@progress/kendo-react-grid 15.1.0-develop.5 → 15.1.0-develop.7
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 +411 -407
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +317 -302
- package/VirtualScroll.d.ts +4 -0
- package/VirtualScroll.js +1 -1
- package/VirtualScroll.mjs +32 -27
- package/components/VirtualScrollOverlay.d.ts +12 -0
- package/components/VirtualScrollOverlay.js +16 -0
- package/components/VirtualScrollOverlay.mjs +65 -0
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/index.d.mts +2 -1
- package/index.d.ts +2 -1
- package/interfaces/GridProps.d.ts +2 -1
- package/interfaces/GridScrollableSettings.d.ts +33 -0
- package/interfaces/VirtualScrollInterface.d.ts +2 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -17
package/GridClientWrapper.mjs
CHANGED
|
@@ -7,32 +7,32 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as c from "react";
|
|
10
|
-
import { useAdaptiveModeContext as
|
|
11
|
-
import { filterBy as
|
|
12
|
-
import { getSelectionOptions as
|
|
13
|
-
import { ColumnResize as
|
|
14
|
-
import { CommonDragLogic as
|
|
15
|
-
import { useStickyGroups as
|
|
16
|
-
import { getDefaultHeadContextMenuItems as
|
|
17
|
-
import { VirtualScroll as
|
|
18
|
-
import { GridContextMenu as
|
|
19
|
-
import { GridContextMenuAnchorPart as
|
|
20
|
-
import { normalizeSortable as
|
|
21
|
-
import { BasePDFExport as
|
|
22
|
-
import { BaseCSVExport as
|
|
23
|
-
import { GridContext as
|
|
24
|
-
import { operators as
|
|
25
|
-
const
|
|
26
|
-
const re = Object.keys(
|
|
27
|
-
return t.reduce((
|
|
28
|
-
},
|
|
10
|
+
import { useAdaptiveModeContext as kn, canUseDOM as ae, getActiveElement as Dn, useDir as Kn, setScrollbarWidth as ut, cloneArray as Tn, useWebMcpRegister as Mn, RowHeightService as Gn, getter as te } from "@progress/kendo-react-common";
|
|
11
|
+
import { filterBy as Hn } from "@progress/kendo-data-query";
|
|
12
|
+
import { getSelectionOptions as Se, populateClipboardData as An, ClipboardActionType as Ne, getEditableOptions as Fn, tableKeyboardNavigation as ne, ClipboardService as Ln, TableKeyboardNavigationContext as Bn, updateLeft as Wn, updateRight as zn, getGroupExpandableOptions as On, groupExpandReducer as pn, getDetailExpandableOptions as Nn, detailExpandReducer as jn, getSelectedState as gt, editReducer as Un, EDIT_ACTION as Vn, closestTagName as xe, getSelectedStateFromKeyDown as qn, getColumnIndex as $n, getRowIndex as _n } from "@progress/kendo-react-data-tools";
|
|
13
|
+
import { ColumnResize as Zn } from "./drag/ColumnResize.mjs";
|
|
14
|
+
import { CommonDragLogic as Jn } from "./drag/CommonDragLogic.mjs";
|
|
15
|
+
import { useStickyGroups as Xn } from "./hooks/useStickyGroups.mjs";
|
|
16
|
+
import { getDefaultHeadContextMenuItems as Yn, getDefaultBodyContextMenuItems as Qn, isRowReorderEnabled as er, calcRowHeight as tr, sanitizeColumns as nr, getFlatColumnsState as rr, getDataAsArray as or } from "./utils/index.mjs";
|
|
17
|
+
import { VirtualScroll as ir } from "./VirtualScroll.mjs";
|
|
18
|
+
import { GridContextMenu as ar, contextMenuItemsMap as cr } from "./contextMenu/GridContextMenu.mjs";
|
|
19
|
+
import { GridContextMenuAnchorPart as ft, GridContextMenuItemNames as ke } from "./contextMenu/enums.mjs";
|
|
20
|
+
import { normalizeSortable as dr, firstLevelSortSeqMap as sr } from "./sortCommon.mjs";
|
|
21
|
+
import { BasePDFExport as lr } from "./BasePDFExport.mjs";
|
|
22
|
+
import { BaseCSVExport as ur } from "./BaseCSVExport.mjs";
|
|
23
|
+
import { GridContext as gr } from "./utils/GridContext.mjs";
|
|
24
|
+
import { operators as fr } from "./filterCommon.mjs";
|
|
25
|
+
const mr = (t, x, z, h) => {
|
|
26
|
+
const re = Object.keys(x.cells).map((K) => z.findIndex((N) => N.field === K)), Z = Object.keys(x.cells).length > 0 ? re : !0;
|
|
27
|
+
return t.reduce((K, N) => (K[N[h != null ? h : "id"]] = Z, K), {});
|
|
28
|
+
}, mt = (t, x, z, h) => x.reduce((Z, K) => ({
|
|
29
29
|
...Z,
|
|
30
|
-
...
|
|
31
|
-
}), {}),
|
|
32
|
-
var
|
|
33
|
-
const
|
|
34
|
-
e.event.preventDefault(),
|
|
35
|
-
...
|
|
30
|
+
...mr(Hn(t, K), K, z, h)
|
|
31
|
+
}), {}), Tr = (t) => {
|
|
32
|
+
var lt;
|
|
33
|
+
const x = t.gridProps.isClient, z = typeof t.gridProps.scrollable == "object" ? t.gridProps.scrollable.mode : t.gridProps.scrollable, [h, re] = c.useState({}), Z = kn(), K = c.useRef(null), N = c.useRef(null), ce = c.useRef({}), Pt = (e) => {
|
|
34
|
+
e.event.preventDefault(), re({
|
|
35
|
+
...h,
|
|
36
36
|
show: !0,
|
|
37
37
|
offset: {
|
|
38
38
|
left: e.event.pageX,
|
|
@@ -41,30 +41,30 @@ const sr = (t, S, b, z) => {
|
|
|
41
41
|
dataItem: e.dataItem,
|
|
42
42
|
field: e.field
|
|
43
43
|
});
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
const n = t.gridProps.dataItemKey || "", o =
|
|
44
|
+
}, je = () => {
|
|
45
|
+
re({});
|
|
46
|
+
}, ht = (e) => {
|
|
47
|
+
const n = t.gridProps.dataItemKey || "", o = h.dataItem, r = t.gridProps.pinnedTopRows || [], i = t.gridProps.pinnedBottomRows || [], a = n ? o[n] : void 0, d = a !== void 0 && r.some((s) => s[n] === a), l = a !== void 0 && i.some((s) => s[n] === a);
|
|
48
48
|
return e.map((s) => {
|
|
49
|
-
const u = typeof s == "string" ?
|
|
50
|
-
return u && u.name ===
|
|
49
|
+
const u = typeof s == "string" ? cr[s] : s;
|
|
50
|
+
return u && u.name === ke.pinRow && u.items ? {
|
|
51
51
|
...u,
|
|
52
|
-
items: u.items.filter((m) => m.name ===
|
|
52
|
+
items: u.items.filter((m) => m.name === ke.pinTop ? !d : m.name === ke.pinBottom ? !l : m.name === ke.unpin ? d || l : !0)
|
|
53
53
|
} : s;
|
|
54
54
|
});
|
|
55
|
-
}, y = c.useMemo(() => t.columnsRef.find((e) => e.field ===
|
|
55
|
+
}, y = c.useMemo(() => t.columnsRef.find((e) => e.field === h.field), [t.columnsRef, h]), Ue = c.useMemo(() => {
|
|
56
56
|
const e = t.gridProps.sortable && (y == null ? void 0 : y.sortable);
|
|
57
|
-
return
|
|
57
|
+
return Yn({
|
|
58
58
|
pdf: !!t.gridProps.pdf,
|
|
59
59
|
sortable: !!e,
|
|
60
|
-
selectable:
|
|
60
|
+
selectable: Se(t.gridProps.selectable).enabled,
|
|
61
61
|
clipboard: !!t.gridProps.clipboard
|
|
62
62
|
});
|
|
63
|
-
}, [y, t.gridProps.sortable, t.gridProps.selectable, t.gridProps.clipboard]),
|
|
63
|
+
}, [y, t.gridProps.sortable, t.gridProps.selectable, t.gridProps.clipboard]), Ve = c.useMemo(() => (t.gridProps.sortable && (y == null || y.sortable), Qn({
|
|
64
64
|
pdf: !!t.gridProps.pdf,
|
|
65
|
-
selectable:
|
|
65
|
+
selectable: Se(t.gridProps.selectable).enabled,
|
|
66
66
|
clipboard: !!t.gridProps.clipboard,
|
|
67
|
-
rowReorderable:
|
|
67
|
+
rowReorderable: er(t.gridProps.rowReorderable),
|
|
68
68
|
pinnable: !!t.gridProps.pinnable
|
|
69
69
|
})), [
|
|
70
70
|
y,
|
|
@@ -74,22 +74,22 @@ const sr = (t, S, b, z) => {
|
|
|
74
74
|
t.gridProps.pinnable,
|
|
75
75
|
t.gridProps.rowReorderable,
|
|
76
76
|
t.gridProps.pdf
|
|
77
|
-
]),
|
|
78
|
-
const e = (y == null ? void 0 : y.contextMenu) || t.gridProps.contextMenu, n = typeof e == "function" ? e(
|
|
79
|
-
if (n &&
|
|
80
|
-
const o =
|
|
77
|
+
]), de = c.useMemo(() => {
|
|
78
|
+
const e = (y == null ? void 0 : y.contextMenu) || t.gridProps.contextMenu, n = typeof e == "function" ? e(h) : e;
|
|
79
|
+
if (n && h.offset) {
|
|
80
|
+
const o = h.dataItem ? ft.body : ft.head, r = n[o], i = h.dataItem ? Ve : Ue;
|
|
81
81
|
let a;
|
|
82
|
-
return r === !0 || r === void 0 ? a = i : r !== !1 && (a = r), t.gridProps.pinnable && a &&
|
|
82
|
+
return r === !0 || r === void 0 ? a = i : r !== !1 && (a = r), t.gridProps.pinnable && a && h.dataItem ? ht(a) : a;
|
|
83
83
|
}
|
|
84
84
|
}, [
|
|
85
85
|
t.gridProps.contextMenu,
|
|
86
86
|
t.gridProps.pinnable,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
h,
|
|
88
|
+
Ve,
|
|
89
|
+
Ue,
|
|
90
90
|
y
|
|
91
|
-
]),
|
|
92
|
-
var d, l, s, u, m, w,
|
|
91
|
+
]), Rt = (e) => {
|
|
92
|
+
var d, l, s, u, m, w, R, p, g;
|
|
93
93
|
const n = e.event.item, o = {
|
|
94
94
|
target: E.current,
|
|
95
95
|
syntheticEvent: e.event.syntheticEvent,
|
|
@@ -98,7 +98,7 @@ const sr = (t, S, b, z) => {
|
|
|
98
98
|
...e
|
|
99
99
|
};
|
|
100
100
|
t.gridProps.onContextMenuItemClick && f(t.gridProps.onContextMenuItemClick, o);
|
|
101
|
-
const r =
|
|
101
|
+
const r = k(), i = {
|
|
102
102
|
selectedField: "",
|
|
103
103
|
componentId: t.id,
|
|
104
104
|
dataItems: r,
|
|
@@ -112,45 +112,45 @@ const sr = (t, S, b, z) => {
|
|
|
112
112
|
metaKey: !1,
|
|
113
113
|
shiftKey: !1,
|
|
114
114
|
isDrag: !1,
|
|
115
|
-
...
|
|
115
|
+
...Se(t.gridProps.selectable),
|
|
116
116
|
...o
|
|
117
|
-
}, a = r.findIndex((
|
|
117
|
+
}, a = r.findIndex((S) => S === e.dataItem);
|
|
118
118
|
switch ((d = n.data) == null ? void 0 : d.action) {
|
|
119
119
|
case "SortCommand":
|
|
120
120
|
if (y) {
|
|
121
|
-
const
|
|
122
|
-
|
|
121
|
+
const S = (l = n.name) == null ? void 0 : l.toLowerCase().includes("asc"), _ = ((s = n.name) == null ? void 0 : s.toLowerCase().includes("desc")) ? "desc" : void 0, W = S ? "asc" : _, ee = n.name ? W : void 0;
|
|
122
|
+
qe(e.event.syntheticEvent, y, ee);
|
|
123
123
|
}
|
|
124
124
|
break;
|
|
125
125
|
case "SelectRowCommand":
|
|
126
|
-
|
|
126
|
+
zt(i);
|
|
127
127
|
break;
|
|
128
128
|
case "SelectAllRowsCommand":
|
|
129
|
-
|
|
129
|
+
Wt(i);
|
|
130
130
|
break;
|
|
131
131
|
case "ExportPDFCommand":
|
|
132
|
-
|
|
132
|
+
Ke();
|
|
133
133
|
break;
|
|
134
134
|
case "ClearSelectionCommand":
|
|
135
|
-
|
|
135
|
+
pt(i);
|
|
136
136
|
break;
|
|
137
137
|
case "ReorderRowCommand":
|
|
138
|
-
ie.current = e.dataItem, (u = n.name) != null && u.toLowerCase().includes("rowup") && a > 0 && oe(e.event.syntheticEvent, a - 1, "before"), (m = n.name) != null && m.toLowerCase().includes("rowdown") && a < r.length - 1 && oe(e.event.syntheticEvent, a + 1, "after"), (w = n.name) != null && w.toLowerCase().includes("rowtop") && oe(e.event.syntheticEvent, 0, "before"), (
|
|
138
|
+
ie.current = e.dataItem, (u = n.name) != null && u.toLowerCase().includes("rowup") && a > 0 && oe(e.event.syntheticEvent, a - 1, "before"), (m = n.name) != null && m.toLowerCase().includes("rowdown") && a < r.length - 1 && oe(e.event.syntheticEvent, a + 1, "after"), (w = n.name) != null && w.toLowerCase().includes("rowtop") && oe(e.event.syntheticEvent, 0, "before"), (R = n.name) != null && R.toLowerCase().includes("rowbottom") && oe(e.event.syntheticEvent, r.length - 1, "after");
|
|
139
139
|
break;
|
|
140
140
|
case "CopySelectionCommand":
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
me(
|
|
142
|
+
Ne.copy,
|
|
143
143
|
e.event.nativeEvent,
|
|
144
144
|
{
|
|
145
|
-
copyHeaders: !((
|
|
145
|
+
copyHeaders: !((p = n.name) != null && p.toLowerCase().includes("noheaders"))
|
|
146
146
|
},
|
|
147
147
|
e.dataItem,
|
|
148
148
|
e.field
|
|
149
149
|
);
|
|
150
150
|
break;
|
|
151
151
|
case "PasteCommand":
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
me(
|
|
153
|
+
Ne.paste,
|
|
154
154
|
e.event.nativeEvent,
|
|
155
155
|
{
|
|
156
156
|
copyHeaders: !((g = n.name) != null && g.toLowerCase().includes("noheaders"))
|
|
@@ -160,21 +160,21 @@ const sr = (t, S, b, z) => {
|
|
|
160
160
|
);
|
|
161
161
|
break;
|
|
162
162
|
case "PinTopCommand":
|
|
163
|
-
|
|
163
|
+
le("pinTop", e.dataItem);
|
|
164
164
|
break;
|
|
165
165
|
case "PinBottomCommand":
|
|
166
|
-
|
|
166
|
+
le("pinBottom", e.dataItem);
|
|
167
167
|
break;
|
|
168
168
|
case "UnpinCommand":
|
|
169
|
-
|
|
169
|
+
le("unpin", e.dataItem);
|
|
170
170
|
break;
|
|
171
171
|
}
|
|
172
|
-
|
|
173
|
-
},
|
|
172
|
+
je();
|
|
173
|
+
}, se = () => {
|
|
174
174
|
const e = t.columnsRef.filter((n) => n.declarationIndex >= 0 && n.parentIndex === -1);
|
|
175
|
-
return
|
|
176
|
-
},
|
|
177
|
-
if (t.gridProps.onContextMenu &&
|
|
175
|
+
return nr(e);
|
|
176
|
+
}, bt = (e, n, o) => {
|
|
177
|
+
if (t.gridProps.onContextMenu && x) {
|
|
178
178
|
const r = {
|
|
179
179
|
target: E.current,
|
|
180
180
|
syntheticEvent: e,
|
|
@@ -184,45 +184,45 @@ const sr = (t, S, b, z) => {
|
|
|
184
184
|
};
|
|
185
185
|
f(t.gridProps.onContextMenu, r);
|
|
186
186
|
}
|
|
187
|
-
t.gridProps.contextMenu &&
|
|
187
|
+
t.gridProps.contextMenu && Pt({
|
|
188
188
|
event: e,
|
|
189
189
|
dataItem: n,
|
|
190
190
|
field: o
|
|
191
191
|
});
|
|
192
|
-
},
|
|
193
|
-
var a, d;
|
|
192
|
+
}, vt = (e) => {
|
|
193
|
+
var a, d, l;
|
|
194
194
|
if (e.target !== e.currentTarget)
|
|
195
195
|
return;
|
|
196
|
-
clearTimeout(
|
|
196
|
+
clearTimeout(We.current), C.current && (C.current.table = V.current);
|
|
197
197
|
const n = e.currentTarget.scrollLeft, o = e.currentTarget.scrollTop;
|
|
198
|
-
t.gridProps.columnVirtualization && (!
|
|
198
|
+
t.gridProps.columnVirtualization && (!D || o === Be.current) && (We.current = window.setTimeout(() => {
|
|
199
199
|
Y();
|
|
200
200
|
}, 0)), t.gridProps.scrollLeftRef && (t.gridProps.scrollLeftRef.current = n), $.current && $.current.setScrollLeft(n), q.current && q.current.setScrollLeft(n), A != null && A.current && A.current.setScrollLeft(n), F != null && F.current && F.current.setScrollLeft(n), L != null && L.current && L.current.setScrollLeft(n), B != null && B.current && B.current.setScrollLeft(n);
|
|
201
201
|
const r = (a = t.gridProps.virtualSkipRef) == null ? void 0 : a.current;
|
|
202
|
-
C.current && o !==
|
|
203
|
-
const i =
|
|
204
|
-
t.gridProps.onScroll &&
|
|
202
|
+
C.current && o !== Be.current && C.current.scrollHandler(e);
|
|
203
|
+
const i = D && ((d = t.gridProps.virtualSkipRef) == null ? void 0 : d.current) !== r;
|
|
204
|
+
t.gridProps.onScroll && x && f(t.gridProps.onScroll, {
|
|
205
205
|
...I(e)
|
|
206
|
-
}),
|
|
207
|
-
},
|
|
206
|
+
}), Be.current = o, !it.current && be.current && Math.abs(be.current.scrollTop - o) > 1 && (be.current.scrollTop = o), (l = ve.current) == null || l.call(ve), i || ct();
|
|
207
|
+
}, Ct = (e) => {
|
|
208
208
|
var o, r;
|
|
209
209
|
const n = e.target;
|
|
210
210
|
if ((e.keyCode === 38 || e.keyCode === 40) && n.closest(".k-grid-sticky-container")) {
|
|
211
211
|
const i = parseInt(((o = n.closest("tr")) == null ? void 0 : o.getAttribute("absolute-row-index")) || "", 10), a = n.getAttribute("data-keyboardnavid");
|
|
212
|
-
if (!isNaN(i) && a && !((r =
|
|
213
|
-
return
|
|
212
|
+
if (!isNaN(i) && a && !((r = M.current) == null ? void 0 : r.querySelector(`tr[absolute-row-index="${i}"]`)))
|
|
213
|
+
return ye.current = {
|
|
214
214
|
navId: a,
|
|
215
215
|
key: e.key,
|
|
216
216
|
code: e.code,
|
|
217
217
|
keyCode: e.keyCode
|
|
218
|
-
}, e.preventDefault(), e.stopPropagation(),
|
|
218
|
+
}, e.preventDefault(), e.stopPropagation(), he({ rowIndex: i }), !0;
|
|
219
219
|
}
|
|
220
220
|
return !1;
|
|
221
|
-
},
|
|
221
|
+
}, It = () => {
|
|
222
222
|
var a;
|
|
223
|
-
if (!
|
|
223
|
+
if (!ye.current || !H.current)
|
|
224
224
|
return;
|
|
225
|
-
const { navId: e, key: n, code: o, keyCode: r } =
|
|
225
|
+
const { navId: e, key: n, code: o, keyCode: r } = ye.current, i = (a = M.current) == null ? void 0 : a.querySelector(
|
|
226
226
|
`[data-keyboardnavid="${e}"]`
|
|
227
227
|
);
|
|
228
228
|
i && i.dispatchEvent(
|
|
@@ -234,89 +234,89 @@ const sr = (t, S, b, z) => {
|
|
|
234
234
|
cancelable: !0
|
|
235
235
|
})
|
|
236
236
|
);
|
|
237
|
-
},
|
|
238
|
-
if (
|
|
237
|
+
}, wt = (e) => {
|
|
238
|
+
if (Ct(e))
|
|
239
239
|
return;
|
|
240
240
|
ne.onKeyDown(e, {
|
|
241
241
|
navigatable: t.gridProps.navigatable || !1,
|
|
242
|
-
contextStateRef:
|
|
242
|
+
contextStateRef: U,
|
|
243
243
|
navigationStateRef: Q,
|
|
244
|
-
onNavigationAction:
|
|
245
|
-
columns:
|
|
244
|
+
onNavigationAction: Et,
|
|
245
|
+
columns: se()
|
|
246
246
|
}), ne.onGetSnapshotBeforeUpdate({
|
|
247
|
-
document:
|
|
248
|
-
contextStateRef:
|
|
247
|
+
document: O(),
|
|
248
|
+
contextStateRef: U,
|
|
249
249
|
navigationStateRef: Q
|
|
250
250
|
});
|
|
251
251
|
const n = {
|
|
252
|
-
dataItems:
|
|
252
|
+
dataItems: k(),
|
|
253
253
|
mode: v.mode,
|
|
254
254
|
cell: v.cell,
|
|
255
255
|
componentId: t.id,
|
|
256
256
|
selectedField: "",
|
|
257
257
|
...I(e)
|
|
258
258
|
};
|
|
259
|
-
t.gridProps.onKeyDown &&
|
|
260
|
-
},
|
|
259
|
+
t.gridProps.onKeyDown && x && f(t.gridProps.onKeyDown, n);
|
|
260
|
+
}, yt = (e) => {
|
|
261
261
|
ne.onFocus(e, {
|
|
262
262
|
navigatable: !!t.gridProps.navigatable,
|
|
263
|
-
contextStateRef:
|
|
263
|
+
contextStateRef: U
|
|
264
264
|
});
|
|
265
|
-
},
|
|
265
|
+
}, Et = (e) => {
|
|
266
266
|
const { columnsRef: n } = t;
|
|
267
|
-
if (e.action === "moveToNextPage" &&
|
|
267
|
+
if (e.action === "moveToNextPage" && Ut(e.event), e.action === "moveToPrevPage" && Vt(e.event), e.focusElement && (e.action === "reorderToRight" || e.action === "reorderToLeft")) {
|
|
268
268
|
const o = parseInt(e.focusElement.ariaColIndex, 10) - 1;
|
|
269
269
|
if (!n[o].reorderable)
|
|
270
270
|
return;
|
|
271
271
|
if (e.action === "reorderToRight" && o < t.columnsRef.length - 1) {
|
|
272
272
|
if (n[o + 1].disableReorder)
|
|
273
273
|
return;
|
|
274
|
-
|
|
274
|
+
ge(o, o + 1, e.event);
|
|
275
275
|
}
|
|
276
276
|
if (e.action === "reorderToLeft" && o > 0) {
|
|
277
277
|
if (n[o - 1].disableReorder)
|
|
278
278
|
return;
|
|
279
|
-
|
|
279
|
+
ge(o, o - 1, e.event);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
if (e.action === "select" &&
|
|
282
|
+
if (e.action === "select" && Ft(e.event), t.gridProps.onNavigationAction && x) {
|
|
283
283
|
const o = {
|
|
284
284
|
focusElement: e.focusElement,
|
|
285
285
|
...I(e.event)
|
|
286
286
|
};
|
|
287
287
|
f(t.gridProps.onNavigationAction, o);
|
|
288
288
|
}
|
|
289
|
-
},
|
|
290
|
-
t.gridProps.onRowClick &&
|
|
289
|
+
}, St = (e, n) => {
|
|
290
|
+
t.gridProps.onRowClick && xe(e.target, "TD") && f(t.gridProps.onRowClick, {
|
|
291
291
|
dataItem: n,
|
|
292
292
|
...I(e)
|
|
293
293
|
});
|
|
294
|
-
},
|
|
295
|
-
t.gridProps.onRowDoubleClick &&
|
|
294
|
+
}, xt = (e, n) => {
|
|
295
|
+
t.gridProps.onRowDoubleClick && xe(e.target, "TD") && f(t.gridProps.onRowDoubleClick, {
|
|
296
296
|
dataItem: n,
|
|
297
297
|
...I(e)
|
|
298
298
|
});
|
|
299
|
-
},
|
|
299
|
+
}, kt = (e) => {
|
|
300
300
|
t.gridProps.onItemChange && f(t.gridProps.onItemChange, {
|
|
301
301
|
...I(e.syntheticEvent),
|
|
302
302
|
dataItem: e.dataItem,
|
|
303
303
|
field: void 0,
|
|
304
304
|
value: void 0
|
|
305
305
|
});
|
|
306
|
-
},
|
|
306
|
+
}, Dt = (e) => {
|
|
307
307
|
t.gridProps.onItemChange && t.gridProps.onEditChange && f(t.gridProps.onEditChange, {
|
|
308
308
|
edit: {},
|
|
309
309
|
...I(e.syntheticEvent)
|
|
310
310
|
});
|
|
311
|
-
},
|
|
311
|
+
}, Kt = (e, n, o) => {
|
|
312
312
|
var r, i;
|
|
313
|
-
if (
|
|
313
|
+
if (st.enabled && st.mode === "incell" && t.gridProps.dataItemKey) {
|
|
314
314
|
if (t.gridProps.pinnable && t.gridProps.editZoneRef) {
|
|
315
315
|
const d = !!((i = (r = e.target).closest) != null && i.call(r, ".k-grid-pinned-container"));
|
|
316
316
|
t.gridProps.editZoneRef.current = d ? "pinned" : "body";
|
|
317
317
|
}
|
|
318
|
-
const a =
|
|
319
|
-
type:
|
|
318
|
+
const a = Un(t.gridProps.edit, {
|
|
319
|
+
type: Vn.ENTER_FIELD_EDIT,
|
|
320
320
|
payload: { id: n[t.gridProps.dataItemKey], field: o }
|
|
321
321
|
});
|
|
322
322
|
t.gridProps.onEditChange && f(t.gridProps.onEditChange, {
|
|
@@ -324,29 +324,29 @@ const sr = (t, S, b, z) => {
|
|
|
324
324
|
...I(e)
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
|
-
},
|
|
327
|
+
}, Tt = (e, n) => {
|
|
328
328
|
var r;
|
|
329
|
-
if (
|
|
330
|
-
const i =
|
|
329
|
+
if (Nn(t.detailExpandable).enabled) {
|
|
330
|
+
const i = jn((r = t.gridProps.detailExpand) != null ? r : {}, e);
|
|
331
331
|
t.gridProps.onDetailExpandChange && f(t.gridProps.onDetailExpandChange, {
|
|
332
332
|
...I(n),
|
|
333
333
|
detailExpand: i
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
|
-
},
|
|
336
|
+
}, Mt = (e, n) => {
|
|
337
337
|
var r;
|
|
338
|
-
const o =
|
|
338
|
+
const o = On(
|
|
339
339
|
typeof t.gridProps.groupable == "object" ? t.gridProps.groupable.expandable !== !1 : t.gridProps.groupable
|
|
340
340
|
);
|
|
341
341
|
if (o.enabled) {
|
|
342
|
-
const i =
|
|
342
|
+
const i = pn((r = t.gridProps.groupExpand) != null ? r : [], e, o);
|
|
343
343
|
t.gridProps.onGroupExpandChange && f(t.gridProps.onGroupExpandChange, {
|
|
344
344
|
...I(n),
|
|
345
345
|
groupExpand: i
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
|
-
|
|
349
|
-
},
|
|
348
|
+
In(e.group);
|
|
349
|
+
}, Gt = c.useCallback(
|
|
350
350
|
(e) => {
|
|
351
351
|
const { dataItemKey: n = "", pinnedTopRows: o = [], pinnedBottomRows: r = [] } = t.gridProps;
|
|
352
352
|
if (!n || !e)
|
|
@@ -355,7 +355,7 @@ const sr = (t, S, b, z) => {
|
|
|
355
355
|
return o != null && o.some((a) => a[n] === i) ? "top" : r != null && r.some((a) => a[n] === i) ? "bottom" : "none";
|
|
356
356
|
},
|
|
357
357
|
[t.gridProps.pinnedTopRows, t.gridProps.pinnedBottomRows, t.gridProps.dataItemKey]
|
|
358
|
-
),
|
|
358
|
+
), le = (e, n) => {
|
|
359
359
|
if (!t.gridProps.pinnable)
|
|
360
360
|
return;
|
|
361
361
|
const { dataItemKey: o = "", pinnedTopRows: r = [], pinnedBottomRows: i = [] } = t.gridProps, a = n[o], d = r.filter((u) => u[o] !== a), l = i.filter((u) => u[o] !== a);
|
|
@@ -374,13 +374,13 @@ const sr = (t, S, b, z) => {
|
|
|
374
374
|
return;
|
|
375
375
|
}
|
|
376
376
|
t.gridProps.onRowPinChange && f(t.gridProps.onRowPinChange, s);
|
|
377
|
-
},
|
|
378
|
-
const { allowUnsort: r, mode: i } =
|
|
377
|
+
}, qe = (e, n, o) => {
|
|
378
|
+
const { allowUnsort: r, mode: i } = dr(
|
|
379
379
|
t.gridProps.sortable || !1,
|
|
380
380
|
n.sortable || !1
|
|
381
|
-
), a = (t.gridProps.sort || []).filter((s) => s.field === n.field)[0], d = o ||
|
|
382
|
-
d !== "" && n.field && l.push({ field: n.field, dir: d }),
|
|
383
|
-
},
|
|
381
|
+
), a = (t.gridProps.sort || []).filter((s) => s.field === n.field)[0], d = o || sr[r][a && a.dir || ""], l = i === "single" ? [] : (t.gridProps.sort || []).filter((s) => s.field !== n.field);
|
|
382
|
+
d !== "" && n.field && l.push({ field: n.field, dir: d }), _e(l, e);
|
|
383
|
+
}, Ht = (e) => {
|
|
384
384
|
t.gridProps.onItemChange && f(t.gridProps.onItemChange, {
|
|
385
385
|
...I(e.syntheticEvent),
|
|
386
386
|
dataItem: e.dataItem,
|
|
@@ -388,7 +388,7 @@ const sr = (t, S, b, z) => {
|
|
|
388
388
|
field: e.field,
|
|
389
389
|
value: e.value
|
|
390
390
|
});
|
|
391
|
-
},
|
|
391
|
+
}, At = (e) => {
|
|
392
392
|
var n;
|
|
393
393
|
if (t.gridProps.onSelectionChange && v.enabled) {
|
|
394
394
|
const { event: o, dataItem: r, dataIndex: i, columnIndex: a } = e, d = {
|
|
@@ -398,7 +398,7 @@ const sr = (t, S, b, z) => {
|
|
|
398
398
|
endColIndex: a,
|
|
399
399
|
startRowIndex: i,
|
|
400
400
|
endRowIndex: i,
|
|
401
|
-
dataItems:
|
|
401
|
+
dataItems: k(),
|
|
402
402
|
altKey: !1,
|
|
403
403
|
ctrlKey: !1,
|
|
404
404
|
shiftKey: !1,
|
|
@@ -411,34 +411,34 @@ const sr = (t, S, b, z) => {
|
|
|
411
411
|
};
|
|
412
412
|
f(t.gridProps.onSelectionChange, {
|
|
413
413
|
...d,
|
|
414
|
-
select: t.gridProps.dataItemKey ?
|
|
414
|
+
select: t.gridProps.dataItemKey ? gt({
|
|
415
415
|
event: d,
|
|
416
416
|
selectedState: (n = t.gridProps.select) != null ? n : {},
|
|
417
417
|
dataItemKey: t.gridProps.dataItemKey
|
|
418
418
|
}) : {}
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
|
-
},
|
|
421
|
+
}, Ft = (e) => {
|
|
422
422
|
var s, u;
|
|
423
423
|
if (!v.enabled || !t.gridProps.dataItemKey)
|
|
424
424
|
return;
|
|
425
425
|
const n = {
|
|
426
|
-
dataItems:
|
|
426
|
+
dataItems: k(),
|
|
427
427
|
mode: v.mode,
|
|
428
428
|
cell: v.cell,
|
|
429
429
|
componentId: t.id,
|
|
430
430
|
selectedField: "",
|
|
431
431
|
...I(e)
|
|
432
|
-
}, o =
|
|
432
|
+
}, o = qn({
|
|
433
433
|
event: n,
|
|
434
434
|
selectedState: (s = t.gridProps.select) != null ? s : {},
|
|
435
435
|
dataItemKey: t.gridProps.dataItemKey
|
|
436
436
|
});
|
|
437
437
|
if (o === t.gridProps.select)
|
|
438
438
|
return;
|
|
439
|
-
const r = e.target, i =
|
|
439
|
+
const r = e.target, i = xe(r, "TD"), a = xe(r, "TR"), d = $n(i), l = _n(a);
|
|
440
440
|
if (d !== void 0 && l !== void 0) {
|
|
441
|
-
const m = (u =
|
|
441
|
+
const m = (u = or(t.gridProps.data)) == null ? void 0 : u[l];
|
|
442
442
|
t.gridProps.onSelectionChange && f(t.gridProps.onSelectionChange, {
|
|
443
443
|
...n,
|
|
444
444
|
select: o,
|
|
@@ -456,9 +456,9 @@ const sr = (t, S, b, z) => {
|
|
|
456
456
|
isDrag: !1
|
|
457
457
|
});
|
|
458
458
|
}
|
|
459
|
-
},
|
|
459
|
+
}, Lt = (e) => {
|
|
460
460
|
if (t.gridProps.onHeaderSelectionChange && v.enabled) {
|
|
461
|
-
const n =
|
|
461
|
+
const n = k();
|
|
462
462
|
f(t.gridProps.onHeaderSelectionChange, {
|
|
463
463
|
select: e.syntheticEvent.target.checked ? n.reduce((o, r) => (t.gridProps.dataItemKey && te(t.gridProps.dataItemKey)(r) !== void 0 && (o[te(t.gridProps.dataItemKey)(r)] = !0), o), {}) : {},
|
|
464
464
|
field: e.field,
|
|
@@ -473,20 +473,20 @@ const sr = (t, S, b, z) => {
|
|
|
473
473
|
...e,
|
|
474
474
|
select: n
|
|
475
475
|
});
|
|
476
|
-
},
|
|
476
|
+
}, Bt = (e, n) => {
|
|
477
477
|
const o = t.gridProps.dataItemKey;
|
|
478
478
|
if (!o || !n)
|
|
479
479
|
return;
|
|
480
|
-
const r = te(o), i =
|
|
481
|
-
i !== -1 &&
|
|
480
|
+
const r = te(o), i = k().findIndex((a) => r(a) === r(n));
|
|
481
|
+
i !== -1 && $e({
|
|
482
482
|
...e,
|
|
483
483
|
startRowIndex: i,
|
|
484
484
|
endRowIndex: i
|
|
485
485
|
});
|
|
486
|
-
},
|
|
486
|
+
}, $e = (e) => {
|
|
487
487
|
var n;
|
|
488
488
|
if (t.gridProps.onSelectionChange && v.enabled) {
|
|
489
|
-
const o =
|
|
489
|
+
const o = k(), r = o[e.startRowIndex], i = o[e.endRowIndex], a = {
|
|
490
490
|
syntheticEvent: void 0,
|
|
491
491
|
target: E.current,
|
|
492
492
|
selectedField: "",
|
|
@@ -496,14 +496,14 @@ const sr = (t, S, b, z) => {
|
|
|
496
496
|
startDataItem: r,
|
|
497
497
|
endDataItem: i,
|
|
498
498
|
...e
|
|
499
|
-
}, d =
|
|
499
|
+
}, d = gt({
|
|
500
500
|
event: a,
|
|
501
501
|
selectedState: (n = t.gridProps.select) != null ? n : {},
|
|
502
502
|
dataItemKey: t.gridProps.dataItemKey
|
|
503
503
|
});
|
|
504
504
|
J(a, d);
|
|
505
505
|
}
|
|
506
|
-
},
|
|
506
|
+
}, Wt = (e) => {
|
|
507
507
|
if (t.gridProps.onSelectionChange && v.enabled) {
|
|
508
508
|
const n = e.dataItems[0], o = e.dataItems[e.dataItems.length - 1], r = {}, i = {
|
|
509
509
|
...e,
|
|
@@ -519,7 +519,7 @@ const sr = (t, S, b, z) => {
|
|
|
519
519
|
r[l] = e.cell ? [...Array(t.columnsRef.length).keys()] : !0;
|
|
520
520
|
}), J(i, r);
|
|
521
521
|
}
|
|
522
|
-
},
|
|
522
|
+
}, zt = (e) => {
|
|
523
523
|
if (t.gridProps.onSelectionChange && v.enabled) {
|
|
524
524
|
const o = te(t.gridProps.dataItemKey)(e.dataItem), r = 0, i = t.columnsRef.length - 1, a = e.dataItems.findIndex(
|
|
525
525
|
(m) => m[t.gridProps.dataItemKey] === e.dataItem[t.gridProps.dataItemKey]
|
|
@@ -534,10 +534,10 @@ const sr = (t, S, b, z) => {
|
|
|
534
534
|
}, u = e.mode === "multiple" ? t.gridProps.select || {} : {};
|
|
535
535
|
u[o] === !0 || Array.isArray(u[o]) && u[o].length === t.columnsRef.length ? delete u[o] : u[o] = e.cell ? [...Array(t.columnsRef.length).keys()] : !0, J(s, u);
|
|
536
536
|
}
|
|
537
|
-
},
|
|
537
|
+
}, Ot = (e) => {
|
|
538
538
|
if (!v.enabled)
|
|
539
539
|
return;
|
|
540
|
-
const n =
|
|
540
|
+
const n = k(), o = {
|
|
541
541
|
syntheticEvent: void 0,
|
|
542
542
|
nativeEvent: void 0,
|
|
543
543
|
target: E.current,
|
|
@@ -566,7 +566,7 @@ const sr = (t, S, b, z) => {
|
|
|
566
566
|
J(m, {});
|
|
567
567
|
return;
|
|
568
568
|
}
|
|
569
|
-
const r =
|
|
569
|
+
const r = mt(
|
|
570
570
|
t.gridProps.data,
|
|
571
571
|
e,
|
|
572
572
|
t.columnsRef,
|
|
@@ -579,8 +579,8 @@ const sr = (t, S, b, z) => {
|
|
|
579
579
|
if (t.gridProps.dataItemKey) {
|
|
580
580
|
const m = te(t.gridProps.dataItemKey);
|
|
581
581
|
for (let w = 0; w < n.length; w++) {
|
|
582
|
-
const
|
|
583
|
-
|
|
582
|
+
const R = m(n[w]);
|
|
583
|
+
R !== void 0 && r[R] && (a === -1 && (a = w, l = n[w]), d = w, s = n[w]);
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
586
|
const u = {
|
|
@@ -593,86 +593,86 @@ const sr = (t, S, b, z) => {
|
|
|
593
593
|
endDataItem: s
|
|
594
594
|
};
|
|
595
595
|
J(u, i);
|
|
596
|
-
},
|
|
596
|
+
}, pt = (e) => {
|
|
597
597
|
t.gridProps.onSelectionChange && v.enabled && J(e, {});
|
|
598
598
|
}, X = (e, n, o, r, i) => {
|
|
599
|
-
|
|
599
|
+
jt();
|
|
600
600
|
const a = t.gridProps.onDataStateChange;
|
|
601
601
|
if (e) {
|
|
602
602
|
const d = { ...I(r), ...n, targetEvent: i };
|
|
603
603
|
f(e, d);
|
|
604
|
-
} else a && (
|
|
605
|
-
...
|
|
604
|
+
} else a && (ce.current = {
|
|
605
|
+
...ce.current,
|
|
606
606
|
...o
|
|
607
607
|
}, f(a, {
|
|
608
608
|
...I(r),
|
|
609
609
|
targetEvent: i || {},
|
|
610
610
|
dataState: {
|
|
611
|
-
...
|
|
612
|
-
...
|
|
611
|
+
...rn(),
|
|
612
|
+
...ce.current
|
|
613
613
|
}
|
|
614
614
|
}));
|
|
615
|
-
},
|
|
615
|
+
}, ue = (e, n, o) => {
|
|
616
616
|
var r;
|
|
617
|
-
|
|
617
|
+
D && t.gridProps.pageable && ((r = C.current) == null || r.reset()), X(
|
|
618
618
|
t.gridProps.onPageChange,
|
|
619
619
|
{ page: e },
|
|
620
620
|
{ skip: e.skip, take: e.take },
|
|
621
621
|
n,
|
|
622
622
|
o
|
|
623
623
|
);
|
|
624
|
-
},
|
|
624
|
+
}, Nt = (e, n, o) => {
|
|
625
625
|
var r;
|
|
626
|
-
t.gridProps.pageable || (r = t.gridProps.group) != null && r.length ? t.gridProps.virtualSkipRef && (t.gridProps.virtualSkipRef.current = e.skip, Y()) :
|
|
627
|
-
},
|
|
626
|
+
t.gridProps.pageable || (r = t.gridProps.group) != null && r.length ? t.gridProps.virtualSkipRef && (t.gridProps.virtualSkipRef.current = e.skip, Y()) : ue(e, n, o);
|
|
627
|
+
}, De = () => {
|
|
628
628
|
let e = t.gridProps.total || 0;
|
|
629
629
|
return Array.isArray(t.gridProps.data) ? e = e || t.gridProps.data.length : t.gridProps.data && (e = e || t.gridProps.data.total), e;
|
|
630
|
-
},
|
|
631
|
-
|
|
632
|
-
},
|
|
630
|
+
}, jt = () => {
|
|
631
|
+
D && t.gridProps.virtualSkipRef && (t.gridProps.virtualSkipRef.current = 0);
|
|
632
|
+
}, Ut = (e) => {
|
|
633
633
|
var i, a;
|
|
634
|
-
const n = (a = (i = t.gridProps.take) != null ? i : t.gridProps.pageSize) != null ? a : 0, o = (t.gridProps.skip || 0) + n, r =
|
|
635
|
-
o < r &&
|
|
636
|
-
},
|
|
634
|
+
const n = (a = (i = t.gridProps.take) != null ? i : t.gridProps.pageSize) != null ? a : 0, o = (t.gridProps.skip || 0) + n, r = De();
|
|
635
|
+
o < r && ue({ skip: o, take: n }, e);
|
|
636
|
+
}, Vt = (e) => {
|
|
637
637
|
var r, i;
|
|
638
638
|
const n = (i = (r = t.gridProps.take) != null ? r : t.gridProps.pageSize) != null ? i : 0, o = (t.gridProps.skip || 0) - n;
|
|
639
|
-
o >= 0 &&
|
|
640
|
-
},
|
|
641
|
-
|
|
642
|
-
},
|
|
639
|
+
o >= 0 && ue({ skip: o, take: n }, e);
|
|
640
|
+
}, qt = (e) => {
|
|
641
|
+
ue({ skip: e.skip, take: e.take }, e.syntheticEvent, e.targetEvent);
|
|
642
|
+
}, _e = (e, n) => {
|
|
643
643
|
X(
|
|
644
644
|
t.gridProps.onSortChange,
|
|
645
645
|
{ sort: e },
|
|
646
|
-
{ sort: e, ...
|
|
646
|
+
{ sort: e, ...D && !t.gridProps.pageable ? { skip: 0 } : {} },
|
|
647
647
|
n
|
|
648
648
|
);
|
|
649
|
-
},
|
|
649
|
+
}, $t = (e, n) => {
|
|
650
650
|
X(
|
|
651
651
|
t.gridProps.onFilterChange,
|
|
652
652
|
{ filter: e },
|
|
653
653
|
{ filter: e, skip: 0 },
|
|
654
654
|
n
|
|
655
655
|
);
|
|
656
|
-
},
|
|
656
|
+
}, _t = (e) => {
|
|
657
657
|
if (!e || e.length === 0) {
|
|
658
|
-
|
|
658
|
+
Ze({});
|
|
659
659
|
return;
|
|
660
660
|
}
|
|
661
|
-
const n =
|
|
661
|
+
const n = mt(
|
|
662
662
|
t.gridProps.data,
|
|
663
663
|
e,
|
|
664
664
|
t.columnsRef,
|
|
665
665
|
t.gridProps.dataItemKey
|
|
666
666
|
);
|
|
667
|
-
|
|
668
|
-
},
|
|
667
|
+
Ze({ ...n });
|
|
668
|
+
}, Ze = (e) => {
|
|
669
669
|
X(
|
|
670
670
|
t.gridProps.onHighlightChange,
|
|
671
671
|
{ highlight: e },
|
|
672
672
|
{},
|
|
673
673
|
{}
|
|
674
674
|
);
|
|
675
|
-
},
|
|
675
|
+
}, Zt = (e) => {
|
|
676
676
|
const n = t.gridProps.searchFields || t.columnsRef.map((i) => i.field) || [], o = e.nativeEvent.target.value, r = {
|
|
677
677
|
logic: "or",
|
|
678
678
|
filters: n.filter((i) => i !== void 0).map((i) => {
|
|
@@ -693,31 +693,31 @@ const sr = (t, S, b, z) => {
|
|
|
693
693
|
{ skip: 0 },
|
|
694
694
|
e.syntheticEvent
|
|
695
695
|
);
|
|
696
|
-
},
|
|
696
|
+
}, Ke = () => {
|
|
697
697
|
var e;
|
|
698
|
-
(e =
|
|
699
|
-
},
|
|
698
|
+
(e = K.current) == null || e.save();
|
|
699
|
+
}, Je = async () => {
|
|
700
700
|
var e;
|
|
701
|
-
await ((e =
|
|
702
|
-
},
|
|
701
|
+
await ((e = N.current) == null ? void 0 : e.save());
|
|
702
|
+
}, Xe = () => {
|
|
703
703
|
var e;
|
|
704
|
-
return ((e =
|
|
705
|
-
},
|
|
704
|
+
return ((e = N.current) == null ? void 0 : e.getBlob()) || null;
|
|
705
|
+
}, Jt = async (e) => {
|
|
706
706
|
var n, o;
|
|
707
707
|
(n = t.gridProps) != null && n.onPdfExport && await ((o = t.gridProps) == null ? void 0 : o.onPdfExport(e));
|
|
708
|
-
},
|
|
708
|
+
}, Xt = (e) => {
|
|
709
709
|
var n, o;
|
|
710
710
|
return (n = t.gridProps) != null && n.onCsvExport ? (o = t.gridProps) == null ? void 0 : o.onCsvExport(e) : e;
|
|
711
|
-
},
|
|
711
|
+
}, Te = (e, n) => {
|
|
712
712
|
const o = n.nativeEvent ? n : { nativeEvent: n.nativeEvent || n.originalEvent };
|
|
713
713
|
let r = {};
|
|
714
|
-
t.isVirtualScroll && e.length && !t.gridProps.pageable && (r = { take: void 0 }), e.length === 0 && t.gridProps.navigatable && (
|
|
714
|
+
t.isVirtualScroll && e.length && !t.gridProps.pageable && (r = { take: void 0 }), e.length === 0 && t.gridProps.navigatable && (Ae.current = !0), X(
|
|
715
715
|
t.gridProps.onGroupChange,
|
|
716
716
|
{ group: e },
|
|
717
717
|
{ group: e, skip: 0, ...r },
|
|
718
718
|
o
|
|
719
719
|
);
|
|
720
|
-
},
|
|
720
|
+
}, Me = (e) => {
|
|
721
721
|
if (t.gridProps.onColumnsStateChange) {
|
|
722
722
|
const n = {
|
|
723
723
|
target: E.current,
|
|
@@ -725,31 +725,31 @@ const sr = (t, S, b, z) => {
|
|
|
725
725
|
};
|
|
726
726
|
f(t.gridProps.onColumnsStateChange, n);
|
|
727
727
|
}
|
|
728
|
-
},
|
|
729
|
-
const { columnsRef: r, columnsState: i } = t, a = r[e], d =
|
|
728
|
+
}, ge = (e, n, o) => {
|
|
729
|
+
const { columnsRef: r, columnsState: i } = t, a = r[e], d = rr(i), l = a.depth, s = (R) => {
|
|
730
730
|
do
|
|
731
|
-
|
|
732
|
-
while (
|
|
733
|
-
return
|
|
731
|
+
R++;
|
|
732
|
+
while (R < r.length && r[R].depth > l);
|
|
733
|
+
return R;
|
|
734
734
|
}, u = r.splice(e, s(e) - e);
|
|
735
|
-
r.splice(e < n ? s(n - u.length) : n, 0, ...u), r.filter((
|
|
736
|
-
|
|
737
|
-
const g = d.find((
|
|
738
|
-
g && (g.orderIndex =
|
|
735
|
+
r.splice(e < n ? s(n - u.length) : n, 0, ...u), r.filter((R) => R.declarationIndex >= 0).forEach((R, p) => {
|
|
736
|
+
R.orderIndex = p;
|
|
737
|
+
const g = d.find((S) => S.id === R.id);
|
|
738
|
+
g && (g.orderIndex = p);
|
|
739
739
|
});
|
|
740
740
|
const m = r[e].locked && r[n].locked;
|
|
741
|
-
|
|
742
|
-
const w =
|
|
741
|
+
Wn(t.columnsMapRef, r, m || Ie.current), zn(t.columnsMapRef, r, m || Ie.current), He.current && (Ie.current = !1, He.current = !1);
|
|
742
|
+
const w = se();
|
|
743
743
|
if (Y(), t.gridProps.onColumnReorder) {
|
|
744
|
-
const
|
|
744
|
+
const R = {
|
|
745
745
|
target: E.current,
|
|
746
746
|
columns: w,
|
|
747
747
|
columnId: a.id,
|
|
748
748
|
nativeEvent: o
|
|
749
749
|
};
|
|
750
|
-
f(t.gridProps.onColumnReorder,
|
|
750
|
+
f(t.gridProps.onColumnReorder, R);
|
|
751
751
|
}
|
|
752
|
-
|
|
752
|
+
Me(i);
|
|
753
753
|
}, oe = (e, n, o) => {
|
|
754
754
|
const r = typeof t.gridProps.rowReorderable == "object" ? t.gridProps.rowReorderable.enabled : t.gridProps.rowReorderable;
|
|
755
755
|
if (o === "forbidden" || !r || !ie.current)
|
|
@@ -763,72 +763,72 @@ const sr = (t, S, b, z) => {
|
|
|
763
763
|
dragEvent: e,
|
|
764
764
|
target: E.current
|
|
765
765
|
}), ie.current = null;
|
|
766
|
-
},
|
|
766
|
+
}, Yt = (e, n, o) => {
|
|
767
767
|
if (t.gridProps.group === void 0)
|
|
768
768
|
return;
|
|
769
769
|
const r = t.gridProps.group.slice();
|
|
770
|
-
r.splice(n, 0, ...r.splice(e, 1)),
|
|
771
|
-
},
|
|
770
|
+
r.splice(n, 0, ...r.splice(e, 1)), Te(r, o);
|
|
771
|
+
}, Ye = (e, n, o) => {
|
|
772
772
|
const r = t.columnsRef[e].field;
|
|
773
773
|
if (!r)
|
|
774
774
|
return;
|
|
775
775
|
const i = (t.gridProps.group || []).slice();
|
|
776
|
-
i.splice(n, 0, { field: r }),
|
|
777
|
-
},
|
|
778
|
-
const o =
|
|
779
|
-
|
|
780
|
-
},
|
|
781
|
-
var e, n, o, r, i, a, d, l, s, u, m, w,
|
|
776
|
+
i.splice(n, 0, { field: r }), Te(i, o);
|
|
777
|
+
}, Qt = (e, n) => {
|
|
778
|
+
const o = j.current.getCurrentGroupsLength;
|
|
779
|
+
Ye(e, o, n);
|
|
780
|
+
}, Ge = () => {
|
|
781
|
+
var e, n, o, r, i, a, d, l, s, u, m, w, R, p;
|
|
782
782
|
if (t.gridProps.dataLayoutMode === "stacked") {
|
|
783
|
-
const g = ((e =
|
|
783
|
+
const g = ((e = H.current) == null ? void 0 : e.offsetWidth) || 0;
|
|
784
784
|
if ((n = P.current) != null && n.colGroupMain && g) {
|
|
785
|
-
const
|
|
786
|
-
if (
|
|
785
|
+
const S = P.current.colGroupMain.children, b = S.length - 1;
|
|
786
|
+
if (b >= 0) {
|
|
787
787
|
let _ = 0;
|
|
788
|
-
for (let ee = 0; ee <
|
|
789
|
-
const
|
|
790
|
-
_ +=
|
|
788
|
+
for (let ee = 0; ee < b; ee++) {
|
|
789
|
+
const xn = parseFloat((S[ee].width || 0).toString()) || S[ee].clientWidth;
|
|
790
|
+
_ += xn;
|
|
791
791
|
}
|
|
792
792
|
const W = Math.max(0, g - _);
|
|
793
|
-
|
|
793
|
+
S[b].width = W + "px", (r = (o = P.current.colGroupHeader) == null ? void 0 : o.children) != null && r[b] && (P.current.colGroupHeader.children[b].width = W + "px"), (a = (i = P.current.colGroupFooter) == null ? void 0 : i.children) != null && a[b] && (P.current.colGroupFooter.children[b].width = W + "px"), (l = (d = P.current.colGroupStickyHeader) == null ? void 0 : d.children) != null && l[b] && (P.current.colGroupStickyHeader.children[b].width = W + "px"), (u = (s = P.current.colGroupStickyFooter) == null ? void 0 : s.children) != null && u[b] && (P.current.colGroupStickyFooter.children[b].width = W + "px"), (w = (m = P.current.colGroupPinnedTop) == null ? void 0 : m.children) != null && w[b] && (P.current.colGroupPinnedTop.children[b].width = W + "px"), (p = (R = P.current.colGroupPinnedBottom) == null ? void 0 : R.children) != null && p[b] && (P.current.colGroupPinnedBottom.children[b].width = W + "px");
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
|
-
$.current && $.current.setWidth(g), q.current && q.current.setWidth(g), A.current && A.current.setWidth(g), F.current && F.current.setWidth(g), L.current && L.current.setWidth(g), B.current && B.current.setWidth(g),
|
|
796
|
+
$.current && $.current.setWidth(g), q.current && q.current.setWidth(g), A.current && A.current.setWidth(g), F.current && F.current.setWidth(g), L.current && L.current.setWidth(g), B.current && B.current.setWidth(g), V.current && (V.current.style.width = g ? g + "px" : "");
|
|
797
797
|
} else {
|
|
798
798
|
let g = 0;
|
|
799
799
|
if (!P.current.colGroupMain)
|
|
800
800
|
return;
|
|
801
|
-
const
|
|
802
|
-
for (let
|
|
803
|
-
const _ =
|
|
801
|
+
const S = P.current.colGroupMain.children;
|
|
802
|
+
for (let b = 0; b < S.length; b++) {
|
|
803
|
+
const _ = S[b].width;
|
|
804
804
|
if (!_) {
|
|
805
805
|
g = 0;
|
|
806
806
|
break;
|
|
807
807
|
}
|
|
808
808
|
g += parseFloat(_.toString());
|
|
809
809
|
}
|
|
810
|
-
g = Math.round(g), $.current && $.current.setWidth(g), q.current && q.current.setWidth(g), A.current && A.current.setWidth(g), F.current && F.current.setWidth(g), L.current && L.current.setWidth(g), B.current && B.current.setWidth(g),
|
|
810
|
+
g = Math.round(g), $.current && $.current.setWidth(g), q.current && q.current.setWidth(g), A.current && A.current.setWidth(g), F.current && F.current.setWidth(g), L.current && L.current.setWidth(g), B.current && B.current.setWidth(g), V.current && (V.current.style.width = g ? g + "px" : "");
|
|
811
811
|
}
|
|
812
|
-
|
|
813
|
-
},
|
|
814
|
-
const e =
|
|
815
|
-
|
|
816
|
-
},
|
|
812
|
+
Ee.current && en();
|
|
813
|
+
}, en = () => {
|
|
814
|
+
const e = G.current, n = e ? e.scrollWidth > e.clientWidth : !1;
|
|
815
|
+
Ee.current && (Ee.current.style.marginBlockEnd = n ? "var(--kendo-scrollbar-width, 0px)" : "");
|
|
816
|
+
}, Qe = () => {
|
|
817
817
|
var e;
|
|
818
|
-
t.gridProps.widthRef && (t.gridProps.widthRef.current = ((e =
|
|
819
|
-
},
|
|
818
|
+
t.gridProps.widthRef && (t.gridProps.widthRef.current = ((e = H.current) == null ? void 0 : e.offsetWidth) || 0);
|
|
819
|
+
}, fe = () => {
|
|
820
820
|
var e;
|
|
821
|
-
t.gridProps.containerHeightRef && (t.gridProps.containerHeightRef.current = ((e =
|
|
822
|
-
},
|
|
821
|
+
t.gridProps.containerHeightRef && (t.gridProps.containerHeightRef.current = ((e = G.current) == null ? void 0 : e.offsetHeight) || 0);
|
|
822
|
+
}, tn = () => {
|
|
823
823
|
const e = t.gridProps.minRowHeightRef;
|
|
824
824
|
if (e && !e.current && !t.gridProps.rowHeight) {
|
|
825
|
-
const n =
|
|
825
|
+
const n = tr(M.current);
|
|
826
826
|
n && (e.current = n, Y());
|
|
827
827
|
}
|
|
828
|
-
},
|
|
828
|
+
}, me = c.useCallback(
|
|
829
829
|
(e, n, o, r, i) => {
|
|
830
830
|
var s;
|
|
831
|
-
if (!
|
|
831
|
+
if (!nn() && !o || !e)
|
|
832
832
|
return;
|
|
833
833
|
const a = {
|
|
834
834
|
type: e,
|
|
@@ -839,13 +839,13 @@ const sr = (t, S, b, z) => {
|
|
|
839
839
|
field: i,
|
|
840
840
|
...typeof t.gridProps.clipboard != "boolean" ? t.gridProps.clipboard : {},
|
|
841
841
|
...o
|
|
842
|
-
}, d =
|
|
842
|
+
}, d = k(), l = An({
|
|
843
843
|
event: a,
|
|
844
844
|
data: d,
|
|
845
845
|
selectedState: (s = t.gridProps.select) != null ? s : {},
|
|
846
|
-
previousCopiedItems:
|
|
846
|
+
previousCopiedItems: at.current
|
|
847
847
|
});
|
|
848
|
-
e !==
|
|
848
|
+
e !== Ne.paste && (at.current = l.copiedItems), t.gridProps.onClipboard && x && f(t.gridProps.onClipboard, {
|
|
849
849
|
...a,
|
|
850
850
|
...l
|
|
851
851
|
});
|
|
@@ -857,15 +857,15 @@ const sr = (t, S, b, z) => {
|
|
|
857
857
|
t.gridProps.clipboard,
|
|
858
858
|
t.gridProps.onClipboard
|
|
859
859
|
]
|
|
860
|
-
),
|
|
860
|
+
), nn = () => {
|
|
861
861
|
var i, a, d;
|
|
862
862
|
if (!ae)
|
|
863
863
|
return !1;
|
|
864
|
-
const e =
|
|
864
|
+
const e = Dn(O()), n = e ? e.matches(".k-table-td") ? e : (i = O()) == null ? void 0 : i.body : (a = O()) == null ? void 0 : a.body, o = n == null ? void 0 : n.closest(".k-grid-container"), r = n && ((d = H.current) == null ? void 0 : d.contains(n));
|
|
865
865
|
return !!(n && r && o);
|
|
866
|
-
},
|
|
867
|
-
|
|
868
|
-
columns:
|
|
866
|
+
}, et = (e, n, o, r, i, a, d) => {
|
|
867
|
+
Ge(), Ie.current = !0, He.current = !0, t.gridProps.onColumnResize && x && f(t.gridProps.onColumnResize, {
|
|
868
|
+
columns: se(),
|
|
869
869
|
nativeEvent: r,
|
|
870
870
|
targetColumnId: d,
|
|
871
871
|
index: e,
|
|
@@ -873,8 +873,8 @@ const sr = (t, S, b, z) => {
|
|
|
873
873
|
oldWidth: o,
|
|
874
874
|
end: i,
|
|
875
875
|
target: E.current
|
|
876
|
-
}), i &&
|
|
877
|
-
},
|
|
876
|
+
}), i && Me(a);
|
|
877
|
+
}, rn = () => {
|
|
878
878
|
var e;
|
|
879
879
|
return {
|
|
880
880
|
filter: t.gridProps.filter,
|
|
@@ -887,7 +887,7 @@ const sr = (t, S, b, z) => {
|
|
|
887
887
|
nativeEvent: e && e.nativeEvent,
|
|
888
888
|
syntheticEvent: e,
|
|
889
889
|
target: E.current
|
|
890
|
-
}),
|
|
890
|
+
}), on = (e) => ({
|
|
891
891
|
...e,
|
|
892
892
|
nativeEvent: void 0,
|
|
893
893
|
syntheticEvent: void 0,
|
|
@@ -899,69 +899,69 @@ const sr = (t, S, b, z) => {
|
|
|
899
899
|
e(n);
|
|
900
900
|
return;
|
|
901
901
|
}
|
|
902
|
-
e(
|
|
903
|
-
},
|
|
902
|
+
e(on(n));
|
|
903
|
+
}, an = () => {
|
|
904
904
|
var e, n, o;
|
|
905
|
-
if (
|
|
906
|
-
|
|
907
|
-
const r = Array.from((o =
|
|
908
|
-
r.length >
|
|
909
|
-
(i) => !
|
|
910
|
-
)[0] : r.length === 1 && (
|
|
905
|
+
if (M.current && ((e = M.current) == null ? void 0 : e.getElementsByClassName("k-grid-edit-row").length) > 0) {
|
|
906
|
+
Le.current = !1, (n = document.activeElement) != null && n.closest(".k-grid-edit-row") ? Fe.current = document.activeElement : Fe.current = void 0;
|
|
907
|
+
const r = Array.from((o = M.current) == null ? void 0 : o.getElementsByClassName("k-grid-edit-row"));
|
|
908
|
+
r.length > Oe.current.length ? Ce.current = r.filter(
|
|
909
|
+
(i) => !Oe.current.includes(i)
|
|
910
|
+
)[0] : r.length === 1 && (Ce.current = r[0], Le.current = !0), Oe.current = r;
|
|
911
911
|
}
|
|
912
|
-
},
|
|
912
|
+
}, k = () => t.dataRef.filter((e) => e.rowType === "data").map((e) => e.dataItem), O = () => {
|
|
913
913
|
var e;
|
|
914
914
|
if (ae)
|
|
915
|
-
return ((e =
|
|
916
|
-
},
|
|
915
|
+
return ((e = Pe()) == null ? void 0 : e.ownerDocument) || document;
|
|
916
|
+
}, Pe = () => H.current, he = c.useCallback(
|
|
917
917
|
(e) => {
|
|
918
918
|
var r, i;
|
|
919
|
-
if (!C.current || !((r = C.current) != null && r.container) ||
|
|
919
|
+
if (!C.current || !((r = C.current) != null && r.container) || z === "none")
|
|
920
920
|
return;
|
|
921
|
-
|
|
922
|
-
const { rowIndex: n } = e, o =
|
|
923
|
-
if (
|
|
921
|
+
T.current && T.current.disconnect();
|
|
922
|
+
const { rowIndex: n } = e, o = Pe();
|
|
923
|
+
if (D) {
|
|
924
924
|
const a = ((i = C.current.rowHeightService) == null ? void 0 : i.offset(n)) || 0;
|
|
925
925
|
C.current.container.scroll(0, a);
|
|
926
926
|
} else if (o) {
|
|
927
927
|
const a = n < 1 ? o.querySelector("tbody > tr:nth-child(1)") : o.querySelector(`tbody > tr:nth-child(${n + 1})`);
|
|
928
|
-
a &&
|
|
928
|
+
a && G.current && (G.current.scrollTop = a.offsetTop);
|
|
929
929
|
}
|
|
930
930
|
},
|
|
931
|
-
[
|
|
932
|
-
),
|
|
933
|
-
|
|
934
|
-
},
|
|
931
|
+
[z]
|
|
932
|
+
), tt = (e) => JSON.stringify(e.map((n) => ({ id: n.id, field: n.field, title: n.title, children: n.children }))), cn = () => tt(En) === tt(t.columnsRef), dn = () => {
|
|
933
|
+
we.current = window.innerWidth, cn() || Y();
|
|
934
|
+
}, sn = () => {
|
|
935
935
|
var a;
|
|
936
936
|
const { virtualTotal: e, virtualPageSize: n, gridProps: o } = t, r = C.current, i = t.gridProps.rowHeight || ((a = o.minRowHeightRef) == null ? void 0 : a.current) || 0;
|
|
937
|
-
r && (r.fixedScroll = o.fixedScroll || !1, r.PageChange =
|
|
938
|
-
},
|
|
937
|
+
r && (r.fixedScroll = o.fixedScroll || !1, r.PageChange = Nt, r.pageSize = n, r.scrollableVirtual = D, r.container = G.current, r.tableBody = M.current, r.scrollHeightContainer = rt.current, r.scrollbarOverlaySpacerElement = ot.current, r.table = V.current, (!r.rowHeightService || r.total !== e) && i && (r.total = e, r.rowHeightService = new Gn(e, i)));
|
|
938
|
+
}, nt = c.useCallback(
|
|
939
939
|
(e) => {
|
|
940
|
-
const n = { rowIndex:
|
|
940
|
+
const n = { rowIndex: ze.current };
|
|
941
941
|
e.forEach((o) => {
|
|
942
|
-
o.boundingClientRect.height !== o.intersectionRect.height &&
|
|
942
|
+
o.boundingClientRect.height !== o.intersectionRect.height && he(n);
|
|
943
943
|
});
|
|
944
944
|
},
|
|
945
|
-
[
|
|
945
|
+
[he]
|
|
946
946
|
), Y = () => {
|
|
947
947
|
t.gridProps.forceUpdate && t.gridProps.forceUpdate();
|
|
948
|
-
},
|
|
948
|
+
}, ln = (e) => e.left !== void 0 ? pe !== "rtl" ? { left: e.left, right: e.right } : { left: e.right, right: e.left } : {}, E = c.useRef(null), C = c.useRef(void 0), P = c.useRef(void 0), j = c.useRef(void 0), U = c.useRef(void 0), Q = c.useRef(void 0), Re = c.useRef(void 0), T = c.useRef(null), M = c.useRef(null), un = c.useRef(null), G = c.useRef(null), V = c.useRef(null), gn = c.useRef(null), H = c.useRef(null), rt = c.useRef(null), be = c.useRef(null), ot = c.useRef(null), it = c.useRef(!1), ve = c.useRef(null), q = c.useRef(null), $ = c.useRef(null), A = c.useRef(null), F = c.useRef(null), L = c.useRef(null), B = c.useRef(null), fn = c.useRef(null), mn = c.useRef(null), He = c.useRef(!1), Ae = c.useRef(!1), Ce = c.useRef(void 0), Fe = c.useRef(void 0), Le = c.useRef(!1), Ie = c.useRef(!0), Be = c.useRef(0), We = c.useRef(void 0), ze = c.useRef(void 0), Oe = c.useRef([]), at = c.useRef([]), we = c.useRef(0), ye = c.useRef(
|
|
949
949
|
null
|
|
950
|
-
),
|
|
951
|
-
stickyHeaderItems:
|
|
952
|
-
stickyHeaderRef:
|
|
953
|
-
stickyFooterItems:
|
|
954
|
-
stickyFooterRef:
|
|
955
|
-
scrollToStickyGroup:
|
|
956
|
-
update:
|
|
957
|
-
} =
|
|
958
|
-
enabled:
|
|
959
|
-
enabledFooters:
|
|
950
|
+
), Pn = typeof t.gridProps.groupable == "object" && !!t.gridProps.groupable.stickyHeaders, hn = typeof t.gridProps.groupable == "object" && !!t.gridProps.groupable.stickyFooters, Rn = !!((lt = t.gridProps.group) != null && lt.length), {
|
|
951
|
+
stickyHeaderItems: bn,
|
|
952
|
+
stickyHeaderRef: vn,
|
|
953
|
+
stickyFooterItems: Cn,
|
|
954
|
+
stickyFooterRef: Ee,
|
|
955
|
+
scrollToStickyGroup: In,
|
|
956
|
+
update: ct
|
|
957
|
+
} = Xn({
|
|
958
|
+
enabled: Pn,
|
|
959
|
+
enabledFooters: hn,
|
|
960
960
|
flatData: t.dataRef,
|
|
961
|
-
containerRef:
|
|
962
|
-
tableBodyRef:
|
|
961
|
+
containerRef: G,
|
|
962
|
+
tableBodyRef: M,
|
|
963
963
|
rowHeight: t.gridProps.rowHeight,
|
|
964
|
-
isGrouped:
|
|
964
|
+
isGrouped: Rn,
|
|
965
965
|
virtualSkipRef: t.gridProps.virtualSkipRef,
|
|
966
966
|
rowHeightServiceRef: {
|
|
967
967
|
get current() {
|
|
@@ -969,156 +969,156 @@ const sr = (t, S, b, z) => {
|
|
|
969
969
|
return (e = C.current) == null ? void 0 : e.rowHeightService;
|
|
970
970
|
}
|
|
971
971
|
}
|
|
972
|
-
}), ie = c.useRef(null),
|
|
972
|
+
}), ie = c.useRef(null), wn = c.useRef(null), yn = c.useRef(null), pe = Kn(H), D = t.isVirtualScroll, En = c.useMemo(() => c.Children.toArray(t.gridProps.children), [t.gridProps.children]), dt = t.gridProps.groupable === !0 || typeof t.gridProps.groupable == "object" && t.gridProps.groupable.enabled !== !1, v = Se(t.gridProps.selectable), st = Fn(t.gridProps.editable), Sn = we.current && Z && we.current <= Z.medium && t.gridProps.adaptive;
|
|
973
973
|
return c.useMemo(() => {
|
|
974
974
|
ne.onConstructor({
|
|
975
975
|
navigatable: !!t.gridProps.navigatable,
|
|
976
|
-
contextStateRef:
|
|
976
|
+
contextStateRef: U,
|
|
977
977
|
navigationStateRef: Q,
|
|
978
978
|
idPrefix: t.id
|
|
979
|
-
}), C.current = new
|
|
979
|
+
}), C.current = new ir();
|
|
980
980
|
}, []), c.useMemo(() => {
|
|
981
981
|
var e;
|
|
982
982
|
(e = C.current) == null || e.reset();
|
|
983
983
|
}, [
|
|
984
|
-
|
|
984
|
+
z,
|
|
985
985
|
t.gridProps.total,
|
|
986
986
|
t.gridProps.filter,
|
|
987
987
|
t.gridProps.group,
|
|
988
|
-
|
|
988
|
+
dt,
|
|
989
989
|
t.gridProps.sort,
|
|
990
990
|
t.gridProps.rowHeight
|
|
991
991
|
]), c.useEffect(() => {
|
|
992
|
-
|
|
993
|
-
}), c.useEffect(() => (t.gridProps.clipboard && (
|
|
994
|
-
|
|
995
|
-
}), [t.gridProps.onClipboard, t.gridProps.clipboard,
|
|
996
|
-
scope:
|
|
997
|
-
contextStateRef:
|
|
992
|
+
ce.current = {};
|
|
993
|
+
}), c.useEffect(() => (t.gridProps.clipboard && (Re.current = new Ln(me), Re.current.addEventListeners(O())), () => {
|
|
994
|
+
Re.current && Re.current.removeEventListeners(O());
|
|
995
|
+
}), [t.gridProps.onClipboard, t.gridProps.clipboard, me, O]), c.useEffect(() => (Qe(), Ge(), ut(), ne.onComponentDidMount({
|
|
996
|
+
scope: H.current || void 0,
|
|
997
|
+
contextStateRef: U,
|
|
998
998
|
navigationStateRef: Q
|
|
999
999
|
}), () => {
|
|
1000
|
-
clearTimeout(
|
|
1000
|
+
clearTimeout(We.current);
|
|
1001
1001
|
}), []), c.useEffect(() => {
|
|
1002
1002
|
var e;
|
|
1003
|
-
|
|
1004
|
-
scope:
|
|
1005
|
-
contextStateRef:
|
|
1003
|
+
Qe(), Ge(), ut(), D && (fe(), tn(), (e = C.current) == null || e.update()), ct(), an(), ne.onComponentDidUpdate({
|
|
1004
|
+
scope: H.current || void 0,
|
|
1005
|
+
contextStateRef: U,
|
|
1006
1006
|
navigationStateRef: Q,
|
|
1007
|
-
focusFirst:
|
|
1008
|
-
newEditableRow:
|
|
1009
|
-
singleEditRow:
|
|
1010
|
-
lastActiveElement:
|
|
1007
|
+
focusFirst: Ae.current,
|
|
1008
|
+
newEditableRow: Ce.current,
|
|
1009
|
+
singleEditRow: Le.current,
|
|
1010
|
+
lastActiveElement: Fe.current,
|
|
1011
1011
|
navigatable: t.gridProps.navigatable
|
|
1012
|
-
}),
|
|
1012
|
+
}), It(), Ae.current = !1, Ce.current = void 0, ye.current = void 0;
|
|
1013
1013
|
}), c.useEffect(() => {
|
|
1014
1014
|
if (ae) {
|
|
1015
1015
|
const e = {
|
|
1016
1016
|
rootMargin: "0px",
|
|
1017
1017
|
threshold: 0.9
|
|
1018
1018
|
};
|
|
1019
|
-
|
|
1019
|
+
T.current = window.IntersectionObserver && new window.IntersectionObserver(nt, e) || null;
|
|
1020
1020
|
}
|
|
1021
1021
|
return () => {
|
|
1022
|
-
|
|
1022
|
+
T.current && (T.current.disconnect(), T.current = null);
|
|
1023
1023
|
};
|
|
1024
|
-
}, [
|
|
1024
|
+
}, [nt]), c.useEffect(() => {
|
|
1025
1025
|
var n;
|
|
1026
1026
|
let e;
|
|
1027
1027
|
return ae && window.ResizeObserver && (e = new window.ResizeObserver(() => {
|
|
1028
|
-
|
|
1029
|
-
}), e.observe((n =
|
|
1028
|
+
dn(), D && fe();
|
|
1029
|
+
}), e.observe((n = O()) == null ? void 0 : n.body)), () => {
|
|
1030
1030
|
e == null || e.disconnect();
|
|
1031
1031
|
};
|
|
1032
1032
|
}, []), c.useEffect(() => {
|
|
1033
|
-
if (!ae || !window.ResizeObserver || !
|
|
1033
|
+
if (!ae || !window.ResizeObserver || !D || !G.current)
|
|
1034
1034
|
return;
|
|
1035
1035
|
const e = () => {
|
|
1036
1036
|
var i, a;
|
|
1037
1037
|
const o = ((i = t.gridProps.containerHeightRef) == null ? void 0 : i.current) || 0;
|
|
1038
|
-
|
|
1038
|
+
fe();
|
|
1039
1039
|
const r = ((a = t.gridProps.containerHeightRef) == null ? void 0 : a.current) || 0;
|
|
1040
1040
|
(o === 0 && r > 0 || Math.abs(r - o) > 10) && Y();
|
|
1041
1041
|
}, n = new window.ResizeObserver(e);
|
|
1042
|
-
return n.observe(
|
|
1042
|
+
return n.observe(G.current), () => {
|
|
1043
1043
|
n.disconnect();
|
|
1044
1044
|
};
|
|
1045
|
-
}, [
|
|
1045
|
+
}, [D, fe]), c.useImperativeHandle(
|
|
1046
1046
|
E,
|
|
1047
1047
|
() => ({
|
|
1048
1048
|
get element() {
|
|
1049
|
-
return
|
|
1049
|
+
return Pe();
|
|
1050
1050
|
},
|
|
1051
1051
|
props: t.gridProps,
|
|
1052
1052
|
get columns() {
|
|
1053
|
-
return
|
|
1053
|
+
return se();
|
|
1054
1054
|
},
|
|
1055
1055
|
scrollIntoView: (e) => {
|
|
1056
1056
|
var r;
|
|
1057
|
-
if (!((r = C.current) != null && r.container) ||
|
|
1057
|
+
if (!((r = C.current) != null && r.container) || z === "none")
|
|
1058
1058
|
return;
|
|
1059
1059
|
const { rowIndex: n } = e;
|
|
1060
|
-
|
|
1061
|
-
const o =
|
|
1062
|
-
if (
|
|
1063
|
-
|
|
1064
|
-
const i = o.querySelector(`[absolute-row-index="${
|
|
1065
|
-
i ?
|
|
1060
|
+
ze.current = n;
|
|
1061
|
+
const o = Pe();
|
|
1062
|
+
if (T.current && o) {
|
|
1063
|
+
T.current.disconnect();
|
|
1064
|
+
const i = o.querySelector(`[absolute-row-index="${ze.current}"]`);
|
|
1065
|
+
i ? T.current.observe(i) : he(e);
|
|
1066
1066
|
}
|
|
1067
1067
|
},
|
|
1068
1068
|
fitColumns: (e) => {
|
|
1069
1069
|
P.current.dblClickHandler(null, e);
|
|
1070
1070
|
},
|
|
1071
|
-
exportAsPdf:
|
|
1072
|
-
saveAsCsv:
|
|
1073
|
-
getCsvBlob:
|
|
1074
|
-
getTotal:
|
|
1075
|
-
getLeafDataItems:
|
|
1071
|
+
exportAsPdf: Ke,
|
|
1072
|
+
saveAsCsv: Je,
|
|
1073
|
+
getCsvBlob: Xe,
|
|
1074
|
+
getTotal: De,
|
|
1075
|
+
getLeafDataItems: k
|
|
1076
1076
|
})
|
|
1077
1077
|
), c.useImperativeHandle(t.gridRef, () => E.current), c.useMemo(() => {
|
|
1078
|
-
P.current = new
|
|
1078
|
+
P.current = new Zn(et);
|
|
1079
1079
|
}, [t.gridProps.onColumnResize, t.columnsRef]), c.useMemo(() => {
|
|
1080
|
-
|
|
1080
|
+
j.current = new Jn(ge, Yt, Ye);
|
|
1081
1081
|
}, [
|
|
1082
1082
|
t.gridProps.onColumnReorder,
|
|
1083
1083
|
t.gridProps.onGroupChange,
|
|
1084
1084
|
t.gridProps.group,
|
|
1085
1085
|
t.columnsRef,
|
|
1086
1086
|
t.gridProps.groupable
|
|
1087
|
-
]), P.current.resizable = t.gridProps.resizable || !1, P.current.columns = t.columnsRef, P.current.columnsState =
|
|
1088
|
-
|
|
1087
|
+
]), P.current.resizable = t.gridProps.resizable || !1, P.current.columns = t.columnsRef, P.current.columnsState = Tn(t.columnsState), j.current.reorderable = t.gridProps.reorderable || !1, j.current.groupable = dt, j.current.columns = t.columnsRef, j.current.dir = pe, sn(), Mn("grid", E, t.gridProps, t.gridProps.webMcp), /* @__PURE__ */ c.createElement(
|
|
1088
|
+
gr.Provider,
|
|
1089
1089
|
{
|
|
1090
1090
|
value: {
|
|
1091
|
-
isClient:
|
|
1091
|
+
isClient: x,
|
|
1092
1092
|
rowReorder: oe,
|
|
1093
1093
|
activeDragRowDataItemRef: ie,
|
|
1094
|
-
reorderRowDragTargetRef:
|
|
1095
|
-
reorderRowDropTargetRef:
|
|
1096
|
-
dir:
|
|
1097
|
-
getCellPositionStyle:
|
|
1094
|
+
reorderRowDragTargetRef: wn,
|
|
1095
|
+
reorderRowDropTargetRef: yn,
|
|
1096
|
+
dir: pe,
|
|
1097
|
+
getCellPositionStyle: ln,
|
|
1098
1098
|
dataItemKey: t.gridProps.dataItemKey,
|
|
1099
1099
|
columnsState: t.columnsState,
|
|
1100
1100
|
columnsRef: t.columnsRef,
|
|
1101
1101
|
hiddenColumnsRef: t.hiddenColumnsRef,
|
|
1102
|
-
onColumnsStateChange:
|
|
1102
|
+
onColumnsStateChange: Me,
|
|
1103
1103
|
groupable: t.gridProps.groupable,
|
|
1104
1104
|
group: t.gridProps.group,
|
|
1105
1105
|
reorderable: t.gridProps.reorderable,
|
|
1106
1106
|
defaultGroup: t.gridProps.defaultGroup,
|
|
1107
|
-
groupChange:
|
|
1108
|
-
selectionRelease:
|
|
1109
|
-
pinnedSelectionRelease:
|
|
1110
|
-
pagerPageChange:
|
|
1111
|
-
onContextMenu:
|
|
1112
|
-
rowClick:
|
|
1113
|
-
rowDblClick:
|
|
1114
|
-
cellClick:
|
|
1115
|
-
headerCellClick:
|
|
1116
|
-
itemChange:
|
|
1117
|
-
onDialogEditCancel:
|
|
1118
|
-
onDialogEditSubmit:
|
|
1119
|
-
columnReorder:
|
|
1120
|
-
onResize:
|
|
1121
|
-
getTotal:
|
|
1107
|
+
groupChange: Te,
|
|
1108
|
+
selectionRelease: $e,
|
|
1109
|
+
pinnedSelectionRelease: Bt,
|
|
1110
|
+
pagerPageChange: qt,
|
|
1111
|
+
onContextMenu: bt,
|
|
1112
|
+
rowClick: St,
|
|
1113
|
+
rowDblClick: xt,
|
|
1114
|
+
cellClick: Kt,
|
|
1115
|
+
headerCellClick: qe,
|
|
1116
|
+
itemChange: Ht,
|
|
1117
|
+
onDialogEditCancel: Dt,
|
|
1118
|
+
onDialogEditSubmit: kt,
|
|
1119
|
+
columnReorder: ge,
|
|
1120
|
+
onResize: et,
|
|
1121
|
+
getTotal: De,
|
|
1122
1122
|
sortable: t.gridProps.sortable,
|
|
1123
1123
|
pageable: t.gridProps.pageable,
|
|
1124
1124
|
pageSize: t.gridProps.pageSize,
|
|
@@ -1126,95 +1126,99 @@ const sr = (t, S, b, z) => {
|
|
|
1126
1126
|
skip: t.gridProps.skip,
|
|
1127
1127
|
take: t.gridProps.take,
|
|
1128
1128
|
defaultSort: t.gridProps.defaultSort,
|
|
1129
|
-
sortChange:
|
|
1129
|
+
sortChange: _e,
|
|
1130
1130
|
filterable: t.gridProps.filterable,
|
|
1131
1131
|
filter: t.gridProps.filter,
|
|
1132
1132
|
defaultFilter: t.gridProps.defaultFilter,
|
|
1133
|
-
filterOperators: t.gridProps.filterOperators ||
|
|
1134
|
-
getLeafDataItems:
|
|
1135
|
-
filterChange:
|
|
1136
|
-
applyHighlightDescriptor:
|
|
1137
|
-
applySelectionDescriptor:
|
|
1133
|
+
filterOperators: t.gridProps.filterOperators || fr,
|
|
1134
|
+
getLeafDataItems: k,
|
|
1135
|
+
filterChange: $t,
|
|
1136
|
+
applyHighlightDescriptor: _t,
|
|
1137
|
+
applySelectionDescriptor: Ot,
|
|
1138
1138
|
highlight: t.gridProps.highlight,
|
|
1139
1139
|
select: t.gridProps.select,
|
|
1140
|
-
searchChange:
|
|
1141
|
-
exportAsPdf:
|
|
1142
|
-
exportAsCsv:
|
|
1143
|
-
getCsvBlob:
|
|
1144
|
-
onHeaderSelectionChange:
|
|
1145
|
-
columnGroupChange:
|
|
1146
|
-
onKeyDown:
|
|
1147
|
-
onFocus:
|
|
1148
|
-
scrollHandler:
|
|
1149
|
-
selectionChange:
|
|
1150
|
-
mobileMode:
|
|
1151
|
-
adaptiveColumnMenuRef:
|
|
1140
|
+
searchChange: Zt,
|
|
1141
|
+
exportAsPdf: Ke,
|
|
1142
|
+
exportAsCsv: Je,
|
|
1143
|
+
getCsvBlob: Xe,
|
|
1144
|
+
onHeaderSelectionChange: Lt,
|
|
1145
|
+
columnGroupChange: Qt,
|
|
1146
|
+
onKeyDown: wt,
|
|
1147
|
+
onFocus: yt,
|
|
1148
|
+
scrollHandler: vt,
|
|
1149
|
+
selectionChange: At,
|
|
1150
|
+
mobileMode: Sn,
|
|
1151
|
+
adaptiveColumnMenuRef: we.current,
|
|
1152
1152
|
adpativeTitle: t.gridProps.adaptiveTitle,
|
|
1153
1153
|
adaptive: t.gridProps.adaptive,
|
|
1154
|
-
dispatchDetailExpand:
|
|
1155
|
-
dispatchGroupExpand:
|
|
1154
|
+
dispatchDetailExpand: Tt,
|
|
1155
|
+
dispatchGroupExpand: Mt,
|
|
1156
1156
|
columnResizeRef: P,
|
|
1157
|
-
dragLogicRef:
|
|
1157
|
+
dragLogicRef: j,
|
|
1158
1158
|
navigationStateRef: Q,
|
|
1159
|
-
tableElementRef:
|
|
1160
|
-
tableBodyElementRef:
|
|
1161
|
-
headerElementRef:
|
|
1162
|
-
containerElementRef:
|
|
1163
|
-
headTableElementRef:
|
|
1164
|
-
elementRef:
|
|
1165
|
-
virtualScrollHeightContainerRef:
|
|
1159
|
+
tableElementRef: V,
|
|
1160
|
+
tableBodyElementRef: M,
|
|
1161
|
+
headerElementRef: un,
|
|
1162
|
+
containerElementRef: G,
|
|
1163
|
+
headTableElementRef: gn,
|
|
1164
|
+
elementRef: H,
|
|
1165
|
+
virtualScrollHeightContainerRef: rt,
|
|
1166
|
+
scrollbarContainerRef: be,
|
|
1167
|
+
scrollbarSpacerRef: ot,
|
|
1168
|
+
vScrollDraggingRef: it,
|
|
1169
|
+
scrollbarShowCallbackRef: ve,
|
|
1166
1170
|
footerRef: q,
|
|
1167
1171
|
headerRef: $,
|
|
1168
1172
|
vsRef: C,
|
|
1169
|
-
stickyHeaderItems:
|
|
1170
|
-
stickyHeaderRef:
|
|
1171
|
-
stickyFooterItems:
|
|
1172
|
-
stickyFooterRef:
|
|
1173
|
+
stickyHeaderItems: bn,
|
|
1174
|
+
stickyHeaderRef: vn,
|
|
1175
|
+
stickyFooterItems: Cn,
|
|
1176
|
+
stickyFooterRef: Ee,
|
|
1173
1177
|
stickyHeaderTableRef: A,
|
|
1174
1178
|
stickyFooterTableRef: F,
|
|
1175
1179
|
pinnedTopTableRef: L,
|
|
1176
1180
|
pinnedBottomTableRef: B,
|
|
1177
|
-
pinnedTopRef:
|
|
1178
|
-
pinnedBottomRef:
|
|
1179
|
-
onRowPin:
|
|
1180
|
-
getRowPinPosition:
|
|
1181
|
+
pinnedTopRef: fn,
|
|
1182
|
+
pinnedBottomRef: mn,
|
|
1183
|
+
onRowPin: le,
|
|
1184
|
+
getRowPinPosition: Gt
|
|
1181
1185
|
}
|
|
1182
1186
|
},
|
|
1183
|
-
/* @__PURE__ */ c.createElement(
|
|
1187
|
+
/* @__PURE__ */ c.createElement(Bn.Provider, { value: U.current }, t.children),
|
|
1184
1188
|
/* @__PURE__ */ c.createElement(
|
|
1185
|
-
|
|
1189
|
+
ar,
|
|
1186
1190
|
{
|
|
1187
|
-
show:
|
|
1188
|
-
dataItem:
|
|
1189
|
-
field:
|
|
1190
|
-
items:
|
|
1191
|
-
offset:
|
|
1192
|
-
onClose:
|
|
1193
|
-
onSelect:
|
|
1191
|
+
show: h.show && (de == null ? void 0 : de.length),
|
|
1192
|
+
dataItem: h.dataItem,
|
|
1193
|
+
field: h.field,
|
|
1194
|
+
items: de,
|
|
1195
|
+
offset: h.offset,
|
|
1196
|
+
onClose: je,
|
|
1197
|
+
onSelect: Rt
|
|
1194
1198
|
}
|
|
1195
1199
|
),
|
|
1196
1200
|
t.gridProps.pdf && /* @__PURE__ */ c.createElement(
|
|
1197
|
-
|
|
1201
|
+
lr,
|
|
1198
1202
|
{
|
|
1199
1203
|
gridProps: t.gridProps,
|
|
1200
1204
|
innerGrid: t.innerGrid,
|
|
1201
1205
|
pdf: typeof t.gridProps.pdf == "object" ? t.gridProps.pdf : {},
|
|
1202
|
-
onPdfExport:
|
|
1203
|
-
ref: (e) =>
|
|
1206
|
+
onPdfExport: Jt,
|
|
1207
|
+
ref: (e) => K.current = e
|
|
1204
1208
|
}
|
|
1205
1209
|
),
|
|
1206
1210
|
t.gridProps.csv && /* @__PURE__ */ c.createElement(
|
|
1207
|
-
|
|
1211
|
+
ur,
|
|
1208
1212
|
{
|
|
1209
1213
|
gridProps: t.gridProps,
|
|
1210
1214
|
csv: typeof t.gridProps.csv == "object" ? t.gridProps.csv : {},
|
|
1211
|
-
onCsvExport:
|
|
1215
|
+
onCsvExport: Xt,
|
|
1212
1216
|
columnsState: t.columnsState,
|
|
1213
|
-
ref: (e) =>
|
|
1217
|
+
ref: (e) => N.current = e
|
|
1214
1218
|
}
|
|
1215
1219
|
)
|
|
1216
1220
|
);
|
|
1217
1221
|
};
|
|
1218
1222
|
export {
|
|
1219
|
-
|
|
1223
|
+
Tr as GridClientWrapper
|
|
1220
1224
|
};
|