@digigov/form 2.0.0-daaf7bdf → 2.0.0-e20fed09
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Field/ErrorGroup/index.js +48 -0
- package/{Form.stories → Field/ErrorGroup}/package.json +1 -1
- package/Field/ErrorGroup.d.ts +15 -0
- package/Field/ErrorGroup.js.map +7 -0
- package/Field/FieldBase/index.js +37 -25
- package/Field/FieldBase.js.map +2 -2
- package/Field/FieldBaseContainer/index.js +38 -18
- package/Field/FieldBaseContainer.d.ts +1 -1
- package/Field/FieldBaseContainer.js.map +2 -2
- package/Field/FieldConditional/index.js +4 -0
- package/Field/FieldConditional.js.map +2 -2
- package/Field/index.js +15 -4
- package/Field/index.js.map +2 -2
- package/Field/types.d.ts +21 -10
- package/Field/utils/index.js +9 -1
- package/Field/utils/index.js.map +2 -2
- package/Field/utils/useField/index.js +14 -1
- package/Field/utils/useField.js.map +2 -2
- package/FieldArray/FieldArray.stories.d.ts +1 -0
- package/FieldArray/FormDialog/index.js +397 -0
- package/{Questions/Questions.stories → FieldArray/FormDialog}/package.json +1 -1
- package/FieldArray/FormDialog.d.ts +66 -0
- package/FieldArray/FormDialog.js.map +7 -0
- package/FieldArray/__stories__/Default.d.ts +1 -1
- package/FieldArray/__stories__/WithExactLength.d.ts +1 -1
- package/FieldArray/__stories__/WithModal.d.ts +2 -0
- package/FieldArray/index.d.ts +6 -0
- package/FieldArray/index.js +87 -29
- package/FieldArray/index.js.map +2 -2
- package/FieldObject/index.d.ts +5 -0
- package/FieldObject/index.js +32 -17
- package/FieldObject/index.js.map +2 -2
- package/Fieldset/index.d.ts +1 -1
- package/Fieldset/index.js +5 -5
- package/Fieldset/index.js.map +2 -2
- package/Fieldset/types.d.ts +2 -2
- package/FormBuilder/FormBuilder.stories.d.ts +4 -0
- package/FormBuilder/__stories__/AutoErrorGrouping.d.ts +3 -0
- package/FormBuilder/__stories__/Default.d.ts +1 -1
- package/FormBuilder/__stories__/ErrorGrouping.d.ts +3 -0
- package/FormBuilder/index.d.ts +1 -1
- package/FormBuilder/index.js +94 -11
- package/FormBuilder/index.js.map +2 -2
- package/FormBuilder/interaction.test.d.ts +1 -0
- package/FormContext/index.js +6 -2
- package/FormContext.d.ts +1 -0
- package/FormContext.js.map +2 -2
- package/MultiplicityField/MultiplicityField.stories.d.ts +2 -0
- package/MultiplicityField/__stories__/Default.d.ts +1 -1
- package/MultiplicityField/__stories__/PreviewDisplay.d.ts +1 -1
- package/MultiplicityField/__stories__/WithExactLength.d.ts +1 -1
- package/MultiplicityField/__stories__/WithMaxLength.d.ts +1 -1
- package/MultiplicityField/__stories__/WithMinAndMaxLength.d.ts +1 -1
- package/MultiplicityField/__stories__/WithMinLength.d.ts +1 -1
- package/MultiplicityField/add-objects/index.js +10 -6
- package/MultiplicityField/add-objects.js.map +2 -2
- package/MultiplicityField/index.js +17 -11
- package/MultiplicityField/index.js.map +2 -2
- package/MultiplicityField/types.d.ts +2 -2
- package/Questions/Questions/index.js +5 -4
- package/Questions/Questions.js.map +2 -2
- package/Questions/Questions.stories.d.ts +2 -0
- package/Questions/Step/StepArrayReview.js.map +2 -2
- package/Questions/Step/StepTitle/index.js +4 -3
- package/Questions/Step/StepTitle.d.ts +1 -1
- package/Questions/Step/StepTitle.js.map +2 -2
- package/Questions/__stories__/Default.d.ts +1 -1
- package/cjs/Field/ErrorGroup/index.js +82 -0
- package/cjs/Field/ErrorGroup.js.map +7 -0
- package/cjs/Field/FieldBase/index.js +36 -24
- package/cjs/Field/FieldBase.js.map +2 -2
- package/cjs/Field/FieldBaseContainer/index.js +37 -17
- package/cjs/Field/FieldBaseContainer.js.map +3 -3
- package/cjs/Field/FieldConditional/index.js +4 -0
- package/cjs/Field/FieldConditional.js.map +2 -2
- package/cjs/Field/index.js +15 -4
- package/cjs/Field/index.js.map +2 -2
- package/cjs/Field/types.js.map +1 -1
- package/cjs/Field/utils/index.js +9 -1
- package/cjs/Field/utils/index.js.map +3 -3
- package/cjs/Field/utils/useField/index.js +14 -1
- package/cjs/Field/utils/useField.js.map +2 -2
- package/cjs/FieldArray/FormDialog/index.js +416 -0
- package/cjs/FieldArray/FormDialog.js.map +7 -0
- package/cjs/FieldArray/index.js +85 -27
- package/cjs/FieldArray/index.js.map +3 -3
- package/cjs/FieldObject/index.js +32 -17
- package/cjs/FieldObject/index.js.map +3 -3
- package/cjs/Fieldset/index.js +10 -10
- package/cjs/Fieldset/index.js.map +3 -3
- package/cjs/Fieldset/types.js.map +1 -1
- package/cjs/FormBuilder/index.js +94 -11
- package/cjs/FormBuilder/index.js.map +3 -3
- package/cjs/FormContext/index.js +9 -4
- package/cjs/FormContext.js.map +3 -3
- package/cjs/MultiplicityField/add-objects/index.js +14 -10
- package/cjs/MultiplicityField/add-objects.js.map +3 -3
- package/cjs/MultiplicityField/index.js +16 -15
- package/cjs/MultiplicityField/index.js.map +3 -3
- package/cjs/MultiplicityField/types.js.map +1 -1
- package/cjs/Questions/Questions/index.js +5 -4
- package/cjs/Questions/Questions.js.map +2 -2
- package/cjs/Questions/Step/StepArrayReview.js.map +2 -2
- package/cjs/Questions/Step/StepTitle/index.js +5 -5
- package/cjs/Questions/Step/StepTitle.js.map +3 -3
- package/cjs/inputs/AutoCompleteInput/index.js +8 -7
- package/cjs/inputs/AutoCompleteInput/index.js.map +3 -3
- package/cjs/inputs/Checkboxes/index.js +9 -9
- package/cjs/inputs/Checkboxes/index.js.map +3 -3
- package/cjs/inputs/DateInput/index.js +51 -22
- package/cjs/inputs/DateInput/index.js.map +3 -3
- package/cjs/inputs/DateTimeInput/index.js +245 -0
- package/cjs/inputs/DateTimeInput/index.js.map +7 -0
- package/cjs/inputs/FileInput/index.js +72 -35
- package/cjs/inputs/FileInput/index.js.map +3 -3
- package/cjs/inputs/ImageInput/__stories__/logo.d/index.js +1 -0
- package/cjs/inputs/ImageInput/__stories__/logo.d.js.map +7 -0
- package/cjs/inputs/ImageInput/index.js +54 -18
- package/cjs/inputs/ImageInput/index.js.map +3 -3
- package/cjs/inputs/Input/index.js +12 -4
- package/cjs/inputs/Input/index.js.map +2 -2
- package/cjs/inputs/Label/index.js +3 -3
- package/cjs/inputs/Label/index.js.map +3 -3
- package/cjs/inputs/OtpInput/index.js +1 -0
- package/cjs/inputs/OtpInput/index.js.map +2 -2
- package/cjs/inputs/Radio/index.js +12 -13
- package/cjs/inputs/Radio/index.js.map +3 -3
- package/cjs/inputs/Select/index.js +11 -5
- package/cjs/inputs/Select/index.js.map +3 -3
- package/cjs/inputs/inputsScenarios/index.js +6 -12
- package/cjs/inputs/inputsScenarios.js.map +2 -2
- package/cjs/{lazy/index.js → lazy.js} +49 -35
- package/cjs/lazy.js.map +3 -3
- package/cjs/locales/el.js.map +1 -1
- package/cjs/{registry/index.js → registry.js} +72 -62
- package/cjs/registry.js.map +3 -3
- package/cjs/types.js.map +1 -1
- package/cjs/utils/index.js +22 -7
- package/cjs/utils.js.map +2 -2
- package/cjs/validators/index.js +55 -85
- package/cjs/validators/index.js.map +3 -3
- package/cjs/validators/utils/amka/index.js +60 -0
- package/cjs/validators/utils/amka.js.map +7 -0
- package/cjs/validators/utils/date/index.js +161 -0
- package/cjs/validators/utils/date.js.map +7 -0
- package/cjs/validators/utils/datetime/index.js +245 -0
- package/cjs/validators/utils/datetime.js.map +7 -0
- package/cjs/validators/utils/file/index.js +30 -17
- package/cjs/validators/utils/file.js.map +2 -2
- package/cjs/validators/utils/index.js +10 -2
- package/cjs/validators/utils/index.js.map +2 -2
- package/cjs/validators/utils/int/index.js +1 -1
- package/cjs/validators/utils/int.js.map +2 -2
- package/cjs/validators/utils/number/index.js +1 -1
- package/cjs/validators/utils/number.js.map +2 -2
- package/cjs/validators/utils/phone.js.map +2 -2
- package/cjs/validators/utils/postal_code.js.map +1 -1
- package/cjs/validators/utils/uuid4.js.map +2 -2
- package/index.js +1 -1
- package/inputs/AutoCompleteInput/AutoComplete.stories.d.ts +2 -0
- package/inputs/AutoCompleteInput/__stories__/Default.d.ts +1 -1
- package/inputs/AutoCompleteInput/__stories__/Multiple.d.ts +1 -1
- package/inputs/AutoCompleteInput/index.d.ts +1 -1
- package/inputs/AutoCompleteInput/index.js +10 -7
- package/inputs/AutoCompleteInput/index.js.map +2 -2
- package/inputs/Checkboxes/Checkboxes.stories.d.ts +2 -0
- package/inputs/Checkboxes/__stories__/Conditional.d.ts +1 -1
- package/inputs/Checkboxes/__stories__/Default.d.ts +1 -1
- package/inputs/Checkboxes/__stories__/WithDivider.d.ts +1 -1
- package/inputs/Checkboxes/index.d.ts +1 -1
- package/inputs/Checkboxes/index.js +10 -6
- package/inputs/Checkboxes/index.js.map +2 -2
- package/inputs/DateInput/DateInput.stories.d.ts +6 -0
- package/inputs/DateInput/__stories__/Default.d.ts +1 -1
- package/inputs/DateInput/__stories__/WithDefaultValue.d.ts +3 -0
- package/inputs/DateInput/__stories__/WithInitialValue.d.ts +3 -0
- package/inputs/DateInput/__stories__/WithWrongDefaultValue.d.ts +3 -0
- package/inputs/DateInput/__stories__/WithWrongInitialValue.d.ts +3 -0
- package/inputs/DateInput/index.d.ts +1 -2
- package/inputs/DateInput/index.js +54 -22
- package/inputs/DateInput/index.js.map +2 -2
- package/inputs/DateTimeInput/DateTimeInput.stories.d.ts +14 -0
- package/inputs/DateTimeInput/__stories__/Default.d.ts +3 -0
- package/inputs/DateTimeInput/__stories__/WithDefaultValue.d.ts +3 -0
- package/inputs/DateTimeInput/__stories__/WithInitialValue.d.ts +3 -0
- package/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.d.ts +3 -0
- package/inputs/DateTimeInput/__stories__/WithWrongInitialValue.d.ts +3 -0
- package/inputs/DateTimeInput/index.d.ts +13 -0
- package/inputs/DateTimeInput/index.js +215 -0
- package/inputs/DateTimeInput/index.js.map +7 -0
- package/inputs/DateTimeInput/index.test.d.ts +1 -0
- package/inputs/{Input/Input.stories → DateTimeInput}/package.json +1 -1
- package/inputs/FileInput/FileInput.stories.d.ts +3 -0
- package/inputs/FileInput/__stories__/Default.d.ts +1 -1
- package/inputs/FileInput/__stories__/WithBorderAndLink.d.ts +3 -0
- package/inputs/FileInput/index.d.ts +17 -1
- package/inputs/FileInput/index.js +76 -36
- package/inputs/FileInput/index.js.map +2 -2
- package/inputs/ImageInput/ImageInput.stories.d.ts +4 -1
- package/inputs/ImageInput/__stories__/Default.d.ts +1 -1
- package/inputs/ImageInput/__stories__/MaxSize.d.ts +1 -1
- package/inputs/ImageInput/__stories__/WithInitialValues.d.ts +3 -0
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension.d.ts +1 -1
- package/inputs/ImageInput/__stories__/logo.d/index.js +1 -0
- package/inputs/{DateInput/__stories__/Default → ImageInput/__stories__/logo.d}/package.json +1 -1
- package/inputs/ImageInput/__stories__/logo.d.js.map +7 -0
- package/inputs/ImageInput/index.d.ts +9 -1
- package/inputs/ImageInput/index.js +54 -18
- package/inputs/ImageInput/index.js.map +2 -2
- package/inputs/Input/Input.stories.d.ts +5 -0
- package/inputs/Input/__stories__/AFM.d.ts +1 -1
- package/inputs/Input/__stories__/AMKA.d.ts +3 -0
- package/inputs/Input/__stories__/Boolean.d.ts +1 -1
- package/inputs/Input/__stories__/Email.d.ts +3 -0
- package/inputs/Input/__stories__/IBAN.d.ts +1 -1
- package/inputs/Input/__stories__/Integer.d.ts +1 -1
- package/inputs/Input/__stories__/LandlineNumber.d.ts +1 -1
- package/inputs/Input/__stories__/MobilePhone.d.ts +1 -1
- package/inputs/Input/__stories__/PhoneNumber.d.ts +1 -1
- package/inputs/Input/__stories__/PostalCode.d.ts +1 -1
- package/inputs/Input/__stories__/String.d.ts +1 -1
- package/inputs/Input/__stories__/StringWithTrimValidation.d.ts +3 -0
- package/inputs/Input/__stories__/TextWithLimit.d.ts +1 -1
- package/inputs/Input/index.d.ts +2 -1
- package/inputs/Input/index.js +12 -4
- package/inputs/Input/index.js.map +2 -2
- package/inputs/Label/Label.stories.d.ts +2 -0
- package/inputs/Label/__stories__/Default.d.ts +1 -1
- package/inputs/Label/index.d.ts +0 -2
- package/inputs/Label/index.js +2 -2
- package/inputs/Label/index.js.map +2 -2
- package/inputs/OtpInput/OtpInput.stories.d.ts +2 -0
- package/inputs/OtpInput/__stories__/Default.d.ts +1 -1
- package/inputs/OtpInput/index.js +1 -0
- package/inputs/OtpInput/index.js.map +2 -2
- package/inputs/Radio/Radio.stories.d.ts +2 -0
- package/inputs/Radio/__stories__/Conditional.d.ts +1 -1
- package/inputs/Radio/__stories__/Default.d.ts +1 -1
- package/inputs/Radio/__stories__/WithDivider.d.ts +1 -1
- package/inputs/Radio/index.d.ts +1 -1
- package/inputs/Radio/index.js +8 -5
- package/inputs/Radio/index.js.map +2 -2
- package/inputs/Select/Select.stories.d.ts +2 -0
- package/inputs/Select/__stories__/Default.d.ts +1 -1
- package/inputs/Select/index.d.ts +3 -2
- package/inputs/Select/index.js +13 -4
- package/inputs/Select/index.js.map +2 -2
- package/inputs/inputsScenarios/index.js +6 -12
- package/inputs/inputsScenarios.d.ts +1 -1
- package/inputs/inputsScenarios.js.map +2 -2
- package/lazy/index.js +77 -67
- package/locales/el.js.map +1 -1
- package/package.json +8 -8
- package/registry/index.js +116 -107
- package/src/Field/ErrorGroup.tsx +84 -0
- package/src/Field/FieldBase.tsx +39 -24
- package/src/Field/FieldBaseContainer.tsx +70 -47
- package/src/Field/FieldConditional.tsx +6 -2
- package/src/Field/doc.mdx +207 -0
- package/src/Field/index.tsx +20 -5
- package/src/Field/types.tsx +42 -29
- package/src/Field/utils/index.ts +8 -0
- package/src/Field/utils/useField.ts +14 -2
- package/src/FieldArray/FieldArray.stories.js +1 -0
- package/src/FieldArray/FormDialog.tsx +565 -0
- package/src/FieldArray/__stories__/Default.tsx +2 -1
- package/src/FieldArray/__stories__/WithExactLength.tsx +2 -1
- package/src/FieldArray/__stories__/WithModal.tsx +160 -0
- package/src/FieldArray/index.test.tsx +8 -0
- package/src/FieldArray/index.tsx +119 -54
- package/src/FieldObject/index.tsx +41 -20
- package/src/Fieldset/index.tsx +5 -5
- package/src/Fieldset/types.tsx +2 -2
- package/src/FormBuilder/FormBuilder.stories.js +5 -0
- package/src/FormBuilder/__stories__/AutoErrorGrouping.tsx +63 -0
- package/src/FormBuilder/__stories__/Default.tsx +1 -1
- package/src/FormBuilder/__stories__/ErrorGrouping.tsx +43 -0
- package/src/FormBuilder/{FormBuilder.mdx → doc.mdx} +27 -35
- package/src/FormBuilder/index.test.tsx +12 -0
- package/src/FormBuilder/index.tsx +104 -14
- package/src/FormBuilder/interaction.test.tsx +40 -0
- package/src/FormBuilder/scenarios.test.tsx +1002 -130
- package/src/FormContext.tsx +5 -2
- package/src/MultiplicityField/MultiplicityField.stories.js +3 -0
- package/src/MultiplicityField/__stories__/Default.tsx +1 -1
- package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +1 -1
- package/src/MultiplicityField/__stories__/WithExactLength.tsx +1 -1
- package/src/MultiplicityField/__stories__/WithMaxLength.tsx +1 -1
- package/src/MultiplicityField/__stories__/WithMinAndMaxLength.tsx +1 -1
- package/src/MultiplicityField/__stories__/WithMinLength.tsx +1 -1
- package/src/MultiplicityField/add-objects.tsx +11 -9
- package/src/MultiplicityField/{MultiplicityField.mdx → doc.mdx} +112 -98
- package/src/MultiplicityField/index.test.tsx +4 -0
- package/src/MultiplicityField/index.tsx +17 -12
- package/src/MultiplicityField/types.ts +2 -2
- package/src/Questions/Questions.stories.js +3 -0
- package/src/Questions/Questions.tsx +4 -4
- package/src/Questions/Step/StepArrayReview.tsx +1 -1
- package/src/Questions/Step/StepTitle.tsx +4 -3
- package/src/Questions/__snapshots__/index.spec.tsx.snap +11 -5
- package/src/Questions/__stories__/Default.tsx +1 -1
- package/src/Questions/{index.mdx → doc.mdx} +30 -53
- package/src/Questions/index.spec.tsx +14 -2
- package/src/Questions/index.test.tsx +4 -0
- package/src/create-simple-form.mdx +2 -6
- package/src/{index.mdx → doc.mdx} +29 -18
- package/src/inputs/AutoCompleteInput/AutoComplete.stories.js +3 -0
- package/src/inputs/AutoCompleteInput/__stories__/Default.tsx +3 -11
- package/src/inputs/AutoCompleteInput/__stories__/Multiple.tsx +2 -8
- package/src/inputs/AutoCompleteInput/{index.mdx → doc.mdx} +2 -13
- package/src/inputs/AutoCompleteInput/index.test.tsx +4 -0
- package/src/inputs/AutoCompleteInput/index.tsx +32 -28
- package/src/inputs/Checkboxes/Checkboxes.stories.js +3 -0
- package/src/inputs/Checkboxes/__stories__/Conditional.tsx +1 -1
- package/src/inputs/Checkboxes/__stories__/Default.tsx +1 -1
- package/src/inputs/Checkboxes/__stories__/WithDivider.tsx +1 -1
- package/src/inputs/Checkboxes/{index.mdx → doc.mdx} +5 -15
- package/src/inputs/Checkboxes/index.test.tsx +4 -0
- package/src/inputs/Checkboxes/index.tsx +28 -28
- package/src/inputs/DateInput/DateInput.stories.js +7 -0
- package/src/inputs/DateInput/__stories__/Default.tsx +8 -13
- package/src/inputs/DateInput/__stories__/WithDefaultValue.tsx +26 -0
- package/src/inputs/DateInput/__stories__/WithInitialValue.tsx +28 -0
- package/src/inputs/DateInput/__stories__/WithWrongDefaultValue.tsx +26 -0
- package/src/inputs/DateInput/__stories__/WithWrongInitialValue.tsx +28 -0
- package/src/inputs/DateInput/{index.mdx → doc.mdx} +1 -8
- package/src/inputs/DateInput/index.test.tsx +20 -0
- package/src/inputs/DateInput/index.tsx +58 -21
- package/src/inputs/DateTimeInput/DateTimeInput.stories.js +14 -0
- package/src/inputs/DateTimeInput/__stories__/Default.tsx +25 -0
- package/src/inputs/DateTimeInput/__stories__/WithDefaultValue.tsx +26 -0
- package/src/inputs/DateTimeInput/__stories__/WithInitialValue.tsx +28 -0
- package/src/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.tsx +26 -0
- package/src/inputs/DateTimeInput/__stories__/WithWrongInitialValue.tsx +28 -0
- package/src/inputs/DateTimeInput/doc.mdx +16 -0
- package/src/inputs/DateTimeInput/index.test.tsx +40 -0
- package/src/inputs/DateTimeInput/index.tsx +233 -0
- package/src/inputs/FileInput/FileInput.stories.js +4 -0
- package/src/inputs/FileInput/__stories__/Default.tsx +1 -1
- package/src/inputs/FileInput/__stories__/WithBorderAndLink.tsx +34 -0
- package/src/inputs/FileInput/{index.mdx → doc.mdx} +1 -5
- package/src/inputs/FileInput/index.test.tsx +8 -0
- package/src/inputs/FileInput/index.tsx +106 -41
- package/src/inputs/ImageInput/ImageInput.stories.js +5 -2
- package/src/inputs/ImageInput/__stories__/Default.tsx +1 -1
- package/src/inputs/ImageInput/__stories__/MaxSize.tsx +5 -4
- package/src/inputs/ImageInput/__stories__/{WithInvalidImageSize.tsx → WithInitialValues.tsx} +12 -3
- package/src/inputs/ImageInput/__stories__/WithInvalidImageDimension.tsx +3 -1
- package/src/inputs/ImageInput/__stories__/logo.d.ts +4 -0
- package/src/inputs/ImageInput/__stories__/logo.png +0 -0
- package/src/inputs/ImageInput/doc.mdx +23 -0
- package/src/inputs/ImageInput/index.test.tsx +8 -4
- package/src/inputs/ImageInput/index.tsx +103 -50
- package/src/inputs/Input/Input.stories.js +6 -0
- package/src/inputs/Input/__stories__/AFM.tsx +1 -1
- package/src/inputs/Input/__stories__/AMKA.tsx +23 -0
- package/src/inputs/Input/__stories__/Boolean.tsx +1 -1
- package/src/inputs/Input/__stories__/Email.tsx +23 -0
- package/src/inputs/Input/__stories__/IBAN.tsx +1 -1
- package/src/inputs/Input/__stories__/Integer.tsx +1 -1
- package/src/inputs/Input/__stories__/LandlineNumber.tsx +3 -2
- package/src/inputs/Input/__stories__/MobilePhone.tsx +2 -1
- package/src/inputs/Input/__stories__/PhoneNumber.tsx +2 -1
- package/src/inputs/Input/__stories__/PostalCode.tsx +2 -1
- package/src/inputs/Input/__stories__/String.tsx +1 -1
- package/src/inputs/Input/__stories__/StringWithTrimValidation.tsx +26 -0
- package/src/inputs/Input/__stories__/TextWithLimit.tsx +2 -1
- package/src/inputs/Input/doc.mdx +56 -0
- package/src/inputs/Input/index.test.tsx +16 -0
- package/src/inputs/Input/index.tsx +30 -12
- package/src/inputs/Label/Label.stories.js +3 -0
- package/src/inputs/Label/__stories__/Default.tsx +1 -1
- package/src/inputs/Label/doc.mdx +14 -0
- package/src/inputs/Label/index.test.tsx +4 -0
- package/src/inputs/Label/index.tsx +2 -6
- package/src/inputs/OtpInput/OtpInput.stories.js +3 -0
- package/src/inputs/OtpInput/__stories__/Default.tsx +1 -1
- package/src/inputs/OtpInput/{index.mdx → doc.mdx} +1 -8
- package/src/inputs/OtpInput/index.test.tsx +4 -0
- package/src/inputs/OtpInput/index.tsx +3 -1
- package/src/inputs/Radio/Radio.stories.js +3 -0
- package/src/inputs/Radio/__stories__/Conditional.tsx +1 -1
- package/src/inputs/Radio/__stories__/Default.tsx +1 -1
- package/src/inputs/Radio/__stories__/WithDivider.tsx +1 -1
- package/src/inputs/Radio/{index.mdx → doc.mdx} +5 -15
- package/src/inputs/Radio/index.test.tsx +4 -0
- package/src/inputs/Radio/index.tsx +59 -56
- package/src/inputs/Select/Select.stories.js +3 -0
- package/src/inputs/Select/__stories__/Default.tsx +1 -1
- package/src/inputs/Select/{index.mdx → doc.mdx} +1 -5
- package/src/inputs/Select/index.test.tsx +4 -0
- package/src/inputs/Select/index.tsx +18 -7
- package/src/inputs/inputsScenarios.ts +36 -42
- package/src/installation.mdx +2 -5
- package/src/lazy.js +77 -64
- package/src/locales/el.ts +1 -1
- package/src/registry.js +108 -100
- package/src/types.tsx +4 -3
- package/src/utils.ts +29 -8
- package/src/validators/index.ts +103 -91
- package/src/validators/utils/amka.ts +39 -0
- package/src/validators/utils/date.ts +131 -0
- package/src/validators/utils/datetime.ts +222 -0
- package/src/validators/utils/file.ts +33 -17
- package/src/validators/utils/index.ts +6 -1
- package/src/validators/utils/int.ts +1 -1
- package/src/validators/utils/number.ts +1 -1
- package/src/validators/utils/phone.ts +1 -1
- package/src/validators/utils/postal_code.ts +1 -1
- package/src/validators/utils/uuid4.ts +2 -1
- package/src/validators/validators.spec.ts +3 -3
- package/types.d.ts +4 -3
- package/types.js.map +1 -1
- package/utils/index.js +22 -7
- package/utils.d.ts +2 -0
- package/utils.js.map +2 -2
- package/validators/index.d.ts +1 -1
- package/validators/index.js +63 -86
- package/validators/index.js.map +2 -2
- package/validators/utils/amka/index.js +36 -0
- package/{FieldArray/FieldArray.stories → validators/utils/amka}/package.json +1 -1
- package/validators/utils/amka.d.ts +6 -0
- package/validators/utils/amka.js.map +7 -0
- package/validators/utils/date/index.js +126 -0
- package/validators/utils/date/package.json +6 -0
- package/validators/utils/date.d.ts +9 -0
- package/validators/utils/date.js.map +7 -0
- package/validators/utils/datetime/index.js +210 -0
- package/validators/utils/datetime/package.json +6 -0
- package/validators/utils/datetime.d.ts +9 -0
- package/validators/utils/datetime.js.map +7 -0
- package/validators/utils/file/index.js +30 -17
- package/validators/utils/file.js.map +2 -2
- package/validators/utils/index.d.ts +3 -0
- package/validators/utils/index.js +6 -1
- package/validators/utils/index.js.map +2 -2
- package/validators/utils/int/index.js +1 -1
- package/validators/utils/int.js.map +2 -2
- package/validators/utils/number/index.js +1 -1
- package/validators/utils/number.js.map +2 -2
- package/validators/utils/phone.d.ts +1 -1
- package/validators/utils/phone.js.map +2 -2
- package/validators/utils/postal_code.d.ts +1 -1
- package/validators/utils/postal_code.js.map +1 -1
- package/validators/utils/uuid4.js.map +2 -2
- package/FieldArray/FieldArray.stories/index.js +0 -14
- package/FieldArray/FieldArray.stories.js.map +0 -7
- package/FieldArray/__stories__/Default/index.js +0 -95
- package/FieldArray/__stories__/Default/package.json +0 -6
- package/FieldArray/__stories__/Default.js.map +0 -7
- package/FieldArray/__stories__/WithExactLength/index.js +0 -95
- package/FieldArray/__stories__/WithExactLength/package.json +0 -6
- package/FieldArray/__stories__/WithExactLength.js.map +0 -7
- package/Form.stories/index.js +0 -7
- package/Form.stories.js.map +0 -7
- package/FormBuilder/FormBuilder.stories/index.js +0 -12
- package/FormBuilder/FormBuilder.stories/package.json +0 -6
- package/FormBuilder/FormBuilder.stories.js.map +0 -7
- package/FormBuilder/__stories__/Default/index.js +0 -32
- package/FormBuilder/__stories__/Default/package.json +0 -6
- package/FormBuilder/__stories__/Default.js.map +0 -7
- package/MultiplicityField/MultiplicityField.stories/index.js +0 -22
- package/MultiplicityField/MultiplicityField.stories/package.json +0 -6
- package/MultiplicityField/MultiplicityField.stories.js.map +0 -7
- package/MultiplicityField/__stories__/Default/index.js +0 -100
- package/MultiplicityField/__stories__/Default/package.json +0 -6
- package/MultiplicityField/__stories__/Default.js.map +0 -7
- package/MultiplicityField/__stories__/PreviewDisplay/index.js +0 -70
- package/MultiplicityField/__stories__/PreviewDisplay/package.json +0 -6
- package/MultiplicityField/__stories__/PreviewDisplay.js.map +0 -7
- package/MultiplicityField/__stories__/WithExactLength/index.js +0 -97
- package/MultiplicityField/__stories__/WithExactLength/package.json +0 -6
- package/MultiplicityField/__stories__/WithExactLength.js.map +0 -7
- package/MultiplicityField/__stories__/WithMaxLength/index.js +0 -100
- package/MultiplicityField/__stories__/WithMaxLength/package.json +0 -6
- package/MultiplicityField/__stories__/WithMaxLength.js.map +0 -7
- package/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +0 -101
- package/MultiplicityField/__stories__/WithMinAndMaxLength/package.json +0 -6
- package/MultiplicityField/__stories__/WithMinAndMaxLength.js.map +0 -7
- package/MultiplicityField/__stories__/WithMinLength/index.js +0 -100
- package/MultiplicityField/__stories__/WithMinLength/package.json +0 -6
- package/MultiplicityField/__stories__/WithMinLength.js.map +0 -7
- package/Questions/Questions.stories/index.js +0 -12
- package/Questions/Questions.stories.js.map +0 -7
- package/Questions/__stories__/Default/index.js +0 -108
- package/Questions/__stories__/Default/package.json +0 -6
- package/Questions/__stories__/Default.js.map +0 -7
- package/cjs/FieldArray/FieldArray.stories/index.js +0 -48
- package/cjs/FieldArray/FieldArray.stories.js.map +0 -7
- package/cjs/FieldArray/__stories__/Default/index.js +0 -128
- package/cjs/FieldArray/__stories__/Default.js.map +0 -7
- package/cjs/FieldArray/__stories__/WithExactLength/index.js +0 -128
- package/cjs/FieldArray/__stories__/WithExactLength.js.map +0 -7
- package/cjs/Form.stories/index.js +0 -26
- package/cjs/Form.stories.js.map +0 -7
- package/cjs/FormBuilder/FormBuilder.stories/index.js +0 -45
- package/cjs/FormBuilder/FormBuilder.stories.js.map +0 -7
- package/cjs/FormBuilder/__stories__/Default/index.js +0 -65
- package/cjs/FormBuilder/__stories__/Default.js.map +0 -7
- package/cjs/MultiplicityField/MultiplicityField.stories/index.js +0 -60
- package/cjs/MultiplicityField/MultiplicityField.stories.js.map +0 -7
- package/cjs/MultiplicityField/__stories__/Default/index.js +0 -133
- package/cjs/MultiplicityField/__stories__/Default.js.map +0 -7
- package/cjs/MultiplicityField/__stories__/PreviewDisplay/index.js +0 -86
- package/cjs/MultiplicityField/__stories__/PreviewDisplay.js.map +0 -7
- package/cjs/MultiplicityField/__stories__/WithExactLength/index.js +0 -130
- package/cjs/MultiplicityField/__stories__/WithExactLength.js.map +0 -7
- package/cjs/MultiplicityField/__stories__/WithMaxLength/index.js +0 -133
- package/cjs/MultiplicityField/__stories__/WithMaxLength.js.map +0 -7
- package/cjs/MultiplicityField/__stories__/WithMinAndMaxLength/index.js +0 -134
- package/cjs/MultiplicityField/__stories__/WithMinAndMaxLength.js.map +0 -7
- package/cjs/MultiplicityField/__stories__/WithMinLength/index.js +0 -133
- package/cjs/MultiplicityField/__stories__/WithMinLength.js.map +0 -7
- package/cjs/Questions/Questions.stories/index.js +0 -45
- package/cjs/Questions/Questions.stories.js.map +0 -7
- package/cjs/Questions/__stories__/Default/index.js +0 -136
- package/cjs/Questions/__stories__/Default.js.map +0 -7
- package/cjs/inputs/AutoCompleteInput/AutoComplete.stories/index.js +0 -48
- package/cjs/inputs/AutoCompleteInput/AutoComplete.stories.js.map +0 -7
- package/cjs/inputs/AutoCompleteInput/__stories__/Default/index.js +0 -83
- package/cjs/inputs/AutoCompleteInput/__stories__/Default.js.map +0 -7
- package/cjs/inputs/AutoCompleteInput/__stories__/Multiple/index.js +0 -83
- package/cjs/inputs/AutoCompleteInput/__stories__/Multiple.js.map +0 -7
- package/cjs/inputs/Checkboxes/Checkboxes.stories/index.js +0 -51
- package/cjs/inputs/Checkboxes/Checkboxes.stories.js.map +0 -7
- package/cjs/inputs/Checkboxes/__stories__/Conditional/index.js +0 -133
- package/cjs/inputs/Checkboxes/__stories__/Conditional.js.map +0 -7
- package/cjs/inputs/Checkboxes/__stories__/Default/index.js +0 -77
- package/cjs/inputs/Checkboxes/__stories__/Default.js.map +0 -7
- package/cjs/inputs/Checkboxes/__stories__/WithDivider/index.js +0 -78
- package/cjs/inputs/Checkboxes/__stories__/WithDivider.js.map +0 -7
- package/cjs/inputs/DateInput/DateInput.stories/index.js +0 -45
- package/cjs/inputs/DateInput/DateInput.stories.js.map +0 -7
- package/cjs/inputs/DateInput/__stories__/Default/index.js +0 -61
- package/cjs/inputs/DateInput/__stories__/Default.js.map +0 -7
- package/cjs/inputs/FileInput/FileInput.stories/index.js +0 -45
- package/cjs/inputs/FileInput/FileInput.stories.js.map +0 -7
- package/cjs/inputs/FileInput/__stories__/Default/index.js +0 -61
- package/cjs/inputs/FileInput/__stories__/Default.js.map +0 -7
- package/cjs/inputs/ImageInput/ImageInput.stories/index.js +0 -51
- package/cjs/inputs/ImageInput/ImageInput.stories.js.map +0 -7
- package/cjs/inputs/ImageInput/__stories__/Default/index.js +0 -63
- package/cjs/inputs/ImageInput/__stories__/Default.js.map +0 -7
- package/cjs/inputs/ImageInput/__stories__/MaxSize/index.js +0 -69
- package/cjs/inputs/ImageInput/__stories__/MaxSize.js.map +0 -7
- package/cjs/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +0 -71
- package/cjs/inputs/ImageInput/__stories__/WithInvalidImageDimension.js.map +0 -7
- package/cjs/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +0 -68
- package/cjs/inputs/ImageInput/__stories__/WithInvalidImageSize.js.map +0 -7
- package/cjs/inputs/Input/Input.stories/index.js +0 -72
- package/cjs/inputs/Input/Input.stories.js.map +0 -7
- package/cjs/inputs/Input/__stories__/AFM/index.js +0 -63
- package/cjs/inputs/Input/__stories__/AFM.js.map +0 -7
- package/cjs/inputs/Input/__stories__/Boolean/index.js +0 -64
- package/cjs/inputs/Input/__stories__/Boolean.js.map +0 -7
- package/cjs/inputs/Input/__stories__/IBAN/index.js +0 -64
- package/cjs/inputs/Input/__stories__/IBAN.js.map +0 -7
- package/cjs/inputs/Input/__stories__/Integer/index.js +0 -78
- package/cjs/inputs/Input/__stories__/Integer.js.map +0 -7
- package/cjs/inputs/Input/__stories__/LandlineNumber/index.js +0 -67
- package/cjs/inputs/Input/__stories__/LandlineNumber.js.map +0 -7
- package/cjs/inputs/Input/__stories__/MobilePhone/index.js +0 -67
- package/cjs/inputs/Input/__stories__/MobilePhone.js.map +0 -7
- package/cjs/inputs/Input/__stories__/PhoneNumber/index.js +0 -66
- package/cjs/inputs/Input/__stories__/PhoneNumber.js.map +0 -7
- package/cjs/inputs/Input/__stories__/PostalCode/index.js +0 -64
- package/cjs/inputs/Input/__stories__/PostalCode.js.map +0 -7
- package/cjs/inputs/Input/__stories__/String/index.js +0 -64
- package/cjs/inputs/Input/__stories__/String.js.map +0 -7
- package/cjs/inputs/Input/__stories__/TextWithLimit/index.js +0 -64
- package/cjs/inputs/Input/__stories__/TextWithLimit.js.map +0 -7
- package/cjs/inputs/Input/inputsInputScenarios/index.js +0 -439
- package/cjs/inputs/Input/inputsInputScenarios.js.map +0 -7
- package/cjs/inputs/Label/Label.stories/index.js +0 -45
- package/cjs/inputs/Label/Label.stories.js.map +0 -7
- package/cjs/inputs/Label/__stories__/Default/index.js +0 -72
- package/cjs/inputs/Label/__stories__/Default.js.map +0 -7
- package/cjs/inputs/OtpInput/OtpInput.stories/index.js +0 -45
- package/cjs/inputs/OtpInput/OtpInput.stories.js.map +0 -7
- package/cjs/inputs/OtpInput/__stories__/Default/index.js +0 -64
- package/cjs/inputs/OtpInput/__stories__/Default.js.map +0 -7
- package/cjs/inputs/Radio/Radio.stories/index.js +0 -51
- package/cjs/inputs/Radio/Radio.stories.js.map +0 -7
- package/cjs/inputs/Radio/__stories__/Conditional/index.js +0 -133
- package/cjs/inputs/Radio/__stories__/Conditional.js.map +0 -7
- package/cjs/inputs/Radio/__stories__/Default/index.js +0 -81
- package/cjs/inputs/Radio/__stories__/Default.js.map +0 -7
- package/cjs/inputs/Radio/__stories__/WithDivider/index.js +0 -82
- package/cjs/inputs/Radio/__stories__/WithDivider.js.map +0 -7
- package/cjs/inputs/Select/Select.stories/index.js +0 -45
- package/cjs/inputs/Select/Select.stories.js.map +0 -7
- package/cjs/inputs/Select/__stories__/Default/index.js +0 -86
- package/cjs/inputs/Select/__stories__/Default.js.map +0 -7
- package/inputs/AutoCompleteInput/AutoComplete.stories/index.js +0 -14
- package/inputs/AutoCompleteInput/AutoComplete.stories/package.json +0 -6
- package/inputs/AutoCompleteInput/AutoComplete.stories.js.map +0 -7
- package/inputs/AutoCompleteInput/__stories__/Default/index.js +0 -50
- package/inputs/AutoCompleteInput/__stories__/Default/package.json +0 -6
- package/inputs/AutoCompleteInput/__stories__/Default.js.map +0 -7
- package/inputs/AutoCompleteInput/__stories__/Multiple/index.js +0 -50
- package/inputs/AutoCompleteInput/__stories__/Multiple/package.json +0 -6
- package/inputs/AutoCompleteInput/__stories__/Multiple.js.map +0 -7
- package/inputs/Checkboxes/Checkboxes.stories/index.js +0 -16
- package/inputs/Checkboxes/Checkboxes.stories/package.json +0 -6
- package/inputs/Checkboxes/Checkboxes.stories.js.map +0 -7
- package/inputs/Checkboxes/__stories__/Conditional/index.js +0 -100
- package/inputs/Checkboxes/__stories__/Conditional/package.json +0 -6
- package/inputs/Checkboxes/__stories__/Conditional.js.map +0 -7
- package/inputs/Checkboxes/__stories__/Default/index.js +0 -44
- package/inputs/Checkboxes/__stories__/Default/package.json +0 -6
- package/inputs/Checkboxes/__stories__/Default.js.map +0 -7
- package/inputs/Checkboxes/__stories__/WithDivider/index.js +0 -45
- package/inputs/Checkboxes/__stories__/WithDivider/package.json +0 -6
- package/inputs/Checkboxes/__stories__/WithDivider.js.map +0 -7
- package/inputs/DateInput/DateInput.stories/index.js +0 -12
- package/inputs/DateInput/DateInput.stories/package.json +0 -6
- package/inputs/DateInput/DateInput.stories.js.map +0 -7
- package/inputs/DateInput/__stories__/Default/index.js +0 -28
- package/inputs/DateInput/__stories__/Default.js.map +0 -7
- package/inputs/FileInput/FileInput.stories/index.js +0 -12
- package/inputs/FileInput/FileInput.stories/package.json +0 -6
- package/inputs/FileInput/FileInput.stories.js.map +0 -7
- package/inputs/FileInput/__stories__/Default/index.js +0 -28
- package/inputs/FileInput/__stories__/Default/package.json +0 -6
- package/inputs/FileInput/__stories__/Default.js.map +0 -7
- package/inputs/ImageInput/ImageInput.stories/index.js +0 -16
- package/inputs/ImageInput/ImageInput.stories/package.json +0 -6
- package/inputs/ImageInput/ImageInput.stories.js.map +0 -7
- package/inputs/ImageInput/__stories__/Default/index.js +0 -30
- package/inputs/ImageInput/__stories__/Default/package.json +0 -6
- package/inputs/ImageInput/__stories__/Default.js.map +0 -7
- package/inputs/ImageInput/__stories__/MaxSize/index.js +0 -36
- package/inputs/ImageInput/__stories__/MaxSize/package.json +0 -6
- package/inputs/ImageInput/__stories__/MaxSize.js.map +0 -7
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension/index.js +0 -38
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension/package.json +0 -6
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension.js.map +0 -7
- package/inputs/ImageInput/__stories__/WithInvalidImageSize/index.js +0 -35
- package/inputs/ImageInput/__stories__/WithInvalidImageSize/package.json +0 -6
- package/inputs/ImageInput/__stories__/WithInvalidImageSize.d.ts +0 -3
- package/inputs/ImageInput/__stories__/WithInvalidImageSize.js.map +0 -7
- package/inputs/Input/Input.stories/index.js +0 -30
- package/inputs/Input/Input.stories.js.map +0 -7
- package/inputs/Input/__stories__/AFM/index.js +0 -30
- package/inputs/Input/__stories__/AFM/package.json +0 -6
- package/inputs/Input/__stories__/AFM.js.map +0 -7
- package/inputs/Input/__stories__/Boolean/index.js +0 -31
- package/inputs/Input/__stories__/Boolean/package.json +0 -6
- package/inputs/Input/__stories__/Boolean.js.map +0 -7
- package/inputs/Input/__stories__/IBAN/index.js +0 -31
- package/inputs/Input/__stories__/IBAN/package.json +0 -6
- package/inputs/Input/__stories__/IBAN.js.map +0 -7
- package/inputs/Input/__stories__/Integer/index.js +0 -45
- package/inputs/Input/__stories__/Integer/package.json +0 -6
- package/inputs/Input/__stories__/Integer.js.map +0 -7
- package/inputs/Input/__stories__/LandlineNumber/index.js +0 -34
- package/inputs/Input/__stories__/LandlineNumber/package.json +0 -6
- package/inputs/Input/__stories__/LandlineNumber.js.map +0 -7
- package/inputs/Input/__stories__/MobilePhone/index.js +0 -34
- package/inputs/Input/__stories__/MobilePhone/package.json +0 -6
- package/inputs/Input/__stories__/MobilePhone.js.map +0 -7
- package/inputs/Input/__stories__/PhoneNumber/index.js +0 -33
- package/inputs/Input/__stories__/PhoneNumber/package.json +0 -6
- package/inputs/Input/__stories__/PhoneNumber.js.map +0 -7
- package/inputs/Input/__stories__/PostalCode/index.js +0 -31
- package/inputs/Input/__stories__/PostalCode/package.json +0 -6
- package/inputs/Input/__stories__/PostalCode.js.map +0 -7
- package/inputs/Input/__stories__/String/index.js +0 -31
- package/inputs/Input/__stories__/String/package.json +0 -6
- package/inputs/Input/__stories__/String.js.map +0 -7
- package/inputs/Input/__stories__/TextWithLimit/index.js +0 -31
- package/inputs/Input/__stories__/TextWithLimit/package.json +0 -6
- package/inputs/Input/__stories__/TextWithLimit.js.map +0 -7
- package/inputs/Input/inputsInputScenarios/index.js +0 -406
- package/inputs/Input/inputsInputScenarios/package.json +0 -6
- package/inputs/Input/inputsInputScenarios.d.ts +0 -57
- package/inputs/Input/inputsInputScenarios.js.map +0 -7
- package/inputs/Label/Label.stories/index.js +0 -12
- package/inputs/Label/Label.stories/package.json +0 -6
- package/inputs/Label/Label.stories.js.map +0 -7
- package/inputs/Label/__stories__/Default/index.js +0 -39
- package/inputs/Label/__stories__/Default/package.json +0 -6
- package/inputs/Label/__stories__/Default.js.map +0 -7
- package/inputs/OtpInput/OtpInput.stories/index.js +0 -12
- package/inputs/OtpInput/OtpInput.stories/package.json +0 -6
- package/inputs/OtpInput/OtpInput.stories.js.map +0 -7
- package/inputs/OtpInput/__stories__/Default/index.js +0 -31
- package/inputs/OtpInput/__stories__/Default/package.json +0 -6
- package/inputs/OtpInput/__stories__/Default.js.map +0 -7
- package/inputs/Radio/Radio.stories/index.js +0 -16
- package/inputs/Radio/Radio.stories/package.json +0 -6
- package/inputs/Radio/Radio.stories.js.map +0 -7
- package/inputs/Radio/__stories__/Conditional/index.js +0 -100
- package/inputs/Radio/__stories__/Conditional/package.json +0 -6
- package/inputs/Radio/__stories__/Conditional.js.map +0 -7
- package/inputs/Radio/__stories__/Default/index.js +0 -48
- package/inputs/Radio/__stories__/Default/package.json +0 -6
- package/inputs/Radio/__stories__/Default.js.map +0 -7
- package/inputs/Radio/__stories__/WithDivider/index.js +0 -49
- package/inputs/Radio/__stories__/WithDivider/package.json +0 -6
- package/inputs/Radio/__stories__/WithDivider.js.map +0 -7
- package/inputs/Select/Select.stories/index.js +0 -12
- package/inputs/Select/Select.stories/package.json +0 -6
- package/inputs/Select/Select.stories.js.map +0 -7
- package/inputs/Select/__stories__/Default/index.js +0 -53
- package/inputs/Select/__stories__/Default/package.json +0 -6
- package/inputs/Select/__stories__/Default.js.map +0 -7
- package/lazy.d.ts +0 -77
- package/lazy.js.map +0 -7
- package/registry.d.ts +0 -70
- package/registry.js.map +0 -7
- package/src/Field/index.mdx +0 -6
- package/src/inputs/ImageInput/index.mdx +0 -19
- package/src/inputs/Input/index.mdx +0 -95
- package/src/inputs/Input/inputsInputScenarios.ts +0 -405
- package/src/inputs/Label/index.mdx +0 -0
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
import React, { LegacyRef, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
ErrorOption,
|
|
4
|
+
useFieldArray,
|
|
5
|
+
UseFieldArrayMove,
|
|
6
|
+
UseFormReturn,
|
|
7
|
+
useWatch,
|
|
8
|
+
} from 'react-hook-form';
|
|
9
|
+
import { FieldProps } from '@digigov/form/Field/types';
|
|
10
|
+
import { FieldObject } from '@digigov/form/FieldObject';
|
|
11
|
+
import { Fieldset } from '@digigov/form/Fieldset';
|
|
12
|
+
import {
|
|
13
|
+
Modal,
|
|
14
|
+
ModalAction,
|
|
15
|
+
ModalContent,
|
|
16
|
+
ModalHeading,
|
|
17
|
+
useModal,
|
|
18
|
+
} from '@digigov/ui/app/Modal';
|
|
19
|
+
import {
|
|
20
|
+
Table,
|
|
21
|
+
TableBody,
|
|
22
|
+
TableContainer,
|
|
23
|
+
TableDataCell,
|
|
24
|
+
TableHead,
|
|
25
|
+
TableHeadCell,
|
|
26
|
+
TableRow,
|
|
27
|
+
} from '@digigov/ui/content';
|
|
28
|
+
import { Button } from '@digigov/ui/form/Button';
|
|
29
|
+
import { StackProps, Grid, Stack } from '@digigov/ui/layouts';
|
|
30
|
+
import Heading from '@digigov/ui/typography/Heading';
|
|
31
|
+
import { Hint } from '@digigov/ui/typography/Hint';
|
|
32
|
+
|
|
33
|
+
export interface FormDialogProps extends FieldProps {
|
|
34
|
+
control: UseFormReturn['control'];
|
|
35
|
+
trigger: UseFormReturn['trigger'];
|
|
36
|
+
register: UseFormReturn['register'];
|
|
37
|
+
clearErrors: UseFormReturn['clearErrors'];
|
|
38
|
+
formState: UseFormReturn['formState'];
|
|
39
|
+
error?: ErrorOption;
|
|
40
|
+
getValues: UseFormReturn['getValues'];
|
|
41
|
+
setValue: UseFormReturn['setValue'];
|
|
42
|
+
reset: UseFormReturn['reset'];
|
|
43
|
+
resetField?: UseFormReturn['resetField'];
|
|
44
|
+
sortable: boolean;
|
|
45
|
+
Field: React.FC<FieldProps>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface DialogProps {
|
|
49
|
+
name: string;
|
|
50
|
+
heading: string;
|
|
51
|
+
actions: React.ReactNode;
|
|
52
|
+
children: React.ReactNode;
|
|
53
|
+
registerModal: (any) => {};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const FormDialog: React.FC<FormDialogProps> = React.forwardRef(
|
|
57
|
+
function FormDialog(
|
|
58
|
+
{
|
|
59
|
+
name,
|
|
60
|
+
trigger,
|
|
61
|
+
register,
|
|
62
|
+
control,
|
|
63
|
+
formState,
|
|
64
|
+
error,
|
|
65
|
+
getValues,
|
|
66
|
+
Field,
|
|
67
|
+
reset,
|
|
68
|
+
sortable,
|
|
69
|
+
...customField
|
|
70
|
+
},
|
|
71
|
+
ref
|
|
72
|
+
) {
|
|
73
|
+
const [isAppending, setIsAppending] = useState(false);
|
|
74
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
75
|
+
const { fields, append, remove, update, move } = useFieldArray({
|
|
76
|
+
control,
|
|
77
|
+
name,
|
|
78
|
+
});
|
|
79
|
+
const { open, close, registerModal } = useModal();
|
|
80
|
+
const currentLength = fields.length > 0 ? fields.length - 1 : fields.length;
|
|
81
|
+
const currentName = isAppending
|
|
82
|
+
? `${name}.${currentLength}`
|
|
83
|
+
: `${name}.${currentIndex}`;
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (isAppending) {
|
|
86
|
+
setCurrentIndex(currentLength);
|
|
87
|
+
open(`modal-${name}`);
|
|
88
|
+
}
|
|
89
|
+
}, [isAppending]);
|
|
90
|
+
|
|
91
|
+
const valuesRef = useRef(null);
|
|
92
|
+
if (!error) {
|
|
93
|
+
const values = getValues(currentName);
|
|
94
|
+
if (typeof values === 'object') {
|
|
95
|
+
valuesRef.current = { ...values };
|
|
96
|
+
} else {
|
|
97
|
+
valuesRef.current = values;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const values = getValues(name);
|
|
101
|
+
const ofField = {
|
|
102
|
+
...customField.extra?.of,
|
|
103
|
+
name: currentName,
|
|
104
|
+
};
|
|
105
|
+
const defaultValue = getValues(currentName) || ofField.defaultValue;
|
|
106
|
+
const noValuesCommitted =
|
|
107
|
+
fields.length === 0 || (fields.length === 1 && isAppending);
|
|
108
|
+
const titleNumber = customField.extra?.label.object.titleNumbering
|
|
109
|
+
? `${currentLength + 1}`
|
|
110
|
+
: '';
|
|
111
|
+
return (
|
|
112
|
+
<>
|
|
113
|
+
{noValuesCommitted && (
|
|
114
|
+
<Hint {...customField.extra?.label.object?.nothing_added_props}>
|
|
115
|
+
{customField.extra?.label.object?.nothing_added}
|
|
116
|
+
</Hint>
|
|
117
|
+
)}
|
|
118
|
+
<ArrayItemModal
|
|
119
|
+
title={
|
|
120
|
+
customField.extra?.label.object.title &&
|
|
121
|
+
`${customField.extra?.label.object.title} ${titleNumber}`
|
|
122
|
+
}
|
|
123
|
+
hint={customField.label?.secondary}
|
|
124
|
+
name={name}
|
|
125
|
+
defaultValue={defaultValue}
|
|
126
|
+
currentName={currentName}
|
|
127
|
+
editOrAppend={async () => {
|
|
128
|
+
const hasNoErrors = await trigger(
|
|
129
|
+
ofField.type === 'object'
|
|
130
|
+
? ofField.extra.fields.map(({ key }) => `${currentName}.${key}`)
|
|
131
|
+
: currentName
|
|
132
|
+
);
|
|
133
|
+
if (!hasNoErrors) {
|
|
134
|
+
update(currentIndex, valuesRef.current);
|
|
135
|
+
}
|
|
136
|
+
if (hasNoErrors) {
|
|
137
|
+
const newValues = getValues(currentName);
|
|
138
|
+
if (isAppending) {
|
|
139
|
+
setIsAppending(false);
|
|
140
|
+
}
|
|
141
|
+
if (newValues === '') {
|
|
142
|
+
remove(currentIndex);
|
|
143
|
+
} else {
|
|
144
|
+
update(currentIndex, newValues);
|
|
145
|
+
}
|
|
146
|
+
close();
|
|
147
|
+
}
|
|
148
|
+
}}
|
|
149
|
+
cancel={() => {
|
|
150
|
+
if (isAppending) {
|
|
151
|
+
setIsAppending(false);
|
|
152
|
+
remove(currentIndex);
|
|
153
|
+
close();
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
update(currentIndex, valuesRef.current);
|
|
157
|
+
reset(undefined, {
|
|
158
|
+
keepTouched: true,
|
|
159
|
+
keepDefaultValues: true,
|
|
160
|
+
keepIsValid: true,
|
|
161
|
+
keepIsSubmitted: true,
|
|
162
|
+
keepValues: true,
|
|
163
|
+
});
|
|
164
|
+
close();
|
|
165
|
+
}}
|
|
166
|
+
type={isAppending ? 'append' : 'edit'}
|
|
167
|
+
appendLabel={customField.extra?.label.object.append.label}
|
|
168
|
+
appendProps={customField.extra?.label.object.append.props}
|
|
169
|
+
editLabel={customField.extra?.label.object.edit.label}
|
|
170
|
+
editProps={customField.extra?.label.object.edit.props}
|
|
171
|
+
cancelLabel={customField.extra?.label.object.cancel.label}
|
|
172
|
+
cancelProps={customField.extra?.label.object.cancel.props}
|
|
173
|
+
control={control}
|
|
174
|
+
{...registerModal(`modal-${name}`)}
|
|
175
|
+
>
|
|
176
|
+
<Fieldset>
|
|
177
|
+
{ofField?.type === 'object' ? (
|
|
178
|
+
<FieldObject
|
|
179
|
+
defaultValue={defaultValue || undefined}
|
|
180
|
+
error={error && error[currentIndex]}
|
|
181
|
+
formState={formState}
|
|
182
|
+
register={register}
|
|
183
|
+
control={control}
|
|
184
|
+
{...ofField}
|
|
185
|
+
key={currentName}
|
|
186
|
+
Field={Field}
|
|
187
|
+
/>
|
|
188
|
+
) : (
|
|
189
|
+
<Field
|
|
190
|
+
name={currentName}
|
|
191
|
+
{...ofField}
|
|
192
|
+
error={error && error[currentIndex]}
|
|
193
|
+
key={currentName}
|
|
194
|
+
/>
|
|
195
|
+
)}
|
|
196
|
+
</Fieldset>
|
|
197
|
+
</ArrayItemModal>
|
|
198
|
+
{!noValuesCommitted && (
|
|
199
|
+
<TableContainer {...customField.extra?.tableContainer}>
|
|
200
|
+
<Table
|
|
201
|
+
ref={ref as LegacyRef<HTMLTableElement>}
|
|
202
|
+
verticalAlign={customField.extra?.verticalAlign}
|
|
203
|
+
>
|
|
204
|
+
{!customField.extra?.noHeader &&
|
|
205
|
+
!noValuesCommitted &&
|
|
206
|
+
ofField?.extra &&
|
|
207
|
+
values?.length > 0 && (
|
|
208
|
+
<ArrayItemHeader
|
|
209
|
+
labels={
|
|
210
|
+
ofField.type === 'object'
|
|
211
|
+
? ofField.extra.fields.map(({ label }) => label.primary)
|
|
212
|
+
: [ofField.label.primary]
|
|
213
|
+
}
|
|
214
|
+
disabled={customField?.editable === false}
|
|
215
|
+
/>
|
|
216
|
+
)}
|
|
217
|
+
<TableBody>
|
|
218
|
+
{!noValuesCommitted &&
|
|
219
|
+
values?.map?.((field, index) => {
|
|
220
|
+
return (
|
|
221
|
+
<ArrayItemDisplay
|
|
222
|
+
key={index}
|
|
223
|
+
name={`${name}.${index}`}
|
|
224
|
+
index={index}
|
|
225
|
+
isFirst={index === 0}
|
|
226
|
+
isLast={index === values.length - 1}
|
|
227
|
+
data={field}
|
|
228
|
+
edit={() => {
|
|
229
|
+
setCurrentIndex(index);
|
|
230
|
+
open(`modal-${name}`);
|
|
231
|
+
}}
|
|
232
|
+
stackProps={customField?.extra?.stackProps}
|
|
233
|
+
wordBreak={customField?.extra?.wordBreak}
|
|
234
|
+
valueDisplay={customField?.extra?.valueDisplay}
|
|
235
|
+
remove={() => {
|
|
236
|
+
remove(index);
|
|
237
|
+
}}
|
|
238
|
+
border={customField.extra?.border}
|
|
239
|
+
move={move}
|
|
240
|
+
sortable={sortable}
|
|
241
|
+
disabledEdit={
|
|
242
|
+
sortable ? true : (customField.extra?.noEdit ?? false)
|
|
243
|
+
}
|
|
244
|
+
disabledDelete={customField.extra?.noDelete ?? false}
|
|
245
|
+
disabled={customField?.editable === false}
|
|
246
|
+
/>
|
|
247
|
+
);
|
|
248
|
+
})}
|
|
249
|
+
</TableBody>
|
|
250
|
+
</Table>
|
|
251
|
+
</TableContainer>
|
|
252
|
+
)}
|
|
253
|
+
{customField.extra?.editVariant !== 'display' && (
|
|
254
|
+
<div
|
|
255
|
+
className={
|
|
256
|
+
customField.extra?.label.object?.addButtonVariant === 'link'
|
|
257
|
+
? 'px-2 py-2 bg-gray-200 border-t border-b border-gray-400'
|
|
258
|
+
: ''
|
|
259
|
+
}
|
|
260
|
+
>
|
|
261
|
+
<Button
|
|
262
|
+
type="button"
|
|
263
|
+
name={`${name}-add-object`}
|
|
264
|
+
color="secondary"
|
|
265
|
+
variant={customField.extra?.label.object?.addButtonVariant}
|
|
266
|
+
onClick={(ev) => {
|
|
267
|
+
ev.preventDefault();
|
|
268
|
+
if (customField?.extra?.of?.type === 'object') {
|
|
269
|
+
append({});
|
|
270
|
+
} else {
|
|
271
|
+
append('');
|
|
272
|
+
}
|
|
273
|
+
setCurrentIndex(currentLength + 1);
|
|
274
|
+
setIsAppending(true);
|
|
275
|
+
}}
|
|
276
|
+
disabled={
|
|
277
|
+
customField?.editable === false ||
|
|
278
|
+
customField.extra?.editVariant === 'noinput' ||
|
|
279
|
+
fields.length >= (customField.extra?.max ?? Number.MAX_VALUE)
|
|
280
|
+
}
|
|
281
|
+
>
|
|
282
|
+
{customField.extra?.label.object?.add}
|
|
283
|
+
</Button>
|
|
284
|
+
</div>
|
|
285
|
+
)}
|
|
286
|
+
</>
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
);
|
|
290
|
+
|
|
291
|
+
export const ArrayItemModal = React.forwardRef(function ArrayItemModal(
|
|
292
|
+
{
|
|
293
|
+
type,
|
|
294
|
+
currentName,
|
|
295
|
+
title,
|
|
296
|
+
hint,
|
|
297
|
+
defaultValue,
|
|
298
|
+
editOrAppend,
|
|
299
|
+
cancel,
|
|
300
|
+
control,
|
|
301
|
+
addTitle,
|
|
302
|
+
editLabel,
|
|
303
|
+
editProps,
|
|
304
|
+
appendLabel,
|
|
305
|
+
appendProps,
|
|
306
|
+
cancelLabel,
|
|
307
|
+
cancelProps,
|
|
308
|
+
children,
|
|
309
|
+
...props
|
|
310
|
+
}: {
|
|
311
|
+
type: 'append' | 'edit';
|
|
312
|
+
name: string;
|
|
313
|
+
title?: string;
|
|
314
|
+
hint?: string;
|
|
315
|
+
editOrAppend: () => void;
|
|
316
|
+
cancel: () => void;
|
|
317
|
+
addTitle?: string;
|
|
318
|
+
editLabel?: string;
|
|
319
|
+
editProps?: any;
|
|
320
|
+
appendLabel?: string;
|
|
321
|
+
appendProps?: any;
|
|
322
|
+
cancelLabel?: string;
|
|
323
|
+
cancelProps?: any;
|
|
324
|
+
children: React.ReactNode;
|
|
325
|
+
[key: string]: any;
|
|
326
|
+
},
|
|
327
|
+
ref
|
|
328
|
+
) {
|
|
329
|
+
const value = useWatch({
|
|
330
|
+
control,
|
|
331
|
+
name: currentName,
|
|
332
|
+
defaultValue: defaultValue,
|
|
333
|
+
});
|
|
334
|
+
const disabled = value === undefined || value === null || value === '';
|
|
335
|
+
return (
|
|
336
|
+
<Modal
|
|
337
|
+
{...props}
|
|
338
|
+
ref={ref as LegacyRef<HTMLDivElement>}
|
|
339
|
+
aria-labelledby="modal-label"
|
|
340
|
+
>
|
|
341
|
+
<ModalHeading id="modal-label">
|
|
342
|
+
{title
|
|
343
|
+
? title
|
|
344
|
+
: type === 'edit'
|
|
345
|
+
? 'Επεξεργασία'
|
|
346
|
+
: addTitle || 'Προσθήκη'}
|
|
347
|
+
</ModalHeading>
|
|
348
|
+
<ModalContent>
|
|
349
|
+
{hint && <Hint>{hint}</Hint>}
|
|
350
|
+
{children}
|
|
351
|
+
</ModalContent>
|
|
352
|
+
<ModalAction>
|
|
353
|
+
{type === 'edit' ? (
|
|
354
|
+
<Button
|
|
355
|
+
color="secondary"
|
|
356
|
+
{...editProps}
|
|
357
|
+
type="button"
|
|
358
|
+
onClick={(e) => {
|
|
359
|
+
e.preventDefault();
|
|
360
|
+
editOrAppend();
|
|
361
|
+
}}
|
|
362
|
+
disabled={disabled}
|
|
363
|
+
>
|
|
364
|
+
{editLabel || 'Αποθήκευση'}
|
|
365
|
+
</Button>
|
|
366
|
+
) : (
|
|
367
|
+
<Button
|
|
368
|
+
color="primary"
|
|
369
|
+
{...appendProps}
|
|
370
|
+
type="button"
|
|
371
|
+
onClick={(e) => {
|
|
372
|
+
e.preventDefault();
|
|
373
|
+
editOrAppend();
|
|
374
|
+
}}
|
|
375
|
+
disabled={disabled}
|
|
376
|
+
>
|
|
377
|
+
{appendLabel || 'Προσθήκη'}
|
|
378
|
+
</Button>
|
|
379
|
+
)}
|
|
380
|
+
<Button
|
|
381
|
+
variant="link"
|
|
382
|
+
type="button"
|
|
383
|
+
{...cancelProps}
|
|
384
|
+
onClick={(e) => {
|
|
385
|
+
e.preventDefault();
|
|
386
|
+
cancel();
|
|
387
|
+
}}
|
|
388
|
+
>
|
|
389
|
+
{cancelLabel || 'Ακύρωση'}
|
|
390
|
+
</Button>
|
|
391
|
+
</ModalAction>
|
|
392
|
+
</Modal>
|
|
393
|
+
);
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
export const ArrayItemHeader = ({ labels, disabled }) => {
|
|
397
|
+
return (
|
|
398
|
+
<TableHead>
|
|
399
|
+
<TableRow>
|
|
400
|
+
{labels.map((label, index) => {
|
|
401
|
+
return <TableHeadCell key={index}>{label}</TableHeadCell>;
|
|
402
|
+
})}
|
|
403
|
+
{!disabled && <TableHeadCell>Ενέργειες</TableHeadCell>}
|
|
404
|
+
</TableRow>
|
|
405
|
+
</TableHead>
|
|
406
|
+
);
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
export const ArrayItemDisplay = ({
|
|
410
|
+
name,
|
|
411
|
+
data,
|
|
412
|
+
edit,
|
|
413
|
+
remove,
|
|
414
|
+
disabledEdit,
|
|
415
|
+
disabledDelete,
|
|
416
|
+
disabled,
|
|
417
|
+
sortable,
|
|
418
|
+
index,
|
|
419
|
+
isFirst,
|
|
420
|
+
isLast,
|
|
421
|
+
move,
|
|
422
|
+
valueDisplay,
|
|
423
|
+
border = true,
|
|
424
|
+
wordBreak = 'break-all',
|
|
425
|
+
stackProps = {
|
|
426
|
+
spacing: 4,
|
|
427
|
+
alignItems: 'flex-end',
|
|
428
|
+
justifyContent: 'flex-end',
|
|
429
|
+
direction: 'column',
|
|
430
|
+
},
|
|
431
|
+
}: {
|
|
432
|
+
data: any;
|
|
433
|
+
name: string;
|
|
434
|
+
edit: (name: string) => void;
|
|
435
|
+
remove: (name: string) => void;
|
|
436
|
+
disabledEdit?: boolean;
|
|
437
|
+
disabledDelete?: boolean;
|
|
438
|
+
disabled?: boolean;
|
|
439
|
+
sortable: boolean;
|
|
440
|
+
index: number;
|
|
441
|
+
isFirst: boolean;
|
|
442
|
+
isLast: boolean;
|
|
443
|
+
move: UseFieldArrayMove;
|
|
444
|
+
valueDisplay?: (value) => React.ReactNode;
|
|
445
|
+
border: boolean;
|
|
446
|
+
wordBreak?: 'break-all' | 'none';
|
|
447
|
+
stackProps?: StackProps;
|
|
448
|
+
}) => {
|
|
449
|
+
if (data === undefined || data === null) {
|
|
450
|
+
return null;
|
|
451
|
+
}
|
|
452
|
+
if (
|
|
453
|
+
Object.keys(data).length === 0 ||
|
|
454
|
+
(Object.keys(data).length === 1 && data.id)
|
|
455
|
+
) {
|
|
456
|
+
return null;
|
|
457
|
+
}
|
|
458
|
+
delete data.id;
|
|
459
|
+
const values: (string | Record<string, any>)[] =
|
|
460
|
+
typeof data === 'string' ? [data] : Object.values(data || {});
|
|
461
|
+
const borderVariant = border === false || sortable ? 'none' : 'border';
|
|
462
|
+
return (
|
|
463
|
+
<>
|
|
464
|
+
<TableRow>
|
|
465
|
+
{values?.map?.((value, valueIndex) => {
|
|
466
|
+
return (
|
|
467
|
+
<TableDataCell
|
|
468
|
+
key={valueIndex}
|
|
469
|
+
variant={borderVariant}
|
|
470
|
+
wordBreak={wordBreak}
|
|
471
|
+
pb={sortable ? 0 : undefined}
|
|
472
|
+
pt={sortable ? 4 : undefined}
|
|
473
|
+
>
|
|
474
|
+
{sortable && valueIndex === 0 && (
|
|
475
|
+
<Heading size="sm" className="mb-2">
|
|
476
|
+
Επιλογή #{index + 1}
|
|
477
|
+
</Heading>
|
|
478
|
+
)}
|
|
479
|
+
{(value as Record<string, any>)?.name ||
|
|
480
|
+
(Array.isArray(value)
|
|
481
|
+
? value.join('\n')
|
|
482
|
+
: valueDisplay
|
|
483
|
+
? valueDisplay(value)
|
|
484
|
+
: value) ||
|
|
485
|
+
''}
|
|
486
|
+
</TableDataCell>
|
|
487
|
+
);
|
|
488
|
+
})}
|
|
489
|
+
{disabled === true ||
|
|
490
|
+
(disabledEdit === true && disabledDelete === true) ? null : (
|
|
491
|
+
<TableDataCell variant={borderVariant}>
|
|
492
|
+
<Stack {...stackProps}>
|
|
493
|
+
{disabledEdit !== true && (
|
|
494
|
+
<Button
|
|
495
|
+
variant="link"
|
|
496
|
+
type="button"
|
|
497
|
+
onClick={() => {
|
|
498
|
+
edit(name);
|
|
499
|
+
}}
|
|
500
|
+
>
|
|
501
|
+
Επεξεργασία
|
|
502
|
+
</Button>
|
|
503
|
+
)}
|
|
504
|
+
{disabledDelete !== true && (
|
|
505
|
+
<Button
|
|
506
|
+
variant="link"
|
|
507
|
+
type="button"
|
|
508
|
+
onClick={() => remove(name)}
|
|
509
|
+
>
|
|
510
|
+
Διαγραφή
|
|
511
|
+
</Button>
|
|
512
|
+
)}
|
|
513
|
+
</Stack>
|
|
514
|
+
</TableDataCell>
|
|
515
|
+
)}
|
|
516
|
+
</TableRow>
|
|
517
|
+
{sortable && (
|
|
518
|
+
<TableRow>
|
|
519
|
+
<TableDataCell
|
|
520
|
+
variant={isLast ? 'none' : 'border'}
|
|
521
|
+
colSpan={
|
|
522
|
+
disabled === true ||
|
|
523
|
+
(disabledEdit === true && disabledDelete === true)
|
|
524
|
+
? values.length
|
|
525
|
+
: values.length + 1
|
|
526
|
+
}
|
|
527
|
+
>
|
|
528
|
+
{sortable && !disabled && !(isFirst && isLast) && (
|
|
529
|
+
<Grid xs={12} mt={2}>
|
|
530
|
+
Μετακίνηση{' '}
|
|
531
|
+
{!isFirst && (
|
|
532
|
+
<>
|
|
533
|
+
προς τα{' '}
|
|
534
|
+
<Button
|
|
535
|
+
type="button"
|
|
536
|
+
variant="link"
|
|
537
|
+
onClick={() => move(index, index - 1)}
|
|
538
|
+
>
|
|
539
|
+
πάνω
|
|
540
|
+
</Button>
|
|
541
|
+
</>
|
|
542
|
+
)}
|
|
543
|
+
{!isFirst && !isLast && ' ή '}
|
|
544
|
+
{!isLast && (
|
|
545
|
+
<>
|
|
546
|
+
προς τα{' '}
|
|
547
|
+
<Button
|
|
548
|
+
type="button"
|
|
549
|
+
variant="link"
|
|
550
|
+
onClick={() => move(index, index + 1)}
|
|
551
|
+
>
|
|
552
|
+
κάτω
|
|
553
|
+
</Button>
|
|
554
|
+
</>
|
|
555
|
+
)}
|
|
556
|
+
</Grid>
|
|
557
|
+
)}
|
|
558
|
+
</TableDataCell>
|
|
559
|
+
</TableRow>
|
|
560
|
+
)}
|
|
561
|
+
</>
|
|
562
|
+
);
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
export default FormDialog;
|
|
@@ -15,6 +15,7 @@ const fields = [
|
|
|
15
15
|
{
|
|
16
16
|
key: 'multiplicity',
|
|
17
17
|
type: 'array',
|
|
18
|
+
editable: true,
|
|
18
19
|
label: {
|
|
19
20
|
primary: 'Συνυπογράφοντες',
|
|
20
21
|
secondary: 'Οι συνυπογράφοντες είναι άνθρωποι σαν και εμάς',
|
|
@@ -80,7 +81,7 @@ const fields = [
|
|
|
80
81
|
},
|
|
81
82
|
] as FieldSpec[];
|
|
82
83
|
|
|
83
|
-
export const Default = () => (
|
|
84
|
+
export const Default = (_: any) => (
|
|
84
85
|
<FormBuilder
|
|
85
86
|
onSubmit={(data) => {
|
|
86
87
|
console.log(data);
|
|
@@ -15,6 +15,7 @@ const fields = [
|
|
|
15
15
|
{
|
|
16
16
|
key: 'multiplicity',
|
|
17
17
|
type: 'array',
|
|
18
|
+
editable: true,
|
|
18
19
|
label: {
|
|
19
20
|
primary: 'Συνυπογράφοντες',
|
|
20
21
|
secondary: 'Οι συνυπογράφοντες είναι άνθρωποι σαν και εμάς',
|
|
@@ -80,7 +81,7 @@ const fields = [
|
|
|
80
81
|
},
|
|
81
82
|
] as FieldSpec[];
|
|
82
83
|
|
|
83
|
-
export const WithExactLength = () => (
|
|
84
|
+
export const WithExactLength = (_: any) => (
|
|
84
85
|
<FormBuilder
|
|
85
86
|
onSubmit={(data) => {
|
|
86
87
|
console.log(data);
|