@digigov/form 2.0.0-76ec20a0 → 2.0.0-7d765d3c
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 +3 -3
- package/Field/ErrorGroup.js.map +1 -1
- package/Field/FieldBase/index.js +7 -4
- package/Field/FieldBase.d.ts +1 -1
- package/Field/FieldBase.js.map +2 -2
- package/Field/FieldBaseContainer/index.js +37 -18
- package/Field/FieldBaseContainer.d.ts +2 -2
- package/Field/FieldBaseContainer.js.map +2 -2
- package/Field/FieldConditional/index.js +4 -0
- package/Field/FieldConditional.d.ts +1 -1
- package/Field/FieldConditional.js.map +2 -2
- package/Field/index.d.ts +1 -1
- package/Field/index.js +25 -29
- package/Field/index.js.map +2 -2
- package/Field/types.d.ts +20 -12
- package/Field/utils/evaluateFieldWithConditions.d.ts +2 -2
- package/Field/utils/evaluateFieldWithConditions.js.map +2 -2
- package/Field/utils/resolveField/index.js +35 -0
- package/Field/utils/{calculateField → resolveField}/package.json +1 -1
- package/Field/utils/resolveField.d.ts +3 -0
- package/Field/utils/resolveField.js.map +7 -0
- package/Field/utils/useField/index.js +12 -3
- package/Field/utils/useField.d.ts +1 -1
- package/Field/utils/useField.js.map +2 -2
- package/FieldArray/BaseFieldArray/index.js +76 -0
- package/FieldArray/BaseFieldArray/package.json +6 -0
- package/FieldArray/BaseFieldArray.d.ts +5 -0
- package/FieldArray/BaseFieldArray.js.map +7 -0
- package/FieldArray/FormDialog/ArrayItemDisplay/index.js +97 -0
- package/FieldArray/FormDialog/ArrayItemDisplay/package.json +6 -0
- package/FieldArray/FormDialog/ArrayItemDisplay.d.ts +22 -0
- package/FieldArray/FormDialog/ArrayItemDisplay.js.map +7 -0
- package/FieldArray/FormDialog/ArrayItemHeader/index.js +11 -0
- package/FieldArray/FormDialog/ArrayItemHeader/package.json +6 -0
- package/FieldArray/FormDialog/ArrayItemHeader.d.ts +5 -0
- package/FieldArray/FormDialog/ArrayItemHeader.js.map +7 -0
- package/FieldArray/FormDialog/ArrayItemModal/index.js +158 -0
- package/{inputs/Input/inputsInputScenarios → FieldArray/FormDialog/ArrayItemModal}/package.json +1 -1
- package/FieldArray/FormDialog/ArrayItemModal.d.ts +26 -0
- package/FieldArray/FormDialog/ArrayItemModal.js.map +7 -0
- package/FieldArray/FormDialog/index.d.ts +19 -0
- package/FieldArray/FormDialog/index.js +152 -258
- package/FieldArray/FormDialog/index.js.map +7 -0
- package/FieldArray/index.d.ts +5 -2
- package/FieldArray/index.js +36 -57
- package/FieldArray/index.js.map +2 -2
- package/FieldObject/index.d.ts +7 -4
- package/FieldObject/index.js +29 -25
- package/FieldObject/index.js.map +2 -2
- package/Fieldset/FieldsetWithContext.js.map +1 -1
- package/Fieldset/index.d.ts +1 -1
- package/Fieldset/index.js.map +1 -1
- package/Fieldset/types.d.ts +2 -2
- package/FormBuilder/index.d.ts +2 -2
- package/FormBuilder/index.js +163 -134
- package/FormBuilder/index.js.map +2 -2
- package/FormContext/index.js +6 -2
- package/FormContext.d.ts +3 -2
- package/FormContext.js.map +2 -2
- package/MultiplicityField/add-objects/index.js +12 -19
- package/MultiplicityField/add-objects.d.ts +1 -1
- package/MultiplicityField/add-objects.js.map +2 -2
- package/MultiplicityField/index.d.ts +2 -2
- package/MultiplicityField/index.js +4 -1
- package/MultiplicityField/index.js.map +2 -2
- package/MultiplicityField/types.d.ts +3 -2
- package/Questions/Questions.d.ts +1 -1
- package/Questions/Questions.js.map +1 -1
- package/Questions/QuestionsContext.d.ts +1 -1
- package/Questions/QuestionsContext.js.map +1 -1
- package/Questions/Step/Step.d.ts +1 -1
- package/Questions/Step/Step.js.map +1 -1
- package/Questions/Step/StepArrayReview.d.ts +1 -1
- package/Questions/Step/StepArrayReview.js.map +1 -1
- package/Questions/Step/StepContext.d.ts +1 -1
- package/Questions/Step/StepContext.js.map +1 -1
- package/Questions/Step/StepDescription.d.ts +1 -1
- package/Questions/Step/StepDescription.js.map +2 -2
- package/Questions/Step/StepForm.d.ts +2 -2
- package/Questions/Step/StepForm.js.map +1 -1
- package/Questions/Step/StepQuote.d.ts +1 -1
- package/Questions/Step/StepQuote.js.map +2 -2
- package/Questions/Step/StepTitle.d.ts +1 -1
- package/Questions/Step/StepTitle.js.map +2 -2
- package/Questions/Step/getAddMoreFields.d.ts +2 -2
- package/Questions/Step/getAddMoreFields.js.map +1 -1
- package/Questions/Step/types.d.ts +1 -1
- package/Questions/getNextStep.d.ts +1 -1
- package/Questions/getNextStep.js.map +1 -1
- package/Questions/types.d.ts +1 -1
- package/cjs/Field/ErrorGroup.js.map +1 -1
- package/cjs/Field/FieldBase/index.js +7 -4
- package/cjs/Field/FieldBase.js.map +2 -2
- package/cjs/Field/FieldBaseContainer/index.js +36 -17
- package/cjs/Field/FieldBaseContainer.js.map +3 -3
- package/cjs/Field/FieldConditional/index.js +4 -0
- package/cjs/Field/FieldConditional.js.map +2 -2
- package/cjs/Field/index.js +25 -26
- package/cjs/Field/index.js.map +2 -2
- package/cjs/Field/types.js.map +1 -1
- package/cjs/Field/utils/evaluateFieldWithConditions.js.map +2 -2
- package/cjs/Field/utils/resolveField/index.js +55 -0
- package/cjs/Field/utils/resolveField.js.map +7 -0
- package/cjs/Field/utils/useField/index.js +12 -3
- package/cjs/Field/utils/useField.js.map +2 -2
- package/cjs/FieldArray/BaseFieldArray/index.js +109 -0
- package/cjs/FieldArray/BaseFieldArray.js.map +7 -0
- package/cjs/FieldArray/FormDialog/ArrayItemDisplay/index.js +130 -0
- package/cjs/FieldArray/FormDialog/ArrayItemDisplay.js.map +7 -0
- package/cjs/{locales/el → FieldArray/FormDialog/ArrayItemHeader}/index.js +16 -7
- package/cjs/FieldArray/FormDialog/ArrayItemHeader.js.map +7 -0
- package/cjs/FieldArray/FormDialog/ArrayItemModal/index.js +186 -0
- package/cjs/FieldArray/FormDialog/ArrayItemModal.js.map +7 -0
- package/cjs/FieldArray/FormDialog/index.js +148 -243
- package/cjs/FieldArray/FormDialog/index.js.map +7 -0
- package/cjs/FieldArray/index.js +35 -56
- package/cjs/FieldArray/index.js.map +3 -3
- package/cjs/FieldObject/index.js +29 -22
- package/cjs/FieldObject/index.js.map +2 -2
- package/cjs/Fieldset/FieldsetWithContext.js.map +1 -1
- package/cjs/Fieldset/index.js.map +1 -1
- package/cjs/Fieldset/types.js.map +1 -1
- package/cjs/FormBuilder/index.js +164 -135
- package/cjs/FormBuilder/index.js.map +3 -3
- package/cjs/FormContext/index.js +7 -2
- package/cjs/FormContext.js.map +2 -2
- package/cjs/MultiplicityField/add-objects/index.js +11 -13
- package/cjs/MultiplicityField/add-objects.js.map +2 -2
- package/cjs/MultiplicityField/index.js +4 -1
- package/cjs/MultiplicityField/index.js.map +2 -2
- package/cjs/MultiplicityField/types.js.map +1 -1
- package/cjs/Questions/Questions.js.map +1 -1
- package/cjs/Questions/QuestionsContext.js.map +1 -1
- package/cjs/Questions/Step/Step.js.map +1 -1
- package/cjs/Questions/Step/StepArrayReview.js.map +1 -1
- package/cjs/Questions/Step/StepContext.js.map +1 -1
- package/cjs/Questions/Step/StepDescription.js.map +2 -2
- package/cjs/Questions/Step/StepForm.js.map +1 -1
- package/cjs/Questions/Step/StepQuote.js.map +2 -2
- package/cjs/Questions/Step/StepTitle.js.map +2 -2
- package/cjs/Questions/Step/getAddMoreFields.js.map +1 -1
- package/cjs/Questions/Step/types.js.map +1 -1
- package/cjs/Questions/getNextStep.js.map +1 -1
- package/cjs/Questions/types.js.map +1 -1
- package/cjs/hooks/useFieldFocusManager/index.js +135 -0
- package/cjs/hooks/useFieldFocusManager.js.map +7 -0
- package/cjs/hooks/utils/index.js +98 -0
- package/cjs/hooks/utils.js.map +7 -0
- package/cjs/inputs/AutoCompleteInput/index.js.map +2 -2
- package/cjs/inputs/Checkboxes/index.js +67 -63
- package/cjs/inputs/Checkboxes/index.js.map +2 -2
- package/cjs/inputs/DateInput/index.js +51 -19
- package/cjs/inputs/DateInput/index.js.map +2 -2
- package/cjs/inputs/DateTimeInput/index.js +78 -39
- package/cjs/inputs/DateTimeInput/index.js.map +2 -2
- package/cjs/inputs/FileInput/index.js +52 -29
- package/cjs/inputs/FileInput/index.js.map +2 -2
- package/cjs/inputs/ImageInput/__stories__/logo.d/index.js +1 -0
- package/cjs/inputs/ImageInput/__stories__/logo.d.js.map +7 -0
- package/cjs/inputs/ImageInput/index.js +41 -10
- package/cjs/inputs/ImageInput/index.js.map +2 -2
- package/cjs/inputs/Input/index.js +55 -57
- package/cjs/inputs/Input/index.js.map +2 -2
- package/cjs/inputs/Label/index.js.map +1 -1
- package/cjs/inputs/OtpInput/index.js +36 -31
- package/cjs/inputs/OtpInput/index.js.map +2 -2
- package/cjs/inputs/Radio/index.js +5 -4
- package/cjs/inputs/Radio/index.js.map +3 -3
- package/cjs/inputs/Select/index.js +4 -3
- package/cjs/inputs/Select/index.js.map +2 -2
- package/cjs/{Field/utils → inputs/registry}/index.js +7 -5
- package/cjs/inputs/registry.js.map +7 -0
- package/cjs/lazy/index.js +10 -9
- package/cjs/lazy.js.map +2 -2
- package/cjs/registry/index.js +26 -18
- package/cjs/registry.js.map +2 -2
- package/cjs/types.js.map +1 -1
- package/cjs/utils/index.js +20 -6
- package/cjs/utils.js.map +2 -2
- package/cjs/validators/index.js +11 -6
- package/cjs/validators/index.js.map +2 -2
- package/cjs/validators/types.js.map +1 -1
- package/cjs/validators/utils/amka/index.js +60 -0
- package/cjs/validators/utils/amka.js.map +7 -0
- package/cjs/validators/utils/date/index.js +26 -3
- package/cjs/validators/utils/date.js.map +2 -2
- package/cjs/validators/utils/datetime/index.js +118 -24
- package/cjs/validators/utils/datetime.js.map +2 -2
- package/cjs/validators/utils/file/index.js +30 -17
- package/cjs/validators/utils/file.js.map +2 -2
- package/cjs/validators/utils/iban.js.map +1 -1
- package/cjs/validators/utils/image.js.map +1 -1
- package/cjs/validators/utils/index.js +5 -1
- package/cjs/validators/utils/index.js.map +2 -2
- package/cjs/validators/utils/int.js.map +1 -1
- package/cjs/validators/utils/number.js.map +1 -1
- package/cjs/validators/utils/otp.js.map +1 -1
- package/cjs/validators/utils/phone.js.map +1 -1
- package/cjs/validators/utils/postal_code.js.map +1 -1
- package/cjs/validators/utils/text_limit.js.map +1 -1
- package/hooks/useFieldFocusManager/index.js +116 -0
- package/hooks/useFieldFocusManager/package.json +6 -0
- package/hooks/useFieldFocusManager.d.ts +25 -0
- package/hooks/useFieldFocusManager.js.map +7 -0
- package/hooks/utils/index.js +73 -0
- package/{Field → hooks}/utils/package.json +1 -1
- package/hooks/utils.d.ts +18 -0
- package/hooks/utils.js.map +7 -0
- package/index.js +1 -1
- package/inputs/AutoCompleteInput/index.d.ts +3 -3
- package/inputs/AutoCompleteInput/index.js +1 -3
- package/inputs/AutoCompleteInput/index.js.map +2 -2
- package/inputs/Checkboxes/index.d.ts +3 -3
- package/inputs/Checkboxes/index.js +67 -63
- package/inputs/Checkboxes/index.js.map +2 -2
- package/inputs/DateInput/DateInput.stories.d.ts +4 -0
- package/inputs/DateInput/__stories__/WithDefaultValue.d.ts +3 -0
- package/inputs/DateInput/__stories__/WithInitialValue.d.ts +3 -0
- package/inputs/DateInput/__stories__/WithWrongDefaultValue.d.ts +3 -0
- package/inputs/DateInput/__stories__/WithWrongInitialValue.d.ts +3 -0
- package/inputs/DateInput/index.d.ts +2 -5
- package/inputs/DateInput/index.js +52 -20
- package/inputs/DateInput/index.js.map +2 -2
- package/inputs/DateTimeInput/DateTimeInput.stories.d.ts +8 -3
- package/inputs/DateTimeInput/__stories__/WithDefaultValue.d.ts +3 -0
- package/inputs/DateTimeInput/__stories__/WithInitialValue.d.ts +3 -0
- package/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.d.ts +3 -0
- package/inputs/DateTimeInput/__stories__/WithWrongInitialValue.d.ts +3 -0
- package/inputs/DateTimeInput/index.d.ts +2 -5
- package/inputs/DateTimeInput/index.js +79 -40
- package/inputs/DateTimeInput/index.js.map +2 -2
- package/inputs/FileInput/FileInput.stories.d.ts +1 -0
- package/inputs/FileInput/__stories__/WithBorderAndLink.d.ts +3 -0
- package/inputs/FileInput/index.d.ts +12 -5
- package/inputs/FileInput/index.js +53 -30
- package/inputs/FileInput/index.js.map +2 -2
- package/inputs/ImageInput/ImageInput.stories.d.ts +2 -1
- package/inputs/ImageInput/__stories__/WithInitialValues.d.ts +3 -0
- package/inputs/ImageInput/__stories__/logo.d/index.js +1 -0
- package/inputs/ImageInput/__stories__/logo.d/package.json +6 -0
- package/inputs/ImageInput/__stories__/logo.d.js.map +7 -0
- package/inputs/ImageInput/index.d.ts +10 -2
- package/inputs/ImageInput/index.js +42 -11
- package/inputs/ImageInput/index.js.map +2 -2
- package/inputs/Input/Input.stories.d.ts +2 -0
- package/inputs/Input/__stories__/AMKA.d.ts +3 -0
- package/inputs/Input/__stories__/Email.d.ts +3 -0
- package/inputs/Input/index.d.ts +4 -3
- package/inputs/Input/index.js +55 -57
- package/inputs/Input/index.js.map +2 -2
- package/inputs/Label/index.d.ts +1 -1
- package/inputs/Label/index.js.map +1 -1
- package/inputs/OtpInput/index.d.ts +1 -5
- package/inputs/OtpInput/index.js +36 -31
- package/inputs/OtpInput/index.js.map +2 -2
- package/inputs/Radio/index.d.ts +4 -4
- package/inputs/Radio/index.js +5 -4
- package/inputs/Radio/index.js.map +3 -3
- package/inputs/Select/index.d.ts +4 -3
- package/inputs/Select/index.js +4 -3
- package/inputs/Select/index.js.map +2 -2
- package/{Field/utils → inputs/registry}/index.js +4 -2
- package/{locales/el → inputs/registry}/package.json +1 -1
- package/{Field/utils/index.d.ts → inputs/registry.d.ts} +2 -1
- package/inputs/registry.js.map +7 -0
- package/lazy/index.js +10 -9
- package/package.json +8 -8
- package/registry/index.js +26 -18
- package/src/Field/ErrorGroup.tsx +3 -3
- package/src/Field/FieldBase.tsx +7 -4
- package/src/Field/FieldBaseContainer.tsx +69 -48
- package/src/Field/FieldConditional.tsx +5 -1
- package/src/Field/index.tsx +30 -38
- package/src/Field/types.tsx +21 -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/FormDialog/ArrayItemDisplay.tsx +165 -0
- package/src/FieldArray/FormDialog/ArrayItemHeader.tsx +15 -0
- package/src/FieldArray/FormDialog/ArrayItemModal.tsx +223 -0
- package/src/FieldArray/FormDialog/index.tsx +233 -0
- package/src/FieldArray/__stories__/WithModal.tsx +3 -2
- package/src/FieldArray/__tests__/multiplicity-attachment.spec.tsx +219 -0
- package/src/FieldArray/__tests__/multiplicity-required.spec.tsx +131 -0
- package/src/FieldArray/__tests__/preference-multiple-choice.spec.tsx +222 -0
- package/src/FieldArray/index.spec.tsx +355 -0
- package/src/FieldArray/index.tsx +41 -72
- 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/index.tsx +197 -146
- package/src/FormBuilder/scenarios.test.tsx +763 -5
- package/src/FormContext.tsx +7 -2
- 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/index.tsx +4 -6
- package/src/inputs/Checkboxes/index.tsx +95 -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/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/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/index.test.tsx +4 -0
- package/src/inputs/FileInput/index.tsx +91 -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/index.test.tsx +21 -17
- package/src/inputs/ImageInput/index.tsx +101 -49
- package/src/inputs/Input/Input.stories.js +2 -0
- package/src/inputs/Input/__stories__/AMKA.tsx +23 -0
- package/src/inputs/Input/__stories__/Email.tsx +23 -0
- package/src/inputs/Input/index.test.tsx +8 -0
- package/src/inputs/Input/index.tsx +76 -73
- package/src/inputs/Label/index.tsx +1 -1
- package/src/inputs/OtpInput/index.tsx +43 -34
- package/src/inputs/Radio/index.tsx +29 -21
- package/src/inputs/Select/index.tsx +9 -6
- package/src/{Field/utils/index.ts → inputs/registry.ts} +5 -1
- package/src/lazy.js +10 -9
- package/src/registry.js +26 -18
- package/src/types.tsx +13 -5
- package/src/utils.ts +30 -8
- package/src/validators/index.ts +27 -15
- 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/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 +6 -3
- 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 +9 -4
- package/types.js.map +1 -1
- package/utils/index.js +20 -6
- package/utils.d.ts +3 -1
- package/utils.js.map +2 -2
- package/validators/index.d.ts +6 -6
- package/validators/index.js +12 -6
- package/validators/index.js.map +2 -2
- package/validators/types.d.ts +1 -1
- package/validators/utils/amka/index.js +36 -0
- package/{inputs/inputsScenarios → validators/utils/amka}/package.json +1 -1
- package/validators/utils/amka.d.ts +6 -0
- package/validators/utils/amka.js.map +7 -0
- package/validators/utils/date/index.js +26 -3
- package/validators/utils/date.d.ts +3 -3
- package/validators/utils/date.js.map +2 -2
- package/validators/utils/datetime/index.js +118 -24
- package/validators/utils/datetime.d.ts +3 -3
- package/validators/utils/datetime.js.map +2 -2
- package/validators/utils/file/index.js +30 -17
- package/validators/utils/file.d.ts +2 -2
- package/validators/utils/file.js.map +2 -2
- package/validators/utils/iban.d.ts +2 -2
- package/validators/utils/iban.js.map +1 -1
- package/validators/utils/image.d.ts +2 -2
- package/validators/utils/image.js.map +1 -1
- package/validators/utils/index.d.ts +3 -2
- package/validators/utils/index.js +4 -1
- package/validators/utils/index.js.map +2 -2
- package/validators/utils/int.d.ts +1 -1
- package/validators/utils/int.js.map +1 -1
- package/validators/utils/number.d.ts +1 -1
- package/validators/utils/number.js.map +1 -1
- package/validators/utils/otp.d.ts +2 -2
- package/validators/utils/otp.js.map +1 -1
- package/validators/utils/phone.d.ts +2 -2
- package/validators/utils/phone.js.map +1 -1
- package/validators/utils/postal_code.d.ts +2 -2
- package/validators/utils/postal_code.js.map +1 -1
- package/validators/utils/text_limit.d.ts +2 -2
- package/validators/utils/text_limit.js.map +1 -1
- package/Field/utils/calculateField/index.js +0 -27
- package/Field/utils/calculateField.d.ts +0 -2
- package/Field/utils/calculateField.js.map +0 -7
- package/Field/utils/index.js.map +0 -7
- package/FieldArray/FormDialog.d.ts +0 -53
- package/FieldArray/FormDialog.js.map +0 -7
- package/FormBuilder/index.test.d.ts +0 -1
- package/FormBuilder/interaction.test.d.ts +0 -1
- package/FormBuilder/scenarios.test.d.ts +0 -88
- package/MultiplicityField/index.test.d.ts +0 -1
- package/Questions/index.spec.d.ts +0 -1
- package/Questions/index.test.d.ts +0 -1
- package/cjs/Field/utils/calculateField/index.js +0 -50
- package/cjs/Field/utils/calculateField.js.map +0 -7
- package/cjs/Field/utils/index.js.map +0 -7
- package/cjs/FieldArray/FormDialog.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/inputsScenarios/index.js +0 -533
- package/cjs/inputs/inputsScenarios.js.map +0 -7
- package/cjs/locales/el.js.map +0 -7
- package/inputs/AutoCompleteInput/index.test.d.ts +0 -1
- package/inputs/Checkboxes/index.test.d.ts +0 -1
- package/inputs/DateInput/index.test.d.ts +0 -1
- package/inputs/DateTimeInput/index.test.d.ts +0 -1
- package/inputs/FileInput/index.test.d.ts +0 -1
- package/inputs/ImageInput/index.test.d.ts +0 -1
- package/inputs/Input/index.test.d.ts +0 -1
- package/inputs/Input/inputsInputScenarios/index.js +0 -406
- package/inputs/Input/inputsInputScenarios.d.ts +0 -57
- package/inputs/Input/inputsInputScenarios.js.map +0 -7
- package/inputs/Label/index.test.d.ts +0 -1
- package/inputs/OtpInput/index.test.d.ts +0 -1
- package/inputs/Radio/index.test.d.ts +0 -1
- package/inputs/Select/index.test.d.ts +0 -1
- package/inputs/inputsScenarios/index.js +0 -499
- package/inputs/inputsScenarios.d.ts +0 -296
- package/inputs/inputsScenarios.js.map +0 -7
- package/locales/el/index.js +0 -6
- package/locales/el.d.ts +0 -2
- package/locales/el.js.map +0 -7
- 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/locales/el.ts +0 -3
- /package/{FieldArray/index.test.d.ts → hooks/__tests__/utils.spec.d.ts} +0 -0
package/FormContext/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { createContext } from "react";
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
2
|
const FormContext = createContext({
|
|
3
3
|
fieldsMap: {},
|
|
4
4
|
fieldsetsMap: {}
|
|
5
5
|
});
|
|
6
|
+
const useFormContext = () => {
|
|
7
|
+
return useContext(FormContext);
|
|
8
|
+
};
|
|
6
9
|
export {
|
|
7
|
-
FormContext
|
|
10
|
+
FormContext,
|
|
11
|
+
useFormContext
|
|
8
12
|
};
|
|
9
13
|
//# sourceMappingURL=FormContext.js.map
|
package/FormContext.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormContextProps } from '@digigov/form/types';
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { FormContextProps } from '@digigov/form/types';
|
|
3
3
|
export declare const FormContext: React.Context<FormContextProps>;
|
|
4
|
+
export declare const useFormContext: () => FormContextProps;
|
package/FormContext.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/FormContext.tsx"],
|
|
4
|
-
"sourcesContent": ["import React
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type React from 'react';\nimport { createContext, useContext } from 'react';\nimport type { FormContextProps } from '@digigov/form/types';\n\nexport const FormContext: React.Context<FormContextProps> = createContext({\n fieldsMap: {},\n fieldsetsMap: {},\n} as FormContextProps);\n\nexport const useFormContext = () => {\n return useContext(FormContext);\n};\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,eAAe,kBAAkB;AAGnC,MAAM,cAA+C,cAAc;AAAA,EACxE,WAAW,CAAC;AAAA,EACZ,cAAc,CAAC;AACjB,CAAqB;AAEd,MAAM,iBAAiB,MAAM;AAClC,SAAO,WAAW,WAAW;AAC/B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useMemo } from "react";
|
|
2
|
-
import {
|
|
3
|
-
useWatch
|
|
4
|
-
} from "react-hook-form";
|
|
2
|
+
import { useWatch } from "react-hook-form";
|
|
5
3
|
import { FieldBase } from "@digigov/form/Field/FieldBase";
|
|
6
|
-
import {
|
|
7
|
-
FIELD_COMPONENTS,
|
|
8
|
-
ALTERNATIVE_COMPONENTS
|
|
9
|
-
} from "@digigov/form/Field/utils";
|
|
10
|
-
import { calculateField } from "@digigov/form/Field/utils/calculateField";
|
|
4
|
+
import { resolveField } from "@digigov/form/Field/utils/resolveField";
|
|
11
5
|
import { useField } from "@digigov/form/Field/utils/useField";
|
|
12
6
|
import { FieldObject } from "@digigov/form/FieldObject";
|
|
13
7
|
import { Fieldset } from "@digigov/form/Fieldset";
|
|
@@ -26,6 +20,7 @@ const AddObjects = ({
|
|
|
26
20
|
setValue,
|
|
27
21
|
stashedObjects,
|
|
28
22
|
getValues,
|
|
23
|
+
resetField,
|
|
29
24
|
onStash,
|
|
30
25
|
error,
|
|
31
26
|
Field
|
|
@@ -108,10 +103,7 @@ const AddObjects = ({
|
|
|
108
103
|
reset,
|
|
109
104
|
error: needsMoreError
|
|
110
105
|
} = useField(radioField.key, radioField?.type ? radioField : null);
|
|
111
|
-
const
|
|
112
|
-
() => calculateField(children, field, FIELD_COMPONENTS, ALTERNATIVE_COMPONENTS),
|
|
113
|
-
[field]
|
|
114
|
-
);
|
|
106
|
+
const resolvedField = useMemo(() => resolveField(children, field), [field]);
|
|
115
107
|
const needsMore = useWatch({ name: field.key, control });
|
|
116
108
|
useEffect(() => {
|
|
117
109
|
if (needsMore === "yes") {
|
|
@@ -122,24 +114,25 @@ const AddObjects = ({
|
|
|
122
114
|
}
|
|
123
115
|
if (needsMore === "") clearErrors("needs-more");
|
|
124
116
|
}, [needsMore]);
|
|
125
|
-
|
|
117
|
+
resolvedField.label = resolvedField.label || {};
|
|
126
118
|
if (extra?.length) {
|
|
127
|
-
|
|
119
|
+
resolvedField.label.secondary = `\u0388\u03C7\u03B5\u03C4\u03B5 \u03C0\u03C1\u03BF\u03C3\u03B8\u03AD\u03C3\u03B5\u03B9 ${stashedObjects.length} \u03B5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AD\u03C2 \u03BA\u03B1\u03B9 \u03C3\u03B1\u03C2 \u03B1\u03C0\u03BF\u03BC\u03AD\u03BD\u03BF\u03C5\u03BD \u03B1\u03BA\u03CC\u03BC\u03B1 ${extra.length - stashedObjects.length} \u03B5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AD\u03C2.`;
|
|
128
120
|
} else if (extra?.min && extra?.max) {
|
|
129
|
-
|
|
121
|
+
resolvedField.label.secondary = `\u03A4\u03BF \u03C0\u03B5\u03B4\u03AF\u03BF \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 \u03B1\u03BA\u03CC\u03BC\u03B1 ${extra?.min - stashedObjects.length} \u03BA\u03B1\u03B9 \u03C4\u03BF \u03BC\u03AD\u03B3\u03B9\u03C3\u03C4\u03BF ${extra?.max} \u03B5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AD\u03C2. \u03A0\u03C1\u03BF\u03C3\u03B8\u03AD\u03C3\u03C4\u03B5 \u03BC\u03B9\u03B1 \u03B1\u03BA\u03CC\u03BC\u03B1 \u03B5\u03C0\u03B9\u03BB\u03AD\u03B3\u03BF\u03BD\u03C4\u03B1\u03C2 \u03C4\u03B7\u03BD \u03B1\u03C0\u03AC\u03BD\u03C4\u03B7\u03C3\u03B7 \xAB\u039D\u03B1\u03B9\xBB \u03C3\u03C4\u03B7\u03BD \u03B5\u03C0\u03CC\u03BC\u03B5\u03BD\u03B7 \u03B5\u03C1\u03CE\u03C4\u03B7\u03C3\u03B7.`;
|
|
130
122
|
} else if (extra?.min) {
|
|
131
|
-
|
|
123
|
+
resolvedField.label.secondary = `\u03A4\u03BF \u03C0\u03B5\u03B4\u03AF\u03BF \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 \u03B1\u03BA\u03CC\u03BC\u03B1 ${extra?.min - stashedObjects.length} \u03B5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AD\u03C2. \u03A0\u03C1\u03BF\u03C3\u03B8\u03AD\u03C3\u03C4\u03B5 \u03BC\u03B9\u03B1 \u03B1\u03BA\u03CC\u03BC\u03B1 \u03B5\u03C0\u03B9\u03BB\u03AD\u03B3\u03BF\u03BD\u03C4\u03B1\u03C2 \u03C4\u03B7\u03BD \u03B1\u03C0\u03AC\u03BD\u03C4\u03B7\u03C3\u03B7 \xAB\u039D\u03B1\u03B9\xBB \u03C3\u03C4\u03B7\u03BD \u03B5\u03C0\u03CC\u03BC\u03B5\u03BD\u03B7 \u03B5\u03C1\u03CE\u03C4\u03B7\u03C3\u03B7.`;
|
|
132
124
|
} else if (extra?.max) {
|
|
133
|
-
|
|
125
|
+
resolvedField.label.secondary = ` \u0388\u03C7\u03B5\u03C4\u03B5 \u03C0\u03C1\u03BF\u03C3\u03B8\u03AD\u03C3\u03B5\u03B9 ${stashedObjects.length} \u03B5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AD\u03C2 \u03BA\u03B1\u03B9 \u03C3\u03B1\u03C2 \u03B1\u03C0\u03BF\u03BC\u03AD\u03BD\u03BF\u03C5\u03BD ${extra.max - stashedObjects.length} \u03B5\u03C0\u03B9\u03C0\u03BB\u03AD\u03BF\u03BD \u03B5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AD\u03C2.`;
|
|
134
126
|
}
|
|
135
127
|
return /* @__PURE__ */ React.createElement(Fieldset, null, /* @__PURE__ */ React.createElement(
|
|
136
128
|
FieldBase,
|
|
137
129
|
{
|
|
138
|
-
...
|
|
139
|
-
name:
|
|
130
|
+
...resolvedField,
|
|
131
|
+
name: resolvedField.key,
|
|
140
132
|
control,
|
|
141
133
|
register,
|
|
142
134
|
reset,
|
|
135
|
+
resetField,
|
|
143
136
|
Field,
|
|
144
137
|
error: extra?.max - stashedObjects.length === 0 || extra?.length - stashedObjects.length === 0 ? error : needsMoreError
|
|
145
138
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ErrorOption, FieldArrayWithId, UseFieldArrayReturn } from 'react-hook-form';
|
|
2
|
+
import type { ErrorOption, FieldArrayWithId, UseFieldArrayReturn } from 'react-hook-form';
|
|
3
3
|
import type { MultiplicityProps, StashedObject } from '@digigov/form/MultiplicityField/types';
|
|
4
4
|
export interface AddObjectsProps extends Omit<MultiplicityProps, 'key' | 'component'> {
|
|
5
5
|
fields: FieldArrayWithId[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/MultiplicityField/add-objects.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useEffect, useMemo } from 'react';\nimport {\n ErrorOption,\n FieldArrayWithId,\n UseFieldArrayReturn,\n
|
|
5
|
-
"mappings": "AAAA,OAAO,SAAS,WAAW,eAAe;
|
|
4
|
+
"sourcesContent": ["import React, { useEffect, useMemo } from 'react';\nimport type {\n ErrorOption,\n FieldArrayWithId,\n UseFieldArrayReturn,\n} from 'react-hook-form';\nimport { useWatch } from 'react-hook-form';\nimport { FieldBase } from '@digigov/form/Field/FieldBase';\nimport { resolveField } from '@digigov/form/Field/utils/resolveField';\nimport { useField } from '@digigov/form/Field/utils/useField';\nimport { FieldObject } from '@digigov/form/FieldObject';\nimport { Fieldset } from '@digigov/form/Fieldset';\nimport type {\n MultiplicityProps,\n StashedObject,\n} from '@digigov/form/MultiplicityField/types';\nimport type { FieldSpec } from '@digigov/form/types';\nimport { Button } from '@digigov/ui/form/Button';\nimport { RadioConditional } from '@digigov/ui/form/RadioContainer';\n\nexport interface AddObjectsProps\n extends Omit<MultiplicityProps, 'key' | 'component'> {\n fields: FieldArrayWithId[];\n error?: ErrorOption;\n append: UseFieldArrayReturn['append'];\n remove: UseFieldArrayReturn['remove'];\n stashedObjects: StashedObject[];\n onStash: (arg0: StashedObject) => void;\n children?: React.ReactNode;\n}\n\nexport const AddObjects: React.FC<AddObjectsProps> = ({\n name,\n fields,\n formState,\n extra,\n append,\n remove,\n trigger,\n clearErrors,\n children,\n setValue,\n stashedObjects,\n getValues,\n resetField,\n onStash,\n error,\n Field,\n}) => {\n const currentIndex = fields.length > 0 ? fields.length - 1 : fields.length;\n const currentName = `${name}.${currentIndex}`;\n const radioField: FieldSpec = {\n key: 'needs-more',\n type: 'choice:single',\n label: {\n primary: extra?.label.question.title,\n },\n required: true,\n validators: [\n {\n name: 'is-locked',\n message: 'form.error.needs-more',\n test: (data) => {\n return data === 'no';\n },\n },\n ],\n extra: {\n options: [\n {\n label: { primary: extra?.label.question.yes },\n id: `radio-input-${name}-yes`,\n value: 'yes',\n selected: function RadioSelected() {\n return (\n <RadioConditional\n hidden={\n needsMore !== 'yes' ||\n (extra?.max && extra?.max - stashedObjects.length === 0)\n }\n >\n {needsMore === 'yes' && fields.length > 0 && (\n <>\n <FieldObject\n name={currentName}\n error={error && error[currentIndex]}\n register={register}\n formState={formState}\n control={control}\n {...extra?.of}\n label={\n extra?.label.question.objectLabel || extra?.of.label\n }\n />\n <Button\n color=\"secondary\"\n name={`${currentName}-add-object`}\n onClick={async (e) => {\n e.preventDefault();\n const nestedFields = extra?.of.extra.fields.map(\n (f) => `${currentName}.${f.key}`\n );\n const result = await trigger(nestedFields);\n if (result) {\n setValue('needs-more', '');\n onStash(getValues(currentName));\n }\n }}\n >\n {extra?.label.object.add}\n </Button>\n </>\n )}\n </RadioConditional>\n );\n },\n },\n {\n label: { primary: extra?.label.question.no },\n id: `radio-input-${name}-no`,\n value: 'no',\n },\n ],\n },\n };\n\n const {\n field,\n control,\n register,\n reset,\n error: needsMoreError,\n } = useField(radioField.key, radioField?.type ? radioField : null);\n\n const resolvedField = useMemo(() => resolveField(children, field), [field]);\n const needsMore = useWatch({ name: field.key, control });\n\n useEffect(() => {\n if (needsMore === 'yes') {\n append({ afm: '', firstName: '', lastName: '' });\n }\n if (needsMore === 'no' && stashedObjects.length < fields.length) {\n remove(currentIndex);\n }\n if (needsMore === '') clearErrors('needs-more');\n }, [needsMore]);\n\n // TODO: Refactor types so that label is always required, the following\n // assignment is a temp fix for typescript build to run\n resolvedField.label = resolvedField.label || {};\n if (extra?.length) {\n resolvedField.label.secondary = `\u0388\u03C7\u03B5\u03C4\u03B5 \u03C0\u03C1\u03BF\u03C3\u03B8\u03AD\u03C3\u03B5\u03B9 ${\n stashedObjects.length\n } \u03B5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AD\u03C2 \u03BA\u03B1\u03B9 \u03C3\u03B1\u03C2 \u03B1\u03C0\u03BF\u03BC\u03AD\u03BD\u03BF\u03C5\u03BD \u03B1\u03BA\u03CC\u03BC\u03B1 ${\n extra.length - stashedObjects.length\n } \u03B5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AD\u03C2.`;\n } else if (extra?.min && extra?.max) {\n resolvedField.label.secondary = `\u03A4\u03BF \u03C0\u03B5\u03B4\u03AF\u03BF \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 \u03B1\u03BA\u03CC\u03BC\u03B1 ${\n extra?.min - stashedObjects.length\n } \u03BA\u03B1\u03B9 \u03C4\u03BF \u03BC\u03AD\u03B3\u03B9\u03C3\u03C4\u03BF ${\n extra?.max\n } \u03B5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AD\u03C2. \u03A0\u03C1\u03BF\u03C3\u03B8\u03AD\u03C3\u03C4\u03B5 \u03BC\u03B9\u03B1 \u03B1\u03BA\u03CC\u03BC\u03B1 \u03B5\u03C0\u03B9\u03BB\u03AD\u03B3\u03BF\u03BD\u03C4\u03B1\u03C2 \u03C4\u03B7\u03BD \u03B1\u03C0\u03AC\u03BD\u03C4\u03B7\u03C3\u03B7 \u00AB\u039D\u03B1\u03B9\u00BB \u03C3\u03C4\u03B7\u03BD \u03B5\u03C0\u03CC\u03BC\u03B5\u03BD\u03B7 \u03B5\u03C1\u03CE\u03C4\u03B7\u03C3\u03B7.`;\n } else if (extra?.min) {\n resolvedField.label.secondary = `\u03A4\u03BF \u03C0\u03B5\u03B4\u03AF\u03BF \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 \u03B1\u03BA\u03CC\u03BC\u03B1 ${\n extra?.min - stashedObjects.length\n } \u03B5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AD\u03C2. \u03A0\u03C1\u03BF\u03C3\u03B8\u03AD\u03C3\u03C4\u03B5 \u03BC\u03B9\u03B1 \u03B1\u03BA\u03CC\u03BC\u03B1 \u03B5\u03C0\u03B9\u03BB\u03AD\u03B3\u03BF\u03BD\u03C4\u03B1\u03C2 \u03C4\u03B7\u03BD \u03B1\u03C0\u03AC\u03BD\u03C4\u03B7\u03C3\u03B7 \u00AB\u039D\u03B1\u03B9\u00BB \u03C3\u03C4\u03B7\u03BD \u03B5\u03C0\u03CC\u03BC\u03B5\u03BD\u03B7 \u03B5\u03C1\u03CE\u03C4\u03B7\u03C3\u03B7.`;\n } else if (extra?.max) {\n resolvedField.label.secondary = ` \u0388\u03C7\u03B5\u03C4\u03B5 \u03C0\u03C1\u03BF\u03C3\u03B8\u03AD\u03C3\u03B5\u03B9 ${\n stashedObjects.length\n } \u03B5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AD\u03C2 \u03BA\u03B1\u03B9 \u03C3\u03B1\u03C2 \u03B1\u03C0\u03BF\u03BC\u03AD\u03BD\u03BF\u03C5\u03BD ${\n extra.max - stashedObjects.length\n } \u03B5\u03C0\u03B9\u03C0\u03BB\u03AD\u03BF\u03BD \u03B5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AD\u03C2.`;\n }\n return (\n <Fieldset>\n <FieldBase\n {...resolvedField}\n name={resolvedField.key}\n control={control}\n register={register}\n reset={reset}\n resetField={resetField}\n Field={Field}\n error={\n extra?.max - stashedObjects.length === 0 ||\n extra?.length - stashedObjects.length === 0\n ? error\n : needsMoreError\n }\n />\n </Fieldset>\n );\n};\n\nexport default AddObjects;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,SAAS,WAAW,eAAe;AAM1C,SAAS,gBAAgB;AACzB,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AACzB,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AAMzB,SAAS,cAAc;AACvB,SAAS,wBAAwB;AAa1B,MAAM,aAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,eAAe,OAAO,SAAS,IAAI,OAAO,SAAS,IAAI,OAAO;AACpE,QAAM,cAAc,GAAG,IAAI,IAAI,YAAY;AAC3C,QAAM,aAAwB;AAAA,IAC5B,KAAK;AAAA,IACL,MAAM;AAAA,IACN,OAAO;AAAA,MACL,SAAS,OAAO,MAAM,SAAS;AAAA,IACjC;AAAA,IACA,UAAU;AAAA,IACV,YAAY;AAAA,MACV;AAAA,QACE,MAAM;AAAA,QACN,SAAS;AAAA,QACT,MAAM,CAAC,SAAS;AACd,iBAAO,SAAS;AAAA,QAClB;AAAA,MACF;AAAA,IACF;AAAA,IACA,OAAO;AAAA,MACL,SAAS;AAAA,QACP;AAAA,UACE,OAAO,EAAE,SAAS,OAAO,MAAM,SAAS,IAAI;AAAA,UAC5C,IAAI,eAAe,IAAI;AAAA,UACvB,OAAO;AAAA,UACP,UAAU,SAAS,gBAAgB;AACjC,mBACE;AAAA,cAAC;AAAA;AAAA,gBACC,QACE,cAAc,SACb,OAAO,OAAO,OAAO,MAAM,eAAe,WAAW;AAAA;AAAA,cAGvD,cAAc,SAAS,OAAO,SAAS,KACtC,0DACE;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAM;AAAA,kBACN,OAAO,SAAS,MAAM,YAAY;AAAA,kBAClC;AAAA,kBACA;AAAA,kBACA;AAAA,kBACC,GAAG,OAAO;AAAA,kBACX,OACE,OAAO,MAAM,SAAS,eAAe,OAAO,GAAG;AAAA;AAAA,cAEnD,GACA;AAAA,gBAAC;AAAA;AAAA,kBACC,OAAM;AAAA,kBACN,MAAM,GAAG,WAAW;AAAA,kBACpB,SAAS,OAAO,MAAM;AACpB,sBAAE,eAAe;AACjB,0BAAM,eAAe,OAAO,GAAG,MAAM,OAAO;AAAA,sBAC1C,CAAC,MAAM,GAAG,WAAW,IAAI,EAAE,GAAG;AAAA,oBAChC;AACA,0BAAM,SAAS,MAAM,QAAQ,YAAY;AACzC,wBAAI,QAAQ;AACV,+BAAS,cAAc,EAAE;AACzB,8BAAQ,UAAU,WAAW,CAAC;AAAA,oBAChC;AAAA,kBACF;AAAA;AAAA,gBAEC,OAAO,MAAM,OAAO;AAAA,cACvB,CACF;AAAA,YAEJ;AAAA,UAEJ;AAAA,QACF;AAAA,QACA;AAAA,UACE,OAAO,EAAE,SAAS,OAAO,MAAM,SAAS,GAAG;AAAA,UAC3C,IAAI,eAAe,IAAI;AAAA,UACvB,OAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,EACT,IAAI,SAAS,WAAW,KAAK,YAAY,OAAO,aAAa,IAAI;AAEjE,QAAM,gBAAgB,QAAQ,MAAM,aAAa,UAAU,KAAK,GAAG,CAAC,KAAK,CAAC;AAC1E,QAAM,YAAY,SAAS,EAAE,MAAM,MAAM,KAAK,QAAQ,CAAC;AAEvD,YAAU,MAAM;AACd,QAAI,cAAc,OAAO;AACvB,aAAO,EAAE,KAAK,IAAI,WAAW,IAAI,UAAU,GAAG,CAAC;AAAA,IACjD;AACA,QAAI,cAAc,QAAQ,eAAe,SAAS,OAAO,QAAQ;AAC/D,aAAO,YAAY;AAAA,IACrB;AACA,QAAI,cAAc,GAAI,aAAY,YAAY;AAAA,EAChD,GAAG,CAAC,SAAS,CAAC;AAId,gBAAc,QAAQ,cAAc,SAAS,CAAC;AAC9C,MAAI,OAAO,QAAQ;AACjB,kBAAc,MAAM,YAAY,yFAC9B,eAAe,MACjB,iLACE,MAAM,SAAS,eAAe,MAChC;AAAA,EACF,WAAW,OAAO,OAAO,OAAO,KAAK;AACnC,kBAAc,MAAM,YAAY,yJAC9B,OAAO,MAAM,eAAe,MAC9B,+EACE,OAAO,GACT;AAAA,EACF,WAAW,OAAO,KAAK;AACrB,kBAAc,MAAM,YAAY,yJAC9B,OAAO,MAAM,eAAe,MAC9B;AAAA,EACF,WAAW,OAAO,KAAK;AACrB,kBAAc,MAAM,YAAY,0FAC9B,eAAe,MACjB,kJACE,MAAM,MAAM,eAAe,MAC7B;AAAA,EACF;AACA,SACE,oCAAC,gBACC;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,MAAM,cAAc;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OACE,OAAO,MAAM,eAAe,WAAW,KACvC,OAAO,SAAS,eAAe,WAAW,IACtC,QACA;AAAA;AAAA,EAER,CACF;AAEJ;AAEA,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { UseFormReturn } from 'react-hook-form';
|
|
3
|
-
import { MultiplicityProps } from '@digigov/form/MultiplicityField/types';
|
|
2
|
+
import type { UseFormReturn } from 'react-hook-form';
|
|
3
|
+
import type { MultiplicityProps } from '@digigov/form/MultiplicityField/types';
|
|
4
4
|
export declare const Multiplicity: React.FC<MultiplicityProps>;
|
|
5
5
|
export default Multiplicity;
|
|
6
6
|
export interface ListObjectProps {
|
|
@@ -25,6 +25,7 @@ const Multiplicity = ({
|
|
|
25
25
|
setValue,
|
|
26
26
|
getValues,
|
|
27
27
|
unregister,
|
|
28
|
+
resetField,
|
|
28
29
|
Field
|
|
29
30
|
}) => {
|
|
30
31
|
const { fields, append, remove } = useFieldArray({
|
|
@@ -49,7 +50,8 @@ const Multiplicity = ({
|
|
|
49
50
|
error: formState.isSubmitted && !formState.isSubmitting && error?.message ? error : void 0,
|
|
50
51
|
hasError: formState.isSubmitted && !formState.isSubmitting && !!error,
|
|
51
52
|
wrapper: "fieldset",
|
|
52
|
-
name
|
|
53
|
+
name,
|
|
54
|
+
register
|
|
53
55
|
},
|
|
54
56
|
stashedObjects.length > 0 ? /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Heading, { size: "md" }, extra?.label.object.title_added), stashedObjects.map((_Object, index) => {
|
|
55
57
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -84,6 +86,7 @@ const Multiplicity = ({
|
|
|
84
86
|
getValues,
|
|
85
87
|
unregister,
|
|
86
88
|
trigger,
|
|
89
|
+
resetField,
|
|
87
90
|
clearErrors,
|
|
88
91
|
Field
|
|
89
92
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/MultiplicityField/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useState } from 'react';\nimport {
|
|
5
|
-
"mappings": "AAAA,OAAO,SAAS,gBAAgB;
|
|
4
|
+
"sourcesContent": ["import React, { useState } from 'react';\nimport type { UseFormReturn } from 'react-hook-form';\nimport { useFieldArray } from 'react-hook-form';\nimport { FieldBaseContainer } from '@digigov/form/Field/FieldBaseContainer';\nimport { FieldObject } from '@digigov/form/FieldObject';\nimport { AddObjects } from '@digigov/form/MultiplicityField/add-objects';\nimport type {\n MultiplicityProps,\n StashedObject,\n} from '@digigov/form/MultiplicityField/types';\nimport {\n Card,\n CardHeading,\n CardContent,\n CardAction,\n} from '@digigov/ui/content/Card';\nimport { Button } from '@digigov/ui/form/Button';\nimport { Heading } from '@digigov/ui/typography/Heading';\n\n// epeidh einai forwardRef to ref mas to dinei xwrista apo ta props\nexport const Multiplicity: React.FC<MultiplicityProps> = ({\n extra,\n name,\n control,\n error,\n register,\n trigger,\n clearErrors,\n formState,\n label,\n layout,\n setValue,\n getValues,\n unregister,\n resetField,\n Field,\n}) => {\n const { fields, append, remove } = useFieldArray({\n control,\n name,\n });\n const [stashedObjects, setStashedObjects] = useState<StashedObject[]>([]);\n const handleStash = (data) => {\n setStashedObjects([...stashedObjects, data]);\n };\n const handleDelete = (index) => {\n remove(index);\n // creating a new array to maintain immutability\n const newStashedObjects = [...stashedObjects];\n newStashedObjects.splice(index, 1);\n setStashedObjects(newStashedObjects);\n };\n return (\n <FieldBaseContainer\n label={label}\n layout={layout}\n error={\n formState.isSubmitted && !formState.isSubmitting && error?.message\n ? error\n : undefined\n }\n hasError={formState.isSubmitted && !formState.isSubmitting && !!error}\n wrapper=\"fieldset\"\n name={name}\n register={register}\n >\n {stashedObjects.length > 0 ? (\n <div>\n <Heading size=\"md\">{extra?.label.object.title_added}</Heading>\n {stashedObjects.map((_Object, index) => {\n return (\n <ListObject\n key={`${name}.${index}`}\n index={index}\n name={name}\n extra={extra}\n control={control}\n register={register}\n formState={formState}\n onDelete={handleDelete}\n />\n );\n })}\n </div>\n ) : (\n ''\n )}\n <AddObjects\n name={name}\n register={register}\n control={control}\n fields={fields}\n formState={formState}\n error={error}\n stashedObjects={stashedObjects}\n extra={extra}\n append={append}\n remove={remove}\n onStash={handleStash}\n setValue={setValue}\n getValues={getValues}\n unregister={unregister}\n trigger={trigger}\n resetField={resetField}\n clearErrors={clearErrors}\n Field={Field}\n />\n </FieldBaseContainer>\n );\n};\n\nexport default Multiplicity;\n\nexport interface ListObjectProps {\n index: number;\n name: string;\n control: UseFormReturn['control'];\n register: UseFormReturn['register'];\n formState: UseFormReturn['formState'];\n onDelete: (index: number) => void;\n extra?: Record<string, any>;\n}\n\nexport const ListObject: React.FC<ListObjectProps> = ({\n index,\n name,\n extra,\n control,\n register,\n onDelete,\n formState,\n // onEdit,\n}) => {\n const currentName = `${name}.${index}`;\n return (\n <Card variant={extra?.border && 'border'}>\n <CardHeading>\n {extra?.label.object.title} #{index + 1}\n </CardHeading>\n <CardContent>\n <FieldObject\n name={currentName}\n formState={formState}\n register={register}\n control={control}\n {...extra?.of}\n />\n </CardContent>\n <CardAction>\n <Button type=\"button\" variant=\"link\" onClick={() => onDelete(index)}>\n {extra?.label.object.delete}\n </Button>\n </CardAction>\n </Card>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,SAAS,gBAAgB;AAEhC,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AACnC,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAK3B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AACvB,SAAS,eAAe;AAGjB,MAAM,eAA4C,CAAC;AAAA,EACxD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,QAAQ,QAAQ,OAAO,IAAI,cAAc;AAAA,IAC/C;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAA0B,CAAC,CAAC;AACxE,QAAM,cAAc,CAAC,SAAS;AAC5B,sBAAkB,CAAC,GAAG,gBAAgB,IAAI,CAAC;AAAA,EAC7C;AACA,QAAM,eAAe,CAAC,UAAU;AAC9B,WAAO,KAAK;AAEZ,UAAM,oBAAoB,CAAC,GAAG,cAAc;AAC5C,sBAAkB,OAAO,OAAO,CAAC;AACjC,sBAAkB,iBAAiB;AAAA,EACrC;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,OACE,UAAU,eAAe,CAAC,UAAU,gBAAgB,OAAO,UACvD,QACA;AAAA,MAEN,UAAU,UAAU,eAAe,CAAC,UAAU,gBAAgB,CAAC,CAAC;AAAA,MAChE,SAAQ;AAAA,MACR;AAAA,MACA;AAAA;AAAA,IAEC,eAAe,SAAS,IACvB,oCAAC,aACC,oCAAC,WAAQ,MAAK,QAAM,OAAO,MAAM,OAAO,WAAY,GACnD,eAAe,IAAI,CAAC,SAAS,UAAU;AACtC,aACE;AAAA,QAAC;AAAA;AAAA,UACC,KAAK,GAAG,IAAI,IAAI,KAAK;AAAA,UACrB;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,UAAU;AAAA;AAAA,MACZ;AAAA,IAEJ,CAAC,CACH,IAEA;AAAA,IAEF;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACF;AAAA,EACF;AAEJ;AAEA,IAAO,4BAAQ;AAYR,MAAM,aAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAEF,MAAM;AACJ,QAAM,cAAc,GAAG,IAAI,IAAI,KAAK;AACpC,SACE,oCAAC,QAAK,SAAS,OAAO,UAAU,YAC9B,oCAAC,mBACE,OAAO,MAAM,OAAO,OAAM,MAAG,QAAQ,CACxC,GACA,oCAAC,mBACC;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG,OAAO;AAAA;AAAA,EACb,CACF,GACA,oCAAC,kBACC,oCAAC,UAAO,MAAK,UAAS,SAAQ,QAAO,SAAS,MAAM,SAAS,KAAK,KAC/D,OAAO,MAAM,OAAO,MACvB,CACF,CACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ErrorOption, UseFormReturn } from 'react-hook-form';
|
|
2
|
-
import { FieldSpec, ControlledFieldProps } from '@digigov/form/Field/types';
|
|
1
|
+
import type { ErrorOption, UseFormReturn } from 'react-hook-form';
|
|
2
|
+
import type { FieldSpec, ControlledFieldProps } from '@digigov/form/Field/types';
|
|
3
3
|
export interface MultiplicityProps extends Omit<ControlledFieldProps, 'value' | 'onChange' | 'error' | 'extra'> {
|
|
4
4
|
name: string;
|
|
5
5
|
control: UseFormReturn['control'];
|
|
@@ -10,6 +10,7 @@ export interface MultiplicityProps extends Omit<ControlledFieldProps, 'value' |
|
|
|
10
10
|
setValue: UseFormReturn['setValue'];
|
|
11
11
|
getValues: UseFormReturn['getValues'];
|
|
12
12
|
unregister: UseFormReturn['unregister'];
|
|
13
|
+
resetField?: UseFormReturn['resetField'];
|
|
13
14
|
error?: ErrorOption;
|
|
14
15
|
extra?: Record<string, any>;
|
|
15
16
|
label?: FieldSpec['label'];
|
package/Questions/Questions.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QuestionsInterface } from '@digigov/form/Questions/types';
|
|
2
|
+
import type { QuestionsInterface } from '@digigov/form/Questions/types';
|
|
3
3
|
/**
|
|
4
4
|
* The Question component accepts question data as props
|
|
5
5
|
* uses composable components to provide a wholesome UX
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Questions/Questions.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useState, useEffect } from 'react';\nimport { getNextStep } from '@digigov/form/Questions/getNextStep';\nimport { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';\nimport { StepInterface } from '@digigov/form/Questions/Step/types';\nimport { QuestionsInterface } from '@digigov/form/Questions/types';\n\nconst isBrowser = typeof window !== 'undefined';\n\n/**\n * The Question component accepts question data as props\n * uses composable components to provide a wholesome UX\n *\n */\nexport const Questions: React.FC<QuestionsInterface> = ({\n name,\n steps,\n initialData = {},\n onChange,\n onSubmit,\n onActiveStep,\n forceStepName,\n localDraft = false,\n children,\n}) => {\n const [currentStep, setCurrentStep] = useState<StepInterface>({ name: '' });\n useEffect(() => {\n if (!forceStepName) {\n setCurrentStep(steps[0]);\n }\n }, [forceStepName, steps]);\n useEffect(() => {\n if (forceStepName !== currentStep.name) {\n const forceStep = steps.find(({ name }) => name === forceStepName);\n if (forceStep) setCurrentStep(forceStep);\n }\n }, [forceStepName]);\n const localData =\n isBrowser && localDraft && window.localStorage.getItem(`questions-${name}`);\n const [data, setData] = useState(\n (localData && JSON.parse(localData)) || initialData\n );\n const submitStep = (stepName, stepData): void => {\n data[stepName] = stepData;\n if (localDraft) {\n if (isBrowser)\n window.localStorage.setItem(`questions-${name}`, JSON.stringify(data));\n }\n if (onChange) {\n onChange(data);\n }\n setData(data);\n const nextStep = getNextStep(currentStep, steps, data);\n if (nextStep) {\n if (onActiveStep) onActiveStep(nextStep);\n setCurrentStep(nextStep);\n } else {\n onSubmit(data);\n }\n };\n\n return (\n <QuestionsContext.Provider\n value={{\n steps,\n currentStep,\n submitStep,\n data,\n onActiveStep,\n }}\n >\n {children}\n </QuestionsContext.Provider>\n );\n};\n"],
|
|
4
|
+
"sourcesContent": ["import React, { useState, useEffect } from 'react';\nimport { getNextStep } from '@digigov/form/Questions/getNextStep';\nimport { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';\nimport type { StepInterface } from '@digigov/form/Questions/Step/types';\nimport type { QuestionsInterface } from '@digigov/form/Questions/types';\n\nconst isBrowser = typeof window !== 'undefined';\n\n/**\n * The Question component accepts question data as props\n * uses composable components to provide a wholesome UX\n *\n */\nexport const Questions: React.FC<QuestionsInterface> = ({\n name,\n steps,\n initialData = {},\n onChange,\n onSubmit,\n onActiveStep,\n forceStepName,\n localDraft = false,\n children,\n}) => {\n const [currentStep, setCurrentStep] = useState<StepInterface>({ name: '' });\n useEffect(() => {\n if (!forceStepName) {\n setCurrentStep(steps[0]);\n }\n }, [forceStepName, steps]);\n useEffect(() => {\n if (forceStepName !== currentStep.name) {\n const forceStep = steps.find(({ name }) => name === forceStepName);\n if (forceStep) setCurrentStep(forceStep);\n }\n }, [forceStepName]);\n const localData =\n isBrowser && localDraft && window.localStorage.getItem(`questions-${name}`);\n const [data, setData] = useState(\n (localData && JSON.parse(localData)) || initialData\n );\n const submitStep = (stepName, stepData): void => {\n data[stepName] = stepData;\n if (localDraft) {\n if (isBrowser)\n window.localStorage.setItem(`questions-${name}`, JSON.stringify(data));\n }\n if (onChange) {\n onChange(data);\n }\n setData(data);\n const nextStep = getNextStep(currentStep, steps, data);\n if (nextStep) {\n if (onActiveStep) onActiveStep(nextStep);\n setCurrentStep(nextStep);\n } else {\n onSubmit(data);\n }\n };\n\n return (\n <QuestionsContext.Provider\n value={{\n steps,\n currentStep,\n submitStep,\n data,\n onActiveStep,\n }}\n >\n {children}\n </QuestionsContext.Provider>\n );\n};\n"],
|
|
5
5
|
"mappings": "AAAA,OAAO,SAAS,UAAU,iBAAiB;AAC3C,SAAS,mBAAmB;AAC5B,SAAS,wBAAwB;AAIjC,MAAM,YAAY,OAAO,WAAW;AAO7B,MAAM,YAA0C,CAAC;AAAA,EACtD;AAAA,EACA;AAAA,EACA,cAAc,CAAC;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa;AAAA,EACb;AACF,MAAM;AACJ,QAAM,CAAC,aAAa,cAAc,IAAI,SAAwB,EAAE,MAAM,GAAG,CAAC;AAC1E,YAAU,MAAM;AACd,QAAI,CAAC,eAAe;AAClB,qBAAe,MAAM,CAAC,CAAC;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,eAAe,KAAK,CAAC;AACzB,YAAU,MAAM;AACd,QAAI,kBAAkB,YAAY,MAAM;AACtC,YAAM,YAAY,MAAM,KAAK,CAAC,EAAE,MAAAA,MAAK,MAAMA,UAAS,aAAa;AACjE,UAAI,UAAW,gBAAe,SAAS;AAAA,IACzC;AAAA,EACF,GAAG,CAAC,aAAa,CAAC;AAClB,QAAM,YACJ,aAAa,cAAc,OAAO,aAAa,QAAQ,aAAa,IAAI,EAAE;AAC5E,QAAM,CAAC,MAAM,OAAO,IAAI;AAAA,IACrB,aAAa,KAAK,MAAM,SAAS,KAAM;AAAA,EAC1C;AACA,QAAM,aAAa,CAAC,UAAU,aAAmB;AAC/C,SAAK,QAAQ,IAAI;AACjB,QAAI,YAAY;AACd,UAAI;AACF,eAAO,aAAa,QAAQ,aAAa,IAAI,IAAI,KAAK,UAAU,IAAI,CAAC;AAAA,IACzE;AACA,QAAI,UAAU;AACZ,eAAS,IAAI;AAAA,IACf;AACA,YAAQ,IAAI;AACZ,UAAM,WAAW,YAAY,aAAa,OAAO,IAAI;AACrD,QAAI,UAAU;AACZ,UAAI,aAAc,cAAa,QAAQ;AACvC,qBAAe,QAAQ;AAAA,IACzB,OAAO;AACL,eAAS,IAAI;AAAA,IACf;AAAA,EACF;AAEA,SACE;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACC,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA;AAAA,IAEC;AAAA,EACH;AAEJ;",
|
|
6
6
|
"names": ["name"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { QuestionsContextInterface } from '@digigov/form/Questions/types';
|
|
1
|
+
import type { QuestionsContextInterface } from '@digigov/form/Questions/types';
|
|
2
2
|
export declare const QuestionsContext: import("react").Context<QuestionsContextInterface>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Questions/QuestionsContext.tsx"],
|
|
4
|
-
"sourcesContent": ["import { createContext } from 'react';\nimport { QuestionsContextInterface } from '@digigov/form/Questions/types';\n\nconst defaultStep = { name: '' };\nexport const QuestionsContext = createContext<QuestionsContextInterface>({\n currentStep: defaultStep,\n steps: [],\n submitStep: () => null,\n});\n"],
|
|
4
|
+
"sourcesContent": ["import { createContext } from 'react';\nimport type { QuestionsContextInterface } from '@digigov/form/Questions/types';\n\nconst defaultStep = { name: '' };\nexport const QuestionsContext = createContext<QuestionsContextInterface>({\n currentStep: defaultStep,\n steps: [],\n submitStep: () => null,\n});\n"],
|
|
5
5
|
"mappings": "AAAA,SAAS,qBAAqB;AAG9B,MAAM,cAAc,EAAE,MAAM,GAAG;AACxB,MAAM,mBAAmB,cAAyC;AAAA,EACvE,aAAa;AAAA,EACb,OAAO,CAAC;AAAA,EACR,YAAY,MAAM;AACpB,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/Questions/Step/Step.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { StepInterface } from '@digigov/form/Questions/Step/types';
|
|
2
|
+
import type { StepInterface } from '@digigov/form/Questions/Step/types';
|
|
3
3
|
/**
|
|
4
4
|
* The Step component accepts Step data as props
|
|
5
5
|
* uses composable components to provide a wholesome UX
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Questions/Step/Step.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext, useState } from 'react';\nimport { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';\nimport { StepArrayReview } from '@digigov/form/Questions/Step/StepArrayReview';\nimport { StepContext } from '@digigov/form/Questions/Step/StepContext';\nimport { StepInterface } from '@digigov/form/Questions/Step/types';\n\n/**\n * The Step component accepts Step data as props\n * uses composable components to provide a wholesome UX\n *\n */\nexport const Step: React.FC<StepInterface> = (props) => {\n // or return all Questions and currentStepName\n // or return a specific Step object\n const { currentStep, submitStep, data } = useContext(QuestionsContext);\n\n const [stepData, setStepData] = useState<Record<string, any>[]>([]);\n const [reviewActive, setReviewActive] = useState(false);\n\n const handleArraySubmit = (_name: string, data: any): void => {\n setStepData([...stepData, data]);\n setReviewActive(true);\n };\n\n const handleArrayDeleteItem = (deleteIndex: number): void => {\n const nextStepData = stepData.filter((_item, stepIndex) => {\n return stepIndex !== deleteIndex;\n });\n setStepData(nextStepData);\n if (nextStepData.length === 0) {\n setReviewActive(false);\n }\n };\n\n const handleArrayReviewStep = (data): void => {\n if (data.addMore === 'yes') {\n setReviewActive(false);\n } else if (data.addMore === 'no') {\n submitStep(currentStep.name, stepData);\n }\n };\n if (!currentStep || props.name !== currentStep.name) return null;\n\n // then provide the currentStep object\n return (\n <StepContext.Provider\n value={{\n ...currentStep,\n submitStep:\n currentStep.type === 'array' ? handleArraySubmit : submitStep,\n initial: data[props.name],\n }}\n >\n {reviewActive ? (\n <StepArrayReview\n array={stepData}\n handleSubmit={handleArrayReviewStep}\n handleDelete={handleArrayDeleteItem}\n />\n ) : (\n props.children\n )}\n </StepContext.Provider>\n );\n};\n\nexport default Step;\n"],
|
|
4
|
+
"sourcesContent": ["import React, { useContext, useState } from 'react';\nimport { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';\nimport { StepArrayReview } from '@digigov/form/Questions/Step/StepArrayReview';\nimport { StepContext } from '@digigov/form/Questions/Step/StepContext';\nimport type { StepInterface } from '@digigov/form/Questions/Step/types';\n\n/**\n * The Step component accepts Step data as props\n * uses composable components to provide a wholesome UX\n *\n */\nexport const Step: React.FC<StepInterface> = (props) => {\n // or return all Questions and currentStepName\n // or return a specific Step object\n const { currentStep, submitStep, data } = useContext(QuestionsContext);\n\n const [stepData, setStepData] = useState<Record<string, any>[]>([]);\n const [reviewActive, setReviewActive] = useState(false);\n\n const handleArraySubmit = (_name: string, data: any): void => {\n setStepData([...stepData, data]);\n setReviewActive(true);\n };\n\n const handleArrayDeleteItem = (deleteIndex: number): void => {\n const nextStepData = stepData.filter((_item, stepIndex) => {\n return stepIndex !== deleteIndex;\n });\n setStepData(nextStepData);\n if (nextStepData.length === 0) {\n setReviewActive(false);\n }\n };\n\n const handleArrayReviewStep = (data): void => {\n if (data.addMore === 'yes') {\n setReviewActive(false);\n } else if (data.addMore === 'no') {\n submitStep(currentStep.name, stepData);\n }\n };\n if (!currentStep || props.name !== currentStep.name) return null;\n\n // then provide the currentStep object\n return (\n <StepContext.Provider\n value={{\n ...currentStep,\n submitStep:\n currentStep.type === 'array' ? handleArraySubmit : submitStep,\n initial: data[props.name],\n }}\n >\n {reviewActive ? (\n <StepArrayReview\n array={stepData}\n handleSubmit={handleArrayReviewStep}\n handleDelete={handleArrayDeleteItem}\n />\n ) : (\n props.children\n )}\n </StepContext.Provider>\n );\n};\n\nexport default Step;\n"],
|
|
5
5
|
"mappings": "AAAA,OAAO,SAAS,YAAY,gBAAgB;AAC5C,SAAS,wBAAwB;AACjC,SAAS,uBAAuB;AAChC,SAAS,mBAAmB;AAQrB,MAAM,OAAgC,CAAC,UAAU;AAGtD,QAAM,EAAE,aAAa,YAAY,KAAK,IAAI,WAAW,gBAAgB;AAErE,QAAM,CAAC,UAAU,WAAW,IAAI,SAAgC,CAAC,CAAC;AAClE,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,KAAK;AAEtD,QAAM,oBAAoB,CAAC,OAAeA,UAAoB;AAC5D,gBAAY,CAAC,GAAG,UAAUA,KAAI,CAAC;AAC/B,oBAAgB,IAAI;AAAA,EACtB;AAEA,QAAM,wBAAwB,CAAC,gBAA8B;AAC3D,UAAM,eAAe,SAAS,OAAO,CAAC,OAAO,cAAc;AACzD,aAAO,cAAc;AAAA,IACvB,CAAC;AACD,gBAAY,YAAY;AACxB,QAAI,aAAa,WAAW,GAAG;AAC7B,sBAAgB,KAAK;AAAA,IACvB;AAAA,EACF;AAEA,QAAM,wBAAwB,CAACA,UAAe;AAC5C,QAAIA,MAAK,YAAY,OAAO;AAC1B,sBAAgB,KAAK;AAAA,IACvB,WAAWA,MAAK,YAAY,MAAM;AAChC,iBAAW,YAAY,MAAM,QAAQ;AAAA,IACvC;AAAA,EACF;AACA,MAAI,CAAC,eAAe,MAAM,SAAS,YAAY,KAAM,QAAO;AAG5D,SACE;AAAA,IAAC,YAAY;AAAA,IAAZ;AAAA,MACC,OAAO;AAAA,QACL,GAAG;AAAA,QACH,YACE,YAAY,SAAS,UAAU,oBAAoB;AAAA,QACrD,SAAS,KAAK,MAAM,IAAI;AAAA,MAC1B;AAAA;AAAA,IAEC,eACC;AAAA,MAAC;AAAA;AAAA,QACC,OAAO;AAAA,QACP,cAAc;AAAA,QACd,cAAc;AAAA;AAAA,IAChB,IAEA,MAAM;AAAA,EAEV;AAEJ;AAEA,IAAO,eAAQ;",
|
|
6
6
|
"names": ["data"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { StepArrayReviewInterface } from '@digigov/form/Questions/Step/types';
|
|
2
|
+
import type { StepArrayReviewInterface } from '@digigov/form/Questions/Step/types';
|
|
3
3
|
export declare const StepArrayReview: React.FC<StepArrayReviewInterface>;
|
|
4
4
|
export default StepArrayReview;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Questions/Step/StepArrayReview.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext } from 'react';\nimport { Field } from '@digigov/form/Field';\nimport { Fieldset } from '@digigov/form/Fieldset';\nimport FormBuilder from '@digigov/form/FormBuilder';\nimport Label from '@digigov/form/inputs/Label';\nimport { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';\nimport { getAddMoreFields } from '@digigov/form/Questions/Step/getAddMoreFields';\nimport { StepArrayReviewInterface } from '@digigov/form/Questions/Step/types';\nimport { FieldSpec } from '@digigov/form/types';\nimport PageTitleContainer, {\n PageTitleHeading,\n} from '@digigov/ui/app/PageTitleContainer';\nimport {\n SummaryList,\n SummaryListItem,\n SummaryListItemKey,\n SummaryListItemValue,\n SummaryListItemAction,\n} from '@digigov/ui/content/SummaryList';\nimport Button from '@digigov/ui/form/Button';\nimport { useTranslation } from '@digigov/ui/i18n';\n\nexport const StepArrayReview: React.FC<StepArrayReviewInterface> = (props) => {\n const { t } = useTranslation();\n const { currentStep } = useContext(QuestionsContext);\n const fields = getAddMoreFields(currentStep);\n const primaryField =\n currentStep.fields.find(\n (field: { key: any }) => field.key === currentStep.review?.primaryFieldKey\n ) || {};\n return (\n <>\n <PageTitleContainer>\n <PageTitleHeading>\n {currentStep.review?.title && t(currentStep.review?.title)}\n </PageTitleHeading>\n </PageTitleContainer>\n <SummaryList>\n {props.array.map(\n (item: Record<string, React.ReactNode>, idx: number) => (\n <SummaryListItem key={idx}>\n <SummaryListItemKey>\n {t(primaryField.label.primary)}\n </SummaryListItemKey>\n <SummaryListItemValue>\n {item[primaryField.key]}\n </SummaryListItemValue>\n <SummaryListItemAction\n onClick={(): void => props.handleDelete(idx)}\n >\n {t('button.delete')}\n </SummaryListItemAction>\n </SummaryListItem>\n )\n )}\n </SummaryList>\n <FormBuilder key=\"addmore\" fields={fields} onSubmit={props.handleSubmit}>\n <Fieldset>\n <Label label={currentStep.review?.addMore.title} />\n {fields.map((field: FieldSpec) => (\n <Field key={field.key} name={field.key} />\n ))}\n </Fieldset>\n <Button type=\"submit\">{t('button.submit')}</Button>\n </FormBuilder>\n </>\n );\n};\n\nexport default StepArrayReview;\n"],
|
|
4
|
+
"sourcesContent": ["import React, { useContext } from 'react';\nimport { Field } from '@digigov/form/Field';\nimport { Fieldset } from '@digigov/form/Fieldset';\nimport FormBuilder from '@digigov/form/FormBuilder';\nimport Label from '@digigov/form/inputs/Label';\nimport { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';\nimport { getAddMoreFields } from '@digigov/form/Questions/Step/getAddMoreFields';\nimport type { StepArrayReviewInterface } from '@digigov/form/Questions/Step/types';\nimport type { FieldSpec } from '@digigov/form/types';\nimport PageTitleContainer, {\n PageTitleHeading,\n} from '@digigov/ui/app/PageTitleContainer';\nimport {\n SummaryList,\n SummaryListItem,\n SummaryListItemKey,\n SummaryListItemValue,\n SummaryListItemAction,\n} from '@digigov/ui/content/SummaryList';\nimport Button from '@digigov/ui/form/Button';\nimport { useTranslation } from '@digigov/ui/i18n';\n\nexport const StepArrayReview: React.FC<StepArrayReviewInterface> = (props) => {\n const { t } = useTranslation();\n const { currentStep } = useContext(QuestionsContext);\n const fields = getAddMoreFields(currentStep);\n const primaryField =\n currentStep.fields.find(\n (field: { key: any }) => field.key === currentStep.review?.primaryFieldKey\n ) || {};\n return (\n <>\n <PageTitleContainer>\n <PageTitleHeading>\n {currentStep.review?.title && t(currentStep.review?.title)}\n </PageTitleHeading>\n </PageTitleContainer>\n <SummaryList>\n {props.array.map(\n (item: Record<string, React.ReactNode>, idx: number) => (\n <SummaryListItem key={idx}>\n <SummaryListItemKey>\n {t(primaryField.label.primary)}\n </SummaryListItemKey>\n <SummaryListItemValue>\n {item[primaryField.key]}\n </SummaryListItemValue>\n <SummaryListItemAction\n onClick={(): void => props.handleDelete(idx)}\n >\n {t('button.delete')}\n </SummaryListItemAction>\n </SummaryListItem>\n )\n )}\n </SummaryList>\n <FormBuilder key=\"addmore\" fields={fields} onSubmit={props.handleSubmit}>\n <Fieldset>\n <Label label={currentStep.review?.addMore.title} />\n {fields.map((field: FieldSpec) => (\n <Field key={field.key} name={field.key} />\n ))}\n </Fieldset>\n <Button type=\"submit\">{t('button.submit')}</Button>\n </FormBuilder>\n </>\n );\n};\n\nexport default StepArrayReview;\n"],
|
|
5
5
|
"mappings": "AAAA,OAAO,SAAS,kBAAkB;AAClC,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,OAAO,iBAAiB;AACxB,OAAO,WAAW;AAClB,SAAS,wBAAwB;AACjC,SAAS,wBAAwB;AAGjC,OAAO;AAAA,EACL;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,OAAO,YAAY;AACnB,SAAS,sBAAsB;AAExB,MAAM,kBAAsD,CAAC,UAAU;AAC5E,QAAM,EAAE,EAAE,IAAI,eAAe;AAC7B,QAAM,EAAE,YAAY,IAAI,WAAW,gBAAgB;AACnD,QAAM,SAAS,iBAAiB,WAAW;AAC3C,QAAM,eACJ,YAAY,OAAO;AAAA,IACjB,CAAC,UAAwB,MAAM,QAAQ,YAAY,QAAQ;AAAA,EAC7D,KAAK,CAAC;AACR,SACE,0DACE,oCAAC,0BACC,oCAAC,wBACE,YAAY,QAAQ,SAAS,EAAE,YAAY,QAAQ,KAAK,CAC3D,CACF,GACA,oCAAC,mBACE,MAAM,MAAM;AAAA,IACX,CAAC,MAAuC,QACtC,oCAAC,mBAAgB,KAAK,OACpB,oCAAC,0BACE,EAAE,aAAa,MAAM,OAAO,CAC/B,GACA,oCAAC,4BACE,KAAK,aAAa,GAAG,CACxB,GACA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS,MAAY,MAAM,aAAa,GAAG;AAAA;AAAA,MAE1C,EAAE,eAAe;AAAA,IACpB,CACF;AAAA,EAEJ,CACF,GACA,oCAAC,eAAY,KAAI,WAAU,QAAgB,UAAU,MAAM,gBACzD,oCAAC,gBACC,oCAAC,SAAM,OAAO,YAAY,QAAQ,QAAQ,OAAO,GAChD,OAAO,IAAI,CAAC,UACX,oCAAC,SAAM,KAAK,MAAM,KAAK,MAAM,MAAM,KAAK,CACzC,CACH,GACA,oCAAC,UAAO,MAAK,YAAU,EAAE,eAAe,CAAE,CAC5C,CACF;AAEJ;AAEA,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Questions/Step/StepContext.tsx"],
|
|
4
|
-
"sourcesContent": ["import { createContext } from 'react';\nimport { StepInterface } from '@digigov/form/Questions/Step/types';\n\nexport const StepContext = createContext<StepInterface>({\n name: '',\n fields: [],\n initial: [],\n errorLabels: [],\n submitStep: '',\n review: {\n title: '',\n primaryFieldKey: '',\n addMore: {\n title: { primary: '' },\n answers: { positive: { primary: 'Yes' }, negative: { primary: 'No' } },\n },\n },\n type: 'object',\n});\n\nexport default StepContext;\n"],
|
|
4
|
+
"sourcesContent": ["import { createContext } from 'react';\nimport type { StepInterface } from '@digigov/form/Questions/Step/types';\n\nexport const StepContext = createContext<StepInterface>({\n name: '',\n fields: [],\n initial: [],\n errorLabels: [],\n submitStep: '',\n review: {\n title: '',\n primaryFieldKey: '',\n addMore: {\n title: { primary: '' },\n answers: { positive: { primary: 'Yes' }, negative: { primary: 'No' } },\n },\n },\n type: 'object',\n});\n\nexport default StepContext;\n"],
|
|
5
5
|
"mappings": "AAAA,SAAS,qBAAqB;AAGvB,MAAM,cAAc,cAA6B;AAAA,EACtD,MAAM;AAAA,EACN,QAAQ,CAAC;AAAA,EACT,SAAS,CAAC;AAAA,EACV,aAAa,CAAC;AAAA,EACd,YAAY;AAAA,EACZ,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,iBAAiB;AAAA,IACjB,SAAS;AAAA,MACP,OAAO,EAAE,SAAS,GAAG;AAAA,MACrB,SAAS,EAAE,UAAU,EAAE,SAAS,MAAM,GAAG,UAAU,EAAE,SAAS,KAAK,EAAE;AAAA,IACvE;AAAA,EACF;AAAA,EACA,MAAM;AACR,CAAC;AAED,IAAO,sBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Questions/Step/StepDescription.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext } from 'react';\nimport { StepContext } from '@digigov/form/Questions/Step/StepContext';\nimport { useTranslation } from '@digigov/ui/i18n';\nimport
|
|
5
|
-
"mappings": "AAAA,OAAO,SAAS,kBAAkB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;
|
|
4
|
+
"sourcesContent": ["import React, { useContext } from 'react';\nimport { StepContext } from '@digigov/form/Questions/Step/StepContext';\nimport { useTranslation } from '@digigov/ui/i18n';\nimport type { ParagraphProps } from '@digigov/ui/typography/Paragraph';\nimport Paragraph from '@digigov/ui/typography/Paragraph';\n\nexport interface StepDescriptionInterface extends ParagraphProps {\n description?: string;\n}\n\nexport const StepDescriptionBase: React.FC<StepDescriptionInterface> = ({\n children,\n description,\n ...props\n}) => {\n const { t } = useTranslation();\n return (\n <Paragraph {...props}>\n {children || (description && t(description))}\n </Paragraph>\n );\n};\n\nexport const StepDescription: React.FC<StepDescriptionInterface> = (props) => {\n const { description: descriptionContext } = useContext(StepContext);\n const description = props.description || descriptionContext;\n return (\n <StepDescriptionBase description={description} {...props}>\n {props.children}\n </StepDescriptionBase>\n );\n};\n\nexport default StepDescription;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,SAAS,kBAAkB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,sBAAsB;AAE/B,OAAO,eAAe;AAMf,MAAM,sBAA0D,CAAC;AAAA,EACtE;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,EAAE,EAAE,IAAI,eAAe;AAC7B,SACE,oCAAC,aAAW,GAAG,SACZ,YAAa,eAAe,EAAE,WAAW,CAC5C;AAEJ;AAEO,MAAM,kBAAsD,CAAC,UAAU;AAC5E,QAAM,EAAE,aAAa,mBAAmB,IAAI,WAAW,WAAW;AAClE,QAAM,cAAc,MAAM,eAAe;AACzC,SACE,oCAAC,uBAAoB,aAA2B,GAAG,SAChD,MAAM,QACT;AAEJ;AAEA,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FieldProps } from '@digigov/form/Field/types';
|
|
3
|
-
import { FormBuilderProps } from '@digigov/form/types';
|
|
2
|
+
import type { FieldProps } from '@digigov/form/Field/types';
|
|
3
|
+
import type { FormBuilderProps } from '@digigov/form/types';
|
|
4
4
|
export interface StepFormProps {
|
|
5
5
|
submitButton: boolean;
|
|
6
6
|
children: React.ReactNode;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Questions/Step/StepForm.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext } from 'react';\nimport Field from '@digigov/form/Field';\nimport { FieldProps } from '@digigov/form/Field/types';\nimport Fieldset from '@digigov/form/Fieldset';\nimport FormBuilder from '@digigov/form/FormBuilder';\nimport { StepContext } from '@digigov/form/Questions/Step/StepContext';\nimport { FormBuilderProps } from '@digigov/form/types';\nimport Button from '@digigov/ui/form/Button';\nimport { useTranslation } from '@digigov/ui/i18n';\n\nexport interface StepFormProps {\n submitButton: boolean;\n children: React.ReactNode;\n fields?: FieldProps[];\n initial?: FormBuilderProps['initial'];\n}\n\n/**\n * The StepForm component accepts a title, a caption and a\n * decription about the Step asked to the User\n */\nexport const StepForm: React.FC<StepFormProps> = ({\n children,\n submitButton,\n ...props\n}) => {\n const { t } = useTranslation();\n const { name, submitStep, ...rest } = useContext(StepContext);\n const fields = rest.fields.length ? rest.fields : props.fields;\n const initial = rest.initial ? rest.initial : props.initial;\n return (\n <FormBuilder\n initial={initial}\n fields={fields}\n onSubmit={(data): void => {\n submitStep(name, data);\n }}\n >\n {children ? (\n <>\n {children}\n {submitButton && (\n <Button type=\"submit\">{t('button.continue')}</Button>\n )}\n </>\n ) : (\n <>\n <Fieldset>\n {fields.map((field) => (\n <Field key={field.key} name={field.key} />\n ))}\n </Fieldset>\n <Button type=\"submit\">{t('button.continue')}</Button>\n </>\n )}\n </FormBuilder>\n );\n};\n\nexport default StepForm;\n"],
|
|
4
|
+
"sourcesContent": ["import React, { useContext } from 'react';\nimport Field from '@digigov/form/Field';\nimport type { FieldProps } from '@digigov/form/Field/types';\nimport Fieldset from '@digigov/form/Fieldset';\nimport FormBuilder from '@digigov/form/FormBuilder';\nimport { StepContext } from '@digigov/form/Questions/Step/StepContext';\nimport type { FormBuilderProps } from '@digigov/form/types';\nimport Button from '@digigov/ui/form/Button';\nimport { useTranslation } from '@digigov/ui/i18n';\n\nexport interface StepFormProps {\n submitButton: boolean;\n children: React.ReactNode;\n fields?: FieldProps[];\n initial?: FormBuilderProps['initial'];\n}\n\n/**\n * The StepForm component accepts a title, a caption and a\n * decription about the Step asked to the User\n */\nexport const StepForm: React.FC<StepFormProps> = ({\n children,\n submitButton,\n ...props\n}) => {\n const { t } = useTranslation();\n const { name, submitStep, ...rest } = useContext(StepContext);\n const fields = rest.fields.length ? rest.fields : props.fields;\n const initial = rest.initial ? rest.initial : props.initial;\n return (\n <FormBuilder\n initial={initial}\n fields={fields}\n onSubmit={(data): void => {\n submitStep(name, data);\n }}\n >\n {children ? (\n <>\n {children}\n {submitButton && (\n <Button type=\"submit\">{t('button.continue')}</Button>\n )}\n </>\n ) : (\n <>\n <Fieldset>\n {fields.map((field) => (\n <Field key={field.key} name={field.key} />\n ))}\n </Fieldset>\n <Button type=\"submit\">{t('button.continue')}</Button>\n </>\n )}\n </FormBuilder>\n );\n};\n\nexport default StepForm;\n"],
|
|
5
5
|
"mappings": "AAAA,OAAO,SAAS,kBAAkB;AAClC,OAAO,WAAW;AAElB,OAAO,cAAc;AACrB,OAAO,iBAAiB;AACxB,SAAS,mBAAmB;AAE5B,OAAO,YAAY;AACnB,SAAS,sBAAsB;AAaxB,MAAM,WAAoC,CAAC;AAAA,EAChD;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,EAAE,EAAE,IAAI,eAAe;AAC7B,QAAM,EAAE,MAAM,YAAY,GAAG,KAAK,IAAI,WAAW,WAAW;AAC5D,QAAM,SAAS,KAAK,OAAO,SAAS,KAAK,SAAS,MAAM;AACxD,QAAM,UAAU,KAAK,UAAU,KAAK,UAAU,MAAM;AACpD,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,UAAU,CAAC,SAAe;AACxB,mBAAW,MAAM,IAAI;AAAA,MACvB;AAAA;AAAA,IAEC,WACC,0DACG,UACA,gBACC,oCAAC,UAAO,MAAK,YAAU,EAAE,iBAAiB,CAAE,CAEhD,IAEA,0DACE,oCAAC,gBACE,OAAO,IAAI,CAAC,UACX,oCAAC,SAAM,KAAK,MAAM,KAAK,MAAM,MAAM,KAAK,CACzC,CACH,GACA,oCAAC,UAAO,MAAK,YAAU,EAAE,iBAAiB,CAAE,CAC9C;AAAA,EAEJ;AAEJ;AAEA,IAAO,mBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Questions/Step/StepQuote.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport type { ParagraphProps } from '@digigov/ui/typography/Paragraph';\nimport Paragraph from '@digigov/ui/typography/Paragraph';\n\nexport const StepQuote: React.FC<ParagraphProps> = ({ children, ...props }) => {\n return <Paragraph {...props}>{children}</Paragraph>;\n};\n\nexport default StepQuote;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,WAAW;AAElB,OAAO,eAAe;AAEf,MAAM,YAAsC,CAAC,EAAE,UAAU,GAAG,MAAM,MAAM;AAC7E,SAAO,oCAAC,aAAW,GAAG,SAAQ,QAAS;AACzC;AAEA,IAAO,oBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Questions/Step/StepTitle.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext } from 'react';\nimport { StepContext } from '@digigov/form/Questions/Step/StepContext';\nimport {\n PageTitleContainer,\n PageTitleCaption,\n} from '@digigov/ui/app/PageTitleContainer';\nimport { useTranslation } from '@digigov/ui/i18n';\nimport { BackLink } from '@digigov/ui/navigation/BackLink';\nimport { Heading
|
|
5
|
-
"mappings": "AAAA,OAAO,SAAS,kBAAkB;AAClC,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB;
|
|
4
|
+
"sourcesContent": ["import React, { useContext } from 'react';\nimport { StepContext } from '@digigov/form/Questions/Step/StepContext';\nimport {\n PageTitleContainer,\n PageTitleCaption,\n} from '@digigov/ui/app/PageTitleContainer';\nimport { useTranslation } from '@digigov/ui/i18n';\nimport { BackLink } from '@digigov/ui/navigation/BackLink';\nimport type { HeadingProps } from '@digigov/ui/typography/Heading';\nimport { Heading } from '@digigov/ui/typography/Heading';\nimport { HeadingCaption } from '@digigov/ui/typography/HeadingCaption';\n\nexport interface StepTitleInterface {\n title?: string;\n backButton?: string;\n caption?: string;\n step?: string;\n children?: React.ReactNode;\n}\n\nexport const StepTitleHeading: React.FC<HeadingProps> = (props) => {\n return <Heading>{props.children}</Heading>;\n};\n\nexport const StepTitleBase: React.FC<StepTitleInterface> = ({\n caption,\n step,\n title,\n backButton,\n children,\n}): React.ReactElement => {\n const { t } = useTranslation();\n return (\n <>\n <BackLink>{backButton || t('button.back')}</BackLink>\n <PageTitleContainer>\n {children || (\n <>\n <HeadingCaption size=\"xl\">{caption && t(caption)}</HeadingCaption>\n {step && <PageTitleCaption>{step}</PageTitleCaption>}\n <StepTitleHeading>{title && t(title)}</StepTitleHeading>\n </>\n )}\n </PageTitleContainer>\n </>\n );\n};\n\n/**\n * The StepTitle component accepts a title, a caption and a step indicator\n * about the Step asked to the User\n */\nexport const StepTitle: React.FC<StepTitleInterface> = (props) => {\n const { caption, title, step, backButton } = useContext(StepContext);\n return (\n <StepTitleBase\n backButton={backButton}\n caption={caption}\n step={step}\n title={title}\n >\n {props.children}\n </StepTitleBase>\n );\n};\n\nexport default StepTitle;\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,SAAS,kBAAkB;AAClC,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB;AAEzB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAUxB,MAAM,mBAA2C,CAAC,UAAU;AACjE,SAAO,oCAAC,eAAS,MAAM,QAAS;AAClC;AAEO,MAAM,gBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA0B;AACxB,QAAM,EAAE,EAAE,IAAI,eAAe;AAC7B,SACE,0DACE,oCAAC,gBAAU,cAAc,EAAE,aAAa,CAAE,GAC1C,oCAAC,0BACE,YACC,0DACE,oCAAC,kBAAe,MAAK,QAAM,WAAW,EAAE,OAAO,CAAE,GAChD,QAAQ,oCAAC,wBAAkB,IAAK,GACjC,oCAAC,wBAAkB,SAAS,EAAE,KAAK,CAAE,CACvC,CAEJ,CACF;AAEJ;AAMO,MAAM,YAA0C,CAAC,UAAU;AAChE,QAAM,EAAE,SAAS,OAAO,MAAM,WAAW,IAAI,WAAW,WAAW;AACnE,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEC,MAAM;AAAA,EACT;AAEJ;AAEA,IAAO,oBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { StepInterface } from '@digigov/form/Questions/Step/types';
|
|
2
|
-
import { FieldSpec } from '@digigov/form/types';
|
|
1
|
+
import type { StepInterface } from '@digigov/form/Questions/Step/types';
|
|
2
|
+
import type { FieldSpec } from '@digigov/form/types';
|
|
3
3
|
export declare const getAddMoreFields: (currentStep: StepInterface) => FieldSpec[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/Questions/Step/getAddMoreFields.tsx"],
|
|
4
|
-
"sourcesContent": ["import { StepInterface } from '@digigov/form/Questions/Step/types';\nimport { FieldSpec } from '@digigov/form/types';\n\nexport const getAddMoreFields = (currentStep: StepInterface): FieldSpec[] => {\n return [\n {\n key: 'addMore',\n type: 'choice:single',\n required: true,\n extra: {\n options: [\n {\n label: currentStep.review?.addMore.answers.positive || {\n primary: 'Yes',\n },\n value: 'yes',\n },\n {\n label: currentStep.review?.addMore.answers.negative || {\n primary: 'No',\n },\n value: 'no',\n },\n ],\n },\n },\n ];\n};\n"],
|
|
4
|
+
"sourcesContent": ["import type { StepInterface } from '@digigov/form/Questions/Step/types';\nimport type { FieldSpec } from '@digigov/form/types';\n\nexport const getAddMoreFields = (currentStep: StepInterface): FieldSpec[] => {\n return [\n {\n key: 'addMore',\n type: 'choice:single',\n required: true,\n extra: {\n options: [\n {\n label: currentStep.review?.addMore.answers.positive || {\n primary: 'Yes',\n },\n value: 'yes',\n },\n {\n label: currentStep.review?.addMore.answers.negative || {\n primary: 'No',\n },\n value: 'no',\n },\n ],\n },\n },\n ];\n};\n"],
|
|
5
5
|
"mappings": "AAGO,MAAM,mBAAmB,CAAC,gBAA4C;AAC3E,SAAO;AAAA,IACL;AAAA,MACE,KAAK;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA,MACV,OAAO;AAAA,QACL,SAAS;AAAA,UACP;AAAA,YACE,OAAO,YAAY,QAAQ,QAAQ,QAAQ,YAAY;AAAA,cACrD,SAAS;AAAA,YACX;AAAA,YACA,OAAO;AAAA,UACT;AAAA,UACA;AAAA,YACE,OAAO,YAAY,QAAQ,QAAQ,QAAQ,YAAY;AAAA,cACrD,SAAS;AAAA,YACX;AAAA,YACA,OAAO;AAAA,UACT;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { StepInterface } from '@digigov/form/Questions/Step/types';
|
|
1
|
+
import type { StepInterface } from '@digigov/form/Questions/Step/types';
|
|
2
2
|
export declare function getNextStep(currentStep: any, steps: any[], data: any): StepInterface | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/Questions/getNextStep.tsx"],
|
|
4
|
-
"sourcesContent": ["import { StepInterface } from '@digigov/form/Questions/Step/types';\n\nexport function getNextStep(\n currentStep: any,\n steps: any[],\n data: any\n): StepInterface | null {\n if (currentStep.nextStep) {\n const nextStepName = currentStep.nextStep(data);\n if (nextStepName) {\n return steps.find((step) => step.name === nextStepName);\n }\n }\n const currentStepIndex = steps.findIndex(\n (step) => step.name === currentStep.name\n );\n const nextStep = steps.slice(currentStepIndex + 1).find((step) => {\n if (step.show) {\n return step.show(data);\n }\n return true;\n });\n return nextStep;\n}\n"],
|
|
4
|
+
"sourcesContent": ["import type { StepInterface } from '@digigov/form/Questions/Step/types';\n\nexport function getNextStep(\n currentStep: any,\n steps: any[],\n data: any\n): StepInterface | null {\n if (currentStep.nextStep) {\n const nextStepName = currentStep.nextStep(data);\n if (nextStepName) {\n return steps.find((step) => step.name === nextStepName);\n }\n }\n const currentStepIndex = steps.findIndex(\n (step) => step.name === currentStep.name\n );\n const nextStep = steps.slice(currentStepIndex + 1).find((step) => {\n if (step.show) {\n return step.show(data);\n }\n return true;\n });\n return nextStep;\n}\n"],
|
|
5
5
|
"mappings": "AAEO,SAAS,YACd,aACA,OACA,MACsB;AACtB,MAAI,YAAY,UAAU;AACxB,UAAM,eAAe,YAAY,SAAS,IAAI;AAC9C,QAAI,cAAc;AAChB,aAAO,MAAM,KAAK,CAAC,SAAS,KAAK,SAAS,YAAY;AAAA,IACxD;AAAA,EACF;AACA,QAAM,mBAAmB,MAAM;AAAA,IAC7B,CAAC,SAAS,KAAK,SAAS,YAAY;AAAA,EACtC;AACA,QAAM,WAAW,MAAM,MAAM,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS;AAChE,QAAI,KAAK,MAAM;AACb,aAAO,KAAK,KAAK,IAAI;AAAA,IACvB;AACA,WAAO;AAAA,EACT,CAAC;AACD,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/Questions/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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"],
|
|
4
|
+
"sourcesContent": ["import React, { createContext, useEffect, useState } from 'react';\nimport type { ErrorOption } from 'react-hook-form';\nimport type { 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 type { 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
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0D;AAG1D,kBAA+B;AAC/B,0BAA6B;AAC7B,kBAA+B;AAC/B,kBAAqB;AACrB,qBAAwB;AACxB,kBAAqB;AASd,MAAM,wBAAoB;AAAA,EAC/B;AACF;AAQO,MAAM,aAAwC,CAAC;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAsB,CAAC,CAAC;AACpD,QAAM,EAAE,EAAE,QAAI,4BAAe;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,8BAAU,MAAM;AACd,cAAU,CAAC,CAAC;AAAA,EACd,GAAG,CAAC,UAAU,CAAC;AACf,SACE,6BAAAA,QAAA,cAAC,kBAAkB,UAAlB,EAA2B,OAAO,EAAE,SAAS,KAC3C,OAAO,KAAK,MAAM,EAAE,WAAW,KAC9B,6BAAAA,QAAA,cAAC,oCAAa,SAAQ,iBACpB,6BAAAA,QAAA,cAAC,0BAAQ,MAAK,QAAK,uNACyB,GAC5C,GACA,6BAAAA,QAAA,cAAC,oBAAK,WAAU,aACZ,cAAc,OAAO,KAAK,MAAM,EAAE,QAAQ,GACzC,OAAO,CAAC,cAAc,OAAO,SAAS,CAAC,EACvC,IAAI,CAAC,WAAW,UAAU;AACzB,WACE,6BAAAA,QAAA,cAAC,wBAAS,KAAK,OAAO,IAAI,GAAG,SAAS,YACpC,6BAAAA,QAAA,cAAC,oBAAK,IAAG,OAAK,EAAE,OAAO,SAAS,GAAG,KAAK,GAAE,GAAC,GAAQ,KACnD,6BAAAA,QAAA,cAAC,oBAAK,MAAM,IAAI,SAAS,MACtB,EAAE,OAAO,SAAS,GAAG,OAAO,CAC/B,CACF;AAAA,EAEJ,CAAC,CACL,CACF,GAED,QACH;AAEJ;AAEA,IAAO,qBAAQ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|