@wavemaker/app-rn-runtime 11.5.0-next.40301 → 11.5.0-next.NULL
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- app-rn-runtime/actions/login-action.js +4 -0
- app-rn-runtime/actions/login-action.js.map +1 -1
- app-rn-runtime/actions/logout-action.js +4 -0
- app-rn-runtime/actions/logout-action.js.map +1 -1
- app-rn-runtime/actions/notification-action.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js +4 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.styles.js +1 -2
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.styles.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.component.js +214 -69
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.props.js +3 -0
- app-rn-runtime/components/advanced/carousel/carousel.props.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.styles.js +22 -10
- app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
- app-rn-runtime/components/advanced/login/login.component.js +3 -2
- app-rn-runtime/components/advanced/login/login.component.js.map +1 -1
- app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js +17 -16
- app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js +28 -11
- app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.props.js +0 -1
- app-rn-runtime/components/advanced/webview/webview.props.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js +7 -5
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/animatedview.component.js +50 -0
- app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
- app-rn-runtime/components/basic/audio/audio.component.js +5 -0
- app-rn-runtime/components/basic/audio/audio.component.js.map +1 -1
- app-rn-runtime/components/basic/button/button.component.js +20 -7
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/button/button.styles.js +15 -5
- app-rn-runtime/components/basic/button/button.styles.js.map +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js +11 -5
- app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js +11 -5
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.props.js +1 -0
- app-rn-runtime/components/basic/icon/icon.props.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.styles.js +2 -1
- app-rn-runtime/components/basic/icon/icon.styles.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +79 -11
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.props.js +1 -0
- app-rn-runtime/components/basic/label/label.props.js.map +1 -1
- app-rn-runtime/components/basic/label/label.styles.js +5 -0
- app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
- app-rn-runtime/components/basic/message/message.component.js +6 -3
- app-rn-runtime/components/basic/message/message.component.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.component.js +7 -5
- app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +4 -3
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.styles.js +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.styles.js.map +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +3 -2
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js +12 -6
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.styles.js +11 -10
- app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.component.js +6 -2
- 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 +2 -1
- app-rn-runtime/components/basic/video/video.component.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.component.js +42 -14
- app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.props.js +10 -1
- app-rn-runtime/components/chart/area-chart/area-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.component.js +42 -4
- app-rn-runtime/components/chart/bar-chart/bar-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.props.js +1 -2
- app-rn-runtime/components/chart/bar-chart/bar-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.component.js +158 -46
- app-rn-runtime/components/chart/basechart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.props.js +18 -4
- app-rn-runtime/components/chart/basechart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.styles.js +44 -2
- app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +25 -3
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.props.js +9 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.component.js +28 -6
- app-rn-runtime/components/chart/line-chart/line-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.props.js +1 -0
- app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +25 -3
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.props.js +1 -0
- app-rn-runtime/components/chart/pie-chart/pie-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +275 -0
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -0
- app-rn-runtime/components/chart/stack-chart/stack-chart.props.js +17 -0
- app-rn-runtime/components/chart/stack-chart/stack-chart.props.js.map +1 -0
- app-rn-runtime/components/chart/stack-chart/stack-chart.styles.js +7 -0
- app-rn-runtime/components/chart/stack-chart/stack-chart.styles.js.map +1 -0
- app-rn-runtime/components/container/accordion/accordion.component.js +22 -15
- app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +6 -24
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
- app-rn-runtime/components/container/container.component.js +14 -4
- app-rn-runtime/components/container/container.component.js.map +1 -1
- app-rn-runtime/components/container/container.props.js +1 -0
- app-rn-runtime/components/container/container.props.js.map +1 -1
- app-rn-runtime/components/container/panel/collapsible-pane.component.js +26 -0
- app-rn-runtime/components/container/panel/collapsible-pane.component.js.map +1 -0
- app-rn-runtime/components/container/panel/panel.component.js +44 -62
- app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.styles.js +9 -2
- app-rn-runtime/components/container/panel/panel.styles.js.map +1 -1
- app-rn-runtime/components/container/partial-host.component.js +1 -1
- app-rn-runtime/components/container/partial-host.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +29 -15
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +15 -10
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.component.js +18 -10
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js +1 -0
- app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.component.js +3 -2
- app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +139 -22
- app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.props.js +4 -0
- app-rn-runtime/components/container/wizard/wizard.props.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.styles.js +117 -6
- app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +22 -3
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js +4 -0
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
- app-rn-runtime/components/data/card/card.component.js +3 -2
- app-rn-runtime/components/data/card/card.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-action/form-action.component.js +1 -0
- app-rn-runtime/components/data/form/form-action/form-action.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js +9 -7
- app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
- app-rn-runtime/components/data/form/form.component.js +12 -6
- app-rn-runtime/components/data/form/form.component.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.styles.js +9 -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 +93 -31
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.props.js +7 -0
- app-rn-runtime/components/data/list/list.props.js.map +1 -1
- app-rn-runtime/components/data/list/list.styles.js +12 -5
- app-rn-runtime/components/data/list/list.styles.js.map +1 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js +1 -0
- app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js +2 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.component.js +1 -0
- app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.styles.js +2 -1
- app-rn-runtime/components/device/camera/camera.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js +4 -1
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js +9 -3
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js +6 -2
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.styles.js +10 -10
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js +2 -0
- app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.styles.js +25 -8
- app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js +4 -2
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.styles.js +2 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.styles.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js +6 -2
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js +45 -6
- app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.props.js +1 -0
- app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
- app-rn-runtime/components/input/calendar/calendar.component.js +4 -0
- app-rn-runtime/components/input/calendar/calendar.component.js.map +1 -1
- app-rn-runtime/components/input/calendar/calendar.styles.js +22 -11
- app-rn-runtime/components/input/calendar/calendar.styles.js.map +1 -1
- app-rn-runtime/components/input/calendar/views/month-view.js +4 -0
- app-rn-runtime/components/input/calendar/views/month-view.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +6 -6
- app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js +14 -7
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +2 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.component.js +15 -4
- app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.styles.js +20 -12
- app-rn-runtime/components/input/chips/chips.styles.js.map +1 -1
- app-rn-runtime/components/input/composite/composite.component.js +8 -1
- app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
- app-rn-runtime/components/input/composite/composite.props.js +1 -0
- app-rn-runtime/components/input/composite/composite.props.js.map +1 -1
- app-rn-runtime/components/input/composite/composite.styles.js +16 -1
- app-rn-runtime/components/input/composite/composite.styles.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.component.js +21 -3
- app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.props.js +1 -0
- app-rn-runtime/components/input/currency/currency.props.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.styles.js +31 -5
- app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +32 -9
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/date/date.component.js +8 -0
- app-rn-runtime/components/input/epoch/date/date.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/date/date.styles.js +16 -0
- app-rn-runtime/components/input/epoch/date/date.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.component.js +8 -0
- app-rn-runtime/components/input/epoch/datetime/datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.props.js +1 -0
- app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +21 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/time/time.component.js +8 -0
- app-rn-runtime/components/input/epoch/time/time.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/time/time.styles.js +16 -0
- app-rn-runtime/components/input/epoch/time/time.styles.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js +1 -0
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +16 -2
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/number/number.props.js +1 -0
- app-rn-runtime/components/input/number/number.props.js.map +1 -1
- app-rn-runtime/components/input/number/number.styles.js +23 -2
- app-rn-runtime/components/input/number/number.styles.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +13 -6
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.props.js +6 -0
- app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.styles.js +6 -9
- app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
- app-rn-runtime/components/input/rating/rating.component.js +2 -0
- app-rn-runtime/components/input/rating/rating.component.js.map +1 -1
- app-rn-runtime/components/input/select/select.component.js +17 -13
- app-rn-runtime/components/input/select/select.component.js.map +1 -1
- app-rn-runtime/components/input/select/select.styles.js +8 -4
- app-rn-runtime/components/input/select/select.styles.js.map +1 -1
- app-rn-runtime/components/input/slider/slider.component.js +99 -23
- app-rn-runtime/components/input/slider/slider.component.js.map +1 -1
- app-rn-runtime/components/input/slider/slider.styles.js +30 -3
- app-rn-runtime/components/input/slider/slider.styles.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.component.js +11 -5
- app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.styles.js +15 -9
- app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +12 -1
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/text/text.props.js +1 -0
- app-rn-runtime/components/input/text/text.props.js.map +1 -1
- app-rn-runtime/components/input/text/text.styles.js +22 -1
- app-rn-runtime/components/input/text/text.styles.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +12 -1
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.props.js +1 -0
- app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.styles.js +17 -0
- app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +44 -5
- app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.styles.js +16 -11
- app-rn-runtime/components/input/toggle/toggle.styles.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +16 -3
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js.map +1 -1
- app-rn-runtime/components/navigation/basenav/basenav.component.js +2 -0
- app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
- app-rn-runtime/components/navigation/menu/menu.component.js +5 -3
- app-rn-runtime/components/navigation/menu/menu.component.js.map +1 -1
- app-rn-runtime/components/navigation/menu/menu.styles.js +10 -6
- app-rn-runtime/components/navigation/menu/menu.styles.js.map +1 -1
- app-rn-runtime/components/navigation/navbar/navbar.component.js +7 -4
- app-rn-runtime/components/navigation/navbar/navbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.component.js +6 -3
- app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.styles.js +14 -10
- app-rn-runtime/components/navigation/navitem/navitem.styles.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js +10 -5
- app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.props.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.styles.js +8 -2
- app-rn-runtime/components/navigation/popover/popover.styles.js.map +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js +2 -2
- app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.styles.js +6 -1
- app-rn-runtime/components/page/left-panel/left-panel.styles.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.component.js +11 -3
- app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
- app-rn-runtime/components/page/tabbar/curve.js +84 -0
- app-rn-runtime/components/page/tabbar/curve.js.map +1 -0
- app-rn-runtime/components/page/tabbar/tabbar.component.js +47 -12
- 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/page/tabbar/tabbar.styles.js +76 -1
- app-rn-runtime/components/page/tabbar/tabbar.styles.js.map +1 -1
- app-rn-runtime/core/base.component.js +84 -37
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/components/floatinglabel.component.js +45 -0
- app-rn-runtime/core/components/floatinglabel.component.js.map +1 -0
- app-rn-runtime/core/components/textinput.component.js +25 -2
- app-rn-runtime/core/components/textinput.component.js.map +1 -1
- app-rn-runtime/core/constant.service.js +22 -0
- app-rn-runtime/core/constant.service.js.map +1 -0
- app-rn-runtime/core/formatters.js +9 -2
- app-rn-runtime/core/formatters.js.map +1 -1
- app-rn-runtime/core/imageSizeEstimator.js +4 -0
- app-rn-runtime/core/imageSizeEstimator.js.map +1 -1
- app-rn-runtime/core/key.extractor.js +22 -0
- app-rn-runtime/core/key.extractor.js.map +1 -0
- app-rn-runtime/core/tappable.component.js +49 -12
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/core/testid.provider.js +5 -0
- app-rn-runtime/core/testid.provider.js.map +1 -0
- app-rn-runtime/core/utils.js +16 -0
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/gestures/swipe.animation.js +90 -16
- app-rn-runtime/gestures/swipe.animation.js.map +1 -1
- app-rn-runtime/package.json +6 -3
- app-rn-runtime/runtime/App.js +55 -22
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/base-fragment.component.js +27 -6
- app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
- app-rn-runtime/runtime/base-page.component.js +25 -2
- app-rn-runtime/runtime/base-page.component.js.map +1 -1
- app-rn-runtime/runtime/services/app-i18n.service.js +7 -0
- app-rn-runtime/runtime/services/app-i18n.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-modal.service.js +1 -1
- app-rn-runtime/runtime/services/app-modal.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-security.service.js +14 -3
- app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
- app-rn-runtime/runtime/services/device/camera-service.js +26 -9
- app-rn-runtime/runtime/services/device/camera-service.js.map +1 -1
- app-rn-runtime/runtime/services/device/scan-service.js +16 -2
- app-rn-runtime/runtime/services/device/scan-service.js.map +1 -1
- app-rn-runtime/runtime/services/webprocess.service.js +0 -1
- app-rn-runtime/runtime/services/webprocess.service.js.map +1 -1
- app-rn-runtime/styles/theme.js +66 -1
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/styles/theme.variables.js +24 -3
- app-rn-runtime/styles/theme.variables.js.map +1 -1
- app-rn-runtime/variables/http.service.js +1 -1
- app-rn-runtime/variables/http.service.js.map +1 -1
- app-rn-runtime/variables/live-variable.js +1 -0
- app-rn-runtime/variables/live-variable.js.map +1 -1
- app-rn-runtime/variables/model-variable.js +13 -1
- app-rn-runtime/variables/model-variable.js.map +1 -1
- app-rn-runtime/variables/service-variable.js +1 -0
- app-rn-runtime/variables/service-variable.js.map +1 -1
|
@@ -19,12 +19,20 @@ export default class WmNumber extends BaseNumberComponent {
|
|
|
19
19
|
constructor(props) {
|
|
20
20
|
super(props, DEFAULT_CLASS, new WmNumberProps(), new WmNumberState());
|
|
21
21
|
}
|
|
22
|
+
getStyleClassName() {
|
|
23
|
+
const classes = [];
|
|
24
|
+
if (this.state.props.floatinglabel) {
|
|
25
|
+
classes.push('app-number-with-label');
|
|
26
|
+
}
|
|
27
|
+
classes.push(super.getStyleClassName());
|
|
28
|
+
return classes.join(' ');
|
|
29
|
+
}
|
|
22
30
|
renderWidget(props) {
|
|
23
31
|
var _this$state$textValue;
|
|
24
32
|
let opts = {};
|
|
25
33
|
const valueExpr = Platform.OS === 'web' ? 'value' : 'defaultValue';
|
|
26
34
|
opts[valueExpr] = ((_this$state$textValue = this.state.textValue) === null || _this$state$textValue === void 0 ? void 0 : _this$state$textValue.toString()) || '';
|
|
27
|
-
return /*#__PURE__*/React.createElement(WMTextInput, _extends({
|
|
35
|
+
return /*#__PURE__*/React.createElement(WMTextInput, _extends({}, this.getTestPropsForInput(), {
|
|
28
36
|
ref: ref => {
|
|
29
37
|
this.widgetRef = ref;
|
|
30
38
|
// @ts-ignore
|
|
@@ -34,16 +42,22 @@ export default class WmNumber extends BaseNumberComponent {
|
|
|
34
42
|
}
|
|
35
43
|
}
|
|
36
44
|
}, opts, {
|
|
45
|
+
floatingLabel: props.floatinglabel,
|
|
46
|
+
floatingLabelStyle: this.styles.floatingLabel,
|
|
47
|
+
activeFloatingLabelStyle: this.styles.activeFloatingLabel,
|
|
37
48
|
style: [this.styles.root, this.state.isValid ? {} : this.styles.invalid],
|
|
38
49
|
keyboardType: "numeric",
|
|
39
50
|
placeholderTextColor: this.styles.placeholderText.color,
|
|
40
51
|
autoFocus: props.autofocus,
|
|
41
52
|
editable: props.disabled || props.readonly ? false : true,
|
|
42
53
|
placeholder: props.placeholder,
|
|
54
|
+
value: this.state.textValue,
|
|
43
55
|
onBlur: this.onBlur.bind(this),
|
|
44
56
|
onFocus: this.onFocus.bind(this),
|
|
45
57
|
onKeyPress: this.validateInputEntry.bind(this),
|
|
46
|
-
onChangeText:
|
|
58
|
+
onChangeText: text => {
|
|
59
|
+
this.onChangeText.bind(this)(text, 'number');
|
|
60
|
+
},
|
|
47
61
|
onChange: this.invokeChange.bind(this),
|
|
48
62
|
allowContentSelection: this.styles.text.userSelect === 'text'
|
|
49
63
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","isNull","WmNumberProps","DEFAULT_CLASS","WMTextInput","BaseNumberComponent","BaseNumberState","WmNumberState","constructor","arguments","_defineProperty","WmNumber","props","renderWidget","_this$state$textValue","opts","valueExpr","OS","
|
|
1
|
+
{"version":3,"names":["React","Platform","isNull","WmNumberProps","DEFAULT_CLASS","WMTextInput","BaseNumberComponent","BaseNumberState","WmNumberState","constructor","arguments","_defineProperty","WmNumber","props","getStyleClassName","classes","state","floatinglabel","push","join","renderWidget","_this$state$textValue","opts","valueExpr","OS","textValue","toString","createElement","_extends","getTestPropsForInput","ref","widgetRef","selectionStart","selectionEnd","cursor","floatingLabel","floatingLabelStyle","styles","activeFloatingLabelStyle","activeFloatingLabel","style","root","isValid","invalid","keyboardType","placeholderTextColor","placeholderText","color","autoFocus","autofocus","editable","disabled","readonly","placeholder","value","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';\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 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 value={this.state.textValue}\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;AAEnF,OAAO,MAAMC,aAAa,SAASD,eAAe,CAAgB;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;EAAA;AAElE;AAEA,eAAe,MAAMC,QAAQ,SAASN,mBAAmB,CAA+C;EAEtGG,WAAWA,CAACI,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAET,aAAa,EAAE,IAAID,aAAa,CAAC,CAAC,EAAE,IAAIK,aAAa,CAAC,CAAC,CAAC;EACvE;EAEOM,iBAAiBA,CAAA,EAAuB;IAC7C,MAAMC,OAAO,GAAG,EAAE;IAClB,IAAI,IAAI,CAACC,KAAK,CAACH,KAAK,CAACI,aAAa,EAAE;MAClCF,OAAO,CAACG,IAAI,CAAC,uBAAuB,CAAC;IACvC;IACAH,OAAO,CAACG,IAAI,CAAC,KAAK,CAACJ,iBAAiB,CAAC,CAAC,CAAC;IACvC,OA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;MAC3BC,QAAQ,EAAErC,KAAK,CAACsC,QAAQ,IAAItC,KAAK,CAACuC,QAAQ,GAAG,KAAK,GAAG,IAAK;MAC1DC,WAAW,EAAExC,KAAK,CAACwC,WAAY;MAC/BC,KAAK,EAAE,IAAI,CAACtC,KAAK,CAACS,SAAU;MAC5B8B,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,CAAC3B,MAAM,CAACwB,IAAI,CAACI,UAAU,KAAK;IAAO,EAC/D,CAAC;EACJ;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseNumberProps","WmNumberProps","constructor","arguments","_defineProperty"],"sources":["number.props.ts"],"sourcesContent":["import BaseNumberProps from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.props';\n\nexport default class WmNumberProps extends BaseNumberProps {\n autofocus: boolean = null as any;\n placeholder: string = '';\n}\n"],"mappings":";;;AAAA,OAAOA,eAAe,MAAM,wEAAwE;AAEpG,eAAe,MAAMC,aAAa,SAASD,eAAe,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBACpC,IAAI;IAAAA,eAAA,
|
|
1
|
+
{"version":3,"names":["BaseNumberProps","WmNumberProps","constructor","arguments","_defineProperty"],"sources":["number.props.ts"],"sourcesContent":["import BaseNumberProps from '@wavemaker/app-rn-runtime/components/input/basenumber/basenumber.props';\n\nexport default class WmNumberProps extends BaseNumberProps {\n autofocus: boolean = null as any;\n floatinglabel?: string;\n placeholder: string = '';\n}\n"],"mappings":";;;AAAA,OAAOA,eAAe,MAAM,wEAAwE;AAEpG,eAAe,MAAMC,aAAa,SAASD,eAAe,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,oBACpC,IAAI;IAAAA,eAAA;IAAAA,eAAA,sBAEH,EAAE;EAAA;AAC1B"}
|
|
@@ -4,12 +4,16 @@ export const DEFAULT_CLASS = 'app-number';
|
|
|
4
4
|
BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
5
5
|
const defaultStyles = defineStyles({
|
|
6
6
|
root: {
|
|
7
|
-
|
|
7
|
+
minHeight: 42,
|
|
8
|
+
paddingTop: 8,
|
|
9
|
+
paddingBottom: 8,
|
|
8
10
|
borderWidth: 1,
|
|
9
11
|
borderStyle: 'solid',
|
|
10
12
|
borderColor: themeVariables.inputBorderColor,
|
|
11
13
|
backgroundColor: themeVariables.inputBackgroundColor,
|
|
12
|
-
borderRadius: 6
|
|
14
|
+
borderRadius: 6,
|
|
15
|
+
paddingLeft: 16,
|
|
16
|
+
paddingRight: 16
|
|
13
17
|
},
|
|
14
18
|
text: {
|
|
15
19
|
fontSize: 16,
|
|
@@ -21,6 +25,8 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
21
25
|
placeholderText: {
|
|
22
26
|
color: themeVariables.inputPlaceholderColor
|
|
23
27
|
},
|
|
28
|
+
floatingLabel: {},
|
|
29
|
+
activeFloatingLabel: {},
|
|
24
30
|
skeleton: {}
|
|
25
31
|
});
|
|
26
32
|
addStyle(DEFAULT_CLASS, '', defaultStyles);
|
|
@@ -34,5 +40,20 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
34
40
|
textAlign: 'right'
|
|
35
41
|
}
|
|
36
42
|
});
|
|
43
|
+
addStyle(DEFAULT_CLASS + '-with-label', '', {
|
|
44
|
+
root: {
|
|
45
|
+
minHeight: 48
|
|
46
|
+
},
|
|
47
|
+
floatingLabel: {
|
|
48
|
+
position: 'absolute',
|
|
49
|
+
top: 12,
|
|
50
|
+
left: 16,
|
|
51
|
+
fontSize: 14,
|
|
52
|
+
color: themeVariables.floatingLabelColor
|
|
53
|
+
},
|
|
54
|
+
activeFloatingLabel: {
|
|
55
|
+
color: themeVariables.activeFloatingLabelColor
|
|
56
|
+
}
|
|
57
|
+
});
|
|
37
58
|
});
|
|
38
59
|
//# sourceMappingURL=number.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","
|
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","minHeight","paddingTop","paddingBottom","borderWidth","borderStyle","borderColor","inputBorderColor","backgroundColor","inputBackgroundColor","borderRadius","paddingLeft","paddingRight","text","fontSize","textAlign","invalid","borderBottomColor","inputInvalidBorderColor","placeholderText","color","inputPlaceholderColor","floatingLabel","activeFloatingLabel","skeleton","inputDisabledBgColor","position","top","left","floatingLabelColor","activeFloatingLabelColor"],"sources":["number.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\n\nexport type WmNumberStyles = BaseStyles & {\n invalid: AllStyle;\n placeholderText: AllStyle;\n floatingLabel: AllStyle;\n activeFloatingLabel: AllStyle;\n skeleton: WmSkeletonStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-number';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmNumberStyles = defineStyles<WmNumberStyles>({\n root: {\n minHeight: 42,\n paddingTop: 8,\n paddingBottom: 8,\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n backgroundColor: themeVariables.inputBackgroundColor,\n borderRadius: 6,\n paddingLeft: 16,\n paddingRight: 16\n },\n text: {\n fontSize: 16,\n textAlign: 'left'\n },\n invalid: {\n borderBottomColor: themeVariables.inputInvalidBorderColor\n },\n placeholderText: {\n color: themeVariables.inputPlaceholderColor\n },\n floatingLabel: {},\n activeFloatingLabel: {},\n skeleton: {} as WmSkeletonStyles\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n backgroundColor: themeVariables.inputDisabledBgColor\n }\n });\n addStyle(DEFAULT_CLASS + '-rtl', '', {\n root : {\n textAlign: 'right'\n }\n });\n addStyle(DEFAULT_CLASS + '-with-label', '', {\n root: {\n minHeight: 48\n },\n floatingLabel: {\n position: 'absolute',\n top: 12,\n left: 16,\n fontSize: 14,\n color: themeVariables.floatingLabelColor\n },\n activeFloatingLabel: {\n color: themeVariables.activeFloatingLabelColor\n }\n });\n});\n\n"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAWxF,OAAO,MAAMC,aAAa,GAAG,YAAY;AACzCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA6B,GAAGL,YAAY,CAAiB;IAC/DM,IAAI,EAAE;MACJC,SAAS,EAAE,EAAE;MACbC,UAAU,EAAE,CAAC;MACbC,aAAa,EAAE,CAAC;MAChBC,WAAW,EAAE,CAAC;MACdC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAET,cAAc,CAACU,gBAAgB;MAC5CC,eAAe,EAAEX,cAAc,CAACY,oBAAoB;MACpDC,YAAY,EAAE,CAAC;MACfC,WAAW,EAAE,EAAE;MACfC,YAAY,EAAE;IAChB,CAAC;IACDC,IAAI,EAAE;MACJC,QAAQ,EAAE,EAAE;MACZC,SAAS,EAAE;IACb,CAAC;IACDC,OAAO,EAAE;MACPC,iBAAiB,EAAEpB,cAAc,CAACqB;IACpC,CAAC;IACDC,eAAe,EAAE;MACfC,KAAK,EAAEvB,cAAc,CAACwB;IACxB,CAAC;IACDC,aAAa,EAAE,CAAC,CAAC;IACjBC,mBAAmB,EAAE,CAAC,CAAC;IACvBC,QAAQ,EAAE,CAAC;EACf,CAAC,CAAC;EAEF1B,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACtCK,IAAI,EAAG;MACLQ,eAAe,EAAEX,cAAc,CAAC4B;IAClC;EACJ,CAAC,CAAC;EACF3B,QAAQ,CAACH,aAAa,GAAG,MAAM,EAAE,EAAE,EAAE;IACjCK,IAAI,EAAG;MACLe,SAAS,EAAE;IACb;EACJ,CAAC,CAAC;EACFjB,QAAQ,CAACH,aAAa,GAAG,aAAa,EAAE,EAAE,EAAE;IAC1CK,IAAI,EAAE;MACJC,SAAS,EAAE;IACb,CAAC;IACDqB,aAAa,EAAE;MACbI,QAAQ,EAAE,UAAU;MACpBC,GAAG,EAAE,EAAE;MACPC,IAAI,EAAE,EAAE;MACRd,QAAQ,EAAE,EAAE;MACZM,KAAK,EAAEvB,cAAc,CAACgC;IACxB,CAAC;IACDN,mBAAmB,EAAE;MACnBH,KAAK,EAAEvB,cAAc,CAACiC;IACxB;EACF,CAAC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { View, Text } from 'react-native';
|
|
3
4
|
import { RadioButton } from 'react-native-paper';
|
|
@@ -13,17 +14,21 @@ export default class WmRadioset extends BaseDatasetComponent {
|
|
|
13
14
|
this.invokeEventCallback('onTap', [null, this.proxy]);
|
|
14
15
|
this.onValueChange(value);
|
|
15
16
|
}
|
|
16
|
-
renderChild(item, index) {
|
|
17
|
+
renderChild(item, index, colWidth) {
|
|
17
18
|
const displayText = item.displayexp || item.displayfield;
|
|
19
|
+
const value = this.state.props.datafield === 'All Fields' ? this.getItemKey(item.datafield) : item.datafield;
|
|
20
|
+
const selected = value === this.state.props.datavalue;
|
|
18
21
|
return /*#__PURE__*/React.createElement(View, {
|
|
19
|
-
style: this.styles.
|
|
22
|
+
style: [this.styles.item, selected ? this.styles.selectedItem : null, {
|
|
23
|
+
width: colWidth
|
|
24
|
+
}],
|
|
20
25
|
key: item.key
|
|
21
|
-
}, /*#__PURE__*/React.createElement(RadioButton.Android, {
|
|
22
|
-
value:
|
|
26
|
+
}, /*#__PURE__*/React.createElement(RadioButton.Android, _extends({}, this.getTestProps('' + index), {
|
|
27
|
+
value: value,
|
|
23
28
|
color: this.styles.root.color,
|
|
24
29
|
uncheckedColor: this.styles.root.color,
|
|
25
30
|
disabled: this.state.props.readonly || this.state.props.disabled
|
|
26
|
-
}), /*#__PURE__*/React.createElement(Text, {
|
|
31
|
+
})), /*#__PURE__*/React.createElement(Text, {
|
|
27
32
|
style: this.styles.radioLabel
|
|
28
33
|
}, displayText));
|
|
29
34
|
}
|
|
@@ -39,12 +44,14 @@ export default class WmRadioset extends BaseDatasetComponent {
|
|
|
39
44
|
}
|
|
40
45
|
renderRadioButtons(items) {
|
|
41
46
|
const props = this.state.props;
|
|
47
|
+
const noOfColumns = props.itemsperrow.xs || 1;
|
|
48
|
+
const colWidth = Math.round(100 / noOfColumns) + '%';
|
|
42
49
|
return /*#__PURE__*/React.createElement(RadioButton.Group, {
|
|
43
50
|
onValueChange: this.onPress.bind(this),
|
|
44
51
|
value: this.state.props.datafield === 'All Fields' ? this.getItemKey(props.datavalue) : props.datavalue
|
|
45
52
|
}, /*#__PURE__*/React.createElement(View, {
|
|
46
53
|
style: this.styles.group
|
|
47
|
-
}, items && items.length ? items.map((item, index) => this.renderChild(item, index)) : null));
|
|
54
|
+
}, items && items.length ? items.map((item, index) => this.renderChild(item, index, colWidth)) : null));
|
|
48
55
|
}
|
|
49
56
|
renderWidget(props) {
|
|
50
57
|
const items = this.state.dataItems;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","RadioButton","WmRadiosetProps","DEFAULT_CLASS","BaseDatasetComponent","BaseDatasetState","WmRadiosetState","WmRadioset","constructor","props","onPress","value","invokeEventCallback","proxy","onValueChange","renderChild","item","index","displayText","displayexp","displayfield","createElement","style","styles","
|
|
1
|
+
{"version":3,"names":["React","View","Text","RadioButton","WmRadiosetProps","DEFAULT_CLASS","BaseDatasetComponent","BaseDatasetState","WmRadiosetState","WmRadioset","constructor","props","onPress","value","invokeEventCallback","proxy","onValueChange","renderChild","item","index","colWidth","displayText","displayexp","displayfield","state","datafield","getItemKey","selected","datavalue","createElement","style","styles","selectedItem","width","key","Android","_extends","getTestProps","color","root","uncheckedColor","disabled","readonly","radioLabel","renderGroupby","groupedData","length","map","groupObj","groupHeaderTitle","renderRadioButtons","data","items","noOfColumns","itemsperrow","xs","Math","round","Group","bind","group","renderWidget","dataItems","groupby"],"sources":["radioset.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, DimensionValue } from 'react-native';\nimport { RadioButton } from 'react-native-paper';\n\nimport WmRadiosetProps from './radioset.props';\nimport { DEFAULT_CLASS, WmRadiosetStyles } from './radioset.styles';\nimport {\n BaseDatasetComponent,\n BaseDatasetState\n} from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.component';\nimport WmSkeleton, { createSkeleton } from '../../basic/skeleton/skeleton.component';\n\nexport class WmRadiosetState extends BaseDatasetState<WmRadiosetProps> {\n}\n\nexport default class WmRadioset extends BaseDatasetComponent<WmRadiosetProps, WmRadiosetState, WmRadiosetStyles> {\n\n constructor(props: WmRadiosetProps) {\n super(props, DEFAULT_CLASS, new WmRadiosetProps());\n }\n\n onPress(value: any) {\n this.invokeEventCallback('onTap', [null, this.proxy]);\n this.onValueChange(value);\n }\n\n renderChild(item: any, index: any, colWidth: DimensionValue) {\n const displayText = item.displayexp || item.displayfield;\n const value = this.state.props.datafield === 'All Fields' ? this.getItemKey(item.datafield) : item.datafield;\n const selected = value === this.state.props.datavalue;\n return (\n <View style={[\n this.styles.item,\n selected ? this.styles.selectedItem : null,\n {width: colWidth}]} key={item.key}>\n <RadioButton.Android\n {...this.getTestProps('' + index)}\n value={value}\n color={this.styles.root.color as string}\n uncheckedColor={this.styles.root.color as string}\n disabled={this.state.props.readonly || this.state.props.disabled}\n />\n <Text style={this.styles.radioLabel}>{displayText}</Text>\n </View>)\n }\n\n renderGroupby() {\n const groupedData = this.state.groupedData;\n return (\n <View>\n {groupedData && groupedData.length\n ? groupedData.map((groupObj: any, index: any) => {\n return(\n <View key={groupObj.key}>\n <Text style={this.styles.groupHeaderTitle}>{groupObj.key}</Text>\n {this.renderRadioButtons(groupObj.data)}\n </View>)\n })\n : null}\n </View>\n );\n }\n\n renderRadioButtons(items: any) {\n const props = this.state.props;\n const noOfColumns = props.itemsperrow.xs || 1;\n const colWidth = Math.round(100/ noOfColumns) + '%' as DimensionValue;\n return(<RadioButton.Group onValueChange={this.onPress.bind(this)} value={this.state.props.datafield === 'All Fields'? this.getItemKey(props.datavalue) : props.datavalue}>\n <View style={this.styles.group}>\n {items && items.length ?\n items.map((item: any, index: any) => this.renderChild(item, index, colWidth)): null}\n </View>\n </RadioButton.Group>)\n }\n\n renderWidget(props: WmRadiosetProps) {\n const items = this.state.dataItems;\n return (\n <View style={this.styles.root}>\n {props.groupby && this.renderGroupby()}\n {!props.groupby && this.renderRadioButtons(items)}\n </View>\n );\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAwB,cAAc;AACzD,SAAS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AAK,CAAC,GAAG,GAAEJ,WAAW,CAAC,GAAG,GAAqB;IACrE,oBAAOrD,KAAA,CAAA6B,aAAA,CAAC1B,WAAW,CAACuD,KAAK;MAAC1C,aAAa,EAAE,IAAI,CAACJ,OAAO,CAAC+C,IAAI,CAAC,IAAI,CAAE;MAAC9C,KAAK,EAAE,IAAI,CAACW,KAAK,CAACb,KAAK,CAACc,SAAS,KAAK,YAAY,GAAE,IAAI,CAACC,UAAU,CAACf,KAAK,CAACiB,SAAS,CAAC,GAAGjB,KAAK,CAACiB;IAAU,gBACvK5B,KAAA,CAAA6B,aAAA,CAAC5B,IAAI;MAAC6B,KAAK,EAAE,IAAI,CAACC,MAAM,CAAC6B;IAAM,GAC5BR,KAAK,IAAIA,KAAK,CAACN,MAAM,GACpBM,KAAK,CAACL,GAAG,CAAC,CAAC7B,IAAS,EAAEC,KAAU,KAAK,IAAI,CAACF,WAAW,CAACC,IAAI,EAAEC,KAAK,EAAEC,QAAQ,CAAC,CAAC,GAAE,IAC7E,CACW,CAAC;EACtB;EAEAyC,YAAYA,CAAClD,KAAsB,EAAE;IACnC,MAAMyC,KAAK,GAAG,IAAI,CAAC5B,KAAK,CAACsC,SAAS;IAClC,oBACI9D,KAAA,CAAA6B,aAAA,CAAC5B,IAAI;MAAC6B,KAAK,EAAE,IAAI,CAACC,MAAM,CAACQ;IAAK,GAC3B5B,KAAK,CAACoD,OAAO,IAAI,IAAI,CAACnB,aAAa,CAAC,CAAC,EACrC,CAACjC,KAAK,CAACoD,OAAO,IAAI,IAAI,CAACb,kBAAkB,CAACE,KAAK,CAC5C,CAAC;EAEb;AACF"}
|
|
@@ -6,6 +6,12 @@ export default class WmRadiosetProps extends BaseDatasetProps {
|
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
8
|
_defineProperty(this, "dataset", 'Option 1, Option 2, Option 3');
|
|
9
|
+
_defineProperty(this, "itemsperrow", {
|
|
10
|
+
xs: 1,
|
|
11
|
+
sm: 1,
|
|
12
|
+
md: 1,
|
|
13
|
+
lg: 1
|
|
14
|
+
});
|
|
9
15
|
}
|
|
10
16
|
}
|
|
11
17
|
//# sourceMappingURL=radioset.props.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseDatasetProps","WmRadiosetProps","constructor","arguments","_defineProperty"],"sources":["radioset.props.ts"],"sourcesContent":["import BaseDatasetProps from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.props';\n\nexport default class WmRadiosetProps extends BaseDatasetProps {\n dataset: any = 'Option 1, Option 2, Option 3';\n}\n"],"mappings":";;;AAAA,OAAOA,gBAAgB,MAAM,0EAA0E;AAEvG,eAAe,MAAMC,eAAe,SAASD,gBAAgB,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,kBAC7C,8BAA8B;EAAA;
|
|
1
|
+
{"version":3,"names":["BaseDatasetProps","WmRadiosetProps","constructor","arguments","_defineProperty","xs","sm","md","lg"],"sources":["radioset.props.ts"],"sourcesContent":["import BaseDatasetProps from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.props';\n\nexport default class WmRadiosetProps extends BaseDatasetProps {\n dataset: any = 'Option 1, Option 2, Option 3';\n itemsperrow = {\n xs: 1,\n sm: 1,\n md: 1,\n lg: 1,\n };\n}\n"],"mappings":";;;AAAA,OAAOA,gBAAgB,MAAM,0EAA0E;AAEvG,eAAe,MAAMC,eAAe,SAASD,gBAAgB,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,kBAC7C,8BAA8B;IAAAA,eAAA,sBAC9B;MACbC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE;IACP,CAAC;EAAA;AACF"}
|
|
@@ -7,7 +7,10 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
7
7
|
color: themeVariables.checkedColor
|
|
8
8
|
},
|
|
9
9
|
text: {},
|
|
10
|
-
group: {
|
|
10
|
+
group: {
|
|
11
|
+
flexDirection: 'row',
|
|
12
|
+
flexWrap: 'wrap'
|
|
13
|
+
},
|
|
11
14
|
groupHeaderTitle: {
|
|
12
15
|
backgroundColor: themeVariables.groupHeadingBgColor,
|
|
13
16
|
fontSize: 16,
|
|
@@ -16,10 +19,11 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
16
19
|
lineHeight: 40,
|
|
17
20
|
fontFamily: themeVariables.baseFont
|
|
18
21
|
},
|
|
19
|
-
|
|
22
|
+
item: {
|
|
20
23
|
flexDirection: 'row',
|
|
21
24
|
alignContent: 'center'
|
|
22
25
|
},
|
|
26
|
+
selectedItem: {},
|
|
23
27
|
radioLabel: {
|
|
24
28
|
alignSelf: 'center',
|
|
25
29
|
fontFamily: themeVariables.baseFont,
|
|
@@ -40,13 +44,6 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
|
40
44
|
opacity: 0.8
|
|
41
45
|
}
|
|
42
46
|
});
|
|
43
|
-
addStyle(DEFAULT_CLASS + '-row', '', {
|
|
44
|
-
group: {
|
|
45
|
-
flexDirection: 'row',
|
|
46
|
-
flexWrap: 'wrap',
|
|
47
|
-
justifyContent: 'space-between'
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
47
|
addStyle(DEFAULT_CLASS, '', defaultStyles);
|
|
51
48
|
});
|
|
52
49
|
//# sourceMappingURL=radioset.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","color","checkedColor","text","group","groupHeaderTitle","backgroundColor","groupHeadingBgColor","fontSize","paddingLeft","paddingRight","lineHeight","fontFamily","baseFont","
|
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","color","checkedColor","text","group","flexDirection","flexWrap","groupHeaderTitle","backgroundColor","groupHeadingBgColor","fontSize","paddingLeft","paddingRight","lineHeight","fontFamily","baseFont","item","alignContent","selectedItem","radioLabel","alignSelf","labelDefaultColor","skeleton","width","height","borderRadius","checkedDisabledColor","opacity"],"sources":["radioset.styles.ts"],"sourcesContent":["import BASE_THEME, { AllStyle } from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\n\nexport type WmRadiosetStyles = BaseStyles & {\n group: AllStyle,\n groupHeaderTitle: AllStyle;\n item: AllStyle;\n selectedItem: AllStyle;\n radioLabel: AllStyle;\n skeleton: WmSkeletonStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-radioset';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmRadiosetStyles = defineStyles({\n root: {\n color: themeVariables.checkedColor\n },\n text: {},\n group: {\n flexDirection: 'row',\n flexWrap: 'wrap'\n },\n groupHeaderTitle: {\n backgroundColor: themeVariables.groupHeadingBgColor,\n fontSize: 16,\n paddingLeft: 8,\n paddingRight: 8,\n lineHeight: 40,\n fontFamily: themeVariables.baseFont\n } as AllStyle,\n item: {\n flexDirection: 'row',\n alignContent: 'center',\n } as AllStyle,\n selectedItem: {} as AllStyle,\n radioLabel: {\n alignSelf: 'center',\n fontFamily: themeVariables.baseFont,\n fontSize: 16,\n color: themeVariables.labelDefaultColor\n } as AllStyle,\n skeleton: {\n root: {\n width: '100%',\n height: 16,\n borderRadius: 4\n }\n } as any as WmSkeletonStyles\n });\n\n addStyle(DEFAULT_CLASS + '-disabled', '', {\n root : {\n color: themeVariables.checkedDisabledColor,\n opacity: 0.8\n }\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAoB,wCAAwC;AAC7E,SAAqBC,YAAY,QAAQ,+CAA+C;AAYxF,OAAO,MAAMC,aAAa,GAAG,cAAc;AAC3CF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA+B,GAAGL,YAAY,CAAC;IACjDM,IAAI,EAAE;MACJC,KAAK,EAAEJ,cAAc,CAACK;IACxB,CAAC;IACDC,IAAI,EAAE,CAAC,CAAC;IACRC,KAAK,EAAE;MACLC,aAAa,EAAE,KAAK;MACpBC,QAAQ,EAAE;IACZ,CAAC;IACDC,gBAAgB,EAAE;MAChBC,eAAe,EAAEX,cAAc,CAACY,mBAAmB;MACnDC,QAAQ,EAAE,EAAE;MACZC,WAAW,EAAE,CAAC;MACdC,YAAY,EAAE,CAAC;MACfC,UAAU,EAAE,EAAE;MACdC,UAAU,EAAEjB,cAAc,CAACkB;IAC7B,CAAa;IACbC,IAAI,EAAE;MACJX,aAAa,EAAE,KAAK;MACpBY,YAAY,EAAE;IAChB,CAAa;IACbC,YAAY,EAAE,CAAC,CAAa;IAC5BC,UAAU,EAAE;MACRC,SAAS,EAAE,QAAQ;MACnBN,UAAU,EAAEjB,cAAc,CAACkB,QAAQ;MACnCL,QAAQ,EAAE,EAAE;MACZT,KAAK,EAAEJ,cAAc,CAACwB;IAC1B,CAAa;IACbC,QAAQ,EAAE;MACRtB,IAAI,EAAE;QACJuB,KAAK,EAAE,MAAM;QACbC,MAAM,EAAE,EAAE;QACVC,YAAY,EAAE;MAChB;IACF;EACJ,CAAC,CAAC;EAEF3B,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACxCK,IAAI,EAAG;MACLC,KAAK,EAAEJ,cAAc,CAAC6B,oBAAoB;MAC1CC,OAAO,EAAE;IACX;EACF,CAAC,CAAC;EAEF7B,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;AAC5C,CAAC,CAAC"}
|
|
@@ -119,6 +119,7 @@ export default class WmRating extends BaseComponent {
|
|
|
119
119
|
return /*#__PURE__*/React.createElement(View, {
|
|
120
120
|
style: this.styles.root
|
|
121
121
|
}, this._background, arr.map((v, i) => this.state.selectedIndex > -1 && i <= this.state.selectedIndex ? /*#__PURE__*/React.createElement(WmIcon, {
|
|
122
|
+
id: this.getTestId('star' + i),
|
|
122
123
|
key: i,
|
|
123
124
|
iconclass: "wi wi-star",
|
|
124
125
|
iconsize: props.iconsize,
|
|
@@ -127,6 +128,7 @@ export default class WmRating extends BaseComponent {
|
|
|
127
128
|
this.changeValue(i);
|
|
128
129
|
}
|
|
129
130
|
}) : null), arr.map((v, i) => this.state.selectedIndex === -1 || i > this.state.selectedIndex ? /*#__PURE__*/React.createElement(WmIcon, {
|
|
131
|
+
id: this.getTestId('star' + i),
|
|
130
132
|
key: i,
|
|
131
133
|
iconclass: "wi wi-star-border",
|
|
132
134
|
iconsize: props.iconsize,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","BaseComponent","BaseComponentState","WmIcon","WmRatingProps","DEFAULT_CLASS","cloneDeep","isArray","isNumber","isString","WmRatingState","constructor","arguments","_defineProperty","WmRating","props","caption","state","prepareItems","items","dataset","maxvalue","Array","from","keys","map","v","split","Object","i","key","value","selectedIndex","datavalue","undefined","findIndex","item","k","datafield","showcaptions","selectedItem","getDisplayExpression","displayfield","updateState","onPropertyChange","name","$new","$old","isDefault","onFieldChange","bind","disabled","changeValue","oldValue","readonly","invokeEventCallback","proxy","renderWidget","maxValue","arr","selectedIconStyles","styles","selectedIcon","iconcolor","text","color","createElement","style","root","_background","iconclass","iconsize","onTap","icon"],"sources":["rating.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text } from 'react-native';\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 WmRatingProps from './rating.props';\nimport { DEFAULT_CLASS, WmRatingStyles } from './rating.styles';\nimport { cloneDeep, isArray, isEmpty, isNumber, isString } from 'lodash-es';\n\nexport class WmRatingState extends BaseComponentState<WmRatingProps> {\n items: any[] = null as any;\n caption: any = null as any;\n selectedIndex = -1;\n isDefault = false;\n}\n\nexport default class WmRating extends BaseComponent<WmRatingProps, WmRatingState, WmRatingStyles> {\n\n constructor(props: WmRatingProps) {\n super(props, DEFAULT_CLASS, new WmRatingProps());\n }\n\n get caption() {\n return this.state.caption;\n }\n\n prepareItems(props: WmRatingProps) {\n let items: any[] = [];\n if (!props.dataset && props.maxvalue) {\n items = Array.from(Array(+props.maxvalue).keys());\n items = items.map(v => v + 1);\n } else if (isString(props.dataset)) {\n items = props.dataset.split(',');\n } else {\n items = props.dataset as any[] || [];\n }\n if (isArray(items) && items[0] !== Object(items[0])) {\n items = items.map((v, i) => ({\n key: i + 1,\n value: v\n }));\n }\n let selectedIndex = -1;\n if (props.datavalue !== undefined && props.datavalue !== null) {\n selectedIndex = items.findIndex((item: any, k) => item[props.datafield as string] == props.datavalue);\n if (selectedIndex === -1 && isNumber(props.datavalue)) {\n selectedIndex = props.datavalue;\n }\n }\n let caption: any = '';\n if (selectedIndex > -1 && props.showcaptions) {\n const selectedItem = items[selectedIndex];\n if (selectedItem) {\n if (props.getDisplayExpression) {\n caption = props.getDisplayExpression(selectedItem);\n } else {\n caption = selectedItem[props.displayfield as string];\n }\n } else {\n caption = selectedIndex + 1;\n }\n }\n this.updateState({\n items: items,\n selectedIndex: selectedIndex,\n caption: caption\n } as WmRatingState);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch(name) {\n case 'dataset' :\n case 'datafield' :\n case 'displayfield' :\n case 'maxvalue':\n case 'datavalue' :\n this.prepareItems(this.state.props);\n if (name === 'datavalue') {\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as WmRatingState, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n }\n break;\n case 'readonly' :\n this.updateState({\n props: {\n disabled: $new\n }\n } as WmRatingState);\n break;\n }\n }\n\n changeValue(i: number) {\n const props = this.state.props;\n const oldValue = props.datavalue;\n if (!props.readonly) {\n let value = this.state.items[i] ? this.state.items[i][props.datafield || '']: i;\n this.updateState({\n props: {\n datavalue: value\n }\n } as WmRatingState, () => {\n !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [undefined, this.proxy, value, oldValue]);\n });\n }\n }\n\n renderWidget(props: WmRatingProps) {\n const maxValue = props.maxvalue ? +props.maxvalue : 5;\n const arr = Array.from(Array(maxValue).keys());\n\n let selectedIconStyles = this.styles.selectedIcon;\n if (props.iconcolor) {\n selectedIconStyles = cloneDeep(this.styles.selectedIcon);\n selectedIconStyles.text.color = props.iconcolor;\n }\n return (\n <View style={this.styles.root}>\n {this._background}\n {arr.map((v, i) => (\n (this.state.selectedIndex > -1 && i <= this.state.selectedIndex) ? <WmIcon\n key={i}\n iconclass=\"wi wi-star\"\n iconsize={props.iconsize}\n styles={selectedIconStyles}\n onTap={() => { this.changeValue(i)}}\n ></WmIcon> : null\n ))}\n {arr.map((v, i) => (\n (this.state.selectedIndex === -1 || i > this.state.selectedIndex) ? <WmIcon\n key={i}\n iconclass=\"wi wi-star-border\"\n iconsize={props.iconsize}\n styles={this.styles.icon}\n onTap={() => { this.changeValue(i)}}\n ></WmIcon> : null\n ))}\n { !!props.showcaptions ? (<Text style={this.styles.text}>{this.state.caption}</Text>) : null }\n </View>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,MAAM,MAAM,gEAAgE;AAEnF,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,SAASC,SAAS,EAAEC,OAAO,EAAWC,QAAQ,EAAEC,QAAQ,QAAQ,WAAW;AAE3E,OAAO,MAAMC,aAAa,SAASR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AAC,KACX,IAAI,CAACZ,KAAK,CAACe,aAAa,KAAK,CAAC,CAAC,IAAIH,CAAC,GAAG,IAAI,CAACZ,KAAK,CAACe,aAAa,gBAAIlC,KAAA,CAAAoE,aAAA,CAAC/D,MAAM;MACzE2B,GAAG,EAAED,CAAE;MACPyC,SAAS,EAAC,mBAAmB;MAC7BC,QAAQ,EAAExD,KAAK,CAACwD,QAAS;MACzBV,MAAM,EAAE,IAAI,CAACA,MAAM,CAACY,IAAK;MACzBD,KAAK,EAAEA,CAAA,KAAM;QAAE,IAAI,CAACpB,WAAW,CAACvB,CAAC,CAAC;MAAA;IAAE,CAC7B,CAAC,GAAG,IACd,CAAC,EACA,CAAC,CAACd,KAAK,CAACwB,YAAY,gBAAIzC,KAAA,CAAAoE,aAAA,CAAClE,IAAI;MAACmE,KAAK,EAAE,IAAI,CAACN,MAAM,CAACG;IAAK,GAAE,IAAI,CAAC/C,KAAK,CAACD,OAAc,CAAC,GAAI,IACpF,CAAC;EACT;AACF"}
|
|
1
|
+
{"version":3,"names":["React","View","Text","BaseComponent","BaseComponentState","WmIcon","WmRatingProps","DEFAULT_CLASS","cloneDeep","isArray","isNumber","isString","WmRatingState","constructor","arguments","_defineProperty","WmRating","props","caption","state","prepareItems","items","dataset","maxvalue","Array","from","keys","map","v","split","Object","i","key","value","selectedIndex","datavalue","undefined","findIndex","item","k","datafield","showcaptions","selectedItem","getDisplayExpression","displayfield","updateState","onPropertyChange","name","$new","$old","isDefault","onFieldChange","bind","disabled","changeValue","oldValue","readonly","invokeEventCallback","proxy","renderWidget","maxValue","arr","selectedIconStyles","styles","selectedIcon","iconcolor","text","color","createElement","style","root","_background","id","getTestId","iconclass","iconsize","onTap","icon"],"sources":["rating.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text } from 'react-native';\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 WmRatingProps from './rating.props';\nimport { DEFAULT_CLASS, WmRatingStyles } from './rating.styles';\nimport { cloneDeep, isArray, isEmpty, isNumber, isString } from 'lodash-es';\n\nexport class WmRatingState extends BaseComponentState<WmRatingProps> {\n items: any[] = null as any;\n caption: any = null as any;\n selectedIndex = -1;\n isDefault = false;\n}\n\nexport default class WmRating extends BaseComponent<WmRatingProps, WmRatingState, WmRatingStyles> {\n\n constructor(props: WmRatingProps) {\n super(props, DEFAULT_CLASS, new WmRatingProps());\n }\n\n get caption() {\n return this.state.caption;\n }\n\n prepareItems(props: WmRatingProps) {\n let items: any[] = [];\n if (!props.dataset && props.maxvalue) {\n items = Array.from(Array(+props.maxvalue).keys());\n items = items.map(v => v + 1);\n } else if (isString(props.dataset)) {\n items = props.dataset.split(',');\n } else {\n items = props.dataset as any[] || [];\n }\n if (isArray(items) && items[0] !== Object(items[0])) {\n items = items.map((v, i) => ({\n key: i + 1,\n value: v\n }));\n }\n let selectedIndex = -1;\n if (props.datavalue !== undefined && props.datavalue !== null) {\n selectedIndex = items.findIndex((item: any, k) => item[props.datafield as string] == props.datavalue);\n if (selectedIndex === -1 && isNumber(props.datavalue)) {\n selectedIndex = props.datavalue;\n }\n }\n let caption: any = '';\n if (selectedIndex > -1 && props.showcaptions) {\n const selectedItem = items[selectedIndex];\n if (selectedItem) {\n if (props.getDisplayExpression) {\n caption = props.getDisplayExpression(selectedItem);\n } else {\n caption = selectedItem[props.displayfield as string];\n }\n } else {\n caption = selectedIndex + 1;\n }\n }\n this.updateState({\n items: items,\n selectedIndex: selectedIndex,\n caption: caption\n } as WmRatingState);\n }\n\n onPropertyChange(name: string, $new: any, $old: any) {\n switch(name) {\n case 'dataset' :\n case 'datafield' :\n case 'displayfield' :\n case 'maxvalue':\n case 'datavalue' :\n this.prepareItems(this.state.props);\n if (name === 'datavalue') {\n const isDefault = this.state.isDefault;\n if (isDefault) {\n this.updateState({ isDefault: false } as WmRatingState, this.props.onFieldChange && this.props.onFieldChange.bind(this, 'datavalue', $new, $old, isDefault));\n } else {\n this.props.onFieldChange && this.props.onFieldChange('datavalue', $new, $old, isDefault);\n }\n }\n break;\n case 'readonly' :\n this.updateState({\n props: {\n disabled: $new\n }\n } as WmRatingState);\n break;\n }\n }\n\n changeValue(i: number) {\n const props = this.state.props;\n const oldValue = props.datavalue;\n if (!props.readonly) {\n let value = this.state.items[i] ? this.state.items[i][props.datafield || '']: i;\n this.updateState({\n props: {\n datavalue: value\n }\n } as WmRatingState, () => {\n !this.props.onFieldChange && value !== oldValue && this.invokeEventCallback('onChange', [undefined, this.proxy, value, oldValue]);\n });\n }\n }\n\n renderWidget(props: WmRatingProps) {\n const maxValue = props.maxvalue ? +props.maxvalue : 5;\n const arr = Array.from(Array(maxValue).keys());\n\n let selectedIconStyles = this.styles.selectedIcon;\n if (props.iconcolor) {\n selectedIconStyles = cloneDeep(this.styles.selectedIcon);\n selectedIconStyles.text.color = props.iconcolor;\n }\n return (\n <View style={this.styles.root}>\n {this._background}\n {arr.map((v, i) => (\n (this.state.selectedIndex > -1 && i <= this.state.selectedIndex) ? <WmIcon\n id={this.getTestId('star' + i)}\n key={i}\n iconclass=\"wi wi-star\"\n iconsize={props.iconsize}\n styles={selectedIconStyles}\n onTap={() => { this.changeValue(i)}}\n ></WmIcon> : null\n ))}\n {arr.map((v, i) => (\n (this.state.selectedIndex === -1 || i > this.state.selectedIndex) ? <WmIcon\n id={this.getTestId('star' + i)}\n key={i}\n iconclass=\"wi wi-star-border\"\n iconsize={props.iconsize}\n styles={this.styles.icon}\n onTap={() => { this.changeValue(i)}}\n ></WmIcon> : null\n ))}\n { !!props.showcaptions ? (<Text style={this.styles.text}>{this.state.caption}</Text>) : null }\n </View>);\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AACjG,OAAOC,MAAM,MAAM,gEAAgE;AAE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;MACtBC,QAAQ,EAAE1D,KAAK,CAAC0D,QAAS;MACzBZ,MAAM,EAAED,kBAAmB;MAC3Bc,KAAK,EAAEA,CAAA,KAAM;QAAE,IAAI,CAACtB,WAAW,CAACvB,CAAC,CAAC;MAAA;IAAE,CAC7B,CAAC,GAAG,IACd,CAAC,EACD8B,GAAG,CAAClC,GAAG,CAAC,CAACC,CAAC,EAAEG,CAAC,KACX,IAAI,CAACZ,KAAK,CAACe,aAAa,KAAK,CAAC,CAAC,IAAIH,CAAC,GAAG,IAAI,CAACZ,KAAK,CAACe,aAAa,gBAAIlC,KAAA,CAAAoE,aAAA,CAAC/D,MAAM;MACzEmE,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,MAAM,GAAG1C,CAAC,CAAE;MAC/BC,GAAG,EAAED,CAAE;MACP2C,SAAS,EAAC,mBAAmB;MAC7BC,QAAQ,EAAE1D,KAAK,CAAC0D,QAAS;MACzBZ,MAAM,EAAE,IAAI,CAACA,MAAM,CAACc,IAAK;MACzBD,KAAK,EAAEA,CAAA,KAAM;QAAE,IAAI,CAACtB,WAAW,CAACvB,CAAC,CAAC;MAAA;IAAE,CAC7B,CAAC,GAAG,IACd,CAAC,EACA,CAAC,CAACd,KAAK,CAACwB,YAAY,gBAAIzC,KAAA,CAAAoE,aAAA,CAAClE,IAAI;MAACmE,KAAK,EAAE,IAAI,CAACN,MAAM,CAACG;IAAK,GAAE,IAAI,CAAC/C,KAAK,CAACD,OAAc,CAAC,GAAI,IACpF,CAAC;EACT;AACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1
2
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
3
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
4
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
@@ -99,15 +100,16 @@ export default class WmSelect extends BaseDatasetComponent {
|
|
|
99
100
|
this.view = ref;
|
|
100
101
|
},
|
|
101
102
|
onLayout: () => {}
|
|
102
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
103
|
+
}, /*#__PURE__*/React.createElement(Text, _extends({
|
|
103
104
|
style: [this.styles.text, this.state.props.displayValue ? {} : {
|
|
104
105
|
color: this.styles.placeholderText.color
|
|
105
106
|
}],
|
|
106
107
|
ref: ref => {
|
|
107
108
|
this.widgetRef = ref;
|
|
108
|
-
}
|
|
109
|
+
}
|
|
110
|
+
}, this.getTestPropsForInput(), {
|
|
109
111
|
onPress: this.onPress.bind(this)
|
|
110
|
-
}, this.state.props.displayValue || props.placeholder || ' '), /*#__PURE__*/React.createElement(WmButton, {
|
|
112
|
+
}), this.state.props.displayValue || props.placeholder || ' '), /*#__PURE__*/React.createElement(WmButton, {
|
|
111
113
|
styles: this.styles.arrowButton,
|
|
112
114
|
iconclass: 'wi wi-keyboard-arrow-down',
|
|
113
115
|
onTap: this.onPress.bind(this)
|
|
@@ -123,20 +125,22 @@ export default class WmSelect extends BaseDatasetComponent {
|
|
|
123
125
|
this.onChange(isPlaceholder ? '' : this.state.props.datafield === 'All Fields' ? item.dataObject : item.datafield);
|
|
124
126
|
this.hide();
|
|
125
127
|
}
|
|
126
|
-
renderSelectItem(item, isPlaceholder, isLast) {
|
|
127
|
-
|
|
128
|
+
renderSelectItem(item, index, isPlaceholder, isLast) {
|
|
129
|
+
let selected = this.isSelected(item);
|
|
130
|
+
return /*#__PURE__*/React.createElement(Tappable, _extends({}, this.getTestPropsForAction(index + ''), {
|
|
128
131
|
onTap: this.onItemSelect.bind(this, item, isPlaceholder)
|
|
129
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
130
|
-
style: [this.styles.selectItem, isLast ? this.styles.lastSelectItem : null]
|
|
131
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
132
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
133
|
+
style: [this.styles.selectItem, isLast ? this.styles.lastSelectItem : null, selected ? this.styles.selectedItem : null]
|
|
134
|
+
}, /*#__PURE__*/React.createElement(Text, _extends({}, this.getTestPropsForLabel(index + ''), {
|
|
132
135
|
style: [this.styles.selectItemText, {
|
|
133
|
-
color: isPlaceholder ? this.styles.placeholderText.color : this.styles.selectItemText.color
|
|
136
|
+
color: isPlaceholder ? this.styles.placeholderText.color : selected ? this.styles.selectedItemText.color : this.styles.selectItemText.color
|
|
134
137
|
}]
|
|
135
|
-
}, isPlaceholder ? this.state.props.placeholder : item.displayexp || item.displayfield), /*#__PURE__*/React.createElement(WmIcon, {
|
|
138
|
+
}), isPlaceholder ? this.state.props.placeholder : item.displayexp || item.displayfield), /*#__PURE__*/React.createElement(WmIcon, {
|
|
139
|
+
id: this.getTestId('checkicon' + index),
|
|
136
140
|
iconclass: "wi wi-check",
|
|
137
141
|
styles: this.theme.mergeStyle(this.styles.checkIcon, {
|
|
138
142
|
root: {
|
|
139
|
-
opacity: !isPlaceholder &&
|
|
143
|
+
opacity: !isPlaceholder && selected ? 1 : 0
|
|
140
144
|
}
|
|
141
145
|
})
|
|
142
146
|
})));
|
|
@@ -171,9 +175,9 @@ export default class WmSelect extends BaseDatasetComponent {
|
|
|
171
175
|
}, props.placeholder ? /*#__PURE__*/React.createElement(View, {
|
|
172
176
|
key: props.name + '_placeholder',
|
|
173
177
|
style: this.styles.placeholderText
|
|
174
|
-
}, this.renderSelectItem({}, true, false)) : null, items && items.map((item, index) => /*#__PURE__*/React.createElement(View, {
|
|
178
|
+
}, this.renderSelectItem({}, 0, true, false)) : null, items && items.map((item, index) => /*#__PURE__*/React.createElement(View, {
|
|
175
179
|
key: item.key
|
|
176
|
-
}, this.renderSelectItem(item, false, index === items.length - 1)))), this.styles, modalService));
|
|
180
|
+
}, this.renderSelectItem(item, index, false, index === items.length - 1)))), this.styles, modalService));
|
|
177
181
|
return null;
|
|
178
182
|
}) : null);
|
|
179
183
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","ScrollView","Text","View","find","isEmpty","WmSelectProps","DEFAULT_CLASS","BaseDatasetComponent","BaseDatasetState","WmIcon","ModalConsumer","WmButton","Tappable","ThemeVariables","WmSelectState","constructor","arguments","_defineProperty","WmSelect","props","updateState","isOpened","onPress","event","state","disabled","showPopover","invokeEventCallback","proxy","onPropertyChange","name","$new","$old","isNaN","displayValue","placeholder","prepareModalOptions","content","styles","modalService","o","modalOptions","modalStyle","modal","contentStyle","modalContent","isModal","centered","onClose","hide","isDefaultValue","validate","triggerValidation","setState","hideModal","focus","_this$widgetRef","widgetRef","renderSelect","createElement","style","root","isValid","invalid","backgroundColor","disabledText","ref","view","onLayout","text","color","placeholderText","bind","arrowButton","iconclass","onTap","isSelected","item","val","datafield","dataObject","datavalue","onItemSelect","isPlaceholder","onChange","renderSelectItem","isLast","selectItem","lastSelectItem","selectItemText","displayexp","displayfield","theme","mergeStyle","checkIcon","opacity","updateDefaultQueryModel","dataItems","length","selectedItem","selected","componentDidMount","onDataItemsUpdate","renderWidget","items","showModal","width","maxHeight","INSTANCE","maxModalHeight","contentContainerStyle","dropDownContent","key","map","index"],"sources":["select.component.tsx"],"sourcesContent":["import React from 'react';\nimport { ScrollView, Text, View } from 'react-native';\nimport { find, isEmpty } from 'lodash';\n\nimport WmSelectProps from './select.props';\nimport { DEFAULT_CLASS, WmSelectStyles } from './select.styles';\nimport {\n BaseDatasetComponent,\n BaseDatasetState\n} from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\nexport class WmSelectState extends BaseDatasetState<WmSelectProps> {\n modalOptions = {} as ModalOptions;\n isOpened: boolean = false;\n selectedValue: any = '';\n}\n\nexport default class WmSelect extends BaseDatasetComponent<WmSelectProps, WmSelectState, WmSelectStyles> {\n constructor(props: WmSelectProps) {\n super(props, DEFAULT_CLASS, new WmSelectProps(), new WmSelectState());\n }\n view: View = null as any;\n public widgetRef: Text | null = null;\n private isDefaultValue: boolean = true;\n\n onPress(event: any) {\n if (this.state.props.disabled) {\n return;\n }\n if (!this.state.isOpened) {\n this.showPopover();\n }\n this.invokeEventCallback('onFocus', [event, this.proxy]);\n }\n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case 'datavalue':\n if (isNaN($new) && isEmpty($new)) {\n this.updateState({\n props: {\n displayValue: this.state.props.placeholder || ''\n }\n } as WmSelectState);\n }\n }\n }\n\n prepareModalOptions(content: React.ReactNode, styles: WmSelectStyles, modalService: ModalService) {\n const o = this.state.modalOptions;\n o.modalStyle = styles.modal;\n o.contentStyle = {...styles.modalContent};\n o.content = content;\n o.isModal = true;\n o.centered = true;\n o.onClose = () => {\n this.hide = () => {};\n if (this.isDefaultValue && this.state.props.displayValue === '') {\n this.validate(this.state.props.displayValue);\n this.props.triggerValidation && this.props.triggerValidation();\n }\n this.invokeEventCallback('onBlur', [{}, this.proxy]);\n this.setState({ isOpened: false, modalOptions: {} as ModalOptions } as WmSelectState);\n };\n this.hide = () => modalService.hideModal(this.state.modalOptions);\n return o;\n }\n\n public showPopover = () => {\n this.updateState({ isOpened: true } as WmSelectState);\n };\n\n public hide = () => {};\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n renderSelect() {\n const props = this.state.props;\n return (\n /*\n * onLayout function is required.\n * https://github.com/naoufal/react-native-accordion/pull/19/files\n */\n <View\n style={[this.styles.root, this.state.isValid ? {} : this.styles.invalid, { backgroundColor: props.disabled ? this.styles.disabledText.backgroundColor : this.styles.root.backgroundColor}]}\n ref={(ref) => {\n this.view = ref as View;\n }}\n onLayout={() => {}}>\n <Text\n style={[this.styles.text,\n this.state.props.displayValue ? {} : {color: this.styles.placeholderText.color}]}\n ref={(ref) => {\n this.widgetRef = ref;\n }}\n onPress={this.onPress.bind(this)}>\n {this.state.props.displayValue || props.placeholder || ' '}\n </Text>\n <WmButton\n styles={this.styles.arrowButton}\n iconclass={'wi wi-keyboard-arrow-down'}\n onTap={this.onPress.bind(this)}\n />\n </View>\n );\n }\n\n isSelected(item: any) {\n const val = this.state.props.datafield === 'All Fields' ? item.dataObject : item.datafield;\n return this.state.props.datavalue === val;\n }\n\n onItemSelect(item: any, isPlaceholder?: boolean) {\n this.isDefaultValue = false;\n this.onChange(isPlaceholder ? '' : this.state.props.datafield === 'All Fields' ? item.dataObject : item.datafield);\n this.hide();\n }\n\n renderSelectItem(item: any, isPlaceholder: boolean, isLast: boolean) {\n return (\n <Tappable onTap={this.onItemSelect.bind(this, item, isPlaceholder)}>\n <View style={[this.styles.selectItem, isLast ? this.styles.lastSelectItem : null ]}>\n <Text style={[this.styles.selectItemText, {color: isPlaceholder ? this.styles.placeholderText.color : this.styles.selectItemText.color}]}>\n {isPlaceholder ? this.state.props.placeholder : (item.displayexp || item.displayfield)}\n </Text>\n <WmIcon iconclass='wi wi-check' styles={this.theme.mergeStyle(this.styles.checkIcon, {\n root: {\n opacity: !isPlaceholder && this.isSelected(item) ? 1 : 0\n }\n })}></WmIcon>\n </View>\n </Tappable>\n );\n }\n\n updateDefaultQueryModel() {\n if (this.state.dataItems && this.state.dataItems.length && this.isDefaultValue) {\n const selectedItem = find(this.state.dataItems, (item) => item.selected);\n selectedItem && this.updateState({\n props: {\n displayValue: selectedItem.displayexp || selectedItem.displayfield || ''\n }\n } as WmSelectState);\n }\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.updateDefaultQueryModel();\n }\n\n onDataItemsUpdate() {\n super.onDataItemsUpdate();\n this.updateDefaultQueryModel();\n }\n\n renderWidget(props: WmSelectProps) {\n return (\n <View>\n {this.renderSelect()}\n {this.state.isOpened ? (\n <ModalConsumer>\n {(modalService: ModalService) => {\n const items = this.state.dataItems;\n modalService.showModal(\n this.prepareModalOptions(\n <ScrollView style={{width: '100%', maxHeight: ThemeVariables.INSTANCE.maxModalHeight}} contentContainerStyle={this.styles.dropDownContent}>\n {props.placeholder ?\n <View key={props.name + '_placeholder'} style={this.styles.placeholderText}>\n {this.renderSelectItem({}, true, false)}\n </View>\n : null}\n {items && items.map((item: any, index: number) => (\n <View key={item.key}>\n {this.renderSelectItem(item, false, index === items.length - 1)}\n </View>\n ))}\n </ScrollView>,\n this.styles,\n modalService\n )\n );\n return null;\n }}\n </ModalConsumer>\n ) : null}\n </View>\n );\n }\n}\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACrD,SAASC,IAAI,EAAEC,OAAO,QAAQ,QAAQ;AAEtC,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,SACEC,oBAAoB,EACpBC,gBAAgB,QACX,8EAA8E;AACrF,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,aAAa,QAAoC,8CAA8C;AACxG,OAAOC,QAAQ,MAAM,oEAAoE;AACzF,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,OAAOC,cAAc,MAAM,kDAAkD;AAE7E,OAAO,MAAMC,aAAa,SAASN,gBAAgB,CAAgB;EAAAO,YAAA;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AAA,CAACzD,IAAI,QACF,IAAI,CAACwD,YAAY,CAAC,CAAC,EACnB,IAAI,CAAClC,KAAK,CAACH,QAAQ,gBAClBtB,KAAA,CAAA4D,aAAA,CAACjD,aAAa,QACV6B,YAA0B,IAAK;MAC/B,MAAMiE,KAAK,GAAG,IAAI,CAAChF,KAAK,CAACyE,SAAS;MAClC1D,YAAY,CAACkE,SAAS,CACpB,IAAI,CAACrE,mBAAmB,eACtBrC,KAAA,CAAA4D,aAAA,CAAC3D,UAAU;QAAC4D,KAAK,EAAE;UAAC8C,KAAK,EAAE,MAAM;UAAEC,SAAS,EAAE9F,cAAc,CAAC+F,QAAQ,CAACC;QAAc,CAAE;QAACC,qBAAqB,EAAE,IAAI,CAACxE,MAAM,CAACyE;MAAgB,GACvI5F,KAAK,CAACgB,WAAW,gBAChBpC,KAAA,CAAA4D,aAAA,CAACzD,IAAI;QAAC8G,GAAG,EAAE7F,KAAK,CAACW,IAAI,GAAG,cAAe;QAAC8B,KAAK,EAAE,IAAI,CAACtB,MAAM,CAACiC;MAAgB,GACxE,IAAI,CAACc,gBAAgB,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAClC,CAAC,GACL,IAAI,EACLmB,KAAK,IAAIA,KAAK,CAACS,GAAG,CAAC,CAACpC,IAAS,EAAEqC,KAAa,kBAC3CnH,KAAA,CAAA4D,aAAA,CAACzD,IAAI;QAAC8G,GAAG,EAAEnC,IAAI,CAACmC;MAAI,GACjB,IAAI,CAAC3B,gBAAgB,CAACR,IAAI,EAAE,KAAK,EAAEqC,KAAK,KAAKV,KAAK,CAACN,MAAM,GAAG,CAAC,CAC1D,CACP,CACO,CAAC,EACb,IAAI,CAAC5D,MAAM,EACXC,YACF,CACF,CAAC;MACD,OAAO,IAAI;IACb,CACa,CAAC,GACd,IACA,CAAC;EAEX;AACF"}
|
|
1
|
+
{"version":3,"names":["React","ScrollView","Text","View","find","isEmpty","WmSelectProps","DEFAULT_CLASS","BaseDatasetComponent","BaseDatasetState","WmIcon","ModalConsumer","WmButton","Tappable","ThemeVariables","WmSelectState","constructor","arguments","_defineProperty","WmSelect","props","updateState","isOpened","onPress","event","state","disabled","showPopover","invokeEventCallback","proxy","onPropertyChange","name","$new","$old","isNaN","displayValue","placeholder","prepareModalOptions","content","styles","modalService","o","modalOptions","modalStyle","modal","contentStyle","modalContent","isModal","centered","onClose","hide","isDefaultValue","validate","triggerValidation","setState","hideModal","focus","_this$widgetRef","widgetRef","renderSelect","createElement","style","root","isValid","invalid","backgroundColor","disabledText","ref","view","onLayout","_extends","text","color","placeholderText","getTestPropsForInput","bind","arrowButton","iconclass","onTap","isSelected","item","val","datafield","dataObject","datavalue","onItemSelect","isPlaceholder","onChange","renderSelectItem","index","isLast","selected","getTestPropsForAction","selectItem","lastSelectItem","selectedItem","getTestPropsForLabel","selectItemText","selectedItemText","displayexp","displayfield","id","getTestId","theme","mergeStyle","checkIcon","opacity","updateDefaultQueryModel","dataItems","length","componentDidMount","onDataItemsUpdate","renderWidget","items","showModal","width","maxHeight","INSTANCE","maxModalHeight","contentContainerStyle","dropDownContent","key","map"],"sources":["select.component.tsx"],"sourcesContent":["import React from 'react';\nimport { ScrollView, Text, View } from 'react-native';\nimport { find, isEmpty } from 'lodash';\n\nimport WmSelectProps from './select.props';\nimport { DEFAULT_CLASS, WmSelectStyles } from './select.styles';\nimport {\n BaseDatasetComponent,\n BaseDatasetState\n} from '@wavemaker/app-rn-runtime/components/input/basedataset/basedataset.component';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { ModalConsumer, ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\nexport class WmSelectState extends BaseDatasetState<WmSelectProps> {\n modalOptions = {} as ModalOptions;\n isOpened: boolean = false;\n selectedValue: any = '';\n}\n\nexport default class WmSelect extends BaseDatasetComponent<WmSelectProps, WmSelectState, WmSelectStyles> {\n constructor(props: WmSelectProps) {\n super(props, DEFAULT_CLASS, new WmSelectProps(), new WmSelectState());\n }\n view: View = null as any;\n public widgetRef: Text | null = null;\n private isDefaultValue: boolean = true;\n\n onPress(event: any) {\n if (this.state.props.disabled) {\n return;\n }\n if (!this.state.isOpened) {\n this.showPopover();\n }\n this.invokeEventCallback('onFocus', [event, this.proxy]);\n }\n\n onPropertyChange(name: string, $new: any, $old: any): void {\n super.onPropertyChange(name, $new, $old);\n switch(name) {\n case 'datavalue':\n if (isNaN($new) && isEmpty($new)) {\n this.updateState({\n props: {\n displayValue: this.state.props.placeholder || ''\n }\n } as WmSelectState);\n }\n }\n }\n\n prepareModalOptions(content: React.ReactNode, styles: WmSelectStyles, modalService: ModalService) {\n const o = this.state.modalOptions;\n o.modalStyle = styles.modal;\n o.contentStyle = {...styles.modalContent};\n o.content = content;\n o.isModal = true;\n o.centered = true;\n o.onClose = () => {\n this.hide = () => {};\n if (this.isDefaultValue && this.state.props.displayValue === '') {\n this.validate(this.state.props.displayValue);\n this.props.triggerValidation && this.props.triggerValidation();\n }\n this.invokeEventCallback('onBlur', [{}, this.proxy]);\n this.setState({ isOpened: false, modalOptions: {} as ModalOptions } as WmSelectState);\n };\n this.hide = () => modalService.hideModal(this.state.modalOptions);\n return o;\n }\n\n public showPopover = () => {\n this.updateState({ isOpened: true } as WmSelectState);\n };\n\n public hide = () => {};\n\n focus() {\n this?.widgetRef?.focus();\n }\n\n renderSelect() {\n const props = this.state.props;\n return (\n /*\n * onLayout function is required.\n * https://github.com/naoufal/react-native-accordion/pull/19/files\n */\n <View\n style={[this.styles.root, this.state.isValid ? {} : this.styles.invalid, { backgroundColor: props.disabled ? this.styles.disabledText.backgroundColor : this.styles.root.backgroundColor}]}\n ref={(ref) => {\n this.view = ref as View;\n }}\n onLayout={() => {}}>\n <Text\n style={[this.styles.text,\n this.state.props.displayValue ? {} : {color: this.styles.placeholderText.color}]}\n ref={(ref) => {\n this.widgetRef = ref;\n }}\n {...this.getTestPropsForInput()}\n onPress={this.onPress.bind(this)}>\n {this.state.props.displayValue || props.placeholder || ' '}\n </Text>\n <WmButton\n styles={this.styles.arrowButton}\n iconclass={'wi wi-keyboard-arrow-down'}\n onTap={this.onPress.bind(this)}\n />\n </View>\n );\n }\n\n isSelected(item: any) {\n const val = this.state.props.datafield === 'All Fields' ? item.dataObject : item.datafield;\n return this.state.props.datavalue === val;\n }\n\n onItemSelect(item: any, isPlaceholder?: boolean) {\n this.isDefaultValue = false;\n this.onChange(isPlaceholder ? '' : this.state.props.datafield === 'All Fields' ? item.dataObject : item.datafield);\n this.hide();\n }\n\n renderSelectItem(item: any, index: number, isPlaceholder: boolean, isLast: boolean) {\n let selected = this.isSelected(item);\n return (\n <Tappable {...this.getTestPropsForAction(index + '')} onTap={this.onItemSelect.bind(this, item, isPlaceholder)}>\n <View style={[this.styles.selectItem, isLast ? this.styles.lastSelectItem : null, selected ? this.styles.selectedItem : null ]}>\n <Text {...this.getTestPropsForLabel(index + '')} style={[this.styles.selectItemText, {color: isPlaceholder ? this.styles.placeholderText.color : selected ? this.styles.selectedItemText.color : this.styles.selectItemText.color}]}>\n {isPlaceholder ? this.state.props.placeholder : (item.displayexp || item.displayfield)}\n </Text>\n <WmIcon id={this.getTestId('checkicon' + index)} iconclass='wi wi-check' styles={this.theme.mergeStyle(this.styles.checkIcon, {\n root: {\n opacity: !isPlaceholder && selected ? 1 : 0\n }\n })}></WmIcon>\n </View>\n </Tappable>\n );\n }\n\n updateDefaultQueryModel() {\n if (this.state.dataItems && this.state.dataItems.length && this.isDefaultValue) {\n const selectedItem = find(this.state.dataItems, (item) => item.selected);\n selectedItem && this.updateState({\n props: {\n displayValue: selectedItem.displayexp || selectedItem.displayfield || ''\n }\n } as WmSelectState);\n }\n }\n\n componentDidMount() {\n super.componentDidMount();\n this.updateDefaultQueryModel();\n }\n\n onDataItemsUpdate() {\n super.onDataItemsUpdate();\n this.updateDefaultQueryModel();\n }\n\n renderWidget(props: WmSelectProps) {\n return (\n <View>\n {this.renderSelect()}\n {this.state.isOpened ? (\n <ModalConsumer>\n {(modalService: ModalService) => {\n const items = this.state.dataItems;\n modalService.showModal(\n this.prepareModalOptions(\n <ScrollView style={{width: '100%', maxHeight: ThemeVariables.INSTANCE.maxModalHeight}} contentContainerStyle={this.styles.dropDownContent}>\n {props.placeholder ?\n <View key={props.name + '_placeholder'} style={this.styles.placeholderText}>\n {this.renderSelectItem({}, 0, true, false)}\n </View>\n : null}\n {items && items.map((item: any, index: number) => (\n <View key={item.key}>\n {this.renderSelectItem(item, index, false, index === items.length - 1)}\n </View>\n ))}\n </ScrollView>,\n this.styles,\n modalService\n )\n );\n return null;\n }}\n </ModalConsumer>\n ) : null}\n </View>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACrD,SAASC,IAAI,EAAEC,OAAO,QAAQ,QAAQ;AAEtC,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,SACEC,oBAAoB,EACpBC,gBAAgB,QACX,8EAA8E;AACrF,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,aAAa,QAAoC,8CAA8C;AACxG,OAAOC,QAAQ,MAAM,oEAAoE;AACzF,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,OAAOC,cAAc,MAAM,kDAAkD;AAE7E,OAAO,MAAMC,aAAa,SAASN,gBAAgB,CAAgB;EAAAO,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,uBAClD,CAAC,CAAC;IAAAA,eAAA,mBACG,KAAK;IAAAA,eAAA,wBACJ,EAAE;EAAA;AACzB;AAEA,eAAe,MAAMC,QAAQ,SAASX,oBAAoB,CAA+C;EACvGQ,WAAWA,CAACI,KAAoB,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