@digigov/form 1.0.0-8ae63a77 → 1.0.0-8b33e4c8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Field/FieldBase.js +14 -31
- package/Field/FieldBaseContainer.js +19 -41
- package/Field/FieldConditional.js +14 -33
- package/Field/index.js +18 -45
- package/Field/package.json +6 -0
- package/Field/types.js +1 -5
- package/Field/utils.js +30 -63
- package/FieldArray/FieldArray.stories.js +5 -42
- package/FieldArray/__stories__/Default.js +11 -32
- package/FieldArray/__stories__/WithExactLength.js +11 -32
- package/FieldArray/index.js +19 -41
- package/FieldArray/package.json +6 -0
- package/FieldObject/index.js +16 -41
- package/FieldObject/package.json +6 -0
- package/Fieldset/FieldsetWithContext.js +13 -35
- package/Fieldset/index.js +21 -51
- package/Fieldset/package.json +6 -0
- package/Fieldset/types.js +1 -5
- package/Form.stories.js +2 -9
- package/FormBuilder/FormBuilder.js +33 -62
- package/FormBuilder/FormBuilder.stories.js +4 -28
- package/FormBuilder/__stories__/Default.js +8 -29
- package/FormBuilder/index.js +2 -11
- package/FormBuilder/package.json +6 -0
- package/FormContext.js +3 -12
- package/MultiplicityField/MultiplicityField.stories.js +9 -98
- package/MultiplicityField/__stories__/Default.js +11 -32
- package/MultiplicityField/__stories__/PreviewDisplay.js +29 -52
- package/MultiplicityField/__stories__/WithExactLength.js +11 -32
- package/MultiplicityField/__stories__/WithMaxLength.js +11 -32
- package/MultiplicityField/__stories__/WithMinAndMaxLength.js +11 -32
- package/MultiplicityField/__stories__/WithMinLength.js +11 -32
- package/MultiplicityField/add-objects.js +25 -49
- package/MultiplicityField/index.js +26 -55
- package/MultiplicityField/package.json +6 -0
- package/Questions/Questions.js +14 -35
- package/Questions/Questions.stories.js +4 -28
- package/Questions/QuestionsContext.js +3 -12
- package/Questions/Step/ReviewStep.js +21 -47
- package/Questions/Step/Step.js +18 -42
- package/Questions/Step/StepArrayReview.js +23 -52
- package/Questions/Step/StepContext.js +3 -13
- package/Questions/Step/StepDescription.js +14 -42
- package/Questions/Step/StepForm.js +19 -45
- package/Questions/Step/StepQuote.js +8 -23
- package/Questions/Step/StepTitle.js +17 -48
- package/Questions/Step/getAddMoreFields.js +2 -11
- package/Questions/Step/index.js +13 -170
- package/Questions/Step/package.json +6 -0
- package/Questions/Step/types.js +1 -5
- package/Questions/__stories__/Default.js +24 -51
- package/Questions/getNextStep.js +1 -8
- package/Questions/index.js +3 -25
- package/Questions/index.spec.js +12 -23
- package/Questions/package.json +6 -0
- package/Questions/types.js +1 -5
- package/{es → cjs}/Field/FieldBase.js +31 -14
- package/cjs/Field/FieldBaseContainer.js +65 -0
- package/cjs/Field/FieldConditional.js +81 -0
- package/cjs/Field/index.js +103 -0
- package/cjs/Field/types.js +5 -0
- package/{es → cjs}/Field/utils.js +63 -30
- package/cjs/FieldArray/FieldArray.stories.js +45 -0
- package/cjs/FieldArray/__stories__/Default.js +111 -0
- package/cjs/FieldArray/__stories__/WithExactLength.js +111 -0
- package/cjs/FieldArray/index.js +87 -0
- package/cjs/FieldObject/index.js +83 -0
- package/cjs/Fieldset/FieldsetWithContext.js +63 -0
- package/cjs/Fieldset/index.js +64 -0
- package/cjs/Fieldset/types.js +5 -0
- package/cjs/Form.stories.js +10 -0
- package/{esm → cjs}/FormBuilder/FormBuilder.js +62 -33
- package/cjs/FormBuilder/FormBuilder.stories.js +31 -0
- package/cjs/FormBuilder/__stories__/Default.js +49 -0
- package/cjs/FormBuilder/index.js +11 -0
- package/cjs/FormContext.js +14 -0
- package/cjs/MultiplicityField/MultiplicityField.stories.js +101 -0
- package/{es → cjs}/MultiplicityField/__stories__/Default.js +32 -11
- package/cjs/MultiplicityField/__stories__/PreviewDisplay.js +106 -0
- package/{esm → cjs}/MultiplicityField/__stories__/WithExactLength.js +32 -11
- package/{es → cjs}/MultiplicityField/__stories__/WithMaxLength.js +32 -11
- package/{es → cjs}/MultiplicityField/__stories__/WithMinAndMaxLength.js +32 -11
- package/{esm → cjs}/MultiplicityField/__stories__/WithMinLength.js +32 -11
- package/{esm → cjs}/MultiplicityField/add-objects.js +49 -25
- package/cjs/MultiplicityField/index.js +143 -0
- package/cjs/Questions/Questions.js +105 -0
- package/cjs/Questions/Questions.stories.js +31 -0
- package/cjs/Questions/QuestionsContext.js +20 -0
- package/cjs/Questions/Step/ReviewStep.js +79 -0
- package/cjs/Questions/Step/Step.js +93 -0
- package/cjs/Questions/Step/StepArrayReview.js +79 -0
- package/{esm → cjs}/Questions/Step/StepContext.js +13 -3
- package/cjs/Questions/Step/StepDescription.js +55 -0
- package/cjs/Questions/Step/StepForm.js +74 -0
- package/cjs/Questions/Step/StepQuote.js +26 -0
- package/cjs/Questions/Step/StepTitle.js +75 -0
- package/{es → cjs}/Questions/Step/getAddMoreFields.js +11 -2
- package/cjs/Questions/Step/index.js +170 -0
- package/cjs/Questions/Step/types.js +5 -0
- package/cjs/Questions/__stories__/Default.js +135 -0
- package/{es → cjs}/Questions/getNextStep.js +8 -1
- package/cjs/Questions/index.js +25 -0
- package/cjs/Questions/index.spec.js +73 -0
- package/cjs/Questions/types.js +5 -0
- package/cjs/index.js +28 -0
- package/cjs/inputs/AutoComplete/AutoComplete.stories.js +31 -0
- package/cjs/inputs/AutoComplete/__stories__/Default.js +71 -0
- package/cjs/inputs/AutoComplete/index.js +68 -0
- package/cjs/inputs/Checkboxes/Checkboxes.stories.js +59 -0
- package/{es → cjs}/inputs/Checkboxes/__stories__/Conditional.js +28 -8
- package/cjs/inputs/Checkboxes/__stories__/Default.js +62 -0
- package/cjs/inputs/Checkboxes/__stories__/WithDivider.js +63 -0
- package/cjs/inputs/Checkboxes/index.js +127 -0
- package/cjs/inputs/DateInput/DateInput.stories.js +31 -0
- package/cjs/inputs/DateInput/__stories__/Default.js +45 -0
- package/cjs/inputs/DateInput/index.js +181 -0
- package/cjs/inputs/FileInput/FileInput.stories.js +31 -0
- package/cjs/inputs/FileInput/__stories__/Default.js +42 -0
- package/cjs/inputs/FileInput/index.js +92 -0
- package/cjs/inputs/Input/Input.stories.js +143 -0
- package/cjs/inputs/Input/__stories__/AFM.js +44 -0
- package/cjs/inputs/Input/__stories__/Boolean.js +45 -0
- package/cjs/inputs/Input/__stories__/Default.js +45 -0
- package/cjs/inputs/Input/__stories__/IBAN.js +45 -0
- package/cjs/inputs/Input/__stories__/Integer.js +53 -0
- package/cjs/inputs/Input/__stories__/MobilePhone.js +44 -0
- package/cjs/inputs/Input/__stories__/PhoneNumber.js +44 -0
- package/cjs/inputs/Input/__stories__/PostalCode.js +47 -0
- package/cjs/inputs/Input/__stories__/TextWithCharacterLimit.js +51 -0
- package/cjs/inputs/Input/index.js +96 -0
- package/cjs/inputs/Label/Label.stories.js +31 -0
- package/cjs/inputs/Label/__stories__/Default.js +49 -0
- package/cjs/inputs/Label/index.js +41 -0
- package/cjs/inputs/OtpInput/OtpInput.stories.js +31 -0
- package/cjs/inputs/OtpInput/__stories__/Default.js +52 -0
- package/cjs/inputs/OtpInput/index.js +182 -0
- package/cjs/inputs/Radio/Radio.stories.js +59 -0
- package/{es → cjs}/inputs/Radio/__stories__/Conditional.js +28 -8
- package/cjs/inputs/Radio/__stories__/Default.js +67 -0
- package/cjs/inputs/Radio/__stories__/WithDivider.js +68 -0
- package/cjs/inputs/Radio/index.js +82 -0
- package/cjs/inputs/Select/Select.stories.js +31 -0
- package/cjs/inputs/Select/__stories__/Default.js +73 -0
- package/cjs/inputs/Select/index.js +49 -0
- package/cjs/inputs/index.js +71 -0
- package/cjs/internal.js +391 -0
- package/cjs/registry.js +208 -0
- package/cjs/types.js +5 -0
- package/{es → cjs}/utils.js +26 -12
- package/{es → cjs}/validators/index.js +54 -26
- package/cjs/validators/types.js +5 -0
- package/{es → cjs}/validators/utils/afm.js +13 -3
- package/{es → cjs}/validators/utils/file.js +12 -2
- package/{esm → cjs}/validators/utils/iban.js +13 -2
- package/cjs/validators/utils/index.js +229 -0
- package/{es → cjs}/validators/utils/int.js +14 -3
- package/cjs/validators/utils/number.js +27 -0
- package/{esm → cjs}/validators/utils/otp.js +14 -3
- package/{esm → cjs}/validators/utils/phone.js +28 -6
- package/{es → cjs}/validators/utils/postal_code.js +14 -3
- package/{esm → cjs}/validators/utils/text_limit.js +14 -3
- package/{es → cjs}/validators/utils/uuid4.js +13 -3
- package/cjs/validators/validators.spec.js +88 -0
- package/index.js +8 -28
- package/inputs/AutoComplete/AutoComplete.stories.js +4 -28
- package/inputs/AutoComplete/__stories__/Default.js +13 -35
- package/inputs/AutoComplete/index.js +12 -35
- package/inputs/AutoComplete/package.json +6 -0
- package/inputs/Checkboxes/Checkboxes.stories.js +6 -56
- package/inputs/Checkboxes/__stories__/Conditional.js +8 -28
- package/inputs/Checkboxes/__stories__/Default.js +8 -28
- package/inputs/Checkboxes/__stories__/WithDivider.js +8 -28
- package/inputs/Checkboxes/index.js +25 -52
- package/inputs/Checkboxes/package.json +6 -0
- package/inputs/DateInput/DateInput.stories.js +4 -28
- package/inputs/DateInput/__stories__/Default.js +8 -28
- package/inputs/DateInput/index.js +26 -52
- package/inputs/DateInput/package.json +6 -0
- package/inputs/FileInput/FileInput.stories.js +4 -28
- package/inputs/FileInput/__stories__/Default.js +8 -28
- package/inputs/FileInput/index.js +22 -52
- package/inputs/FileInput/package.json +6 -0
- package/inputs/Input/Input.stories.js +12 -140
- package/inputs/Input/__stories__/AFM.js +8 -28
- package/inputs/Input/__stories__/Boolean.js +8 -28
- package/inputs/Input/__stories__/Default.js +8 -28
- package/inputs/Input/__stories__/IBAN.js +8 -28
- package/inputs/Input/__stories__/Integer.js +9 -29
- package/inputs/Input/__stories__/MobilePhone.js +8 -28
- package/inputs/Input/__stories__/PhoneNumber.js +8 -28
- package/inputs/Input/__stories__/PostalCode.js +8 -28
- package/inputs/Input/__stories__/TextWithCharacterLimit.js +8 -28
- package/inputs/Input/index.js +19 -40
- package/inputs/Input/package.json +6 -0
- package/inputs/Label/Label.stories.js +4 -28
- package/inputs/Label/__stories__/Default.js +9 -29
- package/inputs/Label/index.js +9 -25
- package/inputs/Label/package.json +6 -0
- package/inputs/OtpInput/OtpInput.stories.js +4 -28
- package/inputs/OtpInput/__stories__/Default.js +9 -30
- package/inputs/OtpInput/index.js +28 -53
- package/inputs/OtpInput/package.json +6 -0
- package/inputs/Radio/Radio.stories.js +6 -56
- package/inputs/Radio/__stories__/Conditional.js +8 -28
- package/inputs/Radio/__stories__/Default.js +8 -28
- package/inputs/Radio/__stories__/WithDivider.js +8 -28
- package/inputs/Radio/index.js +24 -45
- package/inputs/Radio/package.json +6 -0
- package/inputs/Select/Select.stories.js +4 -28
- package/inputs/Select/__stories__/Default.js +8 -28
- package/inputs/Select/index.js +12 -29
- package/inputs/Select/package.json +6 -0
- package/inputs/index.js +8 -71
- package/inputs/package.json +6 -0
- package/internal.js +34 -391
- package/package.json +6 -6
- package/registry.js +61 -133
- package/types.js +1 -5
- package/utils.js +12 -26
- package/validators/index.js +26 -54
- package/validators/package.json +6 -0
- package/validators/types.js +1 -5
- package/validators/utils/afm.js +3 -13
- package/validators/utils/file.js +2 -12
- package/validators/utils/iban.js +2 -13
- package/validators/utils/index.js +12 -139
- package/validators/utils/int.js +3 -14
- package/validators/utils/number.js +3 -14
- package/validators/utils/otp.js +3 -14
- package/validators/utils/package.json +6 -0
- package/validators/utils/phone.js +6 -28
- package/validators/utils/postal_code.js +3 -14
- package/validators/utils/text_limit.js +3 -14
- package/validators/utils/uuid4.js +3 -13
- package/validators/validators.spec.js +29 -32
- package/es/Field/FieldBaseContainer.js +0 -43
- package/es/Field/FieldConditional.js +0 -62
- package/es/Field/index.js +0 -76
- package/es/Field/types.js +0 -1
- package/es/FieldArray/FieldArray.stories.js +0 -8
- package/es/FieldArray/__stories__/Default.js +0 -90
- package/es/FieldArray/__stories__/WithExactLength.js +0 -90
- package/es/FieldArray/index.js +0 -65
- package/es/FieldObject/index.js +0 -58
- package/es/Fieldset/FieldsetWithContext.js +0 -41
- package/es/Fieldset/index.js +0 -34
- package/es/Fieldset/types.js +0 -1
- package/es/Form.stories.js +0 -3
- package/es/FormBuilder/FormBuilder.js +0 -160
- package/es/FormBuilder/FormBuilder.stories.js +0 -7
- package/es/FormBuilder/__stories__/Default.js +0 -28
- package/es/FormBuilder/index.js +0 -2
- package/es/FormContext.js +0 -5
- package/es/MultiplicityField/MultiplicityField.stories.js +0 -12
- package/es/MultiplicityField/__stories__/PreviewDisplay.js +0 -83
- package/es/MultiplicityField/__stories__/WithExactLength.js +0 -92
- package/es/MultiplicityField/__stories__/WithMinLength.js +0 -95
- package/es/MultiplicityField/add-objects.js +0 -160
- package/es/MultiplicityField/index.js +0 -114
- package/es/Questions/Questions.js +0 -84
- package/es/Questions/Questions.stories.js +0 -7
- package/es/Questions/QuestionsContext.js +0 -11
- package/es/Questions/Step/ReviewStep.js +0 -53
- package/es/Questions/Step/Step.js +0 -69
- package/es/Questions/Step/StepArrayReview.js +0 -50
- package/es/Questions/Step/StepContext.js +0 -27
- package/es/Questions/Step/StepDescription.js +0 -27
- package/es/Questions/Step/StepForm.js +0 -48
- package/es/Questions/Step/StepQuote.js +0 -11
- package/es/Questions/Step/StepTitle.js +0 -44
- package/es/Questions/Step/index.js +0 -13
- package/es/Questions/Step/types.js +0 -1
- package/es/Questions/__stories__/Default.js +0 -108
- package/es/Questions/index.js +0 -3
- package/es/Questions/index.spec.js +0 -62
- package/es/Questions/types.js +0 -1
- package/es/index.js +0 -3
- package/es/inputs/AutoComplete/AutoComplete.stories.js +0 -7
- package/es/inputs/AutoComplete/__stories__/Default.js +0 -49
- package/es/inputs/AutoComplete/index.js +0 -45
- package/es/inputs/Checkboxes/Checkboxes.stories.js +0 -9
- package/es/inputs/Checkboxes/__stories__/Default.js +0 -42
- package/es/inputs/Checkboxes/__stories__/WithDivider.js +0 -43
- package/es/inputs/Checkboxes/index.js +0 -100
- package/es/inputs/DateInput/DateInput.stories.js +0 -7
- package/es/inputs/DateInput/__stories__/Default.js +0 -25
- package/es/inputs/DateInput/index.js +0 -155
- package/es/inputs/FileInput/FileInput.stories.js +0 -7
- package/es/inputs/FileInput/__stories__/Default.js +0 -22
- package/es/inputs/FileInput/index.js +0 -62
- package/es/inputs/Input/Input.stories.js +0 -15
- package/es/inputs/Input/__stories__/AFM.js +0 -24
- package/es/inputs/Input/__stories__/Boolean.js +0 -25
- package/es/inputs/Input/__stories__/Default.js +0 -25
- package/es/inputs/Input/__stories__/IBAN.js +0 -25
- package/es/inputs/Input/__stories__/Integer.js +0 -33
- package/es/inputs/Input/__stories__/MobilePhone.js +0 -24
- package/es/inputs/Input/__stories__/PhoneNumber.js +0 -24
- package/es/inputs/Input/__stories__/PostalCode.js +0 -27
- package/es/inputs/Input/__stories__/TextWithCharacterLimit.js +0 -31
- package/es/inputs/Input/index.js +0 -75
- package/es/inputs/Label/Label.stories.js +0 -7
- package/es/inputs/Label/__stories__/Default.js +0 -29
- package/es/inputs/Label/index.js +0 -25
- package/es/inputs/OtpInput/OtpInput.stories.js +0 -7
- package/es/inputs/OtpInput/__stories__/Default.js +0 -31
- package/es/inputs/OtpInput/index.js +0 -157
- package/es/inputs/Radio/Radio.stories.js +0 -9
- package/es/inputs/Radio/__stories__/Default.js +0 -47
- package/es/inputs/Radio/__stories__/WithDivider.js +0 -48
- package/es/inputs/Radio/index.js +0 -61
- package/es/inputs/Select/Select.stories.js +0 -7
- package/es/inputs/Select/__stories__/Default.js +0 -53
- package/es/inputs/Select/index.js +0 -32
- package/es/inputs/index.js +0 -8
- package/es/internal.js +0 -34
- package/es/registry.js +0 -136
- package/es/types.js +0 -1
- package/es/validators/types.js +0 -1
- package/es/validators/utils/iban.js +0 -123
- package/es/validators/utils/index.js +0 -102
- package/es/validators/utils/number.js +0 -16
- package/es/validators/utils/otp.js +0 -26
- package/es/validators/utils/phone.js +0 -122
- package/es/validators/utils/text_limit.js +0 -54
- package/es/validators/validators.spec.js +0 -85
- package/esm/Field/FieldBase.js +0 -84
- package/esm/Field/FieldBaseContainer.js +0 -43
- package/esm/Field/FieldConditional.js +0 -62
- package/esm/Field/index.js +0 -76
- package/esm/Field/index.mdx +0 -6
- package/esm/Field/types.js +0 -1
- package/esm/Field/utils.js +0 -162
- package/esm/FieldArray/FieldArray.stories.js +0 -8
- package/esm/FieldArray/FieldArray.stories.playwright.json +0 -353
- package/esm/FieldArray/__stories__/Default.js +0 -90
- package/esm/FieldArray/__stories__/WithExactLength.js +0 -90
- package/esm/FieldArray/index.js +0 -65
- package/esm/FieldObject/index.js +0 -58
- package/esm/Fieldset/FieldsetWithContext.js +0 -41
- package/esm/Fieldset/index.js +0 -34
- package/esm/Fieldset/types.js +0 -1
- package/esm/Form.stories.js +0 -3
- package/esm/FormBuilder/FormBuilder.mdx +0 -256
- package/esm/FormBuilder/FormBuilder.stories.js +0 -7
- package/esm/FormBuilder/FormBuilder.stories.playwright.json +0 -52
- package/esm/FormBuilder/__stories__/Default.js +0 -28
- package/esm/FormBuilder/index.js +0 -2
- package/esm/FormContext.js +0 -5
- package/esm/MultiplicityField/MultiplicityField.mdx +0 -590
- package/esm/MultiplicityField/MultiplicityField.stories.js +0 -12
- package/esm/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
- package/esm/MultiplicityField/__stories__/Default.js +0 -97
- package/esm/MultiplicityField/__stories__/PreviewDisplay.js +0 -83
- package/esm/MultiplicityField/__stories__/WithMaxLength.js +0 -95
- package/esm/MultiplicityField/__stories__/WithMinAndMaxLength.js +0 -96
- package/esm/MultiplicityField/index.js +0 -114
- package/esm/Questions/Questions.js +0 -84
- package/esm/Questions/Questions.stories.js +0 -7
- package/esm/Questions/QuestionsContext.js +0 -11
- package/esm/Questions/Step/ReviewStep.js +0 -53
- package/esm/Questions/Step/Step.js +0 -69
- package/esm/Questions/Step/StepArrayReview.js +0 -50
- package/esm/Questions/Step/StepDescription.js +0 -27
- package/esm/Questions/Step/StepForm.js +0 -48
- package/esm/Questions/Step/StepQuote.js +0 -11
- package/esm/Questions/Step/StepTitle.js +0 -44
- package/esm/Questions/Step/getAddMoreFields.js +0 -22
- package/esm/Questions/Step/index.js +0 -13
- package/esm/Questions/Step/types.js +0 -1
- package/esm/Questions/__snapshots__/index.spec.tsx.snap +0 -596
- package/esm/Questions/__stories__/Default.js +0 -108
- package/esm/Questions/getNextStep.js +0 -23
- package/esm/Questions/index.js +0 -3
- package/esm/Questions/index.mdx +0 -415
- package/esm/Questions/index.spec.js +0 -62
- package/esm/Questions/types.js +0 -1
- package/esm/create-simple-form.mdx +0 -539
- package/esm/index.js +0 -8
- package/esm/index.mdx +0 -51
- package/esm/inputs/AutoComplete/AutoComplete.stories.js +0 -7
- package/esm/inputs/AutoComplete/__stories__/Default.js +0 -49
- package/esm/inputs/AutoComplete/index.js +0 -45
- package/esm/inputs/Checkboxes/Checkboxes.stories.js +0 -9
- package/esm/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
- package/esm/inputs/Checkboxes/__stories__/Conditional.js +0 -95
- package/esm/inputs/Checkboxes/__stories__/Default.js +0 -42
- package/esm/inputs/Checkboxes/__stories__/WithDivider.js +0 -43
- package/esm/inputs/Checkboxes/index.js +0 -100
- package/esm/inputs/Checkboxes/index.mdx +0 -0
- package/esm/inputs/DateInput/DateInput.stories.js +0 -7
- package/esm/inputs/DateInput/DateInput.stories.playwright.json +0 -72
- package/esm/inputs/DateInput/__stories__/Default.js +0 -25
- package/esm/inputs/DateInput/index.js +0 -155
- package/esm/inputs/FileInput/FileInput.stories.js +0 -7
- package/esm/inputs/FileInput/FileInput.stories.playwright.json +0 -75
- package/esm/inputs/FileInput/__stories__/Default.js +0 -22
- package/esm/inputs/FileInput/index.js +0 -62
- package/esm/inputs/Input/Input.stories.js +0 -15
- package/esm/inputs/Input/Input.stories.playwright.json +0 -376
- package/esm/inputs/Input/__stories__/AFM.js +0 -24
- package/esm/inputs/Input/__stories__/Boolean.js +0 -25
- package/esm/inputs/Input/__stories__/Default.js +0 -25
- package/esm/inputs/Input/__stories__/IBAN.js +0 -25
- package/esm/inputs/Input/__stories__/Integer.js +0 -33
- package/esm/inputs/Input/__stories__/MobilePhone.js +0 -24
- package/esm/inputs/Input/__stories__/PhoneNumber.js +0 -24
- package/esm/inputs/Input/__stories__/PostalCode.js +0 -27
- package/esm/inputs/Input/__stories__/TextWithCharacterLimit.js +0 -31
- package/esm/inputs/Input/index.js +0 -75
- package/esm/inputs/Input/index.mdx +0 -8
- package/esm/inputs/Label/Label.stories.js +0 -7
- package/esm/inputs/Label/Label.stories.playwright.json +0 -40
- package/esm/inputs/Label/__stories__/Default.js +0 -29
- package/esm/inputs/Label/index.js +0 -25
- package/esm/inputs/Label/index.mdx +0 -0
- package/esm/inputs/OtpInput/OtpInput.stories.js +0 -7
- package/esm/inputs/OtpInput/__stories__/Default.js +0 -31
- package/esm/inputs/OtpInput/index.js +0 -157
- package/esm/inputs/Radio/Radio.stories.js +0 -9
- package/esm/inputs/Radio/Radio.stories.playwright.json +0 -73
- package/esm/inputs/Radio/__stories__/Conditional.js +0 -95
- package/esm/inputs/Radio/__stories__/Default.js +0 -47
- package/esm/inputs/Radio/__stories__/WithDivider.js +0 -48
- package/esm/inputs/Radio/index.js +0 -61
- package/esm/inputs/Radio/index.mdx +0 -0
- package/esm/inputs/Select/Select.stories.js +0 -7
- package/esm/inputs/Select/Select.stories.playwright.json +0 -22
- package/esm/inputs/Select/__stories__/Default.js +0 -53
- package/esm/inputs/Select/index.js +0 -32
- package/esm/inputs/index.js +0 -8
- package/esm/installation.mdx +0 -68
- package/esm/internal.js +0 -34
- package/esm/registry.js +0 -136
- package/esm/types.js +0 -1
- package/esm/utils.js +0 -99
- package/esm/validators/index.js +0 -186
- package/esm/validators/types.js +0 -1
- package/esm/validators/utils/afm.js +0 -35
- package/esm/validators/utils/file.js +0 -52
- package/esm/validators/utils/index.js +0 -102
- package/esm/validators/utils/int.js +0 -20
- package/esm/validators/utils/number.js +0 -16
- package/esm/validators/utils/postal_code.js +0 -29
- package/esm/validators/utils/uuid4.js +0 -20
- package/esm/validators/validators.spec.js +0 -85
- /package/{es → cjs}/Field/index.mdx +0 -0
- /package/{es → cjs}/FieldArray/FieldArray.stories.playwright.json +0 -0
- /package/{es → cjs}/FormBuilder/FormBuilder.mdx +0 -0
- /package/{es → cjs}/FormBuilder/FormBuilder.stories.playwright.json +0 -0
- /package/{es → cjs}/MultiplicityField/MultiplicityField.mdx +0 -0
- /package/{es → cjs}/MultiplicityField/MultiplicityField.stories.playwright.json +0 -0
- /package/{es → cjs}/Questions/__snapshots__/index.spec.tsx.snap +0 -0
- /package/{es → cjs}/Questions/index.mdx +0 -0
- /package/{es → cjs}/create-simple-form.mdx +0 -0
- /package/{es → cjs}/index.mdx +0 -0
- /package/{es → cjs}/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -0
- /package/{es → cjs}/inputs/Checkboxes/index.mdx +0 -0
- /package/{es → cjs}/inputs/DateInput/DateInput.stories.playwright.json +0 -0
- /package/{es → cjs}/inputs/FileInput/FileInput.stories.playwright.json +0 -0
- /package/{es → cjs}/inputs/Input/Input.stories.playwright.json +0 -0
- /package/{es → cjs}/inputs/Input/index.mdx +0 -0
- /package/{es → cjs}/inputs/Label/Label.stories.playwright.json +0 -0
- /package/{es → cjs}/inputs/Label/index.mdx +0 -0
- /package/{es → cjs}/inputs/Radio/Radio.stories.playwright.json +0 -0
- /package/{es → cjs}/inputs/Radio/index.mdx +0 -0
- /package/{es → cjs}/inputs/Select/Select.stories.playwright.json +0 -0
- /package/{es → cjs}/installation.mdx +0 -0
package/registry.js
CHANGED
|
@@ -1,133 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var _digigov_form_internal = _interopRequireWildcard(require("@digigov/form/internal"));
|
|
61
|
-
|
|
62
|
-
var _digigov_form_MultiplicityField_add_objects = _interopRequireWildcard(require("@digigov/form/MultiplicityField/add-objects"));
|
|
63
|
-
|
|
64
|
-
var _digigov_form_MultiplicityField = _interopRequireWildcard(require("@digigov/form/MultiplicityField"));
|
|
65
|
-
|
|
66
|
-
var _digigov_form_Questions_getNextStep = _interopRequireWildcard(require("@digigov/form/Questions/getNextStep"));
|
|
67
|
-
|
|
68
|
-
var _digigov_form_Questions = _interopRequireWildcard(require("@digigov/form/Questions"));
|
|
69
|
-
|
|
70
|
-
var _digigov_form_Questions_Questions = _interopRequireWildcard(require("@digigov/form/Questions/Questions"));
|
|
71
|
-
|
|
72
|
-
var _digigov_form_Questions_QuestionsContext = _interopRequireWildcard(require("@digigov/form/Questions/QuestionsContext"));
|
|
73
|
-
|
|
74
|
-
var _digigov_form_Questions_Step_getAddMoreFields = _interopRequireWildcard(require("@digigov/form/Questions/Step/getAddMoreFields"));
|
|
75
|
-
|
|
76
|
-
var _digigov_form_Questions_Step = _interopRequireWildcard(require("@digigov/form/Questions/Step"));
|
|
77
|
-
|
|
78
|
-
var _digigov_form_Questions_Step_ReviewStep = _interopRequireWildcard(require("@digigov/form/Questions/Step/ReviewStep"));
|
|
79
|
-
|
|
80
|
-
var _digigov_form_Questions_Step_Step = _interopRequireWildcard(require("@digigov/form/Questions/Step/Step"));
|
|
81
|
-
|
|
82
|
-
var _digigov_form_Questions_Step_StepArrayReview = _interopRequireWildcard(require("@digigov/form/Questions/Step/StepArrayReview"));
|
|
83
|
-
|
|
84
|
-
var _digigov_form_Questions_Step_StepContext = _interopRequireWildcard(require("@digigov/form/Questions/Step/StepContext"));
|
|
85
|
-
|
|
86
|
-
var _digigov_form_Questions_Step_StepDescription = _interopRequireWildcard(require("@digigov/form/Questions/Step/StepDescription"));
|
|
87
|
-
|
|
88
|
-
var _digigov_form_Questions_Step_StepForm = _interopRequireWildcard(require("@digigov/form/Questions/Step/StepForm"));
|
|
89
|
-
|
|
90
|
-
var _digigov_form_Questions_Step_StepQuote = _interopRequireWildcard(require("@digigov/form/Questions/Step/StepQuote"));
|
|
91
|
-
|
|
92
|
-
var _digigov_form_Questions_Step_StepTitle = _interopRequireWildcard(require("@digigov/form/Questions/Step/StepTitle"));
|
|
93
|
-
|
|
94
|
-
var _digigov_form_Questions_Step_types = _interopRequireWildcard(require("@digigov/form/Questions/Step/types"));
|
|
95
|
-
|
|
96
|
-
var _digigov_form_Questions_types = _interopRequireWildcard(require("@digigov/form/Questions/types"));
|
|
97
|
-
|
|
98
|
-
var _digigov_form_types = _interopRequireWildcard(require("@digigov/form/types"));
|
|
99
|
-
|
|
100
|
-
var _digigov_form_utils = _interopRequireWildcard(require("@digigov/form/utils"));
|
|
101
|
-
|
|
102
|
-
var _digigov_form_validators = _interopRequireWildcard(require("@digigov/form/validators"));
|
|
103
|
-
|
|
104
|
-
var _digigov_form_validators_types = _interopRequireWildcard(require("@digigov/form/validators/types"));
|
|
105
|
-
|
|
106
|
-
var _digigov_form_validators_utils_afm = _interopRequireWildcard(require("@digigov/form/validators/utils/afm"));
|
|
107
|
-
|
|
108
|
-
var _digigov_form_validators_utils_file = _interopRequireWildcard(require("@digigov/form/validators/utils/file"));
|
|
109
|
-
|
|
110
|
-
var _digigov_form_validators_utils_iban = _interopRequireWildcard(require("@digigov/form/validators/utils/iban"));
|
|
111
|
-
|
|
112
|
-
var _digigov_form_validators_utils = _interopRequireWildcard(require("@digigov/form/validators/utils"));
|
|
113
|
-
|
|
114
|
-
var _digigov_form_validators_utils_int = _interopRequireWildcard(require("@digigov/form/validators/utils/int"));
|
|
115
|
-
|
|
116
|
-
var _digigov_form_validators_utils_number = _interopRequireWildcard(require("@digigov/form/validators/utils/number"));
|
|
117
|
-
|
|
118
|
-
var _digigov_form_validators_utils_otp = _interopRequireWildcard(require("@digigov/form/validators/utils/otp"));
|
|
119
|
-
|
|
120
|
-
var _digigov_form_validators_utils_phone = _interopRequireWildcard(require("@digigov/form/validators/utils/phone"));
|
|
121
|
-
|
|
122
|
-
var _digigov_form_validators_utils_postal_code = _interopRequireWildcard(require("@digigov/form/validators/utils/postal_code"));
|
|
123
|
-
|
|
124
|
-
var _digigov_form_validators_utils_text_limit = _interopRequireWildcard(require("@digigov/form/validators/utils/text_limit"));
|
|
125
|
-
|
|
126
|
-
var _digigov_form_validators_utils_uuid4 = _interopRequireWildcard(require("@digigov/form/validators/utils/uuid4"));
|
|
127
|
-
|
|
128
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
129
|
-
|
|
130
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
1
|
+
import * as _digigov_form_Field_FieldBase from "./Field/FieldBase";
|
|
2
|
+
import * as _digigov_form_Field_FieldBaseContainer from "./Field/FieldBaseContainer";
|
|
3
|
+
import * as _digigov_form_Field_FieldConditional from "./Field/FieldConditional";
|
|
4
|
+
import * as _digigov_form_Field from "./Field";
|
|
5
|
+
import * as _digigov_form_Field_types from "./Field/types";
|
|
6
|
+
import * as _digigov_form_Field_utils from "./Field/utils";
|
|
7
|
+
import * as _digigov_form_FieldArray from "./FieldArray";
|
|
8
|
+
import * as _digigov_form_FieldObject from "./FieldObject";
|
|
9
|
+
import * as _digigov_form_Fieldset_FieldsetWithContext from "./Fieldset/FieldsetWithContext";
|
|
10
|
+
import * as _digigov_form_Fieldset from "./Fieldset";
|
|
11
|
+
import * as _digigov_form_Fieldset_types from "./Fieldset/types";
|
|
12
|
+
import * as _digigov_form_FormBuilder_FormBuilder from "./FormBuilder/FormBuilder";
|
|
13
|
+
import * as _digigov_form_FormBuilder from "./FormBuilder";
|
|
14
|
+
import * as _digigov_form_FormContext from "./FormContext";
|
|
15
|
+
import * as _digigov_form from "./";
|
|
16
|
+
import * as _digigov_form_inputs_AutoComplete from "./inputs/AutoComplete";
|
|
17
|
+
import * as _digigov_form_inputs_Checkboxes from "./inputs/Checkboxes";
|
|
18
|
+
import * as _digigov_form_inputs_DateInput from "./inputs/DateInput";
|
|
19
|
+
import * as _digigov_form_inputs_FileInput from "./inputs/FileInput";
|
|
20
|
+
import * as _digigov_form_inputs from "./inputs";
|
|
21
|
+
import * as _digigov_form_inputs_Input from "./inputs/Input";
|
|
22
|
+
import * as _digigov_form_inputs_Label from "./inputs/Label";
|
|
23
|
+
import * as _digigov_form_inputs_OtpInput from "./inputs/OtpInput";
|
|
24
|
+
import * as _digigov_form_inputs_Radio from "./inputs/Radio";
|
|
25
|
+
import * as _digigov_form_inputs_Select from "./inputs/Select";
|
|
26
|
+
import * as _digigov_form_internal from "./internal";
|
|
27
|
+
import * as _digigov_form_MultiplicityField_add_objects from "./MultiplicityField/add-objects";
|
|
28
|
+
import * as _digigov_form_MultiplicityField from "./MultiplicityField";
|
|
29
|
+
import * as _digigov_form_Questions_getNextStep from "./Questions/getNextStep";
|
|
30
|
+
import * as _digigov_form_Questions from "./Questions";
|
|
31
|
+
import * as _digigov_form_Questions_Questions from "./Questions/Questions";
|
|
32
|
+
import * as _digigov_form_Questions_QuestionsContext from "./Questions/QuestionsContext";
|
|
33
|
+
import * as _digigov_form_Questions_Step_getAddMoreFields from "./Questions/Step/getAddMoreFields";
|
|
34
|
+
import * as _digigov_form_Questions_Step from "./Questions/Step";
|
|
35
|
+
import * as _digigov_form_Questions_Step_ReviewStep from "./Questions/Step/ReviewStep";
|
|
36
|
+
import * as _digigov_form_Questions_Step_Step from "./Questions/Step/Step";
|
|
37
|
+
import * as _digigov_form_Questions_Step_StepArrayReview from "./Questions/Step/StepArrayReview";
|
|
38
|
+
import * as _digigov_form_Questions_Step_StepContext from "./Questions/Step/StepContext";
|
|
39
|
+
import * as _digigov_form_Questions_Step_StepDescription from "./Questions/Step/StepDescription";
|
|
40
|
+
import * as _digigov_form_Questions_Step_StepForm from "./Questions/Step/StepForm";
|
|
41
|
+
import * as _digigov_form_Questions_Step_StepQuote from "./Questions/Step/StepQuote";
|
|
42
|
+
import * as _digigov_form_Questions_Step_StepTitle from "./Questions/Step/StepTitle";
|
|
43
|
+
import * as _digigov_form_Questions_Step_types from "./Questions/Step/types";
|
|
44
|
+
import * as _digigov_form_Questions_types from "./Questions/types";
|
|
45
|
+
import * as _digigov_form_types from "./types";
|
|
46
|
+
import * as _digigov_form_utils from "./utils";
|
|
47
|
+
import * as _digigov_form_validators from "./validators";
|
|
48
|
+
import * as _digigov_form_validators_types from "./validators/types";
|
|
49
|
+
import * as _digigov_form_validators_utils_afm from "./validators/utils/afm";
|
|
50
|
+
import * as _digigov_form_validators_utils_file from "./validators/utils/file";
|
|
51
|
+
import * as _digigov_form_validators_utils_iban from "./validators/utils/iban";
|
|
52
|
+
import * as _digigov_form_validators_utils from "./validators/utils";
|
|
53
|
+
import * as _digigov_form_validators_utils_int from "./validators/utils/int";
|
|
54
|
+
import * as _digigov_form_validators_utils_number from "./validators/utils/number";
|
|
55
|
+
import * as _digigov_form_validators_utils_otp from "./validators/utils/otp";
|
|
56
|
+
import * as _digigov_form_validators_utils_phone from "./validators/utils/phone";
|
|
57
|
+
import * as _digigov_form_validators_utils_postal_code from "./validators/utils/postal_code";
|
|
58
|
+
import * as _digigov_form_validators_utils_text_limit from "./validators/utils/text_limit";
|
|
59
|
+
import * as _digigov_form_validators_utils_uuid4 from "./validators/utils/uuid4";
|
|
131
60
|
|
|
132
61
|
function lazyImport(pkgImport) {
|
|
133
62
|
// eslint-disable-next-line no-undef
|
|
@@ -144,7 +73,7 @@ function lazyImport(pkgImport) {
|
|
|
144
73
|
});
|
|
145
74
|
}
|
|
146
75
|
|
|
147
|
-
|
|
76
|
+
export default {
|
|
148
77
|
'@digigov/form/Field/FieldBase': lazyImport(_digigov_form_Field_FieldBase),
|
|
149
78
|
'@digigov/form/Field/FieldBaseContainer': lazyImport(_digigov_form_Field_FieldBaseContainer),
|
|
150
79
|
'@digigov/form/Field/FieldConditional': lazyImport(_digigov_form_Field_FieldConditional),
|
|
@@ -204,5 +133,4 @@ var _default = {
|
|
|
204
133
|
'@digigov/form/validators/utils/postal_code': lazyImport(_digigov_form_validators_utils_postal_code),
|
|
205
134
|
'@digigov/form/validators/utils/text_limit': lazyImport(_digigov_form_validators_utils_text_limit),
|
|
206
135
|
'@digigov/form/validators/utils/uuid4': lazyImport(_digigov_form_validators_utils_uuid4)
|
|
207
|
-
};
|
|
208
|
-
exports["default"] = _default;
|
|
136
|
+
};
|
package/types.js
CHANGED
package/utils.js
CHANGED
|
@@ -1,24 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.yupResolver = void 0;
|
|
11
|
-
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
-
|
|
16
|
-
var _resolvers = require("@hookform/resolvers");
|
|
17
|
-
|
|
18
|
-
var _reactHookForm = require("react-hook-form");
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
19
4
|
|
|
20
5
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
21
6
|
|
|
7
|
+
import { validateFieldsNatively } from '@hookform/resolvers';
|
|
8
|
+
import { appendErrors } from 'react-hook-form';
|
|
9
|
+
|
|
22
10
|
/**
|
|
23
11
|
* Why `path!` ? because it could be `undefined` in some case
|
|
24
12
|
* https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string
|
|
@@ -39,18 +27,18 @@ var parseErrorSchema = function parseErrorSchema(error, validateAllFieldCriteria
|
|
|
39
27
|
if (validateAllFieldCriteria) {
|
|
40
28
|
var types = previous[error.path].types;
|
|
41
29
|
var messages = types && types[error.type];
|
|
42
|
-
previous[error.path] =
|
|
30
|
+
previous[error.path] = appendErrors(error.path, validateAllFieldCriteria, previous, error.type, messages ? [].concat(messages, error.message) : error.message);
|
|
43
31
|
}
|
|
44
32
|
|
|
45
33
|
return previous;
|
|
46
34
|
}, {});
|
|
47
35
|
};
|
|
48
36
|
|
|
49
|
-
var yupResolver = function yupResolver(schema) {
|
|
37
|
+
export var yupResolver = function yupResolver(schema) {
|
|
50
38
|
var schemaOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
51
39
|
var resolverOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
52
40
|
return /*#__PURE__*/function () {
|
|
53
|
-
var _ref = (
|
|
41
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values, context, options) {
|
|
54
42
|
var result, parsed;
|
|
55
43
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
56
44
|
while (1) {
|
|
@@ -64,7 +52,7 @@ var yupResolver = function yupResolver(schema) {
|
|
|
64
52
|
}
|
|
65
53
|
|
|
66
54
|
_context.next = 4;
|
|
67
|
-
return schema[resolverOptions.mode === 'sync' ? 'validateSync' : 'validate'](values, (
|
|
55
|
+
return schema[resolverOptions.mode === 'sync' ? 'validateSync' : 'validate'](values, _extends({
|
|
68
56
|
abortEarly: false
|
|
69
57
|
}, schemaOptions, {
|
|
70
58
|
context: context
|
|
@@ -72,7 +60,7 @@ var yupResolver = function yupResolver(schema) {
|
|
|
72
60
|
|
|
73
61
|
case 4:
|
|
74
62
|
result = _context.sent;
|
|
75
|
-
options.shouldUseNativeValidation &&
|
|
63
|
+
options.shouldUseNativeValidation && validateFieldsNatively({}, options);
|
|
76
64
|
return _context.abrupt("return", {
|
|
77
65
|
values: resolverOptions.rawValues ? values : result,
|
|
78
66
|
errors: {}
|
|
@@ -108,6 +96,4 @@ var yupResolver = function yupResolver(schema) {
|
|
|
108
96
|
return _ref.apply(this, arguments);
|
|
109
97
|
};
|
|
110
98
|
}();
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
exports.yupResolver = yupResolver;
|
|
99
|
+
};
|
package/validators/index.js
CHANGED
|
@@ -1,45 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.getYUPTypeMap = void 0;
|
|
11
|
-
exports.useValidationSchema = useValidationSchema;
|
|
12
|
-
|
|
13
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
14
|
-
|
|
15
|
-
var _react = require("react");
|
|
16
|
-
|
|
17
|
-
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
18
|
-
|
|
19
|
-
var _customParseFormat = _interopRequireDefault(require("dayjs/plugin/customParseFormat"));
|
|
20
|
-
|
|
21
|
-
var yup = _interopRequireWildcard(require("yup"));
|
|
22
|
-
|
|
23
|
-
var _utils = require("@digigov/form/validators/utils");
|
|
24
|
-
|
|
25
|
-
var _int = require("@digigov/form/validators/utils/int");
|
|
26
|
-
|
|
27
|
-
var _number = require("@digigov/form/validators/utils/number");
|
|
28
|
-
|
|
29
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
30
|
-
|
|
31
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
32
|
-
|
|
33
|
-
_dayjs["default"].extend(_customParseFormat["default"]);
|
|
34
|
-
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import dayjs from 'dayjs';
|
|
4
|
+
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
5
|
+
import * as yup from 'yup';
|
|
6
|
+
import { getYupObjectShape, AFM_VALIDATOR, FILE_MAX_SIZE_VALIDATOR, IBAN_VALIDATOR, OTP_VALIDATOR, MOBILE_PHONE_VALIDATOR, PHONE_NUMBER_VALIDATOR, TEXT_LIMIT_VALIDATOR, POSTALCODE_VALIDATOR, UUID4_VALIDATOR } from "./utils";
|
|
7
|
+
import { INT_VALIDATOR } from "./utils/int";
|
|
8
|
+
import { NUMBER_VALIDATOR } from "./utils/number";
|
|
9
|
+
dayjs.extend(customParseFormat);
|
|
35
10
|
var VALID_DATE_FORMATS = ['DD/MM/YYYY'];
|
|
36
11
|
var DATE_CACHE = {};
|
|
37
12
|
|
|
38
13
|
var getDate = function getDate(v) {
|
|
39
|
-
return DATE_CACHE[v] ? DATE_CACHE[v] : (
|
|
14
|
+
return DATE_CACHE[v] ? DATE_CACHE[v] : dayjs(v, VALID_DATE_FORMATS, true);
|
|
40
15
|
};
|
|
41
16
|
|
|
42
|
-
var getYUPTypeMap = function getYUPTypeMap() {
|
|
17
|
+
export var getYUPTypeMap = function getYUPTypeMap() {
|
|
43
18
|
var yupTypeMap = {
|
|
44
19
|
file: function file(field) {
|
|
45
20
|
return yup.mixed().transform(function (value) {
|
|
@@ -48,15 +23,15 @@ var getYUPTypeMap = function getYUPTypeMap() {
|
|
|
48
23
|
}
|
|
49
24
|
|
|
50
25
|
return value;
|
|
51
|
-
}).nullable().test(
|
|
26
|
+
}).nullable().test(FILE_MAX_SIZE_VALIDATOR(field));
|
|
52
27
|
},
|
|
53
28
|
string: yup.string,
|
|
54
29
|
"boolean": yup["boolean"],
|
|
55
30
|
object: function object(field) {
|
|
56
|
-
return
|
|
31
|
+
return getYupObjectShape(field.extra.fields, yupTypeMap);
|
|
57
32
|
},
|
|
58
33
|
array: function array(field) {
|
|
59
|
-
if ((
|
|
34
|
+
if (_typeof(field.extra.of) === 'object') {
|
|
60
35
|
// else if the field is an object then it is a scalar type
|
|
61
36
|
// eg. number, string etc.
|
|
62
37
|
var arrayValidator = yup.array().of(yupTypeMap[field.extra.of.type](field.extra.of)).required(field.required);
|
|
@@ -89,40 +64,40 @@ var getYUPTypeMap = function getYUPTypeMap() {
|
|
|
89
64
|
"int": function int() {
|
|
90
65
|
return yup.mixed().transform(function (_, val) {
|
|
91
66
|
return val !== '' ? Number(val) : null;
|
|
92
|
-
}).test(
|
|
67
|
+
}).test(NUMBER_VALIDATOR()).test(INT_VALIDATOR());
|
|
93
68
|
},
|
|
94
69
|
email: function email() {
|
|
95
70
|
return yup.string().email('form.error.email');
|
|
96
71
|
},
|
|
97
72
|
afm: function afm() {
|
|
98
|
-
return yup.string().test(
|
|
73
|
+
return yup.string().test(AFM_VALIDATOR);
|
|
99
74
|
},
|
|
100
75
|
uuid4: function uuid4() {
|
|
101
|
-
return yup.string().test(
|
|
76
|
+
return yup.string().test(UUID4_VALIDATOR);
|
|
102
77
|
},
|
|
103
78
|
iban: function iban(field) {
|
|
104
|
-
return yup.string().test(
|
|
79
|
+
return yup.string().test(IBAN_VALIDATOR(field));
|
|
105
80
|
},
|
|
106
81
|
otp: function otp(field) {
|
|
107
|
-
return yup.string().test(
|
|
82
|
+
return yup.string().test(OTP_VALIDATOR(field));
|
|
108
83
|
},
|
|
109
84
|
text: function text(field) {
|
|
110
85
|
var _field$extra, _field$extra$limit, _field$extra2, _field$extra2$limit;
|
|
111
86
|
|
|
112
87
|
if (field !== null && field !== void 0 && (_field$extra = field.extra) !== null && _field$extra !== void 0 && (_field$extra$limit = _field$extra.limit) !== null && _field$extra$limit !== void 0 && _field$extra$limit.max || !!(field !== null && field !== void 0 && (_field$extra2 = field.extra) !== null && _field$extra2 !== void 0 && (_field$extra2$limit = _field$extra2.limit) !== null && _field$extra2$limit !== void 0 && _field$extra2$limit.min)) {
|
|
113
|
-
return yup.string().test(
|
|
88
|
+
return yup.string().test(TEXT_LIMIT_VALIDATOR(field));
|
|
114
89
|
} else {
|
|
115
90
|
return yup.string();
|
|
116
91
|
}
|
|
117
92
|
},
|
|
118
93
|
postal_code: function postal_code(field) {
|
|
119
|
-
return yup.string().test(
|
|
94
|
+
return yup.string().test(POSTALCODE_VALIDATOR(field));
|
|
120
95
|
},
|
|
121
96
|
mobile_phone: function mobile_phone() {
|
|
122
|
-
return yup.string().test(
|
|
97
|
+
return yup.string().test(MOBILE_PHONE_VALIDATOR);
|
|
123
98
|
},
|
|
124
99
|
phone_number: function phone_number(field) {
|
|
125
|
-
return yup.string().test(
|
|
100
|
+
return yup.string().test(PHONE_NUMBER_VALIDATOR(field));
|
|
126
101
|
},
|
|
127
102
|
'choice:multiple': function choiceMultiple() {
|
|
128
103
|
return yup.array().of(yup.string()).nullable();
|
|
@@ -202,13 +177,10 @@ var getYUPTypeMap = function getYUPTypeMap() {
|
|
|
202
177
|
};
|
|
203
178
|
return yupTypeMap;
|
|
204
179
|
};
|
|
205
|
-
|
|
206
|
-
exports.getYUPTypeMap = getYUPTypeMap;
|
|
207
|
-
|
|
208
180
|
// Create a yup validation schema from given fields input
|
|
209
|
-
function useValidationSchema(fields, validatorRegistry) {
|
|
210
|
-
return
|
|
181
|
+
export function useValidationSchema(fields, validatorRegistry) {
|
|
182
|
+
return useMemo(function () {
|
|
211
183
|
var yupTypeMap = getYUPTypeMap();
|
|
212
|
-
return
|
|
184
|
+
return getYupObjectShape(fields, yupTypeMap, validatorRegistry);
|
|
213
185
|
}, []);
|
|
214
186
|
}
|
package/validators/types.js
CHANGED
package/validators/utils/afm.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.AFM_VALIDATOR = void 0;
|
|
7
|
-
exports.validateAFM = validateAFM;
|
|
8
|
-
|
|
9
|
-
function validateAFM(afm) {
|
|
1
|
+
export function validateAFM(afm) {
|
|
10
2
|
if (afm.length !== 9) {
|
|
11
3
|
// "afm should be 9 digits"
|
|
12
4
|
return false;
|
|
@@ -30,8 +22,7 @@ function validateAFM(afm) {
|
|
|
30
22
|
var valid = calc % 10 === d9;
|
|
31
23
|
return valid;
|
|
32
24
|
}
|
|
33
|
-
|
|
34
|
-
var AFM_VALIDATOR = {
|
|
25
|
+
export var AFM_VALIDATOR = {
|
|
35
26
|
name: 'afm-validator',
|
|
36
27
|
message: 'form.error.afm',
|
|
37
28
|
test: function test(value) {
|
|
@@ -41,5 +32,4 @@ var AFM_VALIDATOR = {
|
|
|
41
32
|
|
|
42
33
|
return true;
|
|
43
34
|
}
|
|
44
|
-
};
|
|
45
|
-
exports.AFM_VALIDATOR = AFM_VALIDATOR;
|
|
35
|
+
};
|
package/validators/utils/file.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.FILE_MAX_SIZE_VALIDATOR = void 0;
|
|
7
|
-
|
|
8
1
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
9
2
|
|
|
10
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -12,8 +5,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
12
5
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
13
6
|
|
|
14
7
|
var DEFAULT_FILE_MAX_SIZE = 10000000;
|
|
15
|
-
|
|
16
|
-
var FILE_MAX_SIZE_VALIDATOR = function FILE_MAX_SIZE_VALIDATOR(field) {
|
|
8
|
+
export var FILE_MAX_SIZE_VALIDATOR = function FILE_MAX_SIZE_VALIDATOR(field) {
|
|
17
9
|
return {
|
|
18
10
|
name: 'file-max-size-validator',
|
|
19
11
|
message: 'form.error.file_size',
|
|
@@ -57,6 +49,4 @@ var FILE_MAX_SIZE_VALIDATOR = function FILE_MAX_SIZE_VALIDATOR(field) {
|
|
|
57
49
|
return true;
|
|
58
50
|
}
|
|
59
51
|
};
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
exports.FILE_MAX_SIZE_VALIDATOR = FILE_MAX_SIZE_VALIDATOR;
|
|
52
|
+
};
|
package/validators/utils/iban.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.IBAN_VALIDATOR = void 0;
|
|
7
|
-
exports.validateIban = validateIban;
|
|
8
|
-
|
|
9
|
-
function validateIban(value, countryCode) {
|
|
1
|
+
export function validateIban(value, countryCode) {
|
|
10
2
|
value = value.replace(/\s/g, '').replace(/-/g, '');
|
|
11
3
|
|
|
12
4
|
if (value.match(/^[0-9]*$/i)) {
|
|
@@ -35,8 +27,7 @@ function validateIban(value, countryCode) {
|
|
|
35
27
|
|
|
36
28
|
return true;
|
|
37
29
|
}
|
|
38
|
-
|
|
39
|
-
var IBAN_VALIDATOR = function IBAN_VALIDATOR(field) {
|
|
30
|
+
export var IBAN_VALIDATOR = function IBAN_VALIDATOR(field) {
|
|
40
31
|
var _field$extra;
|
|
41
32
|
|
|
42
33
|
var countryCode = field === null || field === void 0 ? void 0 : (_field$extra = field.extra) === null || _field$extra === void 0 ? void 0 : _field$extra.country;
|
|
@@ -52,8 +43,6 @@ var IBAN_VALIDATOR = function IBAN_VALIDATOR(field) {
|
|
|
52
43
|
}
|
|
53
44
|
};
|
|
54
45
|
};
|
|
55
|
-
|
|
56
|
-
exports.IBAN_VALIDATOR = IBAN_VALIDATOR;
|
|
57
46
|
var ibanCountryCodesLengths = {
|
|
58
47
|
AD: 24,
|
|
59
48
|
AT: 20,
|