@wavemaker/app-rn-runtime 11.4.0-next.141708 → 11.4.0-next.24560
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/notification-action.js +5 -4
- app-rn-runtime/actions/notification-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-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.component.js +1 -1
- app-rn-runtime/components/advanced/carousel/carousel.component.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/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/webview/webview.component.js +1 -1
- app-rn-runtime/components/advanced/webview/webview.component.js.map +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js +1 -1
- app-rn-runtime/components/basic/anchor/anchor.component.js.map +1 -1
- 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/buttongroup/buttongroup.component.js +1 -1
- app-rn-runtime/components/basic/buttongroup/buttongroup.component.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/label/label.component.js +1 -1
- app-rn-runtime/components/basic/label/label.component.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/picture/picture.component.js +37 -26
- app-rn-runtime/components/basic/picture/picture.component.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-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/search/search.component.js +4 -1
- app-rn-runtime/components/basic/search/search.component.js.map +1 -1
- app-rn-runtime/components/basic/spinner/spinner.component.js +10 -10
- app-rn-runtime/components/basic/spinner/spinner.component.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/container/accordion/accordion.component.js +1 -1
- app-rn-runtime/components/container/accordion/accordion.component.js.map +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.js +1 -1
- app-rn-runtime/components/container/accordion/accordionpane/accordionpane.component.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/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/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/layoutgrid.component.js +1 -1
- app-rn-runtime/components/container/layoutgrid/layoutgrid.component.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/linearlayoutitem/linearlayoutitem.component.js +1 -1
- app-rn-runtime/components/container/linearlayout/linearlayoutitem/linearlayoutitem.component.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-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.component.js +1 -1
- app-rn-runtime/components/container/panel/panel.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js +12 -4
- app-rn-runtime/components/container/tabs/tabheader/tabheader.component.js.map +1 -1
- app-rn-runtime/components/container/tabs/tabheader/tabheader.styles.js +2 -1
- 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/tabs.component.js +80 -64
- 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 +1 -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/wizard/wizard.component.js +1 -1
- app-rn-runtime/components/container/wizard/wizard.component.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/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-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.component.js +1 -1
- app-rn-runtime/components/data/card/card.component.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-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-field/form-field.component.js +1 -1
- app-rn-runtime/components/data/form/form-field/form-field.component.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.component.js +2 -31
- app-rn-runtime/components/data/form/form.component.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.component.js +17 -8
- app-rn-runtime/components/data/list/list.component.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/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/dialog/dialog.component.js +1 -1
- app-rn-runtime/components/dialogs/dialog/dialog.component.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/dialogcontent/dialogcontent.component.js +1 -1
- app-rn-runtime/components/dialogs/dialogcontent/dialogcontent.component.js.map +1 -1
- app-rn-runtime/components/input/baseinput/baseinput.component.js +7 -0
- app-rn-runtime/components/input/baseinput/baseinput.component.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/checkbox/checkbox.component.js +1 -16
- app-rn-runtime/components/input/checkbox/checkbox.component.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/composite/composite.component.js +1 -1
- app-rn-runtime/components/input/composite/composite.component.js.map +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.js +1 -1
- app-rn-runtime/components/input/epoch/base-datetime.component.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/number/number.component.js +0 -9
- app-rn-runtime/components/input/number/number.component.js.map +1 -1
- app-rn-runtime/components/input/radioset/radioset.component.js +0 -40
- app-rn-runtime/components/input/radioset/radioset.component.js.map +1 -1
- app-rn-runtime/components/input/rating/rating.component.js +1 -1
- app-rn-runtime/components/input/rating/rating.component.js.map +1 -1
- app-rn-runtime/components/input/slider/slider.component.js +1 -1
- app-rn-runtime/components/input/slider/slider.component.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.styles.js +7 -7
- app-rn-runtime/components/input/switch/switch.styles.js.map +1 -1
- app-rn-runtime/components/input/text/text.component.js +1 -10
- app-rn-runtime/components/input/text/text.component.js.map +1 -1
- app-rn-runtime/components/input/textarea/textarea.component.js +0 -10
- app-rn-runtime/components/input/textarea/textarea.component.js.map +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.js +1 -1
- app-rn-runtime/components/input/toggle/toggle.component.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/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/navbar/navbar.component.js +2 -0
- app-rn-runtime/components/navigation/navbar/navbar.component.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/popover/popover.component.js +1 -1
- app-rn-runtime/components/navigation/popover/popover.component.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/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.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.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/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 +113 -41
- app-rn-runtime/core/base.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 +15 -1
- app-rn-runtime/core/injector.js.map +1 -1
- app-rn-runtime/core/tappable.component.js +9 -2
- app-rn-runtime/core/tappable.component.js.map +1 -1
- app-rn-runtime/core/utils.js +6 -0
- app-rn-runtime/core/utils.js.map +1 -1
- app-rn-runtime/gestures/swipe.animation.js +105 -0
- app-rn-runtime/gestures/swipe.animation.js.map +1 -0
- app-rn-runtime/package.json +33 -32
- app-rn-runtime/runtime/App.js +24 -16
- app-rn-runtime/runtime/App.js.map +1 -1
- app-rn-runtime/runtime/App.navigator.js +2 -12
- app-rn-runtime/runtime/App.navigator.js.map +1 -1
- app-rn-runtime/runtime/base-fragment.component.js +6 -4
- app-rn-runtime/runtime/base-fragment.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-security.service.js.map +1 -1
- app-rn-runtime/runtime/services/app-spinner.service.js +5 -1
- 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/camera-service.js +28 -6
- app-rn-runtime/runtime/services/device/camera-service.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/styles/background.component.js +259 -0
- app-rn-runtime/styles/background.component.js.map +1 -0
- app-rn-runtime/styles/style-prop.validator.js +38 -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 +6 -37
- app-rn-runtime/styles/theme.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/file/upload-file.operation.js +43 -21
- app-rn-runtime/variables/device/file/upload-file.operation.js.map +1 -1
- app-rn-runtime/variables/http.service.js +12 -14
- app-rn-runtime/variables/http.service.js.map +1 -1
- app-rn-runtime/variables/live-variable.js +96 -0
- app-rn-runtime/variables/live-variable.js.map +1 -0
- app-rn-runtime/variables/service-variable.js +19 -8
- app-rn-runtime/variables/service-variable.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["map","Map","get","t","set","o"],"sources":["injector.ts"],"sourcesContent":["const map = new Map<string, any>();\n\nconst get = <T>(t :string): T => {\n return map.get(t) as T;\n};\n\nconst set = <T>(t :string, o: T) => {\n map.set(t, o);\n};\n\nexport default {\n set: set,\n get: get\n};"],"mappings":"AAAA,MAAMA,GAAG,GAAG,IAAIC,GAAG,EAAe;AAElC,MAAMC,GAAG,GAAOC,CAAS,IAAQ;EAC7B,OAAOH,GAAG,CAACE,GAAG,CAACC,CAAC,CAAC;AACrB,CAAC;AAED,MAAMC,GAAG,GAAG,CAAID,CAAS,EAAEE,CAAI,KAAK;EAChCL,GAAG,CAACI,GAAG,CAACD,CAAC,EAAEE,CAAC,CAAC;AACjB,CAAC;AAED,eAAe;
|
|
1
|
+
{"version":3,"names":["map","Map","get","t","set","o","remove","v","delete","getInstance","key","FOCUSED_ELEMENT"],"sources":["injector.ts"],"sourcesContent":["const map = new Map<string, any>();\n\nconst get = <T>(t :string): T => {\n return map.get(t) as T;\n};\n\nconst set = <T>(t :string, o: T) => {\n map.set(t, o);\n};\n\nconst remove = <T>(t :string): T => {\n const v = map.get(t) as T;\n v && map.delete(t);\n return v;\n};\n\nconst getInstance = <T>(key: string) => {\n return {\n set: (o: T) => set(key, o),\n get: () => get(key) as T,\n remove: () => remove(key) as T\n }\n};\nexport default {\n set: set,\n get: get,\n remove: remove,\n FOCUSED_ELEMENT: getInstance<any>('FOCUSED_ELEMENT')\n};"],"mappings":"AAAA,MAAMA,GAAG,GAAG,IAAIC,GAAG,EAAe;AAElC,MAAMC,GAAG,GAAOC,CAAS,IAAQ;EAC7B,OAAOH,GAAG,CAACE,GAAG,CAACC,CAAC,CAAC;AACrB,CAAC;AAED,MAAMC,GAAG,GAAG,CAAID,CAAS,EAAEE,CAAI,KAAK;EAChCL,GAAG,CAACI,GAAG,CAACD,CAAC,EAAEE,CAAC,CAAC;AACjB,CAAC;AAED,MAAMC,MAAM,GAAQH,CAAS,IAAQ;EACjC,MAAMI,CAAC,GAAGP,GAAG,CAACE,GAAG,CAACC,CAAC,CAAM;EACzBI,CAAC,IAAIP,GAAG,CAACQ,MAAM,CAACL,CAAC,CAAC;EAClB,OAAOI,CAAC;AACZ,CAAC;AAED,MAAME,WAAW,GAAOC,GAAW,IAAK;EACpC,OAAO;IACHN,GAAG,EAAGC,CAAI,IAAKD,GAAG,CAACM,GAAG,EAAEL,CAAC,CAAC;IAC1BH,GAAG,EAAE,MAAMA,GAAG,CAACQ,GAAG,CAAM;IACxBJ,MAAM,EAAE,MAAMA,MAAM,CAACI,GAAG;EAC5B,CAAC;AACL,CAAC;AACD,eAAe;EACXN,GAAG,EAAEA,GAAG;EACRF,GAAG,EAAEA,GAAG;EACRI,MAAM,EAAEA,MAAM;EACdK,eAAe,EAAEF,WAAW,CAAM,iBAAiB;AACvD,CAAC"}
|
|
@@ -5,6 +5,7 @@ import React from "react";
|
|
|
5
5
|
import { View } from "react-native";
|
|
6
6
|
import { TouchableOpacity } from "react-native";
|
|
7
7
|
import { get } from "lodash";
|
|
8
|
+
import injector from "./injector";
|
|
8
9
|
export class TapEvent {
|
|
9
10
|
constructor() {
|
|
10
11
|
_defineProperty(this, "propagationEnabled", true);
|
|
@@ -30,12 +31,18 @@ export class Tappable extends React.Component {
|
|
|
30
31
|
}
|
|
31
32
|
const syntheticEvent = Tappable.CURRENT_EVENT;
|
|
32
33
|
if (syntheticEvent.propagationEnabled) {
|
|
34
|
+
var _injector$FOCUSED_ELE;
|
|
35
|
+
(_injector$FOCUSED_ELE = injector.FOCUSED_ELEMENT.get()) === null || _injector$FOCUSED_ELE === void 0 ? void 0 : _injector$FOCUSED_ELE.blur();
|
|
33
36
|
if (delta < 500) {
|
|
34
37
|
this.props.onDoubleTap && this.props.onDoubleTap(e);
|
|
35
|
-
|
|
38
|
+
setTimeout(() => {
|
|
39
|
+
target === null || target === void 0 ? void 0 : target.invokeEventCallback('onDoubletap', [syntheticEvent, target]);
|
|
40
|
+
}, 200);
|
|
36
41
|
}
|
|
37
42
|
this.props.onTap && this.props.onTap(e || syntheticEvent);
|
|
38
|
-
|
|
43
|
+
setTimeout(() => {
|
|
44
|
+
target === null || target === void 0 ? void 0 : target.invokeEventCallback('onTap', [syntheticEvent, target]);
|
|
45
|
+
}, 200);
|
|
39
46
|
}
|
|
40
47
|
}
|
|
41
48
|
render() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","TouchableOpacity","get","TapEvent","constructor","stopPropagation","propagationEnabled","Tappable","Component","props","onPress","e","delta","Date","getTime","lastPress","target","CURRENT_EVENT","setTimeout","syntheticEvent","onDoubleTap","invokeEventCallback","onTap","render","onDoubletap","proxy","styles","children"],"sources":["tappable.component.tsx"],"sourcesContent":["import { BaseComponent } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport React from \"react\";\nimport { GestureResponderEvent, View } from \"react-native\";\nimport { TouchableOpacity } from \"react-native\";\nimport { get } from \"lodash\";\n\ninterface TappableProps {\n children?: any\n styles?: any;\n target?: BaseComponent<any, any, any>;\n onTap?: (e: any) => void;\n onDoubleTap?: (e: any) => void;\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\n static CURRENT_EVENT: TapEvent = null as any;\n\n constructor(props: any) {\n super(props);\n }\n\n onPress(e?: GestureResponderEvent): void {\n const delta = new Date().getTime() - this.lastPress;\n this.lastPress = this.lastPress > 0 ? 0: new Date().getTime();\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 if (syntheticEvent.propagationEnabled) {\n if(delta < 500) {\n this.props.onDoubleTap && this.props.onDoubleTap(e);\n target?.invokeEventCallback('onDoubletap', [syntheticEvent, target]);\n }\n this.props.onTap && this.props.onTap(e || syntheticEvent);\n target?.invokeEventCallback('onTap', [syntheticEvent, target]);\n }\n }\n\n render() {\n const target = this.props.target;\n if (target?.props.onTap || target?.props.onDoubletap || this.props.onTap || this.props.onDoubleTap) {\n return (\n <TouchableOpacity disabled={get(target?.proxy, 'disabled')}\n style={this.props.styles}\n onPress={() => this.onPress()}>\n {this.props.children}\n </TouchableOpacity>\n );\n }\n return (<View style={this.props.styles}>{this.props.children}</View>);\n }\n}\n"],"mappings":";;;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAgCC,IAAI,QAAQ,cAAc;AAC1D,SAASC,gBAAgB,QAAQ,cAAc;AAC/C,SAASC,GAAG,QAAQ,QAAQ;
|
|
1
|
+
{"version":3,"names":["React","View","TouchableOpacity","get","injector","TapEvent","constructor","stopPropagation","propagationEnabled","Tappable","Component","props","onPress","e","delta","Date","getTime","lastPress","target","CURRENT_EVENT","setTimeout","syntheticEvent","FOCUSED_ELEMENT","blur","onDoubleTap","invokeEventCallback","onTap","render","onDoubletap","proxy","styles","children"],"sources":["tappable.component.tsx"],"sourcesContent":["import { BaseComponent } from \"@wavemaker/app-rn-runtime/core/base.component\";\nimport React from \"react\";\nimport { GestureResponderEvent, View } from \"react-native\";\nimport { TouchableOpacity } from \"react-native\";\nimport { get } from \"lodash\";\nimport injector from \"./injector\";\n\ninterface TappableProps {\n children?: any\n styles?: any;\n target?: BaseComponent<any, any, any>;\n onTap?: (e: any) => void;\n onDoubleTap?: (e: any) => void;\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\n static CURRENT_EVENT: TapEvent = null as any;\n\n constructor(props: any) {\n super(props);\n }\n\n onPress(e?: GestureResponderEvent): void {\n const delta = new Date().getTime() - this.lastPress;\n this.lastPress = this.lastPress > 0 ? 0: new Date().getTime();\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 if (syntheticEvent.propagationEnabled) {\n injector.FOCUSED_ELEMENT.get()?.blur();\n if(delta < 500) {\n this.props.onDoubleTap && this.props.onDoubleTap(e);\n setTimeout(() => {\n target?.invokeEventCallback('onDoubletap', [syntheticEvent, target]);\n }, 200);\n }\n this.props.onTap && this.props.onTap(e || syntheticEvent);\n setTimeout(() => {\n target?.invokeEventCallback('onTap', [syntheticEvent, target]);\n }, 200);\n }\n }\n\n render() {\n const target = this.props.target;\n if (target?.props.onTap || target?.props.onDoubletap || this.props.onTap || this.props.onDoubleTap) {\n return (\n <TouchableOpacity disabled={get(target?.proxy, 'disabled')}\n style={this.props.styles}\n onPress={() => this.onPress()}>\n {this.props.children}\n </TouchableOpacity>\n );\n }\n return (<View style={this.props.styles}>{this.props.children}</View>);\n }\n}\n"],"mappings":";;;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAgCC,IAAI,QAAQ,cAAc;AAC1D,SAASC,gBAAgB,QAAQ,cAAc;AAC/C,SAASC,GAAG,QAAQ,QAAQ;AAC5B,OAAOC,QAAQ,MAAM,YAAY;AAUjC,OAAO,MAAMC,QAAQ,CAAC;EAGlBC,WAAW,GAAG;IAAA,4CAFO,IAAI;EAIzB;EAEAC,eAAe,GAAG;IACd,IAAI,CAACC,kBAAkB,GAAG,KAAK;EACnC;AACJ;AAEA,OAAO,MAAMC,QAAQ,SAAST,KAAK,CAACU,SAAS,CAAqB;EAK9DJ,WAAW,CAACK,KAAU,EAAE;IACpB,KAAK,CAACA,KAAK,CAAC;IAAC,mCALG,CAAC;EAMrB;EAEAC,OAAO,CAACC,CAAyB,EAAQ;IACrC,MAAMC,KAAK,GAAG,IAAIC,IAAI,EAAE,CAACC,OAAO,EAAE,GAAG,IAAI,CAACC,SAAS;IACnD,IAAI,CAACA,SAAS,GAAG,IAAI,CAACA,SAAS,GAAG,CAAC,GAAG,CAAC,GAAE,IAAIF,IAAI,EAAE,CAACC,OAAO,EAAE;IAC7D,MAAME,MAAM,GAAG,IAAI,CAACP,KAAK,CAACO,MAAM;IAChC,IAAI,CAACT,QAAQ,CAACU,aAAa,EAAE;MACzBV,QAAQ,CAACU,aAAa,GAAG,IAAId,QAAQ,EAAE;MACvCe,UAAU,CAAC,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U,CAAE;QACvD,KAAK,EAAE,IAAI,CAAClB,KAAK,CAACmB,MAAO;QACzB,OAAO,EAAE,MAAM,IAAI,CAAClB,OAAO;MAAG,GAC7B,IAAI,CAACD,KAAK,CAACoB,QAAQ,CACL;IAE3B;IACA,oBAAQ,oBAAC,IAAI;MAAC,KAAK,EAAE,IAAI,CAACpB,KAAK,CAACmB;IAAO,GAAE,IAAI,CAACnB,KAAK,CAACoB,QAAQ,CAAQ;EACxE;AACJ;AAAC,gBAhDYtB,QAAQ,mBAGgB,IAAI"}
|
app-rn-runtime/core/utils.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
2
|
import moment from "moment";
|
|
3
|
+
import * as FileSystem from "expo-file-system";
|
|
3
4
|
import { isFunction, includes, isUndefined, isNull, orderBy, groupBy, toLower, get, forEach, sortBy, cloneDeep, keys, values, isArray, isString, isNumber } from 'lodash';
|
|
4
5
|
const GROUP_BY_OPTIONS = {
|
|
5
6
|
ALPHABET: 'alphabet',
|
|
@@ -285,4 +286,9 @@ export const validateField = (props, value) => {
|
|
|
285
286
|
isValid: true
|
|
286
287
|
};
|
|
287
288
|
};
|
|
289
|
+
export const toBase64 = function (path) {
|
|
290
|
+
return FileSystem.readAsStringAsync(path, {
|
|
291
|
+
encoding: 'base64'
|
|
292
|
+
});
|
|
293
|
+
};
|
|
288
294
|
//# sourceMappingURL=utils.js.map
|
app-rn-runtime/core/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","moment","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","o2","o","Object","k","v","deepCopy","objects","toBoolean","val","undefined","toNumber","parseFloat","e","encodeUrl","url","splits","split","hash","params","length","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","arguments","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"],"sources":["utils.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport moment from \"moment\";\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"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,MAAM,MAAM,QAAQ;AAC3B,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,EAA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,OAAO;MACLV,SAAS,EAAG,SAAS;MACrBC,OAAO,EAAE;IACX,CAAC;EACH;EAEA,OAAO;IACLA,OAAO,EAAE;EACX,CAAC;AACH,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","o2","o","Object","k","v","deepCopy","objects","toBoolean","val","undefined","toNumber","parseFloat","e","encodeUrl","url","splits","split","hash","params","length","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","arguments","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","toBase64","path","readAsStringAsync","encoding"],"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\n\nexport const toBase64 = function(path: string) {\n return FileSystem.readAsStringAsync(path, { encoding: 'base64' });\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MAAM,GAAGkF,KAAK,CAACU,QAAQ,EAAE;IAC5D,OAAO;MACLL,SAAS,EAAG,UAAU;MACtBC,OAAO,EAAE;IACX,CAAC;EAEH;EACA,IAAIL,KAAK,IAAID,KAAK,CAACW,OAAO,IAAI,IAAIC,IAAI,CAACZ,KAAK,CAACa,SAAS,CAAC,GAAGhJ,MAAM,CAACmI,KAAK,CAACW,OAAO,CAAC,CAACG,OAAO,CAAC,KAAK,CAAC,CAACC,MAAM,EAAE,EAAE;IACvG,OAAO;MACLV,SAAS,EAAG,SAAS;MACrBC,OAAO,EAAE;IACX,CAAC;EACH;EACA,IAAIL,KAAK,IAAID,KAAK,CAACgB,OAAO,IAAI,IAAIJ,IAAI,CAACZ,KAAK,CAACa,SAAS,CAAC,GAAGhJ,MAAM,CAACmI,KAAK,CAACgB,OAAO,CAAC,CAACC,KAAK,CAAC,KAAK,CAAC,CAACF,MAAM,EAAE,EAAE;IACrG,OAAO;MACLV,SAAS,EAAG,SAAS;MACrBC,OAAO,EAAE;IACX,CAAC;EACH;EAEA,OAAO;IACLA,OAAO,EAAE;EACX,CAAC;AACH,CAAC;AAGD,OAAO,MAAMY,QAAQ,GAAG,UAASC,IAAY,EAAE;EAC7C,OAAOrJ,UAAU,CAACsJ,iBAAiB,CAACD,IAAI,EAAE;IAAEE,QAAQ,EAAE;EAAS,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
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 { isNil } from 'lodash-es';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Animated, Easing } from 'react-native';
|
|
7
|
+
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
8
|
+
import { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';
|
|
9
|
+
export class Handlers {
|
|
10
|
+
constructor() {
|
|
11
|
+
_defineProperty(this, "bounds", null);
|
|
12
|
+
_defineProperty(this, "onAnimation", () => {});
|
|
13
|
+
_defineProperty(this, "onLower", () => {});
|
|
14
|
+
_defineProperty(this, "onUpper", () => {});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export class Props {
|
|
18
|
+
constructor() {
|
|
19
|
+
_defineProperty(this, "threshold", 30);
|
|
20
|
+
_defineProperty(this, "direction", 'horizontal');
|
|
21
|
+
_defineProperty(this, "handlers", {});
|
|
22
|
+
_defineProperty(this, "style", {});
|
|
23
|
+
_defineProperty(this, "children", void 0);
|
|
24
|
+
_defineProperty(this, "enableGestures", void 0);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export class State {
|
|
28
|
+
constructor() {
|
|
29
|
+
_defineProperty(this, "threshold", 30);
|
|
30
|
+
_defineProperty(this, "isHorizontal", false);
|
|
31
|
+
_defineProperty(this, "bounds", {});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export class View extends React.Component {
|
|
35
|
+
constructor(props) {
|
|
36
|
+
super(props);
|
|
37
|
+
_defineProperty(this, "gesture", Gesture.Pan());
|
|
38
|
+
_defineProperty(this, "position", new Animated.Value(0));
|
|
39
|
+
this.state = {
|
|
40
|
+
isHorizontal: props.direction === 'horizontal',
|
|
41
|
+
threshold: props.threshold || 30,
|
|
42
|
+
bounds: {}
|
|
43
|
+
};
|
|
44
|
+
this.gesture.maxPointers(1).minDistance(this.state.threshold).enabled(this.props.enableGestures && !isWebPreviewMode()).onChange(e => {
|
|
45
|
+
var _this$props$handlers, _this$props$handlers2;
|
|
46
|
+
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)) || {};
|
|
47
|
+
this.position.setValue(((bounds === null || bounds === void 0 ? void 0 : bounds.center) || 0) + (this.state.isHorizontal ? e.translationX : e.translationY));
|
|
48
|
+
}).onEnd(e => {
|
|
49
|
+
var _this$props$handlers3, _this$props$handlers4;
|
|
50
|
+
((_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));
|
|
51
|
+
if (e.translationX < 0) {
|
|
52
|
+
this.goToUpper(e);
|
|
53
|
+
} else if (e.translationX > 0) {
|
|
54
|
+
this.goToLower(e);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
goToLower(e) {
|
|
59
|
+
var _this$props$handlers5, _this$props$handlers6;
|
|
60
|
+
const bounds = ((_this$props$handlers5 = this.props.handlers) === null || _this$props$handlers5 === void 0 ? void 0 : _this$props$handlers5.bounds) && ((_this$props$handlers6 = this.props.handlers) === null || _this$props$handlers6 === void 0 ? void 0 : _this$props$handlers6.bounds(e)) || {};
|
|
61
|
+
this.setPosition(bounds.lower).then(() => {
|
|
62
|
+
var _this$props$handlers7, _this$props$handlers8;
|
|
63
|
+
((_this$props$handlers7 = this.props.handlers) === null || _this$props$handlers7 === void 0 ? void 0 : _this$props$handlers7.onLower) && ((_this$props$handlers8 = this.props.handlers) === null || _this$props$handlers8 === void 0 ? void 0 : _this$props$handlers8.onLower(e));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
goToUpper(e) {
|
|
67
|
+
var _this$props$handlers9, _this$props$handlers10;
|
|
68
|
+
const bounds = ((_this$props$handlers9 = this.props.handlers) === null || _this$props$handlers9 === void 0 ? void 0 : _this$props$handlers9.bounds) && ((_this$props$handlers10 = this.props.handlers) === null || _this$props$handlers10 === void 0 ? void 0 : _this$props$handlers10.bounds(e)) || {};
|
|
69
|
+
this.setPosition(bounds.upper).then(() => {
|
|
70
|
+
var _this$props$handlers11, _this$props$handlers12;
|
|
71
|
+
((_this$props$handlers11 = this.props.handlers) === null || _this$props$handlers11 === void 0 ? void 0 : _this$props$handlers11.onUpper) && ((_this$props$handlers12 = this.props.handlers) === null || _this$props$handlers12 === void 0 ? void 0 : _this$props$handlers12.onUpper(e));
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
setPosition(value) {
|
|
75
|
+
if (isNil(value)) {
|
|
76
|
+
return Promise.reject();
|
|
77
|
+
}
|
|
78
|
+
return new Promise(resolve => {
|
|
79
|
+
Animated.timing(this.position, {
|
|
80
|
+
useNativeDriver: true,
|
|
81
|
+
toValue: value,
|
|
82
|
+
duration: 200,
|
|
83
|
+
easing: Easing.out(Easing.linear)
|
|
84
|
+
}).start(resolve);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
render() {
|
|
88
|
+
return (
|
|
89
|
+
/*#__PURE__*/
|
|
90
|
+
//@ts-ignore
|
|
91
|
+
React.createElement(GestureDetector, {
|
|
92
|
+
gesture: this.gesture
|
|
93
|
+
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
94
|
+
style: [this.props.style, {
|
|
95
|
+
transform: this.state.isHorizontal ? [{
|
|
96
|
+
translateX: this.position
|
|
97
|
+
}] : [{
|
|
98
|
+
translateY: this.position
|
|
99
|
+
}]
|
|
100
|
+
}]
|
|
101
|
+
}, this.props.children))
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=swipe.animation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isNil","React","Animated","Easing","Gesture","GestureDetector","isWebPreviewMode","Handlers","Props","State","View","Component","constructor","props","Pan","Value","state","isHorizontal","direction","threshold","bounds","gesture","maxPointers","minDistance","enabled","enableGestures","onChange","e","handlers","position","setValue","center","translationX","translationY","onEnd","onAnimation","goToUpper","goToLower","setPosition","lower","then","onLower","upper","onUpper","value","Promise","reject","resolve","timing","useNativeDriver","toValue","duration","easing","out","linear","start","render","style","transform","translateX","translateY","children"],"sources":["swipe.animation.tsx"],"sourcesContent":["import { isNil } from 'lodash-es';\nimport React from 'react';\nimport { Animated, Easing, ViewStyle } from 'react-native';\nimport { Gesture, GestureDetector, GestureUpdateEvent } from 'react-native-gesture-handler';\nimport { isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';\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}\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}\n\nexport class State {\n threshold = 30;\n isHorizontal = false;\n bounds: Bounds = {} as any;\n}\n\nexport class View extends React.Component<Props, State> {\n\n private gesture = Gesture.Pan();\n private position = new Animated.Value(0);\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 this.position.setValue(\n (bounds?.center || 0) +\n (this.state.isHorizontal ? e.translationX : e.translationY));\n })\n .onEnd(e => {\n this.props.handlers?.onAnimation && \n this.props.handlers?.onAnimation(e);\n if (e.translationX < 0) {\n this.goToUpper(e);\n } else if (e.translationX > 0) {\n this.goToLower(e);\n }\n })\n\n }\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 this.props.handlers?.onLower && \n this.props.handlers?.onLower(e);\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 this.props.handlers?.onUpper && \n this.props.handlers?.onUpper(e);\n });\n }\n \n setPosition(value: number | undefined) {\n if (isNil(value)) {\n return Promise.reject();\n }\n return new Promise((resolve) => {\n Animated.timing(this.position, {\n useNativeDriver: true,\n toValue: value,\n duration: 200,\n easing: Easing.out(Easing.linear)\n }).start(resolve);\n });\n }\n\n public render() {\n return (\n //@ts-ignore\n <GestureDetector gesture={this.gesture}>\n <Animated.View style={[\n this.props.style, \n {\n transform: this.state.isHorizontal ? [{\n translateX: this.position\n }] : [{\n translateY: this.position\n }]\n }]}>\n {this.props.children}\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,QAAmB,cAAc;AAC1D,SAASC,OAAO,EAAEC,eAAe,QAA4B,8BAA8B;AAC3F,SAASC,gBAAgB,QAAQ,sCAAsC;AAEvE,OAAO,MAAMC,QAAQ,CAAC;EAAA;IAAA,gCACgC,IAAI;IAAA,qCACF,MAAM,CAAC,CAAC;IAAA,iCACX,MAAM,CAAC,CAAC;IAAA,iCACR,MAAM,CAAC,CAAC;EAAA;AAC7D;AAQA,OAAO,MAAMC,KAAK,CAAC;EAAA;IAAA,mCACM,EAAE;IAAA,mCACiB,YAAY;IAAA,kCAC9B,CAAC,CAAC;IAAA,+BACJ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,2DAAnB,uBAAqBe,OAAO,CAAChB,CAAC,CAAC;IACnC,CAAC,CAAC;EACV;EAEAW,WAAW,CAACM,KAAyB,EAAE;IACnC,IAAI5C,KAAK,CAAC4C,KAAK,CAAC,EAAE;MACd,OAAOC,OAAO,CAACC,MAAM,EAAE;IAC3B;IACA,OAAO,IAAID,OAAO,CAAEE,OAAO,IAAK;MAC5B7C,QAAQ,CAAC8C,MAAM,CAAC,IAAI,CAACnB,QAAQ,EAAE;QAC3BoB,eAAe,EAAE,IAAI;QACrBC,OAAO,EAAGN,KAAK;QACfO,QAAQ,EAAE,GAAG;QACbC,MAAM,EAAEjD,MAAM,CAACkD,GAAG,CAAClD,MAAM,CAACmD,MAAM;MACpC,CAAC,CAAC,CAACC,KAAK,CAACR,OAAO,CAAC;IACrB,CAAC,CAAC;EACN;EAEOS,MAAM,GAAG;IACZ;MAAA;MACI;MACA,oBAAC,eAAe;QAAC,OAAO,EAAE,IAAI,CAACnC;MAAQ,gBACnC,oBAAC,QAAQ,CAAC,IAAI;QAAC,KAAK,EAAE,CAClB,IAAI,CAACR,KAAK,CAAC4C,KAAK,EAChB;UACIC,SAAS,EAAE,IAAI,CAAC1C,KAAK,CAACC,YAAY,GAAG,CAAC;YAClC0C,UAAU,EAAE,IAAI,CAAC9B;UACrB,CAAC,CAAC,GAAG,CAAC;YACF+B,UAAU,EAAE,IAAI,CAAC/B;UACrB,CAAC;QACL,CAAC;MAAE,GACF,IAAI,CAAChB,KAAK,CAACgD,QAAQ,CACR;IACF;EAE1B;AAEJ"}
|
app-rn-runtime/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavemaker/app-rn-runtime",
|
|
3
|
-
"version": "11.4.0-next.
|
|
3
|
+
"version": "11.4.0-next.24560",
|
|
4
4
|
"description": "''",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"module": "index",
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
"example": "yarn --cwd example",
|
|
22
22
|
"pods": "cd example && pod-install --quiet",
|
|
23
23
|
"bootstrap": "yarn example && yarn && yarn pods",
|
|
24
|
-
"watch": "npm-watch build"
|
|
25
|
-
"publish-patch": "npm run build -- --production=true && node scripts/npm-publish.js"
|
|
24
|
+
"watch": "npm-watch build"
|
|
26
25
|
},
|
|
27
26
|
"keywords": [
|
|
28
27
|
"react-native",
|
|
@@ -42,37 +41,38 @@
|
|
|
42
41
|
"dependencies": {
|
|
43
42
|
"@expo/vector-icons": "~13.0.0",
|
|
44
43
|
"@react-native-async-storage/async-storage": "^1.17.11",
|
|
45
|
-
"@react-native-community/datetimepicker": "^6.7.
|
|
44
|
+
"@react-native-community/datetimepicker": "^6.7.3",
|
|
46
45
|
"@react-native-community/netinfo": "^9.3.7",
|
|
47
|
-
"@react-native-community/slider": "^4.
|
|
46
|
+
"@react-native-community/slider": "^4.4.1",
|
|
48
47
|
"@react-native-masked-view/masked-view": "^0.2.8",
|
|
49
|
-
"@react-navigation/drawer": "^6.
|
|
48
|
+
"@react-navigation/drawer": "^6.6.2",
|
|
50
49
|
"@react-navigation/native": "^6.0.16",
|
|
51
50
|
"@react-navigation/stack": "^6.3.7",
|
|
52
51
|
"@types/lodash-es": "^4.17.6",
|
|
53
|
-
"@wavemaker/variables": "11.4.0-next.
|
|
54
|
-
"axios": "^
|
|
52
|
+
"@wavemaker/variables": "11.4.0-next.24560",
|
|
53
|
+
"axios": "^1.4.0",
|
|
55
54
|
"color": "4.2.3",
|
|
56
55
|
"cross-env": "^5.2.0",
|
|
57
56
|
"css-mediaquery": "^0.1.2",
|
|
57
|
+
"expo-font": "^11.1.1",
|
|
58
58
|
"expo-linear-gradient": "~12.0.1",
|
|
59
59
|
"expo-modules-core": "~1.1.0",
|
|
60
60
|
"fast-xml-parser": "^3.17.6",
|
|
61
61
|
"lodash-es": "^4.17.21",
|
|
62
|
-
"lottie-react-native": "^5.1.
|
|
62
|
+
"lottie-react-native": "^5.1.4",
|
|
63
63
|
"moment": "^2.29.1",
|
|
64
64
|
"react-lottie-player": "^1.5.4",
|
|
65
65
|
"react-native-animatable": "^1.3.3",
|
|
66
|
-
"react-native-circular-progress": "^1.3.
|
|
66
|
+
"react-native-circular-progress": "^1.3.9",
|
|
67
67
|
"react-native-logs": "^4.0.1",
|
|
68
68
|
"react-native-paper": "^4.11.1",
|
|
69
69
|
"react-native-paper-dates": "^0.8.0",
|
|
70
|
-
"react-native-reanimated": "~2.
|
|
71
|
-
"react-native-screens": "~3.
|
|
70
|
+
"react-native-reanimated": "~2.14.4",
|
|
71
|
+
"react-native-screens": "~3.20.0",
|
|
72
72
|
"react-native-snap-carousel": "^3.9.1",
|
|
73
73
|
"react-native-svg": "13.4.0",
|
|
74
|
-
"react-native-web": "~0.18.
|
|
75
|
-
"react-native-webview": "~11.
|
|
74
|
+
"react-native-web": "~0.18.12",
|
|
75
|
+
"react-native-webview": "~11.26.0",
|
|
76
76
|
"react-xml-parser": "^1.1.8",
|
|
77
77
|
"xml2js": "^0.4.23"
|
|
78
78
|
},
|
|
@@ -99,34 +99,35 @@
|
|
|
99
99
|
"eslint-config-prettier": "^7.0.0",
|
|
100
100
|
"eslint-plugin-prettier": "^3.1.3",
|
|
101
101
|
"execa": "^5.0.0",
|
|
102
|
-
"expo-av": "~13.
|
|
103
|
-
"expo-barcode-scanner": "~12.
|
|
104
|
-
"expo-calendar": "~11.
|
|
105
|
-
"expo-camera": "~13.1
|
|
106
|
-
"expo-contacts": "~
|
|
107
|
-
"expo-device": "~5.
|
|
108
|
-
"expo-document-picker": "~11.
|
|
109
|
-
"expo-
|
|
110
|
-
"expo-
|
|
111
|
-
"expo-
|
|
112
|
-
"expo-
|
|
102
|
+
"expo-av": "~13.2.1",
|
|
103
|
+
"expo-barcode-scanner": "~12.3.2",
|
|
104
|
+
"expo-calendar": "~11.1.1",
|
|
105
|
+
"expo-camera": "~13.2.1",
|
|
106
|
+
"expo-contacts": "~12.0.1",
|
|
107
|
+
"expo-device": "~5.2.1",
|
|
108
|
+
"expo-document-picker": "~11.2.2",
|
|
109
|
+
"expo-file-system": "^15.1.1",
|
|
110
|
+
"expo-location": "~15.1.1",
|
|
111
|
+
"expo-network": "~5.2.1",
|
|
112
|
+
"expo-splash-screen": "~0.18.2",
|
|
113
|
+
"expo-web-browser": "~12.1.1",
|
|
113
114
|
"handlebars": "^4.7.7",
|
|
114
115
|
"jest": "^29.3.1",
|
|
115
116
|
"jest-html-reporter": "^3.7.0",
|
|
116
117
|
"ncp": "^2.0.0",
|
|
117
|
-
"react": "18.
|
|
118
|
-
"react-dom": "18.
|
|
119
|
-
"react-native": "0.
|
|
118
|
+
"react": "18.2.0",
|
|
119
|
+
"react-dom": "18.2.0",
|
|
120
|
+
"react-native": "0.71.8",
|
|
120
121
|
"react-native-builder-bob": "^0.18.1",
|
|
121
|
-
"react-native-gesture-handler": "~2.
|
|
122
|
-
"react-native-safe-area-context": "4.
|
|
122
|
+
"react-native-gesture-handler": "~2.9.0",
|
|
123
|
+
"react-native-safe-area-context": "4.5.3",
|
|
123
124
|
"react-test-renderer": "18.1.0",
|
|
124
125
|
"release-it": "^14.2.2",
|
|
125
126
|
"tar": "^6.1.0",
|
|
126
127
|
"typescript": "^4.9.3",
|
|
127
|
-
"victory-native": "^36.
|
|
128
|
+
"victory-native": "^36.6.11",
|
|
128
129
|
"yargs": "^16.2.0",
|
|
129
|
-
"@wavemaker/variables": "11.4.0-next.
|
|
130
|
+
"@wavemaker/variables": "11.4.0-next.24560"
|
|
130
131
|
},
|
|
131
132
|
"jest": {
|
|
132
133
|
"preset": "react-native",
|
app-rn-runtime/runtime/App.js
CHANGED
|
@@ -3,9 +3,9 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
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
4
|
import React from 'react';
|
|
5
5
|
import axios from 'axios';
|
|
6
|
-
import { Platform, TouchableOpacity, View } from 'react-native';
|
|
6
|
+
import { Platform, TouchableOpacity, View, StatusBar } from 'react-native';
|
|
7
7
|
import ProtoTypes from 'prop-types';
|
|
8
|
-
import { SafeAreaProvider, SafeAreaInsetsContext } from 'react-native-safe-area-context';
|
|
8
|
+
import { SafeAreaProvider, SafeAreaInsetsContext, SafeAreaView } from 'react-native-safe-area-context';
|
|
9
9
|
import { DefaultTheme, Provider as PaperProvider } from 'react-native-paper';
|
|
10
10
|
import { Linking } from 'react-native';
|
|
11
11
|
import { NativeModulesProxy } from 'expo-modules-core';
|
|
@@ -17,6 +17,7 @@ import StorageService from '@wavemaker/app-rn-runtime/core/storage.service';
|
|
|
17
17
|
import injector from '@wavemaker/app-rn-runtime/core/injector';
|
|
18
18
|
import formatters from '@wavemaker/app-rn-runtime/core/formatters';
|
|
19
19
|
import { deepCopy, isWebPreviewMode } from '@wavemaker/app-rn-runtime/core/utils';
|
|
20
|
+
import * as Utils from '@wavemaker/app-rn-runtime/core/utils';
|
|
20
21
|
import { ModalProvider } from '@wavemaker/app-rn-runtime/core/modal.service';
|
|
21
22
|
import { FixedViewContainer } from '@wavemaker/app-rn-runtime/core/fixed-view.component';
|
|
22
23
|
import { ToastProvider } from '@wavemaker/app-rn-runtime/core/toast.service';
|
|
@@ -71,6 +72,7 @@ class DrawerImpl {
|
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
const SUPPORTED_SERVICES = {
|
|
75
|
+
Utils: Utils,
|
|
74
76
|
StorageService: StorageService,
|
|
75
77
|
AppDisplayManagerService: AppDisplayManagerService
|
|
76
78
|
};
|
|
@@ -105,6 +107,9 @@ export default class BaseApp extends React.Component {
|
|
|
105
107
|
setTimeout(() => SplashScreen.hideAsync(), 10000);
|
|
106
108
|
this.appConfig.app = this;
|
|
107
109
|
this.appConfig.drawer = new DrawerImpl(() => this.refresh());
|
|
110
|
+
AppSpinnerService.setDefaultOptions({
|
|
111
|
+
spinner: this.appConfig.spinner
|
|
112
|
+
});
|
|
108
113
|
let refreshAfterWait = false;
|
|
109
114
|
this.baseUrl = this.appConfig.url;
|
|
110
115
|
let wait = 0;
|
|
@@ -188,7 +193,13 @@ export default class BaseApp extends React.Component {
|
|
|
188
193
|
// To support old api
|
|
189
194
|
reload() {}
|
|
190
195
|
bindServiceInterceptors() {
|
|
191
|
-
this.axiosInterceptorIds = [axios.interceptors.request.use(config =>
|
|
196
|
+
this.axiosInterceptorIds = [axios.interceptors.request.use(config => {
|
|
197
|
+
const url = config.url;
|
|
198
|
+
if (!(url.startsWith('http://') || url.startsWith("https://"))) {
|
|
199
|
+
config.url = this.appConfig.url + '/' + url;
|
|
200
|
+
}
|
|
201
|
+
return this.onBeforeServiceCall(config);
|
|
202
|
+
}), axios.interceptors.response.use(response => {
|
|
192
203
|
this.onServiceSuccess(response.data, response);
|
|
193
204
|
return response;
|
|
194
205
|
}, error => {
|
|
@@ -199,7 +210,7 @@ export default class BaseApp extends React.Component {
|
|
|
199
210
|
if (errorDetails && errorDetails.errors) {
|
|
200
211
|
errMsg = parseErrors(errorDetails.errors) || "Service Call Failed";
|
|
201
212
|
} else {
|
|
202
|
-
errMsg =
|
|
213
|
+
errMsg = error.message || "Service Call Failed";
|
|
203
214
|
}
|
|
204
215
|
error.message = errMsg;
|
|
205
216
|
this.onServiceError(error.message, error);
|
|
@@ -267,7 +278,7 @@ export default class BaseApp extends React.Component {
|
|
|
267
278
|
watcher: this.watcher,
|
|
268
279
|
render: watch => {
|
|
269
280
|
watch(() => AppToastService.refreshCount);
|
|
270
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, AppToastService.toastsOpened.map((o, i) => /*#__PURE__*/React.createElement(View, {
|
|
281
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, AppToastService.toastsOpened.map((o, i) => this.getProviders( /*#__PURE__*/React.createElement(View, {
|
|
271
282
|
key: i,
|
|
272
283
|
style: [{
|
|
273
284
|
position: 'absolute',
|
|
@@ -282,7 +293,7 @@ export default class BaseApp extends React.Component {
|
|
|
282
293
|
type: o.type,
|
|
283
294
|
caption: o.text,
|
|
284
295
|
hideclose: true
|
|
285
|
-
})))));
|
|
296
|
+
}))))));
|
|
286
297
|
}
|
|
287
298
|
});
|
|
288
299
|
}
|
|
@@ -386,14 +397,11 @@ export default class BaseApp extends React.Component {
|
|
|
386
397
|
left: 0,
|
|
387
398
|
right: 0
|
|
388
399
|
};
|
|
389
|
-
return _this2.getProviders( /*#__PURE__*/React.createElement(
|
|
390
|
-
style:
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
paddingRight: insets === null || insets === void 0 ? void 0 : insets.right
|
|
395
|
-
}]
|
|
396
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
400
|
+
return _this2.getProviders( /*#__PURE__*/React.createElement(SafeAreaView, {
|
|
401
|
+
style: {
|
|
402
|
+
flex: 1
|
|
403
|
+
}
|
|
404
|
+
}, /*#__PURE__*/React.createElement(StatusBar, null), /*#__PURE__*/React.createElement(FixedViewContainer, null, /*#__PURE__*/React.createElement(View, {
|
|
397
405
|
style: styles.container
|
|
398
406
|
}, /*#__PURE__*/React.createElement(AppNavigator, {
|
|
399
407
|
app: _this2,
|
|
@@ -402,10 +410,10 @@ export default class BaseApp extends React.Component {
|
|
|
402
410
|
hideDrawer: ((_this2$appConfig$draw = _this2.appConfig.drawer) === null || _this2$appConfig$draw === void 0 ? void 0 : _this2$appConfig$draw.getContent()) === null,
|
|
403
411
|
drawerContent: () => _this2.appConfig.drawer ? _this2.getProviders(_this2.appConfig.drawer.getContent()) : null,
|
|
404
412
|
drawerAnimation: (_this2$appConfig$draw2 = _this2.appConfig.drawer) === null || _this2$appConfig$draw2 === void 0 ? void 0 : _this2$appConfig$draw2.getAnimation()
|
|
405
|
-
}), commonPartial), /*#__PURE__*/React.createElement(WmNetworkInfoToaster, {
|
|
413
|
+
}), commonPartial, _this2.renderToasters(), _this2.renderDialogs(), _this2.renderDisplayManager()), /*#__PURE__*/React.createElement(WmNetworkInfoToaster, {
|
|
406
414
|
appLocale: _this2.appConfig.appLocale
|
|
407
415
|
}))));
|
|
408
|
-
})
|
|
416
|
+
}))));
|
|
409
417
|
}
|
|
410
418
|
}
|
|
411
419
|
const styles = {
|