@jielga/tmdatagrid 1.0.0 → 1.0.2
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/README.md +8 -8
- package/dist/index.d.ts +225 -225
- package/dist/index.js +58 -50
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -2
- package/skills/appearance/SKILL.md +322 -0
- package/skills/cell-selection/SKILL.md +240 -0
- package/skills/columns/SKILL.md +261 -86
- package/skills/data/SKILL.md +289 -0
- package/skills/editing/SKILL.md +492 -0
- package/skills/editing/references/editing-api.md +124 -0
- package/skills/editing/references/editors-and-validation.md +198 -0
- package/skills/filtering/SKILL.md +344 -0
- package/skills/getting-started/SKILL.md +48 -27
- package/skills/grouping/SKILL.md +264 -0
- package/skills/options/SKILL.md +31 -20
- package/skills/rows/SKILL.md +369 -0
- package/skills/rows/references/rows-api.md +117 -0
- package/skills/server-side/SKILL.md +7 -7
- package/skills/testing/SKILL.md +12 -12
- package/src/tmdatagrid/TMDataGridContext.ts +2 -2
- package/src/tmdatagrid/components/TMDataGrid.module.css +2 -2
- package/src/tmdatagrid/components/TMDataGrid.tsx +5 -5
- package/src/tmdatagrid/components/TMDataGridCellEditor.tsx +4 -4
- package/src/tmdatagrid/components/TMDataGridColumnsPanel.tsx +2 -2
- package/src/tmdatagrid/components/TMDataGridDetailsColumn.tsx +6 -6
- package/src/tmdatagrid/components/TMDataGridEditActions.tsx +2 -2
- package/src/tmdatagrid/components/TMDataGridEditColumn.tsx +4 -4
- package/src/tmdatagrid/components/TMDataGridEntryRows.tsx +6 -6
- package/src/tmdatagrid/components/TMDataGridFilterPanel.tsx +6 -6
- package/src/tmdatagrid/components/TMDataGridFilterPills.module.css +2 -2
- package/src/tmdatagrid/components/TMDataGridFilterPills.tsx +1 -1
- package/src/tmdatagrid/components/TMDataGridFooter.module.css +1 -1
- package/src/tmdatagrid/components/TMDataGridFooter.tsx +12 -6
- package/src/tmdatagrid/components/TMDataGridGroupColumn.module.css +1 -1
- package/src/tmdatagrid/components/TMDataGridGroupColumn.tsx +5 -5
- package/src/tmdatagrid/components/TMDataGridHeaderCell.module.css +8 -8
- package/src/tmdatagrid/components/TMDataGridHeaderCell.tsx +12 -12
- package/src/tmdatagrid/components/TMDataGridRowNumberColumn.tsx +4 -4
- package/src/tmdatagrid/components/TMDataGridSearch.tsx +5 -5
- package/src/tmdatagrid/components/TMDataGridSelectColumn.tsx +8 -8
- package/src/tmdatagrid/components/TMDataGridTable.module.css +18 -18
- package/src/tmdatagrid/components/TMDataGridTable.tsx +116 -116
- package/src/tmdatagrid/components/TMDataGridToolbar.tsx +5 -5
- package/src/tmdatagrid/components/editors/TMDataGridBooleanEditor.tsx +1 -1
- package/src/tmdatagrid/components/editors/TMDataGridDateEditor.tsx +2 -2
- package/src/tmdatagrid/components/editors/TMDataGridMultiSelectEditor.tsx +1 -1
- package/src/tmdatagrid/components/editors/TMDataGridNumberEditor.tsx +1 -1
- package/src/tmdatagrid/components/editors/TMDataGridSelectEditor.tsx +2 -2
- package/src/tmdatagrid/components/editors/editorShared.ts +3 -3
- package/src/tmdatagrid/components/filters/DgDateRangeFilter.tsx +1 -1
- package/src/tmdatagrid/components/filters/DgRangeSliderFilter.tsx +1 -1
- package/src/tmdatagrid/components/filters/DgTriStateFilter.tsx +1 -1
- package/src/tmdatagrid/components/filters/TMDataGridFilterValueInput.tsx +2 -2
- package/src/tmdatagrid/components/sticky.module.css +8 -8
- package/src/tmdatagrid/core/autosize.ts +4 -4
- package/src/tmdatagrid/core/capabilities.ts +17 -17
- package/src/tmdatagrid/core/cellExport.ts +13 -13
- package/src/tmdatagrid/core/cellNavigation.ts +6 -6
- package/src/tmdatagrid/core/cellRange.ts +4 -4
- package/src/tmdatagrid/core/columnOptions.ts +2 -2
- package/src/tmdatagrid/core/columnOrdering.ts +2 -2
- package/src/tmdatagrid/core/columnUtils.ts +3 -3
- package/src/tmdatagrid/core/editEngine.ts +49 -49
- package/src/tmdatagrid/core/expanding.ts +5 -5
- package/src/tmdatagrid/core/filterControls.ts +5 -5
- package/src/tmdatagrid/core/filterOperators.ts +14 -14
- package/src/tmdatagrid/core/labels.ts +8 -8
- package/src/tmdatagrid/core/matchHighlight.ts +4 -4
- package/src/tmdatagrid/core/persistence.ts +8 -8
- package/src/tmdatagrid/core/quickSearch.ts +8 -8
- package/src/tmdatagrid/core/rowPinning.ts +3 -3
- package/src/tmdatagrid/core/rowSelection.ts +12 -12
- package/src/tmdatagrid/core/sizes.ts +1 -1
- package/src/tmdatagrid/core/summary.ts +3 -3
- package/src/tmdatagrid/useTMDataGrid.tsx +79 -79
- package/skills/features/SKILL.md +0 -352
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Store as me, shallow as he } from "@tanstack/store";
|
|
|
9
9
|
import { aggregationFns as ge, columnFacetingFeature as _e, columnFilteringFeature as Y, columnGroupingFeature as X, columnOrderingFeature as ve, columnPinningFeature as ye, columnResizingFeature as Z, columnSizingFeature as be, columnVisibilityFeature as xe, createColumnHelper as Se, createExpandedRowModel as Ce, createFacetedMinMaxValues as we, createFacetedRowModel as Te, createFacetedUniqueValues as Ee, createFilteredRowModel as De, createGroupedRowModel as Oe, createPaginatedRowModel as ke, createSortedRowModel as Ae, filterFns as je, flexRender as Me, globalFilteringFeature as Ne, metaHelper as Pe, rowExpandingFeature as Fe, rowPaginationFeature as Ie, rowPinningFeature as Le, rowSelectionFeature as Re, rowSortingFeature as ze, sortFns as Be, tableFeatures as Ve, useTable as He } from "@tanstack/react-table";
|
|
10
10
|
import { compareItems as Ue, rankItem as We } from "@tanstack/match-sorter-utils";
|
|
11
11
|
import { useVirtualizer as Ge } from "@tanstack/react-virtual";
|
|
12
|
-
var Ke = { root: "
|
|
12
|
+
var Ke = { root: "_root_1e2oi_8" }, Q = {
|
|
13
13
|
columnsPanel: "_columnsPanel_1492o_1",
|
|
14
14
|
columnsPanelSearch: "_columnsPanelSearch_1492o_7",
|
|
15
15
|
columnsPanelList: "_columnsPanelList_1492o_11",
|
|
@@ -761,10 +761,10 @@ function rn(e) {
|
|
|
761
761
|
return e.columnDef.meta?.enableOrdering !== !1 && e.parent === void 0;
|
|
762
762
|
}
|
|
763
763
|
var an = {
|
|
764
|
-
groupToggle: "
|
|
765
|
-
chevron: "
|
|
766
|
-
groupLabel: "
|
|
767
|
-
groupCount: "
|
|
764
|
+
groupToggle: "_groupToggle_1954o_4",
|
|
765
|
+
chevron: "_chevron_1954o_14",
|
|
766
|
+
groupLabel: "_groupLabel_1954o_34",
|
|
767
|
+
groupCount: "_groupCount_1954o_44"
|
|
768
768
|
}, on = "__group__", sn = 16, cn = "(Blank)";
|
|
769
769
|
function ln(e, t = cn) {
|
|
770
770
|
return e == null || e === "" ? t : e instanceof Date ? e.toLocaleDateString() : String(e);
|
|
@@ -905,6 +905,7 @@ function mn() {
|
|
|
905
905
|
} else f = t[5], p = t[6], m = t[7], h = t[8], g = t[9], _ = t[10], v = t[11], y = t[12], b = t[13], S = t[14], C = t[15];
|
|
906
906
|
let w;
|
|
907
907
|
t[27] !== i || t[28] !== r || t[29] !== o || t[30] !== C.length ? (w = C.length === 0 && /* @__PURE__ */ q(T, {
|
|
908
|
+
span: !0,
|
|
908
909
|
size: i,
|
|
909
910
|
c: "dimmed",
|
|
910
911
|
children: r.columnsNoMatch(o)
|
|
@@ -1248,6 +1249,7 @@ function kn() {
|
|
|
1248
1249
|
}, t[26] = r.actions, t[27] = k);
|
|
1249
1250
|
let j;
|
|
1250
1251
|
t[28] !== s || t[29] !== a.filters ? (j = /* @__PURE__ */ q(T, {
|
|
1252
|
+
span: !0,
|
|
1251
1253
|
size: s,
|
|
1252
1254
|
fw: 600,
|
|
1253
1255
|
children: a.filters
|
|
@@ -1402,9 +1404,9 @@ function Nn(e) {
|
|
|
1402
1404
|
return e.filterPanelOpen;
|
|
1403
1405
|
}
|
|
1404
1406
|
var Pn = {
|
|
1405
|
-
filterPills: "
|
|
1406
|
-
pill: "
|
|
1407
|
-
pillLabel: "
|
|
1407
|
+
filterPills: "_filterPills_14wl0_3",
|
|
1408
|
+
pill: "_pill_14wl0_15",
|
|
1409
|
+
pillLabel: "_pillLabel_14wl0_27"
|
|
1408
1410
|
}, Fn = {
|
|
1409
1411
|
active: null,
|
|
1410
1412
|
openRowIds: [],
|
|
@@ -2211,7 +2213,7 @@ function Nr({ persist: e, labels: t, enableColumnOrdering: r, enablePagination:
|
|
|
2211
2213
|
i(() => {
|
|
2212
2214
|
W.current !== g && (W.current = g, re.cancelAll());
|
|
2213
2215
|
}, [g, re]), i(() => {
|
|
2214
|
-
g !== void 0 && D.getRowId === void 0 && console.error("TMDataGrid: editMode requires getRowId
|
|
2216
|
+
g !== void 0 && D.getRowId === void 0 && console.error("TMDataGrid: editMode requires getRowId - drafts are keyed by row id, and the index fallback names a different record after any sort or filter.");
|
|
2215
2217
|
}, []), i(() => {
|
|
2216
2218
|
if (!N) return;
|
|
2217
2219
|
let e = U.store.state.grouping, t = U.store.subscribe((t) => {
|
|
@@ -2419,7 +2421,7 @@ function Ir(e) {
|
|
|
2419
2421
|
function Lr(e) {
|
|
2420
2422
|
return e.columnFilters;
|
|
2421
2423
|
}
|
|
2422
|
-
var Rr = { footer: "
|
|
2424
|
+
var Rr = { footer: "_footer_te0a3_1" };
|
|
2423
2425
|
//#endregion
|
|
2424
2426
|
//#region src/tmdatagrid/components/TMDataGridFooter.tsx
|
|
2425
2427
|
function zr(e) {
|
|
@@ -2461,6 +2463,7 @@ function Br(t) {
|
|
|
2461
2463
|
n[5] !== s || n[6] !== o ? (d = Ut(o, s), n[5] = s, n[6] = o, n[7] = d) : d = n[7];
|
|
2462
2464
|
let p = d, { pageIndex: m, pageSize: h } = o.store.state.pagination, g = o.getRowCount(), _ = g === 0 ? 0 : m * h + 1, v = Math.min(g, (m + 1) * h), y = a.includes(h) ? a : [...a, h].sort(Vr), b = D, x = l.pagingSuspendedHint, S = Rr, w = !p, E;
|
|
2463
2465
|
n[8] !== u || n[9] !== l.rowsPerPage ? (E = /* @__PURE__ */ q(T, {
|
|
2466
|
+
span: !0,
|
|
2464
2467
|
size: u,
|
|
2465
2468
|
c: "dimmed",
|
|
2466
2469
|
children: l.rowsPerPage
|
|
@@ -2495,6 +2498,7 @@ function Br(t) {
|
|
|
2495
2498
|
total: g
|
|
2496
2499
|
}) : l.groupedAllRows(o.getFilteredRowModel().rows.length), I;
|
|
2497
2500
|
n[25] !== F || n[26] !== u || n[27] !== ee ? (I = /* @__PURE__ */ q(F, {
|
|
2501
|
+
span: !0,
|
|
2498
2502
|
size: u,
|
|
2499
2503
|
c: "dimmed",
|
|
2500
2504
|
"data-dg-part": "page-range",
|
|
@@ -2629,47 +2633,47 @@ function Ur(e) {
|
|
|
2629
2633
|
return typeof e.globalFilter == "string" ? e.globalFilter : "";
|
|
2630
2634
|
}
|
|
2631
2635
|
var Wr = {
|
|
2632
|
-
tableWrapper: "
|
|
2633
|
-
scrollContainer: "
|
|
2634
|
-
grid: "
|
|
2635
|
-
headerRow: "
|
|
2636
|
-
"dg-header-shadow": "_dg-header-
|
|
2637
|
-
bodyRow: "
|
|
2638
|
-
bodyCell: "
|
|
2639
|
-
cellContent: "
|
|
2640
|
-
cellEditor: "
|
|
2641
|
-
cellEditorActions: "
|
|
2642
|
-
detailsCell: "
|
|
2643
|
-
messageRow: "
|
|
2644
|
-
entryBlock: "
|
|
2645
|
-
entryRow: "
|
|
2646
|
-
pinnedTopBlock: "
|
|
2647
|
-
pinnedBottomBlock: "
|
|
2648
|
-
entryCell: "
|
|
2649
|
-
matchHighlight: "
|
|
2650
|
-
summaryRow: "
|
|
2651
|
-
summaryCell: "
|
|
2636
|
+
tableWrapper: "_tableWrapper_15qzd_2",
|
|
2637
|
+
scrollContainer: "_scrollContainer_15qzd_10",
|
|
2638
|
+
grid: "_grid_15qzd_21",
|
|
2639
|
+
headerRow: "_headerRow_15qzd_27",
|
|
2640
|
+
"dg-header-shadow": "_dg-header-shadow_15qzd_1",
|
|
2641
|
+
bodyRow: "_bodyRow_15qzd_76",
|
|
2642
|
+
bodyCell: "_bodyCell_15qzd_143",
|
|
2643
|
+
cellContent: "_cellContent_15qzd_141",
|
|
2644
|
+
cellEditor: "_cellEditor_15qzd_243",
|
|
2645
|
+
cellEditorActions: "_cellEditorActions_15qzd_252",
|
|
2646
|
+
detailsCell: "_detailsCell_15qzd_303",
|
|
2647
|
+
messageRow: "_messageRow_15qzd_15",
|
|
2648
|
+
entryBlock: "_entryBlock_15qzd_347",
|
|
2649
|
+
entryRow: "_entryRow_15qzd_356",
|
|
2650
|
+
pinnedTopBlock: "_pinnedTopBlock_15qzd_369",
|
|
2651
|
+
pinnedBottomBlock: "_pinnedBottomBlock_15qzd_382",
|
|
2652
|
+
entryCell: "_entryCell_15qzd_395",
|
|
2653
|
+
matchHighlight: "_matchHighlight_15qzd_422",
|
|
2654
|
+
summaryRow: "_summaryRow_15qzd_434",
|
|
2655
|
+
summaryCell: "_summaryCell_15qzd_443"
|
|
2652
2656
|
}, Gr = {
|
|
2653
|
-
stickyLeft: "
|
|
2654
|
-
stickyRight: "
|
|
2655
|
-
stickyEdgeIn: "
|
|
2656
|
-
stickyEdgeOut: "
|
|
2657
|
+
stickyLeft: "_stickyLeft_1vw51_16",
|
|
2658
|
+
stickyRight: "_stickyRight_1vw51_17",
|
|
2659
|
+
stickyEdgeIn: "_stickyEdgeIn_1vw51_1",
|
|
2660
|
+
stickyEdgeOut: "_stickyEdgeOut_1vw51_1"
|
|
2657
2661
|
}, Kr = {
|
|
2658
|
-
headerCell: "
|
|
2659
|
-
headerCellFiltered: "
|
|
2660
|
-
headerTitle: "
|
|
2661
|
-
headerActions: "
|
|
2662
|
-
headerAction: "
|
|
2663
|
-
headerCellSortable: "
|
|
2664
|
-
sortAction: "
|
|
2665
|
-
sortIndex: "
|
|
2666
|
-
headerCellDragging: "
|
|
2667
|
-
headerCellDropBefore: "
|
|
2668
|
-
headerCellDropAfter: "
|
|
2669
|
-
columnSeparator: "
|
|
2670
|
-
columnSeparatorResizable: "
|
|
2671
|
-
columnSeparatorActive: "
|
|
2672
|
-
menuItemActive: "
|
|
2662
|
+
headerCell: "_headerCell_188ed_1",
|
|
2663
|
+
headerCellFiltered: "_headerCellFiltered_188ed_35",
|
|
2664
|
+
headerTitle: "_headerTitle_188ed_35",
|
|
2665
|
+
headerActions: "_headerActions_188ed_58",
|
|
2666
|
+
headerAction: "_headerAction_188ed_58",
|
|
2667
|
+
headerCellSortable: "_headerCellSortable_188ed_87",
|
|
2668
|
+
sortAction: "_sortAction_188ed_93",
|
|
2669
|
+
sortIndex: "_sortIndex_188ed_103",
|
|
2670
|
+
headerCellDragging: "_headerCellDragging_188ed_115",
|
|
2671
|
+
headerCellDropBefore: "_headerCellDropBefore_188ed_119",
|
|
2672
|
+
headerCellDropAfter: "_headerCellDropAfter_188ed_120",
|
|
2673
|
+
columnSeparator: "_columnSeparator_188ed_140",
|
|
2674
|
+
columnSeparatorResizable: "_columnSeparatorResizable_188ed_152",
|
|
2675
|
+
columnSeparatorActive: "_columnSeparatorActive_188ed_175",
|
|
2676
|
+
menuItemActive: "_menuItemActive_188ed_181"
|
|
2673
2677
|
}, qr = 30, Jr = 2;
|
|
2674
2678
|
function Yr(e) {
|
|
2675
2679
|
let t = document.createRange();
|
|
@@ -4060,7 +4064,7 @@ function ea({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4060
4064
|
}));
|
|
4061
4065
|
let ge = o(null), _e = o(!1), Y = pe.at(-1)?.index ?? -1;
|
|
4062
4066
|
i(() => {
|
|
4063
|
-
S === void 0 || W.length === 0 || (j.pagination && !_e.current && (_e.current = !0, console.warn("TMDataGrid: onReachEnd and pagination slice the same scroll
|
|
4067
|
+
S === void 0 || W.length === 0 || (j.pagination && !_e.current && (_e.current = !0, console.warn("TMDataGrid: onReachEnd and pagination slice the same scroll - the pager caps the rows, so the end it reaches is the page's. Use one or the other.")), !(Y < W.length - 1 - C) && ge.current !== W.length && (ge.current = W.length, S()));
|
|
4064
4068
|
});
|
|
4065
4069
|
let X = D.getLeftVisibleLeafColumns(), ve = D.getRightVisibleLeafColumns(), ye = D.getCenterVisibleLeafColumns(), Z = [
|
|
4066
4070
|
...X,
|
|
@@ -4603,10 +4607,12 @@ function ea({ onRowClick: e, onCellClick: t, onCellDoubleClick: r, onCellContext
|
|
|
4603
4607
|
stroke: 1.4,
|
|
4604
4608
|
opacity: .4
|
|
4605
4609
|
}), /* @__PURE__ */ q(T, {
|
|
4610
|
+
span: !0,
|
|
4606
4611
|
size: P,
|
|
4607
4612
|
c: "dimmed",
|
|
4608
4613
|
children: ne
|
|
4609
4614
|
})] }) : /* @__PURE__ */ q(T, {
|
|
4615
|
+
span: !0,
|
|
4610
4616
|
size: P,
|
|
4611
4617
|
c: "dimmed",
|
|
4612
4618
|
children: M.noRows
|
|
@@ -4684,6 +4690,7 @@ function aa(t) {
|
|
|
4684
4690
|
if (A(i.store), r !== void 0) {
|
|
4685
4691
|
let e;
|
|
4686
4692
|
return n[0] !== r || n[1] !== a ? (e = /* @__PURE__ */ q(T, {
|
|
4693
|
+
span: !0,
|
|
4687
4694
|
size: a,
|
|
4688
4695
|
c: "dimmed",
|
|
4689
4696
|
"data-dg-part": "summary-count",
|
|
@@ -4696,6 +4703,7 @@ function aa(t) {
|
|
|
4696
4703
|
n[5] === i ? c = n[6] : (c = i.options.meta?.totalRowCount ?? i.getPreFilteredRowModel().rows.length, n[5] = i, n[6] = c);
|
|
4697
4704
|
let l = c, u;
|
|
4698
4705
|
return n[7] !== a || n[8] !== s || n[9] !== l ? (u = /* @__PURE__ */ J(T, {
|
|
4706
|
+
span: !0,
|
|
4699
4707
|
size: a,
|
|
4700
4708
|
c: "dimmed",
|
|
4701
4709
|
"data-dg-part": "summary-count",
|