@box-kite/react 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/box-kite/references/components.md +2 -2
- package/BOX_AI_CONTEXT.md +79 -75
- package/BOX_KITE_AI_CONTEXT.md +79 -75
- package/README.md +1 -1
- package/components/dataGrid/components/dataGridBottomBarSelection.d.ts +7 -0
- package/components/dataGrid/components/dataGridDetailRow.d.ts +3 -3
- package/components/dataGrid/components/dataGridGroupRow.d.ts +3 -3
- package/components/dataGrid/components/dataGridHeader.d.ts +6 -2
- package/components/dataGrid/components/dataGridRow.d.ts +3 -3
- package/components/dataGrid/contracts/dataGridContract.d.ts +13 -0
- package/components/dataGrid/gridNavigationContext.d.ts +7 -2
- package/components/dataGrid/models/editModel.d.ts +6 -4
- package/components/dataGrid/models/exportModel.d.ts +1 -1
- package/components/dataGrid/models/gridModel.d.ts +55 -2
- package/components/dataGrid/models/headerCellModel.d.ts +5 -0
- package/components/dataGrid/models/localeText.d.ts +102 -0
- package/components/dataGrid/models/rangeModel.d.ts +2 -0
- package/components/dataGrid/useFilterDraft.d.ts +9 -0
- package/components/dataGrid.cjs +3 -3
- package/components/dataGrid.d.ts +1 -0
- package/components/dataGrid.mjs +1394 -990
- package/components/semantics.d.ts +29 -29
- package/docs/components.md +1 -1
- package/package.json +28 -22
- package/utils/dataGrid/activeCellStore.d.ts +14 -0
- package/utils/dataGrid/filterDraftUtils.d.ts +19 -0
- package/utils/dataGrid/headerCellUtils.d.ts +50 -0
package/components/dataGrid.mjs
CHANGED
|
@@ -2,118 +2,150 @@
|
|
|
2
2
|
import { o as e, u as t } from "../platform.mjs";
|
|
3
3
|
import { n } from "../effects.mjs";
|
|
4
4
|
import r from "../box.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
import { Path as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import { Span as
|
|
19
|
-
import
|
|
20
|
-
import { Fragment as
|
|
5
|
+
import { a as i, n as a, o, r as s, t as c } from "../behavior.mjs";
|
|
6
|
+
import { t as l } from "../identity.mjs";
|
|
7
|
+
import { Path as u, Svg as d } from "./svg.mjs";
|
|
8
|
+
import f from "./baseSvg.mjs";
|
|
9
|
+
import p from "./button.mjs";
|
|
10
|
+
import m from "./flex.mjs";
|
|
11
|
+
import h from "./checkbox.mjs";
|
|
12
|
+
import g from "./overlay.mjs";
|
|
13
|
+
import _ from "./presence.mjs";
|
|
14
|
+
import v from "./visuallyHidden.mjs";
|
|
15
|
+
import y from "./textbox.mjs";
|
|
16
|
+
import b from "./grid.mjs";
|
|
17
|
+
import x from "./dropdown.mjs";
|
|
18
|
+
import { Span as S } from "./semantics.mjs";
|
|
19
|
+
import C, { Fragment as w, createContext as T, forwardRef as E, memo as D, useCallback as O, useContext as ee, useEffect as k, useImperativeHandle as A, useLayoutEffect as j, useMemo as M, useRef as N, useState as P, useSyncExternalStore as F } from "react";
|
|
20
|
+
import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
21
21
|
import { useSyncExternalStore as te } from "use-sync-external-store/shim";
|
|
22
|
-
//#region src/components/dataGrid/components/
|
|
22
|
+
//#region src/components/dataGrid/components/dataGridBottomBarSelection.tsx
|
|
23
23
|
function ne(e) {
|
|
24
|
-
let { grid: t } = e,
|
|
24
|
+
let { grid: t } = e, n = t.selectedRows.size, i = t.isSelectionView;
|
|
25
|
+
return /* @__PURE__ */ R(m, {
|
|
26
|
+
component: `${t.componentName}.bottomBar.selection`,
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ L(r, {
|
|
29
|
+
component: `${t.componentName}.bottomBar.info`,
|
|
30
|
+
children: t.localeText.selectedCount(n, t.hiddenSelectedCount)
|
|
31
|
+
}),
|
|
32
|
+
t.canShowSelection && (n > 0 || i) && /* @__PURE__ */ L(p, {
|
|
33
|
+
type: "button",
|
|
34
|
+
component: `${t.componentName}.bottomBar.action`,
|
|
35
|
+
variant: { pressed: i },
|
|
36
|
+
props: { "aria-pressed": i },
|
|
37
|
+
onClick: t.toggleSelectionView,
|
|
38
|
+
children: t.localeText.showSelected
|
|
39
|
+
}),
|
|
40
|
+
n > 0 && /* @__PURE__ */ R(p, {
|
|
41
|
+
type: "button",
|
|
42
|
+
component: `${t.componentName}.bottomBar.action`,
|
|
43
|
+
onClick: t.clearSelection,
|
|
44
|
+
children: [/* @__PURE__ */ L(r, {
|
|
45
|
+
tag: "span",
|
|
46
|
+
props: { "aria-hidden": !0 },
|
|
47
|
+
children: "✕"
|
|
48
|
+
}), t.localeText.clearSelection]
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/components/dataGrid/components/dataGridPagination.tsx
|
|
55
|
+
function re(e) {
|
|
56
|
+
let { grid: t } = e, { pagination: n } = t, i = n.state, a = O(() => n.firstPage(), [n]), o = O(() => n.prevPage(), [n]), s = O(() => n.nextPage(), [n]), c = O(() => n.lastPage(), [n]);
|
|
25
57
|
if (!i) return null;
|
|
26
58
|
let { canGoPrev: l, canGoNext: u, totalPages: d } = n;
|
|
27
|
-
return /* @__PURE__ */
|
|
59
|
+
return /* @__PURE__ */ R(m, {
|
|
28
60
|
component: `${t.componentName}.bottomBar.pagination`,
|
|
29
61
|
gap: .5,
|
|
30
62
|
ai: "center",
|
|
31
63
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ L(ie, {
|
|
33
65
|
grid: t,
|
|
34
66
|
pageSize: i.pageSize
|
|
35
67
|
}),
|
|
36
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ L(oe, {
|
|
37
69
|
componentName: t.componentName,
|
|
38
|
-
label:
|
|
70
|
+
label: t.localeText.firstPage,
|
|
39
71
|
onClick: a,
|
|
40
72
|
disabled: !l,
|
|
41
|
-
children: /* @__PURE__ */
|
|
73
|
+
children: /* @__PURE__ */ L(le, {})
|
|
42
74
|
}),
|
|
43
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ L(oe, {
|
|
44
76
|
componentName: t.componentName,
|
|
45
|
-
label:
|
|
77
|
+
label: t.localeText.previousPage,
|
|
46
78
|
onClick: o,
|
|
47
79
|
disabled: !l,
|
|
48
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ L(se, {})
|
|
49
81
|
}),
|
|
50
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ R(m, {
|
|
51
83
|
ai: "center",
|
|
52
84
|
gap: 1.5,
|
|
53
85
|
px: 2,
|
|
54
86
|
userSelect: "none",
|
|
55
|
-
children: [/* @__PURE__ */
|
|
87
|
+
children: [/* @__PURE__ */ L(ae, {
|
|
56
88
|
grid: t,
|
|
57
89
|
page: i.page,
|
|
58
90
|
totalPages: d
|
|
59
|
-
}), /* @__PURE__ */
|
|
91
|
+
}), /* @__PURE__ */ L(r, {
|
|
60
92
|
component: `${t.componentName}.bottomBar.pagination.info`,
|
|
61
93
|
fontSize: 12,
|
|
62
94
|
opacity: .7,
|
|
63
|
-
children:
|
|
95
|
+
children: t.localeText.pageCount(d)
|
|
64
96
|
})]
|
|
65
97
|
}),
|
|
66
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ L(oe, {
|
|
67
99
|
componentName: t.componentName,
|
|
68
|
-
label:
|
|
100
|
+
label: t.localeText.nextPage,
|
|
69
101
|
onClick: s,
|
|
70
102
|
disabled: !u,
|
|
71
|
-
children: /* @__PURE__ */
|
|
103
|
+
children: /* @__PURE__ */ L(ce, {})
|
|
72
104
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ L(oe, {
|
|
74
106
|
componentName: t.componentName,
|
|
75
|
-
label:
|
|
107
|
+
label: t.localeText.lastPage,
|
|
76
108
|
onClick: c,
|
|
77
109
|
disabled: !u,
|
|
78
|
-
children: /* @__PURE__ */
|
|
110
|
+
children: /* @__PURE__ */ L(ue, {})
|
|
79
111
|
})
|
|
80
112
|
]
|
|
81
113
|
});
|
|
82
114
|
}
|
|
83
|
-
|
|
84
|
-
function
|
|
115
|
+
re.displayName = "DataGridPagination";
|
|
116
|
+
function ie({ grid: e, pageSize: t }) {
|
|
85
117
|
let n = e.pagination.pageSizeOptions;
|
|
86
|
-
return !n || n.length === 0 ? null : /* @__PURE__ */
|
|
118
|
+
return !n || n.length === 0 ? null : /* @__PURE__ */ L(m, {
|
|
87
119
|
ai: "center",
|
|
88
120
|
gap: 1,
|
|
89
121
|
me: 1,
|
|
90
|
-
children: /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ L(r, {
|
|
91
123
|
component: `${e.componentName}.bottomBar.pagination.pageSize`,
|
|
92
124
|
tag: "select",
|
|
93
125
|
fontSize: 12,
|
|
94
126
|
borderRadius: 4,
|
|
95
127
|
cursor: "pointer",
|
|
96
128
|
props: {
|
|
97
|
-
"aria-label":
|
|
129
|
+
"aria-label": e.localeText.rowsPerPage,
|
|
98
130
|
value: t,
|
|
99
131
|
onChange: (t) => e.pagination.changePageSize(Number(t.target.value))
|
|
100
132
|
},
|
|
101
|
-
children: n.map((
|
|
102
|
-
value:
|
|
103
|
-
children:
|
|
104
|
-
},
|
|
133
|
+
children: n.map((t) => /* @__PURE__ */ L("option", {
|
|
134
|
+
value: t,
|
|
135
|
+
children: e.localeText.pageSizeOption(t)
|
|
136
|
+
}, t))
|
|
105
137
|
})
|
|
106
138
|
});
|
|
107
139
|
}
|
|
108
|
-
function
|
|
109
|
-
let [r, i] =
|
|
140
|
+
function ae({ grid: e, page: t, totalPages: n }) {
|
|
141
|
+
let [r, i] = P(String(t)), [a, o] = P(t);
|
|
110
142
|
t !== a && (o(t), i(String(t)));
|
|
111
|
-
let s =
|
|
143
|
+
let s = O(() => {
|
|
112
144
|
e.pagination.jumpToPage(r), i(String(e.pagination.page));
|
|
113
|
-
}, [e, r]), c =
|
|
145
|
+
}, [e, r]), c = O((e) => {
|
|
114
146
|
e.key === "Enter" ? s() : e.key === "Escape" && i(String(t));
|
|
115
147
|
}, [s, t]);
|
|
116
|
-
return /* @__PURE__ */
|
|
148
|
+
return /* @__PURE__ */ L(y, {
|
|
117
149
|
type: "number",
|
|
118
150
|
variant: "compact",
|
|
119
151
|
value: r,
|
|
@@ -121,7 +153,7 @@ function ie({ grid: e, page: t, totalPages: n }) {
|
|
|
121
153
|
textAlign: "center",
|
|
122
154
|
fontSize: 12,
|
|
123
155
|
props: {
|
|
124
|
-
"aria-label":
|
|
156
|
+
"aria-label": e.localeText.pageNumber,
|
|
125
157
|
onKeyDown: c,
|
|
126
158
|
onBlur: s,
|
|
127
159
|
min: 1,
|
|
@@ -129,9 +161,9 @@ function ie({ grid: e, page: t, totalPages: n }) {
|
|
|
129
161
|
}
|
|
130
162
|
});
|
|
131
163
|
}
|
|
132
|
-
function
|
|
164
|
+
function oe(e) {
|
|
133
165
|
let { componentName: t, label: n, onClick: r, disabled: i, children: a } = e;
|
|
134
|
-
return /* @__PURE__ */
|
|
166
|
+
return /* @__PURE__ */ L(p, {
|
|
135
167
|
component: `${t}.bottomBar.pagination.button`,
|
|
136
168
|
props: {
|
|
137
169
|
"aria-label": n,
|
|
@@ -151,8 +183,8 @@ function I(e) {
|
|
|
151
183
|
children: a
|
|
152
184
|
});
|
|
153
185
|
}
|
|
154
|
-
function
|
|
155
|
-
return /* @__PURE__ */
|
|
186
|
+
function z(e) {
|
|
187
|
+
return /* @__PURE__ */ L(d, {
|
|
156
188
|
viewBox: "0 0 24 24",
|
|
157
189
|
width: "14",
|
|
158
190
|
height: "14",
|
|
@@ -161,74 +193,78 @@ function L(e) {
|
|
|
161
193
|
strokeWidth: 2,
|
|
162
194
|
strokeLinecap: "round",
|
|
163
195
|
strokeLinejoin: "round",
|
|
164
|
-
children: /* @__PURE__ */
|
|
196
|
+
children: /* @__PURE__ */ L(u, { d: e.d })
|
|
165
197
|
});
|
|
166
198
|
}
|
|
167
|
-
function ae() {
|
|
168
|
-
return /* @__PURE__ */ P(L, { d: "M15 18l-6-6 6-6" });
|
|
169
|
-
}
|
|
170
|
-
function oe() {
|
|
171
|
-
return /* @__PURE__ */ P(L, { d: "M9 18l6-6-6-6" });
|
|
172
|
-
}
|
|
173
199
|
function se() {
|
|
174
|
-
return /* @__PURE__ */
|
|
200
|
+
return /* @__PURE__ */ L(z, { d: "M15 18l-6-6 6-6" });
|
|
175
201
|
}
|
|
176
202
|
function ce() {
|
|
177
|
-
return /* @__PURE__ */
|
|
203
|
+
return /* @__PURE__ */ L(z, { d: "M9 18l6-6-6-6" });
|
|
204
|
+
}
|
|
205
|
+
function le() {
|
|
206
|
+
return /* @__PURE__ */ L(z, { d: "M18 18l-6-6 6-6M11 18l-6-6 6-6" });
|
|
207
|
+
}
|
|
208
|
+
function ue() {
|
|
209
|
+
return /* @__PURE__ */ L(z, { d: "M6 18l6-6-6-6M13 18l6-6-6-6" });
|
|
178
210
|
}
|
|
179
211
|
//#endregion
|
|
180
212
|
//#region src/components/dataGrid/components/dataGridBottomBar.tsx
|
|
181
|
-
function
|
|
213
|
+
function de(e) {
|
|
182
214
|
let { grid: t } = e, { pagination: n, filter: i } = t;
|
|
183
215
|
if (n.state) {
|
|
184
216
|
let { totalItems: e, startItem: i, endItem: a } = n;
|
|
185
|
-
return /* @__PURE__ */
|
|
217
|
+
return /* @__PURE__ */ R(m, {
|
|
186
218
|
component: `${t.componentName}.bottomBar`,
|
|
187
219
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ L(r, {
|
|
189
221
|
component: `${t.componentName}.bottomBar.info`,
|
|
190
|
-
children:
|
|
222
|
+
children: t.localeText.pageRowRange(i, a, e)
|
|
191
223
|
}),
|
|
192
|
-
t.props.def.rowSelection && /* @__PURE__ */
|
|
193
|
-
|
|
194
|
-
children: ["Selected: ", t.selectedRows.size]
|
|
195
|
-
}),
|
|
196
|
-
/* @__PURE__ */ P(ne, { grid: t })
|
|
224
|
+
t.props.def.rowSelection && /* @__PURE__ */ L(ne, { grid: t }),
|
|
225
|
+
/* @__PURE__ */ L(re, { grid: t })
|
|
197
226
|
]
|
|
198
227
|
});
|
|
199
228
|
}
|
|
200
229
|
let { filtered: a, total: o } = i.filterStats;
|
|
201
|
-
return /* @__PURE__ */
|
|
230
|
+
return /* @__PURE__ */ R(m, {
|
|
202
231
|
component: `${t.componentName}.bottomBar`,
|
|
203
232
|
children: [
|
|
204
|
-
/* @__PURE__ */
|
|
205
|
-
component: `${t.componentName}.bottomBar.info`,
|
|
206
|
-
children: ["Rows: ", a === o ? o : `${a} / ${o}`]
|
|
207
|
-
}),
|
|
208
|
-
t.props.def.rowSelection && /* @__PURE__ */ F(r, {
|
|
233
|
+
/* @__PURE__ */ L(r, {
|
|
209
234
|
component: `${t.componentName}.bottomBar.info`,
|
|
210
|
-
children:
|
|
235
|
+
children: t.localeText.rowCount(a, o)
|
|
211
236
|
}),
|
|
212
|
-
i.hasActiveFilters && /* @__PURE__ */
|
|
237
|
+
i.hasActiveFilters && /* @__PURE__ */ R(p, {
|
|
238
|
+
type: "button",
|
|
213
239
|
component: `${t.componentName}.bottomBar.clearFilters`,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
240
|
+
onClick: i.clearAllFilters,
|
|
241
|
+
children: [/* @__PURE__ */ L(r, {
|
|
242
|
+
tag: "span",
|
|
243
|
+
props: { "aria-hidden": !0 },
|
|
244
|
+
children: "✕"
|
|
245
|
+
}), t.localeText.clearFilters]
|
|
246
|
+
}),
|
|
247
|
+
t.props.def.rowSelection && /* @__PURE__ */ L(ne, { grid: t })
|
|
220
248
|
]
|
|
221
249
|
});
|
|
222
250
|
}
|
|
223
251
|
//#endregion
|
|
224
252
|
//#region src/components/dataGrid/gridNavigationContext.ts
|
|
225
|
-
var
|
|
226
|
-
function
|
|
227
|
-
return
|
|
253
|
+
var fe = T(null);
|
|
254
|
+
function B() {
|
|
255
|
+
return ee(fe);
|
|
256
|
+
}
|
|
257
|
+
var pe = () => () => {};
|
|
258
|
+
function me(e, t, n) {
|
|
259
|
+
let r = F(e?.activeCell.subscribe ?? pe, () => !!e?.activeCell.isActive(t, n), () => !!e?.activeCell.isActive(t, n));
|
|
260
|
+
return e ? {
|
|
261
|
+
...e.cellProps(t, n),
|
|
262
|
+
tabIndex: r ? 0 : -1
|
|
263
|
+
} : {};
|
|
228
264
|
}
|
|
229
265
|
//#endregion
|
|
230
266
|
//#region src/components/dataGrid/models/viewportModel.ts
|
|
231
|
-
var
|
|
267
|
+
var he = class e {
|
|
232
268
|
grid;
|
|
233
269
|
static DEFAULT_VISIBLE_ROWS_COUNT = 10;
|
|
234
270
|
static ROWS_AHEAD = 12;
|
|
@@ -298,34 +334,47 @@ var de = class e {
|
|
|
298
334
|
viewHeight: this.viewHeight
|
|
299
335
|
};
|
|
300
336
|
}
|
|
301
|
-
},
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
337
|
+
}, ge = class {
|
|
338
|
+
row;
|
|
339
|
+
column;
|
|
340
|
+
listeners = /* @__PURE__ */ new Set();
|
|
341
|
+
constructor(e, t) {
|
|
342
|
+
this.row = e, this.column = t;
|
|
343
|
+
}
|
|
344
|
+
subscribe = (e) => (this.listeners.add(e), () => this.listeners.delete(e));
|
|
345
|
+
isActive(e, t) {
|
|
346
|
+
return e === this.row && t === this.column;
|
|
347
|
+
}
|
|
348
|
+
set(e, t) {
|
|
349
|
+
(e !== this.row || t !== this.column) && (this.row = e, this.column = t, this.listeners.forEach((e) => e()));
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region src/components/dataGrid/models/editModel.ts
|
|
354
|
+
function V(e, t) {
|
|
306
355
|
return JSON.stringify([e, t]);
|
|
307
356
|
}
|
|
308
|
-
var
|
|
309
|
-
function
|
|
357
|
+
var _e = 1e3;
|
|
358
|
+
function ve(e) {
|
|
310
359
|
return typeof e == "number" ? "number" : typeof e == "boolean" ? "checkbox" : "text";
|
|
311
360
|
}
|
|
312
|
-
function
|
|
361
|
+
function ye(e, t) {
|
|
313
362
|
if (e === "text") return t;
|
|
314
363
|
if (e !== "number" || t.trim() === "") return;
|
|
315
364
|
let n = Number(t);
|
|
316
365
|
return Number.isFinite(n) ? n : void 0;
|
|
317
366
|
}
|
|
318
|
-
var
|
|
367
|
+
var be = /* @__PURE__ */ new Set([
|
|
319
368
|
"true",
|
|
320
369
|
"1",
|
|
321
370
|
"yes"
|
|
322
|
-
]),
|
|
371
|
+
]), xe = /* @__PURE__ */ new Set([
|
|
323
372
|
"false",
|
|
324
373
|
"0",
|
|
325
374
|
"no",
|
|
326
375
|
""
|
|
327
|
-
])
|
|
328
|
-
function
|
|
376
|
+
]);
|
|
377
|
+
function Se(e, t, n) {
|
|
329
378
|
if (e.type === "number") {
|
|
330
379
|
if (n.trim() === "") return { value: null };
|
|
331
380
|
let e = Number(n);
|
|
@@ -333,7 +382,7 @@ function be(e, t, n) {
|
|
|
333
382
|
}
|
|
334
383
|
if (e.type === "checkbox") {
|
|
335
384
|
let e = n.trim().toLowerCase();
|
|
336
|
-
return
|
|
385
|
+
return be.has(e) ? { value: !0 } : xe.has(e) ? { value: !1 } : void 0;
|
|
337
386
|
}
|
|
338
387
|
if (e.type === "select") {
|
|
339
388
|
let e = t.find((e) => String(e.value) === n);
|
|
@@ -341,14 +390,18 @@ function be(e, t, n) {
|
|
|
341
390
|
}
|
|
342
391
|
return { value: n };
|
|
343
392
|
}
|
|
344
|
-
function
|
|
393
|
+
function Ce(e) {
|
|
345
394
|
return e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey;
|
|
346
395
|
}
|
|
347
|
-
var
|
|
396
|
+
var we = class {
|
|
348
397
|
grid;
|
|
349
398
|
constructor(e) {
|
|
350
399
|
this.grid = e;
|
|
351
400
|
}
|
|
401
|
+
get invalidValue() {
|
|
402
|
+
return this.grid.localeText.invalidValue;
|
|
403
|
+
}
|
|
404
|
+
errorText = (e) => e instanceof Error ? e.message : this.invalidValue;
|
|
352
405
|
values = /* @__PURE__ */ new Map();
|
|
353
406
|
rejected = /* @__PURE__ */ new Set();
|
|
354
407
|
_edits = [];
|
|
@@ -365,16 +418,20 @@ var Se = class {
|
|
|
365
418
|
}
|
|
366
419
|
editorFor(e, t) {
|
|
367
420
|
let { editor: n } = e.def;
|
|
368
|
-
return typeof n == "object" ? n : n ? { type: n } : { type:
|
|
421
|
+
return typeof n == "object" ? n : n ? { type: n } : { type: ve(t) };
|
|
369
422
|
}
|
|
370
423
|
isEditing(e, t) {
|
|
371
424
|
return this._active?.rowKey === e && this._active.columnKey === t;
|
|
372
425
|
}
|
|
426
|
+
rowDigest(e) {
|
|
427
|
+
let t = this._active;
|
|
428
|
+
return !t || t.rowKey !== e ? "" : `${String(t.columnKey)}:${t.token}:${t.drafts}:${+t.pending}:${t.error ?? ""}`;
|
|
429
|
+
}
|
|
373
430
|
get isOpen() {
|
|
374
431
|
return !!this._active;
|
|
375
432
|
}
|
|
376
433
|
isRejected(e, t) {
|
|
377
|
-
return this.rejected.size > 0 && this.rejected.has(
|
|
434
|
+
return this.rejected.size > 0 && this.rejected.has(V(e, t));
|
|
378
435
|
}
|
|
379
436
|
get draft() {
|
|
380
437
|
return this._active?.draft;
|
|
@@ -386,13 +443,14 @@ var Se = class {
|
|
|
386
443
|
return !!this._active?.pending;
|
|
387
444
|
}
|
|
388
445
|
begin(e, t, n, r) {
|
|
389
|
-
let i = r === void 0 ? void 0 :
|
|
390
|
-
this.rejected.delete(
|
|
446
|
+
let i = r === void 0 ? void 0 : ye(this.editorFor(t, n).type, r);
|
|
447
|
+
this.rejected.delete(V(e.key, t.key)), this._active = {
|
|
391
448
|
row: e,
|
|
392
449
|
rowKey: e.key,
|
|
393
450
|
columnKey: t.key,
|
|
394
451
|
draft: i ?? n,
|
|
395
452
|
token: ++this._token,
|
|
453
|
+
drafts: 0,
|
|
396
454
|
pending: !1
|
|
397
455
|
}, this.grid.notify();
|
|
398
456
|
}
|
|
@@ -406,8 +464,9 @@ var Se = class {
|
|
|
406
464
|
this._active && (this._active = {
|
|
407
465
|
...this._active,
|
|
408
466
|
draft: e,
|
|
409
|
-
error: void 0
|
|
410
|
-
|
|
467
|
+
error: void 0,
|
|
468
|
+
drafts: this._active.drafts + 1
|
|
469
|
+
}, this.grid.notifyRows());
|
|
411
470
|
}
|
|
412
471
|
cancel() {
|
|
413
472
|
this._active && (this._token++, this._active = void 0, this.grid.notify());
|
|
@@ -431,7 +490,7 @@ var Se = class {
|
|
|
431
490
|
this._active = {
|
|
432
491
|
...e,
|
|
433
492
|
pending: !0
|
|
434
|
-
}, this.grid.notify(), s.then((t) => this.settle(e.token, o, t), (t) => this.settle(e.token, o,
|
|
493
|
+
}, this.grid.notify(), s.then((t) => this.settle(e.token, o, t), (t) => this.settle(e.token, o, this.errorText(t)));
|
|
435
494
|
return;
|
|
436
495
|
}
|
|
437
496
|
this.settle(e.token, o, s);
|
|
@@ -442,16 +501,16 @@ var Se = class {
|
|
|
442
501
|
this._active = {
|
|
443
502
|
...this._active,
|
|
444
503
|
pending: !1,
|
|
445
|
-
error: typeof n == "string" ? n :
|
|
504
|
+
error: typeof n == "string" ? n : this.invalidValue
|
|
446
505
|
}, this.grid.notify();
|
|
447
506
|
return;
|
|
448
507
|
}
|
|
449
|
-
this.values.set(
|
|
508
|
+
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" });
|
|
450
509
|
}
|
|
451
510
|
}
|
|
452
511
|
valueOf(e, t, n) {
|
|
453
512
|
if (this.values.size === 0) return n;
|
|
454
|
-
let r =
|
|
513
|
+
let r = V(e, t);
|
|
455
514
|
return this.values.has(r) ? this.values.get(r) : n;
|
|
456
515
|
}
|
|
457
516
|
get edits() {
|
|
@@ -470,18 +529,18 @@ var Se = class {
|
|
|
470
529
|
c++;
|
|
471
530
|
continue;
|
|
472
531
|
}
|
|
473
|
-
let f = this.valueOf(l.key, u.key, l.data[u.key]), p =
|
|
532
|
+
let f = this.valueOf(l.key, u.key, l.data[u.key]), p = Se(this.editorFor(u, f), this.optionsFor(u, l), d), m = {
|
|
474
533
|
rowKey: l.key,
|
|
475
534
|
columnKey: u.key,
|
|
476
535
|
row: l.data,
|
|
477
536
|
value: p?.value,
|
|
478
537
|
oldValue: f
|
|
479
538
|
};
|
|
480
|
-
o.push(m), s.push(p ? i?.(m) :
|
|
539
|
+
o.push(m), s.push(p ? i?.(m) : this.grid.localeText.wrongKindOfValue);
|
|
481
540
|
}
|
|
482
541
|
}
|
|
483
542
|
if (s.some((e) => e instanceof Promise)) {
|
|
484
|
-
Promise.all(s.map((e) => Promise.resolve(e).catch(
|
|
543
|
+
Promise.all(s.map((e) => Promise.resolve(e).catch(this.errorText))).then((t) => this.settlePaste(a, e, o, t, c));
|
|
485
544
|
return;
|
|
486
545
|
}
|
|
487
546
|
this.settlePaste(a, e, o, s, c);
|
|
@@ -496,13 +555,13 @@ var Se = class {
|
|
|
496
555
|
this.rejected.clear(), n.forEach((e, t) => {
|
|
497
556
|
let n = r[t];
|
|
498
557
|
if (typeof n == "string" || n === !1) {
|
|
499
|
-
this.rejected.add(
|
|
558
|
+
this.rejected.add(V(e.rowKey, e.columnKey)), o.push({
|
|
500
559
|
...e,
|
|
501
|
-
error: typeof n == "string" ? n :
|
|
560
|
+
error: typeof n == "string" ? n : this.invalidValue
|
|
502
561
|
});
|
|
503
562
|
return;
|
|
504
563
|
}
|
|
505
|
-
Object.is(e.value, e.oldValue) || (this.values.set(
|
|
564
|
+
Object.is(e.value, e.oldValue) || (this.values.set(V(e.rowKey, e.columnKey), e.value), a.push(e));
|
|
506
565
|
}), a.length > 0 && (this._edits = [...this._edits, ...a]), this.grid.notify(), a.length > 0 && this.grid.props.onCellEditsChange?.(this._edits, { reason: "paste" }), this.grid.props.onPaste?.({
|
|
507
566
|
range: this.grid.range.rangeOf(t),
|
|
508
567
|
applied: a,
|
|
@@ -511,8 +570,8 @@ var Se = class {
|
|
|
511
570
|
});
|
|
512
571
|
}
|
|
513
572
|
nextEditable(e, t, n = !1) {
|
|
514
|
-
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 +
|
|
515
|
-
for (let e = o; e >= Math.max(0, o -
|
|
573
|
+
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 + _e);
|
|
574
|
+
for (let e = o; e >= Math.max(0, o - _e) && e <= s; e += a) {
|
|
516
575
|
let t = Math.floor(e / i.length), n = e % i.length, a = r[t], o = i[n];
|
|
517
576
|
if (!(!o || a?.kind !== "row" || !this.isEditable(a, o))) return {
|
|
518
577
|
row: t,
|
|
@@ -520,10 +579,10 @@ var Se = class {
|
|
|
520
579
|
};
|
|
521
580
|
}
|
|
522
581
|
}
|
|
523
|
-
},
|
|
582
|
+
}, Te = Symbol("memo.unset"), Ee = class {
|
|
524
583
|
action;
|
|
525
584
|
deps;
|
|
526
|
-
cache =
|
|
585
|
+
cache = Te;
|
|
527
586
|
dependents = /* @__PURE__ */ new Set();
|
|
528
587
|
wired = !1;
|
|
529
588
|
constructor(e, t) {
|
|
@@ -536,21 +595,21 @@ var Se = class {
|
|
|
536
595
|
}
|
|
537
596
|
}
|
|
538
597
|
get value() {
|
|
539
|
-
return this.wire(), this.cache ===
|
|
598
|
+
return this.wire(), this.cache === Te && (this.cache = this.action()), this.cache;
|
|
540
599
|
}
|
|
541
600
|
clear() {
|
|
542
|
-
if (this.wire(), this.cache !==
|
|
543
|
-
this.cache =
|
|
601
|
+
if (this.wire(), this.cache !== Te) {
|
|
602
|
+
this.cache = Te;
|
|
544
603
|
for (let e of this.dependents) e.clear();
|
|
545
604
|
}
|
|
546
605
|
}
|
|
547
606
|
};
|
|
548
|
-
function
|
|
549
|
-
return new
|
|
607
|
+
function H(e, t = () => []) {
|
|
608
|
+
return new Ee(e, t);
|
|
550
609
|
}
|
|
551
610
|
//#endregion
|
|
552
611
|
//#region src/components/dataGrid/models/cellModel.ts
|
|
553
|
-
var
|
|
612
|
+
var U = class {
|
|
554
613
|
grid;
|
|
555
614
|
row;
|
|
556
615
|
column;
|
|
@@ -617,7 +676,7 @@ var H = class {
|
|
|
617
676
|
cancelEdit = () => {
|
|
618
677
|
this.grid.edits.cancel();
|
|
619
678
|
};
|
|
620
|
-
},
|
|
679
|
+
}, De = class e {
|
|
621
680
|
grid;
|
|
622
681
|
parentRow;
|
|
623
682
|
constructor(e, t) {
|
|
@@ -676,7 +735,7 @@ var H = class {
|
|
|
676
735
|
toggleDetail = () => {
|
|
677
736
|
this.grid.toggleDetailRow(this.key);
|
|
678
737
|
};
|
|
679
|
-
_cells =
|
|
738
|
+
_cells = H(() => this.grid.columns.value.visibleLeafs.map((e) => new U(this.grid, this, e)));
|
|
680
739
|
get cells() {
|
|
681
740
|
return this._cells.value;
|
|
682
741
|
}
|
|
@@ -699,7 +758,7 @@ var H = class {
|
|
|
699
758
|
return this.grid.expandedDetailRows.has(this.key);
|
|
700
759
|
}
|
|
701
760
|
get flatRows() {
|
|
702
|
-
return this.grid.props.def.rowDetail && this.expanded ? [this, new
|
|
761
|
+
return this.grid.props.def.rowDetail && this.expanded ? [this, new De(this.grid, this)] : [this];
|
|
703
762
|
}
|
|
704
763
|
get allRows() {
|
|
705
764
|
return this;
|
|
@@ -707,153 +766,153 @@ var H = class {
|
|
|
707
766
|
};
|
|
708
767
|
//#endregion
|
|
709
768
|
//#region src/components/dataGrid/models/treeRow.ts
|
|
710
|
-
function
|
|
769
|
+
function Oe(e) {
|
|
711
770
|
return !!e && e.isTreeRow === !0;
|
|
712
771
|
}
|
|
713
772
|
//#endregion
|
|
714
773
|
//#region src/components/dataGrid/useGridNavigation.ts
|
|
715
|
-
var
|
|
716
|
-
function
|
|
717
|
-
let { grid: t, scrollerRef: r, scroll: i, onScrollTo: a } = e, s = t.headerRows.value,
|
|
774
|
+
var ke = "[role=\"gridcell\"],[role=\"columnheader\"]", Ae = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]", je = 2, Me = [];
|
|
775
|
+
function Ne(e) {
|
|
776
|
+
let { grid: t, scrollerRef: r, scroll: i, onScrollTo: a } = e, s = t.headerRows.value, l = t.filter.hasFilterableColumns, u = s.length + +!!l, d = t.viewport.isEmpty ? Me : t.flatRows.value, f = t.columns.value.visibleLeafs.length, p = t.aggregation.hasFooter && !t.viewport.isEmpty ? 1 : 0, m = u + d.length + p, h = O((e) => {
|
|
718
777
|
if (e < s.length) return s[e]?.length ?? 0;
|
|
719
|
-
if (e <
|
|
720
|
-
let t =
|
|
778
|
+
if (e < u || e >= u + d.length) return f;
|
|
779
|
+
let t = d[e - u];
|
|
721
780
|
return t ? t.cellCount : 0;
|
|
722
781
|
}, [
|
|
723
|
-
u,
|
|
724
782
|
d,
|
|
725
|
-
|
|
783
|
+
f,
|
|
784
|
+
u,
|
|
726
785
|
s
|
|
727
|
-
]),
|
|
786
|
+
]), g = O((e, t) => e < s.length ? (s[e]?.[t]?.headerCell.columnIndex ?? t + 1) - 1 : e < u ? t : d[e - u]?.columnOf(t) ?? t, [
|
|
787
|
+
d,
|
|
728
788
|
u,
|
|
729
|
-
l,
|
|
730
789
|
s
|
|
731
|
-
]),
|
|
732
|
-
let { viewport: o } = t, s = e -
|
|
733
|
-
if (o.showAll || !c || s >=
|
|
790
|
+
]), _ = N(!1), v = O((e, n) => {
|
|
791
|
+
let { viewport: o } = t, s = e - u, c = r.current;
|
|
792
|
+
if (o.showAll || !c || s >= d.length) return;
|
|
734
793
|
if (s < 0) {
|
|
735
|
-
n >=
|
|
794
|
+
n >= u && (c.scrollTop = 0, a(0));
|
|
736
795
|
return;
|
|
737
796
|
}
|
|
738
|
-
let { startIndex:
|
|
739
|
-
if (s >=
|
|
797
|
+
let { startIndex: l, take: f } = o.window(i.top, i.direction);
|
|
798
|
+
if (s >= l + je && s < l + f - je) return;
|
|
740
799
|
let p = o.rowTop(s);
|
|
741
800
|
c.scrollTop = p, a(p);
|
|
742
801
|
}, [
|
|
743
|
-
|
|
802
|
+
d.length,
|
|
744
803
|
t,
|
|
745
|
-
|
|
804
|
+
u,
|
|
746
805
|
a,
|
|
747
806
|
i,
|
|
748
807
|
r
|
|
749
|
-
]),
|
|
750
|
-
let i = e -
|
|
751
|
-
if (i < 0 || i >=
|
|
808
|
+
]), y = N(0), b = O((e, n, r) => {
|
|
809
|
+
let i = e - u;
|
|
810
|
+
if (i < 0 || i >= d.length) {
|
|
752
811
|
t.range.clear();
|
|
753
812
|
return;
|
|
754
813
|
}
|
|
755
814
|
if (r.reason === "keyboard") {
|
|
756
|
-
t.range.setCurrent(i,
|
|
815
|
+
t.range.setCurrent(i, g(e, n), !!r.event?.shiftKey);
|
|
757
816
|
return;
|
|
758
817
|
}
|
|
759
|
-
t.range.syncCurrent(i,
|
|
818
|
+
t.range.syncCurrent(i, g(e, n));
|
|
760
819
|
}, [
|
|
761
|
-
|
|
762
|
-
|
|
820
|
+
d.length,
|
|
821
|
+
g,
|
|
763
822
|
t,
|
|
764
|
-
|
|
765
|
-
]),
|
|
766
|
-
count:
|
|
767
|
-
columns:
|
|
768
|
-
columnIndexOf:
|
|
823
|
+
u
|
|
824
|
+
]), x = c({
|
|
825
|
+
count: m,
|
|
826
|
+
columns: h,
|
|
827
|
+
columnIndexOf: g,
|
|
769
828
|
pageSize: t.viewport.pageRows,
|
|
770
829
|
onActiveCellChange: (e, t) => {
|
|
771
|
-
let n =
|
|
772
|
-
|
|
830
|
+
let n = y.current;
|
|
831
|
+
y.current = e.row, b(e.row, e.column, t), t.reason === "keyboard" && (v(e.row, n), _.current = !0);
|
|
773
832
|
}
|
|
774
|
-
}),
|
|
833
|
+
}), S = x.activeItem;
|
|
775
834
|
n(() => {
|
|
776
|
-
|
|
835
|
+
_.current && (_.current = !1, S()?.focus());
|
|
777
836
|
});
|
|
778
|
-
let
|
|
837
|
+
let C = O((e, n, r) => {
|
|
779
838
|
if (!t.tree.enabled || e.key !== "ArrowRight" && e.key !== "ArrowLeft") return !1;
|
|
780
|
-
let i =
|
|
781
|
-
if (!
|
|
839
|
+
let i = d[n - u];
|
|
840
|
+
if (!Oe(i) || t.columns.value.visibleLeafs[r]?.key !== t.tree.columnKey) return !1;
|
|
782
841
|
if (e.key === (t.isRtl ? "ArrowLeft" : "ArrowRight")) return !i.hasChildren || i.treeExpanded ? !1 : (i.toggleTree(), !0);
|
|
783
842
|
if (i.hasChildren && i.treeExpanded) return i.toggleTree(), !0;
|
|
784
|
-
for (let e = n - 1; e >=
|
|
785
|
-
let t =
|
|
786
|
-
if (!(!
|
|
843
|
+
for (let e = n - 1; e >= u; e--) {
|
|
844
|
+
let t = d[e - u];
|
|
845
|
+
if (!(!Oe(t) || t.level >= i.level)) return x.setActiveCell(e, r, { reason: "keyboard" }), !0;
|
|
787
846
|
}
|
|
788
847
|
return !1;
|
|
789
848
|
}, [
|
|
790
|
-
|
|
849
|
+
d,
|
|
791
850
|
t,
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
]),
|
|
795
|
-
let { activeIndex: t, activeColumn: n } =
|
|
796
|
-
if (i >= 0 && i <
|
|
851
|
+
u,
|
|
852
|
+
x
|
|
853
|
+
]), w = O((e) => {
|
|
854
|
+
let { activeIndex: t, activeColumn: n } = x, r = e ? -1 : 1, i = n + r;
|
|
855
|
+
if (i >= 0 && i < h(t)) return x.setActiveCell(t, i, { reason: "keyboard" }), !0;
|
|
797
856
|
let a = t + r;
|
|
798
|
-
return a < 0 || a >=
|
|
857
|
+
return a < 0 || a >= m ? !1 : (x.setActiveCell(a, e ? Math.max(0, h(a) - 1) : 0, { reason: "keyboard" }), !0);
|
|
799
858
|
}, [
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
]),
|
|
859
|
+
h,
|
|
860
|
+
x,
|
|
861
|
+
m
|
|
862
|
+
]), T = O((e, n) => {
|
|
804
863
|
if (!t.props.def.rowSelection) return !1;
|
|
805
|
-
if (e <
|
|
806
|
-
let r = t.flatRows.value[e -
|
|
864
|
+
if (e < u) return e >= s.length || !t.columns.value.visibleLeafs[n]?.isRowSelection ? !1 : (t.toggleSelectAllRows(), !0);
|
|
865
|
+
let r = t.flatRows.value[e - u];
|
|
807
866
|
return r instanceof W && (r.toggleSelection(), !0);
|
|
808
867
|
}, [
|
|
809
868
|
t,
|
|
810
|
-
|
|
869
|
+
u,
|
|
811
870
|
s.length
|
|
812
|
-
]),
|
|
813
|
-
let r = Array.from(e.querySelectorAll(
|
|
871
|
+
]), E = O((e, t, n) => {
|
|
872
|
+
let r = Array.from(e.querySelectorAll(Ae));
|
|
814
873
|
if (r.length < 2) return !1;
|
|
815
874
|
let i = r.indexOf(t);
|
|
816
875
|
return i !== -1 && (r[(i + (n ? -1 : 1) + r.length) % r.length].focus(), !0);
|
|
817
|
-
}, []), D =
|
|
818
|
-
let n = e.target, r = n.closest?.(
|
|
876
|
+
}, []), D = x.onKeyDown, ee = O((e) => {
|
|
877
|
+
let n = e.target, r = n.closest?.(ke);
|
|
819
878
|
if (r) {
|
|
820
879
|
if (n !== r) {
|
|
821
880
|
if (e.key === "Escape" && !r.querySelector("[aria-expanded=\"true\"]")) {
|
|
822
881
|
e.preventDefault(), r.focus();
|
|
823
882
|
return;
|
|
824
883
|
}
|
|
825
|
-
e.key === "Tab" &&
|
|
884
|
+
e.key === "Tab" && E(r, n, e.shiftKey) && e.preventDefault();
|
|
826
885
|
return;
|
|
827
886
|
}
|
|
828
887
|
if (e.key === "Tab" && t.props.def.tabNavigation === "cells") {
|
|
829
|
-
|
|
888
|
+
w(e.shiftKey) && e.preventDefault();
|
|
830
889
|
return;
|
|
831
890
|
}
|
|
832
|
-
if (e.key === " " &&
|
|
891
|
+
if (e.key === " " && T(x.activeIndex, x.activeColumn)) {
|
|
833
892
|
e.preventDefault();
|
|
834
893
|
return;
|
|
835
894
|
}
|
|
836
895
|
if (e.key === "Enter" || e.key === " " || e.key === "F2") {
|
|
837
|
-
let n = s[
|
|
896
|
+
let n = s[x.activeIndex]?.[x.activeColumn];
|
|
838
897
|
if (e.key !== "F2" && n?.headerCell.isSortable) {
|
|
839
898
|
e.preventDefault(), n.sortColumn();
|
|
840
899
|
return;
|
|
841
900
|
}
|
|
842
|
-
if (t.edits.beginAt(
|
|
901
|
+
if (t.edits.beginAt(x.activeIndex - u, x.activeColumn)) {
|
|
843
902
|
e.preventDefault();
|
|
844
903
|
return;
|
|
845
904
|
}
|
|
846
|
-
let i = r.querySelector(
|
|
905
|
+
let i = r.querySelector(Ae);
|
|
847
906
|
if (i) {
|
|
848
907
|
e.preventDefault(), i.focus();
|
|
849
908
|
return;
|
|
850
909
|
}
|
|
851
910
|
}
|
|
852
|
-
if (t.edits.enabled &&
|
|
911
|
+
if (t.edits.enabled && Ce(e) && t.edits.beginAt(x.activeIndex - u, x.activeColumn, e.key)) {
|
|
853
912
|
e.preventDefault();
|
|
854
913
|
return;
|
|
855
914
|
}
|
|
856
|
-
if (
|
|
915
|
+
if (C(e, x.activeIndex, x.activeColumn)) {
|
|
857
916
|
e.preventDefault();
|
|
858
917
|
return;
|
|
859
918
|
}
|
|
@@ -861,36 +920,50 @@ function Oe(e) {
|
|
|
861
920
|
}
|
|
862
921
|
}, [
|
|
863
922
|
t,
|
|
864
|
-
|
|
923
|
+
u,
|
|
865
924
|
s,
|
|
866
|
-
|
|
867
|
-
|
|
925
|
+
x.activeColumn,
|
|
926
|
+
x.activeIndex,
|
|
868
927
|
D,
|
|
869
|
-
C,
|
|
870
|
-
T,
|
|
871
928
|
w,
|
|
872
|
-
|
|
873
|
-
|
|
929
|
+
E,
|
|
930
|
+
T,
|
|
931
|
+
C
|
|
932
|
+
]), { setActiveCell: k, activeIndex: A, activeColumn: j } = x, F = o(x.cellProps), [I] = P(() => new ge(A, j));
|
|
933
|
+
n(() => I.set(A, j), [
|
|
934
|
+
I,
|
|
935
|
+
j,
|
|
936
|
+
A
|
|
937
|
+
]);
|
|
938
|
+
let L = O((e, t) => {
|
|
939
|
+
let { ref: n, onFocus: r } = F.current(e, t);
|
|
940
|
+
return {
|
|
941
|
+
ref: n,
|
|
942
|
+
onFocus: r
|
|
943
|
+
};
|
|
944
|
+
}, [F]);
|
|
874
945
|
return {
|
|
875
|
-
navigation:
|
|
876
|
-
rowCount:
|
|
877
|
-
columnCount:
|
|
878
|
-
headerRowCount:
|
|
879
|
-
cellProps:
|
|
880
|
-
|
|
946
|
+
navigation: M(() => ({
|
|
947
|
+
rowCount: m,
|
|
948
|
+
columnCount: f,
|
|
949
|
+
headerRowCount: u,
|
|
950
|
+
cellProps: L,
|
|
951
|
+
activeCell: I,
|
|
952
|
+
setActiveCell: k
|
|
881
953
|
}), [
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
954
|
+
I,
|
|
955
|
+
L,
|
|
956
|
+
f,
|
|
957
|
+
u,
|
|
958
|
+
m,
|
|
959
|
+
k
|
|
887
960
|
]),
|
|
888
|
-
onKeyDown:
|
|
961
|
+
onKeyDown: ee
|
|
889
962
|
};
|
|
890
963
|
}
|
|
891
964
|
//#endregion
|
|
892
965
|
//#region src/utils/array/arrayUtils.ts
|
|
893
|
-
var
|
|
966
|
+
var Pe;
|
|
894
967
|
(function(e) {
|
|
895
968
|
function t(e, t, n = 0) {
|
|
896
969
|
return e.slice(n, n + t);
|
|
@@ -937,36 +1010,36 @@ var ke;
|
|
|
937
1010
|
}));
|
|
938
1011
|
}
|
|
939
1012
|
e.groupBy = s;
|
|
940
|
-
})(
|
|
941
|
-
var
|
|
1013
|
+
})(Pe ||= {});
|
|
1014
|
+
var G = Pe, Fe = "row-number-cell", Ie = "row-selection-cell", K = "grouping-cell", Le = "row-detail-cell";
|
|
942
1015
|
//#endregion
|
|
943
1016
|
//#region src/components/dataGrid/models/aggregationModel.ts
|
|
944
|
-
function
|
|
1017
|
+
function q(e) {
|
|
945
1018
|
return e.filter((e) => typeof e == "number" && !Number.isNaN(e));
|
|
946
1019
|
}
|
|
947
|
-
var
|
|
1020
|
+
var Re = (e) => e.reduce((e, t) => e + t, 0), ze = (e, t) => e.reduce((e, n) => (t ? n < e : n > e) ? n : e), Be = {
|
|
948
1021
|
sum: (e) => {
|
|
949
|
-
let t =
|
|
950
|
-
return t.length ?
|
|
1022
|
+
let t = q(e);
|
|
1023
|
+
return t.length ? Re(t) : null;
|
|
951
1024
|
},
|
|
952
1025
|
avg: (e) => {
|
|
953
|
-
let t =
|
|
954
|
-
return t.length ? Math.round(
|
|
1026
|
+
let t = q(e);
|
|
1027
|
+
return t.length ? Math.round(Re(t) / t.length * 100) / 100 : null;
|
|
955
1028
|
},
|
|
956
1029
|
min: (e) => {
|
|
957
|
-
let t =
|
|
958
|
-
return t.length ?
|
|
1030
|
+
let t = q(e);
|
|
1031
|
+
return t.length ? ze(t, !0) : null;
|
|
959
1032
|
},
|
|
960
1033
|
max: (e) => {
|
|
961
|
-
let t =
|
|
962
|
-
return t.length ?
|
|
1034
|
+
let t = q(e);
|
|
1035
|
+
return t.length ? ze(t, !1) : null;
|
|
963
1036
|
},
|
|
964
1037
|
count: (e, t) => t.length
|
|
965
1038
|
};
|
|
966
|
-
function
|
|
967
|
-
return typeof e == "function" ? e(t, n) :
|
|
1039
|
+
function Ve(e, t, n) {
|
|
1040
|
+
return typeof e == "function" ? e(t, n) : Be[e]?.(t, n) ?? null;
|
|
968
1041
|
}
|
|
969
|
-
var
|
|
1042
|
+
var He = class {
|
|
970
1043
|
grid;
|
|
971
1044
|
constructor(e) {
|
|
972
1045
|
this.grid = e;
|
|
@@ -982,13 +1055,13 @@ var Le = class {
|
|
|
982
1055
|
}
|
|
983
1056
|
get footerLabel() {
|
|
984
1057
|
let { footer: e } = this.grid.props.def;
|
|
985
|
-
return typeof e == "object" ? e.label :
|
|
1058
|
+
return typeof e == "object" ? e.label : this.grid.localeText.footerTotal;
|
|
986
1059
|
}
|
|
987
1060
|
get footerLabelColumn() {
|
|
988
1061
|
return this.grid.columns.value.visibleLeafs.find((e) => (e.isData || e.isGrouping) && !e.aggregate);
|
|
989
1062
|
}
|
|
990
|
-
footerCells =
|
|
991
|
-
},
|
|
1063
|
+
footerCells = H(() => this.grid.columns.value.visibleLeafs.map((e) => new Ue(this.grid, e, this.grid.filteredData, "footer")), () => [this.grid.rows]);
|
|
1064
|
+
}, Ue = class {
|
|
992
1065
|
grid;
|
|
993
1066
|
column;
|
|
994
1067
|
rows;
|
|
@@ -997,13 +1070,13 @@ var Le = class {
|
|
|
997
1070
|
constructor(e, t, n, r, i) {
|
|
998
1071
|
this.grid = e, this.column = t, this.rows = n, this.scope = r, this.given = i;
|
|
999
1072
|
}
|
|
1000
|
-
_values =
|
|
1073
|
+
_values = H(() => this.rows.map((e) => e[this.column.key]));
|
|
1001
1074
|
get values() {
|
|
1002
1075
|
return this._values.value;
|
|
1003
1076
|
}
|
|
1004
|
-
_value =
|
|
1077
|
+
_value = H(() => {
|
|
1005
1078
|
let e = this.column.aggregate;
|
|
1006
|
-
return e ?
|
|
1079
|
+
return e ? Ve(e, this.values, this.rows) : null;
|
|
1007
1080
|
});
|
|
1008
1081
|
get value() {
|
|
1009
1082
|
let e = this.given?.();
|
|
@@ -1018,7 +1091,7 @@ var Le = class {
|
|
|
1018
1091
|
get isLast() {
|
|
1019
1092
|
return !1;
|
|
1020
1093
|
}
|
|
1021
|
-
},
|
|
1094
|
+
}, We = class {
|
|
1022
1095
|
grid;
|
|
1023
1096
|
row;
|
|
1024
1097
|
column;
|
|
@@ -1040,7 +1113,7 @@ var Le = class {
|
|
|
1040
1113
|
get cellKind() {
|
|
1041
1114
|
return this.column.isGrouping ? "grouping" : this.column.isRowSelection ? this.row.selectable ? "selection" : "spacer" : this.row.spans(this.column) ? "hidden" : this.column.aggregate ? "aggregate" : "spacer";
|
|
1042
1115
|
}
|
|
1043
|
-
_aggregate =
|
|
1116
|
+
_aggregate = H(() => this.column.aggregate ? new Ue(this.grid, this.column, this.row.allRows.map((e) => e.data), "group", () => this.row.aggregateValue(this.column)) : null);
|
|
1044
1117
|
get aggregate() {
|
|
1045
1118
|
return this._aggregate.value;
|
|
1046
1119
|
}
|
|
@@ -1059,7 +1132,7 @@ var Le = class {
|
|
|
1059
1132
|
get hasGroupingBorder() {
|
|
1060
1133
|
return this.row.groupingColumn.pin === "START";
|
|
1061
1134
|
}
|
|
1062
|
-
},
|
|
1135
|
+
}, Ge = class {
|
|
1063
1136
|
grid;
|
|
1064
1137
|
groupColumn;
|
|
1065
1138
|
rows;
|
|
@@ -1085,11 +1158,11 @@ var Le = class {
|
|
|
1085
1158
|
return `${this.parentRow?.key ?? ""}${this.groupColumn.key}${this.groupValue}`;
|
|
1086
1159
|
}
|
|
1087
1160
|
parentRow;
|
|
1088
|
-
_cells =
|
|
1161
|
+
_cells = H(() => this.grid.columns.value.visibleLeafs.map((e) => new We(this.grid, this, e)));
|
|
1089
1162
|
get cells() {
|
|
1090
1163
|
return this._cells.value;
|
|
1091
1164
|
}
|
|
1092
|
-
_renderedCells =
|
|
1165
|
+
_renderedCells = H(() => {
|
|
1093
1166
|
let e = [];
|
|
1094
1167
|
return this.cells.forEach((t, n) => {
|
|
1095
1168
|
t.cellKind !== "hidden" && e.push({
|
|
@@ -1120,7 +1193,7 @@ var Le = class {
|
|
|
1120
1193
|
return this.parentRow ? this.parentRow.depth + 1 : 0;
|
|
1121
1194
|
}
|
|
1122
1195
|
get count() {
|
|
1123
|
-
return
|
|
1196
|
+
return G.sumBy(this.rows, (e) => e.count, 0);
|
|
1124
1197
|
}
|
|
1125
1198
|
get flatRows() {
|
|
1126
1199
|
return this.expanded ? [this, ...this.rows.flatMap((e) => e.flatRows)] : [this];
|
|
@@ -1129,7 +1202,7 @@ var Le = class {
|
|
|
1129
1202
|
return this.rows.flatMap((e) => e.allRows);
|
|
1130
1203
|
}
|
|
1131
1204
|
get groupingColumn() {
|
|
1132
|
-
return
|
|
1205
|
+
return G.findOrThrow(this.grid.columns.value.leafs, (e) => e.key === K);
|
|
1133
1206
|
}
|
|
1134
1207
|
get groupingColumnGridColumn() {
|
|
1135
1208
|
return this.grid.groupingSpan.value.length;
|
|
@@ -1147,11 +1220,11 @@ var Le = class {
|
|
|
1147
1220
|
};
|
|
1148
1221
|
//#endregion
|
|
1149
1222
|
//#region src/components/dataGrid/components/dataGridDetailRow.tsx
|
|
1150
|
-
function
|
|
1151
|
-
let { row: t, index: i } = e, { grid: a, parentRow: o } = t, s = a.props.def.rowDetail, c =
|
|
1223
|
+
function Ke(e) {
|
|
1224
|
+
let { row: t, index: i } = e, { grid: a, parentRow: o } = t, s = a.props.def.rowDetail, c = B(), l = (c?.headerRowCount ?? 0) + i, { ref: u, tabIndex: d, onFocus: f } = me(c, l, 0), p = t.isAutoHeight, h = N(null);
|
|
1152
1225
|
return n(() => {
|
|
1153
1226
|
a.takeDetailReveal(o.key) && h.current?.scrollIntoView?.({ block: "nearest" });
|
|
1154
|
-
}), /* @__PURE__ */
|
|
1227
|
+
}), /* @__PURE__ */ L(m, {
|
|
1155
1228
|
ref: h,
|
|
1156
1229
|
component: `${a.componentName}.body.detailRow`,
|
|
1157
1230
|
props: {
|
|
@@ -1160,9 +1233,9 @@ function Ve(e) {
|
|
|
1160
1233
|
},
|
|
1161
1234
|
style: {
|
|
1162
1235
|
gridColumn: "1 / -1",
|
|
1163
|
-
height:
|
|
1236
|
+
height: p ? "auto" : `${t.height}px`
|
|
1164
1237
|
},
|
|
1165
|
-
children: /* @__PURE__ */
|
|
1238
|
+
children: /* @__PURE__ */ L(r, {
|
|
1166
1239
|
ref: u,
|
|
1167
1240
|
component: `${a.componentName}.body.detailRow.content`,
|
|
1168
1241
|
position: "sticky",
|
|
@@ -1174,22 +1247,22 @@ function Ve(e) {
|
|
|
1174
1247
|
"aria-colindex": 1,
|
|
1175
1248
|
"aria-colspan": c?.columnCount,
|
|
1176
1249
|
tabIndex: d,
|
|
1177
|
-
onFocus:
|
|
1250
|
+
onFocus: f
|
|
1178
1251
|
},
|
|
1179
1252
|
style: { width: `var(${a.viewportWidthVarName})` },
|
|
1180
1253
|
children: s.content(o.data)
|
|
1181
1254
|
})
|
|
1182
1255
|
});
|
|
1183
1256
|
}
|
|
1184
|
-
|
|
1185
|
-
var
|
|
1257
|
+
Ke.displayName = "DataGridDetailRow";
|
|
1258
|
+
var qe = D(Ke);
|
|
1186
1259
|
//#endregion
|
|
1187
1260
|
//#region src/components/dataGrid/components/dataGridAggregateValue.tsx
|
|
1188
|
-
function
|
|
1261
|
+
function Je(e) {
|
|
1189
1262
|
let { cell: t } = e, { column: n } = t;
|
|
1190
|
-
if (n.AggregateCell) return /* @__PURE__ */
|
|
1263
|
+
if (n.AggregateCell) return /* @__PURE__ */ L(n.AggregateCell, { cell: t });
|
|
1191
1264
|
let i = t.scope === "footer" ? "footer.cell" : "body.groupRow.aggregate";
|
|
1192
|
-
return /* @__PURE__ */
|
|
1265
|
+
return /* @__PURE__ */ L(r, {
|
|
1193
1266
|
component: `${n.grid.componentName}.${i}`,
|
|
1194
1267
|
px: 3,
|
|
1195
1268
|
textOverflow: "ellipsis",
|
|
@@ -1198,12 +1271,12 @@ function Ue(e) {
|
|
|
1198
1271
|
children: t.value
|
|
1199
1272
|
});
|
|
1200
1273
|
}
|
|
1201
|
-
|
|
1274
|
+
Je.displayName = "DataGridAggregateValue";
|
|
1202
1275
|
//#endregion
|
|
1203
1276
|
//#region src/components/dataGrid/components/dataGridCell.tsx
|
|
1204
|
-
var
|
|
1205
|
-
function
|
|
1206
|
-
let { children: n, cell: r, row: i, columnIndex: a, ariaColIndex: o, ariaColSpan: s, style: c, ...l } = t, { column: u } = r, d =
|
|
1277
|
+
var Ye = "button,a[href],input,select,textarea";
|
|
1278
|
+
function J(t) {
|
|
1279
|
+
let { children: n, cell: r, row: i, columnIndex: a, ariaColIndex: o, ariaColSpan: s, style: c, ...l } = t, { column: u } = r, d = B(), { ref: f, tabIndex: p, onFocus: h } = me(d, i, a), { range: g } = u.grid, _ = r instanceof U ? i - (d?.headerRowCount ?? 0) : -1, v = _ >= 0 && g.isCurrent(_, a), y = _ >= 0 && g.isSelected(_, a);
|
|
1207
1280
|
u.hasAlign && (l.jc = u.align);
|
|
1208
1281
|
let b = r.isExpanded ? {
|
|
1209
1282
|
...u.cellVariant.value,
|
|
@@ -1216,8 +1289,8 @@ function Y(t) {
|
|
|
1216
1289
|
isInRange: y && !v,
|
|
1217
1290
|
isCurrentCell: v
|
|
1218
1291
|
});
|
|
1219
|
-
let x = r instanceof
|
|
1220
|
-
r instanceof
|
|
1292
|
+
let x = r instanceof U && !r.editing && r.rejected;
|
|
1293
|
+
r instanceof U && r.editing ? b = {
|
|
1221
1294
|
...b,
|
|
1222
1295
|
isEditing: !0,
|
|
1223
1296
|
isInvalid: !!r.error
|
|
@@ -1225,15 +1298,15 @@ function Y(t) {
|
|
|
1225
1298
|
...b,
|
|
1226
1299
|
isInvalid: !0
|
|
1227
1300
|
});
|
|
1228
|
-
let S = r instanceof
|
|
1229
|
-
t.target.closest(
|
|
1301
|
+
let S = r instanceof U ? (t) => {
|
|
1302
|
+
t.target.closest(Ye) || (e(t.currentTarget), r.beginEdit());
|
|
1230
1303
|
} : void 0, C = g.enabled && _ >= 0, w = C ? (e) => {
|
|
1231
|
-
e.button === 0 && e.pointerType !== "touch" && (e.target.closest(
|
|
1304
|
+
e.button === 0 && e.pointerType !== "touch" && (e.target.closest(Ye) || g.press(_, a, e.shiftKey));
|
|
1232
1305
|
} : void 0, T = C && g.isDragging ? (e) => {
|
|
1233
1306
|
g.dragTo(_, a), e.currentTarget.focus();
|
|
1234
1307
|
} : void 0;
|
|
1235
|
-
return /* @__PURE__ */
|
|
1236
|
-
ref:
|
|
1308
|
+
return /* @__PURE__ */ L(m, {
|
|
1309
|
+
ref: f,
|
|
1237
1310
|
component: `${u.grid.componentName}.body.cell`,
|
|
1238
1311
|
props: {
|
|
1239
1312
|
role: "gridcell",
|
|
@@ -1241,7 +1314,7 @@ function Y(t) {
|
|
|
1241
1314
|
"aria-colspan": s,
|
|
1242
1315
|
"aria-selected": y || void 0,
|
|
1243
1316
|
"aria-invalid": x || void 0,
|
|
1244
|
-
tabIndex:
|
|
1317
|
+
tabIndex: p,
|
|
1245
1318
|
onFocus: h,
|
|
1246
1319
|
onDoubleClick: S,
|
|
1247
1320
|
onPointerDown: w,
|
|
@@ -1256,28 +1329,28 @@ function Y(t) {
|
|
|
1256
1329
|
children: n
|
|
1257
1330
|
});
|
|
1258
1331
|
}
|
|
1259
|
-
|
|
1332
|
+
J.displayName = "DataGridCell";
|
|
1260
1333
|
//#endregion
|
|
1261
1334
|
//#region src/components/dataGrid/components/dataGridFooter.tsx
|
|
1262
|
-
function
|
|
1263
|
-
let { grid: t } = e, { aggregation: n } = t, i =
|
|
1335
|
+
function Xe(e) {
|
|
1336
|
+
let { grid: t } = e, { aggregation: n } = t, i = B();
|
|
1264
1337
|
if (!n.hasFooter) return null;
|
|
1265
1338
|
let a = (i?.rowCount ?? 1) - 1, { footerLabelColumn: o, footerLabel: s } = n;
|
|
1266
|
-
return /* @__PURE__ */
|
|
1339
|
+
return /* @__PURE__ */ L(b, {
|
|
1267
1340
|
component: `${t.componentName}.footer`,
|
|
1268
1341
|
props: { role: "rowgroup" },
|
|
1269
1342
|
style: { gridTemplateColumns: t.gridTemplateColumns.value },
|
|
1270
|
-
children: /* @__PURE__ */
|
|
1343
|
+
children: /* @__PURE__ */ L(r, {
|
|
1271
1344
|
display: "contents",
|
|
1272
1345
|
props: {
|
|
1273
1346
|
role: "row",
|
|
1274
1347
|
"aria-rowindex": a + 1
|
|
1275
1348
|
},
|
|
1276
|
-
children: n.footerCells.value.map((e, n) => /* @__PURE__ */
|
|
1349
|
+
children: n.footerCells.value.map((e, n) => /* @__PURE__ */ L(J, {
|
|
1277
1350
|
cell: e,
|
|
1278
1351
|
row: a,
|
|
1279
1352
|
columnIndex: n,
|
|
1280
|
-
children: e.column.aggregate ? /* @__PURE__ */
|
|
1353
|
+
children: e.column.aggregate ? /* @__PURE__ */ L(Je, { cell: e }) : e.column === o ? /* @__PURE__ */ L(r, {
|
|
1281
1354
|
component: `${t.componentName}.footer.label`,
|
|
1282
1355
|
px: 3,
|
|
1283
1356
|
textWrap: "nowrap",
|
|
@@ -1287,16 +1360,16 @@ function Ge(e) {
|
|
|
1287
1360
|
})
|
|
1288
1361
|
});
|
|
1289
1362
|
}
|
|
1290
|
-
|
|
1363
|
+
Xe.displayName = "DataGridFooter";
|
|
1291
1364
|
//#endregion
|
|
1292
1365
|
//#region src/icons/expandIcon.tsx
|
|
1293
|
-
function
|
|
1294
|
-
return /* @__PURE__ */
|
|
1366
|
+
function Y(e) {
|
|
1367
|
+
return /* @__PURE__ */ L(d, {
|
|
1295
1368
|
viewBox: "4 2 16 18",
|
|
1296
1369
|
width: "1rem",
|
|
1297
1370
|
fill: "currentColor",
|
|
1298
1371
|
...e,
|
|
1299
|
-
children: /* @__PURE__ */
|
|
1372
|
+
children: /* @__PURE__ */ L(u, {
|
|
1300
1373
|
fillRule: "evenodd",
|
|
1301
1374
|
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",
|
|
1302
1375
|
props: { clipRule: "evenodd" }
|
|
@@ -1305,32 +1378,32 @@ function X(e) {
|
|
|
1305
1378
|
}
|
|
1306
1379
|
//#endregion
|
|
1307
1380
|
//#region src/components/dataGrid/components/dataGridCellPlaceholder.tsx
|
|
1308
|
-
var
|
|
1381
|
+
var Ze = [
|
|
1309
1382
|
"3/5",
|
|
1310
1383
|
"2/5",
|
|
1311
1384
|
"4/5",
|
|
1312
1385
|
"1/2",
|
|
1313
1386
|
"7/12"
|
|
1314
1387
|
];
|
|
1315
|
-
function
|
|
1316
|
-
let { cell: t, columnIndex: n } = e, i =
|
|
1317
|
-
return /* @__PURE__ */
|
|
1388
|
+
function Qe(e) {
|
|
1389
|
+
let { cell: t, columnIndex: n } = e, i = Ze[(t.row.rowIndex + n) % Ze.length];
|
|
1390
|
+
return /* @__PURE__ */ L(m, {
|
|
1318
1391
|
component: `${t.grid.componentName}.body.cell.placeholder`,
|
|
1319
1392
|
ai: "center",
|
|
1320
1393
|
px: 3,
|
|
1321
1394
|
props: { "aria-hidden": !0 },
|
|
1322
|
-
children: /* @__PURE__ */
|
|
1395
|
+
children: /* @__PURE__ */ L(r, {
|
|
1323
1396
|
component: `${t.grid.componentName}.body.cell.placeholder.bar`,
|
|
1324
1397
|
width: i
|
|
1325
1398
|
})
|
|
1326
1399
|
});
|
|
1327
1400
|
}
|
|
1328
|
-
|
|
1401
|
+
Qe.displayName = "DataGridCellPlaceholder";
|
|
1329
1402
|
//#endregion
|
|
1330
1403
|
//#region src/components/dataGrid/components/dataGridGroupRow.tsx
|
|
1331
|
-
function
|
|
1332
|
-
let { row: t, index: n } = e, { selected: i, indeterminate: a, expanded: o, placeholder: s } = t, c = (
|
|
1333
|
-
return /* @__PURE__ */
|
|
1404
|
+
function $e(e) {
|
|
1405
|
+
let { row: t, index: n } = e, { selected: i, indeterminate: a, expanded: o, placeholder: s } = t, c = (B()?.headerRowCount ?? 0) + n, l = O(() => t.toggleSelectAll(), [t]);
|
|
1406
|
+
return /* @__PURE__ */ L(m, {
|
|
1334
1407
|
component: `${t.grid.componentName}.body.groupRow`,
|
|
1335
1408
|
className: "grid-row",
|
|
1336
1409
|
selected: t.grid.props.def.rowSelection ? i : void 0,
|
|
@@ -1343,7 +1416,7 @@ function Je(e) {
|
|
|
1343
1416
|
},
|
|
1344
1417
|
children: t.renderedCells.map(({ cell: e, columnIndex: n }, u) => {
|
|
1345
1418
|
switch (e.cellKind) {
|
|
1346
|
-
case "grouping": return /* @__PURE__ */
|
|
1419
|
+
case "grouping": return /* @__PURE__ */ L(J, {
|
|
1347
1420
|
cell: e,
|
|
1348
1421
|
row: c,
|
|
1349
1422
|
columnIndex: u,
|
|
@@ -1357,13 +1430,13 @@ function Je(e) {
|
|
|
1357
1430
|
gridColumn: e.gridColumnSpan,
|
|
1358
1431
|
ps: e.depthPadding,
|
|
1359
1432
|
overflow: "auto",
|
|
1360
|
-
children: s ? /* @__PURE__ */
|
|
1433
|
+
children: s ? /* @__PURE__ */ L(Qe, {
|
|
1361
1434
|
cell: e,
|
|
1362
1435
|
columnIndex: u
|
|
1363
|
-
}) : /* @__PURE__ */
|
|
1436
|
+
}) : /* @__PURE__ */ L(r, {
|
|
1364
1437
|
textWrap: "nowrap",
|
|
1365
1438
|
px: 3,
|
|
1366
|
-
children: /* @__PURE__ */
|
|
1439
|
+
children: /* @__PURE__ */ R(p, {
|
|
1367
1440
|
component: `${t.grid.componentName}.body.groupRow.expandButton`,
|
|
1368
1441
|
onClick: () => t.toggleRow(),
|
|
1369
1442
|
cursor: "pointer",
|
|
@@ -1374,7 +1447,7 @@ function Je(e) {
|
|
|
1374
1447
|
tabIndex: -1,
|
|
1375
1448
|
"aria-expanded": o
|
|
1376
1449
|
},
|
|
1377
|
-
children: [/* @__PURE__ */
|
|
1450
|
+
children: [/* @__PURE__ */ L(Y, {
|
|
1378
1451
|
fill: "currentColor",
|
|
1379
1452
|
width: "14px",
|
|
1380
1453
|
height: "14px",
|
|
@@ -1383,12 +1456,12 @@ function Je(e) {
|
|
|
1383
1456
|
})
|
|
1384
1457
|
})
|
|
1385
1458
|
}, e.column.key);
|
|
1386
|
-
case "selection": return /* @__PURE__ */
|
|
1459
|
+
case "selection": return /* @__PURE__ */ L(J, {
|
|
1387
1460
|
cell: e,
|
|
1388
1461
|
row: c,
|
|
1389
1462
|
columnIndex: u,
|
|
1390
1463
|
ariaColIndex: n + 1,
|
|
1391
|
-
children: /* @__PURE__ */
|
|
1464
|
+
children: /* @__PURE__ */ L(h, {
|
|
1392
1465
|
variant: "datagrid",
|
|
1393
1466
|
m: 1,
|
|
1394
1467
|
checked: i,
|
|
@@ -1396,18 +1469,18 @@ function Je(e) {
|
|
|
1396
1469
|
onChange: l,
|
|
1397
1470
|
props: {
|
|
1398
1471
|
tabIndex: -1,
|
|
1399
|
-
"aria-label":
|
|
1472
|
+
"aria-label": t.grid.localeText.selectGroupRows(String(t.groupValue))
|
|
1400
1473
|
}
|
|
1401
1474
|
})
|
|
1402
1475
|
}, e.column.key);
|
|
1403
|
-
case "aggregate": return /* @__PURE__ */
|
|
1476
|
+
case "aggregate": return /* @__PURE__ */ L(J, {
|
|
1404
1477
|
cell: e,
|
|
1405
1478
|
row: c,
|
|
1406
1479
|
columnIndex: u,
|
|
1407
1480
|
ariaColIndex: n + 1,
|
|
1408
|
-
children: e.aggregate && /* @__PURE__ */
|
|
1481
|
+
children: e.aggregate && /* @__PURE__ */ L(Je, { cell: e.aggregate })
|
|
1409
1482
|
}, e.column.key);
|
|
1410
|
-
case "spacer": return /* @__PURE__ */
|
|
1483
|
+
case "spacer": return /* @__PURE__ */ L(J, {
|
|
1411
1484
|
cell: e,
|
|
1412
1485
|
row: c,
|
|
1413
1486
|
columnIndex: u,
|
|
@@ -1420,21 +1493,21 @@ function Je(e) {
|
|
|
1420
1493
|
})
|
|
1421
1494
|
});
|
|
1422
1495
|
}
|
|
1423
|
-
|
|
1424
|
-
var
|
|
1425
|
-
function
|
|
1496
|
+
$e.displayName = "DataGridGroupRow";
|
|
1497
|
+
var et = D($e), tt = "input,select,textarea,button";
|
|
1498
|
+
function nt(e) {
|
|
1426
1499
|
let { options: t } = e.editor;
|
|
1427
1500
|
return typeof t == "function" ? t(e.row.data) : t ?? [];
|
|
1428
1501
|
}
|
|
1429
|
-
function
|
|
1430
|
-
let { cell: t, row: r, columnIndex: i } = e, { grid: a } = t, o =
|
|
1502
|
+
function rt(e) {
|
|
1503
|
+
let { cell: t, row: r, columnIndex: i } = e, { grid: a } = t, o = B(), s = N(null), c = l("datagrid-cell-error"), { error: u, pending: d } = t;
|
|
1431
1504
|
n(() => {
|
|
1432
|
-
let e =
|
|
1505
|
+
let e = s.current?.querySelector(tt);
|
|
1433
1506
|
e?.focus(), e instanceof HTMLInputElement && e.type !== "checkbox" && e.select();
|
|
1434
1507
|
}, []);
|
|
1435
|
-
let
|
|
1436
|
-
|
|
1437
|
-
}, []),
|
|
1508
|
+
let f = O(() => {
|
|
1509
|
+
s.current?.closest("[role=\"gridcell\"]")?.focus();
|
|
1510
|
+
}, []), p = O((e) => {
|
|
1438
1511
|
if (!o) return;
|
|
1439
1512
|
let t = a.edits.nextEditable(r - o.headerRowCount, i, e.shiftKey);
|
|
1440
1513
|
t && (e.preventDefault(), o.setActiveCell(t.row + o.headerRowCount, t.column, { reason: "programmatic" }), a.edits.beginAt(t.row, t.column));
|
|
@@ -1443,14 +1516,14 @@ function Qe(e) {
|
|
|
1443
1516
|
a,
|
|
1444
1517
|
o,
|
|
1445
1518
|
r
|
|
1446
|
-
]),
|
|
1519
|
+
]), h = O((e) => {
|
|
1447
1520
|
if (e.key === "Escape") {
|
|
1448
|
-
if (
|
|
1449
|
-
e.preventDefault(), e.stopPropagation(), t.cancelEdit(),
|
|
1521
|
+
if (s.current?.querySelector("[aria-expanded=\"true\"]")) return;
|
|
1522
|
+
e.preventDefault(), e.stopPropagation(), t.cancelEdit(), f();
|
|
1450
1523
|
return;
|
|
1451
1524
|
}
|
|
1452
1525
|
if (e.key === "Enter") {
|
|
1453
|
-
e.preventDefault(), e.stopPropagation(), t.commitEdit(), t.editing ||
|
|
1526
|
+
e.preventDefault(), e.stopPropagation(), t.commitEdit(), t.editing || f();
|
|
1454
1527
|
return;
|
|
1455
1528
|
}
|
|
1456
1529
|
if (e.key === "Tab") {
|
|
@@ -1458,59 +1531,59 @@ function Qe(e) {
|
|
|
1458
1531
|
e.preventDefault();
|
|
1459
1532
|
return;
|
|
1460
1533
|
}
|
|
1461
|
-
|
|
1534
|
+
p(e);
|
|
1462
1535
|
}
|
|
1463
1536
|
}, [
|
|
1464
1537
|
t,
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
]), _ =
|
|
1538
|
+
f,
|
|
1539
|
+
p
|
|
1540
|
+
]), _ = O(() => {
|
|
1468
1541
|
!t.editing || t.pending || t.commitEdit();
|
|
1469
1542
|
}, [t]);
|
|
1470
|
-
return /* @__PURE__ */
|
|
1471
|
-
ref:
|
|
1543
|
+
return /* @__PURE__ */ R(m, {
|
|
1544
|
+
ref: s,
|
|
1472
1545
|
component: `${a.componentName}.body.cell.editor`,
|
|
1473
1546
|
variant: { isPending: d },
|
|
1474
|
-
props: { onKeyDown:
|
|
1547
|
+
props: { onKeyDown: h },
|
|
1475
1548
|
width: "fit",
|
|
1476
1549
|
height: "fit",
|
|
1477
1550
|
ai: "center",
|
|
1478
|
-
children: [/* @__PURE__ */
|
|
1551
|
+
children: [/* @__PURE__ */ L(it, {
|
|
1479
1552
|
cell: t,
|
|
1480
|
-
errorId: u ?
|
|
1553
|
+
errorId: u ? c : void 0,
|
|
1481
1554
|
onBlur: _,
|
|
1482
|
-
onCommitted:
|
|
1483
|
-
}), u && /* @__PURE__ */
|
|
1484
|
-
anchor:
|
|
1555
|
+
onCommitted: f
|
|
1556
|
+
}), u && /* @__PURE__ */ L(g, {
|
|
1557
|
+
anchor: s,
|
|
1485
1558
|
side: "bottom",
|
|
1486
1559
|
align: "start",
|
|
1487
1560
|
offset: 1,
|
|
1488
1561
|
matchWidth: !1,
|
|
1489
1562
|
component: `${a.componentName}.body.cell.error`,
|
|
1490
|
-
id:
|
|
1563
|
+
id: c,
|
|
1491
1564
|
props: { role: "alert" },
|
|
1492
1565
|
children: u
|
|
1493
1566
|
})]
|
|
1494
1567
|
});
|
|
1495
1568
|
}
|
|
1496
|
-
function
|
|
1497
|
-
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 = {
|
|
1498
|
-
"aria-label":
|
|
1569
|
+
function it(e) {
|
|
1570
|
+
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, f = {
|
|
1571
|
+
"aria-label": t.grid.localeText.editCell(String(d)),
|
|
1499
1572
|
"aria-invalid": n ? !0 : void 0,
|
|
1500
1573
|
"aria-describedby": n
|
|
1501
1574
|
};
|
|
1502
|
-
if (a) return /* @__PURE__ */
|
|
1503
|
-
if (o === "checkbox") return /* @__PURE__ */
|
|
1575
|
+
if (a) return /* @__PURE__ */ L(a, { cell: t });
|
|
1576
|
+
if (o === "checkbox") return /* @__PURE__ */ L(h, {
|
|
1504
1577
|
checked: !!t.draft,
|
|
1505
1578
|
onChange: (e) => {
|
|
1506
1579
|
t.setDraft(e.target.checked), t.commitEdit(), i();
|
|
1507
1580
|
},
|
|
1508
1581
|
props: {
|
|
1509
|
-
...
|
|
1582
|
+
...f,
|
|
1510
1583
|
onBlur: r
|
|
1511
1584
|
}
|
|
1512
1585
|
});
|
|
1513
|
-
if (o === "select") return /* @__PURE__ */
|
|
1586
|
+
if (o === "select") return /* @__PURE__ */ L(x, {
|
|
1514
1587
|
value: t.draft,
|
|
1515
1588
|
defaultOpen: !0,
|
|
1516
1589
|
width: "fit",
|
|
@@ -1521,15 +1594,15 @@ function $e(e) {
|
|
|
1521
1594
|
onValueChange: (e) => {
|
|
1522
1595
|
t.setDraft(e ?? null), t.commitEdit(), i();
|
|
1523
1596
|
},
|
|
1524
|
-
props:
|
|
1525
|
-
children:
|
|
1597
|
+
props: f,
|
|
1598
|
+
children: nt(t).map((e) => /* @__PURE__ */ L(x.Item, {
|
|
1526
1599
|
value: e.value,
|
|
1527
1600
|
children: e.label ?? String(e.value)
|
|
1528
1601
|
}, String(e.value)))
|
|
1529
1602
|
});
|
|
1530
|
-
let
|
|
1531
|
-
return /* @__PURE__ */
|
|
1532
|
-
type:
|
|
1603
|
+
let p = o === "number";
|
|
1604
|
+
return /* @__PURE__ */ L(y, {
|
|
1605
|
+
type: p ? "number" : "text",
|
|
1533
1606
|
value: t.draft === null || t.draft === void 0 ? "" : String(t.draft),
|
|
1534
1607
|
placeholder: s,
|
|
1535
1608
|
step: c,
|
|
@@ -1540,29 +1613,29 @@ function $e(e) {
|
|
|
1540
1613
|
focus: { outline: 0 },
|
|
1541
1614
|
onChange: (e) => {
|
|
1542
1615
|
let n = e.target.value;
|
|
1543
|
-
t.setDraft(
|
|
1616
|
+
t.setDraft(p ? n === "" ? null : Number(n) : n);
|
|
1544
1617
|
},
|
|
1545
1618
|
props: {
|
|
1546
|
-
...
|
|
1619
|
+
...f,
|
|
1547
1620
|
min: l,
|
|
1548
1621
|
max: u,
|
|
1549
1622
|
onBlur: r
|
|
1550
1623
|
}
|
|
1551
1624
|
});
|
|
1552
1625
|
}
|
|
1553
|
-
|
|
1626
|
+
rt.displayName = "DataGridCellEditor";
|
|
1554
1627
|
//#endregion
|
|
1555
1628
|
//#region src/components/dataGrid/components/dataGridCellText.tsx
|
|
1556
|
-
function
|
|
1629
|
+
function at(e) {
|
|
1557
1630
|
let { cell: t } = e;
|
|
1558
|
-
return /* @__PURE__ */
|
|
1631
|
+
return /* @__PURE__ */ L(m, {
|
|
1559
1632
|
component: `${t.grid.componentName}.body.cell.text`,
|
|
1560
1633
|
height: "fit",
|
|
1561
1634
|
width: "fit",
|
|
1562
1635
|
overflow: "auto",
|
|
1563
1636
|
ai: "center",
|
|
1564
1637
|
jc: t.column.align,
|
|
1565
|
-
children: /* @__PURE__ */
|
|
1638
|
+
children: /* @__PURE__ */ L(r, {
|
|
1566
1639
|
px: 3,
|
|
1567
1640
|
textOverflow: "ellipsis",
|
|
1568
1641
|
overflow: "hidden",
|
|
@@ -1571,18 +1644,18 @@ function et(e) {
|
|
|
1571
1644
|
})
|
|
1572
1645
|
});
|
|
1573
1646
|
}
|
|
1574
|
-
|
|
1647
|
+
at.displayName = "DataGridCellText";
|
|
1575
1648
|
//#endregion
|
|
1576
1649
|
//#region src/components/dataGrid/components/dataGridCellTree.tsx
|
|
1577
|
-
function
|
|
1578
|
-
let { cell: t, row: n, children: i } = e, { hasChildren: a, treeExpanded: o, level: s } = n, c = n.grid.componentName, l =
|
|
1650
|
+
function ot(e) {
|
|
1651
|
+
let { cell: t, row: n, children: i } = e, { hasChildren: a, treeExpanded: o, level: s } = n, c = n.grid.componentName, l = O((e) => {
|
|
1579
1652
|
e.stopPropagation(), n.toggleTree();
|
|
1580
|
-
}, [n]), u = t.value == null || t.value === "" ?
|
|
1581
|
-
return /* @__PURE__ */
|
|
1653
|
+
}, [n]), u = t.value == null || t.value === "" ? t.grid.localeText.unnamedRow(n.rowIndex + 1) : String(t.value);
|
|
1654
|
+
return /* @__PURE__ */ R(m, {
|
|
1582
1655
|
component: `${c}.body.cell.tree`,
|
|
1583
1656
|
ai: "center",
|
|
1584
1657
|
ps: s * n.grid.tree.indent,
|
|
1585
|
-
children: [a ? /* @__PURE__ */
|
|
1658
|
+
children: [a ? /* @__PURE__ */ L(p, {
|
|
1586
1659
|
component: `${c}.body.cell.tree.toggle`,
|
|
1587
1660
|
variant: { isExpanded: o },
|
|
1588
1661
|
type: "button",
|
|
@@ -1593,15 +1666,15 @@ function tt(e) {
|
|
|
1593
1666
|
jc: "center",
|
|
1594
1667
|
props: {
|
|
1595
1668
|
tabIndex: -1,
|
|
1596
|
-
"aria-label":
|
|
1669
|
+
"aria-label": (o ? t.grid.localeText.collapseTreeRow : t.grid.localeText.expandTreeRow)(u)
|
|
1597
1670
|
},
|
|
1598
|
-
children: /* @__PURE__ */
|
|
1671
|
+
children: /* @__PURE__ */ L(Y, {
|
|
1599
1672
|
fill: "currentColor",
|
|
1600
1673
|
width: "14px",
|
|
1601
1674
|
height: "14px",
|
|
1602
1675
|
rotate: o ? 0 : -90
|
|
1603
1676
|
})
|
|
1604
|
-
}) : /* @__PURE__ */
|
|
1677
|
+
}) : /* @__PURE__ */ L(r, { component: `${c}.body.cell.tree.spacer` }), /* @__PURE__ */ L(r, {
|
|
1605
1678
|
textOverflow: "ellipsis",
|
|
1606
1679
|
overflow: "hidden",
|
|
1607
1680
|
textWrap: "nowrap",
|
|
@@ -1610,29 +1683,29 @@ function tt(e) {
|
|
|
1610
1683
|
})]
|
|
1611
1684
|
});
|
|
1612
1685
|
}
|
|
1613
|
-
|
|
1686
|
+
ot.displayName = "DataGridCellTree";
|
|
1614
1687
|
//#endregion
|
|
1615
1688
|
//#region src/components/dataGrid/components/dataGridRow.tsx
|
|
1616
|
-
function
|
|
1617
|
-
let { row: t, index: n } = e, { selected: r, expandOnRowClick: i } = t, a = (
|
|
1689
|
+
function st(e) {
|
|
1690
|
+
let { row: t, index: n } = e, { selected: r, expandOnRowClick: i } = t, a = (B()?.headerRowCount ?? 0) + n, o = Oe(t) ? t : void 0, s = o && t.grid.tree.columnKey, c = O(() => {
|
|
1618
1691
|
t.toggleDetail();
|
|
1619
1692
|
}, [t]), l = (e, n) => {
|
|
1620
|
-
if (e.editing) return /* @__PURE__ */
|
|
1693
|
+
if (e.editing) return /* @__PURE__ */ L(rt, {
|
|
1621
1694
|
cell: e,
|
|
1622
1695
|
row: a,
|
|
1623
1696
|
columnIndex: n
|
|
1624
1697
|
});
|
|
1625
|
-
let r = t.placeholder && !e.column.isRowNumber ? /* @__PURE__ */
|
|
1698
|
+
let r = t.placeholder && !e.column.isRowNumber ? /* @__PURE__ */ L(Qe, {
|
|
1626
1699
|
cell: e,
|
|
1627
1700
|
columnIndex: n
|
|
1628
|
-
}) : e.column.Cell ? /* @__PURE__ */
|
|
1629
|
-
return !o || e.column.key !== s ? r : /* @__PURE__ */
|
|
1701
|
+
}) : e.column.Cell ? /* @__PURE__ */ L(e.column.Cell, { cell: e }) : /* @__PURE__ */ L(at, { cell: e });
|
|
1702
|
+
return !o || e.column.key !== s ? r : /* @__PURE__ */ L(ot, {
|
|
1630
1703
|
cell: e,
|
|
1631
1704
|
row: o,
|
|
1632
1705
|
children: r
|
|
1633
1706
|
});
|
|
1634
1707
|
};
|
|
1635
|
-
return /* @__PURE__ */
|
|
1708
|
+
return /* @__PURE__ */ L(m, {
|
|
1636
1709
|
component: `${t.grid.componentName}.body.row`,
|
|
1637
1710
|
className: "grid-row",
|
|
1638
1711
|
selected: t.grid.props.def.rowSelection ? r : void 0,
|
|
@@ -1648,7 +1721,7 @@ function nt(e) {
|
|
|
1648
1721
|
onClick: i ? c : void 0
|
|
1649
1722
|
},
|
|
1650
1723
|
cursor: i ? "pointer" : void 0,
|
|
1651
|
-
children: t.cells.map((e, t) => /* @__PURE__ */
|
|
1724
|
+
children: t.cells.map((e, t) => /* @__PURE__ */ L(J, {
|
|
1652
1725
|
cell: e,
|
|
1653
1726
|
row: a,
|
|
1654
1727
|
columnIndex: t,
|
|
@@ -1656,36 +1729,37 @@ function nt(e) {
|
|
|
1656
1729
|
}, e.column.key))
|
|
1657
1730
|
});
|
|
1658
1731
|
}
|
|
1659
|
-
|
|
1660
|
-
var
|
|
1732
|
+
st.displayName = "DataGridRow";
|
|
1733
|
+
var ct = D(st);
|
|
1661
1734
|
//#endregion
|
|
1662
1735
|
//#region src/components/dataGrid/components/dataGridBody.tsx
|
|
1663
|
-
function
|
|
1664
|
-
return e instanceof
|
|
1736
|
+
function lt(e, t, n) {
|
|
1737
|
+
return e instanceof De ? /* @__PURE__ */ L(qe, {
|
|
1665
1738
|
row: e,
|
|
1666
1739
|
index: t,
|
|
1667
1740
|
version: n
|
|
1668
|
-
}, e.key) : e instanceof
|
|
1741
|
+
}, e.key) : e instanceof Ge ? /* @__PURE__ */ L(et, {
|
|
1669
1742
|
row: e,
|
|
1670
1743
|
index: t,
|
|
1671
1744
|
version: n
|
|
1672
|
-
}, e.key) : /* @__PURE__ */
|
|
1745
|
+
}, e.key) : /* @__PURE__ */ L(ct, {
|
|
1673
1746
|
row: e,
|
|
1674
1747
|
index: t,
|
|
1675
1748
|
version: n
|
|
1676
1749
|
}, e.key);
|
|
1677
1750
|
}
|
|
1678
|
-
function
|
|
1679
|
-
let { grid: t, scroll: n } = e, { viewport: i } = t, { startIndex: a, take: o, translateY: s, totalHeight: c, viewHeight: l } = i.window(n.top, n.direction), u = i.showAll, d = i.isEmpty,
|
|
1680
|
-
|
|
1751
|
+
function ut(e) {
|
|
1752
|
+
let { grid: t, scroll: n } = e, { viewport: i } = t, { startIndex: a, take: o, translateY: s, totalHeight: c, viewHeight: l } = i.window(n.top, n.direction), u = i.showAll, d = i.isEmpty, f = t.flatRows.value, p = t.getSnapshot(), h = M(() => d ? null : G.take(f, o, a).map((e, n) => lt(e, a + n, t.rowVersion(e, a + n))), [
|
|
1753
|
+
f,
|
|
1754
|
+
t,
|
|
1681
1755
|
d,
|
|
1682
1756
|
o,
|
|
1683
1757
|
a,
|
|
1684
|
-
|
|
1758
|
+
p
|
|
1685
1759
|
]);
|
|
1686
1760
|
if (d) {
|
|
1687
|
-
let { noDataComponent: e } = t.props.def, n = t.props.loading ?
|
|
1688
|
-
return /* @__PURE__ */
|
|
1761
|
+
let { noDataComponent: e } = t.props.def, n = t.props.loading ? t.localeText.loadingRows : t.localeText.noRows;
|
|
1762
|
+
return /* @__PURE__ */ L(m, {
|
|
1689
1763
|
component: `${t.componentName}.body.empty`,
|
|
1690
1764
|
jc: "center",
|
|
1691
1765
|
ai: "center",
|
|
@@ -1694,14 +1768,14 @@ function at(e) {
|
|
|
1694
1768
|
insetStart: 0,
|
|
1695
1769
|
props: { role: "row" },
|
|
1696
1770
|
style: { height: i.emptyHeight },
|
|
1697
|
-
children: /* @__PURE__ */
|
|
1771
|
+
children: /* @__PURE__ */ L(r, {
|
|
1698
1772
|
display: "contents",
|
|
1699
1773
|
props: { role: "gridcell" },
|
|
1700
1774
|
children: e ?? n
|
|
1701
1775
|
})
|
|
1702
1776
|
});
|
|
1703
1777
|
}
|
|
1704
|
-
return u ? /* @__PURE__ */
|
|
1778
|
+
return u ? /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(b, {
|
|
1705
1779
|
component: `${t.componentName}.body`,
|
|
1706
1780
|
width: "max-content",
|
|
1707
1781
|
minWidth: "fit",
|
|
@@ -1710,13 +1784,13 @@ function at(e) {
|
|
|
1710
1784
|
props: { role: "rowgroup" },
|
|
1711
1785
|
style: { gridTemplateColumns: t.gridTemplateColumns.value },
|
|
1712
1786
|
children: h
|
|
1713
|
-
}), /* @__PURE__ */
|
|
1787
|
+
}), /* @__PURE__ */ L(Xe, { grid: t })] }) : /* @__PURE__ */ R(r, {
|
|
1714
1788
|
props: { role: "presentation" },
|
|
1715
1789
|
style: { height: l },
|
|
1716
|
-
children: [/* @__PURE__ */
|
|
1790
|
+
children: [/* @__PURE__ */ L(r, {
|
|
1717
1791
|
props: { role: "presentation" },
|
|
1718
1792
|
style: { height: `${c}px` },
|
|
1719
|
-
children: /* @__PURE__ */
|
|
1793
|
+
children: /* @__PURE__ */ L(b, {
|
|
1720
1794
|
component: `${t.componentName}.body`,
|
|
1721
1795
|
width: "max-content",
|
|
1722
1796
|
minWidth: "fit",
|
|
@@ -1730,15 +1804,15 @@ function at(e) {
|
|
|
1730
1804
|
},
|
|
1731
1805
|
children: h
|
|
1732
1806
|
})
|
|
1733
|
-
}), /* @__PURE__ */
|
|
1807
|
+
}), /* @__PURE__ */ L(Xe, { grid: t })]
|
|
1734
1808
|
});
|
|
1735
1809
|
}
|
|
1736
|
-
|
|
1810
|
+
ut.displayName = "DataGridBody";
|
|
1737
1811
|
//#endregion
|
|
1738
1812
|
//#region src/components/dataGrid/components/dataGridEmptyColumns.tsx
|
|
1739
|
-
function
|
|
1813
|
+
function dt(e) {
|
|
1740
1814
|
let { grid: t } = e;
|
|
1741
|
-
return /* @__PURE__ */
|
|
1815
|
+
return /* @__PURE__ */ L(m, {
|
|
1742
1816
|
component: `${t.componentName}.emptyColumns`,
|
|
1743
1817
|
d: "column",
|
|
1744
1818
|
ai: "center",
|
|
@@ -1749,11 +1823,11 @@ function ot(e) {
|
|
|
1749
1823
|
bgColor: "gray-50",
|
|
1750
1824
|
borderRadius: 4,
|
|
1751
1825
|
theme: { dark: { bgColor: "gray-900" } },
|
|
1752
|
-
children: /* @__PURE__ */
|
|
1826
|
+
children: /* @__PURE__ */ R(m, {
|
|
1753
1827
|
d: "column",
|
|
1754
1828
|
ai: "center",
|
|
1755
1829
|
gap: 3,
|
|
1756
|
-
children: [/* @__PURE__ */
|
|
1830
|
+
children: [/* @__PURE__ */ L(r, {
|
|
1757
1831
|
width: 16,
|
|
1758
1832
|
height: 16,
|
|
1759
1833
|
borderRadius: 999,
|
|
@@ -1762,44 +1836,169 @@ function ot(e) {
|
|
|
1762
1836
|
display: "flex",
|
|
1763
1837
|
ai: "center",
|
|
1764
1838
|
jc: "center",
|
|
1765
|
-
children: /* @__PURE__ */
|
|
1839
|
+
children: /* @__PURE__ */ L(d, {
|
|
1766
1840
|
viewBox: "0 0 24 24",
|
|
1767
1841
|
width: "40",
|
|
1768
1842
|
fill: "currentColor",
|
|
1769
1843
|
color: "gray-400",
|
|
1770
1844
|
theme: { dark: { color: "gray-500" } },
|
|
1771
|
-
children: /* @__PURE__ */
|
|
1845
|
+
children: /* @__PURE__ */ L(u, {
|
|
1772
1846
|
fillRule: "evenodd",
|
|
1773
1847
|
props: { clipRule: "evenodd" },
|
|
1774
1848
|
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"
|
|
1775
1849
|
})
|
|
1776
1850
|
})
|
|
1777
|
-
}), /* @__PURE__ */
|
|
1851
|
+
}), /* @__PURE__ */ R(m, {
|
|
1778
1852
|
d: "column",
|
|
1779
1853
|
ai: "center",
|
|
1780
1854
|
gap: 1,
|
|
1781
|
-
children: [/* @__PURE__ */
|
|
1855
|
+
children: [/* @__PURE__ */ L(r, {
|
|
1782
1856
|
fontSize: 18,
|
|
1783
1857
|
fontWeight: 600,
|
|
1784
1858
|
color: "gray-900",
|
|
1785
1859
|
theme: { dark: { color: "gray-50" } },
|
|
1786
|
-
children:
|
|
1787
|
-
}), /* @__PURE__ */
|
|
1860
|
+
children: t.localeText.noColumnsTitle
|
|
1861
|
+
}), /* @__PURE__ */ L(r, {
|
|
1788
1862
|
fontSize: 14,
|
|
1789
1863
|
color: "gray-500",
|
|
1790
1864
|
textAlign: "center",
|
|
1791
1865
|
theme: { dark: { color: "gray-400" } },
|
|
1792
|
-
children:
|
|
1866
|
+
children: t.localeText.noColumnsDescription
|
|
1793
1867
|
})]
|
|
1794
1868
|
})]
|
|
1795
1869
|
})
|
|
1796
1870
|
});
|
|
1797
1871
|
}
|
|
1798
1872
|
//#endregion
|
|
1873
|
+
//#region src/utils/dataGrid/headerCellUtils.ts
|
|
1874
|
+
var ft;
|
|
1875
|
+
(function(e) {
|
|
1876
|
+
let t = e.CELL_SELECTOR = "[role=\"columnheader\"][aria-sort]", n = ".resizer", r = `button, input, a, [role="menu"], [role="separator"], ${n}`;
|
|
1877
|
+
function i(e, t) {
|
|
1878
|
+
if (!(t instanceof Element) || !e.contains(t)) return !1;
|
|
1879
|
+
let n = t.closest(r);
|
|
1880
|
+
return !n || !e.contains(n);
|
|
1881
|
+
}
|
|
1882
|
+
e.isSortPress = i, e.INITIAL = {
|
|
1883
|
+
visible: !1,
|
|
1884
|
+
entering: !1,
|
|
1885
|
+
backward: !1,
|
|
1886
|
+
paused: !1
|
|
1887
|
+
};
|
|
1888
|
+
function a(e) {
|
|
1889
|
+
return e instanceof Element && e.closest(n) !== null;
|
|
1890
|
+
}
|
|
1891
|
+
e.isOnResizer = a;
|
|
1892
|
+
function o(e, n) {
|
|
1893
|
+
if (!(n instanceof Element) || a(n)) return;
|
|
1894
|
+
let r = n.closest(t);
|
|
1895
|
+
return r && e.contains(r) ? r : void 0;
|
|
1896
|
+
}
|
|
1897
|
+
e.cellAt = o;
|
|
1898
|
+
function s(e, n) {
|
|
1899
|
+
let r = e.getBoundingClientRect(), i = n.getBoundingClientRect(), { left: a, right: o } = i, s = n.querySelector("[role=\"separator\"]"), c = s?.closest(t) === n ? s.getBoundingClientRect() : void 0;
|
|
1900
|
+
return c && c.width > 0 && (c.left + c.right > a + o ? o = Math.min(o, c.left) : a = Math.max(a, c.right)), {
|
|
1901
|
+
left: a - r.left,
|
|
1902
|
+
right: r.right - o,
|
|
1903
|
+
top: i.top - r.top,
|
|
1904
|
+
bottom: r.bottom - i.bottom
|
|
1905
|
+
};
|
|
1906
|
+
}
|
|
1907
|
+
e.bounds = s;
|
|
1908
|
+
function c(e, t) {
|
|
1909
|
+
return !e || !t ? e === t : e.left === t.left && e.right === t.right && e.top === t.top && e.bottom === t.bottom;
|
|
1910
|
+
}
|
|
1911
|
+
e.sameBounds = c;
|
|
1912
|
+
function l(e, t) {
|
|
1913
|
+
if (!t) return e.visible || e.paused ? {
|
|
1914
|
+
...e,
|
|
1915
|
+
visible: !1,
|
|
1916
|
+
entering: !1,
|
|
1917
|
+
paused: !1
|
|
1918
|
+
} : e;
|
|
1919
|
+
if (!e.visible && !e.paused || !e.bounds) return {
|
|
1920
|
+
...e,
|
|
1921
|
+
bounds: t,
|
|
1922
|
+
visible: !0,
|
|
1923
|
+
entering: !0
|
|
1924
|
+
};
|
|
1925
|
+
if (c(e.bounds, t)) return e.visible ? e : {
|
|
1926
|
+
...e,
|
|
1927
|
+
visible: !0,
|
|
1928
|
+
paused: !1
|
|
1929
|
+
};
|
|
1930
|
+
let n = t.left - t.right - (e.bounds.left - e.bounds.right);
|
|
1931
|
+
return {
|
|
1932
|
+
bounds: t,
|
|
1933
|
+
visible: !0,
|
|
1934
|
+
entering: !1,
|
|
1935
|
+
backward: n === 0 ? e.backward : n < 0,
|
|
1936
|
+
paused: !1
|
|
1937
|
+
};
|
|
1938
|
+
}
|
|
1939
|
+
e.hover = l;
|
|
1940
|
+
function u(e) {
|
|
1941
|
+
return e.visible ? {
|
|
1942
|
+
...e,
|
|
1943
|
+
visible: !1,
|
|
1944
|
+
entering: !1,
|
|
1945
|
+
paused: !0
|
|
1946
|
+
} : e;
|
|
1947
|
+
}
|
|
1948
|
+
e.pause = u;
|
|
1949
|
+
})(ft ||= {});
|
|
1950
|
+
var X = ft, pt;
|
|
1951
|
+
(function(e) {
|
|
1952
|
+
function t(e, t) {
|
|
1953
|
+
return (t?.type === "text" ? t.value : "") === (e.trim() ? e : "");
|
|
1954
|
+
}
|
|
1955
|
+
e.textMatches = t;
|
|
1956
|
+
function n(e) {
|
|
1957
|
+
return e?.type === "number" ? {
|
|
1958
|
+
operator: e.operator,
|
|
1959
|
+
value: String(e.value),
|
|
1960
|
+
valueTo: e.valueTo === void 0 ? "" : String(e.valueTo)
|
|
1961
|
+
} : {
|
|
1962
|
+
operator: "eq",
|
|
1963
|
+
value: "",
|
|
1964
|
+
valueTo: ""
|
|
1965
|
+
};
|
|
1966
|
+
}
|
|
1967
|
+
e.numberDraft = n;
|
|
1968
|
+
function r(e, t) {
|
|
1969
|
+
let n = parseFloat(e.value);
|
|
1970
|
+
if (t?.type !== "number") return isNaN(n);
|
|
1971
|
+
if (t.value !== n || t.operator !== e.operator) return !1;
|
|
1972
|
+
if (t.operator !== "between") return !0;
|
|
1973
|
+
let r = parseFloat(e.valueTo);
|
|
1974
|
+
return t.valueTo === void 0 ? isNaN(r) : t.valueTo === r;
|
|
1975
|
+
}
|
|
1976
|
+
e.numberMatches = r;
|
|
1977
|
+
})(pt ||= {});
|
|
1978
|
+
var Z = pt, mt = 300;
|
|
1979
|
+
function ht(e, t, r) {
|
|
1980
|
+
let a = N(/* @__PURE__ */ new Map()), o = O(() => {
|
|
1981
|
+
for (let e of a.current.values()) clearTimeout(e);
|
|
1982
|
+
a.current.clear();
|
|
1983
|
+
}, []), s = O((e, t) => {
|
|
1984
|
+
clearTimeout(a.current.get(e)), a.current.set(e, setTimeout(() => {
|
|
1985
|
+
a.current.delete(e), t();
|
|
1986
|
+
}, mt));
|
|
1987
|
+
}, []);
|
|
1988
|
+
k(() => o, [o]);
|
|
1989
|
+
let c = i(() => {
|
|
1990
|
+
t(e) || (o(), r(e));
|
|
1991
|
+
});
|
|
1992
|
+
return n(c, [e, c]), {
|
|
1993
|
+
debounce: s,
|
|
1994
|
+
cancel: o
|
|
1995
|
+
};
|
|
1996
|
+
}
|
|
1997
|
+
//#endregion
|
|
1799
1998
|
//#region src/components/dataGrid/components/dataGridColumnFilter.tsx
|
|
1800
|
-
function
|
|
1801
|
-
let {
|
|
1802
|
-
return /* @__PURE__ */
|
|
1999
|
+
function gt(e) {
|
|
2000
|
+
let { label: t, onClear: n } = e;
|
|
2001
|
+
return /* @__PURE__ */ L(p, {
|
|
1803
2002
|
clean: !0,
|
|
1804
2003
|
type: "button",
|
|
1805
2004
|
position: "absolute",
|
|
@@ -1812,9 +2011,9 @@ function st(e) {
|
|
|
1812
2011
|
onClick: n,
|
|
1813
2012
|
props: {
|
|
1814
2013
|
tabIndex: -1,
|
|
1815
|
-
"aria-label":
|
|
2014
|
+
"aria-label": t
|
|
1816
2015
|
},
|
|
1817
|
-
children: /* @__PURE__ */
|
|
2016
|
+
children: /* @__PURE__ */ L(r, {
|
|
1818
2017
|
fontSize: 10,
|
|
1819
2018
|
color: "gray-400",
|
|
1820
2019
|
hover: { color: "gray-600" },
|
|
@@ -1822,80 +2021,65 @@ function st(e) {
|
|
|
1822
2021
|
})
|
|
1823
2022
|
});
|
|
1824
2023
|
}
|
|
1825
|
-
function
|
|
1826
|
-
let { currentFilter: t } = e, { componentName: n } = e.grid, r = e.header ?? e.key, i = t?.type === "text" ? t.value : "",
|
|
1827
|
-
O(() => () => {
|
|
1828
|
-
s.current && clearTimeout(s.current);
|
|
1829
|
-
}, []);
|
|
1830
|
-
let c = E((t) => {
|
|
2024
|
+
function _t({ column: e }) {
|
|
2025
|
+
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 } = ht(t, (e) => Z.textMatches(a, e), (e) => o(e?.type === "text" ? e.value : "")), l = O((t) => {
|
|
1831
2026
|
let n = t.target.value;
|
|
1832
|
-
o(n), s
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
}, [e
|
|
1836
|
-
|
|
1837
|
-
}, [e]);
|
|
1838
|
-
return /* @__PURE__ */ F(f, {
|
|
2027
|
+
o(n), s("value", () => e.setTextFilter(n));
|
|
2028
|
+
}, [e, s]), u = O(() => {
|
|
2029
|
+
c(), o(""), e.clearFilter();
|
|
2030
|
+
}, [e, c]);
|
|
2031
|
+
return /* @__PURE__ */ R(m, {
|
|
1839
2032
|
component: `${n}.filter.cell.input`,
|
|
1840
|
-
children: [/* @__PURE__ */
|
|
2033
|
+
children: [/* @__PURE__ */ L(y, {
|
|
1841
2034
|
width: "fit",
|
|
1842
2035
|
variant: "compact",
|
|
1843
|
-
placeholder: e.filterConfig?.placeholder ??
|
|
2036
|
+
placeholder: e.filterConfig?.placeholder ?? i.filterPlaceholder,
|
|
1844
2037
|
value: a,
|
|
1845
|
-
onChange:
|
|
2038
|
+
onChange: l,
|
|
1846
2039
|
b: 0,
|
|
1847
2040
|
bgColor: "transparent",
|
|
1848
2041
|
focus: { outline: 0 },
|
|
1849
2042
|
props: {
|
|
1850
2043
|
tabIndex: -1,
|
|
1851
|
-
"aria-label":
|
|
2044
|
+
"aria-label": i.filterColumn(r)
|
|
1852
2045
|
}
|
|
1853
|
-
}), a && /* @__PURE__ */
|
|
1854
|
-
|
|
1855
|
-
onClear:
|
|
2046
|
+
}), a && /* @__PURE__ */ L(gt, {
|
|
2047
|
+
label: i.clearFilter(r),
|
|
2048
|
+
onClear: u
|
|
1856
2049
|
})]
|
|
1857
2050
|
});
|
|
1858
2051
|
}
|
|
1859
|
-
function
|
|
1860
|
-
let { currentFilter: t } = e, { componentName: n } = e.grid, r = e.header ?? e.key, i =
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
c(
|
|
1867
|
-
|
|
1868
|
-
|
|
2052
|
+
function vt({ column: e }) {
|
|
2053
|
+
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 = O((e) => {
|
|
2054
|
+
s.current = e, o(e);
|
|
2055
|
+
}, []), { debounce: l, cancel: u } = ht(t, (e) => Z.numberMatches(a, e), (e) => c(Z.numberDraft(e))), { operator: d, value: f, valueTo: p } = a, h = e.filterConfig, g = O(() => {
|
|
2056
|
+
let { operator: t, value: n, valueTo: r } = s.current;
|
|
2057
|
+
e.setNumberFilter(t, n, r);
|
|
2058
|
+
}, [e]), _ = O((e, t) => {
|
|
2059
|
+
c({
|
|
2060
|
+
...s.current,
|
|
2061
|
+
...e
|
|
2062
|
+
}), t ? l("value", g) : (u(), g());
|
|
1869
2063
|
}, [
|
|
1870
|
-
|
|
2064
|
+
c,
|
|
2065
|
+
g,
|
|
1871
2066
|
l,
|
|
1872
|
-
|
|
1873
|
-
]), b =
|
|
1874
|
-
u(
|
|
1875
|
-
}, [
|
|
1876
|
-
e,
|
|
1877
|
-
s,
|
|
1878
|
-
d
|
|
1879
|
-
]), x = E((t) => {
|
|
1880
|
-
let n = t.target.value;
|
|
1881
|
-
p(n), h.current && clearTimeout(h.current), h.current = setTimeout(() => {
|
|
1882
|
-
e.setNumberFilter(l, s, n), h.current = null;
|
|
1883
|
-
}, 300);
|
|
2067
|
+
u
|
|
2068
|
+
]), v = O((e) => _({ value: e.target.value }, !0), [_]), b = O((e) => _({ valueTo: e.target.value }, !0), [_]), S = O((e) => _({ operator: e }, !1), [_]), C = O(() => {
|
|
2069
|
+
u(), c(Z.numberDraft(void 0)), e.clearFilter();
|
|
1884
2070
|
}, [
|
|
1885
2071
|
e,
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
])
|
|
1889
|
-
|
|
1890
|
-
}, [e]);
|
|
1891
|
-
return /* @__PURE__ */ F(f, {
|
|
2072
|
+
u,
|
|
2073
|
+
c
|
|
2074
|
+
]);
|
|
2075
|
+
return /* @__PURE__ */ R(m, {
|
|
1892
2076
|
component: `${n}.filter.cell.input`,
|
|
1893
|
-
ai:
|
|
2077
|
+
ai: d === "between" ? "start" : "center",
|
|
1894
2078
|
gap: 1,
|
|
1895
|
-
children: [/* @__PURE__ */
|
|
1896
|
-
value:
|
|
2079
|
+
children: [/* @__PURE__ */ R(x, {
|
|
2080
|
+
value: d,
|
|
1897
2081
|
variant: "compact",
|
|
1898
|
-
onChange: (e) => e &&
|
|
2082
|
+
onChange: (e) => e && S(e),
|
|
1899
2083
|
minWidth: 6,
|
|
1900
2084
|
hideIcon: !0,
|
|
1901
2085
|
b: 0,
|
|
@@ -1903,143 +2087,143 @@ function lt({ column: e }) {
|
|
|
1903
2087
|
focus: { outline: 0 },
|
|
1904
2088
|
props: {
|
|
1905
2089
|
tabIndex: -1,
|
|
1906
|
-
"aria-label":
|
|
2090
|
+
"aria-label": i.filterComparison(r)
|
|
1907
2091
|
},
|
|
1908
2092
|
children: [
|
|
1909
|
-
/* @__PURE__ */
|
|
2093
|
+
/* @__PURE__ */ L(x.Item, {
|
|
1910
2094
|
value: "eq",
|
|
1911
2095
|
children: "="
|
|
1912
2096
|
}),
|
|
1913
|
-
/* @__PURE__ */
|
|
2097
|
+
/* @__PURE__ */ L(x.Item, {
|
|
1914
2098
|
value: "ne",
|
|
1915
2099
|
children: "≠"
|
|
1916
2100
|
}),
|
|
1917
|
-
/* @__PURE__ */
|
|
2101
|
+
/* @__PURE__ */ L(x.Item, {
|
|
1918
2102
|
value: "gt",
|
|
1919
2103
|
children: ">"
|
|
1920
2104
|
}),
|
|
1921
|
-
/* @__PURE__ */
|
|
2105
|
+
/* @__PURE__ */ L(x.Item, {
|
|
1922
2106
|
value: "gte",
|
|
1923
2107
|
children: "≥"
|
|
1924
2108
|
}),
|
|
1925
|
-
/* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ L(x.Item, {
|
|
1926
2110
|
value: "lt",
|
|
1927
2111
|
children: "<"
|
|
1928
2112
|
}),
|
|
1929
|
-
/* @__PURE__ */
|
|
2113
|
+
/* @__PURE__ */ L(x.Item, {
|
|
1930
2114
|
value: "lte",
|
|
1931
2115
|
children: "≤"
|
|
1932
2116
|
}),
|
|
1933
|
-
/* @__PURE__ */
|
|
2117
|
+
/* @__PURE__ */ L(x.Item, {
|
|
1934
2118
|
value: "between",
|
|
1935
2119
|
children: "↔"
|
|
1936
2120
|
})
|
|
1937
2121
|
]
|
|
1938
|
-
}),
|
|
2122
|
+
}), d === "between" ? /* @__PURE__ */ R(m, {
|
|
1939
2123
|
d: "column",
|
|
1940
2124
|
gap: 1,
|
|
1941
2125
|
flex1: !0,
|
|
1942
|
-
children: [/* @__PURE__ */
|
|
2126
|
+
children: [/* @__PURE__ */ R(m, {
|
|
1943
2127
|
ai: "center",
|
|
1944
2128
|
position: "relative",
|
|
1945
2129
|
flex1: !0,
|
|
1946
|
-
children: [/* @__PURE__ */
|
|
2130
|
+
children: [/* @__PURE__ */ L(y, {
|
|
1947
2131
|
type: "number",
|
|
1948
2132
|
variant: "compact",
|
|
1949
|
-
placeholder:
|
|
1950
|
-
value:
|
|
2133
|
+
placeholder: h?.placeholder ?? i.filterFromPlaceholder,
|
|
2134
|
+
value: f,
|
|
1951
2135
|
onChange: v,
|
|
1952
2136
|
width: "fit",
|
|
1953
|
-
step:
|
|
2137
|
+
step: h?.step,
|
|
1954
2138
|
b: 0,
|
|
1955
2139
|
bgColor: "transparent",
|
|
1956
2140
|
focus: { outline: 0 },
|
|
1957
2141
|
props: {
|
|
1958
2142
|
tabIndex: -1,
|
|
1959
|
-
"aria-label":
|
|
2143
|
+
"aria-label": i.filterFrom(r)
|
|
1960
2144
|
}
|
|
1961
|
-
}), (
|
|
1962
|
-
|
|
1963
|
-
onClear:
|
|
2145
|
+
}), (f !== "" || p !== "") && /* @__PURE__ */ L(gt, {
|
|
2146
|
+
label: i.clearFilter(r),
|
|
2147
|
+
onClear: C
|
|
1964
2148
|
})]
|
|
1965
|
-
}), /* @__PURE__ */
|
|
2149
|
+
}), /* @__PURE__ */ L(m, {
|
|
1966
2150
|
ai: "center",
|
|
1967
2151
|
flex1: !0,
|
|
1968
|
-
children: /* @__PURE__ */
|
|
2152
|
+
children: /* @__PURE__ */ L(y, {
|
|
1969
2153
|
type: "number",
|
|
1970
2154
|
variant: "compact",
|
|
1971
|
-
placeholder:
|
|
1972
|
-
value:
|
|
1973
|
-
onChange:
|
|
2155
|
+
placeholder: i.filterToPlaceholder,
|
|
2156
|
+
value: p,
|
|
2157
|
+
onChange: b,
|
|
1974
2158
|
width: "fit",
|
|
1975
|
-
step:
|
|
2159
|
+
step: h?.step,
|
|
1976
2160
|
b: 0,
|
|
1977
2161
|
bgColor: "transparent",
|
|
1978
2162
|
focus: { outline: 0 },
|
|
1979
2163
|
props: {
|
|
1980
2164
|
tabIndex: -1,
|
|
1981
|
-
"aria-label":
|
|
2165
|
+
"aria-label": i.filterTo(r)
|
|
1982
2166
|
}
|
|
1983
2167
|
})
|
|
1984
2168
|
})]
|
|
1985
|
-
}) : /* @__PURE__ */
|
|
2169
|
+
}) : /* @__PURE__ */ R(m, {
|
|
1986
2170
|
ai: "center",
|
|
1987
2171
|
position: "relative",
|
|
1988
2172
|
flex1: !0,
|
|
1989
|
-
children: [/* @__PURE__ */
|
|
2173
|
+
children: [/* @__PURE__ */ L(y, {
|
|
1990
2174
|
type: "number",
|
|
1991
2175
|
variant: "compact",
|
|
1992
|
-
placeholder:
|
|
1993
|
-
value:
|
|
2176
|
+
placeholder: h?.placeholder ?? i.filterValuePlaceholder,
|
|
2177
|
+
value: f,
|
|
1994
2178
|
onChange: v,
|
|
1995
2179
|
width: "fit",
|
|
1996
|
-
step:
|
|
2180
|
+
step: h?.step,
|
|
1997
2181
|
b: 0,
|
|
1998
2182
|
bgColor: "transparent",
|
|
1999
2183
|
focus: { outline: 0 },
|
|
2000
2184
|
props: {
|
|
2001
2185
|
tabIndex: -1,
|
|
2002
|
-
"aria-label":
|
|
2186
|
+
"aria-label": i.filterColumn(r)
|
|
2003
2187
|
}
|
|
2004
|
-
}),
|
|
2005
|
-
|
|
2006
|
-
onClear:
|
|
2188
|
+
}), f !== "" && /* @__PURE__ */ L(gt, {
|
|
2189
|
+
label: i.clearFilter(r),
|
|
2190
|
+
onClear: C
|
|
2007
2191
|
})]
|
|
2008
2192
|
})]
|
|
2009
2193
|
});
|
|
2010
2194
|
}
|
|
2011
|
-
function
|
|
2012
|
-
let { currentFilter: t } = e, { componentName: n } = e.grid, i = e.header ?? e.key, a = t?.type === "multiselect" ? t.values : [],
|
|
2195
|
+
function yt({ column: e }) {
|
|
2196
|
+
let { currentFilter: t } = e, { componentName: n } = e.grid, i = String(e.header ?? e.key), a = e.grid.localeText, o = t?.type === "multiselect" ? t.values : [], s = e.filterOptions, c = O((t, n) => {
|
|
2013
2197
|
e.setMultiselectFilter(n);
|
|
2014
2198
|
}, [e]);
|
|
2015
|
-
return /* @__PURE__ */
|
|
2199
|
+
return /* @__PURE__ */ L(m, {
|
|
2016
2200
|
component: `${n}.filter.cell.input`,
|
|
2017
|
-
children: /* @__PURE__ */
|
|
2201
|
+
children: /* @__PURE__ */ R(x, {
|
|
2018
2202
|
multiple: !0,
|
|
2019
2203
|
showCheckbox: !0,
|
|
2020
2204
|
isSearchable: !0,
|
|
2021
|
-
searchPlaceholder:
|
|
2022
|
-
value:
|
|
2205
|
+
searchPlaceholder: a.filterSelectSearchPlaceholder,
|
|
2206
|
+
value: o,
|
|
2023
2207
|
width: "fit",
|
|
2024
2208
|
minWidth: 0,
|
|
2025
2209
|
bgColor: "transparent",
|
|
2026
|
-
onChange:
|
|
2210
|
+
onChange: c,
|
|
2027
2211
|
variant: "compact",
|
|
2028
2212
|
b: 0,
|
|
2029
2213
|
focus: { outline: 0 },
|
|
2030
2214
|
props: {
|
|
2031
2215
|
tabIndex: -1,
|
|
2032
|
-
"aria-label":
|
|
2216
|
+
"aria-label": a.filterColumn(i)
|
|
2033
2217
|
},
|
|
2034
2218
|
children: [
|
|
2035
|
-
/* @__PURE__ */
|
|
2219
|
+
/* @__PURE__ */ L(x.Display, { children: (t) => t.length === 0 ? /* @__PURE__ */ L(r, {
|
|
2036
2220
|
tag: "span",
|
|
2037
2221
|
color: "gray-400",
|
|
2038
|
-
children: e.filterConfig?.placeholder ??
|
|
2039
|
-
}) : t.length === 1 ?
|
|
2040
|
-
/* @__PURE__ */
|
|
2041
|
-
/* @__PURE__ */
|
|
2042
|
-
|
|
2222
|
+
children: e.filterConfig?.placeholder ?? a.filterSelectPlaceholder
|
|
2223
|
+
}) : t.length === 1 ? s.find((e) => e.value === t[0])?.label ?? String(t[0]) : `${t.length} selected` }),
|
|
2224
|
+
/* @__PURE__ */ L(x.Unselect, { children: a.filterSelectClear }),
|
|
2225
|
+
/* @__PURE__ */ L(x.SelectAll, { children: a.filterSelectAll }),
|
|
2226
|
+
s.map((e) => /* @__PURE__ */ L(x.Item, {
|
|
2043
2227
|
value: e.value,
|
|
2044
2228
|
ai: "center",
|
|
2045
2229
|
gap: 2,
|
|
@@ -2049,21 +2233,21 @@ function ut({ column: e }) {
|
|
|
2049
2233
|
})
|
|
2050
2234
|
});
|
|
2051
2235
|
}
|
|
2052
|
-
function
|
|
2236
|
+
function bt(e) {
|
|
2053
2237
|
let { column: t } = e, n = t.filterConfig;
|
|
2054
2238
|
if (!n) return null;
|
|
2055
2239
|
switch (n.type) {
|
|
2056
|
-
case "number": return /* @__PURE__ */
|
|
2057
|
-
case "multiselect": return /* @__PURE__ */
|
|
2058
|
-
default: return /* @__PURE__ */
|
|
2240
|
+
case "number": return /* @__PURE__ */ L(vt, { column: t });
|
|
2241
|
+
case "multiselect": return /* @__PURE__ */ L(yt, { column: t });
|
|
2242
|
+
default: return /* @__PURE__ */ L(_t, { column: t });
|
|
2059
2243
|
}
|
|
2060
2244
|
}
|
|
2061
|
-
|
|
2245
|
+
bt.displayName = "DataGridColumnFilter";
|
|
2062
2246
|
//#endregion
|
|
2063
2247
|
//#region src/components/dataGrid/components/dataGridFilterCell.tsx
|
|
2064
|
-
function
|
|
2065
|
-
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:
|
|
2066
|
-
return /* @__PURE__ */
|
|
2248
|
+
function xt(e) {
|
|
2249
|
+
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: h, isLastEndPinned: g } = t.pinFlags.value, { ref: _, tabIndex: v, onFocus: y } = me(B(), r, i), b = t.isGrouping || t.isRowNumber || t.isRowSelection;
|
|
2250
|
+
return /* @__PURE__ */ L(m, {
|
|
2067
2251
|
ref: _,
|
|
2068
2252
|
component: `${n.componentName}.filter.cell`,
|
|
2069
2253
|
props: {
|
|
@@ -2074,8 +2258,8 @@ function ft(e) {
|
|
|
2074
2258
|
},
|
|
2075
2259
|
variant: {
|
|
2076
2260
|
isPinned: d,
|
|
2077
|
-
isFirstStartPinned:
|
|
2078
|
-
isLastStartPinned:
|
|
2261
|
+
isFirstStartPinned: f,
|
|
2262
|
+
isLastStartPinned: p,
|
|
2079
2263
|
isFirstEndPinned: h,
|
|
2080
2264
|
isLastEndPinned: g
|
|
2081
2265
|
},
|
|
@@ -2085,23 +2269,23 @@ function ft(e) {
|
|
|
2085
2269
|
insetInlineStart: l ? `var(${o})` : void 0,
|
|
2086
2270
|
insetInlineEnd: u ? `var(${s})` : void 0
|
|
2087
2271
|
},
|
|
2088
|
-
children: !b && c && /* @__PURE__ */
|
|
2272
|
+
children: !b && c && /* @__PURE__ */ L(bt, { column: t })
|
|
2089
2273
|
});
|
|
2090
2274
|
}
|
|
2091
|
-
|
|
2275
|
+
xt.displayName = "DataGridFilterCell";
|
|
2092
2276
|
//#endregion
|
|
2093
2277
|
//#region src/components/dataGrid/components/dataGridFilterRow.tsx
|
|
2094
|
-
function
|
|
2278
|
+
function St(e) {
|
|
2095
2279
|
let { grid: t } = e;
|
|
2096
2280
|
if (!t.filter.hasFilterableColumns) return null;
|
|
2097
2281
|
let n = t.headerRows.value.length;
|
|
2098
|
-
return /* @__PURE__ */
|
|
2282
|
+
return /* @__PURE__ */ L(r, {
|
|
2099
2283
|
display: "contents",
|
|
2100
2284
|
props: {
|
|
2101
2285
|
role: "row",
|
|
2102
2286
|
"aria-rowindex": n + 1
|
|
2103
2287
|
},
|
|
2104
|
-
children: t.columns.value.visibleLeafs.map((e, r) => /* @__PURE__ */
|
|
2288
|
+
children: t.columns.value.visibleLeafs.map((e, r) => /* @__PURE__ */ L(xt, {
|
|
2105
2289
|
column: e,
|
|
2106
2290
|
grid: t,
|
|
2107
2291
|
row: n,
|
|
@@ -2109,25 +2293,25 @@ function pt(e) {
|
|
|
2109
2293
|
}, e.uniqueKey))
|
|
2110
2294
|
});
|
|
2111
2295
|
}
|
|
2112
|
-
|
|
2296
|
+
St.displayName = "DataGridFilterRow";
|
|
2113
2297
|
//#endregion
|
|
2114
2298
|
//#region src/icons/sortIcon.tsx
|
|
2115
|
-
function
|
|
2116
|
-
return /* @__PURE__ */
|
|
2299
|
+
function Ct(e) {
|
|
2300
|
+
return /* @__PURE__ */ L(d, {
|
|
2117
2301
|
viewBox: "0 0 24 24",
|
|
2118
2302
|
width: "1.5rem",
|
|
2119
2303
|
...e,
|
|
2120
|
-
children: /* @__PURE__ */
|
|
2304
|
+
children: /* @__PURE__ */ L(u, { d: "M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z" })
|
|
2121
2305
|
});
|
|
2122
2306
|
}
|
|
2123
2307
|
//#endregion
|
|
2124
2308
|
//#region src/icons/dotsIcon.tsx
|
|
2125
|
-
function
|
|
2126
|
-
return /* @__PURE__ */
|
|
2309
|
+
function wt(e) {
|
|
2310
|
+
return /* @__PURE__ */ L(d, {
|
|
2127
2311
|
viewBox: "0 0 16 16",
|
|
2128
2312
|
width: "18",
|
|
2129
2313
|
...e,
|
|
2130
|
-
children: /* @__PURE__ */
|
|
2314
|
+
children: /* @__PURE__ */ L(u, {
|
|
2131
2315
|
strokeWidth: 4,
|
|
2132
2316
|
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"
|
|
2133
2317
|
})
|
|
@@ -2135,119 +2319,127 @@ function ht(e) {
|
|
|
2135
2319
|
}
|
|
2136
2320
|
//#endregion
|
|
2137
2321
|
//#region src/icons/groupingIcon.tsx
|
|
2138
|
-
function
|
|
2139
|
-
return /* @__PURE__ */
|
|
2322
|
+
function Tt(e) {
|
|
2323
|
+
return /* @__PURE__ */ L(d, {
|
|
2140
2324
|
viewBox: "0 0 24 24",
|
|
2141
2325
|
width: "1.5rem",
|
|
2142
2326
|
...e,
|
|
2143
|
-
children: /* @__PURE__ */
|
|
2327
|
+
children: /* @__PURE__ */ L(u, { d: "M3 5h8v2H3V5zm0 6h8v2H3v-2zm0 6h8v2H3v-2zm12-12h6v6h-6V5zm1 1v4h4V6h-4zm-1 7h6v6h-6v-6zm1 1v4h4v-4h-4z" })
|
|
2144
2328
|
});
|
|
2145
2329
|
}
|
|
2146
2330
|
//#endregion
|
|
2147
2331
|
//#region src/icons/pinIcon.tsx
|
|
2148
|
-
function
|
|
2149
|
-
return /* @__PURE__ */
|
|
2332
|
+
function Et(e) {
|
|
2333
|
+
return /* @__PURE__ */ L(d, {
|
|
2150
2334
|
viewBox: "0 0 1024 1024",
|
|
2151
2335
|
width: "1.5rem",
|
|
2152
2336
|
...e,
|
|
2153
|
-
children: /* @__PURE__ */
|
|
2337
|
+
children: /* @__PURE__ */ L(u, { 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" })
|
|
2154
2338
|
});
|
|
2155
2339
|
}
|
|
2156
2340
|
//#endregion
|
|
2157
2341
|
//#region src/components/dataGrid/components/dataGridHeaderCellContextMenu.tsx
|
|
2158
|
-
function
|
|
2159
|
-
let
|
|
2160
|
-
return /* @__PURE__ */
|
|
2342
|
+
function Dt(e) {
|
|
2343
|
+
let { side: t, left: n, right: r } = e;
|
|
2344
|
+
return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ L(S, {
|
|
2161
2345
|
rtl: { display: "none" },
|
|
2162
|
-
children:
|
|
2163
|
-
}), /* @__PURE__ */
|
|
2346
|
+
children: t === "start" ? n : r
|
|
2347
|
+
}), /* @__PURE__ */ L(S, {
|
|
2164
2348
|
ltr: { display: "none" },
|
|
2165
|
-
children:
|
|
2349
|
+
children: t === "start" ? r : n
|
|
2166
2350
|
})] });
|
|
2167
2351
|
}
|
|
2168
|
-
function
|
|
2169
|
-
let { column: t } = e, { grid:
|
|
2170
|
-
let e = (e) => /* @__PURE__ */
|
|
2171
|
-
component: `${
|
|
2352
|
+
function Ot(e) {
|
|
2353
|
+
let { column: t } = e, { grid: i, isEndAligned: o, header: u, key: d } = t, f = t.headerCell, h = String(u ?? d), v = i.localeText, y = l("datagrid-column-menu"), [b, x] = P(!1), C = N(null), T = N(null), E = N(!1), D = o ? 3 : void 0, ee = o ? void 0 : 3, k = M(() => {
|
|
2354
|
+
let e = (e) => /* @__PURE__ */ L(S, {
|
|
2355
|
+
component: `${i.componentName}.header.cell.contextMenu.tooltip.item.icon`,
|
|
2172
2356
|
children: e
|
|
2173
|
-
}), n = (t) => e(/* @__PURE__ */
|
|
2357
|
+
}), n = (t) => e(/* @__PURE__ */ L(Ct, {
|
|
2174
2358
|
width: "100%",
|
|
2175
2359
|
fill: "currentColor",
|
|
2176
2360
|
rotate: t
|
|
2177
|
-
})),
|
|
2361
|
+
})), a = (t, n) => e(/* @__PURE__ */ L(Et, {
|
|
2178
2362
|
width: "100%",
|
|
2179
2363
|
fill: "currentColor",
|
|
2180
2364
|
rotate: t,
|
|
2181
2365
|
rtl: { rotate: n }
|
|
2182
|
-
})),
|
|
2366
|
+
})), o = e(/* @__PURE__ */ L(Tt, {
|
|
2183
2367
|
width: "100%",
|
|
2184
2368
|
fill: "currentColor"
|
|
2185
|
-
})),
|
|
2369
|
+
})), s = /* @__PURE__ */ L(r, { width: 4 });
|
|
2186
2370
|
return [
|
|
2187
2371
|
[
|
|
2188
|
-
|
|
2372
|
+
f.canSortAsc && {
|
|
2189
2373
|
key: "sort-asc",
|
|
2190
2374
|
icon: n(),
|
|
2191
|
-
label:
|
|
2192
|
-
text:
|
|
2375
|
+
label: v.sortAscending,
|
|
2376
|
+
text: v.sortAscending,
|
|
2193
2377
|
run: () => t.sortColumn("ASC")
|
|
2194
2378
|
},
|
|
2195
|
-
|
|
2379
|
+
f.canSortDesc && {
|
|
2196
2380
|
key: "sort-desc",
|
|
2197
2381
|
icon: n(180),
|
|
2198
|
-
label:
|
|
2199
|
-
text:
|
|
2382
|
+
label: v.sortDescending,
|
|
2383
|
+
text: v.sortDescending,
|
|
2200
2384
|
run: () => t.sortColumn("DESC")
|
|
2201
2385
|
},
|
|
2202
|
-
|
|
2386
|
+
f.canClearSort && {
|
|
2203
2387
|
key: "sort-clear",
|
|
2204
|
-
icon:
|
|
2205
|
-
label:
|
|
2206
|
-
text:
|
|
2388
|
+
icon: s,
|
|
2389
|
+
label: v.clearSort,
|
|
2390
|
+
text: v.clearSort,
|
|
2207
2391
|
run: () => t.sortColumn(void 0)
|
|
2208
2392
|
}
|
|
2209
2393
|
],
|
|
2210
2394
|
[
|
|
2211
|
-
|
|
2395
|
+
f.canPinStart && {
|
|
2212
2396
|
key: "pin-start",
|
|
2213
|
-
icon:
|
|
2214
|
-
label: /* @__PURE__ */
|
|
2215
|
-
|
|
2397
|
+
icon: a(0, -90),
|
|
2398
|
+
label: /* @__PURE__ */ L(Dt, {
|
|
2399
|
+
side: "start",
|
|
2400
|
+
left: v.pinLeft,
|
|
2401
|
+
right: v.pinRight
|
|
2402
|
+
}),
|
|
2403
|
+
text: v.pinLeft,
|
|
2216
2404
|
run: () => t.pinColumn("START")
|
|
2217
2405
|
},
|
|
2218
|
-
|
|
2406
|
+
f.canPinEnd && {
|
|
2219
2407
|
key: "pin-end",
|
|
2220
|
-
icon:
|
|
2221
|
-
label: /* @__PURE__ */
|
|
2222
|
-
|
|
2408
|
+
icon: a(-90, 0),
|
|
2409
|
+
label: /* @__PURE__ */ L(Dt, {
|
|
2410
|
+
side: "end",
|
|
2411
|
+
left: v.pinLeft,
|
|
2412
|
+
right: v.pinRight
|
|
2413
|
+
}),
|
|
2414
|
+
text: v.pinRight,
|
|
2223
2415
|
run: () => t.pinColumn("END")
|
|
2224
2416
|
},
|
|
2225
|
-
|
|
2417
|
+
f.canUnpin && {
|
|
2226
2418
|
key: "unpin",
|
|
2227
|
-
icon:
|
|
2228
|
-
label:
|
|
2229
|
-
text:
|
|
2419
|
+
icon: s,
|
|
2420
|
+
label: v.unpin,
|
|
2421
|
+
text: v.unpin,
|
|
2230
2422
|
run: () => t.pinColumn()
|
|
2231
2423
|
}
|
|
2232
2424
|
],
|
|
2233
|
-
[
|
|
2425
|
+
[f.canGroupBy && {
|
|
2234
2426
|
key: "group",
|
|
2235
|
-
icon:
|
|
2236
|
-
label: /* @__PURE__ */
|
|
2427
|
+
icon: o,
|
|
2428
|
+
label: /* @__PURE__ */ L(r, {
|
|
2237
2429
|
textWrap: "nowrap",
|
|
2238
|
-
children:
|
|
2430
|
+
children: v.groupBy(h)
|
|
2239
2431
|
}),
|
|
2240
|
-
text:
|
|
2432
|
+
text: v.groupBy(h),
|
|
2241
2433
|
run: t.toggleGrouping
|
|
2242
|
-
},
|
|
2434
|
+
}, f.canUnGroupAll && {
|
|
2243
2435
|
key: "ungroup",
|
|
2244
|
-
icon:
|
|
2245
|
-
label: /* @__PURE__ */
|
|
2436
|
+
icon: o,
|
|
2437
|
+
label: /* @__PURE__ */ L(r, {
|
|
2246
2438
|
textWrap: "nowrap",
|
|
2247
|
-
children:
|
|
2439
|
+
children: v.ungroupAll
|
|
2248
2440
|
}),
|
|
2249
|
-
text:
|
|
2250
|
-
run:
|
|
2441
|
+
text: v.ungroupAll,
|
|
2442
|
+
run: i.unGroupAll
|
|
2251
2443
|
}]
|
|
2252
2444
|
].map((e) => e.filter((e) => e !== !1)).filter((e) => e.length > 0).flatMap((e, t) => e.map((e, n) => ({
|
|
2253
2445
|
...e,
|
|
@@ -2255,84 +2447,85 @@ function yt(e) {
|
|
|
2255
2447
|
})));
|
|
2256
2448
|
}, [
|
|
2257
2449
|
t,
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2450
|
+
h,
|
|
2451
|
+
i,
|
|
2452
|
+
f,
|
|
2453
|
+
v
|
|
2454
|
+
]), A = O((e = !0) => {
|
|
2455
|
+
E.current = !1, x(!1), e && C.current?.focus();
|
|
2456
|
+
}, []), j = c({
|
|
2264
2457
|
count: k.length,
|
|
2265
2458
|
textOf: (e) => k[e]?.text ?? "",
|
|
2266
2459
|
onSelect: (e) => {
|
|
2267
2460
|
k[e]?.run(), A();
|
|
2268
2461
|
}
|
|
2269
2462
|
});
|
|
2270
|
-
|
|
2271
|
-
enabled:
|
|
2272
|
-
inside: [C,
|
|
2463
|
+
s({
|
|
2464
|
+
enabled: b,
|
|
2465
|
+
inside: [C, T],
|
|
2273
2466
|
onDismiss: () => A()
|
|
2274
|
-
}),
|
|
2275
|
-
enabled:
|
|
2467
|
+
}), a({
|
|
2468
|
+
enabled: b,
|
|
2276
2469
|
returnTo: C
|
|
2277
2470
|
});
|
|
2278
|
-
let
|
|
2279
|
-
|
|
2280
|
-
}, [
|
|
2471
|
+
let F = j.setActiveIndex, I = j.activeItem, te = O(() => {
|
|
2472
|
+
F(0, { reason: "programmatic" }), E.current = !0, x(!0);
|
|
2473
|
+
}, [F]);
|
|
2281
2474
|
return n(() => {
|
|
2282
|
-
if (!
|
|
2283
|
-
let e =
|
|
2284
|
-
e && (
|
|
2285
|
-
}), /* @__PURE__ */
|
|
2475
|
+
if (!E.current) return;
|
|
2476
|
+
let e = I();
|
|
2477
|
+
e && (E.current = !1, e.focus());
|
|
2478
|
+
}), /* @__PURE__ */ R(m, {
|
|
2286
2479
|
position: "absolute",
|
|
2287
2480
|
insetStart: D,
|
|
2288
|
-
insetEnd:
|
|
2481
|
+
insetEnd: ee,
|
|
2289
2482
|
top: "1/2",
|
|
2290
2483
|
translateY: -3,
|
|
2291
2484
|
ai: "center",
|
|
2292
|
-
children: [/* @__PURE__ */
|
|
2485
|
+
children: [/* @__PURE__ */ L(p, {
|
|
2293
2486
|
ref: C,
|
|
2294
|
-
component: `${
|
|
2295
|
-
onClick: () =>
|
|
2296
|
-
variant:
|
|
2487
|
+
component: `${i.componentName}.header.cell.contextMenu`,
|
|
2488
|
+
onClick: () => b ? A(!1) : te(),
|
|
2489
|
+
variant: f.contextMenuButtonVariant,
|
|
2297
2490
|
type: "button",
|
|
2298
2491
|
props: {
|
|
2299
2492
|
tabIndex: -1,
|
|
2300
|
-
"aria-label":
|
|
2493
|
+
"aria-label": v.columnOptions(h),
|
|
2301
2494
|
"aria-haspopup": "menu",
|
|
2302
|
-
"aria-expanded":
|
|
2303
|
-
"aria-controls":
|
|
2495
|
+
"aria-expanded": b,
|
|
2496
|
+
"aria-controls": b ? y : void 0
|
|
2304
2497
|
},
|
|
2305
|
-
children: /* @__PURE__ */
|
|
2306
|
-
component: `${
|
|
2307
|
-
children: /* @__PURE__ */
|
|
2498
|
+
children: /* @__PURE__ */ L(S, {
|
|
2499
|
+
component: `${i.componentName}.header.cell.contextMenu.icon`,
|
|
2500
|
+
children: /* @__PURE__ */ L(wt, { fill: "currentColor" })
|
|
2308
2501
|
})
|
|
2309
|
-
}), /* @__PURE__ */
|
|
2310
|
-
present:
|
|
2311
|
-
children: (e) => /* @__PURE__ */
|
|
2312
|
-
component: `${
|
|
2502
|
+
}), /* @__PURE__ */ L(_, {
|
|
2503
|
+
present: b,
|
|
2504
|
+
children: (e) => /* @__PURE__ */ L(g, {
|
|
2505
|
+
component: `${i.componentName}.header.cell.contextMenu.tooltip`,
|
|
2313
2506
|
variant: { closed: !e.present },
|
|
2314
|
-
ref:
|
|
2507
|
+
ref: T,
|
|
2315
2508
|
contentRef: e.ref,
|
|
2316
2509
|
anchor: C,
|
|
2317
2510
|
side: "bottom",
|
|
2318
2511
|
align: "end",
|
|
2319
2512
|
matchWidth: !1,
|
|
2320
|
-
id:
|
|
2513
|
+
id: y,
|
|
2321
2514
|
props: {
|
|
2322
2515
|
role: "menu",
|
|
2323
|
-
"aria-label":
|
|
2324
|
-
onKeyDown:
|
|
2516
|
+
"aria-label": v.columnOptions(h),
|
|
2517
|
+
onKeyDown: j.onKeyDown,
|
|
2325
2518
|
...e.props
|
|
2326
2519
|
},
|
|
2327
2520
|
children: k.map((e, t) => {
|
|
2328
|
-
let { ref: n, tabIndex:
|
|
2329
|
-
return /* @__PURE__ */
|
|
2521
|
+
let { ref: n, tabIndex: a, onFocus: o } = j.itemProps(t);
|
|
2522
|
+
return /* @__PURE__ */ R(w, { children: [e.startsSection && /* @__PURE__ */ L(r, {
|
|
2330
2523
|
bb: 1,
|
|
2331
2524
|
my: 2,
|
|
2332
2525
|
borderColor: "gray-300",
|
|
2333
|
-
component: `${
|
|
2334
|
-
}), /* @__PURE__ */
|
|
2335
|
-
component: `${
|
|
2526
|
+
component: `${i.componentName}.header.cell.contextMenu.tooltip.item.separator`
|
|
2527
|
+
}), /* @__PURE__ */ R(p, {
|
|
2528
|
+
component: `${i.componentName}.header.cell.contextMenu.tooltip.item`,
|
|
2336
2529
|
ref: n,
|
|
2337
2530
|
type: "button",
|
|
2338
2531
|
onClick: (t) => {
|
|
@@ -2340,8 +2533,8 @@ function yt(e) {
|
|
|
2340
2533
|
},
|
|
2341
2534
|
props: {
|
|
2342
2535
|
role: "menuitem",
|
|
2343
|
-
tabIndex:
|
|
2344
|
-
onFocus:
|
|
2536
|
+
tabIndex: a,
|
|
2537
|
+
onFocus: o
|
|
2345
2538
|
},
|
|
2346
2539
|
children: [e.icon, e.label]
|
|
2347
2540
|
})] }, e.key);
|
|
@@ -2350,49 +2543,49 @@ function yt(e) {
|
|
|
2350
2543
|
})]
|
|
2351
2544
|
});
|
|
2352
2545
|
}
|
|
2353
|
-
|
|
2546
|
+
Ot.displayName = "DataGridHeaderCellContextMenu";
|
|
2354
2547
|
//#endregion
|
|
2355
2548
|
//#region src/components/dataGrid/components/dataGridHeaderCellResizer.tsx
|
|
2356
|
-
var
|
|
2357
|
-
function
|
|
2549
|
+
var kt = (e) => "touches" in e ? e.touches[0]?.pageX ?? 0 : e.pageX, At = 16, jt = 150;
|
|
2550
|
+
function Mt(e) {
|
|
2358
2551
|
let t = e.sizingElement;
|
|
2359
2552
|
t && Object.entries(e.sizes.value).forEach(([e, n]) => t.style.setProperty(e, n));
|
|
2360
2553
|
}
|
|
2361
|
-
function
|
|
2362
|
-
let { column: t, controls: n } = e, i = t.grid.resizerStyle, a = t.headerCell, o =
|
|
2554
|
+
function Nt(e) {
|
|
2555
|
+
let { column: t, controls: n } = e, i = t.grid.resizerStyle, a = t.headerCell, o = O((e) => {
|
|
2363
2556
|
let { grid: n } = t;
|
|
2364
|
-
e.type === "mousedown" && e.preventDefault(), t.beginResize(
|
|
2365
|
-
let r = new AbortController(), { signal: i } = r, a = 0, o =
|
|
2366
|
-
t.applyResize(o),
|
|
2557
|
+
e.type === "mousedown" && e.preventDefault(), t.beginResize(kt(e.nativeEvent));
|
|
2558
|
+
let r = new AbortController(), { signal: i } = r, a = 0, o = kt(e.nativeEvent), s = () => {
|
|
2559
|
+
t.applyResize(o), Mt(n);
|
|
2367
2560
|
}, c = n.resizeMode === "instant" ? (e) => {
|
|
2368
|
-
o =
|
|
2561
|
+
o = kt(e), s();
|
|
2369
2562
|
} : (e) => {
|
|
2370
|
-
o =
|
|
2563
|
+
o = kt(e), a ||= requestAnimationFrame(() => {
|
|
2371
2564
|
a = 0, s();
|
|
2372
2565
|
});
|
|
2373
2566
|
}, l = () => {
|
|
2374
2567
|
r.abort(), a && cancelAnimationFrame(a), s(), t.endResize();
|
|
2375
2568
|
};
|
|
2376
2569
|
window.addEventListener("mousemove", c, { signal: i }), window.addEventListener("touchmove", c, { signal: i }), window.addEventListener("mouseup", l, { signal: i }), window.addEventListener("touchend", l, { signal: i });
|
|
2377
|
-
}, [t]), s =
|
|
2570
|
+
}, [t]), s = N(void 0), c = N(0), l = O(() => {
|
|
2378
2571
|
let { grid: e } = t;
|
|
2379
2572
|
if (e.resizeMode === "instant") {
|
|
2380
|
-
|
|
2573
|
+
Mt(e);
|
|
2381
2574
|
return;
|
|
2382
2575
|
}
|
|
2383
2576
|
c.current ||= requestAnimationFrame(() => {
|
|
2384
|
-
c.current = 0,
|
|
2577
|
+
c.current = 0, Mt(e);
|
|
2385
2578
|
});
|
|
2386
|
-
}, [t]), u =
|
|
2579
|
+
}, [t]), u = O(() => {
|
|
2387
2580
|
s.current !== void 0 && (clearTimeout(s.current), s.current = void 0, c.current &&= (cancelAnimationFrame(c.current), 0), t.endResize());
|
|
2388
2581
|
}, [t]);
|
|
2389
|
-
|
|
2582
|
+
k(() => () => {
|
|
2390
2583
|
clearTimeout(s.current), c.current && cancelAnimationFrame(c.current);
|
|
2391
2584
|
}, []);
|
|
2392
|
-
let d =
|
|
2585
|
+
let d = O((e) => {
|
|
2393
2586
|
switch (e.key) {
|
|
2394
2587
|
case "ArrowRight":
|
|
2395
|
-
t.moveResizer(
|
|
2588
|
+
t.moveResizer(At);
|
|
2396
2589
|
break;
|
|
2397
2590
|
case "ArrowLeft":
|
|
2398
2591
|
t.moveResizer(-16);
|
|
@@ -2405,21 +2598,22 @@ function Ct(e) {
|
|
|
2405
2598
|
break;
|
|
2406
2599
|
default: return;
|
|
2407
2600
|
}
|
|
2408
|
-
e.preventDefault(), l(), clearTimeout(s.current), s.current = setTimeout(u,
|
|
2601
|
+
e.preventDefault(), l(), clearTimeout(s.current), s.current = setTimeout(u, jt);
|
|
2409
2602
|
}, [
|
|
2410
2603
|
t,
|
|
2411
2604
|
u,
|
|
2412
2605
|
a,
|
|
2413
2606
|
l
|
|
2414
2607
|
]);
|
|
2415
|
-
return /* @__PURE__ */
|
|
2608
|
+
return /* @__PURE__ */ L(m, {
|
|
2416
2609
|
height: "fit",
|
|
2417
2610
|
ai: "center",
|
|
2418
2611
|
position: "absolute",
|
|
2419
|
-
insetEnd: t.pin === "END" ? void 0 :
|
|
2420
|
-
insetStart: t.pin === "END" ?
|
|
2612
|
+
insetEnd: t.pin === "END" ? void 0 : -.75,
|
|
2613
|
+
insetStart: t.pin === "END" ? -.75 : void 0,
|
|
2614
|
+
zIndex: 1,
|
|
2421
2615
|
py: 3,
|
|
2422
|
-
children: /* @__PURE__ */
|
|
2616
|
+
children: /* @__PURE__ */ L(r, {
|
|
2423
2617
|
cursor: "col-resize",
|
|
2424
2618
|
px: .75,
|
|
2425
2619
|
mt: -6,
|
|
@@ -2429,7 +2623,7 @@ function Ct(e) {
|
|
|
2429
2623
|
onMouseDown: o,
|
|
2430
2624
|
onTouchStart: o
|
|
2431
2625
|
},
|
|
2432
|
-
children: /* @__PURE__ */
|
|
2626
|
+
children: /* @__PURE__ */ L(r, {
|
|
2433
2627
|
component: `${t.grid.componentName}.header.cell.resizer`,
|
|
2434
2628
|
opacity: i === "visible" ? void 0 : 0,
|
|
2435
2629
|
group: i === "hover" ? { "header-cell/hover": { opacity: 1 } } : void 0,
|
|
@@ -2441,7 +2635,7 @@ function Ct(e) {
|
|
|
2441
2635
|
"aria-valuenow": a.width,
|
|
2442
2636
|
"aria-valuemin": a.minWidth,
|
|
2443
2637
|
"aria-valuemax": a.maxWidth,
|
|
2444
|
-
"aria-valuetext":
|
|
2638
|
+
"aria-valuetext": t.grid.localeText.columnWidth(a.width),
|
|
2445
2639
|
tabIndex: -1,
|
|
2446
2640
|
onKeyDown: d,
|
|
2447
2641
|
onKeyUp: u
|
|
@@ -2450,147 +2644,192 @@ function Ct(e) {
|
|
|
2450
2644
|
})
|
|
2451
2645
|
});
|
|
2452
2646
|
}
|
|
2453
|
-
|
|
2647
|
+
Nt.displayName = "DataGridHeaderCellResizer";
|
|
2454
2648
|
//#endregion
|
|
2455
2649
|
//#region src/components/dataGrid/components/dataGridHeaderCell.tsx
|
|
2456
|
-
function
|
|
2457
|
-
let { column: t, row: n, columnIndex: i } = e, { grid: a } = t, { isStartPinned: o, isEndPinned:
|
|
2650
|
+
function Pt(e) {
|
|
2651
|
+
let { column: t, row: n, columnIndex: i } = e, { grid: a } = t, { isStartPinned: o, isEndPinned: s } = t.pinFlags.value, c = t.headerCell, { isSortable: u, showResizer: d, showContextMenu: f, paddingStart: p, paddingEnd: g } = c, { ref: _, tabIndex: y, onFocus: b } = me(B(), n, i), x = l("datagrid-columnheader"), S = N(null), C = O(() => {
|
|
2458
2652
|
a.toggleSelectAllRows();
|
|
2459
|
-
}, [a]),
|
|
2653
|
+
}, [a]), w = t.isRowSelection ? /* @__PURE__ */ L(h, {
|
|
2460
2654
|
variant: "datagrid",
|
|
2461
2655
|
m: 1,
|
|
2462
2656
|
indeterminate: a.someRowsSelected && !a.allRowsSelected,
|
|
2463
2657
|
checked: a.allRowsSelected,
|
|
2464
|
-
onChange:
|
|
2658
|
+
onChange: C,
|
|
2465
2659
|
props: {
|
|
2466
2660
|
tabIndex: -1,
|
|
2467
|
-
"aria-label":
|
|
2661
|
+
"aria-label": a.localeText.selectAllRows
|
|
2468
2662
|
}
|
|
2469
|
-
}) :
|
|
2663
|
+
}) : c.hiddenLabel ? /* @__PURE__ */ L(v, {
|
|
2470
2664
|
tag: "span",
|
|
2471
|
-
children:
|
|
2472
|
-
}) :
|
|
2473
|
-
return /* @__PURE__ */
|
|
2474
|
-
ref:
|
|
2665
|
+
children: c.hiddenLabel
|
|
2666
|
+
}) : c.label;
|
|
2667
|
+
return /* @__PURE__ */ L(m, {
|
|
2668
|
+
ref: _,
|
|
2475
2669
|
id: x,
|
|
2476
2670
|
props: {
|
|
2477
2671
|
role: "columnheader",
|
|
2478
|
-
"aria-colindex":
|
|
2479
|
-
"aria-colspan":
|
|
2480
|
-
"aria-rowspan":
|
|
2481
|
-
"aria-sort":
|
|
2672
|
+
"aria-colindex": c.columnIndex,
|
|
2673
|
+
"aria-colspan": c.columnSpan,
|
|
2674
|
+
"aria-rowspan": c.rowSpan,
|
|
2675
|
+
"aria-sort": c.ariaSort,
|
|
2482
2676
|
tabIndex: y,
|
|
2483
|
-
onFocus: b
|
|
2677
|
+
onFocus: b,
|
|
2678
|
+
onPointerDown: u ? (e) => S.current = e.target : void 0,
|
|
2679
|
+
onClick: u ? (e) => {
|
|
2680
|
+
X.isSortPress(e.currentTarget, S.current ?? e.target) && t.sortColumn(), S.current = null;
|
|
2681
|
+
} : void 0
|
|
2484
2682
|
},
|
|
2485
2683
|
className: "header-cell",
|
|
2486
2684
|
component: `${a.componentName}.header.cell`,
|
|
2487
|
-
variant:
|
|
2685
|
+
variant: c.variant,
|
|
2488
2686
|
gridRow: t.gridRows,
|
|
2489
|
-
gridColumn:
|
|
2687
|
+
gridColumn: c.gridColumn,
|
|
2490
2688
|
style: {
|
|
2491
2689
|
width: `var(${t.widthVarName})`,
|
|
2492
2690
|
insetInlineStart: o ? `var(${t.inlineStartVarName})` : void 0,
|
|
2493
|
-
insetInlineEnd:
|
|
2691
|
+
insetInlineEnd: s ? `var(${t.inlineEndVarName})` : void 0
|
|
2494
2692
|
},
|
|
2495
|
-
children: /* @__PURE__ */
|
|
2496
|
-
/* @__PURE__ */
|
|
2693
|
+
children: /* @__PURE__ */ R(I, { children: [
|
|
2694
|
+
/* @__PURE__ */ L(m, {
|
|
2497
2695
|
width: "fit",
|
|
2498
2696
|
height: "fit",
|
|
2499
2697
|
jc: t.align,
|
|
2500
|
-
|
|
2501
|
-
children: /* @__PURE__ */ F(f, {
|
|
2698
|
+
children: /* @__PURE__ */ R(m, {
|
|
2502
2699
|
overflow: "hidden",
|
|
2503
2700
|
position: t.isLeaf ? void 0 : "sticky",
|
|
2504
2701
|
ai: "center",
|
|
2505
2702
|
transition: "none",
|
|
2506
|
-
ps:
|
|
2507
|
-
pe:
|
|
2703
|
+
ps: p,
|
|
2704
|
+
pe: g,
|
|
2508
2705
|
style: { insetInlineStart: t.pin ? void 0 : `var(${a.inlineStartEdgeVarName})` },
|
|
2509
2706
|
children: [
|
|
2510
|
-
/* @__PURE__ */
|
|
2707
|
+
/* @__PURE__ */ L(r, {
|
|
2511
2708
|
overflow: "hidden",
|
|
2512
2709
|
textOverflow: "ellipsis",
|
|
2513
2710
|
textWrap: "nowrap",
|
|
2514
|
-
children:
|
|
2711
|
+
children: w
|
|
2515
2712
|
}),
|
|
2516
|
-
|
|
2713
|
+
c.isSorted && /* @__PURE__ */ L(r, {
|
|
2517
2714
|
ps: (t.inlineWidth ?? 0) < 58 ? 0 : 2,
|
|
2518
|
-
children: /* @__PURE__ */
|
|
2715
|
+
children: /* @__PURE__ */ L(Ct, {
|
|
2519
2716
|
width: "16px",
|
|
2520
|
-
rotate:
|
|
2717
|
+
rotate: c.sortDirection === "ASC" ? 0 : 180,
|
|
2718
|
+
transition: "transform",
|
|
2719
|
+
transitionTimingFunction: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
2720
|
+
transitionDuration: 180,
|
|
2721
|
+
motionReduce: { transition: "none" },
|
|
2521
2722
|
fill: "currentColor"
|
|
2522
2723
|
})
|
|
2523
2724
|
}),
|
|
2524
|
-
|
|
2725
|
+
f && /* @__PURE__ */ L(r, { minWidth: t.isEndAligned ? 4 : 10 })
|
|
2525
2726
|
]
|
|
2526
2727
|
})
|
|
2527
2728
|
}),
|
|
2528
|
-
d && /* @__PURE__ */
|
|
2729
|
+
d && /* @__PURE__ */ L(Nt, {
|
|
2529
2730
|
column: t,
|
|
2530
2731
|
controls: x
|
|
2531
2732
|
}),
|
|
2532
|
-
|
|
2733
|
+
f && /* @__PURE__ */ L(Ot, { column: t })
|
|
2533
2734
|
] })
|
|
2534
2735
|
});
|
|
2535
2736
|
}
|
|
2536
|
-
|
|
2737
|
+
Pt.displayName = "DataGridHeaderCell";
|
|
2537
2738
|
//#endregion
|
|
2538
2739
|
//#region src/components/dataGrid/components/dataGridHeader.tsx
|
|
2539
|
-
function
|
|
2540
|
-
let { grid: t } = e
|
|
2541
|
-
|
|
2740
|
+
function Ft(e) {
|
|
2741
|
+
let { grid: t } = e, n = N(null), [i, a] = P(X.INITIAL), o = t.headerHover === "sliding", s = (e) => {
|
|
2742
|
+
let t = n.current;
|
|
2743
|
+
if (!o || !t || e.pointerType === "touch") return;
|
|
2744
|
+
if (X.isOnResizer(e.target)) return a((e) => X.pause(e));
|
|
2745
|
+
let r = X.cellAt(t, e.target), i = r && X.bounds(t, r);
|
|
2746
|
+
a((e) => X.hover(e, i));
|
|
2747
|
+
}, c = () => a((e) => X.hover(e, void 0)), l = i.visible || i.paused;
|
|
2748
|
+
k(() => {
|
|
2749
|
+
if (l) return document.addEventListener("scroll", c, {
|
|
2750
|
+
capture: !0,
|
|
2751
|
+
passive: !0
|
|
2752
|
+
}), () => document.removeEventListener("scroll", c, { capture: !0 });
|
|
2753
|
+
}, [l]);
|
|
2754
|
+
let { bounds: u } = i;
|
|
2755
|
+
return /* @__PURE__ */ R(b, {
|
|
2756
|
+
ref: n,
|
|
2542
2757
|
component: `${t.componentName}.header`,
|
|
2543
|
-
props: {
|
|
2758
|
+
props: {
|
|
2759
|
+
role: "rowgroup",
|
|
2760
|
+
onPointerMove: o ? s : void 0,
|
|
2761
|
+
onPointerLeave: o ? c : void 0
|
|
2762
|
+
},
|
|
2544
2763
|
style: { gridTemplateColumns: t.gridTemplateColumns.value },
|
|
2545
|
-
children: [
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2764
|
+
children: [
|
|
2765
|
+
t.headerRows.value.map((e, t) => /* @__PURE__ */ L(r, {
|
|
2766
|
+
display: "contents",
|
|
2767
|
+
props: {
|
|
2768
|
+
role: "row",
|
|
2769
|
+
"aria-rowindex": t + 1
|
|
2770
|
+
},
|
|
2771
|
+
children: e.map((e, n) => /* @__PURE__ */ L(Pt, {
|
|
2772
|
+
column: e,
|
|
2773
|
+
row: t,
|
|
2774
|
+
columnIndex: n
|
|
2775
|
+
}, e.uniqueKey))
|
|
2776
|
+
}, t)),
|
|
2777
|
+
/* @__PURE__ */ L(St, { grid: t }),
|
|
2778
|
+
o && u && /* @__PURE__ */ L(r, {
|
|
2779
|
+
tag: "span",
|
|
2780
|
+
component: `${t.componentName}.header.hover`,
|
|
2781
|
+
variant: {
|
|
2782
|
+
visible: i.visible,
|
|
2783
|
+
backward: i.backward,
|
|
2784
|
+
entering: i.entering
|
|
2785
|
+
},
|
|
2786
|
+
style: {
|
|
2787
|
+
left: `${u.left}px`,
|
|
2788
|
+
right: `${u.right}px`,
|
|
2789
|
+
top: `${u.top}px`,
|
|
2790
|
+
bottom: `${u.bottom}px`
|
|
2791
|
+
},
|
|
2792
|
+
props: { "aria-hidden": !0 }
|
|
2793
|
+
})
|
|
2794
|
+
]
|
|
2557
2795
|
});
|
|
2558
2796
|
}
|
|
2559
|
-
|
|
2797
|
+
Ft.displayName = "DataGridHeader";
|
|
2798
|
+
var It = D(Ft);
|
|
2560
2799
|
//#endregion
|
|
2561
2800
|
//#region src/components/dataGrid/components/dataGridLoader.tsx
|
|
2562
|
-
function
|
|
2801
|
+
function Lt(e) {
|
|
2563
2802
|
let { grid: t } = e;
|
|
2564
|
-
return /* @__PURE__ */
|
|
2803
|
+
return /* @__PURE__ */ L(r, {
|
|
2565
2804
|
component: `${t.componentName}.loader`,
|
|
2566
2805
|
props: { "aria-hidden": !0 },
|
|
2567
|
-
children: /* @__PURE__ */
|
|
2806
|
+
children: /* @__PURE__ */ L(r, {
|
|
2568
2807
|
component: `${t.componentName}.loader.track`,
|
|
2569
2808
|
style: { height: 3 },
|
|
2570
|
-
children: /* @__PURE__ */
|
|
2809
|
+
children: /* @__PURE__ */ L(r, {
|
|
2571
2810
|
component: `${t.componentName}.loader.track.bar`,
|
|
2572
2811
|
width: "2/5"
|
|
2573
2812
|
})
|
|
2574
2813
|
})
|
|
2575
2814
|
});
|
|
2576
2815
|
}
|
|
2577
|
-
|
|
2816
|
+
Lt.displayName = "DataGridLoader";
|
|
2578
2817
|
//#endregion
|
|
2579
2818
|
//#region src/components/dataGrid/components/dataGridContent.tsx
|
|
2580
|
-
function
|
|
2581
|
-
let { grid: t } = e, i =
|
|
2819
|
+
function Rt(e) {
|
|
2820
|
+
let { grid: t } = e, i = N(null), [a, o] = P({
|
|
2582
2821
|
top: 0,
|
|
2583
2822
|
direction: "down"
|
|
2584
|
-
}), s =
|
|
2823
|
+
}), s = N(null), c = O((e) => {
|
|
2585
2824
|
o((t) => e === t.top ? t : {
|
|
2586
2825
|
top: e,
|
|
2587
|
-
direction:
|
|
2826
|
+
direction: he.directionOf(t.top, e, t.direction)
|
|
2588
2827
|
});
|
|
2589
|
-
}, []), l =
|
|
2828
|
+
}, []), l = O((e) => {
|
|
2590
2829
|
s.current !== null && cancelAnimationFrame(s.current), s.current = requestAnimationFrame(() => {
|
|
2591
2830
|
c(e.target.scrollTop), s.current = null;
|
|
2592
2831
|
});
|
|
2593
|
-
}, [c]), { navigation: u, onKeyDown: d } =
|
|
2832
|
+
}, [c]), { navigation: u, onKeyDown: d } = Ne({
|
|
2594
2833
|
grid: t,
|
|
2595
2834
|
scrollerRef: i,
|
|
2596
2835
|
scroll: a,
|
|
@@ -2598,7 +2837,7 @@ function Dt(e) {
|
|
|
2598
2837
|
}), { source: f } = t, { queryVersion: p } = f;
|
|
2599
2838
|
n(() => {
|
|
2600
2839
|
f.enabled && i.current && (i.current.scrollTop = 0);
|
|
2601
|
-
}, [f, p]),
|
|
2840
|
+
}, [f, p]), k(() => {
|
|
2602
2841
|
if (!f.enabled) return;
|
|
2603
2842
|
let { startIndex: e, take: n } = t.viewport.window(i.current?.scrollTop ?? 0, a.direction);
|
|
2604
2843
|
f.request(e, e + n);
|
|
@@ -2613,7 +2852,7 @@ function Dt(e) {
|
|
|
2613
2852
|
t.expansionVersion
|
|
2614
2853
|
]);
|
|
2615
2854
|
let { range: m } = t, { isDragging: h } = m;
|
|
2616
|
-
return
|
|
2855
|
+
return k(() => {
|
|
2617
2856
|
if (h) return window.addEventListener("pointerup", m.endDrag), window.addEventListener("pointercancel", m.endDrag), () => {
|
|
2618
2857
|
window.removeEventListener("pointerup", m.endDrag), window.removeEventListener("pointercancel", m.endDrag);
|
|
2619
2858
|
};
|
|
@@ -2622,9 +2861,9 @@ function Dt(e) {
|
|
|
2622
2861
|
if (!e) return;
|
|
2623
2862
|
let n = new ResizeObserver(() => t.setContainerWidth(e.clientWidth));
|
|
2624
2863
|
return n.observe(e), () => n.disconnect();
|
|
2625
|
-
}, [t]), t.hasVisibleColumns ? /* @__PURE__ */
|
|
2864
|
+
}, [t]), t.hasVisibleColumns ? /* @__PURE__ */ L(fe.Provider, {
|
|
2626
2865
|
value: u,
|
|
2627
|
-
children: /* @__PURE__ */
|
|
2866
|
+
children: /* @__PURE__ */ R(r, {
|
|
2628
2867
|
ref: i,
|
|
2629
2868
|
component: `${t.componentName}.content`,
|
|
2630
2869
|
overflowX: "auto",
|
|
@@ -2643,62 +2882,65 @@ function Dt(e) {
|
|
|
2643
2882
|
onPaste: m.onPaste
|
|
2644
2883
|
},
|
|
2645
2884
|
children: [
|
|
2646
|
-
/* @__PURE__ */
|
|
2647
|
-
|
|
2648
|
-
|
|
2885
|
+
/* @__PURE__ */ L(It, {
|
|
2886
|
+
grid: t,
|
|
2887
|
+
version: t.headerVersion
|
|
2888
|
+
}),
|
|
2889
|
+
(t.props.loading || f.isLoading) && /* @__PURE__ */ L(Lt, { grid: t }),
|
|
2890
|
+
/* @__PURE__ */ L(ut, {
|
|
2649
2891
|
grid: t,
|
|
2650
2892
|
scroll: a
|
|
2651
2893
|
})
|
|
2652
2894
|
]
|
|
2653
2895
|
})
|
|
2654
|
-
}) : /* @__PURE__ */
|
|
2896
|
+
}) : /* @__PURE__ */ L(dt, { grid: t });
|
|
2655
2897
|
}
|
|
2656
|
-
|
|
2898
|
+
Rt.displayName = "DataGridContent";
|
|
2657
2899
|
//#endregion
|
|
2658
2900
|
//#region src/components/dataGrid/components/dataGridDataSourceError.tsx
|
|
2659
|
-
function
|
|
2901
|
+
function zt(e) {
|
|
2660
2902
|
let { grid: t } = e, { error: n } = t.source;
|
|
2661
2903
|
if (n === void 0) return null;
|
|
2662
|
-
let i = n instanceof Error && n.message ? n.message :
|
|
2663
|
-
return /* @__PURE__ */
|
|
2904
|
+
let i = n instanceof Error && n.message ? n.message : t.localeText.loadError;
|
|
2905
|
+
return /* @__PURE__ */ R(m, {
|
|
2664
2906
|
component: `${t.componentName}.error`,
|
|
2665
2907
|
props: { role: "alert" },
|
|
2666
|
-
children: [/* @__PURE__ */
|
|
2908
|
+
children: [/* @__PURE__ */ L(r, {
|
|
2667
2909
|
component: `${t.componentName}.error.message`,
|
|
2668
2910
|
children: i
|
|
2669
|
-
}), /* @__PURE__ */
|
|
2911
|
+
}), /* @__PURE__ */ L(p, {
|
|
2670
2912
|
component: `${t.componentName}.error.retry`,
|
|
2671
2913
|
type: "button",
|
|
2672
2914
|
onClick: t.source.retry,
|
|
2673
|
-
children:
|
|
2915
|
+
children: t.localeText.retry
|
|
2674
2916
|
})]
|
|
2675
2917
|
});
|
|
2676
2918
|
}
|
|
2677
|
-
|
|
2919
|
+
zt.displayName = "DataGridDataSourceError";
|
|
2678
2920
|
//#endregion
|
|
2679
2921
|
//#region src/components/dataGrid/components/dataGridColumnGroups.tsx
|
|
2680
|
-
function
|
|
2922
|
+
function Bt(e) {
|
|
2681
2923
|
let { grid: t } = e;
|
|
2682
|
-
return t.groupColumns.size === 0 ? null : /* @__PURE__ */
|
|
2924
|
+
return t.groupColumns.size === 0 ? null : /* @__PURE__ */ R(m, {
|
|
2683
2925
|
component: `${t.componentName}.topBar.columnGroups`,
|
|
2684
|
-
children: [/* @__PURE__ */
|
|
2926
|
+
children: [/* @__PURE__ */ L(S, {
|
|
2685
2927
|
component: `${t.componentName}.topBar.columnGroups.icon`,
|
|
2686
|
-
children: /* @__PURE__ */
|
|
2928
|
+
children: /* @__PURE__ */ L(Tt, {
|
|
2687
2929
|
width: "100%",
|
|
2688
2930
|
fill: "currentColor"
|
|
2689
2931
|
})
|
|
2690
|
-
}), t.groupedColumns.map((e) => /* @__PURE__ */
|
|
2932
|
+
}), t.groupedColumns.map((e) => /* @__PURE__ */ R(C.Fragment, { children: [/* @__PURE__ */ L(Y, {
|
|
2691
2933
|
fill: "currentColor",
|
|
2692
2934
|
width: "14px",
|
|
2693
2935
|
height: "14px",
|
|
2694
2936
|
rotate: -90
|
|
2695
|
-
}), /* @__PURE__ */
|
|
2937
|
+
}), /* @__PURE__ */ R(m, {
|
|
2696
2938
|
component: `${t.componentName}.topBar.columnGroups.item`,
|
|
2697
|
-
children: [e.header ?? e.key, /* @__PURE__ */
|
|
2939
|
+
children: [e.header ?? e.key, /* @__PURE__ */ L(p, {
|
|
2698
2940
|
component: `${t.componentName}.topBar.columnGroups.item.icon`,
|
|
2699
2941
|
onClick: () => t.toggleGrouping(e.key),
|
|
2700
|
-
props: { "aria-label":
|
|
2701
|
-
children: /* @__PURE__ */
|
|
2942
|
+
props: { "aria-label": t.localeText.stopGrouping(String(e.header ?? e.key)) },
|
|
2943
|
+
children: /* @__PURE__ */ L(r, {
|
|
2702
2944
|
fontSize: 10,
|
|
2703
2945
|
color: "gray-400",
|
|
2704
2946
|
hover: { color: "gray-600" },
|
|
@@ -2708,47 +2950,47 @@ function kt(e) {
|
|
|
2708
2950
|
})] }, e.key))]
|
|
2709
2951
|
});
|
|
2710
2952
|
}
|
|
2711
|
-
|
|
2953
|
+
Bt.displayName = "DataGridColumnGroups";
|
|
2712
2954
|
//#endregion
|
|
2713
2955
|
//#region src/components/dataGrid/components/dataGridExport.tsx
|
|
2714
|
-
function
|
|
2715
|
-
let { grid: t } = e, n = t.exportConfig, r =
|
|
2716
|
-
return n ? /* @__PURE__ */
|
|
2956
|
+
function Vt(e) {
|
|
2957
|
+
let { grid: t } = e, n = t.exportConfig, r = O(() => void t.exportCsv(n).catch(() => void 0), [t, n]), i = O(() => void t.exportXlsx(n).catch(() => void 0), [t, n]);
|
|
2958
|
+
return n ? /* @__PURE__ */ R(m, {
|
|
2717
2959
|
component: `${t.componentName}.topBar.export`,
|
|
2718
2960
|
ai: "center",
|
|
2719
2961
|
gap: 2,
|
|
2720
|
-
children: [n.csv !== !1 && /* @__PURE__ */
|
|
2962
|
+
children: [n.csv !== !1 && /* @__PURE__ */ L(Ht, {
|
|
2721
2963
|
componentName: t.componentName,
|
|
2722
2964
|
onClick: r,
|
|
2723
|
-
label:
|
|
2724
|
-
children:
|
|
2725
|
-
}), n.xlsx !== !1 && /* @__PURE__ */
|
|
2965
|
+
label: t.localeText.exportCsvLabel,
|
|
2966
|
+
children: t.localeText.exportCsv
|
|
2967
|
+
}), n.xlsx !== !1 && /* @__PURE__ */ L(Ht, {
|
|
2726
2968
|
componentName: t.componentName,
|
|
2727
2969
|
onClick: i,
|
|
2728
|
-
label:
|
|
2729
|
-
children:
|
|
2970
|
+
label: t.localeText.exportExcelLabel,
|
|
2971
|
+
children: t.localeText.exportExcel
|
|
2730
2972
|
})]
|
|
2731
2973
|
}) : null;
|
|
2732
2974
|
}
|
|
2733
|
-
|
|
2734
|
-
function
|
|
2975
|
+
Vt.displayName = "DataGridExport";
|
|
2976
|
+
function Ht(e) {
|
|
2735
2977
|
let { componentName: t, onClick: n, label: r, children: i } = e;
|
|
2736
|
-
return /* @__PURE__ */
|
|
2978
|
+
return /* @__PURE__ */ R(p, {
|
|
2737
2979
|
component: `${t}.topBar.export.button`,
|
|
2738
2980
|
onClick: n,
|
|
2739
2981
|
props: { "aria-label": r },
|
|
2740
|
-
children: [/* @__PURE__ */
|
|
2982
|
+
children: [/* @__PURE__ */ R(d, {
|
|
2741
2983
|
viewBox: "0 0 20 20",
|
|
2742
2984
|
width: 16,
|
|
2743
2985
|
height: 16,
|
|
2744
2986
|
fill: "none",
|
|
2745
2987
|
stroke: "currentColor",
|
|
2746
2988
|
strokeWidth: 1.6,
|
|
2747
|
-
children: [/* @__PURE__ */
|
|
2989
|
+
children: [/* @__PURE__ */ L(u, {
|
|
2748
2990
|
d: "M10 3v9m0 0 3.5-3.5M10 12 6.5 8.5",
|
|
2749
2991
|
strokeLinecap: "round",
|
|
2750
2992
|
strokeLinejoin: "round"
|
|
2751
|
-
}), /* @__PURE__ */
|
|
2993
|
+
}), /* @__PURE__ */ L(u, {
|
|
2752
2994
|
d: "M3.5 13.5v2a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-2",
|
|
2753
2995
|
strokeLinecap: "round"
|
|
2754
2996
|
})]
|
|
@@ -2757,62 +2999,56 @@ function jt(e) {
|
|
|
2757
2999
|
}
|
|
2758
3000
|
//#endregion
|
|
2759
3001
|
//#region src/icons/searchIcon.tsx
|
|
2760
|
-
function
|
|
2761
|
-
return /* @__PURE__ */
|
|
3002
|
+
function Ut(e) {
|
|
3003
|
+
return /* @__PURE__ */ L(d, {
|
|
2762
3004
|
viewBox: "0 0 488.4 488.4",
|
|
2763
3005
|
width: "1.5rem",
|
|
2764
3006
|
...e,
|
|
2765
|
-
children: /* @__PURE__ */
|
|
3007
|
+
children: /* @__PURE__ */ L(u, { 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" })
|
|
2766
3008
|
});
|
|
2767
3009
|
}
|
|
2768
3010
|
//#endregion
|
|
2769
3011
|
//#region src/components/dataGrid/components/dataGridGlobalFilter.tsx
|
|
2770
|
-
function
|
|
2771
|
-
let { grid: t } = e, [n, i] =
|
|
2772
|
-
O(() => () => {
|
|
2773
|
-
a.current && clearTimeout(a.current);
|
|
2774
|
-
}, []);
|
|
2775
|
-
let o = E((e) => {
|
|
3012
|
+
function Wt(e) {
|
|
3013
|
+
let { grid: t } = e, [n, i] = P(t.globalFilterValue), { debounce: a, cancel: o } = ht(t.globalFilterValue, (e) => e === n, i), s = O((e) => {
|
|
2776
3014
|
let n = e.target.value;
|
|
2777
|
-
i(n), a
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
}, [t]),
|
|
2781
|
-
|
|
2782
|
-
}, [t]), { filtered: c, total: l } = t.filter.filterStats, u = t.filter.hasActiveFilters && c !== l;
|
|
2783
|
-
return /* @__PURE__ */ F(f, {
|
|
3015
|
+
i(n), a("value", () => t.filter.setGlobalFilter(n));
|
|
3016
|
+
}, [t, a]), c = O(() => {
|
|
3017
|
+
o(), i(""), t.filter.setGlobalFilter("");
|
|
3018
|
+
}, [t, o]), { filtered: l, total: u } = t.filter.filterStats, d = !t.props.def.bottomBar && t.filter.hasActiveFilters && l !== u;
|
|
3019
|
+
return /* @__PURE__ */ R(m, {
|
|
2784
3020
|
component: `${t.componentName}.topBar.globalFilter`,
|
|
2785
|
-
children: [
|
|
3021
|
+
children: [d && /* @__PURE__ */ R(r, {
|
|
2786
3022
|
component: `${t.componentName}.topBar.globalFilter.stats`,
|
|
2787
3023
|
children: [
|
|
2788
|
-
|
|
3024
|
+
l,
|
|
2789
3025
|
"/",
|
|
2790
|
-
|
|
3026
|
+
u
|
|
2791
3027
|
]
|
|
2792
|
-
}), /* @__PURE__ */
|
|
3028
|
+
}), /* @__PURE__ */ R(m, {
|
|
2793
3029
|
position: "relative",
|
|
2794
3030
|
ai: "center",
|
|
2795
3031
|
children: [
|
|
2796
|
-
/* @__PURE__ */
|
|
3032
|
+
/* @__PURE__ */ L(m, {
|
|
2797
3033
|
position: "absolute",
|
|
2798
3034
|
insetStart: 3,
|
|
2799
3035
|
pointerEvents: "none",
|
|
2800
3036
|
color: "gray-400",
|
|
2801
3037
|
theme: { dark: { color: "gray-500" } },
|
|
2802
|
-
children: /* @__PURE__ */
|
|
3038
|
+
children: /* @__PURE__ */ L(Ut, {
|
|
2803
3039
|
fill: "currentColor",
|
|
2804
3040
|
width: "14px"
|
|
2805
3041
|
})
|
|
2806
3042
|
}),
|
|
2807
|
-
/* @__PURE__ */
|
|
2808
|
-
placeholder:
|
|
3043
|
+
/* @__PURE__ */ L(y, {
|
|
3044
|
+
placeholder: t.localeText.searchPlaceholder,
|
|
2809
3045
|
variant: "compact",
|
|
2810
3046
|
value: n,
|
|
2811
|
-
onChange:
|
|
3047
|
+
onChange: s,
|
|
2812
3048
|
ps: 8,
|
|
2813
3049
|
pe: n ? 8 : 3
|
|
2814
3050
|
}),
|
|
2815
|
-
n && /* @__PURE__ */
|
|
3051
|
+
n && /* @__PURE__ */ L(r, {
|
|
2816
3052
|
position: "absolute",
|
|
2817
3053
|
insetEnd: 2,
|
|
2818
3054
|
cursor: "pointer",
|
|
@@ -2823,8 +3059,8 @@ function Nt(e) {
|
|
|
2823
3059
|
color: "gray-500",
|
|
2824
3060
|
hover: { color: "gray-300" }
|
|
2825
3061
|
} },
|
|
2826
|
-
props: { onClick:
|
|
2827
|
-
children: /* @__PURE__ */
|
|
3062
|
+
props: { onClick: c },
|
|
3063
|
+
children: /* @__PURE__ */ L(r, {
|
|
2828
3064
|
fontSize: 12,
|
|
2829
3065
|
fontWeight: 600,
|
|
2830
3066
|
children: "✕"
|
|
@@ -2836,9 +3072,9 @@ function Nt(e) {
|
|
|
2836
3072
|
}
|
|
2837
3073
|
//#endregion
|
|
2838
3074
|
//#region src/components/dataGrid/components/dataGridTopBarContextMenu.tsx
|
|
2839
|
-
function
|
|
3075
|
+
function Gt(e) {
|
|
2840
3076
|
let { grid: t } = e, { columnVisibility: n } = t, { entries: i, selectedIds: a, total: o, hasHidden: s } = n;
|
|
2841
|
-
return /* @__PURE__ */
|
|
3077
|
+
return /* @__PURE__ */ R(x, {
|
|
2842
3078
|
component: `${t.componentName}.topBar.columnVisibility`,
|
|
2843
3079
|
multiple: !0,
|
|
2844
3080
|
showCheckbox: !0,
|
|
@@ -2849,21 +3085,21 @@ function Pt(e) {
|
|
|
2849
3085
|
n.setVisibility(t);
|
|
2850
3086
|
},
|
|
2851
3087
|
isSearchable: i.length > 6,
|
|
2852
|
-
searchPlaceholder:
|
|
3088
|
+
searchPlaceholder: t.localeText.columnsMenuSearchPlaceholder,
|
|
2853
3089
|
display: "inline-flex",
|
|
2854
|
-
props: { "aria-label":
|
|
3090
|
+
props: { "aria-label": t.localeText.columnsMenu },
|
|
2855
3091
|
children: [
|
|
2856
|
-
/* @__PURE__ */
|
|
3092
|
+
/* @__PURE__ */ L(x.Display, { children: (e) => {
|
|
2857
3093
|
let n = e.length === 0;
|
|
2858
|
-
return /* @__PURE__ */
|
|
3094
|
+
return /* @__PURE__ */ R(m, {
|
|
2859
3095
|
ai: "center",
|
|
2860
3096
|
gap: 2,
|
|
2861
|
-
children: [/* @__PURE__ */
|
|
3097
|
+
children: [/* @__PURE__ */ R(f, {
|
|
2862
3098
|
viewBox: "0 0 20 20",
|
|
2863
3099
|
width: "18",
|
|
2864
3100
|
height: "18",
|
|
2865
3101
|
children: [
|
|
2866
|
-
/* @__PURE__ */
|
|
3102
|
+
/* @__PURE__ */ L("rect", {
|
|
2867
3103
|
x: "2",
|
|
2868
3104
|
y: "3",
|
|
2869
3105
|
width: "4",
|
|
@@ -2872,7 +3108,7 @@ function Pt(e) {
|
|
|
2872
3108
|
fill: "currentColor",
|
|
2873
3109
|
opacity: .9
|
|
2874
3110
|
}),
|
|
2875
|
-
/* @__PURE__ */
|
|
3111
|
+
/* @__PURE__ */ L("rect", {
|
|
2876
3112
|
x: "8",
|
|
2877
3113
|
y: "3",
|
|
2878
3114
|
width: "4",
|
|
@@ -2881,7 +3117,7 @@ function Pt(e) {
|
|
|
2881
3117
|
fill: "currentColor",
|
|
2882
3118
|
opacity: .6
|
|
2883
3119
|
}),
|
|
2884
|
-
/* @__PURE__ */
|
|
3120
|
+
/* @__PURE__ */ L("rect", {
|
|
2885
3121
|
x: "14",
|
|
2886
3122
|
y: "3",
|
|
2887
3123
|
width: "4",
|
|
@@ -2891,7 +3127,7 @@ function Pt(e) {
|
|
|
2891
3127
|
opacity: .3
|
|
2892
3128
|
})
|
|
2893
3129
|
]
|
|
2894
|
-
}), s && /* @__PURE__ */
|
|
3130
|
+
}), s && /* @__PURE__ */ R(r, {
|
|
2895
3131
|
component: `${t.componentName}.topBar.columnVisibility.badge`,
|
|
2896
3132
|
tag: "span",
|
|
2897
3133
|
fontSize: 11,
|
|
@@ -2914,9 +3150,9 @@ function Pt(e) {
|
|
|
2914
3150
|
})]
|
|
2915
3151
|
});
|
|
2916
3152
|
} }),
|
|
2917
|
-
/* @__PURE__ */
|
|
2918
|
-
/* @__PURE__ */
|
|
2919
|
-
i.map((e) => /* @__PURE__ */
|
|
3153
|
+
/* @__PURE__ */ L(x.SelectAll, { children: t.localeText.columnsMenuShowAll }),
|
|
3154
|
+
/* @__PURE__ */ L(x.Unselect, { children: t.localeText.columnsMenuHideAll }),
|
|
3155
|
+
i.map((e) => /* @__PURE__ */ L(x.Item, {
|
|
2920
3156
|
value: e.id,
|
|
2921
3157
|
textWrap: "nowrap",
|
|
2922
3158
|
children: e.label
|
|
@@ -2924,30 +3160,30 @@ function Pt(e) {
|
|
|
2924
3160
|
]
|
|
2925
3161
|
});
|
|
2926
3162
|
}
|
|
2927
|
-
|
|
3163
|
+
Gt.displayName = "DataGridTopBarContextMenu";
|
|
2928
3164
|
//#endregion
|
|
2929
3165
|
//#region src/components/dataGrid/components/dataGridTopBar.tsx
|
|
2930
|
-
function
|
|
3166
|
+
function Kt(e) {
|
|
2931
3167
|
let { grid: t } = e, { title: n, topBarContent: i, globalFilter: a } = t.props.def;
|
|
2932
|
-
return /* @__PURE__ */
|
|
3168
|
+
return /* @__PURE__ */ R(m, {
|
|
2933
3169
|
component: `${t.componentName}.topBar`,
|
|
2934
3170
|
position: "relative",
|
|
2935
3171
|
d: "column",
|
|
2936
3172
|
gap: 3,
|
|
2937
|
-
children: [/* @__PURE__ */
|
|
3173
|
+
children: [/* @__PURE__ */ R(m, {
|
|
2938
3174
|
ai: "center",
|
|
2939
3175
|
jc: "space-between",
|
|
2940
3176
|
gap: 4,
|
|
2941
3177
|
flexWrap: "wrap",
|
|
2942
3178
|
width: "fit",
|
|
2943
|
-
children: [/* @__PURE__ */
|
|
3179
|
+
children: [/* @__PURE__ */ R(m, {
|
|
2944
3180
|
ai: "center",
|
|
2945
3181
|
gap: 3,
|
|
2946
3182
|
flexWrap: "wrap",
|
|
2947
3183
|
minWidth: 0,
|
|
2948
3184
|
children: [
|
|
2949
|
-
/* @__PURE__ */
|
|
2950
|
-
n && /* @__PURE__ */
|
|
3185
|
+
/* @__PURE__ */ L(Gt, { grid: t }),
|
|
3186
|
+
n && /* @__PURE__ */ L(r, {
|
|
2951
3187
|
id: t.titleId,
|
|
2952
3188
|
fontWeight: 600,
|
|
2953
3189
|
fontSize: 16,
|
|
@@ -2955,24 +3191,24 @@ function Ft(e) {
|
|
|
2955
3191
|
theme: { dark: { color: "gray-100" } },
|
|
2956
3192
|
children: n
|
|
2957
3193
|
}),
|
|
2958
|
-
/* @__PURE__ */
|
|
3194
|
+
/* @__PURE__ */ L(Bt, { grid: t })
|
|
2959
3195
|
]
|
|
2960
|
-
}), /* @__PURE__ */
|
|
3196
|
+
}), /* @__PURE__ */ R(m, {
|
|
2961
3197
|
ai: "center",
|
|
2962
3198
|
gap: 3,
|
|
2963
3199
|
flexWrap: "wrap",
|
|
2964
|
-
children: [a && /* @__PURE__ */
|
|
3200
|
+
children: [a && /* @__PURE__ */ L(Wt, { grid: t }), /* @__PURE__ */ L(Vt, { grid: t })]
|
|
2965
3201
|
})]
|
|
2966
|
-
}), i && /* @__PURE__ */
|
|
3202
|
+
}), i && /* @__PURE__ */ L(r, {
|
|
2967
3203
|
width: "fit",
|
|
2968
3204
|
children: i
|
|
2969
3205
|
})]
|
|
2970
3206
|
});
|
|
2971
3207
|
}
|
|
2972
|
-
|
|
3208
|
+
Kt.displayName = "DataGridTopBar";
|
|
2973
3209
|
//#endregion
|
|
2974
3210
|
//#region src/utils/string/fuzzySearch.ts
|
|
2975
|
-
function
|
|
3211
|
+
function qt(e, t) {
|
|
2976
3212
|
if (!e) return {
|
|
2977
3213
|
score: 1,
|
|
2978
3214
|
matches: []
|
|
@@ -2985,16 +3221,16 @@ function It(e, t) {
|
|
|
2985
3221
|
matches: o
|
|
2986
3222
|
});
|
|
2987
3223
|
}
|
|
2988
|
-
function
|
|
2989
|
-
return
|
|
3224
|
+
function Jt(e, t) {
|
|
3225
|
+
return qt(e, t) !== null;
|
|
2990
3226
|
}
|
|
2991
3227
|
//#endregion
|
|
2992
3228
|
//#region src/components/dataGrid/components/dataGridCellRowDetail.tsx
|
|
2993
|
-
function
|
|
2994
|
-
let { cell: t } = e, n = t.isExpanded, r =
|
|
3229
|
+
function Yt(e) {
|
|
3230
|
+
let { cell: t } = e, n = t.isExpanded, r = O((e) => {
|
|
2995
3231
|
e.stopPropagation(), t.toggleDetail();
|
|
2996
3232
|
}, [t]);
|
|
2997
|
-
return /* @__PURE__ */
|
|
3233
|
+
return /* @__PURE__ */ L(p, {
|
|
2998
3234
|
component: `${t.grid.componentName}.body.cell.rowDetail`,
|
|
2999
3235
|
variant: { isExpanded: n },
|
|
3000
3236
|
type: "button",
|
|
@@ -3007,10 +3243,10 @@ function Rt(e) {
|
|
|
3007
3243
|
height: "fit",
|
|
3008
3244
|
props: {
|
|
3009
3245
|
tabIndex: -1,
|
|
3010
|
-
"aria-label":
|
|
3246
|
+
"aria-label": (n ? t.grid.localeText.collapseRowDetail : t.grid.localeText.expandRowDetail)(t.row.rowIndex + 1),
|
|
3011
3247
|
"aria-expanded": n
|
|
3012
3248
|
},
|
|
3013
|
-
children: /* @__PURE__ */
|
|
3249
|
+
children: /* @__PURE__ */ L(Y, {
|
|
3014
3250
|
fill: "currentColor",
|
|
3015
3251
|
width: "14px",
|
|
3016
3252
|
height: "14px",
|
|
@@ -3018,33 +3254,33 @@ function Rt(e) {
|
|
|
3018
3254
|
})
|
|
3019
3255
|
});
|
|
3020
3256
|
}
|
|
3021
|
-
|
|
3257
|
+
Yt.displayName = "DataGridCellRowDetail";
|
|
3022
3258
|
//#endregion
|
|
3023
3259
|
//#region src/components/dataGrid/components/dataGridCellRowSelection.tsx
|
|
3024
|
-
function
|
|
3025
|
-
let { cell: t } = e, n =
|
|
3260
|
+
function Xt(e) {
|
|
3261
|
+
let { cell: t } = e, n = O(() => {
|
|
3026
3262
|
t.toggleSelection();
|
|
3027
3263
|
}, [t]);
|
|
3028
|
-
return /* @__PURE__ */
|
|
3264
|
+
return /* @__PURE__ */ L(h, {
|
|
3029
3265
|
variant: "datagrid",
|
|
3030
3266
|
checked: t.selected,
|
|
3031
3267
|
indeterminate: t.indeterminate,
|
|
3032
3268
|
onChange: n,
|
|
3033
3269
|
props: {
|
|
3034
3270
|
tabIndex: -1,
|
|
3035
|
-
"aria-label":
|
|
3271
|
+
"aria-label": t.grid.localeText.selectRow(t.row.rowIndex + 1)
|
|
3036
3272
|
}
|
|
3037
3273
|
});
|
|
3038
3274
|
}
|
|
3039
|
-
|
|
3275
|
+
Xt.displayName = "DataGridCellRowSelection";
|
|
3040
3276
|
//#endregion
|
|
3041
3277
|
//#region src/components/dataGrid/contracts/dataGridContract.ts
|
|
3042
|
-
function
|
|
3278
|
+
function Zt(e) {
|
|
3043
3279
|
if (e) return e === "LEFT" ? "START" : e === "RIGHT" ? "END" : e;
|
|
3044
3280
|
}
|
|
3045
3281
|
//#endregion
|
|
3046
3282
|
//#region src/components/dataGrid/models/headerCellModel.ts
|
|
3047
|
-
var
|
|
3283
|
+
var Qt = 1e3, $t = class {
|
|
3048
3284
|
column;
|
|
3049
3285
|
constructor(e) {
|
|
3050
3286
|
this.column = e;
|
|
@@ -3057,21 +3293,24 @@ var Vt = 1e3, Ht = class {
|
|
|
3057
3293
|
if (e.isRowNumber || e.isRowSelection) return null;
|
|
3058
3294
|
if (e.isGrouping) {
|
|
3059
3295
|
if (this.grid.groupColumns.size === 1) {
|
|
3060
|
-
let e = this.grid.groupColumns.values().next().value, t =
|
|
3296
|
+
let e = this.grid.groupColumns.values().next().value, t = G.findOrThrow(this.grid.columns.value.leafs, (t) => t.key === e);
|
|
3061
3297
|
return t.header ?? t.key;
|
|
3062
3298
|
}
|
|
3063
|
-
return
|
|
3299
|
+
return this.grid.localeText.groupHeader;
|
|
3064
3300
|
}
|
|
3065
3301
|
return e.header ?? e.key;
|
|
3066
3302
|
}
|
|
3067
3303
|
get hiddenLabel() {
|
|
3068
|
-
if (this.column.isRowNumber) return
|
|
3069
|
-
if (this.column.isRowDetail) return
|
|
3304
|
+
if (this.column.isRowNumber) return this.grid.localeText.rowNumberHeader;
|
|
3305
|
+
if (this.column.isRowDetail) return this.grid.localeText.rowDetailHeader;
|
|
3070
3306
|
}
|
|
3071
3307
|
get isSortable() {
|
|
3072
3308
|
let e = this.column;
|
|
3073
3309
|
return e.isLeaf && !e.isRowNumber && !e.isRowSelection && !e.isRowDetail && e.sortable;
|
|
3074
3310
|
}
|
|
3311
|
+
get hasHoverPill() {
|
|
3312
|
+
return this.isSortable && this.grid.headerHover === "static";
|
|
3313
|
+
}
|
|
3075
3314
|
get isSorted() {
|
|
3076
3315
|
return this.column.key === this.grid.sortColumn;
|
|
3077
3316
|
}
|
|
@@ -3105,7 +3344,7 @@ var Vt = 1e3, Ht = class {
|
|
|
3105
3344
|
if (this.isSortable) return !this.isSorted || !this.sortDirection ? "none" : this.sortDirection === "ASC" ? "ascending" : "descending";
|
|
3106
3345
|
}
|
|
3107
3346
|
get resizerLabel() {
|
|
3108
|
-
return
|
|
3347
|
+
return this.grid.localeText.resizeColumn(String(this.label ?? this.column.key));
|
|
3109
3348
|
}
|
|
3110
3349
|
get width() {
|
|
3111
3350
|
return this.column.inlineWidth ?? this.column.baseWidth;
|
|
@@ -3114,7 +3353,7 @@ var Vt = 1e3, Ht = class {
|
|
|
3114
3353
|
return Math.max(1, this.column.leafs.length) * this.grid.MIN_COLUMN_WIDTH_PX;
|
|
3115
3354
|
}
|
|
3116
3355
|
get maxWidth() {
|
|
3117
|
-
return Math.max(this.grid.containerWidth ||
|
|
3356
|
+
return Math.max(this.grid.containerWidth || Qt, this.width, this.minWidth);
|
|
3118
3357
|
}
|
|
3119
3358
|
get paddingStart() {
|
|
3120
3359
|
if (!this.column.isRowSelection) return this.column.isEndAligned ? 10 : 3;
|
|
@@ -3131,6 +3370,9 @@ var Vt = 1e3, Ht = class {
|
|
|
3131
3370
|
isFirstEndPinned: r,
|
|
3132
3371
|
isLastEndPinned: i,
|
|
3133
3372
|
isSortable: this.isSortable,
|
|
3373
|
+
hasHoverPill: this.hasHoverPill,
|
|
3374
|
+
isPillBeforeResizer: this.hasHoverPill && this.showResizer && this.column.pin !== "END",
|
|
3375
|
+
isPillAfterResizer: this.hasHoverPill && this.showResizer && this.column.pin === "END",
|
|
3134
3376
|
isRowNumber: this.column.isRowNumber,
|
|
3135
3377
|
isFirstLeaf: this.column.isFirstLeaf,
|
|
3136
3378
|
isLastLeaf: this.column.isLastLeaf
|
|
@@ -3196,16 +3438,16 @@ var Vt = 1e3, Ht = class {
|
|
|
3196
3438
|
pin: t.pin
|
|
3197
3439
|
} : r, n, this)) ?? [], this.isLeaf) {
|
|
3198
3440
|
let e = this.grid.columnWidths.get(this.key);
|
|
3199
|
-
this._inlineWidth = e ?? this.def.width ?? this.grid.DEFAULT_COLUMN_WIDTH_PX, this._pin =
|
|
3441
|
+
this._inlineWidth = e ?? this.def.width ?? this.grid.DEFAULT_COLUMN_WIDTH_PX, this._pin = Zt(t.pin);
|
|
3200
3442
|
}
|
|
3201
3443
|
}
|
|
3202
3444
|
columns = [];
|
|
3203
3445
|
get kind() {
|
|
3204
3446
|
switch (this.key) {
|
|
3205
|
-
case
|
|
3206
|
-
case
|
|
3207
|
-
case
|
|
3208
|
-
case
|
|
3447
|
+
case Fe: return "rowNumber";
|
|
3448
|
+
case Ie: return "rowSelection";
|
|
3449
|
+
case Le: return "rowDetail";
|
|
3450
|
+
case K: return "grouping";
|
|
3209
3451
|
default: return "data";
|
|
3210
3452
|
}
|
|
3211
3453
|
}
|
|
@@ -3224,7 +3466,7 @@ var Vt = 1e3, Ht = class {
|
|
|
3224
3466
|
get isData() {
|
|
3225
3467
|
return this.kind === "data";
|
|
3226
3468
|
}
|
|
3227
|
-
pinFlags =
|
|
3469
|
+
pinFlags = H(() => {
|
|
3228
3470
|
let e = this.pin === "START", t = this.pin === "END";
|
|
3229
3471
|
return {
|
|
3230
3472
|
isStartPinned: e,
|
|
@@ -3236,7 +3478,7 @@ var Vt = 1e3, Ht = class {
|
|
|
3236
3478
|
isLastEndPinned: t && this.endOffset === 0
|
|
3237
3479
|
};
|
|
3238
3480
|
}, () => [this.grid.columns]);
|
|
3239
|
-
cellVariant =
|
|
3481
|
+
cellVariant = H(() => {
|
|
3240
3482
|
let { isPinned: e, isFirstStartPinned: t, isLastStartPinned: n, isFirstEndPinned: r, isLastEndPinned: i } = this.pinFlags.value;
|
|
3241
3483
|
return {
|
|
3242
3484
|
isPinned: e,
|
|
@@ -3251,7 +3493,7 @@ var Vt = 1e3, Ht = class {
|
|
|
3251
3493
|
isRowDetail: this.isRowDetail
|
|
3252
3494
|
};
|
|
3253
3495
|
}, () => [this.pinFlags]);
|
|
3254
|
-
cellStyleVars =
|
|
3496
|
+
cellStyleVars = H(() => {
|
|
3255
3497
|
let { isStartPinned: e, isEndPinned: t } = this.pinFlags.value;
|
|
3256
3498
|
return {
|
|
3257
3499
|
width: `var(${this.widthVarName})`,
|
|
@@ -3260,7 +3502,7 @@ var Vt = 1e3, Ht = class {
|
|
|
3260
3502
|
insetInlineEnd: t ? `var(${this.inlineEndVarName})` : void 0
|
|
3261
3503
|
};
|
|
3262
3504
|
}, () => [this.pinFlags]);
|
|
3263
|
-
_headerCell =
|
|
3505
|
+
_headerCell = H(() => new $t(this));
|
|
3264
3506
|
get headerCell() {
|
|
3265
3507
|
return this._headerCell.value;
|
|
3266
3508
|
}
|
|
@@ -3315,7 +3557,7 @@ var Vt = 1e3, Ht = class {
|
|
|
3315
3557
|
get filterOptions() {
|
|
3316
3558
|
let e = this.filterConfig;
|
|
3317
3559
|
return e?.type === "multiselect" && e.options ? e.options : this.grid.getColumnUniqueValues(this.key).map((e) => ({
|
|
3318
|
-
label: e === null ?
|
|
3560
|
+
label: e === null ? this.grid.localeText.filterEmptyValue : String(e),
|
|
3319
3561
|
value: e
|
|
3320
3562
|
}));
|
|
3321
3563
|
}
|
|
@@ -3421,16 +3663,16 @@ var Vt = 1e3, Ht = class {
|
|
|
3421
3663
|
get inlineWidth() {
|
|
3422
3664
|
if (this.isLeaf) return this.grid.getFlexWidth(this.key) ?? this._inlineWidth;
|
|
3423
3665
|
let e = this.visibleColumns.map((e) => e.inlineWidth).filter((e) => typeof e == "number");
|
|
3424
|
-
if (e.length !== 0) return
|
|
3666
|
+
if (e.length !== 0) return G.sumBy(e, (e) => e);
|
|
3425
3667
|
}
|
|
3426
3668
|
get startOffset() {
|
|
3427
3669
|
let e = 0;
|
|
3428
3670
|
if (this.parent) {
|
|
3429
3671
|
let { visibleColumns: t, startOffset: n } = this.parent, r = t.findIndex((e) => e === this);
|
|
3430
|
-
e +=
|
|
3672
|
+
e += G.sumBy(t, (e, t) => t < r ? e.inlineWidth ?? 0 : 0), e += n;
|
|
3431
3673
|
} else {
|
|
3432
3674
|
let t = this.grid.columns.value.start.filter((e) => e.isVisible), n = t.findIndex((e) => e === this);
|
|
3433
|
-
e +=
|
|
3675
|
+
e += G.sumBy(t, (e, t) => t < n ? e.inlineWidth ?? 0 : 0);
|
|
3434
3676
|
}
|
|
3435
3677
|
return e;
|
|
3436
3678
|
}
|
|
@@ -3438,10 +3680,10 @@ var Vt = 1e3, Ht = class {
|
|
|
3438
3680
|
let e = 0;
|
|
3439
3681
|
if (this.parent) {
|
|
3440
3682
|
let { visibleColumns: t } = this.parent, n = t.reverse(), r = n.findIndex((e) => e === this);
|
|
3441
|
-
e +=
|
|
3683
|
+
e += G.sumBy(n, (e, t) => t < r ? e.inlineWidth ?? 0 : 0), e += this.parent.endOffset;
|
|
3442
3684
|
} else {
|
|
3443
3685
|
let t = this.grid.columns.value.end.filter((e) => e.isVisible).reverse(), n = t.findIndex((e) => e === this);
|
|
3444
|
-
e +=
|
|
3686
|
+
e += G.sumBy(t, (e, t) => t < n ? e.inlineWidth ?? 0 : 0);
|
|
3445
3687
|
}
|
|
3446
3688
|
return e;
|
|
3447
3689
|
}
|
|
@@ -3479,7 +3721,7 @@ var Vt = 1e3, Ht = class {
|
|
|
3479
3721
|
_resizeTotalWidth = 0;
|
|
3480
3722
|
beginResize = (e) => {
|
|
3481
3723
|
let { MIN_COLUMN_WIDTH_PX: t } = this.grid;
|
|
3482
|
-
this._resizeStartX = e, this._resizeSizes =
|
|
3724
|
+
this._resizeStartX = e, this._resizeSizes = G.toRecord(this.leafs, (e) => [e.key, e.inlineWidth ?? e.baseWidth]), this._resizeTotalWidth = G.sumBy(this.leafs, (e) => this._resizeSizes[e.key]) - this.leafs.length * t;
|
|
3483
3725
|
};
|
|
3484
3726
|
get resizeSign() {
|
|
3485
3727
|
return this.pin === "END" === this.grid.isRtl ? 1 : -1;
|
|
@@ -3505,7 +3747,7 @@ var Vt = 1e3, Ht = class {
|
|
|
3505
3747
|
this.moveResizer((e - t) * this.resizeSign);
|
|
3506
3748
|
};
|
|
3507
3749
|
pinColumn = (e) => {
|
|
3508
|
-
this.isLeaf ? this._pin =
|
|
3750
|
+
this.isLeaf ? this._pin = Zt(e) : this.columns.forEach((t) => t.pinColumn(e)), this.grid.pinColumn(this.uniqueKey, e);
|
|
3509
3751
|
};
|
|
3510
3752
|
toggleGrouping = () => {
|
|
3511
3753
|
this.grid.toggleGrouping(this.key);
|
|
@@ -3520,7 +3762,7 @@ var Vt = 1e3, Ht = class {
|
|
|
3520
3762
|
toggleVisibility = () => {
|
|
3521
3763
|
this.grid.toggleColumnVisibility(this.key);
|
|
3522
3764
|
};
|
|
3523
|
-
},
|
|
3765
|
+
}, en = class {
|
|
3524
3766
|
grid;
|
|
3525
3767
|
constructor(e) {
|
|
3526
3768
|
this.grid = e;
|
|
@@ -3555,19 +3797,19 @@ var Vt = 1e3, Ht = class {
|
|
|
3555
3797
|
};
|
|
3556
3798
|
//#endregion
|
|
3557
3799
|
//#region src/utils/array/lazyList.ts
|
|
3558
|
-
function
|
|
3800
|
+
function tn(e, t) {
|
|
3559
3801
|
return new Proxy([], {
|
|
3560
3802
|
get(n, r, i) {
|
|
3561
3803
|
if (r === "length") return e;
|
|
3562
|
-
let a =
|
|
3804
|
+
let a = nn(r, e);
|
|
3563
3805
|
return a === void 0 ? Reflect.get(n, r, i) : t(a);
|
|
3564
3806
|
},
|
|
3565
3807
|
has(t, n) {
|
|
3566
|
-
return
|
|
3808
|
+
return nn(n, e) !== void 0 || Reflect.has(t, n);
|
|
3567
3809
|
},
|
|
3568
3810
|
getOwnPropertyDescriptor(n, r) {
|
|
3569
|
-
return
|
|
3570
|
-
value: t(
|
|
3811
|
+
return nn(r, e) === void 0 ? Reflect.getOwnPropertyDescriptor(n, r) : {
|
|
3812
|
+
value: t(nn(r, e)),
|
|
3571
3813
|
writable: !0,
|
|
3572
3814
|
enumerable: !0,
|
|
3573
3815
|
configurable: !0
|
|
@@ -3575,7 +3817,7 @@ function Wt(e, t) {
|
|
|
3575
3817
|
}
|
|
3576
3818
|
});
|
|
3577
3819
|
}
|
|
3578
|
-
function
|
|
3820
|
+
function nn(e, t) {
|
|
3579
3821
|
if (typeof e != "string") return;
|
|
3580
3822
|
let n = Number(e);
|
|
3581
3823
|
return Number.isInteger(n) && n >= 0 && n < t ? n : void 0;
|
|
@@ -3706,7 +3948,7 @@ var $ = class e {
|
|
|
3706
3948
|
}), this.source.changed());
|
|
3707
3949
|
});
|
|
3708
3950
|
}
|
|
3709
|
-
},
|
|
3951
|
+
}, rn = class extends Ge {
|
|
3710
3952
|
level;
|
|
3711
3953
|
constructor(e, t, n, r) {
|
|
3712
3954
|
super(e, n, [], r, ""), this.level = t;
|
|
@@ -3728,7 +3970,7 @@ var $ = class e {
|
|
|
3728
3970
|
return [...this.level.groupKeys, this.groupValue];
|
|
3729
3971
|
}
|
|
3730
3972
|
get key() {
|
|
3731
|
-
return this.placeholder ? `${this.level.placeholderKey}-group-${this.rowIndex}` :
|
|
3973
|
+
return this.placeholder ? `${this.level.placeholderKey}-group-${this.rowIndex}` : an(this.groupKeys);
|
|
3732
3974
|
}
|
|
3733
3975
|
get depth() {
|
|
3734
3976
|
return this.level.depth;
|
|
@@ -3764,21 +4006,21 @@ var $ = class e {
|
|
|
3764
4006
|
this.placeholder || this.grid.toggleGroupRow(this.key);
|
|
3765
4007
|
}
|
|
3766
4008
|
};
|
|
3767
|
-
function
|
|
4009
|
+
function an(e) {
|
|
3768
4010
|
return `rb-group:${$.keyOf(e)}`;
|
|
3769
4011
|
}
|
|
3770
4012
|
//#endregion
|
|
3771
4013
|
//#region src/components/dataGrid/models/sourceRowModel.ts
|
|
3772
|
-
var
|
|
4014
|
+
var on = {}, sn = class extends W {
|
|
3773
4015
|
sourceLevel;
|
|
3774
4016
|
constructor(e, t, n) {
|
|
3775
|
-
super(e,
|
|
4017
|
+
super(e, on, n), this.sourceLevel = t;
|
|
3776
4018
|
}
|
|
3777
4019
|
get row() {
|
|
3778
4020
|
return this.sourceLevel.rowAt(this.rowIndex);
|
|
3779
4021
|
}
|
|
3780
4022
|
get data() {
|
|
3781
|
-
return this.row ??
|
|
4023
|
+
return this.row ?? on;
|
|
3782
4024
|
}
|
|
3783
4025
|
get placeholder() {
|
|
3784
4026
|
return this.row === void 0;
|
|
@@ -3796,7 +4038,7 @@ var Jt = {}, Yt = class extends W {
|
|
|
3796
4038
|
get selected() {
|
|
3797
4039
|
return !this.placeholder && super.selected;
|
|
3798
4040
|
}
|
|
3799
|
-
},
|
|
4041
|
+
}, cn = class extends sn {
|
|
3800
4042
|
isTreeRow = !0;
|
|
3801
4043
|
get level() {
|
|
3802
4044
|
return this.sourceLevel.depth;
|
|
@@ -3816,7 +4058,7 @@ var Jt = {}, Yt = class extends W {
|
|
|
3816
4058
|
toggleTree = () => {
|
|
3817
4059
|
this.hasChildren && this.grid.tree.toggle(this.key, this.level);
|
|
3818
4060
|
};
|
|
3819
|
-
},
|
|
4061
|
+
}, ln = 100, un = 40, dn = class {
|
|
3820
4062
|
grid;
|
|
3821
4063
|
constructor(e) {
|
|
3822
4064
|
this.grid = e;
|
|
@@ -3842,11 +4084,11 @@ var Jt = {}, Yt = class extends W {
|
|
|
3842
4084
|
}
|
|
3843
4085
|
get blockSize() {
|
|
3844
4086
|
let e = this.config?.blockSize;
|
|
3845
|
-
return e && e > 0 ? Math.floor(e) : this.grid.isPaginated ? this.grid.pageSize :
|
|
4087
|
+
return e && e > 0 ? Math.floor(e) : this.grid.isPaginated ? this.grid.pageSize : ln;
|
|
3846
4088
|
}
|
|
3847
4089
|
get maxBlocks() {
|
|
3848
4090
|
let e = this.config?.maxBlocks;
|
|
3849
|
-
return e && e > 0 ? Math.floor(e) :
|
|
4091
|
+
return e && e > 0 ? Math.floor(e) : un;
|
|
3850
4092
|
}
|
|
3851
4093
|
get queryVersion() {
|
|
3852
4094
|
return this._query;
|
|
@@ -3901,7 +4143,7 @@ var Jt = {}, Yt = class extends W {
|
|
|
3901
4143
|
return e.loadedBlocks().forEach(({ index: a, rows: o }) => {
|
|
3902
4144
|
o.forEach((o, s) => {
|
|
3903
4145
|
let c = [...e.path, o[r]];
|
|
3904
|
-
if (!t.has(
|
|
4146
|
+
if (!t.has(an(c))) return;
|
|
3905
4147
|
let l = a * n + s;
|
|
3906
4148
|
i.push({
|
|
3907
4149
|
rowIndex: l,
|
|
@@ -3955,20 +4197,20 @@ var Jt = {}, Yt = class extends W {
|
|
|
3955
4197
|
listLength = -1;
|
|
3956
4198
|
rowList() {
|
|
3957
4199
|
let { start: e } = this.visibleRange();
|
|
3958
|
-
return this.listLength = this.visibleLength(),
|
|
4200
|
+
return this.listLength = this.visibleLength(), tn(this.listLength, (t) => this.rowModelAt(e + t));
|
|
3959
4201
|
}
|
|
3960
4202
|
flatRowList(e) {
|
|
3961
4203
|
let t = this.detailPositions();
|
|
3962
|
-
return t.length === 0 ? e :
|
|
3963
|
-
let r =
|
|
3964
|
-
return t[r] === n ? new
|
|
4204
|
+
return t.length === 0 ? e : tn(e.length + t.length, (n) => {
|
|
4205
|
+
let r = pn(t, n);
|
|
4206
|
+
return t[r] === n ? new De(this.grid, e[n - r - 1]) : e[n - r];
|
|
3965
4207
|
});
|
|
3966
4208
|
}
|
|
3967
4209
|
rowOffsets(e) {
|
|
3968
4210
|
let { rowHeight: t } = this.grid, n = this.detailPositions(), r = [0];
|
|
3969
4211
|
return n.forEach((t, n) => r.push(r[n] + e[t].heightForOffset)), {
|
|
3970
|
-
offsets:
|
|
3971
|
-
let i =
|
|
4212
|
+
offsets: tn(e.length, (e) => {
|
|
4213
|
+
let i = pn(n, e);
|
|
3972
4214
|
return (e - i) * t + r[i];
|
|
3973
4215
|
}),
|
|
3974
4216
|
totalHeight: (e.length - n.length) * t + r[n.length]
|
|
@@ -3997,7 +4239,7 @@ var Jt = {}, Yt = class extends W {
|
|
|
3997
4239
|
let i = this.levels.get(r);
|
|
3998
4240
|
!i || i.isGroupLevel || i.loadedBlocks().forEach(({ index: r, rows: i }) => {
|
|
3999
4241
|
i.forEach((i, a) => {
|
|
4000
|
-
let o =
|
|
4242
|
+
let o = fn(n, r * t + a);
|
|
4001
4243
|
o !== void 0 && e(o, i);
|
|
4002
4244
|
});
|
|
4003
4245
|
});
|
|
@@ -4005,14 +4247,14 @@ var Jt = {}, Yt = class extends W {
|
|
|
4005
4247
|
}
|
|
4006
4248
|
rowModelAt(e) {
|
|
4007
4249
|
let t = this.segmentAt(e);
|
|
4008
|
-
if (!t) return new
|
|
4250
|
+
if (!t) return new sn(this.grid, this.root, e);
|
|
4009
4251
|
let { level: n } = t, r = t.levelStart + (e - t.start), i = this.models.get(n.key);
|
|
4010
4252
|
i || this.models.set(n.key, i = /* @__PURE__ */ new Map());
|
|
4011
4253
|
let a = i.get(r);
|
|
4012
|
-
return a || (a = n.isGroupLevel ? new
|
|
4254
|
+
return a || (a = n.isGroupLevel ? new rn(this.grid, n, this.groupColumnAt(n.depth), r) : this.isTree ? new cn(this.grid, n, r) : new sn(this.grid, n, r), i.set(r, a)), a;
|
|
4013
4255
|
}
|
|
4014
4256
|
groupColumnAt(e) {
|
|
4015
|
-
return
|
|
4257
|
+
return G.findOrThrow(this.grid.columns.value.leafs, (t) => t.key === this.groupBy[e]);
|
|
4016
4258
|
}
|
|
4017
4259
|
visibleLength() {
|
|
4018
4260
|
let { start: e, end: t } = this.visibleRange();
|
|
@@ -4098,10 +4340,10 @@ var Jt = {}, Yt = class extends W {
|
|
|
4098
4340
|
this._segments = void 0, this._byLevel = void 0, this.listLength !== this.visibleLength() && this.grid.rows.clear(), this.grid.flatRows.clear(), this.grid.notify();
|
|
4099
4341
|
}
|
|
4100
4342
|
};
|
|
4101
|
-
function
|
|
4343
|
+
function fn(e, t) {
|
|
4102
4344
|
for (let n of e) if (t >= n.levelStart && t < n.levelStart + n.length) return n.start + (t - n.levelStart);
|
|
4103
4345
|
}
|
|
4104
|
-
function
|
|
4346
|
+
function pn(e, t) {
|
|
4105
4347
|
let n = 0, r = e.length;
|
|
4106
4348
|
for (; n < r;) {
|
|
4107
4349
|
let i = n + r >>> 1;
|
|
@@ -4111,7 +4353,7 @@ function tn(e, t) {
|
|
|
4111
4353
|
}
|
|
4112
4354
|
//#endregion
|
|
4113
4355
|
//#region src/components/dataGrid/models/exportModel.ts
|
|
4114
|
-
var
|
|
4356
|
+
var mn = 7, hn = class {
|
|
4115
4357
|
grid;
|
|
4116
4358
|
constructor(e) {
|
|
4117
4359
|
this.grid = e;
|
|
@@ -4125,7 +4367,7 @@ var nn = 7, rn = class {
|
|
|
4125
4367
|
}
|
|
4126
4368
|
width(e) {
|
|
4127
4369
|
let t = e.inlineWidth ?? this.grid.DEFAULT_COLUMN_WIDTH_PX;
|
|
4128
|
-
return Math.min(80, Math.max(6, Math.round(t /
|
|
4370
|
+
return Math.min(80, Math.max(6, Math.round(t / mn * 10) / 10));
|
|
4129
4371
|
}
|
|
4130
4372
|
value(e, t) {
|
|
4131
4373
|
let { exportValue: n } = e.def, r = n ? n(t) : t[e.key];
|
|
@@ -4133,7 +4375,7 @@ var nn = 7, rn = class {
|
|
|
4133
4375
|
}
|
|
4134
4376
|
aggregateOf(e, t) {
|
|
4135
4377
|
let n = e.aggregate;
|
|
4136
|
-
return n ?
|
|
4378
|
+
return n ? Ve(n, t.map((t) => this.value(e, t)), t) : null;
|
|
4137
4379
|
}
|
|
4138
4380
|
table(e = {}) {
|
|
4139
4381
|
let t = this.columns(e.columns), n = e.groups ?? !0, r = [], i = (e, a, o) => {
|
|
@@ -4148,7 +4390,7 @@ var nn = 7, rn = class {
|
|
|
4148
4390
|
}), i(s.rows, n ? a + 1 : a, o || n && e);
|
|
4149
4391
|
} else {
|
|
4150
4392
|
if (s.placeholder) continue;
|
|
4151
|
-
let e =
|
|
4393
|
+
let e = Oe(s) ? s.level : a;
|
|
4152
4394
|
r.push({
|
|
4153
4395
|
kind: "data",
|
|
4154
4396
|
level: e,
|
|
@@ -4194,10 +4436,10 @@ var nn = 7, rn = class {
|
|
|
4194
4436
|
};
|
|
4195
4437
|
}
|
|
4196
4438
|
fileName(e = {}) {
|
|
4197
|
-
let { title: t } = this.grid.props.def, n = typeof t == "string" && t.trim() ? t.trim() :
|
|
4439
|
+
let { title: t } = this.grid.props.def, n = typeof t == "string" && t.trim() ? t.trim() : this.grid.localeText.exportFileName;
|
|
4198
4440
|
return e.fileName?.trim() || n;
|
|
4199
4441
|
}
|
|
4200
|
-
},
|
|
4442
|
+
}, gn = class {
|
|
4201
4443
|
grid;
|
|
4202
4444
|
constructor(e) {
|
|
4203
4445
|
this.grid = e;
|
|
@@ -4219,7 +4461,80 @@ var nn = 7, rn = class {
|
|
|
4219
4461
|
}
|
|
4220
4462
|
setGlobalFilter = (e) => this.grid.setGlobalFilter(e);
|
|
4221
4463
|
clearAllFilters = () => this.grid.clearAllFilters();
|
|
4222
|
-
},
|
|
4464
|
+
}, _n = {
|
|
4465
|
+
searchPlaceholder: "Search...",
|
|
4466
|
+
columnsMenu: "Columns",
|
|
4467
|
+
columnsMenuSearchPlaceholder: "Search columns...",
|
|
4468
|
+
columnsMenuShowAll: "Show All",
|
|
4469
|
+
columnsMenuHideAll: "Hide All",
|
|
4470
|
+
stopGrouping: (e) => `Stop grouping by ${e}`,
|
|
4471
|
+
exportCsv: "CSV",
|
|
4472
|
+
exportCsvLabel: "Export CSV",
|
|
4473
|
+
exportExcel: "Excel",
|
|
4474
|
+
exportExcelLabel: "Export Excel",
|
|
4475
|
+
exportFileName: "export",
|
|
4476
|
+
selectAllRows: "Select all rows",
|
|
4477
|
+
rowNumberHeader: "Row number",
|
|
4478
|
+
rowDetailHeader: "Row details",
|
|
4479
|
+
groupHeader: "Group",
|
|
4480
|
+
columnOptions: (e) => `Column options for ${e}`,
|
|
4481
|
+
resizeColumn: (e) => `Resize ${e}`,
|
|
4482
|
+
columnWidth: (e) => `${e} pixels`,
|
|
4483
|
+
sortAscending: "Sort Ascending",
|
|
4484
|
+
sortDescending: "Sort Descending",
|
|
4485
|
+
clearSort: "Clear Sort",
|
|
4486
|
+
pinLeft: "Pin Left",
|
|
4487
|
+
pinRight: "Pin Right",
|
|
4488
|
+
unpin: "Unpin",
|
|
4489
|
+
groupBy: (e) => `Group by ${e}`,
|
|
4490
|
+
ungroupAll: "Un-Group All",
|
|
4491
|
+
filterPlaceholder: "Filter...",
|
|
4492
|
+
filterColumn: (e) => `Filter ${e}`,
|
|
4493
|
+
clearFilter: (e) => `Clear the ${e} filter`,
|
|
4494
|
+
filterComparison: (e) => `Comparison for ${e}`,
|
|
4495
|
+
filterValuePlaceholder: "Value",
|
|
4496
|
+
filterFromPlaceholder: "From",
|
|
4497
|
+
filterToPlaceholder: "To",
|
|
4498
|
+
filterFrom: (e) => `Filter ${e} from`,
|
|
4499
|
+
filterTo: (e) => `Filter ${e} to`,
|
|
4500
|
+
filterSelectPlaceholder: "Select...",
|
|
4501
|
+
filterSelectSearchPlaceholder: "Search...",
|
|
4502
|
+
filterSelectClear: "Clear",
|
|
4503
|
+
filterSelectAll: "Select All",
|
|
4504
|
+
filterEmptyValue: "(empty)",
|
|
4505
|
+
noRows: "empty",
|
|
4506
|
+
loadingRows: "loading...",
|
|
4507
|
+
selectRow: (e) => `Select row ${e}`,
|
|
4508
|
+
selectGroupRows: (e) => `Select all rows in ${e}`,
|
|
4509
|
+
expandRowDetail: (e) => `Expand details for row ${e}`,
|
|
4510
|
+
collapseRowDetail: (e) => `Collapse details for row ${e}`,
|
|
4511
|
+
expandTreeRow: (e) => `Expand ${e}`,
|
|
4512
|
+
collapseTreeRow: (e) => `Collapse ${e}`,
|
|
4513
|
+
unnamedRow: (e) => `row ${e}`,
|
|
4514
|
+
editCell: (e) => `Edit ${e}`,
|
|
4515
|
+
invalidValue: "Invalid value",
|
|
4516
|
+
wrongKindOfValue: "Wrong kind of value",
|
|
4517
|
+
footerTotal: "Total",
|
|
4518
|
+
noColumnsTitle: "No Columns Selected",
|
|
4519
|
+
noColumnsDescription: "Select at least one column from the columns menu to display data",
|
|
4520
|
+
loadError: "Could not load rows.",
|
|
4521
|
+
retry: "Retry",
|
|
4522
|
+
rowCount: (e, t) => e === t ? `Rows: ${t}` : `Rows: ${e} / ${t}`,
|
|
4523
|
+
pageRowRange: (e, t, n) => n > 0 ? `Rows: ${e}–${t} of ${n}` : "Rows: 0",
|
|
4524
|
+
selectedCount: (e, t) => t > 0 ? `Selected: ${e} (${t} hidden)` : `Selected: ${e}`,
|
|
4525
|
+
clearFilters: "Clear filters",
|
|
4526
|
+
showSelected: "Show selected",
|
|
4527
|
+
clearSelection: "Clear selection",
|
|
4528
|
+
rowsPerPage: "Rows per page",
|
|
4529
|
+
pageSizeOption: (e) => `${e} / page`,
|
|
4530
|
+
pageNumber: "Page number",
|
|
4531
|
+
pageCount: (e) => `of ${e}`,
|
|
4532
|
+
firstPage: "First page",
|
|
4533
|
+
previousPage: "Previous page",
|
|
4534
|
+
nextPage: "Next page",
|
|
4535
|
+
lastPage: "Last page",
|
|
4536
|
+
selectionAnnouncement: (e, t) => e === 0 ? "No rows selected" : `${e} of ${t} rows selected`
|
|
4537
|
+
}, vn = class {
|
|
4223
4538
|
grid;
|
|
4224
4539
|
constructor(e) {
|
|
4225
4540
|
this.grid = e;
|
|
@@ -4275,16 +4590,16 @@ var nn = 7, rn = class {
|
|
|
4275
4590
|
let t = parseInt(e, 10);
|
|
4276
4591
|
isNaN(t) || this.grid.changePage(Math.max(1, Math.min(t, this.totalPages)));
|
|
4277
4592
|
};
|
|
4278
|
-
},
|
|
4279
|
-
function
|
|
4593
|
+
}, yn = /["\t\r\n]/;
|
|
4594
|
+
function bn(e) {
|
|
4280
4595
|
if (e == null) return "";
|
|
4281
4596
|
let t = e instanceof Date ? e.toISOString() : String(e);
|
|
4282
|
-
return
|
|
4597
|
+
return yn.test(t) ? `"${t.split("\"").join("\"\"")}"` : t;
|
|
4283
4598
|
}
|
|
4284
|
-
function
|
|
4285
|
-
return e.map((e) => e.map(
|
|
4599
|
+
function xn(e) {
|
|
4600
|
+
return e.map((e) => e.map(bn).join(" ")).join("\r\n");
|
|
4286
4601
|
}
|
|
4287
|
-
function
|
|
4602
|
+
function Sn(e) {
|
|
4288
4603
|
let t = [], n = [], r = "", i = !1;
|
|
4289
4604
|
for (let a = 0; a < e.length; a++) {
|
|
4290
4605
|
let o = e[a];
|
|
@@ -4292,10 +4607,10 @@ function un(e) {
|
|
|
4292
4607
|
}
|
|
4293
4608
|
return (r !== "" || n.length > 0) && (n.push(r), t.push(n)), t;
|
|
4294
4609
|
}
|
|
4295
|
-
function
|
|
4610
|
+
function Cn(e, t) {
|
|
4296
4611
|
return e?.row === t?.row && e?.column === t?.column;
|
|
4297
4612
|
}
|
|
4298
|
-
var
|
|
4613
|
+
var wn = class {
|
|
4299
4614
|
grid;
|
|
4300
4615
|
constructor(e) {
|
|
4301
4616
|
this.grid = e;
|
|
@@ -4332,18 +4647,22 @@ var fn = class {
|
|
|
4332
4647
|
let n = this.bounds;
|
|
4333
4648
|
return !n || !this.hasSelection ? !1 : e >= n.startRow && e <= n.endRow && t >= n.startColumn && t <= n.endColumn;
|
|
4334
4649
|
}
|
|
4650
|
+
rowDigest(e) {
|
|
4651
|
+
let t = this._focus?.row === e ? this._focus.column : -1, n = this.hasSelection ? this.bounds : void 0;
|
|
4652
|
+
return `${t}:${n && e >= n.startRow && e <= n.endRow ? `${n.startColumn}-${n.endColumn}` : ""}:${+this._dragging}`;
|
|
4653
|
+
}
|
|
4335
4654
|
setCurrent(e, t, n = !1) {
|
|
4336
4655
|
let r = {
|
|
4337
4656
|
row: e,
|
|
4338
4657
|
column: t
|
|
4339
4658
|
}, i = n && this._anchor ? this._anchor : r;
|
|
4340
|
-
|
|
4659
|
+
Cn(this._focus, r) && Cn(this._anchor, i) || (this._anchor = i, this._focus = r, this.grid.notifyRows(), this.emit(n ? "extend" : "select"));
|
|
4341
4660
|
}
|
|
4342
4661
|
syncCurrent(e, t) {
|
|
4343
4662
|
this.isCurrent(e, t) || this.setCurrent(e, t);
|
|
4344
4663
|
}
|
|
4345
4664
|
clear() {
|
|
4346
|
-
!this._focus && !this._anchor || (this._anchor = void 0, this._focus = void 0, this._dragging = !1, this.grid.
|
|
4665
|
+
!this._focus && !this._anchor || (this._anchor = void 0, this._focus = void 0, this._dragging = !1, this.grid.notifyRows(), this.emit("clear"));
|
|
4347
4666
|
}
|
|
4348
4667
|
press(e, t, n) {
|
|
4349
4668
|
this.setCurrent(e, t, n), n || (this._dragging = !0);
|
|
@@ -4352,7 +4671,7 @@ var fn = class {
|
|
|
4352
4671
|
this._dragging && this.setCurrent(e, t, !0);
|
|
4353
4672
|
}
|
|
4354
4673
|
endDrag = () => {
|
|
4355
|
-
this._dragging && (this._dragging = !1, this.grid.
|
|
4674
|
+
this._dragging && (this._dragging = !1, this.grid.notifyRows());
|
|
4356
4675
|
};
|
|
4357
4676
|
columnsOf(e = this.bounds) {
|
|
4358
4677
|
return e ? this.grid.columns.value.visibleLeafs.slice(e.startColumn, e.endColumn + 1) : [];
|
|
@@ -4388,7 +4707,7 @@ var fn = class {
|
|
|
4388
4707
|
onCopy = (e) => {
|
|
4389
4708
|
if (!this._focus || !e.clipboardData) return;
|
|
4390
4709
|
let t = e.currentTarget.ownerDocument.defaultView?.getSelection();
|
|
4391
|
-
t && !t.isCollapsed || (e.clipboardData.setData("text/plain",
|
|
4710
|
+
t && !t.isCollapsed || (e.clipboardData.setData("text/plain", xn(this.values())), e.preventDefault());
|
|
4392
4711
|
};
|
|
4393
4712
|
pasteBounds(e, t) {
|
|
4394
4713
|
let n = this.bounds;
|
|
@@ -4405,10 +4724,10 @@ var fn = class {
|
|
|
4405
4724
|
if (!this._focus || !e.clipboardData || this.grid.edits.isOpen || !this.grid.edits.enabled) return;
|
|
4406
4725
|
let t = e.clipboardData.getData("text/plain");
|
|
4407
4726
|
if (!t) return;
|
|
4408
|
-
let n =
|
|
4727
|
+
let n = Sn(t), r = n.reduce((e, t) => Math.max(e, t.length), 0), i = this.pasteBounds(n.length, r);
|
|
4409
4728
|
i && (e.preventDefault(), this.grid.edits.paste(i, (e, t) => n[e % n.length][t % r] ?? ""));
|
|
4410
4729
|
};
|
|
4411
|
-
},
|
|
4730
|
+
}, Tn = class extends W {
|
|
4412
4731
|
node;
|
|
4413
4732
|
level;
|
|
4414
4733
|
position;
|
|
@@ -4428,7 +4747,7 @@ var fn = class {
|
|
|
4428
4747
|
toggleTree = () => {
|
|
4429
4748
|
this.grid.tree.toggle(this.key, this.level);
|
|
4430
4749
|
};
|
|
4431
|
-
_subtreeKeys =
|
|
4750
|
+
_subtreeKeys = H(() => {
|
|
4432
4751
|
let e = [], t = (n) => {
|
|
4433
4752
|
n.forEach((n) => {
|
|
4434
4753
|
e.push(this.grid.getRowKey(n.data)), t(n.children);
|
|
@@ -4459,10 +4778,10 @@ var fn = class {
|
|
|
4459
4778
|
};
|
|
4460
4779
|
//#endregion
|
|
4461
4780
|
//#region src/components/dataGrid/models/treeModel.ts
|
|
4462
|
-
function
|
|
4781
|
+
function En(e) {
|
|
4463
4782
|
return JSON.stringify(e);
|
|
4464
4783
|
}
|
|
4465
|
-
var
|
|
4784
|
+
var Dn = class {
|
|
4466
4785
|
grid;
|
|
4467
4786
|
constructor(e) {
|
|
4468
4787
|
this.grid = e;
|
|
@@ -4516,9 +4835,9 @@ var hn = class {
|
|
|
4516
4835
|
data: e,
|
|
4517
4836
|
children: []
|
|
4518
4837
|
};
|
|
4519
|
-
n.set(
|
|
4838
|
+
n.set(En(r), i);
|
|
4520
4839
|
let a;
|
|
4521
|
-
for (let e = r.length - 1; e > 0 && !a; e--) a = n.get(
|
|
4840
|
+
for (let e = r.length - 1; e > 0 && !a; e--) a = n.get(En(r.slice(0, e)));
|
|
4522
4841
|
(a ? a.children : t).push(i);
|
|
4523
4842
|
}), t;
|
|
4524
4843
|
}
|
|
@@ -4534,17 +4853,17 @@ var hn = class {
|
|
|
4534
4853
|
}
|
|
4535
4854
|
sortNodes(e) {
|
|
4536
4855
|
let { sortColumn: t, sortDirection: n } = this.grid;
|
|
4537
|
-
return t === void 0 ? e :
|
|
4856
|
+
return t === void 0 ? e : G.sortBy(e, (e) => e.data[t], n).map((e) => ({
|
|
4538
4857
|
data: e.data,
|
|
4539
4858
|
children: this.sortNodes(e.children)
|
|
4540
4859
|
}));
|
|
4541
4860
|
}
|
|
4542
|
-
nodes =
|
|
4861
|
+
nodes = H(() => {
|
|
4543
4862
|
if (!this.isEager) return [];
|
|
4544
4863
|
let e = this.isFlat ? this.buildFlat(this.grid.data) : this.buildNested(this.grid.data);
|
|
4545
4864
|
return this.sortNodes(this.grid.hasRowFilters ? this.prune(e) : e);
|
|
4546
4865
|
});
|
|
4547
|
-
allRows =
|
|
4866
|
+
allRows = H(() => {
|
|
4548
4867
|
let e = [], t = (n) => {
|
|
4549
4868
|
n.forEach((n) => {
|
|
4550
4869
|
e.push(n.data), t(n.children);
|
|
@@ -4564,7 +4883,7 @@ var hn = class {
|
|
|
4564
4883
|
}
|
|
4565
4884
|
rowList() {
|
|
4566
4885
|
let e = 0, t = (n, r, i) => n.map((a, o) => {
|
|
4567
|
-
let s = new
|
|
4886
|
+
let s = new Tn(this.grid, a, e++, r, o, n.length, i);
|
|
4568
4887
|
return s.treeExpanded && (s.children = t(a.children, r + 1, s)), s;
|
|
4569
4888
|
});
|
|
4570
4889
|
return t(this.nodes.value, 0);
|
|
@@ -4606,7 +4925,7 @@ var hn = class {
|
|
|
4606
4925
|
let n = !this.isExpanded(e, t);
|
|
4607
4926
|
n ? (this._opened.add(e), this._closed.delete(e)) : (this._closed.add(e), this._opened.delete(e)), this.grid.treeExpansionChanged(), this.grid.props.onExpandedTreeKeysChange?.(this.expandedKeys(), { reason: n ? "expand" : "collapse" }), this.grid.notify();
|
|
4608
4927
|
};
|
|
4609
|
-
},
|
|
4928
|
+
}, On = {}, kn = class e {
|
|
4610
4929
|
props;
|
|
4611
4930
|
constructor(e, t) {
|
|
4612
4931
|
this.props = e, t && this.listeners.add(t);
|
|
@@ -4615,12 +4934,31 @@ var hn = class {
|
|
|
4615
4934
|
listeners = /* @__PURE__ */ new Set();
|
|
4616
4935
|
subscribe = (e) => (this.listeners.add(e), () => this.listeners.delete(e));
|
|
4617
4936
|
getSnapshot = () => this._version;
|
|
4937
|
+
static drawnPropsChanged(e, t) {
|
|
4938
|
+
let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
4939
|
+
for (let r of n) if (e[r] !== t[r] && typeof t[r] != "function") return !0;
|
|
4940
|
+
return !1;
|
|
4941
|
+
}
|
|
4942
|
+
_epoch = 0;
|
|
4618
4943
|
notify = () => {
|
|
4944
|
+
this._epoch++, this.notifyRows();
|
|
4945
|
+
};
|
|
4946
|
+
notifyRows = () => {
|
|
4619
4947
|
this._version++, this.listeners.forEach((e) => e());
|
|
4620
4948
|
};
|
|
4621
|
-
|
|
4622
|
-
let
|
|
4623
|
-
|
|
4949
|
+
rowVersion(e, t) {
|
|
4950
|
+
let n = `${this._epoch}|${this.range.rowDigest(t)}`;
|
|
4951
|
+
if (e.kind === "detail") return n;
|
|
4952
|
+
let r = `${+e.selected}${+e.indeterminate}${+e.expanded}`;
|
|
4953
|
+
return e.kind === "row" ? `${n}|${r}|${this.edits.rowDigest(e.key)}` : `${n}|${r}`;
|
|
4954
|
+
}
|
|
4955
|
+
_selectionVersion = 0;
|
|
4956
|
+
get headerVersion() {
|
|
4957
|
+
return `${this._epoch}:${this._selectionVersion}`;
|
|
4958
|
+
}
|
|
4959
|
+
setProps(t) {
|
|
4960
|
+
let n = this.props;
|
|
4961
|
+
n !== t && (e.drawnPropsChanged(n, t) && this._epoch++, this.props = t, n.def !== t.def && this.sourceColumns.clear(), (n.data !== t.data || n.def !== t.def || n.globalFilterValue !== t.globalFilterValue || n.columnFilters !== t.columnFilters || n.filters !== t.filters || n.expandedRowKeys !== t.expandedRowKeys || n.expandedTreeKeys !== t.expandedTreeKeys || n.page !== t.page || n.pageSize !== t.pageSize) && this.rows.clear(), (n.globalFilterValue !== t.globalFilterValue || n.columnFilters !== t.columnFilters || n.filters !== t.filters) && this.leaveSelectionView(), (n.data !== t.data || n.def !== t.def || n.globalFilterValue !== t.globalFilterValue || n.columnFilters !== t.columnFilters || n.filters !== t.filters) && this.tree.nodes.clear());
|
|
4624
4962
|
}
|
|
4625
4963
|
get data() {
|
|
4626
4964
|
return this.props.data ?? [];
|
|
@@ -4647,22 +4985,38 @@ var hn = class {
|
|
|
4647
4985
|
get resizeMode() {
|
|
4648
4986
|
return this.props.def.resizeMode ?? "smooth";
|
|
4649
4987
|
}
|
|
4650
|
-
|
|
4988
|
+
get headerHover() {
|
|
4989
|
+
return this.props.def.headerHover ?? "static";
|
|
4990
|
+
}
|
|
4991
|
+
_localeText;
|
|
4992
|
+
get localeText() {
|
|
4993
|
+
let e = this.props.def.localeText, t = this._localeText;
|
|
4994
|
+
if (t && t.from === e) return t.text;
|
|
4995
|
+
let n = {
|
|
4996
|
+
..._n,
|
|
4997
|
+
...e
|
|
4998
|
+
};
|
|
4999
|
+
return this._localeText = {
|
|
5000
|
+
from: e,
|
|
5001
|
+
text: n
|
|
5002
|
+
}, n;
|
|
5003
|
+
}
|
|
5004
|
+
sourceColumns = H(() => {
|
|
4651
5005
|
let { def: e } = this.props, t = [];
|
|
4652
|
-
if (this.groupColumns.size > 0 && t.push(new Q({ key:
|
|
5006
|
+
if (this.groupColumns.size > 0 && t.push(new Q({ key: K }, this)), t.push(...e.columns.map((e) => new Q(e, this))), e.rowSelection) {
|
|
4653
5007
|
let n = typeof e.rowSelection == "object" && e.rowSelection.pinned ? "START" : void 0;
|
|
4654
5008
|
t.unshift(new Q({
|
|
4655
|
-
key:
|
|
5009
|
+
key: Ie,
|
|
4656
5010
|
pin: n,
|
|
4657
5011
|
width: 50,
|
|
4658
5012
|
align: "center",
|
|
4659
|
-
Cell:
|
|
5013
|
+
Cell: Xt
|
|
4660
5014
|
}, this));
|
|
4661
5015
|
}
|
|
4662
5016
|
if (e.showRowNumber) {
|
|
4663
5017
|
let n, r = 70;
|
|
4664
5018
|
typeof e.showRowNumber == "object" && (e.showRowNumber.pinned && (n = "START"), r = e.showRowNumber.width ?? 70), t.unshift(new Q({
|
|
4665
|
-
key:
|
|
5019
|
+
key: Fe,
|
|
4666
5020
|
pin: n,
|
|
4667
5021
|
width: r,
|
|
4668
5022
|
align: "end"
|
|
@@ -4671,17 +5025,17 @@ var hn = class {
|
|
|
4671
5025
|
if (e.rowDetail) {
|
|
4672
5026
|
let n = e.rowDetail.pinned ? "START" : void 0, r = e.rowDetail.expandColumnWidth ?? 50, i = e.rowDetail.expandColumnHeader ?? "";
|
|
4673
5027
|
t.unshift(new Q({
|
|
4674
|
-
key:
|
|
5028
|
+
key: Le,
|
|
4675
5029
|
header: i,
|
|
4676
5030
|
pin: n,
|
|
4677
5031
|
width: r,
|
|
4678
5032
|
align: "center",
|
|
4679
|
-
Cell:
|
|
5033
|
+
Cell: Yt
|
|
4680
5034
|
}, this));
|
|
4681
5035
|
}
|
|
4682
5036
|
return t;
|
|
4683
5037
|
});
|
|
4684
|
-
columns =
|
|
5038
|
+
columns = H(() => {
|
|
4685
5039
|
let e = this.sourceColumns.value.map((e) => e.getPinnedColumn("START")).filter((e) => !!e), t = this.sourceColumns.value.map((e) => e.getPinnedColumn()).filter((e) => !!e), n = this.sourceColumns.value.map((e) => e.getPinnedColumn("END")).filter((e) => !!e), r = [
|
|
4686
5040
|
...e,
|
|
4687
5041
|
...t,
|
|
@@ -4695,24 +5049,24 @@ var hn = class {
|
|
|
4695
5049
|
leafs: i,
|
|
4696
5050
|
visibleLeafs: a,
|
|
4697
5051
|
userVisibleLeafs: a.filter((e) => ![
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
5052
|
+
Fe,
|
|
5053
|
+
Ie,
|
|
5054
|
+
K,
|
|
5055
|
+
Le
|
|
4702
5056
|
].includes(e.key)),
|
|
4703
|
-
maxDeath:
|
|
5057
|
+
maxDeath: G.maxBy(r, (e) => e.death) + 1
|
|
4704
5058
|
};
|
|
4705
5059
|
}, () => [this.sourceColumns]);
|
|
4706
|
-
headerRows =
|
|
4707
|
-
let t =
|
|
5060
|
+
headerRows = H(() => G.sortBy(G.groupBy(this.columns.value.flat, (e) => e.death), (e) => e.key).map((e) => {
|
|
5061
|
+
let t = G.toRecord(G.groupBy(e.values, (e) => e.pin ?? "NO_PIN"), (e) => [e.key, e.values]);
|
|
4708
5062
|
return [
|
|
4709
5063
|
...t.START?.filter((e) => e.isVisible) ?? [],
|
|
4710
5064
|
...t.NO_PIN?.filter((e) => e.isVisible) ?? [],
|
|
4711
5065
|
...t.END?.filter((e) => e.isVisible) ?? []
|
|
4712
5066
|
];
|
|
4713
5067
|
}), () => [this.columns]);
|
|
4714
|
-
gridTemplateColumns =
|
|
4715
|
-
let { visibleLeafs: e } = this.columns.value, t =
|
|
5068
|
+
gridTemplateColumns = H(() => {
|
|
5069
|
+
let { visibleLeafs: e } = this.columns.value, t = G.sumBy(e, (e) => +(e.pin === "END")), n = e.length - t;
|
|
4716
5070
|
return `${n > 0 ? `repeat(${n}, max-content)` : ""} ${t > 0 ? `repeat(${t}, max-content)` : ""}`.trim();
|
|
4717
5071
|
}, () => [this.columns]);
|
|
4718
5072
|
_globalFilterValue = "";
|
|
@@ -4723,7 +5077,7 @@ var hn = class {
|
|
|
4723
5077
|
get columnFilters() {
|
|
4724
5078
|
return this.props.columnFilters ?? this._columnFilters;
|
|
4725
5079
|
}
|
|
4726
|
-
globalFilterColumns =
|
|
5080
|
+
globalFilterColumns = H(() => this.props.def.globalFilterKeys ?? this.columns.value.leafs.filter((e) => e.key !== "row-number-cell" && e.key !== "row-selection-cell" && e.key !== "grouping-cell" && e.key !== "row-detail-cell").map((e) => e.key), () => [this.columns]);
|
|
4727
5081
|
rowMatchesFilters(e) {
|
|
4728
5082
|
let { filters: t } = this.props;
|
|
4729
5083
|
return t && !t.every((t) => t(e)) || this.props.def.globalFilter && !this.matchesGlobalFilter(e) ? !1 : this.matchesColumnFilters(e);
|
|
@@ -4735,7 +5089,7 @@ var hn = class {
|
|
|
4735
5089
|
let t = this.globalFilterValue.trim();
|
|
4736
5090
|
return !t || this.globalFilterColumns.value.some((n) => {
|
|
4737
5091
|
let r = e[n];
|
|
4738
|
-
return r != null &&
|
|
5092
|
+
return r != null && Jt(t, String(r));
|
|
4739
5093
|
});
|
|
4740
5094
|
}
|
|
4741
5095
|
matchesColumnFilters(e) {
|
|
@@ -4747,7 +5101,7 @@ var hn = class {
|
|
|
4747
5101
|
}
|
|
4748
5102
|
matchesFilter(e, t) {
|
|
4749
5103
|
switch (t.type) {
|
|
4750
|
-
case "text": return !t.value.trim() || e != null &&
|
|
5104
|
+
case "text": return !t.value.trim() || e != null && Jt(t.value, String(e));
|
|
4751
5105
|
case "number": {
|
|
4752
5106
|
if (e == null) return !1;
|
|
4753
5107
|
let n = typeof e == "number" ? e : parseFloat(String(e));
|
|
@@ -4768,7 +5122,13 @@ var hn = class {
|
|
|
4768
5122
|
}
|
|
4769
5123
|
}
|
|
4770
5124
|
get filteredData() {
|
|
4771
|
-
|
|
5125
|
+
if (this.source.enabled || this.isPaginated) return this.data;
|
|
5126
|
+
if (this.tree.isEager) return this.tree.allRows.value;
|
|
5127
|
+
if (this._selectionView) {
|
|
5128
|
+
let e = this._selectionView;
|
|
5129
|
+
return this.data.filter((t) => e.has(this.getRowKey(t)));
|
|
5130
|
+
}
|
|
5131
|
+
return this.hasRowFilters ? this.data.filter((e) => this.rowMatchesFilters(e)) : this.data;
|
|
4772
5132
|
}
|
|
4773
5133
|
fireServerStateChange(e, t) {
|
|
4774
5134
|
this.props.onServerStateChange?.({
|
|
@@ -4791,7 +5151,7 @@ var hn = class {
|
|
|
4791
5151
|
}
|
|
4792
5152
|
setGlobalFilter = (e) => {
|
|
4793
5153
|
let t = e === "" ? "clear" : "filter";
|
|
4794
|
-
this._globalFilterValue = e, this.props.onGlobalFilterChange?.(e, { reason: t });
|
|
5154
|
+
this._globalFilterValue = e, this.leaveSelectionView(), this.props.onGlobalFilterChange?.(e, { reason: t });
|
|
4795
5155
|
let n = this.resetToFirstPage(t);
|
|
4796
5156
|
this.fireServerStateChange(t, {
|
|
4797
5157
|
globalFilterValue: e,
|
|
@@ -4800,7 +5160,7 @@ var hn = class {
|
|
|
4800
5160
|
};
|
|
4801
5161
|
setColumnFilter = (e, t) => {
|
|
4802
5162
|
let n = { ...this.columnFilters }, r = t === void 0 ? "clear" : "filter";
|
|
4803
|
-
t === void 0 ? delete n[e] : n[e] = t, this._columnFilters = n, this.props.onColumnFiltersChange?.(n, { reason: r });
|
|
5163
|
+
t === void 0 ? delete n[e] : n[e] = t, this._columnFilters = n, this.leaveSelectionView(), this.props.onColumnFiltersChange?.(n, { reason: r });
|
|
4804
5164
|
let i = this.resetToFirstPage(r);
|
|
4805
5165
|
this.fireServerStateChange(r, {
|
|
4806
5166
|
columnFilters: n,
|
|
@@ -4808,7 +5168,7 @@ var hn = class {
|
|
|
4808
5168
|
}), this.source.invalidate(), this.tree.nodes.clear(), this.rows.clear(), this.notify();
|
|
4809
5169
|
};
|
|
4810
5170
|
clearColumnFilters = () => {
|
|
4811
|
-
this._columnFilters = {}, this.props.onColumnFiltersChange?.({}, { reason: "clear" }), this.fireServerStateChange("clear", { columnFilters: {} }), this.source.invalidate(), this.tree.nodes.clear(), this.rows.clear(), this.notify();
|
|
5171
|
+
this._columnFilters = {}, this.leaveSelectionView(), this.props.onColumnFiltersChange?.({}, { reason: "clear" }), this.fireServerStateChange("clear", { columnFilters: {} }), this.source.invalidate(), this.tree.nodes.clear(), this.rows.clear(), this.notify();
|
|
4812
5172
|
};
|
|
4813
5173
|
clearAllFilters = () => {
|
|
4814
5174
|
this.setGlobalFilter(""), this.clearColumnFilters();
|
|
@@ -4839,19 +5199,19 @@ var hn = class {
|
|
|
4839
5199
|
get totalRowCount() {
|
|
4840
5200
|
return this.source.enabled ? this.source.rowCount : this.tree.isEager ? this.tree.everyRow().length : this.props.def.pagination?.totalCount ?? this.data.length;
|
|
4841
5201
|
}
|
|
4842
|
-
rows =
|
|
5202
|
+
rows = H(() => {
|
|
4843
5203
|
if (this.source.enabled) return this.source.rowList();
|
|
4844
5204
|
if (this.tree.isEager) return this.tree.rowList();
|
|
4845
5205
|
let e = this.filteredData;
|
|
4846
|
-
if (this._sortColumn && !this.isPaginated && (e =
|
|
5206
|
+
if (this._sortColumn && !this.isPaginated && (e = G.sortBy(e, (e) => e[this._sortColumn], this._sortDirection)), this.groupColumns.size > 0) {
|
|
4847
5207
|
let t = (e, n, r) => {
|
|
4848
5208
|
let i = n.values().next().value;
|
|
4849
5209
|
n.delete(i);
|
|
4850
|
-
let a =
|
|
4851
|
-
return this._sortColumn === "grouping-cell" && (e =
|
|
5210
|
+
let a = G.findOrThrow(this.columns.value.leafs, (e) => e.key === i);
|
|
5211
|
+
return this._sortColumn === "grouping-cell" && (e = G.sortBy(e, (e) => e[i], this._sortDirection)), G.groupBy(e, (e) => e[i]).map((e) => {
|
|
4852
5212
|
let i;
|
|
4853
5213
|
i = n.size > 0 ? t(e.values, new Set(n), r + 1) : e.values.map((e, t) => new W(this, e, r + 1 + t));
|
|
4854
|
-
let o = new
|
|
5214
|
+
let o = new Ge(this, a, i, r, e.key);
|
|
4855
5215
|
return r += 1, o.expanded && (r += i.length), o;
|
|
4856
5216
|
});
|
|
4857
5217
|
};
|
|
@@ -4859,30 +5219,30 @@ var hn = class {
|
|
|
4859
5219
|
}
|
|
4860
5220
|
return e.map((e, t) => new W(this, e, t));
|
|
4861
5221
|
}, () => [this.columns]);
|
|
4862
|
-
groupingSpan =
|
|
5222
|
+
groupingSpan = H(() => {
|
|
4863
5223
|
let { visibleLeafs: e } = this.columns.value, t = e.findIndex((e) => e.isGrouping);
|
|
4864
5224
|
if (t === -1) return [];
|
|
4865
5225
|
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;
|
|
4866
5226
|
return [e[t], ...e.filter((e, t) => t < i && n(e, t))];
|
|
4867
5227
|
}, () => [this.columns]);
|
|
4868
|
-
flatRows =
|
|
5228
|
+
flatRows = H(() => this.source.enabled ? this.source.flatRowList(this.rows.value) : this.rows.value.flatMap((e) => e.flatRows), () => [this.rows]);
|
|
4869
5229
|
get rowHeight() {
|
|
4870
5230
|
return this.props.def.rowHeight ?? this.DEFAULT_ROW_HEIGHT_PX;
|
|
4871
5231
|
}
|
|
4872
|
-
sizes =
|
|
5232
|
+
sizes = H(() => {
|
|
4873
5233
|
let e = this.columns.value.flat.reduce((e, t) => {
|
|
4874
5234
|
let { inlineWidth: n } = t;
|
|
4875
5235
|
return typeof n == "number" && (e[t.widthVarName] = `${t.inlineWidth}px`), t.pin === "START" && (e[t.inlineStartVarName] = `${t.startOffset}px`), t.pin === "END" && (e[t.inlineEndVarName] = `${t.endOffset}px`), e;
|
|
4876
5236
|
}, {});
|
|
4877
5237
|
e[this.rowHeightVarName] = `${this.rowHeight}px`, e[this.inlineStartEdgeVarName] = `${this.inlineStartEdge}px`, this._containerWidth > 0 && (e[this.viewportWidthVarName] = `${this._containerWidth}px`);
|
|
4878
|
-
let { visibleLeafs: t } = this.columns.value, n = t.find((e) => e.key ===
|
|
5238
|
+
let { visibleLeafs: t } = this.columns.value, n = t.find((e) => e.key === K);
|
|
4879
5239
|
if (n) {
|
|
4880
|
-
let t =
|
|
5240
|
+
let t = G.sumBy(this.groupingSpan.value, (e) => e.inlineWidth ?? 0);
|
|
4881
5241
|
e[n.groupColumnWidthVarName] = `${t}px`;
|
|
4882
5242
|
}
|
|
4883
5243
|
return this.groupColumns.forEach((n) => {
|
|
4884
|
-
let r =
|
|
4885
|
-
e[r.groupColumnWidthVarName] = `${
|
|
5244
|
+
let r = G.findOrThrow(this.columns.value.leafs, (e) => e.key === n);
|
|
5245
|
+
e[r.groupColumnWidthVarName] = `${G.sumBy(t, (e) => e.pin === r.pin ? e.inlineWidth ?? 0 : 0)}px`;
|
|
4886
5246
|
}), e;
|
|
4887
5247
|
}, () => [this.columns, this.flexWidths]);
|
|
4888
5248
|
_containerWidth = 0;
|
|
@@ -4902,11 +5262,11 @@ var hn = class {
|
|
|
4902
5262
|
setContainerWidth = (e) => {
|
|
4903
5263
|
this._containerWidth !== e && (this._containerWidth = e, this.flexWidths.clear(), this.notify());
|
|
4904
5264
|
};
|
|
4905
|
-
flexWidths =
|
|
5265
|
+
flexWidths = H(() => {
|
|
4906
5266
|
let e = this._containerWidth;
|
|
4907
5267
|
if (e <= 0) return {};
|
|
4908
|
-
let t = this.columns.value.visibleLeafs, n = (e) => !e.isFlexible || this.columnWidths.has(e.key), r =
|
|
4909
|
-
if (o <= a) return
|
|
5268
|
+
let t = this.columns.value.visibleLeafs, n = (e) => !e.isFlexible || this.columnWidths.has(e.key), r = G.sumBy(t.filter(n), (e) => e.baseWidth), i = t.filter((e) => !n(e)), a = G.sumBy(i, (e) => e.baseWidth), o = e - r;
|
|
5269
|
+
if (o <= a) return G.toRecord(i, (e) => [e.key, e.baseWidth]);
|
|
4910
5270
|
let s = {}, c = 0;
|
|
4911
5271
|
return i.forEach((e, t) => {
|
|
4912
5272
|
if (t === i.length - 1) s[e.key] = o - c;
|
|
@@ -4979,31 +5339,31 @@ var hn = class {
|
|
|
4979
5339
|
pageSize: e
|
|
4980
5340
|
}), this.source.invalidate(), this.tree.nodes.clear(), this.rows.clear(), this.notify());
|
|
4981
5341
|
};
|
|
4982
|
-
rowOffsets =
|
|
5342
|
+
rowOffsets = H(() => {
|
|
4983
5343
|
if (this.source.enabled) return this.source.rowOffsets(this.flatRows.value);
|
|
4984
5344
|
let e = [], t = 0;
|
|
4985
|
-
for (let n of this.flatRows.value) e.push(t), t += n instanceof
|
|
5345
|
+
for (let n of this.flatRows.value) e.push(t), t += n instanceof De ? n.heightForOffset : this.rowHeight;
|
|
4986
5346
|
return {
|
|
4987
5347
|
offsets: e,
|
|
4988
5348
|
totalHeight: t
|
|
4989
5349
|
};
|
|
4990
5350
|
}, () => [this.flatRows]);
|
|
4991
|
-
viewport = new
|
|
4992
|
-
columnVisibility = new
|
|
4993
|
-
filter = new
|
|
4994
|
-
pagination = new
|
|
4995
|
-
aggregation = new
|
|
4996
|
-
exporter = new
|
|
4997
|
-
source = new
|
|
4998
|
-
tree = new
|
|
4999
|
-
edits = new
|
|
5000
|
-
range = new
|
|
5351
|
+
viewport = new he(this);
|
|
5352
|
+
columnVisibility = new en(this);
|
|
5353
|
+
filter = new gn(this);
|
|
5354
|
+
pagination = new vn(this);
|
|
5355
|
+
aggregation = new He(this);
|
|
5356
|
+
exporter = new hn(this);
|
|
5357
|
+
source = new dn(this);
|
|
5358
|
+
tree = new Dn(this);
|
|
5359
|
+
edits = new we(this);
|
|
5360
|
+
range = new wn(this);
|
|
5001
5361
|
refresh = () => {
|
|
5002
5362
|
this.edits.clearEdits(), this.source.invalidate();
|
|
5003
5363
|
};
|
|
5004
5364
|
get exportConfig() {
|
|
5005
5365
|
let e = this.props.def.export;
|
|
5006
|
-
if (e) return typeof e == "object" ? e :
|
|
5366
|
+
if (e) return typeof e == "object" ? e : On;
|
|
5007
5367
|
}
|
|
5008
5368
|
exportCsv = async (e = {}) => {
|
|
5009
5369
|
let { downloadCsv: t } = await import("../gridExport.mjs");
|
|
@@ -5019,28 +5379,63 @@ var hn = class {
|
|
|
5019
5379
|
get isEmpty() {
|
|
5020
5380
|
return this.source.enabled ? this.flatRows.value.length === 0 : this.data.length === 0;
|
|
5021
5381
|
}
|
|
5382
|
+
get selectableRows() {
|
|
5383
|
+
return this.source.enabled ? this.loadedRows : this.filteredData;
|
|
5384
|
+
}
|
|
5385
|
+
_selectableKeys = H(() => (this.rows.value, new Set(this.selectableRows.map((e) => this.getRowKey(e)))), () => [this.rows]);
|
|
5386
|
+
get selectableKeys() {
|
|
5387
|
+
return this.source.enabled ? new Set(this.loadedRows.map((e) => this.getRowKey(e))) : this._selectableKeys.value;
|
|
5388
|
+
}
|
|
5389
|
+
_selectionCounts;
|
|
5390
|
+
get shownSelectedCount() {
|
|
5391
|
+
let e = this.selectableKeys, t = this._selectionCounts;
|
|
5392
|
+
if (t && t.keys === e && t.selected === this.selectedRows) return t.shown;
|
|
5393
|
+
let n = 0;
|
|
5394
|
+
for (let t of this.selectedRows) e.has(t) && n++;
|
|
5395
|
+
return this._selectionCounts = {
|
|
5396
|
+
keys: e,
|
|
5397
|
+
selected: this.selectedRows,
|
|
5398
|
+
shown: n
|
|
5399
|
+
}, n;
|
|
5400
|
+
}
|
|
5022
5401
|
get allRowsSelected() {
|
|
5023
|
-
let e = this.
|
|
5024
|
-
return e > 0 && this.
|
|
5402
|
+
let e = this.selectableKeys.size;
|
|
5403
|
+
return e > 0 && this.shownSelectedCount === e;
|
|
5025
5404
|
}
|
|
5026
5405
|
get someRowsSelected() {
|
|
5027
|
-
return this.
|
|
5406
|
+
return this.shownSelectedCount > 0;
|
|
5407
|
+
}
|
|
5408
|
+
get hiddenSelectedCount() {
|
|
5409
|
+
return this.source.enabled || this.isPaginated ? 0 : this.selectedRows.size - this.shownSelectedCount;
|
|
5410
|
+
}
|
|
5411
|
+
_selectionView = null;
|
|
5412
|
+
get isSelectionView() {
|
|
5413
|
+
return this._selectionView !== null;
|
|
5414
|
+
}
|
|
5415
|
+
get canShowSelection() {
|
|
5416
|
+
return !!this.props.def.rowSelection && !this.source.enabled && !this.isPaginated && !this.tree.isEager;
|
|
5417
|
+
}
|
|
5418
|
+
toggleSelectionView = () => {
|
|
5419
|
+
this._selectionView = this._selectionView ? null : new Set(this.selectedRows), this.rows.clear(), this.notify();
|
|
5420
|
+
};
|
|
5421
|
+
leaveSelectionView() {
|
|
5422
|
+
this._selectionView = null;
|
|
5028
5423
|
}
|
|
5029
5424
|
_selectionAnnounced = !1;
|
|
5030
5425
|
get selectionAnnouncement() {
|
|
5031
5426
|
if (!this._selectionAnnounced) return "";
|
|
5032
5427
|
let e = this.selectedRows.size;
|
|
5033
|
-
return e
|
|
5428
|
+
return this.localeText.selectionAnnouncement(e, this.totalRowCount);
|
|
5034
5429
|
}
|
|
5035
5430
|
get groupedColumns() {
|
|
5036
|
-
return Array.from(this.groupColumns, (e) =>
|
|
5431
|
+
return Array.from(this.groupColumns, (e) => G.findOrThrow(this.columns.value.leafs, (t) => t.key === e));
|
|
5037
5432
|
}
|
|
5038
5433
|
selectedRows = /* @__PURE__ */ new Set();
|
|
5039
5434
|
get inlineStartEdge() {
|
|
5040
|
-
return
|
|
5435
|
+
return G.sumBy(this.columns.value.start, (e) => e.inlineWidth ?? 0);
|
|
5041
5436
|
}
|
|
5042
5437
|
get inlineEndEdge() {
|
|
5043
|
-
return
|
|
5438
|
+
return G.sumBy(this.columns.value.end, (e) => e.inlineWidth ?? 0);
|
|
5044
5439
|
}
|
|
5045
5440
|
inlineStartEdgeVarName = "--inline-start-edge";
|
|
5046
5441
|
rowHeightVarName = "--row-height";
|
|
@@ -5071,7 +5466,7 @@ var hn = class {
|
|
|
5071
5466
|
}), this.source.invalidate(), this.tree.nodes.clear(), this.rows.clear(), this.notify();
|
|
5072
5467
|
};
|
|
5073
5468
|
pinColumn = (e, t) => {
|
|
5074
|
-
let n =
|
|
5469
|
+
let n = Zt(t), r = G.findOrThrow(this.columns.value.flat, (t) => t.uniqueKey === e);
|
|
5075
5470
|
r.pin !== n && r.pinColumn(n), this.columns.clear(), this.notify();
|
|
5076
5471
|
};
|
|
5077
5472
|
toggleGrouping = (e) => {
|
|
@@ -5107,18 +5502,27 @@ var hn = class {
|
|
|
5107
5502
|
toggleRowsSelection = (e, t = !1) => {
|
|
5108
5503
|
this.selectedRows = new Set(this.selectedRows), this._selectionAnnounced = !0;
|
|
5109
5504
|
let n = e.every((e) => this.selectedRows.has(e));
|
|
5110
|
-
n ? e.forEach((e) => this.selectedRows.delete(e)) : e.forEach((e) => this.selectedRows.add(e))
|
|
5111
|
-
let r =
|
|
5112
|
-
this.
|
|
5113
|
-
|
|
5505
|
+
n ? e.forEach((e) => this.selectedRows.delete(e)) : e.forEach((e) => this.selectedRows.add(e));
|
|
5506
|
+
let r = t ? n ? "clear" : "select-all" : n ? "deselect" : "select";
|
|
5507
|
+
this.selectionChanged(e, n ? "deselect" : "select", r);
|
|
5508
|
+
};
|
|
5509
|
+
toggleSelectAllRows = () => {
|
|
5510
|
+
this.toggleRowsSelection(this.selectableRows.map((e) => this.getRowKey(e)), !0);
|
|
5511
|
+
};
|
|
5512
|
+
clearSelection = () => {
|
|
5513
|
+
let e = Array.from(this.selectedRows);
|
|
5514
|
+
this.selectedRows = /* @__PURE__ */ new Set(), this._selectionAnnounced = !0, this._selectionView && (this._selectionView = null, this.rows.clear()), this.selectionChanged(e, "deselect", "clear");
|
|
5515
|
+
};
|
|
5516
|
+
selectionChanged(e, t, n) {
|
|
5517
|
+
this._selectionVersion++, this.flatRows.clear(), this.notifyRows();
|
|
5518
|
+
let r = Array.from(this.selectedRows);
|
|
5519
|
+
this.props.onSelectedRowKeysChange?.(r, { reason: n }), this.props.onSelectionChange?.({
|
|
5520
|
+
action: t,
|
|
5114
5521
|
affectedRowKeys: e,
|
|
5115
5522
|
selectedRowKeys: r,
|
|
5116
5523
|
isAllSelected: this.selectedRows.size === this.loadedRows.length
|
|
5117
5524
|
});
|
|
5118
|
-
}
|
|
5119
|
-
toggleSelectAllRows = () => {
|
|
5120
|
-
this.toggleRowsSelection(this.loadedRows.map((e) => this.getRowKey(e)), !0);
|
|
5121
|
-
};
|
|
5525
|
+
}
|
|
5122
5526
|
toggleColumnVisibility = (e) => {
|
|
5123
5527
|
this.hiddenColumns = new Set(this.hiddenColumns), this.hiddenColumns.has(e) ? this.hiddenColumns.delete(e) : this.hiddenColumns.add(e), this.columns.clear(), this.notify();
|
|
5124
5528
|
};
|
|
@@ -5151,15 +5555,15 @@ var hn = class {
|
|
|
5151
5555
|
};
|
|
5152
5556
|
//#endregion
|
|
5153
5557
|
//#region src/components/dataGrid/useGrid.ts
|
|
5154
|
-
function
|
|
5155
|
-
let [t] =
|
|
5558
|
+
function An(e) {
|
|
5559
|
+
let [t] = P(() => new kn(e)), n = l("datagrid");
|
|
5156
5560
|
return t.setProps(e), t.setIdentifier(n), te(t.subscribe, t.getSnapshot, t.getSnapshot), t;
|
|
5157
5561
|
}
|
|
5158
5562
|
//#endregion
|
|
5159
5563
|
//#region src/components/dataGrid.tsx
|
|
5160
|
-
function
|
|
5161
|
-
let n =
|
|
5162
|
-
|
|
5564
|
+
function jn(e, t) {
|
|
5565
|
+
let n = An(e), i = N(null);
|
|
5566
|
+
A(t, () => ({
|
|
5163
5567
|
get element() {
|
|
5164
5568
|
return i.current;
|
|
5165
5569
|
},
|
|
@@ -5168,31 +5572,31 @@ function yn(e, t) {
|
|
|
5168
5572
|
refresh: n.refresh,
|
|
5169
5573
|
clearEdits: n.edits.clearEdits
|
|
5170
5574
|
}), [n]);
|
|
5171
|
-
let { component: a, data: o, def: s, loading: c, filters: l, globalFilterValue: u, columnFilters: d, expandedRowKeys: f, expandedTreeKeys: p, page: m, pageSize: h, onSelectedRowKeysChange:
|
|
5172
|
-
return
|
|
5575
|
+
let { component: a, data: o, def: s, loading: c, filters: l, globalFilterValue: u, columnFilters: d, expandedRowKeys: f, expandedTreeKeys: p, page: m, pageSize: h, onSelectedRowKeysChange: g, onSelectionChange: _, onGlobalFilterChange: y, onColumnFiltersChange: b, onExpandedRowKeysChange: x, onExpandedTreeKeysChange: S, onCellEditsChange: C, onPaginationChange: w, onPageChange: T, onPageSizeChange: E, onSortingChange: D, onSortChange: O, onServerStateChange: ee, style: k, ...M } = e;
|
|
5576
|
+
return j(() => {
|
|
5173
5577
|
let e = i.current;
|
|
5174
5578
|
if (e) return n.setSizingElement(e), () => n.setSizingElement(null);
|
|
5175
|
-
}, [n]), /* @__PURE__ */
|
|
5579
|
+
}, [n]), /* @__PURE__ */ R(r, {
|
|
5176
5580
|
ref: i,
|
|
5177
5581
|
component: n.componentName,
|
|
5178
|
-
...
|
|
5582
|
+
...M,
|
|
5179
5583
|
style: {
|
|
5180
5584
|
...n.sizes.value,
|
|
5181
|
-
...
|
|
5585
|
+
...k
|
|
5182
5586
|
},
|
|
5183
5587
|
children: [
|
|
5184
|
-
n.props.def.topBar && /* @__PURE__ */
|
|
5185
|
-
/* @__PURE__ */
|
|
5186
|
-
/* @__PURE__ */
|
|
5187
|
-
n.props.def.bottomBar && /* @__PURE__ */
|
|
5188
|
-
/* @__PURE__ */
|
|
5588
|
+
n.props.def.topBar && /* @__PURE__ */ L(Kt, { grid: n }),
|
|
5589
|
+
/* @__PURE__ */ L(zt, { grid: n }),
|
|
5590
|
+
/* @__PURE__ */ L(Rt, { grid: n }),
|
|
5591
|
+
n.props.def.bottomBar && /* @__PURE__ */ L(de, { grid: n }),
|
|
5592
|
+
/* @__PURE__ */ L(v, {
|
|
5189
5593
|
props: { role: "status" },
|
|
5190
5594
|
children: n.selectionAnnouncement
|
|
5191
5595
|
})
|
|
5192
5596
|
]
|
|
5193
5597
|
});
|
|
5194
5598
|
}
|
|
5195
|
-
var
|
|
5196
|
-
|
|
5599
|
+
var Mn = E(jn);
|
|
5600
|
+
jn.displayName = "DataGrid";
|
|
5197
5601
|
//#endregion
|
|
5198
|
-
export {
|
|
5602
|
+
export { _n as DATA_GRID_LOCALE_TEXT, Mn as default };
|