@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.
- package/components/basic/audio/audio.component.js +47 -52
- package/components/basic/audio/audio.component.js.map +1 -1
- package/components/basic/video/video.component.js +64 -89
- package/components/basic/video/video.component.js.map +1 -1
- package/components/device/barcodescanner/barcodescanner.component.js +18 -26
- package/components/device/barcodescanner/barcodescanner.component.js.map +1 -1
- package/components/device/camera/camera.component.js +19 -28
- package/components/device/camera/camera.component.js.map +1 -1
- package/components/input/fileupload/fileupload.component.js +13 -17
- package/components/input/fileupload/fileupload.component.js.map +1 -1
- package/core/device/calendar-service.js +1 -7
- package/core/device/calendar-service.js.map +1 -1
- package/core/device/camera-service.js +0 -6
- package/core/device/camera-service.js.map +1 -1
- package/core/device/contacts-service.js +1 -7
- package/core/device/contacts-service.js.map +1 -1
- package/core/device/location-service.js +1 -7
- package/core/device/location-service.js.map +1 -1
- package/core/device/scan-service.js +0 -6
- package/core/device/scan-service.js.map +1 -1
- package/core/utils.js +6 -0
- package/core/utils.js.map +1 -1
- package/npm-shrinkwrap.json +27 -27
- package/package-lock.json +27 -27
- package/package.json +2 -2
- package/runtime/services/device/calendar-service.js +5 -9
- package/runtime/services/device/calendar-service.js.map +1 -1
- package/runtime/services/device/camera-service.js +22 -39
- package/runtime/services/device/camera-service.js.map +1 -1
- package/runtime/services/device/contacts-service.js +5 -6
- package/runtime/services/device/contacts-service.js.map +1 -1
- package/runtime/services/device/location-service.js +4 -4
- package/runtime/services/device/location-service.js.map +1 -1
- package/runtime/services/device/permissions.js +39 -34
- package/runtime/services/device/permissions.js.map +1 -1
- package/runtime/services/device/scan-service.js +3 -4
- package/runtime/services/device/scan-service.js.map +1 -1
- package/variables/device/calendar/create-event.operation.js +1 -12
- package/variables/device/calendar/create-event.operation.js.map +1 -1
- package/variables/device/calendar/delete-event.operation.js +1 -12
- package/variables/device/calendar/delete-event.operation.js.map +1 -1
- package/variables/device/calendar/get-events.operation.js +1 -12
- package/variables/device/calendar/get-events.operation.js.map +1 -1
- package/variables/device/camera/capture-image.operation.js +1 -8
- package/variables/device/camera/capture-image.operation.js.map +1 -1
- package/variables/device/camera/capture-video.operation.js +1 -7
- package/variables/device/camera/capture-video.operation.js.map +1 -1
- package/variables/device/contacts/get-contacts.operation.js +1 -12
- package/variables/device/contacts/get-contacts.operation.js.map +1 -1
- package/variables/device/device/current-geo-position.operation.js +1 -12
- package/variables/device/device/current-geo-position.operation.js.map +1 -1
- package/variables/device/file/upload-file.operation.js +3 -17
- package/variables/device/file/upload-file.operation.js.map +1 -1
- package/variables/device/scan/scan.operation.js +1 -12
- package/variables/device/scan/scan.operation.js.map +1 -1
- package/core/device/av-service.js +0 -8
- package/core/device/av-service.js.map +0 -1
- package/core/device/fileupload-service.js +0 -8
- package/core/device/fileupload-service.js.map +0 -1
- package/runtime/services/device/permission-service.js +0 -5
- package/runtime/services/device/permission-service.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","View","BaseComponent","BaseComponentState","ScanConsumer","
|
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,yBAAy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,EAAGC,KAAK,IAAK,IAAI,CAACC,YAAY,CAACD,KAAK;MAAE,GAAKb,kBAAkB,GACxG,IAAI,CAACe,WAAW,eACjB3C,KAAA,CAAAkC,aAAA,CAAC3B,QAAQ;QAACqC,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,QAAQ,CAAE;QAACC,SAAS,EAAEnC,KAAK,CAACmC,SAAU;QAACR,MAAM,EAAE,IAAI,CAACA,MAAM,CAACS,MAAO;QAACC,KAAK,EAAE,IAAI,CAACnC,SAAS,CAACoC,IAAI,CAAC,IAAI,CAAE;QAAClB,OAAO,EAAEpB,KAAK,CAACoB,OAAQ;QAACmB,QAAQ,EAAEvC,KAAK,CAACuC,QAAS;QAACpB,kBAAkB,EAAEnB,KAAK,CAACmB,kBAAmB;QAACG,IAAI,EAAEtB,KAAK,CAACsB,IAAK;QAACD,iBAAiB,EAAErB,KAAK,CAACqB;MAAkB,CAAW,CACtS,CAAC;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
|
-
|
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(
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
this.
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
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","
|
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;AA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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
|
-
|
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(
|
55
|
-
this.
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
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","
|
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,O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ext = /*#__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":[
|
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"
|
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
|
-
|
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":[
|
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
|
-
|
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":[
|
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"
|
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);
|