@jielga/tmdatagrid 0.1.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/LICENSE +21 -0
- package/README.md +162 -0
- package/dist/index.d.ts +592 -0
- package/dist/index.js +1590 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +2 -0
- package/package.json +111 -0
- package/skills/columns/SKILL.md +195 -0
- package/skills/features/SKILL.md +214 -0
- package/skills/getting-started/SKILL.md +209 -0
- package/skills/options/SKILL.md +208 -0
- package/skills/server-side/SKILL.md +150 -0
- package/src/tmdatagrid/TMDataGrid.module.css +410 -0
- package/src/tmdatagrid/TMDataGrid.tsx +101 -0
- package/src/tmdatagrid/TMDataGridColumnsPanel.tsx +91 -0
- package/src/tmdatagrid/TMDataGridContext.ts +32 -0
- package/src/tmdatagrid/TMDataGridFilterPanel.tsx +182 -0
- package/src/tmdatagrid/TMDataGridFooter.tsx +74 -0
- package/src/tmdatagrid/TMDataGridHeaderCell.tsx +466 -0
- package/src/tmdatagrid/TMDataGridTable.tsx +297 -0
- package/src/tmdatagrid/TMDataGridToolbar.tsx +131 -0
- package/src/tmdatagrid/capabilities.ts +117 -0
- package/src/tmdatagrid/columnOrdering.ts +140 -0
- package/src/tmdatagrid/columnUtils.ts +43 -0
- package/src/tmdatagrid/filterOperators.ts +171 -0
- package/src/tmdatagrid/icons.ts +25 -0
- package/src/tmdatagrid/index.ts +68 -0
- package/src/tmdatagrid/persistence.ts +187 -0
- package/src/tmdatagrid/sizes.ts +29 -0
- package/src/tmdatagrid/useTMDataGrid.tsx +378 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1590 @@
|
|
|
1
|
+
import { c as e } from "react/compiler-runtime";
|
|
2
|
+
import { createContext as t, useCallback as n, useContext as r, useEffect as i, useRef as a, useState as o } from "react";
|
|
3
|
+
import { ActionIcon as s, Button as c, Checkbox as l, Group as u, Loader as d, Menu as f, Popover as p, ScrollArea as m, Select as h, Stack as g, Text as _, TextInput as v, Tooltip as y } from "@mantine/core";
|
|
4
|
+
import { useCreateStore as b, useSelector as x } from "@tanstack/react-store";
|
|
5
|
+
import { IconArrowBarToLeft as S, IconArrowBarToRight as C, IconArrowDown as w, IconArrowLeft as T, IconArrowRight as E, IconArrowUp as D, IconChevronLeft as O, IconChevronRight as k, IconColumns3 as A, IconDotsVertical as j, IconEyeOff as M, IconFilter as N, IconMenu2 as ee, IconPinnedOff as te, IconSearch as P, IconX as F } from "@tabler/icons-react";
|
|
6
|
+
import { jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
7
|
+
import { columnFacetingFeature as R, columnFilteringFeature as z, columnOrderingFeature as B, columnPinningFeature as ne, columnResizingFeature as re, columnSizingFeature as ie, columnVisibilityFeature as ae, createColumnHelper as oe, createFacetedMinMaxValues as se, createFacetedRowModel as ce, createFacetedUniqueValues as le, createFilteredRowModel as V, createPaginatedRowModel as ue, createSortedRowModel as de, filterFns as H, flexRender as fe, globalFilteringFeature as pe, metaHelper as me, rowPaginationFeature as he, rowSelectionFeature as U, rowSortingFeature as W, sortFns as ge, tableFeatures as _e, useTable as ve } from "@tanstack/react-table";
|
|
8
|
+
import { useVirtualizer as ye } from "@tanstack/react-virtual";
|
|
9
|
+
import { shallow as be } from "@tanstack/store";
|
|
10
|
+
var G = {
|
|
11
|
+
root: "_root_pt0ni_3",
|
|
12
|
+
toolbar: "_toolbar_pt0ni_57",
|
|
13
|
+
toolbarSpacer: "_toolbarSpacer_pt0ni_66",
|
|
14
|
+
tableWrapper: "_tableWrapper_pt0ni_71",
|
|
15
|
+
scrollContainer: "_scrollContainer_pt0ni_79",
|
|
16
|
+
grid: "_grid_pt0ni_87",
|
|
17
|
+
headerRow: "_headerRow_pt0ni_93",
|
|
18
|
+
headerCell: "_headerCell_pt0ni_102",
|
|
19
|
+
headerTitle: "_headerTitle_pt0ni_126",
|
|
20
|
+
headerActions: "_headerActions_pt0ni_149",
|
|
21
|
+
headerAction: "_headerAction_pt0ni_149",
|
|
22
|
+
headerCellSortable: "_headerCellSortable_pt0ni_178",
|
|
23
|
+
headerCellDragging: "_headerCellDragging_pt0ni_185",
|
|
24
|
+
headerCellDropBefore: "_headerCellDropBefore_pt0ni_189",
|
|
25
|
+
headerCellDropAfter: "_headerCellDropAfter_pt0ni_190",
|
|
26
|
+
columnSeparator: "_columnSeparator_pt0ni_210",
|
|
27
|
+
columnSeparatorResizable: "_columnSeparatorResizable_pt0ni_222",
|
|
28
|
+
columnSeparatorActive: "_columnSeparatorActive_pt0ni_245",
|
|
29
|
+
bodyRow: "_bodyRow_pt0ni_250",
|
|
30
|
+
bodyCell: "_bodyCell_pt0ni_268",
|
|
31
|
+
cellContent: "_cellContent_pt0ni_266",
|
|
32
|
+
stickyLeft: "_stickyLeft_pt0ni_305",
|
|
33
|
+
stickyRight: "_stickyRight_pt0ni_309",
|
|
34
|
+
messageRow: "_messageRow_pt0ni_341",
|
|
35
|
+
footer: "_footer_pt0ni_351",
|
|
36
|
+
filterPanel: "_filterPanel_pt0ni_362",
|
|
37
|
+
filterRow: "_filterRow_pt0ni_374",
|
|
38
|
+
menuItemActive: "_menuItemActive_pt0ni_381",
|
|
39
|
+
columnsPanel: "_columnsPanel_pt0ni_386",
|
|
40
|
+
columnsPanelSearch: "_columnsPanelSearch_pt0ni_392",
|
|
41
|
+
columnsPanelList: "_columnsPanelList_pt0ni_396",
|
|
42
|
+
columnsPanelFooter: "_columnsPanelFooter_pt0ni_403"
|
|
43
|
+
}, K = t(null), xe = K.Provider;
|
|
44
|
+
function q() {
|
|
45
|
+
let e = r(K);
|
|
46
|
+
if (!e) throw Error("TMDataGrid compound components must be rendered inside <TMDataGrid>");
|
|
47
|
+
return e;
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/tmdatagrid/columnUtils.ts
|
|
51
|
+
function Se(e) {
|
|
52
|
+
let t = e.columnDef.meta?.label;
|
|
53
|
+
if (t) return t;
|
|
54
|
+
let n = e.columnDef.header;
|
|
55
|
+
return typeof n == "string" ? n : e.id;
|
|
56
|
+
}
|
|
57
|
+
function Ce(e) {
|
|
58
|
+
return e.columnDef.meta?.type ?? "string";
|
|
59
|
+
}
|
|
60
|
+
function we(e) {
|
|
61
|
+
return e.columnDef.meta?.align ?? "left";
|
|
62
|
+
}
|
|
63
|
+
function Te(e) {
|
|
64
|
+
return e.columnDef.meta?.enableOrdering === !1 ? !1 : e.parent === void 0;
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/tmdatagrid/TMDataGridColumnsPanel.tsx
|
|
68
|
+
function Ee() {
|
|
69
|
+
let t = e(54), { table: n, controlSize: r } = q(), [i, a] = o(""), s = x(n.store, Oe), u, d, f, p, h, g, y, b, S, C;
|
|
70
|
+
if (t[0] !== s || t[1] !== r || t[2] !== i || t[3] !== n) {
|
|
71
|
+
let e = n.getAllLeafColumns(), o = i.trim().toLowerCase();
|
|
72
|
+
C = o ? e.filter((e) => Se(e).toLowerCase().includes(o)) : e, d = e.filter(De);
|
|
73
|
+
let c;
|
|
74
|
+
t[14] === s ? c = t[15] : (c = (e) => s[e.id] !== !1, t[14] = s, t[15] = c), f = d.filter(c).length, b = G.columnsPanel;
|
|
75
|
+
let _;
|
|
76
|
+
t[16] === Symbol.for("react.memo_cache_sentinel") ? (_ = (e) => a(e.currentTarget.value), t[16] = _) : _ = t[16];
|
|
77
|
+
let x;
|
|
78
|
+
t[17] === Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ I(P, {
|
|
79
|
+
size: 16,
|
|
80
|
+
stroke: 1.6
|
|
81
|
+
}), t[17] = x) : x = t[17], t[18] !== r || t[19] !== i ? (S = /* @__PURE__ */ I("div", {
|
|
82
|
+
className: G.columnsPanelSearch,
|
|
83
|
+
children: /* @__PURE__ */ I(v, {
|
|
84
|
+
value: i,
|
|
85
|
+
onChange: _,
|
|
86
|
+
placeholder: "Search",
|
|
87
|
+
leftSection: x,
|
|
88
|
+
size: r,
|
|
89
|
+
"data-autofocus": !0
|
|
90
|
+
})
|
|
91
|
+
}), t[18] = r, t[19] = i, t[20] = S) : S = t[20], u = m.Autosize, g = 260, y = "auto", p = G.columnsPanelList;
|
|
92
|
+
let w;
|
|
93
|
+
t[21] !== s || t[22] !== r ? (w = (e) => /* @__PURE__ */ I(l, {
|
|
94
|
+
size: r,
|
|
95
|
+
label: Se(e),
|
|
96
|
+
disabled: !e.getCanHide(),
|
|
97
|
+
checked: s[e.id] !== !1,
|
|
98
|
+
onChange: (t) => e.toggleVisibility(t.currentTarget.checked)
|
|
99
|
+
}, e.id), t[21] = s, t[22] = r, t[23] = w) : w = t[23], h = C.map(w), t[0] = s, t[1] = r, t[2] = i, t[3] = n, t[4] = u, t[5] = d, t[6] = f, t[7] = p, t[8] = h, t[9] = g, t[10] = y, t[11] = b, t[12] = S, t[13] = C;
|
|
100
|
+
} else u = t[4], d = t[5], f = t[6], p = t[7], h = t[8], g = t[9], y = t[10], b = t[11], S = t[12], C = t[13];
|
|
101
|
+
let w;
|
|
102
|
+
t[24] !== r || t[25] !== i || t[26] !== C.length ? (w = C.length === 0 && /* @__PURE__ */ L(_, {
|
|
103
|
+
size: r,
|
|
104
|
+
c: "dimmed",
|
|
105
|
+
children: [
|
|
106
|
+
"No columns match “",
|
|
107
|
+
i,
|
|
108
|
+
"”"
|
|
109
|
+
]
|
|
110
|
+
}), t[24] = r, t[25] = i, t[26] = C.length, t[27] = w) : w = t[27];
|
|
111
|
+
let T;
|
|
112
|
+
t[28] !== p || t[29] !== h || t[30] !== w ? (T = /* @__PURE__ */ L("div", {
|
|
113
|
+
className: p,
|
|
114
|
+
children: [h, w]
|
|
115
|
+
}), t[28] = p, t[29] = h, t[30] = w, t[31] = T) : T = t[31];
|
|
116
|
+
let E;
|
|
117
|
+
t[32] !== u || t[33] !== g || t[34] !== y || t[35] !== T ? (E = /* @__PURE__ */ I(u, {
|
|
118
|
+
mah: g,
|
|
119
|
+
type: y,
|
|
120
|
+
children: T
|
|
121
|
+
}), t[32] = u, t[33] = g, t[34] = y, t[35] = T, t[36] = E) : E = t[36];
|
|
122
|
+
let D = f === d.length, O = f > 0 && f < d.length, k;
|
|
123
|
+
t[37] === n ? k = t[38] : (k = (e) => n.toggleAllColumnsVisible(e.currentTarget.checked), t[37] = n, t[38] = k);
|
|
124
|
+
let A;
|
|
125
|
+
t[39] !== r || t[40] !== O || t[41] !== k || t[42] !== D ? (A = /* @__PURE__ */ I(l, {
|
|
126
|
+
size: r,
|
|
127
|
+
label: "Show/Hide All",
|
|
128
|
+
checked: D,
|
|
129
|
+
indeterminate: O,
|
|
130
|
+
onChange: k
|
|
131
|
+
}), t[39] = r, t[40] = O, t[41] = k, t[42] = D, t[43] = A) : A = t[43];
|
|
132
|
+
let j;
|
|
133
|
+
t[44] === n ? j = t[45] : (j = /* @__PURE__ */ I(c, {
|
|
134
|
+
variant: "subtle",
|
|
135
|
+
size: "compact-sm",
|
|
136
|
+
onClick: () => n.resetColumnVisibility(),
|
|
137
|
+
children: "RESET"
|
|
138
|
+
}), t[44] = n, t[45] = j);
|
|
139
|
+
let M;
|
|
140
|
+
t[46] !== A || t[47] !== j ? (M = /* @__PURE__ */ L("div", {
|
|
141
|
+
className: G.columnsPanelFooter,
|
|
142
|
+
children: [A, j]
|
|
143
|
+
}), t[46] = A, t[47] = j, t[48] = M) : M = t[48];
|
|
144
|
+
let N;
|
|
145
|
+
return t[49] !== M || t[50] !== b || t[51] !== S || t[52] !== E ? (N = /* @__PURE__ */ L("div", {
|
|
146
|
+
className: b,
|
|
147
|
+
children: [
|
|
148
|
+
S,
|
|
149
|
+
E,
|
|
150
|
+
M
|
|
151
|
+
]
|
|
152
|
+
}), t[49] = M, t[50] = b, t[51] = S, t[52] = E, t[53] = N) : N = t[53], N;
|
|
153
|
+
}
|
|
154
|
+
function De(e) {
|
|
155
|
+
return e.getCanHide();
|
|
156
|
+
}
|
|
157
|
+
function Oe(e) {
|
|
158
|
+
return e.columnVisibility;
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region src/tmdatagrid/filterOperators.ts
|
|
162
|
+
var ke = {
|
|
163
|
+
contains: "contains",
|
|
164
|
+
equals: "equals",
|
|
165
|
+
notEquals: "does not equal",
|
|
166
|
+
startsWith: "starts with",
|
|
167
|
+
endsWith: "ends with",
|
|
168
|
+
greaterThan: "is greater than",
|
|
169
|
+
greaterThanOrEqual: "is greater than or equal to",
|
|
170
|
+
lessThan: "is less than",
|
|
171
|
+
lessThanOrEqual: "is less than or equal to",
|
|
172
|
+
isEmpty: "is empty",
|
|
173
|
+
isNotEmpty: "is not empty"
|
|
174
|
+
}, Ae = [
|
|
175
|
+
"contains",
|
|
176
|
+
"equals",
|
|
177
|
+
"notEquals",
|
|
178
|
+
"startsWith",
|
|
179
|
+
"endsWith",
|
|
180
|
+
"isEmpty",
|
|
181
|
+
"isNotEmpty"
|
|
182
|
+
], je = [
|
|
183
|
+
"equals",
|
|
184
|
+
"notEquals",
|
|
185
|
+
"greaterThan",
|
|
186
|
+
"greaterThanOrEqual",
|
|
187
|
+
"lessThan",
|
|
188
|
+
"lessThanOrEqual",
|
|
189
|
+
"isEmpty",
|
|
190
|
+
"isNotEmpty"
|
|
191
|
+
], Me = ["isEmpty", "isNotEmpty"];
|
|
192
|
+
function Ne(e) {
|
|
193
|
+
return e === "number" ? je : Ae;
|
|
194
|
+
}
|
|
195
|
+
function J(e) {
|
|
196
|
+
return e === "number" ? "equals" : "contains";
|
|
197
|
+
}
|
|
198
|
+
function Y(e) {
|
|
199
|
+
return !Me.includes(e);
|
|
200
|
+
}
|
|
201
|
+
function Pe(e) {
|
|
202
|
+
return typeof e == "object" && !!e && "operator" in e && typeof e.operator == "string";
|
|
203
|
+
}
|
|
204
|
+
function Fe(e) {
|
|
205
|
+
return Pe(e) ? !Y(e.operator) || e.value.trim() !== "" : !1;
|
|
206
|
+
}
|
|
207
|
+
function Ie(e, { operator: t, value: n }) {
|
|
208
|
+
if (t === "isEmpty") return e == null || e === "";
|
|
209
|
+
if (t === "isNotEmpty") return e != null && e !== "";
|
|
210
|
+
let r = n.trim();
|
|
211
|
+
if (r === "") return !0;
|
|
212
|
+
let i = typeof e == "number" ? e : NaN, a = Number(r), o = !Number.isNaN(i) && !Number.isNaN(a);
|
|
213
|
+
switch (t) {
|
|
214
|
+
case "greaterThan": return o && i > a;
|
|
215
|
+
case "greaterThanOrEqual": return o && i >= a;
|
|
216
|
+
case "lessThan": return o && i < a;
|
|
217
|
+
case "lessThanOrEqual": return o && i <= a;
|
|
218
|
+
default: break;
|
|
219
|
+
}
|
|
220
|
+
let s = String(e ?? "").toLowerCase(), c = r.toLowerCase();
|
|
221
|
+
switch (t) {
|
|
222
|
+
case "contains": return s.includes(c);
|
|
223
|
+
case "equals": return o ? i === a : s === c;
|
|
224
|
+
case "notEquals": return o ? i !== a : s !== c;
|
|
225
|
+
case "startsWith": return s.startsWith(c);
|
|
226
|
+
case "endsWith": return s.endsWith(c);
|
|
227
|
+
default: return !0;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function Le(e, t, n) {
|
|
231
|
+
return Pe(n) ? Ie(e.getValue(t), n) : !0;
|
|
232
|
+
}
|
|
233
|
+
//#endregion
|
|
234
|
+
//#region src/tmdatagrid/TMDataGridFilterPanel.tsx
|
|
235
|
+
var Re = {
|
|
236
|
+
operator: "contains",
|
|
237
|
+
value: ""
|
|
238
|
+
};
|
|
239
|
+
function ze(e) {
|
|
240
|
+
return Pe(e) ? e : Re;
|
|
241
|
+
}
|
|
242
|
+
function Be() {
|
|
243
|
+
let t = e(39), { table: n, ui: r, controlSize: i } = q(), a = x(r, Ge), o = x(n.store, We);
|
|
244
|
+
if (!a) return null;
|
|
245
|
+
let l, u;
|
|
246
|
+
t[0] === n ? (l = t[1], u = t[2]) : (l = n.getAllLeafColumns().filter(Ue), u = l.map(He), t[0] = n, t[1] = l, t[2] = u);
|
|
247
|
+
let d = u, f;
|
|
248
|
+
t[3] !== o || t[4] !== n || t[5] !== r ? (f = function(e) {
|
|
249
|
+
let t = o.filter((t) => t.id !== e);
|
|
250
|
+
n.setColumnFilters(t), t.length === 0 && r.actions.closeFilterPanel();
|
|
251
|
+
}, t[3] = o, t[4] = n, t[5] = r, t[6] = f) : f = t[6];
|
|
252
|
+
let p = f, m;
|
|
253
|
+
t[7] !== o || t[8] !== n || t[9] !== r ? (m = function(e, t) {
|
|
254
|
+
let i = ze(o.find((t) => t.id === e)?.value), a = n.getColumn(t);
|
|
255
|
+
n.setColumnFilters(o.filter((e) => e.id !== t).map((n) => n.id === e ? {
|
|
256
|
+
id: t,
|
|
257
|
+
value: {
|
|
258
|
+
operator: J(a ? Ce(a) : "string"),
|
|
259
|
+
value: i.value
|
|
260
|
+
}
|
|
261
|
+
} : n)), r.actions.openFilterPanel(t);
|
|
262
|
+
}, t[7] = o, t[8] = n, t[9] = r, t[10] = m) : m = t[10];
|
|
263
|
+
let _ = m, y;
|
|
264
|
+
t[11] !== o || t[12] !== n ? (y = function(e, t) {
|
|
265
|
+
n.setColumnFilters(o.map((n) => n.id === e ? {
|
|
266
|
+
...n,
|
|
267
|
+
value: {
|
|
268
|
+
...ze(n.value),
|
|
269
|
+
...t
|
|
270
|
+
}
|
|
271
|
+
} : n));
|
|
272
|
+
}, t[11] = o, t[12] = n, t[13] = y) : y = t[13];
|
|
273
|
+
let b = y, S;
|
|
274
|
+
t[14] !== o || t[15] !== l || t[16] !== n ? (S = function() {
|
|
275
|
+
let e = l.find((e) => !o.some((t) => t.id === e.id));
|
|
276
|
+
e && n.setColumnFilters([...o, {
|
|
277
|
+
id: e.id,
|
|
278
|
+
value: {
|
|
279
|
+
operator: J(Ce(e)),
|
|
280
|
+
value: ""
|
|
281
|
+
}
|
|
282
|
+
}]);
|
|
283
|
+
}, t[14] = o, t[15] = l, t[16] = n, t[17] = S) : S = t[17];
|
|
284
|
+
let C = S, w;
|
|
285
|
+
if (t[18] !== _ || t[19] !== o || t[20] !== d || t[21] !== i || t[22] !== b || t[23] !== p || t[24] !== n) {
|
|
286
|
+
let e;
|
|
287
|
+
t[26] !== _ || t[27] !== d || t[28] !== i || t[29] !== b || t[30] !== p || t[31] !== n ? (e = (e) => {
|
|
288
|
+
let t = n.getColumn(e.id), r = ze(e.value), a = t ? Ce(t) : "string", o = Y(r.operator);
|
|
289
|
+
return /* @__PURE__ */ L("div", {
|
|
290
|
+
className: G.filterRow,
|
|
291
|
+
children: [
|
|
292
|
+
/* @__PURE__ */ I(s, {
|
|
293
|
+
variant: "subtle",
|
|
294
|
+
color: "gray",
|
|
295
|
+
size: "lg",
|
|
296
|
+
"aria-label": "Remove filter",
|
|
297
|
+
onClick: () => p(e.id),
|
|
298
|
+
children: /* @__PURE__ */ I(F, {
|
|
299
|
+
size: 18,
|
|
300
|
+
stroke: 1.6
|
|
301
|
+
})
|
|
302
|
+
}),
|
|
303
|
+
/* @__PURE__ */ I(h, {
|
|
304
|
+
label: "Column",
|
|
305
|
+
size: i,
|
|
306
|
+
w: 160,
|
|
307
|
+
allowDeselect: !1,
|
|
308
|
+
data: d,
|
|
309
|
+
value: e.id,
|
|
310
|
+
onChange: (t) => t && _(e.id, t)
|
|
311
|
+
}),
|
|
312
|
+
/* @__PURE__ */ I(h, {
|
|
313
|
+
label: "Operator",
|
|
314
|
+
size: i,
|
|
315
|
+
w: 170,
|
|
316
|
+
allowDeselect: !1,
|
|
317
|
+
data: Ne(a).map(Ve),
|
|
318
|
+
value: r.operator,
|
|
319
|
+
onChange: (t) => t && b(e.id, { operator: t })
|
|
320
|
+
}),
|
|
321
|
+
/* @__PURE__ */ I(v, {
|
|
322
|
+
label: "Value",
|
|
323
|
+
size: i,
|
|
324
|
+
w: 180,
|
|
325
|
+
type: a === "number" && o ? "number" : "text",
|
|
326
|
+
disabled: !o,
|
|
327
|
+
placeholder: o ? "Filter value" : "",
|
|
328
|
+
value: o ? r.value : "",
|
|
329
|
+
onChange: (t) => b(e.id, { value: t.currentTarget.value })
|
|
330
|
+
})
|
|
331
|
+
]
|
|
332
|
+
}, e.id);
|
|
333
|
+
}, t[26] = _, t[27] = d, t[28] = i, t[29] = b, t[30] = p, t[31] = n, t[32] = e) : e = t[32], w = o.map(e), t[18] = _, t[19] = o, t[20] = d, t[21] = i, t[22] = b, t[23] = p, t[24] = n, t[25] = w;
|
|
334
|
+
} else w = t[25];
|
|
335
|
+
let T;
|
|
336
|
+
t[33] === Symbol.for("react.memo_cache_sentinel") ? (T = { alignSelf: "flex-start" }, t[33] = T) : T = t[33];
|
|
337
|
+
let E;
|
|
338
|
+
t[34] === C ? E = t[35] : (E = /* @__PURE__ */ I(c, {
|
|
339
|
+
variant: "subtle",
|
|
340
|
+
size: "compact-sm",
|
|
341
|
+
style: T,
|
|
342
|
+
onClick: C,
|
|
343
|
+
children: "Add filter"
|
|
344
|
+
}), t[34] = C, t[35] = E);
|
|
345
|
+
let D;
|
|
346
|
+
return t[36] !== w || t[37] !== E ? (D = /* @__PURE__ */ I("div", {
|
|
347
|
+
className: G.filterPanel,
|
|
348
|
+
children: /* @__PURE__ */ L(g, {
|
|
349
|
+
gap: "xs",
|
|
350
|
+
children: [w, E]
|
|
351
|
+
})
|
|
352
|
+
}), t[36] = w, t[37] = E, t[38] = D) : D = t[38], D;
|
|
353
|
+
}
|
|
354
|
+
function Ve(e) {
|
|
355
|
+
return {
|
|
356
|
+
value: e,
|
|
357
|
+
label: ke[e]
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
function He(e) {
|
|
361
|
+
return {
|
|
362
|
+
value: e.id,
|
|
363
|
+
label: Se(e)
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
function Ue(e) {
|
|
367
|
+
return e.getCanFilter();
|
|
368
|
+
}
|
|
369
|
+
function We(e) {
|
|
370
|
+
return e.columnFilters;
|
|
371
|
+
}
|
|
372
|
+
function Ge(e) {
|
|
373
|
+
return e.filterPanelOpen;
|
|
374
|
+
}
|
|
375
|
+
//#endregion
|
|
376
|
+
//#region src/tmdatagrid/TMDataGridFooter.tsx
|
|
377
|
+
function Ke(t) {
|
|
378
|
+
let n = e(47), { pageSizeOptions: r } = t, i;
|
|
379
|
+
n[0] === r ? i = n[1] : (i = r === void 0 ? [
|
|
380
|
+
10,
|
|
381
|
+
25,
|
|
382
|
+
50,
|
|
383
|
+
100
|
|
384
|
+
] : r, n[0] = r, n[1] = i);
|
|
385
|
+
let a = i, { table: o, controlSize: c } = q();
|
|
386
|
+
x(o.store);
|
|
387
|
+
let { pageIndex: l, pageSize: d } = o.store.state.pagination, f;
|
|
388
|
+
n[2] === o ? f = n[3] : (f = o.getRowCount(), n[2] = o, n[3] = f);
|
|
389
|
+
let p = f, m = p === 0 ? 0 : l * d + 1, g = Math.min(p, (l + 1) * d), v;
|
|
390
|
+
n[4] === c ? v = n[5] : (v = /* @__PURE__ */ I(_, {
|
|
391
|
+
size: c,
|
|
392
|
+
c: "dimmed",
|
|
393
|
+
children: "Rows per page:"
|
|
394
|
+
}), n[4] = c, n[5] = v);
|
|
395
|
+
let y;
|
|
396
|
+
n[6] === a ? y = n[7] : (y = a.map(String), n[6] = a, n[7] = y);
|
|
397
|
+
let b = String(d), S;
|
|
398
|
+
n[8] !== a[0] || n[9] !== o ? (S = (e) => {
|
|
399
|
+
o.setPageSize(Number(e) || a[0]), o.setPageIndex(0);
|
|
400
|
+
}, n[8] = a[0], n[9] = o, n[10] = S) : S = n[10];
|
|
401
|
+
let C;
|
|
402
|
+
n[11] !== c || n[12] !== y || n[13] !== b || n[14] !== S ? (C = /* @__PURE__ */ I(h, {
|
|
403
|
+
size: c,
|
|
404
|
+
w: 78,
|
|
405
|
+
allowDeselect: !1,
|
|
406
|
+
variant: "unstyled",
|
|
407
|
+
data: y,
|
|
408
|
+
value: b,
|
|
409
|
+
onChange: S
|
|
410
|
+
}), n[11] = c, n[12] = y, n[13] = b, n[14] = S, n[15] = C) : C = n[15];
|
|
411
|
+
let w;
|
|
412
|
+
n[16] !== v || n[17] !== C ? (w = /* @__PURE__ */ L(u, {
|
|
413
|
+
gap: "xs",
|
|
414
|
+
wrap: "nowrap",
|
|
415
|
+
children: [v, C]
|
|
416
|
+
}), n[16] = v, n[17] = C, n[18] = w) : w = n[18];
|
|
417
|
+
let T;
|
|
418
|
+
n[19] !== c || n[20] !== m || n[21] !== g || n[22] !== p ? (T = /* @__PURE__ */ L(_, {
|
|
419
|
+
size: c,
|
|
420
|
+
c: "dimmed",
|
|
421
|
+
children: [
|
|
422
|
+
m,
|
|
423
|
+
"–",
|
|
424
|
+
g,
|
|
425
|
+
" of ",
|
|
426
|
+
p
|
|
427
|
+
]
|
|
428
|
+
}), n[19] = c, n[20] = m, n[21] = g, n[22] = p, n[23] = T) : T = n[23];
|
|
429
|
+
let E;
|
|
430
|
+
n[24] === o ? E = n[25] : (E = o.getCanPreviousPage(), n[24] = o, n[25] = E);
|
|
431
|
+
let D = !E, A;
|
|
432
|
+
n[26] === o ? A = n[27] : (A = () => o.previousPage(), n[26] = o, n[27] = A);
|
|
433
|
+
let j;
|
|
434
|
+
n[28] === Symbol.for("react.memo_cache_sentinel") ? (j = /* @__PURE__ */ I(O, {
|
|
435
|
+
size: 18,
|
|
436
|
+
stroke: 1.6
|
|
437
|
+
}), n[28] = j) : j = n[28];
|
|
438
|
+
let M;
|
|
439
|
+
n[29] !== D || n[30] !== A ? (M = /* @__PURE__ */ I(s, {
|
|
440
|
+
variant: "subtle",
|
|
441
|
+
color: "gray",
|
|
442
|
+
"aria-label": "Previous page",
|
|
443
|
+
disabled: D,
|
|
444
|
+
onClick: A,
|
|
445
|
+
children: j
|
|
446
|
+
}), n[29] = D, n[30] = A, n[31] = M) : M = n[31];
|
|
447
|
+
let N;
|
|
448
|
+
n[32] === o ? N = n[33] : (N = o.getCanNextPage(), n[32] = o, n[33] = N);
|
|
449
|
+
let ee = !N, te;
|
|
450
|
+
n[34] === o ? te = n[35] : (te = () => o.nextPage(), n[34] = o, n[35] = te);
|
|
451
|
+
let P;
|
|
452
|
+
n[36] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ I(k, {
|
|
453
|
+
size: 18,
|
|
454
|
+
stroke: 1.6
|
|
455
|
+
}), n[36] = P) : P = n[36];
|
|
456
|
+
let F;
|
|
457
|
+
n[37] !== ee || n[38] !== te ? (F = /* @__PURE__ */ I(s, {
|
|
458
|
+
variant: "subtle",
|
|
459
|
+
color: "gray",
|
|
460
|
+
"aria-label": "Next page",
|
|
461
|
+
disabled: ee,
|
|
462
|
+
onClick: te,
|
|
463
|
+
children: P
|
|
464
|
+
}), n[37] = ee, n[38] = te, n[39] = F) : F = n[39];
|
|
465
|
+
let R;
|
|
466
|
+
n[40] !== M || n[41] !== F ? (R = /* @__PURE__ */ L(u, {
|
|
467
|
+
gap: 4,
|
|
468
|
+
wrap: "nowrap",
|
|
469
|
+
children: [M, F]
|
|
470
|
+
}), n[40] = M, n[41] = F, n[42] = R) : R = n[42];
|
|
471
|
+
let z;
|
|
472
|
+
return n[43] !== T || n[44] !== R || n[45] !== w ? (z = /* @__PURE__ */ L("div", {
|
|
473
|
+
className: G.footer,
|
|
474
|
+
children: [
|
|
475
|
+
w,
|
|
476
|
+
T,
|
|
477
|
+
R
|
|
478
|
+
]
|
|
479
|
+
}), n[43] = T, n[44] = R, n[45] = w, n[46] = z) : z = n[46], z;
|
|
480
|
+
}
|
|
481
|
+
//#endregion
|
|
482
|
+
//#region src/tmdatagrid/capabilities.ts
|
|
483
|
+
function qe(e) {
|
|
484
|
+
return {
|
|
485
|
+
sorting: e.enableSorting !== !1,
|
|
486
|
+
filtering: e.enableColumnFilters !== !1,
|
|
487
|
+
hiding: e.enableHiding !== !1,
|
|
488
|
+
pinning: e.enableColumnPinning !== !1,
|
|
489
|
+
resizing: e.enableColumnResizing !== !1,
|
|
490
|
+
ordering: e.enableColumnOrdering !== !1,
|
|
491
|
+
rowSelection: e.enableRowSelection !== !1
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
function Je(e, t) {
|
|
495
|
+
return {
|
|
496
|
+
canSort: t.sorting && e.getCanSort(),
|
|
497
|
+
canFilter: t.filtering && e.getCanFilter(),
|
|
498
|
+
canHide: t.hiding && e.getCanHide(),
|
|
499
|
+
canPin: t.pinning && e.getCanPin(),
|
|
500
|
+
canResize: t.resizing && e.getCanResize(),
|
|
501
|
+
canReorder: t.ordering && Te(e)
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
function Ye(e, t) {
|
|
505
|
+
let n = e.getAllLeafColumns(), r = (e) => n.some((n) => e(Je(n, t)));
|
|
506
|
+
return {
|
|
507
|
+
canSortAny: r((e) => e.canSort),
|
|
508
|
+
canFilterAny: r((e) => e.canFilter),
|
|
509
|
+
canHideAny: r((e) => e.canHide),
|
|
510
|
+
canPinAny: r((e) => e.canPin),
|
|
511
|
+
canReorderAny: r((e) => e.canReorder),
|
|
512
|
+
canSelectRows: t.rowSelection
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
//#endregion
|
|
516
|
+
//#region src/tmdatagrid/columnOrdering.ts
|
|
517
|
+
function Xe(e, t) {
|
|
518
|
+
return e.left.includes(t) ? "left" : e.right.includes(t) ? "right" : "center";
|
|
519
|
+
}
|
|
520
|
+
function Ze(e, t, n, r) {
|
|
521
|
+
let i = e.filter((e) => e !== t), a = i.indexOf(n);
|
|
522
|
+
return a === -1 ? [...e] : (i.splice(r === "before" ? a : a + 1, 0, t), i);
|
|
523
|
+
}
|
|
524
|
+
function Qe({ table: e, columnId: t, targetId: n, side: r }) {
|
|
525
|
+
if (t === n) return;
|
|
526
|
+
let i = e.store.state.columnPinning, a = Xe(i, t);
|
|
527
|
+
if (a !== Xe(i, n)) return;
|
|
528
|
+
let o = e.getAllLeafColumns().map((e) => e.id);
|
|
529
|
+
e.setColumnOrder(Ze(o, t, n, r)), a !== "center" && e.setColumnPinning((e) => ({
|
|
530
|
+
...e,
|
|
531
|
+
[a]: Ze(e[a], t, n, r)
|
|
532
|
+
}));
|
|
533
|
+
}
|
|
534
|
+
function $e(e, t) {
|
|
535
|
+
return t === "left" ? e.getLeftVisibleLeafColumns() : t === "right" ? e.getRightVisibleLeafColumns() : e.getCenterVisibleLeafColumns();
|
|
536
|
+
}
|
|
537
|
+
function et({ table: e, columnId: t, direction: n }) {
|
|
538
|
+
let r = $e(e, Xe(e.store.state.columnPinning, t)), i = r.findIndex((e) => e.id === t);
|
|
539
|
+
if (i === -1) return null;
|
|
540
|
+
let a = r[i + n];
|
|
541
|
+
return !a || !Te(a) ? null : a;
|
|
542
|
+
}
|
|
543
|
+
function tt({ table: e, columnId: t, direction: n }) {
|
|
544
|
+
let r = et({
|
|
545
|
+
table: e,
|
|
546
|
+
columnId: t,
|
|
547
|
+
direction: n
|
|
548
|
+
});
|
|
549
|
+
r && Qe({
|
|
550
|
+
table: e,
|
|
551
|
+
columnId: t,
|
|
552
|
+
targetId: r.id,
|
|
553
|
+
side: n === -1 ? "before" : "after"
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
//#endregion
|
|
557
|
+
//#region src/tmdatagrid/persistence.ts
|
|
558
|
+
var nt = [
|
|
559
|
+
"columnFilters",
|
|
560
|
+
"globalFilter",
|
|
561
|
+
"sorting",
|
|
562
|
+
"pagination"
|
|
563
|
+
], rt = [
|
|
564
|
+
"columnVisibility",
|
|
565
|
+
"columnSizing",
|
|
566
|
+
"columnOrder",
|
|
567
|
+
"columnPinning"
|
|
568
|
+
];
|
|
569
|
+
function it(e, t) {
|
|
570
|
+
if (!e) return null;
|
|
571
|
+
if (typeof e == "string") return {
|
|
572
|
+
key: e,
|
|
573
|
+
slices: t
|
|
574
|
+
};
|
|
575
|
+
let [n, r] = e;
|
|
576
|
+
return n ? {
|
|
577
|
+
key: n,
|
|
578
|
+
slices: r
|
|
579
|
+
} : null;
|
|
580
|
+
}
|
|
581
|
+
function at(e) {
|
|
582
|
+
if (!e) return null;
|
|
583
|
+
try {
|
|
584
|
+
return typeof window > "u" ? null : e.storageMode === "sessionStorage" ? window.sessionStorage : window.localStorage;
|
|
585
|
+
} catch {
|
|
586
|
+
return null;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
function ot(e, t, n) {
|
|
590
|
+
if (!e || !t) return {};
|
|
591
|
+
try {
|
|
592
|
+
let r = e.getItem(t.key);
|
|
593
|
+
if (!r) return {};
|
|
594
|
+
let i = n(r);
|
|
595
|
+
if (typeof i != "object" || !i) return {};
|
|
596
|
+
let a = i, o = {};
|
|
597
|
+
for (let e of t.slices) e in a && (o[e] = a[e]);
|
|
598
|
+
return o;
|
|
599
|
+
} catch {
|
|
600
|
+
return {};
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
function X(e, t, n, r) {
|
|
604
|
+
if (!e || !t) return;
|
|
605
|
+
let i = {};
|
|
606
|
+
for (let e of t.slices) i[e] = n[e];
|
|
607
|
+
try {
|
|
608
|
+
e.setItem(t.key, r(i));
|
|
609
|
+
} catch {}
|
|
610
|
+
}
|
|
611
|
+
function Z(e) {
|
|
612
|
+
return {
|
|
613
|
+
data: it(e?.dataKey, nt),
|
|
614
|
+
settings: it(e?.settingsKey, rt)
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
function st(e) {
|
|
618
|
+
let { data: t, settings: n } = Z(e);
|
|
619
|
+
return t !== null || n !== null;
|
|
620
|
+
}
|
|
621
|
+
var ct = (e) => JSON.parse(e), lt = (e) => JSON.stringify(e);
|
|
622
|
+
function ut(e) {
|
|
623
|
+
let t = at(e), { data: n, settings: r } = Z(e), i = e?.deserialize ?? ct;
|
|
624
|
+
return {
|
|
625
|
+
...ot(t, r, i),
|
|
626
|
+
...ot(t, n, i)
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
function dt(e, t) {
|
|
630
|
+
let n = at(t);
|
|
631
|
+
if (!n) return;
|
|
632
|
+
let { data: r, settings: i } = Z(t), a = t?.serialize ?? lt;
|
|
633
|
+
X(n, r, e, a), X(n, i, e, a);
|
|
634
|
+
}
|
|
635
|
+
//#endregion
|
|
636
|
+
//#region src/tmdatagrid/useTMDataGrid.tsx
|
|
637
|
+
var ft = "__select__", Q = _e({
|
|
638
|
+
columnFilteringFeature: z,
|
|
639
|
+
globalFilteringFeature: pe,
|
|
640
|
+
rowSortingFeature: W,
|
|
641
|
+
rowPaginationFeature: he,
|
|
642
|
+
rowSelectionFeature: U,
|
|
643
|
+
columnPinningFeature: ne,
|
|
644
|
+
columnVisibilityFeature: ae,
|
|
645
|
+
columnOrderingFeature: B,
|
|
646
|
+
columnSizingFeature: ie,
|
|
647
|
+
columnResizingFeature: re,
|
|
648
|
+
columnFacetingFeature: R,
|
|
649
|
+
filteredRowModel: V(),
|
|
650
|
+
sortedRowModel: de(),
|
|
651
|
+
paginatedRowModel: ue(),
|
|
652
|
+
facetedRowModel: ce(),
|
|
653
|
+
facetedMinMaxValues: se(),
|
|
654
|
+
facetedUniqueValues: le(),
|
|
655
|
+
filterFns: {
|
|
656
|
+
...H,
|
|
657
|
+
tmDataGrid: Le
|
|
658
|
+
},
|
|
659
|
+
sortFns: ge,
|
|
660
|
+
tableMeta: me(),
|
|
661
|
+
columnMeta: me()
|
|
662
|
+
});
|
|
663
|
+
function pt() {
|
|
664
|
+
return oe();
|
|
665
|
+
}
|
|
666
|
+
function $(e) {
|
|
667
|
+
return e.map((e) => "columns" in e && Array.isArray(e.columns) ? {
|
|
668
|
+
...e,
|
|
669
|
+
columns: $(e.columns)
|
|
670
|
+
} : {
|
|
671
|
+
filterFn: "tmDataGrid",
|
|
672
|
+
...e
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
function mt() {
|
|
676
|
+
return {
|
|
677
|
+
id: ft,
|
|
678
|
+
meta: {
|
|
679
|
+
label: "Checkbox selection",
|
|
680
|
+
align: "center",
|
|
681
|
+
enableOrdering: !1
|
|
682
|
+
},
|
|
683
|
+
size: 48,
|
|
684
|
+
minSize: 48,
|
|
685
|
+
maxSize: 48,
|
|
686
|
+
enableResizing: !1,
|
|
687
|
+
enableSorting: !1,
|
|
688
|
+
enableColumnFilter: !1,
|
|
689
|
+
enableGlobalFilter: !1,
|
|
690
|
+
enablePinning: !1,
|
|
691
|
+
header: ({ table: e }) => /* @__PURE__ */ I(l, {
|
|
692
|
+
size: "xs",
|
|
693
|
+
"aria-label": "Select all rows",
|
|
694
|
+
checked: e.getIsAllRowsSelected(),
|
|
695
|
+
indeterminate: e.getIsSomeRowsSelected(),
|
|
696
|
+
onChange: e.getToggleAllRowsSelectedHandler()
|
|
697
|
+
}),
|
|
698
|
+
cell: ({ row: e }) => /* @__PURE__ */ I(l, {
|
|
699
|
+
size: "xs",
|
|
700
|
+
"aria-label": "Select row",
|
|
701
|
+
checked: e.getIsSelected(),
|
|
702
|
+
disabled: !e.getCanSelect(),
|
|
703
|
+
indeterminate: e.getIsSomeSelected(),
|
|
704
|
+
onChange: e.getToggleSelectedHandler(),
|
|
705
|
+
onClick: (e) => e.stopPropagation()
|
|
706
|
+
})
|
|
707
|
+
};
|
|
708
|
+
}
|
|
709
|
+
function ht(t) {
|
|
710
|
+
let n = e(46), r, a, s;
|
|
711
|
+
n[0] === t ? (r = n[1], a = n[2], s = n[3]) : ({persist: s, enableColumnOrdering: r, ...a} = t, n[0] = t, n[1] = r, n[2] = a, n[3] = s);
|
|
712
|
+
let c = a.enableRowSelection !== !1, l = a.enableColumnPinning !== !1, u;
|
|
713
|
+
if (n[4] !== a.columns || n[5] !== c) {
|
|
714
|
+
let e = $(a.columns);
|
|
715
|
+
u = c ? [mt(), ...e] : e, n[4] = a.columns, n[5] = c, n[6] = u;
|
|
716
|
+
} else u = n[6];
|
|
717
|
+
let d = u, f;
|
|
718
|
+
n[7] === s ? f = n[8] : (f = () => ut(s), n[7] = s, n[8] = f);
|
|
719
|
+
let [p] = o(f), m = d, h;
|
|
720
|
+
n[9] !== l || n[10] !== c ? (h = c && l ? [ft] : [], n[9] = l, n[10] = c, n[11] = h) : h = n[11];
|
|
721
|
+
let g;
|
|
722
|
+
n[12] !== a.initialState?.columnPinning?.left || n[13] !== p.columnPinning?.left || n[14] !== h ? (g = [...h, ...(p.columnPinning?.left ?? a.initialState?.columnPinning?.left ?? []).filter(bt)], n[12] = a.initialState?.columnPinning?.left, n[13] = p.columnPinning?.left, n[14] = h, n[15] = g) : g = n[15];
|
|
723
|
+
let _;
|
|
724
|
+
n[16] !== a.initialState?.columnPinning?.right || n[17] !== p.columnPinning?.right ? (_ = p.columnPinning?.right ?? a.initialState?.columnPinning?.right ?? [], n[16] = a.initialState?.columnPinning?.right, n[17] = p.columnPinning?.right, n[18] = _) : _ = n[18];
|
|
725
|
+
let v;
|
|
726
|
+
n[19] !== g || n[20] !== _ ? (v = {
|
|
727
|
+
left: g,
|
|
728
|
+
right: _
|
|
729
|
+
}, n[19] = g, n[20] = _, n[21] = v) : v = n[21];
|
|
730
|
+
let y = a.initialState?.pagination, x;
|
|
731
|
+
n[22] !== p.pagination || n[23] !== y ? (x = {
|
|
732
|
+
pageIndex: 0,
|
|
733
|
+
pageSize: 25,
|
|
734
|
+
...y,
|
|
735
|
+
...p.pagination
|
|
736
|
+
}, n[22] = p.pagination, n[23] = y, n[24] = x) : x = n[24];
|
|
737
|
+
let S;
|
|
738
|
+
n[25] !== a.initialState || n[26] !== p || n[27] !== v || n[28] !== x ? (S = {
|
|
739
|
+
...a.initialState,
|
|
740
|
+
...p,
|
|
741
|
+
columnPinning: v,
|
|
742
|
+
pagination: x
|
|
743
|
+
}, n[25] = a.initialState, n[26] = p, n[27] = v, n[28] = x, n[29] = S) : S = n[29];
|
|
744
|
+
let C;
|
|
745
|
+
n[30] !== a || n[31] !== S || n[32] !== m ? (C = {
|
|
746
|
+
columnResizeMode: "onChange",
|
|
747
|
+
enableSorting: !0,
|
|
748
|
+
enableColumnResizing: !0,
|
|
749
|
+
globalFilterFn: "includesString",
|
|
750
|
+
...a,
|
|
751
|
+
features: Q,
|
|
752
|
+
columns: m,
|
|
753
|
+
initialState: S
|
|
754
|
+
}, n[30] = a, n[31] = S, n[32] = m, n[33] = C) : C = n[33];
|
|
755
|
+
let w = ve(C), T, E;
|
|
756
|
+
n[34] !== s || n[35] !== w ? (T = () => {
|
|
757
|
+
if (!st(s)) return;
|
|
758
|
+
dt(w.store.state, s);
|
|
759
|
+
let e = w.store.subscribe((e) => {
|
|
760
|
+
dt(e, s);
|
|
761
|
+
});
|
|
762
|
+
return () => e.unsubscribe();
|
|
763
|
+
}, E = [s, w], n[34] = s, n[35] = w, n[36] = T, n[37] = E) : (T = n[36], E = n[37]), i(T, E);
|
|
764
|
+
let D;
|
|
765
|
+
n[38] === Symbol.for("react.memo_cache_sentinel") ? (D = {
|
|
766
|
+
filterPanelOpen: !1,
|
|
767
|
+
columnsPanelOpen: !1,
|
|
768
|
+
filterPanelColumnId: null,
|
|
769
|
+
draggedColumnId: null
|
|
770
|
+
}, n[38] = D) : D = n[38];
|
|
771
|
+
let O = b(D, gt), k;
|
|
772
|
+
n[39] !== r || n[40] !== a ? (k = qe({
|
|
773
|
+
...a,
|
|
774
|
+
enableColumnOrdering: r
|
|
775
|
+
}), n[39] = r, n[40] = a, n[41] = k) : k = n[41];
|
|
776
|
+
let A = k, j;
|
|
777
|
+
return n[42] !== A || n[43] !== w || n[44] !== O ? (j = {
|
|
778
|
+
table: w,
|
|
779
|
+
ui: O,
|
|
780
|
+
features: A
|
|
781
|
+
}, n[42] = A, n[43] = w, n[44] = O, n[45] = j) : j = n[45], j;
|
|
782
|
+
}
|
|
783
|
+
function gt(e) {
|
|
784
|
+
let { setState: t } = e;
|
|
785
|
+
return {
|
|
786
|
+
openFilterPanel: (e) => {
|
|
787
|
+
let n = e === void 0 ? null : e;
|
|
788
|
+
return t((e) => ({
|
|
789
|
+
...e,
|
|
790
|
+
filterPanelOpen: !0,
|
|
791
|
+
filterPanelColumnId: n
|
|
792
|
+
}));
|
|
793
|
+
},
|
|
794
|
+
closeFilterPanel: () => t(yt),
|
|
795
|
+
setColumnsPanelOpen: (e) => t((t) => ({
|
|
796
|
+
...t,
|
|
797
|
+
columnsPanelOpen: e
|
|
798
|
+
})),
|
|
799
|
+
toggleColumnsPanel: () => t(vt),
|
|
800
|
+
startColumnDrag: (e) => t((t) => ({
|
|
801
|
+
...t,
|
|
802
|
+
draggedColumnId: e
|
|
803
|
+
})),
|
|
804
|
+
endColumnDrag: () => t(_t)
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
function _t(e) {
|
|
808
|
+
return {
|
|
809
|
+
...e,
|
|
810
|
+
draggedColumnId: null
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
function vt(e) {
|
|
814
|
+
return {
|
|
815
|
+
...e,
|
|
816
|
+
columnsPanelOpen: !e.columnsPanelOpen
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
function yt(e) {
|
|
820
|
+
return {
|
|
821
|
+
...e,
|
|
822
|
+
filterPanelOpen: !1,
|
|
823
|
+
filterPanelColumnId: null
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
function bt(e) {
|
|
827
|
+
return e !== ft;
|
|
828
|
+
}
|
|
829
|
+
function xt(e, t) {
|
|
830
|
+
let n = e.table.getColumn(t);
|
|
831
|
+
n && n.getFilterValue() === void 0 && n.setFilterValue({
|
|
832
|
+
operator: J(n.columnDef.meta?.type ?? "string"),
|
|
833
|
+
value: ""
|
|
834
|
+
}), e.ui.actions.openFilterPanel(t);
|
|
835
|
+
}
|
|
836
|
+
//#endregion
|
|
837
|
+
//#region src/tmdatagrid/TMDataGridHeaderCell.tsx
|
|
838
|
+
function St(t) {
|
|
839
|
+
let n = e(173), { header: r, layout: i } = t, c = q(), { table: l, features: u } = c, d = r.column, [p, m] = o(!1), [h, g] = o(null), _ = a(null), v = a(!1), b;
|
|
840
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (b = { compare: be }, n[0] = b) : b = n[0];
|
|
841
|
+
let { sorting: O, columnFilters: k, resizingColumnId: ee, columnPinning: P } = x(l.store, Dt, b), F = x(c.ui, Et), R = r.subHeaders.length === 0, z;
|
|
842
|
+
n[1] === d ? z = n[2] : (z = Se(d), n[1] = d, n[2] = z);
|
|
843
|
+
let B = z, ne;
|
|
844
|
+
n[3] === d ? ne = n[4] : (ne = we(d), n[3] = d, n[4] = ne);
|
|
845
|
+
let re = ne, ie;
|
|
846
|
+
n[5] !== d.id || n[6] !== O ? (ie = O.find((e) => e.id === d.id)?.desc, n[5] = d.id, n[6] = O, n[7] = ie) : ie = n[7];
|
|
847
|
+
let ae = ie, oe = ae !== void 0, se;
|
|
848
|
+
if (n[8] !== d.id || n[9] !== k) {
|
|
849
|
+
let e;
|
|
850
|
+
n[11] === d.id ? e = n[12] : (e = (e) => e.id === d.id && Fe(e.value), n[11] = d.id, n[12] = e), se = k.some(e), n[8] = d.id, n[9] = k, n[10] = se;
|
|
851
|
+
} else se = n[10];
|
|
852
|
+
let ce = se, le = ee === d.id, V = i.pinnedAt, ue;
|
|
853
|
+
n[13] !== d || n[14] !== u ? (ue = Je(d, u), n[13] = d, n[14] = u, n[15] = ue) : ue = n[15];
|
|
854
|
+
let de = ue, H = R && de.canSort, pe = R && de.canFilter, me = R && de.canHide, he = R && de.canPin, U = de.canResize, W = R && de.canReorder, ge;
|
|
855
|
+
n[16] !== u || n[17] !== R || n[18] !== l ? (ge = R && Ye(l, u).canHideAny, n[16] = u, n[17] = R, n[18] = l, n[19] = ge) : ge = n[19];
|
|
856
|
+
let _e = ge, ve = F === d.id, ye;
|
|
857
|
+
n[20] !== W || n[21] !== d.id || n[22] !== P || n[23] !== F || n[24] !== ve ? (ye = W && F !== null && !ve && Xe(P, F) === Xe(P, d.id), n[20] = W, n[21] = d.id, n[22] = P, n[23] = F, n[24] = ve, n[25] = ye) : ye = n[25];
|
|
858
|
+
let K = ye, xe;
|
|
859
|
+
n[26] !== c.ui || n[27] !== d.id ? (xe = function(e) {
|
|
860
|
+
e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", d.id), c.ui.actions.startColumnDrag(d.id);
|
|
861
|
+
}, n[26] = c.ui, n[27] = d.id, n[28] = xe) : xe = n[28];
|
|
862
|
+
let Ce = xe, Te;
|
|
863
|
+
n[29] === K ? Te = n[30] : (Te = function(e) {
|
|
864
|
+
if (!K) return;
|
|
865
|
+
e.preventDefault(), e.dataTransfer.dropEffect = "move";
|
|
866
|
+
let t = _.current?.getBoundingClientRect();
|
|
867
|
+
t && g(e.clientX < t.left + t.width / 2 ? "before" : "after");
|
|
868
|
+
}, n[29] = K, n[30] = Te);
|
|
869
|
+
let Ee = Te, De;
|
|
870
|
+
n[31] === Symbol.for("react.memo_cache_sentinel") ? (De = function(e) {
|
|
871
|
+
let t = e.relatedTarget;
|
|
872
|
+
t instanceof Node && e.currentTarget.contains(t) || g(null);
|
|
873
|
+
}, n[31] = De) : De = n[31];
|
|
874
|
+
let Oe = De, ke;
|
|
875
|
+
n[32] !== c.ui || n[33] !== d.id || n[34] !== F || n[35] !== h || n[36] !== K || n[37] !== l ? (ke = function(e) {
|
|
876
|
+
e.preventDefault(), g(null), c.ui.actions.endColumnDrag(), !(!K || !h || !F) && Qe({
|
|
877
|
+
table: l,
|
|
878
|
+
columnId: F,
|
|
879
|
+
targetId: d.id,
|
|
880
|
+
side: h
|
|
881
|
+
});
|
|
882
|
+
}, n[32] = c.ui, n[33] = d.id, n[34] = F, n[35] = h, n[36] = K, n[37] = l, n[38] = ke) : ke = n[38];
|
|
883
|
+
let Ae = ke, je;
|
|
884
|
+
n[39] === c.ui ? je = n[40] : (je = function() {
|
|
885
|
+
g(null), c.ui.actions.endColumnDrag();
|
|
886
|
+
}, n[39] = c.ui, n[40] = je);
|
|
887
|
+
let Me = je, Ne;
|
|
888
|
+
n[41] !== d || n[42] !== l ? (Ne = function(e) {
|
|
889
|
+
if (e && !(d.id in l.store.state.columnSizing)) {
|
|
890
|
+
let e = _.current?.getBoundingClientRect().width;
|
|
891
|
+
e && l.setColumnSizing((t) => ({
|
|
892
|
+
...t,
|
|
893
|
+
[d.id]: Math.round(e)
|
|
894
|
+
}));
|
|
895
|
+
}
|
|
896
|
+
d.pin(e);
|
|
897
|
+
}, n[41] = d, n[42] = l, n[43] = Ne) : Ne = n[43];
|
|
898
|
+
let J = Ne, Y;
|
|
899
|
+
if (n[44] !== c || n[45] !== pe || n[46] !== me || n[47] !== _e || n[48] !== he || n[49] !== W || n[50] !== H || n[51] !== d || n[52] !== V || n[53] !== J || n[54] !== l) {
|
|
900
|
+
if (Y = [], H) {
|
|
901
|
+
let e;
|
|
902
|
+
n[56] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ I(D, {
|
|
903
|
+
size: 16,
|
|
904
|
+
stroke: 1.6
|
|
905
|
+
}), n[56] = e) : e = n[56];
|
|
906
|
+
let t;
|
|
907
|
+
n[57] === d ? t = n[58] : (t = /* @__PURE__ */ I(f.Item, {
|
|
908
|
+
leftSection: e,
|
|
909
|
+
onClick: () => d.toggleSorting(!1),
|
|
910
|
+
children: "Sort by ASC"
|
|
911
|
+
}, "sort-asc"), n[57] = d, n[58] = t);
|
|
912
|
+
let r;
|
|
913
|
+
n[59] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ I(w, {
|
|
914
|
+
size: 16,
|
|
915
|
+
stroke: 1.6
|
|
916
|
+
}), n[59] = r) : r = n[59];
|
|
917
|
+
let i;
|
|
918
|
+
n[60] === d ? i = n[61] : (i = /* @__PURE__ */ I(f.Item, {
|
|
919
|
+
leftSection: r,
|
|
920
|
+
onClick: () => d.toggleSorting(!0),
|
|
921
|
+
children: "Sort by DESC"
|
|
922
|
+
}, "sort-desc"), n[60] = d, n[61] = i);
|
|
923
|
+
let a;
|
|
924
|
+
n[62] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ I(f.Divider, {}, "sort-divider"), n[62] = a) : a = n[62], Y.push(t, i, a);
|
|
925
|
+
}
|
|
926
|
+
if (pe) {
|
|
927
|
+
let e;
|
|
928
|
+
n[63] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ I(N, {
|
|
929
|
+
size: 16,
|
|
930
|
+
stroke: 1.6
|
|
931
|
+
}), n[63] = e) : e = n[63];
|
|
932
|
+
let t;
|
|
933
|
+
n[64] !== c || n[65] !== d.id ? (t = /* @__PURE__ */ I(f.Item, {
|
|
934
|
+
leftSection: e,
|
|
935
|
+
onClick: () => xt(c, d.id),
|
|
936
|
+
children: "Filter"
|
|
937
|
+
}, "filter"), n[64] = c, n[65] = d.id, n[66] = t) : t = n[66];
|
|
938
|
+
let r;
|
|
939
|
+
n[67] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ I(f.Divider, {}, "filter-divider"), n[67] = r) : r = n[67], Y.push(t, r);
|
|
940
|
+
}
|
|
941
|
+
if (he) {
|
|
942
|
+
let e = V === "left" ? G.menuItemActive : void 0, t;
|
|
943
|
+
n[68] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ I(S, {
|
|
944
|
+
size: 16,
|
|
945
|
+
stroke: 1.6
|
|
946
|
+
}), n[68] = t) : t = n[68];
|
|
947
|
+
let r;
|
|
948
|
+
n[69] !== V || n[70] !== J ? (r = () => J(V === "left" ? !1 : "left"), n[69] = V, n[70] = J, n[71] = r) : r = n[71];
|
|
949
|
+
let i;
|
|
950
|
+
n[72] !== e || n[73] !== r ? (i = /* @__PURE__ */ I(f.Item, {
|
|
951
|
+
className: e,
|
|
952
|
+
leftSection: t,
|
|
953
|
+
onClick: r,
|
|
954
|
+
children: "Pin to left"
|
|
955
|
+
}, "pin-left"), n[72] = e, n[73] = r, n[74] = i) : i = n[74];
|
|
956
|
+
let a = V === "right" ? G.menuItemActive : void 0, o;
|
|
957
|
+
n[75] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ I(C, {
|
|
958
|
+
size: 16,
|
|
959
|
+
stroke: 1.6
|
|
960
|
+
}), n[75] = o) : o = n[75];
|
|
961
|
+
let s;
|
|
962
|
+
n[76] !== V || n[77] !== J ? (s = () => J(V === "right" ? !1 : "right"), n[76] = V, n[77] = J, n[78] = s) : s = n[78];
|
|
963
|
+
let c;
|
|
964
|
+
if (n[79] !== a || n[80] !== s ? (c = /* @__PURE__ */ I(f.Item, {
|
|
965
|
+
className: a,
|
|
966
|
+
leftSection: o,
|
|
967
|
+
onClick: s,
|
|
968
|
+
children: "Pin to right"
|
|
969
|
+
}, "pin-right"), n[79] = a, n[80] = s, n[81] = c) : c = n[81], Y.push(i, c), V) {
|
|
970
|
+
let e;
|
|
971
|
+
n[82] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ I(te, {
|
|
972
|
+
size: 16,
|
|
973
|
+
stroke: 1.6
|
|
974
|
+
}), n[82] = e) : e = n[82];
|
|
975
|
+
let t;
|
|
976
|
+
n[83] === J ? t = n[84] : (t = /* @__PURE__ */ I(f.Item, {
|
|
977
|
+
leftSection: e,
|
|
978
|
+
onClick: () => J(!1),
|
|
979
|
+
children: "Unpin"
|
|
980
|
+
}, "unpin"), n[83] = J, n[84] = t), Y.push(t);
|
|
981
|
+
}
|
|
982
|
+
let l;
|
|
983
|
+
n[85] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ I(f.Divider, {}, "pin-divider"), n[85] = l) : l = n[85], Y.push(l);
|
|
984
|
+
}
|
|
985
|
+
if (W) {
|
|
986
|
+
let e;
|
|
987
|
+
n[86] !== d.id || n[87] !== l ? (e = et({
|
|
988
|
+
table: l,
|
|
989
|
+
columnId: d.id,
|
|
990
|
+
direction: -1
|
|
991
|
+
}), n[86] = d.id, n[87] = l, n[88] = e) : e = n[88];
|
|
992
|
+
let t = e, r;
|
|
993
|
+
n[89] !== d.id || n[90] !== l ? (r = et({
|
|
994
|
+
table: l,
|
|
995
|
+
columnId: d.id,
|
|
996
|
+
direction: 1
|
|
997
|
+
}), n[89] = d.id, n[90] = l, n[91] = r) : r = n[91];
|
|
998
|
+
let i = r;
|
|
999
|
+
if (t || i) {
|
|
1000
|
+
let e = !t, r;
|
|
1001
|
+
n[92] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ I(T, {
|
|
1002
|
+
size: 16,
|
|
1003
|
+
stroke: 1.6
|
|
1004
|
+
}), n[92] = r) : r = n[92];
|
|
1005
|
+
let a;
|
|
1006
|
+
n[93] !== d.id || n[94] !== l ? (a = () => tt({
|
|
1007
|
+
table: l,
|
|
1008
|
+
columnId: d.id,
|
|
1009
|
+
direction: -1
|
|
1010
|
+
}), n[93] = d.id, n[94] = l, n[95] = a) : a = n[95];
|
|
1011
|
+
let o;
|
|
1012
|
+
n[96] !== e || n[97] !== a ? (o = /* @__PURE__ */ I(f.Item, {
|
|
1013
|
+
disabled: e,
|
|
1014
|
+
leftSection: r,
|
|
1015
|
+
onClick: a,
|
|
1016
|
+
children: "Move left"
|
|
1017
|
+
}, "move-left"), n[96] = e, n[97] = a, n[98] = o) : o = n[98];
|
|
1018
|
+
let s = !i, c;
|
|
1019
|
+
n[99] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ I(E, {
|
|
1020
|
+
size: 16,
|
|
1021
|
+
stroke: 1.6
|
|
1022
|
+
}), n[99] = c) : c = n[99];
|
|
1023
|
+
let u;
|
|
1024
|
+
n[100] !== d.id || n[101] !== l ? (u = () => tt({
|
|
1025
|
+
table: l,
|
|
1026
|
+
columnId: d.id,
|
|
1027
|
+
direction: 1
|
|
1028
|
+
}), n[100] = d.id, n[101] = l, n[102] = u) : u = n[102];
|
|
1029
|
+
let p;
|
|
1030
|
+
n[103] !== s || n[104] !== u ? (p = /* @__PURE__ */ I(f.Item, {
|
|
1031
|
+
disabled: s,
|
|
1032
|
+
leftSection: c,
|
|
1033
|
+
onClick: u,
|
|
1034
|
+
children: "Move right"
|
|
1035
|
+
}, "move-right"), n[103] = s, n[104] = u, n[105] = p) : p = n[105];
|
|
1036
|
+
let m;
|
|
1037
|
+
n[106] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ I(f.Divider, {}, "move-divider"), n[106] = m) : m = n[106], Y.push(o, p, m);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
if (me) {
|
|
1041
|
+
let e;
|
|
1042
|
+
n[107] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ I(M, {
|
|
1043
|
+
size: 16,
|
|
1044
|
+
stroke: 1.6
|
|
1045
|
+
}), n[107] = e) : e = n[107];
|
|
1046
|
+
let t;
|
|
1047
|
+
n[108] === d ? t = n[109] : (t = /* @__PURE__ */ I(f.Item, {
|
|
1048
|
+
leftSection: e,
|
|
1049
|
+
onClick: () => d.toggleVisibility(!1),
|
|
1050
|
+
children: "Hide column"
|
|
1051
|
+
}, "hide"), n[108] = d, n[109] = t), Y.push(t);
|
|
1052
|
+
}
|
|
1053
|
+
if (_e) {
|
|
1054
|
+
let e;
|
|
1055
|
+
n[110] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ I(A, {
|
|
1056
|
+
size: 16,
|
|
1057
|
+
stroke: 1.6
|
|
1058
|
+
}), n[110] = e) : e = n[110];
|
|
1059
|
+
let t;
|
|
1060
|
+
n[111] === c.ui.actions ? t = n[112] : (t = /* @__PURE__ */ I(f.Item, {
|
|
1061
|
+
leftSection: e,
|
|
1062
|
+
onClick: () => c.ui.actions.setColumnsPanelOpen(!0),
|
|
1063
|
+
children: "Manage columns"
|
|
1064
|
+
}, "manage"), n[111] = c.ui.actions, n[112] = t), Y.push(t);
|
|
1065
|
+
}
|
|
1066
|
+
for (; Y.length > 0 && Ot(Y.at(-1));) Y.pop();
|
|
1067
|
+
n[44] = c, n[45] = pe, n[46] = me, n[47] = _e, n[48] = he, n[49] = W, n[50] = H, n[51] = d, n[52] = V, n[53] = J, n[54] = l, n[55] = Y;
|
|
1068
|
+
} else Y = n[55];
|
|
1069
|
+
let Pe = H ? G.headerCellSortable : "", Ie = ve ? G.headerCellDragging : "", Le = h === "before" ? G.headerCellDropBefore : "", Re = h === "after" ? G.headerCellDropAfter : "", ze = i.isBoundary && V === "left" ? G.stickyLeft : "", Be = i.isBoundary && V === "right" ? G.stickyRight : "", Ve;
|
|
1070
|
+
n[113] !== Pe || n[114] !== Ie || n[115] !== Le || n[116] !== Re || n[117] !== ze || n[118] !== Be ? (Ve = [
|
|
1071
|
+
G.headerCell,
|
|
1072
|
+
Pe,
|
|
1073
|
+
Ie,
|
|
1074
|
+
Le,
|
|
1075
|
+
Re,
|
|
1076
|
+
ze,
|
|
1077
|
+
Be
|
|
1078
|
+
].filter(Boolean), n[113] = Pe, n[114] = Ie, n[115] = Le, n[116] = Re, n[117] = ze, n[118] = Be, n[119] = Ve) : Ve = n[119];
|
|
1079
|
+
let He = Ve.join(" "), Ue = `dg-header-${d.id}`, We = oe || ce, Ge = W && !le, Ke = W ? Ce : void 0, qe = W ? Me : void 0, Ze = K ? Ee : void 0, $e = K ? Oe : void 0, nt = K ? Ae : void 0, rt = V === "left" ? i.offset : void 0, it = V === "right" ? i.offset : void 0, at = V ? "sticky" : void 0, ot = V ? 4 : void 0, X;
|
|
1080
|
+
n[120] !== rt || n[121] !== it || n[122] !== at || n[123] !== ot ? (X = {
|
|
1081
|
+
left: rt,
|
|
1082
|
+
right: it,
|
|
1083
|
+
position: at,
|
|
1084
|
+
zIndex: ot
|
|
1085
|
+
}, n[120] = rt, n[121] = it, n[122] = at, n[123] = ot, n[124] = X) : X = n[124];
|
|
1086
|
+
let Z;
|
|
1087
|
+
n[125] !== H || n[126] !== d ? (Z = H ? (e) => {
|
|
1088
|
+
if (v.current) {
|
|
1089
|
+
v.current = !1;
|
|
1090
|
+
return;
|
|
1091
|
+
}
|
|
1092
|
+
d.getToggleSortingHandler()?.(e);
|
|
1093
|
+
} : void 0, n[125] = H, n[126] = d, n[127] = Z) : Z = n[127];
|
|
1094
|
+
let st;
|
|
1095
|
+
n[128] !== d.columnDef || n[129] !== r || n[130] !== R || n[131] !== B ? (st = r.isPlaceholder ? null : /* @__PURE__ */ I(y, {
|
|
1096
|
+
label: B,
|
|
1097
|
+
openDelay: 600,
|
|
1098
|
+
withinPortal: !0,
|
|
1099
|
+
disabled: !R,
|
|
1100
|
+
children: /* @__PURE__ */ I("span", {
|
|
1101
|
+
className: G.headerTitle,
|
|
1102
|
+
children: fe(d.columnDef.header, r.getContext())
|
|
1103
|
+
})
|
|
1104
|
+
}), n[128] = d.columnDef, n[129] = r, n[130] = R, n[131] = B, n[132] = st) : st = n[132];
|
|
1105
|
+
let ct;
|
|
1106
|
+
n[133] !== c || n[134] !== H || n[135] !== d || n[136] !== ce || n[137] !== R || n[138] !== oe || n[139] !== B || n[140] !== Y || n[141] !== p || n[142] !== ae ? (ct = R && /* @__PURE__ */ L("div", {
|
|
1107
|
+
className: G.headerActions,
|
|
1108
|
+
children: [
|
|
1109
|
+
ce && /* @__PURE__ */ I(s, {
|
|
1110
|
+
className: G.headerAction,
|
|
1111
|
+
"data-pinned-visible": "true",
|
|
1112
|
+
variant: "subtle",
|
|
1113
|
+
color: "gray",
|
|
1114
|
+
size: "xs",
|
|
1115
|
+
"aria-label": `Filter on ${B}`,
|
|
1116
|
+
onClick: (e) => {
|
|
1117
|
+
e.stopPropagation(), xt(c, d.id);
|
|
1118
|
+
},
|
|
1119
|
+
children: /* @__PURE__ */ I(N, {
|
|
1120
|
+
size: 14,
|
|
1121
|
+
stroke: 1.6
|
|
1122
|
+
})
|
|
1123
|
+
}),
|
|
1124
|
+
H && /* @__PURE__ */ I(s, {
|
|
1125
|
+
className: G.headerAction,
|
|
1126
|
+
"data-pinned-visible": oe,
|
|
1127
|
+
variant: "subtle",
|
|
1128
|
+
color: "gray",
|
|
1129
|
+
size: "xs",
|
|
1130
|
+
"aria-label": `Sort ${B}`,
|
|
1131
|
+
onClick: d.getToggleSortingHandler(),
|
|
1132
|
+
children: I(ae ? w : D, {
|
|
1133
|
+
size: 14,
|
|
1134
|
+
stroke: 1.6
|
|
1135
|
+
})
|
|
1136
|
+
}),
|
|
1137
|
+
Y.length > 0 && d.id !== "__select__" && /* @__PURE__ */ L(f, {
|
|
1138
|
+
opened: p,
|
|
1139
|
+
onChange: m,
|
|
1140
|
+
position: "bottom-start",
|
|
1141
|
+
shadow: "md",
|
|
1142
|
+
width: 220,
|
|
1143
|
+
withinPortal: !0,
|
|
1144
|
+
children: [/* @__PURE__ */ I(f.Target, { children: /* @__PURE__ */ I(s, {
|
|
1145
|
+
className: G.headerAction,
|
|
1146
|
+
"data-pinned-visible": p,
|
|
1147
|
+
variant: "subtle",
|
|
1148
|
+
color: "gray",
|
|
1149
|
+
size: "xs",
|
|
1150
|
+
"aria-label": `${B} column menu`,
|
|
1151
|
+
onClick: (e) => {
|
|
1152
|
+
e.stopPropagation(), m(Tt);
|
|
1153
|
+
},
|
|
1154
|
+
children: /* @__PURE__ */ I(j, {
|
|
1155
|
+
size: 14,
|
|
1156
|
+
stroke: 1.6
|
|
1157
|
+
})
|
|
1158
|
+
}) }), /* @__PURE__ */ I(f.Dropdown, {
|
|
1159
|
+
onClick: wt,
|
|
1160
|
+
children: Y
|
|
1161
|
+
})]
|
|
1162
|
+
})
|
|
1163
|
+
]
|
|
1164
|
+
}), n[133] = c, n[134] = H, n[135] = d, n[136] = ce, n[137] = R, n[138] = oe, n[139] = B, n[140] = Y, n[141] = p, n[142] = ae, n[143] = ct) : ct = n[143];
|
|
1165
|
+
let lt = U ? G.columnSeparatorResizable : "", ut = le ? G.columnSeparatorActive : "", dt;
|
|
1166
|
+
n[144] !== lt || n[145] !== ut ? (dt = [
|
|
1167
|
+
G.columnSeparator,
|
|
1168
|
+
lt,
|
|
1169
|
+
ut
|
|
1170
|
+
].filter(Boolean), n[144] = lt, n[145] = ut, n[146] = dt) : dt = n[146];
|
|
1171
|
+
let ft = dt.join(" "), Q;
|
|
1172
|
+
n[147] !== U || n[148] !== r ? (Q = U ? (e) => {
|
|
1173
|
+
v.current = !0, r.getResizeHandler()(e);
|
|
1174
|
+
} : void 0, n[147] = U, n[148] = r, n[149] = Q) : Q = n[149];
|
|
1175
|
+
let pt;
|
|
1176
|
+
n[150] !== U || n[151] !== r ? (pt = U ? r.getResizeHandler() : void 0, n[150] = U, n[151] = r, n[152] = pt) : pt = n[152];
|
|
1177
|
+
let $;
|
|
1178
|
+
n[153] !== ft || n[154] !== Q || n[155] !== pt ? ($ = /* @__PURE__ */ I("div", {
|
|
1179
|
+
className: ft,
|
|
1180
|
+
draggable: !1,
|
|
1181
|
+
onMouseDown: Q,
|
|
1182
|
+
onTouchStart: pt,
|
|
1183
|
+
onClick: Ct
|
|
1184
|
+
}), n[153] = ft, n[154] = Q, n[155] = pt, n[156] = $) : $ = n[156];
|
|
1185
|
+
let mt;
|
|
1186
|
+
return n[157] !== re || n[158] !== He || n[159] !== Ue || n[160] !== We || n[161] !== Ge || n[162] !== Ke || n[163] !== qe || n[164] !== Ze || n[165] !== $e || n[166] !== nt || n[167] !== X || n[168] !== Z || n[169] !== st || n[170] !== ct || n[171] !== $ ? (mt = /* @__PURE__ */ L("div", {
|
|
1187
|
+
ref: _,
|
|
1188
|
+
role: "columnheader",
|
|
1189
|
+
"data-testid": Ue,
|
|
1190
|
+
"data-active": We,
|
|
1191
|
+
"data-align": re,
|
|
1192
|
+
className: He,
|
|
1193
|
+
draggable: Ge,
|
|
1194
|
+
onDragStart: Ke,
|
|
1195
|
+
onDragEnd: qe,
|
|
1196
|
+
onDragOver: Ze,
|
|
1197
|
+
onDragLeave: $e,
|
|
1198
|
+
onDrop: nt,
|
|
1199
|
+
style: X,
|
|
1200
|
+
onClick: Z,
|
|
1201
|
+
children: [
|
|
1202
|
+
st,
|
|
1203
|
+
ct,
|
|
1204
|
+
$
|
|
1205
|
+
]
|
|
1206
|
+
}), n[157] = re, n[158] = He, n[159] = Ue, n[160] = We, n[161] = Ge, n[162] = Ke, n[163] = qe, n[164] = Ze, n[165] = $e, n[166] = nt, n[167] = X, n[168] = Z, n[169] = st, n[170] = ct, n[171] = $, n[172] = mt) : mt = n[172], mt;
|
|
1207
|
+
}
|
|
1208
|
+
function Ct(e) {
|
|
1209
|
+
return e.stopPropagation();
|
|
1210
|
+
}
|
|
1211
|
+
function wt(e) {
|
|
1212
|
+
return e.stopPropagation();
|
|
1213
|
+
}
|
|
1214
|
+
function Tt(e) {
|
|
1215
|
+
return !e;
|
|
1216
|
+
}
|
|
1217
|
+
function Et(e) {
|
|
1218
|
+
return e.draggedColumnId;
|
|
1219
|
+
}
|
|
1220
|
+
function Dt(e) {
|
|
1221
|
+
return {
|
|
1222
|
+
sorting: e.sorting,
|
|
1223
|
+
columnFilters: e.columnFilters,
|
|
1224
|
+
resizingColumnId: e.columnResizing.isResizingColumn,
|
|
1225
|
+
columnPinning: e.columnPinning,
|
|
1226
|
+
columnOrder: e.columnOrder
|
|
1227
|
+
};
|
|
1228
|
+
}
|
|
1229
|
+
function Ot(e) {
|
|
1230
|
+
return typeof e == "object" && !!e && "type" in e && e.type === f.Divider;
|
|
1231
|
+
}
|
|
1232
|
+
//#endregion
|
|
1233
|
+
//#region src/tmdatagrid/TMDataGridTable.tsx
|
|
1234
|
+
var kt = {
|
|
1235
|
+
pinnedAt: !1,
|
|
1236
|
+
offset: 0,
|
|
1237
|
+
isBoundary: !1
|
|
1238
|
+
};
|
|
1239
|
+
function At(t) {
|
|
1240
|
+
let n = e(20), { cell: r, rowHeight: i, layout: a } = t, o;
|
|
1241
|
+
n[0] === r.column ? o = n[1] : (o = we(r.column), n[0] = r.column, n[1] = o);
|
|
1242
|
+
let s = a.isBoundary && a.pinnedAt === "left" ? G.stickyLeft : "", c = a.isBoundary && a.pinnedAt === "right" ? G.stickyRight : "", l;
|
|
1243
|
+
n[2] !== s || n[3] !== c ? (l = [
|
|
1244
|
+
G.bodyCell,
|
|
1245
|
+
s,
|
|
1246
|
+
c
|
|
1247
|
+
].filter(Boolean), n[2] = s, n[3] = c, n[4] = l) : l = n[4];
|
|
1248
|
+
let u = l.join(" "), d = a.pinnedAt === "left" ? a.offset : void 0, f = a.pinnedAt === "right" ? a.offset : void 0, p = a.pinnedAt ? "sticky" : void 0, m = a.pinnedAt ? 2 : void 0, h;
|
|
1249
|
+
n[5] !== i || n[6] !== d || n[7] !== f || n[8] !== p || n[9] !== m ? (h = {
|
|
1250
|
+
minHeight: i,
|
|
1251
|
+
left: d,
|
|
1252
|
+
right: f,
|
|
1253
|
+
position: p,
|
|
1254
|
+
zIndex: m
|
|
1255
|
+
}, n[5] = i, n[6] = d, n[7] = f, n[8] = p, n[9] = m, n[10] = h) : h = n[10];
|
|
1256
|
+
let g;
|
|
1257
|
+
n[11] === r ? g = n[12] : (g = fe(r.column.columnDef.cell, r.getContext()), n[11] = r, n[12] = g);
|
|
1258
|
+
let _;
|
|
1259
|
+
n[13] === g ? _ = n[14] : (_ = /* @__PURE__ */ I("span", {
|
|
1260
|
+
className: G.cellContent,
|
|
1261
|
+
children: g
|
|
1262
|
+
}), n[13] = g, n[14] = _);
|
|
1263
|
+
let v;
|
|
1264
|
+
return n[15] !== o || n[16] !== h || n[17] !== _ || n[18] !== u ? (v = /* @__PURE__ */ I("div", {
|
|
1265
|
+
role: "cell",
|
|
1266
|
+
"data-align": o,
|
|
1267
|
+
className: u,
|
|
1268
|
+
style: h,
|
|
1269
|
+
children: _
|
|
1270
|
+
}), n[15] = o, n[16] = h, n[17] = _, n[18] = u, n[19] = v) : v = n[19], v;
|
|
1271
|
+
}
|
|
1272
|
+
function jt({ onRowClick: e }) {
|
|
1273
|
+
let { table: t, rowHeight: r, controlSize: i } = q();
|
|
1274
|
+
x(t.store);
|
|
1275
|
+
let { loading: o, noResultsLabel: s = "No rows match your filters" } = t.options.meta ?? {}, c = a(null), l = t.getPaginatedRowModel().rows, u = ye({
|
|
1276
|
+
count: l.length,
|
|
1277
|
+
getScrollElement: () => c.current,
|
|
1278
|
+
estimateSize: n(() => r, [r]),
|
|
1279
|
+
getItemKey: n((e) => l[e]?.id ?? e, [l]),
|
|
1280
|
+
overscan: 6,
|
|
1281
|
+
initialRect: {
|
|
1282
|
+
height: 600,
|
|
1283
|
+
width: 1200
|
|
1284
|
+
}
|
|
1285
|
+
}), f = u.getVirtualItems(), p = f[0]?.start ?? 0, m = u.getTotalSize() - (f.at(-1)?.end ?? 0), h = t.getLeftLeafColumns(), g = t.getRightLeafColumns(), v = t.getCenterLeafColumns(), y = [
|
|
1286
|
+
...h,
|
|
1287
|
+
...v,
|
|
1288
|
+
...g
|
|
1289
|
+
], b = t.getCenterHeaderGroups(), S = t.getLeftHeaderGroups(), C = t.getRightHeaderGroups(), w = b.map((e, t) => ({
|
|
1290
|
+
id: e.id,
|
|
1291
|
+
headers: [
|
|
1292
|
+
...S[t]?.headers ?? [],
|
|
1293
|
+
...e.headers,
|
|
1294
|
+
...C[t]?.headers ?? []
|
|
1295
|
+
]
|
|
1296
|
+
})), T = t.store.state.columnSizing, E = y.map((e) => {
|
|
1297
|
+
let t = e.columnDef.minSize === e.columnDef.maxSize, n = e.id in T, r = e.getIsPinned() !== !1, i = e.columnDef.minSize ?? 80;
|
|
1298
|
+
return t || n || r ? {
|
|
1299
|
+
track: `${e.getSize()}px`,
|
|
1300
|
+
minWidth: e.getSize()
|
|
1301
|
+
} : {
|
|
1302
|
+
track: `minmax(${i}px, ${e.columnDef.meta?.flex ?? 1}fr)`,
|
|
1303
|
+
minWidth: i
|
|
1304
|
+
};
|
|
1305
|
+
}), D = E.map((e) => e.track).join(" "), O = E.reduce((e, t) => e + t.minWidth, 0), k = /* @__PURE__ */ new Map(), A = (e) => E[y.findIndex((t) => t.id === e)]?.minWidth ?? 0, j = 0;
|
|
1306
|
+
for (let e of h) k.set(e.id, {
|
|
1307
|
+
pinnedAt: "left",
|
|
1308
|
+
offset: j,
|
|
1309
|
+
isBoundary: e.id === h.at(-1)?.id
|
|
1310
|
+
}), j += A(e.id);
|
|
1311
|
+
let M = 0;
|
|
1312
|
+
for (let e of [...g].reverse()) k.set(e.id, {
|
|
1313
|
+
pinnedAt: "right",
|
|
1314
|
+
offset: M,
|
|
1315
|
+
isBoundary: e.id === g[0]?.id
|
|
1316
|
+
}), M += A(e.id);
|
|
1317
|
+
for (let e of v) k.set(e.id, {
|
|
1318
|
+
pinnedAt: !1,
|
|
1319
|
+
offset: 0,
|
|
1320
|
+
isBoundary: !1
|
|
1321
|
+
});
|
|
1322
|
+
let N = (e) => k.get(e) ?? kt, ee = l.length === 0;
|
|
1323
|
+
return /* @__PURE__ */ L("div", {
|
|
1324
|
+
className: G.tableWrapper,
|
|
1325
|
+
children: [/* @__PURE__ */ I("div", {
|
|
1326
|
+
ref: c,
|
|
1327
|
+
className: G.scrollContainer,
|
|
1328
|
+
children: /* @__PURE__ */ L("div", {
|
|
1329
|
+
role: "table",
|
|
1330
|
+
className: G.grid,
|
|
1331
|
+
style: {
|
|
1332
|
+
gridTemplateColumns: D,
|
|
1333
|
+
minWidth: O
|
|
1334
|
+
},
|
|
1335
|
+
children: [
|
|
1336
|
+
/* @__PURE__ */ I("div", {
|
|
1337
|
+
role: "rowgroup",
|
|
1338
|
+
style: { display: "contents" },
|
|
1339
|
+
children: w.map((e) => /* @__PURE__ */ I("div", {
|
|
1340
|
+
role: "row",
|
|
1341
|
+
className: G.headerRow,
|
|
1342
|
+
children: e.headers.map((e) => /* @__PURE__ */ I(St, {
|
|
1343
|
+
header: e,
|
|
1344
|
+
layout: N(e.column.id)
|
|
1345
|
+
}, e.id))
|
|
1346
|
+
}, e.id))
|
|
1347
|
+
}),
|
|
1348
|
+
p > 0 && /* @__PURE__ */ I("div", {
|
|
1349
|
+
"aria-hidden": !0,
|
|
1350
|
+
style: {
|
|
1351
|
+
gridColumn: "1/-1",
|
|
1352
|
+
height: p
|
|
1353
|
+
}
|
|
1354
|
+
}),
|
|
1355
|
+
/* @__PURE__ */ I("div", {
|
|
1356
|
+
role: "rowgroup",
|
|
1357
|
+
style: { display: "contents" },
|
|
1358
|
+
children: f.map((t) => {
|
|
1359
|
+
let n = l[t.index];
|
|
1360
|
+
return n ? /* @__PURE__ */ I("div", {
|
|
1361
|
+
role: "row",
|
|
1362
|
+
"data-testid": `dg-row-${n.id}`,
|
|
1363
|
+
"data-selected": n.getIsSelected(),
|
|
1364
|
+
className: G.bodyRow,
|
|
1365
|
+
style: {
|
|
1366
|
+
minHeight: r,
|
|
1367
|
+
cursor: e ? "pointer" : void 0
|
|
1368
|
+
},
|
|
1369
|
+
onClick: e ? () => e(n) : void 0,
|
|
1370
|
+
children: [
|
|
1371
|
+
...n.getLeftVisibleCells(),
|
|
1372
|
+
...n.getCenterVisibleCells(),
|
|
1373
|
+
...n.getRightVisibleCells()
|
|
1374
|
+
].map((e) => /* @__PURE__ */ I(At, {
|
|
1375
|
+
cell: e,
|
|
1376
|
+
rowHeight: r,
|
|
1377
|
+
layout: N(e.column.id)
|
|
1378
|
+
}, e.id))
|
|
1379
|
+
}, t.key) : null;
|
|
1380
|
+
})
|
|
1381
|
+
}),
|
|
1382
|
+
ee && o === !0 && /* @__PURE__ */ I("div", {
|
|
1383
|
+
role: "row",
|
|
1384
|
+
className: G.messageRow,
|
|
1385
|
+
children: /* @__PURE__ */ I(d, { size: "lg" })
|
|
1386
|
+
}),
|
|
1387
|
+
ee && o !== !0 && /* @__PURE__ */ L("div", {
|
|
1388
|
+
role: "row",
|
|
1389
|
+
className: G.messageRow,
|
|
1390
|
+
children: [/* @__PURE__ */ I(P, {
|
|
1391
|
+
size: 40,
|
|
1392
|
+
stroke: 1.4,
|
|
1393
|
+
opacity: .4
|
|
1394
|
+
}), /* @__PURE__ */ I(_, {
|
|
1395
|
+
size: i,
|
|
1396
|
+
c: "dimmed",
|
|
1397
|
+
children: s
|
|
1398
|
+
})]
|
|
1399
|
+
}),
|
|
1400
|
+
m > 0 && /* @__PURE__ */ I("div", {
|
|
1401
|
+
"aria-hidden": !0,
|
|
1402
|
+
style: {
|
|
1403
|
+
gridColumn: "1/-1",
|
|
1404
|
+
height: m
|
|
1405
|
+
}
|
|
1406
|
+
})
|
|
1407
|
+
]
|
|
1408
|
+
})
|
|
1409
|
+
}), /* @__PURE__ */ I(Be, {})]
|
|
1410
|
+
});
|
|
1411
|
+
}
|
|
1412
|
+
//#endregion
|
|
1413
|
+
//#region src/tmdatagrid/TMDataGridToolbar.tsx
|
|
1414
|
+
function Mt(t) {
|
|
1415
|
+
let n = e(2), { children: r } = t, i;
|
|
1416
|
+
return n[0] === r ? i = n[1] : (i = /* @__PURE__ */ I("div", {
|
|
1417
|
+
className: G.toolbar,
|
|
1418
|
+
children: r
|
|
1419
|
+
}), n[0] = r, n[1] = i), i;
|
|
1420
|
+
}
|
|
1421
|
+
function Nt() {
|
|
1422
|
+
let t = e(1), n;
|
|
1423
|
+
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ I("div", { className: G.toolbarSpacer }), t[0] = n) : n = t[0], n;
|
|
1424
|
+
}
|
|
1425
|
+
function Pt(t) {
|
|
1426
|
+
let n = e(11), { children: r } = t, { table: i, controlSize: a } = q();
|
|
1427
|
+
if (x(i.store), r !== void 0) {
|
|
1428
|
+
let e;
|
|
1429
|
+
return n[0] !== r || n[1] !== a ? (e = /* @__PURE__ */ I(_, {
|
|
1430
|
+
size: a,
|
|
1431
|
+
c: "dimmed",
|
|
1432
|
+
children: r
|
|
1433
|
+
}), n[0] = r, n[1] = a, n[2] = e) : e = n[2], e;
|
|
1434
|
+
}
|
|
1435
|
+
let o;
|
|
1436
|
+
n[3] === i ? o = n[4] : (o = i.getRowCount(), n[3] = i, n[4] = o);
|
|
1437
|
+
let s = o, c;
|
|
1438
|
+
n[5] === i ? c = n[6] : (c = i.options.meta?.totalRowCount ?? i.getPreFilteredRowModel().rows.length, n[5] = i, n[6] = c);
|
|
1439
|
+
let l = c, u;
|
|
1440
|
+
return n[7] !== a || n[8] !== s || n[9] !== l ? (u = /* @__PURE__ */ L(_, {
|
|
1441
|
+
size: a,
|
|
1442
|
+
c: "dimmed",
|
|
1443
|
+
children: [
|
|
1444
|
+
s,
|
|
1445
|
+
" / ",
|
|
1446
|
+
l
|
|
1447
|
+
]
|
|
1448
|
+
}), n[7] = a, n[8] = s, n[9] = l, n[10] = u) : u = n[10], u;
|
|
1449
|
+
}
|
|
1450
|
+
function Ft() {
|
|
1451
|
+
let t = e(9), { table: n, ui: r, features: i, controlSize: a } = q(), o = x(r, It);
|
|
1452
|
+
if (!Ye(n, i).canHideAny) return null;
|
|
1453
|
+
let c;
|
|
1454
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ I(ee, {
|
|
1455
|
+
size: 18,
|
|
1456
|
+
stroke: 1.6
|
|
1457
|
+
}), t[0] = c) : c = t[0];
|
|
1458
|
+
let l;
|
|
1459
|
+
t[1] !== a || t[2] !== r.actions.toggleColumnsPanel ? (l = /* @__PURE__ */ I(p.Target, { children: /* @__PURE__ */ I(y, {
|
|
1460
|
+
label: "Manage columns",
|
|
1461
|
+
openDelay: 400,
|
|
1462
|
+
children: /* @__PURE__ */ I(s, {
|
|
1463
|
+
variant: "subtle",
|
|
1464
|
+
color: "gray",
|
|
1465
|
+
size: a,
|
|
1466
|
+
"aria-label": "Manage columns",
|
|
1467
|
+
onClick: r.actions.toggleColumnsPanel,
|
|
1468
|
+
children: c
|
|
1469
|
+
})
|
|
1470
|
+
}) }), t[1] = a, t[2] = r.actions.toggleColumnsPanel, t[3] = l) : l = t[3];
|
|
1471
|
+
let u;
|
|
1472
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ I(p.Dropdown, {
|
|
1473
|
+
p: 0,
|
|
1474
|
+
children: /* @__PURE__ */ I(Ee, {})
|
|
1475
|
+
}), t[4] = u) : u = t[4];
|
|
1476
|
+
let d;
|
|
1477
|
+
return t[5] !== o || t[6] !== l || t[7] !== r.actions.setColumnsPanelOpen ? (d = /* @__PURE__ */ L(p, {
|
|
1478
|
+
opened: o,
|
|
1479
|
+
onChange: r.actions.setColumnsPanelOpen,
|
|
1480
|
+
position: "bottom-end",
|
|
1481
|
+
shadow: "md",
|
|
1482
|
+
radius: "md",
|
|
1483
|
+
withinPortal: !0,
|
|
1484
|
+
trapFocus: !0,
|
|
1485
|
+
children: [l, u]
|
|
1486
|
+
}), t[5] = o, t[6] = l, t[7] = r.actions.setColumnsPanelOpen, t[8] = d) : d = t[8], d;
|
|
1487
|
+
}
|
|
1488
|
+
function It(e) {
|
|
1489
|
+
return e.columnsPanelOpen;
|
|
1490
|
+
}
|
|
1491
|
+
function Lt() {
|
|
1492
|
+
let t = e(11), n = q(), { table: r, ui: i, features: a, controlSize: o } = n, c = x(i, Vt), l = x(r.store, Bt).filter(zt).length;
|
|
1493
|
+
if (!Ye(r, a).canFilterAny) return null;
|
|
1494
|
+
let u = c || l > 0 ? "light" : "subtle", d = l > 0 ? void 0 : "gray", f;
|
|
1495
|
+
t[0] !== n || t[1] !== c || t[2] !== r || t[3] !== i ? (f = () => {
|
|
1496
|
+
if (c) {
|
|
1497
|
+
i.actions.closeFilterPanel();
|
|
1498
|
+
return;
|
|
1499
|
+
}
|
|
1500
|
+
let e = r.getAllLeafColumns().find(Rt);
|
|
1501
|
+
e ? xt(n, e.id) : i.actions.openFilterPanel();
|
|
1502
|
+
}, t[0] = n, t[1] = c, t[2] = r, t[3] = i, t[4] = f) : f = t[4];
|
|
1503
|
+
let p;
|
|
1504
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ I(N, {
|
|
1505
|
+
size: 16,
|
|
1506
|
+
stroke: 1.6
|
|
1507
|
+
}), t[5] = p) : p = t[5];
|
|
1508
|
+
let m;
|
|
1509
|
+
return t[6] !== o || t[7] !== u || t[8] !== d || t[9] !== f ? (m = /* @__PURE__ */ I(y, {
|
|
1510
|
+
label: "Filters",
|
|
1511
|
+
openDelay: 400,
|
|
1512
|
+
children: /* @__PURE__ */ I(s, {
|
|
1513
|
+
variant: u,
|
|
1514
|
+
color: d,
|
|
1515
|
+
size: o,
|
|
1516
|
+
"aria-label": "Filters",
|
|
1517
|
+
onClick: f,
|
|
1518
|
+
children: p
|
|
1519
|
+
})
|
|
1520
|
+
}), t[6] = o, t[7] = u, t[8] = d, t[9] = f, t[10] = m) : m = t[10], m;
|
|
1521
|
+
}
|
|
1522
|
+
function Rt(e) {
|
|
1523
|
+
return e.getCanFilter();
|
|
1524
|
+
}
|
|
1525
|
+
function zt(e) {
|
|
1526
|
+
return Fe(e.value);
|
|
1527
|
+
}
|
|
1528
|
+
function Bt(e) {
|
|
1529
|
+
return e.columnFilters;
|
|
1530
|
+
}
|
|
1531
|
+
function Vt(e) {
|
|
1532
|
+
return e.filterPanelOpen;
|
|
1533
|
+
}
|
|
1534
|
+
//#endregion
|
|
1535
|
+
//#region src/tmdatagrid/sizes.ts
|
|
1536
|
+
var Ht = "md", Ut = {
|
|
1537
|
+
xs: 34,
|
|
1538
|
+
sm: 42,
|
|
1539
|
+
md: 52,
|
|
1540
|
+
lg: 62,
|
|
1541
|
+
xl: 72
|
|
1542
|
+
}, Wt = {
|
|
1543
|
+
xs: "xs",
|
|
1544
|
+
sm: "xs",
|
|
1545
|
+
md: "sm",
|
|
1546
|
+
lg: "sm",
|
|
1547
|
+
xl: "md"
|
|
1548
|
+
};
|
|
1549
|
+
//#endregion
|
|
1550
|
+
//#region src/tmdatagrid/TMDataGrid.tsx
|
|
1551
|
+
function Gt(t) {
|
|
1552
|
+
let n = e(17), { table: r, ui: i, features: a, size: o, children: s, className: c, style: l } = t, u = o === void 0 ? "md" : o, d = r.options.meta?.rowHeight ?? Ut[u], f = Wt[u], p;
|
|
1553
|
+
n[0] !== a || n[1] !== d || n[2] !== u || n[3] !== f || n[4] !== r || n[5] !== i ? (p = {
|
|
1554
|
+
table: r,
|
|
1555
|
+
ui: i,
|
|
1556
|
+
features: a,
|
|
1557
|
+
size: u,
|
|
1558
|
+
rowHeight: d,
|
|
1559
|
+
controlSize: f
|
|
1560
|
+
}, n[0] = a, n[1] = d, n[2] = u, n[3] = f, n[4] = r, n[5] = i, n[6] = p) : p = n[6];
|
|
1561
|
+
let m = p, h;
|
|
1562
|
+
n[7] === c ? h = n[8] : (h = [G.root, c].filter(Boolean), n[7] = c, n[8] = h);
|
|
1563
|
+
let g = h.join(" "), _;
|
|
1564
|
+
n[9] !== s || n[10] !== u || n[11] !== l || n[12] !== g ? (_ = /* @__PURE__ */ I("div", {
|
|
1565
|
+
"data-size": u,
|
|
1566
|
+
className: g,
|
|
1567
|
+
style: l,
|
|
1568
|
+
children: s
|
|
1569
|
+
}), n[9] = s, n[10] = u, n[11] = l, n[12] = g, n[13] = _) : _ = n[13];
|
|
1570
|
+
let v;
|
|
1571
|
+
return n[14] !== m || n[15] !== _ ? (v = /* @__PURE__ */ I(xe, {
|
|
1572
|
+
value: m,
|
|
1573
|
+
children: _
|
|
1574
|
+
}), n[14] = m, n[15] = _, n[16] = v) : v = n[16], v;
|
|
1575
|
+
}
|
|
1576
|
+
var Kt = Object.assign(Gt, {
|
|
1577
|
+
Toolbar: Mt,
|
|
1578
|
+
Spacer: Nt,
|
|
1579
|
+
SummaryCount: Pt,
|
|
1580
|
+
ColumnsButton: Ft,
|
|
1581
|
+
FilterButton: Lt,
|
|
1582
|
+
Table: jt,
|
|
1583
|
+
Footer: Ke,
|
|
1584
|
+
FilterPanel: Be,
|
|
1585
|
+
ColumnsPanel: Ee
|
|
1586
|
+
});
|
|
1587
|
+
//#endregion
|
|
1588
|
+
export { nt as DATA_STATE_SLICES, Ht as DEFAULT_TMDATAGRID_SIZE, ke as FILTER_OPERATOR_LABELS, ft as SELECT_COLUMN_ID, rt as SETTINGS_STATE_SLICES, Wt as SIZE_CONTROL_SIZE, Ut as SIZE_ROW_HEIGHT, Kt as TMDataGrid, pt as createTMDataGridColumnHelper, Je as getColumnCapabilities, Se as getColumnLabel, Xe as getColumnRegion, Ce as getColumnType, Ye as getGridCapabilities, et as getStepTargetColumn, Te as isColumnReorderable, Fe as isFilterActive, Qe as moveColumn, tt as moveColumnByStep, xt as openColumnFilter, qe as readFeatureFlags, Q as tmDataGridFeatures, ht as useTMDataGrid, q as useTMDataGridContext };
|
|
1589
|
+
|
|
1590
|
+
//# sourceMappingURL=index.js.map
|