@wavemaker/app-rn-runtime 12.0.0-next.45752 → 12.0.0-next.46502
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 +14 -2
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.props.js +1 -0
- app-rn-runtime/components/advanced/carousel/carousel.props.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.styles.js +15 -0
- app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js +15 -5
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.styles.js +3 -0
- app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
- app-rn-runtime/components/basic/audio/audio.component.js +9 -2
- app-rn-runtime/components/basic/audio/audio.component.js.map +1 -1
- app-rn-runtime/components/basic/audio/audio.styles.js +7 -0
- app-rn-runtime/components/basic/audio/audio.styles.js.map +1 -1
- app-rn-runtime/components/basic/button/button.component.js +15 -2
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/custom/custom.component.js +1 -1
- app-rn-runtime/components/basic/custom/custom.component.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js +10 -2
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +13 -3
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
- app-rn-runtime/components/basic/lottie/lottie.component.js +3 -1
- app-rn-runtime/components/basic/lottie/lottie.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js +10 -1
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.props.js +3 -0
- app-rn-runtime/components/basic/search/search.props.js.map +1 -1
- app-rn-runtime/components/basic/search/search.styles.js +5 -0
- app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.component.js +6 -3
- app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.props.js +9 -1
- app-rn-runtime/components/basic/skeleton/skeleton.props.js.map +1 -1
- app-rn-runtime/components/basic/video/video.component.js +6 -0
- app-rn-runtime/components/basic/video/video.component.js.map +1 -1
- app-rn-runtime/components/basic/video/video.styles.js +7 -1
- app-rn-runtime/components/basic/video/video.styles.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.component.js +2 -1
- app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.styles.js +7 -1
- app-rn-runtime/components/chart/area-chart/area-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js +7 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/basechart.component.js +23 -0
- app-rn-runtime/components/chart/basechart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.props.js +2 -2
- app-rn-runtime/components/chart/basechart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js +7 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/column-chart/column-chart.styles.js +7 -1
- app-rn-runtime/components/chart/column-chart/column-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js +7 -1
- app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.props.js +2 -0
- app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.styles.js +7 -1
- app-rn-runtime/components/chart/line-chart/line-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +2 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js +7 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.component.js +58 -11
- 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 +4 -0
- app-rn-runtime/components/container/accordion/accordion.styles.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +11 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
- app-rn-runtime/components/container/container.component.js +44 -3
- 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/container.styles.js +7 -0
- app-rn-runtime/components/container/container.styles.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +5 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js +6 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +28 -2
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.props.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js +4 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js +31 -5
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.props.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.styles.js +4 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.styles.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.component.js +43 -4
- app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.styles.js +3 -0
- app-rn-runtime/components/container/panel/panel.styles.js.map +1 -1
- app-rn-runtime/components/container/partial-host.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +2 -2
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +11 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js +1 -0
- app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.component.js +41 -6
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js +4 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.component.js +28 -2
- app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.props.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.styles.js +6 -1
- app-rn-runtime/components/container/tile/tile.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +39 -6
- app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.props.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.styles.js +3 -0
- app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +8 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js +6 -2
- app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.styles.js +4 -1
- app-rn-runtime/components/data/card/card-content/card-content.styles.js.map +1 -1
- app-rn-runtime/components/data/card/card.component.js +18 -0
- app-rn-runtime/components/data/card/card.component.js.map +1 -1
- app-rn-runtime/components/data/card/card.styles.js +3 -0
- app-rn-runtime/components/data/card/card.styles.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js +2 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
- app-rn-runtime/components/data/form/form.component.js +1 -1
- app-rn-runtime/components/data/form/form.component.js.map +1 -1
- app-rn-runtime/components/data/form/form.props.js +1 -0
- app-rn-runtime/components/data/form/form.props.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js +15 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.props.js +1 -0
- app-rn-runtime/components/data/list/list-template/list-template.props.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.styles.js +11 -1
- app-rn-runtime/components/data/list/list-template/list-template.styles.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +32 -24
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.props.js +1 -0
- app-rn-runtime/components/data/list/list.props.js.map +1 -1
- app-rn-runtime/components/data/list/list.styles.js +9 -0
- app-rn-runtime/components/data/list/list.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js +46 -10
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js +19 -6
- app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
- app-rn-runtime/components/input/calendar/calendar.component.js +25 -0
- app-rn-runtime/components/input/calendar/calendar.component.js.map +1 -1
- app-rn-runtime/components/input/calendar/calendar.styles.js +19 -0
- app-rn-runtime/components/input/calendar/calendar.styles.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +23 -3
- app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.styles.js +19 -2
- app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js +21 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js +1 -0
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +1 -0
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.component.js +16 -2
- app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.styles.js +8 -0
- app-rn-runtime/components/input/chips/chips.styles.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.component.js +14 -4
- app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.styles.js +43 -1
- app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +26 -5
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.props.js +6 -0
- app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +13 -0
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +7 -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 +3 -0
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js +7 -4
- app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.props.js +3 -0
- app-rn-runtime/components/input/epoch/wheelpickermodal/time/time-picker-modal.props.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +17 -3
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/number/number.styles.js +24 -1
- app-rn-runtime/components/input/number/number.styles.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +33 -8
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.props.js +2 -0
- app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.styles.js +7 -0
- app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
- app-rn-runtime/components/input/select/select.component.js +11 -3
- app-rn-runtime/components/input/select/select.component.js.map +1 -1
- app-rn-runtime/components/input/select/select.styles.js +24 -0
- app-rn-runtime/components/input/select/select.styles.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.component.js +13 -3
- app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.styles.js +15 -0
- app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +26 -2
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/text/text.props.js +3 -0
- app-rn-runtime/components/input/text/text.props.js.map +1 -1
- app-rn-runtime/components/input/text/text.styles.js +3 -0
- app-rn-runtime/components/input/text/text.styles.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +24 -1
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.props.js +2 -0
- app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.styles.js +3 -0
- app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +6 -0
- app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.props.js +2 -0
- app-rn-runtime/components/input/toggle/toggle.props.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.styles.js +7 -0
- app-rn-runtime/components/input/toggle/toggle.styles.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
- app-rn-runtime/components/page/content/content.component.js.map +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js +4 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.component.js +70 -14
- app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.props.js +2 -2
- app-rn-runtime/components/page/page-content/page-content.props.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.styles.js +6 -1
- app-rn-runtime/components/page/page-content/page-content.styles.js.map +1 -1
- app-rn-runtime/components/page/page.component.js.map +1 -1
- app-rn-runtime/components/page/page.props.js.map +1 -1
- app-rn-runtime/components/page/page.styles.js +7 -1
- app-rn-runtime/components/page/page.styles.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.component.js +27 -1
- app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.props.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.styles.js +6 -1
- app-rn-runtime/components/page/partial/partial.styles.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js +27 -1
- app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.props.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.styles.js +6 -1
- app-rn-runtime/components/prefab/prefab-container.styles.js.map +1 -1
- app-rn-runtime/core/AppConfig.js.map +1 -1
- app-rn-runtime/core/base.component.js +33 -6
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/components/textinput.component.js +9 -7
- app-rn-runtime/core/components/textinput.component.js.map +1 -1
- app-rn-runtime/core/props.provider.js +0 -1
- app-rn-runtime/core/props.provider.js.map +1 -1
- app-rn-runtime/core/storage.service.js +15 -0
- app-rn-runtime/core/storage.service.js.map +1 -1
- app-rn-runtime/core/tappable.component.js +10 -4
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/core/utils.js +5 -0
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/core/wm-component-tree.js +58 -0
- app-rn-runtime/core/wm-component-tree.js.map +1 -0
- app-rn-runtime/package.json +13 -6
- app-rn-runtime/runtime/App.js +23 -9
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/App.navigator.js +1 -0
- app-rn-runtime/runtime/App.navigator.js.map +1 -1
- app-rn-runtime/runtime/base-fragment.component.js +46 -13
- app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
- app-rn-runtime/runtime/base-page.component.js +38 -2
- app-rn-runtime/runtime/base-page.component.js.map +1 -1
- app-rn-runtime/runtime/base-partial.component.js +3 -0
- 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/drawer.navigator.js +19 -10
- app-rn-runtime/runtime/navigator/drawer.navigator.js.map +1 -1
- app-rn-runtime/runtime/services/app-modal.service.js +4 -4
- app-rn-runtime/runtime/services/app-modal.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-security.service.js +17 -1
- app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
- app-rn-runtime/styles/theme.js +10 -0
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/styles/theme.variables.js +2 -1
- app-rn-runtime/styles/theme.variables.js.map +1 -1
- app-rn-runtime/variables/http.service.js +5 -1
- app-rn-runtime/variables/http.service.js.map +1 -1
- app-rn-runtime/variables/live-variable.js +14 -0
- app-rn-runtime/variables/live-variable.js.map +1 -1
@@ -22,12 +22,35 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
22
22
|
invalid: {
|
23
23
|
borderBottomColor: themeVariables.inputInvalidBorderColor
|
24
24
|
},
|
25
|
+
focused: {
|
26
|
+
borderColor: themeVariables.inputFocusBorderColor
|
27
|
+
},
|
25
28
|
placeholderText: {
|
26
29
|
color: themeVariables.inputPlaceholderColor
|
27
30
|
},
|
28
31
|
floatingLabel: {},
|
29
32
|
activeFloatingLabel: {},
|
30
|
-
skeleton: {
|
33
|
+
skeleton: {
|
34
|
+
root: {
|
35
|
+
borderRadius: 6,
|
36
|
+
paddingLeft: 16,
|
37
|
+
paddingRight: 16,
|
38
|
+
minHeight: 42,
|
39
|
+
paddingTop: 8,
|
40
|
+
paddingBottom: 8,
|
41
|
+
width: '100%',
|
42
|
+
height: 40
|
43
|
+
}
|
44
|
+
},
|
45
|
+
skeletonLabel: {
|
46
|
+
root: {
|
47
|
+
bottom: 12,
|
48
|
+
left: 16,
|
49
|
+
width: 80,
|
50
|
+
height: 16,
|
51
|
+
borderRadius: 4
|
52
|
+
}
|
53
|
+
}
|
31
54
|
});
|
32
55
|
addStyle(DEFAULT_CLASS, '', defaultStyles);
|
33
56
|
addStyle(DEFAULT_CLASS + '-disabled', '', {
|
@@ -1 +1 @@
|
|
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","
|
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","focused","inputFocusBorderColor","placeholderText","color","inputPlaceholderColor","floatingLabel","activeFloatingLabel","skeleton","width","height","skeletonLabel","bottom","left","inputDisabledBgColor","position","top","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 focused: AllStyle;\n placeholderText: AllStyle;\n floatingLabel: AllStyle;\n activeFloatingLabel: AllStyle;\n skeleton: WmSkeletonStyles;\n skeletonLabel: 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 focused : {\n borderColor: themeVariables.inputFocusBorderColor,\n },\n placeholderText: {\n color: themeVariables.inputPlaceholderColor\n },\n floatingLabel: {},\n activeFloatingLabel: {},\n skeleton: {\n root:{\n borderRadius: 6,\n paddingLeft: 16,\n paddingRight: 16,\n minHeight: 42,\n paddingTop: 8,\n paddingBottom: 8,\n width: '100%',\n height: 40,\n },\n } as any as WmSkeletonStyles,\n skeletonLabel: {\n root: {\n bottom: 12,\n left: 16,\n width:80,\n height:16,\n borderRadius:4\n }\n } as any 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;AAaxF,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,C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mBAAmB,EAAE;MACnBH,KAAK,EAAEzB,cAAc,CAACuC;IACxB;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
@@ -11,6 +11,8 @@ 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';
|
14
16
|
export class WmRadiosetState extends BaseDatasetState {
|
15
17
|
constructor(...args) {
|
16
18
|
super(...args);
|
@@ -45,10 +47,11 @@ export default class WmRadioset extends BaseDatasetComponent {
|
|
45
47
|
renderChild(item, index, colWidth) {
|
46
48
|
const displayText = item.displayexp || item.displayfield;
|
47
49
|
const value = this.state.props.datafield === 'All Fields' ? this.getItemKey(item.datafield) : item.datafield;
|
50
|
+
const itemStyle = colWidth ? [{
|
51
|
+
width: colWidth
|
52
|
+
}, this.styles.item] : [this.styles.noscrollitem];
|
48
53
|
return /*#__PURE__*/React.createElement(TouchableOpacity, _extends({
|
49
|
-
style: [
|
50
|
-
width: colWidth
|
51
|
-
}],
|
54
|
+
style: [itemStyle, item.selected ? this.styles.selectedItem : null],
|
52
55
|
onPress: this.onPress.bind(this, item),
|
53
56
|
key: item.key
|
54
57
|
}, this.getTestPropsForAction("radio" + index)), /*#__PURE__*/React.createElement(WmIcon, {
|
@@ -57,7 +60,7 @@ export default class WmRadioset extends BaseDatasetComponent {
|
|
57
60
|
styles: item.selected ? this.styles.checkedRadio : this.styles.uncheckedRadio,
|
58
61
|
disabled: this.state.props.readonly || this.state.props.disabled
|
59
62
|
}), !isEmpty(this.state.template) && this.props.renderitempartial ? this.props.renderitempartial(item.dataObject, index, this.state.template) : /*#__PURE__*/React.createElement(Text, _extends({
|
60
|
-
style: this.styles.radioLabel
|
63
|
+
style: [this.styles.radioLabel, item.selected ? this.styles.selectedLabel : null]
|
61
64
|
}, this.getTestPropsForLabel('caption' + index)), displayText));
|
62
65
|
}
|
63
66
|
setTemplate(partialName) {
|
@@ -81,17 +84,39 @@ export default class WmRadioset extends BaseDatasetComponent {
|
|
81
84
|
const props = this.state.props;
|
82
85
|
const noOfColumns = props.itemsperrow.xs || 1;
|
83
86
|
const colWidth = Math.round(100 / noOfColumns) + '%';
|
84
|
-
return /*#__PURE__*/React.createElement(View, {
|
87
|
+
return props.radiosetscroll ? /*#__PURE__*/React.createElement(View, {
|
85
88
|
style: noOfColumns === 1 ? {} : this.styles.group
|
86
|
-
}, items && items.length ? items.map((item, index) => this.renderChild(item, index, colWidth)) : null)
|
89
|
+
}, items && items.length ? items.map((item, index) => this.renderChild(item, index, colWidth)) : null) : /*#__PURE__*/React.createElement(View, {
|
90
|
+
style: [this.styles.group]
|
91
|
+
}, items && items.length ? items.map((item, index) => this.renderChild(item, index)) : null);
|
92
|
+
}
|
93
|
+
renderSkeleton(props) {
|
94
|
+
var _ref;
|
95
|
+
const noOfColumns = props.itemsperrow.xs || 1;
|
96
|
+
const colWidth = Math.round(100 / noOfColumns) + '%';
|
97
|
+
return [...getNumberOfEmptyObjects((_ref = props.numberofskeletonitems) !== null && _ref !== void 0 ? _ref : 5)].map(_ => {
|
98
|
+
return /*#__PURE__*/React.createElement(View, {
|
99
|
+
style: [this.styles.item, {
|
100
|
+
width: colWidth
|
101
|
+
}]
|
102
|
+
}, /*#__PURE__*/React.createElement(WmIcon, {
|
103
|
+
styles: this.styles.checkedRadio
|
104
|
+
}), /*#__PURE__*/React.createElement(WmLabel, {
|
105
|
+
styles: {
|
106
|
+
skeleton: this.styles.skeleton
|
107
|
+
}
|
108
|
+
}));
|
109
|
+
});
|
87
110
|
}
|
88
111
|
renderWidget(props) {
|
89
112
|
const items = this.state.dataItems;
|
90
|
-
return /*#__PURE__*/React.createElement(ScrollView, {
|
113
|
+
return props.radiosetscroll ? /*#__PURE__*/React.createElement(ScrollView, {
|
91
114
|
style: this.styles.root
|
92
115
|
}, /*#__PURE__*/React.createElement(ScrollView, {
|
93
116
|
horizontal: true
|
94
|
-
}, props.groupby && this.renderGroupby(), !props.groupby && this.renderRadioButtons(items)))
|
117
|
+
}, props.groupby && this.renderGroupby(), !props.groupby && this.renderRadioButtons(items))) : /*#__PURE__*/React.createElement(View, {
|
118
|
+
style: [this.styles.root]
|
119
|
+
}, props.groupby && this.renderGroupby(), !props.groupby && this.renderRadioButtons(items));
|
95
120
|
}
|
96
121
|
}
|
97
122
|
//# sourceMappingURL=radioset.component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","Text","TouchableOpacity","ScrollView","WmRadiosetProps","DEFAULT_CLASS","BaseDatasetComponent","BaseDatasetState","WmIcon","find","isEqual","isEmpty","WmRadiosetState","constructor","args","_defineProperty","WmRadioset","props","onPress","item","state","disabled","readonly","invokeEventCallback","proxy","selected","selectedValue","selectedItem","dataItems","d","key","oldValue","datavalue","datafield","validate","updateState","computeDisplayValue","undefined","renderChild","index","colWidth","displayText","displayexp","displayfield","value","getItemKey","createElement","_extends","style","styles","width","bind","getTestPropsForAction","id","getTestId","iconclass","checkedRadio","uncheckedRadio","template","renderitempartial","dataObject","radioLabel","getTestPropsForLabel","setTemplate","partialName","renderGroupby","groupedData","accessibilityRole","length","map","groupObj","groupHeaderTitle","renderRadioButtons","data","items","noOfColumns","itemsperrow","xs","Math","round","group","renderWidget","root","horizontal","groupby"],"sources":["radioset.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, DimensionValue, TouchableOpacity } from 'react-native';\nimport { ScrollView } from 'react-native-gesture-handler';\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 WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmSkeleton, { createSkeleton } from '../../basic/skeleton/skeleton.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { find, forEach, isEqual } from 'lodash-es';\nimport { isEmpty } from 'lodash';\n\nexport class WmRadiosetState extends BaseDatasetState<WmRadiosetProps> {\n template: string = '';\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(item: any) {\n if (this.state.props.disabled || this.state.props.readonly) {\n return;\n }\n this.invokeEventCallback('onTap', [null, this.proxy]);\n item.selected = true;\n let selectedValue: any = \"\";\n const selectedItem = find(this.state.dataItems, d => isEqual(d.key, item.key));\n const oldValue = this.state.props.datavalue;\n selectedItem.selected = item.selected;\n selectedValue = selectedItem.selected ? selectedItem.datafield : null;\n this.validate(selectedValue);\n this.updateState({ props: { datavalue: selectedValue }} as WmRadiosetState,() => {\n this.computeDisplayValue();\n this.invokeEventCallback('onChange', [ undefined, this.proxy, selectedValue, oldValue ]);\n });\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 return (\n <TouchableOpacity style={[\n this.styles.item,\n item.selected ? this.styles.selectedItem : null,\n {width: colWidth}]} onPress={this.onPress.bind(this, item)} key={item.key} {...this.getTestPropsForAction(\"radio\"+index)}>\n <WmIcon id={this.getTestId('radiobutton' + index)} iconclass=\"wi wi-fiber-manual-record\" styles={item.selected ? this.styles.checkedRadio : this.styles.uncheckedRadio} disabled={this.state.props.readonly || this.state.props.disabled}></WmIcon>\n {!isEmpty(this.state.template) && this.props.renderitempartial ?\n this.props.renderitempartial(item.dataObject, index, this.state.template) : <Text style={this.styles.radioLabel} {...this.getTestPropsForLabel('caption'+index)}>{displayText}</Text>}\n </TouchableOpacity>)\n }\n\n setTemplate(partialName: any) {\n this.updateState({ template: partialName } as WmRadiosetState);\n }\n\n renderGroupby() {\n const groupedData = this.state.groupedData;\n return (\n <View accessibilityRole='radiogroup'>\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(\n <View style={noOfColumns === 1 ? {} : this.styles.group}>\n {items && items.length ?\n items.map((item: any, index: any) => this.renderChild(item, index, colWidth)): null}\n </View>)\n }\n\n renderWidget(props: WmRadiosetProps) {\n const items = this.state.dataItems;\n return (\n <ScrollView style={this.styles.root}>\n <ScrollView horizontal={true}>\n {props.groupby && this.renderGroupby()}\n {!props.groupby && this.renderRadioButtons(items)}\n </ScrollView>\n </ScrollView>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,IAAI,EAAkBC,gBAAgB,QAAQ,cAAc;AAC3E,SAASC,UAAU,QAAQ,8BAA8B;AAEzD,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAA0B,mBAAmB;AACnE,SACEC,oBAAoB,EACpBC,gBAAgB,QACX,8EAA8E;AACrF,OAAOC,MAAM,MAAM,gEAAgE;AAGnF,SAASC,IAAI,EAAWC,OAAO,QAAQ,WAAW;AAClD,SAASC,OAAO,QAAQ,QAAQ;AAEhC,OAAO,MAAMC,eAAe,SAASL,gBAAgB,CAAkB;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,mBAClD,EAAE;E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B;IACrE,oBACE5E,KAAA,CAAA+C,aAAA,CAAC9C,IAAI;MAACgD,KAAK,EAAE2B,WAAW,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC1B,MAAM,CAAC+B;IAAM,GACrDN,KAAK,IAAIA,KAAK,CAACN,MAAM,GACpBM,KAAK,CAACL,GAAG,CAAC,CAAClD,IAAS,EAAEoB,KAAU,KAAK,IAAI,CAACD,WAAW,CAACnB,IAAI,EAAEoB,KAAK,EAAEC,QAAQ,CAAC,CAAC,GAAE,IAC7E,CAAC;EACX;EAEAyC,YAAYA,CAAChE,KAAsB,EAAE;IACnC,MAAMyD,KAAK,GAAG,IAAI,CAACtD,KAAK,CAACQ,SAAS;IAClC,oBACE7B,KAAA,CAAA+C,aAAA,CAAC3C,UAAU;MAAC6C,KAAK,EAAE,IAAI,CAACC,MAAM,CAACiC;IAAK,gBAClCnF,KAAA,CAAA+C,aAAA,CAAC3C,UAAU;MAACgF,UAAU,EAAE;IAAK,GAC1BlE,KAAK,CAACmE,OAAO,IAAI,IAAI,CAACnB,aAAa,CAAC,CAAC,EACrC,CAAChD,KAAK,CAACmE,OAAO,IAAI,IAAI,CAACZ,kBAAkB,CAACE,KAAK,CACtC,CACF,CAAC;EAEjB;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","View","Text","TouchableOpacity","ScrollView","WmRadiosetProps","DEFAULT_CLASS","BaseDatasetComponent","BaseDatasetState","WmIcon","find","isEqual","isEmpty","WmLabel","getNumberOfEmptyObjects","WmRadiosetState","constructor","args","_defineProperty","WmRadioset","props","onPress","item","state","disabled","readonly","invokeEventCallback","proxy","selected","selectedValue","selectedItem","dataItems","d","key","oldValue","datavalue","datafield","validate","updateState","computeDisplayValue","undefined","renderChild","index","colWidth","displayText","displayexp","displayfield","value","getItemKey","itemStyle","width","styles","noscrollitem","createElement","_extends","style","bind","getTestPropsForAction","id","getTestId","iconclass","checkedRadio","uncheckedRadio","template","renderitempartial","dataObject","radioLabel","selectedLabel","getTestPropsForLabel","setTemplate","partialName","renderGroupby","groupedData","accessibilityRole","length","map","groupObj","groupHeaderTitle","renderRadioButtons","data","items","noOfColumns","itemsperrow","xs","Math","round","radiosetscroll","group","renderSkeleton","_ref","numberofskeletonitems","_","skeleton","renderWidget","root","horizontal","groupby"],"sources":["radioset.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View, Text, DimensionValue, TouchableOpacity } from 'react-native';\nimport { ScrollView } from 'react-native-gesture-handler';\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 WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport WmSkeleton, { createSkeleton } from '../../basic/skeleton/skeleton.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { find, forEach, isEqual } from 'lodash-es';\nimport { isEmpty } from 'lodash';\nimport WmLabel from '@wavemaker/app-rn-runtime/components/basic/label/label.component';\nimport { getNumberOfEmptyObjects } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport class WmRadiosetState extends BaseDatasetState<WmRadiosetProps> {\n template: string = '';\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(item: any) {\n if (this.state.props.disabled || this.state.props.readonly) {\n return;\n }\n this.invokeEventCallback('onTap', [null, this.proxy]);\n item.selected = true;\n let selectedValue: any = \"\";\n const selectedItem = find(this.state.dataItems, d => isEqual(d.key, item.key));\n const oldValue = this.state.props.datavalue;\n selectedItem.selected = item.selected;\n selectedValue = selectedItem.selected ? selectedItem.datafield : null;\n this.validate(selectedValue);\n this.updateState({ props: { datavalue: selectedValue }} as WmRadiosetState,() => {\n this.computeDisplayValue();\n this.invokeEventCallback('onChange', [ undefined, this.proxy, selectedValue, oldValue ]);\n });\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 itemStyle = colWidth ? [{ width: colWidth }, this.styles.item] \n : [this.styles.noscrollitem];\n return (\n <TouchableOpacity style={[\n itemStyle,\n item.selected ? this.styles.selectedItem : null]}\n onPress={this.onPress.bind(this, item)} key={item.key} {...this.getTestPropsForAction(\"radio\"+index)}>\n <WmIcon id={this.getTestId('radiobutton' + index)} iconclass=\"wi wi-fiber-manual-record\" styles={item.selected ? this.styles.checkedRadio : this.styles.uncheckedRadio} disabled={this.state.props.readonly || this.state.props.disabled}></WmIcon>\n {!isEmpty(this.state.template) && this.props.renderitempartial ?\n this.props.renderitempartial(item.dataObject, index, this.state.template) : <Text style={[this.styles.radioLabel, item.selected ? this.styles.selectedLabel : null]} {...this.getTestPropsForLabel('caption'+index)}>{displayText}</Text>}\n </TouchableOpacity>)\n }\n\n setTemplate(partialName: any) {\n this.updateState({ template: partialName } as WmRadiosetState);\n }\n\n renderGroupby() {\n const groupedData = this.state.groupedData;\n return (\n <View accessibilityRole='radiogroup'>\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 props.radiosetscroll ? (\n <View style={noOfColumns === 1 ? {} : this.styles.group}>\n {items && items.length ?\n items.map((item: any, index: any) => this.renderChild(item, index, colWidth)): null}\n </View>\n ) : (\n <View style={[this.styles.group]}>\n {items && items.length ?\n items.map((item: any, index: any) => this.renderChild(item, index)): null}\n </View>\n )\n }\n\n public renderSkeleton(props: WmRadiosetProps): React.ReactNode {\n const noOfColumns = props.itemsperrow.xs || 1;\n const colWidth = Math.round(100/ noOfColumns) + '%' as DimensionValue;\n\n return [...getNumberOfEmptyObjects(props.numberofskeletonitems as number ?? 5)].map(_ => {\n return <View style={[this.styles.item, {width: colWidth}]}>\n <WmIcon styles={this.styles.checkedRadio}/>\n <WmLabel styles={{ skeleton: this.styles.skeleton }}/>\n </View>\n })\n\n }\n\n renderWidget(props: WmRadiosetProps) {\n const items = this.state.dataItems;\n return props.radiosetscroll ? (\n <ScrollView style={this.styles.root}>\n <ScrollView horizontal={true}>\n {props.groupby && this.renderGroupby()}\n {!props.groupby && this.renderRadioButtons(items)}\n </ScrollView>\n </ScrollView>\n ) : (\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,EAAkBC,gBAAgB,QAAQ,cAAc;AAC3E,SAASC,UAAU,QAAQ,8BAA8B;AAEzD,OAAOC,eAAe,MAAM,kBAAkB;AAC9C,SAASC,aAAa,QAA0B,mBAAmB;AACnE,SACEC,oBAAoB,EACpBC,gBAAgB,QACX,8EAA8E;AACrF,OAAOC,MAAM,MAAM,gEAAgE;AAGnF,SAASC,IAAI,EAAWC,OAAO,QAAQ,WAAW;AAClD,SAASC,OAAO,QAAQ,QAAQ;AAChC,OAAOC,OAAO,MAAM,kEAAkE;AACtF,SAASC,uBAAuB,QAAQ,sCAAsC;AAE9E,OAAO,MAAMC,eAAe,SAASP,gBAAgB,CAAkB;EAAAQ,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,mBAClD,EAAE;EAAA;AACvB;AAEA,eAAe,MAAMC,UAAU,SAASZ,oBAAoB,CAAqD;EAE/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ty(this, "radiosetscroll", true);
|
15
16
|
_defineProperty(this, "renderitempartial", void 0);
|
17
|
+
_defineProperty(this, "numberofskeletonitems", void 0);
|
16
18
|
}
|
17
19
|
}
|
18
20
|
//# sourceMappingURL=radioset.props.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BaseDatasetProps","WmRadiosetProps","constructor","args","_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 renderitempartial?: (item: any, index: number, partialName: string)=> React.ReactNode;\n}\n"],"mappings":";;;AAAA,OAAOA,gBAAgB,MAAM,0EAA0E;AAEvG,eAAe,MAAMC,eAAe,SAASD,gBAAgB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,kBAC7C,8BAA8B;IAAAA,eAAA,sBAC9B;MACbC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE;IACP,CAAC;IAAAJ,eAAA;EAAA;
|
1
|
+
{"version":3,"names":["BaseDatasetProps","WmRadiosetProps","constructor","args","_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 radiosetscroll: boolean = true;\n renderitempartial?: (item: any, index: number, partialName: string)=> React.ReactNode;\n numberofskeletonitems?: number | string\n}\n"],"mappings":";;;AAAA,OAAOA,gBAAgB,MAAM,0EAA0E;AAEvG,eAAe,MAAMC,eAAe,SAASD,gBAAgB,CAAC;EAAAE,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,kBAC7C,8BAA8B;IAAAA,eAAA,sBAC9B;MACbC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE;IACP,CAAC;IAAAJ,eAAA,yBACyB,IAAI;IAAAA,eAAA;IAAAA,eAAA;EAAA;AAG/B","ignoreList":[]}
|
@@ -25,7 +25,14 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
25
25
|
marginRight: -20,
|
26
26
|
marginTop: 8
|
27
27
|
},
|
28
|
+
noscrollitem: {
|
29
|
+
flexDirection: 'row',
|
30
|
+
alignContent: 'center',
|
31
|
+
marginTop: 8,
|
32
|
+
marginLeft: 16
|
33
|
+
},
|
28
34
|
selectedItem: {},
|
35
|
+
selectedLabel: {},
|
29
36
|
radioLabel: {
|
30
37
|
alignSelf: 'center',
|
31
38
|
fontFamily: themeVariables.baseFont,
|
@@ -1 +1 @@
|
|
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","marginRight","marginTop","selectedItem","radioLabel","alignSelf","labelDefaultColor","
|
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","marginRight","marginTop","noscrollitem","marginLeft","selectedItem","selectedLabel","radioLabel","alignSelf","labelDefaultColor","skeleton","width","height","borderRadius","uncheckedRadio","borderStyle","borderWidth","borderColor","checkedBorderColor","icon","opacity","checkedRadio","padding","checkedDisabledColor"],"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 '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.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 uncheckedRadio: WmIconStyles;\n checkedRadio: WmIconStyles;\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 marginRight: -20,\n marginTop: 8\n } as AllStyle,\n noscrollitem:{\n flexDirection: 'row',\n alignContent: 'center',\n marginTop: 8, \n marginLeft: 16 \n } as AllStyle,\n selectedItem: {} as AllStyle,\n selectedLabel: {} as AllStyle,\n radioLabel: {\n alignSelf: 'center',\n fontFamily: themeVariables.baseFont,\n fontSize: 16,\n color: themeVariables.labelDefaultColor,\n marginLeft: 8\n } as AllStyle,\n skeleton: {\n root: {\n width: '100%',\n height: 16,\n borderRadius: 4,\n }\n } as any as WmSkeletonStyles,\n uncheckedRadio: {\n root: {\n width: 20,\n height: 20,\n borderRadius: 10,\n borderStyle: \"solid\",\n borderWidth: 2,\n borderColor: themeVariables.checkedBorderColor,\n },\n text: {},\n icon: {\n opacity: 0,\n }\n } as WmIconStyles,\n checkedRadio : {\n root: {\n width: 20,\n height: 20,\n borderRadius: 10,\n borderStyle: \"solid\",\n borderWidth: 2,\n borderColor: themeVariables.checkedBorderColor,\n },\n text: {\n fontSize: 16,\n },\n icon : {\n color: themeVariables.checkedColor,\n padding: 0,\n }\n } as WmIconStyles\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;AAexF,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,QAAQ;MACtBC,WAAW,EAAE,CAAC,EAAE;MAChBC,SAAS,EAAE;IACb,CAAa;IACbC,YAAY,EAAC;MACXf,aAAa,EAAE,KAAK;MACpBY,YAAY,EAAE,QAAQ;MACtBE,SAAS,EAAE,CAAC;MACZE,UAAU,EAAE;IACd,CA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EAAE,EAAE,EAAEI,aAAa,CAAC;AAC5C,CAAC,CAAC","ignoreList":[]}
|
@@ -16,6 +16,7 @@ import { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';
|
|
16
16
|
import ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';
|
17
17
|
import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
|
18
18
|
import { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';
|
19
|
+
import { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';
|
19
20
|
export class WmSelectState extends BaseDatasetState {
|
20
21
|
constructor(...args) {
|
21
22
|
super(...args);
|
@@ -89,6 +90,11 @@ export default class WmSelect extends BaseDatasetComponent {
|
|
89
90
|
var _this$widgetRef;
|
90
91
|
this === null || this === void 0 || (_this$widgetRef = this.widgetRef) === null || _this$widgetRef === void 0 || _this$widgetRef.focus();
|
91
92
|
}
|
93
|
+
renderSkeletonForText() {
|
94
|
+
return createSkeleton(this.theme, {}, {
|
95
|
+
...this.styles.textSkeleton.root
|
96
|
+
});
|
97
|
+
}
|
92
98
|
renderSelect() {
|
93
99
|
const props = this.state.props;
|
94
100
|
const select = this.styles.root;
|
@@ -101,7 +107,9 @@ export default class WmSelect extends BaseDatasetComponent {
|
|
101
107
|
React.createElement(View, {
|
102
108
|
style: [this.styles.root, this.state.isValid ? {} : this.styles.invalid, {
|
103
109
|
backgroundColor: props.disabled ? this.styles.disabledText.backgroundColor : this.styles.root.backgroundColor
|
104
|
-
}
|
110
|
+
}, this._showSkeleton ? {
|
111
|
+
justifyContent: 'space-between'
|
112
|
+
} : {}],
|
105
113
|
ref: ref => {
|
106
114
|
this.view = ref;
|
107
115
|
},
|
@@ -115,7 +123,7 @@ export default class WmSelect extends BaseDatasetComponent {
|
|
115
123
|
style: {
|
116
124
|
borderRadius: this.styles.root.borderRadius
|
117
125
|
}
|
118
|
-
}) : null, /*#__PURE__*/React.createElement(Text, _extends({
|
126
|
+
}) : null, this._showSkeleton && (this.state.props.displayValue || props.placeholder) ? this.renderSkeletonForText() : /*#__PURE__*/React.createElement(Text, _extends({
|
119
127
|
style: [this.styles.text, this.state.props.displayValue ? {} : {
|
120
128
|
color: this.styles.placeholderText.color
|
121
129
|
}],
|
@@ -125,7 +133,7 @@ export default class WmSelect extends BaseDatasetComponent {
|
|
125
133
|
}, this.getTestPropsForInput(), getAccessibilityProps(AccessibilityWidgetType.SELECT, props), {
|
126
134
|
onPress: this.onPress.bind(this)
|
127
135
|
}), this.state.props.displayValue || props.placeholder || ' '), /*#__PURE__*/React.createElement(WmButton, {
|
128
|
-
styles: this.styles.arrowButton,
|
136
|
+
styles: this._showSkeleton ? this.styles.arrowButtonSkeleton.root : this.styles.arrowButton,
|
129
137
|
iconclass: 'wi wi-keyboard-arrow-down',
|
130
138
|
onTap: this.onPress.bind(this),
|
131
139
|
hint: props === null || props === void 0 ? void 0 : props.hint
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Text","View","ScrollView","find","isEmpty","WmSelectProps","DEFAULT_CLASS","BaseDatasetComponent","BaseDatasetState","WmIcon","ModalConsumer","WmButton","Tappable","ThemeVariables","AccessibilityWidgetType","getAccessibilityProps","BackgroundComponent","WmSelectState","constructor","args","_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","setTimeout","triggerValidation","setState","hideModal","focus","_this$widgetRef","widgetRef","renderSelect","select","root","createElement","style","isValid","invalid","backgroundColor","disabledText","ref","view","onLayout","backgroundImage","image","position","backgroundPosition","size","backgroundSize","repeat","backgroundRepeat","resizeMode","backgroundResizeMode","borderRadius","_extends","text","color","placeholderText","getTestPropsForInput","SELECT","bind","arrowButton","iconclass","onTap","hint","isSelected","item","val","datafield","dataObject","datavalue","onItemSelect","isPlaceholder","onChange","renderSelectItem","index","isLast","selected","getTestPropsForAction","accessibilityProps","expanded","selectItem","lastSelectItem","selectedItem","getTestPropsForLabel","selectItemText","selectedItemText","displayexp","displayfield","id","getTestId","theme","mergeStyle","checkIcon","opacity","updateDefaultQueryModel","dataItems","length","componentDidMount","onDataItemsUpdate","renderWidget","_background","items","showModal","width","maxHeight","INSTANCE","maxModalHeight","contentContainerStyle","dropDownContent","key","map"],"sources":["select.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { ScrollView } from 'react-native-gesture-handler';\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';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\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 setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n }, 0);\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 const select = this.styles.root as any;\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 {select.backgroundImage ? (<BackgroundComponent\n image={select.backgroundImage}\n position={select.backgroundPosition || 'center'}\n size={select.backgroundSize || 'contain'}\n repeat={select.backgroundRepeat || 'no-repeat'}\n resizeMode={select.backgroundResizeMode}\n style={{borderRadius: this.styles.root.borderRadius}}\n ></BackgroundComponent>) : null }\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 {...getAccessibilityProps(\n AccessibilityWidgetType.SELECT,\n props\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 hint={props?.hint}\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('selectitem'+index)} onTap={this.onItemSelect.bind(this, item, isPlaceholder)} \n accessibilityProps={{...getAccessibilityProps(\n AccessibilityWidgetType.SELECT,\n {...this.props, expanded: this.state.isOpened}\n )}}>\n <View style={[this.styles.selectItem, isLast ? this.styles.lastSelectItem : null, selected ? this.styles.selectedItem : null ]}>\n <Text {...this.getTestPropsForLabel('label'+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._background}\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,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzC,SAASC,UAAU,QAAQ,8BAA8B;AACzD,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;AAC7E,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAASC,mBAAmB,QAAQ,uDA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AAK,CAACL,MAAM,GAAG,CAAC,CACjE,CACP,CACO,CAAC,EACb,IAAI,CAACvF,MAAM,EACXC,YACF,CACF,CAAC;MACD,OAAO,IAAI;IACb,CACa,CAAC,GACd,IACA,CAAC;EAEX;AACF","ignoreList":[]}
|
1
|
+
{"version":3,"names":["React","Text","View","ScrollView","find","isEmpty","WmSelectProps","DEFAULT_CLASS","BaseDatasetComponent","BaseDatasetState","WmIcon","ModalConsumer","WmButton","Tappable","ThemeVariables","AccessibilityWidgetType","getAccessibilityProps","BackgroundComponent","createSkeleton","WmSelectState","constructor","args","_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","setTimeout","triggerValidation","setState","hideModal","focus","_this$widgetRef","widgetRef","renderSkeletonForText","theme","textSkeleton","root","renderSelect","select","createElement","style","isValid","invalid","backgroundColor","disabledText","_showSkeleton","justifyContent","ref","view","onLayout","backgroundImage","image","position","backgroundPosition","size","backgroundSize","repeat","backgroundRepeat","resizeMode","backgroundResizeMode","borderRadius","_extends","text","color","placeholderText","getTestPropsForInput","SELECT","bind","arrowButtonSkeleton","arrowButton","iconclass","onTap","hint","isSelected","item","val","datafield","dataObject","datavalue","onItemSelect","isPlaceholder","onChange","renderSelectItem","index","isLast","selected","getTestPropsForAction","accessibilityProps","expanded","selectItem","lastSelectItem","selectedItem","getTestPropsForLabel","selectItemText","selectedItemText","displayexp","displayfield","id","getTestId","mergeStyle","checkIcon","opacity","updateDefaultQueryModel","dataItems","length","componentDidMount","onDataItemsUpdate","renderWidget","_background","items","showModal","width","maxHeight","INSTANCE","maxModalHeight","contentContainerStyle","dropDownContent","key","map"],"sources":["select.component.tsx"],"sourcesContent":["import React from 'react';\nimport { DimensionValue, Text, View } from 'react-native';\nimport { ScrollView } from 'react-native-gesture-handler';\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';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility'; \nimport { BackgroundComponent } from '@wavemaker/app-rn-runtime/styles/background.component';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\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 setTimeout(() => {\n this.props.triggerValidation && this.props.triggerValidation();\n }, 0);\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 private renderSkeletonForText(){\n return createSkeleton(this.theme, {} as WmSkeletonStyles, {\n ...this.styles.textSkeleton.root\n });\n }\n\n renderSelect() {\n const props = this.state.props;\n const select = this.styles.root as any;\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 this._showSkeleton ? { justifyContent: 'space-between' } : {}]}\n ref={(ref) => {\n this.view = ref as View;\n }}\n onLayout={() => {}}>\n {select.backgroundImage ? (<BackgroundComponent\n image={select.backgroundImage}\n position={select.backgroundPosition || 'center'}\n size={select.backgroundSize || 'contain'}\n repeat={select.backgroundRepeat || 'no-repeat'}\n resizeMode={select.backgroundResizeMode}\n style={{borderRadius: this.styles.root.borderRadius}}\n ></BackgroundComponent>) : null }\n {this._showSkeleton && (this.state.props.displayValue || props.placeholder)? this.renderSkeletonForText() : <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 {...getAccessibilityProps(\n AccessibilityWidgetType.SELECT,\n props\n )}\n onPress={this.onPress.bind(this)}>\n {this.state.props.displayValue || props.placeholder || ' '}\n </Text>}\n <WmButton\n styles={this._showSkeleton ? this.styles.arrowButtonSkeleton.root : this.styles.arrowButton}\n iconclass={'wi wi-keyboard-arrow-down'}\n onTap={this.onPress.bind(this)}\n hint={props?.hint}\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('selectitem'+index)} onTap={this.onItemSelect.bind(this, item, isPlaceholder)} \n accessibilityProps={{...getAccessibilityProps(\n AccessibilityWidgetType.SELECT,\n {...this.props, expanded: this.state.isOpened}\n )}}>\n <View style={[this.styles.selectItem, isLast ? this.styles.lastSelectItem : null, selected ? this.styles.selectedItem : null ]}>\n <Text {...this.getTestPropsForLabel('label'+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._background}\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,SAAyBC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACzD,SAASC,UAAU,QAAQ,8BAA8B;AACzD,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;AAC7E,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAASC,mBAAmB,QAAQ,uDAAuD;AAC3F,SAASC,cAAc,QAAQ,wEAAwE;AAGvG,OAAO,MAAMC,aAAa,SAASV,gBA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,KAAK,CAACW,IAAI,GAAG,cAAe;QAACoC,KAAK,EAAE,IAAI,CAAC5B,MAAM,CAACoD;MAAgB,GACxE,IAAI,CAACkB,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,CACrC,CAAC,GACL,IAAI,EACL2B,KAAK,IAAIA,KAAK,CAACS,GAAG,CAAC,CAAC5C,IAAS,EAAES,KAAa,kBAC3ClH,KAAA,CAAAsE,aAAA,CAACpE,IAAI;QAACkJ,GAAG,EAAE3C,IAAI,CAAC2C;MAAI,GACjB,IAAI,CAACnC,gBAAgB,CAACR,IAAI,EAAES,KAAK,EAAE,KAAK,EAAEA,KAAK,KAAK0B,KAAK,CAACL,MAAM,GAAG,CAAC,CACjE,CACP,CACO,CAAC,EACb,IAAI,CAAC5F,MAAM,EACXC,YACF,CACF,CAAC;MACD,OAAO,IAAI;IACb,CACa,CAAC,GACd,IACA,CAAC;EAEX;AACF","ignoreList":[]}
|
@@ -84,6 +84,30 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
84
84
|
justifyContent: 'center',
|
85
85
|
backgroundColor: 'transparent'
|
86
86
|
}
|
87
|
+
},
|
88
|
+
skeleton: {
|
89
|
+
root: {
|
90
|
+
minWidth: 0,
|
91
|
+
width: 120,
|
92
|
+
height: 16,
|
93
|
+
borderRadius: 4,
|
94
|
+
marginRight: 8,
|
95
|
+
padding: 0
|
96
|
+
}
|
97
|
+
},
|
98
|
+
arrowButtonSkeleton: {
|
99
|
+
root: {
|
100
|
+
width: 24,
|
101
|
+
height: 24,
|
102
|
+
borderRadius: 12
|
103
|
+
}
|
104
|
+
},
|
105
|
+
textSkeleton: {
|
106
|
+
root: {
|
107
|
+
width: 100,
|
108
|
+
height: 16,
|
109
|
+
borderRadius: 8
|
110
|
+
}
|
87
111
|
}
|
88
112
|
});
|
89
113
|
addStyle(DEFAULT_CLASS, '', defaultStyles);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","Platform","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","padding","borderWidth","borderStyle","borderColor","inputBorderColor","backgroundColor","inputBackgroundColor","borderRadius","minWidth","alignItems","invalid","borderBottomColor","inputInvalidBorderColor","text","fontSize","fontFamily","baseFont","flex","color","inputTextColor","checkIcon","primaryColor","disabledText","inputDisabledBgColor","modal","height","modalContent","position","width","selectItem","paddingHorizontal","paddingVertical","borderBottomWidth","borderBottomStyle","selecttemBorderColor","lastSelectItem","selectItemText","selectItemTextColor","selectedItem","selectedItemText","placeholderText","inputPlaceholderColor","dropDownContent","arrowButton","paddingTop","paddingBottom","paddingLeft","paddingRight","minHeight","alignSelf","justifyContent","OS","textAlign"],"sources":["select.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 { WmButtonStyles } from '@wavemaker/app-rn-runtime/components/basic/button/button.styles';\nimport { Platform } from 'react-native';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\n\nexport type WmSelectStyles = BaseStyles & {\n arrowButton: WmButtonStyles;\n modal: AllStyle;\n modalContent: AllStyle;\n checkIcon: WmIconStyles;\n selectItem: AllStyle;\n lastSelectItem: AllStyle,\n selectItemText: AllStyle;\n selectedItem: AllStyle;\n selectedItemText: AllStyle;\n dropDownContent: AllStyle;\n disabledText: AllStyle;\n placeholderText: AllStyle;\n invalid: AllStyle;\n};\n\nexport const DEFAULT_CLASS = 'app-select';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmSelectStyles = defineStyles({\n root: {\n flexDirection: 'row',\n padding: 12,\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n backgroundColor: themeVariables.inputBackgroundColor,\n borderRadius: 6,\n minWidth: 160,\n alignItems: 'center'\n },\n invalid: {\n borderBottomColor: themeVariables.inputInvalidBorderColor\n },\n text: {\n fontSize: 16,\n fontFamily: themeVariables.baseFont,\n flex: 1,\n color: themeVariables.inputTextColor\n },\n checkIcon: {\n text: {\n fontSize: 24,\n color: themeVariables.primaryColor\n }\n } as WmIconStyles,\n disabledText: {\n backgroundColor : themeVariables.inputDisabledBgColor\n },\n modal: {\n backgroundColor: 'rgba(0, 0, 0, 0.3)',\n height: '100%'\n },\n modalContent: {\n backgroundColor: themeVariables.inputBackgroundColor,\n borderRadius: 6,\n position: 'absolute',\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n width: '90%'\n },\n selectItem: {\n width: '100%',\n paddingHorizontal: 16,\n paddingVertical: 8,\n borderBottomWidth: 1,\n borderBottomStyle: 'solid',\n borderBottomColor: themeVariables.selecttemBorderColor,\n flexDirection: 'row',\n alignItems: 'center'\n },\n lastSelectItem: {\n borderBottomWidth: 0\n },\n selectItemText: {\n fontSize: 16,\n fontFamily: themeVariables.baseFont,\n color: themeVariables.selectItemTextColor,\n flex: 1\n },\n selectedItem: {},\n selectedItemText:{},\n placeholderText: {\n color: themeVariables.inputPlaceholderColor\n },\n dropDownContent: {},\n arrowButton: {\n root: {\n borderRadius: 0,\n paddingTop: 6,\n paddingBottom: 6,\n paddingLeft: 6,\n paddingRight: 0,\n minHeight: 0,\n alignItems: 'center',\n alignSelf: 'center',\n justifyContent: 'center',\n backgroundColor: 'transparent'\n }\n } as WmButtonStyles,\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', '', Platform.OS==\"web\"?{\n text:{\n textAlign:'right',\n }\n }:{\n text:{\n textAlign:'left',\n }\n });\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAkB,wCAAwC;AAC3E,SAAqBC,YAAY,QAAQ,+CAA+C;AAExF,SAASC,QAAQ,QAAQ,cAAc;
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","Platform","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","flexDirection","padding","borderWidth","borderStyle","borderColor","inputBorderColor","backgroundColor","inputBackgroundColor","borderRadius","minWidth","alignItems","invalid","borderBottomColor","inputInvalidBorderColor","text","fontSize","fontFamily","baseFont","flex","color","inputTextColor","checkIcon","primaryColor","disabledText","inputDisabledBgColor","modal","height","modalContent","position","width","selectItem","paddingHorizontal","paddingVertical","borderBottomWidth","borderBottomStyle","selecttemBorderColor","lastSelectItem","selectItemText","selectItemTextColor","selectedItem","selectedItemText","placeholderText","inputPlaceholderColor","dropDownContent","arrowButton","paddingTop","paddingBottom","paddingLeft","paddingRight","minHeight","alignSelf","justifyContent","skeleton","marginRight","arrowButtonSkeleton","textSkeleton","OS","textAlign"],"sources":["select.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 { WmButtonStyles } from '@wavemaker/app-rn-runtime/components/basic/button/button.styles';\nimport { Platform } from 'react-native';\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\nimport { WmSkeletonStyles } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.styles';\n\nexport type WmSelectStyles = BaseStyles & {\n arrowButton: WmButtonStyles;\n modal: AllStyle;\n modalContent: AllStyle;\n checkIcon: WmIconStyles;\n selectItem: AllStyle;\n lastSelectItem: AllStyle,\n selectItemText: AllStyle;\n selectedItem: AllStyle;\n selectedItemText: AllStyle;\n dropDownContent: AllStyle;\n disabledText: AllStyle;\n placeholderText: AllStyle;\n invalid: AllStyle;\n skeleton: WmSkeletonStyles;\n arrowButtonSkeleton: WmSkeletonStyles;\n textSkeleton: WmSkeletonStyles;\n};\n\nexport const DEFAULT_CLASS = 'app-select';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmSelectStyles = defineStyles({\n root: {\n flexDirection: 'row',\n padding: 12,\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n backgroundColor: themeVariables.inputBackgroundColor,\n borderRadius: 6,\n minWidth: 160,\n alignItems: 'center'\n },\n invalid: {\n borderBottomColor: themeVariables.inputInvalidBorderColor\n },\n text: {\n fontSize: 16,\n fontFamily: themeVariables.baseFont,\n flex: 1,\n color: themeVariables.inputTextColor\n },\n checkIcon: {\n text: {\n fontSize: 24,\n color: themeVariables.primaryColor\n }\n } as WmIconStyles,\n disabledText: {\n backgroundColor : themeVariables.inputDisabledBgColor\n },\n modal: {\n backgroundColor: 'rgba(0, 0, 0, 0.3)',\n height: '100%'\n },\n modalContent: {\n backgroundColor: themeVariables.inputBackgroundColor,\n borderRadius: 6,\n position: 'absolute',\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: themeVariables.inputBorderColor,\n width: '90%'\n },\n selectItem: {\n width: '100%',\n paddingHorizontal: 16,\n paddingVertical: 8,\n borderBottomWidth: 1,\n borderBottomStyle: 'solid',\n borderBottomColor: themeVariables.selecttemBorderColor,\n flexDirection: 'row',\n alignItems: 'center'\n },\n lastSelectItem: {\n borderBottomWidth: 0\n },\n selectItemText: {\n fontSize: 16,\n fontFamily: themeVariables.baseFont,\n color: themeVariables.selectItemTextColor,\n flex: 1\n },\n selectedItem: {},\n selectedItemText:{},\n placeholderText: {\n color: themeVariables.inputPlaceholderColor\n },\n dropDownContent: {},\n arrowButton: {\n root: {\n borderRadius: 0,\n paddingTop: 6,\n paddingBottom: 6,\n paddingLeft: 6,\n paddingRight: 0,\n minHeight: 0,\n alignItems: 'center',\n alignSelf: 'center',\n justifyContent: 'center',\n backgroundColor: 'transparent'\n }\n } as WmButtonStyles,\n skeleton: {\n root:{\n minWidth: 0,\n width:120,\n height: 16,\n borderRadius: 4,\n marginRight:8,\n padding:0\n }\n } as any as WmSkeletonStyles,\n arrowButtonSkeleton: {\n root: {\n width: 24,\n height: 24,\n borderRadius: 12 \n }\n } as any as WmSkeletonStyles,\n textSkeleton: {\n root: {\n width: 100,\n height: 16,\n borderRadius: 8 \n }\n } as any 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', '', Platform.OS==\"web\"?{\n text:{\n textAlign:'right',\n }\n }:{\n text:{\n textAlign:'left',\n }\n });\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAkB,wCAAwC;AAC3E,SAAqBC,YAAY,QAAQ,+CAA+C;AAExF,SAASC,QAAQ,QAAQ,cAAc;AAuBvC,OAAO,MAAMC,aAAa,GAAG,YAAY;AACzCH,UAAU,CAACI,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA6B,GAAGN,YAAY,CAAC;IACjDO,IAAI,EAAE;MACJC,aAAa,EAAE,KAAK;MACpBC,OAAO,EAAE,EAAE;MACXC,WAAW,EAAE,CAAC;MACdC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAER,cAAc,CAACS,gBAAgB;MAC5CC,eAAe,EAAEV,cAAc,CAACW,oBAAoB;MACpDC,YAAY,EAAE,CAAC;MACfC,QAAQ,EAAE,GAAG;MACbC,UAAU,EAAE;IACd,CAAC;IACDC,OAAO,EAAE;MACPC,iBAAiB,EAAEhB,cAAc,CAACiB;IACpC,CAAC;IACDC,IAAI,EAAE;MACJC,QAAQ,EAAE,EAAE;MACZC,UAAU,EAAEpB,cAAc,CAACqB,QAAQ;MACnCC,IAAI,EAAE,CAAC;MACPC,KAAK,EAAEvB,cAAc,CAACwB;IACxB,CAAC;IACDC,SAAS,EAAE;MACTP,IAAI,EAAE;QACJC,QAAQ,EAAE,EAAE;QACZI,KAAK,EAAEvB,cAAc,CAAC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AAQ;QACpBwC,SAAS,EAAE,QAAQ;QACnBC,cAAc,EAAE,QAAQ;QACxB7C,eAAe,EAAE;MACnB;IACF,CAAmB;IACnB8C,QAAQ,EAAE;MACRrD,IAAI,EAAC;QACHU,QAAQ,EAAE,CAAC;QACXoB,KAAK,EAAC,GAAG;QACTH,MAAM,EAAE,EAAE;QACVlB,YAAY,EAAE,CAAC;QACf6C,WAAW,EAAC,CAAC;QACbpD,OAAO,EAAC;MACV;IACF,CAA4B;IAC5BqD,mBAAmB,EAAE;MACnBvD,IAAI,EAAE;QACJ8B,KAAK,EAAE,EAAE;QACTH,MAAM,EAAE,EAAE;QACVlB,YAAY,EAAE;MAChB;IACF,CAA4B;IAC5B+C,YAAY,EAAE;MACZxD,IAAI,EAAE;QACJ8B,KAAK,EAAE,GAAG;QACVH,MAAM,EAAE,EAAE;QACVlB,YAAY,EAAE;MAChB;IACF;EACF,CAAC,CAAC;EAEFX,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAACH,aAAa,GAAG,WAAW,EAAE,EAAE,EAAE;IACtCK,IAAI,EAAG;MACLO,eAAe,EAAEV,cAAc,CAAC4B;IAClC;EACJ,CAAC,CAAC;EACF3B,QAAQ,CAACH,aAAa,GAAG,MAAM,EAAE,EAAE,EAAED,QAAQ,CAAC+D,EAAE,IAAE,KAAK,GAAC;IACtD1C,IAAI,EAAC;MACH2C,SAAS,EAAC;IACZ;EACF,CAAC,GAAC;IACA3C,IAAI,EAAC;MACH2C,SAAS,EAAC;IACZ;EACF,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
@@ -8,6 +8,7 @@ import WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.compone
|
|
8
8
|
import { BaseDatasetComponent, BaseDatasetState } from '../basedataset/basedataset.component';
|
9
9
|
import { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';
|
10
10
|
import { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';
|
11
|
+
import { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';
|
11
12
|
export class WmSwitchState extends BaseDatasetState {}
|
12
13
|
export default class WmSwitch extends BaseDatasetComponent {
|
13
14
|
constructor(props) {
|
@@ -68,17 +69,26 @@ export default class WmSwitch extends BaseDatasetComponent {
|
|
68
69
|
styles: this.styles.loadingIcon,
|
69
70
|
iconclass: item.icon,
|
70
71
|
caption: displayText
|
71
|
-
}) : /*#__PURE__*/React.createElement(View, null,
|
72
|
+
}) : /*#__PURE__*/React.createElement(View, null, this._showSkeleton ? createSkeleton(this.theme, {}, {
|
73
|
+
...this.styles.text,
|
74
|
+
...this.styles.textSkeleton.root
|
75
|
+
}) : /*#__PURE__*/React.createElement(Text, _extends({}, this.getTestPropsForLabel('label' + index), {
|
72
76
|
style: [isSelected ? this.styles.selectedButtonText : this.styles.text, {
|
73
77
|
color: isSelected ? this.styles.selectedButton.color : this.styles.button.color
|
74
78
|
}]
|
75
79
|
}), displayText)));
|
76
80
|
}
|
77
|
-
|
81
|
+
renderItems() {
|
78
82
|
const items = this.state.dataItems;
|
83
|
+
if (this._showSkeleton) {
|
84
|
+
return [{}, {}, {}].map((item, index) => this.renderChild(item, index));
|
85
|
+
}
|
86
|
+
return items && items.length ? items.map((item, index) => this.renderChild(item, index)) : null;
|
87
|
+
}
|
88
|
+
renderWidget(props) {
|
79
89
|
return /*#__PURE__*/React.createElement(View, {
|
80
90
|
style: this.styles.root
|
81
|
-
},
|
91
|
+
}, this.renderItems());
|
82
92
|
}
|
83
93
|
}
|
84
94
|
//# sourceMappingURL=switch.component.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Text","View","isEqual","find","WmSwitchProps","DEFAULT_CLASS","WmIcon","BaseDatasetComponent","BaseDatasetState","Tappable","AccessibilityWidgetType","getAccessibilityProps","WmSwitchState","WmSwitch","constructor","props","onChange","value","oldVal","state","datavalue","validate","datafield","selectedItem","dataItems","item","key","dataObject","updateState","isDefault","invokeEvent","invokeEventCallback","undefined","proxy","onTap","event","getItemKey","renderChild","index","btnClass","length","displayText","displayexp","displayfield","isSelected","createElement","_extends","getTestPropsForAction","accessibilityProps","SWITCH","selected","hint","disabled","bind","styles","button","selectedButton","iconclass","id","getTestId","loadingIcon","icon","caption","getTestPropsForLabel","style","selectedButtonText","
|
1
|
+
{"version":3,"names":["React","Text","View","isEqual","find","WmSwitchProps","DEFAULT_CLASS","WmIcon","BaseDatasetComponent","BaseDatasetState","Tappable","AccessibilityWidgetType","getAccessibilityProps","createSkeleton","WmSwitchState","WmSwitch","constructor","props","onChange","value","oldVal","state","datavalue","validate","datafield","selectedItem","dataItems","item","key","dataObject","updateState","isDefault","invokeEvent","invokeEventCallback","undefined","proxy","onTap","event","getItemKey","renderChild","index","btnClass","length","displayText","displayexp","displayfield","isSelected","createElement","_extends","getTestPropsForAction","accessibilityProps","SWITCH","selected","hint","disabled","bind","styles","button","selectedButton","iconclass","id","getTestId","loadingIcon","icon","caption","_showSkeleton","theme","text","textSkeleton","root","getTestPropsForLabel","style","selectedButtonText","color","renderItems","items","map","renderWidget"],"sources":["switch.component.tsx"],"sourcesContent":["import React, { useRef } from 'react';\nimport {DimensionValue, LayoutChangeEvent, Text, View} from \"react-native\";\nimport { isEqual, find } from 'lodash';\n\nimport WmSwitchProps from './switch.props';\nimport { DEFAULT_CLASS, WmSwitchStyles } from './switch.styles';\nimport WmIcon from '@wavemaker/app-rn-runtime/components/basic/icon/icon.component';\nimport { BaseDatasetComponent, BaseDatasetState } from '../basedataset/basedataset.component';\nimport { Tappable } from '@wavemaker/app-rn-runtime/core/tappable.component';\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\nimport { createSkeleton } from '@wavemaker/app-rn-runtime/components/basic/skeleton/skeleton.component';\nimport { WmSkeletonStyles } from '../../basic/skeleton/skeleton.styles';\n\nexport class WmSwitchState extends BaseDatasetState<WmSwitchProps> {}\n\nexport default class WmSwitch extends BaseDatasetComponent<WmSwitchProps, WmSwitchState, WmSwitchStyles> {\n constructor(props: WmSwitchProps) {\n super(props, DEFAULT_CLASS, new WmSwitchProps());\n }\n\n onChange(value: any) {\n if (!value) {\n return;\n }\n const oldVal = this.state.props.datavalue;\n this.validate(value);\n if (value === oldVal) {\n return;\n }\n if (this.state.props.datafield === 'All Fields') {\n const selectedItem = find(this.state.dataItems, (item) => isEqual(item.key, value));\n value = selectedItem && selectedItem.dataObject;\n }\n // @ts-ignore\n this.updateState({props: {datavalue: value}, isDefault: false},\n () => {\n if (!this.props.invokeEvent) {\n this.invokeEventCallback('onChange', [undefined, this.proxy, value, oldVal]);\n }\n });\n }\n\n onTap(event: any, item: any) {\n const value = this.state.props.datafield === 'All Fields' ? this.getItemKey(item.datafield) : item.datafield;\n this.onChange(value);\n this.invokeEventCallback('onTap', [ event, this.proxy ]);\n }\n renderChild(item: any, index: any) {\n let btnClass = 'button';\n const props = this.state.props;\n if(index === 0) {\n btnClass = 'firstButton';\n } else if (index+1 === this.state.dataItems.length) {\n btnClass = 'lastButton';\n }\n const displayText = item.displayexp || item.displayfield;\n const isSelected = this.state.props.datafield === 'All Fields' ? isEqual(props.datavalue, item.datafield) : this.state.props.datavalue === item.datafield;\n return (\n <Tappable\n {...this.getTestPropsForAction('button'+index)}\n accessibilityProps={{...getAccessibilityProps(AccessibilityWidgetType.SWITCH, {selected: isSelected, hint: props?.hint})}}\n onTap={this.state.props.disabled ? undefined : this.onTap.bind(this, null, item)}\n styles={[\n this.styles.button,\n this.styles[btnClass],\n isSelected ? this.styles.selectedButton : null]}\n key={item.key}>\n {this.state.props.iconclass ?\n (<WmIcon\n id={this.getTestId('icon' + index)}\n styles={this.styles.loadingIcon}\n iconclass={item.icon}\n caption={displayText}></WmIcon>)\n : (<View>\n {\n this._showSkeleton ? createSkeleton(this.theme, {} as WmSkeletonStyles, {\n ...this.styles.text,\n ...this.styles.textSkeleton.root\n }) : <Text\n {...this.getTestPropsForLabel('label' + index)}\n style={[ isSelected ? this.styles.selectedButtonText : this.styles.text,\n {color: isSelected ? this.styles.selectedButton.color : this.styles.button.color }]}>\n {displayText}\n </Text>\n }\n </View>)}\n </Tappable>\n );\n };\n\n renderItems() {\n const items = this.state.dataItems;\n if(this._showSkeleton) {\n return [{}, {}, {}].map((item: any, index: any) => this.renderChild(item, index))\n }\n return items && items.length ?\n items.map((item: any, index: any) => this.renderChild(item, index)): null\n }\n\n renderWidget(props: WmSwitchProps) {\n return (<View style={this.styles.root}>\n {this.renderItems()}\n </View>);\n }\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAkB,OAAO;AACrC,SAA2CC,IAAI,EAAEC,IAAI,QAAO,cAAc;AAC1E,SAASC,OAAO,EAAEC,IAAI,QAAQ,QAAQ;AAEtC,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,MAAM,MAAM,gEAAgE;AACnF,SAASC,oBAAoB,EAAEC,gBAAgB,QAAQ,sCAAsC;AAC7F,SAASC,QAAQ,QAAQ,mDAAmD;AAC5E,SAASC,uBAAuB,EAAEC,qBAAqB,QAAQ,8CAA8C;AAC7G,SAASC,cAAc,QAAQ,wEAAwE;AAGvG,OAAO,MAAMC,aAAa,SAASL,gBAAgB,CAAgB;AAEnE,eAAe,MAAMM,QAAQ,SAASP,oBAAoB,CAA+C;EACvGQ,WAAWA,CAACC,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEX,aAAa,EAAE,IAAID,aAAa,CAAC,CAAC,CAAC;EAClD;EAEAa,QAAQA,CAACC,KAAU,EAAE;IACnB,IAAI,CAACA,KAAK,EAAE;MACV;IACF;IACA,MAAMC,MAAM,GAAG,IAAI,CAACC,KAAK,CAACJ,KAAK,CAACK,SAAS;IACzC,IAAI,CAACC,QAAQ,CAACJ,KAAK,CAAC;IACpB,IAAIA,KAAK,KAAKC,MAAM,EAAE;MACpB;I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AAC,CAAC,GAAE,IAAI;EAC7E;EAEAqC,YAAYA,CAAC5D,KAAoB,EAAE;IACjC,oBAAQjB,KAAA,CAAA+C,aAAA,CAAC7C,IAAI;MAACqE,KAAK,EAAE,IAAI,CAACf,MAAM,CAACa;IAAK,GACnC,IAAI,CAACK,WAAW,CAAC,CACd,CAAC;EACT;AACF","ignoreList":[]}
|
@@ -68,6 +68,21 @@ BASE_THEME.registerStyle((themeVariables, addStyle) => {
|
|
68
68
|
borderTopRightRadius: 18,
|
69
69
|
borderBottomRightRadius: 18,
|
70
70
|
borderRightWidth: 1
|
71
|
+
},
|
72
|
+
skeleton: {
|
73
|
+
root: {
|
74
|
+
width: 64,
|
75
|
+
height: 40,
|
76
|
+
paddingLeft: 16,
|
77
|
+
paddingRight: 16
|
78
|
+
}
|
79
|
+
},
|
80
|
+
textSkeleton: {
|
81
|
+
root: {
|
82
|
+
width: 30,
|
83
|
+
height: 10,
|
84
|
+
borderRadius: 4
|
85
|
+
}
|
71
86
|
}
|
72
87
|
});
|
73
88
|
addStyle(DEFAULT_CLASS, '', defaultStyles);
|