@box-kite/react 2.2.18 → 2.3.1
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/.claude/rules/box-kite-rules.md +6 -2
- package/.claude/skills/box-kite/SKILL.md +19 -15
- package/.claude/skills/box-kite/references/patterns.md +1 -1
- package/.claude/skills/box-kite/references/styling.md +3 -3
- package/.cursor/rules/box-kite.mdc +7 -3
- package/AGENTS.md +7 -3
- package/BOX_AI_CONTEXT.md +81 -41
- package/BOX_KITE_AI_CONTEXT.md +81 -41
- package/README.md +13 -7
- package/behavior.cjs +1 -1
- package/behavior.mjs +1 -1
- package/box.cjs +1 -1
- package/box.d.ts +1 -0
- package/box.mjs +1 -1
- package/catalog.cjs +1 -1
- package/catalog.mjs +4 -1
- package/client.cjs +1 -1
- package/client.mjs +14 -14
- package/components/calendar.cjs +1 -1
- package/components/calendar.mjs +21 -20
- package/components/dashboard.cjs +1 -1
- package/components/dashboard.mjs +12 -12
- package/components/dataGrid/components/dataGridFooter.d.ts +6 -2
- package/components/dataGrid/models/gridModel.d.ts +21 -2
- package/components/dataGrid/models/groupRowModel.d.ts +1 -1
- package/components/dataGrid/models/rowModel.d.ts +1 -1
- package/components/dataGrid/models/sourceGroupRowModel.d.ts +5 -1
- package/components/dataGrid/models/sourceRowModel.d.ts +5 -1
- package/components/dataGrid.cjs +3 -3
- package/components/dataGrid.mjs +821 -771
- package/components/dateField.cjs +1 -1
- package/components/dateField.mjs +6 -6
- package/components/datePicker.cjs +1 -1
- package/components/datePicker.mjs +116 -111
- package/components/dialog.cjs +1 -1
- package/components/dialog.d.ts +1 -1
- package/components/dialog.mjs +1 -1
- package/components/dropdown.cjs +1 -1
- package/components/dropdown.mjs +8 -3
- package/components/menu.cjs +1 -1
- package/components/menu.mjs +10 -10
- package/components/overlay.cjs +1 -1
- package/components/overlay.mjs +6 -6
- package/components/popover.cjs +1 -1
- package/components/popover.d.ts +8 -2
- package/components/popover.mjs +58 -55
- package/components/slider.cjs +1 -1
- package/components/slider.mjs +8 -8
- package/components/sortableList.cjs +1 -1
- package/components/sortableList.mjs +1 -1
- package/components/svg.d.ts +2 -2
- package/components/swipeItem.cjs +1 -1
- package/components/swipeItem.mjs +11 -11
- package/components/tabs.cjs +1 -1
- package/components/tabs.mjs +9 -9
- package/dataGridList.cjs +1 -1
- package/dataGridList.mjs +3 -5
- package/docs/props.md +49 -25
- package/interactionListening.cjs +1 -1
- package/interactionListening.mjs +3 -3
- package/layer.cjs +1 -1
- package/layer.mjs +1 -1
- package/package.json +5 -5
- package/placement.cjs +1 -1
- package/placement.mjs +1 -1
- package/platform.cjs +1 -1
- package/platform.mjs +16 -11
- package/react-shared.cjs +1 -1
- package/react-shared.mjs +1 -1
- package/rsc.cjs +1 -1
- package/rsc.d.ts +1 -0
- package/rsc.mjs +1 -1
- package/utils/dom/domUtils.d.ts +2 -0
package/components/dataGrid.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { _ as e, f as t, o as n } from "../platform.mjs";
|
|
3
3
|
import { n as r } from "../effects.mjs";
|
|
4
4
|
import { t as i } from "../interactions.mjs";
|
|
5
5
|
import a from "../box.mjs";
|
|
@@ -18,22 +18,23 @@ import { n as S } from "../scrolling.mjs";
|
|
|
18
18
|
import C from "./grid.mjs";
|
|
19
19
|
import w from "./dropdown.mjs";
|
|
20
20
|
import { Span as T } from "./semantics.mjs";
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import { Fragment as
|
|
25
|
-
import {
|
|
21
|
+
import ee from "./popover.mjs";
|
|
22
|
+
import te from "./switch.mjs";
|
|
23
|
+
import E, { Fragment as ne, createContext as D, forwardRef as O, memo as k, useCallback as A, useContext as j, useEffect as M, useImperativeHandle as re, useLayoutEffect as ie, useMemo as ae, useRef as N, useState as P, useSyncExternalStore as oe } from "react";
|
|
24
|
+
import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
25
|
+
import { flushSync as se } from "react-dom";
|
|
26
|
+
import { useSyncExternalStore as ce } from "use-sync-external-store/shim";
|
|
26
27
|
//#region src/components/dataGrid/components/dataGridBottomBarSelection.tsx
|
|
27
|
-
function
|
|
28
|
+
function le(e) {
|
|
28
29
|
let { grid: t } = e, n = t.selectedRows.size, r = t.isSelectionView;
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ L(_, {
|
|
30
31
|
component: `${t.componentName}.bottomBar.selection`,
|
|
31
32
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
+
/* @__PURE__ */ I(a, {
|
|
33
34
|
component: `${t.componentName}.bottomBar.info`,
|
|
34
35
|
children: t.localeText.selectedCount(n, t.hiddenSelectedCount)
|
|
35
36
|
}),
|
|
36
|
-
t.canShowSelection && (n > 0 || r) && /* @__PURE__ */
|
|
37
|
+
t.canShowSelection && (n > 0 || r) && /* @__PURE__ */ I(h, {
|
|
37
38
|
type: "button",
|
|
38
39
|
component: `${t.componentName}.bottomBar.action`,
|
|
39
40
|
variant: { pressed: r },
|
|
@@ -41,11 +42,11 @@ function se(e) {
|
|
|
41
42
|
onClick: t.toggleSelectionView,
|
|
42
43
|
children: t.localeText.showSelected
|
|
43
44
|
}),
|
|
44
|
-
n > 0 && /* @__PURE__ */
|
|
45
|
+
n > 0 && /* @__PURE__ */ L(h, {
|
|
45
46
|
type: "button",
|
|
46
47
|
component: `${t.componentName}.bottomBar.action`,
|
|
47
48
|
onClick: t.clearSelection,
|
|
48
|
-
children: [/* @__PURE__ */
|
|
49
|
+
children: [/* @__PURE__ */ I(a, {
|
|
49
50
|
tag: "span",
|
|
50
51
|
props: { "aria-hidden": !0 },
|
|
51
52
|
children: "✕"
|
|
@@ -56,74 +57,74 @@ function se(e) {
|
|
|
56
57
|
}
|
|
57
58
|
//#endregion
|
|
58
59
|
//#region src/components/dataGrid/components/dataGridPagination.tsx
|
|
59
|
-
function
|
|
60
|
-
let { grid: t } = e, { pagination: n } = t, r = n.state, i =
|
|
60
|
+
function ue(e) {
|
|
61
|
+
let { grid: t } = e, { pagination: n } = t, r = n.state, i = A(() => n.firstPage(), [n]), o = A(() => n.prevPage(), [n]), s = A(() => n.nextPage(), [n]), c = A(() => n.lastPage(), [n]);
|
|
61
62
|
if (!r) return null;
|
|
62
63
|
let { canGoPrev: l, canGoNext: u, totalPages: d } = n;
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ L(_, {
|
|
64
65
|
component: `${t.componentName}.bottomBar.pagination`,
|
|
65
66
|
gap: .5,
|
|
66
67
|
ai: "center",
|
|
67
68
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ I(de, {
|
|
69
70
|
grid: t,
|
|
70
71
|
pageSize: r.pageSize
|
|
71
72
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ I(pe, {
|
|
73
74
|
componentName: t.componentName,
|
|
74
75
|
label: t.localeText.firstPage,
|
|
75
76
|
onClick: i,
|
|
76
77
|
disabled: !l,
|
|
77
|
-
children: /* @__PURE__ */
|
|
78
|
+
children: /* @__PURE__ */ I(_e, {})
|
|
78
79
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ I(pe, {
|
|
80
81
|
componentName: t.componentName,
|
|
81
82
|
label: t.localeText.previousPage,
|
|
82
83
|
onClick: o,
|
|
83
84
|
disabled: !l,
|
|
84
|
-
children: /* @__PURE__ */
|
|
85
|
+
children: /* @__PURE__ */ I(he, {})
|
|
85
86
|
}),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ L(_, {
|
|
87
88
|
ai: "center",
|
|
88
89
|
gap: 1.5,
|
|
89
90
|
px: 2,
|
|
90
91
|
userSelect: "none",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
92
|
+
children: [/* @__PURE__ */ I(fe, {
|
|
92
93
|
grid: t,
|
|
93
94
|
page: r.page,
|
|
94
95
|
totalPages: d
|
|
95
|
-
}), /* @__PURE__ */
|
|
96
|
+
}), /* @__PURE__ */ I(a, {
|
|
96
97
|
component: `${t.componentName}.bottomBar.pagination.info`,
|
|
97
98
|
fontSize: 12,
|
|
98
99
|
opacity: .7,
|
|
99
100
|
children: t.localeText.pageCount(d)
|
|
100
101
|
})]
|
|
101
102
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
+
/* @__PURE__ */ I(pe, {
|
|
103
104
|
componentName: t.componentName,
|
|
104
105
|
label: t.localeText.nextPage,
|
|
105
106
|
onClick: s,
|
|
106
107
|
disabled: !u,
|
|
107
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ I(ge, {})
|
|
108
109
|
}),
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ I(pe, {
|
|
110
111
|
componentName: t.componentName,
|
|
111
112
|
label: t.localeText.lastPage,
|
|
112
113
|
onClick: c,
|
|
113
114
|
disabled: !u,
|
|
114
|
-
children: /* @__PURE__ */
|
|
115
|
+
children: /* @__PURE__ */ I(ve, {})
|
|
115
116
|
})
|
|
116
117
|
]
|
|
117
118
|
});
|
|
118
119
|
}
|
|
119
|
-
|
|
120
|
-
function
|
|
120
|
+
ue.displayName = "DataGridPagination";
|
|
121
|
+
function de({ grid: e, pageSize: t }) {
|
|
121
122
|
let n = e.pagination.pageSizeOptions;
|
|
122
|
-
return !n || n.length === 0 ? null : /* @__PURE__ */
|
|
123
|
+
return !n || n.length === 0 ? null : /* @__PURE__ */ I(_, {
|
|
123
124
|
ai: "center",
|
|
124
125
|
gap: 1,
|
|
125
126
|
me: 1,
|
|
126
|
-
children: /* @__PURE__ */
|
|
127
|
+
children: /* @__PURE__ */ I(a, {
|
|
127
128
|
component: `${e.componentName}.bottomBar.pagination.pageSize`,
|
|
128
129
|
tag: "select",
|
|
129
130
|
fontSize: 12,
|
|
@@ -134,22 +135,22 @@ function le({ grid: e, pageSize: t }) {
|
|
|
134
135
|
value: t,
|
|
135
136
|
onChange: (t) => e.pagination.changePageSize(Number(t.target.value))
|
|
136
137
|
},
|
|
137
|
-
children: n.map((t) => /* @__PURE__ */
|
|
138
|
+
children: n.map((t) => /* @__PURE__ */ I("option", {
|
|
138
139
|
value: t,
|
|
139
140
|
children: e.localeText.pageSizeOption(t)
|
|
140
141
|
}, t))
|
|
141
142
|
})
|
|
142
143
|
});
|
|
143
144
|
}
|
|
144
|
-
function
|
|
145
|
-
let [r, i] =
|
|
145
|
+
function fe({ grid: e, page: t, totalPages: n }) {
|
|
146
|
+
let [r, i] = P(String(t)), [a, o] = P(t);
|
|
146
147
|
t !== a && (o(t), i(String(t)));
|
|
147
|
-
let s =
|
|
148
|
+
let s = A(() => {
|
|
148
149
|
e.pagination.jumpToPage(r), i(String(e.pagination.page));
|
|
149
|
-
}, [e, r]), c =
|
|
150
|
+
}, [e, r]), c = A((e) => {
|
|
150
151
|
e.key === "Enter" ? s() : e.key === "Escape" && i(String(t));
|
|
151
152
|
}, [s, t]);
|
|
152
|
-
return /* @__PURE__ */
|
|
153
|
+
return /* @__PURE__ */ I(x, {
|
|
153
154
|
type: "number",
|
|
154
155
|
variant: "compact",
|
|
155
156
|
value: r,
|
|
@@ -165,9 +166,9 @@ function ue({ grid: e, page: t, totalPages: n }) {
|
|
|
165
166
|
}
|
|
166
167
|
});
|
|
167
168
|
}
|
|
168
|
-
function
|
|
169
|
+
function pe(e) {
|
|
169
170
|
let { componentName: t, label: n, onClick: r, disabled: i, children: a } = e;
|
|
170
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ I(h, {
|
|
171
172
|
component: `${t}.bottomBar.pagination.button`,
|
|
172
173
|
props: {
|
|
173
174
|
"aria-label": n,
|
|
@@ -187,8 +188,8 @@ function de(e) {
|
|
|
187
188
|
children: a
|
|
188
189
|
});
|
|
189
190
|
}
|
|
190
|
-
function
|
|
191
|
-
return /* @__PURE__ */
|
|
191
|
+
function me(e) {
|
|
192
|
+
return /* @__PURE__ */ I(m, {
|
|
192
193
|
viewBox: "0 0 24 24",
|
|
193
194
|
width: "14",
|
|
194
195
|
height: "14",
|
|
@@ -197,70 +198,70 @@ function fe(e) {
|
|
|
197
198
|
strokeWidth: 2,
|
|
198
199
|
strokeLinecap: "round",
|
|
199
200
|
strokeLinejoin: "round",
|
|
200
|
-
children: /* @__PURE__ */
|
|
201
|
+
children: /* @__PURE__ */ I(p, { d: e.d })
|
|
201
202
|
});
|
|
202
203
|
}
|
|
203
|
-
function pe() {
|
|
204
|
-
return /* @__PURE__ */ L(fe, { d: "M15 18l-6-6 6-6" });
|
|
205
|
-
}
|
|
206
|
-
function me() {
|
|
207
|
-
return /* @__PURE__ */ L(fe, { d: "M9 18l6-6-6-6" });
|
|
208
|
-
}
|
|
209
204
|
function he() {
|
|
210
|
-
return /* @__PURE__ */
|
|
205
|
+
return /* @__PURE__ */ I(me, { d: "M15 18l-6-6 6-6" });
|
|
211
206
|
}
|
|
212
207
|
function ge() {
|
|
213
|
-
return /* @__PURE__ */
|
|
208
|
+
return /* @__PURE__ */ I(me, { d: "M9 18l6-6-6-6" });
|
|
209
|
+
}
|
|
210
|
+
function _e() {
|
|
211
|
+
return /* @__PURE__ */ I(me, { d: "M18 18l-6-6 6-6M11 18l-6-6 6-6" });
|
|
212
|
+
}
|
|
213
|
+
function ve() {
|
|
214
|
+
return /* @__PURE__ */ I(me, { d: "M6 18l6-6-6-6M13 18l6-6-6-6" });
|
|
214
215
|
}
|
|
215
216
|
//#endregion
|
|
216
217
|
//#region src/components/dataGrid/components/dataGridBottomBar.tsx
|
|
217
|
-
function
|
|
218
|
+
function ye(e) {
|
|
218
219
|
let { grid: t } = e, { pagination: n, filter: r } = t;
|
|
219
220
|
if (n.state) {
|
|
220
221
|
let { totalItems: e, startItem: r, endItem: i } = n;
|
|
221
|
-
return /* @__PURE__ */
|
|
222
|
+
return /* @__PURE__ */ L(_, {
|
|
222
223
|
component: `${t.componentName}.bottomBar`,
|
|
223
224
|
children: [
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ I(a, {
|
|
225
226
|
component: `${t.componentName}.bottomBar.info`,
|
|
226
227
|
children: t.localeText.pageRowRange(r, i, e)
|
|
227
228
|
}),
|
|
228
|
-
t.props.def.rowSelection && /* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */
|
|
229
|
+
t.props.def.rowSelection && /* @__PURE__ */ I(le, { grid: t }),
|
|
230
|
+
/* @__PURE__ */ I(ue, { grid: t })
|
|
230
231
|
]
|
|
231
232
|
});
|
|
232
233
|
}
|
|
233
234
|
let { filtered: i, total: o } = r.filterStats;
|
|
234
|
-
return /* @__PURE__ */
|
|
235
|
+
return /* @__PURE__ */ L(_, {
|
|
235
236
|
component: `${t.componentName}.bottomBar`,
|
|
236
237
|
children: [
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ I(a, {
|
|
238
239
|
component: `${t.componentName}.bottomBar.info`,
|
|
239
240
|
children: t.localeText.rowCount(i, o)
|
|
240
241
|
}),
|
|
241
|
-
r.hasActiveFilters && /* @__PURE__ */
|
|
242
|
+
r.hasActiveFilters && /* @__PURE__ */ L(h, {
|
|
242
243
|
type: "button",
|
|
243
244
|
component: `${t.componentName}.bottomBar.clearFilters`,
|
|
244
245
|
onClick: r.clearAllFilters,
|
|
245
|
-
children: [/* @__PURE__ */
|
|
246
|
+
children: [/* @__PURE__ */ I(a, {
|
|
246
247
|
tag: "span",
|
|
247
248
|
props: { "aria-hidden": !0 },
|
|
248
249
|
children: "✕"
|
|
249
250
|
}), t.localeText.clearFilters]
|
|
250
251
|
}),
|
|
251
|
-
t.props.def.rowSelection && /* @__PURE__ */
|
|
252
|
+
t.props.def.rowSelection && /* @__PURE__ */ I(le, { grid: t })
|
|
252
253
|
]
|
|
253
254
|
});
|
|
254
255
|
}
|
|
255
256
|
//#endregion
|
|
256
257
|
//#region src/components/dataGrid/gridNavigationContext.ts
|
|
257
|
-
var
|
|
258
|
-
function
|
|
259
|
-
return
|
|
258
|
+
var be = D(null);
|
|
259
|
+
function R() {
|
|
260
|
+
return j(be);
|
|
260
261
|
}
|
|
261
|
-
var
|
|
262
|
-
function
|
|
263
|
-
let r =
|
|
262
|
+
var xe = () => () => {};
|
|
263
|
+
function Se(e, t, n) {
|
|
264
|
+
let r = oe(e?.activeCell.subscribe ?? xe, () => !!e?.activeCell.isActive(t, n), () => !!e?.activeCell.isActive(t, n));
|
|
264
265
|
return e ? {
|
|
265
266
|
...e.cellProps(t, n),
|
|
266
267
|
tabIndex: r ? 0 : -1
|
|
@@ -268,7 +269,7 @@ function be(e, t, n) {
|
|
|
268
269
|
}
|
|
269
270
|
//#endregion
|
|
270
271
|
//#region src/components/dataGrid/models/viewportModel.ts
|
|
271
|
-
var
|
|
272
|
+
var Ce = class e {
|
|
272
273
|
grid;
|
|
273
274
|
static DEFAULT_VISIBLE_ROWS_COUNT = 10;
|
|
274
275
|
static ROWS_AHEAD = 12;
|
|
@@ -321,7 +322,7 @@ var xe = class e {
|
|
|
321
322
|
totalHeight: this.totalHeight,
|
|
322
323
|
viewHeight: void 0
|
|
323
324
|
};
|
|
324
|
-
let { rowHeight: i } = this.grid, { ROWS_AHEAD: a, ROWS_BEHIND: o, PARTIAL_ROWS: s } = e, c = n === "down" ? o : a, { offsets: l } = this.grid.rowOffsets.value, u = this.hasDetailRows ? S(l, t) : Math.floor(t / i), d = Math.max(0, u - c), f = this.hasDetailRows ? l[d] ?? 0 : d * i;
|
|
325
|
+
let { rowHeight: i } = this.grid, { ROWS_AHEAD: a, ROWS_BEHIND: o, PARTIAL_ROWS: s } = e, c = n === "down" ? o : a, { offsets: l } = this.grid.rowOffsets.value, u = Math.min(this.hasDetailRows ? S(l, t) : Math.floor(t / i), Math.max(0, r - 1)), d = Math.max(0, u - c), f = this.hasDetailRows ? l[d] ?? 0 : d * i;
|
|
325
326
|
return {
|
|
326
327
|
startIndex: d,
|
|
327
328
|
take: this.visibleRowsCount + s + o + a,
|
|
@@ -330,7 +331,7 @@ var xe = class e {
|
|
|
330
331
|
viewHeight: this.viewHeight
|
|
331
332
|
};
|
|
332
333
|
}
|
|
333
|
-
},
|
|
334
|
+
}, we = class {
|
|
334
335
|
row;
|
|
335
336
|
column;
|
|
336
337
|
listeners = /* @__PURE__ */ new Set();
|
|
@@ -344,23 +345,23 @@ var xe = class e {
|
|
|
344
345
|
set(e, t) {
|
|
345
346
|
(e !== this.row || t !== this.column) && (this.row = e, this.column = t, this.listeners.forEach((e) => e()));
|
|
346
347
|
}
|
|
347
|
-
},
|
|
348
|
-
function
|
|
349
|
-
return
|
|
348
|
+
}, Te, Ee;
|
|
349
|
+
function De() {
|
|
350
|
+
return Ee ??= import("../dataGridDateParts.mjs").then((e) => Te = e.default), Ee;
|
|
350
351
|
}
|
|
351
|
-
function
|
|
352
|
-
return
|
|
352
|
+
function Oe() {
|
|
353
|
+
return Te;
|
|
353
354
|
}
|
|
354
|
-
function
|
|
355
|
-
let [t, n] =
|
|
355
|
+
function z(e) {
|
|
356
|
+
let [t, n] = P(void 0);
|
|
356
357
|
return r(() => {
|
|
357
358
|
if (!e || t) return;
|
|
358
|
-
if (
|
|
359
|
-
n(() =>
|
|
359
|
+
if (Te) {
|
|
360
|
+
n(() => Te);
|
|
360
361
|
return;
|
|
361
362
|
}
|
|
362
363
|
let r = !0;
|
|
363
|
-
return
|
|
364
|
+
return De().then((e) => r && n(() => e)), () => {
|
|
364
365
|
r = !1;
|
|
365
366
|
};
|
|
366
367
|
}, [e, t]), t;
|
|
@@ -370,39 +371,39 @@ function De(e) {
|
|
|
370
371
|
function B(e, t) {
|
|
371
372
|
return JSON.stringify([e, t]);
|
|
372
373
|
}
|
|
373
|
-
var
|
|
374
|
-
function
|
|
375
|
-
return typeof e == "number" ? "number" : typeof e == "boolean" ? "checkbox" : e instanceof Date ? "datetime" : typeof e == "string" ?
|
|
374
|
+
var ke = 1e3;
|
|
375
|
+
function Ae(e) {
|
|
376
|
+
return typeof e == "number" ? "number" : typeof e == "boolean" ? "checkbox" : e instanceof Date ? "datetime" : typeof e == "string" ? Me.test(e) ? "date" : Ne.test(e) ? "time" : Pe.test(e) ? "datetime" : "text" : "text";
|
|
376
377
|
}
|
|
377
|
-
var
|
|
378
|
+
var je = /* @__PURE__ */ new Set([
|
|
378
379
|
"date",
|
|
379
380
|
"time",
|
|
380
381
|
"datetime"
|
|
381
|
-
]),
|
|
382
|
-
function
|
|
383
|
-
return
|
|
382
|
+
]), Me = /^\d{4}-\d{2}-\d{2}$/, Ne = /^\d{2}:\d{2}(:\d{2}(\.\d+)?)?$/, Pe = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;
|
|
383
|
+
function Fe(e) {
|
|
384
|
+
return je.has(e);
|
|
384
385
|
}
|
|
385
|
-
function
|
|
386
|
+
function Ie(e, t) {
|
|
386
387
|
if (e === "text") return t;
|
|
387
388
|
if (e !== "number" || t.trim() === "") return;
|
|
388
389
|
let n = Number(t);
|
|
389
390
|
return Number.isFinite(n) ? n : void 0;
|
|
390
391
|
}
|
|
391
|
-
var
|
|
392
|
+
var Le = [
|
|
392
393
|
"value",
|
|
393
394
|
"oldValue",
|
|
394
395
|
"error"
|
|
395
|
-
],
|
|
396
|
+
], Re = /* @__PURE__ */ new Set([
|
|
396
397
|
"true",
|
|
397
398
|
"1",
|
|
398
399
|
"yes"
|
|
399
|
-
]),
|
|
400
|
+
]), ze = /* @__PURE__ */ new Set([
|
|
400
401
|
"false",
|
|
401
402
|
"0",
|
|
402
403
|
"no",
|
|
403
404
|
""
|
|
404
405
|
]);
|
|
405
|
-
function
|
|
406
|
+
function Be(e, t, n) {
|
|
406
407
|
if (e.type === "number") {
|
|
407
408
|
if (n.trim() === "") return { value: null };
|
|
408
409
|
let e = Number(n);
|
|
@@ -410,17 +411,17 @@ function ze(e, t, n) {
|
|
|
410
411
|
}
|
|
411
412
|
if (e.type === "checkbox") {
|
|
412
413
|
let e = n.trim().toLowerCase();
|
|
413
|
-
return
|
|
414
|
+
return Re.has(e) ? { value: !0 } : ze.has(e) ? { value: !1 } : void 0;
|
|
414
415
|
}
|
|
415
|
-
if (
|
|
416
|
+
if (Fe(e.type)) {
|
|
416
417
|
if (n.trim() === "") return { value: null };
|
|
417
|
-
let t =
|
|
418
|
+
let t = Oe();
|
|
418
419
|
if (t) {
|
|
419
420
|
let r = t.parsePasted(e, n);
|
|
420
421
|
return r ? { value: r } : void 0;
|
|
421
422
|
}
|
|
422
423
|
let r = n.trim();
|
|
423
|
-
return (e.type === "date" ?
|
|
424
|
+
return (e.type === "date" ? Me : e.type === "time" ? Ne : Pe).test(r) ? { value: r } : void 0;
|
|
424
425
|
}
|
|
425
426
|
if (e.type === "select") {
|
|
426
427
|
let e = t.find((e) => String(e.value) === n);
|
|
@@ -428,10 +429,10 @@ function ze(e, t, n) {
|
|
|
428
429
|
}
|
|
429
430
|
return { value: n };
|
|
430
431
|
}
|
|
431
|
-
function
|
|
432
|
+
function Ve(e) {
|
|
432
433
|
return e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey;
|
|
433
434
|
}
|
|
434
|
-
var
|
|
435
|
+
var He = class {
|
|
435
436
|
grid;
|
|
436
437
|
constructor(e) {
|
|
437
438
|
this.grid = e;
|
|
@@ -456,7 +457,7 @@ var Ve = class {
|
|
|
456
457
|
}
|
|
457
458
|
editorFor(e, t) {
|
|
458
459
|
let { editor: n } = e.def;
|
|
459
|
-
return typeof n == "object" ? n : n ? { type: n } : { type:
|
|
460
|
+
return typeof n == "object" ? n : n ? { type: n } : { type: Ae(t) };
|
|
460
461
|
}
|
|
461
462
|
isEditing(e, t) {
|
|
462
463
|
return this._active?.rowKey === e && this._active.columnKey === t;
|
|
@@ -481,7 +482,7 @@ var Ve = class {
|
|
|
481
482
|
return !!this._active?.pending;
|
|
482
483
|
}
|
|
483
484
|
begin(e, t, n, r) {
|
|
484
|
-
let i = r === void 0 ? void 0 :
|
|
485
|
+
let i = r === void 0 ? void 0 : Ie(this.editorFor(t, n).type, r);
|
|
485
486
|
this.rejected.delete(B(e.key, t.key)), this._active = {
|
|
486
487
|
row: e,
|
|
487
488
|
rowKey: e.key,
|
|
@@ -548,14 +549,14 @@ var Ve = class {
|
|
|
548
549
|
columnKey: t.columnKey,
|
|
549
550
|
oldValue: t.oldValue,
|
|
550
551
|
error: this._active.error
|
|
551
|
-
},
|
|
552
|
+
}, Le);
|
|
552
553
|
return;
|
|
553
554
|
}
|
|
554
555
|
this.values.set(B(t.rowKey, t.columnKey), t.value), this._edits = [...this._edits, t], this._active = void 0, this.grid.notify(), this.grid.props.onCellEditsChange?.(this._edits, { reason: "edit" }), this.grid.reportInteraction("cellEdit", t.value, "edit", {
|
|
555
556
|
rowKey: t.rowKey,
|
|
556
557
|
columnKey: t.columnKey,
|
|
557
558
|
oldValue: t.oldValue
|
|
558
|
-
},
|
|
559
|
+
}, Le);
|
|
559
560
|
}
|
|
560
561
|
}
|
|
561
562
|
valueOf(e, t, n) {
|
|
@@ -579,7 +580,7 @@ var Ve = class {
|
|
|
579
580
|
c++;
|
|
580
581
|
continue;
|
|
581
582
|
}
|
|
582
|
-
let f = this.valueOf(l.key, u.key, l.data[u.key]), p =
|
|
583
|
+
let f = this.valueOf(l.key, u.key, l.data[u.key]), p = Be(this.editorFor(u, f), this.optionsFor(u, l), d), m = {
|
|
583
584
|
rowKey: l.key,
|
|
584
585
|
columnKey: u.key,
|
|
585
586
|
row: l.data,
|
|
@@ -638,8 +639,8 @@ var Ve = class {
|
|
|
638
639
|
}, ["cells"]);
|
|
639
640
|
}
|
|
640
641
|
nextEditable(e, t, n = !1) {
|
|
641
|
-
let r = this.grid.flatRows.value, i = this.grid.columns.value.visibleLeafs, a = n ? -1 : 1, o = e * i.length + t + a, s = Math.min(r.length * i.length - 1, o +
|
|
642
|
-
for (let e = o; e >= Math.max(0, o -
|
|
642
|
+
let r = this.grid.flatRows.value, i = this.grid.columns.value.visibleLeafs, a = n ? -1 : 1, o = e * i.length + t + a, s = Math.min(r.length * i.length - 1, o + ke);
|
|
643
|
+
for (let e = o; e >= Math.max(0, o - ke) && e <= s; e += a) {
|
|
643
644
|
let t = Math.floor(e / i.length), n = e % i.length, a = r[t], o = i[n];
|
|
644
645
|
if (!(!o || a?.kind !== "row" || !this.isEditable(a, o))) return {
|
|
645
646
|
row: t,
|
|
@@ -719,7 +720,7 @@ var Ve = class {
|
|
|
719
720
|
columnKey: this.column.key
|
|
720
721
|
}, ["value"]);
|
|
721
722
|
};
|
|
722
|
-
},
|
|
723
|
+
}, Ue = class e {
|
|
723
724
|
grid;
|
|
724
725
|
parentRow;
|
|
725
726
|
constructor(e, t) {
|
|
@@ -752,7 +753,7 @@ var Ve = class {
|
|
|
752
753
|
get allRows() {
|
|
753
754
|
return [];
|
|
754
755
|
}
|
|
755
|
-
},
|
|
756
|
+
}, H = class {
|
|
756
757
|
grid;
|
|
757
758
|
rowIndex;
|
|
758
759
|
constructor(e, t, n) {
|
|
@@ -805,7 +806,7 @@ var Ve = class {
|
|
|
805
806
|
return this.grid.expandedDetailRows.has(this.key);
|
|
806
807
|
}
|
|
807
808
|
get flatRows() {
|
|
808
|
-
return this.grid.props.def.rowDetail && this.expanded ? [this, new
|
|
809
|
+
return this.grid.props.def.rowDetail && this.expanded ? [this, new Ue(this.grid, this)] : [this];
|
|
809
810
|
}
|
|
810
811
|
get allRows() {
|
|
811
812
|
return this;
|
|
@@ -813,14 +814,14 @@ var Ve = class {
|
|
|
813
814
|
};
|
|
814
815
|
//#endregion
|
|
815
816
|
//#region src/components/dataGrid/models/treeRow.ts
|
|
816
|
-
function
|
|
817
|
+
function U(e) {
|
|
817
818
|
return !!e && e.isTreeRow === !0;
|
|
818
819
|
}
|
|
819
820
|
//#endregion
|
|
820
821
|
//#region src/components/dataGrid/useGridNavigation.ts
|
|
821
|
-
var
|
|
822
|
-
function
|
|
823
|
-
let { grid: t, scrollerRef: n, scroll: i, onScrollTo: a } = e, o = t.headerRows.value, s = t.filter.hasFilterableColumns, l = o.length + +!!s, d = t.viewport.isEmpty ?
|
|
822
|
+
var We = "[role=\"gridcell\"],[role=\"columnheader\"]", Ge = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]", Ke = 2, qe = [];
|
|
823
|
+
function Je(e) {
|
|
824
|
+
let { grid: t, scrollerRef: n, scroll: i, onScrollTo: a } = e, o = t.headerRows.value, s = t.filter.hasFilterableColumns, l = o.length + +!!s, d = t.viewport.isEmpty ? qe : t.flatRows.value, f = t.columns.value.visibleLeafs.length, p = t.aggregation.hasFooter && !t.viewport.isEmpty ? 1 : 0, m = l + d.length + p, h = A((e) => {
|
|
824
825
|
if (e < o.length) return o[e]?.length ?? 0;
|
|
825
826
|
if (e < l || e >= l + d.length) return f;
|
|
826
827
|
let t = d[e - l];
|
|
@@ -830,11 +831,11 @@ function Ke(e) {
|
|
|
830
831
|
f,
|
|
831
832
|
l,
|
|
832
833
|
o
|
|
833
|
-
]), g =
|
|
834
|
+
]), g = A((e, t) => e < o.length ? (o[e]?.[t]?.headerCell.columnIndex ?? t + 1) - 1 : e < l ? t : d[e - l]?.columnOf(t) ?? t, [
|
|
834
835
|
d,
|
|
835
836
|
l,
|
|
836
837
|
o
|
|
837
|
-
]), _ =
|
|
838
|
+
]), _ = N(!1), v = A((e, r) => {
|
|
838
839
|
let { viewport: o } = t, s = e - l, c = n.current;
|
|
839
840
|
if (o.showAll || !c || s >= d.length) return;
|
|
840
841
|
if (s < 0) {
|
|
@@ -842,7 +843,7 @@ function Ke(e) {
|
|
|
842
843
|
return;
|
|
843
844
|
}
|
|
844
845
|
let { startIndex: u, take: f } = o.window(i.top, i.direction);
|
|
845
|
-
if (s >= u +
|
|
846
|
+
if (s >= u + Ke && s < u + f - Ke) return;
|
|
846
847
|
let p = o.rowTop(s);
|
|
847
848
|
c.scrollTop = p, a(p);
|
|
848
849
|
}, [
|
|
@@ -852,7 +853,7 @@ function Ke(e) {
|
|
|
852
853
|
a,
|
|
853
854
|
i,
|
|
854
855
|
n
|
|
855
|
-
]), y =
|
|
856
|
+
]), y = N(0), b = A((e, n, r) => {
|
|
856
857
|
let i = e - l;
|
|
857
858
|
if (i < 0 || i >= d.length) {
|
|
858
859
|
t.range.clear();
|
|
@@ -881,15 +882,15 @@ function Ke(e) {
|
|
|
881
882
|
r(() => {
|
|
882
883
|
_.current && (_.current = !1, S()?.focus());
|
|
883
884
|
});
|
|
884
|
-
let C =
|
|
885
|
+
let C = A((e, n, r) => {
|
|
885
886
|
if (!t.tree.enabled || e.key !== "ArrowRight" && e.key !== "ArrowLeft") return !1;
|
|
886
887
|
let i = d[n - l];
|
|
887
|
-
if (!
|
|
888
|
+
if (!U(i) || t.columns.value.visibleLeafs[r]?.key !== t.tree.columnKey) return !1;
|
|
888
889
|
if (e.key === (t.isRtl ? "ArrowLeft" : "ArrowRight")) return !i.hasChildren || i.treeExpanded ? !1 : (i.toggleTree(), !0);
|
|
889
890
|
if (i.hasChildren && i.treeExpanded) return i.toggleTree(), !0;
|
|
890
891
|
for (let e = n - 1; e >= l; e--) {
|
|
891
892
|
let t = d[e - l];
|
|
892
|
-
if (!(!
|
|
893
|
+
if (!(!U(t) || t.level >= i.level)) return x.setActiveCell(e, r, { reason: "keyboard" }), !0;
|
|
893
894
|
}
|
|
894
895
|
return !1;
|
|
895
896
|
}, [
|
|
@@ -897,7 +898,7 @@ function Ke(e) {
|
|
|
897
898
|
t,
|
|
898
899
|
l,
|
|
899
900
|
x
|
|
900
|
-
]), w =
|
|
901
|
+
]), w = A((e) => {
|
|
901
902
|
let { activeIndex: t, activeColumn: n } = x, r = e ? -1 : 1, i = n + r;
|
|
902
903
|
if (i >= 0 && i < h(t)) return x.setActiveCell(t, i, { reason: "keyboard" }), !0;
|
|
903
904
|
let a = t + r;
|
|
@@ -906,29 +907,29 @@ function Ke(e) {
|
|
|
906
907
|
h,
|
|
907
908
|
x,
|
|
908
909
|
m
|
|
909
|
-
]), T =
|
|
910
|
+
]), T = A((e, n) => {
|
|
910
911
|
if (!t.props.def.rowSelection) return !1;
|
|
911
912
|
if (e < l) return e >= o.length || !t.columns.value.visibleLeafs[n]?.isRowSelection ? !1 : (t.toggleSelectAllRows(), !0);
|
|
912
913
|
let r = t.flatRows.value[e - l];
|
|
913
|
-
return r instanceof
|
|
914
|
+
return r instanceof H && (r.toggleSelection(), !0);
|
|
914
915
|
}, [
|
|
915
916
|
t,
|
|
916
917
|
l,
|
|
917
918
|
o.length
|
|
918
|
-
]),
|
|
919
|
-
let r = Array.from(e.querySelectorAll(
|
|
919
|
+
]), ee = A((e, t, n) => {
|
|
920
|
+
let r = Array.from(e.querySelectorAll(Ge));
|
|
920
921
|
if (r.length < 2) return !1;
|
|
921
922
|
let i = r.indexOf(t);
|
|
922
923
|
return i !== -1 && (r[(i + (n ? -1 : 1) + r.length) % r.length].focus(), !0);
|
|
923
|
-
}, []),
|
|
924
|
-
let n = e.target, r = n.closest?.(
|
|
924
|
+
}, []), te = x.onKeyDown, E = A((e) => {
|
|
925
|
+
let n = e.target, r = n.closest?.(We);
|
|
925
926
|
if (r) {
|
|
926
927
|
if (n !== r) {
|
|
927
928
|
if (e.key === "Escape" && !r.querySelector("[aria-expanded=\"true\"]")) {
|
|
928
929
|
e.preventDefault(), r.focus();
|
|
929
930
|
return;
|
|
930
931
|
}
|
|
931
|
-
e.key === "Tab" &&
|
|
932
|
+
e.key === "Tab" && ee(r, n, e.shiftKey) && e.preventDefault();
|
|
932
933
|
return;
|
|
933
934
|
}
|
|
934
935
|
if (e.key === "Tab" && t.props.def.tabNavigation === "cells") {
|
|
@@ -949,13 +950,13 @@ function Ke(e) {
|
|
|
949
950
|
e.preventDefault();
|
|
950
951
|
return;
|
|
951
952
|
}
|
|
952
|
-
let i = r.querySelector(
|
|
953
|
+
let i = r.querySelector(Ge);
|
|
953
954
|
if (i) {
|
|
954
955
|
e.preventDefault(), i.focus();
|
|
955
956
|
return;
|
|
956
957
|
}
|
|
957
958
|
}
|
|
958
|
-
if (t.edits.enabled &&
|
|
959
|
+
if (t.edits.enabled && Ve(e) && t.edits.beginAt(x.activeIndex - l, x.activeColumn, e.key)) {
|
|
959
960
|
e.preventDefault();
|
|
960
961
|
return;
|
|
961
962
|
}
|
|
@@ -963,7 +964,7 @@ function Ke(e) {
|
|
|
963
964
|
e.preventDefault();
|
|
964
965
|
return;
|
|
965
966
|
}
|
|
966
|
-
|
|
967
|
+
te(e);
|
|
967
968
|
}
|
|
968
969
|
}, [
|
|
969
970
|
t,
|
|
@@ -971,46 +972,46 @@ function Ke(e) {
|
|
|
971
972
|
o,
|
|
972
973
|
x.activeColumn,
|
|
973
974
|
x.activeIndex,
|
|
974
|
-
|
|
975
|
+
te,
|
|
975
976
|
w,
|
|
976
|
-
|
|
977
|
+
ee,
|
|
977
978
|
T,
|
|
978
979
|
C
|
|
979
|
-
]), { setActiveCell:
|
|
980
|
-
r(() =>
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
980
|
+
]), { setActiveCell: ne, activeIndex: D, activeColumn: O } = x, k = c(x.cellProps), [j] = P(() => new we(D, O));
|
|
981
|
+
r(() => j.set(D, O), [
|
|
982
|
+
j,
|
|
983
|
+
O,
|
|
984
|
+
D
|
|
984
985
|
]);
|
|
985
|
-
let
|
|
986
|
-
let { ref: n, onFocus: r } =
|
|
986
|
+
let M = A((e, t) => {
|
|
987
|
+
let { ref: n, onFocus: r } = k.current(e, t);
|
|
987
988
|
return {
|
|
988
989
|
ref: n,
|
|
989
990
|
onFocus: r
|
|
990
991
|
};
|
|
991
|
-
}, [
|
|
992
|
+
}, [k]);
|
|
992
993
|
return {
|
|
993
|
-
navigation:
|
|
994
|
+
navigation: ae(() => ({
|
|
994
995
|
rowCount: m,
|
|
995
996
|
columnCount: f,
|
|
996
997
|
headerRowCount: l,
|
|
997
|
-
cellProps:
|
|
998
|
-
activeCell:
|
|
999
|
-
setActiveCell:
|
|
998
|
+
cellProps: M,
|
|
999
|
+
activeCell: j,
|
|
1000
|
+
setActiveCell: ne
|
|
1000
1001
|
}), [
|
|
1002
|
+
j,
|
|
1001
1003
|
M,
|
|
1002
|
-
N,
|
|
1003
1004
|
f,
|
|
1004
1005
|
l,
|
|
1005
1006
|
m,
|
|
1006
|
-
|
|
1007
|
+
ne
|
|
1007
1008
|
]),
|
|
1008
|
-
onKeyDown:
|
|
1009
|
+
onKeyDown: E
|
|
1009
1010
|
};
|
|
1010
1011
|
}
|
|
1011
1012
|
//#endregion
|
|
1012
1013
|
//#region src/utils/array/arrayUtils.ts
|
|
1013
|
-
var
|
|
1014
|
+
var Ye;
|
|
1014
1015
|
(function(e) {
|
|
1015
1016
|
function t(e, t, n = 0) {
|
|
1016
1017
|
return e.slice(n, n + t);
|
|
@@ -1057,11 +1058,11 @@ var qe;
|
|
|
1057
1058
|
}));
|
|
1058
1059
|
}
|
|
1059
1060
|
e.groupBy = s;
|
|
1060
|
-
})(
|
|
1061
|
-
var
|
|
1061
|
+
})(Ye ||= {});
|
|
1062
|
+
var W = Ye, Xe = "row-number-cell", Ze = "row-selection-cell", G = "grouping-cell", Qe = "row-detail-cell", K = Symbol("memo.unset"), $e = class {
|
|
1062
1063
|
action;
|
|
1063
1064
|
deps;
|
|
1064
|
-
cache =
|
|
1065
|
+
cache = K;
|
|
1065
1066
|
dependents = /* @__PURE__ */ new Set();
|
|
1066
1067
|
wired = !1;
|
|
1067
1068
|
constructor(e, t) {
|
|
@@ -1074,46 +1075,46 @@ var G = qe, Je = "row-number-cell", Ye = "row-selection-cell", K = "grouping-cel
|
|
|
1074
1075
|
}
|
|
1075
1076
|
}
|
|
1076
1077
|
get value() {
|
|
1077
|
-
return this.wire(), this.cache ===
|
|
1078
|
+
return this.wire(), this.cache === K && (this.cache = this.action()), this.cache;
|
|
1078
1079
|
}
|
|
1079
1080
|
clear() {
|
|
1080
|
-
if (this.wire(), this.cache !==
|
|
1081
|
-
this.cache =
|
|
1081
|
+
if (this.wire(), this.cache !== K) {
|
|
1082
|
+
this.cache = K;
|
|
1082
1083
|
for (let e of this.dependents) e.clear();
|
|
1083
1084
|
}
|
|
1084
1085
|
}
|
|
1085
1086
|
};
|
|
1086
1087
|
function q(e, t = () => []) {
|
|
1087
|
-
return new
|
|
1088
|
+
return new $e(e, t);
|
|
1088
1089
|
}
|
|
1089
1090
|
//#endregion
|
|
1090
1091
|
//#region src/components/dataGrid/models/aggregationModel.ts
|
|
1091
|
-
function
|
|
1092
|
+
function et(e) {
|
|
1092
1093
|
return e.filter((e) => typeof e == "number" && !Number.isNaN(e));
|
|
1093
1094
|
}
|
|
1094
|
-
var
|
|
1095
|
+
var tt = (e) => e.reduce((e, t) => e + t, 0), nt = (e, t) => e.reduce((e, n) => (t ? n < e : n > e) ? n : e), rt = {
|
|
1095
1096
|
sum: (e) => {
|
|
1096
|
-
let t =
|
|
1097
|
-
return t.length ?
|
|
1097
|
+
let t = et(e);
|
|
1098
|
+
return t.length ? tt(t) : null;
|
|
1098
1099
|
},
|
|
1099
1100
|
avg: (e) => {
|
|
1100
|
-
let t =
|
|
1101
|
-
return t.length ? Math.round(
|
|
1101
|
+
let t = et(e);
|
|
1102
|
+
return t.length ? Math.round(tt(t) / t.length * 100) / 100 : null;
|
|
1102
1103
|
},
|
|
1103
1104
|
min: (e) => {
|
|
1104
|
-
let t =
|
|
1105
|
-
return t.length ?
|
|
1105
|
+
let t = et(e);
|
|
1106
|
+
return t.length ? nt(t, !0) : null;
|
|
1106
1107
|
},
|
|
1107
1108
|
max: (e) => {
|
|
1108
|
-
let t =
|
|
1109
|
-
return t.length ?
|
|
1109
|
+
let t = et(e);
|
|
1110
|
+
return t.length ? nt(t, !1) : null;
|
|
1110
1111
|
},
|
|
1111
1112
|
count: (e, t) => t.length
|
|
1112
1113
|
};
|
|
1113
|
-
function
|
|
1114
|
-
return typeof e == "function" ? e(t, n) :
|
|
1114
|
+
function it(e, t, n) {
|
|
1115
|
+
return typeof e == "function" ? e(t, n) : rt[e]?.(t, n) ?? null;
|
|
1115
1116
|
}
|
|
1116
|
-
var
|
|
1117
|
+
var at = class {
|
|
1117
1118
|
grid;
|
|
1118
1119
|
constructor(e) {
|
|
1119
1120
|
this.grid = e;
|
|
@@ -1134,8 +1135,8 @@ var it = class {
|
|
|
1134
1135
|
get footerLabelColumn() {
|
|
1135
1136
|
return this.grid.columns.value.visibleLeafs.find((e) => (e.isData || e.isGrouping) && !e.aggregate);
|
|
1136
1137
|
}
|
|
1137
|
-
footerCells = q(() => this.grid.columns.value.visibleLeafs.map((e) => new
|
|
1138
|
-
},
|
|
1138
|
+
footerCells = q(() => this.grid.columns.value.visibleLeafs.map((e) => new ot(this.grid, e, this.grid.filteredData, "footer")), () => [this.grid.rows]);
|
|
1139
|
+
}, ot = class {
|
|
1139
1140
|
grid;
|
|
1140
1141
|
column;
|
|
1141
1142
|
rows;
|
|
@@ -1150,7 +1151,7 @@ var it = class {
|
|
|
1150
1151
|
}
|
|
1151
1152
|
_value = q(() => {
|
|
1152
1153
|
let e = this.column.aggregate;
|
|
1153
|
-
return e ?
|
|
1154
|
+
return e ? it(e, this.values, this.rows) : null;
|
|
1154
1155
|
});
|
|
1155
1156
|
get value() {
|
|
1156
1157
|
let e = this.given?.();
|
|
@@ -1165,7 +1166,7 @@ var it = class {
|
|
|
1165
1166
|
get isLast() {
|
|
1166
1167
|
return !1;
|
|
1167
1168
|
}
|
|
1168
|
-
},
|
|
1169
|
+
}, st = class {
|
|
1169
1170
|
grid;
|
|
1170
1171
|
row;
|
|
1171
1172
|
column;
|
|
@@ -1187,7 +1188,7 @@ var it = class {
|
|
|
1187
1188
|
get cellKind() {
|
|
1188
1189
|
return this.column.isGrouping ? "grouping" : this.column.isRowSelection ? this.row.selectable ? "selection" : "spacer" : this.row.spans(this.column) ? "hidden" : this.column.aggregate ? "aggregate" : "spacer";
|
|
1189
1190
|
}
|
|
1190
|
-
_aggregate = q(() => this.column.aggregate ? new
|
|
1191
|
+
_aggregate = q(() => this.column.aggregate ? new ot(this.grid, this.column, this.row.allRows.map((e) => e.data), "group", () => this.row.aggregateValue(this.column)) : null);
|
|
1191
1192
|
get aggregate() {
|
|
1192
1193
|
return this._aggregate.value;
|
|
1193
1194
|
}
|
|
@@ -1206,7 +1207,7 @@ var it = class {
|
|
|
1206
1207
|
get hasGroupingBorder() {
|
|
1207
1208
|
return this.row.groupingColumn.pin === "START";
|
|
1208
1209
|
}
|
|
1209
|
-
},
|
|
1210
|
+
}, ct = class {
|
|
1210
1211
|
grid;
|
|
1211
1212
|
groupColumn;
|
|
1212
1213
|
rows;
|
|
@@ -1240,7 +1241,7 @@ var it = class {
|
|
|
1240
1241
|
let e = this.grid.columns.value.visibleLeafs;
|
|
1241
1242
|
return this._cells?.leafs !== e && (this._cells = {
|
|
1242
1243
|
leafs: e,
|
|
1243
|
-
cells: e.map((e) => new
|
|
1244
|
+
cells: e.map((e) => new st(this.grid, this, e))
|
|
1244
1245
|
}), this._cells;
|
|
1245
1246
|
}
|
|
1246
1247
|
get renderedCells() {
|
|
@@ -1271,7 +1272,7 @@ var it = class {
|
|
|
1271
1272
|
return this.parentRow ? this.parentRow.depth + 1 : 0;
|
|
1272
1273
|
}
|
|
1273
1274
|
get count() {
|
|
1274
|
-
return
|
|
1275
|
+
return W.sumBy(this.rows, (e) => e.count, 0);
|
|
1275
1276
|
}
|
|
1276
1277
|
get flatRows() {
|
|
1277
1278
|
return this.expanded ? [this, ...this.rows.flatMap((e) => e.flatRows)] : [this];
|
|
@@ -1280,7 +1281,7 @@ var it = class {
|
|
|
1280
1281
|
return this.rows.flatMap((e) => e.allRows);
|
|
1281
1282
|
}
|
|
1282
1283
|
get groupingColumn() {
|
|
1283
|
-
return
|
|
1284
|
+
return W.findOrThrow(this.grid.columns.value.leafs, (e) => e.key === G);
|
|
1284
1285
|
}
|
|
1285
1286
|
get groupingColumnGridColumn() {
|
|
1286
1287
|
return this.grid.groupingSpan.value.length;
|
|
@@ -1298,11 +1299,11 @@ var it = class {
|
|
|
1298
1299
|
};
|
|
1299
1300
|
//#endregion
|
|
1300
1301
|
//#region src/components/dataGrid/components/dataGridDetailRow.tsx
|
|
1301
|
-
function
|
|
1302
|
-
let { row: t, index: n } = e, { grid: i, parentRow: o } = t, s = i.props.def.rowDetail, c =
|
|
1302
|
+
function lt(e) {
|
|
1303
|
+
let { row: t, index: n } = e, { grid: i, parentRow: o } = t, s = i.props.def.rowDetail, c = R(), l = (c?.headerRowCount ?? 0) + n, { ref: u, tabIndex: d, onFocus: f } = Se(c, l, 0), p = t.isAutoHeight, m = N(null);
|
|
1303
1304
|
return r(() => {
|
|
1304
1305
|
i.takeDetailReveal(o.key) && m.current?.scrollIntoView?.({ block: "nearest" });
|
|
1305
|
-
}), /* @__PURE__ */
|
|
1306
|
+
}), /* @__PURE__ */ I(_, {
|
|
1306
1307
|
ref: m,
|
|
1307
1308
|
component: `${i.componentName}.body.detailRow`,
|
|
1308
1309
|
transition: "none",
|
|
@@ -1314,7 +1315,7 @@ function ct(e) {
|
|
|
1314
1315
|
gridColumn: "1 / -1",
|
|
1315
1316
|
height: p ? "auto" : `${t.height}px`
|
|
1316
1317
|
},
|
|
1317
|
-
children: /* @__PURE__ */
|
|
1318
|
+
children: /* @__PURE__ */ I(a, {
|
|
1318
1319
|
ref: u,
|
|
1319
1320
|
component: `${i.componentName}.body.detailRow.content`,
|
|
1320
1321
|
position: "sticky",
|
|
@@ -1334,15 +1335,15 @@ function ct(e) {
|
|
|
1334
1335
|
})
|
|
1335
1336
|
});
|
|
1336
1337
|
}
|
|
1337
|
-
|
|
1338
|
-
var
|
|
1338
|
+
lt.displayName = "DataGridDetailRow";
|
|
1339
|
+
var ut = k(lt);
|
|
1339
1340
|
//#endregion
|
|
1340
1341
|
//#region src/components/dataGrid/components/dataGridAggregateValue.tsx
|
|
1341
|
-
function
|
|
1342
|
+
function dt(e) {
|
|
1342
1343
|
let { cell: t } = e, { column: n } = t;
|
|
1343
|
-
if (n.AggregateCell) return /* @__PURE__ */
|
|
1344
|
+
if (n.AggregateCell) return /* @__PURE__ */ I(n.AggregateCell, { cell: t });
|
|
1344
1345
|
let r = t.scope === "footer" ? "footer.cell" : "body.groupRow.aggregate";
|
|
1345
|
-
return /* @__PURE__ */
|
|
1346
|
+
return /* @__PURE__ */ I(a, {
|
|
1346
1347
|
component: `${n.grid.componentName}.${r}`,
|
|
1347
1348
|
px: 3,
|
|
1348
1349
|
textOverflow: "ellipsis",
|
|
@@ -1351,12 +1352,12 @@ function ut(e) {
|
|
|
1351
1352
|
children: t.value
|
|
1352
1353
|
});
|
|
1353
1354
|
}
|
|
1354
|
-
|
|
1355
|
+
dt.displayName = "DataGridAggregateValue";
|
|
1355
1356
|
//#endregion
|
|
1356
1357
|
//#region src/components/dataGrid/components/dataGridCell.tsx
|
|
1357
|
-
var
|
|
1358
|
-
function J(
|
|
1359
|
-
let { children: n, cell: r, row: i, columnIndex: a, ariaColIndex: o, ariaColSpan: s, style: c, ...l } =
|
|
1358
|
+
var ft = "button,a[href],input,select,textarea";
|
|
1359
|
+
function J(e) {
|
|
1360
|
+
let { children: n, cell: r, row: i, columnIndex: a, ariaColIndex: o, ariaColSpan: s, style: c, ...l } = e, { column: u } = r, d = R(), { ref: f, tabIndex: p, onFocus: m } = Se(d, i, a), { range: h } = u.grid, g = r instanceof V ? i - (d?.headerRowCount ?? 0) : -1, v = g >= 0 && h.isCurrent(g, a), y = g >= 0 && h.isSelected(g, a);
|
|
1360
1361
|
u.hasAlign && (l.jc = u.align);
|
|
1361
1362
|
let b = r.isExpanded ? {
|
|
1362
1363
|
...u.cellVariant.value,
|
|
@@ -1378,14 +1379,14 @@ function J(t) {
|
|
|
1378
1379
|
...b,
|
|
1379
1380
|
isInvalid: !0
|
|
1380
1381
|
});
|
|
1381
|
-
let S = r instanceof V ? (
|
|
1382
|
-
|
|
1382
|
+
let S = r instanceof V ? (e) => {
|
|
1383
|
+
e.target.closest(ft) || (t(e.currentTarget), r.beginEdit());
|
|
1383
1384
|
} : void 0, C = h.enabled && g >= 0, w = C ? (e) => {
|
|
1384
|
-
e.button === 0 && e.pointerType !== "touch" && (e.target.closest(
|
|
1385
|
+
e.button === 0 && e.pointerType !== "touch" && (e.target.closest(ft) || h.press(g, a, e.shiftKey));
|
|
1385
1386
|
} : void 0, T = C && h.isDragging ? (e) => {
|
|
1386
1387
|
h.dragTo(g, a), e.currentTarget.focus();
|
|
1387
1388
|
} : void 0;
|
|
1388
|
-
return /* @__PURE__ */
|
|
1389
|
+
return /* @__PURE__ */ I(_, {
|
|
1389
1390
|
ref: f,
|
|
1390
1391
|
component: `${u.grid.componentName}.body.cell`,
|
|
1391
1392
|
props: {
|
|
@@ -1412,25 +1413,25 @@ function J(t) {
|
|
|
1412
1413
|
J.displayName = "DataGridCell";
|
|
1413
1414
|
//#endregion
|
|
1414
1415
|
//#region src/components/dataGrid/components/dataGridFooter.tsx
|
|
1415
|
-
function
|
|
1416
|
-
let { grid: t } = e, { aggregation: n } = t, r =
|
|
1416
|
+
function pt(e) {
|
|
1417
|
+
let { grid: t } = e, { aggregation: n } = t, r = R();
|
|
1417
1418
|
if (!n.hasFooter) return null;
|
|
1418
1419
|
let i = (r?.rowCount ?? 1) - 1, { footerLabelColumn: o, footerLabel: s } = n;
|
|
1419
|
-
return /* @__PURE__ */
|
|
1420
|
+
return /* @__PURE__ */ I(C, {
|
|
1420
1421
|
component: `${t.componentName}.footer`,
|
|
1421
1422
|
props: { role: "rowgroup" },
|
|
1422
1423
|
style: { gridTemplateColumns: t.gridTemplateColumns.value },
|
|
1423
|
-
children: /* @__PURE__ */
|
|
1424
|
+
children: /* @__PURE__ */ I(a, {
|
|
1424
1425
|
display: "contents",
|
|
1425
1426
|
props: {
|
|
1426
1427
|
role: "row",
|
|
1427
1428
|
"aria-rowindex": i + 1
|
|
1428
1429
|
},
|
|
1429
|
-
children: n.footerCells.value.map((e, n) => /* @__PURE__ */
|
|
1430
|
+
children: n.footerCells.value.map((e, n) => /* @__PURE__ */ I(J, {
|
|
1430
1431
|
cell: e,
|
|
1431
1432
|
row: i,
|
|
1432
1433
|
columnIndex: n,
|
|
1433
|
-
children: e.column.aggregate ? /* @__PURE__ */
|
|
1434
|
+
children: e.column.aggregate ? /* @__PURE__ */ I(dt, { cell: e }) : e.column === o ? /* @__PURE__ */ I(a, {
|
|
1434
1435
|
component: `${t.componentName}.footer.label`,
|
|
1435
1436
|
px: 3,
|
|
1436
1437
|
textWrap: "nowrap",
|
|
@@ -1440,16 +1441,17 @@ function ft(e) {
|
|
|
1440
1441
|
})
|
|
1441
1442
|
});
|
|
1442
1443
|
}
|
|
1443
|
-
|
|
1444
|
+
pt.displayName = "DataGridFooter";
|
|
1445
|
+
var mt = k(pt);
|
|
1444
1446
|
//#endregion
|
|
1445
1447
|
//#region src/icons/expandIcon.tsx
|
|
1446
1448
|
function Y(e) {
|
|
1447
|
-
return /* @__PURE__ */
|
|
1449
|
+
return /* @__PURE__ */ I(m, {
|
|
1448
1450
|
viewBox: "4 2 16 18",
|
|
1449
1451
|
width: "1rem",
|
|
1450
1452
|
fill: "currentColor",
|
|
1451
1453
|
...e,
|
|
1452
|
-
children: /* @__PURE__ */
|
|
1454
|
+
children: /* @__PURE__ */ I(p, {
|
|
1453
1455
|
fillRule: "evenodd",
|
|
1454
1456
|
d: "M12.707 14.707a1 1 0 0 1-1.414 0l-5-5a1 1 0 0 1 1.414-1.414L12 12.586l4.293-4.293a1 1 0 1 1 1.414 1.414l-5 5Z",
|
|
1455
1457
|
props: { clipRule: "evenodd" }
|
|
@@ -1458,32 +1460,32 @@ function Y(e) {
|
|
|
1458
1460
|
}
|
|
1459
1461
|
//#endregion
|
|
1460
1462
|
//#region src/components/dataGrid/components/dataGridCellPlaceholder.tsx
|
|
1461
|
-
var
|
|
1463
|
+
var ht = [
|
|
1462
1464
|
"3/5",
|
|
1463
1465
|
"2/5",
|
|
1464
1466
|
"4/5",
|
|
1465
1467
|
"1/2",
|
|
1466
1468
|
"7/12"
|
|
1467
1469
|
];
|
|
1468
|
-
function
|
|
1469
|
-
let { cell: t, columnIndex: n } = e, r =
|
|
1470
|
-
return /* @__PURE__ */
|
|
1470
|
+
function gt(e) {
|
|
1471
|
+
let { cell: t, columnIndex: n } = e, r = ht[(t.row.rowIndex + n) % ht.length];
|
|
1472
|
+
return /* @__PURE__ */ I(_, {
|
|
1471
1473
|
component: `${t.grid.componentName}.body.cell.placeholder`,
|
|
1472
1474
|
ai: "center",
|
|
1473
1475
|
px: 3,
|
|
1474
1476
|
props: { "aria-hidden": !0 },
|
|
1475
|
-
children: /* @__PURE__ */
|
|
1477
|
+
children: /* @__PURE__ */ I(a, {
|
|
1476
1478
|
component: `${t.grid.componentName}.body.cell.placeholder.bar`,
|
|
1477
1479
|
width: r
|
|
1478
1480
|
})
|
|
1479
1481
|
});
|
|
1480
1482
|
}
|
|
1481
|
-
|
|
1483
|
+
gt.displayName = "DataGridCellPlaceholder";
|
|
1482
1484
|
//#endregion
|
|
1483
1485
|
//#region src/components/dataGrid/components/dataGridGroupRow.tsx
|
|
1484
|
-
function
|
|
1485
|
-
let { row: t, index: n } = e, { selected: r, indeterminate: i, expanded: o, placeholder: s } = t, c = (
|
|
1486
|
-
return /* @__PURE__ */
|
|
1486
|
+
function _t(e) {
|
|
1487
|
+
let { row: t, index: n } = e, { selected: r, indeterminate: i, expanded: o, placeholder: s } = t, c = (R()?.headerRowCount ?? 0) + n, l = A(() => t.toggleSelectAll(), [t]);
|
|
1488
|
+
return /* @__PURE__ */ I(_, {
|
|
1487
1489
|
component: `${t.grid.componentName}.body.groupRow`,
|
|
1488
1490
|
className: "grid-row",
|
|
1489
1491
|
selected: t.grid.props.def.rowSelection ? r : void 0,
|
|
@@ -1496,7 +1498,7 @@ function ht(e) {
|
|
|
1496
1498
|
},
|
|
1497
1499
|
children: t.renderedCells.map(({ cell: e, columnIndex: n }, u) => {
|
|
1498
1500
|
switch (e.cellKind) {
|
|
1499
|
-
case "grouping": return /* @__PURE__ */
|
|
1501
|
+
case "grouping": return /* @__PURE__ */ I(J, {
|
|
1500
1502
|
cell: e,
|
|
1501
1503
|
row: c,
|
|
1502
1504
|
columnIndex: u,
|
|
@@ -1509,14 +1511,14 @@ function ht(e) {
|
|
|
1509
1511
|
be: e.hasGroupingBorder ? 1 : void 0,
|
|
1510
1512
|
gridColumn: e.gridColumnSpan,
|
|
1511
1513
|
ps: e.depthPadding,
|
|
1512
|
-
overflow: "
|
|
1513
|
-
children: s ? /* @__PURE__ */
|
|
1514
|
+
overflow: "hidden",
|
|
1515
|
+
children: s ? /* @__PURE__ */ I(gt, {
|
|
1514
1516
|
cell: e,
|
|
1515
1517
|
columnIndex: u
|
|
1516
|
-
}) : /* @__PURE__ */
|
|
1518
|
+
}) : /* @__PURE__ */ I(a, {
|
|
1517
1519
|
textWrap: "nowrap",
|
|
1518
1520
|
px: 3,
|
|
1519
|
-
children: /* @__PURE__ */
|
|
1521
|
+
children: /* @__PURE__ */ L(h, {
|
|
1520
1522
|
component: `${t.grid.componentName}.body.groupRow.expandButton`,
|
|
1521
1523
|
onClick: () => t.toggleRow(),
|
|
1522
1524
|
cursor: "pointer",
|
|
@@ -1527,7 +1529,7 @@ function ht(e) {
|
|
|
1527
1529
|
tabIndex: -1,
|
|
1528
1530
|
"aria-expanded": o
|
|
1529
1531
|
},
|
|
1530
|
-
children: [/* @__PURE__ */
|
|
1532
|
+
children: [/* @__PURE__ */ I(Y, {
|
|
1531
1533
|
fill: "currentColor",
|
|
1532
1534
|
width: "14px",
|
|
1533
1535
|
height: "14px",
|
|
@@ -1536,12 +1538,12 @@ function ht(e) {
|
|
|
1536
1538
|
})
|
|
1537
1539
|
})
|
|
1538
1540
|
}, e.column.key);
|
|
1539
|
-
case "selection": return /* @__PURE__ */
|
|
1541
|
+
case "selection": return /* @__PURE__ */ I(J, {
|
|
1540
1542
|
cell: e,
|
|
1541
1543
|
row: c,
|
|
1542
1544
|
columnIndex: u,
|
|
1543
1545
|
ariaColIndex: n + 1,
|
|
1544
|
-
children: /* @__PURE__ */
|
|
1546
|
+
children: /* @__PURE__ */ I(v, {
|
|
1545
1547
|
variant: "datagrid",
|
|
1546
1548
|
m: 1,
|
|
1547
1549
|
checked: r,
|
|
@@ -1553,14 +1555,14 @@ function ht(e) {
|
|
|
1553
1555
|
}
|
|
1554
1556
|
})
|
|
1555
1557
|
}, e.column.key);
|
|
1556
|
-
case "aggregate": return /* @__PURE__ */
|
|
1558
|
+
case "aggregate": return /* @__PURE__ */ I(J, {
|
|
1557
1559
|
cell: e,
|
|
1558
1560
|
row: c,
|
|
1559
1561
|
columnIndex: u,
|
|
1560
1562
|
ariaColIndex: n + 1,
|
|
1561
|
-
children: e.aggregate && /* @__PURE__ */
|
|
1563
|
+
children: e.aggregate && /* @__PURE__ */ I(dt, { cell: e.aggregate })
|
|
1562
1564
|
}, e.column.key);
|
|
1563
|
-
case "spacer": return /* @__PURE__ */
|
|
1565
|
+
case "spacer": return /* @__PURE__ */ I(J, {
|
|
1564
1566
|
cell: e,
|
|
1565
1567
|
row: c,
|
|
1566
1568
|
columnIndex: u,
|
|
@@ -1573,21 +1575,21 @@ function ht(e) {
|
|
|
1573
1575
|
})
|
|
1574
1576
|
});
|
|
1575
1577
|
}
|
|
1576
|
-
|
|
1577
|
-
var
|
|
1578
|
-
function
|
|
1578
|
+
_t.displayName = "DataGridGroupRow";
|
|
1579
|
+
var vt = k(_t), yt = "input:not([type=\"hidden\"]),select,textarea,button,[role=\"spinbutton\"]";
|
|
1580
|
+
function bt(e) {
|
|
1579
1581
|
let { options: t } = e.editor;
|
|
1580
1582
|
return typeof t == "function" ? t(e.row.data) : t ?? [];
|
|
1581
1583
|
}
|
|
1582
|
-
function
|
|
1583
|
-
let { cell: t, row: n, columnIndex: i } = e, { grid: a } = t, o =
|
|
1584
|
+
function xt(e) {
|
|
1585
|
+
let { cell: t, row: n, columnIndex: i } = e, { grid: a } = t, o = R(), s = N(null), c = d("datagrid-cell-error"), { error: l, pending: u } = t;
|
|
1584
1586
|
r(() => {
|
|
1585
|
-
let e = s.current?.querySelector(
|
|
1587
|
+
let e = s.current?.querySelector(yt);
|
|
1586
1588
|
e?.focus(), e instanceof HTMLInputElement && e.type !== "checkbox" && e.select();
|
|
1587
1589
|
}, []);
|
|
1588
|
-
let f =
|
|
1590
|
+
let f = A(() => {
|
|
1589
1591
|
s.current?.closest("[role=\"gridcell\"]")?.focus();
|
|
1590
|
-
}, []), p =
|
|
1592
|
+
}, []), p = A((e) => {
|
|
1591
1593
|
if (!o) return;
|
|
1592
1594
|
let t = a.edits.nextEditable(n - o.headerRowCount, i, e.shiftKey);
|
|
1593
1595
|
t && (e.preventDefault(), o.setActiveCell(t.row + o.headerRowCount, t.column, { reason: "programmatic" }), a.edits.beginAt(t.row, t.column));
|
|
@@ -1596,7 +1598,7 @@ function yt(e) {
|
|
|
1596
1598
|
a,
|
|
1597
1599
|
o,
|
|
1598
1600
|
n
|
|
1599
|
-
]), m =
|
|
1601
|
+
]), m = A((e) => {
|
|
1600
1602
|
if (e.key === "Escape") {
|
|
1601
1603
|
if (s.current?.querySelector("[aria-expanded=\"true\"]")) return;
|
|
1602
1604
|
e.preventDefault(), e.stopPropagation(), t.cancelEdit(), f();
|
|
@@ -1617,10 +1619,10 @@ function yt(e) {
|
|
|
1617
1619
|
t,
|
|
1618
1620
|
f,
|
|
1619
1621
|
p
|
|
1620
|
-
]), h =
|
|
1622
|
+
]), h = A(() => {
|
|
1621
1623
|
!t.editing || t.pending || t.commitEdit();
|
|
1622
1624
|
}, [t]);
|
|
1623
|
-
return /* @__PURE__ */
|
|
1625
|
+
return /* @__PURE__ */ L(_, {
|
|
1624
1626
|
ref: s,
|
|
1625
1627
|
component: `${a.componentName}.body.cell.editor`,
|
|
1626
1628
|
variant: { isPending: u },
|
|
@@ -1628,12 +1630,12 @@ function yt(e) {
|
|
|
1628
1630
|
width: "fit",
|
|
1629
1631
|
height: "fit",
|
|
1630
1632
|
ai: "center",
|
|
1631
|
-
children: [/* @__PURE__ */
|
|
1633
|
+
children: [/* @__PURE__ */ I(St, {
|
|
1632
1634
|
cell: t,
|
|
1633
1635
|
errorId: l ? c : void 0,
|
|
1634
1636
|
onBlur: h,
|
|
1635
1637
|
onCommitted: f
|
|
1636
|
-
}), l && /* @__PURE__ */
|
|
1638
|
+
}), l && /* @__PURE__ */ I(y, {
|
|
1637
1639
|
anchor: s,
|
|
1638
1640
|
side: "bottom",
|
|
1639
1641
|
align: "start",
|
|
@@ -1646,14 +1648,14 @@ function yt(e) {
|
|
|
1646
1648
|
})]
|
|
1647
1649
|
});
|
|
1648
1650
|
}
|
|
1649
|
-
function
|
|
1651
|
+
function St(e) {
|
|
1650
1652
|
let { cell: t, errorId: n, onBlur: r, onCommitted: i } = e, { EditCell: a } = t.column.def, { type: o, placeholder: s, step: c, min: l, max: u } = t.editor, d = t.column.header ?? t.column.key, p = {
|
|
1651
1653
|
"aria-label": t.grid.localeText.editCell(String(d)),
|
|
1652
1654
|
"aria-invalid": n ? !0 : void 0,
|
|
1653
1655
|
"aria-describedby": n
|
|
1654
|
-
}, m =
|
|
1655
|
-
if (a) return /* @__PURE__ */
|
|
1656
|
-
if (o === "checkbox") return /* @__PURE__ */
|
|
1656
|
+
}, m = z(Fe(o));
|
|
1657
|
+
if (a) return /* @__PURE__ */ I(a, { cell: t });
|
|
1658
|
+
if (o === "checkbox") return /* @__PURE__ */ I(v, {
|
|
1657
1659
|
checked: !!t.draft,
|
|
1658
1660
|
onChange: (e) => {
|
|
1659
1661
|
t.setDraft(e.target.checked), t.commitEdit(), i();
|
|
@@ -1663,7 +1665,7 @@ function bt(e) {
|
|
|
1663
1665
|
onBlur: r
|
|
1664
1666
|
}
|
|
1665
1667
|
});
|
|
1666
|
-
if (o === "select") return /* @__PURE__ */
|
|
1668
|
+
if (o === "select") return /* @__PURE__ */ I(f, { children: /* @__PURE__ */ I(w, {
|
|
1667
1669
|
value: t.draft,
|
|
1668
1670
|
defaultOpen: !0,
|
|
1669
1671
|
width: "fit",
|
|
@@ -1675,19 +1677,19 @@ function bt(e) {
|
|
|
1675
1677
|
t.setDraft(e ?? null), t.commitEdit(), i();
|
|
1676
1678
|
},
|
|
1677
1679
|
props: p,
|
|
1678
|
-
children:
|
|
1680
|
+
children: bt(t).map((e) => /* @__PURE__ */ I(w.Item, {
|
|
1679
1681
|
value: e.value,
|
|
1680
1682
|
children: e.label ?? String(e.value)
|
|
1681
1683
|
}, String(e.value)))
|
|
1682
1684
|
}) });
|
|
1683
|
-
if (
|
|
1685
|
+
if (Fe(o)) return m ? /* @__PURE__ */ I(m.DateEditor, {
|
|
1684
1686
|
cell: t,
|
|
1685
1687
|
label: p["aria-label"],
|
|
1686
1688
|
errorId: n,
|
|
1687
1689
|
onBlur: r
|
|
1688
1690
|
}) : null;
|
|
1689
1691
|
let h = o === "number";
|
|
1690
|
-
return /* @__PURE__ */
|
|
1692
|
+
return /* @__PURE__ */ I(x, {
|
|
1691
1693
|
type: h ? "number" : "text",
|
|
1692
1694
|
value: t.draft === null || t.draft === void 0 ? "" : String(t.draft),
|
|
1693
1695
|
placeholder: s,
|
|
@@ -1709,84 +1711,84 @@ function bt(e) {
|
|
|
1709
1711
|
}
|
|
1710
1712
|
});
|
|
1711
1713
|
}
|
|
1712
|
-
|
|
1714
|
+
xt.displayName = "DataGridCellEditor";
|
|
1713
1715
|
//#endregion
|
|
1714
1716
|
//#region src/components/dataGrid/components/dataGridBooleanValue.tsx
|
|
1715
|
-
function
|
|
1717
|
+
function Ct(e) {
|
|
1716
1718
|
let { value: t, text: n } = e;
|
|
1717
|
-
return /* @__PURE__ */
|
|
1719
|
+
return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(m, {
|
|
1718
1720
|
viewBox: "0 0 16 16",
|
|
1719
1721
|
width: "1rem",
|
|
1720
1722
|
height: "1rem",
|
|
1721
1723
|
css: { verticalAlign: "middle" },
|
|
1722
1724
|
color: t ? void 0 : "base-400",
|
|
1723
1725
|
props: { fill: "none" },
|
|
1724
|
-
children: /* @__PURE__ */
|
|
1726
|
+
children: /* @__PURE__ */ I(p, {
|
|
1725
1727
|
d: t ? "m3.5 8.5 3 3 6-7" : "m5 5 6 6m0-6-6 6",
|
|
1726
1728
|
stroke: "currentColor",
|
|
1727
1729
|
strokeWidth: 1.75,
|
|
1728
1730
|
strokeLinecap: "round",
|
|
1729
1731
|
strokeLinejoin: "round"
|
|
1730
1732
|
})
|
|
1731
|
-
}), /* @__PURE__ */
|
|
1733
|
+
}), /* @__PURE__ */ I(g, {
|
|
1732
1734
|
tag: "span",
|
|
1733
1735
|
children: t ? n.booleanTrue : n.booleanFalse
|
|
1734
1736
|
})] });
|
|
1735
1737
|
}
|
|
1736
|
-
|
|
1738
|
+
Ct.displayName = "DataGridBooleanValue";
|
|
1737
1739
|
//#endregion
|
|
1738
1740
|
//#region src/components/dataGrid/components/dataGridDateValue.tsx
|
|
1739
|
-
function
|
|
1741
|
+
function wt(e, t) {
|
|
1740
1742
|
if (e.def.dateFormat) return e.def.dateFormat;
|
|
1741
1743
|
let { editor: n } = e.def, r = typeof n == "object" ? n.type : n;
|
|
1742
|
-
return r &&
|
|
1744
|
+
return r && Fe(r) ? r : t instanceof Date ? "datetime" : null;
|
|
1743
1745
|
}
|
|
1744
|
-
function
|
|
1745
|
-
let { value: t, format: n } = e, r =
|
|
1746
|
-
return r ? /* @__PURE__ */
|
|
1746
|
+
function Tt(e) {
|
|
1747
|
+
let { value: t, format: n } = e, r = z(!0);
|
|
1748
|
+
return r ? /* @__PURE__ */ I(r.DateValue, {
|
|
1747
1749
|
value: t,
|
|
1748
1750
|
format: n
|
|
1749
|
-
}) : /* @__PURE__ */
|
|
1751
|
+
}) : /* @__PURE__ */ I(F, { children: t instanceof Date ? t.toISOString() : t == null ? "" : String(t) });
|
|
1750
1752
|
}
|
|
1751
|
-
|
|
1753
|
+
Tt.displayName = "DataGridDateValue";
|
|
1752
1754
|
//#endregion
|
|
1753
1755
|
//#region src/components/dataGrid/components/dataGridCellText.tsx
|
|
1754
|
-
function
|
|
1755
|
-
let { cell: t } = e, { value: n } = t, r =
|
|
1756
|
-
return /* @__PURE__ */
|
|
1756
|
+
function Et(e) {
|
|
1757
|
+
let { cell: t } = e, { value: n } = t, r = wt(t.column, n);
|
|
1758
|
+
return /* @__PURE__ */ I(_, {
|
|
1757
1759
|
component: `${t.grid.componentName}.body.cell.text`,
|
|
1758
1760
|
height: "fit",
|
|
1759
1761
|
width: "fit",
|
|
1760
|
-
overflow: "
|
|
1762
|
+
overflow: "hidden",
|
|
1761
1763
|
ai: "center",
|
|
1762
1764
|
jc: t.column.align,
|
|
1763
|
-
children: /* @__PURE__ */
|
|
1765
|
+
children: /* @__PURE__ */ I(a, {
|
|
1764
1766
|
px: 3,
|
|
1765
1767
|
textOverflow: "ellipsis",
|
|
1766
1768
|
overflow: "hidden",
|
|
1767
1769
|
textWrap: "nowrap",
|
|
1768
|
-
children: typeof n == "boolean" ? /* @__PURE__ */
|
|
1770
|
+
children: typeof n == "boolean" ? /* @__PURE__ */ I(Ct, {
|
|
1769
1771
|
value: n,
|
|
1770
1772
|
text: t.grid.localeText
|
|
1771
|
-
}) : r ? /* @__PURE__ */
|
|
1773
|
+
}) : r ? /* @__PURE__ */ I(Tt, {
|
|
1772
1774
|
value: n,
|
|
1773
1775
|
format: r
|
|
1774
1776
|
}) : n
|
|
1775
1777
|
})
|
|
1776
1778
|
});
|
|
1777
1779
|
}
|
|
1778
|
-
|
|
1780
|
+
Et.displayName = "DataGridCellText";
|
|
1779
1781
|
//#endregion
|
|
1780
1782
|
//#region src/components/dataGrid/components/dataGridCellTree.tsx
|
|
1781
|
-
function
|
|
1782
|
-
let { cell: t, row: n, children: r } = e, { hasChildren: i, treeExpanded: o, level: s } = n, c = n.grid.componentName, l =
|
|
1783
|
+
function Dt(e) {
|
|
1784
|
+
let { cell: t, row: n, children: r } = e, { hasChildren: i, treeExpanded: o, level: s } = n, c = n.grid.componentName, l = A((e) => {
|
|
1783
1785
|
e.stopPropagation(), n.toggleTree();
|
|
1784
1786
|
}, [n]), u = t.value == null || t.value === "" ? t.grid.localeText.unnamedRow(n.rowIndex + 1) : String(t.value);
|
|
1785
|
-
return /* @__PURE__ */
|
|
1787
|
+
return /* @__PURE__ */ L(_, {
|
|
1786
1788
|
component: `${c}.body.cell.tree`,
|
|
1787
1789
|
ai: "center",
|
|
1788
1790
|
ps: s * n.grid.tree.indent,
|
|
1789
|
-
children: [i ? /* @__PURE__ */
|
|
1791
|
+
children: [i ? /* @__PURE__ */ I(h, {
|
|
1790
1792
|
component: `${c}.body.cell.tree.toggle`,
|
|
1791
1793
|
variant: { isExpanded: o },
|
|
1792
1794
|
type: "button",
|
|
@@ -1799,13 +1801,13 @@ function Tt(e) {
|
|
|
1799
1801
|
tabIndex: -1,
|
|
1800
1802
|
"aria-label": (o ? t.grid.localeText.collapseTreeRow : t.grid.localeText.expandTreeRow)(u)
|
|
1801
1803
|
},
|
|
1802
|
-
children: /* @__PURE__ */
|
|
1804
|
+
children: /* @__PURE__ */ I(Y, {
|
|
1803
1805
|
fill: "currentColor",
|
|
1804
1806
|
width: "14px",
|
|
1805
1807
|
height: "14px",
|
|
1806
1808
|
rotate: o ? 0 : -90
|
|
1807
1809
|
})
|
|
1808
|
-
}) : /* @__PURE__ */
|
|
1810
|
+
}) : /* @__PURE__ */ I(a, { component: `${c}.body.cell.tree.spacer` }), /* @__PURE__ */ I(a, {
|
|
1809
1811
|
textOverflow: "ellipsis",
|
|
1810
1812
|
overflow: "hidden",
|
|
1811
1813
|
textWrap: "nowrap",
|
|
@@ -1814,29 +1816,29 @@ function Tt(e) {
|
|
|
1814
1816
|
})]
|
|
1815
1817
|
});
|
|
1816
1818
|
}
|
|
1817
|
-
|
|
1819
|
+
Dt.displayName = "DataGridCellTree";
|
|
1818
1820
|
//#endregion
|
|
1819
1821
|
//#region src/components/dataGrid/components/dataGridRow.tsx
|
|
1820
|
-
function
|
|
1821
|
-
let { row: t, index: n } = e, { selected: r, expandOnRowClick: i } = t, a = (
|
|
1822
|
+
function Ot(e) {
|
|
1823
|
+
let { row: t, index: n } = e, { selected: r, expandOnRowClick: i } = t, a = (R()?.headerRowCount ?? 0) + n, o = U(t) ? t : void 0, s = o && t.grid.tree.columnKey, c = A(() => {
|
|
1822
1824
|
t.toggleDetail();
|
|
1823
1825
|
}, [t]), l = (e, n) => {
|
|
1824
|
-
if (e.editing) return /* @__PURE__ */
|
|
1826
|
+
if (e.editing) return /* @__PURE__ */ I(xt, {
|
|
1825
1827
|
cell: e,
|
|
1826
1828
|
row: a,
|
|
1827
1829
|
columnIndex: n
|
|
1828
1830
|
});
|
|
1829
|
-
let r = t.placeholder && !e.column.isRowNumber ? /* @__PURE__ */
|
|
1831
|
+
let r = t.placeholder && !e.column.isRowNumber ? /* @__PURE__ */ I(gt, {
|
|
1830
1832
|
cell: e,
|
|
1831
1833
|
columnIndex: n
|
|
1832
|
-
}) : e.column.Cell ? /* @__PURE__ */
|
|
1833
|
-
return !o || e.column.key !== s ? r : /* @__PURE__ */
|
|
1834
|
+
}) : e.column.Cell ? /* @__PURE__ */ I(e.column.Cell, { cell: e }) : /* @__PURE__ */ I(Et, { cell: e });
|
|
1835
|
+
return !o || e.column.key !== s ? r : /* @__PURE__ */ I(Dt, {
|
|
1834
1836
|
cell: e,
|
|
1835
1837
|
row: o,
|
|
1836
1838
|
children: r
|
|
1837
1839
|
});
|
|
1838
1840
|
};
|
|
1839
|
-
return /* @__PURE__ */
|
|
1841
|
+
return /* @__PURE__ */ I(_, {
|
|
1840
1842
|
component: `${t.grid.componentName}.body.row`,
|
|
1841
1843
|
className: "grid-row",
|
|
1842
1844
|
selected: t.grid.props.def.rowSelection ? r : void 0,
|
|
@@ -1852,7 +1854,7 @@ function Et(e) {
|
|
|
1852
1854
|
onClick: i ? c : void 0
|
|
1853
1855
|
},
|
|
1854
1856
|
cursor: i ? "pointer" : void 0,
|
|
1855
|
-
children: t.cells.map((e, t) => /* @__PURE__ */
|
|
1857
|
+
children: t.cells.map((e, t) => /* @__PURE__ */ I(J, {
|
|
1856
1858
|
cell: e,
|
|
1857
1859
|
row: a,
|
|
1858
1860
|
columnIndex: t,
|
|
@@ -1860,27 +1862,27 @@ function Et(e) {
|
|
|
1860
1862
|
}, e.column.key))
|
|
1861
1863
|
});
|
|
1862
1864
|
}
|
|
1863
|
-
|
|
1864
|
-
var
|
|
1865
|
+
Ot.displayName = "DataGridRow";
|
|
1866
|
+
var kt = k(Ot);
|
|
1865
1867
|
//#endregion
|
|
1866
1868
|
//#region src/components/dataGrid/components/dataGridBody.tsx
|
|
1867
|
-
function
|
|
1868
|
-
return e instanceof
|
|
1869
|
+
function At(e, t, n) {
|
|
1870
|
+
return e instanceof Ue ? /* @__PURE__ */ I(ut, {
|
|
1869
1871
|
row: e,
|
|
1870
1872
|
index: t,
|
|
1871
1873
|
version: n
|
|
1872
|
-
}, e.key) : e instanceof
|
|
1874
|
+
}, e.key) : e instanceof ct ? /* @__PURE__ */ I(vt, {
|
|
1873
1875
|
row: e,
|
|
1874
1876
|
index: t,
|
|
1875
1877
|
version: n
|
|
1876
|
-
}, e.key) : /* @__PURE__ */
|
|
1878
|
+
}, e.key) : /* @__PURE__ */ I(kt, {
|
|
1877
1879
|
row: e,
|
|
1878
1880
|
index: t,
|
|
1879
1881
|
version: n
|
|
1880
1882
|
}, e.key);
|
|
1881
1883
|
}
|
|
1882
|
-
function
|
|
1883
|
-
let { grid: t, scroll: n } = e, { viewport: r } = t, { startIndex: i, take: o, translateY: s, totalHeight: c, viewHeight: l } = r.window(n.top, n.direction), u = r.showAll, d = r.isEmpty, f = t.flatRows.value, p = t.getSnapshot(), m =
|
|
1884
|
+
function jt(e) {
|
|
1885
|
+
let { grid: t, scroll: n } = e, { viewport: r } = t, { startIndex: i, take: o, translateY: s, totalHeight: c, viewHeight: l } = r.window(n.top, n.direction), u = r.showAll, d = r.isEmpty, f = t.flatRows.value, p = t.getSnapshot(), m = ae(() => d ? null : W.take(f, o, i).map((e, n) => At(e, i + n, t.rowVersion(e, i + n))), [
|
|
1884
1886
|
f,
|
|
1885
1887
|
t,
|
|
1886
1888
|
d,
|
|
@@ -1890,23 +1892,24 @@ function kt(e) {
|
|
|
1890
1892
|
]);
|
|
1891
1893
|
if (d) {
|
|
1892
1894
|
let { noDataComponent: e } = t.props.def, n = t.props.loading ? t.localeText.loadingRows : t.localeText.noRows;
|
|
1893
|
-
return /* @__PURE__ */
|
|
1895
|
+
return /* @__PURE__ */ I(_, {
|
|
1894
1896
|
component: `${t.componentName}.body.empty`,
|
|
1895
1897
|
jc: "center",
|
|
1896
1898
|
ai: "center",
|
|
1897
1899
|
width: "fit",
|
|
1898
1900
|
position: "sticky",
|
|
1899
1901
|
insetStart: 0,
|
|
1902
|
+
transition: "none",
|
|
1900
1903
|
props: { role: "row" },
|
|
1901
1904
|
style: { height: r.emptyHeight },
|
|
1902
|
-
children: /* @__PURE__ */
|
|
1905
|
+
children: /* @__PURE__ */ I(a, {
|
|
1903
1906
|
display: "contents",
|
|
1904
1907
|
props: { role: "gridcell" },
|
|
1905
1908
|
children: e ?? n
|
|
1906
1909
|
})
|
|
1907
1910
|
});
|
|
1908
1911
|
}
|
|
1909
|
-
return u ? /* @__PURE__ */
|
|
1912
|
+
return u ? /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(C, {
|
|
1910
1913
|
component: `${t.componentName}.body`,
|
|
1911
1914
|
width: "max-content",
|
|
1912
1915
|
minWidth: "fit",
|
|
@@ -1915,13 +1918,18 @@ function kt(e) {
|
|
|
1915
1918
|
props: { role: "rowgroup" },
|
|
1916
1919
|
style: { gridTemplateColumns: t.gridTemplateColumns.value },
|
|
1917
1920
|
children: m
|
|
1918
|
-
}), /* @__PURE__ */
|
|
1921
|
+
}), /* @__PURE__ */ I(mt, {
|
|
1922
|
+
grid: t,
|
|
1923
|
+
version: t.headerVersion
|
|
1924
|
+
})] }) : /* @__PURE__ */ L(a, {
|
|
1925
|
+
transition: "none",
|
|
1919
1926
|
props: { role: "presentation" },
|
|
1920
1927
|
style: { height: l },
|
|
1921
|
-
children: [/* @__PURE__ */
|
|
1928
|
+
children: [/* @__PURE__ */ I(a, {
|
|
1929
|
+
transition: "none",
|
|
1922
1930
|
props: { role: "presentation" },
|
|
1923
1931
|
style: { height: `${c}px` },
|
|
1924
|
-
children: /* @__PURE__ */
|
|
1932
|
+
children: /* @__PURE__ */ I(C, {
|
|
1925
1933
|
component: `${t.componentName}.body`,
|
|
1926
1934
|
width: "max-content",
|
|
1927
1935
|
minWidth: "fit",
|
|
@@ -1935,15 +1943,18 @@ function kt(e) {
|
|
|
1935
1943
|
},
|
|
1936
1944
|
children: m
|
|
1937
1945
|
})
|
|
1938
|
-
}), /* @__PURE__ */
|
|
1946
|
+
}), /* @__PURE__ */ I(mt, {
|
|
1947
|
+
grid: t,
|
|
1948
|
+
version: t.headerVersion
|
|
1949
|
+
})]
|
|
1939
1950
|
});
|
|
1940
1951
|
}
|
|
1941
|
-
|
|
1952
|
+
jt.displayName = "DataGridBody";
|
|
1942
1953
|
//#endregion
|
|
1943
1954
|
//#region src/components/dataGrid/components/dataGridEmptyColumns.tsx
|
|
1944
|
-
function
|
|
1955
|
+
function Mt(e) {
|
|
1945
1956
|
let { grid: t } = e;
|
|
1946
|
-
return /* @__PURE__ */
|
|
1957
|
+
return /* @__PURE__ */ I(_, {
|
|
1947
1958
|
component: `${t.componentName}.emptyColumns`,
|
|
1948
1959
|
d: "column",
|
|
1949
1960
|
ai: "center",
|
|
@@ -1954,11 +1965,11 @@ function At(e) {
|
|
|
1954
1965
|
bgColor: "base-50",
|
|
1955
1966
|
borderRadius: 4,
|
|
1956
1967
|
theme: { dark: { bgColor: "base-900" } },
|
|
1957
|
-
children: /* @__PURE__ */
|
|
1968
|
+
children: /* @__PURE__ */ L(_, {
|
|
1958
1969
|
d: "column",
|
|
1959
1970
|
ai: "center",
|
|
1960
1971
|
gap: 3,
|
|
1961
|
-
children: [/* @__PURE__ */
|
|
1972
|
+
children: [/* @__PURE__ */ I(a, {
|
|
1962
1973
|
width: 16,
|
|
1963
1974
|
height: 16,
|
|
1964
1975
|
borderRadius: 999,
|
|
@@ -1967,29 +1978,29 @@ function At(e) {
|
|
|
1967
1978
|
display: "flex",
|
|
1968
1979
|
ai: "center",
|
|
1969
1980
|
jc: "center",
|
|
1970
|
-
children: /* @__PURE__ */
|
|
1981
|
+
children: /* @__PURE__ */ I(m, {
|
|
1971
1982
|
viewBox: "0 0 24 24",
|
|
1972
1983
|
width: "40",
|
|
1973
1984
|
fill: "currentColor",
|
|
1974
1985
|
color: "base-400",
|
|
1975
1986
|
theme: { dark: { color: "base-500" } },
|
|
1976
|
-
children: /* @__PURE__ */
|
|
1987
|
+
children: /* @__PURE__ */ I(p, {
|
|
1977
1988
|
fillRule: "evenodd",
|
|
1978
1989
|
props: { clipRule: "evenodd" },
|
|
1979
1990
|
d: "M3 6a3 3 0 013-3h12a3 3 0 013 3v12a3 3 0 01-3 3H6a3 3 0 01-3-3V6zm3-1a1 1 0 00-1 1v12a1 1 0 001 1h12a1 1 0 001-1V6a1 1 0 00-1-1H6zm2 3a1 1 0 011-1h6a1 1 0 110 2H9a1 1 0 01-1-1zm0 4a1 1 0 011-1h6a1 1 0 110 2H9a1 1 0 01-1-1zm0 4a1 1 0 011-1h4a1 1 0 110 2H9a1 1 0 01-1-1z"
|
|
1980
1991
|
})
|
|
1981
1992
|
})
|
|
1982
|
-
}), /* @__PURE__ */
|
|
1993
|
+
}), /* @__PURE__ */ L(_, {
|
|
1983
1994
|
d: "column",
|
|
1984
1995
|
ai: "center",
|
|
1985
1996
|
gap: 1,
|
|
1986
|
-
children: [/* @__PURE__ */
|
|
1997
|
+
children: [/* @__PURE__ */ I(a, {
|
|
1987
1998
|
fontSize: 18,
|
|
1988
1999
|
fontWeight: 600,
|
|
1989
2000
|
color: "base-900",
|
|
1990
2001
|
theme: { dark: { color: "base-50" } },
|
|
1991
2002
|
children: t.localeText.noColumnsTitle
|
|
1992
|
-
}), /* @__PURE__ */
|
|
2003
|
+
}), /* @__PURE__ */ I(a, {
|
|
1993
2004
|
fontSize: 14,
|
|
1994
2005
|
color: "base-500",
|
|
1995
2006
|
textAlign: "center",
|
|
@@ -2002,7 +2013,7 @@ function At(e) {
|
|
|
2002
2013
|
}
|
|
2003
2014
|
//#endregion
|
|
2004
2015
|
//#region src/utils/dataGrid/headerCellUtils.ts
|
|
2005
|
-
var
|
|
2016
|
+
var Nt;
|
|
2006
2017
|
(function(e) {
|
|
2007
2018
|
let t = e.CELL_SELECTOR = "[role=\"columnheader\"][aria-sort]", n = ".resizer", r = `button, input, a, [role="menu"], [role="separator"], ${n}`;
|
|
2008
2019
|
function i(e, t) {
|
|
@@ -2077,8 +2088,8 @@ var jt;
|
|
|
2077
2088
|
} : e;
|
|
2078
2089
|
}
|
|
2079
2090
|
e.pause = u;
|
|
2080
|
-
})(
|
|
2081
|
-
var X =
|
|
2091
|
+
})(Nt ||= {});
|
|
2092
|
+
var X = Nt, Pt;
|
|
2082
2093
|
(function(e) {
|
|
2083
2094
|
function t(e, t) {
|
|
2084
2095
|
return (t?.type === "text" ? t.value : "") === (e.trim() ? e : "");
|
|
@@ -2105,18 +2116,18 @@ var X = jt, Mt;
|
|
|
2105
2116
|
return t.valueTo === void 0 ? isNaN(r) : t.valueTo === r;
|
|
2106
2117
|
}
|
|
2107
2118
|
e.numberMatches = r;
|
|
2108
|
-
})(
|
|
2109
|
-
var Z =
|
|
2110
|
-
function
|
|
2111
|
-
let i =
|
|
2119
|
+
})(Pt ||= {});
|
|
2120
|
+
var Z = Pt, Ft = 300;
|
|
2121
|
+
function It(e, t, n) {
|
|
2122
|
+
let i = N(/* @__PURE__ */ new Map()), a = A(() => {
|
|
2112
2123
|
for (let e of i.current.values()) clearTimeout(e);
|
|
2113
2124
|
i.current.clear();
|
|
2114
|
-
}, []), s =
|
|
2125
|
+
}, []), s = A((e, t) => {
|
|
2115
2126
|
clearTimeout(i.current.get(e)), i.current.set(e, setTimeout(() => {
|
|
2116
2127
|
i.current.delete(e), t();
|
|
2117
|
-
},
|
|
2128
|
+
}, Ft));
|
|
2118
2129
|
}, []);
|
|
2119
|
-
|
|
2130
|
+
M(() => a, [a]);
|
|
2120
2131
|
let c = o(() => {
|
|
2121
2132
|
t(e) || (a(), n(e));
|
|
2122
2133
|
});
|
|
@@ -2127,9 +2138,9 @@ function Pt(e, t, n) {
|
|
|
2127
2138
|
}
|
|
2128
2139
|
//#endregion
|
|
2129
2140
|
//#region src/components/dataGrid/components/dataGridColumnFilter.tsx
|
|
2130
|
-
function
|
|
2141
|
+
function Lt(e) {
|
|
2131
2142
|
let { label: t, onClear: n } = e;
|
|
2132
|
-
return /* @__PURE__ */
|
|
2143
|
+
return /* @__PURE__ */ I(h, {
|
|
2133
2144
|
clean: !0,
|
|
2134
2145
|
type: "button",
|
|
2135
2146
|
position: "absolute",
|
|
@@ -2144,7 +2155,7 @@ function Ft(e) {
|
|
|
2144
2155
|
tabIndex: -1,
|
|
2145
2156
|
"aria-label": t
|
|
2146
2157
|
},
|
|
2147
|
-
children: /* @__PURE__ */
|
|
2158
|
+
children: /* @__PURE__ */ I(a, {
|
|
2148
2159
|
fontSize: 10,
|
|
2149
2160
|
color: "base-400",
|
|
2150
2161
|
hover: { color: "base-600" },
|
|
@@ -2152,16 +2163,16 @@ function Ft(e) {
|
|
|
2152
2163
|
})
|
|
2153
2164
|
});
|
|
2154
2165
|
}
|
|
2155
|
-
function
|
|
2156
|
-
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), i = e.grid.localeText, [a, o] =
|
|
2166
|
+
function Rt({ column: e }) {
|
|
2167
|
+
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), i = e.grid.localeText, [a, o] = P(t?.type === "text" ? t.value : ""), { debounce: s, cancel: c } = It(t, (e) => Z.textMatches(a, e), (e) => o(e?.type === "text" ? e.value : "")), l = A((t) => {
|
|
2157
2168
|
let n = t.target.value;
|
|
2158
2169
|
o(n), s("value", () => e.setTextFilter(n));
|
|
2159
|
-
}, [e, s]), u =
|
|
2170
|
+
}, [e, s]), u = A(() => {
|
|
2160
2171
|
c(), o(""), e.clearFilter();
|
|
2161
2172
|
}, [e, c]);
|
|
2162
|
-
return /* @__PURE__ */
|
|
2173
|
+
return /* @__PURE__ */ L(_, {
|
|
2163
2174
|
component: `${n}.filter.cell.input`,
|
|
2164
|
-
children: [/* @__PURE__ */
|
|
2175
|
+
children: [/* @__PURE__ */ I(x, {
|
|
2165
2176
|
width: "fit",
|
|
2166
2177
|
variant: "compact",
|
|
2167
2178
|
placeholder: e.filterConfig?.placeholder ?? i.filterPlaceholder,
|
|
@@ -2174,19 +2185,19 @@ function It({ column: e }) {
|
|
|
2174
2185
|
tabIndex: -1,
|
|
2175
2186
|
"aria-label": i.filterColumn(r)
|
|
2176
2187
|
}
|
|
2177
|
-
}), a && /* @__PURE__ */
|
|
2188
|
+
}), a && /* @__PURE__ */ I(Lt, {
|
|
2178
2189
|
label: i.clearFilter(r),
|
|
2179
2190
|
onClear: u
|
|
2180
2191
|
})]
|
|
2181
2192
|
});
|
|
2182
2193
|
}
|
|
2183
|
-
function
|
|
2184
|
-
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), i = e.grid.localeText, [a, o] =
|
|
2194
|
+
function zt({ column: e }) {
|
|
2195
|
+
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), i = e.grid.localeText, [a, o] = P(() => Z.numberDraft(t)), s = N(a), c = A((e) => {
|
|
2185
2196
|
s.current = e, o(e);
|
|
2186
|
-
}, []), { debounce: l, cancel: u } =
|
|
2197
|
+
}, []), { debounce: l, cancel: u } = It(t, (e) => Z.numberMatches(a, e), (e) => c(Z.numberDraft(e))), { operator: d, value: p, valueTo: m } = a, h = e.filterConfig, g = A(() => {
|
|
2187
2198
|
let { operator: t, value: n, valueTo: r } = s.current;
|
|
2188
2199
|
e.setNumberFilter(t, n, r);
|
|
2189
|
-
}, [e]), v =
|
|
2200
|
+
}, [e]), v = A((e, t) => {
|
|
2190
2201
|
c({
|
|
2191
2202
|
...s.current,
|
|
2192
2203
|
...e
|
|
@@ -2196,18 +2207,18 @@ function Lt({ column: e }) {
|
|
|
2196
2207
|
g,
|
|
2197
2208
|
l,
|
|
2198
2209
|
u
|
|
2199
|
-
]), y =
|
|
2210
|
+
]), y = A((e) => v({ value: e.target.value }, !0), [v]), b = A((e) => v({ valueTo: e.target.value }, !0), [v]), S = A((e) => v({ operator: e }, !1), [v]), C = A(() => {
|
|
2200
2211
|
u(), c(Z.numberDraft(void 0)), e.clearFilter();
|
|
2201
2212
|
}, [
|
|
2202
2213
|
e,
|
|
2203
2214
|
u,
|
|
2204
2215
|
c
|
|
2205
2216
|
]);
|
|
2206
|
-
return /* @__PURE__ */
|
|
2217
|
+
return /* @__PURE__ */ L(_, {
|
|
2207
2218
|
component: `${n}.filter.cell.input`,
|
|
2208
2219
|
ai: d === "between" ? "start" : "center",
|
|
2209
2220
|
gap: 1,
|
|
2210
|
-
children: [/* @__PURE__ */
|
|
2221
|
+
children: [/* @__PURE__ */ I(f, { children: /* @__PURE__ */ L(w, {
|
|
2211
2222
|
value: d,
|
|
2212
2223
|
variant: "compact",
|
|
2213
2224
|
onChange: (e) => e && S(e),
|
|
@@ -2221,44 +2232,44 @@ function Lt({ column: e }) {
|
|
|
2221
2232
|
"aria-label": i.filterComparison(r)
|
|
2222
2233
|
},
|
|
2223
2234
|
children: [
|
|
2224
|
-
/* @__PURE__ */
|
|
2235
|
+
/* @__PURE__ */ I(w.Item, {
|
|
2225
2236
|
value: "eq",
|
|
2226
2237
|
children: "="
|
|
2227
2238
|
}),
|
|
2228
|
-
/* @__PURE__ */
|
|
2239
|
+
/* @__PURE__ */ I(w.Item, {
|
|
2229
2240
|
value: "ne",
|
|
2230
2241
|
children: "≠"
|
|
2231
2242
|
}),
|
|
2232
|
-
/* @__PURE__ */
|
|
2243
|
+
/* @__PURE__ */ I(w.Item, {
|
|
2233
2244
|
value: "gt",
|
|
2234
2245
|
children: ">"
|
|
2235
2246
|
}),
|
|
2236
|
-
/* @__PURE__ */
|
|
2247
|
+
/* @__PURE__ */ I(w.Item, {
|
|
2237
2248
|
value: "gte",
|
|
2238
2249
|
children: "≥"
|
|
2239
2250
|
}),
|
|
2240
|
-
/* @__PURE__ */
|
|
2251
|
+
/* @__PURE__ */ I(w.Item, {
|
|
2241
2252
|
value: "lt",
|
|
2242
2253
|
children: "<"
|
|
2243
2254
|
}),
|
|
2244
|
-
/* @__PURE__ */
|
|
2255
|
+
/* @__PURE__ */ I(w.Item, {
|
|
2245
2256
|
value: "lte",
|
|
2246
2257
|
children: "≤"
|
|
2247
2258
|
}),
|
|
2248
|
-
/* @__PURE__ */
|
|
2259
|
+
/* @__PURE__ */ I(w.Item, {
|
|
2249
2260
|
value: "between",
|
|
2250
2261
|
children: "↔"
|
|
2251
2262
|
})
|
|
2252
2263
|
]
|
|
2253
|
-
}) }), d === "between" ? /* @__PURE__ */
|
|
2264
|
+
}) }), d === "between" ? /* @__PURE__ */ L(_, {
|
|
2254
2265
|
d: "column",
|
|
2255
2266
|
gap: 1,
|
|
2256
2267
|
flex1: !0,
|
|
2257
|
-
children: [/* @__PURE__ */
|
|
2268
|
+
children: [/* @__PURE__ */ L(_, {
|
|
2258
2269
|
ai: "center",
|
|
2259
2270
|
position: "relative",
|
|
2260
2271
|
flex1: !0,
|
|
2261
|
-
children: [/* @__PURE__ */
|
|
2272
|
+
children: [/* @__PURE__ */ I(x, {
|
|
2262
2273
|
type: "number",
|
|
2263
2274
|
variant: "compact",
|
|
2264
2275
|
placeholder: h?.placeholder ?? i.filterFromPlaceholder,
|
|
@@ -2273,14 +2284,14 @@ function Lt({ column: e }) {
|
|
|
2273
2284
|
tabIndex: -1,
|
|
2274
2285
|
"aria-label": i.filterFrom(r)
|
|
2275
2286
|
}
|
|
2276
|
-
}), (p !== "" || m !== "") && /* @__PURE__ */
|
|
2287
|
+
}), (p !== "" || m !== "") && /* @__PURE__ */ I(Lt, {
|
|
2277
2288
|
label: i.clearFilter(r),
|
|
2278
2289
|
onClear: C
|
|
2279
2290
|
})]
|
|
2280
|
-
}), /* @__PURE__ */
|
|
2291
|
+
}), /* @__PURE__ */ I(_, {
|
|
2281
2292
|
ai: "center",
|
|
2282
2293
|
flex1: !0,
|
|
2283
|
-
children: /* @__PURE__ */
|
|
2294
|
+
children: /* @__PURE__ */ I(x, {
|
|
2284
2295
|
type: "number",
|
|
2285
2296
|
variant: "compact",
|
|
2286
2297
|
placeholder: i.filterToPlaceholder,
|
|
@@ -2297,11 +2308,11 @@ function Lt({ column: e }) {
|
|
|
2297
2308
|
}
|
|
2298
2309
|
})
|
|
2299
2310
|
})]
|
|
2300
|
-
}) : /* @__PURE__ */
|
|
2311
|
+
}) : /* @__PURE__ */ L(_, {
|
|
2301
2312
|
ai: "center",
|
|
2302
2313
|
position: "relative",
|
|
2303
2314
|
flex1: !0,
|
|
2304
|
-
children: [/* @__PURE__ */
|
|
2315
|
+
children: [/* @__PURE__ */ I(x, {
|
|
2305
2316
|
type: "number",
|
|
2306
2317
|
variant: "compact",
|
|
2307
2318
|
placeholder: h?.placeholder ?? i.filterValuePlaceholder,
|
|
@@ -2316,24 +2327,24 @@ function Lt({ column: e }) {
|
|
|
2316
2327
|
tabIndex: -1,
|
|
2317
2328
|
"aria-label": i.filterColumn(r)
|
|
2318
2329
|
}
|
|
2319
|
-
}), p !== "" && /* @__PURE__ */
|
|
2330
|
+
}), p !== "" && /* @__PURE__ */ I(Lt, {
|
|
2320
2331
|
label: i.clearFilter(r),
|
|
2321
2332
|
onClear: C
|
|
2322
2333
|
})]
|
|
2323
2334
|
})]
|
|
2324
2335
|
});
|
|
2325
2336
|
}
|
|
2326
|
-
function
|
|
2327
|
-
let t =
|
|
2328
|
-
return t ? /* @__PURE__ */
|
|
2337
|
+
function Bt({ column: e }) {
|
|
2338
|
+
let t = z(!0);
|
|
2339
|
+
return t ? /* @__PURE__ */ I(t.DateFilter, { column: e }) : null;
|
|
2329
2340
|
}
|
|
2330
|
-
function
|
|
2331
|
-
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), i = e.grid.localeText, o = t?.type === "multiselect" ? t.values : [], s = e.filterOptions, c =
|
|
2341
|
+
function Vt({ column: e }) {
|
|
2342
|
+
let { currentFilter: t } = e, { componentName: n } = e.grid, r = String(e.header ?? e.key), i = e.grid.localeText, o = t?.type === "multiselect" ? t.values : [], s = e.filterOptions, c = A((t, n) => {
|
|
2332
2343
|
e.setMultiselectFilter(n);
|
|
2333
2344
|
}, [e]);
|
|
2334
|
-
return /* @__PURE__ */
|
|
2345
|
+
return /* @__PURE__ */ I(_, {
|
|
2335
2346
|
component: `${n}.filter.cell.input`,
|
|
2336
|
-
children: /* @__PURE__ */
|
|
2347
|
+
children: /* @__PURE__ */ I(f, { children: /* @__PURE__ */ L(w, {
|
|
2337
2348
|
multiple: !0,
|
|
2338
2349
|
showCheckbox: !0,
|
|
2339
2350
|
isSearchable: !0,
|
|
@@ -2351,14 +2362,14 @@ function zt({ column: e }) {
|
|
|
2351
2362
|
"aria-label": i.filterColumn(r)
|
|
2352
2363
|
},
|
|
2353
2364
|
children: [
|
|
2354
|
-
/* @__PURE__ */
|
|
2365
|
+
/* @__PURE__ */ I(w.Display, { children: (t) => t.length === 0 ? /* @__PURE__ */ I(a, {
|
|
2355
2366
|
tag: "span",
|
|
2356
2367
|
color: "base-400",
|
|
2357
2368
|
children: e.filterConfig?.placeholder ?? i.filterSelectPlaceholder
|
|
2358
2369
|
}) : t.length === 1 ? s.find((e) => e.value === t[0])?.label ?? String(t[0]) : `${t.length} selected` }),
|
|
2359
|
-
/* @__PURE__ */
|
|
2360
|
-
/* @__PURE__ */
|
|
2361
|
-
s.map((e) => /* @__PURE__ */
|
|
2370
|
+
/* @__PURE__ */ I(w.Unselect, { children: i.filterSelectClear }),
|
|
2371
|
+
/* @__PURE__ */ I(w.SelectAll, { children: i.filterSelectAll }),
|
|
2372
|
+
s.map((e) => /* @__PURE__ */ I(w.Item, {
|
|
2362
2373
|
value: e.value,
|
|
2363
2374
|
ai: "center",
|
|
2364
2375
|
gap: 2,
|
|
@@ -2368,22 +2379,22 @@ function zt({ column: e }) {
|
|
|
2368
2379
|
}) })
|
|
2369
2380
|
});
|
|
2370
2381
|
}
|
|
2371
|
-
function
|
|
2382
|
+
function Ht(e) {
|
|
2372
2383
|
let { column: t } = e, n = t.filterConfig;
|
|
2373
2384
|
if (!n) return null;
|
|
2374
2385
|
switch (n.type) {
|
|
2375
|
-
case "number": return /* @__PURE__ */
|
|
2376
|
-
case "multiselect": return /* @__PURE__ */
|
|
2377
|
-
case "date": return /* @__PURE__ */
|
|
2378
|
-
default: return /* @__PURE__ */
|
|
2386
|
+
case "number": return /* @__PURE__ */ I(zt, { column: t });
|
|
2387
|
+
case "multiselect": return /* @__PURE__ */ I(Vt, { column: t });
|
|
2388
|
+
case "date": return /* @__PURE__ */ I(Bt, { column: t });
|
|
2389
|
+
default: return /* @__PURE__ */ I(Rt, { column: t });
|
|
2379
2390
|
}
|
|
2380
2391
|
}
|
|
2381
|
-
|
|
2392
|
+
Ht.displayName = "DataGridColumnFilter";
|
|
2382
2393
|
//#endregion
|
|
2383
2394
|
//#region src/components/dataGrid/components/dataGridFilterCell.tsx
|
|
2384
|
-
function
|
|
2385
|
-
let { column: t, grid: n, row: r, columnIndex: i } = e, { widthVarName: a, inlineStartVarName: o, inlineEndVarName: s, filterable: c } = t, { isStartPinned: l, isEndPinned: u, isPinned: d, isFirstStartPinned: f, isLastStartPinned: p, isFirstEndPinned: m, isLastEndPinned: h } = t.pinFlags.value, { ref: g, tabIndex: v, onFocus: y } =
|
|
2386
|
-
return /* @__PURE__ */
|
|
2395
|
+
function Ut(e) {
|
|
2396
|
+
let { column: t, grid: n, row: r, columnIndex: i } = e, { widthVarName: a, inlineStartVarName: o, inlineEndVarName: s, filterable: c } = t, { isStartPinned: l, isEndPinned: u, isPinned: d, isFirstStartPinned: f, isLastStartPinned: p, isFirstEndPinned: m, isLastEndPinned: h } = t.pinFlags.value, { ref: g, tabIndex: v, onFocus: y } = Se(R(), r, i), b = t.isGrouping || t.isRowNumber || t.isRowSelection;
|
|
2397
|
+
return /* @__PURE__ */ I(_, {
|
|
2387
2398
|
ref: g,
|
|
2388
2399
|
component: `${n.componentName}.filter.cell`,
|
|
2389
2400
|
props: {
|
|
@@ -2405,23 +2416,23 @@ function Vt(e) {
|
|
|
2405
2416
|
insetInlineStart: l ? `var(${o})` : void 0,
|
|
2406
2417
|
insetInlineEnd: u ? `var(${s})` : void 0
|
|
2407
2418
|
},
|
|
2408
|
-
children: !b && c && /* @__PURE__ */
|
|
2419
|
+
children: !b && c && /* @__PURE__ */ I(Ht, { column: t })
|
|
2409
2420
|
});
|
|
2410
2421
|
}
|
|
2411
|
-
|
|
2422
|
+
Ut.displayName = "DataGridFilterCell";
|
|
2412
2423
|
//#endregion
|
|
2413
2424
|
//#region src/components/dataGrid/components/dataGridFilterRow.tsx
|
|
2414
|
-
function
|
|
2425
|
+
function Wt(e) {
|
|
2415
2426
|
let { grid: t } = e;
|
|
2416
2427
|
if (!t.filter.hasFilterableColumns) return null;
|
|
2417
2428
|
let n = t.headerRows.value.length;
|
|
2418
|
-
return /* @__PURE__ */
|
|
2429
|
+
return /* @__PURE__ */ I(a, {
|
|
2419
2430
|
display: "contents",
|
|
2420
2431
|
props: {
|
|
2421
2432
|
role: "row",
|
|
2422
2433
|
"aria-rowindex": n + 1
|
|
2423
2434
|
},
|
|
2424
|
-
children: t.columns.value.visibleLeafs.map((e, r) => /* @__PURE__ */
|
|
2435
|
+
children: t.columns.value.visibleLeafs.map((e, r) => /* @__PURE__ */ I(Ut, {
|
|
2425
2436
|
column: e,
|
|
2426
2437
|
grid: t,
|
|
2427
2438
|
row: n,
|
|
@@ -2429,25 +2440,25 @@ function Ht(e) {
|
|
|
2429
2440
|
}, e.uniqueKey))
|
|
2430
2441
|
});
|
|
2431
2442
|
}
|
|
2432
|
-
|
|
2443
|
+
Wt.displayName = "DataGridFilterRow";
|
|
2433
2444
|
//#endregion
|
|
2434
2445
|
//#region src/icons/sortIcon.tsx
|
|
2435
|
-
function
|
|
2436
|
-
return /* @__PURE__ */
|
|
2446
|
+
function Gt(e) {
|
|
2447
|
+
return /* @__PURE__ */ I(m, {
|
|
2437
2448
|
viewBox: "0 0 24 24",
|
|
2438
2449
|
width: "1.5rem",
|
|
2439
2450
|
...e,
|
|
2440
|
-
children: /* @__PURE__ */
|
|
2451
|
+
children: /* @__PURE__ */ I(p, { d: "M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z" })
|
|
2441
2452
|
});
|
|
2442
2453
|
}
|
|
2443
2454
|
//#endregion
|
|
2444
2455
|
//#region src/icons/dotsIcon.tsx
|
|
2445
|
-
function
|
|
2446
|
-
return /* @__PURE__ */
|
|
2456
|
+
function Kt(e) {
|
|
2457
|
+
return /* @__PURE__ */ I(m, {
|
|
2447
2458
|
viewBox: "0 0 16 16",
|
|
2448
2459
|
width: "18",
|
|
2449
2460
|
...e,
|
|
2450
|
-
children: /* @__PURE__ */
|
|
2461
|
+
children: /* @__PURE__ */ I(p, {
|
|
2451
2462
|
strokeWidth: 4,
|
|
2452
2463
|
d: "M7.936 12.128a.936.936 0 1 1 0 1.872.936.936 0 0 1 0-1.872ZM7.936 7.052a.936.936 0 1 1 0 1.873.936.936 0 0 1 0-1.873ZM7.936 1.977a.936.936 0 1 1 0 1.872.936.936 0 0 1 0-1.872Z"
|
|
2453
2464
|
})
|
|
@@ -2455,54 +2466,54 @@ function Wt(e) {
|
|
|
2455
2466
|
}
|
|
2456
2467
|
//#endregion
|
|
2457
2468
|
//#region src/icons/groupingIcon.tsx
|
|
2458
|
-
function
|
|
2459
|
-
return /* @__PURE__ */
|
|
2469
|
+
function qt(e) {
|
|
2470
|
+
return /* @__PURE__ */ I(m, {
|
|
2460
2471
|
viewBox: "0 0 24 24",
|
|
2461
2472
|
width: "1.5rem",
|
|
2462
2473
|
...e,
|
|
2463
|
-
children: /* @__PURE__ */
|
|
2474
|
+
children: /* @__PURE__ */ I(p, { d: "M3 5h8v2H3V5zm0 6h8v2H3v-2zm0 6h8v2H3v-2zm12-12h6v6h-6V5zm1 1v4h4V6h-4zm-1 7h6v6h-6v-6zm1 1v4h4v-4h-4z" })
|
|
2464
2475
|
});
|
|
2465
2476
|
}
|
|
2466
2477
|
//#endregion
|
|
2467
2478
|
//#region src/icons/pinIcon.tsx
|
|
2468
|
-
function
|
|
2469
|
-
return /* @__PURE__ */
|
|
2479
|
+
function Jt(e) {
|
|
2480
|
+
return /* @__PURE__ */ I(m, {
|
|
2470
2481
|
viewBox: "0 0 1024 1024",
|
|
2471
2482
|
width: "1.5rem",
|
|
2472
2483
|
...e,
|
|
2473
|
-
children: /* @__PURE__ */
|
|
2484
|
+
children: /* @__PURE__ */ I(p, { d: "M31.997 1023.957a31.699 31.699 0 0 1-22.611-9.386C3.328 1008.556 0 1000.493 0 991.96s3.328-16.596 9.386-22.611L328.25 650.484l-152.52-152.52a95.907 95.907 0 0 1-25.087-92.152 95.31 95.31 0 0 1 44.327-58.62l.896-.512a353.464 353.464 0 0 1 176.156-47.398c20.137 0 40.36 1.749 60.283 5.205L597.71 44.54A95.224 95.224 0 0 1 678.685.085c25.64 0 49.745 9.983 67.877 28.073l249.195 249.195a95.224 95.224 0 0 1 25.897 88.74 95.139 95.139 0 0 1-42.152 60.154L719.513 591.695a352.227 352.227 0 0 1-42.663 237.292A95.395 95.395 0 0 1 594 876.514a95.523 95.523 0 0 1-67.963-28.2L373.43 695.706 54.61 1014.614a31.912 31.912 0 0 1-22.612 9.343zm340.025-660.68c-50.64 0-100.685 13.566-144.798 39.207a31.57 31.57 0 0 0-14.676 19.497 31.699 31.699 0 0 0 8.362 30.675L571.344 803.09c6.059 6.059 14.122 9.386 22.697 9.386a31.699 31.699 0 0 0 27.56-15.785 287.421 287.421 0 0 0 31.06-212.676 31.997 31.997 0 0 1 13.907-34.471l278.59-177.266a31.57 31.57 0 0 0 14.037-20.051 31.699 31.699 0 0 0-8.618-29.566l-249.28-249.28a31.912 31.912 0 0 0-49.618 5.418l-177.308 278.59a31.827 31.827 0 0 1-34.472 13.908 293.778 293.778 0 0 0-67.877-8.02z" })
|
|
2474
2485
|
});
|
|
2475
2486
|
}
|
|
2476
2487
|
//#endregion
|
|
2477
2488
|
//#region src/components/dataGrid/components/dataGridHeaderCellContextMenu.tsx
|
|
2478
|
-
function
|
|
2489
|
+
function Yt(e) {
|
|
2479
2490
|
let { side: t, left: n, right: r } = e;
|
|
2480
|
-
return /* @__PURE__ */
|
|
2491
|
+
return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(T, {
|
|
2481
2492
|
rtl: { display: "none" },
|
|
2482
2493
|
children: t === "start" ? n : r
|
|
2483
|
-
}), /* @__PURE__ */
|
|
2494
|
+
}), /* @__PURE__ */ I(T, {
|
|
2484
2495
|
ltr: { display: "none" },
|
|
2485
2496
|
children: t === "start" ? r : n
|
|
2486
2497
|
})] });
|
|
2487
2498
|
}
|
|
2488
|
-
function
|
|
2489
|
-
let { column: t } = e, { grid: n, isEndAligned: i, header: o, key: c } = t, f = t.headerCell, p = String(o ?? c), m = n.localeText, g = d("datagrid-column-menu"), [v, x] =
|
|
2490
|
-
let e = (e) => /* @__PURE__ */
|
|
2499
|
+
function Xt(e) {
|
|
2500
|
+
let { column: t } = e, { grid: n, isEndAligned: i, header: o, key: c } = t, f = t.headerCell, p = String(o ?? c), m = n.localeText, g = d("datagrid-column-menu"), [v, x] = P(!1), S = N(null), C = N(null), w = N(!1), ee = i ? 3 : void 0, te = i ? void 0 : 3, E = ae(() => {
|
|
2501
|
+
let e = (e) => /* @__PURE__ */ I(T, {
|
|
2491
2502
|
component: `${n.componentName}.header.cell.contextMenu.tooltip.item.icon`,
|
|
2492
2503
|
children: e
|
|
2493
|
-
}), r = (t) => e(/* @__PURE__ */
|
|
2504
|
+
}), r = (t) => e(/* @__PURE__ */ I(Gt, {
|
|
2494
2505
|
width: "100%",
|
|
2495
2506
|
fill: "currentColor",
|
|
2496
2507
|
rotate: t
|
|
2497
|
-
})), i = (t, n) => e(/* @__PURE__ */
|
|
2508
|
+
})), i = (t, n) => e(/* @__PURE__ */ I(Jt, {
|
|
2498
2509
|
width: "100%",
|
|
2499
2510
|
fill: "currentColor",
|
|
2500
2511
|
rotate: t,
|
|
2501
2512
|
rtl: { rotate: n }
|
|
2502
|
-
})), o = e(/* @__PURE__ */
|
|
2513
|
+
})), o = e(/* @__PURE__ */ I(qt, {
|
|
2503
2514
|
width: "100%",
|
|
2504
2515
|
fill: "currentColor"
|
|
2505
|
-
})), s = /* @__PURE__ */
|
|
2516
|
+
})), s = /* @__PURE__ */ I(a, { width: 4 });
|
|
2506
2517
|
return [
|
|
2507
2518
|
[
|
|
2508
2519
|
f.canSortAsc && {
|
|
@@ -2531,7 +2542,7 @@ function Jt(e) {
|
|
|
2531
2542
|
f.canPinStart && {
|
|
2532
2543
|
key: "pin-start",
|
|
2533
2544
|
icon: i(0, -90),
|
|
2534
|
-
label: /* @__PURE__ */
|
|
2545
|
+
label: /* @__PURE__ */ I(Yt, {
|
|
2535
2546
|
side: "start",
|
|
2536
2547
|
left: m.pinLeft,
|
|
2537
2548
|
right: m.pinRight
|
|
@@ -2542,7 +2553,7 @@ function Jt(e) {
|
|
|
2542
2553
|
f.canPinEnd && {
|
|
2543
2554
|
key: "pin-end",
|
|
2544
2555
|
icon: i(-90, 0),
|
|
2545
|
-
label: /* @__PURE__ */
|
|
2556
|
+
label: /* @__PURE__ */ I(Yt, {
|
|
2546
2557
|
side: "end",
|
|
2547
2558
|
left: m.pinLeft,
|
|
2548
2559
|
right: m.pinRight
|
|
@@ -2561,7 +2572,7 @@ function Jt(e) {
|
|
|
2561
2572
|
[f.canGroupBy && {
|
|
2562
2573
|
key: "group",
|
|
2563
2574
|
icon: o,
|
|
2564
|
-
label: /* @__PURE__ */
|
|
2575
|
+
label: /* @__PURE__ */ I(a, {
|
|
2565
2576
|
textWrap: "nowrap",
|
|
2566
2577
|
children: m.groupBy(p)
|
|
2567
2578
|
}),
|
|
@@ -2570,7 +2581,7 @@ function Jt(e) {
|
|
|
2570
2581
|
}, f.canUnGroupAll && {
|
|
2571
2582
|
key: "ungroup",
|
|
2572
2583
|
icon: o,
|
|
2573
|
-
label: /* @__PURE__ */
|
|
2584
|
+
label: /* @__PURE__ */ I(a, {
|
|
2574
2585
|
textWrap: "nowrap",
|
|
2575
2586
|
children: m.ungroupAll
|
|
2576
2587
|
}),
|
|
@@ -2587,41 +2598,41 @@ function Jt(e) {
|
|
|
2587
2598
|
n,
|
|
2588
2599
|
f,
|
|
2589
2600
|
m
|
|
2590
|
-
]),
|
|
2601
|
+
]), D = A((e = !0) => {
|
|
2591
2602
|
w.current = !1, x(!1), e && S.current?.focus();
|
|
2592
|
-
}, []),
|
|
2593
|
-
count:
|
|
2594
|
-
textOf: (e) =>
|
|
2603
|
+
}, []), O = u({
|
|
2604
|
+
count: E.length,
|
|
2605
|
+
textOf: (e) => E[e]?.text ?? "",
|
|
2595
2606
|
onSelect: (e) => {
|
|
2596
|
-
|
|
2607
|
+
E[e]?.run(), D();
|
|
2597
2608
|
}
|
|
2598
2609
|
});
|
|
2599
2610
|
l({
|
|
2600
2611
|
enabled: v,
|
|
2601
2612
|
inside: [S, C],
|
|
2602
|
-
onDismiss: () =>
|
|
2613
|
+
onDismiss: () => D()
|
|
2603
2614
|
}), s({
|
|
2604
2615
|
enabled: v,
|
|
2605
2616
|
returnTo: S
|
|
2606
2617
|
});
|
|
2607
|
-
let
|
|
2608
|
-
|
|
2609
|
-
}, [
|
|
2618
|
+
let k = O.setActiveIndex, j = O.activeItem, M = A(() => {
|
|
2619
|
+
k(0, { reason: "programmatic" }), w.current = !0, x(!0);
|
|
2620
|
+
}, [k]);
|
|
2610
2621
|
return r(() => {
|
|
2611
2622
|
if (!w.current) return;
|
|
2612
|
-
let e =
|
|
2623
|
+
let e = j();
|
|
2613
2624
|
e && (w.current = !1, e.focus());
|
|
2614
|
-
}), /* @__PURE__ */
|
|
2625
|
+
}), /* @__PURE__ */ L(_, {
|
|
2615
2626
|
position: "absolute",
|
|
2616
|
-
insetStart:
|
|
2617
|
-
insetEnd:
|
|
2627
|
+
insetStart: ee,
|
|
2628
|
+
insetEnd: te,
|
|
2618
2629
|
top: "1/2",
|
|
2619
2630
|
translateY: -3,
|
|
2620
2631
|
ai: "center",
|
|
2621
|
-
children: [/* @__PURE__ */
|
|
2632
|
+
children: [/* @__PURE__ */ I(h, {
|
|
2622
2633
|
ref: S,
|
|
2623
2634
|
component: `${n.componentName}.header.cell.contextMenu`,
|
|
2624
|
-
onClick: () => v ?
|
|
2635
|
+
onClick: () => v ? D(!1) : M(),
|
|
2625
2636
|
variant: f.contextMenuButtonVariant,
|
|
2626
2637
|
type: "button",
|
|
2627
2638
|
props: {
|
|
@@ -2631,13 +2642,13 @@ function Jt(e) {
|
|
|
2631
2642
|
"aria-expanded": v,
|
|
2632
2643
|
"aria-controls": v ? g : void 0
|
|
2633
2644
|
},
|
|
2634
|
-
children: /* @__PURE__ */
|
|
2645
|
+
children: /* @__PURE__ */ I(T, {
|
|
2635
2646
|
component: `${n.componentName}.header.cell.contextMenu.icon`,
|
|
2636
|
-
children: /* @__PURE__ */
|
|
2647
|
+
children: /* @__PURE__ */ I(Kt, { fill: "currentColor" })
|
|
2637
2648
|
})
|
|
2638
|
-
}), /* @__PURE__ */
|
|
2649
|
+
}), /* @__PURE__ */ I(b, {
|
|
2639
2650
|
present: v,
|
|
2640
|
-
children: (e) => /* @__PURE__ */
|
|
2651
|
+
children: (e) => /* @__PURE__ */ I(y, {
|
|
2641
2652
|
component: `${n.componentName}.header.cell.contextMenu.tooltip`,
|
|
2642
2653
|
variant: { closed: !e.present },
|
|
2643
2654
|
ref: C,
|
|
@@ -2650,22 +2661,22 @@ function Jt(e) {
|
|
|
2650
2661
|
props: {
|
|
2651
2662
|
role: "menu",
|
|
2652
2663
|
"aria-label": m.columnOptions(p),
|
|
2653
|
-
onKeyDown:
|
|
2664
|
+
onKeyDown: O.onKeyDown,
|
|
2654
2665
|
...e.props
|
|
2655
2666
|
},
|
|
2656
|
-
children:
|
|
2657
|
-
let { ref: r, tabIndex: i, onFocus: o } =
|
|
2658
|
-
return /* @__PURE__ */
|
|
2667
|
+
children: E.map((e, t) => {
|
|
2668
|
+
let { ref: r, tabIndex: i, onFocus: o } = O.itemProps(t);
|
|
2669
|
+
return /* @__PURE__ */ L(ne, { children: [e.startsSection && /* @__PURE__ */ I(a, {
|
|
2659
2670
|
bb: 1,
|
|
2660
2671
|
my: 2,
|
|
2661
2672
|
borderColor: "base-300",
|
|
2662
2673
|
component: `${n.componentName}.header.cell.contextMenu.tooltip.item.separator`
|
|
2663
|
-
}), /* @__PURE__ */
|
|
2674
|
+
}), /* @__PURE__ */ L(h, {
|
|
2664
2675
|
component: `${n.componentName}.header.cell.contextMenu.tooltip.item`,
|
|
2665
2676
|
ref: r,
|
|
2666
2677
|
type: "button",
|
|
2667
2678
|
onClick: (t) => {
|
|
2668
|
-
t.stopPropagation(), e.run(),
|
|
2679
|
+
t.stopPropagation(), e.run(), D();
|
|
2669
2680
|
},
|
|
2670
2681
|
props: {
|
|
2671
2682
|
role: "menuitem",
|
|
@@ -2679,27 +2690,27 @@ function Jt(e) {
|
|
|
2679
2690
|
})]
|
|
2680
2691
|
});
|
|
2681
2692
|
}
|
|
2682
|
-
|
|
2693
|
+
Xt.displayName = "DataGridHeaderCellContextMenu";
|
|
2683
2694
|
//#endregion
|
|
2684
2695
|
//#region src/components/dataGrid/components/dataGridHeaderCellResizer.tsx
|
|
2685
|
-
var
|
|
2686
|
-
function
|
|
2687
|
-
let { column: t, controls: n } = e, r = t.grid.resizerStyle, i = t.headerCell, o =
|
|
2696
|
+
var Zt = (e) => "touches" in e ? e.touches[0]?.pageX ?? 0 : e.pageX, Qt = 16, $t = 150;
|
|
2697
|
+
function en(e) {
|
|
2698
|
+
let { column: t, controls: n } = e, r = t.grid.resizerStyle, i = t.headerCell, o = A((e) => {
|
|
2688
2699
|
let { grid: n } = t;
|
|
2689
|
-
e.type === "mousedown" && e.preventDefault(), t.beginResize(
|
|
2690
|
-
let r = new AbortController(), { signal: i } = r, a = 0, o =
|
|
2700
|
+
e.type === "mousedown" && e.preventDefault(), t.beginResize(Zt(e.nativeEvent));
|
|
2701
|
+
let r = new AbortController(), { signal: i } = r, a = 0, o = Zt(e.nativeEvent), s = () => {
|
|
2691
2702
|
t.applyResize(o), n.paintSizes();
|
|
2692
2703
|
}, c = n.resizeMode === "instant" ? (e) => {
|
|
2693
|
-
o =
|
|
2704
|
+
o = Zt(e), s();
|
|
2694
2705
|
} : (e) => {
|
|
2695
|
-
o =
|
|
2706
|
+
o = Zt(e), a ||= requestAnimationFrame(() => {
|
|
2696
2707
|
a = 0, s();
|
|
2697
2708
|
});
|
|
2698
2709
|
}, l = () => {
|
|
2699
2710
|
r.abort(), a && cancelAnimationFrame(a), s(), t.endResize();
|
|
2700
2711
|
};
|
|
2701
2712
|
window.addEventListener("mousemove", c, { signal: i }), window.addEventListener("touchmove", c, { signal: i }), window.addEventListener("mouseup", l, { signal: i }), window.addEventListener("touchend", l, { signal: i });
|
|
2702
|
-
}, [t]), s =
|
|
2713
|
+
}, [t]), s = N(void 0), c = N(0), l = A(() => {
|
|
2703
2714
|
let { grid: e } = t;
|
|
2704
2715
|
if (e.resizeMode === "instant") {
|
|
2705
2716
|
e.paintSizes();
|
|
@@ -2708,16 +2719,16 @@ function Qt(e) {
|
|
|
2708
2719
|
c.current ||= requestAnimationFrame(() => {
|
|
2709
2720
|
c.current = 0, e.paintSizes();
|
|
2710
2721
|
});
|
|
2711
|
-
}, [t]), u =
|
|
2722
|
+
}, [t]), u = A(() => {
|
|
2712
2723
|
s.current !== void 0 && (clearTimeout(s.current), s.current = void 0, c.current &&= (cancelAnimationFrame(c.current), 0), t.endResize());
|
|
2713
2724
|
}, [t]);
|
|
2714
|
-
|
|
2725
|
+
M(() => () => {
|
|
2715
2726
|
clearTimeout(s.current), c.current && cancelAnimationFrame(c.current);
|
|
2716
2727
|
}, []);
|
|
2717
|
-
let d =
|
|
2728
|
+
let d = A((e) => {
|
|
2718
2729
|
switch (e.key) {
|
|
2719
2730
|
case "ArrowRight":
|
|
2720
|
-
t.moveResizer(
|
|
2731
|
+
t.moveResizer(Qt);
|
|
2721
2732
|
break;
|
|
2722
2733
|
case "ArrowLeft":
|
|
2723
2734
|
t.moveResizer(-16);
|
|
@@ -2730,14 +2741,14 @@ function Qt(e) {
|
|
|
2730
2741
|
break;
|
|
2731
2742
|
default: return;
|
|
2732
2743
|
}
|
|
2733
|
-
e.preventDefault(), l(), clearTimeout(s.current), s.current = setTimeout(u,
|
|
2744
|
+
e.preventDefault(), l(), clearTimeout(s.current), s.current = setTimeout(u, $t);
|
|
2734
2745
|
}, [
|
|
2735
2746
|
t,
|
|
2736
2747
|
u,
|
|
2737
2748
|
i,
|
|
2738
2749
|
l
|
|
2739
2750
|
]), { isAtGridEnd: f } = i;
|
|
2740
|
-
return /* @__PURE__ */
|
|
2751
|
+
return /* @__PURE__ */ I(_, {
|
|
2741
2752
|
height: "fit",
|
|
2742
2753
|
ai: "center",
|
|
2743
2754
|
position: "absolute",
|
|
@@ -2745,7 +2756,7 @@ function Qt(e) {
|
|
|
2745
2756
|
insetStart: t.pin === "END" ? -.75 : void 0,
|
|
2746
2757
|
zIndex: 1,
|
|
2747
2758
|
py: 3,
|
|
2748
|
-
children: /* @__PURE__ */
|
|
2759
|
+
children: /* @__PURE__ */ I(a, {
|
|
2749
2760
|
cursor: "col-resize",
|
|
2750
2761
|
px: f ? void 0 : .75,
|
|
2751
2762
|
ps: f ? 1.5 : void 0,
|
|
@@ -2756,7 +2767,7 @@ function Qt(e) {
|
|
|
2756
2767
|
onMouseDown: o,
|
|
2757
2768
|
onTouchStart: o
|
|
2758
2769
|
},
|
|
2759
|
-
children: /* @__PURE__ */
|
|
2770
|
+
children: /* @__PURE__ */ I(a, {
|
|
2760
2771
|
component: `${t.grid.componentName}.header.cell.resizer`,
|
|
2761
2772
|
opacity: r === "visible" ? void 0 : 0,
|
|
2762
2773
|
group: r === "hover" ? { "header-cell/hover": { opacity: 1 } } : void 0,
|
|
@@ -2777,13 +2788,13 @@ function Qt(e) {
|
|
|
2777
2788
|
})
|
|
2778
2789
|
});
|
|
2779
2790
|
}
|
|
2780
|
-
|
|
2791
|
+
en.displayName = "DataGridHeaderCellResizer";
|
|
2781
2792
|
//#endregion
|
|
2782
2793
|
//#region src/components/dataGrid/components/dataGridHeaderCell.tsx
|
|
2783
|
-
function
|
|
2784
|
-
let { column: t, row: n, columnIndex: r } = e, { grid: i } = t, { isStartPinned: o, isEndPinned: s } = t.pinFlags.value, c = t.headerCell, { isSortable: l, showResizer: u, showContextMenu: f, paddingStart: p, paddingEnd: m } = c, { ref: h, tabIndex: y, onFocus: b } =
|
|
2794
|
+
function tn(e) {
|
|
2795
|
+
let { column: t, row: n, columnIndex: r } = e, { grid: i } = t, { isStartPinned: o, isEndPinned: s } = t.pinFlags.value, c = t.headerCell, { isSortable: l, showResizer: u, showContextMenu: f, paddingStart: p, paddingEnd: m } = c, { ref: h, tabIndex: y, onFocus: b } = Se(R(), n, r), x = d("datagrid-columnheader"), S = N(null), C = A(() => {
|
|
2785
2796
|
i.toggleSelectAllRows();
|
|
2786
|
-
}, [i]), w = t.isRowSelection ? /* @__PURE__ */
|
|
2797
|
+
}, [i]), w = t.isRowSelection ? /* @__PURE__ */ I(v, {
|
|
2787
2798
|
variant: "datagrid",
|
|
2788
2799
|
m: 1,
|
|
2789
2800
|
indeterminate: i.someRowsSelected && !i.allRowsSelected,
|
|
@@ -2793,11 +2804,11 @@ function $t(e) {
|
|
|
2793
2804
|
tabIndex: -1,
|
|
2794
2805
|
"aria-label": i.localeText.selectAllRows
|
|
2795
2806
|
}
|
|
2796
|
-
}) : c.hiddenLabel ? /* @__PURE__ */
|
|
2807
|
+
}) : c.hiddenLabel ? /* @__PURE__ */ I(g, {
|
|
2797
2808
|
tag: "span",
|
|
2798
2809
|
children: c.hiddenLabel
|
|
2799
2810
|
}) : c.label;
|
|
2800
|
-
return /* @__PURE__ */
|
|
2811
|
+
return /* @__PURE__ */ I(_, {
|
|
2801
2812
|
ref: h,
|
|
2802
2813
|
id: x,
|
|
2803
2814
|
props: {
|
|
@@ -2823,12 +2834,12 @@ function $t(e) {
|
|
|
2823
2834
|
insetInlineStart: o ? `var(${t.inlineStartVarName})` : void 0,
|
|
2824
2835
|
insetInlineEnd: s ? `var(${t.inlineEndVarName})` : void 0
|
|
2825
2836
|
},
|
|
2826
|
-
children: /* @__PURE__ */
|
|
2827
|
-
/* @__PURE__ */
|
|
2837
|
+
children: /* @__PURE__ */ L(F, { children: [
|
|
2838
|
+
/* @__PURE__ */ I(_, {
|
|
2828
2839
|
width: "fit",
|
|
2829
2840
|
height: "fit",
|
|
2830
2841
|
jc: t.align,
|
|
2831
|
-
children: /* @__PURE__ */
|
|
2842
|
+
children: /* @__PURE__ */ L(_, {
|
|
2832
2843
|
overflow: "hidden",
|
|
2833
2844
|
position: t.isLeaf ? void 0 : "sticky",
|
|
2834
2845
|
ai: "center",
|
|
@@ -2837,15 +2848,15 @@ function $t(e) {
|
|
|
2837
2848
|
pe: m,
|
|
2838
2849
|
style: { insetInlineStart: t.pin ? void 0 : `var(${i.inlineStartEdgeVarName})` },
|
|
2839
2850
|
children: [
|
|
2840
|
-
/* @__PURE__ */
|
|
2851
|
+
/* @__PURE__ */ I(a, {
|
|
2841
2852
|
overflow: "hidden",
|
|
2842
2853
|
textOverflow: "ellipsis",
|
|
2843
2854
|
textWrap: "nowrap",
|
|
2844
2855
|
children: w
|
|
2845
2856
|
}),
|
|
2846
|
-
c.isSorted && /* @__PURE__ */
|
|
2857
|
+
c.isSorted && /* @__PURE__ */ I(a, {
|
|
2847
2858
|
ps: (t.inlineWidth ?? 0) < 58 ? 0 : 2,
|
|
2848
|
-
children: /* @__PURE__ */
|
|
2859
|
+
children: /* @__PURE__ */ I(Gt, {
|
|
2849
2860
|
width: "16px",
|
|
2850
2861
|
rotate: c.sortDirection === "ASC" ? 0 : 180,
|
|
2851
2862
|
transition: "transform",
|
|
@@ -2855,37 +2866,37 @@ function $t(e) {
|
|
|
2855
2866
|
fill: "currentColor"
|
|
2856
2867
|
})
|
|
2857
2868
|
}),
|
|
2858
|
-
f && /* @__PURE__ */
|
|
2869
|
+
f && /* @__PURE__ */ I(a, { minWidth: t.isEndAligned ? 4 : 10 })
|
|
2859
2870
|
]
|
|
2860
2871
|
})
|
|
2861
2872
|
}),
|
|
2862
|
-
u && /* @__PURE__ */
|
|
2873
|
+
u && /* @__PURE__ */ I(en, {
|
|
2863
2874
|
column: t,
|
|
2864
2875
|
controls: x
|
|
2865
2876
|
}),
|
|
2866
|
-
f && /* @__PURE__ */
|
|
2877
|
+
f && /* @__PURE__ */ I(Xt, { column: t })
|
|
2867
2878
|
] })
|
|
2868
2879
|
});
|
|
2869
2880
|
}
|
|
2870
|
-
|
|
2881
|
+
tn.displayName = "DataGridHeaderCell";
|
|
2871
2882
|
//#endregion
|
|
2872
2883
|
//#region src/components/dataGrid/components/dataGridHeader.tsx
|
|
2873
|
-
function
|
|
2874
|
-
let { grid: t } = e, n =
|
|
2884
|
+
function nn(e) {
|
|
2885
|
+
let { grid: t } = e, n = N(null), [r, i] = P(X.INITIAL), o = t.headerHover === "sliding", s = (e) => {
|
|
2875
2886
|
let t = n.current;
|
|
2876
2887
|
if (!o || !t || e.pointerType === "touch") return;
|
|
2877
2888
|
if (X.isOnResizer(e.target)) return i((e) => X.pause(e));
|
|
2878
2889
|
let r = X.cellAt(t, e.target), a = r && X.bounds(t, r);
|
|
2879
2890
|
i((e) => X.hover(e, a));
|
|
2880
2891
|
}, c = () => i((e) => X.hover(e, void 0)), l = r.visible || r.paused;
|
|
2881
|
-
|
|
2892
|
+
M(() => {
|
|
2882
2893
|
if (l) return document.addEventListener("scroll", c, {
|
|
2883
2894
|
capture: !0,
|
|
2884
2895
|
passive: !0
|
|
2885
2896
|
}), () => document.removeEventListener("scroll", c, { capture: !0 });
|
|
2886
2897
|
}, [l]);
|
|
2887
2898
|
let { bounds: u } = r;
|
|
2888
|
-
return /* @__PURE__ */
|
|
2899
|
+
return /* @__PURE__ */ L(C, {
|
|
2889
2900
|
ref: n,
|
|
2890
2901
|
component: `${t.componentName}.header`,
|
|
2891
2902
|
props: {
|
|
@@ -2895,20 +2906,20 @@ function en(e) {
|
|
|
2895
2906
|
},
|
|
2896
2907
|
style: { gridTemplateColumns: t.gridTemplateColumns.value },
|
|
2897
2908
|
children: [
|
|
2898
|
-
t.headerRows.value.map((e, t) => /* @__PURE__ */
|
|
2909
|
+
t.headerRows.value.map((e, t) => /* @__PURE__ */ I(a, {
|
|
2899
2910
|
display: "contents",
|
|
2900
2911
|
props: {
|
|
2901
2912
|
role: "row",
|
|
2902
2913
|
"aria-rowindex": t + 1
|
|
2903
2914
|
},
|
|
2904
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
2915
|
+
children: e.map((e, n) => /* @__PURE__ */ I(tn, {
|
|
2905
2916
|
column: e,
|
|
2906
2917
|
row: t,
|
|
2907
2918
|
columnIndex: n
|
|
2908
2919
|
}, e.uniqueKey))
|
|
2909
2920
|
}, t)),
|
|
2910
|
-
/* @__PURE__ */
|
|
2911
|
-
o && u && /* @__PURE__ */
|
|
2921
|
+
/* @__PURE__ */ I(Wt, { grid: t }),
|
|
2922
|
+
o && u && /* @__PURE__ */ I(a, {
|
|
2912
2923
|
tag: "span",
|
|
2913
2924
|
component: `${t.componentName}.header.hover`,
|
|
2914
2925
|
variant: {
|
|
@@ -2927,42 +2938,42 @@ function en(e) {
|
|
|
2927
2938
|
]
|
|
2928
2939
|
});
|
|
2929
2940
|
}
|
|
2930
|
-
|
|
2931
|
-
var
|
|
2941
|
+
nn.displayName = "DataGridHeader";
|
|
2942
|
+
var rn = k(nn);
|
|
2932
2943
|
//#endregion
|
|
2933
2944
|
//#region src/components/dataGrid/components/dataGridLoader.tsx
|
|
2934
|
-
function
|
|
2945
|
+
function an(e) {
|
|
2935
2946
|
let { grid: t } = e;
|
|
2936
|
-
return /* @__PURE__ */
|
|
2947
|
+
return /* @__PURE__ */ I(a, {
|
|
2937
2948
|
component: `${t.componentName}.loader`,
|
|
2938
2949
|
props: { "aria-hidden": !0 },
|
|
2939
|
-
children: /* @__PURE__ */
|
|
2950
|
+
children: /* @__PURE__ */ I(a, {
|
|
2940
2951
|
component: `${t.componentName}.loader.track`,
|
|
2941
2952
|
style: { height: 3 },
|
|
2942
|
-
children: /* @__PURE__ */
|
|
2953
|
+
children: /* @__PURE__ */ I(a, {
|
|
2943
2954
|
component: `${t.componentName}.loader.track.bar`,
|
|
2944
2955
|
width: "2/5"
|
|
2945
2956
|
})
|
|
2946
2957
|
})
|
|
2947
2958
|
});
|
|
2948
2959
|
}
|
|
2949
|
-
|
|
2960
|
+
an.displayName = "DataGridLoader";
|
|
2950
2961
|
//#endregion
|
|
2951
2962
|
//#region src/components/dataGrid/components/dataGridContent.tsx
|
|
2952
|
-
function
|
|
2953
|
-
let { grid: t } = e, n =
|
|
2963
|
+
function on(e) {
|
|
2964
|
+
let { grid: t } = e, n = N(null), [i, o] = P({
|
|
2954
2965
|
top: 0,
|
|
2955
2966
|
direction: "down"
|
|
2956
|
-
}), s =
|
|
2967
|
+
}), s = N(null), c = A((e) => {
|
|
2957
2968
|
o((t) => e === t.top ? t : {
|
|
2958
2969
|
top: e,
|
|
2959
|
-
direction:
|
|
2970
|
+
direction: Ce.directionOf(t.top, e, t.direction)
|
|
2960
2971
|
});
|
|
2961
|
-
}, []), l =
|
|
2972
|
+
}, []), l = A((e) => {
|
|
2962
2973
|
s.current !== null && cancelAnimationFrame(s.current), s.current = requestAnimationFrame(() => {
|
|
2963
|
-
c(e.target.scrollTop)
|
|
2974
|
+
s.current = null, se(() => c(e.target.scrollTop));
|
|
2964
2975
|
});
|
|
2965
|
-
}, [c]), { navigation: u, onKeyDown: d } =
|
|
2976
|
+
}, [c]), { navigation: u, onKeyDown: d } = Je({
|
|
2966
2977
|
grid: t,
|
|
2967
2978
|
scrollerRef: n,
|
|
2968
2979
|
scroll: i,
|
|
@@ -2970,7 +2981,7 @@ function rn(e) {
|
|
|
2970
2981
|
}), { source: f } = t, { queryVersion: p } = f;
|
|
2971
2982
|
r(() => {
|
|
2972
2983
|
f.enabled && n.current && (n.current.scrollTop = 0);
|
|
2973
|
-
}, [f, p]),
|
|
2984
|
+
}, [f, p]), M(() => {
|
|
2974
2985
|
if (!f.enabled) return;
|
|
2975
2986
|
let { startIndex: e, take: r } = t.viewport.window(n.current?.scrollTop ?? 0, i.direction);
|
|
2976
2987
|
f.request(e, e + r);
|
|
@@ -2985,7 +2996,7 @@ function rn(e) {
|
|
|
2985
2996
|
t.expansionVersion
|
|
2986
2997
|
]);
|
|
2987
2998
|
let { range: m } = t, { isDragging: h } = m;
|
|
2988
|
-
return
|
|
2999
|
+
return M(() => {
|
|
2989
3000
|
if (h) return window.addEventListener("pointerup", m.endDrag), window.addEventListener("pointercancel", m.endDrag), () => {
|
|
2990
3001
|
window.removeEventListener("pointerup", m.endDrag), window.removeEventListener("pointercancel", m.endDrag);
|
|
2991
3002
|
};
|
|
@@ -2996,9 +3007,9 @@ function rn(e) {
|
|
|
2996
3007
|
t.setContainerWidth(e.clientWidth), t.paintSizes();
|
|
2997
3008
|
});
|
|
2998
3009
|
return r.observe(e), () => r.disconnect();
|
|
2999
|
-
}, [t]), t.hasVisibleColumns ? /* @__PURE__ */
|
|
3010
|
+
}, [t]), t.hasVisibleColumns ? /* @__PURE__ */ I(be.Provider, {
|
|
3000
3011
|
value: u,
|
|
3001
|
-
children: /* @__PURE__ */
|
|
3012
|
+
children: /* @__PURE__ */ L(a, {
|
|
3002
3013
|
ref: n,
|
|
3003
3014
|
component: `${t.componentName}.content`,
|
|
3004
3015
|
overflowX: "auto",
|
|
@@ -3016,33 +3027,33 @@ function rn(e) {
|
|
|
3016
3027
|
onPaste: m.onPaste
|
|
3017
3028
|
},
|
|
3018
3029
|
children: [
|
|
3019
|
-
/* @__PURE__ */
|
|
3030
|
+
/* @__PURE__ */ I(rn, {
|
|
3020
3031
|
grid: t,
|
|
3021
3032
|
version: t.headerVersion
|
|
3022
3033
|
}),
|
|
3023
|
-
(t.props.loading || f.isLoading) && /* @__PURE__ */
|
|
3024
|
-
/* @__PURE__ */
|
|
3034
|
+
(t.props.loading || f.isLoading) && /* @__PURE__ */ I(an, { grid: t }),
|
|
3035
|
+
/* @__PURE__ */ I(jt, {
|
|
3025
3036
|
grid: t,
|
|
3026
3037
|
scroll: i
|
|
3027
3038
|
})
|
|
3028
3039
|
]
|
|
3029
3040
|
})
|
|
3030
|
-
}) : /* @__PURE__ */
|
|
3041
|
+
}) : /* @__PURE__ */ I(Mt, { grid: t });
|
|
3031
3042
|
}
|
|
3032
|
-
|
|
3043
|
+
on.displayName = "DataGridContent";
|
|
3033
3044
|
//#endregion
|
|
3034
3045
|
//#region src/components/dataGrid/components/dataGridDataSourceError.tsx
|
|
3035
|
-
function
|
|
3046
|
+
function sn(e) {
|
|
3036
3047
|
let { grid: t } = e, { error: n } = t.source;
|
|
3037
3048
|
if (n === void 0) return null;
|
|
3038
3049
|
let r = n instanceof Error && n.message ? n.message : t.localeText.loadError;
|
|
3039
|
-
return /* @__PURE__ */
|
|
3050
|
+
return /* @__PURE__ */ L(_, {
|
|
3040
3051
|
component: `${t.componentName}.error`,
|
|
3041
3052
|
props: { role: "alert" },
|
|
3042
|
-
children: [/* @__PURE__ */
|
|
3053
|
+
children: [/* @__PURE__ */ I(a, {
|
|
3043
3054
|
component: `${t.componentName}.error.message`,
|
|
3044
3055
|
children: r
|
|
3045
|
-
}), /* @__PURE__ */
|
|
3056
|
+
}), /* @__PURE__ */ I(h, {
|
|
3046
3057
|
component: `${t.componentName}.error.retry`,
|
|
3047
3058
|
type: "button",
|
|
3048
3059
|
onClick: t.source.retry,
|
|
@@ -3050,31 +3061,31 @@ function an(e) {
|
|
|
3050
3061
|
})]
|
|
3051
3062
|
});
|
|
3052
3063
|
}
|
|
3053
|
-
|
|
3064
|
+
sn.displayName = "DataGridDataSourceError";
|
|
3054
3065
|
//#endregion
|
|
3055
3066
|
//#region src/components/dataGrid/components/dataGridColumnGroups.tsx
|
|
3056
|
-
function
|
|
3067
|
+
function cn(e) {
|
|
3057
3068
|
let { grid: t } = e;
|
|
3058
|
-
return t.groupColumns.size === 0 ? null : /* @__PURE__ */
|
|
3069
|
+
return t.groupColumns.size === 0 ? null : /* @__PURE__ */ L(_, {
|
|
3059
3070
|
component: `${t.componentName}.topBar.columnGroups`,
|
|
3060
|
-
children: [/* @__PURE__ */
|
|
3071
|
+
children: [/* @__PURE__ */ I(T, {
|
|
3061
3072
|
component: `${t.componentName}.topBar.columnGroups.icon`,
|
|
3062
|
-
children: /* @__PURE__ */
|
|
3073
|
+
children: /* @__PURE__ */ I(qt, {
|
|
3063
3074
|
width: "100%",
|
|
3064
3075
|
fill: "currentColor"
|
|
3065
3076
|
})
|
|
3066
|
-
}), t.groupedColumns.map((e) => /* @__PURE__ */
|
|
3077
|
+
}), t.groupedColumns.map((e) => /* @__PURE__ */ L(E.Fragment, { children: [/* @__PURE__ */ I(Y, {
|
|
3067
3078
|
fill: "currentColor",
|
|
3068
3079
|
width: "14px",
|
|
3069
3080
|
height: "14px",
|
|
3070
3081
|
rotate: -90
|
|
3071
|
-
}), /* @__PURE__ */
|
|
3082
|
+
}), /* @__PURE__ */ L(_, {
|
|
3072
3083
|
component: `${t.componentName}.topBar.columnGroups.item`,
|
|
3073
|
-
children: [e.header ?? e.key, /* @__PURE__ */
|
|
3084
|
+
children: [e.header ?? e.key, /* @__PURE__ */ I(h, {
|
|
3074
3085
|
component: `${t.componentName}.topBar.columnGroups.item.icon`,
|
|
3075
3086
|
onClick: () => t.toggleGrouping(e.key),
|
|
3076
3087
|
props: { "aria-label": t.localeText.stopGrouping(String(e.header ?? e.key)) },
|
|
3077
|
-
children: /* @__PURE__ */
|
|
3088
|
+
children: /* @__PURE__ */ I(a, {
|
|
3078
3089
|
fontSize: 10,
|
|
3079
3090
|
color: "base-400",
|
|
3080
3091
|
hover: { color: "base-600" },
|
|
@@ -3084,25 +3095,25 @@ function on(e) {
|
|
|
3084
3095
|
})] }, e.key))]
|
|
3085
3096
|
});
|
|
3086
3097
|
}
|
|
3087
|
-
|
|
3098
|
+
cn.displayName = "DataGridColumnGroups";
|
|
3088
3099
|
//#endregion
|
|
3089
3100
|
//#region src/icons/searchIcon.tsx
|
|
3090
|
-
function
|
|
3091
|
-
return /* @__PURE__ */
|
|
3101
|
+
function ln(e) {
|
|
3102
|
+
return /* @__PURE__ */ I(m, {
|
|
3092
3103
|
viewBox: "0 0 488.4 488.4",
|
|
3093
3104
|
width: "1.5rem",
|
|
3094
3105
|
...e,
|
|
3095
|
-
children: /* @__PURE__ */
|
|
3106
|
+
children: /* @__PURE__ */ I(p, { d: "M0 203.25c0 112.1 91.2 203.2 203.2 203.2 51.6 0 98.8-19.4 134.7-51.2l129.5 129.5c2.4 2.4 5.5 3.6 8.7 3.6s6.3-1.2 8.7-3.6c4.8-4.8 4.8-12.5 0-17.3l-129.6-129.5c31.8-35.9 51.2-83 51.2-134.7C406.4 91.15 315.2.05 203.2.05S0 91.15 0 203.25zm381.9 0c0 98.5-80.2 178.7-178.7 178.7s-178.7-80.2-178.7-178.7 80.2-178.7 178.7-178.7 178.7 80.1 178.7 178.7z" })
|
|
3096
3107
|
});
|
|
3097
3108
|
}
|
|
3098
3109
|
//#endregion
|
|
3099
3110
|
//#region src/components/dataGrid/components/dataGridColumnsPanel.tsx
|
|
3100
|
-
var
|
|
3101
|
-
function
|
|
3102
|
-
let { grid: t } = e, { columnVisibility: n, localeText: r, componentName: i } = t, { visibleCount: o, total: s, hasHidden: c } = n, [l, u] =
|
|
3111
|
+
var un = 6;
|
|
3112
|
+
function dn(e) {
|
|
3113
|
+
let { grid: t } = e, { columnVisibility: n, localeText: r, componentName: i } = t, { visibleCount: o, total: s, hasHidden: c } = n, [l, u] = P(!1), [d, g] = P(""), _ = A((e) => {
|
|
3103
3114
|
u(e), e || g("");
|
|
3104
3115
|
}, []);
|
|
3105
|
-
return /* @__PURE__ */
|
|
3116
|
+
return /* @__PURE__ */ I(f, { children: /* @__PURE__ */ I(ee, {
|
|
3106
3117
|
label: r.columnsMenu,
|
|
3107
3118
|
side: "bottom",
|
|
3108
3119
|
align: "end",
|
|
@@ -3111,7 +3122,7 @@ function ln(e) {
|
|
|
3111
3122
|
autoFocus: !1,
|
|
3112
3123
|
p: 0,
|
|
3113
3124
|
overflow: "visible",
|
|
3114
|
-
trigger: (e) => /* @__PURE__ */
|
|
3125
|
+
trigger: (e) => /* @__PURE__ */ L(h, {
|
|
3115
3126
|
...e,
|
|
3116
3127
|
component: `${i}.topBar.columnVisibility`,
|
|
3117
3128
|
props: {
|
|
@@ -3119,17 +3130,17 @@ function ln(e) {
|
|
|
3119
3130
|
"aria-label": c ? r.columnsMenuLabel(o, s) : void 0
|
|
3120
3131
|
},
|
|
3121
3132
|
children: [
|
|
3122
|
-
/* @__PURE__ */
|
|
3133
|
+
/* @__PURE__ */ I(m, {
|
|
3123
3134
|
viewBox: "0 0 20 20",
|
|
3124
3135
|
width: 16,
|
|
3125
3136
|
height: 16,
|
|
3126
3137
|
fill: "none",
|
|
3127
3138
|
stroke: "currentColor",
|
|
3128
3139
|
strokeWidth: 1.6,
|
|
3129
|
-
children: /* @__PURE__ */
|
|
3140
|
+
children: /* @__PURE__ */ I(p, { d: "M4.5 3.5h11a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-11a1 1 0 0 1 1-1ZM8 3.5v13M12 3.5v13" })
|
|
3130
3141
|
}),
|
|
3131
3142
|
r.columnsMenu,
|
|
3132
|
-
c && /* @__PURE__ */
|
|
3143
|
+
c && /* @__PURE__ */ L(a, {
|
|
3133
3144
|
component: `${i}.topBar.columnVisibility.badge`,
|
|
3134
3145
|
tag: "span",
|
|
3135
3146
|
variant: { empty: o === 0 },
|
|
@@ -3142,7 +3153,7 @@ function ln(e) {
|
|
|
3142
3153
|
})
|
|
3143
3154
|
]
|
|
3144
3155
|
}),
|
|
3145
|
-
children: /* @__PURE__ */
|
|
3156
|
+
children: /* @__PURE__ */ I(fn, {
|
|
3146
3157
|
grid: t,
|
|
3147
3158
|
open: l,
|
|
3148
3159
|
query: d,
|
|
@@ -3150,13 +3161,13 @@ function ln(e) {
|
|
|
3150
3161
|
})
|
|
3151
3162
|
}) });
|
|
3152
3163
|
}
|
|
3153
|
-
|
|
3154
|
-
function
|
|
3155
|
-
let { columnVisibility: i, localeText: o, componentName: s } = e, c = `${s}.topBar.columnVisibility`, l =
|
|
3156
|
-
|
|
3164
|
+
dn.displayName = "DataGridColumnsPanel";
|
|
3165
|
+
function fn({ grid: e, open: t, query: n, onQueryChange: r }) {
|
|
3166
|
+
let { columnVisibility: i, localeText: o, componentName: s } = e, c = `${s}.topBar.columnVisibility`, l = N(null), u = N(null), d = i.total > un, f = i.search(n), p = i.sections(f), m = f.every((e) => e.visible), g = f.every((e) => !e.visible);
|
|
3167
|
+
M(() => {
|
|
3157
3168
|
t && (u.current ?? l.current?.querySelector("input"))?.focus();
|
|
3158
3169
|
}, [t]);
|
|
3159
|
-
let v =
|
|
3170
|
+
let v = A((e) => {
|
|
3160
3171
|
if (![
|
|
3161
3172
|
"ArrowDown",
|
|
3162
3173
|
"ArrowUp",
|
|
@@ -3173,20 +3184,20 @@ function un({ grid: e, open: t, query: n, onQueryChange: r }) {
|
|
|
3173
3184
|
}[e.key];
|
|
3174
3185
|
e.preventDefault(), i?.focus();
|
|
3175
3186
|
}, []);
|
|
3176
|
-
return /* @__PURE__ */
|
|
3187
|
+
return /* @__PURE__ */ L(_, {
|
|
3177
3188
|
ref: l,
|
|
3178
3189
|
component: `${c}.panel`,
|
|
3179
3190
|
props: { onKeyDown: v },
|
|
3180
3191
|
children: [
|
|
3181
|
-
d && /* @__PURE__ */
|
|
3192
|
+
d && /* @__PURE__ */ L(_, {
|
|
3182
3193
|
component: `${c}.search`,
|
|
3183
|
-
children: [/* @__PURE__ */
|
|
3194
|
+
children: [/* @__PURE__ */ I(_, {
|
|
3184
3195
|
component: `${c}.searchIcon`,
|
|
3185
|
-
children: /* @__PURE__ */
|
|
3196
|
+
children: /* @__PURE__ */ I(ln, {
|
|
3186
3197
|
fill: "currentColor",
|
|
3187
3198
|
width: "14px"
|
|
3188
3199
|
})
|
|
3189
|
-
}), /* @__PURE__ */
|
|
3200
|
+
}), /* @__PURE__ */ I(x, {
|
|
3190
3201
|
ref: u,
|
|
3191
3202
|
component: `${c}.searchInput`,
|
|
3192
3203
|
value: n,
|
|
@@ -3199,19 +3210,19 @@ function un({ grid: e, open: t, query: n, onQueryChange: r }) {
|
|
|
3199
3210
|
}
|
|
3200
3211
|
})]
|
|
3201
3212
|
}),
|
|
3202
|
-
/* @__PURE__ */
|
|
3213
|
+
/* @__PURE__ */ L(_, {
|
|
3203
3214
|
component: `${c}.toolbar`,
|
|
3204
|
-
children: [/* @__PURE__ */
|
|
3215
|
+
children: [/* @__PURE__ */ I(a, {
|
|
3205
3216
|
component: `${c}.count`,
|
|
3206
3217
|
children: o.columnsMenuShown(i.visibleCount, i.total)
|
|
3207
|
-
}), /* @__PURE__ */
|
|
3218
|
+
}), /* @__PURE__ */ L(_, {
|
|
3208
3219
|
gap: 1,
|
|
3209
|
-
children: [/* @__PURE__ */
|
|
3220
|
+
children: [/* @__PURE__ */ I(h, {
|
|
3210
3221
|
component: `${c}.action`,
|
|
3211
3222
|
disabled: m,
|
|
3212
3223
|
onClick: () => i.setAll(!0, f),
|
|
3213
3224
|
children: o.columnsMenuShowAll
|
|
3214
|
-
}), /* @__PURE__ */
|
|
3225
|
+
}), /* @__PURE__ */ I(h, {
|
|
3215
3226
|
component: `${c}.action`,
|
|
3216
3227
|
disabled: g,
|
|
3217
3228
|
onClick: () => i.setAll(!1, f),
|
|
@@ -3219,20 +3230,20 @@ function un({ grid: e, open: t, query: n, onQueryChange: r }) {
|
|
|
3219
3230
|
})]
|
|
3220
3231
|
})]
|
|
3221
3232
|
}),
|
|
3222
|
-
/* @__PURE__ */
|
|
3233
|
+
/* @__PURE__ */ L(_, {
|
|
3223
3234
|
component: `${c}.list`,
|
|
3224
|
-
children: [p.map((e, t) => /* @__PURE__ */
|
|
3235
|
+
children: [p.map((e, t) => /* @__PURE__ */ L(_, {
|
|
3225
3236
|
component: `${c}.section`,
|
|
3226
3237
|
variant: { divided: t > 0 && !e.group },
|
|
3227
3238
|
props: e.group ? {
|
|
3228
3239
|
role: "group",
|
|
3229
3240
|
"aria-label": e.group
|
|
3230
3241
|
} : void 0,
|
|
3231
|
-
children: [e.group && /* @__PURE__ */
|
|
3242
|
+
children: [e.group && /* @__PURE__ */ I(a, {
|
|
3232
3243
|
component: `${c}.group`,
|
|
3233
3244
|
props: { "aria-hidden": !0 },
|
|
3234
3245
|
children: e.group
|
|
3235
|
-
}), e.entries.map((e) => /* @__PURE__ */
|
|
3246
|
+
}), e.entries.map((e) => /* @__PURE__ */ I(te, {
|
|
3236
3247
|
checked: e.visible,
|
|
3237
3248
|
onChange: () => e.column.toggleVisibility(),
|
|
3238
3249
|
label: e.label,
|
|
@@ -3241,7 +3252,7 @@ function un({ grid: e, open: t, query: n, onQueryChange: r }) {
|
|
|
3241
3252
|
display: "flex"
|
|
3242
3253
|
}
|
|
3243
3254
|
}, e.id))]
|
|
3244
|
-
}, `${e.group ?? ""}-${t}`)), f.length === 0 && /* @__PURE__ */
|
|
3255
|
+
}, `${e.group ?? ""}-${t}`)), f.length === 0 && /* @__PURE__ */ I(a, {
|
|
3245
3256
|
component: `${c}.empty`,
|
|
3246
3257
|
props: { role: "status" },
|
|
3247
3258
|
children: o.columnsMenuNoMatch(n.trim())
|
|
@@ -3252,18 +3263,18 @@ function un({ grid: e, open: t, query: n, onQueryChange: r }) {
|
|
|
3252
3263
|
}
|
|
3253
3264
|
//#endregion
|
|
3254
3265
|
//#region src/components/dataGrid/components/dataGridExport.tsx
|
|
3255
|
-
function
|
|
3256
|
-
let { grid: t } = e, n = t.exportConfig, r =
|
|
3257
|
-
return n ? /* @__PURE__ */
|
|
3266
|
+
function pn(e) {
|
|
3267
|
+
let { grid: t } = e, n = t.exportConfig, r = A(() => void t.exportCsv(n).then(() => t.reportInteraction("export", "csv", "toolbar"), () => void 0), [t, n]), i = A(() => void t.exportXlsx(n).then(() => t.reportInteraction("export", "xlsx", "toolbar"), () => void 0), [t, n]);
|
|
3268
|
+
return n ? /* @__PURE__ */ L(_, {
|
|
3258
3269
|
component: `${t.componentName}.topBar.export`,
|
|
3259
3270
|
ai: "center",
|
|
3260
3271
|
gap: 2,
|
|
3261
|
-
children: [n.csv !== !1 && /* @__PURE__ */
|
|
3272
|
+
children: [n.csv !== !1 && /* @__PURE__ */ I(mn, {
|
|
3262
3273
|
componentName: t.componentName,
|
|
3263
3274
|
onClick: r,
|
|
3264
3275
|
label: t.localeText.exportCsvLabel,
|
|
3265
3276
|
children: t.localeText.exportCsv
|
|
3266
|
-
}), n.xlsx !== !1 && /* @__PURE__ */
|
|
3277
|
+
}), n.xlsx !== !1 && /* @__PURE__ */ I(mn, {
|
|
3267
3278
|
componentName: t.componentName,
|
|
3268
3279
|
onClick: i,
|
|
3269
3280
|
label: t.localeText.exportExcelLabel,
|
|
@@ -3271,25 +3282,25 @@ function dn(e) {
|
|
|
3271
3282
|
})]
|
|
3272
3283
|
}) : null;
|
|
3273
3284
|
}
|
|
3274
|
-
|
|
3275
|
-
function
|
|
3285
|
+
pn.displayName = "DataGridExport";
|
|
3286
|
+
function mn(e) {
|
|
3276
3287
|
let { componentName: t, onClick: n, label: r, children: i } = e;
|
|
3277
|
-
return /* @__PURE__ */
|
|
3288
|
+
return /* @__PURE__ */ L(h, {
|
|
3278
3289
|
component: `${t}.topBar.export.button`,
|
|
3279
3290
|
onClick: n,
|
|
3280
3291
|
props: { "aria-label": r },
|
|
3281
|
-
children: [/* @__PURE__ */
|
|
3292
|
+
children: [/* @__PURE__ */ L(m, {
|
|
3282
3293
|
viewBox: "0 0 20 20",
|
|
3283
3294
|
width: 16,
|
|
3284
3295
|
height: 16,
|
|
3285
3296
|
fill: "none",
|
|
3286
3297
|
stroke: "currentColor",
|
|
3287
3298
|
strokeWidth: 1.6,
|
|
3288
|
-
children: [/* @__PURE__ */
|
|
3299
|
+
children: [/* @__PURE__ */ I(p, {
|
|
3289
3300
|
d: "M10 3v9m0 0 3.5-3.5M10 12 6.5 8.5",
|
|
3290
3301
|
strokeLinecap: "round",
|
|
3291
3302
|
strokeLinejoin: "round"
|
|
3292
|
-
}), /* @__PURE__ */
|
|
3303
|
+
}), /* @__PURE__ */ I(p, {
|
|
3293
3304
|
d: "M3.5 13.5v2a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-2",
|
|
3294
3305
|
strokeLinecap: "round"
|
|
3295
3306
|
})]
|
|
@@ -3298,38 +3309,38 @@ function fn(e) {
|
|
|
3298
3309
|
}
|
|
3299
3310
|
//#endregion
|
|
3300
3311
|
//#region src/components/dataGrid/components/dataGridGlobalFilter.tsx
|
|
3301
|
-
function
|
|
3302
|
-
let { grid: t } = e, [n, r] =
|
|
3312
|
+
function hn(e) {
|
|
3313
|
+
let { grid: t } = e, [n, r] = P(t.globalFilterValue), { debounce: i, cancel: o } = It(t.globalFilterValue, (e) => e === n, r), s = A((e) => {
|
|
3303
3314
|
let n = e.target.value;
|
|
3304
3315
|
r(n), i("value", () => t.filter.setGlobalFilter(n));
|
|
3305
|
-
}, [t, i]), c =
|
|
3316
|
+
}, [t, i]), c = A(() => {
|
|
3306
3317
|
o(), r(""), t.filter.setGlobalFilter("");
|
|
3307
3318
|
}, [t, o]), { filtered: l, total: u } = t.filter.filterStats, d = !t.props.def.bottomBar && t.filter.hasActiveFilters && l !== u;
|
|
3308
|
-
return /* @__PURE__ */
|
|
3319
|
+
return /* @__PURE__ */ L(_, {
|
|
3309
3320
|
component: `${t.componentName}.topBar.globalFilter`,
|
|
3310
|
-
children: [d && /* @__PURE__ */
|
|
3321
|
+
children: [d && /* @__PURE__ */ L(a, {
|
|
3311
3322
|
component: `${t.componentName}.topBar.globalFilter.stats`,
|
|
3312
3323
|
children: [
|
|
3313
3324
|
l,
|
|
3314
3325
|
"/",
|
|
3315
3326
|
u
|
|
3316
3327
|
]
|
|
3317
|
-
}), /* @__PURE__ */
|
|
3328
|
+
}), /* @__PURE__ */ L(_, {
|
|
3318
3329
|
position: "relative",
|
|
3319
3330
|
ai: "center",
|
|
3320
3331
|
children: [
|
|
3321
|
-
/* @__PURE__ */
|
|
3332
|
+
/* @__PURE__ */ I(_, {
|
|
3322
3333
|
position: "absolute",
|
|
3323
3334
|
insetStart: 3,
|
|
3324
3335
|
pointerEvents: "none",
|
|
3325
3336
|
color: "base-400",
|
|
3326
3337
|
theme: { dark: { color: "base-500" } },
|
|
3327
|
-
children: /* @__PURE__ */
|
|
3338
|
+
children: /* @__PURE__ */ I(ln, {
|
|
3328
3339
|
fill: "currentColor",
|
|
3329
3340
|
width: "14px"
|
|
3330
3341
|
})
|
|
3331
3342
|
}),
|
|
3332
|
-
/* @__PURE__ */
|
|
3343
|
+
/* @__PURE__ */ I(x, {
|
|
3333
3344
|
placeholder: t.localeText.searchPlaceholder,
|
|
3334
3345
|
variant: "compact",
|
|
3335
3346
|
value: n,
|
|
@@ -3337,7 +3348,7 @@ function pn(e) {
|
|
|
3337
3348
|
ps: 8,
|
|
3338
3349
|
pe: n ? 8 : 3
|
|
3339
3350
|
}),
|
|
3340
|
-
n && /* @__PURE__ */
|
|
3351
|
+
n && /* @__PURE__ */ I(a, {
|
|
3341
3352
|
position: "absolute",
|
|
3342
3353
|
insetEnd: 2,
|
|
3343
3354
|
cursor: "pointer",
|
|
@@ -3349,7 +3360,7 @@ function pn(e) {
|
|
|
3349
3360
|
hover: { color: "base-300" }
|
|
3350
3361
|
} },
|
|
3351
3362
|
props: { onClick: c },
|
|
3352
|
-
children: /* @__PURE__ */
|
|
3363
|
+
children: /* @__PURE__ */ I(a, {
|
|
3353
3364
|
fontSize: 12,
|
|
3354
3365
|
fontWeight: 600,
|
|
3355
3366
|
children: "✕"
|
|
@@ -3361,52 +3372,52 @@ function pn(e) {
|
|
|
3361
3372
|
}
|
|
3362
3373
|
//#endregion
|
|
3363
3374
|
//#region src/components/dataGrid/components/dataGridTopBar.tsx
|
|
3364
|
-
function
|
|
3375
|
+
function gn(e) {
|
|
3365
3376
|
let { grid: t } = e, { title: n, topBarContent: r, globalFilter: i } = t.props.def;
|
|
3366
|
-
return /* @__PURE__ */
|
|
3377
|
+
return /* @__PURE__ */ L(_, {
|
|
3367
3378
|
component: `${t.componentName}.topBar`,
|
|
3368
3379
|
position: "relative",
|
|
3369
3380
|
d: "column",
|
|
3370
3381
|
gap: 3,
|
|
3371
|
-
children: [/* @__PURE__ */
|
|
3382
|
+
children: [/* @__PURE__ */ L(_, {
|
|
3372
3383
|
ai: "center",
|
|
3373
3384
|
jc: "space-between",
|
|
3374
3385
|
gap: 4,
|
|
3375
3386
|
flexWrap: "wrap",
|
|
3376
3387
|
width: "fit",
|
|
3377
|
-
children: [/* @__PURE__ */
|
|
3388
|
+
children: [/* @__PURE__ */ L(_, {
|
|
3378
3389
|
ai: "center",
|
|
3379
3390
|
gap: 3,
|
|
3380
3391
|
flexWrap: "wrap",
|
|
3381
3392
|
minWidth: 0,
|
|
3382
|
-
children: [n && /* @__PURE__ */
|
|
3393
|
+
children: [n && /* @__PURE__ */ I(a, {
|
|
3383
3394
|
id: t.titleId,
|
|
3384
3395
|
fontWeight: 600,
|
|
3385
3396
|
fontSize: 16,
|
|
3386
3397
|
color: "base-800",
|
|
3387
3398
|
theme: { dark: { color: "base-100" } },
|
|
3388
3399
|
children: n
|
|
3389
|
-
}), /* @__PURE__ */
|
|
3390
|
-
}), /* @__PURE__ */
|
|
3400
|
+
}), /* @__PURE__ */ I(cn, { grid: t })]
|
|
3401
|
+
}), /* @__PURE__ */ L(_, {
|
|
3391
3402
|
ai: "center",
|
|
3392
3403
|
gap: 3,
|
|
3393
3404
|
flexWrap: "wrap",
|
|
3394
3405
|
children: [
|
|
3395
|
-
i && /* @__PURE__ */
|
|
3396
|
-
/* @__PURE__ */
|
|
3397
|
-
/* @__PURE__ */
|
|
3406
|
+
i && /* @__PURE__ */ I(hn, { grid: t }),
|
|
3407
|
+
/* @__PURE__ */ I(dn, { grid: t }),
|
|
3408
|
+
/* @__PURE__ */ I(pn, { grid: t })
|
|
3398
3409
|
]
|
|
3399
3410
|
})]
|
|
3400
|
-
}), r && /* @__PURE__ */
|
|
3411
|
+
}), r && /* @__PURE__ */ I(a, {
|
|
3401
3412
|
width: "fit",
|
|
3402
3413
|
children: r
|
|
3403
3414
|
})]
|
|
3404
3415
|
});
|
|
3405
3416
|
}
|
|
3406
|
-
|
|
3417
|
+
gn.displayName = "DataGridTopBar";
|
|
3407
3418
|
//#endregion
|
|
3408
3419
|
//#region src/utils/string/fuzzySearch.ts
|
|
3409
|
-
function
|
|
3420
|
+
function _n(e, t) {
|
|
3410
3421
|
if (!e) return {
|
|
3411
3422
|
score: 1,
|
|
3412
3423
|
matches: []
|
|
@@ -3419,16 +3430,16 @@ function hn(e, t) {
|
|
|
3419
3430
|
matches: o
|
|
3420
3431
|
});
|
|
3421
3432
|
}
|
|
3422
|
-
function
|
|
3423
|
-
return
|
|
3433
|
+
function vn(e, t) {
|
|
3434
|
+
return _n(e, t) !== null;
|
|
3424
3435
|
}
|
|
3425
3436
|
//#endregion
|
|
3426
3437
|
//#region src/components/dataGrid/components/dataGridCellRowDetail.tsx
|
|
3427
|
-
function
|
|
3428
|
-
let { cell: t } = e, n = t.isExpanded, r =
|
|
3438
|
+
function yn(e) {
|
|
3439
|
+
let { cell: t } = e, n = t.isExpanded, r = A((e) => {
|
|
3429
3440
|
e.stopPropagation(), t.toggleDetail();
|
|
3430
3441
|
}, [t]);
|
|
3431
|
-
return /* @__PURE__ */
|
|
3442
|
+
return /* @__PURE__ */ I(h, {
|
|
3432
3443
|
component: `${t.grid.componentName}.body.cell.rowDetail`,
|
|
3433
3444
|
variant: { isExpanded: n },
|
|
3434
3445
|
type: "button",
|
|
@@ -3444,7 +3455,7 @@ function _n(e) {
|
|
|
3444
3455
|
"aria-label": (n ? t.grid.localeText.collapseRowDetail : t.grid.localeText.expandRowDetail)(t.row.rowIndex + 1),
|
|
3445
3456
|
"aria-expanded": n
|
|
3446
3457
|
},
|
|
3447
|
-
children: /* @__PURE__ */
|
|
3458
|
+
children: /* @__PURE__ */ I(Y, {
|
|
3448
3459
|
fill: "currentColor",
|
|
3449
3460
|
width: "14px",
|
|
3450
3461
|
height: "14px",
|
|
@@ -3452,14 +3463,14 @@ function _n(e) {
|
|
|
3452
3463
|
})
|
|
3453
3464
|
});
|
|
3454
3465
|
}
|
|
3455
|
-
|
|
3466
|
+
yn.displayName = "DataGridCellRowDetail";
|
|
3456
3467
|
//#endregion
|
|
3457
3468
|
//#region src/components/dataGrid/components/dataGridCellRowSelection.tsx
|
|
3458
|
-
function
|
|
3459
|
-
let { cell: t } = e, n =
|
|
3469
|
+
function bn(e) {
|
|
3470
|
+
let { cell: t } = e, n = A(() => {
|
|
3460
3471
|
t.toggleSelection();
|
|
3461
3472
|
}, [t]);
|
|
3462
|
-
return /* @__PURE__ */
|
|
3473
|
+
return /* @__PURE__ */ I(v, {
|
|
3463
3474
|
variant: "datagrid",
|
|
3464
3475
|
checked: t.selected,
|
|
3465
3476
|
indeterminate: t.indeterminate,
|
|
@@ -3470,15 +3481,15 @@ function vn(e) {
|
|
|
3470
3481
|
}
|
|
3471
3482
|
});
|
|
3472
3483
|
}
|
|
3473
|
-
|
|
3484
|
+
bn.displayName = "DataGridCellRowSelection";
|
|
3474
3485
|
//#endregion
|
|
3475
3486
|
//#region src/components/dataGrid/contracts/dataGridContract.ts
|
|
3476
|
-
function
|
|
3487
|
+
function xn(e) {
|
|
3477
3488
|
if (e) return e === "LEFT" ? "START" : e === "RIGHT" ? "END" : e;
|
|
3478
3489
|
}
|
|
3479
3490
|
//#endregion
|
|
3480
3491
|
//#region src/components/dataGrid/models/headerCellModel.ts
|
|
3481
|
-
var
|
|
3492
|
+
var Sn = 1e3, Cn = class {
|
|
3482
3493
|
column;
|
|
3483
3494
|
constructor(e) {
|
|
3484
3495
|
this.column = e;
|
|
@@ -3491,7 +3502,7 @@ var bn = 1e3, xn = class {
|
|
|
3491
3502
|
if (e.isRowNumber || e.isRowSelection) return null;
|
|
3492
3503
|
if (e.isGrouping) {
|
|
3493
3504
|
if (this.grid.groupColumns.size === 1) {
|
|
3494
|
-
let e = this.grid.groupColumns.values().next().value, t =
|
|
3505
|
+
let e = this.grid.groupColumns.values().next().value, t = W.findOrThrow(this.grid.columns.value.leafs, (t) => t.key === e);
|
|
3495
3506
|
return t.header ?? t.key;
|
|
3496
3507
|
}
|
|
3497
3508
|
return this.grid.localeText.groupHeader;
|
|
@@ -3555,7 +3566,7 @@ var bn = 1e3, xn = class {
|
|
|
3555
3566
|
return Math.max(1, this.column.leafs.length) * this.grid.MIN_COLUMN_WIDTH_PX;
|
|
3556
3567
|
}
|
|
3557
3568
|
get maxWidth() {
|
|
3558
|
-
return Math.max(this.grid.containerWidth ||
|
|
3569
|
+
return Math.max(this.grid.containerWidth || Sn, this.width, this.minWidth);
|
|
3559
3570
|
}
|
|
3560
3571
|
get paddingStart() {
|
|
3561
3572
|
if (!this.column.isRowSelection) return this.column.isEndAligned ? 10 : 3;
|
|
@@ -3641,16 +3652,16 @@ var bn = 1e3, xn = class {
|
|
|
3641
3652
|
pin: t.pin
|
|
3642
3653
|
} : r, n, this)) ?? [], this.isLeaf) {
|
|
3643
3654
|
let e = this.grid.columnWidths.get(this.key);
|
|
3644
|
-
this._inlineWidth = e ?? this.def.width ?? this.grid.DEFAULT_COLUMN_WIDTH_PX, this._pin =
|
|
3655
|
+
this._inlineWidth = e ?? this.def.width ?? this.grid.DEFAULT_COLUMN_WIDTH_PX, this._pin = xn(t.pin);
|
|
3645
3656
|
}
|
|
3646
3657
|
}
|
|
3647
3658
|
columns = [];
|
|
3648
3659
|
get kind() {
|
|
3649
3660
|
switch (this.key) {
|
|
3650
|
-
case
|
|
3651
|
-
case
|
|
3652
|
-
case
|
|
3653
|
-
case
|
|
3661
|
+
case Xe: return "rowNumber";
|
|
3662
|
+
case Ze: return "rowSelection";
|
|
3663
|
+
case Qe: return "rowDetail";
|
|
3664
|
+
case G: return "grouping";
|
|
3654
3665
|
default: return "data";
|
|
3655
3666
|
}
|
|
3656
3667
|
}
|
|
@@ -3705,7 +3716,7 @@ var bn = 1e3, xn = class {
|
|
|
3705
3716
|
insetInlineEnd: t ? `var(${this.inlineEndVarName})` : void 0
|
|
3706
3717
|
};
|
|
3707
3718
|
}, () => [this.pinFlags]);
|
|
3708
|
-
_headerCell = q(() => new
|
|
3719
|
+
_headerCell = q(() => new Cn(this));
|
|
3709
3720
|
get headerCell() {
|
|
3710
3721
|
return this._headerCell.value;
|
|
3711
3722
|
}
|
|
@@ -3840,7 +3851,7 @@ var bn = 1e3, xn = class {
|
|
|
3840
3851
|
};
|
|
3841
3852
|
}
|
|
3842
3853
|
get isFlexible() {
|
|
3843
|
-
return this.def.flexible !== !1;
|
|
3854
|
+
return this.isRowNumber || this.isRowSelection || this.isRowDetail ? !1 : this.def.flexible !== !1;
|
|
3844
3855
|
}
|
|
3845
3856
|
get baseWidth() {
|
|
3846
3857
|
return this._inlineWidth ?? this.grid.DEFAULT_COLUMN_WIDTH_PX;
|
|
@@ -3881,16 +3892,16 @@ var bn = 1e3, xn = class {
|
|
|
3881
3892
|
get inlineWidth() {
|
|
3882
3893
|
if (this.isLeaf) return this.grid.getFlexWidth(this.key) ?? this._inlineWidth;
|
|
3883
3894
|
let e = this.visibleColumns.map((e) => e.inlineWidth).filter((e) => typeof e == "number");
|
|
3884
|
-
if (e.length !== 0) return
|
|
3895
|
+
if (e.length !== 0) return W.sumBy(e, (e) => e);
|
|
3885
3896
|
}
|
|
3886
3897
|
get startOffset() {
|
|
3887
3898
|
let e = 0;
|
|
3888
3899
|
if (this.parent) {
|
|
3889
3900
|
let { visibleColumns: t, startOffset: n } = this.parent, r = t.findIndex((e) => e === this);
|
|
3890
|
-
e +=
|
|
3901
|
+
e += W.sumBy(t, (e, t) => t < r ? e.inlineWidth ?? 0 : 0), e += n;
|
|
3891
3902
|
} else {
|
|
3892
3903
|
let t = this.grid.columns.value.start.filter((e) => e.isVisible), n = t.findIndex((e) => e === this);
|
|
3893
|
-
e +=
|
|
3904
|
+
e += W.sumBy(t, (e, t) => t < n ? e.inlineWidth ?? 0 : 0);
|
|
3894
3905
|
}
|
|
3895
3906
|
return e;
|
|
3896
3907
|
}
|
|
@@ -3898,10 +3909,10 @@ var bn = 1e3, xn = class {
|
|
|
3898
3909
|
let e = 0;
|
|
3899
3910
|
if (this.parent) {
|
|
3900
3911
|
let { visibleColumns: t } = this.parent, n = t.reverse(), r = n.findIndex((e) => e === this);
|
|
3901
|
-
e +=
|
|
3912
|
+
e += W.sumBy(n, (e, t) => t < r ? e.inlineWidth ?? 0 : 0), e += this.parent.endOffset;
|
|
3902
3913
|
} else {
|
|
3903
3914
|
let t = this.grid.columns.value.end.filter((e) => e.isVisible).reverse(), n = t.findIndex((e) => e === this);
|
|
3904
|
-
e +=
|
|
3915
|
+
e += W.sumBy(t, (e, t) => t < n ? e.inlineWidth ?? 0 : 0);
|
|
3905
3916
|
}
|
|
3906
3917
|
return e;
|
|
3907
3918
|
}
|
|
@@ -3939,7 +3950,7 @@ var bn = 1e3, xn = class {
|
|
|
3939
3950
|
_resizeTotalWidth = 0;
|
|
3940
3951
|
beginResize = (e) => {
|
|
3941
3952
|
let { MIN_COLUMN_WIDTH_PX: t } = this.grid;
|
|
3942
|
-
this._resizeStartX = e, this._resizeSizes =
|
|
3953
|
+
this._resizeStartX = e, this._resizeSizes = W.toRecord(this.leafs, (e) => [e.key, e.inlineWidth ?? e.baseWidth]), this._resizeTotalWidth = W.sumBy(this.leafs, (e) => this._resizeSizes[e.key]) - this.leafs.length * t;
|
|
3943
3954
|
};
|
|
3944
3955
|
get resizeSign() {
|
|
3945
3956
|
return this.pin === "END" === this.grid.isRtl ? 1 : -1;
|
|
@@ -3952,10 +3963,10 @@ var bn = 1e3, xn = class {
|
|
|
3952
3963
|
}), this.grid.flexWidths.clear();
|
|
3953
3964
|
};
|
|
3954
3965
|
resizeTo = (e) => {
|
|
3955
|
-
this.applyResize(e), this.grid.
|
|
3966
|
+
this.applyResize(e), this.grid.notifyLayout();
|
|
3956
3967
|
};
|
|
3957
3968
|
endResize = () => {
|
|
3958
|
-
this.grid.
|
|
3969
|
+
this.grid.notifyLayout(), this.grid.reportInteraction("columnResize", this.leafs.reduce((e, t) => e + (t.inlineWidth ?? t.baseWidth), 0), "resize", { columnKey: this.key });
|
|
3959
3970
|
};
|
|
3960
3971
|
moveResizer = (e) => {
|
|
3961
3972
|
this.beginResize(0), this.applyResize(e);
|
|
@@ -3969,7 +3980,7 @@ var bn = 1e3, xn = class {
|
|
|
3969
3980
|
this.setPin(e), this.pin !== t && this.grid.reportInteraction("columnPinChange", this.pin, this.pin ? "pin" : "unpin", { columnKey: this.key });
|
|
3970
3981
|
};
|
|
3971
3982
|
setPin(e) {
|
|
3972
|
-
this.isLeaf ? this._pin =
|
|
3983
|
+
this.isLeaf ? this._pin = xn(e) : this.columns.forEach((t) => t.setPin(e)), this.grid.pinColumn(this.uniqueKey, e);
|
|
3973
3984
|
}
|
|
3974
3985
|
toggleGrouping = () => {
|
|
3975
3986
|
this.grid.toggleGrouping(this.key);
|
|
@@ -3984,7 +3995,7 @@ var bn = 1e3, xn = class {
|
|
|
3984
3995
|
toggleVisibility = () => {
|
|
3985
3996
|
this.grid.toggleColumnVisibility(this.key);
|
|
3986
3997
|
};
|
|
3987
|
-
},
|
|
3998
|
+
}, wn = class {
|
|
3988
3999
|
grid;
|
|
3989
4000
|
constructor(e) {
|
|
3990
4001
|
this.grid = e;
|
|
@@ -4043,19 +4054,19 @@ var bn = 1e3, xn = class {
|
|
|
4043
4054
|
};
|
|
4044
4055
|
//#endregion
|
|
4045
4056
|
//#region src/utils/array/lazyList.ts
|
|
4046
|
-
function
|
|
4057
|
+
function Tn(e, t) {
|
|
4047
4058
|
return new Proxy([], {
|
|
4048
4059
|
get(n, r, i) {
|
|
4049
4060
|
if (r === "length") return e;
|
|
4050
|
-
let a =
|
|
4061
|
+
let a = En(r, e);
|
|
4051
4062
|
return a === void 0 ? Reflect.get(n, r, i) : t(a);
|
|
4052
4063
|
},
|
|
4053
4064
|
has(t, n) {
|
|
4054
|
-
return
|
|
4065
|
+
return En(n, e) !== void 0 || Reflect.has(t, n);
|
|
4055
4066
|
},
|
|
4056
4067
|
getOwnPropertyDescriptor(n, r) {
|
|
4057
|
-
return
|
|
4058
|
-
value: t(
|
|
4068
|
+
return En(r, e) === void 0 ? Reflect.getOwnPropertyDescriptor(n, r) : {
|
|
4069
|
+
value: t(En(r, e)),
|
|
4059
4070
|
writable: !0,
|
|
4060
4071
|
enumerable: !0,
|
|
4061
4072
|
configurable: !0
|
|
@@ -4063,7 +4074,7 @@ function Cn(e, t) {
|
|
|
4063
4074
|
}
|
|
4064
4075
|
});
|
|
4065
4076
|
}
|
|
4066
|
-
function
|
|
4077
|
+
function En(e, t) {
|
|
4067
4078
|
if (typeof e != "string") return;
|
|
4068
4079
|
let n = Number(e);
|
|
4069
4080
|
return Number.isInteger(n) && n >= 0 && n < t ? n : void 0;
|
|
@@ -4194,13 +4205,14 @@ var $ = class e {
|
|
|
4194
4205
|
}), this.source.changed());
|
|
4195
4206
|
});
|
|
4196
4207
|
}
|
|
4197
|
-
},
|
|
4208
|
+
}, Dn = class extends ct {
|
|
4198
4209
|
level;
|
|
4199
|
-
|
|
4200
|
-
|
|
4210
|
+
levelIndex;
|
|
4211
|
+
constructor(e, t, n, r, i = r) {
|
|
4212
|
+
super(e, n, [], i, ""), this.level = t, this.levelIndex = r;
|
|
4201
4213
|
}
|
|
4202
4214
|
get row() {
|
|
4203
|
-
return this.level.rowAt(this.
|
|
4215
|
+
return this.level.rowAt(this.levelIndex);
|
|
4204
4216
|
}
|
|
4205
4217
|
get data() {
|
|
4206
4218
|
return this.row;
|
|
@@ -4216,17 +4228,17 @@ var $ = class e {
|
|
|
4216
4228
|
return [...this.level.groupKeys, this.groupValue];
|
|
4217
4229
|
}
|
|
4218
4230
|
get key() {
|
|
4219
|
-
return this.placeholder ? `${this.level.placeholderKey}-group-${this.
|
|
4231
|
+
return this.placeholder ? `${this.level.placeholderKey}-group-${this.levelIndex}` : On(this.groupKeys);
|
|
4220
4232
|
}
|
|
4221
4233
|
get depth() {
|
|
4222
4234
|
return this.level.depth;
|
|
4223
4235
|
}
|
|
4224
4236
|
get count() {
|
|
4225
|
-
return this.level.groupCountAt(this.
|
|
4237
|
+
return this.level.groupCountAt(this.levelIndex) ?? 0;
|
|
4226
4238
|
}
|
|
4227
4239
|
get label() {
|
|
4228
4240
|
if (this.placeholder) return "";
|
|
4229
|
-
let e = this.level.groupCountAt(this.
|
|
4241
|
+
let e = this.level.groupCountAt(this.levelIndex);
|
|
4230
4242
|
return e === void 0 ? `${this.groupValue}` : `${this.groupValue} (${e})`;
|
|
4231
4243
|
}
|
|
4232
4244
|
aggregateValue(e) {
|
|
@@ -4252,28 +4264,29 @@ var $ = class e {
|
|
|
4252
4264
|
this.placeholder || this.grid.toggleGroupRow(this.key);
|
|
4253
4265
|
}
|
|
4254
4266
|
};
|
|
4255
|
-
function
|
|
4267
|
+
function On(e) {
|
|
4256
4268
|
return `rb-group:${$.keyOf(e)}`;
|
|
4257
4269
|
}
|
|
4258
4270
|
//#endregion
|
|
4259
4271
|
//#region src/components/dataGrid/models/sourceRowModel.ts
|
|
4260
|
-
var
|
|
4272
|
+
var kn = {}, An = class extends H {
|
|
4261
4273
|
sourceLevel;
|
|
4262
|
-
|
|
4263
|
-
|
|
4274
|
+
levelIndex;
|
|
4275
|
+
constructor(e, t, n, r = n) {
|
|
4276
|
+
super(e, kn, r), this.sourceLevel = t, this.levelIndex = n;
|
|
4264
4277
|
}
|
|
4265
4278
|
get row() {
|
|
4266
|
-
return this.sourceLevel.rowAt(this.
|
|
4279
|
+
return this.sourceLevel.rowAt(this.levelIndex);
|
|
4267
4280
|
}
|
|
4268
4281
|
get data() {
|
|
4269
|
-
return this.row ??
|
|
4282
|
+
return this.row ?? kn;
|
|
4270
4283
|
}
|
|
4271
4284
|
get placeholder() {
|
|
4272
4285
|
return this.row === void 0;
|
|
4273
4286
|
}
|
|
4274
4287
|
get key() {
|
|
4275
4288
|
let e = this.row;
|
|
4276
|
-
return e === void 0 ? `${this.sourceLevel.placeholderKey}-${this.
|
|
4289
|
+
return e === void 0 ? `${this.sourceLevel.placeholderKey}-${this.levelIndex}` : this.grid.getRowKey(e);
|
|
4277
4290
|
}
|
|
4278
4291
|
get expandOnRowClick() {
|
|
4279
4292
|
return !this.placeholder && super.expandOnRowClick;
|
|
@@ -4284,13 +4297,13 @@ var Dn = {}, On = class extends U {
|
|
|
4284
4297
|
get selected() {
|
|
4285
4298
|
return !this.placeholder && super.selected;
|
|
4286
4299
|
}
|
|
4287
|
-
},
|
|
4300
|
+
}, jn = class extends An {
|
|
4288
4301
|
isTreeRow = !0;
|
|
4289
4302
|
get level() {
|
|
4290
4303
|
return this.sourceLevel.depth;
|
|
4291
4304
|
}
|
|
4292
4305
|
get position() {
|
|
4293
|
-
return this.
|
|
4306
|
+
return this.levelIndex;
|
|
4294
4307
|
}
|
|
4295
4308
|
get siblings() {
|
|
4296
4309
|
return this.sourceLevel.totalCount ?? -1;
|
|
@@ -4304,7 +4317,7 @@ var Dn = {}, On = class extends U {
|
|
|
4304
4317
|
toggleTree = () => {
|
|
4305
4318
|
this.hasChildren && this.grid.tree.toggle(this.key, this.level);
|
|
4306
4319
|
};
|
|
4307
|
-
},
|
|
4320
|
+
}, Mn = 100, Nn = 40, Pn = class {
|
|
4308
4321
|
grid;
|
|
4309
4322
|
constructor(e) {
|
|
4310
4323
|
this.grid = e;
|
|
@@ -4330,11 +4343,11 @@ var Dn = {}, On = class extends U {
|
|
|
4330
4343
|
}
|
|
4331
4344
|
get blockSize() {
|
|
4332
4345
|
let e = this.config?.blockSize;
|
|
4333
|
-
return e && e > 0 ? Math.floor(e) : this.grid.isPaginated ? this.grid.pageSize :
|
|
4346
|
+
return e && e > 0 ? Math.floor(e) : this.grid.isPaginated ? this.grid.pageSize : Mn;
|
|
4334
4347
|
}
|
|
4335
4348
|
get maxBlocks() {
|
|
4336
4349
|
let e = this.config?.maxBlocks;
|
|
4337
|
-
return e && e > 0 ? Math.floor(e) :
|
|
4350
|
+
return e && e > 0 ? Math.floor(e) : Nn;
|
|
4338
4351
|
}
|
|
4339
4352
|
get queryVersion() {
|
|
4340
4353
|
return this._query;
|
|
@@ -4389,7 +4402,7 @@ var Dn = {}, On = class extends U {
|
|
|
4389
4402
|
return e.loadedBlocks().forEach(({ index: a, rows: o }) => {
|
|
4390
4403
|
o.forEach((o, s) => {
|
|
4391
4404
|
let c = [...e.path, o[r]];
|
|
4392
|
-
if (!t.has(
|
|
4405
|
+
if (!t.has(On(c))) return;
|
|
4393
4406
|
let l = a * n + s;
|
|
4394
4407
|
i.push({
|
|
4395
4408
|
rowIndex: l,
|
|
@@ -4443,20 +4456,20 @@ var Dn = {}, On = class extends U {
|
|
|
4443
4456
|
listLength = -1;
|
|
4444
4457
|
rowList() {
|
|
4445
4458
|
let { start: e } = this.visibleRange();
|
|
4446
|
-
return this.listLength = this.visibleLength(),
|
|
4459
|
+
return this.listLength = this.visibleLength(), Tn(this.listLength, (t) => this.rowModelAt(e + t));
|
|
4447
4460
|
}
|
|
4448
4461
|
flatRowList(e) {
|
|
4449
4462
|
let t = this.detailPositions();
|
|
4450
|
-
return t.length === 0 ? e :
|
|
4451
|
-
let r =
|
|
4452
|
-
return t[r] === n ? new
|
|
4463
|
+
return t.length === 0 ? e : Tn(e.length + t.length, (n) => {
|
|
4464
|
+
let r = In(t, n);
|
|
4465
|
+
return t[r] === n ? new Ue(this.grid, e[n - r - 1]) : e[n - r];
|
|
4453
4466
|
});
|
|
4454
4467
|
}
|
|
4455
4468
|
rowOffsets(e) {
|
|
4456
4469
|
let { rowHeight: t } = this.grid, n = this.detailPositions(), r = [0];
|
|
4457
4470
|
return n.forEach((t, n) => r.push(r[n] + e[t].heightForOffset)), {
|
|
4458
|
-
offsets:
|
|
4459
|
-
let i =
|
|
4471
|
+
offsets: Tn(e.length, (e) => {
|
|
4472
|
+
let i = In(n, e);
|
|
4460
4473
|
return (e - i) * t + r[i];
|
|
4461
4474
|
}),
|
|
4462
4475
|
totalHeight: (e.length - n.length) * t + r[n.length]
|
|
@@ -4485,7 +4498,7 @@ var Dn = {}, On = class extends U {
|
|
|
4485
4498
|
let i = this.levels.get(r);
|
|
4486
4499
|
!i || i.isGroupLevel || i.loadedBlocks().forEach(({ index: r, rows: i }) => {
|
|
4487
4500
|
i.forEach((i, a) => {
|
|
4488
|
-
let o =
|
|
4501
|
+
let o = Fn(n, r * t + a);
|
|
4489
4502
|
o !== void 0 && e(o, i);
|
|
4490
4503
|
});
|
|
4491
4504
|
});
|
|
@@ -4493,14 +4506,14 @@ var Dn = {}, On = class extends U {
|
|
|
4493
4506
|
}
|
|
4494
4507
|
rowModelAt(e) {
|
|
4495
4508
|
let t = this.segmentAt(e);
|
|
4496
|
-
if (!t) return new
|
|
4509
|
+
if (!t) return new An(this.grid, this.root, e);
|
|
4497
4510
|
let { level: n } = t, r = t.levelStart + (e - t.start), i = this.models.get(n.key);
|
|
4498
4511
|
i || this.models.set(n.key, i = /* @__PURE__ */ new Map());
|
|
4499
4512
|
let a = i.get(r);
|
|
4500
|
-
return a || (a = n.isGroupLevel ? new
|
|
4513
|
+
return a || (a = n.isGroupLevel ? new Dn(this.grid, n, this.groupColumnAt(n.depth), r) : this.isTree ? new jn(this.grid, n, r) : new An(this.grid, n, r), i.set(r, a)), a.rowIndex = e, a;
|
|
4501
4514
|
}
|
|
4502
4515
|
groupColumnAt(e) {
|
|
4503
|
-
return
|
|
4516
|
+
return W.findOrThrow(this.grid.columns.value.leafs, (t) => t.key === this.groupBy[e]);
|
|
4504
4517
|
}
|
|
4505
4518
|
visibleLength() {
|
|
4506
4519
|
let { start: e, end: t } = this.visibleRange();
|
|
@@ -4586,10 +4599,10 @@ var Dn = {}, On = class extends U {
|
|
|
4586
4599
|
this._segments = void 0, this._byLevel = void 0, this.listLength !== this.visibleLength() && this.grid.rows.clear(), this.grid.flatRows.clear(), this.grid.notify();
|
|
4587
4600
|
}
|
|
4588
4601
|
};
|
|
4589
|
-
function
|
|
4602
|
+
function Fn(e, t) {
|
|
4590
4603
|
for (let n of e) if (t >= n.levelStart && t < n.levelStart + n.length) return n.start + (t - n.levelStart);
|
|
4591
4604
|
}
|
|
4592
|
-
function
|
|
4605
|
+
function In(e, t) {
|
|
4593
4606
|
let n = 0, r = e.length;
|
|
4594
4607
|
for (; n < r;) {
|
|
4595
4608
|
let i = n + r >>> 1;
|
|
@@ -4599,7 +4612,7 @@ function Pn(e, t) {
|
|
|
4599
4612
|
}
|
|
4600
4613
|
//#endregion
|
|
4601
4614
|
//#region src/components/dataGrid/models/exportModel.ts
|
|
4602
|
-
var
|
|
4615
|
+
var Ln = 7, Rn = class {
|
|
4603
4616
|
grid;
|
|
4604
4617
|
constructor(e) {
|
|
4605
4618
|
this.grid = e;
|
|
@@ -4613,7 +4626,7 @@ var Fn = 7, In = class {
|
|
|
4613
4626
|
}
|
|
4614
4627
|
width(e) {
|
|
4615
4628
|
let t = e.inlineWidth ?? this.grid.DEFAULT_COLUMN_WIDTH_PX;
|
|
4616
|
-
return Math.min(80, Math.max(6, Math.round(t /
|
|
4629
|
+
return Math.min(80, Math.max(6, Math.round(t / Ln * 10) / 10));
|
|
4617
4630
|
}
|
|
4618
4631
|
value(e, t) {
|
|
4619
4632
|
let { exportValue: n } = e.def, r = n ? n(t) : t[e.key];
|
|
@@ -4621,7 +4634,7 @@ var Fn = 7, In = class {
|
|
|
4621
4634
|
}
|
|
4622
4635
|
aggregateOf(e, t) {
|
|
4623
4636
|
let n = e.aggregate;
|
|
4624
|
-
return n ?
|
|
4637
|
+
return n ? it(n, t.map((t) => this.value(e, t)), t) : null;
|
|
4625
4638
|
}
|
|
4626
4639
|
table(e = {}) {
|
|
4627
4640
|
let t = this.columns(e.columns), n = e.groups ?? !0, r = [], i = (e, a, o) => {
|
|
@@ -4636,7 +4649,7 @@ var Fn = 7, In = class {
|
|
|
4636
4649
|
}), i(s.rows, n ? a + 1 : a, o || n && e);
|
|
4637
4650
|
} else {
|
|
4638
4651
|
if (s.placeholder) continue;
|
|
4639
|
-
let e =
|
|
4652
|
+
let e = U(s) ? s.level : a;
|
|
4640
4653
|
r.push({
|
|
4641
4654
|
kind: "data",
|
|
4642
4655
|
level: e,
|
|
@@ -4685,7 +4698,7 @@ var Fn = 7, In = class {
|
|
|
4685
4698
|
let { title: t } = this.grid.props.def, n = typeof t == "string" && t.trim() ? t.trim() : this.grid.localeText.exportFileName;
|
|
4686
4699
|
return e.fileName?.trim() || n;
|
|
4687
4700
|
}
|
|
4688
|
-
},
|
|
4701
|
+
}, zn = class {
|
|
4689
4702
|
grid;
|
|
4690
4703
|
constructor(e) {
|
|
4691
4704
|
this.grid = e;
|
|
@@ -4707,7 +4720,7 @@ var Fn = 7, In = class {
|
|
|
4707
4720
|
}
|
|
4708
4721
|
setGlobalFilter = (e) => this.grid.setGlobalFilter(e);
|
|
4709
4722
|
clearAllFilters = () => this.grid.clearAllFilters();
|
|
4710
|
-
},
|
|
4723
|
+
}, Bn = class {
|
|
4711
4724
|
grid;
|
|
4712
4725
|
constructor(e) {
|
|
4713
4726
|
this.grid = e;
|
|
@@ -4846,23 +4859,23 @@ var Fn = 7, In = class {
|
|
|
4846
4859
|
describe(e, t) {
|
|
4847
4860
|
switch (t.type) {
|
|
4848
4861
|
case "text": return `“${t.value}”`;
|
|
4849
|
-
case "number": return t.operator === "between" ? `${t.value}–${t.valueTo ?? ""}` : `${
|
|
4862
|
+
case "number": return t.operator === "between" ? `${t.value}–${t.valueTo ?? ""}` : `${Hn[t.operator]} ${t.value}`;
|
|
4850
4863
|
case "multiselect": {
|
|
4851
4864
|
let n = e.filterOptions, r = t.values.map((e) => e === null ? this.grid.localeText.filterEmptyValue : n.find((t) => t.value === e)?.label ?? String(e)), i = r.slice(0, 2).join(", ");
|
|
4852
4865
|
return r.length > 2 ? `${i} +${r.length - 2}` : i;
|
|
4853
4866
|
}
|
|
4854
|
-
case "date": return t.operator === "between" ?
|
|
4867
|
+
case "date": return t.operator === "between" ? Oe()?.describeDay(t.value, t.valueTo ?? t.value) ?? `${t.value}–${t.valueTo ?? ""}` : `${Un[t.operator]} ${Oe()?.describeDay(t.value) ?? t.value}`;
|
|
4855
4868
|
}
|
|
4856
4869
|
}
|
|
4857
4870
|
_record = null;
|
|
4858
4871
|
get record() {
|
|
4859
4872
|
if (!this._record) return;
|
|
4860
4873
|
let e = this.grid.flatRows.value, { index: t, key: n } = this._record;
|
|
4861
|
-
if (
|
|
4874
|
+
if (Wn(e[t]) && e[t].key === n) return e[t];
|
|
4862
4875
|
let r = -1;
|
|
4863
|
-
for (let t = 0; t < Math.min(e.length,
|
|
4876
|
+
for (let t = 0; t < Math.min(e.length, Vn) && r === -1; t++) {
|
|
4864
4877
|
let i = e[t];
|
|
4865
|
-
|
|
4878
|
+
Wn(i) && i.key === n && (r = t);
|
|
4866
4879
|
}
|
|
4867
4880
|
if (r !== -1) return this._record = {
|
|
4868
4881
|
index: r,
|
|
@@ -4886,7 +4899,7 @@ var Fn = 7, In = class {
|
|
|
4886
4899
|
let t = this.grid.flatRows.value;
|
|
4887
4900
|
for (let n = this._record.index + e; n >= 0 && n < t.length; n += e) {
|
|
4888
4901
|
let e = t[n];
|
|
4889
|
-
if (
|
|
4902
|
+
if (Wn(e) && !e.placeholder) return n;
|
|
4890
4903
|
}
|
|
4891
4904
|
return -1;
|
|
4892
4905
|
}
|
|
@@ -4913,30 +4926,30 @@ var Fn = 7, In = class {
|
|
|
4913
4926
|
total: this.grid.totalRowCount
|
|
4914
4927
|
};
|
|
4915
4928
|
let e = this.grid.flatRows.value, t = 0, n = 0;
|
|
4916
|
-
for (let r = 0; r < e.length; r++)
|
|
4929
|
+
for (let r = 0; r < e.length; r++) Wn(e[r]) && (n++, r <= this._record.index && t++);
|
|
4917
4930
|
return {
|
|
4918
4931
|
position: t,
|
|
4919
4932
|
total: n
|
|
4920
4933
|
};
|
|
4921
4934
|
}
|
|
4922
|
-
},
|
|
4935
|
+
}, Vn = 1e4, Hn = {
|
|
4923
4936
|
eq: "=",
|
|
4924
4937
|
ne: "≠",
|
|
4925
4938
|
gt: ">",
|
|
4926
4939
|
gte: "≥",
|
|
4927
4940
|
lt: "<",
|
|
4928
4941
|
lte: "≤"
|
|
4929
|
-
},
|
|
4942
|
+
}, Un = {
|
|
4930
4943
|
on: "=",
|
|
4931
4944
|
before: "<",
|
|
4932
4945
|
after: ">"
|
|
4933
4946
|
};
|
|
4934
|
-
function
|
|
4947
|
+
function Wn(e) {
|
|
4935
4948
|
return !!e && e.kind === "row";
|
|
4936
4949
|
}
|
|
4937
4950
|
//#endregion
|
|
4938
4951
|
//#region src/components/dataGrid/models/localeText.ts
|
|
4939
|
-
var
|
|
4952
|
+
var Gn = {
|
|
4940
4953
|
searchPlaceholder: "Search...",
|
|
4941
4954
|
columnsMenu: "Columns",
|
|
4942
4955
|
columnsMenuLabel: (e, t) => `Columns, ${e} of ${t} shown`,
|
|
@@ -5033,7 +5046,7 @@ var Un = {
|
|
|
5033
5046
|
selectedRows: (e) => `${e} selected`,
|
|
5034
5047
|
selectAll: "Select all",
|
|
5035
5048
|
selectionAnnouncement: (e, t) => e === 0 ? "No rows selected" : `${e} of ${t} rows selected`
|
|
5036
|
-
},
|
|
5049
|
+
}, Kn = class {
|
|
5037
5050
|
grid;
|
|
5038
5051
|
constructor(e) {
|
|
5039
5052
|
this.grid = e;
|
|
@@ -5089,16 +5102,16 @@ var Un = {
|
|
|
5089
5102
|
let t = parseInt(e, 10);
|
|
5090
5103
|
isNaN(t) || this.grid.changePage(Math.max(1, Math.min(t, this.totalPages)));
|
|
5091
5104
|
};
|
|
5092
|
-
},
|
|
5093
|
-
function
|
|
5105
|
+
}, qn = /["\t\r\n]/;
|
|
5106
|
+
function Jn(e) {
|
|
5094
5107
|
if (e == null) return "";
|
|
5095
5108
|
let t = e instanceof Date ? e.toISOString() : String(e);
|
|
5096
|
-
return
|
|
5109
|
+
return qn.test(t) ? `"${t.split("\"").join("\"\"")}"` : t;
|
|
5097
5110
|
}
|
|
5098
|
-
function
|
|
5099
|
-
return e.map((e) => e.map(
|
|
5111
|
+
function Yn(e) {
|
|
5112
|
+
return e.map((e) => e.map(Jn).join(" ")).join("\r\n");
|
|
5100
5113
|
}
|
|
5101
|
-
function
|
|
5114
|
+
function Xn(e) {
|
|
5102
5115
|
let t = [], n = [], r = "", i = !1;
|
|
5103
5116
|
for (let a = 0; a < e.length; a++) {
|
|
5104
5117
|
let o = e[a];
|
|
@@ -5106,10 +5119,10 @@ function Jn(e) {
|
|
|
5106
5119
|
}
|
|
5107
5120
|
return (r !== "" || n.length > 0) && (n.push(r), t.push(n)), t;
|
|
5108
5121
|
}
|
|
5109
|
-
function
|
|
5122
|
+
function Zn(e, t) {
|
|
5110
5123
|
return e?.row === t?.row && e?.column === t?.column;
|
|
5111
5124
|
}
|
|
5112
|
-
var
|
|
5125
|
+
var Qn = class {
|
|
5113
5126
|
grid;
|
|
5114
5127
|
constructor(e) {
|
|
5115
5128
|
this.grid = e;
|
|
@@ -5155,7 +5168,7 @@ var Xn = class {
|
|
|
5155
5168
|
row: e,
|
|
5156
5169
|
column: t
|
|
5157
5170
|
}, i = n && this._anchor ? this._anchor : r;
|
|
5158
|
-
|
|
5171
|
+
Zn(this._focus, r) && Zn(this._anchor, i) || (this._anchor = i, this._focus = r, this.grid.notifyRows(), this.emit(n ? "extend" : "select"));
|
|
5159
5172
|
}
|
|
5160
5173
|
syncCurrent(e, t) {
|
|
5161
5174
|
this.isCurrent(e, t) || this.setCurrent(e, t);
|
|
@@ -5183,7 +5196,7 @@ var Xn = class {
|
|
|
5183
5196
|
let t = this.columnsOf(e), n = this.grid.flatRows.value, r = [];
|
|
5184
5197
|
for (let i = e.startRow; i <= e.endRow; i++) {
|
|
5185
5198
|
let e = n[i];
|
|
5186
|
-
e?.kind === "group" ? r.push(t.map((t) => t.key === "grouping-cell" || t.key === e.groupColumn.key ? e.groupValue : null)) : e?.kind === "row" && !e.placeholder ? r.push(t.map((t) => this.valueOf(t, e))) : r.push(t.map(() => null));
|
|
5199
|
+
e?.kind === "group" ? r.push(t.map((t) => t.isRowNumber ? e.rowIndex + 1 : t.key === "grouping-cell" || t.key === e.groupColumn.key ? e.groupValue : null)) : e?.kind === "row" && !e.placeholder ? r.push(t.map((t) => this.valueOf(t, e))) : r.push(t.map(() => null));
|
|
5187
5200
|
}
|
|
5188
5201
|
return r;
|
|
5189
5202
|
}
|
|
@@ -5212,12 +5225,12 @@ var Xn = class {
|
|
|
5212
5225
|
this.grid.props.onRangeChange?.(this.range, { reason: e }), e === "extend" && !this._dragging && this.reportBlock();
|
|
5213
5226
|
}
|
|
5214
5227
|
reportBlock() {
|
|
5215
|
-
this.enabled && this._anchor && !
|
|
5228
|
+
this.enabled && this._anchor && !Zn(this._anchor, this._focus) && this.grid.reportInteraction("rangeChange", this.block, "extend");
|
|
5216
5229
|
}
|
|
5217
5230
|
onCopy = (e) => {
|
|
5218
5231
|
if (!this._focus || !e.clipboardData) return;
|
|
5219
5232
|
let t = e.currentTarget.ownerDocument.defaultView?.getSelection();
|
|
5220
|
-
t && !t.isCollapsed || (e.clipboardData.setData("text/plain",
|
|
5233
|
+
t && !t.isCollapsed || (e.clipboardData.setData("text/plain", Yn(this.values())), e.preventDefault(), this.grid.reportInteraction("copy", this.block, "copy"));
|
|
5221
5234
|
};
|
|
5222
5235
|
pasteBounds(e, t) {
|
|
5223
5236
|
let n = this.bounds;
|
|
@@ -5234,10 +5247,10 @@ var Xn = class {
|
|
|
5234
5247
|
if (!this._focus || !e.clipboardData || this.grid.edits.isOpen || !this.grid.edits.enabled) return;
|
|
5235
5248
|
let t = e.clipboardData.getData("text/plain");
|
|
5236
5249
|
if (!t) return;
|
|
5237
|
-
let n =
|
|
5250
|
+
let n = Xn(t), r = n.reduce((e, t) => Math.max(e, t.length), 0), i = this.pasteBounds(n.length, r);
|
|
5238
5251
|
i && (e.preventDefault(), this.grid.edits.paste(i, (e, t) => n[e % n.length][t % r] ?? ""));
|
|
5239
5252
|
};
|
|
5240
|
-
},
|
|
5253
|
+
}, $n = class extends H {
|
|
5241
5254
|
node;
|
|
5242
5255
|
level;
|
|
5243
5256
|
position;
|
|
@@ -5288,10 +5301,10 @@ var Xn = class {
|
|
|
5288
5301
|
};
|
|
5289
5302
|
//#endregion
|
|
5290
5303
|
//#region src/components/dataGrid/models/treeModel.ts
|
|
5291
|
-
function
|
|
5304
|
+
function er(e) {
|
|
5292
5305
|
return JSON.stringify(e);
|
|
5293
5306
|
}
|
|
5294
|
-
var
|
|
5307
|
+
var tr = class {
|
|
5295
5308
|
grid;
|
|
5296
5309
|
constructor(e) {
|
|
5297
5310
|
this.grid = e;
|
|
@@ -5345,9 +5358,9 @@ var $n = class {
|
|
|
5345
5358
|
data: e,
|
|
5346
5359
|
children: []
|
|
5347
5360
|
};
|
|
5348
|
-
n.set(
|
|
5361
|
+
n.set(er(r), i);
|
|
5349
5362
|
let a;
|
|
5350
|
-
for (let e = r.length - 1; e > 0 && !a; e--) a = n.get(
|
|
5363
|
+
for (let e = r.length - 1; e > 0 && !a; e--) a = n.get(er(r.slice(0, e)));
|
|
5351
5364
|
(a ? a.children : t).push(i);
|
|
5352
5365
|
}), t;
|
|
5353
5366
|
}
|
|
@@ -5363,7 +5376,7 @@ var $n = class {
|
|
|
5363
5376
|
}
|
|
5364
5377
|
sortNodes(e) {
|
|
5365
5378
|
let { sortColumn: t, sortDirection: n } = this.grid;
|
|
5366
|
-
return t === void 0 ? e :
|
|
5379
|
+
return t === void 0 ? e : W.sortBy(e, (e) => e.data[t], n).map((e) => ({
|
|
5367
5380
|
data: e.data,
|
|
5368
5381
|
children: this.sortNodes(e.children)
|
|
5369
5382
|
}));
|
|
@@ -5393,7 +5406,7 @@ var $n = class {
|
|
|
5393
5406
|
}
|
|
5394
5407
|
rowList() {
|
|
5395
5408
|
let e = 0, t = (n, r, i) => n.map((a, o) => {
|
|
5396
|
-
let s = new
|
|
5409
|
+
let s = new $n(this.grid, a, e++, r, o, n.length, i);
|
|
5397
5410
|
return s.treeExpanded && (s.children = t(a.children, r + 1, s)), s;
|
|
5398
5411
|
});
|
|
5399
5412
|
return t(this.nodes.value, 0);
|
|
@@ -5437,8 +5450,8 @@ var $n = class {
|
|
|
5437
5450
|
let r = this.expandedKeys();
|
|
5438
5451
|
this.grid.fire("expandedTreeKeysChange", r, n ? "expand" : "collapse", { details: { rowKey: e } }), this.grid.notify();
|
|
5439
5452
|
};
|
|
5440
|
-
},
|
|
5441
|
-
function
|
|
5453
|
+
}, nr = {};
|
|
5454
|
+
function rr(e) {
|
|
5442
5455
|
if (typeof e == "string" && /^\d{4}-\d{2}-\d{2}$/.test(e)) return e;
|
|
5443
5456
|
if (!(e instanceof Date) && typeof e != "string" && typeof e != "number") return null;
|
|
5444
5457
|
let t = e instanceof Date ? e : new Date(e);
|
|
@@ -5446,7 +5459,7 @@ function tr(e) {
|
|
|
5446
5459
|
let n = (e) => String(e).padStart(2, "0");
|
|
5447
5460
|
return `${String(t.getFullYear()).padStart(4, "0")}-${n(t.getMonth() + 1)}-${n(t.getDate())}`;
|
|
5448
5461
|
}
|
|
5449
|
-
var
|
|
5462
|
+
var ir = class t {
|
|
5450
5463
|
props;
|
|
5451
5464
|
constructor(e, t) {
|
|
5452
5465
|
this.props = e, t && this.listeners.add(t);
|
|
@@ -5474,12 +5487,16 @@ var nr = class e {
|
|
|
5474
5487
|
return e.kind === "row" ? `${n}|${r}|${this.edits.rowDigest(e.key)}` : `${n}|${r}`;
|
|
5475
5488
|
}
|
|
5476
5489
|
_selectionVersion = 0;
|
|
5490
|
+
_layoutVersion = 0;
|
|
5477
5491
|
get headerVersion() {
|
|
5478
|
-
return `${this._epoch}:${this._selectionVersion}`;
|
|
5492
|
+
return `${this._epoch}:${this._selectionVersion}:${this._layoutVersion}`;
|
|
5479
5493
|
}
|
|
5480
|
-
|
|
5494
|
+
notifyLayout = () => {
|
|
5495
|
+
this._layoutVersion++, this.notifyRows();
|
|
5496
|
+
};
|
|
5497
|
+
setProps(e) {
|
|
5481
5498
|
let n = this.props;
|
|
5482
|
-
n !==
|
|
5499
|
+
n !== e && (t.drawnPropsChanged(n, e) && this._epoch++, this.props = e, n.def !== e.def && this.sourceColumns.clear(), (n.data !== e.data || n.def !== e.def || n.globalFilterValue !== e.globalFilterValue || n.columnFilters !== e.columnFilters || n.filters !== e.filters || n.expandedRowKeys !== e.expandedRowKeys || n.expandedTreeKeys !== e.expandedTreeKeys || n.page !== e.page || n.pageSize !== e.pageSize) && this.rows.clear(), (n.globalFilterValue !== e.globalFilterValue || n.columnFilters !== e.columnFilters || n.filters !== e.filters) && this.leaveSelectionView(), (n.data !== e.data || n.def !== e.def || n.globalFilterValue !== e.globalFilterValue || n.columnFilters !== e.columnFilters || n.filters !== e.filters) && this.tree.nodes.clear());
|
|
5483
5500
|
}
|
|
5484
5501
|
get data() {
|
|
5485
5502
|
return this.props.data ?? [];
|
|
@@ -5514,7 +5531,7 @@ var nr = class e {
|
|
|
5514
5531
|
let e = this.props.def.localeText, t = this._localeText;
|
|
5515
5532
|
if (t && t.from === e) return t.text;
|
|
5516
5533
|
let n = {
|
|
5517
|
-
...
|
|
5534
|
+
...Gn,
|
|
5518
5535
|
...e
|
|
5519
5536
|
};
|
|
5520
5537
|
return this._localeText = {
|
|
@@ -5524,20 +5541,20 @@ var nr = class e {
|
|
|
5524
5541
|
}
|
|
5525
5542
|
sourceColumns = q(() => {
|
|
5526
5543
|
let { def: e } = this.props, t = [];
|
|
5527
|
-
if (this.groupColumns.size > 0 && t.push(new Q({ key:
|
|
5544
|
+
if (this.groupColumns.size > 0 && t.push(new Q({ key: G }, this)), t.push(...e.columns.map((e) => new Q(e, this))), e.rowSelection) {
|
|
5528
5545
|
let n = typeof e.rowSelection == "object" && e.rowSelection.pinned ? "START" : void 0;
|
|
5529
5546
|
t.unshift(new Q({
|
|
5530
|
-
key:
|
|
5547
|
+
key: Ze,
|
|
5531
5548
|
pin: n,
|
|
5532
5549
|
width: 50,
|
|
5533
5550
|
align: "center",
|
|
5534
|
-
Cell:
|
|
5551
|
+
Cell: bn
|
|
5535
5552
|
}, this));
|
|
5536
5553
|
}
|
|
5537
5554
|
if (e.showRowNumber) {
|
|
5538
5555
|
let n, r = 70;
|
|
5539
5556
|
typeof e.showRowNumber == "object" && (e.showRowNumber.pinned && (n = "START"), r = e.showRowNumber.width ?? 70), t.unshift(new Q({
|
|
5540
|
-
key:
|
|
5557
|
+
key: Xe,
|
|
5541
5558
|
pin: n,
|
|
5542
5559
|
width: r,
|
|
5543
5560
|
align: "end"
|
|
@@ -5546,12 +5563,12 @@ var nr = class e {
|
|
|
5546
5563
|
if (e.rowDetail) {
|
|
5547
5564
|
let n = e.rowDetail.pinned ? "START" : void 0, r = e.rowDetail.expandColumnWidth ?? 50, i = e.rowDetail.expandColumnHeader ?? "";
|
|
5548
5565
|
t.unshift(new Q({
|
|
5549
|
-
key:
|
|
5566
|
+
key: Qe,
|
|
5550
5567
|
header: i,
|
|
5551
5568
|
pin: n,
|
|
5552
5569
|
width: r,
|
|
5553
5570
|
align: "center",
|
|
5554
|
-
Cell:
|
|
5571
|
+
Cell: yn
|
|
5555
5572
|
}, this));
|
|
5556
5573
|
}
|
|
5557
5574
|
return t;
|
|
@@ -5570,16 +5587,16 @@ var nr = class e {
|
|
|
5570
5587
|
leafs: i,
|
|
5571
5588
|
visibleLeafs: a,
|
|
5572
5589
|
userVisibleLeafs: a.filter((e) => ![
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5590
|
+
Xe,
|
|
5591
|
+
Ze,
|
|
5592
|
+
G,
|
|
5593
|
+
Qe
|
|
5577
5594
|
].includes(e.key)),
|
|
5578
|
-
maxDeath:
|
|
5595
|
+
maxDeath: W.maxBy(r, (e) => e.death) + 1
|
|
5579
5596
|
};
|
|
5580
5597
|
}, () => [this.sourceColumns]);
|
|
5581
|
-
headerRows = q(() =>
|
|
5582
|
-
let t =
|
|
5598
|
+
headerRows = q(() => W.sortBy(W.groupBy(this.columns.value.flat, (e) => e.death), (e) => e.key).map((e) => {
|
|
5599
|
+
let t = W.toRecord(W.groupBy(e.values, (e) => e.pin ?? "NO_PIN"), (e) => [e.key, e.values]);
|
|
5583
5600
|
return [
|
|
5584
5601
|
...t.START?.filter((e) => e.isVisible) ?? [],
|
|
5585
5602
|
...t.NO_PIN?.filter((e) => e.isVisible) ?? [],
|
|
@@ -5587,7 +5604,7 @@ var nr = class e {
|
|
|
5587
5604
|
];
|
|
5588
5605
|
}), () => [this.columns]);
|
|
5589
5606
|
gridTemplateColumns = q(() => {
|
|
5590
|
-
let { visibleLeafs: e } = this.columns.value, t =
|
|
5607
|
+
let { visibleLeafs: e } = this.columns.value, t = W.sumBy(e, (e) => +(e.pin === "END")), n = e.length - t;
|
|
5591
5608
|
return `${n > 0 ? `repeat(${n}, max-content)` : ""} ${t > 0 ? `repeat(${t}, max-content)` : ""}`.trim();
|
|
5592
5609
|
}, () => [this.columns]);
|
|
5593
5610
|
_globalFilterValue = "";
|
|
@@ -5610,7 +5627,7 @@ var nr = class e {
|
|
|
5610
5627
|
let t = this.globalFilterValue.trim();
|
|
5611
5628
|
return !t || this.globalFilterColumns.value.some((n) => {
|
|
5612
5629
|
let r = e[n];
|
|
5613
|
-
return r != null &&
|
|
5630
|
+
return r != null && vn(t, String(r));
|
|
5614
5631
|
});
|
|
5615
5632
|
}
|
|
5616
5633
|
matchesColumnFilters(e) {
|
|
@@ -5622,7 +5639,7 @@ var nr = class e {
|
|
|
5622
5639
|
}
|
|
5623
5640
|
matchesFilter(e, t) {
|
|
5624
5641
|
switch (t.type) {
|
|
5625
|
-
case "text": return !t.value.trim() || e != null &&
|
|
5642
|
+
case "text": return !t.value.trim() || e != null && vn(t.value, String(e));
|
|
5626
5643
|
case "number": {
|
|
5627
5644
|
if (e == null) return !1;
|
|
5628
5645
|
let n = typeof e == "number" ? e : parseFloat(String(e));
|
|
@@ -5640,7 +5657,7 @@ var nr = class e {
|
|
|
5640
5657
|
}
|
|
5641
5658
|
case "date": {
|
|
5642
5659
|
if (!t.value) return !0;
|
|
5643
|
-
let n =
|
|
5660
|
+
let n = rr(e);
|
|
5644
5661
|
if (!n) return !1;
|
|
5645
5662
|
switch (t.operator) {
|
|
5646
5663
|
case "on": return n === t.value;
|
|
@@ -5660,7 +5677,22 @@ var nr = class e {
|
|
|
5660
5677
|
let e = this._selectionView;
|
|
5661
5678
|
return this.data.filter((t) => e.has(this.getRowKey(t)));
|
|
5662
5679
|
}
|
|
5663
|
-
|
|
5680
|
+
if (!this.hasRowFilters) return this.data;
|
|
5681
|
+
let { filters: e, def: n } = this.props, r = JSON.stringify(this.globalFilterColumns.value), i = [
|
|
5682
|
+
this.data,
|
|
5683
|
+
e,
|
|
5684
|
+
!!n.globalFilter,
|
|
5685
|
+
this.globalFilterValue,
|
|
5686
|
+
r,
|
|
5687
|
+
this.columnFilters
|
|
5688
|
+
];
|
|
5689
|
+
return t.reuse(this._filtered, i, () => this.data.filter((e) => this.rowMatchesFilters(e)));
|
|
5690
|
+
}
|
|
5691
|
+
_filtered = {};
|
|
5692
|
+
_sorted = {};
|
|
5693
|
+
_rowModels = {};
|
|
5694
|
+
static reuse(e, t, n) {
|
|
5695
|
+
return e.inputs && e.inputs.length === t.length && e.inputs.every((e, n) => Object.is(e, t[n])) ? e.value : (e.inputs = t, e.value = n(), e.value);
|
|
5664
5696
|
}
|
|
5665
5697
|
reportInteraction(e, t, n, r, a) {
|
|
5666
5698
|
this._batching || i({
|
|
@@ -5766,21 +5798,28 @@ var nr = class e {
|
|
|
5766
5798
|
if (this.source.enabled) return this.source.rowList();
|
|
5767
5799
|
if (this.tree.isEager) return this.tree.rowList();
|
|
5768
5800
|
let e = this.filteredData;
|
|
5769
|
-
if (this._sortColumn && !this.isPaginated
|
|
5770
|
-
let
|
|
5771
|
-
|
|
5772
|
-
n
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5801
|
+
if (this._sortColumn && !this.isPaginated) {
|
|
5802
|
+
let n = e, r = this._sortColumn;
|
|
5803
|
+
e = t.reuse(this._sorted, [
|
|
5804
|
+
n,
|
|
5805
|
+
r,
|
|
5806
|
+
this._sortDirection
|
|
5807
|
+
], () => W.sortBy(n, (e) => e[r], this._sortDirection));
|
|
5808
|
+
}
|
|
5809
|
+
if (this.groupColumns.size > 0) {
|
|
5810
|
+
let t = (e, n) => {
|
|
5811
|
+
let r = n.values().next().value;
|
|
5812
|
+
n.delete(r);
|
|
5813
|
+
let i = W.findOrThrow(this.columns.value.leafs, (e) => e.key === r);
|
|
5814
|
+
return this._sortColumn === "grouping-cell" && (e = W.sortBy(e, (e) => e[r], this._sortDirection)), W.groupBy(e, (e) => e[r]).map((e, r) => {
|
|
5815
|
+
let a = n.size > 0 ? t(e.values, new Set(n)) : e.values.map((e, t) => new H(this, e, t));
|
|
5816
|
+
return new ct(this, i, a, r, e.key);
|
|
5779
5817
|
});
|
|
5780
5818
|
};
|
|
5781
|
-
return t(e, new Set(this.groupColumns)
|
|
5819
|
+
return t(e, new Set(this.groupColumns));
|
|
5782
5820
|
}
|
|
5783
|
-
|
|
5821
|
+
let n = e;
|
|
5822
|
+
return t.reuse(this._rowModels, [n, this.props.def.rowKey], () => n.map((e, t) => new H(this, e, t)));
|
|
5784
5823
|
}, () => [this.columns]);
|
|
5785
5824
|
groupingSpan = q(() => {
|
|
5786
5825
|
let { visibleLeafs: e } = this.columns.value, t = e.findIndex((e) => e.isGrouping);
|
|
@@ -5788,7 +5827,15 @@ var nr = class e {
|
|
|
5788
5827
|
let n = (n, r) => r > t && n.pin === e[t].pin && !n.isRowNumber && !n.isRowSelection && !n.isRowDetail, r = e.findIndex((e, t) => n(e, t) && !!e.aggregate), i = r === -1 ? e.length : r;
|
|
5789
5828
|
return [e[t], ...e.filter((e, t) => t < i && n(e, t))];
|
|
5790
5829
|
}, () => [this.columns]);
|
|
5791
|
-
flatRows = q(() =>
|
|
5830
|
+
flatRows = q(() => {
|
|
5831
|
+
if (this.source.enabled) return this.source.flatRowList(this.rows.value);
|
|
5832
|
+
let e = this.rows.value.flatMap((e) => e.flatRows);
|
|
5833
|
+
if (this.groupColumns.size > 0 && !this.tree.isEager) {
|
|
5834
|
+
let t = 0;
|
|
5835
|
+
for (let n of e) n.kind !== "detail" && (n.rowIndex = t++);
|
|
5836
|
+
}
|
|
5837
|
+
return e;
|
|
5838
|
+
}, () => [this.rows]);
|
|
5792
5839
|
get rowHeight() {
|
|
5793
5840
|
return this.props.def.rowHeight ?? this.DEFAULT_ROW_HEIGHT_PX;
|
|
5794
5841
|
}
|
|
@@ -5798,14 +5845,14 @@ var nr = class e {
|
|
|
5798
5845
|
return typeof n == "number" && (e[t.widthVarName] = `${t.inlineWidth}px`), t.pin === "START" && (e[t.inlineStartVarName] = `${t.startOffset}px`), t.pin === "END" && (e[t.inlineEndVarName] = `${t.endOffset}px`), e;
|
|
5799
5846
|
}, {});
|
|
5800
5847
|
e[this.rowHeightVarName] = `${this.rowHeight}px`, e[this.inlineStartEdgeVarName] = `${this.inlineStartEdge}px`, this._containerWidth > 0 && (e[this.viewportWidthVarName] = `${this._containerWidth}px`);
|
|
5801
|
-
let { visibleLeafs: t } = this.columns.value, n = t.find((e) => e.key ===
|
|
5848
|
+
let { visibleLeafs: t } = this.columns.value, n = t.find((e) => e.key === G);
|
|
5802
5849
|
if (n) {
|
|
5803
|
-
let t =
|
|
5850
|
+
let t = W.sumBy(this.groupingSpan.value, (e) => e.inlineWidth ?? 0);
|
|
5804
5851
|
e[n.groupColumnWidthVarName] = `${t}px`;
|
|
5805
5852
|
}
|
|
5806
5853
|
return this.groupColumns.forEach((n) => {
|
|
5807
|
-
let r =
|
|
5808
|
-
e[r.groupColumnWidthVarName] = `${
|
|
5854
|
+
let r = W.findOrThrow(this.columns.value.leafs, (e) => e.key === n);
|
|
5855
|
+
e[r.groupColumnWidthVarName] = `${W.sumBy(t, (e) => e.pin === r.pin ? e.inlineWidth ?? 0 : 0)}px`;
|
|
5809
5856
|
}), e;
|
|
5810
5857
|
}, () => [this.columns, this.flexWidths]);
|
|
5811
5858
|
_containerWidth = 0;
|
|
@@ -5824,16 +5871,16 @@ var nr = class e {
|
|
|
5824
5871
|
e && Object.entries(this.sizes.value).forEach(([t, n]) => e.style.setProperty(t, n));
|
|
5825
5872
|
};
|
|
5826
5873
|
get isRtl() {
|
|
5827
|
-
return
|
|
5874
|
+
return e(this._sizingElement);
|
|
5828
5875
|
}
|
|
5829
5876
|
setContainerWidth = (e) => {
|
|
5830
|
-
this._containerWidth !== e && (this._containerWidth = e, this.flexWidths.clear(), this.
|
|
5877
|
+
this._containerWidth !== e && (this._containerWidth = e, this.flexWidths.clear(), this.notifyLayout());
|
|
5831
5878
|
};
|
|
5832
5879
|
flexWidths = q(() => {
|
|
5833
5880
|
let e = this._containerWidth;
|
|
5834
5881
|
if (e <= 0) return {};
|
|
5835
|
-
let t = this.columns.value.visibleLeafs, n = (e) => !e.isFlexible || this.columnWidths.has(e.key), r =
|
|
5836
|
-
if (o <= a) return
|
|
5882
|
+
let t = this.columns.value.visibleLeafs, n = (e) => !e.isFlexible || this.columnWidths.has(e.key), r = W.sumBy(t.filter(n), (e) => e.baseWidth), i = t.filter((e) => !n(e)), a = W.sumBy(i, (e) => e.baseWidth), o = e - r;
|
|
5883
|
+
if (o <= a) return W.toRecord(i, (e) => [e.key, e.baseWidth]);
|
|
5837
5884
|
let s = {}, c = 0;
|
|
5838
5885
|
return i.forEach((e, t) => {
|
|
5839
5886
|
if (t === i.length - 1) s[e.key] = o - c;
|
|
@@ -5862,7 +5909,7 @@ var nr = class e {
|
|
|
5862
5909
|
let t = new Set(this.expandedDetailRows);
|
|
5863
5910
|
t.has(e) ? t.delete(e) : t.add(e);
|
|
5864
5911
|
let n = t.has(e);
|
|
5865
|
-
this._revealDetailKey = n && this.props.def.rowDetail?.scrollIntoView !== !1 ? e : null, this._expandedDetailRows = t, this.fire("expandedRowKeysChange", Array.from(t), n ? "expand" : "collapse", { details: { rowKey: e } }), this.
|
|
5912
|
+
this._revealDetailKey = n && this.props.def.rowDetail?.scrollIntoView !== !1 ? e : null, this._expandedDetailRows = t, this.fire("expandedRowKeysChange", Array.from(t), n ? "expand" : "collapse", { details: { rowKey: e } }), this.expansionChanged(), this.notify();
|
|
5866
5913
|
};
|
|
5867
5914
|
_page = 1;
|
|
5868
5915
|
_pageSize;
|
|
@@ -5909,29 +5956,29 @@ var nr = class e {
|
|
|
5909
5956
|
rowOffsets = q(() => {
|
|
5910
5957
|
if (this.source.enabled) return this.source.rowOffsets(this.flatRows.value);
|
|
5911
5958
|
let e = [], t = 0;
|
|
5912
|
-
for (let n of this.flatRows.value) e.push(t), t += n instanceof
|
|
5959
|
+
for (let n of this.flatRows.value) e.push(t), t += n instanceof Ue ? n.heightForOffset : this.rowHeight;
|
|
5913
5960
|
return {
|
|
5914
5961
|
offsets: e,
|
|
5915
5962
|
totalHeight: t
|
|
5916
5963
|
};
|
|
5917
5964
|
}, () => [this.flatRows]);
|
|
5918
|
-
viewport = new
|
|
5919
|
-
columnVisibility = new
|
|
5920
|
-
filter = new
|
|
5921
|
-
pagination = new
|
|
5922
|
-
aggregation = new
|
|
5923
|
-
exporter = new
|
|
5924
|
-
source = new
|
|
5925
|
-
tree = new
|
|
5926
|
-
edits = new
|
|
5927
|
-
range = new
|
|
5928
|
-
list = new
|
|
5965
|
+
viewport = new Ce(this);
|
|
5966
|
+
columnVisibility = new wn(this);
|
|
5967
|
+
filter = new zn(this);
|
|
5968
|
+
pagination = new Kn(this);
|
|
5969
|
+
aggregation = new at(this);
|
|
5970
|
+
exporter = new Rn(this);
|
|
5971
|
+
source = new Pn(this);
|
|
5972
|
+
tree = new tr(this);
|
|
5973
|
+
edits = new He(this);
|
|
5974
|
+
range = new Qn(this);
|
|
5975
|
+
list = new Bn(this);
|
|
5929
5976
|
refresh = () => {
|
|
5930
5977
|
this.edits.clearEdits(), this.source.invalidate();
|
|
5931
5978
|
};
|
|
5932
5979
|
get exportConfig() {
|
|
5933
5980
|
let e = this.props.def.export;
|
|
5934
|
-
if (e) return typeof e == "object" ? e :
|
|
5981
|
+
if (e) return typeof e == "object" ? e : nr;
|
|
5935
5982
|
}
|
|
5936
5983
|
exportCsv = async (e = {}) => {
|
|
5937
5984
|
let { downloadCsv: t } = await import("../gridExport.mjs");
|
|
@@ -5996,14 +6043,14 @@ var nr = class e {
|
|
|
5996
6043
|
return this.localeText.selectionAnnouncement(e, this.totalRowCount);
|
|
5997
6044
|
}
|
|
5998
6045
|
get groupedColumns() {
|
|
5999
|
-
return Array.from(this.groupColumns, (e) =>
|
|
6046
|
+
return Array.from(this.groupColumns, (e) => W.findOrThrow(this.columns.value.leafs, (t) => t.key === e));
|
|
6000
6047
|
}
|
|
6001
6048
|
selectedRows = /* @__PURE__ */ new Set();
|
|
6002
6049
|
get inlineStartEdge() {
|
|
6003
|
-
return
|
|
6050
|
+
return W.sumBy(this.columns.value.start, (e) => e.inlineWidth ?? 0);
|
|
6004
6051
|
}
|
|
6005
6052
|
get inlineEndEdge() {
|
|
6006
|
-
return
|
|
6053
|
+
return W.sumBy(this.columns.value.end, (e) => e.inlineWidth ?? 0);
|
|
6007
6054
|
}
|
|
6008
6055
|
inlineStartEdgeVarName = "--inline-start-edge";
|
|
6009
6056
|
rowHeightVarName = "--row-height";
|
|
@@ -6034,7 +6081,7 @@ var nr = class e {
|
|
|
6034
6081
|
}), this.source.invalidate(), this.tree.nodes.clear(), this.rows.clear(), this.notify();
|
|
6035
6082
|
};
|
|
6036
6083
|
pinColumn = (e, t) => {
|
|
6037
|
-
let n =
|
|
6084
|
+
let n = xn(t), r = W.findOrThrow(this.columns.value.flat, (t) => t.uniqueKey === e);
|
|
6038
6085
|
r.pin !== n && r.pinColumn(n), this.columns.clear(), this.notify();
|
|
6039
6086
|
};
|
|
6040
6087
|
toggleGrouping = (e) => {
|
|
@@ -6059,8 +6106,11 @@ var nr = class e {
|
|
|
6059
6106
|
}
|
|
6060
6107
|
_collapsedGroupRow = /* @__PURE__ */ new Set();
|
|
6061
6108
|
toggleGroupRow = (e, t = this.expandedGroupRow.has(e)) => {
|
|
6062
|
-
this._expansion++, this.expandedGroupRow = new Set(this.expandedGroupRow), this._collapsedGroupRow = new Set(this._collapsedGroupRow), t ? (this.expandedGroupRow.delete(e), this._collapsedGroupRow.add(e)) : (this.expandedGroupRow.add(e), this._collapsedGroupRow.delete(e)), this.reportInteraction("groupExpandedChange", !t, t ? "collapse" : "expand", { groupRowKey: e }), this.source.expansionChanged(), this.
|
|
6109
|
+
this._expansion++, this.expandedGroupRow = new Set(this.expandedGroupRow), this._collapsedGroupRow = new Set(this._collapsedGroupRow), t ? (this.expandedGroupRow.delete(e), this._collapsedGroupRow.add(e)) : (this.expandedGroupRow.add(e), this._collapsedGroupRow.delete(e)), this.reportInteraction("groupExpandedChange", !t, t ? "collapse" : "expand", { groupRowKey: e }), this.source.expansionChanged(), this.expansionChanged(), this.notify();
|
|
6063
6110
|
};
|
|
6111
|
+
expansionChanged() {
|
|
6112
|
+
this.source.enabled || this.tree.isEager ? this.rows.clear() : this.flatRows.clear();
|
|
6113
|
+
}
|
|
6064
6114
|
treeExpansionChanged() {
|
|
6065
6115
|
this._expansion++, this.source.expansionChanged(), this.rows.clear();
|
|
6066
6116
|
}
|
|
@@ -6126,32 +6176,32 @@ var nr = class e {
|
|
|
6126
6176
|
};
|
|
6127
6177
|
//#endregion
|
|
6128
6178
|
//#region src/components/dataGrid/useGrid.ts
|
|
6129
|
-
function
|
|
6130
|
-
let [t] =
|
|
6131
|
-
return t.setProps(e), t.setIdentifier(n),
|
|
6179
|
+
function ar(e) {
|
|
6180
|
+
let [t] = P(() => new ir(e)), n = d("datagrid");
|
|
6181
|
+
return t.setProps(e), t.setIdentifier(n), ce(t.subscribe, t.getSnapshot, t.getSnapshot), t;
|
|
6132
6182
|
}
|
|
6133
6183
|
//#endregion
|
|
6134
6184
|
//#region src/components/dataGrid/useListLayout.ts
|
|
6135
|
-
var
|
|
6136
|
-
function
|
|
6137
|
-
return
|
|
6185
|
+
var or, sr;
|
|
6186
|
+
function cr() {
|
|
6187
|
+
return sr ??= import("../dataGridList.mjs").then((e) => or = e.default), sr;
|
|
6138
6188
|
}
|
|
6139
|
-
n("(max-width: 36rem)")?.matches &&
|
|
6140
|
-
function
|
|
6141
|
-
let [t, n] =
|
|
6142
|
-
return
|
|
6189
|
+
n("(max-width: 36rem)")?.matches && cr();
|
|
6190
|
+
function lr(e) {
|
|
6191
|
+
let [t, n] = P(() => or);
|
|
6192
|
+
return M(() => {
|
|
6143
6193
|
if (!e || t) return;
|
|
6144
6194
|
let r = !0;
|
|
6145
|
-
return
|
|
6195
|
+
return cr().then((e) => r && n(() => e)), () => {
|
|
6146
6196
|
r = !1;
|
|
6147
6197
|
};
|
|
6148
6198
|
}, [e, t]), t;
|
|
6149
6199
|
}
|
|
6150
6200
|
//#endregion
|
|
6151
6201
|
//#region src/components/dataGrid.tsx
|
|
6152
|
-
function
|
|
6153
|
-
let n =
|
|
6154
|
-
|
|
6202
|
+
function ur(e, t) {
|
|
6203
|
+
let n = ar(e), i = N(null);
|
|
6204
|
+
re(t, () => ({
|
|
6155
6205
|
get element() {
|
|
6156
6206
|
return i.current;
|
|
6157
6207
|
},
|
|
@@ -6160,8 +6210,8 @@ function cr(e, t) {
|
|
|
6160
6210
|
refresh: n.refresh,
|
|
6161
6211
|
clearEdits: n.edits.clearEdits
|
|
6162
6212
|
}), [n]);
|
|
6163
|
-
let { component: o, data: s, def: c, loading: l, filters: u, globalFilterValue: d, columnFilters: f, expandedRowKeys: p, expandedTreeKeys: m, page: h, pageSize: _, onSelectedRowKeysChange: v, onSelectionChange: y, onGlobalFilterChange: b, onColumnFiltersChange: x, onExpandedRowKeysChange: S, onExpandedTreeKeysChange: C, onCellEditsChange: w, onPaginationChange: T, onPageChange:
|
|
6164
|
-
|
|
6213
|
+
let { component: o, data: s, def: c, loading: l, filters: u, globalFilterValue: d, columnFilters: f, expandedRowKeys: p, expandedTreeKeys: m, page: h, pageSize: _, onSelectedRowKeysChange: v, onSelectionChange: y, onGlobalFilterChange: b, onColumnFiltersChange: x, onExpandedRowKeysChange: S, onExpandedTreeKeysChange: C, onCellEditsChange: w, onPaginationChange: T, onPageChange: ee, onPageSizeChange: te, onSortingChange: E, onSortChange: ne, onServerStateChange: D, style: O, ...k } = e;
|
|
6214
|
+
ie(() => {
|
|
6165
6215
|
let e = i.current;
|
|
6166
6216
|
if (e) return n.setSizingElement(e), () => n.setSizingElement(null);
|
|
6167
6217
|
}, [n]), r(() => {
|
|
@@ -6171,28 +6221,28 @@ function cr(e, t) {
|
|
|
6171
6221
|
let t = new ResizeObserver(() => n.list.setWidth(e.clientWidth));
|
|
6172
6222
|
return t.observe(e), () => t.disconnect();
|
|
6173
6223
|
}, [n]);
|
|
6174
|
-
let
|
|
6175
|
-
return /* @__PURE__ */
|
|
6224
|
+
let A = n.list.active, j = lr(A);
|
|
6225
|
+
return /* @__PURE__ */ L(a, {
|
|
6176
6226
|
ref: i,
|
|
6177
6227
|
component: n.componentName,
|
|
6178
|
-
variant: { list: !!
|
|
6179
|
-
...
|
|
6228
|
+
variant: { list: !!j && A },
|
|
6229
|
+
...k,
|
|
6180
6230
|
style: {
|
|
6181
6231
|
...n.sizes.value,
|
|
6182
|
-
...
|
|
6232
|
+
...O
|
|
6183
6233
|
},
|
|
6184
|
-
children: [
|
|
6185
|
-
n.props.def.topBar && /* @__PURE__ */
|
|
6186
|
-
/* @__PURE__ */
|
|
6187
|
-
/* @__PURE__ */
|
|
6188
|
-
n.props.def.bottomBar && /* @__PURE__ */
|
|
6189
|
-
] }), /* @__PURE__ */
|
|
6234
|
+
children: [j && A ? /* @__PURE__ */ I(j, { grid: n }) : /* @__PURE__ */ L(F, { children: [
|
|
6235
|
+
n.props.def.topBar && /* @__PURE__ */ I(gn, { grid: n }),
|
|
6236
|
+
/* @__PURE__ */ I(sn, { grid: n }),
|
|
6237
|
+
/* @__PURE__ */ I(on, { grid: n }),
|
|
6238
|
+
n.props.def.bottomBar && /* @__PURE__ */ I(ye, { grid: n })
|
|
6239
|
+
] }), /* @__PURE__ */ I(g, {
|
|
6190
6240
|
props: { role: "status" },
|
|
6191
6241
|
children: n.selectionAnnouncement
|
|
6192
6242
|
})]
|
|
6193
6243
|
});
|
|
6194
6244
|
}
|
|
6195
|
-
var
|
|
6196
|
-
|
|
6245
|
+
var dr = k(O(ur));
|
|
6246
|
+
ur.displayName = "DataGrid";
|
|
6197
6247
|
//#endregion
|
|
6198
|
-
export {
|
|
6248
|
+
export { Gn as DATA_GRID_LOCALE_TEXT, an as a, Z as c, xt as d, dr as default, Y as f, sn as i, Tt as l, z as m, dn as n, Gt as o, U as p, ln as r, It as s, pn as t, wt as u };
|