@digigov/form 2.0.0-rc.8 → 2.0.3
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/CHANGELOG.md +118 -3
- package/Field/ErrorGroup.d.ts +15 -0
- package/Field/ErrorGroup.js +53 -0
- package/Field/FieldBase.d.ts +1 -1
- package/Field/FieldBase.js +77 -0
- package/Field/FieldBaseContainer.d.ts +2 -2
- package/Field/FieldBaseContainer.js +43 -0
- package/Field/FieldConditional.d.ts +1 -1
- package/Field/FieldConditional.js +45 -0
- package/Field/index.d.ts +1 -1
- package/Field/index.js +70 -68
- package/Field/types.d.ts +61 -11
- package/Field/utils/evaluateFieldWithConditions.d.ts +2 -0
- package/Field/utils/evaluateFieldWithConditions.js +19 -0
- package/Field/utils/resolveField.d.ts +3 -0
- package/Field/utils/resolveField.js +32 -0
- package/Field/utils/useField.d.ts +2 -0
- package/Field/utils/useField.js +47 -0
- package/FieldArray/BaseFieldArray.d.ts +5 -0
- package/FieldArray/BaseFieldArray.js +46 -0
- package/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay.d.ts +9 -0
- package/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay.js +13 -0
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay.d.ts +26 -0
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay.js +134 -0
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader.d.ts +5 -0
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader.js +6 -0
- package/FieldArray/FormDialog/ArrayDisplay/index.d.ts +15 -0
- package/FieldArray/FormDialog/ArrayDisplay/index.js +32 -0
- package/FieldArray/FormDialog/ArrayEditModal.d.ts +24 -0
- package/FieldArray/FormDialog/ArrayEditModal.js +138 -0
- package/FieldArray/FormDialog/index.d.ts +19 -0
- package/FieldArray/FormDialog/index.js +199 -0
- package/FieldArray/index.d.ts +11 -2
- package/FieldArray/index.js +65 -60
- package/FieldObject/index.d.ts +11 -3
- package/FieldObject/index.js +53 -52
- package/Fieldset/FieldsetWithContext.js +27 -0
- package/Fieldset/index.d.ts +2 -2
- package/Fieldset/index.js +18 -32
- package/Fieldset/types.d.ts +3 -2
- package/FormBuilder/index.d.ts +8 -1
- package/FormBuilder/index.js +239 -2
- package/FormContext.d.ts +3 -2
- package/FormContext.js +7 -0
- package/MultiplicityField/add-objects.d.ts +3 -2
- package/MultiplicityField/add-objects.js +107 -0
- package/MultiplicityField/index.d.ts +2 -19
- package/MultiplicityField/index.js +84 -111
- package/MultiplicityField/types.d.ts +19 -0
- package/Questions/Questions.d.ts +1 -1
- package/Questions/Questions.js +48 -0
- package/Questions/QuestionsContext.d.ts +1 -2
- package/Questions/QuestionsContext.js +10 -0
- package/Questions/Step/ReviewStep.js +32 -0
- package/Questions/Step/Step.d.ts +1 -1
- package/Questions/Step/Step.js +39 -0
- package/Questions/Step/StepArrayReview.d.ts +1 -1
- package/Questions/Step/StepArrayReview.js +35 -0
- package/Questions/Step/StepContext.d.ts +1 -2
- package/Questions/Step/StepContext.js +28 -0
- package/Questions/Step/StepDescription.d.ts +1 -1
- package/Questions/Step/StepDescription.js +18 -0
- package/Questions/Step/StepForm.d.ts +2 -2
- package/Questions/Step/StepForm.js +29 -0
- package/Questions/Step/StepQuote.d.ts +1 -1
- package/Questions/Step/StepQuote.js +5 -0
- package/Questions/Step/StepTitle.d.ts +2 -1
- package/Questions/Step/StepTitle.js +25 -0
- package/Questions/Step/getAddMoreFields.d.ts +2 -2
- package/Questions/Step/getAddMoreFields.js +24 -0
- package/Questions/Step/index.d.ts +11 -12
- package/Questions/Step/index.js +13 -13
- package/Questions/Step/types.d.ts +2 -1
- package/Questions/Step/types.js +0 -0
- package/Questions/getNextStep.d.ts +1 -1
- package/Questions/getNextStep.js +13 -0
- package/Questions/index.d.ts +2 -2
- package/Questions/index.js +4 -3
- package/Questions/types.d.ts +2 -1
- package/Questions/types.js +0 -0
- package/hooks/useFieldFocusManager.d.ts +25 -0
- package/hooks/useFieldFocusManager.js +83 -0
- package/hooks/utils.d.ts +18 -0
- package/hooks/utils.js +60 -0
- package/index.d.ts +5 -2
- package/index.js +8 -4
- package/inputs/AutoCompleteInput/index.d.ts +4 -4
- package/inputs/AutoCompleteInput/index.js +42 -55
- package/inputs/Checkboxes/index.d.ts +7 -4
- package/inputs/Checkboxes/index.js +50 -91
- package/inputs/DateInput/index.d.ts +3 -7
- package/inputs/DateInput/index.js +128 -125
- package/inputs/DateTimeInput/index.d.ts +10 -0
- package/inputs/DateTimeInput/index.js +190 -0
- package/inputs/FileInput/index.d.ts +18 -2
- package/inputs/FileInput/index.js +59 -56
- package/inputs/ImageInput/index.d.ts +10 -2
- package/inputs/ImageInput/index.js +94 -74
- package/inputs/Input/index.d.ts +5 -2
- package/inputs/Input/index.js +67 -67
- package/inputs/Label/index.d.ts +2 -4
- package/inputs/Label/index.js +13 -21
- package/inputs/OtpInput/index.d.ts +1 -5
- package/inputs/OtpInput/index.js +122 -139
- package/inputs/Radio/index.d.ts +10 -3
- package/inputs/Radio/index.js +72 -56
- package/inputs/Select/index.d.ts +7 -4
- package/inputs/Select/index.js +23 -30
- package/inputs/index.d.ts +9 -9
- package/inputs/index.js +10 -9
- package/inputs/registry.d.ts +5 -0
- package/inputs/registry.js +80 -0
- package/internal.d.ts +5 -34
- package/internal.js +6 -0
- package/lazy.d.ts +94 -66
- package/lazy.js +163 -0
- package/package.json +12 -13
- package/registry.d.ts +45 -27
- package/registry.js +170 -0
- package/src/Field/ErrorGroup.tsx +84 -0
- package/src/Field/FieldBase.tsx +43 -25
- package/src/Field/FieldBaseContainer.tsx +71 -47
- package/src/Field/FieldConditional.tsx +10 -2
- package/src/Field/doc.mdx +207 -0
- package/src/Field/index.tsx +37 -23
- package/src/Field/types.tsx +92 -13
- package/src/Field/utils/evaluateFieldWithConditions.ts +33 -0
- package/src/Field/utils/resolveField.ts +58 -0
- package/src/Field/utils/useField.ts +68 -0
- package/src/FieldArray/BaseFieldArray.tsx +97 -0
- package/src/FieldArray/FieldArray.stories.js +4 -2
- package/src/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay.tsx +45 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/ArrayDisplay.stories.js +14 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay.tsx +370 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader.tsx +15 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/Cards.tsx +88 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/Default.tsx +93 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/ReadOnly.tsx +79 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/ReadOnlyCards.tsx +75 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/Sortable.tsx +93 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/SortableCards.tsx +88 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/index.test.tsx +44 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/index.tsx +67 -0
- package/src/FieldArray/FormDialog/ArrayEditModal.tsx +241 -0
- package/src/FieldArray/FormDialog/index.tsx +302 -0
- package/src/FieldArray/__stories__/CardsWithError.tsx +110 -0
- package/src/FieldArray/__stories__/Default.tsx +2 -1
- package/src/FieldArray/__stories__/TableWithError.tsx +111 -0
- package/src/FieldArray/__stories__/WithExactLength.tsx +2 -1
- package/src/FieldArray/__stories__/WithModal.tsx +188 -0
- package/src/FieldArray/__tests__/fieldset-multiplicity.spec.tsx +271 -0
- package/src/FieldArray/__tests__/multiplicity-attachment.spec.tsx +280 -0
- package/src/FieldArray/__tests__/multiplicity-optional.spec.tsx +232 -0
- package/src/FieldArray/__tests__/multiplicity-required.spec.tsx +170 -0
- package/src/FieldArray/__tests__/nested-fieldset-multiplicity.spec.tsx +627 -0
- package/src/FieldArray/__tests__/preference-multiple-choice.spec.tsx +222 -0
- package/src/FieldArray/index.spec.tsx +355 -0
- package/src/FieldArray/index.test.tsx +43 -0
- package/src/FieldArray/index.tsx +84 -55
- package/src/FieldObject/index.tsx +53 -27
- package/src/Fieldset/FieldsetWithContext.tsx +1 -1
- package/src/Fieldset/index.tsx +6 -6
- package/src/Fieldset/types.tsx +5 -3
- package/src/FormBuilder/FormBuilder.stories.js +6 -1
- package/src/FormBuilder/__stories__/AutoErrorGrouping.tsx +63 -0
- package/src/FormBuilder/__stories__/Default.tsx +1 -1
- package/src/FormBuilder/__stories__/ErrorGrouping.tsx +43 -0
- package/src/FormBuilder/{FormBuilder.mdx → doc.mdx} +27 -35
- package/src/FormBuilder/index.test.tsx +32 -0
- package/src/FormBuilder/index.tsx +314 -1
- package/src/FormBuilder/interaction.test.tsx +40 -0
- package/src/FormBuilder/scenarios.test.tsx +2775 -0
- package/src/FormContext.tsx +7 -3
- package/src/MultiplicityField/MultiplicityField.stories.js +9 -6
- package/src/MultiplicityField/__stories__/Default.tsx +1 -1
- package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +2 -4
- package/src/MultiplicityField/__stories__/WithExactLength.tsx +2 -2
- package/src/MultiplicityField/__stories__/WithMaxLength.tsx +2 -2
- package/src/MultiplicityField/__stories__/WithMinAndMaxLength.tsx +2 -2
- package/src/MultiplicityField/__stories__/WithMinLength.tsx +2 -2
- package/src/MultiplicityField/add-objects.tsx +39 -30
- package/{cjs/MultiplicityField/MultiplicityField.mdx → src/MultiplicityField/doc.mdx} +112 -98
- package/src/MultiplicityField/index.test.tsx +44 -0
- package/src/MultiplicityField/index.tsx +25 -34
- package/src/MultiplicityField/types.ts +25 -0
- package/src/Questions/Questions.stories.js +4 -1
- package/src/Questions/Questions.tsx +6 -6
- package/src/Questions/QuestionsContext.tsx +1 -1
- package/src/Questions/Step/Step.tsx +1 -1
- package/src/Questions/Step/StepArrayReview.tsx +3 -3
- package/src/Questions/Step/StepContext.tsx +1 -1
- package/src/Questions/Step/StepDescription.tsx +2 -1
- package/src/Questions/Step/StepForm.tsx +2 -2
- package/src/Questions/Step/StepQuote.tsx +2 -1
- package/src/Questions/Step/StepTitle.tsx +6 -3
- package/src/Questions/Step/getAddMoreFields.tsx +2 -2
- package/src/Questions/Step/index.ts +0 -1
- package/src/Questions/Step/types.tsx +2 -1
- package/src/Questions/__snapshots__/index.spec.tsx.snap +74 -587
- package/src/Questions/__stories__/Default.tsx +1 -1
- package/{Questions/index.mdx → src/Questions/doc.mdx} +34 -57
- package/src/Questions/getNextStep.tsx +1 -1
- package/src/Questions/index.spec.tsx +17 -5
- package/src/Questions/index.test.tsx +24 -0
- package/src/Questions/types.tsx +2 -1
- package/src/create-simple-form.mdx +2 -6
- package/src/{index.mdx → doc.mdx} +29 -18
- package/src/hooks/__tests__/useFieldFocusManager.spec.tsx +1079 -0
- package/src/hooks/__tests__/utils.spec.ts +568 -0
- package/src/hooks/useFieldFocusManager.ts +162 -0
- package/src/hooks/utils.ts +122 -0
- package/src/index.ts +4 -1
- package/src/inputs/AutoCompleteInput/AutoComplete.stories.js +5 -2
- package/src/inputs/AutoCompleteInput/__stories__/Default.tsx +3 -11
- package/src/inputs/AutoCompleteInput/__stories__/Multiple.tsx +2 -9
- package/{cjs/inputs/AutoCompleteInput/index.mdx → src/inputs/AutoCompleteInput/doc.mdx} +2 -13
- package/src/inputs/AutoCompleteInput/index.test.tsx +28 -0
- package/src/inputs/AutoCompleteInput/index.tsx +40 -35
- package/src/inputs/Checkboxes/Checkboxes.stories.js +6 -3
- package/src/inputs/Checkboxes/__stories__/Conditional.tsx +1 -1
- package/src/inputs/Checkboxes/__stories__/Default.tsx +1 -1
- package/src/inputs/Checkboxes/__stories__/WithDivider.tsx +1 -1
- package/src/inputs/Checkboxes/{index.mdx → doc.mdx} +5 -15
- package/src/inputs/Checkboxes/index.test.tsx +32 -0
- package/src/inputs/Checkboxes/index.tsx +106 -92
- package/src/inputs/DateInput/DateInput.stories.js +8 -1
- package/src/inputs/DateInput/__stories__/Default.tsx +17 -16
- package/src/inputs/DateInput/__stories__/WithDefaultValue.tsx +26 -0
- package/src/inputs/DateInput/__stories__/WithInitialValue.tsx +28 -0
- package/src/inputs/DateInput/__stories__/WithWrongDefaultValue.tsx +26 -0
- package/src/inputs/DateInput/__stories__/WithWrongInitialValue.tsx +28 -0
- package/src/inputs/DateInput/{index.mdx → doc.mdx} +1 -8
- package/src/inputs/DateInput/index.test.tsx +40 -0
- package/src/inputs/DateInput/index.tsx +77 -27
- package/src/inputs/DateTimeInput/DateTimeInput.stories.js +14 -0
- package/src/inputs/DateTimeInput/__stories__/Default.tsx +25 -0
- package/src/inputs/DateTimeInput/__stories__/WithDefaultValue.tsx +26 -0
- package/src/inputs/DateTimeInput/__stories__/WithInitialValue.tsx +28 -0
- package/src/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.tsx +26 -0
- package/src/inputs/DateTimeInput/__stories__/WithWrongInitialValue.tsx +28 -0
- package/src/inputs/DateTimeInput/doc.mdx +16 -0
- package/src/inputs/DateTimeInput/index.test.tsx +40 -0
- package/src/inputs/DateTimeInput/index.tsx +246 -0
- package/src/inputs/FileInput/FileInput.stories.js +5 -1
- package/src/inputs/FileInput/__stories__/Default.tsx +1 -1
- package/src/inputs/FileInput/__stories__/WithBorderAndLink.tsx +34 -0
- package/{inputs/FileInput/index.mdx → src/inputs/FileInput/doc.mdx} +1 -5
- package/src/inputs/FileInput/index.test.tsx +28 -0
- package/src/inputs/FileInput/index.tsx +102 -43
- package/src/inputs/ImageInput/ImageInput.stories.js +7 -3
- package/src/inputs/ImageInput/__stories__/Default.tsx +1 -1
- package/src/inputs/ImageInput/__stories__/{WithInvalidImageSize.tsx → MaxSize.tsx} +5 -3
- package/src/inputs/ImageInput/__stories__/WithInitialValues.tsx +45 -0
- package/src/inputs/ImageInput/__stories__/WithInvalidImageDimension.tsx +3 -1
- package/src/inputs/ImageInput/__stories__/logo.d.ts +4 -0
- package/src/inputs/ImageInput/__stories__/logo.png +0 -0
- package/src/inputs/ImageInput/doc.mdx +23 -0
- package/src/inputs/ImageInput/index.test.tsx +36 -0
- package/src/inputs/ImageInput/index.tsx +105 -52
- package/src/inputs/Input/Input.stories.js +17 -10
- package/src/inputs/Input/__stories__/AFM.tsx +1 -1
- package/src/inputs/Input/__stories__/AMKA.tsx +23 -0
- package/src/inputs/Input/__stories__/Boolean.tsx +1 -1
- package/src/inputs/Input/__stories__/Email.tsx +23 -0
- package/src/inputs/Input/__stories__/IBAN.tsx +1 -1
- package/src/inputs/Input/__stories__/Integer.tsx +1 -1
- package/src/inputs/Input/__stories__/LandlineNumber.tsx +3 -2
- package/src/inputs/Input/__stories__/MobilePhone.tsx +2 -1
- package/src/inputs/Input/__stories__/PhoneNumber.tsx +2 -1
- package/src/inputs/Input/__stories__/PostalCode.tsx +2 -1
- package/src/inputs/Input/__stories__/Rate.tsx +25 -0
- package/src/inputs/Input/__stories__/{Default.tsx → String.tsx} +2 -2
- package/src/inputs/Input/__stories__/StringWithTrimValidation.tsx +26 -0
- package/src/inputs/Input/__stories__/{TextWithCharacterLimit.tsx → TextWithLimit.tsx} +3 -2
- package/src/inputs/Input/doc.mdx +56 -0
- package/src/inputs/Input/index.test.tsx +76 -0
- package/src/inputs/Input/index.tsx +55 -35
- package/src/inputs/Label/Label.stories.js +4 -1
- package/src/inputs/Label/__stories__/Default.tsx +4 -2
- package/src/inputs/Label/doc.mdx +14 -0
- package/src/inputs/Label/index.test.tsx +24 -0
- package/src/inputs/Label/index.tsx +4 -11
- package/src/inputs/OtpInput/OtpInput.stories.js +4 -1
- package/src/inputs/OtpInput/__stories__/Default.tsx +1 -1
- package/{cjs/inputs/OtpInput/index.mdx → src/inputs/OtpInput/doc.mdx} +1 -8
- package/src/inputs/OtpInput/index.test.tsx +24 -0
- package/src/inputs/OtpInput/index.tsx +45 -34
- package/src/inputs/Radio/Radio.stories.js +6 -3
- package/src/inputs/Radio/__stories__/Conditional.tsx +3 -2
- package/src/inputs/Radio/__stories__/Default.tsx +1 -1
- package/src/inputs/Radio/__stories__/WithDivider.tsx +1 -1
- package/{cjs/inputs/Radio/index.mdx → src/inputs/Radio/doc.mdx} +5 -15
- package/src/inputs/Radio/index.test.tsx +32 -0
- package/src/inputs/Radio/index.tsx +93 -12
- package/src/inputs/Select/Select.stories.js +4 -1
- package/src/inputs/Select/__stories__/Default.tsx +1 -1
- package/src/inputs/Select/{index.mdx → doc.mdx} +1 -5
- package/src/inputs/Select/index.test.tsx +24 -0
- package/src/inputs/Select/index.tsx +22 -9
- package/src/inputs/registry.ts +86 -0
- package/src/installation.mdx +2 -5
- package/src/internal.ts +2 -31
- package/src/lazy.ts +56 -0
- package/src/registry.ts +179 -0
- package/src/types.tsx +21 -65
- package/src/utils.ts +67 -33
- package/src/validators/index.ts +138 -99
- package/src/validators/types.ts +1 -1
- package/src/validators/utils/amka.ts +39 -0
- package/src/validators/utils/date.ts +131 -0
- package/src/validators/utils/datetime.ts +222 -0
- package/src/validators/utils/email.ts +11 -0
- package/src/validators/utils/file.ts +35 -19
- package/src/validators/utils/iban.ts +2 -2
- package/src/validators/utils/image.ts +2 -2
- package/src/validators/utils/index.ts +15 -6
- package/src/validators/utils/int.ts +2 -2
- package/src/validators/utils/number.ts +2 -2
- package/src/validators/utils/otp.ts +2 -2
- package/src/validators/utils/phone.ts +65 -74
- package/src/validators/utils/postal_code.ts +3 -3
- package/src/validators/utils/text_limit.ts +2 -2
- package/src/validators/utils/uuid4.ts +2 -1
- package/src/validators/validators.spec.ts +6 -40
- package/types.d.ts +14 -37
- package/types.js +1 -0
- package/utils.d.ts +4 -1
- package/utils.js +56 -0
- package/validators/index.d.ts +6 -6
- package/validators/index.js +115 -180
- package/validators/types.d.ts +1 -1
- package/validators/types.js +0 -0
- package/validators/utils/afm.js +19 -0
- package/validators/utils/amka.d.ts +6 -0
- package/validators/utils/amka.js +27 -0
- package/validators/utils/date.d.ts +9 -0
- package/validators/utils/date.js +95 -0
- package/validators/utils/datetime.d.ts +9 -0
- package/validators/utils/datetime.js +121 -0
- package/validators/utils/email.d.ts +5 -0
- package/validators/utils/email.js +10 -0
- package/validators/utils/file.d.ts +2 -2
- package/validators/utils/file.js +31 -0
- package/validators/utils/iban.d.ts +2 -2
- package/validators/utils/iban.js +104 -0
- package/validators/utils/image.d.ts +2 -2
- package/validators/utils/image.js +65 -0
- package/validators/utils/index.d.ts +14 -11
- package/validators/utils/index.js +62 -85
- package/validators/utils/int.d.ts +1 -1
- package/validators/utils/int.js +13 -0
- package/validators/utils/number.d.ts +1 -1
- package/validators/utils/number.js +12 -0
- package/validators/utils/otp.d.ts +2 -2
- package/validators/utils/otp.js +21 -0
- package/validators/utils/phone.d.ts +3 -3
- package/validators/utils/phone.js +198 -0
- package/validators/utils/postal_code.d.ts +3 -3
- package/validators/utils/postal_code.js +18 -0
- package/validators/utils/text_limit.d.ts +2 -2
- package/validators/utils/text_limit.js +34 -0
- package/validators/utils/uuid4.js +14 -0
- package/Field/FieldBase/index.js +0 -82
- package/Field/FieldBase/package.json +0 -6
- package/Field/FieldBaseContainer/index.js +0 -40
- package/Field/FieldBaseContainer/package.json +0 -6
- package/Field/FieldConditional/index.js +0 -59
- package/Field/FieldConditional/package.json +0 -6
- package/Field/index.mdx +0 -6
- package/Field/package.json +0 -6
- package/Field/types/index.js +0 -1
- package/Field/types/package.json +0 -6
- package/Field/utils/index.js +0 -153
- package/Field/utils/package.json +0 -6
- package/Field/utils.d.ts +0 -5
- package/FieldArray/FieldArray.stories/index.js +0 -8
- package/FieldArray/FieldArray.stories/package.json +0 -6
- package/FieldArray/FieldArray.stories.d.ts +0 -9
- package/FieldArray/FieldArray.stories.playwright.json +0 -353
- package/FieldArray/__stories__/Default/index.js +0 -88
- package/FieldArray/__stories__/Default/package.json +0 -6
- package/FieldArray/__stories__/Default.d.ts +0 -2
- package/FieldArray/__stories__/WithExactLength/index.js +0 -88
- package/FieldArray/__stories__/WithExactLength/package.json +0 -6
- package/FieldArray/__stories__/WithExactLength.d.ts +0 -2
- package/FieldArray/package.json +0 -6
- package/FieldObject/package.json +0 -6
- package/Fieldset/FieldsetWithContext/index.js +0 -35
- package/Fieldset/FieldsetWithContext/package.json +0 -6
- package/Fieldset/package.json +0 -6
- package/Fieldset/types/index.js +0 -1
- package/Fieldset/types/package.json +0 -6
- package/Form.stories/index.js +0 -3
- package/Form.stories/package.json +0 -6
- package/Form.stories.d.ts +0 -4
- package/FormBuilder/FormBuilder/index.js +0 -152
- package/FormBuilder/FormBuilder/package.json +0 -6
- package/FormBuilder/FormBuilder.d.ts +0 -5
- package/FormBuilder/FormBuilder.mdx +0 -256
- package/FormBuilder/FormBuilder.stories/index.js +0 -7
- package/FormBuilder/FormBuilder.stories/package.json +0 -6
- package/FormBuilder/FormBuilder.stories.d.ts +0 -8
- package/FormBuilder/FormBuilder.stories.playwright.json +0 -52
- package/FormBuilder/__stories__/Default/index.js +0 -26
- package/FormBuilder/__stories__/Default/package.json +0 -6
- package/FormBuilder/__stories__/Default.d.ts +0 -3
- package/FormBuilder/package.json +0 -6
- package/FormContext/index.js +0 -5
- package/FormContext/package.json +0 -6
- package/MultiplicityField/MultiplicityField.mdx +0 -590
- package/MultiplicityField/MultiplicityField.stories/index.js +0 -12
- package/MultiplicityField/MultiplicityField.stories/package.json +0 -6
- package/MultiplicityField/MultiplicityField.stories.d.ts +0 -13
- package/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
- package/MultiplicityField/__stories__/Default/index.js +0 -95
- package/MultiplicityField/__stories__/Default/package.json +0 -6
- package/MultiplicityField/__stories__/Default.d.ts +0 -2
- package/MultiplicityField/__stories__/PreviewDisplay/index.js +0 -78
- package/MultiplicityField/__stories__/PreviewDisplay/package.json +0 -6
- package/MultiplicityField/__stories__/PreviewDisplay.d.ts +0 -2
- package/MultiplicityField/__stories__/WithExactLength/index.js +0 -90
- package/MultiplicityField/__stories__/WithExactLength/package.json +0 -6
- package/MultiplicityField/__stories__/WithExactLength.d.ts +0 -2
- package/MultiplicityField/__stories__/WithMaxLength/index.js +0 -93
- package/MultiplicityField/__stories__/WithMaxLength/package.json +0 -6
- package/MultiplicityField/__stories__/WithMaxLength.d.ts +0 -2
- package/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +0 -94
- package/MultiplicityField/__stories__/WithMinAndMaxLength/package.json +0 -6
- package/MultiplicityField/__stories__/WithMinAndMaxLength.d.ts +0 -2
- package/MultiplicityField/__stories__/WithMinLength/index.js +0 -93
- package/MultiplicityField/__stories__/WithMinLength/package.json +0 -6
- package/MultiplicityField/__stories__/WithMinLength.d.ts +0 -2
- package/MultiplicityField/add-objects/index.js +0 -148
- package/MultiplicityField/add-objects/package.json +0 -6
- package/MultiplicityField/package.json +0 -6
- package/Questions/Questions/index.js +0 -75
- package/Questions/Questions/package.json +0 -6
- package/Questions/Questions.stories/index.js +0 -7
- package/Questions/Questions.stories/package.json +0 -6
- package/Questions/Questions.stories.d.ts +0 -8
- package/Questions/QuestionsContext/index.js +0 -11
- package/Questions/QuestionsContext/package.json +0 -6
- package/Questions/Step/ReviewStep/index.js +0 -50
- package/Questions/Step/ReviewStep/package.json +0 -6
- package/Questions/Step/Step/index.js +0 -62
- package/Questions/Step/Step/package.json +0 -6
- package/Questions/Step/StepArrayReview/index.js +0 -46
- package/Questions/Step/StepArrayReview/package.json +0 -6
- package/Questions/Step/StepContext/index.js +0 -27
- package/Questions/Step/StepContext/package.json +0 -6
- package/Questions/Step/StepDescription/index.js +0 -24
- package/Questions/Step/StepDescription/package.json +0 -6
- package/Questions/Step/StepForm/index.js +0 -44
- package/Questions/Step/StepForm/package.json +0 -6
- package/Questions/Step/StepQuote/index.js +0 -10
- package/Questions/Step/StepQuote/package.json +0 -6
- package/Questions/Step/StepTitle/index.js +0 -41
- package/Questions/Step/StepTitle/package.json +0 -6
- package/Questions/Step/getAddMoreFields/index.js +0 -21
- package/Questions/Step/getAddMoreFields/package.json +0 -6
- package/Questions/Step/package.json +0 -6
- package/Questions/Step/types/index.js +0 -1
- package/Questions/Step/types/package.json +0 -6
- package/Questions/__snapshots__/index.spec.tsx.snap +0 -596
- package/Questions/__stories__/Default/index.js +0 -102
- package/Questions/__stories__/Default/package.json +0 -6
- package/Questions/__stories__/Default.d.ts +0 -3
- package/Questions/getNextStep/index.js +0 -20
- package/Questions/getNextStep/package.json +0 -6
- package/Questions/index.spec/index.js +0 -59
- package/Questions/index.spec/package.json +0 -6
- package/Questions/index.spec.d.ts +0 -1
- package/Questions/package.json +0 -6
- package/Questions/types/index.js +0 -1
- package/Questions/types/package.json +0 -6
- package/cjs/Field/FieldBase/index.js +0 -89
- package/cjs/Field/FieldBaseContainer/index.js +0 -47
- package/cjs/Field/FieldConditional/index.js +0 -66
- package/cjs/Field/index.js +0 -80
- package/cjs/Field/index.mdx +0 -6
- package/cjs/Field/types/index.js +0 -5
- package/cjs/Field/utils/index.js +0 -162
- package/cjs/FieldArray/FieldArray.stories/index.js +0 -38
- package/cjs/FieldArray/FieldArray.stories.playwright.json +0 -353
- package/cjs/FieldArray/__stories__/Default/index.js +0 -98
- package/cjs/FieldArray/__stories__/WithExactLength/index.js +0 -98
- package/cjs/FieldArray/index.js +0 -68
- package/cjs/FieldObject/index.js +0 -64
- package/cjs/Fieldset/FieldsetWithContext/index.js +0 -45
- package/cjs/Fieldset/index.js +0 -44
- package/cjs/Fieldset/types/index.js +0 -5
- package/cjs/Form.stories/index.js +0 -9
- package/cjs/FormBuilder/FormBuilder/index.js +0 -162
- package/cjs/FormBuilder/FormBuilder.mdx +0 -256
- package/cjs/FormBuilder/FormBuilder.stories/index.js +0 -26
- package/cjs/FormBuilder/FormBuilder.stories.playwright.json +0 -52
- package/cjs/FormBuilder/__stories__/Default/index.js +0 -36
- package/cjs/FormBuilder/index.js +0 -8
- package/cjs/FormContext/index.js +0 -11
- package/cjs/MultiplicityField/MultiplicityField.stories/index.js +0 -86
- package/cjs/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
- package/cjs/MultiplicityField/__stories__/Default/index.js +0 -105
- package/cjs/MultiplicityField/__stories__/PreviewDisplay/index.js +0 -88
- package/cjs/MultiplicityField/__stories__/WithExactLength/index.js +0 -100
- package/cjs/MultiplicityField/__stories__/WithMaxLength/index.js +0 -103
- package/cjs/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +0 -104
- package/cjs/MultiplicityField/__stories__/WithMinLength/index.js +0 -103
- package/cjs/MultiplicityField/add-objects/index.js +0 -155
- package/cjs/MultiplicityField/index.js +0 -123
- package/cjs/Questions/Questions/index.js +0 -85
- package/cjs/Questions/Questions.stories/index.js +0 -26
- package/cjs/Questions/QuestionsContext/index.js +0 -17
- package/cjs/Questions/Step/ReviewStep/index.js +0 -60
- package/cjs/Questions/Step/Step/index.js +0 -72
- package/cjs/Questions/Step/StepArrayReview/index.js +0 -56
- package/cjs/Questions/Step/StepContext/index.js +0 -33
- package/cjs/Questions/Step/StepDescription/index.js +0 -34
- package/cjs/Questions/Step/StepForm/index.js +0 -54
- package/cjs/Questions/Step/StepQuote/index.js +0 -17
- package/cjs/Questions/Step/StepTitle/index.js +0 -51
- package/cjs/Questions/Step/getAddMoreFields/index.js +0 -27
- package/cjs/Questions/Step/index.js +0 -143
- package/cjs/Questions/Step/types/index.js +0 -5
- package/cjs/Questions/__snapshots__/index.spec.tsx.snap +0 -596
- package/cjs/Questions/__stories__/Default/index.js +0 -113
- package/cjs/Questions/getNextStep/index.js +0 -26
- package/cjs/Questions/index.js +0 -21
- package/cjs/Questions/index.mdx +0 -415
- package/cjs/Questions/index.spec/index.js +0 -63
- package/cjs/Questions/types/index.js +0 -5
- package/cjs/create-simple-form.mdx +0 -539
- package/cjs/index.js +0 -22
- package/cjs/index.mdx +0 -51
- package/cjs/inputs/AutoCompleteInput/AutoComplete.stories/index.js +0 -38
- package/cjs/inputs/AutoCompleteInput/__stories__/Default/index.js +0 -51
- package/cjs/inputs/AutoCompleteInput/__stories__/Multiple/index.js +0 -52
- package/cjs/inputs/AutoCompleteInput/index.js +0 -66
- package/cjs/inputs/Checkboxes/Checkboxes.stories/index.js +0 -50
- package/cjs/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
- package/cjs/inputs/Checkboxes/__stories__/Conditional/index.js +0 -103
- package/cjs/inputs/Checkboxes/__stories__/Default/index.js +0 -50
- package/cjs/inputs/Checkboxes/__stories__/WithDivider/index.js +0 -51
- package/cjs/inputs/Checkboxes/index.js +0 -101
- package/cjs/inputs/Checkboxes/index.mdx +0 -33
- package/cjs/inputs/DateInput/DateInput.stories/index.js +0 -26
- package/cjs/inputs/DateInput/DateInput.stories.playwright.json +0 -72
- package/cjs/inputs/DateInput/__stories__/Default/index.js +0 -33
- package/cjs/inputs/DateInput/index.js +0 -141
- package/cjs/inputs/DateInput/index.mdx +0 -23
- package/cjs/inputs/FileInput/FileInput.stories/index.js +0 -26
- package/cjs/inputs/FileInput/FileInput.stories.playwright.json +0 -75
- package/cjs/inputs/FileInput/__stories__/Default/index.js +0 -30
- package/cjs/inputs/FileInput/index.js +0 -68
- package/cjs/inputs/FileInput/index.mdx +0 -19
- package/cjs/inputs/ImageInput/ImageInput.stories/index.js +0 -50
- package/cjs/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
- package/cjs/inputs/ImageInput/__stories__/Default/index.js +0 -38
- package/cjs/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +0 -46
- package/cjs/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +0 -43
- package/cjs/inputs/ImageInput/index.js +0 -86
- package/cjs/inputs/ImageInput/index.mdx +0 -19
- package/cjs/inputs/Input/Input.stories/index.js +0 -134
- package/cjs/inputs/Input/Input.stories.playwright.json +0 -376
- package/cjs/inputs/Input/__stories__/AFM/index.js +0 -32
- package/cjs/inputs/Input/__stories__/Boolean/index.js +0 -33
- package/cjs/inputs/Input/__stories__/Default/index.js +0 -33
- package/cjs/inputs/Input/__stories__/IBAN/index.js +0 -33
- package/cjs/inputs/Input/__stories__/Integer/index.js +0 -41
- package/cjs/inputs/Input/__stories__/LandlineNumber/index.js +0 -36
- package/cjs/inputs/Input/__stories__/MobilePhone/index.js +0 -36
- package/cjs/inputs/Input/__stories__/PhoneNumber/index.js +0 -35
- package/cjs/inputs/Input/__stories__/PostalCode/index.js +0 -35
- package/cjs/inputs/Input/__stories__/TextWithCharacterLimit/index.js +0 -39
- package/cjs/inputs/Input/index.js +0 -76
- package/cjs/inputs/Input/index.mdx +0 -95
- package/cjs/inputs/Label/Label.stories/index.js +0 -26
- package/cjs/inputs/Label/Label.stories.playwright.json +0 -40
- package/cjs/inputs/Label/__stories__/Default/index.js +0 -37
- package/cjs/inputs/Label/index.js +0 -29
- package/cjs/inputs/OtpInput/OtpInput.stories/index.js +0 -26
- package/cjs/inputs/OtpInput/__stories__/Default/index.js +0 -39
- package/cjs/inputs/OtpInput/index.js +0 -151
- package/cjs/inputs/Radio/Radio.stories/index.js +0 -50
- package/cjs/inputs/Radio/Radio.stories.playwright.json +0 -73
- package/cjs/inputs/Radio/__stories__/Conditional/index.js +0 -103
- package/cjs/inputs/Radio/__stories__/Default/index.js +0 -55
- package/cjs/inputs/Radio/__stories__/WithDivider/index.js +0 -56
- package/cjs/inputs/Radio/index.js +0 -64
- package/cjs/inputs/Select/Select.stories/index.js +0 -26
- package/cjs/inputs/Select/Select.stories.playwright.json +0 -22
- package/cjs/inputs/Select/__stories__/Default/index.js +0 -61
- package/cjs/inputs/Select/index.js +0 -38
- package/cjs/inputs/Select/index.mdx +0 -17
- package/cjs/inputs/index.js +0 -69
- package/cjs/installation.mdx +0 -68
- package/cjs/internal/index.js +0 -348
- package/cjs/lazy/index.js +0 -517
- package/cjs/registry/index.js +0 -147
- package/cjs/types/index.js +0 -5
- package/cjs/utils/index.js +0 -87
- package/cjs/validators/index.js +0 -193
- package/cjs/validators/types/index.js +0 -5
- package/cjs/validators/utils/afm/index.js +0 -38
- package/cjs/validators/utils/file/index.js +0 -43
- package/cjs/validators/utils/iban/index.js +0 -123
- package/cjs/validators/utils/image/index.js +0 -126
- package/cjs/validators/utils/index.js +0 -204
- package/cjs/validators/utils/int/index.js +0 -26
- package/cjs/validators/utils/number/index.js +0 -22
- package/cjs/validators/utils/otp/index.js +0 -32
- package/cjs/validators/utils/phone/index.js +0 -143
- package/cjs/validators/utils/postal_code/index.js +0 -34
- package/cjs/validators/utils/text_limit/index.js +0 -54
- package/cjs/validators/utils/uuid4/index.js +0 -25
- package/cjs/validators/validators.spec/index.js +0 -87
- package/create-simple-form.mdx +0 -539
- package/index.mdx +0 -51
- package/inputs/AutoCompleteInput/AutoComplete.stories/index.js +0 -8
- package/inputs/AutoCompleteInput/AutoComplete.stories/package.json +0 -6
- package/inputs/AutoCompleteInput/AutoComplete.stories.d.ts +0 -9
- package/inputs/AutoCompleteInput/__stories__/Default/index.js +0 -44
- package/inputs/AutoCompleteInput/__stories__/Default/package.json +0 -6
- package/inputs/AutoCompleteInput/__stories__/Default.d.ts +0 -3
- package/inputs/AutoCompleteInput/__stories__/Multiple/index.js +0 -45
- package/inputs/AutoCompleteInput/__stories__/Multiple/package.json +0 -6
- package/inputs/AutoCompleteInput/__stories__/Multiple.d.ts +0 -3
- package/inputs/AutoCompleteInput/index.mdx +0 -29
- package/inputs/AutoCompleteInput/package.json +0 -6
- package/inputs/Checkboxes/Checkboxes.stories/index.js +0 -9
- package/inputs/Checkboxes/Checkboxes.stories/package.json +0 -6
- package/inputs/Checkboxes/Checkboxes.stories.d.ts +0 -10
- package/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -85
- package/inputs/Checkboxes/__stories__/Conditional/index.js +0 -93
- package/inputs/Checkboxes/__stories__/Conditional/package.json +0 -6
- package/inputs/Checkboxes/__stories__/Conditional.d.ts +0 -3
- package/inputs/Checkboxes/__stories__/Default/index.js +0 -40
- package/inputs/Checkboxes/__stories__/Default/package.json +0 -6
- package/inputs/Checkboxes/__stories__/Default.d.ts +0 -3
- package/inputs/Checkboxes/__stories__/WithDivider/index.js +0 -41
- package/inputs/Checkboxes/__stories__/WithDivider/package.json +0 -6
- package/inputs/Checkboxes/__stories__/WithDivider.d.ts +0 -3
- package/inputs/Checkboxes/index.mdx +0 -33
- package/inputs/Checkboxes/package.json +0 -6
- package/inputs/DateInput/DateInput.stories/index.js +0 -7
- package/inputs/DateInput/DateInput.stories/package.json +0 -6
- package/inputs/DateInput/DateInput.stories.d.ts +0 -8
- package/inputs/DateInput/DateInput.stories.playwright.json +0 -72
- package/inputs/DateInput/__stories__/Default/index.js +0 -23
- package/inputs/DateInput/__stories__/Default/package.json +0 -6
- package/inputs/DateInput/__stories__/Default.d.ts +0 -3
- package/inputs/DateInput/index.mdx +0 -23
- package/inputs/DateInput/package.json +0 -6
- package/inputs/FileInput/FileInput.stories/index.js +0 -7
- package/inputs/FileInput/FileInput.stories/package.json +0 -6
- package/inputs/FileInput/FileInput.stories.d.ts +0 -8
- package/inputs/FileInput/FileInput.stories.playwright.json +0 -75
- package/inputs/FileInput/__stories__/Default/index.js +0 -20
- package/inputs/FileInput/__stories__/Default/package.json +0 -6
- package/inputs/FileInput/__stories__/Default.d.ts +0 -3
- package/inputs/FileInput/package.json +0 -6
- package/inputs/ImageInput/ImageInput.stories/index.js +0 -9
- package/inputs/ImageInput/ImageInput.stories/package.json +0 -6
- package/inputs/ImageInput/ImageInput.stories.d.ts +0 -10
- package/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
- package/inputs/ImageInput/__stories__/Default/index.js +0 -28
- package/inputs/ImageInput/__stories__/Default/package.json +0 -6
- package/inputs/ImageInput/__stories__/Default.d.ts +0 -3
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +0 -36
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension/package.json +0 -6
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension.d.ts +0 -3
- package/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +0 -33
- package/inputs/ImageInput/__stories__/WithInvalidImageSize/package.json +0 -6
- package/inputs/ImageInput/__stories__/WithInvalidImageSize.d.ts +0 -3
- package/inputs/ImageInput/index.mdx +0 -19
- package/inputs/ImageInput/package.json +0 -6
- package/inputs/Input/Input.stories/index.js +0 -16
- package/inputs/Input/Input.stories/package.json +0 -6
- package/inputs/Input/Input.stories.d.ts +0 -17
- package/inputs/Input/Input.stories.playwright.json +0 -376
- package/inputs/Input/__stories__/AFM/index.js +0 -22
- package/inputs/Input/__stories__/AFM/package.json +0 -6
- package/inputs/Input/__stories__/AFM.d.ts +0 -3
- package/inputs/Input/__stories__/Boolean/index.js +0 -23
- package/inputs/Input/__stories__/Boolean/package.json +0 -6
- package/inputs/Input/__stories__/Boolean.d.ts +0 -3
- package/inputs/Input/__stories__/Default/index.js +0 -23
- package/inputs/Input/__stories__/Default/package.json +0 -6
- package/inputs/Input/__stories__/Default.d.ts +0 -3
- package/inputs/Input/__stories__/IBAN/index.js +0 -23
- package/inputs/Input/__stories__/IBAN/package.json +0 -6
- package/inputs/Input/__stories__/IBAN.d.ts +0 -3
- package/inputs/Input/__stories__/Integer/index.js +0 -31
- package/inputs/Input/__stories__/Integer/package.json +0 -6
- package/inputs/Input/__stories__/Integer.d.ts +0 -3
- package/inputs/Input/__stories__/LandlineNumber/index.js +0 -26
- package/inputs/Input/__stories__/LandlineNumber/package.json +0 -6
- package/inputs/Input/__stories__/LandlineNumber.d.ts +0 -3
- package/inputs/Input/__stories__/MobilePhone/index.js +0 -26
- package/inputs/Input/__stories__/MobilePhone/package.json +0 -6
- package/inputs/Input/__stories__/MobilePhone.d.ts +0 -3
- package/inputs/Input/__stories__/PhoneNumber/index.js +0 -25
- package/inputs/Input/__stories__/PhoneNumber/package.json +0 -6
- package/inputs/Input/__stories__/PhoneNumber.d.ts +0 -3
- package/inputs/Input/__stories__/PostalCode/index.js +0 -25
- package/inputs/Input/__stories__/PostalCode/package.json +0 -6
- package/inputs/Input/__stories__/PostalCode.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 -95
- package/inputs/Input/package.json +0 -6
- package/inputs/Label/Label.stories/index.js +0 -7
- package/inputs/Label/Label.stories/package.json +0 -6
- package/inputs/Label/Label.stories.d.ts +0 -8
- package/inputs/Label/Label.stories.playwright.json +0 -40
- package/inputs/Label/__stories__/Default/index.js +0 -27
- package/inputs/Label/__stories__/Default/package.json +0 -6
- package/inputs/Label/__stories__/Default.d.ts +0 -3
- package/inputs/Label/package.json +0 -6
- package/inputs/OtpInput/OtpInput.stories/index.js +0 -7
- package/inputs/OtpInput/OtpInput.stories/package.json +0 -6
- package/inputs/OtpInput/OtpInput.stories.d.ts +0 -8
- package/inputs/OtpInput/__stories__/Default/index.js +0 -29
- package/inputs/OtpInput/__stories__/Default/package.json +0 -6
- package/inputs/OtpInput/__stories__/Default.d.ts +0 -3
- package/inputs/OtpInput/index.mdx +0 -23
- package/inputs/OtpInput/package.json +0 -6
- package/inputs/Radio/Radio.stories/index.js +0 -9
- package/inputs/Radio/Radio.stories/package.json +0 -6
- package/inputs/Radio/Radio.stories.d.ts +0 -10
- package/inputs/Radio/Radio.stories.playwright.json +0 -73
- package/inputs/Radio/__stories__/Conditional/index.js +0 -93
- package/inputs/Radio/__stories__/Conditional/package.json +0 -6
- package/inputs/Radio/__stories__/Conditional.d.ts +0 -3
- package/inputs/Radio/__stories__/Default/index.js +0 -45
- package/inputs/Radio/__stories__/Default/package.json +0 -6
- package/inputs/Radio/__stories__/Default.d.ts +0 -3
- package/inputs/Radio/__stories__/WithDivider/index.js +0 -46
- package/inputs/Radio/__stories__/WithDivider/package.json +0 -6
- package/inputs/Radio/__stories__/WithDivider.d.ts +0 -3
- package/inputs/Radio/index.mdx +0 -33
- package/inputs/Radio/package.json +0 -6
- package/inputs/Select/Select.stories/index.js +0 -7
- package/inputs/Select/Select.stories/package.json +0 -6
- package/inputs/Select/Select.stories.d.ts +0 -8
- package/inputs/Select/Select.stories.playwright.json +0 -22
- package/inputs/Select/__stories__/Default/index.js +0 -51
- package/inputs/Select/__stories__/Default/package.json +0 -6
- package/inputs/Select/__stories__/Default.d.ts +0 -3
- package/inputs/Select/index.mdx +0 -17
- package/inputs/Select/package.json +0 -6
- package/inputs/package.json +0 -6
- package/installation.mdx +0 -68
- package/internal/index.js +0 -34
- package/internal/package.json +0 -6
- package/lazy/index.js +0 -395
- package/lazy/package.json +0 -6
- package/registry/index.js +0 -138
- package/registry/package.json +0 -6
- package/src/Field/index.mdx +0 -6
- package/src/Field/utils.ts +0 -191
- package/src/FieldArray/FieldArray.stories.playwright.json +0 -353
- package/src/FormBuilder/FormBuilder.stories.playwright.json +0 -52
- package/src/FormBuilder/FormBuilder.tsx +0 -166
- package/src/MultiplicityField/MultiplicityField.mdx +0 -590
- package/src/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
- package/src/Questions/index.mdx +0 -415
- package/src/inputs/AutoCompleteInput/index.mdx +0 -29
- 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/FileInput/index.mdx +0 -19
- package/src/inputs/ImageInput/ImageInput.stories.playwright.json +0 -77
- package/src/inputs/ImageInput/index.mdx +0 -19
- package/src/inputs/Input/Input.stories.playwright.json +0 -376
- package/src/inputs/Input/index.mdx +0 -95
- package/src/inputs/Label/Label.stories.playwright.json +0 -40
- package/src/inputs/OtpInput/index.mdx +0 -23
- package/src/inputs/Radio/Radio.stories.playwright.json +0 -73
- package/src/inputs/Radio/index.mdx +0 -33
- package/src/inputs/Select/Select.stories.playwright.json +0 -22
- package/src/lazy.js +0 -60
- package/src/registry.js +0 -145
- package/types/index.js +0 -1
- package/types/package.json +0 -6
- package/utils/index.js +0 -80
- package/utils/package.json +0 -6
- package/validators/package.json +0 -6
- package/validators/types/index.js +0 -1
- package/validators/types/package.json +0 -6
- package/validators/utils/afm/index.js +0 -31
- package/validators/utils/afm/package.json +0 -6
- package/validators/utils/file/index.js +0 -37
- package/validators/utils/file/package.json +0 -6
- package/validators/utils/iban/index.js +0 -116
- package/validators/utils/iban/package.json +0 -6
- package/validators/utils/image/index.js +0 -119
- package/validators/utils/image/package.json +0 -6
- package/validators/utils/int/index.js +0 -19
- package/validators/utils/int/package.json +0 -6
- package/validators/utils/number/index.js +0 -15
- package/validators/utils/number/package.json +0 -6
- package/validators/utils/otp/index.js +0 -25
- package/validators/utils/otp/package.json +0 -6
- package/validators/utils/package.json +0 -6
- package/validators/utils/phone/index.js +0 -134
- package/validators/utils/phone/package.json +0 -6
- package/validators/utils/postal_code/index.js +0 -27
- package/validators/utils/postal_code/package.json +0 -6
- package/validators/utils/text_limit/index.js +0 -47
- package/validators/utils/text_limit/package.json +0 -6
- package/validators/utils/uuid4/index.js +0 -18
- package/validators/utils/uuid4/package.json +0 -6
- package/validators/validators.spec/index.js +0 -85
- package/validators/validators.spec/package.json +0 -6
- package/validators/validators.spec.d.ts +0 -1
- /package/{cjs/inputs/Label/index.mdx → Field/types.js} +0 -0
- /package/{inputs/Label/index.mdx → Fieldset/types.js} +0 -0
- /package/{src/inputs/Label/index.mdx → MultiplicityField/types.js} +0 -0
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "4",
|
|
3
|
-
"stories": {
|
|
4
|
-
"digigov-form-inputs-dateinput--default": {
|
|
5
|
-
"actionSets": [
|
|
6
|
-
{
|
|
7
|
-
"actions": [
|
|
8
|
-
{
|
|
9
|
-
"name": "keyboard.press",
|
|
10
|
-
"args": {
|
|
11
|
-
"key": "Tab"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"name": "keyboard.press",
|
|
16
|
-
"args": {
|
|
17
|
-
"key": "Tab"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"name": "keyboard.press",
|
|
22
|
-
"args": {
|
|
23
|
-
"key": "Tab"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
|
-
"id": "n5PFnx7RcuJV",
|
|
28
|
-
"title": "navigate with keyboard"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"actions": [
|
|
32
|
-
{
|
|
33
|
-
"name": "click",
|
|
34
|
-
"args": {
|
|
35
|
-
"selector": "html>body>div:nth-child(5)>form>button"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"name": "type",
|
|
40
|
-
"args": {
|
|
41
|
-
"selector": "html>body>div:nth-child(5)>form>div>fieldset>div>div:nth-child(1)>label>input",
|
|
42
|
-
"text": "33"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"name": "type",
|
|
47
|
-
"args": {
|
|
48
|
-
"selector": "html>body>div:nth-child(5)>form>div>fieldset>div>div:nth-child(2)>label>input",
|
|
49
|
-
"text": "33"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"name": "type",
|
|
54
|
-
"args": {
|
|
55
|
-
"selector": "html>body>div:nth-child(5)>form>div>fieldset>div>div:nth-child(3)>label>input",
|
|
56
|
-
"text": "3333"
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"name": "click",
|
|
61
|
-
"args": {
|
|
62
|
-
"selector": "html>body>div:nth-child(5)>form>button"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
],
|
|
66
|
-
"id": "Ck7_BFdgITMe",
|
|
67
|
-
"title": "show validation errors"
|
|
68
|
-
}
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = exports.Default = void 0;
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _form = _interopRequireWildcard(require("@digigov/form"));
|
|
11
|
-
var _Button = require("@digigov/ui/cjs/form/Button");
|
|
12
|
-
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); }
|
|
13
|
-
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; }
|
|
14
|
-
var _ref = /*#__PURE__*/_react["default"].createElement(_Button.Button, {
|
|
15
|
-
type: "submit"
|
|
16
|
-
}, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
|
|
17
|
-
var Default = exports.Default = function Default() {
|
|
18
|
-
return /*#__PURE__*/_react["default"].createElement(_form["default"], {
|
|
19
|
-
onSubmit: function onSubmit(data) {
|
|
20
|
-
console.log(data);
|
|
21
|
-
}
|
|
22
|
-
}, /*#__PURE__*/_react["default"].createElement(_form.Field, {
|
|
23
|
-
key: 'string',
|
|
24
|
-
name: "string",
|
|
25
|
-
type: "date",
|
|
26
|
-
required: true,
|
|
27
|
-
label: {
|
|
28
|
-
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
29
|
-
secondary: 'Για παράδειγμα, 05 11 2020'
|
|
30
|
-
}
|
|
31
|
-
}), _ref);
|
|
32
|
-
};
|
|
33
|
-
var _default = exports["default"] = Default;
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = exports.DateInput = void 0;
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
13
|
-
var _customParseFormat = _interopRequireDefault(require("dayjs/plugin/customParseFormat"));
|
|
14
|
-
var _DateInputContainer = _interopRequireDefault(require("@digigov/react-core/cjs/DateInputContainer"));
|
|
15
|
-
var _DateInputItem = _interopRequireDefault(require("@digigov/react-core/cjs/DateInputItem"));
|
|
16
|
-
var _i18n = require("@digigov/ui/cjs/i18n");
|
|
17
|
-
var _excluded = ["label"],
|
|
18
|
-
_excluded2 = ["name", "type"];
|
|
19
|
-
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); }
|
|
20
|
-
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; }
|
|
21
|
-
_dayjs["default"].extend(_customParseFormat["default"]);
|
|
22
|
-
function useDate(value, onChange) {
|
|
23
|
-
var _useMemo = (0, _react.useMemo)(function () {
|
|
24
|
-
if (!value || value.length === 0) {
|
|
25
|
-
onChange('');
|
|
26
|
-
return ['', '', ''];
|
|
27
|
-
}
|
|
28
|
-
var _value$split = value.split('/'),
|
|
29
|
-
_value$split2 = (0, _slicedToArray2["default"])(_value$split, 3),
|
|
30
|
-
day = _value$split2[0],
|
|
31
|
-
month = _value$split2[1],
|
|
32
|
-
year = _value$split2[2];
|
|
33
|
-
return [year, month, day];
|
|
34
|
-
}, [value]),
|
|
35
|
-
_useMemo2 = (0, _slicedToArray2["default"])(_useMemo, 3),
|
|
36
|
-
year = _useMemo2[0],
|
|
37
|
-
month = _useMemo2[1],
|
|
38
|
-
day = _useMemo2[2];
|
|
39
|
-
function set(year, month, day) {
|
|
40
|
-
var value = "".concat(day || '', "/").concat(month || '', "/").concat(year || '');
|
|
41
|
-
if (!year && !month && !day) {
|
|
42
|
-
onChange(null);
|
|
43
|
-
} else {
|
|
44
|
-
onChange(value);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function setYear(evt) {
|
|
48
|
-
var val = evt.target.value;
|
|
49
|
-
set(val, month, day);
|
|
50
|
-
}
|
|
51
|
-
function setMonth(evt, cast) {
|
|
52
|
-
var val = evt.target.value;
|
|
53
|
-
if (cast && val && val.length === 1) {
|
|
54
|
-
val = '0' + val;
|
|
55
|
-
}
|
|
56
|
-
set(year, val, day);
|
|
57
|
-
}
|
|
58
|
-
function setDay(evt, cast) {
|
|
59
|
-
var val = evt.target.value;
|
|
60
|
-
if (cast && val && val.length === 1) {
|
|
61
|
-
val = '0' + val;
|
|
62
|
-
}
|
|
63
|
-
set(year, month, val);
|
|
64
|
-
}
|
|
65
|
-
return {
|
|
66
|
-
day: day,
|
|
67
|
-
month: month,
|
|
68
|
-
year: year,
|
|
69
|
-
setYear: setYear,
|
|
70
|
-
setMonth: setMonth,
|
|
71
|
-
setDay: setDay
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
var VALID_FORMATS = ['DD/MM/YYYY'];
|
|
75
|
-
var makeDate = function makeDate(val) {
|
|
76
|
-
var date = (0, _dayjs["default"])(val, VALID_FORMATS, true);
|
|
77
|
-
if (date.isValid()) {
|
|
78
|
-
return date.format('DD/MM/YYYY');
|
|
79
|
-
}
|
|
80
|
-
return '';
|
|
81
|
-
};
|
|
82
|
-
var DatePart = function DatePart(_ref) {
|
|
83
|
-
var label = _ref.label,
|
|
84
|
-
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
85
|
-
return /*#__PURE__*/_react["default"].createElement(_DateInputItem["default"], props, label);
|
|
86
|
-
};
|
|
87
|
-
var DateInput = exports.DateInput = function DateInput(_ref2) {
|
|
88
|
-
var name = _ref2.name,
|
|
89
|
-
type = _ref2.type,
|
|
90
|
-
props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded2);
|
|
91
|
-
var _useTranslation = (0, _i18n.useTranslation)(),
|
|
92
|
-
t = _useTranslation.t;
|
|
93
|
-
var _useState = (0, _react.useState)(props.value),
|
|
94
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 1),
|
|
95
|
-
initial = _useState2[0];
|
|
96
|
-
var value = (0, _react.useMemo)(function () {
|
|
97
|
-
if (initial === props.value) {
|
|
98
|
-
return makeDate(props.value);
|
|
99
|
-
}
|
|
100
|
-
return props.value;
|
|
101
|
-
}, [props.value, initial]);
|
|
102
|
-
var date = useDate(value || makeDate(props.defaultValue), props.onChange);
|
|
103
|
-
return /*#__PURE__*/_react["default"].createElement(_DateInputContainer["default"], null, /*#__PURE__*/_react["default"].createElement(DatePart, {
|
|
104
|
-
label: t('form.label.day'),
|
|
105
|
-
onChange: date.setDay,
|
|
106
|
-
onBlur: function onBlur(e) {
|
|
107
|
-
return date.setDay(e, true);
|
|
108
|
-
},
|
|
109
|
-
value: date.day,
|
|
110
|
-
width: 2,
|
|
111
|
-
name: "".concat(name, "-day"),
|
|
112
|
-
maxLength: "2",
|
|
113
|
-
disabled: props.disabled,
|
|
114
|
-
"aria-required": props['aria-required'],
|
|
115
|
-
error: !date.day ? props.error : false
|
|
116
|
-
}), /*#__PURE__*/_react["default"].createElement(DatePart, {
|
|
117
|
-
label: t('form.label.month'),
|
|
118
|
-
onChange: date.setMonth,
|
|
119
|
-
onBlur: function onBlur(e) {
|
|
120
|
-
return date.setMonth(e, true);
|
|
121
|
-
},
|
|
122
|
-
value: date.month,
|
|
123
|
-
width: 2,
|
|
124
|
-
name: "".concat(props.name, "-month"),
|
|
125
|
-
maxLength: "2",
|
|
126
|
-
disabled: props.disabled,
|
|
127
|
-
"aria-required": props['aria-required'],
|
|
128
|
-
error: !date.month ? props.error : false
|
|
129
|
-
}), /*#__PURE__*/_react["default"].createElement(DatePart, {
|
|
130
|
-
label: t('form.label.year'),
|
|
131
|
-
onChange: date.setYear,
|
|
132
|
-
value: date.year,
|
|
133
|
-
width: 4,
|
|
134
|
-
name: "".concat(props.name, "-year"),
|
|
135
|
-
maxLength: "4",
|
|
136
|
-
disabled: props.disabled,
|
|
137
|
-
"aria-required": props['aria-required'],
|
|
138
|
-
error: !date.year ? props.error : false
|
|
139
|
-
}));
|
|
140
|
-
};
|
|
141
|
-
var _default = exports["default"] = DateInput;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Date Input
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Date input
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Input element of type `date` create input fields that let the user enter a date,
|
|
10
|
-
either with a textbox that validates the input or a special date picker interface.
|
|
11
|
-
|
|
12
|
-
## How to use
|
|
13
|
-
|
|
14
|
-
### Default
|
|
15
|
-
|
|
16
|
-
<Story
|
|
17
|
-
packageName="@digigov/form"
|
|
18
|
-
component="inputs/DateInput"
|
|
19
|
-
story="Default.tsx"
|
|
20
|
-
/>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
var _exportNames = {};
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
var _FileInput = _interopRequireDefault(require("@digigov/form/inputs/FileInput"));
|
|
10
|
-
var _Default = require("@digigov/form/inputs/FileInput/__stories__/Default");
|
|
11
|
-
Object.keys(_Default).forEach(function (key) {
|
|
12
|
-
if (key === "default" || key === "__esModule") return;
|
|
13
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
14
|
-
if (key in exports && exports[key] === _Default[key]) return;
|
|
15
|
-
Object.defineProperty(exports, key, {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function get() {
|
|
18
|
-
return _Default[key];
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
var _default = exports["default"] = {
|
|
23
|
-
title: 'Digigov Form/inputs/FileInput',
|
|
24
|
-
component: _FileInput["default"],
|
|
25
|
-
displayName: 'FileInput'
|
|
26
|
-
};
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "4",
|
|
3
|
-
"stories": {
|
|
4
|
-
"digigov-form-inputs-fileinput--default": {
|
|
5
|
-
"actionSets": [
|
|
6
|
-
{
|
|
7
|
-
"actions": [
|
|
8
|
-
{
|
|
9
|
-
"name": "click",
|
|
10
|
-
"args": {
|
|
11
|
-
"selector": "html>body>div:nth-child(5)>form>button"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"id": "c4Jhtju9oCJZ",
|
|
16
|
-
"title": "show validation error"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"actions": [
|
|
20
|
-
{
|
|
21
|
-
"name": "setFiles",
|
|
22
|
-
"args": {
|
|
23
|
-
"selector": "html>body>div:nth-child(5)>form>div>fieldset>div>label",
|
|
24
|
-
"file": {
|
|
25
|
-
"name": "arxeio.txt",
|
|
26
|
-
"size": 200
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"name": "click",
|
|
32
|
-
"args": {
|
|
33
|
-
"selector": "html>body>div:nth-child(5)>form>div>fieldset>div>button"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
"id": "WPIcVVWz-299",
|
|
38
|
-
"title": "add file and remove"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"actions": [
|
|
42
|
-
{
|
|
43
|
-
"name": "setFiles",
|
|
44
|
-
"args": {
|
|
45
|
-
"selector": "html>body>div:nth-child(5)>form>div>fieldset>div>label",
|
|
46
|
-
"file": {
|
|
47
|
-
"name": "arxeio.txt",
|
|
48
|
-
"size": 200
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"name": "setFiles",
|
|
54
|
-
"args": {
|
|
55
|
-
"selector": "html>body>div:nth-child(5)>form>div>fieldset>div>label",
|
|
56
|
-
"file": {
|
|
57
|
-
"name": "neo_arxeio.txt",
|
|
58
|
-
"size": 200
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"name": "click",
|
|
64
|
-
"args": {
|
|
65
|
-
"selector": "html>body>div:nth-child(5)>form>button"
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
"id": "inSBFd25dzkC",
|
|
70
|
-
"title": "add file, replace and remove"
|
|
71
|
-
}
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = exports.Default = void 0;
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _form = _interopRequireWildcard(require("@digigov/form"));
|
|
11
|
-
var _Button = require("@digigov/ui/cjs/form/Button");
|
|
12
|
-
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); }
|
|
13
|
-
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; }
|
|
14
|
-
var _ref = /*#__PURE__*/_react["default"].createElement(_Button.Button, null, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
|
|
15
|
-
var Default = exports.Default = function Default() {
|
|
16
|
-
return /*#__PURE__*/_react["default"].createElement(_form["default"], {
|
|
17
|
-
onSubmit: function onSubmit(data) {
|
|
18
|
-
console.log(data);
|
|
19
|
-
}
|
|
20
|
-
}, /*#__PURE__*/_react["default"].createElement(_form.Field, {
|
|
21
|
-
key: 'string',
|
|
22
|
-
name: "file",
|
|
23
|
-
type: "file",
|
|
24
|
-
required: true,
|
|
25
|
-
label: {
|
|
26
|
-
primary: 'Βιογραφικό σημείωμα'
|
|
27
|
-
}
|
|
28
|
-
}), _ref);
|
|
29
|
-
};
|
|
30
|
-
var _default = exports["default"] = Default;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = exports.FileInput = void 0;
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
-
var _FileUpload = _interopRequireDefault(require("@digigov/react-core/cjs/FileUpload"));
|
|
15
|
-
var _FileUploadContainer = _interopRequireDefault(require("@digigov/react-core/cjs/FileUploadContainer"));
|
|
16
|
-
var _Hint = _interopRequireDefault(require("@digigov/react-core/cjs/Hint"));
|
|
17
|
-
var _Button = _interopRequireDefault(require("@digigov/ui/cjs/form/Button"));
|
|
18
|
-
var _i18n = require("@digigov/ui/cjs/i18n");
|
|
19
|
-
var _Paragraph = _interopRequireDefault(require("@digigov/ui/cjs/typography/Paragraph"));
|
|
20
|
-
var _excluded = ["name", "extra", "disabled", "reset", "onChange"];
|
|
21
|
-
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); }
|
|
22
|
-
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; }
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
-
var FileInput = exports.FileInput = /*#__PURE__*/_react["default"].forwardRef(function FileInput(_ref, ref) {
|
|
25
|
-
var name = _ref.name,
|
|
26
|
-
_ref$extra = _ref.extra,
|
|
27
|
-
extra = _ref$extra === void 0 ? {} : _ref$extra,
|
|
28
|
-
disabled = _ref.disabled,
|
|
29
|
-
reset = _ref.reset,
|
|
30
|
-
onChange = _ref.onChange,
|
|
31
|
-
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
32
|
-
var _useTranslation = (0, _i18n.useTranslation)(),
|
|
33
|
-
t = _useTranslation.t;
|
|
34
|
-
var _useState = (0, _react.useState)([]),
|
|
35
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
36
|
-
files = _useState2[0],
|
|
37
|
-
setFiles = _useState2[1];
|
|
38
|
-
var handleChange = function handleChange(e) {
|
|
39
|
-
var target = e.target;
|
|
40
|
-
var selectedFiles = Array.from(target.files).map(function (_ref2) {
|
|
41
|
-
var name = _ref2.name;
|
|
42
|
-
return name;
|
|
43
|
-
});
|
|
44
|
-
setFiles(selectedFiles);
|
|
45
|
-
// proceed calling the onChange provided
|
|
46
|
-
// by react-hook-form
|
|
47
|
-
onChange(e);
|
|
48
|
-
};
|
|
49
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_FileUploadContainer["default"], {
|
|
50
|
-
hasFiles: files && files.length > 0
|
|
51
|
-
}, files !== null && files !== void 0 && files.length ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Paragraph["default"], null, /*#__PURE__*/_react["default"].createElement("b", null, t('upload.file'), ":"), " ", "".concat(files.join(', ')))) : /*#__PURE__*/_react["default"].createElement(_Hint["default"], null, t('upload.no_file')), /*#__PURE__*/_react["default"].createElement(_FileUpload["default"], (0, _extends2["default"])({
|
|
52
|
-
ref: ref,
|
|
53
|
-
hasFiles: !!(files !== null && files !== void 0 && files.length),
|
|
54
|
-
name: name,
|
|
55
|
-
disabled: disabled,
|
|
56
|
-
onChange: handleChange
|
|
57
|
-
}, (0, _extends2["default"])({}, props, {
|
|
58
|
-
required: undefined
|
|
59
|
-
})), files !== null && files !== void 0 && files.length ? t('upload.change_file') : t('upload.choose_file')), files !== undefined && files.length > 0 && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
60
|
-
variant: "link",
|
|
61
|
-
onClick: function onClick(event) {
|
|
62
|
-
event.preventDefault();
|
|
63
|
-
reset((0, _defineProperty2["default"])({}, name, ''));
|
|
64
|
-
setFiles(undefined);
|
|
65
|
-
}
|
|
66
|
-
}, t('upload.reset_file')))));
|
|
67
|
-
});
|
|
68
|
-
var _default = exports["default"] = FileInput;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: File Input
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# File input
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Input element of type `file` let the user choose one or more files from their device storage.
|
|
10
|
-
|
|
11
|
-
## How to use
|
|
12
|
-
|
|
13
|
-
### Default
|
|
14
|
-
|
|
15
|
-
<Story
|
|
16
|
-
packageName="@digigov/form"
|
|
17
|
-
component="inputs/FileInput"
|
|
18
|
-
story="Default.tsx"
|
|
19
|
-
/>
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
var _exportNames = {};
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
var _ImageInput = _interopRequireDefault(require("@digigov/form/inputs/ImageInput"));
|
|
10
|
-
var _Default = require("@digigov/form/inputs/ImageInput/__stories__/Default");
|
|
11
|
-
Object.keys(_Default).forEach(function (key) {
|
|
12
|
-
if (key === "default" || key === "__esModule") return;
|
|
13
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
14
|
-
if (key in exports && exports[key] === _Default[key]) return;
|
|
15
|
-
Object.defineProperty(exports, key, {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function get() {
|
|
18
|
-
return _Default[key];
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
var _WithInvalidImageSize = require("@digigov/form/inputs/ImageInput/__stories__/WithInvalidImageSize");
|
|
23
|
-
Object.keys(_WithInvalidImageSize).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] === _WithInvalidImageSize[key]) return;
|
|
27
|
-
Object.defineProperty(exports, key, {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function get() {
|
|
30
|
-
return _WithInvalidImageSize[key];
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
var _WithInvalidImageDimension = require("@digigov/form/inputs/ImageInput/__stories__/WithInvalidImageDimension");
|
|
35
|
-
Object.keys(_WithInvalidImageDimension).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] === _WithInvalidImageDimension[key]) return;
|
|
39
|
-
Object.defineProperty(exports, key, {
|
|
40
|
-
enumerable: true,
|
|
41
|
-
get: function get() {
|
|
42
|
-
return _WithInvalidImageDimension[key];
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
var _default = exports["default"] = {
|
|
47
|
-
title: 'Digigov Form/inputs/ImageInput',
|
|
48
|
-
component: _ImageInput["default"],
|
|
49
|
-
displayName: 'ImageInput'
|
|
50
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "4",
|
|
3
|
-
"stories": {
|
|
4
|
-
"digigov-form-inputs-imageinput--with-invalid-image-dimension": {
|
|
5
|
-
"actionSets": [
|
|
6
|
-
{
|
|
7
|
-
"actions": [
|
|
8
|
-
{
|
|
9
|
-
"name": "setImages",
|
|
10
|
-
"args": {
|
|
11
|
-
"file": {
|
|
12
|
-
"name": "image.jpg",
|
|
13
|
-
"size": 500,
|
|
14
|
-
"width": 500,
|
|
15
|
-
"height": 500
|
|
16
|
-
},
|
|
17
|
-
"selector": "html>body>div:nth-child(5)>form>fieldset>div>fieldset>div>div>label"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"name": "click",
|
|
22
|
-
"args": {
|
|
23
|
-
"selector": "html>body>div:nth-child(5)>form>button"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
],
|
|
27
|
-
"id": "o22sSYzQqsMl",
|
|
28
|
-
"title": "Dimension image action"
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
"digigov-form-inputs-imageinput--with-invalid-image-size": {
|
|
33
|
-
"actionSets": [
|
|
34
|
-
{
|
|
35
|
-
"actions": [
|
|
36
|
-
{
|
|
37
|
-
"name": "setImages",
|
|
38
|
-
"args": {
|
|
39
|
-
"file": {
|
|
40
|
-
"name": "image.jpg",
|
|
41
|
-
"size": 500,
|
|
42
|
-
"width": 500,
|
|
43
|
-
"height": 500
|
|
44
|
-
},
|
|
45
|
-
"selector": "html>body>div:nth-child(5)>form>fieldset>div>fieldset>div>div>label"
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"name": "click",
|
|
50
|
-
"args": {
|
|
51
|
-
"selector": "html>body>div:nth-child(5)>form>button"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
],
|
|
55
|
-
"id": "0TewzMxhK1db",
|
|
56
|
-
"title": "Size image action"
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
"digigov-form-inputs-imageinput--default": {
|
|
61
|
-
"actionSets": [
|
|
62
|
-
{
|
|
63
|
-
"actions": [
|
|
64
|
-
{
|
|
65
|
-
"name": "click",
|
|
66
|
-
"args": {
|
|
67
|
-
"selector": "html>body>div:nth-child(5)>form>button"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
|
-
"id": "Pvb2kqeg1fI3",
|
|
72
|
-
"title": "Invalid submit"
|
|
73
|
-
}
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = exports.Default = void 0;
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _form = _interopRequireWildcard(require("@digigov/form"));
|
|
11
|
-
var _Button = require("@digigov/ui/cjs/form/Button");
|
|
12
|
-
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); }
|
|
13
|
-
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; }
|
|
14
|
-
var FIELDS = [{
|
|
15
|
-
key: 'image',
|
|
16
|
-
type: 'image',
|
|
17
|
-
required: true,
|
|
18
|
-
label: {
|
|
19
|
-
primary: 'Ανέβασμα φωτογραφίας'
|
|
20
|
-
}
|
|
21
|
-
}];
|
|
22
|
-
var _ref = /*#__PURE__*/_react["default"].createElement(_Button.Button, {
|
|
23
|
-
type: "submit"
|
|
24
|
-
}, "\u03A3\u03C5\u03BD\u03AD\u03C7\u03B5\u03B9\u03B1");
|
|
25
|
-
var Default = exports.Default = function Default() {
|
|
26
|
-
return /*#__PURE__*/_react["default"].createElement(_form["default"], {
|
|
27
|
-
fields: FIELDS,
|
|
28
|
-
onSubmit: function onSubmit(data) {
|
|
29
|
-
console.log(data);
|
|
30
|
-
}
|
|
31
|
-
}, /*#__PURE__*/_react["default"].createElement(_form.Fieldset, null, FIELDS.map(function (field) {
|
|
32
|
-
return /*#__PURE__*/_react["default"].createElement(_form.Field, {
|
|
33
|
-
key: field.key,
|
|
34
|
-
name: field.key
|
|
35
|
-
});
|
|
36
|
-
})), _ref);
|
|
37
|
-
};
|
|
38
|
-
var _default = exports["default"] = Default;
|