@opennsw/jsonforms-renderers 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,28 +1,37 @@
1
- import { jsx as e, jsxs as s, Fragment as ce } from "react/jsx-runtime";
2
- import { createContext as ze, useContext as Te, useState as L, useRef as Le, useEffect as X, useCallback as se } from "react";
3
- import { rankWith as z, isStringControl as Ue, or as Z, isNumberControl as Ae, isIntegerControl as De, isBooleanControl as ke, isEnumControl as xe, isOneOfControl as Re, isDateControl as Fe, uiTypeIs as E, formatIs as ae, createDefaultValue as $e, isObjectArrayControl as Ne, isPrimitiveArrayControl as Ie } from "@jsonforms/core";
4
- import { withJsonFormsControlProps as I, JsonFormsDispatch as B, withJsonFormsArrayControlProps as Se } from "@jsonforms/react";
5
- import { Box as w, Flex as v, Text as c, TextField as Q, Checkbox as Ee, Select as H, Tabs as M, Card as Y, Heading as ue, Button as _, IconButton as Be } from "@radix-ui/themes";
6
- import { FileTextIcon as Oe, CheckCircledIcon as Ve, Cross2Icon as Pe, ExclamationTriangleIcon as je, UploadIcon as He, TrashIcon as Me, PlusIcon as We } from "@radix-ui/react-icons";
7
- const he = ze(null);
8
- function $r({
1
+ import { jsx as e, jsxs as p, Fragment as Y } from "react/jsx-runtime";
2
+ import { createContext as ge, useContext as me, useState as M, useRef as ee, useEffect as fe, useCallback as be } from "react";
3
+ import { rankWith as z, isStringControl as ye, or as Z, isNumberControl as ve, isIntegerControl as Ce, isBooleanControl as we, isEnumControl as ne, isOneOfControl as oe, isDateControl as ze, uiTypeIs as j, and as xe, schemaMatches as $e, createDefaultValue as ke, isObjectArrayControl as Te, isPrimitiveArrayControl as Re } from "@jsonforms/core";
4
+ import { withJsonFormsControlProps as U, JsonFormsDispatch as E, withJsonFormsArrayControlProps as Se } from "@jsonforms/react";
5
+ import { Box as w, Flex as C, Text as c, TextField as Q, Checkbox as Fe, RadioGroup as re, Select as W, Tabs as G, Heading as le, Card as ie, Button as _, IconButton as Le } from "@radix-ui/themes";
6
+ import { FileTextIcon as Ae, CheckCircledIcon as Ue, Cross2Icon as De, ExclamationTriangleIcon as Ie, UploadIcon as Oe, TrashIcon as Ve, PlusIcon as je } from "@radix-ui/react-icons";
7
+ const ce = ge(null);
8
+ function Tr({
9
9
  children: t,
10
- onUpload: l,
11
- getDownloadUrl: r,
12
- openFileInNewTab: u
10
+ onUpload: n,
11
+ getDownloadUrl: r
13
12
  }) {
14
- const m = { onUpload: l, getDownloadUrl: r, openFileInNewTab: u };
15
- return /* @__PURE__ */ e(he.Provider, { value: m, children: t });
13
+ const f = { onUpload: n, getDownloadUrl: r };
14
+ return /* @__PURE__ */ e(ce.Provider, { value: f, children: t });
16
15
  }
17
- function _e() {
18
- return Te(he);
16
+ function Ee() {
17
+ return me(ce);
19
18
  }
20
- const qe = ({ data: t, handleChange: l, path: r, label: u, required: m, errors: i, uischema: a, schema: n, enabled: b }) => {
21
- var f;
22
- const d = i.length === 0;
23
- return /* @__PURE__ */ e(w, { mb: "4", children: /* @__PURE__ */ s(v, { direction: "column", gap: "1", children: [
24
- /* @__PURE__ */ s(c, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
25
- u,
19
+ const Ne = ({
20
+ data: t,
21
+ handleChange: n,
22
+ path: r,
23
+ label: f,
24
+ required: m,
25
+ errors: i,
26
+ uischema: l,
27
+ schema: h,
28
+ enabled: s
29
+ }) => {
30
+ var y;
31
+ const g = i.length === 0;
32
+ return /* @__PURE__ */ e(w, { mb: "4", children: /* @__PURE__ */ p(C, { direction: "column", gap: "1", children: [
33
+ /* @__PURE__ */ p(c, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
34
+ f,
26
35
  " ",
27
36
  m && /* @__PURE__ */ e(c, { color: "red", children: "*" })
28
37
  ] }),
@@ -30,32 +39,39 @@ const qe = ({ data: t, handleChange: l, path: r, label: u, required: m, errors:
30
39
  Q.Root,
31
40
  {
32
41
  value: t || "",
33
- onChange: (C) => l(r, C.target.value),
34
- disabled: !b,
35
- placeholder: (f = a.options) == null ? void 0 : f.placeholder,
36
- color: d ? void 0 : "red",
42
+ onChange: (a) => n(r, a.target.value),
43
+ disabled: !s,
44
+ placeholder: (y = l.options) == null ? void 0 : y.placeholder,
45
+ color: g ? void 0 : "red",
37
46
  id: r
38
47
  }
39
48
  ),
40
- !d && i !== "is a required property" && /* @__PURE__ */ e(c, { color: "red", size: "1", children: i }),
41
- n.description && /* @__PURE__ */ e(c, { size: "1", color: "gray", children: n.description })
49
+ !g && i !== "is a required property" && /* @__PURE__ */ e(c, { color: "red", size: "1", children: i }),
50
+ h.description && /* @__PURE__ */ e(c, { size: "1", color: "gray", children: h.description })
42
51
  ] }) });
43
- }, Ge = z(
44
- 1,
45
- Ue
46
- ), Je = I(qe), Ke = ({ data: t, handleChange: l, path: r, label: u, required: m, errors: i, uischema: a, schema: n, enabled: b }) => {
47
- var C;
48
- const d = i.length === 0, f = (h) => {
49
- if (h === "") {
50
- l(r, void 0);
52
+ }, Be = z(1, ye), Pe = U(Ne), We = ({
53
+ data: t,
54
+ handleChange: n,
55
+ path: r,
56
+ label: f,
57
+ required: m,
58
+ errors: i,
59
+ uischema: l,
60
+ schema: h,
61
+ enabled: s
62
+ }) => {
63
+ var a;
64
+ const g = i.length === 0, y = (d) => {
65
+ if (d === "") {
66
+ n(r, void 0);
51
67
  return;
52
68
  }
53
- const p = Number(h);
54
- isNaN(p) || l(r, p);
69
+ const u = Number(d);
70
+ isNaN(u) || n(r, u);
55
71
  };
56
- return /* @__PURE__ */ e(w, { mb: "4", children: /* @__PURE__ */ s(v, { direction: "column", gap: "1", children: [
57
- /* @__PURE__ */ s(c, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
58
- u,
72
+ return /* @__PURE__ */ e(w, { mb: "4", children: /* @__PURE__ */ p(C, { direction: "column", gap: "1", children: [
73
+ /* @__PURE__ */ p(c, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
74
+ f,
59
75
  " ",
60
76
  m && /* @__PURE__ */ e(c, { color: "red", children: "*" })
61
77
  ] }),
@@ -64,89 +80,137 @@ const qe = ({ data: t, handleChange: l, path: r, label: u, required: m, errors:
64
80
  {
65
81
  type: "number",
66
82
  value: t ?? "",
67
- onChange: (h) => f(h.target.value),
68
- disabled: !b,
69
- placeholder: (C = a.options) == null ? void 0 : C.placeholder,
70
- color: d ? void 0 : "red",
83
+ onChange: (d) => y(d.target.value),
84
+ disabled: !s,
85
+ placeholder: (a = l.options) == null ? void 0 : a.placeholder,
86
+ color: g ? void 0 : "red",
71
87
  id: r
72
88
  }
73
89
  ),
74
- !d && i !== "is a required property" && /* @__PURE__ */ e(c, { color: "red", size: "1", children: i }),
75
- n.description && /* @__PURE__ */ e(c, { size: "1", color: "gray", children: n.description })
90
+ !g && i !== "is a required property" && /* @__PURE__ */ e(c, { color: "red", size: "1", children: i }),
91
+ h.description && /* @__PURE__ */ e(c, { size: "1", color: "gray", children: h.description })
76
92
  ] }) });
77
- }, Xe = z(
78
- 2,
79
- Z(Ae, De)
80
- ), Ze = I(Ke), Qe = ({ data: t, handleChange: l, path: r, label: u, required: m, errors: i, schema: a, enabled: n }) => {
81
- const b = i.length === 0;
82
- return /* @__PURE__ */ s(w, { mb: "4", children: [
83
- /* @__PURE__ */ s(v, { gap: "2", align: "center", children: [
93
+ }, Ge = z(2, Z(ve, Ce)), qe = U(We), Ke = ({
94
+ data: t,
95
+ handleChange: n,
96
+ path: r,
97
+ label: f,
98
+ required: m,
99
+ errors: i,
100
+ schema: l,
101
+ enabled: h
102
+ }) => {
103
+ const s = i.length === 0;
104
+ return /* @__PURE__ */ p(w, { mb: "4", children: [
105
+ /* @__PURE__ */ p(C, { gap: "2", align: "center", children: [
84
106
  /* @__PURE__ */ e(
85
- Ee,
107
+ Fe,
86
108
  {
87
109
  checked: !!t,
88
- onCheckedChange: (d) => l(r, d === !0),
89
- disabled: !n,
110
+ onCheckedChange: (g) => n(r, g === !0),
111
+ disabled: !h,
90
112
  id: r
91
113
  }
92
114
  ),
93
- /* @__PURE__ */ s(c, { as: "label", size: "2", htmlFor: r, children: [
94
- u,
115
+ /* @__PURE__ */ p(c, { as: "label", size: "2", htmlFor: r, children: [
116
+ f,
95
117
  " ",
96
118
  m && "*"
97
119
  ] })
98
120
  ] }),
99
- !b && /* @__PURE__ */ e(c, { color: "red", size: "1", className: "block mt-1", children: i }),
100
- a.description && /* @__PURE__ */ e(c, { size: "1", color: "gray", className: "block mt-1", children: a.description })
121
+ !s && /* @__PURE__ */ e(c, { color: "red", size: "1", className: "block mt-1", children: i }),
122
+ l.description && /* @__PURE__ */ e(c, { size: "1", color: "gray", className: "block mt-1", children: l.description })
101
123
  ] });
102
- }, Ye = z(
103
- 2,
104
- ke
105
- ), er = I(Qe), rr = ({ data: t, handleChange: l, path: r, label: u, required: m, errors: i, schema: a, uischema: n, enabled: b }) => {
106
- var h;
107
- const d = i.length === 0;
108
- let f = [];
109
- a.enum ? f = a.enum.map((p) => ({ value: String(p), label: String(p) })) : a.oneOf && (f = a.oneOf.map((p) => ({
110
- value: String(p.const),
111
- label: p.title || String(p.const)
124
+ }, Me = z(2, we), He = U(Ke), Je = ({ data: t, handleChange: n, path: r, label: f, required: m, errors: i, schema: l, enabled: h }) => {
125
+ const s = i.length === 0;
126
+ let g = [];
127
+ l.enum ? g = l.enum.map((a) => ({ value: a, label: String(a) })) : l.oneOf && (g = l.oneOf.map((a) => ({
128
+ value: a.const,
129
+ label: a.title || String(a.const)
112
130
  })));
113
- const C = t !== void 0 ? String(t) : "";
114
- return /* @__PURE__ */ e(w, { mb: "4", children: /* @__PURE__ */ s(v, { direction: "column", gap: "1", children: [
115
- /* @__PURE__ */ s(c, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
116
- u,
131
+ const y = t;
132
+ return /* @__PURE__ */ e(w, { mb: "4", children: /* @__PURE__ */ p(C, { direction: "column", gap: "1", children: [
133
+ /* @__PURE__ */ p(c, { as: "div", size: "2", weight: "bold", children: [
134
+ f,
117
135
  " ",
118
136
  m && /* @__PURE__ */ e(c, { color: "red", children: "*" })
119
137
  ] }),
120
- /* @__PURE__ */ s(
121
- H.Root,
138
+ /* @__PURE__ */ e(
139
+ re.Root,
122
140
  {
123
- value: C,
124
- onValueChange: (p) => l(r, p),
125
- disabled: !b,
126
- children: [
127
- /* @__PURE__ */ e(
128
- H.Trigger,
129
- {
130
- placeholder: ((h = n.options) == null ? void 0 : h.placeholder) || "Select an option",
131
- color: d ? void 0 : "red",
132
- id: r
133
- }
134
- ),
135
- /* @__PURE__ */ e(H.Content, { children: f.map((p) => /* @__PURE__ */ e(H.Item, { value: p.value, children: p.label }, p.value)) })
136
- ]
141
+ value: y !== void 0 ? String(y) : "",
142
+ onValueChange: (a) => {
143
+ const d = g.find((u) => String(u.value) === a);
144
+ d && n(r, d.value);
145
+ },
146
+ disabled: !h,
147
+ children: /* @__PURE__ */ e(
148
+ C,
149
+ {
150
+ direction: "row",
151
+ style: {
152
+ flexWrap: "wrap",
153
+ columnGap: "clamp(14px, 3vw, 36px)",
154
+ rowGap: "clamp(8px, 1.6vw, 14px)"
155
+ },
156
+ children: g.map((a) => /* @__PURE__ */ p(C, { align: "center", gap: "2", style: { minWidth: "max-content" }, children: [
157
+ /* @__PURE__ */ e(re.Item, { value: String(a.value) }),
158
+ /* @__PURE__ */ e(c, { size: "2", color: h ? void 0 : "gray", children: a.label })
159
+ ] }, String(a.value)))
160
+ }
161
+ )
137
162
  }
138
163
  ),
139
- !d && i !== "is a required property" && /* @__PURE__ */ e(c, { color: "red", size: "1", children: i }),
140
- a.description && /* @__PURE__ */ e(c, { size: "1", color: "gray", children: a.description })
164
+ !s && i !== "is a required property" && /* @__PURE__ */ e(c, { color: "red", size: "1", children: i }),
165
+ l.description && /* @__PURE__ */ e(c, { size: "1", color: "gray", children: l.description })
166
+ ] }) });
167
+ }, _e = (t, n, r) => {
168
+ var m;
169
+ return Z(ne, oe)(t, n, r) && ((m = t == null ? void 0 : t.options) == null ? void 0 : m.format) === "radio" ? 3 : -1;
170
+ }, Ze = U(Je), Qe = ({
171
+ data: t,
172
+ handleChange: n,
173
+ path: r,
174
+ label: f,
175
+ required: m,
176
+ errors: i,
177
+ schema: l,
178
+ uischema: h,
179
+ enabled: s
180
+ }) => {
181
+ var d;
182
+ const g = i.length === 0;
183
+ let y = [];
184
+ l.enum ? y = l.enum.map((u) => ({ value: String(u), label: String(u) })) : l.oneOf && (y = l.oneOf.map((u) => ({
185
+ value: String(u.const),
186
+ label: u.title || String(u.const)
187
+ })));
188
+ const a = t !== void 0 ? String(t) : "";
189
+ return /* @__PURE__ */ e(w, { mb: "4", children: /* @__PURE__ */ p(C, { direction: "column", gap: "1", children: [
190
+ /* @__PURE__ */ p(c, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
191
+ f,
192
+ " ",
193
+ m && /* @__PURE__ */ e(c, { color: "red", children: "*" })
194
+ ] }),
195
+ /* @__PURE__ */ p(W.Root, { value: a, onValueChange: (u) => n(r, u), disabled: !s, children: [
196
+ /* @__PURE__ */ e(
197
+ W.Trigger,
198
+ {
199
+ placeholder: ((d = h.options) == null ? void 0 : d.placeholder) || "Select an option",
200
+ color: g ? void 0 : "red",
201
+ id: r
202
+ }
203
+ ),
204
+ /* @__PURE__ */ e(W.Content, { children: y.map((u) => /* @__PURE__ */ e(W.Item, { value: u.value, children: u.label }, u.value)) })
205
+ ] }),
206
+ !g && i !== "is a required property" && /* @__PURE__ */ e(c, { color: "red", size: "1", children: i }),
207
+ l.description && /* @__PURE__ */ e(c, { size: "1", color: "gray", children: l.description })
141
208
  ] }) });
142
- }, tr = z(
143
- 2,
144
- Z(xe, Re)
145
- ), or = I(rr), nr = ({ data: t, handleChange: l, path: r, label: u, required: m, errors: i, schema: a, enabled: n }) => {
146
- const b = i.length === 0;
147
- return /* @__PURE__ */ e(w, { mb: "4", children: /* @__PURE__ */ s(v, { direction: "column", gap: "1", children: [
148
- /* @__PURE__ */ s(c, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
149
- u,
209
+ }, Xe = z(2, Z(ne, oe)), Ye = U(Qe), er = ({ data: t, handleChange: n, path: r, label: f, required: m, errors: i, schema: l, enabled: h }) => {
210
+ const s = i.length === 0;
211
+ return /* @__PURE__ */ e(w, { mb: "4", children: /* @__PURE__ */ p(C, { direction: "column", gap: "1", children: [
212
+ /* @__PURE__ */ p(c, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
213
+ f,
150
214
  " ",
151
215
  m && /* @__PURE__ */ e(c, { color: "red", children: "*" })
152
216
  ] }),
@@ -155,422 +219,405 @@ const qe = ({ data: t, handleChange: l, path: r, label: u, required: m, errors:
155
219
  {
156
220
  type: "date",
157
221
  value: t || "",
158
- onChange: (d) => l(r, d.target.value),
159
- disabled: !n,
160
- color: b ? void 0 : "red",
222
+ onChange: (g) => n(r, g.target.value),
223
+ disabled: !h,
224
+ color: s ? void 0 : "red",
161
225
  id: r
162
226
  }
163
227
  ),
164
- !b && i !== "is a required property" && /* @__PURE__ */ e(c, { color: "red", size: "1", children: i }),
165
- a.description && /* @__PURE__ */ e(c, { size: "1", color: "gray", children: a.description })
228
+ !s && i !== "is a required property" && /* @__PURE__ */ e(c, { color: "red", size: "1", children: i }),
229
+ l.description && /* @__PURE__ */ e(c, { size: "1", color: "gray", children: l.description })
166
230
  ] }) });
167
- }, lr = z(
168
- 2,
169
- Fe
170
- ), ir = I(nr), cr = ({ uischema: t, schema: l, path: r, renderers: u, cells: m, enabled: i }) => {
171
- const n = t.elements;
172
- return /* @__PURE__ */ e(v, { direction: "column", gap: "4", children: n.map((b, d) => /* @__PURE__ */ e(
173
- B,
231
+ }, rr = z(2, ze), tr = U(er), nr = ({ uischema: t, schema: n, path: r, renderers: f, cells: m, enabled: i }) => {
232
+ const h = t.elements;
233
+ return /* @__PURE__ */ e(C, { direction: "column", gap: "4", children: h.map((s, g) => /* @__PURE__ */ e(
234
+ E,
174
235
  {
175
- uischema: b,
176
- schema: l,
236
+ uischema: s,
237
+ schema: n,
177
238
  path: r,
178
- renderers: u,
239
+ renderers: f,
179
240
  cells: m,
180
241
  enabled: i
181
242
  },
182
- `${r}-${d}`
243
+ `${r}-${g}`
183
244
  )) });
184
- }, sr = z(1, E("VerticalLayout")), ar = ({ uischema: t, schema: l, path: r, renderers: u, cells: m, enabled: i }) => {
185
- const n = t.elements;
186
- return /* @__PURE__ */ e(v, { direction: "row", gap: "4", children: n.map((b, d) => /* @__PURE__ */ e(w, { style: { flex: 1 }, children: /* @__PURE__ */ e(
187
- B,
245
+ }, or = z(1, j("VerticalLayout")), lr = ({ uischema: t, schema: n, path: r, renderers: f, cells: m, enabled: i }) => {
246
+ const h = t.elements;
247
+ return /* @__PURE__ */ e(C, { direction: "row", gap: "4", children: h.map((s, g) => /* @__PURE__ */ e(w, { style: { flex: 1 }, children: /* @__PURE__ */ e(
248
+ E,
188
249
  {
189
- uischema: b,
190
- schema: l,
250
+ uischema: s,
251
+ schema: n,
191
252
  path: r,
192
- renderers: u,
253
+ renderers: f,
193
254
  cells: m,
194
255
  enabled: i
195
256
  }
196
- ) }, `${r}-${d}`)) });
197
- }, dr = z(1, E("HorizontalLayout")), ur = ({ uischema: t, schema: l, path: r, renderers: u, cells: m, enabled: i }) => {
198
- const a = t, n = a.elements;
199
- return /* @__PURE__ */ s(Y, { mb: "4", children: [
200
- a.label && /* @__PURE__ */ e(ue, { size: "4", mb: "4", children: a.label }),
201
- /* @__PURE__ */ e(v, { direction: "column", gap: "4", children: n.map((b, d) => /* @__PURE__ */ e(
202
- B,
257
+ ) }, `${r}-${g}`)) });
258
+ }, ir = z(1, j("HorizontalLayout")), cr = ({ uischema: t, schema: n, path: r, renderers: f, cells: m, enabled: i }) => {
259
+ const l = t, h = l.elements;
260
+ return /* @__PURE__ */ p(w, { mb: "6", children: [
261
+ l.label && /* @__PURE__ */ e(le, { size: "3", mb: "3", className: "text-gray-500 uppercase tracking-wide font-semibold", children: l.label }),
262
+ /* @__PURE__ */ e(C, { direction: "column", gap: "4", children: h.map((s, g) => /* @__PURE__ */ e(
263
+ E,
203
264
  {
204
- uischema: b,
205
- schema: l,
265
+ uischema: s,
266
+ schema: n,
206
267
  path: r,
207
- renderers: u,
268
+ renderers: f,
208
269
  cells: m,
209
270
  enabled: i
210
271
  },
211
- `${r}-${d}`
272
+ `${r}-${g}`
212
273
  )) })
213
274
  ] });
214
- }, hr = z(1, E("Group")), pr = ({ uischema: t, schema: l, path: r, renderers: u, cells: m, enabled: i }) => {
215
- var C;
216
- const n = t.elements.filter((h) => h.type === "Category"), [b, d] = L(((C = n[0]) == null ? void 0 : C.label) || "");
217
- if (!n.length) return null;
218
- const f = n.find((h) => h.label === b) ? b : n[0].label;
219
- return /* @__PURE__ */ s(M.Root, { value: f, onValueChange: d, children: [
220
- /* @__PURE__ */ e(M.List, { children: n.map((h, p) => /* @__PURE__ */ e(M.Trigger, { value: h.label, children: h.label }, `${r}-${p}`)) }),
221
- /* @__PURE__ */ e(w, { pt: "3", children: n.map((h, p) => /* @__PURE__ */ e(M.Content, { value: h.label, children: /* @__PURE__ */ e(v, { direction: "column", gap: "4", children: h.elements.map((S, D) => /* @__PURE__ */ e(
222
- B,
275
+ }, sr = z(1, j("Group")), ar = ({
276
+ uischema: t,
277
+ schema: n,
278
+ path: r,
279
+ renderers: f,
280
+ cells: m,
281
+ enabled: i
282
+ }) => {
283
+ var a;
284
+ const h = t.elements.filter((d) => d.type === "Category"), [s, g] = M(((a = h[0]) == null ? void 0 : a.label) || "");
285
+ if (!h.length) return null;
286
+ const y = h.find((d) => d.label === s) ? s : h[0].label;
287
+ return /* @__PURE__ */ p(G.Root, { value: y, onValueChange: g, children: [
288
+ /* @__PURE__ */ e(G.List, { children: h.map((d, u) => /* @__PURE__ */ e(G.Trigger, { value: d.label, children: d.label }, `${r}-${u}`)) }),
289
+ /* @__PURE__ */ e(w, { pt: "3", children: h.map((d, u) => /* @__PURE__ */ e(G.Content, { value: d.label, children: /* @__PURE__ */ e(C, { direction: "column", gap: "4", children: d.elements.map((k, x) => /* @__PURE__ */ e(
290
+ E,
223
291
  {
224
- uischema: S,
225
- schema: l,
292
+ uischema: k,
293
+ schema: n,
226
294
  path: r,
227
- renderers: u,
295
+ renderers: f,
228
296
  cells: m,
229
297
  enabled: i
230
298
  },
231
- `${r}-${p}-${D}`
232
- )) }) }, `${r}-${p}`)) })
299
+ `${r}-${u}-${x}`
300
+ )) }) }, `${r}-${u}`)) })
233
301
  ] });
234
- }, mr = z(1, E("Categorization")), br = 50, pe = 60, $ = /* @__PURE__ */ new Map();
235
- function me() {
236
- const t = Date.now() / 1e3;
237
- for (const [l, r] of $.entries())
238
- r.expiresAt <= t + pe && $.delete(l);
302
+ }, dr = z(1, j("Categorization"));
303
+ function ur(t) {
304
+ return t ? Array.isArray(t) ? t : [t] : [];
239
305
  }
240
- function gr(t, l, r) {
241
- if (me(), $.size >= br) {
242
- const u = $.keys().next().value;
243
- u != null && $.delete(u);
244
- }
245
- $.set(t, { url: l, expiresAt: r });
306
+ function q(t) {
307
+ return t >= 1024 * 1024 ? `${(t / (1024 * 1024)).toFixed(0)} MB` : t >= 1024 ? `${(t / 1024).toFixed(0)} KB` : `${t} B`;
246
308
  }
247
- function W(t) {
248
- return !t.startsWith("data:");
309
+ function K(t) {
310
+ return t.split(",").map((n) => {
311
+ if (n = n.trim(), n.endsWith("/*"))
312
+ return n.split("/")[0].toUpperCase() + "S";
313
+ if (n.startsWith("."))
314
+ return n.slice(1).toUpperCase();
315
+ const r = n.split("/")[1];
316
+ return r ? r.toUpperCase() : n;
317
+ }).join(", ");
249
318
  }
250
- const fr = ({ data: t, handleChange: l, path: r, label: u, required: m, uischema: i, enabled: a }) => {
251
- const n = _e(), [b, d] = L(!1), [f, C] = L(null), [h, p] = L(null), [S, D] = L(null), [q, k] = L(!1), [A, x] = L(null), [O, V] = L(!1), [T, ee] = L(null), R = Le(null);
252
- X(() => () => {
253
- T && URL.revokeObjectURL(T);
254
- }, [T]);
255
- const re = (i == null ? void 0 : i.options) || {}, P = re.maxSize || 5 * 1024 * 1024, N = re.accept || "image/*,application/pdf", U = a !== !1, te = se(async (o, g) => {
256
- me();
257
- const F = $.get(o);
258
- if (F && F.expiresAt > Date.now() / 1e3 + pe) {
259
- D(F.url);
260
- return;
261
- }
262
- if (!(n != null && n.getDownloadUrl)) {
263
- x("Download not configured for this application.");
264
- return;
265
- }
266
- k(!0), x(null);
267
- try {
268
- const y = await n.getDownloadUrl(o);
269
- if (g != null && g.aborted) return;
270
- D(y.url), gr(o, y.url, y.expiresAt);
271
- } catch {
272
- if (g != null && g.aborted) return;
273
- x("Unable to reach the server.");
274
- } finally {
275
- g != null && g.aborted || k(!1);
276
- }
277
- }, [n]);
278
- X(() => {
279
- if (t && W(t) && !T) {
280
- const o = new AbortController();
281
- return te(t, o.signal), () => o.abort();
282
- }
283
- T || (D(null), x(null));
284
- }, [t, te, T]);
285
- const be = () => h || (t ? "Uploaded File" : null), [ge, G] = L(null);
286
- X(() => {
287
- var o;
288
- if (t && !W(t))
319
+ const pr = ({ data: t, handleChange: n, path: r, label: f, required: m, uischema: i, schema: l, enabled: h }) => {
320
+ const s = Ee(), g = (l == null ? void 0 : l["x-file"]) ?? {}, y = (i == null ? void 0 : i.options) ?? {}, a = g.maxFiles ?? y.maxFiles ?? 1, d = g.maxSize ?? y.maxSize ?? 5 * 1024 * 1024, u = g.accept ?? y.accept ?? "image/*,application/pdf", k = a > 1, x = h !== !1, [H, L] = M(!1), [$, T] = M(null), [I, N] = M({}), B = ee(/* @__PURE__ */ new Set()), O = ee(null), R = ur(t), P = R.length >= a;
321
+ fe(() => () => {
322
+ B.current.forEach((o) => URL.revokeObjectURL(o)), B.current.clear();
323
+ }, []);
324
+ const X = be(
325
+ async (o) => {
326
+ if (T(null), R.length >= a) {
327
+ T(`Maximum ${a} file${a > 1 ? "s" : ""} allowed.`);
328
+ return;
329
+ }
330
+ if (o.size > d) {
331
+ T(`File exceeds the ${q(d)} limit.`);
332
+ return;
333
+ }
334
+ if (!u.split(",").map((b) => b.trim()).some((b) => b === "*" || b === "*/*" ? !0 : b.endsWith("/*") ? o.type.startsWith(b.slice(0, -1)) : b.startsWith(".") ? o.name.toLowerCase().endsWith(b.toLowerCase()) : o.type === b)) {
335
+ T(`Invalid type. Accepted: ${K(u)}`);
336
+ return;
337
+ }
338
+ if (!(s != null && s.onUpload)) {
339
+ T("Upload service not configured.");
340
+ return;
341
+ }
289
342
  try {
290
- const g = t.split(","), F = ((o = g[0].match(/:(.*?);/)) == null ? void 0 : o[1]) || "application/octet-stream", y = g[1], K = atob(y), le = new Array(K.length);
291
- for (let j = 0; j < K.length; j++)
292
- le[j] = K.charCodeAt(j);
293
- const ve = new Uint8Array(le), we = new Blob([ve], { type: F }), ie = URL.createObjectURL(we);
294
- return G(ie), () => URL.revokeObjectURL(ie);
295
- } catch (g) {
296
- console.error("Failed to create blob URL:", g), G(null);
343
+ const b = await s.onUpload(o), F = URL.createObjectURL(o);
344
+ B.current.add(F);
345
+ const A = { key: b.key, name: b.name ?? o.name, blobUrl: F };
346
+ N((D) => ({ ...D, [b.key]: A }));
347
+ const V = [...R, b.key];
348
+ n(r, k ? V : V[0]);
349
+ } catch {
350
+ T("Upload failed. Please try again."), O.current && (O.current.value = "");
297
351
  }
298
- else
299
- G(null);
300
- }, [t]);
301
- const oe = T ?? (t && W(t) ? S : ge), ne = se(async (o) => {
302
- if (o.size > P) {
303
- const y = (P / 1048576).toFixed(0);
304
- C(`File size exceeds ${y}MB limit.`);
305
- return;
306
- }
307
- const F = N.split(",").map((y) => y.trim()).some((y) => y.endsWith("/*") ? o.type.startsWith(y.slice(0, -1)) : y.startsWith(".") ? o.name.toLowerCase().endsWith(y.toLowerCase()) : o.type === y);
308
- if (N !== "*" && !F && !N.includes("*/*")) {
309
- C(`Invalid file type. Accepted types: ${N}`);
352
+ },
353
+ [R, a, d, u, s, r, n, k]
354
+ ), J = (o) => {
355
+ o.preventDefault(), o.stopPropagation(), !(!x || P) && L(o.type === "dragenter" || o.type === "dragover");
356
+ }, se = (o) => {
357
+ var v;
358
+ o.preventDefault(), o.stopPropagation(), L(!1), !(!x || P) && (v = o.dataTransfer.files) != null && v[0] && X(o.dataTransfer.files[0]);
359
+ }, ae = (o) => {
360
+ var v;
361
+ (v = o.target.files) != null && v[0] && (X(o.target.files[0]), o.target.value = "");
362
+ }, de = (o) => {
363
+ if (!x) return;
364
+ N((S) => {
365
+ var A;
366
+ const b = { ...S }, F = (A = b[o]) == null ? void 0 : A.blobUrl;
367
+ return F && (URL.revokeObjectURL(F), B.current.delete(F)), delete b[o], b;
368
+ });
369
+ const v = R.filter((S) => S !== o);
370
+ n(r, k ? v.length > 0 ? v : null : v[0] ?? null);
371
+ }, ue = async (o, v) => {
372
+ var F, A, V;
373
+ o.preventDefault();
374
+ const S = (F = I[v]) == null ? void 0 : F.blobUrl;
375
+ if (S) {
376
+ (A = window.open(S, "_blank", "noopener,noreferrer")) == null || A.focus();
310
377
  return;
311
378
  }
312
- if (n != null && n.onUpload) {
379
+ const b = window.open("", "_blank");
380
+ if (b)
313
381
  try {
314
- const y = await n.onUpload(o);
315
- ee(URL.createObjectURL(o)), l(r, y.key), p(y.name ?? o.name), C(null);
382
+ const D = await ((V = s == null ? void 0 : s.getDownloadUrl) == null ? void 0 : V.call(s, v));
383
+ D != null && D.url ? b.location.href = D.url : b.close();
316
384
  } catch {
317
- C("Upload failed."), R.current && (R.current.value = "");
385
+ b.close();
318
386
  }
319
- return;
320
- }
321
- C("Upload service not configured for this application.");
322
- }, [N, n, P, r, l]), J = (o) => {
323
- o.preventDefault(), o.stopPropagation(), !(!U || t) && (o.type === "dragenter" || o.type === "dragover" ? d(!0) : o.type === "dragleave" && d(!1));
324
- }, fe = (o) => {
325
- o.preventDefault(), o.stopPropagation(), d(!1), !(!U || t) && o.dataTransfer.files && o.dataTransfer.files[0] && ne(o.dataTransfer.files[0]);
326
- }, ye = (o) => {
327
- o.target.files && o.target.files[0] && ne(o.target.files[0]);
328
- }, Ce = () => {
329
- U && (T && (URL.revokeObjectURL(T), ee(null)), l(r, null), p(null), C(null), R.current && (R.current.value = ""));
330
387
  };
331
- return /* @__PURE__ */ s(w, { mb: "4", children: [
332
- /* @__PURE__ */ s(c, { as: "label", size: "2", weight: "bold", mb: "1", className: "block", children: [
333
- u,
334
- " ",
335
- m && "*"
388
+ if (!x && R.length === 0) return null;
389
+ const pe = a - R.length, he = x && !P;
390
+ return /* @__PURE__ */ p(w, { mb: "4", children: [
391
+ /* @__PURE__ */ p(C, { align: "center", justify: "between", mb: "2", children: [
392
+ /* @__PURE__ */ p(c, { as: "label", size: "2", weight: "bold", children: [
393
+ f,
394
+ m && /* @__PURE__ */ e(c, { color: "red", children: " *" })
395
+ ] }),
396
+ /* @__PURE__ */ e(c, { size: "1", color: "gray", children: k ? `Up to ${a} files · ${q(d)} each · ${K(u)}` : `${q(d)} · ${K(u)}` })
336
397
  ] }),
337
- t ? /* @__PURE__ */ e(Y, { size: "2", variant: "surface", className: "relative group", children: /* @__PURE__ */ s(v, { align: "center", gap: "3", children: [
338
- /* @__PURE__ */ e(w, { className: "bg-blue-100 p-2 rounded text-blue-600", children: /* @__PURE__ */ e(Oe, { width: "20", height: "20" }) }),
339
- /* @__PURE__ */ e(w, { style: { flex: 1, overflow: "hidden" }, children: /* @__PURE__ */ e(c, { size: "2", weight: "bold", className: "block truncate", children: be() }) }),
340
- /* @__PURE__ */ s(v, { align: "center", gap: "3", children: [
341
- q ? /* @__PURE__ */ e(c, { size: "1", color: "gray", children: "Loading..." }) : A ? /* @__PURE__ */ e(c, { size: "1", color: "red", children: "Error" }) : O ? /* @__PURE__ */ e(c, { size: "1", color: "gray", children: "Opening…" }) : !T && (n != null && n.openFileInNewTab) && t && W(t) ? /* @__PURE__ */ e(
342
- _,
398
+ R.map((o) => {
399
+ var v;
400
+ return /* @__PURE__ */ e(ie, { size: "2", variant: "surface", mb: "2", children: /* @__PURE__ */ p(C, { align: "center", gap: "3", children: [
401
+ /* @__PURE__ */ e(
402
+ w,
343
403
  {
344
- variant: "soft",
345
- color: "blue",
346
- size: "1",
347
- onClick: (o) => {
348
- o.stopPropagation();
349
- const g = n.openFileInNewTab;
350
- g && (V(!0), g(t).finally(() => V(!1)));
404
+ style: {
405
+ background: "var(--blue-3)",
406
+ padding: 8,
407
+ borderRadius: 6,
408
+ color: "var(--blue-9)",
409
+ flexShrink: 0
351
410
  },
352
- children: "View"
411
+ children: /* @__PURE__ */ e(Ae, { width: "20", height: "20" })
353
412
  }
354
- ) : /* @__PURE__ */ e(_, { variant: "soft", color: "blue", size: "1", asChild: !0, children: /* @__PURE__ */ e(
355
- "a",
413
+ ),
414
+ /* @__PURE__ */ e(w, { style: { flex: 1, overflow: "hidden" }, children: /* @__PURE__ */ e(
415
+ c,
356
416
  {
357
- href: oe || "#",
358
- target: "_blank",
359
- rel: "noopener noreferrer",
360
- onClick: (o) => {
361
- o.stopPropagation(), oe || o.preventDefault();
417
+ size: "2",
418
+ weight: "bold",
419
+ style: {
420
+ display: "block",
421
+ overflow: "hidden",
422
+ textOverflow: "ellipsis",
423
+ whiteSpace: "nowrap"
362
424
  },
363
- children: "View"
425
+ children: ((v = I[o]) == null ? void 0 : v.name) ?? "Uploaded File"
364
426
  }
365
427
  ) }),
366
- /* @__PURE__ */ s(v, { align: "center", gap: "2", children: [
367
- /* @__PURE__ */ e(Ve, { className: "text-green-600 w-5 h-5" }),
368
- U && /* @__PURE__ */ e(
369
- Be,
370
- {
371
- variant: "ghost",
372
- color: "gray",
373
- onClick: Ce,
374
- className: "hover:text-red-600 transition-colors",
375
- children: /* @__PURE__ */ e(Pe, {})
376
- }
377
- )
428
+ /* @__PURE__ */ p(C, { align: "center", gap: "2", style: { flexShrink: 0 }, children: [
429
+ /* @__PURE__ */ e(_, { variant: "soft", color: "blue", size: "1", onClick: (S) => ue(S, o), children: "View" }),
430
+ /* @__PURE__ */ e(Ue, { style: { color: "var(--green-9)", width: 18, height: 18 } }),
431
+ x && /* @__PURE__ */ e(Le, { variant: "ghost", color: "gray", onClick: () => de(o), children: /* @__PURE__ */ e(De, {}) })
378
432
  ] })
379
- ] })
380
- ] }) }) : /* @__PURE__ */ s(
433
+ ] }) }, o);
434
+ }),
435
+ he && /* @__PURE__ */ p(
381
436
  "div",
382
437
  {
383
- className: `
384
- border-2 border-dashed rounded-lg p-6 text-center transition-all duration-200 ease-in-out
385
- ${b ? "border-blue-500 bg-blue-50" : "border-gray-300 hover:border-blue-400 hover:bg-gray-50"}
386
- ${f ? "border-red-300 bg-red-50" : ""}
387
- ${U ? "cursor-pointer" : "opacity-60 cursor-not-allowed pointer-events-none"}
388
- `,
389
- onDragEnter: J,
390
- onDragLeave: J,
391
- onDragOver: J,
392
- onDrop: fe,
438
+ role: "button",
439
+ tabIndex: 0,
393
440
  onClick: () => {
394
441
  var o;
395
- return U && ((o = R.current) == null ? void 0 : o.click());
442
+ return (o = O.current) == null ? void 0 : o.click();
396
443
  },
397
444
  onKeyDown: (o) => {
398
- var g;
399
- U && (o.key === "Enter" || o.key === " ") && (o.preventDefault(), (g = R.current) == null || g.click());
445
+ var v;
446
+ (o.key === "Enter" || o.key === " ") && (o.preventDefault(), (v = O.current) == null || v.click());
400
447
  },
401
- role: "button",
402
- tabIndex: U ? 0 : -1,
448
+ onDragEnter: J,
449
+ onDragLeave: J,
450
+ onDragOver: J,
451
+ onDrop: se,
452
+ style: { cursor: "pointer" },
453
+ className: [
454
+ "border-2 border-dashed rounded-lg p-6 text-center",
455
+ "transition-all duration-200 ease-in-out",
456
+ H ? "border-blue-500 bg-blue-50" : $ ? "border-red-300 bg-red-50" : "border-gray-300 hover:border-blue-400 hover:bg-gray-50"
457
+ ].join(" "),
403
458
  children: [
404
- /* @__PURE__ */ e(
405
- "input",
406
- {
407
- ref: R,
408
- type: "file",
409
- style: { display: "none" },
410
- accept: N,
411
- onChange: ye,
412
- disabled: !U
413
- }
414
- ),
415
- /* @__PURE__ */ e(v, { direction: "column", align: "center", gap: "2", children: f ? /* @__PURE__ */ s(ce, { children: [
416
- /* @__PURE__ */ e(je, { className: "w-8 h-8 text-red-500" }),
417
- /* @__PURE__ */ e(c, { size: "2", color: "red", weight: "medium", children: f }),
459
+ /* @__PURE__ */ e("input", { ref: O, type: "file", style: { display: "none" }, accept: u, onChange: ae }),
460
+ /* @__PURE__ */ e(C, { direction: "column", align: "center", gap: "2", children: $ ? /* @__PURE__ */ p(Y, { children: [
461
+ /* @__PURE__ */ e(Ie, { style: { width: 32, height: 32, color: "var(--red-9)" } }),
462
+ /* @__PURE__ */ e(c, { size: "2", color: "red", weight: "medium", children: $ }),
418
463
  /* @__PURE__ */ e(c, { size: "1", color: "gray", children: "Click to try again" })
419
- ] }) : /* @__PURE__ */ s(ce, { children: [
420
- /* @__PURE__ */ e(He, { className: "w-8 h-8 text-gray-400" }),
421
- /* @__PURE__ */ e(c, { size: "2", weight: "medium", children: "Click to upload or drag and drop" }),
422
- /* @__PURE__ */ s(c, { size: "1", color: "gray", children: [
423
- "Max ",
424
- Math.round(P / (1024 * 1024)),
425
- "MB"
464
+ ] }) : /* @__PURE__ */ p(Y, { children: [
465
+ /* @__PURE__ */ e(Oe, { style: { width: 32, height: 32, color: "var(--gray-8)" } }),
466
+ /* @__PURE__ */ e(c, { size: "2", weight: "medium", children: R.length > 0 ? `Add another file (${pe} remaining)` : "Click to upload or drag and drop" }),
467
+ /* @__PURE__ */ p(c, { size: "1", color: "gray", children: [
468
+ q(d),
469
+ " max · ",
470
+ K(u)
426
471
  ] })
427
472
  ] }) })
428
473
  ]
429
474
  }
430
- )
475
+ ),
476
+ x && P && k && /* @__PURE__ */ p(c, { size: "1", color: "gray", mt: "1", style: { display: "block", textAlign: "center" }, children: [
477
+ "Maximum ",
478
+ a,
479
+ " files uploaded. Remove one to replace it."
480
+ ] })
431
481
  ] });
432
- }, yr = I(fr), Cr = z(
433
- 3,
434
- // Rank
435
- Z(ae("data-url"), ae("file"))
436
- ), vr = ({
482
+ }, hr = U(pr), gr = z(
483
+ 10,
484
+ // high rank to beat default array renderer
485
+ xe(
486
+ // Match both single-file (type: string) and multi-file (type: array)
487
+ $e((t) => {
488
+ if (t.type === "string" && t.format === "file") return !0;
489
+ if (t.type === "array") {
490
+ const n = t.items;
491
+ return (n == null ? void 0 : n.type) === "string" && (n == null ? void 0 : n.format) === "file";
492
+ }
493
+ return !1;
494
+ })
495
+ )
496
+ ), mr = ({
437
497
  data: t,
438
- path: l,
498
+ path: n,
439
499
  schema: r,
440
- uischema: u,
500
+ uischema: f,
441
501
  enabled: m,
442
502
  visible: i,
443
- addItem: a,
444
- removeItems: n,
445
- rootSchema: b,
446
- arraySchema: d
503
+ addItem: l,
504
+ removeItems: h,
505
+ rootSchema: s,
506
+ arraySchema: g
447
507
  }) => {
448
- const f = d ? r : r.items, C = d || r;
449
- if (i === !1 || !f || typeof f != "object" || Array.isArray(f))
508
+ const y = g ? r : r.items, a = g || r;
509
+ if (i === !1 || !y || typeof y != "object" || Array.isArray(y))
450
510
  return null;
451
- const h = f, p = Array.isArray(t) ? t : [], S = C.title || "Array Items", D = () => {
452
- const k = $e(h, b);
453
- a && a(l, k)();
454
- }, q = (k) => {
455
- if (n) {
456
- const A = n(l, [k]);
457
- A && A();
511
+ const d = y, u = Array.isArray(t) ? t : [], k = a.title || "Array Items", x = () => {
512
+ const L = ke(d, s);
513
+ l && l(n, L)();
514
+ }, H = (L) => {
515
+ if (h) {
516
+ const $ = h(n, [L]);
517
+ $ && $();
458
518
  }
459
519
  };
460
- return /* @__PURE__ */ e(w, { mb: "6", children: /* @__PURE__ */ s(v, { direction: "column", gap: "4", children: [
461
- /* @__PURE__ */ e(c, { as: "div", size: "4", weight: "bold", children: S }),
462
- p.length === 0 && /* @__PURE__ */ e(w, { py: "4", px: "4", style: { backgroundColor: "var(--gray-3)", borderRadius: "var(--radius-3)" }, children: /* @__PURE__ */ e(c, { size: "2", color: "gray", children: "No items have been added yet." }) }),
463
- p.map((k, A) => {
464
- var O;
465
- const x = `${l}.${A}`;
466
- return /* @__PURE__ */ e(Y, { size: "3", variant: "surface", children: /* @__PURE__ */ s(v, { direction: "column", gap: "4", children: [
467
- /* @__PURE__ */ s(v, { justify: "between", align: "center", children: [
468
- /* @__PURE__ */ s(c, { size: "3", weight: "bold", children: [
520
+ return /* @__PURE__ */ e(w, { mb: "6", children: /* @__PURE__ */ p(C, { direction: "column", gap: "4", children: [
521
+ /* @__PURE__ */ e(c, { as: "div", size: "4", weight: "bold", children: k }),
522
+ u.length === 0 && /* @__PURE__ */ e(w, { py: "4", px: "4", style: { backgroundColor: "var(--gray-3)", borderRadius: "var(--radius-3)" }, children: /* @__PURE__ */ e(c, { size: "2", color: "gray", children: "No items have been added yet." }) }),
523
+ u.map((L, $) => {
524
+ var I;
525
+ const T = `${n}.${$}`;
526
+ return /* @__PURE__ */ e(ie, { size: "3", variant: "surface", children: /* @__PURE__ */ p(C, { direction: "column", gap: "4", children: [
527
+ /* @__PURE__ */ p(C, { justify: "between", align: "center", children: [
528
+ /* @__PURE__ */ p(c, { size: "3", weight: "bold", children: [
469
529
  "Item ",
470
- A + 1
530
+ $ + 1
471
531
  ] }),
472
- m && /* @__PURE__ */ s(
532
+ m && /* @__PURE__ */ p(
473
533
  _,
474
534
  {
475
535
  type: "button",
476
536
  color: "red",
477
537
  variant: "soft",
478
- onClick: () => q(A),
538
+ onClick: () => H($),
479
539
  title: "Remove item",
480
540
  children: [
481
- /* @__PURE__ */ e(Me, {}),
541
+ /* @__PURE__ */ e(Ve, {}),
482
542
  "Remove"
483
543
  ]
484
544
  }
485
545
  )
486
546
  ] }),
487
547
  /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(
488
- B,
548
+ E,
489
549
  {
490
- schema: h,
491
- uischema: ((O = u.options) == null ? void 0 : O.detail) || (h.type === "object" || h.properties ? {
550
+ schema: d,
551
+ uischema: ((I = f.options) == null ? void 0 : I.detail) || (d.type === "object" || d.properties ? {
492
552
  type: "VerticalLayout",
493
- elements: Object.keys(
494
- h.properties || {}
495
- ).map((V) => ({
553
+ elements: Object.keys(d.properties || {}).map((N) => ({
496
554
  type: "Control",
497
- scope: `#/properties/${V}`
555
+ scope: `#/properties/${N}`
498
556
  }))
499
557
  } : {
500
558
  type: "Control",
501
559
  scope: "#"
502
560
  }),
503
- path: x,
561
+ path: T,
504
562
  enabled: m,
505
563
  renderers: void 0,
506
564
  cells: void 0
507
565
  }
508
566
  ) })
509
- ] }) }, x);
567
+ ] }) }, T);
510
568
  }),
511
- m && /* @__PURE__ */ e(w, { mt: "2", children: /* @__PURE__ */ s(
512
- _,
513
- {
514
- type: "button",
515
- variant: "surface",
516
- onClick: D,
517
- children: [
518
- /* @__PURE__ */ e(We, {}),
519
- "Add Item"
520
- ]
521
- }
522
- ) })
569
+ m && /* @__PURE__ */ e(w, { mt: "2", children: /* @__PURE__ */ p(_, { type: "button", variant: "surface", onClick: x, children: [
570
+ /* @__PURE__ */ e(je, {}),
571
+ "Add Item"
572
+ ] }) })
523
573
  ] }) });
524
- }, de = Se(vr), wr = z(
525
- 3,
526
- Ne
527
- ), zr = ({ uischema: t, visible: l }) => {
574
+ }, te = Se(mr), fr = z(3, Te), br = ({ uischema: t, visible: n }) => {
528
575
  const r = t;
529
- return l === !1 ? null : /* @__PURE__ */ e(w, { mb: "4", children: /* @__PURE__ */ e(ue, { size: "4", children: r.text }) });
530
- }, Tr = z(1, E("Label")), Lr = z(
531
- 3,
532
- Ie
533
- ), Nr = [
534
- { tester: Ge, renderer: Je },
535
- { tester: Xe, renderer: Ze },
536
- { tester: Ye, renderer: er },
537
- { tester: tr, renderer: or },
538
- { tester: lr, renderer: ir },
576
+ return n === !1 ? null : /* @__PURE__ */ e(w, { mb: "4", children: /* @__PURE__ */ e(le, { size: "4", children: r.text }) });
577
+ }, yr = z(1, j("Label")), vr = z(3, Re), Rr = [
578
+ { tester: Be, renderer: Pe },
579
+ { tester: Ge, renderer: qe },
580
+ { tester: Me, renderer: He },
581
+ { tester: _e, renderer: Ze },
582
+ { tester: Xe, renderer: Ye },
583
+ { tester: rr, renderer: tr },
584
+ { tester: or, renderer: nr },
585
+ { tester: ir, renderer: lr },
539
586
  { tester: sr, renderer: cr },
540
587
  { tester: dr, renderer: ar },
541
- { tester: hr, renderer: ur },
542
- { tester: mr, renderer: pr },
543
- { tester: Cr, renderer: yr },
544
- { tester: wr, renderer: de },
545
- { tester: Lr, renderer: de },
546
- { tester: Tr, renderer: zr }
588
+ { tester: gr, renderer: hr },
589
+ { tester: fr, renderer: te },
590
+ { tester: vr, renderer: te },
591
+ { tester: yr, renderer: br }
547
592
  ];
548
593
  export {
549
- de as ArrayControl,
550
- wr as ArrayControlTester,
551
- Qe as BooleanControl,
552
- Ye as BooleanControlTester,
553
- pr as CategorizationLayoutRenderer,
554
- mr as CategorizationLayoutTester,
555
- nr as DateControl,
556
- lr as DateControlTester,
557
- yr as FileControl,
558
- Cr as FileControlTester,
559
- ur as GroupLayoutRenderer,
560
- hr as GroupLayoutTester,
561
- ar as HorizontalLayoutRenderer,
562
- dr as HorizontalLayoutTester,
563
- zr as LabelRenderer,
564
- Tr as LabelTester,
565
- Ke as NumberControl,
566
- Xe as NumberControlTester,
567
- rr as SelectControl,
568
- tr as SelectControlTester,
569
- qe as TextControl,
570
- Ge as TextControlTester,
571
- $r as UploadProvider,
572
- cr as VerticalLayoutRenderer,
573
- sr as VerticalLayoutTester,
574
- Nr as radixRenderers,
575
- _e as useUpload
594
+ te as ArrayControl,
595
+ fr as ArrayControlTester,
596
+ Ke as BooleanControl,
597
+ Me as BooleanControlTester,
598
+ ar as CategorizationLayoutRenderer,
599
+ dr as CategorizationLayoutTester,
600
+ er as DateControl,
601
+ rr as DateControlTester,
602
+ hr as FileControl,
603
+ gr as FileControlTester,
604
+ cr as GroupLayoutRenderer,
605
+ sr as GroupLayoutTester,
606
+ lr as HorizontalLayoutRenderer,
607
+ ir as HorizontalLayoutTester,
608
+ br as LabelRenderer,
609
+ yr as LabelTester,
610
+ We as NumberControl,
611
+ Ge as NumberControlTester,
612
+ Je as RadioControl,
613
+ _e as RadioControlTester,
614
+ Qe as SelectControl,
615
+ Xe as SelectControlTester,
616
+ Ne as TextControl,
617
+ Be as TextControlTester,
618
+ Tr as UploadProvider,
619
+ nr as VerticalLayoutRenderer,
620
+ or as VerticalLayoutTester,
621
+ Rr as radixRenderers,
622
+ Ee as useUpload
576
623
  };