@wavemaker/app-rn-runtime 12.0.0-next.45102 → 12.0.0-next.45128
Sign up to get free protection for your applications and to get access to all the features.
- app-rn-runtime/components/advanced/carousel/carousel.component.js +31 -5
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.props.js +1 -0
- app-rn-runtime/components/advanced/carousel/carousel.props.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.styles.js +15 -0
- app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js +15 -5
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.styles.js +3 -0
- app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
- app-rn-runtime/components/basic/animatedview.component.js +6 -2
- app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
- app-rn-runtime/components/basic/audio/audio.component.js.map +1 -1
- app-rn-runtime/components/basic/button/button.component.js +20 -6
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js +14 -6
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +13 -3
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
- app-rn-runtime/components/basic/message/message.component.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.component.js +1 -2
- app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +2 -2
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +5 -5
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js +9 -0
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.props.js +2 -0
- app-rn-runtime/components/basic/search/search.props.js.map +1 -1
- app-rn-runtime/components/basic/search/search.styles.js +5 -0
- app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.component.js +4 -3
- app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.props.js +9 -1
- app-rn-runtime/components/basic/skeleton/skeleton.props.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.component.js +2 -3
- app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.styles.js +3 -2
- app-rn-runtime/components/basic/spinner/spinner.styles.js.map +1 -1
- app-rn-runtime/components/basic/video/video.component.js.map +1 -1
- app-rn-runtime/components/basic/video/video.styles.js +4 -1
- app-rn-runtime/components/basic/video/video.styles.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.component.js +2 -1
- app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.styles.js +7 -1
- app-rn-runtime/components/chart/area-chart/area-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js +7 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/basechart.component.js +54 -2
- app-rn-runtime/components/chart/basechart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.props.js +3 -2
- app-rn-runtime/components/chart/basechart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.styles.js +4 -0
- app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +15 -3
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js +7 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/column-chart/column-chart.styles.js +7 -1
- app-rn-runtime/components/chart/column-chart/column-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js +7 -1
- app-rn-runtime/components/chart/donut-chart/donut-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.props.js +2 -0
- app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.styles.js +7 -1
- app-rn-runtime/components/chart/line-chart/line-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +6 -2
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js +7 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.styles.js.map +1 -1
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +37 -11
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.component.js +61 -12
- app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.props.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.styles.js +5 -0
- app-rn-runtime/components/container/accordion/accordion.styles.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +11 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
- app-rn-runtime/components/container/container.component.js +36 -2
- app-rn-runtime/components/container/container.component.js.map +1 -1
- app-rn-runtime/components/container/container.styles.js +7 -0
- app-rn-runtime/components/container/container.styles.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +5 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js +6 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.styles.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +28 -2
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.props.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js +4 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.styles.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js +31 -5
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.props.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.styles.js +4 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.styles.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.component.js +47 -6
- app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.styles.js +3 -0
- app-rn-runtime/components/container/panel/panel.styles.js.map +1 -1
- app-rn-runtime/components/container/partial-host.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +3 -4
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +11 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.component.js +41 -5
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js +4 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.component.js +28 -2
- app-rn-runtime/components/container/tile/tile.component.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.props.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.styles.js +6 -1
- app-rn-runtime/components/container/tile/tile.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +62 -13
- app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.props.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.styles.js +3 -0
- app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +4 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js +6 -2
- app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.styles.js +4 -1
- app-rn-runtime/components/data/card/card-content/card-content.styles.js.map +1 -1
- app-rn-runtime/components/data/card/card.component.js +18 -0
- app-rn-runtime/components/data/card/card.component.js.map +1 -1
- app-rn-runtime/components/data/card/card.styles.js +3 -0
- app-rn-runtime/components/data/card/card.styles.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
- app-rn-runtime/components/data/form/form.component.js +1 -1
- app-rn-runtime/components/data/form/form.component.js.map +1 -1
- app-rn-runtime/components/data/form/form.props.js +1 -0
- app-rn-runtime/components/data/form/form.props.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js +15 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.props.js +1 -0
- app-rn-runtime/components/data/list/list-template/list-template.props.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.styles.js +11 -1
- app-rn-runtime/components/data/list/list-template/list-template.styles.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +54 -33
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.props.js +1 -0
- app-rn-runtime/components/data/list/list.props.js.map +1 -1
- app-rn-runtime/components/data/list/list.styles.js +9 -0
- app-rn-runtime/components/data/list/list.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js +5 -3
- app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
- app-rn-runtime/components/input/basedataset/basedataset.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js +11 -4
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.props.js +1 -0
- app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js +25 -12
- app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.props.js +2 -0
- app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +5 -6
- app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js +24 -3
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js +1 -0
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +1 -0
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.component.js +3 -2
- app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.component.js +16 -1
- app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +22 -5
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheel-date-picker.component.js +123 -12
- app-rn-runtime/components/input/epoch/wheel-date-picker.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpicker/wheelpicker.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js +4 -0
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js +2 -0
- app-rn-runtime/components/input/epoch/wheelpickermodal/date/date-picker-modal.props.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js +4 -2
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.props.js +1 -0
- app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +6 -3
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +27 -7
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.props.js +1 -0
- app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.styles.js +1 -0
- app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
- app-rn-runtime/components/input/select/select.component.js +23 -9
- app-rn-runtime/components/input/select/select.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.component.js +2 -2
- app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +21 -0
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/text/text.props.js +2 -0
- app-rn-runtime/components/input/text/text.props.js.map +1 -1
- app-rn-runtime/components/input/text/text.styles.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +21 -0
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.props.js +2 -0
- app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +2 -4
- app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +2 -2
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.component.js +2 -3
- app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
- app-rn-runtime/components/page/content/content.component.js +19 -4
- app-rn-runtime/components/page/content/content.component.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.component.js +27 -2
- app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.props.js +2 -2
- app-rn-runtime/components/page/page-content/page-content.props.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.styles.js +6 -1
- app-rn-runtime/components/page/page-content/page-content.styles.js.map +1 -1
- app-rn-runtime/components/page/page.component.js.map +1 -1
- app-rn-runtime/components/page/page.props.js.map +1 -1
- app-rn-runtime/components/page/page.styles.js +7 -1
- app-rn-runtime/components/page/page.styles.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.component.js +27 -1
- app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.props.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.styles.js +6 -1
- app-rn-runtime/components/page/partial/partial.styles.js.map +1 -1
- app-rn-runtime/components/page/tabbar/curve.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.props.js +1 -0
- app-rn-runtime/components/page/tabbar/tabbar.props.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js +27 -1
- app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.props.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.styles.js +6 -1
- app-rn-runtime/components/prefab/prefab-container.styles.js.map +1 -1
- app-rn-runtime/core/base.component.js +5 -3
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/components/textinput.component.js +4 -3
- app-rn-runtime/core/components/textinput.component.js.map +1 -1
- app-rn-runtime/core/formatters.js.map +1 -1
- app-rn-runtime/core/key.extractor.js.map +1 -1
- app-rn-runtime/core/props.provider.js +4 -1
- app-rn-runtime/core/props.provider.js.map +1 -1
- app-rn-runtime/core/storage.service.js.map +1 -1
- app-rn-runtime/core/tappable.component.js +34 -27
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/core/ui-preferences.context.js +7 -0
- app-rn-runtime/core/ui-preferences.context.js.map +1 -0
- app-rn-runtime/core/utils.js +87 -4
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/package.json +30 -7
- app-rn-runtime/runtime/App.js +4 -8
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/App.navigator.js.map +1 -1
- app-rn-runtime/runtime/base-fragment.component.js +43 -13
- app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
- app-rn-runtime/runtime/base-page.component.js.map +1 -1
- app-rn-runtime/runtime/base-partial.component.js.map +1 -1
- app-rn-runtime/runtime/base-prefab.component.js.map +1 -1
- app-rn-runtime/runtime/navigator/stack.navigator.js.map +1 -1
- app-rn-runtime/runtime/services/app-i18n.service.js +10 -0
- app-rn-runtime/runtime/services/app-i18n.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-security.service.js +42 -2
- app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-spinner.service.js +1 -1
- app-rn-runtime/runtime/services/app-spinner.service.js.map +1 -1
- app-rn-runtime/runtime/services/webprocess.service.js.map +1 -1
- app-rn-runtime/runtime/watcher.js.map +1 -1
- app-rn-runtime/styles/background.component.js +1 -0
- app-rn-runtime/styles/background.component.js.map +1 -1
- app-rn-runtime/styles/style-prop.validator.js.map +1 -1
- app-rn-runtime/styles/theme.js +5 -0
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/styles/theme.variables.js +1 -0
- app-rn-runtime/styles/theme.variables.js.map +1 -1
- app-rn-runtime/variables/base-variable.js.map +1 -1
- app-rn-runtime/variables/device/file/upload-file.operation.js.map +1 -1
- app-rn-runtime/variables/device-variable.js.map +1 -1
- app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["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","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}\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":";;;AAEA,OAAOA,SAAS,MAAM,qEAAqE;AAC3F,OAAOC,YAAY,MAAwC,2BAA2B;AAiBtF,eAAe,MAAeC,WAAW,SAASD,YAAY,CAA6B;EAIvFE,WAAWA,CAACC,KAAmB,EAAE;IAC7B,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,wBAJY,CAAC,CAAC;IAAAA,eAAA,iBACV,IAAI;IAIrB,MAAMC,cAAc,GAAG,CAAC,CAAC,IAAI,CAACF,KAAK,CAACG,MAAM;IAC1C,IAAI,CAACC,GAAG,GAAG,IAAI,CAACC,SAAS,CAACC,GAAG;IAC7B,IAAI,CAACC,OAAO,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEP,cAAc,GAAG,CAAC,CAAC,GAAG,IAAI,CAACE,GAAG,CAACG,OAAO,CAAC;IACxE,IAAI,CAACG,SAAS,GAAGF,MAAM,CAACC,MAAM,CAAC,CAAC,CAAC,EAAEP,cAAc,GAAG,CAAC,CAAC,GAAG,IAAI,CAACE,GAAG,CAACM,SAAS,CAAC;IAC5E,IAAI,CAACC,kBAAkB,GAAG,IAAI,CAACX,KAAK,CAACW,kBAAkB;IACvD,IAAIT,cAAc,EAAE;MAClB,IAAI,CAACU,MAAM,GAAG,IAAI,CAACZ,KAAK,CAACG,MAAM;MAC/B,IAAI,CAACU,OAAO,GAAE,IAAI,CAACD,MAAM,CAACC,OAAO;IACnC;IACA,IAAI,CAACC,OAAO,GAAGd,KAAK,CAACe,aAAa,CAACC,MAAM,CAAC,CAAC;EAC/C;EAEAC,eAAeA,CAAA,EAAG;IAChB,OAAO,KAAK,CAACA,eAAe,CAAC,CAAC,CAACC,IAAI,CAAC,MAAM;MACxC,IAAI,CAACC,cAAc,CAAC,CAAC;MACrB,IAAI,CAACC,mBAAmB,CAAC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PrefabContainer","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,MAA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1C,KAAK,CAAC+C,MAAM,cAAAL,aAAA,uBAAZA,aAAA,CAAcM,IAAI;IAAE,GAChD,IAAI,CAAC1B,aAAa,GAAG,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 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","createStackNavigator","ThemeVariables","Stack","pages","Screen","Component","constructor","props","_defineProperty","state","renew","page","createPage","navigation","cleanUp","push","addListener","setState","createElement","route","name","component","destroyMe","setTimeout","componentWillUnmount","forEach","fn","render","getPageId","pageName","pageParams","pageParamsStr","Object","keys","sort","map","k","join","AppStackNavigator","Navigator","initialRouteName","landingPage","p","key","getId","params","options","headerShown","cardStyle","backgroundColor","INSTANCE","pageContentBgColor"],"sources":["stack.navigator.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { createStackNavigator } from '@react-navigation/stack';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\nconst Stack = createStackNavigator();\n\ninterface AppStackNavigatorProps {\n pages: any[];\n landingPage: string; \n}\n\nconst pages = {} as any;\n\nclass Screen extends React.Component {\n\n private cleanUp = [] as Function[];\n\n constructor(props: any) {\n super(props);\n this.state = {\n renew: false,\n page: this.createPage()\n };\n const navigation = (this.props as any).navigation as any;\n this.cleanUp.push(navigation.addListener('focus', () => {\n const state = (this.state as any);\n if (state.renew) {\n state.page = this.createPage();\n this.setState(() => ({\n renew: false,\n page: state.page\n }));\n }\n }));\n }\n\n private createPage() {\n const props = this.props as any;\n return React.createElement(pages[props.route.name].component, {...props, destroyMe: () => {\n setTimeout(() => {\n this.setState(() => ({renew: true, page: null}));\n }, 100);\n }});\n }\n\n componentWillUnmount() {\n this.cleanUp.forEach(fn => fn && fn());\n }\n\n render() {\n return (this.state as any).page || (<View/>);\n }\n}\n\nconst getPageId = (pageName: string, pageParams: any) => {\n const pageParamsStr = pageParams ? Object.keys(pageParams)\n .sort()\n .map((k: string) => `${k}=${pageParams[k]}`)\n .join('&') : '';\n return `${pageName}?${pageParamsStr}`;\n}\n\nconst AppStackNavigator = (props: AppStackNavigatorProps) => {\n return (<Stack.Navigator initialRouteName={props.landingPage}>\n {props.pages.map(p => {\n pages[p.name] = p;\n return (\n <Stack.Screen key={p.name}\n name={p.name}\n component={Screen}\n getId={({params}) => getPageId(p.name, params)}\n options={{\n headerShown: false,\n cardStyle: {\n backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor\n }\n }}\n />);\n })}\n </Stack.Navigator>);\n};\n\nexport default AppStackNavigator;"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;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C,CAAC,CAAC;EACL;EAEAa,oBAAoBA,CAAA,EAAG;IACrB,IAAI,CAACV,OAAO,CAACW,OAAO,CAACC,EAAE,IAAIA,EAAE,IAAIA,EAAE,CAAC,CAAC,CAAC;EACxC;EAEAC,MAAMA,CAAA,EAAG;IACP,OAAQ,IAAI,CAAClB,KAAK,CAASE,IAAI,iBAAKb,KAAA,CAAAoB,aAAA,CAACnB,IAAI,MAAC,CAAE;EAC9C;AACF;AAEA,MAAM6B,SAAS,GAAGA,CAACC,QAAgB,EAAEC,UAAe,KAAK;EACvD,MAAMC,aAAa,GAAGD,UAAU,GAAGE,MAAM,CAACC,IAAI,CAACH,UAAU,CAAC,CACvDI,IAAI,CAAC,CAAC,CACNC,GAAG,CAAEC,CAAS,
|
1
|
+
{"version":3,"names":["React","View","createStackNavigator","ThemeVariables","Stack","pages","Screen","Component","constructor","props","_defineProperty","state","renew","page","createPage","navigation","cleanUp","push","addListener","setState","createElement","route","name","component","destroyMe","setTimeout","componentWillUnmount","forEach","fn","render","getPageId","pageName","pageParams","pageParamsStr","Object","keys","sort","map","k","join","AppStackNavigator","Navigator","initialRouteName","landingPage","p","key","getId","params","options","headerShown","cardStyle","backgroundColor","INSTANCE","pageContentBgColor"],"sources":["stack.navigator.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { createStackNavigator } from '@react-navigation/stack';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\nconst Stack = createStackNavigator();\n\ninterface AppStackNavigatorProps {\n pages: any[];\n landingPage: string; \n}\n\nconst pages = {} as any;\n\nclass Screen extends React.Component {\n\n private cleanUp = [] as Function[];\n\n constructor(props: any) {\n super(props);\n this.state = {\n renew: false,\n page: this.createPage()\n };\n const navigation = (this.props as any).navigation as any;\n this.cleanUp.push(navigation.addListener('focus', () => {\n const state = (this.state as any);\n if (state.renew) {\n state.page = this.createPage();\n this.setState(() => ({\n renew: false,\n page: state.page\n }));\n }\n }));\n }\n\n private createPage() {\n const props = this.props as any;\n return React.createElement(pages[props.route.name].component, {...props, destroyMe: () => {\n setTimeout(() => {\n this.setState(() => ({renew: true, page: null}));\n }, 100);\n }});\n }\n\n componentWillUnmount() {\n this.cleanUp.forEach(fn => fn && fn());\n }\n\n render() {\n return (this.state as any).page || (<View/>);\n }\n}\n\nconst getPageId = (pageName: string, pageParams: any) => {\n const pageParamsStr = pageParams ? Object.keys(pageParams)\n .sort()\n .map((k: string) => `${k}=${pageParams[k]}`)\n .join('&') : '';\n return `${pageName}?${pageParamsStr}`;\n}\n\nconst AppStackNavigator = (props: AppStackNavigatorProps) => {\n return (<Stack.Navigator initialRouteName={props.landingPage}>\n {props.pages.map(p => {\n pages[p.name] = p;\n return (\n <Stack.Screen key={p.name}\n name={p.name}\n component={Screen}\n getId={({params}) => getPageId(p.name, params)}\n options={{\n headerShown: false,\n cardStyle: {\n backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor\n }\n }}\n />);\n })}\n </Stack.Navigator>);\n};\n\nexport default AppStackNavigator;"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,oBAAoB,QAAQ,yBAAyB;AAC9D,OAAOC,cAAc,MAAM,kDAAkD;AAE7E,MAAMC,KAAK,GAAGF,oBAAoB,CAAC,CAAC;AAOpC,MAAMG,KAAK,GAAG,CAAC,CAAQ;AAEvB,MAAMC,MAAM,SAASN,KAAK,CAACO,SAAS,CAAC;EAInCC,WAAWA,CAACC,KAAU,EAAE;IACtB,KAAK,CAACA,KAAK,CAAC;IAACC,eAAA,kBAHG,EAAE;IAIlB,IAAI,CAACC,KAAK,GAAG;MACXC,KAAK,EAAE,KAAK;MACZC,IAAI,EAAE,IAAI,CAACC,UAAU,CAAC;IACxB,CAAC;IACD,MAAMC,UAAU,GAAI,IAAI,CAACN,KAAK,CAASM,UAAiB;IACxD,IAAI,CAACC,OAAO,CAACC,IAAI,CAACF,UAAU,CAACG,WAAW,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AE,CAAC,CAC3CC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;EACjB,OAAO,GAAGR,QAAQ,IAAIE,aAAa,EAAE;AACvC,CAAC;AAED,MAAMO,iBAAiB,GAAI/B,KAA6B,IAAK;EAC3D,oBAAQT,KAAA,CAAAoB,aAAA,CAAChB,KAAK,CAACqC,SAAS;IAACC,gBAAgB,EAAEjC,KAAK,CAACkC;EAAY,GAC1DlC,KAAK,CAACJ,KAAK,CAACgC,GAAG,CAACO,CAAC,IAAI;IACpBvC,KAAK,CAACuC,CAAC,CAACtB,IAAI,CAAC,GAAGsB,CAAC;IACjB,oBACE5C,KAAA,CAAAoB,aAAA,CAAChB,KAAK,CAACE,MAAM;MAACuC,GAAG,EAAED,CAAC,CAACtB,IAAK;MACxBA,IAAI,EAAEsB,CAAC,CAACtB,IAAK;MACbC,SAAS,EAAEjB,MAAO;MAClBwC,KAAK,EAAEA,CAAC;QAACC;MAAM,CAAC,KAAKjB,SAAS,CAACc,CAAC,CAACtB,IAAI,EAAEyB,MAAM,CAAE;MAC/CC,OAAO,EAAE;QACPC,WAAW,EAAE,KAAK;QAClBC,SAAS,EAAE;UACTC,eAAe,EAAEhD,cAAc,CAACiD,QAAQ,CAACC;QAC3C;MACF;IAAE,CACH,CAAC;EACJ,CAAC,CACY,CAAC;AACpB,CAAC;AAED,eAAeb,iBAAiB","ignoreList":[]}
|
@@ -51,6 +51,16 @@ class AppI18nService {
|
|
51
51
|
});
|
52
52
|
});
|
53
53
|
}
|
54
|
+
|
55
|
+
// app defaults support same as web
|
56
|
+
get appDefaults() {
|
57
|
+
return {
|
58
|
+
dateFormat: this.dateFormat,
|
59
|
+
timeFormat: this.timeFormat,
|
60
|
+
currencyCode: this.currencyCode,
|
61
|
+
dateTimeFormat: this.dateTimeFormat
|
62
|
+
};
|
63
|
+
}
|
54
64
|
setTimezone(timezone) {
|
55
65
|
this.timezone = timezone;
|
56
66
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["axios","StorageService","isWebPreviewMode","I18nManager","APP_LOCALE_ROOT_PATH","STORAGE_KEY","RTL_LANGUAGE_CODES","map","forEach","v","AppI18nService","constructor","_defineProperty","init","selectedLocale","getItem","isRTLLocale","newLocale","setRTL","locale","flag","needsRestart","isRTL","forceRTL","loadAppLocaleBundle","url","Promise","resolve","then","path","get","bundle","dateFormat","data","formats","date","timeFormat","time","currencyCode","currency","dateTimeFormat","catch","console","warn","setTimezone","timezone","getTimezone","setSelectedLocale","setItem","getSelectedLocale","i18nService"],"sources":["app-i18n.service.tsx"],"sourcesContent":["import axios, { AxiosResponse } from 'axios';\nimport StorageService from '@wavemaker/app-rn-runtime/core/storage.service';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport { I18nManager, Platform } from 'react-native';\nimport { I18nService } from '@wavemaker/app-rn-runtime/core/i18n.service';\n\nconst APP_LOCALE_ROOT_PATH = '/resources/i18n';\nconst STORAGE_KEY = 'selectedLocale';\nconst RTL_LANGUAGE_CODES = (()=>{\n const map = {} as any;\n [\"ar\", \"ar-001\", \"ar-ae\", \"ar-bh\", \"ar-dz\", \"ar-eg\", \"ar-iq\", \"ar-jo\", \"ar-kw\", \"ar-lb\",\n \"ar-ly\", \"ar-ma\", \"ar-om\", \"ar-qa\", \"ar-sa\", \"ar-sd\", \"ar-sy\", \"ar-tn\", \"ar-ye\", \"arc\",\n \"bcc\", \"bqi\", \"ckb\", \"dv\", \"fa\", \"glk\", \"he\", \"ku\", \"mzn\", \"pnb\", \"ps\", \"sd\", \"ug\", \"ur\", \"yi\"].forEach(v=>{\n map[v] = true;\n });\n return map;\n })();\n\nclass AppI18nService implements I18nService{\n appLocale: any;\n defaultSupportedLocale = 'en';\n selectedLocale: any;\n dateFormat: string = '';\n timeFormat: string = '';\n dateTimeFormat: string = '';\n currencyCode: string = '';\n timezone: string = '';\n\n constructor() {}\n\n async init() {\n this.selectedLocale = await StorageService.getItem(STORAGE_KEY);\n }\n\n isRTLLocale(newLocale: string = this.selectedLocale){\n return !!(newLocale && RTL_LANGUAGE_CODES[newLocale]);\n }\n\n setRTL(locale?: string){\n const flag = this.isRTLLocale(locale);\n const needsRestart = !isWebPreviewMode() && I18nManager.isRTL !== flag;\n I18nManager.forceRTL(flag);\n return needsRestart; \n }\n\n loadAppLocaleBundle(url: string) {\n return Promise.resolve().then(() => {\n const path = `${url + APP_LOCALE_ROOT_PATH}/${this.selectedLocale}.json`;\n return axios.get(path)\n .then((bundle) => {\n this.dateFormat = bundle.data.formats.date;\n this.timeFormat = bundle.data.formats.time;\n this.currencyCode = bundle.data.formats.currency;\n this.dateTimeFormat = this.dateFormat + ' ' + this.timeFormat;\n return bundle;\n })\n .catch(() => {\n console.warn(`error loading locale resource from ${path}`);\n });\n\n });\n }\n\n setTimezone(timezone: string){\n this.timezone = timezone;\n }\n\n getTimezone(){\n return this.timezone;\n }\n\n setSelectedLocale(locale: string) {\n this.selectedLocale = locale;\n StorageService.setItem(STORAGE_KEY, locale);\n return this.setRTL(locale);\n }\n\n getSelectedLocale() {\n return this.selectedLocale;\n }\n}\n\nconst i18nService = new AppI18nService();\n\nexport default i18nService;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAyB,OAAO;AAC5C,OAAOC,cAAc,MAAM,gDAAgD;AAC3E,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,WAAW,QAAkB,cAAc;AAGpD,MAAMC,oBAAoB,GAAG,iBAAiB;AAC9C,MAAMC,WAAW,GAAG,gBAAgB;AACpC,MAAMC,kBAAkB,GAAG,CAAC,MAAI;EAC9B,MAAMC,GAAG,GAAG,CAAC,CAAQ;EACrB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EACtF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,O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,"names":["axios","StorageService","isWebPreviewMode","I18nManager","APP_LOCALE_ROOT_PATH","STORAGE_KEY","RTL_LANGUAGE_CODES","map","forEach","v","AppI18nService","constructor","_defineProperty","init","selectedLocale","getItem","isRTLLocale","newLocale","setRTL","locale","flag","needsRestart","isRTL","forceRTL","loadAppLocaleBundle","url","Promise","resolve","then","path","get","bundle","dateFormat","data","formats","date","timeFormat","time","currencyCode","currency","dateTimeFormat","catch","console","warn","appDefaults","setTimezone","timezone","getTimezone","setSelectedLocale","setItem","getSelectedLocale","i18nService"],"sources":["app-i18n.service.tsx"],"sourcesContent":["import axios, { AxiosResponse } from 'axios';\nimport StorageService from '@wavemaker/app-rn-runtime/core/storage.service';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport { I18nManager, Platform } from 'react-native';\nimport { I18nService } from '@wavemaker/app-rn-runtime/core/i18n.service';\n\nconst APP_LOCALE_ROOT_PATH = '/resources/i18n';\nconst STORAGE_KEY = 'selectedLocale';\nconst RTL_LANGUAGE_CODES = (()=>{\n const map = {} as any;\n [\"ar\", \"ar-001\", \"ar-ae\", \"ar-bh\", \"ar-dz\", \"ar-eg\", \"ar-iq\", \"ar-jo\", \"ar-kw\", \"ar-lb\",\n \"ar-ly\", \"ar-ma\", \"ar-om\", \"ar-qa\", \"ar-sa\", \"ar-sd\", \"ar-sy\", \"ar-tn\", \"ar-ye\", \"arc\",\n \"bcc\", \"bqi\", \"ckb\", \"dv\", \"fa\", \"glk\", \"he\", \"ku\", \"mzn\", \"pnb\", \"ps\", \"sd\", \"ug\", \"ur\", \"yi\"].forEach(v=>{\n map[v] = true;\n });\n return map;\n })();\n\nclass AppI18nService implements I18nService{\n appLocale: any;\n defaultSupportedLocale = 'en';\n selectedLocale: any;\n dateFormat: string = '';\n timeFormat: string = '';\n dateTimeFormat: string = '';\n currencyCode: string = '';\n timezone: string = '';\n\n constructor() {}\n\n async init() {\n this.selectedLocale = await StorageService.getItem(STORAGE_KEY);\n }\n\n isRTLLocale(newLocale: string = this.selectedLocale){\n return !!(newLocale && RTL_LANGUAGE_CODES[newLocale]);\n }\n\n setRTL(locale?: string){\n const flag = this.isRTLLocale(locale);\n const needsRestart = !isWebPreviewMode() && I18nManager.isRTL !== flag;\n I18nManager.forceRTL(flag);\n return needsRestart; \n }\n\n loadAppLocaleBundle(url: string) {\n return Promise.resolve().then(() => {\n const path = `${url + APP_LOCALE_ROOT_PATH}/${this.selectedLocale}.json`;\n return axios.get(path)\n .then((bundle) => {\n this.dateFormat = bundle.data.formats.date;\n this.timeFormat = bundle.data.formats.time;\n this.currencyCode = bundle.data.formats.currency;\n this.dateTimeFormat = this.dateFormat + ' ' + this.timeFormat;\n return bundle;\n })\n .catch(() => {\n console.warn(`error loading locale resource from ${path}`);\n });\n\n });\n }\n\n // app defaults support same as web \n get appDefaults(){\n return {\n dateFormat : this.dateFormat,\n timeFormat : this.timeFormat,\n currencyCode: this.currencyCode,\n dateTimeFormat: this.dateTimeFormat\n }\n }\n\n setTimezone(timezone: string){\n this.timezone = timezone;\n }\n\n getTimezone(){\n return this.timezone;\n }\n\n setSelectedLocale(locale: string) {\n this.selectedLocale = locale;\n StorageService.setItem(STORAGE_KEY, locale);\n return this.setRTL(locale);\n }\n\n getSelectedLocale() {\n return this.selectedLocale;\n }\n}\n\nconst i18nService = new AppI18nService();\n\nexport default i18nService;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAyB,OAAO;AAC5C,OAAOC,cAAc,MAAM,gDAAgD;AAC3E,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,WAAW,QAAkB,cAAc;AAGpD,MAAMC,oBAAoB,GAAG,iBAAiB;AAC9C,MAAMC,WAAW,GAAG,gBAAgB;AACpC,MAAMC,kBAAkB,GAAG,CAAC,MAAI;EAC9B,MAAMC,GAAG,GAAG,CAAC,CAAQ;EACrB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,O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AC3C,OAAO,IAAI,CAACD,MAAM,CAACC,MAAM,CAAC;EAC9B;EAEA+B,iBAAiBA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACpC,cAAc;EAC5B;AACJ;AAEA,MAAMqC,WAAW,GAAG,IAAIzC,cAAc,CAAC,CAAC;AAExC,eAAeyC,WAAW","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,gDAAgD;AAC3E,OAAOC,QAAQ,MAAM,yCAAyC;AAE9D,OAAOC,cAAc,MAAM,gDAAgD;AAG3E,OAAOC,iBAAiB,MAAM,sBAAsB;AAAC,IAehDC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA,EAATA,SAAS;AAMd,MAAMC,aAAa,GAAG,aAAa;AACnC,MAAMC,gBAAgB,GAAG,eAAe;AACxC,MAAMC,gBAAgB,GAAG,iBAAiB;AAE1C,MAAMC,kBAAkB,CAA4B;EAWhDC,WAAWA,CAAA,EAAG;IAAAC,eAAA;IAAAA,eAAA,qBARD,KAAK;IAAAA,eAAA,uBACE,CAAC,CAAC;IAAAA,eAAA;IAAAA,eAAA;IAAAA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CAAC,IAAI,GAAAP,qBAAA,GAAC,IAAI,CAACjF,YAAY,CAAC6C,OAAO,cAAAoC,qBAAA,eAAzBA,qBAAA,CAA2B7C,eAAe,GAAE;MAC9F,OAAO,IAAI;IACf;;IAEA;IACA,IAAIzE,QAAQ,CAAC0H,cAAc,EAAErH,SAAS,CAACyH,aAAa,CAAC,KAAAP,sBAAA,GAAI,IAAI,CAAClF,YAAY,CAAC6C,OAAO,cAAAqC,sBAAA,eAAzBA,sBAAA,CAA2B9C,eAAe,EAAE;MACjG,OAAO,IAAI;IACf;;IAEA;IACA,OAAO,EAAA+C,sBAAA,OAAI,CAACnF,YAAY,CAAC6C,OAAO,cAAAsC,sBAAA,uBAAzBA,sBAAA,CAA2B/C,eAAe,KAAI,IAAI,CAACwC,UAAU,CAACS,cAAc,GAAAD,sBAAA,GAAE,IAAI,CAACpF,YAAY,CAAC6C,OAAO,cAAAuC,sBAAA,uBAAzBA,sBAAA,CAA2B/C,KAAK,CAAC;EAC1H;AACJ;AAEA,MAAMqD,kBAAkB,GAAG,IAAItH,kBAAkB,CAAC,CAAC;AAEnD,eAAesH,kBAAkB","ignoreList":[]}
|
1
|
+
{"version":3,"names":["Platform","axios","each","includes","networkService","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;\n"],"mappings":";;;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,KAAK,MAAqD,OAAO;AACxE,SAASC,IAAI,EAAEC,QAAQ,QAAQ,QAAQ;AAEvC,OAAOC,cAAc,MAAM,gDAAgD;AAC3E,OAAOC,QAAQ,MAAM,yCAAyC;AAE9D,OAAOC,cAAc,MAAM,gDAAgD;AAG3E,OAAOC,iBAAiB,MAAM,sBAAsB;AACpD,SAASC,gBAAgB,QAAQ,sCAAsC;AAAC,IAenEC,SAAS,0BAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAATA,SAAS;EAAA,OAATA,SAAS;AAAA,EAATA,SAAS;AAMd,MAAMC,aAAa,GAAG,aAAa;AACnC,MAAMC,gBAAgB,GAAG,eAAe;AACx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AAA,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":[]}
|
@@ -44,7 +44,6 @@ export class AppSpinnerService {
|
|
44
44
|
this.count++;
|
45
45
|
}
|
46
46
|
hide() {
|
47
|
-
this.skeleton = false;
|
48
47
|
if (this.count > 0) {
|
49
48
|
this.count--;
|
50
49
|
} else {
|
@@ -55,6 +54,7 @@ export class AppSpinnerService {
|
|
55
54
|
if (!this.count && this.destroy) {
|
56
55
|
this.destroy.call(this.displayManager);
|
57
56
|
this.destroy = null;
|
57
|
+
this.skeleton = false;
|
58
58
|
}
|
59
59
|
}, 300);
|
60
60
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","appDisplayManagerService","WmSpinner","ThemeVariables","AppSpinnerService","constructor","displayManager","_defineProperty","setImage","path","image","setDefaultOptions","options","defaultDisplayOptions","show","skeleton","spinner","loader","count","destroy","setTimeout","content","createElement","Fragment","style","styles","appSpinnerContainer","backgroundColor","INSTANCE","pageContentBgColor","caption","message","classname","lottie","delay","hide","call","justifyContent","alignItems","width","height","opacity","spinnerService"],"sources":["app-spinner.service.tsx"],"sourcesContent":["import React from 'react';\n\nimport { View, ViewStyle } from 'react-native';\n\nimport { SpinnerService, DisplayOptions } from '@wavemaker/app-rn-runtime/core/spinner.service';\nimport { DisplayManager } from '@wavemaker/app-rn-runtime/core/display.manager';\nimport appDisplayManagerService from '@wavemaker/app-rn-runtime/runtime/services/app-display-manager.service';\nimport WmSpinner from '@wavemaker/app-rn-runtime/components/basic/spinner/spinner.component';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\nexport class AppSpinnerService implements SpinnerService {\n public displayOptions = {} as DisplayOptions;\n public destroy: any;\n public delay = 0;\n private count = 0;\n private image: string = '';\n public skeleton: boolean = false;\n private defaultDisplayOptions: DisplayOptions = {} as any;\n constructor(private displayManager: DisplayManager) {}\n\n setImage(path: string) {\n this.image = path;\n }\n\n setDefaultOptions(options: DisplayOptions) {\n this.defaultDisplayOptions = options;\n }\n\n show(options: DisplayOptions = this.defaultDisplayOptions) {\n this.skeleton = options.spinner.loader == 'skeleton';\n if (this.count === 0 && !this.destroy) { \n setTimeout(() => {\n const content = (<>\n {!this.skeleton? \n <View style={[styles.appSpinnerContainer, { backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor }]}>\n <WmSpinner\n caption={options.message || ''}\n classname=\"global-spinner\"\n lottie={options.spinner}></WmSpinner>\n </View> : null}\n </>);\n this.destroy = this.displayManager.show({ content: content });\n }, this.delay);\n }\n this.count++;\n }\n\n hide() {\n
|
1
|
+
{"version":3,"names":["React","View","appDisplayManagerService","WmSpinner","ThemeVariables","AppSpinnerService","constructor","displayManager","_defineProperty","setImage","path","image","setDefaultOptions","options","defaultDisplayOptions","show","skeleton","spinner","loader","count","destroy","setTimeout","content","createElement","Fragment","style","styles","appSpinnerContainer","backgroundColor","INSTANCE","pageContentBgColor","caption","message","classname","lottie","delay","hide","call","justifyContent","alignItems","width","height","opacity","spinnerService"],"sources":["app-spinner.service.tsx"],"sourcesContent":["import React from 'react';\n\nimport { View, ViewStyle } from 'react-native';\n\nimport { SpinnerService, DisplayOptions } from '@wavemaker/app-rn-runtime/core/spinner.service';\nimport { DisplayManager } from '@wavemaker/app-rn-runtime/core/display.manager';\nimport appDisplayManagerService from '@wavemaker/app-rn-runtime/runtime/services/app-display-manager.service';\nimport WmSpinner from '@wavemaker/app-rn-runtime/components/basic/spinner/spinner.component';\nimport ThemeVariables from '@wavemaker/app-rn-runtime/styles/theme.variables';\n\nexport class AppSpinnerService implements SpinnerService {\n public displayOptions = {} as DisplayOptions;\n public destroy: any;\n public delay = 0;\n private count = 0;\n private image: string = '';\n public skeleton: boolean = false;\n private defaultDisplayOptions: DisplayOptions = {} as any;\n constructor(private displayManager: DisplayManager) {}\n\n setImage(path: string) {\n this.image = path;\n }\n\n setDefaultOptions(options: DisplayOptions) {\n this.defaultDisplayOptions = options;\n }\n\n show(options: DisplayOptions = this.defaultDisplayOptions) {\n this.skeleton = options.spinner.loader == 'skeleton';\n if (this.count === 0 && !this.destroy) { \n setTimeout(() => {\n const content = (<>\n {!this.skeleton? \n <View style={[styles.appSpinnerContainer, { backgroundColor: ThemeVariables.INSTANCE.pageContentBgColor }]}>\n <WmSpinner\n caption={options.message || ''}\n classname=\"global-spinner\"\n lottie={options.spinner}></WmSpinner>\n </View> : null}\n </>);\n this.destroy = this.displayManager.show({ content: content });\n }, this.delay);\n }\n this.count++;\n }\n\n hide() {\n if (this.count > 0) {\n this.count--;\n } else {\n this.count = 0;\n }\n if (this.count === 0) {\n setTimeout(() => {\n if (!this.count && this.destroy) {\n this.destroy.call(this.displayManager);\n this.destroy = null;\n this.skeleton = false;\n }\n }, 300);\n }\n }\n}\n\nconst styles = {\n appSpinnerContainer:{ \n justifyContent: 'center', \n alignItems: 'center', \n width:'100%', \n height:'100%', \n opacity: 0.8 \n } as ViewStyle\n}\n\nconst spinnerService = new AppSpinnerService(appDisplayManagerService);\nexport default spinnerService;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,IAAI,QAAmB,cAAc;AAI9C,OAAOC,wBAAwB,MAAM,wEAAwE;AAC7G,OAAOC,SAAS,MAAM,sEAAsE;AAC5F,OAAOC,cAAc,MAAM,kDAAkD;AAE7E,OAAO,MAAMC,iBAAiB,CAA2B;EAQvDC,WAAWA,CAAS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CAACa,KAAK,CAAC;IAChB;IACA,IAAI,CAAChB,KAAK,EAAE;EACd;EAEAiB,IAAIA,CAAA,EAAG;IACL,IAAI,IAAI,CAACjB,KAAK,GAAG,CAAC,EAAE;MAClB,IAAI,CAACA,KAAK,EAAE;IACd,CAAC,MAAM;MACL,IAAI,CAACA,KAAK,GAAG,CAAC;IAChB;IACA,IAAI,IAAI,CAACA,KAAK,KAAK,CAAC,EAAE;MACpBE,UAAU,CAAC,MAAM;QACf,IAAI,CAAC,IAAI,CAACF,KAAK,IAAI,IAAI,CAACC,OAAO,EAAE;UAC/B,IAAI,CAACA,OAAO,CAACiB,IAAI,CAAC,IAAI,CAAC9B,cAAc,CAAC;UACtC,IAAI,CAACa,OAAO,GAAG,IAAI;UACnB,IAAI,CAACJ,QAAQ,GAAG,KAAK;QACvB;MACF,CAAC,EAAE,GAAG,CAAC;IACT;EACF;AACF;AAEA,MAAMU,MAAM,GAAG;EACbC,mBAAmB,EAAC;IAClBW,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAC,MAAM;IACZC,MAAM,EAAC,MAAM;IACbC,OAAO,EAAE;EACX;AACF,CAAC;AAED,MAAMC,cAAc,GAAG,IAAItC,iBAAiB,CAACH,wBAAwB,CAAC;AACtE,eAAeyC,cAAc","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["axios","React","Component","Dimensions","View","WmWebview","injector","AppDisplayManagerService","windowWidth","get","width","windowHeight","height","WebProcessWebViewProps","constructor","_defineProperty","WebProcessWebView","props","getScriptToInject","process","render","createElement","style","src","incognito","styles","root","onLoad","e","w","setTimeout","executeScript","then","output","onComplete","WebProcessService","execute","hookUrl","useSystemBrowser","baseUrl","url","withCredentials","response","executeWithSystemBrowser","data","executeWithInAppBrowser","processInfo","Promise","reject","resolve","destroyFn","show","content","encodeURIComponent","ouput","call"],"sources":["webprocess.service.tsx"],"sourcesContent":["import axios from \"axios\";\nimport React, { Component } from \"react\";\nimport { Dimensions, View } from \"react-native\";\n\nimport WmWebview from \"@wavemaker/app-rn-runtime/components/advanced/webview/webview.component\";\nimport AppConfig from \"@wavemaker/app-rn-runtime/core/AppConfig\";\nimport injector from \"@wavemaker/app-rn-runtime/core/injector\";\n\nimport AppDisplayManagerService from \"./app-display-manager.service\";\n\ndeclare const window: any, document: any, alert: any;\n\nconst windowWidth = Dimensions.get('window').width;\nconst windowHeight = Dimensions.get('window').height;\n\nclass WebProcessWebViewProps {\n src: string = \"\";\n process: string = \"\";\n incognito = false;\n onComplete?: (output: string) => any = null as any;\n}\n \nclass WebProcessWebView extends Component<WebProcessWebViewProps> {\n\n constructor(props: WebProcessWebViewProps) {\n super(props);\n }\n\n private getScriptToInject(process: string): string {\n return `(function() {\n var elements = document.querySelectorAll('body.flex>a.link');\n for (var i = 0; i < elements.length; i++) {\n var href = elements[i].href;\n if (href && href.indexOf('://services/webprocess/${process}?process_output=')) {\n return href.split('process_output=')[1];\n }\n }\n window.isWebLoginProcess = true;\n })()`;\n }\n\n render() {\n return(\n <View style={{\n width: windowWidth,\n height: windowHeight\n }}>\n <WmWebview src={this.props.src}\n incognito={this.props.incognito}\n styles={{\n root: {\n width: '100%',\n height: '100%'\n }\n }}\n onLoad={(e, w) => {\n setTimeout(() => {\n w.executeScript(this.getScriptToInject(this.props.process))\n .then((output) => {\n if (output) {\n const onComplete = this.props.onComplete;\n onComplete && onComplete(output as string);\n }\n });\n }, 1000);\n }}></WmWebview>\n </View>\n );\n }\n}\n\nexport class WebProcessService {\n\n baseUrl: string | null = null;\n\n constructor() {}\n\n public execute(process: string, hookUrl: string, useSystemBrowser = false, incognito = false): Promise<any> {\n if (!this.baseUrl) {\n this.baseUrl = injector.get<AppConfig>('APP_CONFIG').url;\n }\n return axios.get(this.baseUrl + `/services/webprocess/prepare?processName=${process}&hookUrl=${hookUrl}&requestSourceType=MOBILE`, {\n withCredentials: true\n })\n .then((response) => {\n if (useSystemBrowser) {\n return this.executeWithSystemBrowser(response.data);\n } else {\n return this.executeWithInAppBrowser(response.data, process, incognito);\n }\n }).then(output => {\n return axios.get(this.baseUrl + '/services/webprocess/decode?encodedProcessdata=' + output, {\n withCredentials: true\n });\n });\n }\n\n private executeWithSystemBrowser(processInfo: string): Promise<any> {\n return Promise.reject('Web Process in System browser is nor ready yet');\n }\n\n private executeWithInAppBrowser(processInfo: string, process: string, incognito: boolean): Promise<any> {\n return new Promise((resolve, reject) => {\n let destroyFn = () => {};\n destroyFn = AppDisplayManagerService.show({\n content: (\n <WebProcessWebView \n src={this.baseUrl + '/services/webprocess/start?process=' + encodeURIComponent(processInfo)}\n incognito={incognito}\n process={process}\n onComplete={(ouput) => {\n resolve(ouput);\n destroyFn.call(AppDisplayManagerService);\n }}></WebProcessWebView>\n ),\n \n });\n });\n }\n}\n\nexport default new WebProcessService();"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,OAAOC,SAAS,MAAM,yEAAyE;AAE/F,OAAOC,QAAQ,MAAM,yCAAyC;AAE9D,OAAOC,wBAAwB,MAAM,+BAA+B;AAIpE,MAAMC,WAAW,GAAGL,UAAU,CAACM,GAAG,CAAC,QAAQ,CAAC,CAACC,KAAK;AAClD,MAAMC,YAAY,GAAGR,UAAU,CAACM,GAAG,CAAC,QAAQ,CAAC,CAACG,MAAM;AAEpD,MAAMC,sBAAsB,CAAC;EAAAC,YAAA;IAAAC,eAAA,cACX,EAAE;IAAAA,eAAA,kBACE,EAAE;IAAAA,eAAA,oBACR,KAAK;IAAAA,eAAA,qBACsB,IAAI;EAAA;AAC/C;AAEA,MAAMC,iBAAiB,SAASd,SAAS,CAAyB;EAE9DY,WAAWA,CAACG,KAA6B,EAAE;IACzC,KAAK,CAACA,KAAK,CAAC;EACd;EAEQC,iBAAiBA,CAACC,OAAe,EAAU;IAC/C,
|
1
|
+
{"version":3,"names":["axios","React","Component","Dimensions","View","WmWebview","injector","AppDisplayManagerService","windowWidth","get","width","windowHeight","height","WebProcessWebViewProps","constructor","_defineProperty","WebProcessWebView","props","getScriptToInject","process","render","createElement","style","src","incognito","styles","root","onLoad","e","w","setTimeout","executeScript","then","output","onComplete","WebProcessService","execute","hookUrl","useSystemBrowser","baseUrl","url","withCredentials","response","executeWithSystemBrowser","data","executeWithInAppBrowser","processInfo","Promise","reject","resolve","destroyFn","show","content","encodeURIComponent","ouput","call"],"sources":["webprocess.service.tsx"],"sourcesContent":["import axios from \"axios\";\nimport React, { Component } from \"react\";\nimport { Dimensions, View } from \"react-native\";\n\nimport WmWebview from \"@wavemaker/app-rn-runtime/components/advanced/webview/webview.component\";\nimport AppConfig from \"@wavemaker/app-rn-runtime/core/AppConfig\";\nimport injector from \"@wavemaker/app-rn-runtime/core/injector\";\n\nimport AppDisplayManagerService from \"./app-display-manager.service\";\n\ndeclare const window: any, document: any, alert: any;\n\nconst windowWidth = Dimensions.get('window').width;\nconst windowHeight = Dimensions.get('window').height;\n\nclass WebProcessWebViewProps {\n src: string = \"\";\n process: string = \"\";\n incognito = false;\n onComplete?: (output: string) => any = null as any;\n}\n \nclass WebProcessWebView extends Component<WebProcessWebViewProps> {\n\n constructor(props: WebProcessWebViewProps) {\n super(props);\n }\n\n private getScriptToInject(process: string): string {\n return `(function() {\n var elements = document.querySelectorAll('body.flex>a.link');\n for (var i = 0; i < elements.length; i++) {\n var href = elements[i].href;\n if (href && href.indexOf('://services/webprocess/${process}?process_output=')) {\n return href.split('process_output=')[1];\n }\n }\n window.isWebLoginProcess = true;\n })()`;\n }\n\n render() {\n return(\n <View style={{\n width: windowWidth,\n height: windowHeight\n }}>\n <WmWebview src={this.props.src}\n incognito={this.props.incognito}\n styles={{\n root: {\n width: '100%',\n height: '100%'\n }\n }}\n onLoad={(e, w) => {\n setTimeout(() => {\n w.executeScript(this.getScriptToInject(this.props.process))\n .then((output) => {\n if (output) {\n const onComplete = this.props.onComplete;\n onComplete && onComplete(output as string);\n }\n });\n }, 1000);\n }}></WmWebview>\n </View>\n );\n }\n}\n\nexport class WebProcessService {\n\n baseUrl: string | null = null;\n\n constructor() {}\n\n public execute(process: string, hookUrl: string, useSystemBrowser = false, incognito = false): Promise<any> {\n if (!this.baseUrl) {\n this.baseUrl = injector.get<AppConfig>('APP_CONFIG').url;\n }\n return axios.get(this.baseUrl + `/services/webprocess/prepare?processName=${process}&hookUrl=${hookUrl}&requestSourceType=MOBILE`, {\n withCredentials: true\n })\n .then((response) => {\n if (useSystemBrowser) {\n return this.executeWithSystemBrowser(response.data);\n } else {\n return this.executeWithInAppBrowser(response.data, process, incognito);\n }\n }).then(output => {\n return axios.get(this.baseUrl + '/services/webprocess/decode?encodedProcessdata=' + output, {\n withCredentials: true\n });\n });\n }\n\n private executeWithSystemBrowser(processInfo: string): Promise<any> {\n return Promise.reject('Web Process in System browser is nor ready yet');\n }\n\n private executeWithInAppBrowser(processInfo: string, process: string, incognito: boolean): Promise<any> {\n return new Promise((resolve, reject) => {\n let destroyFn = () => {};\n destroyFn = AppDisplayManagerService.show({\n content: (\n <WebProcessWebView \n src={this.baseUrl + '/services/webprocess/start?process=' + encodeURIComponent(processInfo)}\n incognito={incognito}\n process={process}\n onComplete={(ouput) => {\n resolve(ouput);\n destroyFn.call(AppDisplayManagerService);\n }}></WebProcessWebView>\n ),\n \n });\n });\n }\n}\n\nexport default new WebProcessService();"],"mappings":";;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,OAAOC,SAAS,MAAM,yEAAyE;AAE/F,OAAOC,QAAQ,MAAM,yCAAyC;AAE9D,OAAOC,wBAAwB,MAAM,+BAA+B;AAIpE,MAAMC,WAAW,GAAGL,UAAU,CAACM,GAAG,CAAC,QAAQ,CAAC,CAACC,KAAK;AAClD,MAAMC,Y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SAAS,GAAG3C,wBAAwB,CAAC4C,IAAI,CAAC;QACtCC,OAAO,eACLnD,KAAA,CAAAoB,aAAA,CAACL,iBAAiB;UAChBO,GAAG,EAAE,IAAI,CAACgB,OAAO,GAAI,qCAAqC,GAAGc,kBAAkB,CAACP,WAAW,CAAE;UAC7FtB,SAAS,EAAEA,SAAU;UACrBL,OAAO,EAAEA,OAAQ;UACjBe,UAAU,EAAGoB,KAAK,IAAK;YACrBL,OAAO,CAACK,KAAK,CAAC;YACdJ,SAAS,CAACK,IAAI,CAAChD,wBAAwB,CAAC;UAC1C;QAAE,CAAoB;MAG5B,CAAC,CAAC;IACR,CAAC,CAAC;EACN;AACJ;AAEA,eAAe,IAAI4B,iBAAiB,CAAC,CAAC","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["isArray","clone","useEffect","useState","WIDGET_LOGGER","WATCH_LOGGER","extend","WatchExpression","constructor","fn","onChange","_defineProperty","last","execute","getExpBody","expBody","expStr","toString","substring","indexOf","lastIndexOf","e","isEqual","$old","$new","isArrayObj","length","i","value","check","start","Date","now","changed","lastExecutionTime","debug","Watcher","isActive","expressions","forEach","expression","children","child","create","parent","push","remove","splice","destroy","clear","watch","count","_Watcher","useWatcher","change","watcher"],"sources":["watcher.ts"],"sourcesContent":["import { isEqual as _isEqual, isArray, isObject, clone, remove, reverse, sortBy } from 'lodash';\nimport { useEffect, useMemo, useState } from 'react';\nimport { WIDGET_LOGGER } from '@wavemaker/app-rn-runtime/core/base.component';\n\nconst WATCH_LOGGER = WIDGET_LOGGER.extend(\"watch\");\n\nclass WatchExpression {\n private last: any = null;\n private expBody: string = null as any;\n public lastExecutionTime = 0;\n\n constructor(private fn: Function, private onChange: (prev: any, now: any) => any) {\n this.last = this.execute();\n if (isArray(this.last)) {\n this.last = clone(this.last);\n }\n }\n\n private getExpBody() {\n if (!this.expBody) {\n const expStr = this.fn.toString();\n this.expBody = expStr.substring(\n expStr.indexOf('return ') + 7,\n expStr.lastIndexOf(';'));\n }\n return this.expBody;\n }\n \n private execute() {\n try {\n return this.fn();\n } catch(e) {\n //do nothing\n return null;\n }\n }\n\n private isEqual($old: any, $new: any) {\n const isArrayObj = isArray($old) || isArray($new);\n if (isArrayObj) {\n if (($old && !$new) \n || (!$old && $new)\n || $old.length !== $new.length) {\n return false;\n }\n for(let i = 0; i < $old.length; i++) {\n if ($old[i] !== $new[i]) {\n return false;\n }\n }\n return true;\n }\n return $old === $new;\n }\n\n get value() {\n return this.last;\n }\n\n public check() {\n const start = Date.now();\n const now = this.execute();\n const changed = !this.isEqual(this.last, now);\n this.lastExecutionTime = Date.now() - start;\n if (changed) {\n WATCH_LOGGER.debug(() => {\n if (this.getExpBody() !== 'fragment') {\n return `Watcher: <${this.getExpBody()}> Changed from ${this.last} to ${now} `;\n }\n return '';\n });\n this.onChange(this.last, now);\n this.last = now;\n if (isArray(this.last)) {\n this.last = clone(this.last);\n }\n return true;\n }\n return false;\n }\n}\n\nexport class Watcher {\n public static ROOT = new Watcher();\n public expressions = [] as WatchExpression[];\n public isActive = true;\n public parent: Watcher = null as any;\n public children = [] as Watcher[];\n private constructor() {}\n\n check() {\n if (this.isActive) {\n this.expressions.forEach(expression => expression.check());\n this.children.forEach(child => {\n child.check();\n });\n }\n }\n \n create() {\n const child = new Watcher();\n child.parent = this;\n this.children.push(child);\n return child;\n }\n\n remove(child: Watcher) {\n if (this.children.length > 0) {\n const i = this.children.indexOf(child);\n if (i >= 0) {\n this.children.splice(i, 1);\n }\n }\n }\n\n destroy() {\n this.clear();\n this.parent && this.parent.remove(this);\n }\n\n clear() {\n this.children = [];\n this.expressions = [];\n }\n\n watch(fn: Function, onChange: (prev: any, now: any) => any) {\n const expression = new WatchExpression(fn, onChange);\n this.expressions.push(expression);\n return expression;\n }\n\n count() {\n if (!this.isActive) {\n return 0;\n }\n let count = this.expressions.length;\n this.children.forEach(child => {\n count += child.count();\n });\n return count;\n }\n}\n\nexport function useWatcher(parent: Watcher) {\n const [change, onChange] = useState({});\n let [ watcher ] = useState(() => parent.create());\n watcher.clear();\n useEffect(() => { \n return () => {\n watcher.destroy();\n };\n }, []);\n return {\n watch: (fn: Function) => {\n return watcher.watch(fn, () => onChange({})).value;\n }\n };\n};"],"mappings":";;;;AAAA,SAA8BA,OAAO,EAAYC,KAAK,QAAiC,QAAQ;AAC/F,SAASC,SAAS,EAAWC,QAAQ,QAAQ,OAAO;AACpD,SAASC,aAAa,QAAQ,+CAA+C;AAE7E,MAAMC,YAAY,GAAGD,aAAa,CAACE,MAAM,CAAC,OAAO,CAAC;AAElD,MAAMC,eAAe,CAAC;EAKlBC,WAAWA,CAASC,EAAY,EAAUC,QAAsC,EAAE;IAAA,KAA9DD,EAAY,GAAZA,EAAY;IAAA,KAAUC,QAAsC,GAAtCA,QAAsC;IAAAC,eAAA,eAJ5D,IAAI;IAAAA,eAAA,kBACE,IAAI;IAAAA,eAAA,4BACH,CAAC;IAGxB,IAAI,CAACC,IAAI,GAAG,IAAI,CAACC,OAAO,CAAC,CAAC;IAC1B,IAAIb,OAAO,CAAC,IAAI,CAACY,IAAI,CAAC,EAAE;MACpB,IAAI,CAACA,IAAI,GAAGX,KAAK,CAAC,IAAI,CAACW,IAAI,CAAC;IAChC;EACJ;EAEQE,UAAUA,CAAA,EAAG;IACjB,IAAI,CAAC,IAAI,CAACC,OAAO,EAAE;MACf,MAAMC,MAAM,GAAG,IAAI,CAACP,EAAE,CAACQ,QAAQ,CAAC,CAAC;MACjC,IAAI,CAACF,OAAO,GAAGC,MAAM,CAACE,SAAS,CAC3BF,MAAM,CAACG,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,EAC7BH,MAAM,CAACI,WAAW,CAAC,GAAG,CAAC,CAAC;IAChC;IACA,OAAO,IAAI,CAACL,OAAO;EACvB;EAEQF,OAAOA,CAAA,EAAG;IACd,IAAI;MACA,OAAO,IAAI,CAACJ,EAAE,CAAC,CAAC;IACpB,CAAC,CAAC,OAAMY,CAAC,EAAE;MACP;MACA,OAAO,IAAI;IACf;EACJ;EAEQC,OAAOA,CAACC,IAAS,EAAEC,IAAS,EAAE;IAClC,MAAMC,UAAU,GAAGzB,OAAO,CAACuB,IAAI,CAAC,IAAIvB,OAAO,CAACwB,IAAI,CAAC;IACjD,IAAIC,UAAU,EAAE;MACZ,IAAKF,IAAI,IAAI,CAACC,IAAI,IACV,CAACD,IAAI,IAAIC,IAAK,IACfD,IAAI,CAACG,MAAM,KAAKF,IAAI,CAACE,MAAM,EAAE;QAChC,OAAO,KAAK;MAChB;MACA,KAAI,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGJ,IAAI,CAACG,MAAM,EAAEC,CAAC,EAAE,EAAE;QACjC,IAAIJ,IAAI,CAACI,CAAC,CAAC,KAAKH,IAAI,CAACG,CAAC,CAAC,EAAE;UACrB,OAAO,KAAK;QAChB;MACJ;MACA,OAAO,IAAI;IACf;IACA,OAAOJ,IAAI,KAAKC,IAAI;EACxB;EAEA,IAAII,KAAKA,CAAA,EAAG;IACR,OAAO,IAAI,CAAChB,IAAI;EACpB;EAEOiB,KAAKA,CAAA,EAAG;IACX,MAAMC,KAAK,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;IACxB,MAAMA,GAAG,GAAG,IAAI,CAACnB,OAAO,CAAC,CAAC;IAC1B,MAAMoB,OAAO,GAAG,CAAC,IAAI,CAACX,OAAO,CAAC,IAAI,CAACV,IAAI,EAAEoB,GAAG,CAAC;IAC7C,IAAI,CAACE,iBAAiB,GAAGH,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGF,KAAK;IAC3C,IAAIG,OAAO,EAAE;MACT5B,YAAY,CAAC8B,KAAK,CAAC,MAAM;QACrB,IAAI,IAAI,CAACrB,UAAU,CAAC,CAAC,KAAK,UAAU,EAAE;UAClC,
|
1
|
+
{"version":3,"names":["isArray","clone","useEffect","useState","WIDGET_LOGGER","WATCH_LOGGER","extend","WatchExpression","constructor","fn","onChange","_defineProperty","last","execute","getExpBody","expBody","expStr","toString","substring","indexOf","lastIndexOf","e","isEqual","$old","$new","isArrayObj","length","i","value","check","start","Date","now","changed","lastExecutionTime","debug","Watcher","isActive","expressions","forEach","expression","children","child","create","parent","push","remove","splice","destroy","clear","watch","count","_Watcher","useWatcher","change","watcher"],"sources":["watcher.ts"],"sourcesContent":["import { isEqual as _isEqual, isArray, isObject, clone, remove, reverse, sortBy } from 'lodash';\nimport { useEffect, useMemo, useState } from 'react';\nimport { WIDGET_LOGGER } from '@wavemaker/app-rn-runtime/core/base.component';\n\nconst WATCH_LOGGER = WIDGET_LOGGER.extend(\"watch\");\n\nclass WatchExpression {\n private last: any = null;\n private expBody: string = null as any;\n public lastExecutionTime = 0;\n\n constructor(private fn: Function, private onChange: (prev: any, now: any) => any) {\n this.last = this.execute();\n if (isArray(this.last)) {\n this.last = clone(this.last);\n }\n }\n\n private getExpBody() {\n if (!this.expBody) {\n const expStr = this.fn.toString();\n this.expBody = expStr.substring(\n expStr.indexOf('return ') + 7,\n expStr.lastIndexOf(';'));\n }\n return this.expBody;\n }\n \n private execute() {\n try {\n return this.fn();\n } catch(e) {\n //do nothing\n return null;\n }\n }\n\n private isEqual($old: any, $new: any) {\n const isArrayObj = isArray($old) || isArray($new);\n if (isArrayObj) {\n if (($old && !$new) \n || (!$old && $new)\n || $old.length !== $new.length) {\n return false;\n }\n for(let i = 0; i < $old.length; i++) {\n if ($old[i] !== $new[i]) {\n return false;\n }\n }\n return true;\n }\n return $old === $new;\n }\n\n get value() {\n return this.last;\n }\n\n public check() {\n const start = Date.now();\n const now = this.execute();\n const changed = !this.isEqual(this.last, now);\n this.lastExecutionTime = Date.now() - start;\n if (changed) {\n WATCH_LOGGER.debug(() => {\n if (this.getExpBody() !== 'fragment') {\n return `Watcher: <${this.getExpBody()}> Changed from ${this.last} to ${now} `;\n }\n return '';\n });\n this.onChange(this.last, now);\n this.last = now;\n if (isArray(this.last)) {\n this.last = clone(this.last);\n }\n return true;\n }\n return false;\n }\n}\n\nexport class Watcher {\n public static ROOT = new Watcher();\n public expressions = [] as WatchExpression[];\n public isActive = true;\n public parent: Watcher = null as any;\n public children = [] as Watcher[];\n private constructor() {}\n\n check() {\n if (this.isActive) {\n this.expressions.forEach(expression => expression.check());\n this.children.forEach(child => {\n child.check();\n });\n }\n }\n \n create() {\n const child = new Watcher();\n child.parent = this;\n this.children.push(child);\n return child;\n }\n\n remove(child: Watcher) {\n if (this.children.length > 0) {\n const i = this.children.indexOf(child);\n if (i >= 0) {\n this.children.splice(i, 1);\n }\n }\n }\n\n destroy() {\n this.clear();\n this.parent && this.parent.remove(this);\n }\n\n clear() {\n this.children = [];\n this.expressions = [];\n }\n\n watch(fn: Function, onChange: (prev: any, now: any) => any) {\n const expression = new WatchExpression(fn, onChange);\n this.expressions.push(expression);\n return expression;\n }\n\n count() {\n if (!this.isActive) {\n return 0;\n }\n let count = this.expressions.length;\n this.children.forEach(child => {\n count += child.count();\n });\n return count;\n }\n}\n\nexport function useWatcher(parent: Watcher) {\n const [change, onChange] = useState({});\n let [ watcher ] = useState(() => parent.create());\n watcher.clear();\n useEffect(() => { \n return () => {\n watcher.destroy();\n };\n }, []);\n return {\n watch: (fn: Function) => {\n return watcher.watch(fn, () => onChange({})).value;\n }\n };\n};"],"mappings":";;;;AAAA,SAA8BA,OAAO,EAAYC,KAAK,QAAiC,QAAQ;AAC/F,SAASC,SAAS,EAAWC,QAAQ,QAAQ,OAAO;AACpD,SAASC,aAAa,QAAQ,+CAA+C;AAE7E,MAAMC,YAAY,GAAGD,aAAa,CAACE,MAAM,CAAC,OAAO,CAAC;AAElD,MAAMC,eAAe,CAAC;EAKlBC,WAAWA,CAASC,EAAY,EAAUC,QAAsC,EAAE;IAAA,KAA9DD,EAAY,GAAZA,EAAY;IAAA,KAAUC,QAAsC,GAAtCA,QAAsC;IAAAC,eAAA,eAJ5D,IAAI;IAAAA,eAAA,kBACE,IAAI;IAAAA,eAAA,4BACH,CAAC;IAGxB,IAAI,CAACC,IAAI,GAAG,IAAI,C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ACnC,IAAI,CAACe,QAAQ,CAACF,OAAO,CAACG,KAAK,IAAI;MAC3BS,KAAK,IAAIT,KAAK,CAACS,KAAK,CAAC,CAAC;IAC1B,CAAC,CAAC;IACF,OAAOA,KAAK;EAChB;AACJ;AAACC,QAAA,GA3DYhB,OAAO;AAAAzB,eAAA,CAAPyB,OAAO,UACK,IAAIA,QAAO,CAAC,CAAC;AA4DtC,OAAO,SAASiB,UAAUA,CAACT,MAAe,EAAE;EACxC,MAAM,CAACU,MAAM,EAAE5C,QAAQ,CAAC,GAAGP,QAAQ,CAAC,CAAC,CAAC,CAAC;EACvC,IAAI,CAAEoD,OAAO,CAAE,GAAGpD,QAAQ,CAAC,MAAMyC,MAAM,CAACD,MAAM,CAAC,CAAC,CAAC;EACjDY,OAAO,CAACN,KAAK,CAAC,CAAC;EACf/C,SAAS,CAAC,MAAM;IACZ,OAAO,MAAM;MACTqD,OAAO,CAACP,OAAO,CAAC,CAAC;IACrB,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EACN,OAAO;IACHE,KAAK,EAAGzC,EAAY,IAAK;MACrB,OAAO8C,OAAO,CAACL,KAAK,CAACzC,EAAE,EAAE,MAAMC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAACkB,KAAK;IACtD;EACJ,CAAC;AACL;AAAC","ignoreList":[]}
|
@@ -94,6 +94,7 @@ export class LinearGradient extends React.Component {
|
|
94
94
|
alignItems: 'center'
|
95
95
|
} : null]
|
96
96
|
}, /*#__PURE__*/React.createElement(ExpoLinearGradient, {
|
97
|
+
testID: "wm-expo-linear-gradient",
|
97
98
|
colors: this.state.colors,
|
98
99
|
locations: this.state.locations,
|
99
100
|
start: this.state.start,
|