@wavemaker/app-rn-runtime 11.4.0-next.25501 → 11.4.0-next.25703
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- app-rn-runtime/actions/base-action.js.map +1 -1
- app-rn-runtime/actions/login-action.js.map +1 -1
- app-rn-runtime/actions/logout-action.js.map +1 -1
- app-rn-runtime/actions/navigation-action.js +14 -2
- app-rn-runtime/actions/navigation-action.js.map +1 -1
- app-rn-runtime/actions/notification-action.js +5 -4
- app-rn-runtime/actions/notification-action.js.map +1 -1
- app-rn-runtime/actions/timer-action.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.component.js +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-content/carousel-content.props.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel-template/carousel-template.props.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.component.js +2 -2
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.props.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.styles.js +16 -0
- app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
- app-rn-runtime/components/advanced/login/login.component.js +1 -1
- app-rn-runtime/components/advanced/login/login.component.js.map +1 -1
- app-rn-runtime/components/advanced/login/login.props.js.map +1 -1
- app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js +5 -5
- app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.component.js.map +1 -1
- app-rn-runtime/components/advanced/network-info-toaster/network-info-toaster.props.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.props.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js +2 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.props.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.styles.js +5 -0
- app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
- app-rn-runtime/components/basic/animatedview.component.js +1 -3
- app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
- app-rn-runtime/components/basic/audio/audio.component.js +240 -0
- app-rn-runtime/components/basic/audio/audio.component.js.map +1 -0
- app-rn-runtime/components/basic/audio/audio.props.js +15 -0
- app-rn-runtime/components/basic/audio/audio.props.js.map +1 -0
- app-rn-runtime/components/basic/audio/audio.styles.js +61 -0
- app-rn-runtime/components/basic/audio/audio.styles.js.map +1 -0
- app-rn-runtime/components/basic/button/button.component.js +1 -1
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/button/button.props.js.map +1 -1
- app-rn-runtime/components/basic/button/button.styles.js.map +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.component.js +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.component.js.map +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.props.js.map +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js.map +1 -1
- app-rn-runtime/components/basic/custom/custom.component.js +25 -0
- app-rn-runtime/components/basic/custom/custom.component.js.map +1 -0
- app-rn-runtime/components/basic/custom/custom.props.js +16 -0
- app-rn-runtime/components/basic/custom/custom.props.js.map +1 -0
- app-rn-runtime/components/basic/custom/custom.styles.js +18 -0
- app-rn-runtime/components/basic/custom/custom.styles.js.map +1 -0
- app-rn-runtime/components/basic/icon/icon.component.js +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.props.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.styles.js +5 -0
- app-rn-runtime/components/basic/icon/icon.styles.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +3 -2
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.props.js.map +1 -1
- app-rn-runtime/components/basic/label/label.styles.js +8 -0
- app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
- app-rn-runtime/components/basic/lottie/lottie.component.js +137 -0
- app-rn-runtime/components/basic/lottie/lottie.component.js.map +1 -0
- app-rn-runtime/components/basic/lottie/lottie.props.js +14 -0
- app-rn-runtime/components/basic/lottie/lottie.props.js.map +1 -0
- app-rn-runtime/components/basic/lottie/lottie.styles.js +11 -0
- app-rn-runtime/components/basic/lottie/lottie.styles.js.map +1 -0
- app-rn-runtime/components/basic/message/message.component.js +1 -1
- app-rn-runtime/components/basic/message/message.component.js.map +1 -1
- app-rn-runtime/components/basic/message/message.props.js.map +1 -1
- app-rn-runtime/components/basic/message/message.styles.js +22 -0
- app-rn-runtime/components/basic/message/message.styles.js.map +1 -1
- app-rn-runtime/components/basic/modal/modal.component.js.map +1 -1
- app-rn-runtime/components/basic/modal/modal.props.js.map +1 -1
- app-rn-runtime/components/basic/modal/modal.styles.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.component.js +40 -29
- app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.props.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.styles.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js +3 -2
- app-rn-runtime/components/basic/progress-bar/progress-bar.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.props.js.map +1 -1
- app-rn-runtime/components/basic/progress-bar/progress-bar.styles.js.map +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.props.js.map +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.styles.js.map +1 -1
- app-rn-runtime/components/basic/search/local-data-provider.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js +5 -2
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.props.js +1 -0
- app-rn-runtime/components/basic/search/search.props.js.map +1 -1
- app-rn-runtime/components/basic/search/search.styles.js +47 -0
- app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.component.js +13 -11
- app-rn-runtime/components/basic/spinner/spinner.component.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.props.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.styles.js +8 -0
- app-rn-runtime/components/basic/spinner/spinner.styles.js.map +1 -1
- app-rn-runtime/components/basic/video/video.component.js +56 -0
- app-rn-runtime/components/basic/video/video.component.js.map +1 -0
- app-rn-runtime/components/basic/video/video.props.js +22 -0
- app-rn-runtime/components/basic/video/video.props.js.map +1 -0
- app-rn-runtime/components/basic/video/video.styles.js +11 -0
- app-rn-runtime/components/basic/video/video.styles.js.map +1 -0
- app-rn-runtime/components/chart/area-chart/area-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/bar-chart/bar-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.component.js +6 -2
- app-rn-runtime/components/chart/basechart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.props.js +1 -0
- app-rn-runtime/components/chart/basechart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.styles.js +17 -0
- app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/column-chart/column-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/donut-chart/donut-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/donut-chart/donut-chart.props.js +0 -1
- app-rn-runtime/components/chart/donut-chart/donut-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/legend/legend.component.js +36 -0
- app-rn-runtime/components/chart/legend/legend.component.js.map +1 -0
- app-rn-runtime/components/chart/line-chart/line-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js +119 -40
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/pie-chart/pie-chart.props.js +1 -2
- app-rn-runtime/components/chart/pie-chart/pie-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/theme/chart.theme.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.component.js +75 -119
- app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.props.js +1 -0
- app-rn-runtime/components/container/accordion/accordion.props.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordion.styles.js +14 -4
- app-rn-runtime/components/container/accordion/accordion.styles.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +49 -8
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.props.js.map +1 -1
- app-rn-runtime/components/container/container.component.js +1 -1
- app-rn-runtime/components/container/container.component.js.map +1 -1
- app-rn-runtime/components/container/container.props.js.map +1 -1
- app-rn-runtime/components/container/container.styles.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js +1 -1
- app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridcolumn/gridcolumn.props.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.component.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/gridrow/gridrow.props.js.map +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.js +1 -1
- 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.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayout.component.js +1 -1
- 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/linearlayoutitem/linearlayoutitem.component.js +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.js.map +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.props.js.map +1 -1
- app-rn-runtime/components/container/panel/panel-content/panel-content.component.js +1 -1
- app-rn-runtime/components/container/panel/panel-content/panel-content.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel-content/panel-content.props.js.map +1 -1
- app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js +1 -1
- app-rn-runtime/components/container/panel/panel-footer/panel-footer.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel-footer/panel-footer.props.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.component.js +1 -1
- 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 +9 -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 +42 -9
- 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/tabheader/tabheader.styles.js +12 -2
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabpane/tabpane.component.js +5 -2
- 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 +84 -65
- app-rn-runtime/components/container/tabs/tabs.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.props.js +1 -0
- app-rn-runtime/components/container/tabs/tabs.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js +40 -1
- app-rn-runtime/components/container/tabs/tabs.styles.js.map +1 -1
- app-rn-runtime/components/container/tile/tile.component.js +1 -1
- 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.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +16 -7
- 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 +53 -1
- app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-content/card-content.props.js.map +1 -1
- app-rn-runtime/components/data/card/card-footer/card-footer.component.js +1 -1
- app-rn-runtime/components/data/card/card-footer/card-footer.component.js.map +1 -1
- app-rn-runtime/components/data/card/card-footer/card-footer.props.js.map +1 -1
- app-rn-runtime/components/data/card/card.component.js +1 -1
- app-rn-runtime/components/data/card/card.component.js.map +1 -1
- app-rn-runtime/components/data/card/card.props.js.map +1 -1
- app-rn-runtime/components/data/form/form-action/form-action.component.js +0 -6
- app-rn-runtime/components/data/form/form-action/form-action.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-action/form-action.props.js.map +1 -1
- app-rn-runtime/components/data/form/form-action/form-action.styles.js.map +1 -1
- app-rn-runtime/components/data/form/form-body/form-body.component.js +1 -1
- app-rn-runtime/components/data/form/form-body/form-body.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-body/form-body.props.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js +3 -3
- app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.props.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.styles.js.map +1 -1
- app-rn-runtime/components/data/form/form-footer/form-footer.component.js +1 -1
- app-rn-runtime/components/data/form/form-footer/form-footer.component.js.map +1 -1
- app-rn-runtime/components/data/form/form-footer/form-footer.props.js.map +1 -1
- app-rn-runtime/components/data/form/form.component.js +3 -33
- app-rn-runtime/components/data/form/form.component.js.map +1 -1
- app-rn-runtime/components/data/form/form.props.js.map +1 -1
- app-rn-runtime/components/data/form/form.styles.js.map +1 -1
- app-rn-runtime/components/data/list/list-template/list-template.component.js +1 -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.map +1 -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 +94 -24
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.props.js +2 -0
- app-rn-runtime/components/data/list/list.props.js.map +1 -1
- app-rn-runtime/components/data/list/list.styles.js.map +1 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js +3 -2
- app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.props.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.component.js +9 -4
- app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.props.js +0 -1
- app-rn-runtime/components/device/camera/camera.props.js.map +1 -1
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.props.js.map +1 -1
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.props.js.map +1 -1
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.styles.js +9 -0
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js +6 -3
- app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.props.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js +1 -1
- app-rn-runtime/components/dialogs/dialogactions/dialogactions.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogactions/dialogactions.props.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.props.js.map +1 -1
- app-rn-runtime/components/input/basedataset/basedataset.component.js.map +1 -1
- app-rn-runtime/components/input/basedataset/basedataset.props.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js +8 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
- app-rn-runtime/components/input/calendar/calendar.component.js +1 -1
- app-rn-runtime/components/input/calendar/calendar.component.js.map +1 -1
- app-rn-runtime/components/input/calendar/calendar.props.js.map +1 -1
- app-rn-runtime/components/input/calendar/calendar.styles.js +22 -0
- app-rn-runtime/components/input/calendar/calendar.styles.js.map +1 -1
- app-rn-runtime/components/input/calendar/views/month-view.js +1 -0
- app-rn-runtime/components/input/calendar/views/month-view.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +1 -16
- app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.props.js +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.props.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js +0 -38
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.props.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.component.js +1 -0
- app-rn-runtime/components/input/chips/chips.component.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.props.js.map +1 -1
- app-rn-runtime/components/input/composite/composite.component.js +1 -1
- app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
- app-rn-runtime/components/input/composite/composite.props.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.component.js +6 -4
- app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.props.js +1 -1
- app-rn-runtime/components/input/currency/currency.props.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.styles.js +9 -0
- app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +6 -3
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/date/date.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/date/date.props.js.map +1 -1
- app-rn-runtime/components/input/epoch/date/date.styles.js +9 -0
- app-rn-runtime/components/input/epoch/date/date.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/date-picker.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +9 -0
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/time/time.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/time/time.props.js.map +1 -1
- app-rn-runtime/components/input/epoch/time/time.styles.js +9 -0
- app-rn-runtime/components/input/epoch/time/time.styles.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +6 -13
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/number/number.props.js +1 -1
- app-rn-runtime/components/input/number/number.props.js.map +1 -1
- app-rn-runtime/components/input/number/number.styles.js +5 -0
- app-rn-runtime/components/input/number/number.styles.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +3 -41
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.props.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.styles.js +8 -0
- app-rn-runtime/components/input/radioset/radioset.styles.js.map +1 -1
- app-rn-runtime/components/input/rating/rating.component.js +2 -2
- app-rn-runtime/components/input/rating/rating.component.js.map +1 -1
- app-rn-runtime/components/input/rating/rating.props.js.map +1 -1
- app-rn-runtime/components/input/select/select.component.js +14 -2
- app-rn-runtime/components/input/select/select.component.js.map +1 -1
- app-rn-runtime/components/input/select/select.props.js.map +1 -1
- app-rn-runtime/components/input/select/select.styles.js +18 -1
- app-rn-runtime/components/input/select/select.styles.js.map +1 -1
- app-rn-runtime/components/input/slider/slider.component.js +3 -2
- app-rn-runtime/components/input/slider/slider.component.js.map +1 -1
- app-rn-runtime/components/input/slider/slider.props.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.component.js +19 -22
- app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.props.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.styles.js +43 -7
- app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +6 -13
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/text/text.props.js.map +1 -1
- app-rn-runtime/components/input/text/text.styles.js +5 -0
- app-rn-runtime/components/input/text/text.styles.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +5 -13
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.styles.js +5 -0
- app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +17 -11
- app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.props.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.styles.js +28 -3
- app-rn-runtime/components/input/toggle/toggle.styles.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js.map +1 -1
- app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
- app-rn-runtime/components/navigation/basenav/basenav.props.js +1 -0
- app-rn-runtime/components/navigation/basenav/basenav.props.js.map +1 -1
- app-rn-runtime/components/navigation/menu/menu.component.js +2 -1
- app-rn-runtime/components/navigation/menu/menu.component.js.map +1 -1
- app-rn-runtime/components/navigation/menu/menu.props.js.map +1 -1
- app-rn-runtime/components/navigation/menu/menu.styles.js +6 -0
- app-rn-runtime/components/navigation/menu/menu.styles.js.map +1 -1
- app-rn-runtime/components/navigation/navbar/navbar.component.js +2 -0
- app-rn-runtime/components/navigation/navbar/navbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/navbar/navbar.props.js.map +1 -1
- app-rn-runtime/components/navigation/navbar/navbar.styles.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.component.js +4 -3
- app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.props.js +1 -0
- app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.styles.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.props.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.styles.js.map +1 -1
- app-rn-runtime/components/page/content/content.component.js +1 -1
- app-rn-runtime/components/page/content/content.component.js.map +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.component.js.map +1 -1
- app-rn-runtime/components/page/left-panel/left-panel.props.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.component.js +2 -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.map +1 -1
- app-rn-runtime/components/page/page.component.js +1 -1
- app-rn-runtime/components/page/page.component.js.map +1 -1
- app-rn-runtime/components/page/partial/partial.component.js +1 -1
- app-rn-runtime/components/page/partial/partial.component.js.map +1 -1
- app-rn-runtime/components/page/partial-container/partial-container.component.js +1 -1
- app-rn-runtime/components/page/partial-container/partial-container.component.js.map +1 -1
- app-rn-runtime/components/page/partial-container/partial-container.props.js.map +1 -1
- app-rn-runtime/components/page/partial-container/partial-container.styles.js +2 -1
- app-rn-runtime/components/page/partial-container/partial-container.styles.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.component.js +2 -1
- app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.props.js.map +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js +1 -1
- app-rn-runtime/components/prefab/prefab-container.component.js.map +1 -1
- app-rn-runtime/core/asset.provider.js +5 -0
- app-rn-runtime/core/asset.provider.js.map +1 -0
- app-rn-runtime/core/base.component.js +141 -57
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/components/textinput.component.js +37 -0
- app-rn-runtime/core/components/textinput.component.js.map +1 -0
- app-rn-runtime/core/device/camera-service.js.map +1 -1
- app-rn-runtime/core/device/scan-service.js.map +1 -1
- app-rn-runtime/core/display.manager.js.map +1 -1
- app-rn-runtime/core/event-notifier.js.map +1 -1
- app-rn-runtime/core/fixed-view.component.js.map +1 -1
- app-rn-runtime/core/formatters.js.map +1 -1
- app-rn-runtime/core/i18n.service.js +2 -0
- app-rn-runtime/core/i18n.service.js.map +1 -0
- app-rn-runtime/core/if.component.js +3 -3
- app-rn-runtime/core/if.component.js.map +1 -1
- app-rn-runtime/core/imageSizeEstimator.js +1 -0
- app-rn-runtime/core/imageSizeEstimator.js.map +1 -1
- app-rn-runtime/core/injector.js +16 -1
- app-rn-runtime/core/injector.js.map +1 -1
- app-rn-runtime/core/logger.js +4 -1
- app-rn-runtime/core/logger.js.map +1 -1
- app-rn-runtime/core/modal.service.js.map +1 -1
- app-rn-runtime/core/navigation.service.js.map +1 -1
- app-rn-runtime/core/network.service.js +17 -15
- app-rn-runtime/core/network.service.js.map +1 -1
- app-rn-runtime/core/partial.service.js.map +1 -1
- app-rn-runtime/core/props.provider.js +1 -1
- app-rn-runtime/core/props.provider.js.map +1 -1
- app-rn-runtime/core/scroll-view.component.js.map +1 -1
- app-rn-runtime/core/security.service.js.map +1 -1
- app-rn-runtime/core/spinner.service.js.map +1 -1
- app-rn-runtime/core/storage.service.js.map +1 -1
- app-rn-runtime/core/tappable.component.js +20 -4
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/core/toast.service.js.map +1 -1
- app-rn-runtime/core/utils.js +24 -0
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/core/viewport.js.map +1 -1
- app-rn-runtime/gestures/swipe.animation.js +110 -0
- app-rn-runtime/gestures/swipe.animation.js.map +1 -0
- app-rn-runtime/package.json +33 -32
- app-rn-runtime/runtime/App.js +38 -22
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/App.navigator.js +13 -14
- app-rn-runtime/runtime/App.navigator.js.map +1 -1
- app-rn-runtime/runtime/base-fragment.component.js +13 -11
- app-rn-runtime/runtime/base-fragment.component.js.map +1 -1
- app-rn-runtime/runtime/base-page.component.js +2 -0
- 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 +1 -5
- app-rn-runtime/runtime/base-prefab.component.js.map +1 -1
- app-rn-runtime/runtime/lib-patch.js.map +1 -1
- app-rn-runtime/runtime/memo.component.js.map +1 -1
- app-rn-runtime/runtime/navigator/drawer.navigator.js +4 -0
- app-rn-runtime/runtime/navigator/drawer.navigator.js.map +1 -1
- app-rn-runtime/runtime/navigator/stack.navigator.js +5 -1
- app-rn-runtime/runtime/navigator/stack.navigator.js.map +1 -1
- app-rn-runtime/runtime/services/app-display-manager.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-i18n.service.js +26 -3
- app-rn-runtime/runtime/services/app-i18n.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-modal.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-security.service.js +7 -7
- app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-spinner.service.js +8 -3
- app-rn-runtime/runtime/services/app-spinner.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-toast.service.js +1 -1
- app-rn-runtime/runtime/services/app-toast.service.js.map +1 -1
- app-rn-runtime/runtime/services/device/calendar-service.js.map +1 -1
- app-rn-runtime/runtime/services/device/camera-service.js +30 -9
- app-rn-runtime/runtime/services/device/camera-service.js.map +1 -1
- app-rn-runtime/runtime/services/device/contacts-service.js.map +1 -1
- app-rn-runtime/runtime/services/device/location-service.js.map +1 -1
- app-rn-runtime/runtime/services/device/permissions.js.map +1 -1
- app-rn-runtime/runtime/services/device/scan-service.js +15 -14
- app-rn-runtime/runtime/services/device/scan-service.js.map +1 -1
- app-rn-runtime/runtime/services/partial.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/MediaQueryList.js.map +1 -1
- app-rn-runtime/styles/background.component.js +298 -0
- app-rn-runtime/styles/background.component.js.map +1 -0
- app-rn-runtime/styles/style-prop.validator.js +42 -8
- app-rn-runtime/styles/style-prop.validator.js.map +1 -1
- app-rn-runtime/styles/style-props.js +93 -0
- app-rn-runtime/styles/style-props.js.map +1 -0
- app-rn-runtime/styles/theme.js +14 -40
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/styles/theme.variables.js +55 -1
- app-rn-runtime/styles/theme.variables.js.map +1 -1
- app-rn-runtime/variables/base-variable.js +3 -3
- app-rn-runtime/variables/base-variable.js.map +1 -1
- app-rn-runtime/variables/device/calendar/create-event.operation.js.map +1 -1
- app-rn-runtime/variables/device/calendar/delete-event.operation.js.map +1 -1
- app-rn-runtime/variables/device/calendar/get-events.operation.js.map +1 -1
- app-rn-runtime/variables/device/camera/capture-image.operation.js.map +1 -1
- app-rn-runtime/variables/device/camera/capture-video.operation.js.map +1 -1
- app-rn-runtime/variables/device/contacts/get-contacts.operation.js.map +1 -1
- app-rn-runtime/variables/device/device/app-info.operation.js.map +1 -1
- app-rn-runtime/variables/device/device/current-geo-position.operation.js.map +1 -1
- app-rn-runtime/variables/device/device/device-info.operation.js.map +1 -1
- app-rn-runtime/variables/device/device/network-info.operation.js.map +1 -1
- app-rn-runtime/variables/device/device/vibrate.operation.js.map +1 -1
- app-rn-runtime/variables/device/file/upload-file.operation.js +43 -21
- app-rn-runtime/variables/device/file/upload-file.operation.js.map +1 -1
- app-rn-runtime/variables/device/operation.provider.js.map +1 -1
- app-rn-runtime/variables/device/scan/scan.operation.js.map +1 -1
- app-rn-runtime/variables/device-variable.js.map +1 -1
- app-rn-runtime/variables/http.service.js +4 -13
- app-rn-runtime/variables/http.service.js.map +1 -1
- app-rn-runtime/variables/model-variable.js.map +1 -1
- app-rn-runtime/variables/service-variable.js +27 -11
- app-rn-runtime/variables/service-variable.js.map +1 -1
- app-rn-runtime/variables/utils/dataset-util.js.map +1 -1
- app-rn-runtime/variables/utils/inflight-queue.js.map +1 -1
- app-rn-runtime/variables/utils/variable.utils.js.map +1 -1
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
2
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
3
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
import { VariableEvents } from './base-variable';
|
|
4
5
|
import { isEqual } from 'lodash';
|
|
6
|
+
import { deepCopy } from '@wavemaker/app-rn-runtime/core/utils';
|
|
5
7
|
import { ServiceVariable as _ServiceVariable } from '@wavemaker/variables/src/model/variable/service-variable';
|
|
6
8
|
import httpService from '@wavemaker/app-rn-runtime/variables/http.service';
|
|
7
9
|
import injector from '@wavemaker/app-rn-runtime/core/injector';
|
|
8
|
-
var _ServiceVariableEvents
|
|
9
|
-
(function (_ServiceVariableEvents) {
|
|
10
|
+
var _ServiceVariableEvents = /*#__PURE__*/function (_ServiceVariableEvents) {
|
|
10
11
|
_ServiceVariableEvents["BEFORE_INVOKE"] = "beforeInvoke";
|
|
11
|
-
|
|
12
|
+
return _ServiceVariableEvents;
|
|
13
|
+
}(_ServiceVariableEvents || {});
|
|
12
14
|
export class ServiceVariable extends _ServiceVariable {
|
|
13
15
|
constructor(config) {
|
|
14
16
|
const variableConfig = {
|
|
15
17
|
name: config.name,
|
|
16
18
|
dataSet: config.paramProvider(),
|
|
17
|
-
dataBinding:
|
|
19
|
+
dataBinding: {},
|
|
18
20
|
isList: config.isList,
|
|
19
21
|
service: config.service,
|
|
20
22
|
serviceType: config.serviceType,
|
|
@@ -25,16 +27,21 @@ export class ServiceVariable extends _ServiceVariable {
|
|
|
25
27
|
serviceInfo: config.getServiceInfo(),
|
|
26
28
|
httpClientService: httpService,
|
|
27
29
|
onSuccess: (context, args) => {
|
|
30
|
+
this.notify(VariableEvents.AFTER_INVOKE, [args.variable, args.data, args.options]);
|
|
31
|
+
this.notify(VariableEvents.SUCCESS, [args.variable, args.data, args.options]);
|
|
28
32
|
return config.onSuccess && config.onSuccess(args.variable, args.data, args.options);
|
|
29
33
|
},
|
|
30
34
|
onError: (context, args) => {
|
|
35
|
+
this.notify(VariableEvents.AFTER_INVOKE, [args.variable, args.data, args.options]);
|
|
36
|
+
this.notify(VariableEvents.ERROR, [args.variable, args.data, args.options]);
|
|
31
37
|
return config.onError && config.onError(args.variable, args.data, args.options);
|
|
32
38
|
},
|
|
33
39
|
onCanUpdate: (context, args) => {
|
|
34
40
|
return config.onCanUpdate && config.onCanUpdate(args.variable, args.data, args.options);
|
|
35
41
|
},
|
|
36
42
|
onBeforeUpdate: (context, args) => {
|
|
37
|
-
|
|
43
|
+
this.notify(VariableEvents.BEFORE_INVOKE, [args.variable, args.inputData, args.options]);
|
|
44
|
+
return config.onBeforeUpdate && config.onBeforeUpdate(args.variable, args.inputData, args.options);
|
|
38
45
|
},
|
|
39
46
|
onResult: (context, args) => {
|
|
40
47
|
return config.onResult && config.onResult(args.variable, args.data, args.options);
|
|
@@ -48,12 +55,15 @@ export class ServiceVariable extends _ServiceVariable {
|
|
|
48
55
|
_defineProperty(this, "cancelTokenSource", void 0);
|
|
49
56
|
_defineProperty(this, "params", {});
|
|
50
57
|
_defineProperty(this, "appConfig", injector.get('APP_CONFIG'));
|
|
58
|
+
this.subscribe(VariableEvents.AFTER_INVOKE, () => {
|
|
59
|
+
this.dataBinding = {};
|
|
60
|
+
});
|
|
51
61
|
}
|
|
52
62
|
invokeOnParamChange() {
|
|
53
63
|
const last = this.params;
|
|
54
64
|
const latest = this.config.paramProvider();
|
|
55
65
|
if (!isEqual(last, latest)) {
|
|
56
|
-
this.invoke();
|
|
66
|
+
this.invoke(latest);
|
|
57
67
|
}
|
|
58
68
|
return Promise.resolve(this);
|
|
59
69
|
}
|
|
@@ -67,7 +77,13 @@ export class ServiceVariable extends _ServiceVariable {
|
|
|
67
77
|
this.appConfig.refresh(false);
|
|
68
78
|
}
|
|
69
79
|
invoke(options, onSuccess, onError) {
|
|
70
|
-
this.
|
|
80
|
+
this.params = this.config.paramProvider();
|
|
81
|
+
this.params = deepCopy({}, this.params, this.dataBinding);
|
|
82
|
+
if (options) {
|
|
83
|
+
this.params = deepCopy({}, this.params, options.inputFields ? options.inputFields : options);
|
|
84
|
+
}
|
|
85
|
+
options = options || {};
|
|
86
|
+
options.inputFields = this.params;
|
|
71
87
|
// service definitions data depends on whether user logged in or not
|
|
72
88
|
// Try to get the latest definition
|
|
73
89
|
this.serviceInfo = this.config.getServiceInfo();
|
|
@@ -103,9 +119,9 @@ export class ServiceVariable extends _ServiceVariable {
|
|
|
103
119
|
// }
|
|
104
120
|
// }
|
|
105
121
|
|
|
106
|
-
setInput(key, val, options) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
122
|
+
// setInput(key: any, val?: any, options?: any) {
|
|
123
|
+
// this.params = merge({}, this.config.paramProvider(), _setInput(this.params, key, val, options));
|
|
124
|
+
// return this.params;
|
|
125
|
+
// }
|
|
110
126
|
}
|
|
111
127
|
//# sourceMappingURL=service-variable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isEqual","ServiceVariable","_ServiceVariable","httpService","injector","_ServiceVariableEvents","constructor","config","variableConfig","name","dataSet","paramProvider","dataBinding","isList","service","serviceType","maxResults","_context","operation","operationId","serviceInfo","getServiceInfo","httpClientService","onSuccess","context","args","variable","data","options","onError","onCanUpdate","onBeforeUpdate","onResult","onBeforeDatasetReady","get","invokeOnParamChange","last","params","latest","invoke","Promise","resolve","doNext","currentPage","reject","onDataUpdated","appConfig","refresh","console","error","setInput","key","val"],"sources":["service-variable.ts"],"sourcesContent":["import { VariableConfig, VariableEvents } from './base-variable';\nimport { isEqual } from 'lodash';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport { $queue } from './utils/inflight-queue';\nimport { ServiceVariable as _ServiceVariable } from '@wavemaker/variables/src/model/variable/service-variable';\nimport httpService from '@wavemaker/app-rn-runtime/variables/http.service';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport interface ServiceVariableConfig extends VariableConfig {\n baseUrl: string;\n maxResults: number;\n _context: any;\n serviceType: string;\n onCanUpdate: any;\n onBeforeUpdate: any;\n onResult: any;\n onBeforeDatasetReady: any;\n inFlightBehavior: string;\n getServiceInfo: Function;\n}\n\nenum _ServiceVariableEvents {\n BEFORE_INVOKE = 'beforeInvoke'\n}\nexport type ServiceVariableEvents = _ServiceVariableEvents | VariableEvents;\n\nexport class ServiceVariable extends _ServiceVariable {\n private cancelTokenSource: any;\n params: any = {};\n public appConfig = injector.get<AppConfig>('APP_CONFIG');\n\n constructor(public config: ServiceVariableConfig) {\n const variableConfig = {\n name: config.name,\n dataSet: config.paramProvider(),\n dataBinding: config.paramProvider(),\n isList: config.isList,\n service: config.service,\n serviceType: config.serviceType,\n maxResults: config.maxResults,\n _context: config._context,\n operation: config.operation,\n operationId: config.operationId,\n serviceInfo: config.getServiceInfo(),\n httpClientService: httpService,\n onSuccess: (context: any, args: any) => {\n return config.onSuccess && config.onSuccess(args.variable, args.data, args.options);\n },\n onError: (context: any, args: any) => {\n return config.onError && config.onError(args.variable, args.data, args.options);\n },\n onCanUpdate: (context: any, args: any) => {\n return config.onCanUpdate && config.onCanUpdate(args.variable, args.data, args.options);\n },\n onBeforeUpdate: (context: any, args: any) => {\n return config.onBeforeUpdate && config.onBeforeUpdate(args.variable, args.data, args.options);\n },\n onResult: (context: any, args: any) => {\n return config.onResult && config.onResult(args.variable, args.data, args.options);\n },\n onBeforeDatasetReady: (context: any, args: any) => {\n return config.onBeforeDatasetReady && config.onBeforeDatasetReady(args.variable, args.data, args.options);\n }\n }\n super(variableConfig);\n }\n\n invokeOnParamChange() {\n const last = this.params;\n const latest = this.config.paramProvider();\n if (!isEqual(last, latest)) {\n this.invoke();\n }\n return Promise.resolve(this);\n }\n\n public doNext(currentPage: number) {\n // this.invoke({\n // page: currentPage\n // });\n return Promise.reject(this);\n }\n\n onDataUpdated() {\n this.appConfig.refresh(false);\n }\n\n invoke(options? : any, onSuccess?: Function, onError?: Function) {\n this.dataBinding = this.params = this.config.paramProvider();\n // service definitions data depends on whether user logged in or not\n // Try to get the latest definition\n this.serviceInfo = this.config.getServiceInfo();\n if (!this.serviceInfo) {\n console.error(`Service Info is missing for (${this.name}) variable.`)\n }\n return super.invoke(options, onSuccess, onError);\n }\n\n // cancel($file?: any) {\n // // CHecks if there is any pending requests in the queue\n // if ($queue.requestsQueue.has(this)) {\n // // If the request is a File upload request then modify the elements associated with file upload\n // // else unsubscribe from the observable on the variable.\n // if (false) {\n // // $file._uploadProgress.unsubscribe();\n // // $file.status = 'abort';\n // // this.totalFilesCount--;\n // // initiateCallback(VARIABLE_CONSTANTS.EVENT.ABORT, variable, $file);\n // // if (!this.isFileUploadInProgress(variable.dataBinding) && this.totalFilesCount === 0) {\n // // $queue.process(variable);\n // // // notify inflight variable\n // // this.notifyInflight(variable, false);\n // // }\n // } else {\n // if (true) {\n // this.cancelTokenSource.cancel();\n // $queue.process(this);\n // // notify inflight variable\n // //this.notifyInflight(variable, false);\n // }\n // }\n // }\n // }\n\n setInput(key: any, val?: any, options?: any) {\n // this.params = merge({}, this.config.paramProvider(), _setInput(this.params, key, val, options));\n // return this.params;\n }\n}\n"],"mappings":";;;AACA,SAASA,OAAO,QAAQ,QAAQ;AAGhC,SAASC,eAAe,IAAIC,gBAAgB,QAAQ,0DAA0D;AAC9G,OAAOC,WAAW,MAAM,kDAAkD;AAC1E,OAAOC,QAAQ,MAAM,yCAAyC;AAAC,IAe1DC,sBAAsB;AAAA,WAAtBA,sBAAsB;EAAtBA,sBAAsB;AAAA,GAAtBA,sBAAsB,KAAtBA,sBAAsB;AAK3B,OAAO,MAAMJ,eAAe,SAASC,gBAAgB,CAAC;EAKpDI,WAAW,CAAQC,MAA6B,EAAE;IAChD,MAAMC,cAAc,GAAG;MACrBC,IAAI,EAAEF,MAAM,CAACE,IAAI;MACjBC,OAAO,EAAEH,MAAM,CAACI,aAAa,EAAE;MAC/BC,WAAW,EAAEL,MAAM,CAACI,aAAa,EAAE;MACnCE,MAAM,EAAEN,MAAM,CAACM,MAAM;MACrBC,OAAO,EAAEP,MAAM,CAACO,OAAO;MACvBC,WAAW,EAAER,MAAM,CAACQ,WAAW;MAC/BC,UAAU,EAAET,MAAM,CAACS,UAAU;MAC7BC,QAAQ,EAAEV,MAAM,CAACU,QAAQ;MACzBC,SAAS,EAAEX,MAAM,CAACW,SAAS;MAC3BC,WAAW,EAAEZ,MAAM,CAACY,WAAW;MAC/BC,WAAW,EAAEb,MAAM,CAACc,cAAc,EAAE;MACpCC,iBAAiB,EAAEnB,WAAW;MAC9BoB,SAAS,EAAE,CAACC,OAAY,EAAEC,IAAS,KAAK;QACtC,OAAOlB,MAAM,CAACgB,SA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VariableEvents","isEqual","deepCopy","ServiceVariable","_ServiceVariable","httpService","injector","_ServiceVariableEvents","constructor","config","variableConfig","name","dataSet","paramProvider","dataBinding","isList","service","serviceType","maxResults","_context","operation","operationId","serviceInfo","getServiceInfo","httpClientService","onSuccess","context","args","notify","AFTER_INVOKE","variable","data","options","SUCCESS","onError","ERROR","onCanUpdate","onBeforeUpdate","BEFORE_INVOKE","inputData","onResult","onBeforeDatasetReady","_defineProperty","get","subscribe","invokeOnParamChange","last","params","latest","invoke","Promise","resolve","doNext","currentPage","reject","onDataUpdated","appConfig","refresh","inputFields","console","error"],"sources":["service-variable.ts"],"sourcesContent":["import { VariableConfig, VariableEvents } from './base-variable';\nimport { isEqual, assignIn } from 'lodash';\nimport AppConfig from '@wavemaker/app-rn-runtime/core/AppConfig';\nimport { deepCopy } from '@wavemaker/app-rn-runtime/core/utils';\nimport { ServiceVariable as _ServiceVariable } from '@wavemaker/variables/src/model/variable/service-variable';\nimport httpService from '@wavemaker/app-rn-runtime/variables/http.service';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport interface ServiceVariableConfig extends VariableConfig {\n baseUrl: string;\n maxResults: number;\n _context: any;\n serviceType: string;\n onCanUpdate: any;\n onBeforeUpdate: any;\n onResult: any;\n onBeforeDatasetReady: any;\n inFlightBehavior: string;\n getServiceInfo: Function;\n}\n\nenum _ServiceVariableEvents {\n BEFORE_INVOKE = 'beforeInvoke'\n}\nexport type ServiceVariableEvents = _ServiceVariableEvents | VariableEvents;\n\nexport class ServiceVariable extends _ServiceVariable {\n private cancelTokenSource: any;\n params: any = {};\n public appConfig = injector.get<AppConfig>('APP_CONFIG');\n\n constructor(public config: ServiceVariableConfig) {\n const variableConfig = {\n name: config.name,\n dataSet: config.paramProvider(),\n dataBinding: {},\n isList: config.isList,\n service: config.service,\n serviceType: config.serviceType,\n maxResults: config.maxResults,\n _context: config._context,\n operation: config.operation,\n operationId: config.operationId,\n serviceInfo: config.getServiceInfo(),\n httpClientService: httpService,\n onSuccess: (context: any, args: any) => {\n this.notify(VariableEvents.AFTER_INVOKE, [args.variable, args.data, args.options]);\n this.notify(VariableEvents.SUCCESS, [args.variable, args.data, args.options]);\n return config.onSuccess && config.onSuccess(args.variable, args.data, args.options);\n },\n onError: (context: any, args: any) => {\n this.notify(VariableEvents.AFTER_INVOKE, [args.variable, args.data, args.options]);\n this.notify(VariableEvents.ERROR, [args.variable, args.data, args.options]);\n return config.onError && config.onError(args.variable, args.data, args.options);\n },\n onCanUpdate: (context: any, args: any) => {\n return config.onCanUpdate && config.onCanUpdate(args.variable, args.data, args.options);\n },\n onBeforeUpdate: (context: any, args: any) => {\n this.notify(VariableEvents.BEFORE_INVOKE, [args.variable, args.inputData, args.options]);\n return config.onBeforeUpdate && config.onBeforeUpdate(args.variable, args.inputData, args.options);\n },\n onResult: (context: any, args: any) => {\n return config.onResult && config.onResult(args.variable, args.data, args.options);\n },\n onBeforeDatasetReady: (context: any, args: any) => {\n return config.onBeforeDatasetReady && config.onBeforeDatasetReady(args.variable, args.data, args.options);\n }\n }\n super(variableConfig);\n this.subscribe(VariableEvents.AFTER_INVOKE, () => {\n this.dataBinding = {};\n });\n }\n\n invokeOnParamChange() {\n const last = this.params;\n const latest = this.config.paramProvider();\n if (!isEqual(last, latest)) {\n this.invoke(latest);\n }\n return Promise.resolve(this);\n }\n\n public doNext(currentPage: number) {\n // this.invoke({\n // page: currentPage\n // });\n return Promise.reject(this);\n }\n\n onDataUpdated() {\n this.appConfig.refresh(false);\n }\n\n invoke(options? : any, onSuccess?: Function, onError?: Function) {\n this.params = this.config.paramProvider();\n this.params = deepCopy({} as any, this.params, this.dataBinding);\n if (options) {\n this.params = deepCopy({} as any, this.params, options.inputFields ? options.inputFields : options);\n }\n options = options || {};\n options.inputFields = this.params;\n // service definitions data depends on whether user logged in or not\n // Try to get the latest definition\n this.serviceInfo = this.config.getServiceInfo();\n if (!this.serviceInfo) {\n console.error(`Service Info is missing for (${this.name}) variable.`)\n }\n return super.invoke(options, onSuccess, onError);\n }\n\n // cancel($file?: any) {\n // // CHecks if there is any pending requests in the queue\n // if ($queue.requestsQueue.has(this)) {\n // // If the request is a File upload request then modify the elements associated with file upload\n // // else unsubscribe from the observable on the variable.\n // if (false) {\n // // $file._uploadProgress.unsubscribe();\n // // $file.status = 'abort';\n // // this.totalFilesCount--;\n // // initiateCallback(VARIABLE_CONSTANTS.EVENT.ABORT, variable, $file);\n // // if (!this.isFileUploadInProgress(variable.dataBinding) && this.totalFilesCount === 0) {\n // // $queue.process(variable);\n // // // notify inflight variable\n // // this.notifyInflight(variable, false);\n // // }\n // } else {\n // if (true) {\n // this.cancelTokenSource.cancel();\n // $queue.process(this);\n // // notify inflight variable\n // //this.notifyInflight(variable, false);\n // }\n // }\n // }\n // }\n\n // setInput(key: any, val?: any, options?: any) {\n // this.params = merge({}, this.config.paramProvider(), _setInput(this.params, key, val, options));\n // return this.params;\n // }\n}\n"],"mappings":";;;AAAA,SAAyBA,cAAc,QAAQ,iBAAiB;AAChE,SAASC,OAAO,QAAkB,QAAQ;AAE1C,SAASC,QAAQ,QAAQ,sCAAsC;AAC/D,SAASC,eAAe,IAAIC,gBAAgB,QAAQ,0DAA0D;AAC9G,OAAOC,WAAW,MAAM,kDAAkD;AAC1E,OAAOC,QAAQ,MAAM,yCAAyC;AAAC,IAe1DC,sBAAsB,0BAAtBA,sBAAsB;EAAtBA,sBAAsB;EAAA,OAAtBA,sBAAsB;AAAA,EAAtBA,sBAAsB;AAK3B,OAAO,MAAMJ,eAAe,SAASC,gBAAgB,CAAC;EAKpDI,WAAWA,CAAQC,MAA6B,EAAE;IAChD,MAAMC,cAAc,GAAG;MACrBC,IAAI,EAAEF,MAAM,CAACE,IAAI;MACjBC,OAAO,EAAEH,MAAM,CAACI,aAAa,CAAC,CAAC;MAC/BC,WAAW,EAAE,CAAC,CAAC;MACfC,MAAM,EAAEN,MAAM,CAACM,MAAM;MACrBC,OAAO,EAAEP,MAAM,CAACO,OAAO;MACvBC,WA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M,CAACc,cAAc,CAAC,CAAC;IAC/C,IAAI,CAAC,IAAI,CAACD,WAAW,EAAE;MACrBqC,OAAO,CAACC,KAAK,CAAE,gCAA+B,IAAI,CAACjD,IAAK,aAAY,CAAC;IACvE;IACA,OAAO,KAAK,CAACsC,MAAM,CAACjB,OAAO,EAAEP,SAAS,EAAES,OAAO,CAAC;EAClD;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;EACA;EACA;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isUndefined","isBoolean","isEqual","isObject","isArray","get","set","findIndex","DatasetUtil","isValidDataset","dataSet","isList","getValue","key","index","setValue","value","getTargetNode","options","parentIndex","undefined","path","getItem","setItem","i","innerArray","innerElemindex","getChildDetails","targetNode","addItem","length","splice","removeItem","exactMatch","getValidDataset","getCount","Object","keys"],"sources":["dataset-util.ts"],"sourcesContent":["import { isUndefined, isBoolean, isEqual, isObject, isArray, get, set, findIndex } from \"lodash\";\nexport default class DatasetUtil {\n\n static isValidDataset(dataSet: any, isList?: boolean) {\n if (!dataSet || (isList && !isArray(dataSet))) {\n return false;\n }\n return dataSet;\n }\n\n static getValue(dataSet: any, key: any, index: any, isList?: boolean) {\n index = index || 0;\n return isList ? dataSet[index][key] : dataSet[key];\n }\n\n static setValue(dataSet: any, key: any, value: any, isList?: boolean) {\n if (key && !isList) {\n dataSet[key] = value;\n }\n return dataSet;\n }\n\n private static getTargetNode(dataSet: any, options: any) {\n dataSet = options.parentIndex !== undefined ? dataSet[options.parentIndex] : dataSet;\n return get(dataSet, options.path);\n }\n\n static getItem(dataSet: any, index: any, isList?: boolean) {\n return isList ? dataSet[index] : dataSet;\n }\n\n static setItem(dataSet: any, i: any, value: any, options?: any) {\n let index;\n if (isUndefined(i) || !options.isList) {\n return dataSet;\n }\n\n if (isObject(i)) {\n index = findIndex(dataSet, i);\n } else {\n index = i;\n }\n\n if (options.path) {\n const innerArray = DatasetUtil.getTargetNode(dataSet, options);\n const innerElemindex = findIndex(innerArray, i);\n if (innerElemindex > -1) {\n innerArray[innerElemindex] = value;\n }\n } else {\n if (index > -1) {\n dataSet[index] = value;\n }\n }\n\n return dataSet;\n }\n\n /**\n * This method is to get target node options like path, parentIndex and isList\n * Example: if we have parent dataset as object and we are performing operations on inner list then we have to set isList as true.\n * So finding the target node type and updating the isList option.\n */\n static getChildDetails (dataSet: any, options: any, isList: boolean) {\n let parentIndex, path;\n if (options && options.path) {\n path = options.path;\n let targetNode;\n if (isList) {\n parentIndex = options.parentIndex || 0;\n targetNode = get(dataSet[parentIndex], options.path);\n } else {\n targetNode = get(dataSet, options.path);\n }\n isList = targetNode ? isArray(targetNode) ? true : false : true;\n }\n return {path, isList, parentIndex};\n }\n\n static addItem(dataSet: any, value: any, index: any, options?: any) {\n if (isUndefined(value) || !options.isList) {\n return dataSet;\n }\n\n if (options.path) {\n const innerArray = DatasetUtil.getTargetNode(dataSet, options);\n if (innerArray) {\n // check for index sanity\n index = index !== undefined ? index : innerArray.length;\n innerArray.splice(index, 0, value);\n } else {\n options.parentIndex !== undefined ? set(dataSet[options.parentIndex], options.path, [value]) : set(dataSet, options.path, [value]);\n }\n\n } else {\n index = index !== undefined ? index : dataSet.length;\n dataSet.splice(index, 0, value);\n }\n\n return dataSet;\n }\n\n /**\n *\n * @param dataSet\n * @param i, can be index value of the object/element in array\n * or\n * the whole object which needs to be removed\n * @param exactMatch\n * @returns {any}\n */\n static removeItem(dataSet: any, i: any, options: any) {\n let index, exactMatch;\n i = i !== undefined ? i : dataSet.length - 1;\n\n if (isBoolean(options)) {\n exactMatch = options;\n }\n if (isObject(options)) {\n // @ts-ignore\n exactMatch = options.exactMatch;\n }\n\n if (isObject(i)) {\n if (options.path) {\n const innerArray = DatasetUtil.getTargetNode(dataSet, options);\n const innerElemindex = findIndex(innerArray, i);\n if (innerElemindex > -1 && (!exactMatch || (exactMatch && isEqual(innerArray[innerElemindex], i)))) {\n innerArray.splice(innerElemindex, 1);\n }\n } else {\n index = findIndex(dataSet, i);\n // When exactMatch property is set to true delete only when every property values are same*/\n if (index > -1 && (!exactMatch || (exactMatch && isEqual(dataSet[index], i)))) {\n dataSet.splice(index, 1);\n }\n }\n } else {\n dataSet.splice(i, 1);\n }\n return dataSet;\n }\n\n static getValidDataset(isList?: boolean) {\n return isList ? [] : {};\n }\n\n static getCount(dataSet: any, isList?: boolean) {\n return isList ? dataSet.length : Object.keys(dataSet).length;\n }\n}\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,GAAG,EAAEC,GAAG,EAAEC,SAAS,QAAQ,QAAQ;AAChG,eAAe,MAAMC,WAAW,CAAC;EAE/B,OAAOC,
|
|
1
|
+
{"version":3,"names":["isUndefined","isBoolean","isEqual","isObject","isArray","get","set","findIndex","DatasetUtil","isValidDataset","dataSet","isList","getValue","key","index","setValue","value","getTargetNode","options","parentIndex","undefined","path","getItem","setItem","i","innerArray","innerElemindex","getChildDetails","targetNode","addItem","length","splice","removeItem","exactMatch","getValidDataset","getCount","Object","keys"],"sources":["dataset-util.ts"],"sourcesContent":["import { isUndefined, isBoolean, isEqual, isObject, isArray, get, set, findIndex } from \"lodash\";\nexport default class DatasetUtil {\n\n static isValidDataset(dataSet: any, isList?: boolean) {\n if (!dataSet || (isList && !isArray(dataSet))) {\n return false;\n }\n return dataSet;\n }\n\n static getValue(dataSet: any, key: any, index: any, isList?: boolean) {\n index = index || 0;\n return isList ? dataSet[index][key] : dataSet[key];\n }\n\n static setValue(dataSet: any, key: any, value: any, isList?: boolean) {\n if (key && !isList) {\n dataSet[key] = value;\n }\n return dataSet;\n }\n\n private static getTargetNode(dataSet: any, options: any) {\n dataSet = options.parentIndex !== undefined ? dataSet[options.parentIndex] : dataSet;\n return get(dataSet, options.path);\n }\n\n static getItem(dataSet: any, index: any, isList?: boolean) {\n return isList ? dataSet[index] : dataSet;\n }\n\n static setItem(dataSet: any, i: any, value: any, options?: any) {\n let index;\n if (isUndefined(i) || !options.isList) {\n return dataSet;\n }\n\n if (isObject(i)) {\n index = findIndex(dataSet, i);\n } else {\n index = i;\n }\n\n if (options.path) {\n const innerArray = DatasetUtil.getTargetNode(dataSet, options);\n const innerElemindex = findIndex(innerArray, i);\n if (innerElemindex > -1) {\n innerArray[innerElemindex] = value;\n }\n } else {\n if (index > -1) {\n dataSet[index] = value;\n }\n }\n\n return dataSet;\n }\n\n /**\n * This method is to get target node options like path, parentIndex and isList\n * Example: if we have parent dataset as object and we are performing operations on inner list then we have to set isList as true.\n * So finding the target node type and updating the isList option.\n */\n static getChildDetails (dataSet: any, options: any, isList: boolean) {\n let parentIndex, path;\n if (options && options.path) {\n path = options.path;\n let targetNode;\n if (isList) {\n parentIndex = options.parentIndex || 0;\n targetNode = get(dataSet[parentIndex], options.path);\n } else {\n targetNode = get(dataSet, options.path);\n }\n isList = targetNode ? isArray(targetNode) ? true : false : true;\n }\n return {path, isList, parentIndex};\n }\n\n static addItem(dataSet: any, value: any, index: any, options?: any) {\n if (isUndefined(value) || !options.isList) {\n return dataSet;\n }\n\n if (options.path) {\n const innerArray = DatasetUtil.getTargetNode(dataSet, options);\n if (innerArray) {\n // check for index sanity\n index = index !== undefined ? index : innerArray.length;\n innerArray.splice(index, 0, value);\n } else {\n options.parentIndex !== undefined ? set(dataSet[options.parentIndex], options.path, [value]) : set(dataSet, options.path, [value]);\n }\n\n } else {\n index = index !== undefined ? index : dataSet.length;\n dataSet.splice(index, 0, value);\n }\n\n return dataSet;\n }\n\n /**\n *\n * @param dataSet\n * @param i, can be index value of the object/element in array\n * or\n * the whole object which needs to be removed\n * @param exactMatch\n * @returns {any}\n */\n static removeItem(dataSet: any, i: any, options: any) {\n let index, exactMatch;\n i = i !== undefined ? i : dataSet.length - 1;\n\n if (isBoolean(options)) {\n exactMatch = options;\n }\n if (isObject(options)) {\n // @ts-ignore\n exactMatch = options.exactMatch;\n }\n\n if (isObject(i)) {\n if (options.path) {\n const innerArray = DatasetUtil.getTargetNode(dataSet, options);\n const innerElemindex = findIndex(innerArray, i);\n if (innerElemindex > -1 && (!exactMatch || (exactMatch && isEqual(innerArray[innerElemindex], i)))) {\n innerArray.splice(innerElemindex, 1);\n }\n } else {\n index = findIndex(dataSet, i);\n // When exactMatch property is set to true delete only when every property values are same*/\n if (index > -1 && (!exactMatch || (exactMatch && isEqual(dataSet[index], i)))) {\n dataSet.splice(index, 1);\n }\n }\n } else {\n dataSet.splice(i, 1);\n }\n return dataSet;\n }\n\n static getValidDataset(isList?: boolean) {\n return isList ? [] : {};\n }\n\n static getCount(dataSet: any, isList?: boolean) {\n return isList ? dataSet.length : Object.keys(dataSet).length;\n }\n}\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,GAAG,EAAEC,GAAG,EAAEC,SAAS,QAAQ,QAAQ;AAChG,eAAe,MAAMC,WAAW,CAAC;EAE/B,OAAOC,cAAcA,CAACC,OAAY,EAAEC,MAAgB,EAAE;IACpD,IAAI,CAACD,OAAO,IAAKC,MAAM,IAAI,CAACP,OAAO,CAACM,OAAO,CAAE,EAAE;MAC7C,OAAO,KAAK;IACd;IACA,OAAOA,OAAO;EAChB;EAEA,OAAOE,QAAQA,CAACF,OAAY,EAAEG,GAAQ,EAAEC,KAAU,EAAEH,MAAgB,EAAE;IACpEG,KAAK,GAAGA,KAAK,IAAI,CAAC;IAClB,OAAOH,MAAM,GAAGD,OAAO,CAACI,KAAK,CAAC,CAACD,GAAG,CAAC,GAAGH,OAAO,CAACG,GAAG,CAAC;EACpD;EAEA,OAAOE,QAAQA,CAACL,OAAY,EAAEG,GAAQ,EAAEG,KAAU,EAAEL,MAAgB,EAAE;IACpE,IAAIE,GAAG,IAAI,CAACF,MAAM,EAAE;MAClBD,OAAO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Ec,CAAC,CAAC;QAC7B;QACA,IAAIV,KAAK,GAAG,CAAC,CAAC,KAAK,CAACmB,UAAU,IAAKA,UAAU,IAAI/B,OAAO,CAACQ,OAAO,CAACI,KAAK,CAAC,EAAEU,CAAC,CAAE,CAAC,EAAE;UAC7Ed,OAAO,CAACqB,MAAM,CAACjB,KAAK,EAAE,CAAC,CAAC;QAC1B;MACF;IACF,CAAC,MAAM;MACLJ,OAAO,CAACqB,MAAM,CAACP,CAAC,EAAE,CAAC,CAAC;IACtB;IACA,OAAOd,OAAO;EAChB;EAEA,OAAOwB,eAAeA,CAACvB,MAAgB,EAAE;IACvC,OAAOA,MAAM,GAAG,EAAE,GAAG,CAAC,CAAC;EACzB;EAEA,OAAOwB,QAAQA,CAACzB,OAAY,EAAEC,MAAgB,EAAE;IAC9C,OAAOA,MAAM,GAAGD,OAAO,CAACoB,MAAM,GAAGM,MAAM,CAACC,IAAI,CAAC3B,OAAO,CAAC,CAACoB,MAAM;EAC9D;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["InflightQueue","Map","addToQueue","variable","param2","requestsQueue","has","get","push","processes","resolve","reject","active","set","rejectProcess","process","clear","delete","nextProcess","length","config","inFlightBehavior","i","splice","submit","Promise","$queue"],"sources":["inflight-queue.ts"],"sourcesContent":["class InflightQueue {\n requestsQueue = new Map();\n\n /**\n * pushes the process against a variable in its queue\n * @param variable\n * @param {{resolve: (value?: any) => void; reject: (reason?: any) => void}} param2\n * the resolve callback will be called on\n */\n private addToQueue(variable: any, param2: {resolve: (value?: (any)) => void; reject: (reason?: any) => void}) {\n if (this.requestsQueue.has(variable)) {\n this.requestsQueue.get(variable).push(param2);\n } else {\n const processes = [];\n processes.push({resolve: param2.resolve, reject: param2.reject, active: false});\n this.requestsQueue.set(variable, processes);\n }\n }\n\n /**\n * Calls the reject method against the passed process\n * @param process\n */\n private rejectProcess(process: any) {\n process.reject('PROCESS_REJECTED_IN_QUEUE');\n }\n\n /**\n * clears the queue against a variable\n * @param variable\n */\n public clear(variable: any) {\n this.requestsQueue.delete(variable);\n }\n\n /**\n * executes the n/w calls for a specified variable pushed in its respective queue (pushed while it was inFlight)\n * @param variable\n */\n process(variable: any) {\n const processes: [any] = this.requestsQueue.get(variable);\n let nextProcess;\n\n // process request queue for the variable only if it is not empty\n if (!processes || !processes.length) {\n this.clear(variable);\n return;\n }\n\n // If only one item in queue\n if (processes.length === 1) {\n nextProcess = processes[0];\n if (nextProcess.active) {\n this.clear(variable);\n } else {\n nextProcess.active = true;\n nextProcess.resolve();\n }\n return;\n }\n\n switch (variable.config.inFlightBehavior) {\n case 'executeLast':\n for (let i = 0; i < processes.length - 2; i++) {\n this.rejectProcess(processes[i]);\n }\n processes.splice(0, processes.length - 1);\n this.process(variable);\n break;\n case 'executeAll':\n nextProcess = processes.splice(0, 1)[0];\n if (nextProcess.active) {\n nextProcess = processes.splice(0, 1)[0];\n }\n nextProcess.active = true;\n nextProcess.resolve();\n break;\n default:\n for (let i = 0; i < processes.length - 1; i++) {\n this.rejectProcess(processes[i]);\n }\n this.clear(variable);\n break;\n }\n }\n\n /**\n * initializes the queue against a variable and makes the first process call\n * If already initialized and a process in queue is in progress, the queue is not processed.\n * To process the next item in the queue, the process method has to be called from the caller.\n * @param variable\n * @returns {Promise<any>}\n */\n submit(variable: any) {\n return new Promise((resolve, reject) => {\n this.addToQueue(variable, {resolve: resolve, reject: reject});\n\n if (this.requestsQueue.get(variable).length === 1) {\n this.process(variable);\n }\n });\n }\n}\n\nexport const $queue = new InflightQueue();\n"],"mappings":";;;AAAA,MAAMA,aAAa,CAAC;
|
|
1
|
+
{"version":3,"names":["InflightQueue","constructor","_defineProperty","Map","addToQueue","variable","param2","requestsQueue","has","get","push","processes","resolve","reject","active","set","rejectProcess","process","clear","delete","nextProcess","length","config","inFlightBehavior","i","splice","submit","Promise","$queue"],"sources":["inflight-queue.ts"],"sourcesContent":["class InflightQueue {\n requestsQueue = new Map();\n\n /**\n * pushes the process against a variable in its queue\n * @param variable\n * @param {{resolve: (value?: any) => void; reject: (reason?: any) => void}} param2\n * the resolve callback will be called on\n */\n private addToQueue(variable: any, param2: {resolve: (value?: (any)) => void; reject: (reason?: any) => void}) {\n if (this.requestsQueue.has(variable)) {\n this.requestsQueue.get(variable).push(param2);\n } else {\n const processes = [];\n processes.push({resolve: param2.resolve, reject: param2.reject, active: false});\n this.requestsQueue.set(variable, processes);\n }\n }\n\n /**\n * Calls the reject method against the passed process\n * @param process\n */\n private rejectProcess(process: any) {\n process.reject('PROCESS_REJECTED_IN_QUEUE');\n }\n\n /**\n * clears the queue against a variable\n * @param variable\n */\n public clear(variable: any) {\n this.requestsQueue.delete(variable);\n }\n\n /**\n * executes the n/w calls for a specified variable pushed in its respective queue (pushed while it was inFlight)\n * @param variable\n */\n process(variable: any) {\n const processes: [any] = this.requestsQueue.get(variable);\n let nextProcess;\n\n // process request queue for the variable only if it is not empty\n if (!processes || !processes.length) {\n this.clear(variable);\n return;\n }\n\n // If only one item in queue\n if (processes.length === 1) {\n nextProcess = processes[0];\n if (nextProcess.active) {\n this.clear(variable);\n } else {\n nextProcess.active = true;\n nextProcess.resolve();\n }\n return;\n }\n\n switch (variable.config.inFlightBehavior) {\n case 'executeLast':\n for (let i = 0; i < processes.length - 2; i++) {\n this.rejectProcess(processes[i]);\n }\n processes.splice(0, processes.length - 1);\n this.process(variable);\n break;\n case 'executeAll':\n nextProcess = processes.splice(0, 1)[0];\n if (nextProcess.active) {\n nextProcess = processes.splice(0, 1)[0];\n }\n nextProcess.active = true;\n nextProcess.resolve();\n break;\n default:\n for (let i = 0; i < processes.length - 1; i++) {\n this.rejectProcess(processes[i]);\n }\n this.clear(variable);\n break;\n }\n }\n\n /**\n * initializes the queue against a variable and makes the first process call\n * If already initialized and a process in queue is in progress, the queue is not processed.\n * To process the next item in the queue, the process method has to be called from the caller.\n * @param variable\n * @returns {Promise<any>}\n */\n submit(variable: any) {\n return new Promise((resolve, reject) => {\n this.addToQueue(variable, {resolve: resolve, reject: reject});\n\n if (this.requestsQueue.get(variable).length === 1) {\n this.process(variable);\n }\n });\n }\n}\n\nexport const $queue = new InflightQueue();\n"],"mappings":";;;AAAA,MAAMA,aAAa,CAAC;EAAAC,YAAA;IAAAC,eAAA,wBACF,IAAIC,GAAG,CAAC,CAAC;EAAA;EAEzB;AACF;AACA;AACA;AACA;AACA;EACUC,UAAUA,CAACC,QAAa,EAAEC,MAA0E,EAAE;IAC5G,IAAI,IAAI,CAACC,aAAa,CAACC,GAAG,CAACH,QAAQ,CAAC,EAAE;MACpC,IAAI,CAACE,aAAa,CAACE,GAAG,CAACJ,QAAQ,CAAC,CAACK,IAAI,CAACJ,MAAM,CAAC;IAC/C,CAAC,MAAM;MACL,MAAMK,SAAS,GAAG,EAAE;MACpBA,SAAS,CAACD,IAAI,CAAC;QAACE,OAAO,EAAEN,MAAM,CAACM,OAAO;QAAEC,MAAM,EAAEP,MAAM,CAACO,MAAM;QAAEC,MAAM,EAAE;MAAK,CAAC,CAAC;MAC/E,IAAI,CAACP,aAAa,CAACQ,GAAG,CAACV,QAAQ,EAAEM,SAAS,CAAC;IAC7C;EACF;;EAEA;AACF;AACA;AACA;EACUK,aAAaA,CAACC,OAAY,EAAE;IAClCA,OAAO,CAACJ,MAAM,CAAC,2BAA2B,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;EACSK,KAAKA,CAACb,QAAa,EAAE;IAC1B,IAAI,CAACE,aAAa,CAACY,MAAM,CAACd,QAAQ,CAAC;EACrC;;EAEA;AACF;AACA;AACA;EACEY,OAAOA,CAACZ,QAAa,EAAE;IACrB,MAAMM,SAAgB,GAAG,IAAI,CAACJ,aAAa,CAACE,GAAG,CAACJ,QAAQ,CAAC;IACzD,IAAIe,WAAW;;IAEf;IACA,IAAI,CAACT,SAAS,IAAI,CAACA,SAAS,CAACU,MAAM,EAAE;MACnC,IAAI,CAACH,KAAK,CAACb,QAAQ,CAAC;MACpB;IACF;;IAEA;IACA,IAAIM,SAAS,CAACU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qB,MAAMA,CAACrB,QAAa,EAAE;IACpB,OAAO,IAAIsB,OAAO,CAAC,CAACf,OAAO,EAAEC,MAAM,KAAK;MACtC,IAAI,CAACT,UAAU,CAACC,QAAQ,EAAE;QAACO,OAAO,EAAEA,OAAO;QAAEC,MAAM,EAAEA;MAAM,CAAC,CAAC;MAE7D,IAAI,IAAI,CAACN,aAAa,CAACE,GAAG,CAACJ,QAAQ,CAAC,CAACgB,MAAM,KAAK,CAAC,EAAE;QACjD,IAAI,CAACJ,OAAO,CAACZ,QAAQ,CAAC;MACxB;IACF,CAAC,CAAC;EACJ;AACF;AAEA,OAAO,MAAMuB,MAAM,GAAG,IAAI5B,aAAa,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forEach","get","isNumber","isObject","isEqual","omit","keys","_setInput","targetObj","key","val","options","lastKey","paramObj","type","parseInt","indexOf","split","pop","findValueOf","join","paramVal","paramKey","obj","create","parts","skipProcessing","part","length","subParts","match","subPart","shift","push","undefined","_key","tempObj","getValidJSON","value","content","parsedIntValue","isNaN","JSON","parse","e","parseErrors","errors","errMsg","error","errorDetails","i","parseError","errorObj","message","replace","parameters","template","map","regEx","isPageable","pageable","first","last","number","numberOfElements","size","sort","totalElements","totalPages","paginatedObj"],"sources":["variable.utils.ts"],"sourcesContent":["import { forEach, get, isNumber, isObject, isEqual, omit, keys } from \"lodash\";\n/**\n * sets the value against passed key on the \"inputFields\" object in the variable\n * @param targetObj: the object in which the key, value is to be set\n * @param variable\n * @param key: can be:\n * - a string e.g. \"username\"\n * - an object, e.g. {\"username\": \"john\", \"ssn\": \"11111\"}\n * @param val\n * - if key is string, the value against it (for that data type)\n * - if key is object, not required\n * @param options\n * @returns {any}\n */\n\nexport const _setInput = (targetObj: any, key: any, val: any, options?: any) => {\n targetObj = targetObj || {};\n let keys,\n lastKey,\n paramObj: any = {};\n\n // content type check\n if (isObject(options)) {\n // @ts-ignore\n switch (options.type) {\n case 'file':\n //val = getBlob(val, options.contentType);\n break;\n case 'number':\n val = isNumber(val) ? val : parseInt(val, 10);\n break;\n }\n }\n\n if (isObject(key)) {\n // check if the passed parameter is an object itself\n paramObj = key;\n } else if (key.indexOf('.') > -1) {\n // check for '.' in key e.g. 'employee.department'\n keys = key.split('.');\n lastKey = keys.pop();\n // Finding the object based on the key\n targetObj = findValueOf(targetObj, keys.join('.'), true);\n key = lastKey;\n paramObj[key] = val;\n } else {\n paramObj[key] = val;\n }\n\n forEach(paramObj, function (paramVal, paramKey) {\n targetObj[paramKey] = paramVal;\n });\n return targetObj;\n}\n\n/*\n * Util method to find the value of a key in the object\n * if key not found and create is true, an object is created against that node\n * Examples:\n * var a = {\n * b: {\n * c : {\n * d: 'test'\n * }\n * }\n * }\n * Utils.findValue(a, 'b.c.d') --> 'test'\n * Utils.findValue(a, 'b.c') --> {d: 'test'}\n * Utils.findValue(a, 'e') --> undefined\n * Utils.findValue(a, 'e', true) --> {} and a will become:\n * {\n * b: {\n * c : {\n * d: 'test'\n * }\n * },\n * e: {\n * }\n * }\n */\nexport const findValueOf = (obj: any, key: any, create?: any) => {\n\n if (!obj || !key) {\n return;\n }\n\n if (!create) {\n return get(obj, key);\n }\n\n const parts = key.split('.'),\n keys: any = [];\n\n let skipProcessing;\n\n // @ts-ignore\n parts.forEach((part: any) => {\n if (!parts.length) { // if the part of a key is not valid, skip the processing.\n skipProcessing = true;\n return false;\n }\n\n const subParts = part.match(/\\w+/g);\n let subPart;\n\n while (subParts.length) {\n subPart = subParts.shift();\n keys.push({ 'key': subPart, 'value': subParts.length ? [] : {} }); // determine whether to create an array or an object\n }\n });\n\n if (skipProcessing) {\n return undefined;\n }\n\n keys.forEach((_key: any) => {\n let tempObj = obj[_key.key];\n if (!isObject(tempObj)) {\n tempObj = getValidJSON(tempObj);\n if (!tempObj) {\n tempObj = _key.value;\n }\n }\n obj[_key.key] = tempObj;\n obj = tempObj;\n });\n\n return obj;\n};\n\nexport const getValidJSON = (content: any) => {\n if (!content) {\n return undefined;\n }\n try {\n const parsedIntValue = parseInt(content, 10);\n /*obtaining json from editor content string*/\n return isObject(content) || !isNaN(parsedIntValue) ? content : JSON.parse(content);\n } catch (e) {\n /*terminating execution if new variable object is not valid json.*/\n return undefined;\n }\n}\n\nexport const parseErrors = (errors: any) => {\n let errMsg = '';\n if (errors && errors.error && errors.error.length) {\n errors.error.forEach((errorDetails: any, i: Number) => {\n errMsg += parseError(errorDetails) + (i > 0 ? '\\n' : '');\n });\n }\n return errMsg;\n}\n\nexport const parseError = (errorObj: any) => {\n let errMsg;\n errMsg = errorObj.message ? replace(errorObj.message, errorObj.parameters, true) : ((errorObj.parameters && errorObj.parameters[0]) || '');\n return errMsg;\n}\n\n/*\n * Util method to replace patterns in string with object keys or array values\n * Examples:\n * Utils.replace('Hello, ${first} ${last} !', {first: 'wavemaker', last: 'ng'}) --> Hello, wavemaker ng\n * Utils.replace('Hello, ${0} ${1} !', ['wavemaker','ng']) --> Hello, wavemaker ng\n * Examples if parseError is true:\n * Utils.replace('Hello, {0} {1} !', ['wavemaker','ng']) --> Hello, wavemaker ng\n */\nexport const replace = (template: any, map: any, parseError?: boolean) => {\n let regEx = /\\$\\{([^\\}]+)\\}/g;\n if (!template) {\n return;\n }\n if (parseError) {\n regEx = /\\{([^\\}]+)\\}/g;\n }\n\n return template.replace(regEx, function (match: any, key: any) {\n return get(map, key);\n });\n};\n\n/*Function to check whether the specified object is a pageable object or not.*/\nexport const isPageable = (obj: any): boolean => {\n const pageable = {\n content: [],\n first: true,\n last: true,\n number: 0,\n numberOfElements: 10,\n size: 20,\n sort: null,\n totalElements: 10,\n totalPages: 1\n };\n // paginated object may or may not contain 'empty' property. In either case, Pageable should return as true.\n const paginatedObj = omit(obj, 'empty');\n return isEqual(keys(pageable), keys(paginatedObj).sort());\n};\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,GAAG,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,IAAI,EAAEC,IAAI,QAAQ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,EAAG;EAC1I,OAAOR,MAAM;AACf,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMO,OAAO,GAAG,CAACE,QAAa,EAAEC,GAAQ,EAAEN,UAAoB,KAAK;EACxE,IAAIO,KAAK,GAAG,iBAAiB;EAC7B,IAAI,CAACF,QAAQ,EAAE;IACX;EACJ;EACA,IAAIL,UAAU,EAAE;IACZO,KAAK,GAAG,eAAe;EAC3B;EAEA,OAAOF,QAAQ,CAACF,OAAO,CAACI,KAAK,EAAE,UAAU5B,KAAU,EAAErB,GAAQ,EAAE;IAC3D,OAAOR,GAAG,CAACwD,GAAG,EAAEhD,GAAG,CAAC;EACxB,CAAC,CAAC;AACJ,CAAC;;AAED;AACA,OAAO,MAAMkD,UAAU,GAAIpC,GAAQ,IAAc;EAC/C,MAAMqC,QAAQ,GAAG;IACfrB,OAAO,EAAE,EAAE;IACXsB,KAAK,EAAE,IAAI;IACXC,IAAI,EAAE,IAAI;IACVC,MAAM,EAAE,CAAC;IACTC,gBAAgB,EAAE,EAAE;IACpBC,IAAI,EAAE,EAAE;IACRC,IAAI,EAAE,IAAI;IACVC,aAAa,EAAE,EAAE;IACjBC,UAAU,EAAE;EACd,CAAC;EACD;EACA,MAAMC,YAAY,GAAGhE,IAAI,CAACkB,GAAG,EAAE,OAAO,CAAC;EACvC,OAAOnB,OAAO,CAACE,IAAI,CAACsD,QAAQ,CAAC,EAAEtD,IAAI,CAAC+D,YAAY,CAAC,CAACH,IAAI,EAAE,CAAC;AAC3D,CAAC"}
|
|
1
|
+
{"version":3,"names":["forEach","get","isNumber","isObject","isEqual","omit","keys","_setInput","targetObj","key","val","options","lastKey","paramObj","type","parseInt","indexOf","split","pop","findValueOf","join","paramVal","paramKey","obj","create","parts","skipProcessing","part","length","subParts","match","subPart","shift","push","undefined","_key","tempObj","getValidJSON","value","content","parsedIntValue","isNaN","JSON","parse","e","parseErrors","errors","errMsg","error","errorDetails","i","parseError","errorObj","message","replace","parameters","template","map","regEx","isPageable","pageable","first","last","number","numberOfElements","size","sort","totalElements","totalPages","paginatedObj"],"sources":["variable.utils.ts"],"sourcesContent":["import { forEach, get, isNumber, isObject, isEqual, omit, keys } from \"lodash\";\n/**\n * sets the value against passed key on the \"inputFields\" object in the variable\n * @param targetObj: the object in which the key, value is to be set\n * @param variable\n * @param key: can be:\n * - a string e.g. \"username\"\n * - an object, e.g. {\"username\": \"john\", \"ssn\": \"11111\"}\n * @param val\n * - if key is string, the value against it (for that data type)\n * - if key is object, not required\n * @param options\n * @returns {any}\n */\n\nexport const _setInput = (targetObj: any, key: any, val: any, options?: any) => {\n targetObj = targetObj || {};\n let keys,\n lastKey,\n paramObj: any = {};\n\n // content type check\n if (isObject(options)) {\n // @ts-ignore\n switch (options.type) {\n case 'file':\n //val = getBlob(val, options.contentType);\n break;\n case 'number':\n val = isNumber(val) ? val : parseInt(val, 10);\n break;\n }\n }\n\n if (isObject(key)) {\n // check if the passed parameter is an object itself\n paramObj = key;\n } else if (key.indexOf('.') > -1) {\n // check for '.' in key e.g. 'employee.department'\n keys = key.split('.');\n lastKey = keys.pop();\n // Finding the object based on the key\n targetObj = findValueOf(targetObj, keys.join('.'), true);\n key = lastKey;\n paramObj[key] = val;\n } else {\n paramObj[key] = val;\n }\n\n forEach(paramObj, function (paramVal, paramKey) {\n targetObj[paramKey] = paramVal;\n });\n return targetObj;\n}\n\n/*\n * Util method to find the value of a key in the object\n * if key not found and create is true, an object is created against that node\n * Examples:\n * var a = {\n * b: {\n * c : {\n * d: 'test'\n * }\n * }\n * }\n * Utils.findValue(a, 'b.c.d') --> 'test'\n * Utils.findValue(a, 'b.c') --> {d: 'test'}\n * Utils.findValue(a, 'e') --> undefined\n * Utils.findValue(a, 'e', true) --> {} and a will become:\n * {\n * b: {\n * c : {\n * d: 'test'\n * }\n * },\n * e: {\n * }\n * }\n */\nexport const findValueOf = (obj: any, key: any, create?: any) => {\n\n if (!obj || !key) {\n return;\n }\n\n if (!create) {\n return get(obj, key);\n }\n\n const parts = key.split('.'),\n keys: any = [];\n\n let skipProcessing;\n\n // @ts-ignore\n parts.forEach((part: any) => {\n if (!parts.length) { // if the part of a key is not valid, skip the processing.\n skipProcessing = true;\n return false;\n }\n\n const subParts = part.match(/\\w+/g);\n let subPart;\n\n while (subParts.length) {\n subPart = subParts.shift();\n keys.push({ 'key': subPart, 'value': subParts.length ? [] : {} }); // determine whether to create an array or an object\n }\n });\n\n if (skipProcessing) {\n return undefined;\n }\n\n keys.forEach((_key: any) => {\n let tempObj = obj[_key.key];\n if (!isObject(tempObj)) {\n tempObj = getValidJSON(tempObj);\n if (!tempObj) {\n tempObj = _key.value;\n }\n }\n obj[_key.key] = tempObj;\n obj = tempObj;\n });\n\n return obj;\n};\n\nexport const getValidJSON = (content: any) => {\n if (!content) {\n return undefined;\n }\n try {\n const parsedIntValue = parseInt(content, 10);\n /*obtaining json from editor content string*/\n return isObject(content) || !isNaN(parsedIntValue) ? content : JSON.parse(content);\n } catch (e) {\n /*terminating execution if new variable object is not valid json.*/\n return undefined;\n }\n}\n\nexport const parseErrors = (errors: any) => {\n let errMsg = '';\n if (errors && errors.error && errors.error.length) {\n errors.error.forEach((errorDetails: any, i: Number) => {\n errMsg += parseError(errorDetails) + (i > 0 ? '\\n' : '');\n });\n }\n return errMsg;\n}\n\nexport const parseError = (errorObj: any) => {\n let errMsg;\n errMsg = errorObj.message ? replace(errorObj.message, errorObj.parameters, true) : ((errorObj.parameters && errorObj.parameters[0]) || '');\n return errMsg;\n}\n\n/*\n * Util method to replace patterns in string with object keys or array values\n * Examples:\n * Utils.replace('Hello, ${first} ${last} !', {first: 'wavemaker', last: 'ng'}) --> Hello, wavemaker ng\n * Utils.replace('Hello, ${0} ${1} !', ['wavemaker','ng']) --> Hello, wavemaker ng\n * Examples if parseError is true:\n * Utils.replace('Hello, {0} {1} !', ['wavemaker','ng']) --> Hello, wavemaker ng\n */\nexport const replace = (template: any, map: any, parseError?: boolean) => {\n let regEx = /\\$\\{([^\\}]+)\\}/g;\n if (!template) {\n return;\n }\n if (parseError) {\n regEx = /\\{([^\\}]+)\\}/g;\n }\n\n return template.replace(regEx, function (match: any, key: any) {\n return get(map, key);\n });\n};\n\n/*Function to check whether the specified object is a pageable object or not.*/\nexport const isPageable = (obj: any): boolean => {\n const pageable = {\n content: [],\n first: true,\n last: true,\n number: 0,\n numberOfElements: 10,\n size: 20,\n sort: null,\n totalElements: 10,\n totalPages: 1\n };\n // paginated object may or may not contain 'empty' property. In either case, Pageable should return as true.\n const paginatedObj = omit(obj, 'empty');\n return isEqual(keys(pageable), keys(paginatedObj).sort());\n};\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,GAAG,EAAEC,QAAQ,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,IAAI,EAAEC,IAAI,QAAQ,QAAQ;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,SAAS,GAAGA,CAACC,SAAc,EAAEC,GAAQ,EAAEC,GAAQ,EAAEC,OAAa,KAAK;EAC9EH,SAAS,GAAGA,SAAS,IAAI,CAAC,CAAC;EAC3B,IAAIF,IAAI;IACNM,OAAO;IACPC,QAAa,GAAG,CAAC,CAAC;;EAEpB;EACA,IAAIV,QAAQ,CAACQ,OAAO,CAAC,EAAE;IACrB;IACA,QAAQA,OAAO,CAACG,IAAI;MAClB,KAAK,MAAM;QACT;QACA;MACF,KAAK,QAAQ;QACXJ,GAAG,GAAGR,QAAQ,CAACQ,GAAG,CAAC,GAAGA,GAAG,GAAGK,QAAQ,CAACL,GAAG,EAAE,EAAE,CAAC;QAC7C;IACJ;EACF;EAEA,IAAIP,QAAQ,CAACM,GAAG,CAAC,EAAE;IACjB;IACAI,QAAQ,GAAGJ,GAAG;EAChB,CAAC,MAAM,IAAIA,GAAG,CAACO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE;IAChC;IACAV,IAAI,GAAGG,GAAG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