@wavemaker/app-rn-runtime 12.0.0-next.140535 → 12.0.0-next.141130
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 +5 -32
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.props.js +0 -1
- app-rn-runtime/components/advanced/carousel/carousel.props.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.styles.js +0 -15
- 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 +5 -15
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.styles.js +0 -3
- app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
- app-rn-runtime/components/basic/animatedview.component.js +2 -6
- 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 +6 -20
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js +6 -14
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +3 -13
- 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 +2 -1
- 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 +0 -12
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.props.js +0 -2
- app-rn-runtime/components/basic/search/search.props.js.map +1 -1
- app-rn-runtime/components/basic/search/search.styles.js +0 -6
- app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.component.js +3 -4
- app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.props.js +1 -9
- app-rn-runtime/components/basic/skeleton/skeleton.props.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.component.js +3 -2
- app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.styles.js +2 -3
- 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 +1 -4
- app-rn-runtime/components/basic/video/video.styles.js.map +1 -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 +1 -7
- 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 +1 -7
- app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/basechart.component.js +2 -54
- app-rn-runtime/components/chart/basechart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.props.js +2 -3
- app-rn-runtime/components/chart/basechart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.styles.js +0 -4
- app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +3 -15
- 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 +1 -7
- 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 +1 -7
- 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 +1 -7
- 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 +0 -2
- 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 +1 -7
- 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 +1 -4
- 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 +1 -7
- 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 +11 -37
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.component.js +5 -47
- 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 +0 -5
- app-rn-runtime/components/container/accordion/accordion.styles.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +1 -4
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
- app-rn-runtime/components/container/container.component.js +2 -36
- app-rn-runtime/components/container/container.component.js.map +1 -1
- app-rn-runtime/components/container/container.styles.js +0 -7
- 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 +1 -5
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js +1 -6
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +2 -27
- 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 +1 -4
- app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js +5 -31
- 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 +1 -4
- app-rn-runtime/components/container/linearlayout/linearlayout.styles.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.component.js +6 -46
- 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 +0 -3
- 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 +4 -3
- 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 +1 -4
- 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 +3 -31
- 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 +1 -4
- app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.component.js +1 -23
- 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 +1 -6
- app-rn-runtime/components/container/tile/tile.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +13 -54
- 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 +0 -3
- app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +1 -4
- 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 +2 -6
- 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 +1 -4
- app-rn-runtime/components/data/card/card-content/card-content.styles.js.map +1 -1
- app-rn-runtime/components/data/card/card.component.js +0 -18
- app-rn-runtime/components/data/card/card.component.js.map +1 -1
- app-rn-runtime/components/data/card/card.styles.js +0 -3
- 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 +0 -1
- app-rn-runtime/components/data/form/form.props.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js +1 -15
- 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 +0 -1
- 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 +1 -11
- app-rn-runtime/components/data/list/list-template/list-template.styles.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +33 -54
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.props.js +0 -1
- app-rn-runtime/components/data/list/list.props.js.map +1 -1
- app-rn-runtime/components/data/list/list.styles.js +0 -9
- app-rn-runtime/components/data/list/list.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js +3 -5
- 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 +4 -11
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.props.js +0 -1
- app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js +12 -25
- app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.props.js +0 -2
- app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +6 -5
- 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 +2 -23
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js +0 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.component.js +2 -3
- app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.component.js +1 -16
- app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +5 -22
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheel-date-picker.component.js +12 -123
- 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 +0 -4
- 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 +0 -2
- 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 +2 -4
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.props.js +0 -1
- app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +3 -6
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +6 -26
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.props.js +0 -1
- app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
- app-rn-runtime/components/input/select/select.component.js +9 -23
- 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 +0 -21
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/text/text.props.js +0 -2
- 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 +0 -21
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.props.js +0 -2
- app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +4 -2
- 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 +3 -2
- 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/page-content/page-content.component.js +2 -27
- 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 +1 -6
- 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 +1 -7
- app-rn-runtime/components/page/page.styles.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.component.js +0 -21
- 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 +1 -6
- 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 +0 -1
- app-rn-runtime/components/page/tabbar/tabbar.props.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js +0 -22
- 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 +1 -6
- app-rn-runtime/components/prefab/prefab-container.styles.js.map +1 -1
- app-rn-runtime/core/base.component.js +3 -5
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/components/textinput.component.js +3 -4
- 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 +0 -4
- 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 +25 -26
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/core/utils.js +4 -87
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/package.json +7 -30
- app-rn-runtime/runtime/App.js +1 -2
- 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 +13 -43
- 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 +0 -10
- app-rn-runtime/runtime/services/app-i18n.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-security.service.js +1 -25
- 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 +0 -1
- 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.map +1 -1
- app-rn-runtime/styles/theme.variables.js +0 -1
- 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
- app-rn-runtime/core/ui-preferences.context.js +0 -7
- app-rn-runtime/core/ui-preferences.context.js.map +0 -1
@@ -4,81 +4,24 @@ 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,
|
8
|
-
import moment from 'moment';
|
7
|
+
import { getDateObject, getDates, getMonths, getYearRange } from '@wavemaker/app-rn-runtime/core/utils';
|
9
8
|
export class WmWheelDatePickerProps {
|
10
9
|
constructor() {
|
11
|
-
_defineProperty(this, "minDate", void 0);
|
12
|
-
_defineProperty(this, "maxDate", void 0);
|
13
10
|
_defineProperty(this, "selectedDate", new Date());
|
14
11
|
_defineProperty(this, "onDateChange", void 0);
|
15
12
|
_defineProperty(this, "itemHeight", PixelRatio.roundToNearestPixel(50));
|
16
13
|
_defineProperty(this, "wrapperHeight", PixelRatio.roundToNearestPixel(150));
|
17
14
|
}
|
18
15
|
}
|
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
|
-
};
|
29
16
|
export class WmWheelDatePickerState {}
|
30
17
|
export class WmWheelDatePicker extends Component {
|
31
|
-
constructor(
|
32
|
-
|
33
|
-
super(_props);
|
18
|
+
constructor(props) {
|
19
|
+
super(props);
|
34
20
|
_defineProperty(this, "itemHeight", void 0);
|
35
21
|
_defineProperty(this, "wrapperHeight", void 0);
|
36
22
|
_defineProperty(this, "selectedDateIndex", 0);
|
37
23
|
_defineProperty(this, "selectedMonthIndex", 0);
|
38
24
|
_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
|
-
});
|
82
25
|
_defineProperty(this, "handleValueChange", (valueType, value, index) => {
|
83
26
|
var _this$props, _this$props$onDateCha;
|
84
27
|
switch (valueType) {
|
@@ -86,85 +29,31 @@ export class WmWheelDatePicker extends Component {
|
|
86
29
|
this.selectedDateIndex = index;
|
87
30
|
break;
|
88
31
|
case 'month':
|
89
|
-
this.monthValue = getMonthIndex(value === null || value === void 0 ? void 0 : value.toString());
|
90
32
|
this.selectedMonthIndex = index;
|
91
33
|
break;
|
92
34
|
case 'year':
|
93
|
-
this.yearValue = value;
|
94
35
|
this.selectedYearIndex = index;
|
95
36
|
break;
|
96
37
|
default:
|
97
38
|
break;
|
98
39
|
}
|
99
|
-
const
|
100
|
-
|
101
|
-
|
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;
|
40
|
+
const selectedDate = getDates()[this.selectedDateIndex];
|
41
|
+
const selectedYear = getYearRange()[this.selectedYearIndex];
|
42
|
+
const dateObj = getDateObject(selectedDate, this.selectedMonthIndex, selectedYear);
|
114
43
|
(_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);
|
115
44
|
});
|
116
45
|
const _selectedDate = this.props.selectedDate || new Date();
|
117
46
|
this.itemHeight = PixelRatio.roundToNearestPixel(this.props.itemHeight || 50) || PixelRatio.roundToNearestPixel(50);
|
118
47
|
this.wrapperHeight = PixelRatio.roundToNearestPixel(this.props.wrapperHeight || 150) || PixelRatio.roundToNearestPixel(150);
|
119
|
-
|
120
|
-
|
121
|
-
this.
|
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
|
-
}
|
48
|
+
this.selectedDateIndex = _selectedDate.getDate() - 1;
|
49
|
+
this.selectedMonthIndex = _selectedDate.getMonth();
|
50
|
+
this.selectedYearIndex = getYearRange().indexOf(_selectedDate.getFullYear());
|
162
51
|
}
|
163
52
|
render() {
|
164
53
|
return /*#__PURE__*/React.createElement(View, {
|
165
54
|
style: styles.root
|
166
55
|
}, /*#__PURE__*/React.createElement(WmWheelScrollPicker, {
|
167
|
-
data:
|
56
|
+
data: getDates(),
|
168
57
|
wrapperHeight: this.wrapperHeight,
|
169
58
|
itemHeight: this.itemHeight,
|
170
59
|
selectedIndex: this.selectedDateIndex,
|
@@ -172,13 +61,13 @@ export class WmWheelDatePicker extends Component {
|
|
172
61
|
}), /*#__PURE__*/React.createElement(View, {
|
173
62
|
style: styles.middle
|
174
63
|
}, /*#__PURE__*/React.createElement(WmWheelScrollPicker, {
|
175
|
-
data:
|
64
|
+
data: getMonths(),
|
176
65
|
wrapperHeight: this.wrapperHeight,
|
177
66
|
itemHeight: this.itemHeight,
|
178
67
|
selectedIndex: this.selectedMonthIndex,
|
179
68
|
onValueChange: (value, index) => this.handleValueChange('month', value, index)
|
180
69
|
})), /*#__PURE__*/React.createElement(WmWheelScrollPicker, {
|
181
|
-
data:
|
70
|
+
data: getYearRange(),
|
182
71
|
wrapperHeight: this.wrapperHeight,
|
183
72
|
itemHeight: this.itemHeight,
|
184
73
|
selectedIndex: this.selectedYearIndex,
|
@@ -1 +1 @@
|
|
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,C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;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
|
+
{"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,c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C,CACF,CAAC,eACFpB,KAAA,CAAAsC,aAAA,CAAClC,IAAI;MAACmC,KAAK,EAAEC,MAAM,CAACM;IAAO,gBACzB9C,KAAA,CAAAsC,aAAA,CAACjC,mBAAmB;MAClBqC,IAAI,EAAElC,SAAS,CAAC,CAAE;MAClBwB,aAAa,EAAE,IAAI,CAACA,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 +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,KAAK,CAACA,MAAK,EAAER,aAAa,CAAC;IAACM,eAAA,yBAHR,IAAI;IAAAA,eAAA,4BAiBLG,KAA8C,IAAK;MACtE;MACA,MAAMC,WAAW,GAAGC,IAAI,CAACC,KAAK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AAyB,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,eAAA,yBAHR,IAAI;IAAAA,eAAA,4BAiBLG,KAA8C,IAAK;MACtE;MACA,MAAMC,WAAW,GAAGC,IAAI,CAACC,KAAK,CAC5BH,KAAK,CAACI,WAAW,CAACC,aAAa,CAACC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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,8 +21,6 @@ export class WmDatePickerModal extends BaseComponent {
|
|
21
21
|
renderWidget() {
|
22
22
|
const {
|
23
23
|
isVisible,
|
24
|
-
minDate,
|
25
|
-
maxDate,
|
26
24
|
onClose,
|
27
25
|
onCancel,
|
28
26
|
onSelect
|
@@ -51,8 +49,6 @@ export class WmDatePickerModal extends BaseComponent {
|
|
51
49
|
}, /*#__PURE__*/React.createElement(Text, {
|
52
50
|
style: styles.header
|
53
51
|
}, "Select Date"), /*#__PURE__*/React.createElement(WmWheelDatePicker, {
|
54
|
-
minDate: minDate,
|
55
|
-
maxDate: maxDate,
|
56
52
|
selectedDate: this.props.selectedDate || selectedDate,
|
57
53
|
onDateChange: date => {
|
58
54
|
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","
|
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,S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EAAEP,MAAM,CAACS;IAAM,CAAE,CACJ,CAAC,eAC3BlC,KAAA,CAAA0B,aAAA,CAACtB,IAAI;MAAC4B,KAAK,EAAEP,MAAM,CAACW;IAAU,gBAC5BpC,KAAA,CAAA0B,aAAA,CAACxB,IAAI;MAAC8B,KAAK,EAAEP,MAAM,CAACY;IAAO,GAAC,aAAiB,CAAC,eAC9CrC,KAAA,CAAA0B,aAAA,CAACrB,iBAAiB;MAChBkB,YAAY,EAAE,IAAI,CAACN,KAAK,CAACM,YAAY,IAAIA,YAAa;MACtDe,YAAY,EAAGC,IAAI,IAAK;QACtB,IAAI,CAACC,QAAQ,CAAC;UAAEjB,YAAY,EAAEgB;QAAK,CAAC,CAAC;MACvC;IAAE,CACH,CAAC,eACFvC,KAAA,CAAA0B,aAAA,CAACtB,IAAI;MAAC4B,KAAK,EAAEP,MAAM,CAACgB;IAAc,gBAChCzC,KAAA,CAAA0B,aAAA,CAACpB,QAAQ;MACPmB,MAAM,EAAEA,MAAM,CAACiB,SAAU;MACzBC,OAAO,EAAC,QAAQ;MAChBC,KAAK,EAAEvB;IAAS,CACjB,CAAC,eACFrB,KAAA,CAAA0B,aAAA,CAACpB,QAAQ;MACPmB,MAAM,EAAEA,MAAM,CAACoB,SAAU;MACzBF,OAAO,EAAC,QAAQ;MAChBC,KAAK,EAAEA,CAAA,KAAMtB,QAAQ,aAARA,QAAQ,uBAARA,QAAQ,CAAGC,YAAY,IAAI,IAAI,CAACN,KAAK,CAACM,YAAY,IAAI,IAAIR,IAAI,CAAC,CAAC;IAAE,CAChF,CACG,CACF,CACF,CACD,CAAC;EAEZ;AACF;AAEA,eAAeC,iBAAiB","ignoreList":[]}
|
@@ -6,8 +6,6 @@ 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);
|
11
9
|
_defineProperty(this, "selectedDate", void 0);
|
12
10
|
_defineProperty(this, "onClose", void 0);
|
13
11
|
_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
|
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;AAK5B","ignoreList":[]}
|
@@ -8,7 +8,6 @@ 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';
|
12
11
|
export class WmFileuploadState extends BaseComponentState {
|
13
12
|
constructor(...args) {
|
14
13
|
super(...args);
|
@@ -24,8 +23,7 @@ export default class WmFileupload extends BaseComponent {
|
|
24
23
|
constructor(props) {
|
25
24
|
super(props, DEFAULT_CLASS, new WmFileuploadProps());
|
26
25
|
}
|
27
|
-
onTap(
|
28
|
-
namedParameters.type = getMimeType(props.contenttype);
|
26
|
+
onTap() {
|
29
27
|
DocumentPicker.getDocumentAsync(namedParameters).then(response => {
|
30
28
|
let selectedFile;
|
31
29
|
if (Platform.OS !== 'web') {
|
@@ -53,7 +51,7 @@ export default class WmFileupload extends BaseComponent {
|
|
53
51
|
caption: props.caption,
|
54
52
|
styles: this.styles.button,
|
55
53
|
iconsize: props.iconsize,
|
56
|
-
onTap:
|
54
|
+
onTap: this.onTap.bind(this)
|
57
55
|
}));
|
58
56
|
}
|
59
57
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Platform","View","DocumentPicker","BaseComponent","BaseComponentState","WmFileuploadProps","DEFAULT_CLASS","WmButton","
|
1
|
+
{"version":3,"names":["React","Platform","View","DocumentPicker","BaseComponent","BaseComponentState","WmFileuploadProps","DEFAULT_CLASS","WmButton","WmFileuploadState","constructor","args","_defineProperty","namedParameters","copyToCacheDirectory","multiple","type","WmFileupload","props","onTap","getDocumentAsync","then","response","selectedFile","OS","assets","mimeType","file","invokeEventCallback","proxy","updateState","selectedFiles","bind","renderWidget","createElement","style","styles","root","_background","accessibilitylabel","caption","hint","id","getTestId","iconclass","button","iconsize"],"sources":["fileupload.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, View } from 'react-native';\nimport * as DocumentPicker from 'expo-document-picker';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmFileuploadProps from './fileupload.props';\nimport { DEFAULT_CLASS, WmFileuploadStyles } from './fileupload.styles';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\n\nexport interface SelectFileOutput {\n mimeType: string;\n name: string;\n size: number;\n type: 'cancel' | 'success';\n uri: string;\n}\n\nexport class WmFileuploadState extends BaseComponentState<WmFileuploadProps> {\n selectedFiles: any;\n}\n\nconst namedParameters = {\n copyToCacheDirectory: false,\n multiple: false,\n type: '*/*'\n};\n\nexport default class WmFileupload extends BaseComponent<WmFileuploadProps, WmFileuploadState, WmFileuploadStyles> {\n\n constructor(props: WmFileuploadProps) {\n super(props, DEFAULT_CLASS, new WmFileuploadProps());\n }\n\n onTap() {\n DocumentPicker.getDocumentAsync(namedParameters).then((response: any) => {\n let selectedFile;\n if (Platform.OS !== 'web') {\n selectedFile = response.assets[0];\n selectedFile.type = selectedFile.mimeType;\n } else {\n selectedFile = [response.assets[0].file];\n }\n this.invokeEventCallback('onBeforeselect', [null, this.proxy, selectedFile]);\n\n this.updateState({\n props: {\n selectedFiles: selectedFile\n }\n } as WmFileuploadState, this.invokeEventCallback.bind(this, 'onSelect', [null, this.proxy, selectedFile]));\n });\n }\n\n renderWidget(props: WmFileuploadProps) {\n return <View style={this.styles.root}>\n {this._background}\n <WmButton accessibilitylabel={props.accessibilitylabel || props.caption} hint = {props.hint} id={this.getTestId()} iconclass={props.iconclass} caption={props.caption} styles={this.styles.button} iconsize={props.iconsize} onTap={this.onTap.bind(this)}></WmButton>\n </View>\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AAC7C,OAAO,KAAKC,cAAc,MAAM,sBAAsB;AAEtD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,iBAAiB,MAAM,oBAAoB;AAClD,SAASC,aAAa,QAA4B,qBAAqB;AACvE,OAAOC,QAAQ,MAAM,oEAAoE;AAUzF,OAAO,MAAMC,iBAAiB,SAASJ,kBAAkB,CAAoB;EAAAK,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;EAAA;AAE7E;AAEA,MAAMC,eAAe,GAAG;EACtBC,oBAAoB,EAAE,KAAK;EAC3BC,QAAQ,EAAE,KAAK;EACfC,IAAI,EAAE;AACR,CAAC;AAED,eAAe,MAAMC,YAAY,SAASb,aAAa,CAA2D;EAEhHM,WAAWA,CAACQ,KAAw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0B,SAAU;MAACJ,OAAO,EAAEtB,KAAK,CAACsB,OAAQ;MAACJ,MAAM,EAAE,IAAI,CAACA,MAAM,CAACS,MAAO;MAACC,QAAQ,EAAE5B,KAAK,CAAC4B,QAAS;MAAC3B,KAAK,EAAE,IAAI,CAACA,KAAK,CAACa,IAAI,CAAC,IAAI;IAAE,CAAW,CACjQ,CAAC;EACT;AACF","ignoreList":[]}
|
@@ -9,7 +9,6 @@ export default class WmFileuploadProps extends BaseProps {
|
|
9
9
|
_defineProperty(this, "iconsize", 16);
|
10
10
|
_defineProperty(this, "caption", 'Upload');
|
11
11
|
_defineProperty(this, "selectedFiles", void 0);
|
12
|
-
_defineProperty(this, "contenttype", void 0);
|
13
12
|
_defineProperty(this, "accessibilitylabel", undefined);
|
14
13
|
_defineProperty(this, "hint", undefined);
|
15
14
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BaseProps","WmFileuploadProps","constructor","args","_defineProperty","undefined"],"sources":["fileupload.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {AccessibilityRole} from 'react-native';\n\nexport default class WmFileuploadProps extends BaseProps {\n iconclass: string = 'wm-sl-l sl-cloud-upload';\n iconsize: number = 16;\n caption: string = 'Upload';\n selectedFiles?: any;\n
|
1
|
+
{"version":3,"names":["BaseProps","WmFileuploadProps","constructor","args","_defineProperty","undefined"],"sources":["fileupload.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {AccessibilityRole} from 'react-native';\n\nexport default class WmFileuploadProps extends BaseProps {\n iconclass: string = 'wm-sl-l sl-cloud-upload';\n iconsize: number = 16;\n caption: string = 'Upload';\n selectedFiles?: any;\n accessibilitylabel?: string = undefined;\n hint?: string = undefined;\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAGzE,eAAe,MAAMC,iBAAiB,SAASD,SAAS,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oBACnC,yBAAyB;IAAAA,eAAA,mBAC1B,EAAE;IAAAA,eAAA,kBACH,QAAQ;IAAAA,eAAA;IAAAA,eAAA,6BAEIC,SAAS;IAAAD,eAAA,eACvBC,SAAS;EAAA;AAC3B","ignoreList":[]}
|
@@ -52,17 +52,14 @@ export default class WmNumber extends BaseNumberComponent {
|
|
52
52
|
autoFocus: props.autofocus,
|
53
53
|
editable: props.disabled || props.readonly ? false : true,
|
54
54
|
placeholder: props.placeholder,
|
55
|
-
onBlur:
|
56
|
-
this.onBlur.bind(this)(event, !!props.displayValue);
|
57
|
-
},
|
55
|
+
onBlur: this.onBlur.bind(this),
|
58
56
|
onFocus: this.onFocus.bind(this),
|
59
57
|
onKeyPress: this.validateInputEntry.bind(this),
|
60
58
|
onChangeText: text => {
|
61
|
-
this.onChangeText.bind(this)(text, 'number'
|
59
|
+
this.onChangeText.bind(this)(text, 'number');
|
62
60
|
},
|
63
61
|
onChange: this.invokeChange.bind(this),
|
64
|
-
allowContentSelection: this.styles.text.userSelect === 'text'
|
65
|
-
customDisplayValue: props.displayValue
|
62
|
+
allowContentSelection: this.styles.text.userSelect === 'text'
|
66
63
|
}));
|
67
64
|
}
|
68
65
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Platform","isNull","WmNumberProps","DEFAULT_CLASS","WMTextInput","BaseNumberComponent","BaseNumberState","AccessibilityWidgetType","getAccessibilityProps","WmNumberState","constructor","args","_defineProperty","WmNumber","props","getStyleClassName","classes","state","floatinglabel","push","join","renderWidget","_this$state$textValue","opts","valueExpr","OS","textValue","toString","createElement","_extends","getTestPropsForInput","NUMBER","ref","widgetRef","selectionStart","selectionEnd","cursor","floatingLabel","floatingLabelStyle","styles","activeFloatingLabelStyle","activeFloatingLabel","style","root","isValid","invalid","keyboardType","placeholderTextColor","placeholderText","color","autoFocus","autofocus","editable","disabled","readonly","placeholder","onBlur","
|
1
|
+
{"version":3,"names":["React","Platform","isNull","WmNumberProps","DEFAULT_CLASS","WMTextInput","BaseNumberComponent","BaseNumberState","AccessibilityWidgetType","getAccessibilityProps","WmNumberState","constructor","args","_defineProperty","WmNumber","props","getStyleClassName","classes","state","floatinglabel","push","join","renderWidget","_this$state$textValue","opts","valueExpr","OS","textValue","toString","createElement","_extends","getTestPropsForInput","NUMBER","ref","widgetRef","selectionStart","selectionEnd","cursor","floatingLabel","floatingLabelStyle","styles","activeFloatingLabelStyle","activeFloatingLabel","style","root","isValid","invalid","keyboardType","placeholderTextColor","placeholderText","color","autoFocus","autofocus","editable","disabled","readonly","placeholder","onBlur","bind","onFocus","onKeyPress","validateInputEntry","onChangeText","text","onChange","invokeChange","allowContentSelection","userSelect"],"sources":["number.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform } from 'react-native';\nimport { isNull } from 'lodash';\n\nimport WmNumberProps from './number.props';\nimport { DEFAULT_CLASS, WmNumberStyles } from './number.styles';\nimport { WMTextInput } from '@wavemaker/app-rn-runtime/core/components/textinput.component';\nimport {\n BaseNumberComponent,\n BaseNumberState\n} from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \n\nexport class WmNumberState extends BaseNumberState<WmNumberProps> {\n keyboardType: any;\n}\n\nexport default class WmNumber extends BaseNumberComponent<WmNumberProps, WmNumberState, WmNumberStyles> {\n\n constructor(props: WmNumberProps) {\n super(props, DEFAULT_CLASS, new WmNumberProps(), new WmNumberState());\n }\n\n public getStyleClassName(): string | undefined {\n const classes = [];\n if (this.state.props.floatinglabel) {\n classes.push('app-number-with-label'); \n }\n classes.push(super.getStyleClassName());\n return classes.join(' ');\n }\n\n renderWidget(props: WmNumberProps) {\n let opts: any = {};\n const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';\n opts[valueExpr] = this.state.textValue?.toString() || '';\n return (<WMTextInput\n {...this.getTestPropsForInput()}\n {...getAccessibilityProps(AccessibilityWidgetType.NUMBER, props)}\n ref={(ref: any) => {this.widgetRef = ref;\n // @ts-ignore\n if (ref && !isNull(ref.selectionStart) && !isNull(ref.selectionEnd)) {\n // @ts-ignore\n ref.selectionStart = ref.selectionEnd = this.cursor;\n }}}\n {...opts}\n floatingLabel={props.floatinglabel}\n floatingLabelStyle={this.styles.floatingLabel}\n activeFloatingLabelStyle={this.styles.activeFloatingLabel}\n style={[this.styles.root, this.state.isValid ? {} : this.styles.invalid]}\n keyboardType=\"numeric\"\n placeholderTextColor={this.styles.placeholderText.color as any}\n autoFocus={props.autofocus}\n editable={props.disabled || props.readonly ? false : true}\n placeholder={props.placeholder}\n onBlur={this.onBlur.bind(this)}\n onFocus={this.onFocus.bind(this)}\n onKeyPress={this.validateInputEntry.bind(this)}\n onChangeText={(text) => {\n this.onChangeText.bind(this)(text, 'number');\n }}\n onChange={this.invokeChange.bind(this)}\n allowContentSelection={this.styles.text.userSelect === 'text'}\n />);\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,MAAM,QAAQ,QAAQ;AAE/B,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,SAASC,WAAW,QAAQ,+DAA+D;AAC3F,SACEC,mBAAmB,EACnBC,eAAe,QACV,4EAA4E;AACnF,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAE7G,OAAO,MAAMC,aAAa,SAASH,eAAe,CAAgB;EAAAI,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;EAAA;AAElE;AAEA,eAAe,MAAMC,QAAQ,SAASR,mBAAmB,CAA+C;EAEtGK,WAAWA,CAACI,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEX,aAAa,EAAE,IAAID,aAAa,CAAC,CAAC,EAAE,IAAIO,aAAa,CAAC,CAAC,CAA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EAAE,IAAI,CAACD,MAAM,CAACE,mBAAoB;MAC1DC,KAAK,EAAE,CAAC,IAAI,CAACH,MAAM,CAACI,IAAI,EAAE,IAAI,CAAC1B,KAAK,CAAC2B,OAAO,GAAG,CAAC,CAAC,GAAG,IAAI,CAACL,MAAM,CAACM,OAAO,CAAE;MACzEC,YAAY,EAAC,SAAS;MACtBC,oBAAoB,EAAE,IAAI,CAACR,MAAM,CAACS,eAAe,CAACC,KAAa;MAC/DC,SAAS,EAAEpC,KAAK,CAACqC,SAAU;MAC3BC,QAAQ,EAAEtC,KAAK,CAACuC,QAAQ,IAAIvC,KAAK,CAACwC,QAAQ,GAAG,KAAK,GAAG,IAAK;MAC1DC,WAAW,EAAEzC,KAAK,CAACyC,WAAY;MAC/BC,MAAM,EAAE,IAAI,CAACA,MAAM,CAACC,IAAI,CAAC,IAAI,CAAE;MAC/BC,OAAO,EAAE,IAAI,CAACA,OAAO,CAACD,IAAI,CAAC,IAAI,CAAE;MACjCE,UAAU,EAAE,IAAI,CAACC,kBAAkB,CAACH,IAAI,CAAC,IAAI,CAAE;MAC/CI,YAAY,EAAGC,IAAI,IAAK;QACtB,IAAI,CAACD,YAAY,CAACJ,IAAI,CAAC,IAAI,CAAC,CAACK,IAAI,EAAE,QAAQ,CAAC;MAC9C,CAAE;MACFC,QAAQ,EAAE,IAAI,CAACC,YAAY,CAACP,IAAI,CAAC,IAAI,CAAE;MACvCQ,qBAAqB,EAAE,IAAI,CAAC1B,MAAM,CAACuB,IAAI,CAACI,UAAU,KAAK;IAAO,EAC/D,CAAC;EACJ;AACF","ignoreList":[]}
|
@@ -11,8 +11,6 @@ import { BaseDatasetComponent, BaseDatasetState } from '@wavemaker/app-rn-runtim
|
|
11
11
|
import WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';
|
12
12
|
import { find, isEqual } from 'lodash-es';
|
13
13
|
import { isEmpty } from 'lodash';
|
14
|
-
import WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';
|
15
|
-
import { getNumberOfEmptyObjects } from '@wavemaker/app-rn-runtime/core/utils';
|
16
14
|
export class WmRadiosetState extends BaseDatasetState {
|
17
15
|
constructor(...args) {
|
18
16
|
super(...args);
|
@@ -24,10 +22,10 @@ export default class WmRadioset extends BaseDatasetComponent {
|
|
24
22
|
super(props, DEFAULT_CLASS, new WmRadiosetProps());
|
25
23
|
}
|
26
24
|
onPress(item) {
|
25
|
+
this.invokeEventCallback('onTap', [null, this.proxy]);
|
27
26
|
if (this.state.props.disabled || this.state.props.readonly) {
|
28
27
|
return;
|
29
28
|
}
|
30
|
-
this.invokeEventCallback('onTap', [null, this.proxy]);
|
31
29
|
item.selected = true;
|
32
30
|
let selectedValue = "";
|
33
31
|
const selectedItem = find(this.state.dataItems, d => isEqual(d.key, item.key));
|
@@ -53,14 +51,14 @@ export default class WmRadioset extends BaseDatasetComponent {
|
|
53
51
|
}],
|
54
52
|
onPress: this.onPress.bind(this, item),
|
55
53
|
key: item.key
|
56
|
-
}, this.getTestPropsForAction(
|
57
|
-
id: this.getTestId('radiobutton' + index),
|
54
|
+
}, this.getTestPropsForAction()), /*#__PURE__*/React.createElement(WmIcon, _extends({}, this.getTestProps('' + index), {
|
58
55
|
iconclass: "wi wi-fiber-manual-record",
|
59
56
|
styles: item.selected ? this.styles.checkedRadio : this.styles.uncheckedRadio,
|
60
|
-
disabled: this.state.props.readonly || this.state.props.disabled
|
61
|
-
|
57
|
+
disabled: this.state.props.readonly || this.state.props.disabled,
|
58
|
+
accessibilitylabel: `Radio button for ${displayText}`
|
59
|
+
})), !isEmpty(this.state.template) && this.props.renderitempartial ? this.props.renderitempartial(item.dataObject, index, this.state.template) : /*#__PURE__*/React.createElement(Text, _extends({
|
62
60
|
style: this.styles.radioLabel
|
63
|
-
}, this.getTestPropsForLabel('caption'
|
61
|
+
}, this.getTestPropsForLabel('caption')), displayText));
|
64
62
|
}
|
65
63
|
setTemplate(partialName) {
|
66
64
|
this.updateState({
|
@@ -87,24 +85,6 @@ export default class WmRadioset extends BaseDatasetComponent {
|
|
87
85
|
style: noOfColumns === 1 ? {} : this.styles.group
|
88
86
|
}, items && items.length ? items.map((item, index) => this.renderChild(item, index, colWidth)) : null);
|
89
87
|
}
|
90
|
-
renderSkeleton(props) {
|
91
|
-
var _ref;
|
92
|
-
const noOfColumns = props.itemsperrow.xs || 1;
|
93
|
-
const colWidth = Math.round(100 / noOfColumns) + '%';
|
94
|
-
return [...getNumberOfEmptyObjects((_ref = props.numberofskeletonitems) !== null && _ref !== void 0 ? _ref : 5)].map(_ => {
|
95
|
-
return /*#__PURE__*/React.createElement(View, {
|
96
|
-
style: [this.styles.item, {
|
97
|
-
width: colWidth
|
98
|
-
}]
|
99
|
-
}, /*#__PURE__*/React.createElement(WmIcon, {
|
100
|
-
styles: this.styles.checkedRadio
|
101
|
-
}), /*#__PURE__*/React.createElement(WmLabel, {
|
102
|
-
styles: {
|
103
|
-
skeleton: this.styles.skeleton
|
104
|
-
}
|
105
|
-
}));
|
106
|
-
});
|
107
|
-
}
|
108
88
|
renderWidget(props) {
|
109
89
|
const items = this.state.dataItems;
|
110
90
|
return /*#__PURE__*/React.createElement(ScrollView, {
|