@digigov/form 2.0.0-13876dba → 2.0.0-16fbe090
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.d.ts +4 -4
- package/Field/ErrorGroup.js +53 -0
- package/Field/FieldBase.d.ts +1 -1
- package/Field/FieldBase.js +77 -0
- package/Field/FieldBaseContainer.d.ts +2 -2
- package/Field/FieldBaseContainer.js +43 -0
- package/Field/FieldConditional.d.ts +1 -1
- package/Field/FieldConditional.js +45 -0
- package/Field/index.d.ts +1 -1
- package/Field/index.js +70 -112
- package/Field/types.d.ts +22 -12
- package/Field/types.js +0 -0
- package/Field/utils/evaluateFieldWithConditions.d.ts +2 -2
- package/Field/utils/evaluateFieldWithConditions.js +19 -0
- package/Field/utils/resolveField.d.ts +3 -0
- package/Field/utils/resolveField.js +32 -0
- package/Field/utils/useField.d.ts +1 -1
- package/Field/utils/useField.js +47 -0
- package/FieldArray/BaseFieldArray.d.ts +5 -0
- package/FieldArray/BaseFieldArray.js +46 -0
- package/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay.d.ts +9 -0
- package/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay.js +13 -0
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay.d.ts +26 -0
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay.js +117 -0
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader.d.ts +5 -0
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader.js +6 -0
- package/FieldArray/FormDialog/ArrayDisplay/index.d.ts +15 -0
- package/FieldArray/FormDialog/ArrayDisplay/index.js +32 -0
- package/FieldArray/FormDialog/ArrayEditModal.d.ts +24 -0
- package/FieldArray/FormDialog/ArrayEditModal.js +138 -0
- package/FieldArray/FormDialog/index.d.ts +19 -0
- package/FieldArray/FormDialog/index.js +191 -271
- package/FieldArray/index.d.ts +5 -2
- package/FieldArray/index.js +62 -106
- package/FieldObject/index.d.ts +7 -4
- package/FieldObject/index.js +51 -72
- package/Fieldset/FieldsetWithContext.js +27 -0
- package/Fieldset/index.d.ts +1 -1
- package/Fieldset/index.js +18 -30
- package/Fieldset/types.d.ts +2 -2
- package/Fieldset/types.js +0 -0
- package/FormBuilder/index.d.ts +2 -2
- package/FormBuilder/index.js +233 -231
- package/FormContext.d.ts +3 -2
- package/FormContext.js +7 -0
- package/MultiplicityField/add-objects.d.ts +2 -2
- package/MultiplicityField/add-objects.js +107 -0
- package/MultiplicityField/index.d.ts +2 -2
- package/MultiplicityField/index.js +81 -116
- package/MultiplicityField/types.d.ts +3 -2
- package/MultiplicityField/types.js +0 -0
- package/Questions/Questions.d.ts +1 -1
- package/Questions/Questions.js +48 -0
- package/Questions/QuestionsContext.d.ts +1 -1
- package/Questions/QuestionsContext.js +10 -0
- package/Questions/Step/ReviewStep.js +32 -0
- package/Questions/Step/Step.d.ts +1 -1
- package/Questions/Step/Step.js +39 -0
- package/Questions/Step/StepArrayReview.d.ts +1 -1
- package/Questions/Step/StepArrayReview.js +35 -0
- package/Questions/Step/StepContext.d.ts +1 -1
- package/Questions/Step/StepContext.js +28 -0
- package/Questions/Step/StepDescription.d.ts +1 -1
- package/Questions/Step/StepDescription.js +18 -0
- package/Questions/Step/StepForm.d.ts +2 -2
- package/Questions/Step/StepForm.js +29 -0
- package/Questions/Step/StepQuote.d.ts +1 -1
- package/Questions/Step/StepQuote.js +5 -0
- package/Questions/Step/StepTitle.d.ts +1 -1
- package/Questions/Step/StepTitle.js +25 -0
- package/Questions/Step/getAddMoreFields.d.ts +2 -2
- package/Questions/Step/getAddMoreFields.js +24 -0
- package/Questions/Step/index.d.ts +11 -11
- package/Questions/Step/index.js +13 -16
- package/Questions/Step/types.d.ts +1 -1
- package/Questions/Step/types.js +0 -0
- package/Questions/getNextStep.d.ts +1 -1
- package/Questions/getNextStep.js +13 -0
- package/Questions/index.d.ts +2 -2
- package/Questions/index.js +4 -7
- package/Questions/types.d.ts +1 -1
- package/Questions/types.js +0 -0
- package/hooks/useFieldFocusManager.d.ts +25 -0
- package/hooks/useFieldFocusManager.js +83 -0
- package/hooks/utils.d.ts +18 -0
- package/hooks/utils.js +60 -0
- package/index.d.ts +5 -5
- package/index.js +8 -13
- package/inputs/AutoCompleteInput/index.d.ts +3 -3
- package/inputs/AutoCompleteInput/index.js +38 -62
- package/inputs/Checkboxes/index.d.ts +5 -3
- package/inputs/Checkboxes/index.js +50 -78
- package/inputs/DateInput/index.d.ts +2 -5
- package/inputs/DateInput/index.js +125 -117
- package/inputs/DateTimeInput/index.d.ts +2 -5
- package/inputs/DateTimeInput/index.js +179 -170
- package/inputs/FileInput/index.d.ts +12 -5
- package/inputs/FileInput/index.js +58 -59
- package/inputs/ImageInput/index.d.ts +10 -2
- package/inputs/ImageInput/index.js +84 -53
- package/inputs/Input/index.d.ts +5 -2
- package/inputs/Input/index.js +60 -69
- package/inputs/Label/index.d.ts +1 -1
- package/inputs/Label/index.js +13 -16
- package/inputs/OtpInput/index.d.ts +1 -5
- package/inputs/OtpInput/index.js +117 -141
- package/inputs/Radio/index.d.ts +6 -4
- package/inputs/Radio/index.js +71 -102
- package/inputs/Select/index.d.ts +6 -3
- package/inputs/Select/index.js +23 -31
- package/inputs/index.d.ts +9 -9
- package/inputs/index.js +10 -21
- package/{Field/utils/index.d.ts → inputs/registry.d.ts} +2 -1
- package/inputs/registry.js +80 -0
- package/internal.d.ts +5 -5
- package/internal.js +6 -0
- package/lazy.d.ts +97 -0
- package/lazy.js +163 -0
- package/package.json +12 -12
- package/registry.d.ts +82 -0
- package/registry.js +170 -0
- package/src/Field/ErrorGroup.tsx +4 -4
- package/src/Field/FieldBase.tsx +9 -4
- package/src/Field/FieldBaseContainer.tsx +69 -48
- package/src/Field/FieldConditional.tsx +5 -1
- package/src/Field/index.tsx +27 -37
- package/src/Field/types.tsx +24 -14
- package/src/Field/utils/evaluateFieldWithConditions.ts +5 -2
- package/src/Field/utils/resolveField.ts +58 -0
- package/src/Field/utils/useField.ts +12 -2
- package/src/FieldArray/BaseFieldArray.tsx +97 -0
- package/src/FieldArray/FieldArray.stories.js +1 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay.tsx +45 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/ArrayDisplay.stories.js +14 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay.tsx +337 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader.tsx +15 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/Cards.tsx +88 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/Default.tsx +93 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/ReadOnly.tsx +79 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/ReadOnlyCards.tsx +75 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/Sortable.tsx +93 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/__stories__/SortableCards.tsx +88 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/index.test.tsx +44 -0
- package/src/FieldArray/FormDialog/ArrayDisplay/index.tsx +67 -0
- package/src/FieldArray/FormDialog/ArrayEditModal.tsx +241 -0
- package/src/FieldArray/FormDialog/index.tsx +302 -0
- package/src/FieldArray/__stories__/CardsWithError.tsx +124 -0
- package/src/FieldArray/__stories__/WithModal.tsx +3 -2
- package/src/FieldArray/__tests__/fieldset-multiplicity.spec.tsx +271 -0
- package/src/FieldArray/__tests__/multiplicity-attachment.spec.tsx +280 -0
- package/src/FieldArray/__tests__/multiplicity-optional.spec.tsx +232 -0
- package/src/FieldArray/__tests__/multiplicity-required.spec.tsx +170 -0
- package/src/FieldArray/__tests__/nested-fieldset-multiplicity.spec.tsx +627 -0
- package/src/FieldArray/__tests__/preference-multiple-choice.spec.tsx +222 -0
- package/src/FieldArray/index.spec.tsx +355 -0
- package/src/FieldArray/index.test.tsx +4 -0
- package/src/FieldArray/index.tsx +49 -73
- package/src/FieldObject/index.tsx +36 -31
- package/src/Fieldset/FieldsetWithContext.tsx +1 -1
- package/src/Fieldset/index.tsx +1 -1
- package/src/Fieldset/types.tsx +2 -2
- package/src/FormBuilder/doc.mdx +1 -1
- package/src/FormBuilder/index.tsx +197 -146
- package/src/FormBuilder/scenarios.test.tsx +806 -9
- package/src/FormContext.tsx +7 -2
- package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +1 -3
- package/src/MultiplicityField/add-objects.tsx +14 -21
- package/src/MultiplicityField/index.tsx +6 -2
- package/src/MultiplicityField/types.ts +6 -2
- package/src/Questions/Questions.tsx +2 -2
- package/src/Questions/QuestionsContext.tsx +1 -1
- package/src/Questions/Step/Step.tsx +1 -1
- package/src/Questions/Step/StepArrayReview.tsx +2 -2
- package/src/Questions/Step/StepContext.tsx +1 -1
- package/src/Questions/Step/StepDescription.tsx +2 -1
- package/src/Questions/Step/StepForm.tsx +2 -2
- package/src/Questions/Step/StepQuote.tsx +2 -1
- package/src/Questions/Step/StepTitle.tsx +2 -1
- package/src/Questions/Step/getAddMoreFields.tsx +2 -2
- package/src/Questions/Step/types.tsx +1 -1
- package/src/Questions/getNextStep.tsx +1 -1
- package/src/Questions/types.tsx +1 -1
- package/src/hooks/__tests__/useFieldFocusManager.spec.tsx +1079 -0
- package/src/hooks/__tests__/utils.spec.ts +568 -0
- package/src/hooks/useFieldFocusManager.ts +162 -0
- package/src/hooks/utils.ts +122 -0
- package/src/inputs/AutoCompleteInput/doc.mdx +2 -2
- package/src/inputs/AutoCompleteInput/index.tsx +4 -6
- package/src/inputs/Checkboxes/doc.mdx +3 -3
- package/src/inputs/Checkboxes/index.tsx +98 -91
- package/src/inputs/DateInput/DateInput.stories.js +4 -0
- 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/doc.mdx +1 -1
- package/src/inputs/DateInput/index.test.tsx +16 -0
- package/src/inputs/DateInput/index.tsx +65 -20
- package/src/inputs/DateTimeInput/DateTimeInput.stories.js +9 -6
- 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 +1 -1
- package/src/inputs/DateTimeInput/index.test.tsx +16 -0
- package/src/inputs/DateTimeInput/index.tsx +92 -40
- package/src/inputs/FileInput/FileInput.stories.js +1 -0
- package/src/inputs/FileInput/__stories__/WithBorderAndLink.tsx +34 -0
- package/src/inputs/FileInput/doc.mdx +1 -1
- package/src/inputs/FileInput/index.test.tsx +4 -0
- package/src/inputs/FileInput/index.tsx +83 -47
- package/src/inputs/ImageInput/ImageInput.stories.js +2 -1
- package/src/inputs/ImageInput/__stories__/MaxSize.tsx +2 -1
- package/src/inputs/ImageInput/__stories__/WithInitialValues.tsx +45 -0
- 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 +3 -3
- package/src/inputs/ImageInput/index.test.tsx +21 -17
- package/src/inputs/ImageInput/index.tsx +102 -50
- package/src/inputs/Input/Input.stories.js +3 -0
- package/src/inputs/Input/__stories__/AMKA.tsx +23 -0
- package/src/inputs/Input/__stories__/Email.tsx +23 -0
- package/src/inputs/Input/__stories__/Rate.tsx +25 -0
- package/src/inputs/Input/doc.mdx +10 -10
- package/src/inputs/Input/index.test.tsx +12 -0
- package/src/inputs/Input/index.tsx +19 -10
- package/src/inputs/Label/doc.mdx +1 -1
- package/src/inputs/Label/index.tsx +1 -1
- package/src/inputs/OtpInput/doc.mdx +1 -1
- package/src/inputs/OtpInput/index.tsx +43 -34
- package/src/inputs/Radio/doc.mdx +3 -3
- package/src/inputs/Radio/index.tsx +33 -22
- package/src/inputs/Select/doc.mdx +1 -1
- package/src/inputs/Select/index.tsx +12 -7
- package/src/{Field/utils/index.ts → inputs/registry.ts} +5 -1
- package/{lazy/index.js → src/lazy.ts} +8 -29
- package/{registry/index.js → src/registry.ts} +33 -19
- package/src/types.tsx +14 -5
- package/src/utils.ts +41 -8
- package/src/validators/index.ts +50 -17
- package/src/validators/types.ts +1 -1
- package/src/validators/utils/amka.ts +39 -0
- package/src/validators/utils/date.ts +30 -6
- package/src/validators/utils/datetime.ts +123 -31
- package/src/validators/utils/email.ts +11 -0
- package/src/validators/utils/file.ts +35 -21
- package/src/validators/utils/iban.ts +2 -2
- package/src/validators/utils/image.ts +2 -2
- package/src/validators/utils/index.ts +13 -6
- package/src/validators/utils/int.ts +1 -1
- package/src/validators/utils/number.ts +1 -1
- package/src/validators/utils/otp.ts +2 -2
- package/src/validators/utils/phone.ts +2 -2
- package/src/validators/utils/postal_code.ts +2 -2
- package/src/validators/utils/text_limit.ts +2 -2
- package/types.d.ts +11 -5
- package/types.js +1 -0
- package/utils.d.ts +4 -1
- package/utils.js +56 -0
- package/validators/index.d.ts +6 -6
- package/validators/index.js +112 -139
- package/validators/types.d.ts +1 -1
- package/validators/types.js +0 -0
- package/validators/utils/afm.js +19 -0
- package/validators/utils/amka.d.ts +6 -0
- package/validators/utils/amka.js +27 -0
- package/validators/utils/date.d.ts +3 -3
- package/validators/utils/date.js +95 -0
- package/validators/utils/datetime.d.ts +3 -3
- package/validators/utils/datetime.js +121 -0
- package/validators/utils/email.d.ts +5 -0
- package/validators/utils/email.js +10 -0
- package/validators/utils/file.d.ts +2 -2
- package/validators/utils/file.js +31 -0
- package/validators/utils/iban.d.ts +2 -2
- package/validators/utils/iban.js +104 -0
- package/validators/utils/image.d.ts +2 -2
- package/validators/utils/image.js +65 -0
- package/validators/utils/index.d.ts +14 -13
- package/validators/utils/index.js +59 -90
- package/validators/utils/int.d.ts +1 -1
- package/validators/utils/int.js +13 -0
- package/validators/utils/number.d.ts +1 -1
- package/validators/utils/number.js +12 -0
- package/validators/utils/otp.d.ts +2 -2
- package/validators/utils/otp.js +21 -0
- package/validators/utils/phone.d.ts +2 -2
- package/validators/utils/phone.js +198 -0
- package/validators/utils/postal_code.d.ts +2 -2
- package/validators/utils/postal_code.js +18 -0
- package/validators/utils/text_limit.d.ts +2 -2
- package/validators/utils/text_limit.js +34 -0
- package/validators/utils/uuid4.js +14 -0
- package/Field/ErrorGroup/index.js +0 -48
- package/Field/ErrorGroup/package.json +0 -6
- package/Field/ErrorGroup.js.map +0 -7
- package/Field/FieldBase/index.js +0 -117
- package/Field/FieldBase/package.json +0 -6
- package/Field/FieldBase.js.map +0 -7
- package/Field/FieldBaseContainer/index.js +0 -33
- package/Field/FieldBaseContainer/package.json +0 -6
- package/Field/FieldBaseContainer.js.map +0 -7
- package/Field/FieldConditional/index.js +0 -85
- package/Field/FieldConditional/package.json +0 -6
- package/Field/FieldConditional.js.map +0 -7
- package/Field/index.js.map +0 -7
- package/Field/package.json +0 -6
- package/Field/types/index.js +0 -1
- package/Field/types/package.json +0 -6
- package/Field/types.js.map +0 -7
- package/Field/utils/calculateField/index.js +0 -27
- package/Field/utils/calculateField/package.json +0 -6
- package/Field/utils/calculateField.d.ts +0 -2
- package/Field/utils/calculateField.js.map +0 -7
- package/Field/utils/evaluateFieldWithConditions/index.js +0 -26
- package/Field/utils/evaluateFieldWithConditions/package.json +0 -6
- package/Field/utils/evaluateFieldWithConditions.js.map +0 -7
- package/Field/utils/index.js +0 -84
- package/Field/utils/index.js.map +0 -7
- package/Field/utils/package.json +0 -6
- package/Field/utils/useField/index.js +0 -57
- package/Field/utils/useField/package.json +0 -6
- package/Field/utils/useField.js.map +0 -7
- package/FieldArray/FieldArray.stories.d.ts +0 -10
- package/FieldArray/FormDialog/package.json +0 -6
- package/FieldArray/FormDialog.d.ts +0 -53
- package/FieldArray/FormDialog.js.map +0 -7
- package/FieldArray/__stories__/Default.d.ts +0 -2
- package/FieldArray/__stories__/WithExactLength.d.ts +0 -2
- package/FieldArray/__stories__/WithModal.d.ts +0 -2
- package/FieldArray/index.js.map +0 -7
- package/FieldArray/index.test.d.ts +0 -1
- package/FieldArray/package.json +0 -6
- package/FieldObject/index.js.map +0 -7
- package/FieldObject/package.json +0 -6
- package/Fieldset/FieldsetWithContext/index.js +0 -31
- package/Fieldset/FieldsetWithContext/package.json +0 -6
- package/Fieldset/FieldsetWithContext.js.map +0 -7
- package/Fieldset/index.js.map +0 -7
- package/Fieldset/package.json +0 -6
- package/Fieldset/types/index.js +0 -1
- package/Fieldset/types/package.json +0 -6
- package/Fieldset/types.js.map +0 -7
- package/Form.stories.d.ts +0 -4
- package/FormBuilder/FormBuilder.stories.d.ts +0 -12
- package/FormBuilder/__stories__/AutoErrorGrouping.d.ts +0 -3
- package/FormBuilder/__stories__/Default.d.ts +0 -3
- package/FormBuilder/__stories__/ErrorGrouping.d.ts +0 -3
- package/FormBuilder/index.js.map +0 -7
- package/FormBuilder/index.test.d.ts +0 -1
- package/FormBuilder/interaction.test.d.ts +0 -1
- package/FormBuilder/package.json +0 -6
- package/FormBuilder/scenarios.test.d.ts +0 -88
- package/FormContext/index.js +0 -9
- package/FormContext/package.json +0 -6
- package/FormContext.js.map +0 -7
- package/MultiplicityField/MultiplicityField.stories.d.ts +0 -15
- package/MultiplicityField/__stories__/Default.d.ts +0 -2
- package/MultiplicityField/__stories__/PreviewDisplay.d.ts +0 -2
- package/MultiplicityField/__stories__/WithExactLength.d.ts +0 -2
- package/MultiplicityField/__stories__/WithMaxLength.d.ts +0 -2
- package/MultiplicityField/__stories__/WithMinAndMaxLength.d.ts +0 -2
- package/MultiplicityField/__stories__/WithMinLength.d.ts +0 -2
- package/MultiplicityField/add-objects/index.js +0 -153
- package/MultiplicityField/add-objects/package.json +0 -6
- package/MultiplicityField/add-objects.js.map +0 -7
- package/MultiplicityField/index.js.map +0 -7
- package/MultiplicityField/index.test.d.ts +0 -1
- package/MultiplicityField/package.json +0 -6
- package/MultiplicityField/types/index.js +0 -1
- package/MultiplicityField/types/package.json +0 -6
- package/MultiplicityField/types.js.map +0 -7
- package/Questions/Questions/index.js +0 -67
- package/Questions/Questions/package.json +0 -6
- package/Questions/Questions.js.map +0 -7
- package/Questions/Questions.stories.d.ts +0 -10
- package/Questions/QuestionsContext/index.js +0 -11
- package/Questions/QuestionsContext/package.json +0 -6
- package/Questions/QuestionsContext.js.map +0 -7
- package/Questions/Step/ReviewStep/index.js +0 -38
- package/Questions/Step/ReviewStep/package.json +0 -6
- package/Questions/Step/ReviewStep.js.map +0 -7
- package/Questions/Step/Step/index.js +0 -54
- package/Questions/Step/Step/package.json +0 -6
- package/Questions/Step/Step.js.map +0 -7
- package/Questions/Step/StepArrayReview/index.js +0 -42
- package/Questions/Step/StepArrayReview/package.json +0 -6
- package/Questions/Step/StepArrayReview.js.map +0 -7
- package/Questions/Step/StepContext/index.js +0 -23
- package/Questions/Step/StepContext/package.json +0 -6
- package/Questions/Step/StepContext.js.map +0 -7
- package/Questions/Step/StepDescription/index.js +0 -24
- package/Questions/Step/StepDescription/package.json +0 -6
- package/Questions/Step/StepDescription.js.map +0 -7
- package/Questions/Step/StepForm/index.js +0 -34
- package/Questions/Step/StepForm/package.json +0 -6
- package/Questions/Step/StepForm.js.map +0 -7
- package/Questions/Step/StepQuote/index.js +0 -11
- package/Questions/Step/StepQuote/package.json +0 -6
- package/Questions/Step/StepQuote.js.map +0 -7
- package/Questions/Step/StepTitle/index.js +0 -44
- package/Questions/Step/StepTitle/package.json +0 -6
- package/Questions/Step/StepTitle.js.map +0 -7
- package/Questions/Step/getAddMoreFields/index.js +0 -29
- package/Questions/Step/getAddMoreFields/package.json +0 -6
- package/Questions/Step/getAddMoreFields.js.map +0 -7
- package/Questions/Step/index.js.map +0 -7
- package/Questions/Step/package.json +0 -6
- package/Questions/Step/types/index.js +0 -1
- package/Questions/Step/types/package.json +0 -6
- package/Questions/Step/types.js.map +0 -7
- package/Questions/__stories__/Default.d.ts +0 -3
- package/Questions/getNextStep/index.js +0 -22
- package/Questions/getNextStep/package.json +0 -6
- package/Questions/getNextStep.js.map +0 -7
- package/Questions/index.js.map +0 -7
- package/Questions/index.spec.d.ts +0 -1
- package/Questions/index.test.d.ts +0 -1
- package/Questions/package.json +0 -6
- package/Questions/types/index.js +0 -1
- package/Questions/types/package.json +0 -6
- package/Questions/types.js.map +0 -7
- package/cjs/Field/ErrorGroup/index.js +0 -82
- package/cjs/Field/ErrorGroup.js.map +0 -7
- package/cjs/Field/FieldBase/index.js +0 -150
- package/cjs/Field/FieldBase.js.map +0 -7
- package/cjs/Field/FieldBaseContainer/index.js +0 -66
- package/cjs/Field/FieldBaseContainer.js.map +0 -7
- package/cjs/Field/FieldConditional/index.js +0 -118
- package/cjs/Field/FieldConditional.js.map +0 -7
- package/cjs/Field/index.js +0 -144
- package/cjs/Field/index.js.map +0 -7
- package/cjs/Field/types/index.js +0 -16
- package/cjs/Field/types.js.map +0 -7
- package/cjs/Field/utils/calculateField/index.js +0 -50
- package/cjs/Field/utils/calculateField.js.map +0 -7
- package/cjs/Field/utils/evaluateFieldWithConditions/index.js +0 -49
- package/cjs/Field/utils/evaluateFieldWithConditions.js.map +0 -7
- package/cjs/Field/utils/index.js +0 -119
- package/cjs/Field/utils/index.js.map +0 -7
- package/cjs/Field/utils/useField/index.js +0 -80
- package/cjs/Field/utils/useField.js.map +0 -7
- package/cjs/FieldArray/FormDialog/index.js +0 -301
- package/cjs/FieldArray/FormDialog.js.map +0 -7
- package/cjs/FieldArray/index.js +0 -143
- package/cjs/FieldArray/index.js.map +0 -7
- package/cjs/FieldObject/index.js +0 -106
- package/cjs/FieldObject/index.js.map +0 -7
- package/cjs/Fieldset/FieldsetWithContext/index.js +0 -59
- package/cjs/Fieldset/FieldsetWithContext.js.map +0 -7
- package/cjs/Fieldset/index.js +0 -66
- package/cjs/Fieldset/index.js.map +0 -7
- package/cjs/Fieldset/types/index.js +0 -16
- package/cjs/Fieldset/types.js.map +0 -7
- package/cjs/FormBuilder/index.js +0 -273
- package/cjs/FormBuilder/index.js.map +0 -7
- package/cjs/FormContext/index.js +0 -32
- package/cjs/FormContext.js.map +0 -7
- package/cjs/MultiplicityField/add-objects/index.js +0 -181
- package/cjs/MultiplicityField/add-objects.js.map +0 -7
- package/cjs/MultiplicityField/index.js +0 -150
- package/cjs/MultiplicityField/index.js.map +0 -7
- package/cjs/MultiplicityField/types/index.js +0 -16
- package/cjs/MultiplicityField/types.js.map +0 -7
- package/cjs/Questions/Questions/index.js +0 -100
- package/cjs/Questions/Questions.js.map +0 -7
- package/cjs/Questions/QuestionsContext/index.js +0 -34
- package/cjs/Questions/QuestionsContext.js.map +0 -7
- package/cjs/Questions/Step/ReviewStep/index.js +0 -65
- package/cjs/Questions/Step/ReviewStep.js.map +0 -7
- package/cjs/Questions/Step/Step/index.js +0 -87
- package/cjs/Questions/Step/Step.js.map +0 -7
- package/cjs/Questions/Step/StepArrayReview/index.js +0 -67
- package/cjs/Questions/Step/StepArrayReview.js.map +0 -7
- package/cjs/Questions/Step/StepContext/index.js +0 -46
- package/cjs/Questions/Step/StepContext.js.map +0 -7
- package/cjs/Questions/Step/StepDescription/index.js +0 -58
- package/cjs/Questions/Step/StepDescription.js.map +0 -7
- package/cjs/Questions/Step/StepForm/index.js +0 -67
- package/cjs/Questions/Step/StepForm.js.map +0 -7
- package/cjs/Questions/Step/StepQuote/index.js +0 -44
- package/cjs/Questions/Step/StepQuote.js.map +0 -7
- package/cjs/Questions/Step/StepTitle/index.js +0 -76
- package/cjs/Questions/Step/StepTitle.js.map +0 -7
- package/cjs/Questions/Step/getAddMoreFields/index.js +0 -52
- package/cjs/Questions/Step/getAddMoreFields.js.map +0 -7
- package/cjs/Questions/Step/index.js +0 -59
- package/cjs/Questions/Step/index.js.map +0 -7
- package/cjs/Questions/Step/types/index.js +0 -16
- package/cjs/Questions/Step/types.js.map +0 -7
- package/cjs/Questions/getNextStep/index.js +0 -45
- package/cjs/Questions/getNextStep.js.map +0 -7
- package/cjs/Questions/index.js +0 -31
- package/cjs/Questions/index.js.map +0 -7
- package/cjs/Questions/types/index.js +0 -16
- package/cjs/Questions/types.js.map +0 -7
- package/cjs/index.js +0 -49
- package/cjs/index.js.map +0 -7
- package/cjs/inputs/AutoCompleteInput/index.js +0 -98
- package/cjs/inputs/AutoCompleteInput/index.js.map +0 -7
- package/cjs/inputs/Checkboxes/index.js +0 -107
- package/cjs/inputs/Checkboxes/index.js.map +0 -7
- package/cjs/inputs/DateInput/index.js +0 -156
- package/cjs/inputs/DateInput/index.js.map +0 -7
- package/cjs/inputs/DateTimeInput/index.js +0 -211
- package/cjs/inputs/DateTimeInput/index.js.map +0 -7
- package/cjs/inputs/FileInput/index.js +0 -95
- package/cjs/inputs/FileInput/index.js.map +0 -7
- package/cjs/inputs/ImageInput/index.js +0 -99
- package/cjs/inputs/ImageInput/index.js.map +0 -7
- package/cjs/inputs/Input/index.js +0 -111
- package/cjs/inputs/Input/index.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/index.js +0 -50
- package/cjs/inputs/Label/index.js.map +0 -7
- package/cjs/inputs/OtpInput/index.js +0 -181
- package/cjs/inputs/OtpInput/index.js.map +0 -7
- package/cjs/inputs/Radio/index.js +0 -134
- package/cjs/inputs/Radio/index.js.map +0 -7
- package/cjs/inputs/Select/index.js +0 -62
- package/cjs/inputs/Select/index.js.map +0 -7
- package/cjs/inputs/index.js +0 -62
- package/cjs/inputs/index.js.map +0 -7
- package/cjs/inputs/inputsScenarios/index.js +0 -533
- package/cjs/inputs/inputsScenarios.js.map +0 -7
- package/cjs/internal/index.js +0 -38
- package/cjs/internal.js.map +0 -7
- package/cjs/lazy/index.js +0 -110
- package/cjs/lazy.js.map +0 -7
- package/cjs/locales/el/index.js +0 -35
- package/cjs/locales/el.js.map +0 -7
- package/cjs/registry/index.js +0 -195
- package/cjs/registry.js.map +0 -7
- package/cjs/types/index.js +0 -22
- package/cjs/types.js.map +0 -7
- package/cjs/utils/index.js +0 -83
- package/cjs/utils.js.map +0 -7
- package/cjs/validators/index.js +0 -160
- package/cjs/validators/index.js.map +0 -7
- package/cjs/validators/types/index.js +0 -16
- package/cjs/validators/types.js.map +0 -7
- package/cjs/validators/utils/afm/index.js +0 -55
- package/cjs/validators/utils/afm.js.map +0 -7
- package/cjs/validators/utils/date/index.js +0 -138
- package/cjs/validators/utils/date.js.map +0 -7
- package/cjs/validators/utils/datetime/index.js +0 -151
- package/cjs/validators/utils/datetime.js.map +0 -7
- package/cjs/validators/utils/file/index.js +0 -48
- package/cjs/validators/utils/file.js.map +0 -7
- package/cjs/validators/utils/iban/index.js +0 -142
- package/cjs/validators/utils/iban.js.map +0 -7
- package/cjs/validators/utils/image/index.js +0 -102
- package/cjs/validators/utils/image.js.map +0 -7
- package/cjs/validators/utils/index.js +0 -144
- package/cjs/validators/utils/index.js.map +0 -7
- package/cjs/validators/utils/int/index.js +0 -48
- package/cjs/validators/utils/int.js.map +0 -7
- package/cjs/validators/utils/number/index.js +0 -44
- package/cjs/validators/utils/number.js.map +0 -7
- package/cjs/validators/utils/otp/index.js +0 -54
- package/cjs/validators/utils/otp.js.map +0 -7
- package/cjs/validators/utils/phone/index.js +0 -198
- package/cjs/validators/utils/phone.js.map +0 -7
- package/cjs/validators/utils/postal_code/index.js +0 -54
- package/cjs/validators/utils/postal_code.js.map +0 -7
- package/cjs/validators/utils/text_limit/index.js +0 -69
- package/cjs/validators/utils/text_limit.js.map +0 -7
- package/cjs/validators/utils/uuid4/index.js +0 -46
- package/cjs/validators/utils/uuid4.js.map +0 -7
- package/index.js.map +0 -7
- package/inputs/AutoCompleteInput/AutoComplete.stories.d.ts +0 -11
- package/inputs/AutoCompleteInput/__stories__/Default.d.ts +0 -3
- package/inputs/AutoCompleteInput/__stories__/Multiple.d.ts +0 -3
- package/inputs/AutoCompleteInput/index.js.map +0 -7
- package/inputs/AutoCompleteInput/index.test.d.ts +0 -1
- package/inputs/AutoCompleteInput/package.json +0 -6
- package/inputs/Checkboxes/Checkboxes.stories.d.ts +0 -12
- package/inputs/Checkboxes/__stories__/Conditional.d.ts +0 -3
- package/inputs/Checkboxes/__stories__/Default.d.ts +0 -3
- package/inputs/Checkboxes/__stories__/WithDivider.d.ts +0 -3
- package/inputs/Checkboxes/index.js.map +0 -7
- package/inputs/Checkboxes/index.test.d.ts +0 -1
- package/inputs/Checkboxes/package.json +0 -6
- package/inputs/DateInput/DateInput.stories.d.ts +0 -10
- package/inputs/DateInput/__stories__/Default.d.ts +0 -3
- package/inputs/DateInput/index.js.map +0 -7
- package/inputs/DateInput/index.test.d.ts +0 -1
- package/inputs/DateInput/package.json +0 -6
- package/inputs/DateTimeInput/DateTimeInput.stories.d.ts +0 -9
- package/inputs/DateTimeInput/__stories__/Default.d.ts +0 -3
- package/inputs/DateTimeInput/index.js.map +0 -7
- package/inputs/DateTimeInput/index.test.d.ts +0 -1
- package/inputs/DateTimeInput/package.json +0 -6
- package/inputs/FileInput/FileInput.stories.d.ts +0 -10
- package/inputs/FileInput/__stories__/Default.d.ts +0 -3
- package/inputs/FileInput/index.js.map +0 -7
- package/inputs/FileInput/index.test.d.ts +0 -1
- package/inputs/FileInput/package.json +0 -6
- package/inputs/ImageInput/ImageInput.stories.d.ts +0 -12
- package/inputs/ImageInput/__stories__/Default.d.ts +0 -3
- package/inputs/ImageInput/__stories__/MaxSize.d.ts +0 -3
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension.d.ts +0 -3
- package/inputs/ImageInput/index.js.map +0 -7
- package/inputs/ImageInput/index.test.d.ts +0 -1
- package/inputs/ImageInput/package.json +0 -6
- package/inputs/Input/Input.stories.d.ts +0 -20
- package/inputs/Input/__stories__/AFM.d.ts +0 -3
- package/inputs/Input/__stories__/Boolean.d.ts +0 -3
- package/inputs/Input/__stories__/IBAN.d.ts +0 -3
- package/inputs/Input/__stories__/Integer.d.ts +0 -3
- package/inputs/Input/__stories__/LandlineNumber.d.ts +0 -3
- package/inputs/Input/__stories__/MobilePhone.d.ts +0 -3
- package/inputs/Input/__stories__/PhoneNumber.d.ts +0 -3
- package/inputs/Input/__stories__/PostalCode.d.ts +0 -3
- package/inputs/Input/__stories__/String.d.ts +0 -3
- package/inputs/Input/__stories__/StringWithTrimValidation.d.ts +0 -3
- package/inputs/Input/__stories__/TextWithLimit.d.ts +0 -3
- package/inputs/Input/index.js.map +0 -7
- package/inputs/Input/index.test.d.ts +0 -1
- 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/Input/package.json +0 -6
- package/inputs/Label/Label.stories.d.ts +0 -10
- package/inputs/Label/__stories__/Default.d.ts +0 -3
- package/inputs/Label/index.js.map +0 -7
- package/inputs/Label/index.test.d.ts +0 -1
- package/inputs/Label/package.json +0 -6
- package/inputs/OtpInput/OtpInput.stories.d.ts +0 -10
- package/inputs/OtpInput/__stories__/Default.d.ts +0 -3
- package/inputs/OtpInput/index.js.map +0 -7
- package/inputs/OtpInput/index.test.d.ts +0 -1
- package/inputs/OtpInput/package.json +0 -6
- package/inputs/Radio/Radio.stories.d.ts +0 -12
- package/inputs/Radio/__stories__/Conditional.d.ts +0 -3
- package/inputs/Radio/__stories__/Default.d.ts +0 -3
- package/inputs/Radio/__stories__/WithDivider.d.ts +0 -3
- package/inputs/Radio/index.js.map +0 -7
- package/inputs/Radio/index.test.d.ts +0 -1
- package/inputs/Radio/package.json +0 -6
- package/inputs/Select/Select.stories.d.ts +0 -10
- package/inputs/Select/__stories__/Default.d.ts +0 -3
- package/inputs/Select/index.js.map +0 -7
- package/inputs/Select/index.test.d.ts +0 -1
- package/inputs/Select/package.json +0 -6
- package/inputs/index.js.map +0 -7
- package/inputs/inputsScenarios/index.js +0 -499
- package/inputs/inputsScenarios/package.json +0 -6
- package/inputs/inputsScenarios.d.ts +0 -296
- package/inputs/inputsScenarios.js.map +0 -7
- package/inputs/package.json +0 -6
- package/internal/index.js +0 -10
- package/internal/package.json +0 -6
- package/internal.js.map +0 -7
- package/lazy/package.json +0 -6
- package/locales/el/index.js +0 -6
- package/locales/el/package.json +0 -6
- package/locales/el.d.ts +0 -2
- package/locales/el.js.map +0 -7
- package/registry/package.json +0 -6
- package/src/Field/utils/calculateField.ts +0 -49
- package/src/FieldArray/FormDialog.tsx +0 -378
- package/src/inputs/Input/inputsInputScenarios.ts +0 -404
- package/src/inputs/inputsScenarios.ts +0 -496
- package/src/lazy.js +0 -77
- package/src/locales/el.ts +0 -3
- package/src/registry.js +0 -165
- package/types/index.js +0 -2
- package/types/package.json +0 -6
- package/types.js.map +0 -7
- package/utils/index.js +0 -60
- package/utils/package.json +0 -6
- package/utils.js.map +0 -7
- package/validators/index.js.map +0 -7
- package/validators/package.json +0 -6
- package/validators/types/index.js +0 -1
- package/validators/types/package.json +0 -6
- package/validators/types.js.map +0 -7
- package/validators/utils/afm/index.js +0 -31
- package/validators/utils/afm/package.json +0 -6
- package/validators/utils/afm.js.map +0 -7
- package/validators/utils/date/index.js +0 -103
- package/validators/utils/date/package.json +0 -6
- package/validators/utils/date.js.map +0 -7
- package/validators/utils/datetime/index.js +0 -116
- package/validators/utils/datetime/package.json +0 -6
- package/validators/utils/datetime.js.map +0 -7
- package/validators/utils/file/index.js +0 -25
- package/validators/utils/file/package.json +0 -6
- package/validators/utils/file.js.map +0 -7
- package/validators/utils/iban/index.js +0 -118
- package/validators/utils/iban/package.json +0 -6
- package/validators/utils/iban.js.map +0 -7
- package/validators/utils/image/index.js +0 -79
- package/validators/utils/image/package.json +0 -6
- package/validators/utils/image.js.map +0 -7
- package/validators/utils/index.js.map +0 -7
- package/validators/utils/int/index.js +0 -24
- package/validators/utils/int/package.json +0 -6
- package/validators/utils/int.js.map +0 -7
- package/validators/utils/number/index.js +0 -20
- package/validators/utils/number/package.json +0 -6
- package/validators/utils/number.js.map +0 -7
- package/validators/utils/otp/index.js +0 -30
- package/validators/utils/otp/package.json +0 -6
- package/validators/utils/otp.js.map +0 -7
- package/validators/utils/package.json +0 -6
- package/validators/utils/phone/index.js +0 -172
- package/validators/utils/phone/package.json +0 -6
- package/validators/utils/phone.js.map +0 -7
- package/validators/utils/postal_code/index.js +0 -30
- package/validators/utils/postal_code/package.json +0 -6
- package/validators/utils/postal_code.js.map +0 -7
- package/validators/utils/text_limit/index.js +0 -45
- package/validators/utils/text_limit/package.json +0 -6
- package/validators/utils/text_limit.js.map +0 -7
- package/validators/utils/uuid4/index.js +0 -22
- package/validators/utils/uuid4/package.json +0 -6
- package/validators/utils/uuid4.js.map +0 -7
- package/validators/validators.spec.d.ts +0 -1
package/cjs/Field/types.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/Field/types.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { ErrorOption, UseFormReturn, UseFormProps } from 'react-hook-form';\nimport { ValidatorSchema } from '@digigov/form/validators/types';\nimport { GridProps } from '@digigov/ui/layouts/Grid';\n\nexport interface FieldLabelProps {\n primary?: string;\n secondary?: string;\n hint?: string;\n}\n\nexport interface FieldSpec {\n key: string; // !TODO rename key to name;\n type?:\n | 'int'\n | 'string'\n | 'text'\n | 'boolean'\n | 'email'\n | 'uuid4'\n | 'choice:multiple'\n | 'choice:single'\n | 'mobile_phone'\n | 'date'\n | 'datetime'\n | 'otp'\n | 'afm'\n | 'iban'\n | 'file'\n | 'image'\n | 'postal_code'\n | 'phone_number'\n | 'array'\n | 'object';\n trim?: boolean;\n component?: any;\n autoComplete?: string;\n placeholder?: string;\n maxLength?: number;\n condition?: Record<string, FieldCondition>;\n controlled?: boolean;\n label?: FieldLabelProps;\n extra?: Record<string, any>;\n editable?: boolean;\n variant?: 'inline' | 'dialog';\n required?: boolean;\n enabled?: boolean;\n disabled?: boolean;\n layout?: Record<\n string,\n | GridProps['xs']\n | GridProps['sm']\n | GridProps['md']\n | GridProps['lg']\n | GridProps['xl']\n >;\n validators?: ValidatorSchema[];\n wrapper?: 'label' | 'fieldset';\n maxWidth?: string;\n maxHeight?: string;\n width?: string;\n}\n\nexport interface FieldCondition {\n is: string | string[] | number | number[] | boolean | boolean[];\n then?: Partial<FieldSpec>;\n else?: Partial<FieldSpec>;\n}\nexport interface ChildFieldMemoProps extends FieldConditionalProps {\n dependencies: FormData;\n}\nexport type FormData = UseFormProps['defaultValues'];\n\nexport interface FieldWithCondition extends Omit<CalculatedField, 'condition'> {\n condition: Record<string, FieldCondition>;\n}\n\nexport interface FieldConditionalProps {\n field: FieldWithCondition;\n control: UseFormReturn['control'];\n register: UseFormReturn['register'];\n reset: UseFormReturn['reset'];\n error?: ErrorOption;\n Field: React.FC<FieldProps>;\n}\n\nexport interface FieldComponentItem {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n component: any;\n controlled?: boolean;\n wrapper?: FieldSpec['wrapper'];\n}\n\nexport interface FieldContainerProps {\n name?: FieldSpec['key'];\n layout?: FieldSpec['layout'];\n label?: FieldSpec['label'];\n error?: ErrorOption | Record<string, any>;\n hasError?: boolean;\n children?: React.ReactNode;\n wrapper?: FieldSpec['wrapper'];\n}\n\nexport type FieldComponentRegistry = Record<string, FieldComponentItem>;\n\nexport type OmittedFieldSpec = Omit<FieldSpec, 'component'>;\n\nexport type UnknownValue = never | never[];\n\nexport interface ControlledFieldProps {\n type?: string;\n value: UnknownValue;\n onChange: (v: UnknownValue) => void;\n defaultValue?: UnknownValue;\n onBlur?: (e: Event) => void;\n extra?: never;\n error?: boolean;\n name?: string;\n disabled?: boolean;\n Field: React.FC<FieldProps>;\n}\n\nexport interface UncontrolledFieldProps {\n name: string;\n register: FieldBaseProps['register'];\n control?: FieldBaseProps['control'];\n error?: boolean;\n extra?: Record<string, never>;\n type?: string;\n disabled?: boolean;\n Field: React.FC<FieldProps>;\n}\n\nexport interface CalculatedField extends OmittedFieldSpec {\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n component: any;\n defaultValue?: never;\n error?: ErrorOption;\n wrapper?: FieldComponentItem['wrapper'];\n multiplicity?: boolean;\n}\n\nexport interface FieldBaseProps extends CalculatedField {\n control: UseFormReturn['control'];\n register: UseFormReturn['register'];\n reset: UseFormReturn['reset'];\n Field: React.FC<FieldProps>;\n}\n\nexport interface FieldProps extends FieldSpec {\n name: string;\n children?: React.ReactNode;\n}\n\nexport interface UseFieldProps {\n field: FieldSpec;\n control: FieldBaseProps['control'];\n register: FieldBaseProps['register'];\n reset: FieldBaseProps['reset'];\n watch: UseFormReturn['watch'];\n formState: UseFormReturn['formState'];\n getFieldState: UseFormReturn['getFieldState'];\n setValue: UseFormReturn['setValue'];\n getValues: UseFormReturn['getValues'];\n unregister: UseFormReturn['unregister'];\n trigger: UseFormReturn['trigger'];\n clearErrors: UseFormReturn['clearErrors'];\n error?: ErrorOption;\n componentRegistry?: FieldComponentRegistry;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var calculateField_exports = {};
|
|
19
|
-
__export(calculateField_exports, {
|
|
20
|
-
calculateField: () => calculateField
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(calculateField_exports);
|
|
23
|
-
function calculateField(children, field, fieldComponentRegistry, alternativeComponents) {
|
|
24
|
-
const calculatedField = { ...field };
|
|
25
|
-
if (children) {
|
|
26
|
-
calculatedField.component = children;
|
|
27
|
-
calculatedField.controlled = true;
|
|
28
|
-
} else if (typeof field.component === "function") {
|
|
29
|
-
} else if (!field.component && !field.type) {
|
|
30
|
-
calculatedField.component = fieldComponentRegistry.string.component;
|
|
31
|
-
calculatedField.controlled = fieldComponentRegistry.string?.controlled || false;
|
|
32
|
-
} else if (typeof field?.extra?.component === "string" && alternativeComponents[field.extra.component]) {
|
|
33
|
-
calculatedField.controlled = alternativeComponents[field.extra.component]?.controlled || false;
|
|
34
|
-
calculatedField.component = alternativeComponents[field.extra.component].component;
|
|
35
|
-
calculatedField.wrapper = alternativeComponents[field.extra.component].wrapper;
|
|
36
|
-
} else if (!field.component && field.type && fieldComponentRegistry[field.type]) {
|
|
37
|
-
calculatedField.component = fieldComponentRegistry[field.type].component;
|
|
38
|
-
calculatedField.wrapper = fieldComponentRegistry[field.type].wrapper;
|
|
39
|
-
calculatedField.controlled = fieldComponentRegistry[field.type]?.controlled || false;
|
|
40
|
-
} else {
|
|
41
|
-
calculatedField.component = fieldComponentRegistry.string.component;
|
|
42
|
-
calculatedField.controlled = fieldComponentRegistry.string?.controlled || false;
|
|
43
|
-
}
|
|
44
|
-
return calculatedField;
|
|
45
|
-
}
|
|
46
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
-
0 && (module.exports = {
|
|
48
|
-
calculateField
|
|
49
|
-
});
|
|
50
|
-
//# sourceMappingURL=calculateField.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/Field/utils/calculateField.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n FieldProps,\n FieldSpec,\n FieldComponentRegistry,\n CalculatedField,\n} from '@digigov/form/Field/types';\n\nexport function calculateField(\n children: FieldProps['children'],\n field: FieldSpec,\n fieldComponentRegistry: FieldComponentRegistry,\n alternativeComponents: FieldComponentRegistry\n): CalculatedField {\n const calculatedField = { ...field };\n if (children) {\n calculatedField.component = children;\n calculatedField.controlled = true;\n } else if (typeof field.component === 'function') {\n // leave as is\n } else if (!field.component && !field.type) {\n calculatedField.component = fieldComponentRegistry.string.component;\n calculatedField.controlled =\n fieldComponentRegistry.string?.controlled || false;\n } else if (\n typeof field?.extra?.component === 'string' &&\n alternativeComponents[field.extra.component]\n ) {\n calculatedField.controlled =\n alternativeComponents[field.extra.component]?.controlled || false;\n calculatedField.component =\n alternativeComponents[field.extra.component].component;\n calculatedField.wrapper =\n alternativeComponents[field.extra.component].wrapper;\n } else if (\n !field.component &&\n field.type &&\n fieldComponentRegistry[field.type]\n ) {\n calculatedField.component = fieldComponentRegistry[field.type].component;\n calculatedField.wrapper = fieldComponentRegistry[field.type].wrapper;\n calculatedField.controlled =\n fieldComponentRegistry[field.type]?.controlled || false;\n } else {\n calculatedField.component = fieldComponentRegistry.string.component;\n calculatedField.controlled =\n fieldComponentRegistry.string?.controlled || false;\n }\n return calculatedField as CalculatedField;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,SAAS,eACd,UACA,OACA,wBACA,uBACiB;AACjB,QAAM,kBAAkB,EAAE,GAAG,MAAM;AACnC,MAAI,UAAU;AACZ,oBAAgB,YAAY;AAC5B,oBAAgB,aAAa;AAAA,EAC/B,WAAW,OAAO,MAAM,cAAc,YAAY;AAAA,EAElD,WAAW,CAAC,MAAM,aAAa,CAAC,MAAM,MAAM;AAC1C,oBAAgB,YAAY,uBAAuB,OAAO;AAC1D,oBAAgB,aACd,uBAAuB,QAAQ,cAAc;AAAA,EACjD,WACE,OAAO,OAAO,OAAO,cAAc,YACnC,sBAAsB,MAAM,MAAM,SAAS,GAC3C;AACA,oBAAgB,aACd,sBAAsB,MAAM,MAAM,SAAS,GAAG,cAAc;AAC9D,oBAAgB,YACd,sBAAsB,MAAM,MAAM,SAAS,EAAE;AAC/C,oBAAgB,UACd,sBAAsB,MAAM,MAAM,SAAS,EAAE;AAAA,EACjD,WACE,CAAC,MAAM,aACP,MAAM,QACN,uBAAuB,MAAM,IAAI,GACjC;AACA,oBAAgB,YAAY,uBAAuB,MAAM,IAAI,EAAE;AAC/D,oBAAgB,UAAU,uBAAuB,MAAM,IAAI,EAAE;AAC7D,oBAAgB,aACd,uBAAuB,MAAM,IAAI,GAAG,cAAc;AAAA,EACtD,OAAO;AACL,oBAAgB,YAAY,uBAAuB,OAAO;AAC1D,oBAAgB,aACd,uBAAuB,QAAQ,cAAc;AAAA,EACjD;AACA,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var evaluateFieldWithConditions_exports = {};
|
|
19
|
-
__export(evaluateFieldWithConditions_exports, {
|
|
20
|
-
evaluateFieldWithConditions: () => evaluateFieldWithConditions
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(evaluateFieldWithConditions_exports);
|
|
23
|
-
function evaluateFieldWithConditions(field, variables) {
|
|
24
|
-
const newField = { ...field };
|
|
25
|
-
if (variables) {
|
|
26
|
-
for (const key in variables) {
|
|
27
|
-
if (field.condition[key] && field.condition[key].is) {
|
|
28
|
-
const is = field.condition[key].is;
|
|
29
|
-
if (is === variables[key] || Array.isArray(variables[key]) && variables[key].includes(is)) {
|
|
30
|
-
const then = field.condition[key].then || {};
|
|
31
|
-
for (const attr in then) {
|
|
32
|
-
newField[attr] = then[attr];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
} else if (field.condition[key]) {
|
|
36
|
-
const otherwise = field.condition[key].else || {};
|
|
37
|
-
for (const attr in otherwise) {
|
|
38
|
-
newField[attr] = otherwise[attr];
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return newField;
|
|
44
|
-
}
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
evaluateFieldWithConditions
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=evaluateFieldWithConditions.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/Field/utils/evaluateFieldWithConditions.ts"],
|
|
4
|
-
"sourcesContent": ["import { FieldWithCondition, CalculatedField } from '@digigov/form/Field/types';\n\nexport function evaluateFieldWithConditions(\n field: FieldWithCondition,\n variables: FormData\n): CalculatedField {\n const newField = { ...field };\n if (variables) {\n for (const key in variables) {\n if (field.condition[key] && field.condition[key].is) {\n const is = field.condition[key].is;\n if (\n is === variables[key] ||\n (Array.isArray(variables[key]) && variables[key].includes(is))\n ) {\n const then = field.condition[key].then || {};\n for (const attr in then) {\n newField[attr] = then[attr];\n }\n }\n } else if (field.condition[key]) {\n const otherwise = field.condition[key].else || {};\n for (const attr in otherwise) {\n newField[attr] = otherwise[attr];\n }\n }\n }\n }\n return newField;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,4BACd,OACA,WACiB;AACjB,QAAM,WAAW,EAAE,GAAG,MAAM;AAC5B,MAAI,WAAW;AACb,eAAW,OAAO,WAAW;AAC3B,UAAI,MAAM,UAAU,GAAG,KAAK,MAAM,UAAU,GAAG,EAAE,IAAI;AACnD,cAAM,KAAK,MAAM,UAAU,GAAG,EAAE;AAChC,YACE,OAAO,UAAU,GAAG,KACnB,MAAM,QAAQ,UAAU,GAAG,CAAC,KAAK,UAAU,GAAG,EAAE,SAAS,EAAE,GAC5D;AACA,gBAAM,OAAO,MAAM,UAAU,GAAG,EAAE,QAAQ,CAAC;AAC3C,qBAAW,QAAQ,MAAM;AACvB,qBAAS,IAAI,IAAI,KAAK,IAAI;AAAA,UAC5B;AAAA,QACF;AAAA,MACF,WAAW,MAAM,UAAU,GAAG,GAAG;AAC/B,cAAM,YAAY,MAAM,UAAU,GAAG,EAAE,QAAQ,CAAC;AAChD,mBAAW,QAAQ,WAAW;AAC5B,mBAAS,IAAI,IAAI,UAAU,IAAI;AAAA,QACjC;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/cjs/Field/utils/index.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var utils_exports = {};
|
|
29
|
-
__export(utils_exports, {
|
|
30
|
-
ALTERNATIVE_COMPONENTS: () => ALTERNATIVE_COMPONENTS,
|
|
31
|
-
CONTROLLED_FIELD_COMPONENTS: () => CONTROLLED_FIELD_COMPONENTS,
|
|
32
|
-
FIELD_COMPONENTS: () => FIELD_COMPONENTS
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(utils_exports);
|
|
35
|
-
var import_AutoCompleteInput = __toESM(require("@digigov/form/inputs/AutoCompleteInput"));
|
|
36
|
-
var import_Checkboxes = __toESM(require("@digigov/form/inputs/Checkboxes"));
|
|
37
|
-
var import_DateInput = __toESM(require("@digigov/form/inputs/DateInput"));
|
|
38
|
-
var import_DateTimeInput = __toESM(require("@digigov/form/inputs/DateTimeInput"));
|
|
39
|
-
var import_FileInput = __toESM(require("@digigov/form/inputs/FileInput"));
|
|
40
|
-
var import_ImageInput = __toESM(require("@digigov/form/inputs/ImageInput"));
|
|
41
|
-
var import_Input = __toESM(require("@digigov/form/inputs/Input"));
|
|
42
|
-
var import_OtpInput = __toESM(require("@digigov/form/inputs/OtpInput"));
|
|
43
|
-
var import_Radio = __toESM(require("@digigov/form/inputs/Radio"));
|
|
44
|
-
var import_Select = __toESM(require("@digigov/form/inputs/Select"));
|
|
45
|
-
const FIELD_COMPONENTS = {
|
|
46
|
-
text: {
|
|
47
|
-
component: import_Input.default
|
|
48
|
-
},
|
|
49
|
-
string: {
|
|
50
|
-
component: import_Input.default
|
|
51
|
-
},
|
|
52
|
-
file: {
|
|
53
|
-
wrapper: "fieldset",
|
|
54
|
-
component: import_FileInput.default
|
|
55
|
-
},
|
|
56
|
-
image: {
|
|
57
|
-
wrapper: "fieldset",
|
|
58
|
-
component: import_ImageInput.default
|
|
59
|
-
},
|
|
60
|
-
date: {
|
|
61
|
-
wrapper: "fieldset",
|
|
62
|
-
controlled: true,
|
|
63
|
-
component: import_DateInput.default
|
|
64
|
-
},
|
|
65
|
-
datetime: {
|
|
66
|
-
wrapper: "fieldset",
|
|
67
|
-
controlled: true,
|
|
68
|
-
component: import_DateTimeInput.default
|
|
69
|
-
},
|
|
70
|
-
otp: {
|
|
71
|
-
wrapper: "fieldset",
|
|
72
|
-
controlled: true,
|
|
73
|
-
component: import_OtpInput.default
|
|
74
|
-
},
|
|
75
|
-
"choice:multiple": {
|
|
76
|
-
wrapper: "fieldset",
|
|
77
|
-
controlled: true,
|
|
78
|
-
component: import_Checkboxes.default
|
|
79
|
-
},
|
|
80
|
-
"choice:single": {
|
|
81
|
-
wrapper: "fieldset",
|
|
82
|
-
controlled: false,
|
|
83
|
-
component: import_Radio.default
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
const ALTERNATIVE_COMPONENTS = {
|
|
87
|
-
Select: {
|
|
88
|
-
component: import_Select.default,
|
|
89
|
-
controlled: false
|
|
90
|
-
},
|
|
91
|
-
AutoComplete: {
|
|
92
|
-
component: import_AutoCompleteInput.default,
|
|
93
|
-
controlled: true,
|
|
94
|
-
wrapper: "fieldset"
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const CONTROLLED_FIELD_COMPONENTS = {
|
|
98
|
-
...FIELD_COMPONENTS,
|
|
99
|
-
"choice:single": {
|
|
100
|
-
wrapper: "fieldset",
|
|
101
|
-
controlled: true,
|
|
102
|
-
component: import_Radio.ControlledRadioButtonsGroup
|
|
103
|
-
},
|
|
104
|
-
text: {
|
|
105
|
-
component: import_Input.default,
|
|
106
|
-
controlled: true
|
|
107
|
-
},
|
|
108
|
-
string: {
|
|
109
|
-
component: import_Input.default,
|
|
110
|
-
controlled: true
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
114
|
-
0 && (module.exports = {
|
|
115
|
-
ALTERNATIVE_COMPONENTS,
|
|
116
|
-
CONTROLLED_FIELD_COMPONENTS,
|
|
117
|
-
FIELD_COMPONENTS
|
|
118
|
-
});
|
|
119
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/Field/utils/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { FieldComponentRegistry } from '@digigov/form/Field/types';\nimport AutoCompleteInput from '@digigov/form/inputs/AutoCompleteInput';\nimport Checkboxes from '@digigov/form/inputs/Checkboxes';\nimport DateInput from '@digigov/form/inputs/DateInput';\nimport DateTimeInput from '@digigov/form/inputs/DateTimeInput';\nimport FileInput from '@digigov/form/inputs/FileInput';\nimport ImageInput from '@digigov/form/inputs/ImageInput';\nimport Input from '@digigov/form/inputs/Input';\nimport OtpInput from '@digigov/form/inputs/OtpInput';\nimport Radio, { ControlledRadioButtonsGroup } from '@digigov/form/inputs/Radio';\nimport Select from '@digigov/form/inputs/Select';\n\nexport const FIELD_COMPONENTS: FieldComponentRegistry = {\n text: {\n component: Input,\n },\n string: {\n component: Input,\n },\n file: {\n wrapper: 'fieldset',\n component: FileInput,\n },\n image: {\n wrapper: 'fieldset',\n component: ImageInput,\n },\n date: {\n wrapper: 'fieldset',\n controlled: true,\n component: DateInput,\n },\n datetime: {\n wrapper: 'fieldset',\n controlled: true,\n component: DateTimeInput,\n },\n otp: {\n wrapper: 'fieldset',\n controlled: true,\n component: OtpInput,\n },\n 'choice:multiple': {\n wrapper: 'fieldset',\n controlled: true,\n component: Checkboxes,\n },\n 'choice:single': {\n wrapper: 'fieldset',\n controlled: false,\n component: Radio,\n },\n};\n\nexport const ALTERNATIVE_COMPONENTS: FieldComponentRegistry = {\n Select: {\n component: Select,\n controlled: false,\n },\n AutoComplete: {\n component: AutoCompleteInput,\n controlled: true,\n wrapper: 'fieldset',\n },\n};\n\nexport const CONTROLLED_FIELD_COMPONENTS: FieldComponentRegistry = {\n ...FIELD_COMPONENTS,\n 'choice:single': {\n wrapper: 'fieldset',\n controlled: true,\n component: ControlledRadioButtonsGroup,\n },\n text: {\n component: Input,\n controlled: true,\n },\n string: {\n component: Input,\n controlled: true,\n },\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,+BAA8B;AAC9B,wBAAuB;AACvB,uBAAsB;AACtB,2BAA0B;AAC1B,uBAAsB;AACtB,wBAAuB;AACvB,mBAAkB;AAClB,sBAAqB;AACrB,mBAAmD;AACnD,oBAAmB;AAEZ,MAAM,mBAA2C;AAAA,EACtD,MAAM;AAAA,IACJ,WAAW,aAAAA;AAAA,EACb;AAAA,EACA,QAAQ;AAAA,IACN,WAAW,aAAAA;AAAA,EACb;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,WAAW,iBAAAC;AAAA,EACb;AAAA,EACA,OAAO;AAAA,IACL,SAAS;AAAA,IACT,WAAW,kBAAAC;AAAA,EACb;AAAA,EACA,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW,iBAAAC;AAAA,EACb;AAAA,EACA,UAAU;AAAA,IACR,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW,qBAAAC;AAAA,EACb;AAAA,EACA,KAAK;AAAA,IACH,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW,gBAAAC;AAAA,EACb;AAAA,EACA,mBAAmB;AAAA,IACjB,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW,kBAAAC;AAAA,EACb;AAAA,EACA,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW,aAAAC;AAAA,EACb;AACF;AAEO,MAAM,yBAAiD;AAAA,EAC5D,QAAQ;AAAA,IACN,WAAW,cAAAC;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EACA,cAAc;AAAA,IACZ,WAAW,yBAAAC;AAAA,IACX,YAAY;AAAA,IACZ,SAAS;AAAA,EACX;AACF;AAEO,MAAM,8BAAsD;AAAA,EACjE,GAAG;AAAA,EACH,iBAAiB;AAAA,IACf,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AAAA,EACA,MAAM;AAAA,IACJ,WAAW,aAAAT;AAAA,IACX,YAAY;AAAA,EACd;AAAA,EACA,QAAQ;AAAA,IACN,WAAW,aAAAA;AAAA,IACX,YAAY;AAAA,EACd;AACF;",
|
|
6
|
-
"names": ["Input", "FileInput", "ImageInput", "DateInput", "DateTimeInput", "OtpInput", "Checkboxes", "Radio", "Select", "AutoCompleteInput"]
|
|
7
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var useField_exports = {};
|
|
19
|
-
__export(useField_exports, {
|
|
20
|
-
useField: () => useField
|
|
21
|
-
});
|
|
22
|
-
module.exports = __toCommonJS(useField_exports);
|
|
23
|
-
var import_react = require("react");
|
|
24
|
-
var import_FormContext = require("@digigov/form/FormContext");
|
|
25
|
-
const useField = (name, customField) => {
|
|
26
|
-
const {
|
|
27
|
-
fieldsMap,
|
|
28
|
-
control,
|
|
29
|
-
register,
|
|
30
|
-
reset,
|
|
31
|
-
trigger,
|
|
32
|
-
clearErrors,
|
|
33
|
-
errors,
|
|
34
|
-
registerField,
|
|
35
|
-
watch,
|
|
36
|
-
componentRegistry,
|
|
37
|
-
getFieldState,
|
|
38
|
-
setValue,
|
|
39
|
-
getValues,
|
|
40
|
-
unregister,
|
|
41
|
-
formState
|
|
42
|
-
} = (0, import_react.useContext)(import_FormContext.FormContext);
|
|
43
|
-
if (!registerField) {
|
|
44
|
-
throw new Error(`
|
|
45
|
-
You can't use the Field component without wrapping it in FormBuilder.
|
|
46
|
-
https://devs.pages.grnet.gr/digigov/digigov-sdk/sdk-docs/forms/create-simple-form/
|
|
47
|
-
`);
|
|
48
|
-
}
|
|
49
|
-
let error = errors[name];
|
|
50
|
-
const nameIndexRegex = name.match(/^(.*?)\.(\d+)$/);
|
|
51
|
-
if (nameIndexRegex) {
|
|
52
|
-
const [, fieldArrayName, indexStr] = nameIndexRegex;
|
|
53
|
-
error = errors[fieldArrayName]?.[Number(indexStr)];
|
|
54
|
-
}
|
|
55
|
-
(0, import_react.useMemo)(
|
|
56
|
-
() => customField?.type && registerField({ ...customField, key: name }),
|
|
57
|
-
[customField, name, registerField]
|
|
58
|
-
);
|
|
59
|
-
return {
|
|
60
|
-
field: customField || fieldsMap[name],
|
|
61
|
-
control,
|
|
62
|
-
register,
|
|
63
|
-
reset,
|
|
64
|
-
trigger,
|
|
65
|
-
watch,
|
|
66
|
-
componentRegistry,
|
|
67
|
-
getFieldState,
|
|
68
|
-
setValue,
|
|
69
|
-
clearErrors,
|
|
70
|
-
getValues,
|
|
71
|
-
unregister,
|
|
72
|
-
formState,
|
|
73
|
-
error
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
77
|
-
0 && (module.exports = {
|
|
78
|
-
useField
|
|
79
|
-
});
|
|
80
|
-
//# sourceMappingURL=useField.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/Field/utils/useField.ts"],
|
|
4
|
-
"sourcesContent": ["import { useContext, useMemo } from 'react';\nimport { FieldSpec, UseFieldProps } from '@digigov/form/Field/types';\nimport { FormContext } from '@digigov/form/FormContext';\n\nexport const useField = (\n name: string,\n customField: FieldSpec | null\n): UseFieldProps => {\n const {\n fieldsMap,\n control,\n register,\n reset,\n trigger,\n clearErrors,\n errors,\n registerField,\n watch,\n componentRegistry,\n getFieldState,\n setValue,\n getValues,\n unregister,\n formState,\n } = useContext(FormContext);\n if (!registerField) {\n throw new Error(`\n You can't use the Field component without wrapping it in FormBuilder.\n https://devs.pages.grnet.gr/digigov/digigov-sdk/sdk-docs/forms/create-simple-form/\n `);\n }\n let error = errors[name];\n const nameIndexRegex = name.match(/^(.*?)\\.(\\d+)$/);\n if (nameIndexRegex) {\n const [, fieldArrayName, indexStr] = nameIndexRegex;\n error = errors[fieldArrayName]?.[Number(indexStr)];\n }\n useMemo(\n () => customField?.type && registerField({ ...customField, key: name }),\n [customField, name, registerField]\n );\n return {\n field: customField || fieldsMap[name],\n control,\n register,\n reset,\n trigger,\n watch,\n componentRegistry,\n getFieldState,\n setValue,\n clearErrors,\n getValues,\n unregister,\n formState,\n error,\n };\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAoC;AAEpC,yBAA4B;AAErB,MAAM,WAAW,CACtB,MACA,gBACkB;AAClB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,8BAAW;AAC1B,MAAI,CAAC,eAAe;AAClB,UAAM,IAAI,MAAM;AAAA;AAAA;AAAA,KAGf;AAAA,EACH;AACA,MAAI,QAAQ,OAAO,IAAI;AACvB,QAAM,iBAAiB,KAAK,MAAM,gBAAgB;AAClD,MAAI,gBAAgB;AAClB,UAAM,CAAC,EAAE,gBAAgB,QAAQ,IAAI;AACrC,YAAQ,OAAO,cAAc,IAAI,OAAO,QAAQ,CAAC;AAAA,EACnD;AACA;AAAA,IACE,MAAM,aAAa,QAAQ,cAAc,EAAE,GAAG,aAAa,KAAK,KAAK,CAAC;AAAA,IACtE,CAAC,aAAa,MAAM,aAAa;AAAA,EACnC;AACA,SAAO;AAAA,IACL,OAAO,eAAe,UAAU,IAAI;AAAA,IACpC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var FormDialog_exports = {};
|
|
29
|
-
__export(FormDialog_exports, {
|
|
30
|
-
ArrayItemDisplay: () => ArrayItemDisplay,
|
|
31
|
-
ArrayItemHeader: () => ArrayItemHeader,
|
|
32
|
-
ArrayItemModal: () => ArrayItemModal,
|
|
33
|
-
FormDialog: () => FormDialog,
|
|
34
|
-
default: () => FormDialog_default
|
|
35
|
-
});
|
|
36
|
-
module.exports = __toCommonJS(FormDialog_exports);
|
|
37
|
-
var import_react = __toESM(require("react"));
|
|
38
|
-
var import_react_hook_form = require("react-hook-form");
|
|
39
|
-
var import_FieldObject = require("@digigov/form/FieldObject");
|
|
40
|
-
var import_Fieldset = require("@digigov/form/Fieldset");
|
|
41
|
-
var import_Modal = require("@digigov/ui/app/Modal");
|
|
42
|
-
var import_content = require("@digigov/ui/content");
|
|
43
|
-
var import_Button = require("@digigov/ui/form/Button");
|
|
44
|
-
var import_Hint = require("@digigov/ui/typography/Hint");
|
|
45
|
-
const FormDialog = ({
|
|
46
|
-
name,
|
|
47
|
-
trigger,
|
|
48
|
-
register,
|
|
49
|
-
control,
|
|
50
|
-
formState,
|
|
51
|
-
error,
|
|
52
|
-
getValues,
|
|
53
|
-
Field,
|
|
54
|
-
reset,
|
|
55
|
-
...customField
|
|
56
|
-
}) => {
|
|
57
|
-
const [isAppending, setIsAppending] = (0, import_react.useState)(false);
|
|
58
|
-
const [currentIndex, setCurrentIndex] = (0, import_react.useState)(0);
|
|
59
|
-
const { fields, append, remove, update } = (0, import_react_hook_form.useFieldArray)({
|
|
60
|
-
control,
|
|
61
|
-
name
|
|
62
|
-
});
|
|
63
|
-
const { open, close, registerModal } = (0, import_Modal.useModal)();
|
|
64
|
-
const currentLength = fields.length > 0 ? fields.length - 1 : fields.length;
|
|
65
|
-
const currentName = isAppending ? `${name}.${currentLength}` : `${name}.${currentIndex}`;
|
|
66
|
-
(0, import_react.useEffect)(() => {
|
|
67
|
-
if (isAppending) {
|
|
68
|
-
setCurrentIndex(currentLength);
|
|
69
|
-
open(`modal-${name}`);
|
|
70
|
-
}
|
|
71
|
-
}, [isAppending]);
|
|
72
|
-
const valuesRef = (0, import_react.useRef)(null);
|
|
73
|
-
if (!error) {
|
|
74
|
-
const values2 = getValues(currentName);
|
|
75
|
-
if (typeof values2 === "object") {
|
|
76
|
-
valuesRef.current = { ...values2 };
|
|
77
|
-
} else {
|
|
78
|
-
valuesRef.current = values2;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
const values = getValues(name);
|
|
82
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
83
|
-
ArrayItemModal,
|
|
84
|
-
{
|
|
85
|
-
title: customField.extra?.label.object.title && `${customField.extra?.label.object.title} ${currentLength + 1}`,
|
|
86
|
-
hint: customField.label?.secondary,
|
|
87
|
-
name,
|
|
88
|
-
editOrAppend: async () => {
|
|
89
|
-
const hasNoErrors = await trigger(
|
|
90
|
-
customField.extra?.of.extra ? customField.extra?.of.extra.fields.map(
|
|
91
|
-
({ key }) => `${currentName}.${key}`
|
|
92
|
-
) : currentName
|
|
93
|
-
);
|
|
94
|
-
if (hasNoErrors) {
|
|
95
|
-
const newValues = getValues(currentName);
|
|
96
|
-
if (isAppending) {
|
|
97
|
-
setIsAppending(false);
|
|
98
|
-
}
|
|
99
|
-
if (customField?.extra?.of?.extra) {
|
|
100
|
-
update(currentIndex, newValues);
|
|
101
|
-
} else {
|
|
102
|
-
update(currentIndex, newValues);
|
|
103
|
-
}
|
|
104
|
-
close();
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
cancel: () => {
|
|
108
|
-
if (isAppending) {
|
|
109
|
-
setIsAppending(false);
|
|
110
|
-
remove(currentIndex);
|
|
111
|
-
close();
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
update(currentIndex, valuesRef.current);
|
|
115
|
-
reset(void 0, {
|
|
116
|
-
keepTouched: true,
|
|
117
|
-
keepDefaultValues: true,
|
|
118
|
-
keepIsValid: true,
|
|
119
|
-
keepIsSubmitted: true,
|
|
120
|
-
keepValues: true
|
|
121
|
-
});
|
|
122
|
-
close();
|
|
123
|
-
},
|
|
124
|
-
type: isAppending ? "append" : "edit",
|
|
125
|
-
appendLabel: customField.extra?.label.object.append.label,
|
|
126
|
-
appendProps: customField.extra?.label.object.append.props,
|
|
127
|
-
editLabel: customField.extra?.label.object.edit.label,
|
|
128
|
-
editProps: customField.extra?.label.object.edit.props,
|
|
129
|
-
cancelLabel: customField.extra?.label.object.cancel.label,
|
|
130
|
-
cancelProps: customField.extra?.label.object.cancel.props,
|
|
131
|
-
...registerModal(`modal-${name}`)
|
|
132
|
-
},
|
|
133
|
-
/* @__PURE__ */ import_react.default.createElement(import_Fieldset.Fieldset, null, customField.extra?.of?.type === "object" ? /* @__PURE__ */ import_react.default.createElement(
|
|
134
|
-
import_FieldObject.FieldObject,
|
|
135
|
-
{
|
|
136
|
-
defaultValue: getValues(currentName) || void 0,
|
|
137
|
-
name: currentName,
|
|
138
|
-
error: error && error[currentIndex],
|
|
139
|
-
formState,
|
|
140
|
-
register,
|
|
141
|
-
control,
|
|
142
|
-
...customField.extra?.of,
|
|
143
|
-
Field
|
|
144
|
-
}
|
|
145
|
-
) : /* @__PURE__ */ import_react.default.createElement(
|
|
146
|
-
Field,
|
|
147
|
-
{
|
|
148
|
-
name: currentName,
|
|
149
|
-
...customField.extra?.of,
|
|
150
|
-
error: error && error[currentIndex],
|
|
151
|
-
key: currentName
|
|
152
|
-
}
|
|
153
|
-
))
|
|
154
|
-
), /* @__PURE__ */ import_react.default.createElement(import_content.TableContainer, null, /* @__PURE__ */ import_react.default.createElement(import_content.Table, null, !customField.extra?.noHeader && customField.extra?.of?.extra && /* @__PURE__ */ import_react.default.createElement(
|
|
155
|
-
ArrayItemHeader,
|
|
156
|
-
{
|
|
157
|
-
labels: customField.extra?.of.extra.fields.map(
|
|
158
|
-
({ label }) => label.primary
|
|
159
|
-
),
|
|
160
|
-
disabled: customField.extra?.editable === false
|
|
161
|
-
}
|
|
162
|
-
), /* @__PURE__ */ import_react.default.createElement(import_content.TableBody, null, values?.map((field, index) => {
|
|
163
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
164
|
-
ArrayItemDisplay,
|
|
165
|
-
{
|
|
166
|
-
key: index,
|
|
167
|
-
name: `${name}.${index}`,
|
|
168
|
-
data: field,
|
|
169
|
-
edit: () => {
|
|
170
|
-
setCurrentIndex(index);
|
|
171
|
-
open(`modal-${name}`);
|
|
172
|
-
},
|
|
173
|
-
remove: () => {
|
|
174
|
-
remove(index);
|
|
175
|
-
},
|
|
176
|
-
disabledEdit: customField.extra?.noEdit ?? false,
|
|
177
|
-
disabledDelete: customField.extra?.noDelete ?? false,
|
|
178
|
-
disabled: customField.extra?.editable ?? false
|
|
179
|
-
}
|
|
180
|
-
);
|
|
181
|
-
})))), /* @__PURE__ */ import_react.default.createElement(
|
|
182
|
-
"div",
|
|
183
|
-
{
|
|
184
|
-
className: customField.extra?.label.object?.addButtonVariant === "link" ? "px-2 py-2 bg-gray-200 border-t border-b border-gray-400" : ""
|
|
185
|
-
},
|
|
186
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
187
|
-
import_Button.Button,
|
|
188
|
-
{
|
|
189
|
-
type: "button",
|
|
190
|
-
name: `${name}-add-object`,
|
|
191
|
-
color: "secondary",
|
|
192
|
-
variant: customField.extra?.label.object?.addButtonVariant,
|
|
193
|
-
onClick: (ev) => {
|
|
194
|
-
ev.preventDefault();
|
|
195
|
-
if (customField.extra?.of?.extra) {
|
|
196
|
-
append({});
|
|
197
|
-
} else {
|
|
198
|
-
append("");
|
|
199
|
-
}
|
|
200
|
-
setCurrentIndex(currentLength + 1);
|
|
201
|
-
setIsAppending(true);
|
|
202
|
-
},
|
|
203
|
-
disabled: !customField?.editable
|
|
204
|
-
},
|
|
205
|
-
customField.extra?.label.object?.add
|
|
206
|
-
)
|
|
207
|
-
));
|
|
208
|
-
};
|
|
209
|
-
const ArrayItemModal = ({
|
|
210
|
-
type,
|
|
211
|
-
name,
|
|
212
|
-
title,
|
|
213
|
-
hint,
|
|
214
|
-
editOrAppend,
|
|
215
|
-
cancel,
|
|
216
|
-
editLabel,
|
|
217
|
-
editProps,
|
|
218
|
-
appendLabel,
|
|
219
|
-
appendProps,
|
|
220
|
-
cancelLabel,
|
|
221
|
-
cancelProps,
|
|
222
|
-
children,
|
|
223
|
-
...props
|
|
224
|
-
}) => {
|
|
225
|
-
return /* @__PURE__ */ import_react.default.createElement(import_Modal.Modal, { ...props, "aria-labelledby": "modal-label" }, /* @__PURE__ */ import_react.default.createElement(import_Modal.ModalHeading, { id: "modal-label" }, title ? title : type === "edit" ? "\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1" : "\u03A0\u03C1\u03BF\u03C3\u03B8\u03AE\u03BA\u03B7"), /* @__PURE__ */ import_react.default.createElement(import_Modal.ModalContent, null, hint && /* @__PURE__ */ import_react.default.createElement(import_Hint.Hint, null, hint), children), /* @__PURE__ */ import_react.default.createElement(import_Modal.ModalAction, null, type === "edit" ? /* @__PURE__ */ import_react.default.createElement(
|
|
226
|
-
import_Button.Button,
|
|
227
|
-
{
|
|
228
|
-
color: "secondary",
|
|
229
|
-
...editProps,
|
|
230
|
-
onClick: async (e) => {
|
|
231
|
-
e.preventDefault();
|
|
232
|
-
editOrAppend(name);
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
editLabel || "\u0391\u03C0\u03BF\u03B8\u03AE\u03BA\u03B5\u03C5\u03C3\u03B7"
|
|
236
|
-
) : /* @__PURE__ */ import_react.default.createElement(
|
|
237
|
-
import_Button.Button,
|
|
238
|
-
{
|
|
239
|
-
color: "primary",
|
|
240
|
-
...appendProps,
|
|
241
|
-
onClick: async (e) => {
|
|
242
|
-
e.preventDefault();
|
|
243
|
-
editOrAppend(name);
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
appendLabel || "\u03A0\u03C1\u03BF\u03C3\u03B8\u03AE\u03BA\u03B7"
|
|
247
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
|
248
|
-
import_Button.Button,
|
|
249
|
-
{
|
|
250
|
-
variant: "link",
|
|
251
|
-
...cancelProps,
|
|
252
|
-
onClick: (e) => {
|
|
253
|
-
e.preventDefault();
|
|
254
|
-
cancel(name);
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
cancelLabel || "\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7"
|
|
258
|
-
)));
|
|
259
|
-
};
|
|
260
|
-
const ArrayItemHeader = ({ labels, disabled }) => {
|
|
261
|
-
return /* @__PURE__ */ import_react.default.createElement(import_content.TableHead, null, /* @__PURE__ */ import_react.default.createElement(import_content.TableRow, null, labels.map((label, index) => {
|
|
262
|
-
return /* @__PURE__ */ import_react.default.createElement(import_content.TableHeadCell, { key: index }, label);
|
|
263
|
-
}), !disabled && /* @__PURE__ */ import_react.default.createElement(import_content.TableHeadCell, null, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B5\u03C2")));
|
|
264
|
-
};
|
|
265
|
-
const ArrayItemDisplay = ({
|
|
266
|
-
name,
|
|
267
|
-
data,
|
|
268
|
-
edit,
|
|
269
|
-
remove,
|
|
270
|
-
disabledEdit,
|
|
271
|
-
disabledDelete,
|
|
272
|
-
disabled
|
|
273
|
-
}) => {
|
|
274
|
-
if (Object.keys(data).length === 0 || Object.keys(data).length === 1 && data.id) {
|
|
275
|
-
return null;
|
|
276
|
-
}
|
|
277
|
-
delete data.id;
|
|
278
|
-
const values = typeof data === "string" ? [data] : Object.values(data);
|
|
279
|
-
return /* @__PURE__ */ import_react.default.createElement(import_content.TableRow, null, values.map((value, index) => {
|
|
280
|
-
return /* @__PURE__ */ import_react.default.createElement(import_content.TableDataCell, { key: index }, value || "");
|
|
281
|
-
}), disabled === true || disabledEdit === true && disabledDelete === true ? null : /* @__PURE__ */ import_react.default.createElement(import_content.TableDataCell, null, /* @__PURE__ */ import_react.default.createElement(import_Button.ButtonGroup, null, disabledEdit !== true && /* @__PURE__ */ import_react.default.createElement(
|
|
282
|
-
import_Button.Button,
|
|
283
|
-
{
|
|
284
|
-
variant: "link",
|
|
285
|
-
type: "button",
|
|
286
|
-
onClick: () => {
|
|
287
|
-
edit(name);
|
|
288
|
-
}
|
|
289
|
-
},
|
|
290
|
-
"\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1"
|
|
291
|
-
), disabledDelete !== true && /* @__PURE__ */ import_react.default.createElement(import_Button.Button, { variant: "link", type: "button", onClick: () => remove(name) }, "\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE"))));
|
|
292
|
-
};
|
|
293
|
-
var FormDialog_default = FormDialog;
|
|
294
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
295
|
-
0 && (module.exports = {
|
|
296
|
-
ArrayItemDisplay,
|
|
297
|
-
ArrayItemHeader,
|
|
298
|
-
ArrayItemModal,
|
|
299
|
-
FormDialog
|
|
300
|
-
});
|
|
301
|
-
//# sourceMappingURL=FormDialog.js.map
|