dynamic-mui 2.5.1 → 2.5.2
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/{AIForm-D8_6RVmA.js → AIForm-CAlzDffx.js} +2 -2
- package/dist/{AIForm-BVJ7qhP5.mjs → AIForm-DhR29Z6d.mjs} +2 -2
- package/dist/{accordion-B3fSXKqC.js → accordion-B1Laqpu6.js} +1 -1
- package/dist/{accordion-BxTjyh5y.mjs → accordion-DRo0ZP5u.mjs} +1 -1
- package/dist/{addressfield-C9VaV9xw.mjs → addressfield-1Ht4A4u9.mjs} +1 -1
- package/dist/{addressfield-Cv8zK_sb.js → addressfield-DEu_5gQv.js} +1 -1
- package/dist/ai/index.cjs +1 -1
- package/dist/ai/index.mjs +1 -1
- package/dist/{asyncautocomplete-BveFRqpV.mjs → asyncautocomplete-BPTtLquY.mjs} +1 -1
- package/dist/{asyncautocomplete-CoOb7mtv.js → asyncautocomplete-DPn-jVl4.js} +1 -1
- package/dist/{bar-CE_D8esp.js → bar-CEFjy1KY.js} +1 -1
- package/dist/{bar-BfMaIpfo.mjs → bar-CkCZunh6.mjs} +1 -1
- package/dist/{cascadeselect-C53hT-C-.mjs → cascadeselect-BKqX6e3j.mjs} +1 -1
- package/dist/{cascadeselect-CWECmehh.js → cascadeselect-DCMmaKxY.js} +1 -1
- package/dist/collection-B6mXg1EE.js +1 -0
- package/dist/{collection-HUYkt74J.mjs → collection-D6iGJnXe.mjs} +317 -300
- package/dist/{colorpicker-BRQPl_IL.mjs → colorpicker-DRC4NHgd.mjs} +1 -1
- package/dist/{colorpicker-zE3r16Gc.js → colorpicker-VOk6ZC89.js} +1 -1
- package/dist/{consentfield-CEddOmCa.js → consentfield-Bogbxanw.js} +1 -1
- package/dist/{consentfield-Cylid9il.mjs → consentfield-DHIVXzhj.mjs} +1 -1
- package/dist/{datatable-BWimO7zD.mjs → datatable-DU0W9LHs.mjs} +1 -1
- package/dist/{datatable-3MUZQhnx.js → datatable-DUdM8xtY.js} +1 -1
- package/dist/dynamic-mui.cjs +1 -1
- package/dist/dynamic-mui.mjs +2 -2
- package/dist/{editabletable-CVJ14zrm.mjs → editabletable-D801lgHY.mjs} +1 -1
- package/dist/{editabletable--ow4E3bB.js → editabletable-De_BiNVx.js} +1 -1
- package/dist/{fileupload-DHiYLdJ5.mjs → fileupload-CozsBlXX.mjs} +1 -1
- package/dist/{fileupload-B7f6VOb0.js → fileupload-YGYUpPXo.js} +1 -1
- package/dist/{formrepeater-BGZGTcVb.mjs → formrepeater-LXzfFY3V.mjs} +1 -1
- package/dist/{formrepeater-CvWeLug8.js → formrepeater-iD9e1ow4.js} +1 -1
- package/dist/{formwizard-BeJK5mqc.mjs → formwizard-Bb0LOmIN.mjs} +1 -1
- package/dist/{formwizard-DrHKFPfN.js → formwizard-CuDayHm6.js} +1 -1
- package/dist/{geofield-Bchfb6__.mjs → geofield-B22-bJ0f.mjs} +1 -1
- package/dist/{geofield-thoXisie.js → geofield-DkB-js8Y.js} +1 -1
- package/dist/{group-DUnv46e_.mjs → group-B5vjjzsk.mjs} +1 -1
- package/dist/{group-B3QBe0YI.js → group-B_WI43pI.js} +1 -1
- package/dist/{intlphone-CMXEolsT.js → intlphone-CkHQ2YvK.js} +1 -1
- package/dist/{intlphone-BY59PVDg.mjs → intlphone-DnqGCNdx.mjs} +1 -1
- package/dist/{keyvaluefield-FBaHQ8Ak.js → keyvaluefield-CX97ykNT.js} +1 -1
- package/dist/{keyvaluefield-BAYbTkCY.mjs → keyvaluefield-Dm5dRen5.mjs} +1 -1
- package/dist/{line-Bk15u06y.js → line-CjQk91Nq.js} +1 -1
- package/dist/{line-Bzbkzk7f.mjs → line-pFBz6CTL.mjs} +1 -1
- package/dist/{lineitemlist-PsoQ4LU4.mjs → lineitemlist-B5JJqhjg.mjs} +1 -1
- package/dist/{lineitemlist-8NL2THwe.js → lineitemlist-C39r0qRM.js} +1 -1
- package/dist/{list-BGzVPlgh.mjs → list-73Pemuh_.mjs} +1 -1
- package/dist/{list-BmGiSIoi.js → list-CkVSoMPM.js} +1 -1
- package/dist/{locationfield-BG76gNbD.js → locationfield-DLFggIVT.js} +1 -1
- package/dist/{locationfield-CupDmXsM.mjs → locationfield-DY8wZ-Vv.mjs} +1 -1
- package/dist/{markdowneditor-vDHguMtU.js → markdowneditor-BtF43ekZ.js} +1 -1
- package/dist/{markdowneditor-4StkbrKV.mjs → markdowneditor-VfwnN9cX.mjs} +1 -1
- package/dist/{matrixfield-CeROIIAj.mjs → matrixfield-BIKQg7FM.mjs} +1 -1
- package/dist/{matrixfield-Vptf0zNH.js → matrixfield-BjdsHrtX.js} +1 -1
- package/dist/{multitextbox-DtSydHcv.js → multitextbox-BNZ6kVPG.js} +1 -1
- package/dist/{multitextbox-DeVv6uzi.mjs → multitextbox-DqLIw1i-.mjs} +1 -1
- package/dist/{npsscale-Dwp2T0DQ.js → npsscale-B2JYIHr8.js} +1 -1
- package/dist/{npsscale-Cd7PoCJS.mjs → npsscale-CWFVm0wp.mjs} +1 -1
- package/dist/{numberstepper-DBKq7hUm.js → numberstepper-Cpb7ceR4.js} +1 -1
- package/dist/{numberstepper-BFNTu3Ii.mjs → numberstepper-DLwZsyV1.mjs} +1 -1
- package/dist/{pie-DKRRH37e.mjs → pie-AC1_bQ6M.mjs} +1 -1
- package/dist/{pie-CE4QV82D.js → pie-BZhroZyG.js} +1 -1
- package/dist/{richtexteditor-DdIfi0-T.mjs → richtexteditor-Bwn62mA-.mjs} +1 -1
- package/dist/{richtexteditor-B6lK2iIt.js → richtexteditor-DDIzZxki.js} +1 -1
- package/dist/{signature-B_drsWTj.js → signature-DtXYAy1a.js} +1 -1
- package/dist/{signature-D9B8bFqg.mjs → signature-z2PB3zv7.mjs} +1 -1
- package/dist/{stepper-D6e9yWIr.mjs → stepper-B8Blpvp8.mjs} +1 -1
- package/dist/{stepper-CO6XiIaw.js → stepper-o3Ef6Czl.js} +1 -1
- package/dist/{summaryfield-CR3aNMZU.js → summaryfield-2t_sXF8P.js} +1 -1
- package/dist/{summaryfield-BIA2gc1w.mjs → summaryfield-CTQL3W7R.mjs} +1 -1
- package/dist/{tabs-B4ZbZQvt.js → tabs-DlIOUQ5z.js} +1 -1
- package/dist/{tabs-PgOpdVX1.mjs → tabs-lqveygGh.mjs} +1 -1
- package/dist/{tagsinput-G_M0DbpI.mjs → tagsinput-C2awcyJT.mjs} +1 -1
- package/dist/{tagsinput-DtNb1IuV.js → tagsinput-g_-HLhtt.js} +1 -1
- package/dist/util/collection.d.ts +1 -0
- package/package.json +1 -1
- package/dist/collection-Cf87KWZM.js +0 -1
|
@@ -1,145 +1,145 @@
|
|
|
1
1
|
import { jsxs as h, jsx as n, Fragment as St } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { R as
|
|
4
|
-
import { ButtonBase as
|
|
2
|
+
import { useRef as Je, useState as Y, Fragment as Re } from "react";
|
|
3
|
+
import { R as Ae, S as Ct, T as kt, U as wt, W as At, X as Ye, Y as Tt, Z as It, _ as zt, $ as Ze, a0 as Mt, a1 as _t, a2 as $t, a3 as qt, a4 as jt, a5 as Wt, a6 as Et, a7 as Dt, a8 as Qe, a9 as Rt, aa as Ot, ab as Bt, ac as Lt, ad as Pt, ae as Ft, af as $e, ag as Vt, ah as et, F as Gt, ai as Ht, aj as oe, ak as Nt, al as Ut, am as Te, an as tt, j as Oe, ao as Kt } from "./AIForm-DhR29Z6d.mjs";
|
|
4
|
+
import { ButtonBase as nt, Icon as j, Button as Z, Typography as R, Box as f, Tooltip as U, useMediaQuery as rt, Dialog as at, IconButton as X, DialogContent as ot, DialogActions as it, Menu as Xt, MenuItem as pe, ListItemIcon as xe, ListItemText as me, Table as Jt, TableHead as Yt, TableRow as he, TableCell as K, TableBody as Zt, Collapse as lt } from "@mui/material";
|
|
5
5
|
import { alpha as p, useTheme as J } from "@mui/material/styles";
|
|
6
6
|
let Qt = 0;
|
|
7
|
-
const
|
|
8
|
-
const a = new Set(
|
|
9
|
-
(t.collections || []).map((c) => [c.id,
|
|
7
|
+
const ie = () => `dmui-col-${++Qt}`, st = (e) => (e.collections || []).map((t) => t.id), en = (e) => Object.fromEntries(st(e).map((t) => [t, []])), Ie = (e, t) => Ae(e).map((r) => {
|
|
8
|
+
const a = new Set(st(t)), i = Object.fromEntries(Object.entries(r).filter(([c]) => !a.has(c))), l = Object.fromEntries(
|
|
9
|
+
(t.collections || []).map((c) => [c.id, Ie(r[c.id], c)])
|
|
10
10
|
);
|
|
11
|
-
return { key:
|
|
12
|
-
}),
|
|
11
|
+
return { key: ie(), data: i, children: l };
|
|
12
|
+
}), ze = (e, t) => e.map((r) => {
|
|
13
13
|
const a = { ...r.data };
|
|
14
14
|
return (t.collections || []).forEach((i) => {
|
|
15
|
-
a[i.id] =
|
|
15
|
+
a[i.id] = ze(r.children[i.id] || [], i);
|
|
16
16
|
}), a;
|
|
17
|
-
}),
|
|
18
|
-
key:
|
|
17
|
+
}), ct = (e) => ({
|
|
18
|
+
key: ie(),
|
|
19
19
|
data: Ct(e.data),
|
|
20
|
-
children: Object.fromEntries(Object.entries(e.children).map(([t, r]) => [t, r.map(
|
|
20
|
+
children: Object.fromEntries(Object.entries(e.children).map(([t, r]) => [t, r.map(ct)]))
|
|
21
21
|
});
|
|
22
|
-
var
|
|
23
|
-
function
|
|
24
|
-
if (
|
|
25
|
-
|
|
22
|
+
var fe, Be;
|
|
23
|
+
function dt() {
|
|
24
|
+
if (Be) return fe;
|
|
25
|
+
Be = 1;
|
|
26
26
|
var e = kt(), t = wt();
|
|
27
27
|
function r(a, i, l) {
|
|
28
28
|
(l !== void 0 && !t(a[i], l) || l === void 0 && !(i in a)) && e(a, i, l);
|
|
29
29
|
}
|
|
30
|
-
return
|
|
30
|
+
return fe = r, fe;
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var ge, Le;
|
|
33
33
|
function tn() {
|
|
34
|
-
if (
|
|
35
|
-
|
|
36
|
-
var e = At(), t =
|
|
34
|
+
if (Le) return ge;
|
|
35
|
+
Le = 1;
|
|
36
|
+
var e = At(), t = Ye();
|
|
37
37
|
function r(a) {
|
|
38
38
|
return t(a) && e(a);
|
|
39
39
|
}
|
|
40
|
-
return
|
|
40
|
+
return ge = r, ge;
|
|
41
41
|
}
|
|
42
|
-
var
|
|
42
|
+
var be, Pe;
|
|
43
43
|
function nn() {
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
var e = Tt(), t = It(), r =
|
|
47
|
-
function d(
|
|
48
|
-
if (!r(
|
|
44
|
+
if (Pe) return be;
|
|
45
|
+
Pe = 1;
|
|
46
|
+
var e = Tt(), t = It(), r = Ye(), a = "[object Object]", i = Function.prototype, l = Object.prototype, c = i.toString, x = l.hasOwnProperty, g = c.call(Object);
|
|
47
|
+
function d(y) {
|
|
48
|
+
if (!r(y) || e(y) != a)
|
|
49
49
|
return !1;
|
|
50
|
-
var b = t(
|
|
50
|
+
var b = t(y);
|
|
51
51
|
if (b === null)
|
|
52
52
|
return !0;
|
|
53
53
|
var o = x.call(b, "constructor") && b.constructor;
|
|
54
54
|
return typeof o == "function" && o instanceof o && c.call(o) == g;
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return be = d, be;
|
|
57
57
|
}
|
|
58
|
-
var
|
|
59
|
-
function
|
|
60
|
-
if (
|
|
61
|
-
|
|
58
|
+
var ue, Fe;
|
|
59
|
+
function pt() {
|
|
60
|
+
if (Fe) return ue;
|
|
61
|
+
Fe = 1;
|
|
62
62
|
function e(t, r) {
|
|
63
63
|
if (!(r === "constructor" && typeof t[r] == "function") && r != "__proto__")
|
|
64
64
|
return t[r];
|
|
65
65
|
}
|
|
66
|
-
return
|
|
66
|
+
return ue = e, ue;
|
|
67
67
|
}
|
|
68
|
-
var
|
|
68
|
+
var ye, Ve;
|
|
69
69
|
function rn() {
|
|
70
|
-
if (
|
|
71
|
-
|
|
72
|
-
var e = zt(), t =
|
|
70
|
+
if (Ve) return ye;
|
|
71
|
+
Ve = 1;
|
|
72
|
+
var e = zt(), t = Ze();
|
|
73
73
|
function r(a) {
|
|
74
74
|
return e(a, t(a));
|
|
75
75
|
}
|
|
76
|
-
return
|
|
76
|
+
return ye = r, ye;
|
|
77
77
|
}
|
|
78
|
-
var
|
|
78
|
+
var ve, Ge;
|
|
79
79
|
function an() {
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
var e =
|
|
83
|
-
function I(A, k, M, W, P,
|
|
84
|
-
var w =
|
|
85
|
-
if (
|
|
86
|
-
e(A, M,
|
|
80
|
+
if (Ge) return ve;
|
|
81
|
+
Ge = 1;
|
|
82
|
+
var e = dt(), t = Mt(), r = _t(), a = $t(), i = qt(), l = jt(), c = Wt(), x = tn(), g = Et(), d = Dt(), y = Qe(), b = nn(), o = Rt(), v = pt(), S = rn();
|
|
83
|
+
function I(A, k, M, W, P, q, _) {
|
|
84
|
+
var w = v(A, M), C = v(k, M), V = _.get(C);
|
|
85
|
+
if (V) {
|
|
86
|
+
e(A, M, V);
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
-
var
|
|
89
|
+
var $ = q ? q(w, C, M + "", A, k, _) : void 0, E = $ === void 0;
|
|
90
90
|
if (E) {
|
|
91
|
-
var D = c(
|
|
92
|
-
|
|
91
|
+
var D = c(C), O = !D && g(C), N = !D && !O && o(C);
|
|
92
|
+
$ = C, D || O || N ? c(w) ? $ = w : x(w) ? $ = a(w) : O ? (E = !1, $ = t(C, !0)) : N ? (E = !1, $ = r(C, !0)) : $ = [] : b(C) || l(C) ? ($ = w, l(w) ? $ = S(w) : (!y(w) || d(w)) && ($ = i(C))) : E = !1;
|
|
93
93
|
}
|
|
94
|
-
E && (
|
|
94
|
+
E && (_.set(C, $), P($, C, W, q, _), _.delete(C)), e(A, M, $);
|
|
95
95
|
}
|
|
96
|
-
return
|
|
96
|
+
return ve = I, ve;
|
|
97
97
|
}
|
|
98
|
-
var
|
|
98
|
+
var Se, He;
|
|
99
99
|
function on() {
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
var e =
|
|
103
|
-
function x(g, d,
|
|
104
|
-
g !== d && r(d, function(
|
|
105
|
-
if (o || (o = new e()), i(
|
|
106
|
-
a(g, d,
|
|
100
|
+
if (He) return Se;
|
|
101
|
+
He = 1;
|
|
102
|
+
var e = Ot(), t = dt(), r = Bt(), a = an(), i = Qe(), l = Ze(), c = pt();
|
|
103
|
+
function x(g, d, y, b, o) {
|
|
104
|
+
g !== d && r(d, function(v, S) {
|
|
105
|
+
if (o || (o = new e()), i(v))
|
|
106
|
+
a(g, d, S, y, x, b, o);
|
|
107
107
|
else {
|
|
108
|
-
var I = b ? b(c(g,
|
|
109
|
-
I === void 0 && (I =
|
|
108
|
+
var I = b ? b(c(g, S), v, S + "", g, d, o) : void 0;
|
|
109
|
+
I === void 0 && (I = v), t(g, S, I);
|
|
110
110
|
}
|
|
111
111
|
}, l);
|
|
112
112
|
}
|
|
113
|
-
return
|
|
113
|
+
return Se = x, Se;
|
|
114
114
|
}
|
|
115
|
-
var
|
|
115
|
+
var Ce, Ne;
|
|
116
116
|
function ln() {
|
|
117
|
-
if (
|
|
118
|
-
|
|
117
|
+
if (Ne) return Ce;
|
|
118
|
+
Ne = 1;
|
|
119
119
|
var e = Lt(), t = Pt();
|
|
120
120
|
function r(a) {
|
|
121
121
|
return e(function(i, l) {
|
|
122
122
|
var c = -1, x = l.length, g = x > 1 ? l[x - 1] : void 0, d = x > 2 ? l[2] : void 0;
|
|
123
123
|
for (g = a.length > 3 && typeof g == "function" ? (x--, g) : void 0, d && t(l[0], l[1], d) && (g = x < 3 ? void 0 : g, x = 1), i = Object(i); ++c < x; ) {
|
|
124
|
-
var
|
|
125
|
-
|
|
124
|
+
var y = l[c];
|
|
125
|
+
y && a(i, y, c, g);
|
|
126
126
|
}
|
|
127
127
|
return i;
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
return
|
|
130
|
+
return Ce = r, Ce;
|
|
131
131
|
}
|
|
132
|
-
var
|
|
132
|
+
var ke, Ue;
|
|
133
133
|
function sn() {
|
|
134
|
-
if (
|
|
135
|
-
|
|
134
|
+
if (Ue) return ke;
|
|
135
|
+
Ue = 1;
|
|
136
136
|
var e = on(), t = ln(), r = t(function(a, i, l) {
|
|
137
137
|
e(a, i, l);
|
|
138
138
|
});
|
|
139
|
-
return
|
|
139
|
+
return ke = r, ke;
|
|
140
140
|
}
|
|
141
141
|
var cn = sn();
|
|
142
|
-
const dn = /* @__PURE__ */ Ft(cn),
|
|
142
|
+
const dn = /* @__PURE__ */ Ft(cn), xt = (e, t) => {
|
|
143
143
|
const r = e.palette[t || "primary"];
|
|
144
144
|
if (r && typeof r == "object" && r.main) return r;
|
|
145
145
|
try {
|
|
@@ -147,7 +147,7 @@ const dn = /* @__PURE__ */ Ft(cn), pt = (e, t) => {
|
|
|
147
147
|
} catch {
|
|
148
148
|
return e.palette.primary;
|
|
149
149
|
}
|
|
150
|
-
},
|
|
150
|
+
}, mt = (e, t) => e.palette.mode === "dark" ? t.light : t.dark, pn = {
|
|
151
151
|
add: "Add {label}",
|
|
152
152
|
addMore: "Add another {labelLower}",
|
|
153
153
|
emptyTitle: "No {pluralLower} yet",
|
|
@@ -186,8 +186,8 @@ const dn = /* @__PURE__ */ Ft(cn), pt = (e, t) => {
|
|
|
186
186
|
if (e == null) return `repeat(auto-fill, minmax(min(${t}px, 100%), 1fr))`;
|
|
187
187
|
const r = (a) => `repeat(${Math.max(1, a)}, minmax(0, 1fr))`;
|
|
188
188
|
return typeof e == "number" ? r(e) : Object.fromEntries(Object.entries(e).map(([a, i]) => [a, r(Number(i))]));
|
|
189
|
-
},
|
|
190
|
-
const i = r > 0, l =
|
|
189
|
+
}, Ke = (e) => e == null ? [] : Array.isArray(e) ? e : [e], hn = (e, t, r, a = {}) => {
|
|
190
|
+
const i = r > 0, l = xt(e, t.color), c = $e(t), x = Vt(t), g = { ...pn, ...a, ...t.texts || {} }, d = t.styles || {}, y = {
|
|
191
191
|
label: c,
|
|
192
192
|
labelLower: c.toLowerCase(),
|
|
193
193
|
plural: x,
|
|
@@ -199,7 +199,7 @@ const dn = /* @__PURE__ */ Ft(cn), pt = (e, t) => {
|
|
|
199
199
|
depth: r,
|
|
200
200
|
nested: i,
|
|
201
201
|
accent: l,
|
|
202
|
-
ink:
|
|
202
|
+
ink: mt(e, l),
|
|
203
203
|
icon: t.icon || (i ? "label" : "folder_open"),
|
|
204
204
|
itemLabel: c,
|
|
205
205
|
plural: x,
|
|
@@ -214,8 +214,8 @@ const dn = /* @__PURE__ */ Ft(cn), pt = (e, t) => {
|
|
|
214
214
|
},
|
|
215
215
|
// Simple by default: edit + delete. Duplicate / move / collapse are opt-in.
|
|
216
216
|
actions: { edit: !0, delete: !0, duplicate: !1, move: !1, collapse: !1, ...t.actions || {} },
|
|
217
|
-
t: (b, o = {}) => xn(String(g[b] ?? ""), { ...
|
|
218
|
-
sx: (b, o) => [...
|
|
217
|
+
t: (b, o = {}) => xn(String(g[b] ?? ""), { ...y, ...o }),
|
|
218
|
+
sx: (b, o) => [...Ke(o), ...Ke(d[b])],
|
|
219
219
|
merged: (b, o = {}) => dn({}, o, d[b] || {})
|
|
220
220
|
};
|
|
221
221
|
}, ee = "cubic-bezier(0.4, 0, 0.2, 1)";
|
|
@@ -256,10 +256,10 @@ function bn({ ui: e, mode: t, title: r, index: a }) {
|
|
|
256
256
|
bgcolor: p(e.accent.main, 0.1),
|
|
257
257
|
color: e.ink,
|
|
258
258
|
"& .MuiIcon-root": { fontSize: 20 }
|
|
259
|
-
}), children: t === "initials" ? gn(r) : t === "index" ? a + 1 : /* @__PURE__ */ n(
|
|
259
|
+
}), children: t === "initials" ? gn(r) : t === "index" ? a + 1 : /* @__PURE__ */ n(j, { children: e.icon }) });
|
|
260
260
|
}
|
|
261
261
|
function un({ ui: e, text: t, color: r }) {
|
|
262
|
-
const a = J(), i = r === "default" ? null :
|
|
262
|
+
const a = J(), i = r === "default" ? null : xt(a, r);
|
|
263
263
|
return /* @__PURE__ */ n(
|
|
264
264
|
f,
|
|
265
265
|
{
|
|
@@ -277,7 +277,7 @@ function un({ ui: e, text: t, color: r }) {
|
|
|
277
277
|
whiteSpace: "nowrap",
|
|
278
278
|
letterSpacing: "0.02em",
|
|
279
279
|
bgcolor: i ? p(i.main, 0.1) : p(a.palette.text.primary, 0.06),
|
|
280
|
-
color: i ?
|
|
280
|
+
color: i ? mt(a, i) : "text.secondary",
|
|
281
281
|
border: `1px solid ${i ? p(i.main, 0.25) : p(a.palette.text.primary, 0.12)}`,
|
|
282
282
|
"&::before": {
|
|
283
283
|
content: '""',
|
|
@@ -292,12 +292,12 @@ function un({ ui: e, text: t, color: r }) {
|
|
|
292
292
|
}
|
|
293
293
|
);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
const { variant: l, icon: c, size: x, fullWidth: g } = e.addButton, d = t === "footer" && !r ? e.t("addMore") : e.t("add"),
|
|
295
|
+
function Xe({ ui: e, placement: t, empty: r, disabled: a, onClick: i }) {
|
|
296
|
+
const { variant: l, icon: c, size: x, fullWidth: g } = e.addButton, d = t === "footer" && !r ? e.t("addMore") : e.t("add"), y = e.config.max != null && a, b = !!g || l === "dashed" && g !== !1, o = (S) => /* @__PURE__ */ n(U, { title: y ? e.t("maxReached") : "", children: /* @__PURE__ */ n(f, { component: "span", sx: { display: b ? "block" : "inline-flex", flexShrink: 0 }, children: S }) });
|
|
297
297
|
if (l === "dashed")
|
|
298
298
|
return o(
|
|
299
299
|
/* @__PURE__ */ h(
|
|
300
|
-
|
|
300
|
+
nt,
|
|
301
301
|
{
|
|
302
302
|
onClick: i,
|
|
303
303
|
disabled: a,
|
|
@@ -322,13 +322,13 @@ function Ke({ ui: e, placement: t, empty: r, disabled: a, onClick: i }) {
|
|
|
322
322
|
"& .MuiIcon-root": { fontSize: 19 }
|
|
323
323
|
}),
|
|
324
324
|
children: [
|
|
325
|
-
/* @__PURE__ */ n(
|
|
325
|
+
/* @__PURE__ */ n(j, { children: c }),
|
|
326
326
|
d
|
|
327
327
|
]
|
|
328
328
|
}
|
|
329
329
|
)
|
|
330
330
|
);
|
|
331
|
-
const
|
|
331
|
+
const v = {
|
|
332
332
|
contained: { bgcolor: e.accent.main, color: e.accent.contrastText, "&:hover": { bgcolor: e.accent.dark } },
|
|
333
333
|
outlined: { color: e.ink, borderColor: p(e.accent.main, 0.5), "&:hover": { borderColor: e.accent.main, bgcolor: p(e.accent.main, 0.05) } },
|
|
334
334
|
text: { color: e.ink, "&:hover": { bgcolor: p(e.accent.main, 0.07) } },
|
|
@@ -336,7 +336,7 @@ function Ke({ ui: e, placement: t, empty: r, disabled: a, onClick: i }) {
|
|
|
336
336
|
}[l] || {};
|
|
337
337
|
return o(
|
|
338
338
|
/* @__PURE__ */ n(
|
|
339
|
-
|
|
339
|
+
Z,
|
|
340
340
|
{
|
|
341
341
|
onClick: i,
|
|
342
342
|
disabled: a,
|
|
@@ -345,14 +345,14 @@ function Ke({ ui: e, placement: t, empty: r, disabled: a, onClick: i }) {
|
|
|
345
345
|
size: x || (e.nested ? "small" : "medium"),
|
|
346
346
|
fullWidth: g,
|
|
347
347
|
disableElevation: !0,
|
|
348
|
-
startIcon: /* @__PURE__ */ n(
|
|
348
|
+
startIcon: /* @__PURE__ */ n(j, { children: c }),
|
|
349
349
|
sx: e.sx("addButton", {
|
|
350
350
|
textTransform: "none",
|
|
351
351
|
fontWeight: 600,
|
|
352
352
|
borderRadius: "8px",
|
|
353
353
|
px: e.nested ? 1.5 : 2,
|
|
354
354
|
whiteSpace: "nowrap",
|
|
355
|
-
...
|
|
355
|
+
...v
|
|
356
356
|
}),
|
|
357
357
|
children: d
|
|
358
358
|
}
|
|
@@ -361,12 +361,12 @@ function Ke({ ui: e, placement: t, empty: r, disabled: a, onClick: i }) {
|
|
|
361
361
|
}
|
|
362
362
|
const yn = (e) => /^[aeiou]/i.test(e) ? "an" : "a", vn = (e) => e.length <= 1 ? e.join("") : `${e.slice(0, -1).join(", ")} and ${e[e.length - 1]}`, Sn = (e) => {
|
|
363
363
|
if (e.nested) return "";
|
|
364
|
-
const t = e.itemLabel.toLowerCase(), r = (e.config.collections || []).map((a) =>
|
|
364
|
+
const t = e.itemLabel.toLowerCase(), r = (e.config.collections || []).map((a) => et($e(a)).toLowerCase());
|
|
365
365
|
return r.length ? `Add ${yn(t)} ${t}, then add its ${vn(r)}.` : `Add your first ${t} to get started.`;
|
|
366
366
|
};
|
|
367
367
|
function Cn({ ui: e, readOnly: t, error: r }) {
|
|
368
368
|
const a = J(), i = e.texts.emptyText != null ? e.t("emptyText") : Sn(e);
|
|
369
|
-
return e.nested ? /* @__PURE__ */ n(
|
|
369
|
+
return e.nested ? /* @__PURE__ */ n(R, { sx: e.sx("empty", {
|
|
370
370
|
fontSize: 13,
|
|
371
371
|
color: "text.disabled",
|
|
372
372
|
fontStyle: "italic",
|
|
@@ -395,31 +395,31 @@ function Cn({ ui: e, readOnly: t, error: r }) {
|
|
|
395
395
|
justifyContent: "center",
|
|
396
396
|
mx: "auto",
|
|
397
397
|
mb: 1.5
|
|
398
|
-
}, children: /* @__PURE__ */ n(
|
|
399
|
-
/* @__PURE__ */ n(
|
|
400
|
-
i && !t && /* @__PURE__ */ n(
|
|
398
|
+
}, children: /* @__PURE__ */ n(j, { sx: { color: e.ink, fontSize: "22px !important" }, children: e.icon || "inbox" }) }),
|
|
399
|
+
/* @__PURE__ */ n(R, { sx: e.sx("emptyTitle", { fontSize: 15, fontWeight: 600, color: "text.primary" }), children: e.t("emptyTitle") }),
|
|
400
|
+
i && !t && /* @__PURE__ */ n(R, { sx: e.sx("emptyText", { fontSize: 13.5, color: "text.secondary", mt: 0.5, maxWidth: 380, mx: "auto" }), children: i })
|
|
401
401
|
]
|
|
402
402
|
}
|
|
403
403
|
);
|
|
404
404
|
}
|
|
405
405
|
function kn({ ui: e, open: t, mode: r, guid: a, session: i, initial: l, context: c, onClose: x, onSave: g }) {
|
|
406
|
-
const d = J(),
|
|
407
|
-
const
|
|
408
|
-
!
|
|
406
|
+
const d = J(), y = e.config.dialog || {}, b = rt(d.breakpoints.down("sm")), o = y.fullScreen === !0 || y.fullScreen !== !1 && b, v = Je(null), [S, I] = Y(0), { accent: A } = e, k = e.t(r === "add" ? "dialogAddTitle" : r === "edit" ? "dialogEditTitle" : "dialogViewTitle"), M = `${a}-dialog-${i}-${S}`, W = e.t("dialogContext"), [P, q] = W.includes("{parent}") ? W.split("{parent}") : [W, null], _ = (w) => {
|
|
407
|
+
const C = v.current;
|
|
408
|
+
!C || !C.validate() || (g({ ...C.getValues() }, w), w && I((V) => V + 1));
|
|
409
409
|
};
|
|
410
410
|
return /* @__PURE__ */ h(
|
|
411
|
-
|
|
411
|
+
at,
|
|
412
412
|
{
|
|
413
413
|
open: t,
|
|
414
|
-
onClose: (w,
|
|
415
|
-
|
|
414
|
+
onClose: (w, C) => {
|
|
415
|
+
C !== "backdropClick" && x();
|
|
416
416
|
},
|
|
417
417
|
fullScreen: o,
|
|
418
418
|
fullWidth: !0,
|
|
419
|
-
maxWidth:
|
|
419
|
+
maxWidth: y.maxWidth || "sm",
|
|
420
420
|
"aria-labelledby": `${a}-dialog-title`,
|
|
421
421
|
onKeyDown: (w) => {
|
|
422
|
-
r !== "view" && w.key === "Enter" && (w.metaKey || w.ctrlKey) && (w.preventDefault(),
|
|
422
|
+
r !== "view" && w.key === "Enter" && (w.metaKey || w.ctrlKey) && (w.preventDefault(), _(!1));
|
|
423
423
|
},
|
|
424
424
|
sx: {
|
|
425
425
|
"& .MuiDialog-paper": e.merged("dialog", {
|
|
@@ -438,55 +438,55 @@ function kn({ ui: e, open: t, mode: r, guid: a, session: i, initial: l, context:
|
|
|
438
438
|
borderBottom: `1px solid ${d.palette.divider}`
|
|
439
439
|
}), children: [
|
|
440
440
|
/* @__PURE__ */ h(f, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
441
|
-
/* @__PURE__ */ n(
|
|
442
|
-
c && /* @__PURE__ */ h(
|
|
441
|
+
/* @__PURE__ */ n(R, { id: `${a}-dialog-title`, sx: e.sx("dialogTitle", { fontWeight: 600, fontSize: 18, lineHeight: 1.3 }), children: k }),
|
|
442
|
+
c && /* @__PURE__ */ h(R, { sx: e.sx("dialogContext", { fontSize: 13.5, color: "text.secondary", mt: 0.25 }), children: [
|
|
443
443
|
P,
|
|
444
|
-
|
|
445
|
-
|
|
444
|
+
q !== null && /* @__PURE__ */ n(f, { component: "strong", sx: { color: "text.primary", fontWeight: 600 }, children: c }),
|
|
445
|
+
q
|
|
446
446
|
] }),
|
|
447
|
-
|
|
447
|
+
y.description && /* @__PURE__ */ n(R, { sx: e.sx("dialogDescription", { fontSize: 13.5, color: "text.secondary", mt: 0.25 }), children: y.description })
|
|
448
448
|
] }),
|
|
449
|
-
/* @__PURE__ */ n(X, { "aria-label": e.t("closeAria"), onClick: x, size: "small", sx: { mt: -0.5, mr: -1, color: "text.secondary" }, children: /* @__PURE__ */ n(
|
|
449
|
+
/* @__PURE__ */ n(X, { "aria-label": e.t("closeAria"), onClick: x, size: "small", sx: { mt: -0.5, mr: -1, color: "text.secondary" }, children: /* @__PURE__ */ n(j, { children: "close" }) })
|
|
450
450
|
] }),
|
|
451
|
-
/* @__PURE__ */ n(
|
|
451
|
+
/* @__PURE__ */ n(ot, { sx: e.sx("dialogContent", { px: { xs: 2, sm: 3 }, pt: "20px !important", pb: 3 }), children: /* @__PURE__ */ n(
|
|
452
452
|
Gt,
|
|
453
453
|
{
|
|
454
454
|
guid: M,
|
|
455
455
|
data: e.config.fields || [],
|
|
456
456
|
patch: r === "add" ? {} : l || {},
|
|
457
|
-
apiRef:
|
|
457
|
+
apiRef: v,
|
|
458
458
|
readOnly: r === "view",
|
|
459
|
-
MuiGridAttributes: { spacing:
|
|
459
|
+
MuiGridAttributes: { spacing: y.spacing ?? 2 }
|
|
460
460
|
},
|
|
461
461
|
M
|
|
462
462
|
) }),
|
|
463
|
-
/* @__PURE__ */ n(
|
|
463
|
+
/* @__PURE__ */ n(it, { sx: e.sx("dialogActions", {
|
|
464
464
|
px: { xs: 2, sm: 3 },
|
|
465
465
|
py: 1.5,
|
|
466
466
|
gap: 1,
|
|
467
467
|
flexWrap: "wrap",
|
|
468
468
|
borderTop: `1px solid ${d.palette.divider}`,
|
|
469
469
|
"& .MuiButton-root": { textTransform: "none", fontWeight: 600, borderRadius: "8px", px: 2, whiteSpace: "nowrap", ml: "0 !important" }
|
|
470
|
-
}), children: r === "view" ? /* @__PURE__ */ n(
|
|
471
|
-
/* @__PURE__ */ n(
|
|
472
|
-
r === "add" &&
|
|
473
|
-
|
|
470
|
+
}), children: r === "view" ? /* @__PURE__ */ n(Z, { variant: "contained", disableElevation: !0, onClick: x, sx: e.sx("dialogSave", { bgcolor: A.main, color: A.contrastText, "&:hover": { bgcolor: A.dark } }), children: e.t("close") }) : /* @__PURE__ */ h(St, { children: [
|
|
471
|
+
/* @__PURE__ */ n(Z, { onClick: x, color: "inherit", sx: e.sx("dialogCancel", { color: "text.secondary" }), children: e.t("cancel") }),
|
|
472
|
+
r === "add" && y.addAnother !== !1 && /* @__PURE__ */ n(
|
|
473
|
+
Z,
|
|
474
474
|
{
|
|
475
475
|
variant: "outlined",
|
|
476
476
|
color: "inherit",
|
|
477
|
-
onClick: () =>
|
|
477
|
+
onClick: () => _(!0),
|
|
478
478
|
sx: e.sx("dialogSaveAnother", { color: e.ink, borderColor: p(A.main, 0.5), "&:hover": { borderColor: A.main, bgcolor: p(A.main, 0.06) } }),
|
|
479
479
|
children: e.t("saveAndAddAnother")
|
|
480
480
|
}
|
|
481
481
|
),
|
|
482
482
|
/* @__PURE__ */ n(U, { title: e.t("shortcut"), placement: "top", describeChild: !0, children: /* @__PURE__ */ n(
|
|
483
|
-
|
|
483
|
+
Z,
|
|
484
484
|
{
|
|
485
485
|
variant: "contained",
|
|
486
486
|
color: "inherit",
|
|
487
487
|
disableElevation: !0,
|
|
488
|
-
startIcon: /* @__PURE__ */ n(
|
|
489
|
-
onClick: () =>
|
|
488
|
+
startIcon: /* @__PURE__ */ n(j, { children: r === "add" ? "add" : "check" }),
|
|
489
|
+
onClick: () => _(!1),
|
|
490
490
|
sx: e.sx("dialogSave", { bgcolor: A.main, color: A.contrastText, "&:hover": { bgcolor: A.dark } }),
|
|
491
491
|
children: r === "add" ? e.t("save") : e.t("saveChanges")
|
|
492
492
|
}
|
|
@@ -511,11 +511,11 @@ function wn({ ui: e, count: t, required: r, action: a, alone: i = !1 }) {
|
|
|
511
511
|
alignItems: "center",
|
|
512
512
|
justifyContent: "center",
|
|
513
513
|
flexShrink: 0
|
|
514
|
-
}, children: /* @__PURE__ */ n(
|
|
514
|
+
}, children: /* @__PURE__ */ n(j, { sx: e.sx("headerIcon", {
|
|
515
515
|
color: e.ink,
|
|
516
516
|
fontSize: `${l ? 14 : 18}px !important`
|
|
517
517
|
}), children: e.icon }) }),
|
|
518
|
-
/* @__PURE__ */ h(
|
|
518
|
+
/* @__PURE__ */ h(R, { sx: e.sx("headerTitle", {
|
|
519
519
|
fontWeight: 700,
|
|
520
520
|
fontSize: l ? 14 : 19,
|
|
521
521
|
lineHeight: 1.3,
|
|
@@ -526,7 +526,7 @@ function wn({ ui: e, count: t, required: r, action: a, alone: i = !1 }) {
|
|
|
526
526
|
] }),
|
|
527
527
|
/* @__PURE__ */ n(fn, { ui: e, n: t })
|
|
528
528
|
] }),
|
|
529
|
-
e.config.description && /* @__PURE__ */ n(
|
|
529
|
+
e.config.description && /* @__PURE__ */ n(R, { sx: e.sx("headerDescription", {
|
|
530
530
|
fontSize: 13.5,
|
|
531
531
|
color: "text.secondary",
|
|
532
532
|
mt: 0.5,
|
|
@@ -536,9 +536,9 @@ function wn({ ui: e, count: t, required: r, action: a, alone: i = !1 }) {
|
|
|
536
536
|
a
|
|
537
537
|
] });
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function Me({ ui: e, title: t, canEdit: r, onOpen: a, size: i }) {
|
|
540
540
|
return /* @__PURE__ */ n(
|
|
541
|
-
|
|
541
|
+
nt,
|
|
542
542
|
{
|
|
543
543
|
onClick: a,
|
|
544
544
|
"aria-label": r ? void 0 : e.t("viewAria", { title: t }),
|
|
@@ -560,32 +560,32 @@ function ze({ ui: e, title: t, canEdit: r, onOpen: a, size: i }) {
|
|
|
560
560
|
}
|
|
561
561
|
);
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function _e({ ui: e, data: t }) {
|
|
564
564
|
const r = e.config.display || {}, a = typeof r.badge == "string" ? { field: r.badge } : r.badge;
|
|
565
565
|
if (!a) return null;
|
|
566
|
-
const i = t[a.field], l =
|
|
566
|
+
const i = t[a.field], l = tt(Te(e.config.fields || [], a.field), i);
|
|
567
567
|
if (!l) return null;
|
|
568
568
|
const c = a.colors?.[String(i)] ?? a.colors?.[l] ?? "default";
|
|
569
569
|
return /* @__PURE__ */ n(un, { ui: e, text: l, color: c });
|
|
570
570
|
}
|
|
571
571
|
function An({ ui: e, title: t, readOnly: r, open: a, canToggle: i, onEdit: l, onDelete: c, onMenu: x, onToggle: g }) {
|
|
572
|
-
const d = J(),
|
|
572
|
+
const d = J(), y = !r && e.actions.edit, b = !r && e.actions.delete, o = !r && (e.actions.duplicate || e.actions.move), v = (S, I) => ({
|
|
573
573
|
width: 30,
|
|
574
574
|
height: 30,
|
|
575
575
|
borderRadius: "8px",
|
|
576
|
-
color:
|
|
576
|
+
color: S,
|
|
577
577
|
transition: `background-color .15s ${ee}, color .15s ${ee}`,
|
|
578
578
|
"&:hover": { bgcolor: I }
|
|
579
579
|
});
|
|
580
580
|
return /* @__PURE__ */ h(f, { sx: e.sx("actions", { display: "flex", alignItems: "center", gap: 0.25, flexShrink: 0 }), children: [
|
|
581
|
-
|
|
581
|
+
y && /* @__PURE__ */ n(U, { title: e.t("edit"), children: /* @__PURE__ */ n(
|
|
582
582
|
X,
|
|
583
583
|
{
|
|
584
584
|
size: "small",
|
|
585
585
|
"aria-label": e.t("editAria", { title: t }),
|
|
586
586
|
onClick: l,
|
|
587
|
-
sx: e.sx("actionButton",
|
|
588
|
-
children: /* @__PURE__ */ n(
|
|
587
|
+
sx: e.sx("actionButton", v(e.ink, p(e.accent.main, 0.1))),
|
|
588
|
+
children: /* @__PURE__ */ n(j, { sx: { fontSize: "17px !important" }, children: "edit" })
|
|
589
589
|
}
|
|
590
590
|
) }),
|
|
591
591
|
b && /* @__PURE__ */ n(U, { title: e.t("delete"), children: /* @__PURE__ */ n(
|
|
@@ -594,8 +594,8 @@ function An({ ui: e, title: t, readOnly: r, open: a, canToggle: i, onEdit: l, on
|
|
|
594
594
|
size: "small",
|
|
595
595
|
"aria-label": e.t("deleteAria", { title: t }),
|
|
596
596
|
onClick: c,
|
|
597
|
-
sx: e.sx("actionButton",
|
|
598
|
-
children: /* @__PURE__ */ n(
|
|
597
|
+
sx: e.sx("actionButton", v(d.palette.error.main, p(d.palette.error.main, 0.08))),
|
|
598
|
+
children: /* @__PURE__ */ n(j, { sx: { fontSize: "17px !important" }, children: "delete_outline" })
|
|
599
599
|
}
|
|
600
600
|
) }),
|
|
601
601
|
o && /* @__PURE__ */ n(U, { title: e.t("more"), children: /* @__PURE__ */ n(
|
|
@@ -603,9 +603,9 @@ function An({ ui: e, title: t, readOnly: r, open: a, canToggle: i, onEdit: l, on
|
|
|
603
603
|
{
|
|
604
604
|
size: "small",
|
|
605
605
|
"aria-label": e.t("moreAria", { title: t }),
|
|
606
|
-
onClick: (
|
|
607
|
-
sx: e.sx("actionButton",
|
|
608
|
-
children: /* @__PURE__ */ n(
|
|
606
|
+
onClick: (S) => x(S.currentTarget),
|
|
607
|
+
sx: e.sx("actionButton", v(d.palette.text.secondary, p(d.palette.text.primary, 0.07))),
|
|
608
|
+
children: /* @__PURE__ */ n(j, { sx: { fontSize: "17px !important" }, children: "more_vert" })
|
|
609
609
|
}
|
|
610
610
|
) }),
|
|
611
611
|
i && /* @__PURE__ */ n(U, { title: a ? e.t("collapse") : e.t("expand"), children: /* @__PURE__ */ n(
|
|
@@ -615,15 +615,15 @@ function An({ ui: e, title: t, readOnly: r, open: a, canToggle: i, onEdit: l, on
|
|
|
615
615
|
"aria-label": e.t(a ? "collapseAria" : "expandAria", { title: t }),
|
|
616
616
|
"aria-expanded": a,
|
|
617
617
|
onClick: g,
|
|
618
|
-
sx: e.sx("actionButton",
|
|
619
|
-
children: /* @__PURE__ */ n(
|
|
618
|
+
sx: e.sx("actionButton", v(d.palette.text.secondary, p(d.palette.text.primary, 0.07))),
|
|
619
|
+
children: /* @__PURE__ */ n(j, { sx: { fontSize: "19px !important", transition: `transform .2s ${ee}`, transform: a ? "rotate(180deg)" : "none" }, children: "expand_more" })
|
|
620
620
|
}
|
|
621
621
|
) })
|
|
622
622
|
] });
|
|
623
623
|
}
|
|
624
|
-
function
|
|
625
|
-
const d = J(),
|
|
626
|
-
return /* @__PURE__ */ n(f, { sx: e.sx("sections", { display: "grid", gridTemplateColumns: mn(e.config.sectionColumns ?? 1, 320) }), children:
|
|
624
|
+
function ht({ ui: e, node: t, guid: r, readOnly: a, issues: i, showErrors: l, texts: c, parentTitle: x, onChildChange: g }) {
|
|
625
|
+
const d = J(), y = e.config.collections || [];
|
|
626
|
+
return /* @__PURE__ */ n(f, { sx: e.sx("sections", { display: "grid", gridTemplateColumns: mn(e.config.sectionColumns ?? 1, 320) }), children: y.map((b, o) => /* @__PURE__ */ n(
|
|
627
627
|
f,
|
|
628
628
|
{
|
|
629
629
|
sx: e.sx("section", {
|
|
@@ -634,15 +634,15 @@ function mt({ ui: e, node: t, guid: r, readOnly: a, issues: i, showErrors: l, te
|
|
|
634
634
|
...o > 0 ? { borderLeft: `1px solid ${d.palette.divider}` } : {}
|
|
635
635
|
}),
|
|
636
636
|
children: /* @__PURE__ */ n(f, { sx: { px: { xs: 2, sm: 2.5 }, pt: { xs: 1.5, sm: 1.75 }, pb: { xs: 1.25, sm: 1.5 } }, children: /* @__PURE__ */ n(
|
|
637
|
-
|
|
637
|
+
ft,
|
|
638
638
|
{
|
|
639
639
|
config: b,
|
|
640
640
|
nodes: t.children[b.id] || [],
|
|
641
|
-
onChange: (
|
|
641
|
+
onChange: (v) => g(b.id, v),
|
|
642
642
|
guid: `${r}-${t.key}`,
|
|
643
643
|
depth: e.depth + 1,
|
|
644
644
|
readOnly: a,
|
|
645
|
-
issues: i.filter((
|
|
645
|
+
issues: i.filter((v) => v.path[0] === b.id).map((v) => ({ ...v, path: v.path.slice(1) })),
|
|
646
646
|
showErrors: l,
|
|
647
647
|
parentTitle: x,
|
|
648
648
|
texts: c
|
|
@@ -652,28 +652,28 @@ function mt({ ui: e, node: t, guid: r, readOnly: a, issues: i, showErrors: l, te
|
|
|
652
652
|
b.id
|
|
653
653
|
)) });
|
|
654
654
|
}
|
|
655
|
-
function Tn({ ui: e, node: t, index: r, guid: a, readOnly: i, collapsed: l, issues: c, showErrors: x, texts: g, onOpen: d, onDelete:
|
|
656
|
-
const
|
|
655
|
+
function Tn({ ui: e, node: t, index: r, guid: a, readOnly: i, collapsed: l, issues: c, showErrors: x, texts: g, onOpen: d, onDelete: y, onMenu: b, onToggle: o, onChildChange: v }) {
|
|
656
|
+
const S = J(), { config: I } = e, A = I.display || {}, { title: k, subtitle: M, details: W } = oe(t.data, I, r), P = I.collections || [], q = P.length > 0, _ = x && c.length > 0, w = A.avatar || "none", C = !i && e.actions.edit, V = !i && e.actions.delete, $ = !i && (e.actions.duplicate || e.actions.move), E = W.length > 0 || q, D = !l, O = _ ? p(S.palette.error.main, 0.05) : p(e.accent.main, 0.05), N = _ ? p(S.palette.error.main, 0.2) : p(e.accent.main, 0.15), G = (m, u) => ({
|
|
657
657
|
width: 30,
|
|
658
658
|
height: 30,
|
|
659
659
|
borderRadius: "8px",
|
|
660
660
|
color: m,
|
|
661
661
|
transition: `background-color .15s ${ee}`,
|
|
662
|
-
"&:hover": { bgcolor:
|
|
662
|
+
"&:hover": { bgcolor: u }
|
|
663
663
|
});
|
|
664
664
|
return /* @__PURE__ */ h(f, { sx: e.sx("item", {
|
|
665
|
-
border: `1px solid ${
|
|
665
|
+
border: `1px solid ${_ ? S.palette.error.main : S.palette.divider}`,
|
|
666
666
|
borderRadius: "14px",
|
|
667
667
|
overflow: "hidden",
|
|
668
668
|
bgcolor: "background.paper",
|
|
669
|
-
boxShadow: `0 1px 3px ${p(
|
|
669
|
+
boxShadow: `0 1px 3px ${p(S.palette.common.black, 0.06)}, 0 4px 12px ${p(S.palette.common.black, 0.04)}`
|
|
670
670
|
}), children: [
|
|
671
671
|
/* @__PURE__ */ h(f, { sx: e.sx("itemHeader", {
|
|
672
672
|
px: { xs: 2, sm: 2.5 },
|
|
673
673
|
pt: { xs: 1.75, sm: 2 },
|
|
674
674
|
pb: { xs: 1.5, sm: 1.75 },
|
|
675
|
-
bgcolor:
|
|
676
|
-
borderBottom: D && E ? `1px solid ${
|
|
675
|
+
bgcolor: O,
|
|
676
|
+
borderBottom: D && E ? `1px solid ${N}` : "1px solid transparent",
|
|
677
677
|
transition: `border-color .2s ${ee}`,
|
|
678
678
|
display: "flex",
|
|
679
679
|
alignItems: "flex-start",
|
|
@@ -682,10 +682,10 @@ function Tn({ ui: e, node: t, index: r, guid: a, readOnly: i, collapsed: l, issu
|
|
|
682
682
|
w !== "none" && /* @__PURE__ */ n(bn, { ui: e, mode: w, title: k, index: r }),
|
|
683
683
|
/* @__PURE__ */ h(f, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
684
684
|
/* @__PURE__ */ h(f, { sx: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 0.75, mb: M ? 0.25 : 0 }, children: [
|
|
685
|
-
/* @__PURE__ */ n(
|
|
686
|
-
/* @__PURE__ */ n(
|
|
685
|
+
/* @__PURE__ */ n(Me, { ui: e, title: k, canEdit: C, onOpen: d, size: 15.5 }),
|
|
686
|
+
/* @__PURE__ */ n(_e, { ui: e, data: t.data })
|
|
687
687
|
] }),
|
|
688
|
-
M && /* @__PURE__ */ h(
|
|
688
|
+
M && /* @__PURE__ */ h(R, { sx: e.sx("subtitle", {
|
|
689
689
|
display: "flex",
|
|
690
690
|
alignItems: "center",
|
|
691
691
|
gap: 0.4,
|
|
@@ -694,11 +694,11 @@ function Tn({ ui: e, node: t, index: r, guid: a, readOnly: i, collapsed: l, issu
|
|
|
694
694
|
wordBreak: "break-word",
|
|
695
695
|
"& .MuiIcon-root": { fontSize: 14, color: "text.disabled" }
|
|
696
696
|
}), children: [
|
|
697
|
-
A.subtitleIcon && /* @__PURE__ */ n(
|
|
697
|
+
A.subtitleIcon && /* @__PURE__ */ n(j, { children: A.subtitleIcon }),
|
|
698
698
|
M
|
|
699
699
|
] }),
|
|
700
|
-
!D &&
|
|
701
|
-
const
|
|
700
|
+
!D && q && /* @__PURE__ */ n(f, { sx: { display: "flex", flexWrap: "wrap", gap: 0.75, mt: 0.6 }, children: P.map((m) => {
|
|
701
|
+
const u = (t.children[m.id] || []).length;
|
|
702
702
|
return /* @__PURE__ */ h(f, { component: "span", sx: {
|
|
703
703
|
fontSize: 12,
|
|
704
704
|
fontWeight: 600,
|
|
@@ -709,41 +709,41 @@ function Tn({ ui: e, node: t, index: r, guid: a, readOnly: i, collapsed: l, issu
|
|
|
709
709
|
color: e.ink,
|
|
710
710
|
border: `1px solid ${p(e.accent.main, 0.18)}`
|
|
711
711
|
}, children: [
|
|
712
|
-
|
|
712
|
+
u,
|
|
713
713
|
" ",
|
|
714
|
-
|
|
714
|
+
et($e(m), u).toLowerCase()
|
|
715
715
|
] }, m.id);
|
|
716
716
|
}) })
|
|
717
717
|
] }),
|
|
718
718
|
/* @__PURE__ */ h(f, { sx: { display: "flex", alignItems: "center", flexShrink: 0, gap: 0.25, mt: -0.25 }, children: [
|
|
719
|
-
|
|
719
|
+
C && /* @__PURE__ */ n(U, { title: e.t("edit"), children: /* @__PURE__ */ n(
|
|
720
720
|
X,
|
|
721
721
|
{
|
|
722
722
|
size: "small",
|
|
723
723
|
"aria-label": e.t("editAria", { title: k }),
|
|
724
724
|
onClick: d,
|
|
725
|
-
sx:
|
|
726
|
-
children: /* @__PURE__ */ n(
|
|
725
|
+
sx: G(e.ink, p(e.accent.main, 0.1)),
|
|
726
|
+
children: /* @__PURE__ */ n(j, { sx: { fontSize: "17px !important" }, children: "edit" })
|
|
727
727
|
}
|
|
728
728
|
) }),
|
|
729
|
-
|
|
729
|
+
V && /* @__PURE__ */ n(U, { title: e.t("delete"), children: /* @__PURE__ */ n(
|
|
730
730
|
X,
|
|
731
731
|
{
|
|
732
732
|
size: "small",
|
|
733
733
|
"aria-label": e.t("deleteAria", { title: k }),
|
|
734
|
-
onClick:
|
|
735
|
-
sx:
|
|
736
|
-
children: /* @__PURE__ */ n(
|
|
734
|
+
onClick: y,
|
|
735
|
+
sx: G(S.palette.error.main, p(S.palette.error.main, 0.08)),
|
|
736
|
+
children: /* @__PURE__ */ n(j, { sx: { fontSize: "17px !important" }, children: "delete_outline" })
|
|
737
737
|
}
|
|
738
738
|
) }),
|
|
739
|
-
|
|
739
|
+
$ && /* @__PURE__ */ n(U, { title: e.t("more"), children: /* @__PURE__ */ n(
|
|
740
740
|
X,
|
|
741
741
|
{
|
|
742
742
|
size: "small",
|
|
743
743
|
"aria-label": e.t("moreAria", { title: k }),
|
|
744
744
|
onClick: (m) => b(m.currentTarget),
|
|
745
|
-
sx:
|
|
746
|
-
children: /* @__PURE__ */ n(
|
|
745
|
+
sx: G(S.palette.text.secondary, p(S.palette.text.primary, 0.07)),
|
|
746
|
+
children: /* @__PURE__ */ n(j, { sx: { fontSize: "17px !important" }, children: "more_vert" })
|
|
747
747
|
}
|
|
748
748
|
) }),
|
|
749
749
|
E && /* @__PURE__ */ n(U, { title: D ? e.t("collapse") : e.t("expand"), children: /* @__PURE__ */ n(
|
|
@@ -752,8 +752,8 @@ function Tn({ ui: e, node: t, index: r, guid: a, readOnly: i, collapsed: l, issu
|
|
|
752
752
|
size: "small",
|
|
753
753
|
"aria-label": e.t(D ? "collapseAria" : "expandAria", { title: k }),
|
|
754
754
|
onClick: o,
|
|
755
|
-
sx:
|
|
756
|
-
children: /* @__PURE__ */ n(
|
|
755
|
+
sx: G(S.palette.text.secondary, p(S.palette.text.primary, 0.07)),
|
|
756
|
+
children: /* @__PURE__ */ n(j, { sx: {
|
|
757
757
|
fontSize: "19px !important",
|
|
758
758
|
transition: `transform .25s ${ee}`,
|
|
759
759
|
transform: D ? "rotate(180deg)" : "none"
|
|
@@ -762,13 +762,13 @@ function Tn({ ui: e, node: t, index: r, guid: a, readOnly: i, collapsed: l, issu
|
|
|
762
762
|
) })
|
|
763
763
|
] })
|
|
764
764
|
] }),
|
|
765
|
-
E && /* @__PURE__ */ h(
|
|
765
|
+
E && /* @__PURE__ */ h(lt, { in: D, timeout: 220, children: [
|
|
766
766
|
W.length > 0 && /* @__PURE__ */ n(f, { sx: e.sx("details", {
|
|
767
767
|
display: "flex",
|
|
768
768
|
overflowX: "auto",
|
|
769
|
-
borderBottom:
|
|
769
|
+
borderBottom: q ? `1px solid ${S.palette.divider}` : "none",
|
|
770
770
|
"&::-webkit-scrollbar": { height: 0 }
|
|
771
|
-
}), children: W.map((m,
|
|
771
|
+
}), children: W.map((m, u) => /* @__PURE__ */ h(
|
|
772
772
|
f,
|
|
773
773
|
{
|
|
774
774
|
sx: e.sx("detail", {
|
|
@@ -777,10 +777,10 @@ function Tn({ ui: e, node: t, index: r, guid: a, readOnly: i, collapsed: l, issu
|
|
|
777
777
|
maxWidth: 220,
|
|
778
778
|
px: { xs: 2, sm: 2.5 },
|
|
779
779
|
py: 1.5,
|
|
780
|
-
borderLeft:
|
|
780
|
+
borderLeft: u > 0 ? `1px solid ${S.palette.divider}` : "none"
|
|
781
781
|
}),
|
|
782
782
|
children: [
|
|
783
|
-
/* @__PURE__ */ h(
|
|
783
|
+
/* @__PURE__ */ h(R, { sx: e.sx("detailLabel", {
|
|
784
784
|
fontSize: 10.5,
|
|
785
785
|
fontWeight: 700,
|
|
786
786
|
letterSpacing: "0.07em",
|
|
@@ -792,10 +792,10 @@ function Tn({ ui: e, node: t, index: r, guid: a, readOnly: i, collapsed: l, issu
|
|
|
792
792
|
gap: 0.4,
|
|
793
793
|
whiteSpace: "nowrap"
|
|
794
794
|
}), children: [
|
|
795
|
-
m.icon && /* @__PURE__ */ n(
|
|
795
|
+
m.icon && /* @__PURE__ */ n(j, { sx: { fontSize: "11px !important" }, children: m.icon }),
|
|
796
796
|
m.label
|
|
797
797
|
] }),
|
|
798
|
-
/* @__PURE__ */ n(
|
|
798
|
+
/* @__PURE__ */ n(R, { sx: e.sx("detailValue", {
|
|
799
799
|
fontSize: 13.5,
|
|
800
800
|
fontWeight: 600,
|
|
801
801
|
color: m.value ? "text.primary" : "text.disabled",
|
|
@@ -806,8 +806,8 @@ function Tn({ ui: e, node: t, index: r, guid: a, readOnly: i, collapsed: l, issu
|
|
|
806
806
|
},
|
|
807
807
|
m.id
|
|
808
808
|
)) }),
|
|
809
|
-
|
|
810
|
-
|
|
809
|
+
q && /* @__PURE__ */ n(
|
|
810
|
+
ht,
|
|
811
811
|
{
|
|
812
812
|
ui: e,
|
|
813
813
|
node: t,
|
|
@@ -817,83 +817,100 @@ function Tn({ ui: e, node: t, index: r, guid: a, readOnly: i, collapsed: l, issu
|
|
|
817
817
|
showErrors: x,
|
|
818
818
|
texts: g,
|
|
819
819
|
parentTitle: k,
|
|
820
|
-
onChildChange:
|
|
820
|
+
onChildChange: v
|
|
821
821
|
}
|
|
822
822
|
)
|
|
823
823
|
] })
|
|
824
824
|
] });
|
|
825
825
|
}
|
|
826
|
-
function In({ ui: e, nodes: t, guid: r, readOnly: a, issues: i, showErrors: l, texts: c, isCollapsed: x, onToggle: g, onOpen: d, onDelete:
|
|
827
|
-
const
|
|
828
|
-
|
|
826
|
+
function In({ ui: e, nodes: t, guid: r, readOnly: a, issues: i, showErrors: l, texts: c, isCollapsed: x, onToggle: g, onOpen: d, onDelete: y, onMenu: b, onChildChange: o }) {
|
|
827
|
+
const v = J(), S = rt(v.breakpoints.down("sm")), { config: I } = e, A = I.fields || [], k = I.display || {}, M = Nt(I), W = typeof k.badge == "string" ? k.badge : k.badge?.field, P = typeof k.badge == "object" && k.badge?.label || (W ? Ut(Te(A, W)) || W : ""), q = (I.collections || []).length > 0, _ = !a && e.actions.edit, w = !a && (e.actions.edit || e.actions.delete || e.actions.duplicate || e.actions.move), C = (m) => i.filter((u) => u.path[0] === m).map((u) => ({ ...u, path: u.path.slice(1) })), V = /* @__PURE__ */ n(f, { component: "span", sx: { color: "text.disabled" }, children: "—" }), $ = (m, u, L) => q && /* @__PURE__ */ n(lt, { in: !x(m.key), timeout: 200, unmountOnExit: !0, children: /* @__PURE__ */ n(
|
|
828
|
+
ht,
|
|
829
829
|
{
|
|
830
830
|
ui: e,
|
|
831
831
|
node: m,
|
|
832
832
|
guid: r,
|
|
833
833
|
readOnly: a,
|
|
834
|
-
issues:
|
|
834
|
+
issues: C(u),
|
|
835
835
|
showErrors: l,
|
|
836
836
|
texts: c,
|
|
837
837
|
parentTitle: L,
|
|
838
|
-
onChildChange: (
|
|
838
|
+
onChildChange: (F, Q) => o(u, F, Q)
|
|
839
839
|
}
|
|
840
|
-
) }), E = (m,
|
|
840
|
+
) }), E = (m, u, L) => /* @__PURE__ */ n(
|
|
841
841
|
An,
|
|
842
842
|
{
|
|
843
843
|
ui: e,
|
|
844
844
|
title: L,
|
|
845
845
|
readOnly: a,
|
|
846
846
|
open: !x(m.key),
|
|
847
|
-
canToggle:
|
|
848
|
-
onEdit: () => d(
|
|
849
|
-
onDelete: () => u
|
|
850
|
-
onMenu: (
|
|
847
|
+
canToggle: q,
|
|
848
|
+
onEdit: () => d(u),
|
|
849
|
+
onDelete: () => y(u),
|
|
850
|
+
onMenu: (F) => b(F, u),
|
|
851
851
|
onToggle: () => g(m.key)
|
|
852
852
|
}
|
|
853
|
-
), D = p(
|
|
854
|
-
if (
|
|
855
|
-
return /* @__PURE__ */ n(f, { sx: e.sx("table", { border: `1px solid ${
|
|
856
|
-
const { title: L, details:
|
|
857
|
-
return /* @__PURE__ */ h(f, { sx: e.sx("mobileRow", { borderTop:
|
|
853
|
+
), D = p(v.palette.error.main, 0.06);
|
|
854
|
+
if (S)
|
|
855
|
+
return /* @__PURE__ */ n(f, { sx: e.sx("table", { border: `1px solid ${v.palette.divider}`, borderRadius: "8px", overflow: "hidden", bgcolor: "background.paper" }), children: t.map((m, u) => {
|
|
856
|
+
const { title: L, details: F } = oe(m.data, I, u), Q = l && C(u).length > 0;
|
|
857
|
+
return /* @__PURE__ */ h(f, { sx: e.sx("mobileRow", { borderTop: u ? `1px solid ${v.palette.divider}` : "none", ...Q ? { bgcolor: D } : {} }), children: [
|
|
858
858
|
/* @__PURE__ */ h(f, { sx: { display: "flex", alignItems: "flex-start", gap: 1, p: 1.5 }, children: [
|
|
859
859
|
/* @__PURE__ */ h(f, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
860
860
|
/* @__PURE__ */ h(f, { sx: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 1 }, children: [
|
|
861
|
-
/* @__PURE__ */ n(
|
|
862
|
-
/* @__PURE__ */ n(
|
|
861
|
+
/* @__PURE__ */ n(Me, { ui: e, title: L, canEdit: _, onOpen: () => d(u), size: 14.5 }),
|
|
862
|
+
/* @__PURE__ */ n(_e, { ui: e, data: m.data })
|
|
863
863
|
] }),
|
|
864
|
-
|
|
865
|
-
/* @__PURE__ */ n(
|
|
866
|
-
/* @__PURE__ */ n(
|
|
867
|
-
] },
|
|
864
|
+
F.length > 0 && /* @__PURE__ */ n(f, { sx: { display: "grid", gridTemplateColumns: "auto 1fr", columnGap: 1.5, rowGap: 0.25, mt: 0.75 }, children: F.map((H) => /* @__PURE__ */ h(Re, { children: [
|
|
865
|
+
/* @__PURE__ */ n(R, { sx: e.sx("detailLabel", { fontSize: 13, color: "text.secondary" }), children: H.label }),
|
|
866
|
+
/* @__PURE__ */ n(R, { sx: e.sx("detailValue", { fontSize: 13, fontWeight: 500, wordBreak: "break-word" }), children: H.value })
|
|
867
|
+
] }, H.id)) })
|
|
868
868
|
] }),
|
|
869
|
-
(w ||
|
|
869
|
+
(w || q) && E(m, u, L)
|
|
870
870
|
] }),
|
|
871
|
-
|
|
871
|
+
$(m, u, L)
|
|
872
872
|
] }, m.key);
|
|
873
873
|
}) });
|
|
874
|
-
const
|
|
875
|
-
return /* @__PURE__ */ n(f, { sx: e.sx("table", { border: `1px solid ${
|
|
876
|
-
/* @__PURE__ */ n(Yt, { children: /* @__PURE__ */ h(
|
|
877
|
-
/* @__PURE__ */ n(K, { sx:
|
|
878
|
-
M.map((m) => /* @__PURE__ */ n(K, { sx:
|
|
879
|
-
W && /* @__PURE__ */ n(K, { sx:
|
|
880
|
-
(w ||
|
|
874
|
+
const O = e.sx("tableHeadCell", { fontSize: 12.5, fontWeight: 600, color: "text.secondary", whiteSpace: "nowrap", py: 1, px: 1.75 }), N = e.sx("tableCell", { fontSize: 14, color: "text.primary", whiteSpace: "nowrap", py: 1.1, px: 1.75 }), G = 1 + M.length + (W ? 1 : 0) + (w || q ? 1 : 0);
|
|
875
|
+
return /* @__PURE__ */ n(f, { sx: e.sx("table", { border: `1px solid ${v.palette.divider}`, borderRadius: "8px", overflowX: "auto", bgcolor: "background.paper" }), children: /* @__PURE__ */ h(Jt, { size: "small", children: [
|
|
876
|
+
/* @__PURE__ */ n(Yt, { children: /* @__PURE__ */ h(he, { sx: e.sx("tableHead", { bgcolor: p(v.palette.text.primary, v.palette.mode === "dark" ? 0.05 : 0.03) }), children: [
|
|
877
|
+
/* @__PURE__ */ n(K, { sx: O, children: k.titleLabel || e.itemLabel }),
|
|
878
|
+
M.map((m) => /* @__PURE__ */ n(K, { sx: O, children: m.label }, m.id)),
|
|
879
|
+
W && /* @__PURE__ */ n(K, { sx: O, children: P }),
|
|
880
|
+
(w || q) && /* @__PURE__ */ n(K, { sx: O })
|
|
881
881
|
] }) }),
|
|
882
|
-
/* @__PURE__ */ n(Zt, { children: t.map((m,
|
|
883
|
-
const { title: L } =
|
|
884
|
-
return /* @__PURE__ */ h(
|
|
885
|
-
/* @__PURE__ */ h(
|
|
886
|
-
/* @__PURE__ */ n(K, { sx:
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
882
|
+
/* @__PURE__ */ n(Zt, { children: t.map((m, u) => {
|
|
883
|
+
const { title: L, rawTitle: F } = oe(m.data, I, u), Q = l && C(u).length > 0, H = u === t.length - 1, re = H && !(q && !x(m.key)) ? { "& > td": { borderBottom: 0 } } : {};
|
|
884
|
+
return /* @__PURE__ */ h(Re, { children: [
|
|
885
|
+
/* @__PURE__ */ h(he, { hover: !0, sx: e.sx("tableRow", { ...re, ...Q ? { bgcolor: D } : {} }), children: [
|
|
886
|
+
/* @__PURE__ */ n(K, { sx: N, children: F ? /* @__PURE__ */ n(Me, { ui: e, title: F, canEdit: _, onOpen: () => d(u), size: 14 }) : /* @__PURE__ */ n(
|
|
887
|
+
f,
|
|
888
|
+
{
|
|
889
|
+
component: _ ? "button" : "span",
|
|
890
|
+
type: _ ? "button" : void 0,
|
|
891
|
+
onClick: _ ? () => d(u) : void 0,
|
|
892
|
+
"aria-label": _ ? e.t("editAria", { title: L }) : void 0,
|
|
893
|
+
sx: {
|
|
894
|
+
background: "none",
|
|
895
|
+
border: 0,
|
|
896
|
+
p: 0,
|
|
897
|
+
font: "inherit",
|
|
898
|
+
color: "text.disabled",
|
|
899
|
+
cursor: _ ? "pointer" : "default"
|
|
900
|
+
},
|
|
901
|
+
children: "—"
|
|
902
|
+
}
|
|
903
|
+
) }),
|
|
904
|
+
M.map((te) => /* @__PURE__ */ n(K, { sx: N, children: tt(Te(A, te.id), m.data[te.id]) || V }, te.id)),
|
|
905
|
+
W && /* @__PURE__ */ n(K, { sx: N, children: /* @__PURE__ */ n(_e, { ui: e, data: m.data }) }),
|
|
906
|
+
(w || q) && /* @__PURE__ */ n(K, { align: "right", sx: e.sx("rowActions", { width: "1%", whiteSpace: "nowrap", py: 0.25 }), children: /* @__PURE__ */ n(f, { sx: { display: "inline-flex" }, children: E(m, u, L) }) })
|
|
890
907
|
] }),
|
|
891
|
-
|
|
908
|
+
q && !x(m.key) && /* @__PURE__ */ n(he, { children: /* @__PURE__ */ n(K, { colSpan: G, sx: { p: 0, ...H ? { borderBottom: 0 } : {} }, children: $(m, u, L) }) })
|
|
892
909
|
] }, m.key);
|
|
893
910
|
}) })
|
|
894
911
|
] }) });
|
|
895
912
|
}
|
|
896
|
-
function
|
|
913
|
+
function ft({
|
|
897
914
|
config: e,
|
|
898
915
|
nodes: t,
|
|
899
916
|
onChange: r,
|
|
@@ -904,40 +921,40 @@ function ht({
|
|
|
904
921
|
showErrors: x = !1,
|
|
905
922
|
required: g = !1,
|
|
906
923
|
parentTitle: d,
|
|
907
|
-
texts:
|
|
924
|
+
texts: y
|
|
908
925
|
}) {
|
|
909
|
-
const b = J(), o = hn(b, e, i,
|
|
910
|
-
if (
|
|
911
|
-
const z = { key:
|
|
912
|
-
o.layout === "cards" &&
|
|
926
|
+
const b = J(), o = hn(b, e, i, y), { emptyTitle: v, emptyText: S, ...I } = { ...y || {}, ...e.texts || {} }, A = e.max != null ? Number(e.max) : void 0, k = !l && (A === void 0 || t.length < A), M = l ? "none" : o.addButton.position, W = M === "header" || M === "both", P = M === "footer" || M === "both", q = e.showEmpty ?? !o.nested, _ = t.length === 0 && q && !(P && o.addButton.variant === "dashed"), w = t.length === 0 && !_ && !P, [C, V] = Y({ open: !1, mode: "add", index: -1, session: 0 }), [$, E] = Y({ open: !1, index: -1, title: "", detail: "" }), [D, O] = Y(null), [N, G] = Y({}), m = (s, T = -1) => V((z) => ({ open: !0, mode: s, index: T, session: z.session + 1 })), u = () => V((s) => ({ ...s, open: !1 })), L = () => m("add"), F = (s) => m(!l && o.actions.edit ? "edit" : "view", s), Q = e.defaultCollapsed ?? o.layout === "table", H = (s) => N[s] ?? Q, re = (s) => G((T) => ({ ...T, [s]: !H(s) })), te = (s, T) => {
|
|
927
|
+
if (C.mode === "add") {
|
|
928
|
+
const z = { key: ie(), data: s, children: en(e) };
|
|
929
|
+
o.layout === "cards" && G((de) => ({ ...de, [z.key]: !1 })), r([...t, z]);
|
|
913
930
|
const B = A !== void 0 && t.length + 1 >= A;
|
|
914
|
-
(!T || B) &&
|
|
931
|
+
(!T || B) && u();
|
|
915
932
|
return;
|
|
916
933
|
}
|
|
917
|
-
|
|
918
|
-
},
|
|
934
|
+
C.mode === "edit" && r(t.map((z, B) => B === C.index ? { ...z, data: s } : z)), u();
|
|
935
|
+
}, qe = (s) => r(t.filter((T, z) => z !== s)), je = (s) => {
|
|
919
936
|
if (e.confirmDelete === !1) {
|
|
920
|
-
|
|
937
|
+
qe(s);
|
|
921
938
|
return;
|
|
922
939
|
}
|
|
923
940
|
const T = t[s];
|
|
924
941
|
E({
|
|
925
942
|
open: !0,
|
|
926
943
|
index: s,
|
|
927
|
-
title:
|
|
944
|
+
title: oe(T.data, e, s).title,
|
|
928
945
|
detail: Ht({ ...T.data, ...T.children }, e)
|
|
929
946
|
});
|
|
930
947
|
}, gt = (s) => {
|
|
931
948
|
const T = [...t];
|
|
932
|
-
T.splice(s + 1, 0,
|
|
933
|
-
},
|
|
949
|
+
T.splice(s + 1, 0, ct(t[s])), r(T);
|
|
950
|
+
}, We = (s, T) => {
|
|
934
951
|
const z = s + T;
|
|
935
952
|
if (z < 0 || z >= t.length) return;
|
|
936
953
|
const B = [...t];
|
|
937
954
|
[B[s], B[z]] = [B[z], B[s]], r(B);
|
|
938
|
-
},
|
|
939
|
-
|
|
940
|
-
}, ut = () =>
|
|
955
|
+
}, Ee = (s, T, z) => r(t.map((B, de) => de === s ? { ...B, children: { ...B.children, [T]: z } } : B)), ae = x ? c.find((s) => s.path.length === 0)?.message : void 0, bt = C.index >= 0 ? t[C.index] : void 0, ne = D?.index ?? -1, le = (s) => {
|
|
956
|
+
O(null), s();
|
|
957
|
+
}, ut = () => G(Object.fromEntries(t.map((s) => [s.key, !0]))), yt = () => G(Object.fromEntries(t.map((s) => [s.key, !1]))), se = t.length > 0 && t.every((s) => H(s.key)), ce = o.t("deleteMessage", { detail: $.detail ? o.t("deleteDetail", { detail: $.detail }) : "" }), [vt, De] = ce.includes("{title}") ? ce.split("{title}") : [ce, null];
|
|
941
958
|
return /* @__PURE__ */ h(f, { "data-collection": e.id, sx: o.sx("root", { width: "100%", minWidth: 0 }), children: [
|
|
942
959
|
/* @__PURE__ */ n(
|
|
943
960
|
wn,
|
|
@@ -945,14 +962,14 @@ function ht({
|
|
|
945
962
|
ui: o,
|
|
946
963
|
count: t.length,
|
|
947
964
|
required: g || (Number(e.min) || 0) > 0,
|
|
948
|
-
alone: w && !
|
|
965
|
+
alone: w && !ae,
|
|
949
966
|
action: /* @__PURE__ */ h(f, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
|
|
950
967
|
o.layout === "cards" && t.length >= 2 && /* @__PURE__ */ n(
|
|
951
|
-
|
|
968
|
+
Z,
|
|
952
969
|
{
|
|
953
970
|
size: "small",
|
|
954
971
|
variant: "text",
|
|
955
|
-
onClick:
|
|
972
|
+
onClick: se ? yt : ut,
|
|
956
973
|
sx: {
|
|
957
974
|
fontSize: 12.5,
|
|
958
975
|
fontWeight: 600,
|
|
@@ -962,26 +979,26 @@ function ht({
|
|
|
962
979
|
textTransform: "none",
|
|
963
980
|
"&:hover": { color: "text.primary", bgcolor: p(b.palette.text.primary, 0.05) }
|
|
964
981
|
},
|
|
965
|
-
startIcon: /* @__PURE__ */ n(
|
|
966
|
-
children:
|
|
982
|
+
startIcon: /* @__PURE__ */ n(j, { sx: { fontSize: "15px !important" }, children: se ? "unfold_more" : "unfold_less" }),
|
|
983
|
+
children: se ? "Expand all" : "Collapse all"
|
|
967
984
|
}
|
|
968
985
|
),
|
|
969
|
-
W && /* @__PURE__ */ n(
|
|
986
|
+
W && /* @__PURE__ */ n(Xe, { ui: o, placement: "header", empty: t.length === 0, disabled: !k, onClick: L })
|
|
970
987
|
] })
|
|
971
988
|
}
|
|
972
989
|
),
|
|
973
|
-
|
|
974
|
-
|
|
990
|
+
ae && /* @__PURE__ */ h(
|
|
991
|
+
R,
|
|
975
992
|
{
|
|
976
993
|
role: "alert",
|
|
977
994
|
sx: o.sx("error", { display: "flex", alignItems: "center", gap: 0.5, color: "error.main", fontSize: 13, fontWeight: 500, mt: -0.5, mb: 1.25 }),
|
|
978
995
|
children: [
|
|
979
|
-
/* @__PURE__ */ n(
|
|
980
|
-
|
|
996
|
+
/* @__PURE__ */ n(j, { sx: { fontSize: "17px !important" }, children: "error_outline" }),
|
|
997
|
+
ae
|
|
981
998
|
]
|
|
982
999
|
}
|
|
983
1000
|
),
|
|
984
|
-
|
|
1001
|
+
_ && /* @__PURE__ */ n(Cn, { ui: o, readOnly: l, error: !!ae }),
|
|
985
1002
|
t.length > 0 && o.layout === "table" && /* @__PURE__ */ n(
|
|
986
1003
|
In,
|
|
987
1004
|
{
|
|
@@ -992,12 +1009,12 @@ function ht({
|
|
|
992
1009
|
issues: c,
|
|
993
1010
|
showErrors: x,
|
|
994
1011
|
texts: I,
|
|
995
|
-
isCollapsed:
|
|
996
|
-
onToggle:
|
|
997
|
-
onOpen:
|
|
998
|
-
onDelete:
|
|
999
|
-
onMenu: (s, T) =>
|
|
1000
|
-
onChildChange:
|
|
1012
|
+
isCollapsed: H,
|
|
1013
|
+
onToggle: re,
|
|
1014
|
+
onOpen: F,
|
|
1015
|
+
onDelete: je,
|
|
1016
|
+
onMenu: (s, T) => O({ anchor: s, index: T }),
|
|
1017
|
+
onChildChange: Ee
|
|
1001
1018
|
}
|
|
1002
1019
|
),
|
|
1003
1020
|
t.length > 0 && o.layout === "cards" && /* @__PURE__ */ n(f, { sx: o.sx("list", { display: "flex", flexDirection: "column", gap: 2 }), children: t.map((s, T) => /* @__PURE__ */ n(
|
|
@@ -1008,31 +1025,31 @@ function ht({
|
|
|
1008
1025
|
index: T,
|
|
1009
1026
|
guid: a,
|
|
1010
1027
|
readOnly: l,
|
|
1011
|
-
collapsed:
|
|
1028
|
+
collapsed: H(s.key),
|
|
1012
1029
|
issues: c.filter((z) => z.path[0] === T).map((z) => ({ ...z, path: z.path.slice(1) })),
|
|
1013
1030
|
showErrors: x,
|
|
1014
1031
|
texts: I,
|
|
1015
|
-
onOpen: () =>
|
|
1016
|
-
onDelete: () =>
|
|
1017
|
-
onMenu: (z) =>
|
|
1018
|
-
onToggle: () =>
|
|
1019
|
-
onChildChange: (z, B) =>
|
|
1032
|
+
onOpen: () => F(T),
|
|
1033
|
+
onDelete: () => je(T),
|
|
1034
|
+
onMenu: (z) => O({ anchor: z, index: T }),
|
|
1035
|
+
onToggle: () => re(s.key),
|
|
1036
|
+
onChildChange: (z, B) => Ee(T, z, B)
|
|
1020
1037
|
},
|
|
1021
1038
|
s.key
|
|
1022
1039
|
)) }),
|
|
1023
|
-
P && /* @__PURE__ */ n(f, { sx: { mt: t.length || o.addButton.variant !== "dashed" ? 1.25 : 0 }, children: /* @__PURE__ */ n(
|
|
1040
|
+
P && /* @__PURE__ */ n(f, { sx: { mt: t.length || o.addButton.variant !== "dashed" ? 1.25 : 0 }, children: /* @__PURE__ */ n(Xe, { ui: o, placement: "footer", empty: t.length === 0, disabled: !k, onClick: L }) }),
|
|
1024
1041
|
/* @__PURE__ */ n(
|
|
1025
1042
|
kn,
|
|
1026
1043
|
{
|
|
1027
1044
|
ui: o,
|
|
1028
|
-
open:
|
|
1029
|
-
mode:
|
|
1030
|
-
session:
|
|
1045
|
+
open: C.open,
|
|
1046
|
+
mode: C.mode,
|
|
1047
|
+
session: C.session,
|
|
1031
1048
|
guid: `${a}-${e.id}`,
|
|
1032
1049
|
initial: bt?.data,
|
|
1033
1050
|
context: d,
|
|
1034
|
-
onClose:
|
|
1035
|
-
onSave:
|
|
1051
|
+
onClose: u,
|
|
1052
|
+
onSave: te
|
|
1036
1053
|
}
|
|
1037
1054
|
),
|
|
1038
1055
|
/* @__PURE__ */ h(
|
|
@@ -1040,53 +1057,53 @@ function ht({
|
|
|
1040
1057
|
{
|
|
1041
1058
|
anchorEl: D?.anchor,
|
|
1042
1059
|
open: !!D,
|
|
1043
|
-
onClose: () =>
|
|
1060
|
+
onClose: () => O(null),
|
|
1044
1061
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1045
1062
|
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
1046
1063
|
sx: { "& .MuiPaper-root": o.merged("menu", { borderRadius: "10px", minWidth: 170 }) },
|
|
1047
1064
|
children: [
|
|
1048
|
-
o.actions.duplicate && /* @__PURE__ */ h(
|
|
1049
|
-
/* @__PURE__ */ n(
|
|
1050
|
-
/* @__PURE__ */ n(
|
|
1065
|
+
o.actions.duplicate && /* @__PURE__ */ h(pe, { sx: o.sx("menuItem"), disabled: !k, onClick: () => le(() => gt(ne)), children: [
|
|
1066
|
+
/* @__PURE__ */ n(xe, { children: /* @__PURE__ */ n(j, { fontSize: "small", children: "content_copy" }) }),
|
|
1067
|
+
/* @__PURE__ */ n(me, { children: o.t("duplicate") })
|
|
1051
1068
|
] }),
|
|
1052
|
-
o.actions.move && /* @__PURE__ */ h(
|
|
1053
|
-
/* @__PURE__ */ n(
|
|
1054
|
-
/* @__PURE__ */ n(
|
|
1069
|
+
o.actions.move && /* @__PURE__ */ h(pe, { sx: o.sx("menuItem"), disabled: ne <= 0, onClick: () => le(() => We(ne, -1)), children: [
|
|
1070
|
+
/* @__PURE__ */ n(xe, { children: /* @__PURE__ */ n(j, { fontSize: "small", children: "arrow_upward" }) }),
|
|
1071
|
+
/* @__PURE__ */ n(me, { children: o.t("moveUp") })
|
|
1055
1072
|
] }),
|
|
1056
|
-
o.actions.move && /* @__PURE__ */ h(
|
|
1057
|
-
/* @__PURE__ */ n(
|
|
1058
|
-
/* @__PURE__ */ n(
|
|
1073
|
+
o.actions.move && /* @__PURE__ */ h(pe, { sx: o.sx("menuItem"), disabled: ne >= t.length - 1, onClick: () => le(() => We(ne, 1)), children: [
|
|
1074
|
+
/* @__PURE__ */ n(xe, { children: /* @__PURE__ */ n(j, { fontSize: "small", children: "arrow_downward" }) }),
|
|
1075
|
+
/* @__PURE__ */ n(me, { children: o.t("moveDown") })
|
|
1059
1076
|
] })
|
|
1060
1077
|
]
|
|
1061
1078
|
}
|
|
1062
1079
|
),
|
|
1063
1080
|
/* @__PURE__ */ h(
|
|
1064
|
-
|
|
1081
|
+
at,
|
|
1065
1082
|
{
|
|
1066
|
-
open:
|
|
1083
|
+
open: $.open,
|
|
1067
1084
|
onClose: () => E((s) => ({ ...s, open: !1 })),
|
|
1068
1085
|
maxWidth: "xs",
|
|
1069
1086
|
fullWidth: !0,
|
|
1070
1087
|
sx: { "& .MuiDialog-paper": o.merged("confirm", { borderRadius: "12px", backgroundImage: "none" }) },
|
|
1071
1088
|
children: [
|
|
1072
|
-
/* @__PURE__ */ h(
|
|
1073
|
-
/* @__PURE__ */ n(
|
|
1074
|
-
/* @__PURE__ */ h(
|
|
1089
|
+
/* @__PURE__ */ h(ot, { sx: { pt: 3, pb: 1 }, children: [
|
|
1090
|
+
/* @__PURE__ */ n(R, { sx: o.sx("confirmTitle", { fontWeight: 600, fontSize: 17 }), children: o.t("deleteTitle") }),
|
|
1091
|
+
/* @__PURE__ */ h(R, { sx: o.sx("confirmText", { fontSize: 14, color: "text.secondary", mt: 1 }), children: [
|
|
1075
1092
|
vt,
|
|
1076
|
-
|
|
1077
|
-
|
|
1093
|
+
De !== null && /* @__PURE__ */ n(f, { component: "strong", sx: { color: "text.primary", fontWeight: 600 }, children: $.title }),
|
|
1094
|
+
De
|
|
1078
1095
|
] })
|
|
1079
1096
|
] }),
|
|
1080
|
-
/* @__PURE__ */ h(
|
|
1081
|
-
/* @__PURE__ */ n(
|
|
1097
|
+
/* @__PURE__ */ h(it, { sx: { px: 3, pb: 2.5, pt: 2, gap: 1, "& .MuiButton-root": { textTransform: "none", fontWeight: 600, borderRadius: "8px" } }, children: [
|
|
1098
|
+
/* @__PURE__ */ n(Z, { color: "inherit", onClick: () => E((s) => ({ ...s, open: !1 })), sx: o.sx("confirmCancel", { color: "text.secondary" }), children: o.t("cancel") }),
|
|
1082
1099
|
/* @__PURE__ */ n(
|
|
1083
|
-
|
|
1100
|
+
Z,
|
|
1084
1101
|
{
|
|
1085
1102
|
variant: "contained",
|
|
1086
1103
|
color: "error",
|
|
1087
1104
|
disableElevation: !0,
|
|
1088
1105
|
onClick: () => {
|
|
1089
|
-
|
|
1106
|
+
qe($.index), E((s) => ({ ...s, open: !1 }));
|
|
1090
1107
|
},
|
|
1091
1108
|
sx: o.sx("confirmDelete"),
|
|
1092
1109
|
children: o.t("deleteConfirm")
|
|
@@ -1098,7 +1115,7 @@ function ht({
|
|
|
1098
1115
|
)
|
|
1099
1116
|
] });
|
|
1100
1117
|
}
|
|
1101
|
-
const zn = ["mandatory", "mandatoryselect"],
|
|
1118
|
+
const zn = ["mandatory", "mandatoryselect"], we = (e) => {
|
|
1102
1119
|
try {
|
|
1103
1120
|
return JSON.stringify(e);
|
|
1104
1121
|
} catch {
|
|
@@ -1106,26 +1123,26 @@ const zn = ["mandatory", "mandatoryselect"], ke = (e) => {
|
|
|
1106
1123
|
}
|
|
1107
1124
|
};
|
|
1108
1125
|
function Wn({ attributes: e = {}, rules: t = {}, onChange: r, submitTick: a }) {
|
|
1109
|
-
const { id: i = "", value: l } = e, c = { ...e, id: i, fields: e.fields || [] }, x = !!(e.readOnly || e.disabled || e.MuiAttributes?.disabled), g = t?.validation?.find((k) => zn.includes(k.rule)), [d] =
|
|
1126
|
+
const { id: i = "", value: l } = e, c = { ...e, id: i, fields: e.fields || [] }, x = !!(e.readOnly || e.disabled || e.MuiAttributes?.disabled), g = t?.validation?.find((k) => zn.includes(k.rule)), [d] = Y(ie), [y, b] = Y(() => Ie(l, c)), [o, v] = Y(!1), S = Je(we(Ae(l)));
|
|
1110
1127
|
Oe(() => {
|
|
1111
|
-
const k =
|
|
1112
|
-
k !==
|
|
1128
|
+
const k = we(Ae(l));
|
|
1129
|
+
k !== S.current && (S.current = k, b(Ie(l, c)));
|
|
1113
1130
|
}, [l]), Oe(() => {
|
|
1114
|
-
a &&
|
|
1131
|
+
a && v(!0);
|
|
1115
1132
|
}, [a]);
|
|
1116
1133
|
const I = (k) => {
|
|
1117
1134
|
b(k);
|
|
1118
|
-
const M =
|
|
1119
|
-
|
|
1120
|
-
}, A = Kt(
|
|
1135
|
+
const M = ze(k, c);
|
|
1136
|
+
S.current = we(M), r?.({ id: i, value: M });
|
|
1137
|
+
}, A = Kt(ze(y, c), c, {
|
|
1121
1138
|
required: !!g,
|
|
1122
1139
|
requiredMessage: g?.message
|
|
1123
1140
|
});
|
|
1124
1141
|
return /* @__PURE__ */ n(
|
|
1125
|
-
|
|
1142
|
+
ft,
|
|
1126
1143
|
{
|
|
1127
1144
|
config: c,
|
|
1128
|
-
nodes:
|
|
1145
|
+
nodes: y,
|
|
1129
1146
|
onChange: I,
|
|
1130
1147
|
guid: `${d}-${i}`,
|
|
1131
1148
|
readOnly: x,
|