@progress/kendo-react-grid 13.3.0-develop.2 → 13.3.0-develop.3
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/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +354 -336
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +330 -350
- package/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +28 -28
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/index.d.mts +283 -69
- package/index.d.ts +283 -69
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -17
- package/rows/GridDetailRowRenderer.js +8 -0
- package/rows/GridDetailRowRenderer.mjs +103 -0
- package/rows/GridRowRenderer.js +8 -0
- package/rows/GridRowRenderer.mjs +88 -0
- package/stacked/GridStackedCell.js +9 -0
- package/stacked/GridStackedCell.mjs +69 -0
- package/stacked/GridStackedDetailToggle.js +9 -0
- package/stacked/GridStackedDetailToggle.mjs +37 -0
- package/stacked/GridStackedRow.js +9 -0
- package/stacked/GridStackedRow.mjs +463 -0
- package/stacked/StackedModeComponents.js +9 -0
- package/stacked/StackedModeComponents.mjs +54 -0
- package/stacked/StackedModeRow.js +8 -0
- package/stacked/StackedModeRow.mjs +131 -0
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as n from "react";
|
|
10
|
+
import { classNames as W } from "@progress/kendo-react-common";
|
|
11
|
+
import { GridStackedCell as oe } from "./GridStackedCell.mjs";
|
|
12
|
+
import { GridStackedDetailToggle as Te } from "./GridStackedDetailToggle.mjs";
|
|
13
|
+
import { GridEditCellEditor as we } from "../cells/editcell/GridEditCellEditor.mjs";
|
|
14
|
+
import { GridContext as ve } from "../utils/GridContext.mjs";
|
|
15
|
+
import { tableKeyboardNavigationTools as P, editReducer as X, EDIT_ACTION as z, handleStackedKeyboardNavigation as De } from "@progress/kendo-react-data-tools";
|
|
16
|
+
import { useGridState as Ce } from "../GridState.mjs";
|
|
17
|
+
const Se = (o) => /* @__PURE__ */ n.createElement("div", { style: { display: "contents" } }, o.children), Re = (o) => {
|
|
18
|
+
if (o != null && o.cols && typeof o.cols != "number")
|
|
19
|
+
return o.cols.map((a) => typeof a == "number" ? `${a}px` : typeof a == "string" ? a : a && typeof a == "object" && a.width !== void 0 ? typeof a.width == "number" ? `${a.width}px` : a.width : "1fr").join(" ");
|
|
20
|
+
}, Ne = (o) => o != null && o.cols ? typeof o.cols == "number" ? o.cols : o.cols.length : 1, C = (o) => typeof o == "function" || typeof o == "object" && o !== null && typeof o.$$typeof == "symbol", Fe = (o, a) => {
|
|
21
|
+
var I, u;
|
|
22
|
+
if (o.cell && C(o.cell))
|
|
23
|
+
return o.cell;
|
|
24
|
+
if ((I = o.cells) != null && I.stackedData && C(o.cells.stackedData))
|
|
25
|
+
return o.cells.stackedData;
|
|
26
|
+
if (a != null && a.stackedData && C(a.stackedData))
|
|
27
|
+
return a.stackedData;
|
|
28
|
+
if ((u = o.cells) != null && u.data && C(o.cells.data))
|
|
29
|
+
return o.cells.data;
|
|
30
|
+
if (a != null && a.data && C(a.data))
|
|
31
|
+
return a.data;
|
|
32
|
+
}, ge = (o, a) => {
|
|
33
|
+
if (!o || !a)
|
|
34
|
+
return;
|
|
35
|
+
const I = o.split(".");
|
|
36
|
+
let u = a;
|
|
37
|
+
for (const f of I) {
|
|
38
|
+
if (u == null)
|
|
39
|
+
return;
|
|
40
|
+
u = u[f];
|
|
41
|
+
}
|
|
42
|
+
return u;
|
|
43
|
+
}, Pe = (o) => {
|
|
44
|
+
const {
|
|
45
|
+
dataItem: a,
|
|
46
|
+
columns: I,
|
|
47
|
+
stackedLayoutSettings: u,
|
|
48
|
+
dataIndex: f,
|
|
49
|
+
isAltRow: Y,
|
|
50
|
+
isSelected: x,
|
|
51
|
+
isInEdit: w,
|
|
52
|
+
editMode: k,
|
|
53
|
+
cells: q,
|
|
54
|
+
idPrefix: L,
|
|
55
|
+
className: J,
|
|
56
|
+
style: V,
|
|
57
|
+
ariaRowIndex: re,
|
|
58
|
+
absoluteRowIndex: S,
|
|
59
|
+
groupLevel: Q = 0,
|
|
60
|
+
preparedCells: K,
|
|
61
|
+
showDetailToggle: ce,
|
|
62
|
+
isDetailExpanded: ie,
|
|
63
|
+
detailExpandField: ue
|
|
64
|
+
} = o, t = n.useContext(ve), [A, , y] = Ce(), j = n.useMemo(
|
|
65
|
+
() => Re(u),
|
|
66
|
+
[u]
|
|
67
|
+
), M = n.useMemo(() => Ne(u), [u]), [Z, R] = n.useState(!1), N = n.useRef(null), v = n.useRef(null), G = n.useRef(/* @__PURE__ */ new Map()), O = n.useRef(!1);
|
|
68
|
+
n.useLayoutEffect(() => {
|
|
69
|
+
if (!w || k !== "inline") {
|
|
70
|
+
O.current = !1, G.current.clear();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
O.current || (O.current = !0, v.current = 0, setTimeout(() => {
|
|
74
|
+
const e = N.current;
|
|
75
|
+
if (!e || e.contains(document.activeElement))
|
|
76
|
+
return;
|
|
77
|
+
const l = e.querySelector('[data-grid-col-index="0"]'), c = (l ? P.getStackedCellFocusableElements(l) : [])[0];
|
|
78
|
+
if (c) {
|
|
79
|
+
c.focus();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const s = P.getStackedCellFocusableElements(e);
|
|
83
|
+
s[0] && s[0].focus();
|
|
84
|
+
}, 0));
|
|
85
|
+
}, [w, k]), n.useEffect(() => {
|
|
86
|
+
const e = (r) => {
|
|
87
|
+
const c = N.current;
|
|
88
|
+
setTimeout(() => {
|
|
89
|
+
const s = document.activeElement;
|
|
90
|
+
c && !c.contains(s) && R(!1);
|
|
91
|
+
}, 0);
|
|
92
|
+
}, l = N.current;
|
|
93
|
+
if (l)
|
|
94
|
+
return l.addEventListener("focusout", e), () => {
|
|
95
|
+
l.removeEventListener("focusout", e);
|
|
96
|
+
};
|
|
97
|
+
}, []);
|
|
98
|
+
const D = n.useMemo(
|
|
99
|
+
() => I.filter((e) => {
|
|
100
|
+
const l = !!e._type, r = e.isAccessible === !1;
|
|
101
|
+
return !e.hidden && !l && !r && (e.columnType === "data" || e.columnType === void 0);
|
|
102
|
+
}),
|
|
103
|
+
[I]
|
|
104
|
+
), H = n.useCallback((e, l) => {
|
|
105
|
+
if (!e.field)
|
|
106
|
+
return null;
|
|
107
|
+
const r = ge(e.field, l);
|
|
108
|
+
return r == null ? null : String(r);
|
|
109
|
+
}, []), fe = n.useMemo(
|
|
110
|
+
() => W("k-table-row", "k-master-row", J, {
|
|
111
|
+
"k-table-alt-row": Y,
|
|
112
|
+
"k-selected": x,
|
|
113
|
+
"k-grid-edit-row": w && k === "inline"
|
|
114
|
+
}),
|
|
115
|
+
[J, Y, x, w, k]
|
|
116
|
+
), ee = n.useMemo(
|
|
117
|
+
() => typeof (u == null ? void 0 : u.cols) == "number" && M > 1,
|
|
118
|
+
[u == null ? void 0 : u.cols, M]
|
|
119
|
+
), de = n.useMemo(
|
|
120
|
+
() => W("k-grid-stack-row", {
|
|
121
|
+
[`k-grid-cols-${M}`]: ee
|
|
122
|
+
}),
|
|
123
|
+
[M, ee]
|
|
124
|
+
), pe = n.useMemo(
|
|
125
|
+
() => j ? { gridTemplateColumns: j, ...V } : V || {},
|
|
126
|
+
[j, V]
|
|
127
|
+
), te = n.useCallback(
|
|
128
|
+
(e) => {
|
|
129
|
+
if (!(y != null && y.onEditChange) || !(t != null && t.dataItemKey) || !e)
|
|
130
|
+
return;
|
|
131
|
+
const l = a[t.dataItemKey];
|
|
132
|
+
if (l === void 0)
|
|
133
|
+
return;
|
|
134
|
+
const r = A.edit || {}, c = X(r, {
|
|
135
|
+
type: z.EXIT_FIELD_EDIT,
|
|
136
|
+
payload: { id: String(l), field: e }
|
|
137
|
+
}), s = {
|
|
138
|
+
nativeEvent: {},
|
|
139
|
+
currentTarget: null,
|
|
140
|
+
target: null,
|
|
141
|
+
bubbles: !1,
|
|
142
|
+
cancelable: !1,
|
|
143
|
+
defaultPrevented: !1,
|
|
144
|
+
eventPhase: 0,
|
|
145
|
+
isTrusted: !1,
|
|
146
|
+
timeStamp: Date.now(),
|
|
147
|
+
type: "editchange",
|
|
148
|
+
preventDefault: () => {
|
|
149
|
+
},
|
|
150
|
+
stopPropagation: () => {
|
|
151
|
+
},
|
|
152
|
+
persist: () => {
|
|
153
|
+
},
|
|
154
|
+
isDefaultPrevented: () => !1,
|
|
155
|
+
isPropagationStopped: () => !1
|
|
156
|
+
};
|
|
157
|
+
y.onEditChange({
|
|
158
|
+
edit: c,
|
|
159
|
+
nativeEvent: {},
|
|
160
|
+
syntheticEvent: s,
|
|
161
|
+
target: null
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
[a, t == null ? void 0 : t.dataItemKey, y, A.edit]
|
|
165
|
+
), le = n.useCallback(
|
|
166
|
+
(e, l) => {
|
|
167
|
+
if (!(y != null && y.onEditChange) || !(t != null && t.dataItemKey) || !e)
|
|
168
|
+
return;
|
|
169
|
+
const r = a[t.dataItemKey];
|
|
170
|
+
if (r === void 0)
|
|
171
|
+
return;
|
|
172
|
+
const c = D.findIndex(($) => $.field === e);
|
|
173
|
+
if (c === -1)
|
|
174
|
+
return;
|
|
175
|
+
const s = c + l;
|
|
176
|
+
if (s < 0 || s >= D.length)
|
|
177
|
+
return;
|
|
178
|
+
const d = D[s].field;
|
|
179
|
+
if (!d)
|
|
180
|
+
return;
|
|
181
|
+
const p = A.edit || {}, F = String(r), m = X(p, {
|
|
182
|
+
type: z.EXIT_FIELD_EDIT,
|
|
183
|
+
payload: { id: F, field: e }
|
|
184
|
+
}), B = X(m, {
|
|
185
|
+
type: z.ENTER_FIELD_EDIT,
|
|
186
|
+
payload: { id: F, field: d }
|
|
187
|
+
}), g = {
|
|
188
|
+
nativeEvent: {},
|
|
189
|
+
currentTarget: null,
|
|
190
|
+
target: null,
|
|
191
|
+
bubbles: !1,
|
|
192
|
+
cancelable: !1,
|
|
193
|
+
defaultPrevented: !1,
|
|
194
|
+
eventPhase: 0,
|
|
195
|
+
isTrusted: !1,
|
|
196
|
+
timeStamp: Date.now(),
|
|
197
|
+
type: "editchange",
|
|
198
|
+
preventDefault: () => {
|
|
199
|
+
},
|
|
200
|
+
stopPropagation: () => {
|
|
201
|
+
},
|
|
202
|
+
persist: () => {
|
|
203
|
+
},
|
|
204
|
+
isDefaultPrevented: () => !1,
|
|
205
|
+
isPropagationStopped: () => !1
|
|
206
|
+
};
|
|
207
|
+
y.onEditChange({
|
|
208
|
+
edit: B,
|
|
209
|
+
nativeEvent: {},
|
|
210
|
+
syntheticEvent: g,
|
|
211
|
+
target: null
|
|
212
|
+
});
|
|
213
|
+
},
|
|
214
|
+
[a, t == null ? void 0 : t.dataItemKey, y, A.edit, D]
|
|
215
|
+
), me = n.useCallback(
|
|
216
|
+
(e, l) => {
|
|
217
|
+
var se;
|
|
218
|
+
const r = I.indexOf(e), c = K == null ? void 0 : K[r], s = c == null ? void 0 : c.props.cellProps, d = Fe(e, q), p = (se = S != null ? S : f) != null ? se : 0, F = L ? `${L}-${p}-${l}` : void 0, m = s ? s.isInEdit : w && e.editable !== !1, B = W("k-grid-stack-cell", e.className, {
|
|
219
|
+
"k-grid-stack-edit-cell ": m
|
|
220
|
+
}), g = (i) => {
|
|
221
|
+
var E;
|
|
222
|
+
if (m) {
|
|
223
|
+
if (i.stopPropagation(), k === "inline" && (v.current = l), k === "incell") {
|
|
224
|
+
const b = i.currentTarget, T = P.getStackedCellFocusableElements(b)[0], _ = document.activeElement;
|
|
225
|
+
T && _ !== T && !T.contains(_) && T.focus();
|
|
226
|
+
}
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
(E = t == null ? void 0 : t.cellClick) == null || E.call(t, i, a, e.field);
|
|
230
|
+
}, $ = (i) => {
|
|
231
|
+
const E = i.target, b = i.currentTarget;
|
|
232
|
+
if (i.key === "Tab" && E !== b)
|
|
233
|
+
return;
|
|
234
|
+
if (i.key === "Enter" && E === b && !m && e.editable !== !1) {
|
|
235
|
+
g(i);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
De({
|
|
239
|
+
event: i,
|
|
240
|
+
cellElement: b,
|
|
241
|
+
onEscape: () => R(!1),
|
|
242
|
+
onExitEdit: () => te(e.field),
|
|
243
|
+
onTabToNextCell: (T) => le(e.field, T),
|
|
244
|
+
isInEdit: m,
|
|
245
|
+
editMode: k
|
|
246
|
+
});
|
|
247
|
+
}, ae = (i) => {
|
|
248
|
+
if (i && m && k === "incell") {
|
|
249
|
+
const b = P.getStackedCellFocusableElements(i)[0], h = document.activeElement;
|
|
250
|
+
if (!b || !h || b === h || b.contains(h))
|
|
251
|
+
return;
|
|
252
|
+
b.focus();
|
|
253
|
+
} else if (i && m && k === "inline") {
|
|
254
|
+
const E = document.activeElement;
|
|
255
|
+
if (E == null ? void 0 : E.closest(".k-animation-container, .k-popup, .k-list-container"))
|
|
256
|
+
return;
|
|
257
|
+
if (i.contains(E)) {
|
|
258
|
+
v.current = l, G.current.set(l, !0);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
const h = N.current;
|
|
262
|
+
if (h != null && h.contains(E))
|
|
263
|
+
return;
|
|
264
|
+
const T = G.current.size === 0, _ = l === 0;
|
|
265
|
+
if (v.current === l || _ && T) {
|
|
266
|
+
const ne = P.getStackedCellFocusableElements(i)[0];
|
|
267
|
+
ne && (ne.focus(), v.current = l, G.current.set(l, !0));
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}, he = {
|
|
271
|
+
className: B,
|
|
272
|
+
"data-grid-col-index": l,
|
|
273
|
+
id: F,
|
|
274
|
+
style: void 0,
|
|
275
|
+
tabIndex: Z ? 0 : -1,
|
|
276
|
+
onClick: g,
|
|
277
|
+
onKeyDown: $,
|
|
278
|
+
onFocus: () => {
|
|
279
|
+
v.current = l;
|
|
280
|
+
},
|
|
281
|
+
ref: ae
|
|
282
|
+
};
|
|
283
|
+
let U = H(e, a);
|
|
284
|
+
if (m) {
|
|
285
|
+
const i = s || {
|
|
286
|
+
dataItem: a,
|
|
287
|
+
field: e.field,
|
|
288
|
+
dataIndex: f,
|
|
289
|
+
columnIndex: l,
|
|
290
|
+
rowType: "data",
|
|
291
|
+
isInEdit: m,
|
|
292
|
+
format: e.format,
|
|
293
|
+
className: e.className,
|
|
294
|
+
editor: e.editor,
|
|
295
|
+
cells: q
|
|
296
|
+
};
|
|
297
|
+
U = /* @__PURE__ */ n.createElement(Se, null, /* @__PURE__ */ n.createElement(we, { cellProps: i }));
|
|
298
|
+
}
|
|
299
|
+
if (d && C(d)) {
|
|
300
|
+
const i = {
|
|
301
|
+
dataItem: a,
|
|
302
|
+
field: e.field,
|
|
303
|
+
title: e.title,
|
|
304
|
+
rowType: "data",
|
|
305
|
+
dataIndex: f,
|
|
306
|
+
columnIndex: l,
|
|
307
|
+
isInEdit: m,
|
|
308
|
+
format: e.format,
|
|
309
|
+
className: e.className,
|
|
310
|
+
columnType: e.columnType,
|
|
311
|
+
stackedCellProps: he,
|
|
312
|
+
children: U
|
|
313
|
+
};
|
|
314
|
+
return /* @__PURE__ */ n.createElement(d, { key: e.id || e.field || l, ...i });
|
|
315
|
+
}
|
|
316
|
+
return /* @__PURE__ */ n.createElement(
|
|
317
|
+
oe,
|
|
318
|
+
{
|
|
319
|
+
key: e.id || e.field || l,
|
|
320
|
+
header: e.title,
|
|
321
|
+
className: e.className,
|
|
322
|
+
isInEdit: m,
|
|
323
|
+
columnIndex: l,
|
|
324
|
+
id: F,
|
|
325
|
+
onClick: g,
|
|
326
|
+
onKeyDown: $,
|
|
327
|
+
cellRef: ae
|
|
328
|
+
},
|
|
329
|
+
U
|
|
330
|
+
);
|
|
331
|
+
},
|
|
332
|
+
[
|
|
333
|
+
I,
|
|
334
|
+
K,
|
|
335
|
+
q,
|
|
336
|
+
L,
|
|
337
|
+
w,
|
|
338
|
+
k,
|
|
339
|
+
a,
|
|
340
|
+
f,
|
|
341
|
+
S,
|
|
342
|
+
Z,
|
|
343
|
+
t,
|
|
344
|
+
H,
|
|
345
|
+
R,
|
|
346
|
+
te,
|
|
347
|
+
le
|
|
348
|
+
]
|
|
349
|
+
), Ee = n.useMemo(() => {
|
|
350
|
+
const e = [];
|
|
351
|
+
for (let l = 0; l < Q; l++)
|
|
352
|
+
e.push(/* @__PURE__ */ n.createElement("td", { key: `group-cell-${l}`, className: "k-table-group-td k-group-cell k-table-td" }));
|
|
353
|
+
return e;
|
|
354
|
+
}, [Q]), be = n.useCallback(
|
|
355
|
+
(e) => {
|
|
356
|
+
var l, r;
|
|
357
|
+
(l = t == null ? void 0 : t.rowClick) == null || l.call(t, e, a), f !== void 0 && ((r = t == null ? void 0 : t.selectionChange) == null || r.call(t, {
|
|
358
|
+
event: e,
|
|
359
|
+
dataItem: a,
|
|
360
|
+
dataIndex: f,
|
|
361
|
+
columnIndex: 0
|
|
362
|
+
}));
|
|
363
|
+
},
|
|
364
|
+
[t, a, f]
|
|
365
|
+
), ke = n.useCallback(
|
|
366
|
+
(e) => {
|
|
367
|
+
var l;
|
|
368
|
+
(l = t == null ? void 0 : t.rowDblClick) == null || l.call(t, e, a);
|
|
369
|
+
},
|
|
370
|
+
[t, a]
|
|
371
|
+
), ye = n.useCallback(
|
|
372
|
+
(e) => {
|
|
373
|
+
var c;
|
|
374
|
+
const l = e.target, r = e.currentTarget;
|
|
375
|
+
if (l === r && e.key === "Enter") {
|
|
376
|
+
e.preventDefault(), f !== void 0 && ((c = t == null ? void 0 : t.selectionChange) == null || c.call(t, {
|
|
377
|
+
event: e,
|
|
378
|
+
dataItem: a,
|
|
379
|
+
dataIndex: f,
|
|
380
|
+
columnIndex: 0
|
|
381
|
+
}));
|
|
382
|
+
const s = r.querySelector(".k-grid-stack-cell");
|
|
383
|
+
s && s.focus();
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
[t, a, f]
|
|
387
|
+
), Ie = n.useCallback(
|
|
388
|
+
(e) => {
|
|
389
|
+
var c;
|
|
390
|
+
const l = e.target, r = e.currentTarget;
|
|
391
|
+
if (l === r) {
|
|
392
|
+
if (e.key === "Tab") {
|
|
393
|
+
const s = r.closest("tr");
|
|
394
|
+
if (e.shiftKey) {
|
|
395
|
+
const d = s == null ? void 0 : s.previousElementSibling;
|
|
396
|
+
if (d) {
|
|
397
|
+
const p = d.querySelector("td.k-table-td[tabindex]");
|
|
398
|
+
if (p) {
|
|
399
|
+
e.preventDefault(), p.focus();
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
} else {
|
|
404
|
+
const d = s == null ? void 0 : s.nextElementSibling;
|
|
405
|
+
if (d) {
|
|
406
|
+
const p = d.querySelector("td.k-table-td[tabindex]");
|
|
407
|
+
if (p) {
|
|
408
|
+
e.preventDefault(), p.focus();
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
416
|
+
e.preventDefault();
|
|
417
|
+
const s = r.closest("tr"), d = e.key === "ArrowUp" ? s == null ? void 0 : s.previousElementSibling : s == null ? void 0 : s.nextElementSibling;
|
|
418
|
+
if (!d)
|
|
419
|
+
return;
|
|
420
|
+
const p = d.querySelector("td.k-table-td[tabindex]");
|
|
421
|
+
p && (p.focus(), p.scrollIntoView && p.scrollIntoView({ block: "nearest" }));
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
if (e.key === "Enter") {
|
|
425
|
+
e.preventDefault(), e.stopPropagation(), f !== void 0 && ((c = t == null ? void 0 : t.selectionChange) == null || c.call(t, {
|
|
426
|
+
event: e,
|
|
427
|
+
dataItem: a,
|
|
428
|
+
dataIndex: f,
|
|
429
|
+
columnIndex: 0
|
|
430
|
+
})), R(!0);
|
|
431
|
+
const s = r.querySelector(".k-grid-stack-cell");
|
|
432
|
+
s && (s.hasAttribute("tabindex") || s.setAttribute("tabindex", "0"), s.focus());
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
[R, t, a, f]
|
|
437
|
+
);
|
|
438
|
+
return /* @__PURE__ */ n.createElement(
|
|
439
|
+
"tr",
|
|
440
|
+
{
|
|
441
|
+
className: fe,
|
|
442
|
+
"data-grid-row-index": S,
|
|
443
|
+
"aria-rowindex": re,
|
|
444
|
+
onClick: be,
|
|
445
|
+
onDoubleClick: ke,
|
|
446
|
+
onKeyDown: ye
|
|
447
|
+
},
|
|
448
|
+
Ee,
|
|
449
|
+
/* @__PURE__ */ n.createElement("td", { ref: N, className: "k-table-td", colSpan: 1, tabIndex: 0, onKeyDown: Ie }, /* @__PURE__ */ n.createElement("div", { className: de, style: pe }, D.map((e, l) => me(e, l)), ce && /* @__PURE__ */ n.createElement(oe, { columnIndex: D.length }, /* @__PURE__ */ n.createElement(
|
|
450
|
+
Te,
|
|
451
|
+
{
|
|
452
|
+
dataItem: a,
|
|
453
|
+
dataIndex: f,
|
|
454
|
+
expanded: !!ie,
|
|
455
|
+
field: ue
|
|
456
|
+
}
|
|
457
|
+
))))
|
|
458
|
+
);
|
|
459
|
+
};
|
|
460
|
+
Pe.displayName = "KendoReactGridStackedRow";
|
|
461
|
+
export {
|
|
462
|
+
Pe as GridStackedRow
|
|
463
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),y=require("../components/colGroup/GridColGroup.js");function f(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const o=f(k),c=({groupLevelCount:e})=>o.createElement(y.GridColGroup,null,Array.from({length:e},(r,t)=>o.createElement("col",{key:`group-col-${t}`,className:"k-group-col"})),o.createElement("col",null));c.displayName="KendoReactStackedModeColGroup";const n=({detailRowId:e,className:r,isHidden:t,detailRowHeight:l,ariaRowIndex:d,groupLevelCount:a,dataItem:i,dataIndex:u,detail:s,id:p,DetailCell:m})=>o.createElement("tr",{key:e,className:r,style:{visibility:t?"hidden":"",height:l},role:"row","aria-rowindex":d},Array.from({length:a},(b,g)=>o.createElement("td",{key:`group-cell-${e}-${g}`,className:"k-table-group-td k-group-cell k-table-td"})),o.createElement(m,{dataItem:i,dataIndex:u,colSpan:1,ariaColIndex:1+a,detail:s,id:p}));n.displayName="KendoReactStackedModeDetailRow";exports.StackedModeColGroup=c;exports.StackedModeDetailRow=n;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as e from "react";
|
|
10
|
+
import { GridColGroup as s } from "../components/colGroup/GridColGroup.mjs";
|
|
11
|
+
const u = ({ groupLevelCount: t }) => /* @__PURE__ */ e.createElement(s, null, Array.from({ length: t }, (l, r) => /* @__PURE__ */ e.createElement("col", { key: `group-col-${r}`, className: "k-group-col" })), /* @__PURE__ */ e.createElement("col", null));
|
|
12
|
+
u.displayName = "KendoReactStackedModeColGroup";
|
|
13
|
+
const y = ({
|
|
14
|
+
detailRowId: t,
|
|
15
|
+
className: l,
|
|
16
|
+
isHidden: r,
|
|
17
|
+
detailRowHeight: a,
|
|
18
|
+
ariaRowIndex: c,
|
|
19
|
+
groupLevelCount: o,
|
|
20
|
+
dataItem: n,
|
|
21
|
+
dataIndex: d,
|
|
22
|
+
detail: m,
|
|
23
|
+
id: i,
|
|
24
|
+
DetailCell: p
|
|
25
|
+
}) => /* @__PURE__ */ e.createElement(
|
|
26
|
+
"tr",
|
|
27
|
+
{
|
|
28
|
+
key: t,
|
|
29
|
+
className: l,
|
|
30
|
+
style: {
|
|
31
|
+
visibility: r ? "hidden" : "",
|
|
32
|
+
height: a
|
|
33
|
+
},
|
|
34
|
+
role: "row",
|
|
35
|
+
"aria-rowindex": c
|
|
36
|
+
},
|
|
37
|
+
Array.from({ length: o }, (g, k) => /* @__PURE__ */ e.createElement("td", { key: `group-cell-${t}-${k}`, className: "k-table-group-td k-group-cell k-table-td" })),
|
|
38
|
+
/* @__PURE__ */ e.createElement(
|
|
39
|
+
p,
|
|
40
|
+
{
|
|
41
|
+
dataItem: n,
|
|
42
|
+
dataIndex: d,
|
|
43
|
+
colSpan: 1,
|
|
44
|
+
ariaColIndex: 1 + o,
|
|
45
|
+
detail: m,
|
|
46
|
+
id: i
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
);
|
|
50
|
+
y.displayName = "KendoReactStackedModeDetailRow";
|
|
51
|
+
export {
|
|
52
|
+
u as StackedModeColGroup,
|
|
53
|
+
y as StackedModeDetailRow
|
|
54
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react"),B=require("../cells/groupcell/GridGroupCellToggle.js"),L=require("../rows/GridRow.js"),V=require("./GridStackedRow.js");function z(e){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const u=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(c,s,u.get?u:{enumerable:!0,get:()=>e[s]})}}return c.default=e,Object.freeze(c)}const t=z(P),H=({item:e,rowId:c,dataIndex:s,idPrefix:u,ariaRowIndex:f,absoluteRowIndex:y,isAltRow:k,isHidden:h,isRowReorderable:j,rowHeight:O,rows:R,leafColumns:p,groupLevelCount:b,stackedLayoutSettings:w,cells:F,editMode:x,isSelected:S,isHighlighted:D,isInEdit:v,preparedCells:M,showDetailToggle:_,isDetailExpanded:q,detailExpandField:A})=>{var C,G,$;if(e.rowType==="data")return t.createElement(V.GridStackedRow,{key:c,dataItem:e.dataItem,columns:p,stackedLayoutSettings:w,isAltRow:k,isSelected:S,isInEdit:v,cells:F,dataIndex:s,idPrefix:u,ariaRowIndex:f,absoluteRowIndex:y,groupLevel:b,preparedCells:M,editMode:x,showDetailToggle:_,isDetailExpanded:q,detailExpandField:A});const I=b+1,E=e.level||0,T=Math.max(1,I-E),N=Array.from({length:E},(d,r)=>t.createElement("td",{key:`group-cell-${c}-${r}`,className:"k-table-group-td k-group-cell k-table-td"}));let m;if(e.rowType==="groupHeader"){const d=(C=e.dataItem)==null?void 0:C.field,r=(G=e.dataItem)==null?void 0:G.value,g=d!==void 0?(()=>{const l=String(d),n=p.find(o=>o.field===l),i=n==null?void 0:n.title;return typeof i=="string"&&i.length?i:l})():void 0;let a="";if(d!==void 0){let l;r instanceof Date?l=r.toString():l=String(r),a=`${g}: ${l}`}else r instanceof Date?a=r.toString():r!==void 0&&(a=String(r));m=t.createElement(t.Fragment,null,N,t.createElement("td",{className:"k-table-td",colSpan:T,role:"gridcell","aria-expanded":e.expanded},t.createElement("p",{className:"k-reset"},t.createElement(B.GridGroupCellToggle,{id:"",dataItem:e.dataItem,dataIndex:e.dataIndex,field:"value",expanded:e.expanded,group:e.group,columnPosition:{},ariaColumnIndex:1,isSelected:!1}),t.createElement("span",{className:"k-value"},a))))}else{const d=p.filter(a=>{const l=!!a._type,n=a.isAccessible===!1;return!a.hidden&&!l&&!n&&(a.columnType==="data"||a.columnType===void 0)}),r=($=e.dataItem)==null?void 0:$.aggregates,g=d.map(a=>{const l=a.field;if(!l||!r)return null;const n=r[l];if(!n||typeof n!="object")return null;const i=Object.keys(n).filter(o=>n[o]!==void 0&&n[o]!==null).map(o=>`${o.length?`${o.charAt(0).toUpperCase()}${o.slice(1)}`:o}: ${String(n[o])}`);return i.length===0?null:t.createElement("div",{key:`agg-${c}-${l}`,className:"k-grid-template-column"},t.createElement("p",{className:"k-grid-template-column-header"},a.title||l),t.createElement("p",{className:"k-reset"},i.join(", ")))}).filter(Boolean);if(e.rowType==="groupFooter"&&g.length===0)return t.createElement(t.Fragment,{key:c});m=t.createElement(t.Fragment,null,N,t.createElement("td",{className:"k-table-td",colSpan:T},t.createElement("div",{className:"k-grid-column-template"},g)))}return t.createElement(L.GridRow,{key:c,dataItem:e.dataItem,isAltRow:k,isInEdit:v,rowType:e.rowType,isRowReorderable:j,isHidden:h,onClick:null,onDoubleClick:null,rowHeight:O,ariaRowIndex:f,absoluteRowIndex:y,dataIndex:s,isSelected:S,isHighlighted:D,rows:R},m)};exports.StackedModeRow=H;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import * as e from "react";
|
|
9
|
+
import { GridGroupCellToggle as _ } from "../cells/groupcell/GridGroupCellToggle.mjs";
|
|
10
|
+
import { GridRow as H } from "../rows/GridRow.mjs";
|
|
11
|
+
import { GridStackedRow as O } from "./GridStackedRow.mjs";
|
|
12
|
+
const J = ({
|
|
13
|
+
item: t,
|
|
14
|
+
rowId: d,
|
|
15
|
+
dataIndex: m,
|
|
16
|
+
idPrefix: h,
|
|
17
|
+
ariaRowIndex: u,
|
|
18
|
+
absoluteRowIndex: f,
|
|
19
|
+
isAltRow: k,
|
|
20
|
+
isHidden: x,
|
|
21
|
+
isRowReorderable: F,
|
|
22
|
+
rowHeight: G,
|
|
23
|
+
rows: A,
|
|
24
|
+
leafColumns: p,
|
|
25
|
+
groupLevelCount: y,
|
|
26
|
+
stackedLayoutSettings: I,
|
|
27
|
+
cells: j,
|
|
28
|
+
editMode: D,
|
|
29
|
+
isSelected: v,
|
|
30
|
+
isHighlighted: R,
|
|
31
|
+
isInEdit: E,
|
|
32
|
+
preparedCells: w,
|
|
33
|
+
showDetailToggle: B,
|
|
34
|
+
isDetailExpanded: L,
|
|
35
|
+
detailExpandField: M
|
|
36
|
+
}) => {
|
|
37
|
+
var T, $, C;
|
|
38
|
+
if (t.rowType === "data")
|
|
39
|
+
return /* @__PURE__ */ e.createElement(
|
|
40
|
+
O,
|
|
41
|
+
{
|
|
42
|
+
key: d,
|
|
43
|
+
dataItem: t.dataItem,
|
|
44
|
+
columns: p,
|
|
45
|
+
stackedLayoutSettings: I,
|
|
46
|
+
isAltRow: k,
|
|
47
|
+
isSelected: v,
|
|
48
|
+
isInEdit: E,
|
|
49
|
+
cells: j,
|
|
50
|
+
dataIndex: m,
|
|
51
|
+
idPrefix: h,
|
|
52
|
+
ariaRowIndex: u,
|
|
53
|
+
absoluteRowIndex: f,
|
|
54
|
+
groupLevel: y,
|
|
55
|
+
preparedCells: w,
|
|
56
|
+
editMode: D,
|
|
57
|
+
showDetailToggle: B,
|
|
58
|
+
isDetailExpanded: L,
|
|
59
|
+
detailExpandField: M
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
const V = y + 1, S = t.level || 0, b = Math.max(1, V - S), N = Array.from({ length: S }, (c, r) => /* @__PURE__ */ e.createElement("td", { key: `group-cell-${d}-${r}`, className: "k-table-group-td k-group-cell k-table-td" }));
|
|
63
|
+
let g;
|
|
64
|
+
if (t.rowType === "groupHeader") {
|
|
65
|
+
const c = (T = t.dataItem) == null ? void 0 : T.field, r = ($ = t.dataItem) == null ? void 0 : $.value, i = c !== void 0 ? (() => {
|
|
66
|
+
const l = String(c), n = p.find((o) => o.field === l), s = n == null ? void 0 : n.title;
|
|
67
|
+
return typeof s == "string" && s.length ? s : l;
|
|
68
|
+
})() : void 0;
|
|
69
|
+
let a = "";
|
|
70
|
+
if (c !== void 0) {
|
|
71
|
+
let l;
|
|
72
|
+
r instanceof Date ? l = r.toString() : l = String(r), a = `${i}: ${l}`;
|
|
73
|
+
} else r instanceof Date ? a = r.toString() : r !== void 0 && (a = String(r));
|
|
74
|
+
g = /* @__PURE__ */ e.createElement(e.Fragment, null, N, /* @__PURE__ */ e.createElement("td", { className: "k-table-td", colSpan: b, role: "gridcell", "aria-expanded": t.expanded }, /* @__PURE__ */ e.createElement("p", { className: "k-reset" }, /* @__PURE__ */ e.createElement(
|
|
75
|
+
_,
|
|
76
|
+
{
|
|
77
|
+
id: "",
|
|
78
|
+
dataItem: t.dataItem,
|
|
79
|
+
dataIndex: t.dataIndex,
|
|
80
|
+
field: "value",
|
|
81
|
+
expanded: t.expanded,
|
|
82
|
+
group: t.group,
|
|
83
|
+
columnPosition: {},
|
|
84
|
+
ariaColumnIndex: 1,
|
|
85
|
+
isSelected: !1
|
|
86
|
+
}
|
|
87
|
+
), /* @__PURE__ */ e.createElement("span", { className: "k-value" }, a))));
|
|
88
|
+
} else {
|
|
89
|
+
const c = p.filter((a) => {
|
|
90
|
+
const l = !!a._type, n = a.isAccessible === !1;
|
|
91
|
+
return !a.hidden && !l && !n && (a.columnType === "data" || a.columnType === void 0);
|
|
92
|
+
}), r = (C = t.dataItem) == null ? void 0 : C.aggregates, i = c.map((a) => {
|
|
93
|
+
const l = a.field;
|
|
94
|
+
if (!l || !r)
|
|
95
|
+
return null;
|
|
96
|
+
const n = r[l];
|
|
97
|
+
if (!n || typeof n != "object")
|
|
98
|
+
return null;
|
|
99
|
+
const s = Object.keys(n).filter((o) => n[o] !== void 0 && n[o] !== null).map((o) => `${o.length ? `${o.charAt(0).toUpperCase()}${o.slice(1)}` : o}: ${String(n[o])}`);
|
|
100
|
+
return s.length === 0 ? null : /* @__PURE__ */ e.createElement("div", { key: `agg-${d}-${l}`, className: "k-grid-template-column" }, /* @__PURE__ */ e.createElement("p", { className: "k-grid-template-column-header" }, a.title || l), /* @__PURE__ */ e.createElement("p", { className: "k-reset" }, s.join(", ")));
|
|
101
|
+
}).filter(Boolean);
|
|
102
|
+
if (t.rowType === "groupFooter" && i.length === 0)
|
|
103
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, { key: d });
|
|
104
|
+
g = /* @__PURE__ */ e.createElement(e.Fragment, null, N, /* @__PURE__ */ e.createElement("td", { className: "k-table-td", colSpan: b }, /* @__PURE__ */ e.createElement("div", { className: "k-grid-column-template" }, i)));
|
|
105
|
+
}
|
|
106
|
+
return /* @__PURE__ */ e.createElement(
|
|
107
|
+
H,
|
|
108
|
+
{
|
|
109
|
+
key: d,
|
|
110
|
+
dataItem: t.dataItem,
|
|
111
|
+
isAltRow: k,
|
|
112
|
+
isInEdit: E,
|
|
113
|
+
rowType: t.rowType,
|
|
114
|
+
isRowReorderable: F,
|
|
115
|
+
isHidden: x,
|
|
116
|
+
onClick: null,
|
|
117
|
+
onDoubleClick: null,
|
|
118
|
+
rowHeight: G,
|
|
119
|
+
ariaRowIndex: u,
|
|
120
|
+
absoluteRowIndex: f,
|
|
121
|
+
dataIndex: m,
|
|
122
|
+
isSelected: v,
|
|
123
|
+
isHighlighted: R,
|
|
124
|
+
rows: A
|
|
125
|
+
},
|
|
126
|
+
g
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
export {
|
|
130
|
+
J as StackedModeRow
|
|
131
|
+
};
|