@wavemaker/app-rn-runtime 11.6.0-rc.5488 → 11.7.0-next.42251
Sign up to get free protection for your applications and to get access to all the features.
- app-rn-runtime/components/advanced/carousel/carousel.component.js +14 -9
- app-rn-runtime/components/advanced/carousel/carousel.component.js.map +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.styles.js +6 -3
- app-rn-runtime/components/advanced/carousel/carousel.styles.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js +33 -14
- app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
- app-rn-runtime/components/advanced/webview/webview.props.js +3 -1
- app-rn-runtime/components/advanced/webview/webview.props.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js +22 -8
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.props.js +7 -0
- app-rn-runtime/components/basic/anchor/anchor.props.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.styles.js +3 -1
- app-rn-runtime/components/basic/anchor/anchor.styles.js.map +1 -1
- app-rn-runtime/components/basic/animatedview.component.js +5 -3
- app-rn-runtime/components/basic/animatedview.component.js.map +1 -1
- app-rn-runtime/components/basic/button/button.component.js +41 -8
- app-rn-runtime/components/basic/button/button.component.js.map +1 -1
- app-rn-runtime/components/basic/button/button.props.js +7 -0
- app-rn-runtime/components/basic/button/button.props.js.map +1 -1
- app-rn-runtime/components/basic/button/button.styles.js +9 -10
- app-rn-runtime/components/basic/button/button.styles.js.map +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js +13 -5
- app-rn-runtime/components/basic/buttongroup/buttongroup.styles.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.component.js +64 -12
- app-rn-runtime/components/basic/icon/icon.component.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.props.js +7 -0
- app-rn-runtime/components/basic/icon/icon.props.js.map +1 -1
- app-rn-runtime/components/basic/icon/icon.styles.js +2 -1
- app-rn-runtime/components/basic/icon/icon.styles.js.map +1 -1
- app-rn-runtime/components/basic/label/label.component.js +34 -25
- app-rn-runtime/components/basic/label/label.component.js.map +1 -1
- app-rn-runtime/components/basic/label/label.props.js +4 -0
- app-rn-runtime/components/basic/label/label.props.js.map +1 -1
- app-rn-runtime/components/basic/label/label.styles.js +4 -5
- app-rn-runtime/components/basic/label/label.styles.js.map +1 -1
- app-rn-runtime/components/basic/message/message.component.js +3 -2
- app-rn-runtime/components/basic/message/message.component.js.map +1 -1
- app-rn-runtime/components/basic/message/message.props.js +3 -0
- app-rn-runtime/components/basic/message/message.props.js.map +1 -1
- app-rn-runtime/components/basic/message/message.styles.js +3 -1
- app-rn-runtime/components/basic/message/message.styles.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.component.js +4 -2
- app-rn-runtime/components/basic/picture/picture.component.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.props.js +3 -0
- app-rn-runtime/components/basic/picture/picture.props.js.map +1 -1
- app-rn-runtime/components/basic/picture/picture.styles.js +3 -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 -3
- 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 +2 -0
- app-rn-runtime/components/basic/progress-bar/progress-bar.props.js.map +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js +3 -2
- app-rn-runtime/components/basic/progress-circle/progress-circle.component.js.map +1 -1
- app-rn-runtime/components/basic/progress-circle/progress-circle.props.js +2 -0
- app-rn-runtime/components/basic/progress-circle/progress-circle.props.js.map +1 -1
- app-rn-runtime/components/basic/search/search.component.js +2 -1
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/search/search.props.js +3 -0
- app-rn-runtime/components/basic/search/search.props.js.map +1 -1
- app-rn-runtime/components/basic/search/search.styles.js +6 -5
- app-rn-runtime/components/basic/search/search.styles.js.map +1 -1
- app-rn-runtime/components/basic/skeleton/skeleton.component.js +0 -1
- app-rn-runtime/components/basic/skeleton/skeleton.component.js.map +1 -1
- app-rn-runtime/components/basic/video/video.component.js +4 -2
- app-rn-runtime/components/basic/video/video.component.js.map +1 -1
- app-rn-runtime/components/basic/video/video.props.js +3 -0
- app-rn-runtime/components/basic/video/video.props.js.map +1 -1
- app-rn-runtime/components/chart/area-chart/area-chart.component.js +34 -24
- 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 +29 -16
- 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 +0 -2
- app-rn-runtime/components/chart/bar-chart/bar-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.component.js +33 -7
- app-rn-runtime/components/chart/basechart.component.js.map +1 -1
- app-rn-runtime/components/chart/basechart.props.js +7 -2
- app-rn-runtime/components/chart/basechart.props.js.map +1 -1
- app-rn-runtime/components/chart/basechart.styles.js +9 -2
- app-rn-runtime/components/chart/basechart.styles.js.map +1 -1
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js +4 -2
- app-rn-runtime/components/chart/bubble-chart/bubble-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/line-chart/line-chart.component.js +27 -20
- 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 +7 -4
- app-rn-runtime/components/chart/pie-chart/pie-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js +33 -10
- app-rn-runtime/components/chart/stack-chart/stack-chart.component.js.map +1 -1
- app-rn-runtime/components/chart/stack-chart/stack-chart.props.js +1 -0
- app-rn-runtime/components/chart/stack-chart/stack-chart.props.js.map +1 -1
- app-rn-runtime/components/chart/staticdata.js +215 -0
- app-rn-runtime/components/chart/staticdata.js.map +1 -0
- app-rn-runtime/components/container/container.component.js +11 -2
- app-rn-runtime/components/container/container.component.js.map +1 -1
- app-rn-runtime/components/container/container.props.js +1 -0
- app-rn-runtime/components/container/container.props.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.component.js +6 -2
- app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
- app-rn-runtime/components/container/panel/panel.props.js +4 -0
- app-rn-runtime/components/container/panel/panel.props.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.js +17 -14
- app-rn-runtime/components/container/wizard/wizard.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizard.styles.js +19 -3
- app-rn-runtime/components/container/wizard/wizard.styles.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js +27 -2
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.component.js.map +1 -1
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js +6 -0
- app-rn-runtime/components/container/wizard/wizardstep/wizardstep.props.js.map +1 -1
- app-rn-runtime/components/data/card/card.component.js +7 -3
- app-rn-runtime/components/data/card/card.component.js.map +1 -1
- app-rn-runtime/components/data/card/card.props.js +4 -0
- app-rn-runtime/components/data/card/card.props.js.map +1 -1
- app-rn-runtime/components/data/form/form-action/form-action.styles.js +2 -1
- app-rn-runtime/components/data/form/form-action/form-action.styles.js.map +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js +5 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.component.js +136 -25
- app-rn-runtime/components/data/list/list.component.js.map +1 -1
- app-rn-runtime/components/data/list/list.props.js +4 -1
- 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/device/barcodescanner/barcodescanner.component.js +4 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.props.js +3 -0
- app-rn-runtime/components/device/barcodescanner/barcodescanner.props.js.map +1 -1
- app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js +13 -6
- app-rn-runtime/components/device/barcodescanner/barcodescanner.styles.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.component.js +4 -1
- app-rn-runtime/components/device/camera/camera.component.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.props.js +3 -0
- app-rn-runtime/components/device/camera/camera.props.js.map +1 -1
- app-rn-runtime/components/device/camera/camera.styles.js +12 -4
- app-rn-runtime/components/device/camera/camera.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js +4 -0
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.props.js +4 -0
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.props.js.map +1 -1
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js +2 -1
- app-rn-runtime/components/dialogs/alertdialog/alertdialog.styles.js.map +1 -1
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js +4 -0
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.props.js +4 -0
- app-rn-runtime/components/dialogs/confirmdialog/confirmdialog.props.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.js +7 -3
- app-rn-runtime/components/dialogs/dialog/dialog.component.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.props.js +4 -0
- app-rn-runtime/components/dialogs/dialog/dialog.props.js.map +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.styles.js +11 -2
- app-rn-runtime/components/dialogs/dialog/dialog.styles.js.map +1 -1
- app-rn-runtime/components/input/basedataset/basedataset.props.js +4 -0
- app-rn-runtime/components/input/basedataset/basedataset.props.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js +2 -2
- app-rn-runtime/components/input/baseinput/baseinput.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.props.js +4 -0
- app-rn-runtime/components/input/baseinput/baseinput.props.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.component.js +16 -10
- app-rn-runtime/components/input/basenumber/basenumber.component.js.map +1 -1
- app-rn-runtime/components/input/basenumber/basenumber.props.js +4 -0
- app-rn-runtime/components/input/basenumber/basenumber.props.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.component.js +12 -5
- app-rn-runtime/components/input/checkbox/checkbox.component.js.map +1 -1
- app-rn-runtime/components/input/checkbox/checkbox.styles.js +35 -5
- app-rn-runtime/components/input/checkbox/checkbox.styles.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js +13 -6
- app-rn-runtime/components/input/checkboxset/checkboxset.component.js.map +1 -1
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js +39 -10
- app-rn-runtime/components/input/checkboxset/checkboxset.styles.js.map +1 -1
- app-rn-runtime/components/input/chips/chips.component.js +5 -1
- app-rn-runtime/components/input/chips/chips.component.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 +1 -1
- app-rn-runtime/components/input/composite/composite.props.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.component.js +18 -3
- app-rn-runtime/components/input/currency/currency.component.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.props.js +1 -0
- app-rn-runtime/components/input/currency/currency.props.js.map +1 -1
- app-rn-runtime/components/input/currency/currency.styles.js +19 -1
- app-rn-runtime/components/input/currency/currency.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +76 -10
- app-rn-runtime/components/input/epoch/base-datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/date/date.component.js +8 -0
- app-rn-runtime/components/input/epoch/date/date.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/date/date.styles.js +16 -0
- app-rn-runtime/components/input/epoch/date/date.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.component.js +8 -0
- app-rn-runtime/components/input/epoch/datetime/datetime.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.props.js +5 -0
- app-rn-runtime/components/input/epoch/datetime/datetime.props.js.map +1 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js +49 -1
- app-rn-runtime/components/input/epoch/datetime/datetime.styles.js.map +1 -1
- app-rn-runtime/components/input/epoch/time/time.component.js +8 -0
- app-rn-runtime/components/input/epoch/time/time.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/time/time.styles.js +16 -0
- app-rn-runtime/components/input/epoch/time/time.styles.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js +2 -0
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.props.js +2 -0
- app-rn-runtime/components/input/fileupload/fileupload.props.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.styles.js +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.styles.js.map +1 -1
- app-rn-runtime/components/input/number/number.component.js +13 -2
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/number/number.props.js +1 -0
- app-rn-runtime/components/input/number/number.props.js.map +1 -1
- app-rn-runtime/components/input/number/number.styles.js +17 -0
- app-rn-runtime/components/input/number/number.styles.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +7 -2
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/select/select.component.js +7 -3
- app-rn-runtime/components/input/select/select.component.js.map +1 -1
- app-rn-runtime/components/input/select/select.styles.js +5 -1
- app-rn-runtime/components/input/select/select.styles.js.map +1 -1
- app-rn-runtime/components/input/slider/slider.styles.js +3 -3
- app-rn-runtime/components/input/slider/slider.styles.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.component.js +8 -1
- app-rn-runtime/components/input/switch/switch.component.js.map +1 -1
- app-rn-runtime/components/input/switch/switch.styles.js +10 -5
- app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +13 -1
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/text/text.props.js +1 -0
- app-rn-runtime/components/input/text/text.props.js.map +1 -1
- app-rn-runtime/components/input/text/text.styles.js +17 -0
- app-rn-runtime/components/input/text/text.styles.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +13 -1
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.props.js +1 -0
- app-rn-runtime/components/input/textarea/textarea.props.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.styles.js +17 -0
- app-rn-runtime/components/input/textarea/textarea.styles.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +48 -5
- app-rn-runtime/components/input/toggle/toggle.component.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.props.js +4 -0
- app-rn-runtime/components/input/toggle/toggle.props.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.styles.js +5 -12
- app-rn-runtime/components/input/toggle/toggle.styles.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js +6 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.component.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js +1 -0
- app-rn-runtime/components/navigation/appnavbar/appnavbar.props.js.map +1 -1
- app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js +11 -2
- app-rn-runtime/components/navigation/appnavbar/appnavbar.styles.js.map +1 -1
- app-rn-runtime/components/navigation/basenav/basenav.component.js +1 -2
- app-rn-runtime/components/navigation/basenav/basenav.component.js.map +1 -1
- app-rn-runtime/components/navigation/menu/menu.styles.js +8 -5
- app-rn-runtime/components/navigation/menu/menu.styles.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.component.js +8 -5
- app-rn-runtime/components/navigation/navitem/navitem.component.js.map +1 -1
- app-rn-runtime/components/navigation/navitem/navitem.props.js +3 -0
- app-rn-runtime/components/navigation/navitem/navitem.props.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.js +10 -3
- app-rn-runtime/components/navigation/popover/popover.component.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.props.js +7 -0
- app-rn-runtime/components/navigation/popover/popover.props.js.map +1 -1
- app-rn-runtime/components/navigation/popover/popover.styles.js +8 -2
- app-rn-runtime/components/navigation/popover/popover.styles.js.map +1 -1
- app-rn-runtime/components/page/page-content/page-content.component.js +7 -1
- app-rn-runtime/components/page/page-content/page-content.component.js.map +1 -1
- app-rn-runtime/components/page/tabbar/curve.js +84 -0
- app-rn-runtime/components/page/tabbar/curve.js.map +1 -0
- app-rn-runtime/components/page/tabbar/tabbar.component.js +44 -10
- app-rn-runtime/components/page/tabbar/tabbar.component.js.map +1 -1
- app-rn-runtime/components/page/tabbar/tabbar.styles.js +82 -15
- app-rn-runtime/components/page/tabbar/tabbar.styles.js.map +1 -1
- app-rn-runtime/core/accessibility.js +149 -0
- app-rn-runtime/core/accessibility.js.map +1 -0
- app-rn-runtime/core/base.component.js +21 -3
- app-rn-runtime/core/base.component.js.map +1 -1
- app-rn-runtime/core/components/floatinglabel.component.js +45 -0
- app-rn-runtime/core/components/floatinglabel.component.js.map +1 -0
- app-rn-runtime/core/components/textinput.component.js +25 -2
- app-rn-runtime/core/components/textinput.component.js.map +1 -1
- app-rn-runtime/core/event-notifier.js +22 -1
- app-rn-runtime/core/event-notifier.js.map +1 -1
- app-rn-runtime/core/tappable.component.js +37 -10
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/core/utils.js +11 -0
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/gestures/swipe.animation.js +34 -1
- app-rn-runtime/gestures/swipe.animation.js.map +1 -1
- app-rn-runtime/package.json +8 -3
- app-rn-runtime/runtime/App.js +12 -7
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/base-page.component.js +1 -1
- app-rn-runtime/runtime/base-page.component.js.map +1 -1
- app-rn-runtime/runtime/services/app-security.service.js +2 -1
- app-rn-runtime/runtime/services/app-security.service.js.map +1 -1
- app-rn-runtime/runtime/services/webprocess.service.js +0 -1
- app-rn-runtime/runtime/services/webprocess.service.js.map +1 -1
- app-rn-runtime/styles/background.component.js +1 -1
- app-rn-runtime/styles/background.component.js.map +1 -1
- app-rn-runtime/styles/theme.js +43 -0
- app-rn-runtime/styles/theme.js.map +1 -1
- app-rn-runtime/styles/theme.variables.js +30 -6
- app-rn-runtime/styles/theme.variables.js.map +1 -1
- app-rn-runtime/variables/model-variable.js +2 -1
- app-rn-runtime/variables/model-variable.js.map +1 -1
- app-rn-runtime/variables/service-variable.js +14 -6
- app-rn-runtime/variables/service-variable.js.map +1 -1
@@ -4,13 +4,28 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
4
4
|
export default class EventNotifier {
|
5
5
|
constructor() {
|
6
6
|
_defineProperty(this, "listeners", {});
|
7
|
+
_defineProperty(this, "parent", null);
|
8
|
+
_defineProperty(this, "children", []);
|
9
|
+
}
|
10
|
+
setParent(parent) {
|
11
|
+
if (parent !== this.parent) {
|
12
|
+
this.parent = parent;
|
13
|
+
this.parent.children.push(this);
|
14
|
+
}
|
7
15
|
}
|
8
16
|
notify(event, args) {
|
9
17
|
if (this.listeners[event]) {
|
10
18
|
this.listeners[event].forEach(l => {
|
11
|
-
|
19
|
+
try {
|
20
|
+
l && l.apply(null, args);
|
21
|
+
} catch (e) {
|
22
|
+
console.error(e);
|
23
|
+
}
|
12
24
|
});
|
13
25
|
}
|
26
|
+
this.children.forEach(c => {
|
27
|
+
c.notify(event, args);
|
28
|
+
});
|
14
29
|
}
|
15
30
|
subscribe(event, fn) {
|
16
31
|
this.listeners[event] = this.listeners[event] || [];
|
@@ -21,5 +36,11 @@ export default class EventNotifier {
|
|
21
36
|
eventListeners.splice(i, 1);
|
22
37
|
};
|
23
38
|
}
|
39
|
+
destroy() {
|
40
|
+
if (this.parent) {
|
41
|
+
const i = this.parent.children.indexOf(this) || -1;
|
42
|
+
this.parent.children.splice(i, 1);
|
43
|
+
}
|
44
|
+
}
|
24
45
|
}
|
25
46
|
//# sourceMappingURL=event-notifier.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["EventNotifier","constructor","_defineProperty","notify","event","args","listeners","forEach","l","apply","
|
1
|
+
{"version":3,"names":["EventNotifier","constructor","_defineProperty","setParent","parent","children","push","notify","event","args","listeners","forEach","l","apply","e","console","error","c","subscribe","fn","eventListeners","i","findIndex","fni","splice","destroy","indexOf"],"sources":["event-notifier.ts"],"sourcesContent":["export default class EventNotifier {\n private listeners = {} as any;\n private parent: EventNotifier = null as any;\n private children: EventNotifier[] = [];\n\n setParent(parent: EventNotifier) {\n if (parent !== this.parent) {\n this.parent = parent;\n this.parent.children.push(this);\n }\n }\n\n public notify(event: string, args: any[]) {\n if (this.listeners[event]) {\n this.listeners[event].forEach((l: Function) => {\n try {\n l && l.apply(null, args);\n } catch(e) {\n console.error(e);\n }\n });\n }\n this.children.forEach((c) => {\n c.notify(event, args);\n })\n }\n\n public subscribe(event: string, fn: Function) {\n this.listeners[event] = this.listeners[event] || [];\n this.listeners[event].push(fn);\n return () => {\n const eventListeners = this.listeners[event];\n const i = eventListeners.findIndex((fni: Function) => fni === fn);\n eventListeners.splice(i, 1);\n };\n }\n\n public destroy() {\n if (this.parent) {\n const i = this.parent.children.indexOf(this) || -1;\n this.parent.children.splice(i, 1);\n }\n }\n}"],"mappings":";;;AAAA,eAAe,MAAMA,aAAa,CAA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E,CAAC,CAAC;IAC/B,CAAC;EACL;EAEOI,OAAOA,CAAA,EAAG;IACb,IAAI,IAAI,CAACrB,MAAM,EAAE;MACb,MAAMiB,CAAC,GAAG,IAAI,CAACjB,MAAM,CAACC,QAAQ,CAACqB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;MAClD,IAAI,CAACtB,MAAM,CAACC,QAAQ,CAACmB,MAAM,CAACH,CAAC,EAAE,CAAC,CAAC;IACrC;EACJ;AACJ"}
|
@@ -4,9 +4,9 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
4
4
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
5
5
|
import React from "react";
|
6
6
|
import { Platform, View } from "react-native";
|
7
|
-
import { TouchableOpacity } from "react-native";
|
8
7
|
import { get } from "lodash";
|
9
8
|
import injector from "./injector";
|
9
|
+
import { TouchableRipple } from "react-native-paper";
|
10
10
|
export class TapEvent {
|
11
11
|
constructor() {
|
12
12
|
_defineProperty(this, "propagationEnabled", true);
|
@@ -19,10 +19,13 @@ export class Tappable extends React.Component {
|
|
19
19
|
constructor(props) {
|
20
20
|
super(props);
|
21
21
|
_defineProperty(this, "lastPress", 0);
|
22
|
+
_defineProperty(this, "lastTap", 0);
|
23
|
+
_defineProperty(this, "lastDoubleTap", 0);
|
24
|
+
_defineProperty(this, "isLongTap", false);
|
22
25
|
}
|
23
26
|
onPress(e) {
|
24
|
-
|
25
|
-
this.lastPress =
|
27
|
+
var _this$props$target;
|
28
|
+
this.lastPress = Date.now();
|
26
29
|
const target = this.props.target;
|
27
30
|
if (!Tappable.CURRENT_EVENT) {
|
28
31
|
Tappable.CURRENT_EVENT = new TapEvent();
|
@@ -31,14 +34,23 @@ export class Tappable extends React.Component {
|
|
31
34
|
}, 10);
|
32
35
|
}
|
33
36
|
const syntheticEvent = Tappable.CURRENT_EVENT;
|
37
|
+
this.props.onTouchStart && this.props.onTouchStart(e || syntheticEvent);
|
38
|
+
(_this$props$target = this.props.target) === null || _this$props$target === void 0 ? void 0 : _this$props$target.invokeEventCallback('onTouchstart', [syntheticEvent, this.props.target]);
|
39
|
+
const currentTime = Date.now();
|
40
|
+
const tapDelta = currentTime - this.lastTap;
|
41
|
+
if (this.isLongTap) {
|
42
|
+
this.isLongTap = false;
|
43
|
+
return;
|
44
|
+
}
|
34
45
|
if (syntheticEvent.propagationEnabled) {
|
35
46
|
var _injector$FOCUSED_ELE;
|
36
47
|
(_injector$FOCUSED_ELE = injector.FOCUSED_ELEMENT.get()) === null || _injector$FOCUSED_ELE === void 0 ? void 0 : _injector$FOCUSED_ELE.blur();
|
37
|
-
if (
|
48
|
+
if (this.lastDoubleTap !== this.lastTap && tapDelta < 500) {
|
38
49
|
this.props.onDoubleTap && this.props.onDoubleTap(e);
|
39
50
|
setTimeout(() => {
|
40
51
|
target === null || target === void 0 ? void 0 : target.invokeEventCallback('onDoubletap', [syntheticEvent, target]);
|
41
52
|
}, 200);
|
53
|
+
this.lastDoubleTap = currentTime;
|
42
54
|
}
|
43
55
|
setTimeout(() => {
|
44
56
|
if (this.props.onTap) {
|
@@ -47,31 +59,46 @@ export class Tappable extends React.Component {
|
|
47
59
|
target === null || target === void 0 ? void 0 : target.invokeEventCallback('onTap', [syntheticEvent, target]);
|
48
60
|
}
|
49
61
|
}, 200);
|
62
|
+
this.lastTap = currentTime;
|
50
63
|
}
|
51
64
|
}
|
52
65
|
onLongTap(e) {
|
53
66
|
const syntheticEvent = Tappable.CURRENT_EVENT;
|
54
67
|
this.props.onLongTap && this.props.onLongTap(e || syntheticEvent);
|
55
68
|
setTimeout(() => {
|
56
|
-
var _this$props$
|
57
|
-
(_this$props$
|
69
|
+
var _this$props$target2;
|
70
|
+
(_this$props$target2 = this.props.target) === null || _this$props$target2 === void 0 ? void 0 : _this$props$target2.invokeEventCallback('onLongtap', [syntheticEvent, this.props.target]);
|
71
|
+
}, 200);
|
72
|
+
this.isLongTap = true;
|
73
|
+
}
|
74
|
+
onPressOut(e) {
|
75
|
+
const syntheticEvent = Tappable.CURRENT_EVENT;
|
76
|
+
this.props.onTouchEnd && this.props.onTouchEnd(e || syntheticEvent);
|
77
|
+
setTimeout(() => {
|
78
|
+
var _this$props$target3;
|
79
|
+
(_this$props$target3 = this.props.target) === null || _this$props$target3 === void 0 ? void 0 : _this$props$target3.invokeEventCallback('onTouchend', [syntheticEvent, this.props.target]);
|
58
80
|
}, 200);
|
81
|
+
this.isLongTap = false;
|
59
82
|
}
|
60
83
|
render() {
|
61
84
|
const target = this.props.target;
|
62
85
|
if (target !== null && target !== void 0 && target.props.onTap || target !== null && target !== void 0 && target.props.onLongtap || target !== null && target !== void 0 && target.props.onDoubletap || this.props.onTap || this.props.onLongTap || this.props.onDoubleTap) {
|
63
|
-
return /*#__PURE__*/React.createElement(
|
86
|
+
return /*#__PURE__*/React.createElement(TouchableRipple, _extends({
|
87
|
+
rippleColor: this.props.rippleColor,
|
88
|
+
borderless: true
|
89
|
+
}, Platform.OS === 'android' || Platform.OS === 'web' ? {
|
64
90
|
accessibilityLabel: this.props.testID,
|
65
91
|
testID: this.props.testID
|
66
92
|
} : {
|
67
|
-
accessible: false,
|
93
|
+
// accessible: false,
|
68
94
|
testID: this.props.testID
|
69
95
|
}, {
|
70
96
|
disabled: get(target === null || target === void 0 ? void 0 : target.proxy, 'disabled'),
|
71
97
|
style: this.props.styles,
|
72
98
|
onPress: () => this.onPress(),
|
73
|
-
onLongPress: () => this.onLongTap()
|
74
|
-
|
99
|
+
onLongPress: () => this.onLongTap(),
|
100
|
+
onPressOut: () => this.onPressOut()
|
101
|
+
}), /*#__PURE__*/React.createElement(React.Fragment, null, this.props.children));
|
75
102
|
}
|
76
103
|
return /*#__PURE__*/React.createElement(View, {
|
77
104
|
style: this.props.styles
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","Platform","View","
|
1
|
+
{"version":3,"names":["React","Platform","View","get","injector","TouchableRipple","TapEvent","constructor","_defineProperty","stopPropagation","propagationEnabled","Tappable","Component","props","onPress","e","_this$props$target","lastPress","Date","now","target","CURRENT_EVENT","setTimeout","syntheticEvent","onTouchStart","invokeEventCallback","currentTime","tapDelta","lastTap","isLongTap","_injector$FOCUSED_ELE","FOCUSED_ELEMENT","blur","lastDoubleTap","onDoubleTap","onTap","onLongTap","_this$props$target2","onPressOut","onTouchEnd","_this$props$target3","render","onLongtap","onDoubletap","createElement","_extends","rippleColor","borderless","OS","accessibilityLabel","testID","disabled","proxy","style","styles","onLongPress","Fragment","children"],"sources":["tappable.component.tsx"],"sourcesContent":["import { BaseComponent } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport React from \"react\";\nimport { GestureResponderEvent, Platform, View } from \"react-native\";\nimport { get } from \"lodash\";\nimport injector from \"./injector\";\nimport { TouchableRipple } from \"react-native-paper\";\nimport ThemeVariables from \"../styles/theme.variables\";\n\n\ninterface TappableProps {\n testID?: string;\n children?: any\n styles?: any;\n target?: BaseComponent<any, any, any>;\n onTap?: (e: any) => void;\n onLongTap?: (e: any) => void; \n onDoubleTap?: (e: any) => void;\n onTouchStart? : (e: any) => void;\n onTouchEnd? : (e: any) => void;\n rippleColor?: string;\n}\n\nexport class TapEvent {\n propagationEnabled = true;\n \n constructor() {\n\n }\n\n stopPropagation() {\n this.propagationEnabled = false;\n }\n}\n\nexport class Tappable extends React.Component<TappableProps, any> {\n private lastPress = 0;\n private lastTap = 0;\n private lastDoubleTap = 0;\n private isLongTap = false;\n\n static CURRENT_EVENT: TapEvent = null as any;\n \n constructor(props: any) {\n super(props);\n }\n\n onPress(e?: GestureResponderEvent): void { \n this.lastPress = Date.now();\n const target = this.props.target;\n if (!Tappable.CURRENT_EVENT) {\n Tappable.CURRENT_EVENT = new TapEvent();\n setTimeout(() => {\n Tappable.CURRENT_EVENT = null as any;\n }, 10);\n }\n const syntheticEvent = Tappable.CURRENT_EVENT;\n this.props.onTouchStart && this.props.onTouchStart(e || syntheticEvent);\n this.props.target?.invokeEventCallback('onTouchstart', [syntheticEvent, this.props.target]);\n const currentTime = Date.now();\n const tapDelta = currentTime - this.lastTap;\n if (this.isLongTap) {\n this.isLongTap = false;\n return;\n }\n if (syntheticEvent.propagationEnabled) {\n injector.FOCUSED_ELEMENT.get()?.blur();\n if(this.lastDoubleTap !== this.lastTap \n && tapDelta < 500) {\n this.props.onDoubleTap && this.props.onDoubleTap(e);\n setTimeout(() => {\n target?.invokeEventCallback('onDoubletap', [syntheticEvent, target]);\n }, 200);\n this.lastDoubleTap = currentTime;\n }\n setTimeout(() => {\n if (this.props.onTap) {\n this.props.onTap(e || syntheticEvent);\n } else {\n target?.invokeEventCallback('onTap', [syntheticEvent, target]);\n }\n }, 200);\n this.lastTap = currentTime;\n }\n }\n\n onLongTap(e?: GestureResponderEvent): void {\n const syntheticEvent = Tappable.CURRENT_EVENT;\n this.props.onLongTap && this.props.onLongTap(e || syntheticEvent);\n setTimeout(() => {\n this.props.target?.invokeEventCallback('onLongtap', [syntheticEvent, this.props.target]);\n }, 200);\n this.isLongTap = true;\n }\n \n onPressOut(e?: GestureResponderEvent): void {\n const syntheticEvent = Tappable.CURRENT_EVENT;\n this.props.onTouchEnd && this.props.onTouchEnd(e || syntheticEvent);\n setTimeout(() => {\n this.props.target?.invokeEventCallback('onTouchend', [syntheticEvent, this.props.target]);\n }, 200);\n this.isLongTap = false;\n }\n\n render() {\n const target = this.props.target;\n if (target?.props.onTap \n || target?.props.onLongtap \n || target?.props.onDoubletap \n || this.props.onTap \n || this.props.onLongTap \n || this.props.onDoubleTap) {\n return (\n <TouchableRipple\n rippleColor={this.props.rippleColor}\n borderless = {true}\n {...(Platform.OS === 'android' || Platform.OS === 'web') ? {\n accessibilityLabel: this.props.testID,\n testID: this.props.testID\n }: {\n // accessible: false,\n testID: this.props.testID\n }} \n disabled={get(target?.proxy, 'disabled')}\n style={this.props.styles}\n onPress={() => this.onPress()}\n onLongPress={() => this.onLongTap()}\n onPressOut={() => this.onPressOut()}>\n <>{this.props.children}</>\n </TouchableRipple>\n );\n }\n return (<View style={this.props.styles}>{this.props.children}</View>);\n }\n}\n"],"mappings":";;;;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAgCC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AACpE,SAASC,GAAG,QAAQ,QAAQ;AAC5B,OAAOC,QAAQ,MAAM,YAAY;AACjC,SAASC,eAAe,QAAQ,oBAAoB;AAiBpD,OAAO,MAAMC,QAAQ,CAAC;EAGlBC,WAAWA,CAAA,EAAG;IAAAC,eAAA,6BAFO,IAAI;EAIzB;EAEAC,eAAeA,CAAA,EAAG;IACd,IAAI,CAACC,kBAAkB,GAAG,KAAK;EACnC;AACJ;AAEA,OAAO,MAAMC,QAAQ,SAASX,KAAK,CAACY,SAAS,CAAqB;EAQ9DL,WAAWA,CAACM,KAAU,EAAE;IACpB,KAAK,CAACA,KAAK,CAAC;IAACL,eAAA,oBARG,CAAC;IAAAA,eAAA,kBACH,CAAC;IAAAA,eAAA,wBACK,CAAC;IAAAA,eAAA,oBACL,KAAK;EAMzB;EAEAM,OAAOA,CAACC,CAAyB,EAAQ;IAAA,IAAAC,kBAAA;IACrC,IAAI,CAACC,SAAS,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;IAC3B,MAAMC,MAAM,GAAG,IAAI,CAACP,KAAK,CAACO,MAAM;IAChC,IAAI,CAACT,QAAQ,CAACU,aAAa,EAAE;MACzBV,QAAQ,CAACU,aAAa,GAAG,IAAIf,QAAQ,CAAC,CAAC;MACvCgB,UAAU,CAAC,MAAM;QACbX,QAAQ,CAACU,aAAa,GAAG,IAAW;MACxC,CAAC,EAAE,EAAE,CAAC;IACV;IACA,MAAME,cAAc,GAAGZ,QAAQ,CAACU,aAAa;IAC7C,IAAI,CAACR,KAAK,CAACW,YAAY,IAAI,I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;MAACmD,KAAK,EAAE,IAAI,CAACxC,KAAK,CAACyC;IAAO,GAAE,IAAI,CAACzC,KAAK,CAAC4C,QAAe,CAAC;EACxE;AACJ;AAACjD,eAAA,CAnGYG,QAAQ,mBAMgB,IAAI"}
|
app-rn-runtime/core/utils.js
CHANGED
@@ -329,4 +329,15 @@ export const isDataSetWidget = widget => {
|
|
329
329
|
export const isFullPathUrl = url => {
|
330
330
|
return isString(url) && (url.startsWith('data:') || url.startsWith('http:') || url.startsWith('https:') || url.startsWith('file:'));
|
331
331
|
};
|
332
|
+
export function removeUndefinedKeys(obj) {
|
333
|
+
for (const key in obj) {
|
334
|
+
if (obj[key] === undefined) {
|
335
|
+
delete obj[key];
|
336
|
+
} else if (typeof obj[key] === 'object') {
|
337
|
+
// * if the value is an object, recursively call the function
|
338
|
+
removeUndefinedKeys(obj[key]);
|
339
|
+
}
|
340
|
+
}
|
341
|
+
return obj;
|
342
|
+
}
|
332
343
|
//# sourceMappingURL=utils.js.map
|
app-rn-runtime/core/utils.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Platform","moment","FileSystem","isFunction","includes","isUndefined","isNull","orderBy","groupBy","toLower","get","forEach","sortBy","cloneDeep","keys","values","isArray","isString","isNumber","GROUP_BY_OPTIONS","ALPHABET","WORD","OTHERS","TIME_ROLLUP_OPTIONS","HOUR","DAY","WEEK","MONTH","YEAR","_deepCopy","o1","_len","arguments","length","o2","Array","_key","o","Object","k","v","deepCopy","_len2","objects","_key2","toBoolean","val","undefined","toNumber","parseFloat","e","encodeUrl","url","splits","split","hash","params","map","p","encodeURIComponent","join","encodeURI","isWebPreviewMode","OS","isDevMode","__DEV__","widgetsWithUndefinedValue","isAndroid","test","window","navigator","userAgent","isIos","getGroupKey","fieldDef","groupby","widgetScope","innerItem","apply","proxy","getGroupedData","fieldDefs","match","orderby","dateFormat","groupKey","groupedLiData","concatStr","toString","trim","substr","replace","format","getSortedGroupedData","getOrderedDataset","dataSet","items","fields","directions","obj","item","push","_groupedData","groupkey","index","liData","key","data","_groupIndex","isDefined","unStringify","defaultVal","number","parseInt","isNaN","retryIfFails","fn","interval","maxRetries","onBeforeRetry","Promise","resolve","retryCount","tryFn","reject","errorFn","errArgs","setTimeout","then","retry","getAbortableDefer","_defer","promise","onAbort","isAborted","abort","validateField","props","value","requiredCheck","regexCheck","required","errorType","isValid","regexp","condition","RegExp","maxchars","mindate","Date","datavalue","startOf","toDate","maxdate","endOf","countDecimalDigits","numberString","decimalMatch","decimalDigits","formatCompactNumber","isNegative","formattedNumber","toFixed","toBase64","path","readAsStringAsync","encoding","DATASET_WIDGETS","Set","isDataSetWidget","widget","has","isFullPathUrl","startsWith"],"sources":["utils.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport moment from \"moment\";\nimport * as FileSystem from \"expo-file-system\";\nimport { isFunction, includes, isUndefined, isNull, orderBy, groupBy, toLower, get, forEach, sortBy, cloneDeep, keys, values, isArray, isString, isNumber} from 'lodash';\n\ndeclare const window: any;\nconst GROUP_BY_OPTIONS = {\n ALPHABET: 'alphabet',\n WORD: 'word',\n OTHERS: 'Others'\n};\nconst TIME_ROLLUP_OPTIONS = {\n HOUR: 'hour',\n DAY: 'day',\n WEEK: 'week',\n MONTH: 'month',\n YEAR: 'year'\n};\n\nconst _deepCopy = (o1: any, ...o2: any) => {\n o2.forEach((o: any) => {\n if (o) {\n Object.keys(o).forEach(k => {\n const v = o[k];\n if (v && !isString(v) && !isArray(v) && typeof v === 'object') {\n o1[k] = _deepCopy(o1[k] || {}, o[k]);\n } else {\n o1[k] = _deepCopy(v);\n }\n });\n }\n });\n return o1;\n};\n\nexport const deepCopy = (...objects: any) => _deepCopy({}, ...objects);\n\nexport const toBoolean = (val: any) => {\n return val === true\n || val === 'true'\n || !(val === false\n || val === null\n || val === undefined\n || val === '');\n};\n\nexport const toNumber = (val: any) => {\n try {\n return parseFloat(val) || 0;\n } catch(e) {\n return 0;\n }\n};\n\n/**\n * this method encodes the url and returns the encoded string\n */\n export const encodeUrl = (url: string): string => {\n let splits = url.split('#');\n const hash = splits[1];\n splits = splits[0].split('?');\n let params = '';\n if (splits.length > 1) {\n params = splits[1].split('&')\n .map(p => p.split('='))\n .map(p => p[0] +'=' + encodeURIComponent(p[1]))\n .join('&');\n }\n return encodeURI(splits[0]) + (params ? '?' + params: '') + (hash ? '#'+ hash : '');\n};\n\nexport const isWebPreviewMode = () => Platform.OS === 'web';\n\nexport const isDevMode = () => isWebPreviewMode() || __DEV__;\n\nexport const widgetsWithUndefinedValue = ['checkbox', 'toggle'];\n\nexport const isAndroid = () => (Platform.OS === 'android' || (Platform.OS === 'web' && /android/i.test(window.navigator.userAgent)));\n\nexport const isIos = () => (Platform.OS === 'ios' || (Platform.OS === 'web' && /iPhone|iPad/i.test(window.navigator.userAgent)));\n\nconst getGroupKey = (fieldDef: any, groupby: string, widgetScope: any, innerItem?: any) => isFunction(groupby) ? groupby.apply(widgetScope.proxy, [innerItem ? fieldDef[innerItem] : fieldDef]) : get(innerItem ? fieldDef[innerItem] : fieldDef, groupby);\n\n/**\n * This method prepares the grouped data.\n *\n * @param fieldDefs array of objects i.e. dataset\n * @param groupby string groupby\n * @param match string match\n * @param orderby string orderby\n * @param dateFormat string date format\n */\nexport const getGroupedData = (fieldDefs: any, groupby: string, match: string, orderby: string, dateFormat: string, widgetScope: any, innerItem?: any) => {\n\n // handling case-in-sensitive scenario\n // ordering the data based on groupby field. If there is innerItem then apply orderby using the innerItem's containing the groupby field.\n fieldDefs = orderBy(fieldDefs, fieldDef => {\n const groupKey = getGroupKey(fieldDef, groupby, widgetScope, innerItem);\n if (groupKey) {\n return toLower(groupKey);\n }\n return '';\n });\n\n // extract the grouped data based on the field obtained from 'groupDataByField'.\n const groupedLiData = groupBy(fieldDefs, function (fieldDef) {\n let concatStr = getGroupKey(fieldDef, groupby, widgetScope, innerItem);\n // by default set the undefined groupKey as 'others'\n if (isUndefined(concatStr) || isNull(concatStr) || concatStr.toString().trim() === '') {\n return GROUP_BY_OPTIONS.OTHERS;\n }\n // if match prop is alphabetic ,get the starting alphabet of the word as key.\n if (match === GROUP_BY_OPTIONS.ALPHABET) {\n concatStr = concatStr.substr(0, 1);\n }\n\n // if match contains the time options then get the concatStr using 'getTimeRolledUpString'\n if (includes(values(TIME_ROLLUP_OPTIONS), match)) {\n dateFormat = dateFormat && dateFormat.replace(/d/g, 'D');\n dateFormat = dateFormat && dateFormat.replace(/y/g, 'Y');\n concatStr = moment(concatStr).format(dateFormat);\n }\n\n return concatStr;\n });\n\n return getSortedGroupedData(groupedLiData, groupby, orderby, innerItem);\n};\n\n/**\n * function to get the ordered dataset based on the given orderby\n */\nexport const getOrderedDataset = (dataSet: any, orderby: string, innerItem?: any) => {\n if (!orderBy) {\n return cloneDeep(dataSet);\n }\n\n // The order by only works when the dataset contains list of objects.\n const items = orderby && orderby.split(','),\n fields: any = [],\n directions: any = [];\n items && items.forEach( obj => {\n const item = obj.split(':');\n fields.push(innerItem ? innerItem + '.' + item[0] : item[0]);\n directions.push(item[1]);\n });\n return orderBy(dataSet, fields, directions);\n};\n\n\n/**\n * This method returns sorted data based to groupkey.\n * Returns a array of objects, each object containing key which is groupKey and data is the sorted data which is sorted by groupby field in the data.\n *\n * @param groupedLiData, grouped data object with key as the groupKey and its value as the array of objects grouped under the groupKey.\n * @param groupBy, string groupby property\n * @returns {any[]}\n */\nexport const getSortedGroupedData = (groupedLiData: any, groupBy: string, orderby: string, innerItem?: any) => {\n const _groupedData: any = [];\n forEach(keys(groupedLiData), (groupkey, index) => {\n const liData = getOrderedDataset(groupedLiData[groupkey], orderby, innerItem);\n _groupedData.push({\n key: groupkey,\n data: sortBy(liData, data => {\n data._groupIndex = index;\n return get(data, groupBy) || get(data[innerItem], groupBy);\n })\n });\n });\n return _groupedData;\n};\n\nexport const isDefined = (v: any) => typeof v !== 'undefined';\n\n// try to convert the chekedvalue and unchecked values to boolean/number\nexport const unStringify = (val: any, defaultVal?: boolean) => {\n if (val === null) {\n return defaultVal;\n }\n\n if (val === true || val === 'true') {\n return true;\n }\n\n if (val === false || val === 'false') {\n return false;\n }\n\n const number = parseInt(val, 10);\n if (!isNaN(number)) {\n return number;\n }\n return val;\n};\n\n/**\n * This function invokes the given the function (fn) until the function successfully executes or the maximum number\n * of retries is reached or onBeforeRetry returns false.\n *\n * @param fn - a function that is needs to be invoked. The function can also return a promise as well.\n * @param interval - minimum time gap between successive retries. This argument should be greater or equal to 0.\n * @param maxRetries - maximum number of retries. This argument should be greater than 0. For all other values,\n * maxRetries is infinity.\n * @param onBeforeRetry - a callback function that will be invoked before re-invoking again. This function can\n * return false or a promise that is resolved to false to stop further retry attempts.\n * @returns {*} a promise that is resolved when fn is success (or) maximum retry attempts reached\n * (or) onBeforeRetry returned false.\n */\nexport const retryIfFails = (fn: Function, interval: number, maxRetries: number, onBeforeRetry = () => Promise.resolve(false)) => {\n let retryCount = 0;\n const tryFn = () => {\n retryCount++;\n if (isFunction(fn)) {\n return fn();\n }\n };\n maxRetries = (isNumber(maxRetries) && maxRetries > 0 ? maxRetries : 0);\n interval = (isNumber(interval) && interval > 0 ? interval : 0);\n return new Promise((resolve, reject) => {\n const errorFn = function () {\n const errArgs = arguments;\n setTimeout(() => {\n Promise.resolve().then(() => onBeforeRetry()).then(function (retry) {\n if (retry !== false && (!maxRetries || retryCount <= maxRetries)) {\n Promise.resolve().then(() => tryFn()).then(resolve, errorFn);\n } else {\n reject(errArgs);\n }\n }, () => reject(errArgs));\n }, interval);\n };\n Promise.resolve().then(() => tryFn()).then(resolve, errorFn);\n });\n};\n\n/**\n * Promise of a defer created using this function, has abort function that will reject the defer when called.\n * @returns {*} angular defer object\n */\nexport const getAbortableDefer = () => {\n const _defer: any = {\n promise: null,\n reject: null,\n resolve: null,\n onAbort: () => { },\n isAborted: false\n };\n _defer.promise = new Promise((resolve, reject) => {\n _defer.resolve = resolve;\n _defer.reject = reject;\n });\n _defer.promise.abort = () => {\n _defer.onAbort && _defer.onAbort();\n _defer.reject('aborted');\n _defer.isAborted = true;\n };\n return _defer;\n};\n\nexport const validateField = (props: any, value: any) => {\n let requiredCheck = true, regexCheck = true;\n if (props.required) {\n if (isArray(value)) {\n requiredCheck = value.length === 0 ? false : true\n } else {\n requiredCheck = !value ? false : true\n }\n if (!requiredCheck) {\n return {\n errorType : 'required',\n isValid: false\n }\n }\n }\n if (value && props.regexp) {\n const condition = new RegExp(\"^\" + props.regexp + \"$\", 'g');\n regexCheck = condition.test(value);\n if (!regexCheck) {\n return {\n errorType : 'regexp',\n isValid: false\n }\n }\n }\n if (value && props.maxchars && value.length > props.maxchars) {\n return {\n errorType : 'maxchars',\n isValid: false\n }\n\n }\n if (value && props.mindate && new Date(props.datavalue) < moment(props.mindate).startOf('day').toDate()) {\n return {\n errorType : 'mindate',\n isValid: false\n }\n }\n if (value && props.maxdate && new Date(props.datavalue) > moment(props.maxdate).endOf('day').toDate()) {\n return {\n errorType : 'maxdate',\n isValid: false\n }\n }\n\n return {\n isValid: true\n }\n};\n\nexport const countDecimalDigits = (number: number | string) => {\n if (!number) return 0;\n\n // * convert the number to a string\n const numberString = number.toString();\n \n // * regular expression to match and count the decimal digits\n const decimalMatch = numberString.match(/\\.(\\d+)/);\n\n if (decimalMatch) {\n const decimalDigits = decimalMatch[1];\n return decimalDigits.length;\n } else {\n return 0; // * no decimal digits found\n }\n}\n\nexport const formatCompactNumber = (number: number) => {\n const isNegative = number < 0;\n number = isNegative ? number * -1 : number;\n let formattedNumber = number + '';\n if (number >= 1000 && number < 1_000_000) {\n formattedNumber = (number / 1000).toFixed(1).replace(/\\.0$/, \"\") + \"K\";\n } else if (number >= 1_000_000 && number < 1_000_000_000) {\n formattedNumber = (number / 1_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"M\";\n } else if (number >= 1_000_000_000 && number < 1_000_000_000_000) {\n formattedNumber = (number / 1_000_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"B\";\n } else if (number >= 1_000_000_000_000 && number < 1_000_000_000_000_000) {\n formattedNumber = (number / 1_000_000_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"T\";\n }\n return (isNegative ? '-' : '') + formattedNumber;\n}\n\nexport const toBase64 = function(path: string) {\n return FileSystem.readAsStringAsync(path, { encoding: 'base64' });\n};\n\nconst DATASET_WIDGETS = new Set([ 'select', 'checkboxset', 'radioset', 'switch', 'autocomplete', 'chips', 'typeahead', 'rating']);\nexport const isDataSetWidget = (widget: any) => {\n return DATASET_WIDGETS.has(widget);\n};\nexport const isFullPathUrl = (url: string) => {\n return isString(url) &&\n (url.startsWith('data:') \n || url.startsWith('http:') \n || url.startsWith('https:') \n || url.startsWith('file:'));\n};\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAO,KAAKC,UAAU,MAAM,kBAAkB;AAC9C,SAASC,UAAU,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAEC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,QAAQ,QAAO,QAAQ;AAGxK,MAAMC,gBAAgB,GAAG;EACvBC,QAAQ,EAAE,UAAU;EACpBC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE;AACV,CAAC;AACD,MAAMC,mBAAmB,GAAG;EAC1BC,IAAI,EAAE,MAAM;EACZC,GAAG,EAAE,KAAK;EACVC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE;AACR,CAAC;AAED,MAAMC,SAAS,GAAG,SAAAA,CAACC,EAAO,EAAiB;EAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAZC,EAAE,OAAAC,KAAA,CAAAJ,IAAA,OAAAA,IAAA,WAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;IAAFF,EAAE,C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AACmC,GAAG,CAAC,KACnBA,GAAG,CAACyH,UAAU,CAAC,OAAO,CAAC,IACrBzH,GAAG,CAACyH,UAAU,CAAC,OAAO,CAAC,IACvBzH,GAAG,CAACyH,UAAU,CAAC,QAAQ,CAAC,IACxBzH,GAAG,CAACyH,UAAU,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC"}
|
1
|
+
{"version":3,"names":["Platform","moment","FileSystem","isFunction","includes","isUndefined","isNull","orderBy","groupBy","toLower","get","forEach","sortBy","cloneDeep","keys","values","isArray","isString","isNumber","GROUP_BY_OPTIONS","ALPHABET","WORD","OTHERS","TIME_ROLLUP_OPTIONS","HOUR","DAY","WEEK","MONTH","YEAR","_deepCopy","o1","_len","arguments","length","o2","Array","_key","o","Object","k","v","deepCopy","_len2","objects","_key2","toBoolean","val","undefined","toNumber","parseFloat","e","encodeUrl","url","splits","split","hash","params","map","p","encodeURIComponent","join","encodeURI","isWebPreviewMode","OS","isDevMode","__DEV__","widgetsWithUndefinedValue","isAndroid","test","window","navigator","userAgent","isIos","getGroupKey","fieldDef","groupby","widgetScope","innerItem","apply","proxy","getGroupedData","fieldDefs","match","orderby","dateFormat","groupKey","groupedLiData","concatStr","toString","trim","substr","replace","format","getSortedGroupedData","getOrderedDataset","dataSet","items","fields","directions","obj","item","push","_groupedData","groupkey","index","liData","key","data","_groupIndex","isDefined","unStringify","defaultVal","number","parseInt","isNaN","retryIfFails","fn","interval","maxRetries","onBeforeRetry","Promise","resolve","retryCount","tryFn","reject","errorFn","errArgs","setTimeout","then","retry","getAbortableDefer","_defer","promise","onAbort","isAborted","abort","validateField","props","value","requiredCheck","regexCheck","required","errorType","isValid","regexp","condition","RegExp","maxchars","mindate","Date","datavalue","startOf","toDate","maxdate","endOf","countDecimalDigits","numberString","decimalMatch","decimalDigits","formatCompactNumber","isNegative","formattedNumber","toFixed","toBase64","path","readAsStringAsync","encoding","DATASET_WIDGETS","Set","isDataSetWidget","widget","has","isFullPathUrl","startsWith","removeUndefinedKeys"],"sources":["utils.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport moment from \"moment\";\nimport * as FileSystem from \"expo-file-system\";\nimport { isFunction, includes, isUndefined, isNull, orderBy, groupBy, toLower, get, forEach, sortBy, cloneDeep, keys, values, isArray, isString, isNumber} from 'lodash';\n\ndeclare const window: any;\nconst GROUP_BY_OPTIONS = {\n ALPHABET: 'alphabet',\n WORD: 'word',\n OTHERS: 'Others'\n};\nconst TIME_ROLLUP_OPTIONS = {\n HOUR: 'hour',\n DAY: 'day',\n WEEK: 'week',\n MONTH: 'month',\n YEAR: 'year'\n};\n\nconst _deepCopy = (o1: any, ...o2: any) => {\n o2.forEach((o: any) => {\n if (o) {\n Object.keys(o).forEach(k => {\n const v = o[k];\n if (v && !isString(v) && !isArray(v) && typeof v === 'object') {\n o1[k] = _deepCopy(o1[k] || {}, o[k]);\n } else {\n o1[k] = _deepCopy(v);\n }\n });\n }\n });\n return o1;\n};\n\nexport const deepCopy = (...objects: any) => _deepCopy({}, ...objects);\n\nexport const toBoolean = (val: any) => {\n return val === true\n || val === 'true'\n || !(val === false\n || val === null\n || val === undefined\n || val === '');\n};\n\nexport const toNumber = (val: any) => {\n try {\n return parseFloat(val) || 0;\n } catch(e) {\n return 0;\n }\n};\n\n/**\n * this method encodes the url and returns the encoded string\n */\n export const encodeUrl = (url: string): string => {\n let splits = url.split('#');\n const hash = splits[1];\n splits = splits[0].split('?');\n let params = '';\n if (splits.length > 1) {\n params = splits[1].split('&')\n .map(p => p.split('='))\n .map(p => p[0] +'=' + encodeURIComponent(p[1]))\n .join('&');\n }\n return encodeURI(splits[0]) + (params ? '?' + params: '') + (hash ? '#'+ hash : '');\n};\n\nexport const isWebPreviewMode = () => Platform.OS === 'web';\n\nexport const isDevMode = () => isWebPreviewMode() || __DEV__;\n\nexport const widgetsWithUndefinedValue = ['checkbox', 'toggle'];\n\nexport const isAndroid = () => (Platform.OS === 'android' || (Platform.OS === 'web' && /android/i.test(window.navigator.userAgent)));\n\nexport const isIos = () => (Platform.OS === 'ios' || (Platform.OS === 'web' && /iPhone|iPad/i.test(window.navigator.userAgent)));\n\nconst getGroupKey = (fieldDef: any, groupby: string, widgetScope: any, innerItem?: any) => isFunction(groupby) ? groupby.apply(widgetScope.proxy, [innerItem ? fieldDef[innerItem] : fieldDef]) : get(innerItem ? fieldDef[innerItem] : fieldDef, groupby);\n\n/**\n * This method prepares the grouped data.\n *\n * @param fieldDefs array of objects i.e. dataset\n * @param groupby string groupby\n * @param match string match\n * @param orderby string orderby\n * @param dateFormat string date format\n */\nexport const getGroupedData = (fieldDefs: any, groupby: string, match: string, orderby: string, dateFormat: string, widgetScope: any, innerItem?: any) => {\n\n // handling case-in-sensitive scenario\n // ordering the data based on groupby field. If there is innerItem then apply orderby using the innerItem's containing the groupby field.\n fieldDefs = orderBy(fieldDefs, fieldDef => {\n const groupKey = getGroupKey(fieldDef, groupby, widgetScope, innerItem);\n if (groupKey) {\n return toLower(groupKey);\n }\n return '';\n });\n\n // extract the grouped data based on the field obtained from 'groupDataByField'.\n const groupedLiData = groupBy(fieldDefs, function (fieldDef) {\n let concatStr = getGroupKey(fieldDef, groupby, widgetScope, innerItem);\n // by default set the undefined groupKey as 'others'\n if (isUndefined(concatStr) || isNull(concatStr) || concatStr.toString().trim() === '') {\n return GROUP_BY_OPTIONS.OTHERS;\n }\n // if match prop is alphabetic ,get the starting alphabet of the word as key.\n if (match === GROUP_BY_OPTIONS.ALPHABET) {\n concatStr = concatStr.substr(0, 1);\n }\n\n // if match contains the time options then get the concatStr using 'getTimeRolledUpString'\n if (includes(values(TIME_ROLLUP_OPTIONS), match)) {\n dateFormat = dateFormat && dateFormat.replace(/d/g, 'D');\n dateFormat = dateFormat && dateFormat.replace(/y/g, 'Y');\n concatStr = moment(concatStr).format(dateFormat);\n }\n\n return concatStr;\n });\n\n return getSortedGroupedData(groupedLiData, groupby, orderby, innerItem);\n};\n\n/**\n * function to get the ordered dataset based on the given orderby\n */\nexport const getOrderedDataset = (dataSet: any, orderby: string, innerItem?: any) => {\n if (!orderBy) {\n return cloneDeep(dataSet);\n }\n\n // The order by only works when the dataset contains list of objects.\n const items = orderby && orderby.split(','),\n fields: any = [],\n directions: any = [];\n items && items.forEach( obj => {\n const item = obj.split(':');\n fields.push(innerItem ? innerItem + '.' + item[0] : item[0]);\n directions.push(item[1]);\n });\n return orderBy(dataSet, fields, directions);\n};\n\n\n/**\n * This method returns sorted data based to groupkey.\n * Returns a array of objects, each object containing key which is groupKey and data is the sorted data which is sorted by groupby field in the data.\n *\n * @param groupedLiData, grouped data object with key as the groupKey and its value as the array of objects grouped under the groupKey.\n * @param groupBy, string groupby property\n * @returns {any[]}\n */\nexport const getSortedGroupedData = (groupedLiData: any, groupBy: string, orderby: string, innerItem?: any) => {\n const _groupedData: any = [];\n forEach(keys(groupedLiData), (groupkey, index) => {\n const liData = getOrderedDataset(groupedLiData[groupkey], orderby, innerItem);\n _groupedData.push({\n key: groupkey,\n data: sortBy(liData, data => {\n data._groupIndex = index;\n return get(data, groupBy) || get(data[innerItem], groupBy);\n })\n });\n });\n return _groupedData;\n};\n\nexport const isDefined = (v: any) => typeof v !== 'undefined';\n\n// try to convert the chekedvalue and unchecked values to boolean/number\nexport const unStringify = (val: any, defaultVal?: boolean) => {\n if (val === null) {\n return defaultVal;\n }\n\n if (val === true || val === 'true') {\n return true;\n }\n\n if (val === false || val === 'false') {\n return false;\n }\n\n const number = parseInt(val, 10);\n if (!isNaN(number)) {\n return number;\n }\n return val;\n};\n\n/**\n * This function invokes the given the function (fn) until the function successfully executes or the maximum number\n * of retries is reached or onBeforeRetry returns false.\n *\n * @param fn - a function that is needs to be invoked. The function can also return a promise as well.\n * @param interval - minimum time gap between successive retries. This argument should be greater or equal to 0.\n * @param maxRetries - maximum number of retries. This argument should be greater than 0. For all other values,\n * maxRetries is infinity.\n * @param onBeforeRetry - a callback function that will be invoked before re-invoking again. This function can\n * return false or a promise that is resolved to false to stop further retry attempts.\n * @returns {*} a promise that is resolved when fn is success (or) maximum retry attempts reached\n * (or) onBeforeRetry returned false.\n */\nexport const retryIfFails = (fn: Function, interval: number, maxRetries: number, onBeforeRetry = () => Promise.resolve(false)) => {\n let retryCount = 0;\n const tryFn = () => {\n retryCount++;\n if (isFunction(fn)) {\n return fn();\n }\n };\n maxRetries = (isNumber(maxRetries) && maxRetries > 0 ? maxRetries : 0);\n interval = (isNumber(interval) && interval > 0 ? interval : 0);\n return new Promise((resolve, reject) => {\n const errorFn = function () {\n const errArgs = arguments;\n setTimeout(() => {\n Promise.resolve().then(() => onBeforeRetry()).then(function (retry) {\n if (retry !== false && (!maxRetries || retryCount <= maxRetries)) {\n Promise.resolve().then(() => tryFn()).then(resolve, errorFn);\n } else {\n reject(errArgs);\n }\n }, () => reject(errArgs));\n }, interval);\n };\n Promise.resolve().then(() => tryFn()).then(resolve, errorFn);\n });\n};\n\n/**\n * Promise of a defer created using this function, has abort function that will reject the defer when called.\n * @returns {*} angular defer object\n */\nexport const getAbortableDefer = () => {\n const _defer: any = {\n promise: null,\n reject: null,\n resolve: null,\n onAbort: () => { },\n isAborted: false\n };\n _defer.promise = new Promise((resolve, reject) => {\n _defer.resolve = resolve;\n _defer.reject = reject;\n });\n _defer.promise.abort = () => {\n _defer.onAbort && _defer.onAbort();\n _defer.reject('aborted');\n _defer.isAborted = true;\n };\n return _defer;\n};\n\nexport const validateField = (props: any, value: any) => {\n let requiredCheck = true, regexCheck = true;\n if (props.required) {\n if (isArray(value)) {\n requiredCheck = value.length === 0 ? false : true\n } else {\n requiredCheck = !value ? false : true\n }\n if (!requiredCheck) {\n return {\n errorType : 'required',\n isValid: false\n }\n }\n }\n if (value && props.regexp) {\n const condition = new RegExp(\"^\" + props.regexp + \"$\", 'g');\n regexCheck = condition.test(value);\n if (!regexCheck) {\n return {\n errorType : 'regexp',\n isValid: false\n }\n }\n }\n if (value && props.maxchars && value.length > props.maxchars) {\n return {\n errorType : 'maxchars',\n isValid: false\n }\n\n }\n if (value && props.mindate && new Date(props.datavalue) < moment(props.mindate).startOf('day').toDate()) {\n return {\n errorType : 'mindate',\n isValid: false\n }\n }\n if (value && props.maxdate && new Date(props.datavalue) > moment(props.maxdate).endOf('day').toDate()) {\n return {\n errorType : 'maxdate',\n isValid: false\n }\n }\n\n return {\n isValid: true\n }\n};\n\nexport const countDecimalDigits = (number: number | string) => {\n if (!number) return 0;\n\n // * convert the number to a string\n const numberString = number.toString();\n \n // * regular expression to match and count the decimal digits\n const decimalMatch = numberString.match(/\\.(\\d+)/);\n\n if (decimalMatch) {\n const decimalDigits = decimalMatch[1];\n return decimalDigits.length;\n } else {\n return 0; // * no decimal digits found\n }\n}\n\nexport const formatCompactNumber = (number: number) => {\n const isNegative = number < 0;\n number = isNegative ? number * -1 : number;\n let formattedNumber = number + '';\n if (number >= 1000 && number < 1_000_000) {\n formattedNumber = (number / 1000).toFixed(1).replace(/\\.0$/, \"\") + \"K\";\n } else if (number >= 1_000_000 && number < 1_000_000_000) {\n formattedNumber = (number / 1_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"M\";\n } else if (number >= 1_000_000_000 && number < 1_000_000_000_000) {\n formattedNumber = (number / 1_000_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"B\";\n } else if (number >= 1_000_000_000_000 && number < 1_000_000_000_000_000) {\n formattedNumber = (number / 1_000_000_000_000).toFixed(1).replace(/\\.0$/, \"\") + \"T\";\n }\n return (isNegative ? '-' : '') + formattedNumber;\n}\n\nexport const toBase64 = function(path: string) {\n return FileSystem.readAsStringAsync(path, { encoding: 'base64' });\n};\n\nconst DATASET_WIDGETS = new Set([ 'select', 'checkboxset', 'radioset', 'switch', 'autocomplete', 'chips', 'typeahead', 'rating']);\nexport const isDataSetWidget = (widget: any) => {\n return DATASET_WIDGETS.has(widget);\n};\nexport const isFullPathUrl = (url: string) => {\n return isString(url) &&\n (url.startsWith('data:') \n || url.startsWith('http:') \n || url.startsWith('https:') \n || url.startsWith('file:'));\n};\n\nexport function removeUndefinedKeys(obj: any) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n } else if (typeof obj[key] === 'object') {\n // * if the value is an object, recursively call the function\n removeUndefinedKeys(obj[key]);\n }\n }\n\n return obj;\n}\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,MAAM,MAAM,QAAQ;AAC3B,OAAO,KAAKC,UAAU,MAAM,kBAAkB;AAC9C,SAASC,UAAU,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,MAAM,EAAEC,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAEC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,QAAQ,QAAO,QAAQ;AAGxK,MAAMC,gBAAgB,GAAG;EACvBC,QAAQ,EAAE,UAAU;EACpBC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE;AACV,CAAC;AACD,MAAMC,mBAAmB,GAAG;EAC1BC,IAAI,EAAE,MAAM;EACZC,GAAG,EAAE,KAAK;EACVC,IAAI,EAAE,MAAM;EACZC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE;AACR,CAAC;AAED,MAAMC,SAAS,GAAG,SAAAA,CAACC,EAAO,EAAiB;EAAA,SAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAZC,EAAE,OAAAC,KAAA,CAAAJ,IAAA,OAAAA,IAAA,WAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;IAAFF,EAAE,CAAAE,IAAA,QAAAJ,SAAA,CAAAI,IAAA;EAAA;EAC7BF,EAAE,CAACvB,OAAO,CAAE0B,CAAM,IAAK;IACnB,IAAIA,CAAC,EAAE;MACHC,MAAM,CAACxB,IAAI,CAACuB,CAAC,CAAC,CAAC1B,OAAO,CAAC4B,CAAC,IAAI;QACxB,MAAMC,CAAC,GAAGH,CAAC,CAACE,CAAC,CAAC;QACd,IAAIC,CAAC,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;EAC5C,KAAK,MAAMO,GAAG,IAAIP,GAAG,EAAE;IACrB,IAAIA,GAAG,CAACO,GAAG,CAAC,KAAK3D,SAAS,EAAE;MAC1B,OAAOoD,GAAG,CAACO,GAAG,CAAC;IACjB,CAAC,MAAM,IAAI,OAAOP,GAAG,CAACO,GAAG,CAAC,KAAK,QAAQ,EAAE;MACvC;MACAoE,mBAAmB,CAAC3E,GAAG,CAACO,GAAG,CAAC,CAAC;IAC/B;EACF;EAEA,OAAOP,GAAG;AACZ"}
|
@@ -50,8 +50,33 @@ export class View extends React.Component {
|
|
50
50
|
threshold: props.threshold || 30,
|
51
51
|
bounds: {}
|
52
52
|
};
|
53
|
-
|
53
|
+
var touchStart = {
|
54
|
+
x: 0,
|
55
|
+
y: 0,
|
56
|
+
active: false
|
57
|
+
};
|
58
|
+
this.gesture.maxPointers(1).minDistance(this.state.threshold).enabled(this.props.enableGestures && !isWebPreviewMode()).onTouchesDown((e, s) => {
|
59
|
+
touchStart = {
|
60
|
+
x: e.changedTouches[0].x,
|
61
|
+
y: e.changedTouches[0].y,
|
62
|
+
active: false
|
63
|
+
};
|
64
|
+
}).onTouchesMove((e, s) => {
|
65
|
+
if (touchStart.active) {
|
66
|
+
return;
|
67
|
+
}
|
68
|
+
const translationX = e.allTouches[0].x - touchStart.x;
|
69
|
+
const translationY = e.allTouches[0].y - touchStart.y;
|
70
|
+
const d = this.state.isHorizontal ? translationX : translationY;
|
71
|
+
const od = this.state.isHorizontal ? translationY : translationX;
|
72
|
+
if (Math.abs(d) >= this.state.threshold && Math.abs(od) < Math.tan(15 * Math.PI / 180) * this.state.threshold) {
|
73
|
+
touchStart.active = true;
|
74
|
+
}
|
75
|
+
}).onChange(e => {
|
54
76
|
var _this$props$handlers, _this$props$handlers2;
|
77
|
+
if (!touchStart.active) {
|
78
|
+
return;
|
79
|
+
}
|
55
80
|
const bounds = ((_this$props$handlers = this.props.handlers) === null || _this$props$handlers === void 0 ? void 0 : _this$props$handlers.bounds) && ((_this$props$handlers2 = this.props.handlers) === null || _this$props$handlers2 === void 0 ? void 0 : _this$props$handlers2.bounds(e)) || {};
|
56
81
|
const d = this.state.isHorizontal ? e.translationX : e.translationY;
|
57
82
|
let phase = this.computePhase((bounds === null || bounds === void 0 ? void 0 : bounds.center) || 0);
|
@@ -64,6 +89,14 @@ export class View extends React.Component {
|
|
64
89
|
this.position.setValue((this.isRTL() ? -(bounds === null || bounds === void 0 ? void 0 : bounds.center) : (bounds === null || bounds === void 0 ? void 0 : bounds.center) || 0) + d);
|
65
90
|
}).onEnd(e => {
|
66
91
|
var _this$props$handlers3, _this$props$handlers4;
|
92
|
+
if (!touchStart.active) {
|
93
|
+
return;
|
94
|
+
}
|
95
|
+
touchStart = {
|
96
|
+
x: 0,
|
97
|
+
y: 0,
|
98
|
+
active: false
|
99
|
+
};
|
67
100
|
((_this$props$handlers3 = this.props.handlers) === null || _this$props$handlers3 === void 0 ? void 0 : _this$props$handlers3.onAnimation) && ((_this$props$handlers4 = this.props.handlers) === null || _this$props$handlers4 === void 0 ? void 0 : _this$props$handlers4.onAnimation(e));
|
68
101
|
if (e.translationX < 0) {
|
69
102
|
this.isRTL() ? this.goToLower(e) : this.goToUpper(e);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["isNil","React","Animated","Easing","View","RNView","Gesture","GestureDetector","isWebPreviewMode","injector","Handlers","constructor","_defineProperty","Props","undefined","State","Number","MAX_VALUE","Component","props","Pan","Value","I18nService","get","state","isHorizontal","direction","threshold","bounds","gesture","maxPointers","minDistance","enabled","enableGestures","onChange","e","_this$props$handlers","_this$props$handlers2","handlers","d","translationX","translationY","phase","computePhase","center","lower","upper","animationPhase","setValue","position","isRTL","onEnd","_this$props$handlers3","_this$props$handlers4","onAnimation","goToLower","goToUpper","computeMaxScroll","_this$viewLayout2","max","childrenWidth","childrenLayout","reduce","s","v","width","childrenHeight","height","_this$viewLayout","viewLayout","setState","maxPosition","setChildrenLayout","event","index","nativeEvent","layout","setViewLayout","value","_this$props$handlers5","_this$props$handlers6","i18nService","isRTLLocale","_this$props$handlers7","_this$props$handlers8","setPosition","then","_this$props$handlers9","_this$props$handlers10","onLower","_this$props$handlers11","_this$props$handlers12","_this$props$handlers13","_this$props$handlers14","onUpper","Promise","reject","isNaN","Math","resolve","parallel","timing","useNativeDriver","toValue","duration","easing","out","linear","start","render","createElement","style","flexDirection","flexWrap","alignItems","transform","translateX","translateY","onLayout","bind","children","map","c","i","_this$props$style","key","slideMinWidth","minWidth","slideWidth"],"sources":["swipe.animation.tsx"],"sourcesContent":["import { isNil } from 'lodash-es';\nimport React from 'react';\nimport { Animated, Easing, View as RNView, ViewStyle, LayoutChangeEvent, LayoutRectangle, DimensionValue } from 'react-native';\nimport { Gesture, GestureDetector, GestureUpdateEvent } from 'react-native-gesture-handler';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport class Handlers {\n bounds?: (g: GestureUpdateEvent<any>) => Bounds = null as any;\n onAnimation?: (g: GestureUpdateEvent<any>) => any = () => {};\n onLower?: (g: GestureUpdateEvent<any>) => any = () => {};\n onUpper?: (g: GestureUpdateEvent<any>) => any = () => {};\n computePhase?: (value: number) => number = null as any;\n}\n\nexport interface Bounds {\n upper?: number;\n center?: number;\n lower?: number;\n}\n\nexport class Props {\n threshold?: number = 30;\n direction?: 'horizontal' | 'vertical' = 'horizontal';\n handlers?: Handlers = {} as any;\n style?: ViewStyle = {} as any;\n children: any;\n enableGestures: any;\n slideWidth?: DimensionValue = '100%'; \n slideMinWidth?: DimensionValue = undefined; \n}\n\nexport class State {\n threshold = 30;\n isHorizontal = false;\n bounds: Bounds = {} as any;\n maxPosition = Number.MAX_VALUE;\n}\n\nexport class View extends React.Component<Props, State> {\n\n static defaultProps = new Props();\n\n private gesture = Gesture.Pan();\n private position = new Animated.Value(0);\n public animationPhase = new Animated.Value(0);\n private i18nService = injector.I18nService.get();\n private childrenLayout: LayoutRectangle[] = [];\n private viewLayout: LayoutRectangle = null as any;\n\n constructor(props: Props) {\n super(props);\n this.state = {\n isHorizontal: props.direction === 'horizontal',\n threshold: props.threshold || 30,\n bounds: {} as any\n } as State;\n this.gesture\n .maxPointers(1)\n .minDistance(this.state.threshold)\n .enabled(this.props.enableGestures && !isWebPreviewMode())\n .onChange(e => {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n const d = (this.state.isHorizontal ? e.translationX : e.translationY);\n let phase = this.computePhase(bounds?.center || 0);\n if (d && d < 0 && !isNil(bounds.center) && !isNil(bounds.lower)\n && bounds.center !== bounds.lower) {\n phase += (d / (bounds.center - bounds.lower)) || 0;\n } else if (d && d > 0 && !isNil(bounds.center) && !isNil(bounds.upper)\n && bounds.center !== bounds.upper) {\n phase += (d / (bounds.upper - bounds.center)) || 0;\n }\n this.animationPhase.setValue(phase);\n this.position.setValue(\n (this.isRTL()?-bounds?.center! :bounds?.center || 0) + d);\n })\n .onEnd(e => {\n this.props.handlers?.onAnimation && \n this.props.handlers?.onAnimation(e);\n if (e.translationX < 0) {\n this.isRTL()?this.goToLower(e):this.goToUpper(e);\n } else if (e.translationX > 0) {\n this.isRTL()?this.goToUpper(e):this.goToLower(e);\n }\n })\n\n }\n\n computeMaxScroll() {\n let max = Number.MAX_VALUE;\n const childrenWidth = this.childrenLayout.reduce((s, v) => s + v.width, 0);\n const childrenHeight = this.childrenLayout.reduce((s, v) => s + v.height, 0);\n if (this.props.direction === 'horizontal') {\n if (childrenWidth && this.viewLayout?.width) {\n max = childrenWidth - this.viewLayout.width;\n }\n } else if (childrenHeight && this.viewLayout?.height) {\n max = childrenHeight - this.viewLayout.height;\n }\n this.setState({maxPosition: -1 * max});\n }\n\n setChildrenLayout(event: LayoutChangeEvent, index: number) {\n this.childrenLayout[index] = event.nativeEvent.layout;\n this.computeMaxScroll();\n }\n\n setViewLayout(event: LayoutChangeEvent) {\n this.viewLayout = event.nativeEvent.layout;\n this.computeMaxScroll();\n }\n\n computePhase(value: number) {\n return (this.props.handlers?.computePhase && \n this.props.handlers?.computePhase(value)) || 0;\n }\n\n isRTL(){\n return this.i18nService.isRTLLocale();\n }\n\n goToLower(e?: any) {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n this.setPosition(bounds.lower)\n .then(() => {\n if (!isNil(bounds.lower) && bounds.center !== bounds.lower) {\n this.props.handlers?.onLower && \n this.props.handlers?.onLower(e);\n }\n });\n }\n\n goToUpper(e?: any) {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n this.setPosition(bounds.upper)\n .then(() => {\n if (!isNil(bounds.upper) && bounds.center !== bounds.upper) {\n this.props.handlers?.onUpper && \n this.props.handlers?.onUpper(e);\n }\n });\n }\n \n setPosition(value: number | undefined) {\n if (isNil(value)) {\n return Promise.reject();\n }\n let position = isNaN(this.state.maxPosition) ? value : Math.max(this.state.maxPosition, value);\n return new Promise((resolve) => {\n Animated.parallel([\n Animated.timing(this.animationPhase, {\n useNativeDriver: true,\n toValue: this.computePhase(value),\n duration: 200,\n easing: Easing.out(Easing.linear)\n }),\n Animated.timing(this.position, {\n useNativeDriver: true,\n toValue: (this.isRTL() ? -1: 1) * position,\n duration: 200,\n easing: Easing.out(Easing.linear)\n })\n ]).start(resolve);\n });\n }\n\n public render() {\n const isHorizontal = this.props.direction === 'horizontal';\n return (\n //@ts-ignore\n <GestureDetector gesture={this.gesture}>\n <Animated.View style={[\n isHorizontal ? {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'center',\n } : null,\n this.props.style, \n {\n transform: this.state.isHorizontal ? [{\n translateX: this.position\n }] : [{\n translateY: this.position\n }]\n }]} onLayout={this.setViewLayout.bind(this)}>\n {this.props.children.map((c: any, i: number) => {\n return (<RNView onLayout={(e) => this.setChildrenLayout(e, i)} key={c.key} \n style={[this.props.slideMinWidth ? {\n minWidth: this.props.slideMinWidth\n } : {\n width: this.props.slideWidth\n },\n this.props.style?.height === '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AAQ,EAAE,QAAQ;UAClBC,UAAU,EAAE;QAChB,CAAC,GAAG,IAAI,EACR,IAAI,CAAC/F,KAAK,CAAC4F,KAAK,EAChB;UACII,SAAS,EAAE,IAAI,CAAC3F,KAAK,CAACC,YAAY,GAAG,CAAC;YAClC2F,UAAU,EAAE,IAAI,CAACnE;UACrB,CAAC,CAAC,GAAG,CAAC;YACFoE,UAAU,EAAE,IAAI,CAACpE;UACrB,CAAC;QACL,CAAC,CAAE;QAACqE,QAAQ,EAAE,IAAI,CAACzC,aAAa,CAAC0C,IAAI,CAAC,IAAI;MAAE,GAC3C,IAAI,CAACpG,KAAK,CAACqG,QAAQ,CAACC,GAAG,CAAC,CAACC,CAAM,EAAEC,CAAS,KAAK;QAAA,IAAAC,iBAAA;QAC5C,oBAAQ3H,KAAA,CAAA6G,aAAA,CAACzG,MAAM;UAACiH,QAAQ,EAAGnF,CAAC,IAAK,IAAI,CAACqC,iBAAiB,CAACrC,CAAC,EAAEwF,CAAC,CAAE;UAACE,GAAG,EAAEH,CAAC,CAACG,GAAI;UACtEd,KAAK,EAAE,CAAC,IAAI,CAAC5F,KAAK,CAAC2G,aAAa,GAAG;YAC/BC,QAAQ,EAAE,IAAI,CAAC5G,KAAK,CAAC2G;UACzB,CAAC,GAAG;YACA7D,KAAK,EAAE,IAAI,CAAC9C,KAAK,CAAC6G;UACtB,CAAC,EACD,EAAAJ,iBAAA,OAAI,CAACzG,KAAK,CAAC4F,KAAK,cAAAa,iBAAA,uBAAhBA,iBAAA,CAAkBzD,MAAM,MAAK,MAAM,GAAG;YAClCA,MAAM,EAAE;UACZ,CAAC,GAAG,IAAI;QACV,GACGuD,CACG,CAAC;MACb,CAAC,CACU,CACF;IAAC;EAE1B;AAEJ;AAAC9G,eAAA,CArKYR,IAAI,kBAES,IAAIS,KAAK,CAAC,CAAC"}
|
1
|
+
{"version":3,"names":["isNil","React","Animated","Easing","View","RNView","Gesture","GestureDetector","isWebPreviewMode","injector","Handlers","constructor","_defineProperty","Props","undefined","State","Number","MAX_VALUE","Component","props","Pan","Value","I18nService","get","state","isHorizontal","direction","threshold","bounds","touchStart","x","y","active","gesture","maxPointers","minDistance","enabled","enableGestures","onTouchesDown","e","s","changedTouches","onTouchesMove","translationX","allTouches","translationY","d","od","Math","abs","tan","PI","onChange","_this$props$handlers","_this$props$handlers2","handlers","phase","computePhase","center","lower","upper","animationPhase","setValue","position","isRTL","onEnd","_this$props$handlers3","_this$props$handlers4","onAnimation","goToLower","goToUpper","computeMaxScroll","_this$viewLayout2","max","childrenWidth","childrenLayout","reduce","v","width","childrenHeight","height","_this$viewLayout","viewLayout","setState","maxPosition","setChildrenLayout","event","index","nativeEvent","layout","setViewLayout","value","_this$props$handlers5","_this$props$handlers6","i18nService","isRTLLocale","_this$props$handlers7","_this$props$handlers8","setPosition","then","_this$props$handlers9","_this$props$handlers10","onLower","_this$props$handlers11","_this$props$handlers12","_this$props$handlers13","_this$props$handlers14","onUpper","Promise","reject","isNaN","resolve","parallel","timing","useNativeDriver","toValue","duration","easing","out","linear","start","render","createElement","style","flexDirection","flexWrap","alignItems","transform","translateX","translateY","onLayout","bind","children","map","c","i","_this$props$style","key","slideMinWidth","minWidth","slideWidth"],"sources":["swipe.animation.tsx"],"sourcesContent":["import { isNil } from 'lodash-es';\nimport React from 'react';\nimport { Animated, Easing, View as RNView, ViewStyle, LayoutChangeEvent, LayoutRectangle, DimensionValue } from 'react-native';\nimport { Gesture, GestureDetector, GestureUpdateEvent } from 'react-native-gesture-handler';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\nimport injector from '@wavemaker/app-rn-runtime/core/injector';\n\nexport class Handlers {\n bounds?: (g: GestureUpdateEvent<any>) => Bounds = null as any;\n onAnimation?: (g: GestureUpdateEvent<any>) => any = () => {};\n onLower?: (g: GestureUpdateEvent<any>) => any = () => {};\n onUpper?: (g: GestureUpdateEvent<any>) => any = () => {};\n computePhase?: (value: number) => number = null as any;\n}\n\nexport interface Bounds {\n upper?: number;\n center?: number;\n lower?: number;\n}\n\nexport class Props {\n threshold?: number = 30;\n direction?: 'horizontal' | 'vertical' = 'horizontal';\n handlers?: Handlers = {} as any;\n style?: ViewStyle = {} as any;\n children: any;\n enableGestures: any;\n slideWidth?: DimensionValue = '100%'; \n slideMinWidth?: DimensionValue = undefined; \n}\n\nexport class State {\n threshold = 30;\n isHorizontal = false;\n bounds: Bounds = {} as any;\n maxPosition = Number.MAX_VALUE;\n}\n\nexport class View extends React.Component<Props, State> {\n\n static defaultProps = new Props();\n\n private gesture = Gesture.Pan();\n private position = new Animated.Value(0);\n public animationPhase = new Animated.Value(0);\n private i18nService = injector.I18nService.get();\n private childrenLayout: LayoutRectangle[] = [];\n private viewLayout: LayoutRectangle = null as any;\n\n constructor(props: Props) {\n super(props);\n this.state = {\n isHorizontal: props.direction === 'horizontal',\n threshold: props.threshold || 30,\n bounds: {} as any\n } as State;\n var touchStart = {\n x: 0,\n y: 0,\n active: false\n };\n this.gesture\n .maxPointers(1)\n .minDistance(this.state.threshold)\n .enabled(this.props.enableGestures && !isWebPreviewMode())\n .onTouchesDown((e, s) => {\n touchStart = {\n x: e.changedTouches[0].x,\n y: e.changedTouches[0].y,\n active: false\n };\n })\n .onTouchesMove((e, s) => {\n if (touchStart.active) {\n return;\n }\n const translationX = e.allTouches[0].x - touchStart.x;\n const translationY = e.allTouches[0].y - touchStart.y;\n const d = (this.state.isHorizontal ? translationX : translationY);\n const od = (this.state.isHorizontal ? translationY : translationX);\n if (Math.abs(d) >= this.state.threshold\n && Math.abs(od) < Math.tan((15 * Math.PI) / 180) * this.state.threshold) {\n touchStart.active = true;\n }\n })\n .onChange(e => {\n if (!touchStart.active) {\n return;\n }\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n const d = (this.state.isHorizontal ? e.translationX : e.translationY);\n let phase = this.computePhase(bounds?.center || 0);\n if (d && d < 0 && !isNil(bounds.center) && !isNil(bounds.lower)\n && bounds.center !== bounds.lower) {\n phase += (d / (bounds.center - bounds.lower)) || 0;\n } else if (d && d > 0 && !isNil(bounds.center) && !isNil(bounds.upper)\n && bounds.center !== bounds.upper) {\n phase += (d / (bounds.upper - bounds.center)) || 0;\n }\n this.animationPhase.setValue(phase);\n this.position.setValue(\n (this.isRTL()?-bounds?.center! :bounds?.center || 0) + d);\n })\n .onEnd(e => {\n if (!touchStart.active) {\n return;\n }\n touchStart = {\n x: 0,\n y: 0,\n active: false\n };\n this.props.handlers?.onAnimation && \n this.props.handlers?.onAnimation(e);\n if (e.translationX < 0) {\n this.isRTL()?this.goToLower(e):this.goToUpper(e);\n } else if (e.translationX > 0) {\n this.isRTL()?this.goToUpper(e):this.goToLower(e);\n }\n })\n\n }\n\n computeMaxScroll() {\n let max = Number.MAX_VALUE;\n const childrenWidth = this.childrenLayout.reduce((s, v) => s + v.width, 0);\n const childrenHeight = this.childrenLayout.reduce((s, v) => s + v.height, 0);\n if (this.props.direction === 'horizontal') {\n if (childrenWidth && this.viewLayout?.width) {\n max = childrenWidth - this.viewLayout.width;\n }\n } else if (childrenHeight && this.viewLayout?.height) {\n max = childrenHeight - this.viewLayout.height;\n }\n this.setState({maxPosition: -1 * max});\n }\n\n setChildrenLayout(event: LayoutChangeEvent, index: number) {\n this.childrenLayout[index] = event.nativeEvent.layout;\n this.computeMaxScroll();\n }\n\n setViewLayout(event: LayoutChangeEvent) {\n this.viewLayout = event.nativeEvent.layout;\n this.computeMaxScroll();\n }\n\n computePhase(value: number) {\n return (this.props.handlers?.computePhase && \n this.props.handlers?.computePhase(value)) || 0;\n }\n\n isRTL(){\n return this.i18nService.isRTLLocale();\n }\n\n goToLower(e?: any) {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n this.setPosition(bounds.lower)\n .then(() => {\n if (!isNil(bounds.lower) && bounds.center !== bounds.lower) {\n this.props.handlers?.onLower && \n this.props.handlers?.onLower(e);\n }\n });\n }\n\n goToUpper(e?: any) {\n const bounds = (this.props.handlers?.bounds && this.props.handlers?.bounds(e)) || {};\n this.setPosition(bounds.upper)\n .then(() => {\n if (!isNil(bounds.upper) && bounds.center !== bounds.upper) {\n this.props.handlers?.onUpper && \n this.props.handlers?.onUpper(e);\n }\n });\n }\n \n setPosition(value: number | undefined) {\n if (isNil(value)) {\n return Promise.reject();\n }\n let position = isNaN(this.state.maxPosition) ? value : Math.max(this.state.maxPosition, value);\n return new Promise((resolve) => {\n Animated.parallel([\n Animated.timing(this.animationPhase, {\n useNativeDriver: true,\n toValue: this.computePhase(value),\n duration: 200,\n easing: Easing.out(Easing.linear)\n }),\n Animated.timing(this.position, {\n useNativeDriver: true,\n toValue: (this.isRTL() ? -1: 1) * position,\n duration: 200,\n easing: Easing.out(Easing.linear)\n })\n ]).start(resolve);\n });\n }\n\n public render() {\n const isHorizontal = this.props.direction === 'horizontal';\n return (\n //@ts-ignore\n <GestureDetector gesture={this.gesture}>\n <Animated.View style={[\n isHorizontal ? {\n flexDirection: 'row',\n flexWrap: 'nowrap',\n alignItems: 'center',\n } : null,\n this.props.style, \n {\n transform: this.state.isHorizontal ? [{\n translateX: this.position\n }] : [{\n translateY: this.position\n }]\n }]} onLayout={this.setViewLayout.bind(this)}>\n {this.props.children.map((c: any, i: number) => {\n return (<RNView onLayout={(e) => this.setChildrenLayout(e, i)} key={c.key} \n style={[this.props.slideMinWidth ? {\n minWidth: this.props.slideMinWidth\n } : {\n width: this.props.slideWidth\n },\n this.props.style?.height === '100%' ? {\n height: '100%'\n } : null\n ]}>\n {c}\n </RNView>);\n })}\n </Animated.View>\n </GestureDetector>\n );\n }\n\n}"],"mappings":";;;AAAA,SAASA,KAAK,QAAQ,WAAW;AACjC,OAAOC,KAAK,MAAO,OAAO;AAC1B,SAASC,QAAQ,EAAEC,MAAM,EAAEC,IAAI,IAAIC,MAAM,QAAuE,cAAc;AAC9H,SAASC,OAAO,EAAEC,eAAe,QAA4B,8BAA8B;AAC3F,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,OAAOC,QA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,GAAG,CAAC;YAClCuG,UAAU,EAAE,IAAI,CAACjE;UACrB,CAAC,CAAC,GAAG,CAAC;YACFkE,UAAU,EAAE,IAAI,CAAClE;UACrB,CAAC;QACL,CAAC,CAAE;QAACmE,QAAQ,EAAE,IAAI,CAACxC,aAAa,CAACyC,IAAI,CAAC,IAAI;MAAE,GAC3C,IAAI,CAAChH,KAAK,CAACiH,QAAQ,CAACC,GAAG,CAAC,CAACC,CAAM,EAAEC,CAAS,KAAK;QAAA,IAAAC,iBAAA;QAC5C,oBAAQvI,KAAA,CAAAyH,aAAA,CAACrH,MAAM;UAAC6H,QAAQ,EAAG3F,CAAC,IAAK,IAAI,CAAC8C,iBAAiB,CAAC9C,CAAC,EAAEgG,CAAC,CAAE;UAACE,GAAG,EAAEH,CAAC,CAACG,GAAI;UACtEd,KAAK,EAAE,CAAC,IAAI,CAACxG,KAAK,CAACuH,aAAa,GAAG;YAC/BC,QAAQ,EAAE,IAAI,CAACxH,KAAK,CAACuH;UACzB,CAAC,GAAG;YACA5D,KAAK,EAAE,IAAI,CAAC3D,KAAK,CAACyH;UACtB,CAAC,EACD,EAAAJ,iBAAA,OAAI,CAACrH,KAAK,CAACwG,KAAK,cAAAa,iBAAA,uBAAhBA,iBAAA,CAAkBxD,MAAM,MAAK,MAAM,GAAG;YAClCA,MAAM,EAAE;UACZ,CAAC,GAAG,IAAI;QACV,GACGsD,CACG,CAAC;MACb,CAAC,CACU,CACF;IAAC;EAE1B;AAEJ;AAAC1H,eAAA,CAzMYR,IAAI,kBAES,IAAIS,KAAK,CAAC,CAAC"}
|
app-rn-runtime/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wavemaker/app-rn-runtime",
|
3
|
-
"version": "11.
|
3
|
+
"version": "11.7.0-next.42251",
|
4
4
|
"description": "''",
|
5
5
|
"main": "index",
|
6
6
|
"module": "index",
|
@@ -35,6 +35,9 @@
|
|
35
35
|
"url": "http://wavemaker.com/issues"
|
36
36
|
},
|
37
37
|
"homepage": "http://wavemaker.com#readme",
|
38
|
+
"publishConfig": {
|
39
|
+
"registry": "https://registry.npmjs.org/"
|
40
|
+
},
|
38
41
|
"dependencies": {
|
39
42
|
"@expo/vector-icons": "13.0.0",
|
40
43
|
"@react-native-async-storage/async-storage": "1.18.2",
|
@@ -46,11 +49,12 @@
|
|
46
49
|
"@react-navigation/native": "6.1.7",
|
47
50
|
"@react-navigation/stack": "^6.3.7",
|
48
51
|
"@types/lodash-es": "^4.17.6",
|
49
|
-
"@wavemaker/variables": "11.
|
52
|
+
"@wavemaker/variables": "11.7.0-next.42251",
|
50
53
|
"axios": "^1.4.0",
|
51
54
|
"color": "4.2.3",
|
52
55
|
"cross-env": "^5.2.0",
|
53
56
|
"css-mediaquery": "^0.1.2",
|
57
|
+
"d3-shape": "^3.2.0",
|
54
58
|
"expo-application": "^5.4.0",
|
55
59
|
"expo-font": "11.4.0",
|
56
60
|
"expo-linear-gradient": "12.3.0",
|
@@ -67,6 +71,7 @@
|
|
67
71
|
"react-native-paper-dates": "^0.8.0",
|
68
72
|
"react-native-reanimated": "3.3.0",
|
69
73
|
"react-native-screens": "3.22.0",
|
74
|
+
"react-native-size-scaling": "^0.5.1",
|
70
75
|
"react-native-snap-carousel": "3.9.1",
|
71
76
|
"react-native-svg": "13.9.0",
|
72
77
|
"react-native-web": "0.18.12",
|
@@ -125,7 +130,7 @@
|
|
125
130
|
"typescript": "^5.1.3",
|
126
131
|
"victory-native": "36.6.11",
|
127
132
|
"yargs": "^16.2.0",
|
128
|
-
"@wavemaker/variables": "11.
|
133
|
+
"@wavemaker/variables": "11.7.0-next.42251"
|
129
134
|
},
|
130
135
|
"jest": {
|
131
136
|
"preset": "react-native",
|
app-rn-runtime/runtime/App.js
CHANGED
@@ -105,6 +105,13 @@ export default class BaseApp extends React.Component {
|
|
105
105
|
_defineProperty(this, "modalsOpened", 0);
|
106
106
|
_defineProperty(this, "toastsOpened", 0);
|
107
107
|
_defineProperty(this, "watcher", Watcher.ROOT);
|
108
|
+
_defineProperty(this, "paperTheme", {
|
109
|
+
...DefaultTheme,
|
110
|
+
colors: {
|
111
|
+
...DefaultTheme.colors,
|
112
|
+
primary: ThemeVariables.INSTANCE.primaryColor
|
113
|
+
}
|
114
|
+
});
|
108
115
|
_defineProperty(this, "lib", preparePatch(() => {
|
109
116
|
this.refresh();
|
110
117
|
}));
|
@@ -158,6 +165,10 @@ export default class BaseApp extends React.Component {
|
|
158
165
|
get activePage() {
|
159
166
|
return this.appConfig.currentPage;
|
160
167
|
}
|
168
|
+
get Widgets() {
|
169
|
+
var _this$commonPartial2;
|
170
|
+
return (_this$commonPartial2 = this.commonPartial) === null || _this$commonPartial2 === void 0 ? void 0 : _this$commonPartial2.Widgets;
|
171
|
+
}
|
161
172
|
goToPage(pageName, params) {
|
162
173
|
var _this$appConfig$curre2;
|
163
174
|
return (_this$appConfig$curre2 = this.appConfig.currentPage) === null || _this$appConfig$curre2 === void 0 ? void 0 : _this$appConfig$curre2.goToPage(pageName, params);
|
@@ -418,13 +429,7 @@ export default class BaseApp extends React.Component {
|
|
418
429
|
return (_this$Variables$value = this.Variables[value]) === null || _this$Variables$value === void 0 ? void 0 : _this$Variables$value.invokeOnParamChange();
|
419
430
|
});
|
420
431
|
return /*#__PURE__*/React.createElement(SafeAreaProvider, null, /*#__PURE__*/React.createElement(PaperProvider, {
|
421
|
-
theme:
|
422
|
-
...DefaultTheme,
|
423
|
-
colors: {
|
424
|
-
...DefaultTheme.colors,
|
425
|
-
primary: ThemeVariables.INSTANCE.primaryColor
|
426
|
-
}
|
427
|
-
}
|
432
|
+
theme: this.paperTheme
|
428
433
|
}, /*#__PURE__*/React.createElement(React.Fragment, null, Platform.OS === 'web' ? this.renderIconsViewSupportForWeb() : null, /*#__PURE__*/React.createElement(SafeAreaInsetsContext.Consumer, null, function () {
|
429
434
|
var _this2$props, _this2$appConfig$draw, _this2$appConfig$draw2;
|
430
435
|
let insets = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|