@box-kite/react 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/rules/box-kite-rules.md +58 -92
- package/.claude/skills/box-kite/SKILL.md +81 -114
- package/.claude/skills/box-kite/references/components.md +1 -1
- package/.claude/skills/box-kite/references/patterns.md +1 -1
- package/.claude/skills/box-kite/references/rules.md +115 -0
- package/.claude/skills/box-kite/references/styling.md +2 -2
- package/.cursor/rules/box-kite.mdc +61 -95
- package/AGENTS.md +62 -96
- package/BOX_AI_CONTEXT.md +82 -78
- package/BOX_KITE_AI_CONTEXT.md +82 -78
- package/README.md +201 -716
- package/catalog.cjs +1 -1
- package/catalog.mjs +3 -0
- package/client.cjs +1 -1
- package/client.mjs +81 -81
- package/components/combobox/comboboxListbox.d.ts +2 -1
- package/components/combobox.cjs +1 -1
- package/components/combobox.d.ts +1 -1
- package/components/combobox.mjs +199 -188
- package/components/dataGrid/components/dataGridFooter.d.ts +6 -2
- package/components/dataGrid/contracts/dataGridContract.d.ts +2 -1
- 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/useListLayout.d.ts +1 -1
- package/components/dataGrid.cjs +3 -3
- package/components/dataGrid.mjs +732 -682
- package/components/radioGroup.cjs +1 -1
- package/components/radioGroup.mjs +1 -0
- package/components/semantics.d.ts +29 -29
- package/components/skeleton.cjs +1 -1
- package/components/skeleton.d.ts +1 -1
- package/components/skeleton.mjs +2 -1
- 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 +1 -1
- package/components/textarea.d.ts +1 -1
- package/components/textbox.d.ts +1 -1
- package/components/timeZoneSelect.d.ts +1 -1
- package/components/toaster.cjs +1 -1
- package/components/toaster.mjs +13 -14
- package/dataGridList.cjs +1 -1
- package/dataGridList.mjs +3 -5
- package/docs/a11y.md +1 -2
- package/docs/index.md +1 -1
- package/docs/props.md +43 -19
- package/effects.cjs +1 -1
- package/effects.mjs +2 -2
- package/identity.cjs +1 -1
- package/identity.mjs +5 -7
- package/package.json +12 -12
- package/react/effects.d.ts +5 -6
- package/react/identity/useIdentifier.d.ts +0 -3
package/components/dataGrid.mjs
CHANGED
|
@@ -18,22 +18,22 @@ 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
26
|
//#region src/components/dataGrid/components/dataGridBottomBarSelection.tsx
|
|
27
|
-
function
|
|
27
|
+
function ce(e) {
|
|
28
28
|
let { grid: t } = e, n = t.selectedRows.size, r = t.isSelectionView;
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ L(_, {
|
|
30
30
|
component: `${t.componentName}.bottomBar.selection`,
|
|
31
31
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
32
|
+
/* @__PURE__ */ I(a, {
|
|
33
33
|
component: `${t.componentName}.bottomBar.info`,
|
|
34
34
|
children: t.localeText.selectedCount(n, t.hiddenSelectedCount)
|
|
35
35
|
}),
|
|
36
|
-
t.canShowSelection && (n > 0 || r) && /* @__PURE__ */
|
|
36
|
+
t.canShowSelection && (n > 0 || r) && /* @__PURE__ */ I(h, {
|
|
37
37
|
type: "button",
|
|
38
38
|
component: `${t.componentName}.bottomBar.action`,
|
|
39
39
|
variant: { pressed: r },
|
|
@@ -41,11 +41,11 @@ function se(e) {
|
|
|
41
41
|
onClick: t.toggleSelectionView,
|
|
42
42
|
children: t.localeText.showSelected
|
|
43
43
|
}),
|
|
44
|
-
n > 0 && /* @__PURE__ */
|
|
44
|
+
n > 0 && /* @__PURE__ */ L(h, {
|
|
45
45
|
type: "button",
|
|
46
46
|
component: `${t.componentName}.bottomBar.action`,
|
|
47
47
|
onClick: t.clearSelection,
|
|
48
|
-
children: [/* @__PURE__ */
|
|
48
|
+
children: [/* @__PURE__ */ I(a, {
|
|
49
49
|
tag: "span",
|
|
50
50
|
props: { "aria-hidden": !0 },
|
|
51
51
|
children: "✕"
|
|
@@ -56,74 +56,74 @@ function se(e) {
|
|
|
56
56
|
}
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/components/dataGrid/components/dataGridPagination.tsx
|
|
59
|
-
function
|
|
60
|
-
let { grid: t } = e, { pagination: n } = t, r = n.state, i =
|
|
59
|
+
function le(e) {
|
|
60
|
+
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
61
|
if (!r) return null;
|
|
62
62
|
let { canGoPrev: l, canGoNext: u, totalPages: d } = n;
|
|
63
|
-
return /* @__PURE__ */
|
|
63
|
+
return /* @__PURE__ */ L(_, {
|
|
64
64
|
component: `${t.componentName}.bottomBar.pagination`,
|
|
65
65
|
gap: .5,
|
|
66
66
|
ai: "center",
|
|
67
67
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ I(ue, {
|
|
69
69
|
grid: t,
|
|
70
70
|
pageSize: r.pageSize
|
|
71
71
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ I(fe, {
|
|
73
73
|
componentName: t.componentName,
|
|
74
74
|
label: t.localeText.firstPage,
|
|
75
75
|
onClick: i,
|
|
76
76
|
disabled: !l,
|
|
77
|
-
children: /* @__PURE__ */
|
|
77
|
+
children: /* @__PURE__ */ I(ge, {})
|
|
78
78
|
}),
|
|
79
|
-
/* @__PURE__ */
|
|
79
|
+
/* @__PURE__ */ I(fe, {
|
|
80
80
|
componentName: t.componentName,
|
|
81
81
|
label: t.localeText.previousPage,
|
|
82
82
|
onClick: o,
|
|
83
83
|
disabled: !l,
|
|
84
|
-
children: /* @__PURE__ */
|
|
84
|
+
children: /* @__PURE__ */ I(me, {})
|
|
85
85
|
}),
|
|
86
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ L(_, {
|
|
87
87
|
ai: "center",
|
|
88
88
|
gap: 1.5,
|
|
89
89
|
px: 2,
|
|
90
90
|
userSelect: "none",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
91
|
+
children: [/* @__PURE__ */ I(de, {
|
|
92
92
|
grid: t,
|
|
93
93
|
page: r.page,
|
|
94
94
|
totalPages: d
|
|
95
|
-
}), /* @__PURE__ */
|
|
95
|
+
}), /* @__PURE__ */ I(a, {
|
|
96
96
|
component: `${t.componentName}.bottomBar.pagination.info`,
|
|
97
97
|
fontSize: 12,
|
|
98
98
|
opacity: .7,
|
|
99
99
|
children: t.localeText.pageCount(d)
|
|
100
100
|
})]
|
|
101
101
|
}),
|
|
102
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ I(fe, {
|
|
103
103
|
componentName: t.componentName,
|
|
104
104
|
label: t.localeText.nextPage,
|
|
105
105
|
onClick: s,
|
|
106
106
|
disabled: !u,
|
|
107
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ I(he, {})
|
|
108
108
|
}),
|
|
109
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ I(fe, {
|
|
110
110
|
componentName: t.componentName,
|
|
111
111
|
label: t.localeText.lastPage,
|
|
112
112
|
onClick: c,
|
|
113
113
|
disabled: !u,
|
|
114
|
-
children: /* @__PURE__ */
|
|
114
|
+
children: /* @__PURE__ */ I(_e, {})
|
|
115
115
|
})
|
|
116
116
|
]
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
|
|
120
|
-
function
|
|
119
|
+
le.displayName = "DataGridPagination";
|
|
120
|
+
function ue({ grid: e, pageSize: t }) {
|
|
121
121
|
let n = e.pagination.pageSizeOptions;
|
|
122
|
-
return !n || n.length === 0 ? null : /* @__PURE__ */
|
|
122
|
+
return !n || n.length === 0 ? null : /* @__PURE__ */ I(_, {
|
|
123
123
|
ai: "center",
|
|
124
124
|
gap: 1,
|
|
125
125
|
me: 1,
|
|
126
|
-
children: /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ I(a, {
|
|
127
127
|
component: `${e.componentName}.bottomBar.pagination.pageSize`,
|
|
128
128
|
tag: "select",
|
|
129
129
|
fontSize: 12,
|
|
@@ -134,24 +134,25 @@ function le({ grid: e, pageSize: t }) {
|
|
|
134
134
|
value: t,
|
|
135
135
|
onChange: (t) => e.pagination.changePageSize(Number(t.target.value))
|
|
136
136
|
},
|
|
137
|
-
children: n.map((t) => /* @__PURE__ */
|
|
137
|
+
children: n.map((t) => /* @__PURE__ */ I("option", {
|
|
138
138
|
value: t,
|
|
139
139
|
children: e.localeText.pageSizeOption(t)
|
|
140
140
|
}, t))
|
|
141
141
|
})
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
let [r, i] =
|
|
144
|
+
function de({ grid: e, page: t, totalPages: n }) {
|
|
145
|
+
let [r, i] = P(String(t)), [a, o] = P(t);
|
|
146
146
|
t !== a && (o(t), i(String(t)));
|
|
147
|
-
let s =
|
|
147
|
+
let s = A(() => {
|
|
148
148
|
e.pagination.jumpToPage(r), i(String(e.pagination.page));
|
|
149
|
-
}, [e, r]), c =
|
|
149
|
+
}, [e, r]), c = A((e) => {
|
|
150
150
|
e.key === "Enter" ? s() : e.key === "Escape" && i(String(t));
|
|
151
151
|
}, [s, t]);
|
|
152
|
-
return /* @__PURE__ */
|
|
152
|
+
return /* @__PURE__ */ I(x, {
|
|
153
153
|
type: "number",
|
|
154
154
|
variant: "compact",
|
|
155
|
+
width: "auto",
|
|
155
156
|
value: r,
|
|
156
157
|
onChange: (e) => i(e.target.value),
|
|
157
158
|
textAlign: "center",
|
|
@@ -165,9 +166,9 @@ function ue({ grid: e, page: t, totalPages: n }) {
|
|
|
165
166
|
}
|
|
166
167
|
});
|
|
167
168
|
}
|
|
168
|
-
function
|
|
169
|
+
function fe(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 pe(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
204
|
function me() {
|
|
207
|
-
return /* @__PURE__ */
|
|
205
|
+
return /* @__PURE__ */ I(pe, { d: "M15 18l-6-6 6-6" });
|
|
208
206
|
}
|
|
209
207
|
function he() {
|
|
210
|
-
return /* @__PURE__ */
|
|
208
|
+
return /* @__PURE__ */ I(pe, { d: "M9 18l6-6-6-6" });
|
|
211
209
|
}
|
|
212
210
|
function ge() {
|
|
213
|
-
return /* @__PURE__ */
|
|
211
|
+
return /* @__PURE__ */ I(pe, { d: "M18 18l-6-6 6-6M11 18l-6-6 6-6" });
|
|
212
|
+
}
|
|
213
|
+
function _e() {
|
|
214
|
+
return /* @__PURE__ */ I(pe, { 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 ve(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(ce, { grid: t }),
|
|
230
|
+
/* @__PURE__ */ I(le, { 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(ce, { 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 ye = D(null);
|
|
259
|
+
function R() {
|
|
260
|
+
return j(ye);
|
|
260
261
|
}
|
|
261
|
-
var
|
|
262
|
-
function
|
|
263
|
-
let r =
|
|
262
|
+
var be = () => () => {};
|
|
263
|
+
function z(e, t, n) {
|
|
264
|
+
let r = oe(e?.activeCell.subscribe ?? be, () => !!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
|
|
@@ -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,
|
|
@@ -344,65 +345,65 @@ 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
|
+
}, B, Ce;
|
|
349
|
+
function we() {
|
|
350
|
+
return Ce ??= import("../dataGridDateParts.mjs").then((e) => B = e.default), Ce;
|
|
350
351
|
}
|
|
351
|
-
function
|
|
352
|
-
return
|
|
352
|
+
function Te() {
|
|
353
|
+
return B;
|
|
353
354
|
}
|
|
354
|
-
function
|
|
355
|
-
let [t, n] =
|
|
355
|
+
function Ee(e) {
|
|
356
|
+
let [t, n] = P(void 0);
|
|
356
357
|
return r(() => {
|
|
357
358
|
if (!e || t) return;
|
|
358
|
-
if (
|
|
359
|
-
n(() =>
|
|
359
|
+
if (B) {
|
|
360
|
+
n(() => B);
|
|
360
361
|
return;
|
|
361
362
|
}
|
|
362
363
|
let r = !0;
|
|
363
|
-
return
|
|
364
|
+
return we().then((e) => r && n(() => e)), () => {
|
|
364
365
|
r = !1;
|
|
365
366
|
};
|
|
366
367
|
}, [e, t]), t;
|
|
367
368
|
}
|
|
368
369
|
//#endregion
|
|
369
370
|
//#region src/components/dataGrid/models/editModel.ts
|
|
370
|
-
function
|
|
371
|
+
function V(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 De = 1e3;
|
|
375
|
+
function Oe(e) {
|
|
376
|
+
return typeof e == "number" ? "number" : typeof e == "boolean" ? "checkbox" : e instanceof Date ? "datetime" : typeof e == "string" ? Ae.test(e) ? "date" : je.test(e) ? "time" : Me.test(e) ? "datetime" : "text" : "text";
|
|
376
377
|
}
|
|
377
|
-
var
|
|
378
|
+
var ke = /* @__PURE__ */ new Set([
|
|
378
379
|
"date",
|
|
379
380
|
"time",
|
|
380
381
|
"datetime"
|
|
381
|
-
]),
|
|
382
|
-
function
|
|
383
|
-
return
|
|
382
|
+
]), Ae = /^\d{4}-\d{2}-\d{2}$/, je = /^\d{2}:\d{2}(:\d{2}(\.\d+)?)?$/, Me = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;
|
|
383
|
+
function Ne(e) {
|
|
384
|
+
return ke.has(e);
|
|
384
385
|
}
|
|
385
|
-
function
|
|
386
|
+
function Pe(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 Fe = [
|
|
392
393
|
"value",
|
|
393
394
|
"oldValue",
|
|
394
395
|
"error"
|
|
395
|
-
],
|
|
396
|
+
], Ie = /* @__PURE__ */ new Set([
|
|
396
397
|
"true",
|
|
397
398
|
"1",
|
|
398
399
|
"yes"
|
|
399
|
-
]),
|
|
400
|
+
]), Le = /* @__PURE__ */ new Set([
|
|
400
401
|
"false",
|
|
401
402
|
"0",
|
|
402
403
|
"no",
|
|
403
404
|
""
|
|
404
405
|
]);
|
|
405
|
-
function
|
|
406
|
+
function Re(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 Ie.has(e) ? { value: !0 } : Le.has(e) ? { value: !1 } : void 0;
|
|
414
415
|
}
|
|
415
|
-
if (
|
|
416
|
+
if (Ne(e.type)) {
|
|
416
417
|
if (n.trim() === "") return { value: null };
|
|
417
|
-
let t =
|
|
418
|
+
let t = Te();
|
|
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" ? Ae : e.type === "time" ? je : Me).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 ze(e) {
|
|
432
433
|
return e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey;
|
|
433
434
|
}
|
|
434
|
-
var
|
|
435
|
+
var Be = 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: Oe(t) };
|
|
460
461
|
}
|
|
461
462
|
isEditing(e, t) {
|
|
462
463
|
return this._active?.rowKey === e && this._active.columnKey === t;
|
|
@@ -469,7 +470,7 @@ var Ve = class {
|
|
|
469
470
|
return !!this._active;
|
|
470
471
|
}
|
|
471
472
|
isRejected(e, t) {
|
|
472
|
-
return this.rejected.size > 0 && this.rejected.has(
|
|
473
|
+
return this.rejected.size > 0 && this.rejected.has(V(e, t));
|
|
473
474
|
}
|
|
474
475
|
get draft() {
|
|
475
476
|
return this._active?.draft;
|
|
@@ -481,8 +482,8 @@ 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
|
-
this.rejected.delete(
|
|
485
|
+
let i = r === void 0 ? void 0 : Pe(this.editorFor(t, n).type, r);
|
|
486
|
+
this.rejected.delete(V(e.key, t.key)), this._active = {
|
|
486
487
|
row: e,
|
|
487
488
|
rowKey: e.key,
|
|
488
489
|
columnKey: t.key,
|
|
@@ -548,19 +549,19 @@ var Ve = class {
|
|
|
548
549
|
columnKey: t.columnKey,
|
|
549
550
|
oldValue: t.oldValue,
|
|
550
551
|
error: this._active.error
|
|
551
|
-
},
|
|
552
|
+
}, Fe);
|
|
552
553
|
return;
|
|
553
554
|
}
|
|
554
|
-
this.values.set(
|
|
555
|
+
this.values.set(V(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
|
+
}, Fe);
|
|
559
560
|
}
|
|
560
561
|
}
|
|
561
562
|
valueOf(e, t, n) {
|
|
562
563
|
if (this.values.size === 0) return n;
|
|
563
|
-
let r =
|
|
564
|
+
let r = V(e, t);
|
|
564
565
|
return this.values.has(r) ? this.values.get(r) : n;
|
|
565
566
|
}
|
|
566
567
|
get edits() {
|
|
@@ -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 = Re(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,
|
|
@@ -605,13 +606,13 @@ var Ve = class {
|
|
|
605
606
|
this.rejected.clear(), n.forEach((e, t) => {
|
|
606
607
|
let n = r[t];
|
|
607
608
|
if (typeof n == "string" || n === !1) {
|
|
608
|
-
this.rejected.add(
|
|
609
|
+
this.rejected.add(V(e.rowKey, e.columnKey)), o.push({
|
|
609
610
|
...e,
|
|
610
611
|
error: typeof n == "string" ? n : this.invalidValue
|
|
611
612
|
});
|
|
612
613
|
return;
|
|
613
614
|
}
|
|
614
|
-
Object.is(e.value, e.oldValue) || (this.values.set(
|
|
615
|
+
Object.is(e.value, e.oldValue) || (this.values.set(V(e.rowKey, e.columnKey), e.value), a.push(e));
|
|
615
616
|
}), a.length > 0 && (this._edits = [...this._edits, ...a]), this.grid.notify(), a.length > 0 && this.grid.props.onCellEditsChange?.(this._edits, { reason: "paste" });
|
|
616
617
|
let s = this.grid.range.rangeOf(t);
|
|
617
618
|
this.grid.props.onPaste?.({
|
|
@@ -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 + De);
|
|
643
|
+
for (let e = o; e >= Math.max(0, o - De) && 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,
|
|
@@ -647,7 +648,7 @@ var Ve = class {
|
|
|
647
648
|
};
|
|
648
649
|
}
|
|
649
650
|
}
|
|
650
|
-
},
|
|
651
|
+
}, H = class {
|
|
651
652
|
grid;
|
|
652
653
|
row;
|
|
653
654
|
column;
|
|
@@ -719,7 +720,7 @@ var Ve = class {
|
|
|
719
720
|
columnKey: this.column.key
|
|
720
721
|
}, ["value"]);
|
|
721
722
|
};
|
|
722
|
-
},
|
|
723
|
+
}, Ve = class e {
|
|
723
724
|
grid;
|
|
724
725
|
parentRow;
|
|
725
726
|
constructor(e, t) {
|
|
@@ -783,7 +784,7 @@ var Ve = class {
|
|
|
783
784
|
let e = this.grid.columns.value.visibleLeafs;
|
|
784
785
|
return this._cells?.leafs !== e && (this._cells = {
|
|
785
786
|
leafs: e,
|
|
786
|
-
cells: e.map((e) => new
|
|
787
|
+
cells: e.map((e) => new H(this.grid, this, e))
|
|
787
788
|
}), this._cells.cells;
|
|
788
789
|
}
|
|
789
790
|
get cellCount() {
|
|
@@ -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 Ve(this.grid, this)] : [this];
|
|
809
810
|
}
|
|
810
811
|
get allRows() {
|
|
811
812
|
return this;
|
|
@@ -820,7 +821,7 @@ function W(e) {
|
|
|
820
821
|
//#region src/components/dataGrid/useGridNavigation.ts
|
|
821
822
|
var He = "[role=\"gridcell\"],[role=\"columnheader\"]", Ue = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]", We = 2, Ge = [];
|
|
822
823
|
function Ke(e) {
|
|
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 ? Ge : t.flatRows.value, f = t.columns.value.visibleLeafs.length, p = t.aggregation.hasFooter && !t.viewport.isEmpty ? 1 : 0, m = l + d.length + p, h =
|
|
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 ? Ge : 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) {
|
|
@@ -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,7 +882,7 @@ 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
888
|
if (!W(i) || t.columns.value.visibleLeafs[r]?.key !== t.tree.columnKey) return !1;
|
|
@@ -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,7 +907,7 @@ 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];
|
|
@@ -915,12 +916,12 @@ function Ke(e) {
|
|
|
915
916
|
t,
|
|
916
917
|
l,
|
|
917
918
|
o.length
|
|
918
|
-
]),
|
|
919
|
+
]), ee = A((e, t, n) => {
|
|
919
920
|
let r = Array.from(e.querySelectorAll(Ue));
|
|
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
|
+
}, []), te = x.onKeyDown, E = A((e) => {
|
|
924
925
|
let n = e.target, r = n.closest?.(He);
|
|
925
926
|
if (r) {
|
|
926
927
|
if (n !== r) {
|
|
@@ -928,7 +929,7 @@ function Ke(e) {
|
|
|
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") {
|
|
@@ -955,7 +956,7 @@ function Ke(e) {
|
|
|
955
956
|
return;
|
|
956
957
|
}
|
|
957
958
|
}
|
|
958
|
-
if (t.edits.enabled &&
|
|
959
|
+
if (t.edits.enabled && ze(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,41 +972,41 @@ 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 Se(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
|
|
@@ -1299,10 +1300,10 @@ var it = class {
|
|
|
1299
1300
|
//#endregion
|
|
1300
1301
|
//#region src/components/dataGrid/components/dataGridDetailRow.tsx
|
|
1301
1302
|
function ct(e) {
|
|
1302
|
-
let { row: t, index: n } = e, { grid: i, parentRow: o } = t, s = i.props.def.rowDetail, c =
|
|
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 } = z(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",
|
|
@@ -1335,14 +1336,14 @@ function ct(e) {
|
|
|
1335
1336
|
});
|
|
1336
1337
|
}
|
|
1337
1338
|
ct.displayName = "DataGridDetailRow";
|
|
1338
|
-
var lt =
|
|
1339
|
+
var lt = k(ct);
|
|
1339
1340
|
//#endregion
|
|
1340
1341
|
//#region src/components/dataGrid/components/dataGridAggregateValue.tsx
|
|
1341
1342
|
function ut(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",
|
|
@@ -1356,7 +1357,7 @@ ut.displayName = "DataGridAggregateValue";
|
|
|
1356
1357
|
//#region src/components/dataGrid/components/dataGridCell.tsx
|
|
1357
1358
|
var dt = "button,a[href],input,select,textarea";
|
|
1358
1359
|
function J(e) {
|
|
1359
|
-
let { children: n, cell: r, row: i, columnIndex: a, ariaColIndex: o, ariaColSpan: s, style: c, ...l } = e, { column: u } = r, d =
|
|
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 } = z(d, i, a), { range: h } = u.grid, g = r instanceof H ? 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,
|
|
@@ -1369,8 +1370,8 @@ function J(e) {
|
|
|
1369
1370
|
isInRange: y && !v,
|
|
1370
1371
|
isCurrentCell: v
|
|
1371
1372
|
});
|
|
1372
|
-
let x = r instanceof
|
|
1373
|
-
r instanceof
|
|
1373
|
+
let x = r instanceof H && !r.editing && r.rejected;
|
|
1374
|
+
r instanceof H && r.editing ? b = {
|
|
1374
1375
|
...b,
|
|
1375
1376
|
isEditing: !0,
|
|
1376
1377
|
isInvalid: !!r.error
|
|
@@ -1378,14 +1379,14 @@ function J(e) {
|
|
|
1378
1379
|
...b,
|
|
1379
1380
|
isInvalid: !0
|
|
1380
1381
|
});
|
|
1381
|
-
let S = r instanceof
|
|
1382
|
+
let S = r instanceof H ? (e) => {
|
|
1382
1383
|
e.target.closest(dt) || (t(e.currentTarget), r.beginEdit());
|
|
1383
1384
|
} : void 0, C = h.enabled && g >= 0, w = C ? (e) => {
|
|
1384
1385
|
e.button === 0 && e.pointerType !== "touch" && (e.target.closest(dt) || 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: {
|
|
@@ -1413,24 +1414,24 @@ J.displayName = "DataGridCell";
|
|
|
1413
1414
|
//#endregion
|
|
1414
1415
|
//#region src/components/dataGrid/components/dataGridFooter.tsx
|
|
1415
1416
|
function ft(e) {
|
|
1416
|
-
let { grid: t } = e, { aggregation: n } = t, r =
|
|
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(ut, { cell: e }) : e.column === o ? /* @__PURE__ */ I(a, {
|
|
1434
1435
|
component: `${t.componentName}.footer.label`,
|
|
1435
1436
|
px: 3,
|
|
1436
1437
|
textWrap: "nowrap",
|
|
@@ -1441,15 +1442,16 @@ function ft(e) {
|
|
|
1441
1442
|
});
|
|
1442
1443
|
}
|
|
1443
1444
|
ft.displayName = "DataGridFooter";
|
|
1445
|
+
var pt = k(ft);
|
|
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 mt = [
|
|
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 ht(e) {
|
|
1471
|
+
let { cell: t, columnIndex: n } = e, r = mt[(t.row.rowIndex + n) % mt.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
|
+
ht.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 gt(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(ht, {
|
|
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(ut, { 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
|
+
gt.displayName = "DataGridGroupRow";
|
|
1579
|
+
var _t = k(gt), vt = "input:not([type=\"hidden\"]),select,textarea,button,[role=\"spinbutton\"]";
|
|
1580
|
+
function yt(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 bt(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(vt);
|
|
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(xt, {
|
|
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 xt(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 = Ee(Ne(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: yt(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 (Ne(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
|
+
bt.displayName = "DataGridCellEditor";
|
|
1713
1715
|
//#endregion
|
|
1714
1716
|
//#region src/components/dataGrid/components/dataGridBooleanValue.tsx
|
|
1715
|
-
function
|
|
1717
|
+
function St(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
|
+
St.displayName = "DataGridBooleanValue";
|
|
1737
1739
|
//#endregion
|
|
1738
1740
|
//#region src/components/dataGrid/components/dataGridDateValue.tsx
|
|
1739
|
-
function
|
|
1741
|
+
function Ct(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 && Ne(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 wt(e) {
|
|
1747
|
+
let { value: t, format: n } = e, r = Ee(!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
|
+
wt.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 Tt(e) {
|
|
1757
|
+
let { cell: t } = e, { value: n } = t, r = Ct(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(St, {
|
|
1769
1771
|
value: n,
|
|
1770
1772
|
text: t.grid.localeText
|
|
1771
|
-
}) : r ? /* @__PURE__ */
|
|
1773
|
+
}) : r ? /* @__PURE__ */ I(wt, {
|
|
1772
1774
|
value: n,
|
|
1773
1775
|
format: r
|
|
1774
1776
|
}) : n
|
|
1775
1777
|
})
|
|
1776
1778
|
});
|
|
1777
1779
|
}
|
|
1778
|
-
|
|
1780
|
+
Tt.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 Et(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
|
+
Et.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 Dt(e) {
|
|
1823
|
+
let { row: t, index: n } = e, { selected: r, expandOnRowClick: i } = t, a = (R()?.headerRowCount ?? 0) + n, o = W(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(bt, {
|
|
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(ht, {
|
|
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(Tt, { cell: e });
|
|
1835
|
+
return !o || e.column.key !== s ? r : /* @__PURE__ */ I(Et, {
|
|
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
|
+
Dt.displayName = "DataGridRow";
|
|
1866
|
+
var Ot = k(Dt);
|
|
1865
1867
|
//#endregion
|
|
1866
1868
|
//#region src/components/dataGrid/components/dataGridBody.tsx
|
|
1867
|
-
function
|
|
1868
|
-
return e instanceof
|
|
1869
|
+
function kt(e, t, n) {
|
|
1870
|
+
return e instanceof Ve ? /* @__PURE__ */ I(lt, {
|
|
1869
1871
|
row: e,
|
|
1870
1872
|
index: t,
|
|
1871
1873
|
version: n
|
|
1872
|
-
}, e.key) : e instanceof st ? /* @__PURE__ */
|
|
1874
|
+
}, e.key) : e instanceof st ? /* @__PURE__ */ I(_t, {
|
|
1873
1875
|
row: e,
|
|
1874
1876
|
index: t,
|
|
1875
1877
|
version: n
|
|
1876
|
-
}, e.key) : /* @__PURE__ */
|
|
1878
|
+
}, e.key) : /* @__PURE__ */ I(Ot, {
|
|
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 At(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 : G.take(f, o, i).map((e, n) => kt(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(pt, {
|
|
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(pt, {
|
|
1947
|
+
grid: t,
|
|
1948
|
+
version: t.headerVersion
|
|
1949
|
+
})]
|
|
1939
1950
|
});
|
|
1940
1951
|
}
|
|
1941
|
-
|
|
1952
|
+
At.displayName = "DataGridBody";
|
|
1942
1953
|
//#endregion
|
|
1943
1954
|
//#region src/components/dataGrid/components/dataGridEmptyColumns.tsx
|
|
1944
|
-
function
|
|
1955
|
+
function jt(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 Mt;
|
|
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
|
+
})(Mt ||= {});
|
|
2092
|
+
var X = Mt, Nt;
|
|
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
|
+
})(Nt ||= {});
|
|
2120
|
+
var Z = Nt, Pt = 300;
|
|
2121
|
+
function Ft(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
|
+
}, Pt));
|
|
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 It(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 Lt({ 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 } = Ft(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(It, {
|
|
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 Rt({ 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 } = Ft(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(It, {
|
|
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(It, {
|
|
2320
2331
|
label: i.clearFilter(r),
|
|
2321
2332
|
onClear: C
|
|
2322
2333
|
})]
|
|
2323
2334
|
})]
|
|
2324
2335
|
});
|
|
2325
2336
|
}
|
|
2326
|
-
function Rt({ column: e }) {
|
|
2327
|
-
let t = De(!0);
|
|
2328
|
-
return t ? /* @__PURE__ */ L(t.DateFilter, { column: e }) : null;
|
|
2329
|
-
}
|
|
2330
2337
|
function zt({ column: e }) {
|
|
2331
|
-
let
|
|
2338
|
+
let t = Ee(!0);
|
|
2339
|
+
return t ? /* @__PURE__ */ I(t.DateFilter, { column: e }) : null;
|
|
2340
|
+
}
|
|
2341
|
+
function Bt({ 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 Vt(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(Rt, { column: t });
|
|
2387
|
+
case "multiselect": return /* @__PURE__ */ I(Bt, { column: t });
|
|
2388
|
+
case "date": return /* @__PURE__ */ I(zt, { column: t });
|
|
2389
|
+
default: return /* @__PURE__ */ I(Lt, { column: t });
|
|
2379
2390
|
}
|
|
2380
2391
|
}
|
|
2381
|
-
|
|
2392
|
+
Vt.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 Ht(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 } = z(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(Vt, { column: t })
|
|
2409
2420
|
});
|
|
2410
2421
|
}
|
|
2411
|
-
|
|
2422
|
+
Ht.displayName = "DataGridFilterCell";
|
|
2412
2423
|
//#endregion
|
|
2413
2424
|
//#region src/components/dataGrid/components/dataGridFilterRow.tsx
|
|
2414
|
-
function
|
|
2425
|
+
function Ut(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(Ht, {
|
|
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
|
+
Ut.displayName = "DataGridFilterRow";
|
|
2433
2444
|
//#endregion
|
|
2434
2445
|
//#region src/icons/sortIcon.tsx
|
|
2435
|
-
function
|
|
2436
|
-
return /* @__PURE__ */
|
|
2446
|
+
function Wt(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 Gt(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 Kt(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 qt(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 Jt(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 Yt(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(Wt, {
|
|
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(qt, {
|
|
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(Kt, {
|
|
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(Jt, {
|
|
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(Jt, {
|
|
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(Gt, { 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
|
+
Yt.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 Xt = (e) => "touches" in e ? e.touches[0]?.pageX ?? 0 : e.pageX, Zt = 16, Qt = 150;
|
|
2697
|
+
function $t(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(Xt(e.nativeEvent));
|
|
2701
|
+
let r = new AbortController(), { signal: i } = r, a = 0, o = Xt(e.nativeEvent), s = () => {
|
|
2691
2702
|
t.applyResize(o), n.paintSizes();
|
|
2692
2703
|
}, c = n.resizeMode === "instant" ? (e) => {
|
|
2693
|
-
o =
|
|
2704
|
+
o = Xt(e), s();
|
|
2694
2705
|
} : (e) => {
|
|
2695
|
-
o =
|
|
2706
|
+
o = Xt(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(Zt);
|
|
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, Qt);
|
|
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
|
+
$t.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 en(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 } = z(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(Wt, {
|
|
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($t, {
|
|
2863
2874
|
column: t,
|
|
2864
2875
|
controls: x
|
|
2865
2876
|
}),
|
|
2866
|
-
f && /* @__PURE__ */
|
|
2877
|
+
f && /* @__PURE__ */ I(Yt, { column: t })
|
|
2867
2878
|
] })
|
|
2868
2879
|
});
|
|
2869
2880
|
}
|
|
2870
|
-
|
|
2881
|
+
en.displayName = "DataGridHeaderCell";
|
|
2871
2882
|
//#endregion
|
|
2872
2883
|
//#region src/components/dataGrid/components/dataGridHeader.tsx
|
|
2873
|
-
function
|
|
2874
|
-
let { grid: t } = e, n =
|
|
2884
|
+
function tn(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(en, {
|
|
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(Ut, { grid: t }),
|
|
2922
|
+
o && u && /* @__PURE__ */ I(a, {
|
|
2912
2923
|
tag: "span",
|
|
2913
2924
|
component: `${t.componentName}.header.hover`,
|
|
2914
2925
|
variant: {
|
|
@@ -2927,40 +2938,40 @@ function en(e) {
|
|
|
2927
2938
|
]
|
|
2928
2939
|
});
|
|
2929
2940
|
}
|
|
2930
|
-
|
|
2931
|
-
var
|
|
2941
|
+
tn.displayName = "DataGridHeader";
|
|
2942
|
+
var nn = k(tn);
|
|
2932
2943
|
//#endregion
|
|
2933
2944
|
//#region src/components/dataGrid/components/dataGridLoader.tsx
|
|
2934
|
-
function
|
|
2945
|
+
function rn(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
|
+
rn.displayName = "DataGridLoader";
|
|
2950
2961
|
//#endregion
|
|
2951
2962
|
//#region src/components/dataGrid/components/dataGridContent.tsx
|
|
2952
|
-
function
|
|
2953
|
-
let { grid: t } = e, n =
|
|
2963
|
+
function an(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
2970
|
direction: xe.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
2976
|
}, [c]), { navigation: u, onKeyDown: d } = Ke({
|
|
2966
2977
|
grid: t,
|
|
@@ -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(ye.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(nn, {
|
|
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(rn, { grid: t }),
|
|
3035
|
+
/* @__PURE__ */ I(At, {
|
|
3025
3036
|
grid: t,
|
|
3026
3037
|
scroll: i
|
|
3027
3038
|
})
|
|
3028
3039
|
]
|
|
3029
3040
|
})
|
|
3030
|
-
}) : /* @__PURE__ */
|
|
3041
|
+
}) : /* @__PURE__ */ I(jt, { grid: t });
|
|
3031
3042
|
}
|
|
3032
|
-
|
|
3043
|
+
an.displayName = "DataGridContent";
|
|
3033
3044
|
//#endregion
|
|
3034
3045
|
//#region src/components/dataGrid/components/dataGridDataSourceError.tsx
|
|
3035
|
-
function
|
|
3046
|
+
function on(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
|
+
on.displayName = "DataGridDataSourceError";
|
|
3054
3065
|
//#endregion
|
|
3055
3066
|
//#region src/components/dataGrid/components/dataGridColumnGroups.tsx
|
|
3056
|
-
function
|
|
3067
|
+
function sn(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(Kt, {
|
|
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
|
+
sn.displayName = "DataGridColumnGroups";
|
|
3088
3099
|
//#endregion
|
|
3089
3100
|
//#region src/icons/searchIcon.tsx
|
|
3090
|
-
function
|
|
3091
|
-
return /* @__PURE__ */
|
|
3101
|
+
function cn(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 ln = 6;
|
|
3112
|
+
function un(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(dn, {
|
|
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
|
+
un.displayName = "DataGridColumnsPanel";
|
|
3165
|
+
function dn({ 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 > ln, 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(cn, {
|
|
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 fn(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(pn, {
|
|
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(pn, {
|
|
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
|
+
fn.displayName = "DataGridExport";
|
|
3286
|
+
function pn(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 mn(e) {
|
|
3313
|
+
let { grid: t } = e, [n, r] = P(t.globalFilterValue), { debounce: i, cancel: o } = Ft(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(cn, {
|
|
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 hn(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(sn, { 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(mn, { grid: t }),
|
|
3407
|
+
/* @__PURE__ */ I(un, { grid: t }),
|
|
3408
|
+
/* @__PURE__ */ I(fn, { 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
|
+
hn.displayName = "DataGridTopBar";
|
|
3407
3418
|
//#endregion
|
|
3408
3419
|
//#region src/utils/string/fuzzySearch.ts
|
|
3409
|
-
function
|
|
3420
|
+
function gn(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 _n(e, t) {
|
|
3434
|
+
return gn(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 vn(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
|
+
vn.displayName = "DataGridCellRowDetail";
|
|
3456
3467
|
//#endregion
|
|
3457
3468
|
//#region src/components/dataGrid/components/dataGridCellRowSelection.tsx
|
|
3458
|
-
function
|
|
3459
|
-
let { cell: t } = e, n =
|
|
3469
|
+
function yn(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
|
+
yn.displayName = "DataGridCellRowSelection";
|
|
3474
3485
|
//#endregion
|
|
3475
3486
|
//#region src/components/dataGrid/contracts/dataGridContract.ts
|
|
3476
|
-
function
|
|
3487
|
+
function bn(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 xn = 1e3, Sn = class {
|
|
3482
3493
|
column;
|
|
3483
3494
|
constructor(e) {
|
|
3484
3495
|
this.column = e;
|
|
@@ -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 || xn, this.width, this.minWidth);
|
|
3559
3570
|
}
|
|
3560
3571
|
get paddingStart() {
|
|
3561
3572
|
if (!this.column.isRowSelection) return this.column.isEndAligned ? 10 : 3;
|
|
@@ -3641,7 +3652,7 @@ 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 = bn(t.pin);
|
|
3645
3656
|
}
|
|
3646
3657
|
}
|
|
3647
3658
|
columns = [];
|
|
@@ -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 Sn(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;
|
|
@@ -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 = bn(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
|
+
}, Cn = 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 wn(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 = Tn(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 Tn(n, e) !== void 0 || Reflect.has(t, n);
|
|
4055
4066
|
},
|
|
4056
4067
|
getOwnPropertyDescriptor(n, r) {
|
|
4057
|
-
return
|
|
4058
|
-
value: t(
|
|
4068
|
+
return Tn(r, e) === void 0 ? Reflect.getOwnPropertyDescriptor(n, r) : {
|
|
4069
|
+
value: t(Tn(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 Tn(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
|
+
}, En = class extends st {
|
|
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}` : Dn(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 Dn(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 On = {}, kn = class extends U {
|
|
4261
4273
|
sourceLevel;
|
|
4262
|
-
|
|
4263
|
-
|
|
4274
|
+
levelIndex;
|
|
4275
|
+
constructor(e, t, n, r = n) {
|
|
4276
|
+
super(e, On, 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 ?? On;
|
|
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
|
+
}, An = class extends kn {
|
|
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
|
+
}, jn = 100, Mn = 40, Nn = 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 : jn;
|
|
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) : Mn;
|
|
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(Dn(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(), wn(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 : wn(e.length + t.length, (n) => {
|
|
4464
|
+
let r = Fn(t, n);
|
|
4465
|
+
return t[r] === n ? new Ve(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: wn(e.length, (e) => {
|
|
4472
|
+
let i = Fn(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 = Pn(n, r * t + a);
|
|
4489
4502
|
o !== void 0 && e(o, i);
|
|
4490
4503
|
});
|
|
4491
4504
|
});
|
|
@@ -4493,11 +4506,11 @@ 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 kn(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 En(this.grid, n, this.groupColumnAt(n.depth), r) : this.isTree ? new An(this.grid, n, r) : new kn(this.grid, n, r), i.set(r, a)), a.rowIndex = e, a;
|
|
4501
4514
|
}
|
|
4502
4515
|
groupColumnAt(e) {
|
|
4503
4516
|
return G.findOrThrow(this.grid.columns.value.leafs, (t) => t.key === this.groupBy[e]);
|
|
@@ -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 Pn(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 Fn(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 In = 7, Ln = 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 / In * 10) / 10));
|
|
4617
4630
|
}
|
|
4618
4631
|
value(e, t) {
|
|
4619
4632
|
let { exportValue: n } = e.def, r = n ? n(t) : t[e.key];
|
|
@@ -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
|
+
}, Rn = 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
|
+
}, zn = 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 ?? ""}` : `${Vn[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" ? Te()?.describeDay(t.value, t.valueTo ?? t.value) ?? `${t.value}–${t.valueTo ?? ""}` : `${Hn[t.operator]} ${Te()?.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 (Un(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, Bn) && r === -1; t++) {
|
|
4864
4877
|
let i = e[t];
|
|
4865
|
-
|
|
4878
|
+
Un(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 (Un(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++) Un(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
|
+
}, Bn = 1e4, Vn = {
|
|
4923
4936
|
eq: "=",
|
|
4924
4937
|
ne: "≠",
|
|
4925
4938
|
gt: ">",
|
|
4926
4939
|
gte: "≥",
|
|
4927
4940
|
lt: "<",
|
|
4928
4941
|
lte: "≤"
|
|
4929
|
-
},
|
|
4942
|
+
}, Hn = {
|
|
4930
4943
|
on: "=",
|
|
4931
4944
|
before: "<",
|
|
4932
4945
|
after: ">"
|
|
4933
4946
|
};
|
|
4934
|
-
function
|
|
4947
|
+
function Un(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 Wn = {
|
|
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
|
+
}, Gn = 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
|
+
}, Kn = /["\t\r\n]/;
|
|
5106
|
+
function qn(e) {
|
|
5094
5107
|
if (e == null) return "";
|
|
5095
5108
|
let t = e instanceof Date ? e.toISOString() : String(e);
|
|
5096
|
-
return
|
|
5097
|
-
}
|
|
5098
|
-
function qn(e) {
|
|
5099
|
-
return e.map((e) => e.map(Kn).join(" ")).join("\r\n");
|
|
5109
|
+
return Kn.test(t) ? `"${t.split("\"").join("\"\"")}"` : t;
|
|
5100
5110
|
}
|
|
5101
5111
|
function Jn(e) {
|
|
5112
|
+
return e.map((e) => e.map(qn).join(" ")).join("\r\n");
|
|
5113
|
+
}
|
|
5114
|
+
function Yn(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 Xn(e, t) {
|
|
5110
5123
|
return e?.row === t?.row && e?.column === t?.column;
|
|
5111
5124
|
}
|
|
5112
|
-
var
|
|
5125
|
+
var Zn = 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
|
+
Xn(this._focus, r) && Xn(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 && !Xn(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", Jn(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 = Yn(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
|
+
}, Qn = class extends U {
|
|
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 $n(e) {
|
|
5292
5305
|
return JSON.stringify(e);
|
|
5293
5306
|
}
|
|
5294
|
-
var
|
|
5307
|
+
var er = 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($n(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($n(r.slice(0, e)));
|
|
5351
5364
|
(a ? a.children : t).push(i);
|
|
5352
5365
|
}), t;
|
|
5353
5366
|
}
|
|
@@ -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 Qn(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
|
+
}, tr = {};
|
|
5454
|
+
function nr(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 rr = class t {
|
|
5450
5463
|
props;
|
|
5451
5464
|
constructor(e, t) {
|
|
5452
5465
|
this.props = e, t && this.listeners.add(t);
|
|
@@ -5474,9 +5487,13 @@ var nr = class t {
|
|
|
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
|
}
|
|
5494
|
+
notifyLayout = () => {
|
|
5495
|
+
this._layoutVersion++, this.notifyRows();
|
|
5496
|
+
};
|
|
5480
5497
|
setProps(e) {
|
|
5481
5498
|
let n = this.props;
|
|
5482
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());
|
|
@@ -5514,7 +5531,7 @@ var nr = class t {
|
|
|
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
|
+
...Wn,
|
|
5518
5535
|
...e
|
|
5519
5536
|
};
|
|
5520
5537
|
return this._localeText = {
|
|
@@ -5531,7 +5548,7 @@ var nr = class t {
|
|
|
5531
5548
|
pin: n,
|
|
5532
5549
|
width: 50,
|
|
5533
5550
|
align: "center",
|
|
5534
|
-
Cell:
|
|
5551
|
+
Cell: yn
|
|
5535
5552
|
}, this));
|
|
5536
5553
|
}
|
|
5537
5554
|
if (e.showRowNumber) {
|
|
@@ -5551,7 +5568,7 @@ var nr = class t {
|
|
|
5551
5568
|
pin: n,
|
|
5552
5569
|
width: r,
|
|
5553
5570
|
align: "center",
|
|
5554
|
-
Cell:
|
|
5571
|
+
Cell: vn
|
|
5555
5572
|
}, this));
|
|
5556
5573
|
}
|
|
5557
5574
|
return t;
|
|
@@ -5610,7 +5627,7 @@ var nr = class t {
|
|
|
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 && _n(t, String(r));
|
|
5614
5631
|
});
|
|
5615
5632
|
}
|
|
5616
5633
|
matchesColumnFilters(e) {
|
|
@@ -5622,7 +5639,7 @@ var nr = class t {
|
|
|
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 && _n(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 t {
|
|
|
5640
5657
|
}
|
|
5641
5658
|
case "date": {
|
|
5642
5659
|
if (!t.value) return !0;
|
|
5643
|
-
let n =
|
|
5660
|
+
let n = nr(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 t {
|
|
|
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 t {
|
|
|
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
|
+
], () => G.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 = G.findOrThrow(this.columns.value.leafs, (e) => e.key === r);
|
|
5814
|
+
return this._sortColumn === "grouping-cell" && (e = G.sortBy(e, (e) => e[r], this._sortDirection)), G.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 U(this, e, t));
|
|
5816
|
+
return new st(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 U(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 t {
|
|
|
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
|
}
|
|
@@ -5827,7 +5874,7 @@ var nr = class t {
|
|
|
5827
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;
|
|
@@ -5862,7 +5909,7 @@ var nr = class t {
|
|
|
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 t {
|
|
|
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 Ve ? n.heightForOffset : this.rowHeight;
|
|
5913
5960
|
return {
|
|
5914
5961
|
offsets: e,
|
|
5915
5962
|
totalHeight: t
|
|
5916
5963
|
};
|
|
5917
5964
|
}, () => [this.flatRows]);
|
|
5918
5965
|
viewport = new xe(this);
|
|
5919
|
-
columnVisibility = new
|
|
5920
|
-
filter = new
|
|
5921
|
-
pagination = new
|
|
5966
|
+
columnVisibility = new Cn(this);
|
|
5967
|
+
filter = new Rn(this);
|
|
5968
|
+
pagination = new Gn(this);
|
|
5922
5969
|
aggregation = new it(this);
|
|
5923
|
-
exporter = new
|
|
5924
|
-
source = new
|
|
5925
|
-
tree = new
|
|
5926
|
-
edits = new
|
|
5927
|
-
range = new
|
|
5928
|
-
list = new
|
|
5970
|
+
exporter = new Ln(this);
|
|
5971
|
+
source = new Nn(this);
|
|
5972
|
+
tree = new er(this);
|
|
5973
|
+
edits = new Be(this);
|
|
5974
|
+
range = new Zn(this);
|
|
5975
|
+
list = new zn(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 : tr;
|
|
5935
5982
|
}
|
|
5936
5983
|
exportCsv = async (e = {}) => {
|
|
5937
5984
|
let { downloadCsv: t } = await import("../gridExport.mjs");
|
|
@@ -6034,7 +6081,7 @@ var nr = class t {
|
|
|
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 = bn(t), r = G.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 t {
|
|
|
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 t {
|
|
|
6126
6176
|
};
|
|
6127
6177
|
//#endregion
|
|
6128
6178
|
//#region src/components/dataGrid/useGrid.ts
|
|
6129
|
-
function
|
|
6130
|
-
let [t] =
|
|
6179
|
+
function ir(e) {
|
|
6180
|
+
let [t] = P(() => new rr(e)), n = d("datagrid");
|
|
6131
6181
|
return t.setProps(e), t.setIdentifier(n), oe(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 ar, or;
|
|
6186
|
+
function sr() {
|
|
6187
|
+
return or ??= import("../dataGridList.mjs").then((e) => ar = e.default), or;
|
|
6138
6188
|
}
|
|
6139
|
-
n("(max-width: 36rem)")?.matches &&
|
|
6140
|
-
function
|
|
6141
|
-
let [t, n] =
|
|
6142
|
-
return
|
|
6189
|
+
n("(max-width: 36rem)")?.matches && sr();
|
|
6190
|
+
function cr(e) {
|
|
6191
|
+
let [t, n] = P(() => ar);
|
|
6192
|
+
return M(() => {
|
|
6143
6193
|
if (!e || t) return;
|
|
6144
6194
|
let r = !0;
|
|
6145
|
-
return
|
|
6195
|
+
return sr().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 lr(e, t) {
|
|
6203
|
+
let n = ir(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 = cr(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(hn, { grid: n }),
|
|
6236
|
+
/* @__PURE__ */ I(on, { grid: n }),
|
|
6237
|
+
/* @__PURE__ */ I(an, { grid: n }),
|
|
6238
|
+
n.props.def.bottomBar && /* @__PURE__ */ I(ve, { 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 ur = k(O(lr));
|
|
6246
|
+
lr.displayName = "DataGrid";
|
|
6197
6247
|
//#endregion
|
|
6198
|
-
export {
|
|
6248
|
+
export { Wn as DATA_GRID_LOCALE_TEXT, rn as a, Z as c, bt as d, ur as default, Y as f, on as i, wt as l, Ee as m, un as n, Wt as o, W as p, cn as r, Ft as s, fn as t, Ct as u };
|