@availity/native-form
Advanced tools
Comparing version 2.8.2 to 2.8.3
@@ -6,2 +6,10 @@ # Change Log | ||
## [2.8.3](https://github.com/Availity/sdk-js/compare/@availity/native-form@2.8.2...@availity/native-form@2.8.3) (2019-09-27) | ||
**Note:** Version bump only for package @availity/native-form | ||
## [2.8.2](https://github.com/Availity/sdk-js/compare/@availity/native-form@2.8.1...@availity/native-form@2.8.2) (2019-02-20) | ||
@@ -8,0 +16,0 @@ |
14
index.js
@@ -13,10 +13,8 @@ import flattenObject from './flattenObject'; | ||
) => { | ||
const mergedOptions = Object.assign( | ||
{ | ||
method: 'post', | ||
action: `/ms/api/availity/internal/spc/magneto/sso/v1/${type}/${spaceId}`, | ||
target: '_blank', | ||
}, | ||
formAttributes | ||
); | ||
const mergedOptions = { | ||
method: 'post', | ||
action: `/ms/api/availity/internal/spc/magneto/sso/v1/${type}/${spaceId}`, | ||
target: '_blank', | ||
...formAttributes, | ||
}; | ||
const form = document.createElement('form'); | ||
@@ -23,0 +21,0 @@ Object.keys(mergedOptions).forEach(key => { |
{ | ||
"name": "@availity/native-form", | ||
"version": "2.8.2", | ||
"version": "2.8.3", | ||
"description": "Submit JSON data via a native form, not AJAX. Useful when you need to open a new page with a POST action.", | ||
@@ -20,3 +20,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "8af17c98df2fc4e3bf0b9d73ebc50f1a9c0fd1d9" | ||
"gitHead": "861ec87ed21a02680c7bf4ff616a2bb3e8dea906" | ||
} |
# native form | ||
> Submit JSON data via a native form, not AJAX. Useful when you need to open a new page with a POST action. | ||
[![Version](https://img.shields.io/npm/v/@availity/native-form.svg?style=for-the-badge)](https://www.npmjs.com/package/@availity/native-form) | ||
## Install | ||
@@ -10,26 +13,2 @@ | ||
## Usage | ||
```js | ||
nativeForm(spaceId[, params[, formAttributes][, type]]); | ||
``` | ||
### Required params | ||
- spaceId: String | ||
### Optional params | ||
- params: Object. Additional parameters you want sent in the post. | ||
- formAttributes: Object. Set/override the form attributes like `target`, `method`, and `action`. `method` defaults to "post", `action` will default to "\`/ms/api/availity/internal/spc/magneto/sso/v1/saml/${spaceId}\`", and `target` will default to "_blank". Additional attributes can be defined and should be valid on an HTML form element. | ||
- type: String. Override the magneto integration type. Defaults to "saml" | ||
### | ||
```js | ||
import nativeForm from '@availity/native-form'; | ||
nativeForm('12312312312', {myExtraParam: 'myExtraParamValue'}, {target: '_top'}); | ||
``` | ||
When `nativeForm` is called it wil create a native HTML form and submit it. | ||
## [Documentation](https://availity.github.io/sdk-js/features/native-form) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
11110
216
14