@fileflow/sdk 0.1.27 → 0.1.29
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-Cg2yM2zN.mjs → ImportWizard-Cux3nYN4.mjs} +526 -527
- package/dist/{ImportWizard-Cg2yM2zN.mjs.map → ImportWizard-Cux3nYN4.mjs.map} +1 -1
- package/dist/{ImportWizard-Blk6OIRr.js → ImportWizard-lxWu3Ydd.js} +17 -17
- package/dist/{ImportWizard-Blk6OIRr.js.map → ImportWizard-lxWu3Ydd.js.map} +1 -1
- package/dist/import.js +1 -1
- package/dist/import.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
import { jsx as d, jsxs as h, Fragment as re } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { h as q, j as
|
|
2
|
+
import * as Ve from "react";
|
|
3
|
+
import It, { useCallback as ze, useState as W, useMemo as We, useEffect as Qe } from "react";
|
|
4
|
+
import { h as q, j as $t, k as Nt, X as ve, m as J, U as st, n as Ae, T as Pe, q as Mt, p as He, o as Ye, t as Vt, d as Pt, V as Je, g as ae, S as ye, L as ge } from "./index-Dn3cI9sZ.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 kt = [
|
|
12
12
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
13
13
|
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
14
|
-
],
|
|
14
|
+
], bt = q("arrow-right", kt);
|
|
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 Et = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Dt = q("check", Et);
|
|
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 Lt = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], zt = q("chevron-left", Lt);
|
|
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 At = [
|
|
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
|
-
],
|
|
39
|
+
], Ht = q("circle-question-mark", At);
|
|
40
40
|
/**
|
|
41
41
|
* @license lucide-react v0.563.0 - ISC
|
|
42
42
|
*
|
|
43
43
|
* This source code is licensed under the ISC license.
|
|
44
44
|
* See the LICENSE file in the root directory of this source tree.
|
|
45
45
|
*/
|
|
46
|
-
const
|
|
46
|
+
const Gt = [
|
|
47
47
|
[
|
|
48
48
|
"path",
|
|
49
49
|
{
|
|
@@ -52,14 +52,14 @@ const Ht = [
|
|
|
52
52
|
}
|
|
53
53
|
],
|
|
54
54
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
55
|
-
],
|
|
55
|
+
], Ot = q("eye", Gt);
|
|
56
56
|
/**
|
|
57
57
|
* @license lucide-react v0.563.0 - ISC
|
|
58
58
|
*
|
|
59
59
|
* This source code is licensed under the ISC license.
|
|
60
60
|
* See the LICENSE file in the root directory of this source tree.
|
|
61
61
|
*/
|
|
62
|
-
const
|
|
62
|
+
const Tt = [
|
|
63
63
|
[
|
|
64
64
|
"path",
|
|
65
65
|
{
|
|
@@ -72,14 +72,14 @@ const Ot = [
|
|
|
72
72
|
["path", { d: "M14 13h2", key: "un5t4a" }],
|
|
73
73
|
["path", { d: "M8 17h2", key: "2yhykz" }],
|
|
74
74
|
["path", { d: "M14 17h2", key: "10kma7" }]
|
|
75
|
-
],
|
|
75
|
+
], Bt = q("file-spreadsheet", Tt);
|
|
76
76
|
/**
|
|
77
77
|
* @license lucide-react v0.563.0 - ISC
|
|
78
78
|
*
|
|
79
79
|
* This source code is licensed under the ISC license.
|
|
80
80
|
* See the LICENSE file in the root directory of this source tree.
|
|
81
81
|
*/
|
|
82
|
-
const
|
|
82
|
+
const Kt = [
|
|
83
83
|
[
|
|
84
84
|
"path",
|
|
85
85
|
{
|
|
@@ -88,26 +88,26 @@ const Bt = [
|
|
|
88
88
|
}
|
|
89
89
|
],
|
|
90
90
|
["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
|
|
91
|
-
],
|
|
91
|
+
], jt = q("file", Kt);
|
|
92
92
|
/**
|
|
93
93
|
* @license lucide-react v0.563.0 - ISC
|
|
94
94
|
*
|
|
95
95
|
* This source code is licensed under the ISC license.
|
|
96
96
|
* See the LICENSE file in the root directory of this source tree.
|
|
97
97
|
*/
|
|
98
|
-
const
|
|
98
|
+
const qt = [
|
|
99
99
|
["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
|
|
100
100
|
["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
|
|
101
101
|
["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
|
|
102
102
|
["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
|
|
103
|
-
],
|
|
103
|
+
], Ut = q("git-branch", qt);
|
|
104
104
|
/**
|
|
105
105
|
* @license lucide-react v0.563.0 - ISC
|
|
106
106
|
*
|
|
107
107
|
* This source code is licensed under the ISC license.
|
|
108
108
|
* See the LICENSE file in the root directory of this source tree.
|
|
109
109
|
*/
|
|
110
|
-
const
|
|
110
|
+
const Xt = [
|
|
111
111
|
[
|
|
112
112
|
"path",
|
|
113
113
|
{
|
|
@@ -115,33 +115,33 @@ const Ut = [
|
|
|
115
115
|
key: "1a8usu"
|
|
116
116
|
}
|
|
117
117
|
]
|
|
118
|
-
],
|
|
118
|
+
], Zt = q("pen", Xt);
|
|
119
119
|
/**
|
|
120
120
|
* @license lucide-react v0.563.0 - ISC
|
|
121
121
|
*
|
|
122
122
|
* This source code is licensed under the ISC license.
|
|
123
123
|
* See the LICENSE file in the root directory of this source tree.
|
|
124
124
|
*/
|
|
125
|
-
const
|
|
125
|
+
const Wt = [
|
|
126
126
|
[
|
|
127
127
|
"path",
|
|
128
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
129
|
],
|
|
130
130
|
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
131
|
-
],
|
|
131
|
+
], Qt = q("square-check-big", Wt);
|
|
132
132
|
/**
|
|
133
133
|
* @license lucide-react v0.563.0 - ISC
|
|
134
134
|
*
|
|
135
135
|
* This source code is licensed under the ISC license.
|
|
136
136
|
* See the LICENSE file in the root directory of this source tree.
|
|
137
137
|
*/
|
|
138
|
-
const
|
|
138
|
+
const Yt = [
|
|
139
139
|
["path", { d: "M10 11v6", key: "nco0om" }],
|
|
140
140
|
["path", { d: "M14 11v6", key: "outv1u" }],
|
|
141
141
|
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
142
142
|
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
143
143
|
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
144
|
-
],
|
|
144
|
+
], Jt = q("trash-2", Yt), et = {
|
|
145
145
|
sessionId: null,
|
|
146
146
|
status: "idle",
|
|
147
147
|
step: "upload",
|
|
@@ -163,7 +163,7 @@ const Qt = [
|
|
|
163
163
|
editingCell: null,
|
|
164
164
|
editedRows: /* @__PURE__ */ new Set()
|
|
165
165
|
};
|
|
166
|
-
function
|
|
166
|
+
function en(e, o) {
|
|
167
167
|
var r;
|
|
168
168
|
const t = [], n = (e == null ? void 0 : e.trim()) || "";
|
|
169
169
|
if (o.required && !n)
|
|
@@ -370,7 +370,7 @@ function Jt(e, o) {
|
|
|
370
370
|
}
|
|
371
371
|
return t;
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function Se(e, o, t) {
|
|
374
374
|
var C;
|
|
375
375
|
const n = [];
|
|
376
376
|
for (const w of e)
|
|
@@ -378,28 +378,28 @@ function ye(e, o, t) {
|
|
|
378
378
|
if (!y.targetKey) continue;
|
|
379
379
|
const x = o.columns.find((P) => P.key === y.targetKey);
|
|
380
380
|
if (!x) continue;
|
|
381
|
-
const
|
|
381
|
+
const $ = w.data[y.targetKey] || w.data[y.sourceColumn] || "", F = en(String($), x);
|
|
382
382
|
for (const P of F)
|
|
383
383
|
n.push({ ...P, rowIndex: w.rowIndex });
|
|
384
384
|
}
|
|
385
385
|
const r = ((C = o.options) == null ? void 0 : C.uniqueKeys) || [];
|
|
386
386
|
for (const w of r) {
|
|
387
|
-
const y = t.find((
|
|
387
|
+
const y = t.find(($) => $.targetKey === w);
|
|
388
388
|
if (!y) continue;
|
|
389
389
|
const x = /* @__PURE__ */ new Map();
|
|
390
|
-
for (const
|
|
391
|
-
const F = String(
|
|
390
|
+
for (const $ of e) {
|
|
391
|
+
const F = String($.data[w] || $.data[y.sourceColumn] || "").toLowerCase().trim();
|
|
392
392
|
if (!F) continue;
|
|
393
393
|
const P = x.get(F) || [];
|
|
394
|
-
P.push(
|
|
394
|
+
P.push($.rowIndex), x.set(F, P);
|
|
395
395
|
}
|
|
396
|
-
for (const [
|
|
396
|
+
for (const [$, F] of x.entries())
|
|
397
397
|
if (F.length > 1)
|
|
398
398
|
for (const P of F.slice(1))
|
|
399
399
|
n.push({
|
|
400
400
|
rowIndex: P,
|
|
401
401
|
columnKey: w,
|
|
402
|
-
value:
|
|
402
|
+
value: $,
|
|
403
403
|
severity: "warning",
|
|
404
404
|
validatorType: "unique",
|
|
405
405
|
message: `Duplicate ${w} value`
|
|
@@ -427,17 +427,17 @@ function ye(e, o, t) {
|
|
|
427
427
|
a[w.validatorType] = (a[w.validatorType] || 0) + 1;
|
|
428
428
|
const m = [];
|
|
429
429
|
for (const w of r) {
|
|
430
|
-
const y = t.find((
|
|
430
|
+
const y = t.find(($) => $.targetKey === w);
|
|
431
431
|
if (!y) continue;
|
|
432
432
|
const x = /* @__PURE__ */ new Map();
|
|
433
|
-
for (const
|
|
434
|
-
const F = String(
|
|
433
|
+
for (const $ of e) {
|
|
434
|
+
const F = String($.data[w] || $.data[y.sourceColumn] || "").toLowerCase().trim();
|
|
435
435
|
if (!F) continue;
|
|
436
436
|
const P = x.get(F) || [];
|
|
437
|
-
P.push(
|
|
437
|
+
P.push($.rowIndex), x.set(F, P);
|
|
438
438
|
}
|
|
439
|
-
for (const [
|
|
440
|
-
F.length > 1 && m.push({ columnKey: w, value:
|
|
439
|
+
for (const [$, F] of x.entries())
|
|
440
|
+
F.length > 1 && m.push({ columnKey: w, value: $, rowIndices: F });
|
|
441
441
|
}
|
|
442
442
|
const v = {
|
|
443
443
|
byColumn: c,
|
|
@@ -458,8 +458,8 @@ function ye(e, o, t) {
|
|
|
458
458
|
errorsByRow: l
|
|
459
459
|
};
|
|
460
460
|
}
|
|
461
|
-
const le =
|
|
462
|
-
...
|
|
461
|
+
const le = $t((e, o) => ({
|
|
462
|
+
...et,
|
|
463
463
|
setSchema: (t) => e({ schema: t }),
|
|
464
464
|
setSessionId: (t) => e({ sessionId: t }),
|
|
465
465
|
setFile: (t) => e({
|
|
@@ -497,7 +497,7 @@ const le = It((e, o) => ({
|
|
|
497
497
|
revalidate: () => {
|
|
498
498
|
const t = o();
|
|
499
499
|
if (!t.schema || !t.validationResults) return;
|
|
500
|
-
const { validationResults: n, errorsByRow: r } =
|
|
500
|
+
const { validationResults: n, errorsByRow: r } = Se(
|
|
501
501
|
t.rows,
|
|
502
502
|
t.schema,
|
|
503
503
|
t.mappings
|
|
@@ -522,7 +522,7 @@ const le = It((e, o) => ({
|
|
|
522
522
|
i && (i.data = { ...i.data, [n]: String(r) });
|
|
523
523
|
const u = new Set(l.editedRows);
|
|
524
524
|
if (u.add(t), e({ rows: s, editedRows: u, editingCell: null }), l.schema && l.validationResults) {
|
|
525
|
-
const { validationResults: f, errorsByRow: p } =
|
|
525
|
+
const { validationResults: f, errorsByRow: p } = Se(
|
|
526
526
|
s,
|
|
527
527
|
l.schema,
|
|
528
528
|
l.mappings
|
|
@@ -536,7 +536,7 @@ const le = It((e, o) => ({
|
|
|
536
536
|
rows: l,
|
|
537
537
|
totalRows: l.length
|
|
538
538
|
}), n.schema && n.validationResults) {
|
|
539
|
-
const { validationResults: s, errorsByRow: i } =
|
|
539
|
+
const { validationResults: s, errorsByRow: i } = Se(
|
|
540
540
|
l,
|
|
541
541
|
n.schema,
|
|
542
542
|
n.mappings
|
|
@@ -547,14 +547,14 @@ const le = It((e, o) => ({
|
|
|
547
547
|
setStatus: (t) => e({ status: t }),
|
|
548
548
|
setLoading: (t) => e({ isLoading: t }),
|
|
549
549
|
setError: (t) => e({ error: t }),
|
|
550
|
-
reset: () => e(
|
|
551
|
-
})),
|
|
550
|
+
reset: () => e(et)
|
|
551
|
+
})), tn = ({
|
|
552
552
|
onFileSelect: e,
|
|
553
553
|
maxSize: o = 50 * 1024 * 1024,
|
|
554
554
|
// 50MB
|
|
555
555
|
acceptedTypes: t = [".csv", ".xlsx", ".xls"]
|
|
556
556
|
}) => {
|
|
557
|
-
const { file: n, fileName: r, fileSize: l, setFile: s, error: i, setError: u, isLoading: f } = le(), p =
|
|
557
|
+
const { file: n, fileName: r, fileSize: l, setFile: s, error: i, setError: u, isLoading: f } = le(), p = ze(
|
|
558
558
|
(C, w) => {
|
|
559
559
|
if (w.length > 0) {
|
|
560
560
|
u("Invalid file type or file too large");
|
|
@@ -566,7 +566,7 @@ const le = It((e, o) => ({
|
|
|
566
566
|
}
|
|
567
567
|
},
|
|
568
568
|
[e, s, u]
|
|
569
|
-
), { getRootProps: g, getInputProps: c, isDragActive: a } =
|
|
569
|
+
), { getRootProps: g, getInputProps: c, isDragActive: a } = Nt({
|
|
570
570
|
onDrop: p,
|
|
571
571
|
accept: {
|
|
572
572
|
"text/csv": [".csv"],
|
|
@@ -580,7 +580,7 @@ const le = It((e, o) => ({
|
|
|
580
580
|
C.stopPropagation(), le.getState().reset();
|
|
581
581
|
};
|
|
582
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__ */ h("div", { className: "ff-flex ff-items-center ff-gap-3", children: [
|
|
583
|
-
/* @__PURE__ */ d("div", { className: "ff-p-2 ff-rounded-lg", style: { backgroundColor: "rgba(41, 142, 51, 0.15)" }, children: /* @__PURE__ */ d(
|
|
583
|
+
/* @__PURE__ */ d("div", { className: "ff-p-2 ff-rounded-lg", style: { backgroundColor: "rgba(41, 142, 51, 0.15)" }, children: /* @__PURE__ */ d(jt, { className: "ff-w-6 ff-h-6", style: { color: "var(--ff-success)" } }) }),
|
|
584
584
|
/* @__PURE__ */ h("div", { className: "ff-flex-1 ff-min-w-0", children: [
|
|
585
585
|
/* @__PURE__ */ d("p", { className: "ff-font-medium ff-truncate", style: { color: "var(--ff-success-dark)" }, children: r }),
|
|
586
586
|
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-success)" }, children: m(l || 0) })
|
|
@@ -600,17 +600,17 @@ const le = It((e, o) => ({
|
|
|
600
600
|
"div",
|
|
601
601
|
{
|
|
602
602
|
...g(),
|
|
603
|
-
className:
|
|
603
|
+
className: J(
|
|
604
604
|
"ff-dropzone",
|
|
605
605
|
a && "ff-dropzone-active",
|
|
606
606
|
f && "ff-opacity-50 ff-cursor-not-allowed"
|
|
607
607
|
),
|
|
608
608
|
children: [
|
|
609
609
|
/* @__PURE__ */ d("input", { ...c() }),
|
|
610
|
-
/* @__PURE__ */ d("div", { className: "ff-dropzone-icon-wrapper", children: /* @__PURE__ */ d(
|
|
610
|
+
/* @__PURE__ */ d("div", { className: "ff-dropzone-icon-wrapper", children: /* @__PURE__ */ d(st, { className: "ff-dropzone-icon" }) }),
|
|
611
611
|
/* @__PURE__ */ d("h3", { className: "ff-dropzone-text", children: a ? "Drop your file here" : "Upload your file" }),
|
|
612
612
|
/* @__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:
|
|
613
|
+
/* @__PURE__ */ d("label", { className: "ff-inline-block", children: /* @__PURE__ */ d("span", { className: J(
|
|
614
614
|
"ff-btn ff-btn-primary",
|
|
615
615
|
f && "ff-opacity-50 ff-cursor-wait"
|
|
616
616
|
), children: f ? "Processing..." : "Choose file" }) }),
|
|
@@ -624,11 +624,11 @@ const le = It((e, o) => ({
|
|
|
624
624
|
}
|
|
625
625
|
),
|
|
626
626
|
i && /* @__PURE__ */ h("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: [
|
|
627
|
-
/* @__PURE__ */ d(
|
|
627
|
+
/* @__PURE__ */ d(Ae, { className: "ff-w-4 ff-h-4 ff-flex-shrink-0" }),
|
|
628
628
|
/* @__PURE__ */ d("p", { children: i })
|
|
629
629
|
] })
|
|
630
630
|
] });
|
|
631
|
-
},
|
|
631
|
+
}, nn = ({ onMappingChange: e }) => {
|
|
632
632
|
const { mappings: o, schema: t, unmappedSource: n, updateMapping: r } = le(), l = (t == null ? void 0 : t.columns) || [], s = (g, c) => {
|
|
633
633
|
const a = c === "" ? null : c;
|
|
634
634
|
r(g, a), e == null || e(g, a);
|
|
@@ -662,14 +662,14 @@ const le = It((e, o) => ({
|
|
|
662
662
|
return /* @__PURE__ */ h(
|
|
663
663
|
"div",
|
|
664
664
|
{
|
|
665
|
-
className:
|
|
665
|
+
className: J(
|
|
666
666
|
"ff-mapping-row",
|
|
667
667
|
c && a && "ff-mapping-row-success",
|
|
668
668
|
c && !a && "ff-mapping-row-warning"
|
|
669
669
|
),
|
|
670
670
|
children: [
|
|
671
671
|
/* @__PURE__ */ d("div", { className: "ff-flex-1", children: /* @__PURE__ */ d("div", { className: "ff-mapping-source", children: g.sourceColumn }) }),
|
|
672
|
-
/* @__PURE__ */ d("div", { className: "ff-mapping-arrow", children: /* @__PURE__ */ d(
|
|
672
|
+
/* @__PURE__ */ d("div", { className: "ff-mapping-arrow", children: /* @__PURE__ */ d(bt, { className: "ff-w-5 ff-h-5" }) }),
|
|
673
673
|
/* @__PURE__ */ d("div", { className: "ff-flex-1 ff-mapping-target", children: /* @__PURE__ */ h(
|
|
674
674
|
"select",
|
|
675
675
|
{
|
|
@@ -696,7 +696,7 @@ const le = It((e, o) => ({
|
|
|
696
696
|
]
|
|
697
697
|
}
|
|
698
698
|
) }),
|
|
699
|
-
/* @__PURE__ */ d("div", { className: "ff-mapping-status", children: c ? a ? /* @__PURE__ */ d(
|
|
699
|
+
/* @__PURE__ */ d("div", { className: "ff-mapping-status", children: c ? a ? /* @__PURE__ */ d(Dt, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ d(Ht, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-warning)" } }) : /* @__PURE__ */ d("span", { className: "ff-w-5 ff-h-5" }) }),
|
|
700
700
|
g.confidence > 0 && /* @__PURE__ */ h("div", { className: "ff-confidence", style: { color: i(g.confidence) }, children: [
|
|
701
701
|
/* @__PURE__ */ h("span", { children: [
|
|
702
702
|
Math.round(g.confidence * 100),
|
|
@@ -718,7 +718,7 @@ const le = It((e, o) => ({
|
|
|
718
718
|
(c) => c.required && !p.has(c.key)
|
|
719
719
|
);
|
|
720
720
|
return g.length > 0 ? /* @__PURE__ */ h("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: [
|
|
721
|
-
/* @__PURE__ */ d(
|
|
721
|
+
/* @__PURE__ */ d(Ae, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
|
|
722
722
|
/* @__PURE__ */ h("div", { children: [
|
|
723
723
|
/* @__PURE__ */ d("p", { className: "ff-text-sm ff-font-medium", style: { color: "var(--ff-warning-dark)" }, children: "Required fields not mapped" }),
|
|
724
724
|
/* @__PURE__ */ d("p", { className: "ff-text-sm ff-mt-1", style: { color: "var(--ff-warning)" }, children: g.map((c) => c.label).join(", ") })
|
|
@@ -737,7 +737,7 @@ const le = It((e, o) => ({
|
|
|
737
737
|
*
|
|
738
738
|
* @license MIT
|
|
739
739
|
*/
|
|
740
|
-
function
|
|
740
|
+
function on() {
|
|
741
741
|
return {
|
|
742
742
|
accessor: (e, o) => typeof e == "function" ? {
|
|
743
743
|
...o,
|
|
@@ -750,24 +750,24 @@ function nn() {
|
|
|
750
750
|
group: (e) => e
|
|
751
751
|
};
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function Y(e, o) {
|
|
754
754
|
return typeof e == "function" ? e(o) : e;
|
|
755
755
|
}
|
|
756
756
|
function T(e, o) {
|
|
757
757
|
return (t) => {
|
|
758
758
|
o.setState((n) => ({
|
|
759
759
|
...n,
|
|
760
|
-
[e]:
|
|
760
|
+
[e]: Y(t, n[e])
|
|
761
761
|
}));
|
|
762
762
|
};
|
|
763
763
|
}
|
|
764
764
|
function we(e) {
|
|
765
765
|
return e instanceof Function;
|
|
766
766
|
}
|
|
767
|
-
function
|
|
767
|
+
function rn(e) {
|
|
768
768
|
return Array.isArray(e) && e.every((o) => typeof o == "number");
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function ln(e, o) {
|
|
771
771
|
const t = [], n = (r) => {
|
|
772
772
|
r.forEach((l) => {
|
|
773
773
|
t.push(l);
|
|
@@ -811,7 +811,7 @@ function R(e, o, t, n) {
|
|
|
811
811
|
onChange: n
|
|
812
812
|
};
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function sn(e, o, t, n) {
|
|
815
815
|
const r = () => {
|
|
816
816
|
var s;
|
|
817
817
|
return (s = l.getValue()) != null ? s : e.options.renderFallbackValue;
|
|
@@ -834,7 +834,7 @@ function ln(e, o, t, n) {
|
|
|
834
834
|
s.createCell == null || s.createCell(l, t, o, e);
|
|
835
835
|
}, {}), l;
|
|
836
836
|
}
|
|
837
|
-
function
|
|
837
|
+
function an(e, o, t, n) {
|
|
838
838
|
var r, l;
|
|
839
839
|
const i = {
|
|
840
840
|
...e._getDefaultColumnDef(),
|
|
@@ -874,8 +874,8 @@ function sn(e, o, t, n) {
|
|
|
874
874
|
c.createColumn == null || c.createColumn(g, e);
|
|
875
875
|
return g;
|
|
876
876
|
}
|
|
877
|
-
const
|
|
878
|
-
function
|
|
877
|
+
const L = "debugHeaders";
|
|
878
|
+
function tt(e, o, t) {
|
|
879
879
|
var n;
|
|
880
880
|
let l = {
|
|
881
881
|
id: (n = t.id) != null ? n : o.id,
|
|
@@ -904,33 +904,33 @@ function et(e, o, t) {
|
|
|
904
904
|
s.createHeader == null || s.createHeader(l, e);
|
|
905
905
|
}), l;
|
|
906
906
|
}
|
|
907
|
-
const
|
|
907
|
+
const un = {
|
|
908
908
|
createTable: (e) => {
|
|
909
909
|
e.getHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => {
|
|
910
910
|
var l, s;
|
|
911
911
|
const i = (l = n == null ? void 0 : n.map((g) => t.find((c) => c.id === g)).filter(Boolean)) != null ? l : [], u = (s = r == null ? void 0 : r.map((g) => t.find((c) => c.id === g)).filter(Boolean)) != null ? s : [], f = t.filter((g) => !(n != null && n.includes(g.id)) && !(r != null && r.includes(g.id)));
|
|
912
912
|
return pe(o, [...i, ...f, ...u], e);
|
|
913
|
-
}, R(e.options,
|
|
913
|
+
}, R(e.options, L, "getHeaderGroups")), e.getCenterHeaderGroups = S(() => [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))), pe(o, t, e, "center")), R(e.options, L, "getCenterHeaderGroups")), e.getLeftHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
|
|
914
914
|
var r;
|
|
915
915
|
const l = (r = n == null ? void 0 : n.map((s) => t.find((i) => i.id === s)).filter(Boolean)) != null ? r : [];
|
|
916
916
|
return pe(o, l, e, "left");
|
|
917
|
-
}, R(e.options,
|
|
917
|
+
}, R(e.options, L, "getLeftHeaderGroups")), e.getRightHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
|
|
918
918
|
var r;
|
|
919
919
|
const l = (r = n == null ? void 0 : n.map((s) => t.find((i) => i.id === s)).filter(Boolean)) != null ? r : [];
|
|
920
920
|
return pe(o, l, e, "right");
|
|
921
|
-
}, R(e.options,
|
|
921
|
+
}, R(e.options, L, "getRightHeaderGroups")), e.getFooterGroups = S(() => [e.getHeaderGroups()], (o) => [...o].reverse(), R(e.options, L, "getFooterGroups")), e.getLeftFooterGroups = S(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), R(e.options, L, "getLeftFooterGroups")), e.getCenterFooterGroups = S(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), R(e.options, L, "getCenterFooterGroups")), e.getRightFooterGroups = S(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), R(e.options, L, "getRightFooterGroups")), e.getFlatHeaders = S(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, L, "getFlatHeaders")), e.getLeftFlatHeaders = S(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, L, "getLeftFlatHeaders")), e.getCenterFlatHeaders = S(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, L, "getCenterFlatHeaders")), e.getRightFlatHeaders = S(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, L, "getRightFlatHeaders")), e.getCenterLeafHeaders = S(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
|
|
922
922
|
var n;
|
|
923
923
|
return !((n = t.subHeaders) != null && n.length);
|
|
924
|
-
}), R(e.options,
|
|
924
|
+
}), R(e.options, L, "getCenterLeafHeaders")), e.getLeftLeafHeaders = S(() => [e.getLeftFlatHeaders()], (o) => o.filter((t) => {
|
|
925
925
|
var n;
|
|
926
926
|
return !((n = t.subHeaders) != null && n.length);
|
|
927
|
-
}), R(e.options,
|
|
927
|
+
}), R(e.options, L, "getLeftLeafHeaders")), e.getRightLeafHeaders = S(() => [e.getRightFlatHeaders()], (o) => o.filter((t) => {
|
|
928
928
|
var n;
|
|
929
929
|
return !((n = t.subHeaders) != null && n.length);
|
|
930
|
-
}), R(e.options,
|
|
930
|
+
}), R(e.options, L, "getRightLeafHeaders")), e.getLeafHeaders = S(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
|
|
931
931
|
var r, l, s, i, u, f;
|
|
932
932
|
return [...(r = (l = o[0]) == null ? void 0 : l.headers) != null ? r : [], ...(s = (i = t[0]) == null ? void 0 : i.headers) != null ? s : [], ...(u = (f = n[0]) == null ? void 0 : f.headers) != null ? u : []].map((p) => p.getLeafHeaders()).flat();
|
|
933
|
-
}, R(e.options,
|
|
933
|
+
}, R(e.options, L, "getLeafHeaders"));
|
|
934
934
|
}
|
|
935
935
|
};
|
|
936
936
|
function pe(e, o, t, n) {
|
|
@@ -952,14 +952,14 @@ function pe(e, o, t, n) {
|
|
|
952
952
|
}, v = [];
|
|
953
953
|
c.forEach((C) => {
|
|
954
954
|
const w = [...v].reverse()[0], y = C.column.depth === m.depth;
|
|
955
|
-
let x,
|
|
956
|
-
if (y && C.column.parent ? x = C.column.parent : (x = C.column,
|
|
955
|
+
let x, $ = !1;
|
|
956
|
+
if (y && C.column.parent ? x = C.column.parent : (x = C.column, $ = !0), w && (w == null ? void 0 : w.column) === x)
|
|
957
957
|
w.subHeaders.push(C);
|
|
958
958
|
else {
|
|
959
|
-
const F =
|
|
959
|
+
const F = tt(t, x, {
|
|
960
960
|
id: [n, a, x.id, C == null ? void 0 : C.id].filter(Boolean).join("_"),
|
|
961
|
-
isPlaceholder:
|
|
962
|
-
placeholderId:
|
|
961
|
+
isPlaceholder: $,
|
|
962
|
+
placeholderId: $ ? `${v.filter((P) => P.column === x).length}` : void 0,
|
|
963
963
|
depth: a,
|
|
964
964
|
index: v.length
|
|
965
965
|
});
|
|
@@ -967,7 +967,7 @@ function pe(e, o, t, n) {
|
|
|
967
967
|
}
|
|
968
968
|
m.headers.push(C), C.headerGroup = m;
|
|
969
969
|
}), u.push(m), a > 0 && f(v, a - 1);
|
|
970
|
-
}, p = o.map((c, a) =>
|
|
970
|
+
}, p = o.map((c, a) => tt(t, c, {
|
|
971
971
|
depth: s,
|
|
972
972
|
index: a
|
|
973
973
|
}));
|
|
@@ -976,10 +976,10 @@ function pe(e, o, t, n) {
|
|
|
976
976
|
let v = 0, C = 0, w = [0];
|
|
977
977
|
m.subHeaders && m.subHeaders.length ? (w = [], g(m.subHeaders).forEach((x) => {
|
|
978
978
|
let {
|
|
979
|
-
colSpan:
|
|
979
|
+
colSpan: $,
|
|
980
980
|
rowSpan: F
|
|
981
981
|
} = x;
|
|
982
|
-
v +=
|
|
982
|
+
v += $, w.push(F);
|
|
983
983
|
})) : v = 1;
|
|
984
984
|
const y = Math.min(...w);
|
|
985
985
|
return C = C + y, m.colSpan = v, m.rowSpan = C, {
|
|
@@ -989,7 +989,7 @@ function pe(e, o, t, n) {
|
|
|
989
989
|
});
|
|
990
990
|
return g((r = (l = u[0]) == null ? void 0 : l.headers) != null ? r : []), u;
|
|
991
991
|
}
|
|
992
|
-
const
|
|
992
|
+
const Ge = (e, o, t, n, r, l, s) => {
|
|
993
993
|
let i = {
|
|
994
994
|
id: o,
|
|
995
995
|
index: n,
|
|
@@ -1017,7 +1017,7 @@ const He = (e, o, t, n, r, l, s) => {
|
|
|
1017
1017
|
return (f = i.getValue(u)) != null ? f : e.options.renderFallbackValue;
|
|
1018
1018
|
},
|
|
1019
1019
|
subRows: [],
|
|
1020
|
-
getLeafRows: () =>
|
|
1020
|
+
getLeafRows: () => ln(i.subRows, (u) => u.subRows),
|
|
1021
1021
|
getParentRow: () => i.parentId ? e.getRow(i.parentId, !0) : void 0,
|
|
1022
1022
|
getParentRows: () => {
|
|
1023
1023
|
let u = [], f = i;
|
|
@@ -1028,7 +1028,7 @@ const He = (e, o, t, n, r, l, s) => {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
return u.reverse();
|
|
1030
1030
|
},
|
|
1031
|
-
getAllCells: S(() => [e.getAllLeafColumns()], (u) => u.map((f) =>
|
|
1031
|
+
getAllCells: S(() => [e.getAllLeafColumns()], (u) => u.map((f) => sn(e, i, f, f.id)), R(e.options, "debugRows", "getAllCells")),
|
|
1032
1032
|
_getAllCellsByColumnId: S(() => [i.getAllCells()], (u) => u.reduce((f, p) => (f[p.column.id] = p, f), {}), R(e.options, "debugRows", "getAllCellsByColumnId"))
|
|
1033
1033
|
};
|
|
1034
1034
|
for (let u = 0; u < e._features.length; u++) {
|
|
@@ -1036,54 +1036,54 @@ const He = (e, o, t, n, r, l, s) => {
|
|
|
1036
1036
|
f == null || f.createRow == null || f.createRow(i, e);
|
|
1037
1037
|
}
|
|
1038
1038
|
return i;
|
|
1039
|
-
},
|
|
1039
|
+
}, fn = {
|
|
1040
1040
|
createColumn: (e, o) => {
|
|
1041
1041
|
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
1042
|
if (e._getFacetedMinMaxValues)
|
|
1043
1043
|
return e._getFacetedMinMaxValues();
|
|
1044
1044
|
};
|
|
1045
1045
|
}
|
|
1046
|
-
},
|
|
1046
|
+
}, it = (e, o, t) => {
|
|
1047
1047
|
var n, r;
|
|
1048
1048
|
const l = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
|
|
1049
1049
|
return !!(!((r = e.getValue(o)) == null || (r = r.toString()) == null || (r = r.toLowerCase()) == null) && r.includes(l));
|
|
1050
1050
|
};
|
|
1051
|
-
st.autoRemove = (e) => j(e);
|
|
1052
|
-
const it = (e, o, t) => {
|
|
1053
|
-
var n;
|
|
1054
|
-
return !!(!((n = e.getValue(o)) == null || (n = n.toString()) == null) && n.includes(t));
|
|
1055
|
-
};
|
|
1056
1051
|
it.autoRemove = (e) => j(e);
|
|
1057
1052
|
const at = (e, o, t) => {
|
|
1058
1053
|
var n;
|
|
1059
|
-
return ((n = e.getValue(o)) == null || (n = n.toString()) == null
|
|
1054
|
+
return !!(!((n = e.getValue(o)) == null || (n = n.toString()) == null) && n.includes(t));
|
|
1060
1055
|
};
|
|
1061
1056
|
at.autoRemove = (e) => j(e);
|
|
1062
1057
|
const ut = (e, o, t) => {
|
|
1063
1058
|
var n;
|
|
1064
|
-
return (n = e.getValue(o)) == null ? void 0 : n.
|
|
1059
|
+
return ((n = e.getValue(o)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === (t == null ? void 0 : t.toLowerCase());
|
|
1065
1060
|
};
|
|
1066
1061
|
ut.autoRemove = (e) => j(e);
|
|
1067
|
-
const ft = (e, o, t) =>
|
|
1062
|
+
const ft = (e, o, t) => {
|
|
1063
|
+
var n;
|
|
1064
|
+
return (n = e.getValue(o)) == null ? void 0 : n.includes(t);
|
|
1065
|
+
};
|
|
1066
|
+
ft.autoRemove = (e) => j(e);
|
|
1067
|
+
const dt = (e, o, t) => !t.some((n) => {
|
|
1068
1068
|
var r;
|
|
1069
1069
|
return !((r = e.getValue(o)) != null && r.includes(n));
|
|
1070
1070
|
});
|
|
1071
|
-
|
|
1072
|
-
const
|
|
1071
|
+
dt.autoRemove = (e) => j(e) || !(e != null && e.length);
|
|
1072
|
+
const ct = (e, o, t) => t.some((n) => {
|
|
1073
1073
|
var r;
|
|
1074
1074
|
return (r = e.getValue(o)) == null ? void 0 : r.includes(n);
|
|
1075
1075
|
});
|
|
1076
|
-
|
|
1077
|
-
const
|
|
1078
|
-
ct.autoRemove = (e) => j(e);
|
|
1079
|
-
const gt = (e, o, t) => e.getValue(o) == t;
|
|
1076
|
+
ct.autoRemove = (e) => j(e) || !(e != null && e.length);
|
|
1077
|
+
const gt = (e, o, t) => e.getValue(o) === t;
|
|
1080
1078
|
gt.autoRemove = (e) => j(e);
|
|
1081
|
-
const
|
|
1079
|
+
const pt = (e, o, t) => e.getValue(o) == t;
|
|
1080
|
+
pt.autoRemove = (e) => j(e);
|
|
1081
|
+
const Oe = (e, o, t) => {
|
|
1082
1082
|
let [n, r] = t;
|
|
1083
1083
|
const l = e.getValue(o);
|
|
1084
1084
|
return l >= n && l <= r;
|
|
1085
1085
|
};
|
|
1086
|
-
|
|
1086
|
+
Oe.resolveFilterValue = (e) => {
|
|
1087
1087
|
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
1088
|
if (l > s) {
|
|
1089
1089
|
const i = l;
|
|
@@ -1091,22 +1091,22 @@ Ge.resolveFilterValue = (e) => {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
return [l, s];
|
|
1093
1093
|
};
|
|
1094
|
-
|
|
1095
|
-
const
|
|
1096
|
-
includesString:
|
|
1097
|
-
includesStringSensitive:
|
|
1098
|
-
equalsString:
|
|
1099
|
-
arrIncludes:
|
|
1100
|
-
arrIncludesAll:
|
|
1101
|
-
arrIncludesSome:
|
|
1102
|
-
equals:
|
|
1103
|
-
weakEquals:
|
|
1104
|
-
inNumberRange:
|
|
1094
|
+
Oe.autoRemove = (e) => j(e) || j(e[0]) && j(e[1]);
|
|
1095
|
+
const Z = {
|
|
1096
|
+
includesString: it,
|
|
1097
|
+
includesStringSensitive: at,
|
|
1098
|
+
equalsString: ut,
|
|
1099
|
+
arrIncludes: ft,
|
|
1100
|
+
arrIncludesAll: dt,
|
|
1101
|
+
arrIncludesSome: ct,
|
|
1102
|
+
equals: gt,
|
|
1103
|
+
weakEquals: pt,
|
|
1104
|
+
inNumberRange: Oe
|
|
1105
1105
|
};
|
|
1106
1106
|
function j(e) {
|
|
1107
1107
|
return e == null || e === "";
|
|
1108
1108
|
}
|
|
1109
|
-
const
|
|
1109
|
+
const dn = {
|
|
1110
1110
|
getDefaultColumnDef: () => ({
|
|
1111
1111
|
filterFn: "auto"
|
|
1112
1112
|
}),
|
|
@@ -1122,12 +1122,12 @@ const fn = {
|
|
|
1122
1122
|
createColumn: (e, o) => {
|
|
1123
1123
|
e.getAutoFilterFn = () => {
|
|
1124
1124
|
const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
|
|
1125
|
-
return typeof n == "string" ?
|
|
1125
|
+
return typeof n == "string" ? Z.includesString : typeof n == "number" ? Z.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? Z.equals : Array.isArray(n) ? Z.arrIncludes : Z.weakEquals;
|
|
1126
1126
|
}, e.getFilterFn = () => {
|
|
1127
1127
|
var t, n;
|
|
1128
1128
|
return we(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
|
|
1129
1129
|
// @ts-ignore
|
|
1130
|
-
(t = (n = o.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t :
|
|
1130
|
+
(t = (n = o.options.filterFns) == null ? void 0 : n[e.columnDef.filterFn]) != null ? t : Z[e.columnDef.filterFn]
|
|
1131
1131
|
);
|
|
1132
1132
|
}, e.getCanFilter = () => {
|
|
1133
1133
|
var t, n, r;
|
|
@@ -1140,8 +1140,8 @@ const fn = {
|
|
|
1140
1140
|
return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
|
|
1141
1141
|
}, e.setFilterValue = (t) => {
|
|
1142
1142
|
o.setColumnFilters((n) => {
|
|
1143
|
-
const r = e.getFilterFn(), l = n == null ? void 0 : n.find((p) => p.id === e.id), s =
|
|
1144
|
-
if (
|
|
1143
|
+
const r = e.getFilterFn(), l = n == null ? void 0 : n.find((p) => p.id === e.id), s = Y(t, l ? l.value : void 0);
|
|
1144
|
+
if (nt(r, s, e)) {
|
|
1145
1145
|
var i;
|
|
1146
1146
|
return (i = n == null ? void 0 : n.filter((p) => p.id !== e.id)) != null ? i : [];
|
|
1147
1147
|
}
|
|
@@ -1164,11 +1164,11 @@ const fn = {
|
|
|
1164
1164
|
e.setColumnFilters = (o) => {
|
|
1165
1165
|
const t = e.getAllLeafColumns(), n = (r) => {
|
|
1166
1166
|
var l;
|
|
1167
|
-
return (l =
|
|
1167
|
+
return (l = Y(o, r)) == null ? void 0 : l.filter((s) => {
|
|
1168
1168
|
const i = t.find((u) => u.id === s.id);
|
|
1169
1169
|
if (i) {
|
|
1170
1170
|
const u = i.getFilterFn();
|
|
1171
|
-
if (
|
|
1171
|
+
if (nt(u, s.value, i))
|
|
1172
1172
|
return !1;
|
|
1173
1173
|
}
|
|
1174
1174
|
return !0;
|
|
@@ -1181,57 +1181,57 @@ const fn = {
|
|
|
1181
1181
|
}, 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
1182
|
}
|
|
1183
1183
|
};
|
|
1184
|
-
function
|
|
1184
|
+
function nt(e, o, t) {
|
|
1185
1185
|
return (e && e.autoRemove ? e.autoRemove(o, t) : !1) || typeof o > "u" || typeof o == "string" && !o;
|
|
1186
1186
|
}
|
|
1187
|
-
const
|
|
1187
|
+
const cn = (e, o, t) => t.reduce((n, r) => {
|
|
1188
1188
|
const l = r.getValue(e);
|
|
1189
1189
|
return n + (typeof l == "number" ? l : 0);
|
|
1190
|
-
}, 0),
|
|
1190
|
+
}, 0), gn = (e, o, t) => {
|
|
1191
1191
|
let n;
|
|
1192
1192
|
return t.forEach((r) => {
|
|
1193
1193
|
const l = r.getValue(e);
|
|
1194
1194
|
l != null && (n > l || n === void 0 && l >= l) && (n = l);
|
|
1195
1195
|
}), n;
|
|
1196
|
-
},
|
|
1196
|
+
}, pn = (e, o, t) => {
|
|
1197
1197
|
let n;
|
|
1198
1198
|
return t.forEach((r) => {
|
|
1199
1199
|
const l = r.getValue(e);
|
|
1200
1200
|
l != null && (n < l || n === void 0 && l >= l) && (n = l);
|
|
1201
1201
|
}), n;
|
|
1202
|
-
},
|
|
1202
|
+
}, mn = (e, o, t) => {
|
|
1203
1203
|
let n, r;
|
|
1204
1204
|
return t.forEach((l) => {
|
|
1205
1205
|
const s = l.getValue(e);
|
|
1206
1206
|
s != null && (n === void 0 ? s >= s && (n = r = s) : (n > s && (n = s), r < s && (r = s)));
|
|
1207
1207
|
}), [n, r];
|
|
1208
|
-
},
|
|
1208
|
+
}, hn = (e, o) => {
|
|
1209
1209
|
let t = 0, n = 0;
|
|
1210
1210
|
if (o.forEach((r) => {
|
|
1211
1211
|
let l = r.getValue(e);
|
|
1212
1212
|
l != null && (l = +l) >= l && (++t, n += l);
|
|
1213
1213
|
}), t) return n / t;
|
|
1214
|
-
},
|
|
1214
|
+
}, vn = (e, o) => {
|
|
1215
1215
|
if (!o.length)
|
|
1216
1216
|
return;
|
|
1217
1217
|
const t = o.map((l) => l.getValue(e));
|
|
1218
|
-
if (!
|
|
1218
|
+
if (!rn(t))
|
|
1219
1219
|
return;
|
|
1220
1220
|
if (t.length === 1)
|
|
1221
1221
|
return t[0];
|
|
1222
1222
|
const n = Math.floor(t.length / 2), r = t.sort((l, s) => l - s);
|
|
1223
1223
|
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
|
-
},
|
|
1224
|
+
}, wn = (e, o) => Array.from(new Set(o.map((t) => t.getValue(e))).values()), Cn = (e, o) => new Set(o.map((t) => t.getValue(e))).size, yn = (e, o) => o.length, Re = {
|
|
1225
|
+
sum: cn,
|
|
1226
|
+
min: gn,
|
|
1227
|
+
max: pn,
|
|
1228
|
+
extent: mn,
|
|
1229
|
+
mean: hn,
|
|
1230
|
+
median: vn,
|
|
1231
|
+
unique: wn,
|
|
1232
|
+
uniqueCount: Cn,
|
|
1233
|
+
count: yn
|
|
1234
|
+
}, Sn = {
|
|
1235
1235
|
getDefaultColumnDef: () => ({
|
|
1236
1236
|
aggregatedCell: (e) => {
|
|
1237
1237
|
var o, t;
|
|
@@ -1267,14 +1267,14 @@ const dn = (e, o, t) => t.reduce((n, r) => {
|
|
|
1267
1267
|
}, e.getAutoAggregationFn = () => {
|
|
1268
1268
|
const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
|
|
1269
1269
|
if (typeof n == "number")
|
|
1270
|
-
return
|
|
1270
|
+
return Re.sum;
|
|
1271
1271
|
if (Object.prototype.toString.call(n) === "[object Date]")
|
|
1272
|
-
return
|
|
1272
|
+
return Re.extent;
|
|
1273
1273
|
}, e.getAggregationFn = () => {
|
|
1274
1274
|
var t, n;
|
|
1275
1275
|
if (!e)
|
|
1276
1276
|
throw new Error();
|
|
1277
|
-
return we(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 :
|
|
1277
|
+
return we(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 : Re[e.columnDef.aggregationFn];
|
|
1278
1278
|
};
|
|
1279
1279
|
},
|
|
1280
1280
|
createTable: (e) => {
|
|
@@ -1298,13 +1298,13 @@ const dn = (e, o, t) => t.reduce((n, r) => {
|
|
|
1298
1298
|
};
|
|
1299
1299
|
}
|
|
1300
1300
|
};
|
|
1301
|
-
function
|
|
1301
|
+
function Rn(e, o, t) {
|
|
1302
1302
|
if (!(o != null && o.length) || !t)
|
|
1303
1303
|
return e;
|
|
1304
1304
|
const n = e.filter((l) => !o.includes(l.id));
|
|
1305
1305
|
return t === "remove" ? n : [...o.map((l) => e.find((s) => s.id === l)).filter(Boolean), ...n];
|
|
1306
1306
|
}
|
|
1307
|
-
const
|
|
1307
|
+
const xn = {
|
|
1308
1308
|
getInitialState: (e) => ({
|
|
1309
1309
|
columnOrder: [],
|
|
1310
1310
|
...e
|
|
@@ -1313,12 +1313,12 @@ const Rn = {
|
|
|
1313
1313
|
onColumnOrderChange: T("columnOrder", e)
|
|
1314
1314
|
}),
|
|
1315
1315
|
createColumn: (e, o) => {
|
|
1316
|
-
e.getIndex = S((t) => [
|
|
1316
|
+
e.getIndex = S((t) => [fe(o, t)], (t) => t.findIndex((n) => n.id === e.id), R(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
|
|
1317
1317
|
var n;
|
|
1318
|
-
return ((n =
|
|
1318
|
+
return ((n = fe(o, t)[0]) == null ? void 0 : n.id) === e.id;
|
|
1319
1319
|
}, e.getIsLastColumn = (t) => {
|
|
1320
1320
|
var n;
|
|
1321
|
-
const r =
|
|
1321
|
+
const r = fe(o, t);
|
|
1322
1322
|
return ((n = r[r.length - 1]) == null ? void 0 : n.id) === e.id;
|
|
1323
1323
|
};
|
|
1324
1324
|
},
|
|
@@ -1338,15 +1338,15 @@ const Rn = {
|
|
|
1338
1338
|
}
|
|
1339
1339
|
l = [...l, ...i];
|
|
1340
1340
|
}
|
|
1341
|
-
return
|
|
1341
|
+
return Rn(l, t, n);
|
|
1342
1342
|
}, R(e.options, "debugTable", "_getOrderColumnsFn"));
|
|
1343
1343
|
}
|
|
1344
|
-
},
|
|
1344
|
+
}, xe = () => ({
|
|
1345
1345
|
left: [],
|
|
1346
1346
|
right: []
|
|
1347
|
-
}),
|
|
1347
|
+
}), _n = {
|
|
1348
1348
|
getInitialState: (e) => ({
|
|
1349
|
-
columnPinning:
|
|
1349
|
+
columnPinning: xe(),
|
|
1350
1350
|
...e
|
|
1351
1351
|
}),
|
|
1352
1352
|
getDefaultOptions: (e) => ({
|
|
@@ -1406,7 +1406,7 @@ const Rn = {
|
|
|
1406
1406
|
createTable: (e) => {
|
|
1407
1407
|
e.setColumnPinning = (o) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(o), e.resetColumnPinning = (o) => {
|
|
1408
1408
|
var t, n;
|
|
1409
|
-
return e.setColumnPinning(o ?
|
|
1409
|
+
return e.setColumnPinning(o ? xe() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : xe());
|
|
1410
1410
|
}, e.getIsSomeColumnsPinned = (o) => {
|
|
1411
1411
|
var t;
|
|
1412
1412
|
const n = e.getState().columnPinning;
|
|
@@ -1421,25 +1421,25 @@ const Rn = {
|
|
|
1421
1421
|
}, R(e.options, "debugColumns", "getCenterLeafColumns"));
|
|
1422
1422
|
}
|
|
1423
1423
|
};
|
|
1424
|
-
function
|
|
1424
|
+
function Fn(e) {
|
|
1425
1425
|
return e || (typeof document < "u" ? document : null);
|
|
1426
1426
|
}
|
|
1427
1427
|
const me = {
|
|
1428
1428
|
size: 150,
|
|
1429
1429
|
minSize: 20,
|
|
1430
1430
|
maxSize: Number.MAX_SAFE_INTEGER
|
|
1431
|
-
},
|
|
1431
|
+
}, _e = () => ({
|
|
1432
1432
|
startOffset: null,
|
|
1433
1433
|
startSize: null,
|
|
1434
1434
|
deltaOffset: null,
|
|
1435
1435
|
deltaPercentage: null,
|
|
1436
1436
|
isResizingColumn: !1,
|
|
1437
1437
|
columnSizingStart: []
|
|
1438
|
-
}),
|
|
1438
|
+
}), In = {
|
|
1439
1439
|
getDefaultColumnDef: () => me,
|
|
1440
1440
|
getInitialState: (e) => ({
|
|
1441
1441
|
columnSizing: {},
|
|
1442
|
-
columnSizingInfo:
|
|
1442
|
+
columnSizingInfo: _e(),
|
|
1443
1443
|
...e
|
|
1444
1444
|
}),
|
|
1445
1445
|
getDefaultOptions: (e) => ({
|
|
@@ -1453,7 +1453,7 @@ const me = {
|
|
|
1453
1453
|
var t, n, r;
|
|
1454
1454
|
const l = o.getState().columnSizing[e.id];
|
|
1455
1455
|
return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : me.minSize, (n = l ?? e.columnDef.size) != null ? n : me.size), (r = e.columnDef.maxSize) != null ? r : me.maxSize);
|
|
1456
|
-
}, e.getStart = S((t) => [t,
|
|
1456
|
+
}, e.getStart = S((t) => [t, fe(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 = S((t) => [t, fe(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
1457
|
o.setColumnSizing((t) => {
|
|
1458
1458
|
let {
|
|
1459
1459
|
[e.id]: n,
|
|
@@ -1487,19 +1487,19 @@ const me = {
|
|
|
1487
1487
|
}, e.getResizeHandler = (t) => {
|
|
1488
1488
|
const n = o.getColumn(e.column.id), r = n == null ? void 0 : n.getCanResize();
|
|
1489
1489
|
return (l) => {
|
|
1490
|
-
if (!n || !r || (l.persist == null || l.persist(),
|
|
1490
|
+
if (!n || !r || (l.persist == null || l.persist(), Fe(l) && l.touches && l.touches.length > 1))
|
|
1491
1491
|
return;
|
|
1492
|
-
const s = e.getSize(), i = e ? e.getLeafHeaders().map((w) => [w.column.id, w.column.getSize()]) : [[n.id, n.getSize()]], u =
|
|
1492
|
+
const s = e.getSize(), i = e ? e.getLeafHeaders().map((w) => [w.column.id, w.column.getSize()]) : [[n.id, n.getSize()]], u = Fe(l) ? Math.round(l.touches[0].clientX) : l.clientX, f = {}, p = (w, y) => {
|
|
1493
1493
|
typeof y == "number" && (o.setColumnSizingInfo((x) => {
|
|
1494
|
-
var
|
|
1495
|
-
const P = o.options.columnResizeDirection === "rtl" ? -1 : 1,
|
|
1496
|
-
return x.columnSizingStart.forEach((
|
|
1497
|
-
let [
|
|
1498
|
-
f[
|
|
1494
|
+
var $, F;
|
|
1495
|
+
const P = o.options.columnResizeDirection === "rtl" ? -1 : 1, X = (y - (($ = x == null ? void 0 : x.startOffset) != null ? $ : 0)) * P, te = Math.max(X / ((F = x == null ? void 0 : x.startSize) != null ? F : 0), -0.999999);
|
|
1496
|
+
return x.columnSizingStart.forEach((A) => {
|
|
1497
|
+
let [H, ne] = A;
|
|
1498
|
+
f[H] = Math.round(Math.max(ne + ne * te, 0) * 100) / 100;
|
|
1499
1499
|
}), {
|
|
1500
1500
|
...x,
|
|
1501
|
-
deltaOffset:
|
|
1502
|
-
deltaPercentage:
|
|
1501
|
+
deltaOffset: X,
|
|
1502
|
+
deltaPercentage: te
|
|
1503
1503
|
};
|
|
1504
1504
|
}), (o.options.columnResizeMode === "onChange" || w === "end") && o.setColumnSizing((x) => ({
|
|
1505
1505
|
...x,
|
|
@@ -1515,7 +1515,7 @@ const me = {
|
|
|
1515
1515
|
deltaPercentage: null,
|
|
1516
1516
|
columnSizingStart: []
|
|
1517
1517
|
}));
|
|
1518
|
-
}, a =
|
|
1518
|
+
}, a = Fn(t), m = {
|
|
1519
1519
|
moveHandler: (w) => g(w.clientX),
|
|
1520
1520
|
upHandler: (w) => {
|
|
1521
1521
|
a == null || a.removeEventListener("mousemove", m.moveHandler), a == null || a.removeEventListener("mouseup", m.upHandler), c(w.clientX);
|
|
@@ -1526,10 +1526,10 @@ const me = {
|
|
|
1526
1526
|
var y;
|
|
1527
1527
|
a == null || a.removeEventListener("touchmove", v.moveHandler), a == null || a.removeEventListener("touchend", v.upHandler), w.cancelable && (w.preventDefault(), w.stopPropagation()), c((y = w.touches[0]) == null ? void 0 : y.clientX);
|
|
1528
1528
|
}
|
|
1529
|
-
}, C =
|
|
1529
|
+
}, C = $n() ? {
|
|
1530
1530
|
passive: !1
|
|
1531
1531
|
} : !1;
|
|
1532
|
-
|
|
1532
|
+
Fe(l) ? (a == null || a.addEventListener("touchmove", v.moveHandler, C), a == null || a.addEventListener("touchend", v.upHandler, C)) : (a == null || a.addEventListener("mousemove", m.moveHandler, C), a == null || a.addEventListener("mouseup", m.upHandler, C)), o.setColumnSizingInfo((w) => ({
|
|
1533
1533
|
...w,
|
|
1534
1534
|
startOffset: u,
|
|
1535
1535
|
startSize: s,
|
|
@@ -1547,7 +1547,7 @@ const me = {
|
|
|
1547
1547
|
e.setColumnSizing(o ? {} : (t = e.initialState.columnSizing) != null ? t : {});
|
|
1548
1548
|
}, e.resetHeaderSizeInfo = (o) => {
|
|
1549
1549
|
var t;
|
|
1550
|
-
e.setColumnSizingInfo(o ?
|
|
1550
|
+
e.setColumnSizingInfo(o ? _e() : (t = e.initialState.columnSizingInfo) != null ? t : _e());
|
|
1551
1551
|
}, e.getTotalSize = () => {
|
|
1552
1552
|
var o, t;
|
|
1553
1553
|
return (o = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
|
|
@@ -1564,7 +1564,7 @@ const me = {
|
|
|
1564
1564
|
}
|
|
1565
1565
|
};
|
|
1566
1566
|
let he = null;
|
|
1567
|
-
function
|
|
1567
|
+
function $n() {
|
|
1568
1568
|
if (typeof he == "boolean") return he;
|
|
1569
1569
|
let e = !1;
|
|
1570
1570
|
try {
|
|
@@ -1580,10 +1580,10 @@ function In() {
|
|
|
1580
1580
|
}
|
|
1581
1581
|
return he = e, he;
|
|
1582
1582
|
}
|
|
1583
|
-
function
|
|
1583
|
+
function Fe(e) {
|
|
1584
1584
|
return e.type === "touchstart";
|
|
1585
1585
|
}
|
|
1586
|
-
const
|
|
1586
|
+
const Nn = {
|
|
1587
1587
|
getInitialState: (e) => ({
|
|
1588
1588
|
columnVisibility: {},
|
|
1589
1589
|
...e
|
|
@@ -1628,17 +1628,17 @@ const $n = {
|
|
|
1628
1628
|
};
|
|
1629
1629
|
}
|
|
1630
1630
|
};
|
|
1631
|
-
function
|
|
1631
|
+
function fe(e, o) {
|
|
1632
1632
|
return o ? o === "center" ? e.getCenterVisibleLeafColumns() : o === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
|
|
1633
1633
|
}
|
|
1634
|
-
const
|
|
1634
|
+
const Mn = {
|
|
1635
1635
|
createTable: (e) => {
|
|
1636
1636
|
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
1637
|
if (e._getGlobalFacetedMinMaxValues)
|
|
1638
1638
|
return e._getGlobalFacetedMinMaxValues();
|
|
1639
1639
|
};
|
|
1640
1640
|
}
|
|
1641
|
-
},
|
|
1641
|
+
}, Vn = {
|
|
1642
1642
|
getInitialState: (e) => ({
|
|
1643
1643
|
globalFilter: void 0,
|
|
1644
1644
|
...e
|
|
@@ -1659,19 +1659,19 @@ const Nn = {
|
|
|
1659
1659
|
};
|
|
1660
1660
|
},
|
|
1661
1661
|
createTable: (e) => {
|
|
1662
|
-
e.getGlobalAutoFilterFn = () =>
|
|
1662
|
+
e.getGlobalAutoFilterFn = () => Z.includesString, e.getGlobalFilterFn = () => {
|
|
1663
1663
|
var o, t;
|
|
1664
1664
|
const {
|
|
1665
1665
|
globalFilterFn: n
|
|
1666
1666
|
} = e.options;
|
|
1667
|
-
return we(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o :
|
|
1667
|
+
return we(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o : Z[n];
|
|
1668
1668
|
}, e.setGlobalFilter = (o) => {
|
|
1669
1669
|
e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(o);
|
|
1670
1670
|
}, e.resetGlobalFilter = (o) => {
|
|
1671
1671
|
e.setGlobalFilter(o ? void 0 : e.initialState.globalFilter);
|
|
1672
1672
|
};
|
|
1673
1673
|
}
|
|
1674
|
-
},
|
|
1674
|
+
}, Pn = {
|
|
1675
1675
|
getInitialState: (e) => ({
|
|
1676
1676
|
expanded: {},
|
|
1677
1677
|
...e
|
|
@@ -1758,14 +1758,14 @@ const Nn = {
|
|
|
1758
1758
|
};
|
|
1759
1759
|
};
|
|
1760
1760
|
}
|
|
1761
|
-
},
|
|
1762
|
-
pageIndex:
|
|
1763
|
-
pageSize:
|
|
1764
|
-
}),
|
|
1761
|
+
}, ke = 0, be = 10, Ie = () => ({
|
|
1762
|
+
pageIndex: ke,
|
|
1763
|
+
pageSize: be
|
|
1764
|
+
}), kn = {
|
|
1765
1765
|
getInitialState: (e) => ({
|
|
1766
1766
|
...e,
|
|
1767
1767
|
pagination: {
|
|
1768
|
-
...
|
|
1768
|
+
...Ie(),
|
|
1769
1769
|
...e == null ? void 0 : e.pagination
|
|
1770
1770
|
}
|
|
1771
1771
|
}),
|
|
@@ -1789,14 +1789,14 @@ const Nn = {
|
|
|
1789
1789
|
});
|
|
1790
1790
|
}
|
|
1791
1791
|
}, e.setPagination = (n) => {
|
|
1792
|
-
const r = (l) =>
|
|
1792
|
+
const r = (l) => Y(n, l);
|
|
1793
1793
|
return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(r);
|
|
1794
1794
|
}, e.resetPagination = (n) => {
|
|
1795
1795
|
var r;
|
|
1796
|
-
e.setPagination(n ?
|
|
1796
|
+
e.setPagination(n ? Ie() : (r = e.initialState.pagination) != null ? r : Ie());
|
|
1797
1797
|
}, e.setPageIndex = (n) => {
|
|
1798
1798
|
e.setPagination((r) => {
|
|
1799
|
-
let l =
|
|
1799
|
+
let l = Y(n, r.pageIndex);
|
|
1800
1800
|
const s = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
|
|
1801
1801
|
return l = Math.max(0, Math.min(l, s)), {
|
|
1802
1802
|
...r,
|
|
@@ -1805,13 +1805,13 @@ const Nn = {
|
|
|
1805
1805
|
});
|
|
1806
1806
|
}, e.resetPageIndex = (n) => {
|
|
1807
1807
|
var r, l;
|
|
1808
|
-
e.setPageIndex(n ?
|
|
1808
|
+
e.setPageIndex(n ? ke : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageIndex) != null ? r : ke);
|
|
1809
1809
|
}, e.resetPageSize = (n) => {
|
|
1810
1810
|
var r, l;
|
|
1811
|
-
e.setPageSize(n ?
|
|
1811
|
+
e.setPageSize(n ? be : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageSize) != null ? r : be);
|
|
1812
1812
|
}, e.setPageSize = (n) => {
|
|
1813
1813
|
e.setPagination((r) => {
|
|
1814
|
-
const l = Math.max(1,
|
|
1814
|
+
const l = Math.max(1, Y(n, r.pageSize)), s = r.pageSize * r.pageIndex, i = Math.floor(s / l);
|
|
1815
1815
|
return {
|
|
1816
1816
|
...r,
|
|
1817
1817
|
pageIndex: i,
|
|
@@ -1820,7 +1820,7 @@ const Nn = {
|
|
|
1820
1820
|
});
|
|
1821
1821
|
}, e.setPageCount = (n) => e.setPagination((r) => {
|
|
1822
1822
|
var l;
|
|
1823
|
-
let s =
|
|
1823
|
+
let s = Y(n, (l = e.options.pageCount) != null ? l : -1);
|
|
1824
1824
|
return typeof s == "number" && (s = Math.max(-1, s)), {
|
|
1825
1825
|
...r,
|
|
1826
1826
|
pageCount: s
|
|
@@ -1841,12 +1841,12 @@ const Nn = {
|
|
|
1841
1841
|
return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
|
|
1842
1842
|
};
|
|
1843
1843
|
}
|
|
1844
|
-
},
|
|
1844
|
+
}, $e = () => ({
|
|
1845
1845
|
top: [],
|
|
1846
1846
|
bottom: []
|
|
1847
|
-
}),
|
|
1847
|
+
}), bn = {
|
|
1848
1848
|
getInitialState: (e) => ({
|
|
1849
|
-
rowPinning:
|
|
1849
|
+
rowPinning: $e(),
|
|
1850
1850
|
...e
|
|
1851
1851
|
}),
|
|
1852
1852
|
getDefaultOptions: (e) => ({
|
|
@@ -1915,7 +1915,7 @@ const Nn = {
|
|
|
1915
1915
|
createTable: (e) => {
|
|
1916
1916
|
e.setRowPinning = (o) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(o), e.resetRowPinning = (o) => {
|
|
1917
1917
|
var t, n;
|
|
1918
|
-
return e.setRowPinning(o ?
|
|
1918
|
+
return e.setRowPinning(o ? $e() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : $e());
|
|
1919
1919
|
}, e.getIsSomeRowsPinned = (o) => {
|
|
1920
1920
|
var t;
|
|
1921
1921
|
const n = e.getState().rowPinning;
|
|
@@ -1945,7 +1945,7 @@ const Nn = {
|
|
|
1945
1945
|
return o.filter((l) => !r.has(l.id));
|
|
1946
1946
|
}, R(e.options, "debugRows", "getCenterRows"));
|
|
1947
1947
|
}
|
|
1948
|
-
},
|
|
1948
|
+
}, En = {
|
|
1949
1949
|
getInitialState: (e) => ({
|
|
1950
1950
|
rowSelection: {},
|
|
1951
1951
|
...e
|
|
@@ -1980,17 +1980,17 @@ const Nn = {
|
|
|
1980
1980
|
...t
|
|
1981
1981
|
};
|
|
1982
1982
|
return e.getRowModel().rows.forEach((l) => {
|
|
1983
|
-
|
|
1983
|
+
Ee(r, l.id, n, !0, e);
|
|
1984
1984
|
}), r;
|
|
1985
|
-
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = S(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ?
|
|
1985
|
+
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = S(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? Ne(e, t) : {
|
|
1986
1986
|
rows: [],
|
|
1987
1987
|
flatRows: [],
|
|
1988
1988
|
rowsById: {}
|
|
1989
|
-
}, R(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = S(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ?
|
|
1989
|
+
}, R(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = S(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? Ne(e, t) : {
|
|
1990
1990
|
rows: [],
|
|
1991
1991
|
flatRows: [],
|
|
1992
1992
|
rowsById: {}
|
|
1993
|
-
}, R(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = S(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ?
|
|
1993
|
+
}, R(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = S(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? Ne(e, t) : {
|
|
1994
1994
|
rows: [],
|
|
1995
1995
|
flatRows: [],
|
|
1996
1996
|
rowsById: {}
|
|
@@ -2029,23 +2029,23 @@ const Nn = {
|
|
|
2029
2029
|
const i = {
|
|
2030
2030
|
...l
|
|
2031
2031
|
};
|
|
2032
|
-
return
|
|
2032
|
+
return Ee(i, e.id, t, (s = n == null ? void 0 : n.selectChildren) != null ? s : !0, o), i;
|
|
2033
2033
|
});
|
|
2034
2034
|
}, e.getIsSelected = () => {
|
|
2035
2035
|
const {
|
|
2036
2036
|
rowSelection: t
|
|
2037
2037
|
} = o.getState();
|
|
2038
|
-
return
|
|
2038
|
+
return Te(e, t);
|
|
2039
2039
|
}, e.getIsSomeSelected = () => {
|
|
2040
2040
|
const {
|
|
2041
2041
|
rowSelection: t
|
|
2042
2042
|
} = o.getState();
|
|
2043
|
-
return
|
|
2043
|
+
return De(e, t) === "some";
|
|
2044
2044
|
}, e.getIsAllSubRowsSelected = () => {
|
|
2045
2045
|
const {
|
|
2046
2046
|
rowSelection: t
|
|
2047
2047
|
} = o.getState();
|
|
2048
|
-
return
|
|
2048
|
+
return De(e, t) === "all";
|
|
2049
2049
|
}, e.getCanSelect = () => {
|
|
2050
2050
|
var t;
|
|
2051
2051
|
return typeof o.options.enableRowSelection == "function" ? o.options.enableRowSelection(e) : (t = o.options.enableRowSelection) != null ? t : !0;
|
|
@@ -2063,16 +2063,16 @@ const Nn = {
|
|
|
2063
2063
|
};
|
|
2064
2064
|
};
|
|
2065
2065
|
}
|
|
2066
|
-
},
|
|
2066
|
+
}, Ee = (e, o, t, n, r) => {
|
|
2067
2067
|
var l;
|
|
2068
2068
|
const s = r.getRow(o, !0);
|
|
2069
|
-
t ? (s.getCanMultiSelect() || Object.keys(e).forEach((i) => delete e[i]), s.getCanSelect() && (e[o] = !0)) : delete e[o], n && (l = s.subRows) != null && l.length && s.getCanSelectSubRows() && s.subRows.forEach((i) =>
|
|
2069
|
+
t ? (s.getCanMultiSelect() || Object.keys(e).forEach((i) => delete e[i]), s.getCanSelect() && (e[o] = !0)) : delete e[o], n && (l = s.subRows) != null && l.length && s.getCanSelectSubRows() && s.subRows.forEach((i) => Ee(e, i.id, t, n, r));
|
|
2070
2070
|
};
|
|
2071
|
-
function
|
|
2071
|
+
function Ne(e, o) {
|
|
2072
2072
|
const t = e.getState().rowSelection, n = [], r = {}, l = function(s, i) {
|
|
2073
2073
|
return s.map((u) => {
|
|
2074
2074
|
var f;
|
|
2075
|
-
const p =
|
|
2075
|
+
const p = Te(u, t);
|
|
2076
2076
|
if (p && (n.push(u), r[u.id] = u), (f = u.subRows) != null && f.length && (u = {
|
|
2077
2077
|
...u,
|
|
2078
2078
|
subRows: l(u.subRows)
|
|
@@ -2086,33 +2086,33 @@ function $e(e, o) {
|
|
|
2086
2086
|
rowsById: r
|
|
2087
2087
|
};
|
|
2088
2088
|
}
|
|
2089
|
-
function
|
|
2089
|
+
function Te(e, o) {
|
|
2090
2090
|
var t;
|
|
2091
2091
|
return (t = o[e.id]) != null ? t : !1;
|
|
2092
2092
|
}
|
|
2093
|
-
function
|
|
2093
|
+
function De(e, o, t) {
|
|
2094
2094
|
var n;
|
|
2095
2095
|
if (!((n = e.subRows) != null && n.length)) return !1;
|
|
2096
2096
|
let r = !0, l = !1;
|
|
2097
2097
|
return e.subRows.forEach((s) => {
|
|
2098
|
-
if (!(l && !r) && (s.getCanSelect() && (
|
|
2099
|
-
const i =
|
|
2098
|
+
if (!(l && !r) && (s.getCanSelect() && (Te(s, o) ? l = !0 : r = !1), s.subRows && s.subRows.length)) {
|
|
2099
|
+
const i = De(s, o);
|
|
2100
2100
|
i === "all" ? l = !0 : (i === "some" && (l = !0), r = !1);
|
|
2101
2101
|
}
|
|
2102
2102
|
}), r ? "all" : l ? "some" : !1;
|
|
2103
2103
|
}
|
|
2104
|
-
const
|
|
2104
|
+
const Le = /([0-9]+)/gm, Dn = (e, o, t) => mt(ee(e.getValue(t)).toLowerCase(), ee(o.getValue(t)).toLowerCase()), Ln = (e, o, t) => mt(ee(e.getValue(t)), ee(o.getValue(t))), zn = (e, o, t) => Be(ee(e.getValue(t)).toLowerCase(), ee(o.getValue(t)).toLowerCase()), An = (e, o, t) => Be(ee(e.getValue(t)), ee(o.getValue(t))), Hn = (e, o, t) => {
|
|
2105
2105
|
const n = e.getValue(t), r = o.getValue(t);
|
|
2106
2106
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
2107
|
-
},
|
|
2108
|
-
function
|
|
2107
|
+
}, Gn = (e, o, t) => Be(e.getValue(t), o.getValue(t));
|
|
2108
|
+
function Be(e, o) {
|
|
2109
2109
|
return e === o ? 0 : e > o ? 1 : -1;
|
|
2110
2110
|
}
|
|
2111
|
-
function
|
|
2111
|
+
function ee(e) {
|
|
2112
2112
|
return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
|
|
2113
2113
|
}
|
|
2114
|
-
function
|
|
2115
|
-
const t = e.split(
|
|
2114
|
+
function mt(e, o) {
|
|
2115
|
+
const t = e.split(Le).filter(Boolean), n = o.split(Le).filter(Boolean);
|
|
2116
2116
|
for (; t.length && n.length; ) {
|
|
2117
2117
|
const r = t.shift(), l = n.shift(), s = parseInt(r, 10), i = parseInt(l, 10), u = [s, i].sort();
|
|
2118
2118
|
if (isNaN(u[0])) {
|
|
@@ -2131,14 +2131,14 @@ function pt(e, o) {
|
|
|
2131
2131
|
}
|
|
2132
2132
|
return t.length - n.length;
|
|
2133
2133
|
}
|
|
2134
|
-
const
|
|
2135
|
-
alphanumeric:
|
|
2136
|
-
alphanumericCaseSensitive:
|
|
2137
|
-
text:
|
|
2138
|
-
textCaseSensitive:
|
|
2139
|
-
datetime:
|
|
2140
|
-
basic:
|
|
2141
|
-
},
|
|
2134
|
+
const ue = {
|
|
2135
|
+
alphanumeric: Dn,
|
|
2136
|
+
alphanumericCaseSensitive: Ln,
|
|
2137
|
+
text: zn,
|
|
2138
|
+
textCaseSensitive: An,
|
|
2139
|
+
datetime: Hn,
|
|
2140
|
+
basic: Gn
|
|
2141
|
+
}, On = {
|
|
2142
2142
|
getInitialState: (e) => ({
|
|
2143
2143
|
sorting: [],
|
|
2144
2144
|
...e
|
|
@@ -2158,11 +2158,11 @@ const ae = {
|
|
|
2158
2158
|
for (const r of t) {
|
|
2159
2159
|
const l = r == null ? void 0 : r.getValue(e.id);
|
|
2160
2160
|
if (Object.prototype.toString.call(l) === "[object Date]")
|
|
2161
|
-
return
|
|
2162
|
-
if (typeof l == "string" && (n = !0, l.split(
|
|
2163
|
-
return
|
|
2161
|
+
return ue.datetime;
|
|
2162
|
+
if (typeof l == "string" && (n = !0, l.split(Le).length > 1))
|
|
2163
|
+
return ue.alphanumeric;
|
|
2164
2164
|
}
|
|
2165
|
-
return n ?
|
|
2165
|
+
return n ? ue.text : ue.basic;
|
|
2166
2166
|
}, e.getAutoSortDir = () => {
|
|
2167
2167
|
const t = o.getFilteredRowModel().flatRows[0];
|
|
2168
2168
|
return typeof (t == null ? void 0 : t.getValue(e.id)) == "string" ? "asc" : "desc";
|
|
@@ -2170,7 +2170,7 @@ const ae = {
|
|
|
2170
2170
|
var t, n;
|
|
2171
2171
|
if (!e)
|
|
2172
2172
|
throw new Error();
|
|
2173
|
-
return we(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 :
|
|
2173
|
+
return we(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 : ue[e.columnDef.sortingFn];
|
|
2174
2174
|
}, e.toggleSorting = (t, n) => {
|
|
2175
2175
|
const r = e.getNextSortingOrder(), l = typeof t < "u" && t !== null;
|
|
2176
2176
|
o.setSorting((s) => {
|
|
@@ -2227,30 +2227,30 @@ const ae = {
|
|
|
2227
2227
|
e.setSorting(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
|
|
2228
2228
|
}, 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
2229
|
}
|
|
2230
|
-
},
|
|
2231
|
-
an,
|
|
2232
|
-
$n,
|
|
2233
|
-
Rn,
|
|
2234
|
-
xn,
|
|
2230
|
+
}, Tn = [
|
|
2235
2231
|
un,
|
|
2236
|
-
fn,
|
|
2237
2232
|
Nn,
|
|
2238
|
-
|
|
2233
|
+
xn,
|
|
2234
|
+
_n,
|
|
2235
|
+
fn,
|
|
2236
|
+
dn,
|
|
2239
2237
|
Mn,
|
|
2238
|
+
//depends on ColumnFaceting
|
|
2239
|
+
Vn,
|
|
2240
2240
|
//depends on ColumnFiltering
|
|
2241
|
-
|
|
2242
|
-
|
|
2241
|
+
On,
|
|
2242
|
+
Sn,
|
|
2243
2243
|
//depends on RowSorting
|
|
2244
|
-
Vn,
|
|
2245
2244
|
Pn,
|
|
2246
2245
|
kn,
|
|
2247
2246
|
bn,
|
|
2248
|
-
|
|
2247
|
+
En,
|
|
2248
|
+
In
|
|
2249
2249
|
];
|
|
2250
|
-
function
|
|
2250
|
+
function Bn(e) {
|
|
2251
2251
|
var o, t;
|
|
2252
2252
|
process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
|
|
2253
|
-
const n = [...
|
|
2253
|
+
const n = [...Tn, ...(o = e._features) != null ? o : []];
|
|
2254
2254
|
let r = {
|
|
2255
2255
|
_features: n
|
|
2256
2256
|
};
|
|
@@ -2288,7 +2288,7 @@ function Tn(e) {
|
|
|
2288
2288
|
r.setState(r.initialState);
|
|
2289
2289
|
},
|
|
2290
2290
|
setOptions: (c) => {
|
|
2291
|
-
const a =
|
|
2291
|
+
const a = Y(c, r.options);
|
|
2292
2292
|
r.options = s(a);
|
|
2293
2293
|
},
|
|
2294
2294
|
getState: () => r.options.state,
|
|
@@ -2330,7 +2330,7 @@ function Tn(e) {
|
|
|
2330
2330
|
getAllColumns: S(() => [r._getColumnDefs()], (c) => {
|
|
2331
2331
|
const a = function(m, v, C) {
|
|
2332
2332
|
return C === void 0 && (C = 0), m.map((w) => {
|
|
2333
|
-
const y =
|
|
2333
|
+
const y = an(r, w, C, v), x = w;
|
|
2334
2334
|
return y.columns = x.columns ? a(x.columns, y, C + 1) : [], y;
|
|
2335
2335
|
});
|
|
2336
2336
|
};
|
|
@@ -2354,7 +2354,7 @@ function Tn(e) {
|
|
|
2354
2354
|
}
|
|
2355
2355
|
return r;
|
|
2356
2356
|
}
|
|
2357
|
-
function
|
|
2357
|
+
function Kn() {
|
|
2358
2358
|
return (e) => S(() => [e.options.data], (o) => {
|
|
2359
2359
|
const t = {
|
|
2360
2360
|
rows: [],
|
|
@@ -2364,7 +2364,7 @@ function Bn() {
|
|
|
2364
2364
|
l === void 0 && (l = 0);
|
|
2365
2365
|
const i = [];
|
|
2366
2366
|
for (let f = 0; f < r.length; f++) {
|
|
2367
|
-
const p =
|
|
2367
|
+
const p = Ge(e, e._getRowId(r[f], f, s), r[f], f, l, void 0, s == null ? void 0 : s.id);
|
|
2368
2368
|
if (t.flatRows.push(p), t.rowsById[p.id] = p, i.push(p), e.options.getSubRows) {
|
|
2369
2369
|
var u;
|
|
2370
2370
|
p.originalSubRows = e.options.getSubRows(r[f], f), (u = p.originalSubRows) != null && u.length && (p.subRows = n(p.originalSubRows, l + 1, p));
|
|
@@ -2375,7 +2375,7 @@ function Bn() {
|
|
|
2375
2375
|
return t.rows = n(o), t;
|
|
2376
2376
|
}, R(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
|
|
2377
2377
|
}
|
|
2378
|
-
function
|
|
2378
|
+
function jn(e) {
|
|
2379
2379
|
const o = [], t = (n) => {
|
|
2380
2380
|
var r;
|
|
2381
2381
|
o.push(n), (r = n.subRows) != null && r.length && n.getIsExpanded() && n.subRows.forEach(t);
|
|
@@ -2386,10 +2386,10 @@ function Kn(e) {
|
|
|
2386
2386
|
rowsById: e.rowsById
|
|
2387
2387
|
};
|
|
2388
2388
|
}
|
|
2389
|
-
function jn(e, o, t) {
|
|
2390
|
-
return t.options.filterFromLeafRows ? qn(e, o, t) : Un(e, o, t);
|
|
2391
|
-
}
|
|
2392
2389
|
function qn(e, o, t) {
|
|
2390
|
+
return t.options.filterFromLeafRows ? Un(e, o, t) : Xn(e, o, t);
|
|
2391
|
+
}
|
|
2392
|
+
function Un(e, o, t) {
|
|
2393
2393
|
var n;
|
|
2394
2394
|
const r = [], l = {}, s = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, i = function(u, f) {
|
|
2395
2395
|
f === void 0 && (f = 0);
|
|
@@ -2397,7 +2397,7 @@ function qn(e, o, t) {
|
|
|
2397
2397
|
for (let c = 0; c < u.length; c++) {
|
|
2398
2398
|
var g;
|
|
2399
2399
|
let a = u[c];
|
|
2400
|
-
const m =
|
|
2400
|
+
const m = Ge(t, a.id, a.original, a.index, a.depth, void 0, a.parentId);
|
|
2401
2401
|
if (m.columnFilters = a.columnFilters, (g = a.subRows) != null && g.length && f < s) {
|
|
2402
2402
|
if (m.subRows = i(a.subRows, f + 1), a = m, o(a) && !m.subRows.length) {
|
|
2403
2403
|
p.push(a), l[a.id] = a, r.push(a);
|
|
@@ -2418,7 +2418,7 @@ function qn(e, o, t) {
|
|
|
2418
2418
|
rowsById: l
|
|
2419
2419
|
};
|
|
2420
2420
|
}
|
|
2421
|
-
function
|
|
2421
|
+
function Xn(e, o, t) {
|
|
2422
2422
|
var n;
|
|
2423
2423
|
const r = [], l = {}, s = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, i = function(u, f) {
|
|
2424
2424
|
f === void 0 && (f = 0);
|
|
@@ -2428,7 +2428,7 @@ function Un(e, o, t) {
|
|
|
2428
2428
|
if (o(a)) {
|
|
2429
2429
|
var g;
|
|
2430
2430
|
if ((g = a.subRows) != null && g.length && f < s) {
|
|
2431
|
-
const v =
|
|
2431
|
+
const v = Ge(t, a.id, a.original, a.index, a.depth, void 0, a.parentId);
|
|
2432
2432
|
v.subRows = i(a.subRows, f + 1), a = v;
|
|
2433
2433
|
}
|
|
2434
2434
|
p.push(a), r.push(a), l[a.id] = a;
|
|
@@ -2442,7 +2442,7 @@ function Un(e, o, t) {
|
|
|
2442
2442
|
rowsById: l
|
|
2443
2443
|
};
|
|
2444
2444
|
}
|
|
2445
|
-
function
|
|
2445
|
+
function Zn() {
|
|
2446
2446
|
return (e) => S(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
|
|
2447
2447
|
if (!o.rows.length || !(t != null && t.length) && !n) {
|
|
2448
2448
|
for (let c = 0; c < o.flatRows.length; c++)
|
|
@@ -2506,10 +2506,10 @@ function Xn() {
|
|
|
2506
2506
|
return !1;
|
|
2507
2507
|
return !0;
|
|
2508
2508
|
};
|
|
2509
|
-
return
|
|
2509
|
+
return qn(o.rows, g, e);
|
|
2510
2510
|
}, R(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
|
|
2511
2511
|
}
|
|
2512
|
-
function
|
|
2512
|
+
function Wn(e) {
|
|
2513
2513
|
return (o) => S(() => [o.getState().pagination, o.getPrePaginationRowModel(), o.options.paginateExpandedRows ? void 0 : o.getState().expanded], (t, n) => {
|
|
2514
2514
|
if (!n.rows.length)
|
|
2515
2515
|
return n;
|
|
@@ -2529,7 +2529,7 @@ function Zn(e) {
|
|
|
2529
2529
|
rows: s,
|
|
2530
2530
|
flatRows: i,
|
|
2531
2531
|
rowsById: u
|
|
2532
|
-
} : g =
|
|
2532
|
+
} : g = jn({
|
|
2533
2533
|
rows: s,
|
|
2534
2534
|
flatRows: i,
|
|
2535
2535
|
rowsById: u
|
|
@@ -2540,7 +2540,7 @@ function Zn(e) {
|
|
|
2540
2540
|
return g.rows.forEach(c), g;
|
|
2541
2541
|
}, R(o.options, "debugTable", "getPaginationRowModel"));
|
|
2542
2542
|
}
|
|
2543
|
-
function
|
|
2543
|
+
function Qn() {
|
|
2544
2544
|
return (e) => S(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
|
|
2545
2545
|
if (!t.rows.length || !(o != null && o.length))
|
|
2546
2546
|
return t;
|
|
@@ -2566,7 +2566,7 @@ function Wn() {
|
|
|
2566
2566
|
const m = l[a], v = s[m.id], C = v.sortUndefined, w = (c = m == null ? void 0 : m.desc) != null ? c : !1;
|
|
2567
2567
|
let y = 0;
|
|
2568
2568
|
if (C) {
|
|
2569
|
-
const x = p.getValue(m.id),
|
|
2569
|
+
const x = p.getValue(m.id), $ = g.getValue(m.id), F = x === void 0, P = $ === void 0;
|
|
2570
2570
|
if (F || P) {
|
|
2571
2571
|
if (C === "first") return F ? -1 : 1;
|
|
2572
2572
|
if (C === "last") return F ? 1 : -1;
|
|
@@ -2599,22 +2599,22 @@ function Wn() {
|
|
|
2599
2599
|
*
|
|
2600
2600
|
* @license MIT
|
|
2601
2601
|
*/
|
|
2602
|
-
function
|
|
2603
|
-
return e ?
|
|
2604
|
-
}
|
|
2605
|
-
function Qn(e) {
|
|
2606
|
-
return Yn(e) || typeof e == "function" || Jn(e);
|
|
2602
|
+
function ot(e, o) {
|
|
2603
|
+
return e ? Yn(e) ? /* @__PURE__ */ Ve.createElement(e, o) : e : null;
|
|
2607
2604
|
}
|
|
2608
2605
|
function Yn(e) {
|
|
2606
|
+
return Jn(e) || typeof e == "function" || eo(e);
|
|
2607
|
+
}
|
|
2608
|
+
function Jn(e) {
|
|
2609
2609
|
return typeof e == "function" && (() => {
|
|
2610
2610
|
const o = Object.getPrototypeOf(e);
|
|
2611
2611
|
return o.prototype && o.prototype.isReactComponent;
|
|
2612
2612
|
})();
|
|
2613
2613
|
}
|
|
2614
|
-
function
|
|
2614
|
+
function eo(e) {
|
|
2615
2615
|
return typeof e == "object" && typeof e.$$typeof == "symbol" && ["react.memo", "react.forward_ref"].includes(e.$$typeof.description);
|
|
2616
2616
|
}
|
|
2617
|
-
function
|
|
2617
|
+
function to(e) {
|
|
2618
2618
|
const o = {
|
|
2619
2619
|
state: {},
|
|
2620
2620
|
// Dummy state
|
|
@@ -2623,9 +2623,9 @@ function eo(e) {
|
|
|
2623
2623
|
// noop
|
|
2624
2624
|
renderFallbackValue: null,
|
|
2625
2625
|
...e
|
|
2626
|
-
}, [t] =
|
|
2627
|
-
current:
|
|
2628
|
-
})), [n, r] =
|
|
2626
|
+
}, [t] = Ve.useState(() => ({
|
|
2627
|
+
current: Bn(o)
|
|
2628
|
+
})), [n, r] = Ve.useState(() => t.current.initialState);
|
|
2629
2629
|
return t.current.setOptions((l) => ({
|
|
2630
2630
|
...l,
|
|
2631
2631
|
...e,
|
|
@@ -2640,7 +2640,7 @@ function eo(e) {
|
|
|
2640
2640
|
}
|
|
2641
2641
|
})), t.current;
|
|
2642
2642
|
}
|
|
2643
|
-
const
|
|
2643
|
+
const rt = ({
|
|
2644
2644
|
editable: e = !0,
|
|
2645
2645
|
deletable: o = !0,
|
|
2646
2646
|
pageSize: t = 25,
|
|
@@ -2657,42 +2657,42 @@ const ot = ({
|
|
|
2657
2657
|
stopEditing: g,
|
|
2658
2658
|
updateCell: c,
|
|
2659
2659
|
deleteRow: a
|
|
2660
|
-
} = le(), [m, v] =
|
|
2661
|
-
const
|
|
2660
|
+
} = le(), [m, v] = W([]), [C, w] = W(""), [y, x] = W(""), $ = We(() => i.filter((I) => I.targetKey !== null).map((I) => {
|
|
2661
|
+
const N = s == null ? void 0 : s.columns.find((V) => V.key === I.targetKey);
|
|
2662
2662
|
return {
|
|
2663
2663
|
sourceColumn: I.sourceColumn,
|
|
2664
2664
|
targetKey: I.targetKey,
|
|
2665
|
-
label: (
|
|
2666
|
-
type: (
|
|
2665
|
+
label: (N == null ? void 0 : N.label) || I.targetKey,
|
|
2666
|
+
type: (N == null ? void 0 : N.type) || "string"
|
|
2667
2667
|
};
|
|
2668
|
-
}), [i, s]), F =
|
|
2669
|
-
(I,
|
|
2668
|
+
}), [i, s]), F = ze(
|
|
2669
|
+
(I, N) => {
|
|
2670
2670
|
const V = u.get(I);
|
|
2671
|
-
return V == null ? void 0 : V.find((
|
|
2671
|
+
return V == null ? void 0 : V.find((K) => K.columnKey === N);
|
|
2672
2672
|
},
|
|
2673
2673
|
[u]
|
|
2674
|
-
), P = (I,
|
|
2675
|
-
x(V), p(I,
|
|
2676
|
-
},
|
|
2674
|
+
), P = (I, N, V) => {
|
|
2675
|
+
x(V), p(I, N);
|
|
2676
|
+
}, X = () => {
|
|
2677
2677
|
f && (c(f.rowIndex, f.columnKey, y), n == null || n(f.rowIndex, f.columnKey, y)), g();
|
|
2678
|
-
},
|
|
2678
|
+
}, te = () => {
|
|
2679
2679
|
x(""), g();
|
|
2680
|
-
},
|
|
2680
|
+
}, A = (I) => {
|
|
2681
2681
|
a(I), r == null || r(I);
|
|
2682
|
-
},
|
|
2682
|
+
}, H = on(), ne = We(
|
|
2683
2683
|
() => [
|
|
2684
|
-
|
|
2684
|
+
H.accessor("rowIndex", {
|
|
2685
2685
|
header: "#",
|
|
2686
2686
|
size: o ? 80 : 60,
|
|
2687
2687
|
cell: (I) => {
|
|
2688
|
-
const
|
|
2688
|
+
const N = I.getValue();
|
|
2689
2689
|
return /* @__PURE__ */ h("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
2690
|
-
/* @__PURE__ */ d("span", { className: "ff-font-mono ff-text-xs", style: { color: "var(--ff-text-muted)" }, children:
|
|
2690
|
+
/* @__PURE__ */ d("span", { className: "ff-font-mono ff-text-xs", style: { color: "var(--ff-text-muted)" }, children: N + 1 }),
|
|
2691
2691
|
o && /* @__PURE__ */ d(
|
|
2692
2692
|
"button",
|
|
2693
2693
|
{
|
|
2694
2694
|
onClick: (V) => {
|
|
2695
|
-
V.stopPropagation(),
|
|
2695
|
+
V.stopPropagation(), A(N);
|
|
2696
2696
|
},
|
|
2697
2697
|
title: "Delete row",
|
|
2698
2698
|
style: {
|
|
@@ -2715,27 +2715,27 @@ const ot = ({
|
|
|
2715
2715
|
onMouseLeave: (V) => {
|
|
2716
2716
|
V.currentTarget.style.color = "#8e8d89", V.currentTarget.style.backgroundColor = "transparent";
|
|
2717
2717
|
},
|
|
2718
|
-
children: /* @__PURE__ */ d(
|
|
2718
|
+
children: /* @__PURE__ */ d(Jt, { style: { width: "14px", height: "14px", display: "block" } })
|
|
2719
2719
|
}
|
|
2720
2720
|
)
|
|
2721
2721
|
] });
|
|
2722
2722
|
}
|
|
2723
2723
|
}),
|
|
2724
|
-
|
|
2725
|
-
(I) =>
|
|
2724
|
+
...$.map(
|
|
2725
|
+
(I) => H.accessor((N) => N.data[I.targetKey] || N.data[I.sourceColumn], {
|
|
2726
2726
|
id: I.targetKey,
|
|
2727
2727
|
header: I.label,
|
|
2728
|
-
cell: (
|
|
2729
|
-
const V =
|
|
2728
|
+
cell: (N) => {
|
|
2729
|
+
const V = N.row.original.rowIndex, K = String(N.getValue() ?? ""), D = F(V, I.targetKey);
|
|
2730
2730
|
return (f == null ? void 0 : f.rowIndex) === V && (f == null ? void 0 : f.columnKey) === I.targetKey ? /* @__PURE__ */ h("div", { className: "ff-flex ff-items-center ff-gap-2 ff-min-w-[280px]", children: [
|
|
2731
2731
|
/* @__PURE__ */ d(
|
|
2732
2732
|
"input",
|
|
2733
2733
|
{
|
|
2734
2734
|
type: "text",
|
|
2735
2735
|
value: y,
|
|
2736
|
-
onChange: (
|
|
2737
|
-
onKeyDown: (
|
|
2738
|
-
|
|
2736
|
+
onChange: (G) => x(G.target.value),
|
|
2737
|
+
onKeyDown: (G) => {
|
|
2738
|
+
G.key === "Enter" && X(), G.key === "Escape" && te();
|
|
2739
2739
|
},
|
|
2740
2740
|
className: "ff-input ff-py-2 ff-px-3 ff-text-sm ff-flex-1 ff-min-w-[160px]",
|
|
2741
2741
|
autoFocus: !0
|
|
@@ -2744,7 +2744,7 @@ const ot = ({
|
|
|
2744
2744
|
/* @__PURE__ */ d(
|
|
2745
2745
|
"button",
|
|
2746
2746
|
{
|
|
2747
|
-
onClick:
|
|
2747
|
+
onClick: X,
|
|
2748
2748
|
className: "ff-btn ff-btn-primary ff-btn-sm ff-flex-shrink-0",
|
|
2749
2749
|
children: "Save"
|
|
2750
2750
|
}
|
|
@@ -2752,7 +2752,7 @@ const ot = ({
|
|
|
2752
2752
|
/* @__PURE__ */ d(
|
|
2753
2753
|
"button",
|
|
2754
2754
|
{
|
|
2755
|
-
onClick:
|
|
2755
|
+
onClick: te,
|
|
2756
2756
|
className: "ff-btn ff-btn-secondary ff-btn-sm ff-flex-shrink-0",
|
|
2757
2757
|
children: "Cancel"
|
|
2758
2758
|
}
|
|
@@ -2760,26 +2760,26 @@ const ot = ({
|
|
|
2760
2760
|
] }) : /* @__PURE__ */ h(
|
|
2761
2761
|
"div",
|
|
2762
2762
|
{
|
|
2763
|
-
className:
|
|
2763
|
+
className: J(
|
|
2764
2764
|
"ff-group ff-flex ff-items-center ff-gap-2",
|
|
2765
|
-
(
|
|
2766
|
-
(
|
|
2765
|
+
(D == null ? void 0 : D.severity) === "error" && "ff-cell-error",
|
|
2766
|
+
(D == null ? void 0 : D.severity) === "warning" && "ff-cell-warning"
|
|
2767
2767
|
),
|
|
2768
2768
|
children: [
|
|
2769
|
-
/* @__PURE__ */ d("span", { className: "ff-flex-1 ff-truncate", children:
|
|
2770
|
-
|
|
2771
|
-
|
|
2769
|
+
/* @__PURE__ */ d("span", { className: "ff-flex-1 ff-truncate", children: K || /* @__PURE__ */ d("span", { style: { color: "var(--ff-text-muted)" }, children: "—" }) }),
|
|
2770
|
+
D && /* @__PURE__ */ h("div", { className: "ff-relative ff-group/tooltip", children: [
|
|
2771
|
+
D.severity === "error" ? /* @__PURE__ */ d(Ae, { className: "ff-w-4 ff-h-4", style: { color: "var(--ff-error)" } }) : /* @__PURE__ */ d(Pe, { className: "ff-w-4 ff-h-4", style: { color: "var(--ff-warning)" } }),
|
|
2772
2772
|
/* @__PURE__ */ h("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: [
|
|
2773
|
-
|
|
2774
|
-
|
|
2773
|
+
D.message,
|
|
2774
|
+
D.suggestion && /* @__PURE__ */ d("span", { className: "ff-block ff-mt-1", style: { color: "var(--ff-text-muted)" }, children: D.suggestion })
|
|
2775
2775
|
] })
|
|
2776
2776
|
] }),
|
|
2777
2777
|
e && /* @__PURE__ */ d(
|
|
2778
2778
|
"button",
|
|
2779
2779
|
{
|
|
2780
|
-
onClick: () => P(V, I.targetKey,
|
|
2780
|
+
onClick: () => P(V, I.targetKey, K),
|
|
2781
2781
|
className: "ff-opacity-0 group-hover:ff-opacity-100 ff-p-1 ff-rounded ff-transition-opacity ff-edit-btn",
|
|
2782
|
-
children: /* @__PURE__ */ d(
|
|
2782
|
+
children: /* @__PURE__ */ d(Zt, { className: "ff-w-3 ff-h-3" })
|
|
2783
2783
|
}
|
|
2784
2784
|
)
|
|
2785
2785
|
]
|
|
@@ -2791,20 +2791,20 @@ const ot = ({
|
|
|
2791
2791
|
// Delete button is now in the # column (first column) so it's always visible
|
|
2792
2792
|
// even when the table has many columns and requires horizontal scrolling.
|
|
2793
2793
|
],
|
|
2794
|
-
[
|
|
2795
|
-
),
|
|
2794
|
+
[$, f, y, e, o, F, H]
|
|
2795
|
+
), k = to({
|
|
2796
2796
|
data: l,
|
|
2797
|
-
columns:
|
|
2797
|
+
columns: ne,
|
|
2798
2798
|
state: {
|
|
2799
2799
|
sorting: m,
|
|
2800
2800
|
globalFilter: C
|
|
2801
2801
|
},
|
|
2802
2802
|
onSortingChange: v,
|
|
2803
2803
|
onGlobalFilterChange: w,
|
|
2804
|
-
getCoreRowModel:
|
|
2805
|
-
getPaginationRowModel:
|
|
2806
|
-
getSortedRowModel:
|
|
2807
|
-
getFilteredRowModel:
|
|
2804
|
+
getCoreRowModel: Kn(),
|
|
2805
|
+
getPaginationRowModel: Wn(),
|
|
2806
|
+
getSortedRowModel: Qn(),
|
|
2807
|
+
getFilteredRowModel: Zn(),
|
|
2808
2808
|
initialState: {
|
|
2809
2809
|
pagination: {
|
|
2810
2810
|
pageSize: t
|
|
@@ -2824,33 +2824,33 @@ const ot = ({
|
|
|
2824
2824
|
}
|
|
2825
2825
|
),
|
|
2826
2826
|
/* @__PURE__ */ h("div", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
2827
|
-
|
|
2827
|
+
k.getFilteredRowModel().rows.length,
|
|
2828
2828
|
" rows"
|
|
2829
2829
|
] })
|
|
2830
2830
|
] }),
|
|
2831
2831
|
/* @__PURE__ */ d("div", { className: "ff-table-container ff-max-h-[500px]", children: /* @__PURE__ */ h("table", { className: "ff-table", children: [
|
|
2832
|
-
/* @__PURE__ */ d("thead", { children:
|
|
2832
|
+
/* @__PURE__ */ d("thead", { children: k.getHeaderGroups().map((I) => /* @__PURE__ */ d("tr", { children: I.headers.map((N) => /* @__PURE__ */ d(
|
|
2833
2833
|
"th",
|
|
2834
2834
|
{
|
|
2835
|
-
style: { width:
|
|
2836
|
-
onClick:
|
|
2837
|
-
className:
|
|
2838
|
-
|
|
2835
|
+
style: { width: N.getSize() },
|
|
2836
|
+
onClick: N.column.getToggleSortingHandler(),
|
|
2837
|
+
className: J(
|
|
2838
|
+
N.column.getCanSort() && "ff-cursor-pointer ff-select-none"
|
|
2839
2839
|
),
|
|
2840
2840
|
children: /* @__PURE__ */ h("div", { className: "ff-flex ff-items-center ff-gap-1", children: [
|
|
2841
|
-
|
|
2842
|
-
|
|
2841
|
+
ot(N.column.columnDef.header, N.getContext()),
|
|
2842
|
+
N.column.getIsSorted() && /* @__PURE__ */ d("span", { children: N.column.getIsSorted() === "asc" ? "↑" : "↓" })
|
|
2843
2843
|
] })
|
|
2844
2844
|
},
|
|
2845
|
-
|
|
2845
|
+
N.id
|
|
2846
2846
|
)) }, I.id)) }),
|
|
2847
|
-
/* @__PURE__ */ d("tbody", { children:
|
|
2848
|
-
const
|
|
2847
|
+
/* @__PURE__ */ d("tbody", { children: k.getRowModel().rows.map((I) => {
|
|
2848
|
+
const N = u.has(I.original.rowIndex);
|
|
2849
2849
|
return /* @__PURE__ */ d(
|
|
2850
2850
|
"tr",
|
|
2851
2851
|
{
|
|
2852
|
-
className:
|
|
2853
|
-
children: I.getVisibleCells().map((V) => /* @__PURE__ */ d("td", { children:
|
|
2852
|
+
className: J(N && "ff-row-error"),
|
|
2853
|
+
children: I.getVisibleCells().map((V) => /* @__PURE__ */ d("td", { children: ot(V.column.columnDef.cell, V.getContext()) }, V.id))
|
|
2854
2854
|
},
|
|
2855
2855
|
I.id
|
|
2856
2856
|
);
|
|
@@ -2859,19 +2859,19 @@ const ot = ({
|
|
|
2859
2859
|
/* @__PURE__ */ h("div", { className: "ff-flex ff-items-center ff-justify-between ff-px-2", children: [
|
|
2860
2860
|
/* @__PURE__ */ h("div", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
2861
2861
|
"Page ",
|
|
2862
|
-
|
|
2862
|
+
k.getState().pagination.pageIndex + 1,
|
|
2863
2863
|
" of ",
|
|
2864
|
-
|
|
2864
|
+
k.getPageCount()
|
|
2865
2865
|
] }),
|
|
2866
2866
|
/* @__PURE__ */ h("div", { className: "ff-flex ff-items-center ff-gap-2", children: [
|
|
2867
2867
|
/* @__PURE__ */ h(
|
|
2868
2868
|
"button",
|
|
2869
2869
|
{
|
|
2870
|
-
onClick: () =>
|
|
2871
|
-
disabled: !
|
|
2870
|
+
onClick: () => k.previousPage(),
|
|
2871
|
+
disabled: !k.getCanPreviousPage(),
|
|
2872
2872
|
className: "ff-btn ff-btn-secondary ff-btn-sm",
|
|
2873
2873
|
children: [
|
|
2874
|
-
/* @__PURE__ */ d(
|
|
2874
|
+
/* @__PURE__ */ d(zt, { className: "ff-w-4 ff-h-4" }),
|
|
2875
2875
|
"Previous"
|
|
2876
2876
|
]
|
|
2877
2877
|
}
|
|
@@ -2879,19 +2879,19 @@ const ot = ({
|
|
|
2879
2879
|
/* @__PURE__ */ h(
|
|
2880
2880
|
"button",
|
|
2881
2881
|
{
|
|
2882
|
-
onClick: () =>
|
|
2883
|
-
disabled: !
|
|
2882
|
+
onClick: () => k.nextPage(),
|
|
2883
|
+
disabled: !k.getCanNextPage(),
|
|
2884
2884
|
className: "ff-btn ff-btn-secondary ff-btn-sm",
|
|
2885
2885
|
children: [
|
|
2886
2886
|
"Next",
|
|
2887
|
-
/* @__PURE__ */ d(
|
|
2887
|
+
/* @__PURE__ */ d(Mt, { className: "ff-w-4 ff-h-4" })
|
|
2888
2888
|
]
|
|
2889
2889
|
}
|
|
2890
2890
|
)
|
|
2891
2891
|
] })
|
|
2892
2892
|
] })
|
|
2893
2893
|
] });
|
|
2894
|
-
},
|
|
2894
|
+
}, lt = ({
|
|
2895
2895
|
showDetails: e = !0
|
|
2896
2896
|
}) => {
|
|
2897
2897
|
const { validationResults: o } = le();
|
|
@@ -2908,7 +2908,7 @@ const ot = ({
|
|
|
2908
2908
|
borderColor: t ? "var(--ff-success)" : "var(--ff-error)"
|
|
2909
2909
|
},
|
|
2910
2910
|
children: [
|
|
2911
|
-
t ? /* @__PURE__ */ d(
|
|
2911
|
+
t ? /* @__PURE__ */ d(He, { className: "ff-w-8 ff-h-8", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ d(Ye, { className: "ff-w-8 ff-h-8", style: { color: "var(--ff-error)" } }),
|
|
2912
2912
|
/* @__PURE__ */ h("div", { children: [
|
|
2913
2913
|
/* @__PURE__ */ d(
|
|
2914
2914
|
"h3",
|
|
@@ -2964,13 +2964,13 @@ const ot = ({
|
|
|
2964
2964
|
] }),
|
|
2965
2965
|
/* @__PURE__ */ h("div", { className: "ff-flex ff-items-center ff-gap-2 ff-flex-shrink-0", children: [
|
|
2966
2966
|
g.errorCount > 0 && /* @__PURE__ */ h("span", { className: "ff-badge ff-badge-error ff-whitespace-nowrap", children: [
|
|
2967
|
-
/* @__PURE__ */ d(
|
|
2967
|
+
/* @__PURE__ */ d(Ye, { className: "ff-w-3 ff-h-3 ff-mr-1" }),
|
|
2968
2968
|
g.errorCount,
|
|
2969
2969
|
" ",
|
|
2970
2970
|
g.errorCount === 1 ? "error" : "errors"
|
|
2971
2971
|
] }),
|
|
2972
2972
|
g.warningCount > 0 && /* @__PURE__ */ h("span", { className: "ff-badge ff-badge-warning ff-whitespace-nowrap", children: [
|
|
2973
|
-
/* @__PURE__ */ d(
|
|
2973
|
+
/* @__PURE__ */ d(Pe, { className: "ff-w-3 ff-h-3 ff-mr-1" }),
|
|
2974
2974
|
g.warningCount,
|
|
2975
2975
|
" ",
|
|
2976
2976
|
g.warningCount === 1 ? "warning" : "warnings"
|
|
@@ -2982,7 +2982,7 @@ const ot = ({
|
|
|
2982
2982
|
)) })
|
|
2983
2983
|
] }),
|
|
2984
2984
|
e && u.duplicates && u.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__ */ h("div", { className: "ff-flex ff-items-start ff-gap-3", children: [
|
|
2985
|
-
/* @__PURE__ */ d(
|
|
2985
|
+
/* @__PURE__ */ d(Pe, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
|
|
2986
2986
|
/* @__PURE__ */ h("div", { children: [
|
|
2987
2987
|
/* @__PURE__ */ d("h4", { className: "ff-font-medium", style: { color: "var(--ff-warning-dark)" }, children: "Duplicate Values Found" }),
|
|
2988
2988
|
/* @__PURE__ */ h("ul", { className: "ff-mt-2 ff-space-y-1 ff-text-sm", style: { color: "var(--ff-warning-dark)" }, children: [
|
|
@@ -3008,13 +3008,13 @@ const ot = ({
|
|
|
3008
3008
|
] })
|
|
3009
3009
|
] }) })
|
|
3010
3010
|
] });
|
|
3011
|
-
},
|
|
3012
|
-
{ key: "upload", label: "Upload", icon:
|
|
3013
|
-
{ key: "mapping", label: "Map Columns", icon:
|
|
3014
|
-
{ key: "validation", label: "Validate", icon:
|
|
3015
|
-
{ key: "review", label: "Review", icon:
|
|
3016
|
-
{ key: "complete", label: "Complete", icon:
|
|
3017
|
-
],
|
|
3011
|
+
}, Me = ["upload", "mapping", "validation", "complete"], no = [
|
|
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 = ({
|
|
3018
3018
|
template: e,
|
|
3019
3019
|
schema: o,
|
|
3020
3020
|
mode: t = "modal",
|
|
@@ -3028,192 +3028,193 @@ const ot = ({
|
|
|
3028
3028
|
step: u,
|
|
3029
3029
|
sessionId: f,
|
|
3030
3030
|
file: p,
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3031
|
+
rows: g,
|
|
3032
|
+
mappings: c,
|
|
3033
|
+
validationResults: a,
|
|
3034
|
+
isLoading: m,
|
|
3035
|
+
error: v,
|
|
3036
|
+
setSchema: C,
|
|
3037
|
+
setSessionId: w,
|
|
3038
|
+
setParsedData: y,
|
|
3039
|
+
setMappings: x,
|
|
3040
|
+
setUnmapped: $,
|
|
3041
|
+
setValidationResults: F,
|
|
3042
|
+
setStep: P,
|
|
3043
|
+
nextStep: X,
|
|
3044
|
+
previousStep: te,
|
|
3045
|
+
setLoading: A,
|
|
3046
|
+
setError: H,
|
|
3047
|
+
reset: ne
|
|
3048
|
+
} = le(), [k, I] = W(null), [N, V] = W(null), [K, D] = W(0), [Ce, G] = W("");
|
|
3049
|
+
Qe(() => {
|
|
3050
|
+
if (V(null), e)
|
|
3051
|
+
if (Vt(e)) {
|
|
3052
|
+
const _ = Pt(e);
|
|
3053
|
+
_ ? I(_) : (V(`Failed to load template "${e}"`), i == null || i(new Error(`Failed to load template "${e}"`)));
|
|
3053
3054
|
} else {
|
|
3054
|
-
const _ = `Template "${e}" not found. Available templates: ${
|
|
3055
|
-
|
|
3055
|
+
const _ = `Template "${e}" not found. Available templates: ${Je.join(", ")}`;
|
|
3056
|
+
V(_), i == null || i(new Error(_));
|
|
3056
3057
|
}
|
|
3057
3058
|
else if (o)
|
|
3058
|
-
|
|
3059
|
+
I(o);
|
|
3059
3060
|
else {
|
|
3060
|
-
const _ = `No template or schema provided. Please specify a template (${
|
|
3061
|
-
|
|
3061
|
+
const _ = `No template or schema provided. Please specify a template (${Je.join(", ")}) or provide a custom schema.`;
|
|
3062
|
+
V(_), i == null || i(new Error(_));
|
|
3062
3063
|
}
|
|
3063
|
-
}, [e, o, i]),
|
|
3064
|
-
|
|
3065
|
-
}, [
|
|
3066
|
-
const
|
|
3064
|
+
}, [e, o, i]), Qe(() => {
|
|
3065
|
+
k && (C(k), Ke(k));
|
|
3066
|
+
}, [k]);
|
|
3067
|
+
const Ke = async (_) => {
|
|
3067
3068
|
try {
|
|
3068
|
-
|
|
3069
|
-
const
|
|
3070
|
-
|
|
3069
|
+
A(!0);
|
|
3070
|
+
const b = await ae().createImportSession(_);
|
|
3071
|
+
w(b.sessionId);
|
|
3071
3072
|
} catch (M) {
|
|
3072
|
-
const
|
|
3073
|
-
|
|
3073
|
+
const b = M;
|
|
3074
|
+
H(b.message), i == null || i(b);
|
|
3074
3075
|
} finally {
|
|
3075
|
-
|
|
3076
|
+
A(!1);
|
|
3076
3077
|
}
|
|
3077
|
-
},
|
|
3078
|
+
}, ht = (_) => {
|
|
3078
3079
|
const M = [];
|
|
3079
|
-
let
|
|
3080
|
-
for (let
|
|
3081
|
-
const
|
|
3082
|
-
|
|
3080
|
+
let b = "", z = !1;
|
|
3081
|
+
for (let E = 0; E < _.length; E++) {
|
|
3082
|
+
const Q = _[E];
|
|
3083
|
+
Q === '"' ? z && _[E + 1] === '"' ? (b += '"', E++) : z = !z : Q === "," && !z ? (M.push(b.trim()), b = "") : b += Q;
|
|
3083
3084
|
}
|
|
3084
|
-
return M.push(
|
|
3085
|
-
},
|
|
3085
|
+
return M.push(b.trim()), M;
|
|
3086
|
+
}, vt = ze(async (_) => {
|
|
3086
3087
|
if (f)
|
|
3087
3088
|
try {
|
|
3088
|
-
|
|
3089
|
-
const M =
|
|
3090
|
-
|
|
3091
|
-
const
|
|
3092
|
-
|
|
3093
|
-
const
|
|
3094
|
-
`).filter((
|
|
3095
|
-
const
|
|
3096
|
-
return
|
|
3097
|
-
|
|
3089
|
+
A(!0), H(null), x([]), $([], []), F(null), D(10), G("Uploading file...");
|
|
3090
|
+
const M = ae();
|
|
3091
|
+
D(20), G("Uploading to server...");
|
|
3092
|
+
const b = await M.uploadFile(f, _);
|
|
3093
|
+
D(40), G("Parsing all rows...");
|
|
3094
|
+
const E = (await _.text()).split(`
|
|
3095
|
+
`).filter((U) => U.trim()), Q = b.data.headers, B = E.slice(1).map((U, oe) => {
|
|
3096
|
+
const ie = ht(U), Ze = {};
|
|
3097
|
+
return Q.forEach((_t, Ft) => {
|
|
3098
|
+
Ze[_t] = ie[Ft] || "";
|
|
3098
3099
|
}), {
|
|
3099
|
-
rowIndex:
|
|
3100
|
-
data:
|
|
3101
|
-
rawData:
|
|
3100
|
+
rowIndex: oe,
|
|
3101
|
+
data: Ze,
|
|
3102
|
+
rawData: ie
|
|
3102
3103
|
};
|
|
3103
3104
|
});
|
|
3104
|
-
|
|
3105
|
-
headers:
|
|
3106
|
-
rows:
|
|
3107
|
-
totalRows:
|
|
3108
|
-
sampleRows:
|
|
3109
|
-
}),
|
|
3105
|
+
D(60), G("Processing rows..."), y({
|
|
3106
|
+
headers: Q,
|
|
3107
|
+
rows: B,
|
|
3108
|
+
totalRows: B.length,
|
|
3109
|
+
sampleRows: B.slice(0, 5)
|
|
3110
|
+
}), D(80), G("Matching columns..."), P("mapping"), await wt(), D(100), G("Done");
|
|
3110
3111
|
} catch (M) {
|
|
3111
|
-
|
|
3112
|
+
H(`Failed to process the uploaded file: ${M.message}`);
|
|
3112
3113
|
} finally {
|
|
3113
|
-
|
|
3114
|
+
A(!1), D(0), G("");
|
|
3114
3115
|
}
|
|
3115
|
-
}, [f]),
|
|
3116
|
+
}, [f]), wt = async () => {
|
|
3116
3117
|
if (f)
|
|
3117
3118
|
try {
|
|
3118
|
-
|
|
3119
|
-
const M = await
|
|
3120
|
-
|
|
3119
|
+
A(!0);
|
|
3120
|
+
const M = await ae().matchColumns(f);
|
|
3121
|
+
x(M.mappings), $(M.unmappedSource, M.unmappedTarget);
|
|
3121
3122
|
} catch (_) {
|
|
3122
|
-
|
|
3123
|
+
H(`Column matching failed: ${_.message}`);
|
|
3123
3124
|
} finally {
|
|
3124
|
-
|
|
3125
|
+
A(!1);
|
|
3125
3126
|
}
|
|
3126
|
-
},
|
|
3127
|
+
}, Ct = async () => {
|
|
3127
3128
|
if (f)
|
|
3128
3129
|
try {
|
|
3129
|
-
|
|
3130
|
-
const M = await
|
|
3131
|
-
|
|
3130
|
+
A(!0), H(null);
|
|
3131
|
+
const M = await ae().validateImport(f);
|
|
3132
|
+
F(M.validation), X();
|
|
3132
3133
|
} catch (_) {
|
|
3133
|
-
|
|
3134
|
+
H(`Validation failed: ${_.message}`);
|
|
3134
3135
|
} finally {
|
|
3135
|
-
|
|
3136
|
+
A(!1);
|
|
3136
3137
|
}
|
|
3137
|
-
}, [
|
|
3138
|
+
}, [je, de] = W(null), [O, qe] = W(null), yt = async () => {
|
|
3138
3139
|
if (f)
|
|
3139
3140
|
try {
|
|
3140
|
-
|
|
3141
|
-
const
|
|
3141
|
+
A(!0), H(null), de(null);
|
|
3142
|
+
const b = await ae().completeImport(f, {
|
|
3142
3143
|
skipInvalidRows: !0,
|
|
3143
3144
|
acknowledgeWarnings: !0
|
|
3144
|
-
}),
|
|
3145
|
-
...
|
|
3146
|
-
data: (
|
|
3147
|
-
rowIndex:
|
|
3148
|
-
data:
|
|
3149
|
-
wasEdited:
|
|
3150
|
-
} :
|
|
3145
|
+
}), z = {
|
|
3146
|
+
...b,
|
|
3147
|
+
data: (b.data || []).map((E) => E.data && typeof E.data == "object" && !Array.isArray(E.data) ? {
|
|
3148
|
+
rowIndex: E.rowIndex ?? 0,
|
|
3149
|
+
data: E.data,
|
|
3150
|
+
wasEdited: E.wasEdited ?? !1
|
|
3151
|
+
} : E)
|
|
3151
3152
|
};
|
|
3152
|
-
|
|
3153
|
+
qe(z), P("complete"), l == null || l(z);
|
|
3153
3154
|
} catch (_) {
|
|
3154
|
-
|
|
3155
|
+
de(_.message), P("complete");
|
|
3155
3156
|
} finally {
|
|
3156
|
-
|
|
3157
|
+
A(!1);
|
|
3157
3158
|
}
|
|
3158
|
-
},
|
|
3159
|
-
|
|
3160
|
-
},
|
|
3161
|
-
|
|
3162
|
-
},
|
|
3159
|
+
}, ce = () => {
|
|
3160
|
+
ne(), s == null || s();
|
|
3161
|
+
}, Ue = () => {
|
|
3162
|
+
de(null), qe(null), D(0), G(""), ne(), k && (C(k), Ke(k));
|
|
3163
|
+
}, St = () => no.findIndex((_) => _.key === u), Rt = () => {
|
|
3163
3164
|
switch (u) {
|
|
3164
3165
|
case "upload":
|
|
3165
3166
|
return p !== null;
|
|
3166
3167
|
case "mapping":
|
|
3167
|
-
return
|
|
3168
|
+
return c.length > 0 && c.some((_) => _.targetKey !== null);
|
|
3168
3169
|
case "validation":
|
|
3169
|
-
return
|
|
3170
|
+
return a !== null;
|
|
3170
3171
|
case "review":
|
|
3171
|
-
return
|
|
3172
|
+
return a !== null && (a.isValid || a.errorCount === 0);
|
|
3172
3173
|
default:
|
|
3173
3174
|
return !1;
|
|
3174
3175
|
}
|
|
3175
|
-
},
|
|
3176
|
+
}, xt = async () => {
|
|
3176
3177
|
switch (u) {
|
|
3177
3178
|
case "mapping":
|
|
3178
|
-
await
|
|
3179
|
+
await Ct();
|
|
3179
3180
|
break;
|
|
3180
3181
|
case "validation":
|
|
3181
|
-
|
|
3182
|
+
X();
|
|
3182
3183
|
break;
|
|
3183
3184
|
case "review":
|
|
3184
|
-
await
|
|
3185
|
+
await yt();
|
|
3185
3186
|
break;
|
|
3186
3187
|
default:
|
|
3187
|
-
|
|
3188
|
+
X();
|
|
3188
3189
|
}
|
|
3189
3190
|
};
|
|
3190
|
-
if (
|
|
3191
|
-
return /* @__PURE__ */ d(
|
|
3191
|
+
if (N)
|
|
3192
|
+
return /* @__PURE__ */ d(ye, { 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__ */ h("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: [
|
|
3192
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(ve, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-error)" } }) }),
|
|
3193
3194
|
/* @__PURE__ */ d("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Configuration Error" }),
|
|
3194
|
-
/* @__PURE__ */ d("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children:
|
|
3195
|
-
s && /* @__PURE__ */ d("button", { onClick:
|
|
3195
|
+
/* @__PURE__ */ d("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children: N }),
|
|
3196
|
+
s && /* @__PURE__ */ d("button", { onClick: ce, className: "ff-btn ff-btn-secondary", children: "Close" })
|
|
3196
3197
|
] }) }) });
|
|
3197
|
-
if (!
|
|
3198
|
-
return /* @__PURE__ */ d(
|
|
3198
|
+
if (!k)
|
|
3199
|
+
return /* @__PURE__ */ d(ye, { 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__ */ h("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: [
|
|
3199
3200
|
/* @__PURE__ */ d(ge, { className: "ff-w-10 ff-h-10 ff-animate-spin ff-mb-4", style: { color: "var(--ff-primary-90)" } }),
|
|
3200
3201
|
/* @__PURE__ */ d("p", { style: { color: "var(--ff-text-muted)" }, children: "Loading template..." })
|
|
3201
3202
|
] }) }) });
|
|
3202
3203
|
const se = () => {
|
|
3203
3204
|
const _ = u === "review" ? "validation" : u;
|
|
3204
|
-
return
|
|
3205
|
-
},
|
|
3205
|
+
return Me.indexOf(_);
|
|
3206
|
+
}, Xe = /* @__PURE__ */ d(re, { children: /* @__PURE__ */ h("div", { className: t === "embed" ? "ff-container ff-embed" : "ff-container ff-modal", children: [
|
|
3206
3207
|
/* @__PURE__ */ h("div", { className: "ff-modal-header", children: [
|
|
3207
3208
|
/* @__PURE__ */ h("div", { className: "ff-modal-header-left", children: [
|
|
3208
3209
|
/* @__PURE__ */ h("div", { className: "ff-flex ff-items-center ff-gap-3", children: [
|
|
3209
|
-
/* @__PURE__ */ d("div", { className: "ff-modal-icon", children: /* @__PURE__ */ d(
|
|
3210
|
+
/* @__PURE__ */ d("div", { className: "ff-modal-icon", children: /* @__PURE__ */ d(Bt, {}) }),
|
|
3210
3211
|
/* @__PURE__ */ d("h2", { className: "ff-modal-title", children: "Import Data" })
|
|
3211
3212
|
] }),
|
|
3212
|
-
/* @__PURE__ */ d("div", { className: "ff-steps ff-ml-4", children:
|
|
3213
|
+
/* @__PURE__ */ d("div", { className: "ff-steps ff-ml-4", children: Me.map((_, M) => /* @__PURE__ */ h(It.Fragment, { children: [
|
|
3213
3214
|
/* @__PURE__ */ d(
|
|
3214
3215
|
"div",
|
|
3215
3216
|
{
|
|
3216
|
-
className:
|
|
3217
|
+
className: J(
|
|
3217
3218
|
"ff-step",
|
|
3218
3219
|
se() === M && "ff-step-active",
|
|
3219
3220
|
se() > M && "ff-step-complete",
|
|
@@ -3222,7 +3223,7 @@ const ot = ({
|
|
|
3222
3223
|
children: se() > M ? "✓" : M + 1
|
|
3223
3224
|
}
|
|
3224
3225
|
),
|
|
3225
|
-
M <
|
|
3226
|
+
M < Me.length - 1 && /* @__PURE__ */ d("div", { className: J(
|
|
3226
3227
|
"ff-step-connector",
|
|
3227
3228
|
se() > M && "ff-step-connector-complete"
|
|
3228
3229
|
) })
|
|
@@ -3231,120 +3232,118 @@ const ot = ({
|
|
|
3231
3232
|
/* @__PURE__ */ d(
|
|
3232
3233
|
"button",
|
|
3233
3234
|
{
|
|
3234
|
-
onClick:
|
|
3235
|
+
onClick: ce,
|
|
3235
3236
|
className: "ff-modal-close",
|
|
3236
3237
|
children: /* @__PURE__ */ d(ve, { className: "ff-w-5 ff-h-5" })
|
|
3237
3238
|
}
|
|
3238
3239
|
)
|
|
3239
3240
|
] }),
|
|
3240
3241
|
/* @__PURE__ */ h("div", { className: "ff-modal-body", children: [
|
|
3241
|
-
|
|
3242
|
-
u === "upload" && /* @__PURE__ */ d("div", { className: "ff-py-4", children: /* @__PURE__ */ d("div", { className: "ff-max-w-xl ff-mx-auto", children:
|
|
3242
|
+
v && /* @__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: v }),
|
|
3243
|
+
u === "upload" && /* @__PURE__ */ d("div", { className: "ff-py-4", children: /* @__PURE__ */ d("div", { className: "ff-max-w-xl ff-mx-auto", children: m && K > 0 ? /* @__PURE__ */ h("div", { className: "ff-p-8 ff-text-center", children: [
|
|
3243
3244
|
/* @__PURE__ */ d(ge, { className: "ff-w-10 ff-h-10 ff-animate-spin ff-mx-auto ff-mb-4", style: { color: "var(--ff-primary-90)" } }),
|
|
3244
|
-
/* @__PURE__ */ d("p", { className: "ff-font-medium ff-mb-2", style: { color: "var(--ff-text-primary)" }, children:
|
|
3245
|
+
/* @__PURE__ */ d("p", { className: "ff-font-medium ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: Ce }),
|
|
3245
3246
|
/* @__PURE__ */ d("div", { className: "ff-progress ff-w-full ff-max-w-xs ff-mx-auto ff-mb-2", children: /* @__PURE__ */ d(
|
|
3246
3247
|
"div",
|
|
3247
3248
|
{
|
|
3248
3249
|
className: "ff-progress-bar",
|
|
3249
|
-
style: { width: `${
|
|
3250
|
+
style: { width: `${K}%`, transition: "width 0.3s ease" }
|
|
3250
3251
|
}
|
|
3251
3252
|
) }),
|
|
3252
3253
|
/* @__PURE__ */ h("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
3253
|
-
|
|
3254
|
+
K,
|
|
3254
3255
|
"% complete"
|
|
3255
3256
|
] })
|
|
3256
|
-
] }) : /* @__PURE__ */ d(
|
|
3257
|
-
u === "mapping" && (
|
|
3257
|
+
] }) : /* @__PURE__ */ d(tn, { onFileSelect: vt }) }) }),
|
|
3258
|
+
u === "mapping" && (m && K > 0 ? /* @__PURE__ */ h("div", { className: "ff-py-12 ff-text-center", children: [
|
|
3258
3259
|
/* @__PURE__ */ d(ge, { className: "ff-w-10 ff-h-10 ff-animate-spin ff-mx-auto ff-mb-4", style: { color: "var(--ff-primary-90)" } }),
|
|
3259
|
-
/* @__PURE__ */ d("p", { className: "ff-font-medium ff-mb-3", style: { color: "var(--ff-text-primary)" }, children:
|
|
3260
|
+
/* @__PURE__ */ d("p", { className: "ff-font-medium ff-mb-3", style: { color: "var(--ff-text-primary)" }, children: Ce }),
|
|
3260
3261
|
/* @__PURE__ */ d("div", { className: "ff-progress ff-w-full ff-max-w-xs ff-mx-auto ff-mb-2", children: /* @__PURE__ */ d(
|
|
3261
3262
|
"div",
|
|
3262
3263
|
{
|
|
3263
3264
|
className: "ff-progress-bar",
|
|
3264
|
-
style: { width: `${
|
|
3265
|
+
style: { width: `${K}%`, transition: "width 0.3s ease" }
|
|
3265
3266
|
}
|
|
3266
3267
|
) }),
|
|
3267
3268
|
/* @__PURE__ */ h("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
3268
|
-
|
|
3269
|
+
K,
|
|
3269
3270
|
"% complete"
|
|
3270
3271
|
] })
|
|
3271
|
-
] }) : /* @__PURE__ */ d(
|
|
3272
|
+
] }) : /* @__PURE__ */ d(nn, {})),
|
|
3272
3273
|
u === "validation" && /* @__PURE__ */ h("div", { className: "ff-space-y-6", children: [
|
|
3273
|
-
/* @__PURE__ */ d(
|
|
3274
|
-
/* @__PURE__ */ d(
|
|
3274
|
+
/* @__PURE__ */ d(lt, {}),
|
|
3275
|
+
/* @__PURE__ */ d(rt, { editable: !0 })
|
|
3275
3276
|
] }),
|
|
3276
3277
|
u === "review" && /* @__PURE__ */ h("div", { className: "ff-space-y-6", children: [
|
|
3277
|
-
/* @__PURE__ */ d(
|
|
3278
|
-
/* @__PURE__ */ d(
|
|
3278
|
+
/* @__PURE__ */ d(lt, { showDetails: !1 }),
|
|
3279
|
+
/* @__PURE__ */ d(rt, { editable: !1, pageSize: 10 })
|
|
3279
3280
|
] }),
|
|
3280
|
-
u === "complete" && /* @__PURE__ */ d("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children:
|
|
3281
|
+
u === "complete" && /* @__PURE__ */ d("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: je ? /* @__PURE__ */ h(re, { children: [
|
|
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(ve, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-error)" } }) }),
|
|
3282
3283
|
/* @__PURE__ */ d("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Import Failed" }),
|
|
3283
|
-
/* @__PURE__ */ d("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children:
|
|
3284
|
+
/* @__PURE__ */ d("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children: je }),
|
|
3284
3285
|
/* @__PURE__ */ h("div", { className: "ff-flex ff-gap-3", children: [
|
|
3285
3286
|
/* @__PURE__ */ d(
|
|
3286
3287
|
"button",
|
|
3287
3288
|
{
|
|
3288
3289
|
onClick: () => {
|
|
3289
|
-
|
|
3290
|
+
de(null), P("review");
|
|
3290
3291
|
},
|
|
3291
3292
|
className: "ff-btn ff-btn-secondary",
|
|
3292
3293
|
children: "Back to Review"
|
|
3293
3294
|
}
|
|
3294
3295
|
),
|
|
3295
|
-
s && /* @__PURE__ */ d("button", { onClick:
|
|
3296
|
+
s && /* @__PURE__ */ d("button", { onClick: ce, className: "ff-btn ff-btn-secondary", children: "Close" })
|
|
3296
3297
|
] })
|
|
3297
3298
|
] }) : /* @__PURE__ */ h(re, { children: [
|
|
3298
|
-
/* @__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(
|
|
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)" } }) }),
|
|
3299
3300
|
/* @__PURE__ */ d("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Import Complete!" }),
|
|
3300
3301
|
/* @__PURE__ */ d("p", { className: "ff-mb-6", style: { color: "var(--ff-text-muted)" }, children: "Your data has been successfully imported." }),
|
|
3301
|
-
/* @__PURE__ */ h("div", { className: "ff-flex ff-gap-6 ff-mb-6", children: [
|
|
3302
|
+
O && /* @__PURE__ */ h("div", { className: "ff-flex ff-gap-6 ff-mb-6", children: [
|
|
3302
3303
|
/* @__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: [
|
|
3303
|
-
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-text-primary)" }, children:
|
|
3304
|
+
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-text-primary)" }, children: O.totalRows }),
|
|
3304
3305
|
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: "Total Rows" })
|
|
3305
3306
|
] }),
|
|
3306
3307
|
/* @__PURE__ */ h("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: [
|
|
3307
|
-
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-success-dark)" }, children:
|
|
3308
|
+
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-success-dark)" }, children: O.importedRows }),
|
|
3308
3309
|
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-success)" }, children: "Imported" })
|
|
3309
3310
|
] }),
|
|
3310
|
-
|
|
3311
|
-
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-warning-dark)" }, children:
|
|
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 }),
|
|
3312
3313
|
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-warning)" }, children: "Skipped" })
|
|
3313
3314
|
] }),
|
|
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: [
|
|
3315
|
-
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-text-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 }),
|
|
3316
3317
|
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: "Columns Mapped" })
|
|
3317
3318
|
] })
|
|
3318
3319
|
] }),
|
|
3319
|
-
(
|
|
3320
|
-
const
|
|
3321
|
-
return
|
|
3322
|
-
/* @__PURE__ */
|
|
3323
|
-
"Data Preview (first ",
|
|
3324
|
-
_.length,
|
|
3325
|
-
" rows)"
|
|
3326
|
-
] }),
|
|
3320
|
+
(O == null ? void 0 : O.data) && O.importedRows > 0 && (() => {
|
|
3321
|
+
const M = O.data.slice(0, O.importedRows).slice(0, 5), b = M[0], z = (b == null ? void 0 : b.data) || b, E = Object.keys(typeof z == "object" ? z : {}).slice(0, 6), Q = (k == null ? void 0 : k.columns) || [];
|
|
3322
|
+
return E.length === 0 ? null : /* @__PURE__ */ h("div", { className: "ff-w-full ff-mb-6", children: [
|
|
3323
|
+
/* @__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" }),
|
|
3327
3324
|
/* @__PURE__ */ d("div", { className: "ff-table-container ff-max-h-[250px]", children: /* @__PURE__ */ h("table", { className: "ff-table", children: [
|
|
3328
3325
|
/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ h("tr", { children: [
|
|
3329
3326
|
/* @__PURE__ */ d("th", { style: { width: 40 }, children: "#" }),
|
|
3330
|
-
|
|
3331
|
-
const U =
|
|
3332
|
-
return /* @__PURE__ */ d("th", { children: (U == null ? void 0 : U.label) ||
|
|
3327
|
+
E.map((B) => {
|
|
3328
|
+
const U = Q.find((oe) => oe.key === B);
|
|
3329
|
+
return /* @__PURE__ */ d("th", { children: (U == null ? void 0 : U.label) || B }, B);
|
|
3333
3330
|
}),
|
|
3334
|
-
|
|
3331
|
+
E.length < Object.keys(typeof z == "object" ? z : {}).length && /* @__PURE__ */ d("th", { children: "..." })
|
|
3335
3332
|
] }) }),
|
|
3336
|
-
/* @__PURE__ */ d("tbody", { children:
|
|
3337
|
-
const
|
|
3333
|
+
/* @__PURE__ */ d("tbody", { children: M.map((B, U) => {
|
|
3334
|
+
const oe = (B == null ? void 0 : B.data) || B;
|
|
3338
3335
|
return /* @__PURE__ */ h("tr", { children: [
|
|
3339
|
-
/* @__PURE__ */ d("td", { children: /* @__PURE__ */ d("span", { className: "ff-font-mono ff-text-xs", style: { color: "var(--ff-text-muted)" }, children:
|
|
3340
|
-
|
|
3341
|
-
|
|
3336
|
+
/* @__PURE__ */ d("td", { children: /* @__PURE__ */ d("span", { className: "ff-font-mono ff-text-xs", style: { color: "var(--ff-text-muted)" }, children: U + 1 }) }),
|
|
3337
|
+
E.map((ie) => /* @__PURE__ */ d("td", { children: /* @__PURE__ */ d("span", { className: "ff-text-sm ff-truncate ff-block ff-max-w-[150px]", children: String((oe == null ? void 0 : oe[ie]) ?? "—") }) }, ie)),
|
|
3338
|
+
E.length < Object.keys(typeof z == "object" ? z : {}).length && /* @__PURE__ */ d("td", { children: /* @__PURE__ */ d("span", { style: { color: "var(--ff-text-muted)" }, children: "..." }) })
|
|
3342
3339
|
] }, U);
|
|
3343
3340
|
}) })
|
|
3344
3341
|
] }) }),
|
|
3345
|
-
|
|
3346
|
-
"Showing
|
|
3347
|
-
|
|
3342
|
+
O.importedRows > 5 && /* @__PURE__ */ h("p", { className: "ff-text-xs ff-mt-1", style: { color: "var(--ff-text-muted)" }, children: [
|
|
3343
|
+
"Showing ",
|
|
3344
|
+
M.length,
|
|
3345
|
+
" of ",
|
|
3346
|
+
O.importedRows,
|
|
3348
3347
|
" imported rows"
|
|
3349
3348
|
] })
|
|
3350
3349
|
] });
|
|
@@ -3353,24 +3352,24 @@ const ot = ({
|
|
|
3353
3352
|
/* @__PURE__ */ d(
|
|
3354
3353
|
"button",
|
|
3355
3354
|
{
|
|
3356
|
-
onClick:
|
|
3355
|
+
onClick: Ue,
|
|
3357
3356
|
className: "ff-btn ff-btn-primary",
|
|
3358
3357
|
children: "Start New Import"
|
|
3359
3358
|
}
|
|
3360
3359
|
),
|
|
3361
|
-
s && /* @__PURE__ */ d("button", { onClick:
|
|
3360
|
+
s && /* @__PURE__ */ d("button", { onClick: ce, className: "ff-btn ff-btn-secondary", children: "Close" })
|
|
3362
3361
|
] })
|
|
3363
3362
|
] }) })
|
|
3364
3363
|
] }),
|
|
3365
3364
|
/* @__PURE__ */ d("div", { className: "ff-modal-footer", children: u === "complete" ? /* @__PURE__ */ h(re, { children: [
|
|
3366
3365
|
/* @__PURE__ */ d("div", {}),
|
|
3367
|
-
/* @__PURE__ */ d("button", { onClick:
|
|
3366
|
+
/* @__PURE__ */ d("button", { onClick: Ue, className: "ff-btn ff-btn-primary", children: "Start New Import" })
|
|
3368
3367
|
] }) : /* @__PURE__ */ h(re, { children: [
|
|
3369
3368
|
/* @__PURE__ */ d(
|
|
3370
3369
|
"button",
|
|
3371
3370
|
{
|
|
3372
|
-
onClick:
|
|
3373
|
-
disabled:
|
|
3371
|
+
onClick: te,
|
|
3372
|
+
disabled: St() === 0 || m,
|
|
3374
3373
|
className: "ff-btn ff-btn-ghost",
|
|
3375
3374
|
children: "Back"
|
|
3376
3375
|
}
|
|
@@ -3378,10 +3377,10 @@ const ot = ({
|
|
|
3378
3377
|
/* @__PURE__ */ d(
|
|
3379
3378
|
"button",
|
|
3380
3379
|
{
|
|
3381
|
-
onClick:
|
|
3382
|
-
disabled: !
|
|
3380
|
+
onClick: xt,
|
|
3381
|
+
disabled: !Rt() || m,
|
|
3383
3382
|
className: "ff-btn ff-btn-primary",
|
|
3384
|
-
children:
|
|
3383
|
+
children: m ? /* @__PURE__ */ h(re, { children: [
|
|
3385
3384
|
/* @__PURE__ */ d(ge, { className: "ff-w-4 ff-h-4 ff-animate-spin" }),
|
|
3386
3385
|
"Processing..."
|
|
3387
3386
|
] }) : u === "review" ? "Complete Import" : "Continue"
|
|
@@ -3389,14 +3388,14 @@ const ot = ({
|
|
|
3389
3388
|
)
|
|
3390
3389
|
] }) })
|
|
3391
3390
|
] }) });
|
|
3392
|
-
return /* @__PURE__ */ d(
|
|
3391
|
+
return /* @__PURE__ */ d(ye, { theme: n, useShadowDom: r, children: t === "modal" ? /* @__PURE__ */ d("div", { className: "ff-overlay", children: Xe }) : Xe });
|
|
3393
3392
|
};
|
|
3394
3393
|
export {
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3394
|
+
nn as C,
|
|
3395
|
+
rt as D,
|
|
3396
|
+
tn as F,
|
|
3397
|
+
io as I,
|
|
3398
|
+
lt as V,
|
|
3400
3399
|
le as u
|
|
3401
3400
|
};
|
|
3402
|
-
//# sourceMappingURL=ImportWizard-
|
|
3401
|
+
//# sourceMappingURL=ImportWizard-Cux3nYN4.mjs.map
|