@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,10 +1,10 @@
|
|
|
1
|
-
import { TComponentOmitProps } from "../../frontend-engine";
|
|
2
|
-
import { IBaseFieldSchema } from "../types";
|
|
3
|
-
import { ToggleProps } from "@lifesg/react-design-system/toggle";
|
|
4
|
-
type TCustomOptions = {
|
|
5
|
-
border?: boolean | undefined;
|
|
6
|
-
};
|
|
7
|
-
export interface ISwitchSchema<V = undefined> extends IBaseFieldSchema<"switch", V>, TComponentOmitProps<ToggleProps> {
|
|
8
|
-
customOptions?: TCustomOptions | undefined;
|
|
9
|
-
}
|
|
10
|
-
export {};
|
|
1
|
+
import { TComponentOmitProps } from "../../frontend-engine";
|
|
2
|
+
import { IBaseFieldSchema } from "../types";
|
|
3
|
+
import { ToggleProps } from "@lifesg/react-design-system/toggle";
|
|
4
|
+
type TCustomOptions = {
|
|
5
|
+
border?: boolean | undefined;
|
|
6
|
+
};
|
|
7
|
+
export interface ISwitchSchema<V = undefined> extends IBaseFieldSchema<"switch", V>, TComponentOmitProps<ToggleProps> {
|
|
8
|
+
customOptions?: TCustomOptions | undefined;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./text-field";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export * from "./text-field";
|
|
2
|
+
export * from "./types";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IGenericFieldProps } from "..";
|
|
2
|
-
import { IEmailFieldSchema, INumericFieldSchema, ITextFieldSchema } from "./types";
|
|
3
|
-
export declare const TextField: (props: IGenericFieldProps<ITextFieldSchema | IEmailFieldSchema | INumericFieldSchema>) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { IGenericFieldProps } from "..";
|
|
2
|
+
import { IEmailFieldSchema, INumericFieldSchema, ITextFieldSchema } from "./types";
|
|
3
|
+
export declare const TextField: (props: IGenericFieldProps<ITextFieldSchema | IEmailFieldSchema | INumericFieldSchema>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { FormInputProps } from "@lifesg/react-design-system/form/types";
|
|
2
|
-
import { InputGroupAddonPosition } from "@lifesg/react-design-system/input-group";
|
|
3
|
-
import * as Icons from "@lifesg/react-icons";
|
|
4
|
-
import { IYupValidationRule, TComponentOmitProps } from "../../frontend-engine";
|
|
5
|
-
import { IBaseFieldSchema } from "../types";
|
|
6
|
-
type TCustomOptions = {
|
|
7
|
-
preventCopyAndPaste?: boolean | undefined;
|
|
8
|
-
preventDragAndDrop?: boolean | undefined;
|
|
9
|
-
addOn?: TIconAddOn | TLabelAddOn | undefined;
|
|
10
|
-
};
|
|
11
|
-
type TIconAddOn = {
|
|
12
|
-
type: "icon";
|
|
13
|
-
icon: keyof typeof Icons;
|
|
14
|
-
color?: string | undefined;
|
|
15
|
-
position?: InputGroupAddonPosition | undefined;
|
|
16
|
-
};
|
|
17
|
-
type TLabelAddOn = {
|
|
18
|
-
type: "label";
|
|
19
|
-
value: string;
|
|
20
|
-
position?: InputGroupAddonPosition | undefined;
|
|
21
|
-
};
|
|
22
|
-
export type TCustomOptionsText = TCustomOptions & {
|
|
23
|
-
textTransform?: "uppercase" | undefined;
|
|
24
|
-
};
|
|
25
|
-
export interface ITextFieldSchema<V = undefined> extends IBaseFieldSchema<"text-field", V>, TComponentOmitProps<FormInputProps, "type" | "maxLength"> {
|
|
26
|
-
customOptions?: TCustomOptionsText | undefined;
|
|
27
|
-
}
|
|
28
|
-
export interface IEmailFieldSchema<V = undefined> extends IBaseFieldSchema<"email-field", V>, TComponentOmitProps<FormInputProps, "type" | "maxLength"> {
|
|
29
|
-
customOptions?: TCustomOptions | undefined;
|
|
30
|
-
}
|
|
31
|
-
export interface INumericFieldValidationRule extends IYupValidationRule {
|
|
32
|
-
decimals?: number | undefined;
|
|
33
|
-
}
|
|
34
|
-
export interface INumericFieldSchema<V = undefined> extends IBaseFieldSchema<"numeric-field", V, INumericFieldValidationRule>, TComponentOmitProps<FormInputProps, "type" | "max" | "min"> {
|
|
35
|
-
customOptions?: TCustomOptions | undefined;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
|
1
|
+
import { FormInputProps } from "@lifesg/react-design-system/form/types";
|
|
2
|
+
import { InputGroupAddonPosition } from "@lifesg/react-design-system/input-group";
|
|
3
|
+
import * as Icons from "@lifesg/react-icons";
|
|
4
|
+
import { IYupValidationRule, TComponentOmitProps } from "../../frontend-engine";
|
|
5
|
+
import { IBaseFieldSchema } from "../types";
|
|
6
|
+
type TCustomOptions = {
|
|
7
|
+
preventCopyAndPaste?: boolean | undefined;
|
|
8
|
+
preventDragAndDrop?: boolean | undefined;
|
|
9
|
+
addOn?: TIconAddOn | TLabelAddOn | undefined;
|
|
10
|
+
};
|
|
11
|
+
type TIconAddOn = {
|
|
12
|
+
type: "icon";
|
|
13
|
+
icon: keyof typeof Icons;
|
|
14
|
+
color?: string | undefined;
|
|
15
|
+
position?: InputGroupAddonPosition | undefined;
|
|
16
|
+
};
|
|
17
|
+
type TLabelAddOn = {
|
|
18
|
+
type: "label";
|
|
19
|
+
value: string;
|
|
20
|
+
position?: InputGroupAddonPosition | undefined;
|
|
21
|
+
};
|
|
22
|
+
export type TCustomOptionsText = TCustomOptions & {
|
|
23
|
+
textTransform?: "uppercase" | undefined;
|
|
24
|
+
};
|
|
25
|
+
export interface ITextFieldSchema<V = undefined> extends IBaseFieldSchema<"text-field", V>, TComponentOmitProps<FormInputProps, "type" | "maxLength"> {
|
|
26
|
+
customOptions?: TCustomOptionsText | undefined;
|
|
27
|
+
}
|
|
28
|
+
export interface IEmailFieldSchema<V = undefined> extends IBaseFieldSchema<"email-field", V>, TComponentOmitProps<FormInputProps, "type" | "maxLength"> {
|
|
29
|
+
customOptions?: TCustomOptions | undefined;
|
|
30
|
+
}
|
|
31
|
+
export interface INumericFieldValidationRule extends IYupValidationRule {
|
|
32
|
+
decimals?: number | undefined;
|
|
33
|
+
}
|
|
34
|
+
export interface INumericFieldSchema<V = undefined> extends IBaseFieldSchema<"numeric-field", V, INumericFieldValidationRule>, TComponentOmitProps<FormInputProps, "type" | "max" | "min"> {
|
|
35
|
+
customOptions?: TCustomOptions | undefined;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./textarea";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export * from "./textarea";
|
|
2
|
+
export * from "./types";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IGenericFieldProps } from "../types";
|
|
2
|
-
import { ITextareaSchema } from "./types";
|
|
3
|
-
export declare const Textarea: (props: IGenericFieldProps<ITextareaSchema>) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { IGenericFieldProps } from "../types";
|
|
2
|
+
import { ITextareaSchema } from "./types";
|
|
3
|
+
export declare const Textarea: (props: IGenericFieldProps<ITextareaSchema>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export {};
|
|
1
|
+
interface ITextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
2
|
+
$resizable?: boolean | undefined;
|
|
3
|
+
}
|
|
4
|
+
export declare const Wrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$chipPosition"> & {
|
|
5
|
+
$chipPosition?: "top" | "bottom" | undefined;
|
|
6
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$chipPosition"> & {
|
|
7
|
+
$chipPosition?: "top" | "bottom" | undefined;
|
|
8
|
+
}, never>>> & string;
|
|
9
|
+
export declare const ChipContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$chipPosition"> & {
|
|
10
|
+
$chipPosition?: "top" | "bottom" | undefined;
|
|
11
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$chipPosition"> & {
|
|
12
|
+
$chipPosition?: "top" | "bottom" | undefined;
|
|
13
|
+
}, never>>> & string;
|
|
14
|
+
export declare const StyledTextarea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<Omit<import("@lifesg/react-design-system/form/types").FormTextareaProps & import("react").RefAttributes<HTMLTextAreaElement>, "ref"> & {
|
|
15
|
+
ref?: import("react").Ref<HTMLTextAreaElement>;
|
|
16
|
+
}, keyof ITextareaProps> & ITextareaProps, never> & Partial<Pick<import("styled-components").FastOmit<Omit<import("@lifesg/react-design-system/form/types").FormTextareaProps & import("react").RefAttributes<HTMLTextAreaElement>, "ref"> & {
|
|
17
|
+
ref?: import("react").Ref<HTMLTextAreaElement>;
|
|
18
|
+
}, keyof ITextareaProps> & ITextareaProps, never>>> & string & Omit<(props: import("@lifesg/react-design-system/form/types").FormTextareaProps & import("react").RefAttributes<HTMLTextAreaElement>) => React.ReactElement | null, keyof import("react").Component<any, {}, any>>;
|
|
19
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FormTextareaProps } from "@lifesg/react-design-system/form/types";
|
|
2
|
-
import { TComponentOmitProps } from "../../frontend-engine";
|
|
3
|
-
import { IBaseFieldSchema } from "../types";
|
|
4
|
-
export interface ITextareaSchema<V = undefined> extends IBaseFieldSchema<"textarea", V>, TComponentOmitProps<FormTextareaProps, "maxLength"> {
|
|
5
|
-
chipTexts?: string[] | undefined;
|
|
6
|
-
chipPosition?: "top" | "bottom" | undefined;
|
|
7
|
-
resizable?: boolean | undefined;
|
|
8
|
-
}
|
|
1
|
+
import { FormTextareaProps } from "@lifesg/react-design-system/form/types";
|
|
2
|
+
import { TComponentOmitProps } from "../../frontend-engine";
|
|
3
|
+
import { IBaseFieldSchema } from "../types";
|
|
4
|
+
export interface ITextareaSchema<V = undefined> extends IBaseFieldSchema<"textarea", V>, TComponentOmitProps<FormTextareaProps, "maxLength"> {
|
|
5
|
+
chipTexts?: string[] | undefined;
|
|
6
|
+
chipPosition?: "top" | "bottom" | undefined;
|
|
7
|
+
resizable?: boolean | undefined;
|
|
8
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./time-field";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export * from "./time-field";
|
|
2
|
+
export * from "./types";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IGenericFieldProps } from "..";
|
|
2
|
-
import { ITimeFieldSchema } from "./types";
|
|
3
|
-
export declare const TimeField: (props: IGenericFieldProps<ITimeFieldSchema>) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { IGenericFieldProps } from "..";
|
|
2
|
+
import { ITimeFieldSchema } from "./types";
|
|
3
|
+
export declare const TimeField: (props: IGenericFieldProps<ITimeFieldSchema>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TimepickerProps } from "@lifesg/react-design-system/timepicker";
|
|
2
|
-
import { TComponentOmitProps } from "../../frontend-engine";
|
|
3
|
-
import { IBaseFieldSchema } from "../types";
|
|
4
|
-
export interface ITimeFieldSchema<V = undefined> extends IBaseFieldSchema<"time-field", V>, TComponentOmitProps<TimepickerProps> {
|
|
5
|
-
useCurrentTime?: boolean | undefined;
|
|
6
|
-
is24HourFormat?: boolean | undefined;
|
|
7
|
-
}
|
|
1
|
+
import { TimepickerProps } from "@lifesg/react-design-system/timepicker";
|
|
2
|
+
import { TComponentOmitProps } from "../../frontend-engine";
|
|
3
|
+
import { IBaseFieldSchema } from "../types";
|
|
4
|
+
export interface ITimeFieldSchema<V = undefined> extends IBaseFieldSchema<"time-field", V>, TComponentOmitProps<TimepickerProps> {
|
|
5
|
+
useCurrentTime?: boolean | undefined;
|
|
6
|
+
is24HourFormat?: boolean | undefined;
|
|
7
|
+
}
|
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
import { FormLabelProps } from "@lifesg/react-design-system/form/types";
|
|
2
|
-
import { ControllerFieldState, ControllerRenderProps } from "react-hook-form";
|
|
3
|
-
import { IYupValidationRule, TRenderRules } from "../../context-providers";
|
|
4
|
-
import { IColumns, IV3Columns } from "../frontend-engine";
|
|
5
|
-
import { IButtonSchema, TButtonEvents } from "./button";
|
|
6
|
-
import { TCheckboxGroupSchema } from "./checkbox-group";
|
|
7
|
-
import { IChipsSchema } from "./chips";
|
|
8
|
-
import { IContactFieldSchema } from "./contact-field";
|
|
9
|
-
import { IDateFieldSchema } from "./date-field";
|
|
10
|
-
import { TDateRangeFieldSchema } from "./date-range-field";
|
|
11
|
-
import { IESignatureFieldSchema } from "./e-signature-field/types";
|
|
12
|
-
import { IOtpVerificationFieldSchema } from "./otp-verification-field";
|
|
13
|
-
import { IErrorFieldSchema } from "./error-field";
|
|
14
|
-
import { IFileUploadSchema, TFileUploadEvents } from "./file-upload";
|
|
15
|
-
import { THiddenFieldSchema } from "./hidden-field";
|
|
16
|
-
import { IHistogramSliderSchema } from "./histogram-slider";
|
|
17
|
-
import { IImageUploadSchema, TImageUploadEvents, TImageUploadTriggers } from "./image-upload";
|
|
18
|
-
import { ILocationFieldSchema, TLocationEvents, TLocationFieldTriggers } from "./location-field";
|
|
19
|
-
import { IMaskedFieldSchema } from "./masked-field";
|
|
20
|
-
import { IMultiSelectSchema } from "./multi-select";
|
|
21
|
-
import { INestedMultiSelectSchema } from "./nested-multi-select";
|
|
22
|
-
import { TRadioButtonGroupSchema } from "./radio-button";
|
|
23
|
-
import { IRangeSelectSchema } from "./range-select";
|
|
24
|
-
import { IResetButtonSchema } from "./reset-button";
|
|
25
|
-
import { ISelectSchema } from "./select";
|
|
26
|
-
import { ISelectHistogramSchema } from "./select-histogram/types";
|
|
27
|
-
import { ISliderSchema } from "./slider";
|
|
28
|
-
import { ISubmitButtonSchema } from "./submit-button";
|
|
29
|
-
import { ISwitchSchema } from "./switch";
|
|
30
|
-
import { IEmailFieldSchema, INumericFieldSchema, ITextFieldSchema } from "./text-field";
|
|
31
|
-
import { ITextareaSchema } from "./textarea";
|
|
32
|
-
import { ITimeFieldSchema } from "./time-field";
|
|
33
|
-
import { IUnitNumberFieldSchema } from "./unit-number-field";
|
|
34
|
-
import { TTabEvents } from "../elements";
|
|
35
|
-
/**
|
|
36
|
-
* field types
|
|
37
|
-
* - components that can contain values that can get submitted
|
|
38
|
-
* - comes with validation config
|
|
39
|
-
*/
|
|
40
|
-
export declare enum EFieldType {
|
|
41
|
-
BUTTON = "ButtonField",
|
|
42
|
-
CHECKBOX = "CheckboxGroup",
|
|
43
|
-
CHIPS = "Chips",
|
|
44
|
-
"CONTACT-FIELD" = "ContactField",
|
|
45
|
-
"DATE-FIELD" = "DateField",
|
|
46
|
-
"DATE-RANGE-FIELD" = "DateRangeField",
|
|
47
|
-
"EMAIL-FIELD" = "TextField",
|
|
48
|
-
"E-SIGNATURE-FIELD" = "ESignatureField",
|
|
49
|
-
"ERROR-FIELD" = "ErrorField",
|
|
50
|
-
"FILE-UPLOAD" = "FileUpload",
|
|
51
|
-
"HIDDEN-FIELD" = "HiddenField",
|
|
52
|
-
"HISTOGRAM-SLIDER" = "HistogramSlider",
|
|
53
|
-
"IMAGE-UPLOAD" = "ImageUpload",
|
|
54
|
-
"LOCATION-FIELD" = "LocationField",
|
|
55
|
-
"MASKED-FIELD" = "MaskedField",
|
|
56
|
-
"MULTI-SELECT" = "MultiSelect",
|
|
57
|
-
"NESTED-MULTI-SELECT" = "NestedMultiSelect",
|
|
58
|
-
"RANGE-SELECT" = "RangeSelect",
|
|
59
|
-
"NUMERIC-FIELD" = "TextField",
|
|
60
|
-
"OTP-VERIFICATION-FIELD" = "OtpVerificationField",
|
|
61
|
-
RADIO = "RadioButtonGroup",
|
|
62
|
-
RESET = "ResetButton",
|
|
63
|
-
SELECT = "Select",
|
|
64
|
-
"SELECT-HISTOGRAM" = "SelectHistogram",
|
|
65
|
-
SLIDER = "Slider",
|
|
66
|
-
SUBMIT = "SubmitButton",
|
|
67
|
-
SWITCH = "Switch",
|
|
68
|
-
TEXTAREA = "Textarea",
|
|
69
|
-
"TEXT-FIELD" = "TextField",
|
|
70
|
-
"TIME-FIELD" = "TimeField",
|
|
71
|
-
"UNIT-NUMBER-FIELD" = "UnitNumberField"
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* union type to represent all field schemas
|
|
75
|
-
*/
|
|
76
|
-
export type TFieldSchema<V = undefined, C = undefined> = IButtonSchema | IChipsSchema<V> | IContactFieldSchema<V> | IDateFieldSchema<V> | IEmailFieldSchema<V> | IESignatureFieldSchema<V> | IErrorFieldSchema | IFileUploadSchema<V> | THiddenFieldSchema<V> | IHistogramSliderSchema<V> | IImageUploadSchema<V> | ILocationFieldSchema<V> | IMaskedFieldSchema<V> | IMultiSelectSchema<V> | IRangeSelectSchema | INestedMultiSelectSchema<V> | INumericFieldSchema<V> | IOtpVerificationFieldSchema<V> | IResetButtonSchema | ISelectSchema<V> | ISelectHistogramSchema<V> | ISliderSchema<V> | ISubmitButtonSchema | ISwitchSchema<V> | ITextareaSchema<V> | ITextFieldSchema<V> | ITimeFieldSchema<V> | IUnitNumberFieldSchema<V> | TCheckboxGroupSchema<V, C> | TDateRangeFieldSchema<V> | TRadioButtonGroupSchema<V, C>;
|
|
77
|
-
/**
|
|
78
|
-
* intersection type to represent all field events
|
|
79
|
-
*/
|
|
80
|
-
export type TFieldEvents = TButtonEvents & TFileUploadEvents & TImageUploadEvents & TLocationEvents & TTabEvents;
|
|
81
|
-
/**
|
|
82
|
-
* intersection type to represent all field triggers
|
|
83
|
-
*/
|
|
84
|
-
export type TFieldTriggers = TImageUploadTriggers & TLocationFieldTriggers;
|
|
85
|
-
export interface IBaseFieldSchema<T, V = undefined, U = undefined> {
|
|
86
|
-
/** defines what kind of component to be rendered */
|
|
87
|
-
uiType: T;
|
|
88
|
-
/** caption for the field */
|
|
89
|
-
label: string | IComplexLabel;
|
|
90
|
-
/** render conditions
|
|
91
|
-
* - need to fulfil at least 1 object in array (OR condition)
|
|
92
|
-
* - in order for an object to be valid, need to fulfil all conditions in that object (AND condition) */
|
|
93
|
-
showIf?: TRenderRules[] | undefined;
|
|
94
|
-
/** validation config, can be customised by passing generics */
|
|
95
|
-
validation?: (V | U | IYupValidationRule<V, U>)[];
|
|
96
|
-
/** escape hatch for other form / frontend engines to have unsupported attributes */
|
|
97
|
-
customOptions?: Record<string, unknown> | undefined;
|
|
98
|
-
/** set responsive columns */
|
|
99
|
-
columns?: IColumns | IV3Columns | undefined;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* for displaying sub label and popover
|
|
103
|
-
*/
|
|
104
|
-
export interface IComplexLabel {
|
|
105
|
-
mainLabel: string;
|
|
106
|
-
subLabel?: string | undefined;
|
|
107
|
-
hint?: IComplexLabelHint | undefined;
|
|
108
|
-
}
|
|
109
|
-
interface IComplexLabelHint {
|
|
110
|
-
content: string;
|
|
111
|
-
zIndex?: number | undefined;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* common props for all fields
|
|
115
|
-
*/
|
|
116
|
-
export interface IGenericFieldProps<T> extends Partial<ControllerFieldState>, Partial<ControllerRenderProps> {
|
|
117
|
-
id: string;
|
|
118
|
-
formattedLabel?: string | FormLabelProps | undefined;
|
|
119
|
-
schema: T;
|
|
120
|
-
warning?: string | undefined;
|
|
121
|
-
}
|
|
122
|
-
export {};
|
|
1
|
+
import { FormLabelProps } from "@lifesg/react-design-system/form/types";
|
|
2
|
+
import { ControllerFieldState, ControllerRenderProps } from "react-hook-form";
|
|
3
|
+
import { IYupValidationRule, TRenderRules } from "../../context-providers";
|
|
4
|
+
import { IColumns, IV3Columns } from "../frontend-engine";
|
|
5
|
+
import { IButtonSchema, TButtonEvents } from "./button";
|
|
6
|
+
import { TCheckboxGroupSchema } from "./checkbox-group";
|
|
7
|
+
import { IChipsSchema } from "./chips";
|
|
8
|
+
import { IContactFieldSchema } from "./contact-field";
|
|
9
|
+
import { IDateFieldSchema } from "./date-field";
|
|
10
|
+
import { TDateRangeFieldSchema } from "./date-range-field";
|
|
11
|
+
import { IESignatureFieldSchema } from "./e-signature-field/types";
|
|
12
|
+
import { IOtpVerificationFieldSchema } from "./otp-verification-field";
|
|
13
|
+
import { IErrorFieldSchema } from "./error-field";
|
|
14
|
+
import { IFileUploadSchema, TFileUploadEvents } from "./file-upload";
|
|
15
|
+
import { THiddenFieldSchema } from "./hidden-field";
|
|
16
|
+
import { IHistogramSliderSchema } from "./histogram-slider";
|
|
17
|
+
import { IImageUploadSchema, TImageUploadEvents, TImageUploadTriggers } from "./image-upload";
|
|
18
|
+
import { ILocationFieldSchema, TLocationEvents, TLocationFieldTriggers } from "./location-field";
|
|
19
|
+
import { IMaskedFieldSchema } from "./masked-field";
|
|
20
|
+
import { IMultiSelectSchema } from "./multi-select";
|
|
21
|
+
import { INestedMultiSelectSchema } from "./nested-multi-select";
|
|
22
|
+
import { TRadioButtonGroupSchema } from "./radio-button";
|
|
23
|
+
import { IRangeSelectSchema } from "./range-select";
|
|
24
|
+
import { IResetButtonSchema } from "./reset-button";
|
|
25
|
+
import { ISelectSchema } from "./select";
|
|
26
|
+
import { ISelectHistogramSchema } from "./select-histogram/types";
|
|
27
|
+
import { ISliderSchema } from "./slider";
|
|
28
|
+
import { ISubmitButtonSchema } from "./submit-button";
|
|
29
|
+
import { ISwitchSchema } from "./switch";
|
|
30
|
+
import { IEmailFieldSchema, INumericFieldSchema, ITextFieldSchema } from "./text-field";
|
|
31
|
+
import { ITextareaSchema } from "./textarea";
|
|
32
|
+
import { ITimeFieldSchema } from "./time-field";
|
|
33
|
+
import { IUnitNumberFieldSchema } from "./unit-number-field";
|
|
34
|
+
import { TTabEvents } from "../elements";
|
|
35
|
+
/**
|
|
36
|
+
* field types
|
|
37
|
+
* - components that can contain values that can get submitted
|
|
38
|
+
* - comes with validation config
|
|
39
|
+
*/
|
|
40
|
+
export declare enum EFieldType {
|
|
41
|
+
BUTTON = "ButtonField",
|
|
42
|
+
CHECKBOX = "CheckboxGroup",
|
|
43
|
+
CHIPS = "Chips",
|
|
44
|
+
"CONTACT-FIELD" = "ContactField",
|
|
45
|
+
"DATE-FIELD" = "DateField",
|
|
46
|
+
"DATE-RANGE-FIELD" = "DateRangeField",
|
|
47
|
+
"EMAIL-FIELD" = "TextField",
|
|
48
|
+
"E-SIGNATURE-FIELD" = "ESignatureField",
|
|
49
|
+
"ERROR-FIELD" = "ErrorField",
|
|
50
|
+
"FILE-UPLOAD" = "FileUpload",
|
|
51
|
+
"HIDDEN-FIELD" = "HiddenField",
|
|
52
|
+
"HISTOGRAM-SLIDER" = "HistogramSlider",
|
|
53
|
+
"IMAGE-UPLOAD" = "ImageUpload",
|
|
54
|
+
"LOCATION-FIELD" = "LocationField",
|
|
55
|
+
"MASKED-FIELD" = "MaskedField",
|
|
56
|
+
"MULTI-SELECT" = "MultiSelect",
|
|
57
|
+
"NESTED-MULTI-SELECT" = "NestedMultiSelect",
|
|
58
|
+
"RANGE-SELECT" = "RangeSelect",
|
|
59
|
+
"NUMERIC-FIELD" = "TextField",
|
|
60
|
+
"OTP-VERIFICATION-FIELD" = "OtpVerificationField",
|
|
61
|
+
RADIO = "RadioButtonGroup",
|
|
62
|
+
RESET = "ResetButton",
|
|
63
|
+
SELECT = "Select",
|
|
64
|
+
"SELECT-HISTOGRAM" = "SelectHistogram",
|
|
65
|
+
SLIDER = "Slider",
|
|
66
|
+
SUBMIT = "SubmitButton",
|
|
67
|
+
SWITCH = "Switch",
|
|
68
|
+
TEXTAREA = "Textarea",
|
|
69
|
+
"TEXT-FIELD" = "TextField",
|
|
70
|
+
"TIME-FIELD" = "TimeField",
|
|
71
|
+
"UNIT-NUMBER-FIELD" = "UnitNumberField"
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* union type to represent all field schemas
|
|
75
|
+
*/
|
|
76
|
+
export type TFieldSchema<V = undefined, C = undefined> = IButtonSchema | IChipsSchema<V> | IContactFieldSchema<V> | IDateFieldSchema<V> | IEmailFieldSchema<V> | IESignatureFieldSchema<V> | IErrorFieldSchema | IFileUploadSchema<V> | THiddenFieldSchema<V> | IHistogramSliderSchema<V> | IImageUploadSchema<V> | ILocationFieldSchema<V> | IMaskedFieldSchema<V> | IMultiSelectSchema<V> | IRangeSelectSchema | INestedMultiSelectSchema<V> | INumericFieldSchema<V> | IOtpVerificationFieldSchema<V> | IResetButtonSchema | ISelectSchema<V> | ISelectHistogramSchema<V> | ISliderSchema<V> | ISubmitButtonSchema | ISwitchSchema<V> | ITextareaSchema<V> | ITextFieldSchema<V> | ITimeFieldSchema<V> | IUnitNumberFieldSchema<V> | TCheckboxGroupSchema<V, C> | TDateRangeFieldSchema<V> | TRadioButtonGroupSchema<V, C>;
|
|
77
|
+
/**
|
|
78
|
+
* intersection type to represent all field events
|
|
79
|
+
*/
|
|
80
|
+
export type TFieldEvents = TButtonEvents & TFileUploadEvents & TImageUploadEvents & TLocationEvents & TTabEvents;
|
|
81
|
+
/**
|
|
82
|
+
* intersection type to represent all field triggers
|
|
83
|
+
*/
|
|
84
|
+
export type TFieldTriggers = TImageUploadTriggers & TLocationFieldTriggers;
|
|
85
|
+
export interface IBaseFieldSchema<T, V = undefined, U = undefined> {
|
|
86
|
+
/** defines what kind of component to be rendered */
|
|
87
|
+
uiType: T;
|
|
88
|
+
/** caption for the field */
|
|
89
|
+
label: string | IComplexLabel;
|
|
90
|
+
/** render conditions
|
|
91
|
+
* - need to fulfil at least 1 object in array (OR condition)
|
|
92
|
+
* - in order for an object to be valid, need to fulfil all conditions in that object (AND condition) */
|
|
93
|
+
showIf?: TRenderRules[] | undefined;
|
|
94
|
+
/** validation config, can be customised by passing generics */
|
|
95
|
+
validation?: (V | U | IYupValidationRule<V, U>)[];
|
|
96
|
+
/** escape hatch for other form / frontend engines to have unsupported attributes */
|
|
97
|
+
customOptions?: Record<string, unknown> | undefined;
|
|
98
|
+
/** set responsive columns */
|
|
99
|
+
columns?: IColumns | IV3Columns | undefined;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* for displaying sub label and popover
|
|
103
|
+
*/
|
|
104
|
+
export interface IComplexLabel {
|
|
105
|
+
mainLabel: string;
|
|
106
|
+
subLabel?: string | undefined;
|
|
107
|
+
hint?: IComplexLabelHint | undefined;
|
|
108
|
+
}
|
|
109
|
+
interface IComplexLabelHint {
|
|
110
|
+
content: string;
|
|
111
|
+
zIndex?: number | undefined;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* common props for all fields
|
|
115
|
+
*/
|
|
116
|
+
export interface IGenericFieldProps<T> extends Partial<ControllerFieldState>, Partial<ControllerRenderProps> {
|
|
117
|
+
id: string;
|
|
118
|
+
formattedLabel?: string | FormLabelProps | undefined;
|
|
119
|
+
schema: T;
|
|
120
|
+
warning?: string | undefined;
|
|
121
|
+
}
|
|
122
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./unit-number-field";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export * from "./unit-number-field";
|
|
2
|
+
export * from "./types";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { UnitNumberInputProps } from "@lifesg/react-design-system/unit-number";
|
|
2
|
-
import { TComponentOmitProps } from "../../frontend-engine";
|
|
3
|
-
import { IBaseFieldSchema } from "../types";
|
|
4
|
-
export interface IUnitNumberFieldValidationRule {
|
|
5
|
-
unitNumberFormat?: boolean | undefined;
|
|
6
|
-
}
|
|
7
|
-
export interface IUnitNumberFieldSchema<V = undefined> extends IBaseFieldSchema<"unit-number-field", V, IUnitNumberFieldValidationRule>, TComponentOmitProps<UnitNumberInputProps> {
|
|
8
|
-
}
|
|
1
|
+
import { UnitNumberInputProps } from "@lifesg/react-design-system/unit-number";
|
|
2
|
+
import { TComponentOmitProps } from "../../frontend-engine";
|
|
3
|
+
import { IBaseFieldSchema } from "../types";
|
|
4
|
+
export interface IUnitNumberFieldValidationRule {
|
|
5
|
+
unitNumberFormat?: boolean | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface IUnitNumberFieldSchema<V = undefined> extends IBaseFieldSchema<"unit-number-field", V, IUnitNumberFieldValidationRule>, TComponentOmitProps<UnitNumberInputProps> {
|
|
8
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IGenericFieldProps } from "..";
|
|
2
|
-
import { IUnitNumberFieldSchema } from "./types";
|
|
3
|
-
export declare const UnitNumberField: (props: IGenericFieldProps<IUnitNumberFieldSchema>) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { IGenericFieldProps } from "..";
|
|
2
|
+
import { IUnitNumberFieldSchema } from "./types";
|
|
3
|
+
export declare const UnitNumberField: (props: IGenericFieldProps<IUnitNumberFieldSchema>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { ReactElement, Ref } from "react";
|
|
2
|
-
import { IYupValidationRule } from "../../context-providers";
|
|
3
|
-
import { TNoInfer } from "../../utils";
|
|
4
|
-
import { IFrontendEngineProps, IFrontendEngineRef } from "./types";
|
|
5
|
-
/**
|
|
6
|
-
* The one and only component needed to create your form
|
|
7
|
-
*
|
|
8
|
-
* Minimally you will need to set the `data` props which is the JSON schema to define the form
|
|
9
|
-
*
|
|
10
|
-
* Generics
|
|
11
|
-
* - V = custom validation types
|
|
12
|
-
* - C = custom component types
|
|
13
|
-
*/
|
|
14
|
-
export declare const FrontendEngine: <V = undefined, C = undefined>(props: IFrontendEngineProps<TNoInfer<V, IYupValidationRule
|
|
15
|
-
ref?: Ref<IFrontendEngineRef>;
|
|
16
|
-
}) => ReactElement;
|
|
17
|
-
/**
|
|
18
|
-
* casting as a function with generics as a way to define generics with forwardRef
|
|
19
|
-
* the generics are a way to set custom definition of Yup validation config
|
|
20
|
-
* `NoInfer` typing is to ensure validation config is either the default `IYupValidationRule` or explicitly typed
|
|
21
|
-
* this prevent inferring from the data props entered by devs
|
|
22
|
-
* can refer to `Add Custom Validation` story for more info
|
|
23
|
-
*/
|
|
1
|
+
import { ReactElement, Ref } from "react";
|
|
2
|
+
import { IYupValidationRule } from "../../context-providers";
|
|
3
|
+
import { TNoInfer } from "../../utils";
|
|
4
|
+
import { IFrontendEngineProps, IFrontendEngineRef } from "./types";
|
|
5
|
+
/**
|
|
6
|
+
* The one and only component needed to create your form
|
|
7
|
+
*
|
|
8
|
+
* Minimally you will need to set the `data` props which is the JSON schema to define the form
|
|
9
|
+
*
|
|
10
|
+
* Generics
|
|
11
|
+
* - V = custom validation types
|
|
12
|
+
* - C = custom component types
|
|
13
|
+
*/
|
|
14
|
+
export declare const FrontendEngine: <V = undefined, C = undefined>(props: IFrontendEngineProps<TNoInfer<V, IYupValidationRule>, C> & {
|
|
15
|
+
ref?: Ref<IFrontendEngineRef>;
|
|
16
|
+
}) => ReactElement;
|
|
17
|
+
/**
|
|
18
|
+
* casting as a function with generics as a way to define generics with forwardRef
|
|
19
|
+
* the generics are a way to set custom definition of Yup validation config
|
|
20
|
+
* `NoInfer` typing is to ensure validation config is either the default `IYupValidationRule` or explicitly typed
|
|
21
|
+
* this prevent inferring from the data props entered by devs
|
|
22
|
+
* can refer to `Add Custom Validation` story for more info
|
|
23
|
+
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./frontend-engine";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export * from "./frontend-engine";
|
|
2
|
+
export * from "./types";
|