@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
|
@@ -1,590 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: ask-users-recursive
|
|
3
|
-
title: Ask users for recursive data
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import LeadText from '@site/src/components/LeadText';
|
|
7
|
-
|
|
8
|
-
<LeadText>
|
|
9
|
-
Multiplicity & FieldArray fields allow users to input data described by a
|
|
10
|
-
particular schema for an arbitrary number of times until they are done. It can
|
|
11
|
-
be used to input a fixed, a minimum, and a maximum length of instances.
|
|
12
|
-
</LeadText>
|
|
13
|
-
|
|
14
|
-
## What we are trying to achieve
|
|
15
|
-
|
|
16
|
-
First off, a bit of history. This field was developed to meet the needs of several
|
|
17
|
-
GOV.GR services. They needed an easy way to add multiple objects in an array of
|
|
18
|
-
data while they could still keep the usability of a web form, submitting data and
|
|
19
|
-
validating the fields as well. As part of the prototype phase, an initial
|
|
20
|
-
implementation was designed and used in Dilosi for several document templates.
|
|
21
|
-
It used a single button to add new items in the array and opened a modal,
|
|
22
|
-
blocking the rest of the user interface and prompting users to input data.
|
|
23
|
-
During this process, the `FieldArray` component was conceived.
|
|
24
|
-
|
|
25
|
-
Meanwhile, Digigov SDK got these requirements and started working on a more
|
|
26
|
-
versatile version of this feature. The new field was developed from scratch as
|
|
27
|
-
an accessible and guided way to fill arrays with objects. Also, we wanted to
|
|
28
|
-
provide an easy-to-use component for developers. The input fields that will
|
|
29
|
-
collect data for each item in the array are described by a JSON schema, then
|
|
30
|
-
provided to `@digigov/form` to manage internally. These fields describe
|
|
31
|
-
properties for a data entity like a citizen and their personal details, and it
|
|
32
|
-
can be reused internally multiple times by `@digigov/form` to generate data
|
|
33
|
-
objects based on this schema.
|
|
34
|
-
|
|
35
|
-
## Accessibility & usability
|
|
36
|
-
|
|
37
|
-
We aim to have semantically correct and valid forms, and as a result we cannot
|
|
38
|
-
mix form-related HTML elements, like `form`, `input`, `label` with generic ones,
|
|
39
|
-
eg. `div`, cards or other custom components. For example, if we try to add a
|
|
40
|
-
paragraph element inside a form, React will throw warnings in our console.
|
|
41
|
-
Instead of creating complex interfaces that try to do too much too fast, Digigov
|
|
42
|
-
Form recommends using forms in their original way, filling and validating
|
|
43
|
-
inputs, then submitting the form as a whole.
|
|
44
|
-
|
|
45
|
-
Adding another dimension to this problem, we should make sure our interfaces
|
|
46
|
-
are entirely accessible to screen readers and other accessibility tools. This is
|
|
47
|
-
the reason we decided to design the flow to be as guided and recoverable as
|
|
48
|
-
possible. Forms and fields should read like well-written pieces of text and
|
|
49
|
-
make sense to the users. While validation fails, the system provides users with
|
|
50
|
-
meaningful error messages and instructs them on how to fix the validation errors to
|
|
51
|
-
proceed. Once the validation is successful, the flow can proceed with
|
|
52
|
-
submmitting data. In any case, it is imperative to provide meaningful
|
|
53
|
-
information to the users at each step. Thus, we should avoid the use of 🌈
|
|
54
|
-
“magic“ ✨ UX solutions that presume users have developed digital skills and
|
|
55
|
-
most of the time are used for expert use cases.
|
|
56
|
-
|
|
57
|
-
Initially, we used an add button that users clicked to explicitly create with
|
|
58
|
-
their action a new item in the array, but in this way we cannot programmatically
|
|
59
|
-
ensure that users still have stuff to enter to the system. What we decided to do
|
|
60
|
-
is to turn this state check into a direct question that will be a part of the final
|
|
61
|
-
form. We created a question that will make sure that users always provide the
|
|
62
|
-
form with their intention.
|
|
63
|
-
|
|
64
|
-
Both FieldArray and MultiplicityField will result in the same data output when
|
|
65
|
-
users submit the form, which is an `array` that contains `objects` described by
|
|
66
|
-
the `extra.fields` key. The component internally uses the
|
|
67
|
-
[useFieldArray](https://www.react-hook-form.com/api/usefieldarray) hook from
|
|
68
|
-
react-hook-form.
|
|
69
|
-
|
|
70
|
-
:::caution
|
|
71
|
-
|
|
72
|
-
We strongly recommend that services concerning citizens use `Multiplicity`, instead
|
|
73
|
-
of `FieldArray`.
|
|
74
|
-
|
|
75
|
-
Please be careful when and how you use a `FieldArray` component. Many users are not
|
|
76
|
-
familiar with modern user interface design practices, and it is likely they will
|
|
77
|
-
be confused. If you choose to use it, please provide meaningful hints in the
|
|
78
|
-
`extra.label.object.nothing_added` and `extra.label.object.title_added` keys.
|
|
79
|
-
|
|
80
|
-
:::
|
|
81
|
-
|
|
82
|
-
Users should fill in data as this schema dictates, and every time
|
|
83
|
-
they add something, we should ask them if they want to continue adding or escape
|
|
84
|
-
the loop. We could also add some limits to the number of items users create,
|
|
85
|
-
resulting in an array with specific cardinality. By doing so, we can validate the
|
|
86
|
-
form state at any time, regardless of whether a user is in the process of data input
|
|
87
|
-
or reviewing what they've added. In any case, the form should guide users
|
|
88
|
-
through steps and validation errors, and avoid giving too much freedom of
|
|
89
|
-
action that could lead to estranged users losing the intended path or their
|
|
90
|
-
focus.
|
|
91
|
-
|
|
92
|
-
Those are a lot of things to keep in mind, but luckily we've got you covered. How
|
|
93
|
-
can we code this feature as part of a Digigov form, you ask?
|
|
94
|
-
|
|
95
|
-
## Introducing the Multiplicity field
|
|
96
|
-
|
|
97
|
-
To deal with these features, we have decided to create a composite field that uses
|
|
98
|
-
custom object schema for the input fields alongside some internal helpers to
|
|
99
|
-
make sure that the flow is usable from beginning to end. In reality, this
|
|
100
|
-
field is in fact considered as a normal single key-value pair by the
|
|
101
|
-
`@digigov/form`, same as every other input type. The only difference is that the
|
|
102
|
-
type of the value will be an `Array` instead of any other primitive used for a
|
|
103
|
-
field type, like `string`, `number`, etc. Inside the array, each one of the
|
|
104
|
-
indexes will be an object with nested field values.
|
|
105
|
-
|
|
106
|
-
This field is the most complex component we currently offer, and it uses the
|
|
107
|
-
[useFieldArray](https://www.react-hook-form.com/api/usefieldarray) hook from
|
|
108
|
-
react-hook-form under the hood. First, let's take a look at what it looks like, and then we can
|
|
109
|
-
break down its functionality and how you can use it.
|
|
110
|
-
|
|
111
|
-
```jsx live
|
|
112
|
-
import React from 'react';
|
|
113
|
-
import Form, { Field } from '@digigov/form';
|
|
114
|
-
import Button from '@digigov/ui/form/Button';
|
|
115
|
-
|
|
116
|
-
export default function SimpleForm() {
|
|
117
|
-
return (
|
|
118
|
-
<Form>
|
|
119
|
-
<Field
|
|
120
|
-
key="vehicles"
|
|
121
|
-
name="vehicles"
|
|
122
|
-
label={{ primary: 'Vehicles' }}
|
|
123
|
-
type="array"
|
|
124
|
-
extra={{
|
|
125
|
-
border: true,
|
|
126
|
-
label: {
|
|
127
|
-
object: {
|
|
128
|
-
title: 'Vehicle',
|
|
129
|
-
title_added: 'The vehicles you have already added',
|
|
130
|
-
add: 'Add',
|
|
131
|
-
delete: 'Remove',
|
|
132
|
-
},
|
|
133
|
-
question: {
|
|
134
|
-
title: 'Do you want to add more vehicles?',
|
|
135
|
-
objectLabel: {
|
|
136
|
-
primary: 'Add one more of your vehicles',
|
|
137
|
-
secondary: 'Fill in the details below and then click “Add“.',
|
|
138
|
-
},
|
|
139
|
-
yes: 'Yes',
|
|
140
|
-
no: 'No',
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
of: {
|
|
144
|
-
type: 'object',
|
|
145
|
-
label: {
|
|
146
|
-
primary: 'Vehicle details',
|
|
147
|
-
secondary: 'See and change the details of a vehicle',
|
|
148
|
-
},
|
|
149
|
-
extra: {
|
|
150
|
-
fields: [
|
|
151
|
-
{
|
|
152
|
-
key: 'registration_date',
|
|
153
|
-
type: 'date',
|
|
154
|
-
required: true,
|
|
155
|
-
label: { primary: 'Registration date' },
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
key: 'make',
|
|
159
|
-
type: 'string',
|
|
160
|
-
required: true,
|
|
161
|
-
label: {
|
|
162
|
-
primary: 'Make',
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
key: 'model',
|
|
167
|
-
type: 'string',
|
|
168
|
-
required: true,
|
|
169
|
-
label: {
|
|
170
|
-
primary: 'Model',
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
],
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
}}
|
|
177
|
-
required
|
|
178
|
-
/>
|
|
179
|
-
<Button type="submit">Submit</Button>
|
|
180
|
-
</Form>
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### How to use it
|
|
186
|
-
|
|
187
|
-
Before we begin, we should setup an empty form. We are going to need a main `Form`
|
|
188
|
-
and a submit `Button` that will trigger the `onSubmit` events in our React form.
|
|
189
|
-
|
|
190
|
-
```jsx
|
|
191
|
-
import React from 'react';
|
|
192
|
-
import Form from '@digigov/form';
|
|
193
|
-
import Button from '@digigov/ui/form/Button';
|
|
194
|
-
|
|
195
|
-
export default function MultiplicityForm() {
|
|
196
|
-
return (
|
|
197
|
-
<Form>
|
|
198
|
-
{/* this is where all fields will eventually be rendered */}
|
|
199
|
-
<Button type="submit">Submit</Button>
|
|
200
|
-
</Form>
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
As you may have already assumed, this boilerplate code will not get us very far.
|
|
206
|
-
We need an actual `Field` component that will be of `type: 'array'` since we
|
|
207
|
-
need a value that contains multiple instances of a single schema. Given that we
|
|
208
|
-
are asking users for information about their vehicles, we can also fill in the `key`,
|
|
209
|
-
`label.primary`, as well as the `type` and `required`
|
|
210
|
-
props.
|
|
211
|
-
|
|
212
|
-
```jsx
|
|
213
|
-
<Field
|
|
214
|
-
key="vehicles"
|
|
215
|
-
name="vehicles"
|
|
216
|
-
label={{ primary: 'Vehicles' }}
|
|
217
|
-
type="array"
|
|
218
|
-
required
|
|
219
|
-
/>
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
Although this code may seem enough at first glance, it will soon become clear
|
|
223
|
-
that Multiplicity packs a lot of functionality. It needs context in the form of
|
|
224
|
-
natural language, Greek, English, or any other language dictated by the user needs
|
|
225
|
-
in order to carry meaning to the end users.
|
|
226
|
-
|
|
227
|
-
It also needs the schema of the form fields to be filled for each iteration. To
|
|
228
|
-
do so, inside the `extra` key we can add an `of` key. This `of` key will contain
|
|
229
|
-
a key named `label` and a key name `type`, signifying the label text and the type of the
|
|
230
|
-
inner form, respectively.
|
|
231
|
-
|
|
232
|
-
Inside the `of` key you can add an `extra` key that will then contain a `fields`
|
|
233
|
-
key describing the field props for all inputs needed.
|
|
234
|
-
|
|
235
|
-
```js
|
|
236
|
-
// this will be used as value for the `extra` prop
|
|
237
|
-
{
|
|
238
|
-
of: {
|
|
239
|
-
type: 'object',
|
|
240
|
-
label: {
|
|
241
|
-
primary: 'Vehicle details',
|
|
242
|
-
secondary: 'See and change the details of a vehicle',
|
|
243
|
-
},
|
|
244
|
-
extra: {
|
|
245
|
-
fields: [
|
|
246
|
-
{
|
|
247
|
-
key: 'registration_date',
|
|
248
|
-
type: 'date',
|
|
249
|
-
required: true,
|
|
250
|
-
label: { primary: 'Registration date' },
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
key: 'make',
|
|
254
|
-
type: 'string',
|
|
255
|
-
required: true,
|
|
256
|
-
label: {
|
|
257
|
-
primary: 'Make',
|
|
258
|
-
},
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
key: 'model',
|
|
262
|
-
type: 'string',
|
|
263
|
-
required: true,
|
|
264
|
-
label: {
|
|
265
|
-
primary: 'Model',
|
|
266
|
-
},
|
|
267
|
-
},
|
|
268
|
-
],
|
|
269
|
-
},
|
|
270
|
-
},
|
|
271
|
-
}
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
## Introducing the FieldArray field
|
|
275
|
-
|
|
276
|
-
As a simpler alternative to Multiplicity, we also offer the original
|
|
277
|
-
implementation called `FieldArray` which may be used in dashboards or other apps
|
|
278
|
-
used by expert users or administrators of any kind. FieldArray skips all the
|
|
279
|
-
extra safety features and protections of the Multiplicity and offers more
|
|
280
|
-
flexibility for the end user.
|
|
281
|
-
|
|
282
|
-
### How to use it
|
|
283
|
-
|
|
284
|
-
We tried to maintain the differences in the API between the two implementations
|
|
285
|
-
as little as possible. The only thing that is required for you to do to use the
|
|
286
|
-
FieldArray instead of the Multiplicity, is to explicitly disable the
|
|
287
|
-
multiplicity functionality, by using the `multiplicity={false}` prop.
|
|
288
|
-
|
|
289
|
-
As a result, if you learn how to use one, you can easily use the other, and
|
|
290
|
-
naturally, you can also change their behaviour by changing a single prop in your
|
|
291
|
-
React code.
|
|
292
|
-
|
|
293
|
-
```jsx
|
|
294
|
-
<Field
|
|
295
|
-
key="vehicles"
|
|
296
|
-
name="vehicles"
|
|
297
|
-
label={{ primary: 'Vehicles' }}
|
|
298
|
-
type="array"
|
|
299
|
-
// highlight-next-line
|
|
300
|
-
multiplicity={false}
|
|
301
|
-
required
|
|
302
|
-
/>
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
The end result looks very different from Multiplicity at first glance, but you
|
|
306
|
-
can achieve the same results with both of them.
|
|
307
|
-
|
|
308
|
-
```jsx live
|
|
309
|
-
import React from 'react';
|
|
310
|
-
import Form, { Field } from '@digigov/form';
|
|
311
|
-
import Button from '@digigov/ui/form/Button';
|
|
312
|
-
|
|
313
|
-
export default function SimpleForm() {
|
|
314
|
-
return (
|
|
315
|
-
<Form>
|
|
316
|
-
<Field
|
|
317
|
-
key="vehicles"
|
|
318
|
-
name="vehicles"
|
|
319
|
-
label={{ primary: 'Vehicles' }}
|
|
320
|
-
type="array"
|
|
321
|
-
multiplicity={false}
|
|
322
|
-
extra={{
|
|
323
|
-
border: true,
|
|
324
|
-
label: {
|
|
325
|
-
object: {
|
|
326
|
-
title: 'Vehicle',
|
|
327
|
-
title_added: 'The vehicles you have already added',
|
|
328
|
-
nothing_added: 'You have not added any vehicles yet.',
|
|
329
|
-
add: 'Add vehicle',
|
|
330
|
-
delete: 'Remove',
|
|
331
|
-
},
|
|
332
|
-
question: {
|
|
333
|
-
title: 'Do you want to add more vehicles?',
|
|
334
|
-
objectLabel: {
|
|
335
|
-
primary: 'Add one more of your vehicles',
|
|
336
|
-
secondary: 'Fill in the details below and then click “Add“.',
|
|
337
|
-
},
|
|
338
|
-
yes: 'Yes',
|
|
339
|
-
no: 'No',
|
|
340
|
-
},
|
|
341
|
-
},
|
|
342
|
-
of: {
|
|
343
|
-
type: 'object',
|
|
344
|
-
label: {
|
|
345
|
-
primary: 'Vehicle details',
|
|
346
|
-
secondary: 'See and change the details of a vehicle',
|
|
347
|
-
},
|
|
348
|
-
extra: {
|
|
349
|
-
fields: [
|
|
350
|
-
{
|
|
351
|
-
key: 'registration_date',
|
|
352
|
-
type: 'date',
|
|
353
|
-
required: true,
|
|
354
|
-
label: { primary: 'Registration date' },
|
|
355
|
-
},
|
|
356
|
-
{
|
|
357
|
-
key: 'make',
|
|
358
|
-
type: 'string',
|
|
359
|
-
required: true,
|
|
360
|
-
label: {
|
|
361
|
-
primary: 'Make',
|
|
362
|
-
},
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
key: 'model',
|
|
366
|
-
type: 'string',
|
|
367
|
-
required: true,
|
|
368
|
-
label: {
|
|
369
|
-
primary: 'Model',
|
|
370
|
-
},
|
|
371
|
-
},
|
|
372
|
-
],
|
|
373
|
-
},
|
|
374
|
-
},
|
|
375
|
-
}}
|
|
376
|
-
required
|
|
377
|
-
/>
|
|
378
|
-
<Button type="submit">Submit</Button>
|
|
379
|
-
</Form>
|
|
380
|
-
);
|
|
381
|
-
}
|
|
382
|
-
```
|
|
383
|
-
|
|
384
|
-
## Validating form data
|
|
385
|
-
|
|
386
|
-
Luckily, if you want to validate the values of the nested fields, for instance,
|
|
387
|
-
the first name of a vehicle, you don't have to perform any further actions. The fields'
|
|
388
|
-
validation will work right out of the box, same as any other form.
|
|
389
|
-
|
|
390
|
-
There is another use case that is available as part of the
|
|
391
|
-
MultiplicityField. Given that the value of this field type is an array, we
|
|
392
|
-
should expect to need some length validation sooner than later.
|
|
393
|
-
|
|
394
|
-
### Exact length
|
|
395
|
-
|
|
396
|
-
You can easily validate the exact length of the items added to the multipliticy
|
|
397
|
-
array, simply by using the `extra.length` prop.
|
|
398
|
-
|
|
399
|
-
```jsx
|
|
400
|
-
<Field
|
|
401
|
-
extra={{
|
|
402
|
-
length: 2,
|
|
403
|
-
of: { ... },
|
|
404
|
-
label: { ... },
|
|
405
|
-
}}
|
|
406
|
-
/>
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
The example below will validate this and show all the error messages necessary
|
|
410
|
-
to make sure that the users understand what is going wrong with the process.
|
|
411
|
-
|
|
412
|
-
```jsx live
|
|
413
|
-
import React from 'react';
|
|
414
|
-
import Form, { Field } from '@digigov/form';
|
|
415
|
-
import Button from '@digigov/ui/form/Button';
|
|
416
|
-
|
|
417
|
-
export default function SimpleForm() {
|
|
418
|
-
return (
|
|
419
|
-
<Form>
|
|
420
|
-
<Field
|
|
421
|
-
key="vehicles"
|
|
422
|
-
name="vehicles"
|
|
423
|
-
label={{ primary: 'Vehicles' }}
|
|
424
|
-
type="array"
|
|
425
|
-
multiplicity={true}
|
|
426
|
-
extra={{
|
|
427
|
-
border: true,
|
|
428
|
-
length: 3,
|
|
429
|
-
label: {
|
|
430
|
-
object: {
|
|
431
|
-
title: 'Vehicle',
|
|
432
|
-
title_added: 'The vehicles you have already added',
|
|
433
|
-
add: 'Add',
|
|
434
|
-
delete: 'Remove',
|
|
435
|
-
},
|
|
436
|
-
question: {
|
|
437
|
-
title: 'Do you want to add more vehicles?',
|
|
438
|
-
objectLabel: {
|
|
439
|
-
primary: 'Add one more of your vehicles',
|
|
440
|
-
secondary: 'Fill in the details below and then click “Add“.',
|
|
441
|
-
},
|
|
442
|
-
yes: 'Yes',
|
|
443
|
-
no: 'No',
|
|
444
|
-
},
|
|
445
|
-
},
|
|
446
|
-
of: {
|
|
447
|
-
type: 'object',
|
|
448
|
-
label: {
|
|
449
|
-
primary: 'Vehicle details',
|
|
450
|
-
secondary: 'See and change the details of a vehicle',
|
|
451
|
-
},
|
|
452
|
-
extra: {
|
|
453
|
-
fields: [
|
|
454
|
-
{
|
|
455
|
-
key: 'registration_date',
|
|
456
|
-
type: 'date',
|
|
457
|
-
required: true,
|
|
458
|
-
label: { primary: 'Registration date' },
|
|
459
|
-
},
|
|
460
|
-
{
|
|
461
|
-
key: 'make',
|
|
462
|
-
type: 'string',
|
|
463
|
-
required: true,
|
|
464
|
-
label: {
|
|
465
|
-
primary: 'Make',
|
|
466
|
-
},
|
|
467
|
-
},
|
|
468
|
-
{
|
|
469
|
-
key: 'model',
|
|
470
|
-
type: 'string',
|
|
471
|
-
required: true,
|
|
472
|
-
label: {
|
|
473
|
-
primary: 'Model',
|
|
474
|
-
},
|
|
475
|
-
},
|
|
476
|
-
],
|
|
477
|
-
},
|
|
478
|
-
},
|
|
479
|
-
}}
|
|
480
|
-
required
|
|
481
|
-
/>
|
|
482
|
-
<Button type="submit">Submit</Button>
|
|
483
|
-
</Form>
|
|
484
|
-
);
|
|
485
|
-
}
|
|
486
|
-
```
|
|
487
|
-
|
|
488
|
-
### Min or max length
|
|
489
|
-
|
|
490
|
-
You can also use the min or max length validation to define the cardinality
|
|
491
|
-
range for the array. You can use only the `min` key to add a minimum length of
|
|
492
|
-
items or only the `max` key to limit them.
|
|
493
|
-
|
|
494
|
-
:::caution
|
|
495
|
-
|
|
496
|
-
Do not mix and match the exact `length` validation with the `min` or `max`.
|
|
497
|
-
|
|
498
|
-
:::
|
|
499
|
-
|
|
500
|
-
```jsx
|
|
501
|
-
<Field
|
|
502
|
-
extra={{
|
|
503
|
-
min: 2,
|
|
504
|
-
max: 5,
|
|
505
|
-
of: { ... },
|
|
506
|
-
label: { ... },
|
|
507
|
-
}}
|
|
508
|
-
/>
|
|
509
|
-
```
|
|
510
|
-
|
|
511
|
-
The example below will validate this and show all the error messages necessary
|
|
512
|
-
to make sure that the users understand what is going wrong with the process.
|
|
513
|
-
|
|
514
|
-
```jsx live
|
|
515
|
-
import React from 'react';
|
|
516
|
-
import Form, { Field } from '@digigov/form';
|
|
517
|
-
import Button from '@digigov/ui/form/Button';
|
|
518
|
-
|
|
519
|
-
export default function SimpleForm() {
|
|
520
|
-
return (
|
|
521
|
-
<Form>
|
|
522
|
-
<Field
|
|
523
|
-
key="vehicles"
|
|
524
|
-
name="vehicles"
|
|
525
|
-
label={{ primary: 'Vehicles' }}
|
|
526
|
-
type="array"
|
|
527
|
-
multiplicity={true}
|
|
528
|
-
extra={{
|
|
529
|
-
border: true,
|
|
530
|
-
min: 2,
|
|
531
|
-
max: 5,
|
|
532
|
-
label: {
|
|
533
|
-
object: {
|
|
534
|
-
title: 'Vehicle',
|
|
535
|
-
title_added: 'The vehicles you have already added',
|
|
536
|
-
nothing_added: 'You have not added any vehicles yet.',
|
|
537
|
-
add: 'Add',
|
|
538
|
-
delete: 'Remove',
|
|
539
|
-
},
|
|
540
|
-
question: {
|
|
541
|
-
title: 'Do you want to add more vehicles?',
|
|
542
|
-
objectLabel: {
|
|
543
|
-
primary: 'Add one more of your vehicles',
|
|
544
|
-
secondary: 'Fill in the details below and then click “Add“.',
|
|
545
|
-
},
|
|
546
|
-
yes: 'Yes',
|
|
547
|
-
no: 'No',
|
|
548
|
-
},
|
|
549
|
-
},
|
|
550
|
-
of: {
|
|
551
|
-
type: 'object',
|
|
552
|
-
label: {
|
|
553
|
-
primary: 'Vehicle details',
|
|
554
|
-
secondary: 'See and change the details of a vehicle',
|
|
555
|
-
},
|
|
556
|
-
extra: {
|
|
557
|
-
fields: [
|
|
558
|
-
{
|
|
559
|
-
key: 'registration_date',
|
|
560
|
-
type: 'date',
|
|
561
|
-
required: true,
|
|
562
|
-
label: { primary: 'Registration date' },
|
|
563
|
-
},
|
|
564
|
-
{
|
|
565
|
-
key: 'make',
|
|
566
|
-
type: 'string',
|
|
567
|
-
required: true,
|
|
568
|
-
label: {
|
|
569
|
-
primary: 'Make',
|
|
570
|
-
},
|
|
571
|
-
},
|
|
572
|
-
{
|
|
573
|
-
key: 'model',
|
|
574
|
-
type: 'string',
|
|
575
|
-
required: true,
|
|
576
|
-
label: {
|
|
577
|
-
primary: 'Model',
|
|
578
|
-
},
|
|
579
|
-
},
|
|
580
|
-
],
|
|
581
|
-
},
|
|
582
|
-
},
|
|
583
|
-
}}
|
|
584
|
-
required
|
|
585
|
-
/>
|
|
586
|
-
<Button type="submit">Submit</Button>
|
|
587
|
-
</Form>
|
|
588
|
-
);
|
|
589
|
-
}
|
|
590
|
-
```
|