@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,30 +1,30 @@
|
|
|
1
|
-
import { ILocationCoord, ILocationFieldValues, ILocationMapApi, TExplicitEditMode, TPanelInputMode, TSinglePanelInputMode } from "../../types";
|
|
2
|
-
import { IMapPin } from "../location-picker/types";
|
|
3
|
-
export interface ILocationSearchProps {
|
|
4
|
-
id?: string | undefined;
|
|
5
|
-
className: string;
|
|
6
|
-
onCancel: () => void;
|
|
7
|
-
onConfirm: () => void;
|
|
8
|
-
panelInputMode: TPanelInputMode;
|
|
9
|
-
addressFieldPlaceholder?: string | undefined;
|
|
10
|
-
gettingCurrentLocation: boolean;
|
|
11
|
-
gettingCurrentLocationFetchMessage?: string | undefined;
|
|
12
|
-
locationListTitle?: string | undefined;
|
|
13
|
-
selectedAddressInfo: ILocationFieldValues;
|
|
14
|
-
onChangeSelectedAddressInfo: (addressInfo: ILocationFieldValues) => void;
|
|
15
|
-
handleApiErrors: (error: any) => void;
|
|
16
|
-
mustHavePostalCode?: boolean | undefined;
|
|
17
|
-
mapApi?: ILocationMapApi | undefined;
|
|
18
|
-
onGetLocationCallback: (lat?: number | undefined, lng?: number | undefined) => void;
|
|
19
|
-
showLocationModal: boolean;
|
|
20
|
-
mapPickedLatLng?: ILocationCoord | undefined;
|
|
21
|
-
formValues?: ILocationFieldValues | undefined;
|
|
22
|
-
updateFormValues: (values: ILocationFieldValues, shouldDirty?: boolean) => void;
|
|
23
|
-
setSinglePanelMode: (panelMode: TSinglePanelInputMode) => void;
|
|
24
|
-
hasExplicitEdit?: TExplicitEditMode | undefined;
|
|
25
|
-
restrictLocationSelection?: boolean | undefined;
|
|
26
|
-
selectablePins: IMapPin[];
|
|
27
|
-
disableSearch?: "disabled" | "readonly" | undefined;
|
|
28
|
-
searchBarIcon?: "search" | "location-pin";
|
|
29
|
-
bufferRadius?: number | undefined;
|
|
30
|
-
}
|
|
1
|
+
import { ILocationCoord, ILocationFieldValues, ILocationMapApi, TExplicitEditMode, TPanelInputMode, TSinglePanelInputMode } from "../../types";
|
|
2
|
+
import { IMapPin } from "../location-picker/types";
|
|
3
|
+
export interface ILocationSearchProps {
|
|
4
|
+
id?: string | undefined;
|
|
5
|
+
className: string;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
onConfirm: () => void;
|
|
8
|
+
panelInputMode: TPanelInputMode;
|
|
9
|
+
addressFieldPlaceholder?: string | undefined;
|
|
10
|
+
gettingCurrentLocation: boolean;
|
|
11
|
+
gettingCurrentLocationFetchMessage?: string | undefined;
|
|
12
|
+
locationListTitle?: string | undefined;
|
|
13
|
+
selectedAddressInfo: ILocationFieldValues;
|
|
14
|
+
onChangeSelectedAddressInfo: (addressInfo: ILocationFieldValues) => void;
|
|
15
|
+
handleApiErrors: (error: any) => void;
|
|
16
|
+
mustHavePostalCode?: boolean | undefined;
|
|
17
|
+
mapApi?: ILocationMapApi | undefined;
|
|
18
|
+
onGetLocationCallback: (lat?: number | undefined, lng?: number | undefined) => void;
|
|
19
|
+
showLocationModal: boolean;
|
|
20
|
+
mapPickedLatLng?: ILocationCoord | undefined;
|
|
21
|
+
formValues?: ILocationFieldValues | undefined;
|
|
22
|
+
updateFormValues: (values: ILocationFieldValues, shouldDirty?: boolean) => void;
|
|
23
|
+
setSinglePanelMode: (panelMode: TSinglePanelInputMode) => void;
|
|
24
|
+
hasExplicitEdit?: TExplicitEditMode | undefined;
|
|
25
|
+
restrictLocationSelection?: boolean | undefined;
|
|
26
|
+
selectablePins: IMapPin[];
|
|
27
|
+
disableSearch?: "disabled" | "readonly" | undefined;
|
|
28
|
+
searchBarIcon?: "search" | "location-pin";
|
|
29
|
+
bufferRadius?: number | undefined;
|
|
30
|
+
}
|
package/components/fields/location-field/location-modal/no-network-modal/no-network-modal.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
interface INoNetworkModal {
|
|
2
|
-
id: string;
|
|
3
|
-
cachedImage: string;
|
|
4
|
-
refreshNetwork: () => void;
|
|
5
|
-
}
|
|
6
|
-
declare const NoNetworkModal: ({ id, cachedImage, refreshNetwork }: INoNetworkModal) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export default NoNetworkModal;
|
|
1
|
+
interface INoNetworkModal {
|
|
2
|
+
id: string;
|
|
3
|
+
cachedImage: string;
|
|
4
|
+
refreshNetwork: () => void;
|
|
5
|
+
}
|
|
6
|
+
declare const NoNetworkModal: ({ id, cachedImage, refreshNetwork }: INoNetworkModal) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default NoNetworkModal;
|
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}, never>>> & string & Omit<(props: import("@lifesg/react-design-system/button").ButtonProps & import("react").RefAttributes<HTMLButtonElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>, keyof import("react").Component<any, {}, any>>;
|
|
1
|
+
export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
2
|
+
export declare const Image: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>>> & string;
|
|
3
|
+
export declare const ContentTitle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("@lifesg/react-design-system").TypographyProps & {
|
|
4
|
+
ref?: import("react").RefObject<HTMLParagraphElement> | undefined;
|
|
5
|
+
} & {
|
|
6
|
+
as?: import("styled-components").WebTarget;
|
|
7
|
+
forwardedAs?: import("styled-components").WebTarget;
|
|
8
|
+
}, never> & Partial<Pick<import("@lifesg/react-design-system").TypographyProps & {
|
|
9
|
+
ref?: import("react").RefObject<HTMLParagraphElement> | undefined;
|
|
10
|
+
} & {
|
|
11
|
+
as?: import("styled-components").WebTarget;
|
|
12
|
+
forwardedAs?: import("styled-components").WebTarget;
|
|
13
|
+
}, never>>> & string;
|
|
14
|
+
export declare const ContentBody: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("@lifesg/react-design-system").TypographyProps & {
|
|
15
|
+
ref?: import("react").RefObject<HTMLParagraphElement> | undefined;
|
|
16
|
+
} & {
|
|
17
|
+
as?: import("styled-components").WebTarget;
|
|
18
|
+
forwardedAs?: import("styled-components").WebTarget;
|
|
19
|
+
}, never> & Partial<Pick<import("@lifesg/react-design-system").TypographyProps & {
|
|
20
|
+
ref?: import("react").RefObject<HTMLParagraphElement> | undefined;
|
|
21
|
+
} & {
|
|
22
|
+
as?: import("styled-components").WebTarget;
|
|
23
|
+
forwardedAs?: import("styled-components").WebTarget;
|
|
24
|
+
}, never>>> & string;
|
|
25
|
+
export declare const ButtonWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("@lifesg/react-design-system").ButtonProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
26
|
+
ref?: import("react").Ref<HTMLButtonElement>;
|
|
27
|
+
}, never> & Partial<Pick<Omit<import("@lifesg/react-design-system").ButtonProps & import("react").RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
28
|
+
ref?: import("react").Ref<HTMLButtonElement>;
|
|
29
|
+
}, never>>> & string & Omit<(props: import("@lifesg/react-design-system").ButtonProps & React.RefAttributes<HTMLButtonElement>) => React.ReactElement | null, keyof import("react").Component<any, {}, any>>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ILocationCoord, ILocationFieldValues } from "../types";
|
|
2
|
-
import { ILocationPickerProps } from "./location-picker/types";
|
|
3
|
-
import { ILocationSearchProps } from "./location-search/types";
|
|
4
|
-
export interface ILocationModalProps extends Pick<ILocationPickerProps, "mapPanZoom" | "interactiveMapPinIconUrl" | "legendItems">, Pick<ILocationSearchProps, "mapApi" | "mustHavePostalCode" | "gettingCurrentLocationFetchMessage" | "disableSearch" | "addressFieldPlaceholder" | "searchBarIcon" | "bufferRadius"> {
|
|
5
|
-
id: string;
|
|
6
|
-
className: string;
|
|
7
|
-
showLocationModal: boolean;
|
|
8
|
-
formValues?: ILocationFieldValues | undefined;
|
|
9
|
-
locationModalStyles?: string | undefined;
|
|
10
|
-
onClose: () => void;
|
|
11
|
-
onConfirm: (values: ILocationFieldValues) => void;
|
|
12
|
-
updateFormValues: (values: ILocationFieldValues, shouldDirty?: boolean) => void;
|
|
13
|
-
locationListTitle?: string | undefined;
|
|
14
|
-
mapBannerText?: string | undefined;
|
|
15
|
-
locationSelectionMode?: "default" | "pins-only" | undefined;
|
|
16
|
-
pinsOnlyIndicateCurrentLocation?: boolean | undefined;
|
|
17
|
-
defaultAddress?: ILocationCoord | undefined;
|
|
18
|
-
}
|
|
1
|
+
import { ILocationCoord, ILocationFieldValues } from "../types";
|
|
2
|
+
import { ILocationPickerProps } from "./location-picker/types";
|
|
3
|
+
import { ILocationSearchProps } from "./location-search/types";
|
|
4
|
+
export interface ILocationModalProps extends Pick<ILocationPickerProps, "mapPanZoom" | "interactiveMapPinIconUrl" | "legendItems">, Pick<ILocationSearchProps, "mapApi" | "mustHavePostalCode" | "gettingCurrentLocationFetchMessage" | "disableSearch" | "addressFieldPlaceholder" | "searchBarIcon" | "bufferRadius"> {
|
|
5
|
+
id: string;
|
|
6
|
+
className: string;
|
|
7
|
+
showLocationModal: boolean;
|
|
8
|
+
formValues?: ILocationFieldValues | undefined;
|
|
9
|
+
locationModalStyles?: string | undefined;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
onConfirm: (values: ILocationFieldValues) => void;
|
|
12
|
+
updateFormValues: (values: ILocationFieldValues, shouldDirty?: boolean) => void;
|
|
13
|
+
locationListTitle?: string | undefined;
|
|
14
|
+
mapBannerText?: string | undefined;
|
|
15
|
+
locationSelectionMode?: "default" | "pins-only" | undefined;
|
|
16
|
+
pinsOnlyIndicateCurrentLocation?: boolean | undefined;
|
|
17
|
+
defaultAddress?: ILocationCoord | undefined;
|
|
18
|
+
}
|
|
@@ -1,163 +1,163 @@
|
|
|
1
|
-
import { TFieldEventListener } from "../../../utils";
|
|
2
|
-
import { IYupValidationRule } from "../../frontend-engine";
|
|
3
|
-
import { IStaticMapProps } from "../../shared";
|
|
4
|
-
import { IBaseFieldSchema } from "../types";
|
|
5
|
-
import { ILocationInputProps } from "./location-input";
|
|
6
|
-
import { ILocationPickerProps, IMapPin } from "./location-modal/location-picker/types";
|
|
7
|
-
import { ILocationSearchProps } from "./location-modal/location-search/types";
|
|
8
|
-
import { ILocationModalProps } from "./location-modal/types";
|
|
9
|
-
export interface ILocationFieldValidation extends IYupValidationRule {
|
|
10
|
-
postalCode?: boolean | undefined;
|
|
11
|
-
}
|
|
12
|
-
export interface ILegendItem {
|
|
13
|
-
id: string;
|
|
14
|
-
label: string;
|
|
15
|
-
icon: string;
|
|
16
|
-
}
|
|
17
|
-
export interface ILocationMapApi {
|
|
18
|
-
reverseGeocode?: string | undefined;
|
|
19
|
-
convertLatLngToXY?: string | undefined;
|
|
20
|
-
search?: string | undefined;
|
|
21
|
-
headers?: Record<string, string> | undefined;
|
|
22
|
-
}
|
|
23
|
-
export interface ILocationFieldSchema<V = undefined> extends IBaseFieldSchema<"location-field", V, ILocationFieldValidation>, Pick<ILocationPickerProps, "interactiveMapPinIconUrl" | "mapPanZoom">, Pick<ILocationSearchProps, "mapApi" | "mustHavePostalCode" | "gettingCurrentLocationFetchMessage" | "hasExplicitEdit" | "disableSearch" | "addressFieldPlaceholder" | "searchBarIcon" | "bufferRadius">, Pick<ILocationInputProps, "locationInputPlaceholder" | "disabled" | "readOnly">, Pick<IStaticMapProps, "staticMapPinColor">, Pick<ILocationModalProps, "locationSelectionMode"> {
|
|
24
|
-
className?: string;
|
|
25
|
-
locationModalStyles?: string | undefined;
|
|
26
|
-
locationListTitle?: string | undefined;
|
|
27
|
-
mapBannerText?: string | undefined;
|
|
28
|
-
pinsOnlyIndicateCurrentLocation?: boolean | undefined;
|
|
29
|
-
legendItems?: ILegendItem[] | undefined;
|
|
30
|
-
defaultAddress?: ILocationCoord | undefined;
|
|
31
|
-
}
|
|
32
|
-
export type TSinglePanelInputMode = "search" | "map";
|
|
33
|
-
export type TExplicitEditMode = "show" | "explicit";
|
|
34
|
-
export type TPanelInputMode = "search" | "map" | "double";
|
|
35
|
-
export interface ILocationFieldValues {
|
|
36
|
-
address?: string | undefined;
|
|
37
|
-
blockNo?: string | undefined;
|
|
38
|
-
building?: string | undefined;
|
|
39
|
-
postalCode?: string | undefined;
|
|
40
|
-
roadName?: string | undefined;
|
|
41
|
-
lat?: number | undefined;
|
|
42
|
-
lng?: number | undefined;
|
|
43
|
-
x?: number | undefined;
|
|
44
|
-
y?: number | undefined;
|
|
45
|
-
}
|
|
46
|
-
export interface ILocationCoord {
|
|
47
|
-
lat: number;
|
|
48
|
-
lng: number;
|
|
49
|
-
}
|
|
50
|
-
export interface IResultListItem extends ILocationFieldValues {
|
|
51
|
-
displayAddressText?: string | undefined;
|
|
52
|
-
}
|
|
53
|
-
export interface IResultsMetaData {
|
|
54
|
-
results: IResultListItem[];
|
|
55
|
-
apiPageNum?: number | undefined;
|
|
56
|
-
totalNumPages?: number | undefined;
|
|
57
|
-
}
|
|
58
|
-
export interface IDisplayResultListParams extends IResultsMetaData {
|
|
59
|
-
queryString?: string | undefined;
|
|
60
|
-
boldResults?: boolean | undefined;
|
|
61
|
-
}
|
|
62
|
-
export type TErrorType = {
|
|
63
|
-
errorType: "OneMapError" | "GetLocationError" | "GetLocationTimeoutError" | "PostalCodeError";
|
|
64
|
-
};
|
|
65
|
-
export interface TLocationFieldDetail<T = unknown> {
|
|
66
|
-
payload?: T | undefined;
|
|
67
|
-
errors?: any | undefined;
|
|
68
|
-
}
|
|
69
|
-
export type TSetCurrentLocationDetail = TLocationFieldDetail<ILocationCoord>;
|
|
70
|
-
export type TLocationFieldErrorDetail = TLocationFieldDetail<TErrorType>;
|
|
71
|
-
export type TLocationFieldEvents = {
|
|
72
|
-
"show-location-modal-ready": CustomEvent;
|
|
73
|
-
"get-current-location": CustomEvent;
|
|
74
|
-
"set-current-location": CustomEvent<TSetCurrentLocationDetail>;
|
|
75
|
-
error: CustomEvent<TLocationFieldErrorDetail>;
|
|
76
|
-
"error-end": CustomEvent<TLocationFieldErrorDetail>;
|
|
77
|
-
"set-selectable-pins": CustomEvent<{
|
|
78
|
-
pins: IMapPin[];
|
|
79
|
-
}>;
|
|
80
|
-
};
|
|
81
|
-
export declare class GeolocationPositionErrorWrapper extends Error {
|
|
82
|
-
code: any;
|
|
83
|
-
message: any;
|
|
84
|
-
constructor(error: GeolocationPositionError);
|
|
85
|
-
}
|
|
86
|
-
/** fired after the location field registers the `show-location-modal` event listener and is ready for external triggers */
|
|
87
|
-
declare function locationFieldEvent(uiType: "location-field", type: "show-location-modal-ready", id: string, listener: TFieldEventListener, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
88
|
-
/** fired on showing location modal */
|
|
89
|
-
declare function locationFieldEvent(uiType: "location-field", type: "show-location-modal", id: string, listener: TFieldEventListener, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
90
|
-
/** fired on dismissing location modal */
|
|
91
|
-
declare function locationFieldEvent(uiType: "location-field", type: "hide-location-modal", id: string, listener: TFieldEventListener, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
92
|
-
/**
|
|
93
|
-
* fired on clicking edit button (edit button is only render with `hasExplicitEdit:true` and if a location is selected)
|
|
94
|
-
*
|
|
95
|
-
* `event.preventDefault()` will stop location modal from being shown
|
|
96
|
-
* */
|
|
97
|
-
declare function locationFieldEvent(uiType: "location-field", type: "click-edit-button", id: string, listener: TFieldEventListener, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
98
|
-
/**
|
|
99
|
-
* fired immediately on clicking refresh current location button in location picker
|
|
100
|
-
*
|
|
101
|
-
* `event.preventDefault()` will prevent the search copy from being updated and stop the retrieval of current location
|
|
102
|
-
*
|
|
103
|
-
* Note: if event is prevented, dispatch `trigger-get-current-location` to resume logic
|
|
104
|
-
* */
|
|
105
|
-
declare function locationFieldEvent(uiType: "location-field", type: "click-refresh-current-location", id: string, listener: TFieldEventListener, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
106
|
-
/**
|
|
107
|
-
* fired on attempting to get current location, after search bar copy has been updated to indicate it is getting current location
|
|
108
|
-
*
|
|
109
|
-
* `event.preventDefault()` will stop the retrieval of current location.
|
|
110
|
-
*
|
|
111
|
-
* Note: if event is prevented, dispatch `set-current-location` to set current location and resume the rest of the logic
|
|
112
|
-
* */
|
|
113
|
-
declare function locationFieldEvent(uiType: "location-field", type: "get-current-location", id: string, listener: TFieldEventListener, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
114
|
-
/** fired after determining current location, before updating search results */
|
|
115
|
-
declare function locationFieldEvent(uiType: "location-field", type: "get-selectable-pins", id: string, listener: TFieldEventListener<ILocationCoord>, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
116
|
-
/**
|
|
117
|
-
* fired on confirming selected address in the location modal
|
|
118
|
-
*
|
|
119
|
-
* `event.preventDefault()` will stop the selected address from being passed into Frontend Engine and from dismissing the location modal
|
|
120
|
-
*
|
|
121
|
-
* Note: if event is prevented, dispatch `confirm-location` to confirm location and dismiss location modal
|
|
122
|
-
*/
|
|
123
|
-
declare function locationFieldEvent(uiType: "location-field", type: "click-confirm-location", id: string, listener: TFieldEventListener<ILocationFieldValues>, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
124
|
-
/**
|
|
125
|
-
* fired before request location permission modal is dismissed
|
|
126
|
-
*
|
|
127
|
-
* `event.preventDefault()` will stop the permission modal from being dismissed
|
|
128
|
-
*
|
|
129
|
-
* Note: if event is prevented, dispatch `hide-permission-modal` to dismiss the permission modal
|
|
130
|
-
* */
|
|
131
|
-
declare function locationFieldEvent(uiType: "location-field", type: "before-hide-permission-modal", id: string, listener: TFieldEventListener, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
132
|
-
/**
|
|
133
|
-
* fired when there is an error due to:
|
|
134
|
-
* - failure in calling reverse geocode endpoint
|
|
135
|
-
* - failure in performing location search via onemap
|
|
136
|
-
* - `set-current-location` event contains error
|
|
137
|
-
*
|
|
138
|
-
* `event.preventDefault()` will prevent the error from being handled and respective error modal from being shown
|
|
139
|
-
*
|
|
140
|
-
* Note: if event is prevented, dispatch `error-end` to dismiss any error modals
|
|
141
|
-
**/
|
|
142
|
-
declare function locationFieldEvent(uiType: "location-field", type: "error", id: string, listener: TFieldEventListener<TLocationFieldErrorDetail>, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
143
|
-
export type TLocationEvents = typeof locationFieldEvent;
|
|
144
|
-
/** shows location modal */
|
|
145
|
-
declare function locationFieldTrigger(uiType: "location-field", type: "show-location-modal", id: string, details: TSetCurrentLocationDetail): boolean;
|
|
146
|
-
/** sets current location manually, this is meant to be triggered if `get-current-location` event is prevented */
|
|
147
|
-
declare function locationFieldTrigger(uiType: "location-field", type: "set-current-location", id: string, details: TSetCurrentLocationDetail): boolean;
|
|
148
|
-
/** dismisses error modal (if any), this is meant to be triggered if `error` event is prevented */
|
|
149
|
-
declare function locationFieldTrigger(uiType: "location-field", type: "error-end", id: string, details: TLocationFieldErrorDetail): void;
|
|
150
|
-
/** add pins to location picker */
|
|
151
|
-
declare function locationFieldTrigger(uiType: "location-field", type: "set-selectable-pins", id: string, details: {
|
|
152
|
-
pins: IMapPin[];
|
|
153
|
-
}): void;
|
|
154
|
-
/** passes location info to Frontend Engine and dismisses location modal. this is meant to be triggered if `click-confirm-location` event is prevented */
|
|
155
|
-
declare function locationFieldTrigger(uiType: "location-field", type: "confirm-location", id: string, details: ILocationFieldValues): void;
|
|
156
|
-
/** dismisses location permission request modal. this is meant to be triggered if `before-hide-permission-modal` is prevented */
|
|
157
|
-
declare function locationFieldTrigger(uiType: "location-field", type: "hide-permission-modal", id: string): void;
|
|
158
|
-
/** dismisses the location modal and discards any location selected in the modal */
|
|
159
|
-
declare function locationFieldTrigger(uiType: "location-field", type: "dismiss-location-modal", id: string): void;
|
|
160
|
-
/** initiate attempt to get current location and updates the search bar to indicate it is getting current location. this is meant to be triggered if `click-refresh-current-location` event is prevented */
|
|
161
|
-
declare function locationFieldTrigger(uiType: "location-field", type: "trigger-get-current-location", id: string): void;
|
|
162
|
-
export type TLocationFieldTriggers = typeof locationFieldTrigger;
|
|
163
|
-
export {};
|
|
1
|
+
import { TFieldEventListener } from "../../../utils";
|
|
2
|
+
import { IYupValidationRule } from "../../frontend-engine";
|
|
3
|
+
import { IStaticMapProps } from "../../shared";
|
|
4
|
+
import { IBaseFieldSchema } from "../types";
|
|
5
|
+
import { ILocationInputProps } from "./location-input";
|
|
6
|
+
import { ILocationPickerProps, IMapPin } from "./location-modal/location-picker/types";
|
|
7
|
+
import { ILocationSearchProps } from "./location-modal/location-search/types";
|
|
8
|
+
import { ILocationModalProps } from "./location-modal/types";
|
|
9
|
+
export interface ILocationFieldValidation extends IYupValidationRule {
|
|
10
|
+
postalCode?: boolean | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface ILegendItem {
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
icon: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ILocationMapApi {
|
|
18
|
+
reverseGeocode?: string | undefined;
|
|
19
|
+
convertLatLngToXY?: string | undefined;
|
|
20
|
+
search?: string | undefined;
|
|
21
|
+
headers?: Record<string, string> | undefined;
|
|
22
|
+
}
|
|
23
|
+
export interface ILocationFieldSchema<V = undefined> extends IBaseFieldSchema<"location-field", V, ILocationFieldValidation>, Pick<ILocationPickerProps, "interactiveMapPinIconUrl" | "mapPanZoom">, Pick<ILocationSearchProps, "mapApi" | "mustHavePostalCode" | "gettingCurrentLocationFetchMessage" | "hasExplicitEdit" | "disableSearch" | "addressFieldPlaceholder" | "searchBarIcon" | "bufferRadius">, Pick<ILocationInputProps, "locationInputPlaceholder" | "disabled" | "readOnly">, Pick<IStaticMapProps, "staticMapPinColor">, Pick<ILocationModalProps, "locationSelectionMode"> {
|
|
24
|
+
className?: string;
|
|
25
|
+
locationModalStyles?: string | undefined;
|
|
26
|
+
locationListTitle?: string | undefined;
|
|
27
|
+
mapBannerText?: string | undefined;
|
|
28
|
+
pinsOnlyIndicateCurrentLocation?: boolean | undefined;
|
|
29
|
+
legendItems?: ILegendItem[] | undefined;
|
|
30
|
+
defaultAddress?: ILocationCoord | undefined;
|
|
31
|
+
}
|
|
32
|
+
export type TSinglePanelInputMode = "search" | "map";
|
|
33
|
+
export type TExplicitEditMode = "show" | "explicit";
|
|
34
|
+
export type TPanelInputMode = "search" | "map" | "double";
|
|
35
|
+
export interface ILocationFieldValues {
|
|
36
|
+
address?: string | undefined;
|
|
37
|
+
blockNo?: string | undefined;
|
|
38
|
+
building?: string | undefined;
|
|
39
|
+
postalCode?: string | undefined;
|
|
40
|
+
roadName?: string | undefined;
|
|
41
|
+
lat?: number | undefined;
|
|
42
|
+
lng?: number | undefined;
|
|
43
|
+
x?: number | undefined;
|
|
44
|
+
y?: number | undefined;
|
|
45
|
+
}
|
|
46
|
+
export interface ILocationCoord {
|
|
47
|
+
lat: number;
|
|
48
|
+
lng: number;
|
|
49
|
+
}
|
|
50
|
+
export interface IResultListItem extends ILocationFieldValues {
|
|
51
|
+
displayAddressText?: string | undefined;
|
|
52
|
+
}
|
|
53
|
+
export interface IResultsMetaData {
|
|
54
|
+
results: IResultListItem[];
|
|
55
|
+
apiPageNum?: number | undefined;
|
|
56
|
+
totalNumPages?: number | undefined;
|
|
57
|
+
}
|
|
58
|
+
export interface IDisplayResultListParams extends IResultsMetaData {
|
|
59
|
+
queryString?: string | undefined;
|
|
60
|
+
boldResults?: boolean | undefined;
|
|
61
|
+
}
|
|
62
|
+
export type TErrorType = {
|
|
63
|
+
errorType: "OneMapError" | "GetLocationError" | "GetLocationTimeoutError" | "PostalCodeError";
|
|
64
|
+
};
|
|
65
|
+
export interface TLocationFieldDetail<T = unknown> {
|
|
66
|
+
payload?: T | undefined;
|
|
67
|
+
errors?: any | undefined;
|
|
68
|
+
}
|
|
69
|
+
export type TSetCurrentLocationDetail = TLocationFieldDetail<ILocationCoord>;
|
|
70
|
+
export type TLocationFieldErrorDetail = TLocationFieldDetail<TErrorType>;
|
|
71
|
+
export type TLocationFieldEvents = {
|
|
72
|
+
"show-location-modal-ready": CustomEvent;
|
|
73
|
+
"get-current-location": CustomEvent;
|
|
74
|
+
"set-current-location": CustomEvent<TSetCurrentLocationDetail>;
|
|
75
|
+
error: CustomEvent<TLocationFieldErrorDetail>;
|
|
76
|
+
"error-end": CustomEvent<TLocationFieldErrorDetail>;
|
|
77
|
+
"set-selectable-pins": CustomEvent<{
|
|
78
|
+
pins: IMapPin[];
|
|
79
|
+
}>;
|
|
80
|
+
};
|
|
81
|
+
export declare class GeolocationPositionErrorWrapper extends Error {
|
|
82
|
+
code: any;
|
|
83
|
+
message: any;
|
|
84
|
+
constructor(error: GeolocationPositionError);
|
|
85
|
+
}
|
|
86
|
+
/** fired after the location field registers the `show-location-modal` event listener and is ready for external triggers */
|
|
87
|
+
declare function locationFieldEvent(uiType: "location-field", type: "show-location-modal-ready", id: string, listener: TFieldEventListener, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
88
|
+
/** fired on showing location modal */
|
|
89
|
+
declare function locationFieldEvent(uiType: "location-field", type: "show-location-modal", id: string, listener: TFieldEventListener, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
90
|
+
/** fired on dismissing location modal */
|
|
91
|
+
declare function locationFieldEvent(uiType: "location-field", type: "hide-location-modal", id: string, listener: TFieldEventListener, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
92
|
+
/**
|
|
93
|
+
* fired on clicking edit button (edit button is only render with `hasExplicitEdit:true` and if a location is selected)
|
|
94
|
+
*
|
|
95
|
+
* `event.preventDefault()` will stop location modal from being shown
|
|
96
|
+
* */
|
|
97
|
+
declare function locationFieldEvent(uiType: "location-field", type: "click-edit-button", id: string, listener: TFieldEventListener, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
98
|
+
/**
|
|
99
|
+
* fired immediately on clicking refresh current location button in location picker
|
|
100
|
+
*
|
|
101
|
+
* `event.preventDefault()` will prevent the search copy from being updated and stop the retrieval of current location
|
|
102
|
+
*
|
|
103
|
+
* Note: if event is prevented, dispatch `trigger-get-current-location` to resume logic
|
|
104
|
+
* */
|
|
105
|
+
declare function locationFieldEvent(uiType: "location-field", type: "click-refresh-current-location", id: string, listener: TFieldEventListener, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
106
|
+
/**
|
|
107
|
+
* fired on attempting to get current location, after search bar copy has been updated to indicate it is getting current location
|
|
108
|
+
*
|
|
109
|
+
* `event.preventDefault()` will stop the retrieval of current location.
|
|
110
|
+
*
|
|
111
|
+
* Note: if event is prevented, dispatch `set-current-location` to set current location and resume the rest of the logic
|
|
112
|
+
* */
|
|
113
|
+
declare function locationFieldEvent(uiType: "location-field", type: "get-current-location", id: string, listener: TFieldEventListener, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
114
|
+
/** fired after determining current location, before updating search results */
|
|
115
|
+
declare function locationFieldEvent(uiType: "location-field", type: "get-selectable-pins", id: string, listener: TFieldEventListener<ILocationCoord>, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
116
|
+
/**
|
|
117
|
+
* fired on confirming selected address in the location modal
|
|
118
|
+
*
|
|
119
|
+
* `event.preventDefault()` will stop the selected address from being passed into Frontend Engine and from dismissing the location modal
|
|
120
|
+
*
|
|
121
|
+
* Note: if event is prevented, dispatch `confirm-location` to confirm location and dismiss location modal
|
|
122
|
+
*/
|
|
123
|
+
declare function locationFieldEvent(uiType: "location-field", type: "click-confirm-location", id: string, listener: TFieldEventListener<ILocationFieldValues>, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
124
|
+
/**
|
|
125
|
+
* fired before request location permission modal is dismissed
|
|
126
|
+
*
|
|
127
|
+
* `event.preventDefault()` will stop the permission modal from being dismissed
|
|
128
|
+
*
|
|
129
|
+
* Note: if event is prevented, dispatch `hide-permission-modal` to dismiss the permission modal
|
|
130
|
+
* */
|
|
131
|
+
declare function locationFieldEvent(uiType: "location-field", type: "before-hide-permission-modal", id: string, listener: TFieldEventListener, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
132
|
+
/**
|
|
133
|
+
* fired when there is an error due to:
|
|
134
|
+
* - failure in calling reverse geocode endpoint
|
|
135
|
+
* - failure in performing location search via onemap
|
|
136
|
+
* - `set-current-location` event contains error
|
|
137
|
+
*
|
|
138
|
+
* `event.preventDefault()` will prevent the error from being handled and respective error modal from being shown
|
|
139
|
+
*
|
|
140
|
+
* Note: if event is prevented, dispatch `error-end` to dismiss any error modals
|
|
141
|
+
**/
|
|
142
|
+
declare function locationFieldEvent(uiType: "location-field", type: "error", id: string, listener: TFieldEventListener<TLocationFieldErrorDetail>, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
143
|
+
export type TLocationEvents = typeof locationFieldEvent;
|
|
144
|
+
/** shows location modal */
|
|
145
|
+
declare function locationFieldTrigger(uiType: "location-field", type: "show-location-modal", id: string, details: TSetCurrentLocationDetail): boolean;
|
|
146
|
+
/** sets current location manually, this is meant to be triggered if `get-current-location` event is prevented */
|
|
147
|
+
declare function locationFieldTrigger(uiType: "location-field", type: "set-current-location", id: string, details: TSetCurrentLocationDetail): boolean;
|
|
148
|
+
/** dismisses error modal (if any), this is meant to be triggered if `error` event is prevented */
|
|
149
|
+
declare function locationFieldTrigger(uiType: "location-field", type: "error-end", id: string, details: TLocationFieldErrorDetail): void;
|
|
150
|
+
/** add pins to location picker */
|
|
151
|
+
declare function locationFieldTrigger(uiType: "location-field", type: "set-selectable-pins", id: string, details: {
|
|
152
|
+
pins: IMapPin[];
|
|
153
|
+
}): void;
|
|
154
|
+
/** passes location info to Frontend Engine and dismisses location modal. this is meant to be triggered if `click-confirm-location` event is prevented */
|
|
155
|
+
declare function locationFieldTrigger(uiType: "location-field", type: "confirm-location", id: string, details: ILocationFieldValues): void;
|
|
156
|
+
/** dismisses location permission request modal. this is meant to be triggered if `before-hide-permission-modal` is prevented */
|
|
157
|
+
declare function locationFieldTrigger(uiType: "location-field", type: "hide-permission-modal", id: string): void;
|
|
158
|
+
/** dismisses the location modal and discards any location selected in the modal */
|
|
159
|
+
declare function locationFieldTrigger(uiType: "location-field", type: "dismiss-location-modal", id: string): void;
|
|
160
|
+
/** initiate attempt to get current location and updates the search bar to indicate it is getting current location. this is meant to be triggered if `click-refresh-current-location` event is prevented */
|
|
161
|
+
declare function locationFieldTrigger(uiType: "location-field", type: "trigger-get-current-location", id: string): void;
|
|
162
|
+
export type TLocationFieldTriggers = typeof locationFieldTrigger;
|
|
163
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./masked-field";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export * from "./masked-field";
|
|
2
|
+
export * from "./types";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IGenericFieldProps } from "..";
|
|
2
|
-
import { IMaskedFieldSchema } from "./types";
|
|
3
|
-
export declare const MaskedField: (props: IGenericFieldProps<IMaskedFieldSchema>) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { IGenericFieldProps } from "..";
|
|
2
|
+
import { IMaskedFieldSchema } from "./types";
|
|
3
|
+
export declare const MaskedField: (props: IGenericFieldProps<IMaskedFieldSchema>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { FormInputProps, FormMaskedInputProps } from "@lifesg/react-design-system/form/types";
|
|
2
|
-
import * as Icons from "@lifesg/react-icons";
|
|
3
|
-
import { TComponentOmitProps } from "../../frontend-engine";
|
|
4
|
-
import { IBaseFieldSchema } from "../types";
|
|
5
|
-
interface IMaskedFieldProps extends Pick<FormMaskedInputProps, "maskChar" | "maskRange" | "unmaskRange" | "iconActiveColor" | "iconInactiveColor" | "transformInput"> {
|
|
6
|
-
maskRegex?: string | undefined;
|
|
7
|
-
iconMask?: keyof typeof Icons | undefined;
|
|
8
|
-
iconUnmask?: keyof typeof Icons | undefined;
|
|
9
|
-
}
|
|
10
|
-
export interface IMaskedFieldSchema<V = undefined> extends IBaseFieldSchema<"masked-field", V>, TComponentOmitProps<FormInputProps & IMaskedFieldProps, "type" | "maxLength"> {
|
|
11
|
-
}
|
|
12
|
-
export {};
|
|
1
|
+
import { FormInputProps, FormMaskedInputProps } from "@lifesg/react-design-system/form/types";
|
|
2
|
+
import * as Icons from "@lifesg/react-icons";
|
|
3
|
+
import { TComponentOmitProps } from "../../frontend-engine";
|
|
4
|
+
import { IBaseFieldSchema } from "../types";
|
|
5
|
+
interface IMaskedFieldProps extends Pick<FormMaskedInputProps, "maskChar" | "maskRange" | "unmaskRange" | "iconActiveColor" | "iconInactiveColor" | "transformInput"> {
|
|
6
|
+
maskRegex?: string | undefined;
|
|
7
|
+
iconMask?: keyof typeof Icons | undefined;
|
|
8
|
+
iconUnmask?: keyof typeof Icons | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface IMaskedFieldSchema<V = undefined> extends IBaseFieldSchema<"masked-field", V>, TComponentOmitProps<FormInputProps & IMaskedFieldProps, "type" | "maxLength"> {
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./multi-select";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export * from "./multi-select";
|
|
2
|
+
export * from "./types";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IGenericFieldProps } from "..";
|
|
2
|
-
import { IMultiSelectSchema } from "./types";
|
|
3
|
-
export declare const MultiSelect: (props: IGenericFieldProps<IMultiSelectSchema>) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { IGenericFieldProps } from "..";
|
|
2
|
+
import { IMultiSelectSchema } from "./types";
|
|
3
|
+
export declare const MultiSelect: (props: IGenericFieldProps<IMultiSelectSchema>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { InputMultiSelectProps } from "@lifesg/react-design-system/input-multi-select";
|
|
2
|
-
import { TComponentOmitProps } from "../../frontend-engine";
|
|
3
|
-
import { IBaseFieldSchema } from "../types";
|
|
4
|
-
export interface IMultiSelectOption {
|
|
5
|
-
label: string;
|
|
6
|
-
value: string;
|
|
7
|
-
}
|
|
8
|
-
export interface IMultiSelectSchema<V = undefined> extends IBaseFieldSchema<"multi-select", V>, TComponentOmitProps<InputMultiSelectProps<IMultiSelectOption, string>> {
|
|
9
|
-
}
|
|
1
|
+
import { InputMultiSelectProps } from "@lifesg/react-design-system/input-multi-select";
|
|
2
|
+
import { TComponentOmitProps } from "../../frontend-engine";
|
|
3
|
+
import { IBaseFieldSchema } from "../types";
|
|
4
|
+
export interface IMultiSelectOption {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
export interface IMultiSelectSchema<V = undefined> extends IBaseFieldSchema<"multi-select", V>, TComponentOmitProps<InputMultiSelectProps<IMultiSelectOption, string>> {
|
|
9
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./nested-multi-select";
|
|
2
|
-
export * from "./types";
|
|
1
|
+
export * from "./nested-multi-select";
|
|
2
|
+
export * from "./types";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IGenericFieldProps } from "..";
|
|
2
|
-
import { INestedMultiSelectSchema } from "./types";
|
|
3
|
-
export declare const NestedMultiSelect: (props: IGenericFieldProps<INestedMultiSelectSchema>) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { IGenericFieldProps } from "..";
|
|
2
|
+
import { INestedMultiSelectSchema } from "./types";
|
|
3
|
+
export declare const NestedMultiSelect: (props: IGenericFieldProps<INestedMultiSelectSchema>) => import("react/jsx-runtime").JSX.Element;
|