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