@gisce/react-ooui 1.1.35-rc.0 → 1.1.35
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/actionbar/FormActionBar.d.ts.map +1 -1
- package/dist/context/ActionViewContext.d.ts +4 -1
- package/dist/context/ActionViewContext.d.ts.map +1 -1
- package/dist/context/FormContext.d.ts +4 -1
- package/dist/context/FormContext.d.ts.map +1 -1
- package/dist/react-ooui.es.js +112 -74
- package/dist/react-ooui.es.js.map +1 -1
- package/dist/react-ooui.umd.js +6 -6
- package/dist/react-ooui.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/actionbar/FormActionBar.tsx +44 -15
- package/src/context/ActionViewContext.tsx +1 -1
- package/src/context/FormContext.tsx +1 -1
- package/src/widgets/views/Form.tsx +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormActionBar.d.ts","sourceRoot":"","sources":["FormActionBar.tsx"],"names":[],"mappings":";AA0CA,iBAAS,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"FormActionBar.d.ts","sourceRoot":"","sources":["FormActionBar.tsx"],"names":[],"mappings":";AA0CA,iBAAS,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,sBAgbnD;AAmBD,eAAe,aAAa,CAAC"}
|
|
@@ -9,7 +9,10 @@ export declare type ActionViewContextType = {
|
|
|
9
9
|
setFormIsSaving?: (value: boolean) => void;
|
|
10
10
|
formHasChanges?: boolean;
|
|
11
11
|
setFormHasChanges?: (value: boolean) => void;
|
|
12
|
-
onFormSave?: () => Promise<
|
|
12
|
+
onFormSave?: () => Promise<{
|
|
13
|
+
succeed: boolean;
|
|
14
|
+
id: number;
|
|
15
|
+
}>;
|
|
13
16
|
formRef?: any;
|
|
14
17
|
searchTreeRef?: any;
|
|
15
18
|
onNewClicked: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionViewContext.d.ts","sourceRoot":"","sources":["ActionViewContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,oBAAY,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,IAAI,EAAE,CAAC;IACvB,WAAW,EAAE,IAAI,CAAC;IAClB,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"ActionViewContext.d.ts","sourceRoot":"","sources":["ActionViewContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,oBAAY,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,IAAI,EAAE,CAAC;IACvB,WAAW,EAAE,IAAI,CAAC;IAClB,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACrC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,MA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AA,MAAM,kBAAkB,UAAW,uBAAuB,KAAG,GA6I5D,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -19,7 +19,10 @@ export declare type FormContextType = {
|
|
|
19
19
|
domain: any[];
|
|
20
20
|
submitForm?: (options?: {
|
|
21
21
|
callOnSubmitSucceed?: boolean;
|
|
22
|
-
}) => Promise<
|
|
22
|
+
}) => Promise<{
|
|
23
|
+
succeed: boolean;
|
|
24
|
+
id: number;
|
|
25
|
+
}>;
|
|
23
26
|
fetchValues?: () => void;
|
|
24
27
|
formHasChanges?: () => boolean;
|
|
25
28
|
elementHasLostFocus?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormContext.d.ts","sourceRoot":"","sources":["FormContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAEhD,oBAAY,eAAe,GAAG;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACzC,mBAAmB,EAAE,CAAC,EACpB,IAAI,EACJ,MAAM,EACN,OAAO,GACR,EAAE;QACD,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,GAAG,CAAC;KACf,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB,UAAU,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/B,SAAS,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9B,cAAc,EAAE,MAAM;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC7C,SAAS,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;I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,EAAE;QACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC,CAAC;AAEF,eAAO,MAAM,WAAW,uCAAoD,CAAC;AAE7E,aAAK,iBAAiB,GAAG,eAAe,GAAG;IACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,YAAY,UAAW,iBAAiB,KAAG,GA2ChD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/dist/react-ooui.es.js
CHANGED
|
@@ -9774,8 +9774,8 @@ function require_stream_readable() {
|
|
|
9774
9774
|
J.pipesCount += 1, l("pipe count=%d opts=%j", J.pipesCount, O);
|
|
9775
9775
|
var ee = (!O || O.end !== !1) && P !== process.stdout && P !== process.stderr, Q = ee ? te : he;
|
|
9776
9776
|
J.endEmitted ? process.nextTick(Q) : X.once("end", Q), P.on("unpipe", ie);
|
|
9777
|
-
function ie(ge,
|
|
9778
|
-
l("onunpipe"), ge === X &&
|
|
9777
|
+
function ie(ge, fe) {
|
|
9778
|
+
l("onunpipe"), ge === X && fe && fe.hasUnpiped === !1 && (fe.hasUnpiped = !0, _e());
|
|
9779
9779
|
}
|
|
9780
9780
|
function te() {
|
|
9781
9781
|
l("onend"), P.end();
|
|
@@ -9784,26 +9784,26 @@ function require_stream_readable() {
|
|
|
9784
9784
|
P.on("drain", oe);
|
|
9785
9785
|
var se = !1;
|
|
9786
9786
|
function _e() {
|
|
9787
|
-
l("cleanup"), P.removeListener("close", me), P.removeListener("finish",
|
|
9787
|
+
l("cleanup"), P.removeListener("close", me), P.removeListener("finish", pe), P.removeListener("drain", oe), P.removeListener("error", ae), P.removeListener("unpipe", ie), X.removeListener("end", te), X.removeListener("end", he), X.removeListener("data", Ce), se = !0, J.awaitDrain && (!P._writableState || P._writableState.needDrain) && oe();
|
|
9788
9788
|
}
|
|
9789
9789
|
X.on("data", Ce);
|
|
9790
9790
|
function Ce(ge) {
|
|
9791
9791
|
l("ondata");
|
|
9792
|
-
var
|
|
9793
|
-
l("dest.write",
|
|
9792
|
+
var fe = P.write(ge);
|
|
9793
|
+
l("dest.write", fe), fe === !1 && ((J.pipesCount === 1 && J.pipes === P || J.pipesCount > 1 && Z(J.pipes, P) !== -1) && !se && (l("false write response, pause", J.awaitDrain), J.awaitDrain++), X.pause());
|
|
9794
9794
|
}
|
|
9795
9795
|
function ae(ge) {
|
|
9796
9796
|
l("onerror", ge), he(), P.removeListener("error", ae), t(P, "error") === 0 && C(P, ge);
|
|
9797
9797
|
}
|
|
9798
9798
|
F(P, "error", ae);
|
|
9799
9799
|
function me() {
|
|
9800
|
-
P.removeListener("finish",
|
|
9800
|
+
P.removeListener("finish", pe), he();
|
|
9801
9801
|
}
|
|
9802
9802
|
P.once("close", me);
|
|
9803
|
-
function
|
|
9803
|
+
function pe() {
|
|
9804
9804
|
l("onfinish"), P.removeListener("close", me), he();
|
|
9805
9805
|
}
|
|
9806
|
-
P.once("finish",
|
|
9806
|
+
P.once("finish", pe);
|
|
9807
9807
|
function he() {
|
|
9808
9808
|
l("unpipe"), X.unpipe(P);
|
|
9809
9809
|
}
|
|
@@ -13076,8 +13076,8 @@ const DEFAULT_SEARCH_LIMIT$1 = 80, useSearch = (e) => {
|
|
|
13076
13076
|
he === -1 ? y == null || y(0) : y == null || y(he);
|
|
13077
13077
|
} else
|
|
13078
13078
|
y == null || y(void 0);
|
|
13079
|
-
const
|
|
13080
|
-
W(
|
|
13079
|
+
const pe = await _e;
|
|
13080
|
+
W(pe), d == null || d(pe);
|
|
13081
13081
|
},
|
|
13082
13082
|
[
|
|
13083
13083
|
y,
|
|
@@ -13671,14 +13671,14 @@ function Form(e, t) {
|
|
|
13671
13671
|
elementHasLostFocus: !0
|
|
13672
13672
|
}), U(!1));
|
|
13673
13673
|
}, [K]);
|
|
13674
|
-
const
|
|
13674
|
+
const pe = (ne, re, ce) => {
|
|
13675
13675
|
Q == null || Q(!1), ee == null || ee(!1), o == null || o(ne, re, ce), ie == null || ie(ne);
|
|
13676
13676
|
}, he = () => {
|
|
13677
13677
|
ee == null || ee(!1), a == null || a();
|
|
13678
13678
|
}, ge = (ne) => {
|
|
13679
13679
|
ee == null || ee(!1), c == null || c(ne);
|
|
13680
13680
|
};
|
|
13681
|
-
function
|
|
13681
|
+
function fe() {
|
|
13682
13682
|
return n || B.current;
|
|
13683
13683
|
}
|
|
13684
13684
|
function Te() {
|
|
@@ -13717,15 +13717,15 @@ function Form(e, t) {
|
|
|
13717
13717
|
}
|
|
13718
13718
|
function ve() {
|
|
13719
13719
|
return {
|
|
13720
|
-
id:
|
|
13721
|
-
active_id:
|
|
13722
|
-
active_ids: [
|
|
13720
|
+
id: fe(),
|
|
13721
|
+
active_id: fe(),
|
|
13722
|
+
active_ids: [fe()],
|
|
13723
13723
|
parent_id: O,
|
|
13724
13724
|
...me
|
|
13725
13725
|
};
|
|
13726
13726
|
}
|
|
13727
13727
|
const we = async (ne) => {
|
|
13728
|
-
const re =
|
|
13728
|
+
const re = fe() ? M == null ? void 0 : M.context : {};
|
|
13729
13729
|
return await ConnectionProvider.getHandler().defaultGet({
|
|
13730
13730
|
model: r,
|
|
13731
13731
|
fields: ne,
|
|
@@ -13849,15 +13849,15 @@ function Form(e, t) {
|
|
|
13849
13849
|
arch: re
|
|
13850
13850
|
}) => {
|
|
13851
13851
|
let ce = {}, de = !1;
|
|
13852
|
-
if (
|
|
13852
|
+
if (fe()) {
|
|
13853
13853
|
ce = (await ConnectionProvider.getHandler().readObjects({
|
|
13854
13854
|
model: r,
|
|
13855
|
-
ids: [
|
|
13855
|
+
ids: [fe()],
|
|
13856
13856
|
fields: ne,
|
|
13857
13857
|
context: g
|
|
13858
13858
|
}))[0];
|
|
13859
13859
|
const xe = await ConnectionProvider.getHandler().search({
|
|
13860
|
-
params: [["res_model", "=", r], ["res_id", "=",
|
|
13860
|
+
params: [["res_model", "=", r], ["res_id", "=", fe()]],
|
|
13861
13861
|
fields: ["id", "name"],
|
|
13862
13862
|
context: ye(),
|
|
13863
13863
|
model: "ir.attachment"
|
|
@@ -13873,7 +13873,7 @@ function Form(e, t) {
|
|
|
13873
13873
|
const {
|
|
13874
13874
|
callOnSubmitSucceed: re = !0
|
|
13875
13875
|
} = ne || {};
|
|
13876
|
-
if (
|
|
13876
|
+
if (fe()) {
|
|
13877
13877
|
const ce = getTouchedValues({
|
|
13878
13878
|
source: k.current,
|
|
13879
13879
|
target: Ee(A),
|
|
@@ -13881,7 +13881,7 @@ function Form(e, t) {
|
|
|
13881
13881
|
});
|
|
13882
13882
|
await ConnectionProvider.getHandler().update({
|
|
13883
13883
|
model: r,
|
|
13884
|
-
id:
|
|
13884
|
+
id: fe(),
|
|
13885
13885
|
values: {
|
|
13886
13886
|
...ce,
|
|
13887
13887
|
...E
|
|
@@ -13907,21 +13907,27 @@ function Form(e, t) {
|
|
|
13907
13907
|
});
|
|
13908
13908
|
B.current = de, k.current = ce;
|
|
13909
13909
|
}
|
|
13910
|
-
y && await y([
|
|
13910
|
+
y && await y([fe()]), !b && re && (pe == null || pe(fe(), be(), ue()));
|
|
13911
13911
|
}, He = async (ne) => {
|
|
13912
13912
|
const {
|
|
13913
13913
|
callOnSubmitSucceed: re = !0
|
|
13914
13914
|
} = ne || {};
|
|
13915
|
-
!b && re && (
|
|
13915
|
+
!b && re && (pe == null || pe(fe(), be(), ue()));
|
|
13916
13916
|
}, Ae = async (ne) => {
|
|
13917
13917
|
let re = !1;
|
|
13918
13918
|
const {
|
|
13919
13919
|
callOnSubmitSucceed: ce = !0
|
|
13920
13920
|
} = ne || {};
|
|
13921
|
-
if (G.current = !0, q(void 0), !Re() &&
|
|
13922
|
-
return G.current = !1, Q == null || Q(!1), he == null || he(),
|
|
13921
|
+
if (G.current = !0, q(void 0), !Re() && fe() && ce)
|
|
13922
|
+
return G.current = !1, Q == null || Q(!1), he == null || he(), {
|
|
13923
|
+
succeed: !0,
|
|
13924
|
+
id: fe()
|
|
13925
|
+
};
|
|
13923
13926
|
if (await Oe())
|
|
13924
|
-
return G.current = !1, showDialog$5(w),
|
|
13927
|
+
return G.current = !1, showDialog$5(w), {
|
|
13928
|
+
succeed: !1,
|
|
13929
|
+
id: fe()
|
|
13930
|
+
};
|
|
13925
13931
|
T(!0), ee == null || ee(!0);
|
|
13926
13932
|
try {
|
|
13927
13933
|
p === "api" ? await Be(ne) : await He(ne), f && (B.current = void 0, Me({
|
|
@@ -13934,7 +13940,10 @@ function Form(e, t) {
|
|
|
13934
13940
|
} finally {
|
|
13935
13941
|
G.current = !1, ee == null || ee(!1), T(!1);
|
|
13936
13942
|
}
|
|
13937
|
-
return
|
|
13943
|
+
return {
|
|
13944
|
+
succeed: re,
|
|
13945
|
+
id: fe()
|
|
13946
|
+
};
|
|
13938
13947
|
}, Ie = ({
|
|
13939
13948
|
fields: ne,
|
|
13940
13949
|
arch: re,
|
|
@@ -14003,7 +14012,7 @@ function Form(e, t) {
|
|
|
14003
14012
|
}), de = await ConnectionProvider.getHandler().executeOnChange({
|
|
14004
14013
|
model: r,
|
|
14005
14014
|
action: re.method,
|
|
14006
|
-
ids:
|
|
14015
|
+
ids: fe() ? [fe()] : [],
|
|
14007
14016
|
payload: ce,
|
|
14008
14017
|
fields: A
|
|
14009
14018
|
});
|
|
@@ -14050,7 +14059,7 @@ function Form(e, t) {
|
|
|
14050
14059
|
const ce = await ConnectionProvider.getHandler().execute({
|
|
14051
14060
|
model: r,
|
|
14052
14061
|
action: ne,
|
|
14053
|
-
payload: [
|
|
14062
|
+
payload: [fe()],
|
|
14054
14063
|
context: {
|
|
14055
14064
|
...re,
|
|
14056
14065
|
...M == null ? void 0 : M.context,
|
|
@@ -14058,9 +14067,9 @@ function Form(e, t) {
|
|
|
14058
14067
|
}
|
|
14059
14068
|
});
|
|
14060
14069
|
if (typeof ce == "object" && ce !== null && Object.keys(ce).length === 0 && b)
|
|
14061
|
-
|
|
14070
|
+
pe == null || pe(fe(), be(), ue());
|
|
14062
14071
|
else if (ce.type && ce.type === "ir.actions.act_window_close")
|
|
14063
|
-
|
|
14072
|
+
pe == null || pe(fe(), be(), ue());
|
|
14064
14073
|
else if (ce.type) {
|
|
14065
14074
|
let de = {};
|
|
14066
14075
|
ce.context && (de = parseContext({
|
|
@@ -14083,9 +14092,9 @@ function Form(e, t) {
|
|
|
14083
14092
|
const re = await ConnectionProvider.getHandler().executeWorkflow({
|
|
14084
14093
|
model: r,
|
|
14085
14094
|
action: ne,
|
|
14086
|
-
payload:
|
|
14095
|
+
payload: fe()
|
|
14087
14096
|
});
|
|
14088
|
-
re.type && re.type === "ir.actions.act_window_close" ?
|
|
14097
|
+
re.type && re.type === "ir.actions.act_window_close" ? pe == null || pe(fe(), be(), ue()) : await Fe();
|
|
14089
14098
|
}
|
|
14090
14099
|
async function Ze({
|
|
14091
14100
|
action: ne,
|
|
@@ -14120,7 +14129,7 @@ function Form(e, t) {
|
|
|
14120
14129
|
Fe();
|
|
14121
14130
|
}
|
|
14122
14131
|
})) || {};
|
|
14123
|
-
!_ && ce && (
|
|
14132
|
+
!_ && ce && (pe == null || pe(fe(), be(), ue()));
|
|
14124
14133
|
}
|
|
14125
14134
|
function Qe() {
|
|
14126
14135
|
De({
|
|
@@ -15309,10 +15318,10 @@ function SearchTree(e, t) {
|
|
|
15309
15318
|
page: Ce,
|
|
15310
15319
|
offset: ae,
|
|
15311
15320
|
getResults: me,
|
|
15312
|
-
requestPageChange:
|
|
15321
|
+
requestPageChange: pe,
|
|
15313
15322
|
changeSort: he,
|
|
15314
15323
|
fetchChildrenForRecord: ge,
|
|
15315
|
-
colorsForResults:
|
|
15324
|
+
colorsForResults: fe,
|
|
15316
15325
|
totalItems: Te
|
|
15317
15326
|
} = useSearch({
|
|
15318
15327
|
model: v,
|
|
@@ -15444,11 +15453,11 @@ function SearchTree(e, t) {
|
|
|
15444
15453
|
page: Ce,
|
|
15445
15454
|
treeView: _,
|
|
15446
15455
|
results: me(),
|
|
15447
|
-
onRequestPageChange:
|
|
15456
|
+
onRequestPageChange: pe,
|
|
15448
15457
|
loading: oe,
|
|
15449
15458
|
onRowClicked: ve,
|
|
15450
15459
|
scrollY: u || Re(),
|
|
15451
|
-
colorsForResults:
|
|
15460
|
+
colorsForResults: fe,
|
|
15452
15461
|
rowSelection: {
|
|
15453
15462
|
selectedRowKeys: z == null ? void 0 : z.map((Se) => Se.id),
|
|
15454
15463
|
onChange: we
|
|
@@ -18515,18 +18524,18 @@ function requireBase() {
|
|
|
18515
18524
|
}, {
|
|
18516
18525
|
key: "renderContent",
|
|
18517
18526
|
value: function() {
|
|
18518
|
-
var B = this, k = this.state, $ = k.ellipsisContent, L = k.isEllipsis, G = k.expanded, Z = this.props, P = Z.component, O = Z.children, X = Z.className, J = Z.type, ee = Z.disabled, Q = Z.style, ie = D(Z, ["component", "children", "className", "type", "disabled", "style"]), te = this.context.direction, oe = this.getEllipsis(), se = oe.rows, _e = oe.suffix, Ce = oe.tooltip, ae = this.getPrefixCls(), me = (0, y.default)(ie, ["prefixCls", "editable", "copyable", "ellipsis", "mark", "code", "delete", "underline", "strong", "keyboard"].concat((0, a.default)(_.configConsumerProps))),
|
|
18519
|
-
if (se && L && !G && !
|
|
18527
|
+
var B = this, k = this.state, $ = k.ellipsisContent, L = k.isEllipsis, G = k.expanded, Z = this.props, P = Z.component, O = Z.children, X = Z.className, J = Z.type, ee = Z.disabled, Q = Z.style, ie = D(Z, ["component", "children", "className", "type", "disabled", "style"]), te = this.context.direction, oe = this.getEllipsis(), se = oe.rows, _e = oe.suffix, Ce = oe.tooltip, ae = this.getPrefixCls(), me = (0, y.default)(ie, ["prefixCls", "editable", "copyable", "ellipsis", "mark", "code", "delete", "underline", "strong", "keyboard"].concat((0, a.default)(_.configConsumerProps))), pe = this.canUseCSSEllipsis(), he = se === 1 && pe, ge = se && se > 1 && pe, fe = O;
|
|
18528
|
+
if (se && L && !G && !pe) {
|
|
18520
18529
|
var Te = ie.title, be = Te || "";
|
|
18521
|
-
!Te && (typeof O == "string" || typeof O == "number") && (be = String(O)), be = be == null ? void 0 : be.slice(String($ || "").length),
|
|
18530
|
+
!Te && (typeof O == "string" || typeof O == "number") && (be = String(O)), be = be == null ? void 0 : be.slice(String($ || "").length), fe = /* @__PURE__ */ f.createElement(f.Fragment, null, $, /* @__PURE__ */ f.createElement("span", {
|
|
18522
18531
|
title: be,
|
|
18523
18532
|
"aria-hidden": "true"
|
|
18524
|
-
}, A), _e), Ce && (
|
|
18533
|
+
}, A), _e), Ce && (fe = /* @__PURE__ */ f.createElement(T.default, {
|
|
18525
18534
|
title: Ce === !0 ? O : Ce
|
|
18526
|
-
}, /* @__PURE__ */ f.createElement("span", null,
|
|
18535
|
+
}, /* @__PURE__ */ f.createElement("span", null, fe)));
|
|
18527
18536
|
} else
|
|
18528
|
-
|
|
18529
|
-
return
|
|
18537
|
+
fe = /* @__PURE__ */ f.createElement(f.Fragment, null, O, _e);
|
|
18538
|
+
return fe = V(this.props, fe), /* @__PURE__ */ f.createElement(C.default, {
|
|
18530
18539
|
componentName: "Text"
|
|
18531
18540
|
}, function(le) {
|
|
18532
18541
|
var ue, ye = le.edit, ve = le.copy, we = le.copied, Re = le.expand;
|
|
@@ -18541,7 +18550,7 @@ function requireBase() {
|
|
|
18541
18550
|
component: P,
|
|
18542
18551
|
ref: B.contentRef,
|
|
18543
18552
|
direction: te
|
|
18544
|
-
}, me),
|
|
18553
|
+
}, me), fe, B.renderOperations()));
|
|
18545
18554
|
});
|
|
18546
18555
|
}
|
|
18547
18556
|
}, {
|
|
@@ -19545,7 +19554,7 @@ const One2manyInput = (e) => {
|
|
|
19545
19554
|
});
|
|
19546
19555
|
}
|
|
19547
19556
|
Z(ve), V || T(!1);
|
|
19548
|
-
},
|
|
19557
|
+
}, pe = (le) => {
|
|
19549
19558
|
const {
|
|
19550
19559
|
id: ue
|
|
19551
19560
|
} = le;
|
|
@@ -19596,7 +19605,7 @@ const One2manyInput = (e) => {
|
|
|
19596
19605
|
return ue.parse(a.get(s).arch), ue.string;
|
|
19597
19606
|
}
|
|
19598
19607
|
}
|
|
19599
|
-
const
|
|
19608
|
+
const fe = () => {
|
|
19600
19609
|
var ue, ye, ve, we;
|
|
19601
19610
|
if (s === "form")
|
|
19602
19611
|
return G.length === 0 ? g("noCurrentEntries") : /* @__PURE__ */ jsx(Form$1, {
|
|
@@ -19643,7 +19652,7 @@ const One2manyInput = (e) => {
|
|
|
19643
19652
|
treeView: a.get("tree"),
|
|
19644
19653
|
results: le,
|
|
19645
19654
|
loading: C,
|
|
19646
|
-
onRowClicked: ((we = a.get("form")) == null ? void 0 : we.fields) !== void 0 ?
|
|
19655
|
+
onRowClicked: ((we = a.get("form")) == null ? void 0 : we.fields) !== void 0 ? pe : void 0,
|
|
19647
19656
|
showPagination: !1,
|
|
19648
19657
|
rowSelection: {
|
|
19649
19658
|
selectedRowKeys: j,
|
|
@@ -19696,7 +19705,7 @@ const One2manyInput = (e) => {
|
|
|
19696
19705
|
selectedRowKeys: j,
|
|
19697
19706
|
showCreateButton: ((be = a.get("form")) == null ? void 0 : be.fields) !== void 0,
|
|
19698
19707
|
showToggleButton: a.size > 1
|
|
19699
|
-
}),
|
|
19708
|
+
}), fe(), /* @__PURE__ */ jsx(FormModal, {
|
|
19700
19709
|
formView: a.get("form"),
|
|
19701
19710
|
model: U,
|
|
19702
19711
|
id: M == null ? void 0 : M.id,
|
|
@@ -23374,7 +23383,9 @@ function FormActionBar({
|
|
|
23374
23383
|
tooltip: S("actions"),
|
|
23375
23384
|
items: e == null ? void 0 : e.action,
|
|
23376
23385
|
onItemClick: async (k) => {
|
|
23377
|
-
!k || !await (
|
|
23386
|
+
!k || !(await saveDocument({
|
|
23387
|
+
onFormSave: a
|
|
23388
|
+
})).succeed || B(k);
|
|
23378
23389
|
}
|
|
23379
23390
|
}), /* @__PURE__ */ jsx(DropdownButton, {
|
|
23380
23391
|
icon: /* @__PURE__ */ jsx(PrinterOutlined, {}),
|
|
@@ -23382,11 +23393,16 @@ function FormActionBar({
|
|
|
23382
23393
|
tooltip: S("reports"),
|
|
23383
23394
|
items: e == null ? void 0 : e.print,
|
|
23384
23395
|
onItemClick: async (k) => {
|
|
23385
|
-
!k
|
|
23396
|
+
if (!k)
|
|
23397
|
+
return;
|
|
23398
|
+
const $ = await saveDocument({
|
|
23399
|
+
onFormSave: a
|
|
23400
|
+
});
|
|
23401
|
+
!$.succeed || B({
|
|
23386
23402
|
...k,
|
|
23387
23403
|
datas: {
|
|
23388
23404
|
...k.datas || {},
|
|
23389
|
-
ids: [
|
|
23405
|
+
ids: [$.currentId]
|
|
23390
23406
|
}
|
|
23391
23407
|
});
|
|
23392
23408
|
}
|
|
@@ -23396,7 +23412,9 @@ function FormActionBar({
|
|
|
23396
23412
|
tooltip: S("related"),
|
|
23397
23413
|
items: e == null ? void 0 : e.relate,
|
|
23398
23414
|
onItemClick: async (k) => {
|
|
23399
|
-
!k || !await (
|
|
23415
|
+
!k || !(await saveDocument({
|
|
23416
|
+
onFormSave: a
|
|
23417
|
+
})).succeed || D({
|
|
23400
23418
|
relateData: k,
|
|
23401
23419
|
values: _.current.getValues(),
|
|
23402
23420
|
fields: _.current.getFields(),
|
|
@@ -23408,9 +23426,12 @@ function FormActionBar({
|
|
|
23408
23426
|
disabled: U,
|
|
23409
23427
|
attachments: x,
|
|
23410
23428
|
onAddNewAttachment: async () => {
|
|
23411
|
-
|
|
23429
|
+
const k = await saveDocument({
|
|
23430
|
+
onFormSave: a
|
|
23431
|
+
});
|
|
23432
|
+
if (!k.succeed)
|
|
23412
23433
|
return;
|
|
23413
|
-
const $ =
|
|
23434
|
+
const $ = k.currentId, L = p;
|
|
23414
23435
|
j({
|
|
23415
23436
|
model: "ir.attachment",
|
|
23416
23437
|
values: {
|
|
@@ -23424,9 +23445,12 @@ function FormActionBar({
|
|
|
23424
23445
|
});
|
|
23425
23446
|
},
|
|
23426
23447
|
onListAllAttachments: async () => {
|
|
23427
|
-
|
|
23448
|
+
const k = await saveDocument({
|
|
23449
|
+
onFormSave: a
|
|
23450
|
+
});
|
|
23451
|
+
if (!k.succeed)
|
|
23428
23452
|
return;
|
|
23429
|
-
const $ =
|
|
23453
|
+
const $ = k.currentId;
|
|
23430
23454
|
j({
|
|
23431
23455
|
model: "ir.attachment",
|
|
23432
23456
|
domain: [["res_model", "=", `${p}`], ["res_id", "=", `${$}`]],
|
|
@@ -23434,7 +23458,9 @@ function FormActionBar({
|
|
|
23434
23458
|
});
|
|
23435
23459
|
},
|
|
23436
23460
|
onViewAttachmentDetails: async (k) => {
|
|
23437
|
-
!await (
|
|
23461
|
+
!(await saveDocument({
|
|
23462
|
+
onFormSave: a
|
|
23463
|
+
})).succeed || j({
|
|
23438
23464
|
model: "ir.attachment",
|
|
23439
23465
|
res_id: k.id,
|
|
23440
23466
|
initialViewType: "form"
|
|
@@ -23448,6 +23474,18 @@ function separator$2() {
|
|
|
23448
23474
|
className: "inline-block w-2"
|
|
23449
23475
|
});
|
|
23450
23476
|
}
|
|
23477
|
+
async function saveDocument({
|
|
23478
|
+
onFormSave: e
|
|
23479
|
+
}) {
|
|
23480
|
+
const t = await (e == null ? void 0 : e());
|
|
23481
|
+
return t != null && t.succeed ? {
|
|
23482
|
+
succeed: !0,
|
|
23483
|
+
currentId: t.id
|
|
23484
|
+
} : {
|
|
23485
|
+
succeed: !1,
|
|
23486
|
+
currentId: void 0
|
|
23487
|
+
};
|
|
23488
|
+
}
|
|
23451
23489
|
var isURL$1 = { exports: {} }, assertString = { exports: {} };
|
|
23452
23490
|
(function(e, t) {
|
|
23453
23491
|
Object.defineProperty(t, "__esModule", {
|
|
@@ -24643,11 +24681,11 @@ function ActionView(e, t) {
|
|
|
24643
24681
|
const ie = async () => {
|
|
24644
24682
|
E(!0);
|
|
24645
24683
|
const ae = [];
|
|
24646
|
-
for (const
|
|
24647
|
-
const [he, ge] =
|
|
24648
|
-
let
|
|
24684
|
+
for (const pe of o) {
|
|
24685
|
+
const [he, ge] = pe;
|
|
24686
|
+
let fe;
|
|
24649
24687
|
try {
|
|
24650
|
-
ge !== "dashboard" && (
|
|
24688
|
+
ge !== "dashboard" && (fe = await ConnectionProvider.getHandler().getView({
|
|
24651
24689
|
model: n,
|
|
24652
24690
|
type: ge,
|
|
24653
24691
|
id: he,
|
|
@@ -24683,14 +24721,14 @@ function ActionView(e, t) {
|
|
|
24683
24721
|
}
|
|
24684
24722
|
case "form": {
|
|
24685
24723
|
ae.push({
|
|
24686
|
-
...
|
|
24724
|
+
...fe,
|
|
24687
24725
|
type: ge
|
|
24688
24726
|
});
|
|
24689
24727
|
break;
|
|
24690
24728
|
}
|
|
24691
24729
|
case "tree": {
|
|
24692
24730
|
ae.push({
|
|
24693
|
-
...
|
|
24731
|
+
...fe,
|
|
24694
24732
|
isExpandable: y,
|
|
24695
24733
|
type: ge
|
|
24696
24734
|
});
|
|
@@ -24698,7 +24736,7 @@ function ActionView(e, t) {
|
|
|
24698
24736
|
}
|
|
24699
24737
|
case "graph": {
|
|
24700
24738
|
ae.push({
|
|
24701
|
-
...
|
|
24739
|
+
...fe,
|
|
24702
24740
|
type: ge
|
|
24703
24741
|
});
|
|
24704
24742
|
break;
|
|
@@ -24706,14 +24744,14 @@ function ActionView(e, t) {
|
|
|
24706
24744
|
}
|
|
24707
24745
|
}
|
|
24708
24746
|
let me;
|
|
24709
|
-
!c && ae.find((
|
|
24747
|
+
!c && ae.find((pe) => pe.type === "tree") ? me = ae.find((he) => he.type === "tree") : c ? me = ae.find((he) => c.id ? he.type === c.type && he.view_id === c.id : he.type === c.type) : me = ae.find((he) => he.type === "form"), me || showDialog$8(`Error determining the first view to show.
|
|
24710
24748
|
Please, make sure the view ids on the fields_view_get responses are the same as the ones defined in the action`), Q(me), _(ae), E(!1);
|
|
24711
24749
|
};
|
|
24712
24750
|
u({
|
|
24713
24751
|
tabKey: l,
|
|
24714
24752
|
canWeClose: te
|
|
24715
24753
|
}), useEffect(() => {
|
|
24716
|
-
const ae = x.find((
|
|
24754
|
+
const ae = x.find((pe) => pe.type === "tree"), me = x.find((pe) => c.id ? pe.type === c.type && pe.view_id === c.id : pe.type === c.type);
|
|
24717
24755
|
Q(me || ae), p ? P == null || P(F) : (ee(void 0), M(void 0)), ie();
|
|
24718
24756
|
}, [n, o, p]), useEffect(() => {
|
|
24719
24757
|
X === l && (P == null || P(w), Z == null || Z(g));
|
|
@@ -24727,25 +24765,25 @@ Please, make sure the view ids on the fields_view_get responses are the same as
|
|
|
24727
24765
|
async function se(ae) {
|
|
24728
24766
|
var ge;
|
|
24729
24767
|
K(!0);
|
|
24730
|
-
const me = D.findIndex((
|
|
24731
|
-
let
|
|
24768
|
+
const me = D.findIndex((fe) => fe.id === ae);
|
|
24769
|
+
let pe;
|
|
24732
24770
|
if (me === -1) {
|
|
24733
24771
|
try {
|
|
24734
|
-
|
|
24772
|
+
pe = (ge = await ConnectionProvider.getHandler().readObjects({
|
|
24735
24773
|
model: n,
|
|
24736
24774
|
ids: [ae],
|
|
24737
24775
|
context: a
|
|
24738
24776
|
})) == null ? void 0 : ge[0];
|
|
24739
24777
|
} catch {
|
|
24740
24778
|
}
|
|
24741
|
-
if (!
|
|
24779
|
+
if (!pe) {
|
|
24742
24780
|
K(!1), z(!1), showDialog$7(k("idNotFound"));
|
|
24743
24781
|
return;
|
|
24744
24782
|
}
|
|
24745
24783
|
} else
|
|
24746
|
-
|
|
24784
|
+
pe = D[me];
|
|
24747
24785
|
K(!1), z(!1);
|
|
24748
|
-
const he = o.find((
|
|
24786
|
+
const he = o.find((fe) => fe[1] === "form");
|
|
24749
24787
|
J({
|
|
24750
24788
|
domain: [],
|
|
24751
24789
|
context: a,
|