@chobantonov/jsonforms-react-antd-webcomponent 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +86 -2
- package/dist/JsonFormsAntdElement.d.ts +26 -0
- package/dist/index.d.ts +3 -0
- package/dist/jsonforms-react-antd.js +1 -0
- package/dist/register.d.ts +1 -0
- package/dist/register.js +6 -0
- package/dist/register.js.map +1 -0
- package/dist/renderers.d.ts +2 -0
- package/dist/src-BFTWxxIf.mjs +202 -0
- package/dist/src-BFTWxxIf.mjs.map +1 -0
- package/dist/standalone/AgGridControlRenderer.impl-BZS8_ocu-B7smOgCn.mjs +39186 -0
- package/dist/standalone/AgGridControlRenderer.impl-BZS8_ocu-B7smOgCn.mjs.map +1 -0
- package/dist/standalone/DynamicJSXRenderer-DyB3ZpZV-DwdyKIB1.mjs +14894 -0
- package/dist/standalone/DynamicJSXRenderer-DyB3ZpZV-DwdyKIB1.mjs.map +1 -0
- package/dist/standalone/MarkupLabelRenderer.impl-CWfdcUuH-D5lfFu1i.mjs +12 -0
- package/dist/standalone/MarkupLabelRenderer.impl-CWfdcUuH-D5lfFu1i.mjs.map +1 -0
- package/dist/standalone/MonacoControlRenderer.impl-CyjMHbOd-CQ8xjLar.mjs +774 -0
- package/dist/standalone/MonacoControlRenderer.impl-CyjMHbOd-CQ8xjLar.mjs.map +1 -0
- package/dist/standalone/RactiveTemplate-Cat7CxUp-BXSHwrZ1.mjs +8028 -0
- package/dist/standalone/RactiveTemplate-Cat7CxUp-BXSHwrZ1.mjs.map +1 -0
- package/dist/standalone/bg-peTJz2yn.mjs +54 -0
- package/dist/standalone/bg-peTJz2yn.mjs.map +1 -0
- package/dist/standalone/bg_BG-B44LSCyD.mjs +222 -0
- package/dist/standalone/bg_BG-B44LSCyD.mjs.map +1 -0
- package/dist/standalone/celTemplate-D_AGhaIL-RG6XN-Eu.mjs +137 -0
- package/dist/standalone/celTemplate-D_AGhaIL-RG6XN-Eu.mjs.map +1 -0
- package/dist/standalone/common-BEnIxhFt.mjs +18 -0
- package/dist/standalone/common-BEnIxhFt.mjs.map +1 -0
- package/dist/standalone/dayjs.min-adoc_mEQ.mjs +300 -0
- package/dist/standalone/dayjs.min-adoc_mEQ.mjs.map +1 -0
- package/dist/standalone/dynamicCel.esm-DGWfIAPF.mjs +43 -0
- package/dist/standalone/dynamicCel.esm-DGWfIAPF.mjs.map +1 -0
- package/dist/standalone/en-D7K60EG2.mjs +25 -0
- package/dist/standalone/en-D7K60EG2.mjs.map +1 -0
- package/dist/standalone/en_US-Bk9ytucu.mjs +223 -0
- package/dist/standalone/en_US-Bk9ytucu.mjs.map +1 -0
- package/dist/standalone/es-BToyXotK.mjs +51 -0
- package/dist/standalone/es-BToyXotK.mjs.map +1 -0
- package/dist/standalone/es_ES-n86UqGMA.mjs +245 -0
- package/dist/standalone/es_ES-n86UqGMA.mjs.map +1 -0
- package/dist/standalone/fr-DlN8a0TJ.mjs +52 -0
- package/dist/standalone/fr-DlN8a0TJ.mjs.map +1 -0
- package/dist/standalone/fr_FR-BNIh97oT.mjs +223 -0
- package/dist/standalone/fr_FR-BNIh97oT.mjs.map +1 -0
- package/dist/standalone/index.js +56734 -0
- package/dist/standalone/index.js.map +1 -0
- package/dist/standalone/it-0HHNpxpp.mjs +51 -0
- package/dist/standalone/it-0HHNpxpp.mjs.map +1 -0
- package/dist/standalone/it_IT-COjke9P6.mjs +245 -0
- package/dist/standalone/it_IT-COjke9P6.mjs.map +1 -0
- package/dist/standalone/ja-CqnjT8BB.mjs +57 -0
- package/dist/standalone/ja-CqnjT8BB.mjs.map +1 -0
- package/dist/standalone/ja_JP-DA4GA8OS.mjs +248 -0
- package/dist/standalone/ja_JP-DA4GA8OS.mjs.map +1 -0
- package/dist/standalone/jsonforms-react-extended.esm-CQmkt5NG.mjs +13673 -0
- package/dist/standalone/jsonforms-react-extended.esm-CQmkt5NG.mjs.map +1 -0
- package/dist/standalone/lib-0rajvaUg.mjs +3170 -0
- package/dist/standalone/lib-0rajvaUg.mjs.map +1 -0
- package/dist/standalone/markdown-C_y73Q0w-CfLH-8Sz.mjs +3061 -0
- package/dist/standalone/markdown-C_y73Q0w-CfLH-8Sz.mjs.map +1 -0
- package/dist/standalone/nl-CFqJarW7.mjs +52 -0
- package/dist/standalone/nl-CFqJarW7.mjs.map +1 -0
- package/dist/standalone/nl_NL-4FmulTf3.mjs +222 -0
- package/dist/standalone/nl_NL-4FmulTf3.mjs.map +1 -0
- package/dist/standalone/objectSpread2-C50HRvBU.mjs +71 -0
- package/dist/standalone/pl-Du1zDNA_.mjs +71 -0
- package/dist/standalone/pl-Du1zDNA_.mjs.map +1 -0
- package/dist/standalone/pl_PL-CBfuF99B.mjs +248 -0
- package/dist/standalone/pl_PL-CBfuF99B.mjs.map +1 -0
- package/dist/standalone/plainRecord.esm-BR1q_7e9.mjs +30 -0
- package/dist/standalone/plainRecord.esm-BR1q_7e9.mjs.map +1 -0
- package/dist/standalone/pt-Dg1pEKF5.mjs +52 -0
- package/dist/standalone/pt-Dg1pEKF5.mjs.map +1 -0
- package/dist/standalone/pt_PT--r6dtf89.mjs +268 -0
- package/dist/standalone/pt_PT--r6dtf89.mjs.map +1 -0
- package/dist/standalone/react-dom-Slk9aa5V.mjs +5644 -0
- package/dist/standalone/react-dom-Slk9aa5V.mjs.map +1 -0
- package/dist/standalone/rolldown-runtime-DUcC5eAW.mjs +26 -0
- package/dist/standalone/rowDetail.esm-Ce56gyeo.mjs +770 -0
- package/dist/standalone/rowDetail.esm-Ce56gyeo.mjs.map +1 -0
- package/dist/standalone/ru-CeNU1BY9.mjs +74 -0
- package/dist/standalone/ru-CeNU1BY9.mjs.map +1 -0
- package/dist/standalone/ru_RU-CIRMzMfd.mjs +245 -0
- package/dist/standalone/ru_RU-CIRMzMfd.mjs.map +1 -0
- package/dist/standalone/tr-Demj1YNf.mjs +51 -0
- package/dist/standalone/tr-Demj1YNf.mjs.map +1 -0
- package/dist/standalone/tr_TR-DOU85NN8.mjs +245 -0
- package/dist/standalone/tr_TR-DOU85NN8.mjs.map +1 -0
- package/dist/standalone/uk-Dq-ndPcu.mjs +67 -0
- package/dist/standalone/uk-Dq-ndPcu.mjs.map +1 -0
- package/dist/standalone/uk_UA-_65wU-M8.mjs +245 -0
- package/dist/standalone/uk_UA-_65wU-M8.mjs.map +1 -0
- package/dist/standalone/zh-cn-DteM8IK0.mjs +60 -0
- package/dist/standalone/zh-cn-DteM8IK0.mjs.map +1 -0
- package/dist/standalone/zh_CN-BaFiZ2OD.mjs +226 -0
- package/dist/standalone/zh_CN-BaFiZ2OD.mjs.map +1 -0
- package/package.json +62 -3
- package/src/JsonFormsAntdElement.tsx +327 -0
- package/src/index.tsx +4 -0
- package/src/register.ts +5 -0
- package/src/renderers.ts +20 -0
|
@@ -0,0 +1,770 @@
|
|
|
1
|
+
import { a as e } from "./rolldown-runtime-DUcC5eAW.mjs";
|
|
2
|
+
import { Cn as t, Cr as n, Dn as r, Hr as i, Kn as a, Lt as o, Mn as s, Mt as c, On as l, Rt as u, Tr as d, Tt as f, Un as p, Ut as m, Wn as h, bn as g, br as _, cn as v, ht as y, jr as b, jt as x, mn as S, vr as C, wr as w, xn as T, yn as E } from "./jsonforms-react-extended.esm-CQmkt5NG.mjs";
|
|
3
|
+
import { n as D, t as O } from "./objectSpread2-C50HRvBU.mjs";
|
|
4
|
+
import { n as k, r as A } from "./plainRecord.esm-BR1q_7e9.mjs";
|
|
5
|
+
D(), A();
|
|
6
|
+
var j = /* @__PURE__ */ e(v()), M = (e) => e == null ? !1 : typeof e == "string" ? e.trim().length > 0 : Array.isArray(e) ? e.some(M) : typeof e != "object" || Object.values(e).some(M), N = /* @__PURE__ */ new WeakMap(), P = (e) => {
|
|
7
|
+
let t = N.get(e);
|
|
8
|
+
if (t) return t;
|
|
9
|
+
let r = [], i = (e) => {
|
|
10
|
+
var t;
|
|
11
|
+
let a = e;
|
|
12
|
+
if ((a.type === "Control" || a.type === "ListWithDetail") && typeof a.scope == "string") {
|
|
13
|
+
let e = n(a.scope);
|
|
14
|
+
r.push({
|
|
15
|
+
segments: e,
|
|
16
|
+
relative: e.join(".")
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
(t = a.elements) == null || t.forEach(i);
|
|
20
|
+
};
|
|
21
|
+
return i(e), N.set(e, r), r;
|
|
22
|
+
}, F = (e, t = "") => P(e).map(({ relative: e }) => [t, e].filter(Boolean).join(".")), ee = (e, t) => t.reduce((e, t) => typeof e == "object" && e ? e[t] : void 0, e), I = (e, t, n = "") => {
|
|
23
|
+
let r = n ? T.data(t, n) : t;
|
|
24
|
+
return P(e).some(({ segments: e }) => M(ee(r, e)));
|
|
25
|
+
}, te = (e, t, n) => {
|
|
26
|
+
var r;
|
|
27
|
+
let i = m(), a = f(t)(e), { collapsible: o, collapsed: s, setExpanded: c } = R(a, n), l = L(a, n, "showDataIndicator") === !0, u = (r = i.core) == null ? void 0 : r.data, d = (0, j.useId)(), p = (0, j.useMemo)(() => l && I(a, u, t), [
|
|
28
|
+
l,
|
|
29
|
+
a,
|
|
30
|
+
u,
|
|
31
|
+
t
|
|
32
|
+
]);
|
|
33
|
+
return {
|
|
34
|
+
contentId: d,
|
|
35
|
+
collapsible: o,
|
|
36
|
+
collapsed: o && s,
|
|
37
|
+
hasData: p,
|
|
38
|
+
toggle: () => c(s)
|
|
39
|
+
};
|
|
40
|
+
}, L = (e, t, n) => {
|
|
41
|
+
var r, i;
|
|
42
|
+
let a = t == null ? void 0 : t[S];
|
|
43
|
+
return (r = (i = e.options) == null ? void 0 : i[n]) == null ? a == null ? void 0 : a[n] : r;
|
|
44
|
+
}, R = (e, t, n = !1, r = "group") => {
|
|
45
|
+
var i;
|
|
46
|
+
let a = ((i = L(e, t, "collapsible")) == null ? n : i) === !0, o = z(e.options, t, r), [s, c] = (0, j.useState)(o), [l, u] = (0, j.useState)(o);
|
|
47
|
+
return l !== o && (u(o), c(o)), {
|
|
48
|
+
collapsible: a,
|
|
49
|
+
collapsed: a && s,
|
|
50
|
+
setExpanded: (0, j.useCallback)((e) => c(!e), [])
|
|
51
|
+
};
|
|
52
|
+
}, z = (e, t, n) => {
|
|
53
|
+
var r, i, a, o, s;
|
|
54
|
+
return ((r = (i = (a = e == null ? void 0 : e.collapsed) == null ? t == null || (o = t.jsonformsExtended) == null || (o = o[n]) == null ? void 0 : o.collapsed : a) == null ? t == null || (s = t.jsonformsExtended) == null ? void 0 : s.collapsed : i) != null && r) === !0;
|
|
55
|
+
};
|
|
56
|
+
function ne(e, t) {
|
|
57
|
+
let n = c(), r = f(e), i = t == null ? void 0 : t.map(r).find((e) => e.type === "Label");
|
|
58
|
+
return i != null && i.i18n ? n(`${i.i18n}.text`, i.text || "") : i == null ? void 0 : i.text;
|
|
59
|
+
}
|
|
60
|
+
// ../jsonforms-react-renderer-common/lib/validation/validationIndicator.esm.js
|
|
61
|
+
var re = (e) => h(e), B = [], ie = (...e) => {
|
|
62
|
+
let t = /* @__PURE__ */ new Set();
|
|
63
|
+
for (let n of e) for (let e of n == null ? B : n) {
|
|
64
|
+
t.add("");
|
|
65
|
+
let n = "";
|
|
66
|
+
for (let r of re(e).split(".")) r !== "" && (n = n ? `${n}.${r}` : r, t.add(n));
|
|
67
|
+
}
|
|
68
|
+
return t;
|
|
69
|
+
}, ae = /* @__PURE__ */ new WeakMap(), oe = (e, t) => {
|
|
70
|
+
let n = e == null ? B : e, r = t == null ? B : t, i = ae.get(n);
|
|
71
|
+
i || (i = /* @__PURE__ */ new WeakMap(), ae.set(n, i));
|
|
72
|
+
let a = i.get(r);
|
|
73
|
+
if (a) return a;
|
|
74
|
+
let o = ie(n, r);
|
|
75
|
+
return i.set(r, o), o;
|
|
76
|
+
}, V = (e) => [e.validationMode === "ValidateAndShow" || e.validationMode === void 0 ? e.errors : void 0, e.additionalErrors], H = (e, t, n, r = "showValidationIndicator") => {
|
|
77
|
+
var i, a;
|
|
78
|
+
let o = e == null || (i = e.options) == null ? void 0 : i[r];
|
|
79
|
+
if (o !== void 0) return o === !0;
|
|
80
|
+
let s = t == null || (a = t.jsonformsExtended) == null ? void 0 : a[r];
|
|
81
|
+
return s === void 0 ? n : s === !0;
|
|
82
|
+
}, se = (e, t) => t.some((t) => e === t || e.startsWith(`${t}.`) || t === ""), ce = (e, t, n, r) => {
|
|
83
|
+
let { core: i } = m(), a = f(t)(e), o = H(a, n, r), s = H(a, n, !1, "showValidationIndicatorCount"), [c, l] = i ? V(i) : [void 0, void 0];
|
|
84
|
+
return (0, j.useMemo)(() => {
|
|
85
|
+
if (!o) return {
|
|
86
|
+
show: !1,
|
|
87
|
+
count: 0
|
|
88
|
+
};
|
|
89
|
+
let e = oe(c, l);
|
|
90
|
+
if (e.size === 0) return {
|
|
91
|
+
show: !1,
|
|
92
|
+
count: 0
|
|
93
|
+
};
|
|
94
|
+
let n = F(a, t);
|
|
95
|
+
if (!n.some((t) => e.has(t))) return {
|
|
96
|
+
show: !1,
|
|
97
|
+
count: 0
|
|
98
|
+
};
|
|
99
|
+
if (!s) return {
|
|
100
|
+
show: !0,
|
|
101
|
+
count: void 0
|
|
102
|
+
};
|
|
103
|
+
let r = [...c == null ? B : c, ...l == null ? B : l].filter((e) => se(re(e), n)).length;
|
|
104
|
+
return {
|
|
105
|
+
show: r > 0,
|
|
106
|
+
count: r
|
|
107
|
+
};
|
|
108
|
+
}, [
|
|
109
|
+
o,
|
|
110
|
+
s,
|
|
111
|
+
c,
|
|
112
|
+
l,
|
|
113
|
+
a,
|
|
114
|
+
t
|
|
115
|
+
]);
|
|
116
|
+
}, U = (e) => e.type === "string" && (e.contentEncoding === "base64" || e.format === "binary" || e.format === "byte"), W = (e, t) => {
|
|
117
|
+
if (e.type !== "array" || !e.items || typeof e.items == "boolean" || Array.isArray(e.items)) return;
|
|
118
|
+
let n = e.items, r = n.$ref ? T.schema(t, n.$ref, t) : n;
|
|
119
|
+
return r && U(r) ? r : void 0;
|
|
120
|
+
}, le = C(7, t(w("Control"), _((e, t) => !!W(e, t)))), ue = (e, t) => new Promise((n, r) => {
|
|
121
|
+
let i = new FileReader();
|
|
122
|
+
i.onerror = () => {
|
|
123
|
+
var e;
|
|
124
|
+
return r((e = i.error) == null ? /* @__PURE__ */ Error("File read failed") : e);
|
|
125
|
+
}, i.onabort = () => r(/* @__PURE__ */ Error("File read aborted")), i.onload = () => {
|
|
126
|
+
var r;
|
|
127
|
+
let a = String((r = i.result) == null ? "" : r);
|
|
128
|
+
if (t.format === "uri") n(a);
|
|
129
|
+
else if (t.format === "binary") {
|
|
130
|
+
let t = a.indexOf(";base64,");
|
|
131
|
+
n(t < 0 ? a : a.slice(0, t) + ";filename=" + encodeURIComponent(e.name) + a.slice(t));
|
|
132
|
+
} else n(a.slice(a.indexOf(",") + 1));
|
|
133
|
+
}, i.readAsDataURL(e);
|
|
134
|
+
}), G = (e) => {
|
|
135
|
+
if (typeof e != "string") return;
|
|
136
|
+
let t = /^data:[^,]*;filename=([^;,]*)/.exec(e);
|
|
137
|
+
if (t) try {
|
|
138
|
+
return decodeURIComponent(t[1]);
|
|
139
|
+
} catch (e) {
|
|
140
|
+
return t[1];
|
|
141
|
+
}
|
|
142
|
+
}, de = (e) => {
|
|
143
|
+
var t, n, r, i;
|
|
144
|
+
let a = x(), [o, s] = (0, j.useState)(!1), [c, l] = (0, j.useState)(!1), u = (0, j.useRef)(null), [d, f] = (0, j.useState)(!1), [p, m] = (0, j.useState)(""), [h, g] = (0, j.useState)("warning"), [_, v] = j.useState(e.data);
|
|
145
|
+
Object.is(_, e.data) || (v(() => e.data), m(""));
|
|
146
|
+
let [y, b] = (0, j.useState)(/* @__PURE__ */ new Map()), S = (0, j.useRef)(e);
|
|
147
|
+
(0, j.useLayoutEffect)(() => {
|
|
148
|
+
S.current = e;
|
|
149
|
+
}, [e]);
|
|
150
|
+
let C = (0, j.useRef)(!0);
|
|
151
|
+
(0, j.useEffect)(() => (C.current = !0, () => {
|
|
152
|
+
C.current = !1;
|
|
153
|
+
}), []);
|
|
154
|
+
let w = W(e.schema, e.rootSchema);
|
|
155
|
+
if (!w || e.visible === !1) return null;
|
|
156
|
+
let T = Array.isArray(e.data) ? e.data : [], E = O(O({}, e.config), e.uischema.options), D = !e.enabled || e.readonly || d, A = E.restrict !== !1, M = (t = e.PillComponent) == null ? "span" : t, N = (n = e.ButtonComponent) == null ? "button" : n, P = !D && (!A || T.length > ((r = e.schema.minItems) == null ? 0 : r));
|
|
157
|
+
return /* @__PURE__ */ j.createElement("div", {
|
|
158
|
+
onMouseEnter: () => s(!0),
|
|
159
|
+
onMouseLeave: () => s(!1),
|
|
160
|
+
onFocusCapture: () => l(!0),
|
|
161
|
+
onBlurCapture: (e) => {
|
|
162
|
+
e.currentTarget.contains(e.relatedTarget) || l(!1);
|
|
163
|
+
},
|
|
164
|
+
style: {
|
|
165
|
+
minWidth: 0,
|
|
166
|
+
width: "100%"
|
|
167
|
+
}
|
|
168
|
+
}, /* @__PURE__ */ j.createElement("div", { style: {
|
|
169
|
+
display: "flex",
|
|
170
|
+
alignItems: "center",
|
|
171
|
+
gap: 4,
|
|
172
|
+
border: e.cell ? "none" : "1px solid var(--file-input-border, #8886)",
|
|
173
|
+
borderRadius: 6,
|
|
174
|
+
padding: e.cell ? 0 : "2px 4px",
|
|
175
|
+
minWidth: 0,
|
|
176
|
+
height: e.cell ? 28 : void 0,
|
|
177
|
+
boxSizing: "border-box"
|
|
178
|
+
} }, /* @__PURE__ */ j.createElement("input", {
|
|
179
|
+
ref: u,
|
|
180
|
+
id: e.id,
|
|
181
|
+
type: "file",
|
|
182
|
+
multiple: !0,
|
|
183
|
+
disabled: D,
|
|
184
|
+
"aria-label": a("file.select"),
|
|
185
|
+
"aria-invalid": !!e.errors,
|
|
186
|
+
accept: typeof E.accept == "string" ? E.accept : w.contentMediaType,
|
|
187
|
+
onChange: function() {
|
|
188
|
+
var t = k(function* (t) {
|
|
189
|
+
var n;
|
|
190
|
+
let r = Array.from((n = t.currentTarget.files) == null ? [] : n);
|
|
191
|
+
if (t.currentTarget.value = "", !r.length || D) return;
|
|
192
|
+
if (m(""), g("warning"), A && e.schema.maxItems !== void 0 && !e.schema.uniqueItems && T.length + r.length > e.schema.maxItems) {
|
|
193
|
+
m(a("file.maxItems", { limit: e.schema.maxItems }));
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
for (let e of r) for (let [t, n] of [
|
|
197
|
+
["formatMinimum", (e, t) => e < t],
|
|
198
|
+
["formatExclusiveMinimum", (e, t) => e <= t],
|
|
199
|
+
["formatMaximum", (e, t) => e > t],
|
|
200
|
+
["formatExclusiveMaximum", (e, t) => e >= t]
|
|
201
|
+
]) {
|
|
202
|
+
var i;
|
|
203
|
+
let r = (i = w[t]) == null ? E[t] : i, o = Number(r);
|
|
204
|
+
if (r !== void 0 && Number.isFinite(o) && o >= 0 && n(e.size, o)) {
|
|
205
|
+
let n = a("file.sizeBound", {
|
|
206
|
+
name: e.name,
|
|
207
|
+
bound: a({
|
|
208
|
+
formatMinimum: "file.atLeast",
|
|
209
|
+
formatExclusiveMinimum: "file.moreThan",
|
|
210
|
+
formatMaximum: "file.atMost",
|
|
211
|
+
formatExclusiveMaximum: "file.lessThan"
|
|
212
|
+
}[t]),
|
|
213
|
+
limit: o
|
|
214
|
+
});
|
|
215
|
+
if (m(n), A) return;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
let o = e.data;
|
|
219
|
+
f(!0);
|
|
220
|
+
try {
|
|
221
|
+
let t = yield Promise.all(r.map((e) => ue(e, w)));
|
|
222
|
+
if (!C.current || S.current.data !== o || S.current.path !== e.path || !S.current.enabled || S.current.readonly) return;
|
|
223
|
+
let n = [...T];
|
|
224
|
+
if (t.forEach((t) => {
|
|
225
|
+
e.schema.uniqueItems && n.includes(t) || n.push(t);
|
|
226
|
+
}), A && e.schema.maxItems !== void 0 && n.length > e.schema.maxItems) {
|
|
227
|
+
m(a("file.maxItems", { limit: e.schema.maxItems }));
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
b((e) => {
|
|
231
|
+
let n = new Map(e);
|
|
232
|
+
return t.forEach((e, t) => n.set(e, r[t].name)), n;
|
|
233
|
+
}), e.handleChange(e.path, n);
|
|
234
|
+
} catch (e) {
|
|
235
|
+
C.current && (g("error"), m(a("file.readFailed")));
|
|
236
|
+
} finally {
|
|
237
|
+
C.current && f(!1);
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
return function(e) {
|
|
241
|
+
return t.apply(this, arguments);
|
|
242
|
+
};
|
|
243
|
+
}(),
|
|
244
|
+
style: { display: "none" }
|
|
245
|
+
}), /* @__PURE__ */ j.createElement(N, {
|
|
246
|
+
style: {
|
|
247
|
+
flex: "0 0 24px",
|
|
248
|
+
width: 24,
|
|
249
|
+
height: 24,
|
|
250
|
+
padding: 0
|
|
251
|
+
},
|
|
252
|
+
type: "button",
|
|
253
|
+
"aria-label": a("file.select"),
|
|
254
|
+
title: a("file.select"),
|
|
255
|
+
disabled: D,
|
|
256
|
+
onClick: () => {
|
|
257
|
+
var e;
|
|
258
|
+
return (e = u.current) == null ? void 0 : e.click();
|
|
259
|
+
}
|
|
260
|
+
}, /* @__PURE__ */ j.createElement("svg", {
|
|
261
|
+
width: "16",
|
|
262
|
+
height: "16",
|
|
263
|
+
viewBox: "0 0 24 24",
|
|
264
|
+
fill: "none",
|
|
265
|
+
stroke: "currentColor",
|
|
266
|
+
strokeWidth: "2",
|
|
267
|
+
"aria-hidden": "true"
|
|
268
|
+
}, /* @__PURE__ */ j.createElement("path", { d: "M14 2H6v20h12V6z M14 2v6h4" }))), d && /* @__PURE__ */ j.createElement("span", { role: "status" }, a("file.reading")), /* @__PURE__ */ j.createElement("div", {
|
|
269
|
+
"data-file-pills": !0,
|
|
270
|
+
tabIndex: 0,
|
|
271
|
+
style: {
|
|
272
|
+
display: "flex",
|
|
273
|
+
alignItems: "center",
|
|
274
|
+
flex: "1 1 0%",
|
|
275
|
+
minWidth: 0,
|
|
276
|
+
flexWrap: e.cell ? "nowrap" : "wrap",
|
|
277
|
+
gap: 4,
|
|
278
|
+
maxHeight: e.cell ? 28 : "8rem",
|
|
279
|
+
overflowX: "auto",
|
|
280
|
+
overflowY: e.cell ? "hidden" : "auto",
|
|
281
|
+
scrollbarWidth: "thin"
|
|
282
|
+
}
|
|
283
|
+
}, T.map((t, n) => {
|
|
284
|
+
var r, i;
|
|
285
|
+
let o = (r = (i = G(t)) == null ? y.get(String(t)) : i) == null ? a("file.numbered", { index: n + 1 }) : r;
|
|
286
|
+
return /* @__PURE__ */ j.createElement(M, {
|
|
287
|
+
key: n,
|
|
288
|
+
style: {
|
|
289
|
+
display: "inline-flex",
|
|
290
|
+
alignItems: "center",
|
|
291
|
+
gap: 4,
|
|
292
|
+
maxWidth: "12rem",
|
|
293
|
+
flexShrink: 0,
|
|
294
|
+
height: 22,
|
|
295
|
+
boxSizing: "border-box",
|
|
296
|
+
borderRadius: 4,
|
|
297
|
+
padding: "0 4px",
|
|
298
|
+
minWidth: 0
|
|
299
|
+
}
|
|
300
|
+
}, /* @__PURE__ */ j.createElement("span", {
|
|
301
|
+
title: o,
|
|
302
|
+
tabIndex: 0,
|
|
303
|
+
style: {
|
|
304
|
+
flex: 1,
|
|
305
|
+
minWidth: 0,
|
|
306
|
+
overflow: "hidden",
|
|
307
|
+
textOverflow: "ellipsis",
|
|
308
|
+
whiteSpace: "nowrap"
|
|
309
|
+
}
|
|
310
|
+
}, o), E.clearable !== !1 && /* @__PURE__ */ j.createElement(N, {
|
|
311
|
+
type: "button",
|
|
312
|
+
style: {
|
|
313
|
+
width: 16,
|
|
314
|
+
height: 16,
|
|
315
|
+
minWidth: 16,
|
|
316
|
+
padding: 0,
|
|
317
|
+
flexShrink: 0,
|
|
318
|
+
lineHeight: 1
|
|
319
|
+
},
|
|
320
|
+
disabled: !P,
|
|
321
|
+
"aria-label": a("composite.remove", { label: o }),
|
|
322
|
+
onClick: () => {
|
|
323
|
+
m(""), e.handleChange(e.path, T.filter((e, t) => t !== n));
|
|
324
|
+
}
|
|
325
|
+
}, "×"));
|
|
326
|
+
})), p && e.cell && e.FeedbackComponent && /* @__PURE__ */ j.createElement(e.FeedbackComponent, {
|
|
327
|
+
message: p,
|
|
328
|
+
cell: !0,
|
|
329
|
+
severity: h
|
|
330
|
+
}), E.clearable !== !1 && T.length > 0 && e.enabled && !e.readonly && /* @__PURE__ */ j.createElement(N, {
|
|
331
|
+
style: {
|
|
332
|
+
marginLeft: "auto",
|
|
333
|
+
flex: "0 0 24px",
|
|
334
|
+
width: 24,
|
|
335
|
+
height: 24,
|
|
336
|
+
padding: 0,
|
|
337
|
+
opacity: o || c ? 1 : 0
|
|
338
|
+
},
|
|
339
|
+
type: "button",
|
|
340
|
+
"aria-label": a("file.clearAll"),
|
|
341
|
+
title: a("file.clearAll"),
|
|
342
|
+
disabled: D || A && ((i = e.schema.minItems) == null ? 0 : i) > 0,
|
|
343
|
+
onClick: () => {
|
|
344
|
+
m(""), e.handleChange(e.path, []);
|
|
345
|
+
}
|
|
346
|
+
}, "×")), p && !e.cell && (e.FeedbackComponent ? /* @__PURE__ */ j.createElement(e.FeedbackComponent, {
|
|
347
|
+
message: p,
|
|
348
|
+
severity: h
|
|
349
|
+
}) : /* @__PURE__ */ j.createElement("span", { role: "alert" }, p)));
|
|
350
|
+
}, K = (e, t, n, r, i = s) => {
|
|
351
|
+
let o = (e, t) => {
|
|
352
|
+
var n;
|
|
353
|
+
if ((e == null ? void 0 : e.type) === "Control" && e.scope === t) return e;
|
|
354
|
+
for (let r of (n = e == null ? void 0 : e.elements) == null ? [] : n) {
|
|
355
|
+
let e = o(r, t);
|
|
356
|
+
if (e) return e;
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
return e.map((e) => {
|
|
360
|
+
let s = h(e), c = t, l = "#", u = "", d = [];
|
|
361
|
+
for (let e of s.split(".").filter(Boolean)) if (c != null && c.$ref && t && (c = T.schema(t, c.$ref, t)), u = u ? u + "." + e : e, (c == null ? void 0 : c.type) === "array" && /^\d+$/.test(e)) c = Array.isArray(c.items) ? c.items[Number(e)] : c.items, l += "/items", d.push(String(Number(e) + 1));
|
|
362
|
+
else {
|
|
363
|
+
var f, m, g, _;
|
|
364
|
+
c = (f = c == null || (_ = c.properties) == null ? void 0 : _[e]) == null ? c == null ? void 0 : c.additionalProperties : f, l += "/properties/" + e.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
365
|
+
let t = o(n, l), i = typeof (t == null ? void 0 : t.label) == "string" ? t.label : (m = c == null ? void 0 : c.title) == null ? e : m;
|
|
366
|
+
d.push((g = r(a(c, t, u, "label"), i)) == null ? i : g);
|
|
367
|
+
}
|
|
368
|
+
let v = o(n, l), y = p([e], i, r, c, v, s);
|
|
369
|
+
return {
|
|
370
|
+
path: d.join(" / "),
|
|
371
|
+
message: y
|
|
372
|
+
};
|
|
373
|
+
});
|
|
374
|
+
};
|
|
375
|
+
function q() {
|
|
376
|
+
var e, t;
|
|
377
|
+
let n = m(), r = f(), i = (t = n.core) != null && t.uischema ? r(n.core.uischema) : void 0, a = c(), [o, s] = V((e = n.core) == null ? {} : e);
|
|
378
|
+
return {
|
|
379
|
+
context: n,
|
|
380
|
+
effectiveUi: i,
|
|
381
|
+
translate: a,
|
|
382
|
+
primary: o,
|
|
383
|
+
additional: s
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
var fe = (e, t, n = !0) => {
|
|
387
|
+
var r, i, a;
|
|
388
|
+
let { context: o, effectiveUi: s, translate: c, primary: l, additional: u } = q(), d = t === void 0 || (r = X(l, u).get(t)) == null ? Y : r;
|
|
389
|
+
return (0, j.useMemo)(() => {
|
|
390
|
+
var t, r;
|
|
391
|
+
if (!n || !e) return [];
|
|
392
|
+
let i = K(d, (t = o.core) == null ? void 0 : t.schema, s, c, (r = o.i18n) == null ? void 0 : r.translateError);
|
|
393
|
+
return i.length ? i : e.split("\n").filter(Boolean).map((e) => ({
|
|
394
|
+
path: "",
|
|
395
|
+
message: e
|
|
396
|
+
}));
|
|
397
|
+
}, [
|
|
398
|
+
n,
|
|
399
|
+
e,
|
|
400
|
+
d,
|
|
401
|
+
(i = o.core) == null ? void 0 : i.schema,
|
|
402
|
+
s,
|
|
403
|
+
c,
|
|
404
|
+
(a = o.i18n) == null ? void 0 : a.translateError
|
|
405
|
+
]);
|
|
406
|
+
}, pe = (e, t) => {
|
|
407
|
+
var n;
|
|
408
|
+
let r = m();
|
|
409
|
+
if (!e) return 0;
|
|
410
|
+
let i = t === void 0 ? void 0 : X(...V((n = r.core) == null ? {} : n)).get(t);
|
|
411
|
+
return (i == null ? void 0 : i.length) || e.split("\n").filter(Boolean).length;
|
|
412
|
+
}, J = (e, t, n = !0) => {
|
|
413
|
+
var r, i, a, o, s, l, u, d;
|
|
414
|
+
let p = m(), g = f(), _ = (s = p.core) != null && s.uischema ? g(p.core.uischema) : void 0, v = x(), y = c(), b = (r = X(...V((i = p.core) == null ? {} : i)).get(e)) == null ? Y : r, S = (0, j.useMemo)(() => b.filter((t) => h(t) === e && t.keyword !== "propertyNames" && t.propertyName === void 0), [b, e]), C = b.length - S.length, w = (a = (o = t == null ? void 0 : t.showValidationIndicatorCount) == null ? (l = p.config) == null ? void 0 : l.showValidationIndicatorCount : o) != null && a, T = [...(0, j.useMemo)(() => {
|
|
415
|
+
var e, t;
|
|
416
|
+
return K(S, (e = p.core) == null ? void 0 : e.schema, _, y, (t = p.i18n) == null ? void 0 : t.translateError).map((e) => e.message);
|
|
417
|
+
}, [
|
|
418
|
+
S,
|
|
419
|
+
(u = p.core) == null ? void 0 : u.schema,
|
|
420
|
+
_,
|
|
421
|
+
y,
|
|
422
|
+
(d = p.i18n) == null ? void 0 : d.translateError
|
|
423
|
+
])];
|
|
424
|
+
return n && C && T.push(v(w ? C === 1 ? "validation.childrenErrorCount" : "validation.childrenErrorsCount" : "validation.childrenErrors", { count: C })), T.join("\n");
|
|
425
|
+
}, Y = [], me = /* @__PURE__ */ new WeakMap(), X = (e = Y, t = Y) => {
|
|
426
|
+
let n = me.get(e);
|
|
427
|
+
n || (n = /* @__PURE__ */ new WeakMap(), me.set(e, n));
|
|
428
|
+
let r = n.get(t);
|
|
429
|
+
if (!r) {
|
|
430
|
+
r = /* @__PURE__ */ new Map();
|
|
431
|
+
for (let n of [...e, ...t]) {
|
|
432
|
+
let e = h(n), t = [""], a = "";
|
|
433
|
+
for (let n of e.split(".")) n && (a = a ? a + "." + n : n, t.push(a));
|
|
434
|
+
for (let e of t) {
|
|
435
|
+
var i;
|
|
436
|
+
let t = (i = r.get(e)) == null ? [] : i;
|
|
437
|
+
t.push(n), r.set(e, t);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
n.set(t, r);
|
|
441
|
+
}
|
|
442
|
+
return r;
|
|
443
|
+
}, he = (e) => {
|
|
444
|
+
var t, n;
|
|
445
|
+
let r = X(...V((t = m().core) == null ? {} : t)), i = (n = r.get(e)) == null ? Y : n, a = i.map((t) => h(t).slice(e ? e.length + 1 : 0).split(".")[0]).find((e) => /^\d+$/.test(e));
|
|
446
|
+
return {
|
|
447
|
+
count: i.length,
|
|
448
|
+
firstIndex: a === void 0 ? void 0 : Number(a),
|
|
449
|
+
rowCount: (t) => {
|
|
450
|
+
var n, i;
|
|
451
|
+
return (n = (i = r.get(e ? e + "." + t : String(t))) == null ? void 0 : i.length) == null ? 0 : n;
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
}, ge = (e, t) => {
|
|
455
|
+
var r;
|
|
456
|
+
if ((t == null || (r = t.summary) == null ? void 0 : r.type) !== "Label") return;
|
|
457
|
+
let i = [], a = (t) => {
|
|
458
|
+
if (t && typeof t == "object") {
|
|
459
|
+
if (t.type === "Control" && typeof t.scope == "string") {
|
|
460
|
+
let r = n(t.scope).join(".");
|
|
461
|
+
i.push([e, r].filter(Boolean).join("."));
|
|
462
|
+
}
|
|
463
|
+
Array.isArray(t.elements) && t.elements.forEach(a);
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
return a(t.detail), i;
|
|
467
|
+
}, _e = (e, t) => {
|
|
468
|
+
var n, r, i, a, o;
|
|
469
|
+
let s = m(), l = f(), u = (i = s.core) != null && i.uischema ? l(s.core.uischema) : void 0, d = c(), p = X(...V((n = s.core) == null ? {} : n));
|
|
470
|
+
return K(t === void 0 ? (r = p.get(e)) == null ? Y : r : Array.from(new Set(t.flatMap((e) => {
|
|
471
|
+
var t;
|
|
472
|
+
return (t = p.get(e)) == null ? Y : t;
|
|
473
|
+
}))), (a = s.core) == null ? void 0 : a.schema, u, d, (o = s.i18n) == null ? void 0 : o.translateError).map((e) => e.path ? `${e.path}: ${e.message}` : e.message).join("\n");
|
|
474
|
+
}, ve = ({ entries: e, renderToggle: t }) => {
|
|
475
|
+
let [n, r] = (0, j.useState)(!1), i = x();
|
|
476
|
+
return /* @__PURE__ */ j.createElement("div", { style: { maxWidth: "min(28rem, 80vw)" } }, /* @__PURE__ */ j.createElement("strong", null, i(e.length === 1 ? "validation.containerError" : "validation.containerErrors", { count: e.length })), /* @__PURE__ */ j.createElement("ul", { style: {
|
|
477
|
+
margin: "8px 0",
|
|
478
|
+
paddingInlineStart: 20,
|
|
479
|
+
maxHeight: "min(20rem, 50vh)",
|
|
480
|
+
overflowY: "auto",
|
|
481
|
+
overflowWrap: "anywhere"
|
|
482
|
+
} }, (n ? e : e.slice(0, 3)).map((e, t) => /* @__PURE__ */ j.createElement("li", {
|
|
483
|
+
key: t,
|
|
484
|
+
style: { marginBlock: 4 }
|
|
485
|
+
}, e.path && /* @__PURE__ */ j.createElement("strong", null, e.path, ": "), e.message))), e.length > 3 && t(i(n ? "validation.showLess" : "validation.showMore", { count: e.length - 3 }), () => r(!n), n));
|
|
486
|
+
}, ye = j.createContext(void 0), be = (e) => e.split("/").slice(1).map((e) => e.replace(/~1/g, "/").replace(/~0/g, "~")).join("."), xe = (e) => {
|
|
487
|
+
var t, n;
|
|
488
|
+
let { context: r, effectiveUi: i, translate: a, primary: o, additional: s } = q();
|
|
489
|
+
return (0, j.useMemo)(() => {
|
|
490
|
+
var t, n;
|
|
491
|
+
let c = [...o == null ? [] : o, ...s == null ? [] : s].filter((t) => t.keyword === "additionalProperties" && be(t.instancePath) === e);
|
|
492
|
+
return K(c, (t = r.core) == null ? void 0 : t.schema, i, a, (n = r.i18n) == null ? void 0 : n.translateError).map((e, t) => `${c[t].params.additionalProperty}: ${e.message}`).join("\n");
|
|
493
|
+
}, [
|
|
494
|
+
o,
|
|
495
|
+
s,
|
|
496
|
+
e,
|
|
497
|
+
(t = r.core) == null ? void 0 : t.schema,
|
|
498
|
+
i,
|
|
499
|
+
a,
|
|
500
|
+
(n = r.i18n) == null ? void 0 : n.translateError
|
|
501
|
+
]);
|
|
502
|
+
}, Se = (e) => {
|
|
503
|
+
var t, n;
|
|
504
|
+
let { context: r, effectiveUi: i, translate: a, primary: o, additional: s } = q();
|
|
505
|
+
return (0, j.useMemo)(() => {
|
|
506
|
+
let t = /* @__PURE__ */ new Map(), n = [...o == null ? [] : o, ...s == null ? [] : s].filter((t) => (t.propertyName !== void 0 || t.keyword === "propertyNames") && be(t.instancePath) === e), c = new Set(n.filter((e) => e.keyword !== "propertyNames").map((e) => e.propertyName));
|
|
507
|
+
for (let e of n) {
|
|
508
|
+
var l, u, d;
|
|
509
|
+
let n = (l = e.propertyName) == null ? e.params.propertyName : l;
|
|
510
|
+
if (e.keyword === "propertyNames" && c.has(n)) continue;
|
|
511
|
+
let o = K([e], (u = r.core) == null ? void 0 : u.schema, i, a, (d = r.i18n) == null ? void 0 : d.translateError)[0].message;
|
|
512
|
+
t.set(n, [t.get(n), o].filter(Boolean).join("\n"));
|
|
513
|
+
}
|
|
514
|
+
return t;
|
|
515
|
+
}, [
|
|
516
|
+
o,
|
|
517
|
+
s,
|
|
518
|
+
e,
|
|
519
|
+
(t = r.core) == null ? void 0 : t.schema,
|
|
520
|
+
i,
|
|
521
|
+
a,
|
|
522
|
+
(n = r.i18n) == null ? void 0 : n.translateError
|
|
523
|
+
]);
|
|
524
|
+
}, Ce = () => {
|
|
525
|
+
let e = m(), t = c();
|
|
526
|
+
return (n) => {
|
|
527
|
+
var r;
|
|
528
|
+
return n != null && n.length ? K(n, void 0, void 0, t, (r = e.i18n) == null ? void 0 : r.translateError).map((e) => e.message).join("\n") : void 0;
|
|
529
|
+
};
|
|
530
|
+
};
|
|
531
|
+
function we(e, t, n) {
|
|
532
|
+
let [r, i] = j.useState(!1), a = pe(n ? "" : e, n ? void 0 : t), o = fe(e, t, r && !n);
|
|
533
|
+
return {
|
|
534
|
+
open: r,
|
|
535
|
+
setOpen: i,
|
|
536
|
+
count: a,
|
|
537
|
+
entries: o,
|
|
538
|
+
message: !n && o[0] ? [o[0].path, o[0].message].filter(Boolean).join(": ") : e
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
// ../jsonforms-react-renderer-common/lib/cells/compositeSummary.esm.js
|
|
542
|
+
var Z = (e) => ({
|
|
543
|
+
text: e,
|
|
544
|
+
generated: !0
|
|
545
|
+
}), Q = (e) => ({
|
|
546
|
+
text: e,
|
|
547
|
+
generated: !1
|
|
548
|
+
}), Te = (e) => e != null && typeof e != "object" && String(e).trim() !== "";
|
|
549
|
+
function Ee(e, t) {
|
|
550
|
+
let n = g.fromScoped(t), r = [];
|
|
551
|
+
for (let t of e) {
|
|
552
|
+
let e = T.data(t, n);
|
|
553
|
+
if (Te(e) && (r.push(String(e)), r.length === 2)) break;
|
|
554
|
+
}
|
|
555
|
+
return r;
|
|
556
|
+
}
|
|
557
|
+
function De(e, t, n, r) {
|
|
558
|
+
let i = t != null && t.scope ? Ee(e, t) : [];
|
|
559
|
+
if (i.length) {
|
|
560
|
+
let t = e.length - i.length, a = t ? " " + n("composite.summary.more", r("composite.summary.more"), { count: t }).replace("{count}", String(t)) : "";
|
|
561
|
+
return Q(i.join(", ") + a);
|
|
562
|
+
}
|
|
563
|
+
let a = e.length === 1 ? "composite.summary.item" : "composite.summary.items";
|
|
564
|
+
return Z(n(a, r(a), { count: e.length }).replace("{count}", String(e.length)));
|
|
565
|
+
}
|
|
566
|
+
function Oe(e, t, n, r, i) {
|
|
567
|
+
var o;
|
|
568
|
+
let s = n ? T.schema(n, e.scope, n) : void 0, c = typeof e.label == "string" ? e.label : (o = s == null ? void 0 : s.title) == null ? t ? l(t.split(".").pop()) : r : o;
|
|
569
|
+
return c ? i(a(s, e, t, "label"), c) : void 0;
|
|
570
|
+
}
|
|
571
|
+
function ke(e, t, n, r, i, a) {
|
|
572
|
+
if (Object.keys(e).length === 0) return Z(r("composite.summary.emptyObject", i("composite.summary.emptyObject")));
|
|
573
|
+
if (t != null && t.scope) {
|
|
574
|
+
let o = g.fromScoped(t), s = T.data(e, o);
|
|
575
|
+
if (Te(s)) return Q(String(s));
|
|
576
|
+
let c = Oe(t, o, a, n, r);
|
|
577
|
+
if (c !== void 0) return Z(r("composite.summary.unspecified", i("composite.summary.unspecified"), { label: c }).replace("{label}", c));
|
|
578
|
+
}
|
|
579
|
+
return Z(n == null ? r("composite.summary.details", i("composite.summary.details")) : n);
|
|
580
|
+
}
|
|
581
|
+
var Ae = (e, t, n, r, i, a) => e == null ? Z(r("composite.summary.unset", i("composite.summary.unset"))) : Array.isArray(e) ? De(e, t, r, i) : typeof e == "object" ? ke(e, t, n, r, i, a) : Q(String(e)), je = (...e) => Ae(...e).text, Me = ({ path: e, children: t }) => {
|
|
582
|
+
let n = m(), r = (0, j.useMemo)(() => {
|
|
583
|
+
let t = !1, r, i = Object.defineProperties({}, Object.getOwnPropertyDescriptors(n));
|
|
584
|
+
return Object.defineProperty(i, "item", {
|
|
585
|
+
enumerable: !0,
|
|
586
|
+
configurable: !0,
|
|
587
|
+
get: () => {
|
|
588
|
+
if (!t) {
|
|
589
|
+
var i;
|
|
590
|
+
r = T.data((i = n.core) == null ? void 0 : i.data, e), t = !0;
|
|
591
|
+
}
|
|
592
|
+
return r;
|
|
593
|
+
}
|
|
594
|
+
}), i;
|
|
595
|
+
}, [n, e]);
|
|
596
|
+
return /* @__PURE__ */ j.createElement(o.Provider, { value: r }, t);
|
|
597
|
+
}, Ne = ({ schema: e, path: t, uischema: n }) => /* @__PURE__ */ j.createElement(u, {
|
|
598
|
+
schema: e,
|
|
599
|
+
uischema: n,
|
|
600
|
+
path: t == null ? "" : t,
|
|
601
|
+
enabled: !1
|
|
602
|
+
}), Pe = (0, j.createContext)(void 0), Fe = ({ changes: e, children: t }) => /* @__PURE__ */ j.createElement(Pe.Provider, { value: e }, t), Ie = (e) => {
|
|
603
|
+
let t = (0, j.useContext)(Pe), n = (0, j.useMemo)(() => ({
|
|
604
|
+
flush: () => n.current.flush(),
|
|
605
|
+
cancel: () => n.current.cancel(),
|
|
606
|
+
current: e
|
|
607
|
+
}), []);
|
|
608
|
+
n.current = e, (0, j.useEffect)(() => {
|
|
609
|
+
if (t) return t.add(n), () => {
|
|
610
|
+
n.cancel(), t.delete(n);
|
|
611
|
+
};
|
|
612
|
+
}, [t, n]);
|
|
613
|
+
}, Le = ({ path: e, reveal: t, renderAction: n, options: r }) => {
|
|
614
|
+
let i = he(e), a = J(e, r), o = x();
|
|
615
|
+
return i.count ? /* @__PURE__ */ j.createElement("div", {
|
|
616
|
+
role: "status",
|
|
617
|
+
style: {
|
|
618
|
+
display: "flex",
|
|
619
|
+
gap: 8,
|
|
620
|
+
alignItems: "center",
|
|
621
|
+
flexWrap: "wrap",
|
|
622
|
+
paddingBlock: 8
|
|
623
|
+
}
|
|
624
|
+
}, /* @__PURE__ */ j.createElement("span", { style: { whiteSpace: "pre-line" } }, a), i.firstIndex !== void 0 && (n ? n(o("collection.firstError"), () => t(i.firstIndex), /* @__PURE__ */ j.createElement(ze, null)) : /* @__PURE__ */ j.createElement("button", {
|
|
625
|
+
type: "button",
|
|
626
|
+
title: o("collection.firstError"),
|
|
627
|
+
"aria-label": o("collection.firstError"),
|
|
628
|
+
style: {
|
|
629
|
+
color: "inherit",
|
|
630
|
+
background: "transparent",
|
|
631
|
+
border: "1px solid currentColor",
|
|
632
|
+
borderRadius: 4,
|
|
633
|
+
width: 28,
|
|
634
|
+
height: 28,
|
|
635
|
+
display: "inline-grid",
|
|
636
|
+
placeItems: "center",
|
|
637
|
+
cursor: "pointer"
|
|
638
|
+
},
|
|
639
|
+
onClick: () => t(i.firstIndex)
|
|
640
|
+
}, /* @__PURE__ */ j.createElement(ze, null)))) : null;
|
|
641
|
+
}, Re = ({ path: e, index: t, renderIndicator: n }) => {
|
|
642
|
+
let r = he(e), i = x(), a = r.rowCount(t);
|
|
643
|
+
if (!a) return null;
|
|
644
|
+
let o = i(a === 1 ? "validation.containerError" : "validation.containerErrors", { count: a });
|
|
645
|
+
return n ? /* @__PURE__ */ j.createElement(j.Fragment, null, n(o)) : /* @__PURE__ */ j.createElement("span", {
|
|
646
|
+
role: "img",
|
|
647
|
+
"aria-label": o,
|
|
648
|
+
title: o
|
|
649
|
+
}, /* @__PURE__ */ j.createElement("svg", {
|
|
650
|
+
width: "16",
|
|
651
|
+
height: "16",
|
|
652
|
+
viewBox: "0 0 24 24",
|
|
653
|
+
fill: "none",
|
|
654
|
+
stroke: "currentColor",
|
|
655
|
+
strokeWidth: "2",
|
|
656
|
+
"aria-hidden": "true"
|
|
657
|
+
}, /* @__PURE__ */ j.createElement("circle", {
|
|
658
|
+
cx: "12",
|
|
659
|
+
cy: "12",
|
|
660
|
+
r: "9"
|
|
661
|
+
}), /* @__PURE__ */ j.createElement("path", { d: "M12 7v6m0 3v1" })));
|
|
662
|
+
}, ze = () => /* @__PURE__ */ j.createElement("svg", {
|
|
663
|
+
width: "16",
|
|
664
|
+
height: "16",
|
|
665
|
+
viewBox: "0 0 24 24",
|
|
666
|
+
fill: "none",
|
|
667
|
+
stroke: "currentColor",
|
|
668
|
+
strokeWidth: "2",
|
|
669
|
+
strokeLinecap: "round",
|
|
670
|
+
strokeLinejoin: "round",
|
|
671
|
+
"aria-hidden": "true",
|
|
672
|
+
focusable: "false"
|
|
673
|
+
}, /* @__PURE__ */ j.createElement("path", { d: "M4 12h14M12 6l6 6-6 6M21 4v16" })), Be = (e, t, n) => t === void 0 ? n : [...new Set(t.map((e) => e.field))].filter((n) => Object.prototype.hasOwnProperty.call(e, n) || t.some((e) => e.field === n && e.scope === "#")), Ve = (e) => {
|
|
674
|
+
let t = {};
|
|
675
|
+
for (let n of [
|
|
676
|
+
"width",
|
|
677
|
+
"minWidth",
|
|
678
|
+
"maxWidth"
|
|
679
|
+
]) {
|
|
680
|
+
let r = e == null ? void 0 : e[n];
|
|
681
|
+
typeof r == "number" && Number.isFinite(r) && r > 0 && (t[n] = r);
|
|
682
|
+
}
|
|
683
|
+
return t;
|
|
684
|
+
}, He = /* @__PURE__ */ e(i()), $ = /* @__PURE__ */ e(b());
|
|
685
|
+
D();
|
|
686
|
+
var Ue = (e) => {
|
|
687
|
+
var t, n, i, a;
|
|
688
|
+
let s = m(), c = (0, j.useMemo)(() => /* @__PURE__ */ new Set(), []), l = x(), f = (n = e.uischema) == null || (n = n.options) == null ? void 0 : n.rowDetail, [p, h] = (0, j.useState)(() => (f == null ? void 0 : f.collapsed) !== !0), [g, _] = (0, j.useState)(), v = (0, j.useRef)(), b = T.data((i = s.core) == null ? void 0 : i.data, e.path), [S, C] = (0, j.useState)({
|
|
689
|
+
array: b,
|
|
690
|
+
presentation: f == null ? void 0 : f.presentation
|
|
691
|
+
}), w = S.array;
|
|
692
|
+
if (w !== b || S.presentation !== (f == null ? void 0 : f.presentation)) {
|
|
693
|
+
if (g && (f == null ? void 0 : f.presentation) === "panel" && (b == null ? void 0 : b[g.index]) !== g.source) {
|
|
694
|
+
var D;
|
|
695
|
+
let e = (D = b == null ? void 0 : b.indexOf(g.source)) == null ? -1 : D;
|
|
696
|
+
e >= 0 ? _({
|
|
697
|
+
index: e,
|
|
698
|
+
source: g.source
|
|
699
|
+
}) : b && w && b.length === w.length && b.every((e, t) => t === g.index || e === (w == null ? void 0 : w[t])) ? _({
|
|
700
|
+
index: g.index,
|
|
701
|
+
source: b[g.index]
|
|
702
|
+
}) : _(void 0);
|
|
703
|
+
}
|
|
704
|
+
C({
|
|
705
|
+
array: b,
|
|
706
|
+
presentation: f == null ? void 0 : f.presentation
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
let k = g ? [e.path, g.index].filter((e) => e !== "").join(".") : "", A = e.enabled !== !1 && !e.readonly && !((a = e.schema) != null && a.readOnly), M = !!g && (f == null ? void 0 : f.presentation) === "dialog" && !(0, He.default)(b == null ? void 0 : b[g.index], g.source), N = (e) => {
|
|
710
|
+
var t;
|
|
711
|
+
let n = (f == null ? void 0 : f.presentation) === "dialog" ? O(O({}, s.core), {}, { data: (0, $.default)((t = s.core) == null ? void 0 : t.data) }) : void 0;
|
|
712
|
+
v.current = n, _({
|
|
713
|
+
index: e,
|
|
714
|
+
source: b == null ? void 0 : b[e],
|
|
715
|
+
draft: n
|
|
716
|
+
});
|
|
717
|
+
}, P = () => {
|
|
718
|
+
c.forEach((e) => e.cancel()), _(void 0), v.current = void 0;
|
|
719
|
+
}, F = (e) => {
|
|
720
|
+
A && v.current && e.type === "jsonforms/UPDATE" && (e.path === k || e.path.startsWith(k + ".")) && (v.current = r(v.current, e), _((e) => e && O(O({}, e), {}, { draft: v.current })));
|
|
721
|
+
}, ee = y((t = s.uischemas) == null ? [] : t, e.schema, e.uischema.scope, k, () => E.uiSchema(e.schema, "VerticalLayout", void 0, e.rootSchema), O(O({}, e.uischema), {}, { options: O(O({}, e.uischema.options), {}, { detail: f == null ? void 0 : f.detail }) }), e.rootSchema), I = g && b && g.index < b.length ? /* @__PURE__ */ j.createElement(u, {
|
|
722
|
+
schema: e.schema,
|
|
723
|
+
uischema: ee,
|
|
724
|
+
path: k,
|
|
725
|
+
enabled: A,
|
|
726
|
+
readonly: !A,
|
|
727
|
+
renderers: e.renderers,
|
|
728
|
+
cells: e.cells
|
|
729
|
+
}) : null;
|
|
730
|
+
return {
|
|
731
|
+
options: f,
|
|
732
|
+
panelOpen: p,
|
|
733
|
+
setPanelOpen: h,
|
|
734
|
+
open: N,
|
|
735
|
+
close: P,
|
|
736
|
+
selection: g,
|
|
737
|
+
enabled: A,
|
|
738
|
+
conflict: M,
|
|
739
|
+
t: l,
|
|
740
|
+
content: g != null && g.draft ? /* @__PURE__ */ j.createElement(o.Provider, { value: O(O({}, s), {}, {
|
|
741
|
+
core: g.draft,
|
|
742
|
+
dispatch: F
|
|
743
|
+
}) }, /* @__PURE__ */ j.createElement(Fe, { changes: c }, I)) : I,
|
|
744
|
+
apply: () => {
|
|
745
|
+
var e;
|
|
746
|
+
if (!g || !A || M || !v.current) return;
|
|
747
|
+
c.forEach((e) => e.flush());
|
|
748
|
+
let t = (0, $.default)(T.data(v.current.data, k));
|
|
749
|
+
(0, He.default)(t, g.source) || (e = s.dispatch) == null || e.call(s, d(k, () => t)), P();
|
|
750
|
+
}
|
|
751
|
+
};
|
|
752
|
+
};
|
|
753
|
+
function We(e, t) {
|
|
754
|
+
return function({ state: n, children: r }) {
|
|
755
|
+
return n.options ? n.options.presentation === "dialog" ? /* @__PURE__ */ j.createElement(j.Fragment, null, r, /* @__PURE__ */ j.createElement(e, { state: n })) : /* @__PURE__ */ j.createElement(t, { state: n }, r) : /* @__PURE__ */ j.createElement(j.Fragment, null, r);
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
function Ge(e) {
|
|
759
|
+
return function({ state: t }) {
|
|
760
|
+
var n;
|
|
761
|
+
return ((n = t.options) == null ? void 0 : n.presentation) === "panel" ? e({
|
|
762
|
+
label: t.t(t.panelOpen ? "collection.hideDetails" : "collection.showDetails"),
|
|
763
|
+
expanded: t.panelOpen,
|
|
764
|
+
toggle: () => t.setPanelOpen((e) => !e)
|
|
765
|
+
}) : null;
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
export { ne as A, U as C, le as D, G as E, R as M, z as N, ce as O, _e as S, de as T, xe as _, Ve as a, Se as b, Fe as c, Ne as d, Ae as f, ye as g, ge as h, Be as i, te as j, V as k, Ie as l, Ce as m, We as n, Re as o, je as p, Ge as r, Le as s, Ue as t, Me as u, ve as v, W as w, J as x, we as y };
|
|
769
|
+
|
|
770
|
+
//# sourceMappingURL=rowDetail.esm-Ce56gyeo.mjs.map
|