@gisce/react-ooui 1.2.0-rc.22 → 1.2.0-rc.23
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/dist/helpers/formHelper.d.ts +2 -1
- package/dist/helpers/formHelper.d.ts.map +1 -1
- package/dist/react-ooui.es.js +1161 -1143
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +10 -10
- package/dist/react-ooui.umd.js.map +1 -1
- package/dist/widgets/views/Form.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/helpers/formHelper.ts +21 -2
- package/src/widgets/views/Form.tsx +13 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["Form.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAiCf,OAAO,EAAE,QAAQ,EAAgB,MAAM,SAAS,CAAC;AAiBjD,oBAAY,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC9B,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IACxE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,G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C,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB,CAAC;;AA89BF,wBAAgC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gisce/react-ooui",
|
|
3
|
-
"version": "1.2.0-rc.
|
|
3
|
+
"version": "1.2.0-rc.23",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"src",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@ant-design/plots": "^1.0.9",
|
|
39
|
-
"@gisce/ooui": "^0.17.
|
|
39
|
+
"@gisce/ooui": "^0.17.12-rc.0",
|
|
40
40
|
"@gisce/react-formiga-components": "^1.0.9-rc.14",
|
|
41
41
|
"@gisce/react-formiga-table": "^0.5.0",
|
|
42
42
|
"@monaco-editor/react": "^4.4.5",
|
|
@@ -152,16 +152,35 @@ export const getValuesForDomain = (domain: any[]) => {
|
|
|
152
152
|
export const getOnChangePayload = ({
|
|
153
153
|
onChangeFieldActionArgs,
|
|
154
154
|
values,
|
|
155
|
+
parentValues = {},
|
|
155
156
|
}: {
|
|
156
157
|
onChangeFieldActionArgs: any[];
|
|
157
158
|
values: any;
|
|
159
|
+
parentValues?: any;
|
|
158
160
|
}) => {
|
|
159
161
|
const payload: any = {};
|
|
160
162
|
onChangeFieldActionArgs.forEach((arg: string) => {
|
|
161
|
-
|
|
163
|
+
const splittedArg = arg.split("");
|
|
164
|
+
|
|
165
|
+
if (arg === "True") {
|
|
166
|
+
payload[arg] = true;
|
|
167
|
+
} else if (arg === "False") {
|
|
168
|
+
payload[arg] = false;
|
|
169
|
+
} else if (values[arg]) {
|
|
162
170
|
payload[arg] = values[arg];
|
|
163
|
-
} else if (
|
|
171
|
+
} else if (
|
|
172
|
+
splittedArg[0] === "'" &&
|
|
173
|
+
splittedArg[splittedArg.length - 1] === "'" &&
|
|
174
|
+
splittedArg.filter((i: string) => i === "'").length === 2
|
|
175
|
+
) {
|
|
164
176
|
payload[arg] = arg.replace(/'/g, "");
|
|
177
|
+
} else if (splittedArg.includes("'")) {
|
|
178
|
+
// This is a string with a variable in it.
|
|
179
|
+
// TODO: pending implement.
|
|
180
|
+
payload[arg] = arg;
|
|
181
|
+
} else if (arg.indexOf("parent.") !== -1) {
|
|
182
|
+
const parentKey = arg.replace("parent.", "");
|
|
183
|
+
payload[arg] = parentValues[parentKey] || false;
|
|
165
184
|
} else {
|
|
166
185
|
payload[arg] = false;
|
|
167
186
|
}
|
|
@@ -126,7 +126,8 @@ function Form(props: FormProps, ref: any) {
|
|
|
126
126
|
const responsiveBehaviour = containerWidth < WIDTH_BREAKPOINT;
|
|
127
127
|
|
|
128
128
|
const formContext = useContext(FormContext) as FormContextType;
|
|
129
|
-
const { activeId: parentId } =
|
|
129
|
+
const { activeId: parentId, getPlainValues: getParentPlainValues } =
|
|
130
|
+
formContext || {};
|
|
130
131
|
|
|
131
132
|
const actionViewContext = useContext(
|
|
132
133
|
ActionViewContext
|
|
@@ -398,13 +399,11 @@ function Form(props: FormProps, ref: any) {
|
|
|
398
399
|
if (valuesProps) {
|
|
399
400
|
values = valuesProps;
|
|
400
401
|
} else {
|
|
401
|
-
({
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
arch: _arch!,
|
|
407
|
-
}));
|
|
402
|
+
({ values, defaultGetCalled: hasDefaultGetCalled } =
|
|
403
|
+
await fetchValuesFromApi({
|
|
404
|
+
fields: _fields,
|
|
405
|
+
arch: _arch!,
|
|
406
|
+
}));
|
|
408
407
|
}
|
|
409
408
|
|
|
410
409
|
if (actionDomain) {
|
|
@@ -455,15 +454,13 @@ function Form(props: FormProps, ref: any) {
|
|
|
455
454
|
|
|
456
455
|
const getFormView = async (): Promise<FormView> => {
|
|
457
456
|
if (getDataFromAction) {
|
|
458
|
-
const action =
|
|
459
|
-
model
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
{
|
|
457
|
+
const action =
|
|
458
|
+
await ConnectionProvider.getHandler().getActionStringForModel(model);
|
|
459
|
+
const viewsForAction =
|
|
460
|
+
await ConnectionProvider.getHandler().getViewsForAction({
|
|
463
461
|
action,
|
|
464
462
|
context: parentContext,
|
|
465
|
-
}
|
|
466
|
-
);
|
|
463
|
+
});
|
|
467
464
|
return viewsForAction.views.get("form");
|
|
468
465
|
}
|
|
469
466
|
|
|
@@ -756,6 +753,7 @@ function Form(props: FormProps, ref: any) {
|
|
|
756
753
|
...formOoui?.context,
|
|
757
754
|
},
|
|
758
755
|
},
|
|
756
|
+
parentValues: getParentPlainValues?.(),
|
|
759
757
|
onChangeFieldActionArgs: onChangeFieldAction.args,
|
|
760
758
|
});
|
|
761
759
|
|