@wavemaker/app-rn-runtime 12.0.0-next.45503 → 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 +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +11 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js +1 -0
- app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.component.js +44 -6
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js +4 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.component.js +28 -2
- app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.props.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.styles.js +6 -1
- app-rn-runtime/components/container/tile/tile.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +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 +54 -33
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.props.js +1 -0
- app-rn-runtime/components/data/list/list.props.js.map +1 -1
- app-rn-runtime/components/data/list/list.styles.js +9 -0
- app-rn-runtime/components/data/list/list.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.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/fileupload/fileupload.component.js +4 -2
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.props.js +1 -0
- app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +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/page/tabbar/tabbar.props.js +1 -0
- app-rn-runtime/components/page/tabbar/tabbar.props.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js +27 -1
- app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.props.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.styles.js +6 -1
- app-rn-runtime/components/prefab/prefab-container.styles.js.map +1 -1
- app-rn-runtime/core/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 +1 -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 +21 -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 +16 -7
- 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 +42 -2
- 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
@@ -36,6 +36,9 @@ export default class BasePage extends BaseFragment {
|
|
36
36
|
AppSecurityService.redirectToLogin(this.toHashURL());
|
37
37
|
}
|
38
38
|
});
|
39
|
+
if (this.App.appConfig.diagnostics.pageStartTime < 0) {
|
40
|
+
this.App.appConfig.diagnostics.pageStartTime = Date.now();
|
41
|
+
}
|
39
42
|
}
|
40
43
|
onComponentInit(w) {
|
41
44
|
super.onComponentInit(w);
|
@@ -73,11 +76,15 @@ export default class BasePage extends BaseFragment {
|
|
73
76
|
onAttach() {
|
74
77
|
super.onAttach();
|
75
78
|
this.setDrawerContent();
|
79
|
+
this.App.appConfig.diagnostics.pageReadyTime = Date.now();
|
80
|
+
this.App.notify('pageAttached', this);
|
76
81
|
}
|
77
82
|
onFragmentReady() {
|
78
83
|
return super.onFragmentReady().then(() => {
|
79
84
|
this.onContentReady();
|
80
85
|
this.App.triggerPageReady(this.pageName, this.proxy);
|
86
|
+
this.App.appConfig.diagnostics.pageReadyTime = Date.now();
|
87
|
+
this.App.notify('pageReady', this);
|
81
88
|
AppSpinnerService.hide();
|
82
89
|
this.cleanup.push(this.props.navigation.addListener('focus', () => {
|
83
90
|
if (this.appConfig.currentPage !== this) {
|
@@ -90,11 +97,30 @@ export default class BasePage extends BaseFragment {
|
|
90
97
|
}
|
91
98
|
componentWillUnmount() {
|
92
99
|
super.componentWillUnmount();
|
100
|
+
this.App.notify('pageDestroyed', this);
|
101
|
+
}
|
102
|
+
async canNavigate(currentPage, nextPage) {
|
103
|
+
let navigate = true;
|
104
|
+
navigate = await this.onBeforePageLeave(currentPage, nextPage);
|
105
|
+
if (navigate !== false) {
|
106
|
+
navigate = await this.App.onBeforePageLeave(currentPage, nextPage);
|
107
|
+
}
|
108
|
+
if (navigate !== false) navigate = true;
|
109
|
+
return navigate;
|
110
|
+
}
|
111
|
+
async onBeforePageLeave(currentPage, nextPage) {
|
112
|
+
//method can be override by the user from studio;
|
113
|
+
return true;
|
93
114
|
}
|
94
|
-
goToPage(pageName, params, clearCahe = false) {
|
115
|
+
async goToPage(pageName, params, clearCahe = false) {
|
116
|
+
const isNavigable = await this.canNavigate(this.pageName, pageName);
|
117
|
+
if (!isNavigable) {
|
118
|
+
return Promise.resolve();
|
119
|
+
}
|
95
120
|
const navigation = this.props.navigation;
|
96
121
|
const _params = clone(params);
|
97
122
|
_params && delete _params['pageName'];
|
123
|
+
this.App.appConfig.diagnostics.pageStartTime = Date.now();
|
98
124
|
if (pageName !== this.pageName || !isEqual(_params || null, this.pageParams || null)) {
|
99
125
|
if (pageName === this.pageName) {
|
100
126
|
navigation.push(pageName, _params);
|
@@ -127,8 +153,18 @@ export default class BasePage extends BaseFragment {
|
|
127
153
|
const paramStr = Object.keys(this.pageParams || []).map(k => k && `${k}=${this.pageParams[k]}`).join('&');
|
128
154
|
return hash + (paramStr ? `?${paramStr}` : '');
|
129
155
|
}
|
130
|
-
goBack() {
|
156
|
+
async goBack() {
|
157
|
+
var _navigation$getState;
|
131
158
|
const navigation = this.props.navigation;
|
159
|
+
const routes = (_navigation$getState = navigation.getState()) === null || _navigation$getState === void 0 ? void 0 : _navigation$getState.routes;
|
160
|
+
let isNavigable = true;
|
161
|
+
if (navigation.canGoBack()) {
|
162
|
+
isNavigable = await this.canNavigate(this.pageName, routes[routes.length - 2].name);
|
163
|
+
}
|
164
|
+
if (!isNavigable) {
|
165
|
+
return Promise.resolve();
|
166
|
+
}
|
167
|
+
this.App.appConfig.diagnostics.pageStartTime = Date.now();
|
132
168
|
if (navigation.canGoBack()) {
|
133
169
|
navigation.goBack();
|
134
170
|
} else if (window && window.history) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["clone","isEqual","React","CommonActions","SplashScreen","WmPage","NavigationServiceProvider","AppSecurityService","AppSpinnerService","BaseFragment","Watcher","BasePage","constructor","props","_this$appConfig$drawe","_defineProperty","setTimeout","hideAsync","pageName","route","name","pageParams","params","appConfig","currentPage","drawer","setContent","serviceDefinitions","App","watcher","ROOT","create","canUserAccessPage","then","flag","cache","redirectToLogin","toHashURL","onComponentInit","w","targetWidget","refreshdataonattach","toggleDrawer","navigation","setDrawerContent","content","drawerContent","drawerType","hasDrawer","proxy","_this$appConfig$drawe2","_this$appConfig$drawe4","_this$appConfig$drawe3","createElement","value","setAnimation","onAttach","onFragmentReady","onContentReady","triggerPageReady","hide","cleanup","push","addListener","refresh","componentWillUnmount","goToPage","clearCahe","_params","dispatch","reset","index","routes","navigate","onDetach","destroyMe","closeDrawer","Promise","resolve","navigateToLandingPage","hash","paramStr","Object","keys","map","k","join","goBack","canGoBack","window","history","back","openUrl","url","startsWith","substring","splits","split","length","p","forEach","openBrowser","isActiveTabbarItem","label","link","links","possibleLinks","find","l","includes","renderWidget","renderPage"],"sources":["base-page.component.tsx"],"sourcesContent":["import { clone, isEqual } from 'lodash';\nimport React, { ReactNode } from 'react';\nimport { CommonActions } from '@react-navigation/native';\nimport * as SplashScreen from 'expo-splash-screen';\nimport { BaseComponent } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPage from '@wavemaker/app-rn-runtime/components/page/page.component';\nimport NavigationService, { NavigationServiceProvider } from '@wavemaker/app-rn-runtime/core/navigation.service';\n\nimport AppSecurityService from './services/app-security.service';\nimport AppSpinnerService from './services/app-spinner.service';\nimport BaseFragment, { FragmentProps, FragmentState } from './base-fragment.component';\nimport { Watcher } from './watcher';\n\ndeclare const window: any;\n\nexport interface PageProps extends FragmentProps {\n route: any;\n navigation: any;\n destroyMe: Function;\n}\n\nexport interface PageState extends FragmentState<PageProps> {}\n\nexport default abstract class BasePage extends BaseFragment<PageProps, PageState> implements NavigationService {\n private pageName = null as unknown as string;\n private pageParams: any = {};\n private hasDrawer = false;\n private hasTabbar = false;\n private drawerContent = null as React.ReactNode;\n private drawerType = '';\n\n constructor(props: PageProps) {\n super(props);\n setTimeout(() => {\n SplashScreen.hideAsync();\n }, 300);\n this.pageName = props.route.name;\n this.pageParams = props.route.params;\n this.appConfig.currentPage = this;\n this.appConfig.drawer?.setContent(null);\n this.serviceDefinitions = this.App.serviceDefinitions;\n this.watcher = Watcher.ROOT.create();\n AppSecurityService.canUserAccessPage(this.pageName)\n .then(flag => {\n if (!flag) {\n this.cache = false;\n AppSecurityService.redirectToLogin(this.toHashURL());\n }\n });\n }\n\n onComponentInit(w: BaseComponent<any, any, any>) {\n super.onComponentInit(w);\n if (w instanceof WmPage) {\n this.targetWidget = w;\n const props = w.props as any;\n this.cache = !(props.cache === false);\n this.refreshdataonattach = !(props.refreshdataonattach === false);\n }\n }\n\n toggleDrawer() {\n (this.props as PageProps).navigation.toggleDrawer();\n }\n\n setDrawerContent(content = this.drawerContent, drawerType = this.drawerType) {\n if (!content) {\n return;\n }\n this.drawerContent = content;\n this.drawerType = drawerType;\n this.hasDrawer = true;\n setTimeout(() => {\n if (this.appConfig.currentPage === this \n || this.appConfig.currentPage.proxy === this) {\n this.appConfig.drawer?.setContent(null);\n setTimeout(() => {\n this.appConfig.drawer?.setContent((\n <NavigationServiceProvider value={this}>\n {content}\n </NavigationServiceProvider>));\n }, 500);\n this.appConfig.drawer?.setAnimation(drawerType);\n }\n }, 10);\n }\n\n onAttach() {\n super.onAttach();\n this.setDrawerContent();\n }\n\n onFragmentReady() {\n return super.onFragmentReady().then(() => {\n this.onContentReady();\n this.App.triggerPageReady(this.pageName, this.proxy as BasePage);\n AppSpinnerService.hide();\n this.cleanup.push((this.props as PageProps).navigation.addListener('focus', () => {\n if (this.appConfig.currentPage !== this) {\n this.appConfig.currentPage = this;\n this.onAttach();\n this.appConfig.refresh();\n }\n }));\n });\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n }\n\n goToPage(pageName: string, params: any, clearCahe = false) {\n const navigation = (this.props as PageProps).navigation;\n const _params = clone(params);\n _params && delete _params['pageName'];\n if (pageName !== this.pageName || !isEqual(_params || null, this.pageParams || null)) {\n if (pageName === this.pageName) {\n navigation.push(pageName, _params);\n } else if (clearCahe) {\n navigation.dispatch(CommonActions.reset({\n index: 0,\n routes: [\n { name: pageName, params: params }\n ]}));\n } else {\n navigation.navigate(pageName, _params);\n }\n if (this.cache) {\n this.onDetach();\n } else {\n this.props.destroyMe();\n }\n } else {\n (this.props as PageProps).navigation.closeDrawer();\n }\n return Promise.resolve();\n }\n\n public navigateToLandingPage() {\n AppSecurityService.navigateToLandingPage();\n }\n\n public toHashURL() {\n const hash = `#/${this.pageName}`;\n const paramStr = Object.keys(this.pageParams || [])\n .map(k => k && `${k}=${this.pageParams[k]}`)\n .join('&');\n return hash + (paramStr ? `?${paramStr}` : '');\n }\n\n goBack() {\n const navigation = (this.props as PageProps).navigation;\n if (navigation.canGoBack()) {\n navigation.goBack();\n } else if (window && window.history) {\n window.history.back();\n }\n return Promise.resolve();\n }\n\n openUrl(url: string, params = {} as any) {\n if (url) {\n if (url.startsWith('#')) {\n url = url.substring(1);\n url = url.startsWith('/') ? url.substring(1) : url;\n const splits = url.split('?');\n const pageName = splits[0];\n let params = {} as any;\n if (splits.length > 1) {\n splits[1].split('&')\n .map(p => p.split('='))\n .forEach(p => params[p[0]] = p[1]);\n }\n return this.goToPage(pageName, params);\n } else {\n this.App.openBrowser(url, params);\n }\n }\n return Promise.resolve();\n }\n\n isActiveTabbarItem({label, link, links}: {label: string, link: string, links: string[]}) {\n const pageName = this.pageName;\n const possibleLinks = [pageName, '#' + pageName, '#/' + pageName];\n return links && links.find(l => possibleLinks.includes(l));\n }\n\n abstract renderPage(): ReactNode;\n\n renderWidget(props: PageProps) {\n return this.renderPage();\n }\n}\n"],"mappings":";;;AAAA,SAASA,KAAK,EAAEC,OAAO,QAAQ,QAAQ;AACvC,OAAOC,KAAK,MAAqB,OAAO;AACxC,SAASC,aAAa,QAAQ,0BAA0B;AACxD,OAAO,KAAKC,YAAY,MAAM,oBAAoB;AAGlD,OAAOC,MAAM,MAAM,0DAA0D;AAC7E,SAA4BC,yBAAyB,QAAQ,mDAAmD;AAEhH,OAAOC,kBAAkB,MAAM,iCAAiC;AAChE,OAAOC,iBAAiB,MAAM,gCAAgC;AAC9D,OAAOC,YAAY,MAAwC,2BAA2B;AACtF,SAASC,OAAO,QAAQ,WAAW;AAYnC,eAAe,MAAeC,QAAQ,SAASF,YAAY,CAAoD;EAQ3GG,WAAWA,CAACC,KAAgB,EAAE;IAAA,IAAAC,qBAAA;IAC5B,KAAK,CAACD,KAAK,CAAC;IAACE,eAAA,mBARI,IAAI;IAAAA,eAAA,qBACG,CAAC,CAAC;IAAAA,eAAA,oBACR,KAAK;IAAAA,eAAA,oBACL,KAAK;IAAAA,eAAA,wBACD,IAAI;IAAAA,eAAA,qBACP,EAAE;IAIrBC,UAAU,CAAC,MAAM;MACfZ,YAAY,CAACa,SAAS,CAAC,CAAC;IAC1B,CAAC,EAAE,GAAG,CAAC;IACP,IAAI,CAACC,QAAQ,GAAGL,KAAK,CAACM,KAAK,CAACC,IAAI;IAChC,IAAI,CAACC,UAAU,GAAGR,KAAK,CAACM,KAAK,CAACG,MAAM;IACpC,IAAI,CAACC,SAAS,CAACC,WAAW,GAAG,IAAI;IACjC,CAAAV,qBAAA,OAAI,CAACS,SAAS,CAACE,MAAM,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Actions","SplashScreen","WmPage","NavigationServiceProvider","AppSecurityService","AppSpinnerService","BaseFragment","Watcher","BasePage","constructor","props","_this$appConfig$drawe","_defineProperty","setTimeout","hideAsync","pageName","route","name","pageParams","params","appConfig","currentPage","drawer","setContent","serviceDefinitions","App","watcher","ROOT","create","canUserAccessPage","then","flag","cache","redirectToLogin","toHashURL","diagnostics","pageStartTime","Date","now","onComponentInit","w","targetWidget","refreshdataonattach","toggleDrawer","navigation","setDrawerContent","content","drawerContent","drawerType","hasDrawer","proxy","_this$appConfig$drawe2","_this$appConfig$drawe4","_this$appConfig$drawe3","createElement","value","setAnimation","onAttach","pageReadyTime","notify","onFragmentReady","onContentReady","triggerPageReady","hide","cleanup","push","addListener","refresh","componentWillUnmount","canNavigate","nextPage","navigate","onBeforePageLeave","goToPage","clearCahe","isNavigable","Promise","resolve","_params","dispatch","reset","index","routes","onDetach","destroyMe","closeDrawer","navigateToLandingPage","hash","paramStr","Object","keys","map","k","join","goBack","_navigation$getState","getState","canGoBack","length","window","history","back","openUrl","url","startsWith","substring","splits","split","p","forEach","openBrowser","isActiveTabbarItem","label","link","links","possibleLinks","find","l","includes","renderWidget","renderPage"],"sources":["base-page.component.tsx"],"sourcesContent":["import { clone, isEqual } from 'lodash';\nimport React, { ReactNode } from 'react';\nimport { CommonActions } from '@react-navigation/native';\nimport * as SplashScreen from 'expo-splash-screen';\nimport { BaseComponent } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmPage from '@wavemaker/app-rn-runtime/components/page/page.component';\nimport NavigationService, { NavigationServiceProvider } from '@wavemaker/app-rn-runtime/core/navigation.service';\n\nimport AppSecurityService from './services/app-security.service';\nimport AppSpinnerService from './services/app-spinner.service';\nimport BaseFragment, { FragmentProps, FragmentState } from './base-fragment.component';\nimport { Watcher } from './watcher';\n\ndeclare const window: any;\n\nexport interface PageProps extends FragmentProps {\n route: any;\n navigation: any;\n destroyMe: Function;\n}\n\nexport interface PageState extends FragmentState<PageProps> {}\n\nexport default abstract class BasePage extends BaseFragment<PageProps, PageState> implements NavigationService {\n private pageName = null as unknown as string;\n private pageParams: any = {};\n private hasDrawer = false;\n private hasTabbar = false;\n private drawerContent = null as React.ReactNode;\n private drawerType = '';\n\n constructor(props: PageProps) {\n super(props);\n setTimeout(() => {\n SplashScreen.hideAsync();\n }, 300);\n this.pageName = props.route.name;\n this.pageParams = props.route.params;\n this.appConfig.currentPage = this;\n this.appConfig.drawer?.setContent(null);\n this.serviceDefinitions = this.App.serviceDefinitions;\n this.watcher = Watcher.ROOT.create();\n AppSecurityService.canUserAccessPage(this.pageName)\n .then(flag => {\n if (!flag) {\n this.cache = false;\n AppSecurityService.redirectToLogin(this.toHashURL());\n }\n });\n if (this.App.appConfig.diagnostics.pageStartTime < 0) {\n this.App.appConfig.diagnostics.pageStartTime = Date.now();\n }\n }\n\n onComponentInit(w: BaseComponent<any, any, any>) {\n super.onComponentInit(w);\n if (w instanceof WmPage) {\n this.targetWidget = w;\n const props = w.props as any;\n this.cache = !(props.cache === false);\n this.refreshdataonattach = !(props.refreshdataonattach === false);\n }\n }\n\n toggleDrawer() {\n (this.props as PageProps).navigation.toggleDrawer();\n }\n\n setDrawerContent(content = this.drawerContent, drawerType = this.drawerType) {\n if (!content) {\n return;\n }\n this.drawerContent = content;\n this.drawerType = drawerType;\n this.hasDrawer = true;\n setTimeout(() => {\n if (this.appConfig.currentPage === this \n || this.appConfig.currentPage.proxy === this) {\n this.appConfig.drawer?.setContent(null);\n setTimeout(() => {\n this.appConfig.drawer?.setContent((\n <NavigationServiceProvider value={this}>\n {content}\n </NavigationServiceProvider>));\n }, 500);\n this.appConfig.drawer?.setAnimation(drawerType);\n }\n }, 10);\n }\n\n onAttach() {\n super.onAttach();\n this.setDrawerContent();\n this.App.appConfig.diagnostics.pageReadyTime = Date.now();\n this.App.notify('pageAttached', this);\n }\n\n onFragmentReady() {\n return super.onFragmentReady().then(() => {\n this.onContentReady();\n this.App.triggerPageReady(this.pageName, this.proxy as BasePage);\n this.App.appConfig.diagnostics.pageReadyTime = Date.now(); \n this.App.notify('pageReady', this);\n AppSpinnerService.hide();\n this.cleanup.push((this.props as PageProps).navigation.addListener('focus', () => {\n if (this.appConfig.currentPage !== this) {\n this.appConfig.currentPage = this;\n this.onAttach();\n this.appConfig.refresh();\n }\n }));\n });\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n this.App.notify('pageDestroyed', this);\n }\n\n async canNavigate (currentPage: string, nextPage: string) {\n let navigate = true;\n navigate = await this.onBeforePageLeave(currentPage, nextPage);\n if(navigate !== false){\n navigate = await this.App.onBeforePageLeave(currentPage, nextPage);\n }\n\n if(navigate !== false) navigate = true;\n\n return navigate; \n }\n\n async onBeforePageLeave(currentPage: string, nextPage: string) {\n //method can be override by the user from studio;\n return true;\n }\n\n async goToPage(pageName: string, params: any, clearCahe = false) {\n const isNavigable = await this.canNavigate(this.pageName, pageName)\n if(!isNavigable){\n return Promise.resolve();\n }\n\n const navigation = (this.props as PageProps).navigation;\n const _params = clone(params);\n _params && delete _params['pageName'];\n this.App.appConfig.diagnostics.pageStartTime = Date.now();\n if (pageName !== this.pageName || !isEqual(_params || null, this.pageParams || null)) {\n if (pageName === this.pageName) {\n navigation.push(pageName, _params);\n } else if (clearCahe) {\n navigation.dispatch(CommonActions.reset({\n index: 0,\n routes: [\n { name: pageName, params: params }\n ]}));\n } else {\n navigation.navigate(pageName, _params);\n }\n if (this.cache) {\n this.onDetach();\n } else {\n this.props.destroyMe();\n }\n } else {\n (this.props as PageProps).navigation.closeDrawer();\n }\n return Promise.resolve();\n }\n\n public navigateToLandingPage() {\n AppSecurityService.navigateToLandingPage();\n }\n\n public toHashURL() {\n const hash = `#/${this.pageName}`;\n const paramStr = Object.keys(this.pageParams || [])\n .map(k => k && `${k}=${this.pageParams[k]}`)\n .join('&');\n return hash + (paramStr ? `?${paramStr}` : '');\n }\n\n async goBack() {\n const navigation = (this.props as PageProps).navigation;\n const routes = navigation.getState()?.routes;\n let isNavigable = true;\n\n if(navigation.canGoBack()){\n isNavigable = await this.canNavigate(this.pageName, routes[routes.length - 2].name)\n }\n if(!isNavigable){\n return Promise.resolve();\n }\n\n this.App.appConfig.diagnostics.pageStartTime = Date.now();\n if (navigation.canGoBack()) {\n navigation.goBack();\n } else if (window && window.history) {\n window.history.back();\n }\n return Promise.resolve();\n }\n\n openUrl(url: string, params = {} as any) {\n if (url) {\n if (url.startsWith('#')) {\n url = url.substring(1);\n url = url.startsWith('/') ? url.substring(1) : url;\n const splits = url.split('?');\n const pageName = splits[0];\n let params = {} as any;\n if (splits.length > 1) {\n splits[1].split('&')\n .map(p => p.split('='))\n .forEach(p => params[p[0]] = p[1]);\n }\n return this.goToPage(pageName, params);\n } else {\n this.App.openBrowser(url, params);\n }\n }\n return Promise.resolve();\n }\n\n isActiveTabbarItem({label, link, links}: {label: string, link: string, links: string[]}) {\n const pageName = this.pageName;\n const possibleLinks = [pageName, '#' + pageName, '#/' + pageName];\n return links && links.find(l => possibleLinks.includes(l));\n }\n\n abstract renderPage(): ReactNode;\n\n renderWidget(props: PageProps) {\n return this.renderPage();\n }\n}\n"],"mappings":";;;AAAA,SAASA,KAAK,EAAEC,OAAO,QAAQ,QAAQ;AACvC,OAAOC,KAAK,MAAqB,OAAO;AACxC,SAASC,aAAa,QAAQ,0BAA0B;AACxD,OAAO,KAAKC,YAAY,MAAM,oBAAoB;AAGlD,OAAOC,MAAM,MAAM,0DAA0D;AAC7E,SAA4BC,yBAAyB,QAAQ,mDAAmD;AAEhH,OAAOC,kBAAkB,MAAM,iCAAiC;AAChE,OAAOC,iBAAiB,MAAM,gCAAgC;AAC9D,OAAOC,YAAY,MAAwC,2BAA2B;AACtF,SAASC,OAAO,QAAQ,WAAW;AAYnC,eAAe,MAAeC,QAAQ,SAASF,YAAY,CAAoD;EAQ3GG,WAAWA,CAACC,KAAgB,EAAE;IAAA,IAAAC,qBAAA;IAC5B,KAAK,CAACD,KAAK,CAAC;IAACE,eAAA,mBARI,IAAI;IAAAA,eAAA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AAG,CAACI,KAAK,CAAC,GAAG,CAAC;QAC7B,MAAM5F,QAAQ,GAAG2F,MAAM,CAAC,CAAC,CAAC;QAC1B,IAAIvF,MAAM,GAAG,CAAC,CAAQ;QACtB,IAAIuF,MAAM,CAACR,MAAM,GAAG,CAAC,EAAE;UACrBQ,MAAM,CAAC,CAAC,CAAC,CAACC,KAAK,CAAC,GAAG,CAAC,CACjBhB,GAAG,CAACiB,CAAC,IAAIA,CAAC,CAACD,KAAK,CAAC,GAAG,CAAC,CAAC,CACtBE,OAAO,CAACD,CAAC,IAAIzF,MAAM,CAACyF,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGA,CAAC,CAAC,CAAC,CAAC,CAAC;QACtC;QACA,OAAO,IAAI,CAACnC,QAAQ,CAAC1D,QAAQ,EAAEI,MAAM,CAAC;MACxC,CAAC,MAAM;QACL,IAAI,CAACM,GAAG,CAACqF,WAAW,CAACP,GAAG,EAAEpF,MAAM,CAAC;MACnC;IACF;IACA,OAAOyD,OAAO,CAACC,OAAO,CAAC,CAAC;EAC1B;EAEAkC,kBAAkBA,CAAC;IAACC,KAAK;IAAEC,IAAI;IAAEC;EAAqD,CAAC,EAAE;IACvF,MAAMnG,QAAQ,GAAG,IAAI,CAACA,QAAQ;IAC9B,MAAMoG,aAAa,GAAG,CAACpG,QAAQ,EAAE,GAAG,GAAGA,QAAQ,EAAE,IAAI,GAAGA,QAAQ,CAAC;IACjE,OAAOmG,KAAK,IAAIA,KAAK,CAACE,IAAI,CAACC,CAAC,IAAIF,aAAa,CAACG,QAAQ,CAACD,CAAC,CAAC,CAAC;EAC5D;EAIAE,YAAYA,CAAC7G,KAAgB,EAAE;IAC7B,OAAO,IAAI,CAAC8G,UAAU,CAAC,CAAC;EAC1B;AACJ","ignoreList":[]}
|
@@ -20,6 +20,9 @@ export default class BasePartial extends BaseFragment {
|
|
20
20
|
this.watcher = props.parentWatcher.create();
|
21
21
|
}
|
22
22
|
onFragmentReady() {
|
23
|
+
if (this.props.invokeVariables === false) {
|
24
|
+
return Promise.resolve();
|
25
|
+
}
|
23
26
|
return super.onFragmentReady().then(() => {
|
24
27
|
this.onContentReady();
|
25
28
|
this.invokeEventCallback('onLoad', [this]);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["WmPartial","BaseFragment","BasePartial","constructor","props","_defineProperty","isPartOfPrefab","prefab","App","appConfig","app","Actions","Object","assign","Variables","serviceDefinitions","Prefab","baseUrl","watcher","parentWatcher","create","onFragmentReady","then","onContentReady","invokeEventCallback","prefabname","_this$Prefab","onComponentInit","w","targetWidget","onComponentDestroy","parent","Widgets","componentDidUpdate","prevProps","prevState","snapshot","pageParams","partialParams","fragmentVariables","renderWidget","renderPartial"],"sources":["base-partial.component.tsx"],"sourcesContent":["import { BaseComponent } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmPartial from '@wavemaker/app-rn-runtime/components/page/partial/partial.component';\nimport BaseFragment, { FragmentProps, FragmentState } from './base-fragment.component';\nimport { ReactNode } from 'react';\nimport BasePrefab from './base-prefab.component';\nimport { Watcher } from './watcher';\nexport interface PartialProps extends FragmentProps {\n serviceDefinitions: any;\n prefab: any;\n parent: any;\n onLoad?: Function;\n parentWatcher: Watcher;\n}\n\nexport interface PartialState extends FragmentState<PartialProps> {}\n\nexport default abstract class BasePartial extends BaseFragment<PartialProps, PartialState> {\n private partialParams: any = {};\n Prefab: BasePrefab = null as any;\n\n constructor(props: PartialProps) {\n super(props);\n const isPartOfPrefab = !!this.props.prefab;\n this.App = this.appConfig.app;\n this.Actions = Object.assign({}, isPartOfPrefab ? {} : this.App.Actions);\n this.Variables = Object.assign({}, isPartOfPrefab ? {} : this.App.Variables);\n this.serviceDefinitions = this.props.serviceDefinitions;\n if (isPartOfPrefab) {\n this.Prefab = this.props.prefab;\n this.baseUrl =this.Prefab.baseUrl;\n }\n this.watcher = props.parentWatcher.create();\n }\n\n onFragmentReady() {\n return super.onFragmentReady().then(() => {\n this.onContentReady();\n this.invokeEventCallback('onLoad', [this]);\n });\n }\n\n get prefabname() {\n return this.Prefab?.props.prefabname;\n }\n\n onComponentInit(w: BaseComponent<any, any, any>) {\n super.onComponentInit(w);\n if (w instanceof WmPartial) {\n this.targetWidget = w;\n }\n }\n\n onComponentDestroy(w: BaseComponent<any, any, any>): void {\n super.onComponentDestroy(w);\n const parent: any = this.props.parent;\n if (parent) {\n delete (parent as any).Widgets;\n delete (parent as any).Variables;\n }\n }\n\n componentDidUpdate(prevProps: Readonly<PartialProps>, prevState: Readonly<PartialState>, snapshot?: any): void {\n super.componentDidUpdate(prevProps, prevState, snapshot);\n const parent: any = this.props.parent;\n if (parent) {\n parent.pageParams = (this as any).pageParams;\n parent.partialParams = (this as any).pageParams;\n parent.Widgets = this.Widgets;\n parent.Variables = this.fragmentVariables;\n }\n }\n\n abstract renderPartial(): ReactNode;\n\n renderWidget(props: PartialProps) {\n return this.renderPartial();\n }\n}\n"],"mappings":";;;
|
1
|
+
{"version":3,"names":["WmPartial","BaseFragment","BasePartial","constructor","props","_defineProperty","isPartOfPrefab","prefab","App","appConfig","app","Actions","Object","assign","Variables","serviceDefinitions","Prefab","baseUrl","watcher","parentWatcher","create","onFragmentReady","invokeVariables","Promise","resolve","then","onContentReady","invokeEventCallback","prefabname","_this$Prefab","onComponentInit","w","targetWidget","onComponentDestroy","parent","Widgets","componentDidUpdate","prevProps","prevState","snapshot","pageParams","partialParams","fragmentVariables","renderWidget","renderPartial"],"sources":["base-partial.component.tsx"],"sourcesContent":["import React from 'react';\nimport { BaseComponent } from '@wavemaker/app-rn-runtime/core/base.component';\nimport WmPartial from '@wavemaker/app-rn-runtime/components/page/partial/partial.component';\nimport BaseFragment, { FragmentProps, FragmentState } from './base-fragment.component';\nimport { ReactNode } from 'react';\nimport BasePrefab from './base-prefab.component';\nimport { Watcher } from './watcher';\nimport { View } from 'react-native';\nimport WmLottie from '../components/basic/lottie/lottie.component';\n\nexport interface PartialProps extends FragmentProps {\n serviceDefinitions: any;\n prefab: any;\n parent: any;\n onLoad?: Function;\n parentWatcher: Watcher;\n invokeVariables: boolean;\n}\n\nexport interface PartialState extends FragmentState<PartialProps> {}\n\nexport default abstract class BasePartial extends BaseFragment<PartialProps, PartialState> {\n private partialParams: any = {};\n Prefab: BasePrefab = null as any;\n\n constructor(props: PartialProps) {\n super(props);\n const isPartOfPrefab = !!this.props.prefab;\n this.App = this.appConfig.app;\n this.Actions = Object.assign({}, isPartOfPrefab ? {} : this.App.Actions);\n this.Variables = Object.assign({}, isPartOfPrefab ? {} : this.App.Variables);\n this.serviceDefinitions = this.props.serviceDefinitions;\n if (isPartOfPrefab) {\n this.Prefab = this.props.prefab;\n this.baseUrl =this.Prefab.baseUrl;\n }\n this.watcher = props.parentWatcher.create();\n }\n\n onFragmentReady() {\n if(this.props.invokeVariables === false) {\n return Promise.resolve();\n }\n return super.onFragmentReady().then(() => {\n this.onContentReady();\n this.invokeEventCallback('onLoad', [this]);\n });\n }\n\n get prefabname() {\n return this.Prefab?.props.prefabname;\n }\n\n onComponentInit(w: BaseComponent<any, any, any>) {\n super.onComponentInit(w);\n if (w instanceof WmPartial) {\n this.targetWidget = w;\n }\n }\n\n onComponentDestroy(w: BaseComponent<any, any, any>): void {\n super.onComponentDestroy(w);\n const parent: any = this.props.parent;\n if (parent) {\n delete (parent as any).Widgets;\n delete (parent as any).Variables;\n }\n }\n\n componentDidUpdate(prevProps: Readonly<PartialProps>, prevState: Readonly<PartialState>, snapshot?: any): void {\n super.componentDidUpdate(prevProps, prevState, snapshot);\n const parent: any = this.props.parent;\n if (parent) {\n parent.pageParams = (this as any).pageParams;\n parent.partialParams = (this as any).pageParams;\n parent.Widgets = this.Widgets;\n parent.Variables = this.fragmentVariables;\n }\n }\n \n abstract renderPartial(): ReactNode;\n\n renderWidget(props: PartialProps) {\n return this.renderPartial();\n }\n}\n"],"mappings":";;;AAEA,OAAOA,SAAS,MAAM,qEAAqE;AAC3F,OAAOC,YAAY,MAAwC,2BAA2B;AAkBtF,eAAe,MAAeC,WA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IAAAC,YAAA;IACf,QAAAA,YAAA,GAAO,IAAI,CAACb,MAAM,cAAAa,YAAA,uBAAXA,YAAA,CAAazB,KAAK,CAACwB,UAAU;EACtC;EAEAE,eAAeA,CAACC,CAA+B,EAAE;IAC/C,KAAK,CAACD,eAAe,CAACC,CAAC,CAAC;IACxB,IAAIA,CAAC,YAAY/B,SAAS,EAAE;MAC1B,IAAI,CAACgC,YAAY,GAAGD,CAAC;IACvB;EACF;EAEAE,kBAAkBA,CAACF,CAA+B,EAAQ;IACxD,KAAK,CAACE,kBAAkB,CAACF,CAAC,CAAC;IAC3B,MAAMG,MAAW,GAAG,IAAI,CAAC9B,KAAK,CAAC8B,MAAM;IACrC,IAAIA,MAAM,EAAE;MACV,OAAQA,MAAM,CAASC,OAAO;MAC9B,OAAQD,MAAM,CAASpB,SAAS;IAClC;EACF;EAEAsB,kBAAkBA,CAACC,SAAiC,EAAEC,SAAiC,EAAEC,QAAc,EAAQ;IAC7G,KAAK,CAACH,kBAAkB,CAACC,SAAS,EAAEC,SAAS,EAAEC,QAAQ,CAAC;IACxD,MAAML,MAAW,GAAG,IAAI,CAAC9B,KAAK,CAAC8B,MAAM;IACrC,IAAIA,MAAM,EAAE;MACVA,MAAM,CAACM,UAAU,GAAI,IAAI,CAASA,UAAU;MAC5CN,MAAM,CAACO,aAAa,GAAK,IAAI,CAASD,UAAU;MAChDN,MAAM,CAACC,OAAO,GAAG,IAAI,CAACA,OAAO;MAC7BD,MAAM,CAACpB,SAAS,GAAG,IAAI,CAAC4B,iBAAiB;IAC3C;EACF;EAIAC,YAAYA,CAACvC,KAAmB,EAAE;IAChC,OAAO,IAAI,CAACwC,aAAa,CAAC,CAAC;EAC7B;AACJ","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","merge","PartialProvider","WmPrefabContainer","BaseFragment","axios","BasePrefab","constructor","props","defualtProps","partialService","_defineProperty","App","appConfig","app","Actions","Variables","appUrl","url","resourceBaseUrl","baseUrl","prefabname","watcher","parentWatcher","create","getServiceDefinitions","onComponentInit","w","targetWidget","onFragmentReady","_renderPrefab","component","renderPrefab","then","onContentReady","invokeEventCallback","refresh","Promise","resolve","resetAppLocale","appLocale","messages","prefabMessages","Object","values","fragments","forEach","f","componentWillUnmount","renderWidget","_props$styles","createElement","value","style","width","styles","root","_BasePrefab","prefabName","defs","SERVICE_DEFINITION_CACHE","get","catch","response","_response$data","serviceDefinitions","data","serviceDefs"],"sources":["base-prefab.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { merge } from 'lodash-es';\n\nimport { BaseComponent } from '@wavemaker/app-rn-runtime/core/base.component';\nimport PartialService, { PartialProvider } from '@wavemaker/app-rn-runtime/core/partial.service';\nimport WmPrefabContainer from '@wavemaker/app-rn-runtime/components/prefab/prefab-container.component';\nimport BaseFragment, { FragmentProps, FragmentState } from './base-fragment.component';\nimport axios from 'axios';\nimport { Watcher } from './watcher';\n\n\nexport interface PrefabProps extends FragmentProps {\n prefabname: string;\n parentWatcher: Watcher;\n}\n\nexport interface PrefabState extends FragmentState<PrefabProps> {}\n\nexport default abstract class BasePrefab extends BaseFragment<PrefabProps, PrefabState> {\n\n private static SERVICE_DEFINITION_CACHE = {} as any;\n\n public static getServiceDefinitions = (prefabName: string, url: string) => {\n const defs = BasePrefab.SERVICE_DEFINITION_CACHE[prefabName];\n if (defs) {\n return Promise.resolve(defs);\n } else {\n return axios.get(url + '/servicedefs')\n .catch(() => ({}))\n .then((response: any) => {\n const serviceDefinitions = response?.data?.serviceDefs || {};\n BasePrefab.SERVICE_DEFINITION_CACHE[prefabName] = serviceDefinitions;\n return Promise.resolve(serviceDefinitions);\n });\n }\n };\n\n private appUrl = '';\n private prefabParams: any = {};\n private _renderPrefab:() => React.ReactNode = null as any;\n\n constructor(props: PrefabProps, defualtProps: PrefabProps, private partialService: PartialService) {\n super(props, defualtProps);\n this.App = this.appConfig.app;\n this.Actions = {};\n this.Variables = {};\n this.appUrl = this.appConfig.url;\n this.resourceBaseUrl = `${this.baseUrl}/app/prefabs/${props.prefabname}`;\n this.baseUrl = `${this.baseUrl}/prefabs/${props.prefabname}`;\n this.watcher = props.parentWatcher.create();\n }\n\n getServiceDefinitions() {\n return BasePrefab.getServiceDefinitions(this.props.prefabname, `${this.appUrl}/services/prefabs/${this.props.prefabname}`);\n }\n\n onComponentInit(w: BaseComponent<any, any, any>) {\n super.onComponentInit(w);\n if (w instanceof WmPrefabContainer) {\n this.targetWidget = w;\n }\n }\n\n onFragmentReady(): Promise<void> {\n this._renderPrefab = () => {\n const component = this.renderPrefab();\n super.onFragmentReady()\n .then(() => {\n this.onContentReady();\n this.invokeEventCallback('onLoad', [null, this]);\n });\n this._renderPrefab = () => this.renderPrefab();\n return component;\n };\n this.refresh();\n return Promise.resolve();\n }\n\n resetAppLocale() {\n this.appLocale = merge({ }, this.appConfig.appLocale.messages, this.appConfig.appLocale.prefabMessages[this.props.prefabname]);\n Object.values(this.fragments).forEach((f: any) => (f as BaseFragment<any, any>).resetAppLocale());\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n this.invokeEventCallback('onDestroy', [null, this]);\n }\n\n abstract renderPrefab(): React.ReactNode;\n\n renderWidget(props: PrefabProps) {\n return (\n <PartialProvider value={this.partialService}>\n <View style={[{width: '100%'}, props.styles?.root]}>\n {this._renderPrefab ? this._renderPrefab(): null}\n </View>\n </PartialProvider>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,KAAK,QAAQ,WAAW;AAGjC,SAAyBC,eAAe,QAAQ,gDAAgD;AAChG,OAAOC,iBAAiB,MAAM,wEAAwE;AACtG,OAAOC,YAAY,MAAwC,2BAA2B;AACtF,OAAOC,KAAK,MAAM,OAAO;
|
1
|
+
{"version":3,"names":["React","View","merge","PartialProvider","WmPrefabContainer","BaseFragment","axios","BasePrefab","constructor","props","defualtProps","partialService","_defineProperty","App","appConfig","app","Actions","Variables","appUrl","url","resourceBaseUrl","baseUrl","prefabname","watcher","parentWatcher","create","getServiceDefinitions","onComponentInit","w","targetWidget","onFragmentReady","_renderPrefab","component","renderPrefab","then","onContentReady","invokeEventCallback","refresh","Promise","resolve","resetAppLocale","appLocale","messages","prefabMessages","Object","values","fragments","forEach","f","componentWillUnmount","renderWidget","_props$styles","createElement","value","style","width","styles","root","_BasePrefab","prefabName","defs","SERVICE_DEFINITION_CACHE","get","catch","response","_response$data","serviceDefinitions","data","serviceDefs"],"sources":["base-prefab.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { merge } from 'lodash-es';\n\nimport { BaseComponent } from '@wavemaker/app-rn-runtime/core/base.component';\nimport PartialService, { PartialProvider } from '@wavemaker/app-rn-runtime/core/partial.service';\nimport WmPrefabContainer from '@wavemaker/app-rn-runtime/components/prefab/prefab-container.component';\nimport BaseFragment, { FragmentProps, FragmentState } from './base-fragment.component';\nimport axios from 'axios';\nimport { Watcher } from './watcher';\nimport WmLottie from '../components/basic/lottie/lottie.component';\n\n\nexport interface PrefabProps extends FragmentProps {\n prefabname: string;\n parentWatcher: Watcher;\n}\n\nexport interface PrefabState extends FragmentState<PrefabProps> {}\n\nexport default abstract class BasePrefab extends BaseFragment<PrefabProps, PrefabState> {\n\n private static SERVICE_DEFINITION_CACHE = {} as any;\n\n public static getServiceDefinitions = (prefabName: string, url: string) => {\n const defs = BasePrefab.SERVICE_DEFINITION_CACHE[prefabName];\n if (defs) {\n return Promise.resolve(defs);\n } else {\n return axios.get(url + '/servicedefs')\n .catch(() => ({}))\n .then((response: any) => {\n const serviceDefinitions = response?.data?.serviceDefs || {};\n BasePrefab.SERVICE_DEFINITION_CACHE[prefabName] = serviceDefinitions;\n return Promise.resolve(serviceDefinitions);\n });\n }\n };\n\n private appUrl = '';\n private prefabParams: any = {};\n private _renderPrefab:() => React.ReactNode = null as any;\n\n constructor(props: PrefabProps, defualtProps: PrefabProps, private partialService: PartialService) {\n super(props, defualtProps);\n this.App = this.appConfig.app;\n this.Actions = {};\n this.Variables = {};\n this.appUrl = this.appConfig.url;\n this.resourceBaseUrl = `${this.baseUrl}/app/prefabs/${props.prefabname}`;\n this.baseUrl = `${this.baseUrl}/prefabs/${props.prefabname}`;\n this.watcher = props.parentWatcher.create();\n }\n\n getServiceDefinitions() {\n return BasePrefab.getServiceDefinitions(this.props.prefabname, `${this.appUrl}/services/prefabs/${this.props.prefabname}`);\n }\n\n onComponentInit(w: BaseComponent<any, any, any>) {\n super.onComponentInit(w);\n if (w instanceof WmPrefabContainer) {\n this.targetWidget = w;\n }\n }\n\n onFragmentReady(): Promise<void> {\n this._renderPrefab = () => {\n const component = this.renderPrefab();\n super.onFragmentReady()\n .then(() => {\n this.onContentReady();\n this.invokeEventCallback('onLoad', [null, this]);\n });\n this._renderPrefab = () => this.renderPrefab();\n return component;\n };\n this.refresh();\n return Promise.resolve();\n }\n\n resetAppLocale() {\n this.appLocale = merge({ }, this.appConfig.appLocale.messages, this.appConfig.appLocale.prefabMessages[this.props.prefabname]);\n Object.values(this.fragments).forEach((f: any) => (f as BaseFragment<any, any>).resetAppLocale());\n }\n\n componentWillUnmount() {\n super.componentWillUnmount();\n this.invokeEventCallback('onDestroy', [null, this]);\n }\n\n abstract renderPrefab(): React.ReactNode;\n \n renderWidget(props: PrefabProps) {\n return (\n <PartialProvider value={this.partialService}>\n <View style={[{width: '100%'}, props.styles?.root]}>\n {this._renderPrefab ? this._renderPrefab(): null}\n </View>\n </PartialProvider>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,KAAK,QAAQ,WAAW;AAGjC,SAAyBC,eAAe,QAAQ,gDAAgD;AAChG,OAAOC,iBAAiB,MAAM,wEAAwE;AACtG,OAAOC,YAAY,MAAwC,2BAA2B;AACtF,OAAOC,KAAK,MAAM,OAAO;AAYzB,eAAe,MAAeC,UAAU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,IAAI,CAACA,aAAa,CAAC,CAAC,GAAE,IACxC,CACS,CAAC;EAEtB;AACJ;AAAC2B,WAAA,GAjF6BnD,UAAU;AAAAK,eAAA,CAAVL,UAAU,8BAEM,CAAC,CAAC;AAAAK,eAAA,CAFlBL,UAAU,2BAIE,CAACoD,UAAkB,EAAExC,GAAW,KAAK;EACzE,MAAMyC,IAAI,GAAGrD,WAAU,CAACsD,wBAAwB,CAACF,UAAU,CAAC;EAC5D,IAAIC,IAAI,EAAE;IACR,OAAOtB,OAAO,CAACC,OAAO,CAACqB,IAAI,CAAC;EAC9B,CAAC,MAAM;IACL,OAAOtD,KAAK,CAACwD,GAAG,CAAC3C,GAAG,GAAG,cAAc,CAAC,CACnC4C,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CACjB7B,IAAI,CAAE8B,QAAa,IAAK;MAAA,IAAAC,cAAA;MACrB,MAAMC,kBAAkB,GAAG,CAAAF,QAAQ,aAARA,QAAQ,gBAAAC,cAAA,GAARD,QAAQ,CAAEG,IAAI,cAAAF,cAAA,uBAAdA,cAAA,CAAgBG,WAAW,KAAI,CAAC,CAAC;MAC5D7D,WAAU,CAACsD,wBAAwB,CAACF,UAAU,CAAC,GAAGO,kBAAkB;MACpE,OAAO5B,OAAO,CAACC,OAAO,CAAC2B,kBAAkB,CAAC;IAC9C,CAAC,CAAC;EACN;AACF,CAAC","ignoreList":[]}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { createDrawerNavigator } from '@react-navigation/drawer';
|
2
|
+
import { createDrawerNavigator, getDrawerStatusFromState } from '@react-navigation/drawer';
|
3
3
|
import ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';
|
4
4
|
const Drawer = createDrawerNavigator();
|
5
5
|
class AppDrawerNavigator extends React.Component {
|
@@ -11,15 +11,24 @@ class AppDrawerNavigator extends React.Component {
|
|
11
11
|
initialRouteName: "pages",
|
12
12
|
drawerContent: this.props.content,
|
13
13
|
useLegacyImplementation: false,
|
14
|
-
screenOptions: {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
14
|
+
screenOptions: ({
|
15
|
+
navigation
|
16
|
+
}) => {
|
17
|
+
const widthStyle = this.props.drawerWidth && getDrawerStatusFromState(navigation.getState()) === 'open' ? {
|
18
|
+
width: this.props.drawerWidth,
|
19
|
+
maxWidth: null
|
20
|
+
} : {};
|
21
|
+
return {
|
22
|
+
drawerType: this.props.type,
|
23
|
+
headerShown: false,
|
24
|
+
gestureHandlerProps: {
|
25
|
+
enabled: !this.props.hide
|
26
|
+
},
|
27
|
+
drawerStyle: {
|
28
|
+
backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor,
|
29
|
+
...widthStyle
|
30
|
+
}
|
31
|
+
};
|
23
32
|
}
|
24
33
|
}, /*#__PURE__*/React.createElement(Drawer.Screen, {
|
25
34
|
name: "pages"
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","createDrawerNavigator","ThemeVariables","Drawer","AppDrawerNavigator","Component","constructor","props","render","createElement","Navigator","initialRouteName","drawerContent","content","useLegacyImplementation","screenOptions","drawerType","type","headerShown","gestureHandlerProps","enabled","hide","drawerStyle","backgroundColor","INSTANCE","pageContentBgColor","Screen","name","_props","rootComponent"],"sources":["drawer.navigator.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { createDrawerNavigator } from '@react-navigation/drawer';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nconst Drawer = createDrawerNavigator();\n\ninterface AppDrawerNavigatorProps {\n content: (props: any) => ReactNode;\n hide: boolean,\n type: any;\n rootComponent: React.ReactNode;\n}\n\nclass AppDrawerNavigator extends React.Component<AppDrawerNavigatorProps, any, any> {\n\n constructor(props: AppDrawerNavigatorProps) {\n super(props);\n }\n\n render(){\n return (<Drawer.Navigator\n initialRouteName=\"pages\"\n drawerContent={this.props.content}\n useLegacyImplementation={false}\n screenOptions={{\n drawerType: this.props.type,\n headerShown: false,\n gestureHandlerProps: { enabled: !this.props.hide },\n drawerStyle: { backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor }\n }}>\n <Drawer.Screen name=\"pages\">\n {(_props) => this.props.rootComponent}\n </Drawer.Screen>\n </Drawer.Navigator>);\n }\n}\n\nexport default AppDrawerNavigator;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,qBAAqB,QAAQ,0BAA0B;
|
1
|
+
{"version":3,"names":["React","createDrawerNavigator","getDrawerStatusFromState","ThemeVariables","Drawer","AppDrawerNavigator","Component","constructor","props","render","createElement","Navigator","initialRouteName","drawerContent","content","useLegacyImplementation","screenOptions","navigation","widthStyle","drawerWidth","getState","width","maxWidth","drawerType","type","headerShown","gestureHandlerProps","enabled","hide","drawerStyle","backgroundColor","INSTANCE","pageContentBgColor","Screen","name","_props","rootComponent"],"sources":["drawer.navigator.tsx"],"sourcesContent":["import React, { ReactNode } from 'react';\nimport { createDrawerNavigator, getDrawerStatusFromState } from '@react-navigation/drawer';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\nconst Drawer = createDrawerNavigator();\n\ninterface AppDrawerNavigatorProps {\n content: (props: any) => ReactNode;\n hide: boolean,\n drawerWidth: any;\n type: any;\n rootComponent: React.ReactNode;\n}\n\nclass AppDrawerNavigator extends React.Component<AppDrawerNavigatorProps, any, any> {\n\n constructor(props: AppDrawerNavigatorProps) {\n super(props);\n }\n\n render(){\n return (<Drawer.Navigator\n initialRouteName=\"pages\"\n drawerContent={this.props.content}\n useLegacyImplementation={false}\n screenOptions={({navigation})=> {\n const widthStyle = (this.props.drawerWidth && getDrawerStatusFromState(navigation.getState()) === 'open' ? {width: this.props.drawerWidth, maxWidth: null} : {})\n return {\n drawerType: this.props.type,\n headerShown: false,\n gestureHandlerProps: { enabled: !this.props.hide },\n drawerStyle: { backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor, ...widthStyle}}\n }}>\n <Drawer.Screen name=\"pages\">\n {(_props) => this.props.rootComponent}\n </Drawer.Screen>\n </Drawer.Navigator>);\n }\n}\n\nexport default AppDrawerNavigator;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAqB,OAAO;AACxC,SAASC,qBAAqB,EAAEC,wBAAwB,QAAQ,0BAA0B;AAC1F,OAAOC,cAAc,MAAM,kDAAkD;AAC7E,MAAMC,MAAM,GAAGH,qBAAqB,CAAC,CAAC;AAUtC,MAAMI,kBAAkB,SAASL,KAAK,CAACM,SAAS,CAAoC;EAElFC,WAAWA,CAACC,KAA8B,EAAE;IAC1C,KAAK,CAACA,KAAK,CAAC;EACd;EAEAC,MAAMA,CAAA,EAAE;IACN,oBAAQT,KAAA,CAAAU,aAAA,CAACN,MAAM,CAACO,SAAS;MACvBC,gBAAgB,EAAC,OAAO;MACxBC,aAAa,EAAE,IAAI,CAACL,KAAK,CAACM,OAAQ;MAClCC,uBAAuB,EAAE,KAAM;MAC/BC,aAAa,EAAEA,CAAC;QAACC;MAAU,CAAC,KAAI;QAC9B,MAAMC,UAAU,GAAI,IAAI,CAACV,KAAK,CAACW,WAAW,IAAIjB,wBAAwB,CAACe,UAAU,CAACG,QAAQ,CAAC,CAAC,CAAC,KAAK,MAAM,GAAG;UAACC,KAAK,EAAE,IAAI,CAACb,KAAK,CAACW,WAAW;UAAEG,QAAQ,EAAE;QAAI,CAAC,GAAG,CAAC,CAAE;QAChK,OAAO;UACLC,UAAU,EAAE,IAAI,CAACf,KAAK,CAACgB,IAAI;UAC3BC,WAAW,EAAE,KAAK;UAClBC,mBAAmB,EAAE;YAAEC,OAAO,EAAE,CAAC,IAAI,CAACnB,KAAK,CAACoB;UAAK,CAAC;UAClDC,WAAW,EAAE;YAAEC,eAAe,EAAG3B,cAAc,CAAC4B,QAAQ,CAACC,kBAAkB;YAAE,GAAGd;UAAU;QAAC,CAAC;MAChG;IAAE,gBACFlB,KAAA,CAAAU,aAAA,CAACN,MAAM,CAAC6B,MAAM;MAACC,IAAI,EAAC;IAAO,GACvBC,MAAM,IAAK,IAAI,CAAC3B,KAAK,CAAC4B,aACX,CACC,CAAC;EACrB;AACF;AAEA,eAAe/B,kBAAkB","ignoreList":[]}
|
@@ -38,10 +38,6 @@ class AppModalService {
|
|
38
38
|
showLastModal() {
|
39
39
|
this.modalOptions = this.modalsOpened.length ? this.modalsOpened[this.modalsOpened.length - 1] : {};
|
40
40
|
this.refresh();
|
41
|
-
// widgets in dialog are not accessible. Hence adding setTimeout
|
42
|
-
setTimeout(() => {
|
43
|
-
this.modalOptions.onOpen && this.modalOptions.onOpen();
|
44
|
-
}, 500);
|
45
41
|
this.setBackButtonPress();
|
46
42
|
}
|
47
43
|
refresh() {
|
@@ -53,6 +49,10 @@ class AppModalService {
|
|
53
49
|
options.elevationIndex = parseInt(this.getAppConfig().app.toastsOpened + this.modalsOpened.length + 1);
|
54
50
|
this.modalsOpened.push(options);
|
55
51
|
this.showLastModal();
|
52
|
+
// widgets in dialog are not accessible. Hence adding setTimeout
|
53
|
+
setTimeout(() => {
|
54
|
+
this.modalOptions.onOpen && this.modalOptions.onOpen();
|
55
|
+
}, 500);
|
56
56
|
}
|
57
57
|
}
|
58
58
|
hideModal(options) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["BackHandler","injector","isAndroid","isWebPreviewMode","AppModalService","constructor","_defineProperty","modalsOpened","length","hideModal","clearBackButtonPress","removeEventListener","handleBackButtonPress","setBackButtonPress","addEventListener","getAppConfig","appConfig","get","showLastModal","modalOptions","refresh","
|
1
|
+
{"version":3,"names":["BackHandler","injector","isAndroid","isWebPreviewMode","AppModalService","constructor","_defineProperty","modalsOpened","length","hideModal","clearBackButtonPress","removeEventListener","handleBackButtonPress","setBackButtonPress","addEventListener","getAppConfig","appConfig","get","showLastModal","modalOptions","refresh","showModal","options","i","findIndex","o","elevationIndex","parseInt","app","toastsOpened","push","setTimeout","onOpen","Promise","resolve","then","animatedRefs","triggerExit","onClose","splice","appModalService"],"sources":["app-modal.service.tsx"],"sourcesContent":["import { BackHandler } from \"react-native\";\n\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport { ModalOptions, ModalService } from '@wavemaker/app-rn-runtime/core/modal.service';\nimport { isAndroid, isWebPreviewMode } from \"@wavemaker/app-rn-runtime/core/utils\";\n\nclass AppModalService implements ModalService {\n public modalOptions = {} as ModalOptions;\n\n public modalsOpened = [] as ModalOptions[];\n public appConfig: any;\n\n animatedRefs: any = [];\n\n private clearBackButtonPress() {\n if (isAndroid() && !isWebPreviewMode()) {\n BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonPress);\n }\n }\n\n private setBackButtonPress() {\n this.clearBackButtonPress();\n if (isAndroid() && !isWebPreviewMode() && this.modalsOpened.length > 0) {\n BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonPress);\n }\n }\n\n private handleBackButtonPress = () => {\n if (this.modalsOpened.length) {\n this.hideModal();\n return true;\n }\n return false;\n }\n\n private getAppConfig() {\n if (!this.appConfig) {\n this.appConfig = injector.get<AppConfig>('APP_CONFIG');\n }\n return this.appConfig;\n }\n\n private showLastModal() {\n this.modalOptions = this.modalsOpened.length ? this.modalsOpened[this.modalsOpened.length - 1] : {} as ModalOptions;\n this.refresh();\n this.setBackButtonPress();\n }\n\n public refresh() {\n this.getAppConfig().refresh();\n }\n\n public showModal(options: ModalOptions) {\n const i = this.modalsOpened.findIndex(o => o === options);\n if (i < 0) {\n options.elevationIndex = parseInt(this.getAppConfig().app.toastsOpened + this.modalsOpened.length + 1);\n this.modalsOpened.push(options);\n this.showLastModal();\n // widgets in dialog are not accessible. Hence adding setTimeout\n setTimeout(() => {\n this.modalOptions.onOpen && this.modalOptions.onOpen();\n },500);\n }\n }\n\n public hideModal(options?: ModalOptions) {\n const i = options ? this.modalsOpened.findIndex(o => o === options) : (this.modalsOpened.length - 1);\n if (i >= 0) {\n Promise.resolve()\n .then(() => this.modalsOpened.length > 1 && this.animatedRefs && this.animatedRefs[i].triggerExit())\n .then(() => {\n const o = this.modalsOpened[i];\n return o && o.onClose && o.onClose();\n })\n .then(() => this.modalsOpened.splice(i, 1))\n .then(() => this.showLastModal());\n }\n this.clearBackButtonPress();\n }\n}\n\nconst appModalService = new AppModalService();\n\nexport default appModalService;\n"],"mappings":";;;AAAA,SAASA,WAAW,QAAQ,cAAc;AAE1C,OAAOC,QAAQ,MAAM,yCAAyC;AAG9D,SAASC,SAAS,EAAEC,gBAAgB,QAAQ,sCAAsC;AAElF,MAAMC,eAAe,CAAyB;EAAAC,YAAA;IAAAC,eAAA,uBACpB,CAAC,CAAC;IAAAA,eAAA,uBAEF,EAAE;IAAAA,eAAA;IAAAA,eAAA,uBAGJ,EAAE;IAAAA,eAAA,gCAeU,MAAM;MACpC,IAAI,IAAI,CAACC,YAAY,CAACC,MAAM,EAAE;QAC5B,IAAI,CAACC,SAAS,CAAC,CAAC;QAChB,OAAO,IAAI;MACb;MACA,OAAO,KAAK;IACd,CAAC;EAAA;EAnBOC,oBAAoBA,CAAA,EAAG;IAC7B,IAAIR,SAAS,CAAC,CAAC,IAAI,CAACC,gBAAgB,CAAC,CAAC,EAAE;MACtCH,WAAW,CAACW,mBAAmB,CAAC,mBAAmB,EAAE,IAAI,CAACC,qBAAqB,CAAC;IAClF;EACF;EAEQC,kBAAkBA,CAAA,EAAG;IAC3B,IAAI,CAACH,oBAAoB,CAAC,CAAC;IAC3B,IAAIR,SAAS,CAAC,CAAC,IAAI,CAACC,gBAAgB,CAAC,CAAC,IAAI,IAAI,CAACI,YAAY,CAACC,MAAM,GAAG,CAAC,EAAE;MACtER,WAAW,CAACc,gBAAgB,CAAC,mBAAmB,EAAE,IAAI,CAACF,qBAAqB,CAAC;IAC/E;EACF;EAUQG,YAAYA,CAAA,EAAG;IACrB,IAAI,CAAC,IAAI,CAACC,SAAS,EAAE;MACnB,IAAI,CAACA,SAAS,GAAGf,QAAQ,CAACgB,GAA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VU,OAAO,CAACC,OAAO,CAAC,CAAC,CACdC,IAAI,CAAC,MAAM,IAAI,CAAC5B,YAAY,CAACC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC4B,YAAY,IAAI,IAAI,CAACA,YAAY,CAACb,CAAC,CAAC,CAACc,WAAW,CAAC,CAAC,CAAC,CACnGF,IAAI,CAAC,MAAM;QACV,MAAMV,CAAC,GAAG,IAAI,CAAClB,YAAY,CAACgB,CAAC,CAAC;QAC9B,OAAOE,CAAC,IAAIA,CAAC,CAACa,OAAO,IAAIb,CAAC,CAACa,OAAO,CAAC,CAAC;MACtC,CAAC,CAAC,CACDH,IAAI,CAAC,MAAM,IAAI,CAAC5B,YAAY,CAACgC,MAAM,CAAChB,CAAC,EAAE,CAAC,CAAC,CAAC,CAC1CY,IAAI,CAAC,MAAM,IAAI,CAACjB,aAAa,CAAC,CAAC,CAAC;IACrC;IACA,IAAI,CAACR,oBAAoB,CAAC,CAAC;EAC/B;AACJ;AAEA,MAAM8B,eAAe,GAAG,IAAIpC,eAAe,CAAC,CAAC;AAE7C,eAAeoC,eAAe","ignoreList":[]}
|
@@ -8,6 +8,7 @@ import networkService from '@wavemaker/app-rn-runtime/core/network.service';
|
|
8
8
|
import injector from '@wavemaker/app-rn-runtime/core/injector';
|
9
9
|
import StorageService from '@wavemaker/app-rn-runtime/core/storage.service';
|
10
10
|
import WebProcessService from './webprocess.service';
|
11
|
+
import { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';
|
11
12
|
var USER_ROLE = /*#__PURE__*/function (USER_ROLE) {
|
12
13
|
USER_ROLE["EVERYONE"] = "Everyone";
|
13
14
|
USER_ROLE["ANONYMOUS"] = "Anonymous";
|
@@ -27,6 +28,19 @@ class AppSecurityService {
|
|
27
28
|
_defineProperty(this, "baseUrl", '');
|
28
29
|
_defineProperty(this, "defaultSecurityConfig", void 0);
|
29
30
|
_defineProperty(this, "landingPage", '');
|
31
|
+
_defineProperty(this, "getRegex", str => {
|
32
|
+
const wm_xsrf_token_index = str.indexOf('wm_xsrf_token') + 13; // 13 is the length of 'wm_xsrf_token' string
|
33
|
+
let index = wm_xsrf_token_index;
|
34
|
+
while (str[index] !== ':') {
|
35
|
+
index++;
|
36
|
+
}
|
37
|
+
const regExp = str.substring(wm_xsrf_token_index, index);
|
38
|
+
return new RegExp(regExp, "g");
|
39
|
+
});
|
40
|
+
_defineProperty(this, "formateData", data => {
|
41
|
+
const regex = this.getRegex(data);
|
42
|
+
return JSON.parse(data.replace(regex, "\""));
|
43
|
+
});
|
30
44
|
axios.interceptors.request.use(config => this.onBeforeServiceCall(config));
|
31
45
|
}
|
32
46
|
onBeforeServiceCall(config) {
|
@@ -90,6 +104,14 @@ class AppSecurityService {
|
|
90
104
|
});
|
91
105
|
}
|
92
106
|
load(baseURL) {
|
107
|
+
if (isWebPreviewMode()) {
|
108
|
+
var _document;
|
109
|
+
const token = (_document = document) === null || _document === void 0 || (_document = _document.cookie) === null || _document === void 0 ? void 0 : _document.split(';').filter(item => item.includes('wm_xsrf_token'));
|
110
|
+
if (token && token.length > 0) {
|
111
|
+
const wm_xsrf_token = token[0].split('=')[1];
|
112
|
+
wm_xsrf_token && StorageService.setItem(XSRF_COOKIE_NAME, wm_xsrf_token);
|
113
|
+
}
|
114
|
+
}
|
93
115
|
return Promise.resolve().then(() => {
|
94
116
|
if (networkService.isConnected()) {
|
95
117
|
return axios.get(baseURL + '/services/security/info').then(response => response.data);
|
@@ -142,7 +164,9 @@ class AppSecurityService {
|
|
142
164
|
setTimeout(() => {
|
143
165
|
WebProcessService.execute('LOGIN', '/services/security/ssologin', false, true).then(output => {
|
144
166
|
if (output) {
|
145
|
-
|
167
|
+
if (output.data) {
|
168
|
+
return this.formateData(`${output.data}`);
|
169
|
+
}
|
146
170
|
}
|
147
171
|
return Promise.reject();
|
148
172
|
}).then(output => {
|
@@ -171,7 +195,23 @@ class AppSecurityService {
|
|
171
195
|
appLogout(options) {
|
172
196
|
return axios.post(options.baseURL + '/j_spring_security_logout', null, {
|
173
197
|
withCredentials: true
|
174
|
-
}).catch(() => {}).then(
|
198
|
+
}).catch(() => {}).then(response => {
|
199
|
+
var _response$data;
|
200
|
+
if (response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.result) {
|
201
|
+
if (isWebPreviewMode()) {
|
202
|
+
location.href = response.data.result;
|
203
|
+
return new Promise(r => setTimeout(r, 5000));
|
204
|
+
} else {
|
205
|
+
var _response$data2;
|
206
|
+
return axios.get(`${response === null || response === void 0 || (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.result}`, {
|
207
|
+
withCredentials: true
|
208
|
+
});
|
209
|
+
}
|
210
|
+
}
|
211
|
+
return Promise.reject();
|
212
|
+
}).catch(e => {
|
213
|
+
console.error(e);
|
214
|
+
}).then(() => {
|
175
215
|
this.isLoggedIn = false;
|
176
216
|
this.redirectToLogin();
|
177
217
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Platform","axios","each","includes","networkService","injector","StorageService","WebProcessService","USER_ROLE","authCookieStr","XSRF_COOKIE_NAME","xsrf_header_name","AppSecurityService","constructor","_defineProperty","interceptors","request","use","config","onBeforeServiceCall","appConfig","getAppConfig","baseUrl","url","getXsrfToken","then","token","_config$url","startsWith","headers","Promise","resolve","getItem","xsrf_token","get","navigateToLandingPage","_this$appConfig$curre","_this$appConfig$logge","currentPage","goToPage","loggedInUser","landingPage","setTimeout","_this$appConfig$curre2","openUrl","appLogin","options","payload","formData","value","name","encodeURIComponent","defaults","withCredentials","post","baseURL","response","xsrfCookieValue","data","setItem","isLoggedIn","load","userData","getLoggedInUserDetails","useDefaultSuccessHandler","app","triggerStartUpVariables","isConnected","getServiceDefinitions","defaultSecurityConfig","details","securityConfig","isSecurityEnabled","securityEnabled","authenticated","_appConfig$appPropert","isAuthenticated","roles","userInfo","userRoles","userName","id","userId","tenantId","userAttributes","dataSet","appProperties","homePage","redirectToLogin","redirectTo","_this$securityConfig","loginConfig","type","authUrl","OS","window","parent","location","href","execute","output","JSON","parse","replace","reject","refresh","_this$securityConfig$","_this$appConfig$curre3","loginPage","pageName","appLogout","catch","canUserAccessPage","_this$securityConfig2","res","status","matchRoles","widgetRoles","some","item","hasAccessToWidget","_this$loggedInUser$da","_this$loggedInUser$da2","_this$loggedInUser$da3","_this$loggedInUser$da4","widgetRolesArr","split","EVERYONE","ANONYMOUS","AUTHENTICATED","appSecurityService"],"sources":["app-security.service.tsx"],"sourcesContent":["import { Platform } from 'react-native';\nimport axios, { InternalAxiosRequestConfig, AxiosResponse } from 'axios';\nimport { each, includes } from 'lodash';\n\nimport networkService from '@wavemaker/app-rn-runtime/core/network.service';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport StorageService from '@wavemaker/app-rn-runtime/core/storage.service';\nimport { SecurityService } from '@wavemaker/app-rn-runtime/core/security.service';\n\nimport WebProcessService from './webprocess.service';\n\ndeclare const window: any;\n\ninterface LoggedInUserConfig {\n isAuthenticated: Boolean;\n isSecurityEnabled: Boolean;\n roles: Array<string>;\n name: String;\n id: String;\n tenantId: String;\n userAttributes: any;\n landingPage: string;\n}\n\nenum USER_ROLE {\n EVERYONE = 'Everyone',\n ANONYMOUS = 'Anonymous',\n AUTHENTICATED = 'Authenticated'\n}\n\nconst authCookieStr = 'AUTH_COOKIE';\nconst XSRF_COOKIE_NAME = 'wm_xsrf_token';\nconst xsrf_header_name = 'X-WM-XSRF-TOKEN';\n\nclass AppSecurityService implements SecurityService {\n\n securityConfig: any;\n isLoggedIn = false;\n loggedInUser: any = {};\n token: any;\n appConfig: any;\n baseUrl: string = '';\n defaultSecurityConfig: any;\n landingPage = '';\n\n constructor() {\n axios.interceptors.request.use((config: InternalAxiosRequestConfig) => this.onBeforeServiceCall(config));\n }\n\n onBeforeServiceCall(config: InternalAxiosRequestConfig) {\n if (!this.appConfig) {\n this.appConfig = this.getAppConfig();\n this.baseUrl = this.appConfig.url;\n }\n return this.getXsrfToken().then((token: string) => {\n if (config.url?.startsWith(this.baseUrl) && token) {\n if(config.headers) config.headers[xsrf_header_name] = token;\n }\n return config\n });\n }\n\n private getXsrfToken(): Promise<string> {\n if (this.token) {\n return Promise.resolve(this.token);\n }\n return StorageService.getItem(XSRF_COOKIE_NAME).then(xsrf_token => {\n this.token = xsrf_token;\n return this.token;\n });\n }\n\n private getAppConfig() {\n return injector.get<AppConfig>('APP_CONFIG');\n }\n\n public navigateToLandingPage() {\n this.appConfig.currentPage?.goToPage(\n this.appConfig.loggedInUser?.landingPage \n || this.appConfig.landingPage \n || 'Main', null, true);\n if (this.landingPage) {\n const landingPage = this.landingPage;\n this.landingPage = '';\n setTimeout(() => {\n this.appConfig.currentPage?.openUrl(landingPage);\n }, 100);\n }\n }\n\n public appLogin(options: any) {\n // encode all parameters\n let payload = '';\n each(options.formData, function (value, name) {\n payload += (payload ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value);\n });\n axios.defaults.withCredentials = true;\n return axios.post(options.baseURL + '/j_spring_security_check', payload, {\n withCredentials: true,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded'\n }}).then((response: AxiosResponse) => {\n const xsrfCookieValue = response.data ? response.data[XSRF_COOKIE_NAME] : '';\n this.token = xsrfCookieValue;\n StorageService.setItem(XSRF_COOKIE_NAME, xsrfCookieValue);\n this.isLoggedIn = true;\n }).then(() => this.load(options.baseURL))\n .then(async () => {\n const userData = await this.getLoggedInUserDetails(options.baseURL, options.useDefaultSuccessHandler);\n await this.appConfig.app.triggerStartUpVariables();\n return userData;\n });\n }\n\n public load(baseURL: string) {\n return Promise.resolve().then(() => {\n if (networkService.isConnected()) {\n return axios.get(baseURL + '/services/security/info')\n .then((response: AxiosResponse) => response.data);\n }\n return this.appConfig.getServiceDefinitions(this.appConfig.url)\n .then(() => Promise.resolve(this.defaultSecurityConfig));\n }).then((details: any) => {\n const loggedInUser = {} as LoggedInUserConfig;\n this.securityConfig = details || {};\n this.securityConfig.isSecurityEnabled = !!details?.securityEnabled;\n const appConfig = this.appConfig;\n if (typeof details !== 'string' && (!details.securityEnabled || details.authenticated)) {\n if (details.authenticated) {\n loggedInUser.isAuthenticated = details.authenticated;\n loggedInUser.isSecurityEnabled = details.authenticated;\n loggedInUser.roles = details.userInfo.userRoles;\n loggedInUser.name = details.userInfo.userName;\n loggedInUser.id = details.userInfo.userId;\n loggedInUser.tenantId = details.userInfo.tenantId;\n loggedInUser.userAttributes = details.userInfo.userAttributes;\n loggedInUser.landingPage = details.userInfo.landingPage;\n appConfig.loggedInUser = loggedInUser;\n this.loggedInUser.dataSet = loggedInUser;\n appConfig.landingPage = appConfig.appProperties?.homePage;\n }\n return appConfig.getServiceDefinitions(appConfig.url)\n .then(() => {\n return details;\n });\n } else {\n return appConfig.getServiceDefinitions(appConfig.url)\n .then(() => {\n this.redirectToLogin();\n });\n }\n });\n }\n\n private getLoggedInUserDetails(baseURL: string, useDefaultSuccessHandler: boolean = true) {\n if (!baseURL) {\n this.loggedInUser = {};\n return Promise.resolve({});\n }\n return this.load(baseURL);\n }\n\n \n public redirectToLogin(redirectTo?: string) {\n if (this.securityConfig?.loginConfig?.type === 'SSO') {\n const authUrl = this.appConfig.url + '/services/security/ssologin';\n if (Platform.OS === 'web') {\n (window.parent || window).location.href = authUrl;\n } else {\n setTimeout(() => {\n WebProcessService.execute('LOGIN', '/services/security/ssologin', false, true)\n .then((output: any) => {\n if (output) {\n return JSON.parse(output.data && output.data.replace(/"/g, \"\\\"\"));\n }\n return Promise.reject();\n }).then((output: any) => {\n if (output[XSRF_COOKIE_NAME]) {\n this.token = output[XSRF_COOKIE_NAME];\n StorageService.setItem(XSRF_COOKIE_NAME, output[XSRF_COOKIE_NAME]);\n }\n }).then(() => {\n this.appConfig.refresh(true);\n }).then(() => this.load(this.baseUrl)).then(() => {\n return this.getLoggedInUserDetails(this.baseUrl);\n });\n }, 1000);\n }\n } else {\n const loginPage = this.securityConfig.loginConfig?.pageName || 'Login';\n if (redirectTo && !redirectTo.startsWith('#/'+ loginPage)) {\n this.landingPage = redirectTo;\n }\n injector.get<AppConfig>('APP_CONFIG').landingPage = loginPage;\n this.appConfig.currentPage?.goToPage(loginPage, null, true);\n }\n this.appConfig.refresh();\n }\n\n public appLogout(options: any) {\n return axios.post(options.baseURL + '/j_spring_security_logout', null, {\n withCredentials: true\n }).catch(() => {}).then(() => {\n this.isLoggedIn = false;\n this.redirectToLogin();\n });\n }\n\n public canUserAccessPage(pageName: string) {\n if (this.baseUrl && this.securityConfig?.isSecurityEnabled) {\n return axios.get(this.baseUrl + `/pages/${pageName}/${pageName}.html`)\n .catch((res) => res)\n .then((res) => res.status === 200 || res.status === 304); \n } else {\n return Promise.resolve(true);\n }\n }\n\n private matchRoles(widgetRoles: Array<String>, userRoles: Array<String>) {\n return widgetRoles.some(function (item) {\n return includes(userRoles, item);\n });\n }\n\n public hasAccessToWidget(widgetRoles: String) {\n const widgetRolesArr = widgetRoles.split(',');\n // access the widget when 'Everyone' is chosen\n if (includes(widgetRolesArr, USER_ROLE.EVERYONE)) {\n return true;\n }\n\n // access the widget when 'Anonymous' is chosen and user is not authenticated\n if (includes(widgetRolesArr, USER_ROLE.ANONYMOUS) && !this.loggedInUser.dataSet?.isAuthenticated) {\n return true;\n }\n\n // access the widget when 'Only Authenticated Users' is chosen and user is authenticated\n if (includes(widgetRolesArr, USER_ROLE.AUTHENTICATED) && this.loggedInUser.dataSet?.isAuthenticated) {\n return true;\n }\n\n // access the widget when widget role and logged in user role matches\n return this.loggedInUser.dataSet?.isAuthenticated && this.matchRoles(widgetRolesArr, this.loggedInUser.dataSet?.roles);\n }\n}\n\nconst appSecurityService = new AppSecurityService();\n\nexport default appSecurityService;\n"],"mappings":";;;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,KAAK,MAAqD,OAAO;AACxE,SAASC,IAAI,EAAEC,QAAQ,QAAQ,QAAQ;AAEvC,OAAOC,cAAc,MAAM,gDAAg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Service","injector","StorageService","WebProcessService","isWebPreviewMode","USER_ROLE","authCookieStr","XSRF_COOKIE_NAME","xsrf_header_name","AppSecurityService","constructor","_defineProperty","str","wm_xsrf_token_index","indexOf","index","regExp","substring","RegExp","data","regex","getRegex","JSON","parse","replace","interceptors","request","use","config","onBeforeServiceCall","appConfig","getAppConfig","baseUrl","url","getXsrfToken","then","token","_config$url","startsWith","headers","Promise","resolve","getItem","xsrf_token","get","navigateToLandingPage","_this$appConfig$curre","_this$appConfig$logge","currentPage","goToPage","loggedInUser","landingPage","setTimeout","_this$appConfig$curre2","openUrl","appLogin","options","payload","formData","value","name","encodeURIComponent","defaults","withCredentials","post","baseURL","response","xsrfCookieValue","setItem","isLoggedIn","load","userData","getLoggedInUserDetails","useDefaultSuccessHandler","app","triggerStartUpVariables","_document","document","cookie","split","filter","item","length","wm_xsrf_token","isConnected","getServiceDefinitions","defaultSecurityConfig","details","securityConfig","isSecurityEnabled","securityEnabled","authenticated","_appConfig$appPropert","isAuthenticated","roles","userInfo","userRoles","userName","id","userId","tenantId","userAttributes","dataSet","appProperties","homePage","redirectToLogin","redirectTo","_this$securityConfig","loginConfig","type","authUrl","OS","window","parent","location","href","execute","output","formateData","reject","refresh","_this$securityConfig$","_this$appConfig$curre3","loginPage","pageName","appLogout","catch","_response$data","result","r","_response$data2","e","console","error","canUserAccessPage","_this$securityConfig2","res","status","matchRoles","widgetRoles","some","hasAccessToWidget","_this$loggedInUser$da","_this$loggedInUser$da2","_this$loggedInUser$da3","_this$loggedInUser$da4","widgetRolesArr","EVERYONE","ANONYMOUS","AUTHENTICATED","appSecurityService"],"sources":["app-security.service.tsx"],"sourcesContent":["import { Platform } from 'react-native';\nimport axios, { InternalAxiosRequestConfig, AxiosResponse } from 'axios';\nimport { each, includes } from 'lodash';\n\nimport networkService from '@wavemaker/app-rn-runtime/core/network.service';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport StorageService from '@wavemaker/app-rn-runtime/core/storage.service';\nimport { SecurityService } from '@wavemaker/app-rn-runtime/core/security.service';\n\nimport WebProcessService from './webprocess.service';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\n\ndeclare const window: any;\n\ninterface LoggedInUserConfig {\n isAuthenticated: Boolean;\n isSecurityEnabled: Boolean;\n roles: Array<string>;\n name: String;\n id: String;\n tenantId: String;\n userAttributes: any;\n landingPage: string;\n}\n\nenum USER_ROLE {\n EVERYONE = 'Everyone',\n ANONYMOUS = 'Anonymous',\n AUTHENTICATED = 'Authenticated'\n}\n\nconst authCookieStr = 'AUTH_COOKIE';\nconst XSRF_COOKIE_NAME = 'wm_xsrf_token';\nconst xsrf_header_name = 'X-WM-XSRF-TOKEN';\n\nclass AppSecurityService implements SecurityService {\n\n securityConfig: any;\n isLoggedIn = false;\n loggedInUser: any = {};\n token: any;\n appConfig: any;\n baseUrl: string = '';\n defaultSecurityConfig: any;\n landingPage = '';\n\n constructor() {\n axios.interceptors.request.use((config: InternalAxiosRequestConfig) => this.onBeforeServiceCall(config));\n }\n\n getRegex = (str: string) =>{\n const wm_xsrf_token_index = str.indexOf('wm_xsrf_token') + 13; // 13 is the length of 'wm_xsrf_token' string\n let index = wm_xsrf_token_index;\n\n while(str[index] !== ':'){\n index++;\n }\n \n const regExp = str.substring(wm_xsrf_token_index, index);\n return new RegExp(regExp, \"g\");\n }\n \n formateData = (data: string) => {\n const regex = this.getRegex(data)\n return JSON.parse(data.replace(regex, \"\\\"\"));\n }\n\n onBeforeServiceCall(config: InternalAxiosRequestConfig) {\n if (!this.appConfig) {\n this.appConfig = this.getAppConfig();\n this.baseUrl = this.appConfig.url;\n }\n return this.getXsrfToken().then((token: string) => {\n if (config.url?.startsWith(this.baseUrl) && token) {\n if(config.headers) config.headers[xsrf_header_name] = token;\n }\n return config\n });\n }\n\n private getXsrfToken(): Promise<string> {\n if (this.token) {\n return Promise.resolve(this.token);\n }\n return StorageService.getItem(XSRF_COOKIE_NAME).then(xsrf_token => {\n this.token = xsrf_token;\n return this.token;\n });\n }\n\n private getAppConfig() {\n return injector.get<AppConfig>('APP_CONFIG');\n }\n\n public navigateToLandingPage() {\n this.appConfig.currentPage?.goToPage(\n this.appConfig.loggedInUser?.landingPage \n || this.appConfig.landingPage \n || 'Main', null, true);\n if (this.landingPage) {\n const landingPage = this.landingPage;\n this.landingPage = '';\n setTimeout(() => {\n this.appConfig.currentPage?.openUrl(landingPage);\n }, 100);\n }\n }\n\n public appLogin(options: any) {\n // encode all parameters\n let payload = '';\n each(options.formData, function (value, name) {\n payload += (payload ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value);\n });\n axios.defaults.withCredentials = true;\n return axios.post(options.baseURL + '/j_spring_security_check', payload, {\n withCredentials: true,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded'\n }}).then((response: AxiosResponse) => {\n const xsrfCookieValue = response.data ? response.data[XSRF_COOKIE_NAME] : '';\n this.token = xsrfCookieValue;\n StorageService.setItem(XSRF_COOKIE_NAME, xsrfCookieValue);\n this.isLoggedIn = true;\n }).then(() => this.load(options.baseURL))\n .then(async () => {\n const userData = await this.getLoggedInUserDetails(options.baseURL, options.useDefaultSuccessHandler);\n await this.appConfig.app.triggerStartUpVariables();\n return userData;\n });\n }\n\n public load(baseURL: string) {\n if (isWebPreviewMode()) {\n const token = document?.cookie?.split(';').filter(item => item.includes('wm_xsrf_token'))\n if (token && token.length > 0) {\n const wm_xsrf_token = token[0].split('=')[1];\n wm_xsrf_token && StorageService.setItem(XSRF_COOKIE_NAME, wm_xsrf_token);\n }\n }\n\n return Promise.resolve().then(() => {\n if (networkService.isConnected()) {\n return axios.get(baseURL + '/services/security/info')\n .then((response: AxiosResponse) => response.data);\n }\n return this.appConfig.getServiceDefinitions(this.appConfig.url)\n .then(() => Promise.resolve(this.defaultSecurityConfig));\n }).then((details: any) => {\n const loggedInUser = {} as LoggedInUserConfig;\n this.securityConfig = details || {};\n this.securityConfig.isSecurityEnabled = !!details?.securityEnabled;\n const appConfig = this.appConfig;\n if (typeof details !== 'string' && (!details.securityEnabled || details.authenticated)) {\n if (details.authenticated) {\n loggedInUser.isAuthenticated = details.authenticated;\n loggedInUser.isSecurityEnabled = details.authenticated;\n loggedInUser.roles = details.userInfo.userRoles;\n loggedInUser.name = details.userInfo.userName;\n loggedInUser.id = details.userInfo.userId;\n loggedInUser.tenantId = details.userInfo.tenantId;\n loggedInUser.userAttributes = details.userInfo.userAttributes;\n loggedInUser.landingPage = details.userInfo.landingPage;\n appConfig.loggedInUser = loggedInUser;\n this.loggedInUser.dataSet = loggedInUser;\n appConfig.landingPage = appConfig.appProperties?.homePage;\n }\n return appConfig.getServiceDefinitions(appConfig.url)\n .then(() => {\n return details;\n });\n } else {\n return appConfig.getServiceDefinitions(appConfig.url)\n .then(() => {\n this.redirectToLogin();\n });\n }\n });\n }\n\n private getLoggedInUserDetails(baseURL: string, useDefaultSuccessHandler: boolean = true) {\n if (!baseURL) {\n this.loggedInUser = {};\n return Promise.resolve({});\n }\n return this.load(baseURL);\n }\n\n \n public redirectToLogin(redirectTo?: string) {\n if (this.securityConfig?.loginConfig?.type === 'SSO') {\n const authUrl = this.appConfig.url + '/services/security/ssologin';\n if (Platform.OS === 'web') {\n (window.parent || window).location.href = authUrl;\n } else {\n setTimeout(() => {\n WebProcessService.execute('LOGIN', '/services/security/ssologin', false, true)\n .then((output: any) => {\n if (output) {\n if(output.data){\n return this.formateData(`${output.data}`);\n }\n }\n return Promise.reject();\n }).then((output: any) => {\n if (output[XSRF_COOKIE_NAME]) {\n this.token = output[XSRF_COOKIE_NAME];\n StorageService.setItem(XSRF_COOKIE_NAME, output[XSRF_COOKIE_NAME]);\n }\n }).then(() => {\n this.appConfig.refresh(true);\n }).then(() => this.load(this.baseUrl)).then(() => {\n return this.getLoggedInUserDetails(this.baseUrl);\n });\n }, 1000);\n }\n } else {\n const loginPage = this.securityConfig.loginConfig?.pageName || 'Login';\n if (redirectTo && !redirectTo.startsWith('#/'+ loginPage)) {\n this.landingPage = redirectTo;\n }\n injector.get<AppConfig>('APP_CONFIG').landingPage = loginPage;\n this.appConfig.currentPage?.goToPage(loginPage, null, true);\n }\n this.appConfig.refresh();\n }\n\n public appLogout(options: any) {\n return axios.post(options.baseURL + '/j_spring_security_logout', null, {\n withCredentials: true\n })\n .catch(() => {})\n .then((response) => {\n if(response?.data?.result){\n if (isWebPreviewMode()) {\n location.href = response.data.result;\n return new Promise(r => setTimeout(r, 5000));\n } else {\n return axios.get(`${response?.data?.result}`, {\n withCredentials: true,\n });\n }\n }\n return Promise.reject();\n })\n .catch((e) => {\n console.error(e);\n })\n .then(()=>{\n this.isLoggedIn = false;\n this.redirectToLogin();\n });\n }\n\n public canUserAccessPage(pageName: string) {\n if (this.baseUrl && this.securityConfig?.isSecurityEnabled) {\n return axios.get(this.baseUrl + `/pages/${pageName}/${pageName}.html`)\n .catch((res) => res)\n .then((res) => res.status === 200 || res.status === 304); \n } else {\n return Promise.resolve(true);\n }\n }\n\n private matchRoles(widgetRoles: Array<String>, userRoles: Array<String>) {\n return widgetRoles.some(function (item) {\n return includes(userRoles, item);\n });\n }\n\n public hasAccessToWidget(widgetRoles: String) {\n const widgetRolesArr = widgetRoles.split(',');\n // access the widget when 'Everyone' is chosen\n if (includes(widgetRolesArr, USER_ROLE.EVERYONE)) {\n return true;\n }\n\n // access the widget when 'Anonymous' is chosen and user is not authenticated\n if (includes(widgetRolesArr, USER_ROLE.ANONYMOUS) && !this.loggedInUser.dataSet?.isAuthenticated) {\n return true;\n }\n\n // access the widget when 'Only Authenticated Users' is chosen and user is authenticated\n if (includes(widgetRolesArr, USER_ROLE.AUTHENTICATED) && this.loggedInUser.dataSet?.isAuthenticated) {\n return true;\n }\n\n // access the widget when widget role and logged in user role matches\n return this.loggedInUser.dataSet?.isAuthenticated && this.matchRoles(widgetRolesArr, this.loggedInUser.dataSet?.roles);\n }\n}\n\nconst appSecurityService = new AppSecurityService();\n\nexport default appSecurityService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AC7C;IACA,IAAIhF,QAAQ,CAACmJ,cAAc,EAAE7I,SAAS,CAAC8I,QAAQ,CAAC,EAAE;MAC9C,OAAO,IAAI;IACf;;IAEA;IACA,IAAIpJ,QAAQ,CAACmJ,cAAc,EAAE7I,SAAS,CAAC+I,SAAS,CAAC,IAAI,GAAAN,qBAAA,GAAC,IAAI,CAAC5F,YAAY,CAACoD,OAAO,cAAAwC,qBAAA,eAAzBA,qBAAA,CAA2BjD,eAAe,GAAE;MAC9F,OAAO,IAAI;IACf;;IAEA;IACA,IAAI9F,QAAQ,CAACmJ,cAAc,EAAE7I,SAAS,CAACgJ,aAAa,CAAC,KAAAN,sBAAA,GAAI,IAAI,CAAC7F,YAAY,CAACoD,OAAO,cAAAyC,sBAAA,eAAzBA,sBAAA,CAA2BlD,eAAe,EAAE;MACjG,OAAO,IAAI;IACf;;IAEA;IACA,OAAO,EAAAmD,sBAAA,OAAI,CAAC9F,YAAY,CAACoD,OAAO,cAAA0C,sBAAA,uBAAzBA,sBAAA,CAA2BnD,eAAe,KAAI,IAAI,CAAC6C,UAAU,CAACQ,cAAc,GAAAD,sBAAA,GAAE,IAAI,CAAC/F,YAAY,CAACoD,OAAO,cAAA2C,sBAAA,uBAAzBA,sBAAA,CAA2BnD,KAAK,CAAC;EAC1H;AACJ;AAEA,MAAMwD,kBAAkB,GAAG,IAAI7I,kBAAkB,CAAC,CAAC;AAEnD,eAAe6I,kBAAkB","ignoreList":[]}
|
app-rn-runtime/styles/theme.js
CHANGED
@@ -48,6 +48,11 @@ export class Theme {
|
|
48
48
|
this.traceEnabled = isWebPreviewMode();
|
49
49
|
}
|
50
50
|
}
|
51
|
+
enableTrace(flag) {
|
52
|
+
this.traceEnabled = flag;
|
53
|
+
this.reset();
|
54
|
+
this.children.forEach(t => t.enableTrace(flag));
|
55
|
+
}
|
51
56
|
subscribe(event, fn) {
|
52
57
|
return this.eventNotifer.subscribe(event, fn);
|
53
58
|
}
|
@@ -400,5 +405,10 @@ Theme.BASE.registerStyle((themeVariables, addStyle) => {
|
|
400
405
|
userSelect: 'none'
|
401
406
|
}
|
402
407
|
});
|
408
|
+
addStyle('hide-context-menu-input', '', {
|
409
|
+
text: {
|
410
|
+
userSelect: 'none'
|
411
|
+
}
|
412
|
+
});
|
403
413
|
});
|
404
414
|
//# sourceMappingURL=theme.js.map
|