@fileflow/sdk 0.1.18 → 0.1.19
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-Dakb05xc.js → ImportWizard-Ct_0XYe5.js} +16 -16
- package/dist/ImportWizard-Ct_0XYe5.js.map +1 -0
- package/dist/{ImportWizard-D4GlHhyY.mjs → ImportWizard-wQRSiaEP.mjs} +483 -477
- package/dist/ImportWizard-wQRSiaEP.mjs.map +1 -0
- package/dist/{KYCWizard-Bk9-GvOh.js → KYCWizard-BCUzLLBj.js} +2 -2
- package/dist/{KYCWizard-Bk9-GvOh.js.map → KYCWizard-BCUzLLBj.js.map} +1 -1
- package/dist/{KYCWizard-BZW0dZ2x.mjs → KYCWizard-BHL5pJzV.mjs} +2 -2
- package/dist/{KYCWizard-BZW0dZ2x.mjs.map → KYCWizard-BHL5pJzV.mjs.map} +1 -1
- package/dist/import.js +1 -1
- package/dist/import.mjs +1 -1
- package/dist/{index-CLgI0mua.js → index-BHPobN9B.js} +2 -2
- package/dist/{index-CLgI0mua.js.map → index-BHPobN9B.js.map} +1 -1
- package/dist/{index-DnkwOjwi.mjs → index-oYOmMOWf.mjs} +2 -2
- package/dist/{index-DnkwOjwi.mjs.map → index-oYOmMOWf.mjs.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +3 -3
- package/dist/kyc.js +1 -1
- package/dist/kyc.mjs +1 -1
- package/dist/styles.css +15 -6
- package/package.json +1 -1
- package/dist/ImportWizard-D4GlHhyY.mjs.map +0 -1
- package/dist/ImportWizard-Dakb05xc.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as g, jsxs as v, Fragment as oe } from "react/jsx-runtime";
|
|
2
2
|
import * as Se from "react";
|
|
3
|
-
import ut, { useCallback as Me, useState as Y, useMemo as
|
|
4
|
-
import { h as G, j as ft, k as dt, X as se, m as j, U as Xe, n as Ie, T as Re, q as gt, p as Ve, o as Ge, t as ct, d as pt, V as Oe, g as ee, S as de, L as be } from "./index-
|
|
3
|
+
import ut, { useCallback as Me, useState as Y, useMemo as He, useEffect as Ae } from "react";
|
|
4
|
+
import { h as G, j as ft, k as dt, X as se, m as j, U as Xe, n as Ie, T as Re, q as gt, p as Ve, o as Ge, t as ct, d as pt, V as Oe, g as ee, S as de, L as be } from "./index-oYOmMOWf.mjs";
|
|
5
5
|
/**
|
|
6
6
|
* @license lucide-react v0.563.0 - ISC
|
|
7
7
|
*
|
|
@@ -18,7 +18,7 @@ const mt = [
|
|
|
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 wt = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], vt = G("check", wt);
|
|
22
22
|
/**
|
|
23
23
|
* @license lucide-react v0.563.0 - ISC
|
|
24
24
|
*
|
|
@@ -141,7 +141,7 @@ const Lt = [
|
|
|
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
|
+
], zt = G("trash-2", Lt), Be = {
|
|
145
145
|
sessionId: null,
|
|
146
146
|
status: "idle",
|
|
147
147
|
step: "upload",
|
|
@@ -208,54 +208,60 @@ const Lt = [
|
|
|
208
208
|
}),
|
|
209
209
|
stopEditing: () => e({ editingCell: null }),
|
|
210
210
|
updateCell: (t, n, r) => e((l) => {
|
|
211
|
-
const i = [...l.rows],
|
|
212
|
-
|
|
213
|
-
const
|
|
214
|
-
return
|
|
211
|
+
const i = [...l.rows], a = i.find((f) => f.rowIndex === t);
|
|
212
|
+
a && (a.data = { ...a.data, [n]: String(r) });
|
|
213
|
+
const u = new Set(l.editedRows);
|
|
214
|
+
return u.add(t), { rows: i, editedRows: u, editingCell: null };
|
|
215
215
|
}),
|
|
216
216
|
deleteRow: (t) => e((n) => {
|
|
217
|
-
|
|
218
|
-
n.
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
217
|
+
var h;
|
|
218
|
+
const l = n.rows.filter((w) => w.rowIndex !== t).map((w, C) => ({ ...w, rowIndex: C })), i = /* @__PURE__ */ new Map();
|
|
219
|
+
n.errorsByRow.forEach((w, C) => {
|
|
220
|
+
if (C !== t) {
|
|
221
|
+
const x = C > t ? C - 1 : C;
|
|
222
|
+
i.set(x, w.map((F) => ({ ...F, rowIndex: x })));
|
|
222
223
|
}
|
|
223
224
|
});
|
|
224
|
-
const s = n.validationResults ? {
|
|
225
|
+
const a = l.length, u = ((h = n.validationResults) == null ? void 0 : h.errors.filter((w) => w.rowIndex !== t).map((w) => ({ ...w, rowIndex: w.rowIndex > t ? w.rowIndex - 1 : w.rowIndex }))) || [], f = u.filter((w) => w.severity === "error").length, p = u.filter((w) => w.severity === "warning").length, c = u.filter((w) => w.severity === "info").length, d = new Set(u.filter((w) => w.severity === "error").map((w) => w.rowIndex)), s = a - d.size, m = n.validationResults ? {
|
|
225
226
|
...n.validationResults,
|
|
226
|
-
totalRows:
|
|
227
|
-
|
|
227
|
+
totalRows: a,
|
|
228
|
+
validRows: s,
|
|
229
|
+
errorCount: f,
|
|
230
|
+
warningCount: p,
|
|
231
|
+
infoCount: c,
|
|
232
|
+
isValid: f === 0,
|
|
233
|
+
errors: u
|
|
228
234
|
} : null;
|
|
229
235
|
return {
|
|
230
236
|
rows: l,
|
|
231
237
|
totalRows: l.length,
|
|
232
238
|
errorsByRow: i,
|
|
233
|
-
validationResults:
|
|
239
|
+
validationResults: m
|
|
234
240
|
};
|
|
235
241
|
}),
|
|
236
242
|
setStatus: (t) => e({ status: t }),
|
|
237
243
|
setLoading: (t) => e({ isLoading: t }),
|
|
238
244
|
setError: (t) => e({ error: t }),
|
|
239
245
|
reset: () => e(Be)
|
|
240
|
-
})),
|
|
246
|
+
})), Ht = ({
|
|
241
247
|
onFileSelect: e,
|
|
242
248
|
maxSize: o = 50 * 1024 * 1024,
|
|
243
249
|
// 50MB
|
|
244
250
|
acceptedTypes: t = [".csv", ".xlsx", ".xls"]
|
|
245
251
|
}) => {
|
|
246
|
-
const { file: n, fileName: r, fileSize: l, setFile: i, error:
|
|
247
|
-
(w,
|
|
248
|
-
if (
|
|
249
|
-
|
|
252
|
+
const { file: n, fileName: r, fileSize: l, setFile: i, error: a, setError: u, isLoading: f } = J(), p = Me(
|
|
253
|
+
(w, C) => {
|
|
254
|
+
if (C.length > 0) {
|
|
255
|
+
u("Invalid file type or file too large");
|
|
250
256
|
return;
|
|
251
257
|
}
|
|
252
258
|
if (w.length > 0) {
|
|
253
|
-
const
|
|
254
|
-
i(
|
|
259
|
+
const x = w[0];
|
|
260
|
+
i(x), e == null || e(x);
|
|
255
261
|
}
|
|
256
262
|
},
|
|
257
|
-
[e, i,
|
|
258
|
-
), { getRootProps: c, getInputProps: d, isDragActive:
|
|
263
|
+
[e, i, u]
|
|
264
|
+
), { getRootProps: c, getInputProps: d, isDragActive: s } = dt({
|
|
259
265
|
onDrop: p,
|
|
260
266
|
accept: {
|
|
261
267
|
"text/csv": [".csv"],
|
|
@@ -291,13 +297,13 @@ const Lt = [
|
|
|
291
297
|
...c(),
|
|
292
298
|
className: j(
|
|
293
299
|
"ff-dropzone",
|
|
294
|
-
|
|
300
|
+
s && "ff-dropzone-active",
|
|
295
301
|
f && "ff-opacity-50 ff-cursor-not-allowed"
|
|
296
302
|
),
|
|
297
303
|
children: [
|
|
298
304
|
/* @__PURE__ */ g("input", { ...d() }),
|
|
299
305
|
/* @__PURE__ */ g("div", { className: "ff-dropzone-icon-wrapper", children: /* @__PURE__ */ g(Xe, { className: "ff-dropzone-icon" }) }),
|
|
300
|
-
/* @__PURE__ */ g("h3", { className: "ff-dropzone-text", children:
|
|
306
|
+
/* @__PURE__ */ g("h3", { className: "ff-dropzone-text", children: s ? "Drop your file here" : "Upload your file" }),
|
|
301
307
|
/* @__PURE__ */ g("p", { className: "ff-dropzone-hint", children: "Drag and drop or click to select" }),
|
|
302
308
|
/* @__PURE__ */ g("label", { className: "ff-inline-block", children: /* @__PURE__ */ g("span", { className: j(
|
|
303
309
|
"ff-btn ff-btn-primary",
|
|
@@ -312,16 +318,16 @@ const Lt = [
|
|
|
312
318
|
]
|
|
313
319
|
}
|
|
314
320
|
),
|
|
315
|
-
|
|
321
|
+
a && /* @__PURE__ */ v("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: [
|
|
316
322
|
/* @__PURE__ */ g(Ie, { className: "ff-w-4 ff-h-4 ff-flex-shrink-0" }),
|
|
317
|
-
/* @__PURE__ */ g("p", { children:
|
|
323
|
+
/* @__PURE__ */ g("p", { children: a })
|
|
318
324
|
] })
|
|
319
325
|
] });
|
|
320
326
|
}, At = ({ onMappingChange: e }) => {
|
|
321
327
|
const { mappings: o, schema: t, unmappedSource: n, updateMapping: r } = J(), l = (t == null ? void 0 : t.columns) || [], i = (c, d) => {
|
|
322
|
-
const
|
|
323
|
-
r(c,
|
|
324
|
-
},
|
|
328
|
+
const s = d === "" ? null : d;
|
|
329
|
+
r(c, s), e == null || e(c, s);
|
|
330
|
+
}, a = (c) => c >= 0.85 ? "var(--ff-success)" : c >= 0.6 ? "var(--ff-warning)" : "var(--ff-error)", u = (c) => c >= 0.85 ? "High" : c >= 0.6 ? "Medium" : "Low", p = new Set(
|
|
325
331
|
o.filter((c) => c.targetKey !== null).map((c) => c.targetKey)
|
|
326
332
|
);
|
|
327
333
|
return /* @__PURE__ */ v("div", { className: "ff-space-y-4", children: [
|
|
@@ -347,14 +353,14 @@ const Lt = [
|
|
|
347
353
|
] }),
|
|
348
354
|
/* @__PURE__ */ g("div", { className: "ff-space-y-2", children: o.map((c) => {
|
|
349
355
|
l.find((m) => m.key === c.targetKey);
|
|
350
|
-
const d = c.targetKey !== null,
|
|
356
|
+
const d = c.targetKey !== null, s = c.confidence >= 0.85;
|
|
351
357
|
return /* @__PURE__ */ v(
|
|
352
358
|
"div",
|
|
353
359
|
{
|
|
354
360
|
className: j(
|
|
355
361
|
"ff-mapping-row",
|
|
356
|
-
d &&
|
|
357
|
-
d && !
|
|
362
|
+
d && s && "ff-mapping-row-success",
|
|
363
|
+
d && !s && "ff-mapping-row-warning"
|
|
358
364
|
),
|
|
359
365
|
children: [
|
|
360
366
|
/* @__PURE__ */ g("div", { className: "ff-flex-1", children: /* @__PURE__ */ g("div", { className: "ff-mapping-source", children: c.sourceColumn }) }),
|
|
@@ -385,15 +391,15 @@ const Lt = [
|
|
|
385
391
|
]
|
|
386
392
|
}
|
|
387
393
|
) }),
|
|
388
|
-
/* @__PURE__ */ g("div", { className: "ff-mapping-status", children: d ?
|
|
389
|
-
c.confidence > 0 && /* @__PURE__ */ v("div", { className: "ff-confidence", style: { color:
|
|
394
|
+
/* @__PURE__ */ g("div", { className: "ff-mapping-status", children: d ? s ? /* @__PURE__ */ g(vt, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-success)" } }) : /* @__PURE__ */ g(yt, { className: "ff-w-5 ff-h-5", style: { color: "var(--ff-warning)" } }) : /* @__PURE__ */ g("span", { className: "ff-w-5 ff-h-5" }) }),
|
|
395
|
+
c.confidence > 0 && /* @__PURE__ */ v("div", { className: "ff-confidence", style: { color: a(c.confidence) }, children: [
|
|
390
396
|
/* @__PURE__ */ v("span", { children: [
|
|
391
397
|
Math.round(c.confidence * 100),
|
|
392
398
|
"%"
|
|
393
399
|
] }),
|
|
394
400
|
/* @__PURE__ */ v("span", { style: { color: "var(--ff-text-muted)" }, children: [
|
|
395
401
|
"(",
|
|
396
|
-
|
|
402
|
+
u(c.confidence),
|
|
397
403
|
")"
|
|
398
404
|
] })
|
|
399
405
|
] })
|
|
@@ -466,23 +472,23 @@ function bt(e, o) {
|
|
|
466
472
|
};
|
|
467
473
|
return n(e), t;
|
|
468
474
|
}
|
|
469
|
-
function
|
|
475
|
+
function S(e, o, t) {
|
|
470
476
|
let n = [], r;
|
|
471
477
|
return (l) => {
|
|
472
478
|
let i;
|
|
473
479
|
t.key && t.debug && (i = Date.now());
|
|
474
|
-
const
|
|
475
|
-
if (!(
|
|
480
|
+
const a = e(l);
|
|
481
|
+
if (!(a.length !== n.length || a.some((p, c) => n[c] !== p)))
|
|
476
482
|
return r;
|
|
477
|
-
n =
|
|
483
|
+
n = a;
|
|
478
484
|
let f;
|
|
479
|
-
if (t.key && t.debug && (f = Date.now()), r = o(...
|
|
480
|
-
const p = Math.round((Date.now() - i) * 100) / 100, c = Math.round((Date.now() - f) * 100) / 100, d = c / 16,
|
|
485
|
+
if (t.key && t.debug && (f = Date.now()), r = o(...a), t == null || t.onChange == null || t.onChange(r), t.key && t.debug && t != null && t.debug()) {
|
|
486
|
+
const p = Math.round((Date.now() - i) * 100) / 100, c = Math.round((Date.now() - f) * 100) / 100, d = c / 16, s = (m, h) => {
|
|
481
487
|
for (m = String(m); m.length < h; )
|
|
482
488
|
m = " " + m;
|
|
483
489
|
return m;
|
|
484
490
|
};
|
|
485
|
-
console.info(`%c⏱ ${
|
|
491
|
+
console.info(`%c⏱ ${s(c, 5)} /${s(p, 5)} ms`, `
|
|
486
492
|
font-size: .6rem;
|
|
487
493
|
font-weight: bold;
|
|
488
494
|
color: hsl(${Math.max(0, Math.min(120 - 120 * d, 120))}deg 100% 31%);`, t == null ? void 0 : t.key);
|
|
@@ -490,7 +496,7 @@ function C(e, o, t) {
|
|
|
490
496
|
return r;
|
|
491
497
|
};
|
|
492
498
|
}
|
|
493
|
-
function
|
|
499
|
+
function R(e, o, t, n) {
|
|
494
500
|
return {
|
|
495
501
|
debug: () => {
|
|
496
502
|
var r;
|
|
@@ -510,14 +516,14 @@ function Bt(e, o, t, n) {
|
|
|
510
516
|
column: t,
|
|
511
517
|
getValue: () => o.getValue(n),
|
|
512
518
|
renderValue: r,
|
|
513
|
-
getContext:
|
|
519
|
+
getContext: S(() => [e, t, o, l], (i, a, u, f) => ({
|
|
514
520
|
table: i,
|
|
515
|
-
column:
|
|
516
|
-
row:
|
|
521
|
+
column: a,
|
|
522
|
+
row: u,
|
|
517
523
|
cell: f,
|
|
518
524
|
getValue: f.getValue,
|
|
519
525
|
renderValue: f.renderValue
|
|
520
|
-
}),
|
|
526
|
+
}), R(e.options, "debugCells", "cell.getContext"))
|
|
521
527
|
};
|
|
522
528
|
return e._features.forEach((i) => {
|
|
523
529
|
i.createCell == null || i.createCell(l, t, o, e);
|
|
@@ -525,39 +531,39 @@ function Bt(e, o, t, n) {
|
|
|
525
531
|
}
|
|
526
532
|
function Tt(e, o, t, n) {
|
|
527
533
|
var r, l;
|
|
528
|
-
const
|
|
534
|
+
const a = {
|
|
529
535
|
...e._getDefaultColumnDef(),
|
|
530
536
|
...o
|
|
531
|
-
},
|
|
532
|
-
let f = (r = (l =
|
|
533
|
-
if (
|
|
534
|
-
let
|
|
535
|
-
for (const h of
|
|
537
|
+
}, u = a.accessorKey;
|
|
538
|
+
let f = (r = (l = a.id) != null ? l : u ? typeof String.prototype.replaceAll == "function" ? u.replaceAll(".", "_") : u.replace(/\./g, "_") : void 0) != null ? r : typeof a.header == "string" ? a.header : void 0, p;
|
|
539
|
+
if (a.accessorFn ? p = a.accessorFn : u && (u.includes(".") ? p = (d) => {
|
|
540
|
+
let s = d;
|
|
541
|
+
for (const h of u.split(".")) {
|
|
536
542
|
var m;
|
|
537
|
-
|
|
543
|
+
s = (m = s) == null ? void 0 : m[h], process.env.NODE_ENV !== "production" && s === void 0 && console.warn(`"${h}" in deeply nested key "${u}" returned undefined.`);
|
|
538
544
|
}
|
|
539
|
-
return
|
|
540
|
-
} : p = (d) => d[
|
|
541
|
-
throw process.env.NODE_ENV !== "production" ? new Error(
|
|
545
|
+
return s;
|
|
546
|
+
} : p = (d) => d[a.accessorKey]), !f)
|
|
547
|
+
throw process.env.NODE_ENV !== "production" ? new Error(a.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header") : new Error();
|
|
542
548
|
let c = {
|
|
543
549
|
id: `${String(f)}`,
|
|
544
550
|
accessorFn: p,
|
|
545
551
|
parent: n,
|
|
546
552
|
depth: t,
|
|
547
|
-
columnDef:
|
|
553
|
+
columnDef: a,
|
|
548
554
|
columns: [],
|
|
549
|
-
getFlatColumns:
|
|
555
|
+
getFlatColumns: S(() => [!0], () => {
|
|
550
556
|
var d;
|
|
551
|
-
return [c, ...(d = c.columns) == null ? void 0 : d.flatMap((
|
|
552
|
-
},
|
|
553
|
-
getLeafColumns:
|
|
554
|
-
var
|
|
555
|
-
if ((
|
|
557
|
+
return [c, ...(d = c.columns) == null ? void 0 : d.flatMap((s) => s.getFlatColumns())];
|
|
558
|
+
}, R(e.options, "debugColumns", "column.getFlatColumns")),
|
|
559
|
+
getLeafColumns: S(() => [e._getOrderColumnsFn()], (d) => {
|
|
560
|
+
var s;
|
|
561
|
+
if ((s = c.columns) != null && s.length) {
|
|
556
562
|
let m = c.columns.flatMap((h) => h.getLeafColumns());
|
|
557
563
|
return d(m);
|
|
558
564
|
}
|
|
559
565
|
return [c];
|
|
560
|
-
},
|
|
566
|
+
}, R(e.options, "debugColumns", "column.getLeafColumns"))
|
|
561
567
|
};
|
|
562
568
|
for (const d of e._features)
|
|
563
569
|
d.createColumn == null || d.createColumn(c, e);
|
|
@@ -578,10 +584,10 @@ function Te(e, o, t) {
|
|
|
578
584
|
rowSpan: 0,
|
|
579
585
|
headerGroup: null,
|
|
580
586
|
getLeafHeaders: () => {
|
|
581
|
-
const i = [],
|
|
582
|
-
|
|
587
|
+
const i = [], a = (u) => {
|
|
588
|
+
u.subHeaders && u.subHeaders.length && u.subHeaders.map(a), i.push(u);
|
|
583
589
|
};
|
|
584
|
-
return
|
|
590
|
+
return a(l), i;
|
|
585
591
|
},
|
|
586
592
|
getContext: () => ({
|
|
587
593
|
table: e,
|
|
@@ -595,91 +601,91 @@ function Te(e, o, t) {
|
|
|
595
601
|
}
|
|
596
602
|
const qt = {
|
|
597
603
|
createTable: (e) => {
|
|
598
|
-
e.getHeaderGroups =
|
|
604
|
+
e.getHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n, r) => {
|
|
599
605
|
var l, i;
|
|
600
|
-
const
|
|
601
|
-
return re(o, [...
|
|
602
|
-
},
|
|
606
|
+
const a = (l = n == null ? void 0 : n.map((c) => t.find((d) => d.id === c)).filter(Boolean)) != null ? l : [], u = (i = r == null ? void 0 : r.map((c) => t.find((d) => d.id === c)).filter(Boolean)) != null ? i : [], f = t.filter((c) => !(n != null && n.includes(c.id)) && !(r != null && r.includes(c.id)));
|
|
607
|
+
return re(o, [...a, ...f, ...u], e);
|
|
608
|
+
}, R(e.options, P, "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))), re(o, t, e, "center")), R(e.options, P, "getCenterHeaderGroups")), e.getLeftHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.left], (o, t, n) => {
|
|
603
609
|
var r;
|
|
604
|
-
const l = (r = n == null ? void 0 : n.map((i) => t.find((
|
|
610
|
+
const l = (r = n == null ? void 0 : n.map((i) => t.find((a) => a.id === i)).filter(Boolean)) != null ? r : [];
|
|
605
611
|
return re(o, l, e, "left");
|
|
606
|
-
},
|
|
612
|
+
}, R(e.options, P, "getLeftHeaderGroups")), e.getRightHeaderGroups = S(() => [e.getAllColumns(), e.getVisibleLeafColumns(), e.getState().columnPinning.right], (o, t, n) => {
|
|
607
613
|
var r;
|
|
608
|
-
const l = (r = n == null ? void 0 : n.map((i) => t.find((
|
|
614
|
+
const l = (r = n == null ? void 0 : n.map((i) => t.find((a) => a.id === i)).filter(Boolean)) != null ? r : [];
|
|
609
615
|
return re(o, l, e, "right");
|
|
610
|
-
},
|
|
616
|
+
}, R(e.options, P, "getRightHeaderGroups")), e.getFooterGroups = S(() => [e.getHeaderGroups()], (o) => [...o].reverse(), R(e.options, P, "getFooterGroups")), e.getLeftFooterGroups = S(() => [e.getLeftHeaderGroups()], (o) => [...o].reverse(), R(e.options, P, "getLeftFooterGroups")), e.getCenterFooterGroups = S(() => [e.getCenterHeaderGroups()], (o) => [...o].reverse(), R(e.options, P, "getCenterFooterGroups")), e.getRightFooterGroups = S(() => [e.getRightHeaderGroups()], (o) => [...o].reverse(), R(e.options, P, "getRightFooterGroups")), e.getFlatHeaders = S(() => [e.getHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, P, "getFlatHeaders")), e.getLeftFlatHeaders = S(() => [e.getLeftHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, P, "getLeftFlatHeaders")), e.getCenterFlatHeaders = S(() => [e.getCenterHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, P, "getCenterFlatHeaders")), e.getRightFlatHeaders = S(() => [e.getRightHeaderGroups()], (o) => o.map((t) => t.headers).flat(), R(e.options, P, "getRightFlatHeaders")), e.getCenterLeafHeaders = S(() => [e.getCenterFlatHeaders()], (o) => o.filter((t) => {
|
|
611
617
|
var n;
|
|
612
618
|
return !((n = t.subHeaders) != null && n.length);
|
|
613
|
-
}),
|
|
619
|
+
}), R(e.options, P, "getCenterLeafHeaders")), e.getLeftLeafHeaders = S(() => [e.getLeftFlatHeaders()], (o) => o.filter((t) => {
|
|
614
620
|
var n;
|
|
615
621
|
return !((n = t.subHeaders) != null && n.length);
|
|
616
|
-
}),
|
|
622
|
+
}), R(e.options, P, "getLeftLeafHeaders")), e.getRightLeafHeaders = S(() => [e.getRightFlatHeaders()], (o) => o.filter((t) => {
|
|
617
623
|
var n;
|
|
618
624
|
return !((n = t.subHeaders) != null && n.length);
|
|
619
|
-
}),
|
|
620
|
-
var r, l, i,
|
|
621
|
-
return [...(r = (l = o[0]) == null ? void 0 : l.headers) != null ? r : [], ...(i = (
|
|
622
|
-
},
|
|
625
|
+
}), R(e.options, P, "getRightLeafHeaders")), e.getLeafHeaders = S(() => [e.getLeftHeaderGroups(), e.getCenterHeaderGroups(), e.getRightHeaderGroups()], (o, t, n) => {
|
|
626
|
+
var r, l, i, a, u, f;
|
|
627
|
+
return [...(r = (l = o[0]) == null ? void 0 : l.headers) != null ? r : [], ...(i = (a = t[0]) == null ? void 0 : a.headers) != null ? i : [], ...(u = (f = n[0]) == null ? void 0 : f.headers) != null ? u : []].map((p) => p.getLeafHeaders()).flat();
|
|
628
|
+
}, R(e.options, P, "getLeafHeaders"));
|
|
623
629
|
}
|
|
624
630
|
};
|
|
625
631
|
function re(e, o, t, n) {
|
|
626
632
|
var r, l;
|
|
627
633
|
let i = 0;
|
|
628
|
-
const
|
|
629
|
-
|
|
634
|
+
const a = function(d, s) {
|
|
635
|
+
s === void 0 && (s = 1), i = Math.max(i, s), d.filter((m) => m.getIsVisible()).forEach((m) => {
|
|
630
636
|
var h;
|
|
631
|
-
(h = m.columns) != null && h.length &&
|
|
637
|
+
(h = m.columns) != null && h.length && a(m.columns, s + 1);
|
|
632
638
|
}, 0);
|
|
633
639
|
};
|
|
634
|
-
|
|
635
|
-
let
|
|
636
|
-
const f = (d,
|
|
640
|
+
a(e);
|
|
641
|
+
let u = [];
|
|
642
|
+
const f = (d, s) => {
|
|
637
643
|
const m = {
|
|
638
|
-
depth:
|
|
639
|
-
id: [n, `${
|
|
644
|
+
depth: s,
|
|
645
|
+
id: [n, `${s}`].filter(Boolean).join("_"),
|
|
640
646
|
headers: []
|
|
641
647
|
}, h = [];
|
|
642
648
|
d.forEach((w) => {
|
|
643
|
-
const
|
|
644
|
-
let
|
|
645
|
-
if (
|
|
646
|
-
|
|
649
|
+
const C = [...h].reverse()[0], x = w.column.depth === m.depth;
|
|
650
|
+
let F, E = !1;
|
|
651
|
+
if (x && w.column.parent ? F = w.column.parent : (F = w.column, E = !0), C && (C == null ? void 0 : C.column) === F)
|
|
652
|
+
C.subHeaders.push(w);
|
|
647
653
|
else {
|
|
648
|
-
const I = Te(t,
|
|
649
|
-
id: [n,
|
|
654
|
+
const I = Te(t, F, {
|
|
655
|
+
id: [n, s, F.id, w == null ? void 0 : w.id].filter(Boolean).join("_"),
|
|
650
656
|
isPlaceholder: E,
|
|
651
|
-
placeholderId: E ? `${h.filter((D) => D.column ===
|
|
652
|
-
depth:
|
|
657
|
+
placeholderId: E ? `${h.filter((D) => D.column === F).length}` : void 0,
|
|
658
|
+
depth: s,
|
|
653
659
|
index: h.length
|
|
654
660
|
});
|
|
655
661
|
I.subHeaders.push(w), h.push(I);
|
|
656
662
|
}
|
|
657
663
|
m.headers.push(w), w.headerGroup = m;
|
|
658
|
-
}),
|
|
659
|
-
}, p = o.map((d,
|
|
664
|
+
}), u.push(m), s > 0 && f(h, s - 1);
|
|
665
|
+
}, p = o.map((d, s) => Te(t, d, {
|
|
660
666
|
depth: i,
|
|
661
|
-
index:
|
|
667
|
+
index: s
|
|
662
668
|
}));
|
|
663
|
-
f(p, i - 1),
|
|
669
|
+
f(p, i - 1), u.reverse();
|
|
664
670
|
const c = (d) => d.filter((m) => m.column.getIsVisible()).map((m) => {
|
|
665
|
-
let h = 0, w = 0,
|
|
666
|
-
m.subHeaders && m.subHeaders.length ? (
|
|
671
|
+
let h = 0, w = 0, C = [0];
|
|
672
|
+
m.subHeaders && m.subHeaders.length ? (C = [], c(m.subHeaders).forEach((F) => {
|
|
667
673
|
let {
|
|
668
674
|
colSpan: E,
|
|
669
675
|
rowSpan: I
|
|
670
|
-
} =
|
|
671
|
-
h += E,
|
|
676
|
+
} = F;
|
|
677
|
+
h += E, C.push(I);
|
|
672
678
|
})) : h = 1;
|
|
673
|
-
const
|
|
674
|
-
return w = w +
|
|
679
|
+
const x = Math.min(...C);
|
|
680
|
+
return w = w + x, m.colSpan = h, m.rowSpan = w, {
|
|
675
681
|
colSpan: h,
|
|
676
682
|
rowSpan: w
|
|
677
683
|
};
|
|
678
684
|
});
|
|
679
|
-
return c((r = (l =
|
|
685
|
+
return c((r = (l = u[0]) == null ? void 0 : l.headers) != null ? r : []), u;
|
|
680
686
|
}
|
|
681
687
|
const Ne = (e, o, t, n, r, l, i) => {
|
|
682
|
-
let
|
|
688
|
+
let a = {
|
|
683
689
|
id: o,
|
|
684
690
|
index: n,
|
|
685
691
|
original: t,
|
|
@@ -687,44 +693,44 @@ const Ne = (e, o, t, n, r, l, i) => {
|
|
|
687
693
|
parentId: i,
|
|
688
694
|
_valuesCache: {},
|
|
689
695
|
_uniqueValuesCache: {},
|
|
690
|
-
getValue: (
|
|
691
|
-
if (
|
|
692
|
-
return
|
|
693
|
-
const f = e.getColumn(
|
|
696
|
+
getValue: (u) => {
|
|
697
|
+
if (a._valuesCache.hasOwnProperty(u))
|
|
698
|
+
return a._valuesCache[u];
|
|
699
|
+
const f = e.getColumn(u);
|
|
694
700
|
if (f != null && f.accessorFn)
|
|
695
|
-
return
|
|
701
|
+
return a._valuesCache[u] = f.accessorFn(a.original, n), a._valuesCache[u];
|
|
696
702
|
},
|
|
697
|
-
getUniqueValues: (
|
|
698
|
-
if (
|
|
699
|
-
return
|
|
700
|
-
const f = e.getColumn(
|
|
703
|
+
getUniqueValues: (u) => {
|
|
704
|
+
if (a._uniqueValuesCache.hasOwnProperty(u))
|
|
705
|
+
return a._uniqueValuesCache[u];
|
|
706
|
+
const f = e.getColumn(u);
|
|
701
707
|
if (f != null && f.accessorFn)
|
|
702
|
-
return f.columnDef.getUniqueValues ? (
|
|
708
|
+
return f.columnDef.getUniqueValues ? (a._uniqueValuesCache[u] = f.columnDef.getUniqueValues(a.original, n), a._uniqueValuesCache[u]) : (a._uniqueValuesCache[u] = [a.getValue(u)], a._uniqueValuesCache[u]);
|
|
703
709
|
},
|
|
704
|
-
renderValue: (
|
|
710
|
+
renderValue: (u) => {
|
|
705
711
|
var f;
|
|
706
|
-
return (f =
|
|
712
|
+
return (f = a.getValue(u)) != null ? f : e.options.renderFallbackValue;
|
|
707
713
|
},
|
|
708
714
|
subRows: [],
|
|
709
|
-
getLeafRows: () => bt(
|
|
710
|
-
getParentRow: () =>
|
|
715
|
+
getLeafRows: () => bt(a.subRows, (u) => u.subRows),
|
|
716
|
+
getParentRow: () => a.parentId ? e.getRow(a.parentId, !0) : void 0,
|
|
711
717
|
getParentRows: () => {
|
|
712
|
-
let
|
|
718
|
+
let u = [], f = a;
|
|
713
719
|
for (; ; ) {
|
|
714
720
|
const p = f.getParentRow();
|
|
715
721
|
if (!p) break;
|
|
716
|
-
|
|
722
|
+
u.push(p), f = p;
|
|
717
723
|
}
|
|
718
|
-
return
|
|
724
|
+
return u.reverse();
|
|
719
725
|
},
|
|
720
|
-
getAllCells:
|
|
721
|
-
_getAllCellsByColumnId:
|
|
726
|
+
getAllCells: S(() => [e.getAllLeafColumns()], (u) => u.map((f) => Bt(e, a, f, f.id)), R(e.options, "debugRows", "getAllCells")),
|
|
727
|
+
_getAllCellsByColumnId: S(() => [a.getAllCells()], (u) => u.reduce((f, p) => (f[p.column.id] = p, f), {}), R(e.options, "debugRows", "getAllCellsByColumnId"))
|
|
722
728
|
};
|
|
723
|
-
for (let
|
|
724
|
-
const f = e._features[
|
|
725
|
-
f == null || f.createRow == null || f.createRow(
|
|
729
|
+
for (let u = 0; u < e._features.length; u++) {
|
|
730
|
+
const f = e._features[u];
|
|
731
|
+
f == null || f.createRow == null || f.createRow(a, e);
|
|
726
732
|
}
|
|
727
|
-
return
|
|
733
|
+
return a;
|
|
728
734
|
}, jt = {
|
|
729
735
|
createColumn: (e, o) => {
|
|
730
736
|
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 = () => {
|
|
@@ -775,8 +781,8 @@ const Pe = (e, o, t) => {
|
|
|
775
781
|
Pe.resolveFilterValue = (e) => {
|
|
776
782
|
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, i = t === null || Number.isNaN(r) ? 1 / 0 : r;
|
|
777
783
|
if (l > i) {
|
|
778
|
-
const
|
|
779
|
-
l = i, i =
|
|
784
|
+
const a = l;
|
|
785
|
+
l = i, i = a;
|
|
780
786
|
}
|
|
781
787
|
return [l, i];
|
|
782
788
|
};
|
|
@@ -831,18 +837,18 @@ const Ut = {
|
|
|
831
837
|
o.setColumnFilters((n) => {
|
|
832
838
|
const r = e.getFilterFn(), l = n == null ? void 0 : n.find((p) => p.id === e.id), i = q(t, l ? l.value : void 0);
|
|
833
839
|
if (qe(r, i, e)) {
|
|
834
|
-
var
|
|
835
|
-
return (
|
|
840
|
+
var a;
|
|
841
|
+
return (a = n == null ? void 0 : n.filter((p) => p.id !== e.id)) != null ? a : [];
|
|
836
842
|
}
|
|
837
|
-
const
|
|
843
|
+
const u = {
|
|
838
844
|
id: e.id,
|
|
839
845
|
value: i
|
|
840
846
|
};
|
|
841
847
|
if (l) {
|
|
842
848
|
var f;
|
|
843
|
-
return (f = n == null ? void 0 : n.map((p) => p.id === e.id ?
|
|
849
|
+
return (f = n == null ? void 0 : n.map((p) => p.id === e.id ? u : p)) != null ? f : [];
|
|
844
850
|
}
|
|
845
|
-
return n != null && n.length ? [...n,
|
|
851
|
+
return n != null && n.length ? [...n, u] : [u];
|
|
846
852
|
});
|
|
847
853
|
};
|
|
848
854
|
},
|
|
@@ -854,10 +860,10 @@ const Ut = {
|
|
|
854
860
|
const t = e.getAllLeafColumns(), n = (r) => {
|
|
855
861
|
var l;
|
|
856
862
|
return (l = q(o, r)) == null ? void 0 : l.filter((i) => {
|
|
857
|
-
const
|
|
858
|
-
if (
|
|
859
|
-
const
|
|
860
|
-
if (qe(
|
|
863
|
+
const a = t.find((u) => u.id === i.id);
|
|
864
|
+
if (a) {
|
|
865
|
+
const u = a.getFilterFn();
|
|
866
|
+
if (qe(u, i.value, a))
|
|
861
867
|
return !1;
|
|
862
868
|
}
|
|
863
869
|
return !0;
|
|
@@ -1002,7 +1008,7 @@ const rn = {
|
|
|
1002
1008
|
onColumnOrderChange: L("columnOrder", e)
|
|
1003
1009
|
}),
|
|
1004
1010
|
createColumn: (e, o) => {
|
|
1005
|
-
e.getIndex =
|
|
1011
|
+
e.getIndex = S((t) => [ne(o, t)], (t) => t.findIndex((n) => n.id === e.id), R(o.options, "debugColumns", "getIndex")), e.getIsFirstColumn = (t) => {
|
|
1006
1012
|
var n;
|
|
1007
1013
|
return ((n = ne(o, t)[0]) == null ? void 0 : n.id) === e.id;
|
|
1008
1014
|
}, e.getIsLastColumn = (t) => {
|
|
@@ -1015,20 +1021,20 @@ const rn = {
|
|
|
1015
1021
|
e.setColumnOrder = (o) => e.options.onColumnOrderChange == null ? void 0 : e.options.onColumnOrderChange(o), e.resetColumnOrder = (o) => {
|
|
1016
1022
|
var t;
|
|
1017
1023
|
e.setColumnOrder(o ? [] : (t = e.initialState.columnOrder) != null ? t : []);
|
|
1018
|
-
}, e._getOrderColumnsFn =
|
|
1024
|
+
}, e._getOrderColumnsFn = S(() => [e.getState().columnOrder, e.getState().grouping, e.options.groupedColumnMode], (o, t, n) => (r) => {
|
|
1019
1025
|
let l = [];
|
|
1020
1026
|
if (!(o != null && o.length))
|
|
1021
1027
|
l = r;
|
|
1022
1028
|
else {
|
|
1023
|
-
const i = [...o],
|
|
1024
|
-
for (;
|
|
1025
|
-
const
|
|
1026
|
-
f > -1 && l.push(
|
|
1029
|
+
const i = [...o], a = [...r];
|
|
1030
|
+
for (; a.length && i.length; ) {
|
|
1031
|
+
const u = i.shift(), f = a.findIndex((p) => p.id === u);
|
|
1032
|
+
f > -1 && l.push(a.splice(f, 1)[0]);
|
|
1027
1033
|
}
|
|
1028
|
-
l = [...l, ...
|
|
1034
|
+
l = [...l, ...a];
|
|
1029
1035
|
}
|
|
1030
1036
|
return on(l, t, n);
|
|
1031
|
-
},
|
|
1037
|
+
}, R(e.options, "debugTable", "_getOrderColumnsFn"));
|
|
1032
1038
|
}
|
|
1033
1039
|
}, ce = () => ({
|
|
1034
1040
|
left: [],
|
|
@@ -1047,10 +1053,10 @@ const rn = {
|
|
|
1047
1053
|
o.setColumnPinning((r) => {
|
|
1048
1054
|
var l, i;
|
|
1049
1055
|
if (t === "right") {
|
|
1050
|
-
var
|
|
1056
|
+
var a, u;
|
|
1051
1057
|
return {
|
|
1052
|
-
left: ((
|
|
1053
|
-
right: [...((
|
|
1058
|
+
left: ((a = r == null ? void 0 : r.left) != null ? a : []).filter((c) => !(n != null && n.includes(c))),
|
|
1059
|
+
right: [...((u = r == null ? void 0 : r.right) != null ? u : []).filter((c) => !(n != null && n.includes(c))), ...n]
|
|
1054
1060
|
};
|
|
1055
1061
|
}
|
|
1056
1062
|
if (t === "left") {
|
|
@@ -1069,10 +1075,10 @@ const rn = {
|
|
|
1069
1075
|
var r, l, i;
|
|
1070
1076
|
return ((r = n.columnDef.enablePinning) != null ? r : !0) && ((l = (i = o.options.enableColumnPinning) != null ? i : o.options.enablePinning) != null ? l : !0);
|
|
1071
1077
|
}), e.getIsPinned = () => {
|
|
1072
|
-
const t = e.getLeafColumns().map((
|
|
1078
|
+
const t = e.getLeafColumns().map((a) => a.id), {
|
|
1073
1079
|
left: n,
|
|
1074
1080
|
right: r
|
|
1075
|
-
} = o.getState().columnPinning, l = t.some((
|
|
1081
|
+
} = o.getState().columnPinning, l = t.some((a) => n == null ? void 0 : n.includes(a)), i = t.some((a) => r == null ? void 0 : r.includes(a));
|
|
1076
1082
|
return l ? "left" : i ? "right" : !1;
|
|
1077
1083
|
}, e.getPinnedIndex = () => {
|
|
1078
1084
|
var t, n;
|
|
@@ -1081,16 +1087,16 @@ const rn = {
|
|
|
1081
1087
|
};
|
|
1082
1088
|
},
|
|
1083
1089
|
createRow: (e, o) => {
|
|
1084
|
-
e.getCenterVisibleCells =
|
|
1090
|
+
e.getCenterVisibleCells = S(() => [e._getAllVisibleCells(), o.getState().columnPinning.left, o.getState().columnPinning.right], (t, n, r) => {
|
|
1085
1091
|
const l = [...n ?? [], ...r ?? []];
|
|
1086
1092
|
return t.filter((i) => !l.includes(i.column.id));
|
|
1087
|
-
},
|
|
1093
|
+
}, R(o.options, "debugRows", "getCenterVisibleCells")), e.getLeftVisibleCells = S(() => [e._getAllVisibleCells(), o.getState().columnPinning.left], (t, n) => (n ?? []).map((l) => t.find((i) => i.column.id === l)).filter(Boolean).map((l) => ({
|
|
1088
1094
|
...l,
|
|
1089
1095
|
position: "left"
|
|
1090
|
-
})),
|
|
1096
|
+
})), R(o.options, "debugRows", "getLeftVisibleCells")), e.getRightVisibleCells = S(() => [e._getAllVisibleCells(), o.getState().columnPinning.right], (t, n) => (n ?? []).map((l) => t.find((i) => i.column.id === l)).filter(Boolean).map((l) => ({
|
|
1091
1097
|
...l,
|
|
1092
1098
|
position: "right"
|
|
1093
|
-
})),
|
|
1099
|
+
})), R(o.options, "debugRows", "getRightVisibleCells"));
|
|
1094
1100
|
},
|
|
1095
1101
|
createTable: (e) => {
|
|
1096
1102
|
e.setColumnPinning = (o) => e.options.onColumnPinningChange == null ? void 0 : e.options.onColumnPinningChange(o), e.resetColumnPinning = (o) => {
|
|
@@ -1104,10 +1110,10 @@ const rn = {
|
|
|
1104
1110
|
return !!((r = n.left) != null && r.length || (l = n.right) != null && l.length);
|
|
1105
1111
|
}
|
|
1106
1112
|
return !!((t = n[o]) != null && t.length);
|
|
1107
|
-
}, e.getLeftLeafColumns =
|
|
1113
|
+
}, e.getLeftLeafColumns = S(() => [e.getAllLeafColumns(), e.getState().columnPinning.left], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), R(e.options, "debugColumns", "getLeftLeafColumns")), e.getRightLeafColumns = S(() => [e.getAllLeafColumns(), e.getState().columnPinning.right], (o, t) => (t ?? []).map((n) => o.find((r) => r.id === n)).filter(Boolean), R(e.options, "debugColumns", "getRightLeafColumns")), e.getCenterLeafColumns = S(() => [e.getAllLeafColumns(), e.getState().columnPinning.left, e.getState().columnPinning.right], (o, t, n) => {
|
|
1108
1114
|
const r = [...t ?? [], ...n ?? []];
|
|
1109
1115
|
return o.filter((l) => !r.includes(l.id));
|
|
1110
|
-
},
|
|
1116
|
+
}, R(e.options, "debugColumns", "getCenterLeafColumns"));
|
|
1111
1117
|
}
|
|
1112
1118
|
};
|
|
1113
1119
|
function sn(e) {
|
|
@@ -1142,7 +1148,7 @@ const le = {
|
|
|
1142
1148
|
var t, n, r;
|
|
1143
1149
|
const l = o.getState().columnSizing[e.id];
|
|
1144
1150
|
return Math.min(Math.max((t = e.columnDef.minSize) != null ? t : le.minSize, (n = l ?? e.columnDef.size) != null ? n : le.size), (r = e.columnDef.maxSize) != null ? r : le.maxSize);
|
|
1145
|
-
}, e.getStart =
|
|
1151
|
+
}, e.getStart = S((t) => [t, ne(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, ne(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 = () => {
|
|
1146
1152
|
o.setColumnSizing((t) => {
|
|
1147
1153
|
let {
|
|
1148
1154
|
[e.id]: n,
|
|
@@ -1178,25 +1184,25 @@ const le = {
|
|
|
1178
1184
|
return (l) => {
|
|
1179
1185
|
if (!n || !r || (l.persist == null || l.persist(), me(l) && l.touches && l.touches.length > 1))
|
|
1180
1186
|
return;
|
|
1181
|
-
const i = e.getSize(),
|
|
1182
|
-
typeof
|
|
1187
|
+
const i = e.getSize(), a = e ? e.getLeafHeaders().map((C) => [C.column.id, C.column.getSize()]) : [[n.id, n.getSize()]], u = me(l) ? Math.round(l.touches[0].clientX) : l.clientX, f = {}, p = (C, x) => {
|
|
1188
|
+
typeof x == "number" && (o.setColumnSizingInfo((F) => {
|
|
1183
1189
|
var E, I;
|
|
1184
|
-
const D = o.options.columnResizeDirection === "rtl" ? -1 : 1, K = (
|
|
1185
|
-
return
|
|
1186
|
-
let [T, O] =
|
|
1190
|
+
const D = o.options.columnResizeDirection === "rtl" ? -1 : 1, K = (x - ((E = F == null ? void 0 : F.startOffset) != null ? E : 0)) * D, N = Math.max(K / ((I = F == null ? void 0 : F.startSize) != null ? I : 0), -0.999999);
|
|
1191
|
+
return F.columnSizingStart.forEach((H) => {
|
|
1192
|
+
let [T, O] = H;
|
|
1187
1193
|
f[T] = Math.round(Math.max(O + O * N, 0) * 100) / 100;
|
|
1188
1194
|
}), {
|
|
1189
|
-
|
|
1195
|
+
...F,
|
|
1190
1196
|
deltaOffset: K,
|
|
1191
1197
|
deltaPercentage: N
|
|
1192
1198
|
};
|
|
1193
|
-
}), (o.options.columnResizeMode === "onChange" ||
|
|
1194
|
-
|
|
1199
|
+
}), (o.options.columnResizeMode === "onChange" || C === "end") && o.setColumnSizing((F) => ({
|
|
1200
|
+
...F,
|
|
1195
1201
|
...f
|
|
1196
1202
|
})));
|
|
1197
|
-
}, c = (
|
|
1198
|
-
p("end",
|
|
1199
|
-
...
|
|
1203
|
+
}, c = (C) => p("move", C), d = (C) => {
|
|
1204
|
+
p("end", C), o.setColumnSizingInfo((x) => ({
|
|
1205
|
+
...x,
|
|
1200
1206
|
isResizingColumn: !1,
|
|
1201
1207
|
startOffset: null,
|
|
1202
1208
|
startSize: null,
|
|
@@ -1204,27 +1210,27 @@ const le = {
|
|
|
1204
1210
|
deltaPercentage: null,
|
|
1205
1211
|
columnSizingStart: []
|
|
1206
1212
|
}));
|
|
1207
|
-
},
|
|
1208
|
-
moveHandler: (
|
|
1209
|
-
upHandler: (
|
|
1210
|
-
|
|
1213
|
+
}, s = sn(t), m = {
|
|
1214
|
+
moveHandler: (C) => c(C.clientX),
|
|
1215
|
+
upHandler: (C) => {
|
|
1216
|
+
s == null || s.removeEventListener("mousemove", m.moveHandler), s == null || s.removeEventListener("mouseup", m.upHandler), d(C.clientX);
|
|
1211
1217
|
}
|
|
1212
1218
|
}, h = {
|
|
1213
|
-
moveHandler: (
|
|
1214
|
-
upHandler: (
|
|
1215
|
-
var
|
|
1216
|
-
|
|
1219
|
+
moveHandler: (C) => (C.cancelable && (C.preventDefault(), C.stopPropagation()), c(C.touches[0].clientX), !1),
|
|
1220
|
+
upHandler: (C) => {
|
|
1221
|
+
var x;
|
|
1222
|
+
s == null || s.removeEventListener("touchmove", h.moveHandler), s == null || s.removeEventListener("touchend", h.upHandler), C.cancelable && (C.preventDefault(), C.stopPropagation()), d((x = C.touches[0]) == null ? void 0 : x.clientX);
|
|
1217
1223
|
}
|
|
1218
1224
|
}, w = un() ? {
|
|
1219
1225
|
passive: !1
|
|
1220
1226
|
} : !1;
|
|
1221
|
-
me(l) ? (
|
|
1222
|
-
...
|
|
1223
|
-
startOffset:
|
|
1227
|
+
me(l) ? (s == null || s.addEventListener("touchmove", h.moveHandler, w), s == null || s.addEventListener("touchend", h.upHandler, w)) : (s == null || s.addEventListener("mousemove", m.moveHandler, w), s == null || s.addEventListener("mouseup", m.upHandler, w)), o.setColumnSizingInfo((C) => ({
|
|
1228
|
+
...C,
|
|
1229
|
+
startOffset: u,
|
|
1224
1230
|
startSize: i,
|
|
1225
1231
|
deltaOffset: 0,
|
|
1226
1232
|
deltaPercentage: 0,
|
|
1227
|
-
columnSizingStart:
|
|
1233
|
+
columnSizingStart: a,
|
|
1228
1234
|
isResizingColumn: n.id
|
|
1229
1235
|
}));
|
|
1230
1236
|
};
|
|
@@ -1298,10 +1304,10 @@ const fn = {
|
|
|
1298
1304
|
};
|
|
1299
1305
|
},
|
|
1300
1306
|
createRow: (e, o) => {
|
|
1301
|
-
e._getAllVisibleCells =
|
|
1307
|
+
e._getAllVisibleCells = S(() => [e.getAllCells(), o.getState().columnVisibility], (t) => t.filter((n) => n.column.getIsVisible()), R(o.options, "debugRows", "_getAllVisibleCells")), e.getVisibleCells = S(() => [e.getLeftVisibleCells(), e.getCenterVisibleCells(), e.getRightVisibleCells()], (t, n, r) => [...t, ...n, ...r], R(o.options, "debugRows", "getVisibleCells"));
|
|
1302
1308
|
},
|
|
1303
1309
|
createTable: (e) => {
|
|
1304
|
-
const o = (t, n) =>
|
|
1310
|
+
const o = (t, n) => S(() => [n(), n().filter((r) => r.getIsVisible()).map((r) => r.id).join("_")], (r) => r.filter((l) => l.getIsVisible == null ? void 0 : l.getIsVisible()), R(e.options, "debugColumns", t));
|
|
1305
1311
|
e.getVisibleFlatColumns = o("getVisibleFlatColumns", () => e.getAllFlatColumns()), e.getVisibleLeafColumns = o("getVisibleLeafColumns", () => e.getAllLeafColumns()), e.getLeftVisibleLeafColumns = o("getLeftVisibleLeafColumns", () => e.getLeftLeafColumns()), e.getRightVisibleLeafColumns = o("getRightVisibleLeafColumns", () => e.getRightLeafColumns()), e.getCenterVisibleLeafColumns = o("getCenterVisibleLeafColumns", () => e.getCenterLeafColumns()), e.setColumnVisibility = (t) => e.options.onColumnVisibilityChange == null ? void 0 : e.options.onColumnVisibilityChange(t), e.resetColumnVisibility = (t) => {
|
|
1306
1312
|
var n;
|
|
1307
1313
|
e.setColumnVisibility(t ? {} : (n = e.initialState.columnVisibility) != null ? n : {});
|
|
@@ -1412,8 +1418,8 @@ const dn = {
|
|
|
1412
1418
|
var r;
|
|
1413
1419
|
const l = n === !0 ? !0 : !!(n != null && n[e.id]);
|
|
1414
1420
|
let i = {};
|
|
1415
|
-
if (n === !0 ? Object.keys(o.getRowModel().rowsById).forEach((
|
|
1416
|
-
i[
|
|
1421
|
+
if (n === !0 ? Object.keys(o.getRowModel().rowsById).forEach((a) => {
|
|
1422
|
+
i[a] = !0;
|
|
1417
1423
|
}) : i = n, t = (r = t) != null ? r : !l, !l && t)
|
|
1418
1424
|
return {
|
|
1419
1425
|
...i,
|
|
@@ -1421,10 +1427,10 @@ const dn = {
|
|
|
1421
1427
|
};
|
|
1422
1428
|
if (l && !t) {
|
|
1423
1429
|
const {
|
|
1424
|
-
[e.id]:
|
|
1425
|
-
...
|
|
1430
|
+
[e.id]: a,
|
|
1431
|
+
...u
|
|
1426
1432
|
} = i;
|
|
1427
|
-
return
|
|
1433
|
+
return u;
|
|
1428
1434
|
}
|
|
1429
1435
|
return n;
|
|
1430
1436
|
});
|
|
@@ -1500,10 +1506,10 @@ const dn = {
|
|
|
1500
1506
|
e.setPageSize(n ? xe : (r = (l = e.initialState) == null || (l = l.pagination) == null ? void 0 : l.pageSize) != null ? r : xe);
|
|
1501
1507
|
}, e.setPageSize = (n) => {
|
|
1502
1508
|
e.setPagination((r) => {
|
|
1503
|
-
const l = Math.max(1, q(n, r.pageSize)), i = r.pageSize * r.pageIndex,
|
|
1509
|
+
const l = Math.max(1, q(n, r.pageSize)), i = r.pageSize * r.pageIndex, a = Math.floor(i / l);
|
|
1504
1510
|
return {
|
|
1505
1511
|
...r,
|
|
1506
|
-
pageIndex:
|
|
1512
|
+
pageIndex: a,
|
|
1507
1513
|
pageSize: l
|
|
1508
1514
|
};
|
|
1509
1515
|
});
|
|
@@ -1514,10 +1520,10 @@ const dn = {
|
|
|
1514
1520
|
...r,
|
|
1515
1521
|
pageCount: i
|
|
1516
1522
|
};
|
|
1517
|
-
}), e.getPageOptions =
|
|
1523
|
+
}), e.getPageOptions = S(() => [e.getPageCount()], (n) => {
|
|
1518
1524
|
let r = [];
|
|
1519
1525
|
return n && n > 0 && (r = [...new Array(n)].fill(null).map((l, i) => i)), r;
|
|
1520
|
-
},
|
|
1526
|
+
}, R(e.options, "debugTable", "getPageOptions")), e.getCanPreviousPage = () => e.getState().pagination.pageIndex > 0, e.getCanNextPage = () => {
|
|
1521
1527
|
const {
|
|
1522
1528
|
pageIndex: n
|
|
1523
1529
|
} = e.getState().pagination, r = e.getPageCount();
|
|
@@ -1530,12 +1536,12 @@ const dn = {
|
|
|
1530
1536
|
return (n = e.options.rowCount) != null ? n : e.getPrePaginationRowModel().rows.length;
|
|
1531
1537
|
};
|
|
1532
1538
|
}
|
|
1533
|
-
},
|
|
1539
|
+
}, we = () => ({
|
|
1534
1540
|
top: [],
|
|
1535
1541
|
bottom: []
|
|
1536
1542
|
}), mn = {
|
|
1537
1543
|
getInitialState: (e) => ({
|
|
1538
|
-
rowPinning:
|
|
1544
|
+
rowPinning: we(),
|
|
1539
1545
|
...e
|
|
1540
1546
|
}),
|
|
1541
1547
|
getDefaultOptions: (e) => ({
|
|
@@ -1543,36 +1549,36 @@ const dn = {
|
|
|
1543
1549
|
}),
|
|
1544
1550
|
createRow: (e, o) => {
|
|
1545
1551
|
e.pin = (t, n, r) => {
|
|
1546
|
-
const l = n ? e.getLeafRows().map((
|
|
1552
|
+
const l = n ? e.getLeafRows().map((u) => {
|
|
1547
1553
|
let {
|
|
1548
1554
|
id: f
|
|
1549
|
-
} =
|
|
1555
|
+
} = u;
|
|
1550
1556
|
return f;
|
|
1551
|
-
}) : [], i = r ? e.getParentRows().map((
|
|
1557
|
+
}) : [], i = r ? e.getParentRows().map((u) => {
|
|
1552
1558
|
let {
|
|
1553
1559
|
id: f
|
|
1554
|
-
} =
|
|
1560
|
+
} = u;
|
|
1555
1561
|
return f;
|
|
1556
|
-
}) : [],
|
|
1557
|
-
o.setRowPinning((
|
|
1562
|
+
}) : [], a = /* @__PURE__ */ new Set([...i, e.id, ...l]);
|
|
1563
|
+
o.setRowPinning((u) => {
|
|
1558
1564
|
var f, p;
|
|
1559
1565
|
if (t === "bottom") {
|
|
1560
1566
|
var c, d;
|
|
1561
1567
|
return {
|
|
1562
|
-
top: ((c =
|
|
1563
|
-
bottom: [...((d =
|
|
1568
|
+
top: ((c = u == null ? void 0 : u.top) != null ? c : []).filter((h) => !(a != null && a.has(h))),
|
|
1569
|
+
bottom: [...((d = u == null ? void 0 : u.bottom) != null ? d : []).filter((h) => !(a != null && a.has(h))), ...Array.from(a)]
|
|
1564
1570
|
};
|
|
1565
1571
|
}
|
|
1566
1572
|
if (t === "top") {
|
|
1567
|
-
var
|
|
1573
|
+
var s, m;
|
|
1568
1574
|
return {
|
|
1569
|
-
top: [...((
|
|
1570
|
-
bottom: ((m =
|
|
1575
|
+
top: [...((s = u == null ? void 0 : u.top) != null ? s : []).filter((h) => !(a != null && a.has(h))), ...Array.from(a)],
|
|
1576
|
+
bottom: ((m = u == null ? void 0 : u.bottom) != null ? m : []).filter((h) => !(a != null && a.has(h)))
|
|
1571
1577
|
};
|
|
1572
1578
|
}
|
|
1573
1579
|
return {
|
|
1574
|
-
top: ((f =
|
|
1575
|
-
bottom: ((p =
|
|
1580
|
+
top: ((f = u == null ? void 0 : u.top) != null ? f : []).filter((h) => !(a != null && a.has(h))),
|
|
1581
|
+
bottom: ((p = u == null ? void 0 : u.bottom) != null ? p : []).filter((h) => !(a != null && a.has(h)))
|
|
1576
1582
|
};
|
|
1577
1583
|
});
|
|
1578
1584
|
}, e.getCanPin = () => {
|
|
@@ -1586,7 +1592,7 @@ const dn = {
|
|
|
1586
1592
|
const t = [e.id], {
|
|
1587
1593
|
top: n,
|
|
1588
1594
|
bottom: r
|
|
1589
|
-
} = o.getState().rowPinning, l = t.some((
|
|
1595
|
+
} = o.getState().rowPinning, l = t.some((a) => n == null ? void 0 : n.includes(a)), i = t.some((a) => r == null ? void 0 : r.includes(a));
|
|
1590
1596
|
return l ? "top" : i ? "bottom" : !1;
|
|
1591
1597
|
}, e.getPinnedIndex = () => {
|
|
1592
1598
|
var t, n;
|
|
@@ -1594,9 +1600,9 @@ const dn = {
|
|
|
1594
1600
|
if (!r) return -1;
|
|
1595
1601
|
const l = (t = r === "top" ? o.getTopRows() : o.getBottomRows()) == null ? void 0 : t.map((i) => {
|
|
1596
1602
|
let {
|
|
1597
|
-
id:
|
|
1603
|
+
id: a
|
|
1598
1604
|
} = i;
|
|
1599
|
-
return
|
|
1605
|
+
return a;
|
|
1600
1606
|
});
|
|
1601
1607
|
return (n = l == null ? void 0 : l.indexOf(e.id)) != null ? n : -1;
|
|
1602
1608
|
};
|
|
@@ -1604,7 +1610,7 @@ const dn = {
|
|
|
1604
1610
|
createTable: (e) => {
|
|
1605
1611
|
e.setRowPinning = (o) => e.options.onRowPinningChange == null ? void 0 : e.options.onRowPinningChange(o), e.resetRowPinning = (o) => {
|
|
1606
1612
|
var t, n;
|
|
1607
|
-
return e.setRowPinning(o ?
|
|
1613
|
+
return e.setRowPinning(o ? we() : (t = (n = e.initialState) == null ? void 0 : n.rowPinning) != null ? t : we());
|
|
1608
1614
|
}, e.getIsSomeRowsPinned = (o) => {
|
|
1609
1615
|
var t;
|
|
1610
1616
|
const n = e.getState().rowPinning;
|
|
@@ -1619,20 +1625,20 @@ const dn = {
|
|
|
1619
1625
|
//get all rows that are pinned even if they would not be otherwise visible
|
|
1620
1626
|
//account for expanded parent rows, but not pagination or filtering
|
|
1621
1627
|
(t ?? []).map((i) => {
|
|
1622
|
-
const
|
|
1623
|
-
return
|
|
1628
|
+
const a = e.getRow(i, !0);
|
|
1629
|
+
return a.getIsAllParentsExpanded() ? a : null;
|
|
1624
1630
|
})
|
|
1625
1631
|
) : (
|
|
1626
1632
|
//else get only visible rows that are pinned
|
|
1627
|
-
(t ?? []).map((i) => o.find((
|
|
1633
|
+
(t ?? []).map((i) => o.find((a) => a.id === i))
|
|
1628
1634
|
)).filter(Boolean).map((i) => ({
|
|
1629
1635
|
...i,
|
|
1630
1636
|
position: n
|
|
1631
1637
|
}));
|
|
1632
|
-
}, e.getTopRows =
|
|
1638
|
+
}, e.getTopRows = S(() => [e.getRowModel().rows, e.getState().rowPinning.top], (o, t) => e._getPinnedRows(o, t, "top"), R(e.options, "debugRows", "getTopRows")), e.getBottomRows = S(() => [e.getRowModel().rows, e.getState().rowPinning.bottom], (o, t) => e._getPinnedRows(o, t, "bottom"), R(e.options, "debugRows", "getBottomRows")), e.getCenterRows = S(() => [e.getRowModel().rows, e.getState().rowPinning.top, e.getState().rowPinning.bottom], (o, t, n) => {
|
|
1633
1639
|
const r = /* @__PURE__ */ new Set([...t ?? [], ...n ?? []]);
|
|
1634
1640
|
return o.filter((l) => !r.has(l.id));
|
|
1635
|
-
},
|
|
1641
|
+
}, R(e.options, "debugRows", "getCenterRows"));
|
|
1636
1642
|
}
|
|
1637
1643
|
}, hn = {
|
|
1638
1644
|
getInitialState: (e) => ({
|
|
@@ -1671,19 +1677,19 @@ const dn = {
|
|
|
1671
1677
|
return e.getRowModel().rows.forEach((l) => {
|
|
1672
1678
|
_e(r, l.id, n, !0, e);
|
|
1673
1679
|
}), r;
|
|
1674
|
-
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel =
|
|
1680
|
+
}), e.getPreSelectedRowModel = () => e.getCoreRowModel(), e.getSelectedRowModel = S(() => [e.getState().rowSelection, e.getCoreRowModel()], (o, t) => Object.keys(o).length ? ve(e, t) : {
|
|
1675
1681
|
rows: [],
|
|
1676
1682
|
flatRows: [],
|
|
1677
1683
|
rowsById: {}
|
|
1678
|
-
},
|
|
1684
|
+
}, R(e.options, "debugTable", "getSelectedRowModel")), e.getFilteredSelectedRowModel = S(() => [e.getState().rowSelection, e.getFilteredRowModel()], (o, t) => Object.keys(o).length ? ve(e, t) : {
|
|
1679
1685
|
rows: [],
|
|
1680
1686
|
flatRows: [],
|
|
1681
1687
|
rowsById: {}
|
|
1682
|
-
},
|
|
1688
|
+
}, R(e.options, "debugTable", "getFilteredSelectedRowModel")), e.getGroupedSelectedRowModel = S(() => [e.getState().rowSelection, e.getSortedRowModel()], (o, t) => Object.keys(o).length ? ve(e, t) : {
|
|
1683
1689
|
rows: [],
|
|
1684
1690
|
flatRows: [],
|
|
1685
1691
|
rowsById: {}
|
|
1686
|
-
},
|
|
1692
|
+
}, R(e.options, "debugTable", "getGroupedSelectedRowModel")), e.getIsAllRowsSelected = () => {
|
|
1687
1693
|
const o = e.getFilteredRowModel().flatRows, {
|
|
1688
1694
|
rowSelection: t
|
|
1689
1695
|
} = e.getState();
|
|
@@ -1715,10 +1721,10 @@ const dn = {
|
|
|
1715
1721
|
var i;
|
|
1716
1722
|
if (t = typeof t < "u" ? t : !r, e.getCanSelect() && r === t)
|
|
1717
1723
|
return l;
|
|
1718
|
-
const
|
|
1724
|
+
const a = {
|
|
1719
1725
|
...l
|
|
1720
1726
|
};
|
|
1721
|
-
return _e(
|
|
1727
|
+
return _e(a, e.id, t, (i = n == null ? void 0 : n.selectChildren) != null ? i : !0, o), a;
|
|
1722
1728
|
});
|
|
1723
1729
|
}, e.getIsSelected = () => {
|
|
1724
1730
|
const {
|
|
@@ -1755,18 +1761,18 @@ const dn = {
|
|
|
1755
1761
|
}, _e = (e, o, t, n, r) => {
|
|
1756
1762
|
var l;
|
|
1757
1763
|
const i = r.getRow(o, !0);
|
|
1758
|
-
t ? (i.getCanMultiSelect() || Object.keys(e).forEach((
|
|
1764
|
+
t ? (i.getCanMultiSelect() || Object.keys(e).forEach((a) => delete e[a]), i.getCanSelect() && (e[o] = !0)) : delete e[o], n && (l = i.subRows) != null && l.length && i.getCanSelectSubRows() && i.subRows.forEach((a) => _e(e, a.id, t, n, r));
|
|
1759
1765
|
};
|
|
1760
|
-
function
|
|
1761
|
-
const t = e.getState().rowSelection, n = [], r = {}, l = function(i,
|
|
1762
|
-
return i.map((
|
|
1766
|
+
function ve(e, o) {
|
|
1767
|
+
const t = e.getState().rowSelection, n = [], r = {}, l = function(i, a) {
|
|
1768
|
+
return i.map((u) => {
|
|
1763
1769
|
var f;
|
|
1764
|
-
const p = Ee(
|
|
1765
|
-
if (p && (n.push(
|
|
1766
|
-
...
|
|
1767
|
-
subRows: l(
|
|
1770
|
+
const p = Ee(u, t);
|
|
1771
|
+
if (p && (n.push(u), r[u.id] = u), (f = u.subRows) != null && f.length && (u = {
|
|
1772
|
+
...u,
|
|
1773
|
+
subRows: l(u.subRows)
|
|
1768
1774
|
}), p)
|
|
1769
|
-
return
|
|
1775
|
+
return u;
|
|
1770
1776
|
}).filter(Boolean);
|
|
1771
1777
|
};
|
|
1772
1778
|
return {
|
|
@@ -1785,12 +1791,12 @@ function Fe(e, o, t) {
|
|
|
1785
1791
|
let r = !0, l = !1;
|
|
1786
1792
|
return e.subRows.forEach((i) => {
|
|
1787
1793
|
if (!(l && !r) && (i.getCanSelect() && (Ee(i, o) ? l = !0 : r = !1), i.subRows && i.subRows.length)) {
|
|
1788
|
-
const
|
|
1789
|
-
|
|
1794
|
+
const a = Fe(i, o);
|
|
1795
|
+
a === "all" ? l = !0 : (a === "some" && (l = !0), r = !1);
|
|
1790
1796
|
}
|
|
1791
1797
|
}), r ? "all" : l ? "some" : !1;
|
|
1792
1798
|
}
|
|
1793
|
-
const $e = /([0-9]+)/gm,
|
|
1799
|
+
const $e = /([0-9]+)/gm, wn = (e, o, t) => ot(U(e.getValue(t)).toLowerCase(), U(o.getValue(t)).toLowerCase()), vn = (e, o, t) => ot(U(e.getValue(t)), U(o.getValue(t))), Cn = (e, o, t) => De(U(e.getValue(t)).toLowerCase(), U(o.getValue(t)).toLowerCase()), Sn = (e, o, t) => De(U(e.getValue(t)), U(o.getValue(t))), Rn = (e, o, t) => {
|
|
1794
1800
|
const n = e.getValue(t), r = o.getValue(t);
|
|
1795
1801
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1796
1802
|
}, yn = (e, o, t) => De(e.getValue(t), o.getValue(t));
|
|
@@ -1803,26 +1809,26 @@ function U(e) {
|
|
|
1803
1809
|
function ot(e, o) {
|
|
1804
1810
|
const t = e.split($e).filter(Boolean), n = o.split($e).filter(Boolean);
|
|
1805
1811
|
for (; t.length && n.length; ) {
|
|
1806
|
-
const r = t.shift(), l = n.shift(), i = parseInt(r, 10),
|
|
1807
|
-
if (isNaN(
|
|
1812
|
+
const r = t.shift(), l = n.shift(), i = parseInt(r, 10), a = parseInt(l, 10), u = [i, a].sort();
|
|
1813
|
+
if (isNaN(u[0])) {
|
|
1808
1814
|
if (r > l)
|
|
1809
1815
|
return 1;
|
|
1810
1816
|
if (l > r)
|
|
1811
1817
|
return -1;
|
|
1812
1818
|
continue;
|
|
1813
1819
|
}
|
|
1814
|
-
if (isNaN(
|
|
1820
|
+
if (isNaN(u[1]))
|
|
1815
1821
|
return isNaN(i) ? -1 : 1;
|
|
1816
|
-
if (i >
|
|
1822
|
+
if (i > a)
|
|
1817
1823
|
return 1;
|
|
1818
|
-
if (
|
|
1824
|
+
if (a > i)
|
|
1819
1825
|
return -1;
|
|
1820
1826
|
}
|
|
1821
1827
|
return t.length - n.length;
|
|
1822
1828
|
}
|
|
1823
1829
|
const te = {
|
|
1824
|
-
alphanumeric:
|
|
1825
|
-
alphanumericCaseSensitive:
|
|
1830
|
+
alphanumeric: wn,
|
|
1831
|
+
alphanumericCaseSensitive: vn,
|
|
1826
1832
|
text: Cn,
|
|
1827
1833
|
textCaseSensitive: Sn,
|
|
1828
1834
|
datetime: Rn,
|
|
@@ -1863,18 +1869,18 @@ const te = {
|
|
|
1863
1869
|
}, e.toggleSorting = (t, n) => {
|
|
1864
1870
|
const r = e.getNextSortingOrder(), l = typeof t < "u" && t !== null;
|
|
1865
1871
|
o.setSorting((i) => {
|
|
1866
|
-
const
|
|
1872
|
+
const a = i == null ? void 0 : i.find((s) => s.id === e.id), u = i == null ? void 0 : i.findIndex((s) => s.id === e.id);
|
|
1867
1873
|
let f = [], p, c = l ? t : r === "desc";
|
|
1868
|
-
if (i != null && i.length && e.getCanMultiSort() && n ?
|
|
1874
|
+
if (i != null && i.length && e.getCanMultiSort() && n ? a ? p = "toggle" : p = "add" : i != null && i.length && u !== i.length - 1 ? p = "replace" : a ? p = "toggle" : p = "replace", p === "toggle" && (l || r || (p = "remove")), p === "add") {
|
|
1869
1875
|
var d;
|
|
1870
1876
|
f = [...i, {
|
|
1871
1877
|
id: e.id,
|
|
1872
1878
|
desc: c
|
|
1873
1879
|
}], f.splice(0, f.length - ((d = o.options.maxMultiSortColCount) != null ? d : Number.MAX_SAFE_INTEGER));
|
|
1874
|
-
} else p === "toggle" ? f = i.map((
|
|
1875
|
-
...
|
|
1880
|
+
} else p === "toggle" ? f = i.map((s) => s.id === e.id ? {
|
|
1881
|
+
...s,
|
|
1876
1882
|
desc: c
|
|
1877
|
-
} :
|
|
1883
|
+
} : s) : p === "remove" ? f = i.filter((s) => s.id !== e.id) : f = [{
|
|
1878
1884
|
id: e.id,
|
|
1879
1885
|
desc: c
|
|
1880
1886
|
}];
|
|
@@ -1943,17 +1949,17 @@ function Fn(e) {
|
|
|
1943
1949
|
let r = {
|
|
1944
1950
|
_features: n
|
|
1945
1951
|
};
|
|
1946
|
-
const l = r._features.reduce((d,
|
|
1952
|
+
const l = r._features.reduce((d, s) => Object.assign(d, s.getDefaultOptions == null ? void 0 : s.getDefaultOptions(r)), {}), i = (d) => r.options.mergeOptions ? r.options.mergeOptions(l, d) : {
|
|
1947
1953
|
...l,
|
|
1948
1954
|
...d
|
|
1949
1955
|
};
|
|
1950
|
-
let
|
|
1956
|
+
let u = {
|
|
1951
1957
|
...{},
|
|
1952
1958
|
...(t = e.initialState) != null ? t : {}
|
|
1953
1959
|
};
|
|
1954
1960
|
r._features.forEach((d) => {
|
|
1955
|
-
var
|
|
1956
|
-
|
|
1961
|
+
var s;
|
|
1962
|
+
u = (s = d.getInitialState == null ? void 0 : d.getInitialState(u)) != null ? s : u;
|
|
1957
1963
|
});
|
|
1958
1964
|
const f = [];
|
|
1959
1965
|
let p = !1;
|
|
@@ -1963,45 +1969,45 @@ function Fn(e) {
|
|
|
1963
1969
|
...l,
|
|
1964
1970
|
...e
|
|
1965
1971
|
},
|
|
1966
|
-
initialState:
|
|
1972
|
+
initialState: u,
|
|
1967
1973
|
_queue: (d) => {
|
|
1968
1974
|
f.push(d), p || (p = !0, Promise.resolve().then(() => {
|
|
1969
1975
|
for (; f.length; )
|
|
1970
1976
|
f.shift()();
|
|
1971
1977
|
p = !1;
|
|
1972
|
-
}).catch((
|
|
1973
|
-
throw
|
|
1978
|
+
}).catch((s) => setTimeout(() => {
|
|
1979
|
+
throw s;
|
|
1974
1980
|
})));
|
|
1975
1981
|
},
|
|
1976
1982
|
reset: () => {
|
|
1977
1983
|
r.setState(r.initialState);
|
|
1978
1984
|
},
|
|
1979
1985
|
setOptions: (d) => {
|
|
1980
|
-
const
|
|
1981
|
-
r.options = i(
|
|
1986
|
+
const s = q(d, r.options);
|
|
1987
|
+
r.options = i(s);
|
|
1982
1988
|
},
|
|
1983
1989
|
getState: () => r.options.state,
|
|
1984
1990
|
setState: (d) => {
|
|
1985
1991
|
r.options.onStateChange == null || r.options.onStateChange(d);
|
|
1986
1992
|
},
|
|
1987
|
-
_getRowId: (d,
|
|
1993
|
+
_getRowId: (d, s, m) => {
|
|
1988
1994
|
var h;
|
|
1989
|
-
return (h = r.options.getRowId == null ? void 0 : r.options.getRowId(d,
|
|
1995
|
+
return (h = r.options.getRowId == null ? void 0 : r.options.getRowId(d, s, m)) != null ? h : `${m ? [m.id, s].join(".") : s}`;
|
|
1990
1996
|
},
|
|
1991
1997
|
getCoreRowModel: () => (r._getCoreRowModel || (r._getCoreRowModel = r.options.getCoreRowModel(r)), r._getCoreRowModel()),
|
|
1992
1998
|
// The final calls start at the bottom of the model,
|
|
1993
1999
|
// expanded rows, which then work their way up
|
|
1994
2000
|
getRowModel: () => r.getPaginationRowModel(),
|
|
1995
2001
|
//in next version, we should just pass in the row model as the optional 2nd arg
|
|
1996
|
-
getRow: (d,
|
|
1997
|
-
let m = (
|
|
2002
|
+
getRow: (d, s) => {
|
|
2003
|
+
let m = (s ? r.getPrePaginationRowModel() : r.getRowModel()).rowsById[d];
|
|
1998
2004
|
if (!m && (m = r.getCoreRowModel().rowsById[d], !m))
|
|
1999
2005
|
throw process.env.NODE_ENV !== "production" ? new Error(`getRow could not find row with ID: ${d}`) : new Error();
|
|
2000
2006
|
return m;
|
|
2001
2007
|
},
|
|
2002
|
-
_getDefaultColumnDef:
|
|
2003
|
-
var
|
|
2004
|
-
return d = (
|
|
2008
|
+
_getDefaultColumnDef: S(() => [r.options.defaultColumn], (d) => {
|
|
2009
|
+
var s;
|
|
2010
|
+
return d = (s = d) != null ? s : {}, {
|
|
2005
2011
|
header: (m) => {
|
|
2006
2012
|
const h = m.header.column.columnDef;
|
|
2007
2013
|
return h.accessorKey ? h.accessorKey : h.accessorFn ? h.id : null;
|
|
@@ -2014,55 +2020,55 @@ function Fn(e) {
|
|
|
2014
2020
|
...r._features.reduce((m, h) => Object.assign(m, h.getDefaultColumnDef == null ? void 0 : h.getDefaultColumnDef()), {}),
|
|
2015
2021
|
...d
|
|
2016
2022
|
};
|
|
2017
|
-
},
|
|
2023
|
+
}, R(e, "debugColumns", "_getDefaultColumnDef")),
|
|
2018
2024
|
_getColumnDefs: () => r.options.columns,
|
|
2019
|
-
getAllColumns:
|
|
2020
|
-
const
|
|
2021
|
-
return w === void 0 && (w = 0), m.map((
|
|
2022
|
-
const
|
|
2023
|
-
return
|
|
2025
|
+
getAllColumns: S(() => [r._getColumnDefs()], (d) => {
|
|
2026
|
+
const s = function(m, h, w) {
|
|
2027
|
+
return w === void 0 && (w = 0), m.map((C) => {
|
|
2028
|
+
const x = Tt(r, C, w, h), F = C;
|
|
2029
|
+
return x.columns = F.columns ? s(F.columns, x, w + 1) : [], x;
|
|
2024
2030
|
});
|
|
2025
2031
|
};
|
|
2026
|
-
return
|
|
2027
|
-
},
|
|
2028
|
-
getAllFlatColumns:
|
|
2029
|
-
_getAllFlatColumnsById:
|
|
2030
|
-
getAllLeafColumns:
|
|
2032
|
+
return s(d);
|
|
2033
|
+
}, R(e, "debugColumns", "getAllColumns")),
|
|
2034
|
+
getAllFlatColumns: S(() => [r.getAllColumns()], (d) => d.flatMap((s) => s.getFlatColumns()), R(e, "debugColumns", "getAllFlatColumns")),
|
|
2035
|
+
_getAllFlatColumnsById: S(() => [r.getAllFlatColumns()], (d) => d.reduce((s, m) => (s[m.id] = m, s), {}), R(e, "debugColumns", "getAllFlatColumnsById")),
|
|
2036
|
+
getAllLeafColumns: S(() => [r.getAllColumns(), r._getOrderColumnsFn()], (d, s) => {
|
|
2031
2037
|
let m = d.flatMap((h) => h.getLeafColumns());
|
|
2032
|
-
return
|
|
2033
|
-
},
|
|
2038
|
+
return s(m);
|
|
2039
|
+
}, R(e, "debugColumns", "getAllLeafColumns")),
|
|
2034
2040
|
getColumn: (d) => {
|
|
2035
|
-
const
|
|
2036
|
-
return process.env.NODE_ENV !== "production" && !
|
|
2041
|
+
const s = r._getAllFlatColumnsById()[d];
|
|
2042
|
+
return process.env.NODE_ENV !== "production" && !s && console.error(`[Table] Column with id '${d}' does not exist.`), s;
|
|
2037
2043
|
}
|
|
2038
2044
|
};
|
|
2039
2045
|
Object.assign(r, c);
|
|
2040
2046
|
for (let d = 0; d < r._features.length; d++) {
|
|
2041
|
-
const
|
|
2042
|
-
|
|
2047
|
+
const s = r._features[d];
|
|
2048
|
+
s == null || s.createTable == null || s.createTable(r);
|
|
2043
2049
|
}
|
|
2044
2050
|
return r;
|
|
2045
2051
|
}
|
|
2046
2052
|
function $n() {
|
|
2047
|
-
return (e) =>
|
|
2053
|
+
return (e) => S(() => [e.options.data], (o) => {
|
|
2048
2054
|
const t = {
|
|
2049
2055
|
rows: [],
|
|
2050
2056
|
flatRows: [],
|
|
2051
2057
|
rowsById: {}
|
|
2052
2058
|
}, n = function(r, l, i) {
|
|
2053
2059
|
l === void 0 && (l = 0);
|
|
2054
|
-
const
|
|
2060
|
+
const a = [];
|
|
2055
2061
|
for (let f = 0; f < r.length; f++) {
|
|
2056
2062
|
const p = Ne(e, e._getRowId(r[f], f, i), r[f], f, l, void 0, i == null ? void 0 : i.id);
|
|
2057
|
-
if (t.flatRows.push(p), t.rowsById[p.id] = p,
|
|
2058
|
-
var
|
|
2059
|
-
p.originalSubRows = e.options.getSubRows(r[f], f), (
|
|
2063
|
+
if (t.flatRows.push(p), t.rowsById[p.id] = p, a.push(p), e.options.getSubRows) {
|
|
2064
|
+
var u;
|
|
2065
|
+
p.originalSubRows = e.options.getSubRows(r[f], f), (u = p.originalSubRows) != null && u.length && (p.subRows = n(p.originalSubRows, l + 1, p));
|
|
2060
2066
|
}
|
|
2061
2067
|
}
|
|
2062
|
-
return
|
|
2068
|
+
return a;
|
|
2063
2069
|
};
|
|
2064
2070
|
return t.rows = n(o), t;
|
|
2065
|
-
},
|
|
2071
|
+
}, R(e.options, "debugTable", "getRowModel", () => e._autoResetPageIndex()));
|
|
2066
2072
|
}
|
|
2067
2073
|
function Mn(e) {
|
|
2068
2074
|
const o = [], t = (n) => {
|
|
@@ -2080,59 +2086,59 @@ function In(e, o, t) {
|
|
|
2080
2086
|
}
|
|
2081
2087
|
function Vn(e, o, t) {
|
|
2082
2088
|
var n;
|
|
2083
|
-
const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100,
|
|
2089
|
+
const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, a = function(u, f) {
|
|
2084
2090
|
f === void 0 && (f = 0);
|
|
2085
2091
|
const p = [];
|
|
2086
|
-
for (let d = 0; d <
|
|
2092
|
+
for (let d = 0; d < u.length; d++) {
|
|
2087
2093
|
var c;
|
|
2088
|
-
let
|
|
2089
|
-
const m = Ne(t,
|
|
2090
|
-
if (m.columnFilters =
|
|
2091
|
-
if (m.subRows = s
|
|
2092
|
-
p.push(
|
|
2094
|
+
let s = u[d];
|
|
2095
|
+
const m = Ne(t, s.id, s.original, s.index, s.depth, void 0, s.parentId);
|
|
2096
|
+
if (m.columnFilters = s.columnFilters, (c = s.subRows) != null && c.length && f < i) {
|
|
2097
|
+
if (m.subRows = a(s.subRows, f + 1), s = m, o(s) && !m.subRows.length) {
|
|
2098
|
+
p.push(s), l[s.id] = s, r.push(s);
|
|
2093
2099
|
continue;
|
|
2094
2100
|
}
|
|
2095
|
-
if (o(
|
|
2096
|
-
p.push(
|
|
2101
|
+
if (o(s) || m.subRows.length) {
|
|
2102
|
+
p.push(s), l[s.id] = s, r.push(s);
|
|
2097
2103
|
continue;
|
|
2098
2104
|
}
|
|
2099
2105
|
} else
|
|
2100
|
-
|
|
2106
|
+
s = m, o(s) && (p.push(s), l[s.id] = s, r.push(s));
|
|
2101
2107
|
}
|
|
2102
2108
|
return p;
|
|
2103
2109
|
};
|
|
2104
2110
|
return {
|
|
2105
|
-
rows:
|
|
2111
|
+
rows: a(e),
|
|
2106
2112
|
flatRows: r,
|
|
2107
2113
|
rowsById: l
|
|
2108
2114
|
};
|
|
2109
2115
|
}
|
|
2110
2116
|
function Nn(e, o, t) {
|
|
2111
2117
|
var n;
|
|
2112
|
-
const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100,
|
|
2118
|
+
const r = [], l = {}, i = (n = t.options.maxLeafRowFilterDepth) != null ? n : 100, a = function(u, f) {
|
|
2113
2119
|
f === void 0 && (f = 0);
|
|
2114
2120
|
const p = [];
|
|
2115
|
-
for (let d = 0; d <
|
|
2116
|
-
let
|
|
2117
|
-
if (o(
|
|
2121
|
+
for (let d = 0; d < u.length; d++) {
|
|
2122
|
+
let s = u[d];
|
|
2123
|
+
if (o(s)) {
|
|
2118
2124
|
var c;
|
|
2119
|
-
if ((c =
|
|
2120
|
-
const h = Ne(t,
|
|
2121
|
-
h.subRows = s
|
|
2125
|
+
if ((c = s.subRows) != null && c.length && f < i) {
|
|
2126
|
+
const h = Ne(t, s.id, s.original, s.index, s.depth, void 0, s.parentId);
|
|
2127
|
+
h.subRows = a(s.subRows, f + 1), s = h;
|
|
2122
2128
|
}
|
|
2123
|
-
p.push(
|
|
2129
|
+
p.push(s), r.push(s), l[s.id] = s;
|
|
2124
2130
|
}
|
|
2125
2131
|
}
|
|
2126
2132
|
return p;
|
|
2127
2133
|
};
|
|
2128
2134
|
return {
|
|
2129
|
-
rows:
|
|
2135
|
+
rows: a(e),
|
|
2130
2136
|
flatRows: r,
|
|
2131
2137
|
rowsById: l
|
|
2132
2138
|
};
|
|
2133
2139
|
}
|
|
2134
2140
|
function Pn() {
|
|
2135
|
-
return (e) =>
|
|
2141
|
+
return (e) => S(() => [e.getPreFilteredRowModel(), e.getState().columnFilters, e.getState().globalFilter], (o, t, n) => {
|
|
2136
2142
|
if (!o.rows.length || !(t != null && t.length) && !n) {
|
|
2137
2143
|
for (let d = 0; d < o.flatRows.length; d++)
|
|
2138
2144
|
o.flatRows[d].columnFilters = {}, o.flatRows[d].columnFiltersMeta = {};
|
|
@@ -2140,7 +2146,7 @@ function Pn() {
|
|
|
2140
2146
|
}
|
|
2141
2147
|
const r = [], l = [];
|
|
2142
2148
|
(t ?? []).forEach((d) => {
|
|
2143
|
-
var
|
|
2149
|
+
var s;
|
|
2144
2150
|
const m = e.getColumn(d.id);
|
|
2145
2151
|
if (!m)
|
|
2146
2152
|
return;
|
|
@@ -2152,54 +2158,54 @@ function Pn() {
|
|
|
2152
2158
|
r.push({
|
|
2153
2159
|
id: d.id,
|
|
2154
2160
|
filterFn: h,
|
|
2155
|
-
resolvedValue: (
|
|
2161
|
+
resolvedValue: (s = h.resolveFilterValue == null ? void 0 : h.resolveFilterValue(d.value)) != null ? s : d.value
|
|
2156
2162
|
});
|
|
2157
2163
|
});
|
|
2158
|
-
const i = (t ?? []).map((d) => d.id),
|
|
2159
|
-
n &&
|
|
2160
|
-
var
|
|
2164
|
+
const i = (t ?? []).map((d) => d.id), a = e.getGlobalFilterFn(), u = e.getAllLeafColumns().filter((d) => d.getCanGlobalFilter());
|
|
2165
|
+
n && a && u.length && (i.push("__global__"), u.forEach((d) => {
|
|
2166
|
+
var s;
|
|
2161
2167
|
l.push({
|
|
2162
2168
|
id: d.id,
|
|
2163
|
-
filterFn:
|
|
2164
|
-
resolvedValue: (
|
|
2169
|
+
filterFn: a,
|
|
2170
|
+
resolvedValue: (s = a.resolveFilterValue == null ? void 0 : a.resolveFilterValue(n)) != null ? s : n
|
|
2165
2171
|
});
|
|
2166
2172
|
}));
|
|
2167
2173
|
let f, p;
|
|
2168
2174
|
for (let d = 0; d < o.flatRows.length; d++) {
|
|
2169
|
-
const
|
|
2170
|
-
if (
|
|
2175
|
+
const s = o.flatRows[d];
|
|
2176
|
+
if (s.columnFilters = {}, r.length)
|
|
2171
2177
|
for (let m = 0; m < r.length; m++) {
|
|
2172
2178
|
f = r[m];
|
|
2173
2179
|
const h = f.id;
|
|
2174
|
-
|
|
2175
|
-
|
|
2180
|
+
s.columnFilters[h] = f.filterFn(s, h, f.resolvedValue, (w) => {
|
|
2181
|
+
s.columnFiltersMeta[h] = w;
|
|
2176
2182
|
});
|
|
2177
2183
|
}
|
|
2178
2184
|
if (l.length) {
|
|
2179
2185
|
for (let m = 0; m < l.length; m++) {
|
|
2180
2186
|
p = l[m];
|
|
2181
2187
|
const h = p.id;
|
|
2182
|
-
if (p.filterFn(
|
|
2183
|
-
|
|
2188
|
+
if (p.filterFn(s, h, p.resolvedValue, (w) => {
|
|
2189
|
+
s.columnFiltersMeta[h] = w;
|
|
2184
2190
|
})) {
|
|
2185
|
-
|
|
2191
|
+
s.columnFilters.__global__ = !0;
|
|
2186
2192
|
break;
|
|
2187
2193
|
}
|
|
2188
2194
|
}
|
|
2189
|
-
|
|
2195
|
+
s.columnFilters.__global__ !== !0 && (s.columnFilters.__global__ = !1);
|
|
2190
2196
|
}
|
|
2191
2197
|
}
|
|
2192
2198
|
const c = (d) => {
|
|
2193
|
-
for (let
|
|
2194
|
-
if (d.columnFilters[i[
|
|
2199
|
+
for (let s = 0; s < i.length; s++)
|
|
2200
|
+
if (d.columnFilters[i[s]] === !1)
|
|
2195
2201
|
return !1;
|
|
2196
2202
|
return !0;
|
|
2197
2203
|
};
|
|
2198
2204
|
return In(o.rows, c, e);
|
|
2199
|
-
},
|
|
2205
|
+
}, R(e.options, "debugTable", "getFilteredRowModel", () => e._autoResetPageIndex()));
|
|
2200
2206
|
}
|
|
2201
2207
|
function En(e) {
|
|
2202
|
-
return (o) =>
|
|
2208
|
+
return (o) => S(() => [o.getState().pagination, o.getPrePaginationRowModel(), o.options.paginateExpandedRows ? void 0 : o.getState().expanded], (t, n) => {
|
|
2203
2209
|
if (!n.rows.length)
|
|
2204
2210
|
return n;
|
|
2205
2211
|
const {
|
|
@@ -2208,75 +2214,75 @@ function En(e) {
|
|
|
2208
2214
|
} = t;
|
|
2209
2215
|
let {
|
|
2210
2216
|
rows: i,
|
|
2211
|
-
flatRows:
|
|
2212
|
-
rowsById:
|
|
2217
|
+
flatRows: a,
|
|
2218
|
+
rowsById: u
|
|
2213
2219
|
} = n;
|
|
2214
2220
|
const f = r * l, p = f + r;
|
|
2215
2221
|
i = i.slice(f, p);
|
|
2216
2222
|
let c;
|
|
2217
2223
|
o.options.paginateExpandedRows ? c = {
|
|
2218
2224
|
rows: i,
|
|
2219
|
-
flatRows:
|
|
2220
|
-
rowsById:
|
|
2225
|
+
flatRows: a,
|
|
2226
|
+
rowsById: u
|
|
2221
2227
|
} : c = Mn({
|
|
2222
2228
|
rows: i,
|
|
2223
|
-
flatRows:
|
|
2224
|
-
rowsById:
|
|
2229
|
+
flatRows: a,
|
|
2230
|
+
rowsById: u
|
|
2225
2231
|
}), c.flatRows = [];
|
|
2226
|
-
const d = (
|
|
2227
|
-
c.flatRows.push(
|
|
2232
|
+
const d = (s) => {
|
|
2233
|
+
c.flatRows.push(s), s.subRows.length && s.subRows.forEach(d);
|
|
2228
2234
|
};
|
|
2229
2235
|
return c.rows.forEach(d), c;
|
|
2230
|
-
},
|
|
2236
|
+
}, R(o.options, "debugTable", "getPaginationRowModel"));
|
|
2231
2237
|
}
|
|
2232
2238
|
function Dn() {
|
|
2233
|
-
return (e) =>
|
|
2239
|
+
return (e) => S(() => [e.getState().sorting, e.getPreSortedRowModel()], (o, t) => {
|
|
2234
2240
|
if (!t.rows.length || !(o != null && o.length))
|
|
2235
2241
|
return t;
|
|
2236
|
-
const n = e.getState().sorting, r = [], l = n.filter((
|
|
2242
|
+
const n = e.getState().sorting, r = [], l = n.filter((u) => {
|
|
2237
2243
|
var f;
|
|
2238
|
-
return (f = e.getColumn(
|
|
2244
|
+
return (f = e.getColumn(u.id)) == null ? void 0 : f.getCanSort();
|
|
2239
2245
|
}), i = {};
|
|
2240
|
-
l.forEach((
|
|
2241
|
-
const f = e.getColumn(
|
|
2242
|
-
f && (i[
|
|
2246
|
+
l.forEach((u) => {
|
|
2247
|
+
const f = e.getColumn(u.id);
|
|
2248
|
+
f && (i[u.id] = {
|
|
2243
2249
|
sortUndefined: f.columnDef.sortUndefined,
|
|
2244
2250
|
invertSorting: f.columnDef.invertSorting,
|
|
2245
2251
|
sortingFn: f.getSortingFn()
|
|
2246
2252
|
});
|
|
2247
2253
|
});
|
|
2248
|
-
const
|
|
2249
|
-
const f =
|
|
2254
|
+
const a = (u) => {
|
|
2255
|
+
const f = u.map((p) => ({
|
|
2250
2256
|
...p
|
|
2251
2257
|
}));
|
|
2252
2258
|
return f.sort((p, c) => {
|
|
2253
|
-
for (let
|
|
2259
|
+
for (let s = 0; s < l.length; s += 1) {
|
|
2254
2260
|
var d;
|
|
2255
|
-
const m = l[
|
|
2256
|
-
let
|
|
2261
|
+
const m = l[s], h = i[m.id], w = h.sortUndefined, C = (d = m == null ? void 0 : m.desc) != null ? d : !1;
|
|
2262
|
+
let x = 0;
|
|
2257
2263
|
if (w) {
|
|
2258
|
-
const
|
|
2264
|
+
const F = p.getValue(m.id), E = c.getValue(m.id), I = F === void 0, D = E === void 0;
|
|
2259
2265
|
if (I || D) {
|
|
2260
2266
|
if (w === "first") return I ? -1 : 1;
|
|
2261
2267
|
if (w === "last") return I ? 1 : -1;
|
|
2262
|
-
|
|
2268
|
+
x = I && D ? 0 : I ? w : -w;
|
|
2263
2269
|
}
|
|
2264
2270
|
}
|
|
2265
|
-
if (
|
|
2266
|
-
return
|
|
2271
|
+
if (x === 0 && (x = h.sortingFn(p, c, m.id)), x !== 0)
|
|
2272
|
+
return C && (x *= -1), h.invertSorting && (x *= -1), x;
|
|
2267
2273
|
}
|
|
2268
2274
|
return p.index - c.index;
|
|
2269
2275
|
}), f.forEach((p) => {
|
|
2270
2276
|
var c;
|
|
2271
|
-
r.push(p), (c = p.subRows) != null && c.length && (p.subRows =
|
|
2277
|
+
r.push(p), (c = p.subRows) != null && c.length && (p.subRows = a(p.subRows));
|
|
2272
2278
|
}), f;
|
|
2273
2279
|
};
|
|
2274
2280
|
return {
|
|
2275
|
-
rows:
|
|
2281
|
+
rows: a(t.rows),
|
|
2276
2282
|
flatRows: r,
|
|
2277
2283
|
rowsById: t.rowsById
|
|
2278
2284
|
};
|
|
2279
|
-
},
|
|
2285
|
+
}, R(e.options, "debugTable", "getSortedRowModel", () => e._autoResetPageIndex()));
|
|
2280
2286
|
}
|
|
2281
2287
|
/**
|
|
2282
2288
|
* react-table
|
|
@@ -2292,7 +2298,7 @@ function je(e, o) {
|
|
|
2292
2298
|
return e ? kn(e) ? /* @__PURE__ */ Se.createElement(e, o) : e : null;
|
|
2293
2299
|
}
|
|
2294
2300
|
function kn(e) {
|
|
2295
|
-
return Ln(e) || typeof e == "function" ||
|
|
2301
|
+
return Ln(e) || typeof e == "function" || zn(e);
|
|
2296
2302
|
}
|
|
2297
2303
|
function Ln(e) {
|
|
2298
2304
|
return typeof e == "function" && (() => {
|
|
@@ -2300,10 +2306,10 @@ function Ln(e) {
|
|
|
2300
2306
|
return o.prototype && o.prototype.isReactComponent;
|
|
2301
2307
|
})();
|
|
2302
2308
|
}
|
|
2303
|
-
function
|
|
2309
|
+
function zn(e) {
|
|
2304
2310
|
return typeof e == "object" && typeof e.$$typeof == "symbol" && ["react.memo", "react.forward_ref"].includes(e.$$typeof.description);
|
|
2305
2311
|
}
|
|
2306
|
-
function
|
|
2312
|
+
function Hn(e) {
|
|
2307
2313
|
const o = {
|
|
2308
2314
|
state: {},
|
|
2309
2315
|
// Dummy state
|
|
@@ -2339,36 +2345,36 @@ const Ue = ({
|
|
|
2339
2345
|
const {
|
|
2340
2346
|
rows: l,
|
|
2341
2347
|
schema: i,
|
|
2342
|
-
mappings:
|
|
2343
|
-
errorsByRow:
|
|
2348
|
+
mappings: a,
|
|
2349
|
+
errorsByRow: u,
|
|
2344
2350
|
editingCell: f,
|
|
2345
2351
|
startEditing: p,
|
|
2346
2352
|
stopEditing: c,
|
|
2347
2353
|
updateCell: d,
|
|
2348
|
-
deleteRow:
|
|
2349
|
-
} = J(), [m, h] = Y([]), [w,
|
|
2350
|
-
const
|
|
2354
|
+
deleteRow: s
|
|
2355
|
+
} = J(), [m, h] = Y([]), [w, C] = Y(""), [x, F] = Y(""), E = He(() => a.filter((y) => y.targetKey !== null).map((y) => {
|
|
2356
|
+
const _ = i == null ? void 0 : i.columns.find((V) => V.key === y.targetKey);
|
|
2351
2357
|
return {
|
|
2352
2358
|
sourceColumn: y.sourceColumn,
|
|
2353
2359
|
targetKey: y.targetKey,
|
|
2354
|
-
label: (
|
|
2355
|
-
type: (
|
|
2360
|
+
label: (_ == null ? void 0 : _.label) || y.targetKey,
|
|
2361
|
+
type: (_ == null ? void 0 : _.type) || "string"
|
|
2356
2362
|
};
|
|
2357
|
-
}), [
|
|
2358
|
-
(y,
|
|
2359
|
-
const V =
|
|
2360
|
-
return V == null ? void 0 : V.find((W) => W.columnKey ===
|
|
2363
|
+
}), [a, i]), I = Me(
|
|
2364
|
+
(y, _) => {
|
|
2365
|
+
const V = u.get(y);
|
|
2366
|
+
return V == null ? void 0 : V.find((W) => W.columnKey === _);
|
|
2361
2367
|
},
|
|
2362
|
-
[
|
|
2363
|
-
), D = (y,
|
|
2364
|
-
|
|
2368
|
+
[u]
|
|
2369
|
+
), D = (y, _, V) => {
|
|
2370
|
+
F(V), p(y, _);
|
|
2365
2371
|
}, K = () => {
|
|
2366
|
-
f && (d(f.rowIndex, f.columnKey,
|
|
2372
|
+
f && (d(f.rowIndex, f.columnKey, x), n == null || n(f.rowIndex, f.columnKey, x)), c();
|
|
2367
2373
|
}, N = () => {
|
|
2368
|
-
|
|
2369
|
-
},
|
|
2370
|
-
|
|
2371
|
-
}, T = Gt(), O =
|
|
2374
|
+
F(""), c();
|
|
2375
|
+
}, H = (y) => {
|
|
2376
|
+
s(y), r == null || r(y);
|
|
2377
|
+
}, T = Gt(), O = He(
|
|
2372
2378
|
() => [
|
|
2373
2379
|
T.accessor("rowIndex", {
|
|
2374
2380
|
header: "#",
|
|
@@ -2376,18 +2382,18 @@ const Ue = ({
|
|
|
2376
2382
|
cell: (y) => /* @__PURE__ */ g("span", { className: "ff-font-mono ff-text-xs", style: { color: "var(--ff-text-muted)" }, children: y.getValue() + 1 })
|
|
2377
2383
|
}),
|
|
2378
2384
|
...E.map(
|
|
2379
|
-
(y) => T.accessor((
|
|
2385
|
+
(y) => T.accessor((_) => _.data[y.targetKey] || _.data[y.sourceColumn], {
|
|
2380
2386
|
id: y.targetKey,
|
|
2381
2387
|
header: y.label,
|
|
2382
|
-
cell: (
|
|
2383
|
-
const V =
|
|
2388
|
+
cell: (_) => {
|
|
2389
|
+
const V = _.row.original.rowIndex, W = String(_.getValue() ?? ""), k = I(V, y.targetKey);
|
|
2384
2390
|
return (f == null ? void 0 : f.rowIndex) === V && (f == null ? void 0 : f.columnKey) === y.targetKey ? /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-gap-2 ff-min-w-[280px]", children: [
|
|
2385
2391
|
/* @__PURE__ */ g(
|
|
2386
2392
|
"input",
|
|
2387
2393
|
{
|
|
2388
2394
|
type: "text",
|
|
2389
|
-
value:
|
|
2390
|
-
onChange: (X) =>
|
|
2395
|
+
value: x,
|
|
2396
|
+
onChange: (X) => F(X.target.value),
|
|
2391
2397
|
onKeyDown: (X) => {
|
|
2392
2398
|
X.key === "Enter" && K(), X.key === "Escape" && N();
|
|
2393
2399
|
},
|
|
@@ -2449,22 +2455,22 @@ const Ue = ({
|
|
|
2449
2455
|
header: "",
|
|
2450
2456
|
size: 50,
|
|
2451
2457
|
cell: (y) => {
|
|
2452
|
-
const
|
|
2458
|
+
const _ = y.row.original.rowIndex;
|
|
2453
2459
|
return /* @__PURE__ */ g(
|
|
2454
2460
|
"button",
|
|
2455
2461
|
{
|
|
2456
|
-
onClick: () =>
|
|
2462
|
+
onClick: () => H(_),
|
|
2457
2463
|
className: "ff-delete-btn",
|
|
2458
2464
|
title: "Delete row",
|
|
2459
|
-
children: /* @__PURE__ */ g(
|
|
2465
|
+
children: /* @__PURE__ */ g(zt, { className: "ff-w-4 ff-h-4" })
|
|
2460
2466
|
}
|
|
2461
2467
|
);
|
|
2462
2468
|
}
|
|
2463
2469
|
})
|
|
2464
2470
|
] : []
|
|
2465
2471
|
],
|
|
2466
|
-
[E, f,
|
|
2467
|
-
),
|
|
2472
|
+
[E, f, x, e, o, I, T]
|
|
2473
|
+
), z = Hn({
|
|
2468
2474
|
data: l,
|
|
2469
2475
|
columns: O,
|
|
2470
2476
|
state: {
|
|
@@ -2472,7 +2478,7 @@ const Ue = ({
|
|
|
2472
2478
|
globalFilter: w
|
|
2473
2479
|
},
|
|
2474
2480
|
onSortingChange: h,
|
|
2475
|
-
onGlobalFilterChange:
|
|
2481
|
+
onGlobalFilterChange: C,
|
|
2476
2482
|
getCoreRowModel: $n(),
|
|
2477
2483
|
getPaginationRowModel: En(),
|
|
2478
2484
|
getSortedRowModel: Dn(),
|
|
@@ -2490,38 +2496,38 @@ const Ue = ({
|
|
|
2490
2496
|
{
|
|
2491
2497
|
type: "text",
|
|
2492
2498
|
value: w,
|
|
2493
|
-
onChange: (y) =>
|
|
2499
|
+
onChange: (y) => C(y.target.value),
|
|
2494
2500
|
placeholder: "Search all columns...",
|
|
2495
2501
|
className: "ff-input ff-max-w-xs"
|
|
2496
2502
|
}
|
|
2497
2503
|
),
|
|
2498
2504
|
/* @__PURE__ */ v("div", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
2499
|
-
|
|
2505
|
+
z.getFilteredRowModel().rows.length,
|
|
2500
2506
|
" rows"
|
|
2501
2507
|
] })
|
|
2502
2508
|
] }),
|
|
2503
2509
|
/* @__PURE__ */ g("div", { className: "ff-table-container ff-max-h-[500px]", children: /* @__PURE__ */ v("table", { className: "ff-table", children: [
|
|
2504
|
-
/* @__PURE__ */ g("thead", { children:
|
|
2510
|
+
/* @__PURE__ */ g("thead", { children: z.getHeaderGroups().map((y) => /* @__PURE__ */ g("tr", { children: y.headers.map((_) => /* @__PURE__ */ g(
|
|
2505
2511
|
"th",
|
|
2506
2512
|
{
|
|
2507
|
-
style: { width:
|
|
2508
|
-
onClick:
|
|
2513
|
+
style: { width: _.getSize() },
|
|
2514
|
+
onClick: _.column.getToggleSortingHandler(),
|
|
2509
2515
|
className: j(
|
|
2510
|
-
|
|
2516
|
+
_.column.getCanSort() && "ff-cursor-pointer ff-select-none"
|
|
2511
2517
|
),
|
|
2512
2518
|
children: /* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-gap-1", children: [
|
|
2513
|
-
je(
|
|
2514
|
-
|
|
2519
|
+
je(_.column.columnDef.header, _.getContext()),
|
|
2520
|
+
_.column.getIsSorted() && /* @__PURE__ */ g("span", { children: _.column.getIsSorted() === "asc" ? "↑" : "↓" })
|
|
2515
2521
|
] })
|
|
2516
2522
|
},
|
|
2517
|
-
|
|
2523
|
+
_.id
|
|
2518
2524
|
)) }, y.id)) }),
|
|
2519
|
-
/* @__PURE__ */ g("tbody", { children:
|
|
2520
|
-
const
|
|
2525
|
+
/* @__PURE__ */ g("tbody", { children: z.getRowModel().rows.map((y) => {
|
|
2526
|
+
const _ = u.has(y.original.rowIndex);
|
|
2521
2527
|
return /* @__PURE__ */ g(
|
|
2522
2528
|
"tr",
|
|
2523
2529
|
{
|
|
2524
|
-
className: j(
|
|
2530
|
+
className: j(_ && "ff-row-error"),
|
|
2525
2531
|
children: y.getVisibleCells().map((V) => /* @__PURE__ */ g("td", { children: je(V.column.columnDef.cell, V.getContext()) }, V.id))
|
|
2526
2532
|
},
|
|
2527
2533
|
y.id
|
|
@@ -2531,16 +2537,16 @@ const Ue = ({
|
|
|
2531
2537
|
/* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-justify-between ff-px-2", children: [
|
|
2532
2538
|
/* @__PURE__ */ v("div", { className: "ff-text-sm", style: { color: "var(--ff-text-muted)" }, children: [
|
|
2533
2539
|
"Page ",
|
|
2534
|
-
|
|
2540
|
+
z.getState().pagination.pageIndex + 1,
|
|
2535
2541
|
" of ",
|
|
2536
|
-
|
|
2542
|
+
z.getPageCount()
|
|
2537
2543
|
] }),
|
|
2538
2544
|
/* @__PURE__ */ v("div", { className: "ff-flex ff-items-center ff-gap-2", children: [
|
|
2539
2545
|
/* @__PURE__ */ v(
|
|
2540
2546
|
"button",
|
|
2541
2547
|
{
|
|
2542
|
-
onClick: () =>
|
|
2543
|
-
disabled: !
|
|
2548
|
+
onClick: () => z.previousPage(),
|
|
2549
|
+
disabled: !z.getCanPreviousPage(),
|
|
2544
2550
|
className: "ff-btn ff-btn-secondary ff-btn-sm",
|
|
2545
2551
|
children: [
|
|
2546
2552
|
/* @__PURE__ */ g(St, { className: "ff-w-4 ff-h-4" }),
|
|
@@ -2551,8 +2557,8 @@ const Ue = ({
|
|
|
2551
2557
|
/* @__PURE__ */ v(
|
|
2552
2558
|
"button",
|
|
2553
2559
|
{
|
|
2554
|
-
onClick: () =>
|
|
2555
|
-
disabled: !
|
|
2560
|
+
onClick: () => z.nextPage(),
|
|
2561
|
+
disabled: !z.getCanNextPage(),
|
|
2556
2562
|
className: "ff-btn ff-btn-secondary ff-btn-sm",
|
|
2557
2563
|
children: [
|
|
2558
2564
|
"Next",
|
|
@@ -2569,7 +2575,7 @@ const Ue = ({
|
|
|
2569
2575
|
const { validationResults: o } = J();
|
|
2570
2576
|
if (!o)
|
|
2571
2577
|
return null;
|
|
2572
|
-
const { isValid: t, totalRows: n, validRows: r, errorCount: l, warningCount: i, infoCount:
|
|
2578
|
+
const { isValid: t, totalRows: n, validRows: r, errorCount: l, warningCount: i, infoCount: a, summary: u } = o, f = Math.round(r / n * 100);
|
|
2573
2579
|
return /* @__PURE__ */ v("div", { className: "ff-space-y-4", children: [
|
|
2574
2580
|
/* @__PURE__ */ v(
|
|
2575
2581
|
"div",
|
|
@@ -2620,9 +2626,9 @@ const Ue = ({
|
|
|
2620
2626
|
/* @__PURE__ */ g("p", { className: "ff-text-sm", style: { color: "var(--ff-warning)" }, children: "Warnings" })
|
|
2621
2627
|
] })
|
|
2622
2628
|
] }),
|
|
2623
|
-
e &&
|
|
2629
|
+
e && u.byColumn && Object.keys(u.byColumn).length > 0 && /* @__PURE__ */ v("div", { className: "ff-border ff-rounded-xl ff-overflow-hidden", style: { backgroundColor: "var(--ff-bg-primary)", borderColor: "var(--ff-border-light)" }, children: [
|
|
2624
2630
|
/* @__PURE__ */ g("div", { className: "ff-px-4 ff-py-3", style: { backgroundColor: "var(--ff-bg-secondary)" }, children: /* @__PURE__ */ g("h4", { className: "ff-font-medium ff-text-sm", style: { color: "var(--ff-text-secondary)" }, children: "Issues by Column" }) }),
|
|
2625
|
-
/* @__PURE__ */ g("div", { children: Object.entries(
|
|
2631
|
+
/* @__PURE__ */ g("div", { children: Object.entries(u.byColumn).filter(([, p]) => p.errorCount > 0 || p.warningCount > 0).map(([p, c], d, s) => /* @__PURE__ */ v(
|
|
2626
2632
|
"div",
|
|
2627
2633
|
{
|
|
2628
2634
|
className: "ff-flex ff-items-center ff-justify-between ff-px-4 ff-py-3",
|
|
@@ -2653,12 +2659,12 @@ const Ue = ({
|
|
|
2653
2659
|
p
|
|
2654
2660
|
)) })
|
|
2655
2661
|
] }),
|
|
2656
|
-
e &&
|
|
2662
|
+
e && u.duplicates && u.duplicates.length > 0 && /* @__PURE__ */ g("div", { className: "ff-border ff-rounded-lg ff-p-4", style: { backgroundColor: "var(--ff-warning-light)", borderColor: "var(--ff-warning)" }, children: /* @__PURE__ */ v("div", { className: "ff-flex ff-items-start ff-gap-3", children: [
|
|
2657
2663
|
/* @__PURE__ */ g(Re, { className: "ff-w-5 ff-h-5 ff-flex-shrink-0 ff-mt-0.5", style: { color: "var(--ff-warning)" } }),
|
|
2658
2664
|
/* @__PURE__ */ v("div", { children: [
|
|
2659
2665
|
/* @__PURE__ */ g("h4", { className: "ff-font-medium", style: { color: "var(--ff-warning-dark)" }, children: "Duplicate Values Found" }),
|
|
2660
2666
|
/* @__PURE__ */ v("ul", { className: "ff-mt-2 ff-space-y-1 ff-text-sm", style: { color: "var(--ff-warning-dark)" }, children: [
|
|
2661
|
-
|
|
2667
|
+
u.duplicates.slice(0, 5).map((p, c) => /* @__PURE__ */ v("li", { children: [
|
|
2662
2668
|
/* @__PURE__ */ g("span", { className: "ff-font-mono", children: p.columnKey }),
|
|
2663
2669
|
': "',
|
|
2664
2670
|
String(p.value),
|
|
@@ -2671,9 +2677,9 @@ const Ue = ({
|
|
|
2671
2677
|
p.rowIndices.length > 3 ? "..." : "",
|
|
2672
2678
|
")"
|
|
2673
2679
|
] }, c)),
|
|
2674
|
-
|
|
2680
|
+
u.duplicates.length > 5 && /* @__PURE__ */ v("li", { style: { color: "var(--ff-warning)" }, children: [
|
|
2675
2681
|
"... and ",
|
|
2676
|
-
|
|
2682
|
+
u.duplicates.length - 5,
|
|
2677
2683
|
" more duplicate groups"
|
|
2678
2684
|
] })
|
|
2679
2685
|
] })
|
|
@@ -2694,75 +2700,75 @@ const Ue = ({
|
|
|
2694
2700
|
useShadowDom: r = !1,
|
|
2695
2701
|
onComplete: l,
|
|
2696
2702
|
onCancel: i,
|
|
2697
|
-
onError:
|
|
2703
|
+
onError: a
|
|
2698
2704
|
}) => {
|
|
2699
2705
|
const {
|
|
2700
|
-
step:
|
|
2706
|
+
step: u,
|
|
2701
2707
|
sessionId: f,
|
|
2702
2708
|
file: p,
|
|
2703
2709
|
mappings: c,
|
|
2704
2710
|
validationResults: d,
|
|
2705
|
-
isLoading:
|
|
2711
|
+
isLoading: s,
|
|
2706
2712
|
error: m,
|
|
2707
2713
|
setSchema: h,
|
|
2708
2714
|
setSessionId: w,
|
|
2709
|
-
setParsedData:
|
|
2710
|
-
setMappings:
|
|
2711
|
-
setUnmapped:
|
|
2715
|
+
setParsedData: C,
|
|
2716
|
+
setMappings: x,
|
|
2717
|
+
setUnmapped: F,
|
|
2712
2718
|
setValidationResults: E,
|
|
2713
2719
|
setStep: I,
|
|
2714
2720
|
nextStep: D,
|
|
2715
2721
|
previousStep: K,
|
|
2716
2722
|
setLoading: N,
|
|
2717
|
-
setError:
|
|
2723
|
+
setError: H,
|
|
2718
2724
|
reset: T
|
|
2719
|
-
} = J(), [O,
|
|
2725
|
+
} = J(), [O, z] = Y(null), [y, _] = Y(null);
|
|
2720
2726
|
Ae(() => {
|
|
2721
|
-
if (
|
|
2727
|
+
if (_(null), e)
|
|
2722
2728
|
if (ct(e)) {
|
|
2723
|
-
const
|
|
2724
|
-
|
|
2729
|
+
const $ = pt(e);
|
|
2730
|
+
$ ? z($) : (_(`Failed to load template "${e}"`), a == null || a(new Error(`Failed to load template "${e}"`)));
|
|
2725
2731
|
} else {
|
|
2726
|
-
const
|
|
2727
|
-
|
|
2732
|
+
const $ = `Template "${e}" not found. Available templates: ${Oe.join(", ")}`;
|
|
2733
|
+
_($), a == null || a(new Error($));
|
|
2728
2734
|
}
|
|
2729
2735
|
else if (o)
|
|
2730
|
-
|
|
2736
|
+
z(o);
|
|
2731
2737
|
else {
|
|
2732
|
-
const
|
|
2733
|
-
|
|
2738
|
+
const $ = `No template or schema provided. Please specify a template (${Oe.join(", ")}) or provide a custom schema.`;
|
|
2739
|
+
_($), a == null || a(new Error($));
|
|
2734
2740
|
}
|
|
2735
|
-
}, [e, o,
|
|
2741
|
+
}, [e, o, a]), Ae(() => {
|
|
2736
2742
|
O && (h(O), V(O));
|
|
2737
2743
|
}, [O]);
|
|
2738
|
-
const V = async (
|
|
2744
|
+
const V = async ($) => {
|
|
2739
2745
|
try {
|
|
2740
2746
|
N(!0);
|
|
2741
|
-
const b = await ee().createImportSession(
|
|
2747
|
+
const b = await ee().createImportSession($);
|
|
2742
2748
|
w(b.sessionId);
|
|
2743
2749
|
} catch (M) {
|
|
2744
2750
|
const b = M;
|
|
2745
|
-
|
|
2751
|
+
H(b.message), a == null || a(b);
|
|
2746
2752
|
} finally {
|
|
2747
2753
|
N(!1);
|
|
2748
2754
|
}
|
|
2749
|
-
}, W = Me(async (
|
|
2755
|
+
}, W = Me(async ($) => {
|
|
2750
2756
|
if (f)
|
|
2751
2757
|
try {
|
|
2752
|
-
N(!0),
|
|
2753
|
-
const b = await ee().uploadFile(f,
|
|
2758
|
+
N(!0), H(null);
|
|
2759
|
+
const b = await ee().uploadFile(f, $), ze = (Q, at) => ({
|
|
2754
2760
|
rowIndex: Q.rowIndex ?? at,
|
|
2755
2761
|
data: Q.data ?? Q,
|
|
2756
2762
|
rawData: Q.rawData ?? Object.values(Q.data ?? Q)
|
|
2757
2763
|
});
|
|
2758
|
-
|
|
2764
|
+
C({
|
|
2759
2765
|
headers: b.data.headers,
|
|
2760
|
-
rows: b.data.sampleRows.map(
|
|
2766
|
+
rows: b.data.sampleRows.map(ze),
|
|
2761
2767
|
totalRows: b.data.totalRows,
|
|
2762
|
-
sampleRows: b.data.sampleRows.map(
|
|
2768
|
+
sampleRows: b.data.sampleRows.map(ze)
|
|
2763
2769
|
}), D(), await k();
|
|
2764
2770
|
} catch (M) {
|
|
2765
|
-
|
|
2771
|
+
H(`Failed to process the uploaded file: ${M.message}`);
|
|
2766
2772
|
} finally {
|
|
2767
2773
|
N(!1);
|
|
2768
2774
|
}
|
|
@@ -2771,45 +2777,45 @@ const Ue = ({
|
|
|
2771
2777
|
try {
|
|
2772
2778
|
N(!0);
|
|
2773
2779
|
const M = await ee().matchColumns(f);
|
|
2774
|
-
|
|
2775
|
-
} catch (
|
|
2776
|
-
|
|
2780
|
+
x(M.mappings), F(M.unmappedSource, M.unmappedTarget);
|
|
2781
|
+
} catch ($) {
|
|
2782
|
+
H(`Column matching failed: ${$.message}`);
|
|
2777
2783
|
} finally {
|
|
2778
2784
|
N(!1);
|
|
2779
2785
|
}
|
|
2780
2786
|
}, ke = async () => {
|
|
2781
2787
|
if (f)
|
|
2782
2788
|
try {
|
|
2783
|
-
N(!0),
|
|
2789
|
+
N(!0), H(null);
|
|
2784
2790
|
const M = await ee().validateImport(f);
|
|
2785
2791
|
E(M.validation), D();
|
|
2786
|
-
} catch (
|
|
2787
|
-
|
|
2792
|
+
} catch ($) {
|
|
2793
|
+
H(`Validation failed: ${$.message}`);
|
|
2788
2794
|
} finally {
|
|
2789
2795
|
N(!1);
|
|
2790
2796
|
}
|
|
2791
2797
|
}, [X, ue] = Y(null), rt = async () => {
|
|
2792
2798
|
if (f)
|
|
2793
2799
|
try {
|
|
2794
|
-
N(!0),
|
|
2800
|
+
N(!0), H(null), ue(null);
|
|
2795
2801
|
const M = await ee().completeImport(f, {
|
|
2796
2802
|
skipInvalidRows: !0,
|
|
2797
2803
|
acknowledgeWarnings: !0
|
|
2798
2804
|
});
|
|
2799
2805
|
I("complete"), l == null || l(M);
|
|
2800
|
-
} catch (
|
|
2801
|
-
ue(
|
|
2806
|
+
} catch ($) {
|
|
2807
|
+
ue($.message), I("complete");
|
|
2802
2808
|
} finally {
|
|
2803
2809
|
N(!1);
|
|
2804
2810
|
}
|
|
2805
2811
|
}, fe = () => {
|
|
2806
2812
|
T(), i == null || i();
|
|
2807
|
-
}, lt = () => An.findIndex((
|
|
2808
|
-
switch (
|
|
2813
|
+
}, lt = () => An.findIndex(($) => $.key === u), it = () => {
|
|
2814
|
+
switch (u) {
|
|
2809
2815
|
case "upload":
|
|
2810
2816
|
return p !== null;
|
|
2811
2817
|
case "mapping":
|
|
2812
|
-
return c.length > 0 && c.some((
|
|
2818
|
+
return c.length > 0 && c.some(($) => $.targetKey !== null);
|
|
2813
2819
|
case "validation":
|
|
2814
2820
|
return d !== null;
|
|
2815
2821
|
case "review":
|
|
@@ -2818,7 +2824,7 @@ const Ue = ({
|
|
|
2818
2824
|
return !1;
|
|
2819
2825
|
}
|
|
2820
2826
|
}, st = async () => {
|
|
2821
|
-
switch (
|
|
2827
|
+
switch (u) {
|
|
2822
2828
|
case "mapping":
|
|
2823
2829
|
await ke();
|
|
2824
2830
|
break;
|
|
@@ -2845,8 +2851,8 @@ const Ue = ({
|
|
|
2845
2851
|
/* @__PURE__ */ g("p", { style: { color: "var(--ff-text-muted)" }, children: "Loading template..." })
|
|
2846
2852
|
] }) }) });
|
|
2847
2853
|
const Z = () => {
|
|
2848
|
-
const
|
|
2849
|
-
return Ce.indexOf(
|
|
2854
|
+
const $ = u === "review" ? "validation" : u;
|
|
2855
|
+
return Ce.indexOf($);
|
|
2850
2856
|
}, Le = /* @__PURE__ */ g(oe, { children: /* @__PURE__ */ v("div", { className: t === "embed" ? "ff-container ff-embed" : "ff-container ff-modal", children: [
|
|
2851
2857
|
/* @__PURE__ */ v("div", { className: "ff-modal-header", children: [
|
|
2852
2858
|
/* @__PURE__ */ v("div", { className: "ff-modal-header-left", children: [
|
|
@@ -2854,7 +2860,7 @@ const Ue = ({
|
|
|
2854
2860
|
/* @__PURE__ */ g("div", { className: "ff-modal-icon", children: /* @__PURE__ */ g($t, {}) }),
|
|
2855
2861
|
/* @__PURE__ */ g("h2", { className: "ff-modal-title", children: "Import Data" })
|
|
2856
2862
|
] }),
|
|
2857
|
-
/* @__PURE__ */ g("div", { className: "ff-steps ff-ml-4", children: Ce.map((
|
|
2863
|
+
/* @__PURE__ */ g("div", { className: "ff-steps ff-ml-4", children: Ce.map(($, M) => /* @__PURE__ */ v(ut.Fragment, { children: [
|
|
2858
2864
|
/* @__PURE__ */ g(
|
|
2859
2865
|
"div",
|
|
2860
2866
|
{
|
|
@@ -2871,7 +2877,7 @@ const Ue = ({
|
|
|
2871
2877
|
"ff-step-connector",
|
|
2872
2878
|
Z() > M && "ff-step-connector-complete"
|
|
2873
2879
|
) })
|
|
2874
|
-
] },
|
|
2880
|
+
] }, $)) })
|
|
2875
2881
|
] }),
|
|
2876
2882
|
/* @__PURE__ */ g(
|
|
2877
2883
|
"button",
|
|
@@ -2884,17 +2890,17 @@ const Ue = ({
|
|
|
2884
2890
|
] }),
|
|
2885
2891
|
/* @__PURE__ */ v("div", { className: "ff-modal-body", children: [
|
|
2886
2892
|
m && /* @__PURE__ */ g("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 }),
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2893
|
+
u === "upload" && /* @__PURE__ */ g("div", { className: "ff-py-4", children: /* @__PURE__ */ g("div", { className: "ff-max-w-xl ff-mx-auto", children: /* @__PURE__ */ g(Ht, { onFileSelect: W }) }) }),
|
|
2894
|
+
u === "mapping" && /* @__PURE__ */ g(At, {}),
|
|
2895
|
+
u === "validation" && /* @__PURE__ */ v("div", { className: "ff-space-y-6", children: [
|
|
2890
2896
|
/* @__PURE__ */ g(Ke, {}),
|
|
2891
2897
|
/* @__PURE__ */ g(Ue, { editable: !0 })
|
|
2892
2898
|
] }),
|
|
2893
|
-
|
|
2899
|
+
u === "review" && /* @__PURE__ */ v("div", { className: "ff-space-y-6", children: [
|
|
2894
2900
|
/* @__PURE__ */ g(Ke, { showDetails: !1 }),
|
|
2895
2901
|
/* @__PURE__ */ g(Ue, { editable: !1, pageSize: 10 })
|
|
2896
2902
|
] }),
|
|
2897
|
-
|
|
2903
|
+
u === "complete" && /* @__PURE__ */ g("div", { className: "ff-flex ff-flex-col ff-items-center ff-justify-center ff-py-12", children: X ? /* @__PURE__ */ v(oe, { children: [
|
|
2898
2904
|
/* @__PURE__ */ g("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__ */ g(se, { className: "ff-w-10 ff-h-10", style: { color: "var(--ff-error)" } }) }),
|
|
2899
2905
|
/* @__PURE__ */ g("h3", { className: "ff-text-xl ff-font-semibold ff-mb-2", style: { color: "var(--ff-text-primary)" }, children: "Import Failed" }),
|
|
2900
2906
|
/* @__PURE__ */ g("p", { className: "ff-text-center ff-max-w-md ff-mb-4", style: { color: "var(--ff-text-muted)" }, children: X }),
|
|
@@ -2917,12 +2923,12 @@ const Ue = ({
|
|
|
2917
2923
|
/* @__PURE__ */ g("p", { style: { color: "var(--ff-text-muted)" }, children: "Your data has been successfully imported." })
|
|
2918
2924
|
] }) })
|
|
2919
2925
|
] }),
|
|
2920
|
-
|
|
2926
|
+
u !== "complete" && /* @__PURE__ */ v("div", { className: "ff-modal-footer", children: [
|
|
2921
2927
|
/* @__PURE__ */ g(
|
|
2922
2928
|
"button",
|
|
2923
2929
|
{
|
|
2924
2930
|
onClick: K,
|
|
2925
|
-
disabled: lt() === 0 ||
|
|
2931
|
+
disabled: lt() === 0 || s,
|
|
2926
2932
|
className: "ff-btn ff-btn-secondary",
|
|
2927
2933
|
children: "Back"
|
|
2928
2934
|
}
|
|
@@ -2931,12 +2937,12 @@ const Ue = ({
|
|
|
2931
2937
|
"button",
|
|
2932
2938
|
{
|
|
2933
2939
|
onClick: st,
|
|
2934
|
-
disabled: !it() ||
|
|
2940
|
+
disabled: !it() || s,
|
|
2935
2941
|
className: "ff-btn ff-btn-primary",
|
|
2936
|
-
children:
|
|
2942
|
+
children: s ? /* @__PURE__ */ v(oe, { children: [
|
|
2937
2943
|
/* @__PURE__ */ g(be, { className: "ff-w-4 ff-h-4 ff-animate-spin" }),
|
|
2938
2944
|
"Processing..."
|
|
2939
|
-
] }) :
|
|
2945
|
+
] }) : u === "review" ? "Complete Import" : "Continue"
|
|
2940
2946
|
}
|
|
2941
2947
|
)
|
|
2942
2948
|
] })
|
|
@@ -2946,9 +2952,9 @@ const Ue = ({
|
|
|
2946
2952
|
export {
|
|
2947
2953
|
At as C,
|
|
2948
2954
|
Ue as D,
|
|
2949
|
-
|
|
2955
|
+
Ht as F,
|
|
2950
2956
|
Tn as I,
|
|
2951
2957
|
Ke as V,
|
|
2952
2958
|
J as u
|
|
2953
2959
|
};
|
|
2954
|
-
//# sourceMappingURL=ImportWizard-
|
|
2960
|
+
//# sourceMappingURL=ImportWizard-wQRSiaEP.mjs.map
|