@jielga/tmdatagrid 1.1.1 → 2.0.0-beta.0
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 +170 -77
- package/dist/index.js +745 -687
- package/dist/index.js.map +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 +42 -17
- package/skills/data/SKILL.md +1 -1
- package/skills/editing/SKILL.md +40 -30
- package/skills/editing/references/editing-api.md +4 -4
- package/skills/editing/references/editors-and-validation.md +50 -8
- package/skills/filtering/SKILL.md +13 -14
- package/skills/getting-started/SKILL.md +1 -1
- package/skills/grouping/SKILL.md +1 -1
- package/skills/options/SKILL.md +1 -1
- package/skills/rows/SKILL.md +1 -1
- package/skills/server-side/SKILL.md +1 -1
- package/skills/testing/SKILL.md +2 -2
- package/src/tmdatagrid/components/TMDataGridCellEditor.tsx +49 -16
- package/src/tmdatagrid/components/TMDataGridEntryRows.tsx +42 -11
- package/src/tmdatagrid/components/TMDataGridFilterPanel.tsx +5 -3
- package/src/tmdatagrid/components/TMDataGridTable.tsx +3 -26
- package/src/tmdatagrid/components/editors/TMDataGridBooleanEditor.tsx +0 -2
- package/src/tmdatagrid/components/editors/TMDataGridDateEditor.tsx +1 -3
- package/src/tmdatagrid/components/editors/TMDataGridMultiSelectEditor.tsx +0 -2
- package/src/tmdatagrid/components/editors/TMDataGridNumberEditor.tsx +13 -11
- package/src/tmdatagrid/components/editors/TMDataGridSelectEditor.tsx +0 -2
- package/src/tmdatagrid/components/editors/TMDataGridStringEditor.tsx +13 -9
- package/src/tmdatagrid/components/editors/editorShared.ts +47 -0
- package/src/tmdatagrid/components/filters/DgAutocompleteFilter.tsx +1 -1
- package/src/tmdatagrid/components/filters/DgDateRangeFilter.tsx +2 -2
- package/src/tmdatagrid/components/filters/DgRangeSliderFilter.tsx +2 -2
- package/src/tmdatagrid/components/filters/DgTriStateFilter.tsx +1 -1
- package/src/tmdatagrid/components/filters/TMDataGridFilterValueInput.tsx +1 -1
- package/src/tmdatagrid/core/columnUtils.ts +44 -3
- package/src/tmdatagrid/core/editEngine.ts +91 -24
- package/src/tmdatagrid/core/editorFocus.ts +29 -0
- package/src/tmdatagrid/core/filterControls.ts +28 -1
- package/src/tmdatagrid/index.ts +6 -0
- package/src/tmdatagrid/useTMDataGrid.tsx +37 -48
package/dist/index.js
CHANGED
|
@@ -349,10 +349,29 @@ function Rt(e) {
|
|
|
349
349
|
let t = e.currentTarget;
|
|
350
350
|
t instanceof HTMLInputElement && t.select();
|
|
351
351
|
}
|
|
352
|
+
function zt() {
|
|
353
|
+
let t = e(2), n = s(null), r = s(null), i;
|
|
354
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = () => {
|
|
355
|
+
let e = r.current, t = n.current;
|
|
356
|
+
if (r.current = null, e === null || t === null) return;
|
|
357
|
+
let i = t.value.length - e.length, a = Math.max(0, Math.min(e.position + i, t.value.length));
|
|
358
|
+
t.setSelectionRange(a, a);
|
|
359
|
+
}, t[0] = i) : i = t[0], a(i);
|
|
360
|
+
let o;
|
|
361
|
+
return t[1] === Symbol.for("react.memo_cache_sentinel") ? (o = {
|
|
362
|
+
inputRef: n,
|
|
363
|
+
remember: (e) => {
|
|
364
|
+
e.selectionStart !== null && (r.current = {
|
|
365
|
+
position: e.selectionStart,
|
|
366
|
+
length: e.value.length
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
}, t[1] = o) : o = t[1], o;
|
|
370
|
+
}
|
|
352
371
|
//#endregion
|
|
353
372
|
//#region src/tmdatagrid/components/TMDataGridEditColumn.tsx
|
|
354
|
-
var
|
|
355
|
-
function
|
|
373
|
+
var Bt = "__edit__";
|
|
374
|
+
function Vt(t) {
|
|
356
375
|
let n = e(81), { row: r } = t, { edit: i, features: a, labels: o } = X(), s = Z(), c = r.id, u;
|
|
357
376
|
n[0] === c ? u = n[1] : (u = (e) => e.openRowIds.includes(c), n[0] = c, n[1] = u);
|
|
358
377
|
let d = j(i.store, u), f;
|
|
@@ -538,9 +557,9 @@ function Bt(t) {
|
|
|
538
557
|
children: [k, P]
|
|
539
558
|
}), n[78] = k, n[79] = P, n[80] = F) : F = n[80], F;
|
|
540
559
|
}
|
|
541
|
-
function
|
|
560
|
+
function Ht(e = "Edit") {
|
|
542
561
|
return {
|
|
543
|
-
id:
|
|
562
|
+
id: Bt,
|
|
544
563
|
meta: {
|
|
545
564
|
label: e,
|
|
546
565
|
align: "center",
|
|
@@ -555,16 +574,16 @@ function Vt(e = "Edit") {
|
|
|
555
574
|
enableGlobalFilter: !1,
|
|
556
575
|
enablePinning: !1,
|
|
557
576
|
header: () => null,
|
|
558
|
-
cell: ({ row: e }) => /* @__PURE__ */ W(
|
|
559
|
-
aggregatedCell: ({ row: e }) => /* @__PURE__ */ W(
|
|
577
|
+
cell: ({ row: e }) => /* @__PURE__ */ W(Vt, { row: e }),
|
|
578
|
+
aggregatedCell: ({ row: e }) => /* @__PURE__ */ W(Vt, { row: e })
|
|
560
579
|
};
|
|
561
580
|
}
|
|
562
581
|
//#endregion
|
|
563
582
|
//#region src/tmdatagrid/components/TMDataGridRowNumberColumn.tsx
|
|
564
|
-
var
|
|
565
|
-
function
|
|
583
|
+
var Ut = "__rowNumber__";
|
|
584
|
+
function Wt(e = "Row number") {
|
|
566
585
|
return {
|
|
567
|
-
id:
|
|
586
|
+
id: Ut,
|
|
568
587
|
meta: {
|
|
569
588
|
label: e,
|
|
570
589
|
align: "center",
|
|
@@ -585,32 +604,32 @@ function Ut(e = "Row number") {
|
|
|
585
604
|
}
|
|
586
605
|
//#endregion
|
|
587
606
|
//#region src/tmdatagrid/core/grouping.ts
|
|
588
|
-
function
|
|
607
|
+
function Gt(e) {
|
|
589
608
|
return e.subRows.length === 0 ? [e] : e.getLeafRows().filter((e) => e.subRows.length === 0);
|
|
590
609
|
}
|
|
591
610
|
//#endregion
|
|
592
611
|
//#region src/tmdatagrid/core/rowSelection.ts
|
|
593
|
-
function
|
|
594
|
-
let n =
|
|
612
|
+
function Kt(e, t) {
|
|
613
|
+
let n = qt(e, t) ? e.getPaginatedRowModel().rows : e.getPrePaginatedRowModel().rows;
|
|
595
614
|
if (!t.rowPinning) return n;
|
|
596
615
|
let { top: r, bottom: i } = e.store.state.rowPinning;
|
|
597
616
|
if (r.length === 0 && i.length === 0) return n;
|
|
598
617
|
let a = /* @__PURE__ */ new Set([...r, ...i]);
|
|
599
618
|
return n.filter((e) => !a.has(e.id));
|
|
600
619
|
}
|
|
601
|
-
function
|
|
620
|
+
function qt(e, t) {
|
|
602
621
|
return t.pagination && e.store.state.grouping.length === 0;
|
|
603
622
|
}
|
|
604
|
-
function
|
|
605
|
-
return
|
|
623
|
+
function Jt(e) {
|
|
624
|
+
return Gt(e).filter((e) => e.getCanSelect()).map((e) => e.id);
|
|
606
625
|
}
|
|
607
|
-
function
|
|
626
|
+
function Yt({ rows: e, rowId: t, anchorRowId: n, modifiers: r, selection: i, canReplaceSelection: a }) {
|
|
608
627
|
let o = e.findIndex((e) => e.id === t), s = e[o];
|
|
609
628
|
if (o === -1 || s === void 0) return {
|
|
610
629
|
selection: i,
|
|
611
630
|
anchorRowId: n
|
|
612
631
|
};
|
|
613
|
-
let c =
|
|
632
|
+
let c = Jt(s);
|
|
614
633
|
if (c.length === 0) return {
|
|
615
634
|
selection: i,
|
|
616
635
|
anchorRowId: n
|
|
@@ -628,7 +647,7 @@ function Jt({ rows: e, rowId: t, anchorRowId: n, modifiers: r, selection: i, can
|
|
|
628
647
|
let l = n === null ? -1 : e.findIndex((e) => e.id === n);
|
|
629
648
|
if (r.extend && l !== -1) {
|
|
630
649
|
let t = Math.min(l, o), s = Math.max(l, o), c = r.toggle || !a ? { ...i } : {};
|
|
631
|
-
for (let n of e.slice(t, s + 1)) for (let e of
|
|
650
|
+
for (let n of e.slice(t, s + 1)) for (let e of Jt(n)) c[e] = !0;
|
|
632
651
|
return {
|
|
633
652
|
selection: c,
|
|
634
653
|
anchorRowId: n
|
|
@@ -651,8 +670,8 @@ function Jt({ rows: e, rowId: t, anchorRowId: n, modifiers: r, selection: i, can
|
|
|
651
670
|
}
|
|
652
671
|
//#endregion
|
|
653
672
|
//#region src/tmdatagrid/components/TMDataGridSelectColumn.tsx
|
|
654
|
-
var
|
|
655
|
-
function
|
|
673
|
+
var Xt = "__select__";
|
|
674
|
+
function Zt(t) {
|
|
656
675
|
let n = e(11), { table: r } = t, { labels: i } = X(), a;
|
|
657
676
|
n[0] === r ? a = n[1] : (a = () => r.getIsAllRowsSelected(), n[0] = r, n[1] = a);
|
|
658
677
|
let o = j(r.store, a), s;
|
|
@@ -669,25 +688,25 @@ function Xt(t) {
|
|
|
669
688
|
onChange: d
|
|
670
689
|
}), n[6] = o, n[7] = i.selectAllRows, n[8] = u, n[9] = d, n[10] = p) : p = n[10], p;
|
|
671
690
|
}
|
|
672
|
-
function
|
|
691
|
+
function Qt(t) {
|
|
673
692
|
let n = e(2), { table: r } = t, { features: i } = X();
|
|
674
693
|
if (!i.multiRowSelection) return null;
|
|
675
694
|
let a;
|
|
676
|
-
return n[0] === r ? a = n[1] : (a = /* @__PURE__ */ W(
|
|
695
|
+
return n[0] === r ? a = n[1] : (a = /* @__PURE__ */ W(Zt, { table: r }), n[0] = r, n[1] = a), a;
|
|
677
696
|
}
|
|
678
|
-
function
|
|
697
|
+
function $t(t) {
|
|
679
698
|
let n = e(21), { row: r } = t, { ui: i, features: a, labels: o } = X(), s = Z(), c = r.subRows.length > 0, l;
|
|
680
699
|
n[0] !== c || n[1] !== r ? (l = () => c ? r.getIsAllSubRowsSelected() : r.getIsSelected(), n[0] = c, n[1] = r, n[2] = l) : l = n[2];
|
|
681
700
|
let u = j(r.table.store, l), d;
|
|
682
701
|
n[3] === r ? d = n[4] : (d = () => r.getIsSomeSelected(), n[3] = r, n[4] = d);
|
|
683
702
|
let p = j(r.table.store, d), m;
|
|
684
|
-
n[5] === r ? m = n[6] : (m =
|
|
703
|
+
n[5] === r ? m = n[6] : (m = Jt(r), n[5] = r, n[6] = m);
|
|
685
704
|
let h = m;
|
|
686
705
|
if (c && !r.getCanMultiSelect()) return null;
|
|
687
706
|
let g = c ? o.selectGroup : o.selectRow, _ = h.length === 0, v = p && !u, y;
|
|
688
707
|
n[7] !== a || n[8] !== r.id || n[9] !== r.table || n[10] !== i.actions || n[11] !== i.state.selectionAnchorRowId ? (y = (e) => {
|
|
689
|
-
let t = e.nativeEvent, n = t instanceof MouseEvent, o =
|
|
690
|
-
rows:
|
|
708
|
+
let t = e.nativeEvent, n = t instanceof MouseEvent, o = Yt({
|
|
709
|
+
rows: Kt(r.table, a),
|
|
691
710
|
rowId: r.id,
|
|
692
711
|
anchorRowId: i.state.selectionAnchorRowId,
|
|
693
712
|
modifiers: {
|
|
@@ -710,15 +729,15 @@ function Qt(t) {
|
|
|
710
729
|
disabled: _,
|
|
711
730
|
indeterminate: v,
|
|
712
731
|
onChange: y,
|
|
713
|
-
onClick:
|
|
732
|
+
onClick: en
|
|
714
733
|
}), 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;
|
|
715
734
|
}
|
|
716
|
-
function
|
|
735
|
+
function en(e) {
|
|
717
736
|
return e.stopPropagation();
|
|
718
737
|
}
|
|
719
|
-
function
|
|
738
|
+
function tn(e = "Checkbox selection") {
|
|
720
739
|
return {
|
|
721
|
-
id:
|
|
740
|
+
id: Xt,
|
|
722
741
|
meta: {
|
|
723
742
|
label: e,
|
|
724
743
|
align: "center",
|
|
@@ -732,52 +751,62 @@ function en(e = "Checkbox selection") {
|
|
|
732
751
|
enableColumnFilter: !1,
|
|
733
752
|
enableGlobalFilter: !1,
|
|
734
753
|
enablePinning: !1,
|
|
735
|
-
header: ({ table: e }) => /* @__PURE__ */ W(
|
|
736
|
-
cell: ({ row: e }) => /* @__PURE__ */ W(
|
|
737
|
-
aggregatedCell: ({ row: e }) => /* @__PURE__ */ W(
|
|
754
|
+
header: ({ table: e }) => /* @__PURE__ */ W(Qt, { table: e }),
|
|
755
|
+
cell: ({ row: e }) => /* @__PURE__ */ W($t, { row: e }),
|
|
756
|
+
aggregatedCell: ({ row: e }) => /* @__PURE__ */ W($t, { row: e })
|
|
738
757
|
};
|
|
739
758
|
}
|
|
740
759
|
//#endregion
|
|
741
760
|
//#region src/tmdatagrid/core/columnUtils.ts
|
|
742
|
-
function
|
|
761
|
+
function nn(e) {
|
|
743
762
|
let t = e.columnDef.meta?.label;
|
|
744
763
|
if (t) return t;
|
|
745
764
|
let n = e.columnDef.header;
|
|
746
765
|
return typeof n == "string" ? n : e.id;
|
|
747
766
|
}
|
|
748
|
-
function nn(e) {
|
|
749
|
-
return e.columnDef.meta?.type ?? "string";
|
|
750
|
-
}
|
|
751
767
|
function rn(e) {
|
|
752
|
-
return e.columnDef.meta?.
|
|
768
|
+
return e.columnDef.meta?.type ?? "string";
|
|
753
769
|
}
|
|
754
770
|
function an(e) {
|
|
755
|
-
return e.columnDef.meta?.
|
|
771
|
+
return e.columnDef.meta?.filter?.defaultOperator ?? dt(rn(e));
|
|
756
772
|
}
|
|
757
773
|
function on(e) {
|
|
758
|
-
return e
|
|
774
|
+
return e.columnDef.meta?.filter?.control;
|
|
759
775
|
}
|
|
760
776
|
function sn(e) {
|
|
777
|
+
return e.columnDef.meta?.edit?.enabled === !1;
|
|
778
|
+
}
|
|
779
|
+
function cn(e, t) {
|
|
780
|
+
let n = e.columnDef.meta?.edit?.enabled;
|
|
781
|
+
return n === !1 ? !1 : typeof n != "function" || n(t);
|
|
782
|
+
}
|
|
783
|
+
function ln(e) {
|
|
784
|
+
return e.columnDef.meta?.align ?? "left";
|
|
785
|
+
}
|
|
786
|
+
function un(e) {
|
|
787
|
+
return e === "__select__" || e === "__details__" || e === "__edit__" || e === "__rowNumber__";
|
|
788
|
+
}
|
|
789
|
+
function dn(e) {
|
|
761
790
|
return e.columnDef.meta?.enableOrdering !== !1 && e.parent === void 0;
|
|
762
791
|
}
|
|
763
|
-
var
|
|
792
|
+
var fn = {
|
|
764
793
|
groupToggle: "_groupToggle_1954o_4",
|
|
765
794
|
chevron: "_chevron_1954o_14",
|
|
766
795
|
groupLabel: "_groupLabel_1954o_34",
|
|
767
796
|
groupCount: "_groupCount_1954o_44"
|
|
768
|
-
},
|
|
769
|
-
function
|
|
797
|
+
}, pn = "__group__", mn = 16, hn = "(Blank)";
|
|
798
|
+
function gn(e, t = hn) {
|
|
770
799
|
return e == null || e === "" ? t : e instanceof Date ? e.toLocaleDateString() : String(e);
|
|
771
800
|
}
|
|
772
|
-
function
|
|
801
|
+
function _n(t) {
|
|
773
802
|
let n = e(39), { row: r } = t, { labels: i } = X(), a;
|
|
774
803
|
n[0] === r ? a = n[1] : (a = () => r.getIsExpanded(), n[0] = r, n[1] = a);
|
|
775
804
|
let o = j(r.table.store, a), s = Z();
|
|
776
805
|
if (!r.getIsGrouped()) return null;
|
|
777
806
|
let c, l, u, d, f, p, m;
|
|
778
807
|
if (n[2] !== o || n[3] !== i || n[4] !== r.depth || n[5] !== r.groupingValue || n[6] !== s) {
|
|
779
|
-
l =
|
|
780
|
-
let e = r.depth *
|
|
808
|
+
l = gn(r.groupingValue, i.blankGroupValue), c = k, u = fn.groupToggle;
|
|
809
|
+
let e = r.depth * mn;
|
|
781
810
|
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;
|
|
782
811
|
} else c = n[7], l = n[8], u = n[9], d = n[10], f = n[11], p = n[12], m = n[13];
|
|
783
812
|
let h = r.id, g;
|
|
@@ -791,20 +820,20 @@ function pn(t) {
|
|
|
791
820
|
}), n[18] = _) : _ = n[18];
|
|
792
821
|
let v;
|
|
793
822
|
n[19] === o ? v = n[20] : (v = /* @__PURE__ */ W("span", {
|
|
794
|
-
className:
|
|
823
|
+
className: fn.chevron,
|
|
795
824
|
"data-expanded": o,
|
|
796
825
|
children: _
|
|
797
826
|
}), n[19] = o, n[20] = v);
|
|
798
827
|
let y;
|
|
799
828
|
n[21] === l ? y = n[22] : (y = /* @__PURE__ */ W("span", {
|
|
800
|
-
className:
|
|
829
|
+
className: fn.groupLabel,
|
|
801
830
|
children: l
|
|
802
831
|
}), n[21] = l, n[22] = y);
|
|
803
832
|
let b;
|
|
804
|
-
n[23] === r ? b = n[24] : (b =
|
|
833
|
+
n[23] === r ? b = n[24] : (b = Gt(r), n[23] = r, n[24] = b);
|
|
805
834
|
let x;
|
|
806
835
|
n[25] === b.length ? x = n[26] : (x = /* @__PURE__ */ G("span", {
|
|
807
|
-
className:
|
|
836
|
+
className: fn.groupCount,
|
|
808
837
|
children: [
|
|
809
838
|
"(",
|
|
810
839
|
b.length,
|
|
@@ -828,27 +857,27 @@ function pn(t) {
|
|
|
828
857
|
]
|
|
829
858
|
}), 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;
|
|
830
859
|
}
|
|
831
|
-
function
|
|
860
|
+
function vn(t) {
|
|
832
861
|
let n = e(6), { table: r } = t, { labels: i } = X(), a;
|
|
833
862
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = { compare: ye }, n[0] = a) : a = n[0];
|
|
834
|
-
let o = j(r.store,
|
|
863
|
+
let o = j(r.store, yn, a);
|
|
835
864
|
if (o.length === 0) return i.groupColumnLabel;
|
|
836
865
|
let s;
|
|
837
866
|
if (n[1] !== o || n[2] !== r) {
|
|
838
867
|
let e;
|
|
839
868
|
n[4] === r ? e = n[5] : (e = (e) => {
|
|
840
869
|
let t = r.getColumn(e);
|
|
841
|
-
return t ?
|
|
870
|
+
return t ? nn(t) : e;
|
|
842
871
|
}, n[4] = r, n[5] = e), s = o.map(e).join(" / "), n[1] = o, n[2] = r, n[3] = s;
|
|
843
872
|
} else s = n[3];
|
|
844
873
|
return s;
|
|
845
874
|
}
|
|
846
|
-
function
|
|
875
|
+
function yn(e) {
|
|
847
876
|
return e.grouping;
|
|
848
877
|
}
|
|
849
|
-
function
|
|
878
|
+
function bn(e = "Group") {
|
|
850
879
|
return {
|
|
851
|
-
id:
|
|
880
|
+
id: pn,
|
|
852
881
|
meta: {
|
|
853
882
|
label: e,
|
|
854
883
|
enableOrdering: !1
|
|
@@ -860,18 +889,18 @@ function gn(e = "Group") {
|
|
|
860
889
|
enableGlobalFilter: !1,
|
|
861
890
|
enableHiding: !1,
|
|
862
891
|
enablePinning: !1,
|
|
863
|
-
cell: ({ row: e }) => /* @__PURE__ */ W(
|
|
864
|
-
aggregatedCell: ({ row: e }) => /* @__PURE__ */ W(
|
|
865
|
-
header: ({ table: e }) => /* @__PURE__ */ W(
|
|
892
|
+
cell: ({ row: e }) => /* @__PURE__ */ W(_n, { row: e }),
|
|
893
|
+
aggregatedCell: ({ row: e }) => /* @__PURE__ */ W(_n, { row: e }),
|
|
894
|
+
header: ({ table: e }) => /* @__PURE__ */ W(vn, { table: e })
|
|
866
895
|
};
|
|
867
896
|
}
|
|
868
897
|
//#endregion
|
|
869
898
|
//#region src/tmdatagrid/components/TMDataGridColumnsPanel.tsx
|
|
870
|
-
function
|
|
871
|
-
let t = e(66), { table: n, labels: r, controlSize: i, resetSettings: a } = X(), [o, s] = c(""), l = j(n.store,
|
|
899
|
+
function xn() {
|
|
900
|
+
let t = e(66), { table: n, labels: r, controlSize: i, resetSettings: a } = X(), [o, s] = c(""), l = j(n.store, wn), u, p, m, h, g, _, v, y, b, x, C;
|
|
872
901
|
if (t[0] !== l || t[1] !== i || t[2] !== r.columnsSearchPlaceholder || t[3] !== o || t[4] !== n) {
|
|
873
|
-
let e = n.getAllLeafColumns().filter(
|
|
874
|
-
C = a ? e.filter((e) =>
|
|
902
|
+
let e = n.getAllLeafColumns().filter(Cn), a = o.trim().toLowerCase();
|
|
903
|
+
C = a ? e.filter((e) => nn(e).toLowerCase().includes(a)) : e, p = e.filter(Sn);
|
|
875
904
|
let c;
|
|
876
905
|
t[16] === l ? c = t[17] : (c = (e) => l[e.id] !== !1, t[16] = l, t[17] = c), m = p.filter(c).length, y = "columns-panel", b = Ze.columnsPanel;
|
|
877
906
|
let d;
|
|
@@ -895,7 +924,7 @@ function _n() {
|
|
|
895
924
|
let T;
|
|
896
925
|
t[24] !== l || t[25] !== i ? (T = (e) => /* @__PURE__ */ W(f, {
|
|
897
926
|
size: i,
|
|
898
|
-
label:
|
|
927
|
+
label: nn(e),
|
|
899
928
|
"data-dg-part": "columns-toggle",
|
|
900
929
|
"data-column-id": e.id,
|
|
901
930
|
disabled: !e.getCanHide(),
|
|
@@ -964,26 +993,26 @@ function _n() {
|
|
|
964
993
|
]
|
|
965
994
|
}), t[60] = te, t[61] = y, t[62] = b, t[63] = x, t[64] = k, t[65] = ne) : ne = t[65], ne;
|
|
966
995
|
}
|
|
967
|
-
function
|
|
996
|
+
function Sn(e) {
|
|
968
997
|
return e.getCanHide();
|
|
969
998
|
}
|
|
970
|
-
function
|
|
999
|
+
function Cn(e) {
|
|
971
1000
|
return e.id !== "__group__" && e.id !== "__rowNumber__";
|
|
972
1001
|
}
|
|
973
|
-
function
|
|
1002
|
+
function wn(e) {
|
|
974
1003
|
return e.columnVisibility;
|
|
975
1004
|
}
|
|
976
1005
|
//#endregion
|
|
977
1006
|
//#region src/tmdatagrid/components/TMDataGridEditActions.tsx
|
|
978
|
-
function
|
|
1007
|
+
function Tn() {
|
|
979
1008
|
let { edit: e } = X();
|
|
980
|
-
return j(e.store,
|
|
1009
|
+
return j(e.store, En);
|
|
981
1010
|
}
|
|
982
|
-
function
|
|
1011
|
+
function En(e) {
|
|
983
1012
|
return e.openRowIds.filter((t) => e.newRows.some((e) => e.tempId === t) || (e.rows[t]?.dirtyFields.length ?? 0) > 0).length + e.deletedRowIds.length;
|
|
984
1013
|
}
|
|
985
|
-
function
|
|
986
|
-
let t = e(10), { edit: n, labels: r } = X(), i =
|
|
1014
|
+
function Dn() {
|
|
1015
|
+
let t = e(10), { edit: n, labels: r } = X(), i = Tn(), a = j(n.store, On), o = i === 0, s;
|
|
987
1016
|
t[0] === n ? s = t[1] : (s = () => void n.submitAll(), t[0] = n, t[1] = s);
|
|
988
1017
|
let c;
|
|
989
1018
|
t[2] !== r || t[3] !== i ? (c = r.saveAllEdits(i), t[2] = r, t[3] = i, t[4] = c) : c = t[4];
|
|
@@ -997,11 +1026,11 @@ function Cn() {
|
|
|
997
1026
|
children: c
|
|
998
1027
|
}), t[5] = a, t[6] = o, t[7] = s, t[8] = c, t[9] = l) : l = t[9], l;
|
|
999
1028
|
}
|
|
1000
|
-
function
|
|
1029
|
+
function On(e) {
|
|
1001
1030
|
return e.openRowIds.some((t) => e.rows[t]?.isSubmitting === !0);
|
|
1002
1031
|
}
|
|
1003
|
-
function
|
|
1004
|
-
let t = e(6), { edit: n, labels: r } = X(), i =
|
|
1032
|
+
function kn() {
|
|
1033
|
+
let t = e(6), { edit: n, labels: r } = X(), i = Tn() === 0, a;
|
|
1005
1034
|
t[0] === n ? a = t[1] : (a = () => n.cancelAll(), t[0] = n, t[1] = a);
|
|
1006
1035
|
let o;
|
|
1007
1036
|
return t[2] !== r.discardAllEdits || t[3] !== i || t[4] !== a ? (o = /* @__PURE__ */ W(d, {
|
|
@@ -1014,12 +1043,12 @@ function Tn() {
|
|
|
1014
1043
|
children: r.discardAllEdits
|
|
1015
1044
|
}), t[2] = r.discardAllEdits, t[3] = i, t[4] = a, t[5] = o) : o = t[5], o;
|
|
1016
1045
|
}
|
|
1017
|
-
var
|
|
1018
|
-
Save:
|
|
1019
|
-
Discard:
|
|
1046
|
+
var An = {
|
|
1047
|
+
Save: Dn,
|
|
1048
|
+
Discard: kn
|
|
1020
1049
|
};
|
|
1021
|
-
function
|
|
1022
|
-
let n = e(4), { renderActions: r } = t === void 0 ? {} : t, { edit: i, features: a } = X(), o =
|
|
1050
|
+
function jn(t) {
|
|
1051
|
+
let n = e(4), { renderActions: r } = t === void 0 ? {} : t, { edit: i, features: a } = X(), o = Tn(), s = j(i.store, Mn);
|
|
1023
1052
|
if (!a.editing) return null;
|
|
1024
1053
|
if (r) {
|
|
1025
1054
|
let e, t;
|
|
@@ -1032,20 +1061,20 @@ function Dn(t) {
|
|
|
1032
1061
|
save: e,
|
|
1033
1062
|
discard: t
|
|
1034
1063
|
},
|
|
1035
|
-
Controls:
|
|
1064
|
+
Controls: An
|
|
1036
1065
|
});
|
|
1037
1066
|
}
|
|
1038
1067
|
let c;
|
|
1039
1068
|
return n[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ G(p, {
|
|
1040
1069
|
gap: "xs",
|
|
1041
1070
|
wrap: "nowrap",
|
|
1042
|
-
children: [/* @__PURE__ */ W(
|
|
1071
|
+
children: [/* @__PURE__ */ W(Dn, {}), /* @__PURE__ */ W(kn, {})]
|
|
1043
1072
|
}), n[3] = c) : c = n[3], c;
|
|
1044
1073
|
}
|
|
1045
|
-
function
|
|
1074
|
+
function Mn(e) {
|
|
1046
1075
|
return e.openRowIds.some((t) => e.rows[t]?.isSubmitting === !0);
|
|
1047
1076
|
}
|
|
1048
|
-
var
|
|
1077
|
+
var Nn = {
|
|
1049
1078
|
filterPanel: "_filterPanel_izakx_4",
|
|
1050
1079
|
filterRow: "_filterRow_izakx_16",
|
|
1051
1080
|
filterPanelHeader: "_filterPanelHeader_izakx_22",
|
|
@@ -1053,16 +1082,16 @@ var kn = {
|
|
|
1053
1082
|
};
|
|
1054
1083
|
//#endregion
|
|
1055
1084
|
//#region src/tmdatagrid/core/columnOptions.ts
|
|
1056
|
-
function
|
|
1085
|
+
function Pn(e, t) {
|
|
1057
1086
|
t == null || t === "" || e.add(String(t));
|
|
1058
1087
|
}
|
|
1059
|
-
function
|
|
1088
|
+
function Fn({ table: e, column: t, row: n, fallback: r }) {
|
|
1060
1089
|
let i = t.columnDef.meta?.options ?? r;
|
|
1061
1090
|
if (!i) return [];
|
|
1062
1091
|
if (i === "faceted") {
|
|
1063
1092
|
let e = /* @__PURE__ */ new Set();
|
|
1064
|
-
for (let n of t.getFacetedUniqueValues().keys()) if (Array.isArray(n)) for (let t of n)
|
|
1065
|
-
else
|
|
1093
|
+
for (let n of t.getFacetedUniqueValues().keys()) if (Array.isArray(n)) for (let t of n) Pn(e, t);
|
|
1094
|
+
else Pn(e, n);
|
|
1066
1095
|
return [...e].sort((e, t) => e.localeCompare(t, void 0, { numeric: !0 })).map((e) => ({ value: e }));
|
|
1067
1096
|
}
|
|
1068
1097
|
return (typeof i == "function" ? i({
|
|
@@ -1071,7 +1100,7 @@ function jn({ table: e, column: t, row: n, fallback: r }) {
|
|
|
1071
1100
|
row: n
|
|
1072
1101
|
}) : i).map((e) => typeof e == "string" ? { value: e } : e);
|
|
1073
1102
|
}
|
|
1074
|
-
function
|
|
1103
|
+
function In(e) {
|
|
1075
1104
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
1076
1105
|
for (let r of e) {
|
|
1077
1106
|
let e = {
|
|
@@ -1092,8 +1121,8 @@ function Mn(e) {
|
|
|
1092
1121
|
}
|
|
1093
1122
|
//#endregion
|
|
1094
1123
|
//#region src/tmdatagrid/components/filters/TMDataGridFilterValueInput.tsx
|
|
1095
|
-
function
|
|
1096
|
-
let n = e(64), { column: r, operator: i, value: a, onChange: o, options: s, size: c, labels: l } = t, u =
|
|
1124
|
+
function Ln(t) {
|
|
1125
|
+
let n = e(64), { column: r, operator: i, value: a, onChange: o, options: s, size: c, labels: l } = t, u = rn(r), d;
|
|
1097
1126
|
n[0] === i ? d = n[1] : (d = ft(i), n[0] = i, n[1] = d);
|
|
1098
1127
|
let f = d, m = typeof a == "string" ? a : "", h = u === "number" ? "number" : u === "date" ? "date" : "text";
|
|
1099
1128
|
if (mt(i)) {
|
|
@@ -1135,7 +1164,7 @@ function Nn(t) {
|
|
|
1135
1164
|
let e = l.filterValue, t;
|
|
1136
1165
|
n[25] === Symbol.for("react.memo_cache_sentinel") ? (t = { withinPortal: !1 }, n[25] = t) : t = n[25];
|
|
1137
1166
|
let r;
|
|
1138
|
-
n[26] === s ? r = n[27] : (r =
|
|
1167
|
+
n[26] === s ? r = n[27] : (r = In(s), n[26] = s, n[27] = r);
|
|
1139
1168
|
let i;
|
|
1140
1169
|
n[28] === a ? i = n[29] : (i = Array.isArray(a) ? [...a] : [], n[28] = a, n[29] = i);
|
|
1141
1170
|
let u;
|
|
@@ -1200,18 +1229,18 @@ function Nn(t) {
|
|
|
1200
1229
|
}
|
|
1201
1230
|
//#endregion
|
|
1202
1231
|
//#region src/tmdatagrid/components/TMDataGridFilterPanel.tsx
|
|
1203
|
-
var
|
|
1232
|
+
var Rn = {
|
|
1204
1233
|
operator: "contains",
|
|
1205
1234
|
value: ""
|
|
1206
1235
|
};
|
|
1207
|
-
function
|
|
1208
|
-
return gt(e) ? e :
|
|
1236
|
+
function zn(e) {
|
|
1237
|
+
return gt(e) ? e : Rn;
|
|
1209
1238
|
}
|
|
1210
|
-
function
|
|
1239
|
+
function Bn(e) {
|
|
1211
1240
|
return pt(e) ? "set" : mt(e) ? "range" : "scalar";
|
|
1212
1241
|
}
|
|
1213
|
-
function
|
|
1214
|
-
let t = e(76), { table: n, ui: r, labels: a, controlSize: o } = X(), c = j(r,
|
|
1242
|
+
function Vn() {
|
|
1243
|
+
let t = e(76), { table: n, ui: r, labels: a, controlSize: o } = X(), c = j(r, Gn), u = j(n.store, Wn), f = s(null), p, m;
|
|
1215
1244
|
if (t[0] !== c || t[1] !== r ? (p = () => {
|
|
1216
1245
|
if (!c) return;
|
|
1217
1246
|
let e = (e) => {
|
|
@@ -1222,12 +1251,12 @@ function Ln() {
|
|
|
1222
1251
|
}, 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;
|
|
1223
1252
|
let h, g, _, v, y, b, x, S;
|
|
1224
1253
|
if (t[4] !== u || t[5] !== n || t[6] !== r.actions) {
|
|
1225
|
-
let e = n.getAllLeafColumns().filter(
|
|
1226
|
-
y = e.map(
|
|
1254
|
+
let e = n.getAllLeafColumns().filter(Un);
|
|
1255
|
+
y = e.map(Hn), x = function(e) {
|
|
1227
1256
|
let t = u.filter((t) => t.id !== e);
|
|
1228
1257
|
n.setColumnFilters(t), t.length === 0 && r.actions.closeFilterPanel();
|
|
1229
1258
|
}, g = function(e, t) {
|
|
1230
|
-
let i =
|
|
1259
|
+
let i = zn(u.find((t) => t.id === e)?.value), a = n.getColumn(t), o = a ? an(a) : dt("string"), s = Bn(o) === Bn(i.operator) ? i.value : ht(o);
|
|
1231
1260
|
n.setColumnFilters(u.filter((e) => e.id !== t).map((n) => n.id === e ? {
|
|
1232
1261
|
id: t,
|
|
1233
1262
|
value: {
|
|
@@ -1241,14 +1270,14 @@ function Ln() {
|
|
|
1241
1270
|
n.setColumnFilters(u.map((n) => n.id === e ? {
|
|
1242
1271
|
...n,
|
|
1243
1272
|
value: {
|
|
1244
|
-
...
|
|
1273
|
+
...zn(n.value),
|
|
1245
1274
|
...t
|
|
1246
1275
|
}
|
|
1247
1276
|
} : n));
|
|
1248
1277
|
}, t[15] = u, t[16] = n, t[17] = i) : i = t[17], b = i;
|
|
1249
1278
|
let a;
|
|
1250
1279
|
t[18] !== u || t[19] !== b ? (a = function(e, t) {
|
|
1251
|
-
let n =
|
|
1280
|
+
let n = zn(u.find((t) => t.id === e)?.value), r = Bn(t) === Bn(n.operator) ? n.value : ht(t);
|
|
1252
1281
|
b(e, {
|
|
1253
1282
|
operator: t,
|
|
1254
1283
|
value: r
|
|
@@ -1260,7 +1289,7 @@ function Ln() {
|
|
|
1260
1289
|
}, t[21] = n, t[22] = r.actions, t[23] = o) : o = t[23], v = o, h = function() {
|
|
1261
1290
|
let t = e.find((e) => !u.some((t) => t.id === e.id));
|
|
1262
1291
|
if (!t) return;
|
|
1263
|
-
let r =
|
|
1292
|
+
let r = an(t);
|
|
1264
1293
|
n.setColumnFilters([...u, {
|
|
1265
1294
|
id: t.id,
|
|
1266
1295
|
value: {
|
|
@@ -1300,22 +1329,22 @@ function Ln() {
|
|
|
1300
1329
|
}), t[32] = a.closeFilters, t[33] = r.actions.closeFilterPanel, t[34] = N) : N = t[34];
|
|
1301
1330
|
let P;
|
|
1302
1331
|
t[35] !== A || t[36] !== N ? (P = /* @__PURE__ */ G("div", {
|
|
1303
|
-
className:
|
|
1332
|
+
className: Nn.filterPanelHeader,
|
|
1304
1333
|
children: [A, N]
|
|
1305
1334
|
}), t[35] = A, t[36] = N, t[37] = P) : P = t[37];
|
|
1306
1335
|
let F;
|
|
1307
1336
|
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) {
|
|
1308
1337
|
let e;
|
|
1309
1338
|
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) => {
|
|
1310
|
-
let t = n.getColumn(e.id), r =
|
|
1339
|
+
let t = n.getColumn(e.id), r = zn(e.value), i = t ? rn(t) : "string", s = ft(r.operator), c = typeof r.value == "string" ? r.value : "", u = t && (t.columnDef.meta?.options !== void 0 || i === "select" || i === "multiSelect") ? Fn({
|
|
1311
1340
|
table: n,
|
|
1312
1341
|
column: t,
|
|
1313
1342
|
fallback: "faceted"
|
|
1314
|
-
}) : [], d = t
|
|
1343
|
+
}) : [], d = (t === void 0 ? void 0 : on(t)) ?? Ln;
|
|
1315
1344
|
return /* @__PURE__ */ G("div", {
|
|
1316
1345
|
"data-dg-part": "filter-row",
|
|
1317
1346
|
"data-column-id": e.id,
|
|
1318
|
-
className:
|
|
1347
|
+
className: Nn.filterRow,
|
|
1319
1348
|
children: [
|
|
1320
1349
|
/* @__PURE__ */ W(l, {
|
|
1321
1350
|
variant: "subtle",
|
|
@@ -1398,7 +1427,7 @@ function Ln() {
|
|
|
1398
1427
|
}), t[61] = v, t[62] = a.clearAllFilters, t[63] = te, t[64] = ne) : ne = t[64];
|
|
1399
1428
|
let L;
|
|
1400
1429
|
t[65] !== I || t[66] !== ne ? (L = /* @__PURE__ */ G("div", {
|
|
1401
|
-
className:
|
|
1430
|
+
className: Nn.filterPanelFooter,
|
|
1402
1431
|
children: [I, ne]
|
|
1403
1432
|
}), t[65] = I, t[66] = ne, t[67] = L) : L = t[67];
|
|
1404
1433
|
let R;
|
|
@@ -1412,44 +1441,44 @@ function Ln() {
|
|
|
1412
1441
|
role: "group",
|
|
1413
1442
|
"aria-label": O,
|
|
1414
1443
|
"data-dg-part": "filter-panel",
|
|
1415
|
-
className:
|
|
1444
|
+
className: Nn.filterPanel,
|
|
1416
1445
|
onKeyDown: k,
|
|
1417
1446
|
children: [P, R]
|
|
1418
1447
|
}), t[71] = a.filters, t[72] = R, t[73] = k, t[74] = P, t[75] = z) : z = t[75], z;
|
|
1419
1448
|
}
|
|
1420
|
-
function
|
|
1449
|
+
function Hn(e) {
|
|
1421
1450
|
return {
|
|
1422
1451
|
value: e.id,
|
|
1423
|
-
label:
|
|
1452
|
+
label: nn(e)
|
|
1424
1453
|
};
|
|
1425
1454
|
}
|
|
1426
|
-
function
|
|
1455
|
+
function Un(e) {
|
|
1427
1456
|
return e.getCanFilter();
|
|
1428
1457
|
}
|
|
1429
|
-
function
|
|
1458
|
+
function Wn(e) {
|
|
1430
1459
|
return e.columnFilters;
|
|
1431
1460
|
}
|
|
1432
|
-
function
|
|
1461
|
+
function Gn(e) {
|
|
1433
1462
|
return e.filterPanelOpen;
|
|
1434
1463
|
}
|
|
1435
|
-
var
|
|
1464
|
+
var Kn = {
|
|
1436
1465
|
filterPills: "_filterPills_14wl0_3",
|
|
1437
1466
|
pill: "_pill_14wl0_15",
|
|
1438
1467
|
pillLabel: "_pillLabel_14wl0_27"
|
|
1439
|
-
},
|
|
1468
|
+
}, qn = {
|
|
1440
1469
|
active: null,
|
|
1441
1470
|
openRowIds: [],
|
|
1442
1471
|
rows: {},
|
|
1443
1472
|
newRows: [],
|
|
1444
1473
|
deletedRowIds: []
|
|
1445
1474
|
};
|
|
1446
|
-
function
|
|
1447
|
-
let t = e.columnDef.meta?.
|
|
1475
|
+
function Jn(e) {
|
|
1476
|
+
let t = e.columnDef.meta?.edit?.field;
|
|
1448
1477
|
if (t) return t;
|
|
1449
1478
|
let n = e.columnDef.accessorKey;
|
|
1450
1479
|
return typeof n == "string" ? n : null;
|
|
1451
1480
|
}
|
|
1452
|
-
function
|
|
1481
|
+
function Yn(e) {
|
|
1453
1482
|
switch (e) {
|
|
1454
1483
|
case "string": return "";
|
|
1455
1484
|
case "multiSelect": return [];
|
|
@@ -1457,7 +1486,7 @@ function Gn(e) {
|
|
|
1457
1486
|
default: return null;
|
|
1458
1487
|
}
|
|
1459
1488
|
}
|
|
1460
|
-
function
|
|
1489
|
+
function Xn(e) {
|
|
1461
1490
|
let t = e.state.fieldMeta;
|
|
1462
1491
|
for (let [n, r] of Object.entries(t)) {
|
|
1463
1492
|
let t = Object.entries(r.errorSourceMap ?? {}).filter(([, e]) => e === "form").map(([e]) => e);
|
|
@@ -1470,20 +1499,20 @@ function Kn(e) {
|
|
|
1470
1499
|
}));
|
|
1471
1500
|
}
|
|
1472
1501
|
}
|
|
1473
|
-
function
|
|
1502
|
+
function Zn(e, t) {
|
|
1474
1503
|
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();
|
|
1475
1504
|
}
|
|
1476
|
-
function
|
|
1505
|
+
function Qn(e) {
|
|
1477
1506
|
return e.some((e) => e != null);
|
|
1478
1507
|
}
|
|
1479
|
-
function
|
|
1480
|
-
let t = new ve(
|
|
1508
|
+
function $n(e) {
|
|
1509
|
+
let t = new ve(qn), n = /* @__PURE__ */ new Map(), r = 0, i = null, a = null, o = () => e().table.getAllLeafColumns().filter((e) => !un(e.id) && !sn(e) && Jn(e) !== null), s = (e, t) => {
|
|
1481
1510
|
let n = [];
|
|
1482
1511
|
for (let r of o()) {
|
|
1483
|
-
let i =
|
|
1512
|
+
let i = Jn(r);
|
|
1484
1513
|
if (i === null) continue;
|
|
1485
1514
|
let a = ge(e.original, i), o = ge(t, i);
|
|
1486
|
-
|
|
1515
|
+
Zn(a, o) || n.push({
|
|
1487
1516
|
columnId: r.id,
|
|
1488
1517
|
field: i,
|
|
1489
1518
|
previous: a,
|
|
@@ -1492,11 +1521,11 @@ function Yn(e) {
|
|
|
1492
1521
|
}
|
|
1493
1522
|
return n;
|
|
1494
1523
|
}, c = (e) => {
|
|
1495
|
-
let t = e.form.state, n = Object.entries(t.fieldMeta).filter(([e, t]) => e !== "" &&
|
|
1524
|
+
let t = e.form.state, n = Object.entries(t.fieldMeta).filter(([e, t]) => e !== "" && Qn(t.errors)).map(([e]) => e);
|
|
1496
1525
|
return {
|
|
1497
1526
|
dirtyFields: s(e, t.values).map((e) => e.field),
|
|
1498
1527
|
errorFields: n,
|
|
1499
|
-
hasRowError:
|
|
1528
|
+
hasRowError: Qn(t.errors),
|
|
1500
1529
|
isSubmitting: t.isSubmitting
|
|
1501
1530
|
};
|
|
1502
1531
|
}, l = (e) => {
|
|
@@ -1578,9 +1607,7 @@ function Yn(e) {
|
|
|
1578
1607
|
return c.unsubscribe = () => u.unsubscribe(), n.set(t, c), l(t), c;
|
|
1579
1608
|
}, p = (t) => !t.getIsGrouped() && e().isRowEditable?.(t) !== !1, m = (t, n) => {
|
|
1580
1609
|
let r = e();
|
|
1581
|
-
|
|
1582
|
-
let i = n.columnDef.meta?.editable;
|
|
1583
|
-
return !(i === !1 || typeof i == "function" && !i(t) || r.isRowEditable !== void 0 && !r.isRowEditable(t));
|
|
1610
|
+
return !(t.getIsGrouped() || un(n.id) || Jn(n) === null || !cn(n, t) || r.isRowEditable !== void 0 && !r.isRowEditable(t));
|
|
1584
1611
|
}, h = (t) => {
|
|
1585
1612
|
try {
|
|
1586
1613
|
return e().table.getRow(t);
|
|
@@ -1589,7 +1616,7 @@ function Yn(e) {
|
|
|
1589
1616
|
}
|
|
1590
1617
|
}, g = async (e) => {
|
|
1591
1618
|
let t = n.get(e);
|
|
1592
|
-
return t === void 0 ? !0 : t.pendingCommit === null ? !t.isNew && s(t, t.form.state.values).length === 0 ? (d(e), !0) : (
|
|
1619
|
+
return t === void 0 ? !0 : t.pendingCommit === null ? !t.isNew && s(t, t.form.state.values).length === 0 ? (d(e), !0) : (Xn(t.form), t.lastSubmitOk = !1, t.pendingCommit = (async () => {
|
|
1593
1620
|
try {
|
|
1594
1621
|
await t.form.handleSubmit();
|
|
1595
1622
|
} finally {
|
|
@@ -1733,46 +1760,46 @@ function Yn(e) {
|
|
|
1733
1760
|
clearCell: async (t, r) => {
|
|
1734
1761
|
let i = e(), a = h(t), o = i.table.getColumn(r);
|
|
1735
1762
|
if (a === void 0 || o === void 0 || !m(a, o)) return !1;
|
|
1736
|
-
let s =
|
|
1737
|
-
return s === null ? !1 : ((n.get(t) ?? f(t, a.original, !1)).form.setFieldValue(s,
|
|
1763
|
+
let s = Jn(o);
|
|
1764
|
+
return s === null ? !1 : ((n.get(t) ?? f(t, a.original, !1)).form.setFieldValue(s, Yn(o.columnDef.meta?.type ?? "string")), g(t));
|
|
1738
1765
|
},
|
|
1739
1766
|
addRow: S,
|
|
1740
1767
|
deleteRow: C,
|
|
1741
1768
|
canDeleteRows: w
|
|
1742
1769
|
};
|
|
1743
1770
|
}
|
|
1744
|
-
function
|
|
1771
|
+
function er(e) {
|
|
1745
1772
|
if (e !== void 0) return typeof e == "function" || "~standard" in e ? { onChange: e } : e;
|
|
1746
1773
|
}
|
|
1747
|
-
function
|
|
1774
|
+
function tr(e) {
|
|
1748
1775
|
if (typeof e != "object" || !e) return !1;
|
|
1749
1776
|
let t = e.fuzzyRank;
|
|
1750
1777
|
return typeof t == "object" && !!t && typeof t.rank == "number";
|
|
1751
1778
|
}
|
|
1752
|
-
function
|
|
1779
|
+
function nr(e, t, n, r) {
|
|
1753
1780
|
let i = Je(String(e.getValue(t) ?? ""), String(n));
|
|
1754
1781
|
return r?.({ fuzzyRank: i }), i.passed;
|
|
1755
1782
|
}
|
|
1756
|
-
function
|
|
1783
|
+
function rr(e) {
|
|
1757
1784
|
let t = null, { columnFiltersMeta: n } = e;
|
|
1758
|
-
for (let e of Object.values(n ?? {}))
|
|
1785
|
+
for (let e of Object.values(n ?? {})) tr(e) && (t === null || e.fuzzyRank.rank > t.rank) && (t = e.fuzzyRank);
|
|
1759
1786
|
return t;
|
|
1760
1787
|
}
|
|
1761
|
-
function
|
|
1788
|
+
function ir(e) {
|
|
1762
1789
|
let { globalFilterFn: t } = e.options;
|
|
1763
1790
|
if (t !== "tmDataGridFuzzy") return !1;
|
|
1764
1791
|
let n = e.store.state;
|
|
1765
1792
|
return (n.sorting?.length ?? 0) === 0 && (n.grouping?.length ?? 0) === 0 && typeof n.globalFilter == "string" && n.globalFilter.trim() !== "";
|
|
1766
1793
|
}
|
|
1767
|
-
function
|
|
1794
|
+
function ar() {
|
|
1768
1795
|
let e = Pe();
|
|
1769
1796
|
return (t) => {
|
|
1770
1797
|
let n = e(t), r = null, i = null;
|
|
1771
1798
|
return () => {
|
|
1772
1799
|
let e = n();
|
|
1773
|
-
return
|
|
1800
|
+
return ir(t) ? e === r && i !== null ? i : (i = {
|
|
1774
1801
|
rows: [...e.rows].sort((e, t) => {
|
|
1775
|
-
let n =
|
|
1802
|
+
let n = rr(e), r = rr(t);
|
|
1776
1803
|
return n !== null && r !== null ? qe(n, r) : n === null ? r === null ? 0 : 1 : -1;
|
|
1777
1804
|
}),
|
|
1778
1805
|
flatRows: e.flatRows,
|
|
@@ -1783,7 +1810,7 @@ function tr() {
|
|
|
1783
1810
|
}
|
|
1784
1811
|
//#endregion
|
|
1785
1812
|
//#region src/tmdatagrid/core/labels.ts
|
|
1786
|
-
var
|
|
1813
|
+
var or = {
|
|
1787
1814
|
operators: $e,
|
|
1788
1815
|
manageColumns: "Manage columns",
|
|
1789
1816
|
filters: "Filters",
|
|
@@ -1869,32 +1896,32 @@ var nr = {
|
|
|
1869
1896
|
expandGroup: (e) => `Expand ${e}`,
|
|
1870
1897
|
collapseGroup: (e) => `Collapse ${e}`
|
|
1871
1898
|
};
|
|
1872
|
-
function
|
|
1899
|
+
function sr(e) {
|
|
1873
1900
|
return e ? {
|
|
1874
|
-
...
|
|
1901
|
+
...or,
|
|
1875
1902
|
...e,
|
|
1876
1903
|
operators: {
|
|
1877
|
-
...
|
|
1904
|
+
...or.operators,
|
|
1878
1905
|
...e.operators
|
|
1879
1906
|
}
|
|
1880
|
-
} :
|
|
1907
|
+
} : or;
|
|
1881
1908
|
}
|
|
1882
1909
|
//#endregion
|
|
1883
1910
|
//#region src/tmdatagrid/core/persistence.ts
|
|
1884
|
-
var
|
|
1911
|
+
var cr = [
|
|
1885
1912
|
"columnFilters",
|
|
1886
1913
|
"globalFilter",
|
|
1887
1914
|
"sorting",
|
|
1888
1915
|
"pagination",
|
|
1889
1916
|
"expanded"
|
|
1890
|
-
],
|
|
1917
|
+
], lr = [
|
|
1891
1918
|
"columnVisibility",
|
|
1892
1919
|
"columnSizing",
|
|
1893
1920
|
"columnOrder",
|
|
1894
1921
|
"columnPinning",
|
|
1895
1922
|
"grouping"
|
|
1896
|
-
],
|
|
1897
|
-
function
|
|
1923
|
+
], ur = 1, dr = "__v";
|
|
1924
|
+
function fr(e, t) {
|
|
1898
1925
|
if (!e) return null;
|
|
1899
1926
|
if (typeof e == "string") return {
|
|
1900
1927
|
key: e,
|
|
@@ -1906,7 +1933,7 @@ function cr(e, t) {
|
|
|
1906
1933
|
slices: r
|
|
1907
1934
|
} : null;
|
|
1908
1935
|
}
|
|
1909
|
-
function
|
|
1936
|
+
function pr(e) {
|
|
1910
1937
|
if (!e) return null;
|
|
1911
1938
|
try {
|
|
1912
1939
|
return typeof window > "u" ? null : e.storageMode === "sessionStorage" ? window.sessionStorage : window.localStorage;
|
|
@@ -1914,36 +1941,36 @@ function lr(e) {
|
|
|
1914
1941
|
return null;
|
|
1915
1942
|
}
|
|
1916
1943
|
}
|
|
1917
|
-
function
|
|
1944
|
+
function mr(e, t) {
|
|
1918
1945
|
return typeof e == "object" && e ? e[t] : void 0;
|
|
1919
1946
|
}
|
|
1920
|
-
var
|
|
1921
|
-
function
|
|
1947
|
+
var hr = (e) => typeof e == "string", gr = (e) => typeof e == "number" && Number.isFinite(e);
|
|
1948
|
+
function _r(e, t) {
|
|
1922
1949
|
return Array.isArray(e) && e.every(t);
|
|
1923
1950
|
}
|
|
1924
|
-
function
|
|
1951
|
+
function vr(e, t) {
|
|
1925
1952
|
return typeof e != "object" || !e || Array.isArray(e) ? !1 : Object.values(e).every(t);
|
|
1926
1953
|
}
|
|
1927
|
-
var
|
|
1928
|
-
columnFilters: (e) =>
|
|
1954
|
+
var yr = (e) => hr(mr(e, "id")), br = {
|
|
1955
|
+
columnFilters: (e) => _r(e, yr),
|
|
1929
1956
|
globalFilter: () => !0,
|
|
1930
|
-
sorting: (e) =>
|
|
1957
|
+
sorting: (e) => _r(e, (e) => yr(e) && typeof mr(e, "desc") == "boolean"),
|
|
1931
1958
|
pagination: (e) => {
|
|
1932
|
-
let t =
|
|
1933
|
-
return
|
|
1959
|
+
let t = mr(e, "pageIndex"), n = mr(e, "pageSize");
|
|
1960
|
+
return gr(t) && t >= 0 && gr(n) && n > 0;
|
|
1934
1961
|
},
|
|
1935
|
-
expanded: (e) => e === !0 ||
|
|
1936
|
-
columnVisibility: (e) =>
|
|
1937
|
-
columnSizing: (e) =>
|
|
1938
|
-
columnOrder: (e) =>
|
|
1939
|
-
columnPinning: (e) =>
|
|
1940
|
-
grouping: (e) =>
|
|
1962
|
+
expanded: (e) => e === !0 || vr(e, (e) => typeof e == "boolean"),
|
|
1963
|
+
columnVisibility: (e) => vr(e, (e) => typeof e == "boolean"),
|
|
1964
|
+
columnSizing: (e) => vr(e, gr),
|
|
1965
|
+
columnOrder: (e) => _r(e, hr),
|
|
1966
|
+
columnPinning: (e) => _r(mr(e, "left"), hr) && _r(mr(e, "right"), hr),
|
|
1967
|
+
grouping: (e) => _r(e, hr)
|
|
1941
1968
|
};
|
|
1942
|
-
function
|
|
1943
|
-
let n =
|
|
1969
|
+
function xr(e, t) {
|
|
1970
|
+
let n = br[e];
|
|
1944
1971
|
return n === void 0 || n(t);
|
|
1945
1972
|
}
|
|
1946
|
-
function
|
|
1973
|
+
function Sr(e, t, n) {
|
|
1947
1974
|
if (!e || !t) return {};
|
|
1948
1975
|
try {
|
|
1949
1976
|
let r = e.getItem(t.key);
|
|
@@ -1951,39 +1978,39 @@ function vr(e, t, n) {
|
|
|
1951
1978
|
let i = n(r);
|
|
1952
1979
|
if (typeof i != "object" || !i) return {};
|
|
1953
1980
|
let a = i;
|
|
1954
|
-
if (a[
|
|
1981
|
+
if (a[dr] !== 1) return {};
|
|
1955
1982
|
let o = {};
|
|
1956
|
-
for (let e of t.slices) e in a &&
|
|
1983
|
+
for (let e of t.slices) e in a && xr(e, a[e]) && (o[e] = a[e]);
|
|
1957
1984
|
return o;
|
|
1958
1985
|
} catch {
|
|
1959
1986
|
return {};
|
|
1960
1987
|
}
|
|
1961
1988
|
}
|
|
1962
|
-
function
|
|
1989
|
+
function Cr(e, t, n, r) {
|
|
1963
1990
|
if (!e || !t) return;
|
|
1964
|
-
let i = { [
|
|
1991
|
+
let i = { [dr]: 1 };
|
|
1965
1992
|
for (let e of t.slices) i[e] = n[e];
|
|
1966
1993
|
try {
|
|
1967
1994
|
e.setItem(t.key, r(i));
|
|
1968
1995
|
} catch {}
|
|
1969
1996
|
}
|
|
1970
|
-
function
|
|
1997
|
+
function wr(e) {
|
|
1971
1998
|
return {
|
|
1972
|
-
data:
|
|
1973
|
-
settings:
|
|
1999
|
+
data: fr(e?.dataKey, cr),
|
|
2000
|
+
settings: fr(e?.settingsKey, lr)
|
|
1974
2001
|
};
|
|
1975
2002
|
}
|
|
1976
|
-
function
|
|
1977
|
-
let { data: t, settings: n } =
|
|
2003
|
+
function Tr(e) {
|
|
2004
|
+
let { data: t, settings: n } = wr(e);
|
|
1978
2005
|
return t !== null || n !== null;
|
|
1979
2006
|
}
|
|
1980
|
-
var
|
|
1981
|
-
function
|
|
2007
|
+
var Er = (e) => JSON.parse(e), Dr = (e) => JSON.stringify(e);
|
|
2008
|
+
function Or(e, t = []) {
|
|
1982
2009
|
for (let n of e) {
|
|
1983
2010
|
if (typeof n != "object" || !n) continue;
|
|
1984
2011
|
let e = n;
|
|
1985
2012
|
if (Array.isArray(e.columns) && e.columns.length > 0) {
|
|
1986
|
-
|
|
2013
|
+
Or(e.columns, t);
|
|
1987
2014
|
continue;
|
|
1988
2015
|
}
|
|
1989
2016
|
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);
|
|
@@ -1991,29 +2018,29 @@ function wr(e, t = []) {
|
|
|
1991
2018
|
}
|
|
1992
2019
|
return t;
|
|
1993
2020
|
}
|
|
1994
|
-
function
|
|
2021
|
+
function kr(e, t) {
|
|
1995
2022
|
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 };
|
|
1996
2023
|
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 = {
|
|
1997
2024
|
left: r(e.columnPinning.left ?? []),
|
|
1998
2025
|
right: r(e.columnPinning.right ?? [])
|
|
1999
2026
|
}), e.sorting && (o.sorting = a(e.sorting)), e.columnFilters && (o.columnFilters = a(e.columnFilters)), o;
|
|
2000
2027
|
}
|
|
2001
|
-
function
|
|
2002
|
-
let n =
|
|
2003
|
-
...
|
|
2004
|
-
...
|
|
2028
|
+
function Ar(e, t) {
|
|
2029
|
+
let n = pr(e), { data: r, settings: i } = wr(e), a = e?.deserialize ?? Er, o = {
|
|
2030
|
+
...Sr(n, i, a),
|
|
2031
|
+
...Sr(n, r, a)
|
|
2005
2032
|
};
|
|
2006
|
-
return t === void 0 ? o :
|
|
2033
|
+
return t === void 0 ? o : kr(o, new Set(t));
|
|
2007
2034
|
}
|
|
2008
|
-
function
|
|
2009
|
-
let n =
|
|
2035
|
+
function jr(e, t) {
|
|
2036
|
+
let n = pr(t);
|
|
2010
2037
|
if (!n) return;
|
|
2011
|
-
let { data: r, settings: i } =
|
|
2012
|
-
|
|
2038
|
+
let { data: r, settings: i } = wr(t), a = t?.serialize ?? Dr;
|
|
2039
|
+
Cr(n, r, e, a), Cr(n, i, e, a);
|
|
2013
2040
|
}
|
|
2014
2041
|
//#endregion
|
|
2015
2042
|
//#region src/tmdatagrid/core/capabilities.ts
|
|
2016
|
-
function
|
|
2043
|
+
function Mr(e) {
|
|
2017
2044
|
let t = e.selectionMode ?? "checkbox", n = e.cellSelection ?? (e.editMode === void 0 ? "none" : "single"), r = t !== "highlight" && e.enableRowSelection !== !1;
|
|
2018
2045
|
return {
|
|
2019
2046
|
sorting: e.enableSorting !== !1,
|
|
@@ -2042,19 +2069,19 @@ function Or(e) {
|
|
|
2042
2069
|
matchHighlighting: e.enableMatchHighlighting === !0
|
|
2043
2070
|
};
|
|
2044
2071
|
}
|
|
2045
|
-
function
|
|
2072
|
+
function Nr(e, t) {
|
|
2046
2073
|
return {
|
|
2047
2074
|
canSort: t.sorting && e.getCanSort(),
|
|
2048
2075
|
canFilter: t.filtering && e.getCanFilter(),
|
|
2049
2076
|
canHide: t.hiding && e.getCanHide(),
|
|
2050
2077
|
canPin: t.pinning && e.getCanPin(),
|
|
2051
2078
|
canResize: t.resizing && e.getCanResize(),
|
|
2052
|
-
canReorder: t.ordering &&
|
|
2079
|
+
canReorder: t.ordering && dn(e),
|
|
2053
2080
|
canGroup: t.grouping && e.getCanGroup()
|
|
2054
2081
|
};
|
|
2055
2082
|
}
|
|
2056
|
-
function
|
|
2057
|
-
let n = e.getAllLeafColumns(), r = (e) => n.some((n) => e(
|
|
2083
|
+
function Pr(e, t) {
|
|
2084
|
+
let n = e.getAllLeafColumns(), r = (e) => n.some((n) => e(Nr(n, t)));
|
|
2058
2085
|
return {
|
|
2059
2086
|
canSortAny: r((e) => e.canSort),
|
|
2060
2087
|
canFilterAny: r((e) => e.canFilter),
|
|
@@ -2069,12 +2096,12 @@ function Ar(e, t) {
|
|
|
2069
2096
|
}
|
|
2070
2097
|
//#endregion
|
|
2071
2098
|
//#region src/tmdatagrid/core/cellNavigation.ts
|
|
2072
|
-
var
|
|
2073
|
-
function
|
|
2099
|
+
var Fr = (e, t) => Math.min(Math.max(e, 0), Math.max(t, 0));
|
|
2100
|
+
function Ir({ key: e, ctrlKey: t, from: n, rowCount: r, columnCount: i, pageRows: a }) {
|
|
2074
2101
|
if (r === 0 || i === 0) return null;
|
|
2075
2102
|
let o = r - 1, s = i - 1, c = (e, t) => ({
|
|
2076
|
-
rowIndex:
|
|
2077
|
-
columnIndex:
|
|
2103
|
+
rowIndex: Fr(e, o),
|
|
2104
|
+
columnIndex: Fr(t, s)
|
|
2078
2105
|
});
|
|
2079
2106
|
switch (e) {
|
|
2080
2107
|
case "ArrowDown": return c(n.rowIndex + 1, n.columnIndex);
|
|
@@ -2088,7 +2115,7 @@ function Mr({ key: e, ctrlKey: t, from: n, rowCount: r, columnCount: i, pageRows
|
|
|
2088
2115
|
default: return null;
|
|
2089
2116
|
}
|
|
2090
2117
|
}
|
|
2091
|
-
function
|
|
2118
|
+
function Lr({ from: e, direction: t, rowCount: n, columnCount: r, isEditable: i }) {
|
|
2092
2119
|
let a = n * r;
|
|
2093
2120
|
if (a === 0) return null;
|
|
2094
2121
|
let o = e.rowIndex * r + e.columnIndex;
|
|
@@ -2101,12 +2128,12 @@ function Nr({ from: e, direction: t, rowCount: n, columnCount: r, isEditable: i
|
|
|
2101
2128
|
}
|
|
2102
2129
|
return null;
|
|
2103
2130
|
}
|
|
2104
|
-
function
|
|
2131
|
+
function Rr(e, t) {
|
|
2105
2132
|
return e === null || t === null ? e === t : e.rowId === t.rowId && e.columnId === t.columnId;
|
|
2106
2133
|
}
|
|
2107
2134
|
//#endregion
|
|
2108
2135
|
//#region src/tmdatagrid/useTMDataGrid.tsx
|
|
2109
|
-
var
|
|
2136
|
+
var zr = 200, Br = Ge({
|
|
2110
2137
|
columnFilteringFeature: Se,
|
|
2111
2138
|
globalFilteringFeature: Le,
|
|
2112
2139
|
rowSortingFeature: Ue,
|
|
@@ -2123,7 +2150,7 @@ var Fr = 200, Ir = Ge({
|
|
|
2123
2150
|
rowPinningFeature: Ve,
|
|
2124
2151
|
filteredRowModel: je(),
|
|
2125
2152
|
groupedRowModel: Me(),
|
|
2126
|
-
sortedRowModel:
|
|
2153
|
+
sortedRowModel: ar(),
|
|
2127
2154
|
expandedRowModel: Oe(),
|
|
2128
2155
|
paginatedRowModel: Ne(),
|
|
2129
2156
|
facetedRowModel: J(),
|
|
@@ -2132,21 +2159,21 @@ var Fr = 200, Ir = Ge({
|
|
|
2132
2159
|
filterFns: {
|
|
2133
2160
|
...Fe,
|
|
2134
2161
|
tmDataGrid: Ct,
|
|
2135
|
-
tmDataGridFuzzy:
|
|
2162
|
+
tmDataGridFuzzy: nr
|
|
2136
2163
|
},
|
|
2137
2164
|
sortFns: We,
|
|
2138
2165
|
aggregationFns: be,
|
|
2139
2166
|
tableMeta: Re(),
|
|
2140
2167
|
columnMeta: Re()
|
|
2141
2168
|
});
|
|
2142
|
-
function
|
|
2169
|
+
function Vr() {
|
|
2143
2170
|
return De();
|
|
2144
2171
|
}
|
|
2145
|
-
var
|
|
2146
|
-
function
|
|
2172
|
+
var Hr = 160, Ur = 6;
|
|
2173
|
+
function Wr(e) {
|
|
2147
2174
|
return e.map((e) => "columns" in e && Array.isArray(e.columns) ? {
|
|
2148
2175
|
...e,
|
|
2149
|
-
columns:
|
|
2176
|
+
columns: Wr(e.columns)
|
|
2150
2177
|
} : {
|
|
2151
2178
|
filterFn: "tmDataGrid",
|
|
2152
2179
|
aggregationFn: void 0,
|
|
@@ -2154,8 +2181,8 @@ function Br(e) {
|
|
|
2154
2181
|
...e
|
|
2155
2182
|
});
|
|
2156
2183
|
}
|
|
2157
|
-
function
|
|
2158
|
-
let O =
|
|
2184
|
+
function Gr({ persist: e, labels: t, enableColumnOrdering: r, enablePagination: a, enableRowNumbers: l, selectionMode: u, showSelectedBackground: d, defaultHighlightedRowId: f, onHighlightedRowChange: p, cellSelection: m, onFocusedCellChange: h, editMode: g, rowValidators: _, isRowEditable: v, onEditCommit: y, onEditCommitBatch: b, newRowDefaults: x, onRowAdd: S, onRowDelete: C, renderDetails: w, renderDetailsEstHeight: T = Hr, overscan: E = Ur, ...D }) {
|
|
2185
|
+
let O = Mr({
|
|
2159
2186
|
...D,
|
|
2160
2187
|
enableColumnOrdering: r,
|
|
2161
2188
|
enablePagination: a,
|
|
@@ -2164,15 +2191,15 @@ function Vr({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2164
2191
|
showSelectedBackground: d,
|
|
2165
2192
|
cellSelection: m,
|
|
2166
2193
|
editMode: g
|
|
2167
|
-
}), k = o(() =>
|
|
2168
|
-
let e =
|
|
2194
|
+
}), k = o(() => sr(t), [t]), j = D.enableColumnPinning !== !1, M = O.selectColumn, N = O.grouping, P = w !== void 0, F = g !== void 0 && (g === "row" || C !== void 0 || g === "batch" && b !== void 0), ee = k.selectColumnLabel, I = k.groupColumnLabel, te = k.detailsColumnLabel, ne = k.editColumnLabel, L = k.rowNumberColumnLabel, R = O.rowNumbers, z = o(() => {
|
|
2195
|
+
let e = Wr(D.columns);
|
|
2169
2196
|
return [
|
|
2170
|
-
...R ? [
|
|
2171
|
-
...M ? [
|
|
2172
|
-
...N ? [
|
|
2197
|
+
...R ? [Wt(L)] : [],
|
|
2198
|
+
...M ? [tn(ee)] : [],
|
|
2199
|
+
...N ? [bn(I)] : [],
|
|
2173
2200
|
...P ? [Mt(te)] : [],
|
|
2174
2201
|
...e,
|
|
2175
|
-
...F ? [
|
|
2202
|
+
...F ? [Ht(ne)] : []
|
|
2176
2203
|
];
|
|
2177
2204
|
}, [
|
|
2178
2205
|
D.columns,
|
|
@@ -2186,7 +2213,7 @@ function Vr({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2186
2213
|
I,
|
|
2187
2214
|
te,
|
|
2188
2215
|
ne
|
|
2189
|
-
]), [re] = c(() =>
|
|
2216
|
+
]), [re] = c(() => Ar(e, Or(z))), ie = re.grouping ?? D.initialState?.grouping ?? [], B = Ke({
|
|
2190
2217
|
columnResizeMode: "onChange",
|
|
2191
2218
|
enableSorting: !0,
|
|
2192
2219
|
enableColumnResizing: !0,
|
|
@@ -2195,7 +2222,7 @@ function Vr({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2195
2222
|
...D,
|
|
2196
2223
|
...w === void 0 ? {} : { getRowCanExpand: D.getRowCanExpand ?? (() => !0) },
|
|
2197
2224
|
enableRowPinning: (e) => !e.getIsGrouped() && (typeof D.enableRowPinning == "function" ? D.enableRowPinning(e) : D.enableRowPinning === !0),
|
|
2198
|
-
features:
|
|
2225
|
+
features: Br,
|
|
2199
2226
|
columns: z,
|
|
2200
2227
|
initialState: {
|
|
2201
2228
|
...D.initialState,
|
|
@@ -2203,17 +2230,17 @@ function Vr({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2203
2230
|
columnVisibility: {
|
|
2204
2231
|
...D.initialState?.columnVisibility,
|
|
2205
2232
|
...re.columnVisibility,
|
|
2206
|
-
...N ? { [
|
|
2233
|
+
...N ? { [pn]: ie.length > 0 } : {}
|
|
2207
2234
|
},
|
|
2208
2235
|
columnPinning: {
|
|
2209
2236
|
left: [
|
|
2210
|
-
...R && j ? [
|
|
2211
|
-
...M && j ? [
|
|
2212
|
-
...N && j ? [
|
|
2237
|
+
...R && j ? [Ut] : [],
|
|
2238
|
+
...M && j ? [Xt] : [],
|
|
2239
|
+
...N && j ? [pn] : [],
|
|
2213
2240
|
...P && j ? [kt] : [],
|
|
2214
2241
|
...(re.columnPinning?.left ?? D.initialState?.columnPinning?.left ?? []).filter((e) => e !== "__rowNumber__" && e !== "__select__" && e !== "__details__" && e !== "__group__")
|
|
2215
2242
|
],
|
|
2216
|
-
right: [...(re.columnPinning?.right ?? D.initialState?.columnPinning?.right ?? []).filter((e) => e !==
|
|
2243
|
+
right: [...(re.columnPinning?.right ?? D.initialState?.columnPinning?.right ?? []).filter((e) => e !== Bt), ...F && j ? [Bt] : []]
|
|
2217
2244
|
},
|
|
2218
2245
|
pagination: {
|
|
2219
2246
|
pageIndex: 0,
|
|
@@ -2234,7 +2261,7 @@ function Vr({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2234
2261
|
onRowAdd: S,
|
|
2235
2262
|
onRowDelete: C
|
|
2236
2263
|
};
|
|
2237
|
-
let [oe] = c(() =>
|
|
2264
|
+
let [oe] = c(() => $n(() => ae.current)), se = s(g);
|
|
2238
2265
|
i(() => {
|
|
2239
2266
|
se.current !== g && (se.current = g, oe.cancelAll());
|
|
2240
2267
|
}, [g, oe]), i(() => {
|
|
@@ -2244,17 +2271,17 @@ function Vr({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2244
2271
|
let e = B.store.state.grouping, t = B.store.subscribe((t) => {
|
|
2245
2272
|
t.grouping !== e && (e = t.grouping, B.setColumnVisibility((e) => ({
|
|
2246
2273
|
...e,
|
|
2247
|
-
[
|
|
2274
|
+
[pn]: t.grouping.length > 0
|
|
2248
2275
|
})), B.setColumnOrder((e) => [...e]));
|
|
2249
2276
|
});
|
|
2250
2277
|
return () => t.unsubscribe();
|
|
2251
2278
|
}, [N, B]), i(() => {
|
|
2252
|
-
if (!
|
|
2253
|
-
|
|
2279
|
+
if (!Tr(e)) return;
|
|
2280
|
+
jr(B.store.state, e);
|
|
2254
2281
|
let t, n = null, r = () => {
|
|
2255
|
-
t = void 0, n !== null && (
|
|
2282
|
+
t = void 0, n !== null && (jr(n, e), n = null);
|
|
2256
2283
|
}, i = B.store.subscribe((e) => {
|
|
2257
|
-
n = e, t !== void 0 && clearTimeout(t), t = setTimeout(r,
|
|
2284
|
+
n = e, t !== void 0 && clearTimeout(t), t = setTimeout(r, zr);
|
|
2258
2285
|
});
|
|
2259
2286
|
return () => {
|
|
2260
2287
|
i.unsubscribe(), t !== void 0 && clearTimeout(t), r();
|
|
@@ -2304,11 +2331,11 @@ function Vr({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2304
2331
|
...e,
|
|
2305
2332
|
selectionAnchorRowId: t
|
|
2306
2333
|
})),
|
|
2307
|
-
setFocusedCell: (t) => e((e) =>
|
|
2334
|
+
setFocusedCell: (t) => e((e) => Rr(e.focusedCell, t) ? e : {
|
|
2308
2335
|
...e,
|
|
2309
2336
|
focusedCell: t
|
|
2310
2337
|
}),
|
|
2311
|
-
setCellRange: (t) => e((e) =>
|
|
2338
|
+
setCellRange: (t) => e((e) => Rr(e.cellRange?.anchor ?? null, t?.anchor ?? null) && Rr(e.cellRange?.focus ?? null, t?.focus ?? null) ? e : {
|
|
2312
2339
|
...e,
|
|
2313
2340
|
cellRange: t
|
|
2314
2341
|
})
|
|
@@ -2335,16 +2362,16 @@ function Vr({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2335
2362
|
let e = D.initialState, t = [...e?.grouping ?? []];
|
|
2336
2363
|
B.setGrouping(t), B.setColumnVisibility({
|
|
2337
2364
|
...e?.columnVisibility,
|
|
2338
|
-
...N ? { [
|
|
2365
|
+
...N ? { [pn]: t.length > 0 } : {}
|
|
2339
2366
|
}), B.setColumnSizing({ ...e?.columnSizing }), B.setColumnOrder([...e?.columnOrder ?? []]), B.setColumnPinning({
|
|
2340
2367
|
left: [
|
|
2341
|
-
...R && j ? [
|
|
2342
|
-
...M && j ? [
|
|
2343
|
-
...N && j ? [
|
|
2368
|
+
...R && j ? [Ut] : [],
|
|
2369
|
+
...M && j ? [Xt] : [],
|
|
2370
|
+
...N && j ? [pn] : [],
|
|
2344
2371
|
...P && j ? [kt] : [],
|
|
2345
2372
|
...(e?.columnPinning?.left ?? []).filter((e) => e !== "__rowNumber__" && e !== "__select__" && e !== "__details__" && e !== "__group__")
|
|
2346
2373
|
],
|
|
2347
|
-
right: [...(e?.columnPinning?.right ?? []).filter((e) => e !==
|
|
2374
|
+
right: [...(e?.columnPinning?.right ?? []).filter((e) => e !== Bt), ...F && j ? [Bt] : []]
|
|
2348
2375
|
});
|
|
2349
2376
|
};
|
|
2350
2377
|
let ue = n(() => H.current(), []), U = s(() => !1);
|
|
@@ -2362,10 +2389,10 @@ function Vr({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2362
2389
|
scrollerRef: U
|
|
2363
2390
|
};
|
|
2364
2391
|
}
|
|
2365
|
-
function
|
|
2392
|
+
function Kr(e, t) {
|
|
2366
2393
|
let n = e.table.getColumn(t);
|
|
2367
2394
|
if (n && n.getFilterValue() === void 0) {
|
|
2368
|
-
let e =
|
|
2395
|
+
let e = an(n);
|
|
2369
2396
|
n.setFilterValue({
|
|
2370
2397
|
operator: e,
|
|
2371
2398
|
value: ht(e)
|
|
@@ -2375,24 +2402,24 @@ function Hr(e, t) {
|
|
|
2375
2402
|
}
|
|
2376
2403
|
//#endregion
|
|
2377
2404
|
//#region src/tmdatagrid/components/TMDataGridFilterPills.tsx
|
|
2378
|
-
function
|
|
2379
|
-
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,
|
|
2405
|
+
function qr(t) {
|
|
2406
|
+
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, Yr), m, h, g, _, v, b, x, S, C;
|
|
2380
2407
|
if (n[0] !== r || n[1] !== s || n[2] !== p || n[3] !== f || n[4] !== o || n[5] !== c || n[6] !== u) {
|
|
2381
2408
|
C = Symbol.for("react.early_return_sentinel");
|
|
2382
2409
|
bb0: {
|
|
2383
|
-
if (h = p.filter(
|
|
2410
|
+
if (h = p.filter(Jr), h.length === 0) {
|
|
2384
2411
|
C = null;
|
|
2385
2412
|
break bb0;
|
|
2386
2413
|
}
|
|
2387
2414
|
v = "group", b = f.activeFilters, x = "filter-pills";
|
|
2388
2415
|
let e;
|
|
2389
|
-
n[16] === s ? e = n[17] : (e = [
|
|
2416
|
+
n[16] === s ? e = n[17] : (e = [Kn.filterPills, s].filter(Boolean), n[16] = s, n[17] = e), S = e.join(" "), m = y.Group, g = c;
|
|
2390
2417
|
let t;
|
|
2391
2418
|
n[18] !== r || n[19] !== p || n[20] !== f || n[21] !== o || n[22] !== c || n[23] !== u ? (t = (e) => {
|
|
2392
|
-
let t = u.getColumn(e.id), n = t ?
|
|
2419
|
+
let t = u.getColumn(e.id), n = t ? nn(t) : e.id, i = e.value;
|
|
2393
2420
|
return gt(i) ? /* @__PURE__ */ W(y, {
|
|
2394
2421
|
size: c,
|
|
2395
|
-
className:
|
|
2422
|
+
className: Kn.pill,
|
|
2396
2423
|
"data-dg-part": "filter-pill",
|
|
2397
2424
|
"data-column-id": e.id,
|
|
2398
2425
|
withRemoveButton: !0,
|
|
@@ -2403,11 +2430,11 @@ function Ur(t) {
|
|
|
2403
2430
|
tabIndex: 0
|
|
2404
2431
|
},
|
|
2405
2432
|
children: /* @__PURE__ */ W(k, {
|
|
2406
|
-
className:
|
|
2407
|
-
onClick: () => o ? o(e.id) :
|
|
2433
|
+
className: Kn.pillLabel,
|
|
2434
|
+
onClick: () => o ? o(e.id) : Kr(r, e.id),
|
|
2408
2435
|
children: vt({
|
|
2409
2436
|
label: n,
|
|
2410
|
-
type: t ?
|
|
2437
|
+
type: t ? rn(t) : "string",
|
|
2411
2438
|
filter: i,
|
|
2412
2439
|
operatorLabels: f.operators
|
|
2413
2440
|
})
|
|
@@ -2440,16 +2467,16 @@ function Ur(t) {
|
|
|
2440
2467
|
children: [w, T]
|
|
2441
2468
|
}), 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;
|
|
2442
2469
|
}
|
|
2443
|
-
function
|
|
2470
|
+
function Jr(e) {
|
|
2444
2471
|
return _t(e.value);
|
|
2445
2472
|
}
|
|
2446
|
-
function
|
|
2473
|
+
function Yr(e) {
|
|
2447
2474
|
return e.columnFilters;
|
|
2448
2475
|
}
|
|
2449
|
-
var
|
|
2476
|
+
var Xr = { footer: "_footer_te0a3_1" };
|
|
2450
2477
|
//#endregion
|
|
2451
2478
|
//#region src/tmdatagrid/components/TMDataGridFooter.tsx
|
|
2452
|
-
function
|
|
2479
|
+
function Zr(e, t = !0) {
|
|
2453
2480
|
let { pageIndex: n, pageSize: r } = e.store.state.pagination, i = e.getRowCount();
|
|
2454
2481
|
return {
|
|
2455
2482
|
state: {
|
|
@@ -2473,13 +2500,13 @@ function qr(e, t = !0) {
|
|
|
2473
2500
|
}
|
|
2474
2501
|
};
|
|
2475
2502
|
}
|
|
2476
|
-
function
|
|
2503
|
+
function Qr(t) {
|
|
2477
2504
|
let n = e(23), { pageSizeOptions: r } = t, { table: i, features: a, labels: o, controlSize: s } = X();
|
|
2478
2505
|
j(i.store);
|
|
2479
2506
|
let c;
|
|
2480
|
-
n[0] !== a || n[1] !== i ? (c =
|
|
2507
|
+
n[0] !== a || n[1] !== i ? (c = qt(i, a), n[0] = a, n[1] = i, n[2] = c) : c = n[2];
|
|
2481
2508
|
let l = c, { pageSize: u } = i.store.state.pagination, d;
|
|
2482
|
-
n[3] !== u || n[4] !== r ? (d = r.includes(u) ? r : [...r, u].sort(
|
|
2509
|
+
n[3] !== u || n[4] !== r ? (d = r.includes(u) ? r : [...r, u].sort($r), n[3] = u, n[4] = r, n[5] = d) : d = n[5];
|
|
2483
2510
|
let f = d, m;
|
|
2484
2511
|
n[6] !== s || n[7] !== o.rowsPerPage ? (m = /* @__PURE__ */ W(E, {
|
|
2485
2512
|
span: !0,
|
|
@@ -2512,14 +2539,14 @@ function Jr(t) {
|
|
|
2512
2539
|
children: [m, y]
|
|
2513
2540
|
}), n[20] = m, n[21] = y, n[22] = b) : b = n[22], b;
|
|
2514
2541
|
}
|
|
2515
|
-
function
|
|
2542
|
+
function $r(e, t) {
|
|
2516
2543
|
return e - t;
|
|
2517
2544
|
}
|
|
2518
|
-
function
|
|
2545
|
+
function ei() {
|
|
2519
2546
|
let t = e(22), { table: n, features: r, labels: i, controlSize: a } = X();
|
|
2520
2547
|
j(n.store);
|
|
2521
2548
|
let o;
|
|
2522
|
-
t[0] !== r || t[1] !== n ? (o =
|
|
2549
|
+
t[0] !== r || t[1] !== n ? (o = qt(n, r), t[0] = r, t[1] = n, t[2] = o) : o = t[2];
|
|
2523
2550
|
let s = o, { pageIndex: c, pageSize: l } = n.store.state.pagination, u, d, f, p, m, h;
|
|
2524
2551
|
if (t[3] !== a || t[4] !== i || t[5] !== c || t[6] !== l || t[7] !== s || t[8] !== n) {
|
|
2525
2552
|
let e = n.getRowCount(), r = e === 0 ? 0 : c * l + 1, o = Math.min(e, (c + 1) * l);
|
|
@@ -2538,11 +2565,11 @@ function Xr() {
|
|
|
2538
2565
|
children: h
|
|
2539
2566
|
}), 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;
|
|
2540
2567
|
}
|
|
2541
|
-
function
|
|
2568
|
+
function ti() {
|
|
2542
2569
|
let t = e(26), { table: n, features: r, labels: i } = X();
|
|
2543
2570
|
j(n.store);
|
|
2544
2571
|
let a;
|
|
2545
|
-
t[0] !== r || t[1] !== n ? (a =
|
|
2572
|
+
t[0] !== r || t[1] !== n ? (a = qt(n, r), t[0] = r, t[1] = n, t[2] = a) : a = t[2];
|
|
2546
2573
|
let o = a, s;
|
|
2547
2574
|
t[3] !== o || t[4] !== n ? (s = !o || !n.getCanPreviousPage(), t[3] = o, t[4] = n, t[5] = s) : s = t[5];
|
|
2548
2575
|
let c;
|
|
@@ -2588,31 +2615,31 @@ function Zr() {
|
|
|
2588
2615
|
children: [d, g]
|
|
2589
2616
|
}), t[23] = d, t[24] = g, t[25] = _) : _ = t[25], _;
|
|
2590
2617
|
}
|
|
2591
|
-
var
|
|
2618
|
+
var ni = [
|
|
2592
2619
|
10,
|
|
2593
2620
|
25,
|
|
2594
2621
|
50,
|
|
2595
2622
|
100
|
|
2596
2623
|
];
|
|
2597
|
-
function
|
|
2598
|
-
let n = e(23), { pageSizeOptions: r, renderPagination: i } = t, a = r === void 0 ?
|
|
2624
|
+
function ri(t) {
|
|
2625
|
+
let n = e(23), { pageSizeOptions: r, renderPagination: i } = t, a = r === void 0 ? ni : r, { table: o, features: s, labels: c } = X();
|
|
2599
2626
|
j(o.store);
|
|
2600
2627
|
let l;
|
|
2601
2628
|
n[0] === a ? l = n[1] : (l = {
|
|
2602
|
-
PageSize: () => /* @__PURE__ */ W(
|
|
2603
|
-
Range:
|
|
2604
|
-
Pager:
|
|
2629
|
+
PageSize: () => /* @__PURE__ */ W(Qr, { pageSizeOptions: a }),
|
|
2630
|
+
Range: ei,
|
|
2631
|
+
Pager: ti
|
|
2605
2632
|
}, n[0] = a, n[1] = l);
|
|
2606
2633
|
let u = l;
|
|
2607
|
-
if (!
|
|
2634
|
+
if (!Pr(o, s).canPaginate) return null;
|
|
2608
2635
|
let d, f;
|
|
2609
2636
|
if (n[2] !== u || n[3] !== s || n[4] !== i || n[5] !== o) {
|
|
2610
2637
|
f = Symbol.for("react.early_return_sentinel");
|
|
2611
|
-
bb0: if (d =
|
|
2612
|
-
let { state: e, actions: t } =
|
|
2638
|
+
bb0: if (d = qt(o, s), i) {
|
|
2639
|
+
let { state: e, actions: t } = Zr(o, d);
|
|
2613
2640
|
f = /* @__PURE__ */ W("div", {
|
|
2614
2641
|
"data-dg-part": "footer",
|
|
2615
|
-
className:
|
|
2642
|
+
className: Xr.footer,
|
|
2616
2643
|
children: i({
|
|
2617
2644
|
state: e,
|
|
2618
2645
|
actions: t,
|
|
@@ -2633,7 +2660,7 @@ function $r(t) {
|
|
|
2633
2660
|
let _;
|
|
2634
2661
|
n[14] !== p || n[15] !== m || n[16] !== h || n[17] !== g ? (_ = /* @__PURE__ */ G("div", {
|
|
2635
2662
|
"data-dg-part": "footer",
|
|
2636
|
-
className:
|
|
2663
|
+
className: Xr.footer,
|
|
2637
2664
|
"data-paging-suspended": p,
|
|
2638
2665
|
children: [
|
|
2639
2666
|
m,
|
|
@@ -2654,13 +2681,13 @@ function $r(t) {
|
|
|
2654
2681
|
}
|
|
2655
2682
|
//#endregion
|
|
2656
2683
|
//#region src/tmdatagrid/components/TMDataGridSearch.tsx
|
|
2657
|
-
function
|
|
2658
|
-
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 } = X(), g = j(f.store,
|
|
2684
|
+
function ii(t) {
|
|
2685
|
+
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 } = X(), g = j(f.store, ai), [_, v] = c(g), y = s(void 0), b = s(g), x, S;
|
|
2659
2686
|
n[0] === g ? (x = n[1], S = n[2]) : (x = () => {
|
|
2660
2687
|
g !== b.current && (b.current = g, v(g));
|
|
2661
2688
|
}, S = [g], n[0] = g, n[1] = x, n[2] = S), i(x, S);
|
|
2662
2689
|
let C, w;
|
|
2663
|
-
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), !
|
|
2690
|
+
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), !Pr(f, p).canSearch) return null;
|
|
2664
2691
|
let T;
|
|
2665
2692
|
n[5] === f ? T = n[6] : (T = (e) => {
|
|
2666
2693
|
b.current = e, f.setGlobalFilter(e === "" ? void 0 : e);
|
|
@@ -2708,7 +2735,7 @@ function ei(t) {
|
|
|
2708
2735
|
rightSection: P
|
|
2709
2736
|
}), 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;
|
|
2710
2737
|
}
|
|
2711
|
-
function
|
|
2738
|
+
function ai(e) {
|
|
2712
2739
|
return typeof e.globalFilter == "string" ? e.globalFilter : "";
|
|
2713
2740
|
}
|
|
2714
2741
|
var Q = {
|
|
@@ -2732,7 +2759,7 @@ var Q = {
|
|
|
2732
2759
|
matchHighlight: "_matchHighlight_15qzd_422",
|
|
2733
2760
|
summaryRow: "_summaryRow_15qzd_434",
|
|
2734
2761
|
summaryCell: "_summaryCell_15qzd_443"
|
|
2735
|
-
},
|
|
2762
|
+
}, oi = {
|
|
2736
2763
|
stickyLeft: "_stickyLeft_1vw51_16",
|
|
2737
2764
|
stickyRight: "_stickyRight_1vw51_17",
|
|
2738
2765
|
stickyEdgeIn: "_stickyEdgeIn_1vw51_1",
|
|
@@ -2753,32 +2780,32 @@ var Q = {
|
|
|
2753
2780
|
columnSeparatorResizable: "_columnSeparatorResizable_188ed_152",
|
|
2754
2781
|
columnSeparatorActive: "_columnSeparatorActive_188ed_175",
|
|
2755
2782
|
menuItemActive: "_menuItemActive_188ed_181"
|
|
2756
|
-
},
|
|
2757
|
-
function
|
|
2783
|
+
}, si = 30, ci = 2;
|
|
2784
|
+
function li(e) {
|
|
2758
2785
|
let t = document.createRange();
|
|
2759
2786
|
t.selectNodeContents(e);
|
|
2760
2787
|
let n = typeof t.getBoundingClientRect == "function" ? t.getBoundingClientRect().width : 0;
|
|
2761
2788
|
return n > 0 ? n : e.scrollWidth;
|
|
2762
2789
|
}
|
|
2763
|
-
function
|
|
2790
|
+
function ui({ container: e, columnId: t }) {
|
|
2764
2791
|
let n = 0, r = e.querySelectorAll(`[role="cell"][data-column-id="${CSS.escape(t)}"],[role="gridcell"][data-column-id="${CSS.escape(t)}"]`);
|
|
2765
2792
|
for (let e of r) {
|
|
2766
2793
|
let t = e.firstElementChild;
|
|
2767
2794
|
if (!(t instanceof HTMLElement)) continue;
|
|
2768
2795
|
let r = getComputedStyle(e), i = (Number.parseFloat(r.paddingLeft) || 0) + (Number.parseFloat(r.paddingRight) || 0);
|
|
2769
|
-
n = Math.max(n,
|
|
2796
|
+
n = Math.max(n, li(t) + i + ci);
|
|
2770
2797
|
}
|
|
2771
2798
|
let i = e.querySelector(`[data-column-id="${CSS.escape(t)}"] [data-dg-header-title]`);
|
|
2772
2799
|
if (i) {
|
|
2773
2800
|
let e = i.closest("[role=\"columnheader\"]"), t = e ? getComputedStyle(e) : null, r = t ? (Number.parseFloat(t.paddingLeft) || 0) + (Number.parseFloat(t.paddingRight) || 0) : 0;
|
|
2774
|
-
n = Math.max(n,
|
|
2801
|
+
n = Math.max(n, li(i) + r + si);
|
|
2775
2802
|
}
|
|
2776
2803
|
return n;
|
|
2777
2804
|
}
|
|
2778
|
-
function
|
|
2805
|
+
function di({ table: e, columnId: t, container: n }) {
|
|
2779
2806
|
let r = e, i = r.getColumn(t);
|
|
2780
2807
|
if (!i || !i.getCanResize()) return !1;
|
|
2781
|
-
let a =
|
|
2808
|
+
let a = ui({
|
|
2782
2809
|
container: n,
|
|
2783
2810
|
columnId: t
|
|
2784
2811
|
});
|
|
@@ -2791,39 +2818,39 @@ function si({ table: e, columnId: t, container: n }) {
|
|
|
2791
2818
|
}
|
|
2792
2819
|
//#endregion
|
|
2793
2820
|
//#region src/tmdatagrid/core/columnOrdering.ts
|
|
2794
|
-
function
|
|
2821
|
+
function fi(e, t) {
|
|
2795
2822
|
return e.left.includes(t) ? "left" : e.right.includes(t) ? "right" : "center";
|
|
2796
2823
|
}
|
|
2797
|
-
function
|
|
2824
|
+
function pi(e, t, n, r) {
|
|
2798
2825
|
let i = e.filter((e) => e !== t), a = i.indexOf(n);
|
|
2799
2826
|
return a === -1 ? [...e] : (i.splice(r === "before" ? a : a + 1, 0, t), i);
|
|
2800
2827
|
}
|
|
2801
|
-
function
|
|
2828
|
+
function mi({ table: e, columnId: t, targetId: n, side: r }) {
|
|
2802
2829
|
if (t === n) return;
|
|
2803
|
-
let i = e.store.state.columnPinning, a =
|
|
2804
|
-
if (a !==
|
|
2830
|
+
let i = e.store.state.columnPinning, a = fi(i, t);
|
|
2831
|
+
if (a !== fi(i, n)) return;
|
|
2805
2832
|
let o = e.getAllLeafColumns().map((e) => e.id);
|
|
2806
|
-
e.setColumnOrder(
|
|
2833
|
+
e.setColumnOrder(pi(o, t, n, r)), a !== "center" && e.setColumnPinning((e) => ({
|
|
2807
2834
|
...e,
|
|
2808
|
-
[a]:
|
|
2835
|
+
[a]: pi(e[a], t, n, r)
|
|
2809
2836
|
}));
|
|
2810
2837
|
}
|
|
2811
|
-
function
|
|
2838
|
+
function hi(e, t) {
|
|
2812
2839
|
return t === "left" ? e.getLeftVisibleLeafColumns() : t === "right" ? e.getRightVisibleLeafColumns() : e.getCenterVisibleLeafColumns();
|
|
2813
2840
|
}
|
|
2814
|
-
function
|
|
2815
|
-
let r =
|
|
2841
|
+
function gi({ table: e, columnId: t, direction: n }) {
|
|
2842
|
+
let r = hi(e, fi(e.store.state.columnPinning, t)), i = r.findIndex((e) => e.id === t);
|
|
2816
2843
|
if (i === -1) return null;
|
|
2817
2844
|
let a = r[i + n];
|
|
2818
|
-
return !a || !
|
|
2845
|
+
return !a || !dn(a) ? null : a;
|
|
2819
2846
|
}
|
|
2820
|
-
function
|
|
2821
|
-
let r =
|
|
2847
|
+
function _i({ table: e, columnId: t, direction: n }) {
|
|
2848
|
+
let r = gi({
|
|
2822
2849
|
table: e,
|
|
2823
2850
|
columnId: t,
|
|
2824
2851
|
direction: n
|
|
2825
2852
|
});
|
|
2826
|
-
r &&
|
|
2853
|
+
r && mi({
|
|
2827
2854
|
table: e,
|
|
2828
2855
|
columnId: t,
|
|
2829
2856
|
targetId: r.id,
|
|
@@ -2832,14 +2859,14 @@ function pi({ table: e, columnId: t, direction: n }) {
|
|
|
2832
2859
|
}
|
|
2833
2860
|
//#endregion
|
|
2834
2861
|
//#region src/tmdatagrid/components/TMDataGridHeaderCell.tsx
|
|
2835
|
-
function
|
|
2862
|
+
function vi(t) {
|
|
2836
2863
|
let n = e(267), { header: r, layout: i, renderColumnMenuItems: a } = t, o = X(), { 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;
|
|
2837
2864
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (C = { compare: ye }, n[0] = C) : C = n[0];
|
|
2838
|
-
let { sorting: w, columnFilters: T, resizingColumnId: E, columnPinning: D, grouping: k } = j(u.store,
|
|
2865
|
+
let { sorting: w, columnFilters: T, resizingColumnId: E, columnPinning: D, grouping: k } = j(u.store, Ti, C), A = j(o.ui, wi), N = r.subHeaders.length === 0, L, R, z, V, H, U, de, fe, pe, me, he, ge, _e, ve, be, xe, Se, K, Ce, we;
|
|
2839
2866
|
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) {
|
|
2840
|
-
Se =
|
|
2867
|
+
Se = nn(p);
|
|
2841
2868
|
let e;
|
|
2842
|
-
n[36] === p ? e = n[37] : (e =
|
|
2869
|
+
n[36] === p ? e = n[37] : (e = ln(p), n[36] = p, n[37] = e), L = e;
|
|
2843
2870
|
let t;
|
|
2844
2871
|
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], Ce = t, xe = Ce !== void 0;
|
|
2845
2872
|
let r;
|
|
@@ -2851,17 +2878,17 @@ function mi(t) {
|
|
|
2851
2878
|
} else s = n[47];
|
|
2852
2879
|
ve = s, be = E === p.id, K = i.pinnedAt;
|
|
2853
2880
|
let c;
|
|
2854
|
-
n[50] !== p || n[51] !== d ? (c =
|
|
2881
|
+
n[50] !== p || n[51] !== d ? (c = Nr(p, d), n[50] = p, n[51] = d, n[52] = c) : c = n[52];
|
|
2855
2882
|
let l = c;
|
|
2856
2883
|
H = N && l.canSort;
|
|
2857
2884
|
let m = N && l.canFilter, h = N && l.canHide, _ = N && l.canPin;
|
|
2858
2885
|
V = l.canResize, z = N && l.canReorder;
|
|
2859
|
-
let v = N && l.canGroup, S = N &&
|
|
2886
|
+
let v = N && l.canGroup, S = N && Pr(u, d).canHideAny, C;
|
|
2860
2887
|
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];
|
|
2861
2888
|
let O = C, j = k.length > 0;
|
|
2862
2889
|
ge = A === p.id;
|
|
2863
2890
|
let ie;
|
|
2864
|
-
n[56] !== z || n[57] !== p.id || n[58] !== D || n[59] !== A || n[60] !== ge ? (ie = z && A !== null && !ge &&
|
|
2891
|
+
n[56] !== z || n[57] !== p.id || n[58] !== D || n[59] !== A || n[60] !== ge ? (ie = z && A !== null && !ge && fi(D, A) === fi(D, p.id), n[56] = z, n[57] = p.id, n[58] = D, n[59] = A, n[60] = ge, n[61] = ie) : ie = n[61], _e = ie;
|
|
2865
2892
|
let G;
|
|
2866
2893
|
n[62] !== o.ui || n[63] !== p.id ? (G = function(e) {
|
|
2867
2894
|
e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", p.id), o.ui.actions.startColumnDrag(p.id);
|
|
@@ -2880,7 +2907,7 @@ function mi(t) {
|
|
|
2880
2907
|
}, n[67] = Te) : Te = n[67], fe = Te;
|
|
2881
2908
|
let Ee;
|
|
2882
2909
|
n[68] !== o.ui || n[69] !== p.id || n[70] !== A || n[71] !== y || n[72] !== _e || n[73] !== u ? (Ee = function(e) {
|
|
2883
|
-
e.preventDefault(), b(null), o.ui.actions.endColumnDrag(), !(!_e || !y || !A) &&
|
|
2910
|
+
e.preventDefault(), b(null), o.ui.actions.endColumnDrag(), !(!_e || !y || !A) && mi({
|
|
2884
2911
|
table: u,
|
|
2885
2912
|
columnId: A,
|
|
2886
2913
|
targetId: p.id,
|
|
@@ -2894,7 +2921,7 @@ function mi(t) {
|
|
|
2894
2921
|
let De;
|
|
2895
2922
|
n[77] !== p.id || n[78] !== u ? (De = function() {
|
|
2896
2923
|
let e = x.current?.closest("[data-dg-scroll-container]");
|
|
2897
|
-
e &&
|
|
2924
|
+
e && di({
|
|
2898
2925
|
table: u,
|
|
2899
2926
|
columnId: p.id,
|
|
2900
2927
|
container: e
|
|
@@ -2949,7 +2976,7 @@ function mi(t) {
|
|
|
2949
2976
|
stroke: 1.6
|
|
2950
2977
|
}), n[96] = e) : e = n[96];
|
|
2951
2978
|
let t;
|
|
2952
|
-
n[97] !== o || n[98] !== p.id ? (t = () =>
|
|
2979
|
+
n[97] !== o || n[98] !== p.id ? (t = () => Kr(o, p.id), n[97] = o, n[98] = p.id, n[99] = t) : t = n[99];
|
|
2953
2980
|
let r;
|
|
2954
2981
|
n[100] !== f.filterMenuItem || n[101] !== t ? (r = /* @__PURE__ */ W(g.Item, {
|
|
2955
2982
|
leftSection: e,
|
|
@@ -2984,7 +3011,7 @@ function mi(t) {
|
|
|
2984
3011
|
stroke: 1.6
|
|
2985
3012
|
}),
|
|
2986
3013
|
onClick: () => t.toggleGrouping(),
|
|
2987
|
-
children: f.ungroup(
|
|
3014
|
+
children: f.ungroup(nn(t))
|
|
2988
3015
|
}, `ungroup-${e}`));
|
|
2989
3016
|
}
|
|
2990
3017
|
let e;
|
|
@@ -3073,13 +3100,13 @@ function mi(t) {
|
|
|
3073
3100
|
}
|
|
3074
3101
|
if (z) {
|
|
3075
3102
|
let e;
|
|
3076
|
-
n[151] !== p.id || n[152] !== u ? (e =
|
|
3103
|
+
n[151] !== p.id || n[152] !== u ? (e = gi({
|
|
3077
3104
|
table: u,
|
|
3078
3105
|
columnId: p.id,
|
|
3079
3106
|
direction: -1
|
|
3080
3107
|
}), n[151] = p.id, n[152] = u, n[153] = e) : e = n[153];
|
|
3081
3108
|
let t = e, r;
|
|
3082
|
-
n[154] !== p.id || n[155] !== u ? (r =
|
|
3109
|
+
n[154] !== p.id || n[155] !== u ? (r = gi({
|
|
3083
3110
|
table: u,
|
|
3084
3111
|
columnId: p.id,
|
|
3085
3112
|
direction: 1
|
|
@@ -3092,7 +3119,7 @@ function mi(t) {
|
|
|
3092
3119
|
stroke: 1.6
|
|
3093
3120
|
}), n[157] = r) : r = n[157];
|
|
3094
3121
|
let a;
|
|
3095
|
-
n[158] !== p.id || n[159] !== u ? (a = () =>
|
|
3122
|
+
n[158] !== p.id || n[159] !== u ? (a = () => _i({
|
|
3096
3123
|
table: u,
|
|
3097
3124
|
columnId: p.id,
|
|
3098
3125
|
direction: -1
|
|
@@ -3110,7 +3137,7 @@ function mi(t) {
|
|
|
3110
3137
|
stroke: 1.6
|
|
3111
3138
|
}), n[165] = c) : c = n[165];
|
|
3112
3139
|
let l;
|
|
3113
|
-
n[166] !== p.id || n[167] !== u ? (l = () =>
|
|
3140
|
+
n[166] !== p.id || n[167] !== u ? (l = () => _i({
|
|
3114
3141
|
table: u,
|
|
3115
3142
|
columnId: p.id,
|
|
3116
3143
|
direction: 1
|
|
@@ -3171,17 +3198,17 @@ function mi(t) {
|
|
|
3171
3198
|
children: f.manageColumns
|
|
3172
3199
|
}, "manage"), n[188] = f.manageColumns, n[189] = t, n[190] = r) : r = n[190], J.push(r);
|
|
3173
3200
|
}
|
|
3174
|
-
for (; J.length > 0 &&
|
|
3201
|
+
for (; J.length > 0 && Ei(J.at(-1));) J.pop();
|
|
3175
3202
|
for (U = a ? [...a({
|
|
3176
3203
|
column: p,
|
|
3177
3204
|
table: u,
|
|
3178
3205
|
internalItems: J
|
|
3179
|
-
})] : J; U.length > 0 &&
|
|
3206
|
+
})] : J; U.length > 0 && Ei(U.at(-1));) U.pop();
|
|
3180
3207
|
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] = L, n[17] = R, n[18] = z, n[19] = V, n[20] = H, n[21] = U, n[22] = de, n[23] = fe, n[24] = pe, n[25] = me, n[26] = he, n[27] = ge, n[28] = _e, n[29] = ve, n[30] = be, n[31] = xe, n[32] = Se, n[33] = K, n[34] = Ce, n[35] = we;
|
|
3181
3208
|
} else L = n[16], R = n[17], z = n[18], V = n[19], H = n[20], U = n[21], de = n[22], fe = n[23], pe = n[24], me = n[25], he = n[26], ge = n[27], _e = n[28], ve = n[29], be = n[30], xe = n[31], Se = n[32], K = n[33], Ce = n[34], we = n[35];
|
|
3182
3209
|
let Te;
|
|
3183
|
-
n[191] !== p.id || n[192] !== U || n[193] !== N ? (Te = N && U.length > 0 && !
|
|
3184
|
-
let Ee = Te, q = H ? $.headerCellSortable : "", De = ve ? $.headerCellFiltered : "", Oe = ge ? $.headerCellDragging : "", ke = y === "before" ? $.headerCellDropBefore : "", J = y === "after" ? $.headerCellDropAfter : "", Ae = i.isBoundary && K === "left" ?
|
|
3210
|
+
n[191] !== p.id || n[192] !== U || n[193] !== N ? (Te = N && U.length > 0 && !un(p.id), n[191] = p.id, n[192] = U, n[193] = N, n[194] = Te) : Te = n[194];
|
|
3211
|
+
let Ee = Te, q = H ? $.headerCellSortable : "", De = ve ? $.headerCellFiltered : "", Oe = ge ? $.headerCellDragging : "", ke = y === "before" ? $.headerCellDropBefore : "", J = y === "after" ? $.headerCellDropAfter : "", Ae = i.isBoundary && K === "left" ? oi.stickyLeft : "", je = i.isBoundary && K === "right" ? oi.stickyRight : "", Me;
|
|
3185
3212
|
n[195] !== q || n[196] !== De || n[197] !== Oe || n[198] !== ke || n[199] !== J || n[200] !== Ae || n[201] !== je ? (Me = [
|
|
3186
3213
|
$.headerCell,
|
|
3187
3214
|
q,
|
|
@@ -3193,7 +3220,7 @@ function mi(t) {
|
|
|
3193
3220
|
je
|
|
3194
3221
|
].filter(Boolean), n[195] = q, n[196] = De, n[197] = Oe, n[198] = ke, n[199] = J, n[200] = Ae, n[201] = je, n[202] = Me) : Me = n[202];
|
|
3195
3222
|
let Ne = Me.join(" "), Pe = p.id, Fe = xe || ve, Le;
|
|
3196
|
-
n[203] === p.id ? Le = n[204] : (Le =
|
|
3223
|
+
n[203] === p.id ? Le = n[204] : (Le = un(p.id), n[203] = p.id, n[204] = Le);
|
|
3197
3224
|
let Re = H ? xe ? Ce ? "descending" : "ascending" : "none" : void 0, ze = z && !be, Be = z ? me : void 0, Ve = z ? de : void 0, He = _e ? pe : void 0, Ue = _e ? fe : void 0, We = _e ? he : void 0, Ge = K === "left" ? i.offset : void 0, Ke = K === "right" ? i.offset : void 0, qe = K ? "sticky" : void 0, Je = K ? "var(--dg-z-header-pinned-cell, 7)" : void 0, Ye;
|
|
3198
3225
|
n[205] !== Ge || n[206] !== Ke || n[207] !== qe || n[208] !== Je ? (Ye = {
|
|
3199
3226
|
left: Ge,
|
|
@@ -3201,7 +3228,7 @@ function mi(t) {
|
|
|
3201
3228
|
position: qe,
|
|
3202
3229
|
zIndex: Je
|
|
3203
3230
|
}, n[205] = Ge, n[206] = Ke, n[207] = qe, n[208] = Je, n[209] = Ye) : Ye = n[209];
|
|
3204
|
-
let Xe = H ?
|
|
3231
|
+
let Xe = H ? Ci : void 0, Ze;
|
|
3205
3232
|
n[210] !== H || n[211] !== p ? (Ze = H ? (e) => {
|
|
3206
3233
|
if (S.current) {
|
|
3207
3234
|
S.current = !1;
|
|
@@ -3235,7 +3262,7 @@ function mi(t) {
|
|
|
3235
3262
|
"data-dg-part": "header-filter",
|
|
3236
3263
|
"data-column-id": p.id,
|
|
3237
3264
|
onClick: (e) => {
|
|
3238
|
-
e.stopPropagation(),
|
|
3265
|
+
e.stopPropagation(), Kr(o, p.id);
|
|
3239
3266
|
},
|
|
3240
3267
|
children: /* @__PURE__ */ W(ae, {
|
|
3241
3268
|
size: 14,
|
|
@@ -3280,21 +3307,21 @@ function mi(t) {
|
|
|
3280
3307
|
"data-dg-part": "header-menu",
|
|
3281
3308
|
"data-column-id": p.id,
|
|
3282
3309
|
onClick: (e) => {
|
|
3283
|
-
e.stopPropagation(), h(
|
|
3310
|
+
e.stopPropagation(), h(Si);
|
|
3284
3311
|
},
|
|
3285
3312
|
children: /* @__PURE__ */ W(ie, {
|
|
3286
3313
|
size: 14,
|
|
3287
3314
|
stroke: 1.6
|
|
3288
3315
|
})
|
|
3289
3316
|
}) }), /* @__PURE__ */ W(g.Dropdown, {
|
|
3290
|
-
onClick:
|
|
3317
|
+
onClick: xi,
|
|
3291
3318
|
children: U
|
|
3292
3319
|
})]
|
|
3293
3320
|
})
|
|
3294
3321
|
]
|
|
3295
3322
|
}), n[218] = o, n[219] = H, n[220] = p, n[221] = _, n[222] = U, n[223] = Ee, n[224] = ve, n[225] = N, n[226] = xe, n[227] = Se, n[228] = f, n[229] = m, n[230] = Ce, n[231] = we, n[232] = Y) : Y = n[232];
|
|
3296
3323
|
let Z;
|
|
3297
|
-
n[233] !== R || n[234] !== V || n[235] !== p.id || n[236] !== r || n[237] !== be ? (Z = !
|
|
3324
|
+
n[233] !== R || n[234] !== V || n[235] !== p.id || n[236] !== r || n[237] !== be ? (Z = !un(p.id) && /* @__PURE__ */ W("div", {
|
|
3298
3325
|
className: [
|
|
3299
3326
|
$.columnSeparator,
|
|
3300
3327
|
V ? $.columnSeparatorResizable : "",
|
|
@@ -3305,7 +3332,7 @@ function mi(t) {
|
|
|
3305
3332
|
S.current = !0, r.getResizeHandler()(e);
|
|
3306
3333
|
} : void 0,
|
|
3307
3334
|
onTouchStart: V ? r.getResizeHandler() : void 0,
|
|
3308
|
-
onClick:
|
|
3335
|
+
onClick: bi,
|
|
3309
3336
|
onDoubleClick: V ? (e) => {
|
|
3310
3337
|
e.stopPropagation(), R();
|
|
3311
3338
|
} : void 0
|
|
@@ -3346,7 +3373,7 @@ function mi(t) {
|
|
|
3346
3373
|
n[259] === et ? nt = n[260] : (nt = /* @__PURE__ */ W(g.ContextMenu, { children: et }), n[259] = et, n[260] = nt);
|
|
3347
3374
|
let rt;
|
|
3348
3375
|
n[261] === U ? rt = n[262] : (rt = /* @__PURE__ */ W(g.Dropdown, {
|
|
3349
|
-
onClick:
|
|
3376
|
+
onClick: yi,
|
|
3350
3377
|
children: U
|
|
3351
3378
|
}), n[261] = U, n[262] = rt);
|
|
3352
3379
|
let it;
|
|
@@ -3360,25 +3387,25 @@ function mi(t) {
|
|
|
3360
3387
|
children: [nt, rt]
|
|
3361
3388
|
}), n[263] = _, n[264] = nt, n[265] = rt, n[266] = it) : it = n[266], it;
|
|
3362
3389
|
}
|
|
3363
|
-
function
|
|
3390
|
+
function yi(e) {
|
|
3364
3391
|
return e.stopPropagation();
|
|
3365
3392
|
}
|
|
3366
|
-
function
|
|
3393
|
+
function bi(e) {
|
|
3367
3394
|
return e.stopPropagation();
|
|
3368
3395
|
}
|
|
3369
|
-
function
|
|
3396
|
+
function xi(e) {
|
|
3370
3397
|
return e.stopPropagation();
|
|
3371
3398
|
}
|
|
3372
|
-
function
|
|
3399
|
+
function Si(e) {
|
|
3373
3400
|
return !e;
|
|
3374
3401
|
}
|
|
3375
|
-
function
|
|
3402
|
+
function Ci(e) {
|
|
3376
3403
|
e.shiftKey && e.preventDefault();
|
|
3377
3404
|
}
|
|
3378
|
-
function
|
|
3405
|
+
function wi(e) {
|
|
3379
3406
|
return e.draggedColumnId;
|
|
3380
3407
|
}
|
|
3381
|
-
function
|
|
3408
|
+
function Ti(e) {
|
|
3382
3409
|
return {
|
|
3383
3410
|
sorting: e.sorting,
|
|
3384
3411
|
columnFilters: e.columnFilters,
|
|
@@ -3388,251 +3415,266 @@ function xi(e) {
|
|
|
3388
3415
|
grouping: e.grouping
|
|
3389
3416
|
};
|
|
3390
3417
|
}
|
|
3391
|
-
function
|
|
3418
|
+
function Ei(e) {
|
|
3392
3419
|
return typeof e == "object" && !!e && "type" in e && e.type === g.Divider;
|
|
3393
3420
|
}
|
|
3394
3421
|
//#endregion
|
|
3395
3422
|
//#region src/tmdatagrid/components/editors/TMDataGridBooleanEditor.tsx
|
|
3396
|
-
function
|
|
3397
|
-
let n = e(
|
|
3398
|
-
n[0] !==
|
|
3399
|
-
let
|
|
3400
|
-
n[3] === r ?
|
|
3401
|
-
let
|
|
3402
|
-
return n[5] !==
|
|
3403
|
-
size:
|
|
3404
|
-
|
|
3405
|
-
"aria-label": u,
|
|
3423
|
+
function Di(t) {
|
|
3424
|
+
let n = e(12), { field: r, column: i, size: a } = t, { labels: o } = X(), s = Pt(r), c = It(r), l;
|
|
3425
|
+
n[0] !== i || n[1] !== o ? (l = o.editCell(nn(i)), n[0] = i, n[1] = o, n[2] = l) : l = n[2];
|
|
3426
|
+
let u = s === !0, d;
|
|
3427
|
+
n[3] === r ? d = n[4] : (d = (e) => r.handleChange(e.currentTarget.checked), n[3] = r, n[4] = d);
|
|
3428
|
+
let p;
|
|
3429
|
+
return n[5] !== c || n[6] !== r.handleBlur || n[7] !== a || n[8] !== l || n[9] !== u || n[10] !== d ? (p = /* @__PURE__ */ W(f, {
|
|
3430
|
+
size: a,
|
|
3431
|
+
"aria-label": l,
|
|
3406
3432
|
"data-dg-part": "editor-input",
|
|
3407
|
-
checked:
|
|
3408
|
-
onChange:
|
|
3433
|
+
checked: u,
|
|
3434
|
+
onChange: d,
|
|
3409
3435
|
onBlur: r.handleBlur,
|
|
3410
|
-
error:
|
|
3411
|
-
}), n[5] =
|
|
3436
|
+
error: c
|
|
3437
|
+
}), n[5] = c, n[6] = r.handleBlur, n[7] = a, n[8] = l, n[9] = u, n[10] = d, n[11] = p) : p = n[11], p;
|
|
3412
3438
|
}
|
|
3413
3439
|
//#endregion
|
|
3414
3440
|
//#region src/tmdatagrid/components/editors/TMDataGridDateEditor.tsx
|
|
3415
|
-
function
|
|
3416
|
-
let n = e(
|
|
3417
|
-
n[0] ===
|
|
3418
|
-
let
|
|
3419
|
-
n[2] !==
|
|
3420
|
-
let
|
|
3421
|
-
n[5] === r ?
|
|
3441
|
+
function Oi(t) {
|
|
3442
|
+
let n = e(14), { field: r, column: i, size: a } = t, { labels: o } = X(), c = Pt(r), l = It(r), u = s(c instanceof Date), d;
|
|
3443
|
+
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);
|
|
3444
|
+
let f = d, p;
|
|
3445
|
+
n[2] !== i || n[3] !== o ? (p = o.editCell(nn(i)), n[2] = i, n[3] = o, n[4] = p) : p = n[4];
|
|
3446
|
+
let m;
|
|
3447
|
+
n[5] === r ? m = n[6] : (m = (e) => {
|
|
3422
3448
|
let t = e.currentTarget.value;
|
|
3423
3449
|
if (t === "") {
|
|
3424
3450
|
r.handleChange(null);
|
|
3425
3451
|
return;
|
|
3426
3452
|
}
|
|
3427
|
-
r.handleChange(
|
|
3428
|
-
}, n[5] = r, n[6] =
|
|
3429
|
-
let
|
|
3430
|
-
return n[7] !==
|
|
3431
|
-
size:
|
|
3453
|
+
r.handleChange(u.current ? /* @__PURE__ */ new Date(`${t}T00:00:00`) : t);
|
|
3454
|
+
}, n[5] = r, n[6] = m);
|
|
3455
|
+
let h;
|
|
3456
|
+
return n[7] !== l || n[8] !== r.handleBlur || n[9] !== a || n[10] !== p || n[11] !== m || n[12] !== f ? (h = /* @__PURE__ */ W(D, {
|
|
3457
|
+
size: a,
|
|
3432
3458
|
w: "100%",
|
|
3433
|
-
autoFocus: i,
|
|
3434
3459
|
type: "date",
|
|
3435
|
-
"aria-label":
|
|
3460
|
+
"aria-label": p,
|
|
3436
3461
|
"data-dg-part": "editor-input",
|
|
3437
|
-
value:
|
|
3438
|
-
onChange:
|
|
3462
|
+
value: f,
|
|
3463
|
+
onChange: m,
|
|
3439
3464
|
onBlur: r.handleBlur,
|
|
3440
|
-
error:
|
|
3441
|
-
}), n[7] =
|
|
3465
|
+
error: l
|
|
3466
|
+
}), n[7] = l, n[8] = r.handleBlur, n[9] = a, n[10] = p, n[11] = m, n[12] = f, n[13] = h) : h = n[13], h;
|
|
3442
3467
|
}
|
|
3443
3468
|
//#endregion
|
|
3444
3469
|
//#region src/tmdatagrid/components/editors/TMDataGridMultiSelectEditor.tsx
|
|
3445
|
-
function
|
|
3446
|
-
let n = e(
|
|
3447
|
-
n[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
3470
|
+
function ki(t) {
|
|
3471
|
+
let n = e(20), { field: r, column: i, row: a, table: o, size: s } = t, { labels: c } = X(), l = Pt(r), u = It(r), d;
|
|
3472
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (d = { withinPortal: !1 }, n[0] = d) : d = n[0];
|
|
3473
|
+
let f;
|
|
3474
|
+
n[1] !== i || n[2] !== c ? (f = c.editCell(nn(i)), n[1] = i, n[2] = c, n[3] = f) : f = n[3];
|
|
3448
3475
|
let p;
|
|
3449
|
-
n[
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
column: a,
|
|
3454
|
-
row: o,
|
|
3476
|
+
n[4] !== i || n[5] !== a || n[6] !== o ? (p = In(Fn({
|
|
3477
|
+
table: o,
|
|
3478
|
+
column: i,
|
|
3479
|
+
row: a,
|
|
3455
3480
|
fallback: "faceted"
|
|
3456
|
-
})), n[4] =
|
|
3481
|
+
})), n[4] = i, n[5] = a, n[6] = o, n[7] = p) : p = n[7];
|
|
3482
|
+
let m;
|
|
3483
|
+
n[8] === l ? m = n[9] : (m = Array.isArray(l) ? l.map(String) : [], n[8] = l, n[9] = m);
|
|
3457
3484
|
let h;
|
|
3458
|
-
n[
|
|
3485
|
+
n[10] === r ? h = n[11] : (h = (e) => r.handleChange(e), n[10] = r, n[11] = h);
|
|
3459
3486
|
let g;
|
|
3460
|
-
n[
|
|
3461
|
-
|
|
3462
|
-
return n[12] !== i || n[13] !== d || n[14] !== r.handleBlur || n[15] !== c || n[16] !== p || n[17] !== m || n[18] !== h || n[19] !== g ? (v = /* @__PURE__ */ W(_, {
|
|
3463
|
-
size: c,
|
|
3487
|
+
return n[12] !== u || n[13] !== r.handleBlur || n[14] !== s || n[15] !== f || n[16] !== p || n[17] !== m || n[18] !== h ? (g = /* @__PURE__ */ W(_, {
|
|
3488
|
+
size: s,
|
|
3464
3489
|
w: "100%",
|
|
3465
|
-
autoFocus: i,
|
|
3466
3490
|
searchable: !0,
|
|
3467
|
-
comboboxProps:
|
|
3468
|
-
"aria-label":
|
|
3491
|
+
comboboxProps: d,
|
|
3492
|
+
"aria-label": f,
|
|
3469
3493
|
"data-dg-part": "editor-input",
|
|
3470
|
-
data:
|
|
3471
|
-
value:
|
|
3472
|
-
onChange:
|
|
3494
|
+
data: p,
|
|
3495
|
+
value: m,
|
|
3496
|
+
onChange: h,
|
|
3473
3497
|
onBlur: r.handleBlur,
|
|
3474
|
-
error:
|
|
3475
|
-
}), n[12] =
|
|
3498
|
+
error: u
|
|
3499
|
+
}), n[12] = u, n[13] = r.handleBlur, n[14] = s, n[15] = f, n[16] = p, n[17] = m, n[18] = h, n[19] = g) : g = n[19], g;
|
|
3476
3500
|
}
|
|
3477
3501
|
//#endregion
|
|
3478
3502
|
//#region src/tmdatagrid/components/editors/TMDataGridNumberEditor.tsx
|
|
3479
|
-
function
|
|
3480
|
-
let n = e(
|
|
3481
|
-
n[0] !==
|
|
3482
|
-
let
|
|
3483
|
-
n[3]
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3503
|
+
function Ai(t) {
|
|
3504
|
+
let n = e(15), { field: r, column: i, size: a } = t, { labels: o } = X(), s = Pt(r), c = It(r), { inputRef: l, remember: u } = zt(), d;
|
|
3505
|
+
n[0] !== i || n[1] !== o ? (d = o.editCell(nn(i)), n[0] = i, n[1] = o, n[2] = d) : d = n[2];
|
|
3506
|
+
let f = typeof s == "number" ? s : "", p;
|
|
3507
|
+
n[3] !== r || n[4] !== l || n[5] !== u ? (p = (e) => {
|
|
3508
|
+
l.current !== null && u(l.current), r.handleChange(typeof e == "number" ? e : e === "" ? null : Number(e));
|
|
3509
|
+
}, n[3] = r, n[4] = l, n[5] = u, n[6] = p) : p = n[6];
|
|
3510
|
+
let m;
|
|
3511
|
+
return n[7] !== c || n[8] !== r.handleBlur || n[9] !== l || n[10] !== a || n[11] !== d || n[12] !== f || n[13] !== p ? (m = /* @__PURE__ */ W(v, {
|
|
3512
|
+
ref: l,
|
|
3513
|
+
size: a,
|
|
3487
3514
|
w: "100%",
|
|
3488
|
-
autoFocus: i,
|
|
3489
3515
|
onFocus: Rt,
|
|
3490
3516
|
hideControls: !0,
|
|
3491
|
-
"aria-label":
|
|
3517
|
+
"aria-label": d,
|
|
3492
3518
|
"data-dg-part": "editor-input",
|
|
3493
|
-
value:
|
|
3494
|
-
onChange:
|
|
3519
|
+
value: f,
|
|
3520
|
+
onChange: p,
|
|
3495
3521
|
onBlur: r.handleBlur,
|
|
3496
|
-
error:
|
|
3497
|
-
}), n[
|
|
3522
|
+
error: c
|
|
3523
|
+
}), n[7] = c, n[8] = r.handleBlur, n[9] = l, n[10] = a, n[11] = d, n[12] = f, n[13] = p, n[14] = m) : m = n[14], m;
|
|
3498
3524
|
}
|
|
3499
3525
|
//#endregion
|
|
3500
3526
|
//#region src/tmdatagrid/components/editors/TMDataGridSelectEditor.tsx
|
|
3501
|
-
function
|
|
3502
|
-
let n = e(
|
|
3503
|
-
n[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
3527
|
+
function ji(t) {
|
|
3528
|
+
let n = e(20), { field: r, column: i, row: a, table: o, size: s, commit: c } = t, { labels: l, features: u } = X(), d = Pt(r), f = It(r), p;
|
|
3529
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (p = { withinPortal: !1 }, n[0] = p) : p = n[0];
|
|
3530
|
+
let m;
|
|
3531
|
+
n[1] !== i || n[2] !== l ? (m = l.editCell(nn(i)), n[1] = i, n[2] = l, n[3] = m) : m = n[3];
|
|
3504
3532
|
let h;
|
|
3505
|
-
n[
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
column: a,
|
|
3510
|
-
row: o,
|
|
3533
|
+
n[4] !== i || n[5] !== a || n[6] !== o ? (h = In(Fn({
|
|
3534
|
+
table: o,
|
|
3535
|
+
column: i,
|
|
3536
|
+
row: a,
|
|
3511
3537
|
fallback: "faceted"
|
|
3512
|
-
})), n[4] =
|
|
3513
|
-
let
|
|
3514
|
-
n[8] !==
|
|
3515
|
-
r.handleChange(e), e !== null &&
|
|
3516
|
-
}, n[8] =
|
|
3517
|
-
let
|
|
3518
|
-
return n[12] !==
|
|
3519
|
-
size:
|
|
3538
|
+
})), n[4] = i, n[5] = a, n[6] = o, n[7] = h) : h = n[7];
|
|
3539
|
+
let g = typeof d == "string" ? d : null, _;
|
|
3540
|
+
n[8] !== c || n[9] !== u || n[10] !== r ? (_ = (e) => {
|
|
3541
|
+
r.handleChange(e), e !== null && u.editMode === "cell" && c();
|
|
3542
|
+
}, n[8] = c, n[9] = u, n[10] = r, n[11] = _) : _ = n[11];
|
|
3543
|
+
let v;
|
|
3544
|
+
return n[12] !== f || n[13] !== r.handleBlur || n[14] !== s || n[15] !== m || n[16] !== h || n[17] !== g || n[18] !== _ ? (v = /* @__PURE__ */ W(w, {
|
|
3545
|
+
size: s,
|
|
3520
3546
|
w: "100%",
|
|
3521
|
-
autoFocus: i,
|
|
3522
3547
|
searchable: !0,
|
|
3523
|
-
comboboxProps:
|
|
3524
|
-
"aria-label":
|
|
3548
|
+
comboboxProps: p,
|
|
3549
|
+
"aria-label": m,
|
|
3525
3550
|
"data-dg-part": "editor-input",
|
|
3526
|
-
data:
|
|
3527
|
-
value:
|
|
3528
|
-
onChange:
|
|
3551
|
+
data: h,
|
|
3552
|
+
value: g,
|
|
3553
|
+
onChange: _,
|
|
3529
3554
|
onBlur: r.handleBlur,
|
|
3530
|
-
error:
|
|
3531
|
-
}), n[12] =
|
|
3555
|
+
error: f
|
|
3556
|
+
}), n[12] = f, n[13] = r.handleBlur, n[14] = s, n[15] = m, n[16] = h, n[17] = g, n[18] = _, n[19] = v) : v = n[19], v;
|
|
3532
3557
|
}
|
|
3533
3558
|
//#endregion
|
|
3534
3559
|
//#region src/tmdatagrid/components/editors/TMDataGridStringEditor.tsx
|
|
3535
|
-
function
|
|
3536
|
-
let n = e(
|
|
3537
|
-
n[0] !==
|
|
3538
|
-
let
|
|
3539
|
-
n[3]
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3560
|
+
function Mi(t) {
|
|
3561
|
+
let n = e(14), { field: r, column: i, size: a } = t, { labels: o } = X(), s = Pt(r), c = It(r), { inputRef: l, remember: u } = zt(), d;
|
|
3562
|
+
n[0] !== i || n[1] !== o ? (d = o.editCell(nn(i)), n[0] = i, n[1] = o, n[2] = d) : d = n[2];
|
|
3563
|
+
let f = typeof s == "string" ? s : "", p;
|
|
3564
|
+
n[3] !== r || n[4] !== u ? (p = (e) => {
|
|
3565
|
+
u(e.currentTarget), r.handleChange(e.currentTarget.value);
|
|
3566
|
+
}, n[3] = r, n[4] = u, n[5] = p) : p = n[5];
|
|
3567
|
+
let m;
|
|
3568
|
+
return n[6] !== c || n[7] !== r.handleBlur || n[8] !== l || n[9] !== a || n[10] !== d || n[11] !== f || n[12] !== p ? (m = /* @__PURE__ */ W(D, {
|
|
3569
|
+
ref: l,
|
|
3570
|
+
size: a,
|
|
3543
3571
|
w: "100%",
|
|
3544
|
-
autoFocus: i,
|
|
3545
3572
|
onFocus: Rt,
|
|
3546
|
-
"aria-label":
|
|
3573
|
+
"aria-label": d,
|
|
3547
3574
|
"data-dg-part": "editor-input",
|
|
3548
|
-
value:
|
|
3549
|
-
onChange:
|
|
3575
|
+
value: f,
|
|
3576
|
+
onChange: p,
|
|
3550
3577
|
onBlur: r.handleBlur,
|
|
3551
|
-
error:
|
|
3552
|
-
}), n[
|
|
3578
|
+
error: c
|
|
3579
|
+
}), n[6] = c, n[7] = r.handleBlur, n[8] = l, n[9] = a, n[10] = d, n[11] = f, n[12] = p, n[13] = m) : m = n[13], m;
|
|
3553
3580
|
}
|
|
3554
3581
|
//#endregion
|
|
3555
3582
|
//#region src/tmdatagrid/components/TMDataGridCellEditor.tsx
|
|
3556
|
-
var
|
|
3557
|
-
string:
|
|
3558
|
-
number:
|
|
3559
|
-
boolean:
|
|
3560
|
-
date:
|
|
3561
|
-
select:
|
|
3562
|
-
multiSelect:
|
|
3583
|
+
var Ni = {
|
|
3584
|
+
string: Mi,
|
|
3585
|
+
number: Ai,
|
|
3586
|
+
boolean: Di,
|
|
3587
|
+
date: Oi,
|
|
3588
|
+
select: ji,
|
|
3589
|
+
multiSelect: ki
|
|
3563
3590
|
};
|
|
3564
|
-
function
|
|
3565
|
-
let { table:
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3591
|
+
function Pi({ cell: e, row: t, takeSeedText: n, onClose: r }) {
|
|
3592
|
+
let { table: a, edit: o, features: u, labels: d, controlSize: f } = X(), p = u.editMode === "row", m = e.column, h = o.getForm(t.id), g = Jn(m), [_] = c(() => n()), v = s(void 0);
|
|
3593
|
+
i(() => {
|
|
3594
|
+
v.current = m.columnDef.meta?.edit?.mapValue;
|
|
3595
|
+
});
|
|
3596
|
+
let [y] = c(() => {
|
|
3597
|
+
let e = new me({
|
|
3598
|
+
form: h,
|
|
3599
|
+
name: g,
|
|
3600
|
+
validators: er(m.columnDef.meta?.edit?.validate)
|
|
3601
|
+
}), n = e.handleChange.bind(e);
|
|
3602
|
+
return e.handleChange = ((r) => {
|
|
3603
|
+
let i = v.current, o = e.state.value, s = typeof r == "function" ? r(o) : r;
|
|
3604
|
+
n(i === void 0 ? s : i({
|
|
3605
|
+
value: s,
|
|
3606
|
+
previous: o,
|
|
3607
|
+
row: t,
|
|
3608
|
+
column: m,
|
|
3609
|
+
table: a
|
|
3610
|
+
}));
|
|
3611
|
+
}), e;
|
|
3612
|
+
});
|
|
3570
3613
|
i(() => y.mount(), [y]), i(() => {
|
|
3571
|
-
if (
|
|
3572
|
-
let e =
|
|
3573
|
-
if (e === "string") y.handleChange(
|
|
3614
|
+
if (_ === void 0) return;
|
|
3615
|
+
let e = m.columnDef.meta?.type ?? "string";
|
|
3616
|
+
if (e === "string") y.handleChange(_);
|
|
3574
3617
|
else if (e === "number") {
|
|
3575
|
-
let e = Number(
|
|
3618
|
+
let e = Number(_);
|
|
3576
3619
|
Number.isFinite(e) && y.handleChange(e);
|
|
3577
3620
|
}
|
|
3578
3621
|
}, []);
|
|
3579
3622
|
let b = s(!1), x = async (e) => {
|
|
3580
3623
|
if (b.current) return !1;
|
|
3581
|
-
let n = await
|
|
3582
|
-
return n && !b.current && (b.current = !0,
|
|
3624
|
+
let n = await o.commit(t.id);
|
|
3625
|
+
return n && !b.current && (b.current = !0, r({
|
|
3583
3626
|
committed: !0,
|
|
3584
3627
|
via: e
|
|
3585
3628
|
})), n;
|
|
3586
3629
|
}, S = () => {
|
|
3587
|
-
b.current || (b.current = !0,
|
|
3630
|
+
b.current || (b.current = !0, o.cancel(t.id), r({
|
|
3588
3631
|
committed: !1,
|
|
3589
3632
|
via: "escape"
|
|
3590
3633
|
}));
|
|
3591
3634
|
}, C = (e) => {
|
|
3592
|
-
b.current || (b.current = !0,
|
|
3635
|
+
b.current || (b.current = !0, o.deactivate(), r({
|
|
3593
3636
|
committed: !1,
|
|
3594
3637
|
via: e
|
|
3595
3638
|
}));
|
|
3596
3639
|
}, w = (e) => {
|
|
3597
|
-
let t =
|
|
3598
|
-
e.key === "Enter" ? (e.preventDefault(), e.stopPropagation(), t ? C("defer") : x("enter")) : e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), S()) : e.key === "Tab" && !
|
|
3640
|
+
let t = u.editMode === "batch";
|
|
3641
|
+
e.key === "Enter" ? (e.preventDefault(), e.stopPropagation(), t ? C("defer") : x("enter")) : e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), S()) : e.key === "Tab" && !p && (e.preventDefault(), e.stopPropagation(), t ? C(e.shiftKey ? "defer-shift-tab" : "defer-tab") : x(e.shiftKey ? "shift-tab" : "tab"));
|
|
3599
3642
|
}, T = (e) => {
|
|
3600
|
-
if (b.current ||
|
|
3643
|
+
if (b.current || p) return;
|
|
3601
3644
|
let n = e.relatedTarget;
|
|
3602
|
-
n instanceof Node && e.currentTarget.contains(n) || (b.current = !0,
|
|
3603
|
-
e ||
|
|
3604
|
-
}) :
|
|
3645
|
+
n instanceof Node && e.currentTarget.contains(n) || (b.current = !0, u.editMode === "cell" ? o.commit(t.id).then((e) => {
|
|
3646
|
+
e || o.deactivate();
|
|
3647
|
+
}) : o.deactivate());
|
|
3605
3648
|
};
|
|
3606
|
-
if (
|
|
3649
|
+
if (h === void 0 || g === null) return null;
|
|
3607
3650
|
let E = {
|
|
3608
3651
|
field: y,
|
|
3609
|
-
form:
|
|
3652
|
+
form: h,
|
|
3610
3653
|
cell: e,
|
|
3611
3654
|
row: t,
|
|
3612
|
-
column:
|
|
3613
|
-
table:
|
|
3655
|
+
column: m,
|
|
3656
|
+
table: a,
|
|
3614
3657
|
commit: () => x("pick"),
|
|
3615
3658
|
cancel: S,
|
|
3616
|
-
size:
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
}, D = h.columnDef.meta?.editor ?? ki[h.columnDef.meta?.type ?? "string"] ?? Oi;
|
|
3659
|
+
size: f,
|
|
3660
|
+
seedText: _
|
|
3661
|
+
}, D = m.columnDef.meta?.edit?.editor ?? Ni[m.columnDef.meta?.type ?? "string"] ?? Mi;
|
|
3620
3662
|
return /* @__PURE__ */ G("div", {
|
|
3621
3663
|
className: Q.cellEditor,
|
|
3622
3664
|
"data-dg-part": "editor",
|
|
3623
3665
|
"data-row-id": t.id,
|
|
3624
|
-
"data-column-id":
|
|
3666
|
+
"data-column-id": m.id,
|
|
3625
3667
|
onKeyDown: w,
|
|
3626
3668
|
onBlur: T,
|
|
3627
3669
|
onMouseDown: (e) => e.stopPropagation(),
|
|
3628
3670
|
onDoubleClick: (e) => e.stopPropagation(),
|
|
3629
|
-
children: [/* @__PURE__ */ W(D, { ...E }),
|
|
3671
|
+
children: [/* @__PURE__ */ W(D, { ...E }), u.editMode === "cellConfirm" && /* @__PURE__ */ G("div", {
|
|
3630
3672
|
className: Q.cellEditorActions,
|
|
3631
3673
|
children: [/* @__PURE__ */ W(l, {
|
|
3632
3674
|
size: "sm",
|
|
3633
3675
|
variant: "subtle",
|
|
3634
3676
|
color: "green",
|
|
3635
|
-
"aria-label":
|
|
3677
|
+
"aria-label": d.confirmEdit,
|
|
3636
3678
|
"data-dg-part": "editor-confirm",
|
|
3637
3679
|
onMouseDown: (e) => e.preventDefault(),
|
|
3638
3680
|
onClick: () => void x("pick"),
|
|
@@ -3644,7 +3686,7 @@ function Ai({ cell: e, row: t, takeSeedText: n, autoFocus: r = !0, onClose: a })
|
|
|
3644
3686
|
size: "sm",
|
|
3645
3687
|
variant: "subtle",
|
|
3646
3688
|
color: "gray",
|
|
3647
|
-
"aria-label":
|
|
3689
|
+
"aria-label": d.cancelEdit,
|
|
3648
3690
|
"data-dg-part": "editor-cancel",
|
|
3649
3691
|
onMouseDown: (e) => e.preventDefault(),
|
|
3650
3692
|
onClick: S,
|
|
@@ -3657,94 +3699,118 @@ function Ai({ cell: e, row: t, takeSeedText: n, autoFocus: r = !0, onClose: a })
|
|
|
3657
3699
|
});
|
|
3658
3700
|
}
|
|
3659
3701
|
//#endregion
|
|
3660
|
-
//#region src/tmdatagrid/
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3702
|
+
//#region src/tmdatagrid/core/editorFocus.ts
|
|
3703
|
+
var Fi = [
|
|
3704
|
+
"button:not([disabled])",
|
|
3705
|
+
"input:not([disabled])",
|
|
3706
|
+
"select:not([disabled])",
|
|
3707
|
+
"textarea:not([disabled])",
|
|
3708
|
+
"a[href]",
|
|
3709
|
+
"[tabindex]:not([tabindex=\"-1\"])"
|
|
3710
|
+
].join(",");
|
|
3711
|
+
function Ii(e) {
|
|
3712
|
+
(e.querySelector("[data-dg-part=\"editor-input\"]") ?? e.querySelector(Fi))?.focus();
|
|
3665
3713
|
}
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3714
|
+
//#endregion
|
|
3715
|
+
//#region src/tmdatagrid/components/TMDataGridEntryRows.tsx
|
|
3716
|
+
function Li(e, t) {
|
|
3717
|
+
return un(t.id) || Jn(t) === null ? !1 : cn(t, e);
|
|
3718
|
+
}
|
|
3719
|
+
function Ri(t) {
|
|
3720
|
+
let n = e(32), { orderedColumns: r, layoutFor: i, rowHeight: o } = t, { table: c, edit: l } = X(), u = j(l.store, Hi), d = s(null), f = s(null), p;
|
|
3721
|
+
n[0] === u ? p = n[1] : (p = () => {
|
|
3722
|
+
let e = u.at(-1)?.tempId;
|
|
3723
|
+
if (e === void 0) {
|
|
3724
|
+
f.current = null;
|
|
3725
|
+
return;
|
|
3726
|
+
}
|
|
3727
|
+
if (f.current === e) return;
|
|
3728
|
+
let t = d.current;
|
|
3729
|
+
if (t === null) return;
|
|
3730
|
+
let n = t.querySelector(`[data-dg-part="editor"][data-row-id="${CSS.escape(e)}"]`);
|
|
3731
|
+
n !== null && (f.current = e, Ii(n));
|
|
3732
|
+
}, n[0] = u, n[1] = p), a(p);
|
|
3733
|
+
let m;
|
|
3734
|
+
if (n[2] !== l || n[3] !== u) {
|
|
3669
3735
|
let e;
|
|
3670
|
-
n[
|
|
3736
|
+
n[5] === l ? e = n[6] : (e = (e) => {
|
|
3671
3737
|
let { tempId: t } = e;
|
|
3672
|
-
return
|
|
3673
|
-
}, n[
|
|
3674
|
-
} else
|
|
3675
|
-
let
|
|
3676
|
-
n[
|
|
3677
|
-
let
|
|
3678
|
-
n[
|
|
3679
|
-
features:
|
|
3680
|
-
columns:
|
|
3681
|
-
data:
|
|
3682
|
-
getRowId:
|
|
3683
|
-
}, n[
|
|
3684
|
-
let
|
|
3685
|
-
if (
|
|
3686
|
-
let
|
|
3687
|
-
if (n[
|
|
3688
|
-
let e =
|
|
3689
|
-
|
|
3738
|
+
return l.getForm(t)?.options.defaultValues ?? {};
|
|
3739
|
+
}, n[5] = l, n[6] = e), m = u.map(e), n[2] = l, n[3] = u, n[4] = m;
|
|
3740
|
+
} else m = n[4];
|
|
3741
|
+
let h = m, g;
|
|
3742
|
+
n[7] === u ? g = n[8] : (g = (e, t) => u[t]?.tempId ?? String(t), n[7] = u, n[8] = g);
|
|
3743
|
+
let _;
|
|
3744
|
+
n[9] !== h || n[10] !== g || n[11] !== c.options.columns ? (_ = {
|
|
3745
|
+
features: Br,
|
|
3746
|
+
columns: c.options.columns,
|
|
3747
|
+
data: h,
|
|
3748
|
+
getRowId: g
|
|
3749
|
+
}, n[9] = h, n[10] = g, n[11] = c.options.columns, n[12] = _) : _ = n[12];
|
|
3750
|
+
let v = Ke(_);
|
|
3751
|
+
if (u.length === 0) return null;
|
|
3752
|
+
let y, b, x, S, C;
|
|
3753
|
+
if (n[13] !== v || n[14] !== i || n[15] !== r || n[16] !== o) {
|
|
3754
|
+
let e = v.getCoreRowModel().rows;
|
|
3755
|
+
y = d, b = "rowgroup", x = !0, S = Q.entryBlock;
|
|
3690
3756
|
let t;
|
|
3691
|
-
n[
|
|
3692
|
-
let t = new Map(e.getAllCells().map(
|
|
3757
|
+
n[22] !== i || n[23] !== r || n[24] !== o ? (t = (e) => {
|
|
3758
|
+
let t = new Map(e.getAllCells().map(Vi));
|
|
3693
3759
|
return /* @__PURE__ */ W("div", {
|
|
3694
3760
|
role: "row",
|
|
3695
3761
|
"data-dg-part": "entry-row",
|
|
3696
3762
|
"data-row-id": e.id,
|
|
3697
3763
|
className: Q.entryRow,
|
|
3698
|
-
children: r.map((
|
|
3699
|
-
let
|
|
3764
|
+
children: r.map((n) => {
|
|
3765
|
+
let r = t.get(n.id), a = i(n.id), s = r !== void 0 && Li(e, n);
|
|
3700
3766
|
return /* @__PURE__ */ W("div", {
|
|
3701
3767
|
role: "cell",
|
|
3702
|
-
"data-column-id":
|
|
3703
|
-
"data-align":
|
|
3704
|
-
"data-control-column":
|
|
3768
|
+
"data-column-id": n.id,
|
|
3769
|
+
"data-align": ln(n),
|
|
3770
|
+
"data-control-column": un(n.id),
|
|
3705
3771
|
className: [
|
|
3706
3772
|
Q.entryCell,
|
|
3707
|
-
|
|
3708
|
-
|
|
3773
|
+
a.isBoundary && a.pinnedAt === "left" ? oi.stickyLeft : "",
|
|
3774
|
+
a.isBoundary && a.pinnedAt === "right" ? oi.stickyRight : ""
|
|
3709
3775
|
].filter(Boolean).join(" "),
|
|
3710
3776
|
style: {
|
|
3711
|
-
minHeight:
|
|
3712
|
-
left:
|
|
3713
|
-
right:
|
|
3714
|
-
position:
|
|
3715
|
-
zIndex:
|
|
3777
|
+
minHeight: o,
|
|
3778
|
+
left: a.pinnedAt === "left" ? a.offset : void 0,
|
|
3779
|
+
right: a.pinnedAt === "right" ? a.offset : void 0,
|
|
3780
|
+
position: a.pinnedAt ? "sticky" : void 0,
|
|
3781
|
+
zIndex: a.pinnedAt ? "var(--dg-z-pinned-row-pinned-cell, 5)" : void 0
|
|
3716
3782
|
},
|
|
3717
|
-
children:
|
|
3718
|
-
cell:
|
|
3783
|
+
children: s && r !== void 0 ? /* @__PURE__ */ W(Pi, {
|
|
3784
|
+
cell: r,
|
|
3719
3785
|
row: e,
|
|
3720
|
-
takeSeedText:
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
}, r.id);
|
|
3786
|
+
takeSeedText: Bi,
|
|
3787
|
+
onClose: zi
|
|
3788
|
+
}) : r !== void 0 && n.id === "__edit__" ? Ie(r.column.columnDef.cell, r.getContext()) : null
|
|
3789
|
+
}, n.id);
|
|
3725
3790
|
})
|
|
3726
3791
|
}, e.id);
|
|
3727
|
-
}, n[
|
|
3728
|
-
} else
|
|
3729
|
-
let
|
|
3730
|
-
return n[
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3792
|
+
}, n[22] = i, n[23] = r, n[24] = o, n[25] = t) : t = n[25], C = e.map(t), n[13] = v, n[14] = i, n[15] = r, n[16] = o, n[17] = y, n[18] = b, n[19] = x, n[20] = S, n[21] = C;
|
|
3793
|
+
} else y = n[17], b = n[18], x = n[19], S = n[20], C = n[21];
|
|
3794
|
+
let w;
|
|
3795
|
+
return n[26] !== y || n[27] !== b || n[28] !== x || n[29] !== S || n[30] !== C ? (w = /* @__PURE__ */ W("div", {
|
|
3796
|
+
ref: y,
|
|
3797
|
+
role: b,
|
|
3798
|
+
"data-dg-entry-block": x,
|
|
3799
|
+
className: S,
|
|
3800
|
+
children: C
|
|
3801
|
+
}), n[26] = y, n[27] = b, n[28] = x, n[29] = S, n[30] = C, n[31] = w) : w = n[31], w;
|
|
3736
3802
|
}
|
|
3737
|
-
function
|
|
3738
|
-
function
|
|
3739
|
-
function
|
|
3803
|
+
function zi() {}
|
|
3804
|
+
function Bi() {}
|
|
3805
|
+
function Vi(e) {
|
|
3740
3806
|
return [e.column.id, e];
|
|
3741
3807
|
}
|
|
3742
|
-
function
|
|
3808
|
+
function Hi(e) {
|
|
3743
3809
|
return e.newRows;
|
|
3744
3810
|
}
|
|
3745
3811
|
//#endregion
|
|
3746
3812
|
//#region src/tmdatagrid/core/cellRange.ts
|
|
3747
|
-
function
|
|
3813
|
+
function Ui({ range: e, rowIndexOf: t, columnIndexOf: n }) {
|
|
3748
3814
|
if (e === null) return null;
|
|
3749
3815
|
let r = t(e.anchor.rowId), i = t(e.focus.rowId), a = n(e.anchor.columnId), o = n(e.focus.columnId);
|
|
3750
3816
|
return r < 0 || i < 0 || a < 0 || o < 0 ? null : {
|
|
@@ -3754,14 +3820,14 @@ function Li({ range: e, rowIndexOf: t, columnIndexOf: n }) {
|
|
|
3754
3820
|
right: Math.max(a, o)
|
|
3755
3821
|
};
|
|
3756
3822
|
}
|
|
3757
|
-
function
|
|
3823
|
+
function Wi(e, t, n) {
|
|
3758
3824
|
return e !== null && t >= e.top && t <= e.bottom && n >= e.left && n <= e.right;
|
|
3759
3825
|
}
|
|
3760
|
-
function
|
|
3826
|
+
function Gi(e) {
|
|
3761
3827
|
return e === null ? 0 : (e.bottom - e.top + 1) * (e.right - e.left + 1);
|
|
3762
3828
|
}
|
|
3763
|
-
function
|
|
3764
|
-
return !
|
|
3829
|
+
function Ki(e, t, n) {
|
|
3830
|
+
return !Wi(e, t, n) || e === null ? null : {
|
|
3765
3831
|
top: t === e.top,
|
|
3766
3832
|
bottom: t === e.bottom,
|
|
3767
3833
|
left: n === e.left,
|
|
@@ -3770,13 +3836,13 @@ function Bi(e, t, n) {
|
|
|
3770
3836
|
}
|
|
3771
3837
|
//#endregion
|
|
3772
3838
|
//#region src/tmdatagrid/core/cellExport.ts
|
|
3773
|
-
var
|
|
3839
|
+
var qi = "", Ji = {
|
|
3774
3840
|
separator: ";",
|
|
3775
3841
|
decimalComma: !0,
|
|
3776
3842
|
includeHeaders: !0,
|
|
3777
3843
|
fileName: "export"
|
|
3778
3844
|
};
|
|
3779
|
-
function
|
|
3845
|
+
function Yi(e, { decimalComma: t }) {
|
|
3780
3846
|
if (e == null) return "";
|
|
3781
3847
|
if (typeof e == "number") {
|
|
3782
3848
|
if (!Number.isFinite(e)) return "";
|
|
@@ -3785,7 +3851,7 @@ function Ui(e, { decimalComma: t }) {
|
|
|
3785
3851
|
}
|
|
3786
3852
|
if (typeof e == "string") return e;
|
|
3787
3853
|
if (typeof e == "boolean") return e ? "true" : "false";
|
|
3788
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
3854
|
+
if (Array.isArray(e)) return e.map((e) => Yi(e, { decimalComma: t })).join(", ");
|
|
3789
3855
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? "" : e.toLocaleString("sv-SE");
|
|
3790
3856
|
if (typeof e == "object") try {
|
|
3791
3857
|
return JSON.stringify(e);
|
|
@@ -3794,18 +3860,18 @@ function Ui(e, { decimalComma: t }) {
|
|
|
3794
3860
|
}
|
|
3795
3861
|
return String(e);
|
|
3796
3862
|
}
|
|
3797
|
-
function
|
|
3798
|
-
let a = t.slice(n.left, n.right + 1).filter((e) => !
|
|
3863
|
+
function Xi({ rows: e, columns: t, bounds: n, includeHeaders: r, decimalComma: i }) {
|
|
3864
|
+
let a = t.slice(n.left, n.right + 1).filter((e) => !un(e.id));
|
|
3799
3865
|
if (a.length === 0) return [];
|
|
3800
3866
|
let o = [];
|
|
3801
|
-
r && o.push(a.map((e) =>
|
|
3867
|
+
r && o.push(a.map((e) => nn(e)));
|
|
3802
3868
|
for (let t = n.top; t <= n.bottom; t += 1) {
|
|
3803
3869
|
let n = e[t];
|
|
3804
|
-
n !== void 0 && o.push(a.map((e) =>
|
|
3870
|
+
n !== void 0 && o.push(a.map((e) => Yi(n.getValue(e.id), { decimalComma: i })));
|
|
3805
3871
|
}
|
|
3806
3872
|
return o;
|
|
3807
3873
|
}
|
|
3808
|
-
function
|
|
3874
|
+
function Zi({ table: e, includeHeaders: t = Ji.includeHeaders, decimalComma: n = Ji.decimalComma }) {
|
|
3809
3875
|
let r = e, i = [
|
|
3810
3876
|
...r.getLeftVisibleLeafColumns(),
|
|
3811
3877
|
...r.getCenterVisibleLeafColumns(),
|
|
@@ -3813,7 +3879,7 @@ function Gi({ table: e, includeHeaders: t = Hi.includeHeaders, decimalComma: n =
|
|
|
3813
3879
|
], a = [], o = (e) => {
|
|
3814
3880
|
for (let t of e) t.getIsGrouped() ? o(t.subRows) : a.push(t);
|
|
3815
3881
|
};
|
|
3816
|
-
return o(r.getSortedRowModel().rows),
|
|
3882
|
+
return o(r.getSortedRowModel().rows), Xi({
|
|
3817
3883
|
rows: a,
|
|
3818
3884
|
columns: i,
|
|
3819
3885
|
bounds: {
|
|
@@ -3826,43 +3892,43 @@ function Gi({ table: e, includeHeaders: t = Hi.includeHeaders, decimalComma: n =
|
|
|
3826
3892
|
decimalComma: n
|
|
3827
3893
|
});
|
|
3828
3894
|
}
|
|
3829
|
-
function
|
|
3895
|
+
function Qi({ table: e, options: t }) {
|
|
3830
3896
|
let n = {
|
|
3831
|
-
...
|
|
3897
|
+
...Ji,
|
|
3832
3898
|
...t
|
|
3833
|
-
}, r =
|
|
3899
|
+
}, r = Zi({
|
|
3834
3900
|
table: e,
|
|
3835
3901
|
includeHeaders: n.includeHeaders,
|
|
3836
3902
|
decimalComma: n.decimalComma
|
|
3837
3903
|
});
|
|
3838
|
-
r.length !== 0 &&
|
|
3904
|
+
r.length !== 0 && ra({
|
|
3839
3905
|
fileName: `${n.fileName}.csv`,
|
|
3840
|
-
text:
|
|
3906
|
+
text: ta(r, { separator: n.separator })
|
|
3841
3907
|
});
|
|
3842
3908
|
}
|
|
3843
|
-
function
|
|
3909
|
+
function $i(e, t) {
|
|
3844
3910
|
return e.includes(t) || e.includes("\"") || e.includes("\n") || e.includes("\r") ? `"${e.replaceAll("\"", "\"\"")}"` : e;
|
|
3845
3911
|
}
|
|
3846
|
-
function
|
|
3847
|
-
return e.map((e) => e.map((e) =>
|
|
3912
|
+
function ea(e) {
|
|
3913
|
+
return e.map((e) => e.map((e) => $i(e, " ")).join(" ")).join("\r\n");
|
|
3848
3914
|
}
|
|
3849
|
-
function
|
|
3850
|
-
return `${
|
|
3915
|
+
function ta(e, { separator: t }) {
|
|
3916
|
+
return `${qi}sep=${t}\r\n${e.map((e) => e.map((e) => $i(e, t)).join(t)).join("\r\n")}\r\n`;
|
|
3851
3917
|
}
|
|
3852
|
-
async function
|
|
3918
|
+
async function na(e) {
|
|
3853
3919
|
try {
|
|
3854
3920
|
return await navigator.clipboard.writeText(e), !0;
|
|
3855
3921
|
} catch {
|
|
3856
3922
|
return !1;
|
|
3857
3923
|
}
|
|
3858
3924
|
}
|
|
3859
|
-
function
|
|
3925
|
+
function ra({ fileName: e, text: t, mimeType: n = "text/csv;charset=utf-8" }) {
|
|
3860
3926
|
let r = URL.createObjectURL(new Blob([t], { type: n })), i = document.createElement("a");
|
|
3861
3927
|
i.href = r, i.download = e, i.style.display = "none", document.body.append(i), i.click(), i.remove(), setTimeout(() => URL.revokeObjectURL(r), 0);
|
|
3862
3928
|
}
|
|
3863
3929
|
//#endregion
|
|
3864
3930
|
//#region src/tmdatagrid/core/rowPinning.ts
|
|
3865
|
-
function
|
|
3931
|
+
function ia(e, t) {
|
|
3866
3932
|
let n = e.store.state.rowPinning[t];
|
|
3867
3933
|
if (n.length === 0) return [];
|
|
3868
3934
|
let r = e.getPrePaginatedRowModel().rowsById, i = e.getCoreRowModel().rowsById, a = [];
|
|
@@ -3874,17 +3940,17 @@ function Qi(e, t) {
|
|
|
3874
3940
|
}
|
|
3875
3941
|
//#endregion
|
|
3876
3942
|
//#region src/tmdatagrid/core/matchHighlight.ts
|
|
3877
|
-
var
|
|
3943
|
+
var aa = [
|
|
3878
3944
|
"contains",
|
|
3879
3945
|
"startsWith",
|
|
3880
3946
|
"endsWith"
|
|
3881
3947
|
];
|
|
3882
|
-
function
|
|
3948
|
+
function oa(e) {
|
|
3883
3949
|
let t = e.store.state, n = typeof t.globalFilter == "string" ? t.globalFilter.trim() : "", r = /* @__PURE__ */ new Map();
|
|
3884
3950
|
for (let e of t.columnFilters) {
|
|
3885
3951
|
if (!gt(e.value)) continue;
|
|
3886
3952
|
let { operator: t, value: n } = e.value;
|
|
3887
|
-
if (
|
|
3953
|
+
if (!aa.includes(t) || typeof n != "string" || n === "") continue;
|
|
3888
3954
|
let i = r.get(e.id) ?? [];
|
|
3889
3955
|
i.push(n), r.set(e.id, i);
|
|
3890
3956
|
}
|
|
@@ -3898,7 +3964,7 @@ function ea(e) {
|
|
|
3898
3964
|
}
|
|
3899
3965
|
return i.size > 0 ? i : null;
|
|
3900
3966
|
}
|
|
3901
|
-
function
|
|
3967
|
+
function sa(e, t) {
|
|
3902
3968
|
let n = e.toLowerCase(), r = [];
|
|
3903
3969
|
for (let e of t) {
|
|
3904
3970
|
let t = e.toLowerCase();
|
|
@@ -3920,33 +3986,26 @@ function ta(e, t) {
|
|
|
3920
3986
|
}
|
|
3921
3987
|
//#endregion
|
|
3922
3988
|
//#region src/tmdatagrid/components/TMDataGridTable.tsx
|
|
3923
|
-
var
|
|
3989
|
+
var ca = {
|
|
3924
3990
|
pinnedAt: !1,
|
|
3925
3991
|
offset: 0,
|
|
3926
3992
|
isBoundary: !1
|
|
3927
|
-
}
|
|
3928
|
-
|
|
3929
|
-
"input:not([disabled])",
|
|
3930
|
-
"select:not([disabled])",
|
|
3931
|
-
"textarea:not([disabled])",
|
|
3932
|
-
"a[href]",
|
|
3933
|
-
"[tabindex]:not([tabindex=\"-1\"])"
|
|
3934
|
-
].join(",");
|
|
3935
|
-
function ia(e, t) {
|
|
3993
|
+
};
|
|
3994
|
+
function la(e, t) {
|
|
3936
3995
|
return e.querySelector(`[data-cell="true"][data-row-id="${CSS.escape(t.rowId)}"][data-column-id="${CSS.escape(t.columnId)}"]`);
|
|
3937
3996
|
}
|
|
3938
|
-
function
|
|
3997
|
+
function ua({ container: e, cellElement: t, leftPinnedWidth: n, rightPinnedWidth: r }) {
|
|
3939
3998
|
let i = t.getBoundingClientRect(), a = e.getBoundingClientRect(), o = a.left + n, s = a.right - r;
|
|
3940
3999
|
i.left < o ? e.scrollLeft -= o - i.left : i.right > s && (e.scrollLeft += i.right - s);
|
|
3941
4000
|
}
|
|
3942
|
-
function
|
|
4001
|
+
function da(e) {
|
|
3943
4002
|
if (e.getIsPlaceholder()) return null;
|
|
3944
4003
|
if (!e.getIsAggregated()) return Ie(e.column.columnDef.cell, e.getContext());
|
|
3945
4004
|
let { aggregatedCell: t, aggregationFn: n } = e.column.columnDef;
|
|
3946
4005
|
return t === void 0 ? n === void 0 ? null : Ie(e.column.columnDef.cell, e.getContext()) : Ie(t, e.getContext());
|
|
3947
4006
|
}
|
|
3948
|
-
function
|
|
3949
|
-
let n =
|
|
4007
|
+
function fa(e, t) {
|
|
4008
|
+
let n = sa(e, t);
|
|
3950
4009
|
if (n === null) return e;
|
|
3951
4010
|
let r = [], i = 0;
|
|
3952
4011
|
for (let t of n) t.start > i && r.push(e.slice(i, t.start)), r.push(/* @__PURE__ */ W("mark", {
|
|
@@ -3955,9 +4014,9 @@ function sa(e, t) {
|
|
|
3955
4014
|
}, t.start)), i = t.end;
|
|
3956
4015
|
return i < e.length && r.push(e.slice(i)), r;
|
|
3957
4016
|
}
|
|
3958
|
-
function
|
|
4017
|
+
function pa(t) {
|
|
3959
4018
|
let n = e(55), { 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: _ } = X(), v;
|
|
3960
|
-
n[0] === r.column ? v = n[1] : (v =
|
|
4019
|
+
n[0] === r.column ? v = n[1] : (v = Jn(r.column), n[0] = r.column, n[1] = v);
|
|
3961
4020
|
let y = v, b = r.row.id, x;
|
|
3962
4021
|
n[2] !== b || n[3] !== y ? (x = (e) => {
|
|
3963
4022
|
if (y === null) return !1;
|
|
@@ -3971,10 +4030,10 @@ function ca(t) {
|
|
|
3971
4030
|
return t !== void 0 && t.errorFields.includes(y);
|
|
3972
4031
|
}, n[5] = b, n[6] = y, n[7] = C) : C = n[7];
|
|
3973
4032
|
let w = j(_.store, C), T = o ? "gridcell" : "cell", E = o?.columnIndex, D = o?.tabIndex, O = o ? !0 : void 0, k = r.row.id, A = r.column.id, M = o?.focused, N = o?.selected, P = o?.selected, F = o?.edges?.top, ee = o?.edges?.bottom, I = o?.edges?.left, te = o?.edges?.right, ne = s !== void 0 || void 0, L = S || void 0, R = w || void 0, z;
|
|
3974
|
-
n[8] === r.column ? z = n[9] : (z =
|
|
4033
|
+
n[8] === r.column ? z = n[9] : (z = ln(r.column), n[8] = r.column, n[9] = z);
|
|
3975
4034
|
let re;
|
|
3976
|
-
n[10] === r.column.id ? re = n[11] : (re =
|
|
3977
|
-
let ie = a.isBoundary && a.pinnedAt === "left" ?
|
|
4035
|
+
n[10] === r.column.id ? re = n[11] : (re = un(r.column.id), n[10] = r.column.id, n[11] = re);
|
|
4036
|
+
let ie = a.isBoundary && a.pinnedAt === "left" ? oi.stickyLeft : "", B = a.isBoundary && a.pinnedAt === "right" ? oi.stickyRight : "", ae;
|
|
3978
4037
|
n[12] !== ie || n[13] !== B ? (ae = [
|
|
3979
4038
|
Q.bodyCell,
|
|
3980
4039
|
ie,
|
|
@@ -3994,9 +4053,9 @@ function ca(t) {
|
|
|
3994
4053
|
children: (() => {
|
|
3995
4054
|
if (l !== void 0 && c === void 0 && !r.getIsPlaceholder() && !r.getIsAggregated() && r.column.columnDef.cell === g.getDefaultColumnDef().cell) {
|
|
3996
4055
|
let e = r.renderValue();
|
|
3997
|
-
if (typeof e == "string" || typeof e == "number") return
|
|
4056
|
+
if (typeof e == "string" || typeof e == "number") return fa(String(e), l);
|
|
3998
4057
|
}
|
|
3999
|
-
return c ??
|
|
4058
|
+
return c ?? da(r);
|
|
4000
4059
|
})()
|
|
4001
4060
|
}), n[21] = r, n[22] = c, n[23] = s, n[24] = l, n[25] = g, n[26] = ue) : ue = n[26];
|
|
4002
4061
|
let U;
|
|
@@ -4030,7 +4089,7 @@ function ca(t) {
|
|
|
4030
4089
|
children: ue
|
|
4031
4090
|
}), n[27] = r.column.id, n[28] = r.row.id, n[29] = d, n[30] = h, n[31] = m, n[32] = u, n[33] = f, n[34] = p, n[35] = M, n[36] = N, n[37] = P, n[38] = F, n[39] = ee, n[40] = I, n[41] = te, n[42] = ne, n[43] = L, n[44] = R, n[45] = z, n[46] = re, n[47] = oe, n[48] = H, n[49] = ue, n[50] = T, n[51] = E, n[52] = D, n[53] = O, n[54] = U) : U = n[54], U;
|
|
4032
4091
|
}
|
|
4033
|
-
function
|
|
4092
|
+
function ma(t) {
|
|
4034
4093
|
let n = e(16), { enabled: r, menuContent: i, menuProps: a, onContextMenu: o, onClose: s, children: c } = t, l;
|
|
4035
4094
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (l = { display: "contents" }, n[0] = l) : l = n[0];
|
|
4036
4095
|
let u = r ? o : void 0, d;
|
|
@@ -4061,13 +4120,13 @@ function la(t) {
|
|
|
4061
4120
|
children: [h, _]
|
|
4062
4121
|
}), n[10] = a, n[11] = p, n[12] = m, n[13] = h, n[14] = _, n[15] = v) : v = n[15], v;
|
|
4063
4122
|
}
|
|
4064
|
-
function
|
|
4123
|
+
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 }) {
|
|
4065
4124
|
let { table: k, ui: A, edit: M, features: N, labels: P, rowHeight: F, controlSize: ee, renderDetails: I, renderDetailsEstHeight: te, overscan: ne, scrollerRef: L } = X();
|
|
4066
4125
|
j(k.store);
|
|
4067
|
-
let R = j(A, (e) => e.highlightedRowId), z = j(A, (e) => e.focusedCell), re = j(A, (e) => e.cellRange), ie = j(M.store, (e) => e.active), B = j(M.store, (e) => e.openRowIds), ae = j(M.store, (e) => e.newRows.length), oe = j(M.store, (e) => e.deletedRowIds), { loading: se, noResultsLabel: ce = P.noResults } = k.options.meta ?? {}, le = s(null), V =
|
|
4126
|
+
let R = j(A, (e) => e.highlightedRowId), z = j(A, (e) => e.focusedCell), re = j(A, (e) => e.cellRange), ie = j(M.store, (e) => e.active), B = j(M.store, (e) => e.openRowIds), ae = j(M.store, (e) => e.newRows.length), oe = j(M.store, (e) => e.deletedRowIds), { loading: se, noResultsLabel: ce = P.noResults } = k.options.meta ?? {}, le = s(null), V = Kt(k, N), H = N.matchHighlighting ? oa(k) : null, ue = N.rowPinning ? ia(k, "top") : [], de = N.rowPinning ? ia(k, "bottom") : [], fe = ue.length + de.length, me = null;
|
|
4068
4127
|
if (N.rowNumbers) {
|
|
4069
4128
|
me = /* @__PURE__ */ new Map();
|
|
4070
|
-
let e =
|
|
4129
|
+
let e = qt(k, N) ? k.store.state.pagination.pageIndex * k.store.state.pagination.pageSize : 0;
|
|
4071
4130
|
for (let t of V) t.getIsGrouped() || me.set(t.id, ++e);
|
|
4072
4131
|
}
|
|
4073
4132
|
let he = (e) => I !== void 0 && !e.getIsGrouped() && e.getIsExpanded(), ge = s(!1);
|
|
@@ -4075,7 +4134,7 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4075
4134
|
if (ge.current) return;
|
|
4076
4135
|
ge.current = !0;
|
|
4077
4136
|
let e = le.current;
|
|
4078
|
-
if (e !== null) for (let t of q) t.columnDef.meta?.autoSize === !0 && (t.id in k.store.state.columnSizing ||
|
|
4137
|
+
if (e !== null) for (let t of q) t.columnDef.meta?.autoSize === !0 && (t.id in k.store.state.columnSizing || di({
|
|
4079
4138
|
table: k,
|
|
4080
4139
|
columnId: t.id,
|
|
4081
4140
|
container: e
|
|
@@ -4187,9 +4246,9 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4187
4246
|
offset: 0,
|
|
4188
4247
|
isBoundary: !1
|
|
4189
4248
|
});
|
|
4190
|
-
let ze = (e) => Pe.get(e) ??
|
|
4249
|
+
let ze = (e) => Pe.get(e) ?? ca, Be = V.length === 0 && fe === 0, Ve = k.store.state.globalFilter, He = k.store.state.columnFilters.length > 0 || (typeof Ve == "string" ? Ve.trim() !== "" : Ve != null), Ue = J.at(-1)?.headers ?? [], We = q.some((e) => e.columnDef.footer !== void 0), Ge = N.rowClickSelects, Ke = Ge || N.highlightRow || e !== void 0, qe = (e) => !e.getIsGrouped() && Ke, Je = (t, n) => {
|
|
4191
4250
|
if (Ge && t.getCanSelect()) {
|
|
4192
|
-
let e =
|
|
4251
|
+
let e = Yt({
|
|
4193
4252
|
rows: V,
|
|
4194
4253
|
rowId: t.id,
|
|
4195
4254
|
anchorRowId: A.state.selectionAnchorRowId,
|
|
@@ -4208,7 +4267,7 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4208
4267
|
}), Y = N.cellSelection, Z = N.cellRangeSelection, $e = s(!1), et = s(null), tt = Y && z !== null ? V.findIndex((e) => e.id === z.rowId) : -1, nt = Y && z !== null ? q.findIndex((e) => e.id === z.columnId) : -1, rt = tt >= 0 && ye.some((e) => e.index === tt), it = V[ye[0]?.index ?? -1], at = Y ? rt && z !== null ? z : it && q[0] ? {
|
|
4209
4268
|
rowId: it.id,
|
|
4210
4269
|
columnId: q[0].id
|
|
4211
|
-
} : null : null, ot = (e, t, n) => e !== null && e.rowId === t && e.columnId === n, st =
|
|
4270
|
+
} : null : null, ot = (e, t, n) => e !== null && e.rowId === t && e.columnId === n, st = Ui({
|
|
4212
4271
|
range: Z ? re : null,
|
|
4213
4272
|
rowIndexOf: (e) => V.findIndex((t) => t.id === e),
|
|
4214
4273
|
columnIndexOf: (e) => q.findIndex((t) => t.id === e)
|
|
@@ -4224,10 +4283,10 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4224
4283
|
bottom: tt,
|
|
4225
4284
|
left: nt,
|
|
4226
4285
|
right: nt
|
|
4227
|
-
} : null), ut =
|
|
4228
|
-
...
|
|
4286
|
+
} : null), ut = Gi(lt), dt = lt === null ? 0 : q.slice(lt.left, lt.right + 1).filter((e) => !un(e.id)).length, ft = {
|
|
4287
|
+
...Ji,
|
|
4229
4288
|
...C
|
|
4230
|
-
}, [pt, mt] = c(ft.includeHeaders), ht = (e) => lt === null ? [] :
|
|
4289
|
+
}, [pt, mt] = c(ft.includeHeaders), ht = (e) => lt === null ? [] : Xi({
|
|
4231
4290
|
rows: V,
|
|
4232
4291
|
columns: q,
|
|
4233
4292
|
bounds: lt,
|
|
@@ -4235,7 +4294,7 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4235
4294
|
decimalComma: ft.decimalComma
|
|
4236
4295
|
}), gt = async () => {
|
|
4237
4296
|
let e = ht(!1);
|
|
4238
|
-
e.length !== 0 && await
|
|
4297
|
+
e.length !== 0 && await na(ea(e));
|
|
4239
4298
|
}, [_t, vt] = c(!1);
|
|
4240
4299
|
i(() => {
|
|
4241
4300
|
if (!_t) return;
|
|
@@ -4246,9 +4305,9 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4246
4305
|
A.actions.setFocusedCell(e), ct(e, { extend: t }), t || vt(!0);
|
|
4247
4306
|
}, bt = (e) => {
|
|
4248
4307
|
let t = ht(e);
|
|
4249
|
-
t.length !== 0 &&
|
|
4308
|
+
t.length !== 0 && ra({
|
|
4250
4309
|
fileName: `${ft.fileName}.csv`,
|
|
4251
|
-
text:
|
|
4310
|
+
text: ta(t, { separator: ft.separator })
|
|
4252
4311
|
});
|
|
4253
4312
|
}, xt = (e, { extend: t } = { extend: !1 }) => {
|
|
4254
4313
|
let n = V[e.rowIndex], r = q[e.columnIndex];
|
|
@@ -4283,11 +4342,11 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4283
4342
|
return;
|
|
4284
4343
|
}
|
|
4285
4344
|
let n = e.querySelector(`[data-dg-part="editor"][data-row-id="${CSS.escape(ie.rowId)}"][data-column-id="${CSS.escape(t)}"]`);
|
|
4286
|
-
n !== null && (Tt.current = ie, (n
|
|
4345
|
+
n !== null && (Tt.current = ie, Ii(n));
|
|
4287
4346
|
});
|
|
4288
4347
|
let Et = (e) => {
|
|
4289
4348
|
let t = le.current;
|
|
4290
|
-
t !== null && ($e.current = !0,
|
|
4349
|
+
t !== null && ($e.current = !0, la(t, e)?.focus());
|
|
4291
4350
|
}, Dt = (e) => {
|
|
4292
4351
|
Y && A.actions.setFocusedCell(e), M.begin({
|
|
4293
4352
|
rowId: e.rowId,
|
|
@@ -4311,7 +4370,7 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4311
4370
|
}) : Et(e);
|
|
4312
4371
|
return;
|
|
4313
4372
|
}
|
|
4314
|
-
let a =
|
|
4373
|
+
let a = Lr({
|
|
4315
4374
|
from: {
|
|
4316
4375
|
rowIndex: r,
|
|
4317
4376
|
columnIndex: i
|
|
@@ -4326,8 +4385,8 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4326
4385
|
});
|
|
4327
4386
|
a === null ? Et(e) : xt(a);
|
|
4328
4387
|
}, kt = (e, { extend: t }) => {
|
|
4329
|
-
if (N.rowSelection &&
|
|
4330
|
-
let n =
|
|
4388
|
+
if (N.rowSelection && Jt(e).length > 0) {
|
|
4389
|
+
let n = Yt({
|
|
4331
4390
|
rows: V,
|
|
4332
4391
|
rowId: e.id,
|
|
4333
4392
|
anchorRowId: A.state.selectionAnchorRowId,
|
|
@@ -4387,7 +4446,7 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4387
4446
|
}
|
|
4388
4447
|
}
|
|
4389
4448
|
if (e.key === "Enter" || e.key === "F2") {
|
|
4390
|
-
let n = t.querySelector(
|
|
4449
|
+
let n = t.querySelector(Fi);
|
|
4391
4450
|
if (n === null) return;
|
|
4392
4451
|
e.preventDefault(), n.focus();
|
|
4393
4452
|
return;
|
|
@@ -4406,7 +4465,7 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4406
4465
|
t && kt(t, { extend: e.shiftKey });
|
|
4407
4466
|
return;
|
|
4408
4467
|
}
|
|
4409
|
-
let c =
|
|
4468
|
+
let c = Ir({
|
|
4410
4469
|
key: e.key,
|
|
4411
4470
|
ctrlKey: e.ctrlKey || e.metaKey,
|
|
4412
4471
|
from: {
|
|
@@ -4428,8 +4487,8 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4428
4487
|
return;
|
|
4429
4488
|
}
|
|
4430
4489
|
if (!$e.current && !e.contains(document.activeElement)) return;
|
|
4431
|
-
let t =
|
|
4432
|
-
t !== null && ($e.current = !1, !t.contains(document.activeElement) && (document.activeElement instanceof Element && document.activeElement.closest("[data-dg-part=\"editor\"]") !== null || (t.focus({ preventScroll: !0 }), ze(z.columnId).pinnedAt === !1 &&
|
|
4490
|
+
let t = la(e, z);
|
|
4491
|
+
t !== null && ($e.current = !1, !t.contains(document.activeElement) && (document.activeElement instanceof Element && document.activeElement.closest("[data-dg-part=\"editor\"]") !== null || (t.focus({ preventScroll: !0 }), ze(z.columnId).pinnedAt === !1 && ua({
|
|
4433
4492
|
container: e,
|
|
4434
4493
|
cellElement: t,
|
|
4435
4494
|
leftPinnedWidth: Le,
|
|
@@ -4440,7 +4499,7 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4440
4499
|
let e = Pt.current, t = Ft.current;
|
|
4441
4500
|
if (Pt.current = null, Ft.current = null, Y && e !== null && t !== null) {
|
|
4442
4501
|
let n = V.findIndex((t) => t.id === e), r = q.findIndex((e) => e.id === t);
|
|
4443
|
-
n >= 0 && !
|
|
4502
|
+
n >= 0 && !Wi(lt, n, r) && (A.actions.setFocusedCell({
|
|
4444
4503
|
rowId: e,
|
|
4445
4504
|
columnId: t
|
|
4446
4505
|
}), ct({
|
|
@@ -4492,7 +4551,7 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4492
4551
|
bottom: !1,
|
|
4493
4552
|
left: !0,
|
|
4494
4553
|
right: !1
|
|
4495
|
-
}), Wt = p !== void 0 || m !== void 0 || _ !== void 0 || v !== void 0,
|
|
4554
|
+
}), Wt = p !== void 0 || m !== void 0 || _ !== void 0 || v !== void 0, Gt = jt || Wt ? (e) => {
|
|
4496
4555
|
if (jt && Nt(), !Wt) return;
|
|
4497
4556
|
let t = e.currentTarget, n = {
|
|
4498
4557
|
top: t.scrollTop <= 1,
|
|
@@ -4508,7 +4567,7 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4508
4567
|
ref: le,
|
|
4509
4568
|
className: Q.scrollContainer,
|
|
4510
4569
|
"data-dg-scroll-container": !0,
|
|
4511
|
-
onScroll:
|
|
4570
|
+
onScroll: Gt,
|
|
4512
4571
|
children: /* @__PURE__ */ G("div", {
|
|
4513
4572
|
ref: _e,
|
|
4514
4573
|
role: Y ? "grid" : "table",
|
|
@@ -4536,19 +4595,19 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4536
4595
|
"data-dg-header-row": !0,
|
|
4537
4596
|
"data-dg-header-last": t === J.length - 1 || void 0,
|
|
4538
4597
|
className: Q.headerRow,
|
|
4539
|
-
children: e.headers.map((e) => /* @__PURE__ */ W(
|
|
4598
|
+
children: e.headers.map((e) => /* @__PURE__ */ W(vi, {
|
|
4540
4599
|
renderColumnMenuItems: x,
|
|
4541
4600
|
header: e,
|
|
4542
4601
|
layout: ze(e.column.id)
|
|
4543
4602
|
}, e.id))
|
|
4544
4603
|
}, e.id))
|
|
4545
4604
|
}),
|
|
4546
|
-
N.editing && ae > 0 && /* @__PURE__ */ W(
|
|
4605
|
+
N.editing && ae > 0 && /* @__PURE__ */ W(Ri, {
|
|
4547
4606
|
orderedColumns: q,
|
|
4548
4607
|
layoutFor: ze,
|
|
4549
4608
|
rowHeight: F
|
|
4550
4609
|
}),
|
|
4551
|
-
/* @__PURE__ */ W(
|
|
4610
|
+
/* @__PURE__ */ W(ma, {
|
|
4552
4611
|
enabled: b !== void 0 || Z,
|
|
4553
4612
|
menuContent: Ht,
|
|
4554
4613
|
menuProps: S,
|
|
@@ -4605,17 +4664,16 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4605
4664
|
} : void 0,
|
|
4606
4665
|
children: [l.map((i, a) => {
|
|
4607
4666
|
let c = ie !== null && ie.rowId === e.id && ie.columnId === i.column.id || u && M.canEditCell(e, i.column);
|
|
4608
|
-
return /* @__PURE__ */ W(
|
|
4667
|
+
return /* @__PURE__ */ W(pa, {
|
|
4609
4668
|
cell: i,
|
|
4610
4669
|
rowHeight: F,
|
|
4611
4670
|
layout: ze(i.column.id),
|
|
4612
4671
|
contentOverride: me !== null && i.column.id === "__rowNumber__" ? me.get(e.id) : void 0,
|
|
4613
4672
|
highlightNeedles: H?.get(i.column.id),
|
|
4614
|
-
editor: c ? /* @__PURE__ */ W(
|
|
4673
|
+
editor: c ? /* @__PURE__ */ W(Pi, {
|
|
4615
4674
|
cell: i,
|
|
4616
4675
|
row: e,
|
|
4617
4676
|
takeSeedText: Ct,
|
|
4618
|
-
autoFocus: !u,
|
|
4619
4677
|
onClose: (t) => Ot({
|
|
4620
4678
|
rowId: e.id,
|
|
4621
4679
|
columnId: i.column.id
|
|
@@ -4633,8 +4691,8 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4633
4691
|
columnIndex: a + 1,
|
|
4634
4692
|
focused: ot(z, e.id, i.column.id),
|
|
4635
4693
|
tabIndex: ot(at, e.id, i.column.id) ? 0 : -1,
|
|
4636
|
-
selected: Z ?
|
|
4637
|
-
edges:
|
|
4694
|
+
selected: Z ? Wi(st, n, a) : ot(z, e.id, i.column.id),
|
|
4695
|
+
edges: Ki(st, n, a)
|
|
4638
4696
|
} : void 0,
|
|
4639
4697
|
onFocus: Y ? () => A.actions.setFocusedCell({
|
|
4640
4698
|
rowId: e.id,
|
|
@@ -4743,12 +4801,12 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4743
4801
|
return /* @__PURE__ */ W("div", {
|
|
4744
4802
|
role: "cell",
|
|
4745
4803
|
"data-column-id": e.column.id,
|
|
4746
|
-
"data-align":
|
|
4747
|
-
"data-control-column":
|
|
4804
|
+
"data-align": ln(e.column),
|
|
4805
|
+
"data-control-column": un(e.column.id),
|
|
4748
4806
|
className: [
|
|
4749
4807
|
Q.summaryCell,
|
|
4750
|
-
t.isBoundary && t.pinnedAt === "left" ?
|
|
4751
|
-
t.isBoundary && t.pinnedAt === "right" ?
|
|
4808
|
+
t.isBoundary && t.pinnedAt === "left" ? oi.stickyLeft : "",
|
|
4809
|
+
t.isBoundary && t.pinnedAt === "right" ? oi.stickyRight : ""
|
|
4752
4810
|
].filter(Boolean).join(" "),
|
|
4753
4811
|
style: {
|
|
4754
4812
|
minHeight: F,
|
|
@@ -4766,28 +4824,28 @@ function ua({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4766
4824
|
})
|
|
4767
4825
|
]
|
|
4768
4826
|
})
|
|
4769
|
-
}), /* @__PURE__ */ W(
|
|
4827
|
+
}), /* @__PURE__ */ W(Vn, {})]
|
|
4770
4828
|
});
|
|
4771
4829
|
}
|
|
4772
|
-
var
|
|
4830
|
+
var ga = {
|
|
4773
4831
|
toolbar: "_toolbar_4my8t_1",
|
|
4774
4832
|
toolbarSpacer: "_toolbarSpacer_4my8t_10"
|
|
4775
4833
|
};
|
|
4776
4834
|
//#endregion
|
|
4777
4835
|
//#region src/tmdatagrid/components/TMDataGridToolbar.tsx
|
|
4778
|
-
function
|
|
4836
|
+
function _a(t) {
|
|
4779
4837
|
let n = e(2), { children: r } = t, i;
|
|
4780
4838
|
return n[0] === r ? i = n[1] : (i = /* @__PURE__ */ W("div", {
|
|
4781
4839
|
"data-dg-part": "toolbar",
|
|
4782
|
-
className:
|
|
4840
|
+
className: ga.toolbar,
|
|
4783
4841
|
children: r
|
|
4784
4842
|
}), n[0] = r, n[1] = i), i;
|
|
4785
4843
|
}
|
|
4786
|
-
function
|
|
4844
|
+
function va() {
|
|
4787
4845
|
let t = e(1), n;
|
|
4788
|
-
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ W("div", { className:
|
|
4846
|
+
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ W("div", { className: ga.toolbarSpacer }), t[0] = n) : n = t[0], n;
|
|
4789
4847
|
}
|
|
4790
|
-
function
|
|
4848
|
+
function ya() {
|
|
4791
4849
|
let t = e(2), { table: n, labels: r } = X();
|
|
4792
4850
|
if (n.options.meta?.loading !== !0) return null;
|
|
4793
4851
|
let i;
|
|
@@ -4797,7 +4855,7 @@ function ma() {
|
|
|
4797
4855
|
"aria-label": r.loading
|
|
4798
4856
|
}), t[0] = r.loading, t[1] = i), i;
|
|
4799
4857
|
}
|
|
4800
|
-
function
|
|
4858
|
+
function ba(t) {
|
|
4801
4859
|
let n = e(11), { children: r } = t, { table: i, controlSize: a } = X();
|
|
4802
4860
|
if (j(i.store), r !== void 0) {
|
|
4803
4861
|
let e;
|
|
@@ -4826,9 +4884,9 @@ function ha(t) {
|
|
|
4826
4884
|
]
|
|
4827
4885
|
}), n[7] = a, n[8] = s, n[9] = l, n[10] = u) : u = n[10], u;
|
|
4828
4886
|
}
|
|
4829
|
-
function
|
|
4830
|
-
let t = e(13), { table: n, ui: r, features: i, labels: a, controlSize: o } = X(), s = j(r,
|
|
4831
|
-
if (!
|
|
4887
|
+
function xa() {
|
|
4888
|
+
let t = e(13), { table: n, ui: r, features: i, labels: a, controlSize: o } = X(), s = j(r, Sa);
|
|
4889
|
+
if (!Pr(n, i).canHideAny) return null;
|
|
4832
4890
|
let c;
|
|
4833
4891
|
t[0] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ W(V, {
|
|
4834
4892
|
size: 18,
|
|
@@ -4853,7 +4911,7 @@ function ga() {
|
|
|
4853
4911
|
let f;
|
|
4854
4912
|
t[8] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ W(b.Dropdown, {
|
|
4855
4913
|
p: 0,
|
|
4856
|
-
children: /* @__PURE__ */ W(
|
|
4914
|
+
children: /* @__PURE__ */ W(xn, {})
|
|
4857
4915
|
}), t[8] = f) : f = t[8];
|
|
4858
4916
|
let p;
|
|
4859
4917
|
return t[9] !== s || t[10] !== d || t[11] !== r.actions.setColumnsPanelOpen ? (p = /* @__PURE__ */ G(b, {
|
|
@@ -4867,20 +4925,20 @@ function ga() {
|
|
|
4867
4925
|
children: [d, f]
|
|
4868
4926
|
}), t[9] = s, t[10] = d, t[11] = r.actions.setColumnsPanelOpen, t[12] = p) : p = t[12], p;
|
|
4869
4927
|
}
|
|
4870
|
-
function
|
|
4928
|
+
function Sa(e) {
|
|
4871
4929
|
return e.columnsPanelOpen;
|
|
4872
4930
|
}
|
|
4873
|
-
function
|
|
4874
|
-
let t = e(15), n = X(), { table: r, ui: i, features: a, labels: o, controlSize: s } = n, c = j(i,
|
|
4875
|
-
if (!
|
|
4931
|
+
function Ca() {
|
|
4932
|
+
let t = e(15), n = X(), { table: r, ui: i, features: a, labels: o, controlSize: s } = n, c = j(i, Da), u = j(r.store, Ea).filter(Ta).length;
|
|
4933
|
+
if (!Pr(r, a).canFilterAny) return null;
|
|
4876
4934
|
let d = c || u > 0 ? "light" : "subtle", f = u > 0 ? void 0 : "gray", p;
|
|
4877
4935
|
t[0] !== n || t[1] !== c || t[2] !== r || t[3] !== i ? (p = () => {
|
|
4878
4936
|
if (c) {
|
|
4879
4937
|
i.actions.closeFilterPanel();
|
|
4880
4938
|
return;
|
|
4881
4939
|
}
|
|
4882
|
-
let e = r.getAllLeafColumns().find(
|
|
4883
|
-
e ?
|
|
4940
|
+
let e = r.getAllLeafColumns().find(wa);
|
|
4941
|
+
e ? Kr(n, e.id) : i.actions.openFilterPanel();
|
|
4884
4942
|
}, t[0] = n, t[1] = c, t[2] = r, t[3] = i, t[4] = p) : p = t[4];
|
|
4885
4943
|
let m;
|
|
4886
4944
|
t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ W(ae, {
|
|
@@ -4904,27 +4962,27 @@ function va() {
|
|
|
4904
4962
|
children: h
|
|
4905
4963
|
}), t[12] = o.filters, t[13] = h, t[14] = g) : g = t[14], g;
|
|
4906
4964
|
}
|
|
4907
|
-
function
|
|
4965
|
+
function wa(e) {
|
|
4908
4966
|
return e.getCanFilter();
|
|
4909
4967
|
}
|
|
4910
|
-
function
|
|
4968
|
+
function Ta(e) {
|
|
4911
4969
|
return _t(e.value);
|
|
4912
4970
|
}
|
|
4913
|
-
function
|
|
4971
|
+
function Ea(e) {
|
|
4914
4972
|
return e.columnFilters;
|
|
4915
4973
|
}
|
|
4916
|
-
function
|
|
4974
|
+
function Da(e) {
|
|
4917
4975
|
return e.filterPanelOpen;
|
|
4918
4976
|
}
|
|
4919
4977
|
//#endregion
|
|
4920
4978
|
//#region src/tmdatagrid/core/sizes.ts
|
|
4921
|
-
var
|
|
4979
|
+
var Oa = "md", ka = {
|
|
4922
4980
|
xs: 34,
|
|
4923
4981
|
sm: 42,
|
|
4924
4982
|
md: 52,
|
|
4925
4983
|
lg: 62,
|
|
4926
4984
|
xl: 72
|
|
4927
|
-
},
|
|
4985
|
+
}, Aa = {
|
|
4928
4986
|
xs: "xs",
|
|
4929
4987
|
sm: "xs",
|
|
4930
4988
|
md: "sm",
|
|
@@ -4933,8 +4991,8 @@ var Ca = "md", wa = {
|
|
|
4933
4991
|
};
|
|
4934
4992
|
//#endregion
|
|
4935
4993
|
//#region src/tmdatagrid/components/TMDataGrid.tsx
|
|
4936
|
-
function
|
|
4937
|
-
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 ??
|
|
4994
|
+
function ja(t) {
|
|
4995
|
+
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 ?? ka[b], S = Aa[b], C;
|
|
4938
4996
|
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 = {
|
|
4939
4997
|
table: r,
|
|
4940
4998
|
ui: i,
|
|
@@ -4969,28 +5027,28 @@ function Ea(t) {
|
|
|
4969
5027
|
children: D
|
|
4970
5028
|
}), n[24] = w, n[25] = D, n[26] = O) : O = n[26], O;
|
|
4971
5029
|
}
|
|
4972
|
-
var
|
|
4973
|
-
Toolbar:
|
|
4974
|
-
Spacer:
|
|
4975
|
-
SummaryCount:
|
|
4976
|
-
LoadingIndicator:
|
|
4977
|
-
Search:
|
|
4978
|
-
EditActions:
|
|
4979
|
-
ColumnsButton:
|
|
4980
|
-
FilterButton:
|
|
4981
|
-
Table:
|
|
4982
|
-
Footer:
|
|
4983
|
-
FilterPanel:
|
|
4984
|
-
FilterPills:
|
|
4985
|
-
ColumnsPanel:
|
|
5030
|
+
var Ma = Object.assign(ja, {
|
|
5031
|
+
Toolbar: _a,
|
|
5032
|
+
Spacer: va,
|
|
5033
|
+
SummaryCount: ba,
|
|
5034
|
+
LoadingIndicator: ya,
|
|
5035
|
+
Search: ii,
|
|
5036
|
+
EditActions: jn,
|
|
5037
|
+
ColumnsButton: xa,
|
|
5038
|
+
FilterButton: Ca,
|
|
5039
|
+
Table: ha,
|
|
5040
|
+
Footer: ri,
|
|
5041
|
+
FilterPanel: Vn,
|
|
5042
|
+
FilterPills: qr,
|
|
5043
|
+
ColumnsPanel: xn
|
|
4986
5044
|
});
|
|
4987
5045
|
//#endregion
|
|
4988
5046
|
//#region src/tmdatagrid/components/filters/DgRangeSliderFilter.tsx
|
|
4989
|
-
function
|
|
5047
|
+
function Na(t) {
|
|
4990
5048
|
let n = e(23), { column: r, operator: i, value: a, onChange: o, size: s, labels: c } = t;
|
|
4991
5049
|
if (!mt(i)) {
|
|
4992
5050
|
let e;
|
|
4993
|
-
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ W(
|
|
5051
|
+
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ W(Ln, { ...t }), n[0] = t, n[1] = e), e;
|
|
4994
5052
|
}
|
|
4995
5053
|
let l;
|
|
4996
5054
|
if (n[2] !== r) {
|
|
@@ -5032,11 +5090,11 @@ function Oa(t) {
|
|
|
5032
5090
|
}
|
|
5033
5091
|
//#endregion
|
|
5034
5092
|
//#region src/tmdatagrid/components/filters/DgDateRangeFilter.tsx
|
|
5035
|
-
function
|
|
5093
|
+
function Pa(t) {
|
|
5036
5094
|
let n = e(23), { operator: r, value: i, onChange: a, size: o, labels: s } = t;
|
|
5037
5095
|
if (!mt(r)) {
|
|
5038
5096
|
let e;
|
|
5039
|
-
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ W(
|
|
5097
|
+
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ W(Ln, { ...t }), n[0] = t, n[1] = e), e;
|
|
5040
5098
|
}
|
|
5041
5099
|
let c;
|
|
5042
5100
|
n[2] === i ? c = n[3] : (c = Array.isArray(i) ? [String(i[0] ?? ""), String(i[1] ?? "")] : ["", ""], n[2] = i, n[3] = c);
|
|
@@ -5072,16 +5130,16 @@ function ka(t) {
|
|
|
5072
5130
|
}
|
|
5073
5131
|
//#endregion
|
|
5074
5132
|
//#region src/tmdatagrid/components/filters/DgAutocompleteFilter.tsx
|
|
5075
|
-
function
|
|
5133
|
+
function Fa(t) {
|
|
5076
5134
|
let n = e(19), { column: r, table: i, operator: a, value: o, onChange: s, options: c, size: l, labels: d } = t;
|
|
5077
5135
|
if (pt(a) || mt(a)) {
|
|
5078
5136
|
let e;
|
|
5079
|
-
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ W(
|
|
5137
|
+
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ W(Ln, { ...t }), n[0] = t, n[1] = e), e;
|
|
5080
5138
|
}
|
|
5081
5139
|
let f;
|
|
5082
5140
|
n[2] === a ? f = n[3] : (f = ft(a), n[2] = a, n[3] = f);
|
|
5083
5141
|
let p = f, m;
|
|
5084
|
-
n[4] !== r || n[5] !== c || n[6] !== i ? (m = c.length > 0 ? c :
|
|
5142
|
+
n[4] !== r || n[5] !== c || n[6] !== i ? (m = c.length > 0 ? c : Fn({
|
|
5085
5143
|
table: i,
|
|
5086
5144
|
column: r,
|
|
5087
5145
|
fallback: "faceted"
|
|
@@ -5089,7 +5147,7 @@ function Aa(t) {
|
|
|
5089
5147
|
let h = m, g = d.filterValue, _;
|
|
5090
5148
|
n[8] === Symbol.for("react.memo_cache_sentinel") ? (_ = { withinPortal: !1 }, n[8] = _) : _ = n[8];
|
|
5091
5149
|
let v = !p, y = p ? d.filterValuePlaceholder : "", b;
|
|
5092
|
-
n[9] === h ? b = n[10] : (b = h.map(
|
|
5150
|
+
n[9] === h ? b = n[10] : (b = h.map(Ia), n[9] = h, n[10] = b);
|
|
5093
5151
|
let x = p && typeof o == "string" ? o : "", S;
|
|
5094
5152
|
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__ */ W(u, {
|
|
5095
5153
|
label: g,
|
|
@@ -5104,16 +5162,16 @@ function Aa(t) {
|
|
|
5104
5162
|
onChange: s
|
|
5105
5163
|
}), 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;
|
|
5106
5164
|
}
|
|
5107
|
-
function
|
|
5165
|
+
function Ia(e) {
|
|
5108
5166
|
return e.value;
|
|
5109
5167
|
}
|
|
5110
5168
|
//#endregion
|
|
5111
5169
|
//#region src/tmdatagrid/components/filters/DgTriStateFilter.tsx
|
|
5112
|
-
function
|
|
5170
|
+
function La(t) {
|
|
5113
5171
|
let n = e(26), { operator: r, value: i, onChange: a, size: o, labels: s } = t;
|
|
5114
5172
|
if (pt(r) || mt(r)) {
|
|
5115
5173
|
let e;
|
|
5116
|
-
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ W(
|
|
5174
|
+
return n[0] === t ? e = n[1] : (e = /* @__PURE__ */ W(Ln, { ...t }), n[0] = t, n[1] = e), e;
|
|
5117
5175
|
}
|
|
5118
5176
|
let c;
|
|
5119
5177
|
n[2] === r ? c = n[3] : (c = ft(r), n[2] = r, n[3] = c);
|
|
@@ -5157,7 +5215,7 @@ function Ma(t) {
|
|
|
5157
5215
|
}
|
|
5158
5216
|
//#endregion
|
|
5159
5217
|
//#region src/tmdatagrid/core/labelsSv.ts
|
|
5160
|
-
var
|
|
5218
|
+
var Ra = {
|
|
5161
5219
|
operators: {
|
|
5162
5220
|
contains: "innehåller",
|
|
5163
5221
|
equals: "är lika med",
|
|
@@ -5264,11 +5322,11 @@ var Na = {
|
|
|
5264
5322
|
};
|
|
5265
5323
|
//#endregion
|
|
5266
5324
|
//#region src/tmdatagrid/core/summary.ts
|
|
5267
|
-
function
|
|
5325
|
+
function za({ table: e, columnId: t, fn: n = "sum" }) {
|
|
5268
5326
|
let r = e.getFilteredRowModel().rows;
|
|
5269
5327
|
return be[n](t, r, r);
|
|
5270
5328
|
}
|
|
5271
5329
|
//#endregion
|
|
5272
|
-
export {
|
|
5330
|
+
export { cr as DATA_STATE_SLICES, Ji as DEFAULT_CELL_EXPORT_OPTIONS, Oa as DEFAULT_TMDATAGRID_SIZE, kt as DETAILS_COLUMN_ID, Fa as DgAutocompleteFilter, Pa as DgDateRangeFilter, Na as DgRangeSliderFilter, La as DgTriStateFilter, Bt as EDIT_COLUMN_ID, $e as FILTER_OPERATOR_LABELS, pn as GROUP_COLUMN_ID, ur as PERSIST_PAYLOAD_VERSION, Ut as ROW_NUMBER_COLUMN_ID, Xt as SELECT_COLUMN_ID, lr as SETTINGS_STATE_SLICES, Aa as SIZE_CONTROL_SIZE, ka as SIZE_ROW_HEIGHT, or as TMDATAGRID_LABELS_EN, Ra as TMDATAGRID_LABELS_SV, Ma as TMDataGrid, Di as TMDataGridBooleanEditor, Oi as TMDataGridDateEditor, jn as TMDataGridEditActions, qr as TMDataGridFilterPills, Ln as TMDataGridFilterValueInput, ki as TMDataGridMultiSelectEditor, Ai as TMDataGridNumberEditor, ii as TMDataGridSearch, ji as TMDataGridSelectEditor, Mi as TMDataGridStringEditor, za as aggregateColumn, Dt as areAllRowsExpanded, di as autosizeColumn, Gi as boundsCellCount, Ki as boundsEdges, Xi as buildCellMatrix, Zi as buildGridCellMatrix, Yn as clearedValueForType, Vr as createTMDataGridColumnHelper, ra as downloadTextFile, ht as emptyValueForOperator, Qi as exportGridToCsv, Yi as formatExportValue, vt as formatFilterLabel, gn as formatGroupValue, nr as fuzzyGlobalFilterFn, Nr as getColumnCapabilities, an as getColumnDefaultOperator, on as getColumnFilterControl, nn as getColumnLabel, fi as getColumnRegion, rn as getColumnType, dt as getDefaultOperator, Kt as getDisplayedRows, Jn as getEditFieldName, Pr as getGridCapabilities, Gt as getGroupDataRows, ut as getOperatorsForType, Jt as getSelectableRowIds, gi as getStepTargetColumn, Zr as getTMDataGridPaginationApi, cn as isColumnEditableForRow, dn as isColumnReorderable, un as isControlColumn, _t as isFilterActive, qt as isPagingActive, Rr as isSameCell, Wi as isWithinBounds, ui as measureColumnContentWidth, sr as mergeLabels, mi as moveColumn, _i as moveColumnByStep, er as normalizeFieldValidate, Kr as openColumnFilter, ft as operatorNeedsValue, pt as operatorTakesArrayValue, mt as operatorTakesRangeValue, In as optionsToComboboxData, Mr as readFeatureFlags, Ir as resolveCellMove, Fn as resolveColumnOptions, Ot as resolveExpandAll, Ui as resolveRangeBounds, Yt as resolveRowSelectionClick, Br as tmDataGridFeatures, ea as toClipboardText, ta as toExcelCsv, Z as useCellControlTabIndex, Gr as useTMDataGrid, X as useTMDataGridContext, na as writeClipboardText };
|
|
5273
5331
|
|
|
5274
5332
|
//# sourceMappingURL=index.js.map
|