@digigov/form 1.0.0-a131264d → 1.0.0-b0737a96
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/{es → 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/{es → 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/{es → cjs}/MultiplicityField/__stories__/WithMinLength.js +32 -11
- package/{es → 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/{es → 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/{es → 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/{es → cjs}/validators/utils/otp.js +14 -3
- package/{es → cjs}/validators/utils/phone.js +28 -6
- package/{es → cjs}/validators/utils/postal_code.js +14 -3
- package/{es → 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.d.ts +1 -1
- 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/Field/FieldBase.mjs +0 -84
- package/Field/FieldBaseContainer.mjs +0 -43
- package/Field/FieldConditional.mjs +0 -62
- package/Field/index.mjs +0 -76
- package/Field/types.mjs +0 -1
- package/Field/utils.mjs +0 -162
- package/FieldArray/FieldArray.stories.mjs +0 -8
- package/FieldArray/__stories__/Default.mjs +0 -90
- package/FieldArray/__stories__/WithExactLength.mjs +0 -90
- package/FieldArray/index.mjs +0 -65
- package/FieldObject/index.mjs +0 -58
- package/Fieldset/FieldsetWithContext.mjs +0 -41
- package/Fieldset/index.mjs +0 -34
- package/Fieldset/types.mjs +0 -1
- package/Form.stories.mjs +0 -3
- package/FormBuilder/FormBuilder.mjs +0 -160
- package/FormBuilder/FormBuilder.stories.mjs +0 -7
- package/FormBuilder/__stories__/Default.mjs +0 -28
- package/FormBuilder/index.mjs +0 -2
- package/FormContext.mjs +0 -5
- package/MultiplicityField/MultiplicityField.stories.mjs +0 -12
- package/MultiplicityField/__stories__/Default.mjs +0 -97
- package/MultiplicityField/__stories__/PreviewDisplay.mjs +0 -83
- package/MultiplicityField/__stories__/WithExactLength.mjs +0 -92
- package/MultiplicityField/__stories__/WithMaxLength.mjs +0 -95
- package/MultiplicityField/__stories__/WithMinAndMaxLength.mjs +0 -96
- package/MultiplicityField/__stories__/WithMinLength.mjs +0 -95
- package/MultiplicityField/add-objects.mjs +0 -160
- package/MultiplicityField/index.mjs +0 -114
- package/Questions/Questions.mjs +0 -84
- package/Questions/Questions.stories.mjs +0 -7
- package/Questions/QuestionsContext.mjs +0 -11
- package/Questions/Step/ReviewStep.mjs +0 -53
- package/Questions/Step/Step.mjs +0 -69
- package/Questions/Step/StepArrayReview.mjs +0 -50
- package/Questions/Step/StepContext.mjs +0 -27
- package/Questions/Step/StepDescription.mjs +0 -27
- package/Questions/Step/StepForm.mjs +0 -48
- package/Questions/Step/StepQuote.mjs +0 -11
- package/Questions/Step/StepTitle.mjs +0 -44
- package/Questions/Step/getAddMoreFields.mjs +0 -22
- package/Questions/Step/index.mjs +0 -13
- package/Questions/Step/types.mjs +0 -1
- package/Questions/__stories__/Default.mjs +0 -108
- package/Questions/getNextStep.mjs +0 -23
- package/Questions/index.mjs +0 -3
- package/Questions/index.spec.mjs +0 -62
- package/Questions/types.mjs +0 -1
- 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.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/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/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/index.js +0 -102
- package/es/validators/utils/number.js +0 -16
- package/es/validators/validators.spec.js +0 -85
- package/index.mjs +0 -8
- package/inputs/AutoComplete/AutoComplete.stories.mjs +0 -7
- package/inputs/AutoComplete/__stories__/Default.mjs +0 -49
- package/inputs/AutoComplete/index.mjs +0 -45
- package/inputs/Checkboxes/Checkboxes.stories.mjs +0 -9
- package/inputs/Checkboxes/__stories__/Conditional.mjs +0 -95
- package/inputs/Checkboxes/__stories__/Default.mjs +0 -42
- package/inputs/Checkboxes/__stories__/WithDivider.mjs +0 -43
- package/inputs/Checkboxes/index.mjs +0 -100
- package/inputs/DateInput/DateInput.stories.mjs +0 -7
- package/inputs/DateInput/__stories__/Default.mjs +0 -25
- package/inputs/DateInput/index.mjs +0 -155
- package/inputs/FileInput/FileInput.stories.mjs +0 -7
- package/inputs/FileInput/__stories__/Default.mjs +0 -22
- package/inputs/FileInput/index.mjs +0 -62
- package/inputs/Input/Input.stories.mjs +0 -15
- package/inputs/Input/__stories__/AFM.mjs +0 -24
- package/inputs/Input/__stories__/Boolean.mjs +0 -25
- package/inputs/Input/__stories__/Default.mjs +0 -25
- package/inputs/Input/__stories__/IBAN.mjs +0 -25
- package/inputs/Input/__stories__/Integer.mjs +0 -33
- package/inputs/Input/__stories__/MobilePhone.mjs +0 -24
- package/inputs/Input/__stories__/PhoneNumber.mjs +0 -24
- package/inputs/Input/__stories__/PostalCode.mjs +0 -27
- package/inputs/Input/__stories__/TextWithCharacterLimit.mjs +0 -31
- package/inputs/Input/index.mjs +0 -75
- package/inputs/Label/Label.stories.mjs +0 -7
- package/inputs/Label/__stories__/Default.mjs +0 -29
- package/inputs/Label/index.mjs +0 -25
- package/inputs/OtpInput/OtpInput.stories.mjs +0 -7
- package/inputs/OtpInput/__stories__/Default.mjs +0 -31
- package/inputs/OtpInput/index.mjs +0 -157
- package/inputs/Radio/Radio.stories.mjs +0 -9
- package/inputs/Radio/__stories__/Conditional.mjs +0 -95
- package/inputs/Radio/__stories__/Default.mjs +0 -47
- package/inputs/Radio/__stories__/WithDivider.mjs +0 -48
- package/inputs/Radio/index.mjs +0 -61
- package/inputs/Select/Select.stories.mjs +0 -7
- package/inputs/Select/__stories__/Default.mjs +0 -53
- package/inputs/Select/index.mjs +0 -32
- package/inputs/index.mjs +0 -8
- package/internal.mjs +0 -34
- package/registry.mjs +0 -136
- package/types.mjs +0 -1
- package/utils.mjs +0 -99
- package/validators/index.mjs +0 -186
- package/validators/types.mjs +0 -1
- package/validators/utils/afm.mjs +0 -35
- package/validators/utils/file.mjs +0 -52
- package/validators/utils/iban.mjs +0 -123
- package/validators/utils/index.mjs +0 -102
- package/validators/utils/int.mjs +0 -20
- package/validators/utils/number.mjs +0 -16
- package/validators/utils/otp.mjs +0 -26
- package/validators/utils/phone.mjs +0 -122
- package/validators/utils/postal_code.mjs +0 -29
- package/validators/utils/text_limit.mjs +0 -54
- package/validators/utils/uuid4.mjs +0 -20
- package/validators/validators.spec.mjs +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
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FormBuilder, { Field } from "../../..";
|
|
3
|
-
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
-
|
|
5
|
-
var _ref = /*#__PURE__*/React.createElement(Button, {
|
|
6
|
-
type: "submit"
|
|
7
|
-
}, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
|
|
8
|
-
|
|
9
|
-
export var WithDivider = function WithDivider() {
|
|
10
|
-
return /*#__PURE__*/React.createElement(FormBuilder, {
|
|
11
|
-
onSubmit: function onSubmit(data) {
|
|
12
|
-
console.log(data);
|
|
13
|
-
}
|
|
14
|
-
}, /*#__PURE__*/React.createElement(Field, {
|
|
15
|
-
key: 'string',
|
|
16
|
-
name: "string",
|
|
17
|
-
type: "choice:single",
|
|
18
|
-
required: true,
|
|
19
|
-
label: {
|
|
20
|
-
primary: 'Ποιά είναι η χώρα της διαμονής σας;'
|
|
21
|
-
},
|
|
22
|
-
extra: {
|
|
23
|
-
options: [{
|
|
24
|
-
label: {
|
|
25
|
-
primary: 'Ελλάδα'
|
|
26
|
-
},
|
|
27
|
-
value: 'greece'
|
|
28
|
-
}, {
|
|
29
|
-
label: {
|
|
30
|
-
primary: 'Κύπρος'
|
|
31
|
-
},
|
|
32
|
-
value: 'cyprus'
|
|
33
|
-
}, {
|
|
34
|
-
label: {
|
|
35
|
-
primary: 'Χώρα της Ευρωπαϊκής Ένωσης'
|
|
36
|
-
},
|
|
37
|
-
value: 'eu'
|
|
38
|
-
}, {
|
|
39
|
-
label: {
|
|
40
|
-
primary: 'Ηνωμένες Πολιτείες της Αμερικής'
|
|
41
|
-
},
|
|
42
|
-
value: 'usa',
|
|
43
|
-
dividerText: 'ή'
|
|
44
|
-
}]
|
|
45
|
-
}
|
|
46
|
-
}), _ref);
|
|
47
|
-
};
|
|
48
|
-
export default WithDivider;
|
package/es/inputs/Radio/index.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["name", "control", "register", "extra", "disabled"],
|
|
4
|
-
_excluded2 = ["label", "value", "show", "disabled", "selected"];
|
|
5
|
-
import React from 'react';
|
|
6
|
-
import { useWatch } from 'react-hook-form';
|
|
7
|
-
import { Field } from "../..";
|
|
8
|
-
import { RadioConditional } from '@digigov/react-core';
|
|
9
|
-
import Hint from '@digigov/react-core/Hint';
|
|
10
|
-
import RadioContainer from '@digigov/react-core/RadioContainer';
|
|
11
|
-
import RadioItem from '@digigov/react-core/RadioItem';
|
|
12
|
-
import { useTranslation } from '@digigov/ui/i18n';
|
|
13
|
-
export var RadioButtonsGroup = function RadioButtonsGroup(_ref) {
|
|
14
|
-
var name = _ref.name,
|
|
15
|
-
control = _ref.control,
|
|
16
|
-
register = _ref.register,
|
|
17
|
-
_ref$extra = _ref.extra,
|
|
18
|
-
options = _ref$extra.options,
|
|
19
|
-
className = _ref$extra.className,
|
|
20
|
-
disabled = _ref.disabled,
|
|
21
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
-
|
|
23
|
-
var currentValue = useWatch({
|
|
24
|
-
control: control,
|
|
25
|
-
name: name
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
var _useTranslation = useTranslation(),
|
|
29
|
-
t = _useTranslation.t;
|
|
30
|
-
|
|
31
|
-
return /*#__PURE__*/React.createElement(RadioContainer, {
|
|
32
|
-
className: className,
|
|
33
|
-
defaultValue: currentValue,
|
|
34
|
-
id: name
|
|
35
|
-
}, options.map(function (_ref2) {
|
|
36
|
-
var label = _ref2.label,
|
|
37
|
-
v = _ref2.value,
|
|
38
|
-
show = _ref2.show,
|
|
39
|
-
optionDisabled = _ref2.disabled,
|
|
40
|
-
selected = _ref2.selected,
|
|
41
|
-
option = _objectWithoutProperties(_ref2, _excluded2);
|
|
42
|
-
|
|
43
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
-
key: "".concat(name, ".").concat(v)
|
|
45
|
-
}, /*#__PURE__*/React.createElement(RadioItem, _extends({}, register(name), {
|
|
46
|
-
value: v,
|
|
47
|
-
disabled: disabled || optionDisabled
|
|
48
|
-
}, option, _extends({}, props, {
|
|
49
|
-
reset: undefined,
|
|
50
|
-
required: undefined,
|
|
51
|
-
'aria-describedby': undefined,
|
|
52
|
-
type: 'radio'
|
|
53
|
-
})), label && label.primary && t(label.primary) || v, label && label.secondary && /*#__PURE__*/React.createElement(Hint, null, t(label.secondary))), selected && selected(), currentValue === v && show && /*#__PURE__*/React.createElement(RadioConditional, null, show.map(function (fieldName) {
|
|
54
|
-
return /*#__PURE__*/React.createElement(Field, {
|
|
55
|
-
name: fieldName,
|
|
56
|
-
key: fieldName
|
|
57
|
-
});
|
|
58
|
-
})));
|
|
59
|
-
}));
|
|
60
|
-
};
|
|
61
|
-
export default RadioButtonsGroup;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FormBuilder, { Field } from "../../..";
|
|
3
|
-
import { Button } from '@digigov/ui/form/Button';
|
|
4
|
-
|
|
5
|
-
var _ref = /*#__PURE__*/React.createElement(Button, {
|
|
6
|
-
type: "submit"
|
|
7
|
-
}, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
|
|
8
|
-
|
|
9
|
-
export var Default = function Default() {
|
|
10
|
-
return /*#__PURE__*/React.createElement(FormBuilder, {
|
|
11
|
-
onSubmit: function onSubmit(data) {
|
|
12
|
-
console.log(data);
|
|
13
|
-
}
|
|
14
|
-
}, /*#__PURE__*/React.createElement(Field, {
|
|
15
|
-
key: 'string',
|
|
16
|
-
name: "string",
|
|
17
|
-
type: "choice:single",
|
|
18
|
-
required: true,
|
|
19
|
-
label: {
|
|
20
|
-
primary: 'Ποιά είναι η χώρα της διαμονής σας;'
|
|
21
|
-
},
|
|
22
|
-
extra: {
|
|
23
|
-
component: 'Select',
|
|
24
|
-
options: [{
|
|
25
|
-
label: {
|
|
26
|
-
primary: ''
|
|
27
|
-
},
|
|
28
|
-
value: ''
|
|
29
|
-
}, {
|
|
30
|
-
label: {
|
|
31
|
-
primary: 'Ελλάδα'
|
|
32
|
-
},
|
|
33
|
-
value: 'greece'
|
|
34
|
-
}, {
|
|
35
|
-
label: {
|
|
36
|
-
primary: 'Κύπρος'
|
|
37
|
-
},
|
|
38
|
-
value: 'cyprus'
|
|
39
|
-
}, {
|
|
40
|
-
label: {
|
|
41
|
-
primary: 'Χώρα της Ευρωπαϊκής Ένωσης'
|
|
42
|
-
},
|
|
43
|
-
value: 'eu'
|
|
44
|
-
}, {
|
|
45
|
-
label: {
|
|
46
|
-
primary: 'Ηνωμένες Πολιτείες της Αμερικής'
|
|
47
|
-
},
|
|
48
|
-
value: 'usa'
|
|
49
|
-
}]
|
|
50
|
-
}
|
|
51
|
-
}), _ref);
|
|
52
|
-
};
|
|
53
|
-
export default Default;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["name", "extra", "disabled"];
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import SelectContainer from '@digigov/react-core/SelectContainer';
|
|
6
|
-
import SelectOption from '@digigov/react-core/SelectOption';
|
|
7
|
-
export var Select = /*#__PURE__*/React.forwardRef(function WrappedSelect(_ref, ref) {
|
|
8
|
-
var name = _ref.name,
|
|
9
|
-
_ref$extra = _ref.extra,
|
|
10
|
-
options = _ref$extra.options,
|
|
11
|
-
className = _ref$extra.className,
|
|
12
|
-
disabled = _ref.disabled,
|
|
13
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
-
|
|
15
|
-
return /*#__PURE__*/React.createElement(SelectContainer, _extends({
|
|
16
|
-
className: className,
|
|
17
|
-
ref: ref,
|
|
18
|
-
name: name,
|
|
19
|
-
disabled: disabled
|
|
20
|
-
}, _extends({}, props, {
|
|
21
|
-
reset: undefined,
|
|
22
|
-
required: undefined
|
|
23
|
-
})), options.map(function (_ref2) {
|
|
24
|
-
var value = _ref2.value,
|
|
25
|
-
label = _ref2.label;
|
|
26
|
-
return /*#__PURE__*/React.createElement(SelectOption, {
|
|
27
|
-
key: value,
|
|
28
|
-
value: value
|
|
29
|
-
}, label && label.primary ? label.primary : value);
|
|
30
|
-
}));
|
|
31
|
-
});
|
|
32
|
-
export default Select;
|
package/es/inputs/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { default as Checkboxes } from "./Checkboxes";
|
|
2
|
-
export { default as DateInput } from "./DateInput";
|
|
3
|
-
export { default as OtpInput } from "./OtpInput";
|
|
4
|
-
export { default as FileInput } from "./FileInput";
|
|
5
|
-
export { default as Input } from "./Input";
|
|
6
|
-
export { default as Label } from "./Label";
|
|
7
|
-
export { default as Radio } from "./Radio";
|
|
8
|
-
export { default as Select } from "./Select";
|
package/es/internal.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export { default as Field } from "./Field";
|
|
2
|
-
export * from "./Field";
|
|
3
|
-
export { default as FieldArray } from "./FieldArray";
|
|
4
|
-
export * from "./FieldArray";
|
|
5
|
-
export { default as FieldConditional } from "./Field/FieldConditional";
|
|
6
|
-
export * from "./Field/FieldConditional";
|
|
7
|
-
export { default as Fieldset } from "./Fieldset";
|
|
8
|
-
export * from "./Fieldset";
|
|
9
|
-
export { default as FormBuilder } from "./FormBuilder";
|
|
10
|
-
export * from "./FormBuilder";
|
|
11
|
-
export { Step } from "./Questions/Step";
|
|
12
|
-
export * from "./Questions/Step";
|
|
13
|
-
export { default as Questions } from "./Questions";
|
|
14
|
-
export * from "./Questions";
|
|
15
|
-
export { default as Checkboxes } from "./inputs/Checkboxes";
|
|
16
|
-
export * from "./inputs/Checkboxes";
|
|
17
|
-
export { default as DateInput } from "./inputs/DateInput";
|
|
18
|
-
export * from "./inputs/DateInput";
|
|
19
|
-
export { default as FileInput } from "./inputs/FileInput";
|
|
20
|
-
export * from "./inputs/FileInput";
|
|
21
|
-
export { default as Input } from "./inputs/Input";
|
|
22
|
-
export * from "./inputs/Input";
|
|
23
|
-
export { default as Label } from "./inputs/Label";
|
|
24
|
-
export * from "./inputs/Label";
|
|
25
|
-
export { default as Radio } from "./inputs/Radio";
|
|
26
|
-
export * from "./inputs/Radio";
|
|
27
|
-
export { default as Select } from "./inputs/Select";
|
|
28
|
-
export * from "./FormContext";
|
|
29
|
-
export * from "./inputs/Select";
|
|
30
|
-
export * from "./inputs";
|
|
31
|
-
export * from "./internal";
|
|
32
|
-
export * from "./types";
|
|
33
|
-
export * from "./utils";
|
|
34
|
-
export * from "./validators";
|
package/es/registry.js
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
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";
|
|
60
|
-
|
|
61
|
-
function lazyImport(pkgImport) {
|
|
62
|
-
// eslint-disable-next-line no-undef
|
|
63
|
-
return new Proxy({}, {
|
|
64
|
-
get: function get(_target, name) {
|
|
65
|
-
if (name === '__esModule' || name === 'default') {
|
|
66
|
-
return pkgImport["default"];
|
|
67
|
-
} else if (name === '*') {
|
|
68
|
-
return pkgImport;
|
|
69
|
-
} else {
|
|
70
|
-
return pkgImport[name];
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export default {
|
|
77
|
-
'@digigov/form/Field/FieldBase': lazyImport(_digigov_form_Field_FieldBase),
|
|
78
|
-
'@digigov/form/Field/FieldBaseContainer': lazyImport(_digigov_form_Field_FieldBaseContainer),
|
|
79
|
-
'@digigov/form/Field/FieldConditional': lazyImport(_digigov_form_Field_FieldConditional),
|
|
80
|
-
'@digigov/form/Field': lazyImport(_digigov_form_Field),
|
|
81
|
-
'@digigov/form/Field/types': lazyImport(_digigov_form_Field_types),
|
|
82
|
-
'@digigov/form/Field/utils': lazyImport(_digigov_form_Field_utils),
|
|
83
|
-
'@digigov/form/FieldArray': lazyImport(_digigov_form_FieldArray),
|
|
84
|
-
'@digigov/form/FieldObject': lazyImport(_digigov_form_FieldObject),
|
|
85
|
-
'@digigov/form/Fieldset/FieldsetWithContext': lazyImport(_digigov_form_Fieldset_FieldsetWithContext),
|
|
86
|
-
'@digigov/form/Fieldset': lazyImport(_digigov_form_Fieldset),
|
|
87
|
-
'@digigov/form/Fieldset/types': lazyImport(_digigov_form_Fieldset_types),
|
|
88
|
-
'@digigov/form/FormBuilder/FormBuilder': lazyImport(_digigov_form_FormBuilder_FormBuilder),
|
|
89
|
-
'@digigov/form/FormBuilder': lazyImport(_digigov_form_FormBuilder),
|
|
90
|
-
'@digigov/form/FormContext': lazyImport(_digigov_form_FormContext),
|
|
91
|
-
'@digigov/form': lazyImport(_digigov_form),
|
|
92
|
-
'@digigov/form/inputs/AutoComplete': lazyImport(_digigov_form_inputs_AutoComplete),
|
|
93
|
-
'@digigov/form/inputs/Checkboxes': lazyImport(_digigov_form_inputs_Checkboxes),
|
|
94
|
-
'@digigov/form/inputs/DateInput': lazyImport(_digigov_form_inputs_DateInput),
|
|
95
|
-
'@digigov/form/inputs/FileInput': lazyImport(_digigov_form_inputs_FileInput),
|
|
96
|
-
'@digigov/form/inputs': lazyImport(_digigov_form_inputs),
|
|
97
|
-
'@digigov/form/inputs/Input': lazyImport(_digigov_form_inputs_Input),
|
|
98
|
-
'@digigov/form/inputs/Label': lazyImport(_digigov_form_inputs_Label),
|
|
99
|
-
'@digigov/form/inputs/OtpInput': lazyImport(_digigov_form_inputs_OtpInput),
|
|
100
|
-
'@digigov/form/inputs/Radio': lazyImport(_digigov_form_inputs_Radio),
|
|
101
|
-
'@digigov/form/inputs/Select': lazyImport(_digigov_form_inputs_Select),
|
|
102
|
-
'@digigov/form/internal': lazyImport(_digigov_form_internal),
|
|
103
|
-
'@digigov/form/MultiplicityField/add-objects': lazyImport(_digigov_form_MultiplicityField_add_objects),
|
|
104
|
-
'@digigov/form/MultiplicityField': lazyImport(_digigov_form_MultiplicityField),
|
|
105
|
-
'@digigov/form/Questions/getNextStep': lazyImport(_digigov_form_Questions_getNextStep),
|
|
106
|
-
'@digigov/form/Questions': lazyImport(_digigov_form_Questions),
|
|
107
|
-
'@digigov/form/Questions/Questions': lazyImport(_digigov_form_Questions_Questions),
|
|
108
|
-
'@digigov/form/Questions/QuestionsContext': lazyImport(_digigov_form_Questions_QuestionsContext),
|
|
109
|
-
'@digigov/form/Questions/Step/getAddMoreFields': lazyImport(_digigov_form_Questions_Step_getAddMoreFields),
|
|
110
|
-
'@digigov/form/Questions/Step': lazyImport(_digigov_form_Questions_Step),
|
|
111
|
-
'@digigov/form/Questions/Step/ReviewStep': lazyImport(_digigov_form_Questions_Step_ReviewStep),
|
|
112
|
-
'@digigov/form/Questions/Step/Step': lazyImport(_digigov_form_Questions_Step_Step),
|
|
113
|
-
'@digigov/form/Questions/Step/StepArrayReview': lazyImport(_digigov_form_Questions_Step_StepArrayReview),
|
|
114
|
-
'@digigov/form/Questions/Step/StepContext': lazyImport(_digigov_form_Questions_Step_StepContext),
|
|
115
|
-
'@digigov/form/Questions/Step/StepDescription': lazyImport(_digigov_form_Questions_Step_StepDescription),
|
|
116
|
-
'@digigov/form/Questions/Step/StepForm': lazyImport(_digigov_form_Questions_Step_StepForm),
|
|
117
|
-
'@digigov/form/Questions/Step/StepQuote': lazyImport(_digigov_form_Questions_Step_StepQuote),
|
|
118
|
-
'@digigov/form/Questions/Step/StepTitle': lazyImport(_digigov_form_Questions_Step_StepTitle),
|
|
119
|
-
'@digigov/form/Questions/Step/types': lazyImport(_digigov_form_Questions_Step_types),
|
|
120
|
-
'@digigov/form/Questions/types': lazyImport(_digigov_form_Questions_types),
|
|
121
|
-
'@digigov/form/types': lazyImport(_digigov_form_types),
|
|
122
|
-
'@digigov/form/utils': lazyImport(_digigov_form_utils),
|
|
123
|
-
'@digigov/form/validators': lazyImport(_digigov_form_validators),
|
|
124
|
-
'@digigov/form/validators/types': lazyImport(_digigov_form_validators_types),
|
|
125
|
-
'@digigov/form/validators/utils/afm': lazyImport(_digigov_form_validators_utils_afm),
|
|
126
|
-
'@digigov/form/validators/utils/file': lazyImport(_digigov_form_validators_utils_file),
|
|
127
|
-
'@digigov/form/validators/utils/iban': lazyImport(_digigov_form_validators_utils_iban),
|
|
128
|
-
'@digigov/form/validators/utils': lazyImport(_digigov_form_validators_utils),
|
|
129
|
-
'@digigov/form/validators/utils/int': lazyImport(_digigov_form_validators_utils_int),
|
|
130
|
-
'@digigov/form/validators/utils/number': lazyImport(_digigov_form_validators_utils_number),
|
|
131
|
-
'@digigov/form/validators/utils/otp': lazyImport(_digigov_form_validators_utils_otp),
|
|
132
|
-
'@digigov/form/validators/utils/phone': lazyImport(_digigov_form_validators_utils_phone),
|
|
133
|
-
'@digigov/form/validators/utils/postal_code': lazyImport(_digigov_form_validators_utils_postal_code),
|
|
134
|
-
'@digigov/form/validators/utils/text_limit': lazyImport(_digigov_form_validators_utils_text_limit),
|
|
135
|
-
'@digigov/form/validators/utils/uuid4': lazyImport(_digigov_form_validators_utils_uuid4)
|
|
136
|
-
};
|
package/es/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/es/validators/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import * as yup from 'yup';
|
|
2
|
-
export * from "./afm";
|
|
3
|
-
export * from "./file";
|
|
4
|
-
export * from "./iban";
|
|
5
|
-
export * from "./otp";
|
|
6
|
-
export * from "./phone";
|
|
7
|
-
export * from "./postal_code";
|
|
8
|
-
export * from "./uuid4";
|
|
9
|
-
export * from "./text_limit";
|
|
10
|
-
export function getYupField(field, yupTypeMap) {
|
|
11
|
-
var yupField = yupTypeMap[(field === null || field === void 0 ? void 0 : field.type) || 'string'] || yupTypeMap['string'];
|
|
12
|
-
return yupField(field);
|
|
13
|
-
}
|
|
14
|
-
export function computeShape(fields, yupTypeMap, validatorRegistry) {
|
|
15
|
-
var fieldSchemas = {};
|
|
16
|
-
var objectFields = {};
|
|
17
|
-
fields.forEach(function (field) {
|
|
18
|
-
var yupField = getYupField(field, yupTypeMap);
|
|
19
|
-
|
|
20
|
-
if (field.condition) {
|
|
21
|
-
var _loop = function _loop(key) {
|
|
22
|
-
var then = void 0,
|
|
23
|
-
otherwise = void 0;
|
|
24
|
-
|
|
25
|
-
if (field.condition[key].then) {
|
|
26
|
-
var _field$condition$key$, _field$condition$key$2;
|
|
27
|
-
|
|
28
|
-
if (((_field$condition$key$ = field.condition[key].then) === null || _field$condition$key$ === void 0 ? void 0 : _field$condition$key$.required) === false) {
|
|
29
|
-
then = yupField.nullable();
|
|
30
|
-
} else if (((_field$condition$key$2 = field.condition[key].then) === null || _field$condition$key$2 === void 0 ? void 0 : _field$condition$key$2.required) === true) {
|
|
31
|
-
then = yupField.nullable().required('form.error.required');
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if (field.condition[key]["else"]) {
|
|
36
|
-
var _field$condition$key$3, _field$condition$key$4;
|
|
37
|
-
|
|
38
|
-
if (((_field$condition$key$3 = field.condition[key]["else"]) === null || _field$condition$key$3 === void 0 ? void 0 : _field$condition$key$3.required) === false) {
|
|
39
|
-
otherwise = yupField.nullable();
|
|
40
|
-
} else if (((_field$condition$key$4 = field.condition[key]["else"]) === null || _field$condition$key$4 === void 0 ? void 0 : _field$condition$key$4.required) === true) {
|
|
41
|
-
otherwise = yupField.nullable().required('form.error.required');
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (then || otherwise) {
|
|
46
|
-
yupField = yupField.when(key, {
|
|
47
|
-
is: function is(val) {
|
|
48
|
-
//@ts-ignore
|
|
49
|
-
var is = field.condition[key].is;
|
|
50
|
-
|
|
51
|
-
if (is === val || Array.isArray(val) && val.includes(is)) {
|
|
52
|
-
return true;
|
|
53
|
-
} else {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
then: then,
|
|
58
|
-
otherwise: otherwise
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
for (var key in field.condition) {
|
|
64
|
-
_loop(key);
|
|
65
|
-
}
|
|
66
|
-
} else if (field.required) {
|
|
67
|
-
yupField = yupField.nullable().required('form.error.required');
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (validatorRegistry && field.type && validatorRegistry[field.type]) {
|
|
71
|
-
validatorRegistry[field.type].forEach(function (validator) {
|
|
72
|
-
yupField = yupField.test(validator);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (field.validators) {
|
|
77
|
-
field.validators.forEach(function (validator) {
|
|
78
|
-
yupField = yupField.test(validator);
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
fieldSchemas[field.key] = yupField;
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
for (var objectKey in objectFields) {
|
|
86
|
-
fieldSchemas[objectKey] = getYupObjectShape(objectFields[objectKey], yupTypeMap, validatorRegistry);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return fieldSchemas;
|
|
90
|
-
}
|
|
91
|
-
export function getYupObjectShape( // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
-
fields, yupTypeMap, validatorRegistry) {
|
|
93
|
-
if (!fields.current) {
|
|
94
|
-
var fieldSchemas = computeShape(fields, yupTypeMap, validatorRegistry);
|
|
95
|
-
return yup.object().shape(fieldSchemas);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return yup.lazy(function () {
|
|
99
|
-
var fieldSchemas = computeShape(Object.values(fields.current), yupTypeMap, validatorRegistry);
|
|
100
|
-
return yup.object().shape(fieldSchemas);
|
|
101
|
-
});
|
|
102
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export function validateNumber(number) {
|
|
2
|
-
return !Number.isNaN(number);
|
|
3
|
-
}
|
|
4
|
-
export var NUMBER_VALIDATOR = function NUMBER_VALIDATOR() {
|
|
5
|
-
return {
|
|
6
|
-
name: 'number-validator',
|
|
7
|
-
message: 'form.error.number',
|
|
8
|
-
test: function test(value) {
|
|
9
|
-
if (value === null) {
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return validateNumber(value);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { validateUUID4, validateIban, validatePostalCode, validatePhoneNumber } from "./utils";
|
|
2
|
-
it('validates wrong uuid4 for empty value', function () {
|
|
3
|
-
expect(validateUUID4('')).toBe(false);
|
|
4
|
-
});
|
|
5
|
-
it('validates wrong uuid4 because of length', function () {
|
|
6
|
-
expect(validateUUID4('9e463bc44a294bab8ee23af6cc3cbbe3')).toBe(false);
|
|
7
|
-
});
|
|
8
|
-
it('validates wrong uuid4 with correct length and wrong form', function () {
|
|
9
|
-
expect(validateUUID4('ab123cd1-1234-ad34-ad45-12345abcdefg')).toBe(false);
|
|
10
|
-
});
|
|
11
|
-
it('validates correct uuid4 validator', function () {
|
|
12
|
-
expect(validateUUID4('9e463bc4-4a29-4bab-8ee2-3af6cc3cbbe3')).toBe(true);
|
|
13
|
-
});
|
|
14
|
-
it('validates correct gr iban', function () {
|
|
15
|
-
expect(validateIban('GR7801100800000008009825202', 'GR')).toBe(true);
|
|
16
|
-
});
|
|
17
|
-
it('validates correct iban with spaces and dashes', function () {
|
|
18
|
-
expect(validateIban('GR 7801-1008 0000-0008 0098-25202', 'GR')).toBe(true);
|
|
19
|
-
});
|
|
20
|
-
it('validates correct foreign iban', function () {
|
|
21
|
-
expect(validateIban('DE75512108001245126199', 'DE')).toBe(true);
|
|
22
|
-
});
|
|
23
|
-
it('validates wrong iban for empty value', function () {
|
|
24
|
-
expect(validateIban('', '')).toBe(false);
|
|
25
|
-
});
|
|
26
|
-
it('validates wrong greek iban for wrong length', function () {
|
|
27
|
-
expect(validateIban('GR78011008000000080098252020', 'gr')).toBe(false);
|
|
28
|
-
});
|
|
29
|
-
it('validates wrong iban for non existing country code', function () {
|
|
30
|
-
expect(validateIban('AAA78011008000000080098252020', 'aaa')).toBe(false);
|
|
31
|
-
});
|
|
32
|
-
it('validates correct greek iban whithout country code', function () {
|
|
33
|
-
expect(validateIban('7801100800000008009825202', '')).toBe(true);
|
|
34
|
-
});
|
|
35
|
-
it('validates wrong postal code without country code', function () {
|
|
36
|
-
expect(validatePostalCode('123', [])).toBe(true);
|
|
37
|
-
});
|
|
38
|
-
it('validates wrong postal code with wrong country code', function () {
|
|
39
|
-
expect(validatePostalCode('123', ['FR'])).toBe(true);
|
|
40
|
-
});
|
|
41
|
-
it('validates wrong postal code with greek country code', function () {
|
|
42
|
-
expect(validatePostalCode('123', ['GR'])).toBe(false);
|
|
43
|
-
});
|
|
44
|
-
it('validates postal code with greek country code', function () {
|
|
45
|
-
expect(validatePostalCode('11143', ['GR'])).toBe(true);
|
|
46
|
-
});
|
|
47
|
-
it('validates phone number type landline with greek country code', function () {
|
|
48
|
-
expect(validatePhoneNumber('2102934896', ['GR'], 'landline')).toBe(true);
|
|
49
|
-
});
|
|
50
|
-
it('validates phone number type landline with ch country code', function () {
|
|
51
|
-
expect(validatePhoneNumber('2102934896', ['CH'], 'landline')).toBe(false);
|
|
52
|
-
});
|
|
53
|
-
it('validates phone number type landline with ch and gr countries code', function () {
|
|
54
|
-
expect(validatePhoneNumber('2102934896', ['GR', 'CH'], 'landline')).toBe(true);
|
|
55
|
-
});
|
|
56
|
-
it('validatesphone number type landline with ch and gr countries code', function () {
|
|
57
|
-
expect(validatePhoneNumber('41446681800', ['GR', 'CH'], 'landline')).toBe(true);
|
|
58
|
-
});
|
|
59
|
-
it('validates phone number type landline with ch and gr countries code but phone number is mobile', function () {
|
|
60
|
-
expect(validatePhoneNumber('2102934896', ['GR', 'CH'], 'mobile')).toBe(false);
|
|
61
|
-
});
|
|
62
|
-
it('validates phone number type mobile with ch and gr countries code', function () {
|
|
63
|
-
expect(validatePhoneNumber('6934100982', ['GR', 'CH'], 'mobile')).toBe(true);
|
|
64
|
-
});
|
|
65
|
-
it('validates phone number type mobile with gr country code', function () {
|
|
66
|
-
expect(validatePhoneNumber('6934100982', ['GR'], 'mobile')).toBe(true);
|
|
67
|
-
});
|
|
68
|
-
it('validates phone number type mobile with ch country code', function () {
|
|
69
|
-
expect(validatePhoneNumber('6934100982', ['CH'], 'mobile')).toBe(false);
|
|
70
|
-
});
|
|
71
|
-
it('validates phone number with no type and ch country code', function () {
|
|
72
|
-
expect(validatePhoneNumber('6934100982', ['CH'], null)).toBe(false);
|
|
73
|
-
});
|
|
74
|
-
it('validates phone number with no type and gr country code', function () {
|
|
75
|
-
expect(validatePhoneNumber('6934100982', ['gr'], null)).toBe(true);
|
|
76
|
-
});
|
|
77
|
-
it('validates phone number with no type and ch country code', function () {
|
|
78
|
-
expect(validatePhoneNumber('41446681800', ['CH'], null)).toBe(true);
|
|
79
|
-
});
|
|
80
|
-
it('validates phone number with no type and gr country code', function () {
|
|
81
|
-
expect(validatePhoneNumber('41446681800', ['gr'], null)).toBe(false);
|
|
82
|
-
});
|
|
83
|
-
it('validates phone number with no type and gr and ch countries code', function () {
|
|
84
|
-
expect(validatePhoneNumber('41446681800', ['gr', 'ch'], null)).toBe(true);
|
|
85
|
-
});
|
package/index.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** @license Digigov v1.0.0-a131264d
|
|
2
|
-
*
|
|
3
|
-
* This source code is licensed under the BSD-2-Clause license found in the
|
|
4
|
-
* LICENSE file in the root directory of this source tree.
|
|
5
|
-
*/
|
|
6
|
-
export * from "./internal";
|
|
7
|
-
import FormBuilder from "./FormBuilder";
|
|
8
|
-
export default FormBuilder;
|