@digigov/form 0.10.6 → 0.10.7
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/.eslintrc.js +3 -0
- package/.prettierrc.js +3 -0
- package/CHANGELOG.json +1392 -0
- package/CHANGELOG.md +8 -1
- package/coverage/clover.xml +859 -0
- package/coverage/coverage-final.json +51 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +386 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/src/Field/FieldBase.tsx.html +379 -0
- package/coverage/lcov-report/src/Field/FieldConditional.tsx.html +310 -0
- package/coverage/lcov-report/src/Field/FieldContainer.tsx.html +256 -0
- package/coverage/lcov-report/src/Field/index.html +176 -0
- package/coverage/lcov-report/src/Field/index.tsx.html +352 -0
- package/coverage/lcov-report/src/Field/utils.ts.html +559 -0
- package/coverage/lcov-report/src/FieldArray/index.html +116 -0
- package/coverage/lcov-report/src/FieldArray/index.tsx.html +319 -0
- package/coverage/lcov-report/src/FieldObject/index.html +116 -0
- package/coverage/lcov-report/src/FieldObject/index.tsx.html +364 -0
- package/coverage/lcov-report/src/Fieldset/index.html +116 -0
- package/coverage/lcov-report/src/Fieldset/index.tsx.html +202 -0
- package/coverage/lcov-report/src/FormBuilder/FormBuilder.tsx.html +580 -0
- package/coverage/lcov-report/src/FormBuilder/index.html +131 -0
- package/coverage/lcov-report/src/FormBuilder/index.tsx.html +94 -0
- package/coverage/lcov-report/src/FormContext.tsx.html +109 -0
- package/coverage/lcov-report/src/MultiplicityField/add-objects.tsx.html +637 -0
- package/coverage/lcov-report/src/MultiplicityField/index.html +131 -0
- package/coverage/lcov-report/src/MultiplicityField/index.tsx.html +580 -0
- package/coverage/lcov-report/src/Questions/Questions.tsx.html +307 -0
- package/coverage/lcov-report/src/Questions/QuestionsContext.tsx.html +112 -0
- package/coverage/lcov-report/src/Questions/Step/ReviewStep.tsx.html +274 -0
- package/coverage/lcov-report/src/Questions/Step/Step.tsx.html +286 -0
- package/coverage/lcov-report/src/Questions/Step/StepArrayReview.tsx.html +289 -0
- package/coverage/lcov-report/src/Questions/Step/StepContext.tsx.html +148 -0
- package/coverage/lcov-report/src/Questions/Step/StepDescription.tsx.html +184 -0
- package/coverage/lcov-report/src/Questions/Step/StepForm.tsx.html +265 -0
- package/coverage/lcov-report/src/Questions/Step/StepQuote.tsx.html +109 -0
- package/coverage/lcov-report/src/Questions/Step/StepTitle.tsx.html +265 -0
- package/coverage/lcov-report/src/Questions/Step/getAddMoreFields.tsx.html +169 -0
- package/coverage/lcov-report/src/Questions/Step/index.html +266 -0
- package/coverage/lcov-report/src/Questions/Step/index.ts.html +124 -0
- package/coverage/lcov-report/src/Questions/Step/types.tsx.html +181 -0
- package/coverage/lcov-report/src/Questions/getNextStep.tsx.html +157 -0
- package/coverage/lcov-report/src/Questions/index.html +161 -0
- package/coverage/lcov-report/src/Questions/index.tsx.html +100 -0
- package/coverage/lcov-report/src/index.html +176 -0
- package/coverage/lcov-report/src/index.ts.html +94 -0
- package/coverage/lcov-report/src/inputs/Checkboxes/index.html +116 -0
- package/coverage/lcov-report/src/inputs/Checkboxes/index.tsx.html +307 -0
- package/coverage/lcov-report/src/inputs/DateInput/index.html +116 -0
- package/coverage/lcov-report/src/inputs/DateInput/index.tsx.html +475 -0
- package/coverage/lcov-report/src/inputs/FileInput/index.html +116 -0
- package/coverage/lcov-report/src/inputs/FileInput/index.tsx.html +313 -0
- package/coverage/lcov-report/src/inputs/Input/index.html +116 -0
- package/coverage/lcov-report/src/inputs/Input/index.tsx.html +271 -0
- package/coverage/lcov-report/src/inputs/Label/index.html +116 -0
- package/coverage/lcov-report/src/inputs/Label/index.tsx.html +217 -0
- package/coverage/lcov-report/src/inputs/Radio/index.html +116 -0
- package/coverage/lcov-report/src/inputs/Radio/index.tsx.html +256 -0
- package/coverage/lcov-report/src/inputs/Select/index.html +116 -0
- package/coverage/lcov-report/src/inputs/Select/index.tsx.html +196 -0
- package/coverage/lcov-report/src/inputs/index.html +116 -0
- package/coverage/lcov-report/src/inputs/index.ts.html +106 -0
- package/coverage/lcov-report/src/internal.ts.html +184 -0
- package/coverage/lcov-report/src/types.tsx.html +406 -0
- package/coverage/lcov-report/src/utils.ts.html +319 -0
- package/coverage/lcov-report/src/validators/index.html +116 -0
- package/coverage/lcov-report/src/validators/index.ts.html +694 -0
- package/coverage/lcov-report/src/validators/utils/afm.ts.html +196 -0
- package/coverage/lcov-report/src/validators/utils/file.ts.html +160 -0
- package/coverage/lcov-report/src/validators/utils/iban.ts.html +442 -0
- package/coverage/lcov-report/src/validators/utils/index.html +236 -0
- package/coverage/lcov-report/src/validators/utils/index.ts.html +367 -0
- package/coverage/lcov-report/src/validators/utils/int.ts.html +151 -0
- package/coverage/lcov-report/src/validators/utils/number.ts.html +139 -0
- package/coverage/lcov-report/src/validators/utils/phone.ts.html +445 -0
- package/coverage/lcov-report/src/validators/utils/postal_code.ts.html +184 -0
- package/coverage/lcov-report/src/validators/utils/uuid4.ts.html +148 -0
- package/coverage/lcov.info +1969 -0
- package/dist/CHANGELOG.md +432 -0
- package/{Field → dist/Field}/FieldBase.d.ts +0 -0
- package/{Field → dist/Field}/FieldBase.js +3 -3
- package/dist/Field/FieldBaseContainer.d.ts +4 -0
- package/{Field/FieldContainer.js → dist/Field/FieldBaseContainer.js} +10 -10
- package/{Field → dist/Field}/FieldConditional.d.ts +0 -0
- package/{Field → dist/Field}/FieldConditional.js +0 -0
- package/{Field → dist/Field}/index.d.ts +0 -0
- package/{Field → dist/Field}/index.js +0 -0
- package/{Field → dist/Field}/index.mdx +0 -0
- package/{Field → dist/Field}/types.d.ts +0 -0
- package/{Field → dist/Field}/types.js +0 -0
- package/{Field → dist/Field}/utils.d.ts +0 -0
- package/{Field → dist/Field}/utils.js +0 -0
- package/{FieldArray → dist/FieldArray}/FieldArray.stories.d.ts +0 -0
- package/{FieldArray → dist/FieldArray}/FieldArray.stories.js +0 -0
- package/{FieldArray → dist/FieldArray}/FieldArray.stories.playwright.json +0 -0
- package/{FieldArray → dist/FieldArray}/__stories__/Default.d.ts +0 -0
- package/{FieldArray → dist/FieldArray}/__stories__/Default.js +0 -0
- package/{FieldArray → dist/FieldArray}/__stories__/WithExactLength.d.ts +0 -0
- package/{FieldArray → dist/FieldArray}/__stories__/WithExactLength.js +0 -0
- package/{FieldArray → dist/FieldArray}/index.d.ts +0 -0
- package/{FieldArray → dist/FieldArray}/index.js +2 -2
- package/{FieldObject → dist/FieldObject}/index.d.ts +0 -0
- package/{FieldObject → dist/FieldObject}/index.js +0 -0
- package/{Fieldset → dist/Fieldset}/FieldsetWithContext.d.ts +0 -0
- package/{Fieldset → dist/Fieldset}/FieldsetWithContext.js +0 -0
- package/{Fieldset → dist/Fieldset}/index.d.ts +2 -1
- package/{Fieldset → dist/Fieldset}/index.js +8 -9
- package/{Fieldset → dist/Fieldset}/types.d.ts +0 -0
- package/{Fieldset → dist/Fieldset}/types.js +0 -0
- package/{Form.stories.d.ts → dist/Form.stories.d.ts} +0 -0
- package/{Form.stories.js → dist/Form.stories.js} +0 -0
- package/{Form.stories.playwright.json → dist/Form.stories.playwright.json} +0 -0
- package/{FormBuilder → dist/FormBuilder}/FormBuilder.d.ts +0 -0
- package/{FormBuilder → dist/FormBuilder}/FormBuilder.js +0 -0
- package/{FormBuilder → dist/FormBuilder}/FormBuilder.mdx +0 -0
- package/{FormBuilder → dist/FormBuilder}/FormBuilder.stories.d.ts +0 -0
- package/{FormBuilder → dist/FormBuilder}/FormBuilder.stories.js +0 -0
- package/{FormBuilder → dist/FormBuilder}/FormBuilder.stories.playwright.json +0 -0
- package/{FormBuilder → dist/FormBuilder}/__stories__/Default.d.ts +0 -0
- package/{FormBuilder → dist/FormBuilder}/__stories__/Default.js +0 -0
- package/{FormBuilder → dist/FormBuilder}/index.d.ts +0 -0
- package/{FormBuilder → dist/FormBuilder}/index.js +0 -0
- package/{FormContext.d.ts → dist/FormContext.d.ts} +0 -0
- package/{FormContext.js → dist/FormContext.js} +0 -0
- package/{LICENSE → dist/LICENSE} +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/MultiplicityField.mdx +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/MultiplicityField.stories.d.ts +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/MultiplicityField.stories.js +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/MultiplicityField.stories.playwright.json +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/__stories__/Default.d.ts +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/__stories__/Default.js +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/__stories__/PreviewDisplay.d.ts +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/__stories__/PreviewDisplay.js +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/__stories__/WithExactLength.d.ts +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/__stories__/WithExactLength.js +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/__stories__/WithMaxLength.d.ts +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/__stories__/WithMaxLength.js +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/__stories__/WithMinAndMaxLength.d.ts +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/__stories__/WithMinAndMaxLength.js +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/__stories__/WithMinLength.d.ts +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/__stories__/WithMinLength.js +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/add-objects.d.ts +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/add-objects.js +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/index.d.ts +0 -0
- package/{MultiplicityField → dist/MultiplicityField}/index.js +2 -2
- package/{Questions → dist/Questions}/Questions.d.ts +0 -0
- package/{Questions → dist/Questions}/Questions.js +0 -0
- package/{Questions → dist/Questions}/QuestionsContext.d.ts +0 -0
- package/{Questions → dist/Questions}/QuestionsContext.js +0 -0
- package/{Questions → dist/Questions}/Step/ReviewStep.d.ts +0 -0
- package/{Questions → dist/Questions}/Step/ReviewStep.js +0 -0
- package/{Questions → dist/Questions}/Step/Step.d.ts +0 -0
- package/{Questions → dist/Questions}/Step/Step.js +0 -0
- package/{Questions → dist/Questions}/Step/StepArrayReview.d.ts +0 -0
- package/{Questions → dist/Questions}/Step/StepArrayReview.js +0 -0
- package/{Questions → dist/Questions}/Step/StepContext.d.ts +0 -0
- package/{Questions → dist/Questions}/Step/StepContext.js +0 -0
- package/{Questions → dist/Questions}/Step/StepDescription.d.ts +0 -0
- package/{Questions → dist/Questions}/Step/StepDescription.js +0 -0
- package/{Questions → dist/Questions}/Step/StepForm.d.ts +0 -0
- package/{Questions → dist/Questions}/Step/StepForm.js +0 -0
- package/{Questions → dist/Questions}/Step/StepQuote.d.ts +0 -0
- package/{Questions → dist/Questions}/Step/StepQuote.js +0 -0
- package/{Questions → dist/Questions}/Step/StepTitle.d.ts +0 -0
- package/{Questions → dist/Questions}/Step/StepTitle.js +0 -0
- package/{Questions → dist/Questions}/Step/getAddMoreFields.d.ts +0 -0
- package/{Questions → dist/Questions}/Step/getAddMoreFields.js +0 -0
- package/{Questions → dist/Questions}/Step/index.d.ts +0 -0
- package/{Questions → dist/Questions}/Step/index.js +0 -0
- package/{Questions → dist/Questions}/Step/types.d.ts +0 -0
- package/{Questions → dist/Questions}/Step/types.js +0 -0
- package/{Questions → dist/Questions}/__snapshots__/index.spec.tsx.snap +0 -0
- package/{Questions → dist/Questions}/getNextStep.d.ts +0 -0
- package/{Questions → dist/Questions}/getNextStep.js +0 -0
- package/{Questions → dist/Questions}/index.d.ts +0 -0
- package/{Questions → dist/Questions}/index.js +0 -0
- package/{Questions → dist/Questions}/index.mdx +0 -0
- package/{Questions → dist/Questions}/index.spec.d.ts +0 -0
- package/{Questions → dist/Questions}/index.spec.js +0 -0
- package/{Questions → dist/Questions}/types.d.ts +0 -0
- package/{Questions → dist/Questions}/types.js +0 -0
- package/{es/inputs/Checkboxes/index.mdx → dist/README.md} +0 -0
- package/{__stories__ → dist/__stories__}/AutoCompleteField.d.ts +0 -0
- package/{__stories__ → dist/__stories__}/AutoCompleteField.js +0 -0
- package/{__stories__ → dist/__stories__}/IntField.d.ts +0 -0
- package/{__stories__ → dist/__stories__}/IntField.js +0 -0
- package/{create-simple-form.mdx → dist/create-simple-form.mdx} +0 -0
- package/{es → dist/es}/Field/FieldBase.js +3 -3
- package/{esm/Field/FieldContainer.js → dist/es/Field/FieldBaseContainer.js} +7 -7
- package/{es → dist/es}/Field/FieldConditional.js +0 -0
- package/{es → dist/es}/Field/index.js +0 -0
- package/{es → dist/es}/Field/index.mdx +0 -0
- package/{es → dist/es}/Field/types.js +0 -0
- package/{es → dist/es}/Field/utils.js +0 -0
- package/{es → dist/es}/FieldArray/FieldArray.stories.js +0 -0
- package/{es → dist/es}/FieldArray/FieldArray.stories.playwright.json +0 -0
- package/{es → dist/es}/FieldArray/__stories__/Default.js +0 -0
- package/{es → dist/es}/FieldArray/__stories__/WithExactLength.js +0 -0
- package/{esm → dist/es}/FieldArray/index.js +1 -1
- package/{es → dist/es}/FieldObject/index.js +0 -0
- package/{es → dist/es}/Fieldset/FieldsetWithContext.js +0 -0
- package/{esm → dist/es}/Fieldset/index.js +2 -5
- package/{es → dist/es}/Fieldset/types.js +0 -0
- package/{es → dist/es}/Form.stories.js +0 -0
- package/{es → dist/es}/Form.stories.playwright.json +0 -0
- package/{es → dist/es}/FormBuilder/FormBuilder.js +0 -0
- package/{es → dist/es}/FormBuilder/FormBuilder.mdx +0 -0
- package/{es → dist/es}/FormBuilder/FormBuilder.stories.js +0 -0
- package/{es → dist/es}/FormBuilder/FormBuilder.stories.playwright.json +0 -0
- package/{es → dist/es}/FormBuilder/__stories__/Default.js +0 -0
- package/{es → dist/es}/FormBuilder/index.js +0 -0
- package/{es → dist/es}/FormContext.js +0 -0
- package/{es → dist/es}/MultiplicityField/MultiplicityField.mdx +0 -0
- package/{es → dist/es}/MultiplicityField/MultiplicityField.stories.js +0 -0
- package/{es → dist/es}/MultiplicityField/MultiplicityField.stories.playwright.json +0 -0
- package/{es → dist/es}/MultiplicityField/__stories__/Default.js +0 -0
- package/{es → dist/es}/MultiplicityField/__stories__/PreviewDisplay.js +0 -0
- package/{es → dist/es}/MultiplicityField/__stories__/WithExactLength.js +0 -0
- package/{es → dist/es}/MultiplicityField/__stories__/WithMaxLength.js +0 -0
- package/{es → dist/es}/MultiplicityField/__stories__/WithMinAndMaxLength.js +0 -0
- package/{es → dist/es}/MultiplicityField/__stories__/WithMinLength.js +0 -0
- package/{es → dist/es}/MultiplicityField/add-objects.js +0 -0
- package/{esm → dist/es}/MultiplicityField/index.js +1 -1
- package/{es → dist/es}/Questions/Questions.js +0 -0
- package/{es → dist/es}/Questions/QuestionsContext.js +0 -0
- package/{es → dist/es}/Questions/Step/ReviewStep.js +0 -0
- package/{es → dist/es}/Questions/Step/Step.js +0 -0
- package/{es → dist/es}/Questions/Step/StepArrayReview.js +0 -0
- package/{es → dist/es}/Questions/Step/StepContext.js +0 -0
- package/{es → dist/es}/Questions/Step/StepDescription.js +0 -0
- package/{es → dist/es}/Questions/Step/StepForm.js +0 -0
- package/{es → dist/es}/Questions/Step/StepQuote.js +0 -0
- package/{es → dist/es}/Questions/Step/StepTitle.js +0 -0
- package/{es → dist/es}/Questions/Step/getAddMoreFields.js +0 -0
- package/{es → dist/es}/Questions/Step/index.js +0 -0
- package/{es → dist/es}/Questions/Step/types.js +0 -0
- package/{es → dist/es}/Questions/__snapshots__/index.spec.tsx.snap +0 -0
- package/{es → dist/es}/Questions/getNextStep.js +0 -0
- package/{es → dist/es}/Questions/index.js +0 -0
- package/{es → dist/es}/Questions/index.mdx +0 -0
- package/{es → dist/es}/Questions/index.spec.js +0 -0
- package/{es → dist/es}/Questions/types.js +0 -0
- package/{es → dist/es}/__stories__/AutoCompleteField.js +0 -0
- package/{es → dist/es}/__stories__/IntField.js +0 -0
- package/{es → dist/es}/create-simple-form.mdx +0 -0
- package/{es → dist/es}/index.js +0 -0
- package/{es → dist/es}/index.mdx +0 -0
- package/{es → dist/es}/inputs/AutoComplete/index.js +0 -0
- package/{es → dist/es}/inputs/Checkboxes/Checkboxes.stories.js +0 -0
- package/{es → dist/es}/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -0
- package/{es → dist/es}/inputs/Checkboxes/__stories__/Default.js +0 -0
- package/{es → dist/es}/inputs/Checkboxes/index.js +0 -0
- package/{es/inputs/Label → dist/es/inputs/Checkboxes}/index.mdx +0 -0
- package/{es → dist/es}/inputs/DateInput/DateInput.stories.js +0 -0
- package/{es → dist/es}/inputs/DateInput/DateInput.stories.playwright.json +0 -0
- package/{es → dist/es}/inputs/DateInput/__stories__/Default.js +0 -0
- package/{esm → dist/es}/inputs/DateInput/index.js +2 -2
- package/{es → dist/es}/inputs/FileInput/FileInput.stories.js +0 -0
- package/{es → dist/es}/inputs/FileInput/FileInput.stories.playwright.json +0 -0
- package/{es → dist/es}/inputs/FileInput/__stories__/Default.js +0 -0
- package/{es → dist/es}/inputs/FileInput/index.js +0 -0
- package/{es → dist/es}/inputs/Input/Input.stories.js +0 -0
- package/{es → dist/es}/inputs/Input/Input.stories.playwright.json +0 -0
- package/{es → dist/es}/inputs/Input/__stories__/AFM.js +0 -0
- package/{es → dist/es}/inputs/Input/__stories__/Boolean.js +0 -0
- package/{es → dist/es}/inputs/Input/__stories__/Default.js +0 -0
- package/{es → dist/es}/inputs/Input/__stories__/IBAN.js +0 -0
- package/{es → dist/es}/inputs/Input/__stories__/Integer.js +0 -0
- package/{es → dist/es}/inputs/Input/__stories__/MobilePhone.js +0 -0
- package/{es → dist/es}/inputs/Input/__stories__/PhoneNumber.js +0 -0
- package/{es → dist/es}/inputs/Input/__stories__/PostalCode.js +0 -0
- package/{es → dist/es}/inputs/Input/index.js +0 -0
- package/{es → dist/es}/inputs/Input/index.mdx +0 -0
- package/{es → dist/es}/inputs/Label/Label.stories.js +0 -0
- package/{es → dist/es}/inputs/Label/Label.stories.playwright.json +0 -0
- package/{es → dist/es}/inputs/Label/__stories__/Default.js +0 -0
- package/{es → dist/es}/inputs/Label/index.js +0 -0
- package/{es/inputs/Radio → dist/es/inputs/Label}/index.mdx +0 -0
- package/{es → dist/es}/inputs/Radio/Radio.stories.js +0 -0
- package/{es → dist/es}/inputs/Radio/Radio.stories.playwright.json +0 -0
- package/{es → dist/es}/inputs/Radio/__stories__/Default.js +0 -0
- package/{es → dist/es}/inputs/Radio/index.js +2 -2
- package/{esm/inputs/Checkboxes → dist/es/inputs/Radio}/index.mdx +0 -0
- package/{es → dist/es}/inputs/Select/Select.stories.js +0 -0
- package/{es → dist/es}/inputs/Select/Select.stories.playwright.json +0 -0
- package/{es → dist/es}/inputs/Select/__stories__/Default.js +0 -0
- package/{esm → dist/es}/inputs/Select/index.js +2 -2
- package/{es → dist/es}/inputs/index.js +0 -0
- package/{es → dist/es}/installation.mdx +0 -0
- package/{es → dist/es}/internal.js +0 -0
- package/{esm → dist/es}/registry.js +2 -2
- package/{es → dist/es}/types.js +0 -0
- package/{es → dist/es}/utils.js +0 -0
- package/{es → dist/es}/validators/index.js +0 -0
- package/{es → dist/es}/validators/types.js +0 -0
- package/{es → dist/es}/validators/utils/afm.js +0 -0
- package/{es → dist/es}/validators/utils/file.js +0 -0
- package/{es → dist/es}/validators/utils/iban.js +0 -0
- package/{es → dist/es}/validators/utils/index.js +0 -0
- package/{es → dist/es}/validators/utils/int.js +0 -0
- package/{es → dist/es}/validators/utils/number.js +0 -0
- package/{es → dist/es}/validators/utils/phone.js +0 -0
- package/{es → dist/es}/validators/utils/postal_code.js +0 -0
- package/{es → dist/es}/validators/utils/uuid4.js +0 -0
- package/{es → dist/es}/validators/validators.spec.js +0 -0
- package/{esm → dist/esm}/Field/FieldBase.js +3 -3
- package/{es/Field/FieldContainer.js → dist/esm/Field/FieldBaseContainer.js} +7 -7
- package/{esm → dist/esm}/Field/FieldConditional.js +0 -0
- package/{esm → dist/esm}/Field/index.js +0 -0
- package/{esm → dist/esm}/Field/index.mdx +0 -0
- package/{esm → dist/esm}/Field/types.js +0 -0
- package/{esm → dist/esm}/Field/utils.js +0 -0
- package/{esm → dist/esm}/FieldArray/FieldArray.stories.js +0 -0
- package/{esm → dist/esm}/FieldArray/FieldArray.stories.playwright.json +0 -0
- package/{esm → dist/esm}/FieldArray/__stories__/Default.js +0 -0
- package/{esm → dist/esm}/FieldArray/__stories__/WithExactLength.js +0 -0
- package/{es → dist/esm}/FieldArray/index.js +1 -1
- package/{esm → dist/esm}/FieldObject/index.js +0 -0
- package/{esm → dist/esm}/Fieldset/FieldsetWithContext.js +0 -0
- package/{es → dist/esm}/Fieldset/index.js +2 -5
- package/{esm → dist/esm}/Fieldset/types.js +0 -0
- package/{esm → dist/esm}/Form.stories.js +0 -0
- package/{esm → dist/esm}/Form.stories.playwright.json +0 -0
- package/{esm → dist/esm}/FormBuilder/FormBuilder.js +0 -0
- package/{esm → dist/esm}/FormBuilder/FormBuilder.mdx +0 -0
- package/{esm → dist/esm}/FormBuilder/FormBuilder.stories.js +0 -0
- package/{esm → dist/esm}/FormBuilder/FormBuilder.stories.playwright.json +0 -0
- package/{esm → dist/esm}/FormBuilder/__stories__/Default.js +0 -0
- package/{esm → dist/esm}/FormBuilder/index.js +0 -0
- package/{esm → dist/esm}/FormContext.js +0 -0
- package/{esm → dist/esm}/MultiplicityField/MultiplicityField.mdx +0 -0
- package/{esm → dist/esm}/MultiplicityField/MultiplicityField.stories.js +0 -0
- package/{esm → dist/esm}/MultiplicityField/MultiplicityField.stories.playwright.json +0 -0
- package/{esm → dist/esm}/MultiplicityField/__stories__/Default.js +0 -0
- package/{esm → dist/esm}/MultiplicityField/__stories__/PreviewDisplay.js +0 -0
- package/{esm → dist/esm}/MultiplicityField/__stories__/WithExactLength.js +0 -0
- package/{esm → dist/esm}/MultiplicityField/__stories__/WithMaxLength.js +0 -0
- package/{esm → dist/esm}/MultiplicityField/__stories__/WithMinAndMaxLength.js +0 -0
- package/{esm → dist/esm}/MultiplicityField/__stories__/WithMinLength.js +0 -0
- package/{esm → dist/esm}/MultiplicityField/add-objects.js +0 -0
- package/{es → dist/esm}/MultiplicityField/index.js +1 -1
- package/{esm → dist/esm}/Questions/Questions.js +0 -0
- package/{esm → dist/esm}/Questions/QuestionsContext.js +0 -0
- package/{esm → dist/esm}/Questions/Step/ReviewStep.js +0 -0
- package/{esm → dist/esm}/Questions/Step/Step.js +0 -0
- package/{esm → dist/esm}/Questions/Step/StepArrayReview.js +0 -0
- package/{esm → dist/esm}/Questions/Step/StepContext.js +0 -0
- package/{esm → dist/esm}/Questions/Step/StepDescription.js +0 -0
- package/{esm → dist/esm}/Questions/Step/StepForm.js +0 -0
- package/{esm → dist/esm}/Questions/Step/StepQuote.js +0 -0
- package/{esm → dist/esm}/Questions/Step/StepTitle.js +0 -0
- package/{esm → dist/esm}/Questions/Step/getAddMoreFields.js +0 -0
- package/{esm → dist/esm}/Questions/Step/index.js +0 -0
- package/{esm → dist/esm}/Questions/Step/types.js +0 -0
- package/{esm → dist/esm}/Questions/__snapshots__/index.spec.tsx.snap +0 -0
- package/{esm → dist/esm}/Questions/getNextStep.js +0 -0
- package/{esm → dist/esm}/Questions/index.js +0 -0
- package/{esm → dist/esm}/Questions/index.mdx +0 -0
- package/{esm → dist/esm}/Questions/index.spec.js +0 -0
- package/{esm → dist/esm}/Questions/types.js +0 -0
- package/{esm → dist/esm}/__stories__/AutoCompleteField.js +0 -0
- package/{esm → dist/esm}/__stories__/IntField.js +0 -0
- package/{esm → dist/esm}/create-simple-form.mdx +0 -0
- package/{esm → dist/esm}/index.js +1 -1
- package/{esm → dist/esm}/index.mdx +0 -0
- package/{esm → dist/esm}/inputs/AutoComplete/index.js +0 -0
- package/{esm → dist/esm}/inputs/Checkboxes/Checkboxes.stories.js +0 -0
- package/{esm → dist/esm}/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -0
- package/{esm → dist/esm}/inputs/Checkboxes/__stories__/Default.js +0 -0
- package/{esm → dist/esm}/inputs/Checkboxes/index.js +0 -0
- package/{esm/inputs/Label → dist/esm/inputs/Checkboxes}/index.mdx +0 -0
- package/{esm → dist/esm}/inputs/DateInput/DateInput.stories.js +0 -0
- package/{esm → dist/esm}/inputs/DateInput/DateInput.stories.playwright.json +0 -0
- package/{esm → dist/esm}/inputs/DateInput/__stories__/Default.js +0 -0
- package/{es → dist/esm}/inputs/DateInput/index.js +2 -2
- package/{esm → dist/esm}/inputs/FileInput/FileInput.stories.js +0 -0
- package/{esm → dist/esm}/inputs/FileInput/FileInput.stories.playwright.json +0 -0
- package/{esm → dist/esm}/inputs/FileInput/__stories__/Default.js +0 -0
- package/{esm → dist/esm}/inputs/FileInput/index.js +0 -0
- package/{esm → dist/esm}/inputs/Input/Input.stories.js +0 -0
- package/{esm → dist/esm}/inputs/Input/Input.stories.playwright.json +0 -0
- package/{esm → dist/esm}/inputs/Input/__stories__/AFM.js +0 -0
- package/{esm → dist/esm}/inputs/Input/__stories__/Boolean.js +0 -0
- package/{esm → dist/esm}/inputs/Input/__stories__/Default.js +0 -0
- package/{esm → dist/esm}/inputs/Input/__stories__/IBAN.js +0 -0
- package/{esm → dist/esm}/inputs/Input/__stories__/Integer.js +0 -0
- package/{esm → dist/esm}/inputs/Input/__stories__/MobilePhone.js +0 -0
- package/{esm → dist/esm}/inputs/Input/__stories__/PhoneNumber.js +0 -0
- package/{esm → dist/esm}/inputs/Input/__stories__/PostalCode.js +0 -0
- package/{esm → dist/esm}/inputs/Input/index.js +0 -0
- package/{esm → dist/esm}/inputs/Input/index.mdx +0 -0
- package/{esm → dist/esm}/inputs/Label/Label.stories.js +0 -0
- package/{esm → dist/esm}/inputs/Label/Label.stories.playwright.json +0 -0
- package/{esm → dist/esm}/inputs/Label/__stories__/Default.js +0 -0
- package/{esm → dist/esm}/inputs/Label/index.js +0 -0
- package/{esm/inputs/Radio → dist/esm/inputs/Label}/index.mdx +0 -0
- package/{esm → dist/esm}/inputs/Radio/Radio.stories.js +0 -0
- package/{esm → dist/esm}/inputs/Radio/Radio.stories.playwright.json +0 -0
- package/{esm → dist/esm}/inputs/Radio/__stories__/Default.js +0 -0
- package/{esm → dist/esm}/inputs/Radio/index.js +2 -2
- package/{inputs/Checkboxes → dist/esm/inputs/Radio}/index.mdx +0 -0
- package/{esm → dist/esm}/inputs/Select/Select.stories.js +0 -0
- package/{esm → dist/esm}/inputs/Select/Select.stories.playwright.json +0 -0
- package/{esm → dist/esm}/inputs/Select/__stories__/Default.js +0 -0
- package/{es → dist/esm}/inputs/Select/index.js +2 -2
- package/{esm → dist/esm}/inputs/index.js +0 -0
- package/{esm → dist/esm}/installation.mdx +0 -0
- package/{esm → dist/esm}/internal.js +0 -0
- package/{es → dist/esm}/registry.js +2 -2
- package/{esm → dist/esm}/types.js +0 -0
- package/{esm → dist/esm}/utils.js +0 -0
- package/{esm → dist/esm}/validators/index.js +0 -0
- package/{esm → dist/esm}/validators/types.js +0 -0
- package/{esm → dist/esm}/validators/utils/afm.js +0 -0
- package/{esm → dist/esm}/validators/utils/file.js +0 -0
- package/{esm → dist/esm}/validators/utils/iban.js +0 -0
- package/{esm → dist/esm}/validators/utils/index.js +0 -0
- package/{esm → dist/esm}/validators/utils/int.js +0 -0
- package/{esm → dist/esm}/validators/utils/number.js +0 -0
- package/{esm → dist/esm}/validators/utils/phone.js +0 -0
- package/{esm → dist/esm}/validators/utils/postal_code.js +0 -0
- package/{esm → dist/esm}/validators/utils/uuid4.js +0 -0
- package/{esm → dist/esm}/validators/validators.spec.js +0 -0
- package/{index.d.ts → dist/index.d.ts} +0 -0
- package/{index.js → dist/index.js} +0 -0
- package/{index.mdx → dist/index.mdx} +0 -0
- package/{inputs → dist/inputs}/AutoComplete/index.d.ts +0 -0
- package/{inputs → dist/inputs}/AutoComplete/index.js +0 -0
- package/{inputs → dist/inputs}/Checkboxes/Checkboxes.stories.d.ts +0 -0
- package/{inputs → dist/inputs}/Checkboxes/Checkboxes.stories.js +0 -0
- package/{inputs → dist/inputs}/Checkboxes/Checkboxes.stories.playwright.json +0 -0
- package/{inputs → dist/inputs}/Checkboxes/__stories__/Default.d.ts +0 -0
- package/{inputs → dist/inputs}/Checkboxes/__stories__/Default.js +0 -0
- package/{inputs → dist/inputs}/Checkboxes/index.d.ts +0 -0
- package/{inputs → dist/inputs}/Checkboxes/index.js +0 -0
- package/{inputs/Label → dist/inputs/Checkboxes}/index.mdx +0 -0
- package/{inputs → dist/inputs}/DateInput/DateInput.stories.d.ts +0 -0
- package/{inputs → dist/inputs}/DateInput/DateInput.stories.js +0 -0
- package/{inputs → dist/inputs}/DateInput/DateInput.stories.playwright.json +0 -0
- package/{inputs → dist/inputs}/DateInput/__stories__/Default.d.ts +0 -0
- package/{inputs → dist/inputs}/DateInput/__stories__/Default.js +0 -0
- package/{inputs → dist/inputs}/DateInput/index.d.ts +0 -0
- package/{inputs → dist/inputs}/DateInput/index.js +2 -2
- package/{inputs → dist/inputs}/FileInput/FileInput.stories.d.ts +0 -0
- package/{inputs → dist/inputs}/FileInput/FileInput.stories.js +0 -0
- package/{inputs → dist/inputs}/FileInput/FileInput.stories.playwright.json +0 -0
- package/{inputs → dist/inputs}/FileInput/__stories__/Default.d.ts +0 -0
- package/{inputs → dist/inputs}/FileInput/__stories__/Default.js +0 -0
- package/{inputs → dist/inputs}/FileInput/index.d.ts +0 -0
- package/{inputs → dist/inputs}/FileInput/index.js +0 -0
- package/{inputs → dist/inputs}/Input/Input.stories.d.ts +0 -0
- package/{inputs → dist/inputs}/Input/Input.stories.js +0 -0
- package/{inputs → dist/inputs}/Input/Input.stories.playwright.json +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/AFM.d.ts +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/AFM.js +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/Boolean.d.ts +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/Boolean.js +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/Default.d.ts +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/Default.js +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/IBAN.d.ts +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/IBAN.js +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/Integer.d.ts +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/Integer.js +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/MobilePhone.d.ts +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/MobilePhone.js +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/PhoneNumber.d.ts +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/PhoneNumber.js +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/PostalCode.d.ts +0 -0
- package/{inputs → dist/inputs}/Input/__stories__/PostalCode.js +0 -0
- package/{inputs → dist/inputs}/Input/index.d.ts +0 -0
- package/{inputs → dist/inputs}/Input/index.js +0 -0
- package/{inputs → dist/inputs}/Input/index.mdx +0 -0
- package/{inputs → dist/inputs}/Label/Label.stories.d.ts +0 -0
- package/{inputs → dist/inputs}/Label/Label.stories.js +0 -0
- package/{inputs → dist/inputs}/Label/Label.stories.playwright.json +0 -0
- package/{inputs → dist/inputs}/Label/__stories__/Default.d.ts +0 -0
- package/{inputs → dist/inputs}/Label/__stories__/Default.js +0 -0
- package/{inputs → dist/inputs}/Label/index.d.ts +0 -0
- package/{inputs → dist/inputs}/Label/index.js +0 -0
- package/{inputs/Radio → dist/inputs/Label}/index.mdx +0 -0
- package/{inputs → dist/inputs}/Radio/Radio.stories.d.ts +0 -0
- package/{inputs → dist/inputs}/Radio/Radio.stories.js +0 -0
- package/{inputs → dist/inputs}/Radio/Radio.stories.playwright.json +0 -0
- package/{inputs → dist/inputs}/Radio/__stories__/Default.d.ts +0 -0
- package/{inputs → dist/inputs}/Radio/__stories__/Default.js +0 -0
- package/{inputs → dist/inputs}/Radio/index.d.ts +0 -0
- package/{inputs → dist/inputs}/Radio/index.js +2 -2
- package/dist/inputs/Radio/index.mdx +0 -0
- package/{inputs → dist/inputs}/Select/Select.stories.d.ts +0 -0
- package/{inputs → dist/inputs}/Select/Select.stories.js +0 -0
- package/{inputs → dist/inputs}/Select/Select.stories.playwright.json +0 -0
- package/{inputs → dist/inputs}/Select/__stories__/Default.d.ts +0 -0
- package/{inputs → dist/inputs}/Select/__stories__/Default.js +0 -0
- package/{inputs → dist/inputs}/Select/index.d.ts +0 -0
- package/{inputs → dist/inputs}/Select/index.js +2 -2
- package/{inputs → dist/inputs}/index.d.ts +0 -0
- package/{inputs → dist/inputs}/index.js +0 -0
- package/{installation.mdx → dist/installation.mdx} +0 -0
- package/{internal.d.ts → dist/internal.d.ts} +0 -0
- package/{internal.js → dist/internal.js} +0 -0
- package/dist/package.json +31 -0
- package/{registry.d.ts → dist/registry.d.ts} +1 -1
- package/{registry.js → dist/registry.js} +3 -3
- package/{types.d.ts → dist/types.d.ts} +0 -0
- package/{types.js → dist/types.js} +0 -0
- package/{utils.d.ts → dist/utils.d.ts} +0 -0
- package/{utils.js → dist/utils.js} +0 -0
- package/{validators → dist/validators}/index.d.ts +0 -0
- package/{validators → dist/validators}/index.js +0 -0
- package/{validators → dist/validators}/types.d.ts +0 -0
- package/{validators → dist/validators}/types.js +0 -0
- package/{validators → dist/validators}/utils/afm.d.ts +0 -0
- package/{validators → dist/validators}/utils/afm.js +0 -0
- package/{validators → dist/validators}/utils/file.d.ts +0 -0
- package/{validators → dist/validators}/utils/file.js +0 -0
- package/{validators → dist/validators}/utils/iban.d.ts +0 -0
- package/{validators → dist/validators}/utils/iban.js +0 -0
- package/{validators → dist/validators}/utils/index.d.ts +0 -0
- package/{validators → dist/validators}/utils/index.js +0 -0
- package/{validators → dist/validators}/utils/int.d.ts +0 -0
- package/{validators → dist/validators}/utils/int.js +0 -0
- package/{validators → dist/validators}/utils/number.d.ts +0 -0
- package/{validators → dist/validators}/utils/number.js +0 -0
- package/{validators → dist/validators}/utils/phone.d.ts +0 -0
- package/{validators → dist/validators}/utils/phone.js +0 -0
- package/{validators → dist/validators}/utils/postal_code.d.ts +0 -0
- package/{validators → dist/validators}/utils/postal_code.js +0 -0
- package/{validators → dist/validators}/utils/uuid4.d.ts +0 -0
- package/{validators → dist/validators}/utils/uuid4.js +0 -0
- package/{validators → dist/validators}/validators.spec.d.ts +0 -0
- package/{validators → dist/validators}/validators.spec.js +0 -0
- package/docs/index.mdx +6 -0
- package/form.build.log +16 -0
- package/package.json +31 -10
- package/src/Field/FieldBase.tsx +99 -0
- package/src/Field/FieldBaseContainer.tsx +57 -0
- package/src/Field/FieldConditional.tsx +75 -0
- package/src/Field/index.mdx +6 -0
- package/src/Field/index.tsx +92 -0
- package/src/Field/types.tsx +102 -0
- package/src/Field/utils.ts +164 -0
- package/src/FieldArray/FieldArray.stories.js +7 -0
- package/src/FieldArray/FieldArray.stories.playwright.json +353 -0
- package/src/FieldArray/__stories__/Default.tsx +95 -0
- package/src/FieldArray/__stories__/WithExactLength.tsx +95 -0
- package/src/FieldArray/index.tsx +83 -0
- package/src/FieldObject/index.tsx +92 -0
- package/src/Fieldset/FieldsetWithContext.tsx +41 -0
- package/src/Fieldset/index.tsx +40 -0
- package/src/Fieldset/types.tsx +6 -0
- package/src/Form.stories.js +5 -0
- package/src/Form.stories.playwright.json +143 -0
- package/src/FormBuilder/FormBuilder.mdx +271 -0
- package/src/FormBuilder/FormBuilder.stories.js +6 -0
- package/src/FormBuilder/FormBuilder.stories.playwright.json +52 -0
- package/src/FormBuilder/FormBuilder.tsx +165 -0
- package/src/FormBuilder/__stories__/Default.tsx +23 -0
- package/src/FormBuilder/index.tsx +3 -0
- package/src/FormContext.tsx +8 -0
- package/src/MultiplicityField/MultiplicityField.mdx +580 -0
- package/src/MultiplicityField/MultiplicityField.stories.js +11 -0
- package/src/MultiplicityField/MultiplicityField.stories.playwright.json +1370 -0
- package/src/MultiplicityField/__stories__/Default.tsx +100 -0
- package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +160 -0
- package/src/MultiplicityField/__stories__/WithExactLength.tsx +99 -0
- package/src/MultiplicityField/__stories__/WithMaxLength.tsx +102 -0
- package/src/MultiplicityField/__stories__/WithMinAndMaxLength.tsx +103 -0
- package/src/MultiplicityField/__stories__/WithMinLength.tsx +102 -0
- package/src/MultiplicityField/add-objects.tsx +186 -0
- package/src/MultiplicityField/index.tsx +166 -0
- package/src/Questions/Questions.tsx +74 -0
- package/src/Questions/QuestionsContext.tsx +9 -0
- package/src/Questions/Step/ReviewStep.tsx +63 -0
- package/src/Questions/Step/Step.tsx +67 -0
- package/src/Questions/Step/StepArrayReview.tsx +68 -0
- package/src/Questions/Step/StepContext.tsx +21 -0
- package/src/Questions/Step/StepDescription.tsx +33 -0
- package/src/Questions/Step/StepForm.tsx +60 -0
- package/src/Questions/Step/StepQuote.tsx +8 -0
- package/src/Questions/Step/StepTitle.tsx +60 -0
- package/src/Questions/Step/getAddMoreFields.tsx +28 -0
- package/src/Questions/Step/index.ts +13 -0
- package/src/Questions/Step/types.tsx +32 -0
- package/src/Questions/__snapshots__/index.spec.tsx.snap +887 -0
- package/src/Questions/getNextStep.tsx +24 -0
- package/src/Questions/index.mdx +13 -0
- package/src/Questions/index.spec.tsx +72 -0
- package/src/Questions/index.tsx +5 -0
- package/src/Questions/types.tsx +25 -0
- package/src/__stories__/AutoCompleteField.tsx +45 -0
- package/src/__stories__/IntField.tsx +38 -0
- package/src/create-simple-form.mdx +518 -0
- package/src/index.mdx +44 -0
- package/src/index.ts +3 -0
- package/src/inputs/AutoComplete/index.tsx +85 -0
- package/src/inputs/Checkboxes/Checkboxes.stories.js +6 -0
- package/src/inputs/Checkboxes/Checkboxes.stories.playwright.json +69 -0
- package/src/inputs/Checkboxes/__stories__/Default.tsx +39 -0
- package/src/inputs/Checkboxes/index.mdx +0 -0
- package/src/inputs/Checkboxes/index.tsx +77 -0
- package/src/inputs/DateInput/DateInput.stories.js +6 -0
- package/src/inputs/DateInput/DateInput.stories.playwright.json +72 -0
- package/src/inputs/DateInput/__stories__/Default.tsx +41 -0
- package/src/inputs/DateInput/index.tsx +130 -0
- package/src/inputs/FileInput/FileInput.stories.js +6 -0
- package/src/inputs/FileInput/FileInput.stories.playwright.json +75 -0
- package/src/inputs/FileInput/__stories__/Default.tsx +23 -0
- package/src/inputs/FileInput/index.tsx +76 -0
- package/src/inputs/Input/Input.stories.js +13 -0
- package/src/inputs/Input/Input.stories.playwright.json +376 -0
- package/src/inputs/Input/__stories__/AFM.tsx +24 -0
- package/src/inputs/Input/__stories__/Boolean.tsx +26 -0
- package/src/inputs/Input/__stories__/Default.tsx +25 -0
- package/src/inputs/Input/__stories__/IBAN.tsx +26 -0
- package/src/inputs/Input/__stories__/Integer.tsx +25 -0
- package/src/inputs/Input/__stories__/MobilePhone.tsx +24 -0
- package/src/inputs/Input/__stories__/PhoneNumber.tsx +24 -0
- package/src/inputs/Input/__stories__/PostalCode.tsx +25 -0
- package/src/inputs/Input/index.mdx +8 -0
- package/src/inputs/Input/index.tsx +62 -0
- package/src/inputs/Label/Label.stories.js +6 -0
- package/src/inputs/Label/Label.stories.playwright.json +40 -0
- package/src/inputs/Label/__stories__/Default.tsx +28 -0
- package/src/inputs/Label/index.mdx +0 -0
- package/src/inputs/Label/index.tsx +44 -0
- package/src/inputs/Radio/Radio.stories.js +6 -0
- package/src/inputs/Radio/Radio.stories.playwright.json +57 -0
- package/src/inputs/Radio/__stories__/Default.tsx +42 -0
- package/src/inputs/Radio/index.mdx +0 -0
- package/src/inputs/Radio/index.tsx +57 -0
- package/src/inputs/Select/Select.stories.js +6 -0
- package/src/inputs/Select/Select.stories.playwright.json +22 -0
- package/src/inputs/Select/__stories__/Default.tsx +47 -0
- package/src/inputs/Select/index.tsx +37 -0
- package/src/inputs/index.ts +7 -0
- package/src/installation.mdx +72 -0
- package/src/internal.ts +34 -0
- package/src/registry.js +134 -0
- package/src/types.tsx +110 -0
- package/src/utils.ts +78 -0
- package/src/validators/index.ts +203 -0
- package/src/validators/types.ts +2 -0
- package/src/validators/utils/afm.ts +37 -0
- package/src/validators/utils/file.ts +25 -0
- package/src/validators/utils/iban.ts +119 -0
- package/src/validators/utils/index.ts +94 -0
- package/src/validators/utils/int.ts +22 -0
- package/src/validators/utils/number.ts +18 -0
- package/src/validators/utils/phone.ts +120 -0
- package/src/validators/utils/postal_code.ts +33 -0
- package/src/validators/utils/uuid4.ts +21 -0
- package/src/validators/validators.spec.ts +122 -0
- package/tsconfig.json +14 -0
- package/tsconfig.production.json +49 -0
- package/Field/FieldContainer.d.ts +0 -4
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "4",
|
|
3
|
+
"stories": {
|
|
4
|
+
"digigov-form-fieldarray--default": {
|
|
5
|
+
"actionSets": [
|
|
6
|
+
{
|
|
7
|
+
"actions": [
|
|
8
|
+
{
|
|
9
|
+
"name": "click",
|
|
10
|
+
"args": {
|
|
11
|
+
"selector": "text=Προσθήκη συνυπογράφοντα"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "click",
|
|
16
|
+
"args": {
|
|
17
|
+
"selector": "text=Συνέχεια"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "waitForSelector",
|
|
22
|
+
"args": {
|
|
23
|
+
"selector": "text=Το πεδίο πρέπει να έχει τουλάχιστον 2 εγγραφές. Προσθέστε μια ακόμα επιλέγοντας την απάντηση «Ναι» στην επόμενη ερώτηση.",
|
|
24
|
+
"options": {
|
|
25
|
+
"state": "visible"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "click",
|
|
31
|
+
"args": {
|
|
32
|
+
"selector": "text=Προσθήκη συνυπογράφοντα",
|
|
33
|
+
"options": {
|
|
34
|
+
"clickCount": 2
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "click",
|
|
40
|
+
"args": {
|
|
41
|
+
"selector": "text=Συνέχεια"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "waitForSelector",
|
|
46
|
+
"args": {
|
|
47
|
+
"selector": "text=Το πεδίο είναι υποχρεωτικό.",
|
|
48
|
+
"options": {
|
|
49
|
+
"state": "visible"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "type",
|
|
55
|
+
"args": {
|
|
56
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(3)>label>input",
|
|
57
|
+
"text": "2107474274"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"name": "click",
|
|
62
|
+
"args": {
|
|
63
|
+
"selector": "html>body>div:nth-child(5)>form>button"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"id": "iMmV-vvS4iNn",
|
|
68
|
+
"title": "Add new items to FieldArray"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"actions": [
|
|
72
|
+
{
|
|
73
|
+
"name": "click",
|
|
74
|
+
"args": {
|
|
75
|
+
"selector": "html>body>div:nth-child(5)>form>button"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"id": "Lhj8o_MByws7",
|
|
80
|
+
"title": "Validation errors"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"actions": [
|
|
84
|
+
{
|
|
85
|
+
"name": "type",
|
|
86
|
+
"args": {
|
|
87
|
+
"selector": "html>body",
|
|
88
|
+
"text": "hello"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "click",
|
|
93
|
+
"args": {
|
|
94
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "type",
|
|
99
|
+
"args": {
|
|
100
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(1)>label>input",
|
|
101
|
+
"text": "150000496"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "type",
|
|
106
|
+
"args": {
|
|
107
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(2)>label>input",
|
|
108
|
+
"text": "Jon"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "type",
|
|
113
|
+
"args": {
|
|
114
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(3)>label>input",
|
|
115
|
+
"text": "Doe"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "click",
|
|
120
|
+
"args": {
|
|
121
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "type",
|
|
126
|
+
"args": {
|
|
127
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(1)>label>input",
|
|
128
|
+
"text": "150000496"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "type",
|
|
133
|
+
"args": {
|
|
134
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(2)>label>input",
|
|
135
|
+
"text": "Mar"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "type",
|
|
140
|
+
"args": {
|
|
141
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(3)>label>input",
|
|
142
|
+
"text": "P"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "type",
|
|
147
|
+
"args": {
|
|
148
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(3)>label>input",
|
|
149
|
+
"text": "6977777777"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "click",
|
|
154
|
+
"args": {
|
|
155
|
+
"selector": "html>body>div:nth-child(5)>form>button"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
"id": "OCWrR7oFA3YV",
|
|
160
|
+
"title": "add 2 items"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"actions": [
|
|
164
|
+
{
|
|
165
|
+
"name": "type",
|
|
166
|
+
"args": {
|
|
167
|
+
"selector": "html>body",
|
|
168
|
+
"text": "hello"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "click",
|
|
173
|
+
"args": {
|
|
174
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "type",
|
|
179
|
+
"args": {
|
|
180
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(1)>label>input",
|
|
181
|
+
"text": "150000496"
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "type",
|
|
186
|
+
"args": {
|
|
187
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(2)>label>input",
|
|
188
|
+
"text": "Jon"
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"name": "type",
|
|
193
|
+
"args": {
|
|
194
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(3)>label>input",
|
|
195
|
+
"text": "Doe"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "click",
|
|
200
|
+
"args": {
|
|
201
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"name": "type",
|
|
206
|
+
"args": {
|
|
207
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(1)>label>input",
|
|
208
|
+
"text": "150000496"
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"name": "type",
|
|
213
|
+
"args": {
|
|
214
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(2)>label>input",
|
|
215
|
+
"text": "Mar"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "type",
|
|
220
|
+
"args": {
|
|
221
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(3)>label>input",
|
|
222
|
+
"text": "P"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"name": "click",
|
|
227
|
+
"args": {
|
|
228
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(3)>div>fieldset>button"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"name": "type",
|
|
233
|
+
"args": {
|
|
234
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(3)>label>input",
|
|
235
|
+
"text": "6977777777"
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"name": "click",
|
|
240
|
+
"args": {
|
|
241
|
+
"selector": "html>body>div:nth-child(5)>form>button"
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
],
|
|
245
|
+
"id": "8ZxUUjo0Yxnr",
|
|
246
|
+
"title": "add 2 items and remove 1"
|
|
247
|
+
}
|
|
248
|
+
]
|
|
249
|
+
},
|
|
250
|
+
"digigov-form-fieldarray--with-exact-length": {
|
|
251
|
+
"actionSets": [
|
|
252
|
+
{
|
|
253
|
+
"actions": [
|
|
254
|
+
{
|
|
255
|
+
"name": "click",
|
|
256
|
+
"args": {
|
|
257
|
+
"selector": "html>body>div:nth-child(5)>form>button"
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"name": "click",
|
|
262
|
+
"args": {
|
|
263
|
+
"selector": "html>body>div:nth-child(5)>form>button"
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
"id": "WG3dAbfXa-Sn",
|
|
268
|
+
"title": "validation errors"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"actions": [
|
|
272
|
+
{
|
|
273
|
+
"name": "type",
|
|
274
|
+
"args": {
|
|
275
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(1)>label>input",
|
|
276
|
+
"text": "Hello"
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"name": "click",
|
|
281
|
+
"args": {
|
|
282
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"name": "type",
|
|
287
|
+
"args": {
|
|
288
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(1)>label>input",
|
|
289
|
+
"text": "150000496"
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"name": "type",
|
|
294
|
+
"args": {
|
|
295
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(2)>label>input",
|
|
296
|
+
"text": "Μάρω"
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"name": "type",
|
|
301
|
+
"args": {
|
|
302
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div>div>fieldset>fieldset>div:nth-child(3)>label>input",
|
|
303
|
+
"text": "Μενεξέ"
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"name": "click",
|
|
308
|
+
"args": {
|
|
309
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>button"
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"name": "type",
|
|
314
|
+
"args": {
|
|
315
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(1)>label>input",
|
|
316
|
+
"text": "150000496"
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"name": "type",
|
|
321
|
+
"args": {
|
|
322
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(2)>label>input",
|
|
323
|
+
"text": "Ηλέκτρα"
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"name": "type",
|
|
328
|
+
"args": {
|
|
329
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(2)>fieldset>div:nth-child(4)>div>fieldset>fieldset>div:nth-child(3)>label>input",
|
|
330
|
+
"text": "Αποστόλου"
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"name": "type",
|
|
335
|
+
"args": {
|
|
336
|
+
"selector": "html>body>div:nth-child(5)>form>div:nth-child(3)>label>input",
|
|
337
|
+
"text": "6977654321"
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"name": "click",
|
|
342
|
+
"args": {
|
|
343
|
+
"selector": "html>body>div:nth-child(5)>form>button"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
],
|
|
347
|
+
"id": "-U0EryxXC-g7",
|
|
348
|
+
"title": "add exact length of items"
|
|
349
|
+
}
|
|
350
|
+
]
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import FormBuilder, { Field, FieldSpec } from '@digigov/form';
|
|
3
|
+
import { Button } from '@digigov/ui/core';
|
|
4
|
+
|
|
5
|
+
const fields = [
|
|
6
|
+
{
|
|
7
|
+
key: 'string',
|
|
8
|
+
type: 'string',
|
|
9
|
+
label: {
|
|
10
|
+
primary: 'Πεδίο κειμένου',
|
|
11
|
+
secondary:
|
|
12
|
+
'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
key: 'multiplicity',
|
|
17
|
+
type: 'array',
|
|
18
|
+
label: {
|
|
19
|
+
primary: 'Συνυπογράφοντες',
|
|
20
|
+
secondary: 'Οι συνυπογράφοντες είναι άνθρωποι σαν και εμάς',
|
|
21
|
+
},
|
|
22
|
+
extra: {
|
|
23
|
+
label: {
|
|
24
|
+
object: {
|
|
25
|
+
title: 'Συνυπογράφοντας',
|
|
26
|
+
add: 'Προσθήκη συνυπογράφοντα',
|
|
27
|
+
delete: 'Αφαίρεση συνυπογράφοντος',
|
|
28
|
+
},
|
|
29
|
+
question: {
|
|
30
|
+
title: 'Θέλετε να προσθέσετε επιπλέον συνυπογράφοντες;',
|
|
31
|
+
objectLabel: {
|
|
32
|
+
primary: 'Προσθήκη νέου συνυπογράφοντα',
|
|
33
|
+
secondary: 'Συμπληρώστε τα στοιχεία και μετά πατήστε «Προσθήκη»',
|
|
34
|
+
},
|
|
35
|
+
yes: 'Ναι',
|
|
36
|
+
no: 'Όχι',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
min: 2,
|
|
40
|
+
max: 4,
|
|
41
|
+
of: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
extra: {
|
|
44
|
+
fields: [
|
|
45
|
+
{
|
|
46
|
+
key: 'afm',
|
|
47
|
+
type: 'afm',
|
|
48
|
+
required: true,
|
|
49
|
+
label: { primary: 'ΑΦΜ' },
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: 'firstName',
|
|
53
|
+
required: true,
|
|
54
|
+
type: 'string',
|
|
55
|
+
label: {
|
|
56
|
+
primary: 'Όνομα',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
key: 'lastName',
|
|
61
|
+
required: true,
|
|
62
|
+
type: 'string',
|
|
63
|
+
label: {
|
|
64
|
+
primary: 'Επώνυμο',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: 'phonenumber',
|
|
74
|
+
type: 'phone_number',
|
|
75
|
+
required: true,
|
|
76
|
+
label: {
|
|
77
|
+
primary: 'Σταθερό τηλέφωνο',
|
|
78
|
+
secondary: 'Συμπληρώστε τον αριθμό τηλεφώνου',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
] as FieldSpec[];
|
|
82
|
+
|
|
83
|
+
export const Default = () => (
|
|
84
|
+
<FormBuilder
|
|
85
|
+
onSubmit={(data) => {
|
|
86
|
+
debugger;
|
|
87
|
+
console.log(data);
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
<Field name="string" {...fields[0]} />
|
|
91
|
+
<Field name="multiplicity" {...fields[1]} />
|
|
92
|
+
<Field name="phonenumber" {...fields[2]} />
|
|
93
|
+
<Button>Συνέχεια</Button>
|
|
94
|
+
</FormBuilder>
|
|
95
|
+
);
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import FormBuilder, { Field, FieldSpec } from '@digigov/form';
|
|
3
|
+
import { Button } from '@digigov/ui/core';
|
|
4
|
+
|
|
5
|
+
const fields = [
|
|
6
|
+
{
|
|
7
|
+
key: 'string',
|
|
8
|
+
type: 'string',
|
|
9
|
+
label: {
|
|
10
|
+
primary: 'Πεδίο κειμένου',
|
|
11
|
+
secondary:
|
|
12
|
+
'Το multiplicity field είναι ένα πεδίο οπότε φαίνεται και είναι μέρος της φόρμας',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
key: 'multiplicity',
|
|
17
|
+
type: 'array',
|
|
18
|
+
label: {
|
|
19
|
+
primary: 'Συνυπογράφοντες',
|
|
20
|
+
secondary: 'Οι συνυπογράφοντες είναι άνθρωποι σαν και εμάς',
|
|
21
|
+
},
|
|
22
|
+
extra: {
|
|
23
|
+
label: {
|
|
24
|
+
object: {
|
|
25
|
+
title: 'Συνυπογράφοντας',
|
|
26
|
+
title_added: 'Οι συνυπογράφοντες που έχετε προσθέσει',
|
|
27
|
+
add: 'Προσθήκη',
|
|
28
|
+
delete: 'Αφαίρεση συνυπογράφοντος',
|
|
29
|
+
},
|
|
30
|
+
question: {
|
|
31
|
+
title: 'Θέλετε να προσθέσετε επιπλέον συνυπογράφοντες;',
|
|
32
|
+
objectLabel: {
|
|
33
|
+
primary: 'Προσθήκη νέου συνυπογράφοντα',
|
|
34
|
+
secondary: 'Συμπληρώστε τα στοιχεία και μετά πατήστε «Προσθήκη»',
|
|
35
|
+
},
|
|
36
|
+
yes: 'Ναι',
|
|
37
|
+
no: 'Όχι',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
length: 2,
|
|
41
|
+
of: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
extra: {
|
|
44
|
+
fields: [
|
|
45
|
+
{
|
|
46
|
+
key: 'afm',
|
|
47
|
+
type: 'afm',
|
|
48
|
+
required: true,
|
|
49
|
+
label: { primary: 'ΑΦΜ' },
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: 'firstName',
|
|
53
|
+
required: true,
|
|
54
|
+
type: 'string',
|
|
55
|
+
label: {
|
|
56
|
+
primary: 'Όνομα',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
key: 'lastName',
|
|
61
|
+
required: true,
|
|
62
|
+
type: 'string',
|
|
63
|
+
label: {
|
|
64
|
+
primary: 'Επώνυμο',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: 'phonenumber',
|
|
74
|
+
type: 'phone_number',
|
|
75
|
+
required: true,
|
|
76
|
+
label: {
|
|
77
|
+
primary: 'Σταθερό τηλέφωνο',
|
|
78
|
+
secondary: 'Συμπληρώστε τον αριθμό τηλεφώνου σας',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
] as FieldSpec[];
|
|
82
|
+
|
|
83
|
+
export const WithExactLength = () => (
|
|
84
|
+
<FormBuilder
|
|
85
|
+
onSubmit={(data) => {
|
|
86
|
+
debugger;
|
|
87
|
+
console.log(data);
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
<Field name="string" {...fields[0]} />
|
|
91
|
+
<Field name="multiplicity" {...fields[1]} />
|
|
92
|
+
<Field name="phonenumber" {...fields[2]} />
|
|
93
|
+
<Button>Συνέχεια</Button>
|
|
94
|
+
</FormBuilder>
|
|
95
|
+
);
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ErrorOption, useFieldArray, UseFormReturn } from 'react-hook-form';
|
|
3
|
+
import FieldObject from '@digigov/form/FieldObject';
|
|
4
|
+
import { Button, Card, Hint } from '@digigov/ui';
|
|
5
|
+
import { FieldsetLabel } from '@digigov/form/Fieldset';
|
|
6
|
+
import Fieldset from '@digigov/react-core/Fieldset';
|
|
7
|
+
import { FieldProps } from '@digigov/form/Field/types';
|
|
8
|
+
import FieldContainer from '@digigov/form/Field/FieldBaseContainer';
|
|
9
|
+
export interface FieldArrayProps extends FieldProps {
|
|
10
|
+
control: UseFormReturn['control'];
|
|
11
|
+
register: UseFormReturn['register'];
|
|
12
|
+
formState: UseFormReturn['formState'];
|
|
13
|
+
error?: ErrorOption;
|
|
14
|
+
}
|
|
15
|
+
export const FieldArray: React.FC<FieldArrayProps> = ({
|
|
16
|
+
name,
|
|
17
|
+
register,
|
|
18
|
+
control,
|
|
19
|
+
formState,
|
|
20
|
+
error,
|
|
21
|
+
layout,
|
|
22
|
+
label,
|
|
23
|
+
...customField
|
|
24
|
+
}) => {
|
|
25
|
+
const { fields, append, remove } = useFieldArray({
|
|
26
|
+
control,
|
|
27
|
+
name,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<FieldContainer
|
|
32
|
+
label={label}
|
|
33
|
+
layout={layout}
|
|
34
|
+
error={
|
|
35
|
+
formState.isSubmitted &&
|
|
36
|
+
!formState.isSubmitting &&
|
|
37
|
+
error?.message &&
|
|
38
|
+
error
|
|
39
|
+
? error
|
|
40
|
+
: undefined
|
|
41
|
+
}
|
|
42
|
+
wrapper="fieldset"
|
|
43
|
+
name={name}
|
|
44
|
+
>
|
|
45
|
+
{fields.length === 0 && (
|
|
46
|
+
<Hint>{customField.extra?.label.object?.nothing_added}</Hint>
|
|
47
|
+
)}
|
|
48
|
+
{fields.map((field, index) => (
|
|
49
|
+
<Card variant="border" key={field.id}>
|
|
50
|
+
<Fieldset>
|
|
51
|
+
<FieldsetLabel>
|
|
52
|
+
{customField.extra?.label.object.title} {index + 1}
|
|
53
|
+
</FieldsetLabel>
|
|
54
|
+
<FieldObject
|
|
55
|
+
name={`${name}.${index}`}
|
|
56
|
+
error={Array.isArray(error) && error[index]}
|
|
57
|
+
formState={formState}
|
|
58
|
+
register={register}
|
|
59
|
+
control={control}
|
|
60
|
+
{...customField.extra?.of}
|
|
61
|
+
/>
|
|
62
|
+
<Button type="button" color="warning" onClick={() => remove(index)}>
|
|
63
|
+
Remove
|
|
64
|
+
</Button>
|
|
65
|
+
</Fieldset>
|
|
66
|
+
</Card>
|
|
67
|
+
))}
|
|
68
|
+
|
|
69
|
+
<Button
|
|
70
|
+
type="button"
|
|
71
|
+
color="secondary"
|
|
72
|
+
onClick={(ev) => {
|
|
73
|
+
ev.preventDefault();
|
|
74
|
+
append({});
|
|
75
|
+
}}
|
|
76
|
+
>
|
|
77
|
+
{customField.extra?.label.object?.add}
|
|
78
|
+
</Button>
|
|
79
|
+
</FieldContainer>
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export default FieldArray;
|