@fileflow/sdk 0.1.29 → 0.1.31
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/ImportWizard-BsXU0Tm7.js +64 -0
- package/dist/ImportWizard-BsXU0Tm7.js.map +1 -0
- package/dist/{ImportWizard-Cux3nYN4.mjs → ImportWizard-C7vsPfrT.mjs} +1184 -1267
- package/dist/ImportWizard-C7vsPfrT.mjs.map +1 -0
- package/dist/{KYCWizard-DecrJ0MW.js → KYCWizard-C9OMqfkX.js} +2 -2
- package/dist/{KYCWizard-DecrJ0MW.js.map → KYCWizard-C9OMqfkX.js.map} +1 -1
- package/dist/{KYCWizard-D9W8V70o.mjs → KYCWizard-a5sYPhrA.mjs} +2 -2
- package/dist/{KYCWizard-D9W8V70o.mjs.map → KYCWizard-a5sYPhrA.mjs.map} +1 -1
- package/dist/import.d.ts +9 -24
- package/dist/import.js +1 -1
- package/dist/import.mjs +1 -1
- package/dist/{index-Dn3cI9sZ.mjs → index-BOU2aWf8.mjs} +212 -212
- package/dist/{index-Dn3cI9sZ.mjs.map → index-BOU2aWf8.mjs.map} +1 -1
- package/dist/{index-RFYSKfrk.js → index-DnSXPtpU.js} +14 -14
- package/dist/{index-RFYSKfrk.js.map → index-DnSXPtpU.js.map} +1 -1
- package/dist/index.d.ts +9 -24
- package/dist/index.js +1 -1
- package/dist/index.mjs +3 -3
- package/dist/kyc.js +1 -1
- package/dist/kyc.mjs +1 -1
- package/dist/styles.css +66 -3
- package/package.json +1 -1
- package/dist/ImportWizard-Cux3nYN4.mjs.map +0 -1
- package/dist/ImportWizard-lxWu3Ydd.js +0 -79
- package/dist/ImportWizard-lxWu3Ydd.js.map +0 -1
|
@@ -1,65 +1,49 @@
|
|
|
1
|
-
import { jsx as d, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { h as
|
|
1
|
+
import { jsx as d, jsxs as w, Fragment as le } from "react/jsx-runtime";
|
|
2
|
+
import * as be from "react";
|
|
3
|
+
import Nt, { useCallback as ye, useState as T, useMemo as Ye, useEffect as Je } from "react";
|
|
4
|
+
import { h as J, j as Vt, k as Pt, X as Se, m as Z, U as kt, n as Oe, T as De, q as Et, p as st, o as et, t as bt, d as Dt, V as tt, g as de, S as _e, L as he } from "./index-BOU2aWf8.mjs";
|
|
5
5
|
/**
|
|
6
6
|
* @license lucide-react v0.563.0 - ISC
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the ISC license.
|
|
9
9
|
* See the LICENSE file in the root directory of this source tree.
|
|
10
10
|
*/
|
|
11
|
-
const
|
|
11
|
+
const Lt = [
|
|
12
12
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
13
13
|
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
14
|
-
],
|
|
14
|
+
], zt = J("arrow-right", Lt);
|
|
15
15
|
/**
|
|
16
16
|
* @license lucide-react v0.563.0 - ISC
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the ISC license.
|
|
19
19
|
* See the LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
|
-
const
|
|
21
|
+
const At = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Ht = J("check", At);
|
|
22
22
|
/**
|
|
23
23
|
* @license lucide-react v0.563.0 - ISC
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the ISC license.
|
|
26
26
|
* See the LICENSE file in the root directory of this source tree.
|
|
27
27
|
*/
|
|
28
|
-
const
|
|
28
|
+
const Gt = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Ot = J("chevron-left", Gt);
|
|
29
29
|
/**
|
|
30
30
|
* @license lucide-react v0.563.0 - ISC
|
|
31
31
|
*
|
|
32
32
|
* This source code is licensed under the ISC license.
|
|
33
33
|
* See the LICENSE file in the root directory of this source tree.
|
|
34
34
|
*/
|
|
35
|
-
const
|
|
35
|
+
const Tt = [
|
|
36
36
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
37
37
|
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
|
|
38
38
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
39
|
-
],
|
|
40
|
-
/**
|
|
41
|
-
* @license lucide-react v0.563.0 - ISC
|
|
42
|
-
*
|
|
43
|
-
* This source code is licensed under the ISC license.
|
|
44
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/
|
|
46
|
-
const Gt = [
|
|
47
|
-
[
|
|
48
|
-
"path",
|
|
49
|
-
{
|
|
50
|
-
d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
|
|
51
|
-
key: "1nclc0"
|
|
52
|
-
}
|
|
53
|
-
],
|
|
54
|
-
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
55
|
-
], Ot = q("eye", Gt);
|
|
39
|
+
], Bt = J("circle-question-mark", Tt);
|
|
56
40
|
/**
|
|
57
41
|
* @license lucide-react v0.563.0 - ISC
|
|
58
42
|
*
|
|
59
43
|
* This source code is licensed under the ISC license.
|
|
60
44
|
* See the LICENSE file in the root directory of this source tree.
|
|
61
45
|
*/
|
|
62
|
-
const
|
|
46
|
+
const Kt = [
|
|
63
47
|
[
|
|
64
48
|
"path",
|
|
65
49
|
{
|
|
@@ -72,14 +56,14 @@ const Tt = [
|
|
|
72
56
|
["path", { d: "M14 13h2", key: "un5t4a" }],
|
|
73
57
|
["path", { d: "M8 17h2", key: "2yhykz" }],
|
|
74
58
|
["path", { d: "M14 17h2", key: "10kma7" }]
|
|
75
|
-
],
|
|
59
|
+
], jt = J("file-spreadsheet", Kt);
|
|
76
60
|
/**
|
|
77
61
|
* @license lucide-react v0.563.0 - ISC
|
|
78
62
|
*
|
|
79
63
|
* This source code is licensed under the ISC license.
|
|
80
64
|
* See the LICENSE file in the root directory of this source tree.
|
|
81
65
|
*/
|
|
82
|
-
const
|
|
66
|
+
const qt = [
|
|
83
67
|
[
|
|
84
68
|
"path",
|
|
85
69
|
{
|
|
@@ -88,19 +72,7 @@ const Kt = [
|
|
|
88
72
|
}
|
|
89
73
|
],
|
|
90
74
|
["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
|
|
91
|
-
],
|
|
92
|
-
/**
|
|
93
|
-
* @license lucide-react v0.563.0 - ISC
|
|
94
|
-
*
|
|
95
|
-
* This source code is licensed under the ISC license.
|
|
96
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/
|
|
98
|
-
const qt = [
|
|
99
|
-
["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
|
|
100
|
-
["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
|
|
101
|
-
["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
|
|
102
|
-
["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
|
|
103
|
-
], Ut = q("git-branch", qt);
|
|
75
|
+
], Ut = J("file", qt);
|
|
104
76
|
/**
|
|
105
77
|
* @license lucide-react v0.563.0 - ISC
|
|
106
78
|
*
|
|
@@ -115,7 +87,7 @@ const Xt = [
|
|
|
115
87
|
key: "1a8usu"
|
|
116
88
|
}
|
|
117
89
|
]
|
|
118
|
-
], Zt =
|
|
90
|
+
], Zt = J("pen", Xt);
|
|
119
91
|
/**
|
|
120
92
|
* @license lucide-react v0.563.0 - ISC
|
|
121
93
|
*
|
|
@@ -123,25 +95,12 @@ const Xt = [
|
|
|
123
95
|
* See the LICENSE file in the root directory of this source tree.
|
|
124
96
|
*/
|
|
125
97
|
const Wt = [
|
|
126
|
-
[
|
|
127
|
-
"path",
|
|
128
|
-
{ d: "M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344", key: "2acyp4" }
|
|
129
|
-
],
|
|
130
|
-
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
131
|
-
], Qt = q("square-check-big", Wt);
|
|
132
|
-
/**
|
|
133
|
-
* @license lucide-react v0.563.0 - ISC
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the ISC license.
|
|
136
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/
|
|
138
|
-
const Yt = [
|
|
139
98
|
["path", { d: "M10 11v6", key: "nco0om" }],
|
|
140
99
|
["path", { d: "M14 11v6", key: "outv1u" }],
|
|
141
100
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
142
101
|
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
143
102
|
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
144
|
-
],
|
|
103
|
+
], Qt = J("trash-2", Wt), nt = {
|
|
145
104
|
sessionId: null,
|
|
146
105
|
status: "idle",
|
|
147
106
|
step: "upload",
|
|
@@ -163,7 +122,7 @@ const Yt = [
|
|
|
163
122
|
editingCell: null,
|
|
164
123
|
editedRows: /* @__PURE__ */ new Set()
|
|
165
124
|
};
|
|
166
|
-
function
|
|
125
|
+
function it(e, o) {
|
|
167
126
|
var r;
|
|
168
127
|
const t = [], n = (e == null ? void 0 : e.trim()) || "";
|
|
169
128
|
if (o.required && !n)
|
|
@@ -189,7 +148,7 @@ function en(e, o) {
|
|
|
189
148
|
message: "Invalid email format"
|
|
190
149
|
});
|
|
191
150
|
else {
|
|
192
|
-
const s = (r = n.split("@")[1]) == null ? void 0 : r.toLowerCase(),
|
|
151
|
+
const s = (r = n.split("@")[1]) == null ? void 0 : r.toLowerCase(), u = {
|
|
193
152
|
"gmial.com": "gmail.com",
|
|
194
153
|
"gmal.com": "gmail.com",
|
|
195
154
|
"gmai.com": "gmail.com",
|
|
@@ -210,14 +169,14 @@ function en(e, o) {
|
|
|
210
169
|
"outloo.com": "outlook.com",
|
|
211
170
|
"outlook.co": "outlook.com"
|
|
212
171
|
};
|
|
213
|
-
s &&
|
|
172
|
+
s && u[s] && t.push({
|
|
214
173
|
rowIndex: 0,
|
|
215
174
|
columnKey: o.key,
|
|
216
175
|
value: n,
|
|
217
176
|
severity: "warning",
|
|
218
177
|
validatorType: "type",
|
|
219
|
-
message: `Possible typo: did you mean @${
|
|
220
|
-
suggestion: `${n.split("@")[0]}@${
|
|
178
|
+
message: `Possible typo: did you mean @${u[s]}?`,
|
|
179
|
+
suggestion: `${n.split("@")[0]}@${u[s]}`
|
|
221
180
|
});
|
|
222
181
|
}
|
|
223
182
|
break;
|
|
@@ -266,35 +225,35 @@ function en(e, o) {
|
|
|
266
225
|
}
|
|
267
226
|
if (o.validators)
|
|
268
227
|
for (const l of o.validators) {
|
|
269
|
-
const s = l.severity === "info" ? "warning" : l.severity || "error",
|
|
228
|
+
const s = l.severity === "info" ? "warning" : l.severity || "error", u = l.params || {};
|
|
270
229
|
switch (l.type) {
|
|
271
230
|
case "minLength": {
|
|
272
|
-
const
|
|
273
|
-
n.length <
|
|
231
|
+
const a = u.value ?? 0;
|
|
232
|
+
n.length < a && t.push({
|
|
274
233
|
rowIndex: 0,
|
|
275
234
|
columnKey: o.key,
|
|
276
235
|
value: n,
|
|
277
236
|
severity: s,
|
|
278
237
|
validatorType: l.type,
|
|
279
|
-
message: l.message || `Must be at least ${
|
|
238
|
+
message: l.message || `Must be at least ${a} characters`
|
|
280
239
|
});
|
|
281
240
|
break;
|
|
282
241
|
}
|
|
283
242
|
case "maxLength": {
|
|
284
|
-
const
|
|
285
|
-
n.length >
|
|
243
|
+
const a = u.value ?? 1 / 0;
|
|
244
|
+
n.length > a && t.push({
|
|
286
245
|
rowIndex: 0,
|
|
287
246
|
columnKey: o.key,
|
|
288
247
|
value: n,
|
|
289
248
|
severity: s,
|
|
290
249
|
validatorType: l.type,
|
|
291
|
-
message: l.message || `Must be at most ${
|
|
250
|
+
message: l.message || `Must be at most ${a} characters`
|
|
292
251
|
});
|
|
293
252
|
break;
|
|
294
253
|
}
|
|
295
254
|
case "min": {
|
|
296
|
-
const
|
|
297
|
-
!isNaN(
|
|
255
|
+
const a = parseFloat(n), f = u.value ?? -1 / 0;
|
|
256
|
+
!isNaN(a) && a < f && t.push({
|
|
298
257
|
rowIndex: 0,
|
|
299
258
|
columnKey: o.key,
|
|
300
259
|
value: n,
|
|
@@ -305,8 +264,8 @@ function en(e, o) {
|
|
|
305
264
|
break;
|
|
306
265
|
}
|
|
307
266
|
case "max": {
|
|
308
|
-
const
|
|
309
|
-
!isNaN(
|
|
267
|
+
const a = parseFloat(n), f = u.value ?? 1 / 0;
|
|
268
|
+
!isNaN(a) && a > f && t.push({
|
|
310
269
|
rowIndex: 0,
|
|
311
270
|
columnKey: o.key,
|
|
312
271
|
value: n,
|
|
@@ -317,8 +276,8 @@ function en(e, o) {
|
|
|
317
276
|
break;
|
|
318
277
|
}
|
|
319
278
|
case "pattern": {
|
|
320
|
-
const
|
|
321
|
-
new RegExp(
|
|
279
|
+
const a = u.regex ?? u.pattern ?? ".*";
|
|
280
|
+
new RegExp(a).test(n) || t.push({
|
|
322
281
|
rowIndex: 0,
|
|
323
282
|
columnKey: o.key,
|
|
324
283
|
value: n,
|
|
@@ -329,21 +288,21 @@ function en(e, o) {
|
|
|
329
288
|
break;
|
|
330
289
|
}
|
|
331
290
|
case "enum": {
|
|
332
|
-
const
|
|
333
|
-
|
|
291
|
+
const a = u.values || [];
|
|
292
|
+
a.map((g) => g.toLowerCase()).includes(n.toLowerCase()) || t.push({
|
|
334
293
|
rowIndex: 0,
|
|
335
294
|
columnKey: o.key,
|
|
336
295
|
value: n,
|
|
337
296
|
severity: s,
|
|
338
297
|
validatorType: l.type,
|
|
339
|
-
message: l.message || `Must be one of: ${
|
|
298
|
+
message: l.message || `Must be one of: ${a.slice(0, 5).join(", ")}${a.length > 5 ? "..." : ""}`
|
|
340
299
|
});
|
|
341
300
|
break;
|
|
342
301
|
}
|
|
343
302
|
case "custom": {
|
|
344
|
-
const
|
|
345
|
-
if (
|
|
346
|
-
const f =
|
|
303
|
+
const a = u.validatorName;
|
|
304
|
+
if (a === "commaSeparatedEnum") {
|
|
305
|
+
const f = u.allowedValues || [], g = n.split(",").map((i) => i.trim().toLowerCase()).filter((i) => i), p = f.map((i) => i.toLowerCase()), c = g.filter((i) => !p.includes(i));
|
|
347
306
|
c.length > 0 && t.push({
|
|
348
307
|
rowIndex: 0,
|
|
349
308
|
columnKey: o.key,
|
|
@@ -353,15 +312,15 @@ function en(e, o) {
|
|
|
353
312
|
message: l.message || `Invalid values: ${c.join(", ")}. Must be comma-separated values from: ${f.slice(0, 5).join(", ")}${f.length > 5 ? "..." : ""}`
|
|
354
313
|
});
|
|
355
314
|
}
|
|
356
|
-
if (
|
|
357
|
-
const
|
|
358
|
-
|
|
315
|
+
if (a === "commaSeparatedEmails") {
|
|
316
|
+
const g = n.split(",").map((p) => p.trim()).filter((p) => p).filter((p) => !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p));
|
|
317
|
+
g.length > 0 && t.push({
|
|
359
318
|
rowIndex: 0,
|
|
360
319
|
columnKey: o.key,
|
|
361
320
|
value: n,
|
|
362
321
|
severity: s,
|
|
363
322
|
validatorType: l.type,
|
|
364
|
-
message: `Invalid email(s): ${
|
|
323
|
+
message: `Invalid email(s): ${g.join(", ")}`
|
|
365
324
|
});
|
|
366
325
|
}
|
|
367
326
|
break;
|
|
@@ -370,96 +329,96 @@ function en(e, o) {
|
|
|
370
329
|
}
|
|
371
330
|
return t;
|
|
372
331
|
}
|
|
373
|
-
function
|
|
332
|
+
function Fe(e, o, t) {
|
|
374
333
|
var C;
|
|
375
334
|
const n = [];
|
|
376
|
-
for (const
|
|
377
|
-
for (const
|
|
378
|
-
if (!
|
|
379
|
-
const
|
|
380
|
-
if (!
|
|
381
|
-
const
|
|
382
|
-
for (const P of
|
|
383
|
-
n.push({ ...P, rowIndex:
|
|
335
|
+
for (const v of e)
|
|
336
|
+
for (const S of t) {
|
|
337
|
+
if (!S.targetKey) continue;
|
|
338
|
+
const I = o.columns.find((P) => P.key === S.targetKey);
|
|
339
|
+
if (!I) continue;
|
|
340
|
+
const F = v.data[S.targetKey] || v.data[S.sourceColumn] || "", M = it(String(F), I);
|
|
341
|
+
for (const P of M)
|
|
342
|
+
n.push({ ...P, rowIndex: v.rowIndex });
|
|
384
343
|
}
|
|
385
344
|
const r = ((C = o.options) == null ? void 0 : C.uniqueKeys) || [];
|
|
386
|
-
for (const
|
|
387
|
-
const
|
|
388
|
-
if (!
|
|
389
|
-
const
|
|
390
|
-
for (const
|
|
391
|
-
const
|
|
392
|
-
if (!
|
|
393
|
-
const P =
|
|
394
|
-
P.push(
|
|
345
|
+
for (const v of r) {
|
|
346
|
+
const S = t.find((F) => F.targetKey === v);
|
|
347
|
+
if (!S) continue;
|
|
348
|
+
const I = /* @__PURE__ */ new Map();
|
|
349
|
+
for (const F of e) {
|
|
350
|
+
const M = String(F.data[v] || F.data[S.sourceColumn] || "").toLowerCase().trim();
|
|
351
|
+
if (!M) continue;
|
|
352
|
+
const P = I.get(M) || [];
|
|
353
|
+
P.push(F.rowIndex), I.set(M, P);
|
|
395
354
|
}
|
|
396
|
-
for (const [
|
|
397
|
-
if (
|
|
398
|
-
for (const P of
|
|
355
|
+
for (const [F, M] of I.entries())
|
|
356
|
+
if (M.length > 1)
|
|
357
|
+
for (const P of M.slice(1))
|
|
399
358
|
n.push({
|
|
400
359
|
rowIndex: P,
|
|
401
|
-
columnKey:
|
|
402
|
-
value:
|
|
360
|
+
columnKey: v,
|
|
361
|
+
value: F,
|
|
403
362
|
severity: "warning",
|
|
404
363
|
validatorType: "unique",
|
|
405
|
-
message: `Duplicate ${
|
|
364
|
+
message: `Duplicate ${v} value`
|
|
406
365
|
});
|
|
407
366
|
}
|
|
408
367
|
const l = /* @__PURE__ */ new Map();
|
|
409
|
-
for (const
|
|
410
|
-
const
|
|
411
|
-
|
|
368
|
+
for (const v of n) {
|
|
369
|
+
const S = l.get(v.rowIndex) || [];
|
|
370
|
+
S.push(v), l.set(v.rowIndex, S);
|
|
412
371
|
}
|
|
413
|
-
const s = n.filter((
|
|
414
|
-
for (const
|
|
415
|
-
c[
|
|
416
|
-
columnKey:
|
|
372
|
+
const s = n.filter((v) => v.severity === "error").length, u = n.filter((v) => v.severity === "warning").length, a = n.filter((v) => v.severity === "info").length, f = new Set(n.filter((v) => v.severity === "error").map((v) => v.rowIndex)), g = e.length, p = g - f.size, c = {};
|
|
373
|
+
for (const v of n) {
|
|
374
|
+
c[v.columnKey] || (c[v.columnKey] = {
|
|
375
|
+
columnKey: v.columnKey,
|
|
417
376
|
errorCount: 0,
|
|
418
377
|
warningCount: 0,
|
|
419
378
|
infoCount: 0,
|
|
420
379
|
mostCommonError: void 0
|
|
421
380
|
});
|
|
422
|
-
const
|
|
423
|
-
|
|
381
|
+
const S = c[v.columnKey];
|
|
382
|
+
v.severity === "error" ? S.errorCount++ : v.severity === "warning" ? S.warningCount++ : S.infoCount++, S.mostCommonError || (S.mostCommonError = v.message);
|
|
424
383
|
}
|
|
425
|
-
const
|
|
426
|
-
for (const
|
|
427
|
-
|
|
384
|
+
const i = {};
|
|
385
|
+
for (const v of n)
|
|
386
|
+
i[v.validatorType] = (i[v.validatorType] || 0) + 1;
|
|
428
387
|
const m = [];
|
|
429
|
-
for (const
|
|
430
|
-
const
|
|
431
|
-
if (!
|
|
432
|
-
const
|
|
433
|
-
for (const
|
|
434
|
-
const
|
|
435
|
-
if (!
|
|
436
|
-
const P =
|
|
437
|
-
P.push(
|
|
388
|
+
for (const v of r) {
|
|
389
|
+
const S = t.find((F) => F.targetKey === v);
|
|
390
|
+
if (!S) continue;
|
|
391
|
+
const I = /* @__PURE__ */ new Map();
|
|
392
|
+
for (const F of e) {
|
|
393
|
+
const M = String(F.data[v] || F.data[S.sourceColumn] || "").toLowerCase().trim();
|
|
394
|
+
if (!M) continue;
|
|
395
|
+
const P = I.get(M) || [];
|
|
396
|
+
P.push(F.rowIndex), I.set(M, P);
|
|
438
397
|
}
|
|
439
|
-
for (const [
|
|
440
|
-
|
|
398
|
+
for (const [F, M] of I.entries())
|
|
399
|
+
M.length > 1 && m.push({ columnKey: v, value: F, rowIndices: M });
|
|
441
400
|
}
|
|
442
|
-
const
|
|
401
|
+
const h = {
|
|
443
402
|
byColumn: c,
|
|
444
|
-
byType:
|
|
403
|
+
byType: i,
|
|
445
404
|
duplicates: m.length > 0 ? m : void 0
|
|
446
405
|
};
|
|
447
406
|
return {
|
|
448
407
|
validationResults: {
|
|
449
408
|
isValid: s === 0,
|
|
450
|
-
totalRows:
|
|
451
|
-
validRows:
|
|
409
|
+
totalRows: g,
|
|
410
|
+
validRows: p,
|
|
452
411
|
errorCount: s,
|
|
453
|
-
warningCount:
|
|
454
|
-
infoCount:
|
|
412
|
+
warningCount: u,
|
|
413
|
+
infoCount: a,
|
|
455
414
|
errors: n,
|
|
456
|
-
summary:
|
|
415
|
+
summary: h
|
|
457
416
|
},
|
|
458
417
|
errorsByRow: l
|
|
459
418
|
};
|
|
460
419
|
}
|
|
461
|
-
const
|
|
462
|
-
...
|
|
420
|
+
const se = Vt((e, o) => ({
|
|
421
|
+
...nt,
|
|
463
422
|
setSchema: (t) => e({ schema: t }),
|
|
464
423
|
setSessionId: (t) => e({ sessionId: t }),
|
|
465
424
|
setFile: (t) => e({
|
|
@@ -497,7 +456,7 @@ const le = $t((e, o) => ({
|
|
|
497
456
|
revalidate: () => {
|
|
498
457
|
const t = o();
|
|
499
458
|
if (!t.schema || !t.validationResults) return;
|
|
500
|
-
const { validationResults: n, errorsByRow: r } =
|
|
459
|
+
const { validationResults: n, errorsByRow: r } = Fe(
|
|
501
460
|
t.rows,
|
|
502
461
|
t.schema,
|
|
503
462
|
t.mappings
|
|
@@ -518,56 +477,56 @@ const le = $t((e, o) => ({
|
|
|
518
477
|
}),
|
|
519
478
|
stopEditing: () => e({ editingCell: null }),
|
|
520
479
|
updateCell: (t, n, r) => {
|
|
521
|
-
const l = o(), s = [...l.rows],
|
|
522
|
-
|
|
523
|
-
const
|
|
524
|
-
if (
|
|
525
|
-
const { validationResults: f, errorsByRow:
|
|
480
|
+
const l = o(), s = [...l.rows], u = s.find((f) => f.rowIndex === t);
|
|
481
|
+
u && (u.data = { ...u.data, [n]: String(r) });
|
|
482
|
+
const a = new Set(l.editedRows);
|
|
483
|
+
if (a.add(t), e({ rows: s, editedRows: a, editingCell: null }), l.schema && l.validationResults) {
|
|
484
|
+
const { validationResults: f, errorsByRow: g } = Fe(
|
|
526
485
|
s,
|
|
527
486
|
l.schema,
|
|
528
487
|
l.mappings
|
|
529
488
|
);
|
|
530
|
-
e({ validationResults: f, errorsByRow:
|
|
489
|
+
e({ validationResults: f, errorsByRow: g });
|
|
531
490
|
}
|
|
532
491
|
},
|
|
533
492
|
deleteRow: (t) => {
|
|
534
|
-
const n = o(), l = n.rows.filter((s) => s.rowIndex !== t).map((s,
|
|
493
|
+
const n = o(), l = n.rows.filter((s) => s.rowIndex !== t).map((s, u) => ({ ...s, rowIndex: u }));
|
|
535
494
|
if (e({
|
|
536
495
|
rows: l,
|
|
537
496
|
totalRows: l.length
|
|
538
497
|
}), n.schema && n.validationResults) {
|
|
539
|
-
const { validationResults: s, errorsByRow:
|
|
498
|
+
const { validationResults: s, errorsByRow: u } = Fe(
|
|
540
499
|
l,
|
|
541
500
|
n.schema,
|
|
542
501
|
n.mappings
|
|
543
502
|
);
|
|
544
|
-
e({ validationResults: s, errorsByRow:
|
|
503
|
+
e({ validationResults: s, errorsByRow: u });
|
|
545
504
|
}
|
|
546
505
|
},
|
|
547
506
|
setStatus: (t) => e({ status: t }),
|
|
548
507
|
setLoading: (t) => e({ isLoading: t }),
|
|
549
508
|
setError: (t) => e({ error: t }),
|
|
550
|
-
reset: () => e(
|
|
551
|
-
})),
|
|
509
|
+
reset: () => e(nt)
|
|
510
|
+
})), Yt = ({
|
|
552
511
|
onFileSelect: e,
|
|
553
512
|
maxSize: o = 50 * 1024 * 1024,
|
|
554
513
|
// 50MB
|
|
555
514
|
acceptedTypes: t = [".csv", ".xlsx", ".xls"]
|
|
556
515
|
}) => {
|
|
557
|
-
const { file: n, fileName: r, fileSize: l, setFile: s, error:
|
|
558
|
-
(C,
|
|
559
|
-
if (
|
|
560
|
-
|
|
516
|
+
const { file: n, fileName: r, fileSize: l, setFile: s, error: u, setError: a, isLoading: f } = se(), g = ye(
|
|
517
|
+
(C, v) => {
|
|
518
|
+
if (v.length > 0) {
|
|
519
|
+
a("Invalid file type or file too large");
|
|
561
520
|
return;
|
|
562
521
|
}
|
|
563
522
|
if (C.length > 0) {
|
|
564
|
-
const
|
|
565
|
-
s(
|
|
523
|
+
const S = C[0];
|
|
524
|
+
s(S), e == null || e(S);
|
|
566
525
|
}
|
|
567
526
|
},
|
|
568
|
-
[e, s,
|
|
569
|
-
), { getRootProps:
|
|
570
|
-
onDrop:
|
|
527
|
+
[e, s, a]
|
|
528
|
+
), { getRootProps: p, getInputProps: c, isDragActive: i } = Pt({
|
|
529
|
+
onDrop: g,
|
|
571
530
|
accept: {
|
|
572
531
|
"text/csv": [".csv"],
|
|
573
532
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [".xlsx"],
|
|
@@ -576,45 +535,45 @@ const le = $t((e, o) => ({
|
|
|
576
535
|
maxSize: o,
|
|
577
536
|
multiple: !1,
|
|
578
537
|
disabled: f
|
|
579
|
-
}), m = (C) => C < 1024 ? `${C} B` : C < 1024 * 1024 ? `${(C / 1024).toFixed(1)} KB` : `${(C / (1024 * 1024)).toFixed(1)} MB`,
|
|
580
|
-
C.stopPropagation(),
|
|
538
|
+
}), m = (C) => C < 1024 ? `${C} B` : C < 1024 * 1024 ? `${(C / 1024).toFixed(1)} KB` : `${(C / (1024 * 1024)).toFixed(1)} MB`, h = (C) => {
|
|
539
|
+
C.stopPropagation(), se.getState().reset();
|
|
581
540
|
};
|
|
582
|
-
return n ? /* @__PURE__ */ d("div", { className: "ff-p-4 ff-rounded-xl ff-border", style: { backgroundColor: "var(--ff-success-light)", borderColor: "var(--ff-success)" }, children: /* @__PURE__ */
|
|
583
|
-
/* @__PURE__ */ d("div", { className: "ff-p-2 ff-rounded-lg", style: { backgroundColor: "rgba(41, 142, 51, 0.15)" }, children: /* @__PURE__ */ d(
|
|
584
|
-
/* @__PURE__ */
|
|
541
|
+
return n ? /* @__PURE__ */ d("div", { className: "ff-p-4 ff-rounded-xl ff-border", style: { backgroundColor: "var(--ff-success-light)", borderColor: "var(--ff-success)" }, children: /* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-gap-3", children: [
|
|
542
|
+
/* @__PURE__ */ d("div", { className: "ff-p-2 ff-rounded-lg", style: { backgroundColor: "rgba(41, 142, 51, 0.15)" }, children: /* @__PURE__ */ d(Ut, { className: "ff-w-6 ff-h-6", style: { color: "var(--ff-success)" } }) }),
|
|
543
|
+
/* @__PURE__ */ w("div", { className: "ff-flex-1 ff-min-w-0", children: [
|
|
585
544
|
/* @__PURE__ */ d("p", { className: "ff-font-medium ff-truncate", style: { color: "var(--ff-success-dark)" }, children: r }),
|
|
586
545
|
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-success)" }, children: m(l || 0) })
|
|
587
546
|
] }),
|
|
588
547
|
/* @__PURE__ */ d(
|
|
589
548
|
"button",
|
|
590
549
|
{
|
|
591
|
-
onClick:
|
|
550
|
+
onClick: h,
|
|
592
551
|
className: "ff-p-1.5 ff-rounded-full ff-transition-colors",
|
|
593
552
|
style: { color: "var(--ff-success)" },
|
|
594
553
|
"aria-label": "Remove file",
|
|
595
|
-
children: /* @__PURE__ */ d(
|
|
554
|
+
children: /* @__PURE__ */ d(Se, { className: "ff-w-5 ff-h-5" })
|
|
596
555
|
}
|
|
597
556
|
)
|
|
598
|
-
] }) }) : /* @__PURE__ */
|
|
599
|
-
/* @__PURE__ */
|
|
557
|
+
] }) }) : /* @__PURE__ */ w("div", { className: "ff-space-y-6", children: [
|
|
558
|
+
/* @__PURE__ */ w(
|
|
600
559
|
"div",
|
|
601
560
|
{
|
|
602
|
-
...
|
|
603
|
-
className:
|
|
561
|
+
...p(),
|
|
562
|
+
className: Z(
|
|
604
563
|
"ff-dropzone",
|
|
605
|
-
|
|
564
|
+
i && "ff-dropzone-active",
|
|
606
565
|
f && "ff-opacity-50 ff-cursor-not-allowed"
|
|
607
566
|
),
|
|
608
567
|
children: [
|
|
609
568
|
/* @__PURE__ */ d("input", { ...c() }),
|
|
610
|
-
/* @__PURE__ */ d("div", { className: "ff-dropzone-icon-wrapper", children: /* @__PURE__ */ d(
|
|
611
|
-
/* @__PURE__ */ d("h3", { className: "ff-dropzone-text", children:
|
|
569
|
+
/* @__PURE__ */ d("div", { className: "ff-dropzone-icon-wrapper", children: /* @__PURE__ */ d(kt, { className: "ff-dropzone-icon" }) }),
|
|
570
|
+
/* @__PURE__ */ d("h3", { className: "ff-dropzone-text", children: i ? "Drop your file here" : "Upload your file" }),
|
|
612
571
|
/* @__PURE__ */ d("p", { className: "ff-dropzone-hint", children: "Drag and drop or click to select" }),
|
|
613
|
-
/* @__PURE__ */ d("label", { className: "ff-inline-block", children: /* @__PURE__ */ d("span", { className:
|
|
572
|
+
/* @__PURE__ */ d("label", { className: "ff-inline-block", children: /* @__PURE__ */ d("span", { className: Z(
|
|
614
573
|
"ff-btn ff-btn-primary",
|
|
615
574
|
f && "ff-opacity-50 ff-cursor-wait"
|
|
616
575
|
), children: f ? "Processing..." : "Choose file" }) }),
|
|
617
|
-
/* @__PURE__ */
|
|
576
|
+
/* @__PURE__ */ w("p", { className: "ff-dropzone-formats", children: [
|
|
618
577
|
"Supports ",
|
|
619
578
|
t.join(", "),
|
|
620
579
|
" up to ",
|
|
@@ -623,66 +582,66 @@ const le = $t((e, o) => ({
|
|
|
623
582
|
]
|
|
624
583
|
}
|
|
625
584
|
),
|
|
626
|
-
|
|
627
|
-
/* @__PURE__ */ d(
|
|
628
|
-
/* @__PURE__ */ d("p", { children:
|
|
585
|
+
u && /* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-gap-2 ff-p-4 ff-rounded-lg ff-text-sm", style: { backgroundColor: "var(--ff-error-light)", color: "var(--ff-error)" }, children: [
|
|
586
|
+
/* @__PURE__ */ d(Oe, { className: "ff-w-4 ff-h-4 ff-flex-shrink-0" }),
|
|
587
|
+
/* @__PURE__ */ d("p", { children: u })
|
|
629
588
|
] })
|
|
630
589
|
] });
|
|
631
|
-
},
|
|
632
|
-
const { mappings: o, schema: t, unmappedSource: n, updateMapping: r } =
|
|
633
|
-
const
|
|
634
|
-
r(
|
|
635
|
-
},
|
|
636
|
-
o.filter((
|
|
590
|
+
}, Jt = ({ onMappingChange: e }) => {
|
|
591
|
+
const { mappings: o, schema: t, unmappedSource: n, updateMapping: r } = se(), l = (t == null ? void 0 : t.columns) || [], s = (p, c) => {
|
|
592
|
+
const i = c === "" ? null : c;
|
|
593
|
+
r(p, i), e == null || e(p, i);
|
|
594
|
+
}, u = (p) => p >= 0.85 ? "var(--ff-success)" : p >= 0.6 ? "var(--ff-warning)" : "var(--ff-error)", a = (p) => p >= 0.85 ? "High" : p >= 0.6 ? "Medium" : "Low", g = new Set(
|
|
595
|
+
o.filter((p) => p.targetKey !== null).map((p) => p.targetKey)
|
|
637
596
|
);
|
|
638
|
-
return /* @__PURE__ */
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
-
/* @__PURE__ */
|
|
597
|
+
return /* @__PURE__ */ w("div", { className: "ff-space-y-4", children: [
|
|
598
|
+
/* @__PURE__ */ w("div", { className: "ff-mapping-header", children: [
|
|
599
|
+
/* @__PURE__ */ w("div", { children: [
|
|
641
600
|
/* @__PURE__ */ d("h3", { className: "ff-mapping-title", children: "Column Mapping" }),
|
|
642
601
|
/* @__PURE__ */ d("p", { className: "ff-mapping-subtitle", children: "Match your file columns to the expected fields" })
|
|
643
602
|
] }),
|
|
644
|
-
/* @__PURE__ */
|
|
645
|
-
/* @__PURE__ */
|
|
603
|
+
/* @__PURE__ */ w("div", { className: "ff-mapping-legend", children: [
|
|
604
|
+
/* @__PURE__ */ w("span", { className: "ff-mapping-legend-item", children: [
|
|
646
605
|
/* @__PURE__ */ d("span", { className: "ff-mapping-legend-dot", style: { backgroundColor: "var(--ff-success)" } }),
|
|
647
606
|
/* @__PURE__ */ d("span", { style: { color: "var(--ff-text-secondary)" }, children: "Mapped" })
|
|
648
607
|
] }),
|
|
649
|
-
/* @__PURE__ */
|
|
608
|
+
/* @__PURE__ */ w("span", { className: "ff-mapping-legend-item", children: [
|
|
650
609
|
/* @__PURE__ */ d("span", { className: "ff-mapping-legend-dot", style: { backgroundColor: "var(--ff-warning)" } }),
|
|
651
610
|
/* @__PURE__ */ d("span", { style: { color: "var(--ff-text-secondary)" }, children: "Review" })
|
|
652
611
|
] }),
|
|
653
|
-
/* @__PURE__ */
|
|
612
|
+
/* @__PURE__ */ w("span", { className: "ff-mapping-legend-item", children: [
|
|
654
613
|
/* @__PURE__ */ d("span", { className: "ff-mapping-legend-dot", style: { backgroundColor: "var(--ff-gray-70)" } }),
|
|
655
614
|
/* @__PURE__ */ d("span", { style: { color: "var(--ff-text-secondary)" }, children: "Unmapped" })
|
|
656
615
|
] })
|
|
657
616
|
] })
|
|
658
617
|
] }),
|
|
659
|
-
/* @__PURE__ */ d("div", { className: "ff-space-y-2", children: o.map((
|
|
660
|
-
l.find((m) => m.key ===
|
|
661
|
-
const c =
|
|
662
|
-
return /* @__PURE__ */
|
|
618
|
+
/* @__PURE__ */ d("div", { className: "ff-space-y-2", children: o.map((p) => {
|
|
619
|
+
l.find((m) => m.key === p.targetKey);
|
|
620
|
+
const c = p.targetKey !== null, i = p.confidence >= 0.85;
|
|
621
|
+
return /* @__PURE__ */ w(
|
|
663
622
|
"div",
|
|
664
623
|
{
|
|
665
|
-
className:
|
|
624
|
+
className: Z(
|
|
666
625
|
"ff-mapping-row",
|
|
667
|
-
c &&
|
|
668
|
-
c && !
|
|
626
|
+
c && i && "ff-mapping-row-success",
|
|
627
|
+
c && !i && "ff-mapping-row-warning"
|
|
669
628
|
),
|
|
670
629
|
children: [
|
|
671
|
-
/* @__PURE__ */ d("div", { className: "ff-flex-1", children: /* @__PURE__ */ d("div", { className: "ff-mapping-source", children:
|
|
672
|
-
/* @__PURE__ */ d("div", { className: "ff-mapping-arrow", children: /* @__PURE__ */ d(
|
|
673
|
-
/* @__PURE__ */ d("div", { className: "ff-flex-1 ff-mapping-target", children: /* @__PURE__ */
|
|
630
|
+
/* @__PURE__ */ d("div", { className: "ff-flex-1", children: /* @__PURE__ */ d("div", { className: "ff-mapping-source", children: p.sourceColumn }) }),
|
|
631
|
+
/* @__PURE__ */ d("div", { className: "ff-mapping-arrow", children: /* @__PURE__ */ d(zt, { className: "ff-w-5 ff-h-5" }) }),
|
|
632
|
+
/* @__PURE__ */ d("div", { className: "ff-flex-1 ff-mapping-target", children: /* @__PURE__ */ w(
|
|
674
633
|
"select",
|
|
675
634
|
{
|
|
676
|
-
value:
|
|
677
|
-
onChange: (m) => s(
|
|
635
|
+
value: p.targetKey || "",
|
|
636
|
+
onChange: (m) => s(p.sourceColumn, m.target.value),
|
|
678
637
|
className: "ff-input",
|
|
679
638
|
children: [
|
|
680
639
|
/* @__PURE__ */ d("option", { value: "", children: "-- Do not import --" }),
|
|
681
|
-
l.map((m) => /* @__PURE__ */
|
|
640
|
+
l.map((m) => /* @__PURE__ */ w(
|
|
682
641
|
"option",
|
|
683
642
|
{
|
|
684
643
|
value: m.key,
|
|
685
|
-
disabled:
|
|
644
|
+
disabled: g.has(m.key) && p.targetKey !== m.key,
|
|
686
645
|
children: [
|
|
687
646
|
m.label,
|
|
688
647
|
" (",
|
|
@@ -696,32 +655,32 @@ const le = $t((e, o) => ({
|
|
|
696
655
|
]
|
|
697
656
|
}
|
|
698
657
|
) }),
|
|
699
|
-
/* @__PURE__ */ d("div", { className: "ff-mapping-status", children: c ?
|
|
700
|
-
|
|
701
|
-
/* @__PURE__ */
|
|
702
|
-
Math.round(
|
|
658
|
+
/* @__PURE__ */ d("div", { className: "ff-mapping-status", children: c ? i ? /* @__PURE__ */ d(Ht, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ d(Bt, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-warning)" } }) : /* @__PURE__ */ d("span", { className: "ff-w-5 ff-h-5" }) }),
|
|
659
|
+
p.confidence > 0 && /* @__PURE__ */ w("div", { className: "ff-confidence", style: { color: u(p.confidence) }, children: [
|
|
660
|
+
/* @__PURE__ */ w("span", { children: [
|
|
661
|
+
Math.round(p.confidence * 100),
|
|
703
662
|
"%"
|
|
704
663
|
] }),
|
|
705
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ w("span", { style: { color: "var(--ff-text-muted)" }, children: [
|
|
706
665
|
"(",
|
|
707
|
-
|
|
666
|
+
a(p.confidence),
|
|
708
667
|
")"
|
|
709
668
|
] })
|
|
710
669
|
] })
|
|
711
670
|
]
|
|
712
671
|
},
|
|
713
|
-
|
|
672
|
+
p.sourceColumn
|
|
714
673
|
);
|
|
715
674
|
}) }),
|
|
716
675
|
(() => {
|
|
717
|
-
const
|
|
718
|
-
(c) => c.required && !
|
|
676
|
+
const p = l.filter(
|
|
677
|
+
(c) => c.required && !g.has(c.key)
|
|
719
678
|
);
|
|
720
|
-
return
|
|
721
|
-
/* @__PURE__ */ d(
|
|
722
|
-
/* @__PURE__ */
|
|
679
|
+
return p.length > 0 ? /* @__PURE__ */ w("div", { className: "ff-flex ff-items-start ff-gap-2 ff-p-4 ff-rounded-lg", style: { backgroundColor: "var(--ff-warning-light)", borderColor: "var(--ff-warning)" }, children: [
|
|
680
|
+
/* @__PURE__ */ d(Oe, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
|
|
681
|
+
/* @__PURE__ */ w("div", { children: [
|
|
723
682
|
/* @__PURE__ */ d("p", { className: "ff-text-sm ff-font-medium", style: { color: "var(--ff-warning-dark)" }, children: "Required fields not mapped" }),
|
|
724
|
-
/* @__PURE__ */ d("p", { className: "ff-text-sm ff-mt-1", style: { color: "var(--ff-warning)" }, children:
|
|
683
|
+
/* @__PURE__ */ d("p", { className: "ff-text-sm ff-mt-1", style: { color: "var(--ff-warning)" }, children: p.map((c) => c.label).join(", ") })
|
|
725
684
|
] })
|
|
726
685
|
] }) : null;
|
|
727
686
|
})()
|
|
@@ -737,7 +696,7 @@ const le = $t((e, o) => ({
|
|
|
737
696
|
*
|
|
738
697
|
* @license MIT
|
|
739
698
|
*/
|
|
740
|
-
function
|
|
699
|
+
function en() {
|
|
741
700
|
return {
|
|
742
701
|
accessor: (e, o) => typeof e == "function" ? {
|
|
743
702
|
...o,
|
|
@@ -750,24 +709,24 @@ function on() {
|
|
|
750
709
|
group: (e) => e
|
|
751
710
|
};
|
|
752
711
|
}
|
|
753
|
-
function
|
|
712
|
+
function Q(e, o) {
|
|
754
713
|
return typeof e == "function" ? e(o) : e;
|
|
755
714
|
}
|
|
756
|
-
function
|
|
715
|
+
function G(e, o) {
|
|
757
716
|
return (t) => {
|
|
758
717
|
o.setState((n) => ({
|
|
759
718
|
...n,
|
|
760
|
-
[e]:
|
|
719
|
+
[e]: Q(t, n[e])
|
|
761
720
|
}));
|
|
762
721
|
};
|
|
763
722
|
}
|
|
764
|
-
function
|
|
723
|
+
function Re(e) {
|
|
765
724
|
return e instanceof Function;
|
|
766
725
|
}
|
|
767
|
-
function
|
|
726
|
+
function tn(e) {
|
|
768
727
|
return Array.isArray(e) && e.every((o) => typeof o == "number");
|
|
769
728
|
}
|
|
770
|
-
function
|
|
729
|
+
function nn(e, o) {
|
|
771
730
|
const t = [], n = (r) => {
|
|
772
731
|
r.forEach((l) => {
|
|
773
732
|
t.push(l);
|
|
@@ -777,23 +736,23 @@ function ln(e, o) {
|
|
|
777
736
|
};
|
|
778
737
|
return n(e), t;
|
|
779
738
|
}
|
|
780
|
-
function
|
|
739
|
+
function y(e, o, t) {
|
|
781
740
|
let n = [], r;
|
|
782
741
|
return (l) => {
|
|
783
742
|
let s;
|
|
784
743
|
t.key && t.debug && (s = Date.now());
|
|
785
|
-
const
|
|
786
|
-
if (!(
|
|
744
|
+
const u = e(l);
|
|
745
|
+
if (!(u.length !== n.length || u.some((g, p) => n[p] !== g)))
|
|
787
746
|
return r;
|
|
788
|
-
n =
|
|
747
|
+
n = u;
|
|
789
748
|
let f;
|
|
790
|
-
if (t.key && t.debug && (f = Date.now()), r = o(...
|
|
791
|
-
const
|
|
792
|
-
for (m = String(m); m.length <
|
|
749
|
+
if (t.key && t.debug && (f = Date.now()), r = o(...u), t == null || t.onChange == null || t.onChange(r), t.key && t.debug && t != null && t.debug()) {
|
|
750
|
+
const g = Math.round((Date.now() - s) * 100) / 100, p = Math.round((Date.now() - f) * 100) / 100, c = p / 16, i = (m, h) => {
|
|
751
|
+
for (m = String(m); m.length < h; )
|
|
793
752
|
m = " " + m;
|
|
794
753
|
return m;
|
|
795
754
|
};
|
|
796
|
-
console.info(`%c⏱ ${
|
|
755
|
+
console.info(`%c⏱ ${i(p, 5)} /${i(g, 5)} ms`, `
|
|
797
756
|
font-size: .6rem;
|
|
798
757
|
font-weight: bold;
|
|
799
758
|
color: hsl(${Math.max(0, Math.min(120 - 120 * c, 120))}deg 100% 31%);`, t == null ? void 0 : t.key);
|
|
@@ -811,7 +770,7 @@ function R(e, o, t, n) {
|
|
|
811
770
|
onChange: n
|
|
812
771
|
};
|
|
813
772
|
}
|
|
814
|
-
function
|
|
773
|
+
function on(e, o, t, n) {
|
|
815
774
|
const r = () => {
|
|
816
775
|
var s;
|
|
817
776
|
return (s = l.getValue()) != null ? s : e.options.renderFallbackValue;
|
|
@@ -821,10 +780,10 @@ function sn(e, o, t, n) {
|
|
|
821
780
|
column: t,
|
|
822
781
|
getValue: () => o.getValue(n),
|
|
823
782
|
renderValue: r,
|
|
824
|
-
getContext:
|
|
783
|
+
getContext: y(() => [e, t, o, l], (s, u, a, f) => ({
|
|
825
784
|
table: s,
|
|
826
|
-
column:
|
|
827
|
-
row:
|
|
785
|
+
column: u,
|
|
786
|
+
row: a,
|
|
828
787
|
cell: f,
|
|
829
788
|
getValue: f.getValue,
|
|
830
789
|
renderValue: f.renderValue
|
|
@@ -834,48 +793,48 @@ function sn(e, o, t, n) {
|
|
|
834
793
|
s.createCell == null || s.createCell(l, t, o, e);
|
|
835
794
|
}, {}), l;
|
|
836
795
|
}
|
|
837
|
-
function
|
|
796
|
+
function rn(e, o, t, n) {
|
|
838
797
|
var r, l;
|
|
839
|
-
const
|
|
798
|
+
const u = {
|
|
840
799
|
...e._getDefaultColumnDef(),
|
|
841
800
|
...o
|
|
842
|
-
},
|
|
843
|
-
let f = (r = (l =
|
|
844
|
-
if (
|
|
845
|
-
let
|
|
846
|
-
for (const
|
|
801
|
+
}, a = u.accessorKey;
|
|
802
|
+
let f = (r = (l = u.id) != null ? l : a ? typeof String.prototype.replaceAll == "function" ? a.replaceAll(".", "_") : a.replace(/\./g, "_") : void 0) != null ? r : typeof u.header == "string" ? u.header : void 0, g;
|
|
803
|
+
if (u.accessorFn ? g = u.accessorFn : a && (a.includes(".") ? g = (c) => {
|
|
804
|
+
let i = c;
|
|
805
|
+
for (const h of a.split(".")) {
|
|
847
806
|
var m;
|
|
848
|
-
|
|
807
|
+
i = (m = i) == null ? void 0 : m[h], process.env.NODE_ENV !== "production" && i === void 0 && console.warn(`"${h}" in deeply nested key "${a}" returned undefined.`);
|
|
849
808
|
}
|
|
850
|
-
return
|
|
851
|
-
} :
|
|
852
|
-
throw process.env.NODE_ENV !== "production" ? new Error(
|
|
853
|
-
let
|
|
809
|
+
return i;
|
|
810
|
+
} : g = (c) => c[u.accessorKey]), !f)
|
|
811
|
+
throw process.env.NODE_ENV !== "production" ? new Error(u.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
|
|
812
|
+
let p = {
|
|
854
813
|
id: `${String(f)}`,
|
|
855
|
-
accessorFn:
|
|
814
|
+
accessorFn: g,
|
|
856
815
|
parent: n,
|
|
857
816
|
depth: t,
|
|
858
|
-
columnDef:
|
|
817
|
+
columnDef: u,
|
|
859
818
|
columns: [],
|
|
860
|
-
getFlatColumns:
|
|
819
|
+
getFlatColumns: y(() => [!0], () => {
|
|
861
820
|
var c;
|
|
862
|
-
return [
|
|
821
|
+
return [p, ...(c = p.columns) == null ? void 0 : c.flatMap((i) => i.getFlatColumns())];
|
|
863
822
|
}, R(e.options, "debugColumns", "column.getFlatColumns")),
|
|
864
|
-
getLeafColumns:
|
|
865
|
-
var
|
|
866
|
-
if ((
|
|
867
|
-
let m =
|
|
823
|
+
getLeafColumns: y(() => [e._getOrderColumnsFn()], (c) => {
|
|
824
|
+
var i;
|
|
825
|
+
if ((i = p.columns) != null && i.length) {
|
|
826
|
+
let m = p.columns.flatMap((h) => h.getLeafColumns());
|
|
868
827
|
return c(m);
|
|
869
828
|
}
|
|
870
|
-
return [
|
|
829
|
+
return [p];
|
|
871
830
|
}, R(e.options, "debugColumns", "column.getLeafColumns"))
|
|
872
831
|
};
|
|
873
832
|
for (const c of e._features)
|
|
874
|
-
c.createColumn == null || c.createColumn(
|
|
875
|
-
return
|
|
833
|
+
c.createColumn == null || c.createColumn(p, e);
|
|
834
|
+
return p;
|
|
876
835
|
}
|
|
877
|
-
const
|
|
878
|
-
function
|
|
836
|
+
const D = "debugHeaders";
|
|
837
|
+
function ot(e, o, t) {
|
|
879
838
|
var n;
|
|
880
839
|
let l = {
|
|
881
840
|
id: (n = t.id) != null ? n : o.id,
|
|
@@ -889,10 +848,10 @@ function tt(e, o, t) {
|
|
|
889
848
|
rowSpan: 0,
|
|
890
849
|
headerGroup: null,
|
|
891
850
|
getLeafHeaders: () => {
|
|
892
|
-
const s = [],
|
|
893
|
-
|
|
851
|
+
const s = [], u = (a) => {
|
|
852
|
+
a.subHeaders && a.subHeaders.length && a.subHeaders.map(u), s.push(a);
|
|
894
853
|
};
|
|
895
|
-
return
|
|
854
|
+
return u(l), s;
|
|
896
855
|
},
|
|
897
856
|
getContext: () => ({
|
|
898
857
|
table: e,
|
|
@@ -904,93 +863,93 @@ function tt(e, o, t) {
|
|
|
904
863
|
s.createHeader == null || s.createHeader(l, e);
|
|
905
864
|
}), l;
|
|
906
865
|
}
|
|
907
|
-
const
|
|
866
|
+
const ln = {
|
|
908
867
|
createTable: (e) => {
|
|
909
|
-
e.getHeaderGroups =
|
|
868
|
+
e.getHeaderGroups = y(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => {
|
|
910
869
|
var l, s;
|
|
911
|
-
const
|
|
912
|
-
return
|
|
913
|
-
}, R(e.options,
|
|
870
|
+
const u = (l = n == null ? void 0 : n.map((p) => t.find((c) => c.id === p)).filter(Boolean)) != null ? l : [], a = (s = r == null ? void 0 : r.map((p) => t.find((c) => c.id === p)).filter(Boolean)) != null ? s : [], f = t.filter((p) => !(n != null && n.includes(p.id)) && !(r != null && r.includes(p.id)));
|
|
871
|
+
return ve(o, [...u, ...f, ...a], e);
|
|
872
|
+
}, R(e.options, D, "getHeaderGroups")), e.getCenterHeaderGroups = y(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => (t = t.filter((l) => !(n != null && n.includes(l.id)) && !(r != null && r.includes(l.id))), ve(o, t, e, "center")), R(e.options, D, "getCenterHeaderGroups")), e.getLeftHeaderGroups = y(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
|
|
914
873
|
var r;
|
|
915
|
-
const l = (r = n == null ? void 0 : n.map((s) => t.find((
|
|
916
|
-
return
|
|
917
|
-
}, R(e.options,
|
|
874
|
+
const l = (r = n == null ? void 0 : n.map((s) => t.find((u) => u.id === s)).filter(Boolean)) != null ? r : [];
|
|
875
|
+
return ve(o, l, e, "left");
|
|
876
|
+
}, R(e.options, D, "getLeftHeaderGroups")), e.getRightHeaderGroups = y(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
|
|
918
877
|
var r;
|
|
919
|
-
const l = (r = n == null ? void 0 : n.map((s) => t.find((
|
|
920
|
-
return
|
|
921
|
-
}, R(e.options,
|
|
878
|
+
const l = (r = n == null ? void 0 : n.map((s) => t.find((u) => u.id === s)).filter(Boolean)) != null ? r : [];
|
|
879
|
+
return ve(o, l, e, "right");
|
|
880
|
+
}, R(e.options, D, "getRightHeaderGroups")), e.getFooterGroups = y(() => [e.getHeaderGroups()], (o) => [...o].reverse(), R(e.options, D, "getFooterGroups")), e.getLeftFooterGroups = y(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), R(e.options, D, "getLeftFooterGroups")), e.getCenterFooterGroups = y(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), R(e.options, D, "getCenterFooterGroups")), e.getRightFooterGroups = y(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), R(e.options, D, "getRightFooterGroups")), e.getFlatHeaders = y(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, D, "getFlatHeaders")), e.getLeftFlatHeaders = y(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, D, "getLeftFlatHeaders")), e.getCenterFlatHeaders = y(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, D, "getCenterFlatHeaders")), e.getRightFlatHeaders = y(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, D, "getRightFlatHeaders")), e.getCenterLeafHeaders = y(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
|
|
922
881
|
var n;
|
|
923
882
|
return !((n = t.subHeaders) != null && n.length);
|
|
924
|
-
}), R(e.options,
|
|
883
|
+
}), R(e.options, D, "getCenterLeafHeaders")), e.getLeftLeafHeaders = y(() => [e.getLeftFlatHeaders()], (o) => o.filter((t) => {
|
|
925
884
|
var n;
|
|
926
885
|
return !((n = t.subHeaders) != null && n.length);
|
|
927
|
-
}), R(e.options,
|
|
886
|
+
}), R(e.options, D, "getLeftLeafHeaders")), e.getRightLeafHeaders = y(() => [e.getRightFlatHeaders()], (o) => o.filter((t) => {
|
|
928
887
|
var n;
|
|
929
888
|
return !((n = t.subHeaders) != null && n.length);
|
|
930
|
-
}), R(e.options,
|
|
931
|
-
var r, l, s,
|
|
932
|
-
return [...(r = (l = o[0]) == null ? void 0 : l.headers) != null ? r : [], ...(s = (
|
|
933
|
-
}, R(e.options,
|
|
889
|
+
}), R(e.options, D, "getRightLeafHeaders")), e.getLeafHeaders = y(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
|
|
890
|
+
var r, l, s, u, a, f;
|
|
891
|
+
return [...(r = (l = o[0]) == null ? void 0 : l.headers) != null ? r : [], ...(s = (u = t[0]) == null ? void 0 : u.headers) != null ? s : [], ...(a = (f = n[0]) == null ? void 0 : f.headers) != null ? a : []].map((g) => g.getLeafHeaders()).flat();
|
|
892
|
+
}, R(e.options, D, "getLeafHeaders"));
|
|
934
893
|
}
|
|
935
894
|
};
|
|
936
|
-
function
|
|
895
|
+
function ve(e, o, t, n) {
|
|
937
896
|
var r, l;
|
|
938
897
|
let s = 0;
|
|
939
|
-
const
|
|
940
|
-
|
|
941
|
-
var
|
|
942
|
-
(
|
|
898
|
+
const u = function(c, i) {
|
|
899
|
+
i === void 0 && (i = 1), s = Math.max(s, i), c.filter((m) => m.getIsVisible()).forEach((m) => {
|
|
900
|
+
var h;
|
|
901
|
+
(h = m.columns) != null && h.length && u(m.columns, i + 1);
|
|
943
902
|
}, 0);
|
|
944
903
|
};
|
|
945
|
-
|
|
946
|
-
let
|
|
947
|
-
const f = (c,
|
|
904
|
+
u(e);
|
|
905
|
+
let a = [];
|
|
906
|
+
const f = (c, i) => {
|
|
948
907
|
const m = {
|
|
949
|
-
depth:
|
|
950
|
-
id: [n, `${
|
|
908
|
+
depth: i,
|
|
909
|
+
id: [n, `${i}`].filter(Boolean).join("_"),
|
|
951
910
|
headers: []
|
|
952
|
-
},
|
|
911
|
+
}, h = [];
|
|
953
912
|
c.forEach((C) => {
|
|
954
|
-
const
|
|
955
|
-
let
|
|
956
|
-
if (
|
|
957
|
-
|
|
913
|
+
const v = [...h].reverse()[0], S = C.column.depth === m.depth;
|
|
914
|
+
let I, F = !1;
|
|
915
|
+
if (S && C.column.parent ? I = C.column.parent : (I = C.column, F = !0), v && (v == null ? void 0 : v.column) === I)
|
|
916
|
+
v.subHeaders.push(C);
|
|
958
917
|
else {
|
|
959
|
-
const
|
|
960
|
-
id: [n,
|
|
961
|
-
isPlaceholder:
|
|
962
|
-
placeholderId:
|
|
963
|
-
depth:
|
|
964
|
-
index:
|
|
918
|
+
const M = ot(t, I, {
|
|
919
|
+
id: [n, i, I.id, C == null ? void 0 : C.id].filter(Boolean).join("_"),
|
|
920
|
+
isPlaceholder: F,
|
|
921
|
+
placeholderId: F ? `${h.filter((P) => P.column === I).length}` : void 0,
|
|
922
|
+
depth: i,
|
|
923
|
+
index: h.length
|
|
965
924
|
});
|
|
966
|
-
|
|
925
|
+
M.subHeaders.push(C), h.push(M);
|
|
967
926
|
}
|
|
968
927
|
m.headers.push(C), C.headerGroup = m;
|
|
969
|
-
}),
|
|
970
|
-
},
|
|
928
|
+
}), a.push(m), i > 0 && f(h, i - 1);
|
|
929
|
+
}, g = o.map((c, i) => ot(t, c, {
|
|
971
930
|
depth: s,
|
|
972
|
-
index:
|
|
931
|
+
index: i
|
|
973
932
|
}));
|
|
974
|
-
f(
|
|
975
|
-
const
|
|
976
|
-
let
|
|
977
|
-
m.subHeaders && m.subHeaders.length ? (
|
|
933
|
+
f(g, s - 1), a.reverse();
|
|
934
|
+
const p = (c) => c.filter((m) => m.column.getIsVisible()).map((m) => {
|
|
935
|
+
let h = 0, C = 0, v = [0];
|
|
936
|
+
m.subHeaders && m.subHeaders.length ? (v = [], p(m.subHeaders).forEach((I) => {
|
|
978
937
|
let {
|
|
979
|
-
colSpan:
|
|
980
|
-
rowSpan:
|
|
981
|
-
} =
|
|
982
|
-
|
|
983
|
-
})) :
|
|
984
|
-
const
|
|
985
|
-
return C = C +
|
|
986
|
-
colSpan:
|
|
938
|
+
colSpan: F,
|
|
939
|
+
rowSpan: M
|
|
940
|
+
} = I;
|
|
941
|
+
h += F, v.push(M);
|
|
942
|
+
})) : h = 1;
|
|
943
|
+
const S = Math.min(...v);
|
|
944
|
+
return C = C + S, m.colSpan = h, m.rowSpan = C, {
|
|
945
|
+
colSpan: h,
|
|
987
946
|
rowSpan: C
|
|
988
947
|
};
|
|
989
948
|
});
|
|
990
|
-
return
|
|
949
|
+
return p((r = (l = a[0]) == null ? void 0 : l.headers) != null ? r : []), a;
|
|
991
950
|
}
|
|
992
|
-
const
|
|
993
|
-
let
|
|
951
|
+
const Te = (e, o, t, n, r, l, s) => {
|
|
952
|
+
let u = {
|
|
994
953
|
id: o,
|
|
995
954
|
index: n,
|
|
996
955
|
original: t,
|
|
@@ -998,115 +957,115 @@ const Ge = (e, o, t, n, r, l, s) => {
|
|
|
998
957
|
parentId: s,
|
|
999
958
|
_valuesCache: {},
|
|
1000
959
|
_uniqueValuesCache: {},
|
|
1001
|
-
getValue: (
|
|
1002
|
-
if (
|
|
1003
|
-
return
|
|
1004
|
-
const f = e.getColumn(
|
|
960
|
+
getValue: (a) => {
|
|
961
|
+
if (u._valuesCache.hasOwnProperty(a))
|
|
962
|
+
return u._valuesCache[a];
|
|
963
|
+
const f = e.getColumn(a);
|
|
1005
964
|
if (f != null && f.accessorFn)
|
|
1006
|
-
return
|
|
965
|
+
return u._valuesCache[a] = f.accessorFn(u.original, n), u._valuesCache[a];
|
|
1007
966
|
},
|
|
1008
|
-
getUniqueValues: (
|
|
1009
|
-
if (
|
|
1010
|
-
return
|
|
1011
|
-
const f = e.getColumn(
|
|
967
|
+
getUniqueValues: (a) => {
|
|
968
|
+
if (u._uniqueValuesCache.hasOwnProperty(a))
|
|
969
|
+
return u._uniqueValuesCache[a];
|
|
970
|
+
const f = e.getColumn(a);
|
|
1012
971
|
if (f != null && f.accessorFn)
|
|
1013
|
-
return f.columnDef.getUniqueValues ? (
|
|
972
|
+
return f.columnDef.getUniqueValues ? (u._uniqueValuesCache[a] = f.columnDef.getUniqueValues(u.original, n), u._uniqueValuesCache[a]) : (u._uniqueValuesCache[a] = [u.getValue(a)], u._uniqueValuesCache[a]);
|
|
1014
973
|
},
|
|
1015
|
-
renderValue: (
|
|
974
|
+
renderValue: (a) => {
|
|
1016
975
|
var f;
|
|
1017
|
-
return (f =
|
|
976
|
+
return (f = u.getValue(a)) != null ? f : e.options.renderFallbackValue;
|
|
1018
977
|
},
|
|
1019
978
|
subRows: [],
|
|
1020
|
-
getLeafRows: () =>
|
|
1021
|
-
getParentRow: () =>
|
|
979
|
+
getLeafRows: () => nn(u.subRows, (a) => a.subRows),
|
|
980
|
+
getParentRow: () => u.parentId ? e.getRow(u.parentId, !0) : void 0,
|
|
1022
981
|
getParentRows: () => {
|
|
1023
|
-
let
|
|
982
|
+
let a = [], f = u;
|
|
1024
983
|
for (; ; ) {
|
|
1025
|
-
const
|
|
1026
|
-
if (!
|
|
1027
|
-
|
|
984
|
+
const g = f.getParentRow();
|
|
985
|
+
if (!g) break;
|
|
986
|
+
a.push(g), f = g;
|
|
1028
987
|
}
|
|
1029
|
-
return
|
|
988
|
+
return a.reverse();
|
|
1030
989
|
},
|
|
1031
|
-
getAllCells:
|
|
1032
|
-
_getAllCellsByColumnId:
|
|
990
|
+
getAllCells: y(() => [e.getAllLeafColumns()], (a) => a.map((f) => on(e, u, f, f.id)), R(e.options, "debugRows", "getAllCells")),
|
|
991
|
+
_getAllCellsByColumnId: y(() => [u.getAllCells()], (a) => a.reduce((f, g) => (f[g.column.id] = g, f), {}), R(e.options, "debugRows", "getAllCellsByColumnId"))
|
|
1033
992
|
};
|
|
1034
|
-
for (let
|
|
1035
|
-
const f = e._features[
|
|
1036
|
-
f == null || f.createRow == null || f.createRow(
|
|
993
|
+
for (let a = 0; a < e._features.length; a++) {
|
|
994
|
+
const f = e._features[a];
|
|
995
|
+
f == null || f.createRow == null || f.createRow(u, e);
|
|
1037
996
|
}
|
|
1038
|
-
return
|
|
1039
|
-
},
|
|
997
|
+
return u;
|
|
998
|
+
}, sn = {
|
|
1040
999
|
createColumn: (e, o) => {
|
|
1041
1000
|
e._getFacetedRowModel = o.options.getFacetedRowModel && o.options.getFacetedRowModel(o, e.id), e.getFacetedRowModel = () => e._getFacetedRowModel ? e._getFacetedRowModel() : o.getPreFilteredRowModel(), e._getFacetedUniqueValues = o.options.getFacetedUniqueValues && o.options.getFacetedUniqueValues(o, e.id), e.getFacetedUniqueValues = () => e._getFacetedUniqueValues ? e._getFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getFacetedMinMaxValues = o.options.getFacetedMinMaxValues && o.options.getFacetedMinMaxValues(o, e.id), e.getFacetedMinMaxValues = () => {
|
|
1042
1001
|
if (e._getFacetedMinMaxValues)
|
|
1043
1002
|
return e._getFacetedMinMaxValues();
|
|
1044
1003
|
};
|
|
1045
1004
|
}
|
|
1046
|
-
},
|
|
1005
|
+
}, at = (e, o, t) => {
|
|
1047
1006
|
var n, r;
|
|
1048
1007
|
const l = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
|
|
1049
1008
|
return !!(!((r = e.getValue(o)) == null || (r = r.toString()) == null || (r = r.toLowerCase()) == null) && r.includes(l));
|
|
1050
1009
|
};
|
|
1051
|
-
|
|
1052
|
-
const
|
|
1010
|
+
at.autoRemove = (e) => B(e);
|
|
1011
|
+
const ut = (e, o, t) => {
|
|
1053
1012
|
var n;
|
|
1054
1013
|
return !!(!((n = e.getValue(o)) == null || (n = n.toString()) == null) && n.includes(t));
|
|
1055
1014
|
};
|
|
1056
|
-
|
|
1057
|
-
const
|
|
1015
|
+
ut.autoRemove = (e) => B(e);
|
|
1016
|
+
const ft = (e, o, t) => {
|
|
1058
1017
|
var n;
|
|
1059
1018
|
return ((n = e.getValue(o)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === (t == null ? void 0 : t.toLowerCase());
|
|
1060
1019
|
};
|
|
1061
|
-
|
|
1062
|
-
const
|
|
1020
|
+
ft.autoRemove = (e) => B(e);
|
|
1021
|
+
const dt = (e, o, t) => {
|
|
1063
1022
|
var n;
|
|
1064
1023
|
return (n = e.getValue(o)) == null ? void 0 : n.includes(t);
|
|
1065
1024
|
};
|
|
1066
|
-
|
|
1067
|
-
const
|
|
1025
|
+
dt.autoRemove = (e) => B(e);
|
|
1026
|
+
const ct = (e, o, t) => !t.some((n) => {
|
|
1068
1027
|
var r;
|
|
1069
1028
|
return !((r = e.getValue(o)) != null && r.includes(n));
|
|
1070
1029
|
});
|
|
1071
|
-
|
|
1072
|
-
const
|
|
1030
|
+
ct.autoRemove = (e) => B(e) || !(e != null && e.length);
|
|
1031
|
+
const gt = (e, o, t) => t.some((n) => {
|
|
1073
1032
|
var r;
|
|
1074
1033
|
return (r = e.getValue(o)) == null ? void 0 : r.includes(n);
|
|
1075
1034
|
});
|
|
1076
|
-
|
|
1077
|
-
const
|
|
1078
|
-
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1081
|
-
const
|
|
1035
|
+
gt.autoRemove = (e) => B(e) || !(e != null && e.length);
|
|
1036
|
+
const pt = (e, o, t) => e.getValue(o) === t;
|
|
1037
|
+
pt.autoRemove = (e) => B(e);
|
|
1038
|
+
const mt = (e, o, t) => e.getValue(o) == t;
|
|
1039
|
+
mt.autoRemove = (e) => B(e);
|
|
1040
|
+
const Be = (e, o, t) => {
|
|
1082
1041
|
let [n, r] = t;
|
|
1083
1042
|
const l = e.getValue(o);
|
|
1084
1043
|
return l >= n && l <= r;
|
|
1085
1044
|
};
|
|
1086
|
-
|
|
1045
|
+
Be.resolveFilterValue = (e) => {
|
|
1087
1046
|
let [o, t] = e, n = typeof o != "number" ? parseFloat(o) : o, r = typeof t != "number" ? parseFloat(t) : t, l = o === null || Number.isNaN(n) ? -1 / 0 : n, s = t === null || Number.isNaN(r) ? 1 / 0 : r;
|
|
1088
1047
|
if (l > s) {
|
|
1089
|
-
const
|
|
1090
|
-
l = s, s =
|
|
1048
|
+
const u = l;
|
|
1049
|
+
l = s, s = u;
|
|
1091
1050
|
}
|
|
1092
1051
|
return [l, s];
|
|
1093
1052
|
};
|
|
1094
|
-
|
|
1095
|
-
const
|
|
1096
|
-
includesString:
|
|
1097
|
-
includesStringSensitive:
|
|
1098
|
-
equalsString:
|
|
1099
|
-
arrIncludes:
|
|
1100
|
-
arrIncludesAll:
|
|
1101
|
-
arrIncludesSome:
|
|
1102
|
-
equals:
|
|
1103
|
-
weakEquals:
|
|
1104
|
-
inNumberRange:
|
|
1053
|
+
Be.autoRemove = (e) => B(e) || B(e[0]) && B(e[1]);
|
|
1054
|
+
const X = {
|
|
1055
|
+
includesString: at,
|
|
1056
|
+
includesStringSensitive: ut,
|
|
1057
|
+
equalsString: ft,
|
|
1058
|
+
arrIncludes: dt,
|
|
1059
|
+
arrIncludesAll: ct,
|
|
1060
|
+
arrIncludesSome: gt,
|
|
1061
|
+
equals: pt,
|
|
1062
|
+
weakEquals: mt,
|
|
1063
|
+
inNumberRange: Be
|
|
1105
1064
|
};
|
|
1106
|
-
function
|
|
1065
|
+
function B(e) {
|
|
1107
1066
|
return e == null || e === "";
|
|
1108
1067
|
}
|
|
1109
|
-
const
|
|
1068
|
+
const an = {
|
|
1110
1069
|
getDefaultColumnDef: () => ({
|
|
1111
1070
|
filterFn: "auto"
|
|
1112
1071
|
}),
|
|
@@ -1115,19 +1074,19 @@ const dn = {
|
|
|
1115
1074
|
...e
|
|
1116
1075
|
}),
|
|
1117
1076
|
getDefaultOptions: (e) => ({
|
|
1118
|
-
onColumnFiltersChange:
|
|
1077
|
+
onColumnFiltersChange: G("columnFilters", e),
|
|
1119
1078
|
filterFromLeafRows: !1,
|
|
1120
1079
|
maxLeafRowFilterDepth: 100
|
|
1121
1080
|
}),
|
|
1122
1081
|
createColumn: (e, o) => {
|
|
1123
1082
|
e.getAutoFilterFn = () => {
|
|
1124
1083
|
const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
|
|
1125
|
-
return typeof n == "string" ?
|
|
1084
|
+
return typeof n == "string" ? X.includesString : typeof n == "number" ? X.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? X.equals : Array.isArray(n) ? X.arrIncludes : X.weakEquals;
|
|
1126
1085
|
}, e.getFilterFn = () => {
|
|
1127
1086
|
var t, n;
|
|
1128
|
-
return
|
|
1087
|
+
return Re(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
|
|
1129
1088
|
// @ts-ignore
|
|
1130
|
-
(t = (n = o.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t :
|
|
1089
|
+
(t = (n = o.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : X[e.columnDef.filterFn]
|
|
1131
1090
|
);
|
|
1132
1091
|
}, e.getCanFilter = () => {
|
|
1133
1092
|
var t, n, r;
|
|
@@ -1140,20 +1099,20 @@ const dn = {
|
|
|
1140
1099
|
return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
|
|
1141
1100
|
}, e.setFilterValue = (t) => {
|
|
1142
1101
|
o.setColumnFilters((n) => {
|
|
1143
|
-
const r = e.getFilterFn(), l = n == null ? void 0 : n.find((
|
|
1144
|
-
if (
|
|
1145
|
-
var
|
|
1146
|
-
return (
|
|
1102
|
+
const r = e.getFilterFn(), l = n == null ? void 0 : n.find((g) => g.id === e.id), s = Q(t, l ? l.value : void 0);
|
|
1103
|
+
if (rt(r, s, e)) {
|
|
1104
|
+
var u;
|
|
1105
|
+
return (u = n == null ? void 0 : n.filter((g) => g.id !== e.id)) != null ? u : [];
|
|
1147
1106
|
}
|
|
1148
|
-
const
|
|
1107
|
+
const a = {
|
|
1149
1108
|
id: e.id,
|
|
1150
1109
|
value: s
|
|
1151
1110
|
};
|
|
1152
1111
|
if (l) {
|
|
1153
1112
|
var f;
|
|
1154
|
-
return (f = n == null ? void 0 : n.map((
|
|
1113
|
+
return (f = n == null ? void 0 : n.map((g) => g.id === e.id ? a : g)) != null ? f : [];
|
|
1155
1114
|
}
|
|
1156
|
-
return n != null && n.length ? [...n,
|
|
1115
|
+
return n != null && n.length ? [...n, a] : [a];
|
|
1157
1116
|
});
|
|
1158
1117
|
};
|
|
1159
1118
|
},
|
|
@@ -1164,11 +1123,11 @@ const dn = {
|
|
|
1164
1123
|
e.setColumnFilters = (o) => {
|
|
1165
1124
|
const t = e.getAllLeafColumns(), n = (r) => {
|
|
1166
1125
|
var l;
|
|
1167
|
-
return (l =
|
|
1168
|
-
const
|
|
1169
|
-
if (
|
|
1170
|
-
const
|
|
1171
|
-
if (
|
|
1126
|
+
return (l = Q(o, r)) == null ? void 0 : l.filter((s) => {
|
|
1127
|
+
const u = t.find((a) => a.id === s.id);
|
|
1128
|
+
if (u) {
|
|
1129
|
+
const a = u.getFilterFn();
|
|
1130
|
+
if (rt(a, s.value, u))
|
|
1172
1131
|
return !1;
|
|
1173
1132
|
}
|
|
1174
1133
|
return !0;
|
|
@@ -1181,57 +1140,57 @@ const dn = {
|
|
|
1181
1140
|
}, e.getPreFilteredRowModel = () => e.getCoreRowModel(), e.getFilteredRowModel = () => (!e._getFilteredRowModel && e.options.getFilteredRowModel && (e._getFilteredRowModel = e.options.getFilteredRowModel(e)), e.options.manualFiltering || !e._getFilteredRowModel ? e.getPreFilteredRowModel() : e._getFilteredRowModel());
|
|
1182
1141
|
}
|
|
1183
1142
|
};
|
|
1184
|
-
function
|
|
1143
|
+
function rt(e, o, t) {
|
|
1185
1144
|
return (e && e.autoRemove ? e.autoRemove(o, t) : !1) || typeof o > "u" || typeof o == "string" && !o;
|
|
1186
1145
|
}
|
|
1187
|
-
const
|
|
1146
|
+
const un = (e, o, t) => t.reduce((n, r) => {
|
|
1188
1147
|
const l = r.getValue(e);
|
|
1189
1148
|
return n + (typeof l == "number" ? l : 0);
|
|
1190
|
-
}, 0),
|
|
1149
|
+
}, 0), fn = (e, o, t) => {
|
|
1191
1150
|
let n;
|
|
1192
1151
|
return t.forEach((r) => {
|
|
1193
1152
|
const l = r.getValue(e);
|
|
1194
1153
|
l != null && (n > l || n === void 0 && l >= l) && (n = l);
|
|
1195
1154
|
}), n;
|
|
1196
|
-
},
|
|
1155
|
+
}, dn = (e, o, t) => {
|
|
1197
1156
|
let n;
|
|
1198
1157
|
return t.forEach((r) => {
|
|
1199
1158
|
const l = r.getValue(e);
|
|
1200
1159
|
l != null && (n < l || n === void 0 && l >= l) && (n = l);
|
|
1201
1160
|
}), n;
|
|
1202
|
-
},
|
|
1161
|
+
}, cn = (e, o, t) => {
|
|
1203
1162
|
let n, r;
|
|
1204
1163
|
return t.forEach((l) => {
|
|
1205
1164
|
const s = l.getValue(e);
|
|
1206
1165
|
s != null && (n === void 0 ? s >= s && (n = r = s) : (n > s && (n = s), r < s && (r = s)));
|
|
1207
1166
|
}), [n, r];
|
|
1208
|
-
},
|
|
1167
|
+
}, gn = (e, o) => {
|
|
1209
1168
|
let t = 0, n = 0;
|
|
1210
1169
|
if (o.forEach((r) => {
|
|
1211
1170
|
let l = r.getValue(e);
|
|
1212
1171
|
l != null && (l = +l) >= l && (++t, n += l);
|
|
1213
1172
|
}), t) return n / t;
|
|
1214
|
-
},
|
|
1173
|
+
}, pn = (e, o) => {
|
|
1215
1174
|
if (!o.length)
|
|
1216
1175
|
return;
|
|
1217
1176
|
const t = o.map((l) => l.getValue(e));
|
|
1218
|
-
if (!
|
|
1177
|
+
if (!tn(t))
|
|
1219
1178
|
return;
|
|
1220
1179
|
if (t.length === 1)
|
|
1221
1180
|
return t[0];
|
|
1222
1181
|
const n = Math.floor(t.length / 2), r = t.sort((l, s) => l - s);
|
|
1223
1182
|
return t.length % 2 !== 0 ? r[n] : (r[n - 1] + r[n]) / 2;
|
|
1224
|
-
},
|
|
1225
|
-
sum:
|
|
1226
|
-
min:
|
|
1227
|
-
max:
|
|
1228
|
-
extent:
|
|
1229
|
-
mean:
|
|
1230
|
-
median:
|
|
1231
|
-
unique:
|
|
1232
|
-
uniqueCount:
|
|
1233
|
-
count:
|
|
1234
|
-
},
|
|
1183
|
+
}, mn = (e, o) => Array.from(new Set(o.map((t) => t.getValue(e))).values()), hn = (e, o) => new Set(o.map((t) => t.getValue(e))).size, vn = (e, o) => o.length, Ie = {
|
|
1184
|
+
sum: un,
|
|
1185
|
+
min: fn,
|
|
1186
|
+
max: dn,
|
|
1187
|
+
extent: cn,
|
|
1188
|
+
mean: gn,
|
|
1189
|
+
median: pn,
|
|
1190
|
+
unique: mn,
|
|
1191
|
+
uniqueCount: hn,
|
|
1192
|
+
count: vn
|
|
1193
|
+
}, wn = {
|
|
1235
1194
|
getDefaultColumnDef: () => ({
|
|
1236
1195
|
aggregatedCell: (e) => {
|
|
1237
1196
|
var o, t;
|
|
@@ -1244,7 +1203,7 @@ const cn = (e, o, t) => t.reduce((n, r) => {
|
|
|
1244
1203
|
...e
|
|
1245
1204
|
}),
|
|
1246
1205
|
getDefaultOptions: (e) => ({
|
|
1247
|
-
onGroupingChange:
|
|
1206
|
+
onGroupingChange: G("grouping", e),
|
|
1248
1207
|
groupedColumnMode: "reorder"
|
|
1249
1208
|
}),
|
|
1250
1209
|
createColumn: (e, o) => {
|
|
@@ -1267,14 +1226,14 @@ const cn = (e, o, t) => t.reduce((n, r) => {
|
|
|
1267
1226
|
}, e.getAutoAggregationFn = () => {
|
|
1268
1227
|
const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
|
|
1269
1228
|
if (typeof n == "number")
|
|
1270
|
-
return
|
|
1229
|
+
return Ie.sum;
|
|
1271
1230
|
if (Object.prototype.toString.call(n) === "[object Date]")
|
|
1272
|
-
return
|
|
1231
|
+
return Ie.extent;
|
|
1273
1232
|
}, e.getAggregationFn = () => {
|
|
1274
1233
|
var t, n;
|
|
1275
1234
|
if (!e)
|
|
1276
1235
|
throw new Error();
|
|
1277
|
-
return
|
|
1236
|
+
return Re(e.columnDef.aggregationFn) ? e.columnDef.aggregationFn : e.columnDef.aggregationFn === "auto" ? e.getAutoAggregationFn() : (t = (n = o.options.aggregationFns) == null ? void 0 : n[e.columnDef.aggregationFn]) != null ? t : Ie[e.columnDef.aggregationFn];
|
|
1278
1237
|
};
|
|
1279
1238
|
},
|
|
1280
1239
|
createTable: (e) => {
|
|
@@ -1298,27 +1257,27 @@ const cn = (e, o, t) => t.reduce((n, r) => {
|
|
|
1298
1257
|
};
|
|
1299
1258
|
}
|
|
1300
1259
|
};
|
|
1301
|
-
function
|
|
1260
|
+
function Cn(e, o, t) {
|
|
1302
1261
|
if (!(o != null && o.length) || !t)
|
|
1303
1262
|
return e;
|
|
1304
1263
|
const n = e.filter((l) => !o.includes(l.id));
|
|
1305
1264
|
return t === "remove" ? n : [...o.map((l) => e.find((s) => s.id === l)).filter(Boolean), ...n];
|
|
1306
1265
|
}
|
|
1307
|
-
const
|
|
1266
|
+
const Sn = {
|
|
1308
1267
|
getInitialState: (e) => ({
|
|
1309
1268
|
columnOrder: [],
|
|
1310
1269
|
...e
|
|
1311
1270
|
}),
|
|
1312
1271
|
getDefaultOptions: (e) => ({
|
|
1313
|
-
onColumnOrderChange:
|
|
1272
|
+
onColumnOrderChange: G("columnOrder", e)
|
|
1314
1273
|
}),
|
|
1315
1274
|
createColumn: (e, o) => {
|
|
1316
|
-
e.getIndex =
|
|
1275
|
+
e.getIndex = y((t) => [ge(o, t)], (t) => t.findIndex((n) => n.id === e.id), R(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
|
|
1317
1276
|
var n;
|
|
1318
|
-
return ((n =
|
|
1277
|
+
return ((n = ge(o, t)[0]) == null ? void 0 : n.id) === e.id;
|
|
1319
1278
|
}, e.getIsLastColumn = (t) => {
|
|
1320
1279
|
var n;
|
|
1321
|
-
const r =
|
|
1280
|
+
const r = ge(o, t);
|
|
1322
1281
|
return ((n = r[r.length - 1]) == null ? void 0 : n.id) === e.id;
|
|
1323
1282
|
};
|
|
1324
1283
|
},
|
|
@@ -1326,31 +1285,31 @@ const xn = {
|
|
|
1326
1285
|
e.setColumnOrder = (o) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(o), e.resetColumnOrder = (o) => {
|
|
1327
1286
|
var t;
|
|
1328
1287
|
e.setColumnOrder(o ? [] : (t = e.initialState.columnOrder) != null ? t : []);
|
|
1329
|
-
}, e._getOrderColumnsFn =
|
|
1288
|
+
}, e._getOrderColumnsFn = y(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (o, t, n) => (r) => {
|
|
1330
1289
|
let l = [];
|
|
1331
1290
|
if (!(o != null && o.length))
|
|
1332
1291
|
l = r;
|
|
1333
1292
|
else {
|
|
1334
|
-
const s = [...o],
|
|
1335
|
-
for (;
|
|
1336
|
-
const
|
|
1337
|
-
f > -1 && l.push(
|
|
1293
|
+
const s = [...o], u = [...r];
|
|
1294
|
+
for (; u.length && s.length; ) {
|
|
1295
|
+
const a = s.shift(), f = u.findIndex((g) => g.id === a);
|
|
1296
|
+
f > -1 && l.push(u.splice(f, 1)[0]);
|
|
1338
1297
|
}
|
|
1339
|
-
l = [...l, ...
|
|
1298
|
+
l = [...l, ...u];
|
|
1340
1299
|
}
|
|
1341
|
-
return
|
|
1300
|
+
return Cn(l, t, n);
|
|
1342
1301
|
}, R(e.options, "debugTable", "_getOrderColumnsFn"));
|
|
1343
1302
|
}
|
|
1344
|
-
},
|
|
1303
|
+
}, $e = () => ({
|
|
1345
1304
|
left: [],
|
|
1346
1305
|
right: []
|
|
1347
|
-
}),
|
|
1306
|
+
}), yn = {
|
|
1348
1307
|
getInitialState: (e) => ({
|
|
1349
|
-
columnPinning:
|
|
1308
|
+
columnPinning: $e(),
|
|
1350
1309
|
...e
|
|
1351
1310
|
}),
|
|
1352
1311
|
getDefaultOptions: (e) => ({
|
|
1353
|
-
onColumnPinningChange:
|
|
1312
|
+
onColumnPinningChange: G("columnPinning", e)
|
|
1354
1313
|
}),
|
|
1355
1314
|
createColumn: (e, o) => {
|
|
1356
1315
|
e.pin = (t) => {
|
|
@@ -1358,32 +1317,32 @@ const xn = {
|
|
|
1358
1317
|
o.setColumnPinning((r) => {
|
|
1359
1318
|
var l, s;
|
|
1360
1319
|
if (t === "right") {
|
|
1361
|
-
var
|
|
1320
|
+
var u, a;
|
|
1362
1321
|
return {
|
|
1363
|
-
left: ((
|
|
1364
|
-
right: [...((
|
|
1322
|
+
left: ((u = r == null ? void 0 : r.left) != null ? u : []).filter((p) => !(n != null && n.includes(p))),
|
|
1323
|
+
right: [...((a = r == null ? void 0 : r.right) != null ? a : []).filter((p) => !(n != null && n.includes(p))), ...n]
|
|
1365
1324
|
};
|
|
1366
1325
|
}
|
|
1367
1326
|
if (t === "left") {
|
|
1368
|
-
var f,
|
|
1327
|
+
var f, g;
|
|
1369
1328
|
return {
|
|
1370
|
-
left: [...((f = r == null ? void 0 : r.left) != null ? f : []).filter((
|
|
1371
|
-
right: ((
|
|
1329
|
+
left: [...((f = r == null ? void 0 : r.left) != null ? f : []).filter((p) => !(n != null && n.includes(p))), ...n],
|
|
1330
|
+
right: ((g = r == null ? void 0 : r.right) != null ? g : []).filter((p) => !(n != null && n.includes(p)))
|
|
1372
1331
|
};
|
|
1373
1332
|
}
|
|
1374
1333
|
return {
|
|
1375
|
-
left: ((l = r == null ? void 0 : r.left) != null ? l : []).filter((
|
|
1376
|
-
right: ((s = r == null ? void 0 : r.right) != null ? s : []).filter((
|
|
1334
|
+
left: ((l = r == null ? void 0 : r.left) != null ? l : []).filter((p) => !(n != null && n.includes(p))),
|
|
1335
|
+
right: ((s = r == null ? void 0 : r.right) != null ? s : []).filter((p) => !(n != null && n.includes(p)))
|
|
1377
1336
|
};
|
|
1378
1337
|
});
|
|
1379
1338
|
}, e.getCanPin = () => e.getLeafColumns().some((n) => {
|
|
1380
1339
|
var r, l, s;
|
|
1381
1340
|
return ((r = n.columnDef.enablePinning) != null ? r : !0) && ((l = (s = o.options.enableColumnPinning) != null ? s : o.options.enablePinning) != null ? l : !0);
|
|
1382
1341
|
}), e.getIsPinned = () => {
|
|
1383
|
-
const t = e.getLeafColumns().map((
|
|
1342
|
+
const t = e.getLeafColumns().map((u) => u.id), {
|
|
1384
1343
|
left: n,
|
|
1385
1344
|
right: r
|
|
1386
|
-
} = o.getState().columnPinning, l = t.some((
|
|
1345
|
+
} = o.getState().columnPinning, l = t.some((u) => n == null ? void 0 : n.includes(u)), s = t.some((u) => r == null ? void 0 : r.includes(u));
|
|
1387
1346
|
return l ? "left" : s ? "right" : !1;
|
|
1388
1347
|
}, e.getPinnedIndex = () => {
|
|
1389
1348
|
var t, n;
|
|
@@ -1392,13 +1351,13 @@ const xn = {
|
|
|
1392
1351
|
};
|
|
1393
1352
|
},
|
|
1394
1353
|
createRow: (e, o) => {
|
|
1395
|
-
e.getCenterVisibleCells =
|
|
1354
|
+
e.getCenterVisibleCells = y(() => [e._getAllVisibleCells(), o.getState().columnPinning.left, o.getState().columnPinning.right], (t, n, r) => {
|
|
1396
1355
|
const l = [...n ?? [], ...r ?? []];
|
|
1397
1356
|
return t.filter((s) => !l.includes(s.column.id));
|
|
1398
|
-
}, R(o.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells =
|
|
1357
|
+
}, R(o.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = y(() => [e._getAllVisibleCells(), o.getState().columnPinning.left], (t, n) => (n ?? []).map((l) => t.find((s) => s.column.id === l)).filter(Boolean).map((l) => ({
|
|
1399
1358
|
...l,
|
|
1400
1359
|
position: "left"
|
|
1401
|
-
})), R(o.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells =
|
|
1360
|
+
})), R(o.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = y(() => [e._getAllVisibleCells(), o.getState().columnPinning.right], (t, n) => (n ?? []).map((l) => t.find((s) => s.column.id === l)).filter(Boolean).map((l) => ({
|
|
1402
1361
|
...l,
|
|
1403
1362
|
position: "right"
|
|
1404
1363
|
})), R(o.options, "debugRows", "getRightVisibleCells"));
|
|
@@ -1406,7 +1365,7 @@ const xn = {
|
|
|
1406
1365
|
createTable: (e) => {
|
|
1407
1366
|
e.setColumnPinning = (o) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(o), e.resetColumnPinning = (o) => {
|
|
1408
1367
|
var t, n;
|
|
1409
|
-
return e.setColumnPinning(o ?
|
|
1368
|
+
return e.setColumnPinning(o ? $e() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : $e());
|
|
1410
1369
|
}, e.getIsSomeColumnsPinned = (o) => {
|
|
1411
1370
|
var t;
|
|
1412
1371
|
const n = e.getState().columnPinning;
|
|
@@ -1415,45 +1374,45 @@ const xn = {
|
|
|
1415
1374
|
return !!((r = n.left) != null && r.length || (l = n.right) != null && l.length);
|
|
1416
1375
|
}
|
|
1417
1376
|
return !!((t = n[o]) != null && t.length);
|
|
1418
|
-
}, e.getLeftLeafColumns =
|
|
1377
|
+
}, e.getLeftLeafColumns = y(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), R(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = y(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), R(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = y(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n) => {
|
|
1419
1378
|
const r = [...t ?? [], ...n ?? []];
|
|
1420
1379
|
return o.filter((l) => !r.includes(l.id));
|
|
1421
1380
|
}, R(e.options, "debugColumns", "getCenterLeafColumns"));
|
|
1422
1381
|
}
|
|
1423
1382
|
};
|
|
1424
|
-
function
|
|
1383
|
+
function Rn(e) {
|
|
1425
1384
|
return e || (typeof document < "u" ? document : null);
|
|
1426
1385
|
}
|
|
1427
|
-
const
|
|
1386
|
+
const we = {
|
|
1428
1387
|
size: 150,
|
|
1429
1388
|
minSize: 20,
|
|
1430
1389
|
maxSize: Number.MAX_SAFE_INTEGER
|
|
1431
|
-
},
|
|
1390
|
+
}, Me = () => ({
|
|
1432
1391
|
startOffset: null,
|
|
1433
1392
|
startSize: null,
|
|
1434
1393
|
deltaOffset: null,
|
|
1435
1394
|
deltaPercentage: null,
|
|
1436
1395
|
isResizingColumn: !1,
|
|
1437
1396
|
columnSizingStart: []
|
|
1438
|
-
}),
|
|
1439
|
-
getDefaultColumnDef: () =>
|
|
1397
|
+
}), xn = {
|
|
1398
|
+
getDefaultColumnDef: () => we,
|
|
1440
1399
|
getInitialState: (e) => ({
|
|
1441
1400
|
columnSizing: {},
|
|
1442
|
-
columnSizingInfo:
|
|
1401
|
+
columnSizingInfo: Me(),
|
|
1443
1402
|
...e
|
|
1444
1403
|
}),
|
|
1445
1404
|
getDefaultOptions: (e) => ({
|
|
1446
1405
|
columnResizeMode: "onEnd",
|
|
1447
1406
|
columnResizeDirection: "ltr",
|
|
1448
|
-
onColumnSizingChange:
|
|
1449
|
-
onColumnSizingInfoChange:
|
|
1407
|
+
onColumnSizingChange: G("columnSizing", e),
|
|
1408
|
+
onColumnSizingInfoChange: G("columnSizingInfo", e)
|
|
1450
1409
|
}),
|
|
1451
1410
|
createColumn: (e, o) => {
|
|
1452
1411
|
e.getSize = () => {
|
|
1453
1412
|
var t, n, r;
|
|
1454
1413
|
const l = o.getState().columnSizing[e.id];
|
|
1455
|
-
return Math.min(Math.max((t = e.columnDef.minSize) != null ? t :
|
|
1456
|
-
}, e.getStart =
|
|
1414
|
+
return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : we.minSize, (n = l ?? e.columnDef.size) != null ? n : we.size), (r = e.columnDef.maxSize) != null ? r : we.maxSize);
|
|
1415
|
+
}, e.getStart = y((t) => [t, ge(o, t), o.getState().columnSizing], (t, n) => n.slice(0, e.getIndex(t)).reduce((r, l) => r + l.getSize(), 0), R(o.options, "debugColumns", "getStart")), e.getAfter = y((t) => [t, ge(o, t), o.getState().columnSizing], (t, n) => n.slice(e.getIndex(t) + 1).reduce((r, l) => r + l.getSize(), 0), R(o.options, "debugColumns", "getAfter")), e.resetSize = () => {
|
|
1457
1416
|
o.setColumnSizing((t) => {
|
|
1458
1417
|
let {
|
|
1459
1418
|
[e.id]: n,
|
|
@@ -1487,27 +1446,27 @@ const me = {
|
|
|
1487
1446
|
}, e.getResizeHandler = (t) => {
|
|
1488
1447
|
const n = o.getColumn(e.column.id), r = n == null ? void 0 : n.getCanResize();
|
|
1489
1448
|
return (l) => {
|
|
1490
|
-
if (!n || !r || (l.persist == null || l.persist(),
|
|
1449
|
+
if (!n || !r || (l.persist == null || l.persist(), Ne(l) && l.touches && l.touches.length > 1))
|
|
1491
1450
|
return;
|
|
1492
|
-
const s = e.getSize(),
|
|
1493
|
-
typeof
|
|
1494
|
-
var
|
|
1495
|
-
const P = o.options.columnResizeDirection === "rtl" ? -1 : 1,
|
|
1496
|
-
return
|
|
1497
|
-
let [
|
|
1498
|
-
f[
|
|
1451
|
+
const s = e.getSize(), u = e ? e.getLeafHeaders().map((v) => [v.column.id, v.column.getSize()]) : [[n.id, n.getSize()]], a = Ne(l) ? Math.round(l.touches[0].clientX) : l.clientX, f = {}, g = (v, S) => {
|
|
1452
|
+
typeof S == "number" && (o.setColumnSizingInfo((I) => {
|
|
1453
|
+
var F, M;
|
|
1454
|
+
const P = o.options.columnResizeDirection === "rtl" ? -1 : 1, j = (S - ((F = I == null ? void 0 : I.startOffset) != null ? F : 0)) * P, W = Math.max(j / ((M = I == null ? void 0 : I.startSize) != null ? M : 0), -0.999999);
|
|
1455
|
+
return I.columnSizingStart.forEach((ie) => {
|
|
1456
|
+
let [z, O] = ie;
|
|
1457
|
+
f[z] = Math.round(Math.max(O + O * W, 0) * 100) / 100;
|
|
1499
1458
|
}), {
|
|
1500
|
-
...
|
|
1501
|
-
deltaOffset:
|
|
1502
|
-
deltaPercentage:
|
|
1459
|
+
...I,
|
|
1460
|
+
deltaOffset: j,
|
|
1461
|
+
deltaPercentage: W
|
|
1503
1462
|
};
|
|
1504
|
-
}), (o.options.columnResizeMode === "onChange" ||
|
|
1505
|
-
...
|
|
1463
|
+
}), (o.options.columnResizeMode === "onChange" || v === "end") && o.setColumnSizing((I) => ({
|
|
1464
|
+
...I,
|
|
1506
1465
|
...f
|
|
1507
1466
|
})));
|
|
1508
|
-
},
|
|
1509
|
-
|
|
1510
|
-
...
|
|
1467
|
+
}, p = (v) => g("move", v), c = (v) => {
|
|
1468
|
+
g("end", v), o.setColumnSizingInfo((S) => ({
|
|
1469
|
+
...S,
|
|
1511
1470
|
isResizingColumn: !1,
|
|
1512
1471
|
startOffset: null,
|
|
1513
1472
|
startSize: null,
|
|
@@ -1515,27 +1474,27 @@ const me = {
|
|
|
1515
1474
|
deltaPercentage: null,
|
|
1516
1475
|
columnSizingStart: []
|
|
1517
1476
|
}));
|
|
1518
|
-
},
|
|
1519
|
-
moveHandler: (
|
|
1520
|
-
upHandler: (
|
|
1521
|
-
|
|
1477
|
+
}, i = Rn(t), m = {
|
|
1478
|
+
moveHandler: (v) => p(v.clientX),
|
|
1479
|
+
upHandler: (v) => {
|
|
1480
|
+
i == null || i.removeEventListener("mousemove", m.moveHandler), i == null || i.removeEventListener("mouseup", m.upHandler), c(v.clientX);
|
|
1522
1481
|
}
|
|
1523
|
-
},
|
|
1524
|
-
moveHandler: (
|
|
1525
|
-
upHandler: (
|
|
1526
|
-
var
|
|
1527
|
-
|
|
1482
|
+
}, h = {
|
|
1483
|
+
moveHandler: (v) => (v.cancelable && (v.preventDefault(), v.stopPropagation()), p(v.touches[0].clientX), !1),
|
|
1484
|
+
upHandler: (v) => {
|
|
1485
|
+
var S;
|
|
1486
|
+
i == null || i.removeEventListener("touchmove", h.moveHandler), i == null || i.removeEventListener("touchend", h.upHandler), v.cancelable && (v.preventDefault(), v.stopPropagation()), c((S = v.touches[0]) == null ? void 0 : S.clientX);
|
|
1528
1487
|
}
|
|
1529
|
-
}, C =
|
|
1488
|
+
}, C = _n() ? {
|
|
1530
1489
|
passive: !1
|
|
1531
1490
|
} : !1;
|
|
1532
|
-
|
|
1533
|
-
...
|
|
1534
|
-
startOffset:
|
|
1491
|
+
Ne(l) ? (i == null || i.addEventListener("touchmove", h.moveHandler, C), i == null || i.addEventListener("touchend", h.upHandler, C)) : (i == null || i.addEventListener("mousemove", m.moveHandler, C), i == null || i.addEventListener("mouseup", m.upHandler, C)), o.setColumnSizingInfo((v) => ({
|
|
1492
|
+
...v,
|
|
1493
|
+
startOffset: a,
|
|
1535
1494
|
startSize: s,
|
|
1536
1495
|
deltaOffset: 0,
|
|
1537
1496
|
deltaPercentage: 0,
|
|
1538
|
-
columnSizingStart:
|
|
1497
|
+
columnSizingStart: u,
|
|
1539
1498
|
isResizingColumn: n.id
|
|
1540
1499
|
}));
|
|
1541
1500
|
};
|
|
@@ -1547,7 +1506,7 @@ const me = {
|
|
|
1547
1506
|
e.setColumnSizing(o ? {} : (t = e.initialState.columnSizing) != null ? t : {});
|
|
1548
1507
|
}, e.resetHeaderSizeInfo = (o) => {
|
|
1549
1508
|
var t;
|
|
1550
|
-
e.setColumnSizingInfo(o ?
|
|
1509
|
+
e.setColumnSizingInfo(o ? Me() : (t = e.initialState.columnSizingInfo) != null ? t : Me());
|
|
1551
1510
|
}, e.getTotalSize = () => {
|
|
1552
1511
|
var o, t;
|
|
1553
1512
|
return (o = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
|
|
@@ -1563,9 +1522,9 @@ const me = {
|
|
|
1563
1522
|
};
|
|
1564
1523
|
}
|
|
1565
1524
|
};
|
|
1566
|
-
let
|
|
1567
|
-
function
|
|
1568
|
-
if (typeof
|
|
1525
|
+
let Ce = null;
|
|
1526
|
+
function _n() {
|
|
1527
|
+
if (typeof Ce == "boolean") return Ce;
|
|
1569
1528
|
let e = !1;
|
|
1570
1529
|
try {
|
|
1571
1530
|
const o = {
|
|
@@ -1578,18 +1537,18 @@ function $n() {
|
|
|
1578
1537
|
} catch {
|
|
1579
1538
|
e = !1;
|
|
1580
1539
|
}
|
|
1581
|
-
return
|
|
1540
|
+
return Ce = e, Ce;
|
|
1582
1541
|
}
|
|
1583
|
-
function
|
|
1542
|
+
function Ne(e) {
|
|
1584
1543
|
return e.type === "touchstart";
|
|
1585
1544
|
}
|
|
1586
|
-
const
|
|
1545
|
+
const Fn = {
|
|
1587
1546
|
getInitialState: (e) => ({
|
|
1588
1547
|
columnVisibility: {},
|
|
1589
1548
|
...e
|
|
1590
1549
|
}),
|
|
1591
1550
|
getDefaultOptions: (e) => ({
|
|
1592
|
-
onColumnVisibilityChange:
|
|
1551
|
+
onColumnVisibilityChange: G("columnVisibility", e)
|
|
1593
1552
|
}),
|
|
1594
1553
|
createColumn: (e, o) => {
|
|
1595
1554
|
e.toggleVisibility = (t) => {
|
|
@@ -1609,10 +1568,10 @@ const Nn = {
|
|
|
1609
1568
|
};
|
|
1610
1569
|
},
|
|
1611
1570
|
createRow: (e, o) => {
|
|
1612
|
-
e._getAllVisibleCells =
|
|
1571
|
+
e._getAllVisibleCells = y(() => [e.getAllCells(), o.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), R(o.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = y(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, r) => [...t, ...n, ...r], R(o.options, "debugRows", "getVisibleCells"));
|
|
1613
1572
|
},
|
|
1614
1573
|
createTable: (e) => {
|
|
1615
|
-
const o = (t, n) =>
|
|
1574
|
+
const o = (t, n) => y(() => [n(), n().filter((r) => r.getIsVisible()).map((r) => r.id).join("_")], (r) => r.filter((l) => l.getIsVisible == null ? void 0 : l.getIsVisible()), R(e.options, "debugColumns", t));
|
|
1616
1575
|
e.getVisibleFlatColumns = o("getVisibleFlatColumns", () => e.getAllFlatColumns()), e.getVisibleLeafColumns = o("getVisibleLeafColumns", () => e.getAllLeafColumns()), e.getLeftVisibleLeafColumns = o("getLeftVisibleLeafColumns", () => e.getLeftLeafColumns()), e.getRightVisibleLeafColumns = o("getRightVisibleLeafColumns", () => e.getRightLeafColumns()), e.getCenterVisibleLeafColumns = o("getCenterVisibleLeafColumns", () => e.getCenterLeafColumns()), e.setColumnVisibility = (t) => e.options.onColumnVisibilityChange == null ? void 0 : e.options.onColumnVisibilityChange(t), e.resetColumnVisibility = (t) => {
|
|
1617
1576
|
var n;
|
|
1618
1577
|
e.setColumnVisibility(t ? {} : (n = e.initialState.columnVisibility) != null ? n : {});
|
|
@@ -1628,23 +1587,23 @@ const Nn = {
|
|
|
1628
1587
|
};
|
|
1629
1588
|
}
|
|
1630
1589
|
};
|
|
1631
|
-
function
|
|
1590
|
+
function ge(e, o) {
|
|
1632
1591
|
return o ? o === "center" ? e.getCenterVisibleLeafColumns() : o === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
|
|
1633
1592
|
}
|
|
1634
|
-
const
|
|
1593
|
+
const In = {
|
|
1635
1594
|
createTable: (e) => {
|
|
1636
1595
|
e._getGlobalFacetedRowModel = e.options.getFacetedRowModel && e.options.getFacetedRowModel(e, "__global__"), e.getGlobalFacetedRowModel = () => e.options.manualFiltering || !e._getGlobalFacetedRowModel ? e.getPreFilteredRowModel() : e._getGlobalFacetedRowModel(), e._getGlobalFacetedUniqueValues = e.options.getFacetedUniqueValues && e.options.getFacetedUniqueValues(e, "__global__"), e.getGlobalFacetedUniqueValues = () => e._getGlobalFacetedUniqueValues ? e._getGlobalFacetedUniqueValues() : /* @__PURE__ */ new Map(), e._getGlobalFacetedMinMaxValues = e.options.getFacetedMinMaxValues && e.options.getFacetedMinMaxValues(e, "__global__"), e.getGlobalFacetedMinMaxValues = () => {
|
|
1637
1596
|
if (e._getGlobalFacetedMinMaxValues)
|
|
1638
1597
|
return e._getGlobalFacetedMinMaxValues();
|
|
1639
1598
|
};
|
|
1640
1599
|
}
|
|
1641
|
-
},
|
|
1600
|
+
}, $n = {
|
|
1642
1601
|
getInitialState: (e) => ({
|
|
1643
1602
|
globalFilter: void 0,
|
|
1644
1603
|
...e
|
|
1645
1604
|
}),
|
|
1646
1605
|
getDefaultOptions: (e) => ({
|
|
1647
|
-
onGlobalFilterChange:
|
|
1606
|
+
onGlobalFilterChange: G("globalFilter", e),
|
|
1648
1607
|
globalFilterFn: "auto",
|
|
1649
1608
|
getColumnCanGlobalFilter: (o) => {
|
|
1650
1609
|
var t;
|
|
@@ -1659,25 +1618,25 @@ const Mn = {
|
|
|
1659
1618
|
};
|
|
1660
1619
|
},
|
|
1661
1620
|
createTable: (e) => {
|
|
1662
|
-
e.getGlobalAutoFilterFn = () =>
|
|
1621
|
+
e.getGlobalAutoFilterFn = () => X.includesString, e.getGlobalFilterFn = () => {
|
|
1663
1622
|
var o, t;
|
|
1664
1623
|
const {
|
|
1665
1624
|
globalFilterFn: n
|
|
1666
1625
|
} = e.options;
|
|
1667
|
-
return
|
|
1626
|
+
return Re(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o : X[n];
|
|
1668
1627
|
}, e.setGlobalFilter = (o) => {
|
|
1669
1628
|
e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(o);
|
|
1670
1629
|
}, e.resetGlobalFilter = (o) => {
|
|
1671
1630
|
e.setGlobalFilter(o ? void 0 : e.initialState.globalFilter);
|
|
1672
1631
|
};
|
|
1673
1632
|
}
|
|
1674
|
-
},
|
|
1633
|
+
}, Mn = {
|
|
1675
1634
|
getInitialState: (e) => ({
|
|
1676
1635
|
expanded: {},
|
|
1677
1636
|
...e
|
|
1678
1637
|
}),
|
|
1679
1638
|
getDefaultOptions: (e) => ({
|
|
1680
|
-
onExpandedChange:
|
|
1639
|
+
onExpandedChange: G("expanded", e),
|
|
1681
1640
|
paginateExpandedRows: !0
|
|
1682
1641
|
}),
|
|
1683
1642
|
createTable: (e) => {
|
|
@@ -1723,8 +1682,8 @@ const Mn = {
|
|
|
1723
1682
|
var r;
|
|
1724
1683
|
const l = n === !0 ? !0 : !!(n != null && n[e.id]);
|
|
1725
1684
|
let s = {};
|
|
1726
|
-
if (n === !0 ? Object.keys(o.getRowModel().rowsById).forEach((
|
|
1727
|
-
s[
|
|
1685
|
+
if (n === !0 ? Object.keys(o.getRowModel().rowsById).forEach((u) => {
|
|
1686
|
+
s[u] = !0;
|
|
1728
1687
|
}) : s = n, t = (r = t) != null ? r : !l, !l && t)
|
|
1729
1688
|
return {
|
|
1730
1689
|
...s,
|
|
@@ -1732,10 +1691,10 @@ const Mn = {
|
|
|
1732
1691
|
};
|
|
1733
1692
|
if (l && !t) {
|
|
1734
1693
|
const {
|
|
1735
|
-
[e.id]:
|
|
1736
|
-
...
|
|
1694
|
+
[e.id]: u,
|
|
1695
|
+
...a
|
|
1737
1696
|
} = s;
|
|
1738
|
-
return
|
|
1697
|
+
return a;
|
|
1739
1698
|
}
|
|
1740
1699
|
return n;
|
|
1741
1700
|
});
|
|
@@ -1758,19 +1717,19 @@ const Mn = {
|
|
|
1758
1717
|
};
|
|
1759
1718
|
};
|
|
1760
1719
|
}
|
|
1761
|
-
},
|
|
1762
|
-
pageIndex:
|
|
1763
|
-
pageSize:
|
|
1764
|
-
}),
|
|
1720
|
+
}, Le = 0, ze = 10, Ve = () => ({
|
|
1721
|
+
pageIndex: Le,
|
|
1722
|
+
pageSize: ze
|
|
1723
|
+
}), Nn = {
|
|
1765
1724
|
getInitialState: (e) => ({
|
|
1766
1725
|
...e,
|
|
1767
1726
|
pagination: {
|
|
1768
|
-
...
|
|
1727
|
+
...Ve(),
|
|
1769
1728
|
...e == null ? void 0 : e.pagination
|
|
1770
1729
|
}
|
|
1771
1730
|
}),
|
|
1772
1731
|
getDefaultOptions: (e) => ({
|
|
1773
|
-
onPaginationChange:
|
|
1732
|
+
onPaginationChange: G("pagination", e)
|
|
1774
1733
|
}),
|
|
1775
1734
|
createTable: (e) => {
|
|
1776
1735
|
let o = !1, t = !1;
|
|
@@ -1789,14 +1748,14 @@ const Mn = {
|
|
|
1789
1748
|
});
|
|
1790
1749
|
}
|
|
1791
1750
|
}, e.setPagination = (n) => {
|
|
1792
|
-
const r = (l) =>
|
|
1751
|
+
const r = (l) => Q(n, l);
|
|
1793
1752
|
return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(r);
|
|
1794
1753
|
}, e.resetPagination = (n) => {
|
|
1795
1754
|
var r;
|
|
1796
|
-
e.setPagination(n ?
|
|
1755
|
+
e.setPagination(n ? Ve() : (r = e.initialState.pagination) != null ? r : Ve());
|
|
1797
1756
|
}, e.setPageIndex = (n) => {
|
|
1798
1757
|
e.setPagination((r) => {
|
|
1799
|
-
let l =
|
|
1758
|
+
let l = Q(n, r.pageIndex);
|
|
1800
1759
|
const s = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
|
|
1801
1760
|
return l = Math.max(0, Math.min(l, s)), {
|
|
1802
1761
|
...r,
|
|
@@ -1805,27 +1764,27 @@ const Mn = {
|
|
|
1805
1764
|
});
|
|
1806
1765
|
}, e.resetPageIndex = (n) => {
|
|
1807
1766
|
var r, l;
|
|
1808
|
-
e.setPageIndex(n ?
|
|
1767
|
+
e.setPageIndex(n ? Le : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageIndex) != null ? r : Le);
|
|
1809
1768
|
}, e.resetPageSize = (n) => {
|
|
1810
1769
|
var r, l;
|
|
1811
|
-
e.setPageSize(n ?
|
|
1770
|
+
e.setPageSize(n ? ze : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageSize) != null ? r : ze);
|
|
1812
1771
|
}, e.setPageSize = (n) => {
|
|
1813
1772
|
e.setPagination((r) => {
|
|
1814
|
-
const l = Math.max(1,
|
|
1773
|
+
const l = Math.max(1, Q(n, r.pageSize)), s = r.pageSize * r.pageIndex, u = Math.floor(s / l);
|
|
1815
1774
|
return {
|
|
1816
1775
|
...r,
|
|
1817
|
-
pageIndex:
|
|
1776
|
+
pageIndex: u,
|
|
1818
1777
|
pageSize: l
|
|
1819
1778
|
};
|
|
1820
1779
|
});
|
|
1821
1780
|
}, e.setPageCount = (n) => e.setPagination((r) => {
|
|
1822
1781
|
var l;
|
|
1823
|
-
let s =
|
|
1782
|
+
let s = Q(n, (l = e.options.pageCount) != null ? l : -1);
|
|
1824
1783
|
return typeof s == "number" && (s = Math.max(-1, s)), {
|
|
1825
1784
|
...r,
|
|
1826
1785
|
pageCount: s
|
|
1827
1786
|
};
|
|
1828
|
-
}), e.getPageOptions =
|
|
1787
|
+
}), e.getPageOptions = y(() => [e.getPageCount()], (n) => {
|
|
1829
1788
|
let r = [];
|
|
1830
1789
|
return n && n > 0 && (r = [...new Array(n)].fill(null).map((l, s) => s)), r;
|
|
1831
1790
|
}, R(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
|
|
@@ -1841,49 +1800,49 @@ const Mn = {
|
|
|
1841
1800
|
return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
|
|
1842
1801
|
};
|
|
1843
1802
|
}
|
|
1844
|
-
},
|
|
1803
|
+
}, Pe = () => ({
|
|
1845
1804
|
top: [],
|
|
1846
1805
|
bottom: []
|
|
1847
|
-
}),
|
|
1806
|
+
}), Vn = {
|
|
1848
1807
|
getInitialState: (e) => ({
|
|
1849
|
-
rowPinning:
|
|
1808
|
+
rowPinning: Pe(),
|
|
1850
1809
|
...e
|
|
1851
1810
|
}),
|
|
1852
1811
|
getDefaultOptions: (e) => ({
|
|
1853
|
-
onRowPinningChange:
|
|
1812
|
+
onRowPinningChange: G("rowPinning", e)
|
|
1854
1813
|
}),
|
|
1855
1814
|
createRow: (e, o) => {
|
|
1856
1815
|
e.pin = (t, n, r) => {
|
|
1857
|
-
const l = n ? e.getLeafRows().map((
|
|
1816
|
+
const l = n ? e.getLeafRows().map((a) => {
|
|
1858
1817
|
let {
|
|
1859
1818
|
id: f
|
|
1860
|
-
} =
|
|
1819
|
+
} = a;
|
|
1861
1820
|
return f;
|
|
1862
|
-
}) : [], s = r ? e.getParentRows().map((
|
|
1821
|
+
}) : [], s = r ? e.getParentRows().map((a) => {
|
|
1863
1822
|
let {
|
|
1864
1823
|
id: f
|
|
1865
|
-
} =
|
|
1824
|
+
} = a;
|
|
1866
1825
|
return f;
|
|
1867
|
-
}) : [],
|
|
1868
|
-
o.setRowPinning((
|
|
1869
|
-
var f,
|
|
1826
|
+
}) : [], u = /* @__PURE__ */ new Set([...s, e.id, ...l]);
|
|
1827
|
+
o.setRowPinning((a) => {
|
|
1828
|
+
var f, g;
|
|
1870
1829
|
if (t === "bottom") {
|
|
1871
|
-
var
|
|
1830
|
+
var p, c;
|
|
1872
1831
|
return {
|
|
1873
|
-
top: ((
|
|
1874
|
-
bottom: [...((c =
|
|
1832
|
+
top: ((p = a == null ? void 0 : a.top) != null ? p : []).filter((h) => !(u != null && u.has(h))),
|
|
1833
|
+
bottom: [...((c = a == null ? void 0 : a.bottom) != null ? c : []).filter((h) => !(u != null && u.has(h))), ...Array.from(u)]
|
|
1875
1834
|
};
|
|
1876
1835
|
}
|
|
1877
1836
|
if (t === "top") {
|
|
1878
|
-
var
|
|
1837
|
+
var i, m;
|
|
1879
1838
|
return {
|
|
1880
|
-
top: [...((
|
|
1881
|
-
bottom: ((m =
|
|
1839
|
+
top: [...((i = a == null ? void 0 : a.top) != null ? i : []).filter((h) => !(u != null && u.has(h))), ...Array.from(u)],
|
|
1840
|
+
bottom: ((m = a == null ? void 0 : a.bottom) != null ? m : []).filter((h) => !(u != null && u.has(h)))
|
|
1882
1841
|
};
|
|
1883
1842
|
}
|
|
1884
1843
|
return {
|
|
1885
|
-
top: ((f =
|
|
1886
|
-
bottom: ((
|
|
1844
|
+
top: ((f = a == null ? void 0 : a.top) != null ? f : []).filter((h) => !(u != null && u.has(h))),
|
|
1845
|
+
bottom: ((g = a == null ? void 0 : a.bottom) != null ? g : []).filter((h) => !(u != null && u.has(h)))
|
|
1887
1846
|
};
|
|
1888
1847
|
});
|
|
1889
1848
|
}, e.getCanPin = () => {
|
|
@@ -1897,7 +1856,7 @@ const Mn = {
|
|
|
1897
1856
|
const t = [e.id], {
|
|
1898
1857
|
top: n,
|
|
1899
1858
|
bottom: r
|
|
1900
|
-
} = o.getState().rowPinning, l = t.some((
|
|
1859
|
+
} = o.getState().rowPinning, l = t.some((u) => n == null ? void 0 : n.includes(u)), s = t.some((u) => r == null ? void 0 : r.includes(u));
|
|
1901
1860
|
return l ? "top" : s ? "bottom" : !1;
|
|
1902
1861
|
}, e.getPinnedIndex = () => {
|
|
1903
1862
|
var t, n;
|
|
@@ -1905,9 +1864,9 @@ const Mn = {
|
|
|
1905
1864
|
if (!r) return -1;
|
|
1906
1865
|
const l = (t = r === "top" ? o.getTopRows() : o.getBottomRows()) == null ? void 0 : t.map((s) => {
|
|
1907
1866
|
let {
|
|
1908
|
-
id:
|
|
1867
|
+
id: u
|
|
1909
1868
|
} = s;
|
|
1910
|
-
return
|
|
1869
|
+
return u;
|
|
1911
1870
|
});
|
|
1912
1871
|
return (n = l == null ? void 0 : l.indexOf(e.id)) != null ? n : -1;
|
|
1913
1872
|
};
|
|
@@ -1915,7 +1874,7 @@ const Mn = {
|
|
|
1915
1874
|
createTable: (e) => {
|
|
1916
1875
|
e.setRowPinning = (o) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(o), e.resetRowPinning = (o) => {
|
|
1917
1876
|
var t, n;
|
|
1918
|
-
return e.setRowPinning(o ?
|
|
1877
|
+
return e.setRowPinning(o ? Pe() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : Pe());
|
|
1919
1878
|
}, e.getIsSomeRowsPinned = (o) => {
|
|
1920
1879
|
var t;
|
|
1921
1880
|
const n = e.getState().rowPinning;
|
|
@@ -1930,28 +1889,28 @@ const Mn = {
|
|
|
1930
1889
|
//get all rows that are pinned even if they would not be otherwise visible
|
|
1931
1890
|
//account for expanded parent rows, but not pagination or filtering
|
|
1932
1891
|
(t ?? []).map((s) => {
|
|
1933
|
-
const
|
|
1934
|
-
return
|
|
1892
|
+
const u = e.getRow(s, !0);
|
|
1893
|
+
return u.getIsAllParentsExpanded() ? u : null;
|
|
1935
1894
|
})
|
|
1936
1895
|
) : (
|
|
1937
1896
|
//else get only visible rows that are pinned
|
|
1938
|
-
(t ?? []).map((s) => o.find((
|
|
1897
|
+
(t ?? []).map((s) => o.find((u) => u.id === s))
|
|
1939
1898
|
)).filter(Boolean).map((s) => ({
|
|
1940
1899
|
...s,
|
|
1941
1900
|
position: n
|
|
1942
1901
|
}));
|
|
1943
|
-
}, e.getTopRows =
|
|
1902
|
+
}, e.getTopRows = y(() => [e.getRowModel().rows, e.getState().rowPinning.top], (o, t) => e._getPinnedRows(o, t, "top"), R(e.options, "debugRows", "getTopRows")), e.getBottomRows = y(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (o, t) => e._getPinnedRows(o, t, "bottom"), R(e.options, "debugRows", "getBottomRows")), e.getCenterRows = y(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (o, t, n) => {
|
|
1944
1903
|
const r = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
|
|
1945
1904
|
return o.filter((l) => !r.has(l.id));
|
|
1946
1905
|
}, R(e.options, "debugRows", "getCenterRows"));
|
|
1947
1906
|
}
|
|
1948
|
-
},
|
|
1907
|
+
}, Pn = {
|
|
1949
1908
|
getInitialState: (e) => ({
|
|
1950
1909
|
rowSelection: {},
|
|
1951
1910
|
...e
|
|
1952
1911
|
}),
|
|
1953
1912
|
getDefaultOptions: (e) => ({
|
|
1954
|
-
onRowSelectionChange:
|
|
1913
|
+
onRowSelectionChange: G("rowSelection", e),
|
|
1955
1914
|
enableRowSelection: !0,
|
|
1956
1915
|
enableMultiRowSelection: !0,
|
|
1957
1916
|
enableSubRowSelection: !0
|
|
@@ -1980,17 +1939,17 @@ const Mn = {
|
|
|
1980
1939
|
...t
|
|
1981
1940
|
};
|
|
1982
1941
|
return e.getRowModel().rows.forEach((l) => {
|
|
1983
|
-
|
|
1942
|
+
Ae(r, l.id, n, !0, e);
|
|
1984
1943
|
}), r;
|
|
1985
|
-
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel =
|
|
1944
|
+
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = y(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? ke(e, t) : {
|
|
1986
1945
|
rows: [],
|
|
1987
1946
|
flatRows: [],
|
|
1988
1947
|
rowsById: {}
|
|
1989
|
-
}, R(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel =
|
|
1948
|
+
}, R(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = y(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? ke(e, t) : {
|
|
1990
1949
|
rows: [],
|
|
1991
1950
|
flatRows: [],
|
|
1992
1951
|
rowsById: {}
|
|
1993
|
-
}, R(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel =
|
|
1952
|
+
}, R(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = y(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? ke(e, t) : {
|
|
1994
1953
|
rows: [],
|
|
1995
1954
|
flatRows: [],
|
|
1996
1955
|
rowsById: {}
|
|
@@ -2026,26 +1985,26 @@ const Mn = {
|
|
|
2026
1985
|
var s;
|
|
2027
1986
|
if (t = typeof t < "u" ? t : !r, e.getCanSelect() && r === t)
|
|
2028
1987
|
return l;
|
|
2029
|
-
const
|
|
1988
|
+
const u = {
|
|
2030
1989
|
...l
|
|
2031
1990
|
};
|
|
2032
|
-
return
|
|
1991
|
+
return Ae(u, e.id, t, (s = n == null ? void 0 : n.selectChildren) != null ? s : !0, o), u;
|
|
2033
1992
|
});
|
|
2034
1993
|
}, e.getIsSelected = () => {
|
|
2035
1994
|
const {
|
|
2036
1995
|
rowSelection: t
|
|
2037
1996
|
} = o.getState();
|
|
2038
|
-
return
|
|
1997
|
+
return Ke(e, t);
|
|
2039
1998
|
}, e.getIsSomeSelected = () => {
|
|
2040
1999
|
const {
|
|
2041
2000
|
rowSelection: t
|
|
2042
2001
|
} = o.getState();
|
|
2043
|
-
return
|
|
2002
|
+
return He(e, t) === "some";
|
|
2044
2003
|
}, e.getIsAllSubRowsSelected = () => {
|
|
2045
2004
|
const {
|
|
2046
2005
|
rowSelection: t
|
|
2047
2006
|
} = o.getState();
|
|
2048
|
-
return
|
|
2007
|
+
return He(e, t) === "all";
|
|
2049
2008
|
}, e.getCanSelect = () => {
|
|
2050
2009
|
var t;
|
|
2051
2010
|
return typeof o.options.enableRowSelection == "function" ? o.options.enableRowSelection(e) : (t = o.options.enableRowSelection) != null ? t : !0;
|
|
@@ -2063,21 +2022,21 @@ const Mn = {
|
|
|
2063
2022
|
};
|
|
2064
2023
|
};
|
|
2065
2024
|
}
|
|
2066
|
-
},
|
|
2025
|
+
}, Ae = (e, o, t, n, r) => {
|
|
2067
2026
|
var l;
|
|
2068
2027
|
const s = r.getRow(o, !0);
|
|
2069
|
-
t ? (s.getCanMultiSelect() || Object.keys(e).forEach((
|
|
2028
|
+
t ? (s.getCanMultiSelect() || Object.keys(e).forEach((u) => delete e[u]), s.getCanSelect() && (e[o] = !0)) : delete e[o], n && (l = s.subRows) != null && l.length && s.getCanSelectSubRows() && s.subRows.forEach((u) => Ae(e, u.id, t, n, r));
|
|
2070
2029
|
};
|
|
2071
|
-
function
|
|
2072
|
-
const t = e.getState().rowSelection, n = [], r = {}, l = function(s,
|
|
2073
|
-
return s.map((
|
|
2030
|
+
function ke(e, o) {
|
|
2031
|
+
const t = e.getState().rowSelection, n = [], r = {}, l = function(s, u) {
|
|
2032
|
+
return s.map((a) => {
|
|
2074
2033
|
var f;
|
|
2075
|
-
const
|
|
2076
|
-
if (
|
|
2077
|
-
...
|
|
2078
|
-
subRows: l(
|
|
2079
|
-
}),
|
|
2080
|
-
return
|
|
2034
|
+
const g = Ke(a, t);
|
|
2035
|
+
if (g && (n.push(a), r[a.id] = a), (f = a.subRows) != null && f.length && (a = {
|
|
2036
|
+
...a,
|
|
2037
|
+
subRows: l(a.subRows)
|
|
2038
|
+
}), g)
|
|
2039
|
+
return a;
|
|
2081
2040
|
}).filter(Boolean);
|
|
2082
2041
|
};
|
|
2083
2042
|
return {
|
|
@@ -2086,59 +2045,59 @@ function Ne(e, o) {
|
|
|
2086
2045
|
rowsById: r
|
|
2087
2046
|
};
|
|
2088
2047
|
}
|
|
2089
|
-
function
|
|
2048
|
+
function Ke(e, o) {
|
|
2090
2049
|
var t;
|
|
2091
2050
|
return (t = o[e.id]) != null ? t : !1;
|
|
2092
2051
|
}
|
|
2093
|
-
function
|
|
2052
|
+
function He(e, o, t) {
|
|
2094
2053
|
var n;
|
|
2095
2054
|
if (!((n = e.subRows) != null && n.length)) return !1;
|
|
2096
2055
|
let r = !0, l = !1;
|
|
2097
2056
|
return e.subRows.forEach((s) => {
|
|
2098
|
-
if (!(l && !r) && (s.getCanSelect() && (
|
|
2099
|
-
const
|
|
2100
|
-
|
|
2057
|
+
if (!(l && !r) && (s.getCanSelect() && (Ke(s, o) ? l = !0 : r = !1), s.subRows && s.subRows.length)) {
|
|
2058
|
+
const u = He(s, o);
|
|
2059
|
+
u === "all" ? l = !0 : (u === "some" && (l = !0), r = !1);
|
|
2101
2060
|
}
|
|
2102
2061
|
}), r ? "all" : l ? "some" : !1;
|
|
2103
2062
|
}
|
|
2104
|
-
const
|
|
2063
|
+
const Ge = /([0-9]+)/gm, kn = (e, o, t) => ht(Y(e.getValue(t)).toLowerCase(), Y(o.getValue(t)).toLowerCase()), En = (e, o, t) => ht(Y(e.getValue(t)), Y(o.getValue(t))), bn = (e, o, t) => je(Y(e.getValue(t)).toLowerCase(), Y(o.getValue(t)).toLowerCase()), Dn = (e, o, t) => je(Y(e.getValue(t)), Y(o.getValue(t))), Ln = (e, o, t) => {
|
|
2105
2064
|
const n = e.getValue(t), r = o.getValue(t);
|
|
2106
2065
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
2107
|
-
},
|
|
2108
|
-
function
|
|
2066
|
+
}, zn = (e, o, t) => je(e.getValue(t), o.getValue(t));
|
|
2067
|
+
function je(e, o) {
|
|
2109
2068
|
return e === o ? 0 : e > o ? 1 : -1;
|
|
2110
2069
|
}
|
|
2111
|
-
function
|
|
2070
|
+
function Y(e) {
|
|
2112
2071
|
return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
|
|
2113
2072
|
}
|
|
2114
|
-
function
|
|
2115
|
-
const t = e.split(
|
|
2073
|
+
function ht(e, o) {
|
|
2074
|
+
const t = e.split(Ge).filter(Boolean), n = o.split(Ge).filter(Boolean);
|
|
2116
2075
|
for (; t.length && n.length; ) {
|
|
2117
|
-
const r = t.shift(), l = n.shift(), s = parseInt(r, 10),
|
|
2118
|
-
if (isNaN(
|
|
2076
|
+
const r = t.shift(), l = n.shift(), s = parseInt(r, 10), u = parseInt(l, 10), a = [s, u].sort();
|
|
2077
|
+
if (isNaN(a[0])) {
|
|
2119
2078
|
if (r > l)
|
|
2120
2079
|
return 1;
|
|
2121
2080
|
if (l > r)
|
|
2122
2081
|
return -1;
|
|
2123
2082
|
continue;
|
|
2124
2083
|
}
|
|
2125
|
-
if (isNaN(
|
|
2084
|
+
if (isNaN(a[1]))
|
|
2126
2085
|
return isNaN(s) ? -1 : 1;
|
|
2127
|
-
if (s >
|
|
2086
|
+
if (s > u)
|
|
2128
2087
|
return 1;
|
|
2129
|
-
if (
|
|
2088
|
+
if (u > s)
|
|
2130
2089
|
return -1;
|
|
2131
2090
|
}
|
|
2132
2091
|
return t.length - n.length;
|
|
2133
2092
|
}
|
|
2134
|
-
const
|
|
2135
|
-
alphanumeric:
|
|
2136
|
-
alphanumericCaseSensitive:
|
|
2137
|
-
text:
|
|
2138
|
-
textCaseSensitive:
|
|
2139
|
-
datetime:
|
|
2140
|
-
basic:
|
|
2141
|
-
},
|
|
2093
|
+
const ce = {
|
|
2094
|
+
alphanumeric: kn,
|
|
2095
|
+
alphanumericCaseSensitive: En,
|
|
2096
|
+
text: bn,
|
|
2097
|
+
textCaseSensitive: Dn,
|
|
2098
|
+
datetime: Ln,
|
|
2099
|
+
basic: zn
|
|
2100
|
+
}, An = {
|
|
2142
2101
|
getInitialState: (e) => ({
|
|
2143
2102
|
sorting: [],
|
|
2144
2103
|
...e
|
|
@@ -2148,7 +2107,7 @@ const ue = {
|
|
|
2148
2107
|
sortUndefined: 1
|
|
2149
2108
|
}),
|
|
2150
2109
|
getDefaultOptions: (e) => ({
|
|
2151
|
-
onSortingChange:
|
|
2110
|
+
onSortingChange: G("sorting", e),
|
|
2152
2111
|
isMultiSortEvent: (o) => o.shiftKey
|
|
2153
2112
|
}),
|
|
2154
2113
|
createColumn: (e, o) => {
|
|
@@ -2158,11 +2117,11 @@ const ue = {
|
|
|
2158
2117
|
for (const r of t) {
|
|
2159
2118
|
const l = r == null ? void 0 : r.getValue(e.id);
|
|
2160
2119
|
if (Object.prototype.toString.call(l) === "[object Date]")
|
|
2161
|
-
return
|
|
2162
|
-
if (typeof l == "string" && (n = !0, l.split(
|
|
2163
|
-
return
|
|
2120
|
+
return ce.datetime;
|
|
2121
|
+
if (typeof l == "string" && (n = !0, l.split(Ge).length > 1))
|
|
2122
|
+
return ce.alphanumeric;
|
|
2164
2123
|
}
|
|
2165
|
-
return n ?
|
|
2124
|
+
return n ? ce.text : ce.basic;
|
|
2166
2125
|
}, e.getAutoSortDir = () => {
|
|
2167
2126
|
const t = o.getFilteredRowModel().flatRows[0];
|
|
2168
2127
|
return typeof (t == null ? void 0 : t.getValue(e.id)) == "string" ? "asc" : "desc";
|
|
@@ -2170,24 +2129,24 @@ const ue = {
|
|
|
2170
2129
|
var t, n;
|
|
2171
2130
|
if (!e)
|
|
2172
2131
|
throw new Error();
|
|
2173
|
-
return
|
|
2132
|
+
return Re(e.columnDef.sortingFn) ? e.columnDef.sortingFn : e.columnDef.sortingFn === "auto" ? e.getAutoSortingFn() : (t = (n = o.options.sortingFns) == null ? void 0 : n[e.columnDef.sortingFn]) != null ? t : ce[e.columnDef.sortingFn];
|
|
2174
2133
|
}, e.toggleSorting = (t, n) => {
|
|
2175
2134
|
const r = e.getNextSortingOrder(), l = typeof t < "u" && t !== null;
|
|
2176
2135
|
o.setSorting((s) => {
|
|
2177
|
-
const
|
|
2178
|
-
let f = [],
|
|
2179
|
-
if (s != null && s.length && e.getCanMultiSort() && n ?
|
|
2136
|
+
const u = s == null ? void 0 : s.find((i) => i.id === e.id), a = s == null ? void 0 : s.findIndex((i) => i.id === e.id);
|
|
2137
|
+
let f = [], g, p = l ? t : r === "desc";
|
|
2138
|
+
if (s != null && s.length && e.getCanMultiSort() && n ? u ? g = "toggle" : g = "add" : s != null && s.length && a !== s.length - 1 ? g = "replace" : u ? g = "toggle" : g = "replace", g === "toggle" && (l || r || (g = "remove")), g === "add") {
|
|
2180
2139
|
var c;
|
|
2181
2140
|
f = [...s, {
|
|
2182
2141
|
id: e.id,
|
|
2183
|
-
desc:
|
|
2142
|
+
desc: p
|
|
2184
2143
|
}], f.splice(0, f.length - ((c = o.options.maxMultiSortColCount) != null ? c : Number.MAX_SAFE_INTEGER));
|
|
2185
|
-
} else
|
|
2186
|
-
...
|
|
2187
|
-
desc:
|
|
2188
|
-
} :
|
|
2144
|
+
} else g === "toggle" ? f = s.map((i) => i.id === e.id ? {
|
|
2145
|
+
...i,
|
|
2146
|
+
desc: p
|
|
2147
|
+
} : i) : g === "remove" ? f = s.filter((i) => i.id !== e.id) : f = [{
|
|
2189
2148
|
id: e.id,
|
|
2190
|
-
desc:
|
|
2149
|
+
desc: p
|
|
2191
2150
|
}];
|
|
2192
2151
|
return f;
|
|
2193
2152
|
});
|
|
@@ -2227,155 +2186,155 @@ const ue = {
|
|
|
2227
2186
|
e.setSorting(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
|
|
2228
2187
|
}, e.getPreSortedRowModel = () => e.getGroupedRowModel(), e.getSortedRowModel = () => (!e._getSortedRowModel && e.options.getSortedRowModel && (e._getSortedRowModel = e.options.getSortedRowModel(e)), e.options.manualSorting || !e._getSortedRowModel ? e.getPreSortedRowModel() : e._getSortedRowModel());
|
|
2229
2188
|
}
|
|
2230
|
-
},
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2189
|
+
}, Hn = [
|
|
2190
|
+
ln,
|
|
2191
|
+
Fn,
|
|
2192
|
+
Sn,
|
|
2193
|
+
yn,
|
|
2194
|
+
sn,
|
|
2195
|
+
an,
|
|
2196
|
+
In,
|
|
2238
2197
|
//depends on ColumnFaceting
|
|
2239
|
-
|
|
2198
|
+
$n,
|
|
2240
2199
|
//depends on ColumnFiltering
|
|
2241
|
-
|
|
2242
|
-
|
|
2200
|
+
An,
|
|
2201
|
+
wn,
|
|
2243
2202
|
//depends on RowSorting
|
|
2203
|
+
Mn,
|
|
2204
|
+
Nn,
|
|
2205
|
+
Vn,
|
|
2244
2206
|
Pn,
|
|
2245
|
-
|
|
2246
|
-
bn,
|
|
2247
|
-
En,
|
|
2248
|
-
In
|
|
2207
|
+
xn
|
|
2249
2208
|
];
|
|
2250
|
-
function
|
|
2209
|
+
function Gn(e) {
|
|
2251
2210
|
var o, t;
|
|
2252
2211
|
process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
|
|
2253
|
-
const n = [...
|
|
2212
|
+
const n = [...Hn, ...(o = e._features) != null ? o : []];
|
|
2254
2213
|
let r = {
|
|
2255
2214
|
_features: n
|
|
2256
2215
|
};
|
|
2257
|
-
const l = r._features.reduce((c,
|
|
2216
|
+
const l = r._features.reduce((c, i) => Object.assign(c, i.getDefaultOptions == null ? void 0 : i.getDefaultOptions(r)), {}), s = (c) => r.options.mergeOptions ? r.options.mergeOptions(l, c) : {
|
|
2258
2217
|
...l,
|
|
2259
2218
|
...c
|
|
2260
2219
|
};
|
|
2261
|
-
let
|
|
2220
|
+
let a = {
|
|
2262
2221
|
...{},
|
|
2263
2222
|
...(t = e.initialState) != null ? t : {}
|
|
2264
2223
|
};
|
|
2265
2224
|
r._features.forEach((c) => {
|
|
2266
|
-
var
|
|
2267
|
-
|
|
2225
|
+
var i;
|
|
2226
|
+
a = (i = c.getInitialState == null ? void 0 : c.getInitialState(a)) != null ? i : a;
|
|
2268
2227
|
});
|
|
2269
2228
|
const f = [];
|
|
2270
|
-
let
|
|
2271
|
-
const
|
|
2229
|
+
let g = !1;
|
|
2230
|
+
const p = {
|
|
2272
2231
|
_features: n,
|
|
2273
2232
|
options: {
|
|
2274
2233
|
...l,
|
|
2275
2234
|
...e
|
|
2276
2235
|
},
|
|
2277
|
-
initialState:
|
|
2236
|
+
initialState: a,
|
|
2278
2237
|
_queue: (c) => {
|
|
2279
|
-
f.push(c),
|
|
2238
|
+
f.push(c), g || (g = !0, Promise.resolve().then(() => {
|
|
2280
2239
|
for (; f.length; )
|
|
2281
2240
|
f.shift()();
|
|
2282
|
-
|
|
2283
|
-
}).catch((
|
|
2284
|
-
throw
|
|
2241
|
+
g = !1;
|
|
2242
|
+
}).catch((i) => setTimeout(() => {
|
|
2243
|
+
throw i;
|
|
2285
2244
|
})));
|
|
2286
2245
|
},
|
|
2287
2246
|
reset: () => {
|
|
2288
2247
|
r.setState(r.initialState);
|
|
2289
2248
|
},
|
|
2290
2249
|
setOptions: (c) => {
|
|
2291
|
-
const
|
|
2292
|
-
r.options = s(
|
|
2250
|
+
const i = Q(c, r.options);
|
|
2251
|
+
r.options = s(i);
|
|
2293
2252
|
},
|
|
2294
2253
|
getState: () => r.options.state,
|
|
2295
2254
|
setState: (c) => {
|
|
2296
2255
|
r.options.onStateChange == null || r.options.onStateChange(c);
|
|
2297
2256
|
},
|
|
2298
|
-
_getRowId: (c,
|
|
2299
|
-
var
|
|
2300
|
-
return (
|
|
2257
|
+
_getRowId: (c, i, m) => {
|
|
2258
|
+
var h;
|
|
2259
|
+
return (h = r.options.getRowId == null ? void 0 : r.options.getRowId(c, i, m)) != null ? h : `${m ? [m.id, i].join(".") : i}`;
|
|
2301
2260
|
},
|
|
2302
2261
|
getCoreRowModel: () => (r._getCoreRowModel || (r._getCoreRowModel = r.options.getCoreRowModel(r)), r._getCoreRowModel()),
|
|
2303
2262
|
// The final calls start at the bottom of the model,
|
|
2304
2263
|
// expanded rows, which then work their way up
|
|
2305
2264
|
getRowModel: () => r.getPaginationRowModel(),
|
|
2306
2265
|
//in next version, we should just pass in the row model as the optional 2nd arg
|
|
2307
|
-
getRow: (c,
|
|
2308
|
-
let m = (
|
|
2266
|
+
getRow: (c, i) => {
|
|
2267
|
+
let m = (i ? r.getPrePaginationRowModel() : r.getRowModel()).rowsById[c];
|
|
2309
2268
|
if (!m && (m = r.getCoreRowModel().rowsById[c], !m))
|
|
2310
2269
|
throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${c}`) : new Error();
|
|
2311
2270
|
return m;
|
|
2312
2271
|
},
|
|
2313
|
-
_getDefaultColumnDef:
|
|
2314
|
-
var
|
|
2315
|
-
return c = (
|
|
2272
|
+
_getDefaultColumnDef: y(() => [r.options.defaultColumn], (c) => {
|
|
2273
|
+
var i;
|
|
2274
|
+
return c = (i = c) != null ? i : {}, {
|
|
2316
2275
|
header: (m) => {
|
|
2317
|
-
const
|
|
2318
|
-
return
|
|
2276
|
+
const h = m.header.column.columnDef;
|
|
2277
|
+
return h.accessorKey ? h.accessorKey : h.accessorFn ? h.id : null;
|
|
2319
2278
|
},
|
|
2320
2279
|
// footer: props => props.header.column.id,
|
|
2321
2280
|
cell: (m) => {
|
|
2322
|
-
var
|
|
2323
|
-
return (
|
|
2281
|
+
var h, C;
|
|
2282
|
+
return (h = (C = m.renderValue()) == null || C.toString == null ? void 0 : C.toString()) != null ? h : null;
|
|
2324
2283
|
},
|
|
2325
|
-
...r._features.reduce((m,
|
|
2284
|
+
...r._features.reduce((m, h) => Object.assign(m, h.getDefaultColumnDef == null ? void 0 : h.getDefaultColumnDef()), {}),
|
|
2326
2285
|
...c
|
|
2327
2286
|
};
|
|
2328
2287
|
}, R(e, "debugColumns", "_getDefaultColumnDef")),
|
|
2329
2288
|
_getColumnDefs: () => r.options.columns,
|
|
2330
|
-
getAllColumns:
|
|
2331
|
-
const
|
|
2332
|
-
return C === void 0 && (C = 0), m.map((
|
|
2333
|
-
const
|
|
2334
|
-
return
|
|
2289
|
+
getAllColumns: y(() => [r._getColumnDefs()], (c) => {
|
|
2290
|
+
const i = function(m, h, C) {
|
|
2291
|
+
return C === void 0 && (C = 0), m.map((v) => {
|
|
2292
|
+
const S = rn(r, v, C, h), I = v;
|
|
2293
|
+
return S.columns = I.columns ? i(I.columns, S, C + 1) : [], S;
|
|
2335
2294
|
});
|
|
2336
2295
|
};
|
|
2337
|
-
return
|
|
2296
|
+
return i(c);
|
|
2338
2297
|
}, R(e, "debugColumns", "getAllColumns")),
|
|
2339
|
-
getAllFlatColumns:
|
|
2340
|
-
_getAllFlatColumnsById:
|
|
2341
|
-
getAllLeafColumns:
|
|
2342
|
-
let m = c.flatMap((
|
|
2343
|
-
return
|
|
2298
|
+
getAllFlatColumns: y(() => [r.getAllColumns()], (c) => c.flatMap((i) => i.getFlatColumns()), R(e, "debugColumns", "getAllFlatColumns")),
|
|
2299
|
+
_getAllFlatColumnsById: y(() => [r.getAllFlatColumns()], (c) => c.reduce((i, m) => (i[m.id] = m, i), {}), R(e, "debugColumns", "getAllFlatColumnsById")),
|
|
2300
|
+
getAllLeafColumns: y(() => [r.getAllColumns(), r._getOrderColumnsFn()], (c, i) => {
|
|
2301
|
+
let m = c.flatMap((h) => h.getLeafColumns());
|
|
2302
|
+
return i(m);
|
|
2344
2303
|
}, R(e, "debugColumns", "getAllLeafColumns")),
|
|
2345
2304
|
getColumn: (c) => {
|
|
2346
|
-
const
|
|
2347
|
-
return process.env.NODE_ENV !== "production" && !
|
|
2305
|
+
const i = r._getAllFlatColumnsById()[c];
|
|
2306
|
+
return process.env.NODE_ENV !== "production" && !i && console.error(`[Table] Column with id '${c}' does not exist.`), i;
|
|
2348
2307
|
}
|
|
2349
2308
|
};
|
|
2350
|
-
Object.assign(r,
|
|
2309
|
+
Object.assign(r, p);
|
|
2351
2310
|
for (let c = 0; c < r._features.length; c++) {
|
|
2352
|
-
const
|
|
2353
|
-
|
|
2311
|
+
const i = r._features[c];
|
|
2312
|
+
i == null || i.createTable == null || i.createTable(r);
|
|
2354
2313
|
}
|
|
2355
2314
|
return r;
|
|
2356
2315
|
}
|
|
2357
|
-
function
|
|
2358
|
-
return (e) =>
|
|
2316
|
+
function On() {
|
|
2317
|
+
return (e) => y(() => [e.options.data], (o) => {
|
|
2359
2318
|
const t = {
|
|
2360
2319
|
rows: [],
|
|
2361
2320
|
flatRows: [],
|
|
2362
2321
|
rowsById: {}
|
|
2363
2322
|
}, n = function(r, l, s) {
|
|
2364
2323
|
l === void 0 && (l = 0);
|
|
2365
|
-
const
|
|
2324
|
+
const u = [];
|
|
2366
2325
|
for (let f = 0; f < r.length; f++) {
|
|
2367
|
-
const
|
|
2368
|
-
if (t.flatRows.push(
|
|
2369
|
-
var
|
|
2370
|
-
|
|
2326
|
+
const g = Te(e, e._getRowId(r[f], f, s), r[f], f, l, void 0, s == null ? void 0 : s.id);
|
|
2327
|
+
if (t.flatRows.push(g), t.rowsById[g.id] = g, u.push(g), e.options.getSubRows) {
|
|
2328
|
+
var a;
|
|
2329
|
+
g.originalSubRows = e.options.getSubRows(r[f], f), (a = g.originalSubRows) != null && a.length && (g.subRows = n(g.originalSubRows, l + 1, g));
|
|
2371
2330
|
}
|
|
2372
2331
|
}
|
|
2373
|
-
return
|
|
2332
|
+
return u;
|
|
2374
2333
|
};
|
|
2375
2334
|
return t.rows = n(o), t;
|
|
2376
2335
|
}, R(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
|
|
2377
2336
|
}
|
|
2378
|
-
function
|
|
2337
|
+
function Tn(e) {
|
|
2379
2338
|
const o = [], t = (n) => {
|
|
2380
2339
|
var r;
|
|
2381
2340
|
o.push(n), (r = n.subRows) != null && r.length && n.getIsExpanded() && n.subRows.forEach(t);
|
|
@@ -2386,64 +2345,64 @@ function jn(e) {
|
|
|
2386
2345
|
rowsById: e.rowsById
|
|
2387
2346
|
};
|
|
2388
2347
|
}
|
|
2389
|
-
function
|
|
2390
|
-
return t.options.filterFromLeafRows ?
|
|
2348
|
+
function Bn(e, o, t) {
|
|
2349
|
+
return t.options.filterFromLeafRows ? Kn(e, o, t) : jn(e, o, t);
|
|
2391
2350
|
}
|
|
2392
|
-
function
|
|
2351
|
+
function Kn(e, o, t) {
|
|
2393
2352
|
var n;
|
|
2394
|
-
const r = [], l = {}, s = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100,
|
|
2353
|
+
const r = [], l = {}, s = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, u = function(a, f) {
|
|
2395
2354
|
f === void 0 && (f = 0);
|
|
2396
|
-
const
|
|
2397
|
-
for (let c = 0; c <
|
|
2398
|
-
var
|
|
2399
|
-
let
|
|
2400
|
-
const m =
|
|
2401
|
-
if (m.columnFilters =
|
|
2402
|
-
if (m.subRows = i
|
|
2403
|
-
|
|
2355
|
+
const g = [];
|
|
2356
|
+
for (let c = 0; c < a.length; c++) {
|
|
2357
|
+
var p;
|
|
2358
|
+
let i = a[c];
|
|
2359
|
+
const m = Te(t, i.id, i.original, i.index, i.depth, void 0, i.parentId);
|
|
2360
|
+
if (m.columnFilters = i.columnFilters, (p = i.subRows) != null && p.length && f < s) {
|
|
2361
|
+
if (m.subRows = u(i.subRows, f + 1), i = m, o(i) && !m.subRows.length) {
|
|
2362
|
+
g.push(i), l[i.id] = i, r.push(i);
|
|
2404
2363
|
continue;
|
|
2405
2364
|
}
|
|
2406
|
-
if (o(
|
|
2407
|
-
|
|
2365
|
+
if (o(i) || m.subRows.length) {
|
|
2366
|
+
g.push(i), l[i.id] = i, r.push(i);
|
|
2408
2367
|
continue;
|
|
2409
2368
|
}
|
|
2410
2369
|
} else
|
|
2411
|
-
|
|
2370
|
+
i = m, o(i) && (g.push(i), l[i.id] = i, r.push(i));
|
|
2412
2371
|
}
|
|
2413
|
-
return
|
|
2372
|
+
return g;
|
|
2414
2373
|
};
|
|
2415
2374
|
return {
|
|
2416
|
-
rows:
|
|
2375
|
+
rows: u(e),
|
|
2417
2376
|
flatRows: r,
|
|
2418
2377
|
rowsById: l
|
|
2419
2378
|
};
|
|
2420
2379
|
}
|
|
2421
|
-
function
|
|
2380
|
+
function jn(e, o, t) {
|
|
2422
2381
|
var n;
|
|
2423
|
-
const r = [], l = {}, s = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100,
|
|
2382
|
+
const r = [], l = {}, s = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, u = function(a, f) {
|
|
2424
2383
|
f === void 0 && (f = 0);
|
|
2425
|
-
const
|
|
2426
|
-
for (let c = 0; c <
|
|
2427
|
-
let
|
|
2428
|
-
if (o(
|
|
2429
|
-
var
|
|
2430
|
-
if ((
|
|
2431
|
-
const
|
|
2432
|
-
|
|
2384
|
+
const g = [];
|
|
2385
|
+
for (let c = 0; c < a.length; c++) {
|
|
2386
|
+
let i = a[c];
|
|
2387
|
+
if (o(i)) {
|
|
2388
|
+
var p;
|
|
2389
|
+
if ((p = i.subRows) != null && p.length && f < s) {
|
|
2390
|
+
const h = Te(t, i.id, i.original, i.index, i.depth, void 0, i.parentId);
|
|
2391
|
+
h.subRows = u(i.subRows, f + 1), i = h;
|
|
2433
2392
|
}
|
|
2434
|
-
|
|
2393
|
+
g.push(i), r.push(i), l[i.id] = i;
|
|
2435
2394
|
}
|
|
2436
2395
|
}
|
|
2437
|
-
return
|
|
2396
|
+
return g;
|
|
2438
2397
|
};
|
|
2439
2398
|
return {
|
|
2440
|
-
rows:
|
|
2399
|
+
rows: u(e),
|
|
2441
2400
|
flatRows: r,
|
|
2442
2401
|
rowsById: l
|
|
2443
2402
|
};
|
|
2444
2403
|
}
|
|
2445
|
-
function
|
|
2446
|
-
return (e) =>
|
|
2404
|
+
function qn() {
|
|
2405
|
+
return (e) => y(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
|
|
2447
2406
|
if (!o.rows.length || !(t != null && t.length) && !n) {
|
|
2448
2407
|
for (let c = 0; c < o.flatRows.length; c++)
|
|
2449
2408
|
o.flatRows[c].columnFilters = {}, o.flatRows[c].columnFiltersMeta = {};
|
|
@@ -2451,66 +2410,66 @@ function Zn() {
|
|
|
2451
2410
|
}
|
|
2452
2411
|
const r = [], l = [];
|
|
2453
2412
|
(t ?? []).forEach((c) => {
|
|
2454
|
-
var
|
|
2413
|
+
var i;
|
|
2455
2414
|
const m = e.getColumn(c.id);
|
|
2456
2415
|
if (!m)
|
|
2457
2416
|
return;
|
|
2458
|
-
const
|
|
2459
|
-
if (!
|
|
2417
|
+
const h = m.getFilterFn();
|
|
2418
|
+
if (!h) {
|
|
2460
2419
|
process.env.NODE_ENV !== "production" && console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${m.id}.`);
|
|
2461
2420
|
return;
|
|
2462
2421
|
}
|
|
2463
2422
|
r.push({
|
|
2464
2423
|
id: c.id,
|
|
2465
|
-
filterFn:
|
|
2466
|
-
resolvedValue: (
|
|
2424
|
+
filterFn: h,
|
|
2425
|
+
resolvedValue: (i = h.resolveFilterValue == null ? void 0 : h.resolveFilterValue(c.value)) != null ? i : c.value
|
|
2467
2426
|
});
|
|
2468
2427
|
});
|
|
2469
|
-
const s = (t ?? []).map((c) => c.id),
|
|
2470
|
-
n &&
|
|
2471
|
-
var
|
|
2428
|
+
const s = (t ?? []).map((c) => c.id), u = e.getGlobalFilterFn(), a = e.getAllLeafColumns().filter((c) => c.getCanGlobalFilter());
|
|
2429
|
+
n && u && a.length && (s.push("__global__"), a.forEach((c) => {
|
|
2430
|
+
var i;
|
|
2472
2431
|
l.push({
|
|
2473
2432
|
id: c.id,
|
|
2474
|
-
filterFn:
|
|
2475
|
-
resolvedValue: (
|
|
2433
|
+
filterFn: u,
|
|
2434
|
+
resolvedValue: (i = u.resolveFilterValue == null ? void 0 : u.resolveFilterValue(n)) != null ? i : n
|
|
2476
2435
|
});
|
|
2477
2436
|
}));
|
|
2478
|
-
let f,
|
|
2437
|
+
let f, g;
|
|
2479
2438
|
for (let c = 0; c < o.flatRows.length; c++) {
|
|
2480
|
-
const
|
|
2481
|
-
if (
|
|
2439
|
+
const i = o.flatRows[c];
|
|
2440
|
+
if (i.columnFilters = {}, r.length)
|
|
2482
2441
|
for (let m = 0; m < r.length; m++) {
|
|
2483
2442
|
f = r[m];
|
|
2484
|
-
const
|
|
2485
|
-
|
|
2486
|
-
|
|
2443
|
+
const h = f.id;
|
|
2444
|
+
i.columnFilters[h] = f.filterFn(i, h, f.resolvedValue, (C) => {
|
|
2445
|
+
i.columnFiltersMeta[h] = C;
|
|
2487
2446
|
});
|
|
2488
2447
|
}
|
|
2489
2448
|
if (l.length) {
|
|
2490
2449
|
for (let m = 0; m < l.length; m++) {
|
|
2491
|
-
|
|
2492
|
-
const
|
|
2493
|
-
if (
|
|
2494
|
-
|
|
2450
|
+
g = l[m];
|
|
2451
|
+
const h = g.id;
|
|
2452
|
+
if (g.filterFn(i, h, g.resolvedValue, (C) => {
|
|
2453
|
+
i.columnFiltersMeta[h] = C;
|
|
2495
2454
|
})) {
|
|
2496
|
-
|
|
2455
|
+
i.columnFilters.__global__ = !0;
|
|
2497
2456
|
break;
|
|
2498
2457
|
}
|
|
2499
2458
|
}
|
|
2500
|
-
|
|
2459
|
+
i.columnFilters.__global__ !== !0 && (i.columnFilters.__global__ = !1);
|
|
2501
2460
|
}
|
|
2502
2461
|
}
|
|
2503
|
-
const
|
|
2504
|
-
for (let
|
|
2505
|
-
if (c.columnFilters[s[
|
|
2462
|
+
const p = (c) => {
|
|
2463
|
+
for (let i = 0; i < s.length; i++)
|
|
2464
|
+
if (c.columnFilters[s[i]] === !1)
|
|
2506
2465
|
return !1;
|
|
2507
2466
|
return !0;
|
|
2508
2467
|
};
|
|
2509
|
-
return
|
|
2468
|
+
return Bn(o.rows, p, e);
|
|
2510
2469
|
}, R(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
|
|
2511
2470
|
}
|
|
2512
|
-
function
|
|
2513
|
-
return (o) =>
|
|
2471
|
+
function Un(e) {
|
|
2472
|
+
return (o) => y(() => [o.getState().pagination, o.getPrePaginationRowModel(), o.options.paginateExpandedRows ? void 0 : o.getState().expanded], (t, n) => {
|
|
2514
2473
|
if (!n.rows.length)
|
|
2515
2474
|
return n;
|
|
2516
2475
|
const {
|
|
@@ -2519,71 +2478,71 @@ function Wn(e) {
|
|
|
2519
2478
|
} = t;
|
|
2520
2479
|
let {
|
|
2521
2480
|
rows: s,
|
|
2522
|
-
flatRows:
|
|
2523
|
-
rowsById:
|
|
2481
|
+
flatRows: u,
|
|
2482
|
+
rowsById: a
|
|
2524
2483
|
} = n;
|
|
2525
|
-
const f = r * l,
|
|
2526
|
-
s = s.slice(f,
|
|
2527
|
-
let
|
|
2528
|
-
o.options.paginateExpandedRows ?
|
|
2484
|
+
const f = r * l, g = f + r;
|
|
2485
|
+
s = s.slice(f, g);
|
|
2486
|
+
let p;
|
|
2487
|
+
o.options.paginateExpandedRows ? p = {
|
|
2529
2488
|
rows: s,
|
|
2530
|
-
flatRows:
|
|
2531
|
-
rowsById:
|
|
2532
|
-
} :
|
|
2489
|
+
flatRows: u,
|
|
2490
|
+
rowsById: a
|
|
2491
|
+
} : p = Tn({
|
|
2533
2492
|
rows: s,
|
|
2534
|
-
flatRows:
|
|
2535
|
-
rowsById:
|
|
2536
|
-
}),
|
|
2537
|
-
const c = (
|
|
2538
|
-
|
|
2493
|
+
flatRows: u,
|
|
2494
|
+
rowsById: a
|
|
2495
|
+
}), p.flatRows = [];
|
|
2496
|
+
const c = (i) => {
|
|
2497
|
+
p.flatRows.push(i), i.subRows.length && i.subRows.forEach(c);
|
|
2539
2498
|
};
|
|
2540
|
-
return
|
|
2499
|
+
return p.rows.forEach(c), p;
|
|
2541
2500
|
}, R(o.options, "debugTable", "getPaginationRowModel"));
|
|
2542
2501
|
}
|
|
2543
|
-
function
|
|
2544
|
-
return (e) =>
|
|
2502
|
+
function Xn() {
|
|
2503
|
+
return (e) => y(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
|
|
2545
2504
|
if (!t.rows.length || !(o != null && o.length))
|
|
2546
2505
|
return t;
|
|
2547
|
-
const n = e.getState().sorting, r = [], l = n.filter((
|
|
2506
|
+
const n = e.getState().sorting, r = [], l = n.filter((a) => {
|
|
2548
2507
|
var f;
|
|
2549
|
-
return (f = e.getColumn(
|
|
2508
|
+
return (f = e.getColumn(a.id)) == null ? void 0 : f.getCanSort();
|
|
2550
2509
|
}), s = {};
|
|
2551
|
-
l.forEach((
|
|
2552
|
-
const f = e.getColumn(
|
|
2553
|
-
f && (s[
|
|
2510
|
+
l.forEach((a) => {
|
|
2511
|
+
const f = e.getColumn(a.id);
|
|
2512
|
+
f && (s[a.id] = {
|
|
2554
2513
|
sortUndefined: f.columnDef.sortUndefined,
|
|
2555
2514
|
invertSorting: f.columnDef.invertSorting,
|
|
2556
2515
|
sortingFn: f.getSortingFn()
|
|
2557
2516
|
});
|
|
2558
2517
|
});
|
|
2559
|
-
const
|
|
2560
|
-
const f =
|
|
2561
|
-
...
|
|
2518
|
+
const u = (a) => {
|
|
2519
|
+
const f = a.map((g) => ({
|
|
2520
|
+
...g
|
|
2562
2521
|
}));
|
|
2563
|
-
return f.sort((
|
|
2564
|
-
for (let
|
|
2522
|
+
return f.sort((g, p) => {
|
|
2523
|
+
for (let i = 0; i < l.length; i += 1) {
|
|
2565
2524
|
var c;
|
|
2566
|
-
const m = l[
|
|
2567
|
-
let
|
|
2525
|
+
const m = l[i], h = s[m.id], C = h.sortUndefined, v = (c = m == null ? void 0 : m.desc) != null ? c : !1;
|
|
2526
|
+
let S = 0;
|
|
2568
2527
|
if (C) {
|
|
2569
|
-
const
|
|
2570
|
-
if (
|
|
2571
|
-
if (C === "first") return
|
|
2572
|
-
if (C === "last") return
|
|
2573
|
-
|
|
2528
|
+
const I = g.getValue(m.id), F = p.getValue(m.id), M = I === void 0, P = F === void 0;
|
|
2529
|
+
if (M || P) {
|
|
2530
|
+
if (C === "first") return M ? -1 : 1;
|
|
2531
|
+
if (C === "last") return M ? 1 : -1;
|
|
2532
|
+
S = M && P ? 0 : M ? C : -C;
|
|
2574
2533
|
}
|
|
2575
2534
|
}
|
|
2576
|
-
if (
|
|
2577
|
-
return
|
|
2535
|
+
if (S === 0 && (S = h.sortingFn(g, p, m.id)), S !== 0)
|
|
2536
|
+
return v && (S *= -1), h.invertSorting && (S *= -1), S;
|
|
2578
2537
|
}
|
|
2579
|
-
return
|
|
2580
|
-
}), f.forEach((
|
|
2581
|
-
var
|
|
2582
|
-
r.push(
|
|
2538
|
+
return g.index - p.index;
|
|
2539
|
+
}), f.forEach((g) => {
|
|
2540
|
+
var p;
|
|
2541
|
+
r.push(g), (p = g.subRows) != null && p.length && (g.subRows = u(g.subRows));
|
|
2583
2542
|
}), f;
|
|
2584
2543
|
};
|
|
2585
2544
|
return {
|
|
2586
|
-
rows:
|
|
2545
|
+
rows: u(t.rows),
|
|
2587
2546
|
flatRows: r,
|
|
2588
2547
|
rowsById: t.rowsById
|
|
2589
2548
|
};
|
|
@@ -2599,22 +2558,22 @@ function Qn() {
|
|
|
2599
2558
|
*
|
|
2600
2559
|
* @license MIT
|
|
2601
2560
|
*/
|
|
2602
|
-
function
|
|
2603
|
-
return e ?
|
|
2561
|
+
function lt(e, o) {
|
|
2562
|
+
return e ? Zn(e) ? /* @__PURE__ */ be.createElement(e, o) : e : null;
|
|
2604
2563
|
}
|
|
2605
|
-
function
|
|
2606
|
-
return
|
|
2564
|
+
function Zn(e) {
|
|
2565
|
+
return Wn(e) || typeof e == "function" || Qn(e);
|
|
2607
2566
|
}
|
|
2608
|
-
function
|
|
2567
|
+
function Wn(e) {
|
|
2609
2568
|
return typeof e == "function" && (() => {
|
|
2610
2569
|
const o = Object.getPrototypeOf(e);
|
|
2611
2570
|
return o.prototype && o.prototype.isReactComponent;
|
|
2612
2571
|
})();
|
|
2613
2572
|
}
|
|
2614
|
-
function
|
|
2573
|
+
function Qn(e) {
|
|
2615
2574
|
return typeof e == "object" && typeof e.$$typeof == "symbol" && ["react.memo", "react.forward_ref"].includes(e.$$typeof.description);
|
|
2616
2575
|
}
|
|
2617
|
-
function
|
|
2576
|
+
function Yn(e) {
|
|
2618
2577
|
const o = {
|
|
2619
2578
|
state: {},
|
|
2620
2579
|
// Dummy state
|
|
@@ -2623,9 +2582,9 @@ function to(e) {
|
|
|
2623
2582
|
// noop
|
|
2624
2583
|
renderFallbackValue: null,
|
|
2625
2584
|
...e
|
|
2626
|
-
}, [t] =
|
|
2627
|
-
current:
|
|
2628
|
-
})), [n, r] =
|
|
2585
|
+
}, [t] = be.useState(() => ({
|
|
2586
|
+
current: Gn(o)
|
|
2587
|
+
})), [n, r] = be.useState(() => t.current.initialState);
|
|
2629
2588
|
return t.current.setOptions((l) => ({
|
|
2630
2589
|
...l,
|
|
2631
2590
|
...e,
|
|
@@ -2640,7 +2599,7 @@ function to(e) {
|
|
|
2640
2599
|
}
|
|
2641
2600
|
})), t.current;
|
|
2642
2601
|
}
|
|
2643
|
-
const
|
|
2602
|
+
const Jn = ({
|
|
2644
2603
|
editable: e = !0,
|
|
2645
2604
|
deletable: o = !0,
|
|
2646
2605
|
pageSize: t = 25,
|
|
@@ -2650,49 +2609,63 @@ const rt = ({
|
|
|
2650
2609
|
const {
|
|
2651
2610
|
rows: l,
|
|
2652
2611
|
schema: s,
|
|
2653
|
-
mappings:
|
|
2654
|
-
errorsByRow:
|
|
2612
|
+
mappings: u,
|
|
2613
|
+
errorsByRow: a,
|
|
2655
2614
|
editingCell: f,
|
|
2656
|
-
startEditing:
|
|
2657
|
-
stopEditing:
|
|
2615
|
+
startEditing: g,
|
|
2616
|
+
stopEditing: p,
|
|
2658
2617
|
updateCell: c,
|
|
2659
|
-
deleteRow:
|
|
2660
|
-
} =
|
|
2661
|
-
const
|
|
2618
|
+
deleteRow: i
|
|
2619
|
+
} = se(), [m, h] = T([]), [C, v] = T(""), [S, I] = T(""), [F, M] = T(null), [P] = T("onChange"), j = Ye(() => u.filter((x) => x.targetKey !== null).map((x) => {
|
|
2620
|
+
const _ = s == null ? void 0 : s.columns.find(($) => $.key === x.targetKey);
|
|
2662
2621
|
return {
|
|
2663
|
-
sourceColumn:
|
|
2664
|
-
targetKey:
|
|
2665
|
-
label: (
|
|
2666
|
-
type: (
|
|
2622
|
+
sourceColumn: x.sourceColumn,
|
|
2623
|
+
targetKey: x.targetKey,
|
|
2624
|
+
label: (_ == null ? void 0 : _.label) || x.targetKey,
|
|
2625
|
+
type: (_ == null ? void 0 : _.type) || "string"
|
|
2667
2626
|
};
|
|
2668
|
-
}), [
|
|
2669
|
-
(
|
|
2670
|
-
const
|
|
2671
|
-
return
|
|
2627
|
+
}), [u, s]), W = ye(
|
|
2628
|
+
(x, _) => {
|
|
2629
|
+
const $ = a.get(x);
|
|
2630
|
+
return $ == null ? void 0 : $.find((ee) => ee.columnKey === _);
|
|
2631
|
+
},
|
|
2632
|
+
[a]
|
|
2633
|
+
), ie = ye(
|
|
2634
|
+
(x, _) => {
|
|
2635
|
+
if (!s) return null;
|
|
2636
|
+
const $ = s.columns.find((ue) => ue.key === _);
|
|
2637
|
+
if (!$) return null;
|
|
2638
|
+
const b = it(x, $).find((ue) => ue.severity === "error");
|
|
2639
|
+
return b ? b.message : null;
|
|
2672
2640
|
},
|
|
2673
|
-
[
|
|
2674
|
-
),
|
|
2675
|
-
|
|
2676
|
-
},
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
},
|
|
2681
|
-
|
|
2682
|
-
},
|
|
2641
|
+
[s]
|
|
2642
|
+
), z = (x, _, $) => {
|
|
2643
|
+
I($), M(null), g(x, _);
|
|
2644
|
+
}, O = (x, _) => {
|
|
2645
|
+
I(x);
|
|
2646
|
+
const $ = ie(x, _);
|
|
2647
|
+
M($);
|
|
2648
|
+
}, ae = () => {
|
|
2649
|
+
F || (f && (c(f.rowIndex, f.columnKey, S), n == null || n(f.rowIndex, f.columnKey, S)), M(null), p());
|
|
2650
|
+
}, A = () => {
|
|
2651
|
+
I(""), M(null), p();
|
|
2652
|
+
}, pe = (x) => {
|
|
2653
|
+
i(x), r == null || r(x);
|
|
2654
|
+
}, ne = en(), oe = Ye(
|
|
2683
2655
|
() => [
|
|
2684
|
-
|
|
2656
|
+
ne.accessor("rowIndex", {
|
|
2685
2657
|
header: "#",
|
|
2686
2658
|
size: o ? 80 : 60,
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2659
|
+
enableResizing: !1,
|
|
2660
|
+
cell: (x) => {
|
|
2661
|
+
const _ = x.getValue();
|
|
2662
|
+
return /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
2663
|
+
/* @__PURE__ */ d("span", { className: "ff-font-mono ff-text-xs", style: { color: "var(--ff-text-muted)" }, children: _ + 1 }),
|
|
2691
2664
|
o && /* @__PURE__ */ d(
|
|
2692
2665
|
"button",
|
|
2693
2666
|
{
|
|
2694
|
-
onClick: (
|
|
2695
|
-
|
|
2667
|
+
onClick: ($) => {
|
|
2668
|
+
$.stopPropagation(), pe(_);
|
|
2696
2669
|
},
|
|
2697
2670
|
title: "Delete row",
|
|
2698
2671
|
style: {
|
|
@@ -2709,75 +2682,85 @@ const rt = ({
|
|
|
2709
2682
|
marginLeft: "2px",
|
|
2710
2683
|
flexShrink: 0
|
|
2711
2684
|
},
|
|
2712
|
-
onMouseEnter: (
|
|
2713
|
-
|
|
2685
|
+
onMouseEnter: ($) => {
|
|
2686
|
+
$.currentTarget.style.color = "#d43338", $.currentTarget.style.backgroundColor = "#fcdede";
|
|
2714
2687
|
},
|
|
2715
|
-
onMouseLeave: (
|
|
2716
|
-
|
|
2688
|
+
onMouseLeave: ($) => {
|
|
2689
|
+
$.currentTarget.style.color = "#8e8d89", $.currentTarget.style.backgroundColor = "transparent";
|
|
2717
2690
|
},
|
|
2718
|
-
children: /* @__PURE__ */ d(
|
|
2691
|
+
children: /* @__PURE__ */ d(Qt, { style: { width: "14px", height: "14px", display: "block" } })
|
|
2719
2692
|
}
|
|
2720
2693
|
)
|
|
2721
2694
|
] });
|
|
2722
2695
|
}
|
|
2723
2696
|
}),
|
|
2724
|
-
|
|
2725
|
-
(
|
|
2726
|
-
id:
|
|
2727
|
-
header:
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2697
|
+
...j.map(
|
|
2698
|
+
(x) => ne.accessor((_) => _.data[x.targetKey] || _.data[x.sourceColumn], {
|
|
2699
|
+
id: x.targetKey,
|
|
2700
|
+
header: x.label,
|
|
2701
|
+
size: 150,
|
|
2702
|
+
minSize: 80,
|
|
2703
|
+
cell: (_) => {
|
|
2704
|
+
const $ = _.row.original.rowIndex, ee = String(_.getValue() ?? ""), b = W($, x.targetKey);
|
|
2705
|
+
return (f == null ? void 0 : f.rowIndex) === $ && (f == null ? void 0 : f.columnKey) === x.targetKey ? /* @__PURE__ */ w("div", { className: "ff-min-w-[280px]", children: [
|
|
2706
|
+
/* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-gap-2", children: [
|
|
2707
|
+
/* @__PURE__ */ d(
|
|
2708
|
+
"input",
|
|
2709
|
+
{
|
|
2710
|
+
type: "text",
|
|
2711
|
+
value: S,
|
|
2712
|
+
onChange: (te) => O(te.target.value, x.targetKey),
|
|
2713
|
+
onKeyDown: (te) => {
|
|
2714
|
+
te.key === "Enter" && !F && ae(), te.key === "Escape" && A();
|
|
2715
|
+
},
|
|
2716
|
+
className: Z(
|
|
2717
|
+
"ff-input ff-py-2 ff-px-3 ff-text-sm ff-flex-1 ff-min-w-[160px]",
|
|
2718
|
+
F && "ff-input-error"
|
|
2719
|
+
),
|
|
2720
|
+
autoFocus: !0
|
|
2721
|
+
}
|
|
2722
|
+
),
|
|
2723
|
+
/* @__PURE__ */ d(
|
|
2724
|
+
"button",
|
|
2725
|
+
{
|
|
2726
|
+
onClick: ae,
|
|
2727
|
+
disabled: !!F,
|
|
2728
|
+
className: "ff-btn ff-btn-primary ff-btn-sm ff-flex-shrink-0",
|
|
2729
|
+
style: F ? { opacity: 0.5, cursor: "not-allowed" } : void 0,
|
|
2730
|
+
children: "Save"
|
|
2731
|
+
}
|
|
2732
|
+
),
|
|
2733
|
+
/* @__PURE__ */ d(
|
|
2734
|
+
"button",
|
|
2735
|
+
{
|
|
2736
|
+
onClick: A,
|
|
2737
|
+
className: "ff-btn ff-btn-secondary ff-btn-sm ff-flex-shrink-0",
|
|
2738
|
+
children: "Cancel"
|
|
2739
|
+
}
|
|
2740
|
+
)
|
|
2741
|
+
] }),
|
|
2742
|
+
F && /* @__PURE__ */ d("p", { className: "ff-text-xs ff-mt-1", style: { color: "var(--ff-error)" }, children: F })
|
|
2743
|
+
] }) : /* @__PURE__ */ w(
|
|
2761
2744
|
"div",
|
|
2762
2745
|
{
|
|
2763
|
-
className:
|
|
2746
|
+
className: Z(
|
|
2764
2747
|
"ff-group ff-flex ff-items-center ff-gap-2",
|
|
2765
|
-
(
|
|
2766
|
-
(
|
|
2748
|
+
(b == null ? void 0 : b.severity) === "error" && "ff-cell-error",
|
|
2749
|
+
(b == null ? void 0 : b.severity) === "warning" && "ff-cell-warning"
|
|
2767
2750
|
),
|
|
2768
2751
|
children: [
|
|
2769
|
-
/* @__PURE__ */ d("span", { className: "ff-flex-1 ff-truncate", children:
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
/* @__PURE__ */
|
|
2773
|
-
|
|
2774
|
-
|
|
2752
|
+
/* @__PURE__ */ d("span", { className: "ff-flex-1 ff-truncate", children: ee || /* @__PURE__ */ d("span", { style: { color: "var(--ff-text-muted)" }, children: "—" }) }),
|
|
2753
|
+
b && /* @__PURE__ */ w("div", { className: "ff-relative ff-group/tooltip", children: [
|
|
2754
|
+
b.severity === "error" ? /* @__PURE__ */ d(Oe, { className: "ff-w-4 ff-h-4", style: { color: "var(--ff-error)" } }) : /* @__PURE__ */ d(De, { className: "ff-w-4 ff-h-4", style: { color: "var(--ff-warning)" } }),
|
|
2755
|
+
/* @__PURE__ */ w("div", { className: "ff-tooltip ff-bottom-full ff-left-1/2 ff-transform ff--translate-x-1/2 ff-mb-2 ff-w-48 group-hover/tooltip:ff-tooltip-visible", children: [
|
|
2756
|
+
b.message,
|
|
2757
|
+
b.suggestion && /* @__PURE__ */ d("span", { className: "ff-block ff-mt-1", style: { color: "var(--ff-text-muted)" }, children: b.suggestion })
|
|
2775
2758
|
] })
|
|
2776
2759
|
] }),
|
|
2777
2760
|
e && /* @__PURE__ */ d(
|
|
2778
2761
|
"button",
|
|
2779
2762
|
{
|
|
2780
|
-
onClick: () =>
|
|
2763
|
+
onClick: () => z($, x.targetKey, ee),
|
|
2781
2764
|
className: "ff-opacity-0 group-hover:ff-opacity-100 ff-p-1 ff-rounded ff-transition-opacity ff-edit-btn",
|
|
2782
2765
|
children: /* @__PURE__ */ d(Zt, { className: "ff-w-3 ff-h-3" })
|
|
2783
2766
|
}
|
|
@@ -2788,118 +2771,138 @@ const rt = ({
|
|
|
2788
2771
|
}
|
|
2789
2772
|
})
|
|
2790
2773
|
)
|
|
2791
|
-
// Delete button is now in the # column (first column) so it's always visible
|
|
2792
|
-
// even when the table has many columns and requires horizontal scrolling.
|
|
2793
2774
|
],
|
|
2794
|
-
[
|
|
2795
|
-
),
|
|
2775
|
+
[j, f, S, F, e, o, W, ne]
|
|
2776
|
+
), E = Yn({
|
|
2796
2777
|
data: l,
|
|
2797
|
-
columns:
|
|
2778
|
+
columns: oe,
|
|
2779
|
+
columnResizeMode: P,
|
|
2780
|
+
enableColumnResizing: !0,
|
|
2798
2781
|
state: {
|
|
2799
2782
|
sorting: m,
|
|
2800
2783
|
globalFilter: C
|
|
2801
2784
|
},
|
|
2802
|
-
onSortingChange:
|
|
2803
|
-
onGlobalFilterChange:
|
|
2804
|
-
getCoreRowModel:
|
|
2805
|
-
getPaginationRowModel:
|
|
2806
|
-
getSortedRowModel:
|
|
2807
|
-
getFilteredRowModel:
|
|
2785
|
+
onSortingChange: h,
|
|
2786
|
+
onGlobalFilterChange: v,
|
|
2787
|
+
getCoreRowModel: On(),
|
|
2788
|
+
getPaginationRowModel: Un(),
|
|
2789
|
+
getSortedRowModel: Xn(),
|
|
2790
|
+
getFilteredRowModel: qn(),
|
|
2808
2791
|
initialState: {
|
|
2809
2792
|
pagination: {
|
|
2810
2793
|
pageSize: t
|
|
2811
2794
|
}
|
|
2812
2795
|
}
|
|
2813
2796
|
});
|
|
2814
|
-
return /* @__PURE__ */
|
|
2815
|
-
/* @__PURE__ */
|
|
2797
|
+
return /* @__PURE__ */ w("div", { className: "ff-space-y-4", children: [
|
|
2798
|
+
/* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-justify-between", children: [
|
|
2816
2799
|
/* @__PURE__ */ d(
|
|
2817
2800
|
"input",
|
|
2818
2801
|
{
|
|
2819
2802
|
type: "text",
|
|
2820
2803
|
value: C,
|
|
2821
|
-
onChange: (
|
|
2804
|
+
onChange: (x) => v(x.target.value),
|
|
2822
2805
|
placeholder: "Search all columns...",
|
|
2823
2806
|
className: "ff-input ff-max-w-xs"
|
|
2824
2807
|
}
|
|
2825
2808
|
),
|
|
2826
|
-
/* @__PURE__ */
|
|
2827
|
-
|
|
2809
|
+
/* @__PURE__ */ w("div", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
2810
|
+
E.getFilteredRowModel().rows.length,
|
|
2828
2811
|
" rows"
|
|
2829
2812
|
] })
|
|
2830
2813
|
] }),
|
|
2831
|
-
/* @__PURE__ */ d("div", { className: "ff-table-container ff-max-h-[500px]", children: /* @__PURE__ */
|
|
2832
|
-
/* @__PURE__ */ d("thead", { children:
|
|
2814
|
+
/* @__PURE__ */ d("div", { className: "ff-table-container ff-max-h-[500px]", children: /* @__PURE__ */ w("table", { className: "ff-table", style: { width: E.getCenterTotalSize() }, children: [
|
|
2815
|
+
/* @__PURE__ */ d("thead", { children: E.getHeaderGroups().map((x) => /* @__PURE__ */ d("tr", { children: x.headers.map((_) => /* @__PURE__ */ w(
|
|
2833
2816
|
"th",
|
|
2834
2817
|
{
|
|
2835
|
-
style: { width:
|
|
2836
|
-
onClick:
|
|
2837
|
-
className:
|
|
2838
|
-
|
|
2818
|
+
style: { width: _.getSize(), position: "relative" },
|
|
2819
|
+
onClick: _.column.getCanSort() ? _.column.getToggleSortingHandler() : void 0,
|
|
2820
|
+
className: Z(
|
|
2821
|
+
_.column.getCanSort() && "ff-cursor-pointer ff-select-none"
|
|
2839
2822
|
),
|
|
2840
|
-
children:
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2823
|
+
children: [
|
|
2824
|
+
/* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-gap-1", children: [
|
|
2825
|
+
lt(_.column.columnDef.header, _.getContext()),
|
|
2826
|
+
_.column.getIsSorted() && /* @__PURE__ */ d("span", { children: _.column.getIsSorted() === "asc" ? "↑" : "↓" })
|
|
2827
|
+
] }),
|
|
2828
|
+
_.column.getCanResize() && /* @__PURE__ */ d(
|
|
2829
|
+
"div",
|
|
2830
|
+
{
|
|
2831
|
+
onMouseDown: _.getResizeHandler(),
|
|
2832
|
+
onTouchStart: _.getResizeHandler(),
|
|
2833
|
+
className: "ff-resize-handle",
|
|
2834
|
+
style: {
|
|
2835
|
+
position: "absolute",
|
|
2836
|
+
right: 0,
|
|
2837
|
+
top: 0,
|
|
2838
|
+
height: "100%",
|
|
2839
|
+
width: "5px",
|
|
2840
|
+
cursor: "col-resize",
|
|
2841
|
+
userSelect: "none",
|
|
2842
|
+
touchAction: "none"
|
|
2843
|
+
}
|
|
2844
|
+
}
|
|
2845
|
+
)
|
|
2846
|
+
]
|
|
2844
2847
|
},
|
|
2845
|
-
|
|
2846
|
-
)) },
|
|
2847
|
-
/* @__PURE__ */ d("tbody", { children:
|
|
2848
|
-
const
|
|
2848
|
+
_.id
|
|
2849
|
+
)) }, x.id)) }),
|
|
2850
|
+
/* @__PURE__ */ d("tbody", { children: E.getRowModel().rows.map((x) => {
|
|
2851
|
+
const _ = a.has(x.original.rowIndex);
|
|
2849
2852
|
return /* @__PURE__ */ d(
|
|
2850
2853
|
"tr",
|
|
2851
2854
|
{
|
|
2852
|
-
className:
|
|
2853
|
-
children:
|
|
2855
|
+
className: Z(_ && "ff-row-error"),
|
|
2856
|
+
children: x.getVisibleCells().map(($) => /* @__PURE__ */ d("td", { style: { width: $.column.getSize() }, children: lt($.column.columnDef.cell, $.getContext()) }, $.id))
|
|
2854
2857
|
},
|
|
2855
|
-
|
|
2858
|
+
x.id
|
|
2856
2859
|
);
|
|
2857
2860
|
}) })
|
|
2858
2861
|
] }) }),
|
|
2859
|
-
/* @__PURE__ */
|
|
2860
|
-
/* @__PURE__ */
|
|
2862
|
+
/* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-justify-between ff-px-2", children: [
|
|
2863
|
+
/* @__PURE__ */ w("div", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
2861
2864
|
"Page ",
|
|
2862
|
-
|
|
2865
|
+
E.getState().pagination.pageIndex + 1,
|
|
2863
2866
|
" of ",
|
|
2864
|
-
|
|
2867
|
+
E.getPageCount()
|
|
2865
2868
|
] }),
|
|
2866
|
-
/* @__PURE__ */
|
|
2867
|
-
/* @__PURE__ */
|
|
2869
|
+
/* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-gap-2", children: [
|
|
2870
|
+
/* @__PURE__ */ w(
|
|
2868
2871
|
"button",
|
|
2869
2872
|
{
|
|
2870
|
-
onClick: () =>
|
|
2871
|
-
disabled: !
|
|
2873
|
+
onClick: () => E.previousPage(),
|
|
2874
|
+
disabled: !E.getCanPreviousPage(),
|
|
2872
2875
|
className: "ff-btn ff-btn-secondary ff-btn-sm",
|
|
2873
2876
|
children: [
|
|
2874
|
-
/* @__PURE__ */ d(
|
|
2877
|
+
/* @__PURE__ */ d(Ot, { className: "ff-w-4 ff-h-4" }),
|
|
2875
2878
|
"Previous"
|
|
2876
2879
|
]
|
|
2877
2880
|
}
|
|
2878
2881
|
),
|
|
2879
|
-
/* @__PURE__ */
|
|
2882
|
+
/* @__PURE__ */ w(
|
|
2880
2883
|
"button",
|
|
2881
2884
|
{
|
|
2882
|
-
onClick: () =>
|
|
2883
|
-
disabled: !
|
|
2885
|
+
onClick: () => E.nextPage(),
|
|
2886
|
+
disabled: !E.getCanNextPage(),
|
|
2884
2887
|
className: "ff-btn ff-btn-secondary ff-btn-sm",
|
|
2885
2888
|
children: [
|
|
2886
2889
|
"Next",
|
|
2887
|
-
/* @__PURE__ */ d(
|
|
2890
|
+
/* @__PURE__ */ d(Et, { className: "ff-w-4 ff-h-4" })
|
|
2888
2891
|
]
|
|
2889
2892
|
}
|
|
2890
2893
|
)
|
|
2891
2894
|
] })
|
|
2892
2895
|
] })
|
|
2893
2896
|
] });
|
|
2894
|
-
},
|
|
2897
|
+
}, eo = ({
|
|
2895
2898
|
showDetails: e = !0
|
|
2896
2899
|
}) => {
|
|
2897
|
-
const { validationResults: o } =
|
|
2900
|
+
const { validationResults: o } = se();
|
|
2898
2901
|
if (!o)
|
|
2899
2902
|
return null;
|
|
2900
|
-
const { isValid: t, totalRows: n, validRows: r, errorCount: l, warningCount: s, infoCount:
|
|
2901
|
-
return /* @__PURE__ */
|
|
2902
|
-
/* @__PURE__ */
|
|
2903
|
+
const { isValid: t, totalRows: n, validRows: r, errorCount: l, warningCount: s, infoCount: u, summary: a } = o, f = Math.round(r / n * 100);
|
|
2904
|
+
return /* @__PURE__ */ w("div", { className: "ff-space-y-4", children: [
|
|
2905
|
+
/* @__PURE__ */ w(
|
|
2903
2906
|
"div",
|
|
2904
2907
|
{
|
|
2905
2908
|
className: "ff-flex ff-items-center ff-gap-4 ff-p-4 ff-rounded-lg ff-border",
|
|
@@ -2908,8 +2911,8 @@ const rt = ({
|
|
|
2908
2911
|
borderColor: t ? "var(--ff-success)" : "var(--ff-error)"
|
|
2909
2912
|
},
|
|
2910
2913
|
children: [
|
|
2911
|
-
t ? /* @__PURE__ */ d(
|
|
2912
|
-
/* @__PURE__ */
|
|
2914
|
+
t ? /* @__PURE__ */ d(st, { className: "ff-w-8 ff-h-8", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ d(et, { className: "ff-w-8 ff-h-8", style: { color: "var(--ff-error)" } }),
|
|
2915
|
+
/* @__PURE__ */ w("div", { children: [
|
|
2913
2916
|
/* @__PURE__ */ d(
|
|
2914
2917
|
"h3",
|
|
2915
2918
|
{
|
|
@@ -2918,7 +2921,7 @@ const rt = ({
|
|
|
2918
2921
|
children: t ? "Validation Passed" : "Validation Failed"
|
|
2919
2922
|
}
|
|
2920
2923
|
),
|
|
2921
|
-
/* @__PURE__ */
|
|
2924
|
+
/* @__PURE__ */ w("p", { className: "ff-text-sm", style: { color: t ? "var(--ff-success)" : "var(--ff-error)" }, children: [
|
|
2922
2925
|
r,
|
|
2923
2926
|
" of ",
|
|
2924
2927
|
n,
|
|
@@ -2930,27 +2933,27 @@ const rt = ({
|
|
|
2930
2933
|
]
|
|
2931
2934
|
}
|
|
2932
2935
|
),
|
|
2933
|
-
/* @__PURE__ */
|
|
2934
|
-
/* @__PURE__ */
|
|
2936
|
+
/* @__PURE__ */ w("div", { className: "ff-grid ff-grid-cols-4 ff-gap-4", children: [
|
|
2937
|
+
/* @__PURE__ */ w("div", { className: "ff-border ff-rounded-lg ff-p-4 ff-text-center", style: { backgroundColor: "var(--ff-bg-primary)", borderColor: "var(--ff-border-light)" }, children: [
|
|
2935
2938
|
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-text-primary)" }, children: n }),
|
|
2936
2939
|
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: "Total Rows" })
|
|
2937
2940
|
] }),
|
|
2938
|
-
/* @__PURE__ */
|
|
2941
|
+
/* @__PURE__ */ w("div", { className: "ff-border ff-rounded-lg ff-p-4 ff-text-center", style: { backgroundColor: "var(--ff-success-light)", borderColor: "var(--ff-success)" }, children: [
|
|
2939
2942
|
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-success-dark)" }, children: r }),
|
|
2940
2943
|
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-success)" }, children: "Valid Rows" })
|
|
2941
2944
|
] }),
|
|
2942
|
-
/* @__PURE__ */
|
|
2945
|
+
/* @__PURE__ */ w("div", { className: "ff-border ff-rounded-lg ff-p-4 ff-text-center", style: { backgroundColor: "var(--ff-error-light)", borderColor: "var(--ff-error)" }, children: [
|
|
2943
2946
|
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-error-dark)" }, children: l }),
|
|
2944
2947
|
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-error)" }, children: "Errors" })
|
|
2945
2948
|
] }),
|
|
2946
|
-
/* @__PURE__ */
|
|
2949
|
+
/* @__PURE__ */ w("div", { className: "ff-border ff-rounded-lg ff-p-4 ff-text-center", style: { backgroundColor: "var(--ff-warning-light)", borderColor: "var(--ff-warning)" }, children: [
|
|
2947
2950
|
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-warning-dark)" }, children: s }),
|
|
2948
2951
|
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-warning)" }, children: "Warnings" })
|
|
2949
2952
|
] })
|
|
2950
2953
|
] }),
|
|
2951
|
-
e &&
|
|
2954
|
+
e && a.byColumn && Object.keys(a.byColumn).length > 0 && /* @__PURE__ */ w("div", { className: "ff-border ff-rounded-xl ff-overflow-hidden", style: { backgroundColor: "var(--ff-bg-primary)", borderColor: "var(--ff-border-light)" }, children: [
|
|
2952
2955
|
/* @__PURE__ */ d("div", { className: "ff-px-4 ff-py-3", style: { backgroundColor: "var(--ff-bg-secondary)" }, children: /* @__PURE__ */ d("h4", { className: "ff-font-medium ff-text-sm", style: { color: "var(--ff-text-secondary)" }, children: "Issues by Column" }) }),
|
|
2953
|
-
/* @__PURE__ */ d("div", { children: Object.entries(
|
|
2956
|
+
/* @__PURE__ */ d("div", { children: Object.entries(a.byColumn).filter(([, g]) => g.errorCount > 0 || g.warningCount > 0).map(([g, p], c, i) => /* @__PURE__ */ w(
|
|
2954
2957
|
"div",
|
|
2955
2958
|
{
|
|
2956
2959
|
className: "ff-flex ff-items-center ff-justify-between ff-px-4 ff-py-3",
|
|
@@ -2958,444 +2961,358 @@ const rt = ({
|
|
|
2958
2961
|
borderTop: c > 0 ? "1px solid var(--ff-border-light)" : void 0
|
|
2959
2962
|
},
|
|
2960
2963
|
children: [
|
|
2961
|
-
/* @__PURE__ */
|
|
2962
|
-
/* @__PURE__ */ d("p", { className: "ff-font-medium ff-text-sm", style: { color: "var(--ff-text-primary)" }, children:
|
|
2963
|
-
|
|
2964
|
+
/* @__PURE__ */ w("div", { className: "ff-flex-1 ff-min-w-0 ff-mr-4", children: [
|
|
2965
|
+
/* @__PURE__ */ d("p", { className: "ff-font-medium ff-text-sm", style: { color: "var(--ff-text-primary)" }, children: p.columnKey }),
|
|
2966
|
+
p.mostCommonError && /* @__PURE__ */ d("p", { className: "ff-text-sm ff-truncate", style: { color: "var(--ff-text-muted)" }, children: p.mostCommonError })
|
|
2964
2967
|
] }),
|
|
2965
|
-
/* @__PURE__ */
|
|
2966
|
-
|
|
2967
|
-
/* @__PURE__ */ d(
|
|
2968
|
-
|
|
2968
|
+
/* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-gap-2 ff-flex-shrink-0", children: [
|
|
2969
|
+
p.errorCount > 0 && /* @__PURE__ */ w("span", { className: "ff-badge ff-badge-error ff-whitespace-nowrap", children: [
|
|
2970
|
+
/* @__PURE__ */ d(et, { className: "ff-w-3 ff-h-3 ff-mr-1" }),
|
|
2971
|
+
p.errorCount,
|
|
2969
2972
|
" ",
|
|
2970
|
-
|
|
2973
|
+
p.errorCount === 1 ? "error" : "errors"
|
|
2971
2974
|
] }),
|
|
2972
|
-
|
|
2973
|
-
/* @__PURE__ */ d(
|
|
2974
|
-
|
|
2975
|
+
p.warningCount > 0 && /* @__PURE__ */ w("span", { className: "ff-badge ff-badge-warning ff-whitespace-nowrap", children: [
|
|
2976
|
+
/* @__PURE__ */ d(De, { className: "ff-w-3 ff-h-3 ff-mr-1" }),
|
|
2977
|
+
p.warningCount,
|
|
2975
2978
|
" ",
|
|
2976
|
-
|
|
2979
|
+
p.warningCount === 1 ? "warning" : "warnings"
|
|
2977
2980
|
] })
|
|
2978
2981
|
] })
|
|
2979
2982
|
]
|
|
2980
2983
|
},
|
|
2981
|
-
|
|
2984
|
+
g
|
|
2982
2985
|
)) })
|
|
2983
2986
|
] }),
|
|
2984
|
-
e &&
|
|
2985
|
-
/* @__PURE__ */ d(
|
|
2986
|
-
/* @__PURE__ */
|
|
2987
|
+
e && a.duplicates && a.duplicates.length > 0 && /* @__PURE__ */ d("div", { className: "ff-border ff-rounded-lg ff-p-4", style: { backgroundColor: "var(--ff-warning-light)", borderColor: "var(--ff-warning)" }, children: /* @__PURE__ */ w("div", { className: "ff-flex ff-items-start ff-gap-3", children: [
|
|
2988
|
+
/* @__PURE__ */ d(De, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
|
|
2989
|
+
/* @__PURE__ */ w("div", { children: [
|
|
2987
2990
|
/* @__PURE__ */ d("h4", { className: "ff-font-medium", style: { color: "var(--ff-warning-dark)" }, children: "Duplicate Values Found" }),
|
|
2988
|
-
/* @__PURE__ */
|
|
2989
|
-
|
|
2990
|
-
/* @__PURE__ */ d("span", { className: "ff-font-mono", children:
|
|
2991
|
+
/* @__PURE__ */ w("ul", { className: "ff-mt-2 ff-space-y-1 ff-text-sm", style: { color: "var(--ff-warning-dark)" }, children: [
|
|
2992
|
+
a.duplicates.slice(0, 5).map((g, p) => /* @__PURE__ */ w("li", { children: [
|
|
2993
|
+
/* @__PURE__ */ d("span", { className: "ff-font-mono", children: g.columnKey }),
|
|
2991
2994
|
': "',
|
|
2992
|
-
String(
|
|
2995
|
+
String(g.value),
|
|
2993
2996
|
'" appears',
|
|
2994
2997
|
" ",
|
|
2995
|
-
|
|
2998
|
+
g.rowIndices.length,
|
|
2996
2999
|
" times (rows",
|
|
2997
3000
|
" ",
|
|
2998
|
-
|
|
2999
|
-
|
|
3001
|
+
g.rowIndices.slice(0, 3).map((c) => c + 1).join(", "),
|
|
3002
|
+
g.rowIndices.length > 3 ? "..." : "",
|
|
3000
3003
|
")"
|
|
3001
|
-
] },
|
|
3002
|
-
|
|
3004
|
+
] }, p)),
|
|
3005
|
+
a.duplicates.length > 5 && /* @__PURE__ */ w("li", { style: { color: "var(--ff-warning)" }, children: [
|
|
3003
3006
|
"... and ",
|
|
3004
|
-
|
|
3007
|
+
a.duplicates.length - 5,
|
|
3005
3008
|
" more duplicate groups"
|
|
3006
3009
|
] })
|
|
3007
3010
|
] })
|
|
3008
3011
|
] })
|
|
3009
3012
|
] }) })
|
|
3010
3013
|
] });
|
|
3011
|
-
},
|
|
3012
|
-
{ key: "upload", label: "Upload", icon: st },
|
|
3013
|
-
{ key: "mapping", label: "Map Columns", icon: Ut },
|
|
3014
|
-
{ key: "validation", label: "Validate", icon: Qt },
|
|
3015
|
-
{ key: "review", label: "Review", icon: Ot },
|
|
3016
|
-
{ key: "complete", label: "Complete", icon: He }
|
|
3017
|
-
], io = ({
|
|
3014
|
+
}, Ee = ["upload", "mapping", "validation", "complete"], ro = ({
|
|
3018
3015
|
template: e,
|
|
3019
3016
|
schema: o,
|
|
3020
3017
|
mode: t = "modal",
|
|
3021
3018
|
theme: n,
|
|
3022
3019
|
useShadowDom: r = !1,
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3020
|
+
error: l,
|
|
3021
|
+
onComplete: s,
|
|
3022
|
+
onCancel: u,
|
|
3023
|
+
onError: a
|
|
3026
3024
|
}) => {
|
|
3027
3025
|
const {
|
|
3028
|
-
step:
|
|
3029
|
-
sessionId:
|
|
3026
|
+
step: f,
|
|
3027
|
+
sessionId: g,
|
|
3030
3028
|
file: p,
|
|
3031
|
-
rows:
|
|
3032
|
-
mappings:
|
|
3033
|
-
validationResults:
|
|
3034
|
-
isLoading:
|
|
3035
|
-
error:
|
|
3036
|
-
setSchema:
|
|
3037
|
-
setSessionId:
|
|
3038
|
-
setParsedData:
|
|
3039
|
-
setMappings:
|
|
3040
|
-
setUnmapped:
|
|
3041
|
-
setValidationResults:
|
|
3042
|
-
setStep:
|
|
3043
|
-
nextStep:
|
|
3044
|
-
previousStep:
|
|
3045
|
-
setLoading:
|
|
3046
|
-
setError:
|
|
3047
|
-
reset:
|
|
3048
|
-
} =
|
|
3049
|
-
|
|
3050
|
-
if (
|
|
3051
|
-
if (
|
|
3052
|
-
const
|
|
3053
|
-
|
|
3029
|
+
rows: c,
|
|
3030
|
+
mappings: i,
|
|
3031
|
+
validationResults: m,
|
|
3032
|
+
isLoading: h,
|
|
3033
|
+
error: C,
|
|
3034
|
+
setSchema: v,
|
|
3035
|
+
setSessionId: S,
|
|
3036
|
+
setParsedData: I,
|
|
3037
|
+
setMappings: F,
|
|
3038
|
+
setUnmapped: M,
|
|
3039
|
+
setValidationResults: P,
|
|
3040
|
+
setStep: j,
|
|
3041
|
+
nextStep: W,
|
|
3042
|
+
previousStep: ie,
|
|
3043
|
+
setLoading: z,
|
|
3044
|
+
setError: O,
|
|
3045
|
+
reset: ae
|
|
3046
|
+
} = se(), [A, pe] = T(null), [ne, oe] = T(null), [E, x] = T(0), [_, $] = T(""), [ee, b] = T(null), [ue, te] = T(null), [fe, qe] = T([]);
|
|
3047
|
+
Je(() => {
|
|
3048
|
+
if (oe(null), e)
|
|
3049
|
+
if (bt(e)) {
|
|
3050
|
+
const N = Dt(e);
|
|
3051
|
+
N ? pe(N) : (oe(`Failed to load template "${e}"`), a == null || a(new Error(`Failed to load template "${e}"`)));
|
|
3054
3052
|
} else {
|
|
3055
|
-
const
|
|
3056
|
-
|
|
3053
|
+
const N = `Template "${e}" not found. Available templates: ${tt.join(", ")}`;
|
|
3054
|
+
oe(N), a == null || a(new Error(N));
|
|
3057
3055
|
}
|
|
3058
3056
|
else if (o)
|
|
3059
|
-
|
|
3057
|
+
pe(o);
|
|
3060
3058
|
else {
|
|
3061
|
-
const
|
|
3062
|
-
|
|
3059
|
+
const N = `No template or schema provided. Please specify a template (${tt.join(", ")}) or provide a custom schema.`;
|
|
3060
|
+
oe(N), a == null || a(new Error(N));
|
|
3063
3061
|
}
|
|
3064
|
-
}, [e, o,
|
|
3065
|
-
|
|
3066
|
-
}, [
|
|
3067
|
-
const
|
|
3062
|
+
}, [e, o, a]), Je(() => {
|
|
3063
|
+
A && (v(A), Ue(A));
|
|
3064
|
+
}, [A]);
|
|
3065
|
+
const Ue = async (N) => {
|
|
3068
3066
|
try {
|
|
3069
|
-
|
|
3070
|
-
const
|
|
3071
|
-
|
|
3072
|
-
} catch (
|
|
3073
|
-
const
|
|
3074
|
-
|
|
3067
|
+
z(!0);
|
|
3068
|
+
const k = await de().createImportSession(N);
|
|
3069
|
+
S(k.sessionId);
|
|
3070
|
+
} catch (V) {
|
|
3071
|
+
const k = V;
|
|
3072
|
+
O(k.message), a == null || a(k);
|
|
3075
3073
|
} finally {
|
|
3076
|
-
|
|
3074
|
+
z(!1);
|
|
3077
3075
|
}
|
|
3078
|
-
},
|
|
3079
|
-
const
|
|
3080
|
-
let
|
|
3081
|
-
for (let
|
|
3082
|
-
const
|
|
3083
|
-
|
|
3076
|
+
}, vt = (N) => {
|
|
3077
|
+
const V = [];
|
|
3078
|
+
let k = "", H = !1;
|
|
3079
|
+
for (let q = 0; q < N.length; q++) {
|
|
3080
|
+
const L = N[q];
|
|
3081
|
+
L === '"' ? H && N[q + 1] === '"' ? (k += '"', q++) : H = !H : L === "," && !H ? (V.push(k.trim()), k = "") : k += L;
|
|
3084
3082
|
}
|
|
3085
|
-
return
|
|
3086
|
-
},
|
|
3087
|
-
if (
|
|
3083
|
+
return V.push(k.trim()), V;
|
|
3084
|
+
}, wt = ye(async (N) => {
|
|
3085
|
+
if (g)
|
|
3088
3086
|
try {
|
|
3089
|
-
|
|
3090
|
-
const
|
|
3091
|
-
|
|
3092
|
-
const
|
|
3093
|
-
|
|
3094
|
-
const
|
|
3095
|
-
`).filter((U) => U.trim()),
|
|
3096
|
-
const
|
|
3097
|
-
return
|
|
3098
|
-
|
|
3099
|
-
}), {
|
|
3100
|
-
rowIndex: oe,
|
|
3101
|
-
data: Ze,
|
|
3102
|
-
rawData: ie
|
|
3103
|
-
};
|
|
3087
|
+
z(!0), O(null), F([]), M([], []), P(null), x(10), $("Uploading file...");
|
|
3088
|
+
const V = de();
|
|
3089
|
+
x(20), $("Uploading to server...");
|
|
3090
|
+
const k = await V.uploadFile(g, N);
|
|
3091
|
+
x(40), $("Parsing all rows...");
|
|
3092
|
+
const q = (await N.text()).split(`
|
|
3093
|
+
`).filter((U) => U.trim()), L = k.data.headers, K = q.slice(1).map((U, me) => {
|
|
3094
|
+
const We = vt(U), Qe = {};
|
|
3095
|
+
return L.forEach(($t, Mt) => {
|
|
3096
|
+
Qe[$t] = We[Mt] || "";
|
|
3097
|
+
}), { rowIndex: me, data: Qe, rawData: We };
|
|
3104
3098
|
});
|
|
3105
|
-
|
|
3106
|
-
headers:
|
|
3107
|
-
rows:
|
|
3108
|
-
totalRows:
|
|
3109
|
-
sampleRows:
|
|
3110
|
-
}),
|
|
3111
|
-
} catch (
|
|
3112
|
-
|
|
3099
|
+
x(60), $("Processing rows..."), I({
|
|
3100
|
+
headers: L,
|
|
3101
|
+
rows: K,
|
|
3102
|
+
totalRows: K.length,
|
|
3103
|
+
sampleRows: K.slice(0, 5)
|
|
3104
|
+
}), x(80), $("Matching columns..."), j("mapping"), await Ct(), x(100), $("Done");
|
|
3105
|
+
} catch (V) {
|
|
3106
|
+
O(`Failed to process the uploaded file: ${V.message}`);
|
|
3113
3107
|
} finally {
|
|
3114
|
-
|
|
3108
|
+
z(!1), x(0), $("");
|
|
3115
3109
|
}
|
|
3116
|
-
}, [
|
|
3117
|
-
if (
|
|
3110
|
+
}, [g]), Ct = async () => {
|
|
3111
|
+
if (g)
|
|
3118
3112
|
try {
|
|
3119
|
-
|
|
3120
|
-
const
|
|
3121
|
-
|
|
3122
|
-
} catch (
|
|
3123
|
-
|
|
3113
|
+
z(!0);
|
|
3114
|
+
const V = await de().matchColumns(g);
|
|
3115
|
+
F(V.mappings), M(V.unmappedSource, V.unmappedTarget);
|
|
3116
|
+
} catch (N) {
|
|
3117
|
+
O(`Column matching failed: ${N.message}`);
|
|
3124
3118
|
} finally {
|
|
3125
|
-
|
|
3119
|
+
z(!1);
|
|
3126
3120
|
}
|
|
3127
|
-
},
|
|
3128
|
-
if (
|
|
3121
|
+
}, St = async () => {
|
|
3122
|
+
if (g)
|
|
3129
3123
|
try {
|
|
3130
|
-
|
|
3131
|
-
const
|
|
3132
|
-
|
|
3133
|
-
} catch (
|
|
3134
|
-
|
|
3124
|
+
z(!0), O(null);
|
|
3125
|
+
const V = await de().validateImport(g);
|
|
3126
|
+
P(V.validation), W();
|
|
3127
|
+
} catch (N) {
|
|
3128
|
+
O(`Validation failed: ${N.message}`);
|
|
3135
3129
|
} finally {
|
|
3136
|
-
|
|
3130
|
+
z(!1);
|
|
3137
3131
|
}
|
|
3138
|
-
},
|
|
3139
|
-
if (
|
|
3132
|
+
}, yt = async () => {
|
|
3133
|
+
if (g)
|
|
3140
3134
|
try {
|
|
3141
|
-
|
|
3142
|
-
const
|
|
3135
|
+
z(!0), O(null), b(null);
|
|
3136
|
+
const N = [...c];
|
|
3137
|
+
qe(N);
|
|
3138
|
+
const H = await de().completeImport(g, {
|
|
3143
3139
|
skipInvalidRows: !0,
|
|
3144
3140
|
acknowledgeWarnings: !0
|
|
3145
|
-
})
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
data: E.data,
|
|
3150
|
-
wasEdited: E.wasEdited ?? !1
|
|
3151
|
-
} : E)
|
|
3152
|
-
};
|
|
3153
|
-
qe(z), P("complete"), l == null || l(z);
|
|
3154
|
-
} catch (_) {
|
|
3155
|
-
de(_.message), P("complete");
|
|
3141
|
+
});
|
|
3142
|
+
te(H), j("complete"), s == null || s(H);
|
|
3143
|
+
} catch (N) {
|
|
3144
|
+
b(N.message), j("complete");
|
|
3156
3145
|
} finally {
|
|
3157
|
-
|
|
3146
|
+
z(!1);
|
|
3158
3147
|
}
|
|
3159
|
-
},
|
|
3160
|
-
|
|
3161
|
-
},
|
|
3162
|
-
|
|
3163
|
-
},
|
|
3164
|
-
switch (
|
|
3148
|
+
}, xe = () => {
|
|
3149
|
+
ae(), u == null || u();
|
|
3150
|
+
}, Rt = () => {
|
|
3151
|
+
b(null), te(null), qe([]), x(0), $(""), ae(), A && (v(A), Ue(A));
|
|
3152
|
+
}, re = () => Ee.indexOf(f), xt = () => {
|
|
3153
|
+
switch (f) {
|
|
3165
3154
|
case "upload":
|
|
3166
3155
|
return p !== null;
|
|
3167
3156
|
case "mapping":
|
|
3168
|
-
return
|
|
3157
|
+
return i.length > 0 && i.some((N) => N.targetKey !== null);
|
|
3169
3158
|
case "validation":
|
|
3170
|
-
return
|
|
3171
|
-
case "review":
|
|
3172
|
-
return a !== null && (a.isValid || a.errorCount === 0);
|
|
3159
|
+
return m !== null && m.errorCount === 0;
|
|
3173
3160
|
default:
|
|
3174
3161
|
return !1;
|
|
3175
3162
|
}
|
|
3176
|
-
},
|
|
3177
|
-
switch (
|
|
3163
|
+
}, _t = async () => {
|
|
3164
|
+
switch (f) {
|
|
3178
3165
|
case "mapping":
|
|
3179
|
-
await
|
|
3166
|
+
await St();
|
|
3180
3167
|
break;
|
|
3181
3168
|
case "validation":
|
|
3182
|
-
X();
|
|
3183
|
-
break;
|
|
3184
|
-
case "review":
|
|
3185
3169
|
await yt();
|
|
3186
3170
|
break;
|
|
3187
3171
|
default:
|
|
3188
|
-
|
|
3172
|
+
W();
|
|
3189
3173
|
}
|
|
3190
|
-
};
|
|
3191
|
-
if (
|
|
3192
|
-
return /* @__PURE__ */ d(
|
|
3193
|
-
/* @__PURE__ */ d("div", { className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4", style: { backgroundColor: "var(--ff-error-light)" }, children: /* @__PURE__ */ d(
|
|
3174
|
+
}, Ft = f === "upload" && h && E > 0 || f === "mapping" && h && E > 0;
|
|
3175
|
+
if (ne)
|
|
3176
|
+
return /* @__PURE__ */ d(_e, { theme: n, useShadowDom: r, children: /* @__PURE__ */ d("div", { className: "ff-container ff-bg-white ff-rounded-xl ff-shadow-xl ff-overflow-hidden ff-p-6", children: /* @__PURE__ */ w("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: [
|
|
3177
|
+
/* @__PURE__ */ d("div", { className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4", style: { backgroundColor: "var(--ff-error-light)" }, children: /* @__PURE__ */ d(Se, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-error)" } }) }),
|
|
3194
3178
|
/* @__PURE__ */ d("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Configuration Error" }),
|
|
3195
|
-
/* @__PURE__ */ d("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children:
|
|
3196
|
-
|
|
3179
|
+
/* @__PURE__ */ d("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children: ne }),
|
|
3180
|
+
u && /* @__PURE__ */ d("button", { onClick: xe, className: "ff-btn ff-btn-secondary", children: "Close" })
|
|
3197
3181
|
] }) }) });
|
|
3198
|
-
if (!
|
|
3199
|
-
return /* @__PURE__ */ d(
|
|
3200
|
-
/* @__PURE__ */ d(
|
|
3182
|
+
if (!A)
|
|
3183
|
+
return /* @__PURE__ */ d(_e, { theme: n, useShadowDom: r, children: /* @__PURE__ */ d("div", { className: "ff-container ff-bg-white ff-rounded-xl ff-shadow-xl ff-overflow-hidden ff-p-6", children: /* @__PURE__ */ w("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: [
|
|
3184
|
+
/* @__PURE__ */ d(he, { className: "ff-w-10 ff-h-10 ff-animate-spin ff-mb-4", style: { color: "var(--ff-primary-90)" } }),
|
|
3201
3185
|
/* @__PURE__ */ d("p", { style: { color: "var(--ff-text-muted)" }, children: "Loading template..." })
|
|
3202
3186
|
] }) }) });
|
|
3203
|
-
const
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
/* @__PURE__ */ h("div", { className: "ff-modal-header-left", children: [
|
|
3209
|
-
/* @__PURE__ */ h("div", { className: "ff-flex ff-items-center ff-gap-3", children: [
|
|
3210
|
-
/* @__PURE__ */ d("div", { className: "ff-modal-icon", children: /* @__PURE__ */ d(Bt, {}) }),
|
|
3187
|
+
const It = t === "embed" ? "ff-container ff-embed" : "ff-container ff-modal", Xe = l || ee, Ze = /* @__PURE__ */ d(le, { children: /* @__PURE__ */ w("div", { className: It, children: [
|
|
3188
|
+
/* @__PURE__ */ w("div", { className: "ff-modal-header", children: [
|
|
3189
|
+
/* @__PURE__ */ w("div", { className: "ff-modal-header-left", children: [
|
|
3190
|
+
/* @__PURE__ */ w("div", { className: "ff-flex ff-items-center ff-gap-3", children: [
|
|
3191
|
+
/* @__PURE__ */ d("div", { className: "ff-modal-icon", children: /* @__PURE__ */ d(jt, {}) }),
|
|
3211
3192
|
/* @__PURE__ */ d("h2", { className: "ff-modal-title", children: "Import Data" })
|
|
3212
3193
|
] }),
|
|
3213
|
-
/* @__PURE__ */ d("div", { className: "ff-steps ff-ml-4", children:
|
|
3214
|
-
/* @__PURE__ */ d(
|
|
3215
|
-
"
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
),
|
|
3223
|
-
children: se() > M ? "✓" : M + 1
|
|
3224
|
-
}
|
|
3225
|
-
),
|
|
3226
|
-
M < Me.length - 1 && /* @__PURE__ */ d("div", { className: J(
|
|
3227
|
-
"ff-step-connector",
|
|
3228
|
-
se() > M && "ff-step-connector-complete"
|
|
3229
|
-
) })
|
|
3230
|
-
] }, _)) })
|
|
3194
|
+
/* @__PURE__ */ d("div", { className: "ff-steps ff-ml-4", children: Ee.map((N, V) => /* @__PURE__ */ w(Nt.Fragment, { children: [
|
|
3195
|
+
/* @__PURE__ */ d("div", { className: Z(
|
|
3196
|
+
"ff-step",
|
|
3197
|
+
re() === V && "ff-step-active",
|
|
3198
|
+
re() > V && "ff-step-complete",
|
|
3199
|
+
re() < V && "ff-step-pending"
|
|
3200
|
+
), children: re() > V ? "✓" : V + 1 }),
|
|
3201
|
+
V < Ee.length - 1 && /* @__PURE__ */ d("div", { className: Z("ff-step-connector", re() > V && "ff-step-connector-complete") })
|
|
3202
|
+
] }, N)) })
|
|
3231
3203
|
] }),
|
|
3232
|
-
/* @__PURE__ */ d(
|
|
3233
|
-
"button",
|
|
3234
|
-
{
|
|
3235
|
-
onClick: ce,
|
|
3236
|
-
className: "ff-modal-close",
|
|
3237
|
-
children: /* @__PURE__ */ d(ve, { className: "ff-w-5 ff-h-5" })
|
|
3238
|
-
}
|
|
3239
|
-
)
|
|
3204
|
+
/* @__PURE__ */ d("button", { onClick: xe, className: "ff-modal-close", children: /* @__PURE__ */ d(Se, { className: "ff-w-5 ff-h-5" }) })
|
|
3240
3205
|
] }),
|
|
3241
|
-
/* @__PURE__ */
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
/* @__PURE__ */ d(
|
|
3245
|
-
/* @__PURE__ */ d("p", { className: "ff-font-medium ff-mb-2", style: { color: "var(--ff-text-primary)" }, children:
|
|
3246
|
-
/* @__PURE__ */ d("div", { className: "ff-progress ff-w-full ff-max-w-xs ff-mx-auto ff-mb-2", children: /* @__PURE__ */ d(
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
className: "ff-progress-bar",
|
|
3250
|
-
style: { width: `${K}%`, transition: "width 0.3s ease" }
|
|
3251
|
-
}
|
|
3252
|
-
) }),
|
|
3253
|
-
/* @__PURE__ */ h("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
3254
|
-
K,
|
|
3206
|
+
/* @__PURE__ */ w("div", { className: "ff-modal-body", children: [
|
|
3207
|
+
C && /* @__PURE__ */ d("div", { className: "ff-mb-4 ff-p-4 ff-border ff-rounded-lg ff-text-sm", style: { backgroundColor: "var(--ff-error-light)", borderColor: "var(--ff-error)", color: "var(--ff-error)" }, children: C }),
|
|
3208
|
+
f === "upload" && /* @__PURE__ */ d("div", { className: "ff-py-4", children: /* @__PURE__ */ d("div", { className: "ff-max-w-xl ff-mx-auto", children: h && E > 0 ? /* @__PURE__ */ w("div", { className: "ff-p-8 ff-text-center", children: [
|
|
3209
|
+
/* @__PURE__ */ d(he, { className: "ff-w-10 ff-h-10 ff-animate-spin ff-mx-auto ff-mb-4", style: { color: "var(--ff-primary-90)" } }),
|
|
3210
|
+
/* @__PURE__ */ d("p", { className: "ff-font-medium ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: _ }),
|
|
3211
|
+
/* @__PURE__ */ d("div", { className: "ff-progress ff-w-full ff-max-w-xs ff-mx-auto ff-mb-2", children: /* @__PURE__ */ d("div", { className: "ff-progress-bar", style: { width: `${E}%`, transition: "width 0.3s ease" } }) }),
|
|
3212
|
+
/* @__PURE__ */ w("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
3213
|
+
E,
|
|
3255
3214
|
"% complete"
|
|
3256
3215
|
] })
|
|
3257
|
-
] }) : /* @__PURE__ */ d(
|
|
3258
|
-
|
|
3259
|
-
/* @__PURE__ */ d(
|
|
3260
|
-
/* @__PURE__ */ d("p", { className: "ff-font-medium ff-mb-3", style: { color: "var(--ff-text-primary)" }, children:
|
|
3261
|
-
/* @__PURE__ */ d("div", { className: "ff-progress ff-w-full ff-max-w-xs ff-mx-auto ff-mb-2", children: /* @__PURE__ */ d(
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
className: "ff-progress-bar",
|
|
3265
|
-
style: { width: `${K}%`, transition: "width 0.3s ease" }
|
|
3266
|
-
}
|
|
3267
|
-
) }),
|
|
3268
|
-
/* @__PURE__ */ h("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
3269
|
-
K,
|
|
3216
|
+
] }) : /* @__PURE__ */ d(Yt, { onFileSelect: wt }) }) }),
|
|
3217
|
+
f === "mapping" && (h && E > 0 ? /* @__PURE__ */ w("div", { className: "ff-py-12 ff-text-center", children: [
|
|
3218
|
+
/* @__PURE__ */ d(he, { className: "ff-w-10 ff-h-10 ff-animate-spin ff-mx-auto ff-mb-4", style: { color: "var(--ff-primary-90)" } }),
|
|
3219
|
+
/* @__PURE__ */ d("p", { className: "ff-font-medium ff-mb-3", style: { color: "var(--ff-text-primary)" }, children: _ }),
|
|
3220
|
+
/* @__PURE__ */ d("div", { className: "ff-progress ff-w-full ff-max-w-xs ff-mx-auto ff-mb-2", children: /* @__PURE__ */ d("div", { className: "ff-progress-bar", style: { width: `${E}%`, transition: "width 0.3s ease" } }) }),
|
|
3221
|
+
/* @__PURE__ */ w("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
3222
|
+
E,
|
|
3270
3223
|
"% complete"
|
|
3271
3224
|
] })
|
|
3272
|
-
] }) : /* @__PURE__ */ d(
|
|
3273
|
-
|
|
3274
|
-
/* @__PURE__ */ d(
|
|
3275
|
-
/* @__PURE__ */ d(
|
|
3276
|
-
] }),
|
|
3277
|
-
u === "review" && /* @__PURE__ */ h("div", { className: "ff-space-y-6", children: [
|
|
3278
|
-
/* @__PURE__ */ d(lt, { showDetails: !1 }),
|
|
3279
|
-
/* @__PURE__ */ d(rt, { editable: !1, pageSize: 10 })
|
|
3225
|
+
] }) : /* @__PURE__ */ d(Jt, {})),
|
|
3226
|
+
f === "validation" && /* @__PURE__ */ w("div", { className: "ff-space-y-6", children: [
|
|
3227
|
+
/* @__PURE__ */ d(eo, {}),
|
|
3228
|
+
/* @__PURE__ */ d(Jn, { editable: !0 })
|
|
3280
3229
|
] }),
|
|
3281
|
-
|
|
3282
|
-
/* @__PURE__ */ d("div", { className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4", style: { backgroundColor: "var(--ff-error-light)" }, children: /* @__PURE__ */ d(
|
|
3230
|
+
f === "complete" && /* @__PURE__ */ d("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: Xe ? /* @__PURE__ */ w(le, { children: [
|
|
3231
|
+
/* @__PURE__ */ d("div", { className: "ff-w-16 ff-h-16 ff-rounded-full ff-flex ff-items-center ff-justify-center ff-mb-4", style: { backgroundColor: "var(--ff-error-light)" }, children: /* @__PURE__ */ d(Se, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-error)" } }) }),
|
|
3283
3232
|
/* @__PURE__ */ d("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Import Failed" }),
|
|
3284
|
-
/* @__PURE__ */ d("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children:
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
"button",
|
|
3288
|
-
{
|
|
3289
|
-
onClick: () => {
|
|
3290
|
-
de(null), P("review");
|
|
3291
|
-
},
|
|
3292
|
-
className: "ff-btn ff-btn-secondary",
|
|
3293
|
-
children: "Back to Review"
|
|
3294
|
-
}
|
|
3295
|
-
),
|
|
3296
|
-
s && /* @__PURE__ */ d("button", { onClick: ce, className: "ff-btn ff-btn-secondary", children: "Close" })
|
|
3297
|
-
] })
|
|
3298
|
-
] }) : /* @__PURE__ */ h(re, { children: [
|
|
3299
|
-
/* @__PURE__ */ d("div", { className: "ff-w-20 ff-h-20 ff-rounded-2xl ff-flex ff-items-center ff-justify-center ff-mb-6", style: { backgroundColor: "var(--ff-success-light)" }, children: /* @__PURE__ */ d(He, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-success)" } }) }),
|
|
3233
|
+
/* @__PURE__ */ d("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children: Xe })
|
|
3234
|
+
] }) : /* @__PURE__ */ w(le, { children: [
|
|
3235
|
+
/* @__PURE__ */ d("div", { className: "ff-w-20 ff-h-20 ff-rounded-2xl ff-flex ff-items-center ff-justify-center ff-mb-6", style: { backgroundColor: "var(--ff-success-light)" }, children: /* @__PURE__ */ d(st, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-success)" } }) }),
|
|
3300
3236
|
/* @__PURE__ */ d("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Import Complete!" }),
|
|
3301
3237
|
/* @__PURE__ */ d("p", { className: "ff-mb-6", style: { color: "var(--ff-text-muted)" }, children: "Your data has been successfully imported." }),
|
|
3302
|
-
|
|
3303
|
-
/* @__PURE__ */
|
|
3304
|
-
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-
|
|
3305
|
-
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-
|
|
3238
|
+
/* @__PURE__ */ w("div", { className: "ff-flex ff-gap-6 ff-mb-6", children: [
|
|
3239
|
+
/* @__PURE__ */ w("div", { className: "ff-text-center ff-px-6 ff-py-3 ff-rounded-xl ff-border", style: { borderColor: "var(--ff-success)", backgroundColor: "var(--ff-success-light)" }, children: [
|
|
3240
|
+
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-success-dark)" }, children: fe.length }),
|
|
3241
|
+
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-success)" }, children: "Rows Imported" })
|
|
3306
3242
|
] }),
|
|
3307
|
-
/* @__PURE__ */
|
|
3308
|
-
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-
|
|
3309
|
-
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-success)" }, children: "Imported" })
|
|
3310
|
-
] }),
|
|
3311
|
-
O.skippedRows > 0 && /* @__PURE__ */ h("div", { className: "ff-text-center ff-px-6 ff-py-3 ff-rounded-xl ff-border", style: { borderColor: "var(--ff-warning)", backgroundColor: "var(--ff-warning-light)" }, children: [
|
|
3312
|
-
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-warning-dark)" }, children: O.skippedRows }),
|
|
3313
|
-
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-warning)" }, children: "Skipped" })
|
|
3314
|
-
] }),
|
|
3315
|
-
/* @__PURE__ */ h("div", { className: "ff-text-center ff-px-6 ff-py-3 ff-rounded-xl ff-border", style: { borderColor: "var(--ff-border-light)", backgroundColor: "var(--ff-bg-primary)" }, children: [
|
|
3316
|
-
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-text-primary)" }, children: c.filter((_) => _.targetKey !== null).length }),
|
|
3243
|
+
/* @__PURE__ */ w("div", { className: "ff-text-center ff-px-6 ff-py-3 ff-rounded-xl ff-border", style: { borderColor: "var(--ff-border-light)", backgroundColor: "var(--ff-bg-primary)" }, children: [
|
|
3244
|
+
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-text-primary)" }, children: i.filter((N) => N.targetKey !== null).length }),
|
|
3317
3245
|
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: "Columns Mapped" })
|
|
3318
3246
|
] })
|
|
3319
3247
|
] }),
|
|
3320
|
-
|
|
3321
|
-
const
|
|
3322
|
-
return
|
|
3248
|
+
fe.length > 0 && (() => {
|
|
3249
|
+
const N = fe.slice(0, 5), V = N[0], k = (V == null ? void 0 : V.data) || V, H = Object.keys(typeof k == "object" ? k : {}).slice(0, 6), q = (A == null ? void 0 : A.columns) || [];
|
|
3250
|
+
return H.length === 0 ? null : /* @__PURE__ */ w("div", { className: "ff-w-full ff-mb-6", children: [
|
|
3323
3251
|
/* @__PURE__ */ d("p", { className: "ff-text-xs ff-font-semibold ff-uppercase ff-tracking-wider ff-mb-2", style: { color: "var(--ff-text-muted)" }, children: "Imported Data Preview" }),
|
|
3324
|
-
/* @__PURE__ */ d("div", { className: "ff-table-container ff-max-h-[250px]", children: /* @__PURE__ */
|
|
3325
|
-
/* @__PURE__ */ d("thead", { children: /* @__PURE__ */
|
|
3252
|
+
/* @__PURE__ */ d("div", { className: "ff-table-container ff-max-h-[250px]", children: /* @__PURE__ */ w("table", { className: "ff-table", children: [
|
|
3253
|
+
/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ w("tr", { children: [
|
|
3326
3254
|
/* @__PURE__ */ d("th", { style: { width: 40 }, children: "#" }),
|
|
3327
|
-
|
|
3328
|
-
const
|
|
3329
|
-
return /* @__PURE__ */ d("th", { children: (
|
|
3255
|
+
H.map((L) => {
|
|
3256
|
+
const K = q.find((U) => U.key === L);
|
|
3257
|
+
return /* @__PURE__ */ d("th", { children: (K == null ? void 0 : K.label) || L }, L);
|
|
3330
3258
|
}),
|
|
3331
|
-
|
|
3259
|
+
H.length < Object.keys(typeof k == "object" ? k : {}).length && /* @__PURE__ */ d("th", { children: "..." })
|
|
3332
3260
|
] }) }),
|
|
3333
|
-
/* @__PURE__ */ d("tbody", { children:
|
|
3334
|
-
const
|
|
3335
|
-
return /* @__PURE__ */
|
|
3336
|
-
/* @__PURE__ */ d("td", { children: /* @__PURE__ */ d("span", { className: "ff-font-mono ff-text-xs", style: { color: "var(--ff-text-muted)" }, children:
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
] },
|
|
3261
|
+
/* @__PURE__ */ d("tbody", { children: N.map((L, K) => {
|
|
3262
|
+
const U = (L == null ? void 0 : L.data) || L;
|
|
3263
|
+
return /* @__PURE__ */ w("tr", { children: [
|
|
3264
|
+
/* @__PURE__ */ d("td", { children: /* @__PURE__ */ d("span", { className: "ff-font-mono ff-text-xs", style: { color: "var(--ff-text-muted)" }, children: K + 1 }) }),
|
|
3265
|
+
H.map((me) => /* @__PURE__ */ d("td", { children: /* @__PURE__ */ d("span", { className: "ff-text-sm ff-truncate ff-block ff-max-w-[150px]", children: String((U == null ? void 0 : U[me]) ?? "—") }) }, me)),
|
|
3266
|
+
H.length < Object.keys(typeof k == "object" ? k : {}).length && /* @__PURE__ */ d("td", { children: /* @__PURE__ */ d("span", { style: { color: "var(--ff-text-muted)" }, children: "..." }) })
|
|
3267
|
+
] }, K);
|
|
3340
3268
|
}) })
|
|
3341
3269
|
] }) }),
|
|
3342
|
-
|
|
3270
|
+
fe.length > 5 && /* @__PURE__ */ w("p", { className: "ff-text-xs ff-mt-1", style: { color: "var(--ff-text-muted)" }, children: [
|
|
3343
3271
|
"Showing ",
|
|
3344
|
-
|
|
3272
|
+
N.length,
|
|
3345
3273
|
" of ",
|
|
3346
|
-
|
|
3274
|
+
fe.length,
|
|
3347
3275
|
" imported rows"
|
|
3348
3276
|
] })
|
|
3349
3277
|
] });
|
|
3350
|
-
})()
|
|
3351
|
-
/* @__PURE__ */ h("div", { className: "ff-flex ff-gap-3", children: [
|
|
3352
|
-
/* @__PURE__ */ d(
|
|
3353
|
-
"button",
|
|
3354
|
-
{
|
|
3355
|
-
onClick: Ue,
|
|
3356
|
-
className: "ff-btn ff-btn-primary",
|
|
3357
|
-
children: "Start New Import"
|
|
3358
|
-
}
|
|
3359
|
-
),
|
|
3360
|
-
s && /* @__PURE__ */ d("button", { onClick: ce, className: "ff-btn ff-btn-secondary", children: "Close" })
|
|
3361
|
-
] })
|
|
3278
|
+
})()
|
|
3362
3279
|
] }) })
|
|
3363
3280
|
] }),
|
|
3364
|
-
/* @__PURE__ */ d("div", { className: "ff-modal-footer", children:
|
|
3365
|
-
/* @__PURE__ */ d("div", {}),
|
|
3366
|
-
/* @__PURE__ */ d("button", { onClick:
|
|
3367
|
-
] }) : /* @__PURE__ */
|
|
3281
|
+
/* @__PURE__ */ d("div", { className: "ff-modal-footer", children: f === "complete" ? /* @__PURE__ */ w(le, { children: [
|
|
3282
|
+
u ? /* @__PURE__ */ d("button", { onClick: xe, className: "ff-btn ff-btn-ghost", children: "Close" }) : /* @__PURE__ */ d("div", {}),
|
|
3283
|
+
/* @__PURE__ */ d("button", { onClick: Rt, className: "ff-btn ff-btn-primary", children: "Start New Import" })
|
|
3284
|
+
] }) : /* @__PURE__ */ w(le, { children: [
|
|
3368
3285
|
/* @__PURE__ */ d(
|
|
3369
3286
|
"button",
|
|
3370
3287
|
{
|
|
3371
|
-
onClick:
|
|
3372
|
-
disabled:
|
|
3288
|
+
onClick: ie,
|
|
3289
|
+
disabled: re() === 0 || h,
|
|
3373
3290
|
className: "ff-btn ff-btn-ghost",
|
|
3374
3291
|
children: "Back"
|
|
3375
3292
|
}
|
|
3376
3293
|
),
|
|
3377
|
-
/* @__PURE__ */ d(
|
|
3294
|
+
!Ft && /* @__PURE__ */ d(
|
|
3378
3295
|
"button",
|
|
3379
3296
|
{
|
|
3380
|
-
onClick:
|
|
3381
|
-
disabled: !
|
|
3297
|
+
onClick: _t,
|
|
3298
|
+
disabled: !xt() || h,
|
|
3382
3299
|
className: "ff-btn ff-btn-primary",
|
|
3383
|
-
children:
|
|
3384
|
-
/* @__PURE__ */ d(
|
|
3385
|
-
"Processing..."
|
|
3386
|
-
] }) :
|
|
3300
|
+
children: h ? /* @__PURE__ */ w(le, { children: [
|
|
3301
|
+
/* @__PURE__ */ d(he, { className: "ff-w-4 ff-h-4 ff-animate-spin" }),
|
|
3302
|
+
" Processing..."
|
|
3303
|
+
] }) : f === "validation" ? m && m.errorCount > 0 ? `Fix ${m.errorCount} error${m.errorCount > 1 ? "s" : ""} to continue` : "Complete Import" : "Continue"
|
|
3387
3304
|
}
|
|
3388
3305
|
)
|
|
3389
3306
|
] }) })
|
|
3390
3307
|
] }) });
|
|
3391
|
-
return /* @__PURE__ */ d(
|
|
3308
|
+
return /* @__PURE__ */ d(_e, { theme: n, useShadowDom: r, children: t === "modal" ? /* @__PURE__ */ d("div", { className: "ff-overlay", children: Ze }) : /* @__PURE__ */ d("div", { className: "ff-embed-resizable", children: Ze }) });
|
|
3392
3309
|
};
|
|
3393
3310
|
export {
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3311
|
+
Jt as C,
|
|
3312
|
+
Jn as D,
|
|
3313
|
+
Yt as F,
|
|
3314
|
+
ro as I,
|
|
3315
|
+
eo as V,
|
|
3316
|
+
se as u
|
|
3400
3317
|
};
|
|
3401
|
-
//# sourceMappingURL=ImportWizard-
|
|
3318
|
+
//# sourceMappingURL=ImportWizard-C7vsPfrT.mjs.map
|