flexi-datagrid 1.2.13 → 1.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -7
- package/dist/DataTable/components/ConditionFilterPanel.d.ts +8 -0
- package/dist/DataTable/constants.d.ts +8 -0
- package/dist/DataTable/hooks/useColumnFilters.d.ts +10 -2
- package/dist/DataTable/hooks/useDataTableState.d.ts +7 -1
- package/dist/DataTable/index.d.ts +1 -1
- package/dist/DataTable/types.d.ts +17 -0
- package/dist/DataTable/utils/records.d.ts +6 -1
- package/dist/flexi-datagrid.css +1 -1
- package/dist/index.es.js +737 -360
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { createContext as e, useCallback as t, useContext as n, useEffect as r, useLayoutEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
2
|
-
import { ArrowDown as c, ArrowUp as l, ArrowUpDown as u, ChevronDown as d, ChevronLeft as f, ChevronRight as p, ChevronsLeft as m, ChevronsRight as h, Filter as g, Pin as
|
|
3
|
-
import {
|
|
4
|
-
import { createPortal as
|
|
2
|
+
import { ArrowDown as c, ArrowUp as l, ArrowUpDown as u, ChevronDown as d, ChevronLeft as f, ChevronRight as p, ChevronsLeft as m, ChevronsRight as h, Filter as g, Pin as _, PinOff as v, RotateCcw as y, Settings as ee, X as b } from "lucide-react";
|
|
3
|
+
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
4
|
+
import { createPortal as w } from "react-dom";
|
|
5
5
|
//#region src/DataTable/context/DataTableContext.tsx
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
return /* @__PURE__ */
|
|
6
|
+
var T = e(null);
|
|
7
|
+
function E({ value: e, children: t }) {
|
|
8
|
+
return /* @__PURE__ */ S(T.Provider, {
|
|
9
9
|
value: e,
|
|
10
10
|
children: t
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
let e = n(
|
|
13
|
+
function D() {
|
|
14
|
+
let e = n(T);
|
|
15
15
|
if (!e) throw Error("DataTable components must be rendered inside <DataTable>.");
|
|
16
16
|
return e;
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/DataTable/utils/classNames.ts
|
|
20
|
-
var
|
|
20
|
+
var O = (...e) => e.filter(Boolean).join(" ");
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/DataTable/components/GroupZone.tsx
|
|
23
|
-
function
|
|
24
|
-
let { groupedColumns: e, columnsByKey: t, addGroup: n, removeGroup: r } =
|
|
25
|
-
return /* @__PURE__ */
|
|
23
|
+
function te() {
|
|
24
|
+
let { groupedColumns: e, columnsByKey: t, addGroup: n, removeGroup: r } = D(), [i, a] = s(!1);
|
|
25
|
+
return /* @__PURE__ */ S("div", {
|
|
26
26
|
onDragOver: (e) => {
|
|
27
27
|
e.preventDefault(), a(!0);
|
|
28
28
|
},
|
|
@@ -32,22 +32,22 @@ function O() {
|
|
|
32
32
|
let r = e.dataTransfer.getData("text/plain");
|
|
33
33
|
r && t.has(r) && n(r);
|
|
34
34
|
},
|
|
35
|
-
className:
|
|
36
|
-
children: e.length === 0 ? /* @__PURE__ */
|
|
35
|
+
className: O("flexi-groupzone", i && "flexi-groupzone--dragover"),
|
|
36
|
+
children: e.length === 0 ? /* @__PURE__ */ S("span", {
|
|
37
37
|
className: "flexi-groupzone-hint",
|
|
38
38
|
children: "Drag a column header here to group your records by that field"
|
|
39
|
-
}) : /* @__PURE__ */
|
|
39
|
+
}) : /* @__PURE__ */ C("div", {
|
|
40
40
|
className: "flexi-groupzone-chips",
|
|
41
|
-
children: [/* @__PURE__ */
|
|
41
|
+
children: [/* @__PURE__ */ S("span", {
|
|
42
42
|
className: "flexi-groupzone-label",
|
|
43
43
|
children: "Grouped By:"
|
|
44
|
-
}), e.map((e) => /* @__PURE__ */
|
|
44
|
+
}), e.map((e) => /* @__PURE__ */ C("div", {
|
|
45
45
|
className: "flexi-chip",
|
|
46
|
-
children: [/* @__PURE__ */
|
|
46
|
+
children: [/* @__PURE__ */ S("span", { children: t.get(e)?.header || e }), /* @__PURE__ */ S("button", {
|
|
47
47
|
type: "button",
|
|
48
48
|
onClick: () => r(e),
|
|
49
49
|
className: "flexi-icon-btn flexi-chip-remove",
|
|
50
|
-
children: /* @__PURE__ */
|
|
50
|
+
children: /* @__PURE__ */ S(b, { className: "flexi-icon-xs" })
|
|
51
51
|
})]
|
|
52
52
|
}, e))]
|
|
53
53
|
})
|
|
@@ -55,47 +55,47 @@ function O() {
|
|
|
55
55
|
}
|
|
56
56
|
//#endregion
|
|
57
57
|
//#region src/DataTable/components/Pagination.tsx
|
|
58
|
-
function
|
|
59
|
-
let { currentPage: e, pageSize: t, totalPages: n, totalCount: r, pageSizeOptions: i, goToPage: a, changePageSize: o } =
|
|
60
|
-
return /* @__PURE__ */
|
|
58
|
+
function ne() {
|
|
59
|
+
let { currentPage: e, pageSize: t, totalPages: n, totalCount: r, pageSizeOptions: i, goToPage: a, changePageSize: o } = D();
|
|
60
|
+
return /* @__PURE__ */ C("div", {
|
|
61
61
|
className: "flexi-pagination",
|
|
62
62
|
children: [
|
|
63
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ C("div", {
|
|
64
64
|
className: "flexi-pagination-size",
|
|
65
|
-
children: [/* @__PURE__ */
|
|
65
|
+
children: [/* @__PURE__ */ S("span", { children: "Rows per page" }), /* @__PURE__ */ S("select", {
|
|
66
66
|
value: t,
|
|
67
67
|
onChange: (e) => o(Number(e.target.value)),
|
|
68
68
|
className: "flexi-pagination-select",
|
|
69
|
-
children: i.map((e) => /* @__PURE__ */
|
|
69
|
+
children: i.map((e) => /* @__PURE__ */ S("option", {
|
|
70
70
|
value: e,
|
|
71
71
|
children: e
|
|
72
72
|
}, e))
|
|
73
73
|
})]
|
|
74
74
|
}),
|
|
75
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ S("div", {
|
|
76
76
|
className: "flexi-pagination-info",
|
|
77
77
|
children: r === 0 ? "0 of 0" : `${(e - 1) * t + 1}–${Math.min(e * t, r)} of ${r}`
|
|
78
78
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ C("div", {
|
|
80
80
|
className: "flexi-pagination-controls",
|
|
81
81
|
children: [
|
|
82
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ S("button", {
|
|
83
83
|
type: "button",
|
|
84
84
|
onClick: () => a(1),
|
|
85
85
|
disabled: e === 1,
|
|
86
86
|
className: "flexi-icon-btn",
|
|
87
87
|
title: "First page",
|
|
88
|
-
children: /* @__PURE__ */
|
|
88
|
+
children: /* @__PURE__ */ S(m, { className: "flexi-icon-sm" })
|
|
89
89
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ S("button", {
|
|
91
91
|
type: "button",
|
|
92
92
|
onClick: () => a(e - 1),
|
|
93
93
|
disabled: e === 1,
|
|
94
94
|
className: "flexi-icon-btn",
|
|
95
95
|
title: "Previous page",
|
|
96
|
-
children: /* @__PURE__ */
|
|
96
|
+
children: /* @__PURE__ */ S(f, { className: "flexi-icon-sm" })
|
|
97
97
|
}),
|
|
98
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ C("span", {
|
|
99
99
|
className: "flexi-pagination-page",
|
|
100
100
|
children: [
|
|
101
101
|
"Page ",
|
|
@@ -104,21 +104,21 @@ function te() {
|
|
|
104
104
|
n
|
|
105
105
|
]
|
|
106
106
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ S("button", {
|
|
108
108
|
type: "button",
|
|
109
109
|
onClick: () => a(e + 1),
|
|
110
110
|
disabled: e === n,
|
|
111
111
|
className: "flexi-icon-btn",
|
|
112
112
|
title: "Next page",
|
|
113
|
-
children: /* @__PURE__ */
|
|
113
|
+
children: /* @__PURE__ */ S(p, { className: "flexi-icon-sm" })
|
|
114
114
|
}),
|
|
115
|
-
/* @__PURE__ */
|
|
115
|
+
/* @__PURE__ */ S("button", {
|
|
116
116
|
type: "button",
|
|
117
117
|
onClick: () => a(n),
|
|
118
118
|
disabled: e === n,
|
|
119
119
|
className: "flexi-icon-btn",
|
|
120
120
|
title: "Last page",
|
|
121
|
-
children: /* @__PURE__ */
|
|
121
|
+
children: /* @__PURE__ */ S(h, { className: "flexi-icon-sm" })
|
|
122
122
|
})
|
|
123
123
|
]
|
|
124
124
|
})
|
|
@@ -127,12 +127,133 @@ function te() {
|
|
|
127
127
|
}
|
|
128
128
|
//#endregion
|
|
129
129
|
//#region src/DataTable/constants.ts
|
|
130
|
-
var
|
|
130
|
+
var re = [
|
|
131
131
|
10,
|
|
132
132
|
25,
|
|
133
133
|
50,
|
|
134
134
|
100
|
|
135
|
-
],
|
|
135
|
+
], ie = [], ae = [], k = [{
|
|
136
|
+
value: "blank",
|
|
137
|
+
label: "Blank",
|
|
138
|
+
valueCount: 0
|
|
139
|
+
}, {
|
|
140
|
+
value: "notBlank",
|
|
141
|
+
label: "Not blank",
|
|
142
|
+
valueCount: 0
|
|
143
|
+
}], oe = {
|
|
144
|
+
text: [
|
|
145
|
+
{
|
|
146
|
+
value: "contains",
|
|
147
|
+
label: "Contains",
|
|
148
|
+
valueCount: 1
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
value: "notContains",
|
|
152
|
+
label: "Not contains",
|
|
153
|
+
valueCount: 1
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
value: "equals",
|
|
157
|
+
label: "Equals",
|
|
158
|
+
valueCount: 1
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
value: "notEqual",
|
|
162
|
+
label: "Not equal",
|
|
163
|
+
valueCount: 1
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
value: "startsWith",
|
|
167
|
+
label: "Starts with",
|
|
168
|
+
valueCount: 1
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
value: "endsWith",
|
|
172
|
+
label: "Ends with",
|
|
173
|
+
valueCount: 1
|
|
174
|
+
},
|
|
175
|
+
...k
|
|
176
|
+
],
|
|
177
|
+
number: [
|
|
178
|
+
{
|
|
179
|
+
value: "equals",
|
|
180
|
+
label: "Equals",
|
|
181
|
+
valueCount: 1
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
value: "notEqual",
|
|
185
|
+
label: "Not equal",
|
|
186
|
+
valueCount: 1
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
value: "greaterThan",
|
|
190
|
+
label: "Greater than",
|
|
191
|
+
valueCount: 1
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
value: "greaterThanOrEqual",
|
|
195
|
+
label: "Greater than or equal",
|
|
196
|
+
valueCount: 1
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
value: "lessThan",
|
|
200
|
+
label: "Less than",
|
|
201
|
+
valueCount: 1
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
value: "lessThanOrEqual",
|
|
205
|
+
label: "Less than or equal",
|
|
206
|
+
valueCount: 1
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
value: "inRange",
|
|
210
|
+
label: "In range",
|
|
211
|
+
valueCount: 2
|
|
212
|
+
},
|
|
213
|
+
...k
|
|
214
|
+
],
|
|
215
|
+
date: [
|
|
216
|
+
{
|
|
217
|
+
value: "equals",
|
|
218
|
+
label: "Equals",
|
|
219
|
+
valueCount: 1
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
value: "notEqual",
|
|
223
|
+
label: "Not equal",
|
|
224
|
+
valueCount: 1
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
value: "before",
|
|
228
|
+
label: "Before",
|
|
229
|
+
valueCount: 1
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
value: "after",
|
|
233
|
+
label: "After",
|
|
234
|
+
valueCount: 1
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
value: "inRange",
|
|
238
|
+
label: "In range",
|
|
239
|
+
valueCount: 2
|
|
240
|
+
},
|
|
241
|
+
...k
|
|
242
|
+
],
|
|
243
|
+
boolean: [
|
|
244
|
+
{
|
|
245
|
+
value: "equals",
|
|
246
|
+
label: "Equals",
|
|
247
|
+
valueCount: 1
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
value: "notEqual",
|
|
251
|
+
label: "Not equal",
|
|
252
|
+
valueCount: 1
|
|
253
|
+
},
|
|
254
|
+
...k
|
|
255
|
+
]
|
|
256
|
+
}, A = (e) => {
|
|
136
257
|
let t = [];
|
|
137
258
|
return e.forEach((e) => {
|
|
138
259
|
e.children && e.children.length > 0 ? t.push(...A(e.children)) : t.push(e);
|
|
@@ -140,13 +261,13 @@ var ne = [
|
|
|
140
261
|
}, j = (e) => {
|
|
141
262
|
if (e === !0) return "left";
|
|
142
263
|
if (e === "left" || e === "right") return e;
|
|
143
|
-
},
|
|
264
|
+
}, M = (e) => {
|
|
144
265
|
let t = {};
|
|
145
266
|
return e.forEach((e) => {
|
|
146
267
|
let n = j(e.pinned);
|
|
147
268
|
n && (t[e.key] = n);
|
|
148
269
|
}), t;
|
|
149
|
-
},
|
|
270
|
+
}, N = (e, t, n) => {
|
|
150
271
|
let r = (e) => {
|
|
151
272
|
let n = t[e];
|
|
152
273
|
return n === "left" ? 0 : n === "right" ? 2 : 1;
|
|
@@ -161,11 +282,11 @@ var ne = [
|
|
|
161
282
|
children: i(e.children)
|
|
162
283
|
} : e);
|
|
163
284
|
return i(e);
|
|
164
|
-
},
|
|
285
|
+
}, se = (e, t, n) => {
|
|
165
286
|
let r = e.map((e) => e.key);
|
|
166
287
|
if (r.includes(t) && r.includes(n)) return e;
|
|
167
288
|
for (let r of e) if (r.children && r.children.length > 0) {
|
|
168
|
-
let e =
|
|
289
|
+
let e = se(r.children, t, n);
|
|
169
290
|
if (e) return e;
|
|
170
291
|
}
|
|
171
292
|
return null;
|
|
@@ -176,7 +297,7 @@ var ne = [
|
|
|
176
297
|
if (typeof r == "number") return r;
|
|
177
298
|
let i = String(r).trim();
|
|
178
299
|
return /^\d+(\.\d+)?(px)?$/i.test(i) && parseInt(i, 10) || 150;
|
|
179
|
-
},
|
|
300
|
+
}, ce = (e, t, n) => {
|
|
180
301
|
let r = (e) => {
|
|
181
302
|
let t = 0;
|
|
182
303
|
return e.forEach((e) => {
|
|
@@ -203,7 +324,7 @@ var ne = [
|
|
|
203
324
|
...e,
|
|
204
325
|
rowSpan: Math.min(e.rowSpan, c.length - t)
|
|
205
326
|
})));
|
|
206
|
-
},
|
|
327
|
+
}, le = ({ visibleLeafColumns: e, pinnedColumns: t, columnWidths: n, hasGroups: r, hasActions: i }) => {
|
|
207
328
|
let a = {}, o = r ? 48 : 0;
|
|
208
329
|
e.forEach((e) => {
|
|
209
330
|
t[e.key] === "left" && (a[e.key] = {
|
|
@@ -220,7 +341,7 @@ var ne = [
|
|
|
220
341
|
}, s += P(i, n));
|
|
221
342
|
}
|
|
222
343
|
return a;
|
|
223
|
-
},
|
|
344
|
+
}, ue = (e, t, n = !1, r) => {
|
|
224
345
|
let i = e[t];
|
|
225
346
|
if (!i) return r || {};
|
|
226
347
|
let a = i.side === "right";
|
|
@@ -233,7 +354,7 @@ var ne = [
|
|
|
233
354
|
boxShadow: a ? "-2px 0 5px -2px rgba(0,0,0,0.1)" : "2px 0 5px -2px rgba(0,0,0,0.1)",
|
|
234
355
|
...r
|
|
235
356
|
};
|
|
236
|
-
},
|
|
357
|
+
}, de = () => /* @__PURE__ */ S("td", {
|
|
237
358
|
className: "flexi-row-indent-cell",
|
|
238
359
|
style: {
|
|
239
360
|
position: "sticky",
|
|
@@ -241,25 +362,25 @@ var ne = [
|
|
|
241
362
|
zIndex: 10
|
|
242
363
|
}
|
|
243
364
|
});
|
|
244
|
-
function
|
|
245
|
-
return /* @__PURE__ */
|
|
365
|
+
function F({ children: e }) {
|
|
366
|
+
return /* @__PURE__ */ S("td", {
|
|
246
367
|
className: "flexi-actions-cell",
|
|
247
368
|
style: {
|
|
248
369
|
position: "sticky",
|
|
249
370
|
right: 0
|
|
250
371
|
},
|
|
251
|
-
children: /* @__PURE__ */
|
|
372
|
+
children: /* @__PURE__ */ S("div", {
|
|
252
373
|
className: "flexi-actions-inner",
|
|
253
374
|
children: e
|
|
254
375
|
})
|
|
255
376
|
});
|
|
256
377
|
}
|
|
257
|
-
function
|
|
258
|
-
let { rowHeight: t, expandedGroups: n, toggleGroupExpansion: r, totalColumnsCount: i } =
|
|
259
|
-
return /* @__PURE__ */
|
|
378
|
+
function fe({ node: e }) {
|
|
379
|
+
let { rowHeight: t, expandedGroups: n, toggleGroupExpansion: r, totalColumnsCount: i } = D(), a = n[e.path] !== !1;
|
|
380
|
+
return /* @__PURE__ */ C("tr", {
|
|
260
381
|
className: "flexi-group-row",
|
|
261
382
|
style: { height: t },
|
|
262
|
-
children: [/* @__PURE__ */
|
|
383
|
+
children: [/* @__PURE__ */ S("td", {
|
|
263
384
|
className: "flexi-group-cell",
|
|
264
385
|
style: {
|
|
265
386
|
position: "sticky",
|
|
@@ -268,87 +389,87 @@ function se({ node: e }) {
|
|
|
268
389
|
backgroundColor: "rgba(248, 250, 252, 0.9)",
|
|
269
390
|
paddingLeft: `${e.depth * 12 + 16}px`
|
|
270
391
|
},
|
|
271
|
-
children: /* @__PURE__ */
|
|
392
|
+
children: /* @__PURE__ */ C("button", {
|
|
272
393
|
type: "button",
|
|
273
394
|
onClick: () => r(e.path),
|
|
274
395
|
className: "flexi-group-toggle",
|
|
275
396
|
children: [
|
|
276
|
-
|
|
277
|
-
/* @__PURE__ */
|
|
397
|
+
S(a ? d : p, { className: "flexi-icon-md flexi-icon-muted" }),
|
|
398
|
+
/* @__PURE__ */ S("span", {
|
|
278
399
|
className: "flexi-group-value",
|
|
279
400
|
children: e.groupValue
|
|
280
401
|
}),
|
|
281
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ S("span", {
|
|
282
403
|
className: "flexi-group-count",
|
|
283
404
|
children: e.totalItemsCount
|
|
284
405
|
})
|
|
285
406
|
]
|
|
286
407
|
})
|
|
287
|
-
}), /* @__PURE__ */
|
|
408
|
+
}), /* @__PURE__ */ S("td", {
|
|
288
409
|
colSpan: Math.max(1, i - 1),
|
|
289
410
|
className: "flexi-group-filler"
|
|
290
411
|
})]
|
|
291
412
|
});
|
|
292
413
|
}
|
|
293
|
-
function
|
|
294
|
-
let { rowHeight: r, hasGroups: i, hasActions: a, actions: o, onRowClick: s, visibleLeafColumns: c, pinnedColumns: l, pinOffsets: u, rowSpanColumns: d, rowSpanInfo: f } =
|
|
295
|
-
return /* @__PURE__ */
|
|
296
|
-
className:
|
|
414
|
+
function pe({ record: e, rowIndex: t, className: n }) {
|
|
415
|
+
let { rowHeight: r, hasGroups: i, hasActions: a, actions: o, onRowClick: s, visibleLeafColumns: c, pinnedColumns: l, pinOffsets: u, rowSpanColumns: d, rowSpanInfo: f } = D(), p = f.get(t);
|
|
416
|
+
return /* @__PURE__ */ C("tr", {
|
|
417
|
+
className: O("flexi-row", s && "flexi-row--clickable", n),
|
|
297
418
|
style: { height: r },
|
|
298
419
|
onClick: s ? (n) => s(e, t, n) : void 0,
|
|
299
420
|
children: [
|
|
300
|
-
i && /* @__PURE__ */
|
|
421
|
+
i && /* @__PURE__ */ S(de, {}),
|
|
301
422
|
c.map((t) => {
|
|
302
423
|
let n = d?.includes(t.key) ? p?.[t.key] : void 0;
|
|
303
424
|
if (n === "skip") return null;
|
|
304
425
|
let r = e[t.key];
|
|
305
|
-
return /* @__PURE__ */
|
|
426
|
+
return /* @__PURE__ */ S("td", {
|
|
306
427
|
rowSpan: typeof n == "number" ? n : void 0,
|
|
307
|
-
className:
|
|
308
|
-
style:
|
|
309
|
-
children: t.render ? t.render(r, e) : /* @__PURE__ */
|
|
428
|
+
className: O("flexi-cell", !!l[t.key] && "flexi-cell--pinned", t.className),
|
|
429
|
+
style: ue(u, t.key, !1, t.style),
|
|
430
|
+
children: t.render ? t.render(r, e) : /* @__PURE__ */ S("span", {
|
|
310
431
|
className: "flexi-cell-text",
|
|
311
432
|
children: r
|
|
312
433
|
})
|
|
313
434
|
}, t.key);
|
|
314
435
|
}),
|
|
315
|
-
a && o && /* @__PURE__ */
|
|
436
|
+
a && o && /* @__PURE__ */ S(F, { children: o(e) })
|
|
316
437
|
]
|
|
317
438
|
});
|
|
318
439
|
}
|
|
319
|
-
function
|
|
320
|
-
let { hasGroups: r, hasActions: i, actions: a, pinnedBottomRowData: o, visibleLeafColumns: s, pinnedColumns: c, pinOffsets: l } =
|
|
440
|
+
function me({ record: e, index: t, className: n }) {
|
|
441
|
+
let { hasGroups: r, hasActions: i, actions: a, pinnedBottomRowData: o, visibleLeafColumns: s, pinnedColumns: c, pinOffsets: l } = D(), u = {
|
|
321
442
|
position: "sticky",
|
|
322
443
|
bottom: `${(o.length - 1 - t) * 48}px`,
|
|
323
444
|
zIndex: 45
|
|
324
445
|
};
|
|
325
|
-
return /* @__PURE__ */
|
|
326
|
-
className:
|
|
446
|
+
return /* @__PURE__ */ C("tr", {
|
|
447
|
+
className: O("flexi-row", "flexi-row--pinned-bottom", n),
|
|
327
448
|
style: u,
|
|
328
449
|
children: [
|
|
329
|
-
r && /* @__PURE__ */
|
|
450
|
+
r && /* @__PURE__ */ S(de, {}),
|
|
330
451
|
s.map((t) => {
|
|
331
452
|
let n = e[t.key], r = t.pinnedRender ?? t.render;
|
|
332
|
-
return /* @__PURE__ */
|
|
333
|
-
className:
|
|
334
|
-
style:
|
|
335
|
-
children: r ? r(n, e) : /* @__PURE__ */
|
|
453
|
+
return /* @__PURE__ */ S("td", {
|
|
454
|
+
className: O("flexi-cell", !!c[t.key] && "flexi-cell--pinned", t.className),
|
|
455
|
+
style: ue(l, t.key, !1, t.style),
|
|
456
|
+
children: r ? r(n, e) : /* @__PURE__ */ S("span", {
|
|
336
457
|
className: "flexi-cell-text",
|
|
337
458
|
children: n
|
|
338
459
|
})
|
|
339
460
|
}, t.key);
|
|
340
461
|
}),
|
|
341
|
-
i && a && /* @__PURE__ */
|
|
462
|
+
i && a && /* @__PURE__ */ S(F, { children: a(e) })
|
|
342
463
|
]
|
|
343
464
|
});
|
|
344
465
|
}
|
|
345
466
|
//#endregion
|
|
346
467
|
//#region src/DataTable/components/PinnedBottomBody.tsx
|
|
347
|
-
function
|
|
348
|
-
let { pinnedBottomRowData: e, pinnedRowClassName: t } =
|
|
349
|
-
return e.length === 0 ? null : /* @__PURE__ */
|
|
468
|
+
function I() {
|
|
469
|
+
let { pinnedBottomRowData: e, pinnedRowClassName: t } = D();
|
|
470
|
+
return e.length === 0 ? null : /* @__PURE__ */ S("tbody", {
|
|
350
471
|
className: "flexi-tbody flexi-tbody--pinned-bottom",
|
|
351
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
472
|
+
children: e.map((e, n) => /* @__PURE__ */ S(me, {
|
|
352
473
|
record: e,
|
|
353
474
|
index: n,
|
|
354
475
|
className: typeof t == "function" ? t(e, n) : t
|
|
@@ -357,22 +478,22 @@ function le() {
|
|
|
357
478
|
}
|
|
358
479
|
//#endregion
|
|
359
480
|
//#region src/DataTable/components/SettingsMenu.tsx
|
|
360
|
-
function
|
|
361
|
-
let { settingsMenu: e } =
|
|
362
|
-
return /* @__PURE__ */
|
|
481
|
+
function L() {
|
|
482
|
+
let { settingsMenu: e } = D();
|
|
483
|
+
return /* @__PURE__ */ S("button", {
|
|
363
484
|
type: "button",
|
|
364
485
|
ref: e.buttonRef,
|
|
365
486
|
onClick: (t) => {
|
|
366
487
|
t.stopPropagation(), e.toggle();
|
|
367
488
|
},
|
|
368
|
-
className:
|
|
489
|
+
className: O("flexi-icon-btn", e.isOpen && "flexi-settings-btn--active"),
|
|
369
490
|
title: "Grid display settings",
|
|
370
|
-
children: /* @__PURE__ */
|
|
491
|
+
children: /* @__PURE__ */ S(ee, { className: "flexi-icon-sm" })
|
|
371
492
|
});
|
|
372
493
|
}
|
|
373
|
-
function
|
|
374
|
-
let { gridRootRef: e, settingsMenu: t, displayPinnedIcon: n, toggleDisplayPinnedIcon: r, showGroupBy: i, toggleShowGroupBy: a, initialLeafColumns: o, hiddenColumns: s, toggleColumnVisibility: c, resetControlPanelDefaults: l } =
|
|
375
|
-
return !t.isOpen || !t.position || !u ? null :
|
|
494
|
+
function R() {
|
|
495
|
+
let { gridRootRef: e, settingsMenu: t, displayPinnedIcon: n, toggleDisplayPinnedIcon: r, showGroupBy: i, toggleShowGroupBy: a, initialLeafColumns: o, hiddenColumns: s, toggleColumnVisibility: c, resetControlPanelDefaults: l } = D(), u = e.current;
|
|
496
|
+
return !t.isOpen || !t.position || !u ? null : w(/* @__PURE__ */ C("div", {
|
|
376
497
|
ref: t.menuRef,
|
|
377
498
|
className: "flexi-settings-menu",
|
|
378
499
|
style: {
|
|
@@ -381,116 +502,167 @@ function z() {
|
|
|
381
502
|
zIndex: 9999
|
|
382
503
|
},
|
|
383
504
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
505
|
+
/* @__PURE__ */ C("div", {
|
|
385
506
|
className: "flexi-settings-section",
|
|
386
507
|
children: [
|
|
387
|
-
/* @__PURE__ */
|
|
508
|
+
/* @__PURE__ */ S("span", {
|
|
388
509
|
className: "flexi-settings-heading",
|
|
389
510
|
children: "Action Icons"
|
|
390
511
|
}),
|
|
391
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ C("label", {
|
|
392
513
|
className: "flexi-filter-option",
|
|
393
|
-
children: [/* @__PURE__ */
|
|
514
|
+
children: [/* @__PURE__ */ S("input", {
|
|
394
515
|
type: "checkbox",
|
|
395
516
|
className: "flexi-checkbox",
|
|
396
517
|
checked: n,
|
|
397
518
|
onChange: r
|
|
398
|
-
}), /* @__PURE__ */
|
|
519
|
+
}), /* @__PURE__ */ S("span", {
|
|
399
520
|
className: "flexi-filter-option-text",
|
|
400
521
|
children: "Show pin icon on hover"
|
|
401
522
|
})]
|
|
402
523
|
}),
|
|
403
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ C("label", {
|
|
404
525
|
className: "flexi-filter-option",
|
|
405
|
-
children: [/* @__PURE__ */
|
|
526
|
+
children: [/* @__PURE__ */ S("input", {
|
|
406
527
|
type: "checkbox",
|
|
407
528
|
className: "flexi-checkbox",
|
|
408
529
|
checked: i,
|
|
409
530
|
onChange: a
|
|
410
|
-
}), /* @__PURE__ */
|
|
531
|
+
}), /* @__PURE__ */ S("span", {
|
|
411
532
|
className: "flexi-filter-option-text",
|
|
412
533
|
children: "Group By"
|
|
413
534
|
})]
|
|
414
535
|
})
|
|
415
536
|
]
|
|
416
537
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ S("div", { className: "flexi-settings-divider" }),
|
|
539
|
+
/* @__PURE__ */ C("div", {
|
|
419
540
|
className: "flexi-settings-section",
|
|
420
|
-
children: [/* @__PURE__ */
|
|
541
|
+
children: [/* @__PURE__ */ S("span", {
|
|
421
542
|
className: "flexi-settings-heading",
|
|
422
543
|
children: "Columns"
|
|
423
|
-
}), o.map((e) => /* @__PURE__ */
|
|
544
|
+
}), o.map((e) => /* @__PURE__ */ C("label", {
|
|
424
545
|
className: "flexi-filter-option",
|
|
425
|
-
children: [/* @__PURE__ */
|
|
546
|
+
children: [/* @__PURE__ */ S("input", {
|
|
426
547
|
type: "checkbox",
|
|
427
548
|
className: "flexi-checkbox",
|
|
428
549
|
checked: !s.includes(e.key),
|
|
429
550
|
onChange: () => c(e.key)
|
|
430
|
-
}), /* @__PURE__ */
|
|
551
|
+
}), /* @__PURE__ */ S("span", {
|
|
431
552
|
className: "flexi-filter-option-text",
|
|
432
553
|
children: e.header
|
|
433
554
|
})]
|
|
434
555
|
}, e.key))]
|
|
435
556
|
}),
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ S("div", { className: "flexi-settings-divider" }),
|
|
558
|
+
/* @__PURE__ */ C("button", {
|
|
438
559
|
type: "button",
|
|
439
560
|
onClick: l,
|
|
440
561
|
className: "flexi-settings-reset",
|
|
441
562
|
title: "Reset pin icon visibility and hidden columns to their defaults",
|
|
442
|
-
children: [/* @__PURE__ */
|
|
563
|
+
children: [/* @__PURE__ */ S(y, { className: "flexi-icon-sm" }), /* @__PURE__ */ S("span", { children: "Reset to defaults" })]
|
|
443
564
|
})
|
|
444
565
|
]
|
|
445
566
|
}), u);
|
|
446
567
|
}
|
|
447
568
|
//#endregion
|
|
448
569
|
//#region src/DataTable/utils/records.ts
|
|
449
|
-
var
|
|
570
|
+
var z = (e, t, n) => n?.getValue ? n.getValue(e) : e[t], B = (e, t) => {
|
|
450
571
|
let n = typeof t == "function" ? t(e) : e[t];
|
|
451
572
|
return n == null ? void 0 : String(n);
|
|
452
|
-
},
|
|
573
|
+
}, he = (e, t, n) => {
|
|
453
574
|
if (!n) return;
|
|
454
575
|
let r;
|
|
455
576
|
for (let i in n) n[i](e, t) && (r = r ? `${r} ${i}` : i);
|
|
456
577
|
return r;
|
|
457
|
-
},
|
|
458
|
-
let r = e.map((e) =>
|
|
578
|
+
}, V = (e, t, n) => {
|
|
579
|
+
let r = e.map((e) => z(e, t, n));
|
|
459
580
|
return Array.from(new Set(r)).filter((e) => e != null);
|
|
460
|
-
},
|
|
581
|
+
}, ge = (e, t, n) => {
|
|
461
582
|
let r = Object.entries(t).filter(([, e]) => e && e.length > 0);
|
|
462
|
-
return r.length === 0 ? e : e.filter((e) => r.every(([t, r]) => r.includes(
|
|
463
|
-
},
|
|
583
|
+
return r.length === 0 ? e : e.filter((e) => r.every(([t, r]) => r.includes(z(e, t, n.get(t)))));
|
|
584
|
+
}, _e = (e, t, n) => {
|
|
585
|
+
if (n?.filterType) return n.filterType;
|
|
586
|
+
for (let r of e) {
|
|
587
|
+
let e = z(r, t, n);
|
|
588
|
+
if (e != null) return typeof e == "number" ? "number" : typeof e == "boolean" ? "boolean" : e instanceof Date ? "date" : "text";
|
|
589
|
+
}
|
|
590
|
+
return "text";
|
|
591
|
+
}, H = (e) => e == null || e === "", ve = (e, t) => {
|
|
592
|
+
if (H(e)) return null;
|
|
593
|
+
if (t === "number") {
|
|
594
|
+
let t = typeof e == "number" ? e : parseFloat(String(e));
|
|
595
|
+
return Number.isNaN(t) ? null : t;
|
|
596
|
+
}
|
|
597
|
+
if (t === "date") {
|
|
598
|
+
let t = e instanceof Date ? e.getTime() : new Date(String(e)).getTime();
|
|
599
|
+
return Number.isNaN(t) ? null : t;
|
|
600
|
+
}
|
|
601
|
+
return String(e).toLowerCase();
|
|
602
|
+
}, ye = (e, t, n) => {
|
|
603
|
+
if (t.operator === "blank") return H(e);
|
|
604
|
+
if (t.operator === "notBlank") return !H(e);
|
|
605
|
+
let r = ve(e, n);
|
|
606
|
+
if (r === null) return !1;
|
|
607
|
+
let i = ve(t.value, n);
|
|
608
|
+
switch (t.operator) {
|
|
609
|
+
case "contains": return typeof r == "string" && i !== null && r.includes(String(i));
|
|
610
|
+
case "notContains": return i === null || typeof r != "string" || !r.includes(String(i));
|
|
611
|
+
case "startsWith": return typeof r == "string" && i !== null && r.startsWith(String(i));
|
|
612
|
+
case "endsWith": return typeof r == "string" && i !== null && r.endsWith(String(i));
|
|
613
|
+
case "equals": return i !== null && r === i;
|
|
614
|
+
case "notEqual": return i === null || r !== i;
|
|
615
|
+
case "greaterThan": return i !== null && r > i;
|
|
616
|
+
case "greaterThanOrEqual": return i !== null && r >= i;
|
|
617
|
+
case "lessThan": return i !== null && r < i;
|
|
618
|
+
case "lessThanOrEqual": return i !== null && r <= i;
|
|
619
|
+
case "before": return i !== null && r < i;
|
|
620
|
+
case "after": return i !== null && r > i;
|
|
621
|
+
case "inRange": {
|
|
622
|
+
let e = i, a = ve(t.valueTo, n);
|
|
623
|
+
return e === null || a === null ? !1 : r >= e && r <= a;
|
|
624
|
+
}
|
|
625
|
+
default: return !0;
|
|
626
|
+
}
|
|
627
|
+
}, be = (e, t, n) => {
|
|
628
|
+
let r = Object.entries(t).filter(([, e]) => e && e.conditions.length > 0);
|
|
629
|
+
if (r.length === 0) return e;
|
|
630
|
+
let i = new Map(r.map(([t]) => [t, _e(e, t, n.get(t))]));
|
|
631
|
+
return e.filter((e) => r.every(([t, r]) => {
|
|
632
|
+
let a = n.get(t), o = i.get(t), s = z(e, t, a), c = r.conditions.map((e) => ye(s, e, o));
|
|
633
|
+
return r.combinator === "OR" ? c.some(Boolean) : c.every(Boolean);
|
|
634
|
+
}));
|
|
635
|
+
}, U = (e) => e == null || typeof e == "number" && Number.isNaN(e), W = (e, t) => typeof e == "number" && typeof t == "number" ? e - t : e instanceof Date && t instanceof Date ? e.getTime() - t.getTime() : String(e).localeCompare(String(t), void 0, {
|
|
464
636
|
numeric: !0,
|
|
465
637
|
sensitivity: "base"
|
|
466
|
-
}),
|
|
467
|
-
let a =
|
|
638
|
+
}), xe = (e, t, n, r) => [...e].sort((e, i) => {
|
|
639
|
+
let a = z(e, t, r), o = z(i, t, r);
|
|
468
640
|
if (a === o) return 0;
|
|
469
|
-
let s =
|
|
641
|
+
let s = U(a), c = U(o);
|
|
470
642
|
if (s && c) return 0;
|
|
471
643
|
if (s) return 1;
|
|
472
644
|
if (c) return -1;
|
|
473
|
-
let l =
|
|
645
|
+
let l = W(a, o);
|
|
474
646
|
return n === "asc" ? l : -l;
|
|
475
647
|
});
|
|
476
648
|
//#endregion
|
|
477
649
|
//#region src/DataTable/components/TableBody.tsx
|
|
478
|
-
function
|
|
479
|
-
let { isLoading: e, visibleRows: t, startIndex: n, totalRowCount: r, topSpacerHeight: i, bottomSpacerHeight: a, totalColumnsCount: o, rowKey: s, rowClassRules: c } =
|
|
480
|
-
return e || r === 0 ? /* @__PURE__ */
|
|
650
|
+
function G() {
|
|
651
|
+
let { isLoading: e, visibleRows: t, startIndex: n, totalRowCount: r, topSpacerHeight: i, bottomSpacerHeight: a, totalColumnsCount: o, rowKey: s, rowClassRules: c } = D(), l = Math.max(1, o);
|
|
652
|
+
return e || r === 0 ? /* @__PURE__ */ S("tbody", {
|
|
481
653
|
className: "flexi-tbody",
|
|
482
|
-
children: /* @__PURE__ */
|
|
654
|
+
children: /* @__PURE__ */ S("tr", { children: /* @__PURE__ */ S("td", {
|
|
483
655
|
colSpan: l,
|
|
484
656
|
className: "flexi-empty-cell",
|
|
485
657
|
children: e ? "Loading records..." : "No records found matching criteria."
|
|
486
658
|
}) })
|
|
487
|
-
}) : /* @__PURE__ */
|
|
659
|
+
}) : /* @__PURE__ */ C("tbody", {
|
|
488
660
|
className: "flexi-tbody",
|
|
489
661
|
children: [
|
|
490
|
-
i > 0 && /* @__PURE__ */
|
|
662
|
+
i > 0 && /* @__PURE__ */ S("tr", {
|
|
491
663
|
"aria-hidden": "true",
|
|
492
664
|
style: { height: i },
|
|
493
|
-
children: /* @__PURE__ */
|
|
665
|
+
children: /* @__PURE__ */ S("td", {
|
|
494
666
|
colSpan: l,
|
|
495
667
|
style: {
|
|
496
668
|
padding: 0,
|
|
@@ -501,16 +673,16 @@ function pe() {
|
|
|
501
673
|
}),
|
|
502
674
|
t.map((e, t) => {
|
|
503
675
|
let r = n + t;
|
|
504
|
-
return e.kind === "group" ? /* @__PURE__ */
|
|
676
|
+
return e.kind === "group" ? /* @__PURE__ */ S(fe, { node: e }, `group-header-${e.path}-${r}`) : /* @__PURE__ */ S(pe, {
|
|
505
677
|
record: e.record,
|
|
506
678
|
rowIndex: r,
|
|
507
|
-
className:
|
|
508
|
-
},
|
|
679
|
+
className: he(e.record, r, c)
|
|
680
|
+
}, B(e.record, s) ?? `row-${r}`);
|
|
509
681
|
}),
|
|
510
|
-
a > 0 && /* @__PURE__ */
|
|
682
|
+
a > 0 && /* @__PURE__ */ S("tr", {
|
|
511
683
|
"aria-hidden": "true",
|
|
512
684
|
style: { height: a },
|
|
513
|
-
children: /* @__PURE__ */
|
|
685
|
+
children: /* @__PURE__ */ S("td", {
|
|
514
686
|
colSpan: l,
|
|
515
687
|
style: {
|
|
516
688
|
padding: 0,
|
|
@@ -524,24 +696,190 @@ function pe() {
|
|
|
524
696
|
}
|
|
525
697
|
//#endregion
|
|
526
698
|
//#region src/DataTable/components/TableColGroup.tsx
|
|
527
|
-
function
|
|
528
|
-
let { hasGroups: e, hasActions: t, visibleLeafColumns: n, columnWidths: r } =
|
|
529
|
-
return /* @__PURE__ */
|
|
530
|
-
e && /* @__PURE__ */
|
|
531
|
-
n.map((e) => /* @__PURE__ */
|
|
699
|
+
function K() {
|
|
700
|
+
let { hasGroups: e, hasActions: t, visibleLeafColumns: n, columnWidths: r } = D();
|
|
701
|
+
return /* @__PURE__ */ C("colgroup", { children: [
|
|
702
|
+
e && /* @__PURE__ */ S("col", { style: { width: "48px" } }),
|
|
703
|
+
n.map((e) => /* @__PURE__ */ S("col", { style: {
|
|
532
704
|
...e.style,
|
|
533
705
|
width: P(e, r)
|
|
534
706
|
} }, e.key)),
|
|
535
|
-
t && /* @__PURE__ */
|
|
707
|
+
t && /* @__PURE__ */ S("col", { style: { width: "100px" } })
|
|
536
708
|
] });
|
|
537
709
|
}
|
|
538
710
|
//#endregion
|
|
711
|
+
//#region src/DataTable/components/ConditionFilterPanel.tsx
|
|
712
|
+
function Se(e, t) {
|
|
713
|
+
let [n, r] = e?.conditions ?? [];
|
|
714
|
+
return {
|
|
715
|
+
operator1: n?.operator ?? t,
|
|
716
|
+
value1: n?.value === void 0 ? "" : String(n.value),
|
|
717
|
+
value1To: n?.valueTo === void 0 ? "" : String(n.valueTo),
|
|
718
|
+
useSecondCondition: !!r,
|
|
719
|
+
combinator: e?.combinator ?? "AND",
|
|
720
|
+
operator2: r?.operator ?? t,
|
|
721
|
+
value2: r?.value === void 0 ? "" : String(r.value),
|
|
722
|
+
value2To: r?.valueTo === void 0 ? "" : String(r.valueTo)
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
function q(e, t) {
|
|
726
|
+
if (e !== "") return t === "number" ? Number(e) : e;
|
|
727
|
+
}
|
|
728
|
+
function J(e, t, n) {
|
|
729
|
+
let r = (e) => t.find((t) => t.value === e) ?? t[0], i = r(e.operator1), a = {
|
|
730
|
+
operator: e.operator1,
|
|
731
|
+
value: q(e.value1, n),
|
|
732
|
+
valueTo: i.valueCount === 2 ? q(e.value1To, n) : void 0
|
|
733
|
+
};
|
|
734
|
+
if (i.valueCount > 0 && a.value === void 0) return null;
|
|
735
|
+
let o = [a];
|
|
736
|
+
if (e.useSecondCondition) {
|
|
737
|
+
let t = r(e.operator2), i = {
|
|
738
|
+
operator: e.operator2,
|
|
739
|
+
value: q(e.value2, n),
|
|
740
|
+
valueTo: t.valueCount === 2 ? q(e.value2To, n) : void 0
|
|
741
|
+
};
|
|
742
|
+
(t.valueCount === 0 || i.value !== void 0) && o.push(i);
|
|
743
|
+
}
|
|
744
|
+
return {
|
|
745
|
+
conditions: o,
|
|
746
|
+
combinator: e.combinator
|
|
747
|
+
};
|
|
748
|
+
}
|
|
749
|
+
function Y({ columnKey: e }) {
|
|
750
|
+
let { filters: t } = D(), n = t.activeColumnFilterType, i = oe[n], a = t.conditionFilters[e], [o, c] = s(() => Se(a, i[0].value));
|
|
751
|
+
r(() => {
|
|
752
|
+
c(Se(a, i[0].value));
|
|
753
|
+
}, [e]), r(() => {
|
|
754
|
+
let r = setTimeout(() => {
|
|
755
|
+
t.setConditionFilter(e, J(o, i, n));
|
|
756
|
+
}, 300);
|
|
757
|
+
return () => clearTimeout(r);
|
|
758
|
+
}, [
|
|
759
|
+
o,
|
|
760
|
+
e,
|
|
761
|
+
n
|
|
762
|
+
]);
|
|
763
|
+
let l = (e) => i.find((t) => t.value === e) ?? i[0], u = l(o.operator1), d = l(o.operator2), f = n === "number" ? "number" : n === "date" ? "date" : "text", p = () => {
|
|
764
|
+
c(Se(void 0, i[0].value)), t.clearConditionFilter(e);
|
|
765
|
+
}, m = (e, t, n, r, i) => e.valueCount === 0 ? null : /* @__PURE__ */ C("div", {
|
|
766
|
+
className: "flexi-condition-values",
|
|
767
|
+
children: [/* @__PURE__ */ S("input", {
|
|
768
|
+
type: f,
|
|
769
|
+
className: "flexi-input",
|
|
770
|
+
value: t,
|
|
771
|
+
placeholder: "Value",
|
|
772
|
+
onChange: (e) => r(e.target.value),
|
|
773
|
+
onClick: (e) => e.stopPropagation()
|
|
774
|
+
}), e.valueCount === 2 && /* @__PURE__ */ S("input", {
|
|
775
|
+
type: f,
|
|
776
|
+
className: "flexi-input",
|
|
777
|
+
value: n,
|
|
778
|
+
placeholder: "To",
|
|
779
|
+
onChange: (e) => i(e.target.value),
|
|
780
|
+
onClick: (e) => e.stopPropagation()
|
|
781
|
+
})]
|
|
782
|
+
});
|
|
783
|
+
return /* @__PURE__ */ C("div", {
|
|
784
|
+
className: "flexi-condition-filter",
|
|
785
|
+
children: [
|
|
786
|
+
/* @__PURE__ */ C("div", {
|
|
787
|
+
className: "flexi-condition-row",
|
|
788
|
+
children: [/* @__PURE__ */ S("select", {
|
|
789
|
+
className: "flexi-input",
|
|
790
|
+
value: o.operator1,
|
|
791
|
+
onClick: (e) => e.stopPropagation(),
|
|
792
|
+
onChange: (e) => c((t) => ({
|
|
793
|
+
...t,
|
|
794
|
+
operator1: e.target.value
|
|
795
|
+
})),
|
|
796
|
+
children: i.map((e) => /* @__PURE__ */ S("option", {
|
|
797
|
+
value: e.value,
|
|
798
|
+
children: e.label
|
|
799
|
+
}, e.value))
|
|
800
|
+
}), m(u, o.value1, o.value1To, (e) => c((t) => ({
|
|
801
|
+
...t,
|
|
802
|
+
value1: e
|
|
803
|
+
})), (e) => c((t) => ({
|
|
804
|
+
...t,
|
|
805
|
+
value1To: e
|
|
806
|
+
})))]
|
|
807
|
+
}),
|
|
808
|
+
/* @__PURE__ */ C("label", {
|
|
809
|
+
className: "flexi-filter-option flexi-condition-toggle",
|
|
810
|
+
children: [/* @__PURE__ */ S("input", {
|
|
811
|
+
type: "checkbox",
|
|
812
|
+
className: "flexi-checkbox",
|
|
813
|
+
checked: o.useSecondCondition,
|
|
814
|
+
onChange: (e) => c((t) => ({
|
|
815
|
+
...t,
|
|
816
|
+
useSecondCondition: e.target.checked
|
|
817
|
+
}))
|
|
818
|
+
}), /* @__PURE__ */ S("span", {
|
|
819
|
+
className: "flexi-filter-option-text",
|
|
820
|
+
children: "Add another condition"
|
|
821
|
+
})]
|
|
822
|
+
}),
|
|
823
|
+
o.useSecondCondition && /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ C("div", {
|
|
824
|
+
className: "flexi-condition-combinator",
|
|
825
|
+
children: [/* @__PURE__ */ C("label", { children: [/* @__PURE__ */ S("input", {
|
|
826
|
+
type: "radio",
|
|
827
|
+
name: `flexi-condition-combinator-${e}`,
|
|
828
|
+
checked: o.combinator === "AND",
|
|
829
|
+
onChange: () => c((e) => ({
|
|
830
|
+
...e,
|
|
831
|
+
combinator: "AND"
|
|
832
|
+
}))
|
|
833
|
+
}), /* @__PURE__ */ S("span", { children: "AND" })] }), /* @__PURE__ */ C("label", { children: [/* @__PURE__ */ S("input", {
|
|
834
|
+
type: "radio",
|
|
835
|
+
name: `flexi-condition-combinator-${e}`,
|
|
836
|
+
checked: o.combinator === "OR",
|
|
837
|
+
onChange: () => c((e) => ({
|
|
838
|
+
...e,
|
|
839
|
+
combinator: "OR"
|
|
840
|
+
}))
|
|
841
|
+
}), /* @__PURE__ */ S("span", { children: "OR" })] })]
|
|
842
|
+
}), /* @__PURE__ */ C("div", {
|
|
843
|
+
className: "flexi-condition-row",
|
|
844
|
+
children: [/* @__PURE__ */ S("select", {
|
|
845
|
+
className: "flexi-input",
|
|
846
|
+
value: o.operator2,
|
|
847
|
+
onClick: (e) => e.stopPropagation(),
|
|
848
|
+
onChange: (e) => c((t) => ({
|
|
849
|
+
...t,
|
|
850
|
+
operator2: e.target.value
|
|
851
|
+
})),
|
|
852
|
+
children: i.map((e) => /* @__PURE__ */ S("option", {
|
|
853
|
+
value: e.value,
|
|
854
|
+
children: e.label
|
|
855
|
+
}, e.value))
|
|
856
|
+
}), m(d, o.value2, o.value2To, (e) => c((t) => ({
|
|
857
|
+
...t,
|
|
858
|
+
value2: e
|
|
859
|
+
})), (e) => c((t) => ({
|
|
860
|
+
...t,
|
|
861
|
+
value2To: e
|
|
862
|
+
})))]
|
|
863
|
+
})] }),
|
|
864
|
+
/* @__PURE__ */ S("div", {
|
|
865
|
+
className: "flexi-filter-footer flexi-condition-footer",
|
|
866
|
+
children: /* @__PURE__ */ S("button", {
|
|
867
|
+
type: "button",
|
|
868
|
+
onClick: p,
|
|
869
|
+
className: "flexi-filter-clear",
|
|
870
|
+
children: "Clear"
|
|
871
|
+
})
|
|
872
|
+
})
|
|
873
|
+
]
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
//#endregion
|
|
539
877
|
//#region src/DataTable/components/FilterDropdown.tsx
|
|
540
|
-
function
|
|
541
|
-
let { gridRootRef: t, filters: n } =
|
|
878
|
+
function Ce({ columnKey: e }) {
|
|
879
|
+
let { gridRootRef: t, filters: n } = D(), r = t.current, { filterPosition: i } = n;
|
|
542
880
|
if (!r || !i) return null;
|
|
543
881
|
let a = n.selectedFilters[e], o = (a?.length || 0) > 0, s = n.filteredUniqueValues;
|
|
544
|
-
return
|
|
882
|
+
return w(/* @__PURE__ */ C("div", {
|
|
545
883
|
ref: n.dropdownRef,
|
|
546
884
|
className: "flexi-filter-dropdown",
|
|
547
885
|
style: {
|
|
@@ -549,10 +887,23 @@ function he({ columnKey: e }) {
|
|
|
549
887
|
left: i.left,
|
|
550
888
|
zIndex: 9999
|
|
551
889
|
},
|
|
552
|
-
children: [
|
|
553
|
-
|
|
890
|
+
children: [/* @__PURE__ */ C("div", {
|
|
891
|
+
className: "flexi-filter-tabs",
|
|
892
|
+
children: [/* @__PURE__ */ S("button", {
|
|
893
|
+
type: "button",
|
|
894
|
+
className: O("flexi-filter-tab", n.filterTab === "condition" && "flexi-filter-tab--active"),
|
|
895
|
+
onClick: () => n.setFilterTab("condition"),
|
|
896
|
+
children: "Filter"
|
|
897
|
+
}), /* @__PURE__ */ S("button", {
|
|
898
|
+
type: "button",
|
|
899
|
+
className: O("flexi-filter-tab", n.filterTab === "values" && "flexi-filter-tab--active"),
|
|
900
|
+
onClick: () => n.setFilterTab("values"),
|
|
901
|
+
children: "Select"
|
|
902
|
+
})]
|
|
903
|
+
}), n.filterTab === "condition" ? /* @__PURE__ */ S(Y, { columnKey: e }) : /* @__PURE__ */ C(x, { children: [
|
|
904
|
+
/* @__PURE__ */ S("div", {
|
|
554
905
|
className: "flexi-filter-search",
|
|
555
|
-
children: /* @__PURE__ */
|
|
906
|
+
children: /* @__PURE__ */ S("input", {
|
|
556
907
|
type: "text",
|
|
557
908
|
placeholder: "Search values...",
|
|
558
909
|
value: n.filterSearchQuery,
|
|
@@ -561,89 +912,89 @@ function he({ columnKey: e }) {
|
|
|
561
912
|
onClick: (e) => e.stopPropagation()
|
|
562
913
|
})
|
|
563
914
|
}),
|
|
564
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ S("div", {
|
|
565
916
|
className: "flexi-filter-list",
|
|
566
|
-
children: s.length === 0 ? /* @__PURE__ */
|
|
917
|
+
children: s.length === 0 ? /* @__PURE__ */ S("div", {
|
|
567
918
|
className: "flexi-filter-empty",
|
|
568
919
|
children: "No results found"
|
|
569
|
-
}) : s.map((t, r) => /* @__PURE__ */
|
|
920
|
+
}) : s.map((t, r) => /* @__PURE__ */ C("label", {
|
|
570
921
|
className: "flexi-filter-option",
|
|
571
|
-
children: [/* @__PURE__ */
|
|
922
|
+
children: [/* @__PURE__ */ S("input", {
|
|
572
923
|
type: "checkbox",
|
|
573
924
|
className: "flexi-checkbox",
|
|
574
925
|
checked: a?.includes(t) || !1,
|
|
575
926
|
onChange: () => n.handleFilterChange(e, t)
|
|
576
|
-
}), /* @__PURE__ */
|
|
927
|
+
}), /* @__PURE__ */ S("span", {
|
|
577
928
|
className: "flexi-filter-option-text",
|
|
578
929
|
children: String(t)
|
|
579
930
|
})]
|
|
580
931
|
}, r))
|
|
581
932
|
}),
|
|
582
|
-
o && /* @__PURE__ */
|
|
933
|
+
o && /* @__PURE__ */ S("div", {
|
|
583
934
|
className: "flexi-filter-footer",
|
|
584
|
-
children: /* @__PURE__ */
|
|
935
|
+
children: /* @__PURE__ */ S("button", {
|
|
585
936
|
type: "button",
|
|
586
937
|
onClick: () => n.clearFilter(e),
|
|
587
938
|
className: "flexi-filter-clear",
|
|
588
939
|
children: "Clear Filter"
|
|
589
940
|
})
|
|
590
941
|
})
|
|
591
|
-
]
|
|
942
|
+
] })]
|
|
592
943
|
}), r);
|
|
593
944
|
}
|
|
594
945
|
//#endregion
|
|
595
946
|
//#region src/DataTable/components/HeaderCell.tsx
|
|
596
|
-
function
|
|
597
|
-
let { groupBy: r, pinnedColumns: i, pinOffsets: a, displayPinnedIcon: o, togglePin: s, sortState: d, handleSort: f, filters: p, handleDragStart: m, handleDragEnd: h, handleDrop:
|
|
598
|
-
return /* @__PURE__ */
|
|
947
|
+
function X({ col: e, rowSpan: t, colSpan: n }) {
|
|
948
|
+
let { groupBy: r, pinnedColumns: i, pinOffsets: a, displayPinnedIcon: o, togglePin: s, sortState: d, handleSort: f, filters: p, handleDragStart: m, handleDragEnd: h, handleDrop: y, startResize: ee } = D(), b = i[e.key], x = !!b, w = (p.selectedFilters[e.key]?.length || 0) > 0 || !!p.conditionFilters[e.key], T = !e.children || e.children.length === 0, E = d.key === e.key, te = r && T, ne = T && e.resizable !== !1, re = !!e.sortable && T;
|
|
949
|
+
return /* @__PURE__ */ C("th", {
|
|
599
950
|
rowSpan: t,
|
|
600
951
|
colSpan: n,
|
|
601
952
|
draggable: !0,
|
|
602
953
|
onDragStart: (t) => m(t, e.key, T),
|
|
603
954
|
onDragEnd: h,
|
|
604
955
|
onDragOver: (e) => e.preventDefault(),
|
|
605
|
-
onDrop: (t) =>
|
|
606
|
-
className:
|
|
607
|
-
style:
|
|
608
|
-
children: [/* @__PURE__ */
|
|
956
|
+
onDrop: (t) => y(t, e.key),
|
|
957
|
+
className: O("flexi-th", "flexi-th--draggable", te && "flexi-th--group-draggable", x && "flexi-th--pinned", e.className, e.headerClassName),
|
|
958
|
+
style: ue(a, e.key, !0, e.headerStyle),
|
|
959
|
+
children: [/* @__PURE__ */ C("div", {
|
|
609
960
|
className: "flexi-th-inner",
|
|
610
961
|
children: [
|
|
611
|
-
/* @__PURE__ */
|
|
612
|
-
className:
|
|
613
|
-
onClick: () =>
|
|
614
|
-
children: [/* @__PURE__ */
|
|
962
|
+
/* @__PURE__ */ C("div", {
|
|
963
|
+
className: O("flexi-th-label", re && "flexi-th-label--sortable"),
|
|
964
|
+
onClick: () => re && f(e.key),
|
|
965
|
+
children: [/* @__PURE__ */ S("span", {
|
|
615
966
|
className: "flexi-th-text",
|
|
616
967
|
children: e.header
|
|
617
|
-
}),
|
|
618
|
-
className:
|
|
619
|
-
children:
|
|
968
|
+
}), re && /* @__PURE__ */ S("span", {
|
|
969
|
+
className: O("flexi-sort-icon", E && "flexi-sort-icon--active"),
|
|
970
|
+
children: E && d.direction === "asc" ? /* @__PURE__ */ S(l, { className: "flexi-icon-sm" }) : E && d.direction === "desc" ? /* @__PURE__ */ S(c, { className: "flexi-icon-sm" }) : /* @__PURE__ */ S(u, { className: "flexi-icon-sm" })
|
|
620
971
|
})]
|
|
621
972
|
}),
|
|
622
|
-
/* @__PURE__ */
|
|
973
|
+
/* @__PURE__ */ C("div", {
|
|
623
974
|
className: "flexi-th-actions",
|
|
624
|
-
children: [T && e.filterable && /* @__PURE__ */
|
|
975
|
+
children: [T && e.filterable && /* @__PURE__ */ S("button", {
|
|
625
976
|
type: "button",
|
|
626
977
|
ref: (t) => p.registerFilterButton(e.key, t),
|
|
627
978
|
onClick: (t) => {
|
|
628
979
|
t.stopPropagation(), p.toggleFilterDropdown(e.key);
|
|
629
980
|
},
|
|
630
|
-
className:
|
|
631
|
-
children: /* @__PURE__ */
|
|
632
|
-
}), T && (o ||
|
|
981
|
+
className: O("flexi-icon-btn", "flexi-filter-btn", w && "flexi-filter-btn--active"),
|
|
982
|
+
children: /* @__PURE__ */ S(g, { className: "flexi-icon-sm" })
|
|
983
|
+
}), T && (o || x || !!e.pinned) && /* @__PURE__ */ S("button", {
|
|
633
984
|
type: "button",
|
|
634
985
|
onClick: (t) => {
|
|
635
986
|
t.stopPropagation(), s(e.key);
|
|
636
987
|
},
|
|
637
|
-
className:
|
|
988
|
+
className: O("flexi-icon-btn", "flexi-pin-btn", x && "flexi-pin-btn--pinned"),
|
|
638
989
|
title: b === "left" ? "Pinned left (click to pin right)" : b === "right" ? "Pinned right (click to unpin)" : "Pin column left",
|
|
639
|
-
children: x
|
|
990
|
+
children: S(x ? v : _, { className: "flexi-icon-sm" })
|
|
640
991
|
})]
|
|
641
992
|
}),
|
|
642
|
-
T && p.activeFilterKey === e.key && /* @__PURE__ */
|
|
993
|
+
T && p.activeFilterKey === e.key && /* @__PURE__ */ S(Ce, { columnKey: e.key })
|
|
643
994
|
]
|
|
644
|
-
}), ne && /* @__PURE__ */
|
|
995
|
+
}), ne && /* @__PURE__ */ S("div", {
|
|
645
996
|
className: "flexi-th-resizer",
|
|
646
|
-
onMouseDown: (t) =>
|
|
997
|
+
onMouseDown: (t) => ee(t, e),
|
|
647
998
|
onClick: (e) => e.stopPropagation(),
|
|
648
999
|
onDragStart: (e) => e.preventDefault()
|
|
649
1000
|
})]
|
|
@@ -651,13 +1002,13 @@ function ge({ col: e, rowSpan: t, colSpan: n }) {
|
|
|
651
1002
|
}
|
|
652
1003
|
//#endregion
|
|
653
1004
|
//#region src/DataTable/components/TableHeader.tsx
|
|
654
|
-
function
|
|
655
|
-
let { headerRows: e, hasGroups: t } =
|
|
656
|
-
return /* @__PURE__ */
|
|
1005
|
+
function we() {
|
|
1006
|
+
let { headerRows: e, hasGroups: t } = D();
|
|
1007
|
+
return /* @__PURE__ */ S("thead", {
|
|
657
1008
|
className: "flexi-thead",
|
|
658
|
-
children: e.map((n, r) => /* @__PURE__ */
|
|
1009
|
+
children: e.map((n, r) => /* @__PURE__ */ C("tr", {
|
|
659
1010
|
className: "flexi-header-row",
|
|
660
|
-
children: [r === 0 && t && /* @__PURE__ */
|
|
1011
|
+
children: [r === 0 && t && /* @__PURE__ */ S("th", {
|
|
661
1012
|
rowSpan: e.length,
|
|
662
1013
|
className: "flexi-group-spacer-th",
|
|
663
1014
|
style: {
|
|
@@ -667,7 +1018,7 @@ function K() {
|
|
|
667
1018
|
zIndex: 35,
|
|
668
1019
|
backgroundColor: "rgb(248, 250, 252)"
|
|
669
1020
|
}
|
|
670
|
-
}), n.map(({ col: e, rowSpan: t, colSpan: n }) => /* @__PURE__ */
|
|
1021
|
+
}), n.map(({ col: e, rowSpan: t, colSpan: n }) => /* @__PURE__ */ S(X, {
|
|
671
1022
|
col: e,
|
|
672
1023
|
rowSpan: t,
|
|
673
1024
|
colSpan: n
|
|
@@ -677,14 +1028,14 @@ function K() {
|
|
|
677
1028
|
}
|
|
678
1029
|
//#endregion
|
|
679
1030
|
//#region src/DataTable/utils/grouping.ts
|
|
680
|
-
var
|
|
1031
|
+
var Te = (e, t, n, r = 0, i = "") => {
|
|
681
1032
|
if (r >= t.length) return e.map((e) => ({
|
|
682
1033
|
kind: "record",
|
|
683
1034
|
record: e
|
|
684
1035
|
}));
|
|
685
1036
|
let a = t[r], o = n.get(a), s = /* @__PURE__ */ new Map();
|
|
686
1037
|
return e.forEach((e) => {
|
|
687
|
-
let t = String(
|
|
1038
|
+
let t = String(z(e, a, o) ?? "N/A"), n = s.get(t);
|
|
688
1039
|
n ? n.push(e) : s.set(t, [e]);
|
|
689
1040
|
}), Array.from(s.entries()).sort(([e], [t]) => e.localeCompare(t, void 0, {
|
|
690
1041
|
numeric: !0,
|
|
@@ -697,18 +1048,18 @@ var _e = (e, t, n, r = 0, i = "") => {
|
|
|
697
1048
|
groupValue: e,
|
|
698
1049
|
path: s,
|
|
699
1050
|
depth: r,
|
|
700
|
-
children:
|
|
1051
|
+
children: Te(o, t, n, r + 1, s),
|
|
701
1052
|
totalItemsCount: o.length
|
|
702
1053
|
};
|
|
703
1054
|
});
|
|
704
|
-
},
|
|
1055
|
+
}, Ee = (e, t) => {
|
|
705
1056
|
let n = [], r = (e) => {
|
|
706
1057
|
e.forEach((e) => {
|
|
707
1058
|
n.push(e), e.kind === "group" && t[e.path] !== !1 && r(e.children);
|
|
708
1059
|
});
|
|
709
1060
|
};
|
|
710
1061
|
return r(e), n;
|
|
711
|
-
},
|
|
1062
|
+
}, De = (e, t, n, r) => {
|
|
712
1063
|
let i = /* @__PURE__ */ new Map();
|
|
713
1064
|
if (!t || t.length === 0) return i;
|
|
714
1065
|
let a = e.map(() => t.map(() => !0)), o = null;
|
|
@@ -723,7 +1074,7 @@ var _e = (e, t, n, r = 0, i = "") => {
|
|
|
723
1074
|
let e = !0;
|
|
724
1075
|
for (let o = 0; o < t.length; o++) {
|
|
725
1076
|
let c = t[o], l = n.get(c);
|
|
726
|
-
e &&
|
|
1077
|
+
e && z(i.record, c, l) === z(s.record, c, l) ? a[r][o] = !1 : (e = !1, a[r][o] = !0);
|
|
727
1078
|
}
|
|
728
1079
|
}
|
|
729
1080
|
o = r;
|
|
@@ -751,7 +1102,7 @@ var _e = (e, t, n, r = 0, i = "") => {
|
|
|
751
1102
|
};
|
|
752
1103
|
//#endregion
|
|
753
1104
|
//#region src/DataTable/hooks/useAnchoredPosition.ts
|
|
754
|
-
function
|
|
1105
|
+
function Z({ active: e, resetKey: t, rootRef: n, getAnchor: i, compute: a }) {
|
|
755
1106
|
let [c, l] = s(null), u = o(i), d = o(a);
|
|
756
1107
|
return u.current = i, d.current = a, r(() => {
|
|
757
1108
|
if (!e) {
|
|
@@ -773,7 +1124,7 @@ function q({ active: e, resetKey: t, rootRef: n, getAnchor: i, compute: a }) {
|
|
|
773
1124
|
}
|
|
774
1125
|
//#endregion
|
|
775
1126
|
//#region src/DataTable/hooks/useClickOutside.ts
|
|
776
|
-
function
|
|
1127
|
+
function Oe(e, t, n) {
|
|
777
1128
|
let i = o(t), a = o(n);
|
|
778
1129
|
i.current = t, a.current = n, r(() => {
|
|
779
1130
|
if (!e) return;
|
|
@@ -786,64 +1137,84 @@ function J(e, t, n) {
|
|
|
786
1137
|
}
|
|
787
1138
|
//#endregion
|
|
788
1139
|
//#region src/DataTable/hooks/useColumnFilters.ts
|
|
789
|
-
function
|
|
790
|
-
let [
|
|
791
|
-
t ?
|
|
792
|
-
}, []),
|
|
793
|
-
|
|
794
|
-
}, []),
|
|
795
|
-
|
|
1140
|
+
function ke({ data: e, columnsByKey: n, gridRootRef: r, onConditionFilterChange: i }) {
|
|
1141
|
+
let [c, l] = s(null), [u, d] = s("condition"), [f, p] = s({}), [m, h] = s({}), [g, _] = s(""), v = o(/* @__PURE__ */ new Map()), y = o(null), ee = t((e, t) => {
|
|
1142
|
+
t ? v.current.set(e, t) : v.current.delete(e);
|
|
1143
|
+
}, []), b = t(() => {
|
|
1144
|
+
l(null), _("");
|
|
1145
|
+
}, []), x = t((e) => {
|
|
1146
|
+
_(""), l((t) => t === e ? null : e);
|
|
796
1147
|
}, []);
|
|
797
|
-
|
|
798
|
-
let
|
|
799
|
-
active:
|
|
800
|
-
resetKey:
|
|
1148
|
+
Oe(c !== null, () => [y.current, c ? v.current.get(c) : null], b);
|
|
1149
|
+
let S = Z({
|
|
1150
|
+
active: c !== null,
|
|
1151
|
+
resetKey: c,
|
|
801
1152
|
rootRef: r,
|
|
802
|
-
getAnchor: () =>
|
|
1153
|
+
getAnchor: () => c ? v.current.get(c) : null,
|
|
803
1154
|
compute: (e, t) => ({
|
|
804
1155
|
top: e.bottom - t.top + 4,
|
|
805
1156
|
left: e.left - t.left
|
|
806
1157
|
})
|
|
807
|
-
}),
|
|
808
|
-
|
|
1158
|
+
}), C = t((e, t) => {
|
|
1159
|
+
p((n) => {
|
|
809
1160
|
let r = n[e] || [], i = r.includes(t) ? r.filter((e) => e !== t) : [...r, t], a = {
|
|
810
1161
|
...n,
|
|
811
1162
|
[e]: i
|
|
812
1163
|
};
|
|
813
1164
|
return i.length === 0 && delete a[e], a;
|
|
814
1165
|
});
|
|
815
|
-
}, []),
|
|
816
|
-
|
|
1166
|
+
}, []), w = t((e) => {
|
|
1167
|
+
p((t) => {
|
|
817
1168
|
let n = { ...t };
|
|
818
1169
|
return delete n[e], n;
|
|
819
1170
|
});
|
|
820
|
-
}, []),
|
|
1171
|
+
}, []), T = t((e, t) => {
|
|
1172
|
+
h((n) => {
|
|
1173
|
+
let r = { ...n };
|
|
1174
|
+
return !t || t.conditions.length === 0 ? delete r[e] : r[e] = t, i?.(r), r;
|
|
1175
|
+
});
|
|
1176
|
+
}, [i]), E = t((e) => {
|
|
1177
|
+
h((t) => {
|
|
1178
|
+
let n = { ...t };
|
|
1179
|
+
return delete n[e], i?.(n), n;
|
|
1180
|
+
});
|
|
1181
|
+
}, [i]), D = a(() => c ? V(e, c, n.get(c)) : [], [
|
|
1182
|
+
e,
|
|
1183
|
+
c,
|
|
1184
|
+
n
|
|
1185
|
+
]), O = a(() => c ? _e(e, c, n.get(c)) : "text", [
|
|
821
1186
|
e,
|
|
822
|
-
|
|
1187
|
+
c,
|
|
823
1188
|
n
|
|
824
1189
|
]);
|
|
825
1190
|
return {
|
|
826
|
-
activeFilterKey:
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
1191
|
+
activeFilterKey: c,
|
|
1192
|
+
filterTab: u,
|
|
1193
|
+
setFilterTab: d,
|
|
1194
|
+
selectedFilters: f,
|
|
1195
|
+
conditionFilters: m,
|
|
1196
|
+
filterSearchQuery: g,
|
|
1197
|
+
setFilterSearchQuery: _,
|
|
1198
|
+
filterPosition: S,
|
|
1199
|
+
dropdownRef: y,
|
|
832
1200
|
filteredUniqueValues: a(() => {
|
|
833
|
-
if (!
|
|
834
|
-
let e =
|
|
835
|
-
return
|
|
836
|
-
}, [
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
1201
|
+
if (!g.trim()) return D;
|
|
1202
|
+
let e = g.toLowerCase();
|
|
1203
|
+
return D.filter((t) => String(t).toLowerCase().includes(e));
|
|
1204
|
+
}, [D, g]),
|
|
1205
|
+
activeColumnFilterType: O,
|
|
1206
|
+
registerFilterButton: ee,
|
|
1207
|
+
toggleFilterDropdown: x,
|
|
1208
|
+
handleFilterChange: C,
|
|
1209
|
+
clearFilter: w,
|
|
1210
|
+
setConditionFilter: T,
|
|
1211
|
+
clearConditionFilter: E
|
|
841
1212
|
};
|
|
842
1213
|
}
|
|
843
1214
|
//#endregion
|
|
844
1215
|
//#region src/DataTable/hooks/useColumnReorder.ts
|
|
845
|
-
function
|
|
846
|
-
let [c, l] = s({}), u = o(null), d = a(() =>
|
|
1216
|
+
function Ae({ columns: e, pinnedColumns: n, isResizingRef: r, onColumnReorder: i }) {
|
|
1217
|
+
let [c, l] = s({}), u = o(null), d = a(() => N(e, n, c), [
|
|
847
1218
|
e,
|
|
848
1219
|
n,
|
|
849
1220
|
c
|
|
@@ -864,14 +1235,14 @@ function xe({ columns: e, pinnedColumns: n, isResizingRef: r, onColumnReorder: i
|
|
|
864
1235
|
t.preventDefault(), t.stopPropagation();
|
|
865
1236
|
let a = u.current;
|
|
866
1237
|
if (u.current = null, !a || a === r) return;
|
|
867
|
-
let o =
|
|
1238
|
+
let o = se(d, a, r);
|
|
868
1239
|
if (!o) return;
|
|
869
1240
|
let s = o.map((e) => e.key), f = s.indexOf(a), p = s.indexOf(r);
|
|
870
1241
|
s.splice(p, 0, s.splice(f, 1)[0]);
|
|
871
1242
|
let m = { ...c };
|
|
872
1243
|
s.forEach((e, t) => {
|
|
873
1244
|
m[e] = t;
|
|
874
|
-
}), l(m), i && i(A(
|
|
1245
|
+
}), l(m), i && i(A(N(e, n, m)).map((e) => e.key));
|
|
875
1246
|
}, [
|
|
876
1247
|
d,
|
|
877
1248
|
c,
|
|
@@ -883,7 +1254,7 @@ function xe({ columns: e, pinnedColumns: n, isResizingRef: r, onColumnReorder: i
|
|
|
883
1254
|
}
|
|
884
1255
|
//#endregion
|
|
885
1256
|
//#region src/DataTable/hooks/useColumnResize.ts
|
|
886
|
-
function
|
|
1257
|
+
function je(e) {
|
|
887
1258
|
let [n, i] = s({}), a = o(!1), c = o(null), l = o(e);
|
|
888
1259
|
return l.current = e, r(() => () => c.current?.(), []), {
|
|
889
1260
|
columnWidths: n,
|
|
@@ -911,7 +1282,7 @@ function Se(e) {
|
|
|
911
1282
|
}
|
|
912
1283
|
//#endregion
|
|
913
1284
|
//#region src/DataTable/hooks/useColumnVisibility.ts
|
|
914
|
-
function
|
|
1285
|
+
function Me({ defaultHiddenColumns: e, defaultDisplayPinnedIcon: n, onColumnVisibilityChange: r }) {
|
|
915
1286
|
let [i, a] = s(e), [o, c] = s(n);
|
|
916
1287
|
return {
|
|
917
1288
|
hiddenColumns: i,
|
|
@@ -932,7 +1303,7 @@ function Ce({ defaultHiddenColumns: e, defaultDisplayPinnedIcon: n, onColumnVisi
|
|
|
932
1303
|
}
|
|
933
1304
|
//#endregion
|
|
934
1305
|
//#region src/DataTable/hooks/usePagination.ts
|
|
935
|
-
function
|
|
1306
|
+
function Ne({ items: e, enabled: n, defaultPageSize: i, onPageChange: o, resetOn: c }) {
|
|
936
1307
|
let [l, u] = s(1), [d, f] = s(Math.max(1, Math.floor(i) || 1)), p = e.length, m = n ? Math.max(1, Math.ceil(p / d)) : 1;
|
|
937
1308
|
return r(() => {
|
|
938
1309
|
u(1);
|
|
@@ -972,8 +1343,8 @@ function we({ items: e, enabled: n, defaultPageSize: i, onPageChange: o, resetOn
|
|
|
972
1343
|
}
|
|
973
1344
|
//#endregion
|
|
974
1345
|
//#region src/DataTable/hooks/usePinnedColumns.ts
|
|
975
|
-
function
|
|
976
|
-
let [r, i] = s(() =>
|
|
1346
|
+
function Pe(e, n) {
|
|
1347
|
+
let [r, i] = s(() => M(e));
|
|
977
1348
|
return {
|
|
978
1349
|
pinnedColumns: r,
|
|
979
1350
|
togglePin: t((e) => {
|
|
@@ -984,7 +1355,7 @@ function Te(e, n) {
|
|
|
984
1355
|
}
|
|
985
1356
|
//#endregion
|
|
986
1357
|
//#region src/DataTable/hooks/useRowGrouping.ts
|
|
987
|
-
function
|
|
1358
|
+
function Fe(e, n) {
|
|
988
1359
|
let [r, i] = s(e), [a, o] = s({});
|
|
989
1360
|
return {
|
|
990
1361
|
groupedColumns: r,
|
|
@@ -1008,11 +1379,11 @@ function Ee(e, n) {
|
|
|
1008
1379
|
}
|
|
1009
1380
|
//#endregion
|
|
1010
1381
|
//#region src/DataTable/hooks/useSettingsMenu.ts
|
|
1011
|
-
function
|
|
1382
|
+
function Ie(e) {
|
|
1012
1383
|
let [n, r] = s(!1), i = o(null), a = o(null), c = t(() => r((e) => !e), []);
|
|
1013
|
-
return
|
|
1384
|
+
return Oe(n, () => [i.current, a.current], t(() => r(!1), [])), {
|
|
1014
1385
|
isOpen: n,
|
|
1015
|
-
position:
|
|
1386
|
+
position: Z({
|
|
1016
1387
|
active: n,
|
|
1017
1388
|
rootRef: e,
|
|
1018
1389
|
getAnchor: () => a.current,
|
|
@@ -1028,7 +1399,7 @@ function De(e) {
|
|
|
1028
1399
|
}
|
|
1029
1400
|
//#endregion
|
|
1030
1401
|
//#region src/DataTable/hooks/useSorting.ts
|
|
1031
|
-
function
|
|
1402
|
+
function Le() {
|
|
1032
1403
|
let [e, n] = s({
|
|
1033
1404
|
key: null,
|
|
1034
1405
|
direction: null
|
|
@@ -1048,7 +1419,7 @@ function Oe() {
|
|
|
1048
1419
|
}
|
|
1049
1420
|
//#endregion
|
|
1050
1421
|
//#region src/DataTable/hooks/useVirtualRows.ts
|
|
1051
|
-
function
|
|
1422
|
+
function Re({ containerRef: e, totalRowCount: t, rowHeight: n, overscan: i }) {
|
|
1052
1423
|
let [o, c] = s(0), [l, u] = s(0);
|
|
1053
1424
|
return r(() => {
|
|
1054
1425
|
let t = e.current;
|
|
@@ -1083,149 +1454,155 @@ function ke({ containerRef: e, totalRowCount: t, rowHeight: n, overscan: i }) {
|
|
|
1083
1454
|
}
|
|
1084
1455
|
//#endregion
|
|
1085
1456
|
//#region src/DataTable/hooks/useDataTableState.ts
|
|
1086
|
-
function
|
|
1087
|
-
let
|
|
1457
|
+
function Q({ columns: e, data: n, rowKey: i, actions: c, isLoading: l, groupBy: u = !1, defaultGroupBy: d = ie, onPinChange: f, onGroupChange: p, pinnedBottomRowData: m = ae, pinnedRowClassName: h, rowHeight: g = 40, overscan: _ = 8, onColumnResize: v, onColumnReorder: y, rowClassRules: ee, onRowClick: b, rowSpanColumns: x, controlPanel: S = !1, defaultDisplayPinnedIcon: C = !1, defaultHiddenColumns: w = ie, onColumnVisibilityChange: T, pagination: E = !1, defaultPageSize: D = 10, pageSizeOptions: O = re, onPageChange: te, onConditionFilterChange: ne }) {
|
|
1458
|
+
let k = o(null), oe = o(null), j = a(() => A(e), [e]), M = a(() => {
|
|
1088
1459
|
let e = /* @__PURE__ */ new Map();
|
|
1089
|
-
return
|
|
1090
|
-
}, [
|
|
1460
|
+
return j.forEach((t) => e.set(t.key, t)), e;
|
|
1461
|
+
}, [j]), { pinnedColumns: N, togglePin: se } = Pe(j, f), { columnWidths: P, isResizingRef: ue, startResize: de } = je(v), { reorderedColumns: F, handleDragStart: fe, handleDragEnd: pe, handleDrop: me } = Ae({
|
|
1091
1462
|
columns: e,
|
|
1092
|
-
pinnedColumns:
|
|
1093
|
-
isResizingRef:
|
|
1094
|
-
onColumnReorder:
|
|
1095
|
-
}),
|
|
1463
|
+
pinnedColumns: N,
|
|
1464
|
+
isResizingRef: ue,
|
|
1465
|
+
onColumnReorder: y
|
|
1466
|
+
}), I = Me({
|
|
1096
1467
|
defaultHiddenColumns: w,
|
|
1097
1468
|
defaultDisplayPinnedIcon: C,
|
|
1098
1469
|
onColumnVisibilityChange: T
|
|
1099
|
-
}), { hiddenColumns:
|
|
1100
|
-
r(() =>
|
|
1101
|
-
let
|
|
1102
|
-
|
|
1103
|
-
}, [
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
]),
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
]),
|
|
1112
|
-
visibleLeafColumns:
|
|
1113
|
-
pinnedColumns:
|
|
1114
|
-
columnWidths:
|
|
1115
|
-
hasGroups:
|
|
1116
|
-
hasActions:
|
|
1470
|
+
}), { hiddenColumns: L } = I, R = Fe(d, p), { groupedColumns: z, expandedGroups: B } = R, [he, V] = s(u);
|
|
1471
|
+
r(() => V(u), [u]);
|
|
1472
|
+
let _e = t(() => V((e) => !e), []), { resetControlPanelDefaults: H } = I, ve = t(() => {
|
|
1473
|
+
H(), V(u);
|
|
1474
|
+
}, [H, u]), ye = he, U = ye ? z : ie, W = U.length > 0, G = !!c, K = a(() => A(F).filter((e) => !U.includes(e.key) && !L.includes(e.key)), [
|
|
1475
|
+
F,
|
|
1476
|
+
U,
|
|
1477
|
+
L
|
|
1478
|
+
]), Se = a(() => ce(F, U, L), [
|
|
1479
|
+
F,
|
|
1480
|
+
U,
|
|
1481
|
+
L
|
|
1482
|
+
]), q = a(() => le({
|
|
1483
|
+
visibleLeafColumns: K,
|
|
1484
|
+
pinnedColumns: N,
|
|
1485
|
+
columnWidths: P,
|
|
1486
|
+
hasGroups: W,
|
|
1487
|
+
hasActions: G
|
|
1117
1488
|
}), [
|
|
1118
|
-
|
|
1489
|
+
K,
|
|
1490
|
+
N,
|
|
1119
1491
|
P,
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
]), X = be({
|
|
1492
|
+
W,
|
|
1493
|
+
G
|
|
1494
|
+
]), J = ke({
|
|
1124
1495
|
data: n,
|
|
1125
|
-
columnsByKey:
|
|
1126
|
-
gridRootRef:
|
|
1127
|
-
|
|
1496
|
+
columnsByKey: M,
|
|
1497
|
+
gridRootRef: k,
|
|
1498
|
+
onConditionFilterChange: ne
|
|
1499
|
+
}), { sortState: Y, handleSort: Ce } = Le(), X = Ne({
|
|
1128
1500
|
items: a(() => {
|
|
1129
|
-
let e =
|
|
1130
|
-
return !
|
|
1501
|
+
let e = ge(n, J.selectedFilters, M);
|
|
1502
|
+
return e = be(e, J.conditionFilters, M), !Y.key || !Y.direction ? e : xe(e, Y.key, Y.direction, M.get(Y.key));
|
|
1131
1503
|
}, [
|
|
1132
1504
|
n,
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1505
|
+
J.selectedFilters,
|
|
1506
|
+
J.conditionFilters,
|
|
1507
|
+
Y,
|
|
1508
|
+
M
|
|
1136
1509
|
]),
|
|
1137
1510
|
enabled: E,
|
|
1138
1511
|
defaultPageSize: D,
|
|
1139
1512
|
onPageChange: te,
|
|
1140
|
-
resetOn: [
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1513
|
+
resetOn: [
|
|
1514
|
+
J.selectedFilters,
|
|
1515
|
+
J.conditionFilters,
|
|
1516
|
+
Y
|
|
1517
|
+
]
|
|
1518
|
+
}), we = a(() => Te(X.pagedItems, U, M), [
|
|
1519
|
+
X.pagedItems,
|
|
1520
|
+
U,
|
|
1521
|
+
M
|
|
1522
|
+
]), Z = a(() => Ee(we, B), [we, B]), Oe = Z.length, { startIndex: Q, endIndex: ze, topSpacerHeight: Be, bottomSpacerHeight: Ve } = Re({
|
|
1523
|
+
containerRef: oe,
|
|
1524
|
+
totalRowCount: Oe,
|
|
1148
1525
|
rowHeight: g,
|
|
1149
|
-
overscan:
|
|
1150
|
-
}),
|
|
1151
|
-
|
|
1526
|
+
overscan: _
|
|
1527
|
+
}), $ = a(() => Z.slice(Q, ze), [
|
|
1528
|
+
Z,
|
|
1529
|
+
Q,
|
|
1530
|
+
ze
|
|
1531
|
+
]), He = a(() => De($, x, M, Q), [
|
|
1152
1532
|
$,
|
|
1153
|
-
Ie
|
|
1154
|
-
]), Be = a(() => ye(ze, x, N, $), [
|
|
1155
|
-
ze,
|
|
1156
1533
|
x,
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
]),
|
|
1534
|
+
M,
|
|
1535
|
+
Q
|
|
1536
|
+
]), Ue = Ie(k), We = K.length + +!!G + +!!W;
|
|
1160
1537
|
return {
|
|
1161
|
-
gridRootRef:
|
|
1162
|
-
tableWrapRef:
|
|
1538
|
+
gridRootRef: k,
|
|
1539
|
+
tableWrapRef: oe,
|
|
1163
1540
|
rowKey: i,
|
|
1164
1541
|
actions: c,
|
|
1165
1542
|
isLoading: !!l,
|
|
1166
|
-
groupBy:
|
|
1167
|
-
showGroupBy:
|
|
1168
|
-
toggleShowGroupBy:
|
|
1543
|
+
groupBy: ye,
|
|
1544
|
+
showGroupBy: he,
|
|
1545
|
+
toggleShowGroupBy: _e,
|
|
1169
1546
|
controlPanel: S,
|
|
1170
1547
|
rowHeight: g,
|
|
1171
1548
|
rowSpanColumns: x,
|
|
1172
|
-
rowClassRules:
|
|
1549
|
+
rowClassRules: ee,
|
|
1173
1550
|
onRowClick: b,
|
|
1174
1551
|
pinnedBottomRowData: m,
|
|
1175
1552
|
pinnedRowClassName: h,
|
|
1176
1553
|
pageSizeOptions: O,
|
|
1177
1554
|
paginationEnabled: E,
|
|
1178
|
-
initialLeafColumns:
|
|
1179
|
-
columnsByKey:
|
|
1180
|
-
visibleLeafColumns:
|
|
1181
|
-
headerRows:
|
|
1182
|
-
pinnedColumns:
|
|
1183
|
-
pinOffsets:
|
|
1184
|
-
columnWidths:
|
|
1185
|
-
togglePin:
|
|
1186
|
-
startResize:
|
|
1187
|
-
handleDragStart:
|
|
1188
|
-
handleDragEnd:
|
|
1189
|
-
handleDrop:
|
|
1190
|
-
hiddenColumns:
|
|
1191
|
-
displayPinnedIcon:
|
|
1192
|
-
toggleColumnVisibility:
|
|
1193
|
-
toggleDisplayPinnedIcon:
|
|
1194
|
-
resetControlPanelDefaults:
|
|
1195
|
-
settingsMenu:
|
|
1196
|
-
groupedColumns:
|
|
1197
|
-
expandedGroups:
|
|
1198
|
-
addGroup:
|
|
1199
|
-
removeGroup:
|
|
1200
|
-
toggleGroupExpansion:
|
|
1201
|
-
hasGroups:
|
|
1202
|
-
hasActions:
|
|
1203
|
-
sortState:
|
|
1204
|
-
handleSort:
|
|
1205
|
-
filters:
|
|
1206
|
-
currentPage:
|
|
1207
|
-
pageSize:
|
|
1208
|
-
totalPages:
|
|
1209
|
-
totalCount:
|
|
1210
|
-
goToPage:
|
|
1211
|
-
changePageSize:
|
|
1212
|
-
visibleRows:
|
|
1213
|
-
startIndex:
|
|
1214
|
-
totalRowCount:
|
|
1215
|
-
topSpacerHeight:
|
|
1216
|
-
bottomSpacerHeight:
|
|
1217
|
-
rowSpanInfo:
|
|
1218
|
-
totalColumnsCount:
|
|
1555
|
+
initialLeafColumns: j,
|
|
1556
|
+
columnsByKey: M,
|
|
1557
|
+
visibleLeafColumns: K,
|
|
1558
|
+
headerRows: Se,
|
|
1559
|
+
pinnedColumns: N,
|
|
1560
|
+
pinOffsets: q,
|
|
1561
|
+
columnWidths: P,
|
|
1562
|
+
togglePin: se,
|
|
1563
|
+
startResize: de,
|
|
1564
|
+
handleDragStart: fe,
|
|
1565
|
+
handleDragEnd: pe,
|
|
1566
|
+
handleDrop: me,
|
|
1567
|
+
hiddenColumns: L,
|
|
1568
|
+
displayPinnedIcon: I.displayPinnedIcon,
|
|
1569
|
+
toggleColumnVisibility: I.toggleColumnVisibility,
|
|
1570
|
+
toggleDisplayPinnedIcon: I.toggleDisplayPinnedIcon,
|
|
1571
|
+
resetControlPanelDefaults: ve,
|
|
1572
|
+
settingsMenu: Ue,
|
|
1573
|
+
groupedColumns: z,
|
|
1574
|
+
expandedGroups: B,
|
|
1575
|
+
addGroup: R.addGroup,
|
|
1576
|
+
removeGroup: R.removeGroup,
|
|
1577
|
+
toggleGroupExpansion: R.toggleGroupExpansion,
|
|
1578
|
+
hasGroups: W,
|
|
1579
|
+
hasActions: G,
|
|
1580
|
+
sortState: Y,
|
|
1581
|
+
handleSort: Ce,
|
|
1582
|
+
filters: J,
|
|
1583
|
+
currentPage: X.currentPage,
|
|
1584
|
+
pageSize: X.pageSize,
|
|
1585
|
+
totalPages: X.totalPages,
|
|
1586
|
+
totalCount: X.totalCount,
|
|
1587
|
+
goToPage: X.goToPage,
|
|
1588
|
+
changePageSize: X.changePageSize,
|
|
1589
|
+
visibleRows: $,
|
|
1590
|
+
startIndex: Q,
|
|
1591
|
+
totalRowCount: Oe,
|
|
1592
|
+
topSpacerHeight: Be,
|
|
1593
|
+
bottomSpacerHeight: Ve,
|
|
1594
|
+
rowSpanInfo: He,
|
|
1595
|
+
totalColumnsCount: We
|
|
1219
1596
|
};
|
|
1220
1597
|
}
|
|
1221
1598
|
//#endregion
|
|
1222
1599
|
//#region src/DataTable/DataTable.tsx
|
|
1223
|
-
var
|
|
1600
|
+
var ze = [
|
|
1224
1601
|
"height",
|
|
1225
1602
|
"maxHeight",
|
|
1226
1603
|
"minHeight"
|
|
1227
1604
|
];
|
|
1228
|
-
function
|
|
1605
|
+
function Be(e, t) {
|
|
1229
1606
|
let [n, r] = s(0);
|
|
1230
1607
|
return i(() => {
|
|
1231
1608
|
let n = t ? e.current?.firstElementChild : null;
|
|
@@ -1242,50 +1619,50 @@ function je(e, t) {
|
|
|
1242
1619
|
return a.observe(n), () => a.disconnect();
|
|
1243
1620
|
}, [e, t]), n;
|
|
1244
1621
|
}
|
|
1245
|
-
function
|
|
1622
|
+
function Ve(e, t) {
|
|
1246
1623
|
if (!e || t <= 0) return e;
|
|
1247
1624
|
let n = { ...e };
|
|
1248
|
-
for (let r of
|
|
1625
|
+
for (let r of ze) {
|
|
1249
1626
|
let i = e[r];
|
|
1250
1627
|
i == null || i === "" || i === "auto" || i === "none" || (n[r] = `calc(${typeof i == "number" ? `${i}px` : String(i)} - ${t}px)`);
|
|
1251
1628
|
}
|
|
1252
1629
|
return n;
|
|
1253
1630
|
}
|
|
1254
|
-
function
|
|
1255
|
-
let t =
|
|
1256
|
-
return /* @__PURE__ */
|
|
1631
|
+
function $(e) {
|
|
1632
|
+
let t = Q(e), { containerStyle: n, tableStyle: r, bordered: i = !1 } = e, a = Ve(n, Be(t.gridRootRef, !!t.groupBy));
|
|
1633
|
+
return /* @__PURE__ */ S(E, {
|
|
1257
1634
|
value: t,
|
|
1258
|
-
children: /* @__PURE__ */
|
|
1635
|
+
children: /* @__PURE__ */ C("div", {
|
|
1259
1636
|
ref: t.gridRootRef,
|
|
1260
1637
|
className: "flexi-root",
|
|
1261
1638
|
children: [
|
|
1262
|
-
t.groupBy && /* @__PURE__ */
|
|
1263
|
-
/* @__PURE__ */
|
|
1639
|
+
t.groupBy && /* @__PURE__ */ S(te, {}),
|
|
1640
|
+
/* @__PURE__ */ C("div", {
|
|
1264
1641
|
ref: t.tableWrapRef,
|
|
1265
1642
|
className: "flexi-table-wrap",
|
|
1266
1643
|
style: a,
|
|
1267
|
-
children: [t.controlPanel && /* @__PURE__ */
|
|
1644
|
+
children: [t.controlPanel && /* @__PURE__ */ S("div", {
|
|
1268
1645
|
className: "flexi-settings-corner",
|
|
1269
|
-
children: /* @__PURE__ */
|
|
1646
|
+
children: /* @__PURE__ */ S("div", {
|
|
1270
1647
|
className: "flexi-settings-corner-inner",
|
|
1271
|
-
children: /* @__PURE__ */
|
|
1648
|
+
children: /* @__PURE__ */ S(L, {})
|
|
1272
1649
|
})
|
|
1273
|
-
}), /* @__PURE__ */
|
|
1274
|
-
className:
|
|
1650
|
+
}), /* @__PURE__ */ C("table", {
|
|
1651
|
+
className: O("flexi-table", i && "flexi-table--bordered"),
|
|
1275
1652
|
style: r,
|
|
1276
1653
|
children: [
|
|
1277
|
-
/* @__PURE__ */
|
|
1278
|
-
/* @__PURE__ */
|
|
1279
|
-
/* @__PURE__ */
|
|
1280
|
-
/* @__PURE__ */
|
|
1654
|
+
/* @__PURE__ */ S(K, {}),
|
|
1655
|
+
/* @__PURE__ */ S(we, {}),
|
|
1656
|
+
/* @__PURE__ */ S(G, {}),
|
|
1657
|
+
/* @__PURE__ */ S(I, {})
|
|
1281
1658
|
]
|
|
1282
1659
|
})]
|
|
1283
1660
|
}),
|
|
1284
|
-
/* @__PURE__ */
|
|
1285
|
-
t.paginationEnabled && /* @__PURE__ */
|
|
1661
|
+
/* @__PURE__ */ S(R, {}),
|
|
1662
|
+
t.paginationEnabled && /* @__PURE__ */ S(ne, {})
|
|
1286
1663
|
]
|
|
1287
1664
|
})
|
|
1288
1665
|
});
|
|
1289
1666
|
}
|
|
1290
1667
|
//#endregion
|
|
1291
|
-
export {
|
|
1668
|
+
export { $ as DataTable };
|