@digigov/form 1.1.2 → 1.1.4-mobile
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/index.js +103 -76
- package/Field/FieldBase.js.map +7 -0
- package/Field/FieldBaseContainer/index.js +29 -37
- package/Field/FieldBaseContainer.js.map +7 -0
- package/Field/FieldConditional/index.js +79 -53
- package/Field/FieldConditional.js.map +7 -0
- package/Field/index.js +89 -63
- package/Field/index.js.map +7 -0
- package/Field/types/index.js +1 -1
- package/Field/types.d.ts +4 -0
- package/Field/types.js.map +7 -0
- package/Field/utils/index.js +96 -85
- package/Field/utils.d.ts +1 -0
- package/Field/utils.js.map +7 -0
- package/FieldArray/FieldArray.stories/index.js +12 -6
- package/FieldArray/FieldArray.stories.d.ts +2 -2
- package/FieldArray/FieldArray.stories.js.map +7 -0
- package/FieldArray/__stories__/Default/index.js +87 -80
- package/FieldArray/__stories__/Default.d.ts +2 -2
- package/FieldArray/__stories__/Default.js.map +7 -0
- package/FieldArray/__stories__/WithExactLength/index.js +87 -80
- package/FieldArray/__stories__/WithExactLength.d.ts +2 -2
- package/FieldArray/__stories__/WithExactLength.js.map +7 -0
- package/FieldArray/index.d.ts +1 -0
- package/FieldArray/index.js +65 -59
- package/FieldArray/index.js.map +7 -0
- package/FieldArray/index.test.d.ts +1 -0
- package/FieldObject/index.d.ts +3 -0
- package/FieldObject/index.js +66 -52
- package/FieldObject/index.js.map +7 -0
- package/Fieldset/FieldsetWithContext/index.js +27 -31
- package/Fieldset/FieldsetWithContext.js.map +7 -0
- package/Fieldset/index.js +27 -29
- package/Fieldset/index.js.map +7 -0
- package/Fieldset/types/index.js +1 -1
- package/Fieldset/types.d.ts +2 -0
- package/Fieldset/types.js.map +7 -0
- package/Form.stories/index.js +7 -3
- package/Form.stories.js.map +7 -0
- package/FormBuilder/FormBuilder/index.js +123 -118
- package/FormBuilder/FormBuilder.d.ts +1 -0
- package/FormBuilder/FormBuilder.js.map +7 -0
- package/FormBuilder/FormBuilder.stories/index.js +10 -5
- package/FormBuilder/FormBuilder.stories.d.ts +1 -1
- package/FormBuilder/FormBuilder.stories.js.map +7 -0
- package/FormBuilder/__stories__/Default/index.js +27 -21
- package/FormBuilder/__stories__/Default.d.ts +2 -2
- package/FormBuilder/__stories__/Default.js.map +7 -0
- package/FormBuilder/index.js +6 -2
- package/FormBuilder/index.js.map +7 -0
- package/FormBuilder/index.test.d.ts +1 -0
- package/FormBuilder/scenarios.test.d.ts +88 -0
- package/FormContext/index.js +7 -3
- package/FormContext.js.map +7 -0
- package/MultiplicityField/MultiplicityField.stories/index.js +20 -10
- package/MultiplicityField/MultiplicityField.stories.d.ts +6 -6
- package/MultiplicityField/MultiplicityField.stories.js.map +7 -0
- package/MultiplicityField/__stories__/Default/index.js +90 -85
- package/MultiplicityField/__stories__/Default.d.ts +2 -2
- package/MultiplicityField/__stories__/Default.js.map +7 -0
- package/MultiplicityField/__stories__/PreviewDisplay/index.js +70 -72
- package/MultiplicityField/__stories__/PreviewDisplay.d.ts +2 -2
- package/MultiplicityField/__stories__/PreviewDisplay.js.map +7 -0
- package/MultiplicityField/__stories__/WithExactLength/index.js +87 -80
- package/MultiplicityField/__stories__/WithExactLength.d.ts +2 -2
- package/MultiplicityField/__stories__/WithExactLength.js.map +7 -0
- package/MultiplicityField/__stories__/WithMaxLength/index.js +90 -83
- package/MultiplicityField/__stories__/WithMaxLength.d.ts +2 -2
- package/MultiplicityField/__stories__/WithMaxLength.js.map +7 -0
- package/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +91 -84
- package/MultiplicityField/__stories__/WithMinAndMaxLength.d.ts +2 -2
- package/MultiplicityField/__stories__/WithMinAndMaxLength.js.map +7 -0
- package/MultiplicityField/__stories__/WithMinLength/index.js +90 -83
- package/MultiplicityField/__stories__/WithMinLength.d.ts +2 -2
- package/MultiplicityField/__stories__/WithMinLength.js.map +7 -0
- package/MultiplicityField/add-objects/index.js +130 -132
- package/MultiplicityField/add-objects.d.ts +1 -0
- package/MultiplicityField/add-objects.js.map +7 -0
- package/MultiplicityField/index.d.ts +1 -1
- package/MultiplicityField/index.js +111 -101
- package/MultiplicityField/index.js.map +7 -0
- package/MultiplicityField/index.test.d.ts +1 -0
- package/Questions/Questions/index.js +44 -53
- package/Questions/Questions.js.map +7 -0
- package/Questions/Questions.stories/index.js +10 -5
- package/Questions/Questions.stories.d.ts +1 -1
- package/Questions/Questions.stories.js.map +7 -0
- package/Questions/QuestionsContext/index.js +9 -9
- package/Questions/QuestionsContext.js.map +7 -0
- package/Questions/Step/ReviewStep/index.js +35 -47
- package/Questions/Step/ReviewStep.js.map +7 -0
- package/Questions/Step/Step/index.js +39 -47
- package/Questions/Step/Step.js.map +7 -0
- package/Questions/Step/StepArrayReview/index.js +41 -45
- package/Questions/Step/StepArrayReview.js.map +7 -0
- package/Questions/Step/StepContext/index.js +15 -19
- package/Questions/Step/StepContext.js.map +7 -0
- package/Questions/Step/StepDescription/index.js +22 -22
- package/Questions/Step/StepDescription.js.map +7 -0
- package/Questions/Step/StepForm/index.js +33 -43
- package/Questions/Step/StepForm.js.map +7 -0
- package/Questions/Step/StepQuote/index.js +10 -9
- package/Questions/Step/StepQuote.js.map +7 -0
- package/Questions/Step/StepTitle/index.js +40 -38
- package/Questions/Step/StepTitle.d.ts +1 -0
- package/Questions/Step/StepTitle.js.map +7 -0
- package/Questions/Step/getAddMoreFields/index.js +28 -20
- package/Questions/Step/getAddMoreFields.js.map +7 -0
- package/Questions/Step/index.d.ts +0 -1
- package/Questions/Step/index.js +16 -13
- package/Questions/Step/index.js.map +7 -0
- package/Questions/Step/types/index.js +1 -1
- package/Questions/Step/types.d.ts +2 -0
- package/Questions/Step/types.js.map +7 -0
- package/Questions/__stories__/Default/index.js +106 -100
- package/Questions/__stories__/Default.d.ts +2 -2
- package/Questions/__stories__/Default.js.map +7 -0
- package/Questions/getNextStep/index.js +12 -10
- package/Questions/getNextStep.js.map +7 -0
- package/Questions/index.js +7 -3
- package/Questions/index.js.map +7 -0
- package/Questions/index.test.d.ts +1 -0
- package/Questions/types/index.js +1 -1
- package/Questions/types.d.ts +2 -0
- package/Questions/types.js.map +7 -0
- package/cjs/Field/FieldBase/index.js +135 -82
- package/cjs/Field/FieldBase.js.map +7 -0
- package/cjs/Field/FieldBaseContainer/index.js +61 -43
- package/cjs/Field/FieldBaseContainer.js.map +7 -0
- package/cjs/Field/FieldConditional/index.js +111 -59
- package/cjs/Field/FieldConditional.js.map +7 -0
- package/cjs/Field/index.js +121 -72
- package/cjs/Field/index.js.map +7 -0
- package/cjs/Field/types/index.js +16 -5
- package/cjs/Field/types.js.map +7 -0
- package/cjs/Field/utils/index.js +139 -106
- package/cjs/Field/utils.js.map +7 -0
- package/cjs/FieldArray/FieldArray.stories/index.js +46 -36
- package/cjs/FieldArray/FieldArray.stories.js.map +7 -0
- package/cjs/FieldArray/__stories__/Default/index.js +119 -89
- package/cjs/FieldArray/__stories__/Default.js.map +7 -0
- package/cjs/FieldArray/__stories__/WithExactLength/index.js +119 -89
- package/cjs/FieldArray/__stories__/WithExactLength.js.map +7 -0
- package/cjs/FieldArray/index.js +97 -65
- package/cjs/FieldArray/index.js.map +7 -0
- package/cjs/FieldObject/index.js +98 -61
- package/cjs/FieldObject/index.js.map +7 -0
- package/cjs/Fieldset/FieldsetWithContext/index.js +54 -40
- package/cjs/Fieldset/FieldsetWithContext.js.map +7 -0
- package/cjs/Fieldset/index.js +61 -39
- package/cjs/Fieldset/index.js.map +7 -0
- package/cjs/Fieldset/types/index.js +16 -5
- package/cjs/Fieldset/types.js.map +7 -0
- package/cjs/Form.stories/index.js +25 -8
- package/cjs/Form.stories.js.map +7 -0
- package/cjs/FormBuilder/FormBuilder/index.js +158 -128
- package/cjs/FormBuilder/FormBuilder.js.map +7 -0
- package/cjs/FormBuilder/FormBuilder.stories/index.js +43 -24
- package/cjs/FormBuilder/FormBuilder.stories.js.map +7 -0
- package/cjs/FormBuilder/__stories__/Default/index.js +60 -31
- package/cjs/FormBuilder/__stories__/Default.js.map +7 -0
- package/cjs/FormBuilder/index.js +24 -7
- package/cjs/FormBuilder/index.js.map +7 -0
- package/cjs/FormContext/index.js +29 -8
- package/cjs/FormContext.js.map +7 -0
- package/cjs/MultiplicityField/MultiplicityField.stories/index.js +58 -84
- package/cjs/MultiplicityField/MultiplicityField.stories.js.map +7 -0
- package/cjs/MultiplicityField/__stories__/Default/index.js +122 -94
- package/cjs/MultiplicityField/__stories__/Default.js.map +7 -0
- package/cjs/MultiplicityField/__stories__/PreviewDisplay/index.js +85 -81
- package/cjs/MultiplicityField/__stories__/PreviewDisplay.js.map +7 -0
- package/cjs/MultiplicityField/__stories__/WithExactLength/index.js +119 -89
- package/cjs/MultiplicityField/__stories__/WithExactLength.js.map +7 -0
- package/cjs/MultiplicityField/__stories__/WithMaxLength/index.js +122 -92
- package/cjs/MultiplicityField/__stories__/WithMaxLength.js.map +7 -0
- package/cjs/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +123 -93
- package/cjs/MultiplicityField/__stories__/WithMinAndMaxLength.js.map +7 -0
- package/cjs/MultiplicityField/__stories__/WithMinLength/index.js +122 -92
- package/cjs/MultiplicityField/__stories__/WithMinLength.js.map +7 -0
- package/cjs/MultiplicityField/add-objects/index.js +160 -138
- package/cjs/MultiplicityField/add-objects.js.map +7 -0
- package/cjs/MultiplicityField/index.js +144 -110
- package/cjs/MultiplicityField/index.js.map +7 -0
- package/cjs/Questions/Questions/index.js +76 -62
- package/cjs/Questions/Questions.js.map +7 -0
- package/cjs/Questions/Questions.stories/index.js +43 -24
- package/cjs/Questions/Questions.stories.js.map +7 -0
- package/cjs/Questions/QuestionsContext/index.js +31 -14
- package/cjs/Questions/QuestionsContext.js.map +7 -0
- package/cjs/Questions/Step/ReviewStep/index.js +61 -56
- package/cjs/Questions/Step/ReviewStep.js.map +7 -0
- package/cjs/Questions/Step/Step/index.js +71 -56
- package/cjs/Questions/Step/Step.js.map +7 -0
- package/cjs/Questions/Step/StepArrayReview/index.js +65 -54
- package/cjs/Questions/Step/StepArrayReview.js.map +7 -0
- package/cjs/Questions/Step/StepContext/index.js +37 -24
- package/cjs/Questions/Step/StepContext.js.map +7 -0
- package/cjs/Questions/Step/StepDescription/index.js +55 -31
- package/cjs/Questions/Step/StepDescription.js.map +7 -0
- package/cjs/Questions/Step/StepForm/index.js +65 -52
- package/cjs/Questions/Step/StepForm.js.map +7 -0
- package/cjs/Questions/Step/StepQuote/index.js +42 -15
- package/cjs/Questions/Step/StepQuote.js.map +7 -0
- package/cjs/Questions/Step/StepTitle/index.js +72 -47
- package/cjs/Questions/Step/StepTitle.js.map +7 -0
- package/cjs/Questions/Step/getAddMoreFields/index.js +50 -25
- package/cjs/Questions/Step/getAddMoreFields.js.map +7 -0
- package/cjs/Questions/Step/index.js +59 -143
- package/cjs/Questions/Step/index.js.map +7 -0
- package/cjs/Questions/Step/types/index.js +16 -5
- package/cjs/Questions/Step/types.js.map +7 -0
- package/cjs/Questions/__stories__/Default/index.js +132 -109
- package/cjs/Questions/__stories__/Default.js.map +7 -0
- package/cjs/Questions/getNextStep/index.js +33 -14
- package/cjs/Questions/getNextStep.js.map +7 -0
- package/cjs/Questions/index.js +29 -19
- package/cjs/Questions/index.js.map +7 -0
- package/cjs/Questions/types/index.js +16 -5
- package/cjs/Questions/types.js.map +7 -0
- package/cjs/index.js +47 -20
- package/cjs/index.js.map +7 -0
- package/cjs/inputs/AutoCompleteInput/AutoComplete.stories/index.js +46 -24
- package/cjs/inputs/AutoCompleteInput/AutoComplete.stories.js.map +7 -0
- package/cjs/inputs/AutoCompleteInput/__stories__/Default/index.js +78 -51
- package/cjs/inputs/AutoCompleteInput/__stories__/Default.js.map +7 -0
- package/cjs/inputs/AutoCompleteInput/__stories__/Multiple/index.js +84 -0
- package/cjs/inputs/AutoCompleteInput/__stories__/Multiple.js.map +7 -0
- package/cjs/inputs/AutoCompleteInput/index.js +90 -46
- package/cjs/inputs/AutoCompleteInput/index.js.map +7 -0
- package/cjs/inputs/Checkboxes/Checkboxes.stories/index.js +49 -48
- package/cjs/inputs/Checkboxes/Checkboxes.stories.js.map +7 -0
- package/cjs/inputs/Checkboxes/__stories__/Conditional/index.js +120 -89
- package/cjs/inputs/Checkboxes/__stories__/Conditional.js.map +7 -0
- package/cjs/inputs/Checkboxes/__stories__/Default/index.js +73 -46
- package/cjs/inputs/Checkboxes/__stories__/Default.js.map +7 -0
- package/cjs/inputs/Checkboxes/__stories__/WithDivider/index.js +74 -47
- package/cjs/inputs/Checkboxes/__stories__/WithDivider.js.map +7 -0
- package/cjs/inputs/Checkboxes/index.js +102 -96
- package/cjs/inputs/Checkboxes/index.js.map +7 -0
- package/cjs/inputs/DateInput/DateInput.stories/index.js +43 -24
- package/cjs/inputs/DateInput/DateInput.stories.js.map +7 -0
- package/cjs/inputs/DateInput/__stories__/Default/index.js +56 -28
- package/cjs/inputs/DateInput/__stories__/Default.js.map +7 -0
- package/cjs/inputs/DateInput/index.js +122 -109
- package/cjs/inputs/DateInput/index.js.map +7 -0
- package/cjs/inputs/FileInput/FileInput.stories/index.js +43 -24
- package/cjs/inputs/FileInput/FileInput.stories.js.map +7 -0
- package/cjs/inputs/FileInput/__stories__/Default/index.js +57 -26
- package/cjs/inputs/FileInput/__stories__/Default.js.map +7 -0
- package/cjs/inputs/FileInput/index.js +76 -63
- package/cjs/inputs/FileInput/index.js.map +7 -0
- package/cjs/inputs/ImageInput/ImageInput.stories/index.js +49 -48
- package/cjs/inputs/ImageInput/ImageInput.stories.js.map +7 -0
- package/cjs/inputs/ImageInput/__stories__/Default/index.js +58 -33
- package/cjs/inputs/ImageInput/__stories__/Default.js.map +7 -0
- package/cjs/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +65 -40
- package/cjs/inputs/ImageInput/__stories__/WithInvalidImageDimension.js.map +7 -0
- package/cjs/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +62 -37
- package/cjs/inputs/ImageInput/__stories__/WithInvalidImageSize.js.map +7 -0
- package/cjs/inputs/ImageInput/index.js +91 -83
- package/cjs/inputs/ImageInput/index.js.map +7 -0
- package/cjs/inputs/Input/Input.stories/index.js +70 -120
- package/cjs/inputs/Input/Input.stories.js.map +7 -0
- package/cjs/inputs/Input/__stories__/AFM/index.js +60 -29
- package/cjs/inputs/Input/__stories__/AFM.js.map +7 -0
- package/cjs/inputs/Input/__stories__/Boolean/index.js +61 -30
- package/cjs/inputs/Input/__stories__/Boolean.js.map +7 -0
- package/cjs/inputs/Input/__stories__/IBAN/index.js +61 -30
- package/cjs/inputs/Input/__stories__/IBAN.js.map +7 -0
- package/cjs/inputs/Input/__stories__/Integer/index.js +75 -38
- package/cjs/inputs/Input/__stories__/Integer.js.map +7 -0
- package/cjs/inputs/Input/__stories__/LandlineNumber/index.js +67 -0
- package/cjs/inputs/Input/__stories__/LandlineNumber.js.map +7 -0
- package/cjs/inputs/Input/__stories__/MobilePhone/index.js +64 -29
- package/cjs/inputs/Input/__stories__/MobilePhone.js.map +7 -0
- package/cjs/inputs/Input/__stories__/PhoneNumber/index.js +63 -29
- package/cjs/inputs/Input/__stories__/PhoneNumber.js.map +7 -0
- package/cjs/inputs/Input/__stories__/PostalCode/index.js +60 -31
- package/cjs/inputs/Input/__stories__/PostalCode.js.map +7 -0
- package/cjs/inputs/Input/__stories__/String/index.js +64 -0
- package/cjs/inputs/Input/__stories__/String.js.map +7 -0
- package/cjs/inputs/Input/__stories__/TextWithLimit/index.js +64 -0
- package/cjs/inputs/Input/__stories__/TextWithLimit.js.map +7 -0
- package/cjs/inputs/Input/index.js +87 -72
- package/cjs/inputs/Input/index.js.map +7 -0
- package/cjs/inputs/Input/inputsInputScenarios/index.js +439 -0
- package/cjs/inputs/Input/inputsInputScenarios.js.map +7 -0
- package/cjs/inputs/Label/Label.stories/index.js +43 -24
- package/cjs/inputs/Label/Label.stories.js.map +7 -0
- package/cjs/inputs/Label/__stories__/Default/index.js +66 -33
- package/cjs/inputs/Label/__stories__/Default.js.map +7 -0
- package/cjs/inputs/Label/index.js +45 -24
- package/cjs/inputs/Label/index.js.map +7 -0
- package/cjs/inputs/OtpInput/OtpInput.stories/index.js +43 -24
- package/cjs/inputs/OtpInput/OtpInput.stories.js.map +7 -0
- package/cjs/inputs/OtpInput/__stories__/Default/index.js +59 -34
- package/cjs/inputs/OtpInput/__stories__/Default.js.map +7 -0
- package/cjs/inputs/OtpInput/index.js +142 -112
- package/cjs/inputs/OtpInput/index.js.map +7 -0
- package/cjs/inputs/Radio/Radio.stories/index.js +49 -48
- package/cjs/inputs/Radio/Radio.stories.js.map +7 -0
- package/cjs/inputs/Radio/__stories__/Conditional/index.js +120 -89
- package/cjs/inputs/Radio/__stories__/Conditional.js.map +7 -0
- package/cjs/inputs/Radio/__stories__/Default/index.js +77 -51
- package/cjs/inputs/Radio/__stories__/Default.js.map +7 -0
- package/cjs/inputs/Radio/__stories__/WithDivider/index.js +78 -52
- package/cjs/inputs/Radio/__stories__/WithDivider.js.map +7 -0
- package/cjs/inputs/Radio/index.js +132 -61
- package/cjs/inputs/Radio/index.js.map +7 -0
- package/cjs/inputs/Select/Select.stories/index.js +43 -24
- package/cjs/inputs/Select/Select.stories.js.map +7 -0
- package/cjs/inputs/Select/__stories__/Default/index.js +82 -57
- package/cjs/inputs/Select/__stories__/Default.js.map +7 -0
- package/cjs/inputs/Select/index.js +55 -36
- package/cjs/inputs/Select/index.js.map +7 -0
- package/cjs/inputs/index.js +62 -69
- package/cjs/inputs/index.js.map +7 -0
- package/cjs/inputs/inputsScenarios/index.js +540 -0
- package/cjs/inputs/inputsScenarios.js.map +7 -0
- package/cjs/internal/index.js +116 -346
- package/cjs/internal.js.map +7 -0
- package/cjs/lazy/index.js +93 -0
- package/cjs/lazy.js.map +7 -0
- package/cjs/locales/el/index.js +35 -0
- package/cjs/locales/el.js.map +7 -0
- package/cjs/registry/index.js +174 -142
- package/cjs/registry.js.map +7 -0
- package/cjs/types/index.js +16 -5
- package/cjs/types.js.map +7 -0
- package/cjs/utils/index.js +78 -83
- package/cjs/utils.js.map +7 -0
- package/cjs/validators/index.js +130 -128
- package/cjs/validators/index.js.map +7 -0
- package/cjs/validators/types/index.js +16 -5
- package/cjs/validators/types.js.map +7 -0
- package/cjs/validators/utils/afm/index.js +38 -21
- package/cjs/validators/utils/afm.js.map +7 -0
- package/cjs/validators/utils/file/index.js +44 -47
- package/cjs/validators/utils/file.js.map +7 -0
- package/cjs/validators/utils/iban/index.js +36 -17
- package/cjs/validators/utils/iban.js.map +7 -0
- package/cjs/validators/utils/image/index.js +88 -112
- package/cjs/validators/utils/image.js.map +7 -0
- package/cjs/validators/utils/index.js +95 -159
- package/cjs/validators/utils/index.js.map +7 -0
- package/cjs/validators/utils/int/index.js +34 -12
- package/cjs/validators/utils/int.js.map +7 -0
- package/cjs/validators/utils/number/index.js +33 -11
- package/cjs/validators/utils/number.js.map +7 -0
- package/cjs/validators/utils/otp/index.js +35 -13
- package/cjs/validators/utils/otp.js.map +7 -0
- package/cjs/validators/utils/phone/index.js +171 -92
- package/cjs/validators/utils/phone.js.map +7 -0
- package/cjs/validators/utils/postal_code/index.js +36 -16
- package/cjs/validators/utils/postal_code.js.map +7 -0
- package/cjs/validators/utils/text_limit/index.js +40 -25
- package/cjs/validators/utils/text_limit.js.map +7 -0
- package/cjs/validators/utils/uuid4/index.js +34 -13
- package/cjs/validators/utils/uuid4.js.map +7 -0
- package/index.d.ts +4 -1
- package/index.js +13 -4
- package/index.js.map +7 -0
- package/inputs/AutoCompleteInput/AutoComplete.stories/index.js +12 -5
- package/inputs/AutoCompleteInput/AutoComplete.stories.d.ts +2 -1
- package/inputs/AutoCompleteInput/AutoComplete.stories.js.map +7 -0
- package/inputs/AutoCompleteInput/__stories__/Default/index.js +46 -42
- package/inputs/AutoCompleteInput/__stories__/Default.d.ts +3 -2
- package/inputs/AutoCompleteInput/__stories__/Default.js.map +7 -0
- package/inputs/AutoCompleteInput/__stories__/Multiple/index.js +51 -0
- package/inputs/AutoCompleteInput/__stories__/Multiple/package.json +6 -0
- package/inputs/AutoCompleteInput/__stories__/Multiple.d.ts +3 -0
- package/inputs/AutoCompleteInput/__stories__/Multiple.js.map +7 -0
- package/inputs/AutoCompleteInput/index.d.ts +1 -1
- package/inputs/AutoCompleteInput/index.js +58 -37
- package/inputs/AutoCompleteInput/index.js.map +7 -0
- package/inputs/AutoCompleteInput/index.test.d.ts +1 -0
- package/inputs/Checkboxes/Checkboxes.stories/index.js +14 -7
- package/inputs/Checkboxes/Checkboxes.stories.d.ts +3 -3
- package/inputs/Checkboxes/Checkboxes.stories.js.map +7 -0
- package/inputs/Checkboxes/__stories__/Conditional/index.js +88 -80
- package/inputs/Checkboxes/__stories__/Conditional.d.ts +3 -2
- package/inputs/Checkboxes/__stories__/Conditional.js.map +7 -0
- package/inputs/Checkboxes/__stories__/Default/index.js +40 -36
- package/inputs/Checkboxes/__stories__/Default.d.ts +2 -2
- package/inputs/Checkboxes/__stories__/Default.js.map +7 -0
- package/inputs/Checkboxes/__stories__/WithDivider/index.js +41 -37
- package/inputs/Checkboxes/__stories__/WithDivider.d.ts +2 -2
- package/inputs/Checkboxes/__stories__/WithDivider.js.map +7 -0
- package/inputs/Checkboxes/index.js +70 -87
- package/inputs/Checkboxes/index.js.map +7 -0
- package/inputs/Checkboxes/index.test.d.ts +1 -0
- package/inputs/DateInput/DateInput.stories/index.js +10 -5
- package/inputs/DateInput/DateInput.stories.d.ts +1 -1
- package/inputs/DateInput/DateInput.stories.js.map +7 -0
- package/inputs/DateInput/__stories__/Default/index.js +23 -18
- package/inputs/DateInput/__stories__/Default.d.ts +2 -2
- package/inputs/DateInput/__stories__/Default.js.map +7 -0
- package/inputs/DateInput/index.d.ts +2 -2
- package/inputs/DateInput/index.js +89 -99
- package/inputs/DateInput/index.js.map +7 -0
- package/inputs/DateInput/index.test.d.ts +1 -0
- package/inputs/FileInput/FileInput.stories/index.js +10 -5
- package/inputs/FileInput/FileInput.stories.d.ts +1 -1
- package/inputs/FileInput/FileInput.stories.js.map +7 -0
- package/inputs/FileInput/__stories__/Default/index.js +24 -16
- package/inputs/FileInput/__stories__/Default.d.ts +2 -2
- package/inputs/FileInput/__stories__/Default.js.map +7 -0
- package/inputs/FileInput/index.js +44 -54
- package/inputs/FileInput/index.js.map +7 -0
- package/inputs/FileInput/index.test.d.ts +1 -0
- package/inputs/ImageInput/ImageInput.stories/index.js +14 -7
- package/inputs/ImageInput/ImageInput.stories.d.ts +3 -3
- package/inputs/ImageInput/ImageInput.stories.js.map +7 -0
- package/inputs/ImageInput/__stories__/Default/index.js +25 -23
- package/inputs/ImageInput/__stories__/Default.d.ts +2 -2
- package/inputs/ImageInput/__stories__/Default.js.map +7 -0
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +32 -30
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension.d.ts +2 -2
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension.js.map +7 -0
- package/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +29 -27
- package/inputs/ImageInput/__stories__/WithInvalidImageSize.d.ts +2 -2
- package/inputs/ImageInput/__stories__/WithInvalidImageSize.js.map +7 -0
- package/inputs/ImageInput/index.js +59 -75
- package/inputs/ImageInput/index.js.map +7 -0
- package/inputs/ImageInput/index.test.d.ts +1 -0
- package/inputs/Input/Input.stories/index.js +28 -13
- package/inputs/Input/Input.stories.d.ts +10 -9
- package/inputs/Input/Input.stories.js.map +7 -0
- package/inputs/Input/__stories__/AFM/index.js +27 -19
- package/inputs/Input/__stories__/AFM.d.ts +2 -2
- package/inputs/Input/__stories__/AFM.js.map +7 -0
- package/inputs/Input/__stories__/Boolean/index.js +28 -20
- package/inputs/Input/__stories__/Boolean.d.ts +2 -2
- package/inputs/Input/__stories__/Boolean.js.map +7 -0
- package/inputs/Input/__stories__/IBAN/index.js +28 -20
- package/inputs/Input/__stories__/IBAN.d.ts +2 -2
- package/inputs/Input/__stories__/IBAN.js.map +7 -0
- package/inputs/Input/__stories__/Integer/index.js +43 -29
- package/inputs/Input/__stories__/Integer.d.ts +2 -2
- package/inputs/Input/__stories__/Integer.js.map +7 -0
- package/inputs/Input/__stories__/LandlineNumber/index.js +34 -0
- package/inputs/Input/__stories__/LandlineNumber/package.json +6 -0
- package/inputs/Input/__stories__/LandlineNumber.d.ts +3 -0
- package/inputs/Input/__stories__/LandlineNumber.js.map +7 -0
- package/inputs/Input/__stories__/MobilePhone/index.js +31 -19
- package/inputs/Input/__stories__/MobilePhone.d.ts +2 -2
- package/inputs/Input/__stories__/MobilePhone.js.map +7 -0
- package/inputs/Input/__stories__/PhoneNumber/index.js +30 -19
- package/inputs/Input/__stories__/PhoneNumber.d.ts +2 -2
- package/inputs/Input/__stories__/PhoneNumber.js.map +7 -0
- package/inputs/Input/__stories__/PostalCode/index.js +27 -21
- package/inputs/Input/__stories__/PostalCode.d.ts +2 -2
- package/inputs/Input/__stories__/PostalCode.js.map +7 -0
- package/inputs/Input/__stories__/String/index.js +31 -0
- package/inputs/Input/__stories__/{Default → String}/package.json +1 -1
- package/inputs/Input/__stories__/String.d.ts +3 -0
- package/inputs/Input/__stories__/String.js.map +7 -0
- package/inputs/Input/__stories__/TextWithLimit/index.js +31 -0
- package/inputs/Input/__stories__/TextWithLimit/package.json +6 -0
- package/inputs/Input/__stories__/TextWithLimit.d.ts +3 -0
- package/inputs/Input/__stories__/TextWithLimit.js.map +7 -0
- package/inputs/Input/index.js +56 -67
- package/inputs/Input/index.js.map +7 -0
- package/inputs/Input/index.test.d.ts +1 -0
- package/inputs/Input/inputsInputScenarios/index.js +406 -0
- package/inputs/Input/inputsInputScenarios/package.json +6 -0
- package/inputs/Input/inputsInputScenarios.d.ts +57 -0
- package/inputs/Input/inputsInputScenarios.js.map +7 -0
- package/inputs/Label/Label.stories/index.js +10 -5
- package/inputs/Label/Label.stories.d.ts +1 -1
- package/inputs/Label/Label.stories.js.map +7 -0
- package/inputs/Label/__stories__/Default/index.js +33 -23
- package/inputs/Label/__stories__/Default.d.ts +2 -2
- package/inputs/Label/__stories__/Default.js.map +7 -0
- package/inputs/Label/index.d.ts +1 -1
- package/inputs/Label/index.js +12 -17
- package/inputs/Label/index.js.map +7 -0
- package/inputs/Label/index.test.d.ts +1 -0
- package/inputs/OtpInput/OtpInput.stories/index.js +10 -5
- package/inputs/OtpInput/OtpInput.stories.d.ts +1 -1
- package/inputs/OtpInput/OtpInput.stories.js.map +7 -0
- package/inputs/OtpInput/__stories__/Default/index.js +26 -24
- package/inputs/OtpInput/__stories__/Default.d.ts +2 -2
- package/inputs/OtpInput/__stories__/Default.js.map +7 -0
- package/inputs/OtpInput/index.d.ts +9 -2
- package/inputs/OtpInput/index.js +109 -103
- package/inputs/OtpInput/index.js.map +7 -0
- package/inputs/OtpInput/index.test.d.ts +1 -0
- package/inputs/Radio/Radio.stories/index.js +14 -7
- package/inputs/Radio/Radio.stories.d.ts +3 -3
- package/inputs/Radio/Radio.stories.js.map +7 -0
- package/inputs/Radio/__stories__/Conditional/index.js +88 -80
- package/inputs/Radio/__stories__/Conditional.d.ts +3 -2
- package/inputs/Radio/__stories__/Conditional.js.map +7 -0
- package/inputs/Radio/__stories__/Default/index.js +44 -41
- package/inputs/Radio/__stories__/Default.d.ts +2 -2
- package/inputs/Radio/__stories__/Default.js.map +7 -0
- package/inputs/Radio/__stories__/WithDivider/index.js +45 -42
- package/inputs/Radio/__stories__/WithDivider.d.ts +2 -2
- package/inputs/Radio/__stories__/WithDivider.js.map +7 -0
- package/inputs/Radio/index.d.ts +4 -0
- package/inputs/Radio/index.js +99 -55
- package/inputs/Radio/index.js.map +7 -0
- package/inputs/Radio/index.test.d.ts +1 -0
- package/inputs/Select/Select.stories/index.js +10 -5
- package/inputs/Select/Select.stories.d.ts +1 -1
- package/inputs/Select/Select.stories.js.map +7 -0
- package/inputs/Select/__stories__/Default/index.js +49 -47
- package/inputs/Select/__stories__/Default.d.ts +2 -2
- package/inputs/Select/__stories__/Default.js.map +7 -0
- package/inputs/Select/index.js +24 -31
- package/inputs/Select/index.js.map +7 -0
- package/inputs/Select/index.test.d.ts +1 -0
- package/inputs/index.js +21 -9
- package/inputs/index.js.map +7 -0
- package/inputs/inputsScenarios/index.js +506 -0
- package/{validators/validators.spec → inputs/inputsScenarios}/package.json +1 -1
- package/inputs/inputsScenarios.d.ts +338 -0
- package/inputs/inputsScenarios.js.map +7 -0
- package/internal/index.js +51 -34
- package/internal.js.map +7 -0
- package/lazy/index.js +64 -0
- package/{Questions/index.spec → lazy}/package.json +1 -1
- package/lazy.d.ts +70 -0
- package/lazy.js.map +7 -0
- package/locales/el/index.js +6 -0
- package/locales/el/package.json +6 -0
- package/locales/el.d.ts +2 -0
- package/locales/el.js.map +7 -0
- package/package.json +5 -7
- package/registry/index.js +146 -134
- package/registry.d.ts +3 -0
- package/registry.js.map +7 -0
- package/src/Field/FieldBase.tsx +2 -0
- package/src/Field/FieldBaseContainer.tsx +1 -1
- package/src/Field/FieldConditional.tsx +4 -0
- package/src/Field/index.tsx +7 -1
- package/src/Field/types.tsx +7 -0
- package/src/Field/utils.ts +13 -6
- package/src/FieldArray/FieldArray.stories.js +2 -2
- package/src/FieldArray/index.test.tsx +24 -0
- package/src/FieldArray/index.tsx +12 -6
- package/src/FieldObject/index.tsx +10 -2
- package/src/Fieldset/types.tsx +3 -1
- package/src/FormBuilder/FormBuilder.stories.js +1 -1
- package/src/FormBuilder/FormBuilder.tsx +15 -3
- package/src/FormBuilder/index.test.tsx +20 -0
- package/src/FormBuilder/scenarios.test.tsx +1864 -0
- package/src/MultiplicityField/MultiplicityField.stories.js +6 -6
- package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +2 -2
- package/src/MultiplicityField/__stories__/WithExactLength.tsx +1 -1
- package/src/MultiplicityField/__stories__/WithMaxLength.tsx +1 -1
- package/src/MultiplicityField/__stories__/WithMinAndMaxLength.tsx +1 -1
- package/src/MultiplicityField/__stories__/WithMinLength.tsx +1 -1
- package/src/MultiplicityField/add-objects.tsx +26 -23
- package/src/MultiplicityField/index.test.tsx +40 -0
- package/src/MultiplicityField/index.tsx +9 -9
- package/src/Questions/Questions.stories.js +1 -1
- package/src/Questions/Step/StepTitle.tsx +1 -0
- package/src/Questions/Step/index.ts +0 -1
- package/src/Questions/Step/types.tsx +1 -0
- package/src/Questions/__snapshots__/index.spec.tsx.snap +67 -586
- package/src/Questions/index.mdx +4 -4
- package/src/Questions/index.spec.tsx +3 -3
- package/src/Questions/index.test.tsx +20 -0
- package/src/Questions/types.tsx +1 -0
- package/src/index.ts +4 -1
- package/src/inputs/AutoCompleteInput/AutoComplete.stories.js +2 -1
- package/src/inputs/AutoCompleteInput/__stories__/Default.tsx +27 -18
- package/src/inputs/AutoCompleteInput/__stories__/Multiple.tsx +54 -0
- package/src/inputs/AutoCompleteInput/index.mdx +29 -0
- package/src/inputs/AutoCompleteInput/index.test.tsx +24 -0
- package/src/inputs/AutoCompleteInput/index.tsx +29 -17
- package/src/inputs/Checkboxes/Checkboxes.stories.js +3 -3
- package/src/inputs/Checkboxes/__stories__/Conditional.tsx +2 -3
- package/src/inputs/Checkboxes/index.mdx +33 -0
- package/src/inputs/Checkboxes/index.test.tsx +29 -0
- package/src/inputs/Checkboxes/index.tsx +28 -26
- package/src/inputs/DateInput/DateInput.stories.js +1 -1
- package/src/inputs/DateInput/__stories__/Default.tsx +21 -15
- package/src/inputs/DateInput/index.mdx +23 -0
- package/src/inputs/DateInput/index.test.tsx +20 -0
- package/src/inputs/DateInput/index.tsx +3 -3
- package/src/inputs/FileInput/FileInput.stories.js +1 -1
- package/src/inputs/FileInput/index.mdx +19 -0
- package/src/inputs/FileInput/index.test.tsx +20 -0
- package/src/inputs/ImageInput/ImageInput.stories.js +3 -3
- package/src/inputs/ImageInput/index.mdx +19 -0
- package/src/inputs/ImageInput/index.test.tsx +28 -0
- package/src/inputs/ImageInput/index.tsx +4 -4
- package/src/inputs/Input/Input.stories.js +10 -9
- package/src/inputs/Input/__stories__/LandlineNumber.tsx +27 -0
- package/src/inputs/Input/__stories__/MobilePhone.tsx +4 -0
- package/src/inputs/Input/__stories__/PhoneNumber.tsx +4 -1
- package/src/inputs/Input/__stories__/{Default.tsx → String.tsx} +2 -2
- package/src/inputs/Input/__stories__/{TextWithCharacterLimit.tsx → TextWithLimit.tsx} +2 -2
- package/src/inputs/Input/index.mdx +90 -3
- package/src/inputs/Input/index.test.tsx +56 -0
- package/src/inputs/Input/index.tsx +13 -13
- package/src/inputs/Input/inputsInputScenarios.ts +405 -0
- package/src/inputs/Label/Label.stories.js +1 -1
- package/src/inputs/Label/index.test.tsx +20 -0
- package/src/inputs/Label/index.tsx +1 -4
- package/src/inputs/OtpInput/OtpInput.stories.js +1 -1
- package/src/inputs/OtpInput/index.mdx +23 -0
- package/src/inputs/OtpInput/index.test.tsx +20 -0
- package/src/inputs/OtpInput/index.tsx +2 -2
- package/src/inputs/Radio/Radio.stories.js +3 -3
- package/src/inputs/Radio/__stories__/Conditional.tsx +4 -1
- package/src/inputs/Radio/index.mdx +33 -0
- package/src/inputs/Radio/index.test.tsx +28 -0
- package/src/inputs/Radio/index.tsx +65 -6
- package/src/inputs/Select/Select.stories.js +1 -1
- package/src/inputs/Select/index.mdx +17 -0
- package/src/inputs/Select/index.test.tsx +20 -0
- package/src/inputs/inputsScenarios.ts +503 -0
- package/src/lazy.js +61 -0
- package/src/locales/el.ts +3 -0
- package/src/registry.js +6 -0
- package/src/types.tsx +21 -19
- package/src/utils.ts +34 -33
- package/src/validators/index.ts +5 -0
- package/src/validators/utils/file.ts +9 -9
- package/src/validators/utils/phone.ts +143 -72
- package/src/validators/validators.spec.ts +3 -37
- package/types/index.js +1 -1
- package/types.d.ts +2 -0
- package/types.js.map +7 -0
- package/utils/index.js +56 -77
- package/utils.js.map +7 -0
- package/validators/index.js +101 -110
- package/validators/index.js.map +7 -0
- package/validators/types/index.js +1 -1
- package/validators/types.js.map +7 -0
- package/validators/utils/afm/index.js +16 -16
- package/validators/utils/afm.js.map +7 -0
- package/validators/utils/file/index.js +22 -42
- package/validators/utils/file.js.map +7 -0
- package/validators/utils/iban/index.js +14 -12
- package/validators/utils/iban.js.map +7 -0
- package/validators/utils/image/index.js +66 -106
- package/validators/utils/image.js.map +7 -0
- package/validators/utils/index.js +54 -48
- package/validators/utils/index.js.map +7 -0
- package/validators/utils/int/index.js +12 -7
- package/validators/utils/int.js.map +7 -0
- package/validators/utils/number/index.js +11 -6
- package/validators/utils/number.js.map +7 -0
- package/validators/utils/otp/index.js +13 -8
- package/validators/utils/otp.js.map +7 -0
- package/validators/utils/phone/index.js +146 -82
- package/validators/utils/phone.d.ts +2 -2
- package/validators/utils/phone.js.map +7 -0
- package/validators/utils/postal_code/index.js +14 -11
- package/validators/utils/postal_code.js.map +7 -0
- package/validators/utils/text_limit/index.js +18 -20
- package/validators/utils/text_limit.js.map +7 -0
- package/validators/utils/uuid4/index.js +12 -8
- package/validators/utils/uuid4.js.map +7 -0
- package/Field/index.mdx +0 -6
- package/FieldArray/FieldArray.stories.playwright.json +0 -353
- package/FormBuilder/FormBuilder.mdx +0 -256
- package/FormBuilder/FormBuilder.stories.playwright.json +0 -52
- package/MultiplicityField/MultiplicityField.mdx +0 -590
- package/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
- package/Questions/__snapshots__/index.spec.tsx.snap +0 -596
- package/Questions/index.mdx +0 -415
- package/Questions/index.spec/index.js +0 -59
- package/cjs/Field/index.mdx +0 -6
- package/cjs/FieldArray/FieldArray.stories.playwright.json +0 -353
- package/cjs/FormBuilder/FormBuilder.mdx +0 -256
- package/cjs/FormBuilder/FormBuilder.stories.playwright.json +0 -52
- package/cjs/MultiplicityField/MultiplicityField.mdx +0 -590
- package/cjs/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
- package/cjs/Questions/__snapshots__/index.spec.tsx.snap +0 -596
- package/cjs/Questions/index.mdx +0 -415
- package/cjs/Questions/index.spec/index.js +0 -63
- package/cjs/create-simple-form.mdx +0 -539
- package/cjs/index.mdx +0 -51
- package/cjs/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
- package/cjs/inputs/Checkboxes/index.mdx +0 -0
- package/cjs/inputs/DateInput/DateInput.stories.playwright.json +0 -72
- package/cjs/inputs/FileInput/FileInput.stories.playwright.json +0 -75
- package/cjs/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
- package/cjs/inputs/Input/Input.stories.playwright.json +0 -376
- package/cjs/inputs/Input/__stories__/Default/index.js +0 -33
- package/cjs/inputs/Input/__stories__/TextWithCharacterLimit/index.js +0 -39
- package/cjs/inputs/Input/index.mdx +0 -8
- package/cjs/inputs/Label/Label.stories.playwright.json +0 -40
- package/cjs/inputs/Label/index.mdx +0 -0
- package/cjs/inputs/Radio/Radio.stories.playwright.json +0 -73
- package/cjs/inputs/Radio/index.mdx +0 -0
- package/cjs/inputs/Select/Select.stories.playwright.json +0 -22
- package/cjs/installation.mdx +0 -68
- package/cjs/validators/validators.spec/index.js +0 -87
- package/create-simple-form.mdx +0 -539
- package/index.mdx +0 -51
- package/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
- package/inputs/Checkboxes/index.mdx +0 -0
- package/inputs/DateInput/DateInput.stories.playwright.json +0 -72
- package/inputs/FileInput/FileInput.stories.playwright.json +0 -75
- package/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
- package/inputs/Input/Input.stories.playwright.json +0 -376
- package/inputs/Input/__stories__/Default/index.js +0 -23
- package/inputs/Input/__stories__/Default.d.ts +0 -3
- package/inputs/Input/__stories__/TextWithCharacterLimit/index.js +0 -29
- package/inputs/Input/__stories__/TextWithCharacterLimit/package.json +0 -6
- package/inputs/Input/__stories__/TextWithCharacterLimit.d.ts +0 -3
- package/inputs/Input/index.mdx +0 -8
- package/inputs/Label/Label.stories.playwright.json +0 -40
- package/inputs/Label/index.mdx +0 -0
- package/inputs/Radio/Radio.stories.playwright.json +0 -73
- package/inputs/Radio/index.mdx +0 -0
- package/inputs/Select/Select.stories.playwright.json +0 -22
- package/installation.mdx +0 -68
- package/src/FieldArray/FieldArray.stories.playwright.json +0 -353
- package/src/FormBuilder/FormBuilder.stories.playwright.json +0 -52
- package/src/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
- package/src/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
- package/src/inputs/DateInput/DateInput.stories.playwright.json +0 -72
- package/src/inputs/FileInput/FileInput.stories.playwright.json +0 -75
- package/src/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
- package/src/inputs/Input/Input.stories.playwright.json +0 -376
- package/src/inputs/Label/Label.stories.playwright.json +0 -40
- package/src/inputs/Radio/Radio.stories.playwright.json +0 -73
- package/src/inputs/Select/Select.stories.playwright.json +0 -22
- package/validators/validators.spec/index.js +0 -85
package/cjs/Questions/index.mdx
DELETED
|
@@ -1,415 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: ask-questions-steps
|
|
3
|
-
title: Asking questions in multiple steps
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
TableContainer,
|
|
8
|
-
Table,
|
|
9
|
-
TableCaption,
|
|
10
|
-
TableHead,
|
|
11
|
-
TableRow,
|
|
12
|
-
TableBody,
|
|
13
|
-
TableHeadCell,
|
|
14
|
-
TableDataCell,
|
|
15
|
-
} from '@digigov/react-core';
|
|
16
|
-
|
|
17
|
-
import LeadText from '@site/src/components/LeadText';
|
|
18
|
-
|
|
19
|
-
<LeadText>
|
|
20
|
-
Question pages are used to ask users meaningful questions needed by your
|
|
21
|
-
GOV.GR service, or even gather data about their persona or their application
|
|
22
|
-
status. Use step questions to make bigger forms less scary and easier to fill
|
|
23
|
-
out.
|
|
24
|
-
</LeadText>
|
|
25
|
-
|
|
26
|
-
## Introduction to Question pages
|
|
27
|
-
|
|
28
|
-
Asking questions is a vital part of interacting with our users, and asking them
|
|
29
|
-
to provide information needed for your service. We want to build forms that
|
|
30
|
-
are accessible to a lot of people regardless of their cognitive or other
|
|
31
|
-
impairments, challenges, or other technological drawbacks.
|
|
32
|
-
|
|
33
|
-
In our case, we don't have to worry about profit, conversions, and sales, but
|
|
34
|
-
there are other hidden costs. If there are too many questions in the form,
|
|
35
|
-
you’ll lose users. You’ll also lose users if there are questions in the form
|
|
36
|
-
that users consider impertinent or irrelevant—or, even worse, you’ll get made-up
|
|
37
|
-
data. If you find that your users have names like John Doe or Mickey Mouse and
|
|
38
|
-
live on Anystreet, in Anywhere, you’ve collected a lot of rubbish that costs a
|
|
39
|
-
lot to clean up. Plus, there is the further hidden cost of loss of goodwill.
|
|
40
|
-
Even if users struggle through to the end of a form and answer honestly, if it’s
|
|
41
|
-
more work than they expected, they’ll be annoyed about it. That's the exact
|
|
42
|
-
opposite of our goals of making concise, easy-to-use services.
|
|
43
|
-
|
|
44
|
-
```jsx live
|
|
45
|
-
import React from 'react';
|
|
46
|
-
import Questions, { Step, StepForm, StepTitle } from '@digigov/form/Questions';
|
|
47
|
-
import { Field } from '@digigov/form';
|
|
48
|
-
|
|
49
|
-
const steps = [
|
|
50
|
-
{
|
|
51
|
-
name: 'residency',
|
|
52
|
-
title: 'Where do you live?',
|
|
53
|
-
fields: [
|
|
54
|
-
{
|
|
55
|
-
key: 'countries',
|
|
56
|
-
type: 'choice:single',
|
|
57
|
-
required: true,
|
|
58
|
-
extra: {
|
|
59
|
-
options: [
|
|
60
|
-
{
|
|
61
|
-
label: {
|
|
62
|
-
primary: 'Greece',
|
|
63
|
-
},
|
|
64
|
-
value: 'greece',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
label: {
|
|
68
|
-
primary: 'Cyprus',
|
|
69
|
-
},
|
|
70
|
-
value: 'cyprus',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
label: {
|
|
74
|
-
primary: 'European Union',
|
|
75
|
-
},
|
|
76
|
-
value: 'eu',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
label: {
|
|
80
|
-
primary: 'United States of America',
|
|
81
|
-
},
|
|
82
|
-
value: 'usa',
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: 'bod',
|
|
91
|
-
title: 'When is your birthday?',
|
|
92
|
-
fields: [
|
|
93
|
-
{
|
|
94
|
-
key: 'bod',
|
|
95
|
-
label: {
|
|
96
|
-
primary: 'Birthday',
|
|
97
|
-
},
|
|
98
|
-
type: 'date',
|
|
99
|
-
required: true,
|
|
100
|
-
},
|
|
101
|
-
],
|
|
102
|
-
},
|
|
103
|
-
];
|
|
104
|
-
|
|
105
|
-
export default function Index() {
|
|
106
|
-
return (
|
|
107
|
-
<Questions
|
|
108
|
-
name={'example'}
|
|
109
|
-
steps={steps}
|
|
110
|
-
onSubmit={(data) => {
|
|
111
|
-
console.log(data);
|
|
112
|
-
}}
|
|
113
|
-
>
|
|
114
|
-
<Step name="residency">
|
|
115
|
-
<StepTitle />
|
|
116
|
-
<StepForm submitButton={true}>
|
|
117
|
-
<Field name="countries" />
|
|
118
|
-
</StepForm>
|
|
119
|
-
</Step>
|
|
120
|
-
<Step name="bod">
|
|
121
|
-
<StepTitle />
|
|
122
|
-
<StepForm submitButton={true}>
|
|
123
|
-
<Field name="bod" />
|
|
124
|
-
</StepForm>
|
|
125
|
-
</Step>
|
|
126
|
-
</Questions>
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
When we started working on forms, we started following the GOV.UK paradigm,
|
|
132
|
-
asking just one question per screen, making it very manageable on mobiles. When
|
|
133
|
-
we sent this early design around internally for comments, a common response was
|
|
134
|
-
that it felt odd on large screens and it slowed users down. In reality, even if
|
|
135
|
-
it adds more clicks, it makes the process feel simpler and easy - there wasn’t
|
|
136
|
-
too much to take in and process at any one time. So we stuck with the simpler
|
|
137
|
-
screens for everyone. [Read
|
|
138
|
-
more](https://designnotes.blog.gov.uk/2014/07/14/things-we-learnt-designing-register-to-vote/)
|
|
139
|
-
about this topic.
|
|
140
|
-
|
|
141
|
-
The approach gave us other advantages. For example, say someone makes a mistake
|
|
142
|
-
answering a question: entering an email address with no ‘@’. The mistake and how
|
|
143
|
-
to correct it is a lot clearer if the question is on the screen. With longer
|
|
144
|
-
pages, it’s common for the question to be off the top or bottom of the screen,
|
|
145
|
-
making it harder to find.
|
|
146
|
-
|
|
147
|
-
For more information about the design specification of question pages, you can
|
|
148
|
-
read our [“Question pages“ pattern
|
|
149
|
-
page](https://guide.services.gov.gr/docs/questions-pages).
|
|
150
|
-
|
|
151
|
-
## How to use it
|
|
152
|
-
|
|
153
|
-
Each step can be defined using a `Step` React component and all steps should be
|
|
154
|
-
place inside a `Questions` component, that will provide the steps subcomponents
|
|
155
|
-
the required state.
|
|
156
|
-
|
|
157
|
-
First, you declare an array called `steps` and then you pass it to `<Questions />` as a prop. Then for each step you can declare a `<Step />` component and
|
|
158
|
-
its subsequent subcomponents that you customise as needed, like the step title,
|
|
159
|
-
description or form. You can also add components that are not form-specific,
|
|
160
|
-
adding paragraphs or other custom components.
|
|
161
|
-
|
|
162
|
-
```jsx
|
|
163
|
-
<Questions name="example" steps={steps} onSubmit={(data) => doSomething(data)}>
|
|
164
|
-
{/* more steps could be rendered here ... */}
|
|
165
|
-
<Step name="age">
|
|
166
|
-
<StepTitle />
|
|
167
|
-
<StepDescription />
|
|
168
|
-
<StepForm submitButton={true}>
|
|
169
|
-
<Field name="age" />
|
|
170
|
-
</StepForm>
|
|
171
|
-
</Step>
|
|
172
|
-
{/* and of course more could be down here as well */}
|
|
173
|
-
</Questions>
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### Step specification
|
|
177
|
-
|
|
178
|
-
Steps can be described using `StepInterface` interface declared as a JSON
|
|
179
|
-
object. The most basic properties are the following:
|
|
180
|
-
|
|
181
|
-
- `name` - a unique identifier, must be different for each step
|
|
182
|
-
- `title` - the main questions title that communicates to the users what this
|
|
183
|
-
question page is about, rendered by `StepTitle`
|
|
184
|
-
- `fields` - an array that describes each input field that will be rendered in
|
|
185
|
-
the `StepForm`. Each fields implements the `FieldSpec` interface as a JSON object.
|
|
186
|
-
|
|
187
|
-
```json title="step-name.json"
|
|
188
|
-
{
|
|
189
|
-
"name": "name",
|
|
190
|
-
"title": "What is your name?",
|
|
191
|
-
"fields": [
|
|
192
|
-
{
|
|
193
|
-
"key": "name",
|
|
194
|
-
"type": "string",
|
|
195
|
-
"required": true
|
|
196
|
-
}
|
|
197
|
-
]
|
|
198
|
-
}
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
### Branching between steps
|
|
202
|
-
|
|
203
|
-
Each step will be rendered in the order that matches their index inside the
|
|
204
|
-
array of fields. You can change this order and create branching between any two
|
|
205
|
-
steps.
|
|
206
|
-
|
|
207
|
-
Each step can be programmaticaly linked to the next step so you can do some
|
|
208
|
-
basic branching between each step. The `nextStep` property will need to be a
|
|
209
|
-
function that will take the form state as an argument and will return the key of
|
|
210
|
-
the next `step`.
|
|
211
|
-
|
|
212
|
-
```json title="next-step.json"
|
|
213
|
-
const steps = [
|
|
214
|
-
{
|
|
215
|
-
name: 'age',
|
|
216
|
-
title: 'What is your age?',
|
|
217
|
-
fields: [
|
|
218
|
-
{
|
|
219
|
-
key: 'age',
|
|
220
|
-
type: 'int',
|
|
221
|
-
required: true,
|
|
222
|
-
}
|
|
223
|
-
],
|
|
224
|
-
// highlight-start
|
|
225
|
-
nextStep: (data) => {
|
|
226
|
-
return data.age < 18 ? 'citizen-adult' : citizen-underage;
|
|
227
|
-
}
|
|
228
|
-
// highlight-end
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
name: 'citizen-underage',
|
|
232
|
-
title: 'Are you a student?',
|
|
233
|
-
fields: [ ... ]
|
|
234
|
-
},
|
|
235
|
-
{
|
|
236
|
-
// highlight-next-line
|
|
237
|
-
name: 'citizen-adult',
|
|
238
|
-
title: 'Are you currently employed?',
|
|
239
|
-
fields: [
|
|
240
|
-
{
|
|
241
|
-
key: 'citizen-underage-employed',
|
|
242
|
-
type: 'choice:single',
|
|
243
|
-
required: true,
|
|
244
|
-
extra: {
|
|
245
|
-
options: [
|
|
246
|
-
{
|
|
247
|
-
label: {primary: "Yes"},
|
|
248
|
-
value: 'yes',
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
label: {primary: "No"},
|
|
252
|
-
value: 'no',
|
|
253
|
-
}
|
|
254
|
-
]
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
]
|
|
258
|
-
},
|
|
259
|
-
];
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
For example, you may use a form to determine if citizens are adults or not, and
|
|
263
|
-
we want to ask users different questions according to their persona. We can use
|
|
264
|
-
a branch between the `age` step and the other two steps.
|
|
265
|
-
|
|
266
|
-
```jsx live
|
|
267
|
-
import React from 'react';
|
|
268
|
-
import GovGRFooter from '@digigov/ui/govgr/Footer';
|
|
269
|
-
import Header from '@digigov/ui/app/Header';
|
|
270
|
-
import HeaderSection from '@digigov/ui/app/Header/HeaderSection';
|
|
271
|
-
import HeaderContent from '@digigov/ui/app/Header/HeaderContent';
|
|
272
|
-
import GovGRLogo from '@digigov/ui/govgr/GovGRLogo';
|
|
273
|
-
import BasicLayout, {
|
|
274
|
-
Top,
|
|
275
|
-
Container,
|
|
276
|
-
Main,
|
|
277
|
-
Bottom,
|
|
278
|
-
} from '@digigov/ui/layouts/Basic';
|
|
279
|
-
import Questions, { Step, StepForm, StepTitle } from '@digigov/form/Questions';
|
|
280
|
-
import { Field } from '@digigov/form';
|
|
281
|
-
import TranslatorsHeader from 'translators-landing/components/TranslatorsHeader';
|
|
282
|
-
|
|
283
|
-
const steps = [
|
|
284
|
-
{
|
|
285
|
-
name: 'age',
|
|
286
|
-
title: 'What is your age?',
|
|
287
|
-
fields: [
|
|
288
|
-
{
|
|
289
|
-
key: 'age',
|
|
290
|
-
type: 'int',
|
|
291
|
-
required: true,
|
|
292
|
-
},
|
|
293
|
-
],
|
|
294
|
-
nextStep: (data) => {
|
|
295
|
-
return data.age < 18 ? 'citizen-adult' : 'citizen-underage';
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
name: 'citizen-underage',
|
|
300
|
-
title: 'Are you a student?',
|
|
301
|
-
fields: [
|
|
302
|
-
{
|
|
303
|
-
key: 'citizen-underage-student',
|
|
304
|
-
type: 'choice:single',
|
|
305
|
-
required: true,
|
|
306
|
-
extra: {
|
|
307
|
-
options: [
|
|
308
|
-
{
|
|
309
|
-
label: { primary: 'Yes' },
|
|
310
|
-
value: 'yes',
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
label: { primary: 'No' },
|
|
314
|
-
value: 'no',
|
|
315
|
-
},
|
|
316
|
-
],
|
|
317
|
-
},
|
|
318
|
-
},
|
|
319
|
-
],
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
name: 'citizen-adult',
|
|
323
|
-
title: 'Are you currently employed?',
|
|
324
|
-
fields: [
|
|
325
|
-
{
|
|
326
|
-
key: 'citizen-adult-employed',
|
|
327
|
-
type: 'choice:single',
|
|
328
|
-
required: true,
|
|
329
|
-
extra: {
|
|
330
|
-
options: [
|
|
331
|
-
{
|
|
332
|
-
label: { primary: 'Yes' },
|
|
333
|
-
value: 'yes',
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
label: { primary: 'No' },
|
|
337
|
-
value: 'no',
|
|
338
|
-
},
|
|
339
|
-
],
|
|
340
|
-
},
|
|
341
|
-
},
|
|
342
|
-
],
|
|
343
|
-
},
|
|
344
|
-
];
|
|
345
|
-
|
|
346
|
-
export default function Index() {
|
|
347
|
-
return (
|
|
348
|
-
<BasicLayout>
|
|
349
|
-
<Top>
|
|
350
|
-
<Header>
|
|
351
|
-
<HeaderContent>
|
|
352
|
-
<HeaderSection>
|
|
353
|
-
<GovGRLogo href="#" />
|
|
354
|
-
</HeaderSection>
|
|
355
|
-
</HeaderContent>
|
|
356
|
-
</Header>
|
|
357
|
-
</Top>
|
|
358
|
-
<Container>
|
|
359
|
-
<Main>
|
|
360
|
-
<Questions
|
|
361
|
-
name={'example'}
|
|
362
|
-
steps={steps}
|
|
363
|
-
onSubmit={(data) => {
|
|
364
|
-
console.log(data);
|
|
365
|
-
}}
|
|
366
|
-
>
|
|
367
|
-
<Step name="age">
|
|
368
|
-
<StepTitle />
|
|
369
|
-
<StepForm submitButton={true}>
|
|
370
|
-
<Field name="age" />
|
|
371
|
-
</StepForm>
|
|
372
|
-
</Step>
|
|
373
|
-
<Step name="citizen-underage">
|
|
374
|
-
<StepTitle />
|
|
375
|
-
<StepForm submitButton={true}>
|
|
376
|
-
<Field name="citizen-underage-student" />
|
|
377
|
-
</StepForm>
|
|
378
|
-
</Step>
|
|
379
|
-
<Step name="citizen-adult">
|
|
380
|
-
<StepTitle />
|
|
381
|
-
<StepForm submitButton={true}>
|
|
382
|
-
<Field name="citizen-adult-employed" />
|
|
383
|
-
</StepForm>
|
|
384
|
-
</Step>
|
|
385
|
-
</Questions>
|
|
386
|
-
</Main>
|
|
387
|
-
</Container>
|
|
388
|
-
<Bottom>
|
|
389
|
-
<GovGRFooter />
|
|
390
|
-
</Bottom>
|
|
391
|
-
</BasicLayout>
|
|
392
|
-
);
|
|
393
|
-
}
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
## Prop types
|
|
397
|
-
|
|
398
|
-
<TableContainer>
|
|
399
|
-
<Table>
|
|
400
|
-
<TableHead>
|
|
401
|
-
<TableRow>
|
|
402
|
-
<TableHeadCell>Περίοδος</TableHeadCell>
|
|
403
|
-
<TableHeadCell>Κανονικό ποσό</TableHeadCell>
|
|
404
|
-
<TableHeadCell>Μειωμένο ποσό</TableHeadCell>
|
|
405
|
-
</TableRow>
|
|
406
|
-
</TableHead>
|
|
407
|
-
<TableBody>
|
|
408
|
-
<TableRow>
|
|
409
|
-
<TableDataCell>Πρώτες 6 εβδομάδες </TableDataCell>
|
|
410
|
-
<TableDataCell> €109.80 / εβδομάδα</TableDataCell>
|
|
411
|
-
<TableDataCell> €69.80 / εβδομάδα</TableDataCell>
|
|
412
|
-
</TableRow>
|
|
413
|
-
</TableBody>
|
|
414
|
-
</Table>
|
|
415
|
-
</TableContainer>
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
-
var React = _interopRequireWildcard(require("react"));
|
|
5
|
-
var _enzyme = require("enzyme");
|
|
6
|
-
var _form = require("@digigov/form");
|
|
7
|
-
var _Questions = _interopRequireWildcard(require("@digigov/form/Questions"));
|
|
8
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
9
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
10
|
-
var steps = [{
|
|
11
|
-
name: 'intro',
|
|
12
|
-
caption: 'intro.caption',
|
|
13
|
-
title: 'intro.title',
|
|
14
|
-
description: 'intro.description',
|
|
15
|
-
fields: [{
|
|
16
|
-
key: 'name',
|
|
17
|
-
label: {
|
|
18
|
-
primary: 'name.field.primary',
|
|
19
|
-
secondary: 'name.field.secondary'
|
|
20
|
-
},
|
|
21
|
-
required: true,
|
|
22
|
-
type: 'string'
|
|
23
|
-
}]
|
|
24
|
-
}, {
|
|
25
|
-
name: 'age',
|
|
26
|
-
caption: 'age.caption',
|
|
27
|
-
title: 'age.title',
|
|
28
|
-
description: 'age.description',
|
|
29
|
-
fields: [{
|
|
30
|
-
key: 'dateOfBirth',
|
|
31
|
-
label: {
|
|
32
|
-
primary: 'age.field.primary',
|
|
33
|
-
secondary: 'age.field.secondary'
|
|
34
|
-
},
|
|
35
|
-
required: true,
|
|
36
|
-
type: 'number'
|
|
37
|
-
}]
|
|
38
|
-
}];
|
|
39
|
-
var _ref = /*#__PURE__*/React.createElement(_Questions.Step, {
|
|
40
|
-
name: "intro"
|
|
41
|
-
}, /*#__PURE__*/React.createElement(_Questions.StepTitle, null), /*#__PURE__*/React.createElement(_Questions.StepQuote, null, "This is the intro"), /*#__PURE__*/React.createElement(_Questions.StepForm, {
|
|
42
|
-
submitButton: true
|
|
43
|
-
}, /*#__PURE__*/React.createElement(_form.Field, {
|
|
44
|
-
key: 'name',
|
|
45
|
-
name: "name"
|
|
46
|
-
})));
|
|
47
|
-
var _ref2 = /*#__PURE__*/React.createElement(_Questions.Step, {
|
|
48
|
-
name: "age"
|
|
49
|
-
}, /*#__PURE__*/React.createElement(_Questions.StepTitle, null), /*#__PURE__*/React.createElement(_Questions.StepQuote, null, "This is the age"), /*#__PURE__*/React.createElement(_Questions.StepForm, {
|
|
50
|
-
submitButton: true
|
|
51
|
-
}, /*#__PURE__*/React.createElement(_form.Field, {
|
|
52
|
-
key: 'dateOfBirth',
|
|
53
|
-
name: "dateOfBirth"
|
|
54
|
-
})));
|
|
55
|
-
it('renders the Questions', function () {
|
|
56
|
-
expect((0, _enzyme.mount)( /*#__PURE__*/React.createElement(_Questions["default"], {
|
|
57
|
-
name: 'example',
|
|
58
|
-
onSubmit: function onSubmit(data) {
|
|
59
|
-
console.log(data);
|
|
60
|
-
},
|
|
61
|
-
steps: steps
|
|
62
|
-
}, _ref, _ref2))).toMatchSnapshot();
|
|
63
|
-
});
|