@wavemaker/app-rn-runtime 11.12.0-rc.219 → 11.12.1-next.28204

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.
Files changed (61) hide show
  1. package/components/basic/audio/audio.component.js +47 -52
  2. package/components/basic/audio/audio.component.js.map +1 -1
  3. package/components/basic/video/video.component.js +64 -89
  4. package/components/basic/video/video.component.js.map +1 -1
  5. package/components/device/barcodescanner/barcodescanner.component.js +18 -26
  6. package/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
  7. package/components/device/camera/camera.component.js +19 -28
  8. package/components/device/camera/camera.component.js.map +1 -1
  9. package/components/input/fileupload/fileupload.component.js +13 -17
  10. package/components/input/fileupload/fileupload.component.js.map +1 -1
  11. package/core/device/calendar-service.js +1 -7
  12. package/core/device/calendar-service.js.map +1 -1
  13. package/core/device/camera-service.js +0 -6
  14. package/core/device/camera-service.js.map +1 -1
  15. package/core/device/contacts-service.js +1 -7
  16. package/core/device/contacts-service.js.map +1 -1
  17. package/core/device/location-service.js +1 -7
  18. package/core/device/location-service.js.map +1 -1
  19. package/core/device/scan-service.js +0 -6
  20. package/core/device/scan-service.js.map +1 -1
  21. package/core/utils.js +6 -0
  22. package/core/utils.js.map +1 -1
  23. package/npm-shrinkwrap.json +27 -27
  24. package/package-lock.json +27 -27
  25. package/package.json +2 -2
  26. package/runtime/services/device/calendar-service.js +5 -9
  27. package/runtime/services/device/calendar-service.js.map +1 -1
  28. package/runtime/services/device/camera-service.js +22 -39
  29. package/runtime/services/device/camera-service.js.map +1 -1
  30. package/runtime/services/device/contacts-service.js +5 -6
  31. package/runtime/services/device/contacts-service.js.map +1 -1
  32. package/runtime/services/device/location-service.js +4 -4
  33. package/runtime/services/device/location-service.js.map +1 -1
  34. package/runtime/services/device/permissions.js +39 -34
  35. package/runtime/services/device/permissions.js.map +1 -1
  36. package/runtime/services/device/scan-service.js +3 -4
  37. package/runtime/services/device/scan-service.js.map +1 -1
  38. package/variables/device/calendar/create-event.operation.js +1 -12
  39. package/variables/device/calendar/create-event.operation.js.map +1 -1
  40. package/variables/device/calendar/delete-event.operation.js +1 -12
  41. package/variables/device/calendar/delete-event.operation.js.map +1 -1
  42. package/variables/device/calendar/get-events.operation.js +1 -12
  43. package/variables/device/calendar/get-events.operation.js.map +1 -1
  44. package/variables/device/camera/capture-image.operation.js +1 -8
  45. package/variables/device/camera/capture-image.operation.js.map +1 -1
  46. package/variables/device/camera/capture-video.operation.js +1 -7
  47. package/variables/device/camera/capture-video.operation.js.map +1 -1
  48. package/variables/device/contacts/get-contacts.operation.js +1 -12
  49. package/variables/device/contacts/get-contacts.operation.js.map +1 -1
  50. package/variables/device/device/current-geo-position.operation.js +1 -12
  51. package/variables/device/device/current-geo-position.operation.js.map +1 -1
  52. package/variables/device/file/upload-file.operation.js +3 -17
  53. package/variables/device/file/upload-file.operation.js.map +1 -1
  54. package/variables/device/scan/scan.operation.js +1 -12
  55. package/variables/device/scan/scan.operation.js.map +1 -1
  56. package/core/device/av-service.js +0 -8
  57. package/core/device/av-service.js.map +0 -1
  58. package/core/device/fileupload-service.js +0 -8
  59. package/core/device/fileupload-service.js.map +0 -1
  60. package/runtime/services/device/permission-service.js +0 -5
  61. package/runtime/services/device/permission-service.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","BaseComponent","BaseComponentState","ScanConsumer","ScanPluginConsumer","WmBarcodescannerProps","DEFAULT_CLASS","WmButton","PermissionConsumer","WmBarcodescannerState","WmBarcodescanner","constructor","props","_defineProperty","onScanTap","params","barcodeFormat","state","barcodeformat","scanPluginService","permissionService","scanner","scanBarcode","then","res","updateState","datavalue","text","invokeEventCallback","proxy","renderWidget","accessibilityProps","accessible","accessibilitylabel","caption","accessibilityrole","hint","createElement","scanService","style","styles","root","onLayout","event","handleLayout","_background","_extends","id","getTestId","iconclass","button","onTap","bind","iconsize"],"sources":["barcodescanner.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { ScanInput, ScanOutput } from '@wavemaker/app-rn-runtime/variables/device/scan/scan.operation';\nimport { ScanConsumer, ScanPluginConsumer, ScanPluginService, ScanService } from '@wavemaker/app-rn-runtime/core/device/scan-service';\n\nimport WmBarcodescannerProps from './barcodescanner.props';\nimport { DEFAULT_CLASS, WmBarcodescannerStyles } from './barcodescanner.styles';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { PermissionConsumer, PermissionService } from '@wavemaker/app-rn-runtime/runtime/services/device/permission-service';\n\nexport class WmBarcodescannerState extends BaseComponentState<WmBarcodescannerProps> {}\n\nexport default class WmBarcodescanner extends BaseComponent<WmBarcodescannerProps, WmBarcodescannerState, WmBarcodescannerStyles> {\n private scanPluginService: ScanPluginService = null as any;\n private permissionService: PermissionService = null as any;\n private scanner: ScanService = null as any;\n constructor(props: WmBarcodescannerProps) {\n super(props, DEFAULT_CLASS, new WmBarcodescannerProps());\n }\n\n onScanTap() {\n const params: ScanInput = {\n barcodeFormat: this.state.props.barcodeformat,\n scanPluginService: this.scanPluginService,\n permissionService: this.permissionService\n };\n this.scanner.scanBarcode(params).then((res: ScanOutput) => {\n this.updateState({\n props: {\n datavalue: res.text\n }\n } as WmBarcodescannerState, () => {\n this.invokeEventCallback('onSuccess', [null, this.proxy]);\n });\n })\n }\n\n renderWidget(props: WmBarcodescannerProps) {\n const accessibilityProps = {\n accessible: props.accessible, \n accessibilitylabel: props.accessibilitylabel || props.caption,\n accessibilityrole: props.accessibilityrole,\n hint: props.hint,\n }\n return (\n <PermissionConsumer>\n {(permissionService: PermissionService) => {\n this.permissionService = permissionService;\n return (<ScanPluginConsumer>\n {(scanPluginService: any) => {\n this.scanPluginService = scanPluginService; \n return <ScanConsumer>\n {(scanService: ScanService) => {\n this.scanner = scanService;\n return <View style={this.styles.root} onLayout={(event) => this.handleLayout(event)}>\n {this._background}\n <WmButton id={this.getTestId('button')} iconclass={props.iconclass} styles={this.styles.button} onTap={this.onScanTap.bind(this)} caption={props.caption} iconsize={props.iconsize} {...accessibilityProps}></WmButton>\n </View>\n }}\n </ScanConsumer>\n }}\n </ScanPluginConsumer>)\n }}\n </PermissionConsumer>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,YAAY,EAAEC,kBAAkB,QAAwC,oDAAoD;AAErI,OAAOC,qBAAqB,MAAM,wBAAwB;AAC1D,SAASC,aAAa,QAAgC,yBAAyB;AAC/E,OAAOC,QAAQ,MAAM,oEAAoE;AACzF,SAASC,kBAAkB,QAA2B,sEAAsE;AAE5H,OAAO,MAAMC,qBAAqB,SAASP,kBAAkB,CAAwB;AAErF,eAAe,MAAMQ,gBAAgB,SAAST,aAAa,CAAuE;EAIhIU,WAAWA,CAACC,KAA4B,EAAE;IACxC,KAAK,CAACA,KAAK,EAAEN,aAAa,EAAE,IAAID,qBAAqB,CAAC,CAAC,CAAC;IAACQ,eAAA,4BAJZ,IAAI;IAAAA,eAAA,4BACJ,IAAI;IAAAA,eAAA,kBACpB,IAAI;EAGnC;EAEAC,SAASA,CAAA,EAAG;IACV,MAAMC,MAAiB,GAAG;MACxBC,aAAa,EAAE,IAAI,CAACC,KAAK,CAACL,KAAK,CAACM,aAAa;MAC7CC,iBAAiB,EAAE,IAAI,CAACA,iBAAiB;MACzCC,iBAAiB,EAAE,IAAI,CAACA;IAC1B,CAAC;IACD,IAAI,CAACC,OAAO,CAACC,WAAW,CAACP,MAAM,CAAC,CAACQ,IAAI,CAAEC,GAAe,IAAK;MACzD,IAAI,CAACC,WAAW,CAAC;QACfb,KAAK,EAAE;UACLc,SAAS,EAAEF,GAAG,CAACG;QACjB;MACF,CAAC,EAA2B,MAAM;QAChC,IAAI,CAACC,mBAAmB,CAAC,WAAW,EAAE,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,KAAK,CAACyC;UAAS,GAAKtB,kBAAkB,CAAY,CAClN,CAAC;QACN,CACY,CAAC;MACjB,CACoB,CAAC;IACvB,CACoB,CAAC;EAEzB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","BaseComponent","BaseComponentState","ScanConsumer","WmBarcodescannerProps","DEFAULT_CLASS","WmButton","WmBarcodescannerState","WmBarcodescanner","constructor","props","_defineProperty","onScanTap","params","barcodeFormat","state","barcodeformat","scanner","scanBarcode","then","res","updateState","datavalue","text","invokeEventCallback","proxy","renderWidget","accessibilityProps","accessible","accessibilitylabel","caption","accessibilityrole","hint","createElement","scanService","_extends","style","styles","root","onLayout","event","handleLayout","_background","id","getTestId","iconclass","button","onTap","bind","iconsize"],"sources":["barcodescanner.component.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { ScanInput, ScanOutput } from '@wavemaker/app-rn-runtime/variables/device/scan/scan.operation';\nimport { ScanConsumer, ScanService } from '@wavemaker/app-rn-runtime/core/device/scan-service';\n\nimport WmBarcodescannerProps from './barcodescanner.props';\nimport { DEFAULT_CLASS, WmBarcodescannerStyles } from './barcodescanner.styles';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\n\nexport class WmBarcodescannerState extends BaseComponentState<WmBarcodescannerProps> {}\n\nexport default class WmBarcodescanner extends BaseComponent<WmBarcodescannerProps, WmBarcodescannerState, WmBarcodescannerStyles> {\n private scanner: ScanService = null as any;\n constructor(props: WmBarcodescannerProps) {\n super(props, DEFAULT_CLASS, new WmBarcodescannerProps());\n }\n\n onScanTap() {\n const params: ScanInput = {\n barcodeFormat: this.state.props.barcodeformat\n };\n this.scanner.scanBarcode(params).then((res: ScanOutput) => {\n this.updateState({\n props: {\n datavalue: res.text\n }\n } as WmBarcodescannerState, () => {\n this.invokeEventCallback('onSuccess', [null, this.proxy]);\n });\n })\n }\n\n renderWidget(props: WmBarcodescannerProps) {\n const accessibilityProps = {\n accessible: props.accessible, \n accessibilitylabel: props.accessibilitylabel || props.caption,\n accessibilityrole: props.accessibilityrole,\n hint: props.hint,\n }\n return (\n <ScanConsumer>\n {(scanService: ScanService) => {\n this.scanner = scanService;\n return <View style={this.styles.root} onLayout={(event) => this.handleLayout(event)} {...accessibilityProps}>\n {this._background}\n <WmButton id={this.getTestId('button')} iconclass={props.iconclass} styles={this.styles.button} onTap={this.onScanTap.bind(this)} caption={props.caption} iconsize={props.iconsize} accessibilitylabel={props.accessibilitylabel} hint={props.hint} accessibilityrole={props.accessibilityrole}></WmButton>\n </View>\n }}\n </ScanConsumer>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,QAAQ,cAAc;AACnC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,SAASC,YAAY,QAAqB,oDAAoD;AAE9F,OAAOC,qBAAqB,MAAM,wBAAwB;AAC1D,SAASC,aAAa,QAAgC,yBAAyB;AAC/E,OAAOC,QAAQ,MAAM,oEAAoE;AAEzF,OAAO,MAAMC,qBAAqB,SAASL,kBAAkB,CAAwB;AAErF,eAAe,MAAMM,gBAAgB,SAASP,aAAa,CAAuE;EAEhIQ,WAAWA,CAACC,KAA4B,EAAE;IACxC,KAAK,CAACA,KAAK,EAAEL,aAAa,EAAE,IAAID,qBAAqB,CAAC,CAAC,CAAC;IAACO,eAAA,kBAF5B,IAAI;EAGnC;EAEAC,SAASA,CAAA,EAAG;IACV,MAAMC,MAAiB,GAAG;MACxBC,aAAa,EAAE,IAAI,CAACC,KAAK,CAACL,KAAK,CAACM;IAClC,CAAC;IACD,IAAI,CAACC,OAAO,CAACC,WAAW,CAACL,MAAM,CAAC,CAACM,IAAI,CAAEC,GAAe,IAAK;MACzD,IAAI,CAACC,WAAW,CAAC;QACfX,KAAK,EAAE;UACLY,SAAS,EAAEF,GAAG,CAACG;QACjB;MACF,CAAC,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AAC;IACT,CACY,CAAC;EAEnB;AACF","ignoreList":[]}
@@ -9,13 +9,11 @@ import WmCameraProps from './camera.props';
9
9
  import { DEFAULT_CLASS } from './camera.styles';
10
10
  import WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';
11
11
  import { CameraConsumer } from "@wavemaker/app-rn-runtime/core/device/camera-service";
12
- import { PermissionConsumer } from '@wavemaker/app-rn-runtime/runtime/services/device/permission-service';
13
12
  export class WmCameraState extends BaseComponentState {}
14
13
  export default class WmCamera extends BaseComponent {
15
14
  constructor(props) {
16
15
  super(props, DEFAULT_CLASS, new WmCameraProps());
17
16
  _defineProperty(this, "camera", null);
18
- _defineProperty(this, "permissionService", null);
19
17
  _defineProperty(this, "localFile", '');
20
18
  }
21
19
  onCameraTap() {
@@ -26,17 +24,13 @@ export default class WmCamera extends BaseComponent {
26
24
  imageQuality: props.imagequality,
27
25
  imageEncodingType: props.imageencodingtype,
28
26
  imageTargetWidth: props.imagetargetwidth,
29
- imageTargetHeight: props.imagetargetheight,
30
- permissionService: this.permissionService
27
+ imageTargetHeight: props.imagetargetheight
31
28
  };
32
29
  this.camera.captureImage(params).then(res => {
33
30
  this.updateModel(null, res.imagePath, res.content);
34
31
  });
35
32
  } else {
36
- const params = {
37
- permissionService: this.permissionService
38
- };
39
- this.camera.captureVideo(params).then(res => {
33
+ this.camera.captureVideo().then(res => {
40
34
  this.updateModel(null, res.videoPath, res.content);
41
35
  });
42
36
  }
@@ -58,26 +52,23 @@ export default class WmCamera extends BaseComponent {
58
52
  accessibilityrole: props.accessibilityrole,
59
53
  hint: props.hint
60
54
  };
61
- return /*#__PURE__*/React.createElement(PermissionConsumer, null, permissionService => {
62
- this.permissionService = permissionService;
63
- return /*#__PURE__*/React.createElement(CameraConsumer, null, cameraService => {
64
- {
65
- this._background;
66
- }
67
- this.camera = cameraService;
68
- return /*#__PURE__*/React.createElement(View, {
69
- style: this.styles.root,
70
- onLayout: event => this.handleLayout(event)
71
- }, /*#__PURE__*/React.createElement(WmButton, _extends({
72
- id: this.getTestId('button'),
73
- caption: props.caption,
74
- iconclass: props.iconclass,
75
- iconsize: props.iconsize,
76
- iconposition: props.caption ? '' : 'left',
77
- styles: this.styles.button,
78
- onTap: this.onCameraTap.bind(this)
79
- }, accessibilityProps)));
80
- });
55
+ return /*#__PURE__*/React.createElement(CameraConsumer, null, cameraService => {
56
+ {
57
+ this._background;
58
+ }
59
+ this.camera = cameraService;
60
+ return /*#__PURE__*/React.createElement(View, {
61
+ style: this.styles.root,
62
+ onLayout: event => this.handleLayout(event)
63
+ }, /*#__PURE__*/React.createElement(WmButton, _extends({
64
+ id: this.getTestId('button'),
65
+ caption: props.caption,
66
+ iconclass: props.iconclass,
67
+ iconsize: props.iconsize,
68
+ iconposition: props.caption ? '' : 'left',
69
+ styles: this.styles.button,
70
+ onTap: this.onCameraTap.bind(this)
71
+ }, accessibilityProps)));
81
72
  });
82
73
  }
83
74
  }
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmCameraProps","DEFAULT_CLASS","WmButton","CameraConsumer","PermissionConsumer","WmCameraState","WmCamera","constructor","props","_defineProperty","onCameraTap","state","capturetype","params","allowImageEdit","allowedit","imageQuality","imagequality","imageEncodingType","imageencodingtype","imageTargetWidth","imagetargetwidth","imageTargetHeight","imagetargetheight","permissionService","camera","captureImage","then","res","updateModel","imagePath","content","captureVideo","videoPath","$event","value","startsWith","localFile","updateState","datavalue","localFilePath","invokeEventCallback","bind","proxy","renderWidget","accessibilityProps","accessible","accessibilitylabel","caption","accessibilityrole","hint","createElement","cameraService","_background","style","styles","root","onLayout","event","handleLayout","_extends","id","getTestId","iconclass","iconsize","iconposition","button","onTap"],"sources":["camera.component.tsx"],"sourcesContent":["import React from 'react';\nimport { AccessibilityRole, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmCameraProps from './camera.props';\nimport { DEFAULT_CLASS, WmCameraStyles } from './camera.styles';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { CaptureImageOutput } from '@wavemaker/app-rn-runtime/variables/device/camera/capture-image.operation';\nimport { CameraConsumer, CameraInput, CameraService, CameraVideoInput } from \"@wavemaker/app-rn-runtime/core/device/camera-service\";\nimport { CaptureVideoOutput } from '@wavemaker/app-rn-runtime/variables/device/camera/capture-video.operation';\nimport { PermissionConsumer, PermissionService } from '@wavemaker/app-rn-runtime/runtime/services/device/permission-service';\n\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nexport class WmCameraState extends BaseComponentState<WmCameraProps> {}\n\nexport default class WmCamera extends BaseComponent<WmCameraProps, WmCameraState, WmCameraStyles> {\n private camera: CameraService = null as any;\n private permissionService: PermissionService = null as any;\n public localFile: string = '';\n constructor(props: WmCameraProps) {\n super(props, DEFAULT_CLASS, new WmCameraProps());\n }\n\n onCameraTap() {\n const props = this.state.props;\n if (props.capturetype === 'IMAGE') {\n const params: CameraInput = {\n allowImageEdit: props.allowedit,\n imageQuality: props.imagequality,\n imageEncodingType: props.imageencodingtype,\n imageTargetWidth: props.imagetargetwidth,\n imageTargetHeight: props.imagetargetheight,\n permissionService: this.permissionService\n };\n\n this.camera.captureImage(params).then((res: CaptureImageOutput) => {\n this.updateModel(null, res.imagePath, res.content);\n });\n } else {\n const params: CameraVideoInput = {\n permissionService: this.permissionService\n };\n this.camera.captureVideo(params).then((res: CaptureVideoOutput) => {\n this.updateModel(null, res.videoPath, res.content);\n });\n }\n\n }\n\n private updateModel($event: any, value: any, content: string) {\n value = (value.startsWith('file://') ? '' : 'file://') + value;\n this.localFile = content;\n this.updateState({\n props: {\n datavalue: value,\n localFilePath: value\n }\n } as WmCameraState, this.invokeEventCallback.bind(this, 'onSuccess', [null, this.proxy, value, this.localFile]));\n }\n\n renderWidget(props: WmCameraProps) {\n const accessibilityProps = {\n accessible: props.accessible, \n accessibilitylabel: props.accessibilitylabel || props.caption,\n accessibilityrole: props.accessibilityrole,\n hint: props.hint,\n }\n return (\n <PermissionConsumer>\n {(permissionService: PermissionService) => {\n this.permissionService = permissionService;\n return (<CameraConsumer>\n {(cameraService: CameraService) => {\n {this._background}\n this.camera = cameraService;\n return <View style={this.styles.root} onLayout={(event) => this.handleLayout(event)}>\n <WmButton id={this.getTestId('button')} caption={props.caption} iconclass={props.iconclass} iconsize={props.iconsize} iconposition={props.caption ? '' : 'left'} styles={this.styles.button} onTap={this.onCameraTap.bind(this)} {...accessibilityProps}></WmButton>\n </View>\n }}\n </CameraConsumer>)\n }}\n </PermissionConsumer>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,QAAQ,cAAc;AACtD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,QAAQ,MAAM,oEAAoE;AAEzF,SAASC,cAAc,QAAsD,sDAAsD;AAEnI,SAASC,kBAAkB,QAA2B,sEAAsE;AAI5H,OAAO,MAAMC,aAAa,SAASN,kBAAkB,CAAgB;AAErE,eAAe,MAAMO,QAAQ,SAASR,aAAa,CAA+C;EAIhGS,WAAWA,CAACC,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEP,aAAa,EAAE,IAAID,aAAa,CAAC,CAAC,CAAC;IAACS,eAAA,iBAJnB,IAAI;IAAAA,eAAA,4BACW,IAAI;IAAAA,eAAA,oBACxB,EAAE;EAG7B;EAEAC,WAAWA,CAAA,EAAG;IACZ,MAAMF,KAAK,GAAG,IAAI,CAACG,KAAK,CAACH,KAAK;IAC9B,IAAIA,KAAK,CAACI,WAAW,KAAK,OAAO,EAAE;MACjC,MAAMC,MAAmB,GAAG;QAC1BC,cAAc,EAAEN,KAAK,CAACO,SAAS;QAC/BC,YAAY,EAAER,KAAK,CAACS,YAAY;QAChCC,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KAAK,CAACsC,UAAU;MAC5BC,kBAAkB,EAAEvC,KAAK,CAACuC,kBAAkB,IAAIvC,KAAK,CAACwC,OAAO;MAC7DC,iBAAiB,EAAEzC,KAAK,CAACyC,iBAAiB;MAC1CC,IAAI,EAAE1C,KAAK,CAAC0C;IACd,CAAC;IACD,oBACEtD,KAAA,CAAAuD,aAAA,CAAC/C,kBAAkB,QACfoB,iBAAoC,IAAK;MACzC,IAAI,CAACA,iBAAiB,GAAGA,iBAAiB;MAC1C,oBAAQ5B,KAAA,CAAAuD,aAAA,CAAChD,cAAc,QACjBiD,aAA4B,IAAK;QACnC;UAAC,IAAI,CAACC,WAAW;QAAA;QACjB,IAAI,CAAC5B,MAAM,GAAG2B,aAAa;QAC3B,oBAAOxD,KAAA,CAAAuD,aAAA,CAACtD,IAAI;UAACyD,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC,IAAK;UAACC,QAAQ,EAAGC,KAAK,IAAK,IAAI,CAACC,YAAY,CAACD,KAAK;QAAE,gBAClF9D,KAAA,CAAAuD,aAAA,CAACjD,QAAQ,EAAA0D,QAAA;UAACC,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,QAAQ,CAAE;UAACd,OAAO,EAAExC,KAAK,CAACwC,OAAQ;UAACe,SAAS,EAAEvD,KAAK,CAACuD,SAAU;UAACC,QAAQ,EAAExD,KAAK,CAACwD,QAAS;UAACC,YAAY,EAAEzD,KAAK,CAACwC,OAAO,GAAG,EAAE,GAAG,MAAO;UAACO,MAAM,EAAE,IAAI,CAACA,MAAM,CAACW,MAAO;UAACC,KAAK,EAAE,IAAI,CAACzD,WAAW,CAACgC,IAAI,CAAC,IAAI;QAAE,GAAKG,kBAAkB,CAAY,CAC/P,CAAC;MACT,CACc,CAAC;IACnB,CACkB,CAAC;EAEzB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","View","BaseComponent","BaseComponentState","WmCameraProps","DEFAULT_CLASS","WmButton","CameraConsumer","WmCameraState","WmCamera","constructor","props","_defineProperty","onCameraTap","state","capturetype","params","allowImageEdit","allowedit","imageQuality","imagequality","imageEncodingType","imageencodingtype","imageTargetWidth","imagetargetwidth","imageTargetHeight","imagetargetheight","camera","captureImage","then","res","updateModel","imagePath","content","captureVideo","videoPath","$event","value","startsWith","localFile","updateState","datavalue","localFilePath","invokeEventCallback","bind","proxy","renderWidget","accessibilityProps","accessible","accessibilitylabel","caption","accessibilityrole","hint","createElement","cameraService","_background","style","styles","root","onLayout","event","handleLayout","_extends","id","getTestId","iconclass","iconsize","iconposition","button","onTap"],"sources":["camera.component.tsx"],"sourcesContent":["import React from 'react';\nimport { AccessibilityRole, View } from 'react-native';\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmCameraProps from './camera.props';\nimport { DEFAULT_CLASS, WmCameraStyles } from './camera.styles';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { CaptureImageOutput } from '@wavemaker/app-rn-runtime/variables/device/camera/capture-image.operation';\nimport { CameraConsumer, CameraInput, CameraService } from \"@wavemaker/app-rn-runtime/core/device/camera-service\";\nimport { CaptureVideoOutput } from '@wavemaker/app-rn-runtime/variables/device/camera/capture-video.operation';\n\nimport { AccessibilityWidgetType, getAccessibilityProps } from '@wavemaker/app-rn-runtime/core/accessibility';\n\nexport class WmCameraState extends BaseComponentState<WmCameraProps> {}\n\nexport default class WmCamera extends BaseComponent<WmCameraProps, WmCameraState, WmCameraStyles> {\n private camera: CameraService = null as any;\n public localFile: string = '';\n constructor(props: WmCameraProps) {\n super(props, DEFAULT_CLASS, new WmCameraProps());\n }\n\n onCameraTap() {\n const props = this.state.props;\n if (props.capturetype === 'IMAGE') {\n const params: CameraInput = {\n allowImageEdit: props.allowedit,\n imageQuality: props.imagequality,\n imageEncodingType: props.imageencodingtype,\n imageTargetWidth: props.imagetargetwidth,\n imageTargetHeight: props.imagetargetheight\n };\n\n this.camera.captureImage(params).then((res: CaptureImageOutput) => {\n this.updateModel(null, res.imagePath, res.content);\n });\n } else {\n this.camera.captureVideo().then((res: CaptureVideoOutput) => {\n this.updateModel(null, res.videoPath, res.content);\n });\n }\n\n }\n\n private updateModel($event: any, value: any, content: string) {\n value = (value.startsWith('file://') ? '' : 'file://') + value;\n this.localFile = content;\n this.updateState({\n props: {\n datavalue: value,\n localFilePath: value\n }\n } as WmCameraState, this.invokeEventCallback.bind(this, 'onSuccess', [null, this.proxy, value, this.localFile]));\n }\n\n renderWidget(props: WmCameraProps) {\n const accessibilityProps = {\n accessible: props.accessible, \n accessibilitylabel: props.accessibilitylabel || props.caption,\n accessibilityrole: props.accessibilityrole,\n hint: props.hint,\n }\n return (\n <CameraConsumer>\n {(cameraService: CameraService) => {\n {this._background}\n this.camera = cameraService;\n return <View style={this.styles.root} onLayout={(event) => this.handleLayout(event)}>\n <WmButton id={this.getTestId('button')} caption={props.caption} iconclass={props.iconclass} iconsize={props.iconsize} iconposition={props.caption ? '' : 'left'} styles={this.styles.button} onTap={this.onCameraTap.bind(this)} {...accessibilityProps}></WmButton>\n </View>\n }}\n </CameraConsumer>\n );\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAA4BC,IAAI,QAAQ,cAAc;AACtD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,aAAa,MAAM,gBAAgB;AAC1C,SAASC,aAAa,QAAwB,iBAAiB;AAC/D,OAAOC,QAAQ,MAAM,oEAAoE;AAEzF,SAASC,cAAc,QAAoC,sDAAsD;AAKjH,OAAO,MAAMC,aAAa,SAASL,kBAAkB,CAAgB;AAErE,eAAe,MAAMM,QAAQ,SAASP,aAAa,CAA+C;EAGhGQ,WAAWA,CAACC,KAAoB,EAAE;IAChC,KAAK,CAACA,KAAK,EAAEN,aAAa,EAAE,IAAID,aAAa,CAAC,CAAC,CAAC;IAACQ,eAAA,iBAHnB,IAAI;IAAAA,eAAA,oBACT,EAAE;EAG7B;EAEAC,WAAWA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AAC,CAAC,CAAC;EAClH;EAEAO,YAAYA,CAACnC,KAAoB,EAAE;IACjC,MAAMoC,kBAAkB,GAAG;MACzBC,UAAU,EAAErC,KAAK,CAACqC,UAAU;MAC5BC,kBAAkB,EAAEtC,KAAK,CAACsC,kBAAkB,IAAItC,KAAK,CAACuC,OAAO;MAC7DC,iBAAiB,EAAExC,KAAK,CAACwC,iBAAiB;MAC1CC,IAAI,EAAEzC,KAAK,CAACyC;IACd,CAAC;IACD,oBACMpD,KAAA,CAAAqD,aAAA,CAAC9C,cAAc,QACT+C,aAA4B,IAAK;MACnC;QAAC,IAAI,CAACC,WAAW;MAAA;MACjB,IAAI,CAAC5B,MAAM,GAAG2B,aAAa;MAC3B,oBAAOtD,KAAA,CAAAqD,aAAA,CAACpD,IAAI;QAACuD,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC,IAAK;QAACC,QAAQ,EAAGC,KAAK,IAAK,IAAI,CAACC,YAAY,CAACD,KAAK;MAAE,gBAClF5D,KAAA,CAAAqD,aAAA,CAAC/C,QAAQ,EAAAwD,QAAA;QAACC,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,QAAQ,CAAE;QAACd,OAAO,EAAEvC,KAAK,CAACuC,OAAQ;QAACe,SAAS,EAAEtD,KAAK,CAACsD,SAAU;QAACC,QAAQ,EAAEvD,KAAK,CAACuD,QAAS;QAACC,YAAY,EAAExD,KAAK,CAACuC,OAAO,GAAG,EAAE,GAAG,MAAO;QAACO,MAAM,EAAE,IAAI,CAACA,MAAM,CAACW,MAAO;QAACC,KAAK,EAAE,IAAI,CAACxD,WAAW,CAAC+B,IAAI,CAAC,IAAI;MAAE,GAAKG,kBAAkB,CAAY,CAC/P,CAAC;IACT,CACc,CAAC;EAEzB;AACF","ignoreList":[]}
@@ -4,12 +4,12 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
4
4
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
5
  import React from 'react';
6
6
  import { Platform, View } from 'react-native';
7
+ import * as DocumentPicker from 'expo-document-picker';
7
8
  import { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';
8
9
  import WmFileuploadProps from './fileupload.props';
9
10
  import { DEFAULT_CLASS } from './fileupload.styles';
10
11
  import WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';
11
12
  import { getMimeType } from '@wavemaker/app-rn-runtime/core/utils';
12
- import { FileUploadPluginConsumer } from '@wavemaker/app-rn-runtime/core/device/fileupload-service';
13
13
  export class WmFileuploadState extends BaseComponentState {
14
14
  constructor(...args) {
15
15
  super(...args);
@@ -24,11 +24,10 @@ const namedParameters = {
24
24
  export default class WmFileupload extends BaseComponent {
25
25
  constructor(props) {
26
26
  super(props, DEFAULT_CLASS, new WmFileuploadProps());
27
- _defineProperty(this, "fileUploadService", null);
28
27
  }
29
28
  onTap(props) {
30
29
  namedParameters.type = getMimeType(props.contenttype);
31
- this.fileUploadService.getDocumentAsync(namedParameters).then(response => {
30
+ DocumentPicker.getDocumentAsync(namedParameters).then(response => {
32
31
  let selectedFile;
33
32
  if (Platform.OS !== 'web') {
34
33
  selectedFile = response.assets[0];
@@ -51,20 +50,17 @@ export default class WmFileupload extends BaseComponent {
51
50
  hint: props.hint,
52
51
  accessibilityrole: props.accessibilityrole
53
52
  };
54
- return /*#__PURE__*/React.createElement(FileUploadPluginConsumer, null, fileUploadPluginService => {
55
- this.fileUploadService = fileUploadPluginService;
56
- return /*#__PURE__*/React.createElement(View, {
57
- style: this.styles.root,
58
- onLayout: event => this.handleLayout(event)
59
- }, this._background, /*#__PURE__*/React.createElement(WmButton, _extends({
60
- id: this.getTestId(),
61
- iconclass: props.iconclass,
62
- caption: props.caption,
63
- styles: this.styles.button,
64
- iconsize: props.iconsize,
65
- onTap: () => this.onTap.bind(this)(props)
66
- }, accessibilityProps)));
67
- });
53
+ return /*#__PURE__*/React.createElement(View, {
54
+ style: this.styles.root,
55
+ onLayout: event => this.handleLayout(event)
56
+ }, this._background, /*#__PURE__*/React.createElement(WmButton, _extends({
57
+ id: this.getTestId(),
58
+ iconclass: props.iconclass,
59
+ caption: props.caption,
60
+ styles: this.styles.button,
61
+ iconsize: props.iconsize,
62
+ onTap: () => this.onTap.bind(this)(props)
63
+ }, accessibilityProps)));
68
64
  }
69
65
  }
70
66
  //# sourceMappingURL=fileupload.component.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","View","BaseComponent","BaseComponentState","WmFileuploadProps","DEFAULT_CLASS","WmButton","getMimeType","FileUploadPluginConsumer","WmFileuploadState","constructor","args","_defineProperty","namedParameters","copyToCacheDirectory","multiple","type","WmFileupload","props","onTap","contenttype","fileUploadService","getDocumentAsync","then","response","selectedFile","OS","assets","mimeType","file","invokeEventCallback","proxy","updateState","selectedFiles","bind","renderWidget","accessibilityProps","accessible","accessibilitylabel","hint","accessibilityrole","createElement","fileUploadPluginService","style","styles","root","onLayout","event","handleLayout","_background","_extends","id","getTestId","iconclass","caption","button","iconsize"],"sources":["fileupload.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, View } from 'react-native';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmFileuploadProps from './fileupload.props';\nimport { DEFAULT_CLASS, WmFileuploadStyles } from './fileupload.styles';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { getMimeType } from '@wavemaker/app-rn-runtime/core/utils';\nimport { FileUploadPluginConsumer, FileUploadPluginService } from '@wavemaker/app-rn-runtime/core/device/fileupload-service';\n\nexport interface SelectFileOutput {\n mimeType: string;\n name: string;\n size: number;\n type: 'cancel' | 'success';\n uri: string;\n}\n\nexport class WmFileuploadState extends BaseComponentState<WmFileuploadProps> {\n selectedFiles: any;\n}\n\ntype NamedParametersType = {\n copyToCacheDirectory: boolean,\n multiple: boolean,\n type: string | string[]\n};\n\nconst namedParameters: NamedParametersType = {\n copyToCacheDirectory: false,\n multiple: false,\n type: '*/*'\n};\n\nexport default class WmFileupload extends BaseComponent<WmFileuploadProps, WmFileuploadState, WmFileuploadStyles> {\n public fileUploadService: any = null as any;\n\n constructor(props: WmFileuploadProps) {\n super(props, DEFAULT_CLASS, new WmFileuploadProps());\n }\n\n onTap(props: WmFileuploadProps) {\n namedParameters.type = getMimeType(props.contenttype);\n this.fileUploadService.getDocumentAsync(namedParameters).then((response: any) => {\n let selectedFile;\n if (Platform.OS !== 'web') {\n selectedFile = response.assets[0];\n selectedFile.type = selectedFile.mimeType;\n } else {\n selectedFile = [response.assets[0].file];\n }\n this.invokeEventCallback('onBeforeselect', [null, this.proxy, selectedFile]);\n\n this.updateState({\n props: {\n selectedFiles: selectedFile\n }\n } as WmFileuploadState, this.invokeEventCallback.bind(this, 'onSelect', [null, this.proxy, selectedFile]));\n });\n }\n\n renderWidget(props: WmFileuploadProps) {\n const accessibilityProps = {\n accessible: props.accessible,\n accessibilitylabel: props.accessibilitylabel,\n hint: props.hint,\n accessibilityrole: props.accessibilityrole,\n };\n return (\n <FileUploadPluginConsumer>\n {(fileUploadPluginService: FileUploadPluginService) => {\n this.fileUploadService = fileUploadPluginService;\n return (\n <View style={this.styles.root} onLayout={(event) => this.handleLayout(event)}>\n {this._background}\n <WmButton id={this.getTestId()} iconclass={props.iconclass} caption={props.caption} styles={this.styles.button} iconsize={props.iconsize} onTap={() => this.onTap.bind(this)(props)} {...accessibilityProps}></WmButton>\n </View>\n )}}\n </FileUploadPluginConsumer>\n )\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AAE7C,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,iBAAiB,MAAM,oBAAoB;AAClD,SAASC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uB,IAAI,CAACK,mBAAmB,CAACI,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,CAACH,KAAK,EAAEN,YAAY,CAAC,CAAC,CAAC;IAC5G,CAAC,CAAC;EACJ;EAEAU,YAAYA,CAACjB,KAAwB,EAAE;IACrC,MAAMkB,kBAAkB,GAAG;MACzBC,UAAU,EAAEnB,KAAK,CAACmB,UAAU;MAC5BC,kBAAkB,EAAEpB,KAAK,CAACoB,kBAAkB;MAC5CC,IAAI,EAAErB,KAAK,CAACqB,IAAI;MAChBC,iBAAiB,EAAEtB,KAAK,CAACsB;IAC3B,CAAC;IACD,oBACEzC,KAAA,CAAA0C,aAAA,CAACjC,wBAAwB,QACvBkC,uBAAgD,IAAK;MACvD,IAAI,CAACrB,iBAAiB,GAAGqB,uBAAuB;MAChD,oBACA3C,KAAA,CAAA0C,aAAA,CAACxC,IAAI;QAAC0C,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC,IAAK;QAACC,QAAQ,EAAGC,KAAK,IAAK,IAAI,CAACC,YAAY,CAACD,KAAK;MAAE,GAC5E,IAAI,CAACE,WAAW,eACjBlD,KAAA,CAAA0C,aAAA,CAACnC,QAAQ,EAAA4C,QAAA;QAACC,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,CAAE;QAACC,SAAS,EAAEnC,KAAK,CAACmC,SAAU;QAACC,OAAO,EAAEpC,KAAK,CAACoC,OAAQ;QAACV,MAAM,EAAE,IAAI,CAACA,MAAM,CAACW,MAAO;QAACC,QAAQ,EAAEtC,KAAK,CAACsC,QAAS;QAACrC,KAAK,EAAEA,CAAA,KAAM,IAAI,CAACA,KAAK,CAACe,IAAI,CAAC,IAAI,CAAC,CAAChB,KAAK;MAAE,GAAKkB,kBAAkB,CAAY,CACnN,CAAC;IACR,CAC6B,CAAC;EAE/B;AACF","ignoreList":[]}
1
+ {"version":3,"names":["React","Platform","View","DocumentPicker","BaseComponent","BaseComponentState","WmFileuploadProps","DEFAULT_CLASS","WmButton","getMimeType","WmFileuploadState","constructor","args","_defineProperty","namedParameters","copyToCacheDirectory","multiple","type","WmFileupload","props","onTap","contenttype","getDocumentAsync","then","response","selectedFile","OS","assets","mimeType","file","invokeEventCallback","proxy","updateState","selectedFiles","bind","renderWidget","accessibilityProps","accessible","accessibilitylabel","hint","accessibilityrole","createElement","style","styles","root","onLayout","event","handleLayout","_background","_extends","id","getTestId","iconclass","caption","button","iconsize"],"sources":["fileupload.component.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, View } from 'react-native';\nimport * as DocumentPicker from 'expo-document-picker';\n\nimport { BaseComponent, BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\n\nimport WmFileuploadProps from './fileupload.props';\nimport { DEFAULT_CLASS, WmFileuploadStyles } from './fileupload.styles';\nimport WmButton from '@wavemaker/app-rn-runtime/components/basic/button/button.component';\nimport { getMimeType } from '@wavemaker/app-rn-runtime/core/utils';\n\nexport interface SelectFileOutput {\n mimeType: string;\n name: string;\n size: number;\n type: 'cancel' | 'success';\n uri: string;\n}\n\nexport class WmFileuploadState extends BaseComponentState<WmFileuploadProps> {\n selectedFiles: any;\n}\n\ntype NamedParametersType = {\n copyToCacheDirectory: boolean,\n multiple: boolean,\n type: string | string[]\n};\n\nconst namedParameters: NamedParametersType = {\n copyToCacheDirectory: false,\n multiple: false,\n type: '*/*'\n};\n\nexport default class WmFileupload extends BaseComponent<WmFileuploadProps, WmFileuploadState, WmFileuploadStyles> {\n\n constructor(props: WmFileuploadProps) {\n super(props, DEFAULT_CLASS, new WmFileuploadProps());\n }\n\n onTap(props: WmFileuploadProps) {\n namedParameters.type = getMimeType(props.contenttype);\n DocumentPicker.getDocumentAsync(namedParameters).then((response: any) => {\n let selectedFile;\n if (Platform.OS !== 'web') {\n selectedFile = response.assets[0];\n selectedFile.type = selectedFile.mimeType;\n } else {\n selectedFile = [response.assets[0].file];\n }\n this.invokeEventCallback('onBeforeselect', [null, this.proxy, selectedFile]);\n\n this.updateState({\n props: {\n selectedFiles: selectedFile\n }\n } as WmFileuploadState, this.invokeEventCallback.bind(this, 'onSelect', [null, this.proxy, selectedFile]));\n });\n }\n\n renderWidget(props: WmFileuploadProps) {\n const accessibilityProps = {\n accessible: props.accessible,\n accessibilitylabel: props.accessibilitylabel,\n hint: props.hint,\n accessibilityrole: props.accessibilityrole,\n };\n\n return <View style={this.styles.root} onLayout={(event) => this.handleLayout(event)}>\n {this._background}\n <WmButton id={this.getTestId()} iconclass={props.iconclass} caption={props.caption} styles={this.styles.button} iconsize={props.iconsize} onTap={() => this.onTap.bind(this)(props)} {...accessibilityProps}></WmButton>\n </View>\n }\n}\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,IAAI,QAAQ,cAAc;AAC7C,OAAO,KAAKC,cAAc,MAAM,sBAAsB;AAEtD,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,+CAA+C;AAEjG,OAAOC,iBAAiB,MAAM,oBAAoB;AAClD,SAASC,aAAa,QAA4B,qBAAqB;AACvE,OAAOC,QAAQ,MAAM,oEAAoE;AACzF,SAASC,WAAW,QAAQ,sCAAsC;AAUlE,OAAO,MAAMC,iBAAiB,SAASL,kBAAkB,CAAoB;EAAAM,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA;EAAA;AAE7E;AAQA,MAAMC,eAAoC,GAAG;EAC3CC,oBAAoB,EAAE,KAAK;EAC3BC,QAAQ,EAAE,KAAK;EACfC,IAAI,EAAE;AACR,CAAC;AAED,eAAe,MAAMC,YAAY,SAASd,aAAa,CAA2D;EAEhHO,WAAWA,CAACQ,KAAwB,EAAE;IACpC,KAAK,CAACA,KAAK,EAAEZ,aAAa,EAAE,IAAID,iBAAiB,CAAC,CAAC,CAAC;EACtD;EAEAc,KAAKA,CAACD,KAAwB,EAAE;IAC9BL,eAAe,CAACG,IAAI,GAAGR,WAAW,CAACU,KAAK,CAACE,WAAW,CAAC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IAAI,CAACC,SAAS,CAAC,CAAE;MAACC,SAAS,EAAEjC,KAAK,CAACiC,SAAU;MAACC,OAAO,EAAElC,KAAK,CAACkC,OAAQ;MAACV,MAAM,EAAE,IAAI,CAACA,MAAM,CAACW,MAAO;MAACC,QAAQ,EAAEpC,KAAK,CAACoC,QAAS;MAACnC,KAAK,EAAEA,CAAA,KAAM,IAAI,CAACA,KAAK,CAACc,IAAI,CAAC,IAAI,CAAC,CAACf,KAAK;IAAE,GAAKiB,kBAAkB,CAAY,CACpN,CAAC;EACT;AACF","ignoreList":[]}
@@ -1,8 +1,2 @@
1
- import React from 'react';
2
-
3
- // * expo-calendar plugin
4
-
5
- const CalendarPluginContext = /*#__PURE__*/React.createContext(null);
6
- export const CalendarPluginProvider = CalendarPluginContext.Provider;
7
- export const CalendarPluginConsumer = CalendarPluginContext.Consumer;
1
+ export {};
8
2
  //# sourceMappingURL=calendar-service.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","CalendarPluginContext","createContext","CalendarPluginProvider","Provider","CalendarPluginConsumer","Consumer"],"sources":["calendar-service.ts"],"sourcesContent":["import { Input } from '@wavemaker/app-rn-runtime/variables/device/operation.provider';\nimport React from 'react';\n\nexport interface CalendarInput extends Input {\n eventTitle: string;\n eventLocation: string;\n eventNotes: string;\n eventStart: Date;\n eventEnd: Date;\n calendarPluginService: any;\n permissionService: any;\n}\n\nexport interface CalendarService {\n getEvents: (params: CalendarInput) => any;\n createEvent: (params: CalendarInput) => any;\n deleteEvent: (params: CalendarInput) => any;\n}\n\n// * expo-calendar plugin\nexport interface CalendarPluginService {\n getCalendarsAsync: any;\n getEventsAsync: any;\n createEventAsync: any;\n deleteEventAsync: any;\n}\nconst CalendarPluginContext = React.createContext<CalendarPluginService>(null as any);\n\nexport const CalendarPluginProvider = CalendarPluginContext.Provider;\nexport const CalendarPluginConsumer = CalendarPluginContext.Consumer;\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;;AAkBzB;;AAOA,MAAMC,qBAAqB,gBAAGD,KAAK,CAACE,aAAa,CAAwB,IAAW,CAAC;AAErF,OAAO,MAAMC,sBAAsB,GAAGF,qBAAqB,CAACG,QAAQ;AACpE,OAAO,MAAMC,sBAAsB,GAAGJ,qBAAqB,CAACK,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["calendar-service.ts"],"sourcesContent":["import { Input } from '@wavemaker/app-rn-runtime/variables/device/operation.provider';\n\nexport interface CalendarInput extends Input {\n eventTitle: string;\n eventLocation: string;\n eventNotes: string;\n eventStart: Date;\n eventEnd: Date;\n}\n\nexport interface CalendarService {\n getEvents: (params: CalendarInput) => any;\n createEvent: (params: CalendarInput) => any;\n deleteEvent: (params: CalendarInput) => any;\n}\n"],"mappings":"","ignoreList":[]}
@@ -2,10 +2,4 @@ import React from 'react';
2
2
  const CameraContext = /*#__PURE__*/React.createContext(null);
3
3
  export const CameraProvider = CameraContext.Provider;
4
4
  export const CameraConsumer = CameraContext.Consumer;
5
-
6
- // * expo-camera plugin
7
-
8
- const CameraPluginContext = /*#__PURE__*/React.createContext(null);
9
- export const CameraPluginProvider = CameraPluginContext.Provider;
10
- export const CameraPluginConsumer = CameraPluginContext.Consumer;
11
5
  //# sourceMappingURL=camera-service.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","CameraContext","createContext","CameraProvider","Provider","CameraConsumer","Consumer","CameraPluginContext","CameraPluginProvider","CameraPluginConsumer"],"sources":["camera-service.ts"],"sourcesContent":["import { Input } from '@wavemaker/app-rn-runtime/variables/device/operation.provider';\nimport React from 'react';\n\nexport interface CameraInput extends Input {\n allowImageEdit: boolean;\n imageQuality: number;\n imageEncodingType: string;\n imageTargetWidth: number;\n imageTargetHeight: number;\n permissionService: any;\n}\n\nexport interface CameraVideoInput {\n permissionService: any;\n}\n\nexport interface CameraService {\n captureImage: (params: CameraInput) => any\n captureVideo: (params: CameraVideoInput) => any;\n}\nconst CameraContext = React.createContext<CameraService>(null as any);\n\nexport const CameraProvider = CameraContext.Provider;\nexport const CameraConsumer = CameraContext.Consumer;\n\n// * expo-camera plugin\nexport interface CameraPluginService {\n CameraView: any;\n Video: any;\n fsReadAsString: (uri: any, params: any) => any;\n}\nconst CameraPluginContext = React.createContext<CameraPluginService>(null as any);\n\nexport const CameraPluginProvider = CameraPluginContext.Provider;\nexport const CameraPluginConsumer = CameraPluginContext.Consumer;\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;AAmBzB,MAAMC,aAAa,gBAAGD,KAAK,CAACE,aAAa,CAAgB,IAAW,CAAC;AAErE,OAAO,MAAMC,cAAc,GAAGF,aAAa,CAACG,QAAQ;AACpD,OAAO,MAAMC,cAAc,GAAGJ,aAAa,CAACK,QAAQ;;AAEpD;;AAMA,MAAMC,mBAAmB,gBAAGP,KAAK,CAACE,aAAa,CAAsB,IAAW,CAAC;AAEjF,OAAO,MAAMM,oBAAoB,GAAGD,mBAAmB,CAACH,QAAQ;AAChE,OAAO,MAAMK,oBAAoB,GAAGF,mBAAmB,CAACD,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["React","CameraContext","createContext","CameraProvider","Provider","CameraConsumer","Consumer"],"sources":["camera-service.ts"],"sourcesContent":["import { Input } from '@wavemaker/app-rn-runtime/variables/device/operation.provider';\nimport React from 'react';\n\nexport interface CameraInput extends Input {\n allowImageEdit: boolean;\n imageQuality: number;\n imageEncodingType: string;\n imageTargetWidth: number;\n imageTargetHeight: number;\n}\n\nexport interface CameraService {\n captureImage: (params: CameraInput) => any\n captureVideo: () => any;\n}\nconst CameraContext = React.createContext<CameraService>(null as any);\n\nexport const CameraProvider = CameraContext.Provider;\nexport const CameraConsumer = CameraContext.Consumer;\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;AAczB,MAAMC,aAAa,gBAAGD,KAAK,CAACE,aAAa,CAAgB,IAAW,CAAC;AAErE,OAAO,MAAMC,cAAc,GAAGF,aAAa,CAACG,QAAQ;AACpD,OAAO,MAAMC,cAAc,GAAGJ,aAAa,CAACK,QAAQ","ignoreList":[]}
@@ -1,8 +1,2 @@
1
- import React from 'react';
2
-
3
- // * expo-contacts plugin
4
-
5
- const ContactsPluginContext = /*#__PURE__*/React.createContext(null);
6
- export const ContactsPluginProvider = ContactsPluginContext.Provider;
7
- export const ContactsPluginConsumer = ContactsPluginContext.Consumer;
1
+ export {};
8
2
  //# sourceMappingURL=contacts-service.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","ContactsPluginContext","createContext","ContactsPluginProvider","Provider","ContactsPluginConsumer","Consumer"],"sources":["contacts-service.ts"],"sourcesContent":["import { Input } from '@wavemaker/app-rn-runtime/variables/device/operation.provider';\nimport React from 'react';\n\nexport interface ContactsInput extends Input {\n contactFilter: string;\n contactsPluginService: any;\n permissionService: any;\n}\n\nexport interface ContactsService {\n getContacts: (params: ContactsInput) => any;\n}\n\n// * expo-contacts plugin\nexport interface ContactsPluginService {\n Fields: any;\n getContactsAsync: any;\n}\nconst ContactsPluginContext = React.createContext<ContactsPluginService>(null as any);\n\nexport const ContactsPluginProvider = ContactsPluginContext.Provider;\nexport const ContactsPluginConsumer = ContactsPluginContext.Consumer;\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;;AAYzB;;AAKA,MAAMC,qBAAqB,gBAAGD,KAAK,CAACE,aAAa,CAAwB,IAAW,CAAC;AAErF,OAAO,MAAMC,sBAAsB,GAAGF,qBAAqB,CAACG,QAAQ;AACpE,OAAO,MAAMC,sBAAsB,GAAGJ,qBAAqB,CAACK,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["contacts-service.ts"],"sourcesContent":["import { Input } from '@wavemaker/app-rn-runtime/variables/device/operation.provider';\n\nexport interface ContactsInput extends Input {\n contactFilter: string;\n}\n\nexport interface ContactsService {\n getContacts: (params: ContactsInput) => any;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,8 +1,2 @@
1
- import React from "react";
2
-
3
- // * expo-location plugin
4
-
5
- const LocationPluginContext = /*#__PURE__*/React.createContext(null);
6
- export const LocationPluginProvider = LocationPluginContext.Provider;
7
- export const LocationPluginConsumer = LocationPluginContext.Consumer;
1
+ export {};
8
2
  //# sourceMappingURL=location-service.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","LocationPluginContext","createContext","LocationPluginProvider","Provider","LocationPluginConsumer","Consumer"],"sources":["location-service.ts"],"sourcesContent":["import {Input} from \"@wavemaker/app-rn-runtime/variables/device/operation.provider\";\nimport React from \"react\";\n\nexport interface GeoPositionInput extends Input {\n maximumAge: number;\n timeout: number;\n enableHighAccuracy: boolean;\n permissionService: any;\n locationPluginService: any;\n}\n\nexport interface LocationService {\n getCurrentGeoPosition: (params: GeoPositionInput) => any;\n}\n\n// * expo-location plugin\nexport interface LocationPluginService {}\nconst LocationPluginContext = React.createContext<LocationPluginService>(null as any);\n\nexport const LocationPluginProvider = LocationPluginContext.Provider;\nexport const LocationPluginConsumer = LocationPluginContext.Consumer;\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;;AAczB;;AAEA,MAAMC,qBAAqB,gBAAGD,KAAK,CAACE,aAAa,CAAwB,IAAW,CAAC;AAErF,OAAO,MAAMC,sBAAsB,GAAGF,qBAAqB,CAACG,QAAQ;AACpE,OAAO,MAAMC,sBAAsB,GAAGJ,qBAAqB,CAACK,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["location-service.ts"],"sourcesContent":["import {Input} from \"@wavemaker/app-rn-runtime/variables/device/operation.provider\";\n\nexport interface GeoPositionInput extends Input {\n maximumAge: number;\n timeout: number;\n enableHighAccuracy: boolean;\n}\n\nexport interface LocationService {\n getCurrentGeoPosition: (params: GeoPositionInput) => any;\n}\n"],"mappings":"","ignoreList":[]}
@@ -2,10 +2,4 @@ import React from 'react';
2
2
  const ScanContext = /*#__PURE__*/React.createContext(null);
3
3
  export const ScanProvider = ScanContext.Provider;
4
4
  export const ScanConsumer = ScanContext.Consumer;
5
-
6
- // * scan service plugin
7
-
8
- const ScanPluginContext = /*#__PURE__*/React.createContext(null);
9
- export const ScanPluginProvider = ScanPluginContext.Provider;
10
- export const ScanPluginConsumer = ScanPluginContext.Consumer;
11
5
  //# sourceMappingURL=scan-service.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","ScanContext","createContext","ScanProvider","Provider","ScanConsumer","Consumer","ScanPluginContext","ScanPluginProvider","ScanPluginConsumer"],"sources":["scan-service.ts"],"sourcesContent":["import {ScanInput} from \"@wavemaker/app-rn-runtime/variables/device/scan/scan.operation\";\nimport React from 'react';\n\nexport interface ScanService {\n scanBarcode: (params: ScanInput) => any;\n}\nconst ScanContext = React.createContext<ScanService>(null as any);\n\nexport const ScanProvider = ScanContext.Provider;\nexport const ScanConsumer = ScanContext.Consumer;\n\n// * scan service plugin\nexport interface ScanPluginService {\n CameraView: any;\n}\nconst ScanPluginContext = React.createContext<ScanPluginService>(null as any);\n\nexport const ScanPluginProvider = ScanPluginContext.Provider;\nexport const ScanPluginConsumer = ScanPluginContext.Consumer;\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;AAKzB,MAAMC,WAAW,gBAAGD,KAAK,CAACE,aAAa,CAAc,IAAW,CAAC;AAEjE,OAAO,MAAMC,YAAY,GAAGF,WAAW,CAACG,QAAQ;AAChD,OAAO,MAAMC,YAAY,GAAGJ,WAAW,CAACK,QAAQ;;AAEhD;;AAIA,MAAMC,iBAAiB,gBAAGP,KAAK,CAACE,aAAa,CAAoB,IAAW,CAAC;AAE7E,OAAO,MAAMM,kBAAkB,GAAGD,iBAAiB,CAACH,QAAQ;AAC5D,OAAO,MAAMK,kBAAkB,GAAGF,iBAAiB,CAACD,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["React","ScanContext","createContext","ScanProvider","Provider","ScanConsumer","Consumer"],"sources":["scan-service.ts"],"sourcesContent":["import {ScanInput} from \"@wavemaker/app-rn-runtime/variables/device/scan/scan.operation\";\nimport React from 'react';\n\nexport interface ScanService {\n scanBarcode: (params: ScanInput) => any;\n}\nconst ScanContext = React.createContext<ScanService>(null as any);\n\nexport const ScanProvider = ScanContext.Provider;\nexport const ScanConsumer = ScanContext.Consumer;\n"],"mappings":"AACA,OAAOA,KAAK,MAAM,OAAO;AAKzB,MAAMC,WAAW,gBAAGD,KAAK,CAACE,aAAa,CAAc,IAAW,CAAC;AAEjE,OAAO,MAAMC,YAAY,GAAGF,WAAW,CAACG,QAAQ;AAChD,OAAO,MAAMC,YAAY,GAAGJ,WAAW,CAACK,QAAQ","ignoreList":[]}
package/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
  import * as mime from 'react-native-mime-types';
5
6
  import ThemeVariables from '../styles/theme.variables';
@@ -328,6 +329,11 @@ export const formatCompactNumber = number => {
328
329
  }
329
330
  return (isNegative ? '-' : '') + formattedNumber;
330
331
  };
332
+ export const toBase64 = function (path) {
333
+ return FileSystem.readAsStringAsync(path, {
334
+ encoding: 'base64'
335
+ });
336
+ };
331
337
  const DATASET_WIDGETS = new Set(['select', 'checkboxset', 'radioset', 'switch', 'autocomplete', 'chips', 'typeahead', 'rating']);
332
338
  export const isDataSetWidget = widget => {
333
339
  return DATASET_WIDGETS.has(widget);