@digigov/form 2.0.0-264e5fff → 2.0.0-290ada95
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 +2 -2
- package/Field/ErrorGroup.js +53 -0
- package/Field/FieldBase.d.ts +1 -1
- package/Field/FieldBase.js +77 -0
- package/Field/FieldBaseContainer.d.ts +1 -1
- 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 +69 -107
- package/Field/types.d.ts +3 -3
- package/Field/types.js +0 -0
- package/Field/utils/evaluateFieldWithConditions.d.ts +1 -1
- package/Field/utils/evaluateFieldWithConditions.js +19 -0
- package/Field/utils/resolveField.d.ts +2 -2
- 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 +1 -1
- package/FieldArray/BaseFieldArray.js +46 -0
- package/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay.js +13 -0
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay.js +117 -0
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader.js +6 -0
- package/FieldArray/FormDialog/ArrayDisplay/index.js +32 -57
- package/FieldArray/FormDialog/ArrayEditModal.d.ts +1 -1
- package/FieldArray/FormDialog/ArrayEditModal.js +138 -0
- package/FieldArray/FormDialog/index.d.ts +1 -1
- package/FieldArray/FormDialog/index.js +142 -177
- package/FieldArray/index.d.ts +2 -2
- package/FieldArray/index.js +59 -86
- package/FieldObject/index.d.ts +2 -2
- package/FieldObject/index.js +52 -77
- package/Fieldset/FieldsetWithContext.js +27 -0
- package/Fieldset/index.d.ts +1 -1
- package/Fieldset/index.js +18 -30
- package/Fieldset/types.js +0 -0
- package/FormBuilder/index.d.ts +2 -2
- package/FormBuilder/index.js +226 -254
- package/FormContext.d.ts +1 -1
- package/FormContext.js +7 -0
- package/MultiplicityField/add-objects.d.ts +1 -1
- package/MultiplicityField/add-objects.js +107 -0
- package/MultiplicityField/index.d.ts +1 -1
- package/MultiplicityField/index.js +81 -119
- package/MultiplicityField/types.d.ts +1 -1
- 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.js +18 -0
- package/Questions/Step/StepForm.d.ts +2 -2
- package/Questions/Step/StepForm.js +29 -0
- package/Questions/Step/StepQuote.js +5 -0
- 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.js +83 -0
- package/hooks/utils.js +60 -0
- package/index.d.ts +5 -5
- package/index.js +8 -13
- package/inputs/AutoCompleteInput/index.d.ts +2 -2
- package/inputs/AutoCompleteInput/index.js +38 -60
- package/inputs/Checkboxes/index.d.ts +2 -2
- package/inputs/Checkboxes/index.js +43 -76
- package/inputs/DateInput/index.d.ts +1 -1
- package/inputs/DateInput/index.js +123 -147
- package/inputs/DateTimeInput/index.d.ts +1 -1
- package/inputs/DateTimeInput/index.js +177 -207
- package/inputs/FileInput/index.d.ts +1 -1
- package/inputs/FileInput/index.js +54 -70
- package/inputs/ImageInput/index.d.ts +1 -1
- package/inputs/ImageInput/index.js +74 -74
- package/inputs/Input/index.d.ts +1 -1
- package/inputs/Input/index.js +60 -73
- package/inputs/Label/index.d.ts +1 -1
- package/inputs/Label/index.js +13 -16
- package/inputs/OtpInput/index.js +116 -145
- package/inputs/Radio/index.d.ts +2 -2
- package/inputs/Radio/index.js +70 -103
- package/inputs/Select/index.d.ts +2 -2
- package/inputs/Select/index.js +23 -32
- package/inputs/index.d.ts +9 -9
- package/inputs/index.js +10 -21
- package/inputs/registry.d.ts +1 -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 +8 -8
- package/registry.d.ts +82 -0
- package/registry.js +170 -0
- package/src/Field/ErrorGroup.tsx +1 -1
- package/src/FormBuilder/doc.mdx +1 -1
- package/src/inputs/AutoCompleteInput/doc.mdx +2 -2
- package/src/inputs/Checkboxes/doc.mdx +3 -3
- package/src/inputs/DateInput/doc.mdx +1 -1
- package/src/inputs/DateTimeInput/doc.mdx +1 -1
- package/src/inputs/FileInput/doc.mdx +1 -1
- package/src/inputs/ImageInput/doc.mdx +3 -3
- package/src/inputs/Input/doc.mdx +10 -10
- package/src/inputs/Label/doc.mdx +1 -1
- package/src/inputs/OtpInput/doc.mdx +1 -1
- package/src/inputs/Radio/doc.mdx +3 -3
- package/src/inputs/Select/doc.mdx +1 -1
- package/{lazy/index.js → src/lazy.ts} +0 -25
- package/types.d.ts +4 -4
- package/types.js +1 -0
- package/utils.js +56 -0
- package/validators/index.d.ts +2 -2
- package/validators/index.js +112 -159
- package/validators/types.js +0 -0
- package/validators/utils/afm.js +19 -0
- package/validators/utils/amka.js +27 -0
- package/validators/utils/date.d.ts +2 -2
- package/validators/utils/date.js +95 -0
- package/validators/utils/datetime.d.ts +2 -2
- package/validators/utils/datetime.js +121 -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 -14
- package/validators/utils/index.js +58 -96
- 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 -122
- package/Field/FieldBase/package.json +0 -6
- package/Field/FieldBase.js.map +0 -7
- package/Field/FieldBaseContainer/index.js +0 -52
- package/Field/FieldBaseContainer/package.json +0 -6
- package/Field/FieldBaseContainer.js.map +0 -7
- package/Field/FieldConditional/index.js +0 -89
- 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/evaluateFieldWithConditions/index.js +0 -26
- package/Field/utils/evaluateFieldWithConditions/package.json +0 -6
- package/Field/utils/evaluateFieldWithConditions.js.map +0 -7
- package/Field/utils/resolveField/index.js +0 -35
- package/Field/utils/resolveField/package.json +0 -6
- package/Field/utils/resolveField.js.map +0 -7
- package/Field/utils/useField/index.js +0 -66
- package/Field/utils/useField/package.json +0 -6
- package/Field/utils/useField.js.map +0 -7
- package/FieldArray/BaseFieldArray/index.js +0 -76
- package/FieldArray/BaseFieldArray/package.json +0 -6
- package/FieldArray/BaseFieldArray.js.map +0 -7
- package/FieldArray/FieldArray.stories.d.ts +0 -11
- package/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay/index.js +0 -23
- package/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay/package.json +0 -6
- package/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay.js.map +0 -7
- package/FieldArray/FormDialog/ArrayDisplay/ArrayDisplay.stories.d.ts +0 -13
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay/index.js +0 -184
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay/package.json +0 -6
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay.js.map +0 -7
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader/index.js +0 -11
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader/package.json +0 -6
- package/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader.js.map +0 -7
- package/FieldArray/FormDialog/ArrayDisplay/__stories__/Cards.d.ts +0 -2
- package/FieldArray/FormDialog/ArrayDisplay/__stories__/Default.d.ts +0 -2
- package/FieldArray/FormDialog/ArrayDisplay/__stories__/ReadOnly.d.ts +0 -2
- package/FieldArray/FormDialog/ArrayDisplay/__stories__/ReadOnlyCards.d.ts +0 -2
- package/FieldArray/FormDialog/ArrayDisplay/__stories__/Sortable.d.ts +0 -2
- package/FieldArray/FormDialog/ArrayDisplay/__stories__/SortableCards.d.ts +0 -2
- package/FieldArray/FormDialog/ArrayDisplay/index.js.map +0 -7
- package/FieldArray/FormDialog/ArrayDisplay/package.json +0 -6
- package/FieldArray/FormDialog/ArrayEditModal/index.js +0 -158
- package/FieldArray/FormDialog/ArrayEditModal/package.json +0 -6
- package/FieldArray/FormDialog/ArrayEditModal.js.map +0 -7
- package/FieldArray/FormDialog/index.js.map +0 -7
- package/FieldArray/FormDialog/package.json +0 -6
- package/FieldArray/__stories__/CardsWithError.d.ts +0 -15
- 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/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/package.json +0 -6
- package/FormContext/index.js +0 -13
- 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 -146
- 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/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/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 -155
- package/cjs/Field/FieldBase.js.map +0 -7
- package/cjs/Field/FieldBaseContainer/index.js +0 -85
- package/cjs/Field/FieldBaseContainer.js.map +0 -7
- package/cjs/Field/FieldConditional/index.js +0 -122
- package/cjs/Field/FieldConditional.js.map +0 -7
- package/cjs/Field/index.js +0 -143
- 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/evaluateFieldWithConditions/index.js +0 -49
- package/cjs/Field/utils/evaluateFieldWithConditions.js.map +0 -7
- package/cjs/Field/utils/resolveField/index.js +0 -55
- package/cjs/Field/utils/resolveField.js.map +0 -7
- package/cjs/Field/utils/useField/index.js +0 -89
- package/cjs/Field/utils/useField.js.map +0 -7
- package/cjs/FieldArray/BaseFieldArray/index.js +0 -109
- package/cjs/FieldArray/BaseFieldArray.js.map +0 -7
- package/cjs/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay/index.js +0 -56
- package/cjs/FieldArray/FormDialog/ArrayDisplay/ArrayContainerDisplay.js.map +0 -7
- package/cjs/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay/index.js +0 -209
- package/cjs/FieldArray/FormDialog/ArrayDisplay/ArrayItemDisplay.js.map +0 -7
- package/cjs/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader/index.js +0 -44
- package/cjs/FieldArray/FormDialog/ArrayDisplay/ArrayItemHeader.js.map +0 -7
- package/cjs/FieldArray/FormDialog/ArrayDisplay/index.js +0 -90
- package/cjs/FieldArray/FormDialog/ArrayDisplay/index.js.map +0 -7
- package/cjs/FieldArray/FormDialog/ArrayEditModal/index.js +0 -186
- package/cjs/FieldArray/FormDialog/ArrayEditModal.js.map +0 -7
- package/cjs/FieldArray/FormDialog/index.js +0 -261
- package/cjs/FieldArray/FormDialog/index.js.map +0 -7
- package/cjs/FieldArray/index.js +0 -126
- package/cjs/FieldArray/index.js.map +0 -7
- package/cjs/FieldObject/index.js +0 -113
- 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 -303
- package/cjs/FormBuilder/index.js.map +0 -7
- package/cjs/FormContext/index.js +0 -37
- package/cjs/FormContext.js.map +0 -7
- package/cjs/MultiplicityField/add-objects/index.js +0 -179
- package/cjs/MultiplicityField/add-objects.js.map +0 -7
- package/cjs/MultiplicityField/index.js +0 -153
- 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/hooks/useFieldFocusManager/index.js +0 -135
- package/cjs/hooks/useFieldFocusManager.js.map +0 -7
- package/cjs/hooks/utils/index.js +0 -98
- package/cjs/hooks/utils.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 -112
- package/cjs/inputs/Checkboxes/index.js.map +0 -7
- package/cjs/inputs/DateInput/index.js +0 -188
- package/cjs/inputs/DateInput/index.js.map +0 -7
- package/cjs/inputs/DateTimeInput/index.js +0 -250
- package/cjs/inputs/DateTimeInput/index.js.map +0 -7
- package/cjs/inputs/FileInput/index.js +0 -110
- package/cjs/inputs/FileInput/index.js.map +0 -7
- package/cjs/inputs/ImageInput/__stories__/logo.d/index.js +0 -1
- package/cjs/inputs/ImageInput/__stories__/logo.d.js.map +0 -7
- package/cjs/inputs/ImageInput/index.js +0 -130
- package/cjs/inputs/ImageInput/index.js.map +0 -7
- package/cjs/inputs/Input/index.js +0 -115
- package/cjs/inputs/Input/index.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 -186
- package/cjs/inputs/OtpInput/index.js.map +0 -7
- package/cjs/inputs/Radio/index.js +0 -136
- package/cjs/inputs/Radio/index.js.map +0 -7
- package/cjs/inputs/Select/index.js +0 -63
- 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/registry/index.js +0 -121
- package/cjs/inputs/registry.js.map +0 -7
- package/cjs/internal/index.js +0 -38
- package/cjs/internal.js.map +0 -7
- package/cjs/lazy/index.js +0 -114
- package/cjs/lazy.js.map +0 -7
- package/cjs/registry/index.js +0 -209
- 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 -106
- package/cjs/utils.js.map +0 -7
- package/cjs/validators/index.js +0 -179
- 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/amka/index.js +0 -60
- package/cjs/validators/utils/amka.js.map +0 -7
- package/cjs/validators/utils/date/index.js +0 -161
- package/cjs/validators/utils/date.js.map +0 -7
- package/cjs/validators/utils/datetime/index.js +0 -245
- package/cjs/validators/utils/datetime.js.map +0 -7
- package/cjs/validators/utils/email/index.js +0 -39
- package/cjs/validators/utils/email.js.map +0 -7
- package/cjs/validators/utils/file/index.js +0 -61
- 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 -152
- 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/hooks/__tests__/utils.spec.d.ts +0 -1
- package/hooks/useFieldFocusManager/index.js +0 -116
- package/hooks/useFieldFocusManager/package.json +0 -6
- package/hooks/useFieldFocusManager.js.map +0 -7
- package/hooks/utils/index.js +0 -73
- package/hooks/utils/package.json +0 -6
- package/hooks/utils.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/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/package.json +0 -6
- package/inputs/DateInput/DateInput.stories.d.ts +0 -14
- package/inputs/DateInput/__stories__/Default.d.ts +0 -3
- package/inputs/DateInput/__stories__/WithDefaultValue.d.ts +0 -3
- package/inputs/DateInput/__stories__/WithInitialValue.d.ts +0 -3
- package/inputs/DateInput/__stories__/WithWrongDefaultValue.d.ts +0 -3
- package/inputs/DateInput/__stories__/WithWrongInitialValue.d.ts +0 -3
- package/inputs/DateInput/index.js.map +0 -7
- package/inputs/DateInput/package.json +0 -6
- package/inputs/DateTimeInput/DateTimeInput.stories.d.ts +0 -14
- package/inputs/DateTimeInput/__stories__/Default.d.ts +0 -3
- package/inputs/DateTimeInput/__stories__/WithDefaultValue.d.ts +0 -3
- package/inputs/DateTimeInput/__stories__/WithInitialValue.d.ts +0 -3
- package/inputs/DateTimeInput/__stories__/WithWrongDefaultValue.d.ts +0 -3
- package/inputs/DateTimeInput/__stories__/WithWrongInitialValue.d.ts +0 -3
- package/inputs/DateTimeInput/index.js.map +0 -7
- package/inputs/DateTimeInput/package.json +0 -6
- package/inputs/FileInput/FileInput.stories.d.ts +0 -11
- package/inputs/FileInput/__stories__/Default.d.ts +0 -3
- package/inputs/FileInput/__stories__/WithBorderAndLink.d.ts +0 -3
- package/inputs/FileInput/index.js.map +0 -7
- package/inputs/FileInput/package.json +0 -6
- package/inputs/ImageInput/ImageInput.stories.d.ts +0 -13
- package/inputs/ImageInput/__stories__/Default.d.ts +0 -3
- package/inputs/ImageInput/__stories__/MaxSize.d.ts +0 -3
- package/inputs/ImageInput/__stories__/WithInitialValues.d.ts +0 -3
- package/inputs/ImageInput/__stories__/WithInvalidImageDimension.d.ts +0 -3
- package/inputs/ImageInput/__stories__/logo.d/index.js +0 -1
- package/inputs/ImageInput/__stories__/logo.d/package.json +0 -6
- package/inputs/ImageInput/__stories__/logo.d.js.map +0 -7
- package/inputs/ImageInput/index.js.map +0 -7
- package/inputs/ImageInput/package.json +0 -6
- package/inputs/Input/Input.stories.d.ts +0 -23
- package/inputs/Input/__stories__/AFM.d.ts +0 -3
- package/inputs/Input/__stories__/AMKA.d.ts +0 -3
- package/inputs/Input/__stories__/Boolean.d.ts +0 -3
- package/inputs/Input/__stories__/Email.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__/Rate.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/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/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/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/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/package.json +0 -6
- package/inputs/index.js.map +0 -7
- package/inputs/package.json +0 -6
- package/inputs/registry/index.js +0 -86
- package/inputs/registry/package.json +0 -6
- package/inputs/registry.js.map +0 -7
- 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/registry/index.js +0 -179
- package/registry/package.json +0 -6
- package/src/lazy.js +0 -81
- package/types/index.js +0 -2
- package/types/package.json +0 -6
- package/types.js.map +0 -7
- package/utils/index.js +0 -82
- 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/amka/index.js +0 -36
- package/validators/utils/amka/package.json +0 -6
- package/validators/utils/amka.js.map +0 -7
- package/validators/utils/date/index.js +0 -126
- package/validators/utils/date/package.json +0 -6
- package/validators/utils/date.js.map +0 -7
- package/validators/utils/datetime/index.js +0 -210
- package/validators/utils/datetime/package.json +0 -6
- package/validators/utils/datetime.js.map +0 -7
- package/validators/utils/email/index.js +0 -16
- package/validators/utils/email/package.json +0 -6
- package/validators/utils/email.js.map +0 -7
- package/validators/utils/file/index.js +0 -38
- package/validators/utils/file/package.json +0 -6
- package/validators/utils/file.js.map +0 -7
- package/validators/utils/iban/index.js +0 -118
- package/validators/utils/iban/package.json +0 -6
- package/validators/utils/iban.js.map +0 -7
- package/validators/utils/image/index.js +0 -79
- package/validators/utils/image/package.json +0 -6
- package/validators/utils/image.js.map +0 -7
- package/validators/utils/index.js.map +0 -7
- package/validators/utils/int/index.js +0 -24
- package/validators/utils/int/package.json +0 -6
- package/validators/utils/int.js.map +0 -7
- package/validators/utils/number/index.js +0 -20
- package/validators/utils/number/package.json +0 -6
- package/validators/utils/number.js.map +0 -7
- package/validators/utils/otp/index.js +0 -30
- package/validators/utils/otp/package.json +0 -6
- package/validators/utils/otp.js.map +0 -7
- package/validators/utils/package.json +0 -6
- package/validators/utils/phone/index.js +0 -172
- package/validators/utils/phone/package.json +0 -6
- package/validators/utils/phone.js.map +0 -7
- package/validators/utils/postal_code/index.js +0 -30
- package/validators/utils/postal_code/package.json +0 -6
- package/validators/utils/postal_code.js.map +0 -7
- package/validators/utils/text_limit/index.js +0 -45
- package/validators/utils/text_limit/package.json +0 -6
- package/validators/utils/text_limit.js.map +0 -7
- package/validators/utils/uuid4/index.js +0 -22
- package/validators/utils/uuid4/package.json +0 -6
- package/validators/utils/uuid4.js.map +0 -7
- package/validators/validators.spec.d.ts +0 -1
- package/src/{registry.js → registry.ts} +6 -6
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var useFieldFocusManager_exports = {};
|
|
19
|
-
__export(useFieldFocusManager_exports, {
|
|
20
|
-
default: () => useFieldFocusManager_default,
|
|
21
|
-
useFieldFocusManager: () => useFieldFocusManager
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(useFieldFocusManager_exports);
|
|
24
|
-
var import_react = require("react");
|
|
25
|
-
var import_utils = require("@digigov/form/hooks/utils");
|
|
26
|
-
function useFieldFocusManager({
|
|
27
|
-
enabled = true,
|
|
28
|
-
control,
|
|
29
|
-
subscribe,
|
|
30
|
-
setFocus
|
|
31
|
-
}) {
|
|
32
|
-
const customFocusableElements = (0, import_react.useRef)(/* @__PURE__ */ new Map());
|
|
33
|
-
const focusableElements = (0, import_react.useRef)(/* @__PURE__ */ new Map());
|
|
34
|
-
(0, import_react.useEffect)(() => {
|
|
35
|
-
if (!enabled) {
|
|
36
|
-
customFocusableElements.current.clear();
|
|
37
|
-
focusableElements.current.clear();
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
}, [enabled]);
|
|
41
|
-
const updateFocusableElements = (0, import_react.useCallback)(() => {
|
|
42
|
-
focusableElements.current.clear();
|
|
43
|
-
const formElements = (0, import_utils.extractFieldEntries)(control._fields);
|
|
44
|
-
const customFieldRefs = (0, import_utils.mapElementsToFields)(
|
|
45
|
-
customFocusableElements.current
|
|
46
|
-
);
|
|
47
|
-
const customElements = (0, import_utils.extractFieldEntries)(customFieldRefs);
|
|
48
|
-
const combinedElements = new Map(formElements);
|
|
49
|
-
customElements.forEach((element, fieldName) => {
|
|
50
|
-
combinedElements.set(fieldName, element);
|
|
51
|
-
});
|
|
52
|
-
focusableElements.current = (0, import_utils.sortElementsByPosition)(combinedElements);
|
|
53
|
-
}, [control._fields]);
|
|
54
|
-
const registerCustomFocusableElement = (0, import_react.useCallback)(
|
|
55
|
-
(fieldName, element) => {
|
|
56
|
-
if (fieldName && element) {
|
|
57
|
-
customFocusableElements.current.set(fieldName, element);
|
|
58
|
-
updateFocusableElements();
|
|
59
|
-
}
|
|
60
|
-
return function unregister() {
|
|
61
|
-
customFocusableElements.current.delete(fieldName);
|
|
62
|
-
updateFocusableElements();
|
|
63
|
-
};
|
|
64
|
-
},
|
|
65
|
-
[updateFocusableElements]
|
|
66
|
-
);
|
|
67
|
-
(0, import_react.useEffect)(() => {
|
|
68
|
-
if (!enabled || !subscribe) return;
|
|
69
|
-
const callback = subscribe({
|
|
70
|
-
formState: {
|
|
71
|
-
errors: true
|
|
72
|
-
// Subscribe to any form state change that might indicate field structure changes
|
|
73
|
-
},
|
|
74
|
-
callback: () => {
|
|
75
|
-
setTimeout(updateFocusableElements, 0);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
updateFocusableElements();
|
|
79
|
-
return () => callback();
|
|
80
|
-
}, [enabled, updateFocusableElements, subscribe]);
|
|
81
|
-
const focusOnError = (0, import_react.useCallback)(
|
|
82
|
-
(errors) => {
|
|
83
|
-
if (!enabled) return;
|
|
84
|
-
if (!errors || Object.keys(errors).length === 0) return;
|
|
85
|
-
for (const [fieldName, element] of Array.from(
|
|
86
|
-
focusableElements.current
|
|
87
|
-
)) {
|
|
88
|
-
if (hasFieldError(errors, fieldName)) {
|
|
89
|
-
if (element && typeof element.focus === "function") {
|
|
90
|
-
element.focus();
|
|
91
|
-
return;
|
|
92
|
-
} else if (element && element.name) {
|
|
93
|
-
setFocus(fieldName);
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
[enabled, setFocus]
|
|
100
|
-
);
|
|
101
|
-
return {
|
|
102
|
-
/**
|
|
103
|
-
* Registers a custom focusable element with the given field name.
|
|
104
|
-
*
|
|
105
|
-
* Returns a callback function to unregister the element by field name.
|
|
106
|
-
*
|
|
107
|
-
* @param fieldName - The name of the field to associate with the element.
|
|
108
|
-
* @param element - The HTML element to register as focusable.
|
|
109
|
-
*/
|
|
110
|
-
registerCustomFocusableElement,
|
|
111
|
-
focusOnError
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
function hasFieldError(errors, fieldName) {
|
|
115
|
-
if (!errors || typeof errors !== "object") return false;
|
|
116
|
-
if (errors[fieldName]) {
|
|
117
|
-
return true;
|
|
118
|
-
}
|
|
119
|
-
const keys = fieldName.split(/[.[\]]+/).filter(Boolean);
|
|
120
|
-
let current = errors;
|
|
121
|
-
for (const key of keys) {
|
|
122
|
-
if (current && typeof current === "object") {
|
|
123
|
-
current = current[key];
|
|
124
|
-
} else {
|
|
125
|
-
return false;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return !!current;
|
|
129
|
-
}
|
|
130
|
-
var useFieldFocusManager_default = useFieldFocusManager;
|
|
131
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
132
|
-
0 && (module.exports = {
|
|
133
|
-
useFieldFocusManager
|
|
134
|
-
});
|
|
135
|
-
//# sourceMappingURL=useFieldFocusManager.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useFieldFocusManager.ts"],
|
|
4
|
-
"sourcesContent": ["import { useCallback, useEffect, useRef } from 'react';\nimport type { Control, FieldValues, Ref, UseFormReturn } from 'react-hook-form';\nimport {\n extractFieldEntries,\n mapElementsToFields,\n sortElementsByPosition,\n} from '@digigov/form/hooks/utils';\n\nexport interface UseFieldFocusManagerProps<T extends FieldValues> {\n enabled?: boolean;\n control: Control<T>;\n subscribe: UseFormReturn['subscribe'];\n setFocus: UseFormReturn['setFocus'];\n}\n\n/**\n * Custom hook to manage focus on form fields.\n *\n * It collects all focusable elements from the form fields and sorts them according to their position in the DOM.\n */\nexport function useFieldFocusManager<T extends FieldValues>({\n enabled = true,\n control,\n subscribe,\n setFocus,\n}: UseFieldFocusManagerProps<T>) {\n /** Array to hold any external focusable elements registered by the user */\n const customFocusableElements = useRef(new Map<string, HTMLElement>());\n /** Map to hold focusable elements by field name */\n const focusableElements = useRef(new Map<string, Ref>());\n\n // When disabled, clear custom focusable elements and focusable elements map\n useEffect(() => {\n if (!enabled) {\n customFocusableElements.current.clear();\n focusableElements.current.clear();\n return;\n }\n }, [enabled]);\n\n const updateFocusableElements = useCallback(() => {\n // Clear existing focusable elements\n focusableElements.current.clear();\n // Extract from form fields\n const formElements = extractFieldEntries(control._fields);\n // Extract from custom elements (convert to FieldRefs format first)\n const customFieldRefs = mapElementsToFields(\n customFocusableElements.current\n );\n const customElements = extractFieldEntries(customFieldRefs);\n\n // Combine both maps\n const combinedElements = new Map(formElements);\n customElements.forEach((element, fieldName) => {\n combinedElements.set(fieldName, element);\n });\n\n // Sort once by DOM position\n focusableElements.current = sortElementsByPosition(combinedElements);\n }, [control._fields]);\n\n // Register / unregister custom focusable elements\n const registerCustomFocusableElement = useCallback(\n (fieldName: string, element: HTMLElement) => {\n if (fieldName && element) {\n customFocusableElements.current.set(fieldName, element);\n updateFocusableElements();\n }\n\n return function unregister() {\n customFocusableElements.current.delete(fieldName);\n updateFocusableElements();\n };\n },\n [updateFocusableElements]\n );\n\n // Collect focusable elements when fields change\n useEffect(() => {\n if (!enabled || !subscribe) return;\n const callback = subscribe({\n formState: {\n errors: true,\n // Subscribe to any form state change that might indicate field structure changes\n },\n callback: () => {\n // Defer to next tick to ensure DOM is updated\n setTimeout(updateFocusableElements, 0);\n },\n });\n\n // Initial update\n updateFocusableElements();\n\n return () => callback();\n }, [enabled, updateFocusableElements, subscribe]);\n\n // Subscribe to errors and focus the first field (according to the DOM) with an error\n const focusOnError = useCallback(\n (errors: Record<string, any>) => {\n if (!enabled) return;\n if (!errors || Object.keys(errors).length === 0) return;\n for (const [fieldName, element] of Array.from(\n focusableElements.current\n )) {\n if (hasFieldError(errors, fieldName)) {\n if (element && typeof element.focus === 'function') {\n element.focus(); // Focus the element directly\n return;\n } else if (element && element.name) {\n setFocus(fieldName); // Field is registered with react-hook-form\n return;\n }\n }\n }\n },\n [enabled, setFocus]\n );\n\n return {\n /**\n * Registers a custom focusable element with the given field name.\n *\n * Returns a callback function to unregister the element by field name.\n *\n * @param fieldName - The name of the field to associate with the element.\n * @param element - The HTML element to register as focusable.\n */\n registerCustomFocusableElement,\n focusOnError,\n };\n}\n\n// Helper function to check for nested field errors\nfunction hasFieldError(\n errors: Record<string, any>,\n fieldName: string\n): boolean {\n if (!errors || typeof errors !== 'object') return false;\n\n // Handle direct field names first\n if (errors[fieldName]) {\n return true;\n }\n\n // Split the field name and traverse the error object\n const keys = fieldName.split(/[.[\\]]+/).filter(Boolean);\n let current = errors;\n\n for (const key of keys) {\n if (current && typeof current === 'object') {\n current = current[key];\n } else {\n return false;\n }\n }\n\n // Check if we found a truthy error value\n return !!current;\n}\n\nexport default useFieldFocusManager;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+C;AAE/C,mBAIO;AAcA,SAAS,qBAA4C;AAAA,EAC1D,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AACF,GAAiC;AAE/B,QAAM,8BAA0B,qBAAO,oBAAI,IAAyB,CAAC;AAErE,QAAM,wBAAoB,qBAAO,oBAAI,IAAiB,CAAC;AAGvD,8BAAU,MAAM;AACd,QAAI,CAAC,SAAS;AACZ,8BAAwB,QAAQ,MAAM;AACtC,wBAAkB,QAAQ,MAAM;AAChC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,OAAO,CAAC;AAEZ,QAAM,8BAA0B,0BAAY,MAAM;AAEhD,sBAAkB,QAAQ,MAAM;AAEhC,UAAM,mBAAe,kCAAoB,QAAQ,OAAO;AAExD,UAAM,sBAAkB;AAAA,MACtB,wBAAwB;AAAA,IAC1B;AACA,UAAM,qBAAiB,kCAAoB,eAAe;AAG1D,UAAM,mBAAmB,IAAI,IAAI,YAAY;AAC7C,mBAAe,QAAQ,CAAC,SAAS,cAAc;AAC7C,uBAAiB,IAAI,WAAW,OAAO;AAAA,IACzC,CAAC;AAGD,sBAAkB,cAAU,qCAAuB,gBAAgB;AAAA,EACrE,GAAG,CAAC,QAAQ,OAAO,CAAC;AAGpB,QAAM,qCAAiC;AAAA,IACrC,CAAC,WAAmB,YAAyB;AAC3C,UAAI,aAAa,SAAS;AACxB,gCAAwB,QAAQ,IAAI,WAAW,OAAO;AACtD,gCAAwB;AAAA,MAC1B;AAEA,aAAO,SAAS,aAAa;AAC3B,gCAAwB,QAAQ,OAAO,SAAS;AAChD,gCAAwB;AAAA,MAC1B;AAAA,IACF;AAAA,IACA,CAAC,uBAAuB;AAAA,EAC1B;AAGA,8BAAU,MAAM;AACd,QAAI,CAAC,WAAW,CAAC,UAAW;AAC5B,UAAM,WAAW,UAAU;AAAA,MACzB,WAAW;AAAA,QACT,QAAQ;AAAA;AAAA,MAEV;AAAA,MACA,UAAU,MAAM;AAEd,mBAAW,yBAAyB,CAAC;AAAA,MACvC;AAAA,IACF,CAAC;AAGD,4BAAwB;AAExB,WAAO,MAAM,SAAS;AAAA,EACxB,GAAG,CAAC,SAAS,yBAAyB,SAAS,CAAC;AAGhD,QAAM,mBAAe;AAAA,IACnB,CAAC,WAAgC;AAC/B,UAAI,CAAC,QAAS;AACd,UAAI,CAAC,UAAU,OAAO,KAAK,MAAM,EAAE,WAAW,EAAG;AACjD,iBAAW,CAAC,WAAW,OAAO,KAAK,MAAM;AAAA,QACvC,kBAAkB;AAAA,MACpB,GAAG;AACD,YAAI,cAAc,QAAQ,SAAS,GAAG;AACpC,cAAI,WAAW,OAAO,QAAQ,UAAU,YAAY;AAClD,oBAAQ,MAAM;AACd;AAAA,UACF,WAAW,WAAW,QAAQ,MAAM;AAClC,qBAAS,SAAS;AAClB;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,SAAS,QAAQ;AAAA,EACpB;AAEA,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASL;AAAA,IACA;AAAA,EACF;AACF;AAGA,SAAS,cACP,QACA,WACS;AACT,MAAI,CAAC,UAAU,OAAO,WAAW,SAAU,QAAO;AAGlD,MAAI,OAAO,SAAS,GAAG;AACrB,WAAO;AAAA,EACT;AAGA,QAAM,OAAO,UAAU,MAAM,SAAS,EAAE,OAAO,OAAO;AACtD,MAAI,UAAU;AAEd,aAAW,OAAO,MAAM;AACtB,QAAI,WAAW,OAAO,YAAY,UAAU;AAC1C,gBAAU,QAAQ,GAAG;AAAA,IACvB,OAAO;AACL,aAAO;AAAA,IACT;AAAA,EACF;AAGA,SAAO,CAAC,CAAC;AACX;AAEA,IAAO,+BAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/cjs/hooks/utils/index.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var utils_exports = {};
|
|
19
|
-
__export(utils_exports, {
|
|
20
|
-
extractFieldEntries: () => extractFieldEntries,
|
|
21
|
-
mapElementsToFields: () => mapElementsToFields,
|
|
22
|
-
sortElementsByPosition: () => sortElementsByPosition
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(utils_exports);
|
|
25
|
-
function extractFieldEntries(fields, prefix = "") {
|
|
26
|
-
const elementMap = /* @__PURE__ */ new Map();
|
|
27
|
-
const fieldEntries = Object.entries(fields);
|
|
28
|
-
if (fieldEntries.length === 0) return elementMap;
|
|
29
|
-
Object.entries(fields).forEach(([fieldName, field]) => {
|
|
30
|
-
if (!field) return;
|
|
31
|
-
const fullFieldName = prefix ? `${prefix}.${fieldName}` : fieldName;
|
|
32
|
-
if (isField(field)) {
|
|
33
|
-
const element = field._f.ref;
|
|
34
|
-
if (element) {
|
|
35
|
-
elementMap.set(fullFieldName, element);
|
|
36
|
-
}
|
|
37
|
-
} else if (isFieldRefs(field)) {
|
|
38
|
-
const keys = Object.keys(field);
|
|
39
|
-
const numericKeys = keys.filter((key) => /^\d+$/.test(key));
|
|
40
|
-
const hasNumericKeys = numericKeys.length > 0;
|
|
41
|
-
if (hasNumericKeys) {
|
|
42
|
-
numericKeys.forEach((index) => {
|
|
43
|
-
const arrayItem = field[index];
|
|
44
|
-
if (arrayItem && isFieldRefs(arrayItem)) {
|
|
45
|
-
const nestedEntries = extractFieldEntries(
|
|
46
|
-
arrayItem,
|
|
47
|
-
`${fullFieldName}.${index}`
|
|
48
|
-
);
|
|
49
|
-
nestedEntries.forEach((element, fieldName2) => {
|
|
50
|
-
elementMap.set(fieldName2, element);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
} else {
|
|
55
|
-
const nestedEntries = extractFieldEntries(field, fullFieldName);
|
|
56
|
-
nestedEntries.forEach((element, fieldName2) => {
|
|
57
|
-
elementMap.set(fieldName2, element);
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
return elementMap;
|
|
63
|
-
}
|
|
64
|
-
const isField = (fieldRef) => Boolean(
|
|
65
|
-
fieldRef && typeof fieldRef === "object" && "_f" in fieldRef && fieldRef._f && "ref" in fieldRef._f
|
|
66
|
-
);
|
|
67
|
-
const isFieldRefs = (fieldRef) => Boolean(fieldRef && typeof fieldRef === "object" && !isField(fieldRef));
|
|
68
|
-
function sortElementsByPosition(elements) {
|
|
69
|
-
const sortedEntries = Array.from(elements.entries()).sort(([, a], [, b]) => {
|
|
70
|
-
if (isActualHTMLElement(a) && isActualHTMLElement(b)) {
|
|
71
|
-
const aPosition = a.compareDocumentPosition(b);
|
|
72
|
-
if (aPosition & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
|
|
73
|
-
if (aPosition & Node.DOCUMENT_POSITION_PRECEDING) return 1;
|
|
74
|
-
}
|
|
75
|
-
return 0;
|
|
76
|
-
});
|
|
77
|
-
return new Map(sortedEntries);
|
|
78
|
-
}
|
|
79
|
-
const isActualHTMLElement = (ref) => ref instanceof HTMLElement && typeof ref.focus === "function";
|
|
80
|
-
function mapElementsToFields(elements) {
|
|
81
|
-
const fields = {};
|
|
82
|
-
elements.forEach((element, fieldName) => {
|
|
83
|
-
fields[fieldName] = {
|
|
84
|
-
_f: {
|
|
85
|
-
ref: element,
|
|
86
|
-
name: fieldName
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
});
|
|
90
|
-
return fields;
|
|
91
|
-
}
|
|
92
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
93
|
-
0 && (module.exports = {
|
|
94
|
-
extractFieldEntries,
|
|
95
|
-
mapElementsToFields,
|
|
96
|
-
sortElementsByPosition
|
|
97
|
-
});
|
|
98
|
-
//# sourceMappingURL=utils.js.map
|
package/cjs/hooks/utils.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/utils.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Field, FieldRefs, Ref } from 'react-hook-form';\n\n/**\n * Recursively extracts field entries from nested form field structure.\n * Handles both regular nested objects and array-like structures.\n */\nexport function extractFieldEntries(\n fields: FieldRefs,\n prefix = ''\n): Map<string, Ref> {\n const elementMap = new Map<string, Ref>();\n\n const fieldEntries = Object.entries(fields);\n if (fieldEntries.length === 0) return elementMap;\n\n Object.entries(fields).forEach(([fieldName, field]) => {\n if (!field) return;\n const fullFieldName = prefix ? `${prefix}.${fieldName}` : fieldName;\n\n // Handle direct field with ref\n if (isField(field)) {\n const element = field._f.ref;\n if (element) {\n elementMap.set(fullFieldName, element);\n }\n }\n\n // Handle array fields (numeric keys indicate array indices)\n else if (isFieldRefs(field)) {\n // Check if any keys are numeric (indicating an array structure)\n // Filter out non-numeric keys like '_f' which contains field metadata\n const keys = Object.keys(field);\n const numericKeys = keys.filter((key) => /^\\d+$/.test(key));\n const hasNumericKeys = numericKeys.length > 0;\n\n if (hasNumericKeys) {\n // Process only the numeric array indices, ignore metadata keys like '_f'\n numericKeys.forEach((index) => {\n const arrayItem = field[index];\n if (arrayItem && isFieldRefs(arrayItem)) {\n const nestedEntries = extractFieldEntries(\n arrayItem,\n `${fullFieldName}.${index}`\n );\n // Merge nested entries into main map\n nestedEntries.forEach((element, fieldName) => {\n elementMap.set(fieldName, element);\n });\n }\n });\n } else {\n // Handle regular nested objects\n const nestedEntries = extractFieldEntries(field, fullFieldName);\n // Merge nested entries into main map\n nestedEntries.forEach((element, fieldName) => {\n elementMap.set(fieldName, element);\n });\n }\n }\n });\n\n return elementMap;\n}\n\n/** Type guard to check if a ref is a Field object */\nconst isField = (fieldRef: FieldRefs[keyof FieldRefs]): fieldRef is Field =>\n Boolean(\n fieldRef &&\n typeof fieldRef === 'object' &&\n '_f' in fieldRef &&\n fieldRef._f &&\n 'ref' in fieldRef._f\n );\n\n/** Type guard to check if a ref is a FieldRefs object (nested fields) */\nconst isFieldRefs = (\n fieldRef: FieldRefs[keyof FieldRefs]\n): fieldRef is FieldRefs =>\n Boolean(fieldRef && typeof fieldRef === 'object' && !isField(fieldRef));\n\n/**\n * Sorts a map of HTML elements by their position in the DOM.\n * Elements appearing earlier in the document order come first.\n */\nexport function sortElementsByPosition(\n elements: Map<string, Ref>\n): Map<string, Ref> {\n const sortedEntries = Array.from(elements.entries()).sort(([, a], [, b]) => {\n if (isActualHTMLElement(a) && isActualHTMLElement(b)) {\n const aPosition = a.compareDocumentPosition(b);\n if (aPosition & Node.DOCUMENT_POSITION_FOLLOWING) return -1;\n if (aPosition & Node.DOCUMENT_POSITION_PRECEDING) return 1;\n }\n return 0; // keep original order\n });\n return new Map(sortedEntries);\n}\n\n/** Type guard to check if a ref is an actual HTML element */\nconst isActualHTMLElement = (ref: Ref): ref is Ref & HTMLElement =>\n ref instanceof HTMLElement && typeof ref.focus === 'function';\n\n/**\n * Maps a collection of HTML elements to a FieldRefs structure.\n *\n * It's not a direct conversion, but rather a way to create a simple FieldRefs\n * structure that can be used with React Hook Form.\n */\nexport function mapElementsToFields(\n elements: Map<string, HTMLElement>\n): Record<string, Field> {\n const fields = {};\n elements.forEach((element, fieldName) => {\n fields[fieldName] = {\n _f: {\n ref: element,\n name: fieldName,\n },\n };\n });\n return fields;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,SAAS,oBACd,QACA,SAAS,IACS;AAClB,QAAM,aAAa,oBAAI,IAAiB;AAExC,QAAM,eAAe,OAAO,QAAQ,MAAM;AAC1C,MAAI,aAAa,WAAW,EAAG,QAAO;AAEtC,SAAO,QAAQ,MAAM,EAAE,QAAQ,CAAC,CAAC,WAAW,KAAK,MAAM;AACrD,QAAI,CAAC,MAAO;AACZ,UAAM,gBAAgB,SAAS,GAAG,MAAM,IAAI,SAAS,KAAK;AAG1D,QAAI,QAAQ,KAAK,GAAG;AAClB,YAAM,UAAU,MAAM,GAAG;AACzB,UAAI,SAAS;AACX,mBAAW,IAAI,eAAe,OAAO;AAAA,MACvC;AAAA,IACF,WAGS,YAAY,KAAK,GAAG;AAG3B,YAAM,OAAO,OAAO,KAAK,KAAK;AAC9B,YAAM,cAAc,KAAK,OAAO,CAAC,QAAQ,QAAQ,KAAK,GAAG,CAAC;AAC1D,YAAM,iBAAiB,YAAY,SAAS;AAE5C,UAAI,gBAAgB;AAElB,oBAAY,QAAQ,CAAC,UAAU;AAC7B,gBAAM,YAAY,MAAM,KAAK;AAC7B,cAAI,aAAa,YAAY,SAAS,GAAG;AACvC,kBAAM,gBAAgB;AAAA,cACpB;AAAA,cACA,GAAG,aAAa,IAAI,KAAK;AAAA,YAC3B;AAEA,0BAAc,QAAQ,CAAC,SAASA,eAAc;AAC5C,yBAAW,IAAIA,YAAW,OAAO;AAAA,YACnC,CAAC;AAAA,UACH;AAAA,QACF,CAAC;AAAA,MACH,OAAO;AAEL,cAAM,gBAAgB,oBAAoB,OAAO,aAAa;AAE9D,sBAAc,QAAQ,CAAC,SAASA,eAAc;AAC5C,qBAAW,IAAIA,YAAW,OAAO;AAAA,QACnC,CAAC;AAAA,MACH;AAAA,IACF;AAAA,EACF,CAAC;AAED,SAAO;AACT;AAGA,MAAM,UAAU,CAAC,aACf;AAAA,EACE,YACE,OAAO,aAAa,YACpB,QAAQ,YACR,SAAS,MACT,SAAS,SAAS;AACtB;AAGF,MAAM,cAAc,CAClB,aAEA,QAAQ,YAAY,OAAO,aAAa,YAAY,CAAC,QAAQ,QAAQ,CAAC;AAMjE,SAAS,uBACd,UACkB;AAClB,QAAM,gBAAgB,MAAM,KAAK,SAAS,QAAQ,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM;AAC1E,QAAI,oBAAoB,CAAC,KAAK,oBAAoB,CAAC,GAAG;AACpD,YAAM,YAAY,EAAE,wBAAwB,CAAC;AAC7C,UAAI,YAAY,KAAK,4BAA6B,QAAO;AACzD,UAAI,YAAY,KAAK,4BAA6B,QAAO;AAAA,IAC3D;AACA,WAAO;AAAA,EACT,CAAC;AACD,SAAO,IAAI,IAAI,aAAa;AAC9B;AAGA,MAAM,sBAAsB,CAAC,QAC3B,eAAe,eAAe,OAAO,IAAI,UAAU;AAQ9C,SAAS,oBACd,UACuB;AACvB,QAAM,SAAS,CAAC;AAChB,WAAS,QAAQ,CAAC,SAAS,cAAc;AACvC,WAAO,SAAS,IAAI;AAAA,MAClB,IAAI;AAAA,QACF,KAAK;AAAA,QACL,MAAM;AAAA,MACR;AAAA,IACF;AAAA,EACF,CAAC;AACD,SAAO;AACT;",
|
|
6
|
-
"names": ["fieldName"]
|
|
7
|
-
}
|
package/cjs/index.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var src_exports = {};
|
|
30
|
-
__export(src_exports, {
|
|
31
|
-
Field: () => import_Field.default,
|
|
32
|
-
Fieldset: () => import_Fieldset.default,
|
|
33
|
-
default: () => src_default
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(src_exports);
|
|
36
|
-
var import_Field = __toESM(require("@digigov/form/Field"));
|
|
37
|
-
var import_Fieldset = __toESM(require("@digigov/form/Fieldset"));
|
|
38
|
-
__reExport(src_exports, require("@digigov/form/inputs/Label"), module.exports);
|
|
39
|
-
var import_FormBuilder = __toESM(require("@digigov/form/FormBuilder"));
|
|
40
|
-
__reExport(src_exports, require("@digigov/form/types"), module.exports);
|
|
41
|
-
var src_default = import_FormBuilder.default;
|
|
42
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
-
0 && (module.exports = {
|
|
44
|
-
Field,
|
|
45
|
-
Fieldset,
|
|
46
|
-
...require("@digigov/form/inputs/Label"),
|
|
47
|
-
...require("@digigov/form/types")
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { default as Field } from '@digigov/form/Field';\nexport { default as Fieldset } from '@digigov/form/Fieldset';\nexport * from '@digigov/form/inputs/Label';\nimport FormBuilder from '@digigov/form/FormBuilder';\nexport * from '@digigov/form/types';\nexport default FormBuilder;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAiC;AACjC,sBAAoC;AACpC,wBAAc,uCAFd;AAGA,yBAAwB;AACxB,wBAAc,gCAJd;AAKA,IAAO,cAAQ,mBAAAA;",
|
|
6
|
-
"names": ["FormBuilder"]
|
|
7
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var AutoCompleteInput_exports = {};
|
|
29
|
-
__export(AutoCompleteInput_exports, {
|
|
30
|
-
AutoCompleteInput: () => AutoCompleteInput,
|
|
31
|
-
default: () => AutoCompleteInput_default
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(AutoCompleteInput_exports);
|
|
34
|
-
var import_react = __toESM(require("react"));
|
|
35
|
-
var import_AutoComplete = require("@digigov/ui/form/AutoComplete");
|
|
36
|
-
var import_Hint = require("@digigov/ui/typography/Hint");
|
|
37
|
-
var import_Base = require("@digigov/ui/utils/Base");
|
|
38
|
-
const AutoCompleteInput = ({
|
|
39
|
-
name,
|
|
40
|
-
type,
|
|
41
|
-
extra: { options },
|
|
42
|
-
onChange,
|
|
43
|
-
value,
|
|
44
|
-
...props
|
|
45
|
-
}) => {
|
|
46
|
-
const suggest = (0, import_react.useCallback)(
|
|
47
|
-
function suggest2(query, syncResults) {
|
|
48
|
-
syncResults(
|
|
49
|
-
query ? options.filter(function(option) {
|
|
50
|
-
return `${option.value} ${option.label?.primary || ""} ${option.label?.secondary || ""}`.toLowerCase().indexOf(query.toLowerCase()) !== -1;
|
|
51
|
-
}) : options
|
|
52
|
-
);
|
|
53
|
-
},
|
|
54
|
-
[options]
|
|
55
|
-
);
|
|
56
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
57
|
-
import_AutoComplete.AutoComplete,
|
|
58
|
-
{
|
|
59
|
-
multiple: type === "choice:multiple" ? true : false,
|
|
60
|
-
source: suggest,
|
|
61
|
-
onConfirm: (value2) => {
|
|
62
|
-
if (Array.isArray(value2)) {
|
|
63
|
-
const selectedValues = value2.map((item) => item.value);
|
|
64
|
-
if (selectedValues.length > 0) onChange(selectedValues);
|
|
65
|
-
else onChange(void 0);
|
|
66
|
-
} else {
|
|
67
|
-
onChange(value2.value);
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
templates: {
|
|
71
|
-
suggestion({ label, value: value2 }) {
|
|
72
|
-
return /* @__PURE__ */ import_react.default.createElement(import_Base.Base, { as: "div" }, label && label.primary && label.primary || value2, label && label.secondary && /* @__PURE__ */ import_react.default.createElement(import_Hint.Hint, null, label.secondary));
|
|
73
|
-
},
|
|
74
|
-
inputValue: (option) => {
|
|
75
|
-
if (!option) {
|
|
76
|
-
return "";
|
|
77
|
-
}
|
|
78
|
-
return option.label.primary || option.value;
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
...{
|
|
82
|
-
...props,
|
|
83
|
-
reset: void 0,
|
|
84
|
-
required: void 0,
|
|
85
|
-
Field: void 0
|
|
86
|
-
},
|
|
87
|
-
name,
|
|
88
|
-
id: `${name}-id`,
|
|
89
|
-
defaultValue: value
|
|
90
|
-
}
|
|
91
|
-
);
|
|
92
|
-
};
|
|
93
|
-
var AutoCompleteInput_default = AutoCompleteInput;
|
|
94
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
95
|
-
0 && (module.exports = {
|
|
96
|
-
AutoCompleteInput
|
|
97
|
-
});
|
|
98
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/inputs/AutoCompleteInput/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback } from 'react';\nimport type { ControlledFieldProps } from '@digigov/form/Field/types';\nimport type { FieldOptionProps } from '@digigov/form/inputs/Label';\nimport type { AutoCompleteProps as UIAutoCompleteProps } from '@digigov/ui/form/AutoComplete';\nimport { AutoComplete } from '@digigov/ui/form/AutoComplete';\nimport { Hint } from '@digigov/ui/typography/Hint';\nimport { Base } from '@digigov/ui/utils/Base';\nexport interface AutoCompleteInputExtra\n extends Omit<\n UIAutoCompleteProps,\n | 'source'\n | 'id'\n | 'templates'\n | 'defaultValue'\n | 'onConfirm'\n | 'dropdownArrow'\n > {\n options: FieldOptionProps[];\n}\n\nexport interface AutoCompleteInputProps\n extends Omit<ControlledFieldProps, 'value' | 'onChange' | 'extra'> {\n extra: AutoCompleteInputExtra;\n value: string;\n onChange: (v: string | string[] | undefined) => void;\n}\n\nexport const AutoCompleteInput: React.FC<AutoCompleteInputProps> = ({\n name,\n type,\n extra: { options },\n onChange,\n value,\n ...props\n}) => {\n const suggest = useCallback(\n function suggest(\n query: string,\n syncResults: (options: any[]) => void\n ): void {\n syncResults(\n query\n ? options.filter(function (option) {\n return (\n `${option.value} ${option.label?.primary || ''} ${\n option.label?.secondary || ''\n }`\n .toLowerCase()\n .indexOf(query.toLowerCase()) !== -1\n );\n })\n : options\n );\n },\n [options]\n );\n\n return (\n <AutoComplete\n multiple={type === 'choice:multiple' ? true : false}\n source={suggest}\n onConfirm={(value) => {\n if (Array.isArray(value)) {\n const selectedValues = value.map((item) => item.value);\n if (selectedValues.length > 0) onChange(selectedValues);\n else onChange(undefined);\n } else {\n onChange(value.value);\n }\n }}\n templates={{\n suggestion({ label, value }) {\n return (\n <Base as=\"div\">\n {(label && label.primary && label.primary) || value}\n {label && label.secondary && <Hint>{label.secondary}</Hint>}\n </Base>\n );\n },\n inputValue: (option) => {\n if (!option) {\n return '';\n }\n return option.label.primary || option.value;\n },\n }}\n {...{\n ...props,\n reset: undefined,\n required: undefined,\n Field: undefined,\n }}\n name={name}\n id={`${name}-id`}\n defaultValue={value}\n />\n );\n};\n\nexport default AutoCompleteInput;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAmC;AAInC,0BAA6B;AAC7B,kBAAqB;AACrB,kBAAqB;AAqBd,MAAM,oBAAsD,CAAC;AAAA,EAClE;AAAA,EACA;AAAA,EACA,OAAO,EAAE,QAAQ;AAAA,EACjB;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,cAAU;AAAA,IACd,SAASA,SACP,OACA,aACM;AACN;AAAA,QACE,QACI,QAAQ,OAAO,SAAU,QAAQ;AAC/B,iBACE,GAAG,OAAO,KAAK,IAAI,OAAO,OAAO,WAAW,EAAE,IAC5C,OAAO,OAAO,aAAa,EAC7B,GACG,YAAY,EACZ,QAAQ,MAAM,YAAY,CAAC,MAAM;AAAA,QAExC,CAAC,IACD;AAAA,MACN;AAAA,IACF;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,SACE,6BAAAC,QAAA;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,SAAS,oBAAoB,OAAO;AAAA,MAC9C,QAAQ;AAAA,MACR,WAAW,CAACC,WAAU;AACpB,YAAI,MAAM,QAAQA,MAAK,GAAG;AACxB,gBAAM,iBAAiBA,OAAM,IAAI,CAAC,SAAS,KAAK,KAAK;AACrD,cAAI,eAAe,SAAS,EAAG,UAAS,cAAc;AAAA,cACjD,UAAS,MAAS;AAAA,QACzB,OAAO;AACL,mBAASA,OAAM,KAAK;AAAA,QACtB;AAAA,MACF;AAAA,MACA,WAAW;AAAA,QACT,WAAW,EAAE,OAAO,OAAAA,OAAM,GAAG;AAC3B,iBACE,6BAAAD,QAAA,cAAC,oBAAK,IAAG,SACL,SAAS,MAAM,WAAW,MAAM,WAAYC,QAC7C,SAAS,MAAM,aAAa,6BAAAD,QAAA,cAAC,wBAAM,MAAM,SAAU,CACtD;AAAA,QAEJ;AAAA,QACA,YAAY,CAAC,WAAW;AACtB,cAAI,CAAC,QAAQ;AACX,mBAAO;AAAA,UACT;AACA,iBAAO,OAAO,MAAM,WAAW,OAAO;AAAA,QACxC;AAAA,MACF;AAAA,MACC,GAAG;AAAA,QACF,GAAG;AAAA,QACH,OAAO;AAAA,QACP,UAAU;AAAA,QACV,OAAO;AAAA,MACT;AAAA,MACA;AAAA,MACA,IAAI,GAAG,IAAI;AAAA,MACX,cAAc;AAAA;AAAA,EAChB;AAEJ;AAEA,IAAO,4BAAQ;",
|
|
6
|
-
"names": ["suggest", "React", "value"]
|
|
7
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var Checkboxes_exports = {};
|
|
29
|
-
__export(Checkboxes_exports, {
|
|
30
|
-
Checkboxes: () => Checkboxes,
|
|
31
|
-
default: () => Checkboxes_default
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(Checkboxes_exports);
|
|
34
|
-
var import_react = __toESM(require("react"));
|
|
35
|
-
var import_utils = require("@digigov/form/utils");
|
|
36
|
-
var import_Checkbox = require("@digigov/ui/form/Checkbox");
|
|
37
|
-
var import_i18n = require("@digigov/ui/i18n");
|
|
38
|
-
var import_Hint = require("@digigov/ui/typography/Hint");
|
|
39
|
-
const Checkboxes = import_react.default.forwardRef(
|
|
40
|
-
({
|
|
41
|
-
name,
|
|
42
|
-
onChange,
|
|
43
|
-
value,
|
|
44
|
-
extra: { options, className },
|
|
45
|
-
disabled,
|
|
46
|
-
Field,
|
|
47
|
-
...props
|
|
48
|
-
}, ref) => {
|
|
49
|
-
if (!value) value = [];
|
|
50
|
-
const handleChange = (optionValue, idx, show) => (evt) => {
|
|
51
|
-
let newValue = [];
|
|
52
|
-
if (evt.currentTarget.checked) {
|
|
53
|
-
newValue = value.concat([optionValue]);
|
|
54
|
-
} else {
|
|
55
|
-
newValue = value.filter((val) => val !== optionValue);
|
|
56
|
-
}
|
|
57
|
-
if (show && show.length > 0) {
|
|
58
|
-
setChecked(
|
|
59
|
-
(items) => items.map((item, index) => index === idx ? !item : item)
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
if (newValue.length === 0) newValue = void 0;
|
|
63
|
-
onChange(newValue);
|
|
64
|
-
};
|
|
65
|
-
const { t } = (0, import_i18n.useTranslation)();
|
|
66
|
-
const [checked, setChecked] = (0, import_react.useState)(
|
|
67
|
-
Array(options.length).fill(false)
|
|
68
|
-
);
|
|
69
|
-
return /* @__PURE__ */ import_react.default.createElement(import_Checkbox.Checkbox, { className }, options.map(
|
|
70
|
-
({
|
|
71
|
-
label,
|
|
72
|
-
value: v,
|
|
73
|
-
show,
|
|
74
|
-
disabled: optionDisabled,
|
|
75
|
-
selected,
|
|
76
|
-
...option
|
|
77
|
-
}, index) => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, { key: index }, /* @__PURE__ */ import_react.default.createElement(
|
|
78
|
-
import_Checkbox.CheckboxItem,
|
|
79
|
-
{
|
|
80
|
-
ref: index === 0 ? ref : void 0,
|
|
81
|
-
key: `${name}.${index}`,
|
|
82
|
-
name: `${name}.${v}`,
|
|
83
|
-
id: `${name}.${v}`,
|
|
84
|
-
value: v,
|
|
85
|
-
disabled: disabled || optionDisabled,
|
|
86
|
-
checked: value?.includes(v),
|
|
87
|
-
onChange: handleChange(v, index, show),
|
|
88
|
-
...option,
|
|
89
|
-
...{
|
|
90
|
-
...(0, import_utils.omit)(props, ["resetField"]),
|
|
91
|
-
reset: void 0,
|
|
92
|
-
defaultValue: void 0,
|
|
93
|
-
error: void 0,
|
|
94
|
-
onBlur: void 0,
|
|
95
|
-
required: void 0,
|
|
96
|
-
"aria-describedby": void 0,
|
|
97
|
-
type: "checkbox"
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
label && label.primary && t(label.primary) || value,
|
|
101
|
-
label && label.secondary && /* @__PURE__ */ import_react.default.createElement(import_Hint.Hint, null, t(label.secondary))
|
|
102
|
-
), !!checked[index] && show && Field && /* @__PURE__ */ import_react.default.createElement(import_Checkbox.CheckboxConditional, null, show.map((fieldName) => /* @__PURE__ */ import_react.default.createElement(Field, { name: fieldName, key: fieldName }))), selected && selected())
|
|
103
|
-
));
|
|
104
|
-
}
|
|
105
|
-
);
|
|
106
|
-
Checkboxes.displayName = "Checkboxes";
|
|
107
|
-
var Checkboxes_default = Checkboxes;
|
|
108
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
109
|
-
0 && (module.exports = {
|
|
110
|
-
Checkboxes
|
|
111
|
-
});
|
|
112
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/inputs/Checkboxes/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useState } from 'react';\nimport type { UseFormReturn } from 'react-hook-form';\nimport type { ControlledFieldProps } from '@digigov/form/Field/types';\nimport type { FieldOptionProps } from '@digigov/form/inputs/Label';\nimport { omit } from '@digigov/form/utils';\nimport {\n Checkbox,\n CheckboxItem,\n CheckboxConditional,\n} from '@digigov/ui/form/Checkbox';\nimport { useTranslation } from '@digigov/ui/i18n';\nimport { Hint } from '@digigov/ui/typography/Hint';\n\nexport interface CheckboxesProps\n extends Omit<ControlledFieldProps, 'extra' | 'value'> {\n value?: string[];\n extra: {\n className?: string;\n options: FieldOptionProps[];\n };\n fieldComponent: React.FC<Omit<ControlledFieldProps, 'value' | 'onChange'>>;\n resetField: UseFormReturn['resetField'];\n}\n\nexport const Checkboxes = React.forwardRef<HTMLInputElement, CheckboxesProps>(\n (\n {\n name,\n onChange,\n value,\n extra: { options, className },\n disabled,\n Field,\n ...props\n },\n ref\n ) => {\n if (!value) value = [];\n const handleChange =\n (optionValue, idx, show) =>\n (evt): void => {\n let newValue: any = [];\n if (evt.currentTarget.checked) {\n newValue = value.concat([optionValue]);\n } else {\n newValue = value.filter((val) => val !== optionValue);\n }\n if (show && show.length > 0) {\n setChecked((items) =>\n items.map((item, index) => (index === idx ? !item : item))\n );\n }\n\n // reset value to undefined instead of an empty array\n // so the error state mechanism can throw validation errors\n if (newValue.length === 0) newValue = undefined;\n onChange(newValue);\n };\n const { t } = useTranslation();\n const [checked, setChecked] = useState(\n Array<boolean>(options.length).fill(false)\n );\n return (\n <Checkbox className={className}>\n {options.map(\n (\n {\n label,\n value: v,\n show,\n disabled: optionDisabled,\n selected,\n ...option\n },\n index\n ) => (\n <React.Fragment key={index}>\n <CheckboxItem\n ref={index === 0 ? ref : undefined}\n key={`${name}.${index}`}\n name={`${name}.${v}`}\n id={`${name}.${v}`}\n value={v}\n disabled={disabled || optionDisabled}\n checked={value?.includes(v)}\n onChange={handleChange(v, index, show)}\n {...option}\n {...{\n ...omit(props, ['resetField']),\n reset: undefined,\n defaultValue: undefined,\n error: undefined,\n onBlur: undefined,\n required: undefined,\n 'aria-describedby': undefined,\n type: 'checkbox',\n }}\n >\n {(label && label.primary && t(label.primary)) || value}\n {label && label.secondary && <Hint>{t(label.secondary)}</Hint>}\n </CheckboxItem>\n\n {!!checked[index] && show && Field && (\n <CheckboxConditional>\n {show.map((fieldName) => (\n <Field name={fieldName} key={fieldName} />\n ))}\n </CheckboxConditional>\n )}\n {selected && selected()}\n </React.Fragment>\n )\n )}\n </Checkbox>\n );\n }\n);\n\nCheckboxes.displayName = 'Checkboxes';\n\nexport default Checkboxes;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAgC;AAIhC,mBAAqB;AACrB,sBAIO;AACP,kBAA+B;AAC/B,kBAAqB;AAad,MAAM,aAAa,aAAAA,QAAM;AAAA,EAC9B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,SAAS,UAAU;AAAA,IAC5B;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,QAAI,CAAC,MAAO,SAAQ,CAAC;AACrB,UAAM,eACJ,CAAC,aAAa,KAAK,SACnB,CAAC,QAAc;AACb,UAAI,WAAgB,CAAC;AACrB,UAAI,IAAI,cAAc,SAAS;AAC7B,mBAAW,MAAM,OAAO,CAAC,WAAW,CAAC;AAAA,MACvC,OAAO;AACL,mBAAW,MAAM,OAAO,CAAC,QAAQ,QAAQ,WAAW;AAAA,MACtD;AACA,UAAI,QAAQ,KAAK,SAAS,GAAG;AAC3B;AAAA,UAAW,CAAC,UACV,MAAM,IAAI,CAAC,MAAM,UAAW,UAAU,MAAM,CAAC,OAAO,IAAK;AAAA,QAC3D;AAAA,MACF;AAIA,UAAI,SAAS,WAAW,EAAG,YAAW;AACtC,eAAS,QAAQ;AAAA,IACnB;AACF,UAAM,EAAE,EAAE,QAAI,4BAAe;AAC7B,UAAM,CAAC,SAAS,UAAU,QAAI;AAAA,MAC5B,MAAe,QAAQ,MAAM,EAAE,KAAK,KAAK;AAAA,IAC3C;AACA,WACE,6BAAAA,QAAA,cAAC,4BAAS,aACP,QAAQ;AAAA,MACP,CACE;AAAA,QACE;AAAA,QACA,OAAO;AAAA,QACP;AAAA,QACA,UAAU;AAAA,QACV;AAAA,QACA,GAAG;AAAA,MACL,GACA,UAEA,6BAAAA,QAAA,cAAC,aAAAA,QAAM,UAAN,EAAe,KAAK,SACnB,6BAAAA,QAAA;AAAA,QAAC;AAAA;AAAA,UACC,KAAK,UAAU,IAAI,MAAM;AAAA,UACzB,KAAK,GAAG,IAAI,IAAI,KAAK;AAAA,UACrB,MAAM,GAAG,IAAI,IAAI,CAAC;AAAA,UAClB,IAAI,GAAG,IAAI,IAAI,CAAC;AAAA,UAChB,OAAO;AAAA,UACP,UAAU,YAAY;AAAA,UACtB,SAAS,OAAO,SAAS,CAAC;AAAA,UAC1B,UAAU,aAAa,GAAG,OAAO,IAAI;AAAA,UACpC,GAAG;AAAA,UACH,GAAG;AAAA,YACF,OAAG,mBAAK,OAAO,CAAC,YAAY,CAAC;AAAA,YAC7B,OAAO;AAAA,YACP,cAAc;AAAA,YACd,OAAO;AAAA,YACP,QAAQ;AAAA,YACR,UAAU;AAAA,YACV,oBAAoB;AAAA,YACpB,MAAM;AAAA,UACR;AAAA;AAAA,QAEE,SAAS,MAAM,WAAW,EAAE,MAAM,OAAO,KAAM;AAAA,QAChD,SAAS,MAAM,aAAa,6BAAAA,QAAA,cAAC,wBAAM,EAAE,MAAM,SAAS,CAAE;AAAA,MACzD,GAEC,CAAC,CAAC,QAAQ,KAAK,KAAK,QAAQ,SAC3B,6BAAAA,QAAA,cAAC,2CACE,KAAK,IAAI,CAAC,cACT,6BAAAA,QAAA,cAAC,SAAM,MAAM,WAAW,KAAK,WAAW,CACzC,CACH,GAED,YAAY,SAAS,CACxB;AAAA,IAEJ,CACF;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;AAEzB,IAAO,qBAAQ;",
|
|
6
|
-
"names": ["React"]
|
|
7
|
-
}
|