@digigov/form 1.2.0-dcbd7ded → 2.0.0-7d9a8d86
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 +74 -68
- package/Field/FieldBase.js.map +7 -0
- package/Field/FieldBaseContainer/index.js +40 -34
- package/Field/FieldBaseContainer.js.map +7 -0
- package/Field/FieldConditional/index.js +48 -41
- package/Field/FieldConditional.js.map +7 -0
- package/Field/index.js +66 -61
- package/Field/index.js.map +7 -0
- package/Field/types/index.js +1 -1
- package/Field/types.js.map +7 -0
- package/Field/utils/index.js +84 -85
- package/Field/utils.js.map +7 -0
- package/FieldArray/FieldArray.stories/index.js +10 -6
- package/FieldArray/FieldArray.stories.js.map +7 -0
- package/FieldArray/__stories__/Default/index.js +90 -81
- package/FieldArray/__stories__/Default.js.map +7 -0
- package/FieldArray/__stories__/WithExactLength/index.js +90 -81
- package/FieldArray/__stories__/WithExactLength.js.map +7 -0
- package/FieldArray/index.js +49 -54
- package/FieldArray/index.js.map +7 -0
- package/FieldObject/index.js +52 -50
- package/FieldObject/index.js.map +7 -0
- package/Fieldset/FieldsetWithContext/index.js +28 -31
- package/Fieldset/FieldsetWithContext.js.map +7 -0
- package/Fieldset/index.js +33 -26
- package/Fieldset/index.js.map +7 -0
- package/Fieldset/types/index.js +1 -1
- 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 +99 -113
- package/FormBuilder/FormBuilder.js.map +7 -0
- package/FormBuilder/FormBuilder.stories/index.js +9 -5
- package/FormBuilder/FormBuilder.stories.js.map +7 -0
- package/FormBuilder/__stories__/Default/index.js +23 -23
- package/FormBuilder/__stories__/Default.js.map +7 -0
- package/FormBuilder/index.js +6 -2
- package/FormBuilder/index.js.map +7 -0
- package/FormContext/index.js +7 -3
- package/FormContext.js.map +7 -0
- package/MultiplicityField/MultiplicityField.stories/index.js +14 -10
- package/MultiplicityField/MultiplicityField.stories.js.map +7 -0
- package/MultiplicityField/__stories__/Default/index.js +94 -85
- package/MultiplicityField/__stories__/Default.js.map +7 -0
- package/MultiplicityField/__stories__/PreviewDisplay/index.js +84 -65
- package/MultiplicityField/__stories__/PreviewDisplay.js.map +7 -0
- package/MultiplicityField/__stories__/WithExactLength/index.js +91 -80
- package/MultiplicityField/__stories__/WithExactLength.js.map +7 -0
- package/MultiplicityField/__stories__/WithMaxLength/index.js +94 -83
- package/MultiplicityField/__stories__/WithMaxLength.js.map +7 -0
- package/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +95 -84
- package/MultiplicityField/__stories__/WithMinAndMaxLength.js.map +7 -0
- package/MultiplicityField/__stories__/WithMinLength/index.js +94 -83
- package/MultiplicityField/__stories__/WithMinLength.js.map +7 -0
- package/MultiplicityField/add-objects/index.js +100 -131
- package/MultiplicityField/add-objects.js.map +7 -0
- package/MultiplicityField/index.js +94 -98
- package/MultiplicityField/index.js.map +7 -0
- package/Questions/Questions/index.js +35 -50
- package/Questions/Questions.js.map +7 -0
- package/Questions/Questions.stories/index.js +9 -5
- 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 +40 -46
- package/Questions/Step/ReviewStep.js.map +7 -0
- package/Questions/Step/Step/index.js +29 -43
- package/Questions/Step/Step.js.map +7 -0
- package/Questions/Step/StepArrayReview/index.js +43 -42
- 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 +27 -22
- package/Questions/Step/StepDescription.js.map +7 -0
- package/Questions/Step/StepForm/index.js +32 -39
- package/Questions/Step/StepForm.js.map +7 -0
- package/Questions/Step/StepQuote/index.js +12 -9
- package/Questions/Step/StepQuote.js.map +7 -0
- package/Questions/Step/StepTitle/index.js +36 -36
- 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.js +17 -13
- package/Questions/Step/index.js.map +7 -0
- package/Questions/Step/types/index.js +1 -1
- package/Questions/Step/types.js.map +7 -0
- package/Questions/__stories__/Default/index.js +111 -98
- package/Questions/__stories__/Default.js.map +7 -0
- package/Questions/getNextStep/index.js +10 -10
- package/Questions/getNextStep.js.map +7 -0
- package/Questions/index.js +7 -3
- package/Questions/index.js.map +7 -0
- package/Questions/index.spec/index.js +63 -57
- package/Questions/index.spec.js.map +7 -0
- package/Questions/types/index.js +1 -1
- package/Questions/types.js.map +7 -0
- package/cjs/Field/FieldBase/index.js +100 -74
- package/cjs/Field/FieldBase.js.map +7 -0
- package/cjs/Field/FieldBaseContainer/index.js +66 -40
- package/cjs/Field/FieldBaseContainer.js.map +7 -0
- package/cjs/Field/FieldConditional/index.js +74 -47
- package/cjs/Field/FieldConditional.js.map +7 -0
- package/cjs/Field/index.js +92 -70
- package/cjs/Field/index.js.map +7 -0
- package/cjs/Field/types/index.js +4 -5
- package/cjs/Field/types.js.map +7 -0
- package/cjs/Field/utils/index.js +120 -106
- package/cjs/Field/utils.js.map +7 -0
- package/cjs/FieldArray/FieldArray.stories/index.js +36 -37
- package/cjs/FieldArray/FieldArray.stories.js.map +7 -0
- package/cjs/FieldArray/__stories__/Default/index.js +116 -90
- package/cjs/FieldArray/__stories__/Default.js.map +7 -0
- package/cjs/FieldArray/__stories__/WithExactLength/index.js +116 -90
- package/cjs/FieldArray/__stories__/WithExactLength.js.map +7 -0
- package/cjs/FieldArray/index.js +75 -60
- package/cjs/FieldArray/index.js.map +7 -0
- package/cjs/FieldObject/index.js +78 -59
- package/cjs/FieldObject/index.js.map +7 -0
- package/cjs/Fieldset/FieldsetWithContext/index.js +49 -40
- package/cjs/Fieldset/FieldsetWithContext.js.map +7 -0
- package/cjs/Fieldset/index.js +61 -36
- package/cjs/Fieldset/index.js.map +7 -0
- package/cjs/Fieldset/types/index.js +4 -5
- package/cjs/Fieldset/types.js.map +7 -0
- package/cjs/Form.stories/index.js +15 -8
- package/cjs/Form.stories.js.map +7 -0
- package/cjs/FormBuilder/FormBuilder/index.js +127 -123
- package/cjs/FormBuilder/FormBuilder.js.map +7 -0
- package/cjs/FormBuilder/FormBuilder.stories/index.js +35 -25
- package/cjs/FormBuilder/FormBuilder.stories.js.map +7 -0
- package/cjs/FormBuilder/__stories__/Default/index.js +50 -33
- package/cjs/FormBuilder/__stories__/Default.js.map +7 -0
- package/cjs/FormBuilder/index.js +30 -7
- package/cjs/FormBuilder/index.js.map +7 -0
- package/cjs/FormContext/index.js +33 -8
- package/cjs/FormContext.js.map +7 -0
- package/cjs/MultiplicityField/MultiplicityField.stories/index.js +40 -85
- package/cjs/MultiplicityField/MultiplicityField.stories.js.map +7 -0
- package/cjs/MultiplicityField/__stories__/Default/index.js +120 -94
- package/cjs/MultiplicityField/__stories__/Default.js.map +7 -0
- package/cjs/MultiplicityField/__stories__/PreviewDisplay/index.js +93 -74
- package/cjs/MultiplicityField/__stories__/PreviewDisplay.js.map +7 -0
- package/cjs/MultiplicityField/__stories__/WithExactLength/index.js +117 -89
- package/cjs/MultiplicityField/__stories__/WithExactLength.js.map +7 -0
- package/cjs/MultiplicityField/__stories__/WithMaxLength/index.js +120 -92
- package/cjs/MultiplicityField/__stories__/WithMaxLength.js.map +7 -0
- package/cjs/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +121 -93
- package/cjs/MultiplicityField/__stories__/WithMinAndMaxLength.js.map +7 -0
- package/cjs/MultiplicityField/__stories__/WithMinLength/index.js +120 -92
- package/cjs/MultiplicityField/__stories__/WithMinLength.js.map +7 -0
- package/cjs/MultiplicityField/add-objects/index.js +124 -137
- package/cjs/MultiplicityField/add-objects.js.map +7 -0
- package/cjs/MultiplicityField/index.js +121 -107
- package/cjs/MultiplicityField/index.js.map +7 -0
- package/cjs/Questions/Questions/index.js +61 -59
- package/cjs/Questions/Questions.js.map +7 -0
- package/cjs/Questions/Questions.stories/index.js +35 -25
- package/cjs/Questions/Questions.stories.js.map +7 -0
- package/cjs/Questions/QuestionsContext/index.js +35 -14
- package/cjs/Questions/QuestionsContext.js.map +7 -0
- package/cjs/Questions/Step/ReviewStep/index.js +60 -55
- package/cjs/Questions/Step/ReviewStep.js.map +7 -0
- package/cjs/Questions/Step/Step/index.js +55 -52
- package/cjs/Questions/Step/Step.js.map +7 -0
- package/cjs/Questions/Step/StepArrayReview/index.js +61 -51
- package/cjs/Questions/Step/StepArrayReview.js.map +7 -0
- package/cjs/Questions/Step/StepContext/index.js +41 -24
- package/cjs/Questions/Step/StepContext.js.map +7 -0
- package/cjs/Questions/Step/StepDescription/index.js +54 -31
- package/cjs/Questions/Step/StepDescription.js.map +7 -0
- package/cjs/Questions/Step/StepForm/index.js +58 -48
- package/cjs/Questions/Step/StepForm.js.map +7 -0
- package/cjs/Questions/Step/StepQuote/index.js +38 -15
- package/cjs/Questions/Step/StepQuote.js.map +7 -0
- package/cjs/Questions/Step/StepTitle/index.js +62 -45
- package/cjs/Questions/Step/StepTitle.js.map +7 -0
- package/cjs/Questions/Step/getAddMoreFields/index.js +38 -25
- package/cjs/Questions/Step/getAddMoreFields.js.map +7 -0
- package/cjs/Questions/Step/index.js +42 -143
- package/cjs/Questions/Step/index.js.map +7 -0
- package/cjs/Questions/Step/types/index.js +4 -5
- package/cjs/Questions/Step/types.js.map +7 -0
- package/cjs/Questions/__stories__/Default/index.js +131 -107
- package/cjs/Questions/__stories__/Default.js.map +7 -0
- package/cjs/Questions/getNextStep/index.js +19 -14
- package/cjs/Questions/getNextStep.js.map +7 -0
- package/cjs/Questions/index.js +31 -20
- package/cjs/Questions/index.js.map +7 -0
- package/cjs/Questions/index.spec/index.js +81 -61
- package/cjs/Questions/index.spec.js.map +7 -0
- package/cjs/Questions/types/index.js +4 -5
- package/cjs/Questions/types.js.map +7 -0
- package/cjs/index.js +31 -21
- package/cjs/index.js.map +7 -0
- package/cjs/inputs/AutoCompleteInput/AutoComplete.stories/index.js +36 -25
- package/cjs/inputs/AutoCompleteInput/AutoComplete.stories.js.map +7 -0
- package/cjs/inputs/AutoCompleteInput/__stories__/Default/index.js +70 -53
- package/cjs/inputs/AutoCompleteInput/__stories__/Default.js.map +7 -0
- package/cjs/inputs/AutoCompleteInput/__stories__/Multiple/index.js +72 -0
- package/cjs/inputs/AutoCompleteInput/__stories__/Multiple.js.map +7 -0
- package/cjs/inputs/AutoCompleteInput/index.js +58 -40
- package/cjs/inputs/AutoCompleteInput/index.js.map +7 -0
- package/cjs/inputs/Checkboxes/Checkboxes.stories/index.js +37 -49
- package/cjs/inputs/Checkboxes/Checkboxes.stories.js.map +7 -0
- package/cjs/inputs/Checkboxes/__stories__/Conditional/index.js +113 -88
- package/cjs/inputs/Checkboxes/__stories__/Conditional.js.map +7 -0
- package/cjs/inputs/Checkboxes/__stories__/Default/index.js +63 -48
- package/cjs/inputs/Checkboxes/__stories__/Default.js.map +7 -0
- package/cjs/inputs/Checkboxes/__stories__/WithDivider/index.js +64 -49
- package/cjs/inputs/Checkboxes/__stories__/WithDivider.js.map +7 -0
- package/cjs/inputs/Checkboxes/index.js +96 -98
- package/cjs/inputs/Checkboxes/index.js.map +7 -0
- package/cjs/inputs/DateInput/DateInput.stories/index.js +35 -25
- package/cjs/inputs/DateInput/DateInput.stories.js.map +7 -0
- package/cjs/inputs/DateInput/__stories__/Default/index.js +50 -31
- package/cjs/inputs/DateInput/__stories__/Default.js.map +7 -0
- package/cjs/inputs/DateInput/index.js +90 -90
- package/cjs/inputs/DateInput/index.js.map +7 -0
- package/cjs/inputs/FileInput/FileInput.stories/index.js +35 -25
- package/cjs/inputs/FileInput/FileInput.stories.js.map +7 -0
- package/cjs/inputs/FileInput/__stories__/Default/index.js +46 -29
- package/cjs/inputs/FileInput/__stories__/Default.js.map +7 -0
- package/cjs/inputs/FileInput/index.js +58 -59
- package/cjs/inputs/FileInput/index.js.map +7 -0
- package/cjs/inputs/ImageInput/ImageInput.stories/index.js +37 -49
- package/cjs/inputs/ImageInput/ImageInput.stories.js.map +7 -0
- package/cjs/inputs/ImageInput/__stories__/Default/index.js +54 -35
- package/cjs/inputs/ImageInput/__stories__/Default.js.map +7 -0
- package/cjs/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +61 -42
- package/cjs/inputs/ImageInput/__stories__/WithInvalidImageDimension.js.map +7 -0
- package/cjs/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +58 -39
- package/cjs/inputs/ImageInput/__stories__/WithInvalidImageSize.js.map +7 -0
- package/cjs/inputs/ImageInput/index.js +65 -64
- package/cjs/inputs/ImageInput/index.js.map +7 -0
- package/cjs/inputs/Input/Input.stories/index.js +45 -134
- package/cjs/inputs/Input/Input.stories.js.map +7 -0
- package/cjs/inputs/Input/__stories__/AFM/index.js +49 -30
- package/cjs/inputs/Input/__stories__/AFM.js.map +7 -0
- package/cjs/inputs/Input/__stories__/Boolean/index.js +50 -31
- package/cjs/inputs/Input/__stories__/Boolean.js.map +7 -0
- package/cjs/inputs/Input/__stories__/Default/index.js +50 -31
- package/cjs/inputs/Input/__stories__/Default.js.map +7 -0
- package/cjs/inputs/Input/__stories__/IBAN/index.js +50 -31
- package/cjs/inputs/Input/__stories__/IBAN.js.map +7 -0
- package/cjs/inputs/Input/__stories__/Integer/index.js +47 -26
- package/cjs/inputs/Input/__stories__/Integer.js.map +7 -0
- package/cjs/inputs/Input/__stories__/LandlineNumber/index.js +53 -34
- package/cjs/inputs/Input/__stories__/LandlineNumber.js.map +7 -0
- package/cjs/inputs/Input/__stories__/MobilePhone/index.js +53 -34
- package/cjs/inputs/Input/__stories__/MobilePhone.js.map +7 -0
- package/cjs/inputs/Input/__stories__/PhoneNumber/index.js +52 -33
- package/cjs/inputs/Input/__stories__/PhoneNumber.js.map +7 -0
- package/cjs/inputs/Input/__stories__/PostalCode/index.js +50 -33
- package/cjs/inputs/Input/__stories__/PostalCode.js.map +7 -0
- package/cjs/inputs/Input/__stories__/TextWithCharacterLimit/index.js +50 -37
- package/cjs/inputs/Input/__stories__/TextWithCharacterLimit.js.map +7 -0
- package/cjs/inputs/Input/index.js +69 -67
- package/cjs/inputs/Input/index.js.map +7 -0
- package/cjs/inputs/Label/Label.stories/index.js +35 -25
- package/cjs/inputs/Label/Label.stories.js.map +7 -0
- package/cjs/inputs/Label/__stories__/Default/index.js +52 -35
- package/cjs/inputs/Label/__stories__/Default.js.map +7 -0
- package/cjs/inputs/Label/index.js +41 -20
- package/cjs/inputs/Label/index.js.map +7 -0
- package/cjs/inputs/OtpInput/OtpInput.stories/index.js +35 -25
- package/cjs/inputs/OtpInput/OtpInput.stories.js.map +7 -0
- package/cjs/inputs/OtpInput/__stories__/Default/index.js +55 -36
- package/cjs/inputs/OtpInput/__stories__/Default.js.map +7 -0
- package/cjs/inputs/OtpInput/index.js +102 -96
- package/cjs/inputs/OtpInput/index.js.map +7 -0
- package/cjs/inputs/Radio/Radio.stories/index.js +37 -49
- package/cjs/inputs/Radio/Radio.stories.js.map +7 -0
- package/cjs/inputs/Radio/__stories__/Conditional/index.js +113 -88
- package/cjs/inputs/Radio/__stories__/Conditional.js.map +7 -0
- package/cjs/inputs/Radio/__stories__/Default/index.js +67 -53
- package/cjs/inputs/Radio/__stories__/Default.js.map +7 -0
- package/cjs/inputs/Radio/__stories__/WithDivider/index.js +68 -54
- package/cjs/inputs/Radio/__stories__/WithDivider.js.map +7 -0
- package/cjs/inputs/Radio/index.js +77 -60
- package/cjs/inputs/Radio/index.js.map +7 -0
- package/cjs/inputs/Select/Select.stories/index.js +35 -25
- package/cjs/inputs/Select/Select.stories.js.map +7 -0
- package/cjs/inputs/Select/__stories__/Default/index.js +72 -59
- package/cjs/inputs/Select/__stories__/Default.js.map +7 -0
- package/cjs/inputs/Select/index.js +46 -36
- package/cjs/inputs/Select/index.js.map +7 -0
- package/cjs/inputs/index.js +56 -69
- package/cjs/inputs/index.js.map +7 -0
- package/cjs/internal/index.js +89 -346
- package/cjs/internal.js.map +7 -0
- package/cjs/lazy/index.js +87 -516
- package/cjs/lazy.js.map +7 -0
- package/cjs/registry/index.js +156 -137
- package/cjs/registry.js.map +7 -0
- package/cjs/types/index.js +4 -5
- package/cjs/types.js.map +7 -0
- package/cjs/utils/index.js +61 -79
- package/cjs/utils.js.map +7 -0
- package/cjs/validators/index.js +129 -131
- package/cjs/validators/index.js.map +7 -0
- package/cjs/validators/types/index.js +4 -5
- package/cjs/validators/types.js.map +7 -0
- package/cjs/validators/utils/afm/index.js +26 -21
- package/cjs/validators/utils/afm.js.map +7 -0
- package/cjs/validators/utils/file/index.js +31 -46
- package/cjs/validators/utils/file.js.map +7 -0
- package/cjs/validators/utils/iban/index.js +24 -17
- package/cjs/validators/utils/iban.js.map +7 -0
- package/cjs/validators/utils/image/index.js +76 -112
- package/cjs/validators/utils/image.js.map +7 -0
- package/cjs/validators/utils/index.js +70 -158
- package/cjs/validators/utils/index.js.map +7 -0
- package/cjs/validators/utils/int/index.js +22 -12
- package/cjs/validators/utils/int.js.map +7 -0
- package/cjs/validators/utils/number/index.js +21 -11
- package/cjs/validators/utils/number.js.map +7 -0
- package/cjs/validators/utils/otp/index.js +23 -13
- package/cjs/validators/utils/otp.js.map +7 -0
- package/cjs/validators/utils/phone/index.js +94 -58
- package/cjs/validators/utils/phone.js.map +7 -0
- package/cjs/validators/utils/postal_code/index.js +24 -16
- package/cjs/validators/utils/postal_code.js.map +7 -0
- package/cjs/validators/utils/text_limit/index.js +28 -25
- package/cjs/validators/utils/text_limit.js.map +7 -0
- package/cjs/validators/utils/uuid4/index.js +22 -13
- package/cjs/validators/utils/uuid4.js.map +7 -0
- package/cjs/validators/validators.spec/index.js +77 -60
- package/cjs/validators/validators.spec.js.map +7 -0
- package/index.js +8 -4
- package/index.js.map +7 -0
- package/inputs/AutoCompleteInput/AutoComplete.stories/index.js +10 -5
- package/inputs/AutoCompleteInput/AutoComplete.stories.d.ts +1 -0
- package/inputs/AutoCompleteInput/AutoComplete.stories.js.map +7 -0
- package/inputs/AutoCompleteInput/__stories__/Default/index.js +44 -44
- package/inputs/AutoCompleteInput/__stories__/Default.d.ts +1 -0
- package/inputs/AutoCompleteInput/__stories__/Default.js.map +7 -0
- package/inputs/AutoCompleteInput/__stories__/Multiple/index.js +45 -0
- package/inputs/AutoCompleteInput/__stories__/Multiple/package.json +6 -0
- package/inputs/AutoCompleteInput/__stories__/Multiple.d.ts +2 -0
- package/inputs/AutoCompleteInput/__stories__/Multiple.js.map +7 -0
- package/inputs/AutoCompleteInput/index.js +32 -31
- package/inputs/AutoCompleteInput/index.js.map +7 -0
- package/inputs/Checkboxes/Checkboxes.stories/index.js +11 -7
- package/inputs/Checkboxes/Checkboxes.stories.js.map +7 -0
- package/inputs/Checkboxes/__stories__/Conditional/index.js +87 -79
- package/inputs/Checkboxes/__stories__/Conditional.d.ts +1 -0
- package/inputs/Checkboxes/__stories__/Conditional.js.map +7 -0
- package/inputs/Checkboxes/__stories__/Default/index.js +36 -38
- package/inputs/Checkboxes/__stories__/Default.js.map +7 -0
- package/inputs/Checkboxes/__stories__/WithDivider/index.js +37 -39
- package/inputs/Checkboxes/__stories__/WithDivider.js.map +7 -0
- package/inputs/Checkboxes/index.js +70 -89
- package/inputs/Checkboxes/index.js.map +7 -0
- package/inputs/DateInput/DateInput.stories/index.js +9 -5
- package/inputs/DateInput/DateInput.stories.js.map +7 -0
- package/inputs/DateInput/__stories__/Default/index.js +23 -21
- package/inputs/DateInput/__stories__/Default.js.map +7 -0
- package/inputs/DateInput/index.js +63 -80
- package/inputs/DateInput/index.js.map +7 -0
- package/inputs/FileInput/FileInput.stories/index.js +9 -5
- package/inputs/FileInput/FileInput.stories.js.map +7 -0
- package/inputs/FileInput/__stories__/Default/index.js +19 -19
- package/inputs/FileInput/__stories__/Default.js.map +7 -0
- package/inputs/FileInput/index.js +32 -50
- package/inputs/FileInput/index.js.map +7 -0
- package/inputs/ImageInput/ImageInput.stories/index.js +11 -7
- package/inputs/ImageInput/ImageInput.stories.js.map +7 -0
- package/inputs/ImageInput/__stories__/Default/index.js +27 -25
- package/inputs/ImageInput/__stories__/Default.js.map +7 -0
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +34 -32
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension.js.map +7 -0
- package/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +31 -29
- package/inputs/ImageInput/__stories__/WithInvalidImageSize.js.map +7 -0
- package/inputs/ImageInput/index.js +38 -55
- package/inputs/ImageInput/index.js.map +7 -0
- package/inputs/Input/Input.stories/index.js +18 -14
- package/inputs/Input/Input.stories.js.map +7 -0
- package/inputs/Input/__stories__/AFM/index.js +22 -20
- package/inputs/Input/__stories__/AFM.js.map +7 -0
- package/inputs/Input/__stories__/Boolean/index.js +23 -21
- package/inputs/Input/__stories__/Boolean.js.map +7 -0
- package/inputs/Input/__stories__/Default/index.js +23 -21
- package/inputs/Input/__stories__/Default.js.map +7 -0
- package/inputs/Input/__stories__/IBAN/index.js +23 -21
- package/inputs/Input/__stories__/IBAN.js.map +7 -0
- package/inputs/Input/__stories__/Integer/index.js +21 -17
- package/inputs/Input/__stories__/Integer.js.map +7 -0
- package/inputs/Input/__stories__/LandlineNumber/index.js +26 -24
- package/inputs/Input/__stories__/LandlineNumber.js.map +7 -0
- package/inputs/Input/__stories__/MobilePhone/index.js +26 -24
- package/inputs/Input/__stories__/MobilePhone.js.map +7 -0
- package/inputs/Input/__stories__/PhoneNumber/index.js +25 -23
- package/inputs/Input/__stories__/PhoneNumber.js.map +7 -0
- package/inputs/Input/__stories__/PostalCode/index.js +23 -23
- package/inputs/Input/__stories__/PostalCode.js.map +7 -0
- package/inputs/Input/__stories__/TextWithCharacterLimit/index.js +23 -27
- package/inputs/Input/__stories__/TextWithCharacterLimit.js.map +7 -0
- package/inputs/Input/index.js +43 -61
- package/inputs/Input/index.js.map +7 -0
- package/inputs/Label/Label.stories/index.js +9 -5
- package/inputs/Label/Label.stories.js.map +7 -0
- package/inputs/Label/__stories__/Default/index.js +25 -25
- package/inputs/Label/__stories__/Default.js.map +7 -0
- package/inputs/Label/index.js +15 -14
- package/inputs/Label/index.js.map +7 -0
- package/inputs/OtpInput/OtpInput.stories/index.js +9 -5
- package/inputs/OtpInput/OtpInput.stories.js.map +7 -0
- package/inputs/OtpInput/__stories__/Default/index.js +28 -26
- package/inputs/OtpInput/__stories__/Default.js.map +7 -0
- package/inputs/OtpInput/index.js +76 -87
- package/inputs/OtpInput/index.js.map +7 -0
- package/inputs/Radio/Radio.stories/index.js +11 -7
- package/inputs/Radio/Radio.stories.js.map +7 -0
- package/inputs/Radio/__stories__/Conditional/index.js +87 -79
- package/inputs/Radio/__stories__/Conditional.d.ts +1 -0
- package/inputs/Radio/__stories__/Conditional.js.map +7 -0
- package/inputs/Radio/__stories__/Default/index.js +40 -43
- package/inputs/Radio/__stories__/Default.js.map +7 -0
- package/inputs/Radio/__stories__/WithDivider/index.js +41 -44
- package/inputs/Radio/__stories__/WithDivider.js.map +7 -0
- package/inputs/Radio/index.js +51 -54
- package/inputs/Radio/index.js.map +7 -0
- package/inputs/Select/Select.stories/index.js +9 -5
- package/inputs/Select/Select.stories.js.map +7 -0
- package/inputs/Select/__stories__/Default/index.js +45 -49
- package/inputs/Select/__stories__/Default.js.map +7 -0
- package/inputs/Select/index.js +20 -30
- package/inputs/Select/index.js.map +7 -0
- package/inputs/index.js +21 -9
- package/inputs/index.js.map +7 -0
- package/internal/index.js +51 -34
- package/internal.js.map +7 -0
- package/lazy/index.js +63 -395
- package/lazy.d.ts +1 -1
- package/lazy.js.map +7 -0
- package/package.json +6 -7
- package/registry/index.js +132 -129
- package/registry.js.map +7 -0
- package/src/Field/FieldBase.tsx +1 -0
- package/src/Field/utils.ts +4 -4
- package/src/inputs/AutoCompleteInput/AutoComplete.stories.js +1 -0
- package/src/inputs/AutoCompleteInput/__stories__/Default.tsx +1 -0
- package/src/inputs/AutoCompleteInput/__stories__/Multiple.tsx +46 -0
- package/src/inputs/AutoCompleteInput/index.mdx +23 -0
- package/src/inputs/AutoCompleteInput/index.tsx +3 -2
- package/src/inputs/Checkboxes/__stories__/Conditional.tsx +2 -3
- package/src/inputs/Checkboxes/index.mdx +33 -0
- package/src/inputs/Checkboxes/index.tsx +2 -2
- package/src/inputs/DateInput/index.mdx +23 -0
- package/src/inputs/DateInput/index.tsx +1 -1
- package/src/inputs/FileInput/index.mdx +19 -0
- package/src/inputs/ImageInput/index.mdx +19 -0
- package/src/inputs/Input/index.mdx +90 -3
- package/src/inputs/OtpInput/index.mdx +23 -0
- package/src/inputs/OtpInput/index.tsx +1 -1
- package/src/inputs/Radio/__stories__/Conditional.tsx +2 -0
- package/src/inputs/Radio/index.mdx +33 -0
- package/src/inputs/Select/index.mdx +17 -0
- package/types/index.js +1 -1
- package/types.js.map +7 -0
- package/utils/index.js +35 -73
- package/utils.js.map +7 -0
- package/validators/index.js +106 -113
- 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 +21 -41
- 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 +45 -47
- 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 +82 -51
- 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/validators/validators.spec/index.js +64 -58
- package/validators/validators.spec.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/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/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/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/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/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
|
@@ -1,74 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
Object.
|
|
6
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, {get: all[name], enumerable: true});
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
16
|
+
__defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toModule = (module2) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
|
|
22
|
+
};
|
|
23
|
+
__markAsModule(exports);
|
|
24
|
+
__export(exports, {
|
|
25
|
+
OtpInput: () => OtpInput,
|
|
26
|
+
REMOVE_SPACES: () => REMOVE_SPACES,
|
|
27
|
+
RE_DIGIT: () => RE_DIGIT,
|
|
28
|
+
default: () => OtpInput_default
|
|
7
29
|
});
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
14
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
var _SingleCharacterInputs = _interopRequireWildcard(require("@digigov/ui/cjs/form/SingleCharacterInputs"));
|
|
16
|
-
var _excluded = ["name", "maxLength"];
|
|
17
|
-
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); }
|
|
18
|
-
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; }
|
|
19
|
-
var RE_DIGIT = exports.RE_DIGIT = new RegExp(/^\d+$/);
|
|
20
|
-
var REMOVE_SPACES = exports.REMOVE_SPACES = new RegExp(/\s+/g);
|
|
30
|
+
var import_react = __toModule(require("react"));
|
|
31
|
+
var import_SingleCharacterInputs = __toModule(require("@digigov/ui/form/SingleCharacterInputs"));
|
|
32
|
+
const RE_DIGIT = new RegExp(/^\d+$/);
|
|
33
|
+
const REMOVE_SPACES = new RegExp(/\s+/g);
|
|
21
34
|
function useOtp(onChange, maxLength) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
otpValues = _useState2[0],
|
|
25
|
-
setOtpValues = _useState2[1];
|
|
26
|
-
var handleChange = (0, _react.useCallback)(function (otp) {
|
|
35
|
+
const [otpValues, setOtpValues] = (0, import_react.useState)(Array(maxLength).fill(""));
|
|
36
|
+
const handleChange = (0, import_react.useCallback)((otp) => {
|
|
27
37
|
setOtpValues(otp);
|
|
28
|
-
|
|
38
|
+
const otpValue = otp.join("");
|
|
29
39
|
onChange(otpValue);
|
|
30
40
|
}, [onChange]);
|
|
31
|
-
|
|
32
|
-
|
|
41
|
+
const setOtp = (item, idx) => {
|
|
42
|
+
const updatedOTPValues = [...otpValues];
|
|
33
43
|
if (item.length === 1 || item.length === 0) {
|
|
34
|
-
updatedOTPValues[idx] = item[0] ||
|
|
44
|
+
updatedOTPValues[idx] = item[0] || "";
|
|
35
45
|
handleChange(updatedOTPValues);
|
|
36
46
|
} else if (item.length === maxLength) {
|
|
37
|
-
|
|
47
|
+
const valueArray = item.split("").slice(0, maxLength);
|
|
38
48
|
handleChange(valueArray);
|
|
39
49
|
}
|
|
40
50
|
};
|
|
41
|
-
|
|
51
|
+
const setSelectionRange = (0, import_react.useCallback)((target) => {
|
|
42
52
|
return target.setSelectionRange(0, target.value.length);
|
|
43
53
|
}, []);
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
const focusToNextInput = (0, import_react.useCallback)((target) => {
|
|
55
|
+
const nextElement = target.nextElementSibling;
|
|
46
56
|
if (nextElement) {
|
|
47
57
|
nextElement.focus();
|
|
48
58
|
}
|
|
49
59
|
}, []);
|
|
50
|
-
|
|
51
|
-
|
|
60
|
+
const focusToPrevInput = (0, import_react.useCallback)((target) => {
|
|
61
|
+
const previousElement = target.previousElementSibling;
|
|
52
62
|
if (previousElement) {
|
|
53
63
|
previousElement.focus();
|
|
54
64
|
}
|
|
55
65
|
}, []);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
const handleKeyDown = (0, import_react.useCallback)((e, idx) => {
|
|
67
|
+
const {key} = e;
|
|
68
|
+
const target = e.target;
|
|
69
|
+
let targetValue = target.value;
|
|
60
70
|
setSelectionRange(target);
|
|
61
|
-
if (key ===
|
|
71
|
+
if (key === "ArrowRight" || key === "ArrowDown") {
|
|
62
72
|
e.preventDefault();
|
|
63
73
|
return focusToNextInput(target);
|
|
64
74
|
}
|
|
65
|
-
if (key ===
|
|
75
|
+
if (key === "ArrowLeft" || key === "ArrowUp") {
|
|
66
76
|
e.preventDefault();
|
|
67
77
|
return focusToPrevInput(target);
|
|
68
78
|
}
|
|
69
|
-
if (e.key ===
|
|
70
|
-
if (targetValue !==
|
|
71
|
-
targetValue =
|
|
79
|
+
if (e.key === "Backspace" || e.key === "Delete") {
|
|
80
|
+
if (targetValue !== "") {
|
|
81
|
+
targetValue = "";
|
|
72
82
|
} else {
|
|
73
83
|
focusToPrevInput(target);
|
|
74
84
|
}
|
|
@@ -76,17 +86,15 @@ function useOtp(onChange, maxLength) {
|
|
|
76
86
|
return e.preventDefault();
|
|
77
87
|
}
|
|
78
88
|
}, [setOtp, focusToPrevInput, focusToNextInput]);
|
|
79
|
-
|
|
80
|
-
|
|
89
|
+
const handleFocus = (0, import_react.useCallback)((e) => {
|
|
90
|
+
const {target} = e;
|
|
81
91
|
setSelectionRange(target);
|
|
82
92
|
}, [setSelectionRange]);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
// emptry string replaces the deleted value
|
|
89
|
-
if (isTargetValueDigit || targetValue === '') {
|
|
93
|
+
const handleOtpChange = (0, import_react.useCallback)((e, idx) => {
|
|
94
|
+
const target = e.target;
|
|
95
|
+
const targetValue = target.value;
|
|
96
|
+
const isTargetValueDigit = RE_DIGIT.test(targetValue);
|
|
97
|
+
if (isTargetValueDigit || targetValue === "") {
|
|
90
98
|
setOtp(targetValue, idx);
|
|
91
99
|
if (target.value.length > 1) {
|
|
92
100
|
target.blur();
|
|
@@ -94,57 +102,55 @@ function useOtp(onChange, maxLength) {
|
|
|
94
102
|
focusToNextInput(target);
|
|
95
103
|
}
|
|
96
104
|
}, [setOtp, handleKeyDown, handleFocus]);
|
|
97
|
-
|
|
105
|
+
const handlePaste = (0, import_react.useCallback)((e) => {
|
|
98
106
|
e.preventDefault();
|
|
99
|
-
|
|
107
|
+
const pastedData = e.clipboardData.getData("text/plain").replace(REMOVE_SPACES, "");
|
|
100
108
|
if (pastedData) {
|
|
101
109
|
setOtp(pastedData, 0);
|
|
102
110
|
}
|
|
103
111
|
}, []);
|
|
104
112
|
return {
|
|
105
|
-
otpValues
|
|
106
|
-
handleOtpChange
|
|
107
|
-
handleKeyDown
|
|
108
|
-
handleFocus
|
|
109
|
-
handlePaste
|
|
113
|
+
otpValues,
|
|
114
|
+
handleOtpChange,
|
|
115
|
+
handleKeyDown,
|
|
116
|
+
handleFocus,
|
|
117
|
+
handlePaste
|
|
110
118
|
};
|
|
111
119
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
120
|
+
const SingleCharacterInputPart = ({...props}) => {
|
|
121
|
+
return /* @__PURE__ */ import_react.default.createElement(import_SingleCharacterInputs.SingleCharacterInput, {
|
|
122
|
+
...props
|
|
123
|
+
});
|
|
115
124
|
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
value
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
onKeyDown: function onKeyDown(e) {
|
|
142
|
-
return otp.handleKeyDown(e, idx);
|
|
143
|
-
},
|
|
144
|
-
onFocus: otp.handleFocus,
|
|
145
|
-
onPaste: otp.handlePaste,
|
|
146
|
-
error: !digit ? props.error : false
|
|
147
|
-
});
|
|
148
|
-
}));
|
|
125
|
+
const OtpInput = ({name, maxLength = 6, ...props}) => {
|
|
126
|
+
const otp = useOtp(props.onChange, maxLength);
|
|
127
|
+
return /* @__PURE__ */ import_react.default.createElement(import_SingleCharacterInputs.default, null, otp.otpValues.map((digit, idx) => /* @__PURE__ */ import_react.default.createElement(SingleCharacterInputPart, {
|
|
128
|
+
name: `${name}-${idx}`,
|
|
129
|
+
type: "text",
|
|
130
|
+
key: idx,
|
|
131
|
+
autoComplete: "one-time-code",
|
|
132
|
+
pattern: "\\d{1}",
|
|
133
|
+
maxLength,
|
|
134
|
+
value: digit,
|
|
135
|
+
disabled: props.disabled,
|
|
136
|
+
"aria-required": props["aria-required"],
|
|
137
|
+
onChange: (e) => otp.handleOtpChange(e, idx),
|
|
138
|
+
onInput: (e) => {
|
|
139
|
+
if (e.target.value === digit) {
|
|
140
|
+
otp.handleOtpChange(e, idx);
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
onKeyDown: (e) => otp.handleKeyDown(e, idx),
|
|
144
|
+
onFocus: otp.handleFocus,
|
|
145
|
+
onPaste: otp.handlePaste,
|
|
146
|
+
error: !digit ? props.error : false
|
|
147
|
+
})));
|
|
149
148
|
};
|
|
150
|
-
var
|
|
149
|
+
var OtpInput_default = OtpInput;
|
|
150
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
151
|
+
0 && (module.exports = {
|
|
152
|
+
OtpInput,
|
|
153
|
+
REMOVE_SPACES,
|
|
154
|
+
RE_DIGIT
|
|
155
|
+
});
|
|
156
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/inputs/OtpInput/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import React, { useState, useCallback } from 'react';\nimport SingleCharacterInputs, {\n SingleCharacterInput,\n} from '@digigov/ui/form/SingleCharacterInputs';\n\nexport const RE_DIGIT = new RegExp(/^\\d+$/);\nexport const REMOVE_SPACES = new RegExp(/\\s+/g);\n\nfunction useOtp(onChange, maxLength) {\n const [otpValues, setOtpValues] = useState(Array<string>(maxLength).fill(''));\n const handleChange = useCallback(\n (otp: string[]) => {\n setOtpValues(otp);\n const otpValue = otp.join('');\n onChange(otpValue);\n },\n [onChange]\n );\n\n const setOtp = (item: string, idx) => {\n const updatedOTPValues = [...otpValues];\n if (item.length === 1 || item.length === 0) {\n updatedOTPValues[idx] = item[0] || '';\n handleChange(updatedOTPValues);\n } else if (item.length === maxLength) {\n const valueArray = item.split('').slice(0, maxLength);\n handleChange(valueArray);\n }\n };\n\n const setSelectionRange = useCallback((target) => {\n return target.setSelectionRange(0, target.value.length);\n }, []);\n\n const focusToNextInput = useCallback((target: HTMLElement) => {\n const nextElement = target.nextElementSibling as HTMLInputElement | null;\n if (nextElement) {\n nextElement.focus();\n }\n }, []);\n\n const focusToPrevInput = useCallback((target: HTMLElement) => {\n const previousElement = target.previousElementSibling as HTMLInputElement | null;\n if (previousElement) {\n previousElement.focus();\n }\n }, []);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>, idx: number) => {\n const { key } = e;\n const target = e.target as HTMLInputElement;\n let targetValue = target.value;\n setSelectionRange(target);\n if (key === 'ArrowRight' || key === 'ArrowDown') {\n e.preventDefault();\n return focusToNextInput(target);\n }\n if (key === 'ArrowLeft' || key === 'ArrowUp') {\n e.preventDefault();\n return focusToPrevInput(target);\n }\n if (e.key === 'Backspace' || e.key === 'Delete') {\n if (targetValue !== '') {\n targetValue = '';\n } else {\n focusToPrevInput(target);\n }\n setOtp(targetValue, idx);\n return e.preventDefault();\n }\n },\n [setOtp, focusToPrevInput, focusToNextInput]\n );\n\n const handleFocus = useCallback(\n (e: React.FocusEvent<HTMLInputElement>) => {\n const { target } = e;\n setSelectionRange(target);\n },\n [setSelectionRange]\n );\n const handleOtpChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>, idx: number) => {\n const target = e.target;\n const targetValue = target.value;\n const isTargetValueDigit = RE_DIGIT.test(targetValue);\n // We want to pass the empty string when the value is deleted\n // emptry string replaces the deleted value\n if (isTargetValueDigit || targetValue === '') {\n setOtp(targetValue, idx);\n if (target.value.length > 1) {\n target.blur();\n }\n focusToNextInput(target);\n }\n },\n [setOtp, handleKeyDown, handleFocus]\n );\n\n const handlePaste = useCallback(\n (e: React.ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n const pastedData = e.clipboardData\n .getData('text/plain')\n .replace(REMOVE_SPACES, '');\n if (pastedData) {\n setOtp(pastedData, 0);\n }\n },\n []\n );\n return {\n otpValues,\n handleOtpChange,\n handleKeyDown,\n handleFocus,\n handlePaste,\n };\n}\n\nconst SingleCharacterInputPart = ({ ...props }) => {\n return <SingleCharacterInput {...props} />;\n};\n\nexport const OtpInput = ({ name, maxLength = 6, ...props }) => {\n const otp = useOtp(props.onChange, maxLength);\n return (\n <SingleCharacterInputs>\n {otp.otpValues.map((digit, idx) => (\n <SingleCharacterInputPart\n name={`${name}-${idx}`}\n type=\"text\"\n key={idx}\n autoComplete=\"one-time-code\"\n pattern=\"\\d{1}\"\n maxLength={maxLength}\n value={digit}\n disabled={props.disabled}\n aria-required={props['aria-required']}\n onChange={(e) => otp.handleOtpChange(e, idx)}\n onInput={(e) => {\n if (e.target.value === digit) {\n otp.handleOtpChange(e, idx);\n }\n }}\n onKeyDown={(e) => otp.handleKeyDown(e, idx)}\n onFocus={otp.handleFocus}\n onPaste={otp.handlePaste}\n error={!digit ? props.error : false}\n />\n ))}\n </SingleCharacterInputs>\n );\n};\n\nexport default OtpInput;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA6C;AAC7C,mCAEO;AAEA,MAAM,WAAW,IAAI,OAAO;AAC5B,MAAM,gBAAgB,IAAI,OAAO;AAExC,gBAAgB,UAAU,WAAW;AACnC,QAAM,CAAC,WAAW,gBAAgB,2BAAS,MAAc,WAAW,KAAK;AACzE,QAAM,eAAe,8BACnB,CAAC,QAAkB;AACjB,iBAAa;AACb,UAAM,WAAW,IAAI,KAAK;AAC1B,aAAS;AAAA,KAEX,CAAC;AAGH,QAAM,SAAS,CAAC,MAAc,QAAQ;AACpC,UAAM,mBAAmB,CAAC,GAAG;AAC7B,QAAI,KAAK,WAAW,KAAK,KAAK,WAAW,GAAG;AAC1C,uBAAiB,OAAO,KAAK,MAAM;AACnC,mBAAa;AAAA,eACJ,KAAK,WAAW,WAAW;AACpC,YAAM,aAAa,KAAK,MAAM,IAAI,MAAM,GAAG;AAC3C,mBAAa;AAAA;AAAA;AAIjB,QAAM,oBAAoB,8BAAY,CAAC,WAAW;AAChD,WAAO,OAAO,kBAAkB,GAAG,OAAO,MAAM;AAAA,KAC/C;AAEH,QAAM,mBAAmB,8BAAY,CAAC,WAAwB;AAC5D,UAAM,cAAc,OAAO;AAC3B,QAAI,aAAa;AACf,kBAAY;AAAA;AAAA,KAEb;AAEH,QAAM,mBAAmB,8BAAY,CAAC,WAAwB;AAC5D,UAAM,kBAAkB,OAAO;AAC/B,QAAI,iBAAiB;AACnB,sBAAgB;AAAA;AAAA,KAEjB;AAEH,QAAM,gBAAgB,8BACpB,CAAC,GAA0C,QAAgB;AACzD,UAAM,CAAE,OAAQ;AAChB,UAAM,SAAS,EAAE;AACjB,QAAI,cAAc,OAAO;AACzB,sBAAkB;AAClB,QAAI,QAAQ,gBAAgB,QAAQ,aAAa;AAC/C,QAAE;AACF,aAAO,iBAAiB;AAAA;AAE1B,QAAI,QAAQ,eAAe,QAAQ,WAAW;AAC5C,QAAE;AACF,aAAO,iBAAiB;AAAA;AAE1B,QAAI,EAAE,QAAQ,eAAe,EAAE,QAAQ,UAAU;AAC/C,UAAI,gBAAgB,IAAI;AACtB,sBAAc;AAAA,aACT;AACL,yBAAiB;AAAA;AAEnB,aAAO,aAAa;AACpB,aAAO,EAAE;AAAA;AAAA,KAGb,CAAC,QAAQ,kBAAkB;AAG7B,QAAM,cAAc,8BAClB,CAAC,MAA0C;AACzC,UAAM,CAAE,UAAW;AACnB,sBAAkB;AAAA,KAEpB,CAAC;AAEH,QAAM,kBAAkB,8BACtB,CAAC,GAAwC,QAAgB;AACvD,UAAM,SAAS,EAAE;AACjB,UAAM,cAAc,OAAO;AAC3B,UAAM,qBAAqB,SAAS,KAAK;AAGzC,QAAI,sBAAsB,gBAAgB,IAAI;AAC5C,aAAO,aAAa;AACpB,UAAI,OAAO,MAAM,SAAS,GAAG;AAC3B,eAAO;AAAA;AAET,uBAAiB;AAAA;AAAA,KAGrB,CAAC,QAAQ,eAAe;AAG1B,QAAM,cAAc,8BAClB,CAAC,MAA8C;AAC7C,MAAE;AACF,UAAM,aAAa,EAAE,cAClB,QAAQ,cACR,QAAQ,eAAe;AAC1B,QAAI,YAAY;AACd,aAAO,YAAY;AAAA;AAAA,KAGvB;AAEF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAIJ,MAAM,2BAA2B,CAAC,IAAK,WAAY;AACjD,SAAO,mDAAC,mDAAD;AAAA,OAA0B;AAAA;AAAA;AAG5B,MAAM,WAAW,CAAC,CAAE,MAAM,YAAY,MAAM,WAAY;AAC7D,QAAM,MAAM,OAAO,MAAM,UAAU;AACnC,SACE,mDAAC,sCAAD,MACG,IAAI,UAAU,IAAI,CAAC,OAAO,QACzB,mDAAC,0BAAD;AAAA,IACE,MAAM,GAAG,QAAQ;AAAA,IACjB,MAAK;AAAA,IACL,KAAK;AAAA,IACL,cAAa;AAAA,IACb,SAAQ;AAAA,IACR;AAAA,IACA,OAAO;AAAA,IACP,UAAU,MAAM;AAAA,IAChB,iBAAe,MAAM;AAAA,IACrB,UAAU,CAAC,MAAM,IAAI,gBAAgB,GAAG;AAAA,IACxC,SAAS,CAAC,MAAM;AACd,UAAI,EAAE,OAAO,UAAU,OAAO;AAC5B,YAAI,gBAAgB,GAAG;AAAA;AAAA;AAAA,IAG3B,WAAW,CAAC,MAAM,IAAI,cAAc,GAAG;AAAA,IACvC,SAAS,IAAI;AAAA,IACb,SAAS,IAAI;AAAA,IACb,OAAO,CAAC,QAAQ,MAAM,QAAQ;AAAA;AAAA;AAOxC,IAAO,mBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,50 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
Object.
|
|
5
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, {get: all[name], enumerable: true});
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
16
|
+
__defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toModule = (module2) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
|
|
22
|
+
};
|
|
23
|
+
__markAsModule(exports);
|
|
24
|
+
__export(exports, {
|
|
25
|
+
default: () => Radio_stories_default
|
|
6
26
|
});
|
|
7
|
-
var
|
|
8
|
-
exports
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
var _WithDivider = require("@digigov/form/inputs/Radio/__stories__/WithDivider");
|
|
23
|
-
Object.keys(_WithDivider).forEach(function (key) {
|
|
24
|
-
if (key === "default" || key === "__esModule") return;
|
|
25
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
26
|
-
if (key in exports && exports[key] === _WithDivider[key]) return;
|
|
27
|
-
Object.defineProperty(exports, key, {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function get() {
|
|
30
|
-
return _WithDivider[key];
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
var _Conditional = require("@digigov/form/inputs/Radio/__stories__/Conditional");
|
|
35
|
-
Object.keys(_Conditional).forEach(function (key) {
|
|
36
|
-
if (key === "default" || key === "__esModule") return;
|
|
37
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
38
|
-
if (key in exports && exports[key] === _Conditional[key]) return;
|
|
39
|
-
Object.defineProperty(exports, key, {
|
|
40
|
-
enumerable: true,
|
|
41
|
-
get: function get() {
|
|
42
|
-
return _Conditional[key];
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
var _default = exports["default"] = {
|
|
47
|
-
title: 'Digigov Form/inputs/Radio',
|
|
48
|
-
component: _Radio["default"],
|
|
49
|
-
displayName: 'Radio'
|
|
50
|
-
};
|
|
27
|
+
var import_Radio = __toModule(require("@digigov/form/inputs/Radio"));
|
|
28
|
+
__reExport(exports, __toModule(require("@digigov/form/inputs/Radio/__stories__/Default")));
|
|
29
|
+
__reExport(exports, __toModule(require("@digigov/form/inputs/Radio/__stories__/WithDivider")));
|
|
30
|
+
__reExport(exports, __toModule(require("@digigov/form/inputs/Radio/__stories__/Conditional")));
|
|
31
|
+
var Radio_stories_default = {
|
|
32
|
+
title: "Digigov Form/inputs/Radio",
|
|
33
|
+
component: import_Radio.default,
|
|
34
|
+
displayName: "Radio"
|
|
35
|
+
};
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {});
|
|
38
|
+
//# sourceMappingURL=Radio.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/inputs/Radio/Radio.stories.js"],
|
|
4
|
+
"sourcesContent": ["import Radio from '@digigov/form/inputs/Radio';\nexport default {\n title: 'Digigov Form/inputs/Radio',\n component: Radio,\n displayName: 'Radio',\n};\nexport * from '@digigov/form/inputs/Radio/__stories__/Default';\nexport * from '@digigov/form/inputs/Radio/__stories__/WithDivider';\nexport * from '@digigov/form/inputs/Radio/__stories__/Conditional';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAMlB,oBAAc;AACd,oBAAc;AACd,oBAAc;AAPd,IAAO,wBAAQ;AAAA,EACb,OAAO;AAAA,EACP,WAAW;AAAA,EACX,aAAa;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,102 +1,127 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
Object.
|
|
6
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", {value: true});
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, {get: all[name], enumerable: true});
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
16
|
+
__defProp(target, key, {get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable});
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toModule = (module2) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? {get: () => module2.default, enumerable: true} : {value: module2, enumerable: true})), module2);
|
|
22
|
+
};
|
|
23
|
+
__markAsModule(exports);
|
|
24
|
+
__export(exports, {
|
|
25
|
+
Conditional: () => Conditional,
|
|
26
|
+
default: () => Conditional_default
|
|
7
27
|
});
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
required: true
|
|
28
|
+
var import_react = __toModule(require("react"));
|
|
29
|
+
var import_form = __toModule(require("@digigov/form"));
|
|
30
|
+
var import_Button = __toModule(require("@digigov/ui/form/Button"));
|
|
31
|
+
const fields = [
|
|
32
|
+
{
|
|
33
|
+
key: "landline",
|
|
34
|
+
type: "phone_number",
|
|
35
|
+
label: {
|
|
36
|
+
secondary: "\u0395\u03B9\u03C3\u03AC\u03B3\u03B5\u03C4\u03B5 \u03C4\u03BF \u03BD\u03BF\u03CD\u03BC\u03B5\u03C1\u03BF \u03C4\u03BF\u03C5 \u03C3\u03C4\u03B1\u03B8\u03B5\u03C1\u03BF\u03CD \u03C3\u03B1\u03C2 \u03C4\u03B7\u03BB\u03B5\u03C6\u03CE\u03BD\u03BF\u03C5."
|
|
37
|
+
},
|
|
38
|
+
enabled: false,
|
|
39
|
+
condition: {
|
|
40
|
+
auth_form: {
|
|
41
|
+
is: "via_mobile_phone",
|
|
42
|
+
then: {
|
|
43
|
+
enabled: true,
|
|
44
|
+
required: true
|
|
45
|
+
}
|
|
27
46
|
}
|
|
28
47
|
}
|
|
29
|
-
}
|
|
30
|
-
}, {
|
|
31
|
-
key: 'mobile_phone',
|
|
32
|
-
type: 'mobile_phone',
|
|
33
|
-
label: {
|
|
34
|
-
secondary: 'Εισάγετε το νούμερο του κινητού σας τηλεφώνου.'
|
|
35
48
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
49
|
+
{
|
|
50
|
+
key: "mobile_phone",
|
|
51
|
+
type: "mobile_phone",
|
|
52
|
+
label: {
|
|
53
|
+
secondary: "\u0395\u03B9\u03C3\u03AC\u03B3\u03B5\u03C4\u03B5 \u03C4\u03BF \u03BD\u03BF\u03CD\u03BC\u03B5\u03C1\u03BF \u03C4\u03BF\u03C5 \u03BA\u03B9\u03BD\u03B7\u03C4\u03BF\u03CD \u03C3\u03B1\u03C2 \u03C4\u03B7\u03BB\u03B5\u03C6\u03CE\u03BD\u03BF\u03C5."
|
|
54
|
+
},
|
|
55
|
+
enabled: false,
|
|
56
|
+
condition: {
|
|
57
|
+
auth_form: {
|
|
58
|
+
is: "via_mobile_phone",
|
|
59
|
+
then: {
|
|
60
|
+
enabled: true,
|
|
61
|
+
required: true
|
|
62
|
+
}
|
|
43
63
|
}
|
|
44
64
|
}
|
|
45
|
-
}
|
|
46
|
-
}, {
|
|
47
|
-
key: 'email',
|
|
48
|
-
type: 'email',
|
|
49
|
-
label: {
|
|
50
|
-
secondary: 'Εισάγετε την διεύθυνση του ηλεκτρονικού σας ταχυδρομείου.'
|
|
51
65
|
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
66
|
+
{
|
|
67
|
+
key: "email",
|
|
68
|
+
type: "email",
|
|
69
|
+
label: {
|
|
70
|
+
secondary: "\u0395\u03B9\u03C3\u03AC\u03B3\u03B5\u03C4\u03B5 \u03C4\u03B7\u03BD \u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 \u03C4\u03BF\u03C5 \u03B7\u03BB\u03B5\u03BA\u03C4\u03C1\u03BF\u03BD\u03B9\u03BA\u03BF\u03CD \u03C3\u03B1\u03C2 \u03C4\u03B1\u03C7\u03C5\u03B4\u03C1\u03BF\u03BC\u03B5\u03AF\u03BF\u03C5."
|
|
71
|
+
},
|
|
72
|
+
enabled: false,
|
|
73
|
+
condition: {
|
|
74
|
+
auth_form: {
|
|
75
|
+
is: "via_email",
|
|
76
|
+
then: {
|
|
77
|
+
enabled: true,
|
|
78
|
+
required: true
|
|
79
|
+
}
|
|
59
80
|
}
|
|
60
81
|
}
|
|
61
|
-
}
|
|
62
|
-
}, {
|
|
63
|
-
key: 'auth_form',
|
|
64
|
-
type: 'choice:single',
|
|
65
|
-
required: true,
|
|
66
|
-
label: {
|
|
67
|
-
primary: 'Επιλέξτε μέθοδο πιστοποίησης',
|
|
68
|
-
secondary: 'Για την ολοκλήρωση της δήλωσης σας, θα χρειαστεί επιπλέον πιστοποίηση. Θα σας στείλουμε ένα κωδικό μιας χρήσης είτε στο τηλέφωνο είτε στην ηλεκτρονική σας διεύθυνση.'
|
|
69
82
|
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
{
|
|
84
|
+
key: "auth_form",
|
|
85
|
+
type: "choice:single",
|
|
86
|
+
required: true,
|
|
87
|
+
label: {
|
|
88
|
+
primary: "\u0395\u03C0\u03B9\u03BB\u03AD\u03BE\u03C4\u03B5 \u03BC\u03AD\u03B8\u03BF\u03B4\u03BF \u03C0\u03B9\u03C3\u03C4\u03BF\u03C0\u03BF\u03AF\u03B7\u03C3\u03B7\u03C2",
|
|
89
|
+
secondary: "\u0393\u03B9\u03B1 \u03C4\u03B7\u03BD \u03BF\u03BB\u03BF\u03BA\u03BB\u03AE\u03C1\u03C9\u03C3\u03B7 \u03C4\u03B7\u03C2 \u03B4\u03AE\u03BB\u03C9\u03C3\u03B7\u03C2 \u03C3\u03B1\u03C2, \u03B8\u03B1 \u03C7\u03C1\u03B5\u03B9\u03B1\u03C3\u03C4\u03B5\u03AF \u03B5\u03C0\u03B9\u03C0\u03BB\u03AD\u03BF\u03BD \u03C0\u03B9\u03C3\u03C4\u03BF\u03C0\u03BF\u03AF\u03B7\u03C3\u03B7. \u0398\u03B1 \u03C3\u03B1\u03C2 \u03C3\u03C4\u03B5\u03AF\u03BB\u03BF\u03C5\u03BC\u03B5 \u03AD\u03BD\u03B1 \u03BA\u03C9\u03B4\u03B9\u03BA\u03CC \u03BC\u03B9\u03B1\u03C2 \u03C7\u03C1\u03AE\u03C3\u03B7\u03C2 \u03B5\u03AF\u03C4\u03B5 \u03C3\u03C4\u03BF \u03C4\u03B7\u03BB\u03AD\u03C6\u03C9\u03BD\u03BF \u03B5\u03AF\u03C4\u03B5 \u03C3\u03C4\u03B7\u03BD \u03B7\u03BB\u03B5\u03BA\u03C4\u03C1\u03BF\u03BD\u03B9\u03BA\u03AE \u03C3\u03B1\u03C2 \u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7."
|
|
90
|
+
},
|
|
91
|
+
extra: {
|
|
92
|
+
options: [
|
|
93
|
+
{
|
|
94
|
+
key: "via_mobile_phone",
|
|
95
|
+
label: {primary: "M\u03AD\u03C3\u03C9 \u03BA\u03B9\u03BD\u03B7\u03C4\u03BF\u03CD \u03C4\u03B7\u03BB\u03B5\u03C6\u03CE\u03BD\u03BF\u03C5"},
|
|
96
|
+
value: "via_mobile_phone",
|
|
97
|
+
show: ["mobile_phone", "landline"]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
key: "via_email",
|
|
101
|
+
label: {
|
|
102
|
+
primary: "\u039C\u03AD\u03C3\u03C9 \u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7\u03C2 \u03B7\u03BB\u03B5\u03BA\u03C4\u03C1\u03BF\u03BD\u03B9\u03BA\u03BF\u03CD \u03C4\u03B1\u03C7\u03C5\u03B4\u03C1\u03BF\u03BC\u03B5\u03AF\u03BF\u03C5 (e-mail)"
|
|
103
|
+
},
|
|
104
|
+
value: "via_email",
|
|
105
|
+
show: ["email"]
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
86
109
|
}
|
|
87
|
-
|
|
88
|
-
|
|
110
|
+
];
|
|
111
|
+
const Conditional = () => /* @__PURE__ */ import_react.default.createElement(import_form.default, {
|
|
112
|
+
onSubmit: (data) => {
|
|
113
|
+
console.log(data);
|
|
114
|
+
},
|
|
115
|
+
fields
|
|
116
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_form.Field, {
|
|
89
117
|
key: "auth_form",
|
|
90
118
|
name: "auth_form"
|
|
91
|
-
})
|
|
92
|
-
var _ref2 = /*#__PURE__*/_react["default"].createElement(_Button.Button, {
|
|
119
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_Button.Button, {
|
|
93
120
|
type: "submit"
|
|
94
|
-
}, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}, _ref, _ref2);
|
|
102
|
-
};
|
|
121
|
+
}, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1"));
|
|
122
|
+
var Conditional_default = Conditional;
|
|
123
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
124
|
+
0 && (module.exports = {
|
|
125
|
+
Conditional
|
|
126
|
+
});
|
|
127
|
+
//# sourceMappingURL=Conditional.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/inputs/Radio/__stories__/Conditional.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport FormBuilder, { Field, FieldSpec } from '@digigov/form';\nimport { Button } from '@digigov/ui/form/Button';\n\nconst fields: FieldSpec[] = [\n {\n key: 'landline',\n type: 'phone_number',\n label: {\n secondary: '\u0395\u03B9\u03C3\u03AC\u03B3\u03B5\u03C4\u03B5 \u03C4\u03BF \u03BD\u03BF\u03CD\u03BC\u03B5\u03C1\u03BF \u03C4\u03BF\u03C5 \u03C3\u03C4\u03B1\u03B8\u03B5\u03C1\u03BF\u03CD \u03C3\u03B1\u03C2 \u03C4\u03B7\u03BB\u03B5\u03C6\u03CE\u03BD\u03BF\u03C5.',\n },\n enabled: false,\n condition: {\n auth_form: {\n is: 'via_mobile_phone',\n then: {\n enabled: true,\n required: true,\n },\n },\n },\n },\n {\n key: 'mobile_phone',\n type: 'mobile_phone',\n label: {\n secondary: '\u0395\u03B9\u03C3\u03AC\u03B3\u03B5\u03C4\u03B5 \u03C4\u03BF \u03BD\u03BF\u03CD\u03BC\u03B5\u03C1\u03BF \u03C4\u03BF\u03C5 \u03BA\u03B9\u03BD\u03B7\u03C4\u03BF\u03CD \u03C3\u03B1\u03C2 \u03C4\u03B7\u03BB\u03B5\u03C6\u03CE\u03BD\u03BF\u03C5.',\n },\n enabled: false,\n condition: {\n auth_form: {\n is: 'via_mobile_phone',\n then: {\n enabled: true,\n required: true,\n },\n },\n },\n },\n {\n key: 'email',\n type: 'email',\n label: {\n secondary: '\u0395\u03B9\u03C3\u03AC\u03B3\u03B5\u03C4\u03B5 \u03C4\u03B7\u03BD \u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 \u03C4\u03BF\u03C5 \u03B7\u03BB\u03B5\u03BA\u03C4\u03C1\u03BF\u03BD\u03B9\u03BA\u03BF\u03CD \u03C3\u03B1\u03C2 \u03C4\u03B1\u03C7\u03C5\u03B4\u03C1\u03BF\u03BC\u03B5\u03AF\u03BF\u03C5.',\n },\n enabled: false,\n condition: {\n auth_form: {\n is: 'via_email',\n then: {\n enabled: true,\n required: true,\n },\n },\n },\n },\n {\n key: 'auth_form',\n type: 'choice:single',\n required: true,\n label: {\n primary: '\u0395\u03C0\u03B9\u03BB\u03AD\u03BE\u03C4\u03B5 \u03BC\u03AD\u03B8\u03BF\u03B4\u03BF \u03C0\u03B9\u03C3\u03C4\u03BF\u03C0\u03BF\u03AF\u03B7\u03C3\u03B7\u03C2',\n secondary:\n '\u0393\u03B9\u03B1 \u03C4\u03B7\u03BD \u03BF\u03BB\u03BF\u03BA\u03BB\u03AE\u03C1\u03C9\u03C3\u03B7 \u03C4\u03B7\u03C2 \u03B4\u03AE\u03BB\u03C9\u03C3\u03B7\u03C2 \u03C3\u03B1\u03C2, \u03B8\u03B1 \u03C7\u03C1\u03B5\u03B9\u03B1\u03C3\u03C4\u03B5\u03AF \u03B5\u03C0\u03B9\u03C0\u03BB\u03AD\u03BF\u03BD \u03C0\u03B9\u03C3\u03C4\u03BF\u03C0\u03BF\u03AF\u03B7\u03C3\u03B7. \u0398\u03B1 \u03C3\u03B1\u03C2 \u03C3\u03C4\u03B5\u03AF\u03BB\u03BF\u03C5\u03BC\u03B5 \u03AD\u03BD\u03B1 \u03BA\u03C9\u03B4\u03B9\u03BA\u03CC \u03BC\u03B9\u03B1\u03C2 \u03C7\u03C1\u03AE\u03C3\u03B7\u03C2 \u03B5\u03AF\u03C4\u03B5 \u03C3\u03C4\u03BF \u03C4\u03B7\u03BB\u03AD\u03C6\u03C9\u03BD\u03BF \u03B5\u03AF\u03C4\u03B5 \u03C3\u03C4\u03B7\u03BD \u03B7\u03BB\u03B5\u03BA\u03C4\u03C1\u03BF\u03BD\u03B9\u03BA\u03AE \u03C3\u03B1\u03C2 \u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7.',\n },\n extra: {\n options: [\n {\n key: 'via_mobile_phone',\n label: { primary: 'M\u03AD\u03C3\u03C9 \u03BA\u03B9\u03BD\u03B7\u03C4\u03BF\u03CD \u03C4\u03B7\u03BB\u03B5\u03C6\u03CE\u03BD\u03BF\u03C5' },\n value: 'via_mobile_phone',\n show: ['mobile_phone', 'landline'],\n },\n {\n key: 'via_email',\n label: {\n primary: '\u039C\u03AD\u03C3\u03C9 \u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7\u03C2 \u03B7\u03BB\u03B5\u03BA\u03C4\u03C1\u03BF\u03BD\u03B9\u03BA\u03BF\u03CD \u03C4\u03B1\u03C7\u03C5\u03B4\u03C1\u03BF\u03BC\u03B5\u03AF\u03BF\u03C5 (e-mail)',\n },\n value: 'via_email',\n show: ['email'],\n },\n ],\n },\n },\n];\n\nexport const Conditional = () => (\n <FormBuilder\n onSubmit={(data) => {\n console.log(data);\n }}\n fields={fields}\n >\n <Field key=\"auth_form\" name=\"auth_form\" />\n <Button type=\"submit\">\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1</Button>\n </FormBuilder>\n);\n\nexport default Conditional;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,kBAA8C;AAC9C,oBAAuB;AAEvB,MAAM,SAAsB;AAAA,EAC1B;AAAA,IACE,KAAK;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,MACL,WAAW;AAAA;AAAA,IAEb,SAAS;AAAA,IACT,WAAW;AAAA,MACT,WAAW;AAAA,QACT,IAAI;AAAA,QACJ,MAAM;AAAA,UACJ,SAAS;AAAA,UACT,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlB;AAAA,IACE,KAAK;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,MACL,WAAW;AAAA;AAAA,IAEb,SAAS;AAAA,IACT,WAAW;AAAA,MACT,WAAW;AAAA,QACT,IAAI;AAAA,QACJ,MAAM;AAAA,UACJ,SAAS;AAAA,UACT,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlB;AAAA,IACE,KAAK;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,MACL,WAAW;AAAA;AAAA,IAEb,SAAS;AAAA,IACT,WAAW;AAAA,MACT,WAAW;AAAA,QACT,IAAI;AAAA,QACJ,MAAM;AAAA,UACJ,SAAS;AAAA,UACT,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlB;AAAA,IACE,KAAK;AAAA,IACL,MAAM;AAAA,IACN,UAAU;AAAA,IACV,OAAO;AAAA,MACL,SAAS;AAAA,MACT,WACE;AAAA;AAAA,IAEJ,OAAO;AAAA,MACL,SAAS;AAAA,QACP;AAAA,UACE,KAAK;AAAA,UACL,OAAO,CAAE,SAAS;AAAA,UAClB,OAAO;AAAA,UACP,MAAM,CAAC,gBAAgB;AAAA;AAAA,QAEzB;AAAA,UACE,KAAK;AAAA,UACL,OAAO;AAAA,YACL,SAAS;AAAA;AAAA,UAEX,OAAO;AAAA,UACP,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAOV,MAAM,cAAc,MACzB,mDAAC,qBAAD;AAAA,EACE,UAAU,CAAC,SAAS;AAClB,YAAQ,IAAI;AAAA;AAAA,EAEd;AAAA,GAEA,mDAAC,mBAAD;AAAA,EAAO,KAAI;AAAA,EAAY,MAAK;AAAA,IAC5B,mDAAC,sBAAD;AAAA,EAAQ,MAAK;AAAA,GAAS;AAI1B,IAAO,sBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|