@wavemaker/app-rn-runtime 11.7.5-next.NULL → 11.7.5-rc.166
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/components/data/form/form.styles.js +1 -1
- app-rn-runtime/components/data/form/form.styles.js.map +1 -1
- app-rn-runtime/components/data/liveform/liveform.component.js +7 -11
- app-rn-runtime/components/data/liveform/liveform.component.js.map +1 -1
- app-rn-runtime/components/input/fileupload/fileupload.component.js +2 -2
- app-rn-runtime/components/input/fileupload/fileupload.component.js.map +1 -1
- app-rn-runtime/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","text","heading","paddingTop","paddingBottom","paddingLeft","paddingRight","borderBottomWidth","borderStyle","borderColor","formBorderColor","title","fontSize","heading4FontSize","color","formTitleColor","fontWeight","subheading","lineHeight","formSubTitleColor","listIcon","marginRight","marginLeft"],"sources":["form.styles.ts"],"sourcesContent":["import BASE_THEME, {AllStyle} from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {WmLabelStyles} from \"@wavemaker/app-rn-runtime/components/basic/label/label.styles\";\nimport ThemeVariables from \"@wavemaker/app-rn-runtime/styles/theme.variables\";\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\n\nexport type WmFormStyles = BaseStyles & {\n heading: AllStyle,\n title: WmLabelStyles,\n listIcon: WmIconStyles,\n subheading: WmLabelStyles\n};\n\nexport const DEFAULT_CLASS = 'app-form';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmFormStyles = defineStyles({\n root: {},\n text: {},\n heading : {\n paddingTop: 12,\n paddingBottom: 12,\n paddingLeft: 0,\n paddingRight: 0,\n borderBottomWidth: 0,\n borderStyle: 'solid',\n borderColor: themeVariables.formBorderColor\n },\n title: {\n text: {\n fontSize: themeVariables.heading4FontSize,\n color: themeVariables.formTitleColor,\n fontWeight: 'bold'\n }\n } as WmLabelStyles,\n subheading: {\n text: {\n fontSize: 12,\n lineHeight: 18,\n color: themeVariables.formSubTitleColor\n }\n } as WmLabelStyles,\n listIcon: {\n root: {\n fontSize:
|
|
1
|
+
{"version":3,"names":["BASE_THEME","defineStyles","DEFAULT_CLASS","registerStyle","themeVariables","addStyle","defaultStyles","root","text","heading","paddingTop","paddingBottom","paddingLeft","paddingRight","borderBottomWidth","borderStyle","borderColor","formBorderColor","title","fontSize","heading4FontSize","color","formTitleColor","fontWeight","subheading","lineHeight","formSubTitleColor","listIcon","marginRight","marginLeft"],"sources":["form.styles.ts"],"sourcesContent":["import BASE_THEME, {AllStyle} from '@wavemaker/app-rn-runtime/styles/theme';\nimport { BaseStyles, defineStyles } from '@wavemaker/app-rn-runtime/core/base.component';\nimport {WmLabelStyles} from \"@wavemaker/app-rn-runtime/components/basic/label/label.styles\";\nimport ThemeVariables from \"@wavemaker/app-rn-runtime/styles/theme.variables\";\nimport { WmIconStyles } from '@wavemaker/app-rn-runtime/components/basic/icon/icon.styles';\n\nexport type WmFormStyles = BaseStyles & {\n heading: AllStyle,\n title: WmLabelStyles,\n listIcon: WmIconStyles,\n subheading: WmLabelStyles\n};\n\nexport const DEFAULT_CLASS = 'app-form';\nBASE_THEME.registerStyle((themeVariables, addStyle) => {\n const defaultStyles: WmFormStyles = defineStyles({\n root: {},\n text: {},\n heading : {\n paddingTop: 12,\n paddingBottom: 12,\n paddingLeft: 0,\n paddingRight: 0,\n borderBottomWidth: 0,\n borderStyle: 'solid',\n borderColor: themeVariables.formBorderColor\n },\n title: {\n text: {\n fontSize: themeVariables.heading4FontSize,\n color: themeVariables.formTitleColor,\n fontWeight: 'bold'\n }\n } as WmLabelStyles,\n subheading: {\n text: {\n fontSize: 12,\n lineHeight: 18,\n color: themeVariables.formSubTitleColor\n }\n } as WmLabelStyles,\n listIcon: {\n root: {\n fontSize: 18,\n marginRight: 8\n }\n } as WmIconStyles,\n });\n\n addStyle(DEFAULT_CLASS, '', defaultStyles);\n addStyle('form-action', '', {\n root: {\n marginLeft: 12\n }\n } as BaseStyles);\n});\n"],"mappings":"AAAA,OAAOA,UAAU,MAAkB,wCAAwC;AAC3E,SAAqBC,YAAY,QAAQ,+CAA+C;AAYxF,OAAO,MAAMC,aAAa,GAAG,UAAU;AACvCF,UAAU,CAACG,aAAa,CAAC,CAACC,cAAc,EAAEC,QAAQ,KAAK;EACrD,MAAMC,aAA2B,GAAGL,YAAY,CAAC;IAC/CM,IAAI,EAAE,CAAC,CAAC;IACRC,IAAI,EAAE,CAAC,CAAC;IACRC,OAAO,EAAG;MACRC,UAAU,EAAE,EAAE;MACdC,aAAa,EAAE,EAAE;MACjBC,WAAW,EAAE,CAAC;MACdC,YAAY,EAAE,CAAC;MACfC,iBAAiB,EAAE,CAAC;MACpBC,WAAW,EAAE,OAAO;MACpBC,WAAW,EAAEZ,cAAc,CAACa;IAC9B,CAAC;IACDC,KAAK,EAAE;MACLV,IAAI,EAAE;QACJW,QAAQ,EAAEf,cAAc,CAACgB,gBAAgB;QACzCC,KAAK,EAAEjB,cAAc,CAACkB,cAAc;QACpCC,UAAU,EAAE;MACd;IACF,CAAkB;IAClBC,UAAU,EAAE;MACVhB,IAAI,EAAE;QACJW,QAAQ,EAAE,EAAE;QACZM,UAAU,EAAE,EAAE;QACdJ,KAAK,EAAEjB,cAAc,CAACsB;MACxB;IACF,CAAkB;IAClBC,QAAQ,EAAE;MACRpB,IAAI,EAAE;QACJY,QAAQ,EAAE,EAAE;QACZS,WAAW,EAAE;MACf;IACF;EACF,CAAC,CAAC;EAEFvB,QAAQ,CAACH,aAAa,EAAE,EAAE,EAAEI,aAAa,CAAC;EAC1CD,QAAQ,CAAC,aAAa,EAAE,EAAE,EAAE;IAC1BE,IAAI,EAAE;MACJsB,UAAU,EAAE;IACd;EACF,CAAe,CAAC;AAClB,CAAC,CAAC"}
|
|
@@ -71,30 +71,26 @@ export default class WmLiveForm extends WmForm {
|
|
|
71
71
|
return false;
|
|
72
72
|
}
|
|
73
73
|
if (this.props.onBeforeservicecall) {
|
|
74
|
-
this.invokeEventCallback('onBeforeservicecall', [null,
|
|
74
|
+
this.invokeEventCallback('onBeforeservicecall', [null, operationType, formData]);
|
|
75
75
|
}
|
|
76
76
|
if (this.props.formSubmit) {
|
|
77
77
|
this.props.formSubmit({
|
|
78
78
|
inputFields: formData
|
|
79
79
|
}, operationType, data => {
|
|
80
|
-
this.
|
|
81
|
-
this.onResultCb(get(data, 'params'), 'success');
|
|
80
|
+
this.onResultCb(data, 'success', operationType);
|
|
82
81
|
}, error => {
|
|
83
|
-
this.
|
|
84
|
-
this.onResultCb(error, '');
|
|
82
|
+
this.onResultCb(error, '', operationType);
|
|
85
83
|
});
|
|
86
|
-
} else {
|
|
87
|
-
this.invokeEventCallback('onSubmit', [null, this.proxy, formData]);
|
|
88
84
|
}
|
|
89
85
|
}
|
|
90
|
-
onResultCb(response, status, event) {
|
|
91
|
-
this.invokeEventCallback('onResult', [null,
|
|
86
|
+
onResultCb(response, status, operationType, event) {
|
|
87
|
+
this.invokeEventCallback('onResult', [null, operationType, response]);
|
|
92
88
|
if (status) {
|
|
93
|
-
this.invokeEventCallback('onSuccess', [null,
|
|
89
|
+
this.invokeEventCallback('onSuccess', [null, operationType, response]);
|
|
94
90
|
this.props.formSuccess && this.props.formSuccess();
|
|
95
91
|
!this.props.onSuccess && this.state.props.postmessage && this.toggleMessage('success', this.state.props.postmessage);
|
|
96
92
|
} else {
|
|
97
|
-
this.invokeEventCallback('onError', [null,
|
|
93
|
+
this.invokeEventCallback('onError', [null, operationType, response]);
|
|
98
94
|
!this.props.onError && this.toggleMessage('error', this.state.props.errormessage || get(response, 'message') || response);
|
|
99
95
|
}
|
|
100
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseComponentState","forEach","isEmpty","some","get","WmForm","WmFormState","constructor","arguments","_defineProperty","Live_Operations","INSERT","UPDATE","DELETE","READ","WmLiveForm","findOperationType","operation","isPrimary","primaryKey","state","props","formdata","length","value","handleSubmit","event","preventDefault","formData","dataoutput","formdataoutput","operationType","validateFieldsOnSubmit","onBeforeservicecall","invokeEventCallback","
|
|
1
|
+
{"version":3,"names":["BaseComponentState","forEach","isEmpty","some","get","WmForm","WmFormState","constructor","arguments","_defineProperty","Live_Operations","INSERT","UPDATE","DELETE","READ","WmLiveForm","findOperationType","operation","isPrimary","primaryKey","state","props","formdata","length","value","handleSubmit","event","preventDefault","formData","dataoutput","formdataoutput","operationType","validateFieldsOnSubmit","onBeforeservicecall","invokeEventCallback","formSubmit","inputFields","data","onResultCb","error","response","status","formSuccess","onSuccess","postmessage","toggleMessage","onError","errormessage"],"sources":["liveform.component.tsx"],"sourcesContent":["import { BaseComponentState } from '@wavemaker/app-rn-runtime/core/base.component';\nimport { forEach, isEmpty, some, get } from 'lodash';\n\nimport WmFormProps from '../form/form.props';\nimport WmForm from '@wavemaker/app-rn-runtime/components/data/form/form.component';\n\nexport class WmFormState extends BaseComponentState<WmFormProps> {\n isValid = false;\n type: 'success' | 'warning' | 'error' | 'info' | 'loading' | undefined = 'success';\n message: string = '';\n showInlineMsg: boolean = false;\n}\nconst Live_Operations = {\n INSERT : 'insert',\n UPDATE : 'update',\n DELETE : 'delete',\n READ : 'read'\n}\n\nexport default class WmLiveForm extends WmForm {\n\n findOperationType() {\n let operation;\n let isPrimary = false;\n // const sourceOperation = this.form.datasource && this.form.datasource.execute(DataSource.Operation.GET_OPERATION_TYPE);\n // if (sourceOperation && sourceOperation !== 'read') {\n // return sourceOperation;\n // }\n /*If OperationType is not set then based on the formdata object return the operation type,\n this case occurs only if the form is outside a livegrid*/\n /*If the formdata object has primary key value then return update else insert*/\n if (this.primaryKey && !isEmpty(this.state.props.formdata)) {\n /*If only one column is primary key*/\n if (this.primaryKey.length === 1) {\n if (this.state.props.formdata[this.primaryKey[0]]) {\n operation = Live_Operations.UPDATE;\n }\n /*If only no column is primary key*/\n } else if (this.primaryKey.length === 0) {\n forEach(this.state.props.formdata, (value) => {\n if (value) {\n isPrimary = true;\n }\n });\n if (isPrimary) {\n operation = Live_Operations.UPDATE;\n }\n /*If multiple columns are primary key*/\n } else {\n // @ts-ignore\n isPrimary = some(this.primaryKey, (primaryKey: any) => {\n if (this.state.props.formdata[primaryKey]) {\n return true;\n }\n });\n if (isPrimary) {\n operation = Live_Operations.UPDATE;\n }\n }\n }\n return operation || Live_Operations.INSERT;\n }\n\n // @ts-ignore\n handleSubmit(event?: any) {\n event?.preventDefault();\n const formData = this.state.props.dataoutput || this.formdataoutput;\n const operationType = this.findOperationType();\n\n if (!this.validateFieldsOnSubmit()) {\n return false;\n }\n if (this.props.onBeforeservicecall) {\n this.invokeEventCallback('onBeforeservicecall', [ null, operationType, formData ]);\n }\n if (this.props.formSubmit) {\n this.props.formSubmit({inputFields: formData}, operationType, ((data: any) => {\n this.onResultCb(data, 'success', operationType);\n }), ((error: any) => {\n this.onResultCb(error, '', operationType);\n }));\n }\n }\n\n onResultCb(response: any, status: string, operationType: string, event?: any) {\n this.invokeEventCallback('onResult', [ null, operationType, response ]);\n if (status) {\n this.invokeEventCallback('onSuccess', [ null, operationType, response ]);\n this.props.formSuccess && this.props.formSuccess();\n !this.props.onSuccess && this.state.props.postmessage && this.toggleMessage('success', this.state.props.postmessage);\n } else {\n this.invokeEventCallback('onError', [ null, operationType, response ]);\n !this.props.onError && this.toggleMessage('error', this.state.props.errormessage || get(response, 'message') || response);\n }\n }\n\n}\n"],"mappings":";;;AAAA,SAASA,kBAAkB,QAAQ,+CAA+C;AAClF,SAASC,OAAO,EAAEC,OAAO,EAAEC,IAAI,EAAEC,GAAG,QAAQ,QAAQ;AAGpD,OAAOC,MAAM,MAAM,+DAA+D;AAElF,OAAO,MAAMC,WAAW,SAASN,kBAAkB,CAAc;EAAAO,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA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H,aAAa,EAAES,QAAQ,CAAE,CAAC;MACxE,IAAI,CAACnB,KAAK,CAACqB,WAAW,IAAI,IAAI,CAACrB,KAAK,CAACqB,WAAW,CAAC,CAAC;MAClD,CAAC,IAAI,CAACrB,KAAK,CAACsB,SAAS,IAAI,IAAI,CAACvB,KAAK,CAACC,KAAK,CAACuB,WAAW,IAAI,IAAI,CAACC,aAAa,CAAC,SAAS,EAAE,IAAI,CAACzB,KAAK,CAACC,KAAK,CAACuB,WAAW,CAAC;IACtH,CAAC,MAAM;MACL,IAAI,CAACV,mBAAmB,CAAC,SAAS,EAAE,CAAE,IAAI,EAAEH,aAAa,EAAES,QAAQ,CAAE,CAAC;MACtE,CAAC,IAAI,CAACnB,KAAK,CAACyB,OAAO,IAAI,IAAI,CAACD,aAAa,CAAC,OAAO,EAAE,IAAI,CAACzB,KAAK,CAACC,KAAK,CAAC0B,YAAY,IAAI3C,GAAG,CAACoC,QAAQ,EAAE,SAAS,CAAC,IAAIA,QAAQ,CAAC;IAC3H;EACF;AAEF"}
|
|
@@ -27,10 +27,10 @@ export default class WmFileupload extends BaseComponent {
|
|
|
27
27
|
DocumentPicker.getDocumentAsync(namedParameters).then(response => {
|
|
28
28
|
let selectedFile;
|
|
29
29
|
if (Platform.OS !== 'web') {
|
|
30
|
-
selectedFile = response;
|
|
30
|
+
selectedFile = response.assets[0];
|
|
31
31
|
selectedFile.type = selectedFile.mimeType;
|
|
32
32
|
} else {
|
|
33
|
-
selectedFile = response.file;
|
|
33
|
+
selectedFile = [response.assets[0].file];
|
|
34
34
|
}
|
|
35
35
|
this.invokeEventCallback('onBeforeselect', [null, this.proxy, selectedFile]);
|
|
36
36
|
this.updateState({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","View","DocumentPicker","BaseComponent","BaseComponentState","WmFileuploadProps","DEFAULT_CLASS","WmButton","WmFileuploadState","constructor","arguments","_defineProperty","namedParameters","copyToCacheDirectory","multiple","type","WmFileupload","props","onTap","getDocumentAsync","then","response","selectedFile","OS","mimeType","file","invokeEventCallback","proxy","updateState","selectedFiles","bind","renderWidget","createElement","style","styles","root","_background","accessibilitylabel","caption","hint","id","getTestId","iconclass","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';\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\nconst namedParameters = {\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() {\n DocumentPicker.getDocumentAsync(namedParameters).then((response: any) => {\n let selectedFile;\n if (Platform.OS !== 'web') {\n selectedFile = response;\n selectedFile.type = selectedFile.mimeType;\n } else {\n selectedFile = response.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 return <View style={this.styles.root}>\n {this._background}\n <WmButton accessibilitylabel={props.accessibilitylabel || props.caption} hint = {props.hint} id={this.getTestId()} iconclass={props.iconclass} caption={props.caption} styles={this.styles.button} iconsize={props.iconsize} onTap={this.onTap.bind(this)}></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;AAUzF,OAAO,MAAMC,iBAAiB,SAASJ,kBAAkB,CAAoB;EAAAK,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;EAAA;AAE7E;AAEA,MAAMC,eAAe,GAAG;EACtBC,oBAAoB,EAAE,KAAK;EAC3BC,QAAQ,EAAE,KAAK;EACfC,IAAI,EAAE;AACR,CAAC;AAED,eAAe,MAAMC,YAAY,SAASb,aAAa,CAA2D;EAEhHM,WAAWA,CAACQ,KAAwB,EAAE;IACpC,KAAK,CAACA,KAAK,EAAEX,aAAa,EAAE,IAAID,iBAAiB,CAAC,CAAC,CAAC;EACtD;EAEAa,KAAKA,CAAA,EAAG;IACNhB,cAAc,CAACiB,gBAAgB,CAACP,eAAe,CAAC,CAACQ,IAAI,CAAEC,QAAa,IAAK;MACvE,IAAIC,YAAY;MAChB,IAAItB,QAAQ,CAACuB,EAAE,KAAK,KAAK,EAAE;QACzBD,YAAY,GAAGD,QAAQ;
|
|
1
|
+
{"version":3,"names":["React","Platform","View","DocumentPicker","BaseComponent","BaseComponentState","WmFileuploadProps","DEFAULT_CLASS","WmButton","WmFileuploadState","constructor","arguments","_defineProperty","namedParameters","copyToCacheDirectory","multiple","type","WmFileupload","props","onTap","getDocumentAsync","then","response","selectedFile","OS","assets","mimeType","file","invokeEventCallback","proxy","updateState","selectedFiles","bind","renderWidget","createElement","style","styles","root","_background","accessibilitylabel","caption","hint","id","getTestId","iconclass","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';\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\nconst namedParameters = {\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() {\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 return <View style={this.styles.root}>\n {this._background}\n <WmButton accessibilitylabel={props.accessibilitylabel || props.caption} hint = {props.hint} id={this.getTestId()} iconclass={props.iconclass} caption={props.caption} styles={this.styles.button} iconsize={props.iconsize} onTap={this.onTap.bind(this)}></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,OA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YAAYA,CAACf,KAAwB,EAAE;IACrC,oBAAOlB,KAAA,CAAAkC,aAAA,CAAChC,IAAI;MAACiC,KAAK,EAAE,IAAI,CAACC,MAAM,CAACC;IAAK,GAClC,IAAI,CAACC,WAAW,eACjBtC,KAAA,CAAAkC,aAAA,CAAC1B,QAAQ;MAAC+B,kBAAkB,EAAErB,KAAK,CAACqB,kBAAkB,IAAIrB,KAAK,CAACsB,OAAQ;MAACC,IAAI,EAAIvB,KAAK,CAACuB,IAAK;MAACC,EAAE,EAAE,IAAI,CAACC,SAAS,CAAC,CAAE;MAACC,SAAS,EAAE1B,KAAK,CAAC0B,SAAU;MAACJ,OAAO,EAAEtB,KAAK,CAACsB,OAAQ;MAACJ,MAAM,EAAE,IAAI,CAACA,MAAM,CAACS,MAAO;MAACC,QAAQ,EAAE5B,KAAK,CAAC4B,QAAS;MAAC3B,KAAK,EAAE,IAAI,CAACA,KAAK,CAACa,IAAI,CAAC,IAAI;IAAE,CAAW,CACjQ,CAAC;EACT;AACF"}
|
app-rn-runtime/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavemaker/app-rn-runtime",
|
|
3
|
-
"version": "11.7.5-
|
|
3
|
+
"version": "11.7.5-rc.166",
|
|
4
4
|
"description": "''",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"module": "index",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@react-navigation/native": "6.1.7",
|
|
50
50
|
"@react-navigation/stack": "^6.3.7",
|
|
51
51
|
"@types/lodash-es": "^4.17.6",
|
|
52
|
-
"@wavemaker/variables": "11.7.5-
|
|
52
|
+
"@wavemaker/variables": "11.7.5-rc.166",
|
|
53
53
|
"axios": "^1.4.0",
|
|
54
54
|
"color": "4.2.3",
|
|
55
55
|
"cross-env": "^5.2.0",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"typescript": "^5.1.3",
|
|
132
132
|
"victory-native": "36.6.11",
|
|
133
133
|
"yargs": "^16.2.0",
|
|
134
|
-
"@wavemaker/variables": "11.7.5-
|
|
134
|
+
"@wavemaker/variables": "11.7.5-rc.166"
|
|
135
135
|
},
|
|
136
136
|
"jest": {
|
|
137
137
|
"preset": "react-native",
|