@wirecore/wirelayer-react 0.1.1 → 0.2.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/chart/Chart.d.ts.map +1 -1
- package/dist/chart/ChartCanvas.d.ts.map +1 -1
- package/dist/chart/Sparkline.d.ts.map +1 -1
- package/dist/chart.js +27 -25
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +2 -2
- package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/LocaleProvider/LocaleProvider.d.ts +1 -1
- package/dist/components/LocaleProvider/LocaleProvider.d.ts.map +1 -1
- package/dist/data-table/DataTable.d.ts +12 -3
- package/dist/data-table/DataTable.d.ts.map +1 -1
- package/dist/data-table/ValueInput.d.ts.map +1 -1
- package/dist/data-table/features.d.ts +3 -0
- package/dist/data-table/features.d.ts.map +1 -1
- package/dist/data-table/index.d.ts +4 -1
- package/dist/data-table/index.d.ts.map +1 -1
- package/dist/data-table/inputs.d.ts +6 -0
- package/dist/data-table/inputs.d.ts.map +1 -0
- package/dist/data-table/types.d.ts +41 -2
- package/dist/data-table/types.d.ts.map +1 -1
- package/dist/data-table.js +1166 -1143
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +53 -57
- package/dist/locales/de.d.ts +2 -0
- package/dist/locales/de.d.ts.map +1 -0
- package/dist/locales/de.js +2 -0
- package/dist/virtual/index.d.ts +3 -0
- package/dist/virtual/index.d.ts.map +1 -1
- package/dist/virtual/virtual-rows.d.ts +4 -0
- package/dist/virtual/virtual-rows.d.ts.map +1 -0
- package/dist/virtual.js +124 -121
- package/package.json +3 -3
package/dist/data-table.js
CHANGED
|
@@ -7,109 +7,122 @@ import { n as f, t as ne } from "./Select-OHqjoGA4.js";
|
|
|
7
7
|
import { t as re } from "./Checkbox-osenM-vo.js";
|
|
8
8
|
import { t as ie } from "./Highlight-oUUddAvP.js";
|
|
9
9
|
import { t as ae } from "./CopyButton-D7RvAM3h.js";
|
|
10
|
-
import { EditHistory as p, aggregateValues as oe, applyPending as se, autoRowSpans as ce, changesByRow as le, clearTableState as ue, collectErrors as de, conditionFieldsFromColumns as fe, createDataController as pe, createDataController as me, createXlsx as he,
|
|
11
|
-
import { ArrowDown as
|
|
12
|
-
import { Fragment as
|
|
13
|
-
import { Fragment as
|
|
10
|
+
import { EditHistory as p, aggregateValues as oe, applyPending as se, autoRowSpans as ce, changesByRow as le, clearTableState as ue, collectErrors as de, conditionFieldsFromColumns as fe, createDataController as pe, createDataController as me, createXlsx as he, csvSeparator as ge, dataAnnouncement as _e, dataSourceToRows as ve, dataTable as ye, dataTableMatchModes as be, defineMatchMode as xe, downloadBytes as Se, downloadText as Ce, emptyConditionGroup as we, emptyFilterRule as Te, extendRange as Ee, findMatches as De, fitColumnWidth as Oe, gridFocusIn as ke, gridKeydown as Ae, groupedRowMove as je, historyKey as Me, idRange as Ne, inlineArrowStep as Pe, isActiveCondition as Fe, isActiveFilter as Ie, isRangeMatchMode as Le, listValueKey as Re, loadTableState as ze, locateTreeNode as Be, matchModeDefinition as Ve, matchModeLabel as He, matchModesFor as m, matchesColumnFilter as Ue, matchesCondition as We, matchesSearch as Ge, menu as Ke, moveColumnBlock as qe, moveItem as Je, moveTreeRow as Ye, nextSorting as Xe, numberSummary as Ze, parseCellText as Qe, parseTsv as $e, pasteTargets as et, pendingValue as tt, pivotTable as nt, pivotView as rt, printHtml as it, printTableHtml as at, queryKey as ot, rangeAround as st, rangeBounds as ct, rowColumnSpans as lt, rowsToDataSource as ut, rowsToDataSource as dt, sameCellValue as ft, saveTableState as pt, syncGrid as mt, toCsv as ht, toFilterRule as gt, toTsv as _t, treeDropMove as vt, treeGridKeyAction as yt, treeKeyboardMove as bt, warnInDevelopment as xt } from "@wirecore/wirelayer-recipes";
|
|
11
|
+
import { ArrowDown as St, ArrowUp as Ct, ArrowUpDown as wt, Check as Tt, ChevronDown as Et, ChevronRight as Dt, ChevronUp as Ot, ChevronsDownUp as kt, ChevronsUpDown as At, Columns3 as jt, Download as Mt, EllipsisVertical as Nt, Filter as Pt, GripVertical as Ft, ListFilter as It, Maximize2 as Lt, Minimize2 as Rt, Pencil as zt, Plus as Bt, Redo2 as Vt, Rows3 as Ht, Search as Ut, TextSearch as Wt, Trash2 as Gt, Undo2 as Kt, X as qt } from "lucide-react";
|
|
12
|
+
import { Fragment as Jt, createContext as Yt, useContext as Xt, useEffect as h, useId as Zt, useImperativeHandle as Qt, useLayoutEffect as $t, useMemo as g, useRef as _, useState as v } from "react";
|
|
13
|
+
import { Fragment as en, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
14
14
|
import { Menu as x } from "@ark-ui/react/menu";
|
|
15
|
-
import { Portal as
|
|
16
|
-
import { Popover as
|
|
17
|
-
import { createPortal as
|
|
18
|
-
import { columnFilteringFeature as
|
|
19
|
-
import { useVirtualizer as Tn } from "@tanstack/react-virtual";
|
|
15
|
+
import { Portal as tn } from "@ark-ui/react/portal";
|
|
16
|
+
import { Popover as nn } from "@ark-ui/react/popover";
|
|
17
|
+
import { createPortal as rn } from "react-dom";
|
|
18
|
+
import { columnFilteringFeature as an, columnGroupingFeature as on, columnOrderingFeature as sn, columnPinningFeature as cn, columnResizingFeature as ln, columnSizingFeature as un, columnVisibilityFeature as dn, createExpandedRowModel as fn, createFilteredRowModel as pn, createGroupedRowModel as mn, createPaginatedRowModel as hn, createSortedRowModel as gn, filterFn_equalsString as _n, filterFn_includesString as vn, globalFilteringFeature as yn, rowExpandingFeature as bn, rowPaginationFeature as xn, rowPinningFeature as Sn, rowSelectionFeature as Cn, rowSortingFeature as wn, sortFn_alphanumeric as Tn, tableFeatures as En, useTable as Dn } from "@tanstack/react-table";
|
|
20
19
|
//#region src/data-table/features.ts
|
|
21
|
-
var
|
|
22
|
-
rowSortingFeature:
|
|
23
|
-
sortedRowModel:
|
|
24
|
-
sortFns: { alphanumeric:
|
|
25
|
-
rowPaginationFeature:
|
|
26
|
-
paginatedRowModel:
|
|
27
|
-
rowSelectionFeature:
|
|
28
|
-
rowPinningFeature:
|
|
29
|
-
rowExpandingFeature:
|
|
30
|
-
expandedRowModel:
|
|
31
|
-
columnGroupingFeature:
|
|
32
|
-
groupedRowModel:
|
|
33
|
-
columnFilteringFeature:
|
|
34
|
-
globalFilteringFeature:
|
|
35
|
-
filteredRowModel:
|
|
20
|
+
var On = En({
|
|
21
|
+
rowSortingFeature: wn,
|
|
22
|
+
sortedRowModel: gn(),
|
|
23
|
+
sortFns: { alphanumeric: Tn },
|
|
24
|
+
rowPaginationFeature: xn,
|
|
25
|
+
paginatedRowModel: hn(),
|
|
26
|
+
rowSelectionFeature: Cn,
|
|
27
|
+
rowPinningFeature: Sn,
|
|
28
|
+
rowExpandingFeature: bn,
|
|
29
|
+
expandedRowModel: fn(),
|
|
30
|
+
columnGroupingFeature: on,
|
|
31
|
+
groupedRowModel: mn(),
|
|
32
|
+
columnFilteringFeature: an,
|
|
33
|
+
globalFilteringFeature: yn,
|
|
34
|
+
filteredRowModel: pn(),
|
|
36
35
|
filterFns: {
|
|
37
|
-
includesString:
|
|
38
|
-
equalsString:
|
|
36
|
+
includesString: vn,
|
|
37
|
+
equalsString: _n
|
|
39
38
|
},
|
|
40
|
-
columnVisibilityFeature:
|
|
41
|
-
columnOrderingFeature:
|
|
42
|
-
columnPinningFeature:
|
|
43
|
-
columnSizingFeature:
|
|
44
|
-
columnResizingFeature:
|
|
45
|
-
});
|
|
39
|
+
columnVisibilityFeature: dn,
|
|
40
|
+
columnOrderingFeature: sn,
|
|
41
|
+
columnPinningFeature: cn,
|
|
42
|
+
columnSizingFeature: un,
|
|
43
|
+
columnResizingFeature: ln
|
|
44
|
+
}), kn = Yt({});
|
|
46
45
|
//#endregion
|
|
47
46
|
//#region src/data-table/ValueInput.tsx
|
|
48
|
-
function
|
|
49
|
-
let
|
|
47
|
+
function An({ type: t, value: n, onChange: r, label: i, options: a, any: o = !1, invalid: c }) {
|
|
48
|
+
let te = e(), l = te.dataTable, { dateInput: u, numberInput: f } = Xt(kn), ie = (a ?? []).some((e) => typeof e != "string"), ae = [...o ? [{
|
|
50
49
|
value: "",
|
|
51
|
-
label:
|
|
50
|
+
label: l.filterAll
|
|
52
51
|
}] : [], ...t === "boolean" ? [{
|
|
53
52
|
value: "true",
|
|
54
|
-
label:
|
|
53
|
+
label: l.yes
|
|
55
54
|
}, {
|
|
56
55
|
value: "false",
|
|
57
|
-
label:
|
|
58
|
-
}] : (
|
|
56
|
+
label: l.no
|
|
57
|
+
}] : (a ?? []).map((e) => typeof e == "string" ? {
|
|
59
58
|
value: e,
|
|
60
59
|
label: e
|
|
61
60
|
} : e)], p = n == null ? "" : String(n);
|
|
62
61
|
return t === "text" ? /* @__PURE__ */ y(d, {
|
|
63
62
|
size: "sm",
|
|
64
63
|
"aria-label": i,
|
|
65
|
-
invalid:
|
|
64
|
+
invalid: c,
|
|
66
65
|
value: p,
|
|
67
66
|
onChange: (e) => r(e.target.value)
|
|
68
67
|
}) : t === "textarea" ? /* @__PURE__ */ y(ee, {
|
|
69
68
|
size: "sm",
|
|
70
69
|
autoResize: !0,
|
|
71
70
|
"aria-label": i,
|
|
72
|
-
invalid:
|
|
71
|
+
invalid: c,
|
|
73
72
|
value: p,
|
|
74
73
|
onChange: (e) => r(e.target.value)
|
|
75
|
-
}) : t === "number" ? /* @__PURE__ */ y(
|
|
74
|
+
}) : t === "number" && f ? /* @__PURE__ */ y(f, {
|
|
76
75
|
size: "sm",
|
|
77
76
|
"aria-label": i,
|
|
78
|
-
invalid:
|
|
77
|
+
invalid: c,
|
|
79
78
|
value: typeof n == "number" ? n : null,
|
|
80
79
|
onValueChange: r
|
|
81
|
-
}) : t === "
|
|
80
|
+
}) : t === "number" ? /* @__PURE__ */ y(d, {
|
|
81
|
+
type: "number",
|
|
82
|
+
size: "sm",
|
|
83
|
+
"aria-label": i,
|
|
84
|
+
invalid: c,
|
|
85
|
+
value: typeof n == "number" ? String(n) : "",
|
|
86
|
+
onChange: ({ target: e }) => r(e.value && Number.isFinite(Number(e.value)) ? Number(e.value) : null)
|
|
87
|
+
}) : (t === "date" || t === "datetime") && u ? /* @__PURE__ */ y(u, {
|
|
82
88
|
"aria-label": i,
|
|
83
|
-
invalid:
|
|
89
|
+
invalid: c,
|
|
84
90
|
withTime: t === "datetime",
|
|
85
91
|
value: p || null,
|
|
86
92
|
onValueChange: r
|
|
93
|
+
}) : t === "date" || t === "datetime" ? /* @__PURE__ */ y(d, {
|
|
94
|
+
type: t === "date" ? "date" : "datetime-local",
|
|
95
|
+
size: "sm",
|
|
96
|
+
"aria-label": i,
|
|
97
|
+
invalid: c,
|
|
98
|
+
value: p.slice(0, t === "date" ? 10 : 16),
|
|
99
|
+
onChange: ({ target: e }) => r(e.value || null)
|
|
87
100
|
}) : t === "multiSelect" ? /* @__PURE__ */ y(s, {
|
|
88
101
|
"aria-label": i,
|
|
89
102
|
items: ae,
|
|
90
|
-
invalid:
|
|
91
|
-
placeholder:
|
|
103
|
+
invalid: c,
|
|
104
|
+
placeholder: l.filterAll,
|
|
92
105
|
value: Array.isArray(n) ? n : [],
|
|
93
106
|
onValueChange: r
|
|
94
107
|
}) : t === "checkbox" ? /* @__PURE__ */ y(re, {
|
|
95
108
|
"aria-label": i,
|
|
96
|
-
invalid:
|
|
109
|
+
invalid: c,
|
|
97
110
|
checked: n === !0,
|
|
98
111
|
onCheckedChange: (e) => r(e === !0)
|
|
99
112
|
}) : /* @__PURE__ */ y(ne, {
|
|
100
113
|
"aria-label": i,
|
|
101
114
|
items: ae,
|
|
102
|
-
invalid:
|
|
103
|
-
placeholder:
|
|
104
|
-
value: ie ? n ?? (
|
|
115
|
+
invalid: c,
|
|
116
|
+
placeholder: te.common.placeholder,
|
|
117
|
+
value: ie ? n ?? (o ? "" : null) : p,
|
|
105
118
|
onValueChange: (e) => r(e ?? "")
|
|
106
119
|
});
|
|
107
120
|
}
|
|
108
121
|
//#endregion
|
|
109
122
|
//#region src/data-table/FilterMenu.tsx
|
|
110
|
-
function
|
|
111
|
-
let d = n("dataTable",
|
|
112
|
-
e && oe(structuredClone(
|
|
123
|
+
function jn({ header: r, type: i, value: a, onChange: o, options: s, matchModes: c, maxConstraints: ee, renderValue: te }) {
|
|
124
|
+
let d = n("dataTable", ye)(), f = e().dataTable, { locale: re } = t(), [ie, ae] = v(!1), [p, oe] = v(() => Te(i)), se = Ie(a), ce = m(i, c), le = (e) => Ve(e)?.input ?? i, ue = (e) => {
|
|
125
|
+
e && oe(structuredClone(gt(a ?? Te(i), i))), ae(e);
|
|
113
126
|
}, de = (e, t) => oe((n) => ({
|
|
114
127
|
...n,
|
|
115
128
|
constraints: n.constraints.map((n, r) => r === e ? {
|
|
@@ -117,18 +130,18 @@ function On({ header: r, type: i, value: a, onChange: o, options: s, matchModes:
|
|
|
117
130
|
...t
|
|
118
131
|
} : n)
|
|
119
132
|
})), fe = (e, t) => {
|
|
120
|
-
let n = p.constraints[e], r =
|
|
133
|
+
let n = p.constraints[e], r = Le(t) !== Le(n.matchMode);
|
|
121
134
|
de(e, r ? {
|
|
122
135
|
matchMode: t,
|
|
123
|
-
value:
|
|
136
|
+
value: Le(t) ? [null, null] : null
|
|
124
137
|
} : { matchMode: t });
|
|
125
138
|
}, pe = (e, t, n) => {
|
|
126
139
|
let r = p.constraints[e], i = Array.isArray(r.value) ? [...r.value] : [null, null];
|
|
127
140
|
i[t] = n, de(e, { value: i });
|
|
128
141
|
}, me = () => {
|
|
129
|
-
o(
|
|
142
|
+
o(Ie(p) ? structuredClone(p) : void 0), ae(!1);
|
|
130
143
|
};
|
|
131
|
-
return /* @__PURE__ */ b(
|
|
144
|
+
return /* @__PURE__ */ b(nn.Root, {
|
|
132
145
|
open: ie,
|
|
133
146
|
onOpenChange: (e) => ue(e.open),
|
|
134
147
|
positioning: {
|
|
@@ -137,15 +150,15 @@ function On({ header: r, type: i, value: a, onChange: o, options: s, matchModes:
|
|
|
137
150
|
},
|
|
138
151
|
lazyMount: !0,
|
|
139
152
|
unmountOnExit: !0,
|
|
140
|
-
children: [/* @__PURE__ */ y(
|
|
153
|
+
children: [/* @__PURE__ */ y(nn.Trigger, {
|
|
141
154
|
className: d.headButton(),
|
|
142
155
|
"aria-label": f.filterMenu(r, se),
|
|
143
156
|
"data-active": se || void 0,
|
|
144
|
-
children: /* @__PURE__ */ y(
|
|
157
|
+
children: /* @__PURE__ */ y(Pt, {
|
|
145
158
|
className: d.headButtonIcon(),
|
|
146
159
|
"aria-hidden": "true"
|
|
147
160
|
})
|
|
148
|
-
}), /* @__PURE__ */ y(
|
|
161
|
+
}), /* @__PURE__ */ y(tn, { children: /* @__PURE__ */ y(nn.Positioner, { children: /* @__PURE__ */ y(nn.Content, {
|
|
149
162
|
className: d.filterPanel(),
|
|
150
163
|
"aria-label": f.filterMenu(r, !1),
|
|
151
164
|
children: /* @__PURE__ */ b("form", {
|
|
@@ -178,12 +191,12 @@ function On({ header: r, type: i, value: a, onChange: o, options: s, matchModes:
|
|
|
178
191
|
"aria-label": f.matchMode(t),
|
|
179
192
|
items: ce.map((e) => ({
|
|
180
193
|
value: e,
|
|
181
|
-
label:
|
|
194
|
+
label: He(e, f.matchModes, re)
|
|
182
195
|
})),
|
|
183
196
|
value: e.matchMode,
|
|
184
197
|
onValueChange: (e) => fe(t, e ?? ce[0])
|
|
185
198
|
}), p.constraints.length > 1 && /* @__PURE__ */ y(u, {
|
|
186
|
-
icon:
|
|
199
|
+
icon: Gt,
|
|
187
200
|
label: f.removeRule(t),
|
|
188
201
|
variant: "text",
|
|
189
202
|
size: "sm",
|
|
@@ -195,22 +208,22 @@ function On({ header: r, type: i, value: a, onChange: o, options: s, matchModes:
|
|
|
195
208
|
}), te ? te({
|
|
196
209
|
value: e.value,
|
|
197
210
|
setValue: (e) => de(t, { value: e })
|
|
198
|
-
}) :
|
|
211
|
+
}) : Le(e.matchMode) ? /* @__PURE__ */ b("div", {
|
|
199
212
|
className: d.filterRange(),
|
|
200
|
-
children: [/* @__PURE__ */ y(
|
|
213
|
+
children: [/* @__PURE__ */ y(An, {
|
|
201
214
|
type: le(e.matchMode),
|
|
202
215
|
label: `${f.value(t)}, ${f.from}`,
|
|
203
216
|
options: s,
|
|
204
217
|
value: Array.isArray(e.value) ? e.value[0] : null,
|
|
205
218
|
onChange: (e) => pe(t, 0, e)
|
|
206
|
-
}), /* @__PURE__ */ y(
|
|
219
|
+
}), /* @__PURE__ */ y(An, {
|
|
207
220
|
type: le(e.matchMode),
|
|
208
221
|
label: `${f.value(t)}, ${f.to}`,
|
|
209
222
|
options: s,
|
|
210
223
|
value: Array.isArray(e.value) ? e.value[1] : null,
|
|
211
224
|
onChange: (e) => pe(t, 1, e)
|
|
212
225
|
})]
|
|
213
|
-
}) : /* @__PURE__ */ y(
|
|
226
|
+
}) : /* @__PURE__ */ y(An, {
|
|
214
227
|
type: le(e.matchMode),
|
|
215
228
|
label: f.value(t),
|
|
216
229
|
options: s,
|
|
@@ -222,7 +235,7 @@ function On({ header: r, type: i, value: a, onChange: o, options: s, matchModes:
|
|
|
222
235
|
variant: "text",
|
|
223
236
|
size: "sm",
|
|
224
237
|
className: d.filterAdd(),
|
|
225
|
-
leadingIcon:
|
|
238
|
+
leadingIcon: Bt,
|
|
226
239
|
onClick: () => oe((e) => ({
|
|
227
240
|
...e,
|
|
228
241
|
constraints: [...e.constraints, {
|
|
@@ -254,123 +267,123 @@ function On({ header: r, type: i, value: a, onChange: o, options: s, matchModes:
|
|
|
254
267
|
}
|
|
255
268
|
//#endregion
|
|
256
269
|
//#region src/data-table/DataTable.tsx
|
|
257
|
-
var S = (e, t) => typeof e == "function" ? e(t) : e,
|
|
270
|
+
var S = (e, t) => typeof e == "function" ? e(t) : e, C = (e) => e == null ? "" : String(e), Mn = (e) => e === void 0 ? [] : Array.isArray(e) ? e : [e], Nn = (e) => e ? Array.isArray(e) ? e : [e] : [], Pn = (e) => Object.fromEntries(e.filter((e) => Ie(e.value)).map((e) => [e.id, e.value])), Fn = (e) => Object.entries(e).filter(([, e]) => Ie(e)).map(([e, t]) => ({
|
|
258
271
|
id: e,
|
|
259
272
|
value: t
|
|
260
|
-
})),
|
|
273
|
+
})), In = (e, t = !0) => Object.fromEntries(e.map((e) => [e, t])), Ln = (e) => Object.fromEntries(e.map((e) => [e, !0])), Rn = (e, t, n) => {
|
|
261
274
|
let r = { ...e };
|
|
262
275
|
for (let e of t) n ? r[e] = !0 : delete r[e];
|
|
263
276
|
return r;
|
|
264
|
-
},
|
|
277
|
+
}, zn = (e) => (e.filterOptions ?? []).some((e) => typeof e != "string"), Bn = /* @__PURE__ */ new Set([
|
|
265
278
|
"select",
|
|
266
279
|
"date",
|
|
267
280
|
"checkbox"
|
|
268
|
-
]),
|
|
281
|
+
]), Vn = 60, Hn = 16, Un = [], Wn = (e) => "getRows" in e ? dt(e.getRows) : e, Gn = "input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"], [data-editor]", Kn = {
|
|
269
282
|
drag: 40,
|
|
270
283
|
select: 48,
|
|
271
284
|
expand: 40,
|
|
272
285
|
number: 56,
|
|
273
286
|
actions: 88
|
|
274
|
-
};
|
|
275
|
-
function
|
|
276
|
-
let
|
|
287
|
+
}, qn = () => void 0;
|
|
288
|
+
function Jn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebounce: pe = 300, pivot: ve, columns: xe, caption: Te, getRowId: He, pageSize: m, onPageSizeChange: Je, pageSizeOptions: Ye, page: ut, onPageChange: dt, first: gt, onFirstChange: Bt, paginatorPosition: Gt = "bottom", sorting: Yt, onSortingChange: Xt, defaultSorting: nn, sortMode: an = "single", manual: on = !1, rowCount: sn, selectable: cn = !1, selectionMode: ln = "multiple", selection: un, onSelectionChange: dn, onSelectedRowsChange: fn, selectOnRowClick: pn = !1, isRowSelectable: mn, selectAllMode: hn = "page", allSelection: gn, onAllSelectionChange: _n, rowLabel: vn, loading: yn = !1, loadingVariant: bn = "overlay", emptyText: xn, noResultsText: Sn, loadingText: Cn, selectAllLabel: wn, getSubRows: Tn, treeFilterMode: En, expanded: Jn, defaultExpanded: Yn, onExpandedChange: Xn, expandLabel: Zn, expansion: Qn, advancedFilter: $n, advancedFilterValue: er, onAdvancedFilterValueChange: tr, renderAdvancedFilter: nr, search: rr = !1, globalFilter: ir, onGlobalFilterChange: ar, highlightSearch: or = !1, filters: sr, onFiltersChange: cr, filterDisplay: lr = "row", showFilters: ur, onShowFiltersChange: dr, filterToggle: fr = !1, maxConstraints: pr = 2, resizable: mr = !1, columnToggle: hr = !1, hiddenColumns: gr, onHiddenColumnsChange: _r, columnMenu: vr = !1, reorderableColumns: yr = !1, columnOrder: br, onColumnOrderChange: xr, pinnedColumns: Sr, onPinnedColumnsChange: Cr, exportFilename: wr, csvSeparator: Tr, exportFormats: Er, groupBy: Dr, onGroupByChange: Or, frozenRows: kr, reorderableRows: Ar = !1, onRowReorder: jr, rowNumbers: Mr = !1, rowActions: Nr, onRowAction: Pr, contextMenu: Fr = !1, rowClass: Ir, rowHref: Lr, onRowClick: Rr, navigation: zr = "tab", statusBar: Br = !1, cellSelection: w = !1, onCellSelectionChange: Vr, onCellPaste: Hr, onSave: Ur, find: Wr = !1, wrapHeaders: Gr = !1, verticalHeaders: Kr = !1, editMode: T = "cell", onCellEdit: qr, onRowEdit: Jr, size: Yr, onSizeChange: Xr, densityToggle: Zr = !1, gridlines: Qr = !1, striped: $r = !1, fullscreenToggle: ei = !1, scrollHeight: ti, features: ni, virtual: ri = !1, rowHeight: ii = 41, onLoadMore: ai, onScrollEnd: oi, stateKey: si, stateStorage: ci = "session", toolbar: li, toolbarStart: ui, toolbarEnd: di, empty: fi, noResults: pi, loadingContent: mi, ref: hi, className: gi, ..._i }) {
|
|
289
|
+
let vi = n("dataTable", ye, a), yi = n("menu", Ke)(), E = e(), { locale: D } = t(), O = E.dataTable, bi = Zt(), xi = _(null), [Si] = v(() => Object.assign({}, ...ni ?? [])), Ci = (e, t) => vn?.(e, t) ?? O.row(t), wi = (e, t) => Zn?.(e, t) ?? O.subRows(Ci(e, t)), [Ti, Ei] = v({
|
|
277
290
|
status: "idle",
|
|
278
291
|
items: []
|
|
279
|
-
}),
|
|
292
|
+
}), Di = _(s), [Oi] = v(() => me({ source: { getItems: (e) => Wn(Di.current).getItems(e) } }));
|
|
280
293
|
h(() => {
|
|
281
|
-
|
|
294
|
+
Di.current = s, Oi.configure({
|
|
282
295
|
ttl: ee,
|
|
283
296
|
debounce: pe
|
|
284
297
|
});
|
|
285
|
-
}), h(() => (
|
|
286
|
-
let
|
|
287
|
-
if (!
|
|
298
|
+
}), h(() => (Oi.configure({ onChange: Ei }), () => Oi.dispose()), [Oi]);
|
|
299
|
+
let ki = g(() => {
|
|
300
|
+
if (!ve) return null;
|
|
288
301
|
let e = /* @__PURE__ */ new Map(), t = (n) => n.forEach((n) => n.columns ? t(n.columns) : e.set(n.id, n));
|
|
289
|
-
t(
|
|
302
|
+
t(xe);
|
|
290
303
|
let n = (t, n) => {
|
|
291
304
|
let r = e.get(n);
|
|
292
305
|
return r ? typeof r.accessor == "function" ? r.accessor(t) : t[r.accessor ?? r.id] : t[n];
|
|
293
306
|
}, r = new Intl.NumberFormat(D, { maximumFractionDigits: 2 });
|
|
294
|
-
return nt(
|
|
307
|
+
return rt(nt(o ?? Un, ve, n, (t, n, r) => {
|
|
295
308
|
let i = e.get(n)?.format;
|
|
296
|
-
return i ? i(r, t) :
|
|
297
|
-
}),
|
|
309
|
+
return i ? i(r, t) : C(r);
|
|
310
|
+
}), ve, {
|
|
298
311
|
header: (t) => e.get(t)?.header ?? t,
|
|
299
312
|
totalLabel: O.total,
|
|
300
|
-
format: (e) => typeof e == "number" ? r.format(e) :
|
|
313
|
+
format: (e) => typeof e == "number" ? r.format(e) : C(e)
|
|
301
314
|
});
|
|
302
315
|
}, [
|
|
303
|
-
|
|
316
|
+
ve,
|
|
304
317
|
o,
|
|
305
|
-
|
|
318
|
+
xe,
|
|
306
319
|
D,
|
|
307
320
|
O
|
|
308
|
-
]), [
|
|
309
|
-
|
|
310
|
-
|
|
321
|
+
]), [Ai, ji] = v(() => we("and", "root")), Mi = er ?? Ai, [Ni, Pi] = v(!1), Fi = g(() => Array.isArray($n) ? $n : $n ? fe(xe, o ?? Un) : [], [
|
|
322
|
+
$n,
|
|
323
|
+
xe,
|
|
311
324
|
o
|
|
312
|
-
]),
|
|
313
|
-
|
|
314
|
-
},
|
|
325
|
+
]), Ii = !!$n && Fe(Mi, Fi), Li = (e) => {
|
|
326
|
+
ji(e), tr?.(e);
|
|
327
|
+
}, Ri = !!$n && !!nr;
|
|
315
328
|
h(() => {
|
|
316
|
-
|
|
317
|
-
}, [
|
|
318
|
-
let
|
|
319
|
-
|
|
320
|
-
|
|
329
|
+
$n && !nr && xt("DataTable: `advancedFilter` has no editor, so the toolbar button is hidden – pass `renderAdvancedFilter={(props) => <ConditionBuilder {...props} />}` with ConditionBuilder from @wirecore/wirelayer-blocks-react");
|
|
330
|
+
}, [$n, nr]);
|
|
331
|
+
let zi = g(() => Ii && !on ? (o ?? Un).filter((e) => We(e, Mi, Fi, D)) : o, [
|
|
332
|
+
Ii,
|
|
333
|
+
on,
|
|
321
334
|
o,
|
|
322
|
-
|
|
323
|
-
|
|
335
|
+
Mi,
|
|
336
|
+
Fi,
|
|
324
337
|
D
|
|
325
|
-
]),
|
|
338
|
+
]), Bi = ki ? ki.rows : s ? Ti.items : zi ?? Un, Vi = ki ? ki.columns : xe, k = on || !!s, Hi = s ? Ti.totalCount ?? Ti.items.length : sn, Ui = !!s && Ti.status === "error", Wi = yn || !!s && Ti.status === "loading", { leafDefs: A, columnById: j } = g(() => {
|
|
326
339
|
let e = /* @__PURE__ */ new Map(), t = [], n = (r) => r.forEach((r) => {
|
|
327
340
|
e.set(r.id, r), r.columns ? n(r.columns) : t.push(r);
|
|
328
341
|
});
|
|
329
|
-
return n(
|
|
342
|
+
return n(Vi), {
|
|
330
343
|
leafDefs: t,
|
|
331
344
|
columnById: e
|
|
332
345
|
};
|
|
333
|
-
}, [
|
|
334
|
-
m !==
|
|
335
|
-
let
|
|
336
|
-
pageIndex:
|
|
337
|
-
pageSize:
|
|
338
|
-
}), [
|
|
339
|
-
|
|
340
|
-
let [
|
|
346
|
+
}, [Vi]), Gi = (e, t) => typeof e.accessor == "function" ? e.accessor(t) : t[e.accessor ?? e.id], M = (e, t, n) => e?.format ? e.format(t, n) : C(t), [Ki, qi] = v(() => Nn(nn)), N = g(() => Yt === void 0 ? Ki : Nn(Yt), [Yt, Ki]), [Ji, Yi] = v(0), [Xi, Zi] = v(m ?? 10), [Qi, $i] = v(m);
|
|
347
|
+
m !== Qi && ($i(m), Zi(m ?? 10));
|
|
348
|
+
let ea = gt === void 0 ? ut === void 0 ? Ji : ut - 1 : Math.floor(gt / Xi), ta = Xi, P = g(() => ({
|
|
349
|
+
pageIndex: ea,
|
|
350
|
+
pageSize: ta
|
|
351
|
+
}), [ea, ta]), [na, ra] = v({}), ia = g(() => un === void 0 ? na : Ln(un), [un, na]), [aa, oa] = v(null), sa = gn === void 0 ? aa : gn, [ca, la] = v(!0), ua = ur ?? ca, [F, da] = v(() => Mn(Dr)), fa = Mn(Dr).join("\0"), [pa, ma] = v(fa);
|
|
352
|
+
fa !== pa && (ma(fa), da(Mn(Dr)));
|
|
353
|
+
let [ha, ga] = v(() => Yn ? In(Yn) : Dr && !Qn ? !0 : {}), _a = g(() => Jn === void 0 ? ha : In(Jn), [Jn, ha]), [va, ya] = v(""), I = ir ?? va, [ba, xa] = v([]), Sa = g(() => sr === void 0 ? ba : Fn(sr), [sr, ba]), [Ca, wa] = v({}), Ta = g(() => gr === void 0 ? Ca : In(gr, !1), [gr, Ca]), [Ea, Da] = v([]), Oa = br ?? Ea, [ka, Aa] = v(null), ja = g(() => Sr ?? ka ?? {
|
|
341
354
|
start: A.filter((e) => e.pinned === "start").map((e) => e.id),
|
|
342
355
|
end: A.filter((e) => e.pinned === "end").map((e) => e.id)
|
|
343
356
|
}, [
|
|
344
|
-
|
|
345
|
-
|
|
357
|
+
Sr,
|
|
358
|
+
ka,
|
|
346
359
|
A
|
|
347
|
-
]), [
|
|
348
|
-
|
|
349
|
-
let
|
|
350
|
-
top:
|
|
360
|
+
]), [Ma, Na] = v({}), [Pa, Fa] = v(Yr ?? "md"), [Ia, La] = v(Yr);
|
|
361
|
+
Yr !== Ia && (La(Yr), Yr && Fa(Yr));
|
|
362
|
+
let Ra = g(() => ({
|
|
363
|
+
top: kr ?? [],
|
|
351
364
|
bottom: []
|
|
352
|
-
}), [
|
|
353
|
-
|
|
354
|
-
},
|
|
355
|
-
e.pageSize !== P.pageSize && (
|
|
356
|
-
},
|
|
357
|
-
|
|
365
|
+
}), [kr]), za = (e) => {
|
|
366
|
+
qi(e), Xt?.(an === "multiple" ? [...e] : e[0] ?? null);
|
|
367
|
+
}, Ba = (e) => {
|
|
368
|
+
e.pageSize !== P.pageSize && (Zi(e.pageSize), Je?.(e.pageSize)), Yi(e.pageIndex), dt?.(e.pageIndex + 1), Bt?.(e.pageIndex * e.pageSize);
|
|
369
|
+
}, Va = _(/* @__PURE__ */ new Map()), Ha = (e) => {
|
|
370
|
+
ra(e);
|
|
358
371
|
let t = Object.keys(e).filter((t) => e[t]);
|
|
359
|
-
|
|
360
|
-
let n =
|
|
361
|
-
for (let t of [...
|
|
362
|
-
for (let e of t) n[e] &&
|
|
363
|
-
|
|
364
|
-
},
|
|
365
|
-
|
|
366
|
-
},
|
|
367
|
-
|
|
368
|
-
},
|
|
369
|
-
|
|
370
|
-
},
|
|
371
|
-
|
|
372
|
-
},
|
|
373
|
-
let e = (e) => !e.filter || e.filter === "text" || e.filter === "select" || e.filter === "multiSelect", t = (e, t, n) => e.format ? e.format(t, n) :
|
|
372
|
+
dn?.(t);
|
|
373
|
+
let n = L.getCoreRowModel().rowsById;
|
|
374
|
+
for (let t of [...Va.current.keys()]) e[t] || Va.current.delete(t);
|
|
375
|
+
for (let e of t) n[e] && Va.current.set(e, n[e].original);
|
|
376
|
+
fn?.(t.flatMap((e) => Va.current.has(e) ? [Va.current.get(e)] : []));
|
|
377
|
+
}, Ua = (e) => {
|
|
378
|
+
oa(e), _n?.(e);
|
|
379
|
+
}, Wa = () => {
|
|
380
|
+
la(!ua), dr?.(!ua);
|
|
381
|
+
}, Ga = (e) => {
|
|
382
|
+
ga(e), Xn?.(e === !0 ? [] : Object.keys(e).filter((t) => e[t]));
|
|
383
|
+
}, Ka = (e) => {
|
|
384
|
+
Fa(e), Xr?.(e);
|
|
385
|
+
}, qa = g(() => {
|
|
386
|
+
let e = (e) => !e.filter || e.filter === "text" || e.filter === "select" || e.filter === "multiSelect", t = (e, t, n) => e.format ? e.format(t, n) : C(t), n = (r) => r.columns ? {
|
|
374
387
|
id: r.id,
|
|
375
388
|
header: r.header,
|
|
376
389
|
columns: r.columns.map(n)
|
|
@@ -382,146 +395,146 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
382
395
|
sortDescFirst: !1,
|
|
383
396
|
sortUndefined: "last",
|
|
384
397
|
...r.sortFn ? { sortFn: (e, t) => r.sortFn(e.original, t.original) } : {},
|
|
385
|
-
filterFn: (n, i, a) =>
|
|
398
|
+
filterFn: (n, i, a) => Ue({
|
|
386
399
|
value: n.getValue(i),
|
|
387
400
|
text: e(r) ? t(r, n.getValue(i), n.original) : "",
|
|
388
401
|
row: n.original,
|
|
389
402
|
type: r.filter,
|
|
390
403
|
locale: D,
|
|
391
404
|
filterFn: r.filterFn,
|
|
392
|
-
byValue:
|
|
405
|
+
byValue: zn(r)
|
|
393
406
|
}, a),
|
|
394
407
|
enableGlobalFilter: r.searchable !== !1,
|
|
395
408
|
enableHiding: r.hideable !== !1,
|
|
396
409
|
enableGrouping: !0,
|
|
397
410
|
...r.width ? { size: r.width } : {},
|
|
398
|
-
minSize:
|
|
411
|
+
minSize: Vn
|
|
399
412
|
};
|
|
400
|
-
return
|
|
401
|
-
}, [
|
|
402
|
-
features:
|
|
403
|
-
columns:
|
|
404
|
-
data:
|
|
405
|
-
getRowId: (e, t) =>
|
|
413
|
+
return Vi.map(n);
|
|
414
|
+
}, [Vi, D]), L = Dn({
|
|
415
|
+
features: On,
|
|
416
|
+
columns: qa,
|
|
417
|
+
data: Bi,
|
|
418
|
+
getRowId: (e, t) => ki ? e.id : He?.(e, t) ?? String(t),
|
|
406
419
|
state: {
|
|
407
420
|
sorting: N,
|
|
408
421
|
pagination: P,
|
|
409
|
-
rowSelection:
|
|
410
|
-
expanded:
|
|
411
|
-
globalFilter:
|
|
412
|
-
columnFilters:
|
|
413
|
-
columnVisibility:
|
|
414
|
-
columnOrder:
|
|
415
|
-
columnPinning:
|
|
416
|
-
columnSizing:
|
|
422
|
+
rowSelection: ia,
|
|
423
|
+
expanded: _a,
|
|
424
|
+
globalFilter: I,
|
|
425
|
+
columnFilters: Sa,
|
|
426
|
+
columnVisibility: Ta,
|
|
427
|
+
columnOrder: Oa,
|
|
428
|
+
columnPinning: ja,
|
|
429
|
+
columnSizing: Ma,
|
|
417
430
|
grouping: F,
|
|
418
|
-
rowPinning:
|
|
431
|
+
rowPinning: Ra
|
|
419
432
|
},
|
|
420
|
-
getSubRows:
|
|
421
|
-
filterFromLeafRows:
|
|
422
|
-
getRowCanExpand: (e) => !!
|
|
423
|
-
...
|
|
424
|
-
onExpandedChange: (e) =>
|
|
425
|
-
onSortingChange: (e) =>
|
|
426
|
-
onPaginationChange: (e) =>
|
|
427
|
-
onRowSelectionChange: (e) =>
|
|
433
|
+
getSubRows: Tn,
|
|
434
|
+
filterFromLeafRows: En === "lenient",
|
|
435
|
+
getRowCanExpand: (e) => !!Qn || !!e.subRows?.length,
|
|
436
|
+
...Ar || w ? { autoResetExpanded: !1 } : {},
|
|
437
|
+
onExpandedChange: (e) => Ga(S(e, _a)),
|
|
438
|
+
onSortingChange: (e) => za(S(e, N)),
|
|
439
|
+
onPaginationChange: (e) => Ba(S(e, P)),
|
|
440
|
+
onRowSelectionChange: (e) => Ha(S(e, ia)),
|
|
428
441
|
onGlobalFilterChange: (e) => {
|
|
429
|
-
let t = S(e,
|
|
430
|
-
|
|
442
|
+
let t = S(e, I) ?? "";
|
|
443
|
+
ya(t), ar?.(t);
|
|
431
444
|
},
|
|
432
445
|
onColumnFiltersChange: (e) => {
|
|
433
|
-
let t = S(e,
|
|
434
|
-
|
|
446
|
+
let t = S(e, Sa);
|
|
447
|
+
xa(t), cr?.(Pn(t));
|
|
435
448
|
},
|
|
436
449
|
onColumnVisibilityChange: (e) => {
|
|
437
|
-
let t = S(e,
|
|
438
|
-
|
|
450
|
+
let t = S(e, Ta);
|
|
451
|
+
wa(t), _r?.(Object.keys(t).filter((e) => t[e] === !1));
|
|
439
452
|
},
|
|
440
453
|
onColumnOrderChange: (e) => {
|
|
441
|
-
let t = S(e,
|
|
442
|
-
|
|
454
|
+
let t = S(e, Oa);
|
|
455
|
+
Da(t), xr?.(t);
|
|
443
456
|
},
|
|
444
457
|
onColumnPinningChange: (e) => {
|
|
445
|
-
let t = S(e,
|
|
446
|
-
|
|
458
|
+
let t = S(e, ja);
|
|
459
|
+
Aa(t), Cr?.({
|
|
447
460
|
start: [...t.start],
|
|
448
461
|
end: [...t.end]
|
|
449
462
|
});
|
|
450
463
|
},
|
|
451
|
-
onColumnSizingChange: (e) =>
|
|
464
|
+
onColumnSizingChange: (e) => Na((t) => S(e, t)),
|
|
452
465
|
onGroupingChange: (e) => {
|
|
453
466
|
let t = S(e, F);
|
|
454
|
-
|
|
467
|
+
da(t), Or?.(t);
|
|
455
468
|
},
|
|
456
|
-
globalFilterFn: (e, t, n) =>
|
|
469
|
+
globalFilterFn: (e, t, n) => Ge([M(j.get(t), e.getValue(t), e.original)], n, D),
|
|
457
470
|
getColumnCanGlobalFilter: (e) => j.get(e.id)?.searchable !== !1,
|
|
458
|
-
enableColumnResizing:
|
|
471
|
+
enableColumnResizing: mr,
|
|
459
472
|
columnResizeMode: "onChange",
|
|
460
473
|
groupedColumnMode: !1,
|
|
461
474
|
keepPinnedRows: !0,
|
|
462
|
-
enableRowSelection: (e) =>
|
|
463
|
-
enableMultiRowSelection:
|
|
475
|
+
enableRowSelection: (e) => cn && !e.getIsGrouped() && (mn?.(e.original) ?? !0),
|
|
476
|
+
enableMultiRowSelection: ln !== "single",
|
|
464
477
|
manualSorting: k,
|
|
465
478
|
manualFiltering: k,
|
|
466
479
|
manualPagination: k || !m,
|
|
467
|
-
rowCount: k ?
|
|
468
|
-
}), [
|
|
469
|
-
size:
|
|
470
|
-
gridlines:
|
|
471
|
-
striped:
|
|
472
|
-
scrollable:
|
|
473
|
-
wrapHeaders:
|
|
474
|
-
verticalHeaders:
|
|
475
|
-
},
|
|
476
|
-
...
|
|
477
|
-
fullscreen:
|
|
478
|
-
grid:
|
|
479
|
-
}),
|
|
480
|
+
rowCount: k ? Hi : void 0
|
|
481
|
+
}), [R, Ja] = v(!1), Ya = {
|
|
482
|
+
size: Pa,
|
|
483
|
+
gridlines: Qr,
|
|
484
|
+
striped: $r,
|
|
485
|
+
scrollable: !!ti,
|
|
486
|
+
wrapHeaders: Gr,
|
|
487
|
+
verticalHeaders: Kr
|
|
488
|
+
}, z = zr === "grid", Xa = z && !!Tn, B = ri && !!ti && !!Si.useVirtualizer, Za = !!m, V = vi({
|
|
489
|
+
...Ya,
|
|
490
|
+
fullscreen: R,
|
|
491
|
+
grid: z
|
|
492
|
+
}), Qa = (e) => {
|
|
480
493
|
let t = j.get(e);
|
|
481
|
-
return
|
|
482
|
-
...
|
|
494
|
+
return vi({
|
|
495
|
+
...Ya,
|
|
483
496
|
align: t?.align,
|
|
484
497
|
hideBelow: t?.hideBelow ? `hide-${t.hideBelow}` : void 0
|
|
485
498
|
});
|
|
486
|
-
},
|
|
487
|
-
...
|
|
488
|
-
...
|
|
489
|
-
...
|
|
490
|
-
...
|
|
491
|
-
],
|
|
492
|
-
let n =
|
|
499
|
+
}, $a = A.some((e) => e.editable), eo = T !== "row", H = [
|
|
500
|
+
...Ar ? ["drag"] : [],
|
|
501
|
+
...cn ? ["select"] : [],
|
|
502
|
+
...Qn ? ["expand"] : [],
|
|
503
|
+
...Mr ? ["number"] : []
|
|
504
|
+
], U = Nr || T === "row" && $a ? ["actions"] : [], W = L.getVisibleLeafColumns(), to = W.length + H.length + U.length, no = mr || A.some((e) => e.width) || ja.start.length > 0 || ja.end.length > 0, ro = ja.start.length > 0, io = ja.end.length > 0, ao = H.reduce((e, t) => e + Kn[t], 0), oo = U.reduce((e, t) => e + Kn[t], 0), so = (e, t) => {
|
|
505
|
+
let n = L.getColumn(e), r = n?.getIsPinned();
|
|
493
506
|
if (!n || !r) return "";
|
|
494
|
-
let i = r === "start" ?
|
|
495
|
-
return [t ?
|
|
496
|
-
},
|
|
497
|
-
let n =
|
|
498
|
-
if (!n || !
|
|
507
|
+
let i = r === "start" ? L.getStartVisibleLeafColumns().at(-1)?.id === e && V.pinnedStartEdge() : L.getEndVisibleLeafColumns()[0]?.id === e && V.pinnedEndEdge();
|
|
508
|
+
return [t ? V.pinnedHead() : V.pinned(), i].filter(Boolean).join(" ");
|
|
509
|
+
}, co = (e, t) => {
|
|
510
|
+
let n = L.getColumn(e);
|
|
511
|
+
if (!n || !no) return;
|
|
499
512
|
let r = n.getIsPinned();
|
|
500
513
|
return {
|
|
501
514
|
...t ? { width: n.getSize() } : {},
|
|
502
|
-
...r === "start" ? { insetInlineStart:
|
|
503
|
-
...r === "end" ? { insetInlineEnd:
|
|
515
|
+
...r === "start" ? { insetInlineStart: ao + n.getStart("start") } : {},
|
|
516
|
+
...r === "end" ? { insetInlineEnd: oo + n.getAfter("end") } : {}
|
|
504
517
|
};
|
|
505
|
-
},
|
|
506
|
-
if (!
|
|
507
|
-
let t = { width:
|
|
508
|
-
if (!
|
|
509
|
-
if (
|
|
518
|
+
}, lo = (e) => U.includes(e) ? io : ro, G = (e, t) => [e === "select" ? V.selectCell() : V.utilityCell(), lo(e) ? t ? V.pinnedHead() : V.pinned() : ""].filter(Boolean).join(" "), K = (e) => {
|
|
519
|
+
if (!no) return;
|
|
520
|
+
let t = { width: Kn[e] };
|
|
521
|
+
if (!lo(e)) return t;
|
|
522
|
+
if (U.includes(e)) return {
|
|
510
523
|
...t,
|
|
511
524
|
insetInlineEnd: 0
|
|
512
525
|
};
|
|
513
|
-
let n =
|
|
526
|
+
let n = H.slice(0, H.indexOf(e));
|
|
514
527
|
return {
|
|
515
528
|
...t,
|
|
516
|
-
insetInlineStart: n.reduce((e, t) => e +
|
|
529
|
+
insetInlineStart: n.reduce((e, t) => e + Kn[t], 0)
|
|
517
530
|
};
|
|
518
|
-
},
|
|
531
|
+
}, uo = L.getHeaderGroups(), fo = (() => {
|
|
519
532
|
let e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map();
|
|
520
|
-
|
|
533
|
+
uo.forEach((n, r) => n.headers.forEach((n) => {
|
|
521
534
|
n.isPlaceholder || (e.set(n.column.id, r), t.set(n.column.id, n));
|
|
522
535
|
}));
|
|
523
536
|
let n = /* @__PURE__ */ new Set();
|
|
524
|
-
return
|
|
537
|
+
return uo.map((r, i) => r.headers.flatMap((r) => {
|
|
525
538
|
let a = r.column.id;
|
|
526
539
|
if (n.has(a)) return [];
|
|
527
540
|
n.add(a);
|
|
@@ -532,31 +545,31 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
532
545
|
group: o.subHeaders.length > 0
|
|
533
546
|
}];
|
|
534
547
|
}));
|
|
535
|
-
})(),
|
|
548
|
+
})(), q = (e) => j.get(e.id)?.header ?? e.id, po = (e) => {
|
|
536
549
|
let t = N[0];
|
|
537
|
-
return t?.id === e ? t.desc ? "descending" : "ascending" :
|
|
538
|
-
},
|
|
539
|
-
|
|
540
|
-
},
|
|
541
|
-
|
|
542
|
-
if (!
|
|
543
|
-
let e =
|
|
544
|
-
(
|
|
550
|
+
return t?.id === e ? t.desc ? "descending" : "ascending" : L.getColumn(e)?.getCanSort() ? "none" : void 0;
|
|
551
|
+
}, mo = (e) => N.findIndex((t) => t.id === e) + 1, [ho, go] = v(""), _o = (e) => {
|
|
552
|
+
go(""), setTimeout(() => go(e));
|
|
553
|
+
}, J = _(null), vo = _(!1);
|
|
554
|
+
$t(() => {
|
|
555
|
+
if (!J.current) return;
|
|
556
|
+
let e = xi.current?.querySelector(J.current);
|
|
557
|
+
(vo.current ? e?.closest("td") ?? e : e)?.focus(), J.current = null, vo.current = !1;
|
|
545
558
|
});
|
|
546
|
-
let
|
|
547
|
-
let t = j.get(e.id), n = e.getIsSorted(), r = e.getIsPinned(), i =
|
|
559
|
+
let yo = vr || yr, bo = (e) => yr && j.get(e)?.reorderable !== !1, xo = (e) => {
|
|
560
|
+
let t = j.get(e.id), n = e.getIsSorted(), r = e.getIsPinned(), i = W.map((e) => e.id), a = i.indexOf(e.id);
|
|
548
561
|
return [
|
|
549
562
|
e.getCanSort() ? [
|
|
550
563
|
{
|
|
551
564
|
value: "sort-asc",
|
|
552
565
|
label: O.sortAscending,
|
|
553
|
-
icon:
|
|
566
|
+
icon: Ct,
|
|
554
567
|
disabled: n === "asc"
|
|
555
568
|
},
|
|
556
569
|
{
|
|
557
570
|
value: "sort-desc",
|
|
558
571
|
label: O.sortDescending,
|
|
559
|
-
icon:
|
|
572
|
+
icon: St,
|
|
560
573
|
disabled: n === "desc"
|
|
561
574
|
},
|
|
562
575
|
...n ? [{
|
|
@@ -578,7 +591,7 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
578
591
|
label: O.unpin
|
|
579
592
|
}] : []
|
|
580
593
|
],
|
|
581
|
-
|
|
594
|
+
bo(e.id) ? [{
|
|
582
595
|
value: "move-earlier",
|
|
583
596
|
label: O.moveEarlier,
|
|
584
597
|
disabled: a <= 0
|
|
@@ -598,25 +611,25 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
598
611
|
label: O.hideColumn
|
|
599
612
|
}] : []]
|
|
600
613
|
].filter((e) => e.length).flatMap((e, t) => t ? [{ type: "separator" }, ...e] : e);
|
|
601
|
-
},
|
|
602
|
-
let r =
|
|
603
|
-
r.splice(r.indexOf(t) + +!!n, 0, e),
|
|
604
|
-
let i =
|
|
605
|
-
i.splice(i.indexOf(t) + +!!n, 0, e),
|
|
606
|
-
},
|
|
607
|
-
let n =
|
|
608
|
-
switch (
|
|
614
|
+
}, So = (e, t, n) => {
|
|
615
|
+
let r = L.getAllLeafColumns().map((e) => e.id).filter((t) => t !== e);
|
|
616
|
+
r.splice(r.indexOf(t) + +!!n, 0, e), L.setColumnOrder(r);
|
|
617
|
+
let i = W.map((e) => e.id).filter((t) => t !== e);
|
|
618
|
+
i.splice(i.indexOf(t) + +!!n, 0, e), _o(O.columnMoved(j.get(e)?.header ?? e, i.indexOf(e) + 1, i.length));
|
|
619
|
+
}, Co = (e, t) => {
|
|
620
|
+
let n = W.map((e) => e.id), r = n.indexOf(e.id);
|
|
621
|
+
switch (J.current = `[data-column-menu="${CSS.escape(e.id)}"]`, t) {
|
|
609
622
|
case "sort-asc":
|
|
610
623
|
case "sort-desc": {
|
|
611
624
|
let n = {
|
|
612
625
|
id: e.id,
|
|
613
626
|
desc: t === "sort-desc"
|
|
614
627
|
};
|
|
615
|
-
|
|
628
|
+
an === "multiple" ? mo(e.id) ? za(N.map((t) => t.id === e.id ? n : t)) : za([...N, n]) : za([n]);
|
|
616
629
|
break;
|
|
617
630
|
}
|
|
618
631
|
case "sort-clear":
|
|
619
|
-
|
|
632
|
+
za(N.filter((t) => t.id !== e.id));
|
|
620
633
|
break;
|
|
621
634
|
case "pin-start":
|
|
622
635
|
case "pin-end":
|
|
@@ -624,96 +637,96 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
624
637
|
e.pin(t === "unpin" ? !1 : t === "pin-start" ? "start" : "end");
|
|
625
638
|
break;
|
|
626
639
|
case "move-earlier":
|
|
627
|
-
|
|
640
|
+
So(e.id, n[r - 1], !1);
|
|
628
641
|
break;
|
|
629
642
|
case "move-later":
|
|
630
|
-
|
|
643
|
+
So(e.id, n[r + 1], !0);
|
|
631
644
|
break;
|
|
632
645
|
case "group":
|
|
633
|
-
|
|
646
|
+
L.setGrouping([...F, e.id]);
|
|
634
647
|
break;
|
|
635
648
|
case "ungroup":
|
|
636
|
-
|
|
649
|
+
L.setGrouping(F.filter((t) => t !== e.id));
|
|
637
650
|
break;
|
|
638
651
|
case "hide": {
|
|
639
652
|
e.toggleVisibility(!1);
|
|
640
653
|
let t = n.filter((t) => t !== e.id)[Math.min(r, n.length - 2)];
|
|
641
|
-
|
|
654
|
+
J.current = t ? `[data-column-menu="${CSS.escape(t)}"]` : null;
|
|
642
655
|
break;
|
|
643
656
|
}
|
|
644
657
|
}
|
|
645
|
-
}, [
|
|
646
|
-
|
|
647
|
-
},
|
|
648
|
-
if (!
|
|
658
|
+
}, [wo, To] = v(null), [Eo, Do] = v(null), Oo = (e, t) => {
|
|
659
|
+
To(e), t.dataTransfer.setData("text/plain", e), t.dataTransfer.effectAllowed = "move";
|
|
660
|
+
}, ko = (e, t) => {
|
|
661
|
+
if (!wo || wo === e || !bo(e)) return;
|
|
649
662
|
t.preventDefault();
|
|
650
663
|
let n = t.currentTarget, r = n.getBoundingClientRect(), i = getComputedStyle(n).direction === "rtl", a = t.clientX > r.left + r.width / 2;
|
|
651
|
-
|
|
664
|
+
Do({
|
|
652
665
|
id: e,
|
|
653
666
|
after: i ? !a : a
|
|
654
667
|
});
|
|
655
|
-
},
|
|
656
|
-
|
|
657
|
-
},
|
|
658
|
-
e.preventDefault(),
|
|
659
|
-
},
|
|
668
|
+
}, Ao = () => {
|
|
669
|
+
To(null), Do(null);
|
|
670
|
+
}, jo = (e) => {
|
|
671
|
+
e.preventDefault(), wo && Eo && So(wo, Eo.id, Eo.after), Ao();
|
|
672
|
+
}, Mo = (e) => Eo?.id === e ? Eo.after ? "after" : "before" : void 0, No = (e, t) => {
|
|
660
673
|
let n = t.currentTarget.closest("th"), r = n?.closest("table");
|
|
661
674
|
if (!n || !r) return;
|
|
662
|
-
let i = j.get(e), a =
|
|
663
|
-
o &&
|
|
675
|
+
let i = j.get(e), a = B && i ? L.getRowModel().rows.map((t) => M(i, t.getValue(e), t.original)) : void 0, o = Oe(r, n, a);
|
|
676
|
+
o && L.setColumnSizing((t) => ({
|
|
664
677
|
...t,
|
|
665
|
-
[e]: Math.min(1200, Math.max(
|
|
678
|
+
[e]: Math.min(1200, Math.max(Vn, o))
|
|
666
679
|
}));
|
|
667
|
-
},
|
|
668
|
-
if (t.key === "Enter") return t.preventDefault(),
|
|
669
|
-
let n =
|
|
680
|
+
}, Po = (e, t) => {
|
|
681
|
+
if (t.key === "Enter") return t.preventDefault(), No(e, t);
|
|
682
|
+
let n = Pe(t.key, t.currentTarget) * Hn;
|
|
670
683
|
if (!n) return;
|
|
671
684
|
t.preventDefault();
|
|
672
|
-
let r =
|
|
673
|
-
|
|
685
|
+
let r = L.getColumn(e);
|
|
686
|
+
L.setColumnSizing((t) => ({
|
|
674
687
|
...t,
|
|
675
|
-
[e]: Math.max(
|
|
688
|
+
[e]: Math.max(Vn, r.getSize() + n)
|
|
676
689
|
}));
|
|
677
|
-
},
|
|
678
|
-
let t =
|
|
690
|
+
}, Fo = (e) => !!e && (!!e.filter || !!e.renderFilter), Io = lr === "row" && ua && A.some((e) => Fo(e)), Lo = lr === "menu" && ua, Ro = !!I || Sa.length > 0 || Ii, zo = (e) => Sa.find((t) => t.id === e)?.value, Bo = (e) => e.filterOptions ?? [...new Set(Bi.map((t) => M(e, Gi(e, t), t)))].filter(Boolean).sort(), Vo = (e) => {
|
|
691
|
+
let t = zo(e.id);
|
|
679
692
|
return t === void 0 ? e.filter === "multiSelect" ? [] : null : typeof t == "string" ? t : t.constraints[0]?.value ?? null;
|
|
680
|
-
},
|
|
693
|
+
}, Ho = (e, t) => L.getColumn(e)?.setFilterValue(t !== void 0 && Ie(t) ? t : void 0), Uo = (e) => e.filterMatchMode ?? (zn(e) && e.filter === "multiSelect" ? "in" : be[e.filter ?? "text"][0]), Wo = (e) => Ve(Uo(e))?.input ?? e.filter ?? "text", Go = (e, t) => {
|
|
681
694
|
let n = e.filter ?? "text";
|
|
682
|
-
if ((n === "text" || n === "select") && !e.filterMatchMode && !
|
|
683
|
-
|
|
695
|
+
if ((n === "text" || n === "select") && !e.filterMatchMode && !zn(e) && !e.renderFilter) return Ho(e.id, C(t));
|
|
696
|
+
Ho(e.id, {
|
|
684
697
|
operator: "and",
|
|
685
698
|
constraints: [{
|
|
686
|
-
matchMode:
|
|
699
|
+
matchMode: Uo(e),
|
|
687
700
|
value: t
|
|
688
701
|
}]
|
|
689
702
|
});
|
|
690
|
-
},
|
|
691
|
-
let n =
|
|
703
|
+
}, Ko = (e, t) => {
|
|
704
|
+
let n = Vo(e);
|
|
692
705
|
return Array.isArray(n) ? n[t] : null;
|
|
693
|
-
},
|
|
694
|
-
let r =
|
|
695
|
-
i[t] = n,
|
|
696
|
-
},
|
|
697
|
-
|
|
706
|
+
}, qo = (e, t, n) => {
|
|
707
|
+
let r = Vo(e), i = Array.isArray(r) ? [...r] : [null, null];
|
|
708
|
+
i[t] = n, Go(e, i);
|
|
709
|
+
}, Jo = ln !== "single", Yo = hn === "all" && k, Xo = (e) => Yo && sa ? e.getCanSelect() && !sa.except.includes(e.id) : e.getIsSelected(), Zo = Yo && sa ? Math.max(0, (Hi ?? Bi.length) - sa.except.length) : Object.values(ia).filter(Boolean).length, Qo = Yo ? sa ? !sa.except.length || "indeterminate" : Zo ? "indeterminate" : !1 : L.getIsAllPageRowsSelected() ? !0 : L.getIsSomePageRowsSelected() ? "indeterminate" : !1, $o = (e) => {
|
|
710
|
+
Yo ? (Ha({}), Ua(sa || !e ? null : {
|
|
698
711
|
mode: "all",
|
|
699
712
|
except: []
|
|
700
|
-
})) :
|
|
701
|
-
},
|
|
702
|
-
let r =
|
|
703
|
-
if (
|
|
704
|
-
let i = new Set(
|
|
705
|
-
for (let a of n &&
|
|
706
|
-
|
|
713
|
+
})) : hn === "all" ? L.toggleAllRowsSelected(e) : L.toggleAllPageRowsSelected(e);
|
|
714
|
+
}, es = `${bi}-select`, ts = _(null), ns = _(!1), rs = (e, t, n = !1) => {
|
|
715
|
+
let r = L.getRowModel().rows.filter((e) => e.getCanSelect()).map((e) => e.id);
|
|
716
|
+
if (Yo && sa) {
|
|
717
|
+
let i = new Set(sa.except);
|
|
718
|
+
for (let a of n && ts.current ? Ne(r, ts.current, e.id) : [e.id]) t ? i.delete(a) : i.add(a);
|
|
719
|
+
Ua({
|
|
707
720
|
mode: "all",
|
|
708
721
|
except: [...i]
|
|
709
722
|
});
|
|
710
|
-
} else
|
|
711
|
-
|
|
712
|
-
},
|
|
723
|
+
} else Ha(Jo ? Rn(ia, n && ts.current ? Ne(r, ts.current, e.id) : [e.id], t) : t ? Ln([e.id]) : {});
|
|
724
|
+
ts.current = e.id;
|
|
725
|
+
}, is = (e) => ns.current = e.shiftKey, as = "button, a, input, select, textarea, label, [role=checkbox], [role=combobox], [contenteditable]", os = (e, t) => {
|
|
713
726
|
let n = t.target, r = !!n.closest("[data-row-link]");
|
|
714
|
-
if (!r && n.closest(
|
|
715
|
-
let i =
|
|
716
|
-
if (
|
|
727
|
+
if (!r && n.closest(as)) return;
|
|
728
|
+
let i = Lr?.(e.original);
|
|
729
|
+
if (Rr?.({
|
|
717
730
|
row: e.original,
|
|
718
731
|
rowId: e.id,
|
|
719
732
|
href: i,
|
|
@@ -721,11 +734,11 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
721
734
|
}), i) {
|
|
722
735
|
if (r || t.nativeEvent.defaultPrevented) return;
|
|
723
736
|
t.ctrlKey || t.metaKey || t.shiftKey ? window.open(i, "_blank", "noopener") : window.location.assign(i);
|
|
724
|
-
} else
|
|
725
|
-
},
|
|
726
|
-
let n =
|
|
727
|
-
t.button === 1 && n && !t.target.closest(
|
|
728
|
-
},
|
|
737
|
+
} else pn && e.getCanSelect() && rs(e, !Jo || !Xo(e), Jo && t.shiftKey);
|
|
738
|
+
}, ss = (e, t) => {
|
|
739
|
+
let n = Lr?.(e.original);
|
|
740
|
+
t.button === 1 && n && !t.target.closest(as) && window.open(n, "_blank", "noopener");
|
|
741
|
+
}, cs = kr?.length ? L.getCenterRows() : L.getRowModel().rows, ls = kr?.length ? L.getTopRows() : [], Y = (Ui ? Un : cs).flatMap((e) => e.getIsGrouped() ? [{
|
|
729
742
|
kind: "group",
|
|
730
743
|
row: e,
|
|
731
744
|
key: e.id
|
|
@@ -733,149 +746,149 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
733
746
|
kind: "row",
|
|
734
747
|
row: e,
|
|
735
748
|
key: e.id
|
|
736
|
-
}, ...
|
|
749
|
+
}, ...Qn && e.getIsExpanded() ? [{
|
|
737
750
|
kind: "expansion",
|
|
738
751
|
row: e,
|
|
739
752
|
key: `${e.id}:details`
|
|
740
|
-
}] : []]),
|
|
753
|
+
}] : []]), us = m && !k ? P.pageIndex * P.pageSize : 0, ds = new Map(Y.filter((e) => e.kind === "row").map((e, t) => [e.row.id, us + t + 1])), fs = (e) => `${bi}-details-${e.id}`, ps = L.getIsAllRowsExpanded(), ms = !!Tn || F.length > 0, hs = A.some((e) => e.aggregate), gs = A.some((e) => e.aggregate || e.footer), _s = (e, t, n) => t == null ? "" : e.format && n ? e.format(t, n) : typeof t == "number" ? new Intl.NumberFormat(D, { maximumFractionDigits: 2 }).format(t) : C(t), vs = (e, t) => {
|
|
741
754
|
if (!e.aggregate) return "";
|
|
742
|
-
let n = t.filter((e) => !e.getIsGrouped()), r = oe(n.map((t) =>
|
|
743
|
-
return
|
|
744
|
-
},
|
|
755
|
+
let n = t.filter((e) => !e.getIsGrouped()), r = oe(n.map((t) => Gi(e, t.original)), e.aggregate);
|
|
756
|
+
return _s(e, r, e.aggregate === "count" ? void 0 : n[0]?.original);
|
|
757
|
+
}, ys = (e) => {
|
|
745
758
|
if (e.footer !== void 0) return e.footer;
|
|
746
759
|
if (!e.aggregate) return "";
|
|
747
|
-
let t =
|
|
760
|
+
let t = vs(e, L.getFilteredRowModel().flatRows);
|
|
748
761
|
return typeof e.aggregate == "string" ? O.aggregates[e.aggregate]?.(t) ?? t : t;
|
|
749
|
-
},
|
|
762
|
+
}, bs = (e) => typeof Nr == "function" ? Nr(e.original) : Nr ?? [], [xs, Ss] = v(null), Cs = (e) => {
|
|
750
763
|
let t = e.target.closest("[data-row-id]");
|
|
751
|
-
|
|
752
|
-
},
|
|
753
|
-
e &&
|
|
764
|
+
Ss(t ? L.getRow(t.dataset.rowId, !0) ?? null : null);
|
|
765
|
+
}, ws = (e, t) => {
|
|
766
|
+
e && Pr?.({
|
|
754
767
|
value: t,
|
|
755
768
|
row: e.original,
|
|
756
769
|
rowId: e.id
|
|
757
770
|
});
|
|
758
|
-
},
|
|
771
|
+
}, Ts = (e) => {
|
|
759
772
|
try {
|
|
760
|
-
return
|
|
773
|
+
return L.getRow(e, !0) ?? void 0;
|
|
761
774
|
} catch {
|
|
762
775
|
return;
|
|
763
776
|
}
|
|
764
|
-
}, [
|
|
777
|
+
}, [X, Es] = v(null), [Ds, Os] = v(null), [ks, As] = v(null), js = _(null);
|
|
765
778
|
h(() => {
|
|
766
|
-
|
|
767
|
-
}, [
|
|
768
|
-
let
|
|
779
|
+
js.current &&= (xi.current?.querySelector(`[data-drag-handle="${CSS.escape(js.current)}"]`)?.focus(), null);
|
|
780
|
+
}, [Bi]);
|
|
781
|
+
let Ms = !!Tn, Ns = F.length > 0, Ps = (e) => F.map((t) => Re(e.getValue(t))).join("\0"), Fs = (e) => F.map((t) => {
|
|
769
782
|
let n = j.get(t);
|
|
770
783
|
return `${n?.header ?? t}: ${M(n, e.getValue(t), e.original)}`;
|
|
771
|
-
}).join(", "),
|
|
784
|
+
}).join(", "), Is = () => Y.filter((e) => e.kind === "row" && (Ns || e.row.depth === 0)).map((e) => e.row), Ls = () => {
|
|
772
785
|
let e = (t) => t.map((t) => ({
|
|
773
786
|
id: t.id,
|
|
774
|
-
...
|
|
787
|
+
...Tn?.(t.original) ? { children: e(t.subRows) } : {}
|
|
775
788
|
}));
|
|
776
|
-
return e(
|
|
777
|
-
},
|
|
778
|
-
let r = (e, t) => e < t ? t - 1 : t, i = e.index, a = r(i, t.index + +!!n), o =
|
|
789
|
+
return e(L.getCoreRowModel().rows);
|
|
790
|
+
}, Rs = (e, t, n) => {
|
|
791
|
+
let r = (e, t) => e < t ? t - 1 : t, i = e.index, a = r(i, t.index + +!!n), o = Ns && Ps(e) !== Ps(t);
|
|
779
792
|
if (i === a && !o) return;
|
|
780
793
|
let s = o ? Object.fromEntries(F.map((e) => [e, t.getValue(e)])) : void 0;
|
|
781
|
-
|
|
794
|
+
jr?.({
|
|
782
795
|
row: e.original,
|
|
783
796
|
rowId: e.id,
|
|
784
797
|
from: i,
|
|
785
798
|
to: a,
|
|
786
799
|
...s ? { group: s } : {}
|
|
787
800
|
});
|
|
788
|
-
let c =
|
|
789
|
-
|
|
790
|
-
},
|
|
801
|
+
let c = Is().filter((n) => n.id !== e.id && (!Ns || Ps(n) === Ps(t))).map((e) => e.id), ee = c.indexOf(t.id) + +!!n + 1, te = Ci(e.original, e.index);
|
|
802
|
+
_o(o ? O.rowMovedToGroup(te, Fs(t), ee, c.length + 1) : O.rowMoved(te, ee, c.length + 1));
|
|
803
|
+
}, zs = (e, t) => {
|
|
791
804
|
if (!t) return;
|
|
792
|
-
let n =
|
|
793
|
-
|
|
805
|
+
let n = Ls(), r = t.parentId ? Ts(t.parentId) : void 0, i = t.parentId ? Be(n, t.parentId)?.node.children ?? [] : n;
|
|
806
|
+
jr?.({
|
|
794
807
|
row: e.original,
|
|
795
808
|
rowId: e.id,
|
|
796
809
|
from: e.index,
|
|
797
810
|
to: t.index,
|
|
798
811
|
parentId: t.parentId,
|
|
799
812
|
index: t.index
|
|
800
|
-
}), r && !r.getIsExpanded() && r.toggleExpanded(!0),
|
|
801
|
-
},
|
|
802
|
-
if (
|
|
813
|
+
}), r && !r.getIsExpanded() && r.toggleExpanded(!0), _o(O.rowMovedInTree(Ci(e.original, e.index), r ? Ci(r.original, r.index) : null, t.index + 1, i.filter((t) => t.id !== e.id).length + 1));
|
|
814
|
+
}, Bs = (e, t) => {
|
|
815
|
+
if (Ms) {
|
|
803
816
|
let n = getComputedStyle(t.currentTarget).direction === "rtl", r = t.key === "ArrowUp" ? "up" : t.key === "ArrowDown" ? "down" : t.key === "ArrowRight" ? n ? "out" : "in" : t.key === "ArrowLeft" ? n ? "in" : "out" : void 0;
|
|
804
817
|
if (!r) return;
|
|
805
|
-
t.preventDefault(),
|
|
818
|
+
t.preventDefault(), js.current = e.id, zs(e, bt(Ls(), e.id, r));
|
|
806
819
|
return;
|
|
807
820
|
}
|
|
808
821
|
if (t.key !== "ArrowUp" && t.key !== "ArrowDown") return;
|
|
809
822
|
t.preventDefault();
|
|
810
|
-
let n =
|
|
811
|
-
if (
|
|
812
|
-
let r =
|
|
823
|
+
let n = Is();
|
|
824
|
+
if (Ns) {
|
|
825
|
+
let r = je(n.map((e) => ({
|
|
813
826
|
id: e.id,
|
|
814
|
-
group:
|
|
815
|
-
})), e.id, t.key === "ArrowUp" ? "up" : "down"), i = r &&
|
|
827
|
+
group: Ps(e)
|
|
828
|
+
})), e.id, t.key === "ArrowUp" ? "up" : "down"), i = r && Ts(r.targetId);
|
|
816
829
|
if (!r || !i) return;
|
|
817
|
-
|
|
830
|
+
js.current = e.id, Rs(e, i, r.after);
|
|
818
831
|
return;
|
|
819
832
|
}
|
|
820
833
|
let r = n[n.indexOf(e) + (t.key === "ArrowUp" ? -1 : 1)];
|
|
821
|
-
r && (
|
|
822
|
-
},
|
|
823
|
-
if (
|
|
824
|
-
|
|
825
|
-
},
|
|
826
|
-
if (!
|
|
834
|
+
r && (js.current = e.id, Rs(e, r, t.key === "ArrowDown"));
|
|
835
|
+
}, Vs = (e, t) => {
|
|
836
|
+
if (Ds !== e.id) return t.preventDefault();
|
|
837
|
+
Es(e.id), t.dataTransfer.setData("text/plain", e.id), t.dataTransfer.effectAllowed = "move";
|
|
838
|
+
}, Hs = (e, t) => {
|
|
839
|
+
if (!X || X === e.id) return;
|
|
827
840
|
let n = t.currentTarget.getBoundingClientRect(), r = (t.clientY - n.top) / n.height;
|
|
828
|
-
if (
|
|
829
|
-
let n =
|
|
830
|
-
if (!
|
|
831
|
-
t.preventDefault(),
|
|
841
|
+
if (Ms) {
|
|
842
|
+
let n = Tn?.(e.original) ? r < .25 ? "before" : r > .75 ? "after" : "inside" : r < .5 ? "before" : "after";
|
|
843
|
+
if (!vt(Ls(), X, e.id, n)) return As(null);
|
|
844
|
+
t.preventDefault(), As({
|
|
832
845
|
id: e.id,
|
|
833
846
|
position: n
|
|
834
847
|
});
|
|
835
|
-
} else t.preventDefault(),
|
|
848
|
+
} else t.preventDefault(), As({
|
|
836
849
|
id: e.id,
|
|
837
850
|
position: r > .5 ? "after" : "before"
|
|
838
851
|
});
|
|
839
|
-
},
|
|
840
|
-
|
|
852
|
+
}, Us = (e, t) => {
|
|
853
|
+
X && (t.preventDefault(), As({
|
|
841
854
|
id: e.id,
|
|
842
855
|
position: "inside"
|
|
843
856
|
}));
|
|
844
|
-
},
|
|
845
|
-
|
|
846
|
-
},
|
|
857
|
+
}, Ws = () => {
|
|
858
|
+
Es(null), As(null), Os(null);
|
|
859
|
+
}, Gs = (e) => {
|
|
847
860
|
e.preventDefault();
|
|
848
|
-
let t =
|
|
849
|
-
if (t && n &&
|
|
850
|
-
if (
|
|
861
|
+
let t = X ? Ts(X) : void 0, n = ks ? Ts(ks.id) : void 0;
|
|
862
|
+
if (t && n && ks) {
|
|
863
|
+
if (Ms) zs(t, vt(Ls(), t.id, n.id, ks.position));
|
|
851
864
|
else if (n.getIsGrouped()) {
|
|
852
865
|
let e = n.getLeafRows().filter((e) => !e.getIsGrouped() && e.id !== t.id).at(-1);
|
|
853
|
-
e &&
|
|
854
|
-
} else
|
|
866
|
+
e && Rs(t, e, !0);
|
|
867
|
+
} else Rs(t, n, ks.position === "after");
|
|
855
868
|
}
|
|
856
|
-
|
|
857
|
-
},
|
|
858
|
-
|
|
859
|
-
},
|
|
860
|
-
let n =
|
|
869
|
+
Ws();
|
|
870
|
+
}, Ks = (e) => ks?.id === e ? ks.position : void 0, [qs, Js] = v({}), Ys = _(qs), Xs = (e) => {
|
|
871
|
+
Ys.current = e, Js(e);
|
|
872
|
+
}, Zs = (e, t) => {
|
|
873
|
+
let n = tt(qs, e.id, t);
|
|
861
874
|
return n ? n.value : e.getValue(t);
|
|
862
|
-
},
|
|
875
|
+
}, Qs = w || T === "batch", [$s] = v(() => new p()), [, ec] = v(0), tc = () => ec((e) => e + 1), nc = (e, t = !0, n = !1) => {
|
|
863
876
|
if (e.length) {
|
|
864
|
-
if (
|
|
877
|
+
if (T === "batch") Xs(se(Ys.current, e, n));
|
|
865
878
|
else for (let t of n ? [...e].reverse() : e) {
|
|
866
|
-
let e =
|
|
867
|
-
e &&
|
|
879
|
+
let e = Ts(t.rowId);
|
|
880
|
+
e && qr?.({
|
|
868
881
|
row: e.original,
|
|
869
882
|
rowId: e.id,
|
|
870
883
|
columnId: t.columnId,
|
|
871
884
|
value: n ? t.before : t.after
|
|
872
885
|
});
|
|
873
886
|
}
|
|
874
|
-
if (
|
|
875
|
-
let e =
|
|
887
|
+
if (T === "row") for (let { rowId: t, values: r } of le(e, n)) {
|
|
888
|
+
let e = Ts(t);
|
|
876
889
|
if (!e) continue;
|
|
877
|
-
let n = A.filter((e) => e.editable).map((t) => [t.id,
|
|
878
|
-
|
|
890
|
+
let n = A.filter((e) => e.editable).map((t) => [t.id, Zs(e, t.id)]);
|
|
891
|
+
Jr?.({
|
|
879
892
|
row: e.original,
|
|
880
893
|
rowId: t,
|
|
881
894
|
values: {
|
|
@@ -884,23 +897,23 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
884
897
|
}
|
|
885
898
|
});
|
|
886
899
|
}
|
|
887
|
-
t &&
|
|
900
|
+
t && Qs && ($s.push(e), tc());
|
|
888
901
|
}
|
|
889
|
-
},
|
|
890
|
-
let e =
|
|
891
|
-
e && (
|
|
892
|
-
},
|
|
893
|
-
let e =
|
|
894
|
-
e && (
|
|
895
|
-
},
|
|
902
|
+
}, rc = () => {
|
|
903
|
+
let e = $s.undo();
|
|
904
|
+
e && (nc(e, !1, !0), tc(), _o(O.undone(e.length)));
|
|
905
|
+
}, ic = () => {
|
|
906
|
+
let e = $s.redo();
|
|
907
|
+
e && (nc(e, !1), tc(), _o(O.redone(e.length)));
|
|
908
|
+
}, ac = Object.keys(qs).length, oc = () => {
|
|
896
909
|
let e = $.current;
|
|
897
910
|
(e?.querySelector("[tabindex=\"0\"]") ?? e)?.focus();
|
|
898
|
-
},
|
|
899
|
-
let e = Object.values(
|
|
911
|
+
}, sc = () => {
|
|
912
|
+
let e = Object.values(Ys.current);
|
|
900
913
|
if (!e.length) return;
|
|
901
914
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
902
915
|
for (let r of e) {
|
|
903
|
-
let e =
|
|
916
|
+
let e = Ts(r.rowId);
|
|
904
917
|
if (!e) continue;
|
|
905
918
|
t.push({
|
|
906
919
|
row: e.original,
|
|
@@ -916,141 +929,141 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
916
929
|
};
|
|
917
930
|
i.values[r.columnId] = r.after, n.set(e.id, i);
|
|
918
931
|
}
|
|
919
|
-
|
|
932
|
+
Ur?.({
|
|
920
933
|
changes: t,
|
|
921
934
|
rows: [...n.values()]
|
|
922
|
-
}),
|
|
923
|
-
},
|
|
924
|
-
Object.keys(
|
|
925
|
-
}, [
|
|
926
|
-
|
|
927
|
-
}, [
|
|
928
|
-
|
|
929
|
-
},
|
|
935
|
+
}), Xs({}), $s.clear(), tc(), _o(O.changesSaved(t.length)), oc();
|
|
936
|
+
}, cc = () => {
|
|
937
|
+
Object.keys(Ys.current).length && (Xs({}), $s.clear(), tc(), _o(O.changesDiscarded), oc());
|
|
938
|
+
}, [lc, uc] = v(null), [dc, fc] = v(null), [pc, mc] = v({}), [hc, gc] = v({}), _c = _(pc), vc = (e) => {
|
|
939
|
+
_c.current = e, mc(e);
|
|
940
|
+
}, [yc, bc] = v(!1), xc = _(!1), Sc = (e) => {
|
|
941
|
+
J.current = e, vo.current = z;
|
|
942
|
+
}, Cc = (e) => e.editor ?? "text", wc = (e, t) => `${e}:${t}`, Tc = (e, t) => `${bi}-error-${e}-${t}`, Ec = "[data-editor] :is(input, button, [role=combobox], [tabindex=\"0\"])", Dc = () => Y.filter((e) => e.kind === "row").flatMap((e) => W.filter((e) => j.get(e.id)?.editable).map((t) => ({
|
|
930
943
|
rowId: e.row.id,
|
|
931
944
|
columnId: t.id
|
|
932
|
-
}))),
|
|
933
|
-
|
|
945
|
+
}))), Oc = (e, t) => {
|
|
946
|
+
jc({
|
|
934
947
|
rowId: e.id,
|
|
935
948
|
columnId: t
|
|
936
|
-
}),
|
|
937
|
-
},
|
|
938
|
-
let r = de(t.map((t) => [t, () => j.get(t)?.validate?.(n[t], e.original)])), i = (e) => (
|
|
939
|
-
return r instanceof Promise ? (
|
|
940
|
-
|
|
949
|
+
}), vc({ [t]: Zs(e, t) }), gc({}), J.current = Ec;
|
|
950
|
+
}, kc = (e, t, n) => {
|
|
951
|
+
let r = de(t.map((t) => [t, () => j.get(t)?.validate?.(n[t], e.original)])), i = (e) => (gc(e), Object.keys(e).length === 0);
|
|
952
|
+
return r instanceof Promise ? (xc.current = !0, bc(!0), r.then(i).finally(() => {
|
|
953
|
+
xc.current = !1, bc(!1);
|
|
941
954
|
})) : i(r);
|
|
942
|
-
},
|
|
943
|
-
|
|
944
|
-
},
|
|
945
|
-
if (!
|
|
946
|
-
let i =
|
|
955
|
+
}, Ac = _(lc), jc = (e) => {
|
|
956
|
+
Ac.current = e, uc(e);
|
|
957
|
+
}, Mc = (e, t, n, r = _c.current) => {
|
|
958
|
+
if (!lc || xc.current) return;
|
|
959
|
+
let i = kc(e, [t], r);
|
|
947
960
|
i instanceof Promise ? i.then((i) => {
|
|
948
|
-
let a =
|
|
949
|
-
a?.rowId === e.id && a.columnId === t && (i ?
|
|
950
|
-
}) : i ?
|
|
951
|
-
},
|
|
961
|
+
let a = Ac.current;
|
|
962
|
+
a?.rowId === e.id && a.columnId === t && (i ? Nc(e, t, n, r) : J.current = Ec);
|
|
963
|
+
}) : i ? Nc(e, t, n, r) : J.current = Ec;
|
|
964
|
+
}, Nc = (e, t, n, r) => {
|
|
952
965
|
let i = r[t];
|
|
953
|
-
|
|
954
|
-
let a =
|
|
955
|
-
if ((
|
|
966
|
+
jc(null);
|
|
967
|
+
let a = Zs(e, t);
|
|
968
|
+
if ((T === "batch" ? !ft(i, a) : i !== e.getValue(t)) && nc([{
|
|
956
969
|
rowId: e.id,
|
|
957
970
|
columnId: t,
|
|
958
971
|
before: a,
|
|
959
972
|
after: i
|
|
960
973
|
}]), n) {
|
|
961
|
-
let r =
|
|
962
|
-
if (i && a) return
|
|
974
|
+
let r = Dc(), i = r[r.findIndex((n) => n.rowId === e.id && n.columnId === t) + n], a = i && L.getRow(i.rowId, !0);
|
|
975
|
+
if (i && a) return Oc(a, i.columnId);
|
|
963
976
|
}
|
|
964
|
-
|
|
965
|
-
},
|
|
966
|
-
|
|
967
|
-
},
|
|
968
|
-
n.defaultPrevented || (n.key === "Escape" ? (n.preventDefault(),
|
|
969
|
-
},
|
|
977
|
+
Sc(`[data-edit="${CSS.escape(wc(e.id, t))}"]`);
|
|
978
|
+
}, Pc = (e, t) => {
|
|
979
|
+
jc(null), gc({}), Sc(`[data-edit="${CSS.escape(wc(e.id, t))}"]`);
|
|
980
|
+
}, Fc = (e, t, n) => {
|
|
981
|
+
n.defaultPrevented || (n.key === "Escape" ? (n.preventDefault(), Pc(e, t)) : n.key === "Enter" && (n.target.matches("textarea") ? n.ctrlKey || n.metaKey : !n.target.matches("button, [role=combobox]")) ? (n.preventDefault(), Mc(e, t)) : n.key === "Tab" && (n.preventDefault(), Mc(e, t, n.shiftKey ? -1 : 1)));
|
|
982
|
+
}, Ic = (e, t, n) => {
|
|
970
983
|
let r = n.relatedTarget, i = n.currentTarget;
|
|
971
|
-
r && (i.contains(r) || !
|
|
972
|
-
},
|
|
984
|
+
r && (i.contains(r) || !xi.current?.contains(r) && r.closest("[data-scope]")) || Mc(e, t);
|
|
985
|
+
}, Lc = (e, t, n) => {
|
|
973
986
|
let r = {
|
|
974
|
-
...
|
|
987
|
+
..._c.current,
|
|
975
988
|
[t.id]: n
|
|
976
989
|
};
|
|
977
|
-
|
|
978
|
-
},
|
|
979
|
-
value:
|
|
980
|
-
setValue: (e) =>
|
|
981
|
-
...
|
|
990
|
+
vc(r), eo && Bn.has(Cc(t)) && !t.renderEditor && Mc(e, t.id, void 0, r);
|
|
991
|
+
}, Rc = (e, t) => ({
|
|
992
|
+
value: pc[t.id],
|
|
993
|
+
setValue: (e) => vc({
|
|
994
|
+
..._c.current,
|
|
982
995
|
[t.id]: e
|
|
983
996
|
}),
|
|
984
997
|
row: e.original,
|
|
985
|
-
commit: () =>
|
|
986
|
-
cancel: () =>
|
|
987
|
-
invalid: !!
|
|
988
|
-
}),
|
|
989
|
-
|
|
990
|
-
},
|
|
991
|
-
if (
|
|
992
|
-
let n =
|
|
993
|
-
|
|
998
|
+
commit: () => eo ? Mc(e, t.id) : Bc(e, !0),
|
|
999
|
+
cancel: () => eo ? Pc(e, t.id) : Bc(e, !1),
|
|
1000
|
+
invalid: !!hc[t.id]
|
|
1001
|
+
}), zc = (e) => {
|
|
1002
|
+
fc(e.id), gc({}), vc(Object.fromEntries(A.filter((e) => e.editable).map((t) => [t.id, e.getValue(t.id)]))), J.current = Ec;
|
|
1003
|
+
}, Bc = (e, t) => {
|
|
1004
|
+
if (xc.current) return;
|
|
1005
|
+
let n = _c.current, r = () => {
|
|
1006
|
+
fc(null), gc({}), Sc(`[data-row-edit="${CSS.escape(e.id)}"]`);
|
|
994
1007
|
};
|
|
995
1008
|
if (!t) return r();
|
|
996
1009
|
let i = A.filter((e) => e.editable).map((e) => e.id), a = (t) => {
|
|
997
|
-
t ? (
|
|
1010
|
+
t ? (Jr?.({
|
|
998
1011
|
row: e.original,
|
|
999
1012
|
rowId: e.id,
|
|
1000
1013
|
values: { ...n }
|
|
1001
|
-
}), r()) :
|
|
1002
|
-
}, o =
|
|
1014
|
+
}), r()) : J.current = Ec;
|
|
1015
|
+
}, o = kc(e, i, n);
|
|
1003
1016
|
o instanceof Promise ? o.then(a) : a(o);
|
|
1004
|
-
},
|
|
1005
|
-
t.defaultPrevented || (t.key === "Escape" ? (t.preventDefault(),
|
|
1006
|
-
}, [
|
|
1007
|
-
if (!
|
|
1008
|
-
let n =
|
|
1009
|
-
return n >=
|
|
1010
|
-
},
|
|
1011
|
-
let t =
|
|
1017
|
+
}, Vc = (e, t) => {
|
|
1018
|
+
t.defaultPrevented || (t.key === "Escape" ? (t.preventDefault(), Bc(e, !1)) : t.key === "Enter" && t.target.matches("input") && (t.preventDefault(), Bc(e, !0)));
|
|
1019
|
+
}, [Z, Hc] = v(null), Uc = Y.filter((e) => e.kind === "row").map((e) => e.row.id), Wc = W.map((e) => e.id), Gc = w ? ct(Z, Uc, Wc) : null, Kc = new Map(Uc.map((e, t) => [e, t])), qc = new Map(Wc.map((e, t) => [e, t])), Jc = (e, t) => {
|
|
1020
|
+
if (!Gc) return !1;
|
|
1021
|
+
let n = Kc.get(e) ?? -1, r = qc.get(t) ?? -1;
|
|
1022
|
+
return n >= Gc.top && n <= Gc.bottom && r >= Gc.left && r <= Gc.right;
|
|
1023
|
+
}, Yc = (e) => {
|
|
1024
|
+
let t = ct(e, Uc, Wc);
|
|
1012
1025
|
if (!t) return null;
|
|
1013
|
-
let n =
|
|
1026
|
+
let n = Uc.slice(t.top, t.bottom + 1), r = Wc.slice(t.left, t.right + 1), i = n.flatMap((e) => Ts(e) ?? []);
|
|
1014
1027
|
return {
|
|
1015
1028
|
rowIds: n,
|
|
1016
1029
|
columnIds: r,
|
|
1017
1030
|
rows: i.map((e) => e.original),
|
|
1018
|
-
values: i.map((e) => r.map((t) =>
|
|
1031
|
+
values: i.map((e) => r.map((t) => Zs(e, t)))
|
|
1019
1032
|
};
|
|
1020
|
-
},
|
|
1021
|
-
e &&
|
|
1022
|
-
},
|
|
1033
|
+
}, Xc = (e) => {
|
|
1034
|
+
e && Z && e.anchor.rowId === Z.anchor.rowId && e.anchor.columnId === Z.anchor.columnId && e.focus.rowId === Z.focus.rowId && e.focus.columnId === Z.focus.columnId || !e && !Z || (Hc(e), Vr?.(Yc(e)));
|
|
1035
|
+
}, Zc = _(!1), Qc = _(!1), $c = _(!1);
|
|
1023
1036
|
h(() => {
|
|
1024
|
-
if (!
|
|
1025
|
-
let e = () =>
|
|
1037
|
+
if (!w) return;
|
|
1038
|
+
let e = () => Zc.current = !1;
|
|
1026
1039
|
return window.addEventListener("pointerup", e), () => window.removeEventListener("pointerup", e);
|
|
1027
|
-
}, [
|
|
1028
|
-
let
|
|
1029
|
-
if (!
|
|
1040
|
+
}, [w]);
|
|
1041
|
+
let el = (e, t, n) => {
|
|
1042
|
+
if (!w || n.button !== 0 || n.target.closest("[data-editor]")) return;
|
|
1030
1043
|
let r = {
|
|
1031
1044
|
rowId: e,
|
|
1032
1045
|
columnId: t
|
|
1033
|
-
}, i = n.shiftKey &&
|
|
1034
|
-
|
|
1035
|
-
anchor:
|
|
1046
|
+
}, i = n.shiftKey && Z;
|
|
1047
|
+
Xc(i ? {
|
|
1048
|
+
anchor: Z.anchor,
|
|
1036
1049
|
focus: r
|
|
1037
1050
|
} : {
|
|
1038
1051
|
anchor: r,
|
|
1039
1052
|
focus: r
|
|
1040
|
-
}),
|
|
1041
|
-
},
|
|
1042
|
-
|
|
1043
|
-
anchor:
|
|
1053
|
+
}), Zc.current = !0, $c.current = !!i, i && window.getSelection()?.removeAllRanges();
|
|
1054
|
+
}, tl = (e, t, n) => {
|
|
1055
|
+
Zc.current && Z && n.buttons & 1 && (Xc({
|
|
1056
|
+
anchor: Z.anchor,
|
|
1044
1057
|
focus: {
|
|
1045
1058
|
rowId: e,
|
|
1046
1059
|
columnId: t
|
|
1047
1060
|
}
|
|
1048
1061
|
}), window.getSelection()?.removeAllRanges());
|
|
1049
|
-
},
|
|
1050
|
-
|
|
1051
|
-
},
|
|
1062
|
+
}, nl = (e) => {
|
|
1063
|
+
$c.current && ($c.current = !1, e.preventDefault(), e.stopPropagation());
|
|
1064
|
+
}, rl = (e, t) => $.current?.querySelector(`tr[data-row-id="${CSS.escape(e)}"] > [data-column-id="${CSS.escape(t)}"]`) ?? null, il = (e) => {
|
|
1052
1065
|
let t = e.target, n = e.key;
|
|
1053
|
-
if (!
|
|
1066
|
+
if (!w || !z || !e.shiftKey || e.altKey || ![
|
|
1054
1067
|
"ArrowUp",
|
|
1055
1068
|
"ArrowDown",
|
|
1056
1069
|
"ArrowLeft",
|
|
@@ -1060,7 +1073,7 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1060
1073
|
].includes(n)) return !1;
|
|
1061
1074
|
let r = t.closest("tr")?.dataset.rowId, i = t.dataset.columnId;
|
|
1062
1075
|
if (!r || !i || !t.matches("td")) return !1;
|
|
1063
|
-
let a = getComputedStyle(t).direction === "rtl", o = n === "ArrowUp" ? "up" : n === "ArrowDown" ? "down" : n === "Home" ? "home" : n === "End" ? "end" : n === "ArrowRight" === a ? "previous" : "next", s =
|
|
1076
|
+
let a = getComputedStyle(t).direction === "rtl", o = n === "ArrowUp" ? "up" : n === "ArrowDown" ? "down" : n === "Home" ? "home" : n === "End" ? "end" : n === "ArrowRight" === a ? "previous" : "next", s = Z && Jc(r, i) ? Z : {
|
|
1064
1077
|
anchor: {
|
|
1065
1078
|
rowId: r,
|
|
1066
1079
|
columnId: i
|
|
@@ -1069,46 +1082,46 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1069
1082
|
rowId: r,
|
|
1070
1083
|
columnId: i
|
|
1071
1084
|
}
|
|
1072
|
-
}, c =
|
|
1073
|
-
e.preventDefault(),
|
|
1085
|
+
}, c = Ee(s, Uc, Wc, o, e.ctrlKey || e.metaKey);
|
|
1086
|
+
e.preventDefault(), Xc(c);
|
|
1074
1087
|
let ee = () => {
|
|
1075
|
-
let e =
|
|
1076
|
-
return e ? (
|
|
1088
|
+
let e = rl(c.focus.rowId, c.focus.columnId);
|
|
1089
|
+
return e ? (Qc.current = !0, e.focus(), Qc.current = !1, e.scrollIntoView?.({
|
|
1077
1090
|
block: "nearest",
|
|
1078
1091
|
inline: "nearest"
|
|
1079
1092
|
}), !0) : !1;
|
|
1080
1093
|
};
|
|
1081
|
-
return !ee() &&
|
|
1082
|
-
},
|
|
1083
|
-
let e =
|
|
1094
|
+
return !ee() && B && (Yl?.scrollToIndex(Y.findIndex((e) => e.kind === "row" && e.row.id === c.focus.rowId)), requestAnimationFrame(() => requestAnimationFrame(() => void ee()))), !0;
|
|
1095
|
+
}, al = (e, t) => M(j.get(t), Zs(e, t), e.original), ol = () => {
|
|
1096
|
+
let e = Yc(Z);
|
|
1084
1097
|
if (e) {
|
|
1085
|
-
let t = e.rowIds.flatMap((e) =>
|
|
1098
|
+
let t = e.rowIds.flatMap((e) => Ts(e) ?? []);
|
|
1086
1099
|
return {
|
|
1087
|
-
text:
|
|
1100
|
+
text: _t(t.map((t) => e.columnIds.map((e) => al(t, e)))),
|
|
1088
1101
|
count: t.length * e.columnIds.length
|
|
1089
1102
|
};
|
|
1090
1103
|
}
|
|
1091
|
-
let t =
|
|
1104
|
+
let t = Y.filter((e) => e.kind === "row" && Xo(e.row)).map((e) => e.row);
|
|
1092
1105
|
return t.length ? {
|
|
1093
|
-
text:
|
|
1094
|
-
count: t.length *
|
|
1106
|
+
text: _t(t.map((e) => Wc.map((t) => al(e, t)))),
|
|
1107
|
+
count: t.length * Wc.length
|
|
1095
1108
|
} : null;
|
|
1096
|
-
},
|
|
1109
|
+
}, sl = () => {
|
|
1097
1110
|
let e = document.activeElement;
|
|
1098
|
-
return !!e && !!$.current?.contains(e) && !e.closest(
|
|
1099
|
-
},
|
|
1100
|
-
if (!
|
|
1101
|
-
let t =
|
|
1102
|
-
t && (e.clipboardData.setData("text/plain", t.text), e.preventDefault(),
|
|
1103
|
-
},
|
|
1104
|
-
let t =
|
|
1105
|
-
if (!t.length || !n || !
|
|
1106
|
-
let r =
|
|
1111
|
+
return !!e && !!$.current?.contains(e) && !e.closest(Gn);
|
|
1112
|
+
}, cl = (e) => {
|
|
1113
|
+
if (!sl() || !e.clipboardData || window.getSelection()?.toString()) return;
|
|
1114
|
+
let t = ol();
|
|
1115
|
+
t && (e.clipboardData.setData("text/plain", t.text), e.preventDefault(), _o(O.cellsCopied(t.count)));
|
|
1116
|
+
}, ll = async (e) => {
|
|
1117
|
+
let t = $e(e), n = ct(Z, Uc, Wc);
|
|
1118
|
+
if (!t.length || !n || !Z) return;
|
|
1119
|
+
let r = et(t, {
|
|
1107
1120
|
row: n.top,
|
|
1108
1121
|
column: n.left
|
|
1109
|
-
},
|
|
1122
|
+
}, Uc, Wc, n), i = [], a = [];
|
|
1110
1123
|
for (let e of r) {
|
|
1111
|
-
let t = j.get(e.columnId), n =
|
|
1124
|
+
let t = j.get(e.columnId), n = Ts(e.rowId);
|
|
1112
1125
|
if (!t || !n) continue;
|
|
1113
1126
|
if (!t.editable) {
|
|
1114
1127
|
i.push({
|
|
@@ -1117,7 +1130,7 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1117
1130
|
});
|
|
1118
1131
|
continue;
|
|
1119
1132
|
}
|
|
1120
|
-
let r =
|
|
1133
|
+
let r = Qe(e.text, Cc(t), {
|
|
1121
1134
|
locale: D,
|
|
1122
1135
|
choices: t.editOptions
|
|
1123
1136
|
});
|
|
@@ -1128,8 +1141,8 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1128
1141
|
});
|
|
1129
1142
|
continue;
|
|
1130
1143
|
}
|
|
1131
|
-
let o =
|
|
1132
|
-
|
|
1144
|
+
let o = Zs(n, e.columnId);
|
|
1145
|
+
ft(r.value, o) || a.push({
|
|
1133
1146
|
change: {
|
|
1134
1147
|
rowId: n.id,
|
|
1135
1148
|
columnId: t.id,
|
|
@@ -1162,113 +1175,113 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1162
1175
|
c.defaultPrevented = !0;
|
|
1163
1176
|
}
|
|
1164
1177
|
};
|
|
1165
|
-
|
|
1166
|
-
},
|
|
1167
|
-
if (!
|
|
1178
|
+
Hr?.(c), !c.defaultPrevented && (nc(s.map(({ change: e }) => e)), Xc(st(r, Uc, Wc)), _o(O.cellsPasted(s.length, i.length)));
|
|
1179
|
+
}, ul = (e) => {
|
|
1180
|
+
if (!sl()) return;
|
|
1168
1181
|
let t = e.clipboardData?.getData("text/plain");
|
|
1169
|
-
t && (e.preventDefault(),
|
|
1182
|
+
t && (e.preventDefault(), ll(t));
|
|
1170
1183
|
};
|
|
1171
1184
|
h(() => {
|
|
1172
|
-
if (
|
|
1173
|
-
document.removeEventListener("copy",
|
|
1185
|
+
if (w) return document.addEventListener("copy", cl), document.addEventListener("paste", ul), () => {
|
|
1186
|
+
document.removeEventListener("copy", cl), document.removeEventListener("paste", ul);
|
|
1174
1187
|
};
|
|
1175
1188
|
});
|
|
1176
|
-
let
|
|
1177
|
-
if (!
|
|
1178
|
-
let t =
|
|
1179
|
-
return t ? (e.preventDefault(), t === "undo" ?
|
|
1180
|
-
}, [
|
|
1189
|
+
let dl = (e) => {
|
|
1190
|
+
if (!Qs || e.target.closest(Gn)) return !1;
|
|
1191
|
+
let t = Me(e);
|
|
1192
|
+
return t ? (e.preventDefault(), t === "undo" ? rc() : ic(), !0) : !1;
|
|
1193
|
+
}, [fl, pl] = v(!1), [ml, hl] = v(""), [gl, _l] = v(0), vl = Wr && fl && !!ml.trim(), yl = vl ? (Za && !k ? L.getPrePaginatedRowModel().rows : L.getRowModel().rows).filter((e) => !e.getIsGrouped()) : [], Q = vl ? De(yl.map((e) => ({
|
|
1181
1194
|
id: e.id,
|
|
1182
|
-
cells:
|
|
1195
|
+
cells: W.map((t) => ({
|
|
1183
1196
|
columnId: t.id,
|
|
1184
|
-
text:
|
|
1197
|
+
text: al(e, t.id)
|
|
1185
1198
|
}))
|
|
1186
|
-
})),
|
|
1199
|
+
})), ml, D) : [], bl = Q.length ? Q[Math.min(gl, Q.length - 1)] : void 0, xl = new Set(Q.map((e) => `${e.rowId}\u0000${e.columnId}`)), Sl = (e, t) => vl ? bl?.rowId === e && bl.columnId === t ? V.findCurrent() : xl.has(`${e}\u0000${t}`) ? V.findMatch() : "" : "", Cl = _(!1), wl = (e) => {
|
|
1187
1200
|
if (!Q.length) return;
|
|
1188
1201
|
let t = (e + Q.length) % Q.length;
|
|
1189
|
-
|
|
1202
|
+
_l(t);
|
|
1190
1203
|
let n = Q[t];
|
|
1191
|
-
if (
|
|
1192
|
-
let e =
|
|
1193
|
-
e >= 0 && t !== P.pageIndex &&
|
|
1204
|
+
if (Za && !k) {
|
|
1205
|
+
let e = yl.findIndex((e) => e.id === n.rowId), t = Math.floor(e / P.pageSize);
|
|
1206
|
+
e >= 0 && t !== P.pageIndex && L.setPageIndex(t);
|
|
1194
1207
|
}
|
|
1195
|
-
|
|
1208
|
+
Cl.current = !0;
|
|
1196
1209
|
};
|
|
1197
1210
|
h(() => {
|
|
1198
|
-
if (!
|
|
1199
|
-
|
|
1200
|
-
let e = () =>
|
|
1211
|
+
if (!Cl.current || !bl) return;
|
|
1212
|
+
Cl.current = !1;
|
|
1213
|
+
let e = () => rl(bl.rowId, bl.columnId)?.scrollIntoView?.({
|
|
1201
1214
|
block: "nearest",
|
|
1202
1215
|
inline: "nearest"
|
|
1203
|
-
}), t =
|
|
1204
|
-
|
|
1216
|
+
}), t = Y.findIndex((e) => e.kind === "row" && e.row.id === bl.rowId);
|
|
1217
|
+
B && t >= 0 ? (Yl?.scrollToIndex(t, { align: "center" }), requestAnimationFrame(() => requestAnimationFrame(e))) : e();
|
|
1205
1218
|
});
|
|
1206
|
-
let
|
|
1207
|
-
let e = !
|
|
1208
|
-
|
|
1209
|
-
},
|
|
1210
|
-
e.key === "Enter" ? (e.preventDefault(),
|
|
1211
|
-
},
|
|
1212
|
-
|
|
1213
|
-
},
|
|
1214
|
-
if (!
|
|
1215
|
-
let e =
|
|
1219
|
+
let Tl = () => {
|
|
1220
|
+
let e = !fl;
|
|
1221
|
+
pl(e), J.current = e ? "[data-find-input] input, input[data-find-input]" : "[data-find-toggle]";
|
|
1222
|
+
}, El = (e) => {
|
|
1223
|
+
e.key === "Enter" ? (e.preventDefault(), wl(gl + (e.shiftKey ? -1 : 1))) : e.key === "Escape" && (e.preventDefault(), Tl());
|
|
1224
|
+
}, Dl = (e) => {
|
|
1225
|
+
hl(e), _l(0), Cl.current = !0;
|
|
1226
|
+
}, Ol = !B && A.some((e) => e.rowSpan === "auto" || e.colSpan), kl = (e) => `${bi}-head-${e}`, Al = (() => {
|
|
1227
|
+
if (!Ol) return;
|
|
1228
|
+
let e = Y.map((e) => e.kind === "row" ? lt(W.map((t) => j.get(t.id)?.colSpan?.(e.row.original) ?? 1)) : W.map(() => 1)), t = Y.map((e, t) => e.kind !== "row" || Y[t - 1]?.kind !== "row"), n = W.map((e) => j.get(e.id)?.rowSpan === "auto"), r = (t, n) => Y.map((r, i) => r.kind === "row" && e[i][n] === 1 ? al(r.row, t) : null), i = ce(W.flatMap((e, t) => n[t] ? [r(e.id, t)] : []), t), a = 0;
|
|
1216
1229
|
return {
|
|
1217
1230
|
columnSpans: e,
|
|
1218
1231
|
rowSpans: n.map((e) => e ? i[a++] : void 0)
|
|
1219
1232
|
};
|
|
1220
|
-
})(),
|
|
1221
|
-
rowSpan:
|
|
1222
|
-
colSpan:
|
|
1223
|
-
}),
|
|
1224
|
-
if (!
|
|
1225
|
-
let { rowSpan: n, colSpan: r } =
|
|
1233
|
+
})(), jl = (e, t) => ({
|
|
1234
|
+
rowSpan: Al?.rowSpans[t]?.[e] ?? 1,
|
|
1235
|
+
colSpan: Al?.columnSpans[e]?.[t] ?? 1
|
|
1236
|
+
}), Ml = (e, t) => {
|
|
1237
|
+
if (!Ol) return {};
|
|
1238
|
+
let { rowSpan: n, colSpan: r } = jl(e, t);
|
|
1226
1239
|
return {
|
|
1227
1240
|
...n > 1 ? { rowSpan: n } : {},
|
|
1228
1241
|
...r > 1 ? { colSpan: r } : {},
|
|
1229
|
-
headers:
|
|
1242
|
+
headers: W.slice(t, t + r).map((e) => kl(e.id)).join(" ")
|
|
1230
1243
|
};
|
|
1231
|
-
},
|
|
1232
|
-
let t =
|
|
1233
|
-
return e.bom === !1 ?
|
|
1234
|
-
},
|
|
1244
|
+
}, Nl = (e = {}) => {
|
|
1245
|
+
let t = L.getVisibleLeafColumns().map((e) => j.get(e.id)).filter((e) => e.exportable !== !1), n = (e.selectionOnly ? L.getSelectedRowModel().flatRows : L.getSortedRowModel().flatRows).filter((e) => !e.getIsGrouped()).map((e) => t.map((t) => t.exportValue ? t.exportValue(e.original) : M(t, e.getValue(t.id), e.original))), r = e.separator ?? Tr ?? ge(D), i = ht([t.map((e) => e.exportHeader ?? e.header), ...n], r);
|
|
1246
|
+
return e.bom === !1 ? i.slice(1) : i;
|
|
1247
|
+
}, Pl = (e = !1) => {
|
|
1235
1248
|
let t = typeof e == "boolean" ? { selectionOnly: e } : e;
|
|
1236
|
-
|
|
1237
|
-
},
|
|
1249
|
+
Ce(`${t.filename ?? wr ?? "export"}.csv`, Nl(t));
|
|
1250
|
+
}, Fl = (e) => [{
|
|
1238
1251
|
row: e,
|
|
1239
1252
|
group: e.getIsGrouped(),
|
|
1240
1253
|
depth: e.depth
|
|
1241
|
-
}, ...e.subRows.flatMap(
|
|
1254
|
+
}, ...e.subRows.flatMap(Fl)], Il = (e = !1) => e ? L.getSelectedRowModel().flatRows.filter((e) => !e.getIsGrouped()).map((e) => ({
|
|
1242
1255
|
row: e,
|
|
1243
1256
|
group: !1,
|
|
1244
1257
|
depth: 0
|
|
1245
|
-
})) :
|
|
1258
|
+
})) : L.getSortedRowModel().rows.flatMap(Fl), Ll = (e) => {
|
|
1246
1259
|
let t = j.get(e.groupingColumnId);
|
|
1247
1260
|
return `${t?.header ?? ""}: ${M(t, e.groupingValue, e.original)} (${e.getLeafRows().filter((e) => !e.getIsGrouped()).length})`;
|
|
1248
|
-
},
|
|
1261
|
+
}, Rl = (e) => e.editor === "datetime" ? "datetime" : e.filter === "date" || e.editor === "date" ? "date" : void 0, zl = (e, t, n) => {
|
|
1249
1262
|
if (e == null || e === "") return null;
|
|
1250
1263
|
if (typeof e == "number") return Number.isFinite(e) ? e : null;
|
|
1251
1264
|
if (e instanceof Date) return {
|
|
1252
1265
|
date: e,
|
|
1253
|
-
time:
|
|
1266
|
+
time: Rl(t) === "datetime"
|
|
1254
1267
|
};
|
|
1255
|
-
let r =
|
|
1268
|
+
let r = Rl(t);
|
|
1256
1269
|
return r && (typeof e == "string" || typeof e == "number") ? {
|
|
1257
1270
|
date: e,
|
|
1258
1271
|
time: r === "datetime"
|
|
1259
|
-
} : typeof e == "boolean" && !t.format ? e : n ? M(t, e, n) :
|
|
1260
|
-
},
|
|
1261
|
-
let t =
|
|
1272
|
+
} : typeof e == "boolean" && !t.format ? e : n ? M(t, e, n) : C(e);
|
|
1273
|
+
}, Bl = (e = {}) => {
|
|
1274
|
+
let t = L.getVisibleLeafColumns().map((e) => j.get(e.id)).filter((e) => e.exportable !== !1), n = Il(e.selectionOnly).filter((t) => !t.group || e.groups !== !1).map(({ row: n, group: r, depth: i }) => {
|
|
1262
1275
|
if (r) {
|
|
1263
1276
|
let e = n.getLeafRows().filter((e) => !e.getIsGrouped());
|
|
1264
1277
|
return {
|
|
1265
1278
|
kind: "group",
|
|
1266
1279
|
level: i,
|
|
1267
1280
|
cells: t.map((t, r) => {
|
|
1268
|
-
if (r === 0) return
|
|
1281
|
+
if (r === 0) return Ll(n);
|
|
1269
1282
|
if (!t.aggregate) return null;
|
|
1270
|
-
let i = oe(e.map((e) =>
|
|
1271
|
-
return typeof i == "number" ? i :
|
|
1283
|
+
let i = oe(e.map((e) => Gi(t, e.original)), t.aggregate);
|
|
1284
|
+
return typeof i == "number" ? i : C(i);
|
|
1272
1285
|
})
|
|
1273
1286
|
};
|
|
1274
1287
|
}
|
|
@@ -1277,18 +1290,18 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1277
1290
|
cells: t.map((e) => {
|
|
1278
1291
|
if (e.exportValue) {
|
|
1279
1292
|
let t = e.exportValue(n.original);
|
|
1280
|
-
return typeof t == "number" || typeof t == "boolean" ? t : t instanceof Date ? { date: t } :
|
|
1293
|
+
return typeof t == "number" || typeof t == "boolean" ? t : t instanceof Date ? { date: t } : C(t);
|
|
1281
1294
|
}
|
|
1282
|
-
return
|
|
1295
|
+
return zl(n.getValue(e.id), e, n.original);
|
|
1283
1296
|
})
|
|
1284
1297
|
};
|
|
1285
1298
|
});
|
|
1286
1299
|
if (e.totals !== !1 && t.some((e) => e.aggregate || e.footer)) {
|
|
1287
|
-
let e =
|
|
1300
|
+
let e = L.getFilteredRowModel().flatRows.filter((e) => !e.getIsGrouped()), r = t.map((t) => {
|
|
1288
1301
|
if (t.footer !== void 0) return t.footer;
|
|
1289
1302
|
if (!t.aggregate) return null;
|
|
1290
|
-
let n = oe(e.map((e) =>
|
|
1291
|
-
return typeof n == "number" ? n :
|
|
1303
|
+
let n = oe(e.map((e) => Gi(t, e.original)), t.aggregate);
|
|
1304
|
+
return typeof n == "number" ? n : C(n);
|
|
1292
1305
|
});
|
|
1293
1306
|
r[0] === null && (r[0] = O.total), n.push({
|
|
1294
1307
|
kind: "total",
|
|
@@ -1296,129 +1309,133 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1296
1309
|
});
|
|
1297
1310
|
}
|
|
1298
1311
|
return he({
|
|
1299
|
-
name: e.sheetName ??
|
|
1312
|
+
name: e.sheetName ?? Te,
|
|
1300
1313
|
columns: t.map((e) => ({ header: e.exportHeader ?? e.header })),
|
|
1301
1314
|
rows: n
|
|
1302
1315
|
});
|
|
1303
|
-
},
|
|
1304
|
-
let t =
|
|
1305
|
-
text:
|
|
1316
|
+
}, Vl = (e = {}) => Se(`${e.filename ?? wr ?? "export"}.xlsx`, Bl(e)), Hl = (e, t) => e === "xlsx" ? Vl({ selectionOnly: t }) : Pl(t), Ul = (e = {}) => {
|
|
1317
|
+
let t = W.map((e) => j.get(e.id)), n = fo.map((e) => e.map((e) => ({
|
|
1318
|
+
text: q(e.header.column),
|
|
1306
1319
|
colSpan: e.group ? e.header.colSpan : 1,
|
|
1307
1320
|
rowSpan: e.rowSpan,
|
|
1308
1321
|
align: e.group ? void 0 : j.get(e.header.column.id)?.align
|
|
1309
|
-
}))), r =
|
|
1322
|
+
}))), r = Il(e.selectionOnly).map(({ row: e, group: n }) => n ? {
|
|
1310
1323
|
kind: "group",
|
|
1311
1324
|
cells: [{
|
|
1312
|
-
text:
|
|
1325
|
+
text: Ll(e),
|
|
1313
1326
|
colSpan: t.length
|
|
1314
1327
|
}]
|
|
1315
1328
|
} : { cells: t.map((t) => ({
|
|
1316
|
-
text:
|
|
1329
|
+
text: al(e, t.id),
|
|
1317
1330
|
align: t.align
|
|
1318
|
-
})) }), i =
|
|
1319
|
-
text:
|
|
1331
|
+
})) }), i = gs ? t.map((e) => ({
|
|
1332
|
+
text: ys(e),
|
|
1320
1333
|
align: e.align
|
|
1321
1334
|
})) : void 0;
|
|
1322
|
-
|
|
1323
|
-
title: e.title ??
|
|
1324
|
-
caption:
|
|
1335
|
+
it(at({
|
|
1336
|
+
title: e.title ?? Te,
|
|
1337
|
+
caption: Te,
|
|
1325
1338
|
lang: D,
|
|
1326
|
-
dir: getComputedStyle(
|
|
1339
|
+
dir: getComputedStyle(xi.current ?? document.body).direction === "rtl" ? "rtl" : "ltr",
|
|
1327
1340
|
head: n,
|
|
1328
1341
|
body: r,
|
|
1329
1342
|
foot: i
|
|
1330
1343
|
}));
|
|
1331
|
-
},
|
|
1332
|
-
|
|
1333
|
-
},
|
|
1334
|
-
s && await
|
|
1344
|
+
}, Wl = () => {
|
|
1345
|
+
si && ue(si, ci);
|
|
1346
|
+
}, Gl = async () => {
|
|
1347
|
+
s && await Oi.refresh();
|
|
1335
1348
|
};
|
|
1336
|
-
|
|
1337
|
-
exportCsv:
|
|
1338
|
-
generateCsv:
|
|
1339
|
-
clearState:
|
|
1340
|
-
exportXlsx:
|
|
1341
|
-
generateXlsx:
|
|
1342
|
-
print:
|
|
1343
|
-
refresh:
|
|
1344
|
-
undo:
|
|
1345
|
-
redo:
|
|
1346
|
-
})),
|
|
1347
|
-
if (!
|
|
1349
|
+
Qt(hi, () => ({
|
|
1350
|
+
exportCsv: Pl,
|
|
1351
|
+
generateCsv: Nl,
|
|
1352
|
+
clearState: Wl,
|
|
1353
|
+
exportXlsx: Vl,
|
|
1354
|
+
generateXlsx: Bl,
|
|
1355
|
+
print: Ul,
|
|
1356
|
+
refresh: Gl,
|
|
1357
|
+
undo: rc,
|
|
1358
|
+
redo: ic
|
|
1359
|
+
})), $t(() => {
|
|
1360
|
+
if (!R) return;
|
|
1348
1361
|
let e = [];
|
|
1349
|
-
for (let t of document.body.children) t !==
|
|
1362
|
+
for (let t of document.body.children) t !== xi.current && t instanceof HTMLElement && !t.inert && (t.inert = !0, e.push(t));
|
|
1350
1363
|
return () => e.forEach((e) => e.inert = !1);
|
|
1351
|
-
}, [
|
|
1352
|
-
let
|
|
1353
|
-
|
|
1354
|
-
},
|
|
1355
|
-
|
|
1356
|
-
},
|
|
1357
|
-
count:
|
|
1358
|
-
getScrollElement: () =>
|
|
1359
|
-
estimateSize: () =>
|
|
1364
|
+
}, [R]);
|
|
1365
|
+
let Kl = () => {
|
|
1366
|
+
Ja(!R), J.current = "[data-fullscreen-toggle]";
|
|
1367
|
+
}, ql = (e) => {
|
|
1368
|
+
R && e.key === "Escape" && !e.defaultPrevented && (e.preventDefault(), Kl());
|
|
1369
|
+
}, Jl = _(null), Yl = (Si.useVirtualizer ?? qn)({
|
|
1370
|
+
count: B ? Y.length : 0,
|
|
1371
|
+
getScrollElement: () => Jl.current,
|
|
1372
|
+
estimateSize: () => ii,
|
|
1360
1373
|
overscan: 8,
|
|
1361
|
-
getItemKey: (e) =>
|
|
1374
|
+
getItemKey: (e) => Y[e]?.key ?? e,
|
|
1362
1375
|
initialRect: {
|
|
1363
1376
|
width: 0,
|
|
1364
|
-
height: Number.parseInt(
|
|
1377
|
+
height: Number.parseInt(ti ?? "", 10) || 400
|
|
1365
1378
|
}
|
|
1366
|
-
})
|
|
1367
|
-
|
|
1379
|
+
});
|
|
1380
|
+
h(() => {
|
|
1381
|
+
ri && !Si.useVirtualizer && xt("DataTable: `virtual` needs the feature virtualRows, so all rows are rendered – pass `features={[virtualRows]}` with virtualRows from @wirecore/wirelayer-react/virtual");
|
|
1382
|
+
}, [ri, Si]);
|
|
1383
|
+
let Xl = B ? Yl?.getVirtualItems() ?? [] : [], Zl = B ? Xl.map((e) => ({
|
|
1384
|
+
...Y[e.index],
|
|
1368
1385
|
index: e.index
|
|
1369
|
-
})) :
|
|
1386
|
+
})) : Y.map((e, t) => ({
|
|
1370
1387
|
...e,
|
|
1371
1388
|
index: t
|
|
1372
|
-
})),
|
|
1373
|
-
|
|
1374
|
-
},
|
|
1389
|
+
})), Ql = B ? Xl[0]?.start ?? 0 : 0, $l = B ? (Yl?.getTotalSize() ?? 0) - (Xl.at(-1)?.end ?? 0) : 0, eu = (e) => {
|
|
1390
|
+
B && e && Yl?.measureElement(e);
|
|
1391
|
+
}, tu = _(!1);
|
|
1375
1392
|
h(() => {
|
|
1376
|
-
|
|
1377
|
-
}, [
|
|
1378
|
-
let
|
|
1393
|
+
tu.current = !1;
|
|
1394
|
+
}, [Bi.length]);
|
|
1395
|
+
let nu = (e) => {
|
|
1379
1396
|
let t = e.currentTarget;
|
|
1380
|
-
|
|
1381
|
-
},
|
|
1397
|
+
tu.current || t.scrollTop + t.clientHeight < t.scrollHeight - 80 || (tu.current = !0, ai?.(), oi?.());
|
|
1398
|
+
}, ru = _(null), [iu, au] = v(0);
|
|
1382
1399
|
h(() => {
|
|
1383
|
-
if (!
|
|
1384
|
-
let e = new ResizeObserver(() =>
|
|
1385
|
-
return e.observe(
|
|
1400
|
+
if (!ru.current || typeof ResizeObserver > "u") return;
|
|
1401
|
+
let e = new ResizeObserver(() => au(ru.current?.offsetHeight ?? 0));
|
|
1402
|
+
return e.observe(ru.current), () => e.disconnect();
|
|
1386
1403
|
}, []);
|
|
1387
1404
|
let $ = _(null);
|
|
1388
1405
|
h(() => {
|
|
1389
|
-
|
|
1406
|
+
z && $.current && mt($.current);
|
|
1390
1407
|
});
|
|
1391
|
-
let
|
|
1408
|
+
let ou = (e) => {
|
|
1392
1409
|
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || e.defaultPrevented) return !1;
|
|
1393
1410
|
let t = e.target, n = t.closest("td"), r = n?.parentElement?.dataset.rowId;
|
|
1394
|
-
if (!n || !r || n.cellIndex !==
|
|
1395
|
-
let i =
|
|
1411
|
+
if (!n || !r || n.cellIndex !== H.length || t.closest(Gn)) return !1;
|
|
1412
|
+
let i = L.getRow(r, !0);
|
|
1396
1413
|
if (!i) return !1;
|
|
1397
1414
|
let a = getComputedStyle($.current).direction === "rtl", o = {
|
|
1398
1415
|
expandable: i.getCanExpand(),
|
|
1399
1416
|
expanded: i.getIsExpanded(),
|
|
1400
1417
|
level: i.depth + 1
|
|
1401
|
-
}, s =
|
|
1418
|
+
}, s = yt(e.key, o, a);
|
|
1402
1419
|
if (!s) return !1;
|
|
1403
1420
|
if (e.preventDefault(), s === "parent") {
|
|
1404
1421
|
let e = i.getParentRow();
|
|
1405
|
-
$.current?.querySelector(`tr[data-row-id="${CSS.escape(e?.id ?? "")}"] > td:nth-child(${
|
|
1422
|
+
$.current?.querySelector(`tr[data-row-id="${CSS.escape(e?.id ?? "")}"] > td:nth-child(${H.length + 1})`)?.focus();
|
|
1406
1423
|
} else i.toggleExpanded(s === "expand");
|
|
1407
1424
|
return !0;
|
|
1408
|
-
},
|
|
1409
|
-
|
|
1410
|
-
itemCount:
|
|
1411
|
-
scrollToItem:
|
|
1412
|
-
pageRows:
|
|
1425
|
+
}, su = (e) => {
|
|
1426
|
+
z && $.current && (Xa && ou(e) || Ae(e.nativeEvent, $.current, {
|
|
1427
|
+
itemCount: Y.length,
|
|
1428
|
+
scrollToItem: B ? (e) => Yl?.scrollToIndex(e) : void 0,
|
|
1429
|
+
pageRows: Jl.current && ti ? Math.max(1, Math.floor(Jl.current.clientHeight / ii) - 1) : 10,
|
|
1413
1430
|
onSelectRow: (e) => {
|
|
1414
|
-
let t =
|
|
1415
|
-
t?.getCanSelect() &&
|
|
1431
|
+
let t = L.getRow(e, !0);
|
|
1432
|
+
t?.getCanSelect() && rs(t, !Jo || !Xo(t));
|
|
1416
1433
|
}
|
|
1417
1434
|
}));
|
|
1418
|
-
},
|
|
1419
|
-
|
|
1435
|
+
}, cu = (e) => {
|
|
1436
|
+
z && $.current && ke($.current, e.target);
|
|
1420
1437
|
let t = e.target, n = t.closest("tr")?.dataset.rowId, r = t.dataset.columnId;
|
|
1421
|
-
|
|
1438
|
+
w && z && !Zc.current && !Qc.current && n && r && t.matches("td") && Xc({
|
|
1422
1439
|
anchor: {
|
|
1423
1440
|
rowId: n,
|
|
1424
1441
|
columnId: r
|
|
@@ -1428,449 +1445,449 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1428
1445
|
columnId: r
|
|
1429
1446
|
}
|
|
1430
1447
|
});
|
|
1431
|
-
},
|
|
1432
|
-
|
|
1433
|
-
},
|
|
1448
|
+
}, lu = (e) => {
|
|
1449
|
+
dl(e) || il(e) || su(e);
|
|
1450
|
+
}, uu = _(!1);
|
|
1434
1451
|
h(() => {
|
|
1435
|
-
if (!
|
|
1436
|
-
let e =
|
|
1437
|
-
|
|
1452
|
+
if (!si) return;
|
|
1453
|
+
let e = ze(si, ci);
|
|
1454
|
+
uu.current = !0, e && (e.sorting && za(e.sorting), e.filters && L.setColumnFilters(Fn(e.filters)), e.globalFilter !== void 0 && L.setGlobalFilter(e.globalFilter), e.columnSizing && Na(e.columnSizing), e.columnOrder && L.setColumnOrder(e.columnOrder), e.hiddenColumns && L.setColumnVisibility(In(e.hiddenColumns, !1)), e.pinnedColumns && L.setColumnPinning(e.pinnedColumns), e.expanded && e.expanded.length && Ga(In(e.expanded)), e.selection && Ha(Ln(e.selection)), e.density && Ka(e.density), (e.page || e.pageSize) && Ba({
|
|
1438
1455
|
pageIndex: (e.page ?? 1) - 1,
|
|
1439
1456
|
pageSize: e.pageSize ?? P.pageSize
|
|
1440
1457
|
}));
|
|
1441
1458
|
}, []);
|
|
1442
|
-
let
|
|
1459
|
+
let du = {
|
|
1443
1460
|
sorting: N,
|
|
1444
|
-
filters:
|
|
1445
|
-
globalFilter:
|
|
1461
|
+
filters: Pn(Sa),
|
|
1462
|
+
globalFilter: I,
|
|
1446
1463
|
page: P.pageIndex + 1,
|
|
1447
1464
|
pageSize: P.pageSize,
|
|
1448
|
-
columnSizing:
|
|
1449
|
-
columnOrder:
|
|
1450
|
-
hiddenColumns: Object.keys(
|
|
1451
|
-
pinnedColumns:
|
|
1452
|
-
expanded:
|
|
1453
|
-
selection: Object.keys(
|
|
1454
|
-
density:
|
|
1455
|
-
},
|
|
1465
|
+
columnSizing: Ma,
|
|
1466
|
+
columnOrder: Oa,
|
|
1467
|
+
hiddenColumns: Object.keys(Ta).filter((e) => Ta[e] === !1),
|
|
1468
|
+
pinnedColumns: ja,
|
|
1469
|
+
expanded: _a === !0 ? [] : Object.keys(_a).filter((e) => _a[e]),
|
|
1470
|
+
selection: Object.keys(ia).filter((e) => ia[e]),
|
|
1471
|
+
density: Pa
|
|
1472
|
+
}, fu = JSON.stringify(du);
|
|
1456
1473
|
h(() => {
|
|
1457
|
-
|
|
1474
|
+
si && uu.current && pt(si, JSON.parse(fu), ci);
|
|
1458
1475
|
}, [
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1476
|
+
si,
|
|
1477
|
+
ci,
|
|
1478
|
+
fu
|
|
1462
1479
|
]);
|
|
1463
|
-
let
|
|
1480
|
+
let pu = {
|
|
1464
1481
|
page: P.pageIndex + 1,
|
|
1465
1482
|
pageSize: m ? P.pageSize : 0,
|
|
1466
1483
|
sorting: N.map((e) => ({
|
|
1467
1484
|
id: e.id,
|
|
1468
1485
|
desc: e.desc
|
|
1469
1486
|
})),
|
|
1470
|
-
filters:
|
|
1471
|
-
search:
|
|
1487
|
+
filters: Pn(Sa),
|
|
1488
|
+
search: I,
|
|
1472
1489
|
groupBy: F,
|
|
1473
|
-
...
|
|
1474
|
-
},
|
|
1475
|
-
...
|
|
1490
|
+
...Ii ? { condition: Mi } : {}
|
|
1491
|
+
}, mu = ot(pu), hu = ot({
|
|
1492
|
+
...pu,
|
|
1476
1493
|
page: void 0,
|
|
1477
1494
|
pageSize: void 0
|
|
1478
|
-
}),
|
|
1495
|
+
}), gu = _(void 0), _u = _(I);
|
|
1479
1496
|
h(() => {
|
|
1480
1497
|
if (!s) return;
|
|
1481
|
-
let e =
|
|
1482
|
-
if (
|
|
1483
|
-
|
|
1498
|
+
let e = gu.current !== void 0 && gu.current !== hu;
|
|
1499
|
+
if (gu.current = hu, e && P.pageIndex !== 0) {
|
|
1500
|
+
Ba({
|
|
1484
1501
|
...P,
|
|
1485
1502
|
pageIndex: 0
|
|
1486
1503
|
});
|
|
1487
1504
|
return;
|
|
1488
1505
|
}
|
|
1489
|
-
let t =
|
|
1490
|
-
|
|
1491
|
-
}, [
|
|
1492
|
-
let
|
|
1506
|
+
let t = _u.current !== I;
|
|
1507
|
+
_u.current = I, Oi.load(JSON.parse(mu), { debounce: t });
|
|
1508
|
+
}, [mu, !!s]);
|
|
1509
|
+
let vu = k ? Hi ?? Bi.length : L.getPrePaginatedRowModel().rows.length, yu = (Ye ?? []).map((e) => ({
|
|
1493
1510
|
value: String(e),
|
|
1494
1511
|
label: String(e)
|
|
1495
|
-
})),
|
|
1496
|
-
if (!
|
|
1497
|
-
let e =
|
|
1498
|
-
return e.length ?
|
|
1499
|
-
let n = j.get(t.id), r =
|
|
1512
|
+
})), bu = Wr || rr || hr || !!wr || Zr || ei || fr || Ri || !!li || !!ui || !!di, xu = or ? I : "", Su = Wi && bn === "skeleton", Cu = Math.min(Y.length || m || 5, 50), wu = Ro && (k || Bi.length > 0) && (pi !== void 0 || Sn !== void 0), Tu = (() => {
|
|
1513
|
+
if (!Br) return [];
|
|
1514
|
+
let e = L.getSelectedRowModel().flatRows.filter((e) => !e.getIsGrouped());
|
|
1515
|
+
return e.length ? W.flatMap((t) => {
|
|
1516
|
+
let n = j.get(t.id), r = Ze(e.map((e) => Gi(n, e.original)));
|
|
1500
1517
|
if (!r) return [];
|
|
1501
1518
|
let i = e[0].original;
|
|
1502
1519
|
return [{
|
|
1503
1520
|
id: t.id,
|
|
1504
|
-
text: `${n.header}: ${O.aggregates.sum(
|
|
1521
|
+
text: `${n.header}: ${O.aggregates.sum(_s(n, r.sum, i))} · ${O.aggregates.avg(_s(n, r.avg, i))}`
|
|
1505
1522
|
}];
|
|
1506
1523
|
}) : [];
|
|
1507
|
-
})(),
|
|
1524
|
+
})(), Eu = k ? Hi ?? Bi.length : L.getCoreRowModel().rows.length, Du = Lr ? W.find((e) => {
|
|
1508
1525
|
let t = j.get(e.id);
|
|
1509
|
-
return !t?.copyable && !(
|
|
1510
|
-
})?.id : void 0,
|
|
1511
|
-
let e =
|
|
1512
|
-
return
|
|
1526
|
+
return !t?.copyable && !(eo && t?.editable);
|
|
1527
|
+
})?.id : void 0, Ou = (e, t) => t === Du ? Lr?.(e.original) : void 0, ku = (e) => e.columns ? e.columns.flatMap(ku) : [e.id], Au = Vi.some((e) => e.columns) ? (() => {
|
|
1528
|
+
let e = L.getAllLeafColumns(), t = (t) => e.findIndex((e) => e.id === t);
|
|
1529
|
+
return Vi.map((n) => ({
|
|
1513
1530
|
def: n,
|
|
1514
|
-
leaves:
|
|
1531
|
+
leaves: ku(n).map((n) => e[t(n)]).filter(Boolean).sort((e, n) => t(e.id) - t(n.id))
|
|
1515
1532
|
})).sort((e, n) => t(e.leaves[0]?.id ?? "") - t(n.leaves[0]?.id ?? ""));
|
|
1516
|
-
})() : void 0,
|
|
1517
|
-
let n =
|
|
1533
|
+
})() : void 0, ju = (e, t) => {
|
|
1534
|
+
let n = Vi.map((e) => ({
|
|
1518
1535
|
id: e.id,
|
|
1519
|
-
leaves:
|
|
1520
|
-
})), r =
|
|
1536
|
+
leaves: ku(e)
|
|
1537
|
+
})), r = qe(L.getAllLeafColumns().map((e) => e.id), n, e, t);
|
|
1521
1538
|
if (!r) return;
|
|
1522
|
-
|
|
1539
|
+
L.setColumnOrder(r);
|
|
1523
1540
|
let i = n.map((e) => e.id).sort((e, t) => r.indexOf(n.find((t) => t.id === e).leaves[0]) - r.indexOf(n.find((e) => e.id === t).leaves[0]));
|
|
1524
|
-
|
|
1525
|
-
},
|
|
1541
|
+
_o(O.columnMoved(j.get(e)?.header ?? e, i.indexOf(e) + 1, i.length));
|
|
1542
|
+
}, Mu = Er?.length ? Er : ["csv"], Nu = cn && Zo > 0, Pu = Mu.length === 1 && Mu[0] === "csv" ? Nu ? [{
|
|
1526
1543
|
value: "all",
|
|
1527
1544
|
label: O.exportAll
|
|
1528
1545
|
}, {
|
|
1529
1546
|
value: "selection",
|
|
1530
1547
|
label: O.exportSelection
|
|
1531
|
-
}] : [] :
|
|
1548
|
+
}] : [] : Mu.flatMap((e) => Nu ? [{
|
|
1532
1549
|
value: `${e}:all`,
|
|
1533
1550
|
label: O.exportAs(e, !1)
|
|
1534
1551
|
}, {
|
|
1535
1552
|
value: `${e}:selection`,
|
|
1536
1553
|
label: O.exportAs(e, !0)
|
|
1537
|
-
}] :
|
|
1554
|
+
}] : Mu.length > 1 ? [{
|
|
1538
1555
|
value: `${e}:all`,
|
|
1539
1556
|
label: O.exportAs(e, !1)
|
|
1540
|
-
}] : []),
|
|
1541
|
-
className:
|
|
1542
|
-
children: [
|
|
1543
|
-
className:
|
|
1557
|
+
}] : []), Fu = Mu.length > 1 ? O.exportMenu : Mu[0] === "xlsx" ? O.exportXlsx : O.export, Iu = /* @__PURE__ */ b("div", {
|
|
1558
|
+
className: V.footer(),
|
|
1559
|
+
children: [yu.length > 0 && /* @__PURE__ */ b("div", {
|
|
1560
|
+
className: V.pageSize(),
|
|
1544
1561
|
children: [/* @__PURE__ */ y("span", {
|
|
1545
1562
|
"aria-hidden": "true",
|
|
1546
1563
|
children: O.rowsPerPage
|
|
1547
1564
|
}), /* @__PURE__ */ y(ne, {
|
|
1548
|
-
className:
|
|
1565
|
+
className: V.pageSizeSelect(),
|
|
1549
1566
|
"aria-label": O.rowsPerPage,
|
|
1550
|
-
items:
|
|
1567
|
+
items: yu,
|
|
1551
1568
|
value: String(P.pageSize),
|
|
1552
|
-
onValueChange: (e) =>
|
|
1569
|
+
onValueChange: (e) => L.setPageSize(Number(e))
|
|
1553
1570
|
})]
|
|
1554
1571
|
}), /* @__PURE__ */ y(r, {
|
|
1555
|
-
count:
|
|
1572
|
+
count: vu,
|
|
1556
1573
|
pageSize: P.pageSize,
|
|
1557
1574
|
page: P.pageIndex + 1,
|
|
1558
|
-
translations: { rootLabel: `${
|
|
1559
|
-
onPageChange: (e) =>
|
|
1575
|
+
translations: { rootLabel: `${Te}: ${E.pagination.rootLabel}` },
|
|
1576
|
+
onPageChange: (e) => L.setPageIndex(e - 1)
|
|
1560
1577
|
})]
|
|
1561
|
-
}),
|
|
1562
|
-
let i =
|
|
1578
|
+
}), Lu = (e, t, n, r) => {
|
|
1579
|
+
let i = w && Jc(e.id, t), a = T === "batch" && !!tt(qs, e.id, t);
|
|
1563
1580
|
return {
|
|
1564
1581
|
className: [
|
|
1565
|
-
i ?
|
|
1566
|
-
a ?
|
|
1567
|
-
|
|
1582
|
+
i ? V.cellSelected() : "",
|
|
1583
|
+
a ? V.cellChanged() : "",
|
|
1584
|
+
Sl(e.id, t)
|
|
1568
1585
|
],
|
|
1569
1586
|
attributes: {
|
|
1570
|
-
...
|
|
1571
|
-
...
|
|
1587
|
+
...w || Wr ? { "data-column-id": t } : {},
|
|
1588
|
+
...w && z ? { "aria-selected": i } : {},
|
|
1572
1589
|
...a ? { "data-changed": "" } : {},
|
|
1573
|
-
...
|
|
1574
|
-
...
|
|
1575
|
-
onPointerDown: (n) =>
|
|
1576
|
-
onPointerEnter: (n) =>
|
|
1577
|
-
onClickCapture:
|
|
1590
|
+
...Ml(n, r),
|
|
1591
|
+
...w ? {
|
|
1592
|
+
onPointerDown: (n) => el(e.id, t, n),
|
|
1593
|
+
onPointerEnter: (n) => tl(e.id, t, n),
|
|
1594
|
+
onClickCapture: nl
|
|
1578
1595
|
} : {}
|
|
1579
1596
|
}
|
|
1580
1597
|
};
|
|
1581
|
-
},
|
|
1582
|
-
icon:
|
|
1598
|
+
}, Ru = (e, t) => dc === e.id ? /* @__PURE__ */ b(en, { children: [/* @__PURE__ */ y(u, {
|
|
1599
|
+
icon: Tt,
|
|
1583
1600
|
label: O.saveRow(t),
|
|
1584
1601
|
variant: "text",
|
|
1585
1602
|
size: "sm",
|
|
1586
|
-
onClick: () =>
|
|
1603
|
+
onClick: () => Bc(e, !0)
|
|
1587
1604
|
}), /* @__PURE__ */ y(u, {
|
|
1588
|
-
icon:
|
|
1605
|
+
icon: qt,
|
|
1589
1606
|
label: O.cancelEdit(t),
|
|
1590
1607
|
variant: "text",
|
|
1591
1608
|
size: "sm",
|
|
1592
|
-
onClick: () =>
|
|
1609
|
+
onClick: () => Bc(e, !1)
|
|
1593
1610
|
})] }) : /* @__PURE__ */ y(u, {
|
|
1594
1611
|
"data-row-edit": e.id,
|
|
1595
|
-
icon:
|
|
1612
|
+
icon: zt,
|
|
1596
1613
|
label: O.editRow(t),
|
|
1597
1614
|
variant: "text",
|
|
1598
1615
|
size: "sm",
|
|
1599
|
-
onClick: () =>
|
|
1600
|
-
}),
|
|
1601
|
-
let r = j.get(t.id), i = M(r, n, e.original), a =
|
|
1602
|
-
if (r?.editable && (
|
|
1616
|
+
onClick: () => zc(e)
|
|
1617
|
+
}), zu = (e, t, n) => {
|
|
1618
|
+
let r = j.get(t.id), i = M(r, n, e.original), a = T === "batch" && !!tt(qs, e.id, t.id), o = r?.cell ? r.cell(e.original, n) : void 0;
|
|
1619
|
+
if (r?.editable && (eo && lc?.rowId === e.id && lc.columnId === t.id || T === "row" && dc === e.id)) return /* @__PURE__ */ b("div", {
|
|
1603
1620
|
"data-editor": "",
|
|
1604
|
-
className:
|
|
1605
|
-
"aria-busy":
|
|
1606
|
-
onKeyDown: (n) =>
|
|
1607
|
-
onBlur:
|
|
1608
|
-
children: [r.renderEditor ? r.renderEditor(
|
|
1609
|
-
type:
|
|
1610
|
-
label:
|
|
1621
|
+
className: V.editor(),
|
|
1622
|
+
"aria-busy": yc || void 0,
|
|
1623
|
+
onKeyDown: (n) => eo ? Fc(e, t.id, n) : Vc(e, n),
|
|
1624
|
+
onBlur: eo ? (n) => Ic(e, t.id, n) : void 0,
|
|
1625
|
+
children: [r.renderEditor ? r.renderEditor(Rc(e, r)) : /* @__PURE__ */ y(An, {
|
|
1626
|
+
type: Cc(r),
|
|
1627
|
+
label: q(t),
|
|
1611
1628
|
options: r.editOptions,
|
|
1612
|
-
invalid: !!
|
|
1613
|
-
value:
|
|
1614
|
-
onChange: (t) =>
|
|
1615
|
-
}),
|
|
1616
|
-
id:
|
|
1629
|
+
invalid: !!hc[t.id],
|
|
1630
|
+
value: pc[t.id],
|
|
1631
|
+
onChange: (t) => Lc(e, r, t)
|
|
1632
|
+
}), hc[t.id] && /* @__PURE__ */ y("span", {
|
|
1633
|
+
id: Tc(e.id, t.id),
|
|
1617
1634
|
role: "alert",
|
|
1618
|
-
className:
|
|
1619
|
-
children:
|
|
1635
|
+
className: V.editError(),
|
|
1636
|
+
children: hc[t.id]
|
|
1620
1637
|
})]
|
|
1621
1638
|
});
|
|
1622
|
-
if (
|
|
1639
|
+
if (eo && r?.editable) return /* @__PURE__ */ y("button", {
|
|
1623
1640
|
type: "button",
|
|
1624
|
-
className:
|
|
1625
|
-
"data-edit":
|
|
1626
|
-
"aria-label": a ? `${O.edit(
|
|
1627
|
-
onClick: () =>
|
|
1641
|
+
className: Qa(t.id).editButton(),
|
|
1642
|
+
"data-edit": wc(e.id, t.id),
|
|
1643
|
+
"aria-label": a ? `${O.edit(q(t), i)}, ${O.changed}` : O.edit(q(t), i),
|
|
1644
|
+
onClick: () => Oc(e, t.id),
|
|
1628
1645
|
children: o ?? i
|
|
1629
1646
|
});
|
|
1630
1647
|
if (r?.copyable) return /* @__PURE__ */ b("span", {
|
|
1631
|
-
className:
|
|
1648
|
+
className: V.copyCell(),
|
|
1632
1649
|
children: [o ?? i, /* @__PURE__ */ y(ae, {
|
|
1633
1650
|
value: i,
|
|
1634
|
-
label: O.copy(
|
|
1651
|
+
label: O.copy(q(t), i)
|
|
1635
1652
|
})]
|
|
1636
1653
|
});
|
|
1637
|
-
let s =
|
|
1654
|
+
let s = vl ? ml.trim() : xu, c = o === void 0 ? s ? /* @__PURE__ */ y(ie, {
|
|
1638
1655
|
text: i,
|
|
1639
1656
|
query: s
|
|
1640
|
-
}) : i : o, ee =
|
|
1657
|
+
}) : i : o, ee = Ou(e, t.id);
|
|
1641
1658
|
return ee ? /* @__PURE__ */ y("a", {
|
|
1642
1659
|
href: ee,
|
|
1643
|
-
className:
|
|
1660
|
+
className: V.rowLink(),
|
|
1644
1661
|
"data-row-link": "",
|
|
1645
1662
|
children: c
|
|
1646
1663
|
}) : c;
|
|
1647
|
-
},
|
|
1648
|
-
onContextMenuCapture:
|
|
1664
|
+
}, Bu = /* @__PURE__ */ b("tbody", {
|
|
1665
|
+
onContextMenuCapture: Cs,
|
|
1649
1666
|
children: [
|
|
1650
|
-
|
|
1651
|
-
colSpan:
|
|
1652
|
-
className:
|
|
1653
|
-
children:
|
|
1654
|
-
className:
|
|
1667
|
+
Y.length === 0 && !Su && /* @__PURE__ */ y("tr", { children: /* @__PURE__ */ y("td", {
|
|
1668
|
+
colSpan: to,
|
|
1669
|
+
className: V.message(),
|
|
1670
|
+
children: Ui ? /* @__PURE__ */ b("span", {
|
|
1671
|
+
className: V.errorContent(),
|
|
1655
1672
|
children: [/* @__PURE__ */ y("span", {
|
|
1656
1673
|
role: "alert",
|
|
1657
1674
|
children: E.dataSource.error
|
|
1658
1675
|
}), /* @__PURE__ */ y(l, {
|
|
1659
1676
|
variant: "outline",
|
|
1660
1677
|
size: "sm",
|
|
1661
|
-
onClick: () => void
|
|
1678
|
+
onClick: () => void Gl(),
|
|
1662
1679
|
children: E.dataSource.retry
|
|
1663
1680
|
})]
|
|
1664
|
-
}) :
|
|
1665
|
-
className:
|
|
1681
|
+
}) : Wi ? mi ?? /* @__PURE__ */ b("span", {
|
|
1682
|
+
className: V.messageContent(),
|
|
1666
1683
|
children: [/* @__PURE__ */ y(f, {
|
|
1667
1684
|
size: "sm",
|
|
1668
|
-
label:
|
|
1669
|
-
}),
|
|
1670
|
-
}) :
|
|
1685
|
+
label: Cn ?? E.common.loading
|
|
1686
|
+
}), Cn ?? E.common.loading]
|
|
1687
|
+
}) : wu ? pi ?? Sn ?? xn ?? E.common.empty : fi ?? xn ?? E.common.empty
|
|
1671
1688
|
}) }),
|
|
1672
|
-
|
|
1673
|
-
className:
|
|
1689
|
+
Su && Array.from({ length: Cu }, (e, t) => /* @__PURE__ */ b("tr", {
|
|
1690
|
+
className: V.row(),
|
|
1674
1691
|
children: [
|
|
1675
|
-
|
|
1676
|
-
className:
|
|
1677
|
-
style:
|
|
1692
|
+
H.map((e) => /* @__PURE__ */ y("td", {
|
|
1693
|
+
className: V.td({ class: G(e, !1) }),
|
|
1694
|
+
style: K(e)
|
|
1678
1695
|
}, e)),
|
|
1679
|
-
|
|
1680
|
-
className:
|
|
1681
|
-
style:
|
|
1696
|
+
W.map((e) => /* @__PURE__ */ y("td", {
|
|
1697
|
+
className: Qa(e.id).td({ class: so(e.id, !1) }),
|
|
1698
|
+
style: co(e.id, !1),
|
|
1682
1699
|
children: /* @__PURE__ */ y(i, {})
|
|
1683
1700
|
}, e.id)),
|
|
1684
|
-
|
|
1685
|
-
className:
|
|
1686
|
-
style:
|
|
1701
|
+
U.length > 0 && /* @__PURE__ */ y("td", {
|
|
1702
|
+
className: V.td({ class: G("actions", !1) }),
|
|
1703
|
+
style: K("actions")
|
|
1687
1704
|
})
|
|
1688
1705
|
]
|
|
1689
1706
|
}, `skeleton-${t + 1}`)),
|
|
1690
|
-
|
|
1691
|
-
className:
|
|
1707
|
+
Ql > 0 && !Su && /* @__PURE__ */ y("tr", {
|
|
1708
|
+
className: V.spacer(),
|
|
1692
1709
|
"aria-hidden": "true",
|
|
1693
1710
|
children: /* @__PURE__ */ y("td", {
|
|
1694
|
-
colSpan:
|
|
1695
|
-
className:
|
|
1696
|
-
style: { height:
|
|
1711
|
+
colSpan: to,
|
|
1712
|
+
className: V.spacerCell(),
|
|
1713
|
+
style: { height: Ql }
|
|
1697
1714
|
})
|
|
1698
1715
|
}),
|
|
1699
|
-
(
|
|
1700
|
-
let t = e.row, n =
|
|
1716
|
+
(Su ? [] : Zl).map((e) => {
|
|
1717
|
+
let t = e.row, n = B ? e.index + fo.length + 1 : void 0;
|
|
1701
1718
|
if (e.kind === "group") {
|
|
1702
1719
|
let r = j.get(t.groupingColumnId), i = M(r, t.groupingValue, t.original), a = t.getLeafRows().length;
|
|
1703
1720
|
return /* @__PURE__ */ b("tr", {
|
|
1704
|
-
ref:
|
|
1705
|
-
className:
|
|
1721
|
+
ref: eu,
|
|
1722
|
+
className: V.groupRow({ class: X ? [V.dropTarget(), V.dropInside()] : void 0 }),
|
|
1706
1723
|
"data-index": e.index,
|
|
1707
1724
|
"aria-rowindex": n,
|
|
1708
|
-
"data-drop":
|
|
1709
|
-
onDragOver:
|
|
1710
|
-
onDragLeave:
|
|
1711
|
-
onDrop:
|
|
1725
|
+
"data-drop": X ? Ks(t.id) : void 0,
|
|
1726
|
+
onDragOver: Ar ? (e) => Us(t, e) : void 0,
|
|
1727
|
+
onDragLeave: Ar ? () => As(null) : void 0,
|
|
1728
|
+
onDrop: Ar ? Gs : void 0,
|
|
1712
1729
|
children: [/* @__PURE__ */ y("td", {
|
|
1713
|
-
colSpan:
|
|
1714
|
-
className:
|
|
1730
|
+
colSpan: hs ? H.length + 1 : to,
|
|
1731
|
+
className: V.groupCell(),
|
|
1715
1732
|
children: /* @__PURE__ */ b("div", {
|
|
1716
|
-
className:
|
|
1733
|
+
className: V.treeCell(),
|
|
1717
1734
|
style: { paddingInlineStart: t.depth * 20 },
|
|
1718
1735
|
children: [
|
|
1719
1736
|
/* @__PURE__ */ y("button", {
|
|
1720
1737
|
type: "button",
|
|
1721
|
-
className:
|
|
1738
|
+
className: V.expander(),
|
|
1722
1739
|
"aria-expanded": t.getIsExpanded(),
|
|
1723
1740
|
"aria-label": O.group(r?.header ?? "", i, a),
|
|
1724
1741
|
onClick: t.getToggleExpandedHandler(),
|
|
1725
|
-
children: /* @__PURE__ */ y(
|
|
1726
|
-
className:
|
|
1742
|
+
children: /* @__PURE__ */ y(Dt, {
|
|
1743
|
+
className: V.expanderIcon(),
|
|
1727
1744
|
"data-state": t.getIsExpanded() ? "open" : "closed",
|
|
1728
1745
|
"aria-hidden": "true"
|
|
1729
1746
|
})
|
|
1730
1747
|
}),
|
|
1731
1748
|
/* @__PURE__ */ y("span", {
|
|
1732
|
-
className:
|
|
1749
|
+
className: V.groupLabel(),
|
|
1733
1750
|
children: i
|
|
1734
1751
|
}),
|
|
1735
1752
|
/* @__PURE__ */ y("span", {
|
|
1736
|
-
className:
|
|
1753
|
+
className: V.groupCount(),
|
|
1737
1754
|
children: `(${a})`
|
|
1738
1755
|
})
|
|
1739
1756
|
]
|
|
1740
1757
|
})
|
|
1741
|
-
}),
|
|
1742
|
-
className:
|
|
1743
|
-
children:
|
|
1744
|
-
}, e.id)),
|
|
1758
|
+
}), hs && /* @__PURE__ */ b(en, { children: [W.slice(1).map((e) => /* @__PURE__ */ y("td", {
|
|
1759
|
+
className: Qa(e.id).groupAggregate(),
|
|
1760
|
+
children: vs(j.get(e.id), t.getLeafRows())
|
|
1761
|
+
}, e.id)), U.length > 0 && /* @__PURE__ */ y("td", { className: V.groupAggregate() })] })]
|
|
1745
1762
|
}, e.key);
|
|
1746
1763
|
}
|
|
1747
1764
|
if (e.kind === "expansion") return /* @__PURE__ */ y("tr", {
|
|
1748
|
-
id:
|
|
1749
|
-
ref:
|
|
1750
|
-
className:
|
|
1765
|
+
id: fs(t),
|
|
1766
|
+
ref: eu,
|
|
1767
|
+
className: V.expansionRow(),
|
|
1751
1768
|
"data-index": e.index,
|
|
1752
1769
|
"aria-rowindex": n,
|
|
1753
1770
|
children: /* @__PURE__ */ y("td", {
|
|
1754
|
-
colSpan:
|
|
1755
|
-
className:
|
|
1756
|
-
children:
|
|
1771
|
+
colSpan: to,
|
|
1772
|
+
className: V.expansionCell(),
|
|
1773
|
+
children: Qn?.(t.original, t.id)
|
|
1757
1774
|
})
|
|
1758
1775
|
}, e.key);
|
|
1759
|
-
let r =
|
|
1776
|
+
let r = Ci(t.original, t.index);
|
|
1760
1777
|
return /* @__PURE__ */ b("tr", {
|
|
1761
|
-
ref:
|
|
1762
|
-
className:
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1778
|
+
ref: eu,
|
|
1779
|
+
className: V.row({ class: [
|
|
1780
|
+
Ar ? V.dropTarget() : "",
|
|
1781
|
+
Ar && Ms && X ? V.dropInside() : "",
|
|
1782
|
+
Lr?.(t.original) ? V.linkRow() : "",
|
|
1783
|
+
Ir?.(t.original)
|
|
1767
1784
|
] }),
|
|
1768
|
-
"data-state":
|
|
1769
|
-
"aria-selected":
|
|
1785
|
+
"data-state": Xo(t) ? "selected" : void 0,
|
|
1786
|
+
"aria-selected": z && cn ? Xo(t) : void 0,
|
|
1770
1787
|
"data-row-id": t.id,
|
|
1771
1788
|
"data-index": e.index,
|
|
1772
1789
|
"aria-rowindex": n,
|
|
1773
|
-
"aria-level":
|
|
1774
|
-
"aria-expanded":
|
|
1775
|
-
draggable:
|
|
1776
|
-
"data-drop":
|
|
1777
|
-
"data-dragging":
|
|
1778
|
-
onClick: (e) =>
|
|
1779
|
-
onAuxClick: (e) =>
|
|
1780
|
-
onDragStart: (e) =>
|
|
1781
|
-
onDragOver: (e) =>
|
|
1782
|
-
onDragLeave: () =>
|
|
1783
|
-
onDrop:
|
|
1784
|
-
onDragEnd:
|
|
1790
|
+
"aria-level": Xa ? t.depth + 1 : void 0,
|
|
1791
|
+
"aria-expanded": Xa && t.getCanExpand() ? t.getIsExpanded() : void 0,
|
|
1792
|
+
draggable: Ds === t.id ? "true" : void 0,
|
|
1793
|
+
"data-drop": Ks(t.id),
|
|
1794
|
+
"data-dragging": X === t.id || void 0,
|
|
1795
|
+
onClick: (e) => os(t, e),
|
|
1796
|
+
onAuxClick: (e) => ss(t, e),
|
|
1797
|
+
onDragStart: (e) => Vs(t, e),
|
|
1798
|
+
onDragOver: (e) => Hs(t, e),
|
|
1799
|
+
onDragLeave: () => As(null),
|
|
1800
|
+
onDrop: Gs,
|
|
1801
|
+
onDragEnd: Ws,
|
|
1785
1802
|
children: [
|
|
1786
|
-
|
|
1787
|
-
className:
|
|
1788
|
-
style:
|
|
1803
|
+
H.map((e) => /* @__PURE__ */ y("td", {
|
|
1804
|
+
className: V.td({ class: G(e, !1) }),
|
|
1805
|
+
style: K(e),
|
|
1789
1806
|
children: e === "drag" ? /* @__PURE__ */ y("button", {
|
|
1790
1807
|
type: "button",
|
|
1791
|
-
className:
|
|
1808
|
+
className: V.dragHandle(),
|
|
1792
1809
|
"data-drag-handle": t.id,
|
|
1793
1810
|
"aria-label": O.moveRow(r),
|
|
1794
|
-
"aria-keyshortcuts":
|
|
1795
|
-
onKeyDown: (e) =>
|
|
1796
|
-
onPointerDown: () =>
|
|
1797
|
-
onPointerUp: () =>
|
|
1798
|
-
children: /* @__PURE__ */ y(
|
|
1799
|
-
className:
|
|
1811
|
+
"aria-keyshortcuts": Ms ? "ArrowUp ArrowDown ArrowLeft ArrowRight" : "ArrowUp ArrowDown",
|
|
1812
|
+
onKeyDown: (e) => Bs(t, e),
|
|
1813
|
+
onPointerDown: () => Os(t.id),
|
|
1814
|
+
onPointerUp: () => Os(X ? Ds : null),
|
|
1815
|
+
children: /* @__PURE__ */ y(Ft, {
|
|
1816
|
+
className: V.dragIcon(),
|
|
1800
1817
|
"aria-hidden": "true"
|
|
1801
1818
|
})
|
|
1802
|
-
}) : e === "select" &&
|
|
1803
|
-
onClickCapture:
|
|
1804
|
-
onKeyDownCapture:
|
|
1819
|
+
}) : e === "select" && Jo ? /* @__PURE__ */ y("span", {
|
|
1820
|
+
onClickCapture: is,
|
|
1821
|
+
onKeyDownCapture: is,
|
|
1805
1822
|
children: /* @__PURE__ */ y(re, {
|
|
1806
|
-
checked:
|
|
1823
|
+
checked: Xo(t),
|
|
1807
1824
|
disabled: !t.getCanSelect(),
|
|
1808
1825
|
"aria-label": O.selectRow(r),
|
|
1809
|
-
onCheckedChange: (e) =>
|
|
1826
|
+
onCheckedChange: (e) => rs(t, e === !0, ns.current)
|
|
1810
1827
|
})
|
|
1811
1828
|
}) : e === "select" ? /* @__PURE__ */ y("input", {
|
|
1812
1829
|
type: "radio",
|
|
1813
|
-
name:
|
|
1814
|
-
className:
|
|
1815
|
-
checked:
|
|
1830
|
+
name: es,
|
|
1831
|
+
className: V.radio(),
|
|
1832
|
+
checked: Xo(t),
|
|
1816
1833
|
disabled: !t.getCanSelect(),
|
|
1817
1834
|
"aria-label": O.selectRow(r),
|
|
1818
|
-
onChange: () =>
|
|
1835
|
+
onChange: () => rs(t, !0)
|
|
1819
1836
|
}) : e === "expand" ? /* @__PURE__ */ y("button", {
|
|
1820
1837
|
type: "button",
|
|
1821
|
-
className:
|
|
1838
|
+
className: V.expander(),
|
|
1822
1839
|
"aria-expanded": t.getIsExpanded(),
|
|
1823
|
-
"aria-controls": t.getIsExpanded() ?
|
|
1840
|
+
"aria-controls": t.getIsExpanded() ? fs(t) : void 0,
|
|
1824
1841
|
"aria-label": O.details(r),
|
|
1825
1842
|
onClick: () => t.toggleExpanded(),
|
|
1826
|
-
children: /* @__PURE__ */ y(
|
|
1827
|
-
className:
|
|
1843
|
+
children: /* @__PURE__ */ y(Dt, {
|
|
1844
|
+
className: V.expanderIcon(),
|
|
1828
1845
|
"data-state": t.getIsExpanded() ? "open" : "closed",
|
|
1829
1846
|
"aria-hidden": "true"
|
|
1830
1847
|
})
|
|
1831
1848
|
}) : /* @__PURE__ */ y("span", {
|
|
1832
|
-
className:
|
|
1833
|
-
children:
|
|
1849
|
+
className: V.rowNumber(),
|
|
1850
|
+
children: ds.get(t.id)
|
|
1834
1851
|
})
|
|
1835
1852
|
}, e)),
|
|
1836
1853
|
t.getVisibleCells().map((n, r) => {
|
|
1837
|
-
if (
|
|
1838
|
-
let t =
|
|
1854
|
+
if (Ol) {
|
|
1855
|
+
let t = jl(e.index, r);
|
|
1839
1856
|
if (!t.rowSpan || !t.colSpan) return null;
|
|
1840
1857
|
}
|
|
1841
|
-
let i =
|
|
1858
|
+
let i = zu(t, n.column, Zs(t, n.column.id)), a = Lu(t, n.column.id, e.index, r);
|
|
1842
1859
|
return /* @__PURE__ */ y("td", {
|
|
1843
|
-
className:
|
|
1844
|
-
style:
|
|
1860
|
+
className: Qa(n.column.id).td({ class: [so(n.column.id, !1), ...a.className] }),
|
|
1861
|
+
style: co(n.column.id, !1),
|
|
1845
1862
|
...a.attributes,
|
|
1846
|
-
children:
|
|
1847
|
-
className:
|
|
1863
|
+
children: ms && r === 0 ? /* @__PURE__ */ b("div", {
|
|
1864
|
+
className: V.treeCell(),
|
|
1848
1865
|
style: { paddingInlineStart: t.depth * 20 },
|
|
1849
|
-
children: [
|
|
1866
|
+
children: [Tn && t.getCanExpand() ? /* @__PURE__ */ y("button", {
|
|
1850
1867
|
type: "button",
|
|
1851
|
-
className:
|
|
1868
|
+
className: V.expander(),
|
|
1852
1869
|
"aria-expanded": t.getIsExpanded(),
|
|
1853
|
-
"aria-label":
|
|
1870
|
+
"aria-label": wi(t.original, t.index),
|
|
1854
1871
|
onClick: t.getToggleExpandedHandler(),
|
|
1855
|
-
children: /* @__PURE__ */ y(
|
|
1856
|
-
className:
|
|
1872
|
+
children: /* @__PURE__ */ y(Dt, {
|
|
1873
|
+
className: V.expanderIcon(),
|
|
1857
1874
|
"data-state": t.getIsExpanded() ? "open" : "closed",
|
|
1858
1875
|
"aria-hidden": "true"
|
|
1859
1876
|
})
|
|
1860
|
-
}) : /* @__PURE__ */ y("span", { className:
|
|
1877
|
+
}) : /* @__PURE__ */ y("span", { className: V.expanderSpacer() }), i]
|
|
1861
1878
|
}) : i
|
|
1862
1879
|
}, n.id);
|
|
1863
1880
|
}),
|
|
1864
|
-
|
|
1865
|
-
className:
|
|
1866
|
-
style:
|
|
1881
|
+
U.length > 0 && /* @__PURE__ */ y("td", {
|
|
1882
|
+
className: V.td({ class: G("actions", !1) }),
|
|
1883
|
+
style: K("actions"),
|
|
1867
1884
|
children: /* @__PURE__ */ b("div", {
|
|
1868
|
-
className:
|
|
1869
|
-
children: [
|
|
1870
|
-
items:
|
|
1871
|
-
onSelect: (e) =>
|
|
1885
|
+
className: V.editActions(),
|
|
1886
|
+
children: [T === "row" && $a && Ru(t, r), Nr && dc !== t.id && /* @__PURE__ */ y(te, {
|
|
1887
|
+
items: bs(t),
|
|
1888
|
+
onSelect: (e) => ws(t, e),
|
|
1872
1889
|
children: /* @__PURE__ */ y(u, {
|
|
1873
|
-
icon:
|
|
1890
|
+
icon: Nt,
|
|
1874
1891
|
label: O.rowActions(r),
|
|
1875
1892
|
variant: "text",
|
|
1876
1893
|
size: "sm"
|
|
@@ -1881,71 +1898,71 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1881
1898
|
]
|
|
1882
1899
|
}, e.key);
|
|
1883
1900
|
}),
|
|
1884
|
-
|
|
1885
|
-
className:
|
|
1901
|
+
$l > 0 && !Su && /* @__PURE__ */ y("tr", {
|
|
1902
|
+
className: V.spacer(),
|
|
1886
1903
|
"aria-hidden": "true",
|
|
1887
1904
|
children: /* @__PURE__ */ y("td", {
|
|
1888
|
-
colSpan:
|
|
1889
|
-
className:
|
|
1890
|
-
style: { height:
|
|
1905
|
+
colSpan: to,
|
|
1906
|
+
className: V.spacerCell(),
|
|
1907
|
+
style: { height: $l }
|
|
1891
1908
|
})
|
|
1892
1909
|
})
|
|
1893
1910
|
]
|
|
1894
|
-
}),
|
|
1895
|
-
...
|
|
1896
|
-
ref:
|
|
1897
|
-
className:
|
|
1898
|
-
role:
|
|
1899
|
-
"aria-modal":
|
|
1900
|
-
"aria-label":
|
|
1901
|
-
onKeyDown:
|
|
1911
|
+
}), Vu = /* @__PURE__ */ b("div", {
|
|
1912
|
+
..._i,
|
|
1913
|
+
ref: xi,
|
|
1914
|
+
className: V.base({ class: gi }),
|
|
1915
|
+
role: R ? "dialog" : void 0,
|
|
1916
|
+
"aria-modal": R || void 0,
|
|
1917
|
+
"aria-label": R ? Te : void 0,
|
|
1918
|
+
onKeyDown: ql,
|
|
1902
1919
|
children: [
|
|
1903
|
-
|
|
1904
|
-
className:
|
|
1920
|
+
bu && /* @__PURE__ */ b("div", {
|
|
1921
|
+
className: V.toolbar(),
|
|
1905
1922
|
children: [
|
|
1906
|
-
|
|
1907
|
-
|
|
1923
|
+
ui,
|
|
1924
|
+
rr && /* @__PURE__ */ y(d, {
|
|
1908
1925
|
type: "search",
|
|
1909
1926
|
size: "sm",
|
|
1910
|
-
leadingIcon:
|
|
1911
|
-
className:
|
|
1927
|
+
leadingIcon: Ut,
|
|
1928
|
+
className: V.search(),
|
|
1912
1929
|
placeholder: O.searchPlaceholder,
|
|
1913
|
-
"aria-label": O.search(
|
|
1914
|
-
value:
|
|
1915
|
-
onChange: (e) =>
|
|
1930
|
+
"aria-label": O.search(Te),
|
|
1931
|
+
value: I,
|
|
1932
|
+
onChange: (e) => L.setGlobalFilter(e.target.value)
|
|
1916
1933
|
}),
|
|
1917
|
-
|
|
1934
|
+
li,
|
|
1918
1935
|
/* @__PURE__ */ b("div", {
|
|
1919
|
-
className:
|
|
1936
|
+
className: V.toolbarEnd(),
|
|
1920
1937
|
children: [
|
|
1921
|
-
|
|
1922
|
-
|
|
1938
|
+
di,
|
|
1939
|
+
Wr && /* @__PURE__ */ y(u, {
|
|
1923
1940
|
"data-find-toggle": "",
|
|
1924
|
-
icon:
|
|
1941
|
+
icon: Wt,
|
|
1925
1942
|
label: O.find,
|
|
1926
1943
|
variant: "outline",
|
|
1927
1944
|
size: "sm",
|
|
1928
|
-
"aria-expanded":
|
|
1929
|
-
onClick:
|
|
1945
|
+
"aria-expanded": fl,
|
|
1946
|
+
onClick: Tl
|
|
1930
1947
|
}),
|
|
1931
|
-
|
|
1948
|
+
Ri && /* @__PURE__ */ y(l, {
|
|
1932
1949
|
variant: "outline",
|
|
1933
1950
|
size: "sm",
|
|
1934
|
-
leadingIcon:
|
|
1935
|
-
"aria-expanded":
|
|
1936
|
-
"aria-controls": `${
|
|
1937
|
-
onClick: () =>
|
|
1951
|
+
leadingIcon: It,
|
|
1952
|
+
"aria-expanded": Ni,
|
|
1953
|
+
"aria-controls": `${bi}-advanced`,
|
|
1954
|
+
onClick: () => Pi(!Ni),
|
|
1938
1955
|
children: E.conditionBuilder.advanced
|
|
1939
1956
|
}),
|
|
1940
|
-
|
|
1941
|
-
icon:
|
|
1957
|
+
fr && /* @__PURE__ */ y(u, {
|
|
1958
|
+
icon: Pt,
|
|
1942
1959
|
label: O.filterToggle,
|
|
1943
1960
|
variant: "outline",
|
|
1944
1961
|
size: "sm",
|
|
1945
|
-
"aria-pressed":
|
|
1946
|
-
onClick:
|
|
1962
|
+
"aria-pressed": ua,
|
|
1963
|
+
onClick: Wa
|
|
1947
1964
|
}),
|
|
1948
|
-
|
|
1965
|
+
Zr && /* @__PURE__ */ b(x.Root, {
|
|
1949
1966
|
positioning: {
|
|
1950
1967
|
placement: "bottom-end",
|
|
1951
1968
|
gutter: 4
|
|
@@ -1955,35 +1972,35 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1955
1972
|
children: [/* @__PURE__ */ y(x.Trigger, {
|
|
1956
1973
|
asChild: !0,
|
|
1957
1974
|
children: /* @__PURE__ */ y(u, {
|
|
1958
|
-
icon:
|
|
1975
|
+
icon: Ht,
|
|
1959
1976
|
label: O.density,
|
|
1960
1977
|
variant: "outline",
|
|
1961
1978
|
size: "sm"
|
|
1962
1979
|
})
|
|
1963
|
-
}), /* @__PURE__ */ y(
|
|
1964
|
-
className:
|
|
1980
|
+
}), /* @__PURE__ */ y(tn, { children: /* @__PURE__ */ y(x.Positioner, { children: /* @__PURE__ */ y(x.Content, {
|
|
1981
|
+
className: yi.content(),
|
|
1965
1982
|
children: /* @__PURE__ */ y(x.RadioItemGroup, {
|
|
1966
|
-
value:
|
|
1967
|
-
onValueChange: (e) =>
|
|
1983
|
+
value: Pa,
|
|
1984
|
+
onValueChange: (e) => Ka(e.value),
|
|
1968
1985
|
children: [
|
|
1969
1986
|
"sm",
|
|
1970
1987
|
"md",
|
|
1971
1988
|
"lg"
|
|
1972
1989
|
].map((e) => /* @__PURE__ */ b(x.RadioItem, {
|
|
1973
1990
|
value: e,
|
|
1974
|
-
className:
|
|
1975
|
-
children: [/* @__PURE__ */ y(x.ItemIndicator, { children: /* @__PURE__ */ y(
|
|
1976
|
-
className:
|
|
1991
|
+
className: yi.item(),
|
|
1992
|
+
children: [/* @__PURE__ */ y(x.ItemIndicator, { children: /* @__PURE__ */ y(Tt, {
|
|
1993
|
+
className: V.menuCheck(),
|
|
1977
1994
|
"aria-hidden": "true"
|
|
1978
1995
|
}) }), /* @__PURE__ */ y(x.ItemText, {
|
|
1979
|
-
className:
|
|
1996
|
+
className: yi.label(),
|
|
1980
1997
|
children: O.densities[e]
|
|
1981
1998
|
})]
|
|
1982
1999
|
}, e))
|
|
1983
2000
|
})
|
|
1984
2001
|
}) }) })]
|
|
1985
2002
|
}),
|
|
1986
|
-
|
|
2003
|
+
hr && /* @__PURE__ */ b(x.Root, {
|
|
1987
2004
|
positioning: {
|
|
1988
2005
|
placement: "bottom-end",
|
|
1989
2006
|
gutter: 4
|
|
@@ -1995,107 +2012,107 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
1995
2012
|
children: /* @__PURE__ */ y(l, {
|
|
1996
2013
|
variant: "outline",
|
|
1997
2014
|
size: "sm",
|
|
1998
|
-
leadingIcon:
|
|
2015
|
+
leadingIcon: jt,
|
|
1999
2016
|
children: O.columns
|
|
2000
2017
|
})
|
|
2001
|
-
}), /* @__PURE__ */ y(
|
|
2002
|
-
className:
|
|
2003
|
-
children: (
|
|
2018
|
+
}), /* @__PURE__ */ y(tn, { children: /* @__PURE__ */ y(x.Positioner, { children: /* @__PURE__ */ y(x.Content, {
|
|
2019
|
+
className: yi.content(),
|
|
2020
|
+
children: (Au || [{
|
|
2004
2021
|
def: void 0,
|
|
2005
|
-
leaves:
|
|
2022
|
+
leaves: L.getAllLeafColumns()
|
|
2006
2023
|
}]).map(({ def: e, leaves: t }, n) => {
|
|
2007
2024
|
let r = t.filter((e) => e.getCanHide()), i = (e, t) => /* @__PURE__ */ b(x.CheckboxItem, {
|
|
2008
2025
|
value: e.id,
|
|
2009
2026
|
checked: e.getIsVisible(),
|
|
2010
2027
|
onCheckedChange: (t) => e.toggleVisibility(t),
|
|
2011
2028
|
closeOnSelect: !1,
|
|
2012
|
-
className:
|
|
2013
|
-
children: [/* @__PURE__ */ y(x.ItemIndicator, { children: /* @__PURE__ */ y(
|
|
2014
|
-
className:
|
|
2029
|
+
className: yi.item({ class: t ? V.columnGroupItem() : void 0 }),
|
|
2030
|
+
children: [/* @__PURE__ */ y(x.ItemIndicator, { children: /* @__PURE__ */ y(Tt, {
|
|
2031
|
+
className: V.menuCheck(),
|
|
2015
2032
|
"aria-hidden": "true"
|
|
2016
2033
|
}) }), /* @__PURE__ */ y(x.ItemText, {
|
|
2017
|
-
className:
|
|
2018
|
-
children:
|
|
2034
|
+
className: yi.label(),
|
|
2035
|
+
children: q(e)
|
|
2019
2036
|
})]
|
|
2020
2037
|
}, e.id);
|
|
2021
|
-
return e?.columns ? /* @__PURE__ */ b(
|
|
2038
|
+
return e?.columns ? /* @__PURE__ */ b(Jt, { children: [
|
|
2022
2039
|
/* @__PURE__ */ b(x.CheckboxItem, {
|
|
2023
2040
|
value: `group:${e.id}`,
|
|
2024
2041
|
checked: r.every((e) => e.getIsVisible()),
|
|
2025
2042
|
disabled: !r.length,
|
|
2026
|
-
onCheckedChange: (e) =>
|
|
2027
|
-
...
|
|
2043
|
+
onCheckedChange: (e) => L.setColumnVisibility({
|
|
2044
|
+
...Ta,
|
|
2028
2045
|
...Object.fromEntries(r.map((t) => [t.id, e]))
|
|
2029
2046
|
}),
|
|
2030
2047
|
closeOnSelect: !1,
|
|
2031
|
-
className:
|
|
2032
|
-
children: [/* @__PURE__ */ y(x.ItemIndicator, { children: /* @__PURE__ */ y(
|
|
2033
|
-
className:
|
|
2048
|
+
className: yi.item(),
|
|
2049
|
+
children: [/* @__PURE__ */ y(x.ItemIndicator, { children: /* @__PURE__ */ y(Tt, {
|
|
2050
|
+
className: V.menuCheck(),
|
|
2034
2051
|
"aria-hidden": "true"
|
|
2035
2052
|
}) }), /* @__PURE__ */ y(x.ItemText, {
|
|
2036
|
-
className:
|
|
2053
|
+
className: yi.label(),
|
|
2037
2054
|
children: e.header
|
|
2038
2055
|
})]
|
|
2039
2056
|
}),
|
|
2040
2057
|
r.map((e) => i(e, !0)),
|
|
2041
|
-
|
|
2058
|
+
yr && [-1, 1].map((t) => /* @__PURE__ */ y(x.Item, {
|
|
2042
2059
|
value: `group-${t < 0 ? "earlier" : "later"}:${e.id}`,
|
|
2043
|
-
disabled: t < 0 ? n === 0 : n ===
|
|
2060
|
+
disabled: t < 0 ? n === 0 : n === Au.length - 1,
|
|
2044
2061
|
closeOnSelect: !1,
|
|
2045
|
-
className:
|
|
2046
|
-
onSelect: () =>
|
|
2062
|
+
className: yi.item({ class: V.columnGroupItem() }),
|
|
2063
|
+
onSelect: () => ju(e.id, t),
|
|
2047
2064
|
children: /* @__PURE__ */ y(x.ItemText, {
|
|
2048
|
-
className:
|
|
2065
|
+
className: yi.label(),
|
|
2049
2066
|
children: t < 0 ? O.columnGroupEarlier(e.header) : O.columnGroupLater(e.header)
|
|
2050
2067
|
})
|
|
2051
2068
|
}, t))
|
|
2052
|
-
] }, `group:${e.id}`) : /* @__PURE__ */ y(
|
|
2069
|
+
] }, `group:${e.id}`) : /* @__PURE__ */ y(Jt, { children: r.map((e) => i(e, !1)) }, e?.id ?? "columns");
|
|
2053
2070
|
})
|
|
2054
2071
|
}) }) })]
|
|
2055
2072
|
}),
|
|
2056
|
-
|
|
2057
|
-
items:
|
|
2073
|
+
wr && (Pu.length > 1 ? /* @__PURE__ */ y(te, {
|
|
2074
|
+
items: Pu,
|
|
2058
2075
|
onSelect: (e) => {
|
|
2059
2076
|
let [t, n] = e.includes(":") ? e.split(":") : ["csv", e];
|
|
2060
|
-
|
|
2077
|
+
Hl(t, n === "selection");
|
|
2061
2078
|
},
|
|
2062
2079
|
children: /* @__PURE__ */ y(l, {
|
|
2063
2080
|
variant: "outline",
|
|
2064
2081
|
size: "sm",
|
|
2065
|
-
leadingIcon:
|
|
2066
|
-
children:
|
|
2082
|
+
leadingIcon: Mt,
|
|
2083
|
+
children: Fu
|
|
2067
2084
|
})
|
|
2068
2085
|
}) : /* @__PURE__ */ y(l, {
|
|
2069
2086
|
variant: "outline",
|
|
2070
2087
|
size: "sm",
|
|
2071
|
-
leadingIcon:
|
|
2072
|
-
onClick: () =>
|
|
2073
|
-
children:
|
|
2088
|
+
leadingIcon: Mt,
|
|
2089
|
+
onClick: () => Hl(Mu[0], !1),
|
|
2090
|
+
children: Fu
|
|
2074
2091
|
})),
|
|
2075
|
-
|
|
2092
|
+
ei && /* @__PURE__ */ y(u, {
|
|
2076
2093
|
"data-fullscreen-toggle": "",
|
|
2077
|
-
icon:
|
|
2078
|
-
label:
|
|
2094
|
+
icon: R ? Rt : Lt,
|
|
2095
|
+
label: R ? O.exitFullscreen : O.fullscreen,
|
|
2079
2096
|
variant: "outline",
|
|
2080
2097
|
size: "sm",
|
|
2081
|
-
onClick:
|
|
2098
|
+
onClick: Kl
|
|
2082
2099
|
})
|
|
2083
2100
|
]
|
|
2084
2101
|
})
|
|
2085
2102
|
]
|
|
2086
2103
|
}),
|
|
2087
|
-
|
|
2088
|
-
id: `${
|
|
2089
|
-
className:
|
|
2090
|
-
children:
|
|
2091
|
-
fields:
|
|
2092
|
-
value:
|
|
2093
|
-
onValueChange:
|
|
2104
|
+
Ri && Ni && /* @__PURE__ */ y("div", {
|
|
2105
|
+
id: `${bi}-advanced`,
|
|
2106
|
+
className: V.advancedFilter(),
|
|
2107
|
+
children: nr({
|
|
2108
|
+
fields: Fi,
|
|
2109
|
+
value: Mi,
|
|
2110
|
+
onValueChange: Li,
|
|
2094
2111
|
label: E.conditionBuilder.advanced
|
|
2095
2112
|
})
|
|
2096
2113
|
}),
|
|
2097
|
-
|
|
2098
|
-
className:
|
|
2114
|
+
Wr && fl && /* @__PURE__ */ b("div", {
|
|
2115
|
+
className: V.findBar(),
|
|
2099
2116
|
role: "search",
|
|
2100
2117
|
"aria-label": O.find,
|
|
2101
2118
|
children: [
|
|
@@ -2103,138 +2120,138 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2103
2120
|
type: "search",
|
|
2104
2121
|
size: "sm",
|
|
2105
2122
|
"data-find-input": "",
|
|
2106
|
-
leadingIcon:
|
|
2107
|
-
className:
|
|
2123
|
+
leadingIcon: Wt,
|
|
2124
|
+
className: V.findInput(),
|
|
2108
2125
|
placeholder: O.searchPlaceholder,
|
|
2109
2126
|
"aria-label": O.find,
|
|
2110
|
-
value:
|
|
2111
|
-
onChange: (e) =>
|
|
2112
|
-
onKeyDown:
|
|
2127
|
+
value: ml,
|
|
2128
|
+
onChange: (e) => Dl(e.target.value),
|
|
2129
|
+
onKeyDown: El
|
|
2113
2130
|
}),
|
|
2114
2131
|
/* @__PURE__ */ y("span", {
|
|
2115
|
-
className:
|
|
2132
|
+
className: V.findCount(),
|
|
2116
2133
|
"aria-live": "polite",
|
|
2117
|
-
children:
|
|
2134
|
+
children: ml.trim() ? O.findMatches(Q.length ? Math.min(gl, Q.length - 1) + 1 : 0, Q.length) : ""
|
|
2118
2135
|
}),
|
|
2119
2136
|
/* @__PURE__ */ y(u, {
|
|
2120
|
-
icon:
|
|
2137
|
+
icon: Ot,
|
|
2121
2138
|
label: O.findPrevious,
|
|
2122
2139
|
variant: "text",
|
|
2123
2140
|
size: "sm",
|
|
2124
2141
|
disabled: !Q.length,
|
|
2125
|
-
onClick: () =>
|
|
2142
|
+
onClick: () => wl(gl - 1)
|
|
2126
2143
|
}),
|
|
2127
2144
|
/* @__PURE__ */ y(u, {
|
|
2128
|
-
icon:
|
|
2145
|
+
icon: Et,
|
|
2129
2146
|
label: O.findNext,
|
|
2130
2147
|
variant: "text",
|
|
2131
2148
|
size: "sm",
|
|
2132
2149
|
disabled: !Q.length,
|
|
2133
|
-
onClick: () =>
|
|
2150
|
+
onClick: () => wl(gl + 1)
|
|
2134
2151
|
}),
|
|
2135
2152
|
/* @__PURE__ */ y(u, {
|
|
2136
|
-
icon:
|
|
2153
|
+
icon: qt,
|
|
2137
2154
|
label: O.findClose,
|
|
2138
2155
|
variant: "text",
|
|
2139
2156
|
size: "sm",
|
|
2140
|
-
onClick:
|
|
2157
|
+
onClick: Tl
|
|
2141
2158
|
})
|
|
2142
2159
|
]
|
|
2143
2160
|
}),
|
|
2144
|
-
|
|
2145
|
-
className:
|
|
2161
|
+
T === "batch" && /* @__PURE__ */ b("div", {
|
|
2162
|
+
className: V.batchBar(),
|
|
2146
2163
|
children: [
|
|
2147
2164
|
/* @__PURE__ */ y("span", {
|
|
2148
|
-
className:
|
|
2149
|
-
children: O.changes(
|
|
2165
|
+
className: V.batchCount(),
|
|
2166
|
+
children: O.changes(ac)
|
|
2150
2167
|
}),
|
|
2151
2168
|
/* @__PURE__ */ y(l, {
|
|
2152
2169
|
variant: "text",
|
|
2153
2170
|
size: "sm",
|
|
2154
|
-
leadingIcon:
|
|
2155
|
-
disabled:
|
|
2156
|
-
onClick:
|
|
2171
|
+
leadingIcon: Kt,
|
|
2172
|
+
disabled: !$s.canUndo,
|
|
2173
|
+
onClick: rc,
|
|
2157
2174
|
children: O.undo
|
|
2158
2175
|
}),
|
|
2159
2176
|
/* @__PURE__ */ y(l, {
|
|
2160
2177
|
variant: "text",
|
|
2161
2178
|
size: "sm",
|
|
2162
|
-
leadingIcon:
|
|
2163
|
-
disabled:
|
|
2164
|
-
onClick:
|
|
2179
|
+
leadingIcon: Vt,
|
|
2180
|
+
disabled: !$s.canRedo,
|
|
2181
|
+
onClick: ic,
|
|
2165
2182
|
children: O.redo
|
|
2166
2183
|
}),
|
|
2167
2184
|
/* @__PURE__ */ y(l, {
|
|
2168
2185
|
variant: "outline",
|
|
2169
2186
|
size: "sm",
|
|
2170
|
-
disabled: !
|
|
2171
|
-
onClick:
|
|
2187
|
+
disabled: !ac,
|
|
2188
|
+
onClick: cc,
|
|
2172
2189
|
children: O.discardChanges
|
|
2173
2190
|
}),
|
|
2174
2191
|
/* @__PURE__ */ y(l, {
|
|
2175
2192
|
size: "sm",
|
|
2176
|
-
disabled: !
|
|
2177
|
-
onClick:
|
|
2193
|
+
disabled: !ac,
|
|
2194
|
+
onClick: sc,
|
|
2178
2195
|
children: O.saveChanges
|
|
2179
2196
|
})
|
|
2180
2197
|
]
|
|
2181
2198
|
}),
|
|
2182
2199
|
/* @__PURE__ */ y("p", {
|
|
2183
2200
|
role: "status",
|
|
2184
|
-
className:
|
|
2185
|
-
children:
|
|
2201
|
+
className: V.status(),
|
|
2202
|
+
children: ho || (s ? Ui ? "" : _e(Ti, E, D) : Ro ? O.results(L.getFilteredRowModel().rows.length) : "")
|
|
2186
2203
|
}),
|
|
2187
|
-
|
|
2204
|
+
Za && Gt === "top" && Iu,
|
|
2188
2205
|
/* @__PURE__ */ y("div", {
|
|
2189
|
-
ref:
|
|
2190
|
-
className:
|
|
2191
|
-
style:
|
|
2192
|
-
onScroll:
|
|
2206
|
+
ref: Jl,
|
|
2207
|
+
className: V.scroll(),
|
|
2208
|
+
style: ti ? { maxHeight: ti } : void 0,
|
|
2209
|
+
onScroll: ti ? nu : void 0,
|
|
2193
2210
|
children: /* @__PURE__ */ b("table", {
|
|
2194
2211
|
ref: $,
|
|
2195
|
-
className:
|
|
2196
|
-
style:
|
|
2197
|
-
"aria-busy":
|
|
2198
|
-
"aria-rowcount":
|
|
2199
|
-
role:
|
|
2200
|
-
"aria-multiselectable":
|
|
2201
|
-
tabIndex: (
|
|
2202
|
-
onKeyDown:
|
|
2203
|
-
onFocus:
|
|
2212
|
+
className: V.table({ class: no ? V.fixedLayout() : void 0 }),
|
|
2213
|
+
style: no ? { minWidth: L.getTotalSize() + ao + oo } : void 0,
|
|
2214
|
+
"aria-busy": Wi || void 0,
|
|
2215
|
+
"aria-rowcount": B ? Y.length + fo.length : void 0,
|
|
2216
|
+
role: z ? Xa ? "treegrid" : "grid" : void 0,
|
|
2217
|
+
"aria-multiselectable": z && (cn && Jo || w) ? "true" : void 0,
|
|
2218
|
+
tabIndex: (w || T === "batch") && !z ? -1 : void 0,
|
|
2219
|
+
onKeyDown: lu,
|
|
2220
|
+
onFocus: cu,
|
|
2204
2221
|
children: [
|
|
2205
2222
|
/* @__PURE__ */ y("caption", {
|
|
2206
|
-
className:
|
|
2207
|
-
children:
|
|
2223
|
+
className: V.caption(),
|
|
2224
|
+
children: Te
|
|
2208
2225
|
}),
|
|
2209
2226
|
/* @__PURE__ */ b("thead", {
|
|
2210
|
-
ref:
|
|
2211
|
-
className:
|
|
2212
|
-
children: [
|
|
2213
|
-
className:
|
|
2227
|
+
ref: ru,
|
|
2228
|
+
className: V.head(),
|
|
2229
|
+
children: [fo.map((e, t) => /* @__PURE__ */ b("tr", {
|
|
2230
|
+
className: V.headRow(),
|
|
2214
2231
|
children: [
|
|
2215
|
-
t === 0 &&
|
|
2232
|
+
t === 0 && H.map((e) => /* @__PURE__ */ y("th", {
|
|
2216
2233
|
scope: "col",
|
|
2217
|
-
rowSpan:
|
|
2218
|
-
className:
|
|
2219
|
-
style:
|
|
2220
|
-
children: e === "select" &&
|
|
2221
|
-
checked:
|
|
2222
|
-
"aria-label":
|
|
2223
|
-
onCheckedChange: (e) =>
|
|
2234
|
+
rowSpan: fo.length,
|
|
2235
|
+
className: V.th({ class: G(e, !0) }),
|
|
2236
|
+
style: K(e),
|
|
2237
|
+
children: e === "select" && Jo ? /* @__PURE__ */ y(re, {
|
|
2238
|
+
checked: Qo,
|
|
2239
|
+
"aria-label": wn ?? (hn === "all" ? O.selectAllRows : O.selectAll),
|
|
2240
|
+
onCheckedChange: (e) => $o(e === !0)
|
|
2224
2241
|
}) : e === "select" ? /* @__PURE__ */ y("span", {
|
|
2225
|
-
className:
|
|
2242
|
+
className: V.srOnly(),
|
|
2226
2243
|
children: O.select
|
|
2227
2244
|
}) : e === "expand" ? /* @__PURE__ */ y("button", {
|
|
2228
2245
|
type: "button",
|
|
2229
|
-
className:
|
|
2230
|
-
"aria-label":
|
|
2231
|
-
onClick: () =>
|
|
2232
|
-
children: y(
|
|
2233
|
-
className:
|
|
2246
|
+
className: V.expander(),
|
|
2247
|
+
"aria-label": ps ? O.collapseAll : O.expandAll,
|
|
2248
|
+
onClick: () => L.toggleAllRowsExpanded(!ps),
|
|
2249
|
+
children: y(ps ? kt : At, {
|
|
2250
|
+
className: V.expanderIcon(),
|
|
2234
2251
|
"aria-hidden": "true"
|
|
2235
2252
|
})
|
|
2236
2253
|
}) : e === "number" ? O.rowNumber : /* @__PURE__ */ y("span", {
|
|
2237
|
-
className:
|
|
2254
|
+
className: V.srOnly(),
|
|
2238
2255
|
children: O.reorder
|
|
2239
2256
|
})
|
|
2240
2257
|
}, e)),
|
|
@@ -2244,230 +2261,236 @@ function Gn({ classes: a, data: o, dataSource: s, cacheTime: ee = 0, searchDebou
|
|
|
2244
2261
|
scope: "colgroup",
|
|
2245
2262
|
colSpan: e.header.colSpan,
|
|
2246
2263
|
rowSpan: e.rowSpan > 1 ? e.rowSpan : void 0,
|
|
2247
|
-
className:
|
|
2248
|
-
children:
|
|
2264
|
+
className: V.th({ class: V.groupTh() }),
|
|
2265
|
+
children: q(t)
|
|
2249
2266
|
}, e.header.id);
|
|
2250
|
-
let r = t.getIsSorted(), i =
|
|
2267
|
+
let r = t.getIsSorted(), i = mo(t.id);
|
|
2251
2268
|
return /* @__PURE__ */ b("th", {
|
|
2252
|
-
id:
|
|
2269
|
+
id: Ol ? kl(t.id) : void 0,
|
|
2253
2270
|
scope: "col",
|
|
2254
2271
|
rowSpan: e.rowSpan > 1 ? e.rowSpan : void 0,
|
|
2255
|
-
className:
|
|
2256
|
-
style:
|
|
2257
|
-
"aria-sort":
|
|
2258
|
-
draggable:
|
|
2259
|
-
"data-drop":
|
|
2260
|
-
"data-dragging":
|
|
2261
|
-
onDragStart: (e) =>
|
|
2262
|
-
onDragOver: (e) =>
|
|
2263
|
-
onDragLeave: () =>
|
|
2264
|
-
onDrop:
|
|
2265
|
-
onDragEnd:
|
|
2272
|
+
className: Qa(t.id).th({ class: [so(t.id, !0), yr ? V.dropTargetColumn() : ""] }),
|
|
2273
|
+
style: co(t.id, !0),
|
|
2274
|
+
"aria-sort": po(t.id),
|
|
2275
|
+
draggable: bo(t.id) && !t.getIsPinned() ? "true" : void 0,
|
|
2276
|
+
"data-drop": Mo(t.id),
|
|
2277
|
+
"data-dragging": wo === t.id || void 0,
|
|
2278
|
+
onDragStart: (e) => Oo(t.id, e),
|
|
2279
|
+
onDragOver: (e) => ko(t.id, e),
|
|
2280
|
+
onDragLeave: () => Do(null),
|
|
2281
|
+
onDrop: jo,
|
|
2282
|
+
onDragEnd: Ao,
|
|
2266
2283
|
children: [/* @__PURE__ */ b("div", {
|
|
2267
|
-
className:
|
|
2284
|
+
className: Qa(t.id).headContent(),
|
|
2268
2285
|
children: [
|
|
2269
2286
|
t.getCanSort() ? /* @__PURE__ */ b("button", {
|
|
2270
2287
|
type: "button",
|
|
2271
|
-
className:
|
|
2272
|
-
onClick: (e) =>
|
|
2288
|
+
className: V.sortButton(),
|
|
2289
|
+
onClick: (e) => za(Xe(N, t.id, an === "multiple" && e.shiftKey)),
|
|
2273
2290
|
children: [
|
|
2274
2291
|
/* @__PURE__ */ y("span", {
|
|
2275
|
-
className:
|
|
2276
|
-
children:
|
|
2292
|
+
className: V.headLabel(),
|
|
2293
|
+
children: q(t)
|
|
2277
2294
|
}),
|
|
2278
|
-
y(r === "asc" ?
|
|
2279
|
-
className:
|
|
2295
|
+
y(r === "asc" ? Ct : r === "desc" ? St : wt, {
|
|
2296
|
+
className: V.sortIcon(),
|
|
2280
2297
|
"aria-hidden": "true"
|
|
2281
2298
|
}),
|
|
2282
|
-
N.length > 1 && i > 0 && /* @__PURE__ */ b(
|
|
2283
|
-
className:
|
|
2299
|
+
N.length > 1 && i > 0 && /* @__PURE__ */ b(en, { children: [/* @__PURE__ */ y("span", {
|
|
2300
|
+
className: V.sortBadge(),
|
|
2284
2301
|
"aria-hidden": "true",
|
|
2285
2302
|
children: i
|
|
2286
2303
|
}), /* @__PURE__ */ y("span", {
|
|
2287
|
-
className:
|
|
2304
|
+
className: V.srOnly(),
|
|
2288
2305
|
children: O.sortPriority(i, r === "desc")
|
|
2289
2306
|
})] })
|
|
2290
2307
|
]
|
|
2291
2308
|
}) : /* @__PURE__ */ y("span", {
|
|
2292
|
-
className:
|
|
2293
|
-
children:
|
|
2309
|
+
className: V.headLabel(),
|
|
2310
|
+
children: q(t)
|
|
2294
2311
|
}),
|
|
2295
|
-
|
|
2296
|
-
header:
|
|
2312
|
+
Lo && n && Fo(n) && /* @__PURE__ */ y(jn, {
|
|
2313
|
+
header: q(t),
|
|
2297
2314
|
type: n.filter ?? "text",
|
|
2298
|
-
value:
|
|
2299
|
-
onChange: (e) =>
|
|
2300
|
-
options:
|
|
2315
|
+
value: zo(t.id),
|
|
2316
|
+
onChange: (e) => Ho(t.id, e),
|
|
2317
|
+
options: Bo(n),
|
|
2301
2318
|
matchModes: n.matchModes,
|
|
2302
|
-
maxConstraints:
|
|
2319
|
+
maxConstraints: pr,
|
|
2303
2320
|
renderValue: n.renderFilter ? (e) => n.renderFilter({
|
|
2304
2321
|
...e,
|
|
2305
2322
|
column: n
|
|
2306
2323
|
}) : void 0
|
|
2307
2324
|
}),
|
|
2308
|
-
|
|
2309
|
-
items:
|
|
2310
|
-
onSelect: (e) =>
|
|
2325
|
+
yo && /* @__PURE__ */ y(te, {
|
|
2326
|
+
items: xo(t),
|
|
2327
|
+
onSelect: (e) => Co(t, e),
|
|
2311
2328
|
children: /* @__PURE__ */ y("button", {
|
|
2312
2329
|
type: "button",
|
|
2313
|
-
className:
|
|
2330
|
+
className: V.headButton(),
|
|
2314
2331
|
"data-column-menu": t.id,
|
|
2315
|
-
"aria-label": O.columnMenu(
|
|
2316
|
-
children: /* @__PURE__ */ y(
|
|
2317
|
-
className:
|
|
2332
|
+
"aria-label": O.columnMenu(q(t)),
|
|
2333
|
+
children: /* @__PURE__ */ y(Nt, {
|
|
2334
|
+
className: V.headButtonIcon(),
|
|
2318
2335
|
"aria-hidden": "true"
|
|
2319
2336
|
})
|
|
2320
2337
|
})
|
|
2321
2338
|
})
|
|
2322
2339
|
]
|
|
2323
|
-
}),
|
|
2340
|
+
}), mr && /* @__PURE__ */ y("div", {
|
|
2324
2341
|
role: "separator",
|
|
2325
2342
|
"aria-orientation": "vertical",
|
|
2326
|
-
"aria-label": O.resize(
|
|
2343
|
+
"aria-label": O.resize(q(t)),
|
|
2327
2344
|
"aria-valuenow": t.getSize(),
|
|
2328
|
-
"aria-valuemin":
|
|
2345
|
+
"aria-valuemin": Vn,
|
|
2329
2346
|
"aria-valuemax": 1200,
|
|
2330
2347
|
tabIndex: 0,
|
|
2331
|
-
className:
|
|
2348
|
+
className: V.resizer(),
|
|
2332
2349
|
"data-resizing": t.getIsResizing() || void 0,
|
|
2333
2350
|
onMouseDown: e.header.getResizeHandler(),
|
|
2334
2351
|
onTouchStart: e.header.getResizeHandler(),
|
|
2335
|
-
onKeyDown: (e) =>
|
|
2336
|
-
onDoubleClick: (e) =>
|
|
2352
|
+
onKeyDown: (e) => Po(t.id, e),
|
|
2353
|
+
onDoubleClick: (e) => No(t.id, e)
|
|
2337
2354
|
})]
|
|
2338
2355
|
}, e.header.id);
|
|
2339
2356
|
}),
|
|
2340
|
-
t === 0 &&
|
|
2357
|
+
t === 0 && U.length > 0 && /* @__PURE__ */ y("th", {
|
|
2341
2358
|
scope: "col",
|
|
2342
|
-
rowSpan:
|
|
2343
|
-
className:
|
|
2344
|
-
style:
|
|
2359
|
+
rowSpan: fo.length,
|
|
2360
|
+
className: V.th({ class: G("actions", !0) }),
|
|
2361
|
+
style: K("actions"),
|
|
2345
2362
|
children: /* @__PURE__ */ y("span", {
|
|
2346
|
-
className:
|
|
2363
|
+
className: V.srOnly(),
|
|
2347
2364
|
children: O.actions
|
|
2348
2365
|
})
|
|
2349
2366
|
})
|
|
2350
2367
|
]
|
|
2351
|
-
}, t)),
|
|
2352
|
-
className:
|
|
2368
|
+
}, t)), Io && /* @__PURE__ */ b("tr", {
|
|
2369
|
+
className: V.filterRow(),
|
|
2353
2370
|
children: [
|
|
2354
|
-
|
|
2355
|
-
className:
|
|
2356
|
-
style:
|
|
2371
|
+
H.map((e) => /* @__PURE__ */ y("td", {
|
|
2372
|
+
className: G(e, !0),
|
|
2373
|
+
style: K(e)
|
|
2357
2374
|
}, e)),
|
|
2358
|
-
|
|
2375
|
+
W.map((e) => {
|
|
2359
2376
|
let t = j.get(e.id);
|
|
2360
2377
|
return /* @__PURE__ */ y("td", {
|
|
2361
|
-
className:
|
|
2362
|
-
style:
|
|
2363
|
-
children: t &&
|
|
2364
|
-
value:
|
|
2365
|
-
setValue: (e) =>
|
|
2378
|
+
className: Qa(e.id).filterCell({ class: so(e.id, !0) }),
|
|
2379
|
+
style: co(e.id, !0),
|
|
2380
|
+
children: t && Fo(t) ? t.renderFilter ? t.renderFilter({
|
|
2381
|
+
value: Vo(t),
|
|
2382
|
+
setValue: (e) => Go(t, e),
|
|
2366
2383
|
column: t
|
|
2367
|
-
}) :
|
|
2368
|
-
className:
|
|
2369
|
-
children: [0, 1].map((n) => /* @__PURE__ */ y(
|
|
2370
|
-
type:
|
|
2371
|
-
label: `${O.filter(
|
|
2372
|
-
options:
|
|
2373
|
-
value:
|
|
2374
|
-
onChange: (e) =>
|
|
2384
|
+
}) : Le(Uo(t)) ? /* @__PURE__ */ y("div", {
|
|
2385
|
+
className: V.filterRowRange(),
|
|
2386
|
+
children: [0, 1].map((n) => /* @__PURE__ */ y(An, {
|
|
2387
|
+
type: Wo(t),
|
|
2388
|
+
label: `${O.filter(q(e))}, ${n ? O.to : O.from}`,
|
|
2389
|
+
options: Bo(t),
|
|
2390
|
+
value: Ko(t, n),
|
|
2391
|
+
onChange: (e) => qo(t, n, e)
|
|
2375
2392
|
}, n))
|
|
2376
|
-
}) : /* @__PURE__ */ y(
|
|
2377
|
-
type:
|
|
2378
|
-
label: O.filter(
|
|
2379
|
-
options:
|
|
2393
|
+
}) : /* @__PURE__ */ y(An, {
|
|
2394
|
+
type: Wo(t),
|
|
2395
|
+
label: O.filter(q(e)),
|
|
2396
|
+
options: Bo(t),
|
|
2380
2397
|
any: !0,
|
|
2381
|
-
value:
|
|
2382
|
-
onChange: (e) =>
|
|
2398
|
+
value: Vo(t),
|
|
2399
|
+
onChange: (e) => Go(t, e)
|
|
2383
2400
|
}) : null
|
|
2384
2401
|
}, e.id);
|
|
2385
2402
|
}),
|
|
2386
|
-
|
|
2387
|
-
className:
|
|
2388
|
-
style:
|
|
2403
|
+
U.length > 0 && /* @__PURE__ */ y("td", {
|
|
2404
|
+
className: G("actions", !0),
|
|
2405
|
+
style: K("actions")
|
|
2389
2406
|
})
|
|
2390
2407
|
]
|
|
2391
2408
|
})]
|
|
2392
2409
|
}),
|
|
2393
|
-
|
|
2394
|
-
className:
|
|
2395
|
-
style:
|
|
2396
|
-
children:
|
|
2397
|
-
className:
|
|
2398
|
-
"data-state":
|
|
2399
|
-
"aria-selected":
|
|
2410
|
+
ls.length > 0 && /* @__PURE__ */ y("tbody", {
|
|
2411
|
+
className: V.frozenBody(),
|
|
2412
|
+
style: ti ? { top: iu } : void 0,
|
|
2413
|
+
children: ls.map((e) => /* @__PURE__ */ b("tr", {
|
|
2414
|
+
className: V.row({ class: Ir?.(e.original) }),
|
|
2415
|
+
"data-state": Xo(e) ? "selected" : void 0,
|
|
2416
|
+
"aria-selected": z && cn ? Xo(e) : void 0,
|
|
2400
2417
|
"data-row-id": e.id,
|
|
2401
2418
|
children: [
|
|
2402
|
-
|
|
2403
|
-
className:
|
|
2404
|
-
style:
|
|
2419
|
+
H.map((e) => /* @__PURE__ */ y("td", {
|
|
2420
|
+
className: V.td({ class: G(e, !1) }),
|
|
2421
|
+
style: K(e)
|
|
2405
2422
|
}, e)),
|
|
2406
2423
|
e.getVisibleCells().map((t) => {
|
|
2407
2424
|
let n = j.get(t.column.id);
|
|
2408
2425
|
return /* @__PURE__ */ y("td", {
|
|
2409
|
-
className:
|
|
2410
|
-
style:
|
|
2411
|
-
children: n?.editable && (
|
|
2412
|
-
className:
|
|
2426
|
+
className: Qa(t.column.id).td({ class: so(t.column.id, !1) }),
|
|
2427
|
+
style: co(t.column.id, !1),
|
|
2428
|
+
children: n?.editable && (eo || dc === e.id) ? zu(e, t.column, Zs(e, t.column.id)) : n?.copyable ? /* @__PURE__ */ b("span", {
|
|
2429
|
+
className: V.copyCell(),
|
|
2413
2430
|
children: [n.cell ? n.cell(e.original, t.getValue()) : M(n, t.getValue(), e.original), /* @__PURE__ */ y(ae, {
|
|
2414
2431
|
value: M(n, t.getValue(), e.original),
|
|
2415
|
-
label: O.copy(
|
|
2432
|
+
label: O.copy(q(t.column), M(n, t.getValue(), e.original))
|
|
2416
2433
|
})]
|
|
2417
2434
|
}) : n?.cell ? n.cell(e.original, t.getValue()) : M(n, t.getValue(), e.original)
|
|
2418
2435
|
}, t.id);
|
|
2419
2436
|
}),
|
|
2420
|
-
|
|
2421
|
-
className:
|
|
2422
|
-
style:
|
|
2423
|
-
children:
|
|
2424
|
-
className:
|
|
2425
|
-
children:
|
|
2437
|
+
U.length > 0 && /* @__PURE__ */ y("td", {
|
|
2438
|
+
className: V.td({ class: G("actions", !1) }),
|
|
2439
|
+
style: K("actions"),
|
|
2440
|
+
children: T === "row" && $a && /* @__PURE__ */ y("div", {
|
|
2441
|
+
className: V.editActions(),
|
|
2442
|
+
children: Ru(e, Ci(e.original, e.index))
|
|
2426
2443
|
})
|
|
2427
2444
|
})
|
|
2428
2445
|
]
|
|
2429
2446
|
}, e.id))
|
|
2430
2447
|
}),
|
|
2431
|
-
|
|
2432
|
-
items:
|
|
2433
|
-
label:
|
|
2434
|
-
onSelect: (e) =>
|
|
2435
|
-
children:
|
|
2436
|
-
}) :
|
|
2437
|
-
|
|
2438
|
-
className:
|
|
2448
|
+
Fr && Nr ? /* @__PURE__ */ y(c, {
|
|
2449
|
+
items: xs ? bs(xs) : [],
|
|
2450
|
+
label: xs ? O.rowActions(Ci(xs.original, xs.index)) : void 0,
|
|
2451
|
+
onSelect: (e) => ws(xs, e),
|
|
2452
|
+
children: Bu
|
|
2453
|
+
}) : Bu,
|
|
2454
|
+
gs && /* @__PURE__ */ y("tfoot", {
|
|
2455
|
+
className: V.foot(),
|
|
2439
2456
|
children: /* @__PURE__ */ b("tr", { children: [
|
|
2440
|
-
|
|
2441
|
-
className:
|
|
2442
|
-
style:
|
|
2457
|
+
H.map((e) => /* @__PURE__ */ y("td", {
|
|
2458
|
+
className: V.footCell({ class: G(e, !1) }),
|
|
2459
|
+
style: K(e)
|
|
2443
2460
|
}, e)),
|
|
2444
|
-
|
|
2445
|
-
className:
|
|
2446
|
-
style:
|
|
2447
|
-
children:
|
|
2461
|
+
W.map((e) => /* @__PURE__ */ y("td", {
|
|
2462
|
+
className: Qa(e.id).footCell({ class: so(e.id, !1) }),
|
|
2463
|
+
style: co(e.id, !1),
|
|
2464
|
+
children: ys(j.get(e.id))
|
|
2448
2465
|
}, e.id)),
|
|
2449
|
-
|
|
2450
|
-
className:
|
|
2451
|
-
style:
|
|
2466
|
+
U.length > 0 && /* @__PURE__ */ y("td", {
|
|
2467
|
+
className: V.footCell({ class: G("actions", !1) }),
|
|
2468
|
+
style: K("actions")
|
|
2452
2469
|
})
|
|
2453
2470
|
] })
|
|
2454
2471
|
})
|
|
2455
2472
|
]
|
|
2456
2473
|
})
|
|
2457
2474
|
}),
|
|
2458
|
-
|
|
2459
|
-
className:
|
|
2475
|
+
Br && /* @__PURE__ */ b("div", {
|
|
2476
|
+
className: V.statusBar(),
|
|
2460
2477
|
children: [
|
|
2461
|
-
/* @__PURE__ */ y("span", { children: O.rowCount(
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2478
|
+
/* @__PURE__ */ y("span", { children: O.rowCount(Eu) }),
|
|
2479
|
+
Ro && /* @__PURE__ */ y("span", { children: O.filteredCount(L.getFilteredRowModel().rows.length) }),
|
|
2480
|
+
cn && /* @__PURE__ */ y("span", { children: E.common.selectedCount(Zo) }),
|
|
2481
|
+
Tu.map((e) => /* @__PURE__ */ y("span", { children: e.text }, e.id))
|
|
2465
2482
|
]
|
|
2466
2483
|
}),
|
|
2467
|
-
|
|
2484
|
+
Za && Gt === "bottom" && Iu
|
|
2468
2485
|
]
|
|
2469
2486
|
});
|
|
2470
|
-
return
|
|
2487
|
+
return /* @__PURE__ */ y(kn.Provider, {
|
|
2488
|
+
value: Si,
|
|
2489
|
+
children: R ? rn(Vu, document.body) : /* @__PURE__ */ y(Jt, { children: Vu })
|
|
2490
|
+
});
|
|
2471
2491
|
}
|
|
2472
2492
|
//#endregion
|
|
2473
|
-
|
|
2493
|
+
//#region src/data-table/inputs.ts
|
|
2494
|
+
var Yn = { dateInput: a }, Xn = { numberInput: o };
|
|
2495
|
+
//#endregion
|
|
2496
|
+
export { Jn as DataTable, pe as createDataController, ve as dataSourceToRows, Yn as dateInput, xe as defineMatchMode, Je as moveItem, Ye as moveTreeRow, Xn as numberInput, ut as rowsToDataSource };
|