@gisce/react-ooui 1.1.63-rc.0 → 1.1.63-rc.1
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/react-ooui.es.js
CHANGED
|
@@ -6116,32 +6116,32 @@ function useStatus(e, t, r, n) {
|
|
|
6116
6116
|
}
|
|
6117
6117
|
var k = useRef(!1);
|
|
6118
6118
|
function M(te) {
|
|
6119
|
-
var
|
|
6120
|
-
if (!(te && !te.deadline && te.target !==
|
|
6121
|
-
var
|
|
6122
|
-
j === STATUS_APPEAR && k.current ?
|
|
6119
|
+
var ae = L();
|
|
6120
|
+
if (!(te && !te.deadline && te.target !== ae)) {
|
|
6121
|
+
var oe;
|
|
6122
|
+
j === STATUS_APPEAR && k.current ? oe = C == null ? void 0 : C(ae, te) : j === STATUS_ENTER && k.current ? oe = T == null ? void 0 : T(ae, te) : j === STATUS_LEAVE && k.current && (oe = F == null ? void 0 : F(ae, te)), oe !== !1 && !K.current && (q(STATUS_NONE), z(null));
|
|
6123
6123
|
}
|
|
6124
6124
|
}
|
|
6125
6125
|
var U = useDomMotionEvents(M), X = _slicedToArray(U, 1), Z = X[0], P = React.useMemo(function() {
|
|
6126
|
-
var te,
|
|
6126
|
+
var te, ae, oe;
|
|
6127
6127
|
switch (j) {
|
|
6128
6128
|
case "appear":
|
|
6129
6129
|
return te = {}, _defineProperty$1(te, STEP_PREPARE, p), _defineProperty$1(te, STEP_START, y), _defineProperty$1(te, STEP_ACTIVE, g), te;
|
|
6130
6130
|
case "enter":
|
|
6131
|
-
return
|
|
6131
|
+
return ae = {}, _defineProperty$1(ae, STEP_PREPARE, h), _defineProperty$1(ae, STEP_START, _), _defineProperty$1(ae, STEP_ACTIVE, x), ae;
|
|
6132
6132
|
case "leave":
|
|
6133
|
-
return
|
|
6133
|
+
return oe = {}, _defineProperty$1(oe, STEP_PREPARE, v), _defineProperty$1(oe, STEP_START, m), _defineProperty$1(oe, STEP_ACTIVE, b), oe;
|
|
6134
6134
|
default:
|
|
6135
6135
|
return {};
|
|
6136
6136
|
}
|
|
6137
6137
|
}, [j]), O = useStepQueue(j, function(te) {
|
|
6138
6138
|
if (te === STEP_PREPARE) {
|
|
6139
|
-
var
|
|
6140
|
-
return
|
|
6139
|
+
var ae = P[STEP_PREPARE];
|
|
6140
|
+
return ae ? ae(L()) : SkipStep;
|
|
6141
6141
|
}
|
|
6142
6142
|
if (ee in P) {
|
|
6143
|
-
var
|
|
6144
|
-
z(((
|
|
6143
|
+
var oe;
|
|
6144
|
+
z(((oe = P[ee]) === null || oe === void 0 ? void 0 : oe.call(P, L(), null)) || null);
|
|
6145
6145
|
}
|
|
6146
6146
|
return ee === STEP_ACTIVE && (Z(L()), d > 0 && (clearTimeout(H.current), H.current = setTimeout(function() {
|
|
6147
6147
|
M({
|
|
@@ -6153,8 +6153,8 @@ function useStatus(e, t, r, n) {
|
|
|
6153
6153
|
if (N(t), !!e) {
|
|
6154
6154
|
var te = Y.current;
|
|
6155
6155
|
Y.current = !0;
|
|
6156
|
-
var
|
|
6157
|
-
!te && t && u && (
|
|
6156
|
+
var ae;
|
|
6157
|
+
!te && t && u && (ae = STATUS_APPEAR), te && t && o && (ae = STATUS_ENTER), (te && !t && c || !te && f && !t && c) && (ae = STATUS_LEAVE), ae && (q(ae), Q());
|
|
6158
6158
|
}
|
|
6159
6159
|
}, [t]), useEffect(function() {
|
|
6160
6160
|
(j === STATUS_APPEAR && !u || j === STATUS_ENTER && !o || j === STATUS_LEAVE && !c) && q(STATUS_NONE);
|
|
@@ -6165,10 +6165,10 @@ function useStatus(e, t, r, n) {
|
|
|
6165
6165
|
}, []), useEffect(function() {
|
|
6166
6166
|
A !== void 0 && j === STATUS_NONE && (w == null || w(A));
|
|
6167
6167
|
}, [A, j]);
|
|
6168
|
-
var
|
|
6169
|
-
return P[STEP_PREPARE] && ee === STEP_START && (
|
|
6168
|
+
var ne = B;
|
|
6169
|
+
return P[STEP_PREPARE] && ee === STEP_START && (ne = _objectSpread2$1({
|
|
6170
6170
|
transition: "none"
|
|
6171
|
-
},
|
|
6171
|
+
}, ne)), [j, ee, ne, A != null ? A : t];
|
|
6172
6172
|
}
|
|
6173
6173
|
var DomWrapper = /* @__PURE__ */ function(e) {
|
|
6174
6174
|
_inherits(r, e);
|
|
@@ -7910,27 +7910,27 @@ function requireClearableLabeledInput() {
|
|
|
7910
7910
|
l.useEffect(function() {
|
|
7911
7911
|
(q.value !== void 0 || M.current !== q.value) && (k(q.value), M.current = q.value);
|
|
7912
7912
|
}, [q.value, M.current]);
|
|
7913
|
-
var U = function(
|
|
7914
|
-
q.value === void 0 && (k(
|
|
7915
|
-
}, X = function(
|
|
7916
|
-
U(
|
|
7917
|
-
}, Z = function(
|
|
7913
|
+
var U = function(ae, oe) {
|
|
7914
|
+
q.value === void 0 && (k(ae), oe == null || oe());
|
|
7915
|
+
}, X = function(ae) {
|
|
7916
|
+
U(ae.target.value), (0, y.resolveOnChange)(Y.current, ae, q.onChange);
|
|
7917
|
+
}, Z = function(ae) {
|
|
7918
7918
|
U("", function() {
|
|
7919
|
-
var
|
|
7920
|
-
(
|
|
7921
|
-
}), (0, y.resolveOnChange)(Y.current,
|
|
7919
|
+
var oe;
|
|
7920
|
+
(oe = Y.current) === null || oe === void 0 || oe.focus();
|
|
7921
|
+
}), (0, y.resolveOnChange)(Y.current, ae, q.onChange);
|
|
7922
7922
|
}, P = D("input", F);
|
|
7923
7923
|
l.useImperativeHandle(C, function() {
|
|
7924
7924
|
var te;
|
|
7925
7925
|
return {
|
|
7926
7926
|
resizableTextArea: (te = Y.current) === null || te === void 0 ? void 0 : te.resizableTextArea,
|
|
7927
|
-
focus: function(
|
|
7927
|
+
focus: function(oe) {
|
|
7928
7928
|
var xe, Se;
|
|
7929
|
-
(0, y.triggerFocus)((Se = (xe = Y.current) === null || xe === void 0 ? void 0 : xe.resizableTextArea) === null || Se === void 0 ? void 0 : Se.textArea,
|
|
7929
|
+
(0, y.triggerFocus)((Se = (xe = Y.current) === null || xe === void 0 ? void 0 : xe.resizableTextArea) === null || Se === void 0 ? void 0 : Se.textArea, oe);
|
|
7930
7930
|
},
|
|
7931
7931
|
blur: function() {
|
|
7932
|
-
var
|
|
7933
|
-
return (
|
|
7932
|
+
var oe;
|
|
7933
|
+
return (oe = Y.current) === null || oe === void 0 ? void 0 : oe.blur();
|
|
7934
7934
|
}
|
|
7935
7935
|
};
|
|
7936
7936
|
});
|
|
@@ -7954,14 +7954,14 @@ function requireClearableLabeledInput() {
|
|
|
7954
7954
|
bordered: E
|
|
7955
7955
|
}));
|
|
7956
7956
|
if (A) {
|
|
7957
|
-
var J = Math.min(G.length, N != null ? N : 1 / 0),
|
|
7958
|
-
return (0, n.default)(A) === "object" ?
|
|
7957
|
+
var J = Math.min(G.length, N != null ? N : 1 / 0), ne = "";
|
|
7958
|
+
return (0, n.default)(A) === "object" ? ne = A.formatter({
|
|
7959
7959
|
count: J,
|
|
7960
7960
|
maxLength: N
|
|
7961
|
-
}) :
|
|
7961
|
+
}) : ne = "".concat(J).concat(Q ? " / ".concat(N) : ""), /* @__PURE__ */ l.createElement("div", {
|
|
7962
7962
|
className: (0, f.default)("".concat(P, "-textarea"), (0, s.default)({}, "".concat(P, "-textarea-rtl"), B === "rtl"), "".concat(P, "-textarea-show-count"), $),
|
|
7963
7963
|
style: I,
|
|
7964
|
-
"data-count":
|
|
7964
|
+
"data-count": ne
|
|
7965
7965
|
}, ee);
|
|
7966
7966
|
}
|
|
7967
7967
|
return ee;
|
|
@@ -9149,8 +9149,8 @@ function require_stream_writable() {
|
|
|
9149
9149
|
Z.allBuffers = G, $(k, M, !0, M.length, Z, "", P.finish), M.pendingcb++, M.lastBufferedRequest = null, P.next ? (M.corkedRequestsFree = P.next, P.next = null) : M.corkedRequestsFree = new e(M), M.bufferedRequestCount = 0;
|
|
9150
9150
|
} else {
|
|
9151
9151
|
for (; U; ) {
|
|
9152
|
-
var Q = U.chunk, ee = U.encoding, J = U.callback,
|
|
9153
|
-
if ($(k, M, !1,
|
|
9152
|
+
var Q = U.chunk, ee = U.encoding, J = U.callback, ne = M.objectMode ? 1 : Q.length;
|
|
9153
|
+
if ($(k, M, !1, ne, Q, ee, J), U = U.next, M.bufferedRequestCount--, M.writing)
|
|
9154
9154
|
break;
|
|
9155
9155
|
}
|
|
9156
9156
|
U === null && (M.lastBufferedRequest = null);
|
|
@@ -9684,9 +9684,9 @@ function require_stream_readable() {
|
|
|
9684
9684
|
if (O === null)
|
|
9685
9685
|
J.reading = !1, q(P, J);
|
|
9686
9686
|
else {
|
|
9687
|
-
var
|
|
9688
|
-
if (ee || (
|
|
9689
|
-
C(P,
|
|
9687
|
+
var ne;
|
|
9688
|
+
if (ee || (ne = N(J, O)), ne)
|
|
9689
|
+
C(P, ne);
|
|
9690
9690
|
else if (J.objectMode || O && O.length > 0)
|
|
9691
9691
|
if (typeof O != "string" && !J.objectMode && Object.getPrototypeOf(O) !== n.prototype && (O = o(O)), Q)
|
|
9692
9692
|
J.endEmitted ? C(P, new m()) : A(P, J, O, !0);
|
|
@@ -9782,39 +9782,39 @@ function require_stream_readable() {
|
|
|
9782
9782
|
break;
|
|
9783
9783
|
}
|
|
9784
9784
|
Q.pipesCount += 1, l("pipe count=%d opts=%j", Q.pipesCount, O);
|
|
9785
|
-
var ee = (!O || O.end !== !1) && P !== process.stdout && P !== process.stderr, J = ee ? te :
|
|
9786
|
-
Q.endEmitted ? process.nextTick(J) : G.once("end", J), P.on("unpipe",
|
|
9787
|
-
function
|
|
9788
|
-
l("onunpipe"),
|
|
9785
|
+
var ee = (!O || O.end !== !1) && P !== process.stdout && P !== process.stderr, J = ee ? te : he;
|
|
9786
|
+
Q.endEmitted ? process.nextTick(J) : G.once("end", J), P.on("unpipe", ne);
|
|
9787
|
+
function ne(ge, ce) {
|
|
9788
|
+
l("onunpipe"), ge === G && ce && ce.hasUnpiped === !1 && (ce.hasUnpiped = !0, xe());
|
|
9789
9789
|
}
|
|
9790
9790
|
function te() {
|
|
9791
9791
|
l("onend"), P.end();
|
|
9792
9792
|
}
|
|
9793
|
-
var
|
|
9794
|
-
P.on("drain",
|
|
9795
|
-
var
|
|
9793
|
+
var ae = Y(G);
|
|
9794
|
+
P.on("drain", ae);
|
|
9795
|
+
var oe = !1;
|
|
9796
9796
|
function xe() {
|
|
9797
|
-
l("cleanup"), P.removeListener("close",
|
|
9797
|
+
l("cleanup"), P.removeListener("close", se), P.removeListener("finish", fe), P.removeListener("drain", ae), P.removeListener("error", be), P.removeListener("unpipe", ne), G.removeListener("end", te), G.removeListener("end", he), G.removeListener("data", Se), oe = !0, Q.awaitDrain && (!P._writableState || P._writableState.needDrain) && ae();
|
|
9798
9798
|
}
|
|
9799
9799
|
G.on("data", Se);
|
|
9800
|
-
function Se(
|
|
9800
|
+
function Se(ge) {
|
|
9801
9801
|
l("ondata");
|
|
9802
|
-
var
|
|
9803
|
-
l("dest.write",
|
|
9802
|
+
var ce = P.write(ge);
|
|
9803
|
+
l("dest.write", ce), ce === !1 && ((Q.pipesCount === 1 && Q.pipes === P || Q.pipesCount > 1 && Z(Q.pipes, P) !== -1) && !oe && (l("false write response, pause", Q.awaitDrain), Q.awaitDrain++), G.pause());
|
|
9804
9804
|
}
|
|
9805
|
-
function
|
|
9806
|
-
l("onerror",
|
|
9805
|
+
function be(ge) {
|
|
9806
|
+
l("onerror", ge), he(), P.removeListener("error", be), t(P, "error") === 0 && C(P, ge);
|
|
9807
9807
|
}
|
|
9808
|
-
F(P, "error",
|
|
9809
|
-
function
|
|
9810
|
-
P.removeListener("finish", fe),
|
|
9808
|
+
F(P, "error", be);
|
|
9809
|
+
function se() {
|
|
9810
|
+
P.removeListener("finish", fe), he();
|
|
9811
9811
|
}
|
|
9812
|
-
P.once("close",
|
|
9812
|
+
P.once("close", se);
|
|
9813
9813
|
function fe() {
|
|
9814
|
-
l("onfinish"), P.removeListener("close",
|
|
9814
|
+
l("onfinish"), P.removeListener("close", se), he();
|
|
9815
9815
|
}
|
|
9816
9816
|
P.once("finish", fe);
|
|
9817
|
-
function
|
|
9817
|
+
function he() {
|
|
9818
9818
|
l("unpipe"), G.unpipe(P);
|
|
9819
9819
|
}
|
|
9820
9820
|
return P.emit("pipe", G), Q.flowing || (l("pipe resume"), G.resume()), P;
|
|
@@ -9842,8 +9842,8 @@ function require_stream_readable() {
|
|
|
9842
9842
|
});
|
|
9843
9843
|
return this;
|
|
9844
9844
|
}
|
|
9845
|
-
var
|
|
9846
|
-
return
|
|
9845
|
+
var ne = Z(O.pipes, P);
|
|
9846
|
+
return ne === -1 ? this : (O.pipes.splice(ne, 1), O.pipesCount -= 1, O.pipesCount === 1 && (O.pipes = O.pipes[0]), P.emit("unpipe", this, G), this);
|
|
9847
9847
|
}, E.prototype.on = function(P, O) {
|
|
9848
9848
|
var G = r.prototype.on.call(this, P, O), Q = this._readableState;
|
|
9849
9849
|
return P === "data" ? (Q.readableListening = this.listenerCount("readable") > 0, Q.flowing !== !1 && this.resume()) : P === "readable" && !Q.endEmitted && !Q.readableListening && (Q.readableListening = Q.needReadable = !0, Q.flowing = !1, Q.emittedReadable = !1, l("on readable", Q.length, Q.reading), Q.length ? V(this) : Q.reading || process.nextTick(K, this)), G;
|
|
@@ -9883,13 +9883,13 @@ function require_stream_readable() {
|
|
|
9883
9883
|
var O = this, G = this._readableState, Q = !1;
|
|
9884
9884
|
P.on("end", function() {
|
|
9885
9885
|
if (l("wrapped end"), G.decoder && !G.ended) {
|
|
9886
|
-
var
|
|
9887
|
-
|
|
9886
|
+
var ne = G.decoder.end();
|
|
9887
|
+
ne && ne.length && O.push(ne);
|
|
9888
9888
|
}
|
|
9889
9889
|
O.push(null);
|
|
9890
|
-
}), P.on("data", function(
|
|
9891
|
-
if (l("wrapped data"), G.decoder && (
|
|
9892
|
-
var te = O.push(
|
|
9890
|
+
}), P.on("data", function(ne) {
|
|
9891
|
+
if (l("wrapped data"), G.decoder && (ne = G.decoder.write(ne)), !(G.objectMode && ne == null) && !(!G.objectMode && (!ne || !ne.length))) {
|
|
9892
|
+
var te = O.push(ne);
|
|
9893
9893
|
te || (Q = !0, P.pause());
|
|
9894
9894
|
}
|
|
9895
9895
|
});
|
|
@@ -9901,8 +9901,8 @@ function require_stream_readable() {
|
|
|
9901
9901
|
}(ee));
|
|
9902
9902
|
for (var J = 0; J < T.length; J++)
|
|
9903
9903
|
P.on(T[J], this.emit.bind(this, T[J]));
|
|
9904
|
-
return this._read = function(
|
|
9905
|
-
l("wrapped _read",
|
|
9904
|
+
return this._read = function(ne) {
|
|
9905
|
+
l("wrapped _read", ne), Q && (Q = !1, P.resume());
|
|
9906
9906
|
}, this;
|
|
9907
9907
|
}, typeof Symbol == "function" && (E.prototype[Symbol.asyncIterator] = function() {
|
|
9908
9908
|
return x === void 0 && (x = requireAsync_iterator()), x(this);
|
|
@@ -13063,19 +13063,19 @@ const transformPlainMany2Ones = ({
|
|
|
13063
13063
|
context: c
|
|
13064
13064
|
});
|
|
13065
13065
|
if (B(J.length), d == null || d(J.length), J.length > 0) {
|
|
13066
|
-
const
|
|
13066
|
+
const ne = J.map((be) => be == null ? void 0 : be[0]), { colors: te } = getTree(f), ae = await ConnectionProvider.getHandler().readEvalUiObjects({
|
|
13067
13067
|
model: t,
|
|
13068
|
-
ids:
|
|
13068
|
+
ids: ne,
|
|
13069
13069
|
arch: f == null ? void 0 : f.arch,
|
|
13070
13070
|
fields: f.field_parent ? { ...f.fields, [f.field_parent]: {} } : f.fields,
|
|
13071
13071
|
context: c,
|
|
13072
13072
|
attrs: te && {
|
|
13073
13073
|
colors: te
|
|
13074
13074
|
}
|
|
13075
|
-
}),
|
|
13076
|
-
L.current = [...
|
|
13077
|
-
const xe =
|
|
13078
|
-
resultsToSort:
|
|
13075
|
+
}), oe = ae[0];
|
|
13076
|
+
L.current = [...oe], K(getColorMap(ae[1]));
|
|
13077
|
+
const xe = oe.map((be) => be.id), Se = h !== void 0 ? sortResults({
|
|
13078
|
+
resultsToSort: oe,
|
|
13079
13079
|
sorter: h,
|
|
13080
13080
|
fields: { ...f.fields, ...p.fields }
|
|
13081
13081
|
}) : [...L.current];
|
|
@@ -13097,26 +13097,26 @@ const transformPlainMany2Ones = ({
|
|
|
13097
13097
|
d
|
|
13098
13098
|
]), X = useCallback(
|
|
13099
13099
|
async (J) => {
|
|
13100
|
-
const { params:
|
|
13101
|
-
params:
|
|
13100
|
+
const { params: ne, newOffset: te } = J || {}, ae = mergeParams(ne || T, g), { colors: oe } = getTree(f), { totalItems: xe, results: Se, attrsEvaluated: be } = await ConnectionProvider.getHandler().searchForTree({
|
|
13101
|
+
params: ae,
|
|
13102
13102
|
limit: W.current,
|
|
13103
13103
|
offset: te || q,
|
|
13104
13104
|
model: t,
|
|
13105
13105
|
fields: f.field_parent ? { ...f.fields, [f.field_parent]: {} } : f.fields,
|
|
13106
13106
|
context: c,
|
|
13107
|
-
attrs:
|
|
13107
|
+
attrs: oe && { colors: oe }
|
|
13108
13108
|
});
|
|
13109
|
-
K(getColorMap(
|
|
13110
|
-
const
|
|
13109
|
+
K(getColorMap(be)), L.current = [...Se];
|
|
13110
|
+
const se = h !== void 0 ? sortResults({
|
|
13111
13111
|
resultsToSort: Se,
|
|
13112
13112
|
sorter: h,
|
|
13113
13113
|
fields: { ...f.fields, ...p.fields }
|
|
13114
13114
|
}) : [...L.current];
|
|
13115
|
-
if (k(
|
|
13116
|
-
const
|
|
13117
|
-
(
|
|
13115
|
+
if (k(se), m && se.length > 0) {
|
|
13116
|
+
const he = se.findIndex(
|
|
13117
|
+
(ge) => x === ge.id
|
|
13118
13118
|
);
|
|
13119
|
-
|
|
13119
|
+
he === -1 ? y == null || y(0) : y == null || y(he);
|
|
13120
13120
|
} else
|
|
13121
13121
|
y == null || y(void 0);
|
|
13122
13122
|
const fe = await xe;
|
|
@@ -13142,8 +13142,8 @@ const transformPlainMany2Ones = ({
|
|
|
13142
13142
|
async (J) => {
|
|
13143
13143
|
try {
|
|
13144
13144
|
E(!0), s == null || s(!0), u && !l.current ? await U() : await X(J);
|
|
13145
|
-
} catch (
|
|
13146
|
-
$(
|
|
13145
|
+
} catch (ne) {
|
|
13146
|
+
$(ne.message);
|
|
13147
13147
|
} finally {
|
|
13148
13148
|
E(!1), A(!1), s == null || s(!1);
|
|
13149
13149
|
}
|
|
@@ -13172,20 +13172,20 @@ const transformPlainMany2Ones = ({
|
|
|
13172
13172
|
), P = useCallback(
|
|
13173
13173
|
(J) => {
|
|
13174
13174
|
v == null || v(J);
|
|
13175
|
-
const
|
|
13175
|
+
const ne = J !== void 0 ? sortResults({
|
|
13176
13176
|
resultsToSort: M(),
|
|
13177
13177
|
sorter: J,
|
|
13178
13178
|
fields: { ...f.fields, ...p.fields }
|
|
13179
13179
|
}) : [...L.current];
|
|
13180
|
-
k(
|
|
13180
|
+
k(ne);
|
|
13181
13181
|
},
|
|
13182
13182
|
[v, M, f, p, k]
|
|
13183
13183
|
), O = useCallback(
|
|
13184
13184
|
(J) => {
|
|
13185
|
-
const { params:
|
|
13186
|
-
w || (r == null || r(void 0), n == null || n([]), F == null || F(te), a == null || a(
|
|
13187
|
-
params:
|
|
13188
|
-
newOffset:
|
|
13185
|
+
const { params: ne, searchValues: te, limit: ae, offset: oe } = J;
|
|
13186
|
+
w || (r == null || r(void 0), n == null || n([]), F == null || F(te), a == null || a(ne), o == null || o(!1), A(!0), $(void 0), j(1), ae && (W.current = ae, C == null || C(ae)), oe && V(oe), Z({
|
|
13187
|
+
params: ne,
|
|
13188
|
+
newOffset: oe
|
|
13189
13189
|
}));
|
|
13190
13190
|
},
|
|
13191
13191
|
[
|
|
@@ -13219,9 +13219,9 @@ const transformPlainMany2Ones = ({
|
|
|
13219
13219
|
b
|
|
13220
13220
|
]), ee = useCallback(
|
|
13221
13221
|
async (J) => {
|
|
13222
|
-
const
|
|
13222
|
+
const ne = J[(f == null ? void 0 : f.field_parent) || "child_id"], te = await ConnectionProvider.getHandler().readObjects({
|
|
13223
13223
|
model: t,
|
|
13224
|
-
ids:
|
|
13224
|
+
ids: ne,
|
|
13225
13225
|
fields: f.field_parent ? { ...f.fields, [f.field_parent]: {} } : f.fields,
|
|
13226
13226
|
context: c
|
|
13227
13227
|
});
|
|
@@ -13273,19 +13273,19 @@ const transformPlainMany2Ones = ({
|
|
|
13273
13273
|
setSearchTreeNameSearch: F,
|
|
13274
13274
|
goToResourceId: w,
|
|
13275
13275
|
limit: E
|
|
13276
|
-
} = e, [S, A] = useState(!1), [N, $] = useState(!1), [I, j] = useState(!1), [q, V] = useState(!0), [D, B] = useState(!0), [z, Y] = useState([]), [H, K] = useState(!1), [W, L] = useState([]), [k, M] = useState(!1), [U, X] = useState(!0), [Z, P] = useState(), [O, G] = useState({}), [Q, ee] = useState(E !== void 0 ? E : DEFAULT_SEARCH_LIMIT$1), [J,
|
|
13276
|
+
} = e, [S, A] = useState(!1), [N, $] = useState(!1), [I, j] = useState(!1), [q, V] = useState(!0), [D, B] = useState(!0), [z, Y] = useState([]), [H, K] = useState(!1), [W, L] = useState([]), [k, M] = useState(!1), [U, X] = useState(!0), [Z, P] = useState(), [O, G] = useState({}), [Q, ee] = useState(E !== void 0 ? E : DEFAULT_SEARCH_LIMIT$1), [J, ne] = useState(n);
|
|
13277
13277
|
useEffect(() => {
|
|
13278
13278
|
p && p.length > 0 && !h && (v == null || v(0), d == null || d(p[0].id));
|
|
13279
13279
|
}, [p]), useEffect(() => {
|
|
13280
13280
|
ee(E !== void 0 ? E : DEFAULT_SEARCH_LIMIT$1);
|
|
13281
13281
|
}, [E]), useEffect(() => {
|
|
13282
|
-
o.length === 1 ? P(o[0]) : o.length > 1 && P(o.filter((
|
|
13282
|
+
o.length === 1 ? P(o[0]) : o.length > 1 && P(o.filter((ae) => ae.view_id !== r.view_id)[0]);
|
|
13283
13283
|
}, [o]), useEffect(() => {
|
|
13284
|
-
(Z == null ? void 0 : Z.view_id) === r.view_id && o.length > 1 && P(o.filter((
|
|
13284
|
+
(Z == null ? void 0 : Z.view_id) === r.view_id && o.length > 1 && P(o.filter((ae) => ae.view_id !== r.view_id)[0]);
|
|
13285
13285
|
}, [r]);
|
|
13286
13286
|
const te = async () => {
|
|
13287
|
-
var
|
|
13288
|
-
return await ((
|
|
13287
|
+
var ae;
|
|
13288
|
+
return await ((ae = s.current) == null ? void 0 : ae.submitForm());
|
|
13289
13289
|
};
|
|
13290
13290
|
return /* @__PURE__ */ jsx(ActionViewContext.Provider, {
|
|
13291
13291
|
value: {
|
|
@@ -13339,7 +13339,7 @@ const transformPlainMany2Ones = ({
|
|
|
13339
13339
|
setSearchValues: G,
|
|
13340
13340
|
limit: Q,
|
|
13341
13341
|
setLimit: ee,
|
|
13342
|
-
setTitle:
|
|
13342
|
+
setTitle: ne
|
|
13343
13343
|
},
|
|
13344
13344
|
children: t
|
|
13345
13345
|
});
|
|
@@ -13746,19 +13746,19 @@ function Form(e, t) {
|
|
|
13746
13746
|
} = P || {}, Q = useContext(ActionViewContext), {
|
|
13747
13747
|
setFormIsSaving: ee = void 0,
|
|
13748
13748
|
setFormHasChanges: J = void 0,
|
|
13749
|
-
setCurrentId:
|
|
13749
|
+
setCurrentId: ne = void 0,
|
|
13750
13750
|
setFormIsLoading: te = void 0,
|
|
13751
|
-
setAttachments:
|
|
13752
|
-
title:
|
|
13751
|
+
setAttachments: ae = void 0,
|
|
13752
|
+
title: oe = void 0,
|
|
13753
13753
|
setTitle: xe = void 0
|
|
13754
13754
|
} = (b ? Q : {}) || {}, Se = useContext(ContentRootContext), {
|
|
13755
|
-
processAction:
|
|
13756
|
-
globalValues:
|
|
13755
|
+
processAction: be,
|
|
13756
|
+
globalValues: se
|
|
13757
13757
|
} = Se || {};
|
|
13758
13758
|
useImperativeHandle(t, () => ({
|
|
13759
13759
|
submitForm: Ie,
|
|
13760
|
-
getFields:
|
|
13761
|
-
getValues:
|
|
13760
|
+
getFields: Re,
|
|
13761
|
+
getValues: Ce,
|
|
13762
13762
|
getPlainValues: Oe,
|
|
13763
13763
|
getContext: Pe,
|
|
13764
13764
|
fetchValues: ke,
|
|
@@ -13779,43 +13779,43 @@ function Form(e, t) {
|
|
|
13779
13779
|
elementHasLostFocus: !0
|
|
13780
13780
|
}), W(!1));
|
|
13781
13781
|
}, [K]);
|
|
13782
|
-
const fe = (
|
|
13783
|
-
J == null || J(!1), ee == null || ee(!1), o == null || o(
|
|
13784
|
-
},
|
|
13782
|
+
const fe = (ie, re, ue) => {
|
|
13783
|
+
J == null || J(!1), ee == null || ee(!1), o == null || o(ie, re, ue), ne == null || ne(ie);
|
|
13784
|
+
}, he = () => {
|
|
13785
13785
|
ee == null || ee(!1), a == null || a();
|
|
13786
|
-
},
|
|
13787
|
-
ee == null || ee(!1), c == null || c(
|
|
13786
|
+
}, ge = (ie) => {
|
|
13787
|
+
ee == null || ee(!1), c == null || c(ie);
|
|
13788
13788
|
};
|
|
13789
|
-
function
|
|
13789
|
+
function ce() {
|
|
13790
13790
|
return n || L.current;
|
|
13791
13791
|
}
|
|
13792
|
-
function
|
|
13792
|
+
function Re() {
|
|
13793
13793
|
return D;
|
|
13794
13794
|
}
|
|
13795
|
-
function
|
|
13796
|
-
const
|
|
13795
|
+
function Ce() {
|
|
13796
|
+
const ie = {
|
|
13797
13797
|
...pe(D),
|
|
13798
13798
|
...le()
|
|
13799
13799
|
};
|
|
13800
|
-
for (const re in
|
|
13801
|
-
|
|
13802
|
-
return
|
|
13800
|
+
for (const re in ie)
|
|
13801
|
+
ie[re] === void 0 && delete ie[re];
|
|
13802
|
+
return ie;
|
|
13803
13803
|
}
|
|
13804
13804
|
function Oe() {
|
|
13805
|
-
const
|
|
13805
|
+
const ie = Ce(), re = Re();
|
|
13806
13806
|
let ue = {};
|
|
13807
|
-
return Object.keys(
|
|
13808
|
-
const
|
|
13809
|
-
re[
|
|
13807
|
+
return Object.keys(ie).forEach((de) => {
|
|
13808
|
+
const we = ie[de];
|
|
13809
|
+
re[de] && re[de].type === "many2one" && we && Array.isArray(we) && we.length === 2 ? ue[de] = we[0] : re[de] && (re[de].type === "one2many" || re[de].type === "many2many") && we && we.items ? ue[de] = we.items.filter((Me) => Me.operation !== "pendingRemove").map((Me) => Me.id) : ue[de] = we;
|
|
13810
13810
|
}), ue;
|
|
13811
13811
|
}
|
|
13812
|
-
function
|
|
13813
|
-
const
|
|
13812
|
+
function Ee() {
|
|
13813
|
+
const ie = {
|
|
13814
13814
|
...pe(D)
|
|
13815
13815
|
};
|
|
13816
|
-
for (const re in
|
|
13817
|
-
|
|
13818
|
-
return
|
|
13816
|
+
for (const re in ie)
|
|
13817
|
+
ie[re] === void 0 && delete ie[re];
|
|
13818
|
+
return ie;
|
|
13819
13819
|
}
|
|
13820
13820
|
function Pe() {
|
|
13821
13821
|
return {
|
|
@@ -13825,42 +13825,42 @@ function Form(e, t) {
|
|
|
13825
13825
|
}
|
|
13826
13826
|
function le() {
|
|
13827
13827
|
return {
|
|
13828
|
-
id:
|
|
13829
|
-
active_id:
|
|
13830
|
-
active_ids: [
|
|
13828
|
+
id: ce(),
|
|
13829
|
+
active_id: ce(),
|
|
13830
|
+
active_ids: [ce()],
|
|
13831
13831
|
parent_id: O,
|
|
13832
|
-
...
|
|
13832
|
+
...se
|
|
13833
13833
|
};
|
|
13834
13834
|
}
|
|
13835
|
-
const
|
|
13836
|
-
const re =
|
|
13835
|
+
const me = async (ie) => {
|
|
13836
|
+
const re = ce() ? $ == null ? void 0 : $.context : {};
|
|
13837
13837
|
return await ConnectionProvider.getHandler().defaultGet({
|
|
13838
13838
|
model: r,
|
|
13839
|
-
fields:
|
|
13839
|
+
fields: ie,
|
|
13840
13840
|
context: {
|
|
13841
13841
|
...m,
|
|
13842
13842
|
...re
|
|
13843
13843
|
},
|
|
13844
13844
|
extraValues: C
|
|
13845
13845
|
});
|
|
13846
|
-
},
|
|
13846
|
+
}, _e = () => Object.keys(getTouchedValues({
|
|
13847
13847
|
source: k.current,
|
|
13848
13848
|
target: pe(D),
|
|
13849
13849
|
fields: D
|
|
13850
|
-
})).length !== 0, pe = (
|
|
13850
|
+
})).length !== 0, pe = (ie) => {
|
|
13851
13851
|
const re = j.getFieldsValue(!0);
|
|
13852
|
-
return processValues(re,
|
|
13853
|
-
}, ye = (
|
|
13852
|
+
return processValues(re, ie);
|
|
13853
|
+
}, ye = (ie, re) => {
|
|
13854
13854
|
Ae({
|
|
13855
13855
|
values: {
|
|
13856
13856
|
...processValues(j.getFieldsValue(!0), D),
|
|
13857
|
-
[
|
|
13857
|
+
[ie]: re
|
|
13858
13858
|
},
|
|
13859
13859
|
fields: D,
|
|
13860
13860
|
reset: !1
|
|
13861
13861
|
});
|
|
13862
|
-
}, ve = (
|
|
13863
|
-
async function
|
|
13862
|
+
}, ve = (ie) => j.getFieldsValue(!0)[ie];
|
|
13863
|
+
async function Te() {
|
|
13864
13864
|
try {
|
|
13865
13865
|
return await j.validateFields(), !1;
|
|
13866
13866
|
} catch {
|
|
@@ -13869,16 +13869,16 @@ function Form(e, t) {
|
|
|
13869
13869
|
}
|
|
13870
13870
|
const Fe = async () => {
|
|
13871
13871
|
N(void 0), te == null || te(!0);
|
|
13872
|
-
let
|
|
13872
|
+
let ie;
|
|
13873
13873
|
try {
|
|
13874
|
-
v ?
|
|
13874
|
+
v ? ie = {
|
|
13875
13875
|
arch: v.arch,
|
|
13876
13876
|
fields: v.fields
|
|
13877
|
-
} :
|
|
13877
|
+
} : ie = await Ve();
|
|
13878
13878
|
const {
|
|
13879
13879
|
fields: re,
|
|
13880
13880
|
arch: ue
|
|
13881
|
-
} =
|
|
13881
|
+
} = ie;
|
|
13882
13882
|
B(re), V(ue), await ke({
|
|
13883
13883
|
fields: re,
|
|
13884
13884
|
arch: ue
|
|
@@ -13886,14 +13886,14 @@ function Form(e, t) {
|
|
|
13886
13886
|
} catch (re) {
|
|
13887
13887
|
N(re != null && re.message ? re.message + re.stack : re), te == null || te(!1);
|
|
13888
13888
|
}
|
|
13889
|
-
}, ke = async (
|
|
13890
|
-
let re, ue,
|
|
13891
|
-
te == null || te(!0), N(void 0),
|
|
13889
|
+
}, ke = async (ie) => {
|
|
13890
|
+
let re, ue, de, we;
|
|
13891
|
+
te == null || te(!0), N(void 0), ie ? (ue = ie.fields, de = ie.arch) : (ue = D, de = q), h ? re = h : {
|
|
13892
13892
|
values: re,
|
|
13893
|
-
defaultGetCalled:
|
|
13893
|
+
defaultGetCalled: we
|
|
13894
13894
|
} = await Ue({
|
|
13895
13895
|
fields: ue,
|
|
13896
|
-
arch:
|
|
13896
|
+
arch: de
|
|
13897
13897
|
}), g && (re = {
|
|
13898
13898
|
...getValuesForDomain(g),
|
|
13899
13899
|
...re
|
|
@@ -13901,27 +13901,27 @@ function Form(e, t) {
|
|
|
13901
13901
|
values: re,
|
|
13902
13902
|
fields: ue,
|
|
13903
13903
|
reset: !0,
|
|
13904
|
-
isDefaultGet:
|
|
13904
|
+
isDefaultGet: we
|
|
13905
13905
|
}), De({
|
|
13906
13906
|
fields: ue,
|
|
13907
|
-
arch:
|
|
13907
|
+
arch: de,
|
|
13908
13908
|
values: re
|
|
13909
|
-
}), te == null || te(!1), J == null || J(!1),
|
|
13910
|
-
}, $e = async () => new Promise(async (
|
|
13911
|
-
|
|
13909
|
+
}), te == null || te(!1), J == null || J(!1), we && W(!0);
|
|
13910
|
+
}, $e = async () => new Promise(async (ie) => {
|
|
13911
|
+
_e() ? showDialog$6({
|
|
13912
13912
|
lang: w,
|
|
13913
13913
|
onOk: () => {
|
|
13914
|
-
|
|
13914
|
+
he == null || he(), ie(!0);
|
|
13915
13915
|
},
|
|
13916
13916
|
onCancel: () => {
|
|
13917
|
-
|
|
13917
|
+
ie(!1);
|
|
13918
13918
|
}
|
|
13919
|
-
}) : (
|
|
13919
|
+
}) : (he == null || he(), ie(!0));
|
|
13920
13920
|
}), Ve = async () => {
|
|
13921
13921
|
if (u) {
|
|
13922
|
-
const
|
|
13922
|
+
const ie = await ConnectionProvider.getHandler().getActionStringForModel(r);
|
|
13923
13923
|
return (await ConnectionProvider.getHandler().getViewsForAction({
|
|
13924
|
-
action:
|
|
13924
|
+
action: ie,
|
|
13925
13925
|
context: m
|
|
13926
13926
|
})).views.get("form");
|
|
13927
13927
|
}
|
|
@@ -13931,14 +13931,14 @@ function Form(e, t) {
|
|
|
13931
13931
|
context: m
|
|
13932
13932
|
});
|
|
13933
13933
|
}, Ae = ({
|
|
13934
|
-
values:
|
|
13934
|
+
values: ie,
|
|
13935
13935
|
fields: re,
|
|
13936
13936
|
reset: ue,
|
|
13937
|
-
isDefaultGet:
|
|
13937
|
+
isDefaultGet: de = !1
|
|
13938
13938
|
}) => {
|
|
13939
13939
|
const Me = {
|
|
13940
13940
|
...ue ? {} : j.getFieldsValue(!0),
|
|
13941
|
-
...
|
|
13941
|
+
...ie
|
|
13942
13942
|
}, Ne = processValues(Me, re), tt = Object.keys(re).map((qe) => {
|
|
13943
13943
|
const rt = Ne[qe] !== void 0 ? Ne[qe] : void 0;
|
|
13944
13944
|
return {
|
|
@@ -13947,37 +13947,37 @@ function Form(e, t) {
|
|
|
13947
13947
|
value: rt
|
|
13948
13948
|
};
|
|
13949
13949
|
});
|
|
13950
|
-
|
|
13950
|
+
de || (M.current = Ne), j.setFields(tt);
|
|
13951
13951
|
}, Ue = async ({
|
|
13952
|
-
fields:
|
|
13952
|
+
fields: ie,
|
|
13953
13953
|
arch: re
|
|
13954
13954
|
}) => {
|
|
13955
|
-
let ue = {},
|
|
13956
|
-
if (
|
|
13955
|
+
let ue = {}, de = !1;
|
|
13956
|
+
if (ce()) {
|
|
13957
13957
|
ue = (await ConnectionProvider.getHandler().readObjects({
|
|
13958
13958
|
model: r,
|
|
13959
|
-
ids: [
|
|
13960
|
-
fields:
|
|
13959
|
+
ids: [ce()],
|
|
13960
|
+
fields: ie,
|
|
13961
13961
|
context: m
|
|
13962
13962
|
}))[0];
|
|
13963
|
-
const
|
|
13964
|
-
params: [["res_model", "=", r], ["res_id", "=",
|
|
13963
|
+
const we = await ConnectionProvider.getHandler().search({
|
|
13964
|
+
params: [["res_model", "=", r], ["res_id", "=", ce()]],
|
|
13965
13965
|
fields: ["id", "name"],
|
|
13966
13966
|
context: Pe(),
|
|
13967
13967
|
model: "ir.attachment"
|
|
13968
13968
|
});
|
|
13969
|
-
|
|
13969
|
+
ae == null || ae(we);
|
|
13970
13970
|
} else
|
|
13971
|
-
|
|
13971
|
+
ae == null || ae([]), ue = await me(ie), de = !0;
|
|
13972
13972
|
return {
|
|
13973
13973
|
values: ue,
|
|
13974
|
-
defaultGetCalled:
|
|
13974
|
+
defaultGetCalled: de
|
|
13975
13975
|
};
|
|
13976
|
-
}, We = async (
|
|
13976
|
+
}, We = async (ie) => {
|
|
13977
13977
|
const {
|
|
13978
13978
|
callOnSubmitSucceed: re = !0
|
|
13979
|
-
} =
|
|
13980
|
-
if (
|
|
13979
|
+
} = ie || {};
|
|
13980
|
+
if (ce()) {
|
|
13981
13981
|
const ue = getTouchedValues({
|
|
13982
13982
|
source: k.current,
|
|
13983
13983
|
target: pe(D),
|
|
@@ -13985,7 +13985,7 @@ function Form(e, t) {
|
|
|
13985
13985
|
});
|
|
13986
13986
|
await ConnectionProvider.getHandler().update({
|
|
13987
13987
|
model: r,
|
|
13988
|
-
id:
|
|
13988
|
+
id: ce(),
|
|
13989
13989
|
values: {
|
|
13990
13990
|
...ue,
|
|
13991
13991
|
...T
|
|
@@ -13997,7 +13997,7 @@ function Form(e, t) {
|
|
|
13997
13997
|
}
|
|
13998
13998
|
}), k.current = pe(D);
|
|
13999
13999
|
} else {
|
|
14000
|
-
const ue = pe(D),
|
|
14000
|
+
const ue = pe(D), de = await ConnectionProvider.getHandler().create({
|
|
14001
14001
|
model: r,
|
|
14002
14002
|
values: {
|
|
14003
14003
|
...ue,
|
|
@@ -14009,61 +14009,61 @@ function Form(e, t) {
|
|
|
14009
14009
|
...$ == null ? void 0 : $.context
|
|
14010
14010
|
}
|
|
14011
14011
|
});
|
|
14012
|
-
L.current =
|
|
14012
|
+
L.current = de, k.current = ue;
|
|
14013
14013
|
}
|
|
14014
|
-
y && await y([
|
|
14015
|
-
}, Be = async (
|
|
14014
|
+
y && await y([ce()]), !_ && re && (fe == null || fe(ce(), Ce(), Ee()));
|
|
14015
|
+
}, Be = async (ie) => {
|
|
14016
14016
|
const {
|
|
14017
14017
|
callOnSubmitSucceed: re = !0
|
|
14018
|
-
} =
|
|
14019
|
-
!_ && re && (fe == null || fe(
|
|
14020
|
-
}, Ie = async (
|
|
14018
|
+
} = ie || {};
|
|
14019
|
+
!_ && re && (fe == null || fe(ce(), Ce(), Ee()));
|
|
14020
|
+
}, Ie = async (ie) => {
|
|
14021
14021
|
let re = !1;
|
|
14022
14022
|
const {
|
|
14023
14023
|
callOnSubmitSucceed: ue = !0
|
|
14024
|
-
} =
|
|
14025
|
-
if (X.current = !0, N(void 0), !
|
|
14026
|
-
return X.current = !1, J == null || J(!1),
|
|
14024
|
+
} = ie || {};
|
|
14025
|
+
if (X.current = !0, N(void 0), !_e() && ce() && ue)
|
|
14026
|
+
return X.current = !1, J == null || J(!1), he == null || he(), {
|
|
14027
14027
|
succeed: !0,
|
|
14028
|
-
id:
|
|
14028
|
+
id: ce()
|
|
14029
14029
|
};
|
|
14030
|
-
if (await
|
|
14030
|
+
if (await Te())
|
|
14031
14031
|
return X.current = !1, showDialog$5(w), {
|
|
14032
14032
|
succeed: !1,
|
|
14033
|
-
id:
|
|
14033
|
+
id: ce()
|
|
14034
14034
|
};
|
|
14035
14035
|
S(!0), ee == null || ee(!0);
|
|
14036
14036
|
try {
|
|
14037
|
-
p === "api" ? await We(
|
|
14037
|
+
p === "api" ? await We(ie) : await Be(ie), f && (L.current = void 0, Ae({
|
|
14038
14038
|
values: {},
|
|
14039
14039
|
fields: D,
|
|
14040
14040
|
reset: !0
|
|
14041
14041
|
})), await ke(), re = !0, message$1.success(F("savedRegisters"));
|
|
14042
|
-
} catch (
|
|
14043
|
-
X.current = !1, S(!1), ee == null || ee(!1),
|
|
14042
|
+
} catch (de) {
|
|
14043
|
+
X.current = !1, S(!1), ee == null || ee(!1), ge == null || ge(de), message$1.error(F("errorWhileSavingForm")), N(de != null && de.message ? de.message : de);
|
|
14044
14044
|
} finally {
|
|
14045
14045
|
X.current = !1, ee == null || ee(!1), S(!1);
|
|
14046
14046
|
}
|
|
14047
14047
|
return {
|
|
14048
14048
|
succeed: re,
|
|
14049
|
-
id:
|
|
14049
|
+
id: ce()
|
|
14050
14050
|
};
|
|
14051
14051
|
}, De = ({
|
|
14052
|
-
fields:
|
|
14052
|
+
fields: ie,
|
|
14053
14053
|
arch: re,
|
|
14054
14054
|
values: ue
|
|
14055
14055
|
}) => {
|
|
14056
|
-
var
|
|
14057
|
-
const
|
|
14058
|
-
|
|
14056
|
+
var we;
|
|
14057
|
+
const de = new Form$4(ie);
|
|
14058
|
+
de.parse(re, {
|
|
14059
14059
|
readOnly: d,
|
|
14060
14060
|
values: {
|
|
14061
14061
|
...ue,
|
|
14062
14062
|
...le()
|
|
14063
14063
|
}
|
|
14064
|
-
}), I(
|
|
14064
|
+
}), I(de), de.string && de.string !== oe && (xe == null || xe(de.string)), z && de.string && ((we = z.setTitle) == null || we.call(z, de.string));
|
|
14065
14065
|
}, je = async ({
|
|
14066
|
-
elementHasLostFocus:
|
|
14066
|
+
elementHasLostFocus: ie = !1
|
|
14067
14067
|
}) => {
|
|
14068
14068
|
if (X.current)
|
|
14069
14069
|
return;
|
|
@@ -14077,24 +14077,24 @@ function Form(e, t) {
|
|
|
14077
14077
|
changedFields: ue,
|
|
14078
14078
|
formOoui: $,
|
|
14079
14079
|
types: ["text", "codeeditor", "email", "url", "char", "float", "float_time", "integer", "many2one"]
|
|
14080
|
-
}) &&
|
|
14080
|
+
}) && ie !== !0)
|
|
14081
14081
|
return;
|
|
14082
14082
|
{
|
|
14083
|
-
const
|
|
14084
|
-
M.current =
|
|
14083
|
+
const de = processValues(j.getFieldsValue(!0), D);
|
|
14084
|
+
M.current = de, l == null || l(de), J == null || J(!0), Ye(ue);
|
|
14085
14085
|
}
|
|
14086
14086
|
}
|
|
14087
|
-
}, He = debounce_1(je, 100), Ye = async (
|
|
14087
|
+
}, He = debounce_1(je, 100), Ye = async (ie) => {
|
|
14088
14088
|
try {
|
|
14089
|
-
for (let re = 0; re <
|
|
14090
|
-
const ue =
|
|
14089
|
+
for (let re = 0; re < ie.length; re += 1) {
|
|
14090
|
+
const ue = ie[re];
|
|
14091
14091
|
await ze(ue);
|
|
14092
14092
|
}
|
|
14093
14093
|
} catch (re) {
|
|
14094
14094
|
showDialog$8(re);
|
|
14095
14095
|
}
|
|
14096
|
-
}, ze = async (
|
|
14097
|
-
const re = $ == null ? void 0 : $.onChangeFields[
|
|
14096
|
+
}, ze = async (ie) => {
|
|
14097
|
+
const re = $ == null ? void 0 : $.onChangeFields[ie];
|
|
14098
14098
|
if (!re) {
|
|
14099
14099
|
De({
|
|
14100
14100
|
fields: D,
|
|
@@ -14113,57 +14113,57 @@ function Form(e, t) {
|
|
|
14113
14113
|
},
|
|
14114
14114
|
parentValues: G == null ? void 0 : G(),
|
|
14115
14115
|
onChangeFieldActionArgs: re.args
|
|
14116
|
-
}),
|
|
14116
|
+
}), de = await ConnectionProvider.getHandler().executeOnChange({
|
|
14117
14117
|
model: r,
|
|
14118
14118
|
action: re.method,
|
|
14119
|
-
ids:
|
|
14119
|
+
ids: ce() ? [ce()] : [],
|
|
14120
14120
|
payload: ue,
|
|
14121
14121
|
fields: D
|
|
14122
14122
|
});
|
|
14123
|
-
if (
|
|
14124
|
-
const
|
|
14123
|
+
if (de.value) {
|
|
14124
|
+
const we = {
|
|
14125
14125
|
...pe(D),
|
|
14126
|
-
...
|
|
14126
|
+
...de.value
|
|
14127
14127
|
};
|
|
14128
14128
|
De({
|
|
14129
14129
|
fields: D,
|
|
14130
14130
|
arch: q,
|
|
14131
|
-
values:
|
|
14131
|
+
values: we
|
|
14132
14132
|
}), Ae({
|
|
14133
|
-
values:
|
|
14133
|
+
values: we,
|
|
14134
14134
|
fields: D,
|
|
14135
14135
|
reset: !1
|
|
14136
14136
|
});
|
|
14137
14137
|
}
|
|
14138
|
-
if (
|
|
14138
|
+
if (de.warning && de.warning.title && de.warning.message && !U.current) {
|
|
14139
14139
|
const {
|
|
14140
|
-
title:
|
|
14140
|
+
title: we,
|
|
14141
14141
|
message: Me
|
|
14142
|
-
} =
|
|
14143
|
-
U.current = !0, showDialog$4(
|
|
14142
|
+
} = de.warning;
|
|
14143
|
+
U.current = !0, showDialog$4(we, Me, () => {
|
|
14144
14144
|
U.current = !1;
|
|
14145
14145
|
});
|
|
14146
14146
|
}
|
|
14147
|
-
if (
|
|
14148
|
-
const
|
|
14149
|
-
fieldsDomain:
|
|
14147
|
+
if (de.domain && Object.keys(de.domain).length > 0) {
|
|
14148
|
+
const we = mergeFieldsDomain({
|
|
14149
|
+
fieldsDomain: de.domain,
|
|
14150
14150
|
fields: D
|
|
14151
14151
|
});
|
|
14152
14152
|
De({
|
|
14153
|
-
fields:
|
|
14153
|
+
fields: we,
|
|
14154
14154
|
arch: q,
|
|
14155
|
-
values: pe(
|
|
14156
|
-
}), B(
|
|
14155
|
+
values: pe(we)
|
|
14156
|
+
}), B(we);
|
|
14157
14157
|
}
|
|
14158
14158
|
};
|
|
14159
14159
|
async function Ge({
|
|
14160
|
-
action:
|
|
14160
|
+
action: ie,
|
|
14161
14161
|
context: re
|
|
14162
14162
|
}) {
|
|
14163
14163
|
const ue = await ConnectionProvider.getHandler().execute({
|
|
14164
14164
|
model: r,
|
|
14165
|
-
action:
|
|
14166
|
-
payload: [
|
|
14165
|
+
action: ie,
|
|
14166
|
+
payload: [ce()],
|
|
14167
14167
|
context: {
|
|
14168
14168
|
...re,
|
|
14169
14169
|
...$ == null ? void 0 : $.context,
|
|
@@ -14171,46 +14171,46 @@ function Form(e, t) {
|
|
|
14171
14171
|
}
|
|
14172
14172
|
});
|
|
14173
14173
|
if (typeof ue == "object" && ue !== null && Object.keys(ue).length === 0 && _)
|
|
14174
|
-
fe == null || fe(
|
|
14174
|
+
fe == null || fe(ce(), Ce(), Ee());
|
|
14175
14175
|
else if (ue.type && ue.type === "ir.actions.act_window_close")
|
|
14176
|
-
fe == null || fe(
|
|
14176
|
+
fe == null || fe(ce(), Ce(), Ee());
|
|
14177
14177
|
else if (ue.type) {
|
|
14178
|
-
let
|
|
14179
|
-
ue.context && (
|
|
14178
|
+
let de = {};
|
|
14179
|
+
ue.context && (de = parseContext({
|
|
14180
14180
|
context: ue.context,
|
|
14181
14181
|
fields: D,
|
|
14182
|
-
values:
|
|
14182
|
+
values: Ce()
|
|
14183
14183
|
})), await Le({
|
|
14184
14184
|
actionData: ue,
|
|
14185
14185
|
context: {
|
|
14186
14186
|
...re,
|
|
14187
|
-
...
|
|
14187
|
+
...de
|
|
14188
14188
|
}
|
|
14189
14189
|
});
|
|
14190
14190
|
} else
|
|
14191
14191
|
await ke();
|
|
14192
14192
|
}
|
|
14193
14193
|
async function Ke({
|
|
14194
|
-
action:
|
|
14194
|
+
action: ie
|
|
14195
14195
|
}) {
|
|
14196
14196
|
const re = await ConnectionProvider.getHandler().executeWorkflow({
|
|
14197
14197
|
model: r,
|
|
14198
|
-
action:
|
|
14199
|
-
payload:
|
|
14198
|
+
action: ie,
|
|
14199
|
+
payload: ce(),
|
|
14200
14200
|
context: {
|
|
14201
14201
|
...m,
|
|
14202
14202
|
...$ == null ? void 0 : $.context
|
|
14203
14203
|
}
|
|
14204
14204
|
});
|
|
14205
|
-
re.type && re.type === "ir.actions.act_window_close" ? fe == null || fe(
|
|
14205
|
+
re.type && re.type === "ir.actions.act_window_close" ? fe == null || fe(ce(), Ce(), Ee()) : await ke();
|
|
14206
14206
|
}
|
|
14207
14207
|
async function Xe({
|
|
14208
|
-
action:
|
|
14208
|
+
action: ie,
|
|
14209
14209
|
context: re
|
|
14210
14210
|
}) {
|
|
14211
14211
|
const ue = (await ConnectionProvider.getHandler().readObjects({
|
|
14212
14212
|
model: "ir.actions.actions",
|
|
14213
|
-
ids: [parseInt(
|
|
14213
|
+
ids: [parseInt(ie)],
|
|
14214
14214
|
context: m
|
|
14215
14215
|
}))[0];
|
|
14216
14216
|
await Le({
|
|
@@ -14219,15 +14219,15 @@ function Form(e, t) {
|
|
|
14219
14219
|
});
|
|
14220
14220
|
}
|
|
14221
14221
|
async function Le({
|
|
14222
|
-
actionData:
|
|
14222
|
+
actionData: ie,
|
|
14223
14223
|
context: re
|
|
14224
14224
|
}) {
|
|
14225
14225
|
const {
|
|
14226
14226
|
closeParent: ue
|
|
14227
|
-
} = await (
|
|
14228
|
-
actionData:
|
|
14227
|
+
} = await (be == null ? void 0 : be({
|
|
14228
|
+
actionData: ie,
|
|
14229
14229
|
fields: D,
|
|
14230
|
-
values:
|
|
14230
|
+
values: Ce(),
|
|
14231
14231
|
context: {
|
|
14232
14232
|
...m,
|
|
14233
14233
|
...$ == null ? void 0 : $.context,
|
|
@@ -14237,7 +14237,7 @@ function Form(e, t) {
|
|
|
14237
14237
|
ke();
|
|
14238
14238
|
}
|
|
14239
14239
|
})) || {};
|
|
14240
|
-
!b && ue && (fe == null || fe(
|
|
14240
|
+
!b && ue && (fe == null || fe(ce(), Ce(), Ee()));
|
|
14241
14241
|
}
|
|
14242
14242
|
function Ze() {
|
|
14243
14243
|
je({
|
|
@@ -14245,39 +14245,39 @@ function Form(e, t) {
|
|
|
14245
14245
|
});
|
|
14246
14246
|
}
|
|
14247
14247
|
async function Qe({
|
|
14248
|
-
type:
|
|
14248
|
+
type: ie,
|
|
14249
14249
|
action: re,
|
|
14250
14250
|
context: ue
|
|
14251
14251
|
}) {
|
|
14252
|
-
if (
|
|
14253
|
-
|
|
14252
|
+
if (ie === "cancel") {
|
|
14253
|
+
he == null || he();
|
|
14254
14254
|
return;
|
|
14255
14255
|
}
|
|
14256
|
-
if (await
|
|
14256
|
+
if (await Te()) {
|
|
14257
14257
|
showDialog$5(w);
|
|
14258
14258
|
return;
|
|
14259
14259
|
}
|
|
14260
14260
|
try {
|
|
14261
14261
|
await Ie({
|
|
14262
14262
|
callOnSubmitSucceed: !1
|
|
14263
|
-
}),
|
|
14263
|
+
}), ie === "object" ? await Ge({
|
|
14264
14264
|
action: re,
|
|
14265
14265
|
context: ue
|
|
14266
|
-
}) :
|
|
14266
|
+
}) : ie === "workflow" ? await Ke({
|
|
14267
14267
|
action: re
|
|
14268
|
-
}) :
|
|
14268
|
+
}) : ie === "action" && await Xe({
|
|
14269
14269
|
action: re,
|
|
14270
14270
|
context: ue
|
|
14271
14271
|
});
|
|
14272
|
-
} catch (
|
|
14273
|
-
showDialog$8(
|
|
14272
|
+
} catch (de) {
|
|
14273
|
+
showDialog$8(de);
|
|
14274
14274
|
}
|
|
14275
14275
|
}
|
|
14276
14276
|
const Je = () => !$ && !A ? /* @__PURE__ */ jsx(Spin, {}) : !r && !v || !x ? null : /* @__PURE__ */ jsx(Fragment, {
|
|
14277
14277
|
children: /* @__PURE__ */ jsx(FormProvider$1, {
|
|
14278
|
-
getValues:
|
|
14278
|
+
getValues: Ce,
|
|
14279
14279
|
getPlainValues: Oe,
|
|
14280
|
-
getFields:
|
|
14280
|
+
getFields: Re,
|
|
14281
14281
|
domain: g,
|
|
14282
14282
|
activeId: n,
|
|
14283
14283
|
activeModel: r,
|
|
@@ -14287,7 +14287,7 @@ function Form(e, t) {
|
|
|
14287
14287
|
getContext: Pe,
|
|
14288
14288
|
submitForm: Ie,
|
|
14289
14289
|
fetchValues: ke,
|
|
14290
|
-
formHasChanges:
|
|
14290
|
+
formHasChanges: _e,
|
|
14291
14291
|
elementHasLostFocus: Ze,
|
|
14292
14292
|
children: /* @__PURE__ */ jsx(Form$3, {
|
|
14293
14293
|
form: j,
|
|
@@ -14329,15 +14329,15 @@ function Form(e, t) {
|
|
|
14329
14329
|
});
|
|
14330
14330
|
return x ? /* @__PURE__ */ jsx(Measure, {
|
|
14331
14331
|
bounds: !0,
|
|
14332
|
-
onResize: (
|
|
14332
|
+
onResize: (ie) => {
|
|
14333
14333
|
var re;
|
|
14334
|
-
H((re =
|
|
14334
|
+
H((re = ie.bounds) == null ? void 0 : re.width);
|
|
14335
14335
|
},
|
|
14336
14336
|
children: ({
|
|
14337
|
-
measureRef:
|
|
14337
|
+
measureRef: ie
|
|
14338
14338
|
}) => /* @__PURE__ */ jsxs("div", {
|
|
14339
14339
|
className: "pb-2",
|
|
14340
|
-
ref:
|
|
14340
|
+
ref: ie,
|
|
14341
14341
|
children: [A && /* @__PURE__ */ jsx(ErrorAlert, {
|
|
14342
14342
|
className: "mt-10 mb-20",
|
|
14343
14343
|
error: A
|
|
@@ -17992,19 +17992,19 @@ function SearchTree(e, t) {
|
|
|
17992
17992
|
setLimit: ee = void 0
|
|
17993
17993
|
} = (d ? q : {}) || {}, {
|
|
17994
17994
|
submit: J,
|
|
17995
|
-
clear:
|
|
17995
|
+
clear: ne,
|
|
17996
17996
|
fetchResults: te,
|
|
17997
|
-
tableRefreshing:
|
|
17998
|
-
searchFilterLoading:
|
|
17997
|
+
tableRefreshing: ae,
|
|
17998
|
+
searchFilterLoading: oe,
|
|
17999
17999
|
searchError: xe,
|
|
18000
18000
|
page: Se,
|
|
18001
|
-
offset:
|
|
18002
|
-
getResults:
|
|
18001
|
+
offset: be,
|
|
18002
|
+
getResults: se,
|
|
18003
18003
|
requestPageChange: fe,
|
|
18004
|
-
changeSort:
|
|
18005
|
-
fetchChildrenForRecord:
|
|
18006
|
-
colorsForResults:
|
|
18007
|
-
totalItems:
|
|
18004
|
+
changeSort: he,
|
|
18005
|
+
fetchChildrenForRecord: ge,
|
|
18006
|
+
colorsForResults: ce,
|
|
18007
|
+
totalItems: Re
|
|
18008
18008
|
} = useSearch({
|
|
18009
18009
|
model: g,
|
|
18010
18010
|
setSearchTreeNameSearch: Z,
|
|
@@ -18036,8 +18036,8 @@ function SearchTree(e, t) {
|
|
|
18036
18036
|
}
|
|
18037
18037
|
})), useEffect(() => {
|
|
18038
18038
|
!y || c && (m.current = !1, te());
|
|
18039
|
-
}, [Se,
|
|
18040
|
-
const
|
|
18039
|
+
}, [Se, be, y, c, s]);
|
|
18040
|
+
const Ce = async () => {
|
|
18041
18041
|
_(!1), v(!0), E(void 0), P == null || P(!0);
|
|
18042
18042
|
try {
|
|
18043
18043
|
await Oe(), _(!0);
|
|
@@ -18054,21 +18054,21 @@ function SearchTree(e, t) {
|
|
|
18054
18054
|
type: "form",
|
|
18055
18055
|
context: f
|
|
18056
18056
|
}));
|
|
18057
|
-
let
|
|
18058
|
-
a || (
|
|
18057
|
+
let Te = a;
|
|
18058
|
+
a || (Te = await ConnectionProvider.getHandler().getView({
|
|
18059
18059
|
model: r,
|
|
18060
18060
|
type: "tree",
|
|
18061
18061
|
context: f
|
|
18062
|
-
})), F(ve), C(
|
|
18062
|
+
})), F(ve), C(Te);
|
|
18063
18063
|
};
|
|
18064
18064
|
useEffect(() => {
|
|
18065
|
-
|
|
18065
|
+
Ce();
|
|
18066
18066
|
}, [r]);
|
|
18067
|
-
const
|
|
18067
|
+
const Ee = (ve) => {
|
|
18068
18068
|
ee == null || ee(ve);
|
|
18069
18069
|
}, Pe = async (ve) => {
|
|
18070
18070
|
const {
|
|
18071
|
-
id:
|
|
18071
|
+
id: Te
|
|
18072
18072
|
} = ve;
|
|
18073
18073
|
N.current || (N.current = await ConnectionProvider.getHandler().treeButOpen({
|
|
18074
18074
|
id: b.view_id,
|
|
@@ -18080,14 +18080,14 @@ function SearchTree(e, t) {
|
|
|
18080
18080
|
actionData: Fe,
|
|
18081
18081
|
fields: b.fields,
|
|
18082
18082
|
values: {
|
|
18083
|
-
active_id:
|
|
18083
|
+
active_id: Te,
|
|
18084
18084
|
...ve
|
|
18085
18085
|
},
|
|
18086
18086
|
context: f
|
|
18087
18087
|
}));
|
|
18088
18088
|
}, le = async (ve) => {
|
|
18089
18089
|
const {
|
|
18090
|
-
id:
|
|
18090
|
+
id: Te
|
|
18091
18091
|
} = ve;
|
|
18092
18092
|
if (b != null && b.isExpandable) {
|
|
18093
18093
|
try {
|
|
@@ -18098,17 +18098,17 @@ function SearchTree(e, t) {
|
|
|
18098
18098
|
return;
|
|
18099
18099
|
}
|
|
18100
18100
|
o({
|
|
18101
|
-
id:
|
|
18101
|
+
id: Te,
|
|
18102
18102
|
model: g,
|
|
18103
18103
|
formView: T,
|
|
18104
18104
|
treeView: b
|
|
18105
18105
|
});
|
|
18106
18106
|
};
|
|
18107
|
-
function
|
|
18108
|
-
const
|
|
18109
|
-
H == null || H(
|
|
18107
|
+
function me(ve) {
|
|
18108
|
+
const Te = se().filter((Fe) => ve.includes(Fe.id));
|
|
18109
|
+
H == null || H(Te), p == null || p(ve);
|
|
18110
18110
|
}
|
|
18111
|
-
function
|
|
18111
|
+
function _e() {
|
|
18112
18112
|
return b != null && b.isExpandable ? $ - 160 : $ - (S + 210);
|
|
18113
18113
|
}
|
|
18114
18114
|
const pe = () => !b || !T ? null : /* @__PURE__ */ jsxs(Fragment, {
|
|
@@ -18119,35 +18119,35 @@ function SearchTree(e, t) {
|
|
|
18119
18119
|
},
|
|
18120
18120
|
searchFields: mergeSearchFields([T.search_fields, b.search_fields]),
|
|
18121
18121
|
formXml: T.arch,
|
|
18122
|
-
onClear:
|
|
18122
|
+
onClear: ne,
|
|
18123
18123
|
limit: Q,
|
|
18124
|
-
offset:
|
|
18125
|
-
isSearching:
|
|
18124
|
+
offset: be,
|
|
18125
|
+
isSearching: oe,
|
|
18126
18126
|
onSubmit: J,
|
|
18127
|
-
onLimitChange:
|
|
18127
|
+
onLimitChange: Ee,
|
|
18128
18128
|
setSearchFilterHeight: A,
|
|
18129
18129
|
searchError: xe,
|
|
18130
18130
|
searchVisible: L,
|
|
18131
18131
|
searchValues: O
|
|
18132
18132
|
}), /* @__PURE__ */ jsx(Tree, {
|
|
18133
18133
|
context: f,
|
|
18134
|
-
total:
|
|
18134
|
+
total: Re,
|
|
18135
18135
|
limit: Q,
|
|
18136
18136
|
page: Se,
|
|
18137
18137
|
treeView: b,
|
|
18138
|
-
results:
|
|
18138
|
+
results: se(),
|
|
18139
18139
|
onRequestPageChange: fe,
|
|
18140
|
-
loading:
|
|
18140
|
+
loading: ae,
|
|
18141
18141
|
onRowClicked: le,
|
|
18142
|
-
scrollY: u ||
|
|
18143
|
-
colorsForResults:
|
|
18142
|
+
scrollY: u || _e(),
|
|
18143
|
+
colorsForResults: ce,
|
|
18144
18144
|
rowSelection: {
|
|
18145
18145
|
selectedRowKeys: Y == null ? void 0 : Y.map((ve) => ve.id),
|
|
18146
|
-
onChange:
|
|
18146
|
+
onChange: me
|
|
18147
18147
|
},
|
|
18148
18148
|
sorter: M,
|
|
18149
|
-
onChangeSort:
|
|
18150
|
-
onFetchChildrenForRecord: b.isExpandable ?
|
|
18149
|
+
onChangeSort: he,
|
|
18150
|
+
onFetchChildrenForRecord: b.isExpandable ? ge : void 0,
|
|
18151
18151
|
childField: b.field_parent,
|
|
18152
18152
|
rootTree: d
|
|
18153
18153
|
})]
|
|
@@ -20657,21 +20657,21 @@ function requireTooltip() {
|
|
|
20657
20657
|
}, I = function(ee) {
|
|
20658
20658
|
"visible" in g || N($() ? !1 : ee), g.onVisibleChange && !$() && g.onVisibleChange(ee);
|
|
20659
20659
|
}, j = function() {
|
|
20660
|
-
var ee = g.builtinPlacements, J = g.arrowPointAtCenter,
|
|
20660
|
+
var ee = g.builtinPlacements, J = g.arrowPointAtCenter, ne = g.autoAdjustOverflow;
|
|
20661
20661
|
return ee || (0, c.default)({
|
|
20662
20662
|
arrowPointAtCenter: J,
|
|
20663
|
-
autoAdjustOverflow:
|
|
20663
|
+
autoAdjustOverflow: ne
|
|
20664
20664
|
});
|
|
20665
20665
|
}, q = function(ee, J) {
|
|
20666
|
-
var
|
|
20667
|
-
return
|
|
20666
|
+
var ne = j(), te = Object.keys(ne).filter(function(xe) {
|
|
20667
|
+
return ne[xe].points[0] === J.points[0] && ne[xe].points[1] === J.points[1];
|
|
20668
20668
|
})[0];
|
|
20669
20669
|
if (!!te) {
|
|
20670
|
-
var
|
|
20670
|
+
var ae = ee.getBoundingClientRect(), oe = {
|
|
20671
20671
|
top: "50%",
|
|
20672
20672
|
left: "50%"
|
|
20673
20673
|
};
|
|
20674
|
-
te.indexOf("top") >= 0 || te.indexOf("Bottom") >= 0 ?
|
|
20674
|
+
te.indexOf("top") >= 0 || te.indexOf("Bottom") >= 0 ? oe.top = "".concat(ae.height - J.offset[1], "px") : (te.indexOf("Top") >= 0 || te.indexOf("bottom") >= 0) && (oe.top = "".concat(-J.offset[1], "px")), te.indexOf("left") >= 0 || te.indexOf("Right") >= 0 ? oe.left = "".concat(ae.width - J.offset[0], "px") : (te.indexOf("right") >= 0 || te.indexOf("Left") >= 0) && (oe.left = "".concat(-J.offset[0], "px")), ee.style.transformOrigin = "".concat(oe.left, " ").concat(oe.top);
|
|
20675
20675
|
}
|
|
20676
20676
|
}, V = function() {
|
|
20677
20677
|
var ee = g.title, J = g.overlay;
|
|
@@ -21121,12 +21121,12 @@ function requireBase() {
|
|
|
21121
21121
|
var Q = (0, $.default)(this.contentRef.current, {
|
|
21122
21122
|
rows: Z,
|
|
21123
21123
|
suffix: P
|
|
21124
|
-
}, G, this.renderOperations(!0), D), ee = Q.content, J = Q.text,
|
|
21125
|
-
(k !== J || M !==
|
|
21124
|
+
}, G, this.renderOperations(!0), D), ee = Q.content, J = Q.text, ne = Q.ellipsis;
|
|
21125
|
+
(k !== J || M !== ne) && (this.setState({
|
|
21126
21126
|
ellipsisText: J,
|
|
21127
21127
|
ellipsisContent: ee,
|
|
21128
|
-
isEllipsis:
|
|
21129
|
-
}), M !==
|
|
21128
|
+
isEllipsis: ne
|
|
21129
|
+
}), M !== ne && O && O(ne));
|
|
21130
21130
|
}
|
|
21131
21131
|
}
|
|
21132
21132
|
}, {
|
|
@@ -21206,33 +21206,33 @@ function requireBase() {
|
|
|
21206
21206
|
}, {
|
|
21207
21207
|
key: "renderContent",
|
|
21208
21208
|
value: function() {
|
|
21209
|
-
var L = this, k = this.state, M = k.ellipsisContent, U = k.isEllipsis, X = k.expanded, Z = this.props, P = Z.component, O = Z.children, G = Z.className, Q = Z.type, ee = Z.disabled, J = Z.style,
|
|
21210
|
-
if (
|
|
21211
|
-
var
|
|
21212
|
-
!
|
|
21213
|
-
title:
|
|
21209
|
+
var L = this, k = this.state, M = k.ellipsisContent, U = k.isEllipsis, X = k.expanded, Z = this.props, P = Z.component, O = Z.children, G = Z.className, Q = Z.type, ee = Z.disabled, J = Z.style, ne = I(Z, ["component", "children", "className", "type", "disabled", "style"]), te = this.context.direction, ae = this.getEllipsis(), oe = ae.rows, xe = ae.suffix, Se = ae.tooltip, be = this.getPrefixCls(), se = (0, y.default)(ne, ["prefixCls", "editable", "copyable", "ellipsis", "mark", "code", "delete", "underline", "strong", "keyboard"].concat((0, a.default)(b.configConsumerProps))), fe = this.canUseCSSEllipsis(), he = oe === 1 && fe, ge = oe && oe > 1 && fe, ce = O;
|
|
21210
|
+
if (oe && U && !X && !fe) {
|
|
21211
|
+
var Re = ne.title, Ce = Re || "";
|
|
21212
|
+
!Re && (typeof O == "string" || typeof O == "number") && (Ce = String(O)), Ce = Ce == null ? void 0 : Ce.slice(String(M || "").length), ce = /* @__PURE__ */ f.createElement(f.Fragment, null, M, /* @__PURE__ */ f.createElement("span", {
|
|
21213
|
+
title: Ce,
|
|
21214
21214
|
"aria-hidden": "true"
|
|
21215
|
-
}, D), xe), Se && (
|
|
21215
|
+
}, D), xe), Se && (ce = /* @__PURE__ */ f.createElement(S.default, {
|
|
21216
21216
|
title: Se === !0 ? O : Se
|
|
21217
|
-
}, /* @__PURE__ */ f.createElement("span", null,
|
|
21217
|
+
}, /* @__PURE__ */ f.createElement("span", null, ce)));
|
|
21218
21218
|
} else
|
|
21219
|
-
|
|
21220
|
-
return
|
|
21219
|
+
ce = /* @__PURE__ */ f.createElement(f.Fragment, null, O, xe);
|
|
21220
|
+
return ce = V(this.props, ce), /* @__PURE__ */ f.createElement(C.default, {
|
|
21221
21221
|
componentName: "Text"
|
|
21222
21222
|
}, function(Oe) {
|
|
21223
|
-
var
|
|
21224
|
-
return L.editStr = Pe, L.copyStr = le, L.copiedStr =
|
|
21223
|
+
var Ee, Pe = Oe.edit, le = Oe.copy, me = Oe.copied, _e = Oe.expand;
|
|
21224
|
+
return L.editStr = Pe, L.copyStr = le, L.copiedStr = me, L.expandStr = _e, /* @__PURE__ */ f.createElement(x.default, {
|
|
21225
21225
|
onResize: L.resizeOnNextFrame,
|
|
21226
|
-
disabled: !
|
|
21226
|
+
disabled: !oe
|
|
21227
21227
|
}, /* @__PURE__ */ f.createElement(A.default, (0, s.default)({
|
|
21228
|
-
className: (0, p.default)((
|
|
21228
|
+
className: (0, p.default)((Ee = {}, (0, n.default)(Ee, "".concat(be, "-").concat(Q), Q), (0, n.default)(Ee, "".concat(be, "-disabled"), ee), (0, n.default)(Ee, "".concat(be, "-ellipsis"), oe), (0, n.default)(Ee, "".concat(be, "-ellipsis-single-line"), he), (0, n.default)(Ee, "".concat(be, "-ellipsis-multiple-line"), ge), Ee), G),
|
|
21229
21229
|
style: (0, s.default)((0, s.default)({}, J), {
|
|
21230
|
-
WebkitLineClamp:
|
|
21230
|
+
WebkitLineClamp: ge ? oe : void 0
|
|
21231
21231
|
}),
|
|
21232
21232
|
component: P,
|
|
21233
21233
|
ref: L.contentRef,
|
|
21234
21234
|
direction: te
|
|
21235
|
-
},
|
|
21235
|
+
}, se), ce, L.renderOperations()));
|
|
21236
21236
|
});
|
|
21237
21237
|
}
|
|
21238
21238
|
}, {
|
|
@@ -22153,21 +22153,21 @@ const One2manyInput = (e) => {
|
|
|
22153
22153
|
J();
|
|
22154
22154
|
}, [y]);
|
|
22155
22155
|
const G = (le) => {
|
|
22156
|
-
var
|
|
22156
|
+
var me, _e;
|
|
22157
22157
|
r == null || r({
|
|
22158
|
-
fields: ((
|
|
22158
|
+
fields: ((me = a.get("form")) == null ? void 0 : me.fields) || ((_e = a.get("tree")) == null ? void 0 : _e.fields),
|
|
22159
22159
|
items: filterDuplicateItems(le)
|
|
22160
22160
|
});
|
|
22161
22161
|
}, Q = async () => {
|
|
22162
22162
|
await ee(), l > Z.length - 1 && l !== 0 && c(0);
|
|
22163
22163
|
}, ee = async (le) => {
|
|
22164
|
-
var
|
|
22164
|
+
var me, _e, pe;
|
|
22165
22165
|
C(!0), x(!1), F(void 0);
|
|
22166
22166
|
try {
|
|
22167
22167
|
const [ye, ve] = await readObjectValues({
|
|
22168
22168
|
treeView: {
|
|
22169
|
-
arch: (
|
|
22170
|
-
fields: (
|
|
22169
|
+
arch: (me = a.get("tree")) == null ? void 0 : me.arch,
|
|
22170
|
+
fields: (_e = a.get("tree")) == null ? void 0 : _e.fields
|
|
22171
22171
|
},
|
|
22172
22172
|
formView: {
|
|
22173
22173
|
fields: ((pe = a.get("form")) == null ? void 0 : pe.fields) || {}
|
|
@@ -22180,7 +22180,7 @@ const One2manyInput = (e) => {
|
|
|
22180
22180
|
},
|
|
22181
22181
|
currentView: le || s
|
|
22182
22182
|
});
|
|
22183
|
-
return Y.current || (Y.current = ye.map((
|
|
22183
|
+
return Y.current || (Y.current = ye.map((Te) => Te.id)), (s || le) === "tree" && ve && K(ve), G(ye), ye;
|
|
22184
22184
|
} catch (ye) {
|
|
22185
22185
|
F(ye);
|
|
22186
22186
|
} finally {
|
|
@@ -22204,22 +22204,22 @@ const One2manyInput = (e) => {
|
|
|
22204
22204
|
widgetFieldName: X
|
|
22205
22205
|
})));
|
|
22206
22206
|
}
|
|
22207
|
-
const
|
|
22208
|
-
const le = Array.from(a.keys()),
|
|
22207
|
+
const ne = () => {
|
|
22208
|
+
const le = Array.from(a.keys()), me = le[(le.indexOf(s) + 1) % le.length];
|
|
22209
22209
|
s === "form" ? xe(() => {
|
|
22210
|
-
u(
|
|
22211
|
-
}) : u(
|
|
22210
|
+
u(me);
|
|
22211
|
+
}) : u(me);
|
|
22212
22212
|
}, te = () => {
|
|
22213
22213
|
l > 0 && (s === "form" ? xe(() => {
|
|
22214
22214
|
c(l - 1);
|
|
22215
22215
|
}) : c(l - 1));
|
|
22216
|
-
},
|
|
22216
|
+
}, ae = () => {
|
|
22217
22217
|
const le = Z.length;
|
|
22218
22218
|
l < le - 1 && (s === "form" ? xe(() => {
|
|
22219
22219
|
c(l + 1);
|
|
22220
22220
|
}) : c(l + 1));
|
|
22221
|
-
},
|
|
22222
|
-
const le = Z[l].id,
|
|
22221
|
+
}, oe = async () => {
|
|
22222
|
+
const le = Z[l].id, me = (await ConnectionProvider.getHandler().readObjects({
|
|
22223
22223
|
model: L,
|
|
22224
22224
|
ids: [le],
|
|
22225
22225
|
fields: a.get("form").fields,
|
|
@@ -22227,7 +22227,7 @@ const One2manyInput = (e) => {
|
|
|
22227
22227
|
...v == null ? void 0 : v(),
|
|
22228
22228
|
...k
|
|
22229
22229
|
}
|
|
22230
|
-
}))[0],
|
|
22230
|
+
}))[0], _e = (await ConnectionProvider.getHandler().readObjects({
|
|
22231
22231
|
model: L,
|
|
22232
22232
|
ids: [le],
|
|
22233
22233
|
fields: a.get("tree").fields,
|
|
@@ -22238,15 +22238,15 @@ const One2manyInput = (e) => {
|
|
|
22238
22238
|
}))[0], pe = o.map((ye) => ye.id === le ? {
|
|
22239
22239
|
...ye,
|
|
22240
22240
|
operation: "original",
|
|
22241
|
-
values:
|
|
22242
|
-
treeValues:
|
|
22241
|
+
values: me,
|
|
22242
|
+
treeValues: _e
|
|
22243
22243
|
} : ye);
|
|
22244
22244
|
G(pe);
|
|
22245
22245
|
}, xe = (le) => {
|
|
22246
22246
|
g ? showDialog$6({
|
|
22247
22247
|
lang: _,
|
|
22248
22248
|
onOk: () => {
|
|
22249
|
-
|
|
22249
|
+
oe(), le(), x(!1);
|
|
22250
22250
|
}
|
|
22251
22251
|
}) : le();
|
|
22252
22252
|
}, Se = () => {
|
|
@@ -22254,7 +22254,7 @@ const One2manyInput = (e) => {
|
|
|
22254
22254
|
showDialog$1({
|
|
22255
22255
|
lang: _,
|
|
22256
22256
|
onOk: () => {
|
|
22257
|
-
s === "form" ? fe() :
|
|
22257
|
+
s === "form" ? fe() : he();
|
|
22258
22258
|
}
|
|
22259
22259
|
});
|
|
22260
22260
|
return;
|
|
@@ -22262,24 +22262,24 @@ const One2manyInput = (e) => {
|
|
|
22262
22262
|
showDialog$2({
|
|
22263
22263
|
lang: _,
|
|
22264
22264
|
onOk: () => {
|
|
22265
|
-
s === "form" ? fe() :
|
|
22265
|
+
s === "form" ? fe() : he();
|
|
22266
22266
|
}
|
|
22267
22267
|
});
|
|
22268
|
-
},
|
|
22268
|
+
}, be = async () => {
|
|
22269
22269
|
const {
|
|
22270
22270
|
inv_field: le
|
|
22271
22271
|
} = n;
|
|
22272
|
-
let
|
|
22273
|
-
le && f && (
|
|
22272
|
+
let me;
|
|
22273
|
+
le && f && (me = {
|
|
22274
22274
|
[le]: f
|
|
22275
22275
|
}), s === "form" ? xe(() => {
|
|
22276
22276
|
V(!0), $({
|
|
22277
|
-
defaultValues:
|
|
22277
|
+
defaultValues: me
|
|
22278
22278
|
}), E(!0);
|
|
22279
22279
|
}) : (V(!0), $({
|
|
22280
|
-
defaultValues:
|
|
22280
|
+
defaultValues: me
|
|
22281
22281
|
}), E(!0));
|
|
22282
|
-
},
|
|
22282
|
+
}, se = async () => {
|
|
22283
22283
|
s === "form" ? xe(() => {
|
|
22284
22284
|
A(!0);
|
|
22285
22285
|
}) : A(!0);
|
|
@@ -22287,10 +22287,10 @@ const One2manyInput = (e) => {
|
|
|
22287
22287
|
C(!0), x(!1), F(void 0);
|
|
22288
22288
|
try {
|
|
22289
22289
|
if (Z[l].id > 0) {
|
|
22290
|
-
const le = o.map((
|
|
22291
|
-
...
|
|
22290
|
+
const le = o.map((me) => me.id === Z[l].id ? {
|
|
22291
|
+
...me,
|
|
22292
22292
|
operation: "pendingRemove"
|
|
22293
|
-
} :
|
|
22293
|
+
} : me);
|
|
22294
22294
|
G(le);
|
|
22295
22295
|
} else
|
|
22296
22296
|
G(o.filter((le) => le.id !== Z[l].id));
|
|
@@ -22298,31 +22298,31 @@ const One2manyInput = (e) => {
|
|
|
22298
22298
|
F(le);
|
|
22299
22299
|
}
|
|
22300
22300
|
c(0), C(!1);
|
|
22301
|
-
},
|
|
22302
|
-
const le = Z.filter((
|
|
22301
|
+
}, he = async () => {
|
|
22302
|
+
const le = Z.filter((me) => I.includes(me.id));
|
|
22303
22303
|
C(!0), x(!1), F(void 0);
|
|
22304
22304
|
try {
|
|
22305
|
-
const
|
|
22305
|
+
const me = le.map((pe) => pe.id), _e = o.filter((pe) => !(me.includes(pe.id) && pe.id < 0)).map((pe) => me.includes(pe.id) ? {
|
|
22306
22306
|
...pe,
|
|
22307
22307
|
operation: "pendingRemove"
|
|
22308
22308
|
} : pe);
|
|
22309
|
-
G(
|
|
22310
|
-
} catch (
|
|
22311
|
-
F(
|
|
22309
|
+
G(_e);
|
|
22310
|
+
} catch (me) {
|
|
22311
|
+
F(me);
|
|
22312
22312
|
}
|
|
22313
22313
|
c(0), C(!1);
|
|
22314
|
-
},
|
|
22314
|
+
}, ge = (le, me, _e) => {
|
|
22315
22315
|
let pe;
|
|
22316
22316
|
if (le)
|
|
22317
22317
|
pe = o.map((ye) => ye.id === le ? {
|
|
22318
22318
|
id: le,
|
|
22319
22319
|
operation: le > 0 ? "pendingUpdate" : "pendingCreate",
|
|
22320
22320
|
values: {
|
|
22321
|
-
...
|
|
22321
|
+
..._e,
|
|
22322
22322
|
id: le
|
|
22323
22323
|
},
|
|
22324
22324
|
treeValues: {
|
|
22325
|
-
...
|
|
22325
|
+
..._e,
|
|
22326
22326
|
id: le
|
|
22327
22327
|
}
|
|
22328
22328
|
} : ye);
|
|
@@ -22332,29 +22332,29 @@ const One2manyInput = (e) => {
|
|
|
22332
22332
|
id: ye,
|
|
22333
22333
|
operation: "pendingCreate",
|
|
22334
22334
|
values: {
|
|
22335
|
-
...
|
|
22335
|
+
..._e,
|
|
22336
22336
|
id: ye
|
|
22337
22337
|
},
|
|
22338
22338
|
treeValues: {
|
|
22339
|
-
...
|
|
22339
|
+
..._e,
|
|
22340
22340
|
id: ye
|
|
22341
22341
|
}
|
|
22342
22342
|
});
|
|
22343
22343
|
}
|
|
22344
22344
|
G(pe), q || E(!1);
|
|
22345
|
-
},
|
|
22345
|
+
}, ce = async (le) => {
|
|
22346
22346
|
const {
|
|
22347
|
-
id:
|
|
22347
|
+
id: me
|
|
22348
22348
|
} = le;
|
|
22349
|
-
let
|
|
22350
|
-
const pe = o.find((ye) => ye.id ===
|
|
22351
|
-
(pe == null ? void 0 : pe.values) === void 0 && (
|
|
22352
|
-
},
|
|
22349
|
+
let _e = o;
|
|
22350
|
+
const pe = o.find((ye) => ye.id === me);
|
|
22351
|
+
(pe == null ? void 0 : pe.values) === void 0 && (_e = await ee("form")), $(_e.find((ye) => ye.id === me)), V(!1), E(!0);
|
|
22352
|
+
}, Re = async (le) => {
|
|
22353
22353
|
C(!0);
|
|
22354
|
-
let
|
|
22355
|
-
const
|
|
22354
|
+
let me = o;
|
|
22355
|
+
const _e = le.filter((pe) => !o.find((ye) => ye.id === pe));
|
|
22356
22356
|
try {
|
|
22357
|
-
for (const pe of
|
|
22357
|
+
for (const pe of _e) {
|
|
22358
22358
|
const ye = (await ConnectionProvider.getHandler().readObjects({
|
|
22359
22359
|
model: L,
|
|
22360
22360
|
ids: [pe],
|
|
@@ -22372,54 +22372,54 @@ const One2manyInput = (e) => {
|
|
|
22372
22372
|
...k
|
|
22373
22373
|
}
|
|
22374
22374
|
}))[0];
|
|
22375
|
-
|
|
22375
|
+
me.push({
|
|
22376
22376
|
id: pe,
|
|
22377
22377
|
operation: "pendingLink",
|
|
22378
22378
|
values: ye,
|
|
22379
22379
|
treeValues: ve
|
|
22380
22380
|
});
|
|
22381
22381
|
}
|
|
22382
|
-
G(
|
|
22382
|
+
G(me);
|
|
22383
22383
|
} catch (pe) {
|
|
22384
22384
|
F(pe);
|
|
22385
22385
|
} finally {
|
|
22386
22386
|
C(!1);
|
|
22387
22387
|
}
|
|
22388
22388
|
};
|
|
22389
|
-
function
|
|
22389
|
+
function Ce() {
|
|
22390
22390
|
const le = ViewObjects[s];
|
|
22391
22391
|
if (s === "graph")
|
|
22392
22392
|
return parseGraph(a.get("graph").arch).string;
|
|
22393
22393
|
{
|
|
22394
|
-
const
|
|
22395
|
-
return
|
|
22394
|
+
const me = new le(a.get(s).fields);
|
|
22395
|
+
return me.parse(a.get(s).arch), me.string;
|
|
22396
22396
|
}
|
|
22397
22397
|
}
|
|
22398
22398
|
const Oe = () => {
|
|
22399
|
-
var
|
|
22399
|
+
var me, _e, pe, ye;
|
|
22400
22400
|
if (s === "form")
|
|
22401
22401
|
return Z.length === 0 ? m("noCurrentEntries") : s !== P.current && o.some((ve) => !ve.values) ? /* @__PURE__ */ jsx(Spin, {}) : /* @__PURE__ */ jsx(Form$1, {
|
|
22402
22402
|
formView: a.get("form"),
|
|
22403
|
-
values: (
|
|
22403
|
+
values: (me = Z[l]) == null ? void 0 : me.values,
|
|
22404
22404
|
parentContext: {
|
|
22405
22405
|
...v == null ? void 0 : v(),
|
|
22406
22406
|
...k
|
|
22407
22407
|
},
|
|
22408
22408
|
model: L,
|
|
22409
|
-
id: (
|
|
22409
|
+
id: (_e = Z[l]) == null ? void 0 : _e.id,
|
|
22410
22410
|
submitMode: "values",
|
|
22411
22411
|
onFieldsChange: (ve) => {
|
|
22412
22412
|
var ke;
|
|
22413
|
-
const
|
|
22413
|
+
const Te = (ke = Z[l]) == null ? void 0 : ke.id, Fe = o.map(($e) => $e.id === Te ? {
|
|
22414
22414
|
...$e,
|
|
22415
22415
|
operation: $e.operation === "original" ? "pendingUpdate" : $e.operation,
|
|
22416
22416
|
values: {
|
|
22417
22417
|
...ve,
|
|
22418
|
-
id:
|
|
22418
|
+
id: Te
|
|
22419
22419
|
},
|
|
22420
22420
|
treeValues: {
|
|
22421
22421
|
...ve,
|
|
22422
|
-
id:
|
|
22422
|
+
id: Te
|
|
22423
22423
|
}
|
|
22424
22424
|
} : $e);
|
|
22425
22425
|
G(Fe), x(!0);
|
|
@@ -22441,7 +22441,7 @@ const One2manyInput = (e) => {
|
|
|
22441
22441
|
treeView: a.get("tree"),
|
|
22442
22442
|
results: le,
|
|
22443
22443
|
loading: b,
|
|
22444
|
-
onRowClicked: ((ye = a.get("form")) == null ? void 0 : ye.fields) !== void 0 ?
|
|
22444
|
+
onRowClicked: ((ye = a.get("form")) == null ? void 0 : ye.fields) !== void 0 ? ce : void 0,
|
|
22445
22445
|
showPagination: !1,
|
|
22446
22446
|
rowSelection: {
|
|
22447
22447
|
selectedRowKeys: I,
|
|
@@ -22476,22 +22476,22 @@ const One2manyInput = (e) => {
|
|
|
22476
22476
|
type: "error",
|
|
22477
22477
|
banner: !0
|
|
22478
22478
|
});
|
|
22479
|
-
const
|
|
22479
|
+
const Ee = q;
|
|
22480
22480
|
return b ? /* @__PURE__ */ jsx(Spin, {}) : /* @__PURE__ */ jsxs(Fragment, {
|
|
22481
22481
|
children: [/* @__PURE__ */ jsx(One2manyTopBar, {
|
|
22482
22482
|
mode: s,
|
|
22483
|
-
title:
|
|
22483
|
+
title: Ce(),
|
|
22484
22484
|
readOnly: W,
|
|
22485
22485
|
isMany2Many: U,
|
|
22486
22486
|
formHasChanges: g,
|
|
22487
22487
|
totalItems: Z.length,
|
|
22488
22488
|
currentItemIndex: l,
|
|
22489
22489
|
onDelete: Se,
|
|
22490
|
-
onCreateItem:
|
|
22491
|
-
onToggleViewMode:
|
|
22490
|
+
onCreateItem: be,
|
|
22491
|
+
onToggleViewMode: ne,
|
|
22492
22492
|
onPreviousItem: te,
|
|
22493
|
-
onNextItem:
|
|
22494
|
-
onSearchItem:
|
|
22493
|
+
onNextItem: ae,
|
|
22494
|
+
onSearchItem: se,
|
|
22495
22495
|
selectedRowKeys: I,
|
|
22496
22496
|
showCreateButton: ((Pe = a.get("form")) == null ? void 0 : Pe.fields) !== void 0,
|
|
22497
22497
|
showToggleButton: a.size > 1
|
|
@@ -22503,7 +22503,7 @@ const One2manyInput = (e) => {
|
|
|
22503
22503
|
values: N == null ? void 0 : N.values,
|
|
22504
22504
|
defaultValues: N == null ? void 0 : N.defaultValues,
|
|
22505
22505
|
visible: w,
|
|
22506
|
-
onSubmitSucceed:
|
|
22506
|
+
onSubmitSucceed: ge,
|
|
22507
22507
|
parentContext: {
|
|
22508
22508
|
...v == null ? void 0 : v(),
|
|
22509
22509
|
...k
|
|
@@ -22512,7 +22512,7 @@ const One2manyInput = (e) => {
|
|
|
22512
22512
|
V(!1), E(!1);
|
|
22513
22513
|
},
|
|
22514
22514
|
readOnly: W,
|
|
22515
|
-
mustClearAfterSave:
|
|
22515
|
+
mustClearAfterSave: Ee
|
|
22516
22516
|
}), /* @__PURE__ */ jsx(SearchModal, {
|
|
22517
22517
|
domain: D.current,
|
|
22518
22518
|
model: L,
|
|
@@ -22522,7 +22522,7 @@ const One2manyInput = (e) => {
|
|
|
22522
22522
|
},
|
|
22523
22523
|
visible: S,
|
|
22524
22524
|
onSelectValues: async (le) => {
|
|
22525
|
-
A(!1),
|
|
22525
|
+
A(!1), Re(le);
|
|
22526
22526
|
},
|
|
22527
22527
|
onCloseModal: () => {
|
|
22528
22528
|
A(!1);
|
|
@@ -24902,126 +24902,127 @@ function ActionView(e, t) {
|
|
|
24902
24902
|
setCurrentId: P,
|
|
24903
24903
|
tabs: O,
|
|
24904
24904
|
activeKey: G,
|
|
24905
|
-
openAction: Q
|
|
24905
|
+
openAction: Q,
|
|
24906
|
+
onRemoveTab: ee
|
|
24906
24907
|
} = X || {};
|
|
24907
|
-
useHotkeys("ctrl+g,command+g", (
|
|
24908
|
-
|
|
24908
|
+
useHotkeys("ctrl+g,command+g", (se) => {
|
|
24909
|
+
se.preventDefault(), oe();
|
|
24909
24910
|
}, [G, O, m, N, I]);
|
|
24910
|
-
function
|
|
24911
|
-
E(
|
|
24911
|
+
function J(se) {
|
|
24912
|
+
E(se), P == null || P(se);
|
|
24912
24913
|
}
|
|
24913
|
-
function
|
|
24914
|
-
g(
|
|
24914
|
+
function ne(se) {
|
|
24915
|
+
g(se), Z == null || Z(se);
|
|
24915
24916
|
}
|
|
24916
24917
|
useImperativeHandle(t, () => ({
|
|
24917
|
-
canWeClose:
|
|
24918
|
+
canWeClose: ae
|
|
24918
24919
|
}));
|
|
24919
|
-
const
|
|
24920
|
+
const te = async () => {
|
|
24920
24921
|
T(!0);
|
|
24921
|
-
const
|
|
24922
|
-
for (const
|
|
24923
|
-
const [
|
|
24924
|
-
let
|
|
24922
|
+
const se = [];
|
|
24923
|
+
for (const he of o) {
|
|
24924
|
+
const [ge, ce] = he;
|
|
24925
|
+
let Re;
|
|
24925
24926
|
try {
|
|
24926
|
-
|
|
24927
|
+
ce !== "dashboard" && (Re = await ConnectionProvider.getHandler().getView({
|
|
24927
24928
|
model: n,
|
|
24928
|
-
type:
|
|
24929
|
-
id:
|
|
24929
|
+
type: ce,
|
|
24930
|
+
id: ge,
|
|
24930
24931
|
context: a
|
|
24931
24932
|
}));
|
|
24932
|
-
} catch (
|
|
24933
|
-
console.error(`${n} - ${
|
|
24933
|
+
} catch (Ce) {
|
|
24934
|
+
console.error(`${n} - ${ce}\xA0- ${JSON.stringify(Ce, null, 2)}`);
|
|
24934
24935
|
continue;
|
|
24935
24936
|
}
|
|
24936
|
-
switch (
|
|
24937
|
+
switch (ce) {
|
|
24937
24938
|
case "dashboard": {
|
|
24938
|
-
const
|
|
24939
|
-
const [,
|
|
24940
|
-
return
|
|
24939
|
+
const Ce = o.find((Ee) => {
|
|
24940
|
+
const [, Pe] = Ee;
|
|
24941
|
+
return Pe === "form";
|
|
24941
24942
|
});
|
|
24942
|
-
let
|
|
24943
|
-
|
|
24943
|
+
let Oe;
|
|
24944
|
+
Ce && (Oe = {
|
|
24944
24945
|
action_id: h,
|
|
24945
24946
|
action_type: v,
|
|
24946
24947
|
name: s,
|
|
24947
24948
|
res_id: a.active_id,
|
|
24948
24949
|
res_model: n,
|
|
24949
|
-
view_id:
|
|
24950
|
-
view_type:
|
|
24951
|
-
}),
|
|
24950
|
+
view_id: Ce[0],
|
|
24951
|
+
view_type: Ce[1]
|
|
24952
|
+
}), se.push({
|
|
24952
24953
|
type: "dashboard",
|
|
24953
24954
|
id: a.active_id,
|
|
24954
24955
|
model: n,
|
|
24955
24956
|
context: a,
|
|
24956
|
-
configAction:
|
|
24957
|
+
configAction: Oe
|
|
24957
24958
|
});
|
|
24958
24959
|
break;
|
|
24959
24960
|
}
|
|
24960
24961
|
case "form": {
|
|
24961
|
-
|
|
24962
|
-
...
|
|
24963
|
-
type:
|
|
24962
|
+
se.push({
|
|
24963
|
+
...Re,
|
|
24964
|
+
type: ce
|
|
24964
24965
|
});
|
|
24965
24966
|
break;
|
|
24966
24967
|
}
|
|
24967
24968
|
case "tree": {
|
|
24968
|
-
|
|
24969
|
-
...
|
|
24969
|
+
se.push({
|
|
24970
|
+
...Re,
|
|
24970
24971
|
isExpandable: y,
|
|
24971
|
-
type:
|
|
24972
|
+
type: ce
|
|
24972
24973
|
});
|
|
24973
24974
|
break;
|
|
24974
24975
|
}
|
|
24975
24976
|
case "graph": {
|
|
24976
|
-
|
|
24977
|
-
...
|
|
24978
|
-
type:
|
|
24977
|
+
se.push({
|
|
24978
|
+
...Re,
|
|
24979
|
+
type: ce
|
|
24979
24980
|
});
|
|
24980
24981
|
break;
|
|
24981
24982
|
}
|
|
24982
24983
|
}
|
|
24983
24984
|
}
|
|
24984
|
-
let
|
|
24985
|
-
!c &&
|
|
24986
|
-
Please, make sure the view ids on the fields_view_get responses are the same as the ones defined in the action`),
|
|
24985
|
+
let fe;
|
|
24986
|
+
!c && se.find((he) => he.type === "tree") ? fe = se.find((ge) => ge.type === "tree") : c ? fe = se.find((ge) => c.id ? ge.type === c.type && ge.view_id === c.id : ge.type === c.type) : fe = se.find((ge) => ge.type === "form"), fe || (showDialog$8(`Error determining the first view to show for model ${n}.
|
|
24987
|
+
Please, make sure the view ids on the fields_view_get responses are the same as the ones defined in the action`), ee == null || ee(l)), ne(fe), b(se), T(!1);
|
|
24987
24988
|
};
|
|
24988
24989
|
u({
|
|
24989
24990
|
tabKey: l,
|
|
24990
|
-
canWeClose:
|
|
24991
|
+
canWeClose: ae
|
|
24991
24992
|
}), useEffect(() => {
|
|
24992
|
-
const
|
|
24993
|
-
|
|
24993
|
+
const se = x.find((he) => he.type === "tree"), fe = x.find((he) => c.id ? he.type === c.type && he.view_id === c.id : he.type === c.type);
|
|
24994
|
+
ne(fe || se), p ? P == null || P(F) : (J(void 0), $(void 0)), te();
|
|
24994
24995
|
}, [n, o, p]), useEffect(() => {
|
|
24995
24996
|
G === l && (P == null || P(w), Z == null || Z(m));
|
|
24996
24997
|
}, [O, G]);
|
|
24997
|
-
async function
|
|
24998
|
-
return m.type === "form" ? await M.current.cancelUnsavedChanges() : !0;
|
|
24998
|
+
async function ae() {
|
|
24999
|
+
return m && m.type === "form" ? await M.current.cancelUnsavedChanges() : !0;
|
|
24999
25000
|
}
|
|
25000
25001
|
async function oe() {
|
|
25001
25002
|
G === l && (m.type === "form" && !await M.current.cancelUnsavedChanges() || Y(!0));
|
|
25002
25003
|
}
|
|
25003
|
-
async function se
|
|
25004
|
-
var
|
|
25004
|
+
async function xe(se) {
|
|
25005
|
+
var ce;
|
|
25005
25006
|
K(!0);
|
|
25006
|
-
const
|
|
25007
|
-
let
|
|
25008
|
-
if (
|
|
25007
|
+
const fe = I.findIndex((Re) => Re.id === se);
|
|
25008
|
+
let he;
|
|
25009
|
+
if (fe === -1) {
|
|
25009
25010
|
try {
|
|
25010
|
-
|
|
25011
|
+
he = (ce = await ConnectionProvider.getHandler().readObjects({
|
|
25011
25012
|
model: n,
|
|
25012
|
-
ids: [
|
|
25013
|
+
ids: [se],
|
|
25013
25014
|
context: a
|
|
25014
|
-
})) == null ? void 0 :
|
|
25015
|
+
})) == null ? void 0 : ce[0];
|
|
25015
25016
|
} catch {
|
|
25016
25017
|
}
|
|
25017
|
-
if (!
|
|
25018
|
+
if (!he) {
|
|
25018
25019
|
K(!1), Y(!1), showDialog$7(k("idNotFound"));
|
|
25019
25020
|
return;
|
|
25020
25021
|
}
|
|
25021
25022
|
} else
|
|
25022
|
-
|
|
25023
|
+
he = I[fe];
|
|
25023
25024
|
K(!1), Y(!1);
|
|
25024
|
-
const
|
|
25025
|
+
const ge = o.find((Re) => Re[1] === "form");
|
|
25025
25026
|
Q({
|
|
25026
25027
|
domain: [],
|
|
25027
25028
|
context: a,
|
|
@@ -25030,23 +25031,23 @@ Please, make sure the view ids on the fields_view_get responses are the same as
|
|
|
25030
25031
|
title: s,
|
|
25031
25032
|
target: "current",
|
|
25032
25033
|
initialView: {
|
|
25033
|
-
id:
|
|
25034
|
+
id: ge == null ? void 0 : ge[0],
|
|
25034
25035
|
type: "form"
|
|
25035
25036
|
},
|
|
25036
25037
|
action_id: h,
|
|
25037
25038
|
action_type: v,
|
|
25038
|
-
res_id:
|
|
25039
|
+
res_id: se
|
|
25039
25040
|
});
|
|
25040
25041
|
}
|
|
25041
|
-
function
|
|
25042
|
-
return x.map((
|
|
25043
|
-
switch (
|
|
25042
|
+
function Se() {
|
|
25043
|
+
return x.map((se) => {
|
|
25044
|
+
switch (se.type) {
|
|
25044
25045
|
case "form":
|
|
25045
25046
|
return /* @__PURE__ */ jsx(FormActionView, {
|
|
25046
25047
|
formRef: M,
|
|
25047
25048
|
currentId: w,
|
|
25048
|
-
visible: m.type ===
|
|
25049
|
-
formView:
|
|
25049
|
+
visible: m.type === se.type && m.view_id === se.view_id,
|
|
25050
|
+
formView: se,
|
|
25050
25051
|
model: n,
|
|
25051
25052
|
context: a,
|
|
25052
25053
|
domain: r,
|
|
@@ -25055,60 +25056,60 @@ Please, make sure the view ids on the fields_view_get responses are the same as
|
|
|
25055
25056
|
results: I,
|
|
25056
25057
|
setResults: j,
|
|
25057
25058
|
setCurrentItemIndex: $
|
|
25058
|
-
}, `${
|
|
25059
|
+
}, `${se.type}-${se.view_id}`);
|
|
25059
25060
|
case "tree":
|
|
25060
25061
|
return /* @__PURE__ */ jsx(TreeActionView, {
|
|
25061
|
-
visible: m.type ===
|
|
25062
|
+
visible: m.type === se.type && m.view_id === se.view_id,
|
|
25062
25063
|
limit: _,
|
|
25063
25064
|
model: n,
|
|
25064
25065
|
context: a,
|
|
25065
25066
|
domain: r,
|
|
25066
|
-
formView: x.find((
|
|
25067
|
-
treeView:
|
|
25067
|
+
formView: x.find((fe) => fe.type === "form"),
|
|
25068
|
+
treeView: se,
|
|
25068
25069
|
searchTreeRef: U,
|
|
25069
25070
|
searchTreeNameSearch: W,
|
|
25070
25071
|
availableViews: x,
|
|
25071
25072
|
results: I,
|
|
25072
25073
|
setCurrentItemIndex: $,
|
|
25073
|
-
setCurrentId:
|
|
25074
|
-
setCurrentView:
|
|
25075
|
-
}, `${
|
|
25074
|
+
setCurrentId: J,
|
|
25075
|
+
setCurrentView: ne
|
|
25076
|
+
}, `${se.type}-${se.view_id}`);
|
|
25076
25077
|
case "graph":
|
|
25077
25078
|
return /* @__PURE__ */ jsx(GraphActionView, {
|
|
25078
|
-
visible: m.type ===
|
|
25079
|
-
viewData:
|
|
25079
|
+
visible: m.type === se.type && m.view_id === se.view_id,
|
|
25080
|
+
viewData: se,
|
|
25080
25081
|
model: n,
|
|
25081
25082
|
context: a,
|
|
25082
25083
|
domain: r,
|
|
25083
|
-
treeView: x.find((
|
|
25084
|
-
formView: x.find((
|
|
25085
|
-
}, `${
|
|
25084
|
+
treeView: x.find((fe) => fe.type === "tree"),
|
|
25085
|
+
formView: x.find((fe) => fe.type === "form")
|
|
25086
|
+
}, `${se.type}-${se.view_id}`);
|
|
25086
25087
|
case "dashboard":
|
|
25087
25088
|
return /* @__PURE__ */ jsx(DashboardActionView, {
|
|
25088
|
-
dashboardData:
|
|
25089
|
-
}, `${
|
|
25089
|
+
dashboardData: se
|
|
25090
|
+
}, `${se.type}-${se.view_id}`);
|
|
25090
25091
|
}
|
|
25091
25092
|
});
|
|
25092
25093
|
}
|
|
25093
|
-
function
|
|
25094
|
+
function be() {
|
|
25094
25095
|
if (w === void 0 && m.type === "form")
|
|
25095
25096
|
M.current.clearAndReload();
|
|
25096
25097
|
else {
|
|
25097
|
-
|
|
25098
|
-
const
|
|
25099
|
-
|
|
25098
|
+
J(void 0);
|
|
25099
|
+
const se = x.find((fe) => fe.type === "form");
|
|
25100
|
+
ne(se);
|
|
25100
25101
|
}
|
|
25101
25102
|
}
|
|
25102
25103
|
return C ? /* @__PURE__ */ jsx(Spin, {}) : m ? /* @__PURE__ */ jsxs(ActionViewProvider, {
|
|
25103
25104
|
title: s,
|
|
25104
25105
|
currentView: m,
|
|
25105
|
-
setCurrentView:
|
|
25106
|
+
setCurrentView: ne,
|
|
25106
25107
|
availableViews: x,
|
|
25107
25108
|
formRef: M,
|
|
25108
25109
|
searchTreeRef: U,
|
|
25109
|
-
onNewClicked:
|
|
25110
|
+
onNewClicked: be,
|
|
25110
25111
|
currentId: w,
|
|
25111
|
-
setCurrentId:
|
|
25112
|
+
setCurrentId: J,
|
|
25112
25113
|
setCurrentItemIndex: $,
|
|
25113
25114
|
currentItemIndex: N,
|
|
25114
25115
|
results: I,
|
|
@@ -25122,11 +25123,11 @@ Please, make sure the view ids on the fields_view_get responses are the same as
|
|
|
25122
25123
|
setSelectedRowItems: A,
|
|
25123
25124
|
setSearchTreeNameSearch: L,
|
|
25124
25125
|
searchTreeNameSearch: W,
|
|
25125
|
-
goToResourceId:
|
|
25126
|
+
goToResourceId: xe,
|
|
25126
25127
|
limit: _,
|
|
25127
|
-
children: [
|
|
25128
|
+
children: [Se(), /* @__PURE__ */ jsx(GoToResourceModal, {
|
|
25128
25129
|
visible: z,
|
|
25129
|
-
onIdSubmitted:
|
|
25130
|
+
onIdSubmitted: xe,
|
|
25130
25131
|
isSearching: H,
|
|
25131
25132
|
onCancel: () => {
|
|
25132
25133
|
Y(!1);
|
|
@@ -25342,8 +25343,8 @@ function DashboardTree(e) {
|
|
|
25342
25343
|
attrs: G && {
|
|
25343
25344
|
colors: G
|
|
25344
25345
|
}
|
|
25345
|
-
}),
|
|
25346
|
-
E(
|
|
25346
|
+
}), ne = await Q;
|
|
25347
|
+
E(ne), $(getColorMap(J));
|
|
25347
25348
|
const te = sortResults({
|
|
25348
25349
|
resultsToSort: ee,
|
|
25349
25350
|
sorter: I,
|