@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldSpec } from '
|
|
2
|
-
import { ValidatorSchema } from '
|
|
1
|
+
import type { FieldSpec } from '../../types.js';
|
|
2
|
+
import type { ValidatorSchema } from '../types.js';
|
|
3
3
|
export declare function validateText(value: string, min: number, max: number): boolean;
|
|
4
4
|
export declare const TEXT_LIMIT_VALIDATOR: (field: FieldSpec) => ValidatorSchema;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
function validateText(value, min, max) {
|
|
2
|
+
let validator;
|
|
3
|
+
if (min || max) if (value.length < min || value.length > max) return false;
|
|
4
|
+
else return true;
|
|
5
|
+
return validator;
|
|
6
|
+
}
|
|
7
|
+
const TEXT_LIMIT_VALIDATOR = (field)=>{
|
|
8
|
+
const min = field?.extra?.limit?.min;
|
|
9
|
+
const max = field?.extra?.limit?.max;
|
|
10
|
+
return {
|
|
11
|
+
name: 'text-limit-validator',
|
|
12
|
+
message: (v)=>{
|
|
13
|
+
if (min || max) {
|
|
14
|
+
if (v.value.length < min) return {
|
|
15
|
+
key: 'form.error.text.less_than',
|
|
16
|
+
context: {
|
|
17
|
+
min: field?.extra?.limit?.min
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
if (v.value.length > max) return {
|
|
21
|
+
key: 'form.error.text.more_than',
|
|
22
|
+
context: {
|
|
23
|
+
max: field?.extra?.limit?.max
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
test: (value)=>{
|
|
29
|
+
if (!value) return true;
|
|
30
|
+
return validateText(value, min, max);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export { TEXT_LIMIT_VALIDATOR, validateText };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const UUID4_PATTERN = /^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i;
|
|
2
|
+
function validateUUID4(uuid4) {
|
|
3
|
+
if (36 !== uuid4.length) return false;
|
|
4
|
+
return UUID4_PATTERN.test(uuid4);
|
|
5
|
+
}
|
|
6
|
+
const UUID4_VALIDATOR = {
|
|
7
|
+
name: 'uuid4-validator',
|
|
8
|
+
message: 'form.error.uuid4',
|
|
9
|
+
test: (value)=>{
|
|
10
|
+
if (value) return validateUUID4(value);
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
export { UUID4_VALIDATOR, validateUUID4 };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import React, { createContext, useEffect, useState } from "react";
|
|
2
|
-
import { List, ListItem } from "@digigov/ui/content/List";
|
|
3
|
-
import { ErrorSummary } from "@digigov/ui/feedback/ErrorSummary";
|
|
4
|
-
import { useTranslation } from "@digigov/ui/i18n";
|
|
5
|
-
import { Link } from "@digigov/ui/navigation/Link";
|
|
6
|
-
import { Heading } from "@digigov/ui/typography/Heading";
|
|
7
|
-
import { Base } from "@digigov/ui/utils/Base";
|
|
8
|
-
const ErrorGroupContext = createContext(
|
|
9
|
-
null
|
|
10
|
-
);
|
|
11
|
-
const ErrorGroup = ({
|
|
12
|
-
children,
|
|
13
|
-
screenSize,
|
|
14
|
-
fieldOrder
|
|
15
|
-
}) => {
|
|
16
|
-
const [errors, setErrors] = useState({});
|
|
17
|
-
const { t } = useTranslation();
|
|
18
|
-
const setError = (name, label, error) => {
|
|
19
|
-
if (errors[name] !== error && errors[name]?.message !== error?.message) {
|
|
20
|
-
if (!error?.message) {
|
|
21
|
-
const updatedErrors = { ...errors };
|
|
22
|
-
delete updatedErrors[name];
|
|
23
|
-
setErrors(updatedErrors);
|
|
24
|
-
} else {
|
|
25
|
-
setErrors({
|
|
26
|
-
...errors,
|
|
27
|
-
[name]: {
|
|
28
|
-
...error,
|
|
29
|
-
label: label.primary
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
setErrors({});
|
|
37
|
-
}, [screenSize]);
|
|
38
|
-
return /* @__PURE__ */ React.createElement(ErrorGroupContext.Provider, { value: { setError } }, Object.keys(errors).length !== 0 && /* @__PURE__ */ React.createElement(ErrorSummary, { variant: "error-group" }, /* @__PURE__ */ React.createElement(Heading, { size: "sm" }, "\u03A4\u03B1 \u03C0\u03B1\u03C1\u03B1\u03BA\u03AC\u03C4\u03C9 \u03C0\u03B5\u03B4\u03AF\u03B1 \u03C4\u03B7\u03C2 \u03C6\u03CC\u03C1\u03BC\u03B1\u03C2 \u03B5\u03B9\u03BD\u03B1\u03B9 \u03BB\u03AC\u03B8\u03BF\u03C2.", " "), /* @__PURE__ */ React.createElement(List, { listStyle: "bullet" }, (fieldOrder || Object.keys(errors).reverse()).filter((fieldName) => errors[fieldName]).map((fieldName, index) => {
|
|
39
|
-
return /* @__PURE__ */ React.createElement(ListItem, { key: index, id: `${fieldName}-error` }, /* @__PURE__ */ React.createElement(Base, { as: "b" }, t(errors[fieldName]?.label), ":"), " ", /* @__PURE__ */ React.createElement(Link, { href: `#${fieldName}` }, t(errors[fieldName]?.message)));
|
|
40
|
-
}))), children);
|
|
41
|
-
};
|
|
42
|
-
var ErrorGroup_default = ErrorGroup;
|
|
43
|
-
export {
|
|
44
|
-
ErrorGroup,
|
|
45
|
-
ErrorGroupContext,
|
|
46
|
-
ErrorGroup_default as default
|
|
47
|
-
};
|
|
48
|
-
//# sourceMappingURL=ErrorGroup.js.map
|
package/Field/ErrorGroup.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/Field/ErrorGroup.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { createContext, useEffect, useState } from 'react';\nimport { ErrorOption } from 'react-hook-form';\nimport { FieldLabelProps } from '@digigov/form/Field/types';\nimport { List, ListItem } from '@digigov/ui/content/List';\nimport { ErrorSummary } from '@digigov/ui/feedback/ErrorSummary';\nimport { useTranslation } from '@digigov/ui/i18n';\nimport { Link } from '@digigov/ui/navigation/Link';\nimport { Heading } from '@digigov/ui/typography/Heading';\nimport { Base } from '@digigov/ui/utils/Base';\nimport { Breakpoints } from '@digigov/ui/utils/hooks/useScreen';\ninterface ErrorGroupContextType {\n setError: (\n name?: string,\n label?: FieldLabelProps,\n error?: ErrorOption\n ) => void;\n}\nexport const ErrorGroupContext = createContext<ErrorGroupContextType | null>(\n null\n);\n\nexport interface ErrorGroupProps {\n children: React.ReactNode;\n screenSize?: Breakpoints | undefined;\n fieldOrder?: any[];\n}\n\nexport const ErrorGroup: React.FC<ErrorGroupProps> = ({\n children,\n screenSize,\n fieldOrder,\n}) => {\n const [errors, setErrors] = useState<ErrorOption>({});\n const { t } = useTranslation();\n const setError = (name, label, error) => {\n if (errors[name] !== error && errors[name]?.message !== error?.message) {\n if (!error?.message) {\n const updatedErrors = { ...errors };\n delete updatedErrors[name];\n setErrors(updatedErrors);\n } else {\n setErrors({\n ...errors,\n [name]: {\n ...error,\n label: label.primary,\n },\n });\n }\n }\n };\n\n useEffect(() => {\n setErrors({});\n }, [screenSize]);\n return (\n <ErrorGroupContext.Provider value={{ setError }}>\n {Object.keys(errors).length !== 0 && (\n <ErrorSummary variant=\"error-group\">\n <Heading size=\"sm\">\n \u03A4\u03B1 \u03C0\u03B1\u03C1\u03B1\u03BA\u03AC\u03C4\u03C9 \u03C0\u03B5\u03B4\u03AF\u03B1 \u03C4\u03B7\u03C2 \u03C6\u03CC\u03C1\u03BC\u03B1\u03C2 \u03B5\u03B9\u03BD\u03B1\u03B9 \u03BB\u03AC\u03B8\u03BF\u03C2.{' '}\n </Heading>\n <List listStyle=\"bullet\">\n {(fieldOrder || Object.keys(errors).reverse())\n .filter((fieldName) => errors[fieldName])\n .map((fieldName, index) => {\n return (\n <ListItem key={index} id={`${fieldName}-error`}>\n <Base as=\"b\">{t(errors[fieldName]?.label)}:</Base>{' '}\n <Link href={`#${fieldName}`}>\n {t(errors[fieldName]?.message)}\n </Link>\n </ListItem>\n );\n })}\n </List>\n </ErrorSummary>\n )}\n {children}\n </ErrorGroupContext.Provider>\n );\n};\n\nexport default ErrorGroup;\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,SAAS,eAAe,WAAW,gBAAgB;AAG1D,SAAS,MAAM,gBAAgB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AACrB,SAAS,eAAe;AACxB,SAAS,YAAY;AASd,MAAM,oBAAoB;AAAA,EAC/B;AACF;AAQO,MAAM,aAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAsB,CAAC,CAAC;AACpD,QAAM,EAAE,EAAE,IAAI,eAAe;AAC7B,QAAM,WAAW,CAAC,MAAM,OAAO,UAAU;AACvC,QAAI,OAAO,IAAI,MAAM,SAAS,OAAO,IAAI,GAAG,YAAY,OAAO,SAAS;AACtE,UAAI,CAAC,OAAO,SAAS;AACnB,cAAM,gBAAgB,EAAE,GAAG,OAAO;AAClC,eAAO,cAAc,IAAI;AACzB,kBAAU,aAAa;AAAA,MACzB,OAAO;AACL,kBAAU;AAAA,UACR,GAAG;AAAA,UACH,CAAC,IAAI,GAAG;AAAA,YACN,GAAG;AAAA,YACH,OAAO,MAAM;AAAA,UACf;AAAA,QACF,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF;AAEA,YAAU,MAAM;AACd,cAAU,CAAC,CAAC;AAAA,EACd,GAAG,CAAC,UAAU,CAAC;AACf,SACE,oCAAC,kBAAkB,UAAlB,EAA2B,OAAO,EAAE,SAAS,KAC3C,OAAO,KAAK,MAAM,EAAE,WAAW,KAC9B,oCAAC,gBAAa,SAAQ,iBACpB,oCAAC,WAAQ,MAAK,QAAK,uNACyB,GAC5C,GACA,oCAAC,QAAK,WAAU,aACZ,cAAc,OAAO,KAAK,MAAM,EAAE,QAAQ,GACzC,OAAO,CAAC,cAAc,OAAO,SAAS,CAAC,EACvC,IAAI,CAAC,WAAW,UAAU;AACzB,WACE,oCAAC,YAAS,KAAK,OAAO,IAAI,GAAG,SAAS,YACpC,oCAAC,QAAK,IAAG,OAAK,EAAE,OAAO,SAAS,GAAG,KAAK,GAAE,GAAC,GAAQ,KACnD,oCAAC,QAAK,MAAM,IAAI,SAAS,MACtB,EAAE,OAAO,SAAS,GAAG,OAAO,CAC/B,CACF;AAAA,EAEJ,CAAC,CACL,CACF,GAED,QACH;AAEJ;AAEA,IAAO,qBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/Field/FieldBase/index.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import React, { useContext, useEffect } from "react";
|
|
2
|
-
import { Controller } from "react-hook-form";
|
|
3
|
-
import { ErrorGroupContext } from "@digigov/form/Field/ErrorGroup";
|
|
4
|
-
import FieldBaseContainer from "@digigov/form/Field/FieldBaseContainer";
|
|
5
|
-
const FieldBase = ({
|
|
6
|
-
required,
|
|
7
|
-
name,
|
|
8
|
-
component: Component,
|
|
9
|
-
wrapper,
|
|
10
|
-
control,
|
|
11
|
-
type,
|
|
12
|
-
controlled = false,
|
|
13
|
-
enabled = true,
|
|
14
|
-
editable,
|
|
15
|
-
defaultValue,
|
|
16
|
-
label,
|
|
17
|
-
extra = {},
|
|
18
|
-
layout,
|
|
19
|
-
error,
|
|
20
|
-
register,
|
|
21
|
-
...componentProps
|
|
22
|
-
}) => {
|
|
23
|
-
const errorGroupContext = useContext(ErrorGroupContext);
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
if (errorGroupContext) {
|
|
26
|
-
errorGroupContext.setError(name, label, error);
|
|
27
|
-
}
|
|
28
|
-
}, [error, name, errorGroupContext?.setError]);
|
|
29
|
-
if (!enabled) {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
if (controlled) {
|
|
33
|
-
return /* @__PURE__ */ React.createElement(
|
|
34
|
-
FieldBaseContainer,
|
|
35
|
-
{
|
|
36
|
-
label,
|
|
37
|
-
layout,
|
|
38
|
-
error: errorGroupContext ? void 0 : error,
|
|
39
|
-
hasError: !!error,
|
|
40
|
-
wrapper,
|
|
41
|
-
name
|
|
42
|
-
},
|
|
43
|
-
/* @__PURE__ */ React.createElement(
|
|
44
|
-
Controller,
|
|
45
|
-
{
|
|
46
|
-
control,
|
|
47
|
-
name,
|
|
48
|
-
render: ({ field }) => {
|
|
49
|
-
return /* @__PURE__ */ React.createElement(
|
|
50
|
-
Component,
|
|
51
|
-
{
|
|
52
|
-
...field,
|
|
53
|
-
control,
|
|
54
|
-
ref: void 0,
|
|
55
|
-
defaultValue,
|
|
56
|
-
extra,
|
|
57
|
-
error: !!error,
|
|
58
|
-
type,
|
|
59
|
-
"aria-required": !!required,
|
|
60
|
-
"aria-describedby": error && `${name}-error`,
|
|
61
|
-
required,
|
|
62
|
-
disabled: editable === false,
|
|
63
|
-
...componentProps
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
return /* @__PURE__ */ React.createElement(
|
|
72
|
-
FieldBaseContainer,
|
|
73
|
-
{
|
|
74
|
-
label,
|
|
75
|
-
layout,
|
|
76
|
-
error: errorGroupContext ? void 0 : error,
|
|
77
|
-
hasError: !!error,
|
|
78
|
-
wrapper,
|
|
79
|
-
name
|
|
80
|
-
},
|
|
81
|
-
Component?.render ? /* @__PURE__ */ React.createElement(
|
|
82
|
-
Component,
|
|
83
|
-
{
|
|
84
|
-
...register(name),
|
|
85
|
-
control,
|
|
86
|
-
error: !!error,
|
|
87
|
-
extra,
|
|
88
|
-
type,
|
|
89
|
-
"aria-required": !!required,
|
|
90
|
-
"aria-describedby": error && `${name}-error`,
|
|
91
|
-
required,
|
|
92
|
-
disabled: editable === false,
|
|
93
|
-
...componentProps
|
|
94
|
-
}
|
|
95
|
-
) : /* @__PURE__ */ React.createElement(
|
|
96
|
-
Component,
|
|
97
|
-
{
|
|
98
|
-
...register(name),
|
|
99
|
-
register,
|
|
100
|
-
control,
|
|
101
|
-
error: !!error,
|
|
102
|
-
extra,
|
|
103
|
-
type,
|
|
104
|
-
"aria-required": !!required,
|
|
105
|
-
"aria-describedby": error && `${name}-error`,
|
|
106
|
-
required,
|
|
107
|
-
disabled: editable === false,
|
|
108
|
-
ref: void 0,
|
|
109
|
-
...componentProps
|
|
110
|
-
}
|
|
111
|
-
)
|
|
112
|
-
);
|
|
113
|
-
};
|
|
114
|
-
export {
|
|
115
|
-
FieldBase
|
|
116
|
-
};
|
|
117
|
-
//# sourceMappingURL=FieldBase.js.map
|
package/Field/FieldBase.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/Field/FieldBase.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext, useEffect } from 'react';\nimport { Controller } from 'react-hook-form';\nimport { ErrorGroupContext } from '@digigov/form/Field/ErrorGroup';\nimport FieldBaseContainer from '@digigov/form/Field/FieldBaseContainer';\nimport { FieldBaseProps } from '@digigov/form/Field/types';\n\nexport const FieldBase: React.FC<FieldBaseProps> = ({\n required,\n name,\n component: Component,\n wrapper,\n control,\n type,\n controlled = false,\n enabled = true,\n editable,\n defaultValue,\n label,\n extra = {},\n layout,\n error,\n register,\n ...componentProps\n}) => {\n const errorGroupContext = useContext(ErrorGroupContext);\n\n useEffect(() => {\n if (errorGroupContext) {\n errorGroupContext.setError(name, label, error);\n }\n }, [error, name, errorGroupContext?.setError]);\n\n if (!enabled) {\n return null;\n }\n\n if (controlled) {\n return (\n <FieldBaseContainer\n label={label}\n layout={layout}\n error={errorGroupContext ? undefined : error}\n hasError={!!error}\n wrapper={wrapper}\n name={name}\n >\n <Controller\n control={control}\n name={name}\n render={({ field }) => {\n return (\n <Component\n {...field}\n control={control}\n ref={undefined}\n defaultValue={defaultValue}\n extra={extra}\n error={!!error}\n type={type}\n aria-required={!!required}\n aria-describedby={error && `${name}-error`}\n required={required}\n disabled={editable === false}\n {...componentProps}\n />\n );\n }}\n />\n </FieldBaseContainer>\n );\n }\n\n return (\n <FieldBaseContainer\n label={label}\n layout={layout}\n error={errorGroupContext ? undefined : error}\n hasError={!!error}\n wrapper={wrapper}\n name={name}\n >\n {Component?.render ? (\n <Component\n {...register(name)}\n control={control}\n error={!!error}\n extra={extra}\n type={type}\n aria-required={!!required}\n aria-describedby={error && `${name}-error`}\n required={required}\n disabled={editable === false}\n {...componentProps}\n />\n ) : (\n <Component\n {...register(name)}\n register={register}\n control={control}\n error={!!error}\n extra={extra}\n type={type}\n aria-required={!!required}\n aria-describedby={error && `${name}-error`}\n required={required}\n disabled={editable === false}\n ref={undefined}\n {...componentProps}\n />\n )}\n </FieldBaseContainer>\n );\n};\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,SAAS,YAAY,iBAAiB;AAC7C,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAClC,OAAO,wBAAwB;AAGxB,MAAM,YAAsC,CAAC;AAAA,EAClD;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ,CAAC;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,oBAAoB,WAAW,iBAAiB;AAEtD,YAAU,MAAM;AACd,QAAI,mBAAmB;AACrB,wBAAkB,SAAS,MAAM,OAAO,KAAK;AAAA,IAC/C;AAAA,EACF,GAAG,CAAC,OAAO,MAAM,mBAAmB,QAAQ,CAAC;AAE7C,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACT;AAEA,MAAI,YAAY;AACd,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,OAAO,oBAAoB,SAAY;AAAA,QACvC,UAAU,CAAC,CAAC;AAAA,QACZ;AAAA,QACA;AAAA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA,QAAQ,CAAC,EAAE,MAAM,MAAM;AACrB,mBACE;AAAA,cAAC;AAAA;AAAA,gBACE,GAAG;AAAA,gBACJ;AAAA,gBACA,KAAK;AAAA,gBACL;AAAA,gBACA;AAAA,gBACA,OAAO,CAAC,CAAC;AAAA,gBACT;AAAA,gBACA,iBAAe,CAAC,CAAC;AAAA,gBACjB,oBAAkB,SAAS,GAAG,IAAI;AAAA,gBAClC;AAAA,gBACA,UAAU,aAAa;AAAA,gBACtB,GAAG;AAAA;AAAA,YACN;AAAA,UAEJ;AAAA;AAAA,MACF;AAAA,IACF;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,OAAO,oBAAoB,SAAY;AAAA,MACvC,UAAU,CAAC,CAAC;AAAA,MACZ;AAAA,MACA;AAAA;AAAA,IAEC,WAAW,SACV;AAAA,MAAC;AAAA;AAAA,QACE,GAAG,SAAS,IAAI;AAAA,QACjB;AAAA,QACA,OAAO,CAAC,CAAC;AAAA,QACT;AAAA,QACA;AAAA,QACA,iBAAe,CAAC,CAAC;AAAA,QACjB,oBAAkB,SAAS,GAAG,IAAI;AAAA,QAClC;AAAA,QACA,UAAU,aAAa;AAAA,QACtB,GAAG;AAAA;AAAA,IACN,IAEA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG,SAAS,IAAI;AAAA,QACjB;AAAA,QACA;AAAA,QACA,OAAO,CAAC,CAAC;AAAA,QACT;AAAA,QACA;AAAA,QACA,iBAAe,CAAC,CAAC;AAAA,QACjB,oBAAkB,SAAS,GAAG,IAAI;AAAA,QAClC;AAAA,QACA,UAAU,aAAa;AAAA,QACvB,KAAK;AAAA,QACJ,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AAEJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Label from "@digigov/form/inputs/Label";
|
|
3
|
-
import { ErrorMessage } from "@digigov/react-core/ErrorMessage";
|
|
4
|
-
import FieldContainer from "@digigov/react-core/FieldContainer";
|
|
5
|
-
import CoreFieldset from "@digigov/react-core/Fieldset";
|
|
6
|
-
import FieldsetLegend from "@digigov/react-core/FieldsetLegend";
|
|
7
|
-
import LabelContainer from "@digigov/react-core/LabelContainer";
|
|
8
|
-
import { useTranslation } from "@digigov/ui/i18n";
|
|
9
|
-
import { Hint } from "@digigov/ui/typography/Hint";
|
|
10
|
-
const FieldBaseContainer = ({
|
|
11
|
-
name,
|
|
12
|
-
wrapper,
|
|
13
|
-
label,
|
|
14
|
-
children,
|
|
15
|
-
error,
|
|
16
|
-
hasError,
|
|
17
|
-
layout
|
|
18
|
-
}) => {
|
|
19
|
-
const { t } = useTranslation();
|
|
20
|
-
const errorMessage = error?.message.key ? error.message.key : error?.message || "";
|
|
21
|
-
const errorContext = error?.message.context || {};
|
|
22
|
-
if (wrapper === "fieldset") {
|
|
23
|
-
return /* @__PURE__ */ React.createElement(FieldContainer, { error: hasError, ...layout }, /* @__PURE__ */ React.createElement(CoreFieldset, null, /* @__PURE__ */ React.createElement(FieldsetLegend, { size: "sm" }, label && label.primary), label && label.secondary && /* @__PURE__ */ React.createElement(Hint, null, t(label.secondary)), error && /* @__PURE__ */ React.createElement(ErrorMessage, { id: `${name}-error` }, t(errorMessage, errorContext)), children, label && label.hint && /* @__PURE__ */ React.createElement(Hint, { size: "sm" }, label.hint)));
|
|
24
|
-
} else {
|
|
25
|
-
return /* @__PURE__ */ React.createElement(FieldContainer, { error: hasError, ...layout }, /* @__PURE__ */ React.createElement(LabelContainer, null, label && /* @__PURE__ */ React.createElement(Label, { label }), error && /* @__PURE__ */ React.createElement(ErrorMessage, { id: `${name}-error` }, t(errorMessage, errorContext)), children, label && label.hint && /* @__PURE__ */ React.createElement(Hint, { size: "sm" }, label.hint)));
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
var FieldBaseContainer_default = FieldBaseContainer;
|
|
29
|
-
export {
|
|
30
|
-
FieldBaseContainer,
|
|
31
|
-
FieldBaseContainer_default as default
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=FieldBaseContainer.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/Field/FieldBaseContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { FieldContainerProps } from '@digigov/form/Field/types';\nimport Label from '@digigov/form/inputs/Label';\nimport { ErrorMessage } from '@digigov/react-core/ErrorMessage';\nimport FieldContainer from '@digigov/react-core/FieldContainer';\nimport CoreFieldset from '@digigov/react-core/Fieldset';\nimport FieldsetLegend from '@digigov/react-core/FieldsetLegend';\nimport LabelContainer from '@digigov/react-core/LabelContainer';\nimport { useTranslation } from '@digigov/ui/i18n';\nimport { Hint } from '@digigov/ui/typography/Hint';\n\nexport const FieldBaseContainer: React.FC<FieldContainerProps> = ({\n name,\n wrapper,\n label,\n children,\n error,\n hasError,\n layout,\n}) => {\n const { t } = useTranslation();\n const errorMessage = error?.message.key\n ? error.message.key\n : error?.message || '';\n const errorContext = error?.message.context || {};\n if (wrapper === 'fieldset') {\n return (\n <FieldContainer error={hasError} {...layout}>\n <CoreFieldset>\n <FieldsetLegend size=\"sm\">{label && label.primary}</FieldsetLegend>\n {label && label.secondary && <Hint>{t(label.secondary)}</Hint>}\n {error && (\n <ErrorMessage id={`${name}-error`}>\n {t(errorMessage, errorContext)}\n </ErrorMessage>\n )}\n {children}\n {label && label.hint && <Hint size=\"sm\">{label.hint}</Hint>}\n </CoreFieldset>\n </FieldContainer>\n );\n } else {\n return (\n <FieldContainer error={hasError} {...layout}>\n <LabelContainer>\n {label && <Label label={label} />}\n {error && (\n <ErrorMessage id={`${name}-error`}>\n {t(errorMessage, errorContext)}\n </ErrorMessage>\n )}\n {children}\n {label && label.hint && <Hint size=\"sm\">{label.hint}</Hint>}\n </LabelContainer>\n </FieldContainer>\n );\n }\n};\n\nexport default FieldBaseContainer;\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAElB,OAAO,WAAW;AAClB,SAAS,oBAAoB;AAC7B,OAAO,oBAAoB;AAC3B,OAAO,kBAAkB;AACzB,OAAO,oBAAoB;AAC3B,OAAO,oBAAoB;AAC3B,SAAS,sBAAsB;AAC/B,SAAS,YAAY;AAEd,MAAM,qBAAoD,CAAC;AAAA,EAChE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,EAAE,IAAI,eAAe;AAC7B,QAAM,eAAe,OAAO,QAAQ,MAChC,MAAM,QAAQ,MACd,OAAO,WAAW;AACtB,QAAM,eAAe,OAAO,QAAQ,WAAW,CAAC;AAChD,MAAI,YAAY,YAAY;AAC1B,WACE,oCAAC,kBAAe,OAAO,UAAW,GAAG,UACnC,oCAAC,oBACC,oCAAC,kBAAe,MAAK,QAAM,SAAS,MAAM,OAAQ,GACjD,SAAS,MAAM,aAAa,oCAAC,YAAM,EAAE,MAAM,SAAS,CAAE,GACtD,SACC,oCAAC,gBAAa,IAAI,GAAG,IAAI,YACtB,EAAE,cAAc,YAAY,CAC/B,GAED,UACA,SAAS,MAAM,QAAQ,oCAAC,QAAK,MAAK,QAAM,MAAM,IAAK,CACtD,CACF;AAAA,EAEJ,OAAO;AACL,WACE,oCAAC,kBAAe,OAAO,UAAW,GAAG,UACnC,oCAAC,sBACE,SAAS,oCAAC,SAAM,OAAc,GAC9B,SACC,oCAAC,gBAAa,IAAI,GAAG,IAAI,YACtB,EAAE,cAAc,YAAY,CAC/B,GAED,UACA,SAAS,MAAM,QAAQ,oCAAC,QAAK,MAAK,QAAM,MAAM,IAAK,CACtD,CACF;AAAA,EAEJ;AACF;AAEA,IAAO,6BAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { useWatch } from "react-hook-form";
|
|
3
|
-
import { FieldBase } from "@digigov/form/Field/FieldBase";
|
|
4
|
-
import { evaluateFieldWithConditions } from "@digigov/form/Field/utils/evaluateFieldWithConditions";
|
|
5
|
-
const ChildFieldMemo = React.memo(
|
|
6
|
-
function ChildField({
|
|
7
|
-
dependencies,
|
|
8
|
-
field,
|
|
9
|
-
control,
|
|
10
|
-
reset,
|
|
11
|
-
register,
|
|
12
|
-
error,
|
|
13
|
-
Field
|
|
14
|
-
}) {
|
|
15
|
-
const newField = evaluateFieldWithConditions(
|
|
16
|
-
field,
|
|
17
|
-
dependencies
|
|
18
|
-
);
|
|
19
|
-
return /* @__PURE__ */ React.createElement(
|
|
20
|
-
FieldBase,
|
|
21
|
-
{
|
|
22
|
-
...newField,
|
|
23
|
-
Field,
|
|
24
|
-
name: newField.key,
|
|
25
|
-
reset,
|
|
26
|
-
control,
|
|
27
|
-
register,
|
|
28
|
-
error
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
},
|
|
32
|
-
(prev, next) => {
|
|
33
|
-
if (!prev || !prev.dependencies) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
if (prev.error !== next.error) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
for (const dep in next.dependencies) {
|
|
40
|
-
if (next.dependencies[dep] !== prev.dependencies[dep]) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
const FieldConditional = ({
|
|
48
|
-
control,
|
|
49
|
-
field,
|
|
50
|
-
register,
|
|
51
|
-
reset,
|
|
52
|
-
error,
|
|
53
|
-
Field
|
|
54
|
-
}) => {
|
|
55
|
-
const dependencyKeys = Object.keys(field.condition);
|
|
56
|
-
const dependencyValues = useWatch({
|
|
57
|
-
name: dependencyKeys,
|
|
58
|
-
control
|
|
59
|
-
});
|
|
60
|
-
const variables = dependencyKeys.reduce(
|
|
61
|
-
(data, fieldKey, index) => ({
|
|
62
|
-
...data,
|
|
63
|
-
[fieldKey]: dependencyValues[index]
|
|
64
|
-
}),
|
|
65
|
-
{}
|
|
66
|
-
);
|
|
67
|
-
return /* @__PURE__ */ React.createElement(
|
|
68
|
-
ChildFieldMemo,
|
|
69
|
-
{
|
|
70
|
-
dependencies: variables,
|
|
71
|
-
field,
|
|
72
|
-
control,
|
|
73
|
-
register,
|
|
74
|
-
reset,
|
|
75
|
-
error,
|
|
76
|
-
Field
|
|
77
|
-
}
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
var FieldConditional_default = FieldConditional;
|
|
81
|
-
export {
|
|
82
|
-
FieldConditional,
|
|
83
|
-
FieldConditional_default as default
|
|
84
|
-
};
|
|
85
|
-
//# sourceMappingURL=FieldConditional.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/Field/FieldConditional.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { useWatch } from 'react-hook-form';\nimport { FieldBase } from '@digigov/form/Field/FieldBase';\nimport {\n ChildFieldMemoProps,\n FieldConditionalProps,\n} from '@digigov/form/Field/types';\nimport { evaluateFieldWithConditions } from '@digigov/form/Field/utils/evaluateFieldWithConditions';\n\nconst ChildFieldMemo = React.memo(\n function ChildField({\n dependencies,\n field,\n control,\n reset,\n register,\n error,\n Field,\n }: ChildFieldMemoProps) {\n const newField = evaluateFieldWithConditions(\n field,\n dependencies as FormData\n );\n return (\n <FieldBase\n {...newField}\n Field={Field}\n name={newField.key}\n reset={reset}\n control={control}\n register={register}\n error={error}\n />\n );\n },\n (prev, next) => {\n if (!prev || !prev.dependencies) {\n return false;\n }\n if (prev.error !== next.error) {\n return false;\n }\n for (const dep in next.dependencies) {\n if (next.dependencies[dep] !== prev.dependencies[dep]) {\n return false;\n }\n }\n return true;\n }\n);\n\nexport const FieldConditional: React.FC<FieldConditionalProps> = ({\n control,\n field,\n register,\n reset,\n error,\n Field,\n}) => {\n const dependencyKeys = Object.keys(field.condition);\n const dependencyValues = useWatch({\n name: dependencyKeys,\n control,\n });\n const variables = dependencyKeys.reduce(\n (data, fieldKey, index) => ({\n ...data,\n [fieldKey]: dependencyValues[index],\n }),\n {}\n );\n return (\n <ChildFieldMemo\n dependencies={variables}\n field={field}\n control={control}\n register={register}\n reset={reset}\n error={error}\n Field={Field}\n />\n );\n};\n\nexport default FieldConditional;\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAK1B,SAAS,mCAAmC;AAE5C,MAAM,iBAAiB,MAAM;AAAA,EAC3B,SAAS,WAAW;AAAA,IAClB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAAwB;AACtB,UAAM,WAAW;AAAA,MACf;AAAA,MACA;AAAA,IACF;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ;AAAA,QACA,MAAM,SAAS;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AAAA,EACA,CAAC,MAAM,SAAS;AACd,QAAI,CAAC,QAAQ,CAAC,KAAK,cAAc;AAC/B,aAAO;AAAA,IACT;AACA,QAAI,KAAK,UAAU,KAAK,OAAO;AAC7B,aAAO;AAAA,IACT;AACA,eAAW,OAAO,KAAK,cAAc;AACnC,UAAI,KAAK,aAAa,GAAG,MAAM,KAAK,aAAa,GAAG,GAAG;AACrD,eAAO;AAAA,MACT;AAAA,IACF;AACA,WAAO;AAAA,EACT;AACF;AAEO,MAAM,mBAAoD,CAAC;AAAA,EAChE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,iBAAiB,OAAO,KAAK,MAAM,SAAS;AAClD,QAAM,mBAAmB,SAAS;AAAA,IAChC,MAAM;AAAA,IACN;AAAA,EACF,CAAC;AACD,QAAM,YAAY,eAAe;AAAA,IAC/B,CAAC,MAAM,UAAU,WAAW;AAAA,MAC1B,GAAG;AAAA,MACH,CAAC,QAAQ,GAAG,iBAAiB,KAAK;AAAA,IACpC;AAAA,IACA,CAAC;AAAA,EACH;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAc;AAAA,MACd;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,2BAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/Field/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/Field/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useMemo } from 'react';\nimport { FieldBase } from '@digigov/form/Field/FieldBase';\nimport FieldConditional from '@digigov/form/Field/FieldConditional';\nimport {\n FieldWithCondition,\n CalculatedField,\n FieldProps,\n} from '@digigov/form/Field/types';\nimport {\n FIELD_COMPONENTS,\n ALTERNATIVE_COMPONENTS,\n} from '@digigov/form/Field/utils';\nimport { calculateField } from '@digigov/form/Field/utils/calculateField';\nimport { useField } from '@digigov/form/Field/utils/useField';\nimport FieldArray from '@digigov/form/FieldArray';\nimport Multiplicity from '@digigov/form/MultiplicityField';\nexport const Field: React.FC<FieldProps> = ({\n name,\n disabled,\n children,\n ...customField\n}) => {\n const {\n field,\n control,\n register,\n reset,\n error,\n componentRegistry,\n formState,\n setValue,\n getValues,\n unregister,\n trigger,\n clearErrors,\n } = useField(name, customField?.type ? customField : null);\n const calculatedField: CalculatedField = useMemo(\n () =>\n calculateField(\n children,\n field,\n {\n ...FIELD_COMPONENTS,\n ...componentRegistry,\n },\n ALTERNATIVE_COMPONENTS\n ),\n [field]\n );\n\n if (calculatedField.condition) {\n return (\n <FieldConditional\n control={control}\n reset={reset}\n register={register}\n field={calculatedField as FieldWithCondition}\n error={error}\n Field={Field}\n />\n );\n }\n if (calculatedField.type === 'array' && !calculatedField.multiplicity) {\n calculatedField.name = name;\n return (\n <FieldArray\n control={control}\n trigger={trigger}\n register={register}\n clearErrors={clearErrors}\n error={error}\n getValues={getValues}\n setValue={setValue}\n formState={formState}\n Field={Field}\n reset={reset}\n {...calculatedField}\n />\n );\n }\n if (\n calculatedField.type === 'array' &&\n calculatedField.multiplicity === true\n ) {\n calculatedField.name = name;\n return (\n <Multiplicity\n control={control}\n register={register}\n trigger={trigger}\n clearErrors={clearErrors}\n error={error}\n formState={formState}\n setValue={setValue}\n getValues={getValues}\n unregister={unregister}\n Field={Field}\n {...calculatedField}\n />\n );\n }\n return (\n <FieldBase\n {...calculatedField}\n name={name}\n disabled={disabled}\n control={control}\n register={register}\n reset={reset}\n error={error}\n Field={Field}\n />\n );\n};\n\nexport default Field;\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,SAAS,eAAe;AAC/B,SAAS,iBAAiB;AAC1B,OAAO,sBAAsB;AAM7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB;AACzB,OAAO,gBAAgB;AACvB,OAAO,kBAAkB;AAClB,MAAM,QAA8B,CAAC;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,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,EACF,IAAI,SAAS,MAAM,aAAa,OAAO,cAAc,IAAI;AACzD,QAAM,kBAAmC;AAAA,IACvC,MACE;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,QACE,GAAG;AAAA,QACH,GAAG;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,IACF,CAAC,KAAK;AAAA,EACR;AAEA,MAAI,gBAAgB,WAAW;AAC7B,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,OAAO;AAAA,QACP;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EAEJ;AACA,MAAI,gBAAgB,SAAS,WAAW,CAAC,gBAAgB,cAAc;AACrE,oBAAgB,OAAO;AACvB,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACA,MACE,gBAAgB,SAAS,WACzB,gBAAgB,iBAAiB,MACjC;AACA,oBAAgB,OAAO;AACvB,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,gBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/Field/package.json
DELETED
package/Field/types/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=types.js.map
|
package/Field/types/package.json
DELETED
package/Field/types.js.map
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
function calculateField(children, field, fieldComponentRegistry, alternativeComponents) {
|
|
2
|
-
const calculatedField = { ...field };
|
|
3
|
-
if (children) {
|
|
4
|
-
calculatedField.component = children;
|
|
5
|
-
calculatedField.controlled = true;
|
|
6
|
-
} else if (typeof field.component === "function") {
|
|
7
|
-
} else if (!field.component && !field.type) {
|
|
8
|
-
calculatedField.component = fieldComponentRegistry.string.component;
|
|
9
|
-
calculatedField.controlled = fieldComponentRegistry.string?.controlled || false;
|
|
10
|
-
} else if (typeof field?.extra?.component === "string" && alternativeComponents[field.extra.component]) {
|
|
11
|
-
calculatedField.controlled = alternativeComponents[field.extra.component]?.controlled || false;
|
|
12
|
-
calculatedField.component = alternativeComponents[field.extra.component].component;
|
|
13
|
-
calculatedField.wrapper = alternativeComponents[field.extra.component].wrapper;
|
|
14
|
-
} else if (!field.component && field.type && fieldComponentRegistry[field.type]) {
|
|
15
|
-
calculatedField.component = fieldComponentRegistry[field.type].component;
|
|
16
|
-
calculatedField.wrapper = fieldComponentRegistry[field.type].wrapper;
|
|
17
|
-
calculatedField.controlled = fieldComponentRegistry[field.type]?.controlled || false;
|
|
18
|
-
} else {
|
|
19
|
-
calculatedField.component = fieldComponentRegistry.string.component;
|
|
20
|
-
calculatedField.controlled = fieldComponentRegistry.string?.controlled || false;
|
|
21
|
-
}
|
|
22
|
-
return calculatedField;
|
|
23
|
-
}
|
|
24
|
-
export {
|
|
25
|
-
calculateField
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=calculateField.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { FieldProps, FieldSpec, FieldComponentRegistry, CalculatedField } from '@digigov/form/Field/types';
|
|
2
|
-
export declare function calculateField(children: FieldProps['children'], field: FieldSpec, fieldComponentRegistry: FieldComponentRegistry, alternativeComponents: FieldComponentRegistry): CalculatedField;
|
|
@@ -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": "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,26 +0,0 @@
|
|
|
1
|
-
function evaluateFieldWithConditions(field, variables) {
|
|
2
|
-
const newField = { ...field };
|
|
3
|
-
if (variables) {
|
|
4
|
-
for (const key in variables) {
|
|
5
|
-
if (field.condition[key] && field.condition[key].is) {
|
|
6
|
-
const is = field.condition[key].is;
|
|
7
|
-
if (is === variables[key] || Array.isArray(variables[key]) && variables[key].includes(is)) {
|
|
8
|
-
const then = field.condition[key].then || {};
|
|
9
|
-
for (const attr in then) {
|
|
10
|
-
newField[attr] = then[attr];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
} else if (field.condition[key]) {
|
|
14
|
-
const otherwise = field.condition[key].else || {};
|
|
15
|
-
for (const attr in otherwise) {
|
|
16
|
-
newField[attr] = otherwise[attr];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return newField;
|
|
22
|
-
}
|
|
23
|
-
export {
|
|
24
|
-
evaluateFieldWithConditions
|
|
25
|
-
};
|
|
26
|
-
//# 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": "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
|
-
}
|