@wavemaker/app-rn-runtime 11.7.2-rc.5607 → 11.7.2-rc.5608
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.
|
@@ -7,6 +7,7 @@ export default class WmFormProps extends BaseProps {
|
|
|
7
7
|
super(...arguments);
|
|
8
8
|
_defineProperty(this, "children", void 0);
|
|
9
9
|
_defineProperty(this, "dataoutput", void 0);
|
|
10
|
+
_defineProperty(this, "onBeforeservicecall", void 0);
|
|
10
11
|
_defineProperty(this, "onBeforesubmit", void 0);
|
|
11
12
|
_defineProperty(this, "formdata", void 0);
|
|
12
13
|
_defineProperty(this, "parentForm", '');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseProps","WmFormProps","constructor","arguments","_defineProperty","metadata"],"sources":["form.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmFormProps extends BaseProps {\n children: any;\n dataoutput: any;\n onBeforesubmit: any;\n formdata: any;\n parentForm: string = '';\n metadata: any;\n title: any;\n subheading: any;\n iconclass: any;\n postmessage: string = 'Data posted successfully';\n errormessage: string = 'An error occured. Please try again!';\n messagelayout: string = 'Inline';\n formSubmit: Function = () => {};\n formSuccess: Function = () => {};\n relatedData: Function = () => {};\n onSuccess: Function = () => {};\n onError: Function = () => {};\n onBeforerender: Function = () => {};\n generateComponent: Function = (metadata:any) => {};\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,WAAW,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,
|
|
1
|
+
{"version":3,"names":["BaseProps","WmFormProps","constructor","arguments","_defineProperty","metadata"],"sources":["form.props.ts"],"sourcesContent":["import { BaseProps } from '@wavemaker/app-rn-runtime/core/base.component';\n\nexport default class WmFormProps extends BaseProps {\n children: any;\n dataoutput: any;\n onBeforeservicecall: any;\n onBeforesubmit: any;\n formdata: any;\n parentForm: string = '';\n metadata: any;\n title: any;\n subheading: any;\n iconclass: any;\n postmessage: string = 'Data posted successfully';\n errormessage: string = 'An error occured. Please try again!';\n messagelayout: string = 'Inline';\n formSubmit: Function = () => {};\n formSuccess: Function = () => {};\n relatedData: Function = () => {};\n onSuccess: Function = () => {};\n onError: Function = () => {};\n onBeforerender: Function = () => {};\n generateComponent: Function = (metadata:any) => {};\n}\n"],"mappings":";;;AAAA,SAASA,SAAS,QAAQ,+CAA+C;AAEzE,eAAe,MAAMC,WAAW,SAASD,SAAS,CAAC;EAAAE,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,qBAM5B,EAAE;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,sBAKD,0BAA0B;IAAAA,eAAA,uBACzB,qCAAqC;IAAAA,eAAA,wBACpC,QAAQ;IAAAA,eAAA,qBACT,MAAM,CAAC,CAAC;IAAAA,eAAA,sBACP,MAAM,CAAC,CAAC;IAAAA,eAAA,sBACR,MAAM,CAAC,CAAC;IAAAA,eAAA,oBACV,MAAM,CAAC,CAAC;IAAAA,eAAA,kBACV,MAAM,CAAC,CAAC;IAAAA,eAAA,yBACD,MAAM,CAAC,CAAC;IAAAA,eAAA,4BACJC,QAAY,IAAK,CAAC,CAAC;EAAA;AACpD"}
|
|
@@ -70,8 +70,8 @@ export default class WmLiveForm extends WmForm {
|
|
|
70
70
|
if (!this.validateFieldsOnSubmit()) {
|
|
71
71
|
return false;
|
|
72
72
|
}
|
|
73
|
-
if (this.props.
|
|
74
|
-
this.invokeEventCallback('
|
|
73
|
+
if (this.props.onBeforeservicecall) {
|
|
74
|
+
this.invokeEventCallback('onBeforeservicecall', [null, this.proxy, formData]);
|
|
75
75
|
}
|
|
76
76
|
if (this.props.formSubmit) {
|
|
77
77
|
this.props.formSubmit({
|
|
@@ -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","
|
|
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","proxy","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, this.proxy, formData ]);\n }\n if (this.props.formSubmit) {\n this.props.formSubmit({inputFields: formData}, operationType, ((data: any) => {\n this.invokeEventCallback('onSubmit', [ null, this.proxy, formData ]);\n this.onResultCb(get(data, 'params'), 'success');\n }), ((error: any) => {\n this.invokeEventCallback('onSubmit', [ null, this.proxy, formData ]);\n this.onResultCb(error, '');\n }));\n } else {\n this.invokeEventCallback('onSubmit', [ null, this.proxy, formData ]);\n }\n }\n\n onResultCb(response: any, status: string, event?: any) {\n this.invokeEventCallback('onResult', [ null, this.proxy, response ]);\n if (status) {\n this.invokeEventCallback('onSuccess', [ null, this.proxy, 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, this.proxy, response ]);\n !this.props.onError && this.toggleMessage('error', this.state.props.errormessage || get(response, 'message') || response);\n }\n }\n\n}\n"],"mapp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AAQ,CAAC;IAC3H;EACF;AAEF"}
|
app-rn-runtime/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavemaker/app-rn-runtime",
|
|
3
|
-
"version": "11.7.2-rc.
|
|
3
|
+
"version": "11.7.2-rc.5608",
|
|
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.2-rc.
|
|
52
|
+
"@wavemaker/variables": "11.7.2-rc.5608",
|
|
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.2-rc.
|
|
134
|
+
"@wavemaker/variables": "11.7.2-rc.5608"
|
|
135
135
|
},
|
|
136
136
|
"jest": {
|
|
137
137
|
"preset": "react-native",
|