@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/Questions/Step/index.js
CHANGED
|
@@ -1,170 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (key === "default" || key === "__esModule") return;
|
|
15
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
16
|
-
if (key in exports && exports[key] === _ReviewStep[key]) return;
|
|
17
|
-
Object.defineProperty(exports, key, {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function get() {
|
|
20
|
-
return _ReviewStep[key];
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
var _Step = _interopRequireWildcard(require("@digigov/form/Questions/Step/Step"));
|
|
26
|
-
|
|
27
|
-
Object.keys(_Step).forEach(function (key) {
|
|
28
|
-
if (key === "default" || key === "__esModule") return;
|
|
29
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
30
|
-
if (key in exports && exports[key] === _Step[key]) return;
|
|
31
|
-
Object.defineProperty(exports, key, {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function get() {
|
|
34
|
-
return _Step[key];
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
var _StepArrayReview = require("@digigov/form/Questions/Step/StepArrayReview");
|
|
40
|
-
|
|
41
|
-
Object.keys(_StepArrayReview).forEach(function (key) {
|
|
42
|
-
if (key === "default" || key === "__esModule") return;
|
|
43
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
44
|
-
if (key in exports && exports[key] === _StepArrayReview[key]) return;
|
|
45
|
-
Object.defineProperty(exports, key, {
|
|
46
|
-
enumerable: true,
|
|
47
|
-
get: function get() {
|
|
48
|
-
return _StepArrayReview[key];
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
var _StepContext = require("@digigov/form/Questions/Step/StepContext");
|
|
54
|
-
|
|
55
|
-
Object.keys(_StepContext).forEach(function (key) {
|
|
56
|
-
if (key === "default" || key === "__esModule") return;
|
|
57
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
58
|
-
if (key in exports && exports[key] === _StepContext[key]) return;
|
|
59
|
-
Object.defineProperty(exports, key, {
|
|
60
|
-
enumerable: true,
|
|
61
|
-
get: function get() {
|
|
62
|
-
return _StepContext[key];
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
var _StepDescription = require("@digigov/form/Questions/Step/StepDescription");
|
|
68
|
-
|
|
69
|
-
Object.keys(_StepDescription).forEach(function (key) {
|
|
70
|
-
if (key === "default" || key === "__esModule") return;
|
|
71
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
72
|
-
if (key in exports && exports[key] === _StepDescription[key]) return;
|
|
73
|
-
Object.defineProperty(exports, key, {
|
|
74
|
-
enumerable: true,
|
|
75
|
-
get: function get() {
|
|
76
|
-
return _StepDescription[key];
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
var _StepForm = require("@digigov/form/Questions/Step/StepForm");
|
|
82
|
-
|
|
83
|
-
Object.keys(_StepForm).forEach(function (key) {
|
|
84
|
-
if (key === "default" || key === "__esModule") return;
|
|
85
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
86
|
-
if (key in exports && exports[key] === _StepForm[key]) return;
|
|
87
|
-
Object.defineProperty(exports, key, {
|
|
88
|
-
enumerable: true,
|
|
89
|
-
get: function get() {
|
|
90
|
-
return _StepForm[key];
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
var _StepQuote = require("@digigov/form/Questions/Step/StepQuote");
|
|
96
|
-
|
|
97
|
-
Object.keys(_StepQuote).forEach(function (key) {
|
|
98
|
-
if (key === "default" || key === "__esModule") return;
|
|
99
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
100
|
-
if (key in exports && exports[key] === _StepQuote[key]) return;
|
|
101
|
-
Object.defineProperty(exports, key, {
|
|
102
|
-
enumerable: true,
|
|
103
|
-
get: function get() {
|
|
104
|
-
return _StepQuote[key];
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
var _StepTitle = require("@digigov/form/Questions/Step/StepTitle");
|
|
110
|
-
|
|
111
|
-
Object.keys(_StepTitle).forEach(function (key) {
|
|
112
|
-
if (key === "default" || key === "__esModule") return;
|
|
113
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
114
|
-
if (key in exports && exports[key] === _StepTitle[key]) return;
|
|
115
|
-
Object.defineProperty(exports, key, {
|
|
116
|
-
enumerable: true,
|
|
117
|
-
get: function get() {
|
|
118
|
-
return _StepTitle[key];
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
var _getAddMoreFields = require("@digigov/form/Questions/Step/getAddMoreFields");
|
|
124
|
-
|
|
125
|
-
Object.keys(_getAddMoreFields).forEach(function (key) {
|
|
126
|
-
if (key === "default" || key === "__esModule") return;
|
|
127
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
128
|
-
if (key in exports && exports[key] === _getAddMoreFields[key]) return;
|
|
129
|
-
Object.defineProperty(exports, key, {
|
|
130
|
-
enumerable: true,
|
|
131
|
-
get: function get() {
|
|
132
|
-
return _getAddMoreFields[key];
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
var _Step2 = require("@digigov/form/Questions/Step/");
|
|
138
|
-
|
|
139
|
-
Object.keys(_Step2).forEach(function (key) {
|
|
140
|
-
if (key === "default" || key === "__esModule") return;
|
|
141
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
142
|
-
if (key in exports && exports[key] === _Step2[key]) return;
|
|
143
|
-
Object.defineProperty(exports, key, {
|
|
144
|
-
enumerable: true,
|
|
145
|
-
get: function get() {
|
|
146
|
-
return _Step2[key];
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
var _types = require("@digigov/form/Questions/Step/types");
|
|
152
|
-
|
|
153
|
-
Object.keys(_types).forEach(function (key) {
|
|
154
|
-
if (key === "default" || key === "__esModule") return;
|
|
155
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
156
|
-
if (key in exports && exports[key] === _types[key]) return;
|
|
157
|
-
Object.defineProperty(exports, key, {
|
|
158
|
-
enumerable: true,
|
|
159
|
-
get: function get() {
|
|
160
|
-
return _types[key];
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
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); }
|
|
166
|
-
|
|
167
|
-
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; }
|
|
168
|
-
|
|
169
|
-
var _default = _Step["default"];
|
|
170
|
-
exports["default"] = _default;
|
|
1
|
+
export * from "./ReviewStep";
|
|
2
|
+
export * from "./Step";
|
|
3
|
+
export * from "./StepArrayReview";
|
|
4
|
+
export * from "./StepContext";
|
|
5
|
+
export * from "./StepDescription";
|
|
6
|
+
export * from "./StepForm";
|
|
7
|
+
export * from "./StepQuote";
|
|
8
|
+
export * from "./StepTitle";
|
|
9
|
+
export * from "./getAddMoreFields";
|
|
10
|
+
export * from "./";
|
|
11
|
+
export * from "./types";
|
|
12
|
+
import Step from "./Step";
|
|
13
|
+
export default Step;
|
package/Questions/Step/types.js
CHANGED
|
@@ -1,37 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
exports.Default = Default;
|
|
11
|
-
exports["default"] = void 0;
|
|
12
|
-
|
|
13
|
-
var _react = _interopRequireDefault(require("react"));
|
|
14
|
-
|
|
15
|
-
var _form = require("@digigov/form");
|
|
16
|
-
|
|
17
|
-
var _Questions = _interopRequireWildcard(require("@digigov/form/Questions"));
|
|
18
|
-
|
|
19
|
-
var _Header = _interopRequireDefault(require("@digigov/ui/app/Header"));
|
|
20
|
-
|
|
21
|
-
var _HeaderContent = _interopRequireDefault(require("@digigov/ui/app/Header/HeaderContent"));
|
|
22
|
-
|
|
23
|
-
var _HeaderSection = _interopRequireDefault(require("@digigov/ui/app/Header/HeaderSection"));
|
|
24
|
-
|
|
25
|
-
var _Footer = _interopRequireDefault(require("@digigov/ui/govgr/Footer"));
|
|
26
|
-
|
|
27
|
-
var _GovGRLogo = _interopRequireDefault(require("@digigov/ui/govgr/GovGRLogo"));
|
|
28
|
-
|
|
29
|
-
var _Basic = _interopRequireWildcard(require("@digigov/ui/layouts/Basic"));
|
|
30
|
-
|
|
31
|
-
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); }
|
|
32
|
-
|
|
33
|
-
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; }
|
|
34
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Field } from "../..";
|
|
3
|
+
import Questions, { Step, StepForm, StepTitle } from "./..";
|
|
4
|
+
import Header from '@digigov/ui/app/Header';
|
|
5
|
+
import HeaderContent from '@digigov/ui/app/Header/HeaderContent';
|
|
6
|
+
import HeaderSection from '@digigov/ui/app/Header/HeaderSection';
|
|
7
|
+
import GovGRFooter from '@digigov/ui/govgr/Footer';
|
|
8
|
+
import GovGRLogo from '@digigov/ui/govgr/GovGRLogo';
|
|
9
|
+
import BasicLayout, { Top, Content, Main, Bottom } from '@digigov/ui/layouts/Basic';
|
|
35
10
|
var steps = [{
|
|
36
11
|
name: 'age',
|
|
37
12
|
title: 'What is your age?',
|
|
@@ -86,43 +61,43 @@ var steps = [{
|
|
|
86
61
|
}]
|
|
87
62
|
}];
|
|
88
63
|
|
|
89
|
-
var _ref = /*#__PURE__*/
|
|
64
|
+
var _ref = /*#__PURE__*/React.createElement(Top, null, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(HeaderContent, null, /*#__PURE__*/React.createElement(HeaderSection, null, /*#__PURE__*/React.createElement(GovGRLogo, {
|
|
90
65
|
href: "#"
|
|
91
66
|
})))));
|
|
92
67
|
|
|
93
|
-
var _ref2 = /*#__PURE__*/
|
|
68
|
+
var _ref2 = /*#__PURE__*/React.createElement(Step, {
|
|
94
69
|
name: "age"
|
|
95
|
-
}, /*#__PURE__*/
|
|
70
|
+
}, /*#__PURE__*/React.createElement(StepTitle, null), /*#__PURE__*/React.createElement(StepForm, {
|
|
96
71
|
submitButton: true
|
|
97
|
-
}, /*#__PURE__*/
|
|
72
|
+
}, /*#__PURE__*/React.createElement(Field, {
|
|
98
73
|
key: "age",
|
|
99
74
|
name: "age"
|
|
100
75
|
})));
|
|
101
76
|
|
|
102
|
-
var _ref3 = /*#__PURE__*/
|
|
77
|
+
var _ref3 = /*#__PURE__*/React.createElement(Step, {
|
|
103
78
|
name: "citizen-underage"
|
|
104
|
-
}, /*#__PURE__*/
|
|
79
|
+
}, /*#__PURE__*/React.createElement(StepTitle, null), /*#__PURE__*/React.createElement(StepForm, {
|
|
105
80
|
submitButton: true
|
|
106
|
-
}, /*#__PURE__*/
|
|
81
|
+
}, /*#__PURE__*/React.createElement(Field, {
|
|
107
82
|
key: "citizen-underage-student",
|
|
108
83
|
name: "citizen-underage-student"
|
|
109
84
|
})));
|
|
110
85
|
|
|
111
|
-
var _ref4 = /*#__PURE__*/
|
|
86
|
+
var _ref4 = /*#__PURE__*/React.createElement(Step, {
|
|
112
87
|
name: "citizen-adult"
|
|
113
|
-
}, /*#__PURE__*/
|
|
88
|
+
}, /*#__PURE__*/React.createElement(StepTitle, {
|
|
114
89
|
backButton: "\u03A0\u03AF\u03C3\u03C9"
|
|
115
|
-
}), /*#__PURE__*/
|
|
90
|
+
}), /*#__PURE__*/React.createElement(StepForm, {
|
|
116
91
|
submitButton: true
|
|
117
|
-
}, /*#__PURE__*/
|
|
92
|
+
}, /*#__PURE__*/React.createElement(Field, {
|
|
118
93
|
key: "citizen-adult-employed",
|
|
119
94
|
name: "citizen-adult-employed"
|
|
120
95
|
})));
|
|
121
96
|
|
|
122
|
-
var _ref5 = /*#__PURE__*/
|
|
97
|
+
var _ref5 = /*#__PURE__*/React.createElement(Bottom, null, /*#__PURE__*/React.createElement(GovGRFooter, null));
|
|
123
98
|
|
|
124
|
-
function Default() {
|
|
125
|
-
return /*#__PURE__*/
|
|
99
|
+
export function Default() {
|
|
100
|
+
return /*#__PURE__*/React.createElement(BasicLayout, null, _ref, /*#__PURE__*/React.createElement(Content, null, /*#__PURE__*/React.createElement(Main, null, /*#__PURE__*/React.createElement(Questions, {
|
|
126
101
|
name: 'example',
|
|
127
102
|
steps: steps,
|
|
128
103
|
onSubmit: function onSubmit(data) {
|
|
@@ -130,6 +105,4 @@ function Default() {
|
|
|
130
105
|
}
|
|
131
106
|
}, _ref2, _ref3, _ref4))), _ref5);
|
|
132
107
|
}
|
|
133
|
-
|
|
134
|
-
var _default = Default;
|
|
135
|
-
exports["default"] = _default;
|
|
108
|
+
export default Default;
|
package/Questions/getNextStep.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getNextStep = getNextStep;
|
|
7
|
-
|
|
8
|
-
function getNextStep(currentStep, steps, data) {
|
|
1
|
+
export function getNextStep(currentStep, steps, data) {
|
|
9
2
|
if (currentStep.nextStep) {
|
|
10
3
|
var nextStepName = currentStep.nextStep(data);
|
|
11
4
|
|
package/Questions/index.js
CHANGED
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _exportNames = {};
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
|
|
9
|
-
var _Questions = require("@digigov/form/Questions/Questions");
|
|
10
|
-
|
|
11
|
-
var _Step = require("@digigov/form/Questions/Step");
|
|
12
|
-
|
|
13
|
-
Object.keys(_Step).forEach(function (key) {
|
|
14
|
-
if (key === "default" || key === "__esModule") return;
|
|
15
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
16
|
-
if (key in exports && exports[key] === _Step[key]) return;
|
|
17
|
-
Object.defineProperty(exports, key, {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function get() {
|
|
20
|
-
return _Step[key];
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
var _default = _Questions.Questions;
|
|
25
|
-
exports["default"] = _default;
|
|
1
|
+
import { Questions } from "./Questions";
|
|
2
|
+
export default Questions;
|
|
3
|
+
export * from "./Step";
|
package/Questions/index.spec.js
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _enzyme = require("enzyme");
|
|
8
|
-
|
|
9
|
-
var _form = require("@digigov/form");
|
|
10
|
-
|
|
11
|
-
var _Questions = _interopRequireWildcard(require("@digigov/form/Questions"));
|
|
12
|
-
|
|
13
|
-
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); }
|
|
14
|
-
|
|
15
|
-
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; }
|
|
16
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
import { Field } from "./..";
|
|
4
|
+
import { Step, StepForm, StepQuote, StepTitle } from "./";
|
|
5
|
+
import Questions from "./";
|
|
17
6
|
var steps = [{
|
|
18
7
|
name: 'intro',
|
|
19
8
|
caption: 'intro.caption',
|
|
@@ -44,26 +33,26 @@ var steps = [{
|
|
|
44
33
|
}]
|
|
45
34
|
}];
|
|
46
35
|
|
|
47
|
-
var _ref = /*#__PURE__*/React.createElement(
|
|
36
|
+
var _ref = /*#__PURE__*/React.createElement(Step, {
|
|
48
37
|
name: "intro"
|
|
49
|
-
}, /*#__PURE__*/React.createElement(
|
|
38
|
+
}, /*#__PURE__*/React.createElement(StepTitle, null), /*#__PURE__*/React.createElement(StepQuote, null, "This is the intro"), /*#__PURE__*/React.createElement(StepForm, {
|
|
50
39
|
submitButton: true
|
|
51
|
-
}, /*#__PURE__*/React.createElement(
|
|
40
|
+
}, /*#__PURE__*/React.createElement(Field, {
|
|
52
41
|
key: 'name',
|
|
53
42
|
name: "name"
|
|
54
43
|
})));
|
|
55
44
|
|
|
56
|
-
var _ref2 = /*#__PURE__*/React.createElement(
|
|
45
|
+
var _ref2 = /*#__PURE__*/React.createElement(Step, {
|
|
57
46
|
name: "age"
|
|
58
|
-
}, /*#__PURE__*/React.createElement(
|
|
47
|
+
}, /*#__PURE__*/React.createElement(StepTitle, null), /*#__PURE__*/React.createElement(StepQuote, null, "This is the age"), /*#__PURE__*/React.createElement(StepForm, {
|
|
59
48
|
submitButton: true
|
|
60
|
-
}, /*#__PURE__*/React.createElement(
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Field, {
|
|
61
50
|
key: 'dateOfBirth',
|
|
62
51
|
name: "dateOfBirth"
|
|
63
52
|
})));
|
|
64
53
|
|
|
65
54
|
it('renders the Questions', function () {
|
|
66
|
-
expect(
|
|
55
|
+
expect(mount( /*#__PURE__*/React.createElement(Questions, {
|
|
67
56
|
name: 'example',
|
|
68
57
|
onSubmit: function onSubmit(data) {
|
|
69
58
|
console.log(data);
|
package/Questions/types.js
CHANGED
|
@@ -1,10 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.FieldBase = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _reactHookForm = require("react-hook-form");
|
|
17
|
+
|
|
18
|
+
var _FieldBaseContainer = _interopRequireDefault(require("./FieldBaseContainer"));
|
|
19
|
+
|
|
3
20
|
var _excluded = ["required", "name", "component", "wrapper", "control", "type", "controlled", "enabled", "editable", "defaultValue", "label", "extra", "layout", "error", "register"];
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import FieldBaseContainer from '@digigov/form/Field/FieldBaseContainer';
|
|
7
|
-
export var FieldBase = function FieldBase(props) {
|
|
21
|
+
|
|
22
|
+
var FieldBase = function FieldBase(props) {
|
|
8
23
|
var required = props.required,
|
|
9
24
|
name = props.name,
|
|
10
25
|
Component = props.component,
|
|
@@ -23,25 +38,25 @@ export var FieldBase = function FieldBase(props) {
|
|
|
23
38
|
layout = props.layout,
|
|
24
39
|
error = props.error,
|
|
25
40
|
register = props.register,
|
|
26
|
-
componentProps =
|
|
41
|
+
componentProps = (0, _objectWithoutProperties2["default"])(props, _excluded);
|
|
27
42
|
|
|
28
43
|
if (!enabled) {
|
|
29
44
|
return null;
|
|
30
45
|
}
|
|
31
46
|
|
|
32
47
|
if (controlled) {
|
|
33
|
-
return /*#__PURE__*/
|
|
48
|
+
return /*#__PURE__*/_react["default"].createElement(_FieldBaseContainer["default"], {
|
|
34
49
|
label: label,
|
|
35
50
|
layout: layout,
|
|
36
51
|
error: error,
|
|
37
52
|
wrapper: wrapper,
|
|
38
53
|
name: name
|
|
39
|
-
}, /*#__PURE__*/
|
|
54
|
+
}, /*#__PURE__*/_react["default"].createElement(_reactHookForm.Controller, {
|
|
40
55
|
control: control,
|
|
41
56
|
name: name,
|
|
42
57
|
render: function render(_ref) {
|
|
43
58
|
var field = _ref.field;
|
|
44
|
-
return /*#__PURE__*/
|
|
59
|
+
return /*#__PURE__*/_react["default"].createElement(Component, (0, _extends2["default"])({}, field, {
|
|
45
60
|
defaultValue: defaultValue,
|
|
46
61
|
extra: extra,
|
|
47
62
|
error: !!error,
|
|
@@ -55,13 +70,13 @@ export var FieldBase = function FieldBase(props) {
|
|
|
55
70
|
}));
|
|
56
71
|
}
|
|
57
72
|
|
|
58
|
-
return /*#__PURE__*/
|
|
73
|
+
return /*#__PURE__*/_react["default"].createElement(_FieldBaseContainer["default"], {
|
|
59
74
|
label: label,
|
|
60
75
|
layout: layout,
|
|
61
76
|
error: error,
|
|
62
77
|
wrapper: wrapper,
|
|
63
78
|
name: name
|
|
64
|
-
}, Component !== null && Component !== void 0 && Component.render ? /*#__PURE__*/
|
|
79
|
+
}, Component !== null && Component !== void 0 && Component.render ? /*#__PURE__*/_react["default"].createElement(Component, (0, _extends2["default"])({}, register(name), {
|
|
65
80
|
control: control,
|
|
66
81
|
error: !!error,
|
|
67
82
|
extra: extra,
|
|
@@ -70,7 +85,7 @@ export var FieldBase = function FieldBase(props) {
|
|
|
70
85
|
"aria-describedby": error && "".concat(name, "-error"),
|
|
71
86
|
required: required,
|
|
72
87
|
disabled: editable === false
|
|
73
|
-
}, componentProps)) : /*#__PURE__*/
|
|
88
|
+
}, componentProps)) : /*#__PURE__*/_react["default"].createElement(Component, (0, _extends2["default"])({}, register(name), {
|
|
74
89
|
register: register,
|
|
75
90
|
control: control,
|
|
76
91
|
error: !!error,
|
|
@@ -81,4 +96,6 @@ export var FieldBase = function FieldBase(props) {
|
|
|
81
96
|
required: required,
|
|
82
97
|
disabled: editable === false
|
|
83
98
|
}, componentProps)));
|
|
84
|
-
};
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
exports.FieldBase = FieldBase;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = exports.FieldBaseContainer = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _Label = _interopRequireDefault(require("../inputs/Label"));
|
|
15
|
+
|
|
16
|
+
var _ErrorMessage = _interopRequireDefault(require("@digigov/react-core/ErrorMessage"));
|
|
17
|
+
|
|
18
|
+
var _FieldContainer = _interopRequireDefault(require("@digigov/react-core/FieldContainer"));
|
|
19
|
+
|
|
20
|
+
var _Fieldset = _interopRequireDefault(require("@digigov/react-core/Fieldset"));
|
|
21
|
+
|
|
22
|
+
var _FieldsetLegend = _interopRequireDefault(require("@digigov/react-core/FieldsetLegend"));
|
|
23
|
+
|
|
24
|
+
var _Hint = _interopRequireDefault(require("@digigov/react-core/Hint"));
|
|
25
|
+
|
|
26
|
+
var _LabelContainer = _interopRequireDefault(require("@digigov/react-core/LabelContainer"));
|
|
27
|
+
|
|
28
|
+
var _i18n = require("@digigov/ui/i18n");
|
|
29
|
+
|
|
30
|
+
var FieldBaseContainer = function FieldBaseContainer(_ref) {
|
|
31
|
+
var name = _ref.name,
|
|
32
|
+
wrapper = _ref.wrapper,
|
|
33
|
+
label = _ref.label,
|
|
34
|
+
children = _ref.children,
|
|
35
|
+
error = _ref.error,
|
|
36
|
+
layout = _ref.layout;
|
|
37
|
+
|
|
38
|
+
var _useTranslation = (0, _i18n.useTranslation)(),
|
|
39
|
+
t = _useTranslation.t;
|
|
40
|
+
|
|
41
|
+
var errorMessage = error !== null && error !== void 0 && error.message.key ? error.message.key : (error === null || error === void 0 ? void 0 : error.message) || '';
|
|
42
|
+
var errorContext = (error === null || error === void 0 ? void 0 : error.message.context) || {};
|
|
43
|
+
|
|
44
|
+
if (wrapper === 'fieldset') {
|
|
45
|
+
return /*#__PURE__*/_react["default"].createElement(_FieldContainer["default"], (0, _extends2["default"])({
|
|
46
|
+
error: !!error
|
|
47
|
+
}, layout), /*#__PURE__*/_react["default"].createElement(_Fieldset["default"], null, /*#__PURE__*/_react["default"].createElement(_FieldsetLegend["default"], {
|
|
48
|
+
size: "sm"
|
|
49
|
+
}, label && label.primary), label && label.secondary && /*#__PURE__*/_react["default"].createElement(_Hint["default"], null, t(label.secondary)), error && /*#__PURE__*/_react["default"].createElement(_ErrorMessage["default"], {
|
|
50
|
+
id: "".concat(name, "-error")
|
|
51
|
+
}, t(errorMessage, errorContext)), children));
|
|
52
|
+
} else {
|
|
53
|
+
return /*#__PURE__*/_react["default"].createElement(_FieldContainer["default"], (0, _extends2["default"])({
|
|
54
|
+
error: !!error
|
|
55
|
+
}, layout), /*#__PURE__*/_react["default"].createElement(_LabelContainer["default"], null, label && /*#__PURE__*/_react["default"].createElement(_Label["default"], {
|
|
56
|
+
label: label
|
|
57
|
+
}), error && /*#__PURE__*/_react["default"].createElement(_ErrorMessage["default"], {
|
|
58
|
+
id: "".concat(name, "-error")
|
|
59
|
+
}, t(errorMessage, errorContext)), children));
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
exports.FieldBaseContainer = FieldBaseContainer;
|
|
64
|
+
var _default = FieldBaseContainer;
|
|
65
|
+
exports["default"] = _default;
|