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