@opennsw/jsonforms-renderers 0.7.0 → 0.9.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/dist/renderers.es.js
CHANGED
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { jsx as n, jsxs as g, Fragment as
|
|
5
|
-
import { useContext as
|
|
6
|
-
import { rankWith as
|
|
7
|
-
import { withJsonFormsControlProps as
|
|
8
|
-
import { Box as
|
|
9
|
-
import { ChevronDownIcon as
|
|
10
|
-
import
|
|
11
|
-
import { read as
|
|
12
|
-
const
|
|
13
|
-
function
|
|
1
|
+
var Ar = Object.defineProperty;
|
|
2
|
+
var Cr = (e, t, r) => t in e ? Ar(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var Ze = (e, t, r) => Cr(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { jsx as n, jsxs as g, Fragment as he } from "react/jsx-runtime";
|
|
5
|
+
import { useContext as cr, createContext as ar, useMemo as Be, useEffect as ge, useState as $, useRef as pe, useCallback as ke } from "react";
|
|
6
|
+
import { rankWith as q, isStringControl as Sr, or as We, isNumberControl as Or, isIntegerControl as Nr, isBooleanControl as xr, isEnumControl as ur, isOneOfControl as dr, schemaMatches as ze, isDateControl as Ir, isDateTimeControl as kr, isTimeControl as Dr, uiTypeIs as Le, and as Mr, Resolve as je, update as zr, createDefaultValue as Lr, isObjectArrayControl as Fr, isPrimitiveArrayControl as Ur } from "@jsonforms/core";
|
|
7
|
+
import { withJsonFormsControlProps as me, JsonFormsDispatch as Fe, useJsonForms as fr, withJsonFormsArrayControlProps as Pr } from "@jsonforms/react";
|
|
8
|
+
import { Box as x, Flex as S, Text as h, TextField as Se, Checkbox as $r, RadioGroup as Qe, Select as Pe, ScrollArea as _r, Spinner as xe, Button as De, Tabs as $e, Heading as hr, Card as pr, IconButton as Me, Table as Re, Tooltip as He } from "@radix-ui/themes";
|
|
9
|
+
import { ChevronDownIcon as Vr, FileTextIcon as Hr, CheckCircledIcon as Wr, Cross2Icon as Ye, ExclamationTriangleIcon as Je, UploadIcon as Ne, TrashIcon as Xr, PlusIcon as Br } from "@radix-ui/react-icons";
|
|
10
|
+
import jr from "dayjs";
|
|
11
|
+
import { read as Kr, utils as Gr } from "@e965/xlsx";
|
|
12
|
+
const mr = ar(null);
|
|
13
|
+
function no({
|
|
14
14
|
children: e,
|
|
15
15
|
onUpload: t,
|
|
16
16
|
getDownloadUrl: r
|
|
17
17
|
}) {
|
|
18
|
-
const
|
|
19
|
-
return /* @__PURE__ */ n(
|
|
18
|
+
const o = { onUpload: t, getDownloadUrl: r };
|
|
19
|
+
return /* @__PURE__ */ n(mr.Provider, { value: o, children: e });
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return
|
|
21
|
+
function Yr() {
|
|
22
|
+
return cr(mr);
|
|
23
23
|
}
|
|
24
|
-
const
|
|
25
|
-
function
|
|
24
|
+
const gr = ar(null);
|
|
25
|
+
function oo({
|
|
26
26
|
children: e,
|
|
27
27
|
services: t
|
|
28
28
|
}) {
|
|
29
|
-
const r =
|
|
30
|
-
return /* @__PURE__ */ n(
|
|
29
|
+
const r = Be(() => t, [t]);
|
|
30
|
+
return /* @__PURE__ */ n(gr.Provider, { value: r, children: e });
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
const t =
|
|
32
|
+
function Jr(e) {
|
|
33
|
+
const t = cr(gr);
|
|
34
34
|
return !t || !e ? null : t[e] ?? null;
|
|
35
35
|
}
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
e === !1 && r(t,
|
|
39
|
-
}, [e, t, r,
|
|
40
|
-
},
|
|
36
|
+
const be = (e, t, r, o = void 0) => {
|
|
37
|
+
ge(() => {
|
|
38
|
+
e === !1 && r(t, o);
|
|
39
|
+
}, [e, t, r, o]);
|
|
40
|
+
}, we = (e, t) => e ? e.split(`
|
|
41
41
|
`).map((r) => r.trim() === "is a required property" ? `${t || "This field"} is required` : r).join(`
|
|
42
|
-
`) : "",
|
|
42
|
+
`) : "", qr = ({
|
|
43
43
|
data: e,
|
|
44
44
|
handleChange: t,
|
|
45
45
|
path: r,
|
|
46
|
-
label:
|
|
47
|
-
required:
|
|
48
|
-
errors:
|
|
46
|
+
label: o,
|
|
47
|
+
required: u,
|
|
48
|
+
errors: i,
|
|
49
49
|
uischema: l,
|
|
50
50
|
schema: a,
|
|
51
|
-
enabled:
|
|
51
|
+
enabled: s,
|
|
52
52
|
visible: c = !0
|
|
53
53
|
}) => {
|
|
54
54
|
var y;
|
|
55
|
-
if (
|
|
55
|
+
if (be(c, r, t), c === !1)
|
|
56
56
|
return null;
|
|
57
|
-
const
|
|
58
|
-
return /* @__PURE__ */ n(
|
|
57
|
+
const d = i.length === 0;
|
|
58
|
+
return /* @__PURE__ */ n(x, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
|
|
59
59
|
/* @__PURE__ */ g(h, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
|
|
60
|
-
|
|
60
|
+
o,
|
|
61
61
|
" ",
|
|
62
|
-
|
|
62
|
+
u && /* @__PURE__ */ n(h, { color: "red", children: "*" })
|
|
63
63
|
] }),
|
|
64
64
|
/* @__PURE__ */ n(
|
|
65
|
-
|
|
65
|
+
Se.Root,
|
|
66
66
|
{
|
|
67
67
|
value: e || "",
|
|
68
68
|
onChange: (p) => t(r, p.target.value),
|
|
69
|
-
disabled: !
|
|
69
|
+
disabled: !s,
|
|
70
70
|
placeholder: (y = l.options) == null ? void 0 : y.placeholder,
|
|
71
|
-
color:
|
|
71
|
+
color: d ? void 0 : "red",
|
|
72
72
|
id: r
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
|
-
!
|
|
75
|
+
!d && /* @__PURE__ */ n(h, { color: "red", size: "1", children: we(i, o) }),
|
|
76
76
|
a.description && /* @__PURE__ */ n(h, { size: "1", color: "gray", children: a.description })
|
|
77
77
|
] }) });
|
|
78
|
-
},
|
|
78
|
+
}, Zr = q(1, Sr), Qr = me(qr), et = ({
|
|
79
79
|
data: e,
|
|
80
80
|
handleChange: t,
|
|
81
81
|
path: r,
|
|
82
|
-
label:
|
|
83
|
-
required:
|
|
84
|
-
errors:
|
|
82
|
+
label: o,
|
|
83
|
+
required: u,
|
|
84
|
+
errors: i,
|
|
85
85
|
uischema: l,
|
|
86
86
|
schema: a,
|
|
87
|
-
enabled:
|
|
87
|
+
enabled: s,
|
|
88
88
|
visible: c = !0
|
|
89
89
|
}) => {
|
|
90
90
|
var p;
|
|
91
|
-
if (
|
|
91
|
+
if (be(c, r, t), c === !1)
|
|
92
92
|
return null;
|
|
93
|
-
const
|
|
93
|
+
const d = i.length === 0, y = (m) => {
|
|
94
94
|
if (m === "") {
|
|
95
95
|
t(r, void 0);
|
|
96
96
|
return;
|
|
@@ -98,93 +98,93 @@ const ce = (e, t, r, i = void 0) => {
|
|
|
98
98
|
const v = Number(m);
|
|
99
99
|
isNaN(v) || t(r, v);
|
|
100
100
|
};
|
|
101
|
-
return /* @__PURE__ */ n(
|
|
101
|
+
return /* @__PURE__ */ n(x, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
|
|
102
102
|
/* @__PURE__ */ g(h, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
|
|
103
|
-
|
|
103
|
+
o,
|
|
104
104
|
" ",
|
|
105
|
-
|
|
105
|
+
u && /* @__PURE__ */ n(h, { color: "red", children: "*" })
|
|
106
106
|
] }),
|
|
107
107
|
/* @__PURE__ */ n(
|
|
108
|
-
|
|
108
|
+
Se.Root,
|
|
109
109
|
{
|
|
110
110
|
type: "number",
|
|
111
111
|
value: e ?? "",
|
|
112
112
|
onChange: (m) => y(m.target.value),
|
|
113
|
-
disabled: !
|
|
113
|
+
disabled: !s,
|
|
114
114
|
placeholder: (p = l.options) == null ? void 0 : p.placeholder,
|
|
115
|
-
color:
|
|
115
|
+
color: d ? void 0 : "red",
|
|
116
116
|
id: r
|
|
117
117
|
}
|
|
118
118
|
),
|
|
119
|
-
!
|
|
119
|
+
!d && /* @__PURE__ */ n(h, { color: "red", size: "1", children: we(i, o) }),
|
|
120
120
|
a.description && /* @__PURE__ */ n(h, { size: "1", color: "gray", children: a.description })
|
|
121
121
|
] }) });
|
|
122
|
-
},
|
|
122
|
+
}, rt = q(2, We(Or, Nr)), tt = me(et), nt = ({
|
|
123
123
|
data: e,
|
|
124
124
|
handleChange: t,
|
|
125
125
|
path: r,
|
|
126
|
-
label:
|
|
127
|
-
required:
|
|
128
|
-
errors:
|
|
126
|
+
label: o,
|
|
127
|
+
required: u,
|
|
128
|
+
errors: i,
|
|
129
129
|
schema: l,
|
|
130
130
|
enabled: a,
|
|
131
|
-
visible:
|
|
131
|
+
visible: s = !0
|
|
132
132
|
}) => {
|
|
133
|
-
if (
|
|
133
|
+
if (be(s, r, t), s === !1)
|
|
134
134
|
return null;
|
|
135
|
-
const c =
|
|
136
|
-
return /* @__PURE__ */ g(
|
|
135
|
+
const c = i.length === 0;
|
|
136
|
+
return /* @__PURE__ */ g(x, { mb: "4", children: [
|
|
137
137
|
/* @__PURE__ */ g(S, { gap: "2", align: "center", children: [
|
|
138
138
|
/* @__PURE__ */ n(
|
|
139
|
-
|
|
139
|
+
$r,
|
|
140
140
|
{
|
|
141
141
|
checked: !!e,
|
|
142
|
-
onCheckedChange: (
|
|
142
|
+
onCheckedChange: (d) => t(r, d === !0),
|
|
143
143
|
disabled: !a,
|
|
144
144
|
id: r
|
|
145
145
|
}
|
|
146
146
|
),
|
|
147
147
|
/* @__PURE__ */ g(h, { as: "label", size: "2", htmlFor: r, children: [
|
|
148
|
-
|
|
148
|
+
o,
|
|
149
149
|
" ",
|
|
150
|
-
|
|
150
|
+
u && "*"
|
|
151
151
|
] })
|
|
152
152
|
] }),
|
|
153
|
-
!c && /* @__PURE__ */ n(h, { color: "red", size: "1", className: "block mt-1", children:
|
|
153
|
+
!c && /* @__PURE__ */ n(h, { color: "red", size: "1", className: "block mt-1", children: we(i, o) }),
|
|
154
154
|
l.description && /* @__PURE__ */ n(h, { size: "1", color: "gray", className: "block mt-1", children: l.description })
|
|
155
155
|
] });
|
|
156
|
-
},
|
|
156
|
+
}, ot = q(2, xr), it = me(nt), lt = ({
|
|
157
157
|
data: e,
|
|
158
158
|
handleChange: t,
|
|
159
159
|
path: r,
|
|
160
|
-
label:
|
|
161
|
-
required:
|
|
162
|
-
errors:
|
|
160
|
+
label: o,
|
|
161
|
+
required: u,
|
|
162
|
+
errors: i,
|
|
163
163
|
schema: l,
|
|
164
164
|
enabled: a,
|
|
165
|
-
visible:
|
|
165
|
+
visible: s = !0
|
|
166
166
|
}) => {
|
|
167
|
-
if (
|
|
167
|
+
if (be(s, r, t), s === !1)
|
|
168
168
|
return null;
|
|
169
|
-
const c =
|
|
170
|
-
let
|
|
171
|
-
l.enum ?
|
|
169
|
+
const c = i.length === 0;
|
|
170
|
+
let d = [];
|
|
171
|
+
l.enum ? d = l.enum.map((p) => ({ value: p, label: String(p) })) : l.oneOf && (d = l.oneOf.map((p) => ({
|
|
172
172
|
value: p.const,
|
|
173
173
|
label: p.title || String(p.const)
|
|
174
174
|
})));
|
|
175
175
|
const y = e;
|
|
176
|
-
return /* @__PURE__ */ n(
|
|
176
|
+
return /* @__PURE__ */ n(x, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
|
|
177
177
|
/* @__PURE__ */ g(h, { as: "div", size: "2", weight: "bold", children: [
|
|
178
|
-
|
|
178
|
+
o,
|
|
179
179
|
" ",
|
|
180
|
-
|
|
180
|
+
u && /* @__PURE__ */ n(h, { color: "red", children: "*" })
|
|
181
181
|
] }),
|
|
182
182
|
/* @__PURE__ */ n(
|
|
183
|
-
|
|
183
|
+
Qe.Root,
|
|
184
184
|
{
|
|
185
185
|
value: y !== void 0 ? String(y) : "",
|
|
186
186
|
onValueChange: (p) => {
|
|
187
|
-
const m =
|
|
187
|
+
const m = d.find((v) => String(v.value) === p);
|
|
188
188
|
m && t(r, m.value);
|
|
189
189
|
},
|
|
190
190
|
disabled: !a,
|
|
@@ -197,210 +197,210 @@ const ce = (e, t, r, i = void 0) => {
|
|
|
197
197
|
columnGap: "clamp(14px, 3vw, 36px)",
|
|
198
198
|
rowGap: "clamp(8px, 1.6vw, 14px)"
|
|
199
199
|
},
|
|
200
|
-
children:
|
|
201
|
-
/* @__PURE__ */ n(
|
|
200
|
+
children: d.map((p) => /* @__PURE__ */ g(S, { align: "center", gap: "2", style: { minWidth: "max-content" }, children: [
|
|
201
|
+
/* @__PURE__ */ n(Qe.Item, { value: String(p.value) }),
|
|
202
202
|
/* @__PURE__ */ n(h, { size: "2", color: a ? void 0 : "gray", children: p.label })
|
|
203
203
|
] }, String(p.value)))
|
|
204
204
|
}
|
|
205
205
|
)
|
|
206
206
|
}
|
|
207
207
|
),
|
|
208
|
-
!c && /* @__PURE__ */ n(h, { color: "red", size: "1", children:
|
|
208
|
+
!c && /* @__PURE__ */ n(h, { color: "red", size: "1", children: we(i, o) }),
|
|
209
209
|
l.description && /* @__PURE__ */ n(h, { size: "1", color: "gray", children: l.description })
|
|
210
210
|
] }) });
|
|
211
|
-
},
|
|
212
|
-
var
|
|
213
|
-
return
|
|
214
|
-
},
|
|
211
|
+
}, st = (e, t, r) => {
|
|
212
|
+
var u;
|
|
213
|
+
return We(ur, dr)(e, t, r) && ((u = e == null ? void 0 : e.options) == null ? void 0 : u.format) === "radio" ? 3 : -1;
|
|
214
|
+
}, ct = me(lt), at = ({
|
|
215
215
|
data: e,
|
|
216
216
|
handleChange: t,
|
|
217
217
|
path: r,
|
|
218
|
-
label:
|
|
219
|
-
required:
|
|
220
|
-
errors:
|
|
218
|
+
label: o,
|
|
219
|
+
required: u,
|
|
220
|
+
errors: i,
|
|
221
221
|
schema: l,
|
|
222
222
|
uischema: a,
|
|
223
|
-
enabled:
|
|
223
|
+
enabled: s,
|
|
224
224
|
visible: c = !0
|
|
225
225
|
}) => {
|
|
226
226
|
var m;
|
|
227
|
-
if (
|
|
227
|
+
if (be(c, r, t), c === !1)
|
|
228
228
|
return null;
|
|
229
|
-
const
|
|
229
|
+
const d = i.length === 0;
|
|
230
230
|
let y = [];
|
|
231
231
|
l.enum ? y = l.enum.map((v) => ({ value: String(v), label: String(v) })) : l.oneOf && (y = l.oneOf.map((v) => ({
|
|
232
232
|
value: String(v.const),
|
|
233
233
|
label: v.title || String(v.const)
|
|
234
234
|
})));
|
|
235
235
|
const p = e !== void 0 ? String(e) : "";
|
|
236
|
-
return /* @__PURE__ */ n(
|
|
236
|
+
return /* @__PURE__ */ n(x, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
|
|
237
237
|
/* @__PURE__ */ g(h, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
|
|
238
|
-
|
|
238
|
+
o,
|
|
239
239
|
" ",
|
|
240
|
-
|
|
240
|
+
u && /* @__PURE__ */ n(h, { color: "red", children: "*" })
|
|
241
241
|
] }),
|
|
242
|
-
/* @__PURE__ */ g(
|
|
242
|
+
/* @__PURE__ */ g(Pe.Root, { value: p, onValueChange: (v) => t(r, v), disabled: !s, children: [
|
|
243
243
|
/* @__PURE__ */ n(
|
|
244
|
-
|
|
244
|
+
Pe.Trigger,
|
|
245
245
|
{
|
|
246
246
|
placeholder: ((m = a.options) == null ? void 0 : m.placeholder) || "Select an option",
|
|
247
|
-
color:
|
|
247
|
+
color: d ? void 0 : "red",
|
|
248
248
|
id: r
|
|
249
249
|
}
|
|
250
250
|
),
|
|
251
|
-
/* @__PURE__ */ n(
|
|
251
|
+
/* @__PURE__ */ n(Pe.Content, { children: y.map((v) => /* @__PURE__ */ n(Pe.Item, { value: v.value, children: v.label }, v.value)) })
|
|
252
252
|
] }),
|
|
253
|
-
!
|
|
253
|
+
!d && /* @__PURE__ */ n(h, { color: "red", size: "1", children: we(i, o) }),
|
|
254
254
|
l.description && /* @__PURE__ */ n(h, { size: "1", color: "gray", children: l.description })
|
|
255
255
|
] }) });
|
|
256
|
-
},
|
|
256
|
+
}, ut = q(2, We(ur, dr)), dt = me(at), ft = {
|
|
257
257
|
"small-list": { fetchOnOpen: !0, searchable: !1, paginated: !1 },
|
|
258
258
|
"large-searchable-list": { fetchOnOpen: !0, searchable: !0, paginated: !1 },
|
|
259
259
|
"large-paginated-list": { fetchOnOpen: !1, searchable: !0, paginated: !0 }
|
|
260
|
-
},
|
|
260
|
+
}, ht = ({
|
|
261
261
|
data: e,
|
|
262
262
|
handleChange: t,
|
|
263
263
|
path: r,
|
|
264
|
-
label:
|
|
265
|
-
required:
|
|
266
|
-
errors:
|
|
264
|
+
label: o,
|
|
265
|
+
required: u,
|
|
266
|
+
errors: i,
|
|
267
267
|
enabled: l,
|
|
268
268
|
visible: a = !0,
|
|
269
|
-
schema:
|
|
269
|
+
schema: s,
|
|
270
270
|
uischema: c
|
|
271
271
|
}) => {
|
|
272
|
-
var
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
var
|
|
276
|
-
if (!
|
|
277
|
-
|
|
272
|
+
var Ee;
|
|
273
|
+
const d = (s == null ? void 0 : s["x-search"]) ?? { service: "" }, y = d.service ?? "", p = d.mode ?? "large-paginated-list", m = ft[p], v = (m == null ? void 0 : m.fetchOnOpen) ?? !1, I = d.params, A = Jr(y), b = s.type === "object", k = b ? typeof e == "string" ? { value: e } : e ?? void 0 : void 0, F = b ? k == null ? void 0 : k.value : e, z = k == null ? void 0 : k.label, w = y ? A ? m ? null : `Invalid x-search.mode "${p}". Expected "small-list", "large-searchable-list", or "large-paginated-list".` : `Search service "${y}" is not registered.` : "Search not configured.", _ = l !== !1, V = !i || i.length === 0, [O, C] = $(!1), [H, B] = $(""), [W, j] = $([]), [ee, re] = $(!1), [le, oe] = $(!1), [se, de] = $(!1), [G, f] = $(null), [T, K] = $(void 0), N = pe(void 0), U = pe(null), Z = pe(null), ie = pe(null), J = pe(void 0);
|
|
274
|
+
ge(() => {
|
|
275
|
+
var ce, Q;
|
|
276
|
+
if (!F) {
|
|
277
|
+
K(void 0), J.current = void 0;
|
|
278
278
|
return;
|
|
279
279
|
}
|
|
280
|
-
if (((
|
|
281
|
-
if (
|
|
282
|
-
|
|
280
|
+
if (((ce = J.current) == null ? void 0 : ce.value) === F && ((Q = J.current) == null ? void 0 : Q.label) === z) return;
|
|
281
|
+
if (J.current = { value: F, label: z }, b && z) {
|
|
282
|
+
K({ id: F, name: z });
|
|
283
283
|
return;
|
|
284
284
|
}
|
|
285
|
-
if (
|
|
286
|
-
let
|
|
287
|
-
return A.resolve(
|
|
288
|
-
!
|
|
285
|
+
if (K({ id: F, name: z ?? F }), !(A != null && A.resolve)) return;
|
|
286
|
+
let R = !1;
|
|
287
|
+
return A.resolve(F, I).then((ae) => {
|
|
288
|
+
!R && ae && K(ae);
|
|
289
289
|
}).catch(() => {
|
|
290
290
|
}), () => {
|
|
291
|
-
|
|
291
|
+
R = !0;
|
|
292
292
|
};
|
|
293
|
-
}, [
|
|
294
|
-
const
|
|
295
|
-
async (
|
|
296
|
-
var
|
|
293
|
+
}, [F, z, b, A, I]);
|
|
294
|
+
const D = ke(
|
|
295
|
+
async (R, ce = !1) => {
|
|
296
|
+
var ae;
|
|
297
297
|
if (!A) {
|
|
298
|
-
|
|
298
|
+
f("Search service not configured.");
|
|
299
299
|
return;
|
|
300
300
|
}
|
|
301
|
-
(
|
|
302
|
-
const
|
|
303
|
-
|
|
301
|
+
(ae = Z.current) == null || ae.abort();
|
|
302
|
+
const Q = new AbortController();
|
|
303
|
+
Z.current = Q, ce ? de(!0) : (oe(!0), de(!1), f(null));
|
|
304
304
|
try {
|
|
305
|
-
const
|
|
306
|
-
query:
|
|
307
|
-
cursor:
|
|
308
|
-
signal:
|
|
309
|
-
params:
|
|
310
|
-
}),
|
|
311
|
-
|
|
305
|
+
const Ae = await A.search({
|
|
306
|
+
query: R,
|
|
307
|
+
cursor: ce ? N.current : void 0,
|
|
308
|
+
signal: Q.signal,
|
|
309
|
+
params: I
|
|
310
|
+
}), Ie = Ae.options ?? [];
|
|
311
|
+
j(ce ? (Ue) => [...Ue, ...Ie] : Ie), N.current = Ae.nextCursor, re(((m == null ? void 0 : m.paginated) ?? !1) && Ae.nextCursor != null);
|
|
312
312
|
} catch {
|
|
313
|
-
if (
|
|
314
|
-
|
|
313
|
+
if (Q.signal.aborted) return;
|
|
314
|
+
f("Failed to load results. Please try again.");
|
|
315
315
|
} finally {
|
|
316
|
-
|
|
316
|
+
Q.signal.aborted || (ce ? de(!1) : oe(!1));
|
|
317
317
|
}
|
|
318
318
|
},
|
|
319
|
-
[A, m == null ? void 0 : m.paginated,
|
|
319
|
+
[A, m == null ? void 0 : m.paginated, I]
|
|
320
320
|
);
|
|
321
|
-
if (
|
|
322
|
-
if (!
|
|
323
|
-
const
|
|
324
|
-
|
|
321
|
+
if (ge(() => {
|
|
322
|
+
if (!O) return;
|
|
323
|
+
const R = (ce) => {
|
|
324
|
+
ie.current && !ie.current.contains(ce.target) && C(!1);
|
|
325
325
|
};
|
|
326
|
-
return document.addEventListener("mousedown",
|
|
327
|
-
}, [
|
|
328
|
-
var
|
|
329
|
-
|
|
330
|
-
}, [
|
|
331
|
-
if (!
|
|
332
|
-
if (!
|
|
333
|
-
|
|
326
|
+
return document.addEventListener("mousedown", R), () => document.removeEventListener("mousedown", R);
|
|
327
|
+
}, [O]), ge(() => {
|
|
328
|
+
var R;
|
|
329
|
+
O || ((R = Z.current) == null || R.abort(), B(""), j([]), re(!1), f(null), oe(!1), de(!1), N.current = void 0);
|
|
330
|
+
}, [O]), ge(() => {
|
|
331
|
+
if (!O) return;
|
|
332
|
+
if (!H && !v) {
|
|
333
|
+
j([]), re(!1), f(null), N.current = void 0;
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
return
|
|
339
|
-
|
|
340
|
-
},
|
|
341
|
-
|
|
336
|
+
U.current && clearTimeout(U.current);
|
|
337
|
+
const R = H ? 300 : 0;
|
|
338
|
+
return U.current = setTimeout(() => {
|
|
339
|
+
j([]), re(!1), N.current = void 0, D(H);
|
|
340
|
+
}, R), () => {
|
|
341
|
+
U.current && clearTimeout(U.current);
|
|
342
342
|
};
|
|
343
|
-
}, [
|
|
343
|
+
}, [H, O, v, D]), be(a, r, t, b ? void 0 : null), a === !1)
|
|
344
344
|
return null;
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
},
|
|
348
|
-
t(r,
|
|
349
|
-
},
|
|
350
|
-
|
|
351
|
-
},
|
|
352
|
-
(
|
|
353
|
-
},
|
|
354
|
-
return /* @__PURE__ */ n(
|
|
345
|
+
const E = () => {
|
|
346
|
+
B(""), j([]), re(!1), f(null), N.current = void 0, C(!0);
|
|
347
|
+
}, L = (R) => {
|
|
348
|
+
t(r, b ? { value: R.id, label: R.name } : R.id), K(R), J.current = { value: R.id, label: b ? R.name : void 0 }, C(!1);
|
|
349
|
+
}, ue = (R) => {
|
|
350
|
+
R.stopPropagation(), t(r, b ? void 0 : null), K(void 0);
|
|
351
|
+
}, X = (R) => {
|
|
352
|
+
(R.key === "Enter" || R.key === " ") && ue(R);
|
|
353
|
+
}, P = ((Ee = c == null ? void 0 : c.options) == null ? void 0 : Ee.placeholder) ?? "Select an option";
|
|
354
|
+
return /* @__PURE__ */ n(x, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
|
|
355
355
|
/* @__PURE__ */ g(h, { as: "label", size: "2", weight: "bold", htmlFor: r, children: [
|
|
356
|
-
|
|
356
|
+
o,
|
|
357
357
|
" ",
|
|
358
|
-
|
|
358
|
+
u && /* @__PURE__ */ n(h, { color: "red", children: "*" })
|
|
359
359
|
] }),
|
|
360
|
-
/* @__PURE__ */ g("div", { ref:
|
|
360
|
+
/* @__PURE__ */ g("div", { ref: ie, style: { position: "relative" }, children: [
|
|
361
361
|
/* @__PURE__ */ n(
|
|
362
|
-
|
|
362
|
+
Se.Root,
|
|
363
363
|
{
|
|
364
364
|
id: r,
|
|
365
|
-
value:
|
|
366
|
-
placeholder:
|
|
367
|
-
disabled: !
|
|
368
|
-
readOnly:
|
|
369
|
-
style:
|
|
370
|
-
onChange: (
|
|
371
|
-
m != null && m.searchable && (
|
|
365
|
+
value: O ? H : (T == null ? void 0 : T.name) ?? "",
|
|
366
|
+
placeholder: O && (m != null && m.searchable) ? "Search..." : P,
|
|
367
|
+
disabled: !_,
|
|
368
|
+
readOnly: O && !(m != null && m.searchable),
|
|
369
|
+
style: V ? void 0 : { outline: "2px solid var(--red-7)", outlineOffset: "-1px" },
|
|
370
|
+
onChange: (R) => {
|
|
371
|
+
m != null && m.searchable && (B(R.target.value), O || E());
|
|
372
372
|
},
|
|
373
373
|
onFocus: () => {
|
|
374
|
-
|
|
374
|
+
_ && !O && E();
|
|
375
375
|
},
|
|
376
|
-
onKeyDown: (
|
|
377
|
-
|
|
376
|
+
onKeyDown: (R) => {
|
|
377
|
+
R.key === "Escape" && C(!1);
|
|
378
378
|
},
|
|
379
|
-
children: /* @__PURE__ */ n(
|
|
380
|
-
|
|
379
|
+
children: /* @__PURE__ */ n(Se.Slot, { side: "right", children: /* @__PURE__ */ g(S, { align: "center", gap: "1", children: [
|
|
380
|
+
F && _ && /* @__PURE__ */ n(
|
|
381
381
|
"span",
|
|
382
382
|
{
|
|
383
383
|
role: "button",
|
|
384
384
|
tabIndex: 0,
|
|
385
|
-
onMouseDown: (
|
|
386
|
-
onClick:
|
|
387
|
-
onKeyDown:
|
|
385
|
+
onMouseDown: (R) => R.preventDefault(),
|
|
386
|
+
onClick: ue,
|
|
387
|
+
onKeyDown: X,
|
|
388
388
|
style: { lineHeight: 1, color: "var(--gray-9)", padding: "0 2px", cursor: "pointer" },
|
|
389
389
|
"aria-label": "Clear selection",
|
|
390
390
|
children: "×"
|
|
391
391
|
}
|
|
392
392
|
),
|
|
393
393
|
/* @__PURE__ */ n(
|
|
394
|
-
|
|
394
|
+
Vr,
|
|
395
395
|
{
|
|
396
|
-
style: { transform:
|
|
396
|
+
style: { transform: O ? "rotate(180deg)" : void 0, transition: "transform 150ms" }
|
|
397
397
|
}
|
|
398
398
|
)
|
|
399
399
|
] }) })
|
|
400
400
|
}
|
|
401
401
|
),
|
|
402
|
-
|
|
403
|
-
|
|
402
|
+
O && /* @__PURE__ */ n(
|
|
403
|
+
x,
|
|
404
404
|
{
|
|
405
405
|
style: {
|
|
406
406
|
position: "absolute",
|
|
@@ -414,229 +414,229 @@ const ce = (e, t, r, i = void 0) => {
|
|
|
414
414
|
border: "1px solid var(--gray-a6)",
|
|
415
415
|
overflow: "hidden"
|
|
416
416
|
},
|
|
417
|
-
children:
|
|
418
|
-
|
|
419
|
-
!
|
|
420
|
-
!
|
|
421
|
-
|
|
422
|
-
|
|
417
|
+
children: w ? /* @__PURE__ */ n(x, { p: "3", children: /* @__PURE__ */ n(h, { size: "2", color: "gray", children: w }) }) : /* @__PURE__ */ n(_r, { style: { maxHeight: 240 }, children: /* @__PURE__ */ g(x, { p: "1", children: [
|
|
418
|
+
le && /* @__PURE__ */ n(S, { justify: "center", p: "4", children: /* @__PURE__ */ n(xe, {}) }),
|
|
419
|
+
!le && G && /* @__PURE__ */ n(x, { px: "3", py: "2", children: /* @__PURE__ */ n(h, { size: "2", color: "red", children: G }) }),
|
|
420
|
+
!le && !G && W.length === 0 && /* @__PURE__ */ n(x, { px: "3", py: "2", children: /* @__PURE__ */ n(h, { size: "2", color: "gray", children: H || v ? "No results found." : "Type to search…" }) }),
|
|
421
|
+
W.map((R) => /* @__PURE__ */ n(
|
|
422
|
+
x,
|
|
423
423
|
{
|
|
424
424
|
px: "3",
|
|
425
425
|
py: "2",
|
|
426
|
-
onMouseDown: (
|
|
427
|
-
onClick: () =>
|
|
426
|
+
onMouseDown: (ce) => ce.preventDefault(),
|
|
427
|
+
onClick: () => L(R),
|
|
428
428
|
style: {
|
|
429
429
|
cursor: "pointer",
|
|
430
430
|
borderRadius: "var(--radius-2)",
|
|
431
|
-
backgroundColor:
|
|
431
|
+
backgroundColor: R.id === F ? "var(--accent-3)" : void 0
|
|
432
432
|
},
|
|
433
433
|
className: "hover:bg-(--gray-3)",
|
|
434
|
-
children: /* @__PURE__ */ n(h, { size: "2", children:
|
|
434
|
+
children: /* @__PURE__ */ n(h, { size: "2", children: R.name })
|
|
435
435
|
},
|
|
436
|
-
|
|
436
|
+
R.id
|
|
437
437
|
)),
|
|
438
|
-
(m == null ? void 0 : m.paginated) &&
|
|
439
|
-
|
|
438
|
+
(m == null ? void 0 : m.paginated) && ee && !se && /* @__PURE__ */ n(x, { px: "3", py: "2", children: /* @__PURE__ */ n(
|
|
439
|
+
De,
|
|
440
440
|
{
|
|
441
441
|
variant: "ghost",
|
|
442
442
|
size: "1",
|
|
443
443
|
style: { width: "100%" },
|
|
444
|
-
onMouseDown: (
|
|
445
|
-
onClick: () => void
|
|
444
|
+
onMouseDown: (R) => R.preventDefault(),
|
|
445
|
+
onClick: () => void D(H, !0),
|
|
446
446
|
children: "Load more"
|
|
447
447
|
}
|
|
448
448
|
) }),
|
|
449
|
-
|
|
449
|
+
se && /* @__PURE__ */ n(S, { justify: "center", p: "2", children: /* @__PURE__ */ n(xe, {}) })
|
|
450
450
|
] }) })
|
|
451
451
|
}
|
|
452
452
|
)
|
|
453
453
|
] }),
|
|
454
|
-
!
|
|
455
|
-
|
|
454
|
+
!V && /* @__PURE__ */ n(h, { color: "red", size: "1", children: we(i, o) }),
|
|
455
|
+
s.description && /* @__PURE__ */ n(h, { size: "1", color: "gray", children: s.description })
|
|
456
456
|
] }) });
|
|
457
|
-
},
|
|
457
|
+
}, pt = me(ht), mt = q(
|
|
458
458
|
3,
|
|
459
459
|
ze((e) => {
|
|
460
460
|
const t = e["x-search"];
|
|
461
461
|
return (e.type === "string" || e.type === "object") && typeof (t == null ? void 0 : t.service) == "string" && t.service !== "";
|
|
462
462
|
})
|
|
463
|
-
),
|
|
464
|
-
const l =
|
|
465
|
-
return /* @__PURE__ */ n(
|
|
463
|
+
), gt = (e, t) => jr(`${e}T${t}`).format(), yt = ({ path: e, label: t, required: r, errors: o, description: u, children: i }) => {
|
|
464
|
+
const l = o.length === 0;
|
|
465
|
+
return /* @__PURE__ */ n(x, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
|
|
466
466
|
/* @__PURE__ */ g(h, { as: "label", size: "2", weight: "bold", htmlFor: e, children: [
|
|
467
467
|
t,
|
|
468
468
|
" ",
|
|
469
469
|
r && /* @__PURE__ */ n(h, { color: "red", children: "*" })
|
|
470
470
|
] }),
|
|
471
|
-
|
|
472
|
-
!l && /* @__PURE__ */ n(h, { color: "red", size: "1", children:
|
|
473
|
-
|
|
471
|
+
i,
|
|
472
|
+
!l && /* @__PURE__ */ n(h, { color: "red", size: "1", children: we(o, t) }),
|
|
473
|
+
u && /* @__PURE__ */ n(h, { size: "1", color: "gray", children: u })
|
|
474
474
|
] }) });
|
|
475
|
-
},
|
|
475
|
+
}, vt = ({
|
|
476
476
|
data: e,
|
|
477
477
|
handleChange: t,
|
|
478
478
|
path: r,
|
|
479
|
-
label:
|
|
480
|
-
required:
|
|
481
|
-
errors:
|
|
479
|
+
label: o,
|
|
480
|
+
required: u,
|
|
481
|
+
errors: i,
|
|
482
482
|
schema: l,
|
|
483
483
|
enabled: a,
|
|
484
|
-
visible:
|
|
484
|
+
visible: s = !0
|
|
485
485
|
}) => {
|
|
486
|
-
if (
|
|
487
|
-
|
|
488
|
-
}, [
|
|
486
|
+
if (ge(() => {
|
|
487
|
+
s === !1 && t(r, void 0);
|
|
488
|
+
}, [s, r, t]), s === !1)
|
|
489
489
|
return null;
|
|
490
|
-
const c =
|
|
490
|
+
const c = i.length === 0, d = typeof e == "string" ? e : "", y = (b) => /* @__PURE__ */ n(yt, { path: r, label: o, required: u, errors: i, description: l.description, children: b });
|
|
491
491
|
if (l.format === "time")
|
|
492
492
|
return y(
|
|
493
493
|
/* @__PURE__ */ n(
|
|
494
|
-
|
|
494
|
+
Se.Root,
|
|
495
495
|
{
|
|
496
496
|
type: "time",
|
|
497
|
-
value:
|
|
498
|
-
onChange: (
|
|
497
|
+
value: d,
|
|
498
|
+
onChange: (b) => t(r, b.target.value),
|
|
499
499
|
disabled: !a,
|
|
500
500
|
color: c ? void 0 : "red",
|
|
501
501
|
id: r
|
|
502
502
|
}
|
|
503
503
|
)
|
|
504
504
|
);
|
|
505
|
-
const p = l.format === "date-time", [m = "", v = ""] =
|
|
506
|
-
if (!
|
|
505
|
+
const p = l.format === "date-time", [m = "", v = ""] = d.split("T"), I = v.slice(0, 5), A = (b, k) => {
|
|
506
|
+
if (!b) {
|
|
507
507
|
t(r, void 0);
|
|
508
508
|
return;
|
|
509
509
|
}
|
|
510
|
-
t(r, p ?
|
|
510
|
+
t(r, p ? gt(b, k || "00:00") : b);
|
|
511
511
|
};
|
|
512
512
|
return y(
|
|
513
513
|
/* @__PURE__ */ g(S, { gap: "2", align: "center", children: [
|
|
514
514
|
/* @__PURE__ */ n(
|
|
515
|
-
|
|
515
|
+
Se.Root,
|
|
516
516
|
{
|
|
517
517
|
type: "date",
|
|
518
518
|
value: m,
|
|
519
519
|
disabled: !a,
|
|
520
520
|
color: c ? void 0 : "red",
|
|
521
|
-
onChange: (
|
|
521
|
+
onChange: (b) => A(b.target.value, I),
|
|
522
522
|
id: r,
|
|
523
523
|
style: { flex: 1 }
|
|
524
524
|
}
|
|
525
525
|
),
|
|
526
526
|
p && /* @__PURE__ */ n(
|
|
527
|
-
|
|
527
|
+
Se.Root,
|
|
528
528
|
{
|
|
529
529
|
type: "time",
|
|
530
|
-
value:
|
|
530
|
+
value: I,
|
|
531
531
|
disabled: !a || !m,
|
|
532
532
|
color: c ? void 0 : "red",
|
|
533
|
-
onChange: (
|
|
533
|
+
onChange: (b) => A(m, b.target.value),
|
|
534
534
|
style: { flex: 1 }
|
|
535
535
|
}
|
|
536
536
|
)
|
|
537
537
|
] })
|
|
538
538
|
);
|
|
539
|
-
},
|
|
539
|
+
}, bt = q(2, We(Ir, kr, Dr)), wt = me(vt), Et = ({
|
|
540
540
|
uischema: e,
|
|
541
541
|
schema: t,
|
|
542
542
|
path: r,
|
|
543
|
-
renderers:
|
|
544
|
-
cells:
|
|
545
|
-
enabled:
|
|
543
|
+
renderers: o,
|
|
544
|
+
cells: u,
|
|
545
|
+
enabled: i,
|
|
546
546
|
visible: l = !0
|
|
547
547
|
}) => {
|
|
548
|
-
const
|
|
549
|
-
return l === !1 ? null : /* @__PURE__ */ n(S, { direction: "column", gap: "4", children:
|
|
550
|
-
|
|
548
|
+
const s = e.elements;
|
|
549
|
+
return l === !1 ? null : /* @__PURE__ */ n(S, { direction: "column", gap: "4", children: s.map((c, d) => /* @__PURE__ */ n(
|
|
550
|
+
Fe,
|
|
551
551
|
{
|
|
552
552
|
uischema: c,
|
|
553
553
|
schema: t,
|
|
554
554
|
path: r,
|
|
555
|
-
renderers:
|
|
556
|
-
cells:
|
|
557
|
-
enabled:
|
|
555
|
+
renderers: o,
|
|
556
|
+
cells: u,
|
|
557
|
+
enabled: i
|
|
558
558
|
},
|
|
559
|
-
`${r}-${
|
|
559
|
+
`${r}-${d}`
|
|
560
560
|
)) });
|
|
561
|
-
},
|
|
561
|
+
}, Rt = q(1, Le("VerticalLayout")), Tt = ({
|
|
562
562
|
uischema: e,
|
|
563
563
|
schema: t,
|
|
564
564
|
path: r,
|
|
565
|
-
renderers:
|
|
566
|
-
cells:
|
|
567
|
-
enabled:
|
|
565
|
+
renderers: o,
|
|
566
|
+
cells: u,
|
|
567
|
+
enabled: i,
|
|
568
568
|
visible: l = !0
|
|
569
569
|
}) => {
|
|
570
|
-
const
|
|
571
|
-
return l === !1 ? null : /* @__PURE__ */ n(S, { direction: "row", gap: "4", children:
|
|
572
|
-
|
|
570
|
+
const s = e.elements;
|
|
571
|
+
return l === !1 ? null : /* @__PURE__ */ n(S, { direction: "row", gap: "4", children: s.map((c, d) => /* @__PURE__ */ n(x, { style: { flex: 1 }, children: /* @__PURE__ */ n(
|
|
572
|
+
Fe,
|
|
573
573
|
{
|
|
574
574
|
uischema: c,
|
|
575
575
|
schema: t,
|
|
576
576
|
path: r,
|
|
577
|
-
renderers:
|
|
578
|
-
cells:
|
|
579
|
-
enabled:
|
|
577
|
+
renderers: o,
|
|
578
|
+
cells: u,
|
|
579
|
+
enabled: i
|
|
580
580
|
}
|
|
581
|
-
) }, `${r}-${
|
|
582
|
-
},
|
|
581
|
+
) }, `${r}-${d}`)) });
|
|
582
|
+
}, At = q(1, Le("HorizontalLayout")), Ct = ({
|
|
583
583
|
uischema: e,
|
|
584
584
|
schema: t,
|
|
585
585
|
path: r,
|
|
586
|
-
renderers:
|
|
587
|
-
cells:
|
|
588
|
-
enabled:
|
|
586
|
+
renderers: o,
|
|
587
|
+
cells: u,
|
|
588
|
+
enabled: i,
|
|
589
589
|
visible: l = !0
|
|
590
590
|
}) => {
|
|
591
|
-
const a = e,
|
|
592
|
-
return l === !1 ? null : /* @__PURE__ */ g(
|
|
593
|
-
a.label && /* @__PURE__ */ n(
|
|
594
|
-
/* @__PURE__ */ n(S, { direction: "column", gap: "4", children:
|
|
595
|
-
|
|
591
|
+
const a = e, s = a.elements;
|
|
592
|
+
return l === !1 ? null : /* @__PURE__ */ g(x, { mb: "6", children: [
|
|
593
|
+
a.label && /* @__PURE__ */ n(hr, { size: "3", mb: "3", className: "text-gray-500 uppercase tracking-wide font-semibold", children: a.label }),
|
|
594
|
+
/* @__PURE__ */ n(S, { direction: "column", gap: "4", children: s.map((c, d) => /* @__PURE__ */ n(
|
|
595
|
+
Fe,
|
|
596
596
|
{
|
|
597
597
|
uischema: c,
|
|
598
598
|
schema: t,
|
|
599
599
|
path: r,
|
|
600
|
-
renderers:
|
|
601
|
-
cells:
|
|
602
|
-
enabled:
|
|
600
|
+
renderers: o,
|
|
601
|
+
cells: u,
|
|
602
|
+
enabled: i
|
|
603
603
|
},
|
|
604
|
-
`${r}-${
|
|
604
|
+
`${r}-${d}`
|
|
605
605
|
)) })
|
|
606
606
|
] });
|
|
607
|
-
},
|
|
607
|
+
}, St = q(1, Le("Group")), Ot = ({
|
|
608
608
|
uischema: e,
|
|
609
609
|
schema: t,
|
|
610
610
|
path: r,
|
|
611
|
-
renderers:
|
|
612
|
-
cells:
|
|
613
|
-
enabled:
|
|
611
|
+
renderers: o,
|
|
612
|
+
cells: u,
|
|
613
|
+
enabled: i,
|
|
614
614
|
visible: l = !0
|
|
615
615
|
}) => {
|
|
616
616
|
var p;
|
|
617
|
-
const
|
|
618
|
-
if (l === !1 || !
|
|
619
|
-
const y =
|
|
620
|
-
return /* @__PURE__ */ g(
|
|
621
|
-
/* @__PURE__ */ n(
|
|
622
|
-
/* @__PURE__ */ n(
|
|
623
|
-
|
|
617
|
+
const s = e.elements.filter((m) => m.type === "Category"), [c, d] = $(((p = s[0]) == null ? void 0 : p.label) || "");
|
|
618
|
+
if (l === !1 || !s.length) return null;
|
|
619
|
+
const y = s.find((m) => m.label === c) ? c : s[0].label;
|
|
620
|
+
return /* @__PURE__ */ g($e.Root, { value: y, onValueChange: d, children: [
|
|
621
|
+
/* @__PURE__ */ n($e.List, { children: s.map((m, v) => /* @__PURE__ */ n($e.Trigger, { value: m.label, children: m.label }, `${r}-${v}`)) }),
|
|
622
|
+
/* @__PURE__ */ n(x, { pt: "3", children: s.map((m, v) => /* @__PURE__ */ n($e.Content, { value: m.label, children: /* @__PURE__ */ n(S, { direction: "column", gap: "4", children: m.elements.map((I, A) => /* @__PURE__ */ n(
|
|
623
|
+
Fe,
|
|
624
624
|
{
|
|
625
|
-
uischema:
|
|
625
|
+
uischema: I,
|
|
626
626
|
schema: t,
|
|
627
627
|
path: r,
|
|
628
|
-
renderers:
|
|
629
|
-
cells:
|
|
630
|
-
enabled:
|
|
628
|
+
renderers: o,
|
|
629
|
+
cells: u,
|
|
630
|
+
enabled: i
|
|
631
631
|
},
|
|
632
632
|
`${r}-${v}-${A}`
|
|
633
633
|
)) }) }, `${r}-${v}`)) })
|
|
634
634
|
] });
|
|
635
|
-
},
|
|
636
|
-
function
|
|
635
|
+
}, Nt = q(1, Le("Categorization"));
|
|
636
|
+
function ye(e) {
|
|
637
637
|
return e >= 1024 * 1024 ? `${(e / (1024 * 1024)).toFixed(0)} MB` : e >= 1024 ? `${(e / 1024).toFixed(0)} KB` : `${e} B`;
|
|
638
638
|
}
|
|
639
|
-
function
|
|
639
|
+
function ve(e) {
|
|
640
640
|
return e.split(",").map((t) => {
|
|
641
641
|
if (t = t.trim(), t.endsWith("/*"))
|
|
642
642
|
return t.split("/")[0].toUpperCase() + "S";
|
|
@@ -646,109 +646,109 @@ function ge(e) {
|
|
|
646
646
|
return r ? r.toUpperCase() : t;
|
|
647
647
|
}).join(", ");
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function xt(e) {
|
|
650
650
|
return e ? Array.isArray(e) ? e : [e] : [];
|
|
651
651
|
}
|
|
652
|
-
const
|
|
652
|
+
const It = ({
|
|
653
653
|
data: e,
|
|
654
654
|
handleChange: t,
|
|
655
655
|
path: r,
|
|
656
|
-
label:
|
|
657
|
-
required:
|
|
658
|
-
uischema:
|
|
656
|
+
label: o,
|
|
657
|
+
required: u,
|
|
658
|
+
uischema: i,
|
|
659
659
|
schema: l,
|
|
660
660
|
enabled: a,
|
|
661
|
-
errors:
|
|
661
|
+
errors: s,
|
|
662
662
|
visible: c = !0
|
|
663
663
|
}) => {
|
|
664
|
-
const
|
|
665
|
-
|
|
666
|
-
const y = !
|
|
667
|
-
|
|
668
|
-
|
|
664
|
+
const d = Yr();
|
|
665
|
+
be(c, r, t, null);
|
|
666
|
+
const y = !s || s.length === 0, p = (l == null ? void 0 : l["x-file"]) ?? {}, m = (i == null ? void 0 : i.options) ?? {}, v = p.maxFiles ?? m.maxFiles ?? 1, I = p.maxSize ?? m.maxSize ?? 5 * 1024 * 1024, A = p.accept ?? m.accept ?? "image/*,application/pdf", b = v > 1, k = a !== !1, [F, z] = $(!1), [w, _] = $(null), [V, O] = $({}), C = pe(/* @__PURE__ */ new Set()), H = pe(null), B = xt(e), W = B.length >= v;
|
|
667
|
+
ge(() => () => {
|
|
668
|
+
C.current.forEach((f) => URL.revokeObjectURL(f)), C.current.clear();
|
|
669
669
|
}, []);
|
|
670
|
-
const
|
|
671
|
-
async (
|
|
672
|
-
if (
|
|
673
|
-
|
|
670
|
+
const j = ke(
|
|
671
|
+
async (f) => {
|
|
672
|
+
if (_(null), B.length >= v) {
|
|
673
|
+
_(`Maximum ${v} file${v > 1 ? "s" : ""} allowed.`);
|
|
674
674
|
return;
|
|
675
675
|
}
|
|
676
|
-
if (
|
|
677
|
-
|
|
676
|
+
if (f.size > I) {
|
|
677
|
+
_(`File exceeds the ${ye(I)} limit.`);
|
|
678
678
|
return;
|
|
679
679
|
}
|
|
680
|
-
if (!A.split(",").map((
|
|
681
|
-
|
|
680
|
+
if (!A.split(",").map((N) => N.trim()).some((N) => N === "*" || N === "*/*" ? !0 : N.endsWith("/*") ? f.type.startsWith(N.slice(0, -1)) : N.startsWith(".") ? f.name.toLowerCase().endsWith(N.toLowerCase()) : f.type === N)) {
|
|
681
|
+
_(`Invalid type. Accepted: ${ve(A)}`);
|
|
682
682
|
return;
|
|
683
683
|
}
|
|
684
|
-
if (!(
|
|
685
|
-
|
|
684
|
+
if (!(d != null && d.onUpload)) {
|
|
685
|
+
_("Upload service not configured.");
|
|
686
686
|
return;
|
|
687
687
|
}
|
|
688
688
|
try {
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
const
|
|
692
|
-
|
|
693
|
-
const
|
|
694
|
-
t(r,
|
|
689
|
+
const N = await d.onUpload(f), U = URL.createObjectURL(f);
|
|
690
|
+
C.current.add(U);
|
|
691
|
+
const Z = { key: N.key, name: N.name ?? f.name, blobUrl: U };
|
|
692
|
+
O((J) => ({ ...J, [N.key]: Z }));
|
|
693
|
+
const ie = [...B, N.key];
|
|
694
|
+
t(r, b ? ie : ie[0]);
|
|
695
695
|
} catch {
|
|
696
|
-
|
|
696
|
+
_("Upload failed. Please try again."), H.current && (H.current.value = "");
|
|
697
697
|
}
|
|
698
698
|
},
|
|
699
|
-
[
|
|
699
|
+
[B, v, I, A, d, r, t, b]
|
|
700
700
|
);
|
|
701
701
|
if (c === !1)
|
|
702
702
|
return null;
|
|
703
|
-
const
|
|
704
|
-
|
|
705
|
-
},
|
|
706
|
-
var
|
|
707
|
-
|
|
708
|
-
},
|
|
709
|
-
var
|
|
710
|
-
(
|
|
711
|
-
},
|
|
712
|
-
if (!
|
|
713
|
-
|
|
714
|
-
var
|
|
715
|
-
const
|
|
716
|
-
return
|
|
703
|
+
const ee = (f) => {
|
|
704
|
+
f.preventDefault(), f.stopPropagation(), !(!k || W) && z(f.type === "dragenter" || f.type === "dragover");
|
|
705
|
+
}, re = (f) => {
|
|
706
|
+
var T;
|
|
707
|
+
f.preventDefault(), f.stopPropagation(), z(!1), !(!k || W) && (T = f.dataTransfer.files) != null && T[0] && j(f.dataTransfer.files[0]);
|
|
708
|
+
}, le = (f) => {
|
|
709
|
+
var T;
|
|
710
|
+
(T = f.target.files) != null && T[0] && (j(f.target.files[0]), f.target.value = "");
|
|
711
|
+
}, oe = (f) => {
|
|
712
|
+
if (!k) return;
|
|
713
|
+
O((K) => {
|
|
714
|
+
var Z;
|
|
715
|
+
const N = { ...K }, U = (Z = N[f]) == null ? void 0 : Z.blobUrl;
|
|
716
|
+
return U && (URL.revokeObjectURL(U), C.current.delete(U)), delete N[f], N;
|
|
717
717
|
});
|
|
718
|
-
const
|
|
719
|
-
t(r,
|
|
720
|
-
},
|
|
721
|
-
var
|
|
722
|
-
|
|
723
|
-
const
|
|
724
|
-
if (
|
|
725
|
-
(
|
|
718
|
+
const T = B.filter((K) => K !== f);
|
|
719
|
+
t(r, b ? T.length > 0 ? T : null : T[0] ?? null);
|
|
720
|
+
}, se = async (f, T) => {
|
|
721
|
+
var U, Z, ie;
|
|
722
|
+
f.preventDefault();
|
|
723
|
+
const K = (U = V[T]) == null ? void 0 : U.blobUrl;
|
|
724
|
+
if (K) {
|
|
725
|
+
(Z = window.open(K, "_blank", "noopener,noreferrer")) == null || Z.focus();
|
|
726
726
|
return;
|
|
727
727
|
}
|
|
728
|
-
const
|
|
729
|
-
if (
|
|
728
|
+
const N = window.open("", "_blank");
|
|
729
|
+
if (N)
|
|
730
730
|
try {
|
|
731
|
-
const
|
|
732
|
-
|
|
731
|
+
const J = await ((ie = d == null ? void 0 : d.getDownloadUrl) == null ? void 0 : ie.call(d, T));
|
|
732
|
+
J != null && J.url ? N.location.href = J.url : N.close();
|
|
733
733
|
} catch {
|
|
734
|
-
|
|
734
|
+
N.close();
|
|
735
735
|
}
|
|
736
736
|
};
|
|
737
|
-
if (!
|
|
738
|
-
const
|
|
739
|
-
return /* @__PURE__ */ g(
|
|
737
|
+
if (!k && B.length === 0) return null;
|
|
738
|
+
const de = v - B.length, G = k && !W;
|
|
739
|
+
return /* @__PURE__ */ g(x, { mb: "4", children: [
|
|
740
740
|
/* @__PURE__ */ g(S, { align: "center", justify: "between", mb: "2", children: [
|
|
741
741
|
/* @__PURE__ */ g(h, { as: "label", size: "2", weight: "bold", children: [
|
|
742
|
-
|
|
743
|
-
|
|
742
|
+
o,
|
|
743
|
+
u && /* @__PURE__ */ n(h, { color: "red", children: " *" })
|
|
744
744
|
] }),
|
|
745
|
-
/* @__PURE__ */ n(h, { size: "1", color: "gray", children:
|
|
745
|
+
/* @__PURE__ */ n(h, { size: "1", color: "gray", children: b ? `Up to ${v} files · ${ye(I)} each · ${ve(A)}` : `${ye(I)} · ${ve(A)}` })
|
|
746
746
|
] }),
|
|
747
|
-
|
|
748
|
-
var
|
|
749
|
-
return /* @__PURE__ */ n(
|
|
747
|
+
B.map((f) => {
|
|
748
|
+
var T;
|
|
749
|
+
return /* @__PURE__ */ n(pr, { size: "2", variant: "surface", mb: "2", children: /* @__PURE__ */ g(S, { align: "center", gap: "3", children: [
|
|
750
750
|
/* @__PURE__ */ n(
|
|
751
|
-
|
|
751
|
+
x,
|
|
752
752
|
{
|
|
753
753
|
style: {
|
|
754
754
|
background: "var(--blue-3)",
|
|
@@ -757,10 +757,10 @@ const Ct = ({
|
|
|
757
757
|
color: "var(--blue-9)",
|
|
758
758
|
flexShrink: 0
|
|
759
759
|
},
|
|
760
|
-
children: /* @__PURE__ */ n(
|
|
760
|
+
children: /* @__PURE__ */ n(Hr, { width: "20", height: "20" })
|
|
761
761
|
}
|
|
762
762
|
),
|
|
763
|
-
/* @__PURE__ */ n(
|
|
763
|
+
/* @__PURE__ */ n(x, { style: { flex: 1, overflow: "hidden" }, children: /* @__PURE__ */ n(
|
|
764
764
|
h,
|
|
765
765
|
{
|
|
766
766
|
size: "2",
|
|
@@ -771,68 +771,68 @@ const Ct = ({
|
|
|
771
771
|
textOverflow: "ellipsis",
|
|
772
772
|
whiteSpace: "nowrap"
|
|
773
773
|
},
|
|
774
|
-
children: ((
|
|
774
|
+
children: ((T = V[f]) == null ? void 0 : T.name) ?? "Uploaded File"
|
|
775
775
|
}
|
|
776
776
|
) }),
|
|
777
777
|
/* @__PURE__ */ g(S, { align: "center", gap: "2", style: { flexShrink: 0 }, children: [
|
|
778
|
-
/* @__PURE__ */ n(
|
|
779
|
-
/* @__PURE__ */ n(
|
|
780
|
-
|
|
778
|
+
/* @__PURE__ */ n(De, { variant: "soft", color: "blue", size: "1", onClick: (K) => se(K, f), children: "View" }),
|
|
779
|
+
/* @__PURE__ */ n(Wr, { style: { color: "var(--green-9)", width: 18, height: 18 } }),
|
|
780
|
+
k && /* @__PURE__ */ n(Me, { variant: "ghost", color: "gray", onClick: () => oe(f), children: /* @__PURE__ */ n(Ye, {}) })
|
|
781
781
|
] })
|
|
782
|
-
] }) },
|
|
782
|
+
] }) }, f);
|
|
783
783
|
}),
|
|
784
|
-
|
|
784
|
+
G && /* @__PURE__ */ g(
|
|
785
785
|
"div",
|
|
786
786
|
{
|
|
787
787
|
role: "button",
|
|
788
788
|
tabIndex: 0,
|
|
789
789
|
onClick: () => {
|
|
790
|
-
var
|
|
791
|
-
return (
|
|
790
|
+
var f;
|
|
791
|
+
return (f = H.current) == null ? void 0 : f.click();
|
|
792
792
|
},
|
|
793
|
-
onKeyDown: (
|
|
794
|
-
var
|
|
795
|
-
(
|
|
793
|
+
onKeyDown: (f) => {
|
|
794
|
+
var T;
|
|
795
|
+
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), (T = H.current) == null || T.click());
|
|
796
796
|
},
|
|
797
|
-
onDragEnter:
|
|
798
|
-
onDragLeave:
|
|
799
|
-
onDragOver:
|
|
800
|
-
onDrop:
|
|
797
|
+
onDragEnter: ee,
|
|
798
|
+
onDragLeave: ee,
|
|
799
|
+
onDragOver: ee,
|
|
800
|
+
onDrop: re,
|
|
801
801
|
style: { cursor: "pointer" },
|
|
802
802
|
className: [
|
|
803
803
|
"border-2 border-dashed rounded-lg p-6 text-center",
|
|
804
804
|
"transition-all duration-200 ease-in-out",
|
|
805
|
-
|
|
805
|
+
F ? "border-blue-500 bg-blue-50" : w ? "border-red-300 bg-red-50" : "border-gray-300 hover:border-blue-400 hover:bg-gray-50"
|
|
806
806
|
].join(" "),
|
|
807
807
|
children: [
|
|
808
|
-
/* @__PURE__ */ n("input", { ref:
|
|
809
|
-
/* @__PURE__ */ n(S, { direction: "column", align: "center", gap: "2", children:
|
|
810
|
-
/* @__PURE__ */ n(
|
|
811
|
-
/* @__PURE__ */ n(h, { size: "2", color: "red", weight: "medium", children:
|
|
808
|
+
/* @__PURE__ */ n("input", { ref: H, type: "file", style: { display: "none" }, accept: A, onChange: le }),
|
|
809
|
+
/* @__PURE__ */ n(S, { direction: "column", align: "center", gap: "2", children: w ? /* @__PURE__ */ g(he, { children: [
|
|
810
|
+
/* @__PURE__ */ n(Je, { style: { width: 32, height: 32, color: "var(--red-9)" } }),
|
|
811
|
+
/* @__PURE__ */ n(h, { size: "2", color: "red", weight: "medium", children: w }),
|
|
812
812
|
/* @__PURE__ */ n(h, { size: "1", color: "gray", children: "Click to try again" })
|
|
813
|
-
] }) : /* @__PURE__ */ g(
|
|
814
|
-
/* @__PURE__ */ n(
|
|
815
|
-
/* @__PURE__ */ n(h, { size: "2", weight: "medium", children:
|
|
813
|
+
] }) : /* @__PURE__ */ g(he, { children: [
|
|
814
|
+
/* @__PURE__ */ n(Ne, { style: { width: 32, height: 32, color: "var(--gray-8)" } }),
|
|
815
|
+
/* @__PURE__ */ n(h, { size: "2", weight: "medium", children: B.length > 0 ? `Add another file (${de} remaining)` : "Click to upload or drag and drop" }),
|
|
816
816
|
/* @__PURE__ */ g(h, { size: "1", color: "gray", children: [
|
|
817
|
-
|
|
817
|
+
ye(I),
|
|
818
818
|
" max · ",
|
|
819
|
-
|
|
819
|
+
ve(A)
|
|
820
820
|
] })
|
|
821
821
|
] }) })
|
|
822
822
|
]
|
|
823
823
|
}
|
|
824
824
|
),
|
|
825
|
-
|
|
825
|
+
k && W && b && /* @__PURE__ */ g(h, { size: "1", color: "gray", mt: "1", style: { display: "block", textAlign: "center" }, children: [
|
|
826
826
|
"Maximum ",
|
|
827
827
|
v,
|
|
828
828
|
" files uploaded. Remove one to replace it."
|
|
829
829
|
] }),
|
|
830
|
-
!y && /* @__PURE__ */ n(h, { color: "red", size: "1", mt: "2", style: { display: "block" }, children:
|
|
830
|
+
!y && /* @__PURE__ */ n(h, { color: "red", size: "1", mt: "2", style: { display: "block" }, children: we(s, o) })
|
|
831
831
|
] });
|
|
832
|
-
},
|
|
832
|
+
}, kt = me(It), Dt = q(
|
|
833
833
|
10,
|
|
834
834
|
// high rank to beat default array renderer
|
|
835
|
-
|
|
835
|
+
Mr(
|
|
836
836
|
// Match both single-file (type: string) and multi-file (type: array)
|
|
837
837
|
ze((e) => {
|
|
838
838
|
if (e.type === "string" && e.format === "file") return !0;
|
|
@@ -844,42 +844,42 @@ const Ct = ({
|
|
|
844
844
|
})
|
|
845
845
|
)
|
|
846
846
|
);
|
|
847
|
-
function
|
|
847
|
+
function yr(e, t) {
|
|
848
848
|
return e !== !1 && t !== !0;
|
|
849
849
|
}
|
|
850
|
-
class
|
|
850
|
+
class Ke extends Error {
|
|
851
851
|
}
|
|
852
|
-
function
|
|
853
|
-
const r =
|
|
852
|
+
function Mt(e, t) {
|
|
853
|
+
const r = Kr(e, { type: "array", cellDates: !0 });
|
|
854
854
|
if (r.SheetNames.length === 0)
|
|
855
|
-
throw new
|
|
856
|
-
const
|
|
857
|
-
if (!
|
|
858
|
-
throw new
|
|
859
|
-
const
|
|
855
|
+
throw new Ke("This file has no sheets.");
|
|
856
|
+
const o = t ?? r.SheetNames[0], u = r.Sheets[o];
|
|
857
|
+
if (!u)
|
|
858
|
+
throw new Ke(`This file doesn't have a sheet named "${o}".`);
|
|
859
|
+
const i = Gr.sheet_to_json(u, { header: 1, raw: !0, defval: null });
|
|
860
860
|
return {
|
|
861
|
-
sheetName:
|
|
862
|
-
matrix:
|
|
863
|
-
rowCount:
|
|
864
|
-
colCount: Math.max(0, ...
|
|
861
|
+
sheetName: o,
|
|
862
|
+
matrix: i,
|
|
863
|
+
rowCount: i.length,
|
|
864
|
+
colCount: Math.max(0, ...i.map((l) => l.length))
|
|
865
865
|
};
|
|
866
866
|
}
|
|
867
|
-
function
|
|
867
|
+
function zt(e) {
|
|
868
868
|
let t = e + 1, r = "";
|
|
869
869
|
for (; t > 0; ) {
|
|
870
|
-
const
|
|
871
|
-
r = String.fromCharCode(65 +
|
|
870
|
+
const o = (t - 1) % 26;
|
|
871
|
+
r = String.fromCharCode(65 + o) + r, t = Math.floor((t - 1) / 26);
|
|
872
872
|
}
|
|
873
873
|
return r;
|
|
874
874
|
}
|
|
875
|
-
class
|
|
876
|
-
constructor(r,
|
|
877
|
-
super(
|
|
878
|
-
|
|
875
|
+
class ne extends Error {
|
|
876
|
+
constructor(r, o) {
|
|
877
|
+
super(o ?? r);
|
|
878
|
+
Ze(this, "code");
|
|
879
879
|
this.code = r, this.name = "FormulaError";
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
|
-
const
|
|
882
|
+
const Lt = [
|
|
883
883
|
// Logical
|
|
884
884
|
// IF is excluded here even though its native body is real, non-stub code —
|
|
885
885
|
// see LOGICAL_FUNCTIONS_WITH_BROKEN_CONDITION_COERCION below for why it's
|
|
@@ -905,7 +905,7 @@ const It = [
|
|
|
905
905
|
// DATE_FUNCTIONS_WITH_BROKEN_NATIVE_IMPL.
|
|
906
906
|
"DATE",
|
|
907
907
|
"TODAY"
|
|
908
|
-
],
|
|
908
|
+
], Ft = [
|
|
909
909
|
"MAX",
|
|
910
910
|
"MIN",
|
|
911
911
|
"MAXA",
|
|
@@ -924,7 +924,7 @@ const It = [
|
|
|
924
924
|
"COUNTA",
|
|
925
925
|
// not present in fast-formula-parser's function table at all.
|
|
926
926
|
"UPPER"
|
|
927
|
-
],
|
|
927
|
+
], Ut = ["YEAR", "MONTH", "DAY", "WEEKDAY"], Pt = ["IF"], $t = [
|
|
928
928
|
"CONCATENATE",
|
|
929
929
|
"CONCAT",
|
|
930
930
|
"LEN",
|
|
@@ -935,113 +935,113 @@ const It = [
|
|
|
935
935
|
"MID",
|
|
936
936
|
"FIND",
|
|
937
937
|
"SEARCH"
|
|
938
|
-
],
|
|
939
|
-
...It,
|
|
940
|
-
...xt,
|
|
941
|
-
...Mt,
|
|
938
|
+
], _t = /* @__PURE__ */ new Set([
|
|
942
939
|
...Lt,
|
|
943
|
-
...
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
940
|
+
...Ft,
|
|
941
|
+
...Ut,
|
|
942
|
+
...$t,
|
|
943
|
+
...Pt
|
|
944
|
+
]), Vt = /"(?:[^"]|"")*"/g, er = new RegExp("(?<![A-Za-z0-9_.])([A-Za-z_][A-Za-z0-9_.]*)\\s*\\(", "g");
|
|
945
|
+
function Ht(e) {
|
|
946
|
+
const t = e.replace(Vt, (o) => " ".repeat(o.length));
|
|
947
|
+
er.lastIndex = 0;
|
|
948
948
|
let r;
|
|
949
|
-
for (; (r =
|
|
950
|
-
const
|
|
951
|
-
if (!
|
|
952
|
-
throw new
|
|
949
|
+
for (; (r = er.exec(t)) !== null; ) {
|
|
950
|
+
const o = r[1].toUpperCase();
|
|
951
|
+
if (!_t.has(o))
|
|
952
|
+
throw new ne("NAME", `Function ${o} is not allowed.`);
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
|
-
function
|
|
956
|
-
let
|
|
957
|
-
if (
|
|
958
|
-
if (typeof
|
|
959
|
-
if (typeof
|
|
960
|
-
if (typeof
|
|
955
|
+
function Wt(e, t, r) {
|
|
956
|
+
let o = e;
|
|
957
|
+
if (o == null) throw r.NA;
|
|
958
|
+
if (typeof o == "object" && !(o instanceof r) && (o = t.retrieveRef(o)), o instanceof r) throw o;
|
|
959
|
+
if (typeof o == "boolean") return o;
|
|
960
|
+
if (typeof o == "number") return o !== 0;
|
|
961
961
|
throw r.VALUE;
|
|
962
962
|
}
|
|
963
|
-
function
|
|
963
|
+
function vr(e) {
|
|
964
964
|
return e !== null && typeof e == "object" && "value" in e ? e.value : e;
|
|
965
965
|
}
|
|
966
|
-
function
|
|
967
|
-
const t =
|
|
966
|
+
function Ce(e) {
|
|
967
|
+
const t = vr(e);
|
|
968
968
|
return Array.isArray(t) ? t.flat(1 / 0) : [t];
|
|
969
969
|
}
|
|
970
|
-
function
|
|
971
|
-
const t =
|
|
970
|
+
function M(e) {
|
|
971
|
+
const t = vr(e);
|
|
972
972
|
return Array.isArray(t) ? t.flat(1 / 0)[0] : t;
|
|
973
973
|
}
|
|
974
|
-
function
|
|
975
|
-
return e === void 0 ? void 0 :
|
|
974
|
+
function _e(e) {
|
|
975
|
+
return e === void 0 ? void 0 : M(e);
|
|
976
976
|
}
|
|
977
|
-
function
|
|
977
|
+
function te(e) {
|
|
978
978
|
return e == null || e === "" ? "" : typeof e == "boolean" ? e ? "TRUE" : "FALSE" : e instanceof Date ? e.toLocaleDateString() : String(e);
|
|
979
979
|
}
|
|
980
|
-
function
|
|
980
|
+
function Xt(e, t) {
|
|
981
981
|
return e instanceof t ? e : new t(e.message || "#ERROR!");
|
|
982
982
|
}
|
|
983
|
-
function
|
|
983
|
+
function Y(e) {
|
|
984
984
|
return e.find((t) => t instanceof Error);
|
|
985
985
|
}
|
|
986
|
-
function
|
|
987
|
-
const r = (
|
|
988
|
-
throw
|
|
989
|
-
},
|
|
990
|
-
const
|
|
986
|
+
function Bt(e, t) {
|
|
987
|
+
const r = (i) => {
|
|
988
|
+
throw Xt(i, t);
|
|
989
|
+
}, o = (i, { checkArgsForErrors: l = !0 } = {}) => (...a) => {
|
|
990
|
+
const s = a.flatMap(Ce);
|
|
991
991
|
if (l) {
|
|
992
|
-
const
|
|
993
|
-
|
|
992
|
+
const d = Y(s);
|
|
993
|
+
d && r(d);
|
|
994
994
|
}
|
|
995
|
-
const c =
|
|
995
|
+
const c = i(...s);
|
|
996
996
|
return c instanceof Error ? r(c) : c;
|
|
997
|
-
},
|
|
998
|
-
const
|
|
997
|
+
}, u = (i, { toText: l = !1 } = {}) => (a) => {
|
|
998
|
+
const s = M(a), c = Y([s]);
|
|
999
999
|
c && r(c);
|
|
1000
|
-
const
|
|
1001
|
-
return
|
|
1000
|
+
const d = i(l ? te(s) : s);
|
|
1001
|
+
return d instanceof Error ? r(d) : d;
|
|
1002
1002
|
};
|
|
1003
1003
|
return {
|
|
1004
1004
|
// valueIfTrue/valueIfFalse are passed through unretrieved (not
|
|
1005
1005
|
// dereferenced or type-checked here) — that's what makes
|
|
1006
1006
|
// `IF(FALSE, B100, 99)` a genuine short-circuit rather than a lookup.
|
|
1007
|
-
IF: (
|
|
1008
|
-
const c =
|
|
1007
|
+
IF: (i, l, a, s) => {
|
|
1008
|
+
const c = Wt(l, i, t);
|
|
1009
1009
|
if (a == null) throw t.NA;
|
|
1010
|
-
return c ? a :
|
|
1010
|
+
return c ? a : s ?? !1;
|
|
1011
1011
|
},
|
|
1012
1012
|
// Empty input -> 0, matching both the hand-rolled engine this replaces
|
|
1013
1013
|
// and formulajs's own convention for MAX/MIN.
|
|
1014
|
-
MAX:
|
|
1015
|
-
MIN:
|
|
1016
|
-
MAXA:
|
|
1017
|
-
MINA:
|
|
1018
|
-
MEDIAN:
|
|
1014
|
+
MAX: o(e.MAX),
|
|
1015
|
+
MIN: o(e.MIN),
|
|
1016
|
+
MAXA: o(e.MAXA),
|
|
1017
|
+
MINA: o(e.MINA),
|
|
1018
|
+
MEDIAN: o(e.MEDIAN),
|
|
1019
1019
|
// COUNTA counts non-blank entries; an error value among the args is
|
|
1020
1020
|
// itself non-blank and gets counted (matching formulajs's own COUNTA,
|
|
1021
1021
|
// which never checks for errors), so this skips the error propagation
|
|
1022
1022
|
// the other aggregates use.
|
|
1023
|
-
COUNTA:
|
|
1024
|
-
LARGE: (
|
|
1025
|
-
const a =
|
|
1023
|
+
COUNTA: o(e.COUNTA, { checkArgsForErrors: !1 }),
|
|
1024
|
+
LARGE: (i, l) => {
|
|
1025
|
+
const a = Ce(i), s = M(l), c = Y([...a, s]);
|
|
1026
1026
|
c && r(c);
|
|
1027
|
-
const
|
|
1028
|
-
return
|
|
1027
|
+
const d = e.LARGE(a, s);
|
|
1028
|
+
return d instanceof Error ? r(d) : d;
|
|
1029
1029
|
},
|
|
1030
|
-
SMALL: (
|
|
1031
|
-
const a =
|
|
1030
|
+
SMALL: (i, l) => {
|
|
1031
|
+
const a = Ce(i), s = M(l), c = Y([...a, s]);
|
|
1032
1032
|
c && r(c);
|
|
1033
|
-
const
|
|
1034
|
-
return
|
|
1033
|
+
const d = e.SMALL(a, s);
|
|
1034
|
+
return d instanceof Error ? r(d) : d;
|
|
1035
1035
|
},
|
|
1036
|
-
PERMUT: (
|
|
1037
|
-
const a = [
|
|
1038
|
-
|
|
1036
|
+
PERMUT: (i, l) => {
|
|
1037
|
+
const a = [M(i), M(l)], s = Y(a);
|
|
1038
|
+
s && r(s);
|
|
1039
1039
|
const c = e.PERMUT(a[0], a[1]);
|
|
1040
1040
|
return c instanceof Error ? r(c) : c;
|
|
1041
1041
|
},
|
|
1042
|
-
PERMUTATIONA: (
|
|
1043
|
-
const a = [
|
|
1044
|
-
|
|
1042
|
+
PERMUTATIONA: (i, l) => {
|
|
1043
|
+
const a = [M(i), M(l)], s = Y(a);
|
|
1044
|
+
s && r(s);
|
|
1045
1045
|
const c = e.PERMUTATIONA(a[0], a[1]);
|
|
1046
1046
|
return c instanceof Error ? r(c) : c;
|
|
1047
1047
|
},
|
|
@@ -1051,43 +1051,43 @@ function $t(e, t) {
|
|
|
1051
1051
|
// Excel's own default too) risks silently mis-ranking unsorted
|
|
1052
1052
|
// real-world data. Same scope decision as the hand-rolled engine this
|
|
1053
1053
|
// replaces, carried forward deliberately rather than dropped.
|
|
1054
|
-
MATCH: (
|
|
1055
|
-
const a =
|
|
1054
|
+
MATCH: (i, l) => {
|
|
1055
|
+
const a = M(i), s = Ce(l), c = Y([a, ...s]);
|
|
1056
1056
|
c && r(c);
|
|
1057
|
-
const
|
|
1058
|
-
return
|
|
1057
|
+
const d = e.MATCH(a, s, 0);
|
|
1058
|
+
return d instanceof Error ? r(d) : d;
|
|
1059
1059
|
},
|
|
1060
|
-
SWITCH: (...
|
|
1061
|
-
const l =
|
|
1060
|
+
SWITCH: (...i) => {
|
|
1061
|
+
const l = i.map(M), a = Y(l);
|
|
1062
1062
|
a && r(a);
|
|
1063
|
-
const
|
|
1064
|
-
return
|
|
1063
|
+
const s = e.SWITCH(...l);
|
|
1064
|
+
return s instanceof Error ? r(s) : s;
|
|
1065
1065
|
},
|
|
1066
|
-
SUBSTITUTE: (
|
|
1067
|
-
const c = [
|
|
1068
|
-
|
|
1069
|
-
const
|
|
1070
|
-
|
|
1066
|
+
SUBSTITUTE: (i, l, a, s) => {
|
|
1067
|
+
const c = [te(M(i)), te(M(l)), te(M(a))];
|
|
1068
|
+
s !== void 0 && c.push(M(s));
|
|
1069
|
+
const d = Y(c);
|
|
1070
|
+
d && r(d);
|
|
1071
1071
|
const y = e.SUBSTITUTE(...c);
|
|
1072
1072
|
return y instanceof Error ? r(y) : y;
|
|
1073
1073
|
},
|
|
1074
|
-
TEXTJOIN: (
|
|
1075
|
-
const
|
|
1074
|
+
TEXTJOIN: (i, l, ...a) => {
|
|
1075
|
+
const s = te(M(i)), c = M(l), d = a.flatMap(Ce).map(te), y = Y([s, c]);
|
|
1076
1076
|
y && r(y);
|
|
1077
|
-
const p = e.TEXTJOIN(
|
|
1077
|
+
const p = e.TEXTJOIN(s, c, d);
|
|
1078
1078
|
return p instanceof Error ? r(p) : p;
|
|
1079
1079
|
},
|
|
1080
|
-
UPPER:
|
|
1080
|
+
UPPER: u(e.UPPER),
|
|
1081
1081
|
// See DATE_FUNCTIONS_WITH_BROKEN_NATIVE_IMPL above for why these override
|
|
1082
1082
|
// fast-formula-parser's own (real, but broken-for-Date-cells) versions.
|
|
1083
|
-
YEAR:
|
|
1084
|
-
MONTH:
|
|
1085
|
-
DAY:
|
|
1086
|
-
WEEKDAY: (
|
|
1087
|
-
const a =
|
|
1083
|
+
YEAR: u(e.YEAR),
|
|
1084
|
+
MONTH: u(e.MONTH),
|
|
1085
|
+
DAY: u(e.DAY),
|
|
1086
|
+
WEEKDAY: (i, l) => {
|
|
1087
|
+
const a = M(i), s = M(l), c = Y([a]);
|
|
1088
1088
|
c && r(c);
|
|
1089
|
-
const
|
|
1090
|
-
return
|
|
1089
|
+
const d = e.WEEKDAY(a, s);
|
|
1090
|
+
return d instanceof Error ? r(d) : d;
|
|
1091
1091
|
},
|
|
1092
1092
|
// See TEXT_FUNCTIONS_BROKEN_FOR_BLANK_CELLS above: these override fast-
|
|
1093
1093
|
// formula-parser's own (real, but broken-for-a-bare-blank-cell) versions.
|
|
@@ -1098,54 +1098,54 @@ function $t(e, t) {
|
|
|
1098
1098
|
// Flattens every argument (a whole range included) and joins with no
|
|
1099
1099
|
// separator, matching Excel's own range-argument behavior — the native
|
|
1100
1100
|
// implementation instead inserts stray commas for a whole-range argument.
|
|
1101
|
-
CONCATENATE: (...
|
|
1102
|
-
const l =
|
|
1101
|
+
CONCATENATE: (...i) => {
|
|
1102
|
+
const l = i.flatMap(Ce), a = Y(l);
|
|
1103
1103
|
a && r(a);
|
|
1104
|
-
const
|
|
1105
|
-
return
|
|
1104
|
+
const s = e.CONCATENATE(...l.map(te));
|
|
1105
|
+
return s instanceof Error ? r(s) : s;
|
|
1106
1106
|
},
|
|
1107
|
-
CONCAT: (...
|
|
1108
|
-
const l =
|
|
1107
|
+
CONCAT: (...i) => {
|
|
1108
|
+
const l = i.flatMap(Ce), a = Y(l);
|
|
1109
1109
|
a && r(a);
|
|
1110
|
-
const
|
|
1111
|
-
return
|
|
1110
|
+
const s = e.CONCAT(...l.map(te));
|
|
1111
|
+
return s instanceof Error ? r(s) : s;
|
|
1112
1112
|
},
|
|
1113
|
-
LEN:
|
|
1114
|
-
TRIM:
|
|
1115
|
-
LOWER:
|
|
1116
|
-
LEFT: (
|
|
1117
|
-
const a =
|
|
1113
|
+
LEN: u(e.LEN, { toText: !0 }),
|
|
1114
|
+
TRIM: u(e.TRIM, { toText: !0 }),
|
|
1115
|
+
LOWER: u(e.LOWER, { toText: !0 }),
|
|
1116
|
+
LEFT: (i, l) => {
|
|
1117
|
+
const a = M(i), s = _e(l), c = Y([a]);
|
|
1118
1118
|
c && r(c);
|
|
1119
|
-
const
|
|
1120
|
-
return
|
|
1119
|
+
const d = e.LEFT(te(a), s);
|
|
1120
|
+
return d instanceof Error ? r(d) : d;
|
|
1121
1121
|
},
|
|
1122
|
-
RIGHT: (
|
|
1123
|
-
const a =
|
|
1122
|
+
RIGHT: (i, l) => {
|
|
1123
|
+
const a = M(i), s = _e(l), c = Y([a]);
|
|
1124
1124
|
c && r(c);
|
|
1125
|
-
const
|
|
1126
|
-
return
|
|
1125
|
+
const d = e.RIGHT(te(a), s);
|
|
1126
|
+
return d instanceof Error ? r(d) : d;
|
|
1127
1127
|
},
|
|
1128
|
-
MID: (
|
|
1129
|
-
const
|
|
1128
|
+
MID: (i, l, a) => {
|
|
1129
|
+
const s = M(i), c = M(l), d = M(a), y = Y([s, c, d]);
|
|
1130
1130
|
y && r(y);
|
|
1131
|
-
const p = e.MID(
|
|
1131
|
+
const p = e.MID(te(s), c, d);
|
|
1132
1132
|
return p instanceof Error ? r(p) : p;
|
|
1133
1133
|
},
|
|
1134
|
-
FIND: (
|
|
1135
|
-
const
|
|
1134
|
+
FIND: (i, l, a) => {
|
|
1135
|
+
const s = M(i), c = M(l), d = _e(a), y = Y([s, c]);
|
|
1136
1136
|
y && r(y);
|
|
1137
|
-
const p = e.FIND(
|
|
1137
|
+
const p = e.FIND(te(s), te(c), d);
|
|
1138
1138
|
return p instanceof Error ? r(p) : p;
|
|
1139
1139
|
},
|
|
1140
|
-
SEARCH: (
|
|
1141
|
-
const
|
|
1140
|
+
SEARCH: (i, l, a) => {
|
|
1141
|
+
const s = M(i), c = M(l), d = _e(a), y = Y([s, c]);
|
|
1142
1142
|
y && r(y);
|
|
1143
|
-
const p = e.SEARCH(
|
|
1143
|
+
const p = e.SEARCH(te(s), te(c), d);
|
|
1144
1144
|
return p instanceof Error ? r(p) : p;
|
|
1145
1145
|
}
|
|
1146
1146
|
};
|
|
1147
1147
|
}
|
|
1148
|
-
const
|
|
1148
|
+
const jt = {
|
|
1149
1149
|
"#REF!": "REF",
|
|
1150
1150
|
"#VALUE!": "VALUE",
|
|
1151
1151
|
"#DIV/0!": "DIV0",
|
|
@@ -1154,100 +1154,100 @@ const _t = {
|
|
|
1154
1154
|
"#NUM!": "NUM",
|
|
1155
1155
|
"#NULL!": "NULL"
|
|
1156
1156
|
};
|
|
1157
|
-
function
|
|
1158
|
-
return
|
|
1157
|
+
function rr(e) {
|
|
1158
|
+
return jt[e.error] ?? "ERROR";
|
|
1159
1159
|
}
|
|
1160
|
-
function
|
|
1161
|
-
if (e instanceof
|
|
1160
|
+
function tr(e, t) {
|
|
1161
|
+
if (e instanceof ne) return e;
|
|
1162
1162
|
if (e instanceof t) {
|
|
1163
1163
|
const r = e.details;
|
|
1164
|
-
return r instanceof
|
|
1164
|
+
return r instanceof ne ? r : r instanceof t ? new ne(rr(r), r.message) : new ne(rr(e), e.message);
|
|
1165
1165
|
}
|
|
1166
|
-
return new
|
|
1166
|
+
return new ne("ERROR", e instanceof Error ? e.message : void 0);
|
|
1167
1167
|
}
|
|
1168
|
-
function
|
|
1168
|
+
function Kt(e) {
|
|
1169
1169
|
return Math.max(0, ...e.map((t) => (t == null ? void 0 : t.length) ?? 0));
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function Gt(e) {
|
|
1172
1172
|
return (t) => {
|
|
1173
1173
|
const r = e[t.row - 1];
|
|
1174
1174
|
if (t.row < 1 || t.col < 1 || r == null || t.col - 1 >= r.length)
|
|
1175
|
-
throw new
|
|
1176
|
-
const
|
|
1177
|
-
return
|
|
1175
|
+
throw new ne("REF");
|
|
1176
|
+
const o = r[t.col - 1];
|
|
1177
|
+
return o == null || o === "" ? null : o;
|
|
1178
1178
|
};
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1180
|
+
function Yt(e) {
|
|
1181
1181
|
return (t) => {
|
|
1182
|
-
const r = Math.min(t.from.row, t.to.row),
|
|
1183
|
-
if (r > e.length ||
|
|
1184
|
-
throw new
|
|
1185
|
-
const a = Math.min(
|
|
1182
|
+
const r = Math.min(t.from.row, t.to.row), o = Math.min(t.from.col, t.to.col), u = Math.max(t.from.row, t.to.row), i = Math.max(t.from.col, t.to.col), l = Kt(e);
|
|
1183
|
+
if (r > e.length || o > l)
|
|
1184
|
+
throw new ne("REF");
|
|
1185
|
+
const a = Math.min(u, e.length), s = [];
|
|
1186
1186
|
for (let c = r; c <= a; c++) {
|
|
1187
|
-
const
|
|
1188
|
-
if (
|
|
1189
|
-
const p = Math.min(
|
|
1190
|
-
for (let m =
|
|
1191
|
-
const v =
|
|
1187
|
+
const d = e[c - 1], y = [];
|
|
1188
|
+
if (d != null) {
|
|
1189
|
+
const p = Math.min(i, d.length);
|
|
1190
|
+
for (let m = o; m <= p; m++) {
|
|
1191
|
+
const v = d[m - 1];
|
|
1192
1192
|
y.push(v == null || v === "" ? null : v);
|
|
1193
1193
|
}
|
|
1194
1194
|
}
|
|
1195
|
-
|
|
1195
|
+
s.push(y);
|
|
1196
1196
|
}
|
|
1197
|
-
return
|
|
1197
|
+
return s;
|
|
1198
1198
|
};
|
|
1199
1199
|
}
|
|
1200
|
-
function
|
|
1200
|
+
function Jt(e) {
|
|
1201
1201
|
if (e == null || e === "") return null;
|
|
1202
1202
|
if (typeof e == "number" || typeof e == "string" || typeof e == "boolean" || e instanceof Date)
|
|
1203
1203
|
return e;
|
|
1204
|
-
throw new
|
|
1204
|
+
throw new ne("VALUE");
|
|
1205
1205
|
}
|
|
1206
|
-
async function
|
|
1207
|
-
if (typeof e != "string") throw new
|
|
1206
|
+
async function br(e, t) {
|
|
1207
|
+
if (typeof e != "string") throw new ne("ERROR");
|
|
1208
1208
|
const r = e.trim();
|
|
1209
|
-
if (r === "") throw new
|
|
1210
|
-
const
|
|
1211
|
-
|
|
1212
|
-
const [
|
|
1209
|
+
if (r === "") throw new ne("ERROR");
|
|
1210
|
+
const o = r.startsWith("=") ? r.slice(1) : r;
|
|
1211
|
+
Ht(o);
|
|
1212
|
+
const [u, i] = await Promise.all([
|
|
1213
1213
|
import("fast-formula-parser"),
|
|
1214
1214
|
import("@formulajs/formulajs")
|
|
1215
|
-
]), l =
|
|
1215
|
+
]), l = u.default ?? u, a = l.FormulaError, s = new l({
|
|
1216
1216
|
...t,
|
|
1217
1217
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- formulajs's own types are all `any`-typed; formulaFunctions.ts narrows the surface it actually calls.
|
|
1218
|
-
functions:
|
|
1218
|
+
functions: Bt(i, a)
|
|
1219
1219
|
});
|
|
1220
1220
|
let c;
|
|
1221
1221
|
try {
|
|
1222
|
-
c =
|
|
1223
|
-
} catch (
|
|
1224
|
-
throw
|
|
1222
|
+
c = s.parse(o, { row: 1, col: 1, sheet: "Sheet1" });
|
|
1223
|
+
} catch (d) {
|
|
1224
|
+
throw tr(d, a);
|
|
1225
1225
|
}
|
|
1226
1226
|
if (c instanceof a)
|
|
1227
|
-
throw
|
|
1228
|
-
return
|
|
1227
|
+
throw tr(c, a);
|
|
1228
|
+
return Jt(c);
|
|
1229
1229
|
}
|
|
1230
|
-
async function
|
|
1231
|
-
return
|
|
1230
|
+
async function qt(e, t) {
|
|
1231
|
+
return br(t, { onCell: Gt(e), onRange: Yt(e) });
|
|
1232
1232
|
}
|
|
1233
|
-
const
|
|
1234
|
-
async function
|
|
1233
|
+
const nr = -1;
|
|
1234
|
+
async function wr(e, t) {
|
|
1235
1235
|
const r = Object.keys(e);
|
|
1236
|
-
return
|
|
1237
|
-
onVariable: (
|
|
1238
|
-
const
|
|
1239
|
-
return
|
|
1236
|
+
return br(t, {
|
|
1237
|
+
onVariable: (o) => {
|
|
1238
|
+
const u = r.indexOf(o);
|
|
1239
|
+
return u === -1 ? null : { row: nr, col: u + 1 };
|
|
1240
1240
|
},
|
|
1241
|
-
onCell: (
|
|
1242
|
-
if (
|
|
1243
|
-
throw new
|
|
1241
|
+
onCell: (o) => {
|
|
1242
|
+
if (o.row === nr) return e[r[o.col - 1]] ?? null;
|
|
1243
|
+
throw new ne("REF");
|
|
1244
1244
|
},
|
|
1245
1245
|
onRange: () => {
|
|
1246
|
-
throw new
|
|
1246
|
+
throw new ne("REF");
|
|
1247
1247
|
}
|
|
1248
1248
|
});
|
|
1249
1249
|
}
|
|
1250
|
-
const
|
|
1250
|
+
const Er = {
|
|
1251
1251
|
REF: "#REF!",
|
|
1252
1252
|
VALUE: "#VALUE!",
|
|
1253
1253
|
DIV0: "#DIV/0!",
|
|
@@ -1257,525 +1257,910 @@ const ur = {
|
|
|
1257
1257
|
NUM: "#NUM!",
|
|
1258
1258
|
NULL: "#NULL!"
|
|
1259
1259
|
};
|
|
1260
|
-
function
|
|
1261
|
-
const t = e instanceof
|
|
1262
|
-
return
|
|
1260
|
+
function qe(e) {
|
|
1261
|
+
const t = e instanceof ne ? e.code : "ERROR";
|
|
1262
|
+
return Er[t];
|
|
1263
1263
|
}
|
|
1264
|
-
async function
|
|
1264
|
+
async function Zt(e, t) {
|
|
1265
1265
|
return e.length === 0 ? t.map((r) => ({
|
|
1266
1266
|
id: typeof (r == null ? void 0 : r.id) == "string" ? r.id : "(unknown)",
|
|
1267
1267
|
label: (r == null ? void 0 : r.label) ?? "(unknown)",
|
|
1268
1268
|
value: null,
|
|
1269
|
-
error:
|
|
1269
|
+
error: Er.ERROR
|
|
1270
1270
|
})) : Promise.all(
|
|
1271
1271
|
t.map(async (r) => {
|
|
1272
1272
|
try {
|
|
1273
1273
|
if (!r || typeof r.label != "string" || typeof r.expression != "string" || typeof r.id != "string")
|
|
1274
|
-
throw new
|
|
1275
|
-
return { id: r.id, label: r.label, value: await
|
|
1276
|
-
} catch (
|
|
1274
|
+
throw new ne("ERROR");
|
|
1275
|
+
return { id: r.id, label: r.label, value: await qt(e, r.expression) };
|
|
1276
|
+
} catch (o) {
|
|
1277
1277
|
return {
|
|
1278
1278
|
id: typeof (r == null ? void 0 : r.id) == "string" ? r.id : "(unknown)",
|
|
1279
1279
|
label: (r == null ? void 0 : r.label) ?? "(unknown)",
|
|
1280
1280
|
value: null,
|
|
1281
|
-
error:
|
|
1281
|
+
error: qe(o)
|
|
1282
1282
|
};
|
|
1283
1283
|
}
|
|
1284
1284
|
})
|
|
1285
1285
|
);
|
|
1286
1286
|
}
|
|
1287
|
-
function
|
|
1287
|
+
function Qt(e, t = {}) {
|
|
1288
1288
|
if (t.columnHeader && t.rowHeader)
|
|
1289
1289
|
throw new Error(
|
|
1290
1290
|
"x-spreadsheet: columnHeader and rowHeader cannot both be true — pick one orientation for the persisted sheet shape."
|
|
1291
1291
|
);
|
|
1292
|
-
return t.columnHeader ?
|
|
1292
|
+
return t.columnHeader ? en(e) : t.rowHeader ? rn(e) : e;
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function Rr(e) {
|
|
1295
1295
|
return e == null || e === "" ? null : e instanceof Date ? e.toISOString() : String(e);
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1297
|
+
function Tr(e, t) {
|
|
1298
1298
|
const r = /* @__PURE__ */ new Set();
|
|
1299
|
-
for (const
|
|
1300
|
-
if (
|
|
1301
|
-
if (r.has(
|
|
1299
|
+
for (const o of e)
|
|
1300
|
+
if (o != null) {
|
|
1301
|
+
if (r.has(o))
|
|
1302
1302
|
throw new Error(
|
|
1303
|
-
`x-spreadsheet: duplicate ${t} value "${
|
|
1303
|
+
`x-spreadsheet: duplicate ${t} value "${o}" — every ${t === "columnHeader" ? "column header" : "column-A value"} must be unique to shape as records.`
|
|
1304
1304
|
);
|
|
1305
|
-
r.add(
|
|
1305
|
+
r.add(o);
|
|
1306
1306
|
}
|
|
1307
1307
|
}
|
|
1308
|
-
function
|
|
1308
|
+
function en(e) {
|
|
1309
1309
|
const [t, ...r] = e;
|
|
1310
1310
|
if (!t) return [];
|
|
1311
|
-
const
|
|
1312
|
-
return
|
|
1313
|
-
const
|
|
1314
|
-
return
|
|
1315
|
-
l != null && (
|
|
1316
|
-
}),
|
|
1311
|
+
const o = t.map(Rr);
|
|
1312
|
+
return Tr(o, "columnHeader"), r.map((u) => {
|
|
1313
|
+
const i = /* @__PURE__ */ Object.create(null);
|
|
1314
|
+
return o.forEach((l, a) => {
|
|
1315
|
+
l != null && (i[l] = u[a] ?? null);
|
|
1316
|
+
}), i;
|
|
1317
1317
|
});
|
|
1318
1318
|
}
|
|
1319
|
-
function
|
|
1320
|
-
const t = e.map((
|
|
1321
|
-
|
|
1322
|
-
const r = Math.max(0, ...e.map((
|
|
1323
|
-
return Array.from({ length:
|
|
1324
|
-
const l =
|
|
1325
|
-
return t.forEach((
|
|
1326
|
-
|
|
1319
|
+
function rn(e) {
|
|
1320
|
+
const t = e.map((u) => Rr(u[0]));
|
|
1321
|
+
Tr(t, "rowHeader");
|
|
1322
|
+
const r = Math.max(0, ...e.map((u) => u.length)), o = Math.max(0, r - 1);
|
|
1323
|
+
return Array.from({ length: o }, (u, i) => {
|
|
1324
|
+
const l = i + 1, a = /* @__PURE__ */ Object.create(null);
|
|
1325
|
+
return t.forEach((s, c) => {
|
|
1326
|
+
s != null && (a[s] = e[c][l] ?? null);
|
|
1327
1327
|
}), a;
|
|
1328
1328
|
});
|
|
1329
1329
|
}
|
|
1330
|
-
function
|
|
1330
|
+
function tn(e) {
|
|
1331
1331
|
return !Array.isArray(e[0]);
|
|
1332
1332
|
}
|
|
1333
|
-
|
|
1334
|
-
const
|
|
1335
|
-
for (const { id:
|
|
1336
|
-
|
|
1337
|
-
return
|
|
1333
|
+
function nn(e) {
|
|
1334
|
+
const t = /* @__PURE__ */ Object.create(null);
|
|
1335
|
+
for (const { id: r, label: o, value: u, error: i } of e)
|
|
1336
|
+
t[r] = i === void 0 ? { label: o, value: u } : { label: o, value: u, error: i };
|
|
1337
|
+
return t;
|
|
1338
1338
|
}
|
|
1339
|
-
|
|
1340
|
-
|
|
1339
|
+
function Ge(e, t) {
|
|
1340
|
+
const r = (o) => o instanceof Date ? o.toISOString() : o ?? null;
|
|
1341
|
+
return r(e) === r(t);
|
|
1342
|
+
}
|
|
1343
|
+
function on(e, t) {
|
|
1344
|
+
const r = e ?? {}, o = t ?? {}, u = Object.keys(r);
|
|
1345
|
+
return u.length !== Object.keys(o).length ? !1 : u.every((i) => {
|
|
1346
|
+
if (!Object.prototype.hasOwnProperty.call(o, i)) return !1;
|
|
1347
|
+
const l = r[i], a = o[i];
|
|
1348
|
+
return l.label === a.label && l.error === a.error && Ge(l.value, a.value);
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
function ln(e, t) {
|
|
1352
|
+
if (e == null || t == null) return e === t;
|
|
1353
|
+
const r = Array.isArray(e);
|
|
1354
|
+
if (r !== Array.isArray(t)) return !1;
|
|
1355
|
+
if (r) {
|
|
1356
|
+
const l = e, a = t;
|
|
1357
|
+
return l.length === a.length && l.every((s, c) => Ge(s, a[c]));
|
|
1358
|
+
}
|
|
1359
|
+
const o = e, u = t, i = Object.keys(o);
|
|
1360
|
+
return i.length !== Object.keys(u).length ? !1 : i.every((l) => Object.prototype.hasOwnProperty.call(u, l) && Ge(o[l], u[l]));
|
|
1361
|
+
}
|
|
1362
|
+
function sn(e, t) {
|
|
1363
|
+
if (e === t) return !0;
|
|
1364
|
+
if (e == null || t == null) return !1;
|
|
1365
|
+
const r = e, o = t;
|
|
1366
|
+
return r.length !== o.length ? !1 : r.every((u, i) => ln(u, o[i]));
|
|
1367
|
+
}
|
|
1368
|
+
function cn(e) {
|
|
1369
|
+
return e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e instanceof Date;
|
|
1370
|
+
}
|
|
1371
|
+
function an(e) {
|
|
1372
|
+
if (e.length === 0) return [];
|
|
1373
|
+
const t = [], r = /* @__PURE__ */ new Set();
|
|
1374
|
+
for (const u of e)
|
|
1375
|
+
for (const i of Object.keys(u))
|
|
1376
|
+
r.has(i) || (r.add(i), t.push(i));
|
|
1377
|
+
if (t.length === 0) return [];
|
|
1378
|
+
const o = e.map(
|
|
1379
|
+
(u) => t.map((i) => {
|
|
1380
|
+
if (!Object.prototype.hasOwnProperty.call(u, i)) return null;
|
|
1381
|
+
const l = u[i];
|
|
1382
|
+
return cn(l) ? l : null;
|
|
1383
|
+
})
|
|
1384
|
+
);
|
|
1385
|
+
return [t, ...o];
|
|
1386
|
+
}
|
|
1387
|
+
function un(e) {
|
|
1388
|
+
const t = Math.max(0, ...e.map((r) => r.length));
|
|
1389
|
+
return Array.from({ length: t }, (r, o) => e.map((u) => u[o] ?? null));
|
|
1390
|
+
}
|
|
1391
|
+
const dn = ".xlsx,.xls,.csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,text/csv", fn = 10 * 1024 * 1024, Xe = 200, hn = 50, pn = [];
|
|
1392
|
+
function Ve(e) {
|
|
1341
1393
|
return e == null || e === "" ? "" : e instanceof Date ? e.toLocaleDateString() : String(e);
|
|
1342
1394
|
}
|
|
1343
|
-
const
|
|
1395
|
+
const mn = ({
|
|
1344
1396
|
data: e,
|
|
1345
1397
|
handleChange: t,
|
|
1346
1398
|
path: r,
|
|
1347
|
-
label:
|
|
1348
|
-
required:
|
|
1349
|
-
schema:
|
|
1399
|
+
label: o,
|
|
1400
|
+
required: u,
|
|
1401
|
+
schema: i,
|
|
1350
1402
|
enabled: l,
|
|
1351
1403
|
readonly: a,
|
|
1352
|
-
errors:
|
|
1404
|
+
errors: s,
|
|
1353
1405
|
visible: c = !0
|
|
1354
1406
|
}) => {
|
|
1355
|
-
|
|
1356
|
-
const
|
|
1357
|
-
() =>
|
|
1358
|
-
), [
|
|
1359
|
-
|
|
1360
|
-
if (
|
|
1361
|
-
|
|
1407
|
+
be(c, r, t, null);
|
|
1408
|
+
const d = !s || s.length === 0, y = yr(l, a), p = (i == null ? void 0 : i["x-spreadsheet"]) ?? {}, m = (i == null ? void 0 : i["x-evaluate"]) ?? pn, v = p.accept ?? dn, I = p.maxSize ?? fn, A = p.columnHeader === !0, b = p.rowHeader === !0, k = p.showSheet !== !1, F = p.sheetName, z = p.persistSheet !== !1, w = e ?? null, [_, V] = $(
|
|
1409
|
+
() => w != null && w.sheet || Object.keys((w == null ? void 0 : w.derivations) ?? {}).length > 0 ? "ready" : "empty"
|
|
1410
|
+
), [O, C] = $(null), [H, B] = $(!1), [W, j] = $(null), [ee, re] = $(null), le = pe(null), oe = pe(null), se = (w == null ? void 0 : w.sheet) ?? null, de = ke(
|
|
1411
|
+
(E) => {
|
|
1412
|
+
if (!tn(E)) return E;
|
|
1413
|
+
const L = an(E);
|
|
1414
|
+
return b ? un(L) : L;
|
|
1415
|
+
},
|
|
1416
|
+
[b]
|
|
1417
|
+
), G = Be(() => W ?? (se ? de(se) : null), [W, se, de]), f = ((ee == null ? void 0 : ee.matrix) === G ? ee.derivations : null) ?? (w == null ? void 0 : w.derivations) ?? {}, T = G != null || w != null, K = Be(() => {
|
|
1418
|
+
const E = A ? 1 : 0, L = b ? 1 : 0, ue = G ? G.slice(E) : [], X = ue.slice(0, Xe), P = Math.min(
|
|
1419
|
+
hn,
|
|
1420
|
+
Math.max(0, ...X.map((Q) => Math.max(0, Q.length - L)))
|
|
1421
|
+
), Ee = Array.from({ length: P }, (Q, ae) => ae + L), R = "", ce = b && !A;
|
|
1422
|
+
return /* @__PURE__ */ n(he, { children: G && k && /* @__PURE__ */ g(x, { mt: "3", children: [
|
|
1423
|
+
/* @__PURE__ */ n(x, { style: { overflow: "auto", maxHeight: 420 }, children: /* @__PURE__ */ g(Re.Root, { variant: "surface", size: "1", children: [
|
|
1424
|
+
!ce && /* @__PURE__ */ n(Re.Header, { children: /* @__PURE__ */ g(Re.Row, { children: [
|
|
1425
|
+
/* @__PURE__ */ n(Re.ColumnHeaderCell, { children: R }),
|
|
1426
|
+
Ee.map((Q) => {
|
|
1427
|
+
var ae;
|
|
1428
|
+
return (
|
|
1429
|
+
// This row only renders when rowHeader isn't the sole
|
|
1430
|
+
// flag set (see suppressColumnHeaderRow) — so reaching
|
|
1431
|
+
// here, either columnHeader is true (real labels) or
|
|
1432
|
+
// both are false (columnLetter fallback).
|
|
1433
|
+
/* @__PURE__ */ n(Re.ColumnHeaderCell, { children: A ? Ve((ae = G[0]) == null ? void 0 : ae[Q]) : zt(Q) }, Q)
|
|
1434
|
+
);
|
|
1435
|
+
})
|
|
1436
|
+
] }) }),
|
|
1437
|
+
/* @__PURE__ */ n(Re.Body, { children: X.map((Q, ae) => {
|
|
1438
|
+
var Ie;
|
|
1439
|
+
const Ae = E + ae;
|
|
1440
|
+
return /* @__PURE__ */ g(Re.Row, { children: [
|
|
1441
|
+
/* @__PURE__ */ n(
|
|
1442
|
+
Re.RowHeaderCell,
|
|
1443
|
+
{
|
|
1444
|
+
style: b ? { fontWeight: 700, background: "var(--gray-a3)" } : void 0,
|
|
1445
|
+
children: b ? Ve((Ie = G[Ae]) == null ? void 0 : Ie[0]) : A ? "" : Ae + 1
|
|
1446
|
+
}
|
|
1447
|
+
),
|
|
1448
|
+
Ee.map((Ue) => /* @__PURE__ */ n(Re.Cell, { children: Ve(Q[Ue]) }, Ue))
|
|
1449
|
+
] }, ae);
|
|
1450
|
+
}) })
|
|
1451
|
+
] }) }),
|
|
1452
|
+
ue.length > Xe && /* @__PURE__ */ g(h, { size: "1", color: "gray", mt: "1", style: { display: "block" }, children: [
|
|
1453
|
+
"Showing first ",
|
|
1454
|
+
Xe,
|
|
1455
|
+
" of ",
|
|
1456
|
+
ue.length,
|
|
1457
|
+
" rows"
|
|
1458
|
+
] })
|
|
1459
|
+
] }) });
|
|
1460
|
+
}, [G, k, A, b]), N = ke(
|
|
1461
|
+
async (E) => {
|
|
1462
|
+
if (C(null), E.size > I) {
|
|
1463
|
+
C(`File exceeds the ${ye(I)} limit.`);
|
|
1362
1464
|
return;
|
|
1363
1465
|
}
|
|
1364
|
-
if (!v.split(",").map((
|
|
1365
|
-
|
|
1466
|
+
if (!v.split(",").map((P) => P.trim()).some((P) => P === "*" || P === "*/*" ? !0 : P.endsWith("/*") ? E.type.startsWith(P.slice(0, -1)) : P.startsWith(".") ? E.name.toLowerCase().endsWith(P.toLowerCase()) : E.type === P)) {
|
|
1467
|
+
C(`Invalid type. Accepted: ${ve(v)}`);
|
|
1366
1468
|
return;
|
|
1367
1469
|
}
|
|
1368
|
-
|
|
1369
|
-
let
|
|
1470
|
+
V("parsing");
|
|
1471
|
+
let X;
|
|
1370
1472
|
try {
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1373
|
-
} catch (
|
|
1374
|
-
|
|
1375
|
-
|
|
1473
|
+
const P = await E.arrayBuffer();
|
|
1474
|
+
X = Mt(P, F).matrix;
|
|
1475
|
+
} catch (P) {
|
|
1476
|
+
V("error"), C(
|
|
1477
|
+
P instanceof Ke ? P.message : "This doesn't look like a valid spreadsheet. Please check the file and try again."
|
|
1376
1478
|
);
|
|
1377
1479
|
return;
|
|
1378
1480
|
}
|
|
1379
|
-
|
|
1380
|
-
let ie;
|
|
1381
|
-
try {
|
|
1382
|
-
ie = await qt(te, m, { persistSheet: A, columnHeader: w, rowHeader: R });
|
|
1383
|
-
} catch (z) {
|
|
1384
|
-
j("error"), O(z instanceof Error ? z.message : "Failed to process the uploaded spreadsheet.");
|
|
1385
|
-
return;
|
|
1386
|
-
}
|
|
1387
|
-
t(r, ie), j("ready");
|
|
1481
|
+
oe.current = (e == null ? void 0 : e.sheet) ?? null, j(X), V("ready");
|
|
1388
1482
|
},
|
|
1389
|
-
[v,
|
|
1483
|
+
[v, I, F, e]
|
|
1390
1484
|
);
|
|
1391
|
-
if (
|
|
1485
|
+
if (ge(() => {
|
|
1486
|
+
W != null && se != null && se !== oe.current && j(null);
|
|
1487
|
+
}, [W, se]), ge(() => {
|
|
1488
|
+
if (m.length === 0 && !z) return;
|
|
1489
|
+
let E = !1;
|
|
1490
|
+
const L = (X) => {
|
|
1491
|
+
y && (on(w == null ? void 0 : w.derivations, X == null ? void 0 : X.derivations) && sn(w == null ? void 0 : w.sheet, X == null ? void 0 : X.sheet) || (oe.current = (X == null ? void 0 : X.sheet) ?? null, t(r, X)));
|
|
1492
|
+
}, ue = G ?? [];
|
|
1493
|
+
if (ue.length === 0) {
|
|
1494
|
+
w != null && L(void 0);
|
|
1495
|
+
return;
|
|
1496
|
+
}
|
|
1497
|
+
return Zt(ue, m).then((X) => {
|
|
1498
|
+
if (E) return;
|
|
1499
|
+
let P;
|
|
1500
|
+
if (W != null) {
|
|
1501
|
+
if (z)
|
|
1502
|
+
try {
|
|
1503
|
+
P = Qt(ue, { columnHeader: A, rowHeader: b });
|
|
1504
|
+
} catch (R) {
|
|
1505
|
+
C(R instanceof Error ? R.message : "Failed to process this sheet.");
|
|
1506
|
+
return;
|
|
1507
|
+
}
|
|
1508
|
+
} else
|
|
1509
|
+
P = w == null ? void 0 : w.sheet;
|
|
1510
|
+
C(null);
|
|
1511
|
+
const Ee = nn(X);
|
|
1512
|
+
re({ matrix: ue, derivations: Ee }), L(P === void 0 ? { derivations: Ee } : { sheet: P, derivations: Ee });
|
|
1513
|
+
}), () => {
|
|
1514
|
+
E = !0;
|
|
1515
|
+
};
|
|
1516
|
+
}, [G, W, m, y, z, A, b]), c === !1)
|
|
1392
1517
|
return null;
|
|
1393
|
-
if (
|
|
1394
|
-
return /* @__PURE__ */ g(
|
|
1395
|
-
/* @__PURE__ */ n(h, { as: "label", size: "2", weight: "bold", children:
|
|
1518
|
+
if (A && b)
|
|
1519
|
+
return /* @__PURE__ */ g(x, { mb: "4", children: [
|
|
1520
|
+
/* @__PURE__ */ n(h, { as: "label", size: "2", weight: "bold", children: o }),
|
|
1396
1521
|
/* @__PURE__ */ n(h, { size: "2", color: "red", style: { display: "block" }, children: "Invalid x-spreadsheet config: columnHeader and rowHeader cannot both be true — pick one orientation." })
|
|
1397
1522
|
] });
|
|
1398
|
-
if (!y && !
|
|
1399
|
-
const
|
|
1400
|
-
|
|
1401
|
-
},
|
|
1402
|
-
var
|
|
1403
|
-
|
|
1404
|
-
},
|
|
1405
|
-
var
|
|
1406
|
-
(
|
|
1407
|
-
},
|
|
1408
|
-
y && (
|
|
1409
|
-
},
|
|
1410
|
-
|
|
1411
|
-
Math.max(0, ...K.map((d) => Math.max(0, d.length - J)))
|
|
1412
|
-
), Ee = Array.from({ length: we }, (d, E) => E + J), De = L && Z == null && re == null && I != null, Se = "", Fe = R && !w, Oe = re ? re.slice(0, ve) : [], Re = Array.from(new Set(Oe.flatMap((d) => Object.keys(d)))).slice(0, Ye);
|
|
1413
|
-
return /* @__PURE__ */ g(C, { mb: "4", children: [
|
|
1523
|
+
if (!y && !T) return null;
|
|
1524
|
+
const U = (E) => {
|
|
1525
|
+
E.preventDefault(), E.stopPropagation(), y && B(E.type === "dragenter" || E.type === "dragover");
|
|
1526
|
+
}, Z = (E) => {
|
|
1527
|
+
var L;
|
|
1528
|
+
E.preventDefault(), E.stopPropagation(), B(!1), y && (L = E.dataTransfer.files) != null && L[0] && N(E.dataTransfer.files[0]);
|
|
1529
|
+
}, ie = (E) => {
|
|
1530
|
+
var L;
|
|
1531
|
+
(L = E.target.files) != null && L[0] && (N(E.target.files[0]), E.target.value = "");
|
|
1532
|
+
}, J = () => {
|
|
1533
|
+
y && (j(null), re(null), oe.current = null, C(null), V("empty"), t(r, null));
|
|
1534
|
+
}, D = k && G == null && w != null;
|
|
1535
|
+
return /* @__PURE__ */ g(x, { mb: "4", children: [
|
|
1414
1536
|
/* @__PURE__ */ g(S, { align: "center", justify: "between", mb: "2", children: [
|
|
1415
1537
|
/* @__PURE__ */ g(S, { align: "center", gap: "1", children: [
|
|
1416
1538
|
/* @__PURE__ */ g(h, { as: "label", size: "2", weight: "bold", children: [
|
|
1417
|
-
|
|
1418
|
-
|
|
1539
|
+
o,
|
|
1540
|
+
u && /* @__PURE__ */ n(h, { color: "red", children: " *" })
|
|
1419
1541
|
] }),
|
|
1420
|
-
|
|
1421
|
-
/* @__PURE__ */ n(
|
|
1422
|
-
|
|
1542
|
+
T && y && /* @__PURE__ */ g(he, { children: [
|
|
1543
|
+
/* @__PURE__ */ n(He, { content: "Replace spreadsheet", children: /* @__PURE__ */ n(
|
|
1544
|
+
Me,
|
|
1423
1545
|
{
|
|
1424
1546
|
variant: "ghost",
|
|
1425
1547
|
size: "1",
|
|
1426
1548
|
onClick: () => {
|
|
1427
|
-
var
|
|
1428
|
-
return (
|
|
1549
|
+
var E;
|
|
1550
|
+
return (E = le.current) == null ? void 0 : E.click();
|
|
1429
1551
|
},
|
|
1430
1552
|
"aria-label": "Replace spreadsheet",
|
|
1431
|
-
children: /* @__PURE__ */ n(
|
|
1553
|
+
children: /* @__PURE__ */ n(Ne, {})
|
|
1432
1554
|
}
|
|
1433
1555
|
) }),
|
|
1434
|
-
/* @__PURE__ */ n(
|
|
1435
|
-
|
|
1556
|
+
/* @__PURE__ */ n(He, { content: "Remove spreadsheet", children: /* @__PURE__ */ n(
|
|
1557
|
+
Me,
|
|
1436
1558
|
{
|
|
1437
1559
|
variant: "ghost",
|
|
1438
1560
|
size: "1",
|
|
1439
1561
|
color: "gray",
|
|
1440
|
-
onClick:
|
|
1562
|
+
onClick: J,
|
|
1441
1563
|
"aria-label": "Remove spreadsheet",
|
|
1442
|
-
children: /* @__PURE__ */ n(
|
|
1564
|
+
children: /* @__PURE__ */ n(Ye, {})
|
|
1443
1565
|
}
|
|
1444
1566
|
) })
|
|
1445
1567
|
] })
|
|
1446
1568
|
] }),
|
|
1447
1569
|
/* @__PURE__ */ g(h, { size: "1", color: "gray", children: [
|
|
1448
|
-
|
|
1570
|
+
ye(I),
|
|
1449
1571
|
" max · ",
|
|
1450
|
-
|
|
1572
|
+
ve(v)
|
|
1451
1573
|
] })
|
|
1452
1574
|
] }),
|
|
1453
|
-
|
|
1454
|
-
/* @__PURE__ */ n("input", { ref: le, type: "file", style: { display: "none" }, accept: v, onChange:
|
|
1455
|
-
y && !
|
|
1575
|
+
T && O && /* @__PURE__ */ n(h, { size: "2", color: "red", mb: "2", style: { display: "block" }, children: O }),
|
|
1576
|
+
/* @__PURE__ */ n("input", { ref: le, type: "file", style: { display: "none" }, accept: v, onChange: ie }),
|
|
1577
|
+
y && !T && /* @__PURE__ */ n(
|
|
1456
1578
|
"div",
|
|
1457
1579
|
{
|
|
1458
1580
|
role: "button",
|
|
1459
1581
|
tabIndex: 0,
|
|
1460
1582
|
onClick: () => {
|
|
1461
|
-
var d;
|
|
1462
|
-
return (d = le.current) == null ? void 0 : d.click();
|
|
1463
|
-
},
|
|
1464
|
-
onKeyDown: (d) => {
|
|
1465
1583
|
var E;
|
|
1466
|
-
|
|
1584
|
+
return (E = le.current) == null ? void 0 : E.click();
|
|
1585
|
+
},
|
|
1586
|
+
onKeyDown: (E) => {
|
|
1587
|
+
var L;
|
|
1588
|
+
(E.key === "Enter" || E.key === " ") && (E.preventDefault(), (L = le.current) == null || L.click());
|
|
1467
1589
|
},
|
|
1468
|
-
onDragEnter:
|
|
1469
|
-
onDragLeave:
|
|
1470
|
-
onDragOver:
|
|
1471
|
-
onDrop:
|
|
1590
|
+
onDragEnter: U,
|
|
1591
|
+
onDragLeave: U,
|
|
1592
|
+
onDragOver: U,
|
|
1593
|
+
onDrop: Z,
|
|
1472
1594
|
style: { cursor: "pointer" },
|
|
1473
1595
|
className: [
|
|
1474
1596
|
"border-2 border-dashed rounded-lg p-6 text-center",
|
|
1475
1597
|
"transition-all duration-200 ease-in-out",
|
|
1476
|
-
|
|
1598
|
+
H ? "border-blue-500 bg-blue-50" : O ? "border-red-300 bg-red-50" : "border-gray-300 hover:border-blue-400 hover:bg-gray-50"
|
|
1477
1599
|
].join(" "),
|
|
1478
|
-
children: /* @__PURE__ */ n(S, { direction: "column", align: "center", gap: "2", children:
|
|
1479
|
-
/* @__PURE__ */ n(
|
|
1600
|
+
children: /* @__PURE__ */ n(S, { direction: "column", align: "center", gap: "2", children: _ === "parsing" ? /* @__PURE__ */ g(he, { children: [
|
|
1601
|
+
/* @__PURE__ */ n(xe, { size: "3" }),
|
|
1480
1602
|
/* @__PURE__ */ n(h, { size: "2", color: "gray", children: "Parsing spreadsheet…" })
|
|
1481
|
-
] }) :
|
|
1482
|
-
/* @__PURE__ */ n(
|
|
1483
|
-
/* @__PURE__ */ n(h, { size: "2", color: "red", weight: "medium", children:
|
|
1603
|
+
] }) : O ? /* @__PURE__ */ g(he, { children: [
|
|
1604
|
+
/* @__PURE__ */ n(Je, { style: { width: 32, height: 32, color: "var(--red-9)" } }),
|
|
1605
|
+
/* @__PURE__ */ n(h, { size: "2", color: "red", weight: "medium", children: O }),
|
|
1484
1606
|
/* @__PURE__ */ n(h, { size: "1", color: "gray", children: "Click to try again" })
|
|
1485
|
-
] }) : /* @__PURE__ */ g(
|
|
1486
|
-
/* @__PURE__ */ n(
|
|
1607
|
+
] }) : /* @__PURE__ */ g(he, { children: [
|
|
1608
|
+
/* @__PURE__ */ n(Ne, { style: { width: 32, height: 32, color: "var(--gray-8)" } }),
|
|
1487
1609
|
/* @__PURE__ */ n(h, { size: "2", weight: "medium", children: "Click to upload or drag and drop" }),
|
|
1488
1610
|
/* @__PURE__ */ g(h, { size: "1", color: "gray", children: [
|
|
1489
|
-
|
|
1611
|
+
ye(I),
|
|
1490
1612
|
" max · ",
|
|
1491
|
-
|
|
1613
|
+
ve(v)
|
|
1492
1614
|
] })
|
|
1493
1615
|
] }) })
|
|
1494
1616
|
}
|
|
1495
1617
|
),
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
/* @__PURE__ */ n($.ColumnHeaderCell, { children: Se }),
|
|
1500
|
-
Ee.map((d) => {
|
|
1501
|
-
var E;
|
|
1502
|
-
return (
|
|
1503
|
-
// This row only renders when rowHeader isn't the sole
|
|
1504
|
-
// flag set (see suppressColumnHeaderRow) — so reaching
|
|
1505
|
-
// here, either columnHeader is true (real labels) or
|
|
1506
|
-
// both are false (columnLetter fallback).
|
|
1507
|
-
/* @__PURE__ */ n($.ColumnHeaderCell, { children: w ? Ce((E = Z[0]) == null ? void 0 : E[d]) : Nt(d) }, d)
|
|
1508
|
-
);
|
|
1509
|
-
})
|
|
1510
|
-
] }) }),
|
|
1511
|
-
/* @__PURE__ */ n($.Body, { children: K.map((d, E) => {
|
|
1512
|
-
var te;
|
|
1513
|
-
const q = H + E;
|
|
1514
|
-
return /* @__PURE__ */ g($.Row, { children: [
|
|
1515
|
-
/* @__PURE__ */ n(
|
|
1516
|
-
$.RowHeaderCell,
|
|
1517
|
-
{
|
|
1518
|
-
style: R ? { fontWeight: 700, background: "var(--gray-a3)" } : void 0,
|
|
1519
|
-
children: R ? Ce((te = Z[q]) == null ? void 0 : te[0]) : w ? "" : q + 1
|
|
1520
|
-
}
|
|
1521
|
-
),
|
|
1522
|
-
Ee.map((ie) => /* @__PURE__ */ n($.Cell, { children: Ce(d[ie]) }, ie))
|
|
1523
|
-
] }, E);
|
|
1524
|
-
}) })
|
|
1525
|
-
] }) }),
|
|
1526
|
-
Q.length > ve && /* @__PURE__ */ g(h, { size: "1", color: "gray", mt: "1", style: { display: "block" }, children: [
|
|
1527
|
-
"Showing first ",
|
|
1528
|
-
ve,
|
|
1529
|
-
" of ",
|
|
1530
|
-
Q.length,
|
|
1531
|
-
" rows"
|
|
1532
|
-
] })
|
|
1533
|
-
] }),
|
|
1534
|
-
re && L && /* @__PURE__ */ g(C, { mt: "3", children: [
|
|
1535
|
-
/* @__PURE__ */ n(C, { style: { overflow: "auto", maxHeight: 420 }, children: /* @__PURE__ */ g($.Root, { variant: "surface", size: "1", children: [
|
|
1536
|
-
/* @__PURE__ */ n($.Header, { children: /* @__PURE__ */ g($.Row, { children: [
|
|
1537
|
-
/* @__PURE__ */ n($.ColumnHeaderCell, {}),
|
|
1538
|
-
Re.map((d) => /* @__PURE__ */ n($.ColumnHeaderCell, { children: d }, d))
|
|
1539
|
-
] }) }),
|
|
1540
|
-
/* @__PURE__ */ n($.Body, { children: Oe.map((d, E) => /* @__PURE__ */ g($.Row, { children: [
|
|
1541
|
-
/* @__PURE__ */ n($.RowHeaderCell, { children: E + 1 }),
|
|
1542
|
-
Re.map((q) => /* @__PURE__ */ n($.Cell, { children: Ce(d[q]) }, q))
|
|
1543
|
-
] }, E)) })
|
|
1544
|
-
] }) }),
|
|
1545
|
-
re.length > ve && /* @__PURE__ */ g(h, { size: "1", color: "gray", mt: "1", style: { display: "block" }, children: [
|
|
1546
|
-
"Showing first ",
|
|
1547
|
-
ve,
|
|
1548
|
-
" of ",
|
|
1549
|
-
re.length,
|
|
1550
|
-
" rows"
|
|
1551
|
-
] })
|
|
1552
|
-
] }),
|
|
1553
|
-
De && /* @__PURE__ */ n(h, { size: "2", color: "gray", mt: "3", style: { display: "block" }, children: "Sheet preview not stored for this field — re-upload to view contents." }),
|
|
1554
|
-
Object.keys(he).length > 0 && /* @__PURE__ */ g(C, { mt: "3", children: [
|
|
1618
|
+
K,
|
|
1619
|
+
D && /* @__PURE__ */ n(h, { size: "2", color: "gray", mt: "3", style: { display: "block" }, children: "Sheet preview not stored for this field — re-upload to view contents." }),
|
|
1620
|
+
Object.keys(f).length > 0 && /* @__PURE__ */ g(x, { mt: "3", children: [
|
|
1555
1621
|
/* @__PURE__ */ n(h, { size: "2", weight: "bold", as: "div", mb: "1", children: "Computed values" }),
|
|
1556
|
-
/* @__PURE__ */ n(S, { direction: "column", gap: "1", children: Object.entries(
|
|
1557
|
-
/* @__PURE__ */ n(h, { size: "2", children:
|
|
1558
|
-
|
|
1622
|
+
/* @__PURE__ */ n(S, { direction: "column", gap: "1", children: Object.entries(f).map(([E, L]) => /* @__PURE__ */ g(S, { justify: "between", children: [
|
|
1623
|
+
/* @__PURE__ */ n(h, { size: "2", children: L.label }),
|
|
1624
|
+
L.error ? /* @__PURE__ */ n(h, { size: "2", color: "red", children: L.error }) : (
|
|
1559
1625
|
// d.value is CellValue | null now (SUM/AVERAGE aren't the only
|
|
1560
1626
|
// possible results anymore — INDEX/CONCATENATE can return a
|
|
1561
1627
|
// string, a bare comparison can return a boolean, etc.), so
|
|
1562
1628
|
// `.toLocaleString()` would throw for e.g. a boolean result.
|
|
1563
1629
|
// Reuse the same formatCell used for the sheet-preview grid.
|
|
1564
|
-
/* @__PURE__ */ n(h, { size: "2", children:
|
|
1630
|
+
/* @__PURE__ */ n(h, { size: "2", children: Ve(L.value) })
|
|
1565
1631
|
)
|
|
1566
|
-
] },
|
|
1632
|
+
] }, E)) })
|
|
1567
1633
|
] }),
|
|
1568
|
-
!
|
|
1634
|
+
!d && /* @__PURE__ */ n(h, { color: "red", size: "1", mt: "2", style: { display: "block" }, children: we(s, o) })
|
|
1569
1635
|
] });
|
|
1570
|
-
},
|
|
1636
|
+
}, gn = me(mn), yn = q(
|
|
1571
1637
|
10,
|
|
1572
1638
|
// matches FileControlTester's rank — beats the default object/Group renderer
|
|
1573
1639
|
ze(
|
|
1574
1640
|
(e) => e.type === "object" && typeof e["x-spreadsheet"] == "object"
|
|
1575
1641
|
)
|
|
1576
1642
|
);
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1643
|
+
class Te extends Error {
|
|
1644
|
+
}
|
|
1645
|
+
const or = 5e6, vn = 1024, bn = /^<\?xml\s+[^>]*\bencoding\s*=\s*["']([^"']+)["']/i, wn = {
|
|
1646
|
+
// Default is true, which would silently drop what in many formats is most of
|
|
1647
|
+
// the payload.
|
|
1648
|
+
ignoreAttributes: !1,
|
|
1649
|
+
// Non-empty, so `@_id` and a sibling <id> element can coexist on one node.
|
|
1650
|
+
attributeNamePrefix: "@_",
|
|
1651
|
+
textNodeName: "#text",
|
|
1652
|
+
parseTagValue: !0,
|
|
1653
|
+
// Default is false, which would make <line qty="10"/> a string while
|
|
1654
|
+
// <line><qty>10</qty></line> is a number.
|
|
1655
|
+
parseAttributeValue: !0,
|
|
1656
|
+
// Defaults are hex: true, leadingZeros: true, which turn "00742" into 742 and
|
|
1657
|
+
// "0x1A" into 26 — silent, irreversible corruption of the zero-padded SKUs,
|
|
1658
|
+
// postcodes and invoice refs that fill real XML.
|
|
1659
|
+
numberParseOptions: { hex: !1, leadingZeros: !1, eNotation: !0 },
|
|
1660
|
+
trimValues: !0,
|
|
1661
|
+
// CDATA merges into the node's ordinary text value: whether an author wrapped
|
|
1662
|
+
// a value in CDATA is an encoding detail, not content.
|
|
1663
|
+
cdataPropName: !1,
|
|
1664
|
+
commentPropName: !1,
|
|
1665
|
+
// Enabled so `&` and DOCTYPE-declared entities resolve. Verified against
|
|
1666
|
+
// 5.11.1 and pinned in parse.test.ts: the library refuses external and
|
|
1667
|
+
// parameter entities, caps declarations, and leaves a nested entity reference
|
|
1668
|
+
// literal rather than expanding it — so no XXE or amplification guard of our
|
|
1669
|
+
// own is needed.
|
|
1670
|
+
processEntities: !0,
|
|
1671
|
+
// Default is false. Despite the name, this is what decodes NUMERIC character
|
|
1672
|
+
// references (`é`), which are core XML — left off they persist as
|
|
1673
|
+
// literal text. The HTML named set comes along as a harmless superset.
|
|
1674
|
+
htmlEntities: !0,
|
|
1675
|
+
// Defaults are both false, which injects a `?xml` key of transport metadata
|
|
1676
|
+
// into the document root.
|
|
1677
|
+
ignoreDeclaration: !0,
|
|
1678
|
+
ignorePiTags: !0,
|
|
1679
|
+
// A leaf with no attributes collapses to its bare value, so <qty>10</qty> is
|
|
1680
|
+
// `10`. Only genuinely mixed nodes get a '#text' key.
|
|
1681
|
+
alwaysCreateTextNode: !1,
|
|
1682
|
+
preserveOrder: !1,
|
|
1683
|
+
// Prefixes are kept so <a:Name> and <b:Name> stay distinguishable;
|
|
1684
|
+
// x-xml.removeNamespaces opts out per field, lossily — see docs.
|
|
1685
|
+
removeNSPrefix: !1,
|
|
1686
|
+
// Library defaults, restated because they are load-bearing: the depth bound
|
|
1687
|
+
// is what stops a deeply-nested document overflowing the stack here and in
|
|
1688
|
+
// every recursive consumer downstream.
|
|
1689
|
+
maxNestedTags: 100,
|
|
1690
|
+
strictReservedNames: !0
|
|
1691
|
+
};
|
|
1692
|
+
function En(e) {
|
|
1693
|
+
const t = new Set(e);
|
|
1694
|
+
return t.size === 0 ? () => !1 : (r, o) => (
|
|
1695
|
+
// A string while the library's own `jPath` option is true (the default) and
|
|
1696
|
+
// a matcher object otherwise; both stringify to the same dotted path.
|
|
1697
|
+
t.has(typeof o == "string" ? o : o.toString()) || t.has(r)
|
|
1698
|
+
);
|
|
1699
|
+
}
|
|
1700
|
+
function Rn(e) {
|
|
1701
|
+
const t = e instanceof Error ? e.message : "";
|
|
1702
|
+
return t.startsWith("[SECURITY] Invalid name:") ? "This document uses a reserved JavaScript name (__proto__, constructor or prototype) as an element or attribute name, which cannot be represented safely." : t === "External entities are not supported" || t === "Parameter entities are not supported" ? `${t}. Please remove the DOCTYPE entity declarations and try again.` : t.startsWith("Maximum nested tags exceeded") ? "This document is nested too deeply to parse." : t.startsWith("Entity count") || t.includes("exceeds maximum allowed") ? "This document declares too many or too large entity definitions to expand safely." : "This doesn't look like a valid XML document. Please check the file and try again.";
|
|
1703
|
+
}
|
|
1704
|
+
async function Tn(e, t = {}) {
|
|
1705
|
+
var c;
|
|
1706
|
+
if (typeof e != "string") throw new Te("This file could not be read as text.");
|
|
1707
|
+
const r = e.charCodeAt(0) === 65279 ? e.slice(1) : e;
|
|
1708
|
+
if (r.trim() === "") throw new Te("This file is empty.");
|
|
1709
|
+
if (r.length > or)
|
|
1710
|
+
throw new Te(
|
|
1711
|
+
`This document is too large to parse (over ${or / 1e6} million characters).`
|
|
1712
|
+
);
|
|
1713
|
+
const o = (c = bn.exec(r.slice(0, vn))) == null ? void 0 : c[1];
|
|
1714
|
+
if (o && !/^utf-?8$/i.test(o))
|
|
1715
|
+
throw new Te(
|
|
1716
|
+
`This document declares the unsupported encoding "${o}". Only UTF-8 is supported.`
|
|
1717
|
+
);
|
|
1718
|
+
const { XMLParser: u, XMLValidator: i } = await import("fast-xml-parser"), l = i.validate(r, { allowBooleanAttributes: !1 });
|
|
1719
|
+
if (l !== !0) {
|
|
1720
|
+
const { msg: d, line: y, col: p } = l.err;
|
|
1721
|
+
throw new Te(`Invalid XML at line ${y}, column ${p}: ${d}`);
|
|
1722
|
+
}
|
|
1723
|
+
const a = new u({
|
|
1724
|
+
...wn,
|
|
1725
|
+
removeNSPrefix: t.removeNamespaces === !0,
|
|
1726
|
+
isArray: En(t.arrayPaths ?? [])
|
|
1727
|
+
});
|
|
1728
|
+
let s;
|
|
1729
|
+
try {
|
|
1730
|
+
s = a.parse(r);
|
|
1731
|
+
} catch (d) {
|
|
1732
|
+
throw new Te(Rn(d));
|
|
1733
|
+
}
|
|
1734
|
+
if (s == null || typeof s != "object" || Array.isArray(s))
|
|
1735
|
+
throw new Te("This document has no root element.");
|
|
1736
|
+
return s;
|
|
1737
|
+
}
|
|
1738
|
+
const Oe = { found: !1 }, fe = (e) => ({ found: !0, value: e });
|
|
1739
|
+
function ir(e) {
|
|
1740
|
+
return e == null || e === "" ? Oe : Array.isArray(e) || e instanceof Date ? fe(e) : typeof e == "object" ? Oe : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? fe(e) : Oe;
|
|
1741
|
+
}
|
|
1742
|
+
const An = /* @__PURE__ */ new Set(["true", "1", "yes", "y"]), Cn = /* @__PURE__ */ new Set(["false", "0", "no", "n"]);
|
|
1743
|
+
async function Sn(e, t) {
|
|
1744
|
+
switch (t.as) {
|
|
1745
|
+
case void 0:
|
|
1746
|
+
return fe(e);
|
|
1747
|
+
case "string":
|
|
1748
|
+
return fe(e instanceof Date ? e.toISOString() : String(e));
|
|
1749
|
+
case "number": {
|
|
1750
|
+
const r = e instanceof Date ? e.getTime() : Number(e);
|
|
1751
|
+
return Number.isFinite(r) ? fe(r) : Oe;
|
|
1752
|
+
}
|
|
1753
|
+
case "boolean": {
|
|
1754
|
+
const r = String(e).trim().toLowerCase();
|
|
1755
|
+
return An.has(r) ? fe(!0) : Cn.has(r) ? fe(!1) : Oe;
|
|
1756
|
+
}
|
|
1757
|
+
case "date": {
|
|
1758
|
+
const { default: r } = await import("dayjs"), { default: o } = await import("./customParseFormat-D14EWdSX.js").then((l) => l.c);
|
|
1759
|
+
r.extend(o);
|
|
1760
|
+
const u = e instanceof Date ? e.toISOString() : String(e), i = t.format ? r(u, t.format, !0) : r(u);
|
|
1761
|
+
return i.isValid() ? fe(i.format("YYYY-MM-DD")) : Oe;
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
async function On(e, t) {
|
|
1766
|
+
if (t.formula !== void 0) {
|
|
1767
|
+
const r = {};
|
|
1768
|
+
for (const [o, u] of Object.entries(t.inputs ?? {})) {
|
|
1769
|
+
const i = ir(je.data(e, u));
|
|
1770
|
+
if (!i.found || Array.isArray(i.value)) return Oe;
|
|
1771
|
+
r[o] = i.value;
|
|
1772
|
+
}
|
|
1773
|
+
try {
|
|
1774
|
+
return fe(await wr(r, t.formula));
|
|
1775
|
+
} catch (o) {
|
|
1776
|
+
throw new Error(`x-xml.writeTo "${t.to}": ${qe(o)}`);
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
if (t.from === void 0) throw new Error(`x-xml.writeTo "${t.to}" needs either "from" or "formula".`);
|
|
1780
|
+
return ir(je.data(e, t.from));
|
|
1781
|
+
}
|
|
1782
|
+
async function Nn(e, t) {
|
|
1783
|
+
const r = [];
|
|
1784
|
+
for (const o of t) {
|
|
1785
|
+
let u = await On(e, o);
|
|
1786
|
+
const i = u.found && Array.isArray(u.value);
|
|
1787
|
+
if (u.found && !i && o.map) {
|
|
1788
|
+
const l = u.value instanceof Date ? u.value.toISOString() : String(u.value);
|
|
1789
|
+
Object.prototype.hasOwnProperty.call(o.map, l) && (u = fe(o.map[l]));
|
|
1790
|
+
}
|
|
1791
|
+
if (u.found && !i && (u = await Sn(u.value, o)), !u.found) {
|
|
1792
|
+
if (o.default === void 0) continue;
|
|
1793
|
+
r.push({ to: o.to, value: o.default });
|
|
1794
|
+
continue;
|
|
1795
|
+
}
|
|
1796
|
+
r.push({ to: o.to, value: u.value });
|
|
1797
|
+
}
|
|
1798
|
+
return r;
|
|
1799
|
+
}
|
|
1800
|
+
const xn = ".xml,text/xml,application/xml", In = 5 * 1024 * 1024, kn = ({
|
|
1801
|
+
data: e,
|
|
1802
|
+
handleChange: t,
|
|
1803
|
+
path: r,
|
|
1804
|
+
label: o,
|
|
1805
|
+
required: u,
|
|
1806
|
+
schema: i,
|
|
1807
|
+
enabled: l,
|
|
1808
|
+
readonly: a,
|
|
1809
|
+
errors: s,
|
|
1810
|
+
visible: c = !0
|
|
1811
|
+
}) => {
|
|
1812
|
+
be(c, r, t);
|
|
1813
|
+
const d = !s || s.length === 0, y = yr(l, a), p = (i == null ? void 0 : i["x-xml"]) ?? {}, m = p.accept ?? xn, v = p.maxSize ?? In, I = p.arrayPaths, A = p.removeNamespaces === !0, b = p.writeTo, k = p.writeBase ?? "root", F = p.persistDocument !== !1, z = fr(), w = e ?? null, [_, V] = $(() => w ? "ready" : "empty"), [O, C] = $(null), [H, B] = $(!1), W = pe(null), j = pe(0), ee = w != null, re = b !== void 0 && b.length > 0, le = ke(
|
|
1814
|
+
async (f) => {
|
|
1815
|
+
var J;
|
|
1816
|
+
const T = ++j.current;
|
|
1817
|
+
if (C(null), f.size > v) {
|
|
1818
|
+
C(`File exceeds the ${ye(v)} limit.`);
|
|
1819
|
+
return;
|
|
1820
|
+
}
|
|
1821
|
+
if (!m.split(",").map((D) => D.trim()).some((D) => D === "*" || D === "*/*" ? !0 : D.endsWith("/*") ? f.type.startsWith(D.slice(0, -1)) : D.startsWith(".") ? f.name.toLowerCase().endsWith(D.toLowerCase()) : f.type === D)) {
|
|
1822
|
+
C(`Invalid type. Accepted: ${ve(m)}`);
|
|
1823
|
+
return;
|
|
1824
|
+
}
|
|
1825
|
+
V("parsing");
|
|
1826
|
+
let U;
|
|
1827
|
+
try {
|
|
1828
|
+
const D = await f.text();
|
|
1829
|
+
U = await Tn(D, { arrayPaths: I, removeNamespaces: A });
|
|
1830
|
+
} catch (D) {
|
|
1831
|
+
if (T !== j.current) return;
|
|
1832
|
+
V("error"), C(
|
|
1833
|
+
D instanceof Te ? D.message : "This doesn't look like a valid XML document. Please check the file and try again."
|
|
1834
|
+
);
|
|
1835
|
+
return;
|
|
1836
|
+
}
|
|
1837
|
+
let Z = [];
|
|
1838
|
+
if (b && b.length > 0)
|
|
1839
|
+
try {
|
|
1840
|
+
Z = await Nn(U, b);
|
|
1841
|
+
} catch (D) {
|
|
1842
|
+
if (T !== j.current) return;
|
|
1843
|
+
V("error"), C(D instanceof Error ? D.message : "This document could not be mapped onto the form.");
|
|
1844
|
+
return;
|
|
1845
|
+
}
|
|
1846
|
+
if (T !== j.current) return;
|
|
1847
|
+
F && t(r, U);
|
|
1848
|
+
const ie = k === "parent" ? r.split(".").slice(0, -1).join(".") : "";
|
|
1849
|
+
for (const D of Z) (J = z.dispatch) == null || J.call(z, zr(ie ? `${ie}.${D.to}` : D.to, () => D.value));
|
|
1850
|
+
V("ready");
|
|
1851
|
+
},
|
|
1852
|
+
[m, v, I, A, b, k, F, r, t, z]
|
|
1853
|
+
);
|
|
1854
|
+
if (c === !1 || !y && !ee) return null;
|
|
1855
|
+
const oe = (f) => {
|
|
1856
|
+
f.preventDefault(), f.stopPropagation(), y && B(f.type === "dragenter" || f.type === "dragover");
|
|
1857
|
+
}, se = (f) => {
|
|
1858
|
+
var T;
|
|
1859
|
+
f.preventDefault(), f.stopPropagation(), B(!1), y && (T = f.dataTransfer.files) != null && T[0] && le(f.dataTransfer.files[0]);
|
|
1860
|
+
}, de = (f) => {
|
|
1861
|
+
var T;
|
|
1862
|
+
(T = f.target.files) != null && T[0] && (le(f.target.files[0]), f.target.value = "");
|
|
1863
|
+
};
|
|
1864
|
+
return /* @__PURE__ */ g(x, { mb: "4", children: [
|
|
1865
|
+
/* @__PURE__ */ g(S, { align: "center", justify: "between", mb: "2", children: [
|
|
1866
|
+
/* @__PURE__ */ g(S, { align: "center", gap: "1", children: [
|
|
1867
|
+
/* @__PURE__ */ g(h, { as: "label", size: "2", weight: "bold", children: [
|
|
1868
|
+
o,
|
|
1869
|
+
u && /* @__PURE__ */ n(h, { color: "red", children: " *" })
|
|
1870
|
+
] }),
|
|
1871
|
+
!re && ee && y && /* @__PURE__ */ g(he, { children: [
|
|
1872
|
+
/* @__PURE__ */ n(He, { content: "Replace document", children: /* @__PURE__ */ n(
|
|
1873
|
+
Me,
|
|
1874
|
+
{
|
|
1875
|
+
variant: "ghost",
|
|
1876
|
+
size: "1",
|
|
1877
|
+
onClick: () => {
|
|
1878
|
+
var f;
|
|
1879
|
+
return (f = W.current) == null ? void 0 : f.click();
|
|
1880
|
+
},
|
|
1881
|
+
"aria-label": "Replace document",
|
|
1882
|
+
children: /* @__PURE__ */ n(Ne, {})
|
|
1883
|
+
}
|
|
1884
|
+
) }),
|
|
1885
|
+
/* @__PURE__ */ n(He, { content: "Remove document", children: /* @__PURE__ */ n(Me, { variant: "ghost", size: "1", color: "gray", onClick: () => {
|
|
1886
|
+
y && (++j.current, C(null), V("empty"), t(r, void 0));
|
|
1887
|
+
}, "aria-label": "Remove document", children: /* @__PURE__ */ n(Ye, {}) }) })
|
|
1888
|
+
] })
|
|
1889
|
+
] }),
|
|
1890
|
+
/* @__PURE__ */ g(S, { align: "center", gap: "2", children: [
|
|
1891
|
+
/* @__PURE__ */ g(h, { size: "1", color: "gray", children: [
|
|
1892
|
+
ye(v),
|
|
1893
|
+
" max · ",
|
|
1894
|
+
ve(m)
|
|
1895
|
+
] }),
|
|
1896
|
+
re && y && /* @__PURE__ */ g(De, { size: "1", variant: "soft", onClick: () => {
|
|
1897
|
+
var f;
|
|
1898
|
+
return (f = W.current) == null ? void 0 : f.click();
|
|
1899
|
+
}, disabled: _ === "parsing", children: [
|
|
1900
|
+
_ === "parsing" ? /* @__PURE__ */ n(xe, { size: "1" }) : /* @__PURE__ */ n(Ne, {}),
|
|
1901
|
+
"Upload"
|
|
1902
|
+
] })
|
|
1903
|
+
] })
|
|
1904
|
+
] }),
|
|
1905
|
+
(re || ee) && O && /* @__PURE__ */ n(h, { size: "2", color: "red", mb: "2", style: { display: "block" }, children: O }),
|
|
1906
|
+
/* @__PURE__ */ n("input", { ref: W, type: "file", style: { display: "none" }, accept: m, onChange: de }),
|
|
1907
|
+
!re && y && !ee && /* @__PURE__ */ n(
|
|
1908
|
+
"div",
|
|
1909
|
+
{
|
|
1910
|
+
role: "button",
|
|
1911
|
+
tabIndex: 0,
|
|
1912
|
+
onClick: () => {
|
|
1913
|
+
var f;
|
|
1914
|
+
return (f = W.current) == null ? void 0 : f.click();
|
|
1915
|
+
},
|
|
1916
|
+
onKeyDown: (f) => {
|
|
1917
|
+
var T;
|
|
1918
|
+
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), (T = W.current) == null || T.click());
|
|
1919
|
+
},
|
|
1920
|
+
onDragEnter: oe,
|
|
1921
|
+
onDragLeave: oe,
|
|
1922
|
+
onDragOver: oe,
|
|
1923
|
+
onDrop: se,
|
|
1924
|
+
style: { cursor: "pointer" },
|
|
1925
|
+
className: [
|
|
1926
|
+
"border-2 border-dashed rounded-lg p-6 text-center",
|
|
1927
|
+
"transition-all duration-200 ease-in-out",
|
|
1928
|
+
H ? "border-blue-500 bg-blue-50" : O ? "border-red-300 bg-red-50" : "border-gray-300 hover:border-blue-400 hover:bg-gray-50"
|
|
1929
|
+
].join(" "),
|
|
1930
|
+
children: /* @__PURE__ */ n(S, { direction: "column", align: "center", gap: "2", children: _ === "parsing" ? /* @__PURE__ */ g(he, { children: [
|
|
1931
|
+
/* @__PURE__ */ n(xe, { size: "3" }),
|
|
1932
|
+
/* @__PURE__ */ n(h, { size: "2", color: "gray", children: "Parsing document…" })
|
|
1933
|
+
] }) : O ? /* @__PURE__ */ g(he, { children: [
|
|
1934
|
+
/* @__PURE__ */ n(Je, { style: { width: 32, height: 32, color: "var(--red-9)" } }),
|
|
1935
|
+
/* @__PURE__ */ n(h, { size: "2", color: "red", weight: "medium", children: O }),
|
|
1936
|
+
/* @__PURE__ */ n(h, { size: "1", color: "gray", children: "Click to try again" })
|
|
1937
|
+
] }) : /* @__PURE__ */ g(he, { children: [
|
|
1938
|
+
/* @__PURE__ */ n(Ne, { style: { width: 32, height: 32, color: "var(--gray-8)" } }),
|
|
1939
|
+
/* @__PURE__ */ n(h, { size: "2", weight: "medium", children: "Click to upload or drag and drop" }),
|
|
1940
|
+
/* @__PURE__ */ g(h, { size: "1", color: "gray", children: [
|
|
1941
|
+
ye(v),
|
|
1942
|
+
" max · ",
|
|
1943
|
+
ve(m)
|
|
1944
|
+
] })
|
|
1945
|
+
] }) })
|
|
1946
|
+
}
|
|
1947
|
+
),
|
|
1948
|
+
!d && /* @__PURE__ */ n(h, { color: "red", size: "1", mt: "2", style: { display: "block" }, children: we(s, o) })
|
|
1949
|
+
] });
|
|
1950
|
+
}, Dn = me(kn), Mn = q(
|
|
1951
|
+
10,
|
|
1952
|
+
ze((e) => {
|
|
1953
|
+
const t = e["x-xml"];
|
|
1954
|
+
return e.type === "object" && typeof t == "object" && t !== null;
|
|
1955
|
+
})
|
|
1956
|
+
);
|
|
1957
|
+
function zn(e, t, r) {
|
|
1958
|
+
const o = {};
|
|
1959
|
+
for (const [u, i] of Object.entries(r)) {
|
|
1960
|
+
const { path: l, default: a } = typeof i == "string" ? { path: i, default: void 0 } : i, s = t ? `${t}.${l}` : l, c = je.data(e, s);
|
|
1581
1961
|
if (c == null) {
|
|
1582
1962
|
if (a === void 0) return;
|
|
1583
|
-
|
|
1963
|
+
o[u] = a;
|
|
1584
1964
|
} else
|
|
1585
|
-
|
|
1965
|
+
o[u] = c;
|
|
1586
1966
|
}
|
|
1587
|
-
return
|
|
1967
|
+
return o;
|
|
1588
1968
|
}
|
|
1589
|
-
async function
|
|
1969
|
+
async function Ln(e, t) {
|
|
1590
1970
|
try {
|
|
1591
|
-
return { status: "ok", value: await
|
|
1971
|
+
return { status: "ok", value: await wr(e, t) };
|
|
1592
1972
|
} catch (r) {
|
|
1593
|
-
return { status: "error", error:
|
|
1973
|
+
return { status: "error", error: qe(r) };
|
|
1594
1974
|
}
|
|
1595
1975
|
}
|
|
1596
|
-
function
|
|
1597
|
-
return e == null ? "" : typeof e == "number" ? e.toFixed(
|
|
1976
|
+
function Fn(e, t) {
|
|
1977
|
+
return e == null ? "" : typeof e == "number" ? e.toFixed(Un(t)) : e instanceof Date ? e.toLocaleDateString() : String(e);
|
|
1598
1978
|
}
|
|
1599
|
-
function
|
|
1979
|
+
function Un(e) {
|
|
1600
1980
|
return Number.isFinite(e) ? Math.min(100, Math.max(0, Math.trunc(e))) : 0;
|
|
1601
1981
|
}
|
|
1602
|
-
const
|
|
1603
|
-
var
|
|
1604
|
-
|
|
1605
|
-
const l =
|
|
1606
|
-
return
|
|
1607
|
-
if (!
|
|
1608
|
-
let
|
|
1609
|
-
const
|
|
1610
|
-
|
|
1982
|
+
const lr = "{value}", Pn = 2, $n = {}, _n = ({ data: e, handleChange: t, path: r, label: o, schema: u, visible: i = !0 }) => {
|
|
1983
|
+
var _;
|
|
1984
|
+
be(i, r, t, null);
|
|
1985
|
+
const l = u == null ? void 0 : u["x-computed"], a = (l == null ? void 0 : l.inputs) ?? $n, s = (l == null ? void 0 : l.formula) ?? "", c = (l == null ? void 0 : l.format) ?? lr, d = (l == null ? void 0 : l.decimals) ?? Pn, y = fr(), p = r.split(".").slice(0, -1).join("."), m = zn((_ = y.core) == null ? void 0 : _.data, p, a), v = m ? JSON.stringify(m) : null, I = y.readonly === !0, [A, b] = $(() => typeof e == "number" ? "ok" : "unavailable"), [k, F] = $(() => typeof e == "number" ? e : null), [z, w] = $(null);
|
|
1986
|
+
return ge(() => {
|
|
1987
|
+
if (!i) return;
|
|
1988
|
+
let V = !1;
|
|
1989
|
+
const O = (C) => {
|
|
1990
|
+
I || C !== (e ?? null) && t(r, C);
|
|
1611
1991
|
};
|
|
1612
1992
|
if (m === void 0) {
|
|
1613
|
-
|
|
1993
|
+
b("unavailable"), w(null), F(null), O(null);
|
|
1614
1994
|
return;
|
|
1615
1995
|
}
|
|
1616
|
-
return
|
|
1617
|
-
if (
|
|
1618
|
-
const
|
|
1619
|
-
if (
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
),
|
|
1996
|
+
return b((C) => C === "ok" ? C : "loading"), Ln(m, s).then((C) => {
|
|
1997
|
+
if (V) return;
|
|
1998
|
+
const H = C.status === "ok" && typeof C.value == "number" && Number.isFinite(C.value) ? C.value : null;
|
|
1999
|
+
if (H === null) {
|
|
2000
|
+
b("error"), w(
|
|
2001
|
+
C.status === "error" ? C.error ?? "Unable to compute value." : "Computed value must be a number."
|
|
2002
|
+
), F(null), O(null);
|
|
1623
2003
|
return;
|
|
1624
2004
|
}
|
|
1625
|
-
|
|
2005
|
+
b("ok"), w(null), F(H), O(H);
|
|
1626
2006
|
}), () => {
|
|
1627
|
-
|
|
2007
|
+
V = !0;
|
|
1628
2008
|
};
|
|
1629
|
-
}, [v,
|
|
1630
|
-
/* @__PURE__ */ n(h, { as: "label", size: "2", weight: "bold", children:
|
|
2009
|
+
}, [v, s, i, I]), i === !1 ? null : /* @__PURE__ */ n(x, { mb: "4", children: /* @__PURE__ */ g(S, { direction: "column", gap: "1", children: [
|
|
2010
|
+
/* @__PURE__ */ n(h, { as: "label", size: "2", weight: "bold", children: o }),
|
|
1631
2011
|
A === "unavailable" ? /* @__PURE__ */ n(h, { size: "2", color: "gray", children: "Not yet available." }) : A === "loading" ? /* @__PURE__ */ g(S, { align: "center", gap: "2", children: [
|
|
1632
|
-
/* @__PURE__ */ n(
|
|
2012
|
+
/* @__PURE__ */ n(xe, { size: "1" }),
|
|
1633
2013
|
/* @__PURE__ */ n(h, { size: "2", color: "gray", children: "Computing…" })
|
|
1634
|
-
] }) : A === "error" ? /* @__PURE__ */ n(h, { size: "2", color: "red", children:
|
|
1635
|
-
|
|
2014
|
+
] }) : A === "error" ? /* @__PURE__ */ n(h, { size: "2", color: "red", children: z }) : /* @__PURE__ */ n(h, { size: "2", children: c.split(lr).join(Fn(k, d)) }),
|
|
2015
|
+
u.description && /* @__PURE__ */ n(h, { size: "1", color: "gray", children: u.description })
|
|
1636
2016
|
] }) });
|
|
1637
|
-
},
|
|
2017
|
+
}, Vn = me(_n), Hn = q(
|
|
1638
2018
|
5,
|
|
1639
2019
|
ze((e) => {
|
|
1640
2020
|
const t = e["x-computed"];
|
|
1641
2021
|
return e.type === "number" && typeof t == "object" && t !== null;
|
|
1642
2022
|
})
|
|
1643
|
-
),
|
|
2023
|
+
), Wn = ({
|
|
1644
2024
|
data: e,
|
|
1645
2025
|
path: t,
|
|
1646
2026
|
schema: r,
|
|
1647
|
-
uischema:
|
|
1648
|
-
enabled:
|
|
1649
|
-
visible:
|
|
2027
|
+
uischema: o,
|
|
2028
|
+
enabled: u,
|
|
2029
|
+
visible: i,
|
|
1650
2030
|
addItem: l,
|
|
1651
2031
|
removeItems: a,
|
|
1652
|
-
rootSchema:
|
|
2032
|
+
rootSchema: s,
|
|
1653
2033
|
arraySchema: c
|
|
1654
2034
|
}) => {
|
|
1655
|
-
const
|
|
1656
|
-
if (
|
|
2035
|
+
const d = c ? r : r.items, y = c || r;
|
|
2036
|
+
if (i === !1 || !d || typeof d != "object" || Array.isArray(d))
|
|
1657
2037
|
return null;
|
|
1658
|
-
const p =
|
|
1659
|
-
const
|
|
1660
|
-
l && l(t,
|
|
1661
|
-
},
|
|
2038
|
+
const p = d, m = Array.isArray(e) ? e : [], v = y.title || "Array Items", I = o.options ?? {}, A = u && I.addable !== !1, b = u && I.removable !== !1, k = () => {
|
|
2039
|
+
const z = Lr(p, s);
|
|
2040
|
+
l && l(t, z)();
|
|
2041
|
+
}, F = (z) => {
|
|
1662
2042
|
if (a) {
|
|
1663
|
-
const
|
|
1664
|
-
|
|
2043
|
+
const w = a(t, [z]);
|
|
2044
|
+
w && w();
|
|
1665
2045
|
}
|
|
1666
2046
|
};
|
|
1667
|
-
return /* @__PURE__ */ n(
|
|
2047
|
+
return /* @__PURE__ */ n(x, { mb: "6", children: /* @__PURE__ */ g(S, { direction: "column", gap: "4", children: [
|
|
1668
2048
|
/* @__PURE__ */ n(h, { as: "div", size: "4", weight: "bold", children: v }),
|
|
1669
|
-
m.length === 0 && /* @__PURE__ */ n(
|
|
1670
|
-
m.map((
|
|
1671
|
-
var
|
|
1672
|
-
const
|
|
1673
|
-
return /* @__PURE__ */ n(
|
|
2049
|
+
m.length === 0 && /* @__PURE__ */ n(x, { py: "4", px: "4", style: { backgroundColor: "var(--gray-3)", borderRadius: "var(--radius-3)" }, children: /* @__PURE__ */ n(h, { size: "2", color: "gray", children: "No items have been added yet." }) }),
|
|
2050
|
+
m.map((z, w) => {
|
|
2051
|
+
var V;
|
|
2052
|
+
const _ = `${t}.${w}`;
|
|
2053
|
+
return /* @__PURE__ */ n(pr, { size: "3", variant: "surface", children: /* @__PURE__ */ g(S, { direction: "column", gap: "4", children: [
|
|
1674
2054
|
/* @__PURE__ */ g(S, { justify: "between", align: "center", children: [
|
|
1675
2055
|
/* @__PURE__ */ g(h, { size: "3", weight: "bold", children: [
|
|
1676
2056
|
"Item ",
|
|
1677
|
-
|
|
2057
|
+
w + 1
|
|
1678
2058
|
] }),
|
|
1679
|
-
|
|
1680
|
-
|
|
2059
|
+
b && /* @__PURE__ */ g(
|
|
2060
|
+
De,
|
|
1681
2061
|
{
|
|
1682
2062
|
type: "button",
|
|
1683
2063
|
color: "red",
|
|
1684
2064
|
variant: "soft",
|
|
1685
|
-
onClick: () =>
|
|
2065
|
+
onClick: () => F(w),
|
|
1686
2066
|
title: "Remove item",
|
|
1687
2067
|
children: [
|
|
1688
|
-
/* @__PURE__ */ n(
|
|
2068
|
+
/* @__PURE__ */ n(Xr, {}),
|
|
1689
2069
|
"Remove"
|
|
1690
2070
|
]
|
|
1691
2071
|
}
|
|
1692
2072
|
)
|
|
1693
2073
|
] }),
|
|
1694
|
-
/* @__PURE__ */ n(
|
|
1695
|
-
|
|
2074
|
+
/* @__PURE__ */ n(x, { children: /* @__PURE__ */ n(
|
|
2075
|
+
Fe,
|
|
1696
2076
|
{
|
|
1697
2077
|
schema: p,
|
|
1698
|
-
uischema: ((
|
|
2078
|
+
uischema: ((V = o.options) == null ? void 0 : V.detail) || (p.type === "object" || p.properties ? {
|
|
1699
2079
|
type: "VerticalLayout",
|
|
1700
|
-
elements: Object.keys(p.properties || {}).map((
|
|
2080
|
+
elements: Object.keys(p.properties || {}).map((O) => ({
|
|
1701
2081
|
type: "Control",
|
|
1702
|
-
scope: `#/properties/${
|
|
2082
|
+
scope: `#/properties/${O}`
|
|
1703
2083
|
}))
|
|
1704
2084
|
} : {
|
|
1705
2085
|
type: "Control",
|
|
1706
2086
|
scope: "#"
|
|
1707
2087
|
}),
|
|
1708
|
-
path:
|
|
1709
|
-
enabled:
|
|
2088
|
+
path: _,
|
|
2089
|
+
enabled: u,
|
|
1710
2090
|
renderers: void 0,
|
|
1711
2091
|
cells: void 0
|
|
1712
2092
|
}
|
|
1713
2093
|
) })
|
|
1714
|
-
] }) },
|
|
2094
|
+
] }) }, _);
|
|
1715
2095
|
}),
|
|
1716
|
-
|
|
1717
|
-
/* @__PURE__ */ n(
|
|
2096
|
+
A && /* @__PURE__ */ n(x, { mt: "2", children: /* @__PURE__ */ g(De, { type: "button", variant: "surface", onClick: k, children: [
|
|
2097
|
+
/* @__PURE__ */ n(Br, {}),
|
|
1718
2098
|
"Add Item"
|
|
1719
2099
|
] }) })
|
|
1720
2100
|
] }) });
|
|
1721
|
-
},
|
|
2101
|
+
}, sr = Pr(Wn), Xn = q(3, Fr), Bn = ({ uischema: e, visible: t }) => {
|
|
1722
2102
|
const r = e;
|
|
1723
|
-
return t === !1 ? null : /* @__PURE__ */ n(
|
|
1724
|
-
},
|
|
1725
|
-
{ tester:
|
|
1726
|
-
{ tester:
|
|
1727
|
-
{ tester:
|
|
1728
|
-
{ tester:
|
|
1729
|
-
{ tester: ct, renderer: st },
|
|
1730
|
-
{ tester: nt, renderer: ot },
|
|
1731
|
-
{ tester: ft, renderer: ht },
|
|
2103
|
+
return t === !1 ? null : /* @__PURE__ */ n(x, { mb: "4", children: /* @__PURE__ */ n(hr, { size: "4", children: r.text }) });
|
|
2104
|
+
}, jn = q(1, Le("Label")), Kn = q(3, Ur), io = [
|
|
2105
|
+
{ tester: Zr, renderer: Qr },
|
|
2106
|
+
{ tester: rt, renderer: tt },
|
|
2107
|
+
{ tester: ot, renderer: it },
|
|
2108
|
+
{ tester: st, renderer: ct },
|
|
1732
2109
|
{ tester: mt, renderer: pt },
|
|
1733
|
-
{ tester:
|
|
1734
|
-
{ tester: bt, renderer:
|
|
1735
|
-
{ tester:
|
|
2110
|
+
{ tester: ut, renderer: dt },
|
|
2111
|
+
{ tester: bt, renderer: wt },
|
|
2112
|
+
{ tester: Rt, renderer: Et },
|
|
1736
2113
|
{ tester: At, renderer: Tt },
|
|
1737
|
-
{ tester:
|
|
1738
|
-
{ tester:
|
|
1739
|
-
{ tester:
|
|
1740
|
-
{ tester:
|
|
1741
|
-
|
|
2114
|
+
{ tester: St, renderer: Ct },
|
|
2115
|
+
{ tester: Nt, renderer: Ot },
|
|
2116
|
+
{ tester: Dt, renderer: kt },
|
|
2117
|
+
{ tester: yn, renderer: gn },
|
|
2118
|
+
// After SpreadsheetControl on purpose: both testers rank 10, and a tie is
|
|
2119
|
+
// resolved by registration order (see XmlControlTester's comment).
|
|
2120
|
+
{ tester: Mn, renderer: Dn },
|
|
2121
|
+
{ tester: Hn, renderer: Vn },
|
|
2122
|
+
{ tester: Xn, renderer: sr },
|
|
2123
|
+
{ tester: Kn, renderer: sr },
|
|
2124
|
+
{ tester: jn, renderer: Bn }
|
|
1742
2125
|
];
|
|
1743
2126
|
export {
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
2127
|
+
sr as ArrayControl,
|
|
2128
|
+
Xn as ArrayControlTester,
|
|
2129
|
+
nt as BooleanControl,
|
|
2130
|
+
ot as BooleanControlTester,
|
|
2131
|
+
Ot as CategorizationLayoutRenderer,
|
|
2132
|
+
Nt as CategorizationLayoutTester,
|
|
2133
|
+
Vn as ComputedControl,
|
|
2134
|
+
Hn as ComputedControlTester,
|
|
2135
|
+
vt as DateControl,
|
|
2136
|
+
bt as DateControlTester,
|
|
2137
|
+
kt as FileControl,
|
|
2138
|
+
Dt as FileControlTester,
|
|
2139
|
+
Ct as GroupLayoutRenderer,
|
|
2140
|
+
St as GroupLayoutTester,
|
|
2141
|
+
Tt as HorizontalLayoutRenderer,
|
|
2142
|
+
At as HorizontalLayoutTester,
|
|
2143
|
+
Bn as LabelRenderer,
|
|
2144
|
+
jn as LabelTester,
|
|
2145
|
+
et as NumberControl,
|
|
2146
|
+
rt as NumberControlTester,
|
|
2147
|
+
lt as RadioControl,
|
|
2148
|
+
st as RadioControlTester,
|
|
2149
|
+
pt as SearchSelectControl,
|
|
2150
|
+
mt as SearchSelectControlTester,
|
|
2151
|
+
oo as SearchServiceProvider,
|
|
2152
|
+
at as SelectControl,
|
|
2153
|
+
ut as SelectControlTester,
|
|
2154
|
+
gn as SpreadsheetControl,
|
|
2155
|
+
yn as SpreadsheetControlTester,
|
|
2156
|
+
qr as TextControl,
|
|
2157
|
+
Zr as TextControlTester,
|
|
2158
|
+
no as UploadProvider,
|
|
2159
|
+
Et as VerticalLayoutRenderer,
|
|
2160
|
+
Rt as VerticalLayoutTester,
|
|
2161
|
+
Dn as XmlControl,
|
|
2162
|
+
Mn as XmlControlTester,
|
|
2163
|
+
io as radixRenderers,
|
|
2164
|
+
Jr as useSearchService,
|
|
2165
|
+
Yr as useUpload
|
|
1781
2166
|
};
|