@progress/kendo-react-grid 16.2.0-develop.9 → 16.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EULA.pdf +0 -0
- package/EULA.rtf +2730 -0
- package/EULA.txt +292 -0
- package/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +234 -232
- package/VirtualScroll.js +1 -1
- package/VirtualScroll.mjs +9 -9
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +113 -85
- package/header/client/GridCustomHeaderColumnMenu.d.ts +22 -0
- package/header/client/GridCustomHeaderColumnMenu.js +9 -0
- package/header/client/GridCustomHeaderColumnMenu.mjs +28 -0
- package/interfaces/GridCellsSettings.d.ts +32 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -22
- package/utils/wheelTouchScroll.d.ts +5 -4
- package/utils/wheelTouchScroll.js +1 -1
- package/utils/wheelTouchScroll.mjs +22 -22
package/GridClientWrapper.mjs
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as c from "react";
|
|
10
10
|
import { useAdaptiveModeContext as Tr, canUseDOM as J, getActiveElement as Mr, useDir as Gr, setScrollbarWidth as mt, cloneArray as Hr, useWebMcpRegister as Ar, RowHeightService as Fr, getter as X } from "@progress/kendo-react-common";
|
|
11
|
-
import { filterBy as
|
|
12
|
-
import { getSelectionOptions as xe, populateClipboardData as
|
|
11
|
+
import { filterBy as Lr } from "@progress/kendo-data-query";
|
|
12
|
+
import { getSelectionOptions as xe, populateClipboardData as Wr, ClipboardActionType as Ve, getEditableOptions as Or, tableKeyboardNavigation as ie, ClipboardService as zr, TableKeyboardNavigationContext as Br, updateLeft as pr, updateRight as Nr, getGroupExpandableOptions as jr, groupExpandReducer as Ur, getDetailExpandableOptions as Vr, detailExpandReducer as qr, getSelectedState as Pt, editReducer as $r, EDIT_ACTION as _r, closestTagName as ke, getSelectedStateFromKeyDown as Zr, getColumnIndex as Jr, getRowIndex as Xr } from "@progress/kendo-react-data-tools";
|
|
13
13
|
import { ColumnResize as Yr } from "./drag/ColumnResize.mjs";
|
|
14
14
|
import { CommonDragLogic as Qr } from "./drag/CommonDragLogic.mjs";
|
|
15
15
|
import { useStickyGroups as en } from "./hooks/useStickyGroups.mjs";
|
|
@@ -24,15 +24,15 @@ import { BasePDFExport as Rn } from "./BasePDFExport.mjs";
|
|
|
24
24
|
import { BaseCSVExport as bn } from "./BaseCSVExport.mjs";
|
|
25
25
|
import { GridContext as vn } from "./utils/GridContext.mjs";
|
|
26
26
|
import { operators as Cn } from "./filterCommon.mjs";
|
|
27
|
-
const In = (t,
|
|
28
|
-
const Y = Object.keys(
|
|
29
|
-
return t.reduce((M, Q) => (M[Q[
|
|
30
|
-
}, Rt = (t,
|
|
27
|
+
const In = (t, K, p, S) => {
|
|
28
|
+
const Y = Object.keys(K.cells).map((M) => p.findIndex((Q) => Q.field === M)), C = Object.keys(K.cells).length > 0 ? Y : !0;
|
|
29
|
+
return t.reduce((M, Q) => (M[Q[S != null ? S : "id"]] = C, M), {});
|
|
30
|
+
}, Rt = (t, K, p, S) => K.reduce((C, M) => ({
|
|
31
31
|
...C,
|
|
32
|
-
...In(
|
|
32
|
+
...In(Lr(t, M), M, p, S)
|
|
33
33
|
}), {}), zn = (t) => {
|
|
34
34
|
var ft;
|
|
35
|
-
const
|
|
35
|
+
const K = t.gridProps.isClient, p = typeof t.gridProps.scrollable == "object" ? t.gridProps.scrollable.mode : t.gridProps.scrollable, { overlayScrollbar: S, wheelMultiplier: Y } = sn(t.gridProps.scrollable), [C, M] = c.useState({}), Q = Tr(), qe = c.useRef(null), Ke = c.useRef(null), de = c.useRef({}), bt = (e) => {
|
|
36
36
|
e.event.preventDefault(), M({
|
|
37
37
|
...C,
|
|
38
38
|
show: !0,
|
|
@@ -46,7 +46,7 @@ const In = (t, D, p, K) => {
|
|
|
46
46
|
}, $e = () => {
|
|
47
47
|
M({});
|
|
48
48
|
}, vt = (e) => {
|
|
49
|
-
const r = t.gridProps.dataItemKey || "",
|
|
49
|
+
const r = t.gridProps.dataItemKey || "", n = C.dataItem, o = t.gridProps.pinnedTopRows || [], i = t.gridProps.pinnedBottomRows || [], a = r ? n[r] : void 0, d = a !== void 0 && o.some((l) => l[r] === a), s = a !== void 0 && i.some((l) => l[r] === a);
|
|
50
50
|
return e.map((l) => {
|
|
51
51
|
const u = typeof l == "string" ? mn[l] : l;
|
|
52
52
|
return u && u.name === De.pinRow && u.items ? {
|
|
@@ -79,9 +79,9 @@ const In = (t, D, p, K) => {
|
|
|
79
79
|
]), le = c.useMemo(() => {
|
|
80
80
|
const e = (w == null ? void 0 : w.contextMenu) || t.gridProps.contextMenu, r = typeof e == "function" ? e(C) : e;
|
|
81
81
|
if (r && C.offset) {
|
|
82
|
-
const
|
|
82
|
+
const n = C.dataItem ? ht.body : ht.head, o = r[n], i = C.dataItem ? Ze : _e;
|
|
83
83
|
let a;
|
|
84
|
-
return
|
|
84
|
+
return o === !0 || o === void 0 ? a = i : o !== !1 && (a = o), t.gridProps.pinnable && a && C.dataItem ? vt(a) : a;
|
|
85
85
|
}
|
|
86
86
|
}, [
|
|
87
87
|
t.gridProps.contextMenu,
|
|
@@ -92,18 +92,18 @@ const In = (t, D, p, K) => {
|
|
|
92
92
|
w
|
|
93
93
|
]), Ct = (e) => {
|
|
94
94
|
var d, s, l, u, f, v, R, j, g;
|
|
95
|
-
const r = e.event.item,
|
|
96
|
-
target:
|
|
95
|
+
const r = e.event.item, n = {
|
|
96
|
+
target: x.current,
|
|
97
97
|
syntheticEvent: e.event.syntheticEvent,
|
|
98
98
|
nativeEvent: e.event.nativeEvent,
|
|
99
99
|
menuItem: r,
|
|
100
100
|
...e
|
|
101
101
|
};
|
|
102
|
-
t.gridProps.onContextMenuItemClick && m(t.gridProps.onContextMenuItemClick,
|
|
103
|
-
const
|
|
102
|
+
t.gridProps.onContextMenuItemClick && m(t.gridProps.onContextMenuItemClick, n);
|
|
103
|
+
const o = T(), i = {
|
|
104
104
|
selectedField: "",
|
|
105
105
|
componentId: t.id,
|
|
106
|
-
dataItems:
|
|
106
|
+
dataItems: o,
|
|
107
107
|
dataItem: e.dataItem,
|
|
108
108
|
startRowIndex: -1,
|
|
109
109
|
endRowIndex: -1,
|
|
@@ -115,12 +115,12 @@ const In = (t, D, p, K) => {
|
|
|
115
115
|
shiftKey: !1,
|
|
116
116
|
isDrag: !1,
|
|
117
117
|
...xe(t.gridProps.selectable),
|
|
118
|
-
...
|
|
119
|
-
}, a =
|
|
118
|
+
...n
|
|
119
|
+
}, a = o.findIndex((D) => D === e.dataItem);
|
|
120
120
|
switch ((d = r.data) == null ? void 0 : d.action) {
|
|
121
121
|
case "SortCommand":
|
|
122
122
|
if (w) {
|
|
123
|
-
const
|
|
123
|
+
const D = (s = r.name) == null ? void 0 : s.toLowerCase().includes("asc"), Z = ((l = r.name) == null ? void 0 : l.toLowerCase().includes("desc")) ? "desc" : void 0, B = D ? "asc" : Z, oe = r.name ? B : void 0;
|
|
124
124
|
Je(e.event.syntheticEvent, w, oe);
|
|
125
125
|
}
|
|
126
126
|
break;
|
|
@@ -137,7 +137,7 @@ const In = (t, D, p, K) => {
|
|
|
137
137
|
Vt(i);
|
|
138
138
|
break;
|
|
139
139
|
case "ReorderRowCommand":
|
|
140
|
-
ce.current = e.dataItem, (u = r.name) != null && u.toLowerCase().includes("rowup") && a > 0 && ae(e.event.syntheticEvent, a - 1, "before"), (f = r.name) != null && f.toLowerCase().includes("rowdown") && a <
|
|
140
|
+
ce.current = e.dataItem, (u = r.name) != null && u.toLowerCase().includes("rowup") && a > 0 && ae(e.event.syntheticEvent, a - 1, "before"), (f = r.name) != null && f.toLowerCase().includes("rowdown") && a < o.length - 1 && ae(e.event.syntheticEvent, a + 1, "after"), (v = r.name) != null && v.toLowerCase().includes("rowtop") && ae(e.event.syntheticEvent, 0, "before"), (R = r.name) != null && R.toLowerCase().includes("rowbottom") && ae(e.event.syntheticEvent, o.length - 1, "after");
|
|
141
141
|
break;
|
|
142
142
|
case "CopySelectionCommand":
|
|
143
143
|
Pe(
|
|
@@ -175,43 +175,43 @@ const In = (t, D, p, K) => {
|
|
|
175
175
|
}, se = () => {
|
|
176
176
|
const e = t.columnsRef.filter((r) => r.declarationIndex >= 0 && r.parentIndex === -1);
|
|
177
177
|
return an(e);
|
|
178
|
-
}, It = (e, r,
|
|
179
|
-
if (t.gridProps.onContextMenu &&
|
|
180
|
-
const
|
|
181
|
-
target:
|
|
178
|
+
}, It = (e, r, n) => {
|
|
179
|
+
if (t.gridProps.onContextMenu && K) {
|
|
180
|
+
const o = {
|
|
181
|
+
target: x.current,
|
|
182
182
|
syntheticEvent: e,
|
|
183
183
|
nativeEvent: e.nativeEvent,
|
|
184
184
|
dataItem: r,
|
|
185
|
-
field:
|
|
185
|
+
field: n
|
|
186
186
|
};
|
|
187
|
-
m(t.gridProps.onContextMenu,
|
|
187
|
+
m(t.gridProps.onContextMenu, o);
|
|
188
188
|
}
|
|
189
189
|
t.gridProps.contextMenu && bt({
|
|
190
190
|
event: e,
|
|
191
191
|
dataItem: r,
|
|
192
|
-
field:
|
|
192
|
+
field: n
|
|
193
193
|
});
|
|
194
194
|
}, yt = (e) => {
|
|
195
195
|
var d, s;
|
|
196
196
|
if (e.target !== e.currentTarget)
|
|
197
197
|
return;
|
|
198
198
|
clearTimeout(pe.current), y.current && (y.current.table = A.current);
|
|
199
|
-
const r = e.currentTarget.scrollLeft,
|
|
200
|
-
t.gridProps.columnVirtualization && (!
|
|
199
|
+
const r = e.currentTarget.scrollLeft, n = e.currentTarget.scrollTop, o = n !== Be.current;
|
|
200
|
+
t.gridProps.columnVirtualization && (!k || n === Be.current) && (pe.current = window.setTimeout(() => {
|
|
201
201
|
re();
|
|
202
|
-
}, 0)), t.gridProps.scrollLeftRef && (t.gridProps.scrollLeftRef.current = r), _.current && _.current.setScrollLeft(r), $.current && $.current.setScrollLeft(r),
|
|
202
|
+
}, 0)), t.gridProps.scrollLeftRef && (t.gridProps.scrollLeftRef.current = r), _.current && _.current.setScrollLeft(r), $.current && $.current.setScrollLeft(r), L != null && L.current && L.current.setScrollLeft(r), W != null && W.current && W.current.setScrollLeft(r), O != null && O.current && O.current.setScrollLeft(r), z != null && z.current && z.current.setScrollLeft(r);
|
|
203
203
|
const i = (d = t.gridProps.virtualSkipRef) == null ? void 0 : d.current;
|
|
204
|
-
y.current &&
|
|
205
|
-
const a =
|
|
206
|
-
t.gridProps.onScroll &&
|
|
204
|
+
y.current && o && y.current.scrollHandler(e);
|
|
205
|
+
const a = k && ((s = t.gridProps.virtualSkipRef) == null ? void 0 : s.current) !== i;
|
|
206
|
+
t.gridProps.onScroll && K && m(t.gridProps.onScroll, {
|
|
207
207
|
...I(e)
|
|
208
|
-
}), Be.current =
|
|
208
|
+
}), Be.current = n, !dt.current && q.current && Math.abs(q.current.scrollTop - n) > 1 && (Fe.current = !0, q.current.scrollTop = n), a || st();
|
|
209
209
|
}, wt = (e) => {
|
|
210
|
-
var
|
|
210
|
+
var n, o;
|
|
211
211
|
const r = e.target;
|
|
212
212
|
if ((e.keyCode === 38 || e.keyCode === 40) && r.closest(".k-grid-sticky-container")) {
|
|
213
|
-
const i = parseInt(((
|
|
214
|
-
if (!isNaN(i) && a && !((
|
|
213
|
+
const i = parseInt(((n = r.closest("tr")) == null ? void 0 : n.getAttribute("absolute-row-index")) || "", 10), a = r.getAttribute("data-keyboardnavid");
|
|
214
|
+
if (!isNaN(i) && a && !((o = H.current) == null ? void 0 : o.querySelector(`tr[absolute-row-index="${i}"]`)))
|
|
215
215
|
return we.current = {
|
|
216
216
|
navId: a,
|
|
217
217
|
key: e.key,
|
|
@@ -224,14 +224,14 @@ const In = (t, D, p, K) => {
|
|
|
224
224
|
var a;
|
|
225
225
|
if (!we.current || !F.current)
|
|
226
226
|
return;
|
|
227
|
-
const { navId: e, key: r, code:
|
|
227
|
+
const { navId: e, key: r, code: n, keyCode: o } = we.current, i = (a = H.current) == null ? void 0 : a.querySelector(
|
|
228
228
|
`[data-keyboardnavid="${e}"]`
|
|
229
229
|
);
|
|
230
230
|
i && i.dispatchEvent(
|
|
231
231
|
new KeyboardEvent("keydown", {
|
|
232
232
|
key: r,
|
|
233
|
-
code:
|
|
234
|
-
keyCode:
|
|
233
|
+
code: n,
|
|
234
|
+
keyCode: o,
|
|
235
235
|
bubbles: !0,
|
|
236
236
|
cancelable: !0
|
|
237
237
|
})
|
|
@@ -258,7 +258,7 @@ const In = (t, D, p, K) => {
|
|
|
258
258
|
selectedField: "",
|
|
259
259
|
...I(e)
|
|
260
260
|
};
|
|
261
|
-
t.gridProps.onKeyDown &&
|
|
261
|
+
t.gridProps.onKeyDown && K && m(t.gridProps.onKeyDown, r);
|
|
262
262
|
}, xt = (e) => {
|
|
263
263
|
ie.onFocus(e, {
|
|
264
264
|
navigatable: !!t.gridProps.navigatable,
|
|
@@ -267,26 +267,26 @@ const In = (t, D, p, K) => {
|
|
|
267
267
|
}, kt = (e) => {
|
|
268
268
|
const { columnsRef: r } = t;
|
|
269
269
|
if (e.action === "moveToNextPage" && _t(e.event), e.action === "moveToPrevPage" && Zt(e.event), e.focusElement && (e.action === "reorderToRight" || e.action === "reorderToLeft")) {
|
|
270
|
-
const
|
|
271
|
-
if (!r[
|
|
270
|
+
const n = parseInt(e.focusElement.ariaColIndex, 10) - 1;
|
|
271
|
+
if (!r[n].reorderable)
|
|
272
272
|
return;
|
|
273
|
-
if (e.action === "reorderToRight" &&
|
|
274
|
-
if (r[
|
|
273
|
+
if (e.action === "reorderToRight" && n < t.columnsRef.length - 1) {
|
|
274
|
+
if (r[n + 1].disableReorder)
|
|
275
275
|
return;
|
|
276
|
-
fe(
|
|
276
|
+
fe(n, n + 1, e.event);
|
|
277
277
|
}
|
|
278
|
-
if (e.action === "reorderToLeft" &&
|
|
279
|
-
if (r[
|
|
278
|
+
if (e.action === "reorderToLeft" && n > 0) {
|
|
279
|
+
if (r[n - 1].disableReorder)
|
|
280
280
|
return;
|
|
281
|
-
fe(
|
|
281
|
+
fe(n, n - 1, e.event);
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
|
-
if (e.action === "select" && zt(e.event), t.gridProps.onNavigationAction &&
|
|
285
|
-
const
|
|
284
|
+
if (e.action === "select" && zt(e.event), t.gridProps.onNavigationAction && K) {
|
|
285
|
+
const n = {
|
|
286
286
|
focusElement: e.focusElement,
|
|
287
287
|
...I(e.event)
|
|
288
288
|
};
|
|
289
|
-
m(t.gridProps.onNavigationAction,
|
|
289
|
+
m(t.gridProps.onNavigationAction, n);
|
|
290
290
|
}
|
|
291
291
|
}, Dt = (e, r) => {
|
|
292
292
|
t.gridProps.onRowClick && ke(e.target, "TD") && m(t.gridProps.onRowClick, {
|
|
@@ -310,16 +310,16 @@ const In = (t, D, p, K) => {
|
|
|
310
310
|
edit: {},
|
|
311
311
|
...I(e.syntheticEvent)
|
|
312
312
|
});
|
|
313
|
-
}, Gt = (e, r,
|
|
314
|
-
var
|
|
313
|
+
}, Gt = (e, r, n) => {
|
|
314
|
+
var o, i;
|
|
315
315
|
if (gt.enabled && gt.mode === "incell" && t.gridProps.dataItemKey) {
|
|
316
316
|
if (t.gridProps.pinnable && t.gridProps.editZoneRef) {
|
|
317
|
-
const d = !!((i = (
|
|
317
|
+
const d = !!((i = (o = e.target).closest) != null && i.call(o, ".k-grid-pinned-container"));
|
|
318
318
|
t.gridProps.editZoneRef.current = d ? "pinned" : "body";
|
|
319
319
|
}
|
|
320
320
|
const a = $r(t.gridProps.edit, {
|
|
321
321
|
type: _r.ENTER_FIELD_EDIT,
|
|
322
|
-
payload: { id: r[t.gridProps.dataItemKey], field:
|
|
322
|
+
payload: { id: r[t.gridProps.dataItemKey], field: n }
|
|
323
323
|
});
|
|
324
324
|
t.gridProps.onEditChange && m(t.gridProps.onEditChange, {
|
|
325
325
|
edit: a,
|
|
@@ -327,21 +327,21 @@ const In = (t, D, p, K) => {
|
|
|
327
327
|
});
|
|
328
328
|
}
|
|
329
329
|
}, Ht = (e, r) => {
|
|
330
|
-
var
|
|
330
|
+
var o;
|
|
331
331
|
if (Vr(t.detailExpandable).enabled) {
|
|
332
|
-
const i = qr((
|
|
332
|
+
const i = qr((o = t.gridProps.detailExpand) != null ? o : {}, e);
|
|
333
333
|
t.gridProps.onDetailExpandChange && m(t.gridProps.onDetailExpandChange, {
|
|
334
334
|
...I(r),
|
|
335
335
|
detailExpand: i
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
}, At = (e, r) => {
|
|
339
|
-
var
|
|
340
|
-
const
|
|
339
|
+
var o;
|
|
340
|
+
const n = jr(
|
|
341
341
|
typeof t.gridProps.groupable == "object" ? t.gridProps.groupable.expandable !== !1 : t.gridProps.groupable
|
|
342
342
|
);
|
|
343
|
-
if (
|
|
344
|
-
const i = Ur((
|
|
343
|
+
if (n.enabled) {
|
|
344
|
+
const i = Ur((o = t.gridProps.groupExpand) != null ? o : [], e, n);
|
|
345
345
|
t.gridProps.onGroupExpandChange && m(t.gridProps.onGroupExpandChange, {
|
|
346
346
|
...I(r),
|
|
347
347
|
groupExpand: i
|
|
@@ -350,17 +350,17 @@ const In = (t, D, p, K) => {
|
|
|
350
350
|
Er(e.group);
|
|
351
351
|
}, Ft = c.useCallback(
|
|
352
352
|
(e) => {
|
|
353
|
-
const { dataItemKey: r = "", pinnedTopRows:
|
|
353
|
+
const { dataItemKey: r = "", pinnedTopRows: n = [], pinnedBottomRows: o = [] } = t.gridProps;
|
|
354
354
|
if (!r || !e)
|
|
355
355
|
return "none";
|
|
356
356
|
const i = e[r];
|
|
357
|
-
return
|
|
357
|
+
return n != null && n.some((a) => a[r] === i) ? "top" : o != null && o.some((a) => a[r] === i) ? "bottom" : "none";
|
|
358
358
|
},
|
|
359
359
|
[t.gridProps.pinnedTopRows, t.gridProps.pinnedBottomRows, t.gridProps.dataItemKey]
|
|
360
360
|
), ue = (e, r) => {
|
|
361
361
|
if (!t.gridProps.pinnable)
|
|
362
362
|
return;
|
|
363
|
-
const { dataItemKey:
|
|
363
|
+
const { dataItemKey: n = "", pinnedTopRows: o = [], pinnedBottomRows: i = [] } = t.gridProps, a = r[n], d = o.filter((u) => u[n] !== a), s = i.filter((u) => u[n] !== a);
|
|
364
364
|
let l;
|
|
365
365
|
switch (e) {
|
|
366
366
|
case "pinTop":
|
|
@@ -376,13 +376,13 @@ const In = (t, D, p, K) => {
|
|
|
376
376
|
return;
|
|
377
377
|
}
|
|
378
378
|
t.gridProps.onRowPinChange && m(t.gridProps.onRowPinChange, l);
|
|
379
|
-
}, Je = (e, r,
|
|
380
|
-
const { allowUnsort:
|
|
379
|
+
}, Je = (e, r, n) => {
|
|
380
|
+
const { allowUnsort: o, mode: i } = Pn(
|
|
381
381
|
t.gridProps.sortable || !1,
|
|
382
382
|
r.sortable || !1
|
|
383
|
-
), a = (t.gridProps.sort || []).filter((l) => l.field === r.field)[0], d =
|
|
383
|
+
), a = (t.gridProps.sort || []).filter((l) => l.field === r.field)[0], d = n || hn[o][a && a.dir || ""], s = i === "single" ? [] : (t.gridProps.sort || []).filter((l) => l.field !== r.field);
|
|
384
384
|
d !== "" && r.field && s.push({ field: r.field, dir: d }), Ye(s, e);
|
|
385
|
-
},
|
|
385
|
+
}, Lt = (e) => {
|
|
386
386
|
t.gridProps.onItemChange && m(t.gridProps.onItemChange, {
|
|
387
387
|
...I(e.syntheticEvent),
|
|
388
388
|
dataItem: e.dataItem,
|
|
@@ -390,12 +390,12 @@ const In = (t, D, p, K) => {
|
|
|
390
390
|
field: e.field,
|
|
391
391
|
value: e.value
|
|
392
392
|
});
|
|
393
|
-
},
|
|
393
|
+
}, Wt = (e) => {
|
|
394
394
|
var r;
|
|
395
395
|
if (t.gridProps.onSelectionChange && h.enabled) {
|
|
396
|
-
const { event:
|
|
397
|
-
...I(
|
|
398
|
-
dataItem:
|
|
396
|
+
const { event: n, dataItem: o, dataIndex: i, columnIndex: a } = e, d = {
|
|
397
|
+
...I(n),
|
|
398
|
+
dataItem: o,
|
|
399
399
|
startColIndex: a,
|
|
400
400
|
endColIndex: a,
|
|
401
401
|
startRowIndex: i,
|
|
@@ -424,13 +424,13 @@ const In = (t, D, p, K) => {
|
|
|
424
424
|
var u;
|
|
425
425
|
if (!t.gridProps.onSelectionChange || !h.enabled || !t.gridProps.dataItemKey)
|
|
426
426
|
return;
|
|
427
|
-
const { event: r, groupDataItem:
|
|
427
|
+
const { event: r, groupDataItem: n, selectAll: o } = e, i = X(t.gridProps.dataItemKey), a = dn(n), d = T(), l = { ...(u = t.gridProps.select) != null ? u : {} };
|
|
428
428
|
a.forEach((f) => {
|
|
429
429
|
const v = i(f);
|
|
430
|
-
v !== void 0 && (
|
|
430
|
+
v !== void 0 && (o ? l[v] = !0 : delete l[v]);
|
|
431
431
|
}), m(t.gridProps.onSelectionChange, {
|
|
432
432
|
...I(r),
|
|
433
|
-
dataItem:
|
|
433
|
+
dataItem: n,
|
|
434
434
|
startColIndex: 0,
|
|
435
435
|
endColIndex: 0,
|
|
436
436
|
startRowIndex: 0,
|
|
@@ -458,19 +458,19 @@ const In = (t, D, p, K) => {
|
|
|
458
458
|
componentId: t.id,
|
|
459
459
|
selectedField: "",
|
|
460
460
|
...I(e)
|
|
461
|
-
},
|
|
461
|
+
}, n = Zr({
|
|
462
462
|
event: r,
|
|
463
463
|
selectedState: (l = t.gridProps.select) != null ? l : {},
|
|
464
464
|
dataItemKey: t.gridProps.dataItemKey
|
|
465
465
|
});
|
|
466
|
-
if (
|
|
466
|
+
if (n === t.gridProps.select)
|
|
467
467
|
return;
|
|
468
|
-
const
|
|
468
|
+
const o = e.target, i = ke(o, "TD"), a = ke(o, "TR"), d = Jr(i), s = Xr(a);
|
|
469
469
|
if (d !== void 0 && s !== void 0) {
|
|
470
470
|
const f = (u = ln(t.gridProps.data)) == null ? void 0 : u[s];
|
|
471
471
|
t.gridProps.onSelectionChange && m(t.gridProps.onSelectionChange, {
|
|
472
472
|
...r,
|
|
473
|
-
select:
|
|
473
|
+
select: n,
|
|
474
474
|
dataItem: f,
|
|
475
475
|
startRowIndex: s,
|
|
476
476
|
startColIndex: d,
|
|
@@ -489,11 +489,11 @@ const In = (t, D, p, K) => {
|
|
|
489
489
|
if (t.gridProps.onHeaderSelectionChange && h.enabled) {
|
|
490
490
|
const r = T();
|
|
491
491
|
m(t.gridProps.onHeaderSelectionChange, {
|
|
492
|
-
select: e.syntheticEvent.target.checked ? r.reduce((
|
|
492
|
+
select: e.syntheticEvent.target.checked ? r.reduce((n, o) => (t.gridProps.dataItemKey && X(t.gridProps.dataItemKey)(o) !== void 0 && (n[X(t.gridProps.dataItemKey)(o)] = !0), n), {}) : {},
|
|
493
493
|
field: e.field,
|
|
494
494
|
nativeEvent: e.syntheticEvent && e.syntheticEvent.nativeEvent,
|
|
495
495
|
syntheticEvent: e.syntheticEvent,
|
|
496
|
-
target:
|
|
496
|
+
target: x.current,
|
|
497
497
|
dataItems: r
|
|
498
498
|
});
|
|
499
499
|
}
|
|
@@ -503,10 +503,10 @@ const In = (t, D, p, K) => {
|
|
|
503
503
|
select: r
|
|
504
504
|
});
|
|
505
505
|
}, pt = (e, r) => {
|
|
506
|
-
const
|
|
507
|
-
if (!
|
|
506
|
+
const n = t.gridProps.dataItemKey;
|
|
507
|
+
if (!n || !r)
|
|
508
508
|
return;
|
|
509
|
-
const
|
|
509
|
+
const o = X(n), i = T().findIndex((a) => o(a) === o(r));
|
|
510
510
|
i !== -1 && Xe({
|
|
511
511
|
...e,
|
|
512
512
|
startRowIndex: i,
|
|
@@ -515,14 +515,14 @@ const In = (t, D, p, K) => {
|
|
|
515
515
|
}, Xe = (e) => {
|
|
516
516
|
var r;
|
|
517
517
|
if (t.gridProps.onSelectionChange && h.enabled) {
|
|
518
|
-
const
|
|
518
|
+
const n = T(), o = n[e.startRowIndex], i = n[e.endRowIndex], a = {
|
|
519
519
|
syntheticEvent: void 0,
|
|
520
|
-
target:
|
|
520
|
+
target: x.current,
|
|
521
521
|
selectedField: "",
|
|
522
522
|
componentId: t.id,
|
|
523
|
-
dataItems:
|
|
523
|
+
dataItems: n,
|
|
524
524
|
dataItem: null,
|
|
525
|
-
startDataItem:
|
|
525
|
+
startDataItem: o,
|
|
526
526
|
endDataItem: i,
|
|
527
527
|
...e
|
|
528
528
|
}, d = Pt({
|
|
@@ -534,10 +534,10 @@ const In = (t, D, p, K) => {
|
|
|
534
534
|
}
|
|
535
535
|
}, Nt = (e) => {
|
|
536
536
|
if (t.gridProps.onSelectionChange && h.enabled) {
|
|
537
|
-
const r = e.dataItems[0],
|
|
537
|
+
const r = e.dataItems[0], n = e.dataItems[e.dataItems.length - 1], o = {}, i = {
|
|
538
538
|
...e,
|
|
539
539
|
startDataItem: r,
|
|
540
|
-
endDataItem:
|
|
540
|
+
endDataItem: n,
|
|
541
541
|
startRowIndex: 0,
|
|
542
542
|
endRowIndex: e.dataItems.length - 1,
|
|
543
543
|
startColIndex: 0,
|
|
@@ -545,12 +545,12 @@ const In = (t, D, p, K) => {
|
|
|
545
545
|
};
|
|
546
546
|
e.dataItems.forEach((a) => {
|
|
547
547
|
const s = X(t.gridProps.dataItemKey)(a);
|
|
548
|
-
|
|
549
|
-
}), ee(i,
|
|
548
|
+
o[s] = e.cell ? [...Array(t.columnsRef.length).keys()] : !0;
|
|
549
|
+
}), ee(i, o);
|
|
550
550
|
}
|
|
551
551
|
}, jt = (e) => {
|
|
552
552
|
if (t.gridProps.onSelectionChange && h.enabled) {
|
|
553
|
-
const
|
|
553
|
+
const n = X(t.gridProps.dataItemKey)(e.dataItem), o = 0, i = t.columnsRef.length - 1, a = e.dataItems.findIndex(
|
|
554
554
|
(f) => f[t.gridProps.dataItemKey] === e.dataItem[t.gridProps.dataItemKey]
|
|
555
555
|
), l = {
|
|
556
556
|
...e,
|
|
@@ -558,18 +558,18 @@ const In = (t, D, p, K) => {
|
|
|
558
558
|
endDataItem: a,
|
|
559
559
|
startRowIndex: a,
|
|
560
560
|
endRowIndex: a,
|
|
561
|
-
startColIndex:
|
|
561
|
+
startColIndex: o,
|
|
562
562
|
endColIndex: i
|
|
563
563
|
}, u = e.mode === "multiple" ? t.gridProps.select || {} : {};
|
|
564
|
-
u[
|
|
564
|
+
u[n] === !0 || Array.isArray(u[n]) && u[n].length === t.columnsRef.length ? delete u[n] : u[n] = e.cell ? [...Array(t.columnsRef.length).keys()] : !0, ee(l, u);
|
|
565
565
|
}
|
|
566
566
|
}, Ut = (e) => {
|
|
567
567
|
if (!h.enabled)
|
|
568
568
|
return;
|
|
569
|
-
const r = T(),
|
|
569
|
+
const r = T(), n = {
|
|
570
570
|
syntheticEvent: void 0,
|
|
571
571
|
nativeEvent: void 0,
|
|
572
|
-
target:
|
|
572
|
+
target: x.current,
|
|
573
573
|
selectedField: "",
|
|
574
574
|
componentId: t.id,
|
|
575
575
|
dataItems: r,
|
|
@@ -586,7 +586,7 @@ const In = (t, D, p, K) => {
|
|
|
586
586
|
};
|
|
587
587
|
if (!e || e.length === 0) {
|
|
588
588
|
const f = {
|
|
589
|
-
...
|
|
589
|
+
...n,
|
|
590
590
|
startRowIndex: -1,
|
|
591
591
|
endRowIndex: -1,
|
|
592
592
|
startColIndex: -1,
|
|
@@ -595,25 +595,25 @@ const In = (t, D, p, K) => {
|
|
|
595
595
|
ee(f, {});
|
|
596
596
|
return;
|
|
597
597
|
}
|
|
598
|
-
const
|
|
598
|
+
const o = Rt(
|
|
599
599
|
t.gridProps.data,
|
|
600
600
|
e,
|
|
601
601
|
t.columnsRef,
|
|
602
602
|
t.gridProps.dataItemKey
|
|
603
603
|
), i = {};
|
|
604
|
-
Object.keys(
|
|
605
|
-
|
|
604
|
+
Object.keys(o).forEach((f) => {
|
|
605
|
+
o[f] && (i[f] = h.cell ? [...Array(t.columnsRef.length).keys()] : !0);
|
|
606
606
|
});
|
|
607
607
|
let a = -1, d = -1, s = r[0] || null, l = r[r.length - 1] || null;
|
|
608
608
|
if (t.gridProps.dataItemKey) {
|
|
609
609
|
const f = X(t.gridProps.dataItemKey);
|
|
610
610
|
for (let v = 0; v < r.length; v++) {
|
|
611
611
|
const R = f(r[v]);
|
|
612
|
-
R !== void 0 &&
|
|
612
|
+
R !== void 0 && o[R] && (a === -1 && (a = v, s = r[v]), d = v, l = r[v]);
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
615
|
const u = {
|
|
616
|
-
...
|
|
616
|
+
...n,
|
|
617
617
|
startRowIndex: a,
|
|
618
618
|
endRowIndex: d,
|
|
619
619
|
startColIndex: 0,
|
|
@@ -624,55 +624,55 @@ const In = (t, D, p, K) => {
|
|
|
624
624
|
ee(u, i);
|
|
625
625
|
}, Vt = (e) => {
|
|
626
626
|
t.gridProps.onSelectionChange && h.enabled && ee(e, {});
|
|
627
|
-
}, te = (e, r,
|
|
627
|
+
}, te = (e, r, n, o, i) => {
|
|
628
628
|
$t();
|
|
629
629
|
const a = t.gridProps.onDataStateChange;
|
|
630
630
|
if (e) {
|
|
631
|
-
const d = { ...I(
|
|
631
|
+
const d = { ...I(o), ...r, targetEvent: i };
|
|
632
632
|
m(e, d);
|
|
633
633
|
} else a && (de.current = {
|
|
634
634
|
...de.current,
|
|
635
|
-
...
|
|
635
|
+
...n
|
|
636
636
|
}, m(a, {
|
|
637
|
-
...I(
|
|
637
|
+
...I(o),
|
|
638
638
|
targetEvent: i || {},
|
|
639
639
|
dataState: {
|
|
640
640
|
...cr(),
|
|
641
641
|
...de.current
|
|
642
642
|
}
|
|
643
643
|
}));
|
|
644
|
-
}, ge = (e, r,
|
|
645
|
-
var
|
|
646
|
-
|
|
644
|
+
}, ge = (e, r, n) => {
|
|
645
|
+
var o;
|
|
646
|
+
k && t.gridProps.pageable && ((o = y.current) == null || o.reset()), te(
|
|
647
647
|
t.gridProps.onPageChange,
|
|
648
648
|
{ page: e },
|
|
649
649
|
{ skip: e.skip, take: e.take },
|
|
650
650
|
r,
|
|
651
|
-
|
|
651
|
+
n
|
|
652
652
|
);
|
|
653
|
-
}, qt = (e, r,
|
|
654
|
-
var
|
|
655
|
-
t.gridProps.pageable || (
|
|
653
|
+
}, qt = (e, r, n) => {
|
|
654
|
+
var o;
|
|
655
|
+
t.gridProps.pageable || (o = t.gridProps.group) != null && o.length ? t.gridProps.virtualSkipRef && (t.gridProps.virtualSkipRef.current = e.skip, re()) : ge(e, r, n);
|
|
656
656
|
}, Te = () => {
|
|
657
657
|
let e = t.gridProps.total || 0;
|
|
658
658
|
return Array.isArray(t.gridProps.data) ? e = e || t.gridProps.data.length : t.gridProps.data && (e = e || t.gridProps.data.total), e;
|
|
659
659
|
}, $t = () => {
|
|
660
|
-
|
|
660
|
+
k && t.gridProps.virtualSkipRef && (t.gridProps.virtualSkipRef.current = 0);
|
|
661
661
|
}, _t = (e) => {
|
|
662
662
|
var i, a;
|
|
663
|
-
const r = (a = (i = t.gridProps.take) != null ? i : t.gridProps.pageSize) != null ? a : 0,
|
|
664
|
-
|
|
663
|
+
const r = (a = (i = t.gridProps.take) != null ? i : t.gridProps.pageSize) != null ? a : 0, n = (t.gridProps.skip || 0) + r, o = Te();
|
|
664
|
+
n < o && ge({ skip: n, take: r }, e);
|
|
665
665
|
}, Zt = (e) => {
|
|
666
|
-
var
|
|
667
|
-
const r = (i = (
|
|
668
|
-
|
|
666
|
+
var o, i;
|
|
667
|
+
const r = (i = (o = t.gridProps.take) != null ? o : t.gridProps.pageSize) != null ? i : 0, n = (t.gridProps.skip || 0) - r;
|
|
668
|
+
n >= 0 && ge({ skip: n, take: r }, e);
|
|
669
669
|
}, Jt = (e) => {
|
|
670
670
|
ge({ skip: e.skip, take: e.take }, e.syntheticEvent, e.targetEvent);
|
|
671
671
|
}, Ye = (e, r) => {
|
|
672
672
|
te(
|
|
673
673
|
t.gridProps.onSortChange,
|
|
674
674
|
{ sort: e },
|
|
675
|
-
{ sort: e, ...
|
|
675
|
+
{ sort: e, ...k && !t.gridProps.pageable ? { skip: 0 } : {} },
|
|
676
676
|
r
|
|
677
677
|
);
|
|
678
678
|
}, Xt = (e, r) => {
|
|
@@ -702,12 +702,12 @@ const In = (t, D, p, K) => {
|
|
|
702
702
|
{}
|
|
703
703
|
);
|
|
704
704
|
}, Qt = (e) => {
|
|
705
|
-
const r = t.gridProps.searchFields || t.columnsRef.map((i) => i.field) || [],
|
|
705
|
+
const r = t.gridProps.searchFields || t.columnsRef.map((i) => i.field) || [], n = e.nativeEvent.target.value, o = {
|
|
706
706
|
logic: "or",
|
|
707
707
|
filters: r.filter((i) => i !== void 0).map((i) => {
|
|
708
708
|
var a;
|
|
709
|
-
return typeof i == "string" ? { field: i, value:
|
|
710
|
-
value:
|
|
709
|
+
return typeof i == "string" ? { field: i, value: n, operator: "contains" } : {
|
|
710
|
+
value: n,
|
|
711
711
|
operator: (a = i.operator) != null ? a : "contains",
|
|
712
712
|
field: i.field,
|
|
713
713
|
ignoreCase: i.ignoreCase
|
|
@@ -717,7 +717,7 @@ const In = (t, D, p, K) => {
|
|
|
717
717
|
te(
|
|
718
718
|
t.gridProps.onSearchChange,
|
|
719
719
|
{
|
|
720
|
-
search:
|
|
720
|
+
search: o
|
|
721
721
|
},
|
|
722
722
|
{ skip: 0 },
|
|
723
723
|
e.syntheticEvent
|
|
@@ -732,111 +732,111 @@ const In = (t, D, p, K) => {
|
|
|
732
732
|
var e;
|
|
733
733
|
return ((e = Ke.current) == null ? void 0 : e.getBlob()) || null;
|
|
734
734
|
}, er = async (e) => {
|
|
735
|
-
var r,
|
|
736
|
-
(r = t.gridProps) != null && r.onPdfExport && await ((
|
|
735
|
+
var r, n;
|
|
736
|
+
(r = t.gridProps) != null && r.onPdfExport && await ((n = t.gridProps) == null ? void 0 : n.onPdfExport(e));
|
|
737
737
|
}, tr = (e) => {
|
|
738
|
-
var r,
|
|
739
|
-
return (r = t.gridProps) != null && r.onCsvExport ? (
|
|
738
|
+
var r, n;
|
|
739
|
+
return (r = t.gridProps) != null && r.onCsvExport ? (n = t.gridProps) == null ? void 0 : n.onCsvExport(e) : e;
|
|
740
740
|
}, Ge = (e, r) => {
|
|
741
|
-
const
|
|
742
|
-
let
|
|
743
|
-
t.isVirtualScroll && e.length && !t.gridProps.pageable && (
|
|
741
|
+
const n = r.nativeEvent ? r : { nativeEvent: r.nativeEvent || r.originalEvent };
|
|
742
|
+
let o = {};
|
|
743
|
+
t.isVirtualScroll && e.length && !t.gridProps.pageable && (o = { take: void 0 }), e.length === 0 && t.gridProps.navigatable && (We.current = !0), te(
|
|
744
744
|
t.gridProps.onGroupChange,
|
|
745
745
|
{ group: e },
|
|
746
|
-
{ group: e, skip: 0, ...
|
|
747
|
-
|
|
746
|
+
{ group: e, skip: 0, ...o },
|
|
747
|
+
n
|
|
748
748
|
);
|
|
749
749
|
}, He = (e) => {
|
|
750
750
|
if (t.gridProps.onColumnsStateChange) {
|
|
751
751
|
const r = {
|
|
752
|
-
target:
|
|
752
|
+
target: x.current,
|
|
753
753
|
columnsState: e
|
|
754
754
|
};
|
|
755
755
|
m(t.gridProps.onColumnsStateChange, r);
|
|
756
756
|
}
|
|
757
|
-
}, fe = (e, r,
|
|
758
|
-
const { columnsRef:
|
|
757
|
+
}, fe = (e, r, n) => {
|
|
758
|
+
const { columnsRef: o, columnsState: i } = t, a = o[e], d = cn(i), s = a.depth, l = (R) => {
|
|
759
759
|
do
|
|
760
760
|
R++;
|
|
761
|
-
while (R <
|
|
761
|
+
while (R < o.length && o[R].depth > s);
|
|
762
762
|
return R;
|
|
763
|
-
}, u =
|
|
764
|
-
|
|
763
|
+
}, u = o.splice(e, l(e) - e);
|
|
764
|
+
o.splice(e < r ? l(r - u.length) : r, 0, ...u), o.filter((R) => R.declarationIndex >= 0).forEach((R, j) => {
|
|
765
765
|
R.orderIndex = j;
|
|
766
|
-
const g = d.find((
|
|
766
|
+
const g = d.find((D) => D.id === R.id);
|
|
767
767
|
g && (g.orderIndex = j);
|
|
768
768
|
});
|
|
769
|
-
const f =
|
|
770
|
-
pr(t.columnsMapRef,
|
|
769
|
+
const f = o[e].locked && o[r].locked;
|
|
770
|
+
pr(t.columnsMapRef, o, f || Ie.current), Nr(t.columnsMapRef, o, f || Ie.current), Le.current && (Ie.current = !1, Le.current = !1);
|
|
771
771
|
const v = se();
|
|
772
772
|
if (re(), t.gridProps.onColumnReorder) {
|
|
773
773
|
const R = {
|
|
774
|
-
target:
|
|
774
|
+
target: x.current,
|
|
775
775
|
columns: v,
|
|
776
776
|
columnId: a.id,
|
|
777
|
-
nativeEvent:
|
|
777
|
+
nativeEvent: n
|
|
778
778
|
};
|
|
779
779
|
m(t.gridProps.onColumnReorder, R);
|
|
780
780
|
}
|
|
781
781
|
He(i);
|
|
782
|
-
}, ae = (e, r,
|
|
783
|
-
const
|
|
784
|
-
if (
|
|
782
|
+
}, ae = (e, r, n) => {
|
|
783
|
+
const o = typeof t.gridProps.rowReorderable == "object" ? t.gridProps.rowReorderable.enabled : t.gridProps.rowReorderable;
|
|
784
|
+
if (n === "forbidden" || !o || !ce.current)
|
|
785
785
|
return;
|
|
786
786
|
const i = t.dataRef[r];
|
|
787
787
|
t.gridProps.onRowReorder && m(t.gridProps.onRowReorder, {
|
|
788
788
|
draggedDataItems: [ce.current],
|
|
789
789
|
droppedDataItem: i == null ? void 0 : i.dataItem,
|
|
790
|
-
dropPosition:
|
|
790
|
+
dropPosition: n,
|
|
791
791
|
nativeEvent: e.originalEvent,
|
|
792
792
|
dragEvent: e,
|
|
793
|
-
target:
|
|
793
|
+
target: x.current
|
|
794
794
|
}), ce.current = null;
|
|
795
|
-
}, rr = (e, r,
|
|
795
|
+
}, rr = (e, r, n) => {
|
|
796
796
|
if (t.gridProps.group === void 0)
|
|
797
797
|
return;
|
|
798
|
-
const
|
|
799
|
-
|
|
800
|
-
}, rt = (e, r,
|
|
801
|
-
const
|
|
802
|
-
if (!
|
|
798
|
+
const o = t.gridProps.group.slice();
|
|
799
|
+
o.splice(r, 0, ...o.splice(e, 1)), Ge(o, n);
|
|
800
|
+
}, rt = (e, r, n) => {
|
|
801
|
+
const o = t.columnsRef[e].field;
|
|
802
|
+
if (!o)
|
|
803
803
|
return;
|
|
804
804
|
const i = (t.gridProps.group || []).slice();
|
|
805
|
-
i.splice(r, 0, { field:
|
|
805
|
+
i.splice(r, 0, { field: o }), Ge(i, n);
|
|
806
806
|
}, nr = (e, r) => {
|
|
807
|
-
const
|
|
808
|
-
rt(e,
|
|
807
|
+
const n = U.current.getCurrentGroupsLength;
|
|
808
|
+
rt(e, n, r);
|
|
809
809
|
}, Ae = () => {
|
|
810
|
-
var e, r,
|
|
810
|
+
var e, r, n, o, i, a, d, s, l, u, f, v, R, j;
|
|
811
811
|
if (t.gridProps.dataLayoutMode === "stacked") {
|
|
812
812
|
const g = ((e = F.current) == null ? void 0 : e.offsetWidth) || 0;
|
|
813
813
|
if ((r = P.current) != null && r.colGroupMain && g) {
|
|
814
|
-
const
|
|
814
|
+
const D = P.current.colGroupMain.children, b = D.length - 1;
|
|
815
815
|
if (b >= 0) {
|
|
816
816
|
let Z = 0;
|
|
817
817
|
for (let oe = 0; oe < b; oe++) {
|
|
818
|
-
const Kr = parseFloat((
|
|
818
|
+
const Kr = parseFloat((D[oe].width || 0).toString()) || D[oe].clientWidth;
|
|
819
819
|
Z += Kr;
|
|
820
820
|
}
|
|
821
821
|
const B = Math.max(0, g - Z);
|
|
822
|
-
|
|
822
|
+
D[b].width = B + "px", (o = (n = P.current.colGroupHeader) == null ? void 0 : n.children) != null && o[b] && (P.current.colGroupHeader.children[b].width = B + "px"), (a = (i = P.current.colGroupFooter) == null ? void 0 : i.children) != null && a[b] && (P.current.colGroupFooter.children[b].width = B + "px"), (s = (d = P.current.colGroupStickyHeader) == null ? void 0 : d.children) != null && s[b] && (P.current.colGroupStickyHeader.children[b].width = B + "px"), (u = (l = P.current.colGroupStickyFooter) == null ? void 0 : l.children) != null && u[b] && (P.current.colGroupStickyFooter.children[b].width = B + "px"), (v = (f = P.current.colGroupPinnedTop) == null ? void 0 : f.children) != null && v[b] && (P.current.colGroupPinnedTop.children[b].width = B + "px"), (j = (R = P.current.colGroupPinnedBottom) == null ? void 0 : R.children) != null && j[b] && (P.current.colGroupPinnedBottom.children[b].width = B + "px");
|
|
823
823
|
}
|
|
824
824
|
}
|
|
825
|
-
_.current && _.current.setWidth(g), $.current && $.current.setWidth(g),
|
|
825
|
+
_.current && _.current.setWidth(g), $.current && $.current.setWidth(g), L.current && L.current.setWidth(g), W.current && W.current.setWidth(g), O.current && O.current.setWidth(g), z.current && z.current.setWidth(g), A.current && (A.current.style.width = g ? g + "px" : "");
|
|
826
826
|
} else {
|
|
827
827
|
let g = 0;
|
|
828
828
|
if (!P.current.colGroupMain)
|
|
829
829
|
return;
|
|
830
|
-
const
|
|
831
|
-
for (let b = 0; b <
|
|
832
|
-
const Z =
|
|
830
|
+
const D = P.current.colGroupMain.children;
|
|
831
|
+
for (let b = 0; b < D.length; b++) {
|
|
832
|
+
const Z = D[b].width;
|
|
833
833
|
if (!Z) {
|
|
834
834
|
g = 0;
|
|
835
835
|
break;
|
|
836
836
|
}
|
|
837
837
|
g += parseFloat(Z.toString());
|
|
838
838
|
}
|
|
839
|
-
g = Math.round(g), _.current && _.current.setWidth(g), $.current && $.current.setWidth(g),
|
|
839
|
+
g = Math.round(g), _.current && _.current.setWidth(g), $.current && $.current.setWidth(g), L.current && L.current.setWidth(g), W.current && W.current.setWidth(g), O.current && O.current.setWidth(g), z.current && z.current.setWidth(g), A.current && (A.current.style.width = g ? g + "px" : "");
|
|
840
840
|
}
|
|
841
841
|
Ee.current && or();
|
|
842
842
|
}, or = () => {
|
|
@@ -855,26 +855,26 @@ const In = (t, D, p, K) => {
|
|
|
855
855
|
r && (e.current = r, re());
|
|
856
856
|
}
|
|
857
857
|
}, Pe = c.useCallback(
|
|
858
|
-
(e, r,
|
|
858
|
+
(e, r, n, o, i) => {
|
|
859
859
|
var l;
|
|
860
|
-
if (!ar() && !
|
|
860
|
+
if (!ar() && !n || !e)
|
|
861
861
|
return;
|
|
862
862
|
const a = {
|
|
863
863
|
type: e,
|
|
864
864
|
nativeEvent: r,
|
|
865
865
|
columns: t.columnsRef,
|
|
866
866
|
dataItemKey: t.gridProps.dataItemKey || "",
|
|
867
|
-
dataItem:
|
|
867
|
+
dataItem: o,
|
|
868
868
|
field: i,
|
|
869
869
|
...typeof t.gridProps.clipboard != "boolean" ? t.gridProps.clipboard : {},
|
|
870
|
-
...
|
|
871
|
-
}, d = T(), s =
|
|
870
|
+
...n
|
|
871
|
+
}, d = T(), s = Wr({
|
|
872
872
|
event: a,
|
|
873
873
|
data: d,
|
|
874
874
|
selectedState: (l = t.gridProps.select) != null ? l : {},
|
|
875
875
|
previousCopiedItems: lt.current
|
|
876
876
|
});
|
|
877
|
-
e !== Ve.paste && (lt.current = s.copiedItems), t.gridProps.onClipboard &&
|
|
877
|
+
e !== Ve.paste && (lt.current = s.copiedItems), t.gridProps.onClipboard && K && m(t.gridProps.onClipboard, {
|
|
878
878
|
...a,
|
|
879
879
|
...s
|
|
880
880
|
});
|
|
@@ -890,18 +890,18 @@ const In = (t, D, p, K) => {
|
|
|
890
890
|
var i, a, d;
|
|
891
891
|
if (!J)
|
|
892
892
|
return !1;
|
|
893
|
-
const e = Mr(N()), r = e ? e.matches(".k-table-td") ? e : (i = N()) == null ? void 0 : i.body : (a = N()) == null ? void 0 : a.body,
|
|
894
|
-
return !!(r &&
|
|
895
|
-
}, ot = (e, r,
|
|
896
|
-
Ae(), Ie.current = !0,
|
|
893
|
+
const e = Mr(N()), r = e ? e.matches(".k-table-td") ? e : (i = N()) == null ? void 0 : i.body : (a = N()) == null ? void 0 : a.body, n = r == null ? void 0 : r.closest(".k-grid-container"), o = r && ((d = F.current) == null ? void 0 : d.contains(r));
|
|
894
|
+
return !!(r && o && n);
|
|
895
|
+
}, ot = (e, r, n, o, i, a, d) => {
|
|
896
|
+
Ae(), Ie.current = !0, Le.current = !0, t.gridProps.onColumnResize && K && m(t.gridProps.onColumnResize, {
|
|
897
897
|
columns: se(),
|
|
898
|
-
nativeEvent:
|
|
898
|
+
nativeEvent: o,
|
|
899
899
|
targetColumnId: d,
|
|
900
900
|
index: e,
|
|
901
901
|
newWidth: r,
|
|
902
|
-
oldWidth:
|
|
902
|
+
oldWidth: n,
|
|
903
903
|
end: i,
|
|
904
|
-
target:
|
|
904
|
+
target: x.current
|
|
905
905
|
}), i && He(a);
|
|
906
906
|
}, cr = () => {
|
|
907
907
|
var e;
|
|
@@ -915,7 +915,7 @@ const In = (t, D, p, K) => {
|
|
|
915
915
|
}, I = (e) => ({
|
|
916
916
|
nativeEvent: e && e.nativeEvent,
|
|
917
917
|
syntheticEvent: e,
|
|
918
|
-
target:
|
|
918
|
+
target: x.current
|
|
919
919
|
}), dr = (e) => ({
|
|
920
920
|
...e,
|
|
921
921
|
nativeEvent: void 0,
|
|
@@ -930,13 +930,13 @@ const In = (t, D, p, K) => {
|
|
|
930
930
|
}
|
|
931
931
|
e(dr(r));
|
|
932
932
|
}, lr = () => {
|
|
933
|
-
var e, r,
|
|
933
|
+
var e, r, n;
|
|
934
934
|
if (H.current && ((e = H.current) == null ? void 0 : e.getElementsByClassName("k-grid-edit-row").length) > 0) {
|
|
935
935
|
ze.current = !1, (r = document.activeElement) != null && r.closest(".k-grid-edit-row") ? Oe.current = document.activeElement : Oe.current = void 0;
|
|
936
|
-
const
|
|
937
|
-
|
|
936
|
+
const o = Array.from((n = H.current) == null ? void 0 : n.getElementsByClassName("k-grid-edit-row"));
|
|
937
|
+
o.length > je.current.length ? Ce.current = o.filter(
|
|
938
938
|
(i) => !je.current.includes(i)
|
|
939
|
-
)[0] :
|
|
939
|
+
)[0] : o.length === 1 && (Ce.current = o[0], ze.current = !0), je.current = o;
|
|
940
940
|
}
|
|
941
941
|
}, T = () => t.dataRef.filter((e) => e.rowType === "data").map((e) => e.dataItem), N = () => {
|
|
942
942
|
var e;
|
|
@@ -944,16 +944,16 @@ const In = (t, D, p, K) => {
|
|
|
944
944
|
return ((e = he()) == null ? void 0 : e.ownerDocument) || document;
|
|
945
945
|
}, he = () => F.current, Re = c.useCallback(
|
|
946
946
|
(e) => {
|
|
947
|
-
var
|
|
948
|
-
if (!y.current || !((
|
|
947
|
+
var o, i;
|
|
948
|
+
if (!y.current || !((o = y.current) != null && o.container) || p === "none")
|
|
949
949
|
return;
|
|
950
950
|
G.current && G.current.disconnect();
|
|
951
|
-
const { rowIndex: r } = e,
|
|
952
|
-
if (
|
|
951
|
+
const { rowIndex: r } = e, n = he();
|
|
952
|
+
if (k) {
|
|
953
953
|
const a = ((i = y.current.rowHeightService) == null ? void 0 : i.offset(r)) || 0;
|
|
954
954
|
y.current.container.scroll(0, a);
|
|
955
|
-
} else if (
|
|
956
|
-
const a = r < 1 ?
|
|
955
|
+
} else if (n) {
|
|
956
|
+
const a = r < 1 ? n.querySelector("tbody > tr:nth-child(1)") : n.querySelector(`tbody > tr:nth-child(${r + 1})`);
|
|
957
957
|
a && E.current && (E.current.scrollTop = a.offsetTop);
|
|
958
958
|
}
|
|
959
959
|
},
|
|
@@ -962,19 +962,19 @@ const In = (t, D, p, K) => {
|
|
|
962
962
|
ye.current = window.innerWidth, sr() || re();
|
|
963
963
|
}, gr = () => {
|
|
964
964
|
var a;
|
|
965
|
-
const { virtualTotal: e, virtualPageSize: r, gridProps:
|
|
966
|
-
|
|
965
|
+
const { virtualTotal: e, virtualPageSize: r, gridProps: n } = t, o = y.current, i = t.gridProps.rowHeight || ((a = n.minRowHeightRef) == null ? void 0 : a.current) || 0;
|
|
966
|
+
o && (o.fixedScroll = n.fixedScroll || !1, o.PageChange = qt, o.pageSize = r, o.scrollableVirtual = k, o.container = E.current, o.tableBody = H.current, o.scrollHeightContainer = ct.current, o.scrollbarOverlaySpacerElement = ve.current, o.overlaySyncingRef = Fe, o.table = A.current, (!o.rowHeightService || o.total !== e) && i && (o.total = e, o.rowHeightService = new Fr(e, i)));
|
|
967
967
|
}, at = c.useCallback(
|
|
968
968
|
(e) => {
|
|
969
969
|
const r = { rowIndex: Ne.current };
|
|
970
|
-
e.forEach((
|
|
971
|
-
|
|
970
|
+
e.forEach((n) => {
|
|
971
|
+
n.boundingClientRect.height !== n.intersectionRect.height && Re(r);
|
|
972
972
|
});
|
|
973
973
|
},
|
|
974
974
|
[Re]
|
|
975
975
|
), re = () => {
|
|
976
976
|
t.gridProps.forceUpdate && t.gridProps.forceUpdate();
|
|
977
|
-
}, fr = (e) => e.left !== void 0 ? Ue !== "rtl" ? { left: e.left, right: e.right } : { left: e.right, right: e.left } : {},
|
|
977
|
+
}, fr = (e) => e.left !== void 0 ? Ue !== "rtl" ? { left: e.left, right: e.right } : { left: e.right, right: e.left } : {}, x = c.useRef(null), y = c.useRef(void 0), P = c.useRef(void 0), U = c.useRef(void 0), V = c.useRef(void 0), ne = c.useRef(void 0), be = c.useRef(void 0), G = c.useRef(null), H = c.useRef(null), mr = c.useRef(null), E = c.useRef(null), A = c.useRef(null), Pr = c.useRef(null), F = c.useRef(null), ct = c.useRef(null), q = c.useRef(null), ve = c.useRef(null), dt = c.useRef(!1), Fe = c.useRef(!1), $ = c.useRef(null), _ = c.useRef(null), L = c.useRef(null), W = c.useRef(null), O = c.useRef(null), z = c.useRef(null), hr = c.useRef(null), Rr = c.useRef(null), Le = c.useRef(!1), We = c.useRef(!1), Ce = c.useRef(void 0), Oe = c.useRef(void 0), ze = c.useRef(!1), Ie = c.useRef(!0), Be = c.useRef(0), pe = c.useRef(void 0), Ne = c.useRef(void 0), je = c.useRef([]), lt = c.useRef([]), ye = c.useRef(0), we = c.useRef(
|
|
978
978
|
null
|
|
979
979
|
), br = typeof t.gridProps.groupable == "object" && !!t.gridProps.groupable.stickyHeaders, vr = typeof t.gridProps.groupable == "object" && !!t.gridProps.groupable.stickyFooters, Cr = !!((ft = t.gridProps.group) != null && ft.length), {
|
|
980
980
|
stickyHeaderItems: Ir,
|
|
@@ -998,7 +998,7 @@ const In = (t, D, p, K) => {
|
|
|
998
998
|
return (e = y.current) == null ? void 0 : e.rowHeightService;
|
|
999
999
|
}
|
|
1000
1000
|
}
|
|
1001
|
-
}), ce = c.useRef(null), Sr = c.useRef(null), xr = c.useRef(null), Ue = Gr(F),
|
|
1001
|
+
}), ce = c.useRef(null), Sr = c.useRef(null), xr = c.useRef(null), Ue = Gr(F), k = t.isVirtualScroll, kr = c.useMemo(() => c.Children.toArray(t.gridProps.children), [t.gridProps.children]), ut = t.gridProps.groupable === !0 || typeof t.gridProps.groupable == "object" && t.gridProps.groupable.enabled !== !1, h = xe(t.gridProps.selectable), gt = Or(t.gridProps.editable), Dr = ye.current && Q && ye.current <= Q.medium && t.gridProps.adaptive;
|
|
1002
1002
|
c.useMemo(() => {
|
|
1003
1003
|
ie.onConstructor({
|
|
1004
1004
|
navigatable: !!t.gridProps.navigatable,
|
|
@@ -1029,16 +1029,16 @@ const In = (t, D, p, K) => {
|
|
|
1029
1029
|
clearTimeout(pe.current);
|
|
1030
1030
|
}), []), c.useEffect(() => {
|
|
1031
1031
|
var e;
|
|
1032
|
-
nt(), Ae(), mt(),
|
|
1032
|
+
nt(), Ae(), mt(), k && (me(), ir(), (e = y.current) == null || e.update()), st(), lr(), ie.onComponentDidUpdate({
|
|
1033
1033
|
scope: F.current || void 0,
|
|
1034
1034
|
contextStateRef: V,
|
|
1035
1035
|
navigationStateRef: ne,
|
|
1036
|
-
focusFirst:
|
|
1036
|
+
focusFirst: We.current,
|
|
1037
1037
|
newEditableRow: Ce.current,
|
|
1038
1038
|
singleEditRow: ze.current,
|
|
1039
1039
|
lastActiveElement: Oe.current,
|
|
1040
1040
|
navigatable: t.gridProps.navigatable
|
|
1041
|
-
}), Et(),
|
|
1041
|
+
}), Et(), We.current = !1, Ce.current = void 0, we.current = void 0;
|
|
1042
1042
|
}), c.useEffect(() => {
|
|
1043
1043
|
if (J) {
|
|
1044
1044
|
const e = {
|
|
@@ -1054,47 +1054,49 @@ const In = (t, D, p, K) => {
|
|
|
1054
1054
|
var r;
|
|
1055
1055
|
let e;
|
|
1056
1056
|
return J && window.ResizeObserver && (e = new window.ResizeObserver(() => {
|
|
1057
|
-
ur(),
|
|
1057
|
+
ur(), k && me();
|
|
1058
1058
|
}), e.observe((r = N()) == null ? void 0 : r.body)), () => {
|
|
1059
1059
|
e == null || e.disconnect();
|
|
1060
1060
|
};
|
|
1061
1061
|
}, []), c.useEffect(() => {
|
|
1062
|
-
if (!J || !window.ResizeObserver || !
|
|
1062
|
+
if (!J || !window.ResizeObserver || !k || !E.current)
|
|
1063
1063
|
return;
|
|
1064
1064
|
const e = () => {
|
|
1065
1065
|
var i, a;
|
|
1066
|
-
const
|
|
1066
|
+
const n = ((i = t.gridProps.containerHeightRef) == null ? void 0 : i.current) || 0;
|
|
1067
1067
|
me();
|
|
1068
|
-
const
|
|
1069
|
-
(
|
|
1068
|
+
const o = ((a = t.gridProps.containerHeightRef) == null ? void 0 : a.current) || 0;
|
|
1069
|
+
(n === 0 && o > 0 || Math.abs(o - n) > 10) && re();
|
|
1070
1070
|
}, r = new window.ResizeObserver(e);
|
|
1071
1071
|
return r.observe(E.current), () => {
|
|
1072
1072
|
r.disconnect();
|
|
1073
1073
|
};
|
|
1074
|
-
}, [
|
|
1074
|
+
}, [k, me]);
|
|
1075
1075
|
const Se = c.useCallback(() => {
|
|
1076
|
-
var
|
|
1076
|
+
var o;
|
|
1077
1077
|
const e = E.current;
|
|
1078
1078
|
if (!e)
|
|
1079
1079
|
return;
|
|
1080
|
-
const r = ((
|
|
1081
|
-
q.current && (q.current.style.bottom =
|
|
1080
|
+
const r = ((o = q.current) == null ? void 0 : o.offsetWidth) || 17, n = e.scrollWidth > e.clientWidth ? r : 0;
|
|
1081
|
+
q.current && (q.current.style.bottom = n + "px"), ve.current && (ve.current.style.height = Math.max(0, e.scrollHeight - n) + "px");
|
|
1082
1082
|
}, []);
|
|
1083
1083
|
return c.useEffect(() => {
|
|
1084
|
-
if (!J || !
|
|
1084
|
+
if (!J || !S || !E.current || !window.ResizeObserver)
|
|
1085
1085
|
return;
|
|
1086
1086
|
const e = E.current, r = new window.ResizeObserver(Se);
|
|
1087
1087
|
return A.current && r.observe(A.current), r.observe(e), () => {
|
|
1088
1088
|
r.disconnect();
|
|
1089
1089
|
};
|
|
1090
|
-
}, [
|
|
1091
|
-
!J || !
|
|
1092
|
-
}, [
|
|
1093
|
-
const e = E.current, r =
|
|
1094
|
-
if (!
|
|
1095
|
-
return
|
|
1096
|
-
|
|
1097
|
-
|
|
1090
|
+
}, [S, Se]), c.useEffect(() => {
|
|
1091
|
+
!J || !S || !E.current || Se();
|
|
1092
|
+
}, [S, Se, t.columnsState, t.gridProps.data]), c.useEffect(() => {
|
|
1093
|
+
const e = E.current, r = k && S;
|
|
1094
|
+
if (!e || !r && Y === 1)
|
|
1095
|
+
return;
|
|
1096
|
+
const n = S ? e.parentElement : null;
|
|
1097
|
+
return un(e, { wheelMultiplier: Y, overlayRequiresCustomWheel: r }, n);
|
|
1098
|
+
}, [k, S, Y]), c.useImperativeHandle(
|
|
1099
|
+
x,
|
|
1098
1100
|
() => ({
|
|
1099
1101
|
get element() {
|
|
1100
1102
|
return he();
|
|
@@ -1104,15 +1106,15 @@ const In = (t, D, p, K) => {
|
|
|
1104
1106
|
return se();
|
|
1105
1107
|
},
|
|
1106
1108
|
scrollIntoView: (e) => {
|
|
1107
|
-
var
|
|
1108
|
-
if (!((
|
|
1109
|
+
var o;
|
|
1110
|
+
if (!((o = y.current) != null && o.container) || p === "none")
|
|
1109
1111
|
return;
|
|
1110
1112
|
const { rowIndex: r } = e;
|
|
1111
1113
|
Ne.current = r;
|
|
1112
|
-
const
|
|
1113
|
-
if (G.current &&
|
|
1114
|
+
const n = he();
|
|
1115
|
+
if (G.current && n) {
|
|
1114
1116
|
G.current.disconnect();
|
|
1115
|
-
const i =
|
|
1117
|
+
const i = n.querySelector(`[absolute-row-index="${Ne.current}"]`);
|
|
1116
1118
|
i ? G.current.observe(i) : Re(e);
|
|
1117
1119
|
}
|
|
1118
1120
|
},
|
|
@@ -1125,7 +1127,7 @@ const In = (t, D, p, K) => {
|
|
|
1125
1127
|
getTotal: Te,
|
|
1126
1128
|
getLeafDataItems: T
|
|
1127
1129
|
})
|
|
1128
|
-
), c.useImperativeHandle(t.gridRef, () =>
|
|
1130
|
+
), c.useImperativeHandle(t.gridRef, () => x.current), c.useMemo(() => {
|
|
1129
1131
|
P.current = new Yr(ot);
|
|
1130
1132
|
}, [t.gridProps.onColumnResize, t.columnsRef]), c.useMemo(() => {
|
|
1131
1133
|
U.current = new Qr(fe, rr, rt);
|
|
@@ -1135,11 +1137,11 @@ const In = (t, D, p, K) => {
|
|
|
1135
1137
|
t.gridProps.group,
|
|
1136
1138
|
t.columnsRef,
|
|
1137
1139
|
t.gridProps.groupable
|
|
1138
|
-
]), P.current.resizable = t.gridProps.resizable || !1, P.current.columns = t.renderedColumnsRef || t.columnsRef, P.current.columnsState = Hr(t.columnsState), U.current.reorderable = t.gridProps.reorderable || !1, U.current.groupable = ut, U.current.columns = t.columnsRef, U.current.dir = Ue, gr(), Ar("grid",
|
|
1140
|
+
]), P.current.resizable = t.gridProps.resizable || !1, P.current.columns = t.renderedColumnsRef || t.columnsRef, P.current.columnsState = Hr(t.columnsState), U.current.reorderable = t.gridProps.reorderable || !1, U.current.groupable = ut, U.current.columns = t.columnsRef, U.current.dir = Ue, gr(), Ar("grid", x, t.gridProps, t.gridProps.webMcp), /* @__PURE__ */ c.createElement(
|
|
1139
1141
|
vn.Provider,
|
|
1140
1142
|
{
|
|
1141
1143
|
value: {
|
|
1142
|
-
isClient:
|
|
1144
|
+
isClient: K,
|
|
1143
1145
|
rowReorder: ae,
|
|
1144
1146
|
activeDragRowDataItemRef: ce,
|
|
1145
1147
|
reorderRowDragTargetRef: Sr,
|
|
@@ -1164,7 +1166,7 @@ const In = (t, D, p, K) => {
|
|
|
1164
1166
|
rowDblClick: Kt,
|
|
1165
1167
|
cellClick: Gt,
|
|
1166
1168
|
headerCellClick: Je,
|
|
1167
|
-
itemChange:
|
|
1169
|
+
itemChange: Lt,
|
|
1168
1170
|
onDialogEditCancel: Mt,
|
|
1169
1171
|
onDialogEditSubmit: Tt,
|
|
1170
1172
|
columnReorder: fe,
|
|
@@ -1198,7 +1200,7 @@ const In = (t, D, p, K) => {
|
|
|
1198
1200
|
onKeyDown: St,
|
|
1199
1201
|
onFocus: xt,
|
|
1200
1202
|
scrollHandler: yt,
|
|
1201
|
-
selectionChange:
|
|
1203
|
+
selectionChange: Wt,
|
|
1202
1204
|
groupSelectionChange: Ot,
|
|
1203
1205
|
mobileMode: Dr,
|
|
1204
1206
|
adaptiveColumnMenuRef: ye.current,
|
|
@@ -1227,8 +1229,8 @@ const In = (t, D, p, K) => {
|
|
|
1227
1229
|
stickyHeaderRef: yr,
|
|
1228
1230
|
stickyFooterItems: wr,
|
|
1229
1231
|
stickyFooterRef: Ee,
|
|
1230
|
-
stickyHeaderTableRef:
|
|
1231
|
-
stickyFooterTableRef:
|
|
1232
|
+
stickyHeaderTableRef: L,
|
|
1233
|
+
stickyFooterTableRef: W,
|
|
1232
1234
|
pinnedTopTableRef: O,
|
|
1233
1235
|
pinnedBottomTableRef: z,
|
|
1234
1236
|
pinnedTopRef: hr,
|