skyflow-react-js
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -10,2 +10,3 @@ import SkyflowElements from './core'; | ||
import RevealElement from './elements/RevealElement'; | ||
import InputFieldElement from './elements/InputField'; | ||
import useRevealContainer from './hooks/RevealContainer'; | ||
@@ -17,3 +18,4 @@ import useMakeSkyflowStyles from './hooks/MakeSkyflowStyles'; | ||
declare const Env: typeof import("skyflow-js/types/utils/common").Env; | ||
declare const ValidationRuleType: typeof import("skyflow-js/types/utils/common").ValidationRuleType; | ||
export { SkyflowElements, CardNumberElement, CVVElement, CardHolderNameElement, ExpirationDateElement, ExpirationMonthElement, ExpirationYearElement, PinElement, RevealElement, useCollectContainer, useMakeSkyflowStyles, useRevealContainer, useCollectListeners, LogLevel, Env, ValidationRuleType, }; | ||
declare const LENGTH_MATCH_RULE = ValidationRuleType.LENGTH_MATCH_RULE; | ||
declare const REGEX_MATCH_RULE = ValidationRuleType.REGEX_MATCH_RULE; | ||
export { SkyflowElements, CardNumberElement, CVVElement, CardHolderNameElement, ExpirationDateElement, ExpirationMonthElement, ExpirationYearElement, PinElement, RevealElement, useCollectContainer, useMakeSkyflowStyles, useRevealContainer, useCollectListeners, LogLevel, Env, LENGTH_MATCH_RULE, REGEX_MATCH_RULE, InputFieldElement }; |
@@ -11,2 +11,3 @@ import SkyflowElements from './core'; | ||
import RevealElement from './elements/RevealElement'; | ||
import InputFieldElement from './elements/InputField'; | ||
import useRevealContainer from './hooks/RevealContainer'; | ||
@@ -18,4 +19,5 @@ import useMakeSkyflowStyles from './hooks/MakeSkyflowStyles'; | ||
const Env = Skyflow.Env; | ||
const ValidationRuleType = Skyflow.ValidationRuleType; | ||
export { SkyflowElements, CardNumberElement, CVVElement, CardHolderNameElement, ExpirationDateElement, ExpirationMonthElement, ExpirationYearElement, PinElement, RevealElement, useCollectContainer, useMakeSkyflowStyles, useRevealContainer, useCollectListeners, LogLevel, Env, ValidationRuleType, }; | ||
const LENGTH_MATCH_RULE = Skyflow.ValidationRuleType.LENGTH_MATCH_RULE; | ||
const REGEX_MATCH_RULE = Skyflow.ValidationRuleType.REGEX_MATCH_RULE; | ||
export { SkyflowElements, CardNumberElement, CVVElement, CardHolderNameElement, ExpirationDateElement, ExpirationMonthElement, ExpirationYearElement, PinElement, RevealElement, useCollectContainer, useMakeSkyflowStyles, useRevealContainer, useCollectListeners, LogLevel, Env, LENGTH_MATCH_RULE, REGEX_MATCH_RULE, InputFieldElement }; | ||
//# sourceMappingURL=index.js.map |
@@ -5,3 +5,3 @@ { | ||
"analyze": false, | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Skyflow React SDK", | ||
@@ -86,3 +86,3 @@ "homepage": "https://github.com/skyflowapi/skyflow-react", | ||
"dependencies": { | ||
"skyflow-js": "^1.18.0" | ||
"skyflow-js": "^1.20.0" | ||
}, | ||
@@ -89,0 +89,0 @@ "peerDependencies": { |
@@ -265,2 +265,6 @@ # skyflow-react-js | ||
- `ExpirationYearElement` | ||
- `InputFieldElement` | ||
The InputFieldElement type is a custom UI element without any built-in validations. See the section on [validations](#validations) for more information on validations. | ||
@@ -410,3 +414,3 @@ Along with Collect Element we can define other options which takes a object of optional parameters as described below: | ||
### 1. Default Validations: | ||
Every Collect Element except of type `INPUT_FIELD` has a set of default validations listed below: | ||
Every Collect Element except of type `InputFieldElement` has a set of default validations listed below: | ||
- `CARD_NUMBER`: Card number validation with checkSum algorithm(Luhn algorithm). | ||
@@ -426,3 +430,3 @@ Available card lengths for defined card types are [12, 13, 14, 15, 16, 17, 18, 19]. | ||
const regexMatchRule = { | ||
type: ValidationRuleType.REGEX_MATCH_RULE, | ||
type: REGEX_MATCH_RULE, | ||
params: { | ||
@@ -439,3 +443,3 @@ regex: RegExp, | ||
const lengthMatchRule = { | ||
type: ValidationRuleType.LENGTH_MATCH_RULE, | ||
type: LENGTH_MATCH_RULE, | ||
params: { | ||
@@ -448,15 +452,2 @@ min: number, // optional | ||
``` | ||
- `ELEMENT_VALUE_MATCH_RULE`: You can use this rule to match the value of one element with another element | ||
```jsx | ||
const elementValueMatchRule = { | ||
type: ValidationRuleType.ELEMENT_VALUE_MATCH_RULE, | ||
params: { | ||
element: CollectElement, | ||
error: string // optional, default error is "VALIDATION FAILED" | ||
} | ||
} | ||
``` | ||
The Sample for using custom validations: | ||
@@ -469,7 +460,7 @@ | ||
*/ | ||
import { CardNumberElement, ValidationRuleType } from "skyflow-react-js"; | ||
import { CardNumberElement, REGEX_MATCH_RULE, LENGTH_MATCH_RULE} from "skyflow-react-js"; | ||
// This rule allows 1 or more alphabets | ||
const alphabetsOnlyRegexRule = { | ||
type: ValidationRuleType.REGEX_MATCH_RULE, | ||
type: REGEX_MATCH_RULE, | ||
params: { | ||
@@ -483,3 +474,3 @@ regex: /^[A-Za-z]+$/, | ||
const lengthRule = { | ||
type: ValidationRuleType.LENGTH_MATCH_RULE, | ||
type: LENGTH_MATCH_RULE, | ||
params: { | ||
@@ -486,0 +477,0 @@ min: 4, |
Sorry, the diff of this file is not supported yet
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
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
65029
55
542
726
Updatedskyflow-js@^1.20.0