@digigov/form 0.10.7 → 0.10.8
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 +8 -1
- package/{dist/Field → Field}/FieldBase.d.ts +0 -0
- package/{dist/Field → Field}/FieldBase.js +0 -0
- package/{dist/Field → Field}/FieldBaseContainer.d.ts +0 -0
- package/{dist/Field → Field}/FieldBaseContainer.js +0 -0
- package/{dist/Field → Field}/FieldConditional.d.ts +0 -0
- package/{dist/Field → Field}/FieldConditional.js +0 -0
- package/{dist/Field → Field}/index.d.ts +0 -0
- package/{dist/Field → Field}/index.js +0 -0
- package/{dist/Field → Field}/index.mdx +0 -0
- package/{dist/Field → Field}/types.d.ts +0 -0
- package/{dist/Field → Field}/types.js +0 -0
- package/{dist/Field → Field}/utils.d.ts +0 -0
- package/{dist/Field → Field}/utils.js +0 -0
- package/{dist/FieldArray → FieldArray}/FieldArray.stories.d.ts +1 -0
- package/{dist/FieldArray → FieldArray}/FieldArray.stories.js +2 -1
- package/{dist/FieldArray → FieldArray}/FieldArray.stories.playwright.json +0 -0
- package/{dist/FieldArray → FieldArray}/__stories__/Default.d.ts +0 -0
- package/{dist/FieldArray → FieldArray}/__stories__/Default.js +0 -0
- package/{dist/FieldArray → FieldArray}/__stories__/WithExactLength.d.ts +0 -0
- package/{dist/FieldArray → FieldArray}/__stories__/WithExactLength.js +0 -0
- package/{dist/FieldArray → FieldArray}/index.d.ts +0 -0
- package/{dist/FieldArray → FieldArray}/index.js +0 -0
- package/{dist/FieldObject → FieldObject}/index.d.ts +0 -0
- package/{dist/FieldObject → FieldObject}/index.js +0 -0
- package/{dist/Fieldset → Fieldset}/FieldsetWithContext.d.ts +0 -0
- package/{dist/Fieldset → Fieldset}/FieldsetWithContext.js +0 -0
- package/{dist/Fieldset → Fieldset}/index.d.ts +0 -0
- package/{dist/Fieldset → Fieldset}/index.js +0 -0
- package/{dist/Fieldset → Fieldset}/types.d.ts +0 -0
- package/{dist/Fieldset → Fieldset}/types.js +0 -0
- package/{dist/Form.stories.d.ts → Form.stories.d.ts} +0 -0
- package/{dist/Form.stories.js → Form.stories.js} +0 -0
- package/{dist/Form.stories.playwright.json → Form.stories.playwright.json} +0 -0
- package/{dist/FormBuilder → FormBuilder}/FormBuilder.d.ts +0 -0
- package/{dist/FormBuilder → FormBuilder}/FormBuilder.js +0 -0
- package/{dist/FormBuilder → FormBuilder}/FormBuilder.mdx +0 -0
- package/{dist/FormBuilder → FormBuilder}/FormBuilder.stories.d.ts +1 -0
- package/{dist/FormBuilder → FormBuilder}/FormBuilder.stories.js +2 -1
- package/{dist/FormBuilder → FormBuilder}/FormBuilder.stories.playwright.json +0 -0
- package/{dist/FormBuilder → FormBuilder}/__stories__/Default.d.ts +0 -0
- package/{dist/FormBuilder → FormBuilder}/__stories__/Default.js +0 -0
- package/{dist/FormBuilder → FormBuilder}/index.d.ts +0 -0
- package/{dist/FormBuilder → FormBuilder}/index.js +0 -0
- package/{dist/FormContext.d.ts → FormContext.d.ts} +0 -0
- package/{dist/FormContext.js → FormContext.js} +0 -0
- package/{dist/LICENSE → LICENSE} +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/MultiplicityField.mdx +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/MultiplicityField.stories.d.ts +1 -0
- package/{dist/MultiplicityField → MultiplicityField}/MultiplicityField.stories.js +2 -1
- package/{dist/MultiplicityField → MultiplicityField}/MultiplicityField.stories.playwright.json +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/__stories__/Default.d.ts +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/__stories__/Default.js +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/__stories__/PreviewDisplay.d.ts +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/__stories__/PreviewDisplay.js +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/__stories__/WithExactLength.d.ts +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/__stories__/WithExactLength.js +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/__stories__/WithMaxLength.d.ts +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/__stories__/WithMaxLength.js +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/__stories__/WithMinAndMaxLength.d.ts +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/__stories__/WithMinAndMaxLength.js +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/__stories__/WithMinLength.d.ts +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/__stories__/WithMinLength.js +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/add-objects.d.ts +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/add-objects.js +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/index.d.ts +0 -0
- package/{dist/MultiplicityField → MultiplicityField}/index.js +0 -0
- package/{dist/Questions → Questions}/Questions.d.ts +0 -0
- package/{dist/Questions → Questions}/Questions.js +0 -0
- package/Questions/Questions.stories.d.ts +8 -0
- package/Questions/Questions.stories.js +31 -0
- package/{dist/Questions → Questions}/QuestionsContext.d.ts +0 -0
- package/{dist/Questions → Questions}/QuestionsContext.js +0 -0
- package/{dist/Questions → Questions}/Step/ReviewStep.d.ts +0 -0
- package/{dist/Questions → Questions}/Step/ReviewStep.js +0 -0
- package/{dist/Questions → Questions}/Step/Step.d.ts +0 -0
- package/{dist/Questions → Questions}/Step/Step.js +0 -0
- package/{dist/Questions → Questions}/Step/StepArrayReview.d.ts +0 -0
- package/{dist/Questions → Questions}/Step/StepArrayReview.js +0 -0
- package/{dist/Questions → Questions}/Step/StepContext.d.ts +0 -0
- package/{dist/Questions → Questions}/Step/StepContext.js +0 -0
- package/{dist/Questions → Questions}/Step/StepDescription.d.ts +0 -0
- package/{dist/Questions → Questions}/Step/StepDescription.js +0 -0
- package/{dist/Questions → Questions}/Step/StepForm.d.ts +0 -0
- package/{dist/Questions → Questions}/Step/StepForm.js +0 -0
- package/{dist/Questions → Questions}/Step/StepQuote.d.ts +0 -0
- package/{dist/Questions → Questions}/Step/StepQuote.js +0 -0
- package/{dist/Questions → Questions}/Step/StepTitle.d.ts +0 -0
- package/{dist/Questions → Questions}/Step/StepTitle.js +0 -0
- package/{dist/Questions → Questions}/Step/getAddMoreFields.d.ts +0 -0
- package/{dist/Questions → Questions}/Step/getAddMoreFields.js +0 -0
- package/{dist/Questions → Questions}/Step/index.d.ts +0 -0
- package/{dist/Questions → Questions}/Step/index.js +0 -0
- package/{dist/Questions → Questions}/Step/types.d.ts +0 -0
- package/{dist/Questions → Questions}/Step/types.js +0 -0
- package/{dist/Questions → Questions}/__snapshots__/index.spec.tsx.snap +0 -0
- package/Questions/__stories__/Default.d.ts +2 -0
- package/Questions/__stories__/Default.js +130 -0
- package/{dist/Questions → Questions}/getNextStep.d.ts +0 -0
- package/{dist/Questions → Questions}/getNextStep.js +0 -0
- package/{dist/Questions → Questions}/index.d.ts +0 -0
- package/{dist/Questions → Questions}/index.js +0 -0
- package/Questions/index.mdx +418 -0
- package/{dist/Questions → Questions}/index.spec.d.ts +0 -0
- package/{dist/Questions → Questions}/index.spec.js +0 -0
- package/{dist/Questions → Questions}/types.d.ts +0 -0
- package/{dist/Questions → Questions}/types.js +0 -0
- package/{dist/__stories__ → __stories__}/AutoCompleteField.d.ts +0 -0
- package/{dist/__stories__ → __stories__}/AutoCompleteField.js +0 -0
- package/{dist/__stories__ → __stories__}/IntField.d.ts +0 -0
- package/{dist/__stories__ → __stories__}/IntField.js +0 -0
- package/{dist/create-simple-form.mdx → create-simple-form.mdx} +0 -0
- package/{dist/es → es}/Field/FieldBase.js +0 -0
- package/{dist/es → es}/Field/FieldBaseContainer.js +0 -0
- package/{dist/es → es}/Field/FieldConditional.js +0 -0
- package/{dist/es → es}/Field/index.js +0 -0
- package/{dist/es → es}/Field/index.mdx +0 -0
- package/{dist/es → es}/Field/types.js +0 -0
- package/{dist/es → es}/Field/utils.js +0 -0
- package/{src → es}/FieldArray/FieldArray.stories.js +2 -1
- package/{dist/es → es}/FieldArray/FieldArray.stories.playwright.json +0 -0
- package/{dist/es → es}/FieldArray/__stories__/Default.js +0 -0
- package/{dist/es → es}/FieldArray/__stories__/WithExactLength.js +0 -0
- package/{dist/es → es}/FieldArray/index.js +0 -0
- package/{dist/es → es}/FieldObject/index.js +0 -0
- package/{dist/es → es}/Fieldset/FieldsetWithContext.js +0 -0
- package/{dist/es → es}/Fieldset/index.js +0 -0
- package/{dist/es → es}/Fieldset/types.js +0 -0
- package/{dist/es → es}/Form.stories.js +0 -0
- package/{dist/es → es}/Form.stories.playwright.json +0 -0
- package/{dist/es → es}/FormBuilder/FormBuilder.js +0 -0
- package/{dist/es → es}/FormBuilder/FormBuilder.mdx +0 -0
- package/{src → es}/FormBuilder/FormBuilder.stories.js +2 -1
- package/{dist/es → es}/FormBuilder/FormBuilder.stories.playwright.json +0 -0
- package/{dist/es → es}/FormBuilder/__stories__/Default.js +0 -0
- package/{dist/es → es}/FormBuilder/index.js +0 -0
- package/{dist/es → es}/FormContext.js +0 -0
- package/{dist/es → es}/MultiplicityField/MultiplicityField.mdx +0 -0
- package/{src → es}/MultiplicityField/MultiplicityField.stories.js +2 -1
- package/{dist/es → es}/MultiplicityField/MultiplicityField.stories.playwright.json +0 -0
- package/{dist/es → es}/MultiplicityField/__stories__/Default.js +0 -0
- package/{dist/es → es}/MultiplicityField/__stories__/PreviewDisplay.js +0 -0
- package/{dist/es → es}/MultiplicityField/__stories__/WithExactLength.js +0 -0
- package/{dist/es → es}/MultiplicityField/__stories__/WithMaxLength.js +0 -0
- package/{dist/es → es}/MultiplicityField/__stories__/WithMinAndMaxLength.js +0 -0
- package/{dist/es → es}/MultiplicityField/__stories__/WithMinLength.js +0 -0
- package/{dist/es → es}/MultiplicityField/add-objects.js +0 -0
- package/{dist/es → es}/MultiplicityField/index.js +0 -0
- package/{dist/es → es}/Questions/Questions.js +0 -0
- package/es/Questions/Questions.stories.js +7 -0
- package/{dist/es → es}/Questions/QuestionsContext.js +0 -0
- package/{dist/es → es}/Questions/Step/ReviewStep.js +0 -0
- package/{dist/es → es}/Questions/Step/Step.js +0 -0
- package/{dist/es → es}/Questions/Step/StepArrayReview.js +0 -0
- package/{dist/es → es}/Questions/Step/StepContext.js +0 -0
- package/{dist/es → es}/Questions/Step/StepDescription.js +0 -0
- package/{dist/es → es}/Questions/Step/StepForm.js +0 -0
- package/{dist/es → es}/Questions/Step/StepQuote.js +0 -0
- package/{dist/es → es}/Questions/Step/StepTitle.js +0 -0
- package/{dist/es → es}/Questions/Step/getAddMoreFields.js +0 -0
- package/{dist/es → es}/Questions/Step/index.js +0 -0
- package/{dist/es → es}/Questions/Step/types.js +0 -0
- package/{dist/es → es}/Questions/__snapshots__/index.spec.tsx.snap +0 -0
- package/es/Questions/__stories__/Default.js +103 -0
- package/{dist/es → es}/Questions/getNextStep.js +0 -0
- package/{dist/es → es}/Questions/index.js +0 -0
- package/es/Questions/index.mdx +418 -0
- package/{dist/es → es}/Questions/index.spec.js +0 -0
- package/{dist/es → es}/Questions/types.js +0 -0
- package/{dist/es → es}/__stories__/AutoCompleteField.js +0 -0
- package/{dist/es → es}/__stories__/IntField.js +0 -0
- package/{dist/es → es}/create-simple-form.mdx +0 -0
- package/{dist/es → es}/index.js +0 -0
- package/{dist/es → es}/index.mdx +0 -0
- package/{dist/es → es}/inputs/AutoComplete/index.js +0 -0
- package/{src → es}/inputs/Checkboxes/Checkboxes.stories.js +2 -1
- package/{dist/es → es}/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -0
- package/{dist/es → es}/inputs/Checkboxes/__stories__/Default.js +0 -0
- package/{dist/es → es}/inputs/Checkboxes/index.js +0 -0
- package/{dist/es → es}/inputs/Checkboxes/index.mdx +0 -0
- package/{src → es}/inputs/DateInput/DateInput.stories.js +2 -1
- package/{dist/es → es}/inputs/DateInput/DateInput.stories.playwright.json +0 -0
- package/{dist/es → es}/inputs/DateInput/__stories__/Default.js +0 -0
- package/{dist/es → es}/inputs/DateInput/index.js +0 -0
- package/{src → es}/inputs/FileInput/FileInput.stories.js +2 -1
- package/{dist/es → es}/inputs/FileInput/FileInput.stories.playwright.json +0 -0
- package/{dist/es → es}/inputs/FileInput/__stories__/Default.js +0 -0
- package/{dist/es → es}/inputs/FileInput/index.js +0 -0
- package/{src → es}/inputs/Input/Input.stories.js +2 -1
- package/{dist/es → es}/inputs/Input/Input.stories.playwright.json +0 -0
- package/{dist/es → es}/inputs/Input/__stories__/AFM.js +0 -0
- package/{dist/es → es}/inputs/Input/__stories__/Boolean.js +0 -0
- package/{dist/es → es}/inputs/Input/__stories__/Default.js +0 -0
- package/{dist/es → es}/inputs/Input/__stories__/IBAN.js +0 -0
- package/{dist/es → es}/inputs/Input/__stories__/Integer.js +0 -0
- package/{dist/es → es}/inputs/Input/__stories__/MobilePhone.js +0 -0
- package/{dist/es → es}/inputs/Input/__stories__/PhoneNumber.js +0 -0
- package/{dist/es → es}/inputs/Input/__stories__/PostalCode.js +0 -0
- package/{dist/es → es}/inputs/Input/index.js +0 -0
- package/{dist/es → es}/inputs/Input/index.mdx +0 -0
- package/{src → es}/inputs/Label/Label.stories.js +2 -1
- package/{dist/es → es}/inputs/Label/Label.stories.playwright.json +0 -0
- package/{dist/es → es}/inputs/Label/__stories__/Default.js +0 -0
- package/{dist/es → es}/inputs/Label/index.js +0 -0
- package/{dist/es → es}/inputs/Label/index.mdx +0 -0
- package/{src → es}/inputs/Radio/Radio.stories.js +2 -1
- package/{dist/es → es}/inputs/Radio/Radio.stories.playwright.json +0 -0
- package/{dist/es → es}/inputs/Radio/__stories__/Default.js +0 -0
- package/{dist/es → es}/inputs/Radio/index.js +0 -0
- package/{dist/es → es}/inputs/Radio/index.mdx +0 -0
- package/{src → es}/inputs/Select/Select.stories.js +2 -1
- package/{dist/es → es}/inputs/Select/Select.stories.playwright.json +0 -0
- package/{dist/es → es}/inputs/Select/__stories__/Default.js +0 -0
- package/{dist/es → es}/inputs/Select/index.js +0 -0
- package/{dist/es → es}/inputs/index.js +0 -0
- package/{dist/es → es}/installation.mdx +0 -0
- package/{dist/es → es}/internal.js +0 -0
- package/{dist/es → es}/registry.js +0 -0
- package/{dist/es → es}/types.js +0 -0
- package/{dist/es → es}/utils.js +0 -0
- package/{dist/es → es}/validators/index.js +0 -0
- package/{dist/es → es}/validators/types.js +0 -0
- package/{dist/es → es}/validators/utils/afm.js +0 -0
- package/{dist/es → es}/validators/utils/file.js +0 -0
- package/{dist/es → es}/validators/utils/iban.js +0 -0
- package/{dist/es → es}/validators/utils/index.js +0 -0
- package/{dist/es → es}/validators/utils/int.js +0 -0
- package/{dist/es → es}/validators/utils/number.js +0 -0
- package/{dist/es → es}/validators/utils/phone.js +0 -0
- package/{dist/es → es}/validators/utils/postal_code.js +0 -0
- package/{dist/es → es}/validators/utils/uuid4.js +0 -0
- package/{dist/es → es}/validators/validators.spec.js +0 -0
- package/{dist/esm → esm}/Field/FieldBase.js +0 -0
- package/{dist/esm → esm}/Field/FieldBaseContainer.js +0 -0
- package/{dist/esm → esm}/Field/FieldConditional.js +0 -0
- package/{dist/esm → esm}/Field/index.js +0 -0
- package/{dist/esm → esm}/Field/index.mdx +0 -0
- package/{dist/esm → esm}/Field/types.js +0 -0
- package/{dist/esm → esm}/Field/utils.js +0 -0
- package/{dist/esm → esm}/FieldArray/FieldArray.stories.js +2 -1
- package/{dist/esm → esm}/FieldArray/FieldArray.stories.playwright.json +0 -0
- package/{dist/esm → esm}/FieldArray/__stories__/Default.js +0 -0
- package/{dist/esm → esm}/FieldArray/__stories__/WithExactLength.js +0 -0
- package/{dist/esm → esm}/FieldArray/index.js +0 -0
- package/{dist/esm → esm}/FieldObject/index.js +0 -0
- package/{dist/esm → esm}/Fieldset/FieldsetWithContext.js +0 -0
- package/{dist/esm → esm}/Fieldset/index.js +0 -0
- package/{dist/esm → esm}/Fieldset/types.js +0 -0
- package/{dist/esm → esm}/Form.stories.js +0 -0
- package/{dist/esm → esm}/Form.stories.playwright.json +0 -0
- package/{dist/esm → esm}/FormBuilder/FormBuilder.js +0 -0
- package/{dist/esm → esm}/FormBuilder/FormBuilder.mdx +0 -0
- package/esm/FormBuilder/FormBuilder.stories.js +7 -0
- package/{dist/esm → esm}/FormBuilder/FormBuilder.stories.playwright.json +0 -0
- package/{dist/esm → esm}/FormBuilder/__stories__/Default.js +0 -0
- package/{dist/esm → esm}/FormBuilder/index.js +0 -0
- package/{dist/esm → esm}/FormContext.js +0 -0
- package/{dist/esm → esm}/MultiplicityField/MultiplicityField.mdx +0 -0
- package/{dist/es → esm}/MultiplicityField/MultiplicityField.stories.js +2 -1
- package/{dist/esm → esm}/MultiplicityField/MultiplicityField.stories.playwright.json +0 -0
- package/{dist/esm → esm}/MultiplicityField/__stories__/Default.js +0 -0
- package/{dist/esm → esm}/MultiplicityField/__stories__/PreviewDisplay.js +0 -0
- package/{dist/esm → esm}/MultiplicityField/__stories__/WithExactLength.js +0 -0
- package/{dist/esm → esm}/MultiplicityField/__stories__/WithMaxLength.js +0 -0
- package/{dist/esm → esm}/MultiplicityField/__stories__/WithMinAndMaxLength.js +0 -0
- package/{dist/esm → esm}/MultiplicityField/__stories__/WithMinLength.js +0 -0
- package/{dist/esm → esm}/MultiplicityField/add-objects.js +0 -0
- package/{dist/esm → esm}/MultiplicityField/index.js +0 -0
- package/{dist/esm → esm}/Questions/Questions.js +0 -0
- package/esm/Questions/Questions.stories.js +7 -0
- package/{dist/esm → esm}/Questions/QuestionsContext.js +0 -0
- package/{dist/esm → esm}/Questions/Step/ReviewStep.js +0 -0
- package/{dist/esm → esm}/Questions/Step/Step.js +0 -0
- package/{dist/esm → esm}/Questions/Step/StepArrayReview.js +0 -0
- package/{dist/esm → esm}/Questions/Step/StepContext.js +0 -0
- package/{dist/esm → esm}/Questions/Step/StepDescription.js +0 -0
- package/{dist/esm → esm}/Questions/Step/StepForm.js +0 -0
- package/{dist/esm → esm}/Questions/Step/StepQuote.js +0 -0
- package/{dist/esm → esm}/Questions/Step/StepTitle.js +0 -0
- package/{dist/esm → esm}/Questions/Step/getAddMoreFields.js +0 -0
- package/{dist/esm → esm}/Questions/Step/index.js +0 -0
- package/{dist/esm → esm}/Questions/Step/types.js +0 -0
- package/{dist/esm → esm}/Questions/__snapshots__/index.spec.tsx.snap +0 -0
- package/esm/Questions/__stories__/Default.js +103 -0
- package/{dist/esm → esm}/Questions/getNextStep.js +0 -0
- package/{dist/esm → esm}/Questions/index.js +0 -0
- package/esm/Questions/index.mdx +418 -0
- package/{dist/esm → esm}/Questions/index.spec.js +0 -0
- package/{dist/esm → esm}/Questions/types.js +0 -0
- package/{dist/esm → esm}/__stories__/AutoCompleteField.js +0 -0
- package/{dist/esm → esm}/__stories__/IntField.js +0 -0
- package/{dist/esm → esm}/create-simple-form.mdx +0 -0
- package/{dist/esm → esm}/index.js +1 -1
- package/{dist/esm → esm}/index.mdx +0 -0
- package/{dist/esm → esm}/inputs/AutoComplete/index.js +0 -0
- package/{dist/es → esm}/inputs/Checkboxes/Checkboxes.stories.js +2 -1
- package/{dist/esm → esm}/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -0
- package/{dist/esm → esm}/inputs/Checkboxes/__stories__/Default.js +0 -0
- package/{dist/esm → esm}/inputs/Checkboxes/index.js +0 -0
- package/{dist/esm → esm}/inputs/Checkboxes/index.mdx +0 -0
- package/{dist/esm → esm}/inputs/DateInput/DateInput.stories.js +2 -1
- package/{dist/esm → esm}/inputs/DateInput/DateInput.stories.playwright.json +0 -0
- package/{dist/esm → esm}/inputs/DateInput/__stories__/Default.js +0 -0
- package/{dist/esm → esm}/inputs/DateInput/index.js +0 -0
- package/{dist/es → esm}/inputs/FileInput/FileInput.stories.js +2 -1
- package/{dist/esm → esm}/inputs/FileInput/FileInput.stories.playwright.json +0 -0
- package/{dist/esm → esm}/inputs/FileInput/__stories__/Default.js +0 -0
- package/{dist/esm → esm}/inputs/FileInput/index.js +0 -0
- package/{dist/es → esm}/inputs/Input/Input.stories.js +2 -1
- package/{dist/esm → esm}/inputs/Input/Input.stories.playwright.json +0 -0
- package/{dist/esm → esm}/inputs/Input/__stories__/AFM.js +0 -0
- package/{dist/esm → esm}/inputs/Input/__stories__/Boolean.js +0 -0
- package/{dist/esm → esm}/inputs/Input/__stories__/Default.js +0 -0
- package/{dist/esm → esm}/inputs/Input/__stories__/IBAN.js +0 -0
- package/{dist/esm → esm}/inputs/Input/__stories__/Integer.js +0 -0
- package/{dist/esm → esm}/inputs/Input/__stories__/MobilePhone.js +0 -0
- package/{dist/esm → esm}/inputs/Input/__stories__/PhoneNumber.js +0 -0
- package/{dist/esm → esm}/inputs/Input/__stories__/PostalCode.js +0 -0
- package/{dist/esm → esm}/inputs/Input/index.js +0 -0
- package/{dist/esm → esm}/inputs/Input/index.mdx +0 -0
- package/{dist/es → esm}/inputs/Label/Label.stories.js +2 -1
- package/{dist/esm → esm}/inputs/Label/Label.stories.playwright.json +0 -0
- package/{dist/esm → esm}/inputs/Label/__stories__/Default.js +0 -0
- package/{dist/esm → esm}/inputs/Label/index.js +0 -0
- package/{dist/esm → esm}/inputs/Label/index.mdx +0 -0
- package/{dist/es → esm}/inputs/Radio/Radio.stories.js +2 -1
- package/{dist/esm → esm}/inputs/Radio/Radio.stories.playwright.json +0 -0
- package/{dist/esm → esm}/inputs/Radio/__stories__/Default.js +0 -0
- package/{dist/esm → esm}/inputs/Radio/index.js +0 -0
- package/{dist/esm → esm}/inputs/Radio/index.mdx +0 -0
- package/{dist/es → esm}/inputs/Select/Select.stories.js +2 -1
- package/{dist/esm → esm}/inputs/Select/Select.stories.playwright.json +0 -0
- package/{dist/esm → esm}/inputs/Select/__stories__/Default.js +0 -0
- package/{dist/esm → esm}/inputs/Select/index.js +0 -0
- package/{dist/esm → esm}/inputs/index.js +0 -0
- package/{dist/esm → esm}/installation.mdx +0 -0
- package/{dist/esm → esm}/internal.js +0 -0
- package/{dist/esm → esm}/registry.js +0 -0
- package/{dist/esm → esm}/types.js +0 -0
- package/{dist/esm → esm}/utils.js +0 -0
- package/{dist/esm → esm}/validators/index.js +0 -0
- package/{dist/esm → esm}/validators/types.js +0 -0
- package/{dist/esm → esm}/validators/utils/afm.js +0 -0
- package/{dist/esm → esm}/validators/utils/file.js +0 -0
- package/{dist/esm → esm}/validators/utils/iban.js +0 -0
- package/{dist/esm → esm}/validators/utils/index.js +0 -0
- package/{dist/esm → esm}/validators/utils/int.js +0 -0
- package/{dist/esm → esm}/validators/utils/number.js +0 -0
- package/{dist/esm → esm}/validators/utils/phone.js +0 -0
- package/{dist/esm → esm}/validators/utils/postal_code.js +0 -0
- package/{dist/esm → esm}/validators/utils/uuid4.js +0 -0
- package/{dist/esm → esm}/validators/validators.spec.js +0 -0
- package/{dist/index.d.ts → index.d.ts} +0 -0
- package/{dist/index.js → index.js} +0 -0
- package/{dist/index.mdx → index.mdx} +0 -0
- package/{dist/inputs → inputs}/AutoComplete/index.d.ts +0 -0
- package/{dist/inputs → inputs}/AutoComplete/index.js +0 -0
- package/{dist/inputs → inputs}/Checkboxes/Checkboxes.stories.d.ts +1 -0
- package/{dist/inputs → inputs}/Checkboxes/Checkboxes.stories.js +2 -1
- package/{dist/inputs → inputs}/Checkboxes/Checkboxes.stories.playwright.json +0 -0
- package/{dist/inputs → inputs}/Checkboxes/__stories__/Default.d.ts +0 -0
- package/{dist/inputs → inputs}/Checkboxes/__stories__/Default.js +0 -0
- package/{dist/inputs → inputs}/Checkboxes/index.d.ts +0 -0
- package/{dist/inputs → inputs}/Checkboxes/index.js +0 -0
- package/{dist/inputs → inputs}/Checkboxes/index.mdx +0 -0
- package/{dist/inputs → inputs}/DateInput/DateInput.stories.d.ts +1 -0
- package/{dist/inputs → inputs}/DateInput/DateInput.stories.js +2 -1
- package/{dist/inputs → inputs}/DateInput/DateInput.stories.playwright.json +0 -0
- package/{dist/inputs → inputs}/DateInput/__stories__/Default.d.ts +0 -0
- package/{dist/inputs → inputs}/DateInput/__stories__/Default.js +0 -0
- package/{dist/inputs → inputs}/DateInput/index.d.ts +0 -0
- package/{dist/inputs → inputs}/DateInput/index.js +0 -0
- package/{dist/inputs → inputs}/FileInput/FileInput.stories.d.ts +1 -0
- package/{dist/inputs → inputs}/FileInput/FileInput.stories.js +2 -1
- package/{dist/inputs → inputs}/FileInput/FileInput.stories.playwright.json +0 -0
- package/{dist/inputs → inputs}/FileInput/__stories__/Default.d.ts +0 -0
- package/{dist/inputs → inputs}/FileInput/__stories__/Default.js +0 -0
- package/{dist/inputs → inputs}/FileInput/index.d.ts +0 -0
- package/{dist/inputs → inputs}/FileInput/index.js +0 -0
- package/{dist/inputs → inputs}/Input/Input.stories.d.ts +1 -0
- package/{dist/inputs → inputs}/Input/Input.stories.js +2 -1
- package/{dist/inputs → inputs}/Input/Input.stories.playwright.json +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/AFM.d.ts +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/AFM.js +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/Boolean.d.ts +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/Boolean.js +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/Default.d.ts +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/Default.js +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/IBAN.d.ts +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/IBAN.js +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/Integer.d.ts +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/Integer.js +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/MobilePhone.d.ts +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/MobilePhone.js +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/PhoneNumber.d.ts +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/PhoneNumber.js +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/PostalCode.d.ts +0 -0
- package/{dist/inputs → inputs}/Input/__stories__/PostalCode.js +0 -0
- package/{dist/inputs → inputs}/Input/index.d.ts +0 -0
- package/{dist/inputs → inputs}/Input/index.js +0 -0
- package/{dist/inputs → inputs}/Input/index.mdx +0 -0
- package/{dist/inputs → inputs}/Label/Label.stories.d.ts +1 -0
- package/{dist/inputs → inputs}/Label/Label.stories.js +2 -1
- package/{dist/inputs → inputs}/Label/Label.stories.playwright.json +0 -0
- package/{dist/inputs → inputs}/Label/__stories__/Default.d.ts +0 -0
- package/{dist/inputs → inputs}/Label/__stories__/Default.js +0 -0
- package/{dist/inputs → inputs}/Label/index.d.ts +0 -0
- package/{dist/inputs → inputs}/Label/index.js +0 -0
- package/{dist/inputs → inputs}/Label/index.mdx +0 -0
- package/{dist/inputs → inputs}/Radio/Radio.stories.d.ts +1 -0
- package/{dist/inputs → inputs}/Radio/Radio.stories.js +2 -1
- package/{dist/inputs → inputs}/Radio/Radio.stories.playwright.json +0 -0
- package/{dist/inputs → inputs}/Radio/__stories__/Default.d.ts +0 -0
- package/{dist/inputs → inputs}/Radio/__stories__/Default.js +0 -0
- package/{dist/inputs → inputs}/Radio/index.d.ts +0 -0
- package/{dist/inputs → inputs}/Radio/index.js +0 -0
- package/{dist/inputs → inputs}/Radio/index.mdx +0 -0
- package/{dist/inputs → inputs}/Select/Select.stories.d.ts +1 -0
- package/{dist/inputs → inputs}/Select/Select.stories.js +2 -1
- package/{dist/inputs → inputs}/Select/Select.stories.playwright.json +0 -0
- package/{dist/inputs → inputs}/Select/__stories__/Default.d.ts +0 -0
- package/{dist/inputs → inputs}/Select/__stories__/Default.js +0 -0
- package/{dist/inputs → inputs}/Select/index.d.ts +0 -0
- package/{dist/inputs → inputs}/Select/index.js +0 -0
- package/{dist/inputs → inputs}/index.d.ts +0 -0
- package/{dist/inputs → inputs}/index.js +0 -0
- package/{dist/installation.mdx → installation.mdx} +0 -0
- package/{dist/internal.d.ts → internal.d.ts} +0 -0
- package/{dist/internal.js → internal.js} +0 -0
- package/package.json +10 -31
- package/{dist/registry.d.ts → registry.d.ts} +0 -0
- package/{dist/registry.js → registry.js} +0 -0
- package/{dist/types.d.ts → types.d.ts} +0 -0
- package/{dist/types.js → types.js} +0 -0
- package/{dist/utils.d.ts → utils.d.ts} +0 -0
- package/{dist/utils.js → utils.js} +0 -0
- package/{dist/validators → validators}/index.d.ts +0 -0
- package/{dist/validators → validators}/index.js +0 -0
- package/{dist/validators → validators}/types.d.ts +0 -0
- package/{dist/validators → validators}/types.js +0 -0
- package/{dist/validators → validators}/utils/afm.d.ts +0 -0
- package/{dist/validators → validators}/utils/afm.js +0 -0
- package/{dist/validators → validators}/utils/file.d.ts +0 -0
- package/{dist/validators → validators}/utils/file.js +0 -0
- package/{dist/validators → validators}/utils/iban.d.ts +0 -0
- package/{dist/validators → validators}/utils/iban.js +0 -0
- package/{dist/validators → validators}/utils/index.d.ts +0 -0
- package/{dist/validators → validators}/utils/index.js +0 -0
- package/{dist/validators → validators}/utils/int.d.ts +0 -0
- package/{dist/validators → validators}/utils/int.js +0 -0
- package/{dist/validators → validators}/utils/number.d.ts +0 -0
- package/{dist/validators → validators}/utils/number.js +0 -0
- package/{dist/validators → validators}/utils/phone.d.ts +0 -0
- package/{dist/validators → validators}/utils/phone.js +0 -0
- package/{dist/validators → validators}/utils/postal_code.d.ts +0 -0
- package/{dist/validators → validators}/utils/postal_code.js +0 -0
- package/{dist/validators → validators}/utils/uuid4.d.ts +0 -0
- package/{dist/validators → validators}/utils/uuid4.js +0 -0
- package/{dist/validators → validators}/validators.spec.d.ts +0 -0
- package/{dist/validators → validators}/validators.spec.js +0 -0
- package/.eslintrc.js +0 -3
- package/.prettierrc.js +0 -3
- package/CHANGELOG.json +0 -1392
- package/coverage/clover.xml +0 -859
- package/coverage/coverage-final.json +0 -51
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -386
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov-report/src/Field/FieldBase.tsx.html +0 -379
- package/coverage/lcov-report/src/Field/FieldConditional.tsx.html +0 -310
- package/coverage/lcov-report/src/Field/FieldContainer.tsx.html +0 -256
- package/coverage/lcov-report/src/Field/index.html +0 -176
- package/coverage/lcov-report/src/Field/index.tsx.html +0 -352
- package/coverage/lcov-report/src/Field/utils.ts.html +0 -559
- package/coverage/lcov-report/src/FieldArray/index.html +0 -116
- package/coverage/lcov-report/src/FieldArray/index.tsx.html +0 -319
- package/coverage/lcov-report/src/FieldObject/index.html +0 -116
- package/coverage/lcov-report/src/FieldObject/index.tsx.html +0 -364
- package/coverage/lcov-report/src/Fieldset/index.html +0 -116
- package/coverage/lcov-report/src/Fieldset/index.tsx.html +0 -202
- package/coverage/lcov-report/src/FormBuilder/FormBuilder.tsx.html +0 -580
- package/coverage/lcov-report/src/FormBuilder/index.html +0 -131
- package/coverage/lcov-report/src/FormBuilder/index.tsx.html +0 -94
- package/coverage/lcov-report/src/FormContext.tsx.html +0 -109
- package/coverage/lcov-report/src/MultiplicityField/add-objects.tsx.html +0 -637
- package/coverage/lcov-report/src/MultiplicityField/index.html +0 -131
- package/coverage/lcov-report/src/MultiplicityField/index.tsx.html +0 -580
- package/coverage/lcov-report/src/Questions/Questions.tsx.html +0 -307
- package/coverage/lcov-report/src/Questions/QuestionsContext.tsx.html +0 -112
- package/coverage/lcov-report/src/Questions/Step/ReviewStep.tsx.html +0 -274
- package/coverage/lcov-report/src/Questions/Step/Step.tsx.html +0 -286
- package/coverage/lcov-report/src/Questions/Step/StepArrayReview.tsx.html +0 -289
- package/coverage/lcov-report/src/Questions/Step/StepContext.tsx.html +0 -148
- package/coverage/lcov-report/src/Questions/Step/StepDescription.tsx.html +0 -184
- package/coverage/lcov-report/src/Questions/Step/StepForm.tsx.html +0 -265
- package/coverage/lcov-report/src/Questions/Step/StepQuote.tsx.html +0 -109
- package/coverage/lcov-report/src/Questions/Step/StepTitle.tsx.html +0 -265
- package/coverage/lcov-report/src/Questions/Step/getAddMoreFields.tsx.html +0 -169
- package/coverage/lcov-report/src/Questions/Step/index.html +0 -266
- package/coverage/lcov-report/src/Questions/Step/index.ts.html +0 -124
- package/coverage/lcov-report/src/Questions/Step/types.tsx.html +0 -181
- package/coverage/lcov-report/src/Questions/getNextStep.tsx.html +0 -157
- package/coverage/lcov-report/src/Questions/index.html +0 -161
- package/coverage/lcov-report/src/Questions/index.tsx.html +0 -100
- package/coverage/lcov-report/src/index.html +0 -176
- package/coverage/lcov-report/src/index.ts.html +0 -94
- package/coverage/lcov-report/src/inputs/Checkboxes/index.html +0 -116
- package/coverage/lcov-report/src/inputs/Checkboxes/index.tsx.html +0 -307
- package/coverage/lcov-report/src/inputs/DateInput/index.html +0 -116
- package/coverage/lcov-report/src/inputs/DateInput/index.tsx.html +0 -475
- package/coverage/lcov-report/src/inputs/FileInput/index.html +0 -116
- package/coverage/lcov-report/src/inputs/FileInput/index.tsx.html +0 -313
- package/coverage/lcov-report/src/inputs/Input/index.html +0 -116
- package/coverage/lcov-report/src/inputs/Input/index.tsx.html +0 -271
- package/coverage/lcov-report/src/inputs/Label/index.html +0 -116
- package/coverage/lcov-report/src/inputs/Label/index.tsx.html +0 -217
- package/coverage/lcov-report/src/inputs/Radio/index.html +0 -116
- package/coverage/lcov-report/src/inputs/Radio/index.tsx.html +0 -256
- package/coverage/lcov-report/src/inputs/Select/index.html +0 -116
- package/coverage/lcov-report/src/inputs/Select/index.tsx.html +0 -196
- package/coverage/lcov-report/src/inputs/index.html +0 -116
- package/coverage/lcov-report/src/inputs/index.ts.html +0 -106
- package/coverage/lcov-report/src/internal.ts.html +0 -184
- package/coverage/lcov-report/src/types.tsx.html +0 -406
- package/coverage/lcov-report/src/utils.ts.html +0 -319
- package/coverage/lcov-report/src/validators/index.html +0 -116
- package/coverage/lcov-report/src/validators/index.ts.html +0 -694
- package/coverage/lcov-report/src/validators/utils/afm.ts.html +0 -196
- package/coverage/lcov-report/src/validators/utils/file.ts.html +0 -160
- package/coverage/lcov-report/src/validators/utils/iban.ts.html +0 -442
- package/coverage/lcov-report/src/validators/utils/index.html +0 -236
- package/coverage/lcov-report/src/validators/utils/index.ts.html +0 -367
- package/coverage/lcov-report/src/validators/utils/int.ts.html +0 -151
- package/coverage/lcov-report/src/validators/utils/number.ts.html +0 -139
- package/coverage/lcov-report/src/validators/utils/phone.ts.html +0 -445
- package/coverage/lcov-report/src/validators/utils/postal_code.ts.html +0 -184
- package/coverage/lcov-report/src/validators/utils/uuid4.ts.html +0 -148
- package/coverage/lcov.info +0 -1969
- package/dist/CHANGELOG.md +0 -432
- package/dist/Questions/index.mdx +0 -13
- package/dist/README.md +0 -0
- package/dist/es/FieldArray/FieldArray.stories.js +0 -7
- package/dist/es/FormBuilder/FormBuilder.stories.js +0 -6
- package/dist/es/Questions/index.mdx +0 -13
- package/dist/es/inputs/DateInput/DateInput.stories.js +0 -6
- package/dist/esm/FormBuilder/FormBuilder.stories.js +0 -6
- package/dist/esm/MultiplicityField/MultiplicityField.stories.js +0 -11
- package/dist/esm/Questions/index.mdx +0 -13
- package/dist/esm/inputs/Checkboxes/Checkboxes.stories.js +0 -6
- package/dist/esm/inputs/FileInput/FileInput.stories.js +0 -6
- package/dist/esm/inputs/Input/Input.stories.js +0 -13
- package/dist/esm/inputs/Label/Label.stories.js +0 -6
- package/dist/esm/inputs/Radio/Radio.stories.js +0 -6
- package/dist/esm/inputs/Select/Select.stories.js +0 -6
- package/dist/package.json +0 -31
- package/docs/index.mdx +0 -6
- package/form.build.log +0 -16
- package/src/Field/FieldBase.tsx +0 -99
- package/src/Field/FieldBaseContainer.tsx +0 -57
- package/src/Field/FieldConditional.tsx +0 -75
- package/src/Field/index.mdx +0 -6
- package/src/Field/index.tsx +0 -92
- package/src/Field/types.tsx +0 -102
- package/src/Field/utils.ts +0 -164
- package/src/FieldArray/FieldArray.stories.playwright.json +0 -353
- package/src/FieldArray/__stories__/Default.tsx +0 -95
- package/src/FieldArray/__stories__/WithExactLength.tsx +0 -95
- package/src/FieldArray/index.tsx +0 -83
- package/src/FieldObject/index.tsx +0 -92
- package/src/Fieldset/FieldsetWithContext.tsx +0 -41
- package/src/Fieldset/index.tsx +0 -40
- package/src/Fieldset/types.tsx +0 -6
- package/src/Form.stories.js +0 -5
- package/src/Form.stories.playwright.json +0 -143
- package/src/FormBuilder/FormBuilder.mdx +0 -271
- package/src/FormBuilder/FormBuilder.stories.playwright.json +0 -52
- package/src/FormBuilder/FormBuilder.tsx +0 -165
- package/src/FormBuilder/__stories__/Default.tsx +0 -23
- package/src/FormBuilder/index.tsx +0 -3
- package/src/FormContext.tsx +0 -8
- package/src/MultiplicityField/MultiplicityField.mdx +0 -580
- package/src/MultiplicityField/MultiplicityField.stories.playwright.json +0 -1370
- package/src/MultiplicityField/__stories__/Default.tsx +0 -100
- package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +0 -160
- package/src/MultiplicityField/__stories__/WithExactLength.tsx +0 -99
- package/src/MultiplicityField/__stories__/WithMaxLength.tsx +0 -102
- package/src/MultiplicityField/__stories__/WithMinAndMaxLength.tsx +0 -103
- package/src/MultiplicityField/__stories__/WithMinLength.tsx +0 -102
- package/src/MultiplicityField/add-objects.tsx +0 -186
- package/src/MultiplicityField/index.tsx +0 -166
- package/src/Questions/Questions.tsx +0 -74
- package/src/Questions/QuestionsContext.tsx +0 -9
- package/src/Questions/Step/ReviewStep.tsx +0 -63
- package/src/Questions/Step/Step.tsx +0 -67
- package/src/Questions/Step/StepArrayReview.tsx +0 -68
- package/src/Questions/Step/StepContext.tsx +0 -21
- package/src/Questions/Step/StepDescription.tsx +0 -33
- package/src/Questions/Step/StepForm.tsx +0 -60
- package/src/Questions/Step/StepQuote.tsx +0 -8
- package/src/Questions/Step/StepTitle.tsx +0 -60
- package/src/Questions/Step/getAddMoreFields.tsx +0 -28
- package/src/Questions/Step/index.ts +0 -13
- package/src/Questions/Step/types.tsx +0 -32
- package/src/Questions/__snapshots__/index.spec.tsx.snap +0 -887
- package/src/Questions/getNextStep.tsx +0 -24
- package/src/Questions/index.mdx +0 -13
- package/src/Questions/index.spec.tsx +0 -72
- package/src/Questions/index.tsx +0 -5
- package/src/Questions/types.tsx +0 -25
- package/src/__stories__/AutoCompleteField.tsx +0 -45
- package/src/__stories__/IntField.tsx +0 -38
- package/src/create-simple-form.mdx +0 -518
- package/src/index.mdx +0 -44
- package/src/index.ts +0 -3
- package/src/inputs/AutoComplete/index.tsx +0 -85
- package/src/inputs/Checkboxes/Checkboxes.stories.playwright.json +0 -69
- package/src/inputs/Checkboxes/__stories__/Default.tsx +0 -39
- package/src/inputs/Checkboxes/index.mdx +0 -0
- package/src/inputs/Checkboxes/index.tsx +0 -77
- package/src/inputs/DateInput/DateInput.stories.playwright.json +0 -72
- package/src/inputs/DateInput/__stories__/Default.tsx +0 -41
- package/src/inputs/DateInput/index.tsx +0 -130
- package/src/inputs/FileInput/FileInput.stories.playwright.json +0 -75
- package/src/inputs/FileInput/__stories__/Default.tsx +0 -23
- package/src/inputs/FileInput/index.tsx +0 -76
- package/src/inputs/Input/Input.stories.playwright.json +0 -376
- package/src/inputs/Input/__stories__/AFM.tsx +0 -24
- package/src/inputs/Input/__stories__/Boolean.tsx +0 -26
- package/src/inputs/Input/__stories__/Default.tsx +0 -25
- package/src/inputs/Input/__stories__/IBAN.tsx +0 -26
- package/src/inputs/Input/__stories__/Integer.tsx +0 -25
- package/src/inputs/Input/__stories__/MobilePhone.tsx +0 -24
- package/src/inputs/Input/__stories__/PhoneNumber.tsx +0 -24
- package/src/inputs/Input/__stories__/PostalCode.tsx +0 -25
- package/src/inputs/Input/index.mdx +0 -8
- package/src/inputs/Input/index.tsx +0 -62
- package/src/inputs/Label/Label.stories.playwright.json +0 -40
- package/src/inputs/Label/__stories__/Default.tsx +0 -28
- package/src/inputs/Label/index.mdx +0 -0
- package/src/inputs/Label/index.tsx +0 -44
- package/src/inputs/Radio/Radio.stories.playwright.json +0 -57
- package/src/inputs/Radio/__stories__/Default.tsx +0 -42
- package/src/inputs/Radio/index.mdx +0 -0
- package/src/inputs/Radio/index.tsx +0 -57
- package/src/inputs/Select/Select.stories.playwright.json +0 -22
- package/src/inputs/Select/__stories__/Default.tsx +0 -47
- package/src/inputs/Select/index.tsx +0 -37
- package/src/inputs/index.ts +0 -7
- package/src/installation.mdx +0 -72
- package/src/internal.ts +0 -34
- package/src/registry.js +0 -134
- package/src/types.tsx +0 -110
- package/src/utils.ts +0 -78
- package/src/validators/index.ts +0 -203
- package/src/validators/types.ts +0 -2
- package/src/validators/utils/afm.ts +0 -37
- package/src/validators/utils/file.ts +0 -25
- package/src/validators/utils/iban.ts +0 -119
- package/src/validators/utils/index.ts +0 -94
- package/src/validators/utils/int.ts +0 -22
- package/src/validators/utils/number.ts +0 -18
- package/src/validators/utils/phone.ts +0 -120
- package/src/validators/utils/postal_code.ts +0 -33
- package/src/validators/utils/uuid4.ts +0 -21
- package/src/validators/validators.spec.ts +0 -122
- package/tsconfig.json +0 -14
- package/tsconfig.production.json +0 -49
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "4",
|
|
3
|
-
"stories": {
|
|
4
|
-
"digigov-form-inputs-checkboxes--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": "6mm9fbbYacA3",
|
|
16
|
-
"title": "show validation error"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"actions": [
|
|
20
|
-
{
|
|
21
|
-
"name": "keyboard.press",
|
|
22
|
-
"args": {
|
|
23
|
-
"key": "Tab"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"name": "keyboard.press",
|
|
28
|
-
"args": {
|
|
29
|
-
"key": "Tab"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"name": "keyboard.press",
|
|
34
|
-
"args": {
|
|
35
|
-
"key": "Space"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"name": "keyboard.press",
|
|
40
|
-
"args": {
|
|
41
|
-
"key": "Tab"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"name": "keyboard.press",
|
|
46
|
-
"args": {
|
|
47
|
-
"key": "Space"
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"name": "click",
|
|
52
|
-
"args": {
|
|
53
|
-
"selector": "html>body>div:nth-child(5)>form>div>fieldset>div>div:nth-child(1)>label>input"
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"name": "click",
|
|
58
|
-
"args": {
|
|
59
|
-
"selector": "html>body>div:nth-child(5)>form>button"
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
"id": "hBiOJ8xaQSWv",
|
|
64
|
-
"title": "Focus and check using keyboard, click box and submit"
|
|
65
|
-
}
|
|
66
|
-
]
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
-
import { Button } from '@digigov/ui/core';
|
|
4
|
-
|
|
5
|
-
export const Default = () => (
|
|
6
|
-
<FormBuilder
|
|
7
|
-
onSubmit={(data) => {
|
|
8
|
-
debugger;
|
|
9
|
-
console.log(data);
|
|
10
|
-
}}
|
|
11
|
-
>
|
|
12
|
-
<Field
|
|
13
|
-
key={'string'}
|
|
14
|
-
name="string"
|
|
15
|
-
type="choice:multiple"
|
|
16
|
-
required
|
|
17
|
-
label={{ primary: 'Πώς αισθάνεστε αυτή τη στιγμή;' }}
|
|
18
|
-
extra={{
|
|
19
|
-
options: [
|
|
20
|
-
{
|
|
21
|
-
label: { primary: 'Έχω συνάχι' },
|
|
22
|
-
value: 'runny-nose',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
label: { primary: 'Έχω πυρετό' },
|
|
26
|
-
value: 'fever',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
label: { primary: 'Αισθάνομαι κούραση' },
|
|
30
|
-
value: 'fatigue',
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
}}
|
|
34
|
-
/>
|
|
35
|
-
<Button type="submit">Συνέχεια</Button>
|
|
36
|
-
</FormBuilder>
|
|
37
|
-
);
|
|
38
|
-
|
|
39
|
-
export default Default;
|
|
File without changes
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FieldOptionProps } from '@digigov/form/inputs/Label';
|
|
3
|
-
import { ControlledFieldProps } from '@digigov/form/Field/types';
|
|
4
|
-
import { useTranslation } from '@digigov/ui/app/i18n';
|
|
5
|
-
import CoreCheckboxes from '@digigov/react-core/Checkbox';
|
|
6
|
-
import CheckboxItem from '@digigov/react-core/CheckboxItem';
|
|
7
|
-
import Hint from '@digigov/react-core/Hint';
|
|
8
|
-
|
|
9
|
-
export interface CheckboxesProps
|
|
10
|
-
extends Omit<ControlledFieldProps, 'extra' | 'value'> {
|
|
11
|
-
value?: string[];
|
|
12
|
-
extra: {
|
|
13
|
-
className?: string;
|
|
14
|
-
options: Array<FieldOptionProps>;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const Checkboxes: React.FC<CheckboxesProps> = function Checkboxes({
|
|
19
|
-
name,
|
|
20
|
-
onChange,
|
|
21
|
-
value,
|
|
22
|
-
extra: { options, className },
|
|
23
|
-
disabled,
|
|
24
|
-
...props
|
|
25
|
-
}) {
|
|
26
|
-
if (!value) value = [];
|
|
27
|
-
const handleChange = (optionValue) => (evt): void => {
|
|
28
|
-
let newValue;
|
|
29
|
-
if (evt.currentTarget.checked) {
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
31
|
-
// @ts-ignore
|
|
32
|
-
newValue = value.concat([optionValue]);
|
|
33
|
-
} else {
|
|
34
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
35
|
-
// @ts-ignore
|
|
36
|
-
newValue = value.filter((val) => val !== optionValue);
|
|
37
|
-
}
|
|
38
|
-
// reset value to undefined instead of an empty array
|
|
39
|
-
// so the error state mechanism can throw validation errors
|
|
40
|
-
if (newValue.length === 0) newValue = undefined;
|
|
41
|
-
onChange(newValue);
|
|
42
|
-
};
|
|
43
|
-
const { t } = useTranslation();
|
|
44
|
-
return (
|
|
45
|
-
<CoreCheckboxes className={className}>
|
|
46
|
-
{options.map((option, key) => (
|
|
47
|
-
<CheckboxItem
|
|
48
|
-
name={name}
|
|
49
|
-
disabled={disabled}
|
|
50
|
-
key={key}
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
checked={value.includes(option.value)}
|
|
54
|
-
onChange={handleChange(option.value)}
|
|
55
|
-
{...option}
|
|
56
|
-
{...{
|
|
57
|
-
...props,
|
|
58
|
-
reset: undefined,
|
|
59
|
-
defaultValue: undefined,
|
|
60
|
-
onBlur: undefined,
|
|
61
|
-
required: undefined,
|
|
62
|
-
'aria-describedby': undefined,
|
|
63
|
-
type: 'checkbox',
|
|
64
|
-
}}
|
|
65
|
-
>
|
|
66
|
-
{(option.label && option.label.primary && t(option.label.primary)) ||
|
|
67
|
-
value}
|
|
68
|
-
{option.label && option.label.secondary && (
|
|
69
|
-
<Hint>{t(option.label.secondary)}</Hint>
|
|
70
|
-
)}
|
|
71
|
-
</CheckboxItem>
|
|
72
|
-
))}
|
|
73
|
-
</CoreCheckboxes>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export default Checkboxes;
|
|
@@ -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,41 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
-
import { Button } from '@digigov/ui/core';
|
|
4
|
-
|
|
5
|
-
export const Default = () => (
|
|
6
|
-
<FormBuilder
|
|
7
|
-
onSubmit={(data) => {
|
|
8
|
-
debugger;
|
|
9
|
-
console.log(data);
|
|
10
|
-
}}
|
|
11
|
-
>
|
|
12
|
-
<Field
|
|
13
|
-
key={'string'}
|
|
14
|
-
name="string"
|
|
15
|
-
type="date"
|
|
16
|
-
required
|
|
17
|
-
label={{
|
|
18
|
-
primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
|
|
19
|
-
secondary: 'Για παράδειγμα, 05 11 2020',
|
|
20
|
-
}}
|
|
21
|
-
extra={{
|
|
22
|
-
options: [
|
|
23
|
-
{
|
|
24
|
-
label: { primary: 'Έχω συνάχι' },
|
|
25
|
-
value: 'runny-nose',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
label: { primary: 'Έχω πυρετό' },
|
|
29
|
-
value: 'fever',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
label: { primary: 'Αισθάνομαι κούραση' },
|
|
33
|
-
value: 'fatigue',
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
}}
|
|
37
|
-
/>
|
|
38
|
-
<Button type="submit">Συνέχεια</Button>
|
|
39
|
-
</FormBuilder>
|
|
40
|
-
);
|
|
41
|
-
export default Default;
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import React, { useMemo, useState } from 'react';
|
|
2
|
-
import { UncontrolledFieldProps } from '@digigov/form/Field/types';
|
|
3
|
-
import dayjs from 'dayjs';
|
|
4
|
-
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
5
|
-
import { useTranslation } from '@digigov/ui/app/i18n';
|
|
6
|
-
import DateInputContainer from '@digigov/react-core/DateInputContainer';
|
|
7
|
-
import CoreDateInputItem from '@digigov/react-core/DateInputItem';
|
|
8
|
-
dayjs.extend(customParseFormat);
|
|
9
|
-
|
|
10
|
-
export interface DateInputProps extends Omit<UncontrolledFieldProps, 'extra'> {
|
|
11
|
-
extra?: {
|
|
12
|
-
max?: string;
|
|
13
|
-
min?: string;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function useDate(value, onChange) {
|
|
18
|
-
const [year, month, day] = useMemo(() => {
|
|
19
|
-
if (!value || value.length === '') {
|
|
20
|
-
return ['', '', ''];
|
|
21
|
-
}
|
|
22
|
-
const [day, month, year] = value.split('/');
|
|
23
|
-
return [year, month, day];
|
|
24
|
-
}, [value]);
|
|
25
|
-
|
|
26
|
-
function set(year, month, day) {
|
|
27
|
-
const value = `${day || ''}/${month || ''}/${year || ''}`;
|
|
28
|
-
if (!year && !month && !day) {
|
|
29
|
-
onChange(null);
|
|
30
|
-
} else {
|
|
31
|
-
onChange(value);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function setYear(evt) {
|
|
36
|
-
const val = evt.target.value;
|
|
37
|
-
set(val, month, day);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function setMonth(evt, cast) {
|
|
41
|
-
let val = evt.target.value;
|
|
42
|
-
if (cast && val && val.length === 1) {
|
|
43
|
-
val = '0' + val;
|
|
44
|
-
}
|
|
45
|
-
set(year, val, day);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function setDay(evt, cast) {
|
|
49
|
-
let val = evt.target.value;
|
|
50
|
-
if (cast && val && val.length === 1) {
|
|
51
|
-
val = '0' + val;
|
|
52
|
-
}
|
|
53
|
-
set(year, month, val);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
day,
|
|
58
|
-
month,
|
|
59
|
-
year,
|
|
60
|
-
setYear,
|
|
61
|
-
setMonth,
|
|
62
|
-
setDay,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const VALID_FORMATS = ['DD/MM/YYYY'];
|
|
67
|
-
|
|
68
|
-
const makeDate = (val) => {
|
|
69
|
-
const date = dayjs(val, VALID_FORMATS, true);
|
|
70
|
-
if (date.isValid()) {
|
|
71
|
-
return date.format('DD/MM/YYYY');
|
|
72
|
-
}
|
|
73
|
-
return '';
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const DatePart = ({ label, ...props }) => {
|
|
77
|
-
return <CoreDateInputItem {...props}>{label}</CoreDateInputItem>;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const DateInput = function DateInput({ name, type, ...props }) {
|
|
81
|
-
const { t } = useTranslation();
|
|
82
|
-
const [initial] = useState(props.value);
|
|
83
|
-
const value = useMemo(() => {
|
|
84
|
-
if (initial === props.value) {
|
|
85
|
-
return makeDate(props.value);
|
|
86
|
-
}
|
|
87
|
-
return props.value;
|
|
88
|
-
}, [props.value, initial]);
|
|
89
|
-
|
|
90
|
-
const date = useDate(value || makeDate(props.defaultValue), props.onChange);
|
|
91
|
-
|
|
92
|
-
return (
|
|
93
|
-
<DateInputContainer>
|
|
94
|
-
<DatePart
|
|
95
|
-
label={t('form.label.day')}
|
|
96
|
-
onChange={date.setDay}
|
|
97
|
-
onBlur={(e) => date.setDay(e, true)}
|
|
98
|
-
value={date.day}
|
|
99
|
-
width={2}
|
|
100
|
-
name={`${name}-day`}
|
|
101
|
-
maxlength="2"
|
|
102
|
-
disabled={props.disabled}
|
|
103
|
-
aria-required={props['aria-required']}
|
|
104
|
-
/>
|
|
105
|
-
<DatePart
|
|
106
|
-
label={t('form.label.month')}
|
|
107
|
-
onChange={date.setMonth}
|
|
108
|
-
onBlur={(e) => date.setMonth(e, true)}
|
|
109
|
-
value={date.month}
|
|
110
|
-
width={2}
|
|
111
|
-
name={`${props.name}-month`}
|
|
112
|
-
maxlength="2"
|
|
113
|
-
disabled={props.disabled}
|
|
114
|
-
aria-required={props['aria-required']}
|
|
115
|
-
/>
|
|
116
|
-
<DatePart
|
|
117
|
-
label={t('form.label.year')}
|
|
118
|
-
onChange={date.setYear}
|
|
119
|
-
value={date.year}
|
|
120
|
-
width={4}
|
|
121
|
-
name={`${props.name}-year`}
|
|
122
|
-
maxlength="4"
|
|
123
|
-
disabled={props.disabled}
|
|
124
|
-
aria-required={props['aria-required']}
|
|
125
|
-
/>
|
|
126
|
-
</DateInputContainer>
|
|
127
|
-
);
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export default DateInput;
|
|
@@ -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,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import FormBuilder, { Field } from '@digigov/form';
|
|
3
|
-
import { Button } from '@digigov/ui/core';
|
|
4
|
-
|
|
5
|
-
export const Default = () => (
|
|
6
|
-
<FormBuilder
|
|
7
|
-
onSubmit={(data) => {
|
|
8
|
-
debugger;
|
|
9
|
-
console.log(data);
|
|
10
|
-
}}
|
|
11
|
-
>
|
|
12
|
-
<Field
|
|
13
|
-
key={'string'}
|
|
14
|
-
name="file"
|
|
15
|
-
type="file"
|
|
16
|
-
required
|
|
17
|
-
label={{ primary: 'Βιογραφικό σημείωμα' }}
|
|
18
|
-
/>
|
|
19
|
-
<Button>Συνέχεια</Button>
|
|
20
|
-
</FormBuilder>
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
export default Default;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { UncontrolledFieldProps } from '@digigov/form/Field/types';
|
|
3
|
-
import { useTranslation } from '@digigov/ui/app/i18n';
|
|
4
|
-
import Paragraph from '@digigov/ui/typography/Paragraph';
|
|
5
|
-
import CoreHint from '@digigov/react-core/Hint';
|
|
6
|
-
import Button from '@digigov/ui/core/Button';
|
|
7
|
-
import FileUploadContainer from '@digigov/react-core/FileUploadContainer';
|
|
8
|
-
import FileUpload from '@digigov/react-core/FileUpload';
|
|
9
|
-
export interface FileInputProps extends Omit<UncontrolledFieldProps, 'extra'> {
|
|
10
|
-
extra?: {
|
|
11
|
-
className?: string;
|
|
12
|
-
multiple?: boolean;
|
|
13
|
-
accept?: string;
|
|
14
|
-
maxSize?: number;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
-
export const FileInput: React.FC<any> = React.forwardRef(function FileInput(
|
|
20
|
-
{ name, extra = {}, disabled, reset, onChange, ...props },
|
|
21
|
-
ref: any
|
|
22
|
-
) {
|
|
23
|
-
const { t } = useTranslation();
|
|
24
|
-
const [files, setFiles] = useState<Array<string> | undefined>([]);
|
|
25
|
-
const handleChange = (e) => {
|
|
26
|
-
const target = e.target as HTMLInputElement;
|
|
27
|
-
const selectedFiles = Array.from(
|
|
28
|
-
target.files as ArrayLike<{ name: string }>
|
|
29
|
-
).map(({ name }) => name);
|
|
30
|
-
setFiles(selectedFiles);
|
|
31
|
-
// proceed calling the onChange provided
|
|
32
|
-
// by react-hook-form
|
|
33
|
-
onChange(e);
|
|
34
|
-
};
|
|
35
|
-
return (
|
|
36
|
-
<>
|
|
37
|
-
<FileUploadContainer hasUploadedFile={files && files.length > 0}>
|
|
38
|
-
{files?.length ? (
|
|
39
|
-
<>
|
|
40
|
-
<Paragraph>
|
|
41
|
-
<b>{t('upload.file')}:</b> {`${files.join(', ')}`}
|
|
42
|
-
</Paragraph>
|
|
43
|
-
</>
|
|
44
|
-
) : (
|
|
45
|
-
<CoreHint>{t('upload.no_file')}</CoreHint>
|
|
46
|
-
)}
|
|
47
|
-
<FileUpload
|
|
48
|
-
ref={ref}
|
|
49
|
-
hasFiles={!!files?.length}
|
|
50
|
-
name={name}
|
|
51
|
-
disabled={disabled}
|
|
52
|
-
onChange={handleChange}
|
|
53
|
-
{...{ ...props, required: undefined }}
|
|
54
|
-
>
|
|
55
|
-
{files?.length ? t('upload.change_file') : t('upload.choose_file')}
|
|
56
|
-
</FileUpload>
|
|
57
|
-
{files !== undefined && files.length > 0 && (
|
|
58
|
-
<>
|
|
59
|
-
<Button
|
|
60
|
-
variant="link"
|
|
61
|
-
onClick={(event) => {
|
|
62
|
-
event.preventDefault();
|
|
63
|
-
reset({ [name]: '' });
|
|
64
|
-
setFiles(undefined);
|
|
65
|
-
}}
|
|
66
|
-
>
|
|
67
|
-
{t('upload.reset_file')}
|
|
68
|
-
</Button>
|
|
69
|
-
</>
|
|
70
|
-
)}
|
|
71
|
-
</FileUploadContainer>
|
|
72
|
-
</>
|
|
73
|
-
);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
export default FileInput;
|