@wavemaker/app-rn-runtime 12.0.0-next.141130 → 12.0.0-next.141134
Sign up to get free protection for your applications and to get access to all the features.
- app-rn-runtime/components/advanced/carousel/carousel.component.js +31 -5
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.props.js +1 -0
- app-rn-runtime/components/advanced/carousel/carousel.props.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.styles.js +15 -0
- app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js +15 -5
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.styles.js +3 -0
- app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
- app-rn-runtime/components/basic/animatedview.component.js +6 -2
- app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
- app-rn-runtime/components/basic/audio/audio.component.js.map +1 -1
- app-rn-runtime/components/basic/button/button.component.js +20 -6
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js +14 -6
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +13 -3
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
- app-rn-runtime/components/basic/message/message.component.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.component.js +1 -2
- app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +2 -2
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +5 -5
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js +9 -0
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.props.js +2 -0
- app-rn-runtime/components/basic/search/search.props.js.map +1 -1
- app-rn-runtime/components/basic/search/search.styles.js +5 -0
- app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.component.js +4 -3
- app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.props.js +9 -1
- app-rn-runtime/components/basic/skeleton/skeleton.props.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.component.js +2 -3
- app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.styles.js +3 -2
- app-rn-runtime/components/basic/spinner/spinner.styles.js.map +1 -1
- app-rn-runtime/components/basic/video/video.component.js.map +1 -1
- app-rn-runtime/components/basic/video/video.styles.js +4 -1
- app-rn-runtime/components/basic/video/video.styles.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.component.js +2 -1
- app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.styles.js +7 -1
- app-rn-runtime/components/chart/area-chart/area-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js +7 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/basechart.component.js +54 -2
- app-rn-runtime/components/chart/basechart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.props.js +3 -2
- app-rn-runtime/components/chart/basechart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.styles.js +4 -0
- app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +15 -3
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js +7 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/column-chart/column-chart.styles.js +7 -1
- app-rn-runtime/components/chart/column-chart/column-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js +7 -1
- app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.props.js +2 -0
- app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.styles.js +7 -1
- app-rn-runtime/components/chart/line-chart/line-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +6 -2
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js +7 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +37 -11
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.component.js +61 -12
- app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.props.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.styles.js +5 -0
- app-rn-runtime/components/container/accordion/accordion.styles.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +11 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
- app-rn-runtime/components/container/container.component.js +36 -2
- app-rn-runtime/components/container/container.component.js.map +1 -1
- app-rn-runtime/components/container/container.styles.js +7 -0
- app-rn-runtime/components/container/container.styles.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +5 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js +6 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +28 -2
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.props.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js +4 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js +31 -5
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.props.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.styles.js +4 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.styles.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.component.js +47 -6
- app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.styles.js +3 -0
- app-rn-runtime/components/container/panel/panel.styles.js.map +1 -1
- app-rn-runtime/components/container/partial-host.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +3 -4
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +11 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.component.js +41 -5
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js +4 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.component.js +28 -2
- app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.props.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.styles.js +6 -1
- app-rn-runtime/components/container/tile/tile.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +62 -13
- app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.props.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.styles.js +3 -0
- app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +4 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js +6 -2
- app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.styles.js +4 -1
- app-rn-runtime/components/data/card/card-content/card-content.styles.js.map +1 -1
- app-rn-runtime/components/data/card/card.component.js +18 -0
- app-rn-runtime/components/data/card/card.component.js.map +1 -1
- app-rn-runtime/components/data/card/card.styles.js +3 -0
- app-rn-runtime/components/data/card/card.styles.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
- app-rn-runtime/components/data/form/form.component.js +1 -1
- app-rn-runtime/components/data/form/form.component.js.map +1 -1
- app-rn-runtime/components/data/form/form.props.js +1 -0
- app-rn-runtime/components/data/form/form.props.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js +15 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.props.js +1 -0
- app-rn-runtime/components/data/list/list-template/list-template.props.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.styles.js +11 -1
- app-rn-runtime/components/data/list/list-template/list-template.styles.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +54 -33
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.props.js +1 -0
- app-rn-runtime/components/data/list/list.props.js.map +1 -1
- app-rn-runtime/components/data/list/list.styles.js +9 -0
- app-rn-runtime/components/data/list/list.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js +5 -3
- app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
- app-rn-runtime/components/input/basedataset/basedataset.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js +11 -4
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.props.js +1 -0
- app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js +25 -12
- app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.props.js +2 -0
- app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +5 -6
- app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js +24 -3
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js +1 -0
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +1 -0
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.component.js +3 -2
- app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.component.js +16 -1
- app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +22 -5
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheel-date-picker.component.js +123 -12
- app-rn-runtime/components/input/epoch/wheel-date-picker.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpicker/wheelpicker.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +4 -0
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js +2 -0
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js +4 -2
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.props.js +1 -0
- app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +6 -3
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +27 -7
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.props.js +1 -0
- app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.styles.js +1 -0
- app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
- app-rn-runtime/components/input/select/select.component.js +23 -9
- app-rn-runtime/components/input/select/select.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.component.js +2 -2
- app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +21 -0
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/text/text.props.js +2 -0
- app-rn-runtime/components/input/text/text.props.js.map +1 -1
- app-rn-runtime/components/input/text/text.styles.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +21 -0
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.props.js +2 -0
- app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +2 -4
- app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +2 -2
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.component.js +2 -3
- app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
- app-rn-runtime/components/page/content/content.component.js +19 -4
- app-rn-runtime/components/page/content/content.component.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.component.js +27 -2
- app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.props.js +2 -2
- app-rn-runtime/components/page/page-content/page-content.props.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.styles.js +6 -1
- app-rn-runtime/components/page/page-content/page-content.styles.js.map +1 -1
- app-rn-runtime/components/page/page.component.js.map +1 -1
- app-rn-runtime/components/page/page.props.js.map +1 -1
- app-rn-runtime/components/page/page.styles.js +7 -1
- app-rn-runtime/components/page/page.styles.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.component.js +27 -1
- app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.props.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.styles.js +6 -1
- app-rn-runtime/components/page/partial/partial.styles.js.map +1 -1
- app-rn-runtime/components/page/tabbar/curve.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.props.js +1 -0
- app-rn-runtime/components/page/tabbar/tabbar.props.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js +27 -1
- app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.props.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.styles.js +6 -1
- app-rn-runtime/components/prefab/prefab-container.styles.js.map +1 -1
- app-rn-runtime/core/base.component.js +5 -3
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/components/textinput.component.js +4 -3
- app-rn-runtime/core/components/textinput.component.js.map +1 -1
- app-rn-runtime/core/formatters.js.map +1 -1
- app-rn-runtime/core/key.extractor.js.map +1 -1
- app-rn-runtime/core/props.provider.js +4 -1
- app-rn-runtime/core/props.provider.js.map +1 -1
- app-rn-runtime/core/storage.service.js.map +1 -1
- app-rn-runtime/core/tappable.component.js +34 -27
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/core/ui-preferences.context.js +7 -0
- app-rn-runtime/core/ui-preferences.context.js.map +1 -0
- app-rn-runtime/core/utils.js +87 -4
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/package.json +30 -7
- app-rn-runtime/runtime/App.js +4 -8
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/App.navigator.js.map +1 -1
- app-rn-runtime/runtime/base-fragment.component.js +43 -13
- app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
- app-rn-runtime/runtime/base-page.component.js.map +1 -1
- app-rn-runtime/runtime/base-partial.component.js.map +1 -1
- app-rn-runtime/runtime/base-prefab.component.js.map +1 -1
- app-rn-runtime/runtime/navigator/stack.navigator.js.map +1 -1
- app-rn-runtime/runtime/services/app-i18n.service.js +10 -0
- app-rn-runtime/runtime/services/app-i18n.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-security.service.js +42 -2
- app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-spinner.service.js +1 -1
- app-rn-runtime/runtime/services/app-spinner.service.js.map +1 -1
- app-rn-runtime/runtime/services/webprocess.service.js.map +1 -1
- app-rn-runtime/runtime/watcher.js.map +1 -1
- app-rn-runtime/styles/background.component.js +1 -0
- app-rn-runtime/styles/background.component.js.map +1 -1
- app-rn-runtime/styles/style-prop.validator.js.map +1 -1
- app-rn-runtime/styles/theme.js +5 -0
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/styles/theme.variables.js +1 -0
- app-rn-runtime/styles/theme.variables.js.map +1 -1
- app-rn-runtime/variables/base-variable.js.map +1 -1
- app-rn-runtime/variables/device/file/upload-file.operation.js.map +1 -1
- app-rn-runtime/variables/device-variable.js.map +1 -1
- app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","Text","Platform","TouchableOpacity","moment","DateTimePicker","BaseComponent","BaseComponentState","WmIcon","WmDatetimeProps","DEFAULT_CLASS","WebDatePicker","isNumber","isString","ModalConsumer","validateField","AccessibilityWidgetType","getAccessibilityProps","FloatingLabel","AppI18nService","WmButton","WmDatePickerModal","WmTimePickerModal","BaseDatetimeState","constructor","args","_defineProperty","CURRENT_DATE","CURRENT_TIME","BaseDatetime","props","defaultClass","defaultProps","defaultState","format","date","Date","getTime","parse","parseInt","toDate","monitorAndUpdateCurrentTime","stopCurrentTimeMonitor","timerId","setInterval","updateState","readonly","datavalue","now","state","clearInterval","convertTimezone","timezone","getTimezone","parsedDateString","toLocaleString","locale","timeZone","momentPattern","pattern","replaceAll","onPropertyChange","name","$new","$old","invokeEventCallback","prevDatavalue","outputformat","datepattern","dateValue","displayValue","onFieldChange","minDateVal","mindate","maxDateVal","maxdate","disabled","onDateChange","$event","validate","modes","shift","isFocused","showDatePicker","length","timestamp","onBlur","OS","setTimeout","triggerValidation","onFocus","mode","showDatePickerModal","showTimePickerModal","value","validationObj","setState","isValid","errorType","componentWillUnmount","renderWebWidget","createElement","onDismiss","minimumDate","maximumDate","renderNativeWidget","_extends","DATE","is24Hour","display","onChange","event","dateSelected","set","getMonth","getFullYear","getDate","renderNativeIOSWidget","date_change","undefined","style","styles","dialog","actionWrapper","selectBtn","caption","onTap","cancelBtn","renderNativeIOSWidgetWithModal","modalService","nativeModalOptions","content","Fragment","hideModal","centered","onClose","showModal","renderNativeWidgetWithModal","addTouchableOpacity","children","_children$props","hint","accessibilityProps","accessible","accessibilityHint","getTestPropsForAction","onPress","getIcon","renderWidget","_props$floatinglabel","root","invalid","focused","_background","floatinglabel","moveUp","label","placeholder","floatingLabel","activeFloatingLabel","container","text","placeholderText","getTestPropsForLabel","flex","isRTL","flexDirection","textAlign","iconclass","color","clearIcon","id","getTestId","accessibilitylabel","clearBtnClicked","calendarIcon","iswheelpicker","isVisible","selectedDate","onSelect","onCancel","selectedDateTime","is24hour","time"],"sources":["base-datetime.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, Platform, TouchableOpacity, ViewStyle } from 'react-native';\nimport moment from 'moment';\nimport DateTimePicker, { DateTimePickerEvent } from '@react-native-community/datetimepicker';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\n\nimport WmDatetimeProps from './datetime/datetime.props';\nimport { DEFAULT_CLASS, WmDatetimeStyles } from './datetime/datetime.styles';\nimport WebDatePicker from './date-picker.component';\nimport { isNumber, isString } from 'lodash-es';\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport { validateField } from '@wavemaker/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { FloatingLabel } from '@wavemaker/app-rn-runtime/core/components/floatinglabel.component';\nimport AppI18nService from '@wavemaker/app-rn-runtime/runtime/services/app-i18n.service';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport WmDatePickerModal from './wheelpickermodal/date/date-picker-modal.component';\nimport WmTimePickerModal from './wheelpickermodal/time/time-picker-modal.component';\n\nexport class BaseDatetimeState extends BaseComponentState<WmDatetimeProps> {\n showDatePicker = false;\n showDatePickerModal = false;\n showTimePickerModal = false;\n dateValue: Date = null as any;\n displayValue: string = null as any;\n isFocused = false;\n timerId: NodeJS.Timer = null as any;\n isValid: boolean = true;\n errorType = '';\n}\n\nconst CURRENT_DATE = 'CURRENT_DATE';\nconst CURRENT_TIME = 'CURRENT_TIME';\n\nexport default abstract class BaseDatetime extends BaseComponent<WmDatetimeProps, BaseDatetimeState, WmDatetimeStyles> {\n clearBtnClicked = false;\n modes = [] as string[];\n nativeModalOptions: ModalOptions = {} as any;\n prevDatavalue: any;\n\n constructor(props: WmDatetimeProps, defaultClass = DEFAULT_CLASS, defaultProps = new WmDatetimeProps(), defaultState= new BaseDatetimeState()) {\n super(props, defaultClass, defaultProps, defaultState);\n }\n\n format(date: Date | number | undefined, format: string) {\n if (format === 'timestamp') {\n return date instanceof Date ? '' + date.getTime() : date;\n }\n return date && moment(date).format(format);\n }\n\n parse(date: string | number, format: string) {\n if (format === 'timestamp') {\n if (isString(date)) {\n return new Date(parseInt(date));\n }\n if (isNumber(date)) {\n return new Date(date);\n }\n }\n return date && moment(date, format).toDate();\n }\n\n private monitorAndUpdateCurrentTime() {\n this.stopCurrentTimeMonitor();\n const timerId = setInterval(() => {\n this.updateState({\n props: {\n readonly: true,\n datavalue: Date.now()\n },\n timerId: timerId\n } as any as BaseDatetimeState);\n }, 1000);\n }\n\n private stopCurrentTimeMonitor() {\n if (this.state.timerId) {\n clearInterval(this.state.timerId as any);\n }\n }\n\n convertTimezone(date: any){ \n const timezone = AppI18nService.getTimezone();\n if (timezone) {\n const parsedDateString = new Date(date).toLocaleString(this.props.locale ? this.props.locale : 'en-us', { timeZone: timezone });\n return moment(parsedDateString, 'M/D/YYYY, h:mm:ss A');\n }\n else {\n return null;\n }\n }\n \n momentPattern(pattern : String) {\n return pattern?.replaceAll('y', 'Y').replaceAll('d', 'D');\n}\n\n onPropertyChange(name: string, $new: any, $old: any) {\n super.onPropertyChange(name, $new, $old);\n const props = this.state.props;\n switch(name) {\n //@ts-ignore\n case 'datavalue':\n this.invokeEventCallback('onChange', [null, this, $new, $old]);\n this.prevDatavalue = $old;\n if (props.datavalue === CURRENT_TIME) {\n this.monitorAndUpdateCurrentTime();\n }\n case 'datepattern':\n case 'outputformat':\n if (props.datavalue && this.momentPattern(props.outputformat as String) && this.momentPattern(props.datepattern as String)) {\n let datavalue: any = props.datavalue;\n if (datavalue === CURRENT_DATE || datavalue === CURRENT_TIME) {\n datavalue = new Date() as any;\n }\n const date = isString(datavalue) ? this.parse(datavalue as string, this.momentPattern(props.outputformat as String)) : datavalue;\n datavalue = this.convertTimezone(datavalue);\n this.updateState({\n dateValue : date,\n displayValue: this.format(datavalue?datavalue:date as any, this.momentPattern(props.datepattern as String))\n } as BaseDatetimeState);\n } else {\n this.updateState({\n dateValue : null as any,\n displayValue: null as any\n } as BaseDatetimeState);\n }\n this.props.onFieldChange && this.props.onFieldChange('datavalue', props.datavalue, this.prevDatavalue);\n break;\n case 'mindate':\n if (isString($new)) {\n const minDateVal = ($new === CURRENT_DATE || $new === CURRENT_TIME) ? new Date() : props.mindate;\n this.updateState({\n props: {\n mindate: moment(minDateVal, this.momentPattern(props.datepattern as String)).toDate()\n }\n } as BaseDatetimeState);\n }\n break;\n case 'maxdate':\n if (isString($new)) {\n const maxDateVal = ($new === CURRENT_DATE || $new === CURRENT_TIME) ? new Date() : props.maxdate;\n this.updateState({\n props: {\n maxdate: moment(maxDateVal, this.momentPattern(props.datepattern as String)).toDate()\n }\n } as BaseDatetimeState);\n }\n break;\n case 'readonly':\n this.updateState({\n props: {\n disabled: $new\n }\n } as BaseDatetimeState)\n break;\n }\n }\n\n onDateChange($event: DateTimePickerEvent, date?: Date) {\n this.validate(date);\n this.modes.shift();\n this.updateState({\n isFocused: false,\n showDatePicker: !!this.modes.length,\n props: {\n datavalue: this.format(date, this.momentPattern(this.state.props.outputformat as String) as string),\n timestamp: this.format(date, 'timestamp')\n }\n } as BaseDatetimeState);\n }\n\n onBlur() {\n if (Platform.OS === 'web') {\n this.validate(this.state.props.datavalue);\n setTimeout(() => this.props.triggerValidation && this.props.triggerValidation());\n }\n this.invokeEventCallback('onBlur', [null, this]);\n }\n\n onFocus() {\n if (!this.state.props.readonly) {\n if (Platform.OS !== 'web' && this.state.props.mode === 'datetime') {\n this.modes = ['date', 'time'];\n } else {\n this.modes = [this.state.props.mode];\n }\n this.updateState({showDatePicker: true, isFocused: true} as BaseDatetimeState);\n if (this.state.props.mode === 'date') {\n this.updateState({showDatePickerModal: true} as BaseDatetimeState);\n }\n if (this.state.props.mode === 'time') {\n this.updateState({showTimePickerModal: true} as BaseDatetimeState);\n }\n if (this.state.props.mode === 'datetime') {\n this.updateState({showDatePickerModal: true} as BaseDatetimeState);\n }\n this.invokeEventCallback('onFocus', [null, this]);\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.setState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as BaseDatetimeState)\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n this.stopCurrentTimeMonitor();\n }\n\n renderWebWidget(props: WmDatetimeProps) {\n return (<WebDatePicker\n mode={this.state.props.mode}\n locale={props.locale}\n value={this.state.dateValue || new Date()}\n onDateChange={(date: Date) => this.onDateChange(null as any, date)}\n onDismiss={() =>\n this.updateState({\n isFocused: false,\n showDatePicker: false\n } as BaseDatetimeState, () => this.onBlur())}\n minimumDate={props.mindate as Date}\n maximumDate={props.maxdate as Date}/>);\n }\n\n renderNativeWidget(props: WmDatetimeProps, onDismiss?: Function) {\n return (<DateTimePicker\n mode={this.modes[0] as any}\n {...getAccessibilityProps(AccessibilityWidgetType.DATE, {...this.state.props})}\n value={this.state.dateValue || new Date()}\n is24Hour={true}\n display='default'\n onChange={(event: DateTimePickerEvent, date?: Date) => {\n if (date && this.state.props.mode === 'datetime' && this.modes[0] === 'time') {\n const dateSelected = this.state.dateValue;\n date = moment(date)\n .set('month', dateSelected.getMonth())\n .set('year', dateSelected.getFullYear())\n .set('date', dateSelected.getDate())\n .toDate();\n }\n this.onDateChange(event, date || this.state.dateValue);\n if (this.modes.length <= 1) {\n this.onBlur();\n onDismiss && onDismiss();\n }\n }}\n minimumDate={props.mindate as Date}\n maximumDate={props.maxdate as Date}\n />\n );\n }\n\n renderNativeIOSWidget(props: WmDatetimeProps, onDismiss?: Function) {\n let date_change : any = undefined;\n return (<View style={this.styles.dialog}>\n <DateTimePicker\n mode={this.modes[0] as any}\n value={this.state.dateValue || new Date()}\n is24Hour={true}\n display='spinner'\n onChange={(event: DateTimePickerEvent, date?: Date) => {\n if (date && this.state.props.mode === 'datetime' && this.modes[0] === 'time') {\n const dateSelected = this.state.dateValue;\n date = moment(date)\n .set('month', dateSelected.getMonth())\n .set('year', dateSelected.getFullYear())\n .set('date', dateSelected.getDate())\n .toDate();\n }\n date_change = date;\n }}\n minimumDate={props.mindate as Date}\n maximumDate={props.maxdate as Date}\n />\n <View style={this.styles.actionWrapper}>\n <WmButton styles={this.styles.selectBtn} caption='Select' onTap={() => {\n this.onDateChange(null as any, date_change || this.state.dateValue || new Date());\n if (this.modes.length <= 1) {\n this.onBlur();\n onDismiss && onDismiss();\n }\n }} />\n <WmButton styles={this.styles.cancelBtn} caption='Cancel' onTap={() => {\n this.modes.shift();\n this.onDateChange(null as any, this.state.dateValue || undefined);\n this.onBlur();\n onDismiss && onDismiss();\n }} />\n </View>\n </View>\n );\n }\n\n renderNativeIOSWidgetWithModal(props: WmDatetimeProps) {\n return (<ModalConsumer>{(modalService: ModalService) => {\n this.nativeModalOptions.content = (<>\n {this.renderNativeIOSWidget(props, () => modalService.hideModal(this.nativeModalOptions))}\n </>);\n this.nativeModalOptions.centered = true;\n this.nativeModalOptions.onClose = () => {\n this.onBlur();\n };\n modalService.showModal(this.nativeModalOptions);\n return null;\n }}</ModalConsumer>);\n }\n\n renderNativeWidgetWithModal(props: WmDatetimeProps) {\n return (<ModalConsumer>{(modalService: ModalService) => {\n this.nativeModalOptions.content = (<>\n {this.renderNativeWidget(props, () => modalService.hideModal(this.nativeModalOptions))}\n </>);\n this.nativeModalOptions.centered = true;\n this.nativeModalOptions.onClose = () => {\n this.onBlur();\n };\n modalService.showModal(this.nativeModalOptions);\n return null;\n }}</ModalConsumer>);\n }\n\n addTouchableOpacity(props: WmDatetimeProps, children: React.JSX.Element, styles?: any) : React.ReactNode{\n const hint = children?.props?.hint;\n const accessibilityProps = hint ? {accessible: true, accessibilityHint: hint} : {};\n\n return (\n <TouchableOpacity \n {...this.getTestPropsForAction()} \n {...accessibilityProps}\n style={styles} onPress={() => {\n if (!props.readonly) {\n this.onFocus();\n }\n this.invokeEventCallback('onTap', [null, this]);\n }}>\n {children}\n </TouchableOpacity>\n );\n }\n\n getIcon() {\n if (this.state.props.mode === 'time') {\n return 'wm-sl-l sl-time'\n }\n return 'wm-sl-l sl-calendar';\n }\n\n renderWidget(props: WmDatetimeProps) {\n return ( \n this.addTouchableOpacity(props, (\n <View style={[this.styles.root, this.state.isValid ? {} : this.styles.invalid, this.state.isFocused ? this.styles.focused : null]}>\n {this._background}\n {props.floatinglabel ? (\n <FloatingLabel\n moveUp={!!(props.datavalue || this.state.isFocused)}\n label={props.floatinglabel ?? props.placeholder} \n style={{\n ...(this.styles.floatingLabel || []),\n ...(this.state.isFocused ? (this.styles.activeFloatingLabel || {}) : {})\n }}\n />\n ) : null}\n <View style={this.styles.container}>\n {this.addTouchableOpacity(props, (\n <Text style={[\n this.styles.text,\n this.state.displayValue ? {} : this.styles.placeholderText\n ]}\n {...this.getTestPropsForLabel()}>\n {this.state.displayValue \n || (props.floatinglabel ? '' : this.state.props.placeholder)}\n </Text>\n ), [{ flex: 1}, this.isRTL?{flexDirection:'row', textAlign:'right'}:{}] )}\n {(!props.readonly && props.datavalue &&\n (<WmIcon iconclass=\"wi wi-clear\"\n styles={{color: this.styles.text.color, ...this.styles.clearIcon}}\n id={this.getTestId('clearicon')}\n accessibilitylabel={`clear ${props?.mode}`}\n onTap={() => {\n this.onDateChange(null as any, null as any);\n this.clearBtnClicked = true;\n }}/>)) || null}\n {this.addTouchableOpacity(props, (\n <WmIcon iconclass={this.getIcon()} styles={{color: this.styles.text.color, ...this.styles.calendarIcon}} hint={props?.hint}/>\n ))}\n </View>\n {\n this.state.showDatePicker\n && ((Platform.OS === 'web' && this.renderWebWidget(props))\n || (!props.iswheelpicker && Platform.OS === 'android' && this.renderNativeWidget(props))\n || (!props.iswheelpicker && Platform.OS === 'ios' && this.renderNativeIOSWidgetWithModal(props)))\n }\n {(Platform.OS !== 'web' && props.iswheelpicker && this.state.showDatePickerModal) && (\n <WmDatePickerModal\n isVisible={this.state.showDatePickerModal}\n onClose={() => this.updateState({showDatePickerModal: false} as BaseDatetimeState)}\n selectedDate={this.state.dateValue}\n onSelect={(date: Date) => {\n this.onDateChange(null as any, date);\n this.updateState({\n isFocused: false,\n showDatePickerModal: false\n } as BaseDatetimeState, () => {\n this.onBlur();\n\n // * showing time picker after selecting date in datetime mode\n if (this.state.props.mode === \"datetime\") {\n this.setState({\n showTimePickerModal: true,\n })\n }\n });\n }}\n onCancel={() => {\n // this.onDateChange(null as any, this.state.dateValue || undefined);\n this.updateState({\n isFocused: false,\n showDatePickerModal: false\n } as BaseDatetimeState, () => this.onBlur());\n }}\n />\n )}\n {(Platform.OS !== 'web' && props.iswheelpicker && this.state.showTimePickerModal) && (\n <WmTimePickerModal\n selectedDateTime={this.state.dateValue}\n is24Hour={props.is24hour}\n isVisible={this.state.showTimePickerModal}\n onClose={() => this.updateState({isFocused: false, showTimePickerModal: false} as BaseDatetimeState)}\n onSelect={(time: Date) => {\n this.onDateChange(null as any, time);\n this.updateState({\n isFocused: false,\n showTimePickerModal: false\n } as BaseDatetimeState, () => this.onBlur());\n }}\n onCancel={() => {\n // this.onDateChange(null as any, this.state.dateValue || undefined);\n this.updateState({\n isFocused: false,\n showTimePickerModal: false\n } as BaseDatetimeState, () => {\n this.onBlur();\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AAI,CAAC1F,WAAW,CAAC;QAACqC,SAAS,EAAE,KAAK;QAAEW,mBAAmB,EAAE;MAAK,CAAsB,CAAE;MACrGsF,QAAQ,EAAGI,IAAU,IAAK;QACxB,IAAI,CAAC1G,YAAY,CAAC,IAAI,EAAS0G,IAAI,CAAC;QACpC,IAAI,CAAC1I,WAAW,CAAC;UACfqC,SAAS,EAAE,KAAK;UAChBW,mBAAmB,EAAE;QACvB,CAAC,EAAuB,MAAM,IAAI,CAACP,MAAM,CAAC,CAAC,CAAC;MAC9C,CAAE;MACF8F,QAAQ,EAAEA,CAAA,KAAM;QACd;QACA,IAAI,CAACvI,WAAW,CAAC;UACfqC,SAAS,EAAE,KAAK;UAChBW,mBAAmB,EAAE;QACvB,CAAC,EAAuB,MAAM;UAC5B,IAAI,CAACP,MAAM,CAAC,CAAC;UACb,IAAI,CAACN,KAAK,CAACC,KAAK,CAAC,CAAC;QACpB,CAAC,CAAC;MACJ;IAAE,CACH,CAEC,CACL,CAAC;EAER;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","View","Text","Platform","TouchableOpacity","moment","DateTimePicker","BaseComponent","BaseComponentState","WmIcon","WmDatetimeProps","DEFAULT_CLASS","WebDatePicker","isNumber","isString","ModalConsumer","isDateFormatAsPerPattern","validateField","AccessibilityWidgetType","getAccessibilityProps","FloatingLabel","AppI18nService","WmButton","WmDatePickerModal","WmTimePickerModal","BaseDatetimeState","constructor","args","_defineProperty","CURRENT_DATE","CURRENT_TIME","BaseDatetime","props","defaultClass","defaultProps","defaultState","format","date","Date","getTime","parse","parseInt","toDate","monitorAndUpdateCurrentTime","stopCurrentTimeMonitor","timerId","setInterval","updateState","readonly","datavalue","now","state","clearInterval","convertTimezone","timezone","getTimezone","parsedDateString","toLocaleString","locale","timeZone","momentPattern","pattern","replaceAll","onPropertyChange","name","$new","$old","invokeEventCallback","prevDatavalue","outputformat","datepattern","dateValue","displayValue","onFieldChange","minDateVal","mindate","isMinMatchingPattern","minDatePatternFormatted","formattedMinDate","maxDateVal","maxdate","isMaxMatchingPattern","maxDatePatternFormatted","formattedMaxDate","disabled","onDateChange","$event","validate","modes","shift","isFocused","showDatePicker","length","timestamp","onBlur","OS","setTimeout","triggerValidation","onFocus","mode","showDatePickerModal","showTimePickerModal","value","validationObj","setState","isValid","errorType","componentWillUnmount","renderWebWidget","createElement","onDismiss","minimumDate","maximumDate","renderNativeWidget","_extends","DATE","is24Hour","display","onChange","event","dateSelected","set","getMonth","getFullYear","getDate","renderNativeIOSWidget","date_change","undefined","style","styles","dialog","actionWrapper","selectBtn","caption","onTap","cancelBtn","renderNativeIOSWidgetWithModal","modalService","nativeModalOptions","content","Fragment","hideModal","centered","onClose","showModal","renderNativeWidgetWithModal","addTouchableOpacity","children","_children$props","hint","accessibilityProps","accessible","accessibilityHint","getTestPropsForAction","onPress","getIcon","renderWidget","_props$floatinglabel","is12HourFormat","test","is24hour","root","invalid","focused","_background","floatinglabel","moveUp","label","placeholder","floatingLabel","activeFloatingLabel","container","text","placeholderText","getTestPropsForLabel","flex","isRTL","flexDirection","textAlign","iconclass","color","clearIcon","id","getTestId","accessibilitylabel","clearBtnClicked","calendarIcon","iswheelpicker","isVisible","minDate","maxDate","selectedDate","onSelect","onCancel","selectedDateTime","time"],"sources":["base-datetime.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, Platform, TouchableOpacity, ViewStyle } from 'react-native';\nimport moment from 'moment';\nimport DateTimePicker, { DateTimePickerEvent } from '@react-native-community/datetimepicker';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\n\nimport WmDatetimeProps from './datetime/datetime.props';\nimport { DEFAULT_CLASS, WmDatetimeStyles } from './datetime/datetime.styles';\nimport WebDatePicker from './date-picker.component';\nimport { isNumber, isString } from 'lodash-es';\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport { isDateFormatAsPerPattern, validateField } from '@wavemaker/app-rn-runtime/core/utils';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { FloatingLabel } from '@wavemaker/app-rn-runtime/core/components/floatinglabel.component';\nimport AppI18nService from '@wavemaker/app-rn-runtime/runtime/services/app-i18n.service';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport WmDatePickerModal from './wheelpickermodal/date/date-picker-modal.component';\nimport WmTimePickerModal from './wheelpickermodal/time/time-picker-modal.component';\n\nexport class BaseDatetimeState extends BaseComponentState<WmDatetimeProps> {\n showDatePicker = false;\n showDatePickerModal = false;\n showTimePickerModal = false;\n dateValue: Date = null as any;\n displayValue: string = null as any;\n isFocused = false;\n timerId: NodeJS.Timer = null as any;\n isValid: boolean = true;\n errorType = '';\n}\n\nconst CURRENT_DATE = 'CURRENT_DATE';\nconst CURRENT_TIME = 'CURRENT_TIME';\n\nexport default abstract class BaseDatetime extends BaseComponent<WmDatetimeProps, BaseDatetimeState, WmDatetimeStyles> {\n clearBtnClicked = false;\n modes = [] as string[];\n nativeModalOptions: ModalOptions = {} as any;\n prevDatavalue: any;\n\n constructor(props: WmDatetimeProps, defaultClass = DEFAULT_CLASS, defaultProps = new WmDatetimeProps(), defaultState= new BaseDatetimeState()) {\n super(props, defaultClass, defaultProps, defaultState);\n }\n\n format(date: Date | number | undefined, format: string) {\n if (format === 'timestamp') {\n return date instanceof Date ? '' + date.getTime() : date;\n }\n return date && moment(date).format(format);\n }\n\n parse(date: string | number, format: string) {\n if (format === 'timestamp') {\n if (isString(date)) {\n return new Date(parseInt(date));\n }\n if (isNumber(date)) {\n return new Date(date);\n }\n }\n return date && moment(date, format).toDate();\n }\n\n private monitorAndUpdateCurrentTime() {\n this.stopCurrentTimeMonitor();\n const timerId = setInterval(() => {\n this.updateState({\n props: {\n readonly: true,\n datavalue: Date.now()\n },\n timerId: timerId\n } as any as BaseDatetimeState);\n }, 1000);\n }\n\n private stopCurrentTimeMonitor() {\n if (this.state.timerId) {\n clearInterval(this.state.timerId as any);\n }\n }\n\n convertTimezone(date: any){ \n const timezone = AppI18nService.getTimezone();\n if (timezone) {\n const parsedDateString = new Date(date).toLocaleString(this.props.locale ? this.props.locale : 'en-us', { timeZone: timezone });\n return moment(parsedDateString, 'M/D/YYYY, h:mm:ss A');\n }\n else {\n return null;\n }\n }\n \n momentPattern(pattern : String) {\n return pattern?.replaceAll('y', 'Y').replaceAll('d', 'D');\n}\n\n onPropertyChange(name: string, $new: any, $old: any) {\n super.onPropertyChange(name, $new, $old);\n const props = this.state.props;\n switch(name) {\n //@ts-ignore\n case 'datavalue':\n this.invokeEventCallback('onChange', [null, this, $new, $old]);\n this.prevDatavalue = $old;\n if (props.datavalue === CURRENT_TIME) {\n this.monitorAndUpdateCurrentTime();\n }\n case 'datepattern':\n case 'outputformat':\n if (props.datavalue && this.momentPattern(props.outputformat as String) && this.momentPattern(props.datepattern as String)) {\n let datavalue: any = props.datavalue;\n if (datavalue === CURRENT_DATE || datavalue === CURRENT_TIME) {\n datavalue = new Date() as any;\n }\n const date = isString(datavalue) ? this.parse(datavalue as string, this.momentPattern(props.outputformat as String)) : datavalue;\n datavalue = this.convertTimezone(datavalue);\n this.updateState({\n dateValue : date,\n displayValue: this.format(datavalue?datavalue:date as any, this.momentPattern(props.datepattern as String))\n } as BaseDatetimeState);\n } else {\n this.updateState({\n dateValue : null as any,\n displayValue: null as any\n } as BaseDatetimeState);\n }\n this.props.onFieldChange && this.props.onFieldChange('datavalue', props.datavalue, this.prevDatavalue);\n break;\n case 'mindate':\n if (isString($new)) {\n const minDateVal = ($new === CURRENT_DATE || $new === CURRENT_TIME) ? new Date() : props.mindate;\n // * check if supplied mindate is as per datepattern\n const isMinMatchingPattern = minDateVal\n ? isDateFormatAsPerPattern(this.momentPattern(props.datepattern as String), minDateVal)\n : false;\n // * min date formatted as per datepattern\n const minDatePatternFormatted = minDateVal && isMinMatchingPattern ? moment(\n moment(\n minDateVal,\n this.momentPattern(props.datepattern as String)\n ).format('YYYY-MM-DD')\n ) : null;\n // * min date formatted as per ISO, if mindate supplied is not as per datepattern\n const formattedMinDate = minDatePatternFormatted && isMinMatchingPattern\n ? minDatePatternFormatted.toDate()\n : moment(minDateVal).toDate();\n this.updateState({\n props: {\n mindate: formattedMinDate\n }\n } as BaseDatetimeState);\n }\n break;\n case 'maxdate':\n if (isString($new)) {\n const maxDateVal = ($new === CURRENT_DATE || $new === CURRENT_TIME) ? new Date() : props.maxdate;\n // * check if supplied maxdate is as per datepattern\n const isMaxMatchingPattern = maxDateVal\n ? isDateFormatAsPerPattern(this.momentPattern(props.datepattern as String), maxDateVal)\n : false;\n // * max date formatted as per datepattern\n const maxDatePatternFormatted = maxDateVal && isMaxMatchingPattern ? moment(\n moment(\n maxDateVal,\n this.momentPattern(props.datepattern as String)\n ).format('YYYY-MM-DD')\n ) : null;\n // * max date formatted as per ISO, if maxdate supplied is not as per datepattern\n const formattedMaxDate = maxDatePatternFormatted && isMaxMatchingPattern\n ? maxDatePatternFormatted.toDate()\n : moment(maxDateVal).toDate();\n\n this.updateState({\n props: {\n maxdate: formattedMaxDate,\n },\n } as BaseDatetimeState);\n }\n break;\n case 'readonly':\n this.updateState({\n props: {\n disabled: $new\n }\n } as BaseDatetimeState)\n break;\n }\n }\n\n onDateChange($event: DateTimePickerEvent, date?: Date) {\n this.validate(date);\n this.modes.shift();\n this.updateState({\n isFocused: false,\n showDatePicker: !!this.modes.length,\n props: {\n datavalue: this.format(date, this.momentPattern(this.state.props.outputformat as String) as string),\n timestamp: this.format(date, 'timestamp')\n }\n } as BaseDatetimeState);\n }\n\n onBlur() {\n if (Platform.OS === 'web') {\n this.validate(this.state.props.datavalue);\n setTimeout(() => this.props.triggerValidation && this.props.triggerValidation());\n }\n this.invokeEventCallback('onBlur', [null, this]);\n }\n\n onFocus() {\n if (!this.state.props.readonly) {\n if (Platform.OS !== 'web' && this.state.props.mode === 'datetime') {\n this.modes = ['date', 'time'];\n } else {\n this.modes = [this.state.props.mode];\n }\n this.updateState({showDatePicker: true, isFocused: true} as BaseDatetimeState);\n if (this.state.props.mode === 'date') {\n this.updateState({showDatePickerModal: true} as BaseDatetimeState);\n }\n if (this.state.props.mode === 'time') {\n this.updateState({showTimePickerModal: true} as BaseDatetimeState);\n }\n if (this.state.props.mode === 'datetime') {\n this.updateState({showDatePickerModal: true} as BaseDatetimeState);\n }\n this.invokeEventCallback('onFocus', [null, this]);\n }\n }\n\n validate(value: any) {\n const validationObj = validateField(this.state.props, value);\n this.setState({\n isValid: validationObj.isValid,\n errorType: validationObj.errorType\n } as BaseDatetimeState)\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n this.stopCurrentTimeMonitor();\n }\n\n renderWebWidget(props: WmDatetimeProps) {\n return (<WebDatePicker\n mode={this.state.props.mode}\n locale={props.locale}\n value={this.state.dateValue || new Date()}\n onDateChange={(date: Date) => this.onDateChange(null as any, date)}\n onDismiss={() =>\n this.updateState({\n isFocused: false,\n showDatePicker: false\n } as BaseDatetimeState, () => this.onBlur())}\n minimumDate={props.mindate as Date}\n maximumDate={props.maxdate as Date}/>);\n }\n\n renderNativeWidget(props: WmDatetimeProps, onDismiss?: Function) {\n return (<DateTimePicker\n mode={this.modes[0] as any}\n {...getAccessibilityProps(AccessibilityWidgetType.DATE, {...this.state.props})}\n value={this.state.dateValue || new Date()}\n is24Hour={true}\n display='default'\n onChange={(event: DateTimePickerEvent, date?: Date) => {\n if (date && this.state.props.mode === 'datetime' && this.modes[0] === 'time') {\n const dateSelected = this.state.dateValue;\n date = moment(date)\n .set('month', dateSelected.getMonth())\n .set('year', dateSelected.getFullYear())\n .set('date', dateSelected.getDate())\n .toDate();\n }\n this.onDateChange(event, date || this.state.dateValue);\n if (this.modes.length <= 1) {\n this.onBlur();\n onDismiss && onDismiss();\n }\n }}\n minimumDate={props.mindate as Date}\n maximumDate={props.maxdate as Date}\n />\n );\n }\n\n renderNativeIOSWidget(props: WmDatetimeProps, onDismiss?: Function) {\n let date_change : any = undefined;\n return (<View style={this.styles.dialog}>\n <DateTimePicker\n mode={this.modes[0] as any}\n value={this.state.dateValue || new Date()}\n is24Hour={true}\n display='spinner'\n onChange={(event: DateTimePickerEvent, date?: Date) => {\n if (date && this.state.props.mode === 'datetime' && this.modes[0] === 'time') {\n const dateSelected = this.state.dateValue;\n date = moment(date)\n .set('month', dateSelected.getMonth())\n .set('year', dateSelected.getFullYear())\n .set('date', dateSelected.getDate())\n .toDate();\n }\n date_change = date;\n }}\n minimumDate={props.mindate as Date}\n maximumDate={props.maxdate as Date}\n />\n <View style={this.styles.actionWrapper}>\n <WmButton styles={this.styles.selectBtn} caption='Select' onTap={() => {\n this.onDateChange(null as any, date_change || this.state.dateValue || new Date());\n if (this.modes.length <= 1) {\n this.onBlur();\n onDismiss && onDismiss();\n }\n }} />\n <WmButton styles={this.styles.cancelBtn} caption='Cancel' onTap={() => {\n this.modes.shift();\n this.onDateChange(null as any, this.state.dateValue || undefined);\n this.onBlur();\n onDismiss && onDismiss();\n }} />\n </View>\n </View>\n );\n }\n\n renderNativeIOSWidgetWithModal(props: WmDatetimeProps) {\n return (<ModalConsumer>{(modalService: ModalService) => {\n this.nativeModalOptions.content = (<>\n {this.renderNativeIOSWidget(props, () => modalService.hideModal(this.nativeModalOptions))}\n </>);\n this.nativeModalOptions.centered = true;\n this.nativeModalOptions.onClose = () => {\n this.onBlur();\n };\n modalService.showModal(this.nativeModalOptions);\n return null;\n }}</ModalConsumer>);\n }\n\n renderNativeWidgetWithModal(props: WmDatetimeProps) {\n return (<ModalConsumer>{(modalService: ModalService) => {\n this.nativeModalOptions.content = (<>\n {this.renderNativeWidget(props, () => modalService.hideModal(this.nativeModalOptions))}\n </>);\n this.nativeModalOptions.centered = true;\n this.nativeModalOptions.onClose = () => {\n this.onBlur();\n };\n modalService.showModal(this.nativeModalOptions);\n return null;\n }}</ModalConsumer>);\n }\n\n addTouchableOpacity(props: WmDatetimeProps, children: React.JSX.Element, styles?: any) : React.ReactNode{\n const hint = children?.props?.hint;\n const accessibilityProps = hint ? {accessible: true, accessibilityHint: hint} : {};\n\n return (\n <TouchableOpacity \n {...this.getTestPropsForAction()} \n {...accessibilityProps}\n style={styles} onPress={() => {\n if (!props.readonly) {\n this.onFocus();\n }\n this.invokeEventCallback('onTap', [null, this]);\n }}>\n {children}\n </TouchableOpacity>\n );\n }\n\n getIcon() {\n if (this.state.props.mode === 'time') {\n return 'wm-sl-l sl-time'\n }\n return 'wm-sl-l sl-calendar';\n }\n\n renderWidget(props: WmDatetimeProps) {\n const is12HourFormat = props?.datepattern && /hh:mm(:ss|:sss)? a/.test(props.datepattern);\n const is24Hour = is12HourFormat ? false : props.is24hour;\n return ( \n this.addTouchableOpacity(props, (\n <View style={[this.styles.root, this.state.isValid ? {} : this.styles.invalid, this.state.isFocused ? this.styles.focused : null]}>\n {this._background}\n {props.floatinglabel ? (\n <FloatingLabel\n moveUp={!!(props.datavalue || this.state.isFocused)}\n label={props.floatinglabel ?? props.placeholder} \n style={{\n ...(this.styles.floatingLabel || []),\n ...(this.state.isFocused ? (this.styles.activeFloatingLabel || {}) : {})\n }}\n />\n ) : null}\n <View style={this.styles.container}>\n {this.addTouchableOpacity(props, (\n <Text style={[\n this.styles.text,\n this.state.displayValue ? {} : this.styles.placeholderText\n ]}\n {...this.getTestPropsForLabel()}>\n {this.state.displayValue \n || (props.floatinglabel ? '' : this.state.props.placeholder)}\n </Text>\n ), [{ flex: 1}, this.isRTL?{flexDirection:'row', textAlign:'right'}:{}] )}\n {(!props.readonly && props.datavalue &&\n (<WmIcon iconclass=\"wi wi-clear\"\n styles={{color: this.styles.text.color, ...this.styles.clearIcon}}\n id={this.getTestId('clearicon')}\n accessibilitylabel={`clear ${props?.mode}`}\n onTap={() => {\n this.onDateChange(null as any, null as any);\n this.clearBtnClicked = true;\n }}/>)) || null}\n {this.addTouchableOpacity(props, (\n <WmIcon iconclass={this.getIcon()} styles={{color: this.styles.text.color, ...this.styles.calendarIcon}} hint={props?.hint} id={this.getTestId('calendericon')}/>\n ))}\n </View>\n {\n this.state.showDatePicker\n && ((Platform.OS === 'web' && this.renderWebWidget(props))\n || (!props.iswheelpicker && Platform.OS === 'android' && this.renderNativeWidget(props))\n || (!props.iswheelpicker && Platform.OS === 'ios' && this.renderNativeIOSWidgetWithModal(props)))\n }\n {(Platform.OS !== 'web' && props.iswheelpicker && this.state.showDatePickerModal) && (\n <WmDatePickerModal\n isVisible={this.state.showDatePickerModal}\n onClose={() => this.updateState({showDatePickerModal: false} as BaseDatetimeState)}\n minDate={props.mindate}\n maxDate={props.maxdate}\n selectedDate={this.state.dateValue}\n onSelect={(date: Date) => {\n this.onDateChange(null as any, date);\n this.updateState({\n isFocused: false,\n showDatePickerModal: false\n } as BaseDatetimeState, () => {\n this.onBlur();\n\n // * showing time picker after selecting date in datetime mode\n if (this.state.props.mode === \"datetime\") {\n this.setState({\n showTimePickerModal: true,\n })\n }\n });\n }}\n onCancel={() => {\n // this.onDateChange(null as any, this.state.dateValue || undefined);\n this.updateState({\n isFocused: false,\n showDatePickerModal: false\n } as BaseDatetimeState, () => this.onBlur());\n }}\n />\n )}\n {(Platform.OS !== 'web' && props.iswheelpicker && this.state.showTimePickerModal) && (\n <WmTimePickerModal\n selectedDateTime={this.state.dateValue}\n is24Hour={is24Hour}\n isVisible={this.state.showTimePickerModal}\n onClose={() => this.updateState({isFocused: false, showTimePickerModal: false} as BaseDatetimeState)}\n onSelect={(time: Date) => {\n this.onDateChange(null as any, time);\n this.updateState({\n isFocused: false,\n showTimePickerModal: false\n } as BaseDatetimeState, () => this.onBlur());\n }}\n onCancel={() => {\n // this.onDateChange(null as any, this.state.dateValue || undefined);\n this.updateState({\n isFocused: false,\n showTimePickerModal: false\n } as BaseDatetimeState, () => {\n this.onBlur();\n this.modes.shift();\n });\n }}\n />\n )}\n </View>\n ))\n );\n }\n}\n\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SA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AW,CAAC;UACf2C,SAAS,EAAE,KAAK;UAChBW,mBAAmB,EAAE;QACvB,CAAC,EAAuB,MAAM,IAAI,CAACP,MAAM,CAAC,CAAC,CAAC;MAC9C,CAAE;MACFmG,QAAQ,EAAEA,CAAA,KAAM;QACd;QACA,IAAI,CAAClJ,WAAW,CAAC;UACf2C,SAAS,EAAE,KAAK;UAChBW,mBAAmB,EAAE;QACvB,CAAC,EAAuB,MAAM;UAC5B,IAAI,CAACP,MAAM,CAAC,CAAC;UACb,IAAI,CAACN,KAAK,CAACC,KAAK,CAAC,CAAC;QACpB,CAAC,CAAC;MACJ;IAAE,CACH,CAEC,CACL,CAAC;EAER;AACF","ignoreList":[]}
|
@@ -4,24 +4,81 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
4
4
|
import React, { Component } from 'react';
|
5
5
|
import { PixelRatio, StyleSheet, View } from 'react-native';
|
6
6
|
import WmWheelScrollPicker from './wheelpicker/wheelpicker.component';
|
7
|
-
import { getDateObject, getDates, getMonths, getYearRange } from '@wavemaker/app-rn-runtime/core/utils';
|
7
|
+
import { getDateObject, getDates, getMonthIndex, getMonths, getYearRange } from '@wavemaker/app-rn-runtime/core/utils';
|
8
|
+
import moment from 'moment';
|
8
9
|
export class WmWheelDatePickerProps {
|
9
10
|
constructor() {
|
11
|
+
_defineProperty(this, "minDate", void 0);
|
12
|
+
_defineProperty(this, "maxDate", void 0);
|
10
13
|
_defineProperty(this, "selectedDate", new Date());
|
11
14
|
_defineProperty(this, "onDateChange", void 0);
|
12
15
|
_defineProperty(this, "itemHeight", PixelRatio.roundToNearestPixel(50));
|
13
16
|
_defineProperty(this, "wrapperHeight", PixelRatio.roundToNearestPixel(150));
|
14
17
|
}
|
15
18
|
}
|
19
|
+
export const START_DATE = {
|
20
|
+
'date': 1,
|
21
|
+
'month': 0,
|
22
|
+
'year': 1950
|
23
|
+
};
|
24
|
+
export const END_DATE = {
|
25
|
+
'date': 31,
|
26
|
+
'month': 11,
|
27
|
+
'year': 2060
|
28
|
+
};
|
16
29
|
export class WmWheelDatePickerState {}
|
17
30
|
export class WmWheelDatePicker extends Component {
|
18
|
-
constructor(
|
19
|
-
|
31
|
+
constructor(_props) {
|
32
|
+
var _selectedDate$getFull;
|
33
|
+
super(_props);
|
20
34
|
_defineProperty(this, "itemHeight", void 0);
|
21
35
|
_defineProperty(this, "wrapperHeight", void 0);
|
22
36
|
_defineProperty(this, "selectedDateIndex", 0);
|
23
37
|
_defineProperty(this, "selectedMonthIndex", 0);
|
24
38
|
_defineProperty(this, "selectedYearIndex", 0);
|
39
|
+
_defineProperty(this, "dateData", []);
|
40
|
+
_defineProperty(this, "monthData", []);
|
41
|
+
_defineProperty(this, "yearData", []);
|
42
|
+
_defineProperty(this, "defaultSelectedDate", void 0);
|
43
|
+
_defineProperty(this, "localSelectedDate", '');
|
44
|
+
_defineProperty(this, "monthValue", 0);
|
45
|
+
_defineProperty(this, "yearValue", '');
|
46
|
+
_defineProperty(this, "getMinValue", (minValue, type) => {
|
47
|
+
const currentMonth = moment(minValue).format('M');
|
48
|
+
const currentYear = moment(minValue).format('YYYY');
|
49
|
+
const selectedMonth = moment(this.localSelectedDate).format('M');
|
50
|
+
const selectedYear = moment(this.localSelectedDate).format('YYYY');
|
51
|
+
const isFutureMonth = Number(selectedMonth) > Number(currentMonth);
|
52
|
+
const isFutureYear = Number(selectedYear) > Number(currentYear);
|
53
|
+
if (!(minValue instanceof Date)) return START_DATE[type];
|
54
|
+
switch (type) {
|
55
|
+
case 'date':
|
56
|
+
const dateValue = isFutureYear ? 1 : isFutureMonth ? 1 : new Date(minValue).getDate();
|
57
|
+
// this.selectedDateIndex = dateIndex;
|
58
|
+
return dateValue;
|
59
|
+
case 'month':
|
60
|
+
const monthValue = isFutureYear ? 0 : new Date(minValue).getMonth();
|
61
|
+
// this.selectedMonthIndex = 11;
|
62
|
+
return monthValue;
|
63
|
+
case 'year':
|
64
|
+
return new Date(minValue).getFullYear();
|
65
|
+
default:
|
66
|
+
return 0;
|
67
|
+
}
|
68
|
+
});
|
69
|
+
_defineProperty(this, "getMaxValue", (maxValue, type) => {
|
70
|
+
if (!(maxValue instanceof Date)) return END_DATE[type];
|
71
|
+
switch (type) {
|
72
|
+
case 'date':
|
73
|
+
return new Date(maxValue).getDate();
|
74
|
+
case 'month':
|
75
|
+
return new Date(maxValue).getMonth();
|
76
|
+
case 'year':
|
77
|
+
return new Date(maxValue).getFullYear();
|
78
|
+
default:
|
79
|
+
return 0;
|
80
|
+
}
|
81
|
+
});
|
25
82
|
_defineProperty(this, "handleValueChange", (valueType, value, index) => {
|
26
83
|
var _this$props, _this$props$onDateCha;
|
27
84
|
switch (valueType) {
|
@@ -29,31 +86,85 @@ export class WmWheelDatePicker extends Component {
|
|
29
86
|
this.selectedDateIndex = index;
|
30
87
|
break;
|
31
88
|
case 'month':
|
89
|
+
this.monthValue = getMonthIndex(value === null || value === void 0 ? void 0 : value.toString());
|
32
90
|
this.selectedMonthIndex = index;
|
33
91
|
break;
|
34
92
|
case 'year':
|
93
|
+
this.yearValue = value;
|
35
94
|
this.selectedYearIndex = index;
|
36
95
|
break;
|
37
96
|
default:
|
38
97
|
break;
|
39
98
|
}
|
40
|
-
const
|
41
|
-
|
42
|
-
|
99
|
+
const {
|
100
|
+
props
|
101
|
+
} = this;
|
102
|
+
const minDate = props.minDate;
|
103
|
+
const maxDate = props.maxDate;
|
104
|
+
// * date range
|
105
|
+
const minDateNum = minDate ? this.getMinValue(minDate, 'date') : 1;
|
106
|
+
const maxDateNum = maxDate ? this.getMaxValue(maxDate, 'date') : 31;
|
107
|
+
const minYear = minDate ? this.getMinValue(minDate, 'year') : 1950;
|
108
|
+
const maxYear = maxDate ? this.getMaxValue(maxDate, 'year') : 2060;
|
109
|
+
const selectedDate = getDates(minDateNum, maxDateNum)[this.selectedDateIndex];
|
110
|
+
const selectedMonthIndex = this.monthValue;
|
111
|
+
const selectedYear = getYearRange(minYear, maxYear)[this.selectedYearIndex];
|
112
|
+
const dateObj = getDateObject(selectedDate, selectedMonthIndex, selectedYear);
|
113
|
+
this.localSelectedDate = dateObj;
|
43
114
|
(_this$props = this.props) === null || _this$props === void 0 || (_this$props$onDateCha = _this$props.onDateChange) === null || _this$props$onDateCha === void 0 || _this$props$onDateCha.call(_this$props, dateObj);
|
44
115
|
});
|
45
116
|
const _selectedDate = this.props.selectedDate || new Date();
|
46
117
|
this.itemHeight = PixelRatio.roundToNearestPixel(this.props.itemHeight || 50) || PixelRatio.roundToNearestPixel(50);
|
47
118
|
this.wrapperHeight = PixelRatio.roundToNearestPixel(this.props.wrapperHeight || 150) || PixelRatio.roundToNearestPixel(150);
|
48
|
-
|
49
|
-
|
50
|
-
this.
|
119
|
+
|
120
|
+
// * Initial values
|
121
|
+
this.defaultSelectedDate = _selectedDate;
|
122
|
+
this.localSelectedDate = _selectedDate;
|
123
|
+
this.monthValue = _selectedDate.getMonth();
|
124
|
+
this.yearValue = (_selectedDate$getFull = _selectedDate.getFullYear()) === null || _selectedDate$getFull === void 0 ? void 0 : _selectedDate$getFull.toString();
|
125
|
+
|
126
|
+
// TODO: selected date handling for range of dates
|
127
|
+
if (!(this.props.minDate || this.props.maxDate)) {
|
128
|
+
this.selectedDateIndex = _selectedDate.getDate() - 1;
|
129
|
+
this.selectedMonthIndex = _selectedDate.getMonth();
|
130
|
+
this.selectedYearIndex = getYearRange().indexOf(_selectedDate.getFullYear());
|
131
|
+
}
|
132
|
+
}
|
133
|
+
// TODO: cache this func for performance improvement
|
134
|
+
getPickerData(type) {
|
135
|
+
const {
|
136
|
+
props
|
137
|
+
} = this;
|
138
|
+
const minDate = props.minDate;
|
139
|
+
const maxDate = props.maxDate;
|
140
|
+
const minDateNum = minDate ? this.getMinValue(minDate, 'date') : 1;
|
141
|
+
const maxDateNum = maxDate ? this.getMaxValue(maxDate, 'date') : 31;
|
142
|
+
const minMonth = minDate ? this.getMinValue(minDate, 'month') : 0;
|
143
|
+
const maxMonth = maxDate ? this.getMaxValue(maxDate, 'month') : 11;
|
144
|
+
const minYear = minDate ? this.getMinValue(minDate, 'year') : 1950;
|
145
|
+
const maxYear = maxDate ? this.getMaxValue(maxDate, 'year') : 2060;
|
146
|
+
switch (type) {
|
147
|
+
case "date":
|
148
|
+
const dateData = getDates(minDateNum, maxDateNum);
|
149
|
+
this.dateData = dateData;
|
150
|
+
return dateData;
|
151
|
+
case "month":
|
152
|
+
const monthData = getMonths(minMonth, maxMonth);
|
153
|
+
this.monthData = monthData;
|
154
|
+
return monthData;
|
155
|
+
case "year":
|
156
|
+
const yearData = getYearRange(minYear, maxYear);
|
157
|
+
this.yearData = yearData;
|
158
|
+
return yearData;
|
159
|
+
default:
|
160
|
+
return [];
|
161
|
+
}
|
51
162
|
}
|
52
163
|
render() {
|
53
164
|
return /*#__PURE__*/React.createElement(View, {
|
54
165
|
style: styles.root
|
55
166
|
}, /*#__PURE__*/React.createElement(WmWheelScrollPicker, {
|
56
|
-
data:
|
167
|
+
data: this.getPickerData('date'),
|
57
168
|
wrapperHeight: this.wrapperHeight,
|
58
169
|
itemHeight: this.itemHeight,
|
59
170
|
selectedIndex: this.selectedDateIndex,
|
@@ -61,13 +172,13 @@ export class WmWheelDatePicker extends Component {
|
|
61
172
|
}), /*#__PURE__*/React.createElement(View, {
|
62
173
|
style: styles.middle
|
63
174
|
}, /*#__PURE__*/React.createElement(WmWheelScrollPicker, {
|
64
|
-
data:
|
175
|
+
data: this.getPickerData('month'),
|
65
176
|
wrapperHeight: this.wrapperHeight,
|
66
177
|
itemHeight: this.itemHeight,
|
67
178
|
selectedIndex: this.selectedMonthIndex,
|
68
179
|
onValueChange: (value, index) => this.handleValueChange('month', value, index)
|
69
180
|
})), /*#__PURE__*/React.createElement(WmWheelScrollPicker, {
|
70
|
-
data:
|
181
|
+
data: this.getPickerData('year'),
|
71
182
|
wrapperHeight: this.wrapperHeight,
|
72
183
|
itemHeight: this.itemHeight,
|
73
184
|
selectedIndex: this.selectedYearIndex,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Component","PixelRatio","StyleSheet","View","WmWheelScrollPicker","getDateObject","getDates","getMonths","getYearRange","WmWheelDatePickerProps","constructor","_defineProperty","Date","roundToNearestPixel","WmWheelDatePickerState","WmWheelDatePicker","props","valueType","value","index","_this$props","_this$props$onDateCha","selectedDateIndex","selectedMonthIndex","selectedYearIndex","selectedDate","selectedYear","dateObj","onDateChange","call","itemHeight","wrapperHeight","getDate","getMonth","indexOf","getFullYear","render","createElement","style","styles","root","data","selectedIndex","onValueChange","handleValueChange","middle","create","flexDirection","marginHorizontal"],"sources":["wheel-date-picker.component.tsx"],"sourcesContent":["import React, { Component } from 'react';\nimport { PixelRatio, StyleSheet, View } from 'react-native';\nimport WmWheelScrollPicker from './wheelpicker/wheelpicker.component'\nimport { getDateObject, getDates, getMonths, getYearRange } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class WmWheelDatePickerProps {\n selectedDate?: Date = new Date();\n onDateChange?: (date: Date) => void;\n itemHeight?: number = PixelRatio.roundToNearestPixel(50);\n wrapperHeight?: number = PixelRatio.roundToNearestPixel(150);\n}\n\nexport class WmWheelDatePickerState {}\n\nexport class WmWheelDatePicker extends Component<\n WmWheelDatePickerProps,\n WmWheelDatePickerState,\n any\n> {\n itemHeight: number;\n wrapperHeight: number;\n selectedDateIndex: number = 0;\n selectedMonthIndex: number = 0;\n selectedYearIndex: number = 0;\n\n constructor(props: WmWheelDatePickerProps) {\n super(props);\n const selectedDate = this.props.selectedDate || new Date();\n\n this.itemHeight =\n PixelRatio.roundToNearestPixel(this.props.itemHeight || 50) || PixelRatio.roundToNearestPixel(50);\n this.wrapperHeight =\n PixelRatio.roundToNearestPixel(this.props.wrapperHeight || 150) || PixelRatio.roundToNearestPixel(150);\n this.selectedDateIndex = selectedDate.getDate() - 1;\n this.selectedMonthIndex = selectedDate.getMonth();\n this.selectedYearIndex = getYearRange().indexOf(selectedDate.getFullYear());\n }\n\n handleValueChange = (\n valueType: 'date' | 'month' | 'year',\n value: string | number,\n index: number,\n ) => {\n switch (valueType) {\n case 'date':\n this.selectedDateIndex = index;\n break;\n case 'month':\n this.selectedMonthIndex = index;\n break;\n case 'year':\n this.selectedYearIndex = index;\n break;\n default:\n break;\n }\n\n const selectedDate = getDates()[this.selectedDateIndex];\n const selectedYear = getYearRange()[this.selectedYearIndex];\n const dateObj = getDateObject(\n selectedDate,\n this.selectedMonthIndex,\n selectedYear,\n );\n\n this.props?.onDateChange?.(dateObj);\n };\n\n render() {\n return (\n <View style={styles.root}>\n <WmWheelScrollPicker\n data={getDates()}\n wrapperHeight={this.wrapperHeight}\n itemHeight={this.itemHeight}\n selectedIndex={this.selectedDateIndex}\n onValueChange={(value: string | number, index: number) =>\n this.handleValueChange('date', value, index)\n }\n />\n <View style={styles.middle}>\n <WmWheelScrollPicker\n data={getMonths()}\n wrapperHeight={this.wrapperHeight}\n itemHeight={this.itemHeight}\n selectedIndex={this.selectedMonthIndex}\n onValueChange={(value: string | number, index: number) =>\n this.handleValueChange('month', value, index)\n }\n />\n </View>\n <WmWheelScrollPicker\n data={getYearRange()}\n wrapperHeight={this.wrapperHeight}\n itemHeight={this.itemHeight}\n selectedIndex={this.selectedYearIndex}\n onValueChange={(value: string | number, index: number) =>\n this.handleValueChange('year', value, index)\n }\n />\n </View>\n );\n }\n}\n\nexport default WmWheelDatePicker;\n\nconst styles = StyleSheet.create({\n root: {\n flexDirection: 'row',\n },\n middle: {\n marginHorizontal: 15,\n },\n});\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,UAAU,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC3D,OAAOC,mBAAmB,MAAM,qCAAqC;AACrE,SAASC,aAAa,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,YAAY,QAAQ,sCAAsC;AAEvG,OAAO,MAAMC,sBAAsB,CAAC;EAAAC,YAAA;IAAAC,eAAA,uBACZ,IAAIC,IAAI,CAAC,CAA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A,aAAc;MAClCD,UAAU,EAAE,IAAI,CAACA,UAAW;MAC5BY,aAAa,EAAE,IAAI,CAACnB,kBAAmB;MACvCoB,aAAa,EAAEA,CAACzB,KAAsB,EAAEC,KAAa,KACnD,IAAI,CAACyB,iBAAiB,CAAC,OAAO,EAAE1B,KAAK,EAAEC,KAAK;IAC7C,CACF,CACG,CAAC,eACPpB,KAAA,CAAAsC,aAAA,CAACjC,mBAAmB;MAClBqC,IAAI,EAAEjC,YAAY,CAAC,CAAE;MACrBuB,aAAa,EAAE,IAAI,CAACA,aAAc;MAClCD,UAAU,EAAE,IAAI,CAACA,UAAW;MAC5BY,aAAa,EAAE,IAAI,CAAClB,iBAAkB;MACtCmB,aAAa,EAAEA,CAACzB,KAAsB,EAAEC,KAAa,KACnD,IAAI,CAACyB,iBAAiB,CAAC,MAAM,EAAE1B,KAAK,EAAEC,KAAK;IAC5C,CACF,CACG,CAAC;EAEX;AACF;AAEA,eAAeJ,iBAAiB;AAEhC,MAAMwB,MAAM,GAAGrC,UAAU,CAAC4C,MAAM,CAAC;EAC/BN,IAAI,EAAE;IACJO,aAAa,EAAE;EACjB,CAAC;EACDF,MAAM,EAAE;IACNG,gBAAgB,EAAE;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","Component","PixelRatio","StyleSheet","View","WmWheelScrollPicker","getDateObject","getDates","getMonthIndex","getMonths","getYearRange","moment","WmWheelDatePickerProps","constructor","_defineProperty","Date","roundToNearestPixel","START_DATE","END_DATE","WmWheelDatePickerState","WmWheelDatePicker","props","_selectedDate$getFull","minValue","type","currentMonth","format","currentYear","selectedMonth","localSelectedDate","selectedYear","isFutureMonth","Number","isFutureYear","dateValue","getDate","monthValue","getMonth","getFullYear","maxValue","valueType","value","index","_this$props","_this$props$onDateCha","selectedDateIndex","toString","selectedMonthIndex","yearValue","selectedYearIndex","minDate","maxDate","minDateNum","getMinValue","maxDateNum","getMaxValue","minYear","maxYear","selectedDate","dateObj","onDateChange","call","itemHeight","wrapperHeight","defaultSelectedDate","indexOf","getPickerData","minMonth","maxMonth","dateData","monthData","yearData","render","createElement","style","styles","root","data","selectedIndex","onValueChange","handleValueChange","middle","create","flexDirection","marginHorizontal"],"sources":["wheel-date-picker.component.tsx"],"sourcesContent":["import React, { Component } from 'react';\nimport { PixelRatio, StyleSheet, View } from 'react-native';\nimport WmWheelScrollPicker from './wheelpicker/wheelpicker.component'\nimport { getDateObject, getDates, getMonthIndex, getMonths, getYearRange } from '@wavemaker/app-rn-runtime/core/utils';\nimport moment from 'moment';\n\nexport class WmWheelDatePickerProps {\n minDate?: Date | string;\n maxDate?: Date | string;\n selectedDate?: Date = new Date();\n onDateChange?: (date: Date) => void;\n itemHeight?: number = PixelRatio.roundToNearestPixel(50);\n wrapperHeight?: number = PixelRatio.roundToNearestPixel(150);\n}\n\nexport const START_DATE = {\n 'date': 1,\n 'month': 0,\n 'year': 1950,\n};\n\nexport const END_DATE = {\n 'date': 31,\n 'month': 11,\n 'year': 2060,\n};\n\nexport class WmWheelDatePickerState {}\n\nexport class WmWheelDatePicker extends Component<\n WmWheelDatePickerProps,\n WmWheelDatePickerState,\n any\n> {\n itemHeight: number;\n wrapperHeight: number;\n selectedDateIndex: number = 0;\n selectedMonthIndex: number = 0;\n selectedYearIndex: number = 0;\n dateData: number[] = [];\n monthData: string[] = [];\n yearData: number[] = [];\n defaultSelectedDate: Date;\n localSelectedDate: Date | string = '';\n monthValue: number = 0;\n yearValue: string = '';\n\n constructor(props: WmWheelDatePickerProps) {\n super(props);\n const selectedDate = this.props.selectedDate || new Date();\n\n this.itemHeight =\n PixelRatio.roundToNearestPixel(this.props.itemHeight || 50) || PixelRatio.roundToNearestPixel(50);\n this.wrapperHeight =\n PixelRatio.roundToNearestPixel(this.props.wrapperHeight || 150) || PixelRatio.roundToNearestPixel(150);\n\n // * Initial values\n this.defaultSelectedDate = selectedDate;\n this.localSelectedDate = selectedDate;\n this.monthValue = selectedDate.getMonth();\n this.yearValue = selectedDate.getFullYear()?.toString();\n\n // TODO: selected date handling for range of dates\n if (!(this.props.minDate || this.props.maxDate)) {\n this.selectedDateIndex = selectedDate.getDate() - 1;\n this.selectedMonthIndex = selectedDate.getMonth();\n this.selectedYearIndex = getYearRange().indexOf(selectedDate.getFullYear());\n }\n }\n\n getMinValue = (minValue: string | Date, type: 'date' | 'month' | 'year') => {\n const currentMonth = moment(minValue).format('M');\n const currentYear = moment(minValue).format('YYYY');\n const selectedMonth = moment(this.localSelectedDate).format('M');\n const selectedYear = moment(this.localSelectedDate).format('YYYY');\n const isFutureMonth = Number(selectedMonth) > Number(currentMonth);\n const isFutureYear = Number(selectedYear) > Number(currentYear);\n\n if (!(minValue instanceof Date)) return START_DATE[type];\n\n switch(type) {\n case 'date':\n const dateValue =\n isFutureYear\n ? 1\n : isFutureMonth\n ? 1\n : new Date(minValue).getDate();\n // this.selectedDateIndex = dateIndex;\n return dateValue;\n case 'month':\n const monthValue = isFutureYear ? 0 : new Date(minValue).getMonth();\n // this.selectedMonthIndex = 11;\n return monthValue;\n case 'year':\n return new Date(minValue).getFullYear();\n default:\n return 0;\n }\n }\n\n getMaxValue = (maxValue: string | Date | undefined, type: 'date' | 'month' | 'year') => {\n if (!(maxValue instanceof Date)) return END_DATE[type];\n\n switch(type) {\n case 'date':\n return new Date(maxValue).getDate();\n case 'month':\n return new Date(maxValue).getMonth();\n case 'year':\n return new Date(maxValue).getFullYear();\n default:\n return 0;\n }\n }\n\n handleValueChange = (\n valueType: 'date' | 'month' | 'year',\n value: string | number,\n index: number,\n ) => {\n switch (valueType) {\n case 'date':\n this.selectedDateIndex = index;\n break;\n case 'month':\n this.monthValue = getMonthIndex(value?.toString());\n this.selectedMonthIndex = index;\n break;\n case 'year':\n this.yearValue = value as string;\n this.selectedYearIndex = index;\n break;\n default:\n break;\n }\n\n const {props} = this;\n const minDate = props.minDate;\n const maxDate = props.maxDate;\n // * date range\n const minDateNum = minDate ? this.getMinValue(minDate, 'date') : 1;\n const maxDateNum = maxDate ? this.getMaxValue(maxDate, 'date') : 31;\n const minYear = minDate ? this.getMinValue(minDate, 'year') : 1950;\n const maxYear = maxDate ? this.getMaxValue(maxDate, 'year') : 2060;\n\n const selectedDate = getDates(minDateNum, maxDateNum)[this.selectedDateIndex];\n const selectedMonthIndex = this.monthValue;\n const selectedYear = getYearRange(minYear, maxYear)[this.selectedYearIndex];\n\n const dateObj = getDateObject(\n selectedDate,\n selectedMonthIndex,\n selectedYear,\n );\n this.localSelectedDate = dateObj;\n\n this.props?.onDateChange?.(dateObj);\n };\n\n // TODO: cache this func for performance improvement\n getPickerData(type: 'date' | 'month' | 'year') {\n const {props} = this;\n const minDate = props.minDate;\n const maxDate = props.maxDate;\n const minDateNum = minDate ? this.getMinValue(minDate, 'date') : 1;\n const maxDateNum = maxDate ? this.getMaxValue(maxDate, 'date') : 31;\n const minMonth = minDate ? this.getMinValue(minDate, 'month') : 0;\n const maxMonth = maxDate ? this.getMaxValue(maxDate, 'month') : 11;\n const minYear = minDate ? this.getMinValue(minDate, 'year') : 1950;\n const maxYear = maxDate ? this.getMaxValue(maxDate, 'year') : 2060;\n\n switch (type) {\n case \"date\":\n const dateData = getDates(minDateNum, maxDateNum);\n this.dateData = dateData;\n return dateData;\n case \"month\":\n const monthData = getMonths(minMonth, maxMonth);\n this.monthData = monthData;\n return monthData;\n case \"year\":\n const yearData = getYearRange(minYear, maxYear);\n this.yearData = yearData;\n return yearData;\n default:\n return [];\n }\n }\n\n render() {\n return (\n <View style={styles.root}>\n <WmWheelScrollPicker\n data={this.getPickerData('date')}\n wrapperHeight={this.wrapperHeight}\n itemHeight={this.itemHeight}\n selectedIndex={this.selectedDateIndex}\n onValueChange={(value: string | number, index: number) =>\n this.handleValueChange('date', value, index)\n }\n />\n <View style={styles.middle}>\n <WmWheelScrollPicker\n data={this.getPickerData('month')}\n wrapperHeight={this.wrapperHeight}\n itemHeight={this.itemHeight}\n selectedIndex={this.selectedMonthIndex}\n onValueChange={(value: string | number, index: number) =>\n this.handleValueChange('month', value, index)\n }\n />\n </View>\n <WmWheelScrollPicker\n data={this.getPickerData('year')}\n wrapperHeight={this.wrapperHeight}\n itemHeight={this.itemHeight}\n selectedIndex={this.selectedYearIndex}\n onValueChange={(value: string | number, index: number) =>\n this.handleValueChange('year', value, index)\n }\n />\n </View>\n );\n }\n}\n\nexport default WmWheelDatePicker;\n\nconst styles = StyleSheet.create({\n root: {\n flexDirection: 'row',\n },\n middle: {\n marginHorizontal: 15,\n },\n});\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,UAAU,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC3D,OAAOC,mBAAmB,MAAM,qCAAqC;AACrE,SAASC,aAAa,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,SAAS,EAAEC,YAAY,QAAQ,sCAAsC;AACtH,OAAOC,MAAM,MAAM,QAAQ;AAE3B,OAAO,MAAMC,sBAAsB,CAAC;EAAAC,YAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA,uBAGZ,IAAIC,IAAI,CAAC,CAAC;IAAAD,eAAA;IAAAA,eAAA,qBAEVZ,UAAU,CAACc,mBAAmB,CAAC,EAAE,CAAC;IAAAF,eAAA,wBAC/BZ,UAAU,CAACc,mBAAmB,CAAC,GAAG,CAAC;EAAA;AAC9D;AAEA,OAAO,MAAMC,UAAU,GAAG;EACxB,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,CAAC;EACV,MAAM,EAAE;AACV,CAAC;AAED,OAAO,MAAMC,QAAQ,GAAG;EACtB,MAAM,EAAE,EAAE;EACV,OAAO,EAAE,EAAE;EACX,MAAM,EAAE;AACV,CAAC;AAED,OAAO,MAAMC,sBAAsB,CAAC;AAEpC,OAAO,MAAMC,iBAAiB,SAASnB,SAAS,CAI9C;EAcAY,WAAWA,CAACQ,MAA6B,EAAE;IAAA,IAAAC,qBAAA;IACzC,KAAK,CAACD,MAAK,CAA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AAa,EAAEA,CAACtC,KAAsB,EAAEC,KAAa,KACnD,IAAI,CAACsC,iBAAiB,CAAC,MAAM,EAAEvC,KAAK,EAAEC,KAAK;IAC5C,CACF,CAAC,eACF1C,KAAA,CAAAyE,aAAA,CAACrE,IAAI;MAACsE,KAAK,EAAEC,MAAM,CAACM;IAAO,gBACzBjF,KAAA,CAAAyE,aAAA,CAACpE,mBAAmB;MAClBwE,IAAI,EAAE,IAAI,CAACX,aAAa,CAAC,OAAO,CAAE;MAClCH,aAAa,EAAE,IAAI,CAACA,aAAc;MAClCD,UAAU,EAAE,IAAI,CAACA,UAAW;MAC5BgB,aAAa,EAAE,IAAI,CAAC/B,kBAAmB;MACvCgC,aAAa,EAAEA,CAACtC,KAAsB,EAAEC,KAAa,KACnD,IAAI,CAACsC,iBAAiB,CAAC,OAAO,EAAEvC,KAAK,EAAEC,KAAK;IAC7C,CACF,CACG,CAAC,eACP1C,KAAA,CAAAyE,aAAA,CAACpE,mBAAmB;MAClBwE,IAAI,EAAE,IAAI,CAACX,aAAa,CAAC,MAAM,CAAE;MACjCH,aAAa,EAAE,IAAI,CAACA,aAAc;MAClCD,UAAU,EAAE,IAAI,CAACA,UAAW;MAC5BgB,aAAa,EAAE,IAAI,CAAC7B,iBAAkB;MACtC8B,aAAa,EAAEA,CAACtC,KAAsB,EAAEC,KAAa,KACnD,IAAI,CAACsC,iBAAiB,CAAC,MAAM,EAAEvC,KAAK,EAAEC,KAAK;IAC5C,CACF,CACG,CAAC;EAEX;AACF;AAEA,eAAetB,iBAAiB;AAEhC,MAAMuD,MAAM,GAAGxE,UAAU,CAAC+E,MAAM,CAAC;EAC/BN,IAAI,EAAE;IACJO,aAAa,EAAE;EACjB,CAAC;EACDF,MAAM,EAAE;IACNG,gBAAgB,EAAE;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","createRef","Text","View","ScrollView","DEFAULT_CLASS","BaseComponent","BaseComponentState","WmWheelPickerState","constructor","args","_defineProperty","WmWheelScrollPicker","props","event","selectedIdx","Math","round","nativeEvent","contentOffset","y","itemHeight","setState","selectedIndex","_this$props$onValueCh","_this$props","state","selectedData","data","onValueChange","call","wheelPickerRef","initialScrollTo","_this$wheelPickerRef","_this$wheelPickerRef$","current","scrollTo","animated","renderWidget","styles","wrapperHeight","scrollOffset","createElement","style","root","height","ref","scrollEventThrottle","contentContainerStyle","paddingVertical","showsVerticalScrollIndicator","onLayout","onScroll","handleWheelScroll","onMomentumScrollEnd","handleWheelMomentumEnd","decelerationRate","snapToInterval","map","item","index","isSelected","key","center","itemBg","selectedItemText","itemText","selectedItemBg","top"],"sources":["wheelpicker.component.tsx"],"sourcesContent":["import React, {createRef} from 'react';\nimport {\n NativeScrollEvent,\n NativeSyntheticEvent,\n Text,\n View,\n} from 'react-native';\nimport { ScrollView } from 'react-native-gesture-handler';\nimport WmWheelPickerProps from './wheelpicker.props';\nimport { DEFAULT_CLASS, WmWheelPickerStyles } from './wheelpicker.styles';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport class WmWheelPickerState extends BaseComponentState<WmWheelPickerProps> {\n selectedIndex: number = 0;\n}\n\nexport class WmWheelScrollPicker extends BaseComponent<WmWheelPickerProps, WmWheelPickerState,\n WmWheelPickerStyles> {\n wheelPickerRef: any = null;\n\n constructor(props: WmWheelPickerProps) {\n super(props, DEFAULT_CLASS);\n\n this.wheelPickerRef = createRef();\n }\n\n initialScrollTo() {\n const props = this.props;\n const y = props.itemHeight * props.selectedIndex;\n this.wheelPickerRef?.current?.scrollTo?.({y: y, animated: false});\n this.setState({\n selectedIndex: props.selectedIndex || 0,\n });\n }\n\n handleWheelScroll = (event: NativeSyntheticEvent<NativeScrollEvent>) => {\n // console.log('scroll =>', event.nativeEvent.contentOffset);\n const selectedIdx = Math.round(\n event.nativeEvent.contentOffset.y / this.props.itemHeight,\n );\n\n this.setState({\n selectedIndex: selectedIdx,\n });\n };\n\n handleWheelMomentumEnd = () => {\n const props = this.props;\n const state = this.state;\n\n const selectedData = props.data[state.selectedIndex];\n this.props.onValueChange?.(selectedData, state.selectedIndex);\n };\n\n renderWidget(props: WmWheelPickerProps) {\n const state = this.state;\n const styles = this.styles;\n const {data, wrapperHeight, itemHeight} = props;\n const scrollOffset = (wrapperHeight - itemHeight) / 2;\n\n return (\n <View style={[styles.root, {height: wrapperHeight}]}>\n <ScrollView\n ref={this.wheelPickerRef}\n scrollEventThrottle={16}\n contentContainerStyle={{paddingVertical: scrollOffset}}\n showsVerticalScrollIndicator={false}\n onLayout={() => this.initialScrollTo()}\n onScroll={this.handleWheelScroll}\n onMomentumScrollEnd={this.handleWheelMomentumEnd}\n decelerationRate=\"fast\"\n snapToInterval={itemHeight} // your snap points\n >\n {data.map((item, index) => {\n const isSelected = index === state.selectedIndex;\n\n return (\n <View\n key={`data_item_${index}`}\n style={[styles.center, styles.itemBg, {height: itemHeight}]}>\n <Text\n style={\n isSelected ? [styles.selectedItemText] : [styles.itemText]\n }>\n {item}\n </Text>\n </View>\n );\n })}\n </ScrollView>\n <View\n style={[\n styles.selectedItemBg,\n {\n height: itemHeight,\n top: scrollOffset,\n },\n ]}\n />\n </View>\n );\n }\n}\n\nexport default WmWheelScrollPicker;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAGC,SAAS,QAAO,OAAO;AACtC,SAGEC,IAAI,EACJC,IAAI,QACC,cAAc;AACrB,SAASC,UAAU,QAAQ,8BAA8B;AAEzD,SAASC,aAAa,QAA6B,sBAAsB;AACzE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAO,MAAMC,kBAAkB,SAASD,kBAAkB,CAAqB;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,wBACrD,CAAC;EAAA;AAC3B;AAEA,OAAO,MAAMC,mBAAmB,SAASN,aAAa,CAChC;EAGpBG,WAAWA,CAACI,MAAyB,EAAE;IACrC,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AAE;IAAK,CAAC,CAAC;IACjE,IAAI,CAACf,QAAQ,CAAC;MACZC,aAAa,EAAEV,KAAK,CAACU,aAAa,IAAI;IACxC,CAAC,CAAC;EACJ;EAqBAe,YAAYA,CAACzB,KAAyB,EAAE;IACtC,MAAMa,KAAK,GAAG,IAAI,CAACA,KAAK;IACxB,MAAMa,MAAM,GAAG,IAAI,CAACA,MAAM;IAC1B,MAAM;MAACX,IAAI;MAAEY,aAAa;MAAEnB;IAAU,CAAC,GAAGR,KAAK;IAC/C,MAAM4B,YAAY,GAAG,CAACD,aAAa,GAAGnB,UAAU,IAAI,CAAC;IAErD,oBACErB,KAAA,CAAA0C,aAAA,CAACvC,IAAI;MAACwC,KAAK,EAAE,CAACJ,MAAM,CAACK,IAAI,EAAE;QAACC,MAAM,EAAEL;MAAa,CAAC;IAAE,gBAClDxC,KAAA,CAAA0C,aAAA,CAACtC,UAAU;MACT0C,GAAG,EAAE,IAAI,CAACf,cAAe;MACzBgB,mBAAmB,EAAE,EAAG;MACxBC,qBAAqB,EAAE;QAACC,eAAe,EAAER;MAAY,CAAE;MACvDS,4BAA4B,EAAE,KAAM;MACpCC,QAAQ,EAAEA,CAAA,KAAM,IAAI,CAACnB,eAAe,CAAC,CAAE;MACvCoB,QAAQ,EAAE,IAAI,CAACC,iBAAkB;MACjCC,mBAAmB,EAAE,IAAI,CAACC,sBAAuB;MACjDC,gBAAgB,EAAC,MAAM;MACvBC,cAAc,EAAEpC,UAAW,CAAC;IAAA,GAE3BO,IAAI,CAAC8B,GAAG,CAAC,CAACC,IAAI,EAAEC,KAAK,KAAK;MACzB,MAAMC,UAAU,GAAGD,KAAK,KAAKlC,KAAK,CAACH,aAAa;MAEhD,oBACEvB,KAAA,CAAA0C,aAAA,CAACvC,IAAI;QACH2D,GAAG,
|
1
|
+
{"version":3,"names":["React","createRef","Text","View","ScrollView","DEFAULT_CLASS","BaseComponent","BaseComponentState","WmWheelPickerState","constructor","args","_defineProperty","WmWheelScrollPicker","props","event","selectedIdx","Math","round","nativeEvent","contentOffset","y","itemHeight","setState","selectedIndex","_this$props$onValueCh","_this$props","state","selectedData","data","onValueChange","call","wheelPickerRef","initialScrollTo","_this$wheelPickerRef","_this$wheelPickerRef$","current","scrollTo","animated","renderWidget","styles","wrapperHeight","scrollOffset","createElement","style","root","height","ref","scrollEventThrottle","contentContainerStyle","paddingVertical","showsVerticalScrollIndicator","onLayout","onScroll","handleWheelScroll","onMomentumScrollEnd","handleWheelMomentumEnd","decelerationRate","snapToInterval","map","item","index","isSelected","key","center","itemBg","selectedItemText","itemText","selectedItemBg","top"],"sources":["wheelpicker.component.tsx"],"sourcesContent":["import React, {createRef} from 'react';\nimport {\n NativeScrollEvent,\n NativeSyntheticEvent,\n Text,\n View,\n} from 'react-native';\nimport { ScrollView } from 'react-native-gesture-handler';\nimport WmWheelPickerProps from './wheelpicker.props';\nimport { DEFAULT_CLASS, WmWheelPickerStyles } from './wheelpicker.styles';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport class WmWheelPickerState extends BaseComponentState<WmWheelPickerProps> {\n selectedIndex: number = 0;\n}\n\nexport class WmWheelScrollPicker extends BaseComponent<WmWheelPickerProps, WmWheelPickerState,\n WmWheelPickerStyles> {\n wheelPickerRef: any = null;\n\n constructor(props: WmWheelPickerProps) {\n super(props, DEFAULT_CLASS);\n\n this.wheelPickerRef = createRef();\n }\n\n initialScrollTo() {\n const props = this.props;\n const y = props.itemHeight * props.selectedIndex;\n this.wheelPickerRef?.current?.scrollTo?.({y: y, animated: false});\n this.setState({\n selectedIndex: props.selectedIndex || 0,\n });\n }\n\n handleWheelScroll = (event: NativeSyntheticEvent<NativeScrollEvent>) => {\n // console.log('scroll =>', event.nativeEvent.contentOffset);\n const selectedIdx = Math.round(\n event.nativeEvent.contentOffset.y / this.props.itemHeight,\n );\n\n this.setState({\n selectedIndex: selectedIdx,\n });\n };\n\n handleWheelMomentumEnd = () => {\n const props = this.props;\n const state = this.state;\n\n const selectedData = props.data[state.selectedIndex];\n this.props.onValueChange?.(selectedData, state.selectedIndex);\n };\n\n renderWidget(props: WmWheelPickerProps) {\n const state = this.state;\n const styles = this.styles;\n const {data, wrapperHeight, itemHeight} = props;\n const scrollOffset = (wrapperHeight - itemHeight) / 2;\n\n return (\n <View style={[styles.root, {height: wrapperHeight}]}>\n <ScrollView\n ref={this.wheelPickerRef}\n scrollEventThrottle={16}\n contentContainerStyle={{paddingVertical: scrollOffset}}\n showsVerticalScrollIndicator={false}\n onLayout={() => this.initialScrollTo()}\n onScroll={this.handleWheelScroll}\n onMomentumScrollEnd={this.handleWheelMomentumEnd}\n decelerationRate=\"fast\"\n snapToInterval={itemHeight} // your snap points\n >\n {data.map((item, index) => {\n const isSelected = index === state.selectedIndex;\n\n return (\n <View\n key={`data_item_${index}`}\n style={[styles.center, styles.itemBg, {height: itemHeight}]}>\n <Text\n style={\n isSelected ? [styles.selectedItemText] : [styles.itemText]\n }>\n {item}\n </Text>\n </View>\n );\n })}\n </ScrollView>\n <View\n style={[\n styles.selectedItemBg,\n {\n height: itemHeight,\n top: scrollOffset,\n },\n ]}\n />\n </View>\n );\n }\n}\n\nexport default WmWheelScrollPicker;\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAGC,SAAS,QAAO,OAAO;AACtC,SAGEC,IAAI,EACJC,IAAI,QACC,cAAc;AACrB,SAASC,UAAU,QAAQ,8BAA8B;AAEzD,SAASC,aAAa,QAA6B,sBAAsB;AACzE,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAO,MAAMC,kBAAkB,SAASD,kBAAkB,CAAqB;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,wBACrD,CAAC;EAAA;AAC3B;AAEA,OAAO,MAAMC,mBAAmB,SAASN,aAAa,CAChC;EAGpBG,WAAWA,CAACI,MAAyB,EAAE;IACrC,KAAK,CAACA,MAAK,EAAER,aAAa,CAAC;IAACM,eA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0C,aAAA,CAACxC,IAAI;QACHyC,KAAK,EACHkB,UAAU,GAAG,CAACtB,MAAM,CAAC0B,gBAAgB,CAAC,GAAG,CAAC1B,MAAM,CAAC2B,QAAQ;MAC1D,GACAP,IACG,CACF,CAAC;IAEX,CAAC,CACS,CAAC,eACb3D,KAAA,CAAA0C,aAAA,CAACvC,IAAI;MACHwC,KAAK,EAAE,CACLJ,MAAM,CAAC4B,cAAc,EACrB;QACEtB,MAAM,EAAExB,UAAU;QAClB+C,GAAG,EAAE3B;MACP,CAAC;IACD,CACH,CACG,CAAC;EAEX;AACF;AAEA,eAAe7B,mBAAmB","ignoreList":[]}
|
@@ -21,6 +21,8 @@ export class WmDatePickerModal extends BaseComponent {
|
|
21
21
|
renderWidget() {
|
22
22
|
const {
|
23
23
|
isVisible,
|
24
|
+
minDate,
|
25
|
+
maxDate,
|
24
26
|
onClose,
|
25
27
|
onCancel,
|
26
28
|
onSelect
|
@@ -49,6 +51,8 @@ export class WmDatePickerModal extends BaseComponent {
|
|
49
51
|
}, /*#__PURE__*/React.createElement(Text, {
|
50
52
|
style: styles.header
|
51
53
|
}, "Select Date"), /*#__PURE__*/React.createElement(WmWheelDatePicker, {
|
54
|
+
minDate: minDate,
|
55
|
+
maxDate: maxDate,
|
52
56
|
selectedDate: this.props.selectedDate || selectedDate,
|
53
57
|
onDateChange: date => {
|
54
58
|
this.setState({
|
app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Modal","Text","TouchableWithoutFeedback","View","WmWheelDatePicker","WmButton","DEFAULT_CLASS","BaseComponent","BaseComponentState","WmDatePickerModalProps","WmDatePickerModalState","constructor","args","_defineProperty","Date","WmDatePickerModal","props","renderWidget","isVisible","onClose","onCancel","onSelect","selectedDate","state","styles","createElement","animationType","transparent","visible","onRequestClose","onDismiss","style","root","flex1","onPress","container","header","onDateChange","date","setState","buttonWrapper","cancelBtn","caption","onTap","selectBtn"],"sources":["date-picker-modal.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Modal, Text, TouchableWithoutFeedback, View } from 'react-native';\nimport WmWheelDatePicker from '../../wheel-date-picker.component';\nimport WmButton from '../../../../basic/button/button.component';\nimport {\n DEFAULT_CLASS,\n WmDateTimePickerModalStyles,\n} from '../styles/datetime-picker-modal.styles';\nimport {\n BaseComponent,\n BaseComponentState,\n} from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmDatePickerModalProps from './date-picker-modal.props';\n\nexport class WmDatePickerModalState extends BaseComponentState<WmDatePickerModalProps> {\n selectedDate: Date = new Date();\n}\n\nexport class WmDatePickerModal extends BaseComponent<\n WmDatePickerModalProps,\n WmDatePickerModalState,\n WmDateTimePickerModalStyles\n> {\n constructor(props: WmDatePickerModalProps) {\n super(props, DEFAULT_CLASS, new WmDatePickerModalProps());\n }\n\n renderWidget() {\n const { isVisible, onClose, onCancel, onSelect } = this.props;\n const { selectedDate } = this.state;\n const { styles } = this;\n\n return (\n <Modal\n animationType=\"fade\"\n transparent={true}\n visible={isVisible}\n onRequestClose={onClose}\n onDismiss={onClose}\n >\n <View style={styles.root}>\n <TouchableWithoutFeedback style={styles.flex1} onPress={onClose}>\n <View style={styles.flex1} />\n </TouchableWithoutFeedback>\n <View style={styles.container}>\n <Text style={styles.header}>Select Date</Text>\n <WmWheelDatePicker\n selectedDate={this.props.selectedDate || selectedDate}\n onDateChange={(date) => {\n this.setState({ selectedDate: date });\n }}\n />\n <View style={styles.buttonWrapper}>\n <WmButton\n styles={styles.cancelBtn}\n caption=\"Cancel\"\n onTap={onCancel}\n />\n <WmButton\n styles={styles.selectBtn}\n caption=\"Select\"\n onTap={() => onSelect?.(selectedDate || this.props.selectedDate || new Date())}\n />\n </View>\n </View>\n </View>\n </Modal>\n );\n }\n}\n\nexport default WmDatePickerModal;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAEC,IAAI,EAAEC,wBAAwB,EAAEC,IAAI,QAAQ,cAAc;AAC1E,OAAOC,iBAAiB,MAAM,mCAAmC;AACjE,OAAOC,QAAQ,MAAM,2CAA2C;AAChE,SACEC,aAAa,QAER,wCAAwC;AAC/C,SACEC,aAAa,EACbC,kBAAkB,QACb,+CAA+C;AACtD,OAAOC,sBAAsB,MAAM,2BAA2B;AAE9D,OAAO,MAAMC,sBAAsB,SAASF,kBAAkB,CAAyB;EAAAG,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,uBAChE,IAAIC,IAAI,CAAC,CAAC;EAAA;AACjC;AAEA,OAAO,MAAMC,iBAAiB,SAASR,aAAa,CAIlD;EACAI,WAAWA,CAACK,KAA6B,EAAE;IACzC,KAAK,CAACA,KAAK,EAAEV,aAAa,EAAE,IAAIG,sBAAsB,CAAC,CAAC,CAAC;EAC3D;EAEAQ,YAAYA,CAAA,EAAG;IACb,MAAM;MAAEC,SAAS;MAAEC,OAAO;MAAEC,QAAQ;MAAEC;IAAS,CAAC,GAAG,IAAI,
|
1
|
+
{"version":3,"names":["React","Modal","Text","TouchableWithoutFeedback","View","WmWheelDatePicker","WmButton","DEFAULT_CLASS","BaseComponent","BaseComponentState","WmDatePickerModalProps","WmDatePickerModalState","constructor","args","_defineProperty","Date","WmDatePickerModal","props","renderWidget","isVisible","minDate","maxDate","onClose","onCancel","onSelect","selectedDate","state","styles","createElement","animationType","transparent","visible","onRequestClose","onDismiss","style","root","flex1","onPress","container","header","onDateChange","date","setState","buttonWrapper","cancelBtn","caption","onTap","selectBtn"],"sources":["date-picker-modal.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Modal, Text, TouchableWithoutFeedback, View } from 'react-native';\nimport WmWheelDatePicker from '../../wheel-date-picker.component';\nimport WmButton from '../../../../basic/button/button.component';\nimport {\n DEFAULT_CLASS,\n WmDateTimePickerModalStyles,\n} from '../styles/datetime-picker-modal.styles';\nimport {\n BaseComponent,\n BaseComponentState,\n} from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmDatePickerModalProps from './date-picker-modal.props';\n\nexport class WmDatePickerModalState extends BaseComponentState<WmDatePickerModalProps> {\n selectedDate: Date = new Date();\n}\n\nexport class WmDatePickerModal extends BaseComponent<\n WmDatePickerModalProps,\n WmDatePickerModalState,\n WmDateTimePickerModalStyles\n> {\n constructor(props: WmDatePickerModalProps) {\n super(props, DEFAULT_CLASS, new WmDatePickerModalProps());\n }\n\n renderWidget() {\n const { isVisible, minDate, maxDate, onClose, onCancel, onSelect } = this.props;\n const { selectedDate } = this.state;\n const { styles } = this;\n\n return (\n <Modal\n animationType=\"fade\"\n transparent={true}\n visible={isVisible}\n onRequestClose={onClose}\n onDismiss={onClose}\n >\n <View style={styles.root}>\n <TouchableWithoutFeedback style={styles.flex1} onPress={onClose}>\n <View style={styles.flex1} />\n </TouchableWithoutFeedback>\n <View style={styles.container}>\n <Text style={styles.header}>Select Date</Text>\n <WmWheelDatePicker\n minDate={minDate}\n maxDate={maxDate}\n selectedDate={this.props.selectedDate || selectedDate}\n onDateChange={(date) => {\n this.setState({ selectedDate: date });\n }}\n />\n <View style={styles.buttonWrapper}>\n <WmButton\n styles={styles.cancelBtn}\n caption=\"Cancel\"\n onTap={onCancel}\n />\n <WmButton\n styles={styles.selectBtn}\n caption=\"Select\"\n onTap={() => onSelect?.(selectedDate || this.props.selectedDate || new Date())}\n />\n </View>\n </View>\n </View>\n </Modal>\n );\n }\n}\n\nexport default WmDatePickerModal;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAEC,IAAI,EAAEC,wBAAwB,EAAEC,IAAI,QAAQ,cAAc;AAC1E,OAAOC,iBAAiB,MAAM,mCAAmC;AACjE,OAAOC,QAAQ,MAAM,2CAA2C;AAChE,SACEC,aAAa,QAER,wCAAwC;AAC/C,SACEC,aAAa,EACbC,kBAAkB,QACb,+CAA+C;AACtD,OAAOC,sBAAsB,MAAM,2BAA2B;AAE9D,OAAO,MAA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KAAA,CAAA4B,aAAA,CAACvB,iBAAiB;MAChBe,OAAO,EAAEA,OAAQ;MACjBC,OAAO,EAAEA,OAAQ;MACjBI,YAAY,EAAE,IAAI,CAACR,KAAK,CAACQ,YAAY,IAAIA,YAAa;MACtDe,YAAY,EAAGC,IAAI,IAAK;QACtB,IAAI,CAACC,QAAQ,CAAC;UAAEjB,YAAY,EAAEgB;QAAK,CAAC,CAAC;MACvC;IAAE,CACH,CAAC,eACFzC,KAAA,CAAA4B,aAAA,CAACxB,IAAI;MAAC8B,KAAK,EAAEP,MAAM,CAACgB;IAAc,gBAChC3C,KAAA,CAAA4B,aAAA,CAACtB,QAAQ;MACPqB,MAAM,EAAEA,MAAM,CAACiB,SAAU;MACzBC,OAAO,EAAC,QAAQ;MAChBC,KAAK,EAAEvB;IAAS,CACjB,CAAC,eACFvB,KAAA,CAAA4B,aAAA,CAACtB,QAAQ;MACPqB,MAAM,EAAEA,MAAM,CAACoB,SAAU;MACzBF,OAAO,EAAC,QAAQ;MAChBC,KAAK,EAAEA,CAAA,KAAMtB,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGC,YAAY,IAAI,IAAI,CAACR,KAAK,CAACQ,YAAY,IAAI,IAAIV,IAAI,CAAC,CAAC;IAAE,CAChF,CACG,CACF,CACF,CACD,CAAC;EAEZ;AACF;AAEA,eAAeC,iBAAiB","ignoreList":[]}
|
@@ -6,6 +6,8 @@ export default class WmDatePickerModalProps extends BaseProps {
|
|
6
6
|
constructor(...args) {
|
7
7
|
super(...args);
|
8
8
|
_defineProperty(this, "isVisible", false);
|
9
|
+
_defineProperty(this, "minDate", void 0);
|
10
|
+
_defineProperty(this, "maxDate", void 0);
|
9
11
|
_defineProperty(this, "selectedDate", void 0);
|
10
12
|
_defineProperty(this, "onClose", void 0);
|
11
13
|
_defineProperty(this, "onSelect", void 0);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BaseProps","WmDatePickerModalProps","constructor","args","_defineProperty"],"sources":["date-picker-modal.props.ts"],"sourcesContent":["import { BaseProps } from \"@wavemaker/app-rn-runtime/core/base.component\";\n\nexport default class WmDatePickerModalProps extends BaseProps {\n isVisible: boolean = false;\n selectedDate?: any;\n onClose?: () => void;\n onSelect?: (date: Date) => void;\n onCancel?: () => void;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,sBAAsB,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBACvC,KAAK;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;EAAA;
|
1
|
+
{"version":3,"names":["BaseProps","WmDatePickerModalProps","constructor","args","_defineProperty"],"sources":["date-picker-modal.props.ts"],"sourcesContent":["import { BaseProps } from \"@wavemaker/app-rn-runtime/core/base.component\";\n\nexport default class WmDatePickerModalProps extends BaseProps {\n isVisible: boolean = false;\n minDate?: Date | string;\n maxDate?: Date | string;\n selectedDate?: any;\n onClose?: () => void;\n onSelect?: (date: Date) => void;\n onCancel?: () => void;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,sBAAsB,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBACvC,KAAK;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;EAAA;AAO5B","ignoreList":[]}
|
@@ -8,6 +8,7 @@ import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/cor
|
|
8
8
|
import WmFileuploadProps from './fileupload.props';
|
9
9
|
import { DEFAULT_CLASS } from './fileupload.styles';
|
10
10
|
import WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';
|
11
|
+
import { getMimeType } from '@wavemaker/app-rn-runtime/core/utils';
|
11
12
|
export class WmFileuploadState extends BaseComponentState {
|
12
13
|
constructor(...args) {
|
13
14
|
super(...args);
|
@@ -23,7 +24,8 @@ export default class WmFileupload extends BaseComponent {
|
|
23
24
|
constructor(props) {
|
24
25
|
super(props, DEFAULT_CLASS, new WmFileuploadProps());
|
25
26
|
}
|
26
|
-
onTap() {
|
27
|
+
onTap(props) {
|
28
|
+
namedParameters.type = getMimeType(props.contenttype);
|
27
29
|
DocumentPicker.getDocumentAsync(namedParameters).then(response => {
|
28
30
|
let selectedFile;
|
29
31
|
if (Platform.OS !== 'web') {
|
@@ -51,7 +53,7 @@ export default class WmFileupload extends BaseComponent {
|
|
51
53
|
caption: props.caption,
|
52
54
|
styles: this.styles.button,
|
53
55
|
iconsize: props.iconsize,
|
54
|
-
onTap: this.onTap.bind(this)
|
56
|
+
onTap: () => this.onTap.bind(this)(props)
|
55
57
|
}));
|
56
58
|
}
|
57
59
|
}
|