@jielga/tmdatagrid 2.0.0-beta.5 → 2.0.0-beta.7
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/index.d.ts +231 -95
- package/dist/index.js +1093 -979
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/skills/appearance/SKILL.md +1 -1
- package/skills/cell-selection/SKILL.md +1 -1
- package/skills/columns/SKILL.md +43 -1
- package/skills/data/SKILL.md +14 -10
- package/skills/editing/SKILL.md +102 -29
- package/skills/editing/references/common-mistakes.md +91 -2
- package/skills/editing/references/editing-api.md +12 -3
- package/skills/editing/references/editors-and-validation.md +64 -13
- package/skills/filtering/SKILL.md +1 -1
- package/skills/getting-started/SKILL.md +1 -1
- package/skills/grouping/SKILL.md +5 -3
- package/skills/options/SKILL.md +1 -1
- package/skills/rows/SKILL.md +7 -3
- package/skills/server-side/SKILL.md +1 -1
- package/skills/testing/SKILL.md +1 -1
- package/src/tmdatagrid/components/TMDataGridDraftActions.tsx +77 -17
- package/src/tmdatagrid/components/TMDataGridEntryRows.tsx +4 -4
- package/src/tmdatagrid/components/TMDataGridTable.tsx +15 -0
- package/src/tmdatagrid/components/TMDataGridToolbar.module.css +4 -0
- package/src/tmdatagrid/components/TMDataGridToolbar.tsx +8 -10
- package/src/tmdatagrid/components/editors/TMDataGridNumberEditor.tsx +34 -4
- package/src/tmdatagrid/core/editEngine.ts +317 -45
- package/src/tmdatagrid/core/summary.ts +10 -2
- package/src/tmdatagrid/index.ts +2 -0
- package/src/tmdatagrid/useTMDataGrid.tsx +39 -0
package/dist/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import { c as e } from "react/compiler-runtime";
|
|
|
2
2
|
import { createContext as t, useCallback as n, useContext as r, useEffect as i, useLayoutEffect as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
3
3
|
import { ActionIcon as l, Autocomplete as u, Button as d, Checkbox as f, Group as p, Input as m, Loader as h, Menu as g, MultiSelect as _, NumberInput as v, Pill as y, Popover as b, RangeSlider as x, ScrollArea as S, SegmentedControl as C, Select as w, Stack as T, Text as E, TextInput as D, Tooltip as O, UnstyledButton as k } from "@mantine/core";
|
|
4
4
|
import { useCreateStore as A, useSelector as j } from "@tanstack/react-store";
|
|
5
|
-
import { IconArrowAutofitWidth as M, IconArrowBackUp as N, IconArrowBarToLeft as P, IconArrowBarToRight as F, IconArrowDown as I, IconArrowLeft as L, IconArrowRight as R, IconArrowUp as z, IconCheck as B, IconChevronLeft as V, IconChevronRight as H, IconColumns3 as ee, IconDotsVertical as
|
|
5
|
+
import { IconArrowAutofitWidth as M, IconArrowBackUp as N, IconArrowBarToLeft as P, IconArrowBarToRight as F, IconArrowDown as I, IconArrowLeft as L, IconArrowRight as R, IconArrowUp as z, IconCheck as B, IconChevronLeft as V, IconChevronRight as H, IconColumns3 as ee, IconDotsVertical as U, IconEyeOff as te, IconFilter as ne, IconFoldDown as re, IconFoldUp as ie, IconIndentDecrease as ae, IconIndentIncrease as oe, IconMenu2 as se, IconPencil as W, IconPinnedOff as G, IconPlus as ce, IconSearch as le, IconTrash as K, IconX as q } from "@tabler/icons-react";
|
|
6
6
|
import { Fragment as ue, jsx as J, jsxs as Y } from "react/jsx-runtime";
|
|
7
7
|
import { FieldApi as de, FormApi as fe, getBy as pe, useStore as me } from "@tanstack/react-form";
|
|
8
8
|
import { Store as he, batch as ge, shallow as _e } from "@tanstack/store";
|
|
9
|
-
import { aggregationFns as ve, columnFacetingFeature as ye, columnFilteringFeature as be, columnGroupingFeature as xe, columnOrderingFeature as Se, columnPinningFeature as Ce, columnResizingFeature as we, columnSizingFeature as Te, columnVisibilityFeature as
|
|
9
|
+
import { aggregationFns as ve, columnFacetingFeature as ye, columnFilteringFeature as be, columnGroupingFeature as xe, columnOrderingFeature as Se, columnPinningFeature as Ce, columnResizingFeature as we, columnSizingFeature as Te, columnVisibilityFeature as Ee, createColumnHelper as X, createExpandedRowModel as Z, createFacetedMinMaxValues as De, createFacetedRowModel as Oe, createFacetedUniqueValues as ke, createFilteredRowModel as Ae, createGroupedRowModel as je, createPaginatedRowModel as Me, createSortedRowModel as Ne, filterFns as Pe, flexRender as Fe, globalFilteringFeature as Ie, metaHelper as Le, rowExpandingFeature as Re, rowPaginationFeature as ze, rowPinningFeature as Be, rowSelectionFeature as Ve, rowSortingFeature as He, sortFns as Ue, tableFeatures as We, useTable as Ge } from "@tanstack/react-table";
|
|
10
10
|
import { compareItems as Ke, rankItem as qe } from "@tanstack/match-sorter-utils";
|
|
11
11
|
import { useVirtualizer as Je } from "@tanstack/react-virtual";
|
|
12
12
|
var Ye = { root: "_root_1wvkg_8" }, Xe = {
|
|
@@ -342,16 +342,19 @@ var $ = {
|
|
|
342
342
|
newRows: [],
|
|
343
343
|
deletedRowIds: []
|
|
344
344
|
};
|
|
345
|
-
function Ft(e
|
|
345
|
+
function Ft(e) {
|
|
346
|
+
return e.openRowIds.filter((t) => !e.committedRowIds.includes(t) && !e.newRows.some((e) => e.tempId === t && e.committed) && (e.newRows.some((e) => e.tempId === t) || (e.rows[t]?.dirtyFields.length ?? 0) > 0));
|
|
347
|
+
}
|
|
348
|
+
function It(e, t) {
|
|
346
349
|
return e === void 0 ? !0 : typeof e == "boolean" ? e : e[t] !== !1;
|
|
347
350
|
}
|
|
348
|
-
function
|
|
351
|
+
function Lt(e) {
|
|
349
352
|
let t = e.columnDef.meta?.edit?.field;
|
|
350
353
|
if (t) return t;
|
|
351
354
|
let n = e.columnDef.accessorKey;
|
|
352
355
|
return typeof n == "string" ? n : null;
|
|
353
356
|
}
|
|
354
|
-
function
|
|
357
|
+
function Rt(e) {
|
|
355
358
|
switch (e) {
|
|
356
359
|
case "string": return "";
|
|
357
360
|
case "multiSelect": return [];
|
|
@@ -359,7 +362,7 @@ function Lt(e) {
|
|
|
359
362
|
default: return null;
|
|
360
363
|
}
|
|
361
364
|
}
|
|
362
|
-
function
|
|
365
|
+
function zt(e) {
|
|
363
366
|
let t = e.state.fieldMeta;
|
|
364
367
|
for (let [n, r] of Object.entries(t)) {
|
|
365
368
|
let t = Object.entries(r.errorSourceMap ?? {}).filter(([, e]) => e === "form").map(([e]) => e);
|
|
@@ -372,18 +375,18 @@ function Rt(e) {
|
|
|
372
375
|
}));
|
|
373
376
|
}
|
|
374
377
|
}
|
|
375
|
-
function
|
|
378
|
+
function Bt(e, t) {
|
|
376
379
|
return Object.is(e, t) ? !0 : Array.isArray(e) && Array.isArray(t) ? e.length === t.length && e.every((e, n) => Object.is(e, t[n])) : e instanceof Date && t instanceof Date && e.getTime() === t.getTime();
|
|
377
380
|
}
|
|
378
|
-
function
|
|
381
|
+
function Vt(e) {
|
|
379
382
|
return e.some((e) => e != null);
|
|
380
383
|
}
|
|
381
|
-
function
|
|
384
|
+
function Ht(e) {
|
|
382
385
|
if (e != null) {
|
|
383
386
|
if (typeof e == "string") return e;
|
|
384
387
|
if (Array.isArray(e)) {
|
|
385
388
|
for (let t of e) {
|
|
386
|
-
let e =
|
|
389
|
+
let e = Ht(t);
|
|
387
390
|
if (e !== void 0) return e;
|
|
388
391
|
}
|
|
389
392
|
return;
|
|
@@ -392,22 +395,22 @@ function Vt(e) {
|
|
|
392
395
|
let t = e.message;
|
|
393
396
|
if (typeof t == "string") return t;
|
|
394
397
|
for (let t of Object.values(e)) {
|
|
395
|
-
let e =
|
|
398
|
+
let e = Ht(t);
|
|
396
399
|
if (e !== void 0) return e;
|
|
397
400
|
}
|
|
398
401
|
}
|
|
399
402
|
}
|
|
400
403
|
}
|
|
401
|
-
var
|
|
404
|
+
var Ut = [
|
|
402
405
|
"onChange",
|
|
403
406
|
"onChangeAsync",
|
|
404
407
|
"onSubmit",
|
|
405
408
|
"onSubmitAsync"
|
|
406
409
|
];
|
|
407
|
-
function
|
|
410
|
+
function Wt(e) {
|
|
408
411
|
return e != null && e !== !1;
|
|
409
412
|
}
|
|
410
|
-
async function
|
|
413
|
+
async function Gt(e, t) {
|
|
411
414
|
if (typeof e == "function") return await e({
|
|
412
415
|
value: t,
|
|
413
416
|
fieldApi: void 0
|
|
@@ -417,58 +420,117 @@ async function Wt(e, t) {
|
|
|
417
420
|
return n === void 0 || n.length === 0 ? void 0 : n[0]?.message ?? "Invalid";
|
|
418
421
|
}
|
|
419
422
|
}
|
|
420
|
-
function
|
|
421
|
-
let t = new he(Pt), n = /* @__PURE__ */ new Map(), r = 0, i = !1, a = null, o = null, s = (
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
423
|
+
function Kt(e) {
|
|
424
|
+
let t = new he(Pt), n = /* @__PURE__ */ new Map(), r = 0, i = !1, a = null, o = null, s = (t) => {
|
|
425
|
+
if (On(t.id) || Lt(t) === null) return !1;
|
|
426
|
+
let n = e().editableColumnIds;
|
|
427
|
+
return n !== void 0 && !n.includes(t.id) ? !1 : !Tn(t);
|
|
428
|
+
}, c = () => e().table.getAllLeafColumns().filter(s), l = async (e, t, n) => {
|
|
429
|
+
let r = n ? void 0 : w(t), i = {};
|
|
430
|
+
for (let t of c()) {
|
|
431
|
+
if (r !== void 0 && !En(t, r)) continue;
|
|
432
|
+
let n = Lt(t);
|
|
426
433
|
if (n === null) continue;
|
|
427
|
-
let a =
|
|
434
|
+
let a = qt(t.columnDef.meta?.edit?.validate);
|
|
428
435
|
if (a === void 0) continue;
|
|
429
436
|
let o = pe(e, n);
|
|
430
|
-
for (let e of
|
|
437
|
+
for (let e of Ut) {
|
|
431
438
|
let t = a[e];
|
|
432
439
|
if (t === void 0) continue;
|
|
433
|
-
let r = await
|
|
434
|
-
if (
|
|
440
|
+
let r = await Gt(t, o);
|
|
441
|
+
if (Wt(r)) {
|
|
435
442
|
i[n] = r;
|
|
436
443
|
break;
|
|
437
444
|
}
|
|
438
445
|
}
|
|
439
446
|
}
|
|
440
447
|
return Object.keys(i).length > 0 ? i : void 0;
|
|
441
|
-
},
|
|
448
|
+
}, u = (r, i, a) => {
|
|
449
|
+
let o = new Set(t.state.deletedRowIds), s = [];
|
|
450
|
+
for (let t of e().table.getCoreRowModel().flatRows) {
|
|
451
|
+
if (o.has(t.id)) continue;
|
|
452
|
+
if (t.id === r) {
|
|
453
|
+
s.push({
|
|
454
|
+
rowId: r,
|
|
455
|
+
value: i
|
|
456
|
+
});
|
|
457
|
+
continue;
|
|
458
|
+
}
|
|
459
|
+
let e = n.get(t.id);
|
|
460
|
+
s.push({
|
|
461
|
+
rowId: t.id,
|
|
462
|
+
value: e === void 0 ? t.original : e.form.state.values
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
for (let e of t.state.newRows) {
|
|
466
|
+
if (e.tempId === r) continue;
|
|
467
|
+
let t = n.get(e.tempId);
|
|
468
|
+
t === void 0 || o.has(e.tempId) || s.push({
|
|
469
|
+
rowId: e.tempId,
|
|
470
|
+
value: t.form.state.values
|
|
471
|
+
});
|
|
472
|
+
}
|
|
473
|
+
return a && s.push({
|
|
474
|
+
rowId: r,
|
|
475
|
+
value: i
|
|
476
|
+
}), s;
|
|
477
|
+
}, d = async (t, n, r) => {
|
|
478
|
+
let i = e().tableValidators;
|
|
479
|
+
if (i?.onSubmit === void 0 && i?.onSubmitAsync === void 0) return;
|
|
480
|
+
let a = {
|
|
481
|
+
value: t,
|
|
482
|
+
rowId: n,
|
|
483
|
+
isNew: r,
|
|
484
|
+
rows: u(n, t, r)
|
|
485
|
+
}, o = i.onSubmit?.(a);
|
|
486
|
+
return Wt(o) ? o : await i.onSubmitAsync?.(a);
|
|
487
|
+
}, f = (e, t) => {
|
|
488
|
+
let n = e.filter(Wt);
|
|
489
|
+
if (n.length === 0) return t === void 0 ? void 0 : { fields: t };
|
|
490
|
+
if (n.length === 1) {
|
|
491
|
+
let e = n[0];
|
|
492
|
+
if (t === void 0) return e;
|
|
493
|
+
if (typeof e == "object" && e) {
|
|
494
|
+
let n = e;
|
|
495
|
+
return {
|
|
496
|
+
...n,
|
|
497
|
+
fields: {
|
|
498
|
+
...t,
|
|
499
|
+
...n.fields ?? {}
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
return {
|
|
504
|
+
form: e,
|
|
505
|
+
fields: t
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
let r, i = { ...t ?? {} };
|
|
509
|
+
for (let e of n) if (typeof e == "object" && e) {
|
|
510
|
+
let t = e;
|
|
511
|
+
Wt(t.form) && (r = t.form), i = {
|
|
512
|
+
...i,
|
|
513
|
+
...t.fields ?? {}
|
|
514
|
+
};
|
|
515
|
+
} else r = e;
|
|
516
|
+
let a = {};
|
|
517
|
+
return r !== void 0 && (a.form = r), Object.keys(i).length > 0 && (a.fields = i), a;
|
|
518
|
+
}, p = (t, n) => {
|
|
442
519
|
let r = e().rowValidators ?? {}, i = r.onSubmitAsync;
|
|
443
520
|
return {
|
|
444
521
|
...r,
|
|
445
522
|
onSubmitAsync: async (e) => {
|
|
446
|
-
let r = i === void 0 ? void 0 : await i(e),
|
|
447
|
-
|
|
448
|
-
if (!Ut(r)) return { fields: a };
|
|
449
|
-
if (typeof r == "object" && r) {
|
|
450
|
-
let e = r;
|
|
451
|
-
return {
|
|
452
|
-
...e,
|
|
453
|
-
fields: {
|
|
454
|
-
...a,
|
|
455
|
-
...e.fields ?? {}
|
|
456
|
-
}
|
|
457
|
-
};
|
|
458
|
-
}
|
|
459
|
-
return {
|
|
460
|
-
form: r,
|
|
461
|
-
fields: a
|
|
462
|
-
};
|
|
523
|
+
let r = e.value, a = i === void 0 ? void 0 : await i(e), o = await d(r, t, n), s = await l(r, t, n);
|
|
524
|
+
return f([o, a], s);
|
|
463
525
|
}
|
|
464
526
|
};
|
|
465
|
-
},
|
|
527
|
+
}, m = (e, t) => {
|
|
466
528
|
let n = [];
|
|
467
|
-
for (let r of
|
|
468
|
-
let i =
|
|
529
|
+
for (let r of c()) {
|
|
530
|
+
let i = Lt(r);
|
|
469
531
|
if (i === null) continue;
|
|
470
532
|
let a = pe(e.original, i), o = pe(t, i);
|
|
471
|
-
|
|
533
|
+
Bt(a, o) || n.push({
|
|
472
534
|
columnId: r.id,
|
|
473
535
|
field: i,
|
|
474
536
|
previous: a,
|
|
@@ -476,42 +538,42 @@ function Gt(e) {
|
|
|
476
538
|
});
|
|
477
539
|
}
|
|
478
540
|
return n;
|
|
479
|
-
},
|
|
541
|
+
}, h = (e) => {
|
|
480
542
|
let t = e.form.state, n = t.values, r = Object.entries(t.fieldMeta).flatMap(([e, t]) => {
|
|
481
543
|
if (e === "") return [];
|
|
482
544
|
let n = t.errors;
|
|
483
|
-
return
|
|
545
|
+
return Vt(n) ? [{
|
|
484
546
|
field: e,
|
|
485
|
-
message:
|
|
547
|
+
message: Ht(n) ?? ""
|
|
486
548
|
}] : [];
|
|
487
|
-
}), i = e.submitErrors.filter((e) => !r.some((t) => t.field === e.field) &&
|
|
549
|
+
}), i = e.submitErrors.filter((e) => !r.some((t) => t.field === e.field) && Bt(pe(n, e.field), e.value)), a = [...r, ...i.map(({ field: e, message: t }) => ({
|
|
488
550
|
field: e,
|
|
489
551
|
message: t
|
|
490
552
|
}))];
|
|
491
553
|
return {
|
|
492
|
-
dirtyFields:
|
|
554
|
+
dirtyFields: m(e, n).map((e) => e.field),
|
|
493
555
|
errorFields: a.map((e) => e.field),
|
|
494
556
|
errorMessages: a,
|
|
495
|
-
hasRowError:
|
|
557
|
+
hasRowError: Vt(t.errors),
|
|
496
558
|
isSubmitting: t.isSubmitting,
|
|
497
559
|
values: n
|
|
498
560
|
};
|
|
499
|
-
},
|
|
561
|
+
}, g = (e) => {
|
|
500
562
|
let r = n.get(e);
|
|
501
563
|
t.setState((t) => {
|
|
502
564
|
let i = { ...t.rows };
|
|
503
|
-
return r === void 0 ? delete i[e] : i[e] =
|
|
565
|
+
return r === void 0 ? delete i[e] : i[e] = h(r), {
|
|
504
566
|
...t,
|
|
505
567
|
rows: i,
|
|
506
568
|
openRowIds: [...n.keys()]
|
|
507
569
|
};
|
|
508
570
|
});
|
|
509
|
-
},
|
|
571
|
+
}, _ = (e) => {
|
|
510
572
|
t.setState((t) => ({
|
|
511
573
|
...t,
|
|
512
574
|
active: e
|
|
513
575
|
}));
|
|
514
|
-
},
|
|
576
|
+
}, v = (e, n) => {
|
|
515
577
|
t.setState((t) => {
|
|
516
578
|
let r = t.newRows.find((t) => t.tempId === e);
|
|
517
579
|
return r === void 0 || r.committed === n ? t : {
|
|
@@ -522,13 +584,13 @@ function Gt(e) {
|
|
|
522
584
|
} : t)
|
|
523
585
|
};
|
|
524
586
|
});
|
|
525
|
-
},
|
|
587
|
+
}, y = (e, r) => {
|
|
526
588
|
let i = n.get(e);
|
|
527
589
|
i !== void 0 && (i.committed = r), t.setState((t) => t.committedRowIds.includes(e) === r ? t : {
|
|
528
590
|
...t,
|
|
529
591
|
committedRowIds: r ? [...t.committedRowIds, e] : t.committedRowIds.filter((t) => t !== e)
|
|
530
592
|
});
|
|
531
|
-
},
|
|
593
|
+
}, b = (e) => {
|
|
532
594
|
let r = n.get(e);
|
|
533
595
|
r !== void 0 && (r.unsubscribe(), r.unmount(), n.delete(e), t.setState((t) => {
|
|
534
596
|
let i = { ...t.rows };
|
|
@@ -541,7 +603,7 @@ function Gt(e) {
|
|
|
541
603
|
active: t.active?.rowId === e ? null : t.active
|
|
542
604
|
};
|
|
543
605
|
}));
|
|
544
|
-
},
|
|
606
|
+
}, x = (t, r, i) => {
|
|
545
607
|
let s = {
|
|
546
608
|
original: r,
|
|
547
609
|
isNew: i,
|
|
@@ -554,7 +616,7 @@ function Gt(e) {
|
|
|
554
616
|
unmount: () => {},
|
|
555
617
|
form: new fe({
|
|
556
618
|
defaultValues: r,
|
|
557
|
-
validators:
|
|
619
|
+
validators: p(t, i),
|
|
558
620
|
onSubmit: async ({ value: n }) => {
|
|
559
621
|
if (s.isNew) {
|
|
560
622
|
let r = {
|
|
@@ -580,7 +642,7 @@ function Gt(e) {
|
|
|
580
642
|
rowId: t,
|
|
581
643
|
value: n,
|
|
582
644
|
original: r,
|
|
583
|
-
changes:
|
|
645
|
+
changes: m(s, n),
|
|
584
646
|
source: e().editMode
|
|
585
647
|
};
|
|
586
648
|
if (a !== null) {
|
|
@@ -600,62 +662,62 @@ function Gt(e) {
|
|
|
600
662
|
})
|
|
601
663
|
};
|
|
602
664
|
s.unmount = s.form.mount();
|
|
603
|
-
let c = s.form.store.subscribe(() =>
|
|
604
|
-
return s.unsubscribe = () => c.unsubscribe(), n.set(t, s),
|
|
605
|
-
},
|
|
665
|
+
let c = s.form.store.subscribe(() => g(t));
|
|
666
|
+
return s.unsubscribe = () => c.unsubscribe(), n.set(t, s), g(t), s;
|
|
667
|
+
}, S = (t) => !t.getIsGrouped() && e().isRowEditable?.(t) !== !1, C = (t, n) => {
|
|
606
668
|
let r = e();
|
|
607
|
-
return !(t.getIsGrouped() ||
|
|
608
|
-
},
|
|
669
|
+
return !(t.getIsGrouped() || !s(n) || !En(n, t) || r.isRowEditable !== void 0 && !r.isRowEditable(t));
|
|
670
|
+
}, w = (t) => {
|
|
609
671
|
try {
|
|
610
672
|
return e().table.getRow(t);
|
|
611
673
|
} catch {
|
|
612
674
|
return;
|
|
613
675
|
}
|
|
614
|
-
},
|
|
676
|
+
}, T = (e) => {
|
|
615
677
|
let t = e.form.state.values;
|
|
616
678
|
return Object.entries(e.form.state.fieldMeta).flatMap(([e, n]) => {
|
|
617
679
|
if (e === "") return [];
|
|
618
|
-
let r = n.errors, i =
|
|
680
|
+
let r = n.errors, i = Vt(r) ? Ht(r) : void 0;
|
|
619
681
|
return i === void 0 ? [] : [{
|
|
620
682
|
field: e,
|
|
621
683
|
value: pe(t, e),
|
|
622
684
|
message: i
|
|
623
685
|
}];
|
|
624
686
|
});
|
|
625
|
-
},
|
|
687
|
+
}, E = async (r) => {
|
|
626
688
|
let a = n.get(r);
|
|
627
|
-
return a === void 0 ? !0 : a.pendingCommit === null ? !a.isNew &&
|
|
689
|
+
return a === void 0 ? !0 : a.pendingCommit === null ? !a.isNew && m(a, a.form.state.values).length === 0 ? (b(r), !0) : (zt(a.form), a.lastSubmitOk = !1, a.submitErrors = [], a.parkOnly = e().draft && !i, a.pendingCommit = (async () => {
|
|
628
690
|
try {
|
|
629
691
|
await a.form.handleSubmit();
|
|
630
692
|
} finally {
|
|
631
693
|
a.pendingCommit = null;
|
|
632
694
|
}
|
|
633
|
-
return a.lastSubmitOk ? a.parkOnly ? (a.committed = !0, a.isNew ?
|
|
695
|
+
return a.lastSubmitOk ? a.parkOnly ? (a.committed = !0, a.isNew ? v(r, !0) : y(r, !0), t.setState((e) => e.active?.rowId === r ? {
|
|
634
696
|
...e,
|
|
635
697
|
active: null
|
|
636
|
-
} : e), !0) : (
|
|
698
|
+
} : e), !0) : (b(r), !0) : (a.submitErrors = T(a), g(r), !1);
|
|
637
699
|
})(), a.pendingCommit) : a.pendingCommit;
|
|
638
|
-
},
|
|
700
|
+
}, D = (t, r) => {
|
|
639
701
|
let i = n.get(t);
|
|
640
702
|
if (i?.isNew === !0) {
|
|
641
|
-
i.committed = !1,
|
|
703
|
+
i.committed = !1, v(t, !1), _({
|
|
642
704
|
rowId: t,
|
|
643
705
|
columnId: r
|
|
644
706
|
});
|
|
645
707
|
return;
|
|
646
708
|
}
|
|
647
|
-
let a =
|
|
709
|
+
let a = w(t);
|
|
648
710
|
if (a !== void 0) {
|
|
649
711
|
if (r !== null) {
|
|
650
712
|
let t = e().table.getColumn(r);
|
|
651
|
-
if (t === void 0 || !
|
|
713
|
+
if (t === void 0 || !C(a, t)) return;
|
|
652
714
|
} else if (e().isRowEditable?.(a) === !1) return;
|
|
653
|
-
n.has(t) ? n.get(t)?.committed === !0 &&
|
|
715
|
+
n.has(t) ? n.get(t)?.committed === !0 && y(t, !1) : x(t, a.original, !1), _({
|
|
654
716
|
rowId: t,
|
|
655
717
|
columnId: r
|
|
656
718
|
});
|
|
657
719
|
}
|
|
658
|
-
},
|
|
720
|
+
}, O = ({ rowId: t, columnId: r }) => {
|
|
659
721
|
let { editMode: i } = e();
|
|
660
722
|
if (i === "cell") {
|
|
661
723
|
let e = [...n.keys()].find((e) => {
|
|
@@ -663,48 +725,48 @@ function Gt(e) {
|
|
|
663
725
|
return e !== t && r?.committed !== !0 && r?.isNew !== !0;
|
|
664
726
|
});
|
|
665
727
|
if (e !== void 0) {
|
|
666
|
-
|
|
667
|
-
e &&
|
|
728
|
+
E(e).then((e) => {
|
|
729
|
+
e && D(t, r);
|
|
668
730
|
});
|
|
669
731
|
return;
|
|
670
732
|
}
|
|
671
733
|
}
|
|
672
|
-
|
|
673
|
-
},
|
|
674
|
-
|
|
675
|
-
},
|
|
676
|
-
|
|
677
|
-
},
|
|
678
|
-
for (let e of [...n.keys()])
|
|
734
|
+
D(t, r);
|
|
735
|
+
}, k = (e) => {
|
|
736
|
+
b(e);
|
|
737
|
+
}, A = () => {
|
|
738
|
+
_(null);
|
|
739
|
+
}, j = () => {
|
|
740
|
+
for (let e of [...n.keys()]) b(e);
|
|
679
741
|
t.setState((e) => ({
|
|
680
742
|
...e,
|
|
681
743
|
active: null,
|
|
682
744
|
committedRowIds: [],
|
|
683
745
|
deletedRowIds: []
|
|
684
746
|
}));
|
|
685
|
-
},
|
|
747
|
+
}, M = (e) => {
|
|
686
748
|
r += 1;
|
|
687
749
|
let n = `__new__${r}`;
|
|
688
|
-
return
|
|
750
|
+
return x(n, N(e), !0), t.setState((e) => ({
|
|
689
751
|
...e,
|
|
690
752
|
newRows: [...e.newRows, {
|
|
691
753
|
tempId: n,
|
|
692
754
|
committed: !1
|
|
693
755
|
}]
|
|
694
756
|
})), n;
|
|
695
|
-
},
|
|
757
|
+
}, N = (t) => {
|
|
696
758
|
let { newRowDefaults: n } = e();
|
|
697
759
|
return {
|
|
698
760
|
...typeof n == "function" ? n() : n ?? {},
|
|
699
761
|
...t
|
|
700
762
|
};
|
|
701
|
-
},
|
|
763
|
+
}, P = async (e, n) => {
|
|
702
764
|
let i = [];
|
|
703
765
|
if (ge(() => {
|
|
704
766
|
for (let t of e) {
|
|
705
767
|
r += 1;
|
|
706
768
|
let e = `__new__${r}`;
|
|
707
|
-
|
|
769
|
+
x(e, N(t), !0), i.push(e);
|
|
708
770
|
}
|
|
709
771
|
t.setState((e) => ({
|
|
710
772
|
...e,
|
|
@@ -718,14 +780,14 @@ function Gt(e) {
|
|
|
718
780
|
open: i
|
|
719
781
|
};
|
|
720
782
|
let a = [], o = [];
|
|
721
|
-
for (let e of i) (await
|
|
783
|
+
for (let e of i) (await E(e) ? a : o).push(e);
|
|
722
784
|
return {
|
|
723
785
|
committed: a,
|
|
724
786
|
open: o
|
|
725
787
|
};
|
|
726
|
-
},
|
|
788
|
+
}, F = (r) => {
|
|
727
789
|
if (n.get(r)?.isNew === !0) {
|
|
728
|
-
|
|
790
|
+
b(r);
|
|
729
791
|
return;
|
|
730
792
|
}
|
|
731
793
|
let i = e();
|
|
@@ -736,32 +798,32 @@ function Gt(e) {
|
|
|
736
798
|
}));
|
|
737
799
|
return;
|
|
738
800
|
}
|
|
739
|
-
let a =
|
|
801
|
+
let a = w(r);
|
|
740
802
|
a !== void 0 && i.onRowDelete?.({
|
|
741
803
|
rowId: r,
|
|
742
804
|
row: a
|
|
743
805
|
});
|
|
744
|
-
},
|
|
806
|
+
}, I = () => {
|
|
745
807
|
let t = e();
|
|
746
808
|
return t.draft ? t.onRowDelete !== void 0 || t.onSaveDrafts !== void 0 : t.onRowDelete !== void 0;
|
|
747
|
-
},
|
|
809
|
+
}, L = () => {
|
|
748
810
|
let e = [...t.state.deletedRowIds];
|
|
749
811
|
return e.length > 0 && t.setState((e) => ({
|
|
750
812
|
...e,
|
|
751
813
|
deletedRowIds: []
|
|
752
814
|
})), e;
|
|
753
|
-
},
|
|
815
|
+
}, R = () => [...n.keys()].filter((e) => n.get(e)?.committed === !0), z = async () => {
|
|
754
816
|
let e = [...n.keys()].filter((e) => n.get(e)?.committed !== !0);
|
|
755
|
-
return (await Promise.all(e.map((e) =>
|
|
756
|
-
},
|
|
757
|
-
i = !1,
|
|
758
|
-
}),
|
|
759
|
-
let r =
|
|
817
|
+
return (await Promise.all(e.map((e) => E(e)))).every(Boolean);
|
|
818
|
+
}, B = null, V = () => B === null ? (i = !0, B = H().finally(() => {
|
|
819
|
+
i = !1, B = null;
|
|
820
|
+
}), B) : B, H = async () => {
|
|
821
|
+
let r = R(), i = [...t.state.deletedRowIds];
|
|
760
822
|
if (r.length === 0 && i.length === 0) return !0;
|
|
761
823
|
if (e().onSaveDrafts === void 0) {
|
|
762
|
-
let t = await Promise.all(r.map((e) =>
|
|
763
|
-
for (let t of
|
|
764
|
-
let n =
|
|
824
|
+
let t = await Promise.all(r.map((e) => E(e)));
|
|
825
|
+
for (let t of L()) {
|
|
826
|
+
let n = w(t);
|
|
765
827
|
n !== void 0 && await e().onRowDelete?.({
|
|
766
828
|
rowId: t,
|
|
767
829
|
row: n
|
|
@@ -795,15 +857,28 @@ function Gt(e) {
|
|
|
795
857
|
return !1;
|
|
796
858
|
}
|
|
797
859
|
let r = n ?? {}, i = !0;
|
|
798
|
-
for (let e of s)
|
|
799
|
-
for (let e of c)
|
|
800
|
-
let a = u.filter((e) =>
|
|
860
|
+
for (let e of s) It(r.updated, e.rowId) ? b(e.rowId) : i = !1;
|
|
861
|
+
for (let e of c) It(r.created, e.tempId) ? b(e.tempId) : i = !1;
|
|
862
|
+
let a = u.filter((e) => It(r.deleted, e));
|
|
801
863
|
if (a.length > 0 && t.setState((e) => ({
|
|
802
864
|
...e,
|
|
803
865
|
deletedRowIds: e.deletedRowIds.filter((e) => !a.includes(e))
|
|
804
866
|
})), a.length < u.length && (i = !1), !i) return !1;
|
|
805
867
|
}
|
|
806
868
|
return l;
|
|
869
|
+
}, ee = async () => {
|
|
870
|
+
let e = await z(), t = await V();
|
|
871
|
+
return e && t;
|
|
872
|
+
}, U = async (e, t) => {
|
|
873
|
+
let r = w(e);
|
|
874
|
+
if (r === void 0) return !1;
|
|
875
|
+
if (t.length === 0) return !0;
|
|
876
|
+
let i = n.get(e) ?? x(e, r.original, !1);
|
|
877
|
+
for (let { field: e, value: n } of t) i.form.setFieldValue(e, n);
|
|
878
|
+
return E(e);
|
|
879
|
+
}, te = (t, n) => {
|
|
880
|
+
let r = w(t), i = e().table.getColumn(n);
|
|
881
|
+
return r === void 0 || i === void 0 || !C(r, i) ? null : Lt(i);
|
|
807
882
|
};
|
|
808
883
|
return {
|
|
809
884
|
store: t,
|
|
@@ -811,38 +886,56 @@ function Gt(e) {
|
|
|
811
886
|
return t.state;
|
|
812
887
|
},
|
|
813
888
|
getForm: (e) => n.get(e)?.form,
|
|
814
|
-
canEditCell:
|
|
815
|
-
canEditRow:
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
889
|
+
canEditCell: C,
|
|
890
|
+
canEditRow: S,
|
|
891
|
+
isColumnEditable: s,
|
|
892
|
+
begin: O,
|
|
893
|
+
commit: E,
|
|
894
|
+
cancel: k,
|
|
895
|
+
deactivate: A,
|
|
896
|
+
cancelAll: j,
|
|
897
|
+
commitAll: z,
|
|
898
|
+
saveDrafts: V,
|
|
899
|
+
submitAll: ee,
|
|
900
|
+
clearCell: async (t, n) => {
|
|
901
|
+
let r = e().table.getColumn(n), i = te(t, n);
|
|
902
|
+
return i === null || r === void 0 ? !1 : U(t, [{
|
|
903
|
+
field: i,
|
|
904
|
+
value: Rt(r.columnDef.meta?.type ?? "string")
|
|
905
|
+
}]);
|
|
826
906
|
},
|
|
827
|
-
|
|
828
|
-
let
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
907
|
+
setCellValue: async (e, t, n) => {
|
|
908
|
+
let r = te(e, t);
|
|
909
|
+
return r !== null && U(e, [{
|
|
910
|
+
field: r,
|
|
911
|
+
value: n
|
|
912
|
+
}]);
|
|
913
|
+
},
|
|
914
|
+
setRowValues: async (e, t) => {
|
|
915
|
+
let n = [];
|
|
916
|
+
for (let [r, i] of Object.entries(t)) {
|
|
917
|
+
let t = te(e, r);
|
|
918
|
+
if (t === null) return !1;
|
|
919
|
+
n.push({
|
|
920
|
+
field: t,
|
|
921
|
+
value: i
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
return U(e, n);
|
|
832
925
|
},
|
|
833
|
-
addRow:
|
|
834
|
-
addRows:
|
|
835
|
-
deleteRow:
|
|
836
|
-
canDeleteRows:
|
|
926
|
+
addRow: M,
|
|
927
|
+
addRows: P,
|
|
928
|
+
deleteRow: F,
|
|
929
|
+
canDeleteRows: I
|
|
837
930
|
};
|
|
838
931
|
}
|
|
839
|
-
function
|
|
932
|
+
function qt(e) {
|
|
840
933
|
if (e !== void 0) return typeof e == "function" || "~standard" in e ? { onChange: e } : e;
|
|
841
934
|
}
|
|
842
935
|
//#endregion
|
|
843
936
|
//#region src/tmdatagrid/components/TMDataGridEditColumn.tsx
|
|
844
|
-
var
|
|
845
|
-
function
|
|
937
|
+
var Jt = "__edit__";
|
|
938
|
+
function Yt(t) {
|
|
846
939
|
let n = e(11), { state: r, rowId: i, label: a, error: o } = t, s = r === "new" ? ce : r === "edited" ? W : K, c = o ?? a, l = o !== null || void 0, u;
|
|
847
940
|
n[0] === s ? u = n[1] : (u = /* @__PURE__ */ J(s, {
|
|
848
941
|
size: 16,
|
|
@@ -866,7 +959,7 @@ function Jt(t) {
|
|
|
866
959
|
children: d
|
|
867
960
|
}), n[8] = c, n[9] = d, n[10] = f) : f = n[10], f;
|
|
868
961
|
}
|
|
869
|
-
function
|
|
962
|
+
function Xt(t) {
|
|
870
963
|
let n = e(159), { row: r } = t, { edit: i, features: a, labels: o } = Q(), s = $e(), c = r.id, u;
|
|
871
964
|
n[0] === c ? u = n[1] : (u = (e) => e.openRowIds.includes(c), n[0] = c, n[1] = u);
|
|
872
965
|
let d = j(i.store, u), f;
|
|
@@ -882,7 +975,7 @@ function Yt(t) {
|
|
|
882
975
|
let C = j(i.store, S);
|
|
883
976
|
if (r.getIsGrouped()) return null;
|
|
884
977
|
let w = m !== void 0 && (m.hasRowError || m.errorFields.length > 0), T;
|
|
885
|
-
n[12] !== i || n[13] !== w || n[14] !== o || n[15] !== m || n[16] !== c ? (T = w ?
|
|
978
|
+
n[12] !== i || n[13] !== w || n[14] !== o || n[15] !== m || n[16] !== c ? (T = w ? Ht(i.getForm(c)?.state.errors ?? []) ?? m.errorMessages[0]?.message ?? o.editRowErrors : null, n[12] = i, n[13] = w, n[14] = o, n[15] = m, n[16] = c, n[17] = T) : T = n[17];
|
|
886
979
|
let E = T, D;
|
|
887
980
|
n[18] !== i || n[19] !== o || n[20] !== c || n[21] !== s ? (D = i.canDeleteRows() ? /* @__PURE__ */ J(O, {
|
|
888
981
|
label: o.deleteRow,
|
|
@@ -908,7 +1001,7 @@ function Yt(t) {
|
|
|
908
1001
|
if (_) {
|
|
909
1002
|
if (y) {
|
|
910
1003
|
let e;
|
|
911
|
-
n[23] !== o.rowStateNew || n[24] !== E || n[25] !== c ? (e = /* @__PURE__ */ J(
|
|
1004
|
+
n[23] !== o.rowStateNew || n[24] !== E || n[25] !== c ? (e = /* @__PURE__ */ J(Yt, {
|
|
912
1005
|
state: "new",
|
|
913
1006
|
rowId: c,
|
|
914
1007
|
label: o.rowStateNew,
|
|
@@ -1039,7 +1132,7 @@ function Yt(t) {
|
|
|
1039
1132
|
}
|
|
1040
1133
|
if (C) {
|
|
1041
1134
|
let e;
|
|
1042
|
-
n[82] !== o.rowStateDeleted || n[83] !== c ? (e = /* @__PURE__ */ J(
|
|
1135
|
+
n[82] !== o.rowStateDeleted || n[83] !== c ? (e = /* @__PURE__ */ J(Yt, {
|
|
1043
1136
|
state: "deleted",
|
|
1044
1137
|
rowId: c,
|
|
1045
1138
|
label: o.rowStateDeleted,
|
|
@@ -1089,7 +1182,7 @@ function Yt(t) {
|
|
|
1089
1182
|
}
|
|
1090
1183
|
if (x) {
|
|
1091
1184
|
let e;
|
|
1092
|
-
n[102] !== o.rowStateEdited || n[103] !== E || n[104] !== c ? (e = /* @__PURE__ */ J(
|
|
1185
|
+
n[102] !== o.rowStateEdited || n[103] !== E || n[104] !== c ? (e = /* @__PURE__ */ J(Yt, {
|
|
1093
1186
|
state: "edited",
|
|
1094
1187
|
rowId: c,
|
|
1095
1188
|
label: o.rowStateEdited,
|
|
@@ -1226,10 +1319,10 @@ function Yt(t) {
|
|
|
1226
1319
|
children: [L, H]
|
|
1227
1320
|
}), n[156] = L, n[157] = H, n[158] = ee) : ee = n[158], ee;
|
|
1228
1321
|
}
|
|
1229
|
-
function
|
|
1322
|
+
function Zt(e = "Edit", t = !1) {
|
|
1230
1323
|
let n = t ? 88 : 64;
|
|
1231
1324
|
return {
|
|
1232
|
-
id:
|
|
1325
|
+
id: Jt,
|
|
1233
1326
|
meta: {
|
|
1234
1327
|
label: e,
|
|
1235
1328
|
align: "center",
|
|
@@ -1245,11 +1338,11 @@ function Xt(e = "Edit", t = !1) {
|
|
|
1245
1338
|
enableHiding: !1,
|
|
1246
1339
|
enablePinning: !1,
|
|
1247
1340
|
header: () => null,
|
|
1248
|
-
cell: ({ row: e }) => /* @__PURE__ */ J(
|
|
1249
|
-
aggregatedCell: ({ row: e }) => /* @__PURE__ */ J(
|
|
1341
|
+
cell: ({ row: e }) => /* @__PURE__ */ J(Xt, { row: e }),
|
|
1342
|
+
aggregatedCell: ({ row: e }) => /* @__PURE__ */ J(Xt, { row: e })
|
|
1250
1343
|
};
|
|
1251
1344
|
}
|
|
1252
|
-
var
|
|
1345
|
+
var Qt = {
|
|
1253
1346
|
groupToggle: "_groupToggle_1954o_4",
|
|
1254
1347
|
chevron: "_chevron_1954o_14",
|
|
1255
1348
|
groupLabel: "_groupLabel_1954o_34",
|
|
@@ -1257,24 +1350,24 @@ var Zt = {
|
|
|
1257
1350
|
};
|
|
1258
1351
|
//#endregion
|
|
1259
1352
|
//#region src/tmdatagrid/core/grouping.ts
|
|
1260
|
-
function
|
|
1353
|
+
function $t(e) {
|
|
1261
1354
|
return e.subRows.length === 0 ? [e] : e.getLeafRows().filter((e) => e.subRows.length === 0);
|
|
1262
1355
|
}
|
|
1263
1356
|
//#endregion
|
|
1264
1357
|
//#region src/tmdatagrid/components/TMDataGridGroupColumn.tsx
|
|
1265
|
-
var
|
|
1266
|
-
function
|
|
1358
|
+
var en = "__group__", tn = 16, nn = "(Blank)";
|
|
1359
|
+
function rn(e, t = nn) {
|
|
1267
1360
|
return e == null || e === "" ? t : e instanceof Date ? e.toLocaleDateString() : String(e);
|
|
1268
1361
|
}
|
|
1269
|
-
function
|
|
1362
|
+
function an(t) {
|
|
1270
1363
|
let n = e(39), { row: r } = t, { labels: i } = Q(), a;
|
|
1271
1364
|
n[0] === r ? a = n[1] : (a = () => r.getIsExpanded(), n[0] = r, n[1] = a);
|
|
1272
1365
|
let o = j(r.table.store, a), s = $e();
|
|
1273
1366
|
if (!r.getIsGrouped()) return null;
|
|
1274
1367
|
let c, l, u, d, f, p, m;
|
|
1275
1368
|
if (n[2] !== o || n[3] !== i || n[4] !== r.depth || n[5] !== r.groupingValue || n[6] !== s) {
|
|
1276
|
-
l =
|
|
1277
|
-
let e = r.depth *
|
|
1369
|
+
l = rn(r.groupingValue, i.blankGroupValue), c = k, u = Qt.groupToggle;
|
|
1370
|
+
let e = r.depth * tn;
|
|
1278
1371
|
n[14] === e ? d = n[15] : (d = { paddingInlineStart: e }, n[14] = e, n[15] = d), f = s, p = o, m = o ? i.collapseGroup(l) : i.expandGroup(l), n[2] = o, n[3] = i, n[4] = r.depth, n[5] = r.groupingValue, n[6] = s, n[7] = c, n[8] = l, n[9] = u, n[10] = d, n[11] = f, n[12] = p, n[13] = m;
|
|
1279
1372
|
} else c = n[7], l = n[8], u = n[9], d = n[10], f = n[11], p = n[12], m = n[13];
|
|
1280
1373
|
let h = r.id, g;
|
|
@@ -1288,20 +1381,20 @@ function rn(t) {
|
|
|
1288
1381
|
}), n[18] = _) : _ = n[18];
|
|
1289
1382
|
let v;
|
|
1290
1383
|
n[19] === o ? v = n[20] : (v = /* @__PURE__ */ J("span", {
|
|
1291
|
-
className:
|
|
1384
|
+
className: Qt.chevron,
|
|
1292
1385
|
"data-expanded": o,
|
|
1293
1386
|
children: _
|
|
1294
1387
|
}), n[19] = o, n[20] = v);
|
|
1295
1388
|
let y;
|
|
1296
1389
|
n[21] === l ? y = n[22] : (y = /* @__PURE__ */ J("span", {
|
|
1297
|
-
className:
|
|
1390
|
+
className: Qt.groupLabel,
|
|
1298
1391
|
children: l
|
|
1299
1392
|
}), n[21] = l, n[22] = y);
|
|
1300
1393
|
let b;
|
|
1301
|
-
n[23] === r ? b = n[24] : (b =
|
|
1394
|
+
n[23] === r ? b = n[24] : (b = $t(r), n[23] = r, n[24] = b);
|
|
1302
1395
|
let x;
|
|
1303
1396
|
n[25] === b.length ? x = n[26] : (x = /* @__PURE__ */ Y("span", {
|
|
1304
|
-
className:
|
|
1397
|
+
className: Qt.groupCount,
|
|
1305
1398
|
children: [
|
|
1306
1399
|
"(",
|
|
1307
1400
|
b.length,
|
|
@@ -1325,27 +1418,27 @@ function rn(t) {
|
|
|
1325
1418
|
]
|
|
1326
1419
|
}), n[27] = c, n[28] = r.id, n[29] = v, n[30] = y, n[31] = x, n[32] = u, n[33] = d, n[34] = f, n[35] = p, n[36] = m, n[37] = g, n[38] = S) : S = n[38], S;
|
|
1327
1420
|
}
|
|
1328
|
-
function
|
|
1421
|
+
function on(t) {
|
|
1329
1422
|
let n = e(6), { table: r } = t, { labels: i } = Q(), a;
|
|
1330
1423
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = { compare: _e }, n[0] = a) : a = n[0];
|
|
1331
|
-
let o = j(r.store,
|
|
1424
|
+
let o = j(r.store, sn, a);
|
|
1332
1425
|
if (o.length === 0) return i.groupColumnLabel;
|
|
1333
1426
|
let s;
|
|
1334
1427
|
if (n[1] !== o || n[2] !== r) {
|
|
1335
1428
|
let e;
|
|
1336
1429
|
n[4] === r ? e = n[5] : (e = (e) => {
|
|
1337
1430
|
let t = r.getColumn(e);
|
|
1338
|
-
return t ?
|
|
1431
|
+
return t ? xn(t) : e;
|
|
1339
1432
|
}, n[4] = r, n[5] = e), s = o.map(e).join(" / "), n[1] = o, n[2] = r, n[3] = s;
|
|
1340
1433
|
} else s = n[3];
|
|
1341
1434
|
return s;
|
|
1342
1435
|
}
|
|
1343
|
-
function
|
|
1436
|
+
function sn(e) {
|
|
1344
1437
|
return e.grouping;
|
|
1345
1438
|
}
|
|
1346
|
-
function
|
|
1439
|
+
function cn(e = "Group") {
|
|
1347
1440
|
return {
|
|
1348
|
-
id:
|
|
1441
|
+
id: en,
|
|
1349
1442
|
meta: {
|
|
1350
1443
|
label: e,
|
|
1351
1444
|
enableOrdering: !1
|
|
@@ -1357,17 +1450,17 @@ function sn(e = "Group") {
|
|
|
1357
1450
|
enableGlobalFilter: !1,
|
|
1358
1451
|
enableHiding: !1,
|
|
1359
1452
|
enablePinning: !1,
|
|
1360
|
-
cell: ({ row: e }) => /* @__PURE__ */ J(
|
|
1361
|
-
aggregatedCell: ({ row: e }) => /* @__PURE__ */ J(
|
|
1362
|
-
header: ({ table: e }) => /* @__PURE__ */ J(
|
|
1453
|
+
cell: ({ row: e }) => /* @__PURE__ */ J(an, { row: e }),
|
|
1454
|
+
aggregatedCell: ({ row: e }) => /* @__PURE__ */ J(an, { row: e }),
|
|
1455
|
+
header: ({ table: e }) => /* @__PURE__ */ J(on, { table: e })
|
|
1363
1456
|
};
|
|
1364
1457
|
}
|
|
1365
1458
|
//#endregion
|
|
1366
1459
|
//#region src/tmdatagrid/components/TMDataGridRowNumberColumn.tsx
|
|
1367
|
-
var
|
|
1368
|
-
function
|
|
1460
|
+
var ln = "__rowNumber__";
|
|
1461
|
+
function un(e = "Row number") {
|
|
1369
1462
|
return {
|
|
1370
|
-
id:
|
|
1463
|
+
id: ln,
|
|
1371
1464
|
meta: {
|
|
1372
1465
|
label: e,
|
|
1373
1466
|
align: "center",
|
|
@@ -1388,27 +1481,27 @@ function ln(e = "Row number") {
|
|
|
1388
1481
|
}
|
|
1389
1482
|
//#endregion
|
|
1390
1483
|
//#region src/tmdatagrid/core/rowSelection.ts
|
|
1391
|
-
function
|
|
1392
|
-
let n =
|
|
1484
|
+
function dn(e, t) {
|
|
1485
|
+
let n = fn(e, t) ? e.getPaginatedRowModel().rows : e.getPrePaginatedRowModel().rows;
|
|
1393
1486
|
if (!t.rowPinning) return n;
|
|
1394
1487
|
let { top: r, bottom: i } = e.store.state.rowPinning;
|
|
1395
1488
|
if (r.length === 0 && i.length === 0) return n;
|
|
1396
1489
|
let a = /* @__PURE__ */ new Set([...r, ...i]);
|
|
1397
1490
|
return n.filter((e) => !a.has(e.id));
|
|
1398
1491
|
}
|
|
1399
|
-
function
|
|
1492
|
+
function fn(e, t) {
|
|
1400
1493
|
return t.pagination && e.store.state.grouping.length === 0;
|
|
1401
1494
|
}
|
|
1402
|
-
function
|
|
1403
|
-
return
|
|
1495
|
+
function pn(e) {
|
|
1496
|
+
return $t(e).filter((e) => e.getCanSelect()).map((e) => e.id);
|
|
1404
1497
|
}
|
|
1405
|
-
function
|
|
1498
|
+
function mn({ rows: e, rowId: t, anchorRowId: n, modifiers: r, selection: i, canReplaceSelection: a }) {
|
|
1406
1499
|
let o = e.findIndex((e) => e.id === t), s = e[o];
|
|
1407
1500
|
if (o === -1 || s === void 0) return {
|
|
1408
1501
|
selection: i,
|
|
1409
1502
|
anchorRowId: n
|
|
1410
1503
|
};
|
|
1411
|
-
let c =
|
|
1504
|
+
let c = pn(s);
|
|
1412
1505
|
if (c.length === 0) return {
|
|
1413
1506
|
selection: i,
|
|
1414
1507
|
anchorRowId: n
|
|
@@ -1426,7 +1519,7 @@ function pn({ rows: e, rowId: t, anchorRowId: n, modifiers: r, selection: i, can
|
|
|
1426
1519
|
let l = n === null ? -1 : e.findIndex((e) => e.id === n);
|
|
1427
1520
|
if (r.extend && l !== -1) {
|
|
1428
1521
|
let t = Math.min(l, o), s = Math.max(l, o), c = r.toggle || !a ? { ...i } : {};
|
|
1429
|
-
for (let n of e.slice(t, s + 1)) for (let e of
|
|
1522
|
+
for (let n of e.slice(t, s + 1)) for (let e of pn(n)) c[e] = !0;
|
|
1430
1523
|
return {
|
|
1431
1524
|
selection: c,
|
|
1432
1525
|
anchorRowId: n
|
|
@@ -1449,8 +1542,8 @@ function pn({ rows: e, rowId: t, anchorRowId: n, modifiers: r, selection: i, can
|
|
|
1449
1542
|
}
|
|
1450
1543
|
//#endregion
|
|
1451
1544
|
//#region src/tmdatagrid/components/TMDataGridSelectColumn.tsx
|
|
1452
|
-
var
|
|
1453
|
-
function
|
|
1545
|
+
var hn = "__select__";
|
|
1546
|
+
function gn(t) {
|
|
1454
1547
|
let n = e(11), { table: r } = t, { labels: i } = Q(), a;
|
|
1455
1548
|
n[0] === r ? a = n[1] : (a = () => r.getIsAllRowsSelected(), n[0] = r, n[1] = a);
|
|
1456
1549
|
let o = j(r.store, a), s;
|
|
@@ -1467,25 +1560,25 @@ function hn(t) {
|
|
|
1467
1560
|
onChange: d
|
|
1468
1561
|
}), n[6] = o, n[7] = i.selectAllRows, n[8] = u, n[9] = d, n[10] = p) : p = n[10], p;
|
|
1469
1562
|
}
|
|
1470
|
-
function
|
|
1563
|
+
function _n(t) {
|
|
1471
1564
|
let n = e(2), { table: r } = t, { features: i } = Q();
|
|
1472
1565
|
if (!i.multiRowSelection) return null;
|
|
1473
1566
|
let a;
|
|
1474
|
-
return n[0] === r ? a = n[1] : (a = /* @__PURE__ */ J(
|
|
1567
|
+
return n[0] === r ? a = n[1] : (a = /* @__PURE__ */ J(gn, { table: r }), n[0] = r, n[1] = a), a;
|
|
1475
1568
|
}
|
|
1476
|
-
function
|
|
1569
|
+
function vn(t) {
|
|
1477
1570
|
let n = e(21), { row: r } = t, { ui: i, features: a, labels: o } = Q(), s = $e(), c = r.subRows.length > 0, l;
|
|
1478
1571
|
n[0] !== c || n[1] !== r ? (l = () => c ? r.getIsAllSubRowsSelected() : r.getIsSelected(), n[0] = c, n[1] = r, n[2] = l) : l = n[2];
|
|
1479
1572
|
let u = j(r.table.store, l), d;
|
|
1480
1573
|
n[3] === r ? d = n[4] : (d = () => r.getIsSomeSelected(), n[3] = r, n[4] = d);
|
|
1481
1574
|
let p = j(r.table.store, d), m;
|
|
1482
|
-
n[5] === r ? m = n[6] : (m =
|
|
1575
|
+
n[5] === r ? m = n[6] : (m = pn(r), n[5] = r, n[6] = m);
|
|
1483
1576
|
let h = m;
|
|
1484
1577
|
if (c && !r.getCanMultiSelect()) return null;
|
|
1485
1578
|
let g = c ? o.selectGroup : o.selectRow, _ = h.length === 0, v = p && !u, y;
|
|
1486
1579
|
n[7] !== a || n[8] !== r.id || n[9] !== r.table || n[10] !== i.actions || n[11] !== i.state.selectionAnchorRowId ? (y = (e) => {
|
|
1487
|
-
let t = e.nativeEvent, n = t instanceof MouseEvent, o =
|
|
1488
|
-
rows:
|
|
1580
|
+
let t = e.nativeEvent, n = t instanceof MouseEvent, o = mn({
|
|
1581
|
+
rows: dn(r.table, a),
|
|
1489
1582
|
rowId: r.id,
|
|
1490
1583
|
anchorRowId: i.state.selectionAnchorRowId,
|
|
1491
1584
|
modifiers: {
|
|
@@ -1508,15 +1601,15 @@ function _n(t) {
|
|
|
1508
1601
|
disabled: _,
|
|
1509
1602
|
indeterminate: v,
|
|
1510
1603
|
onChange: y,
|
|
1511
|
-
onClick:
|
|
1604
|
+
onClick: yn
|
|
1512
1605
|
}), n[13] = r.id, n[14] = u, n[15] = g, n[16] = _, n[17] = v, n[18] = y, n[19] = s, n[20] = b) : b = n[20], b;
|
|
1513
1606
|
}
|
|
1514
|
-
function
|
|
1607
|
+
function yn(e) {
|
|
1515
1608
|
return e.stopPropagation();
|
|
1516
1609
|
}
|
|
1517
|
-
function
|
|
1610
|
+
function bn(e = "Checkbox selection") {
|
|
1518
1611
|
return {
|
|
1519
|
-
id:
|
|
1612
|
+
id: hn,
|
|
1520
1613
|
meta: {
|
|
1521
1614
|
label: e,
|
|
1522
1615
|
align: "center",
|
|
@@ -1531,55 +1624,55 @@ function yn(e = "Checkbox selection") {
|
|
|
1531
1624
|
enableGlobalFilter: !1,
|
|
1532
1625
|
enableHiding: !1,
|
|
1533
1626
|
enablePinning: !1,
|
|
1534
|
-
header: ({ table: e }) => /* @__PURE__ */ J(
|
|
1535
|
-
cell: ({ row: e }) => /* @__PURE__ */ J(
|
|
1536
|
-
aggregatedCell: ({ row: e }) => /* @__PURE__ */ J(
|
|
1627
|
+
header: ({ table: e }) => /* @__PURE__ */ J(_n, { table: e }),
|
|
1628
|
+
cell: ({ row: e }) => /* @__PURE__ */ J(vn, { row: e }),
|
|
1629
|
+
aggregatedCell: ({ row: e }) => /* @__PURE__ */ J(vn, { row: e })
|
|
1537
1630
|
};
|
|
1538
1631
|
}
|
|
1539
1632
|
//#endregion
|
|
1540
1633
|
//#region src/tmdatagrid/core/columnUtils.ts
|
|
1541
|
-
function
|
|
1634
|
+
function xn(e) {
|
|
1542
1635
|
let t = e.columnDef.meta?.label;
|
|
1543
1636
|
if (t) return t;
|
|
1544
1637
|
let n = e.columnDef.header;
|
|
1545
1638
|
return typeof n == "string" ? n : e.id;
|
|
1546
1639
|
}
|
|
1547
|
-
function xn(e) {
|
|
1548
|
-
return e.columnDef.meta?.type ?? "string";
|
|
1549
|
-
}
|
|
1550
1640
|
function Sn(e) {
|
|
1551
|
-
return e.columnDef.meta?.
|
|
1641
|
+
return e.columnDef.meta?.type ?? "string";
|
|
1552
1642
|
}
|
|
1553
1643
|
function Cn(e) {
|
|
1554
|
-
return e.columnDef.meta?.filter?.
|
|
1644
|
+
return e.columnDef.meta?.filter?.defaultOperator ?? ft(Sn(e));
|
|
1555
1645
|
}
|
|
1556
1646
|
function wn(e) {
|
|
1647
|
+
return e.columnDef.meta?.filter?.control;
|
|
1648
|
+
}
|
|
1649
|
+
function Tn(e) {
|
|
1557
1650
|
return e.columnDef.meta?.edit?.enabled === !1;
|
|
1558
1651
|
}
|
|
1559
|
-
function
|
|
1652
|
+
function En(e, t) {
|
|
1560
1653
|
let n = e.columnDef.meta?.edit?.enabled;
|
|
1561
1654
|
return n === !1 ? !1 : typeof n != "function" || n(t);
|
|
1562
1655
|
}
|
|
1563
|
-
function En(e) {
|
|
1564
|
-
return e.columnDef.meta?.align ?? "left";
|
|
1565
|
-
}
|
|
1566
1656
|
function Dn(e) {
|
|
1567
|
-
return e
|
|
1657
|
+
return e.columnDef.meta?.align ?? "left";
|
|
1568
1658
|
}
|
|
1569
1659
|
function On(e) {
|
|
1570
|
-
return
|
|
1660
|
+
return e === "__select__" || e === "__details__" || e === "__edit__" || e === "__rowNumber__";
|
|
1571
1661
|
}
|
|
1572
1662
|
function kn(e) {
|
|
1663
|
+
return On(e) || e === "__group__";
|
|
1664
|
+
}
|
|
1665
|
+
function An(e) {
|
|
1573
1666
|
return e.columnDef.meta?.enableOrdering !== !1 && e.parent === void 0;
|
|
1574
1667
|
}
|
|
1575
1668
|
//#endregion
|
|
1576
1669
|
//#region src/tmdatagrid/components/TMDataGridColumnsPanel.tsx
|
|
1577
|
-
function
|
|
1578
|
-
let t = e(67), { table: n, labels: r, controlSize: i, resetSettings: a } = Q(), [o, s] = c(""), l = j(n.store,
|
|
1670
|
+
function jn() {
|
|
1671
|
+
let t = e(67), { table: n, labels: r, controlSize: i, resetSettings: a } = Q(), [o, s] = c(""), l = j(n.store, Nn), u, p, m, h, g, _, v, y, b, x, C, w;
|
|
1579
1672
|
if (t[0] !== l || t[1] !== i || t[2] !== r.columnsSearchPlaceholder || t[3] !== o || t[4] !== n) {
|
|
1580
|
-
p = n.getAllLeafColumns().filter(
|
|
1673
|
+
p = n.getAllLeafColumns().filter(Mn);
|
|
1581
1674
|
let e = o.trim().toLowerCase();
|
|
1582
|
-
w = e ? p.filter((t) =>
|
|
1675
|
+
w = e ? p.filter((t) => xn(t).toLowerCase().includes(e)) : p;
|
|
1583
1676
|
let a;
|
|
1584
1677
|
t[17] === l ? a = t[18] : (a = (e) => l[e.id] !== !1, t[17] = l, t[18] = a), h = p.filter(a).length, m = (e) => {
|
|
1585
1678
|
n.setColumnVisibility((t) => {
|
|
@@ -1609,7 +1702,7 @@ function An() {
|
|
|
1609
1702
|
let T;
|
|
1610
1703
|
t[25] !== l || t[26] !== i ? (T = (e) => /* @__PURE__ */ J(f, {
|
|
1611
1704
|
size: i,
|
|
1612
|
-
label:
|
|
1705
|
+
label: xn(e),
|
|
1613
1706
|
"data-dg-part": "columns-toggle",
|
|
1614
1707
|
"data-column-id": e.id,
|
|
1615
1708
|
checked: l[e.id] !== !1,
|
|
@@ -1677,33 +1770,37 @@ function An() {
|
|
|
1677
1770
|
]
|
|
1678
1771
|
}), t[61] = z, t[62] = b, t[63] = x, t[64] = C, t[65] = A, t[66] = B) : B = t[66], B;
|
|
1679
1772
|
}
|
|
1680
|
-
function
|
|
1773
|
+
function Mn(e) {
|
|
1681
1774
|
return e.getCanHide();
|
|
1682
1775
|
}
|
|
1683
|
-
function
|
|
1776
|
+
function Nn(e) {
|
|
1684
1777
|
return e.columnVisibility;
|
|
1685
1778
|
}
|
|
1686
1779
|
//#endregion
|
|
1687
1780
|
//#region src/tmdatagrid/components/TMDataGridDraftActions.tsx
|
|
1688
|
-
function
|
|
1781
|
+
function Pn() {
|
|
1689
1782
|
let { edit: e } = Q();
|
|
1690
|
-
return j(e.store,
|
|
1691
|
-
}
|
|
1692
|
-
function Pn(e) {
|
|
1693
|
-
return e.committedRowIds.length + e.newRows.filter(Fn).length + e.deletedRowIds.length;
|
|
1783
|
+
return j(e.store, Fn);
|
|
1694
1784
|
}
|
|
1695
1785
|
function Fn(e) {
|
|
1786
|
+
return e.committedRowIds.length + e.newRows.filter(In).length + e.deletedRowIds.length;
|
|
1787
|
+
}
|
|
1788
|
+
function In(e) {
|
|
1696
1789
|
return e.committed;
|
|
1697
1790
|
}
|
|
1698
|
-
function
|
|
1791
|
+
function Ln() {
|
|
1699
1792
|
let { edit: e } = Q();
|
|
1700
|
-
return j(e.store,
|
|
1793
|
+
return j(e.store, Rn);
|
|
1794
|
+
}
|
|
1795
|
+
function Rn(e) {
|
|
1796
|
+
return Ft(e).length;
|
|
1701
1797
|
}
|
|
1702
|
-
function
|
|
1703
|
-
|
|
1798
|
+
function zn() {
|
|
1799
|
+
let t = e(1), { edit: n } = Q(), r;
|
|
1800
|
+
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (r = { compare: _e }, t[0] = r) : r = t[0], j(n.store, Ft, r);
|
|
1704
1801
|
}
|
|
1705
|
-
function
|
|
1706
|
-
let t = e(11), { edit: n, labels: r } = Q(), i =
|
|
1802
|
+
function Bn() {
|
|
1803
|
+
let t = e(11), { edit: n, labels: r } = Q(), i = Pn(), a = j(n.store, Vn), o = i === 0, s;
|
|
1707
1804
|
t[0] === n ? s = t[1] : (s = () => void n.saveDrafts(), t[0] = n, t[1] = s);
|
|
1708
1805
|
let c;
|
|
1709
1806
|
t[2] !== i || t[3] !== r ? (c = r.saveAllEdits(i), t[2] = i, t[3] = r, t[4] = c) : c = t[4];
|
|
@@ -1718,11 +1815,11 @@ function Rn() {
|
|
|
1718
1815
|
children: c
|
|
1719
1816
|
}), t[5] = i, t[6] = a, t[7] = o, t[8] = s, t[9] = c, t[10] = l) : l = t[10], l;
|
|
1720
1817
|
}
|
|
1721
|
-
function
|
|
1818
|
+
function Vn(e) {
|
|
1722
1819
|
return e.openRowIds.some((t) => e.rows[t]?.isSubmitting === !0);
|
|
1723
1820
|
}
|
|
1724
|
-
function
|
|
1725
|
-
let t = e(6), { labels: n } = Q(), r =
|
|
1821
|
+
function Hn() {
|
|
1822
|
+
let t = e(6), { labels: n } = Q(), r = Ln();
|
|
1726
1823
|
if (r === 0) return null;
|
|
1727
1824
|
let i;
|
|
1728
1825
|
t[0] !== n || t[1] !== r ? (i = n.editRowsStillOpen(r), t[0] = n, t[1] = r, t[2] = i) : i = t[2];
|
|
@@ -1735,8 +1832,8 @@ function Bn() {
|
|
|
1735
1832
|
children: i
|
|
1736
1833
|
}), t[3] = r, t[4] = i, t[5] = a) : a = t[5], a;
|
|
1737
1834
|
}
|
|
1738
|
-
function
|
|
1739
|
-
let t = e(6), { edit: n, labels: r } = Q(), i =
|
|
1835
|
+
function Un() {
|
|
1836
|
+
let t = e(6), { edit: n, labels: r } = Q(), i = Pn() + Ln() === 0, a;
|
|
1740
1837
|
t[0] === n ? a = t[1] : (a = () => n.cancelAll(), t[0] = n, t[1] = a);
|
|
1741
1838
|
let o;
|
|
1742
1839
|
return t[2] !== r.discardAllEdits || t[3] !== i || t[4] !== a ? (o = /* @__PURE__ */ J(d, {
|
|
@@ -1749,46 +1846,62 @@ function Vn() {
|
|
|
1749
1846
|
children: r.discardAllEdits
|
|
1750
1847
|
}), t[2] = r.discardAllEdits, t[3] = i, t[4] = a, t[5] = o) : o = t[5], o;
|
|
1751
1848
|
}
|
|
1752
|
-
var
|
|
1753
|
-
Save:
|
|
1754
|
-
Discard:
|
|
1755
|
-
OpenRowsNote:
|
|
1849
|
+
var Wn = {
|
|
1850
|
+
Save: Bn,
|
|
1851
|
+
Discard: Un,
|
|
1852
|
+
OpenRowsNote: Hn
|
|
1756
1853
|
};
|
|
1757
|
-
function
|
|
1758
|
-
let n = e(
|
|
1854
|
+
function Gn(t) {
|
|
1855
|
+
let n = e(10), { renderActions: r } = t === void 0 ? {} : t, { edit: i, features: a, table: o, scrollToRow: s } = Q(), c = Pn(), l = zn(), u = j(i.store, Kn);
|
|
1759
1856
|
if (!a.editing) return null;
|
|
1760
1857
|
if (r) {
|
|
1761
|
-
let e, t,
|
|
1762
|
-
|
|
1858
|
+
let e, t, d;
|
|
1859
|
+
n[0] === i ? (e = n[1], t = n[2], d = n[3]) : (e = () => i.saveDrafts(), t = () => i.commitAll(), d = () => i.cancelAll(), n[0] = i, n[1] = e, n[2] = t, n[3] = d);
|
|
1860
|
+
let f;
|
|
1861
|
+
return n[4] !== i.state || n[5] !== a || n[6] !== s || n[7] !== o ? (f = (e) => {
|
|
1862
|
+
let t = i.state, n = Ft(t);
|
|
1863
|
+
if (n.length === 0) return !1;
|
|
1864
|
+
let r = new Set(n), c = dn(o, a).find((e) => r.has(e.id));
|
|
1865
|
+
return c === void 0 ? n.some((n) => t.newRows.some((e) => e.tempId === n) || s({
|
|
1866
|
+
rowId: n,
|
|
1867
|
+
align: e
|
|
1868
|
+
})) : s({
|
|
1869
|
+
rowId: c.id,
|
|
1870
|
+
align: e
|
|
1871
|
+
});
|
|
1872
|
+
}, n[4] = i.state, n[5] = a, n[6] = s, n[7] = o, n[8] = f) : f = n[8], r({
|
|
1763
1873
|
state: {
|
|
1764
|
-
draftCount:
|
|
1765
|
-
openCount:
|
|
1766
|
-
|
|
1767
|
-
|
|
1874
|
+
draftCount: c,
|
|
1875
|
+
openCount: l.length,
|
|
1876
|
+
openRowIds: l,
|
|
1877
|
+
pendingCount: c + l.length,
|
|
1878
|
+
isSubmitting: u
|
|
1768
1879
|
},
|
|
1769
1880
|
actions: {
|
|
1770
1881
|
save: e,
|
|
1771
1882
|
commitAll: t,
|
|
1772
|
-
discard:
|
|
1883
|
+
discard: d,
|
|
1884
|
+
scrollToRow: s,
|
|
1885
|
+
scrollToFirstOpenRow: f
|
|
1773
1886
|
},
|
|
1774
|
-
Controls:
|
|
1887
|
+
Controls: Wn
|
|
1775
1888
|
});
|
|
1776
1889
|
}
|
|
1777
|
-
let
|
|
1778
|
-
return n[
|
|
1890
|
+
let d;
|
|
1891
|
+
return n[9] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ Y(p, {
|
|
1779
1892
|
gap: "xs",
|
|
1780
1893
|
wrap: "nowrap",
|
|
1781
1894
|
children: [
|
|
1895
|
+
/* @__PURE__ */ J(Hn, {}),
|
|
1782
1896
|
/* @__PURE__ */ J(Bn, {}),
|
|
1783
|
-
/* @__PURE__ */ J(
|
|
1784
|
-
/* @__PURE__ */ J(Vn, {})
|
|
1897
|
+
/* @__PURE__ */ J(Un, {})
|
|
1785
1898
|
]
|
|
1786
|
-
}), n[
|
|
1899
|
+
}), n[9] = d) : d = n[9], d;
|
|
1787
1900
|
}
|
|
1788
|
-
function
|
|
1901
|
+
function Kn(e) {
|
|
1789
1902
|
return e.openRowIds.some((t) => e.rows[t]?.isSubmitting === !0);
|
|
1790
1903
|
}
|
|
1791
|
-
var
|
|
1904
|
+
var qn = {
|
|
1792
1905
|
filterPanel: "_filterPanel_izakx_4",
|
|
1793
1906
|
filterRow: "_filterRow_izakx_16",
|
|
1794
1907
|
filterPanelHeader: "_filterPanelHeader_izakx_22",
|
|
@@ -1796,16 +1909,16 @@ var Gn = {
|
|
|
1796
1909
|
};
|
|
1797
1910
|
//#endregion
|
|
1798
1911
|
//#region src/tmdatagrid/core/columnOptions.ts
|
|
1799
|
-
function
|
|
1912
|
+
function Jn(e, t) {
|
|
1800
1913
|
t == null || t === "" || e.add(String(t));
|
|
1801
1914
|
}
|
|
1802
|
-
function
|
|
1915
|
+
function Yn({ table: e, column: t, row: n, fallback: r }) {
|
|
1803
1916
|
let i = t.columnDef.meta?.options ?? r;
|
|
1804
1917
|
if (!i) return [];
|
|
1805
1918
|
if (i === "faceted") {
|
|
1806
1919
|
let e = /* @__PURE__ */ new Set();
|
|
1807
|
-
for (let n of t.getFacetedUniqueValues().keys()) if (Array.isArray(n)) for (let t of n)
|
|
1808
|
-
else
|
|
1920
|
+
for (let n of t.getFacetedUniqueValues().keys()) if (Array.isArray(n)) for (let t of n) Jn(e, t);
|
|
1921
|
+
else Jn(e, n);
|
|
1809
1922
|
return [...e].sort((e, t) => e.localeCompare(t, void 0, { numeric: !0 })).map((e) => ({ value: e }));
|
|
1810
1923
|
}
|
|
1811
1924
|
return (typeof i == "function" ? i({
|
|
@@ -1814,7 +1927,7 @@ function qn({ table: e, column: t, row: n, fallback: r }) {
|
|
|
1814
1927
|
row: n
|
|
1815
1928
|
}) : i).map((e) => typeof e == "string" ? { value: e } : e);
|
|
1816
1929
|
}
|
|
1817
|
-
function
|
|
1930
|
+
function Xn(e) {
|
|
1818
1931
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
1819
1932
|
for (let r of e) {
|
|
1820
1933
|
let e = {
|
|
@@ -1835,8 +1948,8 @@ function Jn(e) {
|
|
|
1835
1948
|
}
|
|
1836
1949
|
//#endregion
|
|
1837
1950
|
//#region src/tmdatagrid/components/filters/TMDataGridFilterValueInput.tsx
|
|
1838
|
-
function
|
|
1839
|
-
let n = e(64), { column: r, operator: i, value: a, onChange: o, options: s, size: c, labels: l } = t, u =
|
|
1951
|
+
function Zn(t) {
|
|
1952
|
+
let n = e(64), { column: r, operator: i, value: a, onChange: o, options: s, size: c, labels: l } = t, u = Sn(r), d;
|
|
1840
1953
|
n[0] === i ? d = n[1] : (d = pt(i), n[0] = i, n[1] = d);
|
|
1841
1954
|
let f = d, m = typeof a == "string" ? a : "", h = u === "number" ? "number" : u === "date" ? "date" : "text";
|
|
1842
1955
|
if (ht(i)) {
|
|
@@ -1878,7 +1991,7 @@ function Yn(t) {
|
|
|
1878
1991
|
let e = l.filterValue, t;
|
|
1879
1992
|
n[25] === Symbol.for("react.memo_cache_sentinel") ? (t = { withinPortal: !1 }, n[25] = t) : t = n[25];
|
|
1880
1993
|
let r;
|
|
1881
|
-
n[26] === s ? r = n[27] : (r =
|
|
1994
|
+
n[26] === s ? r = n[27] : (r = Xn(s), n[26] = s, n[27] = r);
|
|
1882
1995
|
let i;
|
|
1883
1996
|
n[28] === a ? i = n[29] : (i = Array.isArray(a) ? [...a] : [], n[28] = a, n[29] = i);
|
|
1884
1997
|
let u;
|
|
@@ -1943,18 +2056,18 @@ function Yn(t) {
|
|
|
1943
2056
|
}
|
|
1944
2057
|
//#endregion
|
|
1945
2058
|
//#region src/tmdatagrid/components/TMDataGridFilterPanel.tsx
|
|
1946
|
-
var
|
|
2059
|
+
var Qn = {
|
|
1947
2060
|
operator: "contains",
|
|
1948
2061
|
value: ""
|
|
1949
2062
|
};
|
|
1950
|
-
function
|
|
1951
|
-
return _t(e) ? e :
|
|
2063
|
+
function $n(e) {
|
|
2064
|
+
return _t(e) ? e : Qn;
|
|
1952
2065
|
}
|
|
1953
|
-
function
|
|
2066
|
+
function er(e) {
|
|
1954
2067
|
return mt(e) ? "set" : ht(e) ? "range" : "scalar";
|
|
1955
2068
|
}
|
|
1956
|
-
function
|
|
1957
|
-
let t = e(76), { table: n, ui: r, labels: a, controlSize: o } = Q(), c = j(r,
|
|
2069
|
+
function tr() {
|
|
2070
|
+
let t = e(76), { table: n, ui: r, labels: a, controlSize: o } = Q(), c = j(r, ar), u = j(n.store, ir), f = s(null), p, m;
|
|
1958
2071
|
if (t[0] !== c || t[1] !== r ? (p = () => {
|
|
1959
2072
|
if (!c) return;
|
|
1960
2073
|
let e = (e) => {
|
|
@@ -1965,12 +2078,12 @@ function $n() {
|
|
|
1965
2078
|
}, m = [c, r], t[0] = c, t[1] = r, t[2] = p, t[3] = m) : (p = t[2], m = t[3]), i(p, m), !c) return null;
|
|
1966
2079
|
let h, g, _, v, y, b, x, S;
|
|
1967
2080
|
if (t[4] !== u || t[5] !== n || t[6] !== r.actions) {
|
|
1968
|
-
let e = n.getAllLeafColumns().filter(
|
|
1969
|
-
y = e.map(
|
|
2081
|
+
let e = n.getAllLeafColumns().filter(rr);
|
|
2082
|
+
y = e.map(nr), x = function(e) {
|
|
1970
2083
|
let t = u.filter((t) => t.id !== e);
|
|
1971
2084
|
n.setColumnFilters(t), t.length === 0 && r.actions.closeFilterPanel();
|
|
1972
2085
|
}, g = function(e, t) {
|
|
1973
|
-
let i =
|
|
2086
|
+
let i = $n(u.find((t) => t.id === e)?.value), a = n.getColumn(t), o = a ? Cn(a) : ft("string"), s = er(o) === er(i.operator) ? i.value : gt(o);
|
|
1974
2087
|
n.setColumnFilters(u.filter((e) => e.id !== t).map((n) => n.id === e ? {
|
|
1975
2088
|
id: t,
|
|
1976
2089
|
value: {
|
|
@@ -1984,14 +2097,14 @@ function $n() {
|
|
|
1984
2097
|
n.setColumnFilters(u.map((n) => n.id === e ? {
|
|
1985
2098
|
...n,
|
|
1986
2099
|
value: {
|
|
1987
|
-
|
|
2100
|
+
...$n(n.value),
|
|
1988
2101
|
...t
|
|
1989
2102
|
}
|
|
1990
2103
|
} : n));
|
|
1991
2104
|
}, t[15] = u, t[16] = n, t[17] = i) : i = t[17], b = i;
|
|
1992
2105
|
let a;
|
|
1993
2106
|
t[18] !== u || t[19] !== b ? (a = function(e, t) {
|
|
1994
|
-
let n =
|
|
2107
|
+
let n = $n(u.find((t) => t.id === e)?.value), r = er(t) === er(n.operator) ? n.value : gt(t);
|
|
1995
2108
|
b(e, {
|
|
1996
2109
|
operator: t,
|
|
1997
2110
|
value: r
|
|
@@ -2003,7 +2116,7 @@ function $n() {
|
|
|
2003
2116
|
}, t[21] = n, t[22] = r.actions, t[23] = o) : o = t[23], v = o, h = function() {
|
|
2004
2117
|
let t = e.find((e) => !u.some((t) => t.id === e.id));
|
|
2005
2118
|
if (!t) return;
|
|
2006
|
-
let r =
|
|
2119
|
+
let r = Cn(t);
|
|
2007
2120
|
n.setColumnFilters([...u, {
|
|
2008
2121
|
id: t.id,
|
|
2009
2122
|
value: {
|
|
@@ -2043,22 +2156,22 @@ function $n() {
|
|
|
2043
2156
|
}), t[32] = a.closeFilters, t[33] = r.actions.closeFilterPanel, t[34] = N) : N = t[34];
|
|
2044
2157
|
let P;
|
|
2045
2158
|
t[35] !== A || t[36] !== N ? (P = /* @__PURE__ */ Y("div", {
|
|
2046
|
-
className:
|
|
2159
|
+
className: qn.filterPanelHeader,
|
|
2047
2160
|
children: [A, N]
|
|
2048
2161
|
}), t[35] = A, t[36] = N, t[37] = P) : P = t[37];
|
|
2049
2162
|
let F;
|
|
2050
2163
|
if (t[38] !== g || t[39] !== _ || t[40] !== u || t[41] !== y || t[42] !== o || t[43] !== a || t[44] !== b || t[45] !== x || t[46] !== n) {
|
|
2051
2164
|
let e;
|
|
2052
2165
|
t[48] !== g || t[49] !== _ || t[50] !== y || t[51] !== o || t[52] !== a || t[53] !== b || t[54] !== x || t[55] !== n ? (e = (e) => {
|
|
2053
|
-
let t = n.getColumn(e.id), r =
|
|
2166
|
+
let t = n.getColumn(e.id), r = $n(e.value), i = t ? Sn(t) : "string", s = pt(r.operator), c = typeof r.value == "string" ? r.value : "", u = t && (t.columnDef.meta?.options !== void 0 || i === "select" || i === "multiSelect") ? Yn({
|
|
2054
2167
|
table: n,
|
|
2055
2168
|
column: t,
|
|
2056
2169
|
fallback: "faceted"
|
|
2057
|
-
}) : [], d = (t === void 0 ? void 0 :
|
|
2170
|
+
}) : [], d = (t === void 0 ? void 0 : wn(t)) ?? Zn;
|
|
2058
2171
|
return /* @__PURE__ */ Y("div", {
|
|
2059
2172
|
"data-dg-part": "filter-row",
|
|
2060
2173
|
"data-column-id": e.id,
|
|
2061
|
-
className:
|
|
2174
|
+
className: qn.filterRow,
|
|
2062
2175
|
children: [
|
|
2063
2176
|
/* @__PURE__ */ J(l, {
|
|
2064
2177
|
variant: "subtle",
|
|
@@ -2141,7 +2254,7 @@ function $n() {
|
|
|
2141
2254
|
}), t[61] = v, t[62] = a.clearAllFilters, t[63] = R, t[64] = z) : z = t[64];
|
|
2142
2255
|
let B;
|
|
2143
2256
|
t[65] !== L || t[66] !== z ? (B = /* @__PURE__ */ Y("div", {
|
|
2144
|
-
className:
|
|
2257
|
+
className: qn.filterPanelFooter,
|
|
2145
2258
|
children: [L, z]
|
|
2146
2259
|
}), t[65] = L, t[66] = z, t[67] = B) : B = t[67];
|
|
2147
2260
|
let V;
|
|
@@ -2155,60 +2268,60 @@ function $n() {
|
|
|
2155
2268
|
role: "group",
|
|
2156
2269
|
"aria-label": O,
|
|
2157
2270
|
"data-dg-part": "filter-panel",
|
|
2158
|
-
className:
|
|
2271
|
+
className: qn.filterPanel,
|
|
2159
2272
|
onKeyDown: k,
|
|
2160
2273
|
children: [P, V]
|
|
2161
2274
|
}), t[71] = a.filters, t[72] = V, t[73] = k, t[74] = P, t[75] = H) : H = t[75], H;
|
|
2162
2275
|
}
|
|
2163
|
-
function
|
|
2276
|
+
function nr(e) {
|
|
2164
2277
|
return {
|
|
2165
2278
|
value: e.id,
|
|
2166
|
-
label:
|
|
2279
|
+
label: xn(e)
|
|
2167
2280
|
};
|
|
2168
2281
|
}
|
|
2169
|
-
function
|
|
2282
|
+
function rr(e) {
|
|
2170
2283
|
return e.getCanFilter();
|
|
2171
2284
|
}
|
|
2172
|
-
function
|
|
2285
|
+
function ir(e) {
|
|
2173
2286
|
return e.columnFilters;
|
|
2174
2287
|
}
|
|
2175
|
-
function
|
|
2288
|
+
function ar(e) {
|
|
2176
2289
|
return e.filterPanelOpen;
|
|
2177
2290
|
}
|
|
2178
|
-
var
|
|
2291
|
+
var or = {
|
|
2179
2292
|
filterPills: "_filterPills_14wl0_3",
|
|
2180
2293
|
pill: "_pill_14wl0_15",
|
|
2181
2294
|
pillLabel: "_pillLabel_14wl0_27"
|
|
2182
2295
|
};
|
|
2183
|
-
function
|
|
2296
|
+
function sr(e) {
|
|
2184
2297
|
if (typeof e != "object" || !e) return !1;
|
|
2185
2298
|
let t = e.fuzzyRank;
|
|
2186
2299
|
return typeof t == "object" && !!t && typeof t.rank == "number";
|
|
2187
2300
|
}
|
|
2188
|
-
function
|
|
2301
|
+
function cr(e, t, n, r) {
|
|
2189
2302
|
let i = qe(String(e.getValue(t) ?? ""), String(n));
|
|
2190
2303
|
return r?.({ fuzzyRank: i }), i.passed;
|
|
2191
2304
|
}
|
|
2192
|
-
function
|
|
2305
|
+
function lr(e) {
|
|
2193
2306
|
let t = null, { columnFiltersMeta: n } = e;
|
|
2194
|
-
for (let e of Object.values(n ?? {}))
|
|
2307
|
+
for (let e of Object.values(n ?? {})) sr(e) && (t === null || e.fuzzyRank.rank > t.rank) && (t = e.fuzzyRank);
|
|
2195
2308
|
return t;
|
|
2196
2309
|
}
|
|
2197
|
-
function
|
|
2310
|
+
function ur(e) {
|
|
2198
2311
|
let { globalFilterFn: t } = e.options;
|
|
2199
2312
|
if (t !== "tmDataGridFuzzy") return !1;
|
|
2200
2313
|
let n = e.store.state;
|
|
2201
2314
|
return (n.sorting?.length ?? 0) === 0 && (n.grouping?.length ?? 0) === 0 && typeof n.globalFilter == "string" && n.globalFilter.trim() !== "";
|
|
2202
2315
|
}
|
|
2203
|
-
function
|
|
2316
|
+
function dr() {
|
|
2204
2317
|
let e = Ne();
|
|
2205
2318
|
return (t) => {
|
|
2206
2319
|
let n = e(t), r = null, i = null;
|
|
2207
2320
|
return () => {
|
|
2208
2321
|
let e = n();
|
|
2209
|
-
return
|
|
2322
|
+
return ur(t) ? e === r && i !== null ? i : (i = {
|
|
2210
2323
|
rows: [...e.rows].sort((e, t) => {
|
|
2211
|
-
let n =
|
|
2324
|
+
let n = lr(e), r = lr(t);
|
|
2212
2325
|
return n !== null && r !== null ? Ke(n, r) : n === null ? r === null ? 0 : 1 : -1;
|
|
2213
2326
|
}),
|
|
2214
2327
|
flatRows: e.flatRows,
|
|
@@ -2219,7 +2332,7 @@ function lr() {
|
|
|
2219
2332
|
}
|
|
2220
2333
|
//#endregion
|
|
2221
2334
|
//#region src/tmdatagrid/core/labels.ts
|
|
2222
|
-
var
|
|
2335
|
+
var fr = {
|
|
2223
2336
|
operators: et,
|
|
2224
2337
|
manageColumns: "Manage columns",
|
|
2225
2338
|
filters: "Filters",
|
|
@@ -2310,32 +2423,32 @@ var ur = {
|
|
|
2310
2423
|
expandGroup: (e) => `Expand ${e}`,
|
|
2311
2424
|
collapseGroup: (e) => `Collapse ${e}`
|
|
2312
2425
|
};
|
|
2313
|
-
function
|
|
2426
|
+
function pr(e) {
|
|
2314
2427
|
return e ? {
|
|
2315
|
-
...
|
|
2428
|
+
...fr,
|
|
2316
2429
|
...e,
|
|
2317
2430
|
operators: {
|
|
2318
|
-
...
|
|
2431
|
+
...fr.operators,
|
|
2319
2432
|
...e.operators
|
|
2320
2433
|
}
|
|
2321
|
-
} :
|
|
2434
|
+
} : fr;
|
|
2322
2435
|
}
|
|
2323
2436
|
//#endregion
|
|
2324
2437
|
//#region src/tmdatagrid/core/persistence.ts
|
|
2325
|
-
var
|
|
2438
|
+
var mr = [
|
|
2326
2439
|
"columnFilters",
|
|
2327
2440
|
"globalFilter",
|
|
2328
2441
|
"sorting",
|
|
2329
2442
|
"pagination",
|
|
2330
2443
|
"expanded"
|
|
2331
|
-
],
|
|
2444
|
+
], hr = [
|
|
2332
2445
|
"columnVisibility",
|
|
2333
2446
|
"columnSizing",
|
|
2334
2447
|
"columnOrder",
|
|
2335
2448
|
"columnPinning",
|
|
2336
2449
|
"grouping"
|
|
2337
|
-
],
|
|
2338
|
-
function
|
|
2450
|
+
], gr = 1, _r = "__v";
|
|
2451
|
+
function vr(e, t) {
|
|
2339
2452
|
if (!e) return null;
|
|
2340
2453
|
if (typeof e == "string") return {
|
|
2341
2454
|
key: e,
|
|
@@ -2347,7 +2460,7 @@ function gr(e, t) {
|
|
|
2347
2460
|
slices: r
|
|
2348
2461
|
} : null;
|
|
2349
2462
|
}
|
|
2350
|
-
function
|
|
2463
|
+
function yr(e) {
|
|
2351
2464
|
if (!e) return null;
|
|
2352
2465
|
try {
|
|
2353
2466
|
return typeof window > "u" ? null : e.storageMode === "sessionStorage" ? window.sessionStorage : window.localStorage;
|
|
@@ -2355,36 +2468,36 @@ function _r(e) {
|
|
|
2355
2468
|
return null;
|
|
2356
2469
|
}
|
|
2357
2470
|
}
|
|
2358
|
-
function
|
|
2471
|
+
function br(e, t) {
|
|
2359
2472
|
return typeof e == "object" && e ? e[t] : void 0;
|
|
2360
2473
|
}
|
|
2361
|
-
var
|
|
2362
|
-
function
|
|
2474
|
+
var xr = (e) => typeof e == "string", Sr = (e) => typeof e == "number" && Number.isFinite(e);
|
|
2475
|
+
function Cr(e, t) {
|
|
2363
2476
|
return Array.isArray(e) && e.every(t);
|
|
2364
2477
|
}
|
|
2365
|
-
function
|
|
2478
|
+
function wr(e, t) {
|
|
2366
2479
|
return typeof e != "object" || !e || Array.isArray(e) ? !1 : Object.values(e).every(t);
|
|
2367
2480
|
}
|
|
2368
|
-
var
|
|
2369
|
-
columnFilters: (e) =>
|
|
2481
|
+
var Tr = (e) => xr(br(e, "id")), Er = {
|
|
2482
|
+
columnFilters: (e) => Cr(e, Tr),
|
|
2370
2483
|
globalFilter: () => !0,
|
|
2371
|
-
sorting: (e) =>
|
|
2484
|
+
sorting: (e) => Cr(e, (e) => Tr(e) && typeof br(e, "desc") == "boolean"),
|
|
2372
2485
|
pagination: (e) => {
|
|
2373
|
-
let t =
|
|
2374
|
-
return
|
|
2486
|
+
let t = br(e, "pageIndex"), n = br(e, "pageSize");
|
|
2487
|
+
return Sr(t) && t >= 0 && Sr(n) && n > 0;
|
|
2375
2488
|
},
|
|
2376
|
-
expanded: (e) => e === !0 ||
|
|
2377
|
-
columnVisibility: (e) =>
|
|
2378
|
-
columnSizing: (e) =>
|
|
2379
|
-
columnOrder: (e) =>
|
|
2380
|
-
columnPinning: (e) =>
|
|
2381
|
-
grouping: (e) =>
|
|
2489
|
+
expanded: (e) => e === !0 || wr(e, (e) => typeof e == "boolean"),
|
|
2490
|
+
columnVisibility: (e) => wr(e, (e) => typeof e == "boolean"),
|
|
2491
|
+
columnSizing: (e) => wr(e, Sr),
|
|
2492
|
+
columnOrder: (e) => Cr(e, xr),
|
|
2493
|
+
columnPinning: (e) => Cr(br(e, "left"), xr) && Cr(br(e, "right"), xr),
|
|
2494
|
+
grouping: (e) => Cr(e, xr)
|
|
2382
2495
|
};
|
|
2383
|
-
function
|
|
2384
|
-
let n =
|
|
2496
|
+
function Dr(e, t) {
|
|
2497
|
+
let n = Er[e];
|
|
2385
2498
|
return n === void 0 || n(t);
|
|
2386
2499
|
}
|
|
2387
|
-
function
|
|
2500
|
+
function Or(e, t, n) {
|
|
2388
2501
|
if (!e || !t) return {};
|
|
2389
2502
|
try {
|
|
2390
2503
|
let r = e.getItem(t.key);
|
|
@@ -2392,39 +2505,39 @@ function Er(e, t, n) {
|
|
|
2392
2505
|
let i = n(r);
|
|
2393
2506
|
if (typeof i != "object" || !i) return {};
|
|
2394
2507
|
let a = i;
|
|
2395
|
-
if (a[
|
|
2508
|
+
if (a[_r] !== 1) return {};
|
|
2396
2509
|
let o = {};
|
|
2397
|
-
for (let e of t.slices) e in a &&
|
|
2510
|
+
for (let e of t.slices) e in a && Dr(e, a[e]) && (o[e] = a[e]);
|
|
2398
2511
|
return o;
|
|
2399
2512
|
} catch {
|
|
2400
2513
|
return {};
|
|
2401
2514
|
}
|
|
2402
2515
|
}
|
|
2403
|
-
function
|
|
2516
|
+
function kr(e, t, n, r) {
|
|
2404
2517
|
if (!e || !t) return;
|
|
2405
|
-
let i = { [
|
|
2518
|
+
let i = { [_r]: 1 };
|
|
2406
2519
|
for (let e of t.slices) i[e] = n[e];
|
|
2407
2520
|
try {
|
|
2408
2521
|
e.setItem(t.key, r(i));
|
|
2409
2522
|
} catch {}
|
|
2410
2523
|
}
|
|
2411
|
-
function
|
|
2524
|
+
function Ar(e) {
|
|
2412
2525
|
return {
|
|
2413
|
-
data:
|
|
2414
|
-
settings:
|
|
2526
|
+
data: vr(e?.dataKey, mr),
|
|
2527
|
+
settings: vr(e?.settingsKey, hr)
|
|
2415
2528
|
};
|
|
2416
2529
|
}
|
|
2417
|
-
function
|
|
2418
|
-
let { data: t, settings: n } =
|
|
2530
|
+
function jr(e) {
|
|
2531
|
+
let { data: t, settings: n } = Ar(e);
|
|
2419
2532
|
return t !== null || n !== null;
|
|
2420
2533
|
}
|
|
2421
|
-
var
|
|
2422
|
-
function
|
|
2534
|
+
var Mr = (e) => JSON.parse(e), Nr = (e) => JSON.stringify(e);
|
|
2535
|
+
function Pr(e, t = []) {
|
|
2423
2536
|
for (let n of e) {
|
|
2424
2537
|
if (typeof n != "object" || !n) continue;
|
|
2425
2538
|
let e = n;
|
|
2426
2539
|
if (Array.isArray(e.columns) && e.columns.length > 0) {
|
|
2427
|
-
|
|
2540
|
+
Pr(e.columns, t);
|
|
2428
2541
|
continue;
|
|
2429
2542
|
}
|
|
2430
2543
|
let r = typeof e.accessorKey == "string" ? e.accessorKey : void 0, i = (typeof e.id == "string" ? e.id : void 0) ?? r?.replaceAll(".", "_") ?? (typeof e.header == "string" ? e.header : void 0);
|
|
@@ -2432,29 +2545,29 @@ function Mr(e, t = []) {
|
|
|
2432
2545
|
}
|
|
2433
2546
|
return t;
|
|
2434
2547
|
}
|
|
2435
|
-
function
|
|
2548
|
+
function Fr(e, t) {
|
|
2436
2549
|
let n = (e) => typeof e == "string" && t.has(e), r = (e) => e.filter(n), i = (e) => Object.fromEntries(Object.entries(e).filter(([e]) => n(e))), a = (e) => e.filter((e) => n(e.id)), o = { ...e };
|
|
2437
2550
|
return e.columnOrder && (o.columnOrder = r(e.columnOrder)), e.grouping && (o.grouping = r(e.grouping)), e.columnVisibility && (o.columnVisibility = i(e.columnVisibility)), e.columnSizing && (o.columnSizing = i(e.columnSizing)), e.columnPinning && (o.columnPinning = {
|
|
2438
2551
|
left: r(e.columnPinning.left ?? []),
|
|
2439
2552
|
right: r(e.columnPinning.right ?? [])
|
|
2440
2553
|
}), e.sorting && (o.sorting = a(e.sorting)), e.columnFilters && (o.columnFilters = a(e.columnFilters)), o;
|
|
2441
2554
|
}
|
|
2442
|
-
function
|
|
2443
|
-
let n =
|
|
2444
|
-
...
|
|
2445
|
-
...
|
|
2555
|
+
function Ir(e, t) {
|
|
2556
|
+
let n = yr(e), { data: r, settings: i } = Ar(e), a = e?.deserialize ?? Mr, o = {
|
|
2557
|
+
...Or(n, i, a),
|
|
2558
|
+
...Or(n, r, a)
|
|
2446
2559
|
};
|
|
2447
|
-
return t === void 0 ? o :
|
|
2560
|
+
return t === void 0 ? o : Fr(o, new Set(t));
|
|
2448
2561
|
}
|
|
2449
|
-
function
|
|
2450
|
-
let n =
|
|
2562
|
+
function Lr(e, t) {
|
|
2563
|
+
let n = yr(t);
|
|
2451
2564
|
if (!n) return;
|
|
2452
|
-
let { data: r, settings: i } =
|
|
2453
|
-
|
|
2565
|
+
let { data: r, settings: i } = Ar(t), a = t?.serialize ?? Nr;
|
|
2566
|
+
kr(n, r, e, a), kr(n, i, e, a);
|
|
2454
2567
|
}
|
|
2455
2568
|
//#endregion
|
|
2456
2569
|
//#region src/tmdatagrid/core/capabilities.ts
|
|
2457
|
-
function
|
|
2570
|
+
function Rr(e) {
|
|
2458
2571
|
let t = e.selectionMode ?? "checkbox", n = e.cellSelection ?? (e.editing === void 0 ? "none" : "single"), r = t !== "highlight" && e.enableRowSelection !== !1;
|
|
2459
2572
|
return {
|
|
2460
2573
|
sorting: e.enableSorting !== !1,
|
|
@@ -2485,19 +2598,19 @@ function Ir(e) {
|
|
|
2485
2598
|
matchHighlighting: e.enableMatchHighlighting === !0
|
|
2486
2599
|
};
|
|
2487
2600
|
}
|
|
2488
|
-
function
|
|
2601
|
+
function zr(e, t) {
|
|
2489
2602
|
return {
|
|
2490
2603
|
canSort: t.sorting && e.getCanSort(),
|
|
2491
2604
|
canFilter: t.filtering && e.getCanFilter(),
|
|
2492
2605
|
canHide: t.hiding && e.getCanHide(),
|
|
2493
2606
|
canPin: t.pinning && e.getCanPin(),
|
|
2494
2607
|
canResize: t.resizing && e.getCanResize(),
|
|
2495
|
-
canReorder: t.ordering &&
|
|
2608
|
+
canReorder: t.ordering && An(e),
|
|
2496
2609
|
canGroup: t.grouping && e.getCanGroup()
|
|
2497
2610
|
};
|
|
2498
2611
|
}
|
|
2499
|
-
function
|
|
2500
|
-
let n = e.getAllLeafColumns(), r = (e) => n.some((n) => e(
|
|
2612
|
+
function Br(e, t) {
|
|
2613
|
+
let n = e.getAllLeafColumns(), r = (e) => n.some((n) => e(zr(n, t)));
|
|
2501
2614
|
return {
|
|
2502
2615
|
canSortAny: r((e) => e.canSort),
|
|
2503
2616
|
canFilterAny: r((e) => e.canFilter),
|
|
@@ -2512,12 +2625,12 @@ function Rr(e, t) {
|
|
|
2512
2625
|
}
|
|
2513
2626
|
//#endregion
|
|
2514
2627
|
//#region src/tmdatagrid/core/cellNavigation.ts
|
|
2515
|
-
var
|
|
2516
|
-
function
|
|
2628
|
+
var Vr = (e, t) => Math.min(Math.max(e, 0), Math.max(t, 0));
|
|
2629
|
+
function Hr({ key: e, ctrlKey: t, from: n, rowCount: r, columnCount: i, pageRows: a }) {
|
|
2517
2630
|
if (r === 0 || i === 0) return null;
|
|
2518
2631
|
let o = r - 1, s = i - 1, c = (e, t) => ({
|
|
2519
|
-
rowIndex:
|
|
2520
|
-
columnIndex:
|
|
2632
|
+
rowIndex: Vr(e, o),
|
|
2633
|
+
columnIndex: Vr(t, s)
|
|
2521
2634
|
});
|
|
2522
2635
|
switch (e) {
|
|
2523
2636
|
case "ArrowDown": return c(n.rowIndex + 1, n.columnIndex);
|
|
@@ -2531,7 +2644,7 @@ function Br({ key: e, ctrlKey: t, from: n, rowCount: r, columnCount: i, pageRows
|
|
|
2531
2644
|
default: return null;
|
|
2532
2645
|
}
|
|
2533
2646
|
}
|
|
2534
|
-
function
|
|
2647
|
+
function Ur({ from: e, direction: t, rowCount: n, columnCount: r, isEditable: i }) {
|
|
2535
2648
|
let a = n * r;
|
|
2536
2649
|
if (a === 0) return null;
|
|
2537
2650
|
let o = e.rowIndex * r + e.columnIndex;
|
|
@@ -2544,12 +2657,12 @@ function Vr({ from: e, direction: t, rowCount: n, columnCount: r, isEditable: i
|
|
|
2544
2657
|
}
|
|
2545
2658
|
return null;
|
|
2546
2659
|
}
|
|
2547
|
-
function
|
|
2660
|
+
function Wr(e, t) {
|
|
2548
2661
|
return e === null || t === null ? e === t : e.rowId === t.rowId && e.columnId === t.columnId;
|
|
2549
2662
|
}
|
|
2550
2663
|
//#endregion
|
|
2551
2664
|
//#region src/tmdatagrid/core/controlledState.ts
|
|
2552
|
-
var
|
|
2665
|
+
var Gr = {
|
|
2553
2666
|
columnFilters: "onColumnFiltersChange",
|
|
2554
2667
|
columnOrder: "onColumnOrderChange",
|
|
2555
2668
|
columnPinning: "onColumnPinningChange",
|
|
@@ -2563,52 +2676,52 @@ var Ur = {
|
|
|
2563
2676
|
rowPinning: "onRowPinningChange",
|
|
2564
2677
|
rowSelection: "onRowSelectionChange",
|
|
2565
2678
|
sorting: "onSortingChange"
|
|
2566
|
-
},
|
|
2567
|
-
function
|
|
2679
|
+
}, Kr = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
2680
|
+
function qr(e) {
|
|
2568
2681
|
if (typeof e != "object" || !e) return !1;
|
|
2569
2682
|
let t = Object.getPrototypeOf(e);
|
|
2570
2683
|
return t === Object.prototype || t === null;
|
|
2571
2684
|
}
|
|
2572
|
-
function
|
|
2685
|
+
function Jr(e, t) {
|
|
2573
2686
|
if (Object.is(e, t)) return !0;
|
|
2574
2687
|
if (e instanceof Date || t instanceof Date) return e instanceof Date && t instanceof Date && e.getTime() === t.getTime();
|
|
2575
|
-
if (Array.isArray(e) || Array.isArray(t)) return !Array.isArray(e) || !Array.isArray(t) ? !1 : e.length === t.length && e.every((e, n) =>
|
|
2576
|
-
if (!
|
|
2688
|
+
if (Array.isArray(e) || Array.isArray(t)) return !Array.isArray(e) || !Array.isArray(t) ? !1 : e.length === t.length && e.every((e, n) => Jr(e, t[n]));
|
|
2689
|
+
if (!qr(e) || !qr(t)) return !1;
|
|
2577
2690
|
let n = Object.keys(e);
|
|
2578
|
-
return n.length === Object.keys(t).length && n.every((n) =>
|
|
2691
|
+
return n.length === Object.keys(t).length && n.every((n) => Kr(t, n) && Jr(e[n], t[n]));
|
|
2579
2692
|
}
|
|
2580
|
-
function
|
|
2693
|
+
function Yr(e) {
|
|
2581
2694
|
if (e === void 0 || !Object.values(e).includes(void 0)) return e;
|
|
2582
2695
|
let t = {};
|
|
2583
2696
|
for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
|
|
2584
2697
|
return t;
|
|
2585
2698
|
}
|
|
2586
|
-
function
|
|
2699
|
+
function Xr(e, t) {
|
|
2587
2700
|
if (e === void 0 || t === void 0 || e === t) return e;
|
|
2588
2701
|
let n = Object.keys(e), r = {}, i = n.length !== Object.keys(t).length;
|
|
2589
2702
|
for (let a of n) {
|
|
2590
2703
|
let n = e[a], o = t[a];
|
|
2591
|
-
|
|
2704
|
+
Kr(t, a) && Jr(n, o) ? r[a] = o : (r[a] = n, i = !0);
|
|
2592
2705
|
}
|
|
2593
2706
|
return i ? r : t;
|
|
2594
2707
|
}
|
|
2595
|
-
function
|
|
2708
|
+
function Zr(e) {
|
|
2596
2709
|
let t = e.state;
|
|
2597
|
-
return t === void 0 ? [] : Object.entries(
|
|
2710
|
+
return t === void 0 ? [] : Object.entries(Gr).filter(([n, r]) => t[n] !== void 0 && e[r] === void 0 && e.atoms?.[n] === void 0).map(([e, t]) => ({
|
|
2598
2711
|
slice: e,
|
|
2599
2712
|
handler: t
|
|
2600
2713
|
}));
|
|
2601
2714
|
}
|
|
2602
2715
|
//#endregion
|
|
2603
2716
|
//#region src/tmdatagrid/useTMDataGrid.tsx
|
|
2604
|
-
var
|
|
2717
|
+
var Qr = 200, $r = We({
|
|
2605
2718
|
columnFilteringFeature: be,
|
|
2606
2719
|
globalFilteringFeature: Ie,
|
|
2607
2720
|
rowSortingFeature: He,
|
|
2608
2721
|
rowPaginationFeature: ze,
|
|
2609
2722
|
rowSelectionFeature: Ve,
|
|
2610
2723
|
columnPinningFeature: Ce,
|
|
2611
|
-
columnVisibilityFeature:
|
|
2724
|
+
columnVisibilityFeature: Ee,
|
|
2612
2725
|
columnOrderingFeature: Se,
|
|
2613
2726
|
columnSizingFeature: Te,
|
|
2614
2727
|
columnResizingFeature: we,
|
|
@@ -2618,7 +2731,7 @@ var Xr = 200, Zr = We({
|
|
|
2618
2731
|
rowPinningFeature: Be,
|
|
2619
2732
|
filteredRowModel: Ae(),
|
|
2620
2733
|
groupedRowModel: je(),
|
|
2621
|
-
sortedRowModel:
|
|
2734
|
+
sortedRowModel: dr(),
|
|
2622
2735
|
expandedRowModel: Z(),
|
|
2623
2736
|
paginatedRowModel: Me(),
|
|
2624
2737
|
facetedRowModel: Oe(),
|
|
@@ -2627,26 +2740,26 @@ var Xr = 200, Zr = We({
|
|
|
2627
2740
|
filterFns: {
|
|
2628
2741
|
...Pe,
|
|
2629
2742
|
tmDataGrid: wt,
|
|
2630
|
-
tmDataGridFuzzy:
|
|
2743
|
+
tmDataGridFuzzy: cr
|
|
2631
2744
|
},
|
|
2632
2745
|
sortFns: Ue,
|
|
2633
2746
|
aggregationFns: ve,
|
|
2634
2747
|
tableMeta: Le(),
|
|
2635
2748
|
columnMeta: Le()
|
|
2636
2749
|
});
|
|
2637
|
-
function
|
|
2638
|
-
return
|
|
2750
|
+
function ei() {
|
|
2751
|
+
return X();
|
|
2639
2752
|
}
|
|
2640
|
-
var
|
|
2641
|
-
function
|
|
2753
|
+
var ti = 160, ni = 6;
|
|
2754
|
+
function ri(e) {
|
|
2642
2755
|
let t = { ...e };
|
|
2643
|
-
for (let e of Object.keys(t))
|
|
2756
|
+
for (let e of Object.keys(t)) On(e) && delete t[e];
|
|
2644
2757
|
return t;
|
|
2645
2758
|
}
|
|
2646
|
-
function
|
|
2759
|
+
function ii(e) {
|
|
2647
2760
|
return e.map((e) => "columns" in e && Array.isArray(e.columns) ? {
|
|
2648
2761
|
...e,
|
|
2649
|
-
columns:
|
|
2762
|
+
columns: ii(e.columns)
|
|
2650
2763
|
} : {
|
|
2651
2764
|
filterFn: "tmDataGrid",
|
|
2652
2765
|
aggregationFn: void 0,
|
|
@@ -2654,8 +2767,8 @@ function ni(e) {
|
|
|
2654
2767
|
...e
|
|
2655
2768
|
});
|
|
2656
2769
|
}
|
|
2657
|
-
function
|
|
2658
|
-
let x = g?.mode, S = g?.draft === !0, C =
|
|
2770
|
+
function ai({ persist: e, labels: t, enableColumnOrdering: r, enablePagination: a, enableRowNumbers: l, selectionMode: u, showSelectedBackground: d, defaultHighlightedRowId: f, onHighlightedRowChange: p, cellSelection: m, onFocusedCellChange: h, editing: g, renderDetails: _, renderDetailsEstHeight: v = ti, overscan: y = ni, ...b }) {
|
|
2771
|
+
let x = g?.mode, S = g?.draft === !0, C = Rr({
|
|
2659
2772
|
...b,
|
|
2660
2773
|
enableColumnOrdering: r,
|
|
2661
2774
|
enablePagination: a,
|
|
@@ -2664,15 +2777,15 @@ function ri({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2664
2777
|
showSelectedBackground: d,
|
|
2665
2778
|
cellSelection: m,
|
|
2666
2779
|
editing: g
|
|
2667
|
-
}), w = o(() =>
|
|
2668
|
-
let e =
|
|
2780
|
+
}), w = o(() => pr(t), [t]), T = b.enableColumnPinning !== !1, E = C.selectColumn, D = C.grouping, O = _ !== void 0, k = g !== void 0 && (g.mode === "row" || S || g.onRowDelete !== void 0), j = w.selectColumnLabel, M = w.groupColumnLabel, N = w.detailsColumnLabel, P = w.editColumnLabel, F = w.rowNumberColumnLabel, I = C.rowNumbers, L = S, R = o(() => {
|
|
2781
|
+
let e = ii(b.columns);
|
|
2669
2782
|
return [
|
|
2670
|
-
...I ? [
|
|
2671
|
-
...E ? [
|
|
2672
|
-
...D ? [
|
|
2783
|
+
...I ? [un(F)] : [],
|
|
2784
|
+
...E ? [bn(j)] : [],
|
|
2785
|
+
...D ? [cn(M)] : [],
|
|
2673
2786
|
...O ? [Nt(N)] : [],
|
|
2674
2787
|
...e,
|
|
2675
|
-
...k ? [
|
|
2788
|
+
...k ? [Zt(P, L)] : []
|
|
2676
2789
|
];
|
|
2677
2790
|
}, [
|
|
2678
2791
|
b.columns,
|
|
@@ -2687,15 +2800,15 @@ function ri({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2687
2800
|
M,
|
|
2688
2801
|
N,
|
|
2689
2802
|
P
|
|
2690
|
-
]), [z] = c(() =>
|
|
2803
|
+
]), [z] = c(() => Ir(e, Pr(R))), B = z.grouping ?? b.initialState?.grouping ?? [], V = s((b.state?.grouping ?? B).length > 0), H = Yr(b.state), ee = H?.columnVisibility, U = H !== void 0 && ee !== void 0 ? {
|
|
2691
2804
|
...H,
|
|
2692
2805
|
columnVisibility: {
|
|
2693
|
-
...
|
|
2694
|
-
...D ? { [
|
|
2806
|
+
...ri(ee),
|
|
2807
|
+
...D ? { [en]: V.current } : {}
|
|
2695
2808
|
}
|
|
2696
|
-
} : H,
|
|
2697
|
-
|
|
2698
|
-
let
|
|
2809
|
+
} : H, te = s(void 0), ne = s(!1), re = ne.current ? U : Xr(U, te.current);
|
|
2810
|
+
ne.current = !1, te.current = re;
|
|
2811
|
+
let ie = Ge({
|
|
2699
2812
|
columnResizeMode: "onChange",
|
|
2700
2813
|
enableSorting: !0,
|
|
2701
2814
|
enableColumnResizing: !0,
|
|
@@ -2704,28 +2817,28 @@ function ri({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2704
2817
|
...b,
|
|
2705
2818
|
..._ === void 0 ? {} : { getRowCanExpand: b.getRowCanExpand ?? (() => !0) },
|
|
2706
2819
|
enableRowPinning: (e) => !e.getIsGrouped() && (typeof b.enableRowPinning == "function" ? b.enableRowPinning(e) : b.enableRowPinning === !0),
|
|
2707
|
-
features:
|
|
2820
|
+
features: $r,
|
|
2708
2821
|
columns: R,
|
|
2709
|
-
state:
|
|
2822
|
+
state: re,
|
|
2710
2823
|
initialState: {
|
|
2711
2824
|
...b.initialState,
|
|
2712
2825
|
...z,
|
|
2713
2826
|
columnVisibility: {
|
|
2714
|
-
...
|
|
2827
|
+
...ri({
|
|
2715
2828
|
...b.initialState?.columnVisibility,
|
|
2716
2829
|
...z.columnVisibility
|
|
2717
2830
|
}),
|
|
2718
|
-
...D ? { [
|
|
2831
|
+
...D ? { [en]: B.length > 0 } : {}
|
|
2719
2832
|
},
|
|
2720
2833
|
columnPinning: {
|
|
2721
2834
|
left: [
|
|
2722
|
-
...I && T ? [
|
|
2723
|
-
...E && T ? [
|
|
2724
|
-
...D && T ? [
|
|
2835
|
+
...I && T ? [ln] : [],
|
|
2836
|
+
...E && T ? [hn] : [],
|
|
2837
|
+
...D && T ? [en] : [],
|
|
2725
2838
|
...O && T ? [At] : [],
|
|
2726
2839
|
...(z.columnPinning?.left ?? b.initialState?.columnPinning?.left ?? []).filter((e) => e !== "__rowNumber__" && e !== "__select__" && e !== "__details__" && e !== "__group__")
|
|
2727
2840
|
],
|
|
2728
|
-
right: [...(z.columnPinning?.right ?? b.initialState?.columnPinning?.right ?? []).filter((e) => e !==
|
|
2841
|
+
right: [...(z.columnPinning?.right ?? b.initialState?.columnPinning?.right ?? []).filter((e) => e !== Jt), ...k && T ? [Jt] : []]
|
|
2729
2842
|
},
|
|
2730
2843
|
pagination: {
|
|
2731
2844
|
pageIndex: 0,
|
|
@@ -2736,10 +2849,12 @@ function ri({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2736
2849
|
}
|
|
2737
2850
|
}), ae = s(null);
|
|
2738
2851
|
ae.current = {
|
|
2739
|
-
table:
|
|
2852
|
+
table: ie,
|
|
2740
2853
|
editMode: x ?? "cell",
|
|
2741
2854
|
draft: S,
|
|
2742
2855
|
rowValidators: g?.rowValidators,
|
|
2856
|
+
tableValidators: g?.tableValidators,
|
|
2857
|
+
editableColumnIds: g?.columns,
|
|
2743
2858
|
isRowEditable: g?.isRowEditable,
|
|
2744
2859
|
onEditCommit: g?.onCommit,
|
|
2745
2860
|
onSaveDrafts: g?.onSaveDrafts ?? g?.onCommitDrafts,
|
|
@@ -2747,7 +2862,7 @@ function ri({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2747
2862
|
onRowAdd: g?.onRowAdd,
|
|
2748
2863
|
onRowDelete: g?.onRowDelete
|
|
2749
2864
|
};
|
|
2750
|
-
let [oe] = c(() =>
|
|
2865
|
+
let [oe] = c(() => Kt(() => ae.current)), se = s({
|
|
2751
2866
|
editMode: x,
|
|
2752
2867
|
editDraft: S
|
|
2753
2868
|
});
|
|
@@ -2764,33 +2879,33 @@ function ri({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2764
2879
|
]), i(() => {
|
|
2765
2880
|
g !== void 0 && b.getRowId === void 0 && console.error("TMDataGrid: editing requires getRowId - drafts are keyed by row id, and the index fallback names a different record after any sort or filter.");
|
|
2766
2881
|
}, []), i(() => {
|
|
2767
|
-
for (let { slice: e, handler: t } of
|
|
2882
|
+
for (let { slice: e, handler: t } of Zr(b)) console.warn(`TMDataGrid: state.${e} is controlled but no ${t} was passed - the slice cannot change. Add ${t}, or use initialState.${e} for a starting value.`);
|
|
2768
2883
|
}, []), i(() => {
|
|
2769
2884
|
if (!D) return;
|
|
2770
|
-
let e =
|
|
2771
|
-
V.current = e.length > 0,
|
|
2885
|
+
let e = ie.store.state.grouping;
|
|
2886
|
+
V.current = e.length > 0, ie.store.state.columnVisibility?.__group__ !== e.length > 0 && ie.setColumnVisibility((t) => ({
|
|
2772
2887
|
...t,
|
|
2773
|
-
[
|
|
2888
|
+
[en]: e.length > 0
|
|
2774
2889
|
}));
|
|
2775
|
-
let t =
|
|
2776
|
-
t.grouping !== e && (e = t.grouping, V.current = t.grouping.length > 0,
|
|
2890
|
+
let t = ie.store.subscribe((t) => {
|
|
2891
|
+
t.grouping !== e && (e = t.grouping, V.current = t.grouping.length > 0, ne.current = !0, ie.setColumnVisibility((e) => ({
|
|
2777
2892
|
...e,
|
|
2778
|
-
[
|
|
2779
|
-
})),
|
|
2893
|
+
[en]: t.grouping.length > 0
|
|
2894
|
+
})), ie.setColumnOrder((e) => [...e]));
|
|
2780
2895
|
});
|
|
2781
2896
|
return () => t.unsubscribe();
|
|
2782
|
-
}, [D,
|
|
2783
|
-
if (!
|
|
2784
|
-
|
|
2897
|
+
}, [D, ie]), i(() => {
|
|
2898
|
+
if (!jr(e)) return;
|
|
2899
|
+
Lr(ie.store.state, e);
|
|
2785
2900
|
let t, n = null, r = () => {
|
|
2786
|
-
t = void 0, n !== null && (
|
|
2787
|
-
}, i =
|
|
2788
|
-
n = e, t !== void 0 && clearTimeout(t), t = setTimeout(r,
|
|
2901
|
+
t = void 0, n !== null && (Lr(n, e), n = null);
|
|
2902
|
+
}, i = ie.store.subscribe((e) => {
|
|
2903
|
+
n = e, t !== void 0 && clearTimeout(t), t = setTimeout(r, Qr);
|
|
2789
2904
|
});
|
|
2790
2905
|
return () => {
|
|
2791
2906
|
i.unsubscribe(), t !== void 0 && clearTimeout(t), r();
|
|
2792
2907
|
};
|
|
2793
|
-
}, [e,
|
|
2908
|
+
}, [e, ie]);
|
|
2794
2909
|
let W = A({
|
|
2795
2910
|
filterPanelOpen: !1,
|
|
2796
2911
|
columnsPanelOpen: !1,
|
|
@@ -2835,11 +2950,11 @@ function ri({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2835
2950
|
...e,
|
|
2836
2951
|
selectionAnchorRowId: t
|
|
2837
2952
|
})),
|
|
2838
|
-
setFocusedCell: (t) => e((e) =>
|
|
2953
|
+
setFocusedCell: (t) => e((e) => Wr(e.focusedCell, t) ? e : {
|
|
2839
2954
|
...e,
|
|
2840
2955
|
focusedCell: t
|
|
2841
2956
|
}),
|
|
2842
|
-
setCellRange: (t) => e((e) =>
|
|
2957
|
+
setCellRange: (t) => e((e) => Wr(e.cellRange?.anchor ?? null, t?.anchor ?? null) && Wr(e.cellRange?.focus ?? null, t?.focus ?? null) ? e : {
|
|
2843
2958
|
...e,
|
|
2844
2959
|
cellRange: t
|
|
2845
2960
|
})
|
|
@@ -2864,23 +2979,23 @@ function ri({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2864
2979
|
let le = s(() => {});
|
|
2865
2980
|
le.current = () => {
|
|
2866
2981
|
let e = b.initialState, t = [...e?.grouping ?? []];
|
|
2867
|
-
|
|
2868
|
-
...
|
|
2869
|
-
...D ? { [
|
|
2870
|
-
}),
|
|
2982
|
+
ie.setGrouping(t), ie.setColumnVisibility({
|
|
2983
|
+
...ri({ ...e?.columnVisibility }),
|
|
2984
|
+
...D ? { [en]: t.length > 0 } : {}
|
|
2985
|
+
}), ie.setColumnSizing({ ...e?.columnSizing }), ie.setColumnOrder([...e?.columnOrder ?? []]), ie.setColumnPinning({
|
|
2871
2986
|
left: [
|
|
2872
|
-
...I && T ? [
|
|
2873
|
-
...E && T ? [
|
|
2874
|
-
...D && T ? [
|
|
2987
|
+
...I && T ? [ln] : [],
|
|
2988
|
+
...E && T ? [hn] : [],
|
|
2989
|
+
...D && T ? [en] : [],
|
|
2875
2990
|
...O && T ? [At] : [],
|
|
2876
2991
|
...(e?.columnPinning?.left ?? []).filter((e) => e !== "__rowNumber__" && e !== "__select__" && e !== "__details__" && e !== "__group__")
|
|
2877
2992
|
],
|
|
2878
|
-
right: [...(e?.columnPinning?.right ?? []).filter((e) => e !==
|
|
2993
|
+
right: [...(e?.columnPinning?.right ?? []).filter((e) => e !== Jt), ...k && T ? [Jt] : []]
|
|
2879
2994
|
});
|
|
2880
2995
|
};
|
|
2881
2996
|
let K = n(() => le.current(), []), q = s(() => !1);
|
|
2882
2997
|
return {
|
|
2883
|
-
table:
|
|
2998
|
+
table: ie,
|
|
2884
2999
|
ui: W,
|
|
2885
3000
|
edit: oe,
|
|
2886
3001
|
features: C,
|
|
@@ -2893,10 +3008,10 @@ function ri({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2893
3008
|
scrollerRef: q
|
|
2894
3009
|
};
|
|
2895
3010
|
}
|
|
2896
|
-
function
|
|
3011
|
+
function oi(e, t) {
|
|
2897
3012
|
let n = e.table.getColumn(t);
|
|
2898
3013
|
if (n && n.getFilterValue() === void 0) {
|
|
2899
|
-
let e =
|
|
3014
|
+
let e = Cn(n);
|
|
2900
3015
|
n.setFilterValue({
|
|
2901
3016
|
operator: e,
|
|
2902
3017
|
value: gt(e)
|
|
@@ -2906,24 +3021,24 @@ function ii(e, t) {
|
|
|
2906
3021
|
}
|
|
2907
3022
|
//#endregion
|
|
2908
3023
|
//#region src/tmdatagrid/components/TMDataGridFilterPills.tsx
|
|
2909
|
-
function
|
|
2910
|
-
let n = e(41), { api: r, size: i, showClearAll: a, onPillClick: o, className: s } = t, c = i === void 0 ? "sm" : i, l = a === void 0 || a, { table: u, labels: f } = r, p = j(u.store,
|
|
3024
|
+
function si(t) {
|
|
3025
|
+
let n = e(41), { api: r, size: i, showClearAll: a, onPillClick: o, className: s } = t, c = i === void 0 ? "sm" : i, l = a === void 0 || a, { table: u, labels: f } = r, p = j(u.store, li), m, h, g, _, v, b, x, S, C;
|
|
2911
3026
|
if (n[0] !== r || n[1] !== s || n[2] !== p || n[3] !== f || n[4] !== o || n[5] !== c || n[6] !== u) {
|
|
2912
3027
|
C = Symbol.for("react.early_return_sentinel");
|
|
2913
3028
|
bb0: {
|
|
2914
|
-
if (h = p.filter(
|
|
3029
|
+
if (h = p.filter(ci), h.length === 0) {
|
|
2915
3030
|
C = null;
|
|
2916
3031
|
break bb0;
|
|
2917
3032
|
}
|
|
2918
3033
|
v = "group", b = f.activeFilters, x = "filter-pills";
|
|
2919
3034
|
let e;
|
|
2920
|
-
n[16] === s ? e = n[17] : (e = [
|
|
3035
|
+
n[16] === s ? e = n[17] : (e = [or.filterPills, s].filter(Boolean), n[16] = s, n[17] = e), S = e.join(" "), m = y.Group, g = c;
|
|
2921
3036
|
let t;
|
|
2922
3037
|
n[18] !== r || n[19] !== p || n[20] !== f || n[21] !== o || n[22] !== c || n[23] !== u ? (t = (e) => {
|
|
2923
|
-
let t = u.getColumn(e.id), n = t ?
|
|
3038
|
+
let t = u.getColumn(e.id), n = t ? xn(t) : e.id, i = e.value;
|
|
2924
3039
|
return _t(i) ? /* @__PURE__ */ J(y, {
|
|
2925
3040
|
size: c,
|
|
2926
|
-
className:
|
|
3041
|
+
className: or.pill,
|
|
2927
3042
|
"data-dg-part": "filter-pill",
|
|
2928
3043
|
"data-column-id": e.id,
|
|
2929
3044
|
withRemoveButton: !0,
|
|
@@ -2934,11 +3049,11 @@ function ai(t) {
|
|
|
2934
3049
|
tabIndex: 0
|
|
2935
3050
|
},
|
|
2936
3051
|
children: /* @__PURE__ */ J(k, {
|
|
2937
|
-
className:
|
|
2938
|
-
onClick: () => o ? o(e.id) :
|
|
3052
|
+
className: or.pillLabel,
|
|
3053
|
+
onClick: () => o ? o(e.id) : oi(r, e.id),
|
|
2939
3054
|
children: yt({
|
|
2940
3055
|
label: n,
|
|
2941
|
-
type: t ?
|
|
3056
|
+
type: t ? Sn(t) : "string",
|
|
2942
3057
|
filter: i,
|
|
2943
3058
|
operatorLabels: f.operators
|
|
2944
3059
|
})
|
|
@@ -2971,16 +3086,16 @@ function ai(t) {
|
|
|
2971
3086
|
children: [w, T]
|
|
2972
3087
|
}), n[34] = w, n[35] = T, n[36] = v, n[37] = b, n[38] = x, n[39] = S, n[40] = E) : E = n[40], E;
|
|
2973
3088
|
}
|
|
2974
|
-
function
|
|
3089
|
+
function ci(e) {
|
|
2975
3090
|
return vt(e.value);
|
|
2976
3091
|
}
|
|
2977
|
-
function
|
|
3092
|
+
function li(e) {
|
|
2978
3093
|
return e.columnFilters;
|
|
2979
3094
|
}
|
|
2980
|
-
var
|
|
3095
|
+
var ui = { footer: "_footer_te0a3_1" };
|
|
2981
3096
|
//#endregion
|
|
2982
3097
|
//#region src/tmdatagrid/components/TMDataGridFooter.tsx
|
|
2983
|
-
function
|
|
3098
|
+
function di(e, t = !0) {
|
|
2984
3099
|
let { pageIndex: n, pageSize: r } = e.store.state.pagination, i = e.getRowCount();
|
|
2985
3100
|
return {
|
|
2986
3101
|
state: {
|
|
@@ -3004,13 +3119,13 @@ function li(e, t = !0) {
|
|
|
3004
3119
|
}
|
|
3005
3120
|
};
|
|
3006
3121
|
}
|
|
3007
|
-
function
|
|
3122
|
+
function fi(t) {
|
|
3008
3123
|
let n = e(23), { pageSizeOptions: r } = t, { table: i, features: a, labels: o, controlSize: s } = Q();
|
|
3009
3124
|
j(i.store);
|
|
3010
3125
|
let c;
|
|
3011
|
-
n[0] !== a || n[1] !== i ? (c =
|
|
3126
|
+
n[0] !== a || n[1] !== i ? (c = fn(i, a), n[0] = a, n[1] = i, n[2] = c) : c = n[2];
|
|
3012
3127
|
let l = c, { pageSize: u } = i.store.state.pagination, d;
|
|
3013
|
-
n[3] !== u || n[4] !== r ? (d = r.includes(u) ? r : [...r, u].sort(
|
|
3128
|
+
n[3] !== u || n[4] !== r ? (d = r.includes(u) ? r : [...r, u].sort(pi), n[3] = u, n[4] = r, n[5] = d) : d = n[5];
|
|
3014
3129
|
let f = d, m;
|
|
3015
3130
|
n[6] !== s || n[7] !== o.rowsPerPage ? (m = /* @__PURE__ */ J(E, {
|
|
3016
3131
|
span: !0,
|
|
@@ -3043,14 +3158,14 @@ function ui(t) {
|
|
|
3043
3158
|
children: [m, y]
|
|
3044
3159
|
}), n[20] = m, n[21] = y, n[22] = b) : b = n[22], b;
|
|
3045
3160
|
}
|
|
3046
|
-
function
|
|
3161
|
+
function pi(e, t) {
|
|
3047
3162
|
return e - t;
|
|
3048
3163
|
}
|
|
3049
|
-
function
|
|
3164
|
+
function mi() {
|
|
3050
3165
|
let t = e(22), { table: n, features: r, labels: i, controlSize: a } = Q();
|
|
3051
3166
|
j(n.store);
|
|
3052
3167
|
let o;
|
|
3053
|
-
t[0] !== r || t[1] !== n ? (o =
|
|
3168
|
+
t[0] !== r || t[1] !== n ? (o = fn(n, r), t[0] = r, t[1] = n, t[2] = o) : o = t[2];
|
|
3054
3169
|
let s = o, { pageIndex: c, pageSize: l } = n.store.state.pagination, u, d, f, p, m, h;
|
|
3055
3170
|
if (t[3] !== a || t[4] !== i || t[5] !== c || t[6] !== l || t[7] !== s || t[8] !== n) {
|
|
3056
3171
|
let e = n.getRowCount(), r = e === 0 ? 0 : c * l + 1, o = Math.min(e, (c + 1) * l);
|
|
@@ -3069,11 +3184,11 @@ function fi() {
|
|
|
3069
3184
|
children: h
|
|
3070
3185
|
}), t[15] = u, t[16] = d, t[17] = f, t[18] = p, t[19] = m, t[20] = h, t[21] = g) : g = t[21], g;
|
|
3071
3186
|
}
|
|
3072
|
-
function
|
|
3187
|
+
function hi() {
|
|
3073
3188
|
let t = e(26), { table: n, features: r, labels: i } = Q();
|
|
3074
3189
|
j(n.store);
|
|
3075
3190
|
let a;
|
|
3076
|
-
t[0] !== r || t[1] !== n ? (a =
|
|
3191
|
+
t[0] !== r || t[1] !== n ? (a = fn(n, r), t[0] = r, t[1] = n, t[2] = a) : a = t[2];
|
|
3077
3192
|
let o = a, s;
|
|
3078
3193
|
t[3] !== o || t[4] !== n ? (s = !o || !n.getCanPreviousPage(), t[3] = o, t[4] = n, t[5] = s) : s = t[5];
|
|
3079
3194
|
let c;
|
|
@@ -3119,31 +3234,31 @@ function pi() {
|
|
|
3119
3234
|
children: [d, g]
|
|
3120
3235
|
}), t[23] = d, t[24] = g, t[25] = _) : _ = t[25], _;
|
|
3121
3236
|
}
|
|
3122
|
-
var
|
|
3237
|
+
var gi = [
|
|
3123
3238
|
10,
|
|
3124
3239
|
25,
|
|
3125
3240
|
50,
|
|
3126
3241
|
100
|
|
3127
3242
|
];
|
|
3128
|
-
function
|
|
3129
|
-
let n = e(23), { pageSizeOptions: r, renderPagination: i } = t, a = r === void 0 ?
|
|
3243
|
+
function _i(t) {
|
|
3244
|
+
let n = e(23), { pageSizeOptions: r, renderPagination: i } = t, a = r === void 0 ? gi : r, { table: o, features: s, labels: c } = Q();
|
|
3130
3245
|
j(o.store);
|
|
3131
3246
|
let l;
|
|
3132
3247
|
n[0] === a ? l = n[1] : (l = {
|
|
3133
|
-
PageSize: () => /* @__PURE__ */ J(
|
|
3134
|
-
Range:
|
|
3135
|
-
Pager:
|
|
3248
|
+
PageSize: () => /* @__PURE__ */ J(fi, { pageSizeOptions: a }),
|
|
3249
|
+
Range: mi,
|
|
3250
|
+
Pager: hi
|
|
3136
3251
|
}, n[0] = a, n[1] = l);
|
|
3137
3252
|
let u = l;
|
|
3138
|
-
if (!
|
|
3253
|
+
if (!Br(o, s).canPaginate) return null;
|
|
3139
3254
|
let d, f;
|
|
3140
3255
|
if (n[2] !== u || n[3] !== s || n[4] !== i || n[5] !== o) {
|
|
3141
3256
|
f = Symbol.for("react.early_return_sentinel");
|
|
3142
|
-
bb0: if (d =
|
|
3143
|
-
let { state: e, actions: t } =
|
|
3257
|
+
bb0: if (d = fn(o, s), i) {
|
|
3258
|
+
let { state: e, actions: t } = di(o, d);
|
|
3144
3259
|
f = /* @__PURE__ */ J("div", {
|
|
3145
3260
|
"data-dg-part": "footer",
|
|
3146
|
-
className:
|
|
3261
|
+
className: ui.footer,
|
|
3147
3262
|
children: i({
|
|
3148
3263
|
state: e,
|
|
3149
3264
|
actions: t,
|
|
@@ -3164,7 +3279,7 @@ function hi(t) {
|
|
|
3164
3279
|
let _;
|
|
3165
3280
|
n[14] !== p || n[15] !== m || n[16] !== h || n[17] !== g ? (_ = /* @__PURE__ */ Y("div", {
|
|
3166
3281
|
"data-dg-part": "footer",
|
|
3167
|
-
className:
|
|
3282
|
+
className: ui.footer,
|
|
3168
3283
|
"data-paging-suspended": p,
|
|
3169
3284
|
children: [
|
|
3170
3285
|
m,
|
|
@@ -3185,13 +3300,13 @@ function hi(t) {
|
|
|
3185
3300
|
}
|
|
3186
3301
|
//#endregion
|
|
3187
3302
|
//#region src/tmdatagrid/components/TMDataGridSearch.tsx
|
|
3188
|
-
function
|
|
3189
|
-
let n = e(25), { placeholder: r, debounce: a, w: o } = t, u = a === void 0 ? 250 : a, d = o === void 0 ? 220 : o, { table: f, features: p, labels: m, controlSize: h } = Q(), g = j(f.store,
|
|
3303
|
+
function vi(t) {
|
|
3304
|
+
let n = e(25), { placeholder: r, debounce: a, w: o } = t, u = a === void 0 ? 250 : a, d = o === void 0 ? 220 : o, { table: f, features: p, labels: m, controlSize: h } = Q(), g = j(f.store, yi), [_, v] = c(g), y = s(void 0), b = s(g), x, S;
|
|
3190
3305
|
n[0] === g ? (x = n[1], S = n[2]) : (x = () => {
|
|
3191
3306
|
g !== b.current && (b.current = g, v(g));
|
|
3192
3307
|
}, S = [g], n[0] = g, n[1] = x, n[2] = S), i(x, S);
|
|
3193
3308
|
let C, w;
|
|
3194
|
-
if (n[3] === Symbol.for("react.memo_cache_sentinel") ? (C = () => () => clearTimeout(y.current), w = [], n[3] = C, n[4] = w) : (C = n[3], w = n[4]), i(C, w), !
|
|
3309
|
+
if (n[3] === Symbol.for("react.memo_cache_sentinel") ? (C = () => () => clearTimeout(y.current), w = [], n[3] = C, n[4] = w) : (C = n[3], w = n[4]), i(C, w), !Br(f, p).canSearch) return null;
|
|
3195
3310
|
let T;
|
|
3196
3311
|
n[5] === f ? T = n[6] : (T = (e) => {
|
|
3197
3312
|
b.current = e, f.setGlobalFilter(e === "" ? void 0 : e);
|
|
@@ -3239,15 +3354,15 @@ function gi(t) {
|
|
|
3239
3354
|
rightSection: P
|
|
3240
3355
|
}), n[17] = h, n[18] = _, n[19] = m.searchLabel, n[20] = M, n[21] = P, n[22] = A, n[23] = d, n[24] = F) : F = n[24], F;
|
|
3241
3356
|
}
|
|
3242
|
-
function
|
|
3357
|
+
function yi(e) {
|
|
3243
3358
|
return typeof e.globalFilter == "string" ? e.globalFilter : "";
|
|
3244
3359
|
}
|
|
3245
|
-
var
|
|
3360
|
+
var bi = {
|
|
3246
3361
|
stickyLeft: "_stickyLeft_1vw51_16",
|
|
3247
3362
|
stickyRight: "_stickyRight_1vw51_17",
|
|
3248
3363
|
stickyEdgeIn: "_stickyEdgeIn_1vw51_1",
|
|
3249
3364
|
stickyEdgeOut: "_stickyEdgeOut_1vw51_1"
|
|
3250
|
-
},
|
|
3365
|
+
}, xi = {
|
|
3251
3366
|
headerCell: "_headerCell_188ed_1",
|
|
3252
3367
|
headerCellFiltered: "_headerCellFiltered_188ed_35",
|
|
3253
3368
|
headerTitle: "_headerTitle_188ed_35",
|
|
@@ -3263,39 +3378,39 @@ var vi = {
|
|
|
3263
3378
|
columnSeparatorResizable: "_columnSeparatorResizable_188ed_152",
|
|
3264
3379
|
columnSeparatorActive: "_columnSeparatorActive_188ed_175",
|
|
3265
3380
|
menuItemActive: "_menuItemActive_188ed_181"
|
|
3266
|
-
},
|
|
3267
|
-
function
|
|
3381
|
+
}, Si = 30, Ci = 2;
|
|
3382
|
+
function wi(e) {
|
|
3268
3383
|
let t = document.createRange();
|
|
3269
3384
|
t.selectNodeContents(e);
|
|
3270
3385
|
let n = typeof t.getBoundingClientRect == "function" ? t.getBoundingClientRect().width : 0;
|
|
3271
3386
|
return n > 0 ? n : e.scrollWidth;
|
|
3272
3387
|
}
|
|
3273
|
-
function
|
|
3388
|
+
function Ti(e, t) {
|
|
3274
3389
|
let n = CSS.escape(t);
|
|
3275
3390
|
return e.querySelectorAll(`[role="cell"][data-column-id="${n}"],[role="gridcell"][data-column-id="${n}"]`);
|
|
3276
3391
|
}
|
|
3277
|
-
function
|
|
3278
|
-
return
|
|
3392
|
+
function Ei(e, t) {
|
|
3393
|
+
return Ti(e, t).length > 0;
|
|
3279
3394
|
}
|
|
3280
|
-
function
|
|
3395
|
+
function Di({ container: e, columnId: t }) {
|
|
3281
3396
|
let n = 0;
|
|
3282
|
-
for (let r of
|
|
3397
|
+
for (let r of Ti(e, t)) {
|
|
3283
3398
|
let e = r.firstElementChild;
|
|
3284
3399
|
if (!(e instanceof HTMLElement)) continue;
|
|
3285
3400
|
let t = getComputedStyle(r), i = (Number.parseFloat(t.paddingLeft) || 0) + (Number.parseFloat(t.paddingRight) || 0);
|
|
3286
|
-
n = Math.max(n,
|
|
3401
|
+
n = Math.max(n, wi(e) + i + Ci);
|
|
3287
3402
|
}
|
|
3288
3403
|
let r = e.querySelector(`[data-column-id="${CSS.escape(t)}"] [data-dg-header-title]`);
|
|
3289
3404
|
if (r) {
|
|
3290
3405
|
let e = r.closest("[role=\"columnheader\"]"), t = e ? getComputedStyle(e) : null, i = t ? (Number.parseFloat(t.paddingLeft) || 0) + (Number.parseFloat(t.paddingRight) || 0) : 0;
|
|
3291
|
-
n = Math.max(n,
|
|
3406
|
+
n = Math.max(n, wi(r) + i + Si);
|
|
3292
3407
|
}
|
|
3293
3408
|
return n;
|
|
3294
3409
|
}
|
|
3295
|
-
function
|
|
3410
|
+
function Oi({ table: e, columnId: t, container: n }) {
|
|
3296
3411
|
let r = e, i = r.getColumn(t);
|
|
3297
3412
|
if (!i || !i.getCanResize()) return !1;
|
|
3298
|
-
let a =
|
|
3413
|
+
let a = Di({
|
|
3299
3414
|
container: n,
|
|
3300
3415
|
columnId: t
|
|
3301
3416
|
});
|
|
@@ -3308,46 +3423,46 @@ function Ei({ table: e, columnId: t, container: n }) {
|
|
|
3308
3423
|
}
|
|
3309
3424
|
//#endregion
|
|
3310
3425
|
//#region src/tmdatagrid/core/columnOrdering.ts
|
|
3311
|
-
function
|
|
3426
|
+
function ki(e, t) {
|
|
3312
3427
|
return e.left.includes(t) ? "left" : e.right.includes(t) ? "right" : "center";
|
|
3313
3428
|
}
|
|
3314
|
-
function
|
|
3429
|
+
function Ai(e, t, n, r) {
|
|
3315
3430
|
let i = e.filter((e) => e !== t), a = i.indexOf(n);
|
|
3316
3431
|
return a === -1 ? [...e] : (i.splice(r === "before" ? a : a + 1, 0, t), i);
|
|
3317
3432
|
}
|
|
3318
|
-
function
|
|
3433
|
+
function ji({ table: e, columnId: t, targetId: n, side: r }) {
|
|
3319
3434
|
if (t === n) return;
|
|
3320
|
-
let i = e.store.state.columnPinning, a =
|
|
3321
|
-
if (a !==
|
|
3435
|
+
let i = e.store.state.columnPinning, a = ki(i, t);
|
|
3436
|
+
if (a !== ki(i, n)) return;
|
|
3322
3437
|
let o = e.getAllLeafColumns().map((e) => e.id);
|
|
3323
|
-
e.setColumnOrder(
|
|
3438
|
+
e.setColumnOrder(Ai(o, t, n, r)), a !== "center" && e.setColumnPinning((e) => ({
|
|
3324
3439
|
...e,
|
|
3325
|
-
[a]:
|
|
3440
|
+
[a]: Ai(e[a], t, n, r)
|
|
3326
3441
|
}));
|
|
3327
3442
|
}
|
|
3328
|
-
function
|
|
3329
|
-
let t = (e) =>
|
|
3443
|
+
function Mi(e) {
|
|
3444
|
+
let t = (e) => kn(e);
|
|
3330
3445
|
return {
|
|
3331
3446
|
left: [...e.left.filter(t), ...e.left.filter((e) => !t(e))],
|
|
3332
3447
|
right: [...e.right.filter((e) => !t(e)), ...e.right.filter(t)]
|
|
3333
3448
|
};
|
|
3334
3449
|
}
|
|
3335
|
-
function
|
|
3450
|
+
function Ni(e, t) {
|
|
3336
3451
|
return t === "left" ? e.getLeftVisibleLeafColumns() : t === "right" ? e.getRightVisibleLeafColumns() : e.getCenterVisibleLeafColumns();
|
|
3337
3452
|
}
|
|
3338
|
-
function
|
|
3339
|
-
let r =
|
|
3453
|
+
function Pi({ table: e, columnId: t, direction: n }) {
|
|
3454
|
+
let r = Ni(e, ki(e.store.state.columnPinning, t)), i = r.findIndex((e) => e.id === t);
|
|
3340
3455
|
if (i === -1) return null;
|
|
3341
3456
|
let a = r[i + n];
|
|
3342
|
-
return !a || !
|
|
3457
|
+
return !a || !An(a) ? null : a;
|
|
3343
3458
|
}
|
|
3344
|
-
function
|
|
3345
|
-
let r =
|
|
3459
|
+
function Fi({ table: e, columnId: t, direction: n }) {
|
|
3460
|
+
let r = Pi({
|
|
3346
3461
|
table: e,
|
|
3347
3462
|
columnId: t,
|
|
3348
3463
|
direction: n
|
|
3349
3464
|
});
|
|
3350
|
-
r &&
|
|
3465
|
+
r && ji({
|
|
3351
3466
|
table: e,
|
|
3352
3467
|
columnId: t,
|
|
3353
3468
|
targetId: r.id,
|
|
@@ -3356,14 +3471,14 @@ function Ni({ table: e, columnId: t, direction: n }) {
|
|
|
3356
3471
|
}
|
|
3357
3472
|
//#endregion
|
|
3358
3473
|
//#region src/tmdatagrid/components/TMDataGridHeaderCell.tsx
|
|
3359
|
-
function
|
|
3474
|
+
function Ii(t) {
|
|
3360
3475
|
let n = e(267), { header: r, layout: i, renderColumnMenuItems: a } = t, o = Q(), { table: u, features: d, labels: f } = o, p = r.column, [m, h] = c(!1), [_, v] = c(!1), [y, b] = c(null), x = s(null), S = s(!1), C;
|
|
3361
3476
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (C = { compare: _e }, n[0] = C) : C = n[0];
|
|
3362
|
-
let { sorting: w, columnFilters: T, resizingColumnId: E, columnPinning: D, grouping: k } = j(u.store,
|
|
3477
|
+
let { sorting: w, columnFilters: T, resizingColumnId: E, columnPinning: D, grouping: k } = j(u.store, Ui, C), A = j(o.ui, Hi), N = r.subHeaders.length === 0, B, V, H, se, W, ce, le, K, q, ue, de, fe, pe, me, he, ge, ve, ye, be, xe;
|
|
3363
3478
|
if (n[1] !== o || n[2] !== p || n[3] !== T || n[4] !== D || n[5] !== A || n[6] !== y || n[7] !== d || n[8] !== k || n[9] !== N || n[10] !== f || n[11] !== i.pinnedAt || n[12] !== a || n[13] !== E || n[14] !== w || n[15] !== u) {
|
|
3364
|
-
ve =
|
|
3479
|
+
ve = xn(p);
|
|
3365
3480
|
let e;
|
|
3366
|
-
n[36] === p ? e = n[37] : (e =
|
|
3481
|
+
n[36] === p ? e = n[37] : (e = Dn(p), n[36] = p, n[37] = e), B = e;
|
|
3367
3482
|
let t;
|
|
3368
3483
|
n[38] !== p.id || n[39] !== w ? (t = w.find((e) => e.id === p.id)?.desc, n[38] = p.id, n[39] = w, n[40] = t) : t = n[40], be = t, ge = be !== void 0;
|
|
3369
3484
|
let r;
|
|
@@ -3375,17 +3490,17 @@ function Pi(t) {
|
|
|
3375
3490
|
} else s = n[47];
|
|
3376
3491
|
me = s, he = E === p.id, ye = i.pinnedAt;
|
|
3377
3492
|
let c;
|
|
3378
|
-
n[50] !== p || n[51] !== d ? (c =
|
|
3493
|
+
n[50] !== p || n[51] !== d ? (c = zr(p, d), n[50] = p, n[51] = d, n[52] = c) : c = n[52];
|
|
3379
3494
|
let l = c;
|
|
3380
3495
|
W = N && l.canSort;
|
|
3381
3496
|
let m = N && l.canFilter, h = N && l.canHide, _ = N && l.canPin;
|
|
3382
3497
|
se = l.canResize, H = N && l.canReorder;
|
|
3383
|
-
let v = N && l.canGroup, S = N &&
|
|
3498
|
+
let v = N && l.canGroup, S = N && Br(u, d).canHideAny, C;
|
|
3384
3499
|
n[53] !== p.id || n[54] !== k ? (C = k.includes(p.id), n[53] = p.id, n[54] = k, n[55] = C) : C = n[55];
|
|
3385
3500
|
let O = C, j = k.length > 0;
|
|
3386
3501
|
fe = A === p.id;
|
|
3387
|
-
let
|
|
3388
|
-
n[56] !== H || n[57] !== p.id || n[58] !== D || n[59] !== A || n[60] !== fe ? (
|
|
3502
|
+
let U;
|
|
3503
|
+
n[56] !== H || n[57] !== p.id || n[58] !== D || n[59] !== A || n[60] !== fe ? (U = H && A !== null && !fe && ki(D, A) === ki(D, p.id), n[56] = H, n[57] = p.id, n[58] = D, n[59] = A, n[60] = fe, n[61] = U) : U = n[61], pe = U;
|
|
3389
3504
|
let Y;
|
|
3390
3505
|
n[62] !== o.ui || n[63] !== p.id ? (Y = function(e) {
|
|
3391
3506
|
e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", p.id), o.ui.actions.startColumnDrag(p.id);
|
|
@@ -3404,7 +3519,7 @@ function Pi(t) {
|
|
|
3404
3519
|
}, n[67] = Se) : Se = n[67], K = Se;
|
|
3405
3520
|
let Ce;
|
|
3406
3521
|
n[68] !== o.ui || n[69] !== p.id || n[70] !== A || n[71] !== y || n[72] !== pe || n[73] !== u ? (Ce = function(e) {
|
|
3407
|
-
e.preventDefault(), b(null), o.ui.actions.endColumnDrag(), !(!pe || !y || !A) &&
|
|
3522
|
+
e.preventDefault(), b(null), o.ui.actions.endColumnDrag(), !(!pe || !y || !A) && ji({
|
|
3408
3523
|
table: u,
|
|
3409
3524
|
columnId: A,
|
|
3410
3525
|
targetId: p.id,
|
|
@@ -3418,14 +3533,14 @@ function Pi(t) {
|
|
|
3418
3533
|
let Te;
|
|
3419
3534
|
n[77] !== p.id || n[78] !== u ? (Te = function() {
|
|
3420
3535
|
let e = x.current?.closest("[data-dg-scroll-container]");
|
|
3421
|
-
e &&
|
|
3536
|
+
e && Oi({
|
|
3422
3537
|
table: u,
|
|
3423
3538
|
columnId: p.id,
|
|
3424
3539
|
container: e
|
|
3425
3540
|
});
|
|
3426
3541
|
}, n[77] = p.id, n[78] = u, n[79] = Te) : Te = n[79], V = Te;
|
|
3427
|
-
let
|
|
3428
|
-
n[80] !== p || n[81] !== u ? (
|
|
3542
|
+
let Ee;
|
|
3543
|
+
n[80] !== p || n[81] !== u ? (Ee = function(e) {
|
|
3429
3544
|
if (e && !(p.id in u.store.state.columnSizing)) {
|
|
3430
3545
|
let e = x.current?.getBoundingClientRect().width;
|
|
3431
3546
|
e && u.setColumnSizing((t) => ({
|
|
@@ -3433,9 +3548,9 @@ function Pi(t) {
|
|
|
3433
3548
|
[p.id]: Math.round(e)
|
|
3434
3549
|
}));
|
|
3435
3550
|
}
|
|
3436
|
-
p.pin(e), u.setColumnPinning(
|
|
3437
|
-
}, n[80] = p, n[81] = u, n[82] =
|
|
3438
|
-
let
|
|
3551
|
+
p.pin(e), u.setColumnPinning(Mi);
|
|
3552
|
+
}, n[80] = p, n[81] = u, n[82] = Ee) : Ee = n[82];
|
|
3553
|
+
let X = Ee, Z = [];
|
|
3439
3554
|
if (W) {
|
|
3440
3555
|
let e;
|
|
3441
3556
|
n[83] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ J(z, {
|
|
@@ -3468,12 +3583,12 @@ function Pi(t) {
|
|
|
3468
3583
|
}
|
|
3469
3584
|
if (m) {
|
|
3470
3585
|
let e;
|
|
3471
|
-
n[96] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ J(
|
|
3586
|
+
n[96] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ J(ne, {
|
|
3472
3587
|
size: 16,
|
|
3473
3588
|
stroke: 1.6
|
|
3474
3589
|
}), n[96] = e) : e = n[96];
|
|
3475
3590
|
let t;
|
|
3476
|
-
n[97] !== o || n[98] !== p.id ? (t = () =>
|
|
3591
|
+
n[97] !== o || n[98] !== p.id ? (t = () => oi(o, p.id), n[97] = o, n[98] = p.id, n[99] = t) : t = n[99];
|
|
3477
3592
|
let r;
|
|
3478
3593
|
n[100] !== f.filterMenuItem || n[101] !== t ? (r = /* @__PURE__ */ J(g.Item, {
|
|
3479
3594
|
leftSection: e,
|
|
@@ -3484,7 +3599,7 @@ function Pi(t) {
|
|
|
3484
3599
|
n[103] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ J(g.Divider, {}, "filter-divider"), n[103] = i) : i = n[103], Z.push(r, i);
|
|
3485
3600
|
}
|
|
3486
3601
|
if (v) {
|
|
3487
|
-
let e = O ?
|
|
3602
|
+
let e = O ? xi.menuItemActive : void 0, t;
|
|
3488
3603
|
n[104] === O ? t = n[105] : (t = J(O ? ae : oe, {
|
|
3489
3604
|
size: 16,
|
|
3490
3605
|
stroke: 1.6
|
|
@@ -3508,7 +3623,7 @@ function Pi(t) {
|
|
|
3508
3623
|
stroke: 1.6
|
|
3509
3624
|
}),
|
|
3510
3625
|
onClick: () => t.toggleGrouping(),
|
|
3511
|
-
children: f.ungroup(
|
|
3626
|
+
children: f.ungroup(xn(t))
|
|
3512
3627
|
}, `ungroup-${e}`));
|
|
3513
3628
|
}
|
|
3514
3629
|
let e;
|
|
@@ -3519,7 +3634,7 @@ function Pi(t) {
|
|
|
3519
3634
|
expand: e
|
|
3520
3635
|
})), n[113] = u, n[114] = e);
|
|
3521
3636
|
let t = e, r;
|
|
3522
|
-
n[115] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ J(
|
|
3637
|
+
n[115] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ J(re, {
|
|
3523
3638
|
size: 16,
|
|
3524
3639
|
stroke: 1.6
|
|
3525
3640
|
}), n[115] = r) : r = n[115];
|
|
@@ -3532,7 +3647,7 @@ function Pi(t) {
|
|
|
3532
3647
|
children: f.expandAllGroups
|
|
3533
3648
|
}, "expand-all"), n[118] = f.expandAllGroups, n[119] = i, n[120] = a) : a = n[120];
|
|
3534
3649
|
let o;
|
|
3535
|
-
n[121] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ J(
|
|
3650
|
+
n[121] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ J(ie, {
|
|
3536
3651
|
size: 16,
|
|
3537
3652
|
stroke: 1.6
|
|
3538
3653
|
}), n[121] = o) : o = n[121];
|
|
@@ -3550,13 +3665,13 @@ function Pi(t) {
|
|
|
3550
3665
|
n[127] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ J(g.Divider, {}, "group-divider"), n[127] = e) : e = n[127], Z.push(e);
|
|
3551
3666
|
}
|
|
3552
3667
|
if (_) {
|
|
3553
|
-
let e = ye === "left" ?
|
|
3668
|
+
let e = ye === "left" ? xi.menuItemActive : void 0, t;
|
|
3554
3669
|
n[128] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ J(P, {
|
|
3555
3670
|
size: 16,
|
|
3556
3671
|
stroke: 1.6
|
|
3557
3672
|
}), n[128] = t) : t = n[128];
|
|
3558
3673
|
let r;
|
|
3559
|
-
n[129] !== ye || n[130] !==
|
|
3674
|
+
n[129] !== ye || n[130] !== X ? (r = () => X(ye !== "left" && "left"), n[129] = ye, n[130] = X, n[131] = r) : r = n[131];
|
|
3560
3675
|
let i;
|
|
3561
3676
|
n[132] !== f.pinLeft || n[133] !== e || n[134] !== r ? (i = /* @__PURE__ */ J(g.Item, {
|
|
3562
3677
|
className: e,
|
|
@@ -3564,13 +3679,13 @@ function Pi(t) {
|
|
|
3564
3679
|
onClick: r,
|
|
3565
3680
|
children: f.pinLeft
|
|
3566
3681
|
}, "pin-left"), n[132] = f.pinLeft, n[133] = e, n[134] = r, n[135] = i) : i = n[135];
|
|
3567
|
-
let a = ye === "right" ?
|
|
3682
|
+
let a = ye === "right" ? xi.menuItemActive : void 0, o;
|
|
3568
3683
|
n[136] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ J(F, {
|
|
3569
3684
|
size: 16,
|
|
3570
3685
|
stroke: 1.6
|
|
3571
3686
|
}), n[136] = o) : o = n[136];
|
|
3572
3687
|
let s;
|
|
3573
|
-
n[137] !== ye || n[138] !==
|
|
3688
|
+
n[137] !== ye || n[138] !== X ? (s = () => X(ye !== "right" && "right"), n[137] = ye, n[138] = X, n[139] = s) : s = n[139];
|
|
3574
3689
|
let c;
|
|
3575
3690
|
if (n[140] !== f.pinRight || n[141] !== a || n[142] !== s ? (c = /* @__PURE__ */ J(g.Item, {
|
|
3576
3691
|
className: a,
|
|
@@ -3584,7 +3699,7 @@ function Pi(t) {
|
|
|
3584
3699
|
stroke: 1.6
|
|
3585
3700
|
}), n[144] = e) : e = n[144];
|
|
3586
3701
|
let t;
|
|
3587
|
-
n[145] ===
|
|
3702
|
+
n[145] === X ? t = n[146] : (t = () => X(!1), n[145] = X, n[146] = t);
|
|
3588
3703
|
let r;
|
|
3589
3704
|
n[147] !== f.unpin || n[148] !== t ? (r = /* @__PURE__ */ J(g.Item, {
|
|
3590
3705
|
leftSection: e,
|
|
@@ -3597,13 +3712,13 @@ function Pi(t) {
|
|
|
3597
3712
|
}
|
|
3598
3713
|
if (H) {
|
|
3599
3714
|
let e;
|
|
3600
|
-
n[151] !== p.id || n[152] !== u ? (e =
|
|
3715
|
+
n[151] !== p.id || n[152] !== u ? (e = Pi({
|
|
3601
3716
|
table: u,
|
|
3602
3717
|
columnId: p.id,
|
|
3603
3718
|
direction: -1
|
|
3604
3719
|
}), n[151] = p.id, n[152] = u, n[153] = e) : e = n[153];
|
|
3605
3720
|
let t = e, r;
|
|
3606
|
-
n[154] !== p.id || n[155] !== u ? (r =
|
|
3721
|
+
n[154] !== p.id || n[155] !== u ? (r = Pi({
|
|
3607
3722
|
table: u,
|
|
3608
3723
|
columnId: p.id,
|
|
3609
3724
|
direction: 1
|
|
@@ -3616,7 +3731,7 @@ function Pi(t) {
|
|
|
3616
3731
|
stroke: 1.6
|
|
3617
3732
|
}), n[157] = r) : r = n[157];
|
|
3618
3733
|
let a;
|
|
3619
|
-
n[158] !== p.id || n[159] !== u ? (a = () =>
|
|
3734
|
+
n[158] !== p.id || n[159] !== u ? (a = () => Fi({
|
|
3620
3735
|
table: u,
|
|
3621
3736
|
columnId: p.id,
|
|
3622
3737
|
direction: -1
|
|
@@ -3634,7 +3749,7 @@ function Pi(t) {
|
|
|
3634
3749
|
stroke: 1.6
|
|
3635
3750
|
}), n[165] = c) : c = n[165];
|
|
3636
3751
|
let l;
|
|
3637
|
-
n[166] !== p.id || n[167] !== u ? (l = () =>
|
|
3752
|
+
n[166] !== p.id || n[167] !== u ? (l = () => Fi({
|
|
3638
3753
|
table: u,
|
|
3639
3754
|
columnId: p.id,
|
|
3640
3755
|
direction: 1
|
|
@@ -3667,7 +3782,7 @@ function Pi(t) {
|
|
|
3667
3782
|
}
|
|
3668
3783
|
if (h) {
|
|
3669
3784
|
let e;
|
|
3670
|
-
n[179] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ J(
|
|
3785
|
+
n[179] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ J(te, {
|
|
3671
3786
|
size: 16,
|
|
3672
3787
|
stroke: 1.6
|
|
3673
3788
|
}), n[179] = e) : e = n[179];
|
|
@@ -3695,29 +3810,29 @@ function Pi(t) {
|
|
|
3695
3810
|
children: f.manageColumns
|
|
3696
3811
|
}, "manage"), n[188] = f.manageColumns, n[189] = t, n[190] = r) : r = n[190], Z.push(r);
|
|
3697
3812
|
}
|
|
3698
|
-
for (; Z.length > 0 &&
|
|
3813
|
+
for (; Z.length > 0 && Wi(Z.at(-1));) Z.pop();
|
|
3699
3814
|
for (ce = a ? [...a({
|
|
3700
3815
|
column: p,
|
|
3701
3816
|
table: u,
|
|
3702
3817
|
internalItems: Z
|
|
3703
|
-
})] : Z; ce.length > 0 &&
|
|
3818
|
+
})] : Z; ce.length > 0 && Wi(ce.at(-1));) ce.pop();
|
|
3704
3819
|
n[1] = o, n[2] = p, n[3] = T, n[4] = D, n[5] = A, n[6] = y, n[7] = d, n[8] = k, n[9] = N, n[10] = f, n[11] = i.pinnedAt, n[12] = a, n[13] = E, n[14] = w, n[15] = u, n[16] = B, n[17] = V, n[18] = H, n[19] = se, n[20] = W, n[21] = ce, n[22] = le, n[23] = K, n[24] = q, n[25] = ue, n[26] = de, n[27] = fe, n[28] = pe, n[29] = me, n[30] = he, n[31] = ge, n[32] = ve, n[33] = ye, n[34] = be, n[35] = xe;
|
|
3705
3820
|
} else B = n[16], V = n[17], H = n[18], se = n[19], W = n[20], ce = n[21], le = n[22], K = n[23], q = n[24], ue = n[25], de = n[26], fe = n[27], pe = n[28], me = n[29], he = n[30], ge = n[31], ve = n[32], ye = n[33], be = n[34], xe = n[35];
|
|
3706
3821
|
let Se;
|
|
3707
|
-
n[191] !== p.id || n[192] !== ce || n[193] !== N ? (Se = N && ce.length > 0 && !
|
|
3708
|
-
let Ce = Se, we = W ?
|
|
3709
|
-
n[195] !== we || n[196] !== Te || n[197] !==
|
|
3710
|
-
|
|
3822
|
+
n[191] !== p.id || n[192] !== ce || n[193] !== N ? (Se = N && ce.length > 0 && !On(p.id), n[191] = p.id, n[192] = ce, n[193] = N, n[194] = Se) : Se = n[194];
|
|
3823
|
+
let Ce = Se, we = W ? xi.headerCellSortable : "", Te = me ? xi.headerCellFiltered : "", Ee = fe ? xi.headerCellDragging : "", X = y === "before" ? xi.headerCellDropBefore : "", Z = y === "after" ? xi.headerCellDropAfter : "", De = i.isBoundary && ye === "left" ? bi.stickyLeft : "", Oe = i.isBoundary && ye === "right" ? bi.stickyRight : "", ke;
|
|
3824
|
+
n[195] !== we || n[196] !== Te || n[197] !== Ee || n[198] !== X || n[199] !== Z || n[200] !== De || n[201] !== Oe ? (ke = [
|
|
3825
|
+
xi.headerCell,
|
|
3711
3826
|
we,
|
|
3712
3827
|
Te,
|
|
3713
|
-
X,
|
|
3714
3828
|
Ee,
|
|
3829
|
+
X,
|
|
3715
3830
|
Z,
|
|
3716
3831
|
De,
|
|
3717
3832
|
Oe
|
|
3718
|
-
].filter(Boolean), n[195] = we, n[196] = Te, n[197] =
|
|
3833
|
+
].filter(Boolean), n[195] = we, n[196] = Te, n[197] = Ee, n[198] = X, n[199] = Z, n[200] = De, n[201] = Oe, n[202] = ke) : ke = n[202];
|
|
3719
3834
|
let Ae = ke.join(" "), je = p.id, Me = ge || me, Ne;
|
|
3720
|
-
n[203] === p.id ? Ne = n[204] : (Ne =
|
|
3835
|
+
n[203] === p.id ? Ne = n[204] : (Ne = On(p.id), n[203] = p.id, n[204] = Ne);
|
|
3721
3836
|
let Pe = W ? ge ? be ? "descending" : "ascending" : "none" : void 0, Ie = H && !he, Le = H ? ue : void 0, Re = H ? le : void 0, ze = pe ? q : void 0, Be = pe ? K : void 0, Ve = pe ? de : void 0, He = ye === "left" ? i.offset : void 0, Ue = ye === "right" ? i.offset : void 0, We = ye ? "sticky" : void 0, Ge = ye ? "var(--dg-z-header-pinned-cell, 7)" : void 0, Ke;
|
|
3722
3837
|
n[205] !== He || n[206] !== Ue || n[207] !== We || n[208] !== Ge ? (Ke = {
|
|
3723
3838
|
left: He,
|
|
@@ -3725,7 +3840,7 @@ function Pi(t) {
|
|
|
3725
3840
|
position: We,
|
|
3726
3841
|
zIndex: Ge
|
|
3727
3842
|
}, n[205] = He, n[206] = Ue, n[207] = We, n[208] = Ge, n[209] = Ke) : Ke = n[209];
|
|
3728
|
-
let qe = W ?
|
|
3843
|
+
let qe = W ? Vi : void 0, Je;
|
|
3729
3844
|
n[210] !== W || n[211] !== p ? (Je = W ? (e) => {
|
|
3730
3845
|
if (S.current) {
|
|
3731
3846
|
S.current = !1;
|
|
@@ -3740,17 +3855,17 @@ function Pi(t) {
|
|
|
3740
3855
|
withinPortal: !0,
|
|
3741
3856
|
disabled: !N,
|
|
3742
3857
|
children: /* @__PURE__ */ J("span", {
|
|
3743
|
-
className:
|
|
3858
|
+
className: xi.headerTitle,
|
|
3744
3859
|
"data-dg-header-title": !0,
|
|
3745
3860
|
children: Fe(p.columnDef.header, r.getContext())
|
|
3746
3861
|
})
|
|
3747
3862
|
}), n[213] = p.columnDef, n[214] = r, n[215] = N, n[216] = ve, n[217] = Ye) : Ye = n[217];
|
|
3748
3863
|
let Xe;
|
|
3749
3864
|
n[218] !== o || n[219] !== W || n[220] !== p || n[221] !== _ || n[222] !== ce || n[223] !== Ce || n[224] !== me || n[225] !== N || n[226] !== ge || n[227] !== ve || n[228] !== f || n[229] !== m || n[230] !== be || n[231] !== xe ? (Xe = N && /* @__PURE__ */ Y("div", {
|
|
3750
|
-
className:
|
|
3865
|
+
className: xi.headerActions,
|
|
3751
3866
|
children: [
|
|
3752
3867
|
me && /* @__PURE__ */ J(l, {
|
|
3753
|
-
className:
|
|
3868
|
+
className: xi.headerAction,
|
|
3754
3869
|
"data-pinned-visible": "true",
|
|
3755
3870
|
variant: "subtle",
|
|
3756
3871
|
color: "gray",
|
|
@@ -3759,15 +3874,15 @@ function Pi(t) {
|
|
|
3759
3874
|
"data-dg-part": "header-filter",
|
|
3760
3875
|
"data-column-id": p.id,
|
|
3761
3876
|
onClick: (e) => {
|
|
3762
|
-
e.stopPropagation(),
|
|
3877
|
+
e.stopPropagation(), oi(o, p.id);
|
|
3763
3878
|
},
|
|
3764
|
-
children: /* @__PURE__ */ J(
|
|
3879
|
+
children: /* @__PURE__ */ J(ne, {
|
|
3765
3880
|
size: 14,
|
|
3766
3881
|
stroke: 1.6
|
|
3767
3882
|
})
|
|
3768
3883
|
}),
|
|
3769
3884
|
W && /* @__PURE__ */ J(l, {
|
|
3770
|
-
className: `${
|
|
3885
|
+
className: `${xi.headerAction} ${xi.sortAction}`,
|
|
3771
3886
|
"data-pinned-visible": ge,
|
|
3772
3887
|
"data-sorted": ge,
|
|
3773
3888
|
variant: "subtle",
|
|
@@ -3783,7 +3898,7 @@ function Pi(t) {
|
|
|
3783
3898
|
})
|
|
3784
3899
|
}),
|
|
3785
3900
|
xe !== null && /* @__PURE__ */ J("span", {
|
|
3786
|
-
className:
|
|
3901
|
+
className: xi.sortIndex,
|
|
3787
3902
|
"data-dg-part": "sort-index",
|
|
3788
3903
|
children: xe
|
|
3789
3904
|
}),
|
|
@@ -3795,7 +3910,7 @@ function Pi(t) {
|
|
|
3795
3910
|
width: 220,
|
|
3796
3911
|
withinPortal: !0,
|
|
3797
3912
|
children: [/* @__PURE__ */ J(g.Target, { children: /* @__PURE__ */ J(l, {
|
|
3798
|
-
className:
|
|
3913
|
+
className: xi.headerAction,
|
|
3799
3914
|
"data-pinned-visible": m || _,
|
|
3800
3915
|
variant: "subtle",
|
|
3801
3916
|
color: "gray",
|
|
@@ -3804,32 +3919,32 @@ function Pi(t) {
|
|
|
3804
3919
|
"data-dg-part": "header-menu",
|
|
3805
3920
|
"data-column-id": p.id,
|
|
3806
3921
|
onClick: (e) => {
|
|
3807
|
-
e.stopPropagation(), h(
|
|
3922
|
+
e.stopPropagation(), h(Bi);
|
|
3808
3923
|
},
|
|
3809
|
-
children: /* @__PURE__ */ J(
|
|
3924
|
+
children: /* @__PURE__ */ J(U, {
|
|
3810
3925
|
size: 14,
|
|
3811
3926
|
stroke: 1.6
|
|
3812
3927
|
})
|
|
3813
3928
|
}) }), /* @__PURE__ */ J(g.Dropdown, {
|
|
3814
|
-
onClick:
|
|
3929
|
+
onClick: zi,
|
|
3815
3930
|
children: ce
|
|
3816
3931
|
})]
|
|
3817
3932
|
})
|
|
3818
3933
|
]
|
|
3819
3934
|
}), n[218] = o, n[219] = W, n[220] = p, n[221] = _, n[222] = ce, n[223] = Ce, n[224] = me, n[225] = N, n[226] = ge, n[227] = ve, n[228] = f, n[229] = m, n[230] = be, n[231] = xe, n[232] = Xe) : Xe = n[232];
|
|
3820
3935
|
let Ze;
|
|
3821
|
-
n[233] !== V || n[234] !== se || n[235] !== p.id || n[236] !== r || n[237] !== he ? (Ze = !
|
|
3936
|
+
n[233] !== V || n[234] !== se || n[235] !== p.id || n[236] !== r || n[237] !== he ? (Ze = !On(p.id) && /* @__PURE__ */ J("div", {
|
|
3822
3937
|
className: [
|
|
3823
|
-
|
|
3824
|
-
se ?
|
|
3825
|
-
he ?
|
|
3938
|
+
xi.columnSeparator,
|
|
3939
|
+
se ? xi.columnSeparatorResizable : "",
|
|
3940
|
+
he ? xi.columnSeparatorActive : ""
|
|
3826
3941
|
].filter(Boolean).join(" "),
|
|
3827
3942
|
draggable: !1,
|
|
3828
3943
|
onMouseDown: se ? (e) => {
|
|
3829
3944
|
S.current = !0, r.getResizeHandler()(e);
|
|
3830
3945
|
} : void 0,
|
|
3831
3946
|
onTouchStart: se ? r.getResizeHandler() : void 0,
|
|
3832
|
-
onClick:
|
|
3947
|
+
onClick: Ri,
|
|
3833
3948
|
onDoubleClick: se ? (e) => {
|
|
3834
3949
|
e.stopPropagation(), V();
|
|
3835
3950
|
} : void 0
|
|
@@ -3870,7 +3985,7 @@ function Pi(t) {
|
|
|
3870
3985
|
n[259] === $e ? tt = n[260] : (tt = /* @__PURE__ */ J(g.ContextMenu, { children: $e }), n[259] = $e, n[260] = tt);
|
|
3871
3986
|
let nt;
|
|
3872
3987
|
n[261] === ce ? nt = n[262] : (nt = /* @__PURE__ */ J(g.Dropdown, {
|
|
3873
|
-
onClick:
|
|
3988
|
+
onClick: Li,
|
|
3874
3989
|
children: ce
|
|
3875
3990
|
}), n[261] = ce, n[262] = nt);
|
|
3876
3991
|
let rt;
|
|
@@ -3884,25 +3999,25 @@ function Pi(t) {
|
|
|
3884
3999
|
children: [tt, nt]
|
|
3885
4000
|
}), n[263] = _, n[264] = tt, n[265] = nt, n[266] = rt) : rt = n[266], rt;
|
|
3886
4001
|
}
|
|
3887
|
-
function
|
|
4002
|
+
function Li(e) {
|
|
3888
4003
|
return e.stopPropagation();
|
|
3889
4004
|
}
|
|
3890
|
-
function
|
|
4005
|
+
function Ri(e) {
|
|
3891
4006
|
return e.stopPropagation();
|
|
3892
4007
|
}
|
|
3893
|
-
function
|
|
4008
|
+
function zi(e) {
|
|
3894
4009
|
return e.stopPropagation();
|
|
3895
4010
|
}
|
|
3896
|
-
function
|
|
4011
|
+
function Bi(e) {
|
|
3897
4012
|
return !e;
|
|
3898
4013
|
}
|
|
3899
|
-
function
|
|
4014
|
+
function Vi(e) {
|
|
3900
4015
|
e.shiftKey && e.preventDefault();
|
|
3901
4016
|
}
|
|
3902
|
-
function
|
|
4017
|
+
function Hi(e) {
|
|
3903
4018
|
return e.draggedColumnId;
|
|
3904
4019
|
}
|
|
3905
|
-
function
|
|
4020
|
+
function Ui(e) {
|
|
3906
4021
|
return {
|
|
3907
4022
|
sorting: e.sorting,
|
|
3908
4023
|
columnFilters: e.columnFilters,
|
|
@@ -3912,28 +4027,28 @@ function Vi(e) {
|
|
|
3912
4027
|
grouping: e.grouping
|
|
3913
4028
|
};
|
|
3914
4029
|
}
|
|
3915
|
-
function
|
|
4030
|
+
function Wi(e) {
|
|
3916
4031
|
return typeof e == "object" && !!e && "type" in e && e.type === g.Divider;
|
|
3917
4032
|
}
|
|
3918
4033
|
//#endregion
|
|
3919
4034
|
//#region src/tmdatagrid/components/editors/editorShared.ts
|
|
3920
|
-
function Ui(e) {
|
|
3921
|
-
return me(e.store, Wi);
|
|
3922
|
-
}
|
|
3923
|
-
function Wi(e) {
|
|
3924
|
-
return e.value;
|
|
3925
|
-
}
|
|
3926
4035
|
function Gi(e) {
|
|
3927
4036
|
return me(e.store, Ki);
|
|
3928
4037
|
}
|
|
3929
4038
|
function Ki(e) {
|
|
3930
|
-
return
|
|
4039
|
+
return e.value;
|
|
3931
4040
|
}
|
|
3932
4041
|
function qi(e) {
|
|
4042
|
+
return me(e.store, Ji);
|
|
4043
|
+
}
|
|
4044
|
+
function Ji(e) {
|
|
4045
|
+
return Ht(e.meta.errors);
|
|
4046
|
+
}
|
|
4047
|
+
function Yi(e) {
|
|
3933
4048
|
let t = e.currentTarget;
|
|
3934
4049
|
t instanceof HTMLInputElement && t.select();
|
|
3935
4050
|
}
|
|
3936
|
-
function
|
|
4051
|
+
function Xi() {
|
|
3937
4052
|
let t = e(2), n = s(null), r = s(null), i;
|
|
3938
4053
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = () => {
|
|
3939
4054
|
let e = r.current, t = n.current;
|
|
@@ -3954,9 +4069,9 @@ function Ji() {
|
|
|
3954
4069
|
}
|
|
3955
4070
|
//#endregion
|
|
3956
4071
|
//#region src/tmdatagrid/components/editors/TMDataGridBooleanEditor.tsx
|
|
3957
|
-
function
|
|
3958
|
-
let n = e(12), { field: r, column: i, size: a } = t, { labels: o } = Q(), s =
|
|
3959
|
-
n[0] !== i || n[1] !== o ? (l = o.editCell(
|
|
4072
|
+
function Zi(t) {
|
|
4073
|
+
let n = e(12), { field: r, column: i, size: a } = t, { labels: o } = Q(), s = Gi(r), c = qi(r), l;
|
|
4074
|
+
n[0] !== i || n[1] !== o ? (l = o.editCell(xn(i)), n[0] = i, n[1] = o, n[2] = l) : l = n[2];
|
|
3960
4075
|
let u = s === !0, d;
|
|
3961
4076
|
n[3] === r ? d = n[4] : (d = (e) => r.handleChange(e.currentTarget.checked), n[3] = r, n[4] = d);
|
|
3962
4077
|
let p;
|
|
@@ -3972,11 +4087,11 @@ function Yi(t) {
|
|
|
3972
4087
|
}
|
|
3973
4088
|
//#endregion
|
|
3974
4089
|
//#region src/tmdatagrid/components/editors/TMDataGridDateEditor.tsx
|
|
3975
|
-
function
|
|
3976
|
-
let n = e(14), { field: r, column: i, size: a } = t, { labels: o } = Q(), c =
|
|
4090
|
+
function Qi(t) {
|
|
4091
|
+
let n = e(14), { field: r, column: i, size: a } = t, { labels: o } = Q(), c = Gi(r), l = qi(r), u = s(c instanceof Date), d;
|
|
3977
4092
|
n[0] === c ? d = n[1] : (d = c instanceof Date ? c.toLocaleDateString("sv-SE") : typeof c == "string" ? c.slice(0, 10) : "", n[0] = c, n[1] = d);
|
|
3978
4093
|
let f = d, p;
|
|
3979
|
-
n[2] !== i || n[3] !== o ? (p = o.editCell(
|
|
4094
|
+
n[2] !== i || n[3] !== o ? (p = o.editCell(xn(i)), n[2] = i, n[3] = o, n[4] = p) : p = n[4];
|
|
3980
4095
|
let m;
|
|
3981
4096
|
n[5] === r ? m = n[6] : (m = (e) => {
|
|
3982
4097
|
let t = e.currentTarget.value;
|
|
@@ -4001,13 +4116,13 @@ function Xi(t) {
|
|
|
4001
4116
|
}
|
|
4002
4117
|
//#endregion
|
|
4003
4118
|
//#region src/tmdatagrid/components/editors/TMDataGridMultiSelectEditor.tsx
|
|
4004
|
-
function
|
|
4005
|
-
let n = e(20), { field: r, column: i, row: a, table: o, size: s } = t, { labels: c } = Q(), l =
|
|
4119
|
+
function $i(t) {
|
|
4120
|
+
let n = e(20), { field: r, column: i, row: a, table: o, size: s } = t, { labels: c } = Q(), l = Gi(r), u = qi(r), d;
|
|
4006
4121
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (d = { withinPortal: !1 }, n[0] = d) : d = n[0];
|
|
4007
4122
|
let f;
|
|
4008
|
-
n[1] !== i || n[2] !== c ? (f = c.editCell(
|
|
4123
|
+
n[1] !== i || n[2] !== c ? (f = c.editCell(xn(i)), n[1] = i, n[2] = c, n[3] = f) : f = n[3];
|
|
4009
4124
|
let p;
|
|
4010
|
-
n[4] !== i || n[5] !== a || n[6] !== o ? (p =
|
|
4125
|
+
n[4] !== i || n[5] !== a || n[6] !== o ? (p = Xn(Yn({
|
|
4011
4126
|
table: o,
|
|
4012
4127
|
column: i,
|
|
4013
4128
|
row: a,
|
|
@@ -4034,37 +4149,43 @@ function Zi(t) {
|
|
|
4034
4149
|
}
|
|
4035
4150
|
//#endregion
|
|
4036
4151
|
//#region src/tmdatagrid/components/editors/TMDataGridNumberEditor.tsx
|
|
4037
|
-
function
|
|
4038
|
-
let n = e(15), { field: r, column: i, size: a } = t, { labels: o } = Q(), s =
|
|
4039
|
-
n[0] !== i || n[1] !== o ? (
|
|
4040
|
-
let
|
|
4041
|
-
n[3] !== r || n[4] !==
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4152
|
+
function ea(t) {
|
|
4153
|
+
let n = e(15), { field: r, column: i, size: a } = t, { labels: o } = Q(), s = Gi(r), l = qi(r), { inputRef: u, remember: d } = Xi(), [f, p] = c(null), m = f === null || f === "" ? null : Number(f), h = Number.isFinite(m) ? m === s : s === null, g;
|
|
4154
|
+
n[0] !== i || n[1] !== o ? (g = o.editCell(xn(i)), n[0] = i, n[1] = o, n[2] = g) : g = n[2];
|
|
4155
|
+
let _ = f !== null && h ? f : typeof s == "number" ? s : "", y;
|
|
4156
|
+
n[3] !== r || n[4] !== u || n[5] !== d ? (y = (e) => {
|
|
4157
|
+
if (u.current !== null && d(u.current), typeof e == "number") {
|
|
4158
|
+
p(null), r.handleChange(e);
|
|
4159
|
+
return;
|
|
4160
|
+
}
|
|
4161
|
+
p(e);
|
|
4162
|
+
let t = Number(e);
|
|
4163
|
+
r.handleChange(e !== "" && Number.isFinite(t) ? t : null);
|
|
4164
|
+
}, n[3] = r, n[4] = u, n[5] = d, n[6] = y) : y = n[6];
|
|
4165
|
+
let b;
|
|
4166
|
+
return n[7] !== l || n[8] !== r.handleBlur || n[9] !== u || n[10] !== a || n[11] !== g || n[12] !== _ || n[13] !== y ? (b = /* @__PURE__ */ J(v, {
|
|
4167
|
+
ref: u,
|
|
4047
4168
|
size: a,
|
|
4048
4169
|
w: "100%",
|
|
4049
|
-
onFocus:
|
|
4170
|
+
onFocus: Yi,
|
|
4050
4171
|
hideControls: !0,
|
|
4051
|
-
"aria-label":
|
|
4172
|
+
"aria-label": g,
|
|
4052
4173
|
"data-dg-part": "editor-input",
|
|
4053
|
-
value:
|
|
4054
|
-
onChange:
|
|
4174
|
+
value: _,
|
|
4175
|
+
onChange: y,
|
|
4055
4176
|
onBlur: r.handleBlur,
|
|
4056
|
-
error:
|
|
4057
|
-
}), n[7] =
|
|
4177
|
+
error: l
|
|
4178
|
+
}), n[7] = l, n[8] = r.handleBlur, n[9] = u, n[10] = a, n[11] = g, n[12] = _, n[13] = y, n[14] = b) : b = n[14], b;
|
|
4058
4179
|
}
|
|
4059
4180
|
//#endregion
|
|
4060
4181
|
//#region src/tmdatagrid/components/editors/TMDataGridSelectEditor.tsx
|
|
4061
|
-
function
|
|
4062
|
-
let n = e(20), { field: r, column: i, row: a, table: o, size: s, commit: c } = t, { labels: l, features: u } = Q(), d =
|
|
4182
|
+
function ta(t) {
|
|
4183
|
+
let n = e(20), { field: r, column: i, row: a, table: o, size: s, commit: c } = t, { labels: l, features: u } = Q(), d = Gi(r), f = qi(r), p;
|
|
4063
4184
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (p = { withinPortal: !1 }, n[0] = p) : p = n[0];
|
|
4064
4185
|
let m;
|
|
4065
|
-
n[1] !== i || n[2] !== l ? (m = l.editCell(
|
|
4186
|
+
n[1] !== i || n[2] !== l ? (m = l.editCell(xn(i)), n[1] = i, n[2] = l, n[3] = m) : m = n[3];
|
|
4066
4187
|
let h;
|
|
4067
|
-
n[4] !== i || n[5] !== a || n[6] !== o ? (h =
|
|
4188
|
+
n[4] !== i || n[5] !== a || n[6] !== o ? (h = Xn(Yn({
|
|
4068
4189
|
table: o,
|
|
4069
4190
|
column: i,
|
|
4070
4191
|
row: a,
|
|
@@ -4091,9 +4212,9 @@ function $i(t) {
|
|
|
4091
4212
|
}
|
|
4092
4213
|
//#endregion
|
|
4093
4214
|
//#region src/tmdatagrid/components/editors/TMDataGridStringEditor.tsx
|
|
4094
|
-
function
|
|
4095
|
-
let n = e(14), { field: r, column: i, size: a } = t, { labels: o } = Q(), s =
|
|
4096
|
-
n[0] !== i || n[1] !== o ? (d = o.editCell(
|
|
4215
|
+
function na(t) {
|
|
4216
|
+
let n = e(14), { field: r, column: i, size: a } = t, { labels: o } = Q(), s = Gi(r), c = qi(r), { inputRef: l, remember: u } = Xi(), d;
|
|
4217
|
+
n[0] !== i || n[1] !== o ? (d = o.editCell(xn(i)), n[0] = i, n[1] = o, n[2] = d) : d = n[2];
|
|
4097
4218
|
let f = typeof s == "string" ? s : "", p;
|
|
4098
4219
|
n[3] !== r || n[4] !== u ? (p = (e) => {
|
|
4099
4220
|
u(e.currentTarget), r.handleChange(e.currentTarget.value);
|
|
@@ -4103,7 +4224,7 @@ function ea(t) {
|
|
|
4103
4224
|
ref: l,
|
|
4104
4225
|
size: a,
|
|
4105
4226
|
w: "100%",
|
|
4106
|
-
onFocus:
|
|
4227
|
+
onFocus: Yi,
|
|
4107
4228
|
"aria-label": d,
|
|
4108
4229
|
"data-dg-part": "editor-input",
|
|
4109
4230
|
value: f,
|
|
@@ -4114,16 +4235,16 @@ function ea(t) {
|
|
|
4114
4235
|
}
|
|
4115
4236
|
//#endregion
|
|
4116
4237
|
//#region src/tmdatagrid/components/TMDataGridCellEditor.tsx
|
|
4117
|
-
var
|
|
4118
|
-
string:
|
|
4119
|
-
number:
|
|
4120
|
-
boolean:
|
|
4121
|
-
date:
|
|
4122
|
-
select:
|
|
4123
|
-
multiSelect:
|
|
4238
|
+
var ra = {
|
|
4239
|
+
string: na,
|
|
4240
|
+
number: ea,
|
|
4241
|
+
boolean: Zi,
|
|
4242
|
+
date: Qi,
|
|
4243
|
+
select: ta,
|
|
4244
|
+
multiSelect: $i
|
|
4124
4245
|
};
|
|
4125
|
-
function
|
|
4126
|
-
let { table: o, edit: u, features: d, labels: f, controlSize: p } = Q(), m = d.editMode === "row" || a, h = e.column, g = u.getForm(t.id), _ =
|
|
4246
|
+
function ia({ cell: e, row: t, takeSeedText: n, onClose: r, inEntryBlock: a = !1 }) {
|
|
4247
|
+
let { table: o, edit: u, features: d, labels: f, controlSize: p } = Q(), m = d.editMode === "row" || a, h = e.column, g = u.getForm(t.id), _ = Lt(h), [v] = c(() => n()), y = s(void 0);
|
|
4127
4248
|
i(() => {
|
|
4128
4249
|
y.current = h.columnDef.meta?.edit?.mapValue;
|
|
4129
4250
|
});
|
|
@@ -4131,7 +4252,7 @@ function na({ cell: e, row: t, takeSeedText: n, onClose: r, inEntryBlock: a = !1
|
|
|
4131
4252
|
let e = new de({
|
|
4132
4253
|
form: g,
|
|
4133
4254
|
name: _,
|
|
4134
|
-
validators:
|
|
4255
|
+
validators: qt(h.columnDef.meta?.edit?.validate)
|
|
4135
4256
|
}), n = e.handleChange.bind(e);
|
|
4136
4257
|
return e.handleChange = ((r) => {
|
|
4137
4258
|
let i = y.current, a = e.state.value, s = typeof r == "function" ? r(a) : r;
|
|
@@ -4197,7 +4318,7 @@ function na({ cell: e, row: t, takeSeedText: n, onClose: r, inEntryBlock: a = !1
|
|
|
4197
4318
|
cancel: C,
|
|
4198
4319
|
size: p,
|
|
4199
4320
|
seedText: v
|
|
4200
|
-
}, O = h.columnDef.meta?.edit?.editor ??
|
|
4321
|
+
}, O = h.columnDef.meta?.edit?.editor ?? ra[h.columnDef.meta?.type ?? "string"] ?? na;
|
|
4201
4322
|
return /* @__PURE__ */ Y("div", {
|
|
4202
4323
|
className: $.cellEditor,
|
|
4203
4324
|
"data-dg-part": "editor",
|
|
@@ -4239,7 +4360,7 @@ function na({ cell: e, row: t, takeSeedText: n, onClose: r, inEntryBlock: a = !1
|
|
|
4239
4360
|
}
|
|
4240
4361
|
//#endregion
|
|
4241
4362
|
//#region src/tmdatagrid/core/editorFocus.ts
|
|
4242
|
-
var
|
|
4363
|
+
var aa = [
|
|
4243
4364
|
"button:not([disabled])",
|
|
4244
4365
|
"input:not([disabled])",
|
|
4245
4366
|
"select:not([disabled])",
|
|
@@ -4247,16 +4368,16 @@ var ra = [
|
|
|
4247
4368
|
"a[href]",
|
|
4248
4369
|
"[tabindex]:not([tabindex=\"-1\"])"
|
|
4249
4370
|
].join(",");
|
|
4250
|
-
function
|
|
4251
|
-
(e.querySelector("[data-dg-part=\"editor-input\"]") ?? e.querySelector(
|
|
4371
|
+
function oa(e) {
|
|
4372
|
+
(e.querySelector("[data-dg-part=\"editor-input\"]") ?? e.querySelector(aa))?.focus();
|
|
4252
4373
|
}
|
|
4253
4374
|
//#endregion
|
|
4254
4375
|
//#region src/tmdatagrid/components/TMDataGridEntryRows.tsx
|
|
4255
|
-
function
|
|
4256
|
-
return
|
|
4376
|
+
function sa(e, t, n) {
|
|
4377
|
+
return n.isColumnEditable(t) ? En(t, e) : !1;
|
|
4257
4378
|
}
|
|
4258
|
-
function
|
|
4259
|
-
let n = e(38), { orderedColumns: r, layoutFor: i, rowHeight: o } = t, { table: c, edit: l, features: u } = Q(), d = j(l.store,
|
|
4379
|
+
function ca(t) {
|
|
4380
|
+
let n = e(38), { orderedColumns: r, layoutFor: i, rowHeight: o } = t, { table: c, edit: l, features: u } = Q(), d = j(l.store, ma), f = j(l.store, pa), p = s(null), m = s(null), h = s(null), g;
|
|
4260
4381
|
n[0] === d ? g = n[1] : (g = () => {
|
|
4261
4382
|
let e = d.at(-1)?.tempId;
|
|
4262
4383
|
if (e === void 0) {
|
|
@@ -4267,7 +4388,7 @@ function oa(t) {
|
|
|
4267
4388
|
let t = p.current;
|
|
4268
4389
|
if (t === null) return;
|
|
4269
4390
|
let n = t.querySelector(`[data-dg-part="editor"][data-row-id="${CSS.escape(e)}"]`);
|
|
4270
|
-
n !== null && (m.current = e,
|
|
4391
|
+
n !== null && (m.current = e, oa(n));
|
|
4271
4392
|
}, n[0] = d, n[1] = g), a(g);
|
|
4272
4393
|
let _;
|
|
4273
4394
|
n[2] === f ? _ = n[3] : (_ = () => {
|
|
@@ -4280,7 +4401,7 @@ function oa(t) {
|
|
|
4280
4401
|
let t = p.current;
|
|
4281
4402
|
if (t === null) return;
|
|
4282
4403
|
let n = t.querySelector(f.columnId === null ? `[data-dg-part="editor"][data-row-id="${CSS.escape(f.rowId)}"]` : `[data-dg-part="editor"][data-row-id="${CSS.escape(f.rowId)}"][data-column-id="${CSS.escape(f.columnId)}"]`);
|
|
4283
|
-
n !== null && (h.current = e,
|
|
4404
|
+
n !== null && (h.current = e, oa(n));
|
|
4284
4405
|
}, n[2] = f, n[3] = _), a(_);
|
|
4285
4406
|
let v;
|
|
4286
4407
|
if (n[4] !== l || n[5] !== d) {
|
|
@@ -4294,7 +4415,7 @@ function oa(t) {
|
|
|
4294
4415
|
n[9] === d ? b = n[10] : (b = (e, t) => d[t]?.tempId ?? String(t), n[9] = d, n[10] = b);
|
|
4295
4416
|
let x;
|
|
4296
4417
|
n[11] !== y || n[12] !== b || n[13] !== c.options.columns ? (x = {
|
|
4297
|
-
features:
|
|
4418
|
+
features: $r,
|
|
4298
4419
|
columns: c.options.columns,
|
|
4299
4420
|
data: y,
|
|
4300
4421
|
getRowId: b
|
|
@@ -4304,12 +4425,12 @@ function oa(t) {
|
|
|
4304
4425
|
let C, w;
|
|
4305
4426
|
if (n[15] !== l || n[16] !== S || n[17] !== u.editNewRowsSticky || n[18] !== i || n[19] !== d || n[20] !== r || n[21] !== o) {
|
|
4306
4427
|
let e = S.getCoreRowModel().rows, t;
|
|
4307
|
-
n[24] === d ? t = n[25] : (t = new Map(d.map(
|
|
4428
|
+
n[24] === d ? t = n[25] : (t = new Map(d.map(fa)), n[24] = d, n[25] = t);
|
|
4308
4429
|
let a = t, s;
|
|
4309
4430
|
n[26] !== a || n[27] !== u.editNewRowsSticky ? (s = (e) => u.editNewRowsSticky || a.get(e.id) !== !0, n[26] = a, n[27] = u.editNewRowsSticky, n[28] = s) : s = n[28];
|
|
4310
4431
|
let c = e.filter(s), f = u.editNewRowsSticky ? [] : e.filter((e) => a.get(e.id) === !0), m;
|
|
4311
4432
|
n[29] !== a || n[30] !== l || n[31] !== i || n[32] !== r || n[33] !== o ? (m = (e, t) => {
|
|
4312
|
-
let n = new Map(e.getAllCells().map(
|
|
4433
|
+
let n = new Map(e.getAllCells().map(da)), s = a.get(e.id) === !0;
|
|
4313
4434
|
return /* @__PURE__ */ J("div", {
|
|
4314
4435
|
role: "row",
|
|
4315
4436
|
"data-dg-part": "entry-row",
|
|
@@ -4319,20 +4440,20 @@ function oa(t) {
|
|
|
4319
4440
|
"data-draft": s,
|
|
4320
4441
|
className: $.entryRow,
|
|
4321
4442
|
children: r.map((r) => {
|
|
4322
|
-
let a = n.get(r.id), c = i(r.id), u = a !== void 0 &&
|
|
4443
|
+
let a = n.get(r.id), c = i(r.id), u = a !== void 0 && sa(e, r, l);
|
|
4323
4444
|
return /* @__PURE__ */ J("div", {
|
|
4324
4445
|
role: "cell",
|
|
4325
4446
|
"data-column-id": r.id,
|
|
4326
|
-
"data-align":
|
|
4327
|
-
"data-control-column":
|
|
4328
|
-
onDoubleClick: s && !
|
|
4447
|
+
"data-align": Dn(r),
|
|
4448
|
+
"data-control-column": On(r.id),
|
|
4449
|
+
onDoubleClick: s && !On(r.id) ? () => l.begin({
|
|
4329
4450
|
rowId: e.id,
|
|
4330
4451
|
columnId: u ? r.id : null
|
|
4331
4452
|
}) : void 0,
|
|
4332
4453
|
className: [
|
|
4333
4454
|
$.entryCell,
|
|
4334
|
-
c.isBoundary && c.pinnedAt === "left" ?
|
|
4335
|
-
c.isBoundary && c.pinnedAt === "right" ?
|
|
4455
|
+
c.isBoundary && c.pinnedAt === "left" ? bi.stickyLeft : "",
|
|
4456
|
+
c.isBoundary && c.pinnedAt === "right" ? bi.stickyRight : ""
|
|
4336
4457
|
].filter(Boolean).join(" "),
|
|
4337
4458
|
style: {
|
|
4338
4459
|
minHeight: o,
|
|
@@ -4344,11 +4465,11 @@ function oa(t) {
|
|
|
4344
4465
|
children: a !== void 0 && r.id === "__edit__" ? Fe(a.column.columnDef.cell, a.getContext()) : s && a !== void 0 ? /* @__PURE__ */ J("span", {
|
|
4345
4466
|
className: $.cellContent,
|
|
4346
4467
|
children: Fe(a.column.columnDef.cell, a.getContext())
|
|
4347
|
-
}) : u && a !== void 0 ? /* @__PURE__ */ J(
|
|
4468
|
+
}) : u && a !== void 0 ? /* @__PURE__ */ J(ia, {
|
|
4348
4469
|
cell: a,
|
|
4349
4470
|
row: e,
|
|
4350
|
-
takeSeedText:
|
|
4351
|
-
onClose:
|
|
4471
|
+
takeSeedText: ua,
|
|
4472
|
+
onClose: la,
|
|
4352
4473
|
inEntryBlock: !0
|
|
4353
4474
|
}) : null
|
|
4354
4475
|
}, r.id);
|
|
@@ -4372,23 +4493,23 @@ function oa(t) {
|
|
|
4372
4493
|
let T;
|
|
4373
4494
|
return n[35] !== C || n[36] !== w ? (T = /* @__PURE__ */ Y(ue, { children: [C, w] }), n[35] = C, n[36] = w, n[37] = T) : T = n[37], T;
|
|
4374
4495
|
}
|
|
4375
|
-
function
|
|
4376
|
-
function
|
|
4377
|
-
function
|
|
4496
|
+
function la() {}
|
|
4497
|
+
function ua() {}
|
|
4498
|
+
function da(e) {
|
|
4378
4499
|
return [e.column.id, e];
|
|
4379
4500
|
}
|
|
4380
|
-
function
|
|
4501
|
+
function fa(e) {
|
|
4381
4502
|
return [e.tempId, e.committed];
|
|
4382
4503
|
}
|
|
4383
|
-
function
|
|
4504
|
+
function pa(e) {
|
|
4384
4505
|
return e.active !== null && e.newRows.some((t) => t.tempId === e.active?.rowId && !t.committed) ? e.active : null;
|
|
4385
4506
|
}
|
|
4386
|
-
function
|
|
4507
|
+
function ma(e) {
|
|
4387
4508
|
return e.newRows;
|
|
4388
4509
|
}
|
|
4389
4510
|
//#endregion
|
|
4390
4511
|
//#region src/tmdatagrid/core/draftCellContext.ts
|
|
4391
|
-
function
|
|
4512
|
+
function ha(e, t) {
|
|
4392
4513
|
let n = Object.create(e.row), r = n;
|
|
4393
4514
|
r.original = t, r._valuesCache = Object.create(null), r._uniqueValuesCache = Object.create(null);
|
|
4394
4515
|
let i = Object.create(e);
|
|
@@ -4403,7 +4524,7 @@ function pa(e, t) {
|
|
|
4403
4524
|
}
|
|
4404
4525
|
//#endregion
|
|
4405
4526
|
//#region src/tmdatagrid/core/cellRange.ts
|
|
4406
|
-
function
|
|
4527
|
+
function ga({ range: e, rowIndexOf: t, columnIndexOf: n }) {
|
|
4407
4528
|
if (e === null) return null;
|
|
4408
4529
|
let r = t(e.anchor.rowId), i = t(e.focus.rowId), a = n(e.anchor.columnId), o = n(e.focus.columnId);
|
|
4409
4530
|
return r < 0 || i < 0 || a < 0 || o < 0 ? null : {
|
|
@@ -4413,14 +4534,14 @@ function ma({ range: e, rowIndexOf: t, columnIndexOf: n }) {
|
|
|
4413
4534
|
right: Math.max(a, o)
|
|
4414
4535
|
};
|
|
4415
4536
|
}
|
|
4416
|
-
function
|
|
4537
|
+
function _a(e, t, n) {
|
|
4417
4538
|
return e !== null && t >= e.top && t <= e.bottom && n >= e.left && n <= e.right;
|
|
4418
4539
|
}
|
|
4419
|
-
function
|
|
4540
|
+
function va(e) {
|
|
4420
4541
|
return e === null ? 0 : (e.bottom - e.top + 1) * (e.right - e.left + 1);
|
|
4421
4542
|
}
|
|
4422
|
-
function
|
|
4423
|
-
return !
|
|
4543
|
+
function ya(e, t, n) {
|
|
4544
|
+
return !_a(e, t, n) || e === null ? null : {
|
|
4424
4545
|
top: t === e.top,
|
|
4425
4546
|
bottom: t === e.bottom,
|
|
4426
4547
|
left: n === e.left,
|
|
@@ -4429,13 +4550,13 @@ function _a(e, t, n) {
|
|
|
4429
4550
|
}
|
|
4430
4551
|
//#endregion
|
|
4431
4552
|
//#region src/tmdatagrid/core/cellExport.ts
|
|
4432
|
-
var
|
|
4553
|
+
var ba = "", xa = {
|
|
4433
4554
|
separator: ";",
|
|
4434
4555
|
decimalComma: !0,
|
|
4435
4556
|
includeHeaders: !0,
|
|
4436
4557
|
fileName: "export"
|
|
4437
4558
|
};
|
|
4438
|
-
function
|
|
4559
|
+
function Sa(e, { decimalComma: t }) {
|
|
4439
4560
|
if (e == null) return "";
|
|
4440
4561
|
if (typeof e == "number") {
|
|
4441
4562
|
if (!Number.isFinite(e)) return "";
|
|
@@ -4444,7 +4565,7 @@ function ba(e, { decimalComma: t }) {
|
|
|
4444
4565
|
}
|
|
4445
4566
|
if (typeof e == "string") return e;
|
|
4446
4567
|
if (typeof e == "boolean") return e ? "true" : "false";
|
|
4447
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
4568
|
+
if (Array.isArray(e)) return e.map((e) => Sa(e, { decimalComma: t })).join(", ");
|
|
4448
4569
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? "" : e.toLocaleString("sv-SE");
|
|
4449
4570
|
if (typeof e == "object") try {
|
|
4450
4571
|
return JSON.stringify(e);
|
|
@@ -4453,18 +4574,18 @@ function ba(e, { decimalComma: t }) {
|
|
|
4453
4574
|
}
|
|
4454
4575
|
return String(e);
|
|
4455
4576
|
}
|
|
4456
|
-
function
|
|
4457
|
-
let a = t.slice(n.left, n.right + 1).filter((e) => !
|
|
4577
|
+
function Ca({ rows: e, columns: t, bounds: n, includeHeaders: r, decimalComma: i }) {
|
|
4578
|
+
let a = t.slice(n.left, n.right + 1).filter((e) => !On(e.id));
|
|
4458
4579
|
if (a.length === 0) return [];
|
|
4459
4580
|
let o = [];
|
|
4460
|
-
r && o.push(a.map((e) =>
|
|
4581
|
+
r && o.push(a.map((e) => xn(e)));
|
|
4461
4582
|
for (let t = n.top; t <= n.bottom; t += 1) {
|
|
4462
4583
|
let n = e[t];
|
|
4463
|
-
n !== void 0 && o.push(a.map((e) =>
|
|
4584
|
+
n !== void 0 && o.push(a.map((e) => Sa(n.getValue(e.id), { decimalComma: i })));
|
|
4464
4585
|
}
|
|
4465
4586
|
return o;
|
|
4466
4587
|
}
|
|
4467
|
-
function
|
|
4588
|
+
function wa({ table: e, includeHeaders: t = xa.includeHeaders, decimalComma: n = xa.decimalComma }) {
|
|
4468
4589
|
let r = e, i = [
|
|
4469
4590
|
...r.getLeftVisibleLeafColumns(),
|
|
4470
4591
|
...r.getCenterVisibleLeafColumns(),
|
|
@@ -4472,7 +4593,7 @@ function Sa({ table: e, includeHeaders: t = ya.includeHeaders, decimalComma: n =
|
|
|
4472
4593
|
], a = [], o = (e) => {
|
|
4473
4594
|
for (let t of e) t.getIsGrouped() ? o(t.subRows) : a.push(t);
|
|
4474
4595
|
};
|
|
4475
|
-
return o(r.getSortedRowModel().rows),
|
|
4596
|
+
return o(r.getSortedRowModel().rows), Ca({
|
|
4476
4597
|
rows: a,
|
|
4477
4598
|
columns: i,
|
|
4478
4599
|
bounds: {
|
|
@@ -4485,43 +4606,43 @@ function Sa({ table: e, includeHeaders: t = ya.includeHeaders, decimalComma: n =
|
|
|
4485
4606
|
decimalComma: n
|
|
4486
4607
|
});
|
|
4487
4608
|
}
|
|
4488
|
-
function
|
|
4609
|
+
function Ta({ table: e, options: t }) {
|
|
4489
4610
|
let n = {
|
|
4490
|
-
...
|
|
4611
|
+
...xa,
|
|
4491
4612
|
...t
|
|
4492
|
-
}, r =
|
|
4613
|
+
}, r = wa({
|
|
4493
4614
|
table: e,
|
|
4494
4615
|
includeHeaders: n.includeHeaders,
|
|
4495
4616
|
decimalComma: n.decimalComma
|
|
4496
4617
|
});
|
|
4497
|
-
r.length !== 0 &&
|
|
4618
|
+
r.length !== 0 && Aa({
|
|
4498
4619
|
fileName: `${n.fileName}.csv`,
|
|
4499
|
-
text:
|
|
4620
|
+
text: Oa(r, { separator: n.separator })
|
|
4500
4621
|
});
|
|
4501
4622
|
}
|
|
4502
|
-
function
|
|
4623
|
+
function Ea(e, t) {
|
|
4503
4624
|
return e.includes(t) || e.includes("\"") || e.includes("\n") || e.includes("\r") ? `"${e.replaceAll("\"", "\"\"")}"` : e;
|
|
4504
4625
|
}
|
|
4505
|
-
function
|
|
4506
|
-
return e.map((e) => e.map((e) =>
|
|
4626
|
+
function Da(e) {
|
|
4627
|
+
return e.map((e) => e.map((e) => Ea(e, " ")).join(" ")).join("\r\n");
|
|
4507
4628
|
}
|
|
4508
|
-
function
|
|
4509
|
-
return `${
|
|
4629
|
+
function Oa(e, { separator: t }) {
|
|
4630
|
+
return `${ba}sep=${t}\r\n${e.map((e) => e.map((e) => Ea(e, t)).join(t)).join("\r\n")}\r\n`;
|
|
4510
4631
|
}
|
|
4511
|
-
async function
|
|
4632
|
+
async function ka(e) {
|
|
4512
4633
|
try {
|
|
4513
4634
|
return await navigator.clipboard.writeText(e), !0;
|
|
4514
4635
|
} catch {
|
|
4515
4636
|
return !1;
|
|
4516
4637
|
}
|
|
4517
4638
|
}
|
|
4518
|
-
function
|
|
4639
|
+
function Aa({ fileName: e, text: t, mimeType: n = "text/csv;charset=utf-8" }) {
|
|
4519
4640
|
let r = URL.createObjectURL(new Blob([t], { type: n })), i = document.createElement("a");
|
|
4520
4641
|
i.href = r, i.download = e, i.style.display = "none", document.body.append(i), i.click(), i.remove(), setTimeout(() => URL.revokeObjectURL(r), 0);
|
|
4521
4642
|
}
|
|
4522
4643
|
//#endregion
|
|
4523
4644
|
//#region src/tmdatagrid/core/rowPinning.ts
|
|
4524
|
-
function
|
|
4645
|
+
function ja(e, t) {
|
|
4525
4646
|
let n = e.store.state.rowPinning[t];
|
|
4526
4647
|
if (n.length === 0) return [];
|
|
4527
4648
|
let r = e.getPrePaginatedRowModel().rowsById, i = e.getCoreRowModel().rowsById, a = [];
|
|
@@ -4533,17 +4654,17 @@ function ka(e, t) {
|
|
|
4533
4654
|
}
|
|
4534
4655
|
//#endregion
|
|
4535
4656
|
//#region src/tmdatagrid/core/matchHighlight.ts
|
|
4536
|
-
var
|
|
4657
|
+
var Ma = [
|
|
4537
4658
|
"contains",
|
|
4538
4659
|
"startsWith",
|
|
4539
4660
|
"endsWith"
|
|
4540
4661
|
];
|
|
4541
|
-
function
|
|
4662
|
+
function Na(e) {
|
|
4542
4663
|
let t = e.store.state, n = typeof t.globalFilter == "string" ? t.globalFilter.trim() : "", r = /* @__PURE__ */ new Map();
|
|
4543
4664
|
for (let e of t.columnFilters) {
|
|
4544
4665
|
if (!_t(e.value)) continue;
|
|
4545
4666
|
let { operator: t, value: n } = e.value;
|
|
4546
|
-
if (!
|
|
4667
|
+
if (!Ma.includes(t) || typeof n != "string" || n === "") continue;
|
|
4547
4668
|
let i = r.get(e.id) ?? [];
|
|
4548
4669
|
i.push(n), r.set(e.id, i);
|
|
4549
4670
|
}
|
|
@@ -4557,7 +4678,7 @@ function ja(e) {
|
|
|
4557
4678
|
}
|
|
4558
4679
|
return i.size > 0 ? i : null;
|
|
4559
4680
|
}
|
|
4560
|
-
function
|
|
4681
|
+
function Pa(e, t) {
|
|
4561
4682
|
let n = e.toLowerCase(), r = [];
|
|
4562
4683
|
for (let e of t) {
|
|
4563
4684
|
let t = e.toLowerCase();
|
|
@@ -4579,26 +4700,26 @@ function Ma(e, t) {
|
|
|
4579
4700
|
}
|
|
4580
4701
|
//#endregion
|
|
4581
4702
|
//#region src/tmdatagrid/components/TMDataGridTable.tsx
|
|
4582
|
-
var
|
|
4703
|
+
var Fa = {
|
|
4583
4704
|
pinnedAt: !1,
|
|
4584
4705
|
offset: 0,
|
|
4585
4706
|
isBoundary: !1
|
|
4586
4707
|
};
|
|
4587
|
-
function
|
|
4708
|
+
function Ia(e, t) {
|
|
4588
4709
|
return e.querySelector(`[data-cell="true"][data-row-id="${CSS.escape(t.rowId)}"][data-column-id="${CSS.escape(t.columnId)}"]`);
|
|
4589
4710
|
}
|
|
4590
|
-
function
|
|
4711
|
+
function La({ container: e, cellElement: t, leftPinnedWidth: n, rightPinnedWidth: r }) {
|
|
4591
4712
|
let i = t.getBoundingClientRect(), a = e.getBoundingClientRect(), o = a.left + n, s = a.right - r;
|
|
4592
4713
|
i.left < o ? e.scrollLeft -= o - i.left : i.right > s && (e.scrollLeft += i.right - s);
|
|
4593
4714
|
}
|
|
4594
|
-
function
|
|
4715
|
+
function Ra(e) {
|
|
4595
4716
|
if (e.getIsPlaceholder()) return null;
|
|
4596
4717
|
if (!e.getIsAggregated()) return Fe(e.column.columnDef.cell, e.getContext());
|
|
4597
4718
|
let { aggregatedCell: t, aggregationFn: n } = e.column.columnDef;
|
|
4598
4719
|
return t === void 0 ? n === void 0 ? null : Fe(e.column.columnDef.cell, e.getContext()) : Fe(t, e.getContext());
|
|
4599
4720
|
}
|
|
4600
|
-
function
|
|
4601
|
-
let n =
|
|
4721
|
+
function za(e, t) {
|
|
4722
|
+
let n = Pa(e, t);
|
|
4602
4723
|
if (n === null) return e;
|
|
4603
4724
|
let r = [], i = 0;
|
|
4604
4725
|
for (let t of n) t.start > i && r.push(e.slice(i, t.start)), r.push(/* @__PURE__ */ J("mark", {
|
|
@@ -4607,11 +4728,11 @@ function La(e, t) {
|
|
|
4607
4728
|
}, t.start)), i = t.end;
|
|
4608
4729
|
return i < e.length && r.push(e.slice(i)), r;
|
|
4609
4730
|
}
|
|
4610
|
-
function
|
|
4731
|
+
function Ba(t) {
|
|
4611
4732
|
let n = e(59), { cell: r, rowHeight: i, layout: a, nav: o, editor: s, contentOverride: c, highlightNeedles: l, onFocus: u, onClick: d, onMouseDown: f, onMouseEnter: p, onDoubleClick: m, onContextMenu: h } = t, { table: g, edit: _ } = Q(), v;
|
|
4612
|
-
n[0] === r.column ? v = n[1] : (v =
|
|
4733
|
+
n[0] === r.column ? v = n[1] : (v = Lt(r.column), n[0] = r.column, n[1] = v);
|
|
4613
4734
|
let y = v, b = r.row.id, x;
|
|
4614
|
-
n[2] === r.column.id ? x = n[3] : (x =
|
|
4735
|
+
n[2] === r.column.id ? x = n[3] : (x = On(r.column.id), n[2] = r.column.id, n[3] = x);
|
|
4615
4736
|
let S = x, C;
|
|
4616
4737
|
n[4] !== b || n[5] !== y ? (C = (e) => {
|
|
4617
4738
|
if (y === null) return !1;
|
|
@@ -4626,14 +4747,14 @@ function Ra(t) {
|
|
|
4626
4747
|
}, n[7] = b, n[8] = y, n[9] = T) : T = n[9];
|
|
4627
4748
|
let E = j(_.store, T), D;
|
|
4628
4749
|
n[10] !== b || n[11] !== S ? (D = (e) => S ? void 0 : e.rows[b]?.values, n[10] = b, n[11] = S, n[12] = D) : D = n[12];
|
|
4629
|
-
let O = j(_.store, D), k = o ? "gridcell" : "cell", A = o?.columnIndex, M = o?.tabIndex, N = o ? !0 : void 0, P = r.row.id, F = r.column.id, I = o?.focused, L = o?.selected, R = o?.selected, z = o?.edges?.top, B = o?.edges?.bottom, V = o?.edges?.left, H = o?.edges?.right, ee = s !== void 0 || void 0,
|
|
4630
|
-
n[13] === r.column ?
|
|
4631
|
-
let
|
|
4632
|
-
n[15] !==
|
|
4750
|
+
let O = j(_.store, D), k = o ? "gridcell" : "cell", A = o?.columnIndex, M = o?.tabIndex, N = o ? !0 : void 0, P = r.row.id, F = r.column.id, I = o?.focused, L = o?.selected, R = o?.selected, z = o?.edges?.top, B = o?.edges?.bottom, V = o?.edges?.left, H = o?.edges?.right, ee = s !== void 0 || void 0, U = w || void 0, te = E || void 0, ne;
|
|
4751
|
+
n[13] === r.column ? ne = n[14] : (ne = Dn(r.column), n[13] = r.column, n[14] = ne);
|
|
4752
|
+
let re = a.isBoundary && a.pinnedAt === "left" ? bi.stickyLeft : "", ie = a.isBoundary && a.pinnedAt === "right" ? bi.stickyRight : "", ae;
|
|
4753
|
+
n[15] !== re || n[16] !== ie ? (ae = [
|
|
4633
4754
|
$.bodyCell,
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
].filter(Boolean), n[15] =
|
|
4755
|
+
re,
|
|
4756
|
+
ie
|
|
4757
|
+
].filter(Boolean), n[15] = re, n[16] = ie, n[17] = ae) : ae = n[17];
|
|
4637
4758
|
let oe = ae.join(" "), se = a.pinnedAt === "left" ? a.offset : void 0, W = a.pinnedAt === "right" ? a.offset : void 0, G = a.pinnedAt ? "sticky" : o?.focused ? "relative" : void 0, ce = o?.focused ? "var(--dg-z-focused-cell, 3)" : a.pinnedAt ? "var(--dg-z-pinned-cell, 2)" : void 0, le;
|
|
4638
4759
|
n[18] !== i || n[19] !== se || n[20] !== W || n[21] !== G || n[22] !== ce ? (le = {
|
|
4639
4760
|
minHeight: i,
|
|
@@ -4646,16 +4767,16 @@ function Ra(t) {
|
|
|
4646
4767
|
n[24] !== r || n[25] !== c || n[26] !== O || n[27] !== s || n[28] !== l || n[29] !== g ? (K = s ?? /* @__PURE__ */ J("span", {
|
|
4647
4768
|
className: $.cellContent,
|
|
4648
4769
|
children: (() => {
|
|
4649
|
-
let e = O !== void 0 && c === void 0 && !r.getIsPlaceholder() && !r.getIsAggregated() ?
|
|
4770
|
+
let e = O !== void 0 && c === void 0 && !r.getIsPlaceholder() && !r.getIsAggregated() ? ha(r, O) : void 0;
|
|
4650
4771
|
if (l !== void 0 && c === void 0 && !r.getIsPlaceholder() && !r.getIsAggregated() && r.column.columnDef.cell === g.getDefaultColumnDef().cell) {
|
|
4651
4772
|
let t = e === void 0 ? r.renderValue() : e.renderValue();
|
|
4652
|
-
if (typeof t == "string" || typeof t == "number") return
|
|
4773
|
+
if (typeof t == "string" || typeof t == "number") return za(String(t), l);
|
|
4653
4774
|
}
|
|
4654
|
-
return e === void 0 ? c ??
|
|
4775
|
+
return e === void 0 ? c ?? Ra(r) : Fe(r.column.columnDef.cell, e);
|
|
4655
4776
|
})()
|
|
4656
4777
|
}), n[24] = r, n[25] = c, n[26] = O, n[27] = s, n[28] = l, n[29] = g, n[30] = K) : K = n[30];
|
|
4657
4778
|
let q;
|
|
4658
|
-
return n[31] !== r.column.id || n[32] !== r.row.id || n[33] !== S || n[34] !== d || n[35] !== h || n[36] !== m || n[37] !== u || n[38] !== f || n[39] !== p || n[40] !== I || n[41] !== L || n[42] !== R || n[43] !== z || n[44] !== B || n[45] !== V || n[46] !== H || n[47] !== ee || n[48] !==
|
|
4779
|
+
return n[31] !== r.column.id || n[32] !== r.row.id || n[33] !== S || n[34] !== d || n[35] !== h || n[36] !== m || n[37] !== u || n[38] !== f || n[39] !== p || n[40] !== I || n[41] !== L || n[42] !== R || n[43] !== z || n[44] !== B || n[45] !== V || n[46] !== H || n[47] !== ee || n[48] !== U || n[49] !== te || n[50] !== ne || n[51] !== oe || n[52] !== le || n[53] !== K || n[54] !== k || n[55] !== A || n[56] !== M || n[57] !== N ? (q = /* @__PURE__ */ J("div", {
|
|
4659
4780
|
role: k,
|
|
4660
4781
|
"aria-colindex": A,
|
|
4661
4782
|
tabIndex: M,
|
|
@@ -4675,17 +4796,17 @@ function Ra(t) {
|
|
|
4675
4796
|
onMouseEnter: p,
|
|
4676
4797
|
onDoubleClick: m,
|
|
4677
4798
|
"data-editing": ee,
|
|
4678
|
-
"data-dirty":
|
|
4679
|
-
"data-invalid":
|
|
4680
|
-
"data-align":
|
|
4799
|
+
"data-dirty": U,
|
|
4800
|
+
"data-invalid": te,
|
|
4801
|
+
"data-align": ne,
|
|
4681
4802
|
"data-control-column": S,
|
|
4682
4803
|
onContextMenu: h,
|
|
4683
4804
|
className: oe,
|
|
4684
4805
|
style: le,
|
|
4685
4806
|
children: K
|
|
4686
|
-
}), n[31] = r.column.id, n[32] = r.row.id, n[33] = S, n[34] = d, n[35] = h, n[36] = m, n[37] = u, n[38] = f, n[39] = p, n[40] = I, n[41] = L, n[42] = R, n[43] = z, n[44] = B, n[45] = V, n[46] = H, n[47] = ee, n[48] =
|
|
4807
|
+
}), n[31] = r.column.id, n[32] = r.row.id, n[33] = S, n[34] = d, n[35] = h, n[36] = m, n[37] = u, n[38] = f, n[39] = p, n[40] = I, n[41] = L, n[42] = R, n[43] = z, n[44] = B, n[45] = V, n[46] = H, n[47] = ee, n[48] = U, n[49] = te, n[50] = ne, n[51] = oe, n[52] = le, n[53] = K, n[54] = k, n[55] = A, n[56] = M, n[57] = N, n[58] = q) : q = n[58], q;
|
|
4687
4808
|
}
|
|
4688
|
-
function
|
|
4809
|
+
function Va(t) {
|
|
4689
4810
|
let n = e(16), { enabled: r, menuContent: i, menuProps: a, onContextMenu: o, onClose: s, children: c } = t, l;
|
|
4690
4811
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (l = { display: "contents" }, n[0] = l) : l = n[0];
|
|
4691
4812
|
let u = r ? o : void 0, d;
|
|
@@ -4716,13 +4837,13 @@ function za(t) {
|
|
|
4716
4837
|
children: [h, _]
|
|
4717
4838
|
}), n[10] = a, n[11] = p, n[12] = m, n[13] = h, n[14] = _, n[15] = v) : v = n[15], v;
|
|
4718
4839
|
}
|
|
4719
|
-
function
|
|
4840
|
+
function Ha({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContextMenu: o, rowClassName: l, rowStyle: u, striped: d = !1, onScrollToTop: p, onScrollToBottom: m, onScrollToLeft: _, onScrollToRight: v, renderEmptyState: y, renderRowContextMenu: b, renderColumnMenuItems: x, rowContextMenuProps: S, cellExport: C, onReachEnd: w, reachEndThreshold: T = 10, "aria-label": D, "aria-labelledby": O }) {
|
|
4720
4841
|
let { table: k, ui: A, edit: M, features: N, labels: P, rowHeight: F, controlSize: I, renderDetails: L, renderDetailsEstHeight: R, overscan: z, scrollerRef: B } = Q();
|
|
4721
4842
|
j(k.store);
|
|
4722
|
-
let V = j(A, (e) => e.highlightedRowId), H = j(A, (e) => e.focusedCell), ee = j(A, (e) => e.cellRange),
|
|
4843
|
+
let V = j(A, (e) => e.highlightedRowId), H = j(A, (e) => e.focusedCell), ee = j(A, (e) => e.cellRange), U = j(M.store, (e) => e.active), te = j(M.store, (e) => e.openRowIds), ne = j(M.store, (e) => e.newRows.length), re = j(M.store, (e) => e.deletedRowIds), ie = j(M.store, (e) => e.openRowIds.filter((t) => (e.rows[t]?.dirtyFields.length ?? 0) > 0)), ae = j(M.store, (e) => e.committedRowIds), { loading: oe, noResultsLabel: se = P.noResults } = k.options.meta ?? {}, W = s(null), G = dn(k, N), ce = N.matchHighlighting ? Na(k) : null, K = N.rowPinning ? ja(k, "top") : [], q = N.rowPinning ? ja(k, "bottom") : [], de = K.length + q.length, fe = null;
|
|
4723
4844
|
if (N.rowNumbers) {
|
|
4724
4845
|
fe = /* @__PURE__ */ new Map();
|
|
4725
|
-
let e =
|
|
4846
|
+
let e = fn(k, N) ? k.store.state.pagination.pageIndex * k.store.state.pagination.pageSize : 0;
|
|
4726
4847
|
for (let t of G) t.getIsGrouped() || fe.set(t.id, ++e);
|
|
4727
4848
|
}
|
|
4728
4849
|
let pe = (e) => L !== void 0 && !e.getIsGrouped() && e.getIsExpanded(), me = s(null);
|
|
@@ -4736,7 +4857,7 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4736
4857
|
t.delete(n);
|
|
4737
4858
|
continue;
|
|
4738
4859
|
}
|
|
4739
|
-
|
|
4860
|
+
Ei(e, n) && (Oi({
|
|
4740
4861
|
table: k,
|
|
4741
4862
|
columnId: n,
|
|
4742
4863
|
container: e
|
|
@@ -4745,7 +4866,7 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4745
4866
|
});
|
|
4746
4867
|
let he = s(null);
|
|
4747
4868
|
i(() => {
|
|
4748
|
-
if (
|
|
4869
|
+
if (ne === 0 && K.length === 0) return;
|
|
4749
4870
|
let e = he.current;
|
|
4750
4871
|
if (e === null) return;
|
|
4751
4872
|
let t = e.querySelectorAll("[data-dg-header-row]"), n = () => {
|
|
@@ -4757,8 +4878,8 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4757
4878
|
let r = new ResizeObserver(n);
|
|
4758
4879
|
for (let e of t) r.observe(e);
|
|
4759
4880
|
return () => r.disconnect();
|
|
4760
|
-
}, [
|
|
4761
|
-
if (
|
|
4881
|
+
}, [ne, K.length]), i(() => {
|
|
4882
|
+
if (ne === 0 || K.length === 0) return;
|
|
4762
4883
|
let e = he.current;
|
|
4763
4884
|
if (e === null) return;
|
|
4764
4885
|
let t = e.querySelector("[data-dg-entry-block]");
|
|
@@ -4769,7 +4890,7 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4769
4890
|
return r.observe(t), () => {
|
|
4770
4891
|
r.disconnect(), e.style.removeProperty("--dg-entry-height");
|
|
4771
4892
|
};
|
|
4772
|
-
}, [
|
|
4893
|
+
}, [ne, K.length]), i(() => {
|
|
4773
4894
|
if (q.length === 0) return;
|
|
4774
4895
|
let e = he.current;
|
|
4775
4896
|
if (e === null) return;
|
|
@@ -4800,7 +4921,11 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4800
4921
|
height: 600,
|
|
4801
4922
|
width: 1200
|
|
4802
4923
|
}
|
|
4803
|
-
}), _e =
|
|
4924
|
+
}), _e = s(F);
|
|
4925
|
+
i(() => {
|
|
4926
|
+
_e.current !== F && (_e.current = F, ge.measure());
|
|
4927
|
+
}, [F, ge]);
|
|
4928
|
+
let ve = ge.getVirtualItems(), ye = ve[0]?.start ?? 0, be = ge.getTotalSize() - (ve.at(-1)?.end ?? 0);
|
|
4804
4929
|
i(() => (B.current = ({ rowId: e, align: t = "auto" }) => {
|
|
4805
4930
|
if (K.some((t) => t.id === e) || q.some((t) => t.id === e)) return !0;
|
|
4806
4931
|
let n = G.findIndex((t) => t.id === e);
|
|
@@ -4808,23 +4933,23 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4808
4933
|
}, () => {
|
|
4809
4934
|
B.current = () => !1;
|
|
4810
4935
|
}));
|
|
4811
|
-
let
|
|
4936
|
+
let xe = s(null), Se = s(!1), Ce = ve.at(-1)?.index ?? -1;
|
|
4812
4937
|
i(() => {
|
|
4813
|
-
w === void 0 || G.length === 0 || (N.pagination && !
|
|
4938
|
+
w === void 0 || G.length === 0 || (N.pagination && !Se.current && (Se.current = !0, console.warn("TMDataGrid: onReachEnd and pagination slice the same scroll - the pager caps the rows, so the end it reaches is the page's. Use one or the other.")), !(Ce < G.length - 1 - T) && xe.current !== G.length && (xe.current = G.length, w()));
|
|
4814
4939
|
});
|
|
4815
|
-
let
|
|
4816
|
-
...
|
|
4817
|
-
...
|
|
4818
|
-
...
|
|
4819
|
-
],
|
|
4940
|
+
let we = k.getLeftVisibleLeafColumns(), Te = k.getRightVisibleLeafColumns(), Ee = k.getCenterVisibleLeafColumns(), X = [
|
|
4941
|
+
...we,
|
|
4942
|
+
...Ee,
|
|
4943
|
+
...Te
|
|
4944
|
+
], Z = k.getCenterHeaderGroups(), De = k.getLeftHeaderGroups(), Oe = k.getRightHeaderGroups(), ke = Z.map((e, t) => ({
|
|
4820
4945
|
id: e.id,
|
|
4821
4946
|
headers: [
|
|
4822
|
-
...
|
|
4947
|
+
...De[t]?.headers ?? [],
|
|
4823
4948
|
...e.headers,
|
|
4824
|
-
...
|
|
4949
|
+
...Oe[t]?.headers ?? []
|
|
4825
4950
|
]
|
|
4826
|
-
})),
|
|
4827
|
-
let t = e.columnDef.minSize === e.columnDef.maxSize, n = e.id in
|
|
4951
|
+
})), Ae = k.store.state.columnSizing, je = X.map((e) => {
|
|
4952
|
+
let t = e.columnDef.minSize === e.columnDef.maxSize, n = e.id in Ae, r = e.getIsPinned() !== !1, i = e.columnDef.minSize ?? 80;
|
|
4828
4953
|
return t || n || r ? {
|
|
4829
4954
|
track: `${e.getSize()}px`,
|
|
4830
4955
|
minWidth: e.getSize()
|
|
@@ -4832,26 +4957,26 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4832
4957
|
track: `minmax(${i}px, ${e.columnDef.meta?.flex ?? 1}fr)`,
|
|
4833
4958
|
minWidth: i
|
|
4834
4959
|
};
|
|
4835
|
-
}),
|
|
4836
|
-
for (let e of
|
|
4960
|
+
}), Me = je.map((e) => e.track).join(" "), Ne = je.reduce((e, t) => e + t.minWidth, 0), Pe = /* @__PURE__ */ new Map(), Ie = (e) => je[X.findIndex((t) => t.id === e)]?.minWidth ?? 0, Le = 0;
|
|
4961
|
+
for (let e of we) Pe.set(e.id, {
|
|
4837
4962
|
pinnedAt: "left",
|
|
4838
|
-
offset: Ie,
|
|
4839
|
-
isBoundary: e.id === Ce.at(-1)?.id
|
|
4840
|
-
}), Ie += Pe(e.id);
|
|
4841
|
-
let Le = 0;
|
|
4842
|
-
for (let e of [...we].reverse()) Ne.set(e.id, {
|
|
4843
|
-
pinnedAt: "right",
|
|
4844
4963
|
offset: Le,
|
|
4845
|
-
isBoundary: e.id === we
|
|
4846
|
-
}), Le +=
|
|
4847
|
-
|
|
4964
|
+
isBoundary: e.id === we.at(-1)?.id
|
|
4965
|
+
}), Le += Ie(e.id);
|
|
4966
|
+
let Re = 0;
|
|
4967
|
+
for (let e of [...Te].reverse()) Pe.set(e.id, {
|
|
4968
|
+
pinnedAt: "right",
|
|
4969
|
+
offset: Re,
|
|
4970
|
+
isBoundary: e.id === Te[0]?.id
|
|
4971
|
+
}), Re += Ie(e.id);
|
|
4972
|
+
for (let e of Ee) Pe.set(e.id, {
|
|
4848
4973
|
pinnedAt: !1,
|
|
4849
4974
|
offset: 0,
|
|
4850
4975
|
isBoundary: !1
|
|
4851
4976
|
});
|
|
4852
|
-
let
|
|
4853
|
-
if (
|
|
4854
|
-
let e =
|
|
4977
|
+
let ze = (e) => Pe.get(e) ?? Fa, Be = G.length === 0 && de === 0, Ve = k.store.state.globalFilter, He = k.store.state.columnFilters.length > 0 || (typeof Ve == "string" ? Ve.trim() !== "" : Ve != null), Ue = ke.at(-1)?.headers ?? [], We = X.some((e) => e.columnDef.footer !== void 0), Ge = N.rowClickSelects, Ke = Ge || N.highlightRow || e !== void 0, qe = (e) => !e.getIsGrouped() && Ke, Ye = (t, n) => {
|
|
4978
|
+
if (Ge && t.getCanSelect()) {
|
|
4979
|
+
let e = mn({
|
|
4855
4980
|
rows: G,
|
|
4856
4981
|
rowId: t.id,
|
|
4857
4982
|
anchorRowId: A.state.selectionAnchorRowId,
|
|
@@ -4862,118 +4987,118 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4862
4987
|
k.setRowSelection(e.selection), A.actions.setSelectionAnchor(e.anchorRowId);
|
|
4863
4988
|
}
|
|
4864
4989
|
N.highlightRow && A.actions.setHighlightedRow(t.id), e?.(t);
|
|
4865
|
-
},
|
|
4990
|
+
}, Xe = (e) => typeof l == "function" ? l(e) : l, Ze = (e) => typeof u == "function" ? u(e) : u, Qe = (e, t, n) => ({
|
|
4866
4991
|
cell: e,
|
|
4867
4992
|
row: t,
|
|
4868
4993
|
column: e.column,
|
|
4869
4994
|
event: n
|
|
4870
|
-
}),
|
|
4871
|
-
rowId:
|
|
4995
|
+
}), $e = N.cellSelection, et = N.cellRangeSelection, tt = s(!1), nt = s(null), rt = $e && H !== null ? G.findIndex((e) => e.id === H.rowId) : -1, it = $e && H !== null ? X.findIndex((e) => e.id === H.columnId) : -1, at = rt >= 0 && ve.some((e) => e.index === rt), ot = G[ve[0]?.index ?? -1], st = $e ? at && H !== null ? H : ot && X[0] ? {
|
|
4996
|
+
rowId: ot.id,
|
|
4872
4997
|
columnId: X[0].id
|
|
4873
|
-
} : null : null,
|
|
4874
|
-
range:
|
|
4998
|
+
} : null : null, ct = (e, t, n) => e !== null && e.rowId === t && e.columnId === n, lt = ga({
|
|
4999
|
+
range: et ? ee : null,
|
|
4875
5000
|
rowIndexOf: (e) => G.findIndex((t) => t.id === e),
|
|
4876
5001
|
columnIndexOf: (e) => X.findIndex((t) => t.id === e)
|
|
4877
|
-
}),
|
|
4878
|
-
if (
|
|
5002
|
+
}), ut = (e, { extend: t }) => {
|
|
5003
|
+
if (!et) return;
|
|
4879
5004
|
let n = t ? ee?.anchor ?? e : e;
|
|
4880
5005
|
A.actions.setCellRange({
|
|
4881
5006
|
anchor: n,
|
|
4882
5007
|
focus: e
|
|
4883
5008
|
});
|
|
4884
|
-
},
|
|
4885
|
-
top:
|
|
4886
|
-
bottom:
|
|
4887
|
-
left:
|
|
4888
|
-
right:
|
|
4889
|
-
} : null),
|
|
4890
|
-
...
|
|
5009
|
+
}, dt = lt ?? ($e && rt >= 0 && it >= 0 ? {
|
|
5010
|
+
top: rt,
|
|
5011
|
+
bottom: rt,
|
|
5012
|
+
left: it,
|
|
5013
|
+
right: it
|
|
5014
|
+
} : null), ft = va(dt), pt = dt === null ? 0 : X.slice(dt.left, dt.right + 1).filter((e) => !On(e.id)).length, mt = {
|
|
5015
|
+
...xa,
|
|
4891
5016
|
...C
|
|
4892
|
-
}, [
|
|
5017
|
+
}, [ht, gt] = c(mt.includeHeaders), _t = (e) => dt === null ? [] : Ca({
|
|
4893
5018
|
rows: G,
|
|
4894
5019
|
columns: X,
|
|
4895
|
-
bounds:
|
|
5020
|
+
bounds: dt,
|
|
4896
5021
|
includeHeaders: e,
|
|
4897
|
-
decimalComma:
|
|
4898
|
-
}),
|
|
4899
|
-
let e =
|
|
4900
|
-
e.length !== 0 && await Da(
|
|
4901
|
-
}, [
|
|
5022
|
+
decimalComma: mt.decimalComma
|
|
5023
|
+
}), vt = async () => {
|
|
5024
|
+
let e = _t(!1);
|
|
5025
|
+
e.length !== 0 && await ka(Da(e));
|
|
5026
|
+
}, [yt, bt] = c(!1);
|
|
4902
5027
|
i(() => {
|
|
4903
|
-
if (!
|
|
4904
|
-
let e = () =>
|
|
5028
|
+
if (!yt) return;
|
|
5029
|
+
let e = () => bt(!1);
|
|
4905
5030
|
return window.addEventListener("mouseup", e), () => window.removeEventListener("mouseup", e);
|
|
4906
|
-
}, [
|
|
4907
|
-
let
|
|
4908
|
-
A.actions.setFocusedCell(e),
|
|
4909
|
-
},
|
|
4910
|
-
let t =
|
|
4911
|
-
t.length !== 0 &&
|
|
4912
|
-
fileName: `${
|
|
4913
|
-
text:
|
|
5031
|
+
}, [yt]);
|
|
5032
|
+
let xt = (e, { extend: t }) => {
|
|
5033
|
+
A.actions.setFocusedCell(e), ut(e, { extend: t }), t || bt(!0);
|
|
5034
|
+
}, St = (e) => {
|
|
5035
|
+
let t = _t(e);
|
|
5036
|
+
t.length !== 0 && Aa({
|
|
5037
|
+
fileName: `${mt.fileName}.csv`,
|
|
5038
|
+
text: Oa(t, { separator: mt.separator })
|
|
4914
5039
|
});
|
|
4915
|
-
},
|
|
5040
|
+
}, Ct = (e, { extend: t } = { extend: !1 }) => {
|
|
4916
5041
|
let n = G[e.rowIndex], r = X[e.columnIndex];
|
|
4917
5042
|
if (!n || !r) return;
|
|
4918
5043
|
let i = {
|
|
4919
5044
|
rowId: n.id,
|
|
4920
5045
|
columnId: r.id
|
|
4921
5046
|
};
|
|
4922
|
-
|
|
4923
|
-
},
|
|
4924
|
-
let e =
|
|
4925
|
-
return
|
|
4926
|
-
},
|
|
5047
|
+
tt.current = !0, A.actions.setFocusedCell(i), ut(i, { extend: t });
|
|
5048
|
+
}, wt = s(void 0), Tt = () => {
|
|
5049
|
+
let e = wt.current;
|
|
5050
|
+
return wt.current = void 0, e;
|
|
5051
|
+
}, Et = (e) => {
|
|
4927
5052
|
let t = G.find((t) => t.id === e);
|
|
4928
5053
|
return t === void 0 ? null : [
|
|
4929
5054
|
...t.getLeftVisibleCells(),
|
|
4930
5055
|
...t.getCenterVisibleCells(),
|
|
4931
5056
|
...t.getRightVisibleCells()
|
|
4932
5057
|
].find((e) => M.canEditCell(t, e.column))?.column.id ?? null;
|
|
4933
|
-
},
|
|
5058
|
+
}, Dt = s(null);
|
|
4934
5059
|
a(() => {
|
|
4935
|
-
if (
|
|
4936
|
-
|
|
5060
|
+
if (U === null) {
|
|
5061
|
+
Dt.current = null;
|
|
4937
5062
|
return;
|
|
4938
5063
|
}
|
|
4939
|
-
if (
|
|
5064
|
+
if (Dt.current === U) return;
|
|
4940
5065
|
let e = W.current;
|
|
4941
5066
|
if (e === null) return;
|
|
4942
|
-
let t =
|
|
5067
|
+
let t = U.columnId ?? Et(U.rowId);
|
|
4943
5068
|
if (t === null) {
|
|
4944
|
-
|
|
5069
|
+
Dt.current = U;
|
|
4945
5070
|
return;
|
|
4946
5071
|
}
|
|
4947
|
-
let n = e.querySelector(`[data-dg-part="editor"][data-row-id="${CSS.escape(
|
|
4948
|
-
n !== null && (
|
|
5072
|
+
let n = e.querySelector(`[data-dg-part="editor"][data-row-id="${CSS.escape(U.rowId)}"][data-column-id="${CSS.escape(t)}"]`);
|
|
5073
|
+
n !== null && (Dt.current = U, oa(n));
|
|
4949
5074
|
});
|
|
4950
|
-
let
|
|
5075
|
+
let Ot = (e) => {
|
|
4951
5076
|
let t = W.current;
|
|
4952
|
-
t !== null && (
|
|
4953
|
-
},
|
|
4954
|
-
|
|
5077
|
+
t !== null && (tt.current = !0, Ia(t, e)?.focus());
|
|
5078
|
+
}, kt = (e) => {
|
|
5079
|
+
$e && A.actions.setFocusedCell(e), M.begin({
|
|
4955
5080
|
rowId: e.rowId,
|
|
4956
5081
|
columnId: e.columnId
|
|
4957
5082
|
});
|
|
4958
|
-
},
|
|
5083
|
+
}, At = (e, t) => {
|
|
4959
5084
|
let n = t.via === "enter" ? "down" : t.via === "tab" || t.via === "defer-tab" ? 1 : t.via === "shift-tab" || t.via === "defer-shift-tab" ? -1 : null;
|
|
4960
5085
|
if (n === null || N.editMode === "row") {
|
|
4961
|
-
|
|
5086
|
+
Ot(e);
|
|
4962
5087
|
return;
|
|
4963
5088
|
}
|
|
4964
5089
|
let r = G.findIndex((t) => t.id === e.rowId), i = X.findIndex((t) => t.id === e.columnId);
|
|
4965
5090
|
if (r < 0 || i < 0) {
|
|
4966
|
-
|
|
5091
|
+
Ot(e);
|
|
4967
5092
|
return;
|
|
4968
5093
|
}
|
|
4969
5094
|
if (n === "down") {
|
|
4970
|
-
r + 1 < G.length ?
|
|
5095
|
+
r + 1 < G.length ? Ct({
|
|
4971
5096
|
rowIndex: r + 1,
|
|
4972
5097
|
columnIndex: i
|
|
4973
|
-
}) :
|
|
5098
|
+
}) : Ot(e);
|
|
4974
5099
|
return;
|
|
4975
5100
|
}
|
|
4976
|
-
let a =
|
|
5101
|
+
let a = Ur({
|
|
4977
5102
|
from: {
|
|
4978
5103
|
rowIndex: r,
|
|
4979
5104
|
columnIndex: i
|
|
@@ -4986,10 +5111,10 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4986
5111
|
return t !== void 0 && n !== void 0 && M.canEditCell(t, n);
|
|
4987
5112
|
}
|
|
4988
5113
|
});
|
|
4989
|
-
a === null ?
|
|
4990
|
-
},
|
|
4991
|
-
if (N.rowSelection &&
|
|
4992
|
-
let n =
|
|
5114
|
+
a === null ? Ot(e) : Ct(a);
|
|
5115
|
+
}, jt = (e, { extend: t }) => {
|
|
5116
|
+
if (N.rowSelection && pn(e).length > 0) {
|
|
5117
|
+
let n = mn({
|
|
4993
5118
|
rows: G,
|
|
4994
5119
|
rowId: e.id,
|
|
4995
5120
|
anchorRowId: A.state.selectionAnchorRowId,
|
|
@@ -5004,7 +5129,7 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5004
5129
|
return;
|
|
5005
5130
|
}
|
|
5006
5131
|
N.highlightRow && !e.getIsGrouped() && A.actions.setHighlightedRow(e.id);
|
|
5007
|
-
},
|
|
5132
|
+
}, Mt = (e) => {
|
|
5008
5133
|
let t = e.target;
|
|
5009
5134
|
if (t.dataset.cell !== "true") {
|
|
5010
5135
|
if (e.key !== "Escape") return;
|
|
@@ -5018,14 +5143,14 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5018
5143
|
let i = G.findIndex((e) => e.id === n), a = X.findIndex((e) => e.id === r);
|
|
5019
5144
|
if (i < 0 || a < 0) return;
|
|
5020
5145
|
if ((e.ctrlKey || e.metaKey) && (e.key === "c" || e.key === "C")) {
|
|
5021
|
-
if (
|
|
5022
|
-
e.preventDefault(),
|
|
5146
|
+
if (dt === null) return;
|
|
5147
|
+
e.preventDefault(), vt();
|
|
5023
5148
|
return;
|
|
5024
5149
|
}
|
|
5025
5150
|
let o = G[i], s = X[a];
|
|
5026
5151
|
if (N.editing && o !== void 0 && s !== void 0 && M.canEditCell(o, s)) {
|
|
5027
5152
|
if (e.key === "Enter" || e.key === "F2") {
|
|
5028
|
-
e.preventDefault(),
|
|
5153
|
+
e.preventDefault(), kt({
|
|
5029
5154
|
rowId: n,
|
|
5030
5155
|
columnId: r
|
|
5031
5156
|
});
|
|
@@ -5033,14 +5158,14 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5033
5158
|
}
|
|
5034
5159
|
if (N.editMode !== "row") {
|
|
5035
5160
|
if (e.key === "Delete" || e.key === "Backspace") {
|
|
5036
|
-
e.preventDefault(), M.clearCell(n, r).then(() =>
|
|
5161
|
+
e.preventDefault(), M.clearCell(n, r).then(() => Ot({
|
|
5037
5162
|
rowId: n,
|
|
5038
5163
|
columnId: r
|
|
5039
5164
|
}));
|
|
5040
5165
|
return;
|
|
5041
5166
|
}
|
|
5042
5167
|
if (e.key.length === 1 && e.key !== " " && !e.ctrlKey && !e.metaKey && !e.altKey) {
|
|
5043
|
-
e.preventDefault(),
|
|
5168
|
+
e.preventDefault(), wt.current = e.key, kt({
|
|
5044
5169
|
rowId: n,
|
|
5045
5170
|
columnId: r
|
|
5046
5171
|
});
|
|
@@ -5049,14 +5174,14 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5049
5174
|
}
|
|
5050
5175
|
}
|
|
5051
5176
|
if (e.key === "Enter" || e.key === "F2") {
|
|
5052
|
-
let n = t.querySelector(
|
|
5177
|
+
let n = t.querySelector(aa);
|
|
5053
5178
|
if (n === null) return;
|
|
5054
5179
|
e.preventDefault(), n.focus();
|
|
5055
5180
|
return;
|
|
5056
5181
|
}
|
|
5057
5182
|
if (e.key === "Escape") {
|
|
5058
5183
|
if (ee === null) return;
|
|
5059
|
-
e.preventDefault(),
|
|
5184
|
+
e.preventDefault(), ut({
|
|
5060
5185
|
rowId: n,
|
|
5061
5186
|
columnId: r
|
|
5062
5187
|
}, { extend: !1 });
|
|
@@ -5065,10 +5190,10 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5065
5190
|
if (e.key === " ") {
|
|
5066
5191
|
e.preventDefault();
|
|
5067
5192
|
let t = G[i];
|
|
5068
|
-
t &&
|
|
5193
|
+
t && jt(t, { extend: e.shiftKey });
|
|
5069
5194
|
return;
|
|
5070
5195
|
}
|
|
5071
|
-
let c =
|
|
5196
|
+
let c = Hr({
|
|
5072
5197
|
key: e.key,
|
|
5073
5198
|
ctrlKey: e.ctrlKey || e.metaKey,
|
|
5074
5199
|
from: {
|
|
@@ -5079,90 +5204,90 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5079
5204
|
columnCount: X.length,
|
|
5080
5205
|
pageRows: Math.max(1, Math.floor((W.current?.clientHeight ?? 0) / F) - 1)
|
|
5081
5206
|
});
|
|
5082
|
-
c !== null && (e.preventDefault(), !(c.rowIndex === i && c.columnIndex === a) &&
|
|
5207
|
+
c !== null && (e.preventDefault(), !(c.rowIndex === i && c.columnIndex === a) && Ct(c, { extend: e.shiftKey && et }));
|
|
5083
5208
|
};
|
|
5084
5209
|
i(() => {
|
|
5085
|
-
if (
|
|
5210
|
+
if (!$e) return;
|
|
5086
5211
|
let e = W.current;
|
|
5087
5212
|
if (e === null) return;
|
|
5088
|
-
if (H !==
|
|
5089
|
-
|
|
5213
|
+
if (H !== nt.current && (nt.current = H, rt >= 0 && ge.scrollToIndex(rt, { align: "auto" })), H === null) {
|
|
5214
|
+
tt.current = !1;
|
|
5090
5215
|
return;
|
|
5091
5216
|
}
|
|
5092
|
-
if (!
|
|
5093
|
-
let t =
|
|
5094
|
-
t !== null && (
|
|
5217
|
+
if (!tt.current && !e.contains(document.activeElement)) return;
|
|
5218
|
+
let t = Ia(e, H);
|
|
5219
|
+
t !== null && (tt.current = !1, !t.contains(document.activeElement) && (document.activeElement instanceof Element && document.activeElement.closest("[data-dg-part=\"editor\"]") !== null || (t.focus({ preventScroll: !0 }), ze(H.columnId).pinnedAt === !1 && La({
|
|
5095
5220
|
container: e,
|
|
5096
5221
|
cellElement: t,
|
|
5097
|
-
leftPinnedWidth:
|
|
5098
|
-
rightPinnedWidth:
|
|
5222
|
+
leftPinnedWidth: Le,
|
|
5223
|
+
rightPinnedWidth: Re
|
|
5099
5224
|
}))));
|
|
5100
5225
|
});
|
|
5101
|
-
let [
|
|
5102
|
-
let e =
|
|
5103
|
-
if (
|
|
5226
|
+
let [Nt, Pt] = c(null), Ft = () => Pt(null), It = s(null), Lt = s(null), Rt = () => {
|
|
5227
|
+
let e = It.current, t = Lt.current;
|
|
5228
|
+
if (It.current = null, Lt.current = null, $e && e !== null && t !== null) {
|
|
5104
5229
|
let n = G.findIndex((t) => t.id === e), r = X.findIndex((e) => e.id === t);
|
|
5105
|
-
n >= 0 && !
|
|
5230
|
+
n >= 0 && !_a(dt, n, r) && (A.actions.setFocusedCell({
|
|
5106
5231
|
rowId: e,
|
|
5107
5232
|
columnId: t
|
|
5108
|
-
}),
|
|
5233
|
+
}), ut({
|
|
5109
5234
|
rowId: e,
|
|
5110
5235
|
columnId: t
|
|
5111
5236
|
}, { extend: !1 }));
|
|
5112
5237
|
}
|
|
5113
|
-
|
|
5238
|
+
Pt(e === null ? null : {
|
|
5114
5239
|
rowId: e,
|
|
5115
5240
|
columnId: t
|
|
5116
5241
|
});
|
|
5117
|
-
},
|
|
5118
|
-
/* @__PURE__ */ J(g.Label, { children: P.cellCount(
|
|
5242
|
+
}, zt = Nt === null ? void 0 : G.find((e) => e.id === Nt.rowId) ?? K.find((e) => e.id === Nt.rowId) ?? q.find((e) => e.id === Nt.rowId), Bt = b !== void 0 && Nt !== null && zt !== void 0 && !zt.getIsGrouped(), Vt = et && Nt !== null && dt !== null ? /* @__PURE__ */ Y(ue, { children: [
|
|
5243
|
+
/* @__PURE__ */ J(g.Label, { children: P.cellCount(ft) }),
|
|
5119
5244
|
/* @__PURE__ */ J(g.Item, {
|
|
5120
|
-
disabled:
|
|
5121
|
-
onClick: () => void
|
|
5245
|
+
disabled: pt === 0,
|
|
5246
|
+
onClick: () => void vt(),
|
|
5122
5247
|
children: P.copy
|
|
5123
5248
|
}),
|
|
5124
5249
|
/* @__PURE__ */ J(g.Item, {
|
|
5125
|
-
disabled:
|
|
5126
|
-
onClick: () =>
|
|
5250
|
+
disabled: pt === 0,
|
|
5251
|
+
onClick: () => St(ht),
|
|
5127
5252
|
children: P.exportCsv
|
|
5128
5253
|
}),
|
|
5129
5254
|
/* @__PURE__ */ J(g.Item, {
|
|
5130
5255
|
closeMenuOnClick: !1,
|
|
5131
|
-
onClick: () =>
|
|
5256
|
+
onClick: () => gt((e) => !e),
|
|
5132
5257
|
children: /* @__PURE__ */ J(f, {
|
|
5133
5258
|
size: "xs",
|
|
5134
|
-
checked:
|
|
5259
|
+
checked: ht,
|
|
5135
5260
|
label: P.includeHeaders,
|
|
5136
5261
|
readOnly: !0,
|
|
5137
5262
|
styles: { input: { cursor: "pointer" } }
|
|
5138
5263
|
})
|
|
5139
5264
|
})
|
|
5140
|
-
] }) : null,
|
|
5265
|
+
] }) : null, Ht = !1, Ut = Bt ? b({
|
|
5141
5266
|
table: k,
|
|
5142
|
-
row:
|
|
5143
|
-
cell:
|
|
5144
|
-
close:
|
|
5267
|
+
row: zt,
|
|
5268
|
+
cell: zt?.getAllCells().find((e) => e.column.id === Nt?.columnId) ?? null,
|
|
5269
|
+
close: Ft,
|
|
5145
5270
|
get internalItems() {
|
|
5146
|
-
return
|
|
5271
|
+
return Ht = !0, Vt;
|
|
5147
5272
|
}
|
|
5148
|
-
}) ?? null : null,
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
] }),
|
|
5273
|
+
}) ?? null : null, Wt = Ht ? Ut : Vt === null && Ut === null ? null : /* @__PURE__ */ Y(ue, { children: [
|
|
5274
|
+
Vt,
|
|
5275
|
+
Vt !== null && Ut !== null && /* @__PURE__ */ J(g.Divider, {}),
|
|
5276
|
+
Ut
|
|
5277
|
+
] }), Gt = s({
|
|
5153
5278
|
top: !0,
|
|
5154
5279
|
bottom: !1,
|
|
5155
5280
|
left: !0,
|
|
5156
5281
|
right: !1
|
|
5157
|
-
}),
|
|
5158
|
-
if (
|
|
5282
|
+
}), Kt = p !== void 0 || m !== void 0 || _ !== void 0 || v !== void 0, qt = Nt || Kt ? (e) => {
|
|
5283
|
+
if (Nt && Ft(), !Kt) return;
|
|
5159
5284
|
let t = e.currentTarget, n = {
|
|
5160
5285
|
top: t.scrollTop <= 1,
|
|
5161
5286
|
bottom: t.scrollTop + t.clientHeight >= t.scrollHeight - 1,
|
|
5162
5287
|
left: t.scrollLeft <= 1,
|
|
5163
5288
|
right: t.scrollLeft + t.clientWidth >= t.scrollWidth - 1
|
|
5164
|
-
}, r =
|
|
5165
|
-
|
|
5289
|
+
}, r = Gt.current;
|
|
5290
|
+
Gt.current = n, n.top && !r.top && p?.(), n.bottom && !r.bottom && m?.(), n.left && !r.left && _?.(), n.right && !r.right && v?.();
|
|
5166
5291
|
} : void 0;
|
|
5167
5292
|
return /* @__PURE__ */ Y("div", {
|
|
5168
5293
|
className: $.tableWrapper,
|
|
@@ -5170,59 +5295,59 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5170
5295
|
ref: W,
|
|
5171
5296
|
className: $.scrollContainer,
|
|
5172
5297
|
"data-dg-scroll-container": !0,
|
|
5173
|
-
onScroll:
|
|
5298
|
+
onScroll: qt,
|
|
5174
5299
|
children: /* @__PURE__ */ Y("div", {
|
|
5175
5300
|
ref: he,
|
|
5176
|
-
role:
|
|
5301
|
+
role: $e ? "grid" : "table",
|
|
5177
5302
|
"aria-label": D,
|
|
5178
5303
|
"aria-labelledby": O,
|
|
5179
5304
|
"aria-busy": oe === !0 || void 0,
|
|
5180
|
-
"aria-multiselectable":
|
|
5181
|
-
onKeyDown:
|
|
5182
|
-
"data-range-dragging":
|
|
5305
|
+
"aria-multiselectable": $e && N.rowSelection && N.multiRowSelection ? !0 : void 0,
|
|
5306
|
+
onKeyDown: $e ? Mt : void 0,
|
|
5307
|
+
"data-range-dragging": yt || void 0,
|
|
5183
5308
|
className: $.grid,
|
|
5184
|
-
"aria-rowcount": G.length + de +
|
|
5309
|
+
"aria-rowcount": G.length + de + ke.length + +!!We,
|
|
5185
5310
|
"aria-colcount": X.length,
|
|
5186
5311
|
"data-dg-row-count": G.length + de,
|
|
5187
5312
|
style: {
|
|
5188
|
-
gridTemplateColumns:
|
|
5189
|
-
minWidth:
|
|
5313
|
+
gridTemplateColumns: Me,
|
|
5314
|
+
minWidth: Ne
|
|
5190
5315
|
},
|
|
5191
5316
|
children: [
|
|
5192
5317
|
/* @__PURE__ */ J("div", {
|
|
5193
5318
|
role: "rowgroup",
|
|
5194
5319
|
style: { display: "contents" },
|
|
5195
|
-
children:
|
|
5320
|
+
children: ke.map((e, t) => /* @__PURE__ */ J("div", {
|
|
5196
5321
|
role: "row",
|
|
5197
5322
|
"aria-rowindex": t + 1,
|
|
5198
5323
|
"data-dg-header-row": !0,
|
|
5199
|
-
"data-dg-header-last": t ===
|
|
5324
|
+
"data-dg-header-last": t === ke.length - 1 || void 0,
|
|
5200
5325
|
className: $.headerRow,
|
|
5201
|
-
children: e.headers.map((e) => /* @__PURE__ */ J(
|
|
5326
|
+
children: e.headers.map((e) => /* @__PURE__ */ J(Ii, {
|
|
5202
5327
|
renderColumnMenuItems: x,
|
|
5203
5328
|
header: e,
|
|
5204
|
-
layout:
|
|
5329
|
+
layout: ze(e.column.id)
|
|
5205
5330
|
}, e.id))
|
|
5206
5331
|
}, e.id))
|
|
5207
5332
|
}),
|
|
5208
|
-
N.editing &&
|
|
5333
|
+
N.editing && ne > 0 && /* @__PURE__ */ J(ca, {
|
|
5209
5334
|
orderedColumns: X,
|
|
5210
|
-
layoutFor:
|
|
5335
|
+
layoutFor: ze,
|
|
5211
5336
|
rowHeight: F
|
|
5212
5337
|
}),
|
|
5213
|
-
/* @__PURE__ */ J(
|
|
5214
|
-
enabled: b !== void 0 ||
|
|
5215
|
-
menuContent:
|
|
5338
|
+
/* @__PURE__ */ J(Va, {
|
|
5339
|
+
enabled: b !== void 0 || et,
|
|
5340
|
+
menuContent: Wt,
|
|
5216
5341
|
menuProps: S,
|
|
5217
|
-
onContextMenu:
|
|
5218
|
-
onClose:
|
|
5342
|
+
onContextMenu: Rt,
|
|
5343
|
+
onClose: Ft,
|
|
5219
5344
|
children: (() => {
|
|
5220
5345
|
let e = (e, n, i, a) => {
|
|
5221
|
-
let s = e.getIsGrouped(), c =
|
|
5346
|
+
let s = e.getIsGrouped(), c = qe(e), l = [
|
|
5222
5347
|
...e.getLeftVisibleCells(),
|
|
5223
5348
|
...e.getCenterVisibleCells(),
|
|
5224
5349
|
...e.getRightVisibleCells()
|
|
5225
|
-
], u = N.editMode === "row" &&
|
|
5350
|
+
], u = N.editMode === "row" && te.includes(e.id) && !ae.includes(e.id), f = !s && !$e && (Ge || N.highlightRow);
|
|
5226
5351
|
return /* @__PURE__ */ Y("div", {
|
|
5227
5352
|
role: "row",
|
|
5228
5353
|
"aria-rowindex": i,
|
|
@@ -5236,85 +5361,85 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5236
5361
|
"data-selected": N.rowSelection && e.getIsSelected(),
|
|
5237
5362
|
"data-selected-bg": N.rowSelection && N.showSelectedBackground && e.getIsSelected(),
|
|
5238
5363
|
"data-highlighted": N.highlightRow && e.id === V,
|
|
5239
|
-
"data-deleted":
|
|
5240
|
-
"data-dirty":
|
|
5364
|
+
"data-deleted": re.length > 0 && re.includes(e.id),
|
|
5365
|
+
"data-dirty": ie.length > 0 && ie.includes(e.id),
|
|
5241
5366
|
"data-draft": ae.length > 0 && ae.includes(e.id),
|
|
5242
|
-
"data-context-menu":
|
|
5243
|
-
"data-selects-on-click":
|
|
5367
|
+
"data-context-menu": Wt !== null && Nt?.rowId === e.id,
|
|
5368
|
+
"data-selects-on-click": Ge && !s,
|
|
5244
5369
|
"aria-selected": N.rowSelection ? e.getIsSelected() : void 0,
|
|
5245
5370
|
"aria-current": N.highlightRow && e.id === V ? !0 : void 0,
|
|
5246
5371
|
"data-striped": d && n >= 0 ? n % 2 == 1 : void 0,
|
|
5247
|
-
className: [$.bodyRow,
|
|
5372
|
+
className: [$.bodyRow, Xe(e)].filter(Boolean).join(" "),
|
|
5248
5373
|
style: {
|
|
5249
5374
|
minHeight: F,
|
|
5250
5375
|
cursor: c ? "pointer" : void 0,
|
|
5251
|
-
...
|
|
5376
|
+
...Ze(e)
|
|
5252
5377
|
},
|
|
5253
5378
|
tabIndex: f ? 0 : void 0,
|
|
5254
|
-
onMouseDown:
|
|
5379
|
+
onMouseDown: Ge && !s ? (e) => {
|
|
5255
5380
|
e.shiftKey && e.preventDefault();
|
|
5256
5381
|
} : void 0,
|
|
5257
|
-
onClick: c ? (t) =>
|
|
5382
|
+
onClick: c ? (t) => Ye(e, {
|
|
5258
5383
|
toggle: t.ctrlKey || t.metaKey,
|
|
5259
5384
|
extend: t.shiftKey
|
|
5260
5385
|
}) : void 0,
|
|
5261
5386
|
onKeyDown: f ? (t) => {
|
|
5262
|
-
t.key !== " " && t.key !== "Enter" || t.target === t.currentTarget && (t.preventDefault(),
|
|
5387
|
+
t.key !== " " && t.key !== "Enter" || t.target === t.currentTarget && (t.preventDefault(), Ye(e, {
|
|
5263
5388
|
toggle: !0,
|
|
5264
5389
|
extend: t.shiftKey
|
|
5265
5390
|
}));
|
|
5266
5391
|
} : void 0,
|
|
5267
|
-
onContextMenu: b && !s ||
|
|
5268
|
-
|
|
5392
|
+
onContextMenu: b && !s || et ? () => {
|
|
5393
|
+
It.current = e.id;
|
|
5269
5394
|
} : void 0,
|
|
5270
5395
|
children: [l.map((i, a) => {
|
|
5271
|
-
let c =
|
|
5272
|
-
return /* @__PURE__ */ J(
|
|
5396
|
+
let c = U !== null && U.rowId === e.id && U.columnId === i.column.id || u && M.canEditCell(e, i.column);
|
|
5397
|
+
return /* @__PURE__ */ J(Ba, {
|
|
5273
5398
|
cell: i,
|
|
5274
5399
|
rowHeight: F,
|
|
5275
|
-
layout:
|
|
5400
|
+
layout: ze(i.column.id),
|
|
5276
5401
|
contentOverride: fe !== null && i.column.id === "__rowNumber__" ? fe.get(e.id) : void 0,
|
|
5277
5402
|
highlightNeedles: ce?.get(i.column.id),
|
|
5278
|
-
editor: c ? /* @__PURE__ */ J(
|
|
5403
|
+
editor: c ? /* @__PURE__ */ J(ia, {
|
|
5279
5404
|
cell: i,
|
|
5280
5405
|
row: e,
|
|
5281
|
-
takeSeedText:
|
|
5282
|
-
onClose: (t) =>
|
|
5406
|
+
takeSeedText: Tt,
|
|
5407
|
+
onClose: (t) => At({
|
|
5283
5408
|
rowId: e.id,
|
|
5284
5409
|
columnId: i.column.id
|
|
5285
5410
|
}, t)
|
|
5286
5411
|
}) : void 0,
|
|
5287
|
-
onClick: t && !s ? (n) => t(
|
|
5412
|
+
onClick: t && !s ? (n) => t(Qe(i, e, n)) : void 0,
|
|
5288
5413
|
onDoubleClick: (N.editing || r) && !s ? (t) => {
|
|
5289
|
-
r?.(
|
|
5414
|
+
r?.(Qe(i, e, t)), N.editing && M.canEditCell(e, i.column) && kt({
|
|
5290
5415
|
rowId: e.id,
|
|
5291
5416
|
columnId: i.column.id
|
|
5292
5417
|
});
|
|
5293
5418
|
} : void 0,
|
|
5294
|
-
nav:
|
|
5419
|
+
nav: $e ? {
|
|
5295
5420
|
rowId: e.id,
|
|
5296
5421
|
columnIndex: a + 1,
|
|
5297
|
-
focused:
|
|
5298
|
-
tabIndex: st
|
|
5299
|
-
selected:
|
|
5300
|
-
edges:
|
|
5422
|
+
focused: ct(H, e.id, i.column.id),
|
|
5423
|
+
tabIndex: ct(st, e.id, i.column.id) ? 0 : -1,
|
|
5424
|
+
selected: et ? _a(lt, n, a) : ct(H, e.id, i.column.id),
|
|
5425
|
+
edges: ya(lt, n, a)
|
|
5301
5426
|
} : void 0,
|
|
5302
|
-
onFocus:
|
|
5427
|
+
onFocus: $e ? () => A.actions.setFocusedCell({
|
|
5303
5428
|
rowId: e.id,
|
|
5304
5429
|
columnId: i.column.id
|
|
5305
5430
|
}) : void 0,
|
|
5306
|
-
onMouseDown:
|
|
5307
|
-
t.button === 0 && (t.shiftKey && t.preventDefault(),
|
|
5431
|
+
onMouseDown: et ? (t) => {
|
|
5432
|
+
t.button === 0 && (t.shiftKey && t.preventDefault(), tt.current = !0, xt({
|
|
5308
5433
|
rowId: e.id,
|
|
5309
5434
|
columnId: i.column.id
|
|
5310
5435
|
}, { extend: t.shiftKey }));
|
|
5311
5436
|
} : void 0,
|
|
5312
|
-
onMouseEnter:
|
|
5437
|
+
onMouseEnter: et && yt ? () => ut({
|
|
5313
5438
|
rowId: e.id,
|
|
5314
5439
|
columnId: i.column.id
|
|
5315
5440
|
}, { extend: !0 }) : void 0,
|
|
5316
|
-
onContextMenu: b ||
|
|
5317
|
-
|
|
5441
|
+
onContextMenu: b || et || o ? (t) => {
|
|
5442
|
+
Lt.current = i.column.id, !s && o?.(Qe(i, e, t));
|
|
5318
5443
|
} : void 0
|
|
5319
5444
|
}, i.id);
|
|
5320
5445
|
}), pe(e) && /* @__PURE__ */ J("div", {
|
|
@@ -5337,36 +5462,36 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5337
5462
|
role: "presentation",
|
|
5338
5463
|
"data-dg-part": "pinned-top",
|
|
5339
5464
|
className: $.pinnedTopBlock,
|
|
5340
|
-
children: K.map((t, n) => e(t, -1,
|
|
5465
|
+
children: K.map((t, n) => e(t, -1, ke.length + n + 1, "top"))
|
|
5341
5466
|
}),
|
|
5342
|
-
|
|
5467
|
+
ye > 0 && /* @__PURE__ */ J("div", {
|
|
5343
5468
|
"aria-hidden": !0,
|
|
5344
5469
|
style: {
|
|
5345
5470
|
gridColumn: "1/-1",
|
|
5346
|
-
height:
|
|
5471
|
+
height: ye
|
|
5347
5472
|
}
|
|
5348
5473
|
}),
|
|
5349
|
-
|
|
5474
|
+
ve.map((t) => {
|
|
5350
5475
|
let n = G[t.index];
|
|
5351
|
-
return n ? e(n, t.index, t.index +
|
|
5476
|
+
return n ? e(n, t.index, t.index + ke.length + K.length + 1) : null;
|
|
5352
5477
|
}),
|
|
5353
|
-
|
|
5478
|
+
be > 0 && /* @__PURE__ */ J("div", {
|
|
5354
5479
|
"aria-hidden": !0,
|
|
5355
5480
|
style: {
|
|
5356
5481
|
gridColumn: "1/-1",
|
|
5357
|
-
height:
|
|
5482
|
+
height: be
|
|
5358
5483
|
}
|
|
5359
5484
|
}),
|
|
5360
5485
|
q.length > 0 && /* @__PURE__ */ J("div", {
|
|
5361
5486
|
role: "presentation",
|
|
5362
5487
|
"data-dg-part": "pinned-bottom",
|
|
5363
5488
|
className: $.pinnedBottomBlock,
|
|
5364
|
-
children: q.map((t, n) => e(t, -1,
|
|
5489
|
+
children: q.map((t, n) => e(t, -1, ke.length + K.length + G.length + n + 1, "bottom"))
|
|
5365
5490
|
})
|
|
5366
5491
|
] });
|
|
5367
5492
|
})()
|
|
5368
5493
|
}),
|
|
5369
|
-
|
|
5494
|
+
Be && oe === !0 && /* @__PURE__ */ J("div", {
|
|
5370
5495
|
role: "row",
|
|
5371
5496
|
className: $.messageRow,
|
|
5372
5497
|
children: /* @__PURE__ */ J(h, {
|
|
@@ -5374,10 +5499,10 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5374
5499
|
"aria-label": P.loading
|
|
5375
5500
|
})
|
|
5376
5501
|
}),
|
|
5377
|
-
|
|
5502
|
+
Be && oe !== !0 && ne === 0 && /* @__PURE__ */ J("div", {
|
|
5378
5503
|
role: "row",
|
|
5379
5504
|
className: $.messageRow,
|
|
5380
|
-
children: y === void 0 ?
|
|
5505
|
+
children: y === void 0 ? He ? /* @__PURE__ */ Y(ue, { children: [/* @__PURE__ */ J(le, {
|
|
5381
5506
|
size: 40,
|
|
5382
5507
|
stroke: 1.4,
|
|
5383
5508
|
opacity: .4
|
|
@@ -5392,26 +5517,26 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5392
5517
|
c: "dimmed",
|
|
5393
5518
|
children: P.noRows
|
|
5394
5519
|
}) : y({
|
|
5395
|
-
hasActiveFilters:
|
|
5520
|
+
hasActiveFilters: He,
|
|
5396
5521
|
table: k
|
|
5397
5522
|
})
|
|
5398
5523
|
}),
|
|
5399
|
-
|
|
5524
|
+
We && /* @__PURE__ */ J("div", {
|
|
5400
5525
|
role: "row",
|
|
5401
|
-
"aria-rowindex": G.length + de +
|
|
5526
|
+
"aria-rowindex": G.length + de + ke.length + 1,
|
|
5402
5527
|
"data-dg-part": "summary-row",
|
|
5403
5528
|
className: $.summaryRow,
|
|
5404
|
-
children:
|
|
5405
|
-
let t =
|
|
5529
|
+
children: Ue.map((e) => {
|
|
5530
|
+
let t = ze(e.column.id);
|
|
5406
5531
|
return /* @__PURE__ */ J("div", {
|
|
5407
5532
|
role: "cell",
|
|
5408
5533
|
"data-column-id": e.column.id,
|
|
5409
|
-
"data-align":
|
|
5410
|
-
"data-control-column":
|
|
5534
|
+
"data-align": Dn(e.column),
|
|
5535
|
+
"data-control-column": On(e.column.id),
|
|
5411
5536
|
className: [
|
|
5412
5537
|
$.summaryCell,
|
|
5413
|
-
t.isBoundary && t.pinnedAt === "left" ?
|
|
5414
|
-
t.isBoundary && t.pinnedAt === "right" ?
|
|
5538
|
+
t.isBoundary && t.pinnedAt === "left" ? bi.stickyLeft : "",
|
|
5539
|
+
t.isBoundary && t.pinnedAt === "right" ? bi.stickyRight : ""
|
|
5415
5540
|
].filter(Boolean).join(" "),
|
|
5416
5541
|
style: {
|
|
5417
5542
|
minHeight: F,
|
|
@@ -5429,28 +5554,29 @@ function Ba({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
5429
5554
|
})
|
|
5430
5555
|
]
|
|
5431
5556
|
})
|
|
5432
|
-
}), /* @__PURE__ */ J(
|
|
5557
|
+
}), /* @__PURE__ */ J(tr, {})]
|
|
5433
5558
|
});
|
|
5434
5559
|
}
|
|
5435
|
-
var
|
|
5436
|
-
toolbar: "
|
|
5437
|
-
toolbarSpacer: "
|
|
5560
|
+
var Ua = {
|
|
5561
|
+
toolbar: "_toolbar_1459c_1",
|
|
5562
|
+
toolbarSpacer: "_toolbarSpacer_1459c_10",
|
|
5563
|
+
summaryCount: "_summaryCount_1459c_14"
|
|
5438
5564
|
};
|
|
5439
5565
|
//#endregion
|
|
5440
5566
|
//#region src/tmdatagrid/components/TMDataGridToolbar.tsx
|
|
5441
|
-
function
|
|
5567
|
+
function Wa(t) {
|
|
5442
5568
|
let n = e(2), { children: r } = t, i;
|
|
5443
5569
|
return n[0] === r ? i = n[1] : (i = /* @__PURE__ */ J("div", {
|
|
5444
5570
|
"data-dg-part": "toolbar",
|
|
5445
|
-
className:
|
|
5571
|
+
className: Ua.toolbar,
|
|
5446
5572
|
children: r
|
|
5447
5573
|
}), n[0] = r, n[1] = i), i;
|
|
5448
5574
|
}
|
|
5449
|
-
function
|
|
5575
|
+
function Ga() {
|
|
5450
5576
|
let t = e(1), n;
|
|
5451
|
-
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ J("div", { className:
|
|
5577
|
+
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ J("div", { className: Ua.toolbarSpacer }), t[0] = n) : n = t[0], n;
|
|
5452
5578
|
}
|
|
5453
|
-
function
|
|
5579
|
+
function Ka() {
|
|
5454
5580
|
let t = e(2), { table: n, labels: r } = Q();
|
|
5455
5581
|
if (n.options.meta?.loading !== !0) return null;
|
|
5456
5582
|
let i;
|
|
@@ -5460,38 +5586,26 @@ function Wa() {
|
|
|
5460
5586
|
"aria-label": r.loading
|
|
5461
5587
|
}), t[0] = r.loading, t[1] = i), i;
|
|
5462
5588
|
}
|
|
5463
|
-
function
|
|
5464
|
-
let n = e(
|
|
5465
|
-
|
|
5466
|
-
let e;
|
|
5467
|
-
return n[0] !== r || n[1] !== a ? (e = /* @__PURE__ */ J(E, {
|
|
5468
|
-
span: !0,
|
|
5469
|
-
size: a,
|
|
5470
|
-
c: "dimmed",
|
|
5471
|
-
"data-dg-part": "summary-count",
|
|
5472
|
-
children: r
|
|
5473
|
-
}), n[0] = r, n[1] = a, n[2] = e) : e = n[2], e;
|
|
5474
|
-
}
|
|
5589
|
+
function qa(t) {
|
|
5590
|
+
let n = e(7), { children: r } = t, { table: i, controlSize: a } = Q();
|
|
5591
|
+
j(i.store);
|
|
5475
5592
|
let o;
|
|
5476
|
-
n[
|
|
5593
|
+
n[0] === i ? o = n[1] : (o = i.getRowCount(), n[0] = i, n[1] = o);
|
|
5477
5594
|
let s = o, c;
|
|
5478
|
-
n[
|
|
5479
|
-
let l = c, u;
|
|
5480
|
-
return n[
|
|
5595
|
+
n[2] === i ? c = n[3] : (c = i.options.meta?.totalRowCount ?? i.getPreFilteredRowModel().rows.length, n[2] = i, n[3] = c);
|
|
5596
|
+
let l = r === void 0 ? `${s} / ${c}` : r, u;
|
|
5597
|
+
return n[4] !== a || n[5] !== l ? (u = /* @__PURE__ */ J(E, {
|
|
5481
5598
|
span: !0,
|
|
5482
5599
|
size: a,
|
|
5483
5600
|
c: "dimmed",
|
|
5601
|
+
className: Ua.summaryCount,
|
|
5484
5602
|
"data-dg-part": "summary-count",
|
|
5485
|
-
children:
|
|
5486
|
-
|
|
5487
|
-
" / ",
|
|
5488
|
-
l
|
|
5489
|
-
]
|
|
5490
|
-
}), n[7] = a, n[8] = s, n[9] = l, n[10] = u) : u = n[10], u;
|
|
5603
|
+
children: l
|
|
5604
|
+
}), n[4] = a, n[5] = l, n[6] = u) : u = n[6], u;
|
|
5491
5605
|
}
|
|
5492
|
-
function
|
|
5493
|
-
let t = e(13), { table: n, ui: r, features: i, labels: a, controlSize: o } = Q(), s = j(r,
|
|
5494
|
-
if (!
|
|
5606
|
+
function Ja() {
|
|
5607
|
+
let t = e(13), { table: n, ui: r, features: i, labels: a, controlSize: o } = Q(), s = j(r, Ya);
|
|
5608
|
+
if (!Br(n, i).canHideAny) return null;
|
|
5495
5609
|
let c;
|
|
5496
5610
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ J(se, {
|
|
5497
5611
|
size: 18,
|
|
@@ -5516,7 +5630,7 @@ function Ka() {
|
|
|
5516
5630
|
let f;
|
|
5517
5631
|
t[8] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ J(b.Dropdown, {
|
|
5518
5632
|
p: 0,
|
|
5519
|
-
children: /* @__PURE__ */ J(
|
|
5633
|
+
children: /* @__PURE__ */ J(jn, {})
|
|
5520
5634
|
}), t[8] = f) : f = t[8];
|
|
5521
5635
|
let p;
|
|
5522
5636
|
return t[9] !== s || t[10] !== d || t[11] !== r.actions.setColumnsPanelOpen ? (p = /* @__PURE__ */ Y(b, {
|
|
@@ -5530,23 +5644,23 @@ function Ka() {
|
|
|
5530
5644
|
children: [d, f]
|
|
5531
5645
|
}), t[9] = s, t[10] = d, t[11] = r.actions.setColumnsPanelOpen, t[12] = p) : p = t[12], p;
|
|
5532
5646
|
}
|
|
5533
|
-
function
|
|
5647
|
+
function Ya(e) {
|
|
5534
5648
|
return e.columnsPanelOpen;
|
|
5535
5649
|
}
|
|
5536
|
-
function
|
|
5537
|
-
let t = e(15), n = Q(), { table: r, ui: i, features: a, labels: o, controlSize: s } = n, c = j(i,
|
|
5538
|
-
if (!
|
|
5650
|
+
function Xa() {
|
|
5651
|
+
let t = e(15), n = Q(), { table: r, ui: i, features: a, labels: o, controlSize: s } = n, c = j(i, eo), u = j(r.store, $a).filter(Qa).length;
|
|
5652
|
+
if (!Br(r, a).canFilterAny) return null;
|
|
5539
5653
|
let d = c || u > 0 ? "light" : "subtle", f = u > 0 ? void 0 : "gray", p;
|
|
5540
5654
|
t[0] !== n || t[1] !== c || t[2] !== r || t[3] !== i ? (p = () => {
|
|
5541
5655
|
if (c) {
|
|
5542
5656
|
i.actions.closeFilterPanel();
|
|
5543
5657
|
return;
|
|
5544
5658
|
}
|
|
5545
|
-
let e = r.getAllLeafColumns().find(
|
|
5546
|
-
e ?
|
|
5659
|
+
let e = r.getAllLeafColumns().find(Za);
|
|
5660
|
+
e ? oi(n, e.id) : i.actions.openFilterPanel();
|
|
5547
5661
|
}, t[0] = n, t[1] = c, t[2] = r, t[3] = i, t[4] = p) : p = t[4];
|
|
5548
5662
|
let m;
|
|
5549
|
-
t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ J(
|
|
5663
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ J(ne, {
|
|
5550
5664
|
size: 16,
|
|
5551
5665
|
stroke: 1.6
|
|
5552
5666
|
}), t[5] = m) : m = t[5];
|
|
@@ -5567,27 +5681,27 @@ function Ja() {
|
|
|
5567
5681
|
children: h
|
|
5568
5682
|
}), t[12] = o.filters, t[13] = h, t[14] = g) : g = t[14], g;
|
|
5569
5683
|
}
|
|
5570
|
-
function
|
|
5684
|
+
function Za(e) {
|
|
5571
5685
|
return e.getCanFilter();
|
|
5572
5686
|
}
|
|
5573
|
-
function
|
|
5687
|
+
function Qa(e) {
|
|
5574
5688
|
return vt(e.value);
|
|
5575
5689
|
}
|
|
5576
|
-
function
|
|
5690
|
+
function $a(e) {
|
|
5577
5691
|
return e.columnFilters;
|
|
5578
5692
|
}
|
|
5579
|
-
function
|
|
5693
|
+
function eo(e) {
|
|
5580
5694
|
return e.filterPanelOpen;
|
|
5581
5695
|
}
|
|
5582
5696
|
//#endregion
|
|
5583
5697
|
//#region src/tmdatagrid/core/sizes.ts
|
|
5584
|
-
var
|
|
5698
|
+
var to = "md", no = {
|
|
5585
5699
|
xs: 34,
|
|
5586
5700
|
sm: 42,
|
|
5587
5701
|
md: 52,
|
|
5588
5702
|
lg: 62,
|
|
5589
5703
|
xl: 72
|
|
5590
|
-
},
|
|
5704
|
+
}, ro = {
|
|
5591
5705
|
xs: "xs",
|
|
5592
5706
|
sm: "xs",
|
|
5593
5707
|
md: "sm",
|
|
@@ -5596,8 +5710,8 @@ var $a = "md", eo = {
|
|
|
5596
5710
|
};
|
|
5597
5711
|
//#endregion
|
|
5598
5712
|
//#region src/tmdatagrid/components/TMDataGrid.tsx
|
|
5599
|
-
function
|
|
5600
|
-
let n = e(27), { table: r, ui: i, edit: a, features: o, labels: s, renderDetails: c, renderDetailsEstHeight: l, overscan: u, resetSettings: d, scrollToRow: f, scrollerRef: p, size: m, children: h, className: g, style: _, id: v, "data-testid": y } = t, b = m === void 0 ? "md" : m, x = r.options.meta?.rowHeight ??
|
|
5713
|
+
function io(t) {
|
|
5714
|
+
let n = e(27), { table: r, ui: i, edit: a, features: o, labels: s, renderDetails: c, renderDetailsEstHeight: l, overscan: u, resetSettings: d, scrollToRow: f, scrollerRef: p, size: m, children: h, className: g, style: _, id: v, "data-testid": y } = t, b = m === void 0 ? "md" : m, x = r.options.meta?.rowHeight ?? no[b], S = ro[b], C;
|
|
5601
5715
|
n[0] !== a || n[1] !== o || n[2] !== s || n[3] !== u || n[4] !== c || n[5] !== l || n[6] !== d || n[7] !== x || n[8] !== f || n[9] !== p || n[10] !== b || n[11] !== S || n[12] !== r || n[13] !== i ? (C = {
|
|
5602
5716
|
table: r,
|
|
5603
5717
|
ui: i,
|
|
@@ -5632,28 +5746,28 @@ function no(t) {
|
|
|
5632
5746
|
children: D
|
|
5633
5747
|
}), n[24] = w, n[25] = D, n[26] = O) : O = n[26], O;
|
|
5634
5748
|
}
|
|
5635
|
-
var
|
|
5636
|
-
Toolbar:
|
|
5637
|
-
Spacer:
|
|
5638
|
-
SummaryCount:
|
|
5639
|
-
LoadingIndicator:
|
|
5640
|
-
Search:
|
|
5641
|
-
DraftActions:
|
|
5642
|
-
ColumnsButton:
|
|
5643
|
-
FilterButton:
|
|
5644
|
-
Table:
|
|
5645
|
-
Footer:
|
|
5646
|
-
FilterPanel:
|
|
5647
|
-
FilterPills:
|
|
5648
|
-
ColumnsPanel:
|
|
5749
|
+
var ao = Object.assign(io, {
|
|
5750
|
+
Toolbar: Wa,
|
|
5751
|
+
Spacer: Ga,
|
|
5752
|
+
SummaryCount: qa,
|
|
5753
|
+
LoadingIndicator: Ka,
|
|
5754
|
+
Search: vi,
|
|
5755
|
+
DraftActions: Gn,
|
|
5756
|
+
ColumnsButton: Ja,
|
|
5757
|
+
FilterButton: Xa,
|
|
5758
|
+
Table: Ha,
|
|
5759
|
+
Footer: _i,
|
|
5760
|
+
FilterPanel: tr,
|
|
5761
|
+
FilterPills: si,
|
|
5762
|
+
ColumnsPanel: jn
|
|
5649
5763
|
});
|
|
5650
5764
|
//#endregion
|
|
5651
5765
|
//#region src/tmdatagrid/components/filters/DgRangeSliderFilter.tsx
|
|
5652
|
-
function
|
|
5766
|
+
function oo(t) {
|
|
5653
5767
|
let n = e(23), { column: r, operator: i, value: a, onChange: o, size: s, labels: c } = t;
|
|
5654
5768
|
if (!ht(i)) {
|
|
5655
5769
|
let e;
|
|
5656
|
-
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ J(
|
|
5770
|
+
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ J(Zn, { ...t }), n[0] = t, n[1] = e), e;
|
|
5657
5771
|
}
|
|
5658
5772
|
let l;
|
|
5659
5773
|
if (n[2] !== r) {
|
|
@@ -5695,11 +5809,11 @@ function io(t) {
|
|
|
5695
5809
|
}
|
|
5696
5810
|
//#endregion
|
|
5697
5811
|
//#region src/tmdatagrid/components/filters/DgDateRangeFilter.tsx
|
|
5698
|
-
function
|
|
5812
|
+
function so(t) {
|
|
5699
5813
|
let n = e(23), { operator: r, value: i, onChange: a, size: o, labels: s } = t;
|
|
5700
5814
|
if (!ht(r)) {
|
|
5701
5815
|
let e;
|
|
5702
|
-
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ J(
|
|
5816
|
+
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ J(Zn, { ...t }), n[0] = t, n[1] = e), e;
|
|
5703
5817
|
}
|
|
5704
5818
|
let c;
|
|
5705
5819
|
n[2] === i ? c = n[3] : (c = Array.isArray(i) ? [String(i[0] ?? ""), String(i[1] ?? "")] : ["", ""], n[2] = i, n[3] = c);
|
|
@@ -5735,16 +5849,16 @@ function ao(t) {
|
|
|
5735
5849
|
}
|
|
5736
5850
|
//#endregion
|
|
5737
5851
|
//#region src/tmdatagrid/components/filters/DgAutocompleteFilter.tsx
|
|
5738
|
-
function
|
|
5852
|
+
function co(t) {
|
|
5739
5853
|
let n = e(19), { column: r, table: i, operator: a, value: o, onChange: s, options: c, size: l, labels: d } = t;
|
|
5740
5854
|
if (mt(a) || ht(a)) {
|
|
5741
5855
|
let e;
|
|
5742
|
-
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ J(
|
|
5856
|
+
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ J(Zn, { ...t }), n[0] = t, n[1] = e), e;
|
|
5743
5857
|
}
|
|
5744
5858
|
let f;
|
|
5745
5859
|
n[2] === a ? f = n[3] : (f = pt(a), n[2] = a, n[3] = f);
|
|
5746
5860
|
let p = f, m;
|
|
5747
|
-
n[4] !== r || n[5] !== c || n[6] !== i ? (m = c.length > 0 ? c :
|
|
5861
|
+
n[4] !== r || n[5] !== c || n[6] !== i ? (m = c.length > 0 ? c : Yn({
|
|
5748
5862
|
table: i,
|
|
5749
5863
|
column: r,
|
|
5750
5864
|
fallback: "faceted"
|
|
@@ -5752,7 +5866,7 @@ function oo(t) {
|
|
|
5752
5866
|
let h = m, g = d.filterValue, _;
|
|
5753
5867
|
n[8] === Symbol.for("react.memo_cache_sentinel") ? (_ = { withinPortal: !1 }, n[8] = _) : _ = n[8];
|
|
5754
5868
|
let v = !p, y = p ? d.filterValuePlaceholder : "", b;
|
|
5755
|
-
n[9] === h ? b = n[10] : (b = h.map(
|
|
5869
|
+
n[9] === h ? b = n[10] : (b = h.map(lo), n[9] = h, n[10] = b);
|
|
5756
5870
|
let x = p && typeof o == "string" ? o : "", S;
|
|
5757
5871
|
return n[11] !== d.filterValue || n[12] !== s || n[13] !== l || n[14] !== v || n[15] !== y || n[16] !== b || n[17] !== x ? (S = /* @__PURE__ */ J(u, {
|
|
5758
5872
|
label: g,
|
|
@@ -5767,16 +5881,16 @@ function oo(t) {
|
|
|
5767
5881
|
onChange: s
|
|
5768
5882
|
}), n[11] = d.filterValue, n[12] = s, n[13] = l, n[14] = v, n[15] = y, n[16] = b, n[17] = x, n[18] = S) : S = n[18], S;
|
|
5769
5883
|
}
|
|
5770
|
-
function
|
|
5884
|
+
function lo(e) {
|
|
5771
5885
|
return e.value;
|
|
5772
5886
|
}
|
|
5773
5887
|
//#endregion
|
|
5774
5888
|
//#region src/tmdatagrid/components/filters/DgTriStateFilter.tsx
|
|
5775
|
-
function
|
|
5889
|
+
function uo(t) {
|
|
5776
5890
|
let n = e(26), { operator: r, value: i, onChange: a, size: o, labels: s } = t;
|
|
5777
5891
|
if (mt(r) || ht(r)) {
|
|
5778
5892
|
let e;
|
|
5779
|
-
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ J(
|
|
5893
|
+
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ J(Zn, { ...t }), n[0] = t, n[1] = e), e;
|
|
5780
5894
|
}
|
|
5781
5895
|
let c;
|
|
5782
5896
|
n[2] === r ? c = n[3] : (c = pt(r), n[2] = r, n[3] = c);
|
|
@@ -5820,7 +5934,7 @@ function co(t) {
|
|
|
5820
5934
|
}
|
|
5821
5935
|
//#endregion
|
|
5822
5936
|
//#region src/tmdatagrid/core/labelsSv.ts
|
|
5823
|
-
var
|
|
5937
|
+
var fo = {
|
|
5824
5938
|
operators: {
|
|
5825
5939
|
contains: "innehåller",
|
|
5826
5940
|
equals: "är lika med",
|
|
@@ -5932,11 +6046,11 @@ var lo = {
|
|
|
5932
6046
|
};
|
|
5933
6047
|
//#endregion
|
|
5934
6048
|
//#region src/tmdatagrid/core/summary.ts
|
|
5935
|
-
function
|
|
5936
|
-
let r = e.getFilteredRowModel().
|
|
6049
|
+
function po({ table: e, columnId: t, fn: n = "sum" }) {
|
|
6050
|
+
let r = e.getFilteredRowModel().flatRows;
|
|
5937
6051
|
return ve[n](t, r, r);
|
|
5938
6052
|
}
|
|
5939
6053
|
//#endregion
|
|
5940
|
-
export {
|
|
6054
|
+
export { mr as DATA_STATE_SLICES, xa as DEFAULT_CELL_EXPORT_OPTIONS, to as DEFAULT_TMDATAGRID_SIZE, At as DETAILS_COLUMN_ID, co as DgAutocompleteFilter, so as DgDateRangeFilter, oo as DgRangeSliderFilter, uo as DgTriStateFilter, Jt as EDIT_COLUMN_ID, et as FILTER_OPERATOR_LABELS, en as GROUP_COLUMN_ID, gr as PERSIST_PAYLOAD_VERSION, ln as ROW_NUMBER_COLUMN_ID, hn as SELECT_COLUMN_ID, hr as SETTINGS_STATE_SLICES, ro as SIZE_CONTROL_SIZE, no as SIZE_ROW_HEIGHT, fr as TMDATAGRID_LABELS_EN, fo as TMDATAGRID_LABELS_SV, ao as TMDataGrid, Zi as TMDataGridBooleanEditor, Qi as TMDataGridDateEditor, Gn as TMDataGridDraftActions, si as TMDataGridFilterPills, Zn as TMDataGridFilterValueInput, $i as TMDataGridMultiSelectEditor, ea as TMDataGridNumberEditor, vi as TMDataGridSearch, ta as TMDataGridSelectEditor, na as TMDataGridStringEditor, po as aggregateColumn, Ot as areAllRowsExpanded, Oi as autosizeColumn, va as boundsCellCount, ya as boundsEdges, Ca as buildCellMatrix, wa as buildGridCellMatrix, Rt as clearedValueForType, ei as createTMDataGridColumnHelper, Aa as downloadTextFile, gt as emptyValueForOperator, Ta as exportGridToCsv, Sa as formatExportValue, yt as formatFilterLabel, rn as formatGroupValue, cr as fuzzyGlobalFilterFn, zr as getColumnCapabilities, Cn as getColumnDefaultOperator, wn as getColumnFilterControl, xn as getColumnLabel, ki as getColumnRegion, Sn as getColumnType, ft as getDefaultOperator, dn as getDisplayedRows, Lt as getEditFieldName, Br as getGridCapabilities, $t as getGroupDataRows, dt as getOperatorsForType, pn as getSelectableRowIds, Pi as getStepTargetColumn, di as getTMDataGridPaginationApi, En as isColumnEditableForRow, An as isColumnReorderable, On as isControlColumn, vt as isFilterActive, kn as isGeneratedColumn, fn as isPagingActive, Wr as isSameCell, _a as isWithinBounds, Mi as keepGeneratedColumnsOutermost, Di as measureColumnContentWidth, pr as mergeLabels, ji as moveColumn, Fi as moveColumnByStep, qt as normalizeFieldValidate, oi as openColumnFilter, pt as operatorNeedsValue, mt as operatorTakesArrayValue, ht as operatorTakesRangeValue, Xn as optionsToComboboxData, Rr as readFeatureFlags, Hr as resolveCellMove, Yn as resolveColumnOptions, kt as resolveExpandAll, ga as resolveRangeBounds, mn as resolveRowSelectionClick, $r as tmDataGridFeatures, Da as toClipboardText, Oa as toExcelCsv, $e as useCellControlTabIndex, ai as useTMDataGrid, Q as useTMDataGridContext, ka as writeClipboardText };
|
|
5941
6055
|
|
|
5942
6056
|
//# sourceMappingURL=index.js.map
|