@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.
- package/dist/index.d.ts +12 -11
- package/dist/jsonforms-renderers.css +1 -1
- package/dist/renderers.cjs.js +1 -6
- package/dist/renderers.es.js +460 -413
- package/package.json +46 -40
package/dist/renderers.es.js
CHANGED
|
@@ -1,28 +1,37 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { rankWith as z, isStringControl as
|
|
4
|
-
import { withJsonFormsControlProps as
|
|
5
|
-
import { Box as w, Flex as
|
|
6
|
-
import { FileTextIcon as
|
|
7
|
-
const
|
|
8
|
-
function
|
|
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:
|
|
11
|
-
getDownloadUrl: r
|
|
12
|
-
openFileInNewTab: u
|
|
10
|
+
onUpload: n,
|
|
11
|
+
getDownloadUrl: r
|
|
13
12
|
}) {
|
|
14
|
-
const
|
|
15
|
-
return /* @__PURE__ */ e(
|
|
13
|
+
const f = { onUpload: n, getDownloadUrl: r };
|
|
14
|
+
return /* @__PURE__ */ e(ce.Provider, { value: f, children: t });
|
|
16
15
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
16
|
+
function Ee() {
|
|
17
|
+
return me(ce);
|
|
19
18
|
}
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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: (
|
|
34
|
-
disabled: !
|
|
35
|
-
placeholder: (
|
|
36
|
-
color:
|
|
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
|
-
!
|
|
41
|
-
|
|
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
|
-
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
|
54
|
-
isNaN(
|
|
69
|
+
const u = Number(d);
|
|
70
|
+
isNaN(u) || n(r, u);
|
|
55
71
|
};
|
|
56
|
-
return /* @__PURE__ */ e(w, { mb: "4", children: /* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
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: (
|
|
68
|
-
disabled: !
|
|
69
|
-
placeholder: (
|
|
70
|
-
color:
|
|
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
|
-
!
|
|
75
|
-
|
|
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
|
-
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
|
|
107
|
+
Fe,
|
|
86
108
|
{
|
|
87
109
|
checked: !!t,
|
|
88
|
-
onCheckedChange: (
|
|
89
|
-
disabled: !
|
|
110
|
+
onCheckedChange: (g) => n(r, g === !0),
|
|
111
|
+
disabled: !h,
|
|
90
112
|
id: r
|
|
91
113
|
}
|
|
92
114
|
),
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
115
|
+
/* @__PURE__ */ p(c, { as: "label", size: "2", htmlFor: r, children: [
|
|
116
|
+
f,
|
|
95
117
|
" ",
|
|
96
118
|
m && "*"
|
|
97
119
|
] })
|
|
98
120
|
] }),
|
|
99
|
-
!
|
|
100
|
-
|
|
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
|
-
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
|
114
|
-
return /* @__PURE__ */ e(w, { mb: "4", children: /* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
|
|
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__ */
|
|
121
|
-
|
|
138
|
+
/* @__PURE__ */ e(
|
|
139
|
+
re.Root,
|
|
122
140
|
{
|
|
123
|
-
value:
|
|
124
|
-
onValueChange: (
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
-
!
|
|
140
|
-
|
|
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
|
-
},
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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: (
|
|
159
|
-
disabled: !
|
|
160
|
-
color:
|
|
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
|
-
!
|
|
165
|
-
|
|
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
|
-
},
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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:
|
|
176
|
-
schema:
|
|
236
|
+
uischema: s,
|
|
237
|
+
schema: n,
|
|
177
238
|
path: r,
|
|
178
|
-
renderers:
|
|
239
|
+
renderers: f,
|
|
179
240
|
cells: m,
|
|
180
241
|
enabled: i
|
|
181
242
|
},
|
|
182
|
-
`${r}-${
|
|
243
|
+
`${r}-${g}`
|
|
183
244
|
)) });
|
|
184
|
-
},
|
|
185
|
-
const
|
|
186
|
-
return /* @__PURE__ */ e(
|
|
187
|
-
|
|
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:
|
|
190
|
-
schema:
|
|
250
|
+
uischema: s,
|
|
251
|
+
schema: n,
|
|
191
252
|
path: r,
|
|
192
|
-
renderers:
|
|
253
|
+
renderers: f,
|
|
193
254
|
cells: m,
|
|
194
255
|
enabled: i
|
|
195
256
|
}
|
|
196
|
-
) }, `${r}-${
|
|
197
|
-
},
|
|
198
|
-
const
|
|
199
|
-
return /* @__PURE__ */
|
|
200
|
-
|
|
201
|
-
/* @__PURE__ */ e(
|
|
202
|
-
|
|
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:
|
|
205
|
-
schema:
|
|
265
|
+
uischema: s,
|
|
266
|
+
schema: n,
|
|
206
267
|
path: r,
|
|
207
|
-
renderers:
|
|
268
|
+
renderers: f,
|
|
208
269
|
cells: m,
|
|
209
270
|
enabled: i
|
|
210
271
|
},
|
|
211
|
-
`${r}-${
|
|
272
|
+
`${r}-${g}`
|
|
212
273
|
)) })
|
|
213
274
|
] });
|
|
214
|
-
},
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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:
|
|
225
|
-
schema:
|
|
292
|
+
uischema: k,
|
|
293
|
+
schema: n,
|
|
226
294
|
path: r,
|
|
227
|
-
renderers:
|
|
295
|
+
renderers: f,
|
|
228
296
|
cells: m,
|
|
229
297
|
enabled: i
|
|
230
298
|
},
|
|
231
|
-
`${r}-${
|
|
232
|
-
)) }) }, `${r}-${
|
|
299
|
+
`${r}-${u}-${x}`
|
|
300
|
+
)) }) }, `${r}-${u}`)) })
|
|
233
301
|
] });
|
|
234
|
-
},
|
|
235
|
-
function
|
|
236
|
-
|
|
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
|
|
241
|
-
|
|
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
|
|
248
|
-
return
|
|
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
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}, [
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
if (
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
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
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
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
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
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
|
-
|
|
379
|
+
const b = window.open("", "_blank");
|
|
380
|
+
if (b)
|
|
313
381
|
try {
|
|
314
|
-
const
|
|
315
|
-
|
|
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
|
-
|
|
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
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
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
|
-
|
|
338
|
-
|
|
339
|
-
/* @__PURE__ */ e(
|
|
340
|
-
|
|
341
|
-
|
|
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
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
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: "
|
|
411
|
+
children: /* @__PURE__ */ e(Ae, { width: "20", height: "20" })
|
|
353
412
|
}
|
|
354
|
-
)
|
|
355
|
-
|
|
413
|
+
),
|
|
414
|
+
/* @__PURE__ */ e(w, { style: { flex: 1, overflow: "hidden" }, children: /* @__PURE__ */ e(
|
|
415
|
+
c,
|
|
356
416
|
{
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
417
|
+
size: "2",
|
|
418
|
+
weight: "bold",
|
|
419
|
+
style: {
|
|
420
|
+
display: "block",
|
|
421
|
+
overflow: "hidden",
|
|
422
|
+
textOverflow: "ellipsis",
|
|
423
|
+
whiteSpace: "nowrap"
|
|
362
424
|
},
|
|
363
|
-
children: "
|
|
425
|
+
children: ((v = I[o]) == null ? void 0 : v.name) ?? "Uploaded File"
|
|
364
426
|
}
|
|
365
427
|
) }),
|
|
366
|
-
/* @__PURE__ */
|
|
367
|
-
/* @__PURE__ */ e(
|
|
368
|
-
|
|
369
|
-
|
|
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
|
-
|
|
433
|
+
] }) }, o);
|
|
434
|
+
}),
|
|
435
|
+
he && /* @__PURE__ */ p(
|
|
381
436
|
"div",
|
|
382
437
|
{
|
|
383
|
-
|
|
384
|
-
|
|
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
|
|
442
|
+
return (o = O.current) == null ? void 0 : o.click();
|
|
396
443
|
},
|
|
397
444
|
onKeyDown: (o) => {
|
|
398
|
-
var
|
|
399
|
-
|
|
445
|
+
var v;
|
|
446
|
+
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), (v = O.current) == null || v.click());
|
|
400
447
|
},
|
|
401
|
-
|
|
402
|
-
|
|
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
|
-
|
|
406
|
-
{
|
|
407
|
-
|
|
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__ */
|
|
420
|
-
/* @__PURE__ */ e(
|
|
421
|
-
/* @__PURE__ */ e(c, { size: "2", weight: "medium", children: "Click to upload or drag and drop" }),
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
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
|
-
},
|
|
433
|
-
|
|
434
|
-
//
|
|
435
|
-
|
|
436
|
-
)
|
|
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:
|
|
498
|
+
path: n,
|
|
439
499
|
schema: r,
|
|
440
|
-
uischema:
|
|
500
|
+
uischema: f,
|
|
441
501
|
enabled: m,
|
|
442
502
|
visible: i,
|
|
443
|
-
addItem:
|
|
444
|
-
removeItems:
|
|
445
|
-
rootSchema:
|
|
446
|
-
arraySchema:
|
|
503
|
+
addItem: l,
|
|
504
|
+
removeItems: h,
|
|
505
|
+
rootSchema: s,
|
|
506
|
+
arraySchema: g
|
|
447
507
|
}) => {
|
|
448
|
-
const
|
|
449
|
-
if (i === !1 || !
|
|
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
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
},
|
|
455
|
-
if (
|
|
456
|
-
const
|
|
457
|
-
|
|
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__ */
|
|
461
|
-
/* @__PURE__ */ e(c, { as: "div", size: "4", weight: "bold", children:
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
var
|
|
465
|
-
const
|
|
466
|
-
return /* @__PURE__ */ e(
|
|
467
|
-
/* @__PURE__ */
|
|
468
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
530
|
+
$ + 1
|
|
471
531
|
] }),
|
|
472
|
-
m && /* @__PURE__ */
|
|
532
|
+
m && /* @__PURE__ */ p(
|
|
473
533
|
_,
|
|
474
534
|
{
|
|
475
535
|
type: "button",
|
|
476
536
|
color: "red",
|
|
477
537
|
variant: "soft",
|
|
478
|
-
onClick: () =>
|
|
538
|
+
onClick: () => H($),
|
|
479
539
|
title: "Remove item",
|
|
480
540
|
children: [
|
|
481
|
-
/* @__PURE__ */ e(
|
|
541
|
+
/* @__PURE__ */ e(Ve, {}),
|
|
482
542
|
"Remove"
|
|
483
543
|
]
|
|
484
544
|
}
|
|
485
545
|
)
|
|
486
546
|
] }),
|
|
487
547
|
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(
|
|
488
|
-
|
|
548
|
+
E,
|
|
489
549
|
{
|
|
490
|
-
schema:
|
|
491
|
-
uischema: ((
|
|
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/${
|
|
555
|
+
scope: `#/properties/${N}`
|
|
498
556
|
}))
|
|
499
557
|
} : {
|
|
500
558
|
type: "Control",
|
|
501
559
|
scope: "#"
|
|
502
560
|
}),
|
|
503
|
-
path:
|
|
561
|
+
path: T,
|
|
504
562
|
enabled: m,
|
|
505
563
|
renderers: void 0,
|
|
506
564
|
cells: void 0
|
|
507
565
|
}
|
|
508
566
|
) })
|
|
509
|
-
] }) },
|
|
567
|
+
] }) }, T);
|
|
510
568
|
}),
|
|
511
|
-
m && /* @__PURE__ */ e(w, { mt: "2", children: /* @__PURE__ */
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
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
|
-
},
|
|
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
|
|
530
|
-
},
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
{ tester:
|
|
535
|
-
{ tester: Xe, renderer:
|
|
536
|
-
{ tester:
|
|
537
|
-
{ tester:
|
|
538
|
-
{ tester:
|
|
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:
|
|
542
|
-
{ tester:
|
|
543
|
-
{ tester:
|
|
544
|
-
{ tester:
|
|
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
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
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
|
};
|