@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,36 +0,0 @@
|
|
|
1
|
-
function digitSum(number) {
|
|
2
|
-
const sum = number > 9 ? 1 : 0;
|
|
3
|
-
return sum + number % 10;
|
|
4
|
-
}
|
|
5
|
-
function validateAMKA(amka) {
|
|
6
|
-
amka = String(amka);
|
|
7
|
-
const checkDigitIndex = amka.length - 1;
|
|
8
|
-
let sum = 0;
|
|
9
|
-
amka.substring(0, checkDigitIndex).split("").reverse().forEach(function(value, index) {
|
|
10
|
-
const weight = (index + 1) % 2 + 1;
|
|
11
|
-
sum += digitSum(parseInt(value, 10) * weight);
|
|
12
|
-
});
|
|
13
|
-
const sumMod10 = sum % 10;
|
|
14
|
-
if (sumMod10 === 0) {
|
|
15
|
-
return amka.substring(checkDigitIndex) === "0";
|
|
16
|
-
} else {
|
|
17
|
-
return amka.substring(checkDigitIndex) === 10 - sumMod10 + "";
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
const AMKA_VALIDATOR = {
|
|
21
|
-
name: "amka-validator",
|
|
22
|
-
message: "form.error.amka",
|
|
23
|
-
test: (value) => {
|
|
24
|
-
if (!value) return true;
|
|
25
|
-
const AMKA_REGEX = /^[0-9]{11}$/;
|
|
26
|
-
if (!AMKA_REGEX.test(value) || value === "00000000000") {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
return validateAMKA(value);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
export {
|
|
33
|
-
AMKA_VALIDATOR,
|
|
34
|
-
validateAMKA
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=amka.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/validators/utils/amka.ts"],
|
|
4
|
-
"sourcesContent": ["function digitSum(number) {\n const sum = number > 9 ? 1 : 0;\n return sum + (number % 10);\n}\n\nexport function validateAMKA(amka: string): boolean {\n // Validate that the last digit is the correct check digit (created using the\n // Luhn algorithm https://en.wikipedia.org/wiki/Luhn_algorithm).\n amka = String(amka);\n const checkDigitIndex = amka.length - 1;\n let sum = 0;\n amka\n .substring(0, checkDigitIndex)\n .split('')\n .reverse()\n .forEach(function (value, index) {\n const weight = ((index + 1) % 2) + 1;\n sum += digitSum(parseInt(value, 10) * weight);\n });\n const sumMod10 = sum % 10;\n if (sumMod10 === 0) {\n return amka.substring(checkDigitIndex) === '0';\n } else {\n return amka.substring(checkDigitIndex) === 10 - sumMod10 + '';\n }\n}\n\nexport const AMKA_VALIDATOR = {\n name: 'amka-validator',\n message: 'form.error.amka',\n test: (value): boolean => {\n if (!value) return true;\n const AMKA_REGEX = /^[0-9]{11}$/;\n if (!AMKA_REGEX.test(value) || value === '00000000000') {\n return false;\n }\n return validateAMKA(value);\n },\n};\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,SAAS,QAAQ;AACxB,QAAM,MAAM,SAAS,IAAI,IAAI;AAC7B,SAAO,MAAO,SAAS;AACzB;AAEO,SAAS,aAAa,MAAuB;AAGlD,SAAO,OAAO,IAAI;AAClB,QAAM,kBAAkB,KAAK,SAAS;AACtC,MAAI,MAAM;AACV,OACG,UAAU,GAAG,eAAe,EAC5B,MAAM,EAAE,EACR,QAAQ,EACR,QAAQ,SAAU,OAAO,OAAO;AAC/B,UAAM,UAAW,QAAQ,KAAK,IAAK;AACnC,WAAO,SAAS,SAAS,OAAO,EAAE,IAAI,MAAM;AAAA,EAC9C,CAAC;AACH,QAAM,WAAW,MAAM;AACvB,MAAI,aAAa,GAAG;AAClB,WAAO,KAAK,UAAU,eAAe,MAAM;AAAA,EAC7C,OAAO;AACL,WAAO,KAAK,UAAU,eAAe,MAAM,KAAK,WAAW;AAAA,EAC7D;AACF;AAEO,MAAM,iBAAiB;AAAA,EAC5B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM,CAAC,UAAmB;AACxB,QAAI,CAAC,MAAO,QAAO;AACnB,UAAM,aAAa;AACnB,QAAI,CAAC,WAAW,KAAK,KAAK,KAAK,UAAU,eAAe;AACtD,aAAO;AAAA,IACT;AACA,WAAO,aAAa,KAAK;AAAA,EAC3B;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import dayjs from "dayjs";
|
|
2
|
-
import customParseFormat from "dayjs/plugin/customParseFormat";
|
|
3
|
-
dayjs.extend(customParseFormat);
|
|
4
|
-
const VALID_DATE_FORMATS = ["DD/MM/YYYY"];
|
|
5
|
-
const DATE_CACHE = {};
|
|
6
|
-
const onlyNumbersRegex = /^\d+$/;
|
|
7
|
-
const getDate = (v) => {
|
|
8
|
-
return DATE_CACHE[v] ? DATE_CACHE[v] : dayjs(v, VALID_DATE_FORMATS, true);
|
|
9
|
-
};
|
|
10
|
-
const getDaysInMonth = (month, year) => {
|
|
11
|
-
return dayjs(`${year}-${month}-01`).daysInMonth();
|
|
12
|
-
};
|
|
13
|
-
const checkPartialDate = (value) => {
|
|
14
|
-
const [day, month, year] = value.split("/");
|
|
15
|
-
if (day && !month && !year) {
|
|
16
|
-
return "form.error.date.invalid_month_year";
|
|
17
|
-
}
|
|
18
|
-
if (!day && month && !year) {
|
|
19
|
-
return "form.error.date.invalid_day_year";
|
|
20
|
-
}
|
|
21
|
-
if (!day && !month && year) {
|
|
22
|
-
return "form.error.date.invalid_day_month";
|
|
23
|
-
}
|
|
24
|
-
if (day && month && !year) {
|
|
25
|
-
return "form.error.date.invalid_year";
|
|
26
|
-
}
|
|
27
|
-
if (day && !month && year) {
|
|
28
|
-
return "form.error.date.invalid_month";
|
|
29
|
-
}
|
|
30
|
-
if (!day && month && year) {
|
|
31
|
-
return "form.error.date.invalid_day";
|
|
32
|
-
}
|
|
33
|
-
if (day && month) {
|
|
34
|
-
const dayNum = parseInt(day);
|
|
35
|
-
const monthNum = parseInt(month);
|
|
36
|
-
const validYear = onlyNumbersRegex.test(year) ? year : void 0;
|
|
37
|
-
if (!validYear || year.length < 4) {
|
|
38
|
-
return "form.error.date.invalid";
|
|
39
|
-
}
|
|
40
|
-
const yearNum = parseInt(validYear);
|
|
41
|
-
const maxDay = getDaysInMonth(monthNum, yearNum);
|
|
42
|
-
if (dayNum < 1 || dayNum > maxDay) {
|
|
43
|
-
return {
|
|
44
|
-
key: "form.error.date.invalid_day_range",
|
|
45
|
-
context: {
|
|
46
|
-
maxDay
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
if (monthNum < 1 || monthNum > 12) {
|
|
51
|
-
return "form.error.datetime.invalid_month_range";
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return "form.error.date.invalid";
|
|
55
|
-
};
|
|
56
|
-
const LATER_THAN_VALIDATOR = (field) => {
|
|
57
|
-
let minDate;
|
|
58
|
-
const params = field.extra || {};
|
|
59
|
-
if (params.min === "now") {
|
|
60
|
-
const today = /* @__PURE__ */ new Date();
|
|
61
|
-
minDate = new Date(today);
|
|
62
|
-
} else {
|
|
63
|
-
minDate = getDate(params.min).toDate();
|
|
64
|
-
}
|
|
65
|
-
const minPreviousDate = new Date(minDate);
|
|
66
|
-
minPreviousDate.setDate(minDate.getDate() - 1);
|
|
67
|
-
return {
|
|
68
|
-
name: "later-than",
|
|
69
|
-
message: {
|
|
70
|
-
key: "form.error.date.later_than",
|
|
71
|
-
context: {
|
|
72
|
-
minDate: minPreviousDate.toLocaleDateString()
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
test: function(value) {
|
|
76
|
-
if (!value) return true;
|
|
77
|
-
const date = getDate(value);
|
|
78
|
-
const isValid = +date.toDate() > +minDate;
|
|
79
|
-
return isValid;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
const EARLIER_THAN_VALIDATOR = (field) => {
|
|
84
|
-
let maxDate;
|
|
85
|
-
const params = field.extra || {};
|
|
86
|
-
if (params.max === "now") {
|
|
87
|
-
const today = /* @__PURE__ */ new Date();
|
|
88
|
-
maxDate = new Date(today);
|
|
89
|
-
} else {
|
|
90
|
-
maxDate = getDate(params.max).toDate();
|
|
91
|
-
}
|
|
92
|
-
const maxNextDate = new Date(maxDate);
|
|
93
|
-
maxNextDate.setDate(maxDate.getDate() + 1);
|
|
94
|
-
return {
|
|
95
|
-
name: "earlier-than",
|
|
96
|
-
message: {
|
|
97
|
-
key: "form.error.date.earlier_than",
|
|
98
|
-
context: {
|
|
99
|
-
maxDate: maxNextDate.toLocaleDateString()
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
test: function(value) {
|
|
103
|
-
if (!value) return true;
|
|
104
|
-
const date = getDate(value);
|
|
105
|
-
const isValid = +date.toDate() < +maxDate;
|
|
106
|
-
return isValid;
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
const DATE_VALIDATOR = {
|
|
111
|
-
name: "date-validator",
|
|
112
|
-
message: (v) => {
|
|
113
|
-
return checkPartialDate(v.value);
|
|
114
|
-
},
|
|
115
|
-
test: function(value) {
|
|
116
|
-
if (!value) return true;
|
|
117
|
-
const date = getDate(value);
|
|
118
|
-
return date.isValid();
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
export {
|
|
122
|
-
DATE_VALIDATOR,
|
|
123
|
-
EARLIER_THAN_VALIDATOR,
|
|
124
|
-
LATER_THAN_VALIDATOR
|
|
125
|
-
};
|
|
126
|
-
//# sourceMappingURL=date.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/validators/utils/date.ts"],
|
|
4
|
-
"sourcesContent": ["import dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport type { FieldSpec } from '@digigov/form/types';\nimport type { ValidatorSchema } from '@digigov/form/validators/types';\n\ndayjs.extend(customParseFormat);\n\nconst VALID_DATE_FORMATS = ['DD/MM/YYYY'];\nconst DATE_CACHE = {};\nconst onlyNumbersRegex = /^\\d+$/;\n\nconst getDate = (v: string) => {\n return DATE_CACHE[v] ? DATE_CACHE[v] : dayjs(v, VALID_DATE_FORMATS, true);\n};\n\nconst getDaysInMonth = (month: number, year: number): number => {\n return dayjs(`${year}-${month}-01`).daysInMonth(); // e.g. 29 for Feb 2024\n};\n\n// Function to check partial date completion\nconst checkPartialDate = (value: string) => {\n const [day, month, year] = value.split('/');\n if (day && !month && !year) {\n return 'form.error.date.invalid_month_year';\n }\n if (!day && month && !year) {\n return 'form.error.date.invalid_day_year';\n }\n if (!day && !month && year) {\n return 'form.error.date.invalid_day_month';\n }\n if (day && month && !year) {\n return 'form.error.date.invalid_year';\n }\n if (day && !month && year) {\n return 'form.error.date.invalid_month';\n }\n if (!day && month && year) {\n return 'form.error.date.invalid_day';\n }\n if (day && month) {\n const dayNum = parseInt(day);\n const monthNum = parseInt(month);\n const validYear = onlyNumbersRegex.test(year) ? year : undefined;\n if (!validYear || year.length < 4) {\n return 'form.error.date.invalid';\n }\n const yearNum = parseInt(validYear);\n const maxDay = getDaysInMonth(monthNum, yearNum);\n if (dayNum < 1 || dayNum > maxDay) {\n return {\n key: 'form.error.date.invalid_day_range',\n context: {\n maxDay: maxDay,\n },\n };\n }\n if (monthNum < 1 || monthNum > 12) {\n return 'form.error.datetime.invalid_month_range';\n }\n }\n return 'form.error.date.invalid';\n};\n\nexport const LATER_THAN_VALIDATOR = (field: FieldSpec): ValidatorSchema => {\n let minDate;\n const params = field.extra || {};\n if (params.min === 'now') {\n const today = new Date();\n minDate = new Date(today);\n } else {\n minDate = getDate(params.min).toDate();\n }\n const minPreviousDate = new Date(minDate);\n minPreviousDate.setDate(minDate.getDate() - 1);\n return {\n name: 'later-than',\n message: {\n key: 'form.error.date.later_than',\n context: {\n minDate: minPreviousDate.toLocaleDateString(),\n },\n },\n test: function (value: string) {\n if (!value) return true;\n const date = getDate(value);\n const isValid = +date.toDate() > +minDate;\n return isValid;\n },\n };\n};\n\nexport const EARLIER_THAN_VALIDATOR = (field: FieldSpec): ValidatorSchema => {\n let maxDate;\n const params = field.extra || {};\n if (params.max === 'now') {\n const today = new Date();\n maxDate = new Date(today);\n } else {\n maxDate = getDate(params.max).toDate();\n }\n const maxNextDate = new Date(maxDate);\n maxNextDate.setDate(maxDate.getDate() + 1);\n return {\n name: 'earlier-than',\n message: {\n key: 'form.error.date.earlier_than',\n context: {\n maxDate: maxNextDate.toLocaleDateString(),\n },\n },\n test: function (value: string) {\n if (!value) return true;\n const date = getDate(value);\n const isValid = +date.toDate() < +maxDate;\n return isValid;\n },\n };\n};\n\nexport const DATE_VALIDATOR = {\n name: 'date-validator',\n message: (v): string | object => {\n return checkPartialDate(v.value);\n },\n test: function (value: string) {\n if (!value) return true;\n const date = getDate(value);\n return date.isValid();\n },\n};\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,uBAAuB;AAI9B,MAAM,OAAO,iBAAiB;AAE9B,MAAM,qBAAqB,CAAC,YAAY;AACxC,MAAM,aAAa,CAAC;AACpB,MAAM,mBAAmB;AAEzB,MAAM,UAAU,CAAC,MAAc;AAC7B,SAAO,WAAW,CAAC,IAAI,WAAW,CAAC,IAAI,MAAM,GAAG,oBAAoB,IAAI;AAC1E;AAEA,MAAM,iBAAiB,CAAC,OAAe,SAAyB;AAC9D,SAAO,MAAM,GAAG,IAAI,IAAI,KAAK,KAAK,EAAE,YAAY;AAClD;AAGA,MAAM,mBAAmB,CAAC,UAAkB;AAC1C,QAAM,CAAC,KAAK,OAAO,IAAI,IAAI,MAAM,MAAM,GAAG;AAC1C,MAAI,OAAO,CAAC,SAAS,CAAC,MAAM;AAC1B,WAAO;AAAA,EACT;AACA,MAAI,CAAC,OAAO,SAAS,CA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
|
4
|
-
const VALID_DATETIME_FORMATS = ["DD/MM/YYYY HH:mm"];
|
|
5
|
-
const DATETIME_CACHE = {};
|
|
6
|
-
const onlyNumbersRegex = /^\d+$/;
|
|
7
|
-
const getDateTime = (v) => {
|
|
8
|
-
return DATETIME_CACHE[v] ? DATETIME_CACHE[v] : dayjs(v, VALID_DATETIME_FORMATS, true);
|
|
9
|
-
};
|
|
10
|
-
const getDaysInMonth = (month, year) => {
|
|
11
|
-
return dayjs(`${year}-${month}-01`).daysInMonth();
|
|
12
|
-
};
|
|
13
|
-
const checkPartialDateTime = (value) => {
|
|
14
|
-
const [datePart, timePart] = value.split(" ");
|
|
15
|
-
const [day, month, year] = datePart?.split("/") ?? [];
|
|
16
|
-
const [hours, minutes] = timePart?.split(":") ?? [];
|
|
17
|
-
const hasDay = Boolean(day);
|
|
18
|
-
const hasMonth = Boolean(month);
|
|
19
|
-
const hasYear = Boolean(year);
|
|
20
|
-
const hasHours = Boolean(hours);
|
|
21
|
-
const hasMinutes = Boolean(minutes);
|
|
22
|
-
if (hasDay && !hasMonth && !hasYear && !hasHours && !hasMinutes) {
|
|
23
|
-
return "form.error.datetime.invalid_month_year_hours_minutes";
|
|
24
|
-
}
|
|
25
|
-
if (!hasDay && hasMonth && !hasYear && !hasHours && !hasMinutes) {
|
|
26
|
-
return "form.error.datetime.invalid_day_year_hours_minutes";
|
|
27
|
-
}
|
|
28
|
-
if (!hasDay && !hasMonth && hasYear && !hasHours && !hasMinutes) {
|
|
29
|
-
return "form.error.datetime.invalid_day_month_hours_minutes";
|
|
30
|
-
}
|
|
31
|
-
if (hasDay && hasMonth && !hasYear && !hasHours && !hasMinutes) {
|
|
32
|
-
return "form.error.datetime.invalid_year_hours_minutes";
|
|
33
|
-
}
|
|
34
|
-
if (hasDay && !hasMonth && hasYear && !hasHours && !hasMinutes) {
|
|
35
|
-
return "form.error.datetime.invalid_month_hours_minutes";
|
|
36
|
-
}
|
|
37
|
-
if (!hasDay && hasMonth && hasYear && !hasHours && !hasMinutes) {
|
|
38
|
-
return "form.error.datetime.invalid_day_hours_minutes";
|
|
39
|
-
}
|
|
40
|
-
if (hasDay && hasMonth && hasYear && !hasHours && !hasMinutes) {
|
|
41
|
-
return "form.error.datetime.invalid__hours_minutes";
|
|
42
|
-
}
|
|
43
|
-
if (hasDay && hasMonth && hasYear && hasHours && !hasMinutes) {
|
|
44
|
-
return "form.error.datetime.invalid_minutes";
|
|
45
|
-
}
|
|
46
|
-
if (hasDay && hasMonth && hasYear && !hasHours && hasMinutes) {
|
|
47
|
-
return "form.error.datetime.invalid_hours";
|
|
48
|
-
}
|
|
49
|
-
if (hasDay && !hasMonth && !hasYear && hasHours && !hasMinutes) {
|
|
50
|
-
return "form.error.datetime.invalid_month_year_minutes";
|
|
51
|
-
}
|
|
52
|
-
if (hasDay && !hasMonth && !hasYear && !hasHours && hasMinutes) {
|
|
53
|
-
return "form.error.datetime.invalid_month_year_hours";
|
|
54
|
-
}
|
|
55
|
-
if (hasDay && !hasMonth && !hasYear && hasHours && hasMinutes) {
|
|
56
|
-
return "form.error.datetime.invalid_month_year";
|
|
57
|
-
}
|
|
58
|
-
if (!hasDay && hasMonth && !hasYear && hasHours && !hasMinutes) {
|
|
59
|
-
return "form.error.datetime.invalid_day_year_minutes";
|
|
60
|
-
}
|
|
61
|
-
if (!hasDay && hasMonth && !hasYear && !hasHours && hasMinutes) {
|
|
62
|
-
return "form.error.datetime.invalid_day_year_hours";
|
|
63
|
-
}
|
|
64
|
-
if (!hasDay && hasMonth && !hasYear && hasHours && hasMinutes) {
|
|
65
|
-
return "form.error.datetime.invalid_day_year";
|
|
66
|
-
}
|
|
67
|
-
if (!hasDay && !hasMonth && hasYear && hasHours && !hasMinutes) {
|
|
68
|
-
return "form.error.datetime.invalid_day_month_minutes";
|
|
69
|
-
}
|
|
70
|
-
if (!hasDay && !hasMonth && hasYear && !hasHours && hasMinutes) {
|
|
71
|
-
return "form.error.datetime.invalid_day_month_hours";
|
|
72
|
-
}
|
|
73
|
-
if (!hasDay && !hasMonth && hasYear && hasHours && hasMinutes) {
|
|
74
|
-
return "form.error.datetime.invalid_day_month";
|
|
75
|
-
}
|
|
76
|
-
if (!hasDay && !hasMonth && !hasYear && hasHours && hasMinutes) {
|
|
77
|
-
return "form.error.datetime.invalid_day_month_year";
|
|
78
|
-
}
|
|
79
|
-
if (!hasDay && !hasMonth && !hasYear && !hasHours && hasMinutes) {
|
|
80
|
-
return "form.error.datetime.invalid_day_month_year_hours";
|
|
81
|
-
}
|
|
82
|
-
if (hasDay && hasMonth && !hasYear && hasHours && !hasMinutes) {
|
|
83
|
-
return "form.error.datetime.invalid_year_minutes";
|
|
84
|
-
}
|
|
85
|
-
if (hasDay && hasMonth && !hasYear && !hasHours && hasMinutes) {
|
|
86
|
-
return "form.error.datetime.invalid_year_hours";
|
|
87
|
-
}
|
|
88
|
-
if (hasDay && hasMonth && !hasYear && hasHours && hasMinutes) {
|
|
89
|
-
return "form.error.datetime.invalid_year";
|
|
90
|
-
}
|
|
91
|
-
if (hasDay && !hasMonth && hasYear && hasHours && !hasMinutes) {
|
|
92
|
-
return "form.error.datetime.invalid_month_minutes";
|
|
93
|
-
}
|
|
94
|
-
if (hasDay && !hasMonth && hasYear && !hasHours && hasMinutes) {
|
|
95
|
-
return "form.error.datetime.invalid_month_hours";
|
|
96
|
-
}
|
|
97
|
-
if (hasDay && !hasMonth && hasYear && hasHours && hasMinutes) {
|
|
98
|
-
return "form.error.datetime.invalid_month";
|
|
99
|
-
}
|
|
100
|
-
if (!hasDay && hasMonth && hasYear && hasHours && !hasMinutes) {
|
|
101
|
-
return "form.error.datetime.invalid_day_minutes";
|
|
102
|
-
}
|
|
103
|
-
if (!hasDay && hasMonth && hasYear && !hasHours && hasMinutes) {
|
|
104
|
-
return "form.error.datetime.invalid_day_hours";
|
|
105
|
-
}
|
|
106
|
-
if (!hasDay && hasMonth && hasYear && hasHours && hasMinutes) {
|
|
107
|
-
return "form.error.datetime.invalid_day";
|
|
108
|
-
}
|
|
109
|
-
if (!hasDay && !hasMonth && !hasYear && hasHours && !hasMinutes) {
|
|
110
|
-
return "form.error.datetime.invalid_day_month_year_minutes";
|
|
111
|
-
}
|
|
112
|
-
if (hasDay && hasMonth && hasYear && !hasHours && !hasMinutes) {
|
|
113
|
-
return "form.error.datetime.invalid_hours_minutes";
|
|
114
|
-
}
|
|
115
|
-
if (day && month) {
|
|
116
|
-
const dayNum = parseInt(day);
|
|
117
|
-
const monthNum = parseInt(month);
|
|
118
|
-
const validYear = onlyNumbersRegex.test(year) ? year : void 0;
|
|
119
|
-
if (!validYear || year.length < 4) {
|
|
120
|
-
return "form.error.datetime.invalid";
|
|
121
|
-
}
|
|
122
|
-
const yearNum = parseInt(validYear);
|
|
123
|
-
const maxDay = getDaysInMonth(monthNum, yearNum);
|
|
124
|
-
if (dayNum < 1 || dayNum > maxDay) {
|
|
125
|
-
return {
|
|
126
|
-
key: "form.error.datetime.invalid_day_range",
|
|
127
|
-
context: {
|
|
128
|
-
maxDay
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
if (monthNum < 1 || monthNum > 12) {
|
|
133
|
-
return "form.error.datetime.invalid_month_range";
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if (hours && minutes) {
|
|
137
|
-
const hoursNum = parseInt(hours);
|
|
138
|
-
const minutesNum = parseInt(minutes);
|
|
139
|
-
if (hoursNum < 0 || hoursNum > 23) {
|
|
140
|
-
return "form.error.datetime.invalid_hours_range";
|
|
141
|
-
}
|
|
142
|
-
if (minutesNum < 0 || minutesNum > 59) {
|
|
143
|
-
return "form.error.datetime.invalid_minutes_range";
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return "form.error.datetime.invalid";
|
|
147
|
-
};
|
|
148
|
-
const LATER_THAN_DATETIME_VALIDATOR = (field) => {
|
|
149
|
-
let minDateTime;
|
|
150
|
-
const params = field.extra || {};
|
|
151
|
-
if (params.min === "now") {
|
|
152
|
-
minDateTime = dayjs();
|
|
153
|
-
} else {
|
|
154
|
-
minDateTime = getDateTime(params.min);
|
|
155
|
-
}
|
|
156
|
-
return {
|
|
157
|
-
name: "later-than-datetime",
|
|
158
|
-
message: {
|
|
159
|
-
key: "form.error.datetime.later_than",
|
|
160
|
-
context: {
|
|
161
|
-
minDateTime: minDateTime.format("DD/MM/YYYY HH:mm")
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
test: function(value) {
|
|
165
|
-
if (!value) return true;
|
|
166
|
-
const datetime = getDateTime(value);
|
|
167
|
-
return datetime.isValid() && datetime.isAfter(minDateTime);
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
const EARLIER_THAN_DATETIME_VALIDATOR = (field) => {
|
|
172
|
-
let maxDateTime;
|
|
173
|
-
const params = field.extra || {};
|
|
174
|
-
if (params.max === "now") {
|
|
175
|
-
maxDateTime = dayjs();
|
|
176
|
-
} else {
|
|
177
|
-
maxDateTime = getDateTime(params.max);
|
|
178
|
-
}
|
|
179
|
-
return {
|
|
180
|
-
name: "earlier-than-datetime",
|
|
181
|
-
message: {
|
|
182
|
-
key: "form.error.datetime.earlier_than",
|
|
183
|
-
context: {
|
|
184
|
-
maxDateTime: maxDateTime.format("DD/MM/YYYY HH:mm")
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
test: function(value) {
|
|
188
|
-
if (!value) return true;
|
|
189
|
-
const datetime = getDateTime(value);
|
|
190
|
-
return datetime.isValid() && datetime.isBefore(maxDateTime);
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
};
|
|
194
|
-
const DATETIME_VALIDATOR = {
|
|
195
|
-
name: "datetime-validator",
|
|
196
|
-
message: (v) => {
|
|
197
|
-
return checkPartialDateTime(v.value);
|
|
198
|
-
},
|
|
199
|
-
test: function(value) {
|
|
200
|
-
if (!value) return true;
|
|
201
|
-
const datetime = getDateTime(value);
|
|
202
|
-
return datetime.isValid();
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
export {
|
|
206
|
-
DATETIME_VALIDATOR,
|
|
207
|
-
EARLIER_THAN_DATETIME_VALIDATOR,
|
|
208
|
-
LATER_THAN_DATETIME_VALIDATOR
|
|
209
|
-
};
|
|
210
|
-
//# sourceMappingURL=datetime.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/validators/utils/datetime.ts"],
|
|
4
|
-
"sourcesContent": ["import dayjs from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport type { FieldSpec } from '@digigov/form/types';\nimport type { ValidatorSchema } from '@digigov/form/validators/types';\n\ndayjs.extend(customParseFormat);\n\nconst VALID_DATETIME_FORMATS = ['DD/MM/YYYY HH:mm'];\nconst DATETIME_CACHE = {};\nconst onlyNumbersRegex = /^\\d+$/;\n\nconst getDateTime = (v: string) => {\n return DATETIME_CACHE[v]\n ? DATETIME_CACHE[v]\n : dayjs(v, VALID_DATETIME_FORMATS, true);\n};\n\nconst getDaysInMonth = (month: number, year: number): number => {\n return dayjs(`${year}-${month}-01`).daysInMonth(); // e.g. 29 for Feb 2024\n};\n\nconst checkPartialDateTime = (value: string) => {\n const [datePart, timePart] = value.split(' ');\n const [day, month, year] = datePart?.split('/') ?? [];\n const [hours, minutes] = timePart?.split(':') ?? [];\n\n const hasDay = Boolean(day);\n const hasMonth = Boolean(month);\n const hasYear = Boolean(year);\n const hasHours = Boolean(hours);\n const hasMinutes = Boolean(minutes);\n\n if (hasDay && !hasMonth && !hasYear && !hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid_month_year_hours_minutes';\n }\n if (!hasDay && hasMonth && !hasYear && !hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid_day_year_hours_minutes';\n }\n if (!hasDay && !hasMonth && hasYear && !hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid_day_month_hours_minutes';\n }\n if (hasDay && hasMonth && !hasYear && !hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid_year_hours_minutes';\n }\n if (hasDay && !hasMonth && hasYear && !hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid_month_hours_minutes';\n }\n if (!hasDay && hasMonth && hasYear && !hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid_day_hours_minutes';\n }\n if (hasDay && hasMonth && hasYear && !hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid__hours_minutes';\n }\n if (hasDay && hasMonth && hasYear && hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid_minutes';\n }\n if (hasDay && hasMonth && hasYear && !hasHours && hasMinutes) {\n return 'form.error.datetime.invalid_hours';\n }\n if (hasDay && !hasMonth && !hasYear && hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid_month_year_minutes';\n }\n if (hasDay && !hasMonth && !hasYear && !hasHours && hasMinutes) {\n return 'form.error.datetime.invalid_month_year_hours';\n }\n if (hasDay && !hasMonth && !hasYear && hasHours && hasMinutes) {\n return 'form.error.datetime.invalid_month_year';\n }\n if (!hasDay && hasMonth && !hasYear && hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid_day_year_minutes';\n }\n if (!hasDay && hasMonth && !hasYear && !hasHours && hasMinutes) {\n return 'form.error.datetime.invalid_day_year_hours';\n }\n if (!hasDay && hasMonth && !hasYear && hasHours && hasMinutes) {\n return 'form.error.datetime.invalid_day_year';\n }\n if (!hasDay && !hasMonth && hasYear && hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid_day_month_minutes';\n }\n if (!hasDay && !hasMonth && hasYear && !hasHours && hasMinutes) {\n return 'form.error.datetime.invalid_day_month_hours';\n }\n if (!hasDay && !hasMonth && hasYear && hasHours && hasMinutes) {\n return 'form.error.datetime.invalid_day_month';\n }\n if (!hasDay && !hasMonth && !hasYear && hasHours && hasMinutes) {\n return 'form.error.datetime.invalid_day_month_year';\n }\n if (!hasDay && !hasMonth && !hasYear && !hasHours && hasMinutes) {\n return 'form.error.datetime.invalid_day_month_year_hours';\n }\n if (hasDay && hasMonth && !hasYear && hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid_year_minutes';\n }\n if (hasDay && hasMonth && !hasYear && !hasHours && hasMinutes) {\n return 'form.error.datetime.invalid_year_hours';\n }\n if (hasDay && hasMonth && !hasYear && hasHours && hasMinutes) {\n return 'form.error.datetime.invalid_year';\n }\n if (hasDay && !hasMonth && hasYear && hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid_month_minutes';\n }\n if (hasDay && !hasMonth && hasYear && !hasHours && hasMinutes) {\n return 'form.error.datetime.invalid_month_hours';\n }\n if (hasDay && !hasMonth && hasYear && hasHours && hasMinutes) {\n return 'form.error.datetime.invalid_month';\n }\n if (!hasDay && hasMonth && hasYear && hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid_day_minutes';\n }\n if (!hasDay && hasMonth && hasYear && !hasHours && hasMinutes) {\n return 'form.error.datetime.invalid_day_hours';\n }\n if (!hasDay && hasMonth && hasYear && hasHours && hasMinutes) {\n return 'form.error.datetime.invalid_day';\n }\n if (!hasDay && !hasMonth && !hasYear && hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid_day_month_year_minutes';\n }\n if (hasDay && hasMonth && hasYear && !hasHours && !hasMinutes) {\n return 'form.error.datetime.invalid_hours_minutes';\n }\n if (day && month) {\n const dayNum = parseInt(day);\n const monthNum = parseInt(month);\n const validYear = onlyNumbersRegex.test(year) ? year : undefined;\n if (!validYear || year.length < 4) {\n return 'form.error.datetime.invalid';\n }\n const yearNum = parseInt(validYear);\n const maxDay = getDaysInMonth(monthNum, yearNum);\n if (dayNum < 1 || dayNum > maxDay) {\n return {\n key: 'form.error.datetime.invalid_day_range',\n context: {\n maxDay: maxDay,\n },\n };\n }\n if (monthNum < 1 || monthNum > 12) {\n return 'form.error.datetime.invalid_month_range';\n }\n }\n if (hours && minutes) {\n const hoursNum = parseInt(hours);\n const minutesNum = parseInt(minutes);\n if (hoursNum < 0 || hoursNum > 23) {\n return 'form.error.datetime.invalid_hours_range';\n }\n if (minutesNum < 0 || minutesNum > 59) {\n return 'form.error.datetime.invalid_minutes_range';\n }\n }\n return 'form.error.datetime.invalid';\n};\n\nexport const LATER_THAN_DATETIME_VALIDATOR = (\n field: FieldSpec\n): ValidatorSchema => {\n let minDateTime;\n const params = field.extra || {};\n if (params.min === 'now') {\n minDateTime = dayjs();\n } else {\n minDateTime = getDateTime(params.min);\n }\n return {\n name: 'later-than-datetime',\n message: {\n key: 'form.error.datetime.later_than',\n context: {\n minDateTime: minDateTime.format('DD/MM/YYYY HH:mm'),\n },\n },\n test: function (value: string) {\n if (!value) return true;\n const datetime = getDateTime(value);\n return datetime.isValid() && datetime.isAfter(minDateTime);\n },\n };\n};\n\nexport const EARLIER_THAN_DATETIME_VALIDATOR = (\n field: FieldSpec\n): ValidatorSchema => {\n let maxDateTime;\n const params = field.extra || {};\n if (params.max === 'now') {\n maxDateTime = dayjs();\n } else {\n maxDateTime = getDateTime(params.max);\n }\n return {\n name: 'earlier-than-datetime',\n message: {\n key: 'form.error.datetime.earlier_than',\n context: {\n maxDateTime: maxDateTime.format('DD/MM/YYYY HH:mm'),\n },\n },\n test: function (value: string) {\n if (!value) return true;\n const datetime = getDateTime(value);\n return datetime.isValid() && datetime.isBefore(maxDateTime);\n },\n };\n};\n\nexport const DATETIME_VALIDATOR = {\n name: 'datetime-validator',\n message: (v): string | object => {\n return checkPartialDateTime(v.value);\n },\n test: function (value: string) {\n if (!value) return true;\n const datetime = getDateTime(value);\n return datetime.isValid();\n },\n};\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,WAAW;AAClB,OAAO,uBAAuB;AAI9B,MAAM,OAAO,iBAAiB;AAE9B,MAAM,yBAAyB,CAAC,kBAAkB;AAClD,MAAM,iBAAiB,CAAC;AACxB,MAAM,mBAAmB;AAEzB,MAAM,cAAc,CAAC,MAAc;AACjC,SAAO,eAAe,CAAC,IACnB,eAAe,CAAC,IAChB,MAAM,GAAG,wBAAwB,IAAI;AAC3C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
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const EMAIL_VALIDATOR = {
|
|
2
|
-
name: "email-validator",
|
|
3
|
-
message: "form.error.email",
|
|
4
|
-
test: (value) => {
|
|
5
|
-
if (!value) return true;
|
|
6
|
-
const EMAIL_REGEX = (
|
|
7
|
-
// eslint-disable-next-line no-useless-escape
|
|
8
|
-
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
|
9
|
-
);
|
|
10
|
-
return EMAIL_REGEX.test(value);
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
EMAIL_VALIDATOR
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=email.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/validators/utils/email.ts"],
|
|
4
|
-
"sourcesContent": ["export const EMAIL_VALIDATOR = {\n name: 'email-validator',\n message: 'form.error.email',\n test: (value: string): boolean => {\n if (!value) return true;\n const EMAIL_REGEX =\n // eslint-disable-next-line no-useless-escape\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return EMAIL_REGEX.test(value);\n },\n};\n"],
|
|
5
|
-
"mappings": "AAAO,MAAM,kBAAkB;AAAA,EAC7B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM,CAAC,UAA2B;AAChC,QAAI,CAAC,MAAO,QAAO;AACnB,UAAM;AAAA;AAAA,MAEJ;AAAA;AACF,WAAO,YAAY,KAAK,KAAK;AAAA,EAC/B;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
const DEFAULT_FILE_MAX_SIZE = 1e7;
|
|
2
|
-
const FILE_MAX_SIZE_VALIDATOR = (field) => {
|
|
3
|
-
const maxSizeInBytes = field?.extra?.limit?.maxSize || DEFAULT_FILE_MAX_SIZE;
|
|
4
|
-
let maxSizeTransformed = maxSizeInBytes / (1024 * 1024);
|
|
5
|
-
let maxSizeText = "MB";
|
|
6
|
-
if (Math.round(maxSizeTransformed) === 0) {
|
|
7
|
-
maxSizeTransformed = Math.round(maxSizeInBytes / 1024);
|
|
8
|
-
maxSizeText = "KB";
|
|
9
|
-
}
|
|
10
|
-
if (Math.round(maxSizeTransformed) === 0) {
|
|
11
|
-
maxSizeTransformed = maxSizeInBytes;
|
|
12
|
-
maxSizeText = "Bytes";
|
|
13
|
-
}
|
|
14
|
-
return {
|
|
15
|
-
name: "file-max-size-validator",
|
|
16
|
-
message: {
|
|
17
|
-
key: field.type === "file" ? "form.error.file_size" : "form.error.image_size",
|
|
18
|
-
context: {
|
|
19
|
-
maxSize: `${maxSizeTransformed} ${maxSizeText}`
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
test: (value) => {
|
|
23
|
-
if (value) {
|
|
24
|
-
for (const file of Array.from(value)) {
|
|
25
|
-
const maxSize = field?.extra?.limit?.maxSize || DEFAULT_FILE_MAX_SIZE;
|
|
26
|
-
if (file.size > maxSize) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export {
|
|
36
|
-
FILE_MAX_SIZE_VALIDATOR
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=file.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/validators/utils/file.ts"],
|
|
4
|
-
"sourcesContent": ["import type { FieldSpec } from '@digigov/form/types';\nimport type { ValidatorSchema } from '@digigov/form/validators/types';\n\nconst DEFAULT_FILE_MAX_SIZE = 10000000;\n\nexport const FILE_MAX_SIZE_VALIDATOR = (field: FieldSpec): ValidatorSchema => {\n const maxSizeInBytes = field?.extra?.limit?.maxSize || DEFAULT_FILE_MAX_SIZE;\n let maxSizeTransformed = maxSizeInBytes / (1024 * 1024); // In MB\n let maxSizeText = 'MB';\n if (Math.round(maxSizeTransformed) === 0) {\n maxSizeTransformed = Math.round(maxSizeInBytes / 1024);\n maxSizeText = 'KB';\n }\n if (Math.round(maxSizeTransformed) === 0) {\n maxSizeTransformed = maxSizeInBytes;\n maxSizeText = 'Bytes';\n }\n return {\n name: 'file-max-size-validator',\n message: {\n key:\n field.type === 'file'\n ? 'form.error.file_size'\n : 'form.error.image_size',\n context: {\n maxSize: `${maxSizeTransformed} ${maxSizeText}`,\n },\n },\n test: (value: File[]): boolean => {\n if (value) {\n for (const file of Array.from(value)) {\n const maxSize = field?.extra?.limit?.maxSize || DEFAULT_FILE_MAX_SIZE;\n if (file.size > maxSize) {\n return false;\n }\n }\n }\n return true;\n },\n };\n};\n"],
|
|
5
|
-
"mappings": "AAGA,MAAM,wBAAwB;AAEvB,MAAM,0BAA0B,CAAC,UAAsC;AAC5E,QAAM,iBAAiB,OAAO,OAAO,OAAO,WAAW;AACvD,MAAI,qBAAqB,kBAAkB,OAAO;AAClD,MAAI,cAAc;AAClB,MAAI,KAAK,MAAM,kBAAkB,MAAM,GAAG;AACxC,yBAAqB,KAAK,MAAM,iBAAiB,IAAI;AACrD,kBAAc;AAAA,EAChB;AACA,MAAI,KAAK,MAAM,kBAAkB,MAAM,GAAG;AACxC,yBAAqB;AACrB,kBAAc;AAAA,EAChB;AACA,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,MACP,KACE,MAAM,SAAS,SACX,yBACA;AAAA,MACN,SAAS;AAAA,QACP,SAAS,GAAG,kBAAkB,IAAI,WAAW;AAAA,MAC/C;AAAA,IACF;AAAA,IACA,MAAM,CAAC,UAA2B;AAChC,UAAI,OAAO;AACT,mBAAW,QAAQ,MAAM,KAAK,KAAK,GAAG;AACpC,gBAAM,UAAU,OAAO,OAAO,OAAO,WAAW;AAChD,cAAI,KAAK,OAAO,SAAS;AACvB,mBAAO;AAAA,UACT;AAAA,QACF;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|