@lifesg/web-frontend-engine 2.2.4 → 2.2.5
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/chunks/file-upload-manager.817b80cc.js +2 -0
- package/chunks/file-upload-manager.817b80cc.js.map +1 -0
- package/chunks/{index.ac3b6195.js → index.44b5e2a5.js} +10 -10
- package/chunks/{index.ac3b6195.js.map → index.44b5e2a5.js.map} +1 -1
- package/chunks/{index.a24b1857.js → index.51ad1607.js} +2 -2
- package/chunks/{index.a24b1857.js.map → index.51ad1607.js.map} +1 -1
- package/chunks/{index.8edac70b.js → index.f1de2e77.js} +2 -2
- package/chunks/{index.8edac70b.js.map → index.f1de2e77.js.map} +1 -1
- package/chunks/{location-modal.6475a4db.js → location-modal.1859f93a.js} +2 -2
- package/chunks/{location-modal.6475a4db.js.map → location-modal.1859f93a.js.map} +1 -1
- package/cjs/chunks/file-upload-manager.85af8429.js +2 -0
- package/cjs/chunks/file-upload-manager.85af8429.js.map +1 -0
- package/cjs/chunks/{index.d136a8bd.js → index.48f1a1f1.js} +2 -2
- package/cjs/chunks/{index.d136a8bd.js.map → index.48f1a1f1.js.map} +1 -1
- package/cjs/chunks/{index.6a929030.js → index.c2370225.js} +7 -7
- package/cjs/chunks/{index.6a929030.js.map → index.c2370225.js.map} +1 -1
- package/cjs/chunks/{index.6e0e20f7.js → index.efc005fc.js} +2 -2
- package/cjs/chunks/{index.6e0e20f7.js.map → index.efc005fc.js.map} +1 -1
- package/cjs/chunks/{location-modal.e5989ca3.js → location-modal.6885ccea.js} +2 -2
- package/cjs/chunks/{location-modal.e5989ca3.js.map → location-modal.6885ccea.js.map} +1 -1
- package/cjs/index.js +1 -1
- package/components/custom/array-field/array-field-element.d.ts +10 -11
- package/components/custom/array-field/array-field.d.ts +3 -3
- package/components/custom/array-field/array-field.styles.d.ts +22 -23
- package/components/custom/array-field/index.d.ts +2 -2
- package/components/custom/array-field/types.d.ts +39 -39
- package/components/custom/filter/filter/filter.d.ts +3 -3
- package/components/custom/filter/filter/types.d.ts +12 -12
- package/components/custom/filter/filter-checkbox/filter-checkbox.d.ts +3 -3
- package/components/custom/filter/filter-checkbox/types.d.ts +23 -23
- package/components/custom/filter/filter-helper.d.ts +8 -8
- package/components/custom/filter/filter-item/filter-item.d.ts +3 -3
- package/components/custom/filter/filter-item/types.d.ts +13 -13
- package/components/custom/filter/index.d.ts +3 -3
- package/components/custom/filter/types.d.ts +11 -11
- package/components/custom/iframe/iframe.d.ts +3 -3
- package/components/custom/iframe/index.d.ts +2 -2
- package/components/custom/iframe/types.d.ts +28 -29
- package/components/custom/index.d.ts +6 -6
- package/components/custom/review/index.d.ts +2 -2
- package/components/custom/review/review.d.ts +3 -3
- package/components/custom/review/review.styles.d.ts +12 -13
- package/components/custom/review/types.d.ts +60 -60
- package/components/custom/timeline/index.d.ts +2 -2
- package/components/custom/timeline/timeline.d.ts +3 -3
- package/components/custom/timeline/types.d.ts +19 -19
- package/components/custom/types.d.ts +87 -87
- package/components/elements/accordion/accordion.d.ts +6 -6
- package/components/elements/accordion/accordion.styles.d.ts +1 -2
- package/components/elements/accordion/index.d.ts +2 -2
- package/components/elements/accordion/types.d.ts +27 -27
- package/components/elements/alert/alert.d.ts +3 -3
- package/components/elements/alert/index.d.ts +2 -2
- package/components/elements/alert/types.d.ts +9 -10
- package/components/elements/divider/divider.d.ts +3 -3
- package/components/elements/divider/index.d.ts +2 -2
- package/components/elements/divider/types.d.ts +6 -6
- package/components/elements/grid/grid.d.ts +3 -3
- package/components/elements/grid/index.d.ts +2 -2
- package/components/elements/grid/types.d.ts +11 -11
- package/components/elements/index.d.ts +9 -9
- package/components/elements/list/data.d.ts +3 -3
- package/components/elements/list/index.d.ts +3 -3
- package/components/elements/list/list-item.d.ts +3 -3
- package/components/elements/list/list.d.ts +3 -3
- package/components/elements/list/types.d.ts +17 -17
- package/components/elements/popover/index.d.ts +2 -2
- package/components/elements/popover/popover.d.ts +3 -3
- package/components/elements/popover/types.d.ts +15 -15
- package/components/elements/section/index.d.ts +2 -2
- package/components/elements/section/section.d.ts +2 -2
- package/components/elements/section/section.styles.d.ts +11 -12
- package/components/elements/section/types.d.ts +16 -16
- package/components/elements/sections/index.d.ts +1 -1
- package/components/elements/sections/sections.d.ts +13 -13
- package/components/elements/tab/index.d.ts +2 -2
- package/components/elements/tab/tab.d.ts +3 -3
- package/components/elements/tab/types.d.ts +23 -23
- package/components/elements/text/data.d.ts +121 -122
- package/components/elements/text/index.d.ts +2 -2
- package/components/elements/text/text.d.ts +3 -3
- package/components/elements/text/types.d.ts +18 -18
- package/components/elements/types.d.ts +97 -97
- package/components/elements/wrapper/col-wrapper.d.ts +12 -12
- package/components/elements/wrapper/conditional-renderer.d.ts +16 -16
- package/components/elements/wrapper/field-wrapper.d.ts +9 -10
- package/components/elements/wrapper/index.d.ts +2 -2
- package/components/elements/wrapper/types.d.ts +29 -30
- package/components/elements/wrapper/wrapper.d.ts +2 -3
- package/components/fields/button/button.d.ts +3 -3
- package/components/fields/button/index.d.ts +2 -2
- package/components/fields/button/types.d.ts +17 -17
- package/components/fields/checkbox-group/checkbox-group.d.ts +3 -3
- package/components/fields/checkbox-group/checkbox-group.styles.d.ts +23 -24
- package/components/fields/checkbox-group/index.d.ts +2 -2
- package/components/fields/checkbox-group/types.d.ts +33 -33
- package/components/fields/chips/chips.d.ts +3 -3
- package/components/fields/chips/chips.styles.d.ts +5 -6
- package/components/fields/chips/index.d.ts +2 -2
- package/components/fields/chips/types.d.ts +18 -19
- package/components/fields/contact-field/contact-field.d.ts +3 -3
- package/components/fields/contact-field/data.d.ts +6 -6
- package/components/fields/contact-field/index.d.ts +2 -2
- package/components/fields/contact-field/types.d.ts +31 -31
- package/components/fields/contact-field/utils.d.ts +7 -7
- package/components/fields/date-field/date-field.d.ts +3 -3
- package/components/fields/date-field/index.d.ts +2 -2
- package/components/fields/date-field/types.d.ts +20 -20
- package/components/fields/date-range-field/date-range-field.d.ts +3 -3
- package/components/fields/date-range-field/index.d.ts +2 -2
- package/components/fields/date-range-field/types.d.ts +32 -32
- package/components/fields/e-signature-field/e-signature-field.d.ts +3 -3
- package/components/fields/e-signature-field/e-signature-field.styles.d.ts +4 -5
- package/components/fields/e-signature-field/index.d.ts +2 -2
- package/components/fields/e-signature-field/types.d.ts +22 -22
- package/components/fields/error-field/error-field.d.ts +3 -3
- package/components/fields/error-field/index.d.ts +2 -2
- package/components/fields/error-field/types.d.ts +11 -11
- package/components/fields/file-upload/file-upload-context.d.ts +14 -14
- package/components/fields/file-upload/file-upload-helper.d.ts +10 -10
- package/components/fields/file-upload/file-upload-manager.d.ts +14 -14
- package/components/fields/file-upload/file-upload.d.ts +4 -4
- package/components/fields/file-upload/index.d.ts +2 -2
- package/components/fields/file-upload/types.d.ts +78 -78
- package/components/fields/hidden-field/hidden-field.d.ts +3 -3
- package/components/fields/hidden-field/index.d.ts +2 -2
- package/components/fields/hidden-field/types.d.ts +29 -29
- package/components/fields/histogram-slider/histogram-slider.d.ts +3 -3
- package/components/fields/histogram-slider/index.d.ts +2 -2
- package/components/fields/histogram-slider/types.d.ts +20 -20
- package/components/fields/image-upload/image-context/image-context.d.ts +16 -16
- package/components/fields/image-upload/image-context/index.d.ts +1 -1
- package/components/fields/image-upload/image-input/drag-upload/drag-upload.d.ts +2 -3
- package/components/fields/image-upload/image-input/drag-upload/drag-upload.styles.d.ts +14 -15
- package/components/fields/image-upload/image-input/drag-upload/index.d.ts +2 -2
- package/components/fields/image-upload/image-input/drag-upload/types.d.ts +15 -16
- package/components/fields/image-upload/image-input/file-item/file-item.d.ts +11 -11
- package/components/fields/image-upload/image-input/file-item/file-item.styles.d.ts +48 -49
- package/components/fields/image-upload/image-input/file-item/index.d.ts +1 -1
- package/components/fields/image-upload/image-input/image-input.d.ts +26 -26
- package/components/fields/image-upload/image-input/image-input.styles.d.ts +47 -48
- package/components/fields/image-upload/image-input/index.d.ts +1 -1
- package/components/fields/image-upload/image-manager/image-manager.d.ts +25 -25
- package/components/fields/image-upload/image-manager/index.d.ts +2 -2
- package/components/fields/image-upload/image-review/image-editor/image-editor.d.ts +2 -3
- package/components/fields/image-upload/image-review/image-editor/image-editor.styles.d.ts +6 -7
- package/components/fields/image-upload/image-review/image-editor/index.d.ts +3 -3
- package/components/fields/image-upload/image-review/image-editor/types.d.ts +17 -17
- package/components/fields/image-upload/image-review/image-error/image-error.d.ts +10 -10
- package/components/fields/image-upload/image-review/image-error/image-error.styles.d.ts +31 -32
- package/components/fields/image-upload/image-review/image-error/index.d.ts +1 -1
- package/components/fields/image-upload/image-review/image-prompts/image-prompts.d.ts +11 -11
- package/components/fields/image-upload/image-review/image-prompts/index.d.ts +1 -1
- package/components/fields/image-upload/image-review/image-review.d.ts +18 -18
- package/components/fields/image-upload/image-review/image-review.styles.d.ts +128 -129
- package/components/fields/image-upload/image-review/image-thumbnails/image-thumbnails.d.ts +11 -11
- package/components/fields/image-upload/image-review/image-thumbnails/image-thumbnails.styles.d.ts +29 -30
- package/components/fields/image-upload/image-review/image-thumbnails/index.d.ts +1 -1
- package/components/fields/image-upload/image-review/index.d.ts +1 -1
- package/components/fields/image-upload/image-upload-helper.d.ts +12 -10
- package/components/fields/image-upload/image-upload.d.ts +4 -4
- package/components/fields/image-upload/index.d.ts +2 -2
- package/components/fields/image-upload/types.d.ts +151 -151
- package/components/fields/index.d.ts +30 -30
- package/components/fields/location-field/index.d.ts +2 -2
- package/components/fields/location-field/location-field.d.ts +3 -3
- package/components/fields/location-field/location-helper.d.ts +38 -39
- package/components/fields/location-field/location-input/dummy-location-field.d.ts +13 -14
- package/components/fields/location-field/location-input/index.d.ts +1 -1
- package/components/fields/location-field/location-input/location-input.d.ts +6 -7
- package/components/fields/location-field/location-input/location-input.styles.d.ts +22 -23
- package/components/fields/location-field/location-modal/infinite-scroll/index.d.ts +1 -1
- package/components/fields/location-field/location-modal/infinite-scroll/infinite-scroll.d.ts +11 -12
- package/components/fields/location-field/location-modal/infinite-scroll/infinite-scroll.style.d.ts +1 -2
- package/components/fields/location-field/location-modal/infinite-scroll/loading-indicator/config.d.ts +5 -5
- package/components/fields/location-field/location-modal/infinite-scroll/loading-indicator/index.d.ts +1 -1
- package/components/fields/location-field/location-modal/infinite-scroll/loading-indicator/loading-indicator.d.ts +5 -5
- package/components/fields/location-field/location-modal/infinite-scroll/loading-indicator/loading-indicator.styles.d.ts +2 -3
- package/components/fields/location-field/location-modal/location-modal.d.ts +8 -8
- package/components/fields/location-field/location-modal/location-modal.data.d.ts +3 -3
- package/components/fields/location-field/location-modal/location-modal.styles.d.ts +16 -17
- package/components/fields/location-field/location-modal/location-picker/helper.d.ts +4 -4
- package/components/fields/location-field/location-modal/location-picker/index.d.ts +1 -1
- package/components/fields/location-field/location-modal/location-picker/legend/index.d.ts +1 -1
- package/components/fields/location-field/location-modal/location-picker/legend/legend.d.ts +8 -8
- package/components/fields/location-field/location-modal/location-picker/legend/legend.styles.d.ts +10 -11
- package/components/fields/location-field/location-modal/location-picker/location-picker.d.ts +3 -3
- package/components/fields/location-field/location-modal/location-picker/location-picker.styles.d.ts +17 -18
- package/components/fields/location-field/location-modal/location-picker/types.d.ts +34 -35
- package/components/fields/location-field/location-modal/location-search/helper.d.ts +14 -14
- package/components/fields/location-field/location-modal/location-search/index.d.ts +1 -1
- package/components/fields/location-field/location-modal/location-search/location-search.d.ts +2 -2
- package/components/fields/location-field/location-modal/location-search/location-search.styles.d.ts +84 -85
- package/components/fields/location-field/location-modal/location-search/types.d.ts +30 -30
- package/components/fields/location-field/location-modal/no-network-modal/no-network-modal.d.ts +7 -7
- package/components/fields/location-field/location-modal/no-network-modal/no-network-modal.styles.d.ts +29 -30
- package/components/fields/location-field/location-modal/types.d.ts +18 -18
- package/components/fields/location-field/types.d.ts +163 -163
- package/components/fields/masked-field/index.d.ts +2 -2
- package/components/fields/masked-field/masked-field.d.ts +3 -3
- package/components/fields/masked-field/types.d.ts +12 -12
- package/components/fields/multi-select/index.d.ts +2 -2
- package/components/fields/multi-select/multi-select.d.ts +3 -3
- package/components/fields/multi-select/types.d.ts +9 -9
- package/components/fields/nested-multi-select/index.d.ts +2 -2
- package/components/fields/nested-multi-select/nested-multi-select.d.ts +3 -3
- package/components/fields/nested-multi-select/types.d.ts +33 -34
- package/components/fields/otp-verification-field/index.d.ts +2 -2
- package/components/fields/otp-verification-field/otp-verification-field.d.ts +3 -3
- package/components/fields/otp-verification-field/types.d.ts +46 -46
- package/components/fields/radio-button/index.d.ts +2 -2
- package/components/fields/radio-button/radio-button.d.ts +3 -3
- package/components/fields/radio-button/radio-button.styles.d.ts +29 -30
- package/components/fields/radio-button/types.d.ts +41 -41
- package/components/fields/range-select/index.d.ts +2 -2
- package/components/fields/range-select/range-select.d.ts +3 -3
- package/components/fields/range-select/types.d.ts +9 -9
- package/components/fields/reset-button/index.d.ts +2 -2
- package/components/fields/reset-button/reset-button.d.ts +3 -3
- package/components/fields/reset-button/types.d.ts +8 -8
- package/components/fields/select/index.d.ts +2 -2
- package/components/fields/select/select.d.ts +3 -3
- package/components/fields/select/types.d.ts +9 -9
- package/components/fields/select-histogram/index.d.ts +2 -2
- package/components/fields/select-histogram/select-histogram.d.ts +3 -3
- package/components/fields/select-histogram/types.d.ts +17 -17
- package/components/fields/slider/index.d.ts +2 -2
- package/components/fields/slider/slider.d.ts +3 -3
- package/components/fields/slider/types.d.ts +11 -11
- package/components/fields/submit-button/index.d.ts +2 -2
- package/components/fields/submit-button/submit-button.d.ts +3 -3
- package/components/fields/submit-button/types.d.ts +7 -7
- package/components/fields/switch/index.d.ts +2 -2
- package/components/fields/switch/switch.d.ts +3 -3
- package/components/fields/switch/switch.styles.d.ts +1 -2
- package/components/fields/switch/types.d.ts +10 -10
- package/components/fields/text-field/index.d.ts +2 -2
- package/components/fields/text-field/text-field.d.ts +3 -3
- package/components/fields/text-field/types.d.ts +37 -37
- package/components/fields/textarea/index.d.ts +2 -2
- package/components/fields/textarea/textarea.d.ts +3 -3
- package/components/fields/textarea/textarea.styles.d.ts +19 -20
- package/components/fields/textarea/types.d.ts +8 -8
- package/components/fields/time-field/index.d.ts +2 -2
- package/components/fields/time-field/time-field.d.ts +3 -3
- package/components/fields/time-field/types.d.ts +7 -7
- package/components/fields/types.d.ts +122 -122
- package/components/fields/unit-number-field/index.d.ts +2 -2
- package/components/fields/unit-number-field/types.d.ts +8 -8
- package/components/fields/unit-number-field/unit-number-field.d.ts +3 -3
- package/components/frontend-engine/frontend-engine.d.ts +23 -23
- package/components/frontend-engine/index.d.ts +2 -2
- package/components/frontend-engine/types.d.ts +213 -214
- package/components/frontend-engine/use-form-change.d.ts +12 -12
- package/components/index.d.ts +2 -2
- package/components/shared/chip/chip.d.ts +6 -6
- package/components/shared/chip/chip.styles.d.ts +16 -17
- package/components/shared/chip/index.d.ts +2 -2
- package/components/shared/chip/types.d.ts +4 -4
- package/components/shared/error-messages.d.ts +102 -102
- package/components/shared/index.d.ts +6 -6
- package/components/shared/prompt/index.d.ts +2 -2
- package/components/shared/prompt/prompt.d.ts +2 -2
- package/components/shared/prompt/prompt.styles.d.ts +40 -41
- package/components/shared/prompt/types.d.ts +16 -16
- package/components/shared/sanitize/index.d.ts +1 -1
- package/components/shared/sanitize/sanitize.d.ts +13 -14
- package/components/shared/static-map/index.d.ts +1 -1
- package/components/shared/static-map/static-map.d.ts +12 -12
- package/components/shared/static-map/static-map.styles.d.ts +12 -13
- package/components/shared/warning/index.d.ts +1 -1
- package/components/shared/warning/warning.d.ts +6 -6
- package/components/types.d.ts +4 -4
- package/context-providers/context-providers.d.ts +7 -7
- package/context-providers/custom-components/context-provider.d.ts +14 -14
- package/context-providers/custom-components/index.d.ts +1 -1
- package/context-providers/event/context-provider.d.ts +14 -14
- package/context-providers/event/index.d.ts +2 -2
- package/context-providers/event/types.d.ts +10 -10
- package/context-providers/form-schema/context-provider.d.ts +12 -12
- package/context-providers/form-schema/index.d.ts +1 -1
- package/context-providers/form-values/context-provider.d.ts +23 -23
- package/context-providers/form-values/index.d.ts +1 -1
- package/context-providers/frontend-engine-form/context-provider.d.ts +13 -13
- package/context-providers/frontend-engine-form/index.d.ts +1 -1
- package/context-providers/index.d.ts +7 -7
- package/context-providers/recaptcha/index.d.ts +3 -3
- package/context-providers/recaptcha/recaptcha-hook.d.ts +5 -5
- package/context-providers/recaptcha/recaptcha-provider.d.ts +10 -11
- package/context-providers/recaptcha/types.d.ts +14 -14
- package/context-providers/yup/context-provider.d.ts +16 -16
- package/context-providers/yup/custom-conditions/html-safe.d.ts +1 -1
- package/context-providers/yup/custom-conditions/index.d.ts +3 -3
- package/context-providers/yup/custom-conditions/uen.d.ts +1 -1
- package/context-providers/yup/custom-conditions/uinfin.d.ts +1 -1
- package/context-providers/yup/helper.d.ts +44 -44
- package/context-providers/yup/index.d.ts +4 -4
- package/context-providers/yup/types.d.ts +82 -82
- package/index.d.ts +3 -3
- package/index.js +1 -1
- package/package.json +1 -1
- package/services/index.d.ts +1 -1
- package/services/onemap/onemap-service.d.ts +21 -21
- package/services/onemap/types.d.ts +48 -48
- package/utils/api-client/api-client.d.ts +65 -65
- package/utils/api-client/index.d.ts +1 -1
- package/utils/date-time-helper.d.ts +22 -22
- package/utils/file-helper.d.ts +45 -47
- package/utils/geolocation-helper.d.ts +17 -17
- package/utils/hooks/index.d.ts +12 -12
- package/utils/hooks/use-custom-components.d.ts +5 -6
- package/utils/hooks/use-deep-layout-effect.d.ts +3 -3
- package/utils/hooks/use-field-event.d.ts +10 -10
- package/utils/hooks/use-form-schema.d.ts +6 -7
- package/utils/hooks/use-form-values.d.ts +11 -12
- package/utils/hooks/use-frontend-engine-component.d.ts +17 -17
- package/utils/hooks/use-frontend-engine-form.d.ts +6 -7
- package/utils/hooks/use-iframe-message.d.ts +5 -5
- package/utils/hooks/use-previous.d.ts +4 -4
- package/utils/hooks/use-validation-config.d.ts +10 -10
- package/utils/hooks/use-validation-schema.d.ts +15 -15
- package/utils/hooks/use-window-helper.d.ts +1 -1
- package/utils/id-helper.d.ts +1 -1
- package/utils/image-helper.d.ts +49 -49
- package/utils/index.d.ts +11 -11
- package/utils/math-helper.d.ts +5 -5
- package/utils/object-helper.d.ts +15 -15
- package/utils/prop-helper.d.ts +8 -8
- package/utils/test-helper.d.ts +4 -4
- package/utils/ts-helper.d.ts +1 -1
- package/utils/types.d.ts +9 -9
- package/chunks/file-upload-manager.ddb44c1f.js +0 -2
- package/chunks/file-upload-manager.ddb44c1f.js.map +0 -1
- package/cjs/chunks/file-upload-manager.b22d56d4.js +0 -2
- package/cjs/chunks/file-upload-manager.b22d56d4.js.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { Dispatch, MutableRefObject, ReactElement, SetStateAction } from "react";
|
|
2
|
-
interface IFormValuesContext {
|
|
3
|
-
formValues: Record<string, unknown>;
|
|
4
|
-
formValuesRef: MutableRefObject<Record<string, unknown>>;
|
|
5
|
-
setFormValues: Dispatch<SetStateAction<Record<string, unknown>>>;
|
|
6
|
-
registeredFields: string[];
|
|
7
|
-
setRegisteredFields: Dispatch<SetStateAction<string[]>>;
|
|
8
|
-
}
|
|
9
|
-
interface IProps {
|
|
10
|
-
children: ReactElement;
|
|
11
|
-
}
|
|
12
|
-
export declare const FormValuesContext: import("react").Context<IFormValuesContext>;
|
|
13
|
-
/**
|
|
14
|
-
* This context stores the form values in parallel to react-hook-form's state.
|
|
15
|
-
*
|
|
16
|
-
* The main difference is that it persists the values of fields that are currently conditionally hidden.
|
|
17
|
-
* Otherwise we won't be able to get their previous values (as the fields are unregistered from react-hook-form).
|
|
18
|
-
*
|
|
19
|
-
* This is used to populate the values of conditionally rendered fields when they are shown again.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
export declare const FormValuesProvider: ({ children }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export {};
|
|
1
|
+
import { Dispatch, MutableRefObject, ReactElement, SetStateAction } from "react";
|
|
2
|
+
interface IFormValuesContext {
|
|
3
|
+
formValues: Record<string, unknown>;
|
|
4
|
+
formValuesRef: MutableRefObject<Record<string, unknown>>;
|
|
5
|
+
setFormValues: Dispatch<SetStateAction<Record<string, unknown>>>;
|
|
6
|
+
registeredFields: string[];
|
|
7
|
+
setRegisteredFields: Dispatch<SetStateAction<string[]>>;
|
|
8
|
+
}
|
|
9
|
+
interface IProps {
|
|
10
|
+
children: ReactElement;
|
|
11
|
+
}
|
|
12
|
+
export declare const FormValuesContext: import("react").Context<IFormValuesContext>;
|
|
13
|
+
/**
|
|
14
|
+
* This context stores the form values in parallel to react-hook-form's state.
|
|
15
|
+
*
|
|
16
|
+
* The main difference is that it persists the values of fields that are currently conditionally hidden.
|
|
17
|
+
* Otherwise we won't be able to get their previous values (as the fields are unregistered from react-hook-form).
|
|
18
|
+
*
|
|
19
|
+
* This is used to populate the values of conditionally rendered fields when they are shown again.
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export declare const FormValuesProvider: ({ children }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./context-provider";
|
|
1
|
+
export * from "./context-provider";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Dispatch, ReactElement, SetStateAction } from "react";
|
|
2
|
-
interface IFrontendEngineFormContext {
|
|
3
|
-
submitHandler: () => void;
|
|
4
|
-
setSubmitHandler: Dispatch<SetStateAction<() => void>>;
|
|
5
|
-
wrapInForm: boolean;
|
|
6
|
-
setWrapInForm: Dispatch<SetStateAction<boolean>>;
|
|
7
|
-
}
|
|
8
|
-
interface IProps {
|
|
9
|
-
children: ReactElement;
|
|
10
|
-
}
|
|
11
|
-
export declare const FrontendEngineFormContext: import("react").Context<IFrontendEngineFormContext>;
|
|
12
|
-
export declare const FrontendEngineFormProvider: ({ children }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
1
|
+
import { Dispatch, ReactElement, SetStateAction } from "react";
|
|
2
|
+
interface IFrontendEngineFormContext {
|
|
3
|
+
submitHandler: () => void;
|
|
4
|
+
setSubmitHandler: Dispatch<SetStateAction<() => void>>;
|
|
5
|
+
wrapInForm: boolean;
|
|
6
|
+
setWrapInForm: Dispatch<SetStateAction<boolean>>;
|
|
7
|
+
}
|
|
8
|
+
interface IProps {
|
|
9
|
+
children: ReactElement;
|
|
10
|
+
}
|
|
11
|
+
export declare const FrontendEngineFormContext: import("react").Context<IFrontendEngineFormContext>;
|
|
12
|
+
export declare const FrontendEngineFormProvider: ({ children }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./context-provider";
|
|
1
|
+
export * from "./context-provider";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from "./context-providers";
|
|
2
|
-
export * from "./custom-components";
|
|
3
|
-
export * from "./event";
|
|
4
|
-
export * from "./form-schema";
|
|
5
|
-
export * from "./form-values";
|
|
6
|
-
export * from "./frontend-engine-form";
|
|
7
|
-
export * from "./yup";
|
|
1
|
+
export * from "./context-providers";
|
|
2
|
+
export * from "./custom-components";
|
|
3
|
+
export * from "./event";
|
|
4
|
+
export * from "./form-schema";
|
|
5
|
+
export * from "./form-values";
|
|
6
|
+
export * from "./frontend-engine-form";
|
|
7
|
+
export * from "./yup";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./recaptcha-hook";
|
|
2
|
-
export * from "./recaptcha-provider";
|
|
3
|
-
export * from "./types";
|
|
1
|
+
export * from "./recaptcha-hook";
|
|
2
|
+
export * from "./recaptcha-provider";
|
|
3
|
+
export * from "./types";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const useRecaptcha: () => {
|
|
2
|
-
loaded: boolean;
|
|
3
|
-
isRecaptchaReady: boolean;
|
|
4
|
-
getToken: (action?: string) => Promise<string>;
|
|
5
|
-
};
|
|
1
|
+
export declare const useRecaptcha: () => {
|
|
2
|
+
loaded: boolean;
|
|
3
|
+
isRecaptchaReady: boolean;
|
|
4
|
+
getToken: (action?: string) => Promise<string | undefined>;
|
|
5
|
+
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
export
|
|
11
|
-
export {};
|
|
1
|
+
import { IRecaptchaContext, IRecaptchaState, TRecaptchaActions } from "./types";
|
|
2
|
+
export declare const RecaptchaContext: import("react").Context<IRecaptchaContext>;
|
|
3
|
+
export declare const recaptchaStateReducer: (state: IRecaptchaState, action: TRecaptchaActions) => IRecaptchaState;
|
|
4
|
+
interface IRecaptchaProviderProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** reCAPTCHA v3 Enterprise site key. When omitted the provider is a no-op. */
|
|
7
|
+
recaptchaSiteKey?: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare const RecaptchaProvider: ({ children, recaptchaSiteKey }: IRecaptchaProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Dispatch } from "react";
|
|
2
|
-
export interface IRecaptchaState {
|
|
3
|
-
loaded: boolean;
|
|
4
|
-
}
|
|
5
|
-
export interface IRecaptchaContext {
|
|
6
|
-
recaptchaState: IRecaptchaState;
|
|
7
|
-
isRecaptchaReady: boolean;
|
|
8
|
-
dispatch: Dispatch<TRecaptchaActions>;
|
|
9
|
-
getToken: (action?: string) => Promise<string | undefined>;
|
|
10
|
-
}
|
|
11
|
-
export type TRecaptchaActions = ISetRecaptchaLoadedAction;
|
|
12
|
-
export interface ISetRecaptchaLoadedAction {
|
|
13
|
-
type: "set-recaptcha-loaded";
|
|
14
|
-
}
|
|
1
|
+
import { Dispatch } from "react";
|
|
2
|
+
export interface IRecaptchaState {
|
|
3
|
+
loaded: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface IRecaptchaContext {
|
|
6
|
+
recaptchaState: IRecaptchaState;
|
|
7
|
+
isRecaptchaReady: boolean;
|
|
8
|
+
dispatch: Dispatch<TRecaptchaActions>;
|
|
9
|
+
getToken: (action?: string) => Promise<string | undefined>;
|
|
10
|
+
}
|
|
11
|
+
export type TRecaptchaActions = ISetRecaptchaLoadedAction;
|
|
12
|
+
export interface ISetRecaptchaLoadedAction {
|
|
13
|
+
type: "set-recaptcha-loaded";
|
|
14
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Dispatch, ReactElement, SetStateAction } from "react";
|
|
2
|
-
import { TFormYupConfig } from "./types";
|
|
3
|
-
import { TWarningPayload } from "../../components/frontend-engine";
|
|
4
|
-
interface IYupContext {
|
|
5
|
-
formValidationConfig: TFormYupConfig;
|
|
6
|
-
setFormValidationConfig: Dispatch<SetStateAction<TFormYupConfig>>;
|
|
7
|
-
warnings: TWarningPayload;
|
|
8
|
-
setWarnings: Dispatch<SetStateAction<TWarningPayload>>;
|
|
9
|
-
yupId: string;
|
|
10
|
-
}
|
|
11
|
-
interface IProps {
|
|
12
|
-
children: ReactElement;
|
|
13
|
-
}
|
|
14
|
-
export declare const YupContext: import("react").Context<IYupContext>;
|
|
15
|
-
export declare const YupProvider: ({ children }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export {};
|
|
1
|
+
import { Dispatch, ReactElement, SetStateAction } from "react";
|
|
2
|
+
import { TFormYupConfig } from "./types";
|
|
3
|
+
import { TWarningPayload } from "../../components/frontend-engine";
|
|
4
|
+
interface IYupContext {
|
|
5
|
+
formValidationConfig: TFormYupConfig;
|
|
6
|
+
setFormValidationConfig: Dispatch<SetStateAction<TFormYupConfig>>;
|
|
7
|
+
warnings: TWarningPayload;
|
|
8
|
+
setWarnings: Dispatch<SetStateAction<TWarningPayload>>;
|
|
9
|
+
yupId: string;
|
|
10
|
+
}
|
|
11
|
+
interface IProps {
|
|
12
|
+
children: ReactElement;
|
|
13
|
+
}
|
|
14
|
+
export declare const YupContext: import("react").Context<IYupContext>;
|
|
15
|
+
export declare const YupProvider: ({ children }: IProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./html-safe";
|
|
2
|
-
import "./uinfin";
|
|
3
|
-
import "./uen";
|
|
1
|
+
import "./html-safe";
|
|
2
|
+
import "./uinfin";
|
|
3
|
+
import "./uen";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import * as Yup from "yup";
|
|
2
|
-
import { ObjectShape } from "yup/lib/object";
|
|
3
|
-
import { IYupRenderRule, IYupValidationRule, TCustomValidationFunction, TFormYupConfig, TYupSchemaType } from "./types";
|
|
4
|
-
interface IYupCombinedRule extends IYupRenderRule, IYupValidationRule {
|
|
5
|
-
}
|
|
6
|
-
export declare namespace YupHelper {
|
|
7
|
-
/**
|
|
8
|
-
* Constructs the entire Yup schema for frontend engine to use
|
|
9
|
-
* @param yupSchemaConfig JSON representation of the eventual Yup schema
|
|
10
|
-
* @param yupId Optionally assign an id to the schema for custom validation
|
|
11
|
-
* @returns Yup schema ready to be used by FrontendEngine
|
|
12
|
-
*/
|
|
13
|
-
const buildSchema: (yupSchemaConfig: TFormYupConfig, yupId?: string | undefined) => Yup.ObjectSchema<ObjectShape>;
|
|
14
|
-
/**
|
|
15
|
-
* Creates a yupSchema for a given field
|
|
16
|
-
* @param yupSchemaField Yup schema for individual field
|
|
17
|
-
* @param fieldValidationConfig JSON representation of the Yup schema
|
|
18
|
-
* @returns yupSchema corresponding to the specified validations and constraints
|
|
19
|
-
*/
|
|
20
|
-
const buildFieldSchema: (yupSchemaField: Yup.AnySchema, fieldValidationConfig: IYupCombinedRule[]) => Yup.AnySchema;
|
|
21
|
-
/**
|
|
22
|
-
* Initialises a Yup schema according to the type provided
|
|
23
|
-
* @param type The schema type
|
|
24
|
-
* @returns yupSchema that corresponds to the validation type
|
|
25
|
-
*/
|
|
26
|
-
const mapSchemaType: (type: TYupSchemaType) => import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>> | Yup.StringSchema<string, import("yup/lib/types").AnyObject, string> | Yup.NumberSchema<number, import("yup/lib/types").AnyObject, number> | Yup.BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean> | import("yup/lib/array").OptionalArraySchema<Yup.AnySchema
|
|
27
|
-
/**
|
|
28
|
-
* Adds Yup validation and constraints based on specified rules
|
|
29
|
-
* @param yupSchema Yup schema that was previously created from specified validation type
|
|
30
|
-
* @param schemaRules An array of validation rules to be mapped against validation type (e.g. a string schema might contain { maxLength: 255 })
|
|
31
|
-
* @returns yupSchema with added constraints and validations
|
|
32
|
-
*/
|
|
33
|
-
const mapRules: <V extends IYupCombinedRule>(yupSchema: Yup.AnySchema, schemaRules: V[]) => Yup.AnySchema;
|
|
34
|
-
/**
|
|
35
|
-
* Declare custom Yup schema condition
|
|
36
|
-
* @param type The schema type
|
|
37
|
-
* @param name Name of the condition
|
|
38
|
-
* @param fn Validation function, it must return a boolean
|
|
39
|
-
* @param yupId Assign the custom condition to a specific schema
|
|
40
|
-
* @param overwrite Whether to replace if the custom validation is already exists
|
|
41
|
-
*/
|
|
42
|
-
const addCondition: (type: TYupSchemaType | "mixed", name: string, fn: TCustomValidationFunction, yupId?: string | undefined, overwrite?: boolean) => void;
|
|
43
|
-
}
|
|
44
|
-
export {};
|
|
1
|
+
import * as Yup from "yup";
|
|
2
|
+
import { ObjectShape } from "yup/lib/object";
|
|
3
|
+
import { IYupRenderRule, IYupValidationRule, TCustomValidationFunction, TFormYupConfig, TYupSchemaType } from "./types";
|
|
4
|
+
interface IYupCombinedRule extends IYupRenderRule, IYupValidationRule {
|
|
5
|
+
}
|
|
6
|
+
export declare namespace YupHelper {
|
|
7
|
+
/**
|
|
8
|
+
* Constructs the entire Yup schema for frontend engine to use
|
|
9
|
+
* @param yupSchemaConfig JSON representation of the eventual Yup schema
|
|
10
|
+
* @param yupId Optionally assign an id to the schema for custom validation
|
|
11
|
+
* @returns Yup schema ready to be used by FrontendEngine
|
|
12
|
+
*/
|
|
13
|
+
const buildSchema: (yupSchemaConfig: TFormYupConfig, yupId?: string | undefined) => Yup.ObjectSchema<ObjectShape>;
|
|
14
|
+
/**
|
|
15
|
+
* Creates a yupSchema for a given field
|
|
16
|
+
* @param yupSchemaField Yup schema for individual field
|
|
17
|
+
* @param fieldValidationConfig JSON representation of the Yup schema
|
|
18
|
+
* @returns yupSchema corresponding to the specified validations and constraints
|
|
19
|
+
*/
|
|
20
|
+
const buildFieldSchema: (yupSchemaField: Yup.AnySchema, fieldValidationConfig: IYupCombinedRule[]) => Yup.AnySchema;
|
|
21
|
+
/**
|
|
22
|
+
* Initialises a Yup schema according to the type provided
|
|
23
|
+
* @param type The schema type
|
|
24
|
+
* @returns yupSchema that corresponds to the validation type
|
|
25
|
+
*/
|
|
26
|
+
const mapSchemaType: (type: TYupSchemaType) => import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>> | Yup.StringSchema<string, import("yup/lib/types").AnyObject, string> | Yup.NumberSchema<number, import("yup/lib/types").AnyObject, number> | Yup.BooleanSchema<boolean, import("yup/lib/types").AnyObject, boolean> | import("yup/lib/array").OptionalArraySchema<Yup.AnySchema, import("yup/lib/types").AnyObject, any[]> | import("yup/lib/mixed").MixedSchema<any, import("yup/lib/types").AnyObject, any>;
|
|
27
|
+
/**
|
|
28
|
+
* Adds Yup validation and constraints based on specified rules
|
|
29
|
+
* @param yupSchema Yup schema that was previously created from specified validation type
|
|
30
|
+
* @param schemaRules An array of validation rules to be mapped against validation type (e.g. a string schema might contain { maxLength: 255 })
|
|
31
|
+
* @returns yupSchema with added constraints and validations
|
|
32
|
+
*/
|
|
33
|
+
const mapRules: <V extends IYupCombinedRule>(yupSchema: Yup.AnySchema, schemaRules: V[]) => Yup.AnySchema;
|
|
34
|
+
/**
|
|
35
|
+
* Declare custom Yup schema condition
|
|
36
|
+
* @param type The schema type
|
|
37
|
+
* @param name Name of the condition
|
|
38
|
+
* @param fn Validation function, it must return a boolean
|
|
39
|
+
* @param yupId Assign the custom condition to a specific schema
|
|
40
|
+
* @param overwrite Whether to replace if the custom validation is already exists
|
|
41
|
+
*/
|
|
42
|
+
const addCondition: (type: TYupSchemaType | "mixed", name: string, fn: TCustomValidationFunction, yupId?: string | undefined, overwrite?: boolean) => void;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./context-provider";
|
|
2
|
-
export * from "./helper";
|
|
3
|
-
export * from "./types";
|
|
4
|
-
import "./custom-conditions";
|
|
1
|
+
export * from "./context-provider";
|
|
2
|
+
export * from "./helper";
|
|
3
|
+
export * from "./types";
|
|
4
|
+
import "./custom-conditions";
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
import * as Yup from "yup";
|
|
2
|
-
export declare const YUP_TYPES: readonly ["string", "number", "boolean", "array", "object"];
|
|
3
|
-
export declare const YUP_CONDITIONS: readonly ["required", "length", "min", "max", "matches", "email", "url", "uuid", "positive", "negative", "integer", "lessThan", "moreThan", "when", "filled", "empty", "equals", "notEquals", "includes", "excludes", "uinfin", "equalsField", "withinDays", "htmlSafe"];
|
|
4
|
-
export type TYupSchemaType = (typeof YUP_TYPES)[number];
|
|
5
|
-
export type TYupCondition = (typeof YUP_CONDITIONS)[number];
|
|
6
|
-
interface IYupRule {
|
|
7
|
-
length?: number | undefined;
|
|
8
|
-
min?: number | undefined;
|
|
9
|
-
max?: number | undefined;
|
|
10
|
-
matches?: string | undefined;
|
|
11
|
-
notMatches?: string | undefined;
|
|
12
|
-
email?: boolean | undefined;
|
|
13
|
-
url?: boolean | undefined;
|
|
14
|
-
uuid?: boolean | undefined;
|
|
15
|
-
positive?: boolean | undefined;
|
|
16
|
-
negative?: boolean | undefined;
|
|
17
|
-
integer?: boolean | undefined;
|
|
18
|
-
lessThan?: number | undefined;
|
|
19
|
-
moreThan?: number | undefined;
|
|
20
|
-
empty?: boolean | undefined;
|
|
21
|
-
equals?: unknown | undefined;
|
|
22
|
-
notEquals?: unknown | undefined;
|
|
23
|
-
includes?: unknown | undefined;
|
|
24
|
-
excludes?: unknown | undefined;
|
|
25
|
-
uinfin?: boolean | undefined;
|
|
26
|
-
uen?: boolean | undefined;
|
|
27
|
-
equalsField?: string | undefined;
|
|
28
|
-
notEqualsField?: string | undefined;
|
|
29
|
-
whitespace?: boolean | IWhitespaceRule | undefined;
|
|
30
|
-
htmlSafe?: boolean | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated Use `whitespace` rule instead.
|
|
33
|
-
*/
|
|
34
|
-
noWhitespaceOnly?: boolean | undefined;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* V and U generics are needed here to be passed into `then` and `otherwise` conditional validation
|
|
38
|
-
* `V` - custom validation rules
|
|
39
|
-
* `U` - custom validation rules defined by components, for internal use, prevents getting overwritten by custom validation rules
|
|
40
|
-
*/
|
|
41
|
-
export interface IYupValidationRule<V = undefined, U = undefined> extends IYupRule {
|
|
42
|
-
required?: boolean | undefined;
|
|
43
|
-
when?: {
|
|
44
|
-
[id: string]: {
|
|
45
|
-
is: string | number | boolean | string[] | number[] | boolean[] | IYupConditionalValidationRule[];
|
|
46
|
-
then: (IYupValidationRule<V, U> | V | U)[];
|
|
47
|
-
otherwise?: (Omit<IYupValidationRule<V, U>, "when"> | V | U)[];
|
|
48
|
-
yupSchema?: Yup.AnySchema | undefined;
|
|
49
|
-
};
|
|
50
|
-
} | undefined;
|
|
51
|
-
errorMessage?: string | undefined;
|
|
52
|
-
soft?: boolean | undefined;
|
|
53
|
-
}
|
|
54
|
-
export interface IYupConditionalValidationRule extends IYupRule {
|
|
55
|
-
filled?: boolean | undefined;
|
|
56
|
-
}
|
|
57
|
-
export interface IYupRenderRule extends IYupRule {
|
|
58
|
-
filled?: boolean | undefined;
|
|
59
|
-
shown?: boolean | undefined;
|
|
60
|
-
withinDays?: IWithinDaysRangeRule | undefined;
|
|
61
|
-
beyondDays?: IDaysRangeRule | undefined;
|
|
62
|
-
}
|
|
63
|
-
export type TRenderRules = Record<string, IYupRenderRule[]>;
|
|
64
|
-
export interface IFieldYupConfig {
|
|
65
|
-
schema: Yup.AnySchema;
|
|
66
|
-
validationRules: IYupValidationRule[];
|
|
67
|
-
}
|
|
68
|
-
export type TFormYupConfig = Record<string, IFieldYupConfig>;
|
|
69
|
-
export type TCustomValidationFunction = (value: unknown, arg: unknown, context: Yup.TestContext) => boolean;
|
|
70
|
-
export interface IDaysRangeRule {
|
|
71
|
-
numberOfDays: number;
|
|
72
|
-
fromDate?: string | undefined;
|
|
73
|
-
dateFormat?: string | undefined;
|
|
74
|
-
}
|
|
75
|
-
export interface IWithinDaysRangeRule extends IDaysRangeRule {
|
|
76
|
-
/** inclusive of today (or `fromDate` if specified). defaults to false, meaning today will fail validation */
|
|
77
|
-
inclusive?: boolean;
|
|
78
|
-
}
|
|
79
|
-
export interface IWhitespaceRule {
|
|
80
|
-
noLeadingOrTrailingWhitespace?: boolean | undefined;
|
|
81
|
-
}
|
|
82
|
-
export {};
|
|
1
|
+
import * as Yup from "yup";
|
|
2
|
+
export declare const YUP_TYPES: readonly ["string", "number", "boolean", "array", "object"];
|
|
3
|
+
export declare const YUP_CONDITIONS: readonly ["required", "length", "min", "max", "matches", "email", "url", "uuid", "positive", "negative", "integer", "lessThan", "moreThan", "when", "filled", "empty", "equals", "notEquals", "includes", "excludes", "uinfin", "equalsField", "withinDays", "htmlSafe"];
|
|
4
|
+
export type TYupSchemaType = (typeof YUP_TYPES)[number];
|
|
5
|
+
export type TYupCondition = (typeof YUP_CONDITIONS)[number];
|
|
6
|
+
interface IYupRule {
|
|
7
|
+
length?: number | undefined;
|
|
8
|
+
min?: number | undefined;
|
|
9
|
+
max?: number | undefined;
|
|
10
|
+
matches?: string | undefined;
|
|
11
|
+
notMatches?: string | undefined;
|
|
12
|
+
email?: boolean | undefined;
|
|
13
|
+
url?: boolean | undefined;
|
|
14
|
+
uuid?: boolean | undefined;
|
|
15
|
+
positive?: boolean | undefined;
|
|
16
|
+
negative?: boolean | undefined;
|
|
17
|
+
integer?: boolean | undefined;
|
|
18
|
+
lessThan?: number | undefined;
|
|
19
|
+
moreThan?: number | undefined;
|
|
20
|
+
empty?: boolean | undefined;
|
|
21
|
+
equals?: unknown | undefined;
|
|
22
|
+
notEquals?: unknown | undefined;
|
|
23
|
+
includes?: unknown | undefined;
|
|
24
|
+
excludes?: unknown | undefined;
|
|
25
|
+
uinfin?: boolean | undefined;
|
|
26
|
+
uen?: boolean | undefined;
|
|
27
|
+
equalsField?: string | undefined;
|
|
28
|
+
notEqualsField?: string | undefined;
|
|
29
|
+
whitespace?: boolean | IWhitespaceRule | undefined;
|
|
30
|
+
htmlSafe?: boolean | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use `whitespace` rule instead.
|
|
33
|
+
*/
|
|
34
|
+
noWhitespaceOnly?: boolean | undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* V and U generics are needed here to be passed into `then` and `otherwise` conditional validation
|
|
38
|
+
* `V` - custom validation rules
|
|
39
|
+
* `U` - custom validation rules defined by components, for internal use, prevents getting overwritten by custom validation rules
|
|
40
|
+
*/
|
|
41
|
+
export interface IYupValidationRule<V = undefined, U = undefined> extends IYupRule {
|
|
42
|
+
required?: boolean | undefined;
|
|
43
|
+
when?: {
|
|
44
|
+
[id: string]: {
|
|
45
|
+
is: string | number | boolean | string[] | number[] | boolean[] | IYupConditionalValidationRule[];
|
|
46
|
+
then: (IYupValidationRule<V, U> | V | U)[];
|
|
47
|
+
otherwise?: (Omit<IYupValidationRule<V, U>, "when"> | V | U)[];
|
|
48
|
+
yupSchema?: Yup.AnySchema | undefined;
|
|
49
|
+
};
|
|
50
|
+
} | undefined;
|
|
51
|
+
errorMessage?: string | undefined;
|
|
52
|
+
soft?: boolean | undefined;
|
|
53
|
+
}
|
|
54
|
+
export interface IYupConditionalValidationRule extends IYupRule {
|
|
55
|
+
filled?: boolean | undefined;
|
|
56
|
+
}
|
|
57
|
+
export interface IYupRenderRule extends IYupRule {
|
|
58
|
+
filled?: boolean | undefined;
|
|
59
|
+
shown?: boolean | undefined;
|
|
60
|
+
withinDays?: IWithinDaysRangeRule | undefined;
|
|
61
|
+
beyondDays?: IDaysRangeRule | undefined;
|
|
62
|
+
}
|
|
63
|
+
export type TRenderRules = Record<string, IYupRenderRule[]>;
|
|
64
|
+
export interface IFieldYupConfig {
|
|
65
|
+
schema: Yup.AnySchema;
|
|
66
|
+
validationRules: IYupValidationRule[];
|
|
67
|
+
}
|
|
68
|
+
export type TFormYupConfig = Record<string, IFieldYupConfig>;
|
|
69
|
+
export type TCustomValidationFunction = (value: unknown, arg: unknown, context: Yup.TestContext) => boolean;
|
|
70
|
+
export interface IDaysRangeRule {
|
|
71
|
+
numberOfDays: number;
|
|
72
|
+
fromDate?: string | undefined;
|
|
73
|
+
dateFormat?: string | undefined;
|
|
74
|
+
}
|
|
75
|
+
export interface IWithinDaysRangeRule extends IDaysRangeRule {
|
|
76
|
+
/** inclusive of today (or `fromDate` if specified). defaults to false, meaning today will fail validation */
|
|
77
|
+
inclusive?: boolean;
|
|
78
|
+
}
|
|
79
|
+
export interface IWhitespaceRule {
|
|
80
|
+
noLeadingOrTrailingWhitespace?: boolean | undefined;
|
|
81
|
+
}
|
|
82
|
+
export {};
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./components";
|
|
2
|
-
export { useFrontendEngineComponent } from "./utils/hooks";
|
|
3
|
-
export type { TCustomComponent } from "./context-providers";
|
|
1
|
+
export * from "./components";
|
|
2
|
+
export { useFrontendEngineComponent } from "./utils/hooks";
|
|
3
|
+
export type { TCustomComponent } from "./context-providers";
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{p as EElementType,q as EFieldType,o as FrontendEngine,n as useFrontendEngineComponent}from"./chunks/index.
|
|
1
|
+
export{p as EElementType,q as EFieldType,o as FrontendEngine,n as useFrontendEngineComponent}from"./chunks/index.44b5e2a5.js";import"react/jsx-runtime";import"@lifesg/react-design-system/box-container";import"@lifesg/react-design-system/button";import"react";import"@lifesg/react-design-system/theme";import"styled-components";import"@lifesg/react-design-system/alert";import"@lifesg/react-design-system/typography";import"@lifesg/react-icons";import"@lifesg/react-icons/plus-circle-fill";import"@lifesg/react-design-system/markup";import"react-dom/server";import"@lifesg/react-design-system/filter";import"@lifesg/react-design-system/timeline";import"@lifesg/react-design-system/form";import"@lifesg/react-icons/exclamation-circle-fill";import"@lifesg/react-design-system/toggle";import"@lifesg/react-design-system/layout";import"@lifesg/react-design-system/v2_layout";import"@lifesg/react-design-system/text-list";import"@lifesg/react-design-system/popover-v2";import"@lifesg/react-design-system/tab";import"@lifesg/react-design-system/modal";import"@lifesg/react-design-system/divider";import"@lifesg/react-design-system/v2_media";import"@lifesg/react-design-system/button-with-icon";import"@lifesg/react-design-system/error-display";import"@lifesg/react-design-system/uneditable-section";import"@lifesg/react-design-system/checkbox";import"@lifesg/react-design-system/file-upload";import"@lifesg/react-icons/cross";import"@lifesg/react-design-system/icon-button";import"@lifesg/react-icons/bin";import"@lifesg/react-icons/eraser";import"@lifesg/react-icons/pencil";import"@lifesg/react-icons/pencil-stroke";import"@lifesg/react-icons/plus";import"@lifesg/react-icons/exclamation-triangle";import"@lifesg/react-icons/pin-fill";import"@lifesg/react-design-system/image-button";import"@lifesg/react-design-system/radio-button";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
package/services/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./onemap/onemap-service";
|
|
1
|
+
export * from "./onemap/onemap-service";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { IColor, OneMapBoolean, OneMapGeocodeInfo, OneMapSearchParam, OneMapSearchResults } from "./types";
|
|
2
|
-
type TReverseGeocodeParams = {
|
|
3
|
-
route: string;
|
|
4
|
-
latitude: number;
|
|
5
|
-
longitude: number;
|
|
6
|
-
abortSignal?: AbortSignal;
|
|
7
|
-
bufferRadius?: number;
|
|
8
|
-
otherFeatures?: OneMapBoolean;
|
|
9
|
-
recaptchaToken?: string;
|
|
10
|
-
headers?: Record<string, string>;
|
|
11
|
-
};
|
|
12
|
-
export declare const OneMapService: {
|
|
13
|
-
reverseGeocode: ({ route, latitude, longitude, abortSignal, bufferRadius, otherFeatures, recaptchaToken, headers, }: TReverseGeocodeParams) => Promise<OneMapGeocodeInfo[]>;
|
|
14
|
-
searchByAddress: (param: OneMapSearchParam, route?: string, recaptchaToken?: string, headers?: Record<string, string>) => Promise<OneMapSearchResults>;
|
|
15
|
-
convertLatLngToXY: (route: string, latitude: number, longitude: number, recaptchaToken?: string, headers?: Record<string, string>) => Promise<{
|
|
16
|
-
X: number;
|
|
17
|
-
Y: number;
|
|
18
|
-
}>;
|
|
19
|
-
getStaticMapUrl: (lat: number, lng: number, width: number, height: number, pinColor: IColor) => string;
|
|
20
|
-
};
|
|
21
|
-
export {};
|
|
1
|
+
import { IColor, OneMapBoolean, OneMapGeocodeInfo, OneMapSearchParam, OneMapSearchResults } from "./types";
|
|
2
|
+
type TReverseGeocodeParams = {
|
|
3
|
+
route: string;
|
|
4
|
+
latitude: number;
|
|
5
|
+
longitude: number;
|
|
6
|
+
abortSignal?: AbortSignal;
|
|
7
|
+
bufferRadius?: number;
|
|
8
|
+
otherFeatures?: OneMapBoolean;
|
|
9
|
+
recaptchaToken?: string;
|
|
10
|
+
headers?: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
export declare const OneMapService: {
|
|
13
|
+
reverseGeocode: ({ route, latitude, longitude, abortSignal, bufferRadius, otherFeatures, recaptchaToken, headers, }: TReverseGeocodeParams) => Promise<OneMapGeocodeInfo[]>;
|
|
14
|
+
searchByAddress: (param: OneMapSearchParam, route?: string, recaptchaToken?: string, headers?: Record<string, string>) => Promise<OneMapSearchResults>;
|
|
15
|
+
convertLatLngToXY: (route: string, latitude: number, longitude: number, recaptchaToken?: string, headers?: Record<string, string>) => Promise<{
|
|
16
|
+
X: number;
|
|
17
|
+
Y: number;
|
|
18
|
+
}>;
|
|
19
|
+
getStaticMapUrl: (lat: number, lng: number, width: number, height: number, pinColor: IColor) => string;
|
|
20
|
+
};
|
|
21
|
+
export {};
|