@fileflow/sdk 0.1.24 → 0.1.26
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-C_B8FF5o.js +79 -0
- package/dist/ImportWizard-C_B8FF5o.js.map +1 -0
- package/dist/{ImportWizard-CnoaPUwN.mjs → ImportWizard-CdHW2xzf.mjs} +567 -549
- package/dist/ImportWizard-CdHW2xzf.mjs.map +1 -0
- 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
- package/dist/ImportWizard-Bueox6It.js +0 -78
- package/dist/ImportWizard-Bueox6It.js.map +0 -1
- package/dist/ImportWizard-CnoaPUwN.mjs.map +0 -1
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { jsx as d, jsxs as h, Fragment as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { h as q, j as
|
|
1
|
+
import { jsx as d, jsxs as h, Fragment as re } from "react/jsx-runtime";
|
|
2
|
+
import * as Me from "react";
|
|
3
|
+
import Ft, { useCallback as Le, useState as Q, useMemo as Ze, useEffect as We } from "react";
|
|
4
|
+
import { h as q, j as It, k as $t, X as ve, m as ee, U as lt, n as ze, T as Ve, q as Nt, p as Ae, o as Qe, t as Mt, d as Vt, V as Ye, g as ie, S as Ce, 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 Pt = [
|
|
12
12
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
13
13
|
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
14
|
-
],
|
|
14
|
+
], kt = q("arrow-right", Pt);
|
|
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 bt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Et = q("check", bt);
|
|
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 Dt = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Lt = q("chevron-left", Dt);
|
|
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 zt = [
|
|
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
|
+
], At = q("circle-question-mark", zt);
|
|
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 Ht = [
|
|
47
47
|
[
|
|
48
48
|
"path",
|
|
49
49
|
{
|
|
@@ -52,14 +52,14 @@ const Et = [
|
|
|
52
52
|
}
|
|
53
53
|
],
|
|
54
54
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
55
|
-
],
|
|
55
|
+
], Gt = q("eye", Ht);
|
|
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 Ot = [
|
|
63
63
|
[
|
|
64
64
|
"path",
|
|
65
65
|
{
|
|
@@ -72,14 +72,14 @@ const Lt = [
|
|
|
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
|
+
], Tt = q("file-spreadsheet", Ot);
|
|
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 Bt = [
|
|
83
83
|
[
|
|
84
84
|
"path",
|
|
85
85
|
{
|
|
@@ -88,26 +88,26 @@ const At = [
|
|
|
88
88
|
}
|
|
89
89
|
],
|
|
90
90
|
["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }]
|
|
91
|
-
],
|
|
91
|
+
], Kt = q("file", Bt);
|
|
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 jt = [
|
|
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
|
+
], qt = q("git-branch", jt);
|
|
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 Ut = [
|
|
111
111
|
[
|
|
112
112
|
"path",
|
|
113
113
|
{
|
|
@@ -115,33 +115,33 @@ const Tt = [
|
|
|
115
115
|
key: "1a8usu"
|
|
116
116
|
}
|
|
117
117
|
]
|
|
118
|
-
],
|
|
118
|
+
], Xt = q("pen", Ut);
|
|
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 Zt = [
|
|
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
|
+
], Wt = q("square-check-big", Zt);
|
|
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 Qt = [
|
|
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
|
+
], Yt = q("trash-2", Qt), Je = {
|
|
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 Jt(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 Xt(e, o) {
|
|
|
370
370
|
}
|
|
371
371
|
return t;
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function ye(e, o, t) {
|
|
374
374
|
var C;
|
|
375
375
|
const n = [];
|
|
376
376
|
for (const w of e)
|
|
@@ -378,8 +378,8 @@ function Ce(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 N = w.data[y.targetKey] || w.data[y.sourceColumn] || "",
|
|
382
|
-
for (const P of
|
|
381
|
+
const N = w.data[y.targetKey] || w.data[y.sourceColumn] || "", F = Jt(String(N), x);
|
|
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) || [];
|
|
@@ -388,14 +388,14 @@ function Ce(e, o, t) {
|
|
|
388
388
|
if (!y) continue;
|
|
389
389
|
const x = /* @__PURE__ */ new Map();
|
|
390
390
|
for (const N of e) {
|
|
391
|
-
const
|
|
392
|
-
if (!
|
|
393
|
-
const P = x.get(
|
|
394
|
-
P.push(N.rowIndex), x.set(
|
|
391
|
+
const F = String(N.data[w] || N.data[y.sourceColumn] || "").toLowerCase().trim();
|
|
392
|
+
if (!F) continue;
|
|
393
|
+
const P = x.get(F) || [];
|
|
394
|
+
P.push(N.rowIndex), x.set(F, P);
|
|
395
395
|
}
|
|
396
|
-
for (const [N,
|
|
397
|
-
if (
|
|
398
|
-
for (const P of
|
|
396
|
+
for (const [N, F] of x.entries())
|
|
397
|
+
if (F.length > 1)
|
|
398
|
+
for (const P of F.slice(1))
|
|
399
399
|
n.push({
|
|
400
400
|
rowIndex: P,
|
|
401
401
|
columnKey: w,
|
|
@@ -431,13 +431,13 @@ function Ce(e, o, t) {
|
|
|
431
431
|
if (!y) continue;
|
|
432
432
|
const x = /* @__PURE__ */ new Map();
|
|
433
433
|
for (const N of e) {
|
|
434
|
-
const
|
|
435
|
-
if (!
|
|
436
|
-
const P = x.get(
|
|
437
|
-
P.push(N.rowIndex), x.set(
|
|
434
|
+
const F = String(N.data[w] || N.data[y.sourceColumn] || "").toLowerCase().trim();
|
|
435
|
+
if (!F) continue;
|
|
436
|
+
const P = x.get(F) || [];
|
|
437
|
+
P.push(N.rowIndex), x.set(F, P);
|
|
438
438
|
}
|
|
439
|
-
for (const [N,
|
|
440
|
-
|
|
439
|
+
for (const [N, F] of x.entries())
|
|
440
|
+
F.length > 1 && m.push({ columnKey: w, value: N, rowIndices: F });
|
|
441
441
|
}
|
|
442
442
|
const v = {
|
|
443
443
|
byColumn: c,
|
|
@@ -458,8 +458,8 @@ function Ce(e, o, t) {
|
|
|
458
458
|
errorsByRow: l
|
|
459
459
|
};
|
|
460
460
|
}
|
|
461
|
-
const
|
|
462
|
-
...
|
|
461
|
+
const le = It((e, o) => ({
|
|
462
|
+
...Je,
|
|
463
463
|
setSchema: (t) => e({ schema: t }),
|
|
464
464
|
setSessionId: (t) => e({ sessionId: t }),
|
|
465
465
|
setFile: (t) => e({
|
|
@@ -483,6 +483,10 @@ const re = St((e, o) => ({
|
|
|
483
483
|
unmappedTarget: n
|
|
484
484
|
}),
|
|
485
485
|
setValidationResults: (t) => {
|
|
486
|
+
if (!t) {
|
|
487
|
+
e({ validationResults: null, errorsByRow: /* @__PURE__ */ new Map() });
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
486
490
|
const n = /* @__PURE__ */ new Map();
|
|
487
491
|
for (const r of t.errors) {
|
|
488
492
|
const l = n.get(r.rowIndex) || [];
|
|
@@ -493,7 +497,7 @@ const re = St((e, o) => ({
|
|
|
493
497
|
revalidate: () => {
|
|
494
498
|
const t = o();
|
|
495
499
|
if (!t.schema || !t.validationResults) return;
|
|
496
|
-
const { validationResults: n, errorsByRow: r } =
|
|
500
|
+
const { validationResults: n, errorsByRow: r } = ye(
|
|
497
501
|
t.rows,
|
|
498
502
|
t.schema,
|
|
499
503
|
t.mappings
|
|
@@ -518,7 +522,7 @@ const re = St((e, o) => ({
|
|
|
518
522
|
i && (i.data = { ...i.data, [n]: String(r) });
|
|
519
523
|
const u = new Set(l.editedRows);
|
|
520
524
|
if (u.add(t), e({ rows: s, editedRows: u, editingCell: null }), l.schema && l.validationResults) {
|
|
521
|
-
const { validationResults: f, errorsByRow: p } =
|
|
525
|
+
const { validationResults: f, errorsByRow: p } = ye(
|
|
522
526
|
s,
|
|
523
527
|
l.schema,
|
|
524
528
|
l.mappings
|
|
@@ -532,7 +536,7 @@ const re = St((e, o) => ({
|
|
|
532
536
|
rows: l,
|
|
533
537
|
totalRows: l.length
|
|
534
538
|
}), n.schema && n.validationResults) {
|
|
535
|
-
const { validationResults: s, errorsByRow: i } =
|
|
539
|
+
const { validationResults: s, errorsByRow: i } = ye(
|
|
536
540
|
l,
|
|
537
541
|
n.schema,
|
|
538
542
|
n.mappings
|
|
@@ -543,14 +547,14 @@ const re = St((e, o) => ({
|
|
|
543
547
|
setStatus: (t) => e({ status: t }),
|
|
544
548
|
setLoading: (t) => e({ isLoading: t }),
|
|
545
549
|
setError: (t) => e({ error: t }),
|
|
546
|
-
reset: () => e(
|
|
547
|
-
})),
|
|
550
|
+
reset: () => e(Je)
|
|
551
|
+
})), en = ({
|
|
548
552
|
onFileSelect: e,
|
|
549
553
|
maxSize: o = 50 * 1024 * 1024,
|
|
550
554
|
// 50MB
|
|
551
555
|
acceptedTypes: t = [".csv", ".xlsx", ".xls"]
|
|
552
556
|
}) => {
|
|
553
|
-
const { file: n, fileName: r, fileSize: l, setFile: s, error: i, setError: u, isLoading: f } =
|
|
557
|
+
const { file: n, fileName: r, fileSize: l, setFile: s, error: i, setError: u, isLoading: f } = le(), p = Le(
|
|
554
558
|
(C, w) => {
|
|
555
559
|
if (w.length > 0) {
|
|
556
560
|
u("Invalid file type or file too large");
|
|
@@ -562,7 +566,7 @@ const re = St((e, o) => ({
|
|
|
562
566
|
}
|
|
563
567
|
},
|
|
564
568
|
[e, s, u]
|
|
565
|
-
), { getRootProps: g, getInputProps: c, isDragActive: a } =
|
|
569
|
+
), { getRootProps: g, getInputProps: c, isDragActive: a } = $t({
|
|
566
570
|
onDrop: p,
|
|
567
571
|
accept: {
|
|
568
572
|
"text/csv": [".csv"],
|
|
@@ -573,10 +577,10 @@ const re = St((e, o) => ({
|
|
|
573
577
|
multiple: !1,
|
|
574
578
|
disabled: f
|
|
575
579
|
}), m = (C) => C < 1024 ? `${C} B` : C < 1024 * 1024 ? `${(C / 1024).toFixed(1)} KB` : `${(C / (1024 * 1024)).toFixed(1)} MB`, v = (C) => {
|
|
576
|
-
C.stopPropagation(),
|
|
580
|
+
C.stopPropagation(), le.getState().reset();
|
|
577
581
|
};
|
|
578
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: [
|
|
579
|
-
/* @__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(Kt, { className: "ff-w-6 ff-h-6", style: { color: "var(--ff-success)" } }) }),
|
|
580
584
|
/* @__PURE__ */ h("div", { className: "ff-flex-1 ff-min-w-0", children: [
|
|
581
585
|
/* @__PURE__ */ d("p", { className: "ff-font-medium ff-truncate", style: { color: "var(--ff-success-dark)" }, children: r }),
|
|
582
586
|
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-success)" }, children: m(l || 0) })
|
|
@@ -588,7 +592,7 @@ const re = St((e, o) => ({
|
|
|
588
592
|
className: "ff-p-1.5 ff-rounded-full ff-transition-colors",
|
|
589
593
|
style: { color: "var(--ff-success)" },
|
|
590
594
|
"aria-label": "Remove file",
|
|
591
|
-
children: /* @__PURE__ */ d(
|
|
595
|
+
children: /* @__PURE__ */ d(ve, { className: "ff-w-5 ff-h-5" })
|
|
592
596
|
}
|
|
593
597
|
)
|
|
594
598
|
] }) }) : /* @__PURE__ */ h("div", { className: "ff-space-y-6", children: [
|
|
@@ -596,17 +600,17 @@ const re = St((e, o) => ({
|
|
|
596
600
|
"div",
|
|
597
601
|
{
|
|
598
602
|
...g(),
|
|
599
|
-
className:
|
|
603
|
+
className: ee(
|
|
600
604
|
"ff-dropzone",
|
|
601
605
|
a && "ff-dropzone-active",
|
|
602
606
|
f && "ff-opacity-50 ff-cursor-not-allowed"
|
|
603
607
|
),
|
|
604
608
|
children: [
|
|
605
609
|
/* @__PURE__ */ d("input", { ...c() }),
|
|
606
|
-
/* @__PURE__ */ d("div", { className: "ff-dropzone-icon-wrapper", children: /* @__PURE__ */ d(
|
|
610
|
+
/* @__PURE__ */ d("div", { className: "ff-dropzone-icon-wrapper", children: /* @__PURE__ */ d(lt, { className: "ff-dropzone-icon" }) }),
|
|
607
611
|
/* @__PURE__ */ d("h3", { className: "ff-dropzone-text", children: a ? "Drop your file here" : "Upload your file" }),
|
|
608
612
|
/* @__PURE__ */ d("p", { className: "ff-dropzone-hint", children: "Drag and drop or click to select" }),
|
|
609
|
-
/* @__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: ee(
|
|
610
614
|
"ff-btn ff-btn-primary",
|
|
611
615
|
f && "ff-opacity-50 ff-cursor-wait"
|
|
612
616
|
), children: f ? "Processing..." : "Choose file" }) }),
|
|
@@ -620,12 +624,12 @@ const re = St((e, o) => ({
|
|
|
620
624
|
}
|
|
621
625
|
),
|
|
622
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: [
|
|
623
|
-
/* @__PURE__ */ d(
|
|
627
|
+
/* @__PURE__ */ d(ze, { className: "ff-w-4 ff-h-4 ff-flex-shrink-0" }),
|
|
624
628
|
/* @__PURE__ */ d("p", { children: i })
|
|
625
629
|
] })
|
|
626
630
|
] });
|
|
627
|
-
},
|
|
628
|
-
const { mappings: o, schema: t, unmappedSource: n, updateMapping: r } =
|
|
631
|
+
}, tn = ({ onMappingChange: e }) => {
|
|
632
|
+
const { mappings: o, schema: t, unmappedSource: n, updateMapping: r } = le(), l = (t == null ? void 0 : t.columns) || [], s = (g, c) => {
|
|
629
633
|
const a = c === "" ? null : c;
|
|
630
634
|
r(g, a), e == null || e(g, a);
|
|
631
635
|
}, i = (g) => g >= 0.85 ? "var(--ff-success)" : g >= 0.6 ? "var(--ff-warning)" : "var(--ff-error)", u = (g) => g >= 0.85 ? "High" : g >= 0.6 ? "Medium" : "Low", p = new Set(
|
|
@@ -658,14 +662,14 @@ const re = St((e, o) => ({
|
|
|
658
662
|
return /* @__PURE__ */ h(
|
|
659
663
|
"div",
|
|
660
664
|
{
|
|
661
|
-
className:
|
|
665
|
+
className: ee(
|
|
662
666
|
"ff-mapping-row",
|
|
663
667
|
c && a && "ff-mapping-row-success",
|
|
664
668
|
c && !a && "ff-mapping-row-warning"
|
|
665
669
|
),
|
|
666
670
|
children: [
|
|
667
671
|
/* @__PURE__ */ d("div", { className: "ff-flex-1", children: /* @__PURE__ */ d("div", { className: "ff-mapping-source", children: g.sourceColumn }) }),
|
|
668
|
-
/* @__PURE__ */ d("div", { className: "ff-mapping-arrow", children: /* @__PURE__ */ d(
|
|
672
|
+
/* @__PURE__ */ d("div", { className: "ff-mapping-arrow", children: /* @__PURE__ */ d(kt, { className: "ff-w-5 ff-h-5" }) }),
|
|
669
673
|
/* @__PURE__ */ d("div", { className: "ff-flex-1 ff-mapping-target", children: /* @__PURE__ */ h(
|
|
670
674
|
"select",
|
|
671
675
|
{
|
|
@@ -692,7 +696,7 @@ const re = St((e, o) => ({
|
|
|
692
696
|
]
|
|
693
697
|
}
|
|
694
698
|
) }),
|
|
695
|
-
/* @__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(Et, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ d(At, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-warning)" } }) : /* @__PURE__ */ d("span", { className: "ff-w-5 ff-h-5" }) }),
|
|
696
700
|
g.confidence > 0 && /* @__PURE__ */ h("div", { className: "ff-confidence", style: { color: i(g.confidence) }, children: [
|
|
697
701
|
/* @__PURE__ */ h("span", { children: [
|
|
698
702
|
Math.round(g.confidence * 100),
|
|
@@ -714,7 +718,7 @@ const re = St((e, o) => ({
|
|
|
714
718
|
(c) => c.required && !p.has(c.key)
|
|
715
719
|
);
|
|
716
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: [
|
|
717
|
-
/* @__PURE__ */ d(
|
|
721
|
+
/* @__PURE__ */ d(ze, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
|
|
718
722
|
/* @__PURE__ */ h("div", { children: [
|
|
719
723
|
/* @__PURE__ */ d("p", { className: "ff-text-sm ff-font-medium", style: { color: "var(--ff-warning-dark)" }, children: "Required fields not mapped" }),
|
|
720
724
|
/* @__PURE__ */ d("p", { className: "ff-text-sm ff-mt-1", style: { color: "var(--ff-warning)" }, children: g.map((c) => c.label).join(", ") })
|
|
@@ -733,7 +737,7 @@ const re = St((e, o) => ({
|
|
|
733
737
|
*
|
|
734
738
|
* @license MIT
|
|
735
739
|
*/
|
|
736
|
-
function
|
|
740
|
+
function nn() {
|
|
737
741
|
return {
|
|
738
742
|
accessor: (e, o) => typeof e == "function" ? {
|
|
739
743
|
...o,
|
|
@@ -746,24 +750,24 @@ function Yt() {
|
|
|
746
750
|
group: (e) => e
|
|
747
751
|
};
|
|
748
752
|
}
|
|
749
|
-
function
|
|
753
|
+
function J(e, o) {
|
|
750
754
|
return typeof e == "function" ? e(o) : e;
|
|
751
755
|
}
|
|
752
|
-
function
|
|
756
|
+
function T(e, o) {
|
|
753
757
|
return (t) => {
|
|
754
758
|
o.setState((n) => ({
|
|
755
759
|
...n,
|
|
756
|
-
[e]:
|
|
760
|
+
[e]: J(t, n[e])
|
|
757
761
|
}));
|
|
758
762
|
};
|
|
759
763
|
}
|
|
760
|
-
function
|
|
764
|
+
function we(e) {
|
|
761
765
|
return e instanceof Function;
|
|
762
766
|
}
|
|
763
|
-
function
|
|
767
|
+
function on(e) {
|
|
764
768
|
return Array.isArray(e) && e.every((o) => typeof o == "number");
|
|
765
769
|
}
|
|
766
|
-
function
|
|
770
|
+
function rn(e, o) {
|
|
767
771
|
const t = [], n = (r) => {
|
|
768
772
|
r.forEach((l) => {
|
|
769
773
|
t.push(l);
|
|
@@ -807,7 +811,7 @@ function R(e, o, t, n) {
|
|
|
807
811
|
onChange: n
|
|
808
812
|
};
|
|
809
813
|
}
|
|
810
|
-
function
|
|
814
|
+
function ln(e, o, t, n) {
|
|
811
815
|
const r = () => {
|
|
812
816
|
var s;
|
|
813
817
|
return (s = l.getValue()) != null ? s : e.options.renderFallbackValue;
|
|
@@ -830,7 +834,7 @@ function en(e, o, t, n) {
|
|
|
830
834
|
s.createCell == null || s.createCell(l, t, o, e);
|
|
831
835
|
}, {}), l;
|
|
832
836
|
}
|
|
833
|
-
function
|
|
837
|
+
function sn(e, o, t, n) {
|
|
834
838
|
var r, l;
|
|
835
839
|
const i = {
|
|
836
840
|
...e._getDefaultColumnDef(),
|
|
@@ -870,8 +874,8 @@ function tn(e, o, t, n) {
|
|
|
870
874
|
c.createColumn == null || c.createColumn(g, e);
|
|
871
875
|
return g;
|
|
872
876
|
}
|
|
873
|
-
const
|
|
874
|
-
function
|
|
877
|
+
const A = "debugHeaders";
|
|
878
|
+
function et(e, o, t) {
|
|
875
879
|
var n;
|
|
876
880
|
let l = {
|
|
877
881
|
id: (n = t.id) != null ? n : o.id,
|
|
@@ -900,36 +904,36 @@ function Qe(e, o, t) {
|
|
|
900
904
|
s.createHeader == null || s.createHeader(l, e);
|
|
901
905
|
}), l;
|
|
902
906
|
}
|
|
903
|
-
const
|
|
907
|
+
const an = {
|
|
904
908
|
createTable: (e) => {
|
|
905
909
|
e.getHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => {
|
|
906
910
|
var l, s;
|
|
907
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)));
|
|
908
|
-
return
|
|
909
|
-
}, R(e.options,
|
|
912
|
+
return pe(o, [...i, ...f, ...u], e);
|
|
913
|
+
}, R(e.options, A, "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, A, "getCenterHeaderGroups")), e.getLeftHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
|
|
910
914
|
var r;
|
|
911
915
|
const l = (r = n == null ? void 0 : n.map((s) => t.find((i) => i.id === s)).filter(Boolean)) != null ? r : [];
|
|
912
|
-
return
|
|
913
|
-
}, R(e.options,
|
|
916
|
+
return pe(o, l, e, "left");
|
|
917
|
+
}, R(e.options, A, "getLeftHeaderGroups")), e.getRightHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
|
|
914
918
|
var r;
|
|
915
919
|
const l = (r = n == null ? void 0 : n.map((s) => t.find((i) => i.id === s)).filter(Boolean)) != null ? r : [];
|
|
916
|
-
return
|
|
917
|
-
}, R(e.options,
|
|
920
|
+
return pe(o, l, e, "right");
|
|
921
|
+
}, R(e.options, A, "getRightHeaderGroups")), e.getFooterGroups = S(() => [e.getHeaderGroups()], (o) => [...o].reverse(), R(e.options, A, "getFooterGroups")), e.getLeftFooterGroups = S(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), R(e.options, A, "getLeftFooterGroups")), e.getCenterFooterGroups = S(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), R(e.options, A, "getCenterFooterGroups")), e.getRightFooterGroups = S(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), R(e.options, A, "getRightFooterGroups")), e.getFlatHeaders = S(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, A, "getFlatHeaders")), e.getLeftFlatHeaders = S(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, A, "getLeftFlatHeaders")), e.getCenterFlatHeaders = S(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, A, "getCenterFlatHeaders")), e.getRightFlatHeaders = S(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, A, "getRightFlatHeaders")), e.getCenterLeafHeaders = S(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
|
|
918
922
|
var n;
|
|
919
923
|
return !((n = t.subHeaders) != null && n.length);
|
|
920
|
-
}), R(e.options,
|
|
924
|
+
}), R(e.options, A, "getCenterLeafHeaders")), e.getLeftLeafHeaders = S(() => [e.getLeftFlatHeaders()], (o) => o.filter((t) => {
|
|
921
925
|
var n;
|
|
922
926
|
return !((n = t.subHeaders) != null && n.length);
|
|
923
|
-
}), R(e.options,
|
|
927
|
+
}), R(e.options, A, "getLeftLeafHeaders")), e.getRightLeafHeaders = S(() => [e.getRightFlatHeaders()], (o) => o.filter((t) => {
|
|
924
928
|
var n;
|
|
925
929
|
return !((n = t.subHeaders) != null && n.length);
|
|
926
|
-
}), R(e.options,
|
|
930
|
+
}), R(e.options, A, "getRightLeafHeaders")), e.getLeafHeaders = S(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
|
|
927
931
|
var r, l, s, i, u, f;
|
|
928
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();
|
|
929
|
-
}, R(e.options,
|
|
933
|
+
}, R(e.options, A, "getLeafHeaders"));
|
|
930
934
|
}
|
|
931
935
|
};
|
|
932
|
-
function
|
|
936
|
+
function pe(e, o, t, n) {
|
|
933
937
|
var r, l;
|
|
934
938
|
let s = 0;
|
|
935
939
|
const i = function(c, a) {
|
|
@@ -952,18 +956,18 @@ function ge(e, o, t, n) {
|
|
|
952
956
|
if (y && C.column.parent ? x = C.column.parent : (x = C.column, N = !0), w && (w == null ? void 0 : w.column) === x)
|
|
953
957
|
w.subHeaders.push(C);
|
|
954
958
|
else {
|
|
955
|
-
const
|
|
959
|
+
const F = et(t, x, {
|
|
956
960
|
id: [n, a, x.id, C == null ? void 0 : C.id].filter(Boolean).join("_"),
|
|
957
961
|
isPlaceholder: N,
|
|
958
962
|
placeholderId: N ? `${v.filter((P) => P.column === x).length}` : void 0,
|
|
959
963
|
depth: a,
|
|
960
964
|
index: v.length
|
|
961
965
|
});
|
|
962
|
-
|
|
966
|
+
F.subHeaders.push(C), v.push(F);
|
|
963
967
|
}
|
|
964
968
|
m.headers.push(C), C.headerGroup = m;
|
|
965
969
|
}), u.push(m), a > 0 && f(v, a - 1);
|
|
966
|
-
}, p = o.map((c, a) =>
|
|
970
|
+
}, p = o.map((c, a) => et(t, c, {
|
|
967
971
|
depth: s,
|
|
968
972
|
index: a
|
|
969
973
|
}));
|
|
@@ -973,9 +977,9 @@ function ge(e, o, t, n) {
|
|
|
973
977
|
m.subHeaders && m.subHeaders.length ? (w = [], g(m.subHeaders).forEach((x) => {
|
|
974
978
|
let {
|
|
975
979
|
colSpan: N,
|
|
976
|
-
rowSpan:
|
|
980
|
+
rowSpan: F
|
|
977
981
|
} = x;
|
|
978
|
-
v += N, w.push(
|
|
982
|
+
v += N, w.push(F);
|
|
979
983
|
})) : v = 1;
|
|
980
984
|
const y = Math.min(...w);
|
|
981
985
|
return C = C + y, m.colSpan = v, m.rowSpan = C, {
|
|
@@ -985,7 +989,7 @@ function ge(e, o, t, n) {
|
|
|
985
989
|
});
|
|
986
990
|
return g((r = (l = u[0]) == null ? void 0 : l.headers) != null ? r : []), u;
|
|
987
991
|
}
|
|
988
|
-
const
|
|
992
|
+
const He = (e, o, t, n, r, l, s) => {
|
|
989
993
|
let i = {
|
|
990
994
|
id: o,
|
|
991
995
|
index: n,
|
|
@@ -1013,7 +1017,7 @@ const Ae = (e, o, t, n, r, l, s) => {
|
|
|
1013
1017
|
return (f = i.getValue(u)) != null ? f : e.options.renderFallbackValue;
|
|
1014
1018
|
},
|
|
1015
1019
|
subRows: [],
|
|
1016
|
-
getLeafRows: () =>
|
|
1020
|
+
getLeafRows: () => rn(i.subRows, (u) => u.subRows),
|
|
1017
1021
|
getParentRow: () => i.parentId ? e.getRow(i.parentId, !0) : void 0,
|
|
1018
1022
|
getParentRows: () => {
|
|
1019
1023
|
let u = [], f = i;
|
|
@@ -1024,7 +1028,7 @@ const Ae = (e, o, t, n, r, l, s) => {
|
|
|
1024
1028
|
}
|
|
1025
1029
|
return u.reverse();
|
|
1026
1030
|
},
|
|
1027
|
-
getAllCells: S(() => [e.getAllLeafColumns()], (u) => u.map((f) =>
|
|
1031
|
+
getAllCells: S(() => [e.getAllLeafColumns()], (u) => u.map((f) => ln(e, i, f, f.id)), R(e.options, "debugRows", "getAllCells")),
|
|
1028
1032
|
_getAllCellsByColumnId: S(() => [i.getAllCells()], (u) => u.reduce((f, p) => (f[p.column.id] = p, f), {}), R(e.options, "debugRows", "getAllCellsByColumnId"))
|
|
1029
1033
|
};
|
|
1030
1034
|
for (let u = 0; u < e._features.length; u++) {
|
|
@@ -1032,54 +1036,54 @@ const Ae = (e, o, t, n, r, l, s) => {
|
|
|
1032
1036
|
f == null || f.createRow == null || f.createRow(i, e);
|
|
1033
1037
|
}
|
|
1034
1038
|
return i;
|
|
1035
|
-
},
|
|
1039
|
+
}, un = {
|
|
1036
1040
|
createColumn: (e, o) => {
|
|
1037
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 = () => {
|
|
1038
1042
|
if (e._getFacetedMinMaxValues)
|
|
1039
1043
|
return e._getFacetedMinMaxValues();
|
|
1040
1044
|
};
|
|
1041
1045
|
}
|
|
1042
|
-
},
|
|
1046
|
+
}, st = (e, o, t) => {
|
|
1043
1047
|
var n, r;
|
|
1044
1048
|
const l = t == null || (n = t.toString()) == null ? void 0 : n.toLowerCase();
|
|
1045
1049
|
return !!(!((r = e.getValue(o)) == null || (r = r.toString()) == null || (r = r.toLowerCase()) == null) && r.includes(l));
|
|
1046
1050
|
};
|
|
1047
|
-
|
|
1048
|
-
const
|
|
1051
|
+
st.autoRemove = (e) => j(e);
|
|
1052
|
+
const it = (e, o, t) => {
|
|
1049
1053
|
var n;
|
|
1050
1054
|
return !!(!((n = e.getValue(o)) == null || (n = n.toString()) == null) && n.includes(t));
|
|
1051
1055
|
};
|
|
1052
|
-
|
|
1053
|
-
const
|
|
1056
|
+
it.autoRemove = (e) => j(e);
|
|
1057
|
+
const at = (e, o, t) => {
|
|
1054
1058
|
var n;
|
|
1055
1059
|
return ((n = e.getValue(o)) == null || (n = n.toString()) == null ? void 0 : n.toLowerCase()) === (t == null ? void 0 : t.toLowerCase());
|
|
1056
1060
|
};
|
|
1057
|
-
|
|
1058
|
-
const
|
|
1061
|
+
at.autoRemove = (e) => j(e);
|
|
1062
|
+
const ut = (e, o, t) => {
|
|
1059
1063
|
var n;
|
|
1060
1064
|
return (n = e.getValue(o)) == null ? void 0 : n.includes(t);
|
|
1061
1065
|
};
|
|
1062
|
-
|
|
1063
|
-
const
|
|
1066
|
+
ut.autoRemove = (e) => j(e);
|
|
1067
|
+
const ft = (e, o, t) => !t.some((n) => {
|
|
1064
1068
|
var r;
|
|
1065
1069
|
return !((r = e.getValue(o)) != null && r.includes(n));
|
|
1066
1070
|
});
|
|
1067
|
-
|
|
1068
|
-
const
|
|
1071
|
+
ft.autoRemove = (e) => j(e) || !(e != null && e.length);
|
|
1072
|
+
const dt = (e, o, t) => t.some((n) => {
|
|
1069
1073
|
var r;
|
|
1070
1074
|
return (r = e.getValue(o)) == null ? void 0 : r.includes(n);
|
|
1071
1075
|
});
|
|
1072
|
-
|
|
1073
|
-
const
|
|
1074
|
-
|
|
1075
|
-
const
|
|
1076
|
-
|
|
1077
|
-
const
|
|
1076
|
+
dt.autoRemove = (e) => j(e) || !(e != null && e.length);
|
|
1077
|
+
const ct = (e, o, t) => e.getValue(o) === t;
|
|
1078
|
+
ct.autoRemove = (e) => j(e);
|
|
1079
|
+
const gt = (e, o, t) => e.getValue(o) == t;
|
|
1080
|
+
gt.autoRemove = (e) => j(e);
|
|
1081
|
+
const Ge = (e, o, t) => {
|
|
1078
1082
|
let [n, r] = t;
|
|
1079
1083
|
const l = e.getValue(o);
|
|
1080
1084
|
return l >= n && l <= r;
|
|
1081
1085
|
};
|
|
1082
|
-
|
|
1086
|
+
Ge.resolveFilterValue = (e) => {
|
|
1083
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;
|
|
1084
1088
|
if (l > s) {
|
|
1085
1089
|
const i = l;
|
|
@@ -1087,22 +1091,22 @@ He.resolveFilterValue = (e) => {
|
|
|
1087
1091
|
}
|
|
1088
1092
|
return [l, s];
|
|
1089
1093
|
};
|
|
1090
|
-
|
|
1091
|
-
const
|
|
1092
|
-
includesString:
|
|
1093
|
-
includesStringSensitive:
|
|
1094
|
-
equalsString:
|
|
1095
|
-
arrIncludes:
|
|
1096
|
-
arrIncludesAll:
|
|
1097
|
-
arrIncludesSome:
|
|
1098
|
-
equals:
|
|
1099
|
-
weakEquals:
|
|
1100
|
-
inNumberRange:
|
|
1094
|
+
Ge.autoRemove = (e) => j(e) || j(e[0]) && j(e[1]);
|
|
1095
|
+
const W = {
|
|
1096
|
+
includesString: st,
|
|
1097
|
+
includesStringSensitive: it,
|
|
1098
|
+
equalsString: at,
|
|
1099
|
+
arrIncludes: ut,
|
|
1100
|
+
arrIncludesAll: ft,
|
|
1101
|
+
arrIncludesSome: dt,
|
|
1102
|
+
equals: ct,
|
|
1103
|
+
weakEquals: gt,
|
|
1104
|
+
inNumberRange: Ge
|
|
1101
1105
|
};
|
|
1102
1106
|
function j(e) {
|
|
1103
1107
|
return e == null || e === "";
|
|
1104
1108
|
}
|
|
1105
|
-
const
|
|
1109
|
+
const fn = {
|
|
1106
1110
|
getDefaultColumnDef: () => ({
|
|
1107
1111
|
filterFn: "auto"
|
|
1108
1112
|
}),
|
|
@@ -1111,19 +1115,19 @@ const rn = {
|
|
|
1111
1115
|
...e
|
|
1112
1116
|
}),
|
|
1113
1117
|
getDefaultOptions: (e) => ({
|
|
1114
|
-
onColumnFiltersChange:
|
|
1118
|
+
onColumnFiltersChange: T("columnFilters", e),
|
|
1115
1119
|
filterFromLeafRows: !1,
|
|
1116
1120
|
maxLeafRowFilterDepth: 100
|
|
1117
1121
|
}),
|
|
1118
1122
|
createColumn: (e, o) => {
|
|
1119
1123
|
e.getAutoFilterFn = () => {
|
|
1120
1124
|
const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
|
|
1121
|
-
return typeof n == "string" ?
|
|
1125
|
+
return typeof n == "string" ? W.includesString : typeof n == "number" ? W.inNumberRange : typeof n == "boolean" || n !== null && typeof n == "object" ? W.equals : Array.isArray(n) ? W.arrIncludes : W.weakEquals;
|
|
1122
1126
|
}, e.getFilterFn = () => {
|
|
1123
1127
|
var t, n;
|
|
1124
|
-
return
|
|
1128
|
+
return we(e.columnDef.filterFn) ? e.columnDef.filterFn : e.columnDef.filterFn === "auto" ? e.getAutoFilterFn() : (
|
|
1125
1129
|
// @ts-ignore
|
|
1126
|
-
(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 : W[e.columnDef.filterFn]
|
|
1127
1131
|
);
|
|
1128
1132
|
}, e.getCanFilter = () => {
|
|
1129
1133
|
var t, n, r;
|
|
@@ -1136,8 +1140,8 @@ const rn = {
|
|
|
1136
1140
|
return (t = (n = o.getState().columnFilters) == null ? void 0 : n.findIndex((r) => r.id === e.id)) != null ? t : -1;
|
|
1137
1141
|
}, e.setFilterValue = (t) => {
|
|
1138
1142
|
o.setColumnFilters((n) => {
|
|
1139
|
-
const r = e.getFilterFn(), l = n == null ? void 0 : n.find((p) => p.id === e.id), s =
|
|
1140
|
-
if (
|
|
1143
|
+
const r = e.getFilterFn(), l = n == null ? void 0 : n.find((p) => p.id === e.id), s = J(t, l ? l.value : void 0);
|
|
1144
|
+
if (tt(r, s, e)) {
|
|
1141
1145
|
var i;
|
|
1142
1146
|
return (i = n == null ? void 0 : n.filter((p) => p.id !== e.id)) != null ? i : [];
|
|
1143
1147
|
}
|
|
@@ -1160,11 +1164,11 @@ const rn = {
|
|
|
1160
1164
|
e.setColumnFilters = (o) => {
|
|
1161
1165
|
const t = e.getAllLeafColumns(), n = (r) => {
|
|
1162
1166
|
var l;
|
|
1163
|
-
return (l =
|
|
1167
|
+
return (l = J(o, r)) == null ? void 0 : l.filter((s) => {
|
|
1164
1168
|
const i = t.find((u) => u.id === s.id);
|
|
1165
1169
|
if (i) {
|
|
1166
1170
|
const u = i.getFilterFn();
|
|
1167
|
-
if (
|
|
1171
|
+
if (tt(u, s.value, i))
|
|
1168
1172
|
return !1;
|
|
1169
1173
|
}
|
|
1170
1174
|
return !0;
|
|
@@ -1177,57 +1181,57 @@ const rn = {
|
|
|
1177
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());
|
|
1178
1182
|
}
|
|
1179
1183
|
};
|
|
1180
|
-
function
|
|
1184
|
+
function tt(e, o, t) {
|
|
1181
1185
|
return (e && e.autoRemove ? e.autoRemove(o, t) : !1) || typeof o > "u" || typeof o == "string" && !o;
|
|
1182
1186
|
}
|
|
1183
|
-
const
|
|
1187
|
+
const dn = (e, o, t) => t.reduce((n, r) => {
|
|
1184
1188
|
const l = r.getValue(e);
|
|
1185
1189
|
return n + (typeof l == "number" ? l : 0);
|
|
1186
|
-
}, 0),
|
|
1190
|
+
}, 0), cn = (e, o, t) => {
|
|
1187
1191
|
let n;
|
|
1188
1192
|
return t.forEach((r) => {
|
|
1189
1193
|
const l = r.getValue(e);
|
|
1190
1194
|
l != null && (n > l || n === void 0 && l >= l) && (n = l);
|
|
1191
1195
|
}), n;
|
|
1192
|
-
},
|
|
1196
|
+
}, gn = (e, o, t) => {
|
|
1193
1197
|
let n;
|
|
1194
1198
|
return t.forEach((r) => {
|
|
1195
1199
|
const l = r.getValue(e);
|
|
1196
1200
|
l != null && (n < l || n === void 0 && l >= l) && (n = l);
|
|
1197
1201
|
}), n;
|
|
1198
|
-
},
|
|
1202
|
+
}, pn = (e, o, t) => {
|
|
1199
1203
|
let n, r;
|
|
1200
1204
|
return t.forEach((l) => {
|
|
1201
1205
|
const s = l.getValue(e);
|
|
1202
1206
|
s != null && (n === void 0 ? s >= s && (n = r = s) : (n > s && (n = s), r < s && (r = s)));
|
|
1203
1207
|
}), [n, r];
|
|
1204
|
-
},
|
|
1208
|
+
}, mn = (e, o) => {
|
|
1205
1209
|
let t = 0, n = 0;
|
|
1206
1210
|
if (o.forEach((r) => {
|
|
1207
1211
|
let l = r.getValue(e);
|
|
1208
1212
|
l != null && (l = +l) >= l && (++t, n += l);
|
|
1209
1213
|
}), t) return n / t;
|
|
1210
|
-
},
|
|
1214
|
+
}, hn = (e, o) => {
|
|
1211
1215
|
if (!o.length)
|
|
1212
1216
|
return;
|
|
1213
1217
|
const t = o.map((l) => l.getValue(e));
|
|
1214
|
-
if (!
|
|
1218
|
+
if (!on(t))
|
|
1215
1219
|
return;
|
|
1216
1220
|
if (t.length === 1)
|
|
1217
1221
|
return t[0];
|
|
1218
1222
|
const n = Math.floor(t.length / 2), r = t.sort((l, s) => l - s);
|
|
1219
1223
|
return t.length % 2 !== 0 ? r[n] : (r[n - 1] + r[n]) / 2;
|
|
1220
|
-
},
|
|
1221
|
-
sum:
|
|
1222
|
-
min:
|
|
1223
|
-
max:
|
|
1224
|
-
extent:
|
|
1225
|
-
mean:
|
|
1226
|
-
median:
|
|
1227
|
-
unique:
|
|
1228
|
-
uniqueCount:
|
|
1229
|
-
count:
|
|
1230
|
-
},
|
|
1224
|
+
}, vn = (e, o) => Array.from(new Set(o.map((t) => t.getValue(e))).values()), wn = (e, o) => new Set(o.map((t) => t.getValue(e))).size, Cn = (e, o) => o.length, Se = {
|
|
1225
|
+
sum: dn,
|
|
1226
|
+
min: cn,
|
|
1227
|
+
max: gn,
|
|
1228
|
+
extent: pn,
|
|
1229
|
+
mean: mn,
|
|
1230
|
+
median: hn,
|
|
1231
|
+
unique: vn,
|
|
1232
|
+
uniqueCount: wn,
|
|
1233
|
+
count: Cn
|
|
1234
|
+
}, yn = {
|
|
1231
1235
|
getDefaultColumnDef: () => ({
|
|
1232
1236
|
aggregatedCell: (e) => {
|
|
1233
1237
|
var o, t;
|
|
@@ -1240,7 +1244,7 @@ const ln = (e, o, t) => t.reduce((n, r) => {
|
|
|
1240
1244
|
...e
|
|
1241
1245
|
}),
|
|
1242
1246
|
getDefaultOptions: (e) => ({
|
|
1243
|
-
onGroupingChange:
|
|
1247
|
+
onGroupingChange: T("grouping", e),
|
|
1244
1248
|
groupedColumnMode: "reorder"
|
|
1245
1249
|
}),
|
|
1246
1250
|
createColumn: (e, o) => {
|
|
@@ -1263,14 +1267,14 @@ const ln = (e, o, t) => t.reduce((n, r) => {
|
|
|
1263
1267
|
}, e.getAutoAggregationFn = () => {
|
|
1264
1268
|
const t = o.getCoreRowModel().flatRows[0], n = t == null ? void 0 : t.getValue(e.id);
|
|
1265
1269
|
if (typeof n == "number")
|
|
1266
|
-
return
|
|
1270
|
+
return Se.sum;
|
|
1267
1271
|
if (Object.prototype.toString.call(n) === "[object Date]")
|
|
1268
|
-
return
|
|
1272
|
+
return Se.extent;
|
|
1269
1273
|
}, e.getAggregationFn = () => {
|
|
1270
1274
|
var t, n;
|
|
1271
1275
|
if (!e)
|
|
1272
1276
|
throw new Error();
|
|
1273
|
-
return
|
|
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 : Se[e.columnDef.aggregationFn];
|
|
1274
1278
|
};
|
|
1275
1279
|
},
|
|
1276
1280
|
createTable: (e) => {
|
|
@@ -1294,19 +1298,19 @@ const ln = (e, o, t) => t.reduce((n, r) => {
|
|
|
1294
1298
|
};
|
|
1295
1299
|
}
|
|
1296
1300
|
};
|
|
1297
|
-
function
|
|
1301
|
+
function Sn(e, o, t) {
|
|
1298
1302
|
if (!(o != null && o.length) || !t)
|
|
1299
1303
|
return e;
|
|
1300
1304
|
const n = e.filter((l) => !o.includes(l.id));
|
|
1301
1305
|
return t === "remove" ? n : [...o.map((l) => e.find((s) => s.id === l)).filter(Boolean), ...n];
|
|
1302
1306
|
}
|
|
1303
|
-
const
|
|
1307
|
+
const Rn = {
|
|
1304
1308
|
getInitialState: (e) => ({
|
|
1305
1309
|
columnOrder: [],
|
|
1306
1310
|
...e
|
|
1307
1311
|
}),
|
|
1308
1312
|
getDefaultOptions: (e) => ({
|
|
1309
|
-
onColumnOrderChange:
|
|
1313
|
+
onColumnOrderChange: T("columnOrder", e)
|
|
1310
1314
|
}),
|
|
1311
1315
|
createColumn: (e, o) => {
|
|
1312
1316
|
e.getIndex = S((t) => [ue(o, t)], (t) => t.findIndex((n) => n.id === e.id), R(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
|
|
@@ -1334,19 +1338,19 @@ const vn = {
|
|
|
1334
1338
|
}
|
|
1335
1339
|
l = [...l, ...i];
|
|
1336
1340
|
}
|
|
1337
|
-
return
|
|
1341
|
+
return Sn(l, t, n);
|
|
1338
1342
|
}, R(e.options, "debugTable", "_getOrderColumnsFn"));
|
|
1339
1343
|
}
|
|
1340
|
-
},
|
|
1344
|
+
}, Re = () => ({
|
|
1341
1345
|
left: [],
|
|
1342
1346
|
right: []
|
|
1343
|
-
}),
|
|
1347
|
+
}), xn = {
|
|
1344
1348
|
getInitialState: (e) => ({
|
|
1345
|
-
columnPinning:
|
|
1349
|
+
columnPinning: Re(),
|
|
1346
1350
|
...e
|
|
1347
1351
|
}),
|
|
1348
1352
|
getDefaultOptions: (e) => ({
|
|
1349
|
-
onColumnPinningChange:
|
|
1353
|
+
onColumnPinningChange: T("columnPinning", e)
|
|
1350
1354
|
}),
|
|
1351
1355
|
createColumn: (e, o) => {
|
|
1352
1356
|
e.pin = (t) => {
|
|
@@ -1402,7 +1406,7 @@ const vn = {
|
|
|
1402
1406
|
createTable: (e) => {
|
|
1403
1407
|
e.setColumnPinning = (o) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(o), e.resetColumnPinning = (o) => {
|
|
1404
1408
|
var t, n;
|
|
1405
|
-
return e.setColumnPinning(o ?
|
|
1409
|
+
return e.setColumnPinning(o ? Re() : (t = (n = e.initialState) == null ? void 0 : n.columnPinning) != null ? t : Re());
|
|
1406
1410
|
}, e.getIsSomeColumnsPinned = (o) => {
|
|
1407
1411
|
var t;
|
|
1408
1412
|
const n = e.getState().columnPinning;
|
|
@@ -1417,38 +1421,38 @@ const vn = {
|
|
|
1417
1421
|
}, R(e.options, "debugColumns", "getCenterLeafColumns"));
|
|
1418
1422
|
}
|
|
1419
1423
|
};
|
|
1420
|
-
function
|
|
1424
|
+
function _n(e) {
|
|
1421
1425
|
return e || (typeof document < "u" ? document : null);
|
|
1422
1426
|
}
|
|
1423
|
-
const
|
|
1427
|
+
const me = {
|
|
1424
1428
|
size: 150,
|
|
1425
1429
|
minSize: 20,
|
|
1426
1430
|
maxSize: Number.MAX_SAFE_INTEGER
|
|
1427
|
-
},
|
|
1431
|
+
}, xe = () => ({
|
|
1428
1432
|
startOffset: null,
|
|
1429
1433
|
startSize: null,
|
|
1430
1434
|
deltaOffset: null,
|
|
1431
1435
|
deltaPercentage: null,
|
|
1432
1436
|
isResizingColumn: !1,
|
|
1433
1437
|
columnSizingStart: []
|
|
1434
|
-
}),
|
|
1435
|
-
getDefaultColumnDef: () =>
|
|
1438
|
+
}), Fn = {
|
|
1439
|
+
getDefaultColumnDef: () => me,
|
|
1436
1440
|
getInitialState: (e) => ({
|
|
1437
1441
|
columnSizing: {},
|
|
1438
|
-
columnSizingInfo:
|
|
1442
|
+
columnSizingInfo: xe(),
|
|
1439
1443
|
...e
|
|
1440
1444
|
}),
|
|
1441
1445
|
getDefaultOptions: (e) => ({
|
|
1442
1446
|
columnResizeMode: "onEnd",
|
|
1443
1447
|
columnResizeDirection: "ltr",
|
|
1444
|
-
onColumnSizingChange:
|
|
1445
|
-
onColumnSizingInfoChange:
|
|
1448
|
+
onColumnSizingChange: T("columnSizing", e),
|
|
1449
|
+
onColumnSizingInfoChange: T("columnSizingInfo", e)
|
|
1446
1450
|
}),
|
|
1447
1451
|
createColumn: (e, o) => {
|
|
1448
1452
|
e.getSize = () => {
|
|
1449
1453
|
var t, n, r;
|
|
1450
1454
|
const l = o.getState().columnSizing[e.id];
|
|
1451
|
-
return Math.min(Math.max((t = e.columnDef.minSize) != null ? t :
|
|
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);
|
|
1452
1456
|
}, e.getStart = S((t) => [t, ue(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, ue(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 = () => {
|
|
1453
1457
|
o.setColumnSizing((t) => {
|
|
1454
1458
|
let {
|
|
@@ -1483,19 +1487,19 @@ const pe = {
|
|
|
1483
1487
|
}, e.getResizeHandler = (t) => {
|
|
1484
1488
|
const n = o.getColumn(e.column.id), r = n == null ? void 0 : n.getCanResize();
|
|
1485
1489
|
return (l) => {
|
|
1486
|
-
if (!n || !r || (l.persist == null || l.persist(),
|
|
1490
|
+
if (!n || !r || (l.persist == null || l.persist(), _e(l) && l.touches && l.touches.length > 1))
|
|
1487
1491
|
return;
|
|
1488
|
-
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 = _e(l) ? Math.round(l.touches[0].clientX) : l.clientX, f = {}, p = (w, y) => {
|
|
1489
1493
|
typeof y == "number" && (o.setColumnSizingInfo((x) => {
|
|
1490
|
-
var N,
|
|
1491
|
-
const P = o.options.columnResizeDirection === "rtl" ? -1 : 1,
|
|
1492
|
-
return x.columnSizingStart.forEach((
|
|
1493
|
-
let [
|
|
1494
|
-
f[
|
|
1494
|
+
var N, F;
|
|
1495
|
+
const P = o.options.columnResizeDirection === "rtl" ? -1 : 1, ne = (y - ((N = x == null ? void 0 : x.startOffset) != null ? N : 0)) * P, L = Math.max(ne / ((F = x == null ? void 0 : x.startSize) != null ? F : 0), -0.999999);
|
|
1496
|
+
return x.columnSizingStart.forEach((K) => {
|
|
1497
|
+
let [Y, z] = K;
|
|
1498
|
+
f[Y] = Math.round(Math.max(z + z * L, 0) * 100) / 100;
|
|
1495
1499
|
}), {
|
|
1496
1500
|
...x,
|
|
1497
|
-
deltaOffset:
|
|
1498
|
-
deltaPercentage:
|
|
1501
|
+
deltaOffset: ne,
|
|
1502
|
+
deltaPercentage: L
|
|
1499
1503
|
};
|
|
1500
1504
|
}), (o.options.columnResizeMode === "onChange" || w === "end") && o.setColumnSizing((x) => ({
|
|
1501
1505
|
...x,
|
|
@@ -1511,7 +1515,7 @@ const pe = {
|
|
|
1511
1515
|
deltaPercentage: null,
|
|
1512
1516
|
columnSizingStart: []
|
|
1513
1517
|
}));
|
|
1514
|
-
}, a =
|
|
1518
|
+
}, a = _n(t), m = {
|
|
1515
1519
|
moveHandler: (w) => g(w.clientX),
|
|
1516
1520
|
upHandler: (w) => {
|
|
1517
1521
|
a == null || a.removeEventListener("mousemove", m.moveHandler), a == null || a.removeEventListener("mouseup", m.upHandler), c(w.clientX);
|
|
@@ -1522,10 +1526,10 @@ const pe = {
|
|
|
1522
1526
|
var y;
|
|
1523
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);
|
|
1524
1528
|
}
|
|
1525
|
-
}, C =
|
|
1529
|
+
}, C = In() ? {
|
|
1526
1530
|
passive: !1
|
|
1527
1531
|
} : !1;
|
|
1528
|
-
|
|
1532
|
+
_e(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) => ({
|
|
1529
1533
|
...w,
|
|
1530
1534
|
startOffset: u,
|
|
1531
1535
|
startSize: s,
|
|
@@ -1543,7 +1547,7 @@ const pe = {
|
|
|
1543
1547
|
e.setColumnSizing(o ? {} : (t = e.initialState.columnSizing) != null ? t : {});
|
|
1544
1548
|
}, e.resetHeaderSizeInfo = (o) => {
|
|
1545
1549
|
var t;
|
|
1546
|
-
e.setColumnSizingInfo(o ?
|
|
1550
|
+
e.setColumnSizingInfo(o ? xe() : (t = e.initialState.columnSizingInfo) != null ? t : xe());
|
|
1547
1551
|
}, e.getTotalSize = () => {
|
|
1548
1552
|
var o, t;
|
|
1549
1553
|
return (o = (t = e.getHeaderGroups()[0]) == null ? void 0 : t.headers.reduce((n, r) => n + r.getSize(), 0)) != null ? o : 0;
|
|
@@ -1559,9 +1563,9 @@ const pe = {
|
|
|
1559
1563
|
};
|
|
1560
1564
|
}
|
|
1561
1565
|
};
|
|
1562
|
-
let
|
|
1563
|
-
function
|
|
1564
|
-
if (typeof
|
|
1566
|
+
let he = null;
|
|
1567
|
+
function In() {
|
|
1568
|
+
if (typeof he == "boolean") return he;
|
|
1565
1569
|
let e = !1;
|
|
1566
1570
|
try {
|
|
1567
1571
|
const o = {
|
|
@@ -1574,18 +1578,18 @@ function Sn() {
|
|
|
1574
1578
|
} catch {
|
|
1575
1579
|
e = !1;
|
|
1576
1580
|
}
|
|
1577
|
-
return
|
|
1581
|
+
return he = e, he;
|
|
1578
1582
|
}
|
|
1579
|
-
function
|
|
1583
|
+
function _e(e) {
|
|
1580
1584
|
return e.type === "touchstart";
|
|
1581
1585
|
}
|
|
1582
|
-
const
|
|
1586
|
+
const $n = {
|
|
1583
1587
|
getInitialState: (e) => ({
|
|
1584
1588
|
columnVisibility: {},
|
|
1585
1589
|
...e
|
|
1586
1590
|
}),
|
|
1587
1591
|
getDefaultOptions: (e) => ({
|
|
1588
|
-
onColumnVisibilityChange:
|
|
1592
|
+
onColumnVisibilityChange: T("columnVisibility", e)
|
|
1589
1593
|
}),
|
|
1590
1594
|
createColumn: (e, o) => {
|
|
1591
1595
|
e.toggleVisibility = (t) => {
|
|
@@ -1627,20 +1631,20 @@ const Rn = {
|
|
|
1627
1631
|
function ue(e, o) {
|
|
1628
1632
|
return o ? o === "center" ? e.getCenterVisibleLeafColumns() : o === "left" ? e.getLeftVisibleLeafColumns() : e.getRightVisibleLeafColumns() : e.getVisibleLeafColumns();
|
|
1629
1633
|
}
|
|
1630
|
-
const
|
|
1634
|
+
const Nn = {
|
|
1631
1635
|
createTable: (e) => {
|
|
1632
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 = () => {
|
|
1633
1637
|
if (e._getGlobalFacetedMinMaxValues)
|
|
1634
1638
|
return e._getGlobalFacetedMinMaxValues();
|
|
1635
1639
|
};
|
|
1636
1640
|
}
|
|
1637
|
-
},
|
|
1641
|
+
}, Mn = {
|
|
1638
1642
|
getInitialState: (e) => ({
|
|
1639
1643
|
globalFilter: void 0,
|
|
1640
1644
|
...e
|
|
1641
1645
|
}),
|
|
1642
1646
|
getDefaultOptions: (e) => ({
|
|
1643
|
-
onGlobalFilterChange:
|
|
1647
|
+
onGlobalFilterChange: T("globalFilter", e),
|
|
1644
1648
|
globalFilterFn: "auto",
|
|
1645
1649
|
getColumnCanGlobalFilter: (o) => {
|
|
1646
1650
|
var t;
|
|
@@ -1655,25 +1659,25 @@ const xn = {
|
|
|
1655
1659
|
};
|
|
1656
1660
|
},
|
|
1657
1661
|
createTable: (e) => {
|
|
1658
|
-
e.getGlobalAutoFilterFn = () =>
|
|
1662
|
+
e.getGlobalAutoFilterFn = () => W.includesString, e.getGlobalFilterFn = () => {
|
|
1659
1663
|
var o, t;
|
|
1660
1664
|
const {
|
|
1661
1665
|
globalFilterFn: n
|
|
1662
1666
|
} = e.options;
|
|
1663
|
-
return
|
|
1667
|
+
return we(n) ? n : n === "auto" ? e.getGlobalAutoFilterFn() : (o = (t = e.options.filterFns) == null ? void 0 : t[n]) != null ? o : W[n];
|
|
1664
1668
|
}, e.setGlobalFilter = (o) => {
|
|
1665
1669
|
e.options.onGlobalFilterChange == null || e.options.onGlobalFilterChange(o);
|
|
1666
1670
|
}, e.resetGlobalFilter = (o) => {
|
|
1667
1671
|
e.setGlobalFilter(o ? void 0 : e.initialState.globalFilter);
|
|
1668
1672
|
};
|
|
1669
1673
|
}
|
|
1670
|
-
},
|
|
1674
|
+
}, Vn = {
|
|
1671
1675
|
getInitialState: (e) => ({
|
|
1672
1676
|
expanded: {},
|
|
1673
1677
|
...e
|
|
1674
1678
|
}),
|
|
1675
1679
|
getDefaultOptions: (e) => ({
|
|
1676
|
-
onExpandedChange:
|
|
1680
|
+
onExpandedChange: T("expanded", e),
|
|
1677
1681
|
paginateExpandedRows: !0
|
|
1678
1682
|
}),
|
|
1679
1683
|
createTable: (e) => {
|
|
@@ -1754,19 +1758,19 @@ const xn = {
|
|
|
1754
1758
|
};
|
|
1755
1759
|
};
|
|
1756
1760
|
}
|
|
1757
|
-
},
|
|
1758
|
-
pageIndex:
|
|
1759
|
-
pageSize:
|
|
1760
|
-
}),
|
|
1761
|
+
}, Pe = 0, ke = 10, Fe = () => ({
|
|
1762
|
+
pageIndex: Pe,
|
|
1763
|
+
pageSize: ke
|
|
1764
|
+
}), Pn = {
|
|
1761
1765
|
getInitialState: (e) => ({
|
|
1762
1766
|
...e,
|
|
1763
1767
|
pagination: {
|
|
1764
|
-
...
|
|
1768
|
+
...Fe(),
|
|
1765
1769
|
...e == null ? void 0 : e.pagination
|
|
1766
1770
|
}
|
|
1767
1771
|
}),
|
|
1768
1772
|
getDefaultOptions: (e) => ({
|
|
1769
|
-
onPaginationChange:
|
|
1773
|
+
onPaginationChange: T("pagination", e)
|
|
1770
1774
|
}),
|
|
1771
1775
|
createTable: (e) => {
|
|
1772
1776
|
let o = !1, t = !1;
|
|
@@ -1785,14 +1789,14 @@ const xn = {
|
|
|
1785
1789
|
});
|
|
1786
1790
|
}
|
|
1787
1791
|
}, e.setPagination = (n) => {
|
|
1788
|
-
const r = (l) =>
|
|
1792
|
+
const r = (l) => J(n, l);
|
|
1789
1793
|
return e.options.onPaginationChange == null ? void 0 : e.options.onPaginationChange(r);
|
|
1790
1794
|
}, e.resetPagination = (n) => {
|
|
1791
1795
|
var r;
|
|
1792
|
-
e.setPagination(n ?
|
|
1796
|
+
e.setPagination(n ? Fe() : (r = e.initialState.pagination) != null ? r : Fe());
|
|
1793
1797
|
}, e.setPageIndex = (n) => {
|
|
1794
1798
|
e.setPagination((r) => {
|
|
1795
|
-
let l =
|
|
1799
|
+
let l = J(n, r.pageIndex);
|
|
1796
1800
|
const s = typeof e.options.pageCount > "u" || e.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : e.options.pageCount - 1;
|
|
1797
1801
|
return l = Math.max(0, Math.min(l, s)), {
|
|
1798
1802
|
...r,
|
|
@@ -1801,13 +1805,13 @@ const xn = {
|
|
|
1801
1805
|
});
|
|
1802
1806
|
}, e.resetPageIndex = (n) => {
|
|
1803
1807
|
var r, l;
|
|
1804
|
-
e.setPageIndex(n ?
|
|
1808
|
+
e.setPageIndex(n ? Pe : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageIndex) != null ? r : Pe);
|
|
1805
1809
|
}, e.resetPageSize = (n) => {
|
|
1806
1810
|
var r, l;
|
|
1807
|
-
e.setPageSize(n ?
|
|
1811
|
+
e.setPageSize(n ? ke : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageSize) != null ? r : ke);
|
|
1808
1812
|
}, e.setPageSize = (n) => {
|
|
1809
1813
|
e.setPagination((r) => {
|
|
1810
|
-
const l = Math.max(1,
|
|
1814
|
+
const l = Math.max(1, J(n, r.pageSize)), s = r.pageSize * r.pageIndex, i = Math.floor(s / l);
|
|
1811
1815
|
return {
|
|
1812
1816
|
...r,
|
|
1813
1817
|
pageIndex: i,
|
|
@@ -1816,7 +1820,7 @@ const xn = {
|
|
|
1816
1820
|
});
|
|
1817
1821
|
}, e.setPageCount = (n) => e.setPagination((r) => {
|
|
1818
1822
|
var l;
|
|
1819
|
-
let s =
|
|
1823
|
+
let s = J(n, (l = e.options.pageCount) != null ? l : -1);
|
|
1820
1824
|
return typeof s == "number" && (s = Math.max(-1, s)), {
|
|
1821
1825
|
...r,
|
|
1822
1826
|
pageCount: s
|
|
@@ -1837,16 +1841,16 @@ const xn = {
|
|
|
1837
1841
|
return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
|
|
1838
1842
|
};
|
|
1839
1843
|
}
|
|
1840
|
-
},
|
|
1844
|
+
}, Ie = () => ({
|
|
1841
1845
|
top: [],
|
|
1842
1846
|
bottom: []
|
|
1843
|
-
}),
|
|
1847
|
+
}), kn = {
|
|
1844
1848
|
getInitialState: (e) => ({
|
|
1845
|
-
rowPinning:
|
|
1849
|
+
rowPinning: Ie(),
|
|
1846
1850
|
...e
|
|
1847
1851
|
}),
|
|
1848
1852
|
getDefaultOptions: (e) => ({
|
|
1849
|
-
onRowPinningChange:
|
|
1853
|
+
onRowPinningChange: T("rowPinning", e)
|
|
1850
1854
|
}),
|
|
1851
1855
|
createRow: (e, o) => {
|
|
1852
1856
|
e.pin = (t, n, r) => {
|
|
@@ -1911,7 +1915,7 @@ const xn = {
|
|
|
1911
1915
|
createTable: (e) => {
|
|
1912
1916
|
e.setRowPinning = (o) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(o), e.resetRowPinning = (o) => {
|
|
1913
1917
|
var t, n;
|
|
1914
|
-
return e.setRowPinning(o ?
|
|
1918
|
+
return e.setRowPinning(o ? Ie() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : Ie());
|
|
1915
1919
|
}, e.getIsSomeRowsPinned = (o) => {
|
|
1916
1920
|
var t;
|
|
1917
1921
|
const n = e.getState().rowPinning;
|
|
@@ -1941,13 +1945,13 @@ const xn = {
|
|
|
1941
1945
|
return o.filter((l) => !r.has(l.id));
|
|
1942
1946
|
}, R(e.options, "debugRows", "getCenterRows"));
|
|
1943
1947
|
}
|
|
1944
|
-
},
|
|
1948
|
+
}, bn = {
|
|
1945
1949
|
getInitialState: (e) => ({
|
|
1946
1950
|
rowSelection: {},
|
|
1947
1951
|
...e
|
|
1948
1952
|
}),
|
|
1949
1953
|
getDefaultOptions: (e) => ({
|
|
1950
|
-
onRowSelectionChange:
|
|
1954
|
+
onRowSelectionChange: T("rowSelection", e),
|
|
1951
1955
|
enableRowSelection: !0,
|
|
1952
1956
|
enableMultiRowSelection: !0,
|
|
1953
1957
|
enableSubRowSelection: !0
|
|
@@ -1976,17 +1980,17 @@ const xn = {
|
|
|
1976
1980
|
...t
|
|
1977
1981
|
};
|
|
1978
1982
|
return e.getRowModel().rows.forEach((l) => {
|
|
1979
|
-
|
|
1983
|
+
be(r, l.id, n, !0, e);
|
|
1980
1984
|
}), r;
|
|
1981
|
-
}), 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 ? $e(e, t) : {
|
|
1982
1986
|
rows: [],
|
|
1983
1987
|
flatRows: [],
|
|
1984
1988
|
rowsById: {}
|
|
1985
|
-
}, 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 ? $e(e, t) : {
|
|
1986
1990
|
rows: [],
|
|
1987
1991
|
flatRows: [],
|
|
1988
1992
|
rowsById: {}
|
|
1989
|
-
}, 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 ? $e(e, t) : {
|
|
1990
1994
|
rows: [],
|
|
1991
1995
|
flatRows: [],
|
|
1992
1996
|
rowsById: {}
|
|
@@ -2025,23 +2029,23 @@ const xn = {
|
|
|
2025
2029
|
const i = {
|
|
2026
2030
|
...l
|
|
2027
2031
|
};
|
|
2028
|
-
return
|
|
2032
|
+
return be(i, e.id, t, (s = n == null ? void 0 : n.selectChildren) != null ? s : !0, o), i;
|
|
2029
2033
|
});
|
|
2030
2034
|
}, e.getIsSelected = () => {
|
|
2031
2035
|
const {
|
|
2032
2036
|
rowSelection: t
|
|
2033
2037
|
} = o.getState();
|
|
2034
|
-
return
|
|
2038
|
+
return Oe(e, t);
|
|
2035
2039
|
}, e.getIsSomeSelected = () => {
|
|
2036
2040
|
const {
|
|
2037
2041
|
rowSelection: t
|
|
2038
2042
|
} = o.getState();
|
|
2039
|
-
return
|
|
2043
|
+
return Ee(e, t) === "some";
|
|
2040
2044
|
}, e.getIsAllSubRowsSelected = () => {
|
|
2041
2045
|
const {
|
|
2042
2046
|
rowSelection: t
|
|
2043
2047
|
} = o.getState();
|
|
2044
|
-
return
|
|
2048
|
+
return Ee(e, t) === "all";
|
|
2045
2049
|
}, e.getCanSelect = () => {
|
|
2046
2050
|
var t;
|
|
2047
2051
|
return typeof o.options.enableRowSelection == "function" ? o.options.enableRowSelection(e) : (t = o.options.enableRowSelection) != null ? t : !0;
|
|
@@ -2059,16 +2063,16 @@ const xn = {
|
|
|
2059
2063
|
};
|
|
2060
2064
|
};
|
|
2061
2065
|
}
|
|
2062
|
-
},
|
|
2066
|
+
}, be = (e, o, t, n, r) => {
|
|
2063
2067
|
var l;
|
|
2064
2068
|
const s = r.getRow(o, !0);
|
|
2065
|
-
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) => be(e, i.id, t, n, r));
|
|
2066
2070
|
};
|
|
2067
|
-
function
|
|
2071
|
+
function $e(e, o) {
|
|
2068
2072
|
const t = e.getState().rowSelection, n = [], r = {}, l = function(s, i) {
|
|
2069
2073
|
return s.map((u) => {
|
|
2070
2074
|
var f;
|
|
2071
|
-
const p =
|
|
2075
|
+
const p = Oe(u, t);
|
|
2072
2076
|
if (p && (n.push(u), r[u.id] = u), (f = u.subRows) != null && f.length && (u = {
|
|
2073
2077
|
...u,
|
|
2074
2078
|
subRows: l(u.subRows)
|
|
@@ -2082,33 +2086,33 @@ function Ie(e, o) {
|
|
|
2082
2086
|
rowsById: r
|
|
2083
2087
|
};
|
|
2084
2088
|
}
|
|
2085
|
-
function
|
|
2089
|
+
function Oe(e, o) {
|
|
2086
2090
|
var t;
|
|
2087
2091
|
return (t = o[e.id]) != null ? t : !1;
|
|
2088
2092
|
}
|
|
2089
|
-
function
|
|
2093
|
+
function Ee(e, o, t) {
|
|
2090
2094
|
var n;
|
|
2091
2095
|
if (!((n = e.subRows) != null && n.length)) return !1;
|
|
2092
2096
|
let r = !0, l = !1;
|
|
2093
2097
|
return e.subRows.forEach((s) => {
|
|
2094
|
-
if (!(l && !r) && (s.getCanSelect() && (
|
|
2095
|
-
const i =
|
|
2098
|
+
if (!(l && !r) && (s.getCanSelect() && (Oe(s, o) ? l = !0 : r = !1), s.subRows && s.subRows.length)) {
|
|
2099
|
+
const i = Ee(s, o);
|
|
2096
2100
|
i === "all" ? l = !0 : (i === "some" && (l = !0), r = !1);
|
|
2097
2101
|
}
|
|
2098
2102
|
}), r ? "all" : l ? "some" : !1;
|
|
2099
2103
|
}
|
|
2100
|
-
const
|
|
2104
|
+
const De = /([0-9]+)/gm, En = (e, o, t) => pt(te(e.getValue(t)).toLowerCase(), te(o.getValue(t)).toLowerCase()), Dn = (e, o, t) => pt(te(e.getValue(t)), te(o.getValue(t))), Ln = (e, o, t) => Te(te(e.getValue(t)).toLowerCase(), te(o.getValue(t)).toLowerCase()), zn = (e, o, t) => Te(te(e.getValue(t)), te(o.getValue(t))), An = (e, o, t) => {
|
|
2101
2105
|
const n = e.getValue(t), r = o.getValue(t);
|
|
2102
2106
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
2103
|
-
},
|
|
2104
|
-
function
|
|
2107
|
+
}, Hn = (e, o, t) => Te(e.getValue(t), o.getValue(t));
|
|
2108
|
+
function Te(e, o) {
|
|
2105
2109
|
return e === o ? 0 : e > o ? 1 : -1;
|
|
2106
2110
|
}
|
|
2107
|
-
function
|
|
2111
|
+
function te(e) {
|
|
2108
2112
|
return typeof e == "number" ? isNaN(e) || e === 1 / 0 || e === -1 / 0 ? "" : String(e) : typeof e == "string" ? e : "";
|
|
2109
2113
|
}
|
|
2110
|
-
function
|
|
2111
|
-
const t = e.split(
|
|
2114
|
+
function pt(e, o) {
|
|
2115
|
+
const t = e.split(De).filter(Boolean), n = o.split(De).filter(Boolean);
|
|
2112
2116
|
for (; t.length && n.length; ) {
|
|
2113
2117
|
const r = t.shift(), l = n.shift(), s = parseInt(r, 10), i = parseInt(l, 10), u = [s, i].sort();
|
|
2114
2118
|
if (isNaN(u[0])) {
|
|
@@ -2128,13 +2132,13 @@ function ct(e, o) {
|
|
|
2128
2132
|
return t.length - n.length;
|
|
2129
2133
|
}
|
|
2130
2134
|
const ae = {
|
|
2131
|
-
alphanumeric:
|
|
2132
|
-
alphanumericCaseSensitive:
|
|
2133
|
-
text:
|
|
2134
|
-
textCaseSensitive:
|
|
2135
|
-
datetime:
|
|
2136
|
-
basic:
|
|
2137
|
-
},
|
|
2135
|
+
alphanumeric: En,
|
|
2136
|
+
alphanumericCaseSensitive: Dn,
|
|
2137
|
+
text: Ln,
|
|
2138
|
+
textCaseSensitive: zn,
|
|
2139
|
+
datetime: An,
|
|
2140
|
+
basic: Hn
|
|
2141
|
+
}, Gn = {
|
|
2138
2142
|
getInitialState: (e) => ({
|
|
2139
2143
|
sorting: [],
|
|
2140
2144
|
...e
|
|
@@ -2144,7 +2148,7 @@ const ae = {
|
|
|
2144
2148
|
sortUndefined: 1
|
|
2145
2149
|
}),
|
|
2146
2150
|
getDefaultOptions: (e) => ({
|
|
2147
|
-
onSortingChange:
|
|
2151
|
+
onSortingChange: T("sorting", e),
|
|
2148
2152
|
isMultiSortEvent: (o) => o.shiftKey
|
|
2149
2153
|
}),
|
|
2150
2154
|
createColumn: (e, o) => {
|
|
@@ -2155,7 +2159,7 @@ const ae = {
|
|
|
2155
2159
|
const l = r == null ? void 0 : r.getValue(e.id);
|
|
2156
2160
|
if (Object.prototype.toString.call(l) === "[object Date]")
|
|
2157
2161
|
return ae.datetime;
|
|
2158
|
-
if (typeof l == "string" && (n = !0, l.split(
|
|
2162
|
+
if (typeof l == "string" && (n = !0, l.split(De).length > 1))
|
|
2159
2163
|
return ae.alphanumeric;
|
|
2160
2164
|
}
|
|
2161
2165
|
return n ? ae.text : ae.basic;
|
|
@@ -2166,7 +2170,7 @@ const ae = {
|
|
|
2166
2170
|
var t, n;
|
|
2167
2171
|
if (!e)
|
|
2168
2172
|
throw new Error();
|
|
2169
|
-
return
|
|
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 : ae[e.columnDef.sortingFn];
|
|
2170
2174
|
}, e.toggleSorting = (t, n) => {
|
|
2171
2175
|
const r = e.getNextSortingOrder(), l = typeof t < "u" && t !== null;
|
|
2172
2176
|
o.setSorting((s) => {
|
|
@@ -2223,30 +2227,30 @@ const ae = {
|
|
|
2223
2227
|
e.setSorting(o ? [] : (t = (n = e.initialState) == null ? void 0 : n.sorting) != null ? t : []);
|
|
2224
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());
|
|
2225
2229
|
}
|
|
2226
|
-
},
|
|
2227
|
-
|
|
2230
|
+
}, On = [
|
|
2231
|
+
an,
|
|
2232
|
+
$n,
|
|
2228
2233
|
Rn,
|
|
2229
|
-
vn,
|
|
2230
|
-
wn,
|
|
2231
|
-
on,
|
|
2232
|
-
rn,
|
|
2233
2234
|
xn,
|
|
2235
|
+
un,
|
|
2236
|
+
fn,
|
|
2237
|
+
Nn,
|
|
2234
2238
|
//depends on ColumnFaceting
|
|
2235
|
-
|
|
2239
|
+
Mn,
|
|
2236
2240
|
//depends on ColumnFiltering
|
|
2237
|
-
|
|
2238
|
-
|
|
2241
|
+
Gn,
|
|
2242
|
+
yn,
|
|
2239
2243
|
//depends on RowSorting
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2244
|
+
Vn,
|
|
2245
|
+
Pn,
|
|
2246
|
+
kn,
|
|
2247
|
+
bn,
|
|
2248
|
+
Fn
|
|
2245
2249
|
];
|
|
2246
|
-
function
|
|
2250
|
+
function Tn(e) {
|
|
2247
2251
|
var o, t;
|
|
2248
2252
|
process.env.NODE_ENV !== "production" && (e.debugAll || e.debugTable) && console.info("Creating Table Instance...");
|
|
2249
|
-
const n = [...
|
|
2253
|
+
const n = [...On, ...(o = e._features) != null ? o : []];
|
|
2250
2254
|
let r = {
|
|
2251
2255
|
_features: n
|
|
2252
2256
|
};
|
|
@@ -2284,7 +2288,7 @@ function zn(e) {
|
|
|
2284
2288
|
r.setState(r.initialState);
|
|
2285
2289
|
},
|
|
2286
2290
|
setOptions: (c) => {
|
|
2287
|
-
const a =
|
|
2291
|
+
const a = J(c, r.options);
|
|
2288
2292
|
r.options = s(a);
|
|
2289
2293
|
},
|
|
2290
2294
|
getState: () => r.options.state,
|
|
@@ -2326,7 +2330,7 @@ function zn(e) {
|
|
|
2326
2330
|
getAllColumns: S(() => [r._getColumnDefs()], (c) => {
|
|
2327
2331
|
const a = function(m, v, C) {
|
|
2328
2332
|
return C === void 0 && (C = 0), m.map((w) => {
|
|
2329
|
-
const y =
|
|
2333
|
+
const y = sn(r, w, C, v), x = w;
|
|
2330
2334
|
return y.columns = x.columns ? a(x.columns, y, C + 1) : [], y;
|
|
2331
2335
|
});
|
|
2332
2336
|
};
|
|
@@ -2350,7 +2354,7 @@ function zn(e) {
|
|
|
2350
2354
|
}
|
|
2351
2355
|
return r;
|
|
2352
2356
|
}
|
|
2353
|
-
function
|
|
2357
|
+
function Bn() {
|
|
2354
2358
|
return (e) => S(() => [e.options.data], (o) => {
|
|
2355
2359
|
const t = {
|
|
2356
2360
|
rows: [],
|
|
@@ -2360,7 +2364,7 @@ function An() {
|
|
|
2360
2364
|
l === void 0 && (l = 0);
|
|
2361
2365
|
const i = [];
|
|
2362
2366
|
for (let f = 0; f < r.length; f++) {
|
|
2363
|
-
const p =
|
|
2367
|
+
const p = He(e, e._getRowId(r[f], f, s), r[f], f, l, void 0, s == null ? void 0 : s.id);
|
|
2364
2368
|
if (t.flatRows.push(p), t.rowsById[p.id] = p, i.push(p), e.options.getSubRows) {
|
|
2365
2369
|
var u;
|
|
2366
2370
|
p.originalSubRows = e.options.getSubRows(r[f], f), (u = p.originalSubRows) != null && u.length && (p.subRows = n(p.originalSubRows, l + 1, p));
|
|
@@ -2371,7 +2375,7 @@ function An() {
|
|
|
2371
2375
|
return t.rows = n(o), t;
|
|
2372
2376
|
}, R(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
|
|
2373
2377
|
}
|
|
2374
|
-
function
|
|
2378
|
+
function Kn(e) {
|
|
2375
2379
|
const o = [], t = (n) => {
|
|
2376
2380
|
var r;
|
|
2377
2381
|
o.push(n), (r = n.subRows) != null && r.length && n.getIsExpanded() && n.subRows.forEach(t);
|
|
@@ -2382,10 +2386,10 @@ function Hn(e) {
|
|
|
2382
2386
|
rowsById: e.rowsById
|
|
2383
2387
|
};
|
|
2384
2388
|
}
|
|
2385
|
-
function
|
|
2386
|
-
return t.options.filterFromLeafRows ?
|
|
2389
|
+
function jn(e, o, t) {
|
|
2390
|
+
return t.options.filterFromLeafRows ? qn(e, o, t) : Un(e, o, t);
|
|
2387
2391
|
}
|
|
2388
|
-
function
|
|
2392
|
+
function qn(e, o, t) {
|
|
2389
2393
|
var n;
|
|
2390
2394
|
const r = [], l = {}, s = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, i = function(u, f) {
|
|
2391
2395
|
f === void 0 && (f = 0);
|
|
@@ -2393,7 +2397,7 @@ function On(e, o, t) {
|
|
|
2393
2397
|
for (let c = 0; c < u.length; c++) {
|
|
2394
2398
|
var g;
|
|
2395
2399
|
let a = u[c];
|
|
2396
|
-
const m =
|
|
2400
|
+
const m = He(t, a.id, a.original, a.index, a.depth, void 0, a.parentId);
|
|
2397
2401
|
if (m.columnFilters = a.columnFilters, (g = a.subRows) != null && g.length && f < s) {
|
|
2398
2402
|
if (m.subRows = i(a.subRows, f + 1), a = m, o(a) && !m.subRows.length) {
|
|
2399
2403
|
p.push(a), l[a.id] = a, r.push(a);
|
|
@@ -2414,7 +2418,7 @@ function On(e, o, t) {
|
|
|
2414
2418
|
rowsById: l
|
|
2415
2419
|
};
|
|
2416
2420
|
}
|
|
2417
|
-
function
|
|
2421
|
+
function Un(e, o, t) {
|
|
2418
2422
|
var n;
|
|
2419
2423
|
const r = [], l = {}, s = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, i = function(u, f) {
|
|
2420
2424
|
f === void 0 && (f = 0);
|
|
@@ -2424,7 +2428,7 @@ function Tn(e, o, t) {
|
|
|
2424
2428
|
if (o(a)) {
|
|
2425
2429
|
var g;
|
|
2426
2430
|
if ((g = a.subRows) != null && g.length && f < s) {
|
|
2427
|
-
const v =
|
|
2431
|
+
const v = He(t, a.id, a.original, a.index, a.depth, void 0, a.parentId);
|
|
2428
2432
|
v.subRows = i(a.subRows, f + 1), a = v;
|
|
2429
2433
|
}
|
|
2430
2434
|
p.push(a), r.push(a), l[a.id] = a;
|
|
@@ -2438,7 +2442,7 @@ function Tn(e, o, t) {
|
|
|
2438
2442
|
rowsById: l
|
|
2439
2443
|
};
|
|
2440
2444
|
}
|
|
2441
|
-
function
|
|
2445
|
+
function Xn() {
|
|
2442
2446
|
return (e) => S(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
|
|
2443
2447
|
if (!o.rows.length || !(t != null && t.length) && !n) {
|
|
2444
2448
|
for (let c = 0; c < o.flatRows.length; c++)
|
|
@@ -2502,10 +2506,10 @@ function Bn() {
|
|
|
2502
2506
|
return !1;
|
|
2503
2507
|
return !0;
|
|
2504
2508
|
};
|
|
2505
|
-
return
|
|
2509
|
+
return jn(o.rows, g, e);
|
|
2506
2510
|
}, R(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
|
|
2507
2511
|
}
|
|
2508
|
-
function
|
|
2512
|
+
function Zn(e) {
|
|
2509
2513
|
return (o) => S(() => [o.getState().pagination, o.getPrePaginationRowModel(), o.options.paginateExpandedRows ? void 0 : o.getState().expanded], (t, n) => {
|
|
2510
2514
|
if (!n.rows.length)
|
|
2511
2515
|
return n;
|
|
@@ -2525,7 +2529,7 @@ function Kn(e) {
|
|
|
2525
2529
|
rows: s,
|
|
2526
2530
|
flatRows: i,
|
|
2527
2531
|
rowsById: u
|
|
2528
|
-
} : g =
|
|
2532
|
+
} : g = Kn({
|
|
2529
2533
|
rows: s,
|
|
2530
2534
|
flatRows: i,
|
|
2531
2535
|
rowsById: u
|
|
@@ -2536,7 +2540,7 @@ function Kn(e) {
|
|
|
2536
2540
|
return g.rows.forEach(c), g;
|
|
2537
2541
|
}, R(o.options, "debugTable", "getPaginationRowModel"));
|
|
2538
2542
|
}
|
|
2539
|
-
function
|
|
2543
|
+
function Wn() {
|
|
2540
2544
|
return (e) => S(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
|
|
2541
2545
|
if (!t.rows.length || !(o != null && o.length))
|
|
2542
2546
|
return t;
|
|
@@ -2562,11 +2566,11 @@ function jn() {
|
|
|
2562
2566
|
const m = l[a], v = s[m.id], C = v.sortUndefined, w = (c = m == null ? void 0 : m.desc) != null ? c : !1;
|
|
2563
2567
|
let y = 0;
|
|
2564
2568
|
if (C) {
|
|
2565
|
-
const x = p.getValue(m.id), N = g.getValue(m.id),
|
|
2566
|
-
if (
|
|
2567
|
-
if (C === "first") return
|
|
2568
|
-
if (C === "last") return
|
|
2569
|
-
y =
|
|
2569
|
+
const x = p.getValue(m.id), N = g.getValue(m.id), F = x === void 0, P = N === void 0;
|
|
2570
|
+
if (F || P) {
|
|
2571
|
+
if (C === "first") return F ? -1 : 1;
|
|
2572
|
+
if (C === "last") return F ? 1 : -1;
|
|
2573
|
+
y = F && P ? 0 : F ? C : -C;
|
|
2570
2574
|
}
|
|
2571
2575
|
}
|
|
2572
2576
|
if (y === 0 && (y = v.sortingFn(p, g, m.id)), y !== 0)
|
|
@@ -2595,22 +2599,22 @@ function jn() {
|
|
|
2595
2599
|
*
|
|
2596
2600
|
* @license MIT
|
|
2597
2601
|
*/
|
|
2598
|
-
function
|
|
2599
|
-
return e ?
|
|
2602
|
+
function nt(e, o) {
|
|
2603
|
+
return e ? Qn(e) ? /* @__PURE__ */ Me.createElement(e, o) : e : null;
|
|
2600
2604
|
}
|
|
2601
|
-
function
|
|
2602
|
-
return
|
|
2605
|
+
function Qn(e) {
|
|
2606
|
+
return Yn(e) || typeof e == "function" || Jn(e);
|
|
2603
2607
|
}
|
|
2604
|
-
function
|
|
2608
|
+
function Yn(e) {
|
|
2605
2609
|
return typeof e == "function" && (() => {
|
|
2606
2610
|
const o = Object.getPrototypeOf(e);
|
|
2607
2611
|
return o.prototype && o.prototype.isReactComponent;
|
|
2608
2612
|
})();
|
|
2609
2613
|
}
|
|
2610
|
-
function
|
|
2614
|
+
function Jn(e) {
|
|
2611
2615
|
return typeof e == "object" && typeof e.$$typeof == "symbol" && ["react.memo", "react.forward_ref"].includes(e.$$typeof.description);
|
|
2612
2616
|
}
|
|
2613
|
-
function
|
|
2617
|
+
function eo(e) {
|
|
2614
2618
|
const o = {
|
|
2615
2619
|
state: {},
|
|
2616
2620
|
// Dummy state
|
|
@@ -2619,9 +2623,9 @@ function Zn(e) {
|
|
|
2619
2623
|
// noop
|
|
2620
2624
|
renderFallbackValue: null,
|
|
2621
2625
|
...e
|
|
2622
|
-
}, [t] =
|
|
2623
|
-
current:
|
|
2624
|
-
})), [n, r] =
|
|
2626
|
+
}, [t] = Me.useState(() => ({
|
|
2627
|
+
current: Tn(o)
|
|
2628
|
+
})), [n, r] = Me.useState(() => t.current.initialState);
|
|
2625
2629
|
return t.current.setOptions((l) => ({
|
|
2626
2630
|
...l,
|
|
2627
2631
|
...e,
|
|
@@ -2636,7 +2640,7 @@ function Zn(e) {
|
|
|
2636
2640
|
}
|
|
2637
2641
|
})), t.current;
|
|
2638
2642
|
}
|
|
2639
|
-
const
|
|
2643
|
+
const ot = ({
|
|
2640
2644
|
editable: e = !0,
|
|
2641
2645
|
deletable: o = !0,
|
|
2642
2646
|
pageSize: t = 25,
|
|
@@ -2653,42 +2657,42 @@ const tt = ({
|
|
|
2653
2657
|
stopEditing: g,
|
|
2654
2658
|
updateCell: c,
|
|
2655
2659
|
deleteRow: a
|
|
2656
|
-
} =
|
|
2657
|
-
const
|
|
2660
|
+
} = le(), [m, v] = Q([]), [C, w] = Q(""), [y, x] = Q(""), N = Ze(() => i.filter((I) => I.targetKey !== null).map((I) => {
|
|
2661
|
+
const $ = s == null ? void 0 : s.columns.find((V) => V.key === I.targetKey);
|
|
2658
2662
|
return {
|
|
2659
|
-
sourceColumn:
|
|
2660
|
-
targetKey:
|
|
2661
|
-
label: (
|
|
2662
|
-
type: (
|
|
2663
|
+
sourceColumn: I.sourceColumn,
|
|
2664
|
+
targetKey: I.targetKey,
|
|
2665
|
+
label: ($ == null ? void 0 : $.label) || I.targetKey,
|
|
2666
|
+
type: ($ == null ? void 0 : $.type) || "string"
|
|
2663
2667
|
};
|
|
2664
|
-
}), [i, s]),
|
|
2665
|
-
(
|
|
2666
|
-
const
|
|
2667
|
-
return
|
|
2668
|
+
}), [i, s]), F = Le(
|
|
2669
|
+
(I, $) => {
|
|
2670
|
+
const V = u.get(I);
|
|
2671
|
+
return V == null ? void 0 : V.find((O) => O.columnKey === $);
|
|
2668
2672
|
},
|
|
2669
2673
|
[u]
|
|
2670
|
-
), P = (
|
|
2671
|
-
x(
|
|
2672
|
-
},
|
|
2674
|
+
), P = (I, $, V) => {
|
|
2675
|
+
x(V), p(I, $);
|
|
2676
|
+
}, ne = () => {
|
|
2673
2677
|
f && (c(f.rowIndex, f.columnKey, y), n == null || n(f.rowIndex, f.columnKey, y)), g();
|
|
2674
|
-
},
|
|
2678
|
+
}, L = () => {
|
|
2675
2679
|
x(""), g();
|
|
2676
|
-
},
|
|
2677
|
-
a(
|
|
2678
|
-
},
|
|
2680
|
+
}, K = (I) => {
|
|
2681
|
+
a(I), r == null || r(I);
|
|
2682
|
+
}, Y = nn(), z = Ze(
|
|
2679
2683
|
() => [
|
|
2680
|
-
|
|
2684
|
+
Y.accessor("rowIndex", {
|
|
2681
2685
|
header: "#",
|
|
2682
2686
|
size: o ? 80 : 60,
|
|
2683
|
-
cell: (
|
|
2684
|
-
const
|
|
2687
|
+
cell: (I) => {
|
|
2688
|
+
const $ = I.getValue();
|
|
2685
2689
|
return /* @__PURE__ */ h("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
2686
|
-
/* @__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: $ + 1 }),
|
|
2687
2691
|
o && /* @__PURE__ */ d(
|
|
2688
2692
|
"button",
|
|
2689
2693
|
{
|
|
2690
|
-
onClick: (
|
|
2691
|
-
|
|
2694
|
+
onClick: (V) => {
|
|
2695
|
+
V.stopPropagation(), K($);
|
|
2692
2696
|
},
|
|
2693
2697
|
title: "Delete row",
|
|
2694
2698
|
style: {
|
|
@@ -2705,33 +2709,33 @@ const tt = ({
|
|
|
2705
2709
|
marginLeft: "2px",
|
|
2706
2710
|
flexShrink: 0
|
|
2707
2711
|
},
|
|
2708
|
-
onMouseEnter: (
|
|
2709
|
-
|
|
2712
|
+
onMouseEnter: (V) => {
|
|
2713
|
+
V.currentTarget.style.color = "#d43338", V.currentTarget.style.backgroundColor = "#fcdede";
|
|
2710
2714
|
},
|
|
2711
|
-
onMouseLeave: (
|
|
2712
|
-
|
|
2715
|
+
onMouseLeave: (V) => {
|
|
2716
|
+
V.currentTarget.style.color = "#8e8d89", V.currentTarget.style.backgroundColor = "transparent";
|
|
2713
2717
|
},
|
|
2714
|
-
children: /* @__PURE__ */ d(
|
|
2718
|
+
children: /* @__PURE__ */ d(Yt, { style: { width: "14px", height: "14px", display: "block" } })
|
|
2715
2719
|
}
|
|
2716
2720
|
)
|
|
2717
2721
|
] });
|
|
2718
2722
|
}
|
|
2719
2723
|
}),
|
|
2720
2724
|
...N.map(
|
|
2721
|
-
(
|
|
2722
|
-
id:
|
|
2723
|
-
header:
|
|
2724
|
-
cell: (
|
|
2725
|
-
const
|
|
2726
|
-
return (f == null ? void 0 : f.rowIndex) ===
|
|
2725
|
+
(I) => Y.accessor(($) => $.data[I.targetKey] || $.data[I.sourceColumn], {
|
|
2726
|
+
id: I.targetKey,
|
|
2727
|
+
header: I.label,
|
|
2728
|
+
cell: ($) => {
|
|
2729
|
+
const V = $.row.original.rowIndex, O = String($.getValue() ?? ""), H = F(V, I.targetKey);
|
|
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: [
|
|
2727
2731
|
/* @__PURE__ */ d(
|
|
2728
2732
|
"input",
|
|
2729
2733
|
{
|
|
2730
2734
|
type: "text",
|
|
2731
2735
|
value: y,
|
|
2732
|
-
onChange: (
|
|
2733
|
-
onKeyDown: (
|
|
2734
|
-
|
|
2736
|
+
onChange: (oe) => x(oe.target.value),
|
|
2737
|
+
onKeyDown: (oe) => {
|
|
2738
|
+
oe.key === "Enter" && ne(), oe.key === "Escape" && L();
|
|
2735
2739
|
},
|
|
2736
2740
|
className: "ff-input ff-py-2 ff-px-3 ff-text-sm ff-flex-1 ff-min-w-[160px]",
|
|
2737
2741
|
autoFocus: !0
|
|
@@ -2740,7 +2744,7 @@ const tt = ({
|
|
|
2740
2744
|
/* @__PURE__ */ d(
|
|
2741
2745
|
"button",
|
|
2742
2746
|
{
|
|
2743
|
-
onClick:
|
|
2747
|
+
onClick: ne,
|
|
2744
2748
|
className: "ff-btn ff-btn-primary ff-btn-sm ff-flex-shrink-0",
|
|
2745
2749
|
children: "Save"
|
|
2746
2750
|
}
|
|
@@ -2748,7 +2752,7 @@ const tt = ({
|
|
|
2748
2752
|
/* @__PURE__ */ d(
|
|
2749
2753
|
"button",
|
|
2750
2754
|
{
|
|
2751
|
-
onClick:
|
|
2755
|
+
onClick: L,
|
|
2752
2756
|
className: "ff-btn ff-btn-secondary ff-btn-sm ff-flex-shrink-0",
|
|
2753
2757
|
children: "Cancel"
|
|
2754
2758
|
}
|
|
@@ -2756,26 +2760,26 @@ const tt = ({
|
|
|
2756
2760
|
] }) : /* @__PURE__ */ h(
|
|
2757
2761
|
"div",
|
|
2758
2762
|
{
|
|
2759
|
-
className:
|
|
2763
|
+
className: ee(
|
|
2760
2764
|
"ff-group ff-flex ff-items-center ff-gap-2",
|
|
2761
|
-
(
|
|
2762
|
-
(
|
|
2765
|
+
(H == null ? void 0 : H.severity) === "error" && "ff-cell-error",
|
|
2766
|
+
(H == null ? void 0 : H.severity) === "warning" && "ff-cell-warning"
|
|
2763
2767
|
),
|
|
2764
2768
|
children: [
|
|
2765
|
-
/* @__PURE__ */ d("span", { className: "ff-flex-1 ff-truncate", children:
|
|
2766
|
-
|
|
2767
|
-
|
|
2769
|
+
/* @__PURE__ */ d("span", { className: "ff-flex-1 ff-truncate", children: O || /* @__PURE__ */ d("span", { style: { color: "var(--ff-text-muted)" }, children: "—" }) }),
|
|
2770
|
+
H && /* @__PURE__ */ h("div", { className: "ff-relative ff-group/tooltip", children: [
|
|
2771
|
+
H.severity === "error" ? /* @__PURE__ */ d(ze, { className: "ff-w-4 ff-h-4", style: { color: "var(--ff-error)" } }) : /* @__PURE__ */ d(Ve, { className: "ff-w-4 ff-h-4", style: { color: "var(--ff-warning)" } }),
|
|
2768
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: [
|
|
2769
|
-
|
|
2770
|
-
|
|
2773
|
+
H.message,
|
|
2774
|
+
H.suggestion && /* @__PURE__ */ d("span", { className: "ff-block ff-mt-1", style: { color: "var(--ff-text-muted)" }, children: H.suggestion })
|
|
2771
2775
|
] })
|
|
2772
2776
|
] }),
|
|
2773
2777
|
e && /* @__PURE__ */ d(
|
|
2774
2778
|
"button",
|
|
2775
2779
|
{
|
|
2776
|
-
onClick: () => P(
|
|
2780
|
+
onClick: () => P(V, I.targetKey, O),
|
|
2777
2781
|
className: "ff-opacity-0 group-hover:ff-opacity-100 ff-p-1 ff-rounded ff-transition-opacity ff-edit-btn",
|
|
2778
|
-
children: /* @__PURE__ */ d(
|
|
2782
|
+
children: /* @__PURE__ */ d(Xt, { className: "ff-w-3 ff-h-3" })
|
|
2779
2783
|
}
|
|
2780
2784
|
)
|
|
2781
2785
|
]
|
|
@@ -2787,20 +2791,20 @@ const tt = ({
|
|
|
2787
2791
|
// Delete button is now in the # column (first column) so it's always visible
|
|
2788
2792
|
// even when the table has many columns and requires horizontal scrolling.
|
|
2789
2793
|
],
|
|
2790
|
-
[N, f, y, e, o,
|
|
2791
|
-
),
|
|
2794
|
+
[N, f, y, e, o, F, Y]
|
|
2795
|
+
), B = eo({
|
|
2792
2796
|
data: l,
|
|
2793
|
-
columns:
|
|
2797
|
+
columns: z,
|
|
2794
2798
|
state: {
|
|
2795
2799
|
sorting: m,
|
|
2796
2800
|
globalFilter: C
|
|
2797
2801
|
},
|
|
2798
2802
|
onSortingChange: v,
|
|
2799
2803
|
onGlobalFilterChange: w,
|
|
2800
|
-
getCoreRowModel:
|
|
2801
|
-
getPaginationRowModel:
|
|
2802
|
-
getSortedRowModel:
|
|
2803
|
-
getFilteredRowModel:
|
|
2804
|
+
getCoreRowModel: Bn(),
|
|
2805
|
+
getPaginationRowModel: Zn(),
|
|
2806
|
+
getSortedRowModel: Wn(),
|
|
2807
|
+
getFilteredRowModel: Xn(),
|
|
2804
2808
|
initialState: {
|
|
2805
2809
|
pagination: {
|
|
2806
2810
|
pageSize: t
|
|
@@ -2814,60 +2818,60 @@ const tt = ({
|
|
|
2814
2818
|
{
|
|
2815
2819
|
type: "text",
|
|
2816
2820
|
value: C,
|
|
2817
|
-
onChange: (
|
|
2821
|
+
onChange: (I) => w(I.target.value),
|
|
2818
2822
|
placeholder: "Search all columns...",
|
|
2819
2823
|
className: "ff-input ff-max-w-xs"
|
|
2820
2824
|
}
|
|
2821
2825
|
),
|
|
2822
2826
|
/* @__PURE__ */ h("div", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
2823
|
-
|
|
2827
|
+
B.getFilteredRowModel().rows.length,
|
|
2824
2828
|
" rows"
|
|
2825
2829
|
] })
|
|
2826
2830
|
] }),
|
|
2827
2831
|
/* @__PURE__ */ d("div", { className: "ff-table-container ff-max-h-[500px]", children: /* @__PURE__ */ h("table", { className: "ff-table", children: [
|
|
2828
|
-
/* @__PURE__ */ d("thead", { children:
|
|
2832
|
+
/* @__PURE__ */ d("thead", { children: B.getHeaderGroups().map((I) => /* @__PURE__ */ d("tr", { children: I.headers.map(($) => /* @__PURE__ */ d(
|
|
2829
2833
|
"th",
|
|
2830
2834
|
{
|
|
2831
|
-
style: { width:
|
|
2832
|
-
onClick:
|
|
2833
|
-
className:
|
|
2834
|
-
|
|
2835
|
+
style: { width: $.getSize() },
|
|
2836
|
+
onClick: $.column.getToggleSortingHandler(),
|
|
2837
|
+
className: ee(
|
|
2838
|
+
$.column.getCanSort() && "ff-cursor-pointer ff-select-none"
|
|
2835
2839
|
),
|
|
2836
2840
|
children: /* @__PURE__ */ h("div", { className: "ff-flex ff-items-center ff-gap-1", children: [
|
|
2837
|
-
|
|
2838
|
-
|
|
2841
|
+
nt($.column.columnDef.header, $.getContext()),
|
|
2842
|
+
$.column.getIsSorted() && /* @__PURE__ */ d("span", { children: $.column.getIsSorted() === "asc" ? "↑" : "↓" })
|
|
2839
2843
|
] })
|
|
2840
2844
|
},
|
|
2841
|
-
|
|
2842
|
-
)) },
|
|
2843
|
-
/* @__PURE__ */ d("tbody", { children:
|
|
2844
|
-
const
|
|
2845
|
+
$.id
|
|
2846
|
+
)) }, I.id)) }),
|
|
2847
|
+
/* @__PURE__ */ d("tbody", { children: B.getRowModel().rows.map((I) => {
|
|
2848
|
+
const $ = u.has(I.original.rowIndex);
|
|
2845
2849
|
return /* @__PURE__ */ d(
|
|
2846
2850
|
"tr",
|
|
2847
2851
|
{
|
|
2848
|
-
className:
|
|
2849
|
-
children:
|
|
2852
|
+
className: ee($ && "ff-row-error"),
|
|
2853
|
+
children: I.getVisibleCells().map((V) => /* @__PURE__ */ d("td", { children: nt(V.column.columnDef.cell, V.getContext()) }, V.id))
|
|
2850
2854
|
},
|
|
2851
|
-
|
|
2855
|
+
I.id
|
|
2852
2856
|
);
|
|
2853
2857
|
}) })
|
|
2854
2858
|
] }) }),
|
|
2855
2859
|
/* @__PURE__ */ h("div", { className: "ff-flex ff-items-center ff-justify-between ff-px-2", children: [
|
|
2856
2860
|
/* @__PURE__ */ h("div", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
2857
2861
|
"Page ",
|
|
2858
|
-
|
|
2862
|
+
B.getState().pagination.pageIndex + 1,
|
|
2859
2863
|
" of ",
|
|
2860
|
-
|
|
2864
|
+
B.getPageCount()
|
|
2861
2865
|
] }),
|
|
2862
2866
|
/* @__PURE__ */ h("div", { className: "ff-flex ff-items-center ff-gap-2", children: [
|
|
2863
2867
|
/* @__PURE__ */ h(
|
|
2864
2868
|
"button",
|
|
2865
2869
|
{
|
|
2866
|
-
onClick: () =>
|
|
2867
|
-
disabled: !
|
|
2870
|
+
onClick: () => B.previousPage(),
|
|
2871
|
+
disabled: !B.getCanPreviousPage(),
|
|
2868
2872
|
className: "ff-btn ff-btn-secondary ff-btn-sm",
|
|
2869
2873
|
children: [
|
|
2870
|
-
/* @__PURE__ */ d(
|
|
2874
|
+
/* @__PURE__ */ d(Lt, { className: "ff-w-4 ff-h-4" }),
|
|
2871
2875
|
"Previous"
|
|
2872
2876
|
]
|
|
2873
2877
|
}
|
|
@@ -2875,22 +2879,22 @@ const tt = ({
|
|
|
2875
2879
|
/* @__PURE__ */ h(
|
|
2876
2880
|
"button",
|
|
2877
2881
|
{
|
|
2878
|
-
onClick: () =>
|
|
2879
|
-
disabled: !
|
|
2882
|
+
onClick: () => B.nextPage(),
|
|
2883
|
+
disabled: !B.getCanNextPage(),
|
|
2880
2884
|
className: "ff-btn ff-btn-secondary ff-btn-sm",
|
|
2881
2885
|
children: [
|
|
2882
2886
|
"Next",
|
|
2883
|
-
/* @__PURE__ */ d(
|
|
2887
|
+
/* @__PURE__ */ d(Nt, { className: "ff-w-4 ff-h-4" })
|
|
2884
2888
|
]
|
|
2885
2889
|
}
|
|
2886
2890
|
)
|
|
2887
2891
|
] })
|
|
2888
2892
|
] })
|
|
2889
2893
|
] });
|
|
2890
|
-
},
|
|
2894
|
+
}, rt = ({
|
|
2891
2895
|
showDetails: e = !0
|
|
2892
2896
|
}) => {
|
|
2893
|
-
const { validationResults: o } =
|
|
2897
|
+
const { validationResults: o } = le();
|
|
2894
2898
|
if (!o)
|
|
2895
2899
|
return null;
|
|
2896
2900
|
const { isValid: t, totalRows: n, validRows: r, errorCount: l, warningCount: s, infoCount: i, summary: u } = o, f = Math.round(r / n * 100);
|
|
@@ -2904,7 +2908,7 @@ const tt = ({
|
|
|
2904
2908
|
borderColor: t ? "var(--ff-success)" : "var(--ff-error)"
|
|
2905
2909
|
},
|
|
2906
2910
|
children: [
|
|
2907
|
-
t ? /* @__PURE__ */ d(
|
|
2911
|
+
t ? /* @__PURE__ */ d(Ae, { className: "ff-w-8 ff-h-8", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ d(Qe, { className: "ff-w-8 ff-h-8", style: { color: "var(--ff-error)" } }),
|
|
2908
2912
|
/* @__PURE__ */ h("div", { children: [
|
|
2909
2913
|
/* @__PURE__ */ d(
|
|
2910
2914
|
"h3",
|
|
@@ -2960,13 +2964,13 @@ const tt = ({
|
|
|
2960
2964
|
] }),
|
|
2961
2965
|
/* @__PURE__ */ h("div", { className: "ff-flex ff-items-center ff-gap-2 ff-flex-shrink-0", children: [
|
|
2962
2966
|
g.errorCount > 0 && /* @__PURE__ */ h("span", { className: "ff-badge ff-badge-error ff-whitespace-nowrap", children: [
|
|
2963
|
-
/* @__PURE__ */ d(
|
|
2967
|
+
/* @__PURE__ */ d(Qe, { className: "ff-w-3 ff-h-3 ff-mr-1" }),
|
|
2964
2968
|
g.errorCount,
|
|
2965
2969
|
" ",
|
|
2966
2970
|
g.errorCount === 1 ? "error" : "errors"
|
|
2967
2971
|
] }),
|
|
2968
2972
|
g.warningCount > 0 && /* @__PURE__ */ h("span", { className: "ff-badge ff-badge-warning ff-whitespace-nowrap", children: [
|
|
2969
|
-
/* @__PURE__ */ d(
|
|
2973
|
+
/* @__PURE__ */ d(Ve, { className: "ff-w-3 ff-h-3 ff-mr-1" }),
|
|
2970
2974
|
g.warningCount,
|
|
2971
2975
|
" ",
|
|
2972
2976
|
g.warningCount === 1 ? "warning" : "warnings"
|
|
@@ -2978,7 +2982,7 @@ const tt = ({
|
|
|
2978
2982
|
)) })
|
|
2979
2983
|
] }),
|
|
2980
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: [
|
|
2981
|
-
/* @__PURE__ */ d(
|
|
2985
|
+
/* @__PURE__ */ d(Ve, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
|
|
2982
2986
|
/* @__PURE__ */ h("div", { children: [
|
|
2983
2987
|
/* @__PURE__ */ d("h4", { className: "ff-font-medium", style: { color: "var(--ff-warning-dark)" }, children: "Duplicate Values Found" }),
|
|
2984
2988
|
/* @__PURE__ */ h("ul", { className: "ff-mt-2 ff-space-y-1 ff-text-sm", style: { color: "var(--ff-warning-dark)" }, children: [
|
|
@@ -3004,13 +3008,13 @@ const tt = ({
|
|
|
3004
3008
|
] })
|
|
3005
3009
|
] }) })
|
|
3006
3010
|
] });
|
|
3007
|
-
},
|
|
3008
|
-
{ key: "upload", label: "Upload", icon:
|
|
3009
|
-
{ key: "mapping", label: "Map Columns", icon:
|
|
3010
|
-
{ key: "validation", label: "Validate", icon:
|
|
3011
|
-
{ key: "review", label: "Review", icon:
|
|
3012
|
-
{ key: "complete", label: "Complete", icon:
|
|
3013
|
-
],
|
|
3011
|
+
}, Ne = ["upload", "mapping", "validation", "complete"], to = [
|
|
3012
|
+
{ key: "upload", label: "Upload", icon: lt },
|
|
3013
|
+
{ key: "mapping", label: "Map Columns", icon: qt },
|
|
3014
|
+
{ key: "validation", label: "Validate", icon: Wt },
|
|
3015
|
+
{ key: "review", label: "Review", icon: Gt },
|
|
3016
|
+
{ key: "complete", label: "Complete", icon: Ae }
|
|
3017
|
+
], so = ({
|
|
3014
3018
|
template: e,
|
|
3015
3019
|
schema: o,
|
|
3016
3020
|
mode: t = "modal",
|
|
@@ -3034,119 +3038,133 @@ const tt = ({
|
|
|
3034
3038
|
setMappings: y,
|
|
3035
3039
|
setUnmapped: x,
|
|
3036
3040
|
setValidationResults: N,
|
|
3037
|
-
setStep:
|
|
3041
|
+
setStep: F,
|
|
3038
3042
|
nextStep: P,
|
|
3039
|
-
previousStep:
|
|
3040
|
-
setLoading:
|
|
3041
|
-
setError:
|
|
3042
|
-
reset:
|
|
3043
|
-
} =
|
|
3044
|
-
|
|
3045
|
-
if (
|
|
3046
|
-
if (
|
|
3047
|
-
const
|
|
3048
|
-
|
|
3043
|
+
previousStep: ne,
|
|
3044
|
+
setLoading: L,
|
|
3045
|
+
setError: K,
|
|
3046
|
+
reset: Y
|
|
3047
|
+
} = le(), [z, B] = Q(null), [I, $] = Q(null), [V, O] = Q(0), [H, X] = Q("");
|
|
3048
|
+
We(() => {
|
|
3049
|
+
if ($(null), e)
|
|
3050
|
+
if (Mt(e)) {
|
|
3051
|
+
const _ = Vt(e);
|
|
3052
|
+
_ ? B(_) : ($(`Failed to load template "${e}"`), i == null || i(new Error(`Failed to load template "${e}"`)));
|
|
3049
3053
|
} else {
|
|
3050
|
-
const
|
|
3051
|
-
|
|
3054
|
+
const _ = `Template "${e}" not found. Available templates: ${Ye.join(", ")}`;
|
|
3055
|
+
$(_), i == null || i(new Error(_));
|
|
3052
3056
|
}
|
|
3053
3057
|
else if (o)
|
|
3054
|
-
|
|
3058
|
+
B(o);
|
|
3055
3059
|
else {
|
|
3056
|
-
const
|
|
3057
|
-
|
|
3060
|
+
const _ = `No template or schema provided. Please specify a template (${Ye.join(", ")}) or provide a custom schema.`;
|
|
3061
|
+
$(_), i == null || i(new Error(_));
|
|
3058
3062
|
}
|
|
3059
|
-
}, [e, o, i]),
|
|
3060
|
-
|
|
3061
|
-
}, [
|
|
3062
|
-
const
|
|
3063
|
+
}, [e, o, i]), We(() => {
|
|
3064
|
+
z && (v(z), oe(z));
|
|
3065
|
+
}, [z]);
|
|
3066
|
+
const oe = async (_) => {
|
|
3063
3067
|
try {
|
|
3064
|
-
|
|
3065
|
-
const k = await ie().createImportSession(
|
|
3068
|
+
L(!0);
|
|
3069
|
+
const k = await ie().createImportSession(_);
|
|
3066
3070
|
C(k.sessionId);
|
|
3067
|
-
} catch (
|
|
3068
|
-
const k =
|
|
3069
|
-
|
|
3071
|
+
} catch (M) {
|
|
3072
|
+
const k = M;
|
|
3073
|
+
K(k.message), i == null || i(k);
|
|
3070
3074
|
} finally {
|
|
3071
|
-
|
|
3075
|
+
L(!1);
|
|
3076
|
+
}
|
|
3077
|
+
}, mt = (_) => {
|
|
3078
|
+
const M = [];
|
|
3079
|
+
let k = "", G = !1;
|
|
3080
|
+
for (let D = 0; D < _.length; D++) {
|
|
3081
|
+
const E = _[D];
|
|
3082
|
+
E === '"' ? G && _[D + 1] === '"' ? (k += '"', D++) : G = !G : E === "," && !G ? (M.push(k.trim()), k = "") : k += E;
|
|
3072
3083
|
}
|
|
3073
|
-
|
|
3084
|
+
return M.push(k.trim()), M;
|
|
3085
|
+
}, ht = Le(async (_) => {
|
|
3074
3086
|
if (f)
|
|
3075
3087
|
try {
|
|
3076
|
-
|
|
3077
|
-
const
|
|
3078
|
-
|
|
3079
|
-
const k = await
|
|
3080
|
-
|
|
3081
|
-
const
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3088
|
+
L(!0), K(null), y([]), x([], []), N(null), O(10), X("Uploading file...");
|
|
3089
|
+
const M = ie();
|
|
3090
|
+
O(20), X("Uploading to server...");
|
|
3091
|
+
const k = await M.uploadFile(f, _);
|
|
3092
|
+
O(40), X("Parsing all rows...");
|
|
3093
|
+
const D = (await _.text()).split(`
|
|
3094
|
+
`).filter((Z) => Z.trim()), E = k.data.headers, U = D.slice(1).map((Z, ce) => {
|
|
3095
|
+
const Ue = mt(Z), Xe = {};
|
|
3096
|
+
return E.forEach((xt, _t) => {
|
|
3097
|
+
Xe[xt] = Ue[_t] || "";
|
|
3098
|
+
}), {
|
|
3099
|
+
rowIndex: ce,
|
|
3100
|
+
data: Xe,
|
|
3101
|
+
rawData: Ue
|
|
3102
|
+
};
|
|
3085
3103
|
});
|
|
3086
|
-
w({
|
|
3087
|
-
headers:
|
|
3088
|
-
rows:
|
|
3089
|
-
totalRows:
|
|
3090
|
-
sampleRows:
|
|
3091
|
-
}),
|
|
3092
|
-
} catch (
|
|
3093
|
-
|
|
3104
|
+
O(60), X("Processing rows..."), w({
|
|
3105
|
+
headers: E,
|
|
3106
|
+
rows: U,
|
|
3107
|
+
totalRows: U.length,
|
|
3108
|
+
sampleRows: U.slice(0, 5)
|
|
3109
|
+
}), O(80), X("Matching columns..."), F("mapping"), await vt(), O(100), X("Done");
|
|
3110
|
+
} catch (M) {
|
|
3111
|
+
K(`Failed to process the uploaded file: ${M.message}`);
|
|
3094
3112
|
} finally {
|
|
3095
|
-
|
|
3113
|
+
L(!1), O(0), X("");
|
|
3096
3114
|
}
|
|
3097
|
-
}, [f]),
|
|
3115
|
+
}, [f]), vt = async () => {
|
|
3098
3116
|
if (f)
|
|
3099
3117
|
try {
|
|
3100
|
-
|
|
3101
|
-
const
|
|
3102
|
-
y(
|
|
3103
|
-
} catch (
|
|
3104
|
-
|
|
3118
|
+
L(!0);
|
|
3119
|
+
const M = await ie().matchColumns(f);
|
|
3120
|
+
y(M.mappings), x(M.unmappedSource, M.unmappedTarget);
|
|
3121
|
+
} catch (_) {
|
|
3122
|
+
K(`Column matching failed: ${_.message}`);
|
|
3105
3123
|
} finally {
|
|
3106
|
-
|
|
3124
|
+
L(!1);
|
|
3107
3125
|
}
|
|
3108
|
-
},
|
|
3126
|
+
}, wt = async () => {
|
|
3109
3127
|
if (f)
|
|
3110
3128
|
try {
|
|
3111
|
-
|
|
3112
|
-
const
|
|
3113
|
-
N(
|
|
3114
|
-
} catch (
|
|
3115
|
-
|
|
3129
|
+
L(!0), K(null);
|
|
3130
|
+
const M = await ie().validateImport(f);
|
|
3131
|
+
N(M.validation), P();
|
|
3132
|
+
} catch (_) {
|
|
3133
|
+
K(`Validation failed: ${_.message}`);
|
|
3116
3134
|
} finally {
|
|
3117
|
-
|
|
3135
|
+
L(!1);
|
|
3118
3136
|
}
|
|
3119
|
-
}, [
|
|
3137
|
+
}, [Be, fe] = Q(null), [b, Ke] = Q(null), Ct = async () => {
|
|
3120
3138
|
if (f)
|
|
3121
3139
|
try {
|
|
3122
|
-
|
|
3140
|
+
L(!0), K(null), fe(null);
|
|
3123
3141
|
const k = await ie().completeImport(f, {
|
|
3124
3142
|
skipInvalidRows: !1,
|
|
3125
3143
|
acknowledgeWarnings: !0
|
|
3126
|
-
}),
|
|
3144
|
+
}), G = {
|
|
3127
3145
|
...k,
|
|
3128
|
-
data: (k.data || []).map((
|
|
3129
|
-
rowIndex:
|
|
3130
|
-
data:
|
|
3131
|
-
wasEdited:
|
|
3132
|
-
} :
|
|
3146
|
+
data: (k.data || []).map((D) => D.data && typeof D.data == "object" && !Array.isArray(D.data) ? {
|
|
3147
|
+
rowIndex: D.rowIndex ?? 0,
|
|
3148
|
+
data: D.data,
|
|
3149
|
+
wasEdited: D.wasEdited ?? !1
|
|
3150
|
+
} : D)
|
|
3133
3151
|
};
|
|
3134
|
-
|
|
3135
|
-
} catch (
|
|
3136
|
-
fe(
|
|
3152
|
+
Ke(G), F("complete"), l == null || l(G);
|
|
3153
|
+
} catch (_) {
|
|
3154
|
+
fe(_.message), F("complete");
|
|
3137
3155
|
} finally {
|
|
3138
|
-
|
|
3156
|
+
L(!1);
|
|
3139
3157
|
}
|
|
3140
3158
|
}, de = () => {
|
|
3141
|
-
|
|
3142
|
-
},
|
|
3143
|
-
fe(null),
|
|
3144
|
-
},
|
|
3159
|
+
Y(), s == null || s();
|
|
3160
|
+
}, je = () => {
|
|
3161
|
+
fe(null), Ke(null), O(0), X(""), Y(), z && (v(z), oe(z));
|
|
3162
|
+
}, yt = () => to.findIndex((_) => _.key === u), St = () => {
|
|
3145
3163
|
switch (u) {
|
|
3146
3164
|
case "upload":
|
|
3147
3165
|
return p !== null;
|
|
3148
3166
|
case "mapping":
|
|
3149
|
-
return g.length > 0 && g.some((
|
|
3167
|
+
return g.length > 0 && g.some((_) => _.targetKey !== null);
|
|
3150
3168
|
case "validation":
|
|
3151
3169
|
return c !== null;
|
|
3152
3170
|
case "review":
|
|
@@ -3154,121 +3172,121 @@ const tt = ({
|
|
|
3154
3172
|
default:
|
|
3155
3173
|
return !1;
|
|
3156
3174
|
}
|
|
3157
|
-
},
|
|
3175
|
+
}, Rt = async () => {
|
|
3158
3176
|
switch (u) {
|
|
3159
3177
|
case "mapping":
|
|
3160
|
-
await
|
|
3178
|
+
await wt();
|
|
3161
3179
|
break;
|
|
3162
3180
|
case "validation":
|
|
3163
3181
|
P();
|
|
3164
3182
|
break;
|
|
3165
3183
|
case "review":
|
|
3166
|
-
await
|
|
3184
|
+
await Ct();
|
|
3167
3185
|
break;
|
|
3168
3186
|
default:
|
|
3169
3187
|
P();
|
|
3170
3188
|
}
|
|
3171
3189
|
};
|
|
3172
|
-
if (
|
|
3173
|
-
return /* @__PURE__ */ d(
|
|
3174
|
-
/* @__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(
|
|
3190
|
+
if (I)
|
|
3191
|
+
return /* @__PURE__ */ d(Ce, { 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
|
+
/* @__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)" } }) }),
|
|
3175
3193
|
/* @__PURE__ */ d("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Configuration Error" }),
|
|
3176
|
-
/* @__PURE__ */ d("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children:
|
|
3194
|
+
/* @__PURE__ */ d("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children: I }),
|
|
3177
3195
|
s && /* @__PURE__ */ d("button", { onClick: de, className: "ff-btn ff-btn-secondary", children: "Close" })
|
|
3178
3196
|
] }) }) });
|
|
3179
|
-
if (!
|
|
3180
|
-
return /* @__PURE__ */ d(
|
|
3181
|
-
/* @__PURE__ */ d(
|
|
3197
|
+
if (!z)
|
|
3198
|
+
return /* @__PURE__ */ d(Ce, { 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
|
+
/* @__PURE__ */ d(ge, { className: "ff-w-10 ff-h-10 ff-animate-spin ff-mb-4", style: { color: "var(--ff-primary-90)" } }),
|
|
3182
3200
|
/* @__PURE__ */ d("p", { style: { color: "var(--ff-text-muted)" }, children: "Loading template..." })
|
|
3183
3201
|
] }) }) });
|
|
3184
|
-
const
|
|
3185
|
-
const
|
|
3186
|
-
return
|
|
3187
|
-
},
|
|
3202
|
+
const se = () => {
|
|
3203
|
+
const _ = u === "review" ? "validation" : u;
|
|
3204
|
+
return Ne.indexOf(_);
|
|
3205
|
+
}, qe = /* @__PURE__ */ d(re, { children: /* @__PURE__ */ h("div", { className: t === "embed" ? "ff-container ff-embed" : "ff-container ff-modal", children: [
|
|
3188
3206
|
/* @__PURE__ */ h("div", { className: "ff-modal-header", children: [
|
|
3189
3207
|
/* @__PURE__ */ h("div", { className: "ff-modal-header-left", children: [
|
|
3190
3208
|
/* @__PURE__ */ h("div", { className: "ff-flex ff-items-center ff-gap-3", children: [
|
|
3191
|
-
/* @__PURE__ */ d("div", { className: "ff-modal-icon", children: /* @__PURE__ */ d(
|
|
3209
|
+
/* @__PURE__ */ d("div", { className: "ff-modal-icon", children: /* @__PURE__ */ d(Tt, {}) }),
|
|
3192
3210
|
/* @__PURE__ */ d("h2", { className: "ff-modal-title", children: "Import Data" })
|
|
3193
3211
|
] }),
|
|
3194
|
-
/* @__PURE__ */ d("div", { className: "ff-steps ff-ml-4", children:
|
|
3212
|
+
/* @__PURE__ */ d("div", { className: "ff-steps ff-ml-4", children: Ne.map((_, M) => /* @__PURE__ */ h(Ft.Fragment, { children: [
|
|
3195
3213
|
/* @__PURE__ */ d(
|
|
3196
3214
|
"div",
|
|
3197
3215
|
{
|
|
3198
|
-
className:
|
|
3216
|
+
className: ee(
|
|
3199
3217
|
"ff-step",
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3218
|
+
se() === M && "ff-step-active",
|
|
3219
|
+
se() > M && "ff-step-complete",
|
|
3220
|
+
se() < M && "ff-step-pending"
|
|
3203
3221
|
),
|
|
3204
|
-
children:
|
|
3222
|
+
children: se() > M ? "✓" : M + 1
|
|
3205
3223
|
}
|
|
3206
3224
|
),
|
|
3207
|
-
|
|
3225
|
+
M < Ne.length - 1 && /* @__PURE__ */ d("div", { className: ee(
|
|
3208
3226
|
"ff-step-connector",
|
|
3209
|
-
|
|
3227
|
+
se() > M && "ff-step-connector-complete"
|
|
3210
3228
|
) })
|
|
3211
|
-
] },
|
|
3229
|
+
] }, _)) })
|
|
3212
3230
|
] }),
|
|
3213
3231
|
/* @__PURE__ */ d(
|
|
3214
3232
|
"button",
|
|
3215
3233
|
{
|
|
3216
3234
|
onClick: de,
|
|
3217
3235
|
className: "ff-modal-close",
|
|
3218
|
-
children: /* @__PURE__ */ d(
|
|
3236
|
+
children: /* @__PURE__ */ d(ve, { className: "ff-w-5 ff-h-5" })
|
|
3219
3237
|
}
|
|
3220
3238
|
)
|
|
3221
3239
|
] }),
|
|
3222
3240
|
/* @__PURE__ */ h("div", { className: "ff-modal-body", children: [
|
|
3223
3241
|
m && /* @__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: m }),
|
|
3224
|
-
u === "upload" && /* @__PURE__ */ d("div", { className: "ff-py-4", children: /* @__PURE__ */ d("div", { className: "ff-max-w-xl ff-mx-auto", children: a &&
|
|
3225
|
-
/* @__PURE__ */ d(
|
|
3226
|
-
/* @__PURE__ */ d("p", { className: "ff-font-medium ff-mb-2", style: { color: "var(--ff-text-primary)" }, children:
|
|
3242
|
+
u === "upload" && /* @__PURE__ */ d("div", { className: "ff-py-4", children: /* @__PURE__ */ d("div", { className: "ff-max-w-xl ff-mx-auto", children: a && V > 0 ? /* @__PURE__ */ h("div", { className: "ff-p-8 ff-text-center", children: [
|
|
3243
|
+
/* @__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: H }),
|
|
3227
3245
|
/* @__PURE__ */ d("div", { className: "ff-progress ff-w-full ff-max-w-xs ff-mx-auto ff-mb-2", children: /* @__PURE__ */ d(
|
|
3228
3246
|
"div",
|
|
3229
3247
|
{
|
|
3230
3248
|
className: "ff-progress-bar",
|
|
3231
|
-
style: { width: `${
|
|
3249
|
+
style: { width: `${V}%`, transition: "width 0.3s ease" }
|
|
3232
3250
|
}
|
|
3233
3251
|
) }),
|
|
3234
3252
|
/* @__PURE__ */ h("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
3235
|
-
|
|
3253
|
+
V,
|
|
3236
3254
|
"% complete"
|
|
3237
3255
|
] })
|
|
3238
|
-
] }) : /* @__PURE__ */ d(
|
|
3239
|
-
u === "mapping" && (a &&
|
|
3240
|
-
/* @__PURE__ */ d(
|
|
3241
|
-
/* @__PURE__ */ d("p", { className: "ff-font-medium ff-mb-3", style: { color: "var(--ff-text-primary)" }, children:
|
|
3256
|
+
] }) : /* @__PURE__ */ d(en, { onFileSelect: ht }) }) }),
|
|
3257
|
+
u === "mapping" && (a && V > 0 ? /* @__PURE__ */ h("div", { className: "ff-py-12 ff-text-center", children: [
|
|
3258
|
+
/* @__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: H }),
|
|
3242
3260
|
/* @__PURE__ */ d("div", { className: "ff-progress ff-w-full ff-max-w-xs ff-mx-auto ff-mb-2", children: /* @__PURE__ */ d(
|
|
3243
3261
|
"div",
|
|
3244
3262
|
{
|
|
3245
3263
|
className: "ff-progress-bar",
|
|
3246
|
-
style: { width: `${
|
|
3264
|
+
style: { width: `${V}%`, transition: "width 0.3s ease" }
|
|
3247
3265
|
}
|
|
3248
3266
|
) }),
|
|
3249
3267
|
/* @__PURE__ */ h("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
3250
|
-
|
|
3268
|
+
V,
|
|
3251
3269
|
"% complete"
|
|
3252
3270
|
] })
|
|
3253
|
-
] }) : /* @__PURE__ */ d(
|
|
3271
|
+
] }) : /* @__PURE__ */ d(tn, {})),
|
|
3254
3272
|
u === "validation" && /* @__PURE__ */ h("div", { className: "ff-space-y-6", children: [
|
|
3255
|
-
/* @__PURE__ */ d(
|
|
3256
|
-
/* @__PURE__ */ d(
|
|
3273
|
+
/* @__PURE__ */ d(rt, {}),
|
|
3274
|
+
/* @__PURE__ */ d(ot, { editable: !0 })
|
|
3257
3275
|
] }),
|
|
3258
3276
|
u === "review" && /* @__PURE__ */ h("div", { className: "ff-space-y-6", children: [
|
|
3259
|
-
/* @__PURE__ */ d(
|
|
3260
|
-
/* @__PURE__ */ d(
|
|
3277
|
+
/* @__PURE__ */ d(rt, { showDetails: !1 }),
|
|
3278
|
+
/* @__PURE__ */ d(ot, { editable: !1, pageSize: 10 })
|
|
3261
3279
|
] }),
|
|
3262
|
-
u === "complete" && /* @__PURE__ */ d("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children:
|
|
3263
|
-
/* @__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(
|
|
3280
|
+
u === "complete" && /* @__PURE__ */ d("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-8", children: Be ? /* @__PURE__ */ h(re, { children: [
|
|
3281
|
+
/* @__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)" } }) }),
|
|
3264
3282
|
/* @__PURE__ */ d("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Import Failed" }),
|
|
3265
|
-
/* @__PURE__ */ d("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children:
|
|
3283
|
+
/* @__PURE__ */ d("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children: Be }),
|
|
3266
3284
|
/* @__PURE__ */ h("div", { className: "ff-flex ff-gap-3", children: [
|
|
3267
3285
|
/* @__PURE__ */ d(
|
|
3268
3286
|
"button",
|
|
3269
3287
|
{
|
|
3270
3288
|
onClick: () => {
|
|
3271
|
-
fe(null),
|
|
3289
|
+
fe(null), F("review");
|
|
3272
3290
|
},
|
|
3273
3291
|
className: "ff-btn ff-btn-secondary",
|
|
3274
3292
|
children: "Back to Review"
|
|
@@ -3276,8 +3294,8 @@ const tt = ({
|
|
|
3276
3294
|
),
|
|
3277
3295
|
s && /* @__PURE__ */ d("button", { onClick: de, className: "ff-btn ff-btn-secondary", children: "Close" })
|
|
3278
3296
|
] })
|
|
3279
|
-
] }) : /* @__PURE__ */ h(
|
|
3280
|
-
/* @__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(
|
|
3297
|
+
] }) : /* @__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(Ae, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-success)" } }) }),
|
|
3281
3299
|
/* @__PURE__ */ d("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Import Complete!" }),
|
|
3282
3300
|
/* @__PURE__ */ d("p", { className: "ff-mb-6", style: { color: "var(--ff-text-muted)" }, children: "Your data has been successfully imported." }),
|
|
3283
3301
|
/* @__PURE__ */ h("div", { className: "ff-flex ff-gap-6 ff-mb-6", children: [
|
|
@@ -3294,34 +3312,34 @@ const tt = ({
|
|
|
3294
3312
|
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-warning)" }, children: "Skipped" })
|
|
3295
3313
|
] }),
|
|
3296
3314
|
/* @__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: [
|
|
3297
|
-
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-text-primary)" }, children: g.filter((
|
|
3315
|
+
/* @__PURE__ */ d("p", { className: "ff-text-2xl ff-font-bold", style: { color: "var(--ff-text-primary)" }, children: g.filter((_) => _.targetKey !== null).length }),
|
|
3298
3316
|
/* @__PURE__ */ d("p", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: "Columns Mapped" })
|
|
3299
3317
|
] })
|
|
3300
3318
|
] }),
|
|
3301
3319
|
(b == null ? void 0 : b.data) && b.data.length > 0 && (() => {
|
|
3302
|
-
const
|
|
3303
|
-
return
|
|
3320
|
+
const _ = b.data.slice(0, 5), M = _[0], k = (M == null ? void 0 : M.data) || M, G = Object.keys(typeof k == "object" ? k : {}).slice(0, 6), D = (z == null ? void 0 : z.columns) || [];
|
|
3321
|
+
return G.length === 0 ? null : /* @__PURE__ */ h("div", { className: "ff-w-full ff-mb-6", children: [
|
|
3304
3322
|
/* @__PURE__ */ h("p", { className: "ff-text-xs ff-font-semibold ff-uppercase ff-tracking-wider ff-mb-2", style: { color: "var(--ff-text-muted)" }, children: [
|
|
3305
3323
|
"Data Preview (first ",
|
|
3306
|
-
|
|
3324
|
+
_.length,
|
|
3307
3325
|
" rows)"
|
|
3308
3326
|
] }),
|
|
3309
3327
|
/* @__PURE__ */ d("div", { className: "ff-table-container ff-max-h-[250px]", children: /* @__PURE__ */ h("table", { className: "ff-table", children: [
|
|
3310
3328
|
/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ h("tr", { children: [
|
|
3311
3329
|
/* @__PURE__ */ d("th", { style: { width: 40 }, children: "#" }),
|
|
3312
|
-
|
|
3313
|
-
const
|
|
3314
|
-
return /* @__PURE__ */ d("th", { children: (
|
|
3330
|
+
G.map((E) => {
|
|
3331
|
+
const U = D.find((Z) => Z.key === E);
|
|
3332
|
+
return /* @__PURE__ */ d("th", { children: (U == null ? void 0 : U.label) || E }, E);
|
|
3315
3333
|
}),
|
|
3316
|
-
|
|
3334
|
+
G.length < Object.keys(typeof k == "object" ? k : {}).length && /* @__PURE__ */ d("th", { children: "..." })
|
|
3317
3335
|
] }) }),
|
|
3318
|
-
/* @__PURE__ */ d("tbody", { children:
|
|
3319
|
-
const
|
|
3336
|
+
/* @__PURE__ */ d("tbody", { children: _.map((E, U) => {
|
|
3337
|
+
const Z = (E == null ? void 0 : E.data) || E;
|
|
3320
3338
|
return /* @__PURE__ */ h("tr", { children: [
|
|
3321
|
-
/* @__PURE__ */ d("td", { children: /* @__PURE__ */ d("span", { className: "ff-font-mono ff-text-xs", style: { color: "var(--ff-text-muted)" }, children: ((
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
] },
|
|
3339
|
+
/* @__PURE__ */ d("td", { children: /* @__PURE__ */ d("span", { className: "ff-font-mono ff-text-xs", style: { color: "var(--ff-text-muted)" }, children: ((E == null ? void 0 : E.rowIndex) ?? U) + 1 }) }),
|
|
3340
|
+
G.map((ce) => /* @__PURE__ */ d("td", { children: /* @__PURE__ */ d("span", { className: "ff-text-sm ff-truncate ff-block ff-max-w-[150px]", children: String((Z == null ? void 0 : Z[ce]) ?? "—") }) }, ce)),
|
|
3341
|
+
G.length < Object.keys(typeof k == "object" ? k : {}).length && /* @__PURE__ */ d("td", { children: /* @__PURE__ */ d("span", { style: { color: "var(--ff-text-muted)" }, children: "..." }) })
|
|
3342
|
+
] }, U);
|
|
3325
3343
|
}) })
|
|
3326
3344
|
] }) }),
|
|
3327
3345
|
b.data.length > 5 && /* @__PURE__ */ h("p", { className: "ff-text-xs ff-mt-1", style: { color: "var(--ff-text-muted)" }, children: [
|
|
@@ -3335,7 +3353,7 @@ const tt = ({
|
|
|
3335
3353
|
/* @__PURE__ */ d(
|
|
3336
3354
|
"button",
|
|
3337
3355
|
{
|
|
3338
|
-
onClick:
|
|
3356
|
+
onClick: je,
|
|
3339
3357
|
className: "ff-btn ff-btn-primary",
|
|
3340
3358
|
children: "Start New Import"
|
|
3341
3359
|
}
|
|
@@ -3344,15 +3362,15 @@ const tt = ({
|
|
|
3344
3362
|
] })
|
|
3345
3363
|
] }) })
|
|
3346
3364
|
] }),
|
|
3347
|
-
/* @__PURE__ */ d("div", { className: "ff-modal-footer", children: u === "complete" ? /* @__PURE__ */ h(
|
|
3365
|
+
/* @__PURE__ */ d("div", { className: "ff-modal-footer", children: u === "complete" ? /* @__PURE__ */ h(re, { children: [
|
|
3348
3366
|
/* @__PURE__ */ d("div", {}),
|
|
3349
|
-
/* @__PURE__ */ d("button", { onClick:
|
|
3350
|
-
] }) : /* @__PURE__ */ h(
|
|
3367
|
+
/* @__PURE__ */ d("button", { onClick: je, className: "ff-btn ff-btn-primary", children: "Start New Import" })
|
|
3368
|
+
] }) : /* @__PURE__ */ h(re, { children: [
|
|
3351
3369
|
/* @__PURE__ */ d(
|
|
3352
3370
|
"button",
|
|
3353
3371
|
{
|
|
3354
|
-
onClick:
|
|
3355
|
-
disabled:
|
|
3372
|
+
onClick: ne,
|
|
3373
|
+
disabled: yt() === 0 || a,
|
|
3356
3374
|
className: "ff-btn ff-btn-ghost",
|
|
3357
3375
|
children: "Back"
|
|
3358
3376
|
}
|
|
@@ -3360,25 +3378,25 @@ const tt = ({
|
|
|
3360
3378
|
/* @__PURE__ */ d(
|
|
3361
3379
|
"button",
|
|
3362
3380
|
{
|
|
3363
|
-
onClick:
|
|
3364
|
-
disabled: !
|
|
3381
|
+
onClick: Rt,
|
|
3382
|
+
disabled: !St() || a,
|
|
3365
3383
|
className: "ff-btn ff-btn-primary",
|
|
3366
|
-
children: a ? /* @__PURE__ */ h(
|
|
3367
|
-
/* @__PURE__ */ d(
|
|
3384
|
+
children: a ? /* @__PURE__ */ h(re, { children: [
|
|
3385
|
+
/* @__PURE__ */ d(ge, { className: "ff-w-4 ff-h-4 ff-animate-spin" }),
|
|
3368
3386
|
"Processing..."
|
|
3369
3387
|
] }) : u === "review" ? "Complete Import" : "Continue"
|
|
3370
3388
|
}
|
|
3371
3389
|
)
|
|
3372
3390
|
] }) })
|
|
3373
3391
|
] }) });
|
|
3374
|
-
return /* @__PURE__ */ d(
|
|
3392
|
+
return /* @__PURE__ */ d(Ce, { theme: n, useShadowDom: r, children: t === "modal" ? /* @__PURE__ */ d("div", { className: "ff-overlay", children: qe }) : qe });
|
|
3375
3393
|
};
|
|
3376
3394
|
export {
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3395
|
+
tn as C,
|
|
3396
|
+
ot as D,
|
|
3397
|
+
en as F,
|
|
3398
|
+
so as I,
|
|
3399
|
+
rt as V,
|
|
3400
|
+
le as u
|
|
3383
3401
|
};
|
|
3384
|
-
//# sourceMappingURL=ImportWizard-
|
|
3402
|
+
//# sourceMappingURL=ImportWizard-CdHW2xzf.mjs.map
|