@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
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
import customParseFormat from "dayjs/plugin/customParseFormat.js";
|
|
3
|
+
dayjs.extend(customParseFormat);
|
|
4
|
+
const VALID_DATETIME_FORMATS = [
|
|
5
|
+
'DD/MM/YYYY HH:mm'
|
|
6
|
+
];
|
|
7
|
+
const DATETIME_CACHE = {};
|
|
8
|
+
const onlyNumbersRegex = /^\d+$/;
|
|
9
|
+
const getDateTime = (v)=>DATETIME_CACHE[v] ? DATETIME_CACHE[v] : dayjs(v, VALID_DATETIME_FORMATS, true);
|
|
10
|
+
const getDaysInMonth = (month, year)=>dayjs(`${year}-${month}-01`).daysInMonth();
|
|
11
|
+
const checkPartialDateTime = (value)=>{
|
|
12
|
+
const [datePart, timePart] = value.split(' ');
|
|
13
|
+
const [day, month, year] = datePart?.split('/') ?? [];
|
|
14
|
+
const [hours, minutes] = timePart?.split(':') ?? [];
|
|
15
|
+
const hasDay = Boolean(day);
|
|
16
|
+
const hasMonth = Boolean(month);
|
|
17
|
+
const hasYear = Boolean(year);
|
|
18
|
+
const hasHours = Boolean(hours);
|
|
19
|
+
const hasMinutes = Boolean(minutes);
|
|
20
|
+
if (hasDay && !hasMonth && !hasYear && !hasHours && !hasMinutes) return 'form.error.datetime.invalid_month_year_hours_minutes';
|
|
21
|
+
if (!hasDay && hasMonth && !hasYear && !hasHours && !hasMinutes) return 'form.error.datetime.invalid_day_year_hours_minutes';
|
|
22
|
+
if (!hasDay && !hasMonth && hasYear && !hasHours && !hasMinutes) return 'form.error.datetime.invalid_day_month_hours_minutes';
|
|
23
|
+
if (hasDay && hasMonth && !hasYear && !hasHours && !hasMinutes) return 'form.error.datetime.invalid_year_hours_minutes';
|
|
24
|
+
if (hasDay && !hasMonth && hasYear && !hasHours && !hasMinutes) return 'form.error.datetime.invalid_month_hours_minutes';
|
|
25
|
+
if (!hasDay && hasMonth && hasYear && !hasHours && !hasMinutes) return 'form.error.datetime.invalid_day_hours_minutes';
|
|
26
|
+
if (hasDay && hasMonth && hasYear && !hasHours && !hasMinutes) return 'form.error.datetime.invalid__hours_minutes';
|
|
27
|
+
if (hasDay && hasMonth && hasYear && hasHours && !hasMinutes) return 'form.error.datetime.invalid_minutes';
|
|
28
|
+
if (hasDay && hasMonth && hasYear && !hasHours && hasMinutes) return 'form.error.datetime.invalid_hours';
|
|
29
|
+
if (hasDay && !hasMonth && !hasYear && hasHours && !hasMinutes) return 'form.error.datetime.invalid_month_year_minutes';
|
|
30
|
+
if (hasDay && !hasMonth && !hasYear && !hasHours && hasMinutes) return 'form.error.datetime.invalid_month_year_hours';
|
|
31
|
+
if (hasDay && !hasMonth && !hasYear && hasHours && hasMinutes) return 'form.error.datetime.invalid_month_year';
|
|
32
|
+
if (!hasDay && hasMonth && !hasYear && hasHours && !hasMinutes) return 'form.error.datetime.invalid_day_year_minutes';
|
|
33
|
+
if (!hasDay && hasMonth && !hasYear && !hasHours && hasMinutes) return 'form.error.datetime.invalid_day_year_hours';
|
|
34
|
+
if (!hasDay && hasMonth && !hasYear && hasHours && hasMinutes) return 'form.error.datetime.invalid_day_year';
|
|
35
|
+
if (!hasDay && !hasMonth && hasYear && hasHours && !hasMinutes) return 'form.error.datetime.invalid_day_month_minutes';
|
|
36
|
+
if (!hasDay && !hasMonth && hasYear && !hasHours && hasMinutes) return 'form.error.datetime.invalid_day_month_hours';
|
|
37
|
+
if (!hasDay && !hasMonth && hasYear && hasHours && hasMinutes) return 'form.error.datetime.invalid_day_month';
|
|
38
|
+
if (!hasDay && !hasMonth && !hasYear && hasHours && hasMinutes) return 'form.error.datetime.invalid_day_month_year';
|
|
39
|
+
if (!hasDay && !hasMonth && !hasYear && !hasHours && hasMinutes) return 'form.error.datetime.invalid_day_month_year_hours';
|
|
40
|
+
if (hasDay && hasMonth && !hasYear && hasHours && !hasMinutes) return 'form.error.datetime.invalid_year_minutes';
|
|
41
|
+
if (hasDay && hasMonth && !hasYear && !hasHours && hasMinutes) return 'form.error.datetime.invalid_year_hours';
|
|
42
|
+
if (hasDay && hasMonth && !hasYear && hasHours && hasMinutes) return 'form.error.datetime.invalid_year';
|
|
43
|
+
if (hasDay && !hasMonth && hasYear && hasHours && !hasMinutes) return 'form.error.datetime.invalid_month_minutes';
|
|
44
|
+
if (hasDay && !hasMonth && hasYear && !hasHours && hasMinutes) return 'form.error.datetime.invalid_month_hours';
|
|
45
|
+
if (hasDay && !hasMonth && hasYear && hasHours && hasMinutes) return 'form.error.datetime.invalid_month';
|
|
46
|
+
if (!hasDay && hasMonth && hasYear && hasHours && !hasMinutes) return 'form.error.datetime.invalid_day_minutes';
|
|
47
|
+
if (!hasDay && hasMonth && hasYear && !hasHours && hasMinutes) return 'form.error.datetime.invalid_day_hours';
|
|
48
|
+
if (!hasDay && hasMonth && hasYear && hasHours && hasMinutes) return 'form.error.datetime.invalid_day';
|
|
49
|
+
if (!hasDay && !hasMonth && !hasYear && hasHours && !hasMinutes) return 'form.error.datetime.invalid_day_month_year_minutes';
|
|
50
|
+
if (hasDay && hasMonth && hasYear && !hasHours && !hasMinutes) return 'form.error.datetime.invalid_hours_minutes';
|
|
51
|
+
if (day && month) {
|
|
52
|
+
const dayNum = parseInt(day);
|
|
53
|
+
const monthNum = parseInt(month);
|
|
54
|
+
const validYear = onlyNumbersRegex.test(year) ? year : void 0;
|
|
55
|
+
if (!validYear || year.length < 4) return 'form.error.datetime.invalid';
|
|
56
|
+
const yearNum = parseInt(validYear);
|
|
57
|
+
const maxDay = getDaysInMonth(monthNum, yearNum);
|
|
58
|
+
if (dayNum < 1 || dayNum > maxDay) return {
|
|
59
|
+
key: 'form.error.datetime.invalid_day_range',
|
|
60
|
+
context: {
|
|
61
|
+
maxDay: maxDay
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
if (monthNum < 1 || monthNum > 12) return 'form.error.datetime.invalid_month_range';
|
|
65
|
+
}
|
|
66
|
+
if (hours && minutes) {
|
|
67
|
+
const hoursNum = parseInt(hours);
|
|
68
|
+
const minutesNum = parseInt(minutes);
|
|
69
|
+
if (hoursNum < 0 || hoursNum > 23) return 'form.error.datetime.invalid_hours_range';
|
|
70
|
+
if (minutesNum < 0 || minutesNum > 59) return 'form.error.datetime.invalid_minutes_range';
|
|
71
|
+
}
|
|
72
|
+
return 'form.error.datetime.invalid';
|
|
73
|
+
};
|
|
74
|
+
const LATER_THAN_DATETIME_VALIDATOR = (field)=>{
|
|
75
|
+
let minDateTime;
|
|
76
|
+
const params = field.extra || {};
|
|
77
|
+
minDateTime = 'now' === params.min ? dayjs() : getDateTime(params.min);
|
|
78
|
+
return {
|
|
79
|
+
name: 'later-than-datetime',
|
|
80
|
+
message: {
|
|
81
|
+
key: 'form.error.datetime.later_than',
|
|
82
|
+
context: {
|
|
83
|
+
minDateTime: minDateTime.format('DD/MM/YYYY HH:mm')
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
test: function(value) {
|
|
87
|
+
if (!value) return true;
|
|
88
|
+
const datetime = getDateTime(value);
|
|
89
|
+
return datetime.isValid() && datetime.isAfter(minDateTime);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
const EARLIER_THAN_DATETIME_VALIDATOR = (field)=>{
|
|
94
|
+
let maxDateTime;
|
|
95
|
+
const params = field.extra || {};
|
|
96
|
+
maxDateTime = 'now' === params.max ? dayjs() : getDateTime(params.max);
|
|
97
|
+
return {
|
|
98
|
+
name: 'earlier-than-datetime',
|
|
99
|
+
message: {
|
|
100
|
+
key: 'form.error.datetime.earlier_than',
|
|
101
|
+
context: {
|
|
102
|
+
maxDateTime: maxDateTime.format('DD/MM/YYYY HH:mm')
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
test: function(value) {
|
|
106
|
+
if (!value) return true;
|
|
107
|
+
const datetime = getDateTime(value);
|
|
108
|
+
return datetime.isValid() && datetime.isBefore(maxDateTime);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
const DATETIME_VALIDATOR = {
|
|
113
|
+
name: 'datetime-validator',
|
|
114
|
+
message: (v)=>checkPartialDateTime(v.value),
|
|
115
|
+
test: function(value) {
|
|
116
|
+
if (!value) return true;
|
|
117
|
+
const datetime = getDateTime(value);
|
|
118
|
+
return datetime.isValid();
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
export { DATETIME_VALIDATOR, EARLIER_THAN_DATETIME_VALIDATOR, LATER_THAN_DATETIME_VALIDATOR };
|
|
@@ -0,0 +1,10 @@
|
|
|
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 = /^(([^<>()\[\]\\.,;:\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,}))$/;
|
|
7
|
+
return EMAIL_REGEX.test(value);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
export { EMAIL_VALIDATOR };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { FieldSpec } from '
|
|
2
|
-
import type { ValidatorSchema } from '
|
|
1
|
+
import type { FieldSpec } from '../../types.js';
|
|
2
|
+
import type { ValidatorSchema } from '../types.js';
|
|
3
3
|
export declare const FILE_MAX_SIZE_VALIDATOR: (field: FieldSpec) => ValidatorSchema;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const DEFAULT_FILE_MAX_SIZE = 10000000;
|
|
2
|
+
const FILE_MAX_SIZE_VALIDATOR = (field)=>{
|
|
3
|
+
const maxSizeInBytes = field?.extra?.limit?.maxSize || DEFAULT_FILE_MAX_SIZE;
|
|
4
|
+
let maxSizeTransformed = maxSizeInBytes / 1048576;
|
|
5
|
+
let maxSizeText = 'MB';
|
|
6
|
+
if (0 === Math.round(maxSizeTransformed)) {
|
|
7
|
+
maxSizeTransformed = Math.round(maxSizeInBytes / 1024);
|
|
8
|
+
maxSizeText = 'KB';
|
|
9
|
+
}
|
|
10
|
+
if (0 === Math.round(maxSizeTransformed)) {
|
|
11
|
+
maxSizeTransformed = maxSizeInBytes;
|
|
12
|
+
maxSizeText = 'Bytes';
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
name: 'file-max-size-validator',
|
|
16
|
+
message: {
|
|
17
|
+
key: 'file' === field.type ? 'form.error.file_size' : 'form.error.image_size',
|
|
18
|
+
context: {
|
|
19
|
+
maxSize: `${maxSizeTransformed} ${maxSizeText}`
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
test: (value)=>{
|
|
23
|
+
if (value) for (const file of Array.from(value)){
|
|
24
|
+
const maxSize = field?.extra?.limit?.maxSize || DEFAULT_FILE_MAX_SIZE;
|
|
25
|
+
if (file.size > maxSize) return false;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export { FILE_MAX_SIZE_VALIDATOR };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldSpec } from '
|
|
2
|
-
import type { ValidatorSchema } from '
|
|
1
|
+
import type { FieldSpec } from '../../types.js';
|
|
2
|
+
import type { ValidatorSchema } from '../types.js';
|
|
3
3
|
export declare function validateIban(value: string, countryCode: string): boolean;
|
|
4
4
|
export declare const IBAN_VALIDATOR: (field: FieldSpec) => ValidatorSchema;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
function validateIban(value, countryCode) {
|
|
2
|
+
value = value.replace(/\s/g, '').replace(/-/g, '');
|
|
3
|
+
if (value.match(/^[0-9]*$/i)) {
|
|
4
|
+
if (25 !== value.length) return false;
|
|
5
|
+
} else {
|
|
6
|
+
value = value.toUpperCase();
|
|
7
|
+
if (countryCode) {
|
|
8
|
+
if (!value.startsWith(countryCode.toUpperCase())) return false;
|
|
9
|
+
if (value.length === ibanCountryCodesLengths[countryCode.toUpperCase()]) return true;
|
|
10
|
+
}
|
|
11
|
+
if (27 !== value.length) return false;
|
|
12
|
+
}
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
const IBAN_VALIDATOR = (field)=>{
|
|
16
|
+
const countryCode = field?.extra?.country;
|
|
17
|
+
return {
|
|
18
|
+
name: 'iban-validator',
|
|
19
|
+
message: 'form.error.iban',
|
|
20
|
+
test: (value)=>{
|
|
21
|
+
if (!value) return true;
|
|
22
|
+
return validateIban(value, countryCode);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
const ibanCountryCodesLengths = {
|
|
27
|
+
AD: 24,
|
|
28
|
+
AT: 20,
|
|
29
|
+
AZ: 28,
|
|
30
|
+
BH: 22,
|
|
31
|
+
BY: 28,
|
|
32
|
+
BE: 16,
|
|
33
|
+
BA: 20,
|
|
34
|
+
BR: 29,
|
|
35
|
+
BG: 22,
|
|
36
|
+
CR: 22,
|
|
37
|
+
HR: 21,
|
|
38
|
+
CY: 28,
|
|
39
|
+
CZ: 24,
|
|
40
|
+
DK: 18,
|
|
41
|
+
DO: 28,
|
|
42
|
+
EG: 29,
|
|
43
|
+
SV: 28,
|
|
44
|
+
EE: 20,
|
|
45
|
+
FO: 18,
|
|
46
|
+
FI: 18,
|
|
47
|
+
FR: 27,
|
|
48
|
+
GE: 22,
|
|
49
|
+
DE: 22,
|
|
50
|
+
GI: 23,
|
|
51
|
+
GR: 27,
|
|
52
|
+
GL: 18,
|
|
53
|
+
GT: 28,
|
|
54
|
+
VA: 22,
|
|
55
|
+
HU: 28,
|
|
56
|
+
IS: 26,
|
|
57
|
+
IQ: 23,
|
|
58
|
+
IE: 22,
|
|
59
|
+
IL: 23,
|
|
60
|
+
IT: 27,
|
|
61
|
+
JO: 30,
|
|
62
|
+
KZ: 20,
|
|
63
|
+
XK: 20,
|
|
64
|
+
KW: 30,
|
|
65
|
+
LV: 21,
|
|
66
|
+
LB: 28,
|
|
67
|
+
LI: 21,
|
|
68
|
+
LT: 20,
|
|
69
|
+
LU: 20,
|
|
70
|
+
MT: 31,
|
|
71
|
+
MR: 27,
|
|
72
|
+
MU: 30,
|
|
73
|
+
MD: 24,
|
|
74
|
+
MC: 27,
|
|
75
|
+
ME: 22,
|
|
76
|
+
NL: 18,
|
|
77
|
+
MK: 19,
|
|
78
|
+
NO: 15,
|
|
79
|
+
PK: 24,
|
|
80
|
+
PS: 29,
|
|
81
|
+
PL: 28,
|
|
82
|
+
PT: 25,
|
|
83
|
+
QA: 29,
|
|
84
|
+
RO: 24,
|
|
85
|
+
LC: 32,
|
|
86
|
+
SM: 27,
|
|
87
|
+
ST: 25,
|
|
88
|
+
SA: 24,
|
|
89
|
+
RS: 22,
|
|
90
|
+
SC: 31,
|
|
91
|
+
SK: 24,
|
|
92
|
+
SI: 19,
|
|
93
|
+
ES: 24,
|
|
94
|
+
SE: 24,
|
|
95
|
+
CH: 21,
|
|
96
|
+
TL: 23,
|
|
97
|
+
TN: 24,
|
|
98
|
+
TR: 26,
|
|
99
|
+
UA: 29,
|
|
100
|
+
AE: 23,
|
|
101
|
+
GB: 22,
|
|
102
|
+
VG: 24
|
|
103
|
+
};
|
|
104
|
+
export { IBAN_VALIDATOR, validateIban };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { FieldSpec } from '
|
|
2
|
-
import type { ValidatorSchema } from '
|
|
1
|
+
import type { FieldSpec } from '../../types.js';
|
|
2
|
+
import type { ValidatorSchema } from '../types.js';
|
|
3
3
|
export declare const IMAGE_DIMENSION_VALIDATOR: (field: FieldSpec) => ValidatorSchema;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const DEFAULT_IMAGE_MAX_HEIGHT_SIZE = 2000;
|
|
2
|
+
const DEFAULT_IMAGE_MAX_WIDTH_SIZE = 2000;
|
|
3
|
+
const DEFAULT_IMAGE_MIN_HEIGHT_SIZE = 100;
|
|
4
|
+
const DEFAULT_IMAGE_MIN_WIDTH_SIZE = 100;
|
|
5
|
+
function getImageDimensions(file) {
|
|
6
|
+
return new Promise((resolve, reject)=>{
|
|
7
|
+
const reader = new FileReader();
|
|
8
|
+
reader.onload = (event)=>{
|
|
9
|
+
const img = new Image();
|
|
10
|
+
img.onload = ()=>{
|
|
11
|
+
resolve({
|
|
12
|
+
width: img.width,
|
|
13
|
+
height: img.height
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
img.onerror = reject;
|
|
17
|
+
const result = event?.target?.result;
|
|
18
|
+
if (result && 'string' == typeof result) img.src = result;
|
|
19
|
+
else reject(new Error('Invalid file format'));
|
|
20
|
+
};
|
|
21
|
+
reader.onerror = reject;
|
|
22
|
+
reader.readAsDataURL(file);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const IMAGE_DIMENSION_VALIDATOR = (field)=>({
|
|
26
|
+
name: 'image-dimension-validator',
|
|
27
|
+
message: (value)=>{
|
|
28
|
+
const minHeight = field?.extra?.limit?.minHeight || DEFAULT_IMAGE_MIN_HEIGHT_SIZE;
|
|
29
|
+
const minWidth = field?.extra?.limit?.minWidth || DEFAULT_IMAGE_MIN_WIDTH_SIZE;
|
|
30
|
+
const maxHeight = field?.extra?.limit?.maxHeight || DEFAULT_IMAGE_MAX_HEIGHT_SIZE;
|
|
31
|
+
const maxWidth = field?.extra?.limit?.maxWidth || DEFAULT_IMAGE_MAX_WIDTH_SIZE;
|
|
32
|
+
if (!value || 0 === value.length) return {
|
|
33
|
+
name: 'image-validator',
|
|
34
|
+
message: 'form.error.required'
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
key: 'form.error.image.image_dimension_size',
|
|
38
|
+
context: {
|
|
39
|
+
maxHeight: maxHeight,
|
|
40
|
+
maxWidth: maxWidth,
|
|
41
|
+
minHeight: minHeight,
|
|
42
|
+
minWidth: minWidth
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
test: async (value)=>{
|
|
47
|
+
if (!value || 0 === value.length) return true;
|
|
48
|
+
const file = value[0];
|
|
49
|
+
const { width, height } = await getImageDimensions(file);
|
|
50
|
+
const maxHeight = field?.extra?.limit?.maxHeight || DEFAULT_IMAGE_MAX_HEIGHT_SIZE;
|
|
51
|
+
const maxWidth = field?.extra?.limit?.maxWidth || DEFAULT_IMAGE_MAX_WIDTH_SIZE;
|
|
52
|
+
const minHeight = field?.extra?.limit?.minHeight || DEFAULT_IMAGE_MIN_HEIGHT_SIZE;
|
|
53
|
+
const minWidth = field?.extra?.limit?.minWidth || DEFAULT_IMAGE_MIN_WIDTH_SIZE;
|
|
54
|
+
if (!file) return true;
|
|
55
|
+
try {
|
|
56
|
+
if (height > maxHeight || width > maxWidth) return false;
|
|
57
|
+
if (height < minHeight || width < minWidth) return false;
|
|
58
|
+
return true;
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error('Error getting image dimensions:', error);
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
export { IMAGE_DIMENSION_VALIDATOR };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
|
-
import type { FieldSpec } from '
|
|
3
|
-
import type { ValidatorSchema } from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
12
|
-
export * from '
|
|
13
|
-
export * from '
|
|
14
|
-
export * from '
|
|
15
|
-
export * from '
|
|
2
|
+
import type { FieldSpec } from '../../types.js';
|
|
3
|
+
import type { ValidatorSchema } from '../types.js';
|
|
4
|
+
export * from './afm.js';
|
|
5
|
+
export * from './amka.js';
|
|
6
|
+
export * from './file.js';
|
|
7
|
+
export * from './iban.js';
|
|
8
|
+
export * from './otp.js';
|
|
9
|
+
export * from './image.js';
|
|
10
|
+
export * from './phone.js';
|
|
11
|
+
export * from './postal_code.js';
|
|
12
|
+
export * from './uuid4.js';
|
|
13
|
+
export * from './text_limit.js';
|
|
14
|
+
export * from './date.js';
|
|
15
|
+
export * from './datetime.js';
|
|
16
16
|
export declare function getYupField(field: FieldSpec, yupTypeMap: Record<string, any>): any;
|
|
17
17
|
export declare function computeShape(fields: FieldSpec[], yupTypeMap: Record<string, ValidatorSchema>, validatorRegistry: Record<string, ValidatorSchema[]> | undefined): {};
|
|
18
18
|
export declare function getYupObjectShape(fields: FieldSpec[] | any, yupTypeMap: Record<string, any>, validatorRegistry?: Record<string, ValidatorSchema[]>): yup.ObjectSchema<{
|
|
@@ -1,104 +1,66 @@
|
|
|
1
|
-
import
|
|
2
|
-
export * from "
|
|
3
|
-
export * from "
|
|
4
|
-
export * from "
|
|
5
|
-
export * from "
|
|
6
|
-
export * from "
|
|
7
|
-
export * from "
|
|
8
|
-
export * from "
|
|
9
|
-
export * from "
|
|
10
|
-
export * from "
|
|
11
|
-
export * from "
|
|
12
|
-
export * from "
|
|
13
|
-
export * from "
|
|
1
|
+
import { lazy, object } from "yup";
|
|
2
|
+
export * from "./afm.js";
|
|
3
|
+
export * from "./amka.js";
|
|
4
|
+
export * from "./file.js";
|
|
5
|
+
export * from "./iban.js";
|
|
6
|
+
export * from "./otp.js";
|
|
7
|
+
export * from "./image.js";
|
|
8
|
+
export * from "./phone.js";
|
|
9
|
+
export * from "./postal_code.js";
|
|
10
|
+
export * from "./uuid4.js";
|
|
11
|
+
export * from "./text_limit.js";
|
|
12
|
+
export * from "./date.js";
|
|
13
|
+
export * from "./datetime.js";
|
|
14
14
|
function getYupField(field, yupTypeMap) {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const yupField = yupTypeMap[field?.type || 'string'] || yupTypeMap['string'];
|
|
16
|
+
return yupField(field);
|
|
17
17
|
}
|
|
18
18
|
function computeShape(fields, yupTypeMap, validatorRegistry) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
const fieldSchemas = {};
|
|
20
|
+
const objectFields = {};
|
|
21
|
+
fields.forEach((field)=>{
|
|
22
|
+
let yupField = getYupField(field, yupTypeMap);
|
|
23
|
+
if (field.condition) for(const key in field.condition){
|
|
24
|
+
let then, otherwise;
|
|
25
|
+
if (field.condition[key].then) {
|
|
26
|
+
if (field.condition[key].then?.required === false) then = yupField.nullable();
|
|
27
|
+
else if (field.condition[key].then?.required === true) then = yupField.nullable().required('form.error.required');
|
|
28
|
+
}
|
|
29
|
+
if (field.condition[key].else) {
|
|
30
|
+
if (field.condition[key].else?.required === false) otherwise = yupField.nullable();
|
|
31
|
+
else if (field.condition[key].else?.required === true) otherwise = yupField.nullable().required('form.error.required');
|
|
32
|
+
}
|
|
33
|
+
if (then || otherwise) yupField = yupField.when(key, {
|
|
34
|
+
is: (val)=>{
|
|
35
|
+
const is = field.condition[key].is;
|
|
36
|
+
if (is === val || Array.isArray(val) && val.includes(is)) return true;
|
|
37
|
+
return false;
|
|
38
|
+
},
|
|
39
|
+
then,
|
|
40
|
+
otherwise
|
|
41
|
+
});
|
|
32
42
|
}
|
|
33
|
-
if (field.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} else if (field.condition[key].else?.required === true) {
|
|
37
|
-
otherwise = yupField.nullable().required("form.error.required");
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
if (then || otherwise) {
|
|
41
|
-
yupField = yupField.when(key, {
|
|
42
|
-
is: (val) => {
|
|
43
|
-
const is = field.condition[key].is;
|
|
44
|
-
if (is === val || Array.isArray(val) && val.includes(is)) {
|
|
45
|
-
return true;
|
|
46
|
-
} else {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
then,
|
|
51
|
-
otherwise
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
} else if (field.required) {
|
|
56
|
-
yupField = yupField.nullable().required("form.error.required");
|
|
57
|
-
}
|
|
58
|
-
if (validatorRegistry && field.type && validatorRegistry[field.type]) {
|
|
59
|
-
if (Array.isArray(validatorRegistry[field.type])) {
|
|
60
|
-
validatorRegistry[field.type].forEach((validator) => {
|
|
61
|
-
yupField = yupField.test(validator);
|
|
43
|
+
else if (field.required) yupField = yupField.nullable().required('form.error.required');
|
|
44
|
+
if (validatorRegistry && field.type && validatorRegistry[field.type]) if (Array.isArray(validatorRegistry[field.type])) validatorRegistry[field.type].forEach((validator)=>{
|
|
45
|
+
yupField = yupField.test(validator);
|
|
62
46
|
});
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
fieldSchemas[field.key] = yupField;
|
|
73
|
-
});
|
|
74
|
-
for (const objectKey in objectFields) {
|
|
75
|
-
fieldSchemas[objectKey] = getYupObjectShape(
|
|
76
|
-
objectFields[objectKey],
|
|
77
|
-
yupTypeMap,
|
|
78
|
-
validatorRegistry
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
return fieldSchemas;
|
|
47
|
+
else yupField = yupField.test(validatorRegistry[field.type]);
|
|
48
|
+
if (field.validators) field.validators.forEach((validator)=>{
|
|
49
|
+
yupField = yupField.test(validator);
|
|
50
|
+
});
|
|
51
|
+
fieldSchemas[field.key] = yupField;
|
|
52
|
+
});
|
|
53
|
+
for(const objectKey in objectFields)fieldSchemas[objectKey] = getYupObjectShape(objectFields[objectKey], yupTypeMap, validatorRegistry);
|
|
54
|
+
return fieldSchemas;
|
|
82
55
|
}
|
|
83
56
|
function getYupObjectShape(fields, yupTypeMap, validatorRegistry) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
),
|
|
93
|
-
yupTypeMap,
|
|
94
|
-
validatorRegistry
|
|
95
|
-
);
|
|
96
|
-
return yup.object().shape(fieldSchemas);
|
|
97
|
-
});
|
|
57
|
+
if (!fields.current) {
|
|
58
|
+
const fieldSchemas = computeShape(fields, yupTypeMap, validatorRegistry);
|
|
59
|
+
return object().shape(fieldSchemas);
|
|
60
|
+
}
|
|
61
|
+
return lazy(function() {
|
|
62
|
+
const fieldSchemas = computeShape(Object.values(fields.current).filter((f)=>!f.key.includes('.')), yupTypeMap, validatorRegistry);
|
|
63
|
+
return object().shape(fieldSchemas);
|
|
64
|
+
});
|
|
98
65
|
}
|
|
99
|
-
export {
|
|
100
|
-
computeShape,
|
|
101
|
-
getYupField,
|
|
102
|
-
getYupObjectShape
|
|
103
|
-
};
|
|
104
|
-
//# sourceMappingURL=index.js.map
|
|
66
|
+
export { computeShape, getYupField, getYupObjectShape };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function validateIntNumber(number) {
|
|
2
|
+
if (void 0 === number) return false;
|
|
3
|
+
return Number.isInteger(number) && Number(number) > 0;
|
|
4
|
+
}
|
|
5
|
+
const INT_VALIDATOR = ()=>({
|
|
6
|
+
name: 'int-validator',
|
|
7
|
+
message: 'form.error.positive_integer_number',
|
|
8
|
+
test: (value)=>{
|
|
9
|
+
if (void 0 === value) return true;
|
|
10
|
+
return validateIntNumber(value);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
export { INT_VALIDATOR, validateIntNumber };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function validateNumber(number) {
|
|
2
|
+
return !Number.isNaN(number);
|
|
3
|
+
}
|
|
4
|
+
const NUMBER_VALIDATOR = ()=>({
|
|
5
|
+
name: 'number-validator',
|
|
6
|
+
message: 'form.error.number',
|
|
7
|
+
test: (value)=>{
|
|
8
|
+
if (void 0 === value) return true;
|
|
9
|
+
return validateNumber(value);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
export { NUMBER_VALIDATOR, validateNumber };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FieldSpec } from '
|
|
2
|
-
import type { ValidatorSchema } from '
|
|
1
|
+
import type { FieldSpec } from '../../types.js';
|
|
2
|
+
import type { ValidatorSchema } from '../types.js';
|
|
3
3
|
export declare function validateOtp(value: string, maxLength: number): boolean;
|
|
4
4
|
export declare const OTP_VALIDATOR: (field: FieldSpec) => ValidatorSchema;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function validateOtp(value, maxLength) {
|
|
2
|
+
if (value.length === maxLength) return true;
|
|
3
|
+
return false;
|
|
4
|
+
}
|
|
5
|
+
const OTP_VALIDATOR = (field)=>{
|
|
6
|
+
const maxLength = field?.maxLength;
|
|
7
|
+
return {
|
|
8
|
+
name: 'otp-validator',
|
|
9
|
+
message: {
|
|
10
|
+
key: 'form.error.otp.less_than',
|
|
11
|
+
context: {
|
|
12
|
+
maxLength: field?.maxLength
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
test: (value)=>{
|
|
16
|
+
if (!value) return true;
|
|
17
|
+
return validateOtp(value, maxLength);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export { OTP_VALIDATOR, validateOtp };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { FieldSpec } from '
|
|
2
|
-
import type { ValidatorSchema } from '
|
|
1
|
+
import type { FieldSpec } from '../../types.js';
|
|
2
|
+
import type { ValidatorSchema } from '../types.js';
|
|
3
3
|
export type PhoneNumberType = 'landline' | 'mobile' | null;
|
|
4
4
|
export declare function discoverPhoneType(phoneNumber: string, config: any): string;
|
|
5
5
|
export declare function validatePhoneNumber(phoneNumber: string, countries?: string[], typeOfPhoneNumber?: PhoneNumberType): boolean;
|