@jielga/tmdatagrid 0.3.0 → 0.5.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 +947 -64
- package/dist/index.js +2474 -1423
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
- package/skills/columns/SKILL.md +1 -1
- package/skills/features/SKILL.md +61 -11
- package/skills/getting-started/SKILL.md +1 -1
- package/skills/options/SKILL.md +12 -2
- package/skills/server-side/SKILL.md +1 -1
- package/src/tmdatagrid/TMDataGridContext.ts +26 -0
- package/src/tmdatagrid/components/TMDataGrid.module.css +10 -0
- package/src/tmdatagrid/components/TMDataGrid.tsx +23 -1
- package/src/tmdatagrid/components/TMDataGridColumnsPanel.tsx +5 -5
- package/src/tmdatagrid/components/TMDataGridDetailsColumn.module.css +33 -0
- package/src/tmdatagrid/components/TMDataGridDetailsColumn.tsx +160 -0
- package/src/tmdatagrid/components/TMDataGridFilterPanel.tsx +111 -33
- package/src/tmdatagrid/components/TMDataGridFilterPills.tsx +5 -4
- package/src/tmdatagrid/components/TMDataGridFooter.tsx +11 -19
- package/src/tmdatagrid/components/TMDataGridGroupColumn.tsx +23 -11
- package/src/tmdatagrid/components/TMDataGridHeaderCell.module.css +15 -3
- package/src/tmdatagrid/components/TMDataGridHeaderCell.tsx +181 -52
- package/src/tmdatagrid/components/TMDataGridSearch.tsx +122 -0
- package/src/tmdatagrid/components/TMDataGridSelectColumn.tsx +23 -13
- package/src/tmdatagrid/components/TMDataGridTable.module.css +127 -6
- package/src/tmdatagrid/components/TMDataGridTable.tsx +1003 -30
- package/src/tmdatagrid/components/TMDataGridToolbar.tsx +30 -7
- package/src/tmdatagrid/components/icons.ts +1 -0
- package/src/tmdatagrid/components/sticky.module.css +77 -16
- package/src/tmdatagrid/core/autosize.ts +125 -0
- package/src/tmdatagrid/core/capabilities.ts +41 -0
- package/src/tmdatagrid/core/cellExport.ts +321 -0
- package/src/tmdatagrid/core/cellNavigation.ts +103 -0
- package/src/tmdatagrid/core/cellRange.ts +118 -0
- package/src/tmdatagrid/core/columnOptions.ts +123 -0
- package/src/tmdatagrid/core/columnUtils.ts +18 -0
- package/src/tmdatagrid/core/expanding.ts +93 -0
- package/src/tmdatagrid/core/filterOperators.ts +176 -15
- package/src/tmdatagrid/core/labels.ts +211 -0
- package/src/tmdatagrid/core/labelsSv.ts +108 -0
- package/src/tmdatagrid/core/summary.ts +35 -0
- package/src/tmdatagrid/index.ts +70 -0
- package/src/tmdatagrid/useTMDataGrid.tsx +328 -12
package/dist/index.js
CHANGED
|
@@ -1,134 +1,397 @@
|
|
|
1
1
|
import { c as e } from "react/compiler-runtime";
|
|
2
|
-
import { createContext as t, useCallback as n, useContext as r, useEffect as i,
|
|
3
|
-
import { ActionIcon as
|
|
4
|
-
import { useCreateStore as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { aggregationFns as
|
|
9
|
-
import { useVirtualizer as
|
|
10
|
-
var
|
|
2
|
+
import { createContext as t, useCallback as n, useContext as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
3
|
+
import { ActionIcon as c, Button as l, Checkbox as u, Group as d, Loader as f, Menu as p, MultiSelect as m, Pill as h, Popover as g, ScrollArea as _, Select as v, Stack as y, Text as b, TextInput as x, Tooltip as S, UnstyledButton as C } from "@mantine/core";
|
|
4
|
+
import { useCreateStore as w, useSelector as T } from "@tanstack/react-store";
|
|
5
|
+
import { IconArrowAutofitWidth as E, IconArrowBarToLeft as D, IconArrowBarToRight as O, IconArrowDown as k, IconArrowLeft as A, IconArrowRight as j, IconArrowUp as M, IconChevronLeft as N, IconChevronRight as P, IconColumns3 as F, IconDotsVertical as I, IconEyeOff as ee, IconFilter as te, IconFoldDown as ne, IconFoldUp as L, IconIndentDecrease as R, IconIndentIncrease as re, IconMenu2 as z, IconPinnedOff as ie, IconSearch as B, IconX as V } from "@tabler/icons-react";
|
|
6
|
+
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
7
|
+
import { shallow as ae } from "@tanstack/store";
|
|
8
|
+
import { aggregationFns as G, columnFacetingFeature as oe, columnFilteringFeature as se, columnGroupingFeature as ce, columnOrderingFeature as le, columnPinningFeature as ue, columnResizingFeature as de, columnSizingFeature as fe, columnVisibilityFeature as pe, createColumnHelper as me, createExpandedRowModel as he, createFacetedMinMaxValues as ge, createFacetedRowModel as _e, createFacetedUniqueValues as ve, createFilteredRowModel as ye, createGroupedRowModel as be, createPaginatedRowModel as K, createSortedRowModel as q, filterFns as J, flexRender as xe, globalFilteringFeature as Se, metaHelper as Ce, rowExpandingFeature as Y, rowPaginationFeature as we, rowSelectionFeature as Te, rowSortingFeature as Ee, sortFns as De, tableFeatures as Oe, useTable as ke } from "@tanstack/react-table";
|
|
9
|
+
import { useVirtualizer as Ae } from "@tanstack/react-virtual";
|
|
10
|
+
var je = { root: "_root_qequm_8" }, X = {
|
|
11
11
|
columnsPanel: "_columnsPanel_1492o_1",
|
|
12
12
|
columnsPanelSearch: "_columnsPanelSearch_1492o_7",
|
|
13
13
|
columnsPanelList: "_columnsPanelList_1492o_11",
|
|
14
14
|
columnsPanelFooter: "_columnsPanelFooter_1492o_18"
|
|
15
|
-
},
|
|
16
|
-
function
|
|
17
|
-
let e = r(
|
|
15
|
+
}, Me = t(null), Ne = Me.Provider;
|
|
16
|
+
function Z() {
|
|
17
|
+
let e = r(Me);
|
|
18
18
|
if (!e) throw Error("TMDataGrid compound components must be rendered inside <TMDataGrid>");
|
|
19
19
|
return e;
|
|
20
20
|
}
|
|
21
|
+
function Pe() {
|
|
22
|
+
let { features: e } = Z();
|
|
23
|
+
return e.cellSelection ? -1 : 0;
|
|
24
|
+
}
|
|
25
|
+
var Fe = {
|
|
26
|
+
detailsToggle: "_detailsToggle_n39tz_3",
|
|
27
|
+
chevron: "_chevron_n39tz_12"
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/tmdatagrid/core/expanding.ts
|
|
31
|
+
function Ie(e, t) {
|
|
32
|
+
return t === "groups" ? e.getIsGrouped() : !e.getIsGrouped();
|
|
33
|
+
}
|
|
34
|
+
function Le(e, t) {
|
|
35
|
+
if (t !== !0) return { ...t };
|
|
36
|
+
let n = {};
|
|
37
|
+
for (let t of e) n[t.id] = !0;
|
|
38
|
+
return n;
|
|
39
|
+
}
|
|
40
|
+
function Re({ rows: e, expanded: t, target: n }) {
|
|
41
|
+
let r = !1;
|
|
42
|
+
for (let i of e) if (Ie(i, n) && (r = !0, t !== !0 && t[i.id] !== !0)) return !1;
|
|
43
|
+
return r;
|
|
44
|
+
}
|
|
45
|
+
function ze({ rows: e, expanded: t, target: n, expand: r }) {
|
|
46
|
+
let i = Le(e, t);
|
|
47
|
+
for (let t of e) Ie(t, n) && (r ? i[t.id] = !0 : delete i[t.id]);
|
|
48
|
+
return i;
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/tmdatagrid/components/TMDataGridDetailsColumn.tsx
|
|
52
|
+
var Be = "__details__";
|
|
53
|
+
function Ve(t) {
|
|
54
|
+
let n = e(13), { row: r } = t, { labels: i } = Z(), a;
|
|
55
|
+
n[0] === r ? a = n[1] : (a = () => r.getIsExpanded(), n[0] = r, n[1] = a);
|
|
56
|
+
let o = T(r.table.store, a), s = Pe();
|
|
57
|
+
if (r.getIsGrouped()) return null;
|
|
58
|
+
let c = o ? i.hideDetails : i.showDetails, l;
|
|
59
|
+
n[2] === r ? l = n[3] : (l = (e) => {
|
|
60
|
+
e.stopPropagation(), r.toggleExpanded();
|
|
61
|
+
}, n[2] = r, n[3] = l);
|
|
62
|
+
let u;
|
|
63
|
+
n[4] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ U(P, {
|
|
64
|
+
size: 16,
|
|
65
|
+
stroke: 1.6
|
|
66
|
+
}), n[4] = u) : u = n[4];
|
|
67
|
+
let d;
|
|
68
|
+
n[5] === o ? d = n[6] : (d = /* @__PURE__ */ U("span", {
|
|
69
|
+
className: Fe.chevron,
|
|
70
|
+
"data-expanded": o,
|
|
71
|
+
children: u
|
|
72
|
+
}), n[5] = o, n[6] = d);
|
|
73
|
+
let f;
|
|
74
|
+
return n[7] !== o || n[8] !== c || n[9] !== l || n[10] !== d || n[11] !== s ? (f = /* @__PURE__ */ U(C, {
|
|
75
|
+
className: Fe.detailsToggle,
|
|
76
|
+
tabIndex: s,
|
|
77
|
+
"aria-expanded": o,
|
|
78
|
+
"aria-label": c,
|
|
79
|
+
onClick: l,
|
|
80
|
+
children: d
|
|
81
|
+
}), n[7] = o, n[8] = c, n[9] = l, n[10] = d, n[11] = s, n[12] = f) : f = n[12], f;
|
|
82
|
+
}
|
|
83
|
+
function He(t) {
|
|
84
|
+
let n = e(16), { table: r } = t, { labels: i } = Z(), a;
|
|
85
|
+
n[0] === r ? a = n[1] : (a = () => r.getPrePaginatedRowModel().flatRows, n[0] = r, n[1] = a);
|
|
86
|
+
let o = a, s;
|
|
87
|
+
n[2] === o ? s = n[3] : (s = (e) => Re({
|
|
88
|
+
rows: o(),
|
|
89
|
+
expanded: e.expanded,
|
|
90
|
+
target: "details"
|
|
91
|
+
}), n[2] = o, n[3] = s);
|
|
92
|
+
let c = T(r.store, s), l = c ? i.collapseAllDetails : i.expandAllDetails, u;
|
|
93
|
+
n[4] !== c || n[5] !== o || n[6] !== r ? (u = () => r.setExpanded(ze({
|
|
94
|
+
rows: o(),
|
|
95
|
+
expanded: r.store.state.expanded,
|
|
96
|
+
target: "details",
|
|
97
|
+
expand: !c
|
|
98
|
+
})), n[4] = c, n[5] = o, n[6] = r, n[7] = u) : u = n[7];
|
|
99
|
+
let d;
|
|
100
|
+
n[8] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ U(P, {
|
|
101
|
+
size: 16,
|
|
102
|
+
stroke: 1.6
|
|
103
|
+
}), n[8] = d) : d = n[8];
|
|
104
|
+
let f;
|
|
105
|
+
n[9] === c ? f = n[10] : (f = /* @__PURE__ */ U("span", {
|
|
106
|
+
className: Fe.chevron,
|
|
107
|
+
"data-expanded": c,
|
|
108
|
+
children: d
|
|
109
|
+
}), n[9] = c, n[10] = f);
|
|
110
|
+
let p;
|
|
111
|
+
return n[11] !== c || n[12] !== l || n[13] !== u || n[14] !== f ? (p = /* @__PURE__ */ U(C, {
|
|
112
|
+
className: Fe.detailsToggle,
|
|
113
|
+
"aria-expanded": c,
|
|
114
|
+
"aria-label": l,
|
|
115
|
+
onClick: u,
|
|
116
|
+
children: f
|
|
117
|
+
}), n[11] = c, n[12] = l, n[13] = u, n[14] = f, n[15] = p) : p = n[15], p;
|
|
118
|
+
}
|
|
119
|
+
function Ue(e = "Details") {
|
|
120
|
+
return {
|
|
121
|
+
id: Be,
|
|
122
|
+
meta: {
|
|
123
|
+
label: e,
|
|
124
|
+
align: "center",
|
|
125
|
+
enableOrdering: !1
|
|
126
|
+
},
|
|
127
|
+
size: 36,
|
|
128
|
+
minSize: 36,
|
|
129
|
+
maxSize: 36,
|
|
130
|
+
enableResizing: !1,
|
|
131
|
+
enableSorting: !1,
|
|
132
|
+
enableColumnFilter: !1,
|
|
133
|
+
enableGlobalFilter: !1,
|
|
134
|
+
enableHiding: !1,
|
|
135
|
+
enablePinning: !1,
|
|
136
|
+
header: ({ table: e }) => /* @__PURE__ */ U(He, { table: e }),
|
|
137
|
+
cell: ({ row: e }) => /* @__PURE__ */ U(Ve, { row: e })
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region src/tmdatagrid/core/grouping.ts
|
|
142
|
+
function We(e) {
|
|
143
|
+
return e.subRows.length === 0 ? [e] : e.getLeafRows().filter((e) => e.subRows.length === 0);
|
|
144
|
+
}
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region src/tmdatagrid/core/rowSelection.ts
|
|
147
|
+
function Ge(e, t) {
|
|
148
|
+
return Ke(e, t) ? e.getPaginatedRowModel().rows : e.getPrePaginatedRowModel().rows;
|
|
149
|
+
}
|
|
150
|
+
function Ke(e, t) {
|
|
151
|
+
return t.pagination && e.store.state.grouping.length === 0;
|
|
152
|
+
}
|
|
153
|
+
function qe(e) {
|
|
154
|
+
return We(e).filter((e) => e.getCanSelect()).map((e) => e.id);
|
|
155
|
+
}
|
|
156
|
+
function Je({ rows: e, rowId: t, anchorRowId: n, modifiers: r, selection: i, canReplaceSelection: a }) {
|
|
157
|
+
let o = e.findIndex((e) => e.id === t), s = e[o];
|
|
158
|
+
if (o === -1 || s === void 0) return {
|
|
159
|
+
selection: i,
|
|
160
|
+
anchorRowId: n
|
|
161
|
+
};
|
|
162
|
+
let c = qe(s);
|
|
163
|
+
if (c.length === 0) return {
|
|
164
|
+
selection: i,
|
|
165
|
+
anchorRowId: n
|
|
166
|
+
};
|
|
167
|
+
if (!s.getCanMultiSelect()) {
|
|
168
|
+
let e = c.length === 1 ? c[0] : void 0;
|
|
169
|
+
return e === void 0 ? {
|
|
170
|
+
selection: i,
|
|
171
|
+
anchorRowId: n
|
|
172
|
+
} : {
|
|
173
|
+
selection: !a && i[e] === !0 ? {} : { [e]: !0 },
|
|
174
|
+
anchorRowId: t
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
let l = n === null ? -1 : e.findIndex((e) => e.id === n);
|
|
178
|
+
if (r.extend && l !== -1) {
|
|
179
|
+
let t = Math.min(l, o), s = Math.max(l, o), c = r.toggle || !a ? { ...i } : {};
|
|
180
|
+
for (let n of e.slice(t, s + 1)) for (let e of qe(n)) c[e] = !0;
|
|
181
|
+
return {
|
|
182
|
+
selection: c,
|
|
183
|
+
anchorRowId: n
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
if (r.toggle || !a) {
|
|
187
|
+
let e = { ...i }, n = c.every((e) => i[e] === !0);
|
|
188
|
+
for (let t of c) n ? delete e[t] : e[t] = !0;
|
|
189
|
+
return {
|
|
190
|
+
selection: e,
|
|
191
|
+
anchorRowId: t
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
let u = {};
|
|
195
|
+
for (let e of c) u[e] = !0;
|
|
196
|
+
return {
|
|
197
|
+
selection: u,
|
|
198
|
+
anchorRowId: t
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
//#region src/tmdatagrid/components/TMDataGridSelectColumn.tsx
|
|
203
|
+
var Q = "__select__";
|
|
204
|
+
function Ye(t) {
|
|
205
|
+
let n = e(11), { table: r } = t, { labels: i } = Z(), a;
|
|
206
|
+
n[0] === r ? a = n[1] : (a = () => r.getIsAllRowsSelected(), n[0] = r, n[1] = a);
|
|
207
|
+
let o = T(r.store, a), s;
|
|
208
|
+
n[2] === r ? s = n[3] : (s = () => r.getIsSomeRowsSelected(), n[2] = r, n[3] = s);
|
|
209
|
+
let c = T(r.store, s), l = i.selectAllRows, d = c && !o, f;
|
|
210
|
+
n[4] === r ? f = n[5] : (f = r.getToggleAllRowsSelectedHandler(), n[4] = r, n[5] = f);
|
|
211
|
+
let p;
|
|
212
|
+
return n[6] !== o || n[7] !== i.selectAllRows || n[8] !== d || n[9] !== f ? (p = /* @__PURE__ */ U(u, {
|
|
213
|
+
size: "xs",
|
|
214
|
+
"aria-label": l,
|
|
215
|
+
checked: o,
|
|
216
|
+
indeterminate: d,
|
|
217
|
+
onChange: f
|
|
218
|
+
}), n[6] = o, n[7] = i.selectAllRows, n[8] = d, n[9] = f, n[10] = p) : p = n[10], p;
|
|
219
|
+
}
|
|
220
|
+
function Xe(t) {
|
|
221
|
+
let n = e(2), { table: r } = t, { features: i } = Z();
|
|
222
|
+
if (!i.multiRowSelection) return null;
|
|
223
|
+
let a;
|
|
224
|
+
return n[0] === r ? a = n[1] : (a = /* @__PURE__ */ U(Ye, { table: r }), n[0] = r, n[1] = a), a;
|
|
225
|
+
}
|
|
226
|
+
function Ze(t) {
|
|
227
|
+
let n = e(20), { row: r } = t, { ui: i, features: a, labels: o } = Z(), s = Pe(), c = r.subRows.length > 0, l;
|
|
228
|
+
n[0] !== c || n[1] !== r ? (l = () => c ? r.getIsAllSubRowsSelected() : r.getIsSelected(), n[0] = c, n[1] = r, n[2] = l) : l = n[2];
|
|
229
|
+
let d = T(r.table.store, l), f;
|
|
230
|
+
n[3] === r ? f = n[4] : (f = () => r.getIsSomeSelected(), n[3] = r, n[4] = f);
|
|
231
|
+
let p = T(r.table.store, f), m;
|
|
232
|
+
n[5] === r ? m = n[6] : (m = qe(r), n[5] = r, n[6] = m);
|
|
233
|
+
let h = m;
|
|
234
|
+
if (c && !r.getCanMultiSelect()) return null;
|
|
235
|
+
let g = c ? o.selectGroup : o.selectRow, _ = h.length === 0, v = p && !d, y;
|
|
236
|
+
n[7] !== a || n[8] !== r.id || n[9] !== r.table || n[10] !== i.actions || n[11] !== i.state.selectionAnchorRowId ? (y = (e) => {
|
|
237
|
+
let t = e.nativeEvent, n = t instanceof MouseEvent, o = Je({
|
|
238
|
+
rows: Ge(r.table, a),
|
|
239
|
+
rowId: r.id,
|
|
240
|
+
anchorRowId: i.state.selectionAnchorRowId,
|
|
241
|
+
modifiers: {
|
|
242
|
+
toggle: n && (t.ctrlKey || t.metaKey),
|
|
243
|
+
extend: n && t.shiftKey
|
|
244
|
+
},
|
|
245
|
+
selection: r.table.store.state.rowSelection,
|
|
246
|
+
canReplaceSelection: !1
|
|
247
|
+
});
|
|
248
|
+
r.table.setRowSelection(o.selection), i.actions.setSelectionAnchor(o.anchorRowId);
|
|
249
|
+
}, n[7] = a, n[8] = r.id, n[9] = r.table, n[10] = i.actions, n[11] = i.state.selectionAnchorRowId, n[12] = y) : y = n[12];
|
|
250
|
+
let b;
|
|
251
|
+
return n[13] !== d || n[14] !== g || n[15] !== _ || n[16] !== v || n[17] !== y || n[18] !== s ? (b = /* @__PURE__ */ U(u, {
|
|
252
|
+
size: "xs",
|
|
253
|
+
tabIndex: s,
|
|
254
|
+
"aria-label": g,
|
|
255
|
+
checked: d,
|
|
256
|
+
disabled: _,
|
|
257
|
+
indeterminate: v,
|
|
258
|
+
onChange: y,
|
|
259
|
+
onClick: Qe
|
|
260
|
+
}), n[13] = d, n[14] = g, n[15] = _, n[16] = v, n[17] = y, n[18] = s, n[19] = b) : b = n[19], b;
|
|
261
|
+
}
|
|
262
|
+
function Qe(e) {
|
|
263
|
+
return e.stopPropagation();
|
|
264
|
+
}
|
|
265
|
+
function $e(e = "Checkbox selection") {
|
|
266
|
+
return {
|
|
267
|
+
id: Q,
|
|
268
|
+
meta: {
|
|
269
|
+
label: e,
|
|
270
|
+
align: "center",
|
|
271
|
+
enableOrdering: !1
|
|
272
|
+
},
|
|
273
|
+
size: 36,
|
|
274
|
+
minSize: 36,
|
|
275
|
+
maxSize: 36,
|
|
276
|
+
enableResizing: !1,
|
|
277
|
+
enableSorting: !1,
|
|
278
|
+
enableColumnFilter: !1,
|
|
279
|
+
enableGlobalFilter: !1,
|
|
280
|
+
enablePinning: !1,
|
|
281
|
+
header: ({ table: e }) => /* @__PURE__ */ U(Xe, { table: e }),
|
|
282
|
+
cell: ({ row: e }) => /* @__PURE__ */ U(Ze, { row: e }),
|
|
283
|
+
aggregatedCell: ({ row: e }) => /* @__PURE__ */ U(Ze, { row: e })
|
|
284
|
+
};
|
|
285
|
+
}
|
|
21
286
|
//#endregion
|
|
22
287
|
//#region src/tmdatagrid/core/columnUtils.ts
|
|
23
|
-
function
|
|
288
|
+
function et(e) {
|
|
24
289
|
let t = e.columnDef.meta?.label;
|
|
25
290
|
if (t) return t;
|
|
26
291
|
let n = e.columnDef.header;
|
|
27
292
|
return typeof n == "string" ? n : e.id;
|
|
28
293
|
}
|
|
29
|
-
function
|
|
294
|
+
function tt(e) {
|
|
30
295
|
return e.columnDef.meta?.type ?? "string";
|
|
31
296
|
}
|
|
32
|
-
function
|
|
297
|
+
function nt(e) {
|
|
33
298
|
return e.columnDef.meta?.align ?? "left";
|
|
34
299
|
}
|
|
35
|
-
function
|
|
300
|
+
function rt(e) {
|
|
301
|
+
return e === "__select__" || e === "__details__";
|
|
302
|
+
}
|
|
303
|
+
function it(e) {
|
|
36
304
|
return e.columnDef.meta?.enableOrdering !== !1 && e.parent === void 0;
|
|
37
305
|
}
|
|
38
|
-
var
|
|
306
|
+
var at = {
|
|
39
307
|
groupToggle: "_groupToggle_h06xv_4",
|
|
40
308
|
chevron: "_chevron_h06xv_14",
|
|
41
309
|
groupLabel: "_groupLabel_h06xv_34",
|
|
42
310
|
groupCount: "_groupCount_h06xv_44"
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var Re = "__group__", Z = 16, Q = "(Blank)";
|
|
52
|
-
function ze(e) {
|
|
53
|
-
return e == null || e === "" ? Q : e instanceof Date ? e.toLocaleDateString() : String(e);
|
|
54
|
-
}
|
|
55
|
-
function Be(t) {
|
|
56
|
-
let n = e(25), { row: r } = t, i;
|
|
57
|
-
n[0] === r ? i = n[1] : (i = () => r.getIsExpanded(), n[0] = r, n[1] = i);
|
|
58
|
-
let a = C(r.table.store, i);
|
|
311
|
+
}, ot = "__group__", st = 16, ct = "(Blank)";
|
|
312
|
+
function lt(e, t = ct) {
|
|
313
|
+
return e == null || e === "" ? t : e instanceof Date ? e.toLocaleDateString() : String(e);
|
|
314
|
+
}
|
|
315
|
+
function ut(t) {
|
|
316
|
+
let n = e(38), { row: r } = t, { labels: i } = Z(), a;
|
|
317
|
+
n[0] === r ? a = n[1] : (a = () => r.getIsExpanded(), n[0] = r, n[1] = a);
|
|
318
|
+
let o = T(r.table.store, a), s = Pe();
|
|
59
319
|
if (!r.getIsGrouped()) return null;
|
|
60
|
-
let
|
|
61
|
-
n[2]
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
n[
|
|
320
|
+
let c, l, u, d, f, p, m;
|
|
321
|
+
if (n[2] !== o || n[3] !== i || n[4] !== r.depth || n[5] !== r.groupingValue || n[6] !== s) {
|
|
322
|
+
l = lt(r.groupingValue, i.blankGroupValue), c = C, u = at.groupToggle;
|
|
323
|
+
let e = r.depth * st;
|
|
324
|
+
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;
|
|
325
|
+
} else c = n[7], l = n[8], u = n[9], d = n[10], f = n[11], p = n[12], m = n[13];
|
|
326
|
+
let h;
|
|
327
|
+
n[16] === r ? h = n[17] : (h = (e) => {
|
|
66
328
|
e.stopPropagation(), r.toggleExpanded();
|
|
67
|
-
}, n[
|
|
68
|
-
let
|
|
69
|
-
n[
|
|
329
|
+
}, n[16] = r, n[17] = h);
|
|
330
|
+
let g;
|
|
331
|
+
n[18] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ U(P, {
|
|
70
332
|
size: 16,
|
|
71
333
|
stroke: 1.6
|
|
72
|
-
}), n[
|
|
73
|
-
let
|
|
74
|
-
n[
|
|
75
|
-
className:
|
|
76
|
-
"data-expanded":
|
|
77
|
-
children:
|
|
78
|
-
}), n[
|
|
79
|
-
let
|
|
80
|
-
n[
|
|
81
|
-
className:
|
|
82
|
-
children:
|
|
83
|
-
}), n[
|
|
84
|
-
let
|
|
85
|
-
n[
|
|
86
|
-
let
|
|
87
|
-
n[
|
|
88
|
-
className:
|
|
334
|
+
}), n[18] = g) : g = n[18];
|
|
335
|
+
let _;
|
|
336
|
+
n[19] === o ? _ = n[20] : (_ = /* @__PURE__ */ U("span", {
|
|
337
|
+
className: at.chevron,
|
|
338
|
+
"data-expanded": o,
|
|
339
|
+
children: g
|
|
340
|
+
}), n[19] = o, n[20] = _);
|
|
341
|
+
let v;
|
|
342
|
+
n[21] === l ? v = n[22] : (v = /* @__PURE__ */ U("span", {
|
|
343
|
+
className: at.groupLabel,
|
|
344
|
+
children: l
|
|
345
|
+
}), n[21] = l, n[22] = v);
|
|
346
|
+
let y;
|
|
347
|
+
n[23] === r ? y = n[24] : (y = We(r), n[23] = r, n[24] = y);
|
|
348
|
+
let b;
|
|
349
|
+
n[25] === y.length ? b = n[26] : (b = /* @__PURE__ */ W("span", {
|
|
350
|
+
className: at.groupCount,
|
|
89
351
|
children: [
|
|
90
352
|
"(",
|
|
91
|
-
|
|
353
|
+
y.length,
|
|
92
354
|
")"
|
|
93
355
|
]
|
|
94
|
-
}), n[
|
|
95
|
-
let
|
|
96
|
-
return n[
|
|
97
|
-
className:
|
|
98
|
-
style:
|
|
99
|
-
|
|
100
|
-
"aria-
|
|
101
|
-
|
|
356
|
+
}), n[25] = y.length, n[26] = b);
|
|
357
|
+
let x;
|
|
358
|
+
return n[27] !== c || n[28] !== v || n[29] !== b || n[30] !== u || n[31] !== d || n[32] !== f || n[33] !== p || n[34] !== m || n[35] !== h || n[36] !== _ ? (x = /* @__PURE__ */ W(c, {
|
|
359
|
+
className: u,
|
|
360
|
+
style: d,
|
|
361
|
+
tabIndex: f,
|
|
362
|
+
"aria-expanded": p,
|
|
363
|
+
"aria-label": m,
|
|
364
|
+
onClick: h,
|
|
102
365
|
children: [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
366
|
+
_,
|
|
367
|
+
v,
|
|
368
|
+
b
|
|
106
369
|
]
|
|
107
|
-
}), n[
|
|
108
|
-
}
|
|
109
|
-
function
|
|
110
|
-
let n = e(6), { table: r } = t, i;
|
|
111
|
-
n[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
112
|
-
let
|
|
113
|
-
if (
|
|
114
|
-
let
|
|
115
|
-
if (n[1] !==
|
|
370
|
+
}), n[27] = c, n[28] = v, n[29] = b, n[30] = u, n[31] = d, n[32] = f, n[33] = p, n[34] = m, n[35] = h, n[36] = _, n[37] = x) : x = n[37], x;
|
|
371
|
+
}
|
|
372
|
+
function dt(t) {
|
|
373
|
+
let n = e(6), { table: r } = t, { labels: i } = Z(), a;
|
|
374
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = { compare: ae }, n[0] = a) : a = n[0];
|
|
375
|
+
let o = T(r.store, ft, a);
|
|
376
|
+
if (o.length === 0) return i.groupColumnLabel;
|
|
377
|
+
let s;
|
|
378
|
+
if (n[1] !== o || n[2] !== r) {
|
|
116
379
|
let e;
|
|
117
380
|
n[4] === r ? e = n[5] : (e = (e) => {
|
|
118
381
|
let t = r.getColumn(e);
|
|
119
|
-
return t ?
|
|
120
|
-
}, n[4] = r, n[5] = e),
|
|
121
|
-
} else
|
|
122
|
-
return
|
|
382
|
+
return t ? et(t) : e;
|
|
383
|
+
}, n[4] = r, n[5] = e), s = o.map(e).join(" / "), n[1] = o, n[2] = r, n[3] = s;
|
|
384
|
+
} else s = n[3];
|
|
385
|
+
return s;
|
|
123
386
|
}
|
|
124
|
-
function
|
|
387
|
+
function ft(e) {
|
|
125
388
|
return e.grouping;
|
|
126
389
|
}
|
|
127
|
-
function
|
|
390
|
+
function pt(e = "Group") {
|
|
128
391
|
return {
|
|
129
|
-
id:
|
|
392
|
+
id: ot,
|
|
130
393
|
meta: {
|
|
131
|
-
label:
|
|
394
|
+
label: e,
|
|
132
395
|
enableOrdering: !1
|
|
133
396
|
},
|
|
134
397
|
size: 260,
|
|
@@ -138,114 +401,154 @@ function Ue() {
|
|
|
138
401
|
enableGlobalFilter: !1,
|
|
139
402
|
enableHiding: !1,
|
|
140
403
|
enablePinning: !1,
|
|
141
|
-
cell: ({ row: e }) => /* @__PURE__ */
|
|
142
|
-
aggregatedCell: ({ row: e }) => /* @__PURE__ */
|
|
143
|
-
header: ({ table: e }) => /* @__PURE__ */
|
|
404
|
+
cell: ({ row: e }) => /* @__PURE__ */ U(ut, { row: e }),
|
|
405
|
+
aggregatedCell: ({ row: e }) => /* @__PURE__ */ U(ut, { row: e }),
|
|
406
|
+
header: ({ table: e }) => /* @__PURE__ */ U(dt, { table: e })
|
|
144
407
|
};
|
|
145
408
|
}
|
|
146
409
|
//#endregion
|
|
147
410
|
//#region src/tmdatagrid/components/TMDataGridColumnsPanel.tsx
|
|
148
|
-
function
|
|
149
|
-
let t = e(
|
|
150
|
-
if (t[0] !==
|
|
151
|
-
let e = n.getAllLeafColumns().filter(
|
|
152
|
-
|
|
153
|
-
let
|
|
154
|
-
t[
|
|
155
|
-
let
|
|
156
|
-
t[
|
|
157
|
-
let
|
|
158
|
-
t[
|
|
411
|
+
function mt() {
|
|
412
|
+
let t = e(61), { table: n, labels: r, controlSize: i } = Z(), [a, o] = s(""), c = T(n.store, _t), d, f, p, m, h, g, v, y, S, C;
|
|
413
|
+
if (t[0] !== c || t[1] !== i || t[2] !== r.columnsSearchPlaceholder || t[3] !== a || t[4] !== n) {
|
|
414
|
+
let e = n.getAllLeafColumns().filter(gt), s = a.trim().toLowerCase();
|
|
415
|
+
C = s ? e.filter((e) => et(e).toLowerCase().includes(s)) : e, f = e.filter(ht);
|
|
416
|
+
let l;
|
|
417
|
+
t[15] === c ? l = t[16] : (l = (e) => c[e.id] !== !1, t[15] = c, t[16] = l), p = f.filter(l).length, y = X.columnsPanel;
|
|
418
|
+
let b;
|
|
419
|
+
t[17] === Symbol.for("react.memo_cache_sentinel") ? (b = (e) => o(e.currentTarget.value), t[17] = b) : b = t[17];
|
|
420
|
+
let w;
|
|
421
|
+
t[18] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ U(B, {
|
|
159
422
|
size: 16,
|
|
160
423
|
stroke: 1.6
|
|
161
|
-
}), t[
|
|
162
|
-
className:
|
|
163
|
-
children: /* @__PURE__ */
|
|
164
|
-
value:
|
|
165
|
-
onChange:
|
|
166
|
-
placeholder:
|
|
167
|
-
leftSection:
|
|
168
|
-
size:
|
|
424
|
+
}), t[18] = w) : w = t[18], t[19] !== i || t[20] !== r.columnsSearchPlaceholder || t[21] !== a ? (S = /* @__PURE__ */ U("div", {
|
|
425
|
+
className: X.columnsPanelSearch,
|
|
426
|
+
children: /* @__PURE__ */ U(x, {
|
|
427
|
+
value: a,
|
|
428
|
+
onChange: b,
|
|
429
|
+
placeholder: r.columnsSearchPlaceholder,
|
|
430
|
+
leftSection: w,
|
|
431
|
+
size: i,
|
|
169
432
|
"data-autofocus": !0
|
|
170
433
|
})
|
|
171
|
-
}), t[
|
|
172
|
-
let
|
|
173
|
-
t[
|
|
174
|
-
size:
|
|
175
|
-
label:
|
|
434
|
+
}), t[19] = i, t[20] = r.columnsSearchPlaceholder, t[21] = a, t[22] = S) : S = t[22], d = _.Autosize, g = 260, v = "auto", m = X.columnsPanelList;
|
|
435
|
+
let T;
|
|
436
|
+
t[23] !== c || t[24] !== i ? (T = (e) => /* @__PURE__ */ U(u, {
|
|
437
|
+
size: i,
|
|
438
|
+
label: et(e),
|
|
176
439
|
disabled: !e.getCanHide(),
|
|
177
|
-
checked:
|
|
440
|
+
checked: c[e.id] !== !1,
|
|
178
441
|
onChange: (t) => e.toggleVisibility(t.currentTarget.checked)
|
|
179
|
-
}, e.id), t[
|
|
180
|
-
} else
|
|
442
|
+
}, e.id), t[23] = c, t[24] = i, t[25] = T) : T = t[25], h = C.map(T), t[0] = c, t[1] = i, t[2] = r.columnsSearchPlaceholder, t[3] = a, t[4] = n, t[5] = d, t[6] = f, t[7] = p, t[8] = m, t[9] = h, t[10] = g, t[11] = v, t[12] = y, t[13] = S, t[14] = C;
|
|
443
|
+
} else d = t[5], f = t[6], p = t[7], m = t[8], h = t[9], g = t[10], v = t[11], y = t[12], S = t[13], C = t[14];
|
|
181
444
|
let w;
|
|
182
|
-
t[
|
|
183
|
-
size:
|
|
445
|
+
t[26] !== i || t[27] !== r || t[28] !== a || t[29] !== C.length ? (w = C.length === 0 && /* @__PURE__ */ U(b, {
|
|
446
|
+
size: i,
|
|
184
447
|
c: "dimmed",
|
|
185
|
-
children:
|
|
186
|
-
|
|
187
|
-
i,
|
|
188
|
-
"”"
|
|
189
|
-
]
|
|
190
|
-
}), t[24] = r, t[25] = i, t[26] = S.length, t[27] = w) : w = t[27];
|
|
191
|
-
let T;
|
|
192
|
-
t[28] !== p || t[29] !== m || t[30] !== w ? (T = /* @__PURE__ */ K("div", {
|
|
193
|
-
className: p,
|
|
194
|
-
children: [m, w]
|
|
195
|
-
}), t[28] = p, t[29] = m, t[30] = w, t[31] = T) : T = t[31];
|
|
448
|
+
children: r.columnsNoMatch(a)
|
|
449
|
+
}), t[26] = i, t[27] = r, t[28] = a, t[29] = C.length, t[30] = w) : w = t[30];
|
|
196
450
|
let E;
|
|
197
|
-
t[
|
|
451
|
+
t[31] !== m || t[32] !== h || t[33] !== w ? (E = /* @__PURE__ */ W("div", {
|
|
452
|
+
className: m,
|
|
453
|
+
children: [h, w]
|
|
454
|
+
}), t[31] = m, t[32] = h, t[33] = w, t[34] = E) : E = t[34];
|
|
455
|
+
let D;
|
|
456
|
+
t[35] !== d || t[36] !== g || t[37] !== v || t[38] !== E ? (D = /* @__PURE__ */ U(d, {
|
|
198
457
|
mah: g,
|
|
199
|
-
type:
|
|
200
|
-
children:
|
|
201
|
-
}), t[
|
|
202
|
-
let
|
|
203
|
-
t[
|
|
204
|
-
let A;
|
|
205
|
-
t[39] !== r || t[40] !== O || t[41] !== k || t[42] !== D ? (A = /* @__PURE__ */ G(l, {
|
|
206
|
-
size: r,
|
|
207
|
-
label: "Show/Hide All",
|
|
208
|
-
checked: D,
|
|
209
|
-
indeterminate: O,
|
|
210
|
-
onChange: k
|
|
211
|
-
}), t[39] = r, t[40] = O, t[41] = k, t[42] = D, t[43] = A) : A = t[43];
|
|
458
|
+
type: v,
|
|
459
|
+
children: E
|
|
460
|
+
}), t[35] = d, t[36] = g, t[37] = v, t[38] = E, t[39] = D) : D = t[39];
|
|
461
|
+
let O = p === f.length, k = p > 0 && p < f.length, A;
|
|
462
|
+
t[40] === n ? A = t[41] : (A = (e) => n.toggleAllColumnsVisible(e.currentTarget.checked), t[40] = n, t[41] = A);
|
|
212
463
|
let j;
|
|
213
|
-
t[
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
464
|
+
t[42] !== i || t[43] !== r.columnsShowHideAll || t[44] !== k || t[45] !== A || t[46] !== O ? (j = /* @__PURE__ */ U(u, {
|
|
465
|
+
size: i,
|
|
466
|
+
label: r.columnsShowHideAll,
|
|
467
|
+
checked: O,
|
|
468
|
+
indeterminate: k,
|
|
469
|
+
onChange: A
|
|
470
|
+
}), t[42] = i, t[43] = r.columnsShowHideAll, t[44] = k, t[45] = A, t[46] = O, t[47] = j) : j = t[47];
|
|
219
471
|
let M;
|
|
220
|
-
t[
|
|
221
|
-
className: Oe.columnsPanelFooter,
|
|
222
|
-
children: [A, j]
|
|
223
|
-
}), t[46] = A, t[47] = j, t[48] = M) : M = t[48];
|
|
472
|
+
t[48] === n ? M = t[49] : (M = () => n.resetColumnVisibility(), t[48] = n, t[49] = M);
|
|
224
473
|
let N;
|
|
225
|
-
|
|
226
|
-
|
|
474
|
+
t[50] !== r.columnsReset || t[51] !== M ? (N = /* @__PURE__ */ U(l, {
|
|
475
|
+
variant: "subtle",
|
|
476
|
+
size: "compact-sm",
|
|
477
|
+
onClick: M,
|
|
478
|
+
children: r.columnsReset
|
|
479
|
+
}), t[50] = r.columnsReset, t[51] = M, t[52] = N) : N = t[52];
|
|
480
|
+
let P;
|
|
481
|
+
t[53] !== j || t[54] !== N ? (P = /* @__PURE__ */ W("div", {
|
|
482
|
+
className: X.columnsPanelFooter,
|
|
483
|
+
children: [j, N]
|
|
484
|
+
}), t[53] = j, t[54] = N, t[55] = P) : P = t[55];
|
|
485
|
+
let F;
|
|
486
|
+
return t[56] !== P || t[57] !== y || t[58] !== S || t[59] !== D ? (F = /* @__PURE__ */ W("div", {
|
|
487
|
+
className: y,
|
|
227
488
|
children: [
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
489
|
+
S,
|
|
490
|
+
D,
|
|
491
|
+
P
|
|
231
492
|
]
|
|
232
|
-
}), t[
|
|
493
|
+
}), t[56] = P, t[57] = y, t[58] = S, t[59] = D, t[60] = F) : F = t[60], F;
|
|
233
494
|
}
|
|
234
|
-
function
|
|
495
|
+
function ht(e) {
|
|
235
496
|
return e.getCanHide();
|
|
236
497
|
}
|
|
237
|
-
function
|
|
238
|
-
return e.id !==
|
|
498
|
+
function gt(e) {
|
|
499
|
+
return e.id !== ot;
|
|
239
500
|
}
|
|
240
|
-
function
|
|
501
|
+
function _t(e) {
|
|
241
502
|
return e.columnVisibility;
|
|
242
503
|
}
|
|
243
|
-
var
|
|
504
|
+
var vt = {
|
|
244
505
|
filterPanel: "_filterPanel_izakx_4",
|
|
245
506
|
filterRow: "_filterRow_izakx_16",
|
|
246
507
|
filterPanelHeader: "_filterPanelHeader_izakx_22",
|
|
247
508
|
filterPanelFooter: "_filterPanelFooter_izakx_30"
|
|
248
|
-
}
|
|
509
|
+
};
|
|
510
|
+
//#endregion
|
|
511
|
+
//#region src/tmdatagrid/core/columnOptions.ts
|
|
512
|
+
function yt(e, t) {
|
|
513
|
+
t == null || t === "" || e.add(String(t));
|
|
514
|
+
}
|
|
515
|
+
function bt({ table: e, column: t, row: n, fallback: r }) {
|
|
516
|
+
let i = t.columnDef.meta?.options ?? r;
|
|
517
|
+
if (!i) return [];
|
|
518
|
+
if (i === "faceted") {
|
|
519
|
+
let e = /* @__PURE__ */ new Set();
|
|
520
|
+
for (let n of t.getFacetedUniqueValues().keys()) if (Array.isArray(n)) for (let t of n) yt(e, t);
|
|
521
|
+
else yt(e, n);
|
|
522
|
+
return [...e].sort((e, t) => e.localeCompare(t, void 0, { numeric: !0 })).map((e) => ({ value: e }));
|
|
523
|
+
}
|
|
524
|
+
return (typeof i == "function" ? i({
|
|
525
|
+
table: e,
|
|
526
|
+
column: t,
|
|
527
|
+
row: n
|
|
528
|
+
}) : i).map((e) => typeof e == "string" ? { value: e } : e);
|
|
529
|
+
}
|
|
530
|
+
function xt(e) {
|
|
531
|
+
let t = [], n = /* @__PURE__ */ new Map();
|
|
532
|
+
for (let r of e) {
|
|
533
|
+
let e = {
|
|
534
|
+
value: r.value,
|
|
535
|
+
label: r.label ?? r.value,
|
|
536
|
+
...r.disabled ? { disabled: !0 } : {}
|
|
537
|
+
};
|
|
538
|
+
if (r.group === void 0) t.push(e);
|
|
539
|
+
else {
|
|
540
|
+
let t = n.get(r.group);
|
|
541
|
+
t ? t.push(e) : n.set(r.group, [e]);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
return [...t, ...[...n].map(([e, t]) => ({
|
|
545
|
+
group: e,
|
|
546
|
+
items: t
|
|
547
|
+
}))];
|
|
548
|
+
}
|
|
549
|
+
//#endregion
|
|
550
|
+
//#region src/tmdatagrid/core/filterOperators.ts
|
|
551
|
+
var St = {
|
|
249
552
|
contains: "contains",
|
|
250
553
|
equals: "equals",
|
|
251
554
|
notEquals: "does not equal",
|
|
@@ -255,9 +558,15 @@ var Je = {
|
|
|
255
558
|
greaterThanOrEqual: "is greater than or equal to",
|
|
256
559
|
lessThan: "is less than",
|
|
257
560
|
lessThanOrEqual: "is less than or equal to",
|
|
561
|
+
before: "is before",
|
|
562
|
+
after: "is after",
|
|
563
|
+
onOrBefore: "is on or before",
|
|
564
|
+
onOrAfter: "is on or after",
|
|
565
|
+
isAnyOf: "is any of",
|
|
566
|
+
isNoneOf: "is none of",
|
|
258
567
|
isEmpty: "is empty",
|
|
259
568
|
isNotEmpty: "is not empty"
|
|
260
|
-
},
|
|
569
|
+
}, Ct = [
|
|
261
570
|
"contains",
|
|
262
571
|
"equals",
|
|
263
572
|
"notEquals",
|
|
@@ -265,7 +574,7 @@ var Je = {
|
|
|
265
574
|
"endsWith",
|
|
266
575
|
"isEmpty",
|
|
267
576
|
"isNotEmpty"
|
|
268
|
-
],
|
|
577
|
+
], wt = [
|
|
269
578
|
"equals",
|
|
270
579
|
"notEquals",
|
|
271
580
|
"greaterThan",
|
|
@@ -274,33 +583,96 @@ var Je = {
|
|
|
274
583
|
"lessThanOrEqual",
|
|
275
584
|
"isEmpty",
|
|
276
585
|
"isNotEmpty"
|
|
277
|
-
],
|
|
278
|
-
|
|
279
|
-
|
|
586
|
+
], Tt = [
|
|
587
|
+
"equals",
|
|
588
|
+
"notEquals",
|
|
589
|
+
"before",
|
|
590
|
+
"after",
|
|
591
|
+
"onOrBefore",
|
|
592
|
+
"onOrAfter",
|
|
593
|
+
"isEmpty",
|
|
594
|
+
"isNotEmpty"
|
|
595
|
+
], Et = [
|
|
596
|
+
"equals",
|
|
597
|
+
"notEquals",
|
|
598
|
+
"isEmpty",
|
|
599
|
+
"isNotEmpty"
|
|
600
|
+
], Dt = [
|
|
601
|
+
"isAnyOf",
|
|
602
|
+
"isNoneOf",
|
|
603
|
+
"isEmpty",
|
|
604
|
+
"isNotEmpty"
|
|
605
|
+
], Ot = ["isEmpty", "isNotEmpty"], kt = ["isAnyOf", "isNoneOf"], At = {
|
|
606
|
+
string: Ct,
|
|
607
|
+
number: wt,
|
|
608
|
+
boolean: Et,
|
|
609
|
+
date: Tt,
|
|
610
|
+
select: Dt,
|
|
611
|
+
multiSelect: Dt
|
|
612
|
+
}, jt = {
|
|
613
|
+
string: "contains",
|
|
614
|
+
number: "equals",
|
|
615
|
+
boolean: "equals",
|
|
616
|
+
date: "equals",
|
|
617
|
+
select: "isAnyOf",
|
|
618
|
+
multiSelect: "isAnyOf"
|
|
619
|
+
};
|
|
620
|
+
function Mt(e) {
|
|
621
|
+
return At[e];
|
|
280
622
|
}
|
|
281
|
-
function
|
|
282
|
-
return e
|
|
623
|
+
function Nt(e) {
|
|
624
|
+
return jt[e];
|
|
283
625
|
}
|
|
284
|
-
function
|
|
285
|
-
return !
|
|
626
|
+
function Pt(e) {
|
|
627
|
+
return !Ot.includes(e);
|
|
286
628
|
}
|
|
287
|
-
function
|
|
629
|
+
function Ft(e) {
|
|
630
|
+
return kt.includes(e);
|
|
631
|
+
}
|
|
632
|
+
function It(e) {
|
|
288
633
|
return typeof e == "object" && !!e && "operator" in e && typeof e.operator == "string";
|
|
289
634
|
}
|
|
290
|
-
function
|
|
291
|
-
return
|
|
292
|
-
}
|
|
293
|
-
function
|
|
294
|
-
let { operator:
|
|
295
|
-
if (!
|
|
296
|
-
let
|
|
297
|
-
return
|
|
298
|
-
}
|
|
299
|
-
function
|
|
300
|
-
if (
|
|
301
|
-
if (
|
|
302
|
-
|
|
635
|
+
function Lt(e) {
|
|
636
|
+
return It(e) ? Pt(e.operator) ? Array.isArray(e.value) ? e.value.length > 0 : typeof e.value == "string" && e.value.trim() !== "" : !0 : !1;
|
|
637
|
+
}
|
|
638
|
+
function Rt({ label: e, type: t, filter: n, operatorLabels: r = St }) {
|
|
639
|
+
let { operator: i, value: a } = n;
|
|
640
|
+
if (!Pt(i)) return `${e} ${r[i]}`;
|
|
641
|
+
let o = Array.isArray(a) ? a.join(", ") : String(a).trim();
|
|
642
|
+
return i === Nt(t) ? `${e}: ${o}` : `${e} ${r[i]} ${o}`;
|
|
643
|
+
}
|
|
644
|
+
function zt(e) {
|
|
645
|
+
if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : e.toLocaleDateString("sv-SE");
|
|
646
|
+
if (typeof e == "string") {
|
|
647
|
+
let t = /^(\d{4}-\d{2}-\d{2})/.exec(e.trim());
|
|
648
|
+
return t ? t[1] : null;
|
|
649
|
+
}
|
|
650
|
+
return null;
|
|
651
|
+
}
|
|
652
|
+
function Bt(e) {
|
|
653
|
+
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
654
|
+
}
|
|
655
|
+
function Vt(e, { operator: t, value: n }) {
|
|
656
|
+
if (t === "isEmpty") return Bt(e);
|
|
657
|
+
if (t === "isNotEmpty") return !Bt(e);
|
|
658
|
+
if (t === "isAnyOf" || t === "isNoneOf") {
|
|
659
|
+
let r = (Array.isArray(n) ? n : [n]).map((e) => String(e).toLowerCase()).filter((e) => e !== "");
|
|
660
|
+
if (r.length === 0) return !0;
|
|
661
|
+
let i = (Array.isArray(e) ? e : [e]).some((e) => r.includes(String(e ?? "").toLowerCase()));
|
|
662
|
+
return t === "isAnyOf" ? i : !i;
|
|
663
|
+
}
|
|
664
|
+
let r = typeof n == "string" ? n.trim() : n.join(",").trim();
|
|
303
665
|
if (r === "") return !0;
|
|
666
|
+
switch (t) {
|
|
667
|
+
case "before":
|
|
668
|
+
case "after":
|
|
669
|
+
case "onOrBefore":
|
|
670
|
+
case "onOrAfter": {
|
|
671
|
+
let n = zt(e), i = zt(r);
|
|
672
|
+
return n === null || i === null ? !1 : t === "before" ? n < i : t === "after" ? n > i : t === "onOrBefore" ? n <= i : n >= i;
|
|
673
|
+
}
|
|
674
|
+
default: break;
|
|
675
|
+
}
|
|
304
676
|
let i = typeof e == "number" ? e : NaN, a = Number(r), o = !Number.isNaN(i) && !Number.isNaN(a);
|
|
305
677
|
switch (t) {
|
|
306
678
|
case "greaterThan": return o && i > a;
|
|
@@ -309,7 +681,7 @@ function at(e, { operator: t, value: n }) {
|
|
|
309
681
|
case "lessThanOrEqual": return o && i <= a;
|
|
310
682
|
default: break;
|
|
311
683
|
}
|
|
312
|
-
let s = String(e ?? "").toLowerCase(), c = r.toLowerCase();
|
|
684
|
+
let s = (e instanceof Date ? zt(e) ?? "" : String(e ?? "")).toLowerCase(), c = r.toLowerCase();
|
|
313
685
|
switch (t) {
|
|
314
686
|
case "contains": return s.includes(c);
|
|
315
687
|
case "equals": return o ? i === a : s === c;
|
|
@@ -319,228 +691,341 @@ function at(e, { operator: t, value: n }) {
|
|
|
319
691
|
default: return !0;
|
|
320
692
|
}
|
|
321
693
|
}
|
|
322
|
-
function
|
|
323
|
-
return !
|
|
694
|
+
function Ht(e, t, n) {
|
|
695
|
+
return !It(n) || Vt(e.getValue(t), n);
|
|
324
696
|
}
|
|
325
697
|
//#endregion
|
|
326
698
|
//#region src/tmdatagrid/components/TMDataGridFilterPanel.tsx
|
|
327
|
-
var
|
|
699
|
+
var Ut = {
|
|
328
700
|
operator: "contains",
|
|
329
701
|
value: ""
|
|
330
702
|
};
|
|
331
|
-
function
|
|
332
|
-
return
|
|
703
|
+
function Wt(e) {
|
|
704
|
+
return It(e) ? e : Ut;
|
|
333
705
|
}
|
|
334
|
-
function
|
|
335
|
-
let t = e(
|
|
336
|
-
if (t[0] !==
|
|
337
|
-
if (!
|
|
706
|
+
function Gt() {
|
|
707
|
+
let t = e(90), { table: n, ui: r, labels: a, controlSize: s } = Z(), u = T(r, Yt), d = T(n.store, Jt), f = o(null), p, h;
|
|
708
|
+
if (t[0] !== u || t[1] !== r ? (p = () => {
|
|
709
|
+
if (!u) return;
|
|
338
710
|
let e = (e) => {
|
|
339
711
|
let t = e.target;
|
|
340
|
-
t instanceof Element && (
|
|
712
|
+
t instanceof Element && (f.current?.contains(t) || t.closest("[data-dg-filter-toggle]") || r.actions.closeFilterPanel());
|
|
341
713
|
};
|
|
342
714
|
return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
|
|
343
|
-
},
|
|
344
|
-
let
|
|
345
|
-
if (t[4] !==
|
|
346
|
-
let e = n.getAllLeafColumns().filter(
|
|
347
|
-
|
|
348
|
-
let t =
|
|
715
|
+
}, h = [u, r], t[0] = u, t[1] = r, t[2] = p, t[3] = h) : (p = t[2], h = t[3]), i(p, h), !u) return null;
|
|
716
|
+
let g, _, S, C, w, E, D, O;
|
|
717
|
+
if (t[4] !== d || t[5] !== n || t[6] !== r.actions) {
|
|
718
|
+
let e = n.getAllLeafColumns().filter(qt);
|
|
719
|
+
w = e.map(Kt), D = function(e) {
|
|
720
|
+
let t = d.filter((t) => t.id !== e);
|
|
349
721
|
n.setColumnFilters(t), t.length === 0 && r.actions.closeFilterPanel();
|
|
350
|
-
},
|
|
351
|
-
let i =
|
|
352
|
-
n.setColumnFilters(
|
|
722
|
+
}, _ = function(e, t) {
|
|
723
|
+
let i = Wt(d.find((t) => t.id === e)?.value), a = n.getColumn(t), o = Nt(a ? tt(a) : "string"), s = Ft(o) === Array.isArray(i.value) ? i.value : Ft(o) ? [] : "";
|
|
724
|
+
n.setColumnFilters(d.filter((e) => e.id !== t).map((n) => n.id === e ? {
|
|
353
725
|
id: t,
|
|
354
726
|
value: {
|
|
355
|
-
operator:
|
|
356
|
-
value:
|
|
727
|
+
operator: o,
|
|
728
|
+
value: s
|
|
357
729
|
}
|
|
358
730
|
} : n)), r.actions.openFilterPanel(t);
|
|
359
731
|
};
|
|
360
732
|
let i;
|
|
361
|
-
t[
|
|
362
|
-
n.setColumnFilters(
|
|
733
|
+
t[15] !== d || t[16] !== n ? (i = function(e, t) {
|
|
734
|
+
n.setColumnFilters(d.map((n) => n.id === e ? {
|
|
363
735
|
...n,
|
|
364
736
|
value: {
|
|
365
|
-
...
|
|
737
|
+
...Wt(n.value),
|
|
366
738
|
...t
|
|
367
739
|
}
|
|
368
740
|
} : n));
|
|
369
|
-
}, t[
|
|
741
|
+
}, t[15] = d, t[16] = n, t[17] = i) : i = t[17], E = i;
|
|
370
742
|
let a;
|
|
371
|
-
t[
|
|
743
|
+
t[18] !== d || t[19] !== E ? (a = function(e, t) {
|
|
744
|
+
let n = Wt(d.find((t) => t.id === e)?.value), r = Ft(t) === Array.isArray(n.value) ? n.value : Ft(t) ? [] : "";
|
|
745
|
+
E(e, {
|
|
746
|
+
operator: t,
|
|
747
|
+
value: r
|
|
748
|
+
});
|
|
749
|
+
}, t[18] = d, t[19] = E, t[20] = a) : a = t[20], S = a;
|
|
750
|
+
let o;
|
|
751
|
+
t[21] !== n || t[22] !== r.actions ? (o = function() {
|
|
372
752
|
n.setColumnFilters([]), r.actions.closeFilterPanel();
|
|
373
|
-
}, t[
|
|
374
|
-
let t = e.find((e) => !
|
|
375
|
-
t && n.setColumnFilters([...
|
|
753
|
+
}, t[21] = n, t[22] = r.actions, t[23] = o) : o = t[23], C = o, g = function() {
|
|
754
|
+
let t = e.find((e) => !d.some((t) => t.id === e.id));
|
|
755
|
+
t && n.setColumnFilters([...d, {
|
|
376
756
|
id: t.id,
|
|
377
757
|
value: {
|
|
378
|
-
operator:
|
|
758
|
+
operator: Nt(tt(t)),
|
|
379
759
|
value: ""
|
|
380
760
|
}
|
|
381
761
|
}]);
|
|
382
762
|
};
|
|
383
|
-
let
|
|
384
|
-
t[
|
|
385
|
-
} else
|
|
386
|
-
let
|
|
387
|
-
t[
|
|
763
|
+
let s;
|
|
764
|
+
t[24] === d ? s = t[25] : (s = (e) => !d.some((t) => t.id === e.id), t[24] = d, t[25] = s), O = e.some(s), t[4] = d, t[5] = n, t[6] = r.actions, t[7] = g, t[8] = _, t[9] = S, t[10] = C, t[11] = w, t[12] = E, t[13] = D, t[14] = O;
|
|
765
|
+
} else g = t[7], _ = t[8], S = t[9], C = t[10], w = t[11], E = t[12], D = t[13], O = t[14];
|
|
766
|
+
let k = O, A = a.filters, j;
|
|
767
|
+
t[26] === r.actions ? j = t[27] : (j = (e) => {
|
|
388
768
|
e.key === "Escape" && (e.stopPropagation(), r.actions.closeFilterPanel());
|
|
389
|
-
}, t[
|
|
390
|
-
let
|
|
391
|
-
t[
|
|
392
|
-
size:
|
|
769
|
+
}, t[26] = r.actions, t[27] = j);
|
|
770
|
+
let M;
|
|
771
|
+
t[28] !== s || t[29] !== a.filters ? (M = /* @__PURE__ */ U(b, {
|
|
772
|
+
size: s,
|
|
393
773
|
fw: 600,
|
|
394
|
-
children:
|
|
395
|
-
}), t[
|
|
396
|
-
let
|
|
397
|
-
t[
|
|
774
|
+
children: a.filters
|
|
775
|
+
}), t[28] = s, t[29] = a.filters, t[30] = M) : M = t[30];
|
|
776
|
+
let N;
|
|
777
|
+
t[31] === Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ U(V, {
|
|
398
778
|
size: 16,
|
|
399
779
|
stroke: 1.6
|
|
400
|
-
}), t[
|
|
401
|
-
let
|
|
402
|
-
t[
|
|
780
|
+
}), t[31] = N) : N = t[31];
|
|
781
|
+
let P;
|
|
782
|
+
t[32] !== a.closeFilters || t[33] !== r.actions.closeFilterPanel ? (P = /* @__PURE__ */ U(c, {
|
|
403
783
|
variant: "subtle",
|
|
404
784
|
color: "gray",
|
|
405
785
|
size: "sm",
|
|
406
|
-
"aria-label":
|
|
786
|
+
"aria-label": a.closeFilters,
|
|
407
787
|
onClick: r.actions.closeFilterPanel,
|
|
408
|
-
children:
|
|
409
|
-
}), t[
|
|
410
|
-
let
|
|
411
|
-
t[
|
|
412
|
-
className:
|
|
413
|
-
children: [
|
|
414
|
-
}), t[
|
|
415
|
-
let
|
|
416
|
-
if (t[
|
|
788
|
+
children: N
|
|
789
|
+
}), t[32] = a.closeFilters, t[33] = r.actions.closeFilterPanel, t[34] = P) : P = t[34];
|
|
790
|
+
let F;
|
|
791
|
+
t[35] !== M || t[36] !== P ? (F = /* @__PURE__ */ W("div", {
|
|
792
|
+
className: vt.filterPanelHeader,
|
|
793
|
+
children: [M, P]
|
|
794
|
+
}), t[35] = M, t[36] = P, t[37] = F) : F = t[37];
|
|
795
|
+
let I;
|
|
796
|
+
if (t[38] !== _ || t[39] !== S || t[40] !== d || t[41] !== w || t[42] !== s || t[43] !== a.booleanFalse || t[44] !== a.booleanTrue || t[45] !== a.filterColumn || t[46] !== a.filterOperator || t[47] !== a.filterValue || t[48] !== a.filterValuePlaceholder || t[49] !== a.operators || t[50] !== a.removeFilter || t[51] !== E || t[52] !== D || t[53] !== n) {
|
|
417
797
|
let e;
|
|
418
|
-
t[
|
|
419
|
-
let t = n.getColumn(e.id), r =
|
|
420
|
-
return /* @__PURE__ */
|
|
421
|
-
className:
|
|
798
|
+
t[55] !== _ || t[56] !== S || t[57] !== w || t[58] !== s || t[59] !== a.booleanFalse || t[60] !== a.booleanTrue || t[61] !== a.filterColumn || t[62] !== a.filterOperator || t[63] !== a.filterValue || t[64] !== a.filterValuePlaceholder || t[65] !== a.operators || t[66] !== a.removeFilter || t[67] !== E || t[68] !== D || t[69] !== n ? (e = (e) => {
|
|
799
|
+
let t = n.getColumn(e.id), r = Wt(e.value), i = t ? tt(t) : "string", o = Pt(r.operator), l = Ft(r.operator), u = typeof r.value == "string" ? r.value : "";
|
|
800
|
+
return /* @__PURE__ */ W("div", {
|
|
801
|
+
className: vt.filterRow,
|
|
422
802
|
children: [
|
|
423
|
-
/* @__PURE__ */
|
|
803
|
+
/* @__PURE__ */ U(c, {
|
|
424
804
|
variant: "subtle",
|
|
425
805
|
color: "gray",
|
|
426
806
|
size: "lg",
|
|
427
|
-
"aria-label":
|
|
428
|
-
onClick: () =>
|
|
429
|
-
children: /* @__PURE__ */
|
|
807
|
+
"aria-label": a.removeFilter,
|
|
808
|
+
onClick: () => D(e.id),
|
|
809
|
+
children: /* @__PURE__ */ U(V, {
|
|
430
810
|
size: 18,
|
|
431
811
|
stroke: 1.6
|
|
432
812
|
})
|
|
433
813
|
}),
|
|
434
|
-
/* @__PURE__ */
|
|
435
|
-
label:
|
|
436
|
-
size:
|
|
814
|
+
/* @__PURE__ */ U(v, {
|
|
815
|
+
label: a.filterColumn,
|
|
816
|
+
size: s,
|
|
437
817
|
w: 160,
|
|
438
818
|
allowDeselect: !1,
|
|
439
819
|
comboboxProps: { withinPortal: !1 },
|
|
440
|
-
data:
|
|
820
|
+
data: w,
|
|
441
821
|
value: e.id,
|
|
442
|
-
onChange: (t) => t &&
|
|
822
|
+
onChange: (t) => t && _(e.id, t)
|
|
443
823
|
}),
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
-
label:
|
|
446
|
-
size:
|
|
824
|
+
/* @__PURE__ */ U(v, {
|
|
825
|
+
label: a.filterOperator,
|
|
826
|
+
size: s,
|
|
447
827
|
w: 170,
|
|
448
828
|
allowDeselect: !1,
|
|
449
829
|
comboboxProps: { withinPortal: !1 },
|
|
450
|
-
data:
|
|
830
|
+
data: Mt(i).map((e) => ({
|
|
831
|
+
value: e,
|
|
832
|
+
label: a.operators[e]
|
|
833
|
+
})),
|
|
451
834
|
value: r.operator,
|
|
452
|
-
onChange: (t) => t && S(e.id,
|
|
835
|
+
onChange: (t) => t && S(e.id, t)
|
|
453
836
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
-
label:
|
|
456
|
-
size:
|
|
837
|
+
l && t ? /* @__PURE__ */ U(m, {
|
|
838
|
+
label: a.filterValue,
|
|
839
|
+
size: s,
|
|
840
|
+
w: 180,
|
|
841
|
+
comboboxProps: { withinPortal: !1 },
|
|
842
|
+
searchable: !0,
|
|
843
|
+
data: xt(bt({
|
|
844
|
+
table: n,
|
|
845
|
+
column: t,
|
|
846
|
+
fallback: "faceted"
|
|
847
|
+
})),
|
|
848
|
+
value: Array.isArray(r.value) ? [...r.value] : [],
|
|
849
|
+
onChange: (t) => E(e.id, { value: t })
|
|
850
|
+
}) : i === "boolean" ? /* @__PURE__ */ U(v, {
|
|
851
|
+
label: a.filterValue,
|
|
852
|
+
size: s,
|
|
853
|
+
w: 180,
|
|
854
|
+
comboboxProps: { withinPortal: !1 },
|
|
855
|
+
disabled: !o,
|
|
856
|
+
clearable: !0,
|
|
857
|
+
placeholder: o ? a.filterValuePlaceholder : "",
|
|
858
|
+
data: [{
|
|
859
|
+
value: "true",
|
|
860
|
+
label: a.booleanTrue
|
|
861
|
+
}, {
|
|
862
|
+
value: "false",
|
|
863
|
+
label: a.booleanFalse
|
|
864
|
+
}],
|
|
865
|
+
value: o && u !== "" ? u : null,
|
|
866
|
+
onChange: (t) => E(e.id, { value: t ?? "" })
|
|
867
|
+
}) : /* @__PURE__ */ U(x, {
|
|
868
|
+
label: a.filterValue,
|
|
869
|
+
size: s,
|
|
457
870
|
w: 180,
|
|
458
|
-
type: i === "number"
|
|
459
|
-
disabled: !
|
|
460
|
-
placeholder:
|
|
461
|
-
value:
|
|
462
|
-
onChange: (t) =>
|
|
871
|
+
type: o ? i === "number" ? "number" : i === "date" ? "date" : "text" : "text",
|
|
872
|
+
disabled: !o,
|
|
873
|
+
placeholder: o ? a.filterValuePlaceholder : "",
|
|
874
|
+
value: o ? u : "",
|
|
875
|
+
onChange: (t) => E(e.id, { value: t.currentTarget.value })
|
|
463
876
|
})
|
|
464
877
|
]
|
|
465
878
|
}, e.id);
|
|
466
|
-
}, t[
|
|
467
|
-
} else
|
|
468
|
-
let
|
|
469
|
-
t[
|
|
879
|
+
}, t[55] = _, t[56] = S, t[57] = w, t[58] = s, t[59] = a.booleanFalse, t[60] = a.booleanTrue, t[61] = a.filterColumn, t[62] = a.filterOperator, t[63] = a.filterValue, t[64] = a.filterValuePlaceholder, t[65] = a.operators, t[66] = a.removeFilter, t[67] = E, t[68] = D, t[69] = n, t[70] = e) : e = t[70], I = d.map(e), t[38] = _, t[39] = S, t[40] = d, t[41] = w, t[42] = s, t[43] = a.booleanFalse, t[44] = a.booleanTrue, t[45] = a.filterColumn, t[46] = a.filterOperator, t[47] = a.filterValue, t[48] = a.filterValuePlaceholder, t[49] = a.operators, t[50] = a.removeFilter, t[51] = E, t[52] = D, t[53] = n, t[54] = I;
|
|
880
|
+
} else I = t[54];
|
|
881
|
+
let ee = !k, te;
|
|
882
|
+
t[71] !== g || t[72] !== a.addFilter || t[73] !== ee ? (te = /* @__PURE__ */ U(l, {
|
|
470
883
|
variant: "subtle",
|
|
471
884
|
size: "compact-sm",
|
|
472
|
-
disabled:
|
|
473
|
-
onClick:
|
|
474
|
-
children:
|
|
475
|
-
}), t[
|
|
476
|
-
let
|
|
477
|
-
t[
|
|
885
|
+
disabled: ee,
|
|
886
|
+
onClick: g,
|
|
887
|
+
children: a.addFilter
|
|
888
|
+
}), t[71] = g, t[72] = a.addFilter, t[73] = ee, t[74] = te) : te = t[74];
|
|
889
|
+
let ne = d.length === 0, L;
|
|
890
|
+
t[75] !== C || t[76] !== a.clearAllFilters || t[77] !== ne ? (L = /* @__PURE__ */ U(l, {
|
|
478
891
|
variant: "subtle",
|
|
479
892
|
color: "gray",
|
|
480
893
|
size: "compact-sm",
|
|
481
|
-
disabled:
|
|
482
|
-
onClick:
|
|
483
|
-
children:
|
|
484
|
-
}), t[
|
|
485
|
-
let L;
|
|
486
|
-
t[53] !== P || t[54] !== I ? (L = /* @__PURE__ */ K("div", {
|
|
487
|
-
className: Je.filterPanelFooter,
|
|
488
|
-
children: [P, I]
|
|
489
|
-
}), t[53] = P, t[54] = I, t[55] = L) : L = t[55];
|
|
894
|
+
disabled: ne,
|
|
895
|
+
onClick: C,
|
|
896
|
+
children: a.clearAllFilters
|
|
897
|
+
}), t[75] = C, t[76] = a.clearAllFilters, t[77] = ne, t[78] = L) : L = t[78];
|
|
490
898
|
let R;
|
|
491
|
-
t[
|
|
899
|
+
t[79] !== te || t[80] !== L ? (R = /* @__PURE__ */ W("div", {
|
|
900
|
+
className: vt.filterPanelFooter,
|
|
901
|
+
children: [te, L]
|
|
902
|
+
}), t[79] = te, t[80] = L, t[81] = R) : R = t[81];
|
|
903
|
+
let re;
|
|
904
|
+
t[82] !== R || t[83] !== I ? (re = /* @__PURE__ */ W(y, {
|
|
492
905
|
gap: "xs",
|
|
493
|
-
children: [
|
|
494
|
-
}), t[
|
|
906
|
+
children: [I, R]
|
|
907
|
+
}), t[82] = R, t[83] = I, t[84] = re) : re = t[84];
|
|
495
908
|
let z;
|
|
496
|
-
return t[
|
|
497
|
-
ref:
|
|
909
|
+
return t[85] !== a.filters || t[86] !== re || t[87] !== j || t[88] !== F ? (z = /* @__PURE__ */ W("div", {
|
|
910
|
+
ref: f,
|
|
498
911
|
role: "group",
|
|
499
|
-
"aria-label":
|
|
500
|
-
className:
|
|
501
|
-
onKeyDown:
|
|
502
|
-
children: [
|
|
503
|
-
}), t[
|
|
912
|
+
"aria-label": A,
|
|
913
|
+
className: vt.filterPanel,
|
|
914
|
+
onKeyDown: j,
|
|
915
|
+
children: [F, re]
|
|
916
|
+
}), t[85] = a.filters, t[86] = re, t[87] = j, t[88] = F, t[89] = z) : z = t[89], z;
|
|
504
917
|
}
|
|
505
|
-
function
|
|
506
|
-
return {
|
|
507
|
-
value: e,
|
|
508
|
-
label: Ye[e]
|
|
509
|
-
};
|
|
510
|
-
}
|
|
511
|
-
function dt(e) {
|
|
918
|
+
function Kt(e) {
|
|
512
919
|
return {
|
|
513
920
|
value: e.id,
|
|
514
|
-
label:
|
|
921
|
+
label: et(e)
|
|
515
922
|
};
|
|
516
923
|
}
|
|
517
|
-
function
|
|
924
|
+
function qt(e) {
|
|
518
925
|
return e.getCanFilter();
|
|
519
926
|
}
|
|
520
|
-
function
|
|
927
|
+
function Jt(e) {
|
|
521
928
|
return e.columnFilters;
|
|
522
929
|
}
|
|
523
|
-
function
|
|
930
|
+
function Yt(e) {
|
|
524
931
|
return e.filterPanelOpen;
|
|
525
932
|
}
|
|
526
|
-
var
|
|
933
|
+
var Xt = {
|
|
527
934
|
filterPills: "_filterPills_1yybb_3",
|
|
528
935
|
pill: "_pill_1yybb_15",
|
|
529
936
|
pillLabel: "_pillLabel_1yybb_27"
|
|
530
|
-
},
|
|
937
|
+
}, Zt = {
|
|
938
|
+
operators: St,
|
|
939
|
+
manageColumns: "Manage columns",
|
|
940
|
+
filters: "Filters",
|
|
941
|
+
searchPlaceholder: "Search",
|
|
942
|
+
searchLabel: "Search rows",
|
|
943
|
+
clearSearch: "Clear search",
|
|
944
|
+
columnsSearchPlaceholder: "Search",
|
|
945
|
+
columnsNoMatch: (e) => `No columns match “${e}”`,
|
|
946
|
+
columnsShowHideAll: "Show/Hide All",
|
|
947
|
+
columnsReset: "RESET",
|
|
948
|
+
filterColumn: "Column",
|
|
949
|
+
filterOperator: "Operator",
|
|
950
|
+
filterValue: "Value",
|
|
951
|
+
filterValuePlaceholder: "Filter value",
|
|
952
|
+
booleanTrue: "Yes",
|
|
953
|
+
booleanFalse: "No",
|
|
954
|
+
addFilter: "Add filter",
|
|
955
|
+
clearAllFilters: "Clear all",
|
|
956
|
+
closeFilters: "Close filters",
|
|
957
|
+
removeFilter: "Remove filter",
|
|
958
|
+
activeFilters: "Active filters",
|
|
959
|
+
clearFilter: (e) => `Clear ${e} filter`,
|
|
960
|
+
sortAsc: "Sort by ASC",
|
|
961
|
+
sortDesc: "Sort by DESC",
|
|
962
|
+
filterMenuItem: "Filter",
|
|
963
|
+
groupBy: (e) => `Group by ${e}`,
|
|
964
|
+
ungroup: (e) => `Ungroup ${e}`,
|
|
965
|
+
expandAllGroups: "Expand all groups",
|
|
966
|
+
collapseAllGroups: "Collapse all groups",
|
|
967
|
+
pinLeft: "Pin to left",
|
|
968
|
+
pinRight: "Pin to right",
|
|
969
|
+
unpin: "Unpin",
|
|
970
|
+
moveLeft: "Move left",
|
|
971
|
+
moveRight: "Move right",
|
|
972
|
+
autosizeColumn: "Autosize column",
|
|
973
|
+
hideColumn: "Hide column",
|
|
974
|
+
filterOn: (e) => `Filter on ${e}`,
|
|
975
|
+
sortColumn: (e) => `Sort ${e}`,
|
|
976
|
+
columnMenu: (e) => `${e} column menu`,
|
|
977
|
+
rowsPerPage: "Rows per page:",
|
|
978
|
+
pageRange: ({ from: e, to: t, total: n }) => `${e}–${t} of ${n}`,
|
|
979
|
+
groupedAllRows: (e) => `Grouped · all ${e} rows`,
|
|
980
|
+
pagingSuspendedHint: "Paging is off while the rows are grouped: the whole tree is rendered and virtualized. Ungroup to page again.",
|
|
981
|
+
previousPage: "Previous page",
|
|
982
|
+
nextPage: "Next page",
|
|
983
|
+
noResults: "No rows match your filters",
|
|
984
|
+
loading: "Loading",
|
|
985
|
+
cellCount: (e) => e === 1 ? "1 cell" : `${e} cells`,
|
|
986
|
+
copy: "Copy",
|
|
987
|
+
exportCsv: "Export as CSV for Excel",
|
|
988
|
+
includeHeaders: "Include headers",
|
|
989
|
+
selectColumnLabel: "Checkbox selection",
|
|
990
|
+
selectAllRows: "Select all rows",
|
|
991
|
+
selectRow: "Select row",
|
|
992
|
+
selectGroup: "Select group",
|
|
993
|
+
detailsColumnLabel: "Details",
|
|
994
|
+
showDetails: "Show details",
|
|
995
|
+
hideDetails: "Hide details",
|
|
996
|
+
expandAllDetails: "Expand all details",
|
|
997
|
+
collapseAllDetails: "Collapse all details",
|
|
998
|
+
groupColumnLabel: "Group",
|
|
999
|
+
blankGroupValue: "(Blank)",
|
|
1000
|
+
expandGroup: (e) => `Expand ${e}`,
|
|
1001
|
+
collapseGroup: (e) => `Collapse ${e}`
|
|
1002
|
+
};
|
|
1003
|
+
function Qt(e) {
|
|
1004
|
+
return e ? {
|
|
1005
|
+
...Zt,
|
|
1006
|
+
...e,
|
|
1007
|
+
operators: {
|
|
1008
|
+
...Zt.operators,
|
|
1009
|
+
...e.operators
|
|
1010
|
+
}
|
|
1011
|
+
} : Zt;
|
|
1012
|
+
}
|
|
1013
|
+
//#endregion
|
|
1014
|
+
//#region src/tmdatagrid/core/persistence.ts
|
|
1015
|
+
var $t = [
|
|
531
1016
|
"columnFilters",
|
|
532
1017
|
"globalFilter",
|
|
533
1018
|
"sorting",
|
|
534
1019
|
"pagination",
|
|
535
1020
|
"expanded"
|
|
536
|
-
],
|
|
1021
|
+
], en = [
|
|
537
1022
|
"columnVisibility",
|
|
538
1023
|
"columnSizing",
|
|
539
1024
|
"columnOrder",
|
|
540
1025
|
"columnPinning",
|
|
541
1026
|
"grouping"
|
|
542
1027
|
];
|
|
543
|
-
function
|
|
1028
|
+
function tn(e, t) {
|
|
544
1029
|
if (!e) return null;
|
|
545
1030
|
if (typeof e == "string") return {
|
|
546
1031
|
key: e,
|
|
@@ -552,7 +1037,7 @@ function vt(e, t) {
|
|
|
552
1037
|
slices: r
|
|
553
1038
|
} : null;
|
|
554
1039
|
}
|
|
555
|
-
function
|
|
1040
|
+
function nn(e) {
|
|
556
1041
|
if (!e) return null;
|
|
557
1042
|
try {
|
|
558
1043
|
return typeof window > "u" ? null : e.storageMode === "sessionStorage" ? window.sessionStorage : window.localStorage;
|
|
@@ -560,36 +1045,36 @@ function yt(e) {
|
|
|
560
1045
|
return null;
|
|
561
1046
|
}
|
|
562
1047
|
}
|
|
563
|
-
function
|
|
1048
|
+
function rn(e, t) {
|
|
564
1049
|
return typeof e == "object" && e ? e[t] : void 0;
|
|
565
1050
|
}
|
|
566
|
-
var
|
|
567
|
-
function
|
|
1051
|
+
var an = (e) => typeof e == "string", on = (e) => typeof e == "number" && Number.isFinite(e);
|
|
1052
|
+
function sn(e, t) {
|
|
568
1053
|
return Array.isArray(e) && e.every(t);
|
|
569
1054
|
}
|
|
570
|
-
function
|
|
1055
|
+
function cn(e, t) {
|
|
571
1056
|
return typeof e != "object" || !e || Array.isArray(e) ? !1 : Object.values(e).every(t);
|
|
572
1057
|
}
|
|
573
|
-
var
|
|
574
|
-
columnFilters: (e) =>
|
|
1058
|
+
var ln = (e) => an(rn(e, "id")), un = {
|
|
1059
|
+
columnFilters: (e) => sn(e, ln),
|
|
575
1060
|
globalFilter: () => !0,
|
|
576
|
-
sorting: (e) =>
|
|
1061
|
+
sorting: (e) => sn(e, (e) => ln(e) && typeof rn(e, "desc") == "boolean"),
|
|
577
1062
|
pagination: (e) => {
|
|
578
|
-
let t =
|
|
579
|
-
return
|
|
1063
|
+
let t = rn(e, "pageIndex"), n = rn(e, "pageSize");
|
|
1064
|
+
return on(t) && t >= 0 && on(n) && n > 0;
|
|
580
1065
|
},
|
|
581
|
-
expanded: (e) => e === !0 ||
|
|
582
|
-
columnVisibility: (e) =>
|
|
583
|
-
columnSizing: (e) =>
|
|
584
|
-
columnOrder: (e) =>
|
|
585
|
-
columnPinning: (e) =>
|
|
586
|
-
grouping: (e) =>
|
|
1066
|
+
expanded: (e) => e === !0 || cn(e, (e) => typeof e == "boolean"),
|
|
1067
|
+
columnVisibility: (e) => cn(e, (e) => typeof e == "boolean"),
|
|
1068
|
+
columnSizing: (e) => cn(e, on),
|
|
1069
|
+
columnOrder: (e) => sn(e, an),
|
|
1070
|
+
columnPinning: (e) => sn(rn(e, "left"), an) && sn(rn(e, "right"), an),
|
|
1071
|
+
grouping: (e) => sn(e, an)
|
|
587
1072
|
};
|
|
588
|
-
function
|
|
589
|
-
let n =
|
|
1073
|
+
function dn(e, t) {
|
|
1074
|
+
let n = un[e];
|
|
590
1075
|
return n === void 0 || n(t);
|
|
591
1076
|
}
|
|
592
|
-
function
|
|
1077
|
+
function fn(e, t, n) {
|
|
593
1078
|
if (!e || !t) return {};
|
|
594
1079
|
try {
|
|
595
1080
|
let r = e.getItem(t.key);
|
|
@@ -597,13 +1082,13 @@ function Ot(e, t, n) {
|
|
|
597
1082
|
let i = n(r);
|
|
598
1083
|
if (typeof i != "object" || !i) return {};
|
|
599
1084
|
let a = i, o = {};
|
|
600
|
-
for (let e of t.slices) e in a &&
|
|
1085
|
+
for (let e of t.slices) e in a && dn(e, a[e]) && (o[e] = a[e]);
|
|
601
1086
|
return o;
|
|
602
1087
|
} catch {
|
|
603
1088
|
return {};
|
|
604
1089
|
}
|
|
605
1090
|
}
|
|
606
|
-
function
|
|
1091
|
+
function pn(e, t, n, r) {
|
|
607
1092
|
if (!e || !t) return;
|
|
608
1093
|
let i = {};
|
|
609
1094
|
for (let e of t.slices) i[e] = n[e];
|
|
@@ -611,65 +1096,69 @@ function kt(e, t, n, r) {
|
|
|
611
1096
|
e.setItem(t.key, r(i));
|
|
612
1097
|
} catch {}
|
|
613
1098
|
}
|
|
614
|
-
function
|
|
1099
|
+
function mn(e) {
|
|
615
1100
|
return {
|
|
616
|
-
data:
|
|
617
|
-
settings:
|
|
1101
|
+
data: tn(e?.dataKey, $t),
|
|
1102
|
+
settings: tn(e?.settingsKey, en)
|
|
618
1103
|
};
|
|
619
1104
|
}
|
|
620
|
-
function
|
|
621
|
-
let { data: t, settings: n } =
|
|
1105
|
+
function hn(e) {
|
|
1106
|
+
let { data: t, settings: n } = mn(e);
|
|
622
1107
|
return t !== null || n !== null;
|
|
623
1108
|
}
|
|
624
|
-
var
|
|
625
|
-
function
|
|
626
|
-
let t =
|
|
1109
|
+
var gn = (e) => JSON.parse(e), _n = (e) => JSON.stringify(e);
|
|
1110
|
+
function vn(e) {
|
|
1111
|
+
let t = nn(e), { data: n, settings: r } = mn(e), i = e?.deserialize ?? gn;
|
|
627
1112
|
return {
|
|
628
|
-
...
|
|
629
|
-
...
|
|
1113
|
+
...fn(t, r, i),
|
|
1114
|
+
...fn(t, n, i)
|
|
630
1115
|
};
|
|
631
1116
|
}
|
|
632
|
-
function
|
|
633
|
-
let n =
|
|
1117
|
+
function yn(e, t) {
|
|
1118
|
+
let n = nn(t);
|
|
634
1119
|
if (!n) return;
|
|
635
|
-
let { data: r, settings: i } =
|
|
636
|
-
|
|
1120
|
+
let { data: r, settings: i } = mn(t), a = t?.serialize ?? _n;
|
|
1121
|
+
pn(n, r, e, a), pn(n, i, e, a);
|
|
637
1122
|
}
|
|
638
1123
|
//#endregion
|
|
639
1124
|
//#region src/tmdatagrid/core/capabilities.ts
|
|
640
|
-
function
|
|
641
|
-
let t = e.selectionMode ?? "checkbox", n = t !== "highlight" && e.enableRowSelection !== !1;
|
|
1125
|
+
function bn(e) {
|
|
1126
|
+
let t = e.selectionMode ?? "checkbox", n = e.cellSelection ?? "none", r = t !== "highlight" && e.enableRowSelection !== !1;
|
|
642
1127
|
return {
|
|
643
1128
|
sorting: e.enableSorting !== !1,
|
|
644
1129
|
filtering: e.enableColumnFilters !== !1,
|
|
1130
|
+
globalFiltering: e.enableGlobalFilter !== !1,
|
|
645
1131
|
hiding: e.enableHiding !== !1,
|
|
646
1132
|
pinning: e.enableColumnPinning !== !1,
|
|
647
1133
|
resizing: e.enableColumnResizing !== !1,
|
|
648
1134
|
ordering: e.enableColumnOrdering !== !1,
|
|
649
|
-
rowSelection:
|
|
1135
|
+
rowSelection: r,
|
|
650
1136
|
selectionMode: t,
|
|
651
|
-
selectColumn:
|
|
652
|
-
rowClickSelects:
|
|
1137
|
+
selectColumn: r && (t === "checkbox" || t === "checkboxAndHighlight"),
|
|
1138
|
+
rowClickSelects: r && t === "row",
|
|
653
1139
|
multiRowSelection: e.enableMultiRowSelection !== !1,
|
|
654
1140
|
showSelectedBackground: e.showSelectedBackground ?? t === "row",
|
|
655
1141
|
highlightRow: t === "checkboxAndHighlight" || t === "highlight",
|
|
1142
|
+
cellSelection: n !== "none",
|
|
1143
|
+
cellSelectionMode: n,
|
|
1144
|
+
cellRangeSelection: n === "range",
|
|
656
1145
|
pagination: e.enablePagination === !0 || e.manualPagination === !0,
|
|
657
1146
|
grouping: e.enableGrouping ?? e.manualPagination !== !0
|
|
658
1147
|
};
|
|
659
1148
|
}
|
|
660
|
-
function
|
|
1149
|
+
function xn(e, t) {
|
|
661
1150
|
return {
|
|
662
1151
|
canSort: t.sorting && e.getCanSort(),
|
|
663
1152
|
canFilter: t.filtering && e.getCanFilter(),
|
|
664
1153
|
canHide: t.hiding && e.getCanHide(),
|
|
665
1154
|
canPin: t.pinning && e.getCanPin(),
|
|
666
1155
|
canResize: t.resizing && e.getCanResize(),
|
|
667
|
-
canReorder: t.ordering &&
|
|
1156
|
+
canReorder: t.ordering && it(e),
|
|
668
1157
|
canGroup: t.grouping && e.getCanGroup()
|
|
669
1158
|
};
|
|
670
1159
|
}
|
|
671
|
-
function
|
|
672
|
-
let n = e.getAllLeafColumns(), r = (e) => n.some((n) => e(
|
|
1160
|
+
function Sn(e, t) {
|
|
1161
|
+
let n = e.getAllLeafColumns(), r = (e) => n.some((n) => e(xn(n, t)));
|
|
673
1162
|
return {
|
|
674
1163
|
canSortAny: r((e) => e.canSort),
|
|
675
1164
|
canFilterAny: r((e) => e.canFilter),
|
|
@@ -678,189 +1167,75 @@ function Rt(e, t) {
|
|
|
678
1167
|
canReorderAny: r((e) => e.canReorder),
|
|
679
1168
|
canGroupAny: r((e) => e.canGroup),
|
|
680
1169
|
canSelectRows: t.rowSelection,
|
|
681
|
-
canPaginate: t.pagination
|
|
1170
|
+
canPaginate: t.pagination,
|
|
1171
|
+
canSearch: t.globalFiltering && n.some((e) => e.getCanGlobalFilter())
|
|
682
1172
|
};
|
|
683
1173
|
}
|
|
684
1174
|
//#endregion
|
|
685
|
-
//#region src/tmdatagrid/core/
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
selection: i,
|
|
704
|
-
anchorRowId: n
|
|
705
|
-
};
|
|
706
|
-
if (!s.getCanMultiSelect()) {
|
|
707
|
-
let e = c.length === 1 ? c[0] : void 0;
|
|
708
|
-
return e === void 0 ? {
|
|
709
|
-
selection: i,
|
|
710
|
-
anchorRowId: n
|
|
711
|
-
} : {
|
|
712
|
-
selection: !a && i[e] === !0 ? {} : { [e]: !0 },
|
|
713
|
-
anchorRowId: t
|
|
714
|
-
};
|
|
715
|
-
}
|
|
716
|
-
let l = n === null ? -1 : e.findIndex((e) => e.id === n);
|
|
717
|
-
if (r.extend && l !== -1) {
|
|
718
|
-
let t = Math.min(l, o), s = Math.max(l, o), c = r.toggle || !a ? { ...i } : {};
|
|
719
|
-
for (let n of e.slice(t, s + 1)) for (let e of Vt(n)) c[e] = !0;
|
|
720
|
-
return {
|
|
721
|
-
selection: c,
|
|
722
|
-
anchorRowId: n
|
|
723
|
-
};
|
|
724
|
-
}
|
|
725
|
-
if (r.toggle || !a) {
|
|
726
|
-
let e = { ...i }, n = c.every((e) => i[e] === !0);
|
|
727
|
-
for (let t of c) n ? delete e[t] : e[t] = !0;
|
|
728
|
-
return {
|
|
729
|
-
selection: e,
|
|
730
|
-
anchorRowId: t
|
|
731
|
-
};
|
|
1175
|
+
//#region src/tmdatagrid/core/cellNavigation.ts
|
|
1176
|
+
var Cn = (e, t) => Math.min(Math.max(e, 0), Math.max(t, 0));
|
|
1177
|
+
function wn({ key: e, ctrlKey: t, from: n, rowCount: r, columnCount: i, pageRows: a }) {
|
|
1178
|
+
if (r === 0 || i === 0) return null;
|
|
1179
|
+
let o = r - 1, s = i - 1, c = (e, t) => ({
|
|
1180
|
+
rowIndex: Cn(e, o),
|
|
1181
|
+
columnIndex: Cn(t, s)
|
|
1182
|
+
});
|
|
1183
|
+
switch (e) {
|
|
1184
|
+
case "ArrowDown": return c(n.rowIndex + 1, n.columnIndex);
|
|
1185
|
+
case "ArrowUp": return c(n.rowIndex - 1, n.columnIndex);
|
|
1186
|
+
case "ArrowRight": return c(n.rowIndex, n.columnIndex + 1);
|
|
1187
|
+
case "ArrowLeft": return c(n.rowIndex, n.columnIndex - 1);
|
|
1188
|
+
case "PageDown": return c(n.rowIndex + Math.max(a, 1), n.columnIndex);
|
|
1189
|
+
case "PageUp": return c(n.rowIndex - Math.max(a, 1), n.columnIndex);
|
|
1190
|
+
case "Home": return c(t ? 0 : n.rowIndex, 0);
|
|
1191
|
+
case "End": return c(t ? o : n.rowIndex, s);
|
|
1192
|
+
default: return null;
|
|
732
1193
|
}
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
return
|
|
736
|
-
selection: u,
|
|
737
|
-
anchorRowId: t
|
|
738
|
-
};
|
|
739
|
-
}
|
|
740
|
-
//#endregion
|
|
741
|
-
//#region src/tmdatagrid/components/TMDataGridSelectColumn.tsx
|
|
742
|
-
var Ut = "__select__";
|
|
743
|
-
function Wt(t) {
|
|
744
|
-
let n = e(10), { table: r } = t, i;
|
|
745
|
-
n[0] === r ? i = n[1] : (i = () => r.getIsAllRowsSelected(), n[0] = r, n[1] = i);
|
|
746
|
-
let a = C(r.store, i), o;
|
|
747
|
-
n[2] === r ? o = n[3] : (o = () => r.getIsSomeRowsSelected(), n[2] = r, n[3] = o);
|
|
748
|
-
let s = C(r.store, o) && !a, c;
|
|
749
|
-
n[4] === r ? c = n[5] : (c = r.getToggleAllRowsSelectedHandler(), n[4] = r, n[5] = c);
|
|
750
|
-
let u;
|
|
751
|
-
return n[6] !== a || n[7] !== s || n[8] !== c ? (u = /* @__PURE__ */ G(l, {
|
|
752
|
-
size: "xs",
|
|
753
|
-
"aria-label": "Select all rows",
|
|
754
|
-
checked: a,
|
|
755
|
-
indeterminate: s,
|
|
756
|
-
onChange: c
|
|
757
|
-
}), n[6] = a, n[7] = s, n[8] = c, n[9] = u) : u = n[9], u;
|
|
758
|
-
}
|
|
759
|
-
function Gt(t) {
|
|
760
|
-
let n = e(2), { table: r } = t, { features: i } = je();
|
|
761
|
-
if (!i.multiRowSelection) return null;
|
|
762
|
-
let a;
|
|
763
|
-
return n[0] === r ? a = n[1] : (a = /* @__PURE__ */ G(Wt, { table: r }), n[0] = r, n[1] = a), a;
|
|
764
|
-
}
|
|
765
|
-
function Kt(t) {
|
|
766
|
-
let n = e(19), { row: r } = t, { ui: i, features: a } = je(), o = r.subRows.length > 0, s;
|
|
767
|
-
n[0] !== o || n[1] !== r ? (s = () => o ? r.getIsAllSubRowsSelected() : r.getIsSelected(), n[0] = o, n[1] = r, n[2] = s) : s = n[2];
|
|
768
|
-
let c = C(r.table.store, s), u;
|
|
769
|
-
n[3] === r ? u = n[4] : (u = () => r.getIsSomeSelected(), n[3] = r, n[4] = u);
|
|
770
|
-
let d = C(r.table.store, u), f;
|
|
771
|
-
n[5] === r ? f = n[6] : (f = Vt(r), n[5] = r, n[6] = f);
|
|
772
|
-
let p = f;
|
|
773
|
-
if (o && !r.getCanMultiSelect()) return null;
|
|
774
|
-
let m = o ? "Select group" : "Select row", h = p.length === 0, g = d && !c, _;
|
|
775
|
-
n[7] !== a || n[8] !== r.id || n[9] !== r.table || n[10] !== i.actions || n[11] !== i.state.selectionAnchorRowId ? (_ = (e) => {
|
|
776
|
-
let t = e.nativeEvent, n = t instanceof MouseEvent, o = Ht({
|
|
777
|
-
rows: zt(r.table, a),
|
|
778
|
-
rowId: r.id,
|
|
779
|
-
anchorRowId: i.state.selectionAnchorRowId,
|
|
780
|
-
modifiers: {
|
|
781
|
-
toggle: n && (t.ctrlKey || t.metaKey),
|
|
782
|
-
extend: n && t.shiftKey
|
|
783
|
-
},
|
|
784
|
-
selection: r.table.store.state.rowSelection,
|
|
785
|
-
canReplaceSelection: !1
|
|
786
|
-
});
|
|
787
|
-
r.table.setRowSelection(o.selection), i.actions.setSelectionAnchor(o.anchorRowId);
|
|
788
|
-
}, n[7] = a, n[8] = r.id, n[9] = r.table, n[10] = i.actions, n[11] = i.state.selectionAnchorRowId, n[12] = _) : _ = n[12];
|
|
789
|
-
let v;
|
|
790
|
-
return n[13] !== c || n[14] !== m || n[15] !== h || n[16] !== g || n[17] !== _ ? (v = /* @__PURE__ */ G(l, {
|
|
791
|
-
size: "xs",
|
|
792
|
-
"aria-label": m,
|
|
793
|
-
checked: c,
|
|
794
|
-
disabled: h,
|
|
795
|
-
indeterminate: g,
|
|
796
|
-
onChange: _,
|
|
797
|
-
onClick: qt
|
|
798
|
-
}), n[13] = c, n[14] = m, n[15] = h, n[16] = g, n[17] = _, n[18] = v) : v = n[18], v;
|
|
799
|
-
}
|
|
800
|
-
function qt(e) {
|
|
801
|
-
return e.stopPropagation();
|
|
802
|
-
}
|
|
803
|
-
function Jt() {
|
|
804
|
-
return {
|
|
805
|
-
id: Ut,
|
|
806
|
-
meta: {
|
|
807
|
-
label: "Checkbox selection",
|
|
808
|
-
align: "center",
|
|
809
|
-
enableOrdering: !1
|
|
810
|
-
},
|
|
811
|
-
size: 48,
|
|
812
|
-
minSize: 48,
|
|
813
|
-
maxSize: 48,
|
|
814
|
-
enableResizing: !1,
|
|
815
|
-
enableSorting: !1,
|
|
816
|
-
enableColumnFilter: !1,
|
|
817
|
-
enableGlobalFilter: !1,
|
|
818
|
-
enablePinning: !1,
|
|
819
|
-
header: ({ table: e }) => /* @__PURE__ */ G(Gt, { table: e }),
|
|
820
|
-
cell: ({ row: e }) => /* @__PURE__ */ G(Kt, { row: e }),
|
|
821
|
-
aggregatedCell: ({ row: e }) => /* @__PURE__ */ G(Kt, { row: e })
|
|
822
|
-
};
|
|
1194
|
+
}
|
|
1195
|
+
function Tn(e, t) {
|
|
1196
|
+
return e === null || t === null ? e === t : e.rowId === t.rowId && e.columnId === t.columnId;
|
|
823
1197
|
}
|
|
824
1198
|
//#endregion
|
|
825
1199
|
//#region src/tmdatagrid/useTMDataGrid.tsx
|
|
826
|
-
var
|
|
827
|
-
columnFilteringFeature:
|
|
828
|
-
globalFilteringFeature:
|
|
829
|
-
rowSortingFeature:
|
|
830
|
-
rowPaginationFeature:
|
|
831
|
-
rowSelectionFeature:
|
|
832
|
-
columnPinningFeature:
|
|
833
|
-
columnVisibilityFeature:
|
|
834
|
-
columnOrderingFeature:
|
|
835
|
-
columnSizingFeature:
|
|
836
|
-
columnResizingFeature:
|
|
837
|
-
columnFacetingFeature:
|
|
838
|
-
columnGroupingFeature:
|
|
839
|
-
rowExpandingFeature:
|
|
840
|
-
filteredRowModel:
|
|
841
|
-
groupedRowModel:
|
|
842
|
-
sortedRowModel:
|
|
843
|
-
expandedRowModel:
|
|
844
|
-
paginatedRowModel:
|
|
845
|
-
facetedRowModel:
|
|
846
|
-
facetedMinMaxValues:
|
|
847
|
-
facetedUniqueValues:
|
|
1200
|
+
var En = 200, Dn = Oe({
|
|
1201
|
+
columnFilteringFeature: se,
|
|
1202
|
+
globalFilteringFeature: Se,
|
|
1203
|
+
rowSortingFeature: Ee,
|
|
1204
|
+
rowPaginationFeature: we,
|
|
1205
|
+
rowSelectionFeature: Te,
|
|
1206
|
+
columnPinningFeature: ue,
|
|
1207
|
+
columnVisibilityFeature: pe,
|
|
1208
|
+
columnOrderingFeature: le,
|
|
1209
|
+
columnSizingFeature: fe,
|
|
1210
|
+
columnResizingFeature: de,
|
|
1211
|
+
columnFacetingFeature: oe,
|
|
1212
|
+
columnGroupingFeature: ce,
|
|
1213
|
+
rowExpandingFeature: Y,
|
|
1214
|
+
filteredRowModel: ye(),
|
|
1215
|
+
groupedRowModel: be(),
|
|
1216
|
+
sortedRowModel: q(),
|
|
1217
|
+
expandedRowModel: he(),
|
|
1218
|
+
paginatedRowModel: K(),
|
|
1219
|
+
facetedRowModel: _e(),
|
|
1220
|
+
facetedMinMaxValues: ge(),
|
|
1221
|
+
facetedUniqueValues: ve(),
|
|
848
1222
|
filterFns: {
|
|
849
|
-
...
|
|
850
|
-
tmDataGrid:
|
|
1223
|
+
...J,
|
|
1224
|
+
tmDataGrid: Ht
|
|
851
1225
|
},
|
|
852
|
-
sortFns:
|
|
853
|
-
aggregationFns:
|
|
854
|
-
tableMeta:
|
|
855
|
-
columnMeta:
|
|
1226
|
+
sortFns: De,
|
|
1227
|
+
aggregationFns: G,
|
|
1228
|
+
tableMeta: Ce(),
|
|
1229
|
+
columnMeta: Ce()
|
|
856
1230
|
});
|
|
857
|
-
function
|
|
858
|
-
return
|
|
1231
|
+
function On() {
|
|
1232
|
+
return me();
|
|
859
1233
|
}
|
|
860
|
-
|
|
1234
|
+
var kn = 160, An = 6;
|
|
1235
|
+
function jn(e) {
|
|
861
1236
|
return e.map((e) => "columns" in e && Array.isArray(e.columns) ? {
|
|
862
1237
|
...e,
|
|
863
|
-
columns:
|
|
1238
|
+
columns: jn(e.columns)
|
|
864
1239
|
} : {
|
|
865
1240
|
filterFn: "tmDataGrid",
|
|
866
1241
|
aggregationFn: void 0,
|
|
@@ -868,271 +1243,246 @@ function Qt(e) {
|
|
|
868
1243
|
...e
|
|
869
1244
|
});
|
|
870
1245
|
}
|
|
871
|
-
function
|
|
872
|
-
let
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
let e = Qt(c.columns), t;
|
|
886
|
-
n[10] === p ? t = n[11] : (t = p ? [Jt()] : [], n[10] = p, n[11] = t);
|
|
887
|
-
let r;
|
|
888
|
-
n[12] === m ? r = n[13] : (r = m ? [Ue()] : [], n[12] = m, n[13] = r), h = [
|
|
889
|
-
...t,
|
|
890
|
-
...r,
|
|
1246
|
+
function Mn({ persist: e, labels: t, enableColumnOrdering: n, enablePagination: r, selectionMode: c, showSelectedBackground: l, defaultHighlightedRowId: u, onHighlightedRowChange: d, cellSelection: f, onFocusedCellChange: p, renderDetails: m, renderDetailsEstHeight: h = kn, overscan: g = An, ..._ }) {
|
|
1247
|
+
let v = bn({
|
|
1248
|
+
..._,
|
|
1249
|
+
enableColumnOrdering: n,
|
|
1250
|
+
enablePagination: r,
|
|
1251
|
+
selectionMode: c,
|
|
1252
|
+
showSelectedBackground: l,
|
|
1253
|
+
cellSelection: f
|
|
1254
|
+
}), y = a(() => Qt(t), [t]), b = _.enableColumnPinning !== !1, x = v.selectColumn, S = v.grouping, C = m !== void 0, T = y.selectColumnLabel, E = y.groupColumnLabel, D = y.detailsColumnLabel, O = a(() => {
|
|
1255
|
+
let e = jn(_.columns);
|
|
1256
|
+
return [
|
|
1257
|
+
...x ? [$e(T)] : [],
|
|
1258
|
+
...S ? [pt(E)] : [],
|
|
1259
|
+
...C ? [Ue(D)] : [],
|
|
891
1260
|
...e
|
|
892
|
-
]
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
...C,
|
|
903
|
-
...v.columnVisibility,
|
|
904
|
-
...w
|
|
905
|
-
}, n[22] = v.columnVisibility, n[23] = C, n[24] = w, n[25] = T) : T = n[25];
|
|
906
|
-
let E;
|
|
907
|
-
n[26] !== f || n[27] !== p ? (E = p && f ? [Ut] : [], n[26] = f, n[27] = p, n[28] = E) : E = n[28];
|
|
908
|
-
let D;
|
|
909
|
-
n[29] !== m || n[30] !== f ? (D = m && f ? [Re] : [], n[29] = m, n[30] = f, n[31] = D) : D = n[31];
|
|
910
|
-
let O;
|
|
911
|
-
n[32] !== c.initialState?.columnPinning?.left || n[33] !== v.columnPinning?.left || n[34] !== D || n[35] !== E ? (O = [
|
|
912
|
-
...E,
|
|
913
|
-
...D,
|
|
914
|
-
...(v.columnPinning?.left ?? c.initialState?.columnPinning?.left ?? []).filter(on)
|
|
915
|
-
], n[32] = c.initialState?.columnPinning?.left, n[33] = v.columnPinning?.left, n[34] = D, n[35] = E, n[36] = O) : O = n[36];
|
|
916
|
-
let k;
|
|
917
|
-
n[37] !== c.initialState?.columnPinning?.right || n[38] !== v.columnPinning?.right ? (k = v.columnPinning?.right ?? c.initialState?.columnPinning?.right ?? [], n[37] = c.initialState?.columnPinning?.right, n[38] = v.columnPinning?.right, n[39] = k) : k = n[39];
|
|
918
|
-
let A;
|
|
919
|
-
n[40] !== O || n[41] !== k ? (A = {
|
|
920
|
-
left: O,
|
|
921
|
-
right: k
|
|
922
|
-
}, n[40] = O, n[41] = k, n[42] = A) : A = n[42];
|
|
923
|
-
let j = c.initialState?.pagination, M;
|
|
924
|
-
n[43] !== v.pagination || n[44] !== j ? (M = {
|
|
925
|
-
pageIndex: 0,
|
|
926
|
-
pageSize: 25,
|
|
927
|
-
...j,
|
|
928
|
-
...v.pagination
|
|
929
|
-
}, n[43] = v.pagination, n[44] = j, n[45] = M) : M = n[45];
|
|
930
|
-
let N;
|
|
931
|
-
n[46] !== c.initialState || n[47] !== v || n[48] !== A || n[49] !== M || n[50] !== T ? (N = {
|
|
932
|
-
...c.initialState,
|
|
933
|
-
...v,
|
|
934
|
-
columnVisibility: T,
|
|
935
|
-
columnPinning: A,
|
|
936
|
-
pagination: M
|
|
937
|
-
}, n[46] = c.initialState, n[47] = v, n[48] = A, n[49] = M, n[50] = T, n[51] = N) : N = n[51];
|
|
938
|
-
let P;
|
|
939
|
-
n[52] !== c || n[53] !== N || n[54] !== x ? (P = {
|
|
1261
|
+
];
|
|
1262
|
+
}, [
|
|
1263
|
+
_.columns,
|
|
1264
|
+
x,
|
|
1265
|
+
C,
|
|
1266
|
+
S,
|
|
1267
|
+
T,
|
|
1268
|
+
E,
|
|
1269
|
+
D
|
|
1270
|
+
]), [k] = s(() => vn(e)), A = k.grouping ?? _.initialState?.grouping ?? [], j = ke({
|
|
940
1271
|
columnResizeMode: "onChange",
|
|
941
1272
|
enableSorting: !0,
|
|
942
1273
|
enableColumnResizing: !0,
|
|
943
1274
|
globalFilterFn: "includesString",
|
|
944
1275
|
groupedColumnMode: "remove",
|
|
945
|
-
...
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
1276
|
+
..._,
|
|
1277
|
+
...m === void 0 ? {} : { getRowCanExpand: _.getRowCanExpand ?? (() => !0) },
|
|
1278
|
+
features: Dn,
|
|
1279
|
+
columns: O,
|
|
1280
|
+
initialState: {
|
|
1281
|
+
..._.initialState,
|
|
1282
|
+
...k,
|
|
1283
|
+
columnVisibility: {
|
|
1284
|
+
..._.initialState?.columnVisibility,
|
|
1285
|
+
...k.columnVisibility,
|
|
1286
|
+
...S ? { [ot]: A.length > 0 } : {}
|
|
1287
|
+
},
|
|
1288
|
+
columnPinning: {
|
|
1289
|
+
left: [
|
|
1290
|
+
...x && b ? [Q] : [],
|
|
1291
|
+
...S && b ? [ot] : [],
|
|
1292
|
+
...C && b ? [Be] : [],
|
|
1293
|
+
...(k.columnPinning?.left ?? _.initialState?.columnPinning?.left ?? []).filter((e) => e !== "__select__" && e !== "__details__" && e !== "__group__")
|
|
1294
|
+
],
|
|
1295
|
+
right: k.columnPinning?.right ?? _.initialState?.columnPinning?.right ?? []
|
|
1296
|
+
},
|
|
1297
|
+
pagination: {
|
|
1298
|
+
pageIndex: 0,
|
|
1299
|
+
pageSize: 25,
|
|
1300
|
+
..._.initialState?.pagination,
|
|
1301
|
+
...k.pagination
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
});
|
|
1305
|
+
i(() => {
|
|
1306
|
+
if (!S) return;
|
|
1307
|
+
let e = j.store.state.grouping, t = j.store.subscribe((t) => {
|
|
1308
|
+
t.grouping !== e && (e = t.grouping, j.setColumnVisibility((e) => ({
|
|
955
1309
|
...e,
|
|
956
|
-
[
|
|
957
|
-
})),
|
|
1310
|
+
[ot]: t.grouping.length > 0
|
|
1311
|
+
})), j.setColumnOrder((e) => [...e]));
|
|
958
1312
|
});
|
|
959
1313
|
return () => t.unsubscribe();
|
|
960
|
-
},
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
}, r = F.store.subscribe((r) => {
|
|
968
|
-
t = r, e !== void 0 && clearTimeout(e), e = setTimeout(n, Yt);
|
|
1314
|
+
}, [S, j]), i(() => {
|
|
1315
|
+
if (!hn(e)) return;
|
|
1316
|
+
yn(j.store.state, e);
|
|
1317
|
+
let t, n = null, r = () => {
|
|
1318
|
+
t = void 0, n !== null && (yn(n, e), n = null);
|
|
1319
|
+
}, i = j.store.subscribe((e) => {
|
|
1320
|
+
n = e, t !== void 0 && clearTimeout(t), t = setTimeout(r, En);
|
|
969
1321
|
});
|
|
970
1322
|
return () => {
|
|
971
|
-
|
|
1323
|
+
i.unsubscribe(), t !== void 0 && clearTimeout(t), r();
|
|
972
1324
|
};
|
|
973
|
-
},
|
|
974
|
-
let
|
|
975
|
-
n[64] === B ? V = n[65] : (V = {
|
|
1325
|
+
}, [e, j]);
|
|
1326
|
+
let M = w({
|
|
976
1327
|
filterPanelOpen: !1,
|
|
977
1328
|
columnsPanelOpen: !1,
|
|
978
1329
|
filterPanelColumnId: null,
|
|
979
1330
|
draggedColumnId: null,
|
|
980
|
-
highlightedRowId:
|
|
981
|
-
selectionAnchorRowId: null
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
let e = H.state.highlightedRowId, t = H.subscribe((t) => {
|
|
990
|
-
t.highlightedRowId !== e && (e = t.highlightedRowId, U.current?.(t.highlightedRowId));
|
|
991
|
-
});
|
|
992
|
-
return () => t.unsubscribe();
|
|
993
|
-
}, K = [H], n[69] = H, n[70] = G, n[71] = K), i(G, K);
|
|
994
|
-
let q;
|
|
995
|
-
return n[72] !== d || n[73] !== F || n[74] !== H ? (q = {
|
|
996
|
-
table: F,
|
|
997
|
-
ui: H,
|
|
998
|
-
features: d
|
|
999
|
-
}, n[72] = d, n[73] = F, n[74] = H, n[75] = q) : q = n[75], q;
|
|
1000
|
-
}
|
|
1001
|
-
function en(e) {
|
|
1002
|
-
let { setState: t } = e;
|
|
1003
|
-
return {
|
|
1004
|
-
openFilterPanel: (e) => {
|
|
1005
|
-
let n = e === void 0 ? null : e;
|
|
1006
|
-
return t((e) => ({
|
|
1007
|
-
...e,
|
|
1008
|
-
filterPanelOpen: !0,
|
|
1009
|
-
filterPanelColumnId: n
|
|
1010
|
-
}));
|
|
1011
|
-
},
|
|
1012
|
-
closeFilterPanel: () => t(rn),
|
|
1013
|
-
setColumnsPanelOpen: (e) => t((t) => ({
|
|
1014
|
-
...t,
|
|
1015
|
-
columnsPanelOpen: e
|
|
1331
|
+
highlightedRowId: u ?? null,
|
|
1332
|
+
selectionAnchorRowId: null,
|
|
1333
|
+
focusedCell: null,
|
|
1334
|
+
cellRange: null
|
|
1335
|
+
}, ({ setState: e }) => ({
|
|
1336
|
+
openFilterPanel: (t = null) => e((e) => ({
|
|
1337
|
+
...e,
|
|
1338
|
+
filterPanelOpen: !0,
|
|
1339
|
+
filterPanelColumnId: t
|
|
1016
1340
|
})),
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1341
|
+
closeFilterPanel: () => e((e) => ({
|
|
1342
|
+
...e,
|
|
1343
|
+
filterPanelOpen: !1,
|
|
1344
|
+
filterPanelColumnId: null
|
|
1021
1345
|
})),
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
highlightedRowId: e
|
|
1346
|
+
setColumnsPanelOpen: (t) => e((e) => ({
|
|
1347
|
+
...e,
|
|
1348
|
+
columnsPanelOpen: t
|
|
1026
1349
|
})),
|
|
1027
|
-
|
|
1028
|
-
...
|
|
1029
|
-
|
|
1030
|
-
}))
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
}
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1350
|
+
toggleColumnsPanel: () => e((e) => ({
|
|
1351
|
+
...e,
|
|
1352
|
+
columnsPanelOpen: !e.columnsPanelOpen
|
|
1353
|
+
})),
|
|
1354
|
+
startColumnDrag: (t) => e((e) => ({
|
|
1355
|
+
...e,
|
|
1356
|
+
draggedColumnId: t
|
|
1357
|
+
})),
|
|
1358
|
+
endColumnDrag: () => e((e) => ({
|
|
1359
|
+
...e,
|
|
1360
|
+
draggedColumnId: null
|
|
1361
|
+
})),
|
|
1362
|
+
setHighlightedRow: (t) => e((e) => ({
|
|
1363
|
+
...e,
|
|
1364
|
+
highlightedRowId: t
|
|
1365
|
+
})),
|
|
1366
|
+
setSelectionAnchor: (t) => e((e) => ({
|
|
1367
|
+
...e,
|
|
1368
|
+
selectionAnchorRowId: t
|
|
1369
|
+
})),
|
|
1370
|
+
setFocusedCell: (t) => e((e) => Tn(e.focusedCell, t) ? e : {
|
|
1371
|
+
...e,
|
|
1372
|
+
focusedCell: t
|
|
1373
|
+
}),
|
|
1374
|
+
setCellRange: (t) => e((e) => Tn(e.cellRange?.anchor ?? null, t?.anchor ?? null) && Tn(e.cellRange?.focus ?? null, t?.focus ?? null) ? e : {
|
|
1375
|
+
...e,
|
|
1376
|
+
cellRange: t
|
|
1377
|
+
})
|
|
1378
|
+
})), N = o(d);
|
|
1379
|
+
i(() => {
|
|
1380
|
+
N.current = d;
|
|
1381
|
+
}, [d]), i(() => {
|
|
1382
|
+
let e = M.state.highlightedRowId, t = M.subscribe((t) => {
|
|
1383
|
+
t.highlightedRowId !== e && (e = t.highlightedRowId, N.current?.(t.highlightedRowId));
|
|
1384
|
+
});
|
|
1385
|
+
return () => t.unsubscribe();
|
|
1386
|
+
}, [M]);
|
|
1387
|
+
let P = o(p);
|
|
1388
|
+
return i(() => {
|
|
1389
|
+
P.current = p;
|
|
1390
|
+
}, [p]), i(() => {
|
|
1391
|
+
let e = M.state.focusedCell, t = M.subscribe((t) => {
|
|
1392
|
+
t.focusedCell !== e && (e = t.focusedCell, P.current?.(t.focusedCell));
|
|
1393
|
+
});
|
|
1394
|
+
return () => t.unsubscribe();
|
|
1395
|
+
}, [M]), {
|
|
1396
|
+
table: j,
|
|
1397
|
+
ui: M,
|
|
1398
|
+
features: v,
|
|
1399
|
+
labels: y,
|
|
1400
|
+
renderDetails: m,
|
|
1401
|
+
renderDetailsEstHeight: h,
|
|
1402
|
+
overscan: g
|
|
1050
1403
|
};
|
|
1051
1404
|
}
|
|
1052
|
-
function
|
|
1053
|
-
return [...e];
|
|
1054
|
-
}
|
|
1055
|
-
function on(e) {
|
|
1056
|
-
return e !== "__select__" && e !== "__group__";
|
|
1057
|
-
}
|
|
1058
|
-
function sn(e, t) {
|
|
1405
|
+
function Nn(e, t) {
|
|
1059
1406
|
let n = e.table.getColumn(t);
|
|
1060
1407
|
n && n.getFilterValue() === void 0 && n.setFilterValue({
|
|
1061
|
-
operator:
|
|
1408
|
+
operator: Nt(n.columnDef.meta?.type ?? "string"),
|
|
1062
1409
|
value: ""
|
|
1063
1410
|
}), e.ui.actions.openFilterPanel(t);
|
|
1064
1411
|
}
|
|
1065
1412
|
//#endregion
|
|
1066
1413
|
//#region src/tmdatagrid/components/TMDataGridFilterPills.tsx
|
|
1067
|
-
function
|
|
1068
|
-
let n = e(
|
|
1069
|
-
if (n[0] !== r || n[1] !== s || n[2] !==
|
|
1414
|
+
function Pn(t) {
|
|
1415
|
+
let n = e(39), { api: r, size: i, showClearAll: a, onPillClick: o, className: s } = t, c = i === void 0 ? "sm" : i, u = a === void 0 || a, { table: d, labels: f } = r, p = T(d.store, In), m, g, _, v, y, b, x, S;
|
|
1416
|
+
if (n[0] !== r || n[1] !== s || n[2] !== p || n[3] !== f || n[4] !== o || n[5] !== c || n[6] !== d) {
|
|
1070
1417
|
S = Symbol.for("react.early_return_sentinel");
|
|
1071
1418
|
bb0: {
|
|
1072
|
-
if (
|
|
1419
|
+
if (g = p.filter(Fn), g.length === 0) {
|
|
1073
1420
|
S = null;
|
|
1074
1421
|
break bb0;
|
|
1075
1422
|
}
|
|
1076
|
-
|
|
1423
|
+
y = "group", b = f.activeFilters;
|
|
1077
1424
|
let e;
|
|
1078
|
-
n[
|
|
1425
|
+
n[15] === s ? e = n[16] : (e = [Xt.filterPills, s].filter(Boolean), n[15] = s, n[16] = e), x = e.join(" "), m = h.Group, _ = c;
|
|
1079
1426
|
let t;
|
|
1080
|
-
n[
|
|
1081
|
-
let t = d.getColumn(e.id), n = t ?
|
|
1082
|
-
return
|
|
1083
|
-
size:
|
|
1084
|
-
className:
|
|
1427
|
+
n[17] !== r || n[18] !== p || n[19] !== f || n[20] !== o || n[21] !== c || n[22] !== d ? (t = (e) => {
|
|
1428
|
+
let t = d.getColumn(e.id), n = t ? et(t) : e.id, i = e.value;
|
|
1429
|
+
return It(i) ? /* @__PURE__ */ U(h, {
|
|
1430
|
+
size: c,
|
|
1431
|
+
className: Xt.pill,
|
|
1085
1432
|
withRemoveButton: !0,
|
|
1086
|
-
onRemove: () => d.setColumnFilters(
|
|
1433
|
+
onRemove: () => d.setColumnFilters(p.filter((t) => t.id !== e.id)),
|
|
1087
1434
|
removeButtonProps: {
|
|
1088
|
-
"aria-label":
|
|
1435
|
+
"aria-label": f.clearFilter(n),
|
|
1089
1436
|
"aria-hidden": !1,
|
|
1090
1437
|
tabIndex: 0
|
|
1091
1438
|
},
|
|
1092
|
-
children: /* @__PURE__ */
|
|
1093
|
-
className:
|
|
1094
|
-
onClick: () => o ? o(e.id) :
|
|
1095
|
-
children:
|
|
1439
|
+
children: /* @__PURE__ */ U(C, {
|
|
1440
|
+
className: Xt.pillLabel,
|
|
1441
|
+
onClick: () => o ? o(e.id) : Nn(r, e.id),
|
|
1442
|
+
children: Rt({
|
|
1096
1443
|
label: n,
|
|
1097
|
-
type: t ?
|
|
1098
|
-
filter: i
|
|
1444
|
+
type: t ? tt(t) : "string",
|
|
1445
|
+
filter: i,
|
|
1446
|
+
operatorLabels: f.operators
|
|
1099
1447
|
})
|
|
1100
1448
|
})
|
|
1101
1449
|
}, e.id) : null;
|
|
1102
|
-
}, n[
|
|
1450
|
+
}, n[17] = r, n[18] = p, n[19] = f, n[20] = o, n[21] = c, n[22] = d, n[23] = t) : t = n[23], v = g.map(t);
|
|
1103
1451
|
}
|
|
1104
|
-
n[0] = r, n[1] = s, n[2] =
|
|
1105
|
-
} else m = n[
|
|
1452
|
+
n[0] = r, n[1] = s, n[2] = p, n[3] = f, n[4] = o, n[5] = c, n[6] = d, n[7] = m, n[8] = g, n[9] = _, n[10] = v, n[11] = y, n[12] = b, n[13] = x, n[14] = S;
|
|
1453
|
+
} else m = n[7], g = n[8], _ = n[9], v = n[10], y = n[11], b = n[12], x = n[13], S = n[14];
|
|
1106
1454
|
if (S !== Symbol.for("react.early_return_sentinel")) return S;
|
|
1107
1455
|
let w;
|
|
1108
|
-
n[
|
|
1109
|
-
size:
|
|
1110
|
-
children:
|
|
1111
|
-
}), n[
|
|
1112
|
-
let
|
|
1113
|
-
n[
|
|
1456
|
+
n[24] !== m || n[25] !== _ || n[26] !== v ? (w = /* @__PURE__ */ U(m, {
|
|
1457
|
+
size: _,
|
|
1458
|
+
children: v
|
|
1459
|
+
}), n[24] = m, n[25] = _, n[26] = v, n[27] = w) : w = n[27];
|
|
1460
|
+
let E;
|
|
1461
|
+
n[28] !== g || n[29] !== f.clearAllFilters || n[30] !== u || n[31] !== d ? (E = u && g.length > 1 && /* @__PURE__ */ U(l, {
|
|
1114
1462
|
variant: "subtle",
|
|
1115
1463
|
color: "gray",
|
|
1116
1464
|
size: "compact-xs",
|
|
1117
1465
|
onClick: () => d.setColumnFilters([]),
|
|
1118
|
-
children:
|
|
1119
|
-
}), n[
|
|
1120
|
-
let
|
|
1121
|
-
return n[
|
|
1122
|
-
role:
|
|
1123
|
-
"aria-label":
|
|
1124
|
-
className:
|
|
1125
|
-
children: [w,
|
|
1126
|
-
}), n[
|
|
1466
|
+
children: f.clearAllFilters
|
|
1467
|
+
}), n[28] = g, n[29] = f.clearAllFilters, n[30] = u, n[31] = d, n[32] = E) : E = n[32];
|
|
1468
|
+
let D;
|
|
1469
|
+
return n[33] !== E || n[34] !== y || n[35] !== b || n[36] !== x || n[37] !== w ? (D = /* @__PURE__ */ W("div", {
|
|
1470
|
+
role: y,
|
|
1471
|
+
"aria-label": b,
|
|
1472
|
+
className: x,
|
|
1473
|
+
children: [w, E]
|
|
1474
|
+
}), n[33] = E, n[34] = y, n[35] = b, n[36] = x, n[37] = w, n[38] = D) : D = n[38], D;
|
|
1127
1475
|
}
|
|
1128
|
-
function
|
|
1129
|
-
return
|
|
1476
|
+
function Fn(e) {
|
|
1477
|
+
return Lt(e.value);
|
|
1130
1478
|
}
|
|
1131
|
-
function
|
|
1479
|
+
function In(e) {
|
|
1132
1480
|
return e.columnFilters;
|
|
1133
1481
|
}
|
|
1134
|
-
var
|
|
1135
|
-
|
|
1482
|
+
var Ln = { footer: "_footer_149ca_1" };
|
|
1483
|
+
//#endregion
|
|
1484
|
+
//#region src/tmdatagrid/components/TMDataGridFooter.tsx
|
|
1485
|
+
function Rn(e) {
|
|
1136
1486
|
let { pageIndex: t, pageSize: n } = e.store.state.pagination;
|
|
1137
1487
|
return {
|
|
1138
1488
|
pageIndex: t,
|
|
@@ -1149,201 +1499,289 @@ function pn(e) {
|
|
|
1149
1499
|
lastPage: () => e.lastPage()
|
|
1150
1500
|
};
|
|
1151
1501
|
}
|
|
1152
|
-
function
|
|
1153
|
-
let n = e(
|
|
1502
|
+
function zn(t) {
|
|
1503
|
+
let n = e(63), { pageSizeOptions: r, pagination: i } = t, a = r === void 0 ? [
|
|
1154
1504
|
10,
|
|
1155
1505
|
25,
|
|
1156
1506
|
50,
|
|
1157
1507
|
100
|
|
1158
|
-
] : r, { table: o, features:
|
|
1159
|
-
if (
|
|
1508
|
+
] : r, { table: o, features: s, labels: l, controlSize: u } = Z();
|
|
1509
|
+
if (T(o.store), !Sn(o, s).canPaginate) return null;
|
|
1160
1510
|
if (i) {
|
|
1161
1511
|
let e;
|
|
1162
|
-
n[0] !== i || n[1] !== o ? (e = i(
|
|
1512
|
+
n[0] !== i || n[1] !== o ? (e = i(Rn(o)), n[0] = i, n[1] = o, n[2] = e) : e = n[2];
|
|
1163
1513
|
let t;
|
|
1164
|
-
return n[3] === e ? t = n[4] : (t = /* @__PURE__ */
|
|
1165
|
-
className:
|
|
1514
|
+
return n[3] === e ? t = n[4] : (t = /* @__PURE__ */ U("div", {
|
|
1515
|
+
className: Ln.footer,
|
|
1166
1516
|
children: e
|
|
1167
1517
|
}), n[3] = e, n[4] = t), t;
|
|
1168
1518
|
}
|
|
1169
|
-
let
|
|
1170
|
-
n[5] !==
|
|
1171
|
-
let
|
|
1172
|
-
n[8]
|
|
1173
|
-
|
|
1174
|
-
n[10] === l ? T = n[11] : (T = /* @__PURE__ */ G(v, {
|
|
1175
|
-
size: l,
|
|
1519
|
+
let f;
|
|
1520
|
+
n[5] !== s || n[6] !== o ? (f = Ke(o, s), n[5] = s, n[6] = o, n[7] = f) : f = n[7];
|
|
1521
|
+
let p = f, { pageIndex: m, pageSize: h } = o.store.state.pagination, g = o.getRowCount(), _ = g === 0 ? 0 : m * h + 1, y = Math.min(g, (m + 1) * h), x = a.includes(h) ? a : [...a, h].sort(Bn), C = S, w = l.pagingSuspendedHint, E = Ln, D = !p, O;
|
|
1522
|
+
n[8] !== u || n[9] !== l.rowsPerPage ? (O = /* @__PURE__ */ U(b, {
|
|
1523
|
+
size: u,
|
|
1176
1524
|
c: "dimmed",
|
|
1177
|
-
children:
|
|
1178
|
-
}), n[
|
|
1179
|
-
let
|
|
1180
|
-
n[
|
|
1181
|
-
let
|
|
1182
|
-
n[
|
|
1525
|
+
children: l.rowsPerPage
|
|
1526
|
+
}), n[8] = u, n[9] = l.rowsPerPage, n[10] = O) : O = n[10];
|
|
1527
|
+
let k = !p, A;
|
|
1528
|
+
n[11] === x ? A = n[12] : (A = x.map(String), n[11] = x, n[12] = A);
|
|
1529
|
+
let j = String(h), M;
|
|
1530
|
+
n[13] !== a || n[14] !== o ? (M = (e) => {
|
|
1183
1531
|
o.setPageSize(Number(e) || a[0]), o.setPageIndex(0);
|
|
1184
|
-
}, n[
|
|
1185
|
-
let
|
|
1186
|
-
n[
|
|
1187
|
-
size:
|
|
1532
|
+
}, n[13] = a, n[14] = o, n[15] = M) : M = n[15];
|
|
1533
|
+
let F;
|
|
1534
|
+
n[16] !== u || n[17] !== k || n[18] !== A || n[19] !== j || n[20] !== M ? (F = /* @__PURE__ */ U(v, {
|
|
1535
|
+
size: u,
|
|
1188
1536
|
w: 78,
|
|
1189
1537
|
allowDeselect: !1,
|
|
1190
1538
|
variant: "unstyled",
|
|
1191
|
-
disabled:
|
|
1192
|
-
data:
|
|
1193
|
-
value:
|
|
1194
|
-
onChange:
|
|
1195
|
-
}), n[
|
|
1196
|
-
let
|
|
1197
|
-
n[
|
|
1539
|
+
disabled: k,
|
|
1540
|
+
data: A,
|
|
1541
|
+
value: j,
|
|
1542
|
+
onChange: M
|
|
1543
|
+
}), n[16] = u, n[17] = k, n[18] = A, n[19] = j, n[20] = M, n[21] = F) : F = n[21];
|
|
1544
|
+
let I;
|
|
1545
|
+
n[22] !== O || n[23] !== F ? (I = /* @__PURE__ */ W(d, {
|
|
1198
1546
|
gap: "xs",
|
|
1199
1547
|
wrap: "nowrap",
|
|
1200
|
-
children: [
|
|
1201
|
-
}), n[
|
|
1202
|
-
let
|
|
1203
|
-
|
|
1204
|
-
y,
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
] }) : /* @__PURE__ */ K(ee, { children: [
|
|
1210
|
-
"Grouped · all ",
|
|
1211
|
-
o.getFilteredRowModel().rows.length,
|
|
1212
|
-
" rows"
|
|
1213
|
-
] }), n[26] = y, n[27] = f, n[28] = o, n[29] = x, n[30] = _, n[31] = P) : P = n[31];
|
|
1214
|
-
let F;
|
|
1215
|
-
n[32] !== l || n[33] !== P ? (F = /* @__PURE__ */ G(v, {
|
|
1216
|
-
size: l,
|
|
1548
|
+
children: [O, F]
|
|
1549
|
+
}), n[22] = O, n[23] = F, n[24] = I) : I = n[24];
|
|
1550
|
+
let ee = b, te = p ? l.pageRange({
|
|
1551
|
+
from: _,
|
|
1552
|
+
to: y,
|
|
1553
|
+
total: g
|
|
1554
|
+
}) : l.groupedAllRows(o.getFilteredRowModel().rows.length), ne;
|
|
1555
|
+
n[25] !== ee || n[26] !== u || n[27] !== te ? (ne = /* @__PURE__ */ U(ee, {
|
|
1556
|
+
size: u,
|
|
1217
1557
|
c: "dimmed",
|
|
1218
|
-
children:
|
|
1219
|
-
}), n[
|
|
1220
|
-
let I;
|
|
1221
|
-
n[35] !== f || n[36] !== o ? (I = !f || !o.getCanPreviousPage(), n[35] = f, n[36] = o, n[37] = I) : I = n[37];
|
|
1558
|
+
children: te
|
|
1559
|
+
}), n[25] = ee, n[26] = u, n[27] = te, n[28] = ne) : ne = n[28];
|
|
1222
1560
|
let L;
|
|
1223
|
-
n[
|
|
1561
|
+
n[29] !== p || n[30] !== o ? (L = !p || !o.getCanPreviousPage(), n[29] = p, n[30] = o, n[31] = L) : L = n[31];
|
|
1224
1562
|
let R;
|
|
1225
|
-
n[
|
|
1563
|
+
n[32] === o ? R = n[33] : (R = () => o.previousPage(), n[32] = o, n[33] = R);
|
|
1564
|
+
let re;
|
|
1565
|
+
n[34] === Symbol.for("react.memo_cache_sentinel") ? (re = /* @__PURE__ */ U(N, {
|
|
1226
1566
|
size: 18,
|
|
1227
1567
|
stroke: 1.6
|
|
1228
|
-
}), n[
|
|
1568
|
+
}), n[34] = re) : re = n[34];
|
|
1229
1569
|
let z;
|
|
1230
|
-
n[
|
|
1570
|
+
n[35] !== l.previousPage || n[36] !== L || n[37] !== R ? (z = /* @__PURE__ */ U(c, {
|
|
1231
1571
|
variant: "subtle",
|
|
1232
1572
|
color: "gray",
|
|
1233
|
-
"aria-label":
|
|
1234
|
-
disabled:
|
|
1235
|
-
onClick:
|
|
1236
|
-
children:
|
|
1237
|
-
}), n[
|
|
1573
|
+
"aria-label": l.previousPage,
|
|
1574
|
+
disabled: L,
|
|
1575
|
+
onClick: R,
|
|
1576
|
+
children: re
|
|
1577
|
+
}), n[35] = l.previousPage, n[36] = L, n[37] = R, n[38] = z) : z = n[38];
|
|
1578
|
+
let ie;
|
|
1579
|
+
n[39] !== p || n[40] !== o ? (ie = !p || !o.getCanNextPage(), n[39] = p, n[40] = o, n[41] = ie) : ie = n[41];
|
|
1238
1580
|
let B;
|
|
1239
|
-
n[
|
|
1581
|
+
n[42] === o ? B = n[43] : (B = () => o.nextPage(), n[42] = o, n[43] = B);
|
|
1240
1582
|
let V;
|
|
1241
|
-
n[
|
|
1242
|
-
let H;
|
|
1243
|
-
n[49] === Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ G(M, {
|
|
1583
|
+
n[44] === Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ U(P, {
|
|
1244
1584
|
size: 18,
|
|
1245
1585
|
stroke: 1.6
|
|
1246
|
-
}), n[
|
|
1247
|
-
let
|
|
1248
|
-
n[
|
|
1586
|
+
}), n[44] = V) : V = n[44];
|
|
1587
|
+
let H;
|
|
1588
|
+
n[45] !== l.nextPage || n[46] !== ie || n[47] !== B ? (H = /* @__PURE__ */ U(c, {
|
|
1249
1589
|
variant: "subtle",
|
|
1250
1590
|
color: "gray",
|
|
1251
|
-
"aria-label":
|
|
1252
|
-
disabled:
|
|
1253
|
-
onClick:
|
|
1254
|
-
children:
|
|
1255
|
-
}), n[
|
|
1256
|
-
let
|
|
1257
|
-
n[
|
|
1591
|
+
"aria-label": l.nextPage,
|
|
1592
|
+
disabled: ie,
|
|
1593
|
+
onClick: B,
|
|
1594
|
+
children: V
|
|
1595
|
+
}), n[45] = l.nextPage, n[46] = ie, n[47] = B, n[48] = H) : H = n[48];
|
|
1596
|
+
let ae;
|
|
1597
|
+
n[49] !== z || n[50] !== H ? (ae = /* @__PURE__ */ W(d, {
|
|
1258
1598
|
gap: 4,
|
|
1259
1599
|
wrap: "nowrap",
|
|
1260
|
-
children: [z,
|
|
1261
|
-
}), n[
|
|
1262
|
-
let
|
|
1263
|
-
n[
|
|
1264
|
-
className:
|
|
1265
|
-
"data-paging-suspended":
|
|
1600
|
+
children: [z, H]
|
|
1601
|
+
}), n[49] = z, n[50] = H, n[51] = ae) : ae = n[51];
|
|
1602
|
+
let G;
|
|
1603
|
+
n[52] !== I || n[53] !== ne || n[54] !== ae || n[55] !== E.footer || n[56] !== D ? (G = /* @__PURE__ */ W("div", {
|
|
1604
|
+
className: E.footer,
|
|
1605
|
+
"data-paging-suspended": D,
|
|
1266
1606
|
children: [
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1607
|
+
I,
|
|
1608
|
+
ne,
|
|
1609
|
+
ae
|
|
1270
1610
|
]
|
|
1271
|
-
}), n[
|
|
1272
|
-
let
|
|
1273
|
-
return n[
|
|
1274
|
-
label:
|
|
1275
|
-
disabled:
|
|
1611
|
+
}), n[52] = I, n[53] = ne, n[54] = ae, n[55] = E.footer, n[56] = D, n[57] = G) : G = n[57];
|
|
1612
|
+
let oe;
|
|
1613
|
+
return n[58] !== C || n[59] !== l.pagingSuspendedHint || n[60] !== p || n[61] !== G ? (oe = /* @__PURE__ */ U(C, {
|
|
1614
|
+
label: w,
|
|
1615
|
+
disabled: p,
|
|
1276
1616
|
withArrow: !0,
|
|
1277
1617
|
multiline: !0,
|
|
1278
1618
|
w: 260,
|
|
1279
1619
|
position: "top",
|
|
1280
|
-
children:
|
|
1281
|
-
}), n[
|
|
1620
|
+
children: G
|
|
1621
|
+
}), n[58] = C, n[59] = l.pagingSuspendedHint, n[60] = p, n[61] = G, n[62] = oe) : oe = n[62], oe;
|
|
1282
1622
|
}
|
|
1283
|
-
function
|
|
1623
|
+
function Bn(e, t) {
|
|
1284
1624
|
return e - t;
|
|
1285
1625
|
}
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1626
|
+
//#endregion
|
|
1627
|
+
//#region src/tmdatagrid/components/TMDataGridSearch.tsx
|
|
1628
|
+
function Vn(t) {
|
|
1629
|
+
let n = e(25), { placeholder: r, debounce: a, w: l } = t, u = a === void 0 ? 250 : a, d = l === void 0 ? 220 : l, { table: f, features: p, labels: m, controlSize: h } = Z(), g = T(f.store, Hn), [_, v] = s(g), y = o(void 0), b = o(g), S, C;
|
|
1630
|
+
n[0] === g ? (S = n[1], C = n[2]) : (S = () => {
|
|
1631
|
+
g !== b.current && (b.current = g, v(g));
|
|
1632
|
+
}, C = [g], n[0] = g, n[1] = S, n[2] = C), i(S, C);
|
|
1633
|
+
let w, E;
|
|
1634
|
+
if (n[3] === Symbol.for("react.memo_cache_sentinel") ? (w = () => () => clearTimeout(y.current), E = [], n[3] = w, n[4] = E) : (w = n[3], E = n[4]), i(w, E), !Sn(f, p).canSearch) return null;
|
|
1635
|
+
let D;
|
|
1636
|
+
n[5] === f ? D = n[6] : (D = (e) => {
|
|
1637
|
+
b.current = e, f.setGlobalFilter(e === "" ? void 0 : e);
|
|
1638
|
+
}, n[5] = f, n[6] = D);
|
|
1639
|
+
let O = D, k;
|
|
1640
|
+
n[7] !== O || n[8] !== u ? (k = (e) => {
|
|
1641
|
+
if (v(e), clearTimeout(y.current), u <= 0) {
|
|
1642
|
+
O(e);
|
|
1643
|
+
return;
|
|
1644
|
+
}
|
|
1645
|
+
y.current = setTimeout(() => O(e), u);
|
|
1646
|
+
}, n[7] = O, n[8] = u, n[9] = k) : k = n[9];
|
|
1647
|
+
let A = k, j;
|
|
1648
|
+
n[10] === A ? j = n[11] : (j = (e) => A(e.currentTarget.value), n[10] = A, n[11] = j);
|
|
1649
|
+
let M = r ?? m.searchPlaceholder, N;
|
|
1650
|
+
n[12] === Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ U(B, {
|
|
1651
|
+
size: 16,
|
|
1652
|
+
stroke: 1.6
|
|
1653
|
+
}), n[12] = N) : N = n[12];
|
|
1654
|
+
let P;
|
|
1655
|
+
n[13] !== O || n[14] !== _ || n[15] !== m.clearSearch ? (P = _ === "" ? void 0 : /* @__PURE__ */ U(c, {
|
|
1656
|
+
variant: "subtle",
|
|
1657
|
+
color: "gray",
|
|
1658
|
+
size: "sm",
|
|
1659
|
+
"aria-label": m.clearSearch,
|
|
1660
|
+
onClick: () => {
|
|
1661
|
+
clearTimeout(y.current), v(""), O("");
|
|
1662
|
+
},
|
|
1663
|
+
children: /* @__PURE__ */ U(V, {
|
|
1664
|
+
size: 14,
|
|
1665
|
+
stroke: 1.6
|
|
1666
|
+
})
|
|
1667
|
+
}), n[13] = O, n[14] = _, n[15] = m.clearSearch, n[16] = P) : P = n[16];
|
|
1668
|
+
let F;
|
|
1669
|
+
return n[17] !== h || n[18] !== _ || n[19] !== m.searchLabel || n[20] !== M || n[21] !== P || n[22] !== j || n[23] !== d ? (F = /* @__PURE__ */ U(x, {
|
|
1670
|
+
size: h,
|
|
1671
|
+
w: d,
|
|
1672
|
+
value: _,
|
|
1673
|
+
onChange: j,
|
|
1674
|
+
placeholder: M,
|
|
1675
|
+
"aria-label": m.searchLabel,
|
|
1676
|
+
leftSection: N,
|
|
1677
|
+
rightSection: P
|
|
1678
|
+
}), n[17] = h, n[18] = _, n[19] = m.searchLabel, n[20] = M, n[21] = P, n[22] = j, n[23] = d, n[24] = F) : F = n[24], F;
|
|
1679
|
+
}
|
|
1680
|
+
function Hn(e) {
|
|
1681
|
+
return typeof e.globalFilter == "string" ? e.globalFilter : "";
|
|
1682
|
+
}
|
|
1683
|
+
var Un = {
|
|
1684
|
+
tableWrapper: "_tableWrapper_1nt60_2",
|
|
1685
|
+
scrollContainer: "_scrollContainer_1nt60_10",
|
|
1686
|
+
grid: "_grid_1nt60_18",
|
|
1687
|
+
headerRow: "_headerRow_1nt60_24",
|
|
1688
|
+
bodyRow: "_bodyRow_1nt60_33",
|
|
1689
|
+
bodyCell: "_bodyCell_1nt60_91",
|
|
1690
|
+
cellContent: "_cellContent_1nt60_89",
|
|
1691
|
+
detailsCell: "_detailsCell_1nt60_204",
|
|
1692
|
+
messageRow: "_messageRow_1nt60_215",
|
|
1693
|
+
summaryRow: "_summaryRow_1nt60_228",
|
|
1694
|
+
summaryCell: "_summaryCell_1nt60_237"
|
|
1695
|
+
}, Wn = {
|
|
1696
|
+
stickyLeft: "_stickyLeft_6z1iq_16",
|
|
1697
|
+
stickyRight: "_stickyRight_6z1iq_17",
|
|
1698
|
+
stickyEdgeIn: "_stickyEdgeIn_6z1iq_1",
|
|
1699
|
+
stickyEdgeOut: "_stickyEdgeOut_6z1iq_1"
|
|
1298
1700
|
}, $ = {
|
|
1299
|
-
headerCell: "
|
|
1300
|
-
headerTitle: "
|
|
1301
|
-
headerActions: "
|
|
1302
|
-
headerAction: "
|
|
1303
|
-
headerCellSortable: "
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1701
|
+
headerCell: "_headerCell_1b6k8_1",
|
|
1702
|
+
headerTitle: "_headerTitle_1b6k8_32",
|
|
1703
|
+
headerActions: "_headerActions_1b6k8_55",
|
|
1704
|
+
headerAction: "_headerAction_1b6k8_55",
|
|
1705
|
+
headerCellSortable: "_headerCellSortable_1b6k8_84",
|
|
1706
|
+
sortIndex: "_sortIndex_1b6k8_90",
|
|
1707
|
+
headerCellDragging: "_headerCellDragging_1b6k8_102",
|
|
1708
|
+
headerCellDropBefore: "_headerCellDropBefore_1b6k8_106",
|
|
1709
|
+
headerCellDropAfter: "_headerCellDropAfter_1b6k8_107",
|
|
1710
|
+
columnSeparator: "_columnSeparator_1b6k8_127",
|
|
1711
|
+
columnSeparatorResizable: "_columnSeparatorResizable_1b6k8_139",
|
|
1712
|
+
columnSeparatorActive: "_columnSeparatorActive_1b6k8_162",
|
|
1713
|
+
menuItemActive: "_menuItemActive_1b6k8_168"
|
|
1714
|
+
}, Gn = 30, Kn = 2;
|
|
1715
|
+
function qn(e) {
|
|
1716
|
+
let t = document.createRange();
|
|
1717
|
+
t.selectNodeContents(e);
|
|
1718
|
+
let n = typeof t.getBoundingClientRect == "function" ? t.getBoundingClientRect().width : 0;
|
|
1719
|
+
return n > 0 ? n : e.scrollWidth;
|
|
1720
|
+
}
|
|
1721
|
+
function Jn({ container: e, columnId: t }) {
|
|
1722
|
+
let n = 0, r = e.querySelectorAll(`[role="cell"][data-column-id="${CSS.escape(t)}"],[role="gridcell"][data-column-id="${CSS.escape(t)}"]`);
|
|
1723
|
+
for (let e of r) {
|
|
1724
|
+
let t = e.firstElementChild;
|
|
1725
|
+
if (!(t instanceof HTMLElement)) continue;
|
|
1726
|
+
let r = getComputedStyle(e), i = (Number.parseFloat(r.paddingLeft) || 0) + (Number.parseFloat(r.paddingRight) || 0);
|
|
1727
|
+
n = Math.max(n, qn(t) + i + Kn);
|
|
1728
|
+
}
|
|
1729
|
+
let i = e.querySelector(`[data-testid="dg-header-${CSS.escape(t)}"] [data-dg-header-title]`);
|
|
1730
|
+
if (i) {
|
|
1731
|
+
let e = i.closest("[role=\"columnheader\"]"), t = e ? getComputedStyle(e) : null, r = t ? (Number.parseFloat(t.paddingLeft) || 0) + (Number.parseFloat(t.paddingRight) || 0) : 0;
|
|
1732
|
+
n = Math.max(n, qn(i) + r + Gn);
|
|
1733
|
+
}
|
|
1734
|
+
return n;
|
|
1735
|
+
}
|
|
1736
|
+
function Yn({ table: e, columnId: t, container: n }) {
|
|
1737
|
+
let r = e, i = r.getColumn(t);
|
|
1738
|
+
if (!i || !i.getCanResize()) return !1;
|
|
1739
|
+
let a = Jn({
|
|
1740
|
+
container: n,
|
|
1741
|
+
columnId: t
|
|
1742
|
+
});
|
|
1743
|
+
if (a <= 0) return !1;
|
|
1744
|
+
let o = i.columnDef.minSize ?? 80, s = i.columnDef.maxSize ?? Infinity, c = Math.round(Math.min(Math.max(a, o), s));
|
|
1745
|
+
return r.setColumnSizing((e) => ({
|
|
1746
|
+
...e,
|
|
1747
|
+
[t]: c
|
|
1748
|
+
})), !0;
|
|
1749
|
+
}
|
|
1312
1750
|
//#endregion
|
|
1313
1751
|
//#region src/tmdatagrid/core/columnOrdering.ts
|
|
1314
|
-
function
|
|
1752
|
+
function Xn(e, t) {
|
|
1315
1753
|
return e.left.includes(t) ? "left" : e.right.includes(t) ? "right" : "center";
|
|
1316
1754
|
}
|
|
1317
|
-
function
|
|
1755
|
+
function Zn(e, t, n, r) {
|
|
1318
1756
|
let i = e.filter((e) => e !== t), a = i.indexOf(n);
|
|
1319
1757
|
return a === -1 ? [...e] : (i.splice(r === "before" ? a : a + 1, 0, t), i);
|
|
1320
1758
|
}
|
|
1321
|
-
function
|
|
1759
|
+
function Qn({ table: e, columnId: t, targetId: n, side: r }) {
|
|
1322
1760
|
if (t === n) return;
|
|
1323
|
-
let i = e.store.state.columnPinning, a =
|
|
1324
|
-
if (a !==
|
|
1761
|
+
let i = e.store.state.columnPinning, a = Xn(i, t);
|
|
1762
|
+
if (a !== Xn(i, n)) return;
|
|
1325
1763
|
let o = e.getAllLeafColumns().map((e) => e.id);
|
|
1326
|
-
e.setColumnOrder(
|
|
1764
|
+
e.setColumnOrder(Zn(o, t, n, r)), a !== "center" && e.setColumnPinning((e) => ({
|
|
1327
1765
|
...e,
|
|
1328
|
-
[a]:
|
|
1766
|
+
[a]: Zn(e[a], t, n, r)
|
|
1329
1767
|
}));
|
|
1330
1768
|
}
|
|
1331
|
-
function
|
|
1769
|
+
function $n(e, t) {
|
|
1332
1770
|
return t === "left" ? e.getLeftVisibleLeafColumns() : t === "right" ? e.getRightVisibleLeafColumns() : e.getCenterVisibleLeafColumns();
|
|
1333
1771
|
}
|
|
1334
|
-
function
|
|
1335
|
-
let r =
|
|
1772
|
+
function er({ table: e, columnId: t, direction: n }) {
|
|
1773
|
+
let r = $n(e, Xn(e.store.state.columnPinning, t)), i = r.findIndex((e) => e.id === t);
|
|
1336
1774
|
if (i === -1) return null;
|
|
1337
1775
|
let a = r[i + n];
|
|
1338
|
-
return !a || !
|
|
1776
|
+
return !a || !it(a) ? null : a;
|
|
1339
1777
|
}
|
|
1340
|
-
function
|
|
1341
|
-
let r =
|
|
1778
|
+
function tr({ table: e, columnId: t, direction: n }) {
|
|
1779
|
+
let r = er({
|
|
1342
1780
|
table: e,
|
|
1343
1781
|
columnId: t,
|
|
1344
1782
|
direction: n
|
|
1345
1783
|
});
|
|
1346
|
-
r &&
|
|
1784
|
+
r && Qn({
|
|
1347
1785
|
table: e,
|
|
1348
1786
|
columnId: t,
|
|
1349
1787
|
targetId: r.id,
|
|
@@ -1352,448 +1790,539 @@ function Cn({ table: e, columnId: t, direction: n }) {
|
|
|
1352
1790
|
}
|
|
1353
1791
|
//#endregion
|
|
1354
1792
|
//#region src/tmdatagrid/components/TMDataGridHeaderCell.tsx
|
|
1355
|
-
function
|
|
1356
|
-
let n = e(
|
|
1357
|
-
n[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
1358
|
-
let { sorting:
|
|
1359
|
-
n[1]
|
|
1360
|
-
|
|
1361
|
-
n[3] === d ? J = n[4] : (J = Pe(d), n[3] = d, n[4] = J);
|
|
1362
|
-
let te = J, ne;
|
|
1363
|
-
n[5] !== d.id || n[6] !== x ? (ne = x.find((e) => e.id === d.id)?.desc, n[5] = d.id, n[6] = x, n[7] = ne) : ne = n[7];
|
|
1364
|
-
let re = ne, ie = re !== void 0, ae;
|
|
1365
|
-
if (n[8] !== d.id || n[9] !== S) {
|
|
1793
|
+
function nr(t) {
|
|
1794
|
+
let n = e(265), { header: r, layout: i } = t, a = Z(), { table: l, features: u, labels: d } = a, f = r.column, [m, h] = s(!1), [g, _] = s(!1), [v, y] = s(null), b = o(null), x = o(!1), C;
|
|
1795
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (C = { compare: ae }, n[0] = C) : C = n[0];
|
|
1796
|
+
let { sorting: w, columnFilters: N, resizingColumnId: P, columnPinning: z, grouping: B } = T(l.store, lr, C), V = T(a.ui, cr), H = r.subHeaders.length === 0, G, oe, se, ce, le, ue, de, fe, pe, me, he, ge, _e, ve, ye, be, K, q, J, Se;
|
|
1797
|
+
if (n[1] !== a || n[2] !== f || n[3] !== N || n[4] !== z || n[5] !== V || n[6] !== v || n[7] !== u || n[8] !== B || n[9] !== H || n[10] !== d || n[11] !== i.pinnedAt || n[12] !== P || n[13] !== w || n[14] !== l) {
|
|
1798
|
+
be = et(f);
|
|
1366
1799
|
let e;
|
|
1367
|
-
n[
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
let
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
});
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
})
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1800
|
+
n[35] === f ? e = n[36] : (e = nt(f), n[35] = f, n[36] = e), G = e;
|
|
1801
|
+
let t;
|
|
1802
|
+
n[37] !== f.id || n[38] !== w ? (t = w.find((e) => e.id === f.id)?.desc, n[37] = f.id, n[38] = w, n[39] = t) : t = n[39], J = t, ye = J !== void 0;
|
|
1803
|
+
let r;
|
|
1804
|
+
n[40] !== f.id || n[41] !== ye || n[42] !== w ? (r = ye && w.length > 1 ? w.findIndex((e) => e.id === f.id) + 1 : null, n[40] = f.id, n[41] = ye, n[42] = w, n[43] = r) : r = n[43], Se = r;
|
|
1805
|
+
let o;
|
|
1806
|
+
if (n[44] !== f.id || n[45] !== N) {
|
|
1807
|
+
let e;
|
|
1808
|
+
n[47] === f.id ? e = n[48] : (e = (e) => e.id === f.id && Lt(e.value), n[47] = f.id, n[48] = e), o = N.some(e), n[44] = f.id, n[45] = N, n[46] = o;
|
|
1809
|
+
} else o = n[46];
|
|
1810
|
+
_e = o, ve = P === f.id, q = i.pinnedAt;
|
|
1811
|
+
let s;
|
|
1812
|
+
n[49] !== f || n[50] !== u ? (s = xn(f, u), n[49] = f, n[50] = u, n[51] = s) : s = n[51];
|
|
1813
|
+
let c = s;
|
|
1814
|
+
le = H && c.canSort;
|
|
1815
|
+
let m = H && c.canFilter, h = H && c.canHide, g = H && c.canPin;
|
|
1816
|
+
ce = c.canResize, se = H && c.canReorder;
|
|
1817
|
+
let _ = H && c.canGroup, x = H && Sn(l, u).canHideAny, S;
|
|
1818
|
+
n[52] !== f.id || n[53] !== B ? (S = B.includes(f.id), n[52] = f.id, n[53] = B, n[54] = S) : S = n[54];
|
|
1819
|
+
let C = S, T = B.length > 0;
|
|
1820
|
+
he = V === f.id;
|
|
1821
|
+
let I;
|
|
1822
|
+
n[55] !== se || n[56] !== f.id || n[57] !== z || n[58] !== V || n[59] !== he ? (I = se && V !== null && !he && Xn(z, V) === Xn(z, f.id), n[55] = se, n[56] = f.id, n[57] = z, n[58] = V, n[59] = he, n[60] = I) : I = n[60], ge = I;
|
|
1823
|
+
let W;
|
|
1824
|
+
n[61] !== a.ui || n[62] !== f.id ? (W = function(e) {
|
|
1825
|
+
e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", f.id), a.ui.actions.startColumnDrag(f.id);
|
|
1826
|
+
}, n[61] = a.ui, n[62] = f.id, n[63] = W) : W = n[63], pe = W;
|
|
1827
|
+
let ae;
|
|
1828
|
+
n[64] === ge ? ae = n[65] : (ae = function(e) {
|
|
1829
|
+
if (!ge) return;
|
|
1830
|
+
e.preventDefault(), e.dataTransfer.dropEffect = "move";
|
|
1831
|
+
let t = b.current?.getBoundingClientRect();
|
|
1832
|
+
t && y(e.clientX < t.left + t.width / 2 ? "before" : "after");
|
|
1833
|
+
}, n[64] = ge, n[65] = ae), fe = ae;
|
|
1834
|
+
let xe;
|
|
1835
|
+
n[66] === Symbol.for("react.memo_cache_sentinel") ? (xe = function(e) {
|
|
1836
|
+
let t = e.relatedTarget;
|
|
1837
|
+
t instanceof Node && e.currentTarget.contains(t) || y(null);
|
|
1838
|
+
}, n[66] = xe) : xe = n[66], de = xe;
|
|
1839
|
+
let Ce;
|
|
1840
|
+
n[67] !== a.ui || n[68] !== f.id || n[69] !== V || n[70] !== v || n[71] !== ge || n[72] !== l ? (Ce = function(e) {
|
|
1841
|
+
e.preventDefault(), y(null), a.ui.actions.endColumnDrag(), !(!ge || !v || !V) && Qn({
|
|
1842
|
+
table: l,
|
|
1843
|
+
columnId: V,
|
|
1844
|
+
targetId: f.id,
|
|
1845
|
+
side: v
|
|
1846
|
+
});
|
|
1847
|
+
}, n[67] = a.ui, n[68] = f.id, n[69] = V, n[70] = v, n[71] = ge, n[72] = l, n[73] = Ce) : Ce = n[73], me = Ce;
|
|
1848
|
+
let Y;
|
|
1849
|
+
n[74] === a.ui ? Y = n[75] : (Y = function() {
|
|
1850
|
+
y(null), a.ui.actions.endColumnDrag();
|
|
1851
|
+
}, n[74] = a.ui, n[75] = Y), ue = Y;
|
|
1852
|
+
let we;
|
|
1853
|
+
n[76] !== f.id || n[77] !== l ? (we = function() {
|
|
1854
|
+
let e = b.current?.closest("[data-dg-scroll-container]");
|
|
1855
|
+
e && Yn({
|
|
1856
|
+
table: l,
|
|
1857
|
+
columnId: f.id,
|
|
1858
|
+
container: e
|
|
1859
|
+
});
|
|
1860
|
+
}, n[76] = f.id, n[77] = l, n[78] = we) : we = n[78], oe = we;
|
|
1861
|
+
let Te;
|
|
1862
|
+
n[79] !== f || n[80] !== l ? (Te = function(e) {
|
|
1863
|
+
if (e && !(f.id in l.store.state.columnSizing)) {
|
|
1864
|
+
let e = b.current?.getBoundingClientRect().width;
|
|
1865
|
+
e && l.setColumnSizing((t) => ({
|
|
1866
|
+
...t,
|
|
1867
|
+
[f.id]: Math.round(e)
|
|
1868
|
+
}));
|
|
1869
|
+
}
|
|
1870
|
+
f.pin(e);
|
|
1871
|
+
}, n[79] = f, n[80] = l, n[81] = Te) : Te = n[81];
|
|
1872
|
+
let Ee = Te;
|
|
1873
|
+
if (K = [], le) {
|
|
1420
1874
|
let e;
|
|
1421
|
-
n[
|
|
1875
|
+
n[82] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ U(M, {
|
|
1422
1876
|
size: 16,
|
|
1423
1877
|
stroke: 1.6
|
|
1424
|
-
}), n[
|
|
1878
|
+
}), n[82] = e) : e = n[82];
|
|
1425
1879
|
let t;
|
|
1426
|
-
n[
|
|
1427
|
-
leftSection: e,
|
|
1428
|
-
onClick: () => d.toggleSorting(!1),
|
|
1429
|
-
children: "Sort by ASC"
|
|
1430
|
-
}, "sort-asc"), n[65] = d, n[66] = t);
|
|
1880
|
+
n[83] === f ? t = n[84] : (t = () => f.toggleSorting(!1), n[83] = f, n[84] = t);
|
|
1431
1881
|
let r;
|
|
1432
|
-
n[
|
|
1882
|
+
n[85] !== d.sortAsc || n[86] !== t ? (r = /* @__PURE__ */ U(p.Item, {
|
|
1883
|
+
leftSection: e,
|
|
1884
|
+
onClick: t,
|
|
1885
|
+
children: d.sortAsc
|
|
1886
|
+
}, "sort-asc"), n[85] = d.sortAsc, n[86] = t, n[87] = r) : r = n[87];
|
|
1887
|
+
let i;
|
|
1888
|
+
n[88] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ U(k, {
|
|
1433
1889
|
size: 16,
|
|
1434
1890
|
stroke: 1.6
|
|
1435
|
-
}), n[
|
|
1436
|
-
let i;
|
|
1437
|
-
n[68] === d ? i = n[69] : (i = /* @__PURE__ */ G(f.Item, {
|
|
1438
|
-
leftSection: r,
|
|
1439
|
-
onClick: () => d.toggleSorting(!0),
|
|
1440
|
-
children: "Sort by DESC"
|
|
1441
|
-
}, "sort-desc"), n[68] = d, n[69] = i);
|
|
1891
|
+
}), n[88] = i) : i = n[88];
|
|
1442
1892
|
let a;
|
|
1443
|
-
n[
|
|
1893
|
+
n[89] === f ? a = n[90] : (a = () => f.toggleSorting(!0), n[89] = f, n[90] = a);
|
|
1894
|
+
let o;
|
|
1895
|
+
n[91] !== d.sortDesc || n[92] !== a ? (o = /* @__PURE__ */ U(p.Item, {
|
|
1896
|
+
leftSection: i,
|
|
1897
|
+
onClick: a,
|
|
1898
|
+
children: d.sortDesc
|
|
1899
|
+
}, "sort-desc"), n[91] = d.sortDesc, n[92] = a, n[93] = o) : o = n[93];
|
|
1900
|
+
let s;
|
|
1901
|
+
n[94] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ U(p.Divider, {}, "sort-divider"), n[94] = s) : s = n[94], K.push(r, o, s);
|
|
1444
1902
|
}
|
|
1445
|
-
if (
|
|
1903
|
+
if (m) {
|
|
1446
1904
|
let e;
|
|
1447
|
-
n[
|
|
1905
|
+
n[95] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ U(te, {
|
|
1448
1906
|
size: 16,
|
|
1449
1907
|
stroke: 1.6
|
|
1450
|
-
}), n[
|
|
1908
|
+
}), n[95] = e) : e = n[95];
|
|
1451
1909
|
let t;
|
|
1452
|
-
n[
|
|
1453
|
-
leftSection: e,
|
|
1454
|
-
onClick: () => sn(c, d.id),
|
|
1455
|
-
children: "Filter"
|
|
1456
|
-
}, "filter"), n[72] = c, n[73] = d.id, n[74] = t) : t = n[74];
|
|
1910
|
+
n[96] !== a || n[97] !== f.id ? (t = () => Nn(a, f.id), n[96] = a, n[97] = f.id, n[98] = t) : t = n[98];
|
|
1457
1911
|
let r;
|
|
1458
|
-
n[
|
|
1912
|
+
n[99] !== d.filterMenuItem || n[100] !== t ? (r = /* @__PURE__ */ U(p.Item, {
|
|
1913
|
+
leftSection: e,
|
|
1914
|
+
onClick: t,
|
|
1915
|
+
children: d.filterMenuItem
|
|
1916
|
+
}, "filter"), n[99] = d.filterMenuItem, n[100] = t, n[101] = r) : r = n[101];
|
|
1917
|
+
let i;
|
|
1918
|
+
n[102] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ U(p.Divider, {}, "filter-divider"), n[102] = i) : i = n[102], K.push(r, i);
|
|
1459
1919
|
}
|
|
1460
|
-
if (
|
|
1461
|
-
let e =
|
|
1462
|
-
n[
|
|
1920
|
+
if (_) {
|
|
1921
|
+
let e = C ? $.menuItemActive : void 0, t;
|
|
1922
|
+
n[103] === C ? t = n[104] : (t = U(C ? R : re, {
|
|
1463
1923
|
size: 16,
|
|
1464
1924
|
stroke: 1.6
|
|
1465
|
-
}), n[
|
|
1925
|
+
}), n[103] = C, n[104] = t);
|
|
1466
1926
|
let r;
|
|
1467
|
-
n[
|
|
1468
|
-
let i =
|
|
1469
|
-
n[
|
|
1927
|
+
n[105] === f ? r = n[106] : (r = f.getToggleGroupingHandler(), n[105] = f, n[106] = r);
|
|
1928
|
+
let i = C ? d.ungroup(be) : d.groupBy(be), a;
|
|
1929
|
+
n[107] !== e || n[108] !== t || n[109] !== r || n[110] !== i ? (a = /* @__PURE__ */ U(p.Item, {
|
|
1470
1930
|
className: e,
|
|
1471
1931
|
leftSection: t,
|
|
1472
1932
|
onClick: r,
|
|
1473
1933
|
children: i
|
|
1474
|
-
}, "group"), n[
|
|
1934
|
+
}, "group"), n[107] = e, n[108] = t, n[109] = r, n[110] = i, n[111] = a) : a = n[111], K.push(a);
|
|
1475
1935
|
}
|
|
1476
|
-
if (
|
|
1477
|
-
if (
|
|
1936
|
+
if (T) {
|
|
1937
|
+
if (f.id === "__group__") for (let e of B) {
|
|
1478
1938
|
let t = l.getColumn(e);
|
|
1479
|
-
t &&
|
|
1480
|
-
leftSection: /* @__PURE__ */
|
|
1939
|
+
t && K.push(/* @__PURE__ */ U(p.Item, {
|
|
1940
|
+
leftSection: /* @__PURE__ */ U(R, {
|
|
1481
1941
|
size: 16,
|
|
1482
1942
|
stroke: 1.6
|
|
1483
1943
|
}),
|
|
1484
1944
|
onClick: () => t.toggleGrouping(),
|
|
1485
|
-
children:
|
|
1945
|
+
children: d.ungroup(et(t))
|
|
1486
1946
|
}, `ungroup-${e}`));
|
|
1487
1947
|
}
|
|
1488
1948
|
let e;
|
|
1489
|
-
n[
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
n[
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
children: "Expand all groups"
|
|
1498
|
-
}, "expand-all"), n[86] = l, n[87] = t);
|
|
1499
|
-
let r;
|
|
1500
|
-
n[88] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ G(R, {
|
|
1949
|
+
n[112] === l ? e = n[113] : (e = (e) => l.setExpanded(ze({
|
|
1950
|
+
rows: l.getPrePaginatedRowModel().flatRows,
|
|
1951
|
+
expanded: l.store.state.expanded,
|
|
1952
|
+
target: "groups",
|
|
1953
|
+
expand: e
|
|
1954
|
+
})), n[112] = l, n[113] = e);
|
|
1955
|
+
let t = e, r;
|
|
1956
|
+
n[114] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ U(ne, {
|
|
1501
1957
|
size: 16,
|
|
1502
1958
|
stroke: 1.6
|
|
1503
|
-
}), n[
|
|
1959
|
+
}), n[114] = r) : r = n[114];
|
|
1504
1960
|
let i;
|
|
1505
|
-
n[
|
|
1961
|
+
n[115] === t ? i = n[116] : (i = () => t(!0), n[115] = t, n[116] = i);
|
|
1962
|
+
let a;
|
|
1963
|
+
n[117] !== d.expandAllGroups || n[118] !== i ? (a = /* @__PURE__ */ U(p.Item, {
|
|
1506
1964
|
leftSection: r,
|
|
1507
|
-
onClick:
|
|
1508
|
-
children:
|
|
1509
|
-
}, "
|
|
1965
|
+
onClick: i,
|
|
1966
|
+
children: d.expandAllGroups
|
|
1967
|
+
}, "expand-all"), n[117] = d.expandAllGroups, n[118] = i, n[119] = a) : a = n[119];
|
|
1968
|
+
let o;
|
|
1969
|
+
n[120] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ U(L, {
|
|
1970
|
+
size: 16,
|
|
1971
|
+
stroke: 1.6
|
|
1972
|
+
}), n[120] = o) : o = n[120];
|
|
1973
|
+
let s;
|
|
1974
|
+
n[121] === t ? s = n[122] : (s = () => t(!1), n[121] = t, n[122] = s);
|
|
1975
|
+
let c;
|
|
1976
|
+
n[123] !== d.collapseAllGroups || n[124] !== s ? (c = /* @__PURE__ */ U(p.Item, {
|
|
1977
|
+
leftSection: o,
|
|
1978
|
+
onClick: s,
|
|
1979
|
+
children: d.collapseAllGroups
|
|
1980
|
+
}, "collapse-all"), n[123] = d.collapseAllGroups, n[124] = s, n[125] = c) : c = n[125], K.push(a, c);
|
|
1510
1981
|
}
|
|
1511
|
-
if (
|
|
1982
|
+
if (_ || T) {
|
|
1512
1983
|
let e;
|
|
1513
|
-
n[
|
|
1984
|
+
n[126] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ U(p.Divider, {}, "group-divider"), n[126] = e) : e = n[126], K.push(e);
|
|
1514
1985
|
}
|
|
1515
|
-
if (
|
|
1516
|
-
let e =
|
|
1517
|
-
n[
|
|
1986
|
+
if (g) {
|
|
1987
|
+
let e = q === "left" ? $.menuItemActive : void 0, t;
|
|
1988
|
+
n[127] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ U(D, {
|
|
1518
1989
|
size: 16,
|
|
1519
1990
|
stroke: 1.6
|
|
1520
|
-
}), n[
|
|
1991
|
+
}), n[127] = t) : t = n[127];
|
|
1521
1992
|
let r;
|
|
1522
|
-
n[
|
|
1993
|
+
n[128] !== q || n[129] !== Ee ? (r = () => Ee(q !== "left" && "left"), n[128] = q, n[129] = Ee, n[130] = r) : r = n[130];
|
|
1523
1994
|
let i;
|
|
1524
|
-
n[
|
|
1995
|
+
n[131] !== d.pinLeft || n[132] !== e || n[133] !== r ? (i = /* @__PURE__ */ U(p.Item, {
|
|
1525
1996
|
className: e,
|
|
1526
1997
|
leftSection: t,
|
|
1527
1998
|
onClick: r,
|
|
1528
|
-
children:
|
|
1529
|
-
}, "pin-left"), n[
|
|
1530
|
-
let a =
|
|
1531
|
-
n[
|
|
1999
|
+
children: d.pinLeft
|
|
2000
|
+
}, "pin-left"), n[131] = d.pinLeft, n[132] = e, n[133] = r, n[134] = i) : i = n[134];
|
|
2001
|
+
let a = q === "right" ? $.menuItemActive : void 0, o;
|
|
2002
|
+
n[135] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ U(O, {
|
|
1532
2003
|
size: 16,
|
|
1533
2004
|
stroke: 1.6
|
|
1534
|
-
}), n[
|
|
2005
|
+
}), n[135] = o) : o = n[135];
|
|
1535
2006
|
let s;
|
|
1536
|
-
n[
|
|
2007
|
+
n[136] !== q || n[137] !== Ee ? (s = () => Ee(q !== "right" && "right"), n[136] = q, n[137] = Ee, n[138] = s) : s = n[138];
|
|
1537
2008
|
let c;
|
|
1538
|
-
if (n[
|
|
2009
|
+
if (n[139] !== d.pinRight || n[140] !== a || n[141] !== s ? (c = /* @__PURE__ */ U(p.Item, {
|
|
1539
2010
|
className: a,
|
|
1540
2011
|
leftSection: o,
|
|
1541
2012
|
onClick: s,
|
|
1542
|
-
children:
|
|
1543
|
-
}, "pin-right"), n[
|
|
2013
|
+
children: d.pinRight
|
|
2014
|
+
}, "pin-right"), n[139] = d.pinRight, n[140] = a, n[141] = s, n[142] = c) : c = n[142], K.push(i, c), q) {
|
|
1544
2015
|
let e;
|
|
1545
|
-
n[
|
|
2016
|
+
n[143] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ U(ie, {
|
|
1546
2017
|
size: 16,
|
|
1547
2018
|
stroke: 1.6
|
|
1548
|
-
}), n[
|
|
2019
|
+
}), n[143] = e) : e = n[143];
|
|
1549
2020
|
let t;
|
|
1550
|
-
n[
|
|
2021
|
+
n[144] === Ee ? t = n[145] : (t = () => Ee(!1), n[144] = Ee, n[145] = t);
|
|
2022
|
+
let r;
|
|
2023
|
+
n[146] !== d.unpin || n[147] !== t ? (r = /* @__PURE__ */ U(p.Item, {
|
|
1551
2024
|
leftSection: e,
|
|
1552
|
-
onClick:
|
|
1553
|
-
children:
|
|
1554
|
-
}, "unpin"), n[
|
|
2025
|
+
onClick: t,
|
|
2026
|
+
children: d.unpin
|
|
2027
|
+
}, "unpin"), n[146] = d.unpin, n[147] = t, n[148] = r) : r = n[148], K.push(r);
|
|
1555
2028
|
}
|
|
1556
2029
|
let l;
|
|
1557
|
-
n[
|
|
2030
|
+
n[149] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ U(p.Divider, {}, "pin-divider"), n[149] = l) : l = n[149], K.push(l);
|
|
1558
2031
|
}
|
|
1559
|
-
if (
|
|
2032
|
+
if (se) {
|
|
1560
2033
|
let e;
|
|
1561
|
-
n[
|
|
2034
|
+
n[150] !== f.id || n[151] !== l ? (e = er({
|
|
1562
2035
|
table: l,
|
|
1563
|
-
columnId:
|
|
2036
|
+
columnId: f.id,
|
|
1564
2037
|
direction: -1
|
|
1565
|
-
}), n[
|
|
2038
|
+
}), n[150] = f.id, n[151] = l, n[152] = e) : e = n[152];
|
|
1566
2039
|
let t = e, r;
|
|
1567
|
-
n[
|
|
2040
|
+
n[153] !== f.id || n[154] !== l ? (r = er({
|
|
1568
2041
|
table: l,
|
|
1569
|
-
columnId:
|
|
2042
|
+
columnId: f.id,
|
|
1570
2043
|
direction: 1
|
|
1571
|
-
}), n[
|
|
2044
|
+
}), n[153] = f.id, n[154] = l, n[155] = r) : r = n[155];
|
|
1572
2045
|
let i = r;
|
|
1573
2046
|
if (t || i) {
|
|
1574
2047
|
let e = !t, r;
|
|
1575
|
-
n[
|
|
2048
|
+
n[156] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ U(A, {
|
|
1576
2049
|
size: 16,
|
|
1577
2050
|
stroke: 1.6
|
|
1578
|
-
}), n[
|
|
2051
|
+
}), n[156] = r) : r = n[156];
|
|
1579
2052
|
let a;
|
|
1580
|
-
n[
|
|
2053
|
+
n[157] !== f.id || n[158] !== l ? (a = () => tr({
|
|
1581
2054
|
table: l,
|
|
1582
|
-
columnId:
|
|
2055
|
+
columnId: f.id,
|
|
1583
2056
|
direction: -1
|
|
1584
|
-
}), n[
|
|
2057
|
+
}), n[157] = f.id, n[158] = l, n[159] = a) : a = n[159];
|
|
1585
2058
|
let o;
|
|
1586
|
-
n[
|
|
2059
|
+
n[160] !== d.moveLeft || n[161] !== e || n[162] !== a ? (o = /* @__PURE__ */ U(p.Item, {
|
|
1587
2060
|
disabled: e,
|
|
1588
2061
|
leftSection: r,
|
|
1589
2062
|
onClick: a,
|
|
1590
|
-
children:
|
|
1591
|
-
}, "move-left"), n[
|
|
2063
|
+
children: d.moveLeft
|
|
2064
|
+
}, "move-left"), n[160] = d.moveLeft, n[161] = e, n[162] = a, n[163] = o) : o = n[163];
|
|
1592
2065
|
let s = !i, c;
|
|
1593
|
-
n[
|
|
2066
|
+
n[164] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ U(j, {
|
|
1594
2067
|
size: 16,
|
|
1595
2068
|
stroke: 1.6
|
|
1596
|
-
}), n[
|
|
2069
|
+
}), n[164] = c) : c = n[164];
|
|
1597
2070
|
let u;
|
|
1598
|
-
n[
|
|
2071
|
+
n[165] !== f.id || n[166] !== l ? (u = () => tr({
|
|
1599
2072
|
table: l,
|
|
1600
|
-
columnId:
|
|
2073
|
+
columnId: f.id,
|
|
1601
2074
|
direction: 1
|
|
1602
|
-
}), n[
|
|
1603
|
-
let
|
|
1604
|
-
n[
|
|
2075
|
+
}), n[165] = f.id, n[166] = l, n[167] = u) : u = n[167];
|
|
2076
|
+
let m;
|
|
2077
|
+
n[168] !== d.moveRight || n[169] !== s || n[170] !== u ? (m = /* @__PURE__ */ U(p.Item, {
|
|
1605
2078
|
disabled: s,
|
|
1606
2079
|
leftSection: c,
|
|
1607
2080
|
onClick: u,
|
|
1608
|
-
children:
|
|
1609
|
-
}, "move-right"), n[
|
|
1610
|
-
let
|
|
1611
|
-
n[
|
|
2081
|
+
children: d.moveRight
|
|
2082
|
+
}, "move-right"), n[168] = d.moveRight, n[169] = s, n[170] = u, n[171] = m) : m = n[171];
|
|
2083
|
+
let h;
|
|
2084
|
+
n[172] === Symbol.for("react.memo_cache_sentinel") ? (h = /* @__PURE__ */ U(p.Divider, {}, "move-divider"), n[172] = h) : h = n[172], K.push(o, m, h);
|
|
1612
2085
|
}
|
|
1613
2086
|
}
|
|
1614
|
-
if (
|
|
2087
|
+
if (ce && H) {
|
|
1615
2088
|
let e;
|
|
1616
|
-
n[
|
|
2089
|
+
n[173] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ U(E, {
|
|
1617
2090
|
size: 16,
|
|
1618
2091
|
stroke: 1.6
|
|
1619
|
-
}), n[
|
|
2092
|
+
}), n[173] = e) : e = n[173];
|
|
1620
2093
|
let t;
|
|
1621
|
-
n[
|
|
2094
|
+
n[174] !== oe || n[175] !== d.autosizeColumn ? (t = /* @__PURE__ */ U(p.Item, {
|
|
1622
2095
|
leftSection: e,
|
|
1623
|
-
onClick:
|
|
1624
|
-
children:
|
|
1625
|
-
}, "
|
|
2096
|
+
onClick: oe,
|
|
2097
|
+
children: d.autosizeColumn
|
|
2098
|
+
}, "autosize"), n[174] = oe, n[175] = d.autosizeColumn, n[176] = t) : t = n[176];
|
|
2099
|
+
let r;
|
|
2100
|
+
n[177] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ U(p.Divider, {}, "autosize-divider"), n[177] = r) : r = n[177], K.push(t, r);
|
|
2101
|
+
}
|
|
2102
|
+
if (h) {
|
|
2103
|
+
let e;
|
|
2104
|
+
n[178] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ U(ee, {
|
|
2105
|
+
size: 16,
|
|
2106
|
+
stroke: 1.6
|
|
2107
|
+
}), n[178] = e) : e = n[178];
|
|
2108
|
+
let t;
|
|
2109
|
+
n[179] === f ? t = n[180] : (t = () => f.toggleVisibility(!1), n[179] = f, n[180] = t);
|
|
2110
|
+
let r;
|
|
2111
|
+
n[181] !== d.hideColumn || n[182] !== t ? (r = /* @__PURE__ */ U(p.Item, {
|
|
2112
|
+
leftSection: e,
|
|
2113
|
+
onClick: t,
|
|
2114
|
+
children: d.hideColumn
|
|
2115
|
+
}, "hide"), n[181] = d.hideColumn, n[182] = t, n[183] = r) : r = n[183], K.push(r);
|
|
1626
2116
|
}
|
|
1627
|
-
if (
|
|
2117
|
+
if (x) {
|
|
1628
2118
|
let e;
|
|
1629
|
-
n[
|
|
2119
|
+
n[184] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ U(F, {
|
|
1630
2120
|
size: 16,
|
|
1631
2121
|
stroke: 1.6
|
|
1632
|
-
}), n[
|
|
2122
|
+
}), n[184] = e) : e = n[184];
|
|
1633
2123
|
let t;
|
|
1634
|
-
n[
|
|
2124
|
+
n[185] === a.ui.actions ? t = n[186] : (t = () => a.ui.actions.setColumnsPanelOpen(!0), n[185] = a.ui.actions, n[186] = t);
|
|
2125
|
+
let r;
|
|
2126
|
+
n[187] !== d.manageColumns || n[188] !== t ? (r = /* @__PURE__ */ U(p.Item, {
|
|
1635
2127
|
leftSection: e,
|
|
1636
|
-
onClick:
|
|
1637
|
-
children:
|
|
1638
|
-
}, "manage"), n[
|
|
2128
|
+
onClick: t,
|
|
2129
|
+
children: d.manageColumns
|
|
2130
|
+
}, "manage"), n[187] = d.manageColumns, n[188] = t, n[189] = r) : r = n[189], K.push(r);
|
|
1639
2131
|
}
|
|
1640
|
-
for (;
|
|
1641
|
-
n[
|
|
1642
|
-
} else
|
|
1643
|
-
let
|
|
1644
|
-
n[
|
|
2132
|
+
for (; K.length > 0 && ur(K.at(-1));) K.pop();
|
|
2133
|
+
n[1] = a, n[2] = f, n[3] = N, n[4] = z, n[5] = V, n[6] = v, n[7] = u, n[8] = B, n[9] = H, n[10] = d, n[11] = i.pinnedAt, n[12] = P, n[13] = w, n[14] = l, n[15] = G, n[16] = oe, n[17] = se, n[18] = ce, n[19] = le, n[20] = ue, 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] = ye, n[30] = be, n[31] = K, n[32] = q, n[33] = J, n[34] = Se;
|
|
2134
|
+
} else G = n[15], oe = n[16], se = n[17], ce = n[18], le = n[19], ue = n[20], de = n[21], fe = n[22], pe = n[23], me = n[24], he = n[25], ge = n[26], _e = n[27], ve = n[28], ye = n[29], be = n[30], K = n[31], q = n[32], J = n[33], Se = n[34];
|
|
2135
|
+
let Ce;
|
|
2136
|
+
n[190] !== f.id || n[191] !== H || n[192] !== K ? (Ce = H && K.length > 0 && !rt(f.id), n[190] = f.id, n[191] = H, n[192] = K, n[193] = Ce) : Ce = n[193];
|
|
2137
|
+
let Y = Ce, we = le ? $.headerCellSortable : "", Te = he ? $.headerCellDragging : "", Ee = v === "before" ? $.headerCellDropBefore : "", De = v === "after" ? $.headerCellDropAfter : "", Oe = i.isBoundary && q === "left" ? Wn.stickyLeft : "", ke = i.isBoundary && q === "right" ? Wn.stickyRight : "", Ae;
|
|
2138
|
+
n[194] !== we || n[195] !== Te || n[196] !== Ee || n[197] !== De || n[198] !== Oe || n[199] !== ke ? (Ae = [
|
|
1645
2139
|
$.headerCell,
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
].filter(Boolean), n[
|
|
1653
|
-
let
|
|
1654
|
-
n[
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
n[
|
|
1662
|
-
|
|
1663
|
-
|
|
2140
|
+
we,
|
|
2141
|
+
Te,
|
|
2142
|
+
Ee,
|
|
2143
|
+
De,
|
|
2144
|
+
Oe,
|
|
2145
|
+
ke
|
|
2146
|
+
].filter(Boolean), n[194] = we, n[195] = Te, n[196] = Ee, n[197] = De, n[198] = Oe, n[199] = ke, n[200] = Ae) : Ae = n[200];
|
|
2147
|
+
let je = Ae.join(" "), X = `dg-header-${f.id}`, Me = ye || _e, Ne;
|
|
2148
|
+
n[201] === f.id ? Ne = n[202] : (Ne = rt(f.id), n[201] = f.id, n[202] = Ne);
|
|
2149
|
+
let Pe = le ? ye ? J ? "descending" : "ascending" : "none" : void 0, Fe = se && !ve, Ie = se ? pe : void 0, Le = se ? ue : void 0, Re = ge ? fe : void 0, Be = ge ? de : void 0, Ve = ge ? me : void 0, He = q === "left" ? i.offset : void 0, Ue = q === "right" ? i.offset : void 0, We = q ? "sticky" : void 0, Ge = q ? "var(--dg-z-header-pinned-cell, 7)" : void 0, Ke;
|
|
2150
|
+
n[203] !== He || n[204] !== Ue || n[205] !== We || n[206] !== Ge ? (Ke = {
|
|
2151
|
+
left: He,
|
|
2152
|
+
right: Ue,
|
|
2153
|
+
position: We,
|
|
2154
|
+
zIndex: Ge
|
|
2155
|
+
}, n[203] = He, n[204] = Ue, n[205] = We, n[206] = Ge, n[207] = Ke) : Ke = n[207];
|
|
2156
|
+
let qe = le ? sr : void 0, Je;
|
|
2157
|
+
n[208] !== le || n[209] !== f ? (Je = le ? (e) => {
|
|
2158
|
+
if (x.current) {
|
|
2159
|
+
x.current = !1;
|
|
1664
2160
|
return;
|
|
1665
2161
|
}
|
|
1666
|
-
|
|
1667
|
-
} : void 0, n[
|
|
1668
|
-
let
|
|
1669
|
-
n[
|
|
1670
|
-
label:
|
|
2162
|
+
f.getToggleSortingHandler()?.(e);
|
|
2163
|
+
} : void 0, n[208] = le, n[209] = f, n[210] = Je) : Je = n[210];
|
|
2164
|
+
let Q;
|
|
2165
|
+
n[211] !== f.columnDef || n[212] !== r || n[213] !== H || n[214] !== be ? (Q = r.isPlaceholder ? null : /* @__PURE__ */ U(S, {
|
|
2166
|
+
label: be,
|
|
1671
2167
|
openDelay: 600,
|
|
1672
2168
|
withinPortal: !0,
|
|
1673
|
-
disabled: !
|
|
1674
|
-
children: /* @__PURE__ */
|
|
2169
|
+
disabled: !H,
|
|
2170
|
+
children: /* @__PURE__ */ U("span", {
|
|
1675
2171
|
className: $.headerTitle,
|
|
1676
|
-
|
|
2172
|
+
"data-dg-header-title": !0,
|
|
2173
|
+
children: xe(f.columnDef.header, r.getContext())
|
|
1677
2174
|
})
|
|
1678
|
-
}), n[
|
|
1679
|
-
let
|
|
1680
|
-
n[
|
|
2175
|
+
}), n[211] = f.columnDef, n[212] = r, n[213] = H, n[214] = be, n[215] = Q) : Q = n[215];
|
|
2176
|
+
let Ye;
|
|
2177
|
+
n[216] !== a || n[217] !== le || n[218] !== f || n[219] !== g || n[220] !== Y || n[221] !== _e || n[222] !== H || n[223] !== ye || n[224] !== be || n[225] !== d || n[226] !== K || n[227] !== m || n[228] !== J || n[229] !== Se ? (Ye = H && /* @__PURE__ */ W("div", {
|
|
1681
2178
|
className: $.headerActions,
|
|
1682
2179
|
children: [
|
|
1683
|
-
|
|
2180
|
+
_e && /* @__PURE__ */ U(c, {
|
|
1684
2181
|
className: $.headerAction,
|
|
1685
2182
|
"data-pinned-visible": "true",
|
|
1686
2183
|
variant: "subtle",
|
|
1687
2184
|
color: "gray",
|
|
1688
2185
|
size: "xs",
|
|
1689
|
-
"aria-label":
|
|
2186
|
+
"aria-label": d.filterOn(be),
|
|
1690
2187
|
onClick: (e) => {
|
|
1691
|
-
e.stopPropagation(),
|
|
2188
|
+
e.stopPropagation(), Nn(a, f.id);
|
|
1692
2189
|
},
|
|
1693
|
-
children: /* @__PURE__ */
|
|
2190
|
+
children: /* @__PURE__ */ U(te, {
|
|
1694
2191
|
size: 14,
|
|
1695
2192
|
stroke: 1.6
|
|
1696
2193
|
})
|
|
1697
2194
|
}),
|
|
1698
|
-
|
|
2195
|
+
le && /* @__PURE__ */ U(c, {
|
|
1699
2196
|
className: $.headerAction,
|
|
1700
|
-
"data-pinned-visible":
|
|
2197
|
+
"data-pinned-visible": ye,
|
|
1701
2198
|
variant: "subtle",
|
|
1702
2199
|
color: "gray",
|
|
1703
2200
|
size: "xs",
|
|
1704
|
-
"aria-label":
|
|
1705
|
-
onClick:
|
|
1706
|
-
children:
|
|
2201
|
+
"aria-label": d.sortColumn(be),
|
|
2202
|
+
onClick: f.getToggleSortingHandler(),
|
|
2203
|
+
children: U(J ? k : M, {
|
|
1707
2204
|
size: 14,
|
|
1708
2205
|
stroke: 1.6
|
|
1709
2206
|
})
|
|
1710
2207
|
}),
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
2208
|
+
Se !== null && /* @__PURE__ */ U("span", {
|
|
2209
|
+
className: $.sortIndex,
|
|
2210
|
+
"data-testid": "dg-sort-index",
|
|
2211
|
+
children: Se
|
|
2212
|
+
}),
|
|
2213
|
+
Y && /* @__PURE__ */ W(p, {
|
|
2214
|
+
opened: m,
|
|
2215
|
+
onChange: h,
|
|
1714
2216
|
position: "bottom-start",
|
|
1715
2217
|
shadow: "md",
|
|
1716
2218
|
width: 220,
|
|
1717
2219
|
withinPortal: !0,
|
|
1718
|
-
children: [/* @__PURE__ */
|
|
2220
|
+
children: [/* @__PURE__ */ U(p.Target, { children: /* @__PURE__ */ U(c, {
|
|
1719
2221
|
className: $.headerAction,
|
|
1720
|
-
"data-pinned-visible":
|
|
2222
|
+
"data-pinned-visible": m || g,
|
|
1721
2223
|
variant: "subtle",
|
|
1722
2224
|
color: "gray",
|
|
1723
2225
|
size: "xs",
|
|
1724
|
-
"aria-label":
|
|
2226
|
+
"aria-label": d.columnMenu(be),
|
|
1725
2227
|
onClick: (e) => {
|
|
1726
|
-
e.stopPropagation(),
|
|
2228
|
+
e.stopPropagation(), h(or);
|
|
1727
2229
|
},
|
|
1728
|
-
children: /* @__PURE__ */
|
|
2230
|
+
children: /* @__PURE__ */ U(I, {
|
|
1729
2231
|
size: 14,
|
|
1730
2232
|
stroke: 1.6
|
|
1731
2233
|
})
|
|
1732
|
-
}) }), /* @__PURE__ */
|
|
1733
|
-
onClick:
|
|
1734
|
-
children:
|
|
2234
|
+
}) }), /* @__PURE__ */ U(p.Dropdown, {
|
|
2235
|
+
onClick: ar,
|
|
2236
|
+
children: K
|
|
1735
2237
|
})]
|
|
1736
2238
|
})
|
|
1737
2239
|
]
|
|
1738
|
-
}), n[
|
|
1739
|
-
let
|
|
1740
|
-
n[
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
n[171] !== pe || n[172] !== r ? (gt = pe ? (e) => {
|
|
1747
|
-
v.current = !0, r.getResizeHandler()(e);
|
|
1748
|
-
} : void 0, n[171] = pe, n[172] = r, n[173] = gt) : gt = n[173];
|
|
1749
|
-
let _t;
|
|
1750
|
-
n[174] !== pe || n[175] !== r ? (_t = pe ? r.getResizeHandler() : void 0, n[174] = pe, n[175] = r, n[176] = _t) : _t = n[176];
|
|
1751
|
-
let vt;
|
|
1752
|
-
n[177] !== ht || n[178] !== gt || n[179] !== _t ? (vt = /* @__PURE__ */ G("div", {
|
|
1753
|
-
className: ht,
|
|
2240
|
+
}), n[216] = a, n[217] = le, n[218] = f, n[219] = g, n[220] = Y, n[221] = _e, n[222] = H, n[223] = ye, n[224] = be, n[225] = d, n[226] = K, n[227] = m, n[228] = J, n[229] = Se, n[230] = Ye) : Ye = n[230];
|
|
2241
|
+
let Xe;
|
|
2242
|
+
n[231] !== oe || n[232] !== ce || n[233] !== f.id || n[234] !== r || n[235] !== ve ? (Xe = !rt(f.id) && /* @__PURE__ */ U("div", {
|
|
2243
|
+
className: [
|
|
2244
|
+
$.columnSeparator,
|
|
2245
|
+
ce ? $.columnSeparatorResizable : "",
|
|
2246
|
+
ve ? $.columnSeparatorActive : ""
|
|
2247
|
+
].filter(Boolean).join(" "),
|
|
1754
2248
|
draggable: !1,
|
|
1755
|
-
onMouseDown:
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
2249
|
+
onMouseDown: ce ? (e) => {
|
|
2250
|
+
x.current = !0, r.getResizeHandler()(e);
|
|
2251
|
+
} : void 0,
|
|
2252
|
+
onTouchStart: ce ? r.getResizeHandler() : void 0,
|
|
2253
|
+
onClick: ir,
|
|
2254
|
+
onDoubleClick: ce ? (e) => {
|
|
2255
|
+
e.stopPropagation(), oe();
|
|
2256
|
+
} : void 0
|
|
2257
|
+
}), n[231] = oe, n[232] = ce, n[233] = f.id, n[234] = r, n[235] = ve, n[236] = Xe) : Xe = n[236];
|
|
2258
|
+
let Ze;
|
|
2259
|
+
n[237] !== G || n[238] !== je || n[239] !== X || n[240] !== Me || n[241] !== Ne || n[242] !== Pe || n[243] !== Fe || n[244] !== Ie || n[245] !== Le || n[246] !== Re || n[247] !== Be || n[248] !== Ve || n[249] !== Ke || n[250] !== qe || n[251] !== Je || n[252] !== Q || n[253] !== Ye || n[254] !== Xe ? (Ze = /* @__PURE__ */ W("div", {
|
|
2260
|
+
ref: b,
|
|
1762
2261
|
role: "columnheader",
|
|
1763
|
-
"data-testid":
|
|
1764
|
-
"data-active":
|
|
1765
|
-
"data-align":
|
|
1766
|
-
"data-
|
|
1767
|
-
"aria-sort":
|
|
1768
|
-
className:
|
|
1769
|
-
draggable:
|
|
1770
|
-
onDragStart:
|
|
1771
|
-
onDragEnd:
|
|
1772
|
-
onDragOver:
|
|
1773
|
-
onDragLeave:
|
|
1774
|
-
onDrop:
|
|
1775
|
-
style:
|
|
1776
|
-
|
|
2262
|
+
"data-testid": X,
|
|
2263
|
+
"data-active": Me,
|
|
2264
|
+
"data-align": G,
|
|
2265
|
+
"data-control-column": Ne,
|
|
2266
|
+
"aria-sort": Pe,
|
|
2267
|
+
className: je,
|
|
2268
|
+
draggable: Fe,
|
|
2269
|
+
onDragStart: Ie,
|
|
2270
|
+
onDragEnd: Le,
|
|
2271
|
+
onDragOver: Re,
|
|
2272
|
+
onDragLeave: Be,
|
|
2273
|
+
onDrop: Ve,
|
|
2274
|
+
style: Ke,
|
|
2275
|
+
onMouseDown: qe,
|
|
2276
|
+
onClick: Je,
|
|
1777
2277
|
children: [
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
2278
|
+
Q,
|
|
2279
|
+
Ye,
|
|
2280
|
+
Xe
|
|
1781
2281
|
]
|
|
1782
|
-
}), n[
|
|
2282
|
+
}), n[237] = G, n[238] = je, n[239] = X, n[240] = Me, n[241] = Ne, n[242] = Pe, n[243] = Fe, n[244] = Ie, n[245] = Le, n[246] = Re, n[247] = Be, n[248] = Ve, n[249] = Ke, n[250] = qe, n[251] = Je, n[252] = Q, n[253] = Ye, n[254] = Xe, n[255] = Ze) : Ze = n[255];
|
|
2283
|
+
let Qe = Ze;
|
|
2284
|
+
if (!Y) return Qe;
|
|
2285
|
+
let $e;
|
|
2286
|
+
n[256] === Symbol.for("react.memo_cache_sentinel") ? ($e = (e) => {
|
|
2287
|
+
_(e), e && h(!1);
|
|
2288
|
+
}, n[256] = $e) : $e = n[256];
|
|
2289
|
+
let tt;
|
|
2290
|
+
n[257] === Qe ? tt = n[258] : (tt = /* @__PURE__ */ U(p.ContextMenu, { children: Qe }), n[257] = Qe, n[258] = tt);
|
|
2291
|
+
let it;
|
|
2292
|
+
n[259] === K ? it = n[260] : (it = /* @__PURE__ */ U(p.Dropdown, {
|
|
2293
|
+
onClick: rr,
|
|
2294
|
+
children: K
|
|
2295
|
+
}), n[259] = K, n[260] = it);
|
|
2296
|
+
let at;
|
|
2297
|
+
return n[261] !== g || n[262] !== tt || n[263] !== it ? (at = /* @__PURE__ */ W(p, {
|
|
2298
|
+
opened: g,
|
|
2299
|
+
onChange: $e,
|
|
2300
|
+
position: "bottom-start",
|
|
2301
|
+
shadow: "md",
|
|
2302
|
+
width: 220,
|
|
2303
|
+
withinPortal: !0,
|
|
2304
|
+
children: [tt, it]
|
|
2305
|
+
}), n[261] = g, n[262] = tt, n[263] = it, n[264] = at) : at = n[264], at;
|
|
2306
|
+
}
|
|
2307
|
+
function rr(e) {
|
|
2308
|
+
return e.stopPropagation();
|
|
1783
2309
|
}
|
|
1784
|
-
function
|
|
2310
|
+
function ir(e) {
|
|
1785
2311
|
return e.stopPropagation();
|
|
1786
2312
|
}
|
|
1787
|
-
function
|
|
2313
|
+
function ar(e) {
|
|
1788
2314
|
return e.stopPropagation();
|
|
1789
2315
|
}
|
|
1790
|
-
function
|
|
2316
|
+
function or(e) {
|
|
1791
2317
|
return !e;
|
|
1792
2318
|
}
|
|
1793
|
-
function
|
|
2319
|
+
function sr(e) {
|
|
2320
|
+
e.shiftKey && e.preventDefault();
|
|
2321
|
+
}
|
|
2322
|
+
function cr(e) {
|
|
1794
2323
|
return e.draggedColumnId;
|
|
1795
2324
|
}
|
|
1796
|
-
function
|
|
2325
|
+
function lr(e) {
|
|
1797
2326
|
return {
|
|
1798
2327
|
sorting: e.sorting,
|
|
1799
2328
|
columnFilters: e.columnFilters,
|
|
@@ -1803,79 +2332,228 @@ function kn(e) {
|
|
|
1803
2332
|
grouping: e.grouping
|
|
1804
2333
|
};
|
|
1805
2334
|
}
|
|
1806
|
-
function
|
|
1807
|
-
return typeof e == "object" && !!e && "type" in e && e.type ===
|
|
2335
|
+
function ur(e) {
|
|
2336
|
+
return typeof e == "object" && !!e && "type" in e && e.type === p.Divider;
|
|
2337
|
+
}
|
|
2338
|
+
//#endregion
|
|
2339
|
+
//#region src/tmdatagrid/core/cellRange.ts
|
|
2340
|
+
function dr({ range: e, rowIndexOf: t, columnIndexOf: n }) {
|
|
2341
|
+
if (e === null) return null;
|
|
2342
|
+
let r = t(e.anchor.rowId), i = t(e.focus.rowId), a = n(e.anchor.columnId), o = n(e.focus.columnId);
|
|
2343
|
+
return r < 0 || i < 0 || a < 0 || o < 0 ? null : {
|
|
2344
|
+
top: Math.min(r, i),
|
|
2345
|
+
bottom: Math.max(r, i),
|
|
2346
|
+
left: Math.min(a, o),
|
|
2347
|
+
right: Math.max(a, o)
|
|
2348
|
+
};
|
|
2349
|
+
}
|
|
2350
|
+
function fr(e, t, n) {
|
|
2351
|
+
return e !== null && t >= e.top && t <= e.bottom && n >= e.left && n <= e.right;
|
|
2352
|
+
}
|
|
2353
|
+
function pr(e) {
|
|
2354
|
+
return e === null ? 0 : (e.bottom - e.top + 1) * (e.right - e.left + 1);
|
|
2355
|
+
}
|
|
2356
|
+
function mr(e, t, n) {
|
|
2357
|
+
return !fr(e, t, n) || e === null ? null : {
|
|
2358
|
+
top: t === e.top,
|
|
2359
|
+
bottom: t === e.bottom,
|
|
2360
|
+
left: n === e.left,
|
|
2361
|
+
right: n === e.right
|
|
2362
|
+
};
|
|
2363
|
+
}
|
|
2364
|
+
//#endregion
|
|
2365
|
+
//#region src/tmdatagrid/core/cellExport.ts
|
|
2366
|
+
var hr = "", gr = {
|
|
2367
|
+
separator: ";",
|
|
2368
|
+
decimalComma: !0,
|
|
2369
|
+
includeHeaders: !0,
|
|
2370
|
+
fileName: "export"
|
|
2371
|
+
};
|
|
2372
|
+
function _r(e, { decimalComma: t }) {
|
|
2373
|
+
if (e == null) return "";
|
|
2374
|
+
if (typeof e == "number") {
|
|
2375
|
+
if (!Number.isFinite(e)) return "";
|
|
2376
|
+
let n = String(e);
|
|
2377
|
+
return t ? n.replace(".", ",") : n;
|
|
2378
|
+
}
|
|
2379
|
+
if (typeof e == "string") return e;
|
|
2380
|
+
if (typeof e == "boolean") return e ? "true" : "false";
|
|
2381
|
+
if (Array.isArray(e)) return e.map((e) => _r(e, { decimalComma: t })).join(", ");
|
|
2382
|
+
if (e instanceof Date) return Number.isNaN(e.getTime()) ? "" : e.toLocaleString("sv-SE");
|
|
2383
|
+
if (typeof e == "object") try {
|
|
2384
|
+
return JSON.stringify(e);
|
|
2385
|
+
} catch {
|
|
2386
|
+
return "";
|
|
2387
|
+
}
|
|
2388
|
+
return String(e);
|
|
2389
|
+
}
|
|
2390
|
+
function vr({ rows: e, columns: t, bounds: n, includeHeaders: r, decimalComma: i }) {
|
|
2391
|
+
let a = t.slice(n.left, n.right + 1).filter((e) => !rt(e.id));
|
|
2392
|
+
if (a.length === 0) return [];
|
|
2393
|
+
let o = [];
|
|
2394
|
+
r && o.push(a.map((e) => et(e)));
|
|
2395
|
+
for (let t = n.top; t <= n.bottom; t += 1) {
|
|
2396
|
+
let n = e[t];
|
|
2397
|
+
n !== void 0 && o.push(a.map((e) => _r(n.getValue(e.id), { decimalComma: i })));
|
|
2398
|
+
}
|
|
2399
|
+
return o;
|
|
2400
|
+
}
|
|
2401
|
+
function yr({ table: e, includeHeaders: t = gr.includeHeaders, decimalComma: n = gr.decimalComma }) {
|
|
2402
|
+
let r = e, i = [
|
|
2403
|
+
...r.getLeftVisibleLeafColumns(),
|
|
2404
|
+
...r.getCenterVisibleLeafColumns(),
|
|
2405
|
+
...r.getRightVisibleLeafColumns()
|
|
2406
|
+
], a = [], o = (e) => {
|
|
2407
|
+
for (let t of e) t.getIsGrouped() ? o(t.subRows) : a.push(t);
|
|
2408
|
+
};
|
|
2409
|
+
return o(r.getSortedRowModel().rows), vr({
|
|
2410
|
+
rows: a,
|
|
2411
|
+
columns: i,
|
|
2412
|
+
bounds: {
|
|
2413
|
+
top: 0,
|
|
2414
|
+
bottom: a.length - 1,
|
|
2415
|
+
left: 0,
|
|
2416
|
+
right: i.length - 1
|
|
2417
|
+
},
|
|
2418
|
+
includeHeaders: t,
|
|
2419
|
+
decimalComma: n
|
|
2420
|
+
});
|
|
2421
|
+
}
|
|
2422
|
+
function br({ table: e, options: t }) {
|
|
2423
|
+
let n = {
|
|
2424
|
+
...gr,
|
|
2425
|
+
...t
|
|
2426
|
+
}, r = yr({
|
|
2427
|
+
table: e,
|
|
2428
|
+
includeHeaders: n.includeHeaders,
|
|
2429
|
+
decimalComma: n.decimalComma
|
|
2430
|
+
});
|
|
2431
|
+
r.length !== 0 && Tr({
|
|
2432
|
+
fileName: `${n.fileName}.csv`,
|
|
2433
|
+
text: Cr(r, { separator: n.separator })
|
|
2434
|
+
});
|
|
2435
|
+
}
|
|
2436
|
+
function xr(e, t) {
|
|
2437
|
+
return e.includes(t) || e.includes("\"") || e.includes("\n") || e.includes("\r") ? `"${e.replaceAll("\"", "\"\"")}"` : e;
|
|
2438
|
+
}
|
|
2439
|
+
function Sr(e) {
|
|
2440
|
+
return e.map((e) => e.map((e) => xr(e, " ")).join(" ")).join("\r\n");
|
|
2441
|
+
}
|
|
2442
|
+
function Cr(e, { separator: t }) {
|
|
2443
|
+
return `${hr}sep=${t}\r\n${e.map((e) => e.map((e) => xr(e, t)).join(t)).join("\r\n")}\r\n`;
|
|
2444
|
+
}
|
|
2445
|
+
async function wr(e) {
|
|
2446
|
+
try {
|
|
2447
|
+
return await navigator.clipboard.writeText(e), !0;
|
|
2448
|
+
} catch {
|
|
2449
|
+
return !1;
|
|
2450
|
+
}
|
|
2451
|
+
}
|
|
2452
|
+
function Tr({ fileName: e, text: t, mimeType: n = "text/csv;charset=utf-8" }) {
|
|
2453
|
+
let r = URL.createObjectURL(new Blob([t], { type: n })), i = document.createElement("a");
|
|
2454
|
+
i.href = r, i.download = e, i.style.display = "none", document.body.append(i), i.click(), i.remove(), setTimeout(() => URL.revokeObjectURL(r), 0);
|
|
1808
2455
|
}
|
|
1809
2456
|
//#endregion
|
|
1810
2457
|
//#region src/tmdatagrid/components/TMDataGridTable.tsx
|
|
1811
|
-
var
|
|
2458
|
+
var Er = {
|
|
1812
2459
|
pinnedAt: !1,
|
|
1813
2460
|
offset: 0,
|
|
1814
2461
|
isBoundary: !1
|
|
1815
|
-
}
|
|
1816
|
-
|
|
2462
|
+
}, Dr = [
|
|
2463
|
+
"button:not([disabled])",
|
|
2464
|
+
"input:not([disabled])",
|
|
2465
|
+
"select:not([disabled])",
|
|
2466
|
+
"textarea:not([disabled])",
|
|
2467
|
+
"a[href]",
|
|
2468
|
+
"[tabindex]:not([tabindex=\"-1\"])"
|
|
2469
|
+
].join(",");
|
|
2470
|
+
function Or(e, t) {
|
|
2471
|
+
return e.querySelector(`[data-cell="true"][data-row-id="${CSS.escape(t.rowId)}"][data-column-id="${CSS.escape(t.columnId)}"]`);
|
|
2472
|
+
}
|
|
2473
|
+
function kr({ container: e, cellElement: t, leftPinnedWidth: n, rightPinnedWidth: r }) {
|
|
2474
|
+
let i = t.getBoundingClientRect(), a = e.getBoundingClientRect(), o = a.left + n, s = a.right - r;
|
|
2475
|
+
i.left < o ? e.scrollLeft -= o - i.left : i.right > s && (e.scrollLeft += i.right - s);
|
|
2476
|
+
}
|
|
2477
|
+
function Ar(e) {
|
|
1817
2478
|
if (e.getIsPlaceholder()) return null;
|
|
1818
|
-
if (!e.getIsAggregated()) return
|
|
2479
|
+
if (!e.getIsAggregated()) return xe(e.column.columnDef.cell, e.getContext());
|
|
1819
2480
|
let { aggregatedCell: t, aggregationFn: n } = e.column.columnDef;
|
|
1820
|
-
return t === void 0 ? n === void 0 ? null :
|
|
1821
|
-
}
|
|
1822
|
-
function
|
|
1823
|
-
let n = e(
|
|
1824
|
-
n[0] === r.column ?
|
|
1825
|
-
let
|
|
1826
|
-
n[2]
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
n[
|
|
2481
|
+
return t === void 0 ? n === void 0 ? null : xe(e.column.columnDef.cell, e.getContext()) : xe(t, e.getContext());
|
|
2482
|
+
}
|
|
2483
|
+
function jr(t) {
|
|
2484
|
+
let n = e(40), { cell: r, rowHeight: i, layout: a, nav: o, onFocus: s, onMouseDown: c, onMouseEnter: l, onContextMenu: u } = t, d = o ? "gridcell" : "cell", f = o?.columnIndex, p = o?.tabIndex, m = o ? !0 : void 0, h = o?.rowId, g = r.column.id, _ = o?.focused, v = o?.selected, y = o?.selected, b = o?.edges?.top, x = o?.edges?.bottom, S = o?.edges?.left, C = o?.edges?.right, w;
|
|
2485
|
+
n[0] === r.column ? w = n[1] : (w = nt(r.column), n[0] = r.column, n[1] = w);
|
|
2486
|
+
let T;
|
|
2487
|
+
n[2] === r.column.id ? T = n[3] : (T = rt(r.column.id), n[2] = r.column.id, n[3] = T);
|
|
2488
|
+
let E = a.isBoundary && a.pinnedAt === "left" ? Wn.stickyLeft : "", D = a.isBoundary && a.pinnedAt === "right" ? Wn.stickyRight : "", O;
|
|
2489
|
+
n[4] !== E || n[5] !== D ? (O = [
|
|
2490
|
+
Un.bodyCell,
|
|
2491
|
+
E,
|
|
2492
|
+
D
|
|
2493
|
+
].filter(Boolean), n[4] = E, n[5] = D, n[6] = O) : O = n[6];
|
|
2494
|
+
let k = O.join(" "), A = a.pinnedAt === "left" ? a.offset : void 0, j = a.pinnedAt === "right" ? a.offset : void 0, M = a.pinnedAt ? "sticky" : o?.focused ? "relative" : void 0, N = o?.focused ? "var(--dg-z-focused-cell, 3)" : a.pinnedAt ? "var(--dg-z-pinned-cell, 2)" : void 0, P;
|
|
2495
|
+
n[7] !== i || n[8] !== A || n[9] !== j || n[10] !== M || n[11] !== N ? (P = {
|
|
1833
2496
|
minHeight: i,
|
|
1834
|
-
left:
|
|
1835
|
-
right:
|
|
1836
|
-
position:
|
|
1837
|
-
zIndex:
|
|
1838
|
-
}, n[
|
|
1839
|
-
let
|
|
1840
|
-
n[
|
|
1841
|
-
let
|
|
1842
|
-
n[
|
|
1843
|
-
className:
|
|
1844
|
-
children:
|
|
1845
|
-
}), n[
|
|
1846
|
-
let
|
|
1847
|
-
return n[
|
|
1848
|
-
role:
|
|
1849
|
-
"
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
2497
|
+
left: A,
|
|
2498
|
+
right: j,
|
|
2499
|
+
position: M,
|
|
2500
|
+
zIndex: N
|
|
2501
|
+
}, n[7] = i, n[8] = A, n[9] = j, n[10] = M, n[11] = N, n[12] = P) : P = n[12];
|
|
2502
|
+
let F;
|
|
2503
|
+
n[13] === r ? F = n[14] : (F = Ar(r), n[13] = r, n[14] = F);
|
|
2504
|
+
let I;
|
|
2505
|
+
n[15] === F ? I = n[16] : (I = /* @__PURE__ */ U("span", {
|
|
2506
|
+
className: Un.cellContent,
|
|
2507
|
+
children: F
|
|
2508
|
+
}), n[15] = F, n[16] = I);
|
|
2509
|
+
let ee;
|
|
2510
|
+
return n[17] !== r.column.id || n[18] !== u || n[19] !== s || n[20] !== c || n[21] !== l || n[22] !== d || n[23] !== b || n[24] !== x || n[25] !== S || n[26] !== C || n[27] !== w || n[28] !== T || n[29] !== k || n[30] !== f || n[31] !== P || n[32] !== I || n[33] !== p || n[34] !== m || n[35] !== h || n[36] !== _ || n[37] !== v || n[38] !== y ? (ee = /* @__PURE__ */ U("div", {
|
|
2511
|
+
role: d,
|
|
2512
|
+
"aria-colindex": f,
|
|
2513
|
+
tabIndex: p,
|
|
2514
|
+
"data-cell": m,
|
|
2515
|
+
"data-row-id": h,
|
|
2516
|
+
"data-column-id": g,
|
|
2517
|
+
"data-focused": _,
|
|
2518
|
+
"aria-selected": v,
|
|
2519
|
+
"data-selected": y,
|
|
2520
|
+
"data-edge-top": b,
|
|
2521
|
+
"data-edge-bottom": x,
|
|
2522
|
+
"data-edge-left": S,
|
|
2523
|
+
"data-edge-right": C,
|
|
2524
|
+
onFocus: s,
|
|
2525
|
+
onMouseDown: c,
|
|
2526
|
+
onMouseEnter: l,
|
|
2527
|
+
"data-align": w,
|
|
2528
|
+
"data-control-column": T,
|
|
2529
|
+
onContextMenu: u,
|
|
2530
|
+
className: k,
|
|
2531
|
+
style: P,
|
|
2532
|
+
children: I
|
|
2533
|
+
}), n[17] = r.column.id, n[18] = u, n[19] = s, n[20] = c, n[21] = l, n[22] = d, n[23] = b, n[24] = x, n[25] = S, n[26] = C, n[27] = w, n[28] = T, n[29] = k, n[30] = f, n[31] = P, n[32] = I, n[33] = p, n[34] = m, n[35] = h, n[36] = _, n[37] = v, n[38] = y, n[39] = ee) : ee = n[39], ee;
|
|
1856
2534
|
}
|
|
1857
|
-
function
|
|
2535
|
+
function Mr(t) {
|
|
1858
2536
|
let n = e(16), { enabled: r, menuContent: i, menuProps: a, onContextMenu: o, onClose: s, children: c } = t, l;
|
|
1859
2537
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (l = { display: "contents" }, n[0] = l) : l = n[0];
|
|
1860
2538
|
let u = r ? o : void 0, d;
|
|
1861
|
-
n[1] !== c || n[2] !== u ? (d = /* @__PURE__ */
|
|
2539
|
+
n[1] !== c || n[2] !== u ? (d = /* @__PURE__ */ U("div", {
|
|
1862
2540
|
role: "rowgroup",
|
|
1863
2541
|
style: l,
|
|
1864
2542
|
onContextMenu: u,
|
|
1865
2543
|
children: c
|
|
1866
2544
|
}), n[1] = c, n[2] = u, n[3] = d) : d = n[3];
|
|
1867
|
-
let
|
|
1868
|
-
if (!r) return
|
|
2545
|
+
let f = d;
|
|
2546
|
+
if (!r) return f;
|
|
1869
2547
|
let m = i !== null, h;
|
|
1870
2548
|
n[4] === s ? h = n[5] : (h = (e) => {
|
|
1871
2549
|
e || s();
|
|
1872
2550
|
}, n[4] = s, n[5] = h);
|
|
1873
2551
|
let g;
|
|
1874
|
-
n[6] ===
|
|
2552
|
+
n[6] === f ? g = n[7] : (g = /* @__PURE__ */ U(p.ContextMenu, { children: f }), n[6] = f, n[7] = g);
|
|
1875
2553
|
let _;
|
|
1876
|
-
n[8] === i ? _ = n[9] : (_ = /* @__PURE__ */
|
|
2554
|
+
n[8] === i ? _ = n[9] : (_ = /* @__PURE__ */ U(p.Dropdown, { children: i }), n[8] = i, n[9] = _);
|
|
1877
2555
|
let v;
|
|
1878
|
-
return n[10] !== a || n[11] !== m || n[12] !== h || n[13] !== g || n[14] !== _ ? (v = /* @__PURE__ */
|
|
2556
|
+
return n[10] !== a || n[11] !== m || n[12] !== h || n[13] !== g || n[14] !== _ ? (v = /* @__PURE__ */ W(p, {
|
|
1879
2557
|
opened: m,
|
|
1880
2558
|
onChange: h,
|
|
1881
2559
|
position: "bottom-start",
|
|
@@ -1885,38 +2563,55 @@ function Pn(t) {
|
|
|
1885
2563
|
children: [g, _]
|
|
1886
2564
|
}), n[10] = a, n[11] = m, n[12] = h, n[13] = g, n[14] = _, n[15] = v) : v = n[15], v;
|
|
1887
2565
|
}
|
|
1888
|
-
function
|
|
1889
|
-
let { table:
|
|
1890
|
-
|
|
1891
|
-
let
|
|
2566
|
+
function Nr({ onRowClick: e, rowContextMenu: t, rowContextMenuProps: r, cellExport: a, onReachEnd: c, reachEndThreshold: l = 10 }) {
|
|
2567
|
+
let { table: d, ui: m, features: h, labels: g, rowHeight: _, controlSize: v, renderDetails: y, renderDetailsEstHeight: x, overscan: S } = Z();
|
|
2568
|
+
T(d.store);
|
|
2569
|
+
let C = T(m, (e) => e.highlightedRowId), w = T(m, (e) => e.focusedCell), E = T(m, (e) => e.cellRange), { loading: D, noResultsLabel: O = g.noResults } = d.options.meta ?? {}, k = o(null), A = Ge(d, h), j = (e) => y !== void 0 && !e.getIsGrouped() && e.getIsExpanded(), M = o(!1);
|
|
1892
2570
|
i(() => {
|
|
1893
|
-
if (
|
|
1894
|
-
|
|
1895
|
-
|
|
2571
|
+
if (M.current) return;
|
|
2572
|
+
M.current = !0;
|
|
2573
|
+
let e = k.current;
|
|
2574
|
+
if (e !== null) for (let t of z) t.columnDef.meta?.autoSize === !0 && (t.id in d.store.state.columnSizing || Yn({
|
|
2575
|
+
table: d,
|
|
2576
|
+
columnId: t.id,
|
|
2577
|
+
container: e
|
|
2578
|
+
}));
|
|
2579
|
+
}), i(() => {
|
|
2580
|
+
if (!h.pagination) return;
|
|
2581
|
+
let e = d.getPageCount();
|
|
2582
|
+
e > 0 && d.store.state.pagination.pageIndex >= e && d.setPageIndex(e - 1);
|
|
1896
2583
|
});
|
|
1897
|
-
let
|
|
1898
|
-
count:
|
|
1899
|
-
getScrollElement: () =>
|
|
1900
|
-
estimateSize:
|
|
1901
|
-
|
|
1902
|
-
|
|
2584
|
+
let N = Ae({
|
|
2585
|
+
count: A.length,
|
|
2586
|
+
getScrollElement: () => k.current,
|
|
2587
|
+
estimateSize: (e) => {
|
|
2588
|
+
let t = A[e];
|
|
2589
|
+
return t === void 0 ? _ : _ + (j(t) ? x : 0);
|
|
2590
|
+
},
|
|
2591
|
+
measureElement: (e, t, n) => e.getBoundingClientRect().height || n.options.estimateSize(n.indexFromElement(e)),
|
|
2592
|
+
getItemKey: n((e) => A[e]?.id ?? e, [A]),
|
|
2593
|
+
overscan: S,
|
|
1903
2594
|
initialRect: {
|
|
1904
2595
|
height: 600,
|
|
1905
2596
|
width: 1200
|
|
1906
2597
|
}
|
|
1907
|
-
}),
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
2598
|
+
}), P = N.getVirtualItems(), F = P[0]?.start ?? 0, I = N.getTotalSize() - (P.at(-1)?.end ?? 0), ee = o(null), te = o(!1), ne = P.at(-1)?.index ?? -1;
|
|
2599
|
+
i(() => {
|
|
2600
|
+
c === void 0 || A.length === 0 || (h.pagination && !te.current && (te.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.")), !(ne < A.length - 1 - l) && ee.current !== A.length && (ee.current = A.length, c()));
|
|
2601
|
+
});
|
|
2602
|
+
let L = d.getLeftVisibleLeafColumns(), R = d.getRightVisibleLeafColumns(), re = d.getCenterVisibleLeafColumns(), z = [
|
|
2603
|
+
...L,
|
|
2604
|
+
...re,
|
|
2605
|
+
...R
|
|
2606
|
+
], ie = d.getCenterHeaderGroups(), V = d.getLeftHeaderGroups(), ae = d.getRightHeaderGroups(), G = ie.map((e, t) => ({
|
|
1912
2607
|
id: e.id,
|
|
1913
2608
|
headers: [
|
|
1914
|
-
...
|
|
2609
|
+
...V[t]?.headers ?? [],
|
|
1915
2610
|
...e.headers,
|
|
1916
|
-
...
|
|
2611
|
+
...ae[t]?.headers ?? []
|
|
1917
2612
|
]
|
|
1918
|
-
})),
|
|
1919
|
-
let t = e.columnDef.minSize === e.columnDef.maxSize, n = e.id in
|
|
2613
|
+
})), oe = d.store.state.columnSizing, se = z.map((e) => {
|
|
2614
|
+
let t = e.columnDef.minSize === e.columnDef.maxSize, n = e.id in oe, r = e.getIsPinned() !== !1, i = e.columnDef.minSize ?? 80;
|
|
1920
2615
|
return t || n || r ? {
|
|
1921
2616
|
track: `${e.getSize()}px`,
|
|
1922
2617
|
minWidth: e.getSize()
|
|
@@ -1924,196 +2619,453 @@ function Fn({ onRowClick: e, rowContextMenu: t, rowContextMenuProps: r }) {
|
|
|
1924
2619
|
track: `minmax(${i}px, ${e.columnDef.meta?.flex ?? 1}fr)`,
|
|
1925
2620
|
minWidth: i
|
|
1926
2621
|
};
|
|
1927
|
-
}),
|
|
1928
|
-
for (let e of
|
|
2622
|
+
}), ce = se.map((e) => e.track).join(" "), le = se.reduce((e, t) => e + t.minWidth, 0), ue = /* @__PURE__ */ new Map(), de = (e) => se[z.findIndex((t) => t.id === e)]?.minWidth ?? 0, fe = 0;
|
|
2623
|
+
for (let e of L) ue.set(e.id, {
|
|
1929
2624
|
pinnedAt: "left",
|
|
1930
|
-
offset:
|
|
1931
|
-
isBoundary: e.id ===
|
|
1932
|
-
}),
|
|
1933
|
-
let
|
|
1934
|
-
for (let e of [...
|
|
2625
|
+
offset: fe,
|
|
2626
|
+
isBoundary: e.id === L.at(-1)?.id
|
|
2627
|
+
}), fe += de(e.id);
|
|
2628
|
+
let pe = 0;
|
|
2629
|
+
for (let e of [...R].reverse()) ue.set(e.id, {
|
|
1935
2630
|
pinnedAt: "right",
|
|
1936
|
-
offset:
|
|
1937
|
-
isBoundary: e.id ===
|
|
1938
|
-
}),
|
|
1939
|
-
for (let e of
|
|
2631
|
+
offset: pe,
|
|
2632
|
+
isBoundary: e.id === R[0]?.id
|
|
2633
|
+
}), pe += de(e.id);
|
|
2634
|
+
for (let e of re) ue.set(e.id, {
|
|
1940
2635
|
pinnedAt: !1,
|
|
1941
2636
|
offset: 0,
|
|
1942
2637
|
isBoundary: !1
|
|
1943
2638
|
});
|
|
1944
|
-
let
|
|
1945
|
-
if (
|
|
1946
|
-
let e =
|
|
1947
|
-
rows:
|
|
2639
|
+
let me = (e) => ue.get(e) ?? Er, he = A.length === 0, ge = G.at(-1)?.headers ?? [], _e = z.some((e) => e.columnDef.footer !== void 0), ve = h.rowClickSelects, ye = ve || h.highlightRow || e !== void 0, be = (e) => !e.getIsGrouped() && ye, K = (t, n) => {
|
|
2640
|
+
if (ve && t.getCanSelect()) {
|
|
2641
|
+
let e = Je({
|
|
2642
|
+
rows: A,
|
|
1948
2643
|
rowId: t.id,
|
|
1949
|
-
anchorRowId:
|
|
2644
|
+
anchorRowId: m.state.selectionAnchorRowId,
|
|
1950
2645
|
modifiers: n,
|
|
1951
|
-
selection:
|
|
2646
|
+
selection: d.store.state.rowSelection,
|
|
1952
2647
|
canReplaceSelection: !0
|
|
1953
2648
|
});
|
|
1954
|
-
|
|
2649
|
+
d.setRowSelection(e.selection), m.actions.setSelectionAnchor(e.anchorRowId);
|
|
2650
|
+
}
|
|
2651
|
+
h.highlightRow && m.actions.setHighlightedRow(t.id), e?.(t);
|
|
2652
|
+
}, q = h.cellSelection, J = h.cellRangeSelection, Se = o(!1), Ce = o(null), Y = q && w !== null ? A.findIndex((e) => e.id === w.rowId) : -1, we = q && w !== null ? z.findIndex((e) => e.id === w.columnId) : -1, Te = Y >= 0 && P.some((e) => e.index === Y), Ee = A[P[0]?.index ?? -1], De = q ? Te && w !== null ? w : Ee && z[0] ? {
|
|
2653
|
+
rowId: Ee.id,
|
|
2654
|
+
columnId: z[0].id
|
|
2655
|
+
} : null : null, Oe = (e, t, n) => e !== null && e.rowId === t && e.columnId === n, ke = dr({
|
|
2656
|
+
range: J ? E : null,
|
|
2657
|
+
rowIndexOf: (e) => A.findIndex((t) => t.id === e),
|
|
2658
|
+
columnIndexOf: (e) => z.findIndex((t) => t.id === e)
|
|
2659
|
+
}), je = (e, { extend: t }) => {
|
|
2660
|
+
if (!J) return;
|
|
2661
|
+
let n = t ? E?.anchor ?? e : e;
|
|
2662
|
+
m.actions.setCellRange({
|
|
2663
|
+
anchor: n,
|
|
2664
|
+
focus: e
|
|
2665
|
+
});
|
|
2666
|
+
}, X = ke ?? (q && Y >= 0 && we >= 0 ? {
|
|
2667
|
+
top: Y,
|
|
2668
|
+
bottom: Y,
|
|
2669
|
+
left: we,
|
|
2670
|
+
right: we
|
|
2671
|
+
} : null), Me = pr(X), Ne = X === null ? 0 : z.slice(X.left, X.right + 1).filter((e) => !rt(e.id)).length, Pe = {
|
|
2672
|
+
...gr,
|
|
2673
|
+
...a
|
|
2674
|
+
}, [Fe, Ie] = s(Pe.includeHeaders), Le = (e) => X === null ? [] : vr({
|
|
2675
|
+
rows: A,
|
|
2676
|
+
columns: z,
|
|
2677
|
+
bounds: X,
|
|
2678
|
+
includeHeaders: e,
|
|
2679
|
+
decimalComma: Pe.decimalComma
|
|
2680
|
+
}), Re = async () => {
|
|
2681
|
+
let e = Le(!1);
|
|
2682
|
+
e.length !== 0 && await wr(Sr(e));
|
|
2683
|
+
}, [ze, Be] = s(!1);
|
|
2684
|
+
i(() => {
|
|
2685
|
+
if (!ze) return;
|
|
2686
|
+
let e = () => Be(!1);
|
|
2687
|
+
return window.addEventListener("mouseup", e), () => window.removeEventListener("mouseup", e);
|
|
2688
|
+
}, [ze]);
|
|
2689
|
+
let Ve = (e, { extend: t }) => {
|
|
2690
|
+
m.actions.setFocusedCell(e), je(e, { extend: t }), t || Be(!0);
|
|
2691
|
+
}, He = (e) => {
|
|
2692
|
+
let t = Le(e);
|
|
2693
|
+
t.length !== 0 && Tr({
|
|
2694
|
+
fileName: `${Pe.fileName}.csv`,
|
|
2695
|
+
text: Cr(t, { separator: Pe.separator })
|
|
2696
|
+
});
|
|
2697
|
+
}, Ue = (e, { extend: t } = { extend: !1 }) => {
|
|
2698
|
+
let n = A[e.rowIndex], r = z[e.columnIndex];
|
|
2699
|
+
if (!n || !r) return;
|
|
2700
|
+
let i = {
|
|
2701
|
+
rowId: n.id,
|
|
2702
|
+
columnId: r.id
|
|
2703
|
+
};
|
|
2704
|
+
Se.current = !0, m.actions.setFocusedCell(i), je(i, { extend: t });
|
|
2705
|
+
}, We = (e, { extend: t }) => {
|
|
2706
|
+
if (h.rowSelection && qe(e).length > 0) {
|
|
2707
|
+
let n = Je({
|
|
2708
|
+
rows: A,
|
|
2709
|
+
rowId: e.id,
|
|
2710
|
+
anchorRowId: m.state.selectionAnchorRowId,
|
|
2711
|
+
modifiers: {
|
|
2712
|
+
toggle: !t,
|
|
2713
|
+
extend: t
|
|
2714
|
+
},
|
|
2715
|
+
selection: d.store.state.rowSelection,
|
|
2716
|
+
canReplaceSelection: !1
|
|
2717
|
+
});
|
|
2718
|
+
d.setRowSelection(n.selection), m.actions.setSelectionAnchor(n.anchorRowId);
|
|
2719
|
+
return;
|
|
2720
|
+
}
|
|
2721
|
+
h.highlightRow && !e.getIsGrouped() && m.actions.setHighlightedRow(e.id);
|
|
2722
|
+
}, Ke = (e) => {
|
|
2723
|
+
let t = e.target;
|
|
2724
|
+
if (t.dataset.cell !== "true") {
|
|
2725
|
+
if (e.key !== "Escape") return;
|
|
2726
|
+
let n = t.closest("[data-cell=\"true\"]");
|
|
2727
|
+
if (n === null) return;
|
|
2728
|
+
e.preventDefault(), n.focus();
|
|
2729
|
+
return;
|
|
2730
|
+
}
|
|
2731
|
+
let { rowId: n, columnId: r } = t.dataset;
|
|
2732
|
+
if (n === void 0 || r === void 0) return;
|
|
2733
|
+
let i = A.findIndex((e) => e.id === n), a = z.findIndex((e) => e.id === r);
|
|
2734
|
+
if (i < 0 || a < 0) return;
|
|
2735
|
+
if ((e.ctrlKey || e.metaKey) && (e.key === "c" || e.key === "C")) {
|
|
2736
|
+
if (X === null) return;
|
|
2737
|
+
e.preventDefault(), Re();
|
|
2738
|
+
return;
|
|
2739
|
+
}
|
|
2740
|
+
if (e.key === "Enter" || e.key === "F2") {
|
|
2741
|
+
let n = t.querySelector(Dr);
|
|
2742
|
+
if (n === null) return;
|
|
2743
|
+
e.preventDefault(), n.focus();
|
|
2744
|
+
return;
|
|
2745
|
+
}
|
|
2746
|
+
if (e.key === "Escape") {
|
|
2747
|
+
if (E === null) return;
|
|
2748
|
+
e.preventDefault(), je({
|
|
2749
|
+
rowId: n,
|
|
2750
|
+
columnId: r
|
|
2751
|
+
}, { extend: !1 });
|
|
2752
|
+
return;
|
|
2753
|
+
}
|
|
2754
|
+
if (e.key === " ") {
|
|
2755
|
+
e.preventDefault();
|
|
2756
|
+
let t = A[i];
|
|
2757
|
+
t && We(t, { extend: e.shiftKey });
|
|
2758
|
+
return;
|
|
1955
2759
|
}
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
2760
|
+
let o = wn({
|
|
2761
|
+
key: e.key,
|
|
2762
|
+
ctrlKey: e.ctrlKey || e.metaKey,
|
|
2763
|
+
from: {
|
|
2764
|
+
rowIndex: i,
|
|
2765
|
+
columnIndex: a
|
|
2766
|
+
},
|
|
2767
|
+
rowCount: A.length,
|
|
2768
|
+
columnCount: z.length,
|
|
2769
|
+
pageRows: Math.max(1, Math.floor((k.current?.clientHeight ?? 0) / _) - 1)
|
|
2770
|
+
});
|
|
2771
|
+
o !== null && (e.preventDefault(), !(o.rowIndex === i && o.columnIndex === a) && Ue(o, { extend: e.shiftKey && J }));
|
|
2772
|
+
};
|
|
2773
|
+
i(() => {
|
|
2774
|
+
if (!q) return;
|
|
2775
|
+
let e = k.current;
|
|
2776
|
+
if (e === null) return;
|
|
2777
|
+
if (w !== Ce.current && (Ce.current = w, Y >= 0 && N.scrollToIndex(Y, { align: "auto" })), w === null) {
|
|
2778
|
+
Se.current = !1;
|
|
2779
|
+
return;
|
|
2780
|
+
}
|
|
2781
|
+
if (!Se.current && !e.contains(document.activeElement)) return;
|
|
2782
|
+
let t = Or(e, w);
|
|
2783
|
+
t !== null && (Se.current = !1, !t.contains(document.activeElement) && (t.focus({ preventScroll: !0 }), me(w.columnId).pinnedAt === !1 && kr({
|
|
2784
|
+
container: e,
|
|
2785
|
+
cellElement: t,
|
|
2786
|
+
leftPinnedWidth: fe,
|
|
2787
|
+
rightPinnedWidth: pe
|
|
2788
|
+
})));
|
|
2789
|
+
});
|
|
2790
|
+
let [Q, Ye] = s(null), Xe = () => Ye(null), Ze = o(null), Qe = o(null), $e = () => {
|
|
2791
|
+
let e = Ze.current, t = Qe.current;
|
|
2792
|
+
if (Ze.current = null, Qe.current = null, q && e !== null && t !== null) {
|
|
2793
|
+
let n = A.findIndex((t) => t.id === e), r = z.findIndex((e) => e.id === t);
|
|
2794
|
+
fr(X, n, r) || (m.actions.setFocusedCell({
|
|
2795
|
+
rowId: e,
|
|
2796
|
+
columnId: t
|
|
2797
|
+
}), je({
|
|
2798
|
+
rowId: e,
|
|
2799
|
+
columnId: t
|
|
2800
|
+
}, { extend: !1 }));
|
|
2801
|
+
}
|
|
2802
|
+
Ye(e === null ? null : {
|
|
1960
2803
|
rowId: e,
|
|
1961
2804
|
columnId: t
|
|
1962
2805
|
});
|
|
1963
|
-
},
|
|
1964
|
-
table:
|
|
1965
|
-
row:
|
|
1966
|
-
cell:
|
|
1967
|
-
close:
|
|
1968
|
-
}) ?? null : null,
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
2806
|
+
}, et = Q === null ? void 0 : A.find((e) => e.id === Q.rowId), tt = t && Q && et && !et.getIsGrouped() ? t({
|
|
2807
|
+
table: d,
|
|
2808
|
+
row: et,
|
|
2809
|
+
cell: et.getAllCells().find((e) => e.column.id === Q.columnId) ?? null,
|
|
2810
|
+
close: Xe
|
|
2811
|
+
}) ?? null : null, it = J && Q !== null && X !== null ? /* @__PURE__ */ W(H, { children: [
|
|
2812
|
+
/* @__PURE__ */ U(p.Label, { children: g.cellCount(Me) }),
|
|
2813
|
+
/* @__PURE__ */ U(p.Item, {
|
|
2814
|
+
disabled: Ne === 0,
|
|
2815
|
+
onClick: () => void Re(),
|
|
2816
|
+
children: g.copy
|
|
2817
|
+
}),
|
|
2818
|
+
/* @__PURE__ */ U(p.Item, {
|
|
2819
|
+
disabled: Ne === 0,
|
|
2820
|
+
onClick: () => He(Fe),
|
|
2821
|
+
children: g.exportCsv
|
|
2822
|
+
}),
|
|
2823
|
+
/* @__PURE__ */ U(p.Item, {
|
|
2824
|
+
closeMenuOnClick: !1,
|
|
2825
|
+
onClick: () => Ie((e) => !e),
|
|
2826
|
+
children: /* @__PURE__ */ U(u, {
|
|
2827
|
+
size: "xs",
|
|
2828
|
+
checked: Fe,
|
|
2829
|
+
label: g.includeHeaders,
|
|
2830
|
+
readOnly: !0,
|
|
2831
|
+
styles: { input: { cursor: "pointer" } }
|
|
2832
|
+
})
|
|
2833
|
+
})
|
|
2834
|
+
] }) : null, at = it === null && tt === null ? null : /* @__PURE__ */ W(H, { children: [
|
|
2835
|
+
it,
|
|
2836
|
+
it !== null && tt !== null && /* @__PURE__ */ U(p.Divider, {}),
|
|
2837
|
+
tt
|
|
2838
|
+
] }), ot = Q ? Xe : void 0;
|
|
2839
|
+
return /* @__PURE__ */ W("div", {
|
|
2840
|
+
className: Un.tableWrapper,
|
|
2841
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2842
|
+
ref: k,
|
|
2843
|
+
className: Un.scrollContainer,
|
|
2844
|
+
"data-dg-scroll-container": !0,
|
|
2845
|
+
onScroll: ot,
|
|
2846
|
+
children: /* @__PURE__ */ W("div", {
|
|
2847
|
+
role: q ? "grid" : "table",
|
|
2848
|
+
"aria-multiselectable": q && h.rowSelection && h.multiRowSelection ? !0 : void 0,
|
|
2849
|
+
onKeyDown: q ? Ke : void 0,
|
|
2850
|
+
"data-range-dragging": ze || void 0,
|
|
2851
|
+
className: Un.grid,
|
|
2852
|
+
"aria-rowcount": A.length + G.length + +!!_e,
|
|
2853
|
+
"aria-colcount": z.length,
|
|
1980
2854
|
style: {
|
|
1981
|
-
gridTemplateColumns:
|
|
1982
|
-
minWidth:
|
|
2855
|
+
gridTemplateColumns: ce,
|
|
2856
|
+
minWidth: le
|
|
1983
2857
|
},
|
|
1984
2858
|
children: [
|
|
1985
|
-
/* @__PURE__ */
|
|
2859
|
+
/* @__PURE__ */ U("div", {
|
|
1986
2860
|
role: "rowgroup",
|
|
1987
2861
|
style: { display: "contents" },
|
|
1988
|
-
children:
|
|
2862
|
+
children: G.map((e, t) => /* @__PURE__ */ U("div", {
|
|
1989
2863
|
role: "row",
|
|
1990
2864
|
"aria-rowindex": t + 1,
|
|
1991
|
-
className:
|
|
1992
|
-
children: e.headers.map((e) => /* @__PURE__ */
|
|
2865
|
+
className: Un.headerRow,
|
|
2866
|
+
children: e.headers.map((e) => /* @__PURE__ */ U(nr, {
|
|
1993
2867
|
header: e,
|
|
1994
|
-
layout:
|
|
2868
|
+
layout: me(e.column.id)
|
|
1995
2869
|
}, e.id))
|
|
1996
2870
|
}, e.id))
|
|
1997
2871
|
}),
|
|
1998
|
-
|
|
2872
|
+
F > 0 && /* @__PURE__ */ U("div", {
|
|
1999
2873
|
"aria-hidden": !0,
|
|
2000
2874
|
style: {
|
|
2001
2875
|
gridColumn: "1/-1",
|
|
2002
|
-
height:
|
|
2876
|
+
height: F
|
|
2003
2877
|
}
|
|
2004
2878
|
}),
|
|
2005
|
-
/* @__PURE__ */
|
|
2006
|
-
enabled: t !== void 0,
|
|
2007
|
-
menuContent:
|
|
2879
|
+
/* @__PURE__ */ U(Mr, {
|
|
2880
|
+
enabled: t !== void 0 || J,
|
|
2881
|
+
menuContent: at,
|
|
2008
2882
|
menuProps: r,
|
|
2009
|
-
onContextMenu:
|
|
2010
|
-
onClose:
|
|
2011
|
-
children:
|
|
2012
|
-
let n =
|
|
2883
|
+
onContextMenu: $e,
|
|
2884
|
+
onClose: Xe,
|
|
2885
|
+
children: P.map((e) => {
|
|
2886
|
+
let n = A[e.index];
|
|
2013
2887
|
if (!n) return null;
|
|
2014
|
-
let r = n.getIsGrouped(), i =
|
|
2015
|
-
return /* @__PURE__ */
|
|
2888
|
+
let r = n.getIsGrouped(), i = be(n), a = !r && !q && (ve || h.highlightRow);
|
|
2889
|
+
return /* @__PURE__ */ W("div", {
|
|
2016
2890
|
role: "row",
|
|
2017
|
-
"aria-rowindex": e.index +
|
|
2891
|
+
"aria-rowindex": e.index + G.length + 1,
|
|
2018
2892
|
"data-testid": `dg-row-${n.id}`,
|
|
2893
|
+
"data-index": y ? e.index : void 0,
|
|
2894
|
+
ref: y ? N.measureElement : void 0,
|
|
2019
2895
|
"data-grouped": r,
|
|
2020
2896
|
"data-depth": n.depth,
|
|
2021
|
-
"data-selected":
|
|
2022
|
-
"data-selected-bg":
|
|
2023
|
-
"data-highlighted":
|
|
2024
|
-
"data-context-menu":
|
|
2025
|
-
"data-selects-on-click":
|
|
2026
|
-
"aria-selected":
|
|
2027
|
-
"aria-current":
|
|
2028
|
-
className:
|
|
2897
|
+
"data-selected": h.rowSelection && n.getIsSelected(),
|
|
2898
|
+
"data-selected-bg": h.rowSelection && h.showSelectedBackground && n.getIsSelected(),
|
|
2899
|
+
"data-highlighted": h.highlightRow && n.id === C,
|
|
2900
|
+
"data-context-menu": at !== null && Q?.rowId === n.id,
|
|
2901
|
+
"data-selects-on-click": ve && !r,
|
|
2902
|
+
"aria-selected": h.rowSelection ? n.getIsSelected() : void 0,
|
|
2903
|
+
"aria-current": h.highlightRow && n.id === C ? !0 : void 0,
|
|
2904
|
+
className: Un.bodyRow,
|
|
2029
2905
|
style: {
|
|
2030
|
-
minHeight:
|
|
2906
|
+
minHeight: _,
|
|
2031
2907
|
cursor: i ? "pointer" : void 0
|
|
2032
2908
|
},
|
|
2033
2909
|
tabIndex: a ? 0 : void 0,
|
|
2034
|
-
onMouseDown:
|
|
2910
|
+
onMouseDown: ve && !r ? (e) => {
|
|
2035
2911
|
e.shiftKey && e.preventDefault();
|
|
2036
2912
|
} : void 0,
|
|
2037
|
-
onClick: i ? (e) =>
|
|
2913
|
+
onClick: i ? (e) => K(n, {
|
|
2038
2914
|
toggle: e.ctrlKey || e.metaKey,
|
|
2039
2915
|
extend: e.shiftKey
|
|
2040
2916
|
}) : void 0,
|
|
2041
2917
|
onKeyDown: a ? (e) => {
|
|
2042
|
-
e.key !== " " && e.key !== "Enter" || e.target === e.currentTarget && (e.preventDefault(),
|
|
2918
|
+
e.key !== " " && e.key !== "Enter" || e.target === e.currentTarget && (e.preventDefault(), K(n, {
|
|
2043
2919
|
toggle: !0,
|
|
2044
2920
|
extend: e.shiftKey
|
|
2045
2921
|
}));
|
|
2046
2922
|
} : void 0,
|
|
2047
|
-
onContextMenu: t && !r ? () => {
|
|
2048
|
-
|
|
2923
|
+
onContextMenu: t && !r || J ? () => {
|
|
2924
|
+
Ze.current = n.id;
|
|
2049
2925
|
} : void 0,
|
|
2050
|
-
children: [
|
|
2926
|
+
children: [[
|
|
2051
2927
|
...n.getLeftVisibleCells(),
|
|
2052
2928
|
...n.getCenterVisibleCells(),
|
|
2053
2929
|
...n.getRightVisibleCells()
|
|
2054
|
-
].map((
|
|
2055
|
-
cell:
|
|
2056
|
-
rowHeight:
|
|
2057
|
-
layout:
|
|
2058
|
-
|
|
2059
|
-
|
|
2930
|
+
].map((r, i) => /* @__PURE__ */ U(jr, {
|
|
2931
|
+
cell: r,
|
|
2932
|
+
rowHeight: _,
|
|
2933
|
+
layout: me(r.column.id),
|
|
2934
|
+
nav: q ? {
|
|
2935
|
+
rowId: n.id,
|
|
2936
|
+
columnIndex: i + 1,
|
|
2937
|
+
focused: Oe(w, n.id, r.column.id),
|
|
2938
|
+
tabIndex: Oe(De, n.id, r.column.id) ? 0 : -1,
|
|
2939
|
+
selected: J ? fr(ke, e.index, i) : Oe(w, n.id, r.column.id),
|
|
2940
|
+
edges: mr(ke, e.index, i)
|
|
2941
|
+
} : void 0,
|
|
2942
|
+
onFocus: q ? () => m.actions.setFocusedCell({
|
|
2943
|
+
rowId: n.id,
|
|
2944
|
+
columnId: r.column.id
|
|
2945
|
+
}) : void 0,
|
|
2946
|
+
onMouseDown: J ? (e) => {
|
|
2947
|
+
e.button === 0 && (e.shiftKey && e.preventDefault(), Se.current = !0, Ve({
|
|
2948
|
+
rowId: n.id,
|
|
2949
|
+
columnId: r.column.id
|
|
2950
|
+
}, { extend: e.shiftKey }));
|
|
2951
|
+
} : void 0,
|
|
2952
|
+
onMouseEnter: J && ze ? () => je({
|
|
2953
|
+
rowId: n.id,
|
|
2954
|
+
columnId: r.column.id
|
|
2955
|
+
}, { extend: !0 }) : void 0,
|
|
2956
|
+
onContextMenu: t || J ? () => {
|
|
2957
|
+
Qe.current = r.column.id;
|
|
2060
2958
|
} : void 0
|
|
2061
|
-
},
|
|
2959
|
+
}, r.id)), j(n) && /* @__PURE__ */ U("div", {
|
|
2960
|
+
role: "cell",
|
|
2961
|
+
"aria-colspan": z.length,
|
|
2962
|
+
"data-testid": `dg-details-${n.id}`,
|
|
2963
|
+
className: Un.detailsCell,
|
|
2964
|
+
onClick: (e) => e.stopPropagation(),
|
|
2965
|
+
onContextMenu: (e) => e.stopPropagation(),
|
|
2966
|
+
children: y?.({
|
|
2967
|
+
table: d,
|
|
2968
|
+
row: n
|
|
2969
|
+
})
|
|
2970
|
+
})]
|
|
2062
2971
|
}, e.key);
|
|
2063
2972
|
})
|
|
2064
2973
|
}),
|
|
2065
|
-
|
|
2974
|
+
he && D === !0 && /* @__PURE__ */ U("div", {
|
|
2066
2975
|
role: "row",
|
|
2067
|
-
className:
|
|
2068
|
-
children: /* @__PURE__ */
|
|
2976
|
+
className: Un.messageRow,
|
|
2977
|
+
children: /* @__PURE__ */ U(f, {
|
|
2978
|
+
size: "lg",
|
|
2979
|
+
"aria-label": g.loading
|
|
2980
|
+
})
|
|
2069
2981
|
}),
|
|
2070
|
-
|
|
2982
|
+
he && D !== !0 && /* @__PURE__ */ W("div", {
|
|
2071
2983
|
role: "row",
|
|
2072
|
-
className:
|
|
2073
|
-
children: [/* @__PURE__ */
|
|
2984
|
+
className: Un.messageRow,
|
|
2985
|
+
children: [/* @__PURE__ */ U(B, {
|
|
2074
2986
|
size: 40,
|
|
2075
2987
|
stroke: 1.4,
|
|
2076
2988
|
opacity: .4
|
|
2077
|
-
}), /* @__PURE__ */
|
|
2078
|
-
size:
|
|
2989
|
+
}), /* @__PURE__ */ U(b, {
|
|
2990
|
+
size: v,
|
|
2079
2991
|
c: "dimmed",
|
|
2080
|
-
children:
|
|
2992
|
+
children: O
|
|
2081
2993
|
})]
|
|
2082
2994
|
}),
|
|
2083
|
-
|
|
2995
|
+
I > 0 && /* @__PURE__ */ U("div", {
|
|
2084
2996
|
"aria-hidden": !0,
|
|
2085
2997
|
style: {
|
|
2086
2998
|
gridColumn: "1/-1",
|
|
2087
|
-
height:
|
|
2999
|
+
height: I
|
|
2088
3000
|
}
|
|
3001
|
+
}),
|
|
3002
|
+
_e && /* @__PURE__ */ U("div", {
|
|
3003
|
+
role: "row",
|
|
3004
|
+
"aria-rowindex": A.length + G.length + 1,
|
|
3005
|
+
"data-testid": "dg-summary-row",
|
|
3006
|
+
className: Un.summaryRow,
|
|
3007
|
+
children: ge.map((e) => {
|
|
3008
|
+
let t = me(e.column.id);
|
|
3009
|
+
return /* @__PURE__ */ U("div", {
|
|
3010
|
+
role: "cell",
|
|
3011
|
+
"data-column-id": e.column.id,
|
|
3012
|
+
"data-align": nt(e.column),
|
|
3013
|
+
"data-control-column": rt(e.column.id),
|
|
3014
|
+
className: [
|
|
3015
|
+
Un.summaryCell,
|
|
3016
|
+
t.isBoundary && t.pinnedAt === "left" ? Wn.stickyLeft : "",
|
|
3017
|
+
t.isBoundary && t.pinnedAt === "right" ? Wn.stickyRight : ""
|
|
3018
|
+
].filter(Boolean).join(" "),
|
|
3019
|
+
style: {
|
|
3020
|
+
minHeight: _,
|
|
3021
|
+
left: t.pinnedAt === "left" ? t.offset : void 0,
|
|
3022
|
+
right: t.pinnedAt === "right" ? t.offset : void 0,
|
|
3023
|
+
position: t.pinnedAt ? "sticky" : void 0,
|
|
3024
|
+
zIndex: t.pinnedAt ? "var(--dg-z-summary-pinned-cell, 5)" : void 0
|
|
3025
|
+
},
|
|
3026
|
+
children: /* @__PURE__ */ U("span", {
|
|
3027
|
+
className: Un.cellContent,
|
|
3028
|
+
children: e.isPlaceholder ? null : xe(e.column.columnDef.footer, e.getContext())
|
|
3029
|
+
})
|
|
3030
|
+
}, e.id);
|
|
3031
|
+
})
|
|
2089
3032
|
})
|
|
2090
3033
|
]
|
|
2091
3034
|
})
|
|
2092
|
-
}), /* @__PURE__ */
|
|
3035
|
+
}), /* @__PURE__ */ U(Gt, {})]
|
|
2093
3036
|
});
|
|
2094
3037
|
}
|
|
2095
|
-
var
|
|
3038
|
+
var Pr = {
|
|
2096
3039
|
toolbar: "_toolbar_4my8t_1",
|
|
2097
3040
|
toolbarSpacer: "_toolbarSpacer_4my8t_10"
|
|
2098
3041
|
};
|
|
2099
3042
|
//#endregion
|
|
2100
3043
|
//#region src/tmdatagrid/components/TMDataGridToolbar.tsx
|
|
2101
|
-
function
|
|
3044
|
+
function Fr(t) {
|
|
2102
3045
|
let n = e(2), { children: r } = t, i;
|
|
2103
|
-
return n[0] === r ? i = n[1] : (i = /* @__PURE__ */
|
|
2104
|
-
className:
|
|
3046
|
+
return n[0] === r ? i = n[1] : (i = /* @__PURE__ */ U("div", {
|
|
3047
|
+
className: Pr.toolbar,
|
|
2105
3048
|
children: r
|
|
2106
3049
|
}), n[0] = r, n[1] = i), i;
|
|
2107
3050
|
}
|
|
2108
|
-
function
|
|
3051
|
+
function Ir() {
|
|
2109
3052
|
let t = e(1), n;
|
|
2110
|
-
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */
|
|
3053
|
+
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ U("div", { className: Pr.toolbarSpacer }), t[0] = n) : n = t[0], n;
|
|
2111
3054
|
}
|
|
2112
|
-
function
|
|
2113
|
-
let
|
|
2114
|
-
if (
|
|
3055
|
+
function Lr() {
|
|
3056
|
+
let t = e(2), { table: n, labels: r } = Z();
|
|
3057
|
+
if (n.options.meta?.loading !== !0) return null;
|
|
3058
|
+
let i;
|
|
3059
|
+
return t[0] === r.loading ? i = t[1] : (i = /* @__PURE__ */ U(f, {
|
|
3060
|
+
size: "xs",
|
|
3061
|
+
"aria-label": r.loading
|
|
3062
|
+
}), t[0] = r.loading, t[1] = i), i;
|
|
3063
|
+
}
|
|
3064
|
+
function Rr(t) {
|
|
3065
|
+
let n = e(11), { children: r } = t, { table: i, controlSize: a } = Z();
|
|
3066
|
+
if (T(i.store), r !== void 0) {
|
|
2115
3067
|
let e;
|
|
2116
|
-
return n[0] !== r || n[1] !== a ? (e = /* @__PURE__ */
|
|
3068
|
+
return n[0] !== r || n[1] !== a ? (e = /* @__PURE__ */ U(b, {
|
|
2117
3069
|
size: a,
|
|
2118
3070
|
c: "dimmed",
|
|
2119
3071
|
children: r
|
|
@@ -2124,7 +3076,7 @@ function zn(t) {
|
|
|
2124
3076
|
let s = o, c;
|
|
2125
3077
|
n[5] === i ? c = n[6] : (c = i.options.meta?.totalRowCount ?? i.getPreFilteredRowModel().rows.length, n[5] = i, n[6] = c);
|
|
2126
3078
|
let l = c, u;
|
|
2127
|
-
return n[7] !== a || n[8] !== s || n[9] !== l ? (u = /* @__PURE__ */
|
|
3079
|
+
return n[7] !== a || n[8] !== s || n[9] !== l ? (u = /* @__PURE__ */ W(b, {
|
|
2128
3080
|
size: a,
|
|
2129
3081
|
c: "dimmed",
|
|
2130
3082
|
children: [
|
|
@@ -2134,100 +3086,104 @@ function zn(t) {
|
|
|
2134
3086
|
]
|
|
2135
3087
|
}), n[7] = a, n[8] = s, n[9] = l, n[10] = u) : u = n[10], u;
|
|
2136
3088
|
}
|
|
2137
|
-
function
|
|
2138
|
-
let t = e(
|
|
2139
|
-
if (!
|
|
2140
|
-
let
|
|
2141
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
3089
|
+
function zr() {
|
|
3090
|
+
let t = e(13), { table: n, ui: r, features: i, labels: a, controlSize: o } = Z(), s = T(r, Br);
|
|
3091
|
+
if (!Sn(n, i).canHideAny) return null;
|
|
3092
|
+
let l;
|
|
3093
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ U(z, {
|
|
2142
3094
|
size: 18,
|
|
2143
3095
|
stroke: 1.6
|
|
2144
|
-
}), t[0] =
|
|
2145
|
-
let l;
|
|
2146
|
-
t[1] !== a || t[2] !== r.actions.toggleColumnsPanel ? (l = /* @__PURE__ */ G(m.Target, { children: /* @__PURE__ */ G(b, {
|
|
2147
|
-
label: "Manage columns",
|
|
2148
|
-
openDelay: 400,
|
|
2149
|
-
children: /* @__PURE__ */ G(s, {
|
|
2150
|
-
variant: "subtle",
|
|
2151
|
-
color: "gray",
|
|
2152
|
-
size: a,
|
|
2153
|
-
"aria-label": "Manage columns",
|
|
2154
|
-
onClick: r.actions.toggleColumnsPanel,
|
|
2155
|
-
children: c
|
|
2156
|
-
})
|
|
2157
|
-
}) }), t[1] = a, t[2] = r.actions.toggleColumnsPanel, t[3] = l) : l = t[3];
|
|
3096
|
+
}), t[0] = l) : l = t[0];
|
|
2158
3097
|
let u;
|
|
2159
|
-
t[
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
3098
|
+
t[1] !== o || t[2] !== a.manageColumns || t[3] !== r.actions.toggleColumnsPanel ? (u = /* @__PURE__ */ U(c, {
|
|
3099
|
+
variant: "subtle",
|
|
3100
|
+
color: "gray",
|
|
3101
|
+
size: o,
|
|
3102
|
+
"aria-label": a.manageColumns,
|
|
3103
|
+
onClick: r.actions.toggleColumnsPanel,
|
|
3104
|
+
children: l
|
|
3105
|
+
}), t[1] = o, t[2] = a.manageColumns, t[3] = r.actions.toggleColumnsPanel, t[4] = u) : u = t[4];
|
|
2163
3106
|
let d;
|
|
2164
|
-
|
|
2165
|
-
|
|
3107
|
+
t[5] !== a.manageColumns || t[6] !== u ? (d = /* @__PURE__ */ U(g.Target, { children: /* @__PURE__ */ U(S, {
|
|
3108
|
+
label: a.manageColumns,
|
|
3109
|
+
openDelay: 400,
|
|
3110
|
+
children: u
|
|
3111
|
+
}) }), t[5] = a.manageColumns, t[6] = u, t[7] = d) : d = t[7];
|
|
3112
|
+
let f;
|
|
3113
|
+
t[8] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ U(g.Dropdown, {
|
|
3114
|
+
p: 0,
|
|
3115
|
+
children: /* @__PURE__ */ U(mt, {})
|
|
3116
|
+
}), t[8] = f) : f = t[8];
|
|
3117
|
+
let p;
|
|
3118
|
+
return t[9] !== s || t[10] !== d || t[11] !== r.actions.setColumnsPanelOpen ? (p = /* @__PURE__ */ W(g, {
|
|
3119
|
+
opened: s,
|
|
2166
3120
|
onChange: r.actions.setColumnsPanelOpen,
|
|
2167
3121
|
position: "bottom-end",
|
|
2168
3122
|
shadow: "md",
|
|
2169
3123
|
radius: "md",
|
|
2170
3124
|
withinPortal: !0,
|
|
2171
3125
|
trapFocus: !0,
|
|
2172
|
-
children: [
|
|
2173
|
-
}), t[
|
|
3126
|
+
children: [d, f]
|
|
3127
|
+
}), t[9] = s, t[10] = d, t[11] = r.actions.setColumnsPanelOpen, t[12] = p) : p = t[12], p;
|
|
2174
3128
|
}
|
|
2175
|
-
function
|
|
3129
|
+
function Br(e) {
|
|
2176
3130
|
return e.columnsPanelOpen;
|
|
2177
3131
|
}
|
|
2178
|
-
function
|
|
2179
|
-
let t = e(
|
|
2180
|
-
if (!
|
|
2181
|
-
let
|
|
2182
|
-
t[0] !== n || t[1] !==
|
|
2183
|
-
if (
|
|
3132
|
+
function Vr() {
|
|
3133
|
+
let t = e(15), n = Z(), { table: r, ui: i, features: a, labels: o, controlSize: s } = n, l = T(i, Gr), u = T(r.store, Wr).filter(Ur).length;
|
|
3134
|
+
if (!Sn(r, a).canFilterAny) return null;
|
|
3135
|
+
let d = l || u > 0 ? "light" : "subtle", f = u > 0 ? void 0 : "gray", p;
|
|
3136
|
+
t[0] !== n || t[1] !== l || t[2] !== r || t[3] !== i ? (p = () => {
|
|
3137
|
+
if (l) {
|
|
2184
3138
|
i.actions.closeFilterPanel();
|
|
2185
3139
|
return;
|
|
2186
3140
|
}
|
|
2187
|
-
let e = r.getAllLeafColumns().find(
|
|
2188
|
-
e ?
|
|
2189
|
-
}, t[0] = n, t[1] =
|
|
2190
|
-
let
|
|
2191
|
-
t[5] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
3141
|
+
let e = r.getAllLeafColumns().find(Hr);
|
|
3142
|
+
e ? Nn(n, e.id) : i.actions.openFilterPanel();
|
|
3143
|
+
}, t[0] = n, t[1] = l, t[2] = r, t[3] = i, t[4] = p) : p = t[4];
|
|
3144
|
+
let m;
|
|
3145
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ U(te, {
|
|
2192
3146
|
size: 16,
|
|
2193
3147
|
stroke: 1.6
|
|
2194
|
-
}), t[5] =
|
|
2195
|
-
let
|
|
2196
|
-
|
|
2197
|
-
|
|
3148
|
+
}), t[5] = m) : m = t[5];
|
|
3149
|
+
let h;
|
|
3150
|
+
t[6] !== s || t[7] !== o.filters || t[8] !== d || t[9] !== f || t[10] !== p ? (h = /* @__PURE__ */ U(c, {
|
|
3151
|
+
variant: d,
|
|
3152
|
+
color: f,
|
|
3153
|
+
size: s,
|
|
3154
|
+
"aria-label": o.filters,
|
|
3155
|
+
"data-dg-filter-toggle": !0,
|
|
3156
|
+
onClick: p,
|
|
3157
|
+
children: m
|
|
3158
|
+
}), t[6] = s, t[7] = o.filters, t[8] = d, t[9] = f, t[10] = p, t[11] = h) : h = t[11];
|
|
3159
|
+
let g;
|
|
3160
|
+
return t[12] !== o.filters || t[13] !== h ? (g = /* @__PURE__ */ U(S, {
|
|
3161
|
+
label: o.filters,
|
|
2198
3162
|
openDelay: 400,
|
|
2199
|
-
children:
|
|
2200
|
-
|
|
2201
|
-
color: d,
|
|
2202
|
-
size: o,
|
|
2203
|
-
"aria-label": "Filters",
|
|
2204
|
-
"data-dg-filter-toggle": !0,
|
|
2205
|
-
onClick: f,
|
|
2206
|
-
children: p
|
|
2207
|
-
})
|
|
2208
|
-
}), t[6] = o, t[7] = u, t[8] = d, t[9] = f, t[10] = m) : m = t[10], m;
|
|
3163
|
+
children: h
|
|
3164
|
+
}), t[12] = o.filters, t[13] = h, t[14] = g) : g = t[14], g;
|
|
2209
3165
|
}
|
|
2210
|
-
function
|
|
3166
|
+
function Hr(e) {
|
|
2211
3167
|
return e.getCanFilter();
|
|
2212
3168
|
}
|
|
2213
|
-
function
|
|
2214
|
-
return
|
|
3169
|
+
function Ur(e) {
|
|
3170
|
+
return Lt(e.value);
|
|
2215
3171
|
}
|
|
2216
|
-
function
|
|
3172
|
+
function Wr(e) {
|
|
2217
3173
|
return e.columnFilters;
|
|
2218
3174
|
}
|
|
2219
|
-
function
|
|
3175
|
+
function Gr(e) {
|
|
2220
3176
|
return e.filterPanelOpen;
|
|
2221
3177
|
}
|
|
2222
3178
|
//#endregion
|
|
2223
3179
|
//#region src/tmdatagrid/core/sizes.ts
|
|
2224
|
-
var
|
|
3180
|
+
var Kr = "md", qr = {
|
|
2225
3181
|
xs: 34,
|
|
2226
3182
|
sm: 42,
|
|
2227
3183
|
md: 52,
|
|
2228
3184
|
lg: 62,
|
|
2229
3185
|
xl: 72
|
|
2230
|
-
},
|
|
3186
|
+
}, Jr = {
|
|
2231
3187
|
xs: "xs",
|
|
2232
3188
|
sm: "xs",
|
|
2233
3189
|
md: "sm",
|
|
@@ -2236,44 +3192,139 @@ var qn = "md", Jn = {
|
|
|
2236
3192
|
};
|
|
2237
3193
|
//#endregion
|
|
2238
3194
|
//#region src/tmdatagrid/components/TMDataGrid.tsx
|
|
2239
|
-
function
|
|
2240
|
-
let n = e(
|
|
2241
|
-
n[0] !== a || n[1] !==
|
|
3195
|
+
function Yr(t) {
|
|
3196
|
+
let n = e(21), { table: r, ui: i, features: a, labels: o, renderDetails: s, renderDetailsEstHeight: c, overscan: l, size: u, children: d, className: f, style: p } = t, m = u === void 0 ? "md" : u, h = r.options.meta?.rowHeight ?? qr[m], g = Jr[m], _;
|
|
3197
|
+
n[0] !== a || n[1] !== o || n[2] !== l || n[3] !== s || n[4] !== c || n[5] !== h || n[6] !== m || n[7] !== g || n[8] !== r || n[9] !== i ? (_ = {
|
|
2242
3198
|
table: r,
|
|
2243
3199
|
ui: i,
|
|
2244
3200
|
features: a,
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
n[
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
3201
|
+
labels: o,
|
|
3202
|
+
renderDetails: s,
|
|
3203
|
+
renderDetailsEstHeight: c,
|
|
3204
|
+
overscan: l,
|
|
3205
|
+
size: m,
|
|
3206
|
+
rowHeight: h,
|
|
3207
|
+
controlSize: g
|
|
3208
|
+
}, n[0] = a, n[1] = o, n[2] = l, n[3] = s, n[4] = c, n[5] = h, n[6] = m, n[7] = g, n[8] = r, n[9] = i, n[10] = _) : _ = n[10];
|
|
3209
|
+
let v = _, y;
|
|
3210
|
+
n[11] === f ? y = n[12] : (y = [je.root, f].filter(Boolean), n[11] = f, n[12] = y);
|
|
3211
|
+
let b = y.join(" "), x;
|
|
3212
|
+
n[13] !== d || n[14] !== m || n[15] !== p || n[16] !== b ? (x = /* @__PURE__ */ U("div", {
|
|
3213
|
+
"data-size": m,
|
|
3214
|
+
className: b,
|
|
3215
|
+
style: p,
|
|
3216
|
+
children: d
|
|
3217
|
+
}), n[13] = d, n[14] = m, n[15] = p, n[16] = b, n[17] = x) : x = n[17];
|
|
3218
|
+
let S;
|
|
3219
|
+
return n[18] !== v || n[19] !== x ? (S = /* @__PURE__ */ U(Ne, {
|
|
3220
|
+
value: v,
|
|
3221
|
+
children: x
|
|
3222
|
+
}), n[18] = v, n[19] = x, n[20] = S) : S = n[20], S;
|
|
3223
|
+
}
|
|
3224
|
+
var Xr = Object.assign(Yr, {
|
|
3225
|
+
Toolbar: Fr,
|
|
3226
|
+
Spacer: Ir,
|
|
3227
|
+
SummaryCount: Rr,
|
|
3228
|
+
LoadingIndicator: Lr,
|
|
3229
|
+
Search: Vn,
|
|
3230
|
+
ColumnsButton: zr,
|
|
3231
|
+
FilterButton: Vr,
|
|
3232
|
+
Table: Nr,
|
|
3233
|
+
Footer: zn,
|
|
3234
|
+
FilterPanel: Gt,
|
|
3235
|
+
FilterPills: Pn,
|
|
3236
|
+
ColumnsPanel: mt
|
|
3237
|
+
}), Zr = {
|
|
3238
|
+
operators: {
|
|
3239
|
+
contains: "innehåller",
|
|
3240
|
+
equals: "är lika med",
|
|
3241
|
+
notEquals: "är inte lika med",
|
|
3242
|
+
startsWith: "börjar med",
|
|
3243
|
+
endsWith: "slutar med",
|
|
3244
|
+
greaterThan: "är större än",
|
|
3245
|
+
greaterThanOrEqual: "är större än eller lika med",
|
|
3246
|
+
lessThan: "är mindre än",
|
|
3247
|
+
lessThanOrEqual: "är mindre än eller lika med",
|
|
3248
|
+
before: "är före",
|
|
3249
|
+
after: "är efter",
|
|
3250
|
+
onOrBefore: "är på eller före",
|
|
3251
|
+
onOrAfter: "är på eller efter",
|
|
3252
|
+
isAnyOf: "är någon av",
|
|
3253
|
+
isNoneOf: "är ingen av",
|
|
3254
|
+
isEmpty: "är tom",
|
|
3255
|
+
isNotEmpty: "är inte tom"
|
|
3256
|
+
},
|
|
3257
|
+
manageColumns: "Hantera kolumner",
|
|
3258
|
+
filters: "Filter",
|
|
3259
|
+
searchPlaceholder: "Sök",
|
|
3260
|
+
searchLabel: "Sök rader",
|
|
3261
|
+
clearSearch: "Rensa sökningen",
|
|
3262
|
+
columnsSearchPlaceholder: "Sök",
|
|
3263
|
+
columnsNoMatch: (e) => `Inga kolumner matchar ”${e}”`,
|
|
3264
|
+
columnsShowHideAll: "Visa/dölj alla",
|
|
3265
|
+
columnsReset: "ÅTERSTÄLL",
|
|
3266
|
+
filterColumn: "Kolumn",
|
|
3267
|
+
filterOperator: "Operator",
|
|
3268
|
+
filterValue: "Värde",
|
|
3269
|
+
filterValuePlaceholder: "Filtervärde",
|
|
3270
|
+
booleanTrue: "Ja",
|
|
3271
|
+
booleanFalse: "Nej",
|
|
3272
|
+
addFilter: "Lägg till filter",
|
|
3273
|
+
clearAllFilters: "Rensa alla",
|
|
3274
|
+
closeFilters: "Stäng filter",
|
|
3275
|
+
removeFilter: "Ta bort filter",
|
|
3276
|
+
activeFilters: "Aktiva filter",
|
|
3277
|
+
clearFilter: (e) => `Rensa filtret för ${e}`,
|
|
3278
|
+
sortAsc: "Sortera stigande",
|
|
3279
|
+
sortDesc: "Sortera fallande",
|
|
3280
|
+
filterMenuItem: "Filtrera",
|
|
3281
|
+
groupBy: (e) => `Gruppera på ${e}`,
|
|
3282
|
+
ungroup: (e) => `Avgruppera ${e}`,
|
|
3283
|
+
expandAllGroups: "Expandera alla grupper",
|
|
3284
|
+
collapseAllGroups: "Fäll ihop alla grupper",
|
|
3285
|
+
pinLeft: "Fäst till vänster",
|
|
3286
|
+
pinRight: "Fäst till höger",
|
|
3287
|
+
unpin: "Lossa",
|
|
3288
|
+
moveLeft: "Flytta åt vänster",
|
|
3289
|
+
moveRight: "Flytta åt höger",
|
|
3290
|
+
autosizeColumn: "Anpassa kolumnbredd",
|
|
3291
|
+
hideColumn: "Dölj kolumn",
|
|
3292
|
+
filterOn: (e) => `Filtrera på ${e}`,
|
|
3293
|
+
sortColumn: (e) => `Sortera ${e}`,
|
|
3294
|
+
columnMenu: (e) => `Kolumnmeny för ${e}`,
|
|
3295
|
+
rowsPerPage: "Rader per sida:",
|
|
3296
|
+
pageRange: ({ from: e, to: t, total: n }) => `${e}–${t} av ${n}`,
|
|
3297
|
+
groupedAllRows: (e) => `Grupperad · alla ${e} rader`,
|
|
3298
|
+
pagingSuspendedHint: "Sidindelningen är avstängd medan raderna är grupperade: hela trädet renderas och virtualiseras. Avgruppera för att bläddra igen.",
|
|
3299
|
+
previousPage: "Föregående sida",
|
|
3300
|
+
nextPage: "Nästa sida",
|
|
3301
|
+
noResults: "Inga rader matchar dina filter",
|
|
3302
|
+
loading: "Laddar",
|
|
3303
|
+
cellCount: (e) => e === 1 ? "1 cell" : `${e} celler`,
|
|
3304
|
+
copy: "Kopiera",
|
|
3305
|
+
exportCsv: "Exportera som CSV för Excel",
|
|
3306
|
+
includeHeaders: "Inkludera rubriker",
|
|
3307
|
+
selectColumnLabel: "Kryssrutemarkering",
|
|
3308
|
+
selectAllRows: "Markera alla rader",
|
|
3309
|
+
selectRow: "Markera rad",
|
|
3310
|
+
selectGroup: "Markera grupp",
|
|
3311
|
+
detailsColumnLabel: "Detaljer",
|
|
3312
|
+
showDetails: "Visa detaljer",
|
|
3313
|
+
hideDetails: "Dölj detaljer",
|
|
3314
|
+
expandAllDetails: "Expandera alla detaljer",
|
|
3315
|
+
collapseAllDetails: "Fäll ihop alla detaljer",
|
|
3316
|
+
groupColumnLabel: "Grupp",
|
|
3317
|
+
blankGroupValue: "(Tom)",
|
|
3318
|
+
expandGroup: (e) => `Expandera ${e}`,
|
|
3319
|
+
collapseGroup: (e) => `Fäll ihop ${e}`
|
|
3320
|
+
};
|
|
3321
|
+
//#endregion
|
|
3322
|
+
//#region src/tmdatagrid/core/summary.ts
|
|
3323
|
+
function Qr({ table: e, columnId: t, fn: n = "sum" }) {
|
|
3324
|
+
let r = e.getFilteredRowModel().rows;
|
|
3325
|
+
return G[n](t, r, r);
|
|
3326
|
+
}
|
|
2276
3327
|
//#endregion
|
|
2277
|
-
export {
|
|
3328
|
+
export { $t as DATA_STATE_SLICES, gr as DEFAULT_CELL_EXPORT_OPTIONS, Kr as DEFAULT_TMDATAGRID_SIZE, Be as DETAILS_COLUMN_ID, St as FILTER_OPERATOR_LABELS, ot as GROUP_COLUMN_ID, Q as SELECT_COLUMN_ID, en as SETTINGS_STATE_SLICES, Jr as SIZE_CONTROL_SIZE, qr as SIZE_ROW_HEIGHT, Zt as TMDATAGRID_LABELS_EN, Zr as TMDATAGRID_LABELS_SV, Xr as TMDataGrid, Pn as TMDataGridFilterPills, Vn as TMDataGridSearch, Qr as aggregateColumn, Re as areAllRowsExpanded, Yn as autosizeColumn, pr as boundsCellCount, mr as boundsEdges, vr as buildCellMatrix, yr as buildGridCellMatrix, On as createTMDataGridColumnHelper, Tr as downloadTextFile, br as exportGridToCsv, _r as formatExportValue, Rt as formatFilterLabel, lt as formatGroupValue, xn as getColumnCapabilities, et as getColumnLabel, Xn as getColumnRegion, tt as getColumnType, Nt as getDefaultOperator, Ge as getDisplayedRows, Sn as getGridCapabilities, We as getGroupDataRows, Mt as getOperatorsForType, qe as getSelectableRowIds, er as getStepTargetColumn, Rn as getTMDataGridPaginationApi, it as isColumnReorderable, rt as isControlColumn, Lt as isFilterActive, Ke as isPagingActive, Tn as isSameCell, fr as isWithinBounds, Jn as measureColumnContentWidth, Qt as mergeLabels, Qn as moveColumn, tr as moveColumnByStep, Nn as openColumnFilter, Pt as operatorNeedsValue, Ft as operatorTakesArrayValue, xt as optionsToComboboxData, bn as readFeatureFlags, wn as resolveCellMove, bt as resolveColumnOptions, ze as resolveExpandAll, dr as resolveRangeBounds, Je as resolveRowSelectionClick, Dn as tmDataGridFeatures, Sr as toClipboardText, Cr as toExcelCsv, Pe as useCellControlTabIndex, Mn as useTMDataGrid, Z as useTMDataGridContext, wr as writeClipboardText };
|
|
2278
3329
|
|
|
2279
3330
|
//# sourceMappingURL=index.js.map
|