@progress/kendo-react-grid 9.5.0-develop.4 → 9.5.0-develop.5
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 +204 -195
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -13
package/GridClientWrapper.mjs
CHANGED
|
@@ -7,22 +7,22 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as i from "react";
|
|
10
|
-
import { canUseDOM as $, getActiveElement as
|
|
11
|
-
import { getSelectionOptions as Y, populateClipboardData as
|
|
12
|
-
import { ColumnResize as
|
|
13
|
-
import { CommonDragLogic as
|
|
14
|
-
import { SAFARI_REGEX as
|
|
15
|
-
import { getDefaultHeadContextMenuItems as
|
|
10
|
+
import { canUseDOM as $, getActiveElement as Gt, useDir as zt, setScrollbarWidth as Ae, getter as J, RowHeightService as He } from "@progress/kendo-react-common";
|
|
11
|
+
import { getSelectionOptions as Y, populateClipboardData as Nt, ClipboardActionType as ge, getEditableOptions as Ot, tableKeyboardNavigation as T, ClipboardService as Bt, TableKeyboardNavigationContext as Ut, editReducer as Vt, EDIT_ACTION as _t, getDetailExpandableOptions as Wt, detailExpandReducer as Fe, getGroupExpandableOptions as jt, groupExpandReducer as qt, DETAIL_EXPAND_ACTION as Xt, getSelectedState as Le, getSelectedStateFromKeyDown as $t, closestTagName as Ge, getColumnIndex as Jt, getRowIndex as Yt, updateLeft as Qt, updateRight as Zt } from "@progress/kendo-react-data-tools";
|
|
12
|
+
import { ColumnResize as pt } from "./drag/ColumnResize.mjs";
|
|
13
|
+
import { CommonDragLogic as er } from "./drag/CommonDragLogic.mjs";
|
|
14
|
+
import { SAFARI_REGEX as tr } from "./constants/index.mjs";
|
|
15
|
+
import { getDefaultHeadContextMenuItems as rr, getDefaultBodyContextMenuItems as nr, isRowReorderEnabled as or, sanitizeColumns as ar, getDataAsArray as ir, firefox as ze, firefoxMaxHeight as Ne } from "./utils/index.mjs";
|
|
16
16
|
import { VirtualScrollFixed as Oe } from "./VirtualScrollFixed.mjs";
|
|
17
|
-
import { VirtualScroll as
|
|
18
|
-
import { GridContextMenu as
|
|
17
|
+
import { VirtualScroll as dr } from "./VirtualScroll.mjs";
|
|
18
|
+
import { GridContextMenu as cr } from "./contextMenu/GridContextMenu.mjs";
|
|
19
19
|
import { GridContextMenuAnchorPart as Be } from "./contextMenu/enums.mjs";
|
|
20
|
-
import { normalize as
|
|
21
|
-
const
|
|
20
|
+
import { normalize as lr, firstLevelSortSeqMap as sr } from "./sortCommon.mjs";
|
|
21
|
+
const ur = i.createContext(void 0), yr = (t) => {
|
|
22
22
|
var Se, De;
|
|
23
|
-
const E = t.gridProps.isClient, [
|
|
23
|
+
const E = t.gridProps.isClient, [I, fe] = i.useState({}), Ue = (e) => {
|
|
24
24
|
e.event.preventDefault(), fe({
|
|
25
|
-
...
|
|
25
|
+
...I,
|
|
26
26
|
show: !0,
|
|
27
27
|
offset: {
|
|
28
28
|
left: e.event.pageX,
|
|
@@ -33,29 +33,29 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
33
33
|
});
|
|
34
34
|
}, me = () => {
|
|
35
35
|
fe({});
|
|
36
|
-
}, P = i.useMemo(() => t.columnsRef.current.find((e) => e.field ===
|
|
36
|
+
}, P = i.useMemo(() => t.columnsRef.current.find((e) => e.field === I.field), [t.columnsRef, I]), Pe = i.useMemo(() => {
|
|
37
37
|
const e = t.gridProps.sortable && (P == null ? void 0 : P.sortable);
|
|
38
|
-
return
|
|
38
|
+
return rr({
|
|
39
39
|
sortable: !!e,
|
|
40
40
|
selectable: Y(t.gridProps.selectable).enabled,
|
|
41
41
|
clipboard: !!t.gridProps.clipboard
|
|
42
42
|
});
|
|
43
43
|
}, [P, t.gridProps.sortable, t.gridProps.selectable, t.gridProps.clipboard]), he = i.useMemo(() => {
|
|
44
44
|
const e = t.gridProps.sortable && (P == null ? void 0 : P.sortable);
|
|
45
|
-
return
|
|
45
|
+
return nr({
|
|
46
46
|
sortable: !!e,
|
|
47
47
|
selectable: Y(t.gridProps.selectable).enabled,
|
|
48
48
|
clipboard: !!t.gridProps.clipboard,
|
|
49
|
-
rowReorderable:
|
|
49
|
+
rowReorderable: or(t.gridProps.rowReorderable)
|
|
50
50
|
});
|
|
51
51
|
}, [P, t.gridProps.sortable, t.gridProps.selectable, t.gridProps.clipboard]), Ve = i.useMemo(() => {
|
|
52
|
-
const e = (P == null ? void 0 : P.contextMenu) || t.gridProps.contextMenu, r = typeof e == "function" ? e(
|
|
53
|
-
if (r &&
|
|
54
|
-
const n =
|
|
52
|
+
const e = (P == null ? void 0 : P.contextMenu) || t.gridProps.contextMenu, r = typeof e == "function" ? e(I) : e;
|
|
53
|
+
if (r && I.offset) {
|
|
54
|
+
const n = I.dataItem ? Be.body : Be.head, o = r[n], a = I.dataItem ? he : Pe;
|
|
55
55
|
return o === !1 ? void 0 : o === !0 || o === void 0 ? a : o;
|
|
56
56
|
}
|
|
57
|
-
}, [t.gridProps.contextMenu,
|
|
58
|
-
var l,
|
|
57
|
+
}, [t.gridProps.contextMenu, I, he, Pe, P]), _e = (e) => {
|
|
58
|
+
var l, s, m, f, R, ke, Ke, Te, Me;
|
|
59
59
|
const r = e.event.item, n = {
|
|
60
60
|
target: C.current,
|
|
61
61
|
syntheticEvent: e.event.syntheticEvent,
|
|
@@ -84,24 +84,24 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
84
84
|
switch ((l = r.data) == null ? void 0 : l.action) {
|
|
85
85
|
case "SortCommand":
|
|
86
86
|
if (P) {
|
|
87
|
-
const ue = (
|
|
88
|
-
be(e.event.syntheticEvent, P,
|
|
87
|
+
const ue = (s = r.name) == null ? void 0 : s.toLowerCase().includes("asc"), Ht = ((m = r.name) == null ? void 0 : m.toLowerCase().includes("desc")) ? "desc" : void 0, Ft = ue ? "asc" : Ht, Lt = r.name ? Ft : void 0;
|
|
88
|
+
be(e.event.syntheticEvent, P, Lt);
|
|
89
89
|
}
|
|
90
90
|
break;
|
|
91
91
|
case "SelectRowCommand":
|
|
92
|
-
|
|
92
|
+
it(a);
|
|
93
93
|
break;
|
|
94
94
|
case "SelectAllRowsCommand":
|
|
95
|
-
|
|
95
|
+
at(a);
|
|
96
96
|
break;
|
|
97
97
|
case "ClearSelectionCommand":
|
|
98
|
-
|
|
98
|
+
dt(a);
|
|
99
99
|
break;
|
|
100
100
|
case "ReorderRowCommand":
|
|
101
|
-
|
|
101
|
+
z.current = e.dataItem, (f = r.name) != null && f.toLowerCase().includes("rowup") && d > 0 && A(e.event.syntheticEvent, d - 1, "before"), (R = r.name) != null && R.toLowerCase().includes("rowdown") && d < o.length - 1 && A(e.event.syntheticEvent, d + 1, "after"), (ke = r.name) != null && ke.toLowerCase().includes("rowtop") && A(e.event.syntheticEvent, 0, "before"), (Ke = r.name) != null && Ke.toLowerCase().includes("rowbottom") && A(e.event.syntheticEvent, o.length - 1, "after");
|
|
102
102
|
break;
|
|
103
103
|
case "CopySelectionCommand":
|
|
104
|
-
|
|
104
|
+
U(
|
|
105
105
|
ge.copy,
|
|
106
106
|
e.event.nativeEvent,
|
|
107
107
|
{
|
|
@@ -112,7 +112,7 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
112
112
|
);
|
|
113
113
|
break;
|
|
114
114
|
case "PasteCommand":
|
|
115
|
-
|
|
115
|
+
U(
|
|
116
116
|
ge.paste,
|
|
117
117
|
e.event.nativeEvent,
|
|
118
118
|
{
|
|
@@ -124,9 +124,9 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
124
124
|
break;
|
|
125
125
|
}
|
|
126
126
|
me();
|
|
127
|
-
},
|
|
127
|
+
}, N = () => {
|
|
128
128
|
const e = g.current.filter((r) => r.declarationIndex >= 0 && r.parentIndex === -1);
|
|
129
|
-
return
|
|
129
|
+
return ar(e);
|
|
130
130
|
}, We = (e, r, n) => {
|
|
131
131
|
if (t.gridProps.onContextMenu && E) {
|
|
132
132
|
const o = {
|
|
@@ -150,66 +150,37 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
150
150
|
const r = e.currentTarget.scrollLeft, n = e.currentTarget.scrollTop, o = t.gridProps.scrollable === "virtual";
|
|
151
151
|
t.gridProps.columnVirtualization && (!o || n === de.current) && (ce.current = window.setTimeout(() => {
|
|
152
152
|
te();
|
|
153
|
-
}, 0)), t.gridProps.scrollLeftRef && (t.gridProps.scrollLeftRef.current = r),
|
|
153
|
+
}, 0)), t.gridProps.scrollLeftRef && (t.gridProps.scrollLeftRef.current = r), G.current && G.current.setScrollLeft(r), L.current && L.current.setScrollLeft(r), c.current && n !== de.current && c.current.scrollHandler(e), t.gridProps.onScroll && E && u(t.gridProps.onScroll, {
|
|
154
154
|
...h(e)
|
|
155
155
|
}), de.current = n;
|
|
156
156
|
}, qe = (e) => {
|
|
157
|
-
var n, o;
|
|
158
157
|
T.onKeyDown(e, {
|
|
159
158
|
navigatable: t.gridProps.navigatable || !1,
|
|
160
159
|
contextStateRef: y,
|
|
161
160
|
navigationStateRef: D,
|
|
162
161
|
onNavigationAction: $e,
|
|
163
|
-
columns:
|
|
162
|
+
columns: N()
|
|
164
163
|
}), T.onGetSnapshotBeforeUpdate({
|
|
165
164
|
document: v(),
|
|
166
165
|
contextStateRef: y,
|
|
167
166
|
navigationStateRef: D
|
|
168
167
|
});
|
|
169
168
|
const r = {
|
|
170
|
-
dataItems:
|
|
171
|
-
mode:
|
|
172
|
-
cell:
|
|
169
|
+
dataItems: H(),
|
|
170
|
+
mode: b.mode,
|
|
171
|
+
cell: b.cell,
|
|
173
172
|
componentId: t.id,
|
|
174
173
|
selectedField: t.gridProps.selectedField,
|
|
175
174
|
...h(e)
|
|
176
175
|
};
|
|
177
|
-
|
|
178
|
-
const a = Ut({
|
|
179
|
-
event: r,
|
|
180
|
-
selectedState: (n = t.gridProps.select) != null ? n : {},
|
|
181
|
-
dataItemKey: t.gridProps.dataItemKey
|
|
182
|
-
});
|
|
183
|
-
if (a === t.gridProps.select)
|
|
184
|
-
return;
|
|
185
|
-
const d = e.target, l = Fe(d, "TD"), f = Fe(d, "TR"), m = Vt(l), s = _t(f);
|
|
186
|
-
if (m !== void 0 && s !== void 0) {
|
|
187
|
-
const R = (o = ar(t.gridProps.data)) == null ? void 0 : o[s];
|
|
188
|
-
t.gridProps.onSelectionChange && u(t.gridProps.onSelectionChange, {
|
|
189
|
-
...r,
|
|
190
|
-
select: a,
|
|
191
|
-
dataItem: R,
|
|
192
|
-
startRowIndex: s,
|
|
193
|
-
startColIndex: m,
|
|
194
|
-
startDataItem: R,
|
|
195
|
-
endDataItem: R,
|
|
196
|
-
endRowIndex: s,
|
|
197
|
-
endColIndex: m,
|
|
198
|
-
ctrlKey: e.ctrlKey,
|
|
199
|
-
altKey: e.altKey,
|
|
200
|
-
metaKey: e.metaKey,
|
|
201
|
-
shiftKey: e.shiftKey,
|
|
202
|
-
isDrag: !1
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
}
|
|
176
|
+
t.gridProps.onKeyDown && E && u(t.gridProps.onKeyDown, r);
|
|
206
177
|
}, Xe = (e) => {
|
|
207
178
|
T.onFocus(e, {
|
|
208
179
|
navigatable: !!t.gridProps.navigatable,
|
|
209
180
|
contextStateRef: y
|
|
210
181
|
});
|
|
211
182
|
}, $e = (e) => {
|
|
212
|
-
if (e.action === "moveToNextPage" &&
|
|
183
|
+
if (e.action === "moveToNextPage" && lt(e.event), e.action === "moveToPrevPage" && st(e.event), e.focusElement && e.action === "reorderToRight") {
|
|
213
184
|
const r = parseInt(e.focusElement.ariaColIndex, 10) - 1;
|
|
214
185
|
r < g.current.length - 1 && Z(r, r + 1, e.event);
|
|
215
186
|
}
|
|
@@ -217,7 +188,7 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
217
188
|
const r = parseInt(e.focusElement.ariaColIndex, 10) - 1;
|
|
218
189
|
r > 0 && Z(r, r - 1, e.event);
|
|
219
190
|
}
|
|
220
|
-
if (t.gridProps.onNavigationAction && E) {
|
|
191
|
+
if (e.action === "select" && rt(e.event), t.gridProps.onNavigationAction && E) {
|
|
221
192
|
const r = {
|
|
222
193
|
focusElement: e.focusElement,
|
|
223
194
|
...h(e.event)
|
|
@@ -236,8 +207,8 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
236
207
|
});
|
|
237
208
|
}, Qe = (e, r, n) => {
|
|
238
209
|
if (ye.enabled && ye.mode === "incell" && t.gridProps.dataItemKey) {
|
|
239
|
-
const o =
|
|
240
|
-
type:
|
|
210
|
+
const o = Vt(t.gridProps.edit, {
|
|
211
|
+
type: _t.ENTER_FIELD_EDIT,
|
|
241
212
|
payload: { id: r[t.gridProps.dataItemKey], field: n }
|
|
242
213
|
});
|
|
243
214
|
t.gridProps.onEditChange && u(t.gridProps.onEditChange, {
|
|
@@ -247,8 +218,8 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
247
218
|
}
|
|
248
219
|
}, Ze = (e, r) => {
|
|
249
220
|
var o;
|
|
250
|
-
if (
|
|
251
|
-
const a =
|
|
221
|
+
if (Wt(t.detailExpandable).enabled) {
|
|
222
|
+
const a = Fe((o = t.gridProps.detailExpand) != null ? o : {}, e);
|
|
252
223
|
t.gridProps.onDetailExpandChange && u(t.gridProps.onDetailExpandChange, {
|
|
253
224
|
...h(r),
|
|
254
225
|
detailExpand: a
|
|
@@ -256,25 +227,25 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
256
227
|
}
|
|
257
228
|
}, pe = (e, r) => {
|
|
258
229
|
var o;
|
|
259
|
-
const n =
|
|
230
|
+
const n = jt(
|
|
260
231
|
typeof t.gridProps.groupable == "object" ? t.gridProps.groupable.expandable !== !1 : t.gridProps.groupable
|
|
261
232
|
);
|
|
262
233
|
if (n.enabled) {
|
|
263
|
-
const a =
|
|
234
|
+
const a = qt((o = t.gridProps.groupExpand) != null ? o : [], e, n);
|
|
264
235
|
t.gridProps.onGroupExpandChange && u(t.gridProps.onGroupExpandChange, {
|
|
265
236
|
...h(r),
|
|
266
237
|
groupExpand: a
|
|
267
238
|
});
|
|
268
239
|
}
|
|
269
240
|
}, be = (e, r, n) => {
|
|
270
|
-
const { allowUnsort: o, mode: a } =
|
|
271
|
-
l !== "" && r.field &&
|
|
241
|
+
const { allowUnsort: o, mode: a } = lr(t.gridProps.sortable || !1, r.sortable || !1), d = (t.gridProps.sort || []).filter((m) => m.field === r.field)[0], l = n || sr[o][d && d.dir || ""], s = a === "single" ? [] : (t.gridProps.sort || []).filter((m) => m.field !== r.field);
|
|
242
|
+
l !== "" && r.field && s.push({ field: r.field, dir: l }), Ie(s, e);
|
|
272
243
|
}, et = (e) => {
|
|
273
244
|
var r;
|
|
274
245
|
if (e.field === t.gridProps.expandField || e._expand || t.gridProps.group && e.field === void 0) {
|
|
275
246
|
if (t.gridProps.onExpandChange) {
|
|
276
|
-
const n = t.gridProps.dataItemKey ?
|
|
277
|
-
type:
|
|
247
|
+
const n = t.gridProps.dataItemKey ? Fe((r = t.gridProps.detailExpand) != null ? r : {}, {
|
|
248
|
+
type: Xt.SET,
|
|
278
249
|
id: e.dataItem[t.gridProps.dataItemKey],
|
|
279
250
|
payload: e.value
|
|
280
251
|
}) : t.gridProps.detailExpand;
|
|
@@ -297,7 +268,7 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
297
268
|
});
|
|
298
269
|
}, tt = (e) => {
|
|
299
270
|
var r;
|
|
300
|
-
if (t.gridProps.onSelectionChange &&
|
|
271
|
+
if (t.gridProps.onSelectionChange && b.enabled) {
|
|
301
272
|
const { event: n, dataItem: o, dataIndex: a, columnIndex: d } = e, l = {
|
|
302
273
|
...h(n.syntheticEvent),
|
|
303
274
|
dataItem: o,
|
|
@@ -305,20 +276,20 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
305
276
|
endColIndex: d,
|
|
306
277
|
startRowIndex: a,
|
|
307
278
|
endRowIndex: a,
|
|
308
|
-
dataItems:
|
|
279
|
+
dataItems: H(),
|
|
309
280
|
altKey: !1,
|
|
310
281
|
ctrlKey: !1,
|
|
311
282
|
shiftKey: !1,
|
|
312
283
|
metaKey: !1,
|
|
313
|
-
mode:
|
|
314
|
-
cell:
|
|
284
|
+
mode: b.mode,
|
|
285
|
+
cell: b.cell,
|
|
315
286
|
isDrag: !1,
|
|
316
287
|
componentId: t.id,
|
|
317
288
|
selectedField: t.gridProps.selectedField || ""
|
|
318
289
|
};
|
|
319
290
|
u(t.gridProps.onSelectionChange, {
|
|
320
291
|
...l,
|
|
321
|
-
select: t.gridProps.dataItemKey ?
|
|
292
|
+
select: t.gridProps.dataItemKey ? Le({
|
|
322
293
|
event: l,
|
|
323
294
|
selectedState: (r = t.gridProps.select) != null ? r : {},
|
|
324
295
|
dataItemKey: t.gridProps.dataItemKey
|
|
@@ -326,9 +297,47 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
326
297
|
});
|
|
327
298
|
}
|
|
328
299
|
}, rt = (e) => {
|
|
300
|
+
var m, f;
|
|
301
|
+
if (t.gridProps.selectedField || !b.enabled || !t.gridProps.dataItemKey)
|
|
302
|
+
return;
|
|
303
|
+
const r = {
|
|
304
|
+
dataItems: H(),
|
|
305
|
+
mode: b.mode,
|
|
306
|
+
cell: b.cell,
|
|
307
|
+
componentId: t.id,
|
|
308
|
+
selectedField: t.gridProps.selectedField,
|
|
309
|
+
...h(e)
|
|
310
|
+
}, n = $t({
|
|
311
|
+
event: r,
|
|
312
|
+
selectedState: (m = t.gridProps.select) != null ? m : {},
|
|
313
|
+
dataItemKey: t.gridProps.dataItemKey
|
|
314
|
+
});
|
|
315
|
+
if (n === t.gridProps.select)
|
|
316
|
+
return;
|
|
317
|
+
const o = e.target, a = Ge(o, "TD"), d = Ge(o, "TR"), l = Jt(a), s = Yt(d);
|
|
318
|
+
if (l !== void 0 && s !== void 0) {
|
|
319
|
+
const R = (f = ir(t.gridProps.data)) == null ? void 0 : f[s];
|
|
320
|
+
t.gridProps.onSelectionChange && u(t.gridProps.onSelectionChange, {
|
|
321
|
+
...r,
|
|
322
|
+
select: n,
|
|
323
|
+
dataItem: R,
|
|
324
|
+
startRowIndex: s,
|
|
325
|
+
startColIndex: l,
|
|
326
|
+
startDataItem: R,
|
|
327
|
+
endDataItem: R,
|
|
328
|
+
endRowIndex: s,
|
|
329
|
+
endColIndex: l,
|
|
330
|
+
ctrlKey: e.ctrlKey,
|
|
331
|
+
altKey: e.altKey,
|
|
332
|
+
metaKey: e.metaKey,
|
|
333
|
+
shiftKey: e.shiftKey,
|
|
334
|
+
isDrag: !1
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
}, nt = (e) => {
|
|
329
338
|
var r;
|
|
330
|
-
if (t.gridProps.onHeaderSelectionChange &&
|
|
331
|
-
const n =
|
|
339
|
+
if (t.gridProps.onHeaderSelectionChange && b.enabled) {
|
|
340
|
+
const n = H();
|
|
332
341
|
u(t.gridProps.onHeaderSelectionChange, {
|
|
333
342
|
select: e.syntheticEvent.target.checked ? n.reduce((o, a) => (t.gridProps.dataItemKey && J(t.gridProps.dataItemKey)(a) !== void 0 && (o[J(t.gridProps.dataItemKey)(a)] = !0), o), {}) : {},
|
|
334
343
|
field: e.field,
|
|
@@ -339,35 +348,35 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
339
348
|
selectedField: (r = t.gridProps.selectedField) != null ? r : ""
|
|
340
349
|
});
|
|
341
350
|
}
|
|
342
|
-
},
|
|
343
|
-
t.gridProps.onSelectionChange &&
|
|
351
|
+
}, O = (e, r) => {
|
|
352
|
+
t.gridProps.onSelectionChange && b.enabled && u(t.gridProps.onSelectionChange, {
|
|
344
353
|
...e,
|
|
345
354
|
select: r
|
|
346
355
|
});
|
|
347
|
-
},
|
|
356
|
+
}, ot = (e) => {
|
|
348
357
|
var r;
|
|
349
|
-
if (t.gridProps.onSelectionChange &&
|
|
358
|
+
if (t.gridProps.onSelectionChange && b.enabled) {
|
|
350
359
|
const n = V()[e.startRowIndex], o = V()[e.endRowIndex], a = {
|
|
351
360
|
syntheticEvent: void 0,
|
|
352
361
|
target: C.current,
|
|
353
362
|
selectedField: t.gridProps.selectedField || "",
|
|
354
363
|
componentId: t.id,
|
|
355
|
-
dataItems:
|
|
364
|
+
dataItems: H(),
|
|
356
365
|
dataItem: null,
|
|
357
366
|
startDataItem: n,
|
|
358
367
|
endDataItem: o,
|
|
359
368
|
...e
|
|
360
|
-
}, d =
|
|
369
|
+
}, d = Le({
|
|
361
370
|
event: a,
|
|
362
371
|
selectedState: (r = t.gridProps.select) != null ? r : {},
|
|
363
372
|
// Thats kinda strange, even through the `dataItemKey` is required by the `getSelectedState`
|
|
364
373
|
// it does work correctly even without it
|
|
365
374
|
dataItemKey: t.gridProps.dataItemKey
|
|
366
375
|
});
|
|
367
|
-
|
|
376
|
+
O(a, d);
|
|
368
377
|
}
|
|
369
|
-
},
|
|
370
|
-
if (t.gridProps.onSelectionChange &&
|
|
378
|
+
}, at = (e) => {
|
|
379
|
+
if (t.gridProps.onSelectionChange && b.enabled) {
|
|
371
380
|
const r = e.dataItems[0], n = e.dataItems[e.dataItems.length - 1], o = {}, a = {
|
|
372
381
|
...e,
|
|
373
382
|
startDataItem: r,
|
|
@@ -378,12 +387,12 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
378
387
|
endColIndex: g.current.length - 1
|
|
379
388
|
};
|
|
380
389
|
e.dataItems.forEach((d) => {
|
|
381
|
-
const
|
|
382
|
-
o[
|
|
383
|
-
}),
|
|
390
|
+
const s = J(t.gridProps.dataItemKey)(d);
|
|
391
|
+
o[s] = e.cell ? [...Array(g.current.length).keys()] : !0;
|
|
392
|
+
}), O(a, o);
|
|
384
393
|
}
|
|
385
|
-
},
|
|
386
|
-
if (t.gridProps.onSelectionChange &&
|
|
394
|
+
}, it = (e) => {
|
|
395
|
+
if (t.gridProps.onSelectionChange && b.enabled) {
|
|
387
396
|
const n = J(t.gridProps.dataItemKey)(e.dataItem), o = 0, a = g.current.length - 1, d = e.dataItems.findIndex(
|
|
388
397
|
(R) => R[t.gridProps.dataItemKey] === e.dataItem[t.gridProps.dataItemKey]
|
|
389
398
|
), m = {
|
|
@@ -394,11 +403,11 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
394
403
|
endRowIndex: d,
|
|
395
404
|
startColIndex: o,
|
|
396
405
|
endColIndex: a
|
|
397
|
-
},
|
|
398
|
-
|
|
406
|
+
}, f = e.mode === "multiple" ? t.gridProps.select || {} : {};
|
|
407
|
+
f[n] === !0 || Array.isArray(f[n]) && f[n].length === g.current.length ? delete f[n] : f[n] = e.cell ? [...Array(g.current.length).keys()] : !0, O(m, f);
|
|
399
408
|
}
|
|
400
|
-
},
|
|
401
|
-
t.gridProps.onSelectionChange &&
|
|
409
|
+
}, dt = (e) => {
|
|
410
|
+
t.gridProps.onSelectionChange && b.enabled && O(e, {});
|
|
402
411
|
}, M = (e, r, n, o, a) => {
|
|
403
412
|
const d = t.gridProps.onDataStateChange;
|
|
404
413
|
if (e) {
|
|
@@ -409,11 +418,11 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
409
418
|
...h(o),
|
|
410
419
|
targetEvent: a || {},
|
|
411
420
|
dataState: {
|
|
412
|
-
...
|
|
421
|
+
...Ct(),
|
|
413
422
|
...n
|
|
414
423
|
}
|
|
415
424
|
});
|
|
416
|
-
},
|
|
425
|
+
}, B = (e, r, n) => {
|
|
417
426
|
M(
|
|
418
427
|
t.gridProps.onPageChange,
|
|
419
428
|
{ page: e },
|
|
@@ -421,19 +430,19 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
421
430
|
r,
|
|
422
431
|
n
|
|
423
432
|
);
|
|
424
|
-
},
|
|
433
|
+
}, ct = () => {
|
|
425
434
|
let e = t.gridProps.total || 0;
|
|
426
435
|
return Array.isArray(t.gridProps.data) ? e = e || t.gridProps.data.length : t.gridProps.data && (e = e || t.gridProps.data.total), e;
|
|
427
|
-
}, ct = (e) => {
|
|
428
|
-
var a, d;
|
|
429
|
-
const r = (d = (a = t.gridProps.take) != null ? a : t.gridProps.pageSize) != null ? d : 0, n = (t.gridProps.skip || 0) + r, o = dt();
|
|
430
|
-
n < o && O({ skip: n, take: r }, e);
|
|
431
436
|
}, lt = (e) => {
|
|
437
|
+
var a, d;
|
|
438
|
+
const r = (d = (a = t.gridProps.take) != null ? a : t.gridProps.pageSize) != null ? d : 0, n = (t.gridProps.skip || 0) + r, o = ct();
|
|
439
|
+
n < o && B({ skip: n, take: r }, e);
|
|
440
|
+
}, st = (e) => {
|
|
432
441
|
var o, a;
|
|
433
442
|
const r = (a = (o = t.gridProps.take) != null ? o : t.gridProps.pageSize) != null ? a : 0, n = (t.gridProps.skip || 0) - r;
|
|
434
|
-
n >= 0 &&
|
|
435
|
-
},
|
|
436
|
-
|
|
443
|
+
n >= 0 && B({ skip: n, take: r }, e);
|
|
444
|
+
}, ut = (e) => {
|
|
445
|
+
B({ skip: e.skip, take: e.take }, e.syntheticEvent, e.targetEvent);
|
|
437
446
|
}, Ie = (e, r) => {
|
|
438
447
|
M(
|
|
439
448
|
t.gridProps.onSortChange,
|
|
@@ -441,14 +450,14 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
441
450
|
{ sort: e, ...t.gridProps.scrollable === "virtual" ? { skip: 0 } : {} },
|
|
442
451
|
r
|
|
443
452
|
);
|
|
444
|
-
},
|
|
453
|
+
}, gt = (e, r) => {
|
|
445
454
|
M(
|
|
446
455
|
t.gridProps.onFilterChange,
|
|
447
456
|
{ filter: e },
|
|
448
457
|
{ filter: e || void 0, skip: 0 },
|
|
449
458
|
r
|
|
450
459
|
);
|
|
451
|
-
},
|
|
460
|
+
}, ft = (e) => {
|
|
452
461
|
const r = t.gridProps.searchFields || g.current.map((a) => a.field) || [], n = e.nativeEvent.target.value, o = {
|
|
453
462
|
logic: "or",
|
|
454
463
|
filters: r.filter((a) => a !== void 0).map((a) => {
|
|
@@ -477,7 +486,7 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
477
486
|
{ group: e, skip: 0 },
|
|
478
487
|
n
|
|
479
488
|
);
|
|
480
|
-
},
|
|
489
|
+
}, mt = (e) => {
|
|
481
490
|
if (t.gridProps.onColumnsStateChange) {
|
|
482
491
|
const r = {
|
|
483
492
|
target: C.current,
|
|
@@ -486,39 +495,39 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
486
495
|
u(t.gridProps.onColumnsStateChange, r);
|
|
487
496
|
}
|
|
488
497
|
}, Z = (e, r, n) => {
|
|
489
|
-
const o = g.current[e], a = o.depth, d = (
|
|
498
|
+
const o = g.current[e], a = o.depth, d = (f) => {
|
|
490
499
|
do
|
|
491
|
-
|
|
492
|
-
while (
|
|
493
|
-
return
|
|
500
|
+
f++;
|
|
501
|
+
while (f < g.current.length && g.current[f].depth > a);
|
|
502
|
+
return f;
|
|
494
503
|
}, l = g.current.splice(e, d(e) - e);
|
|
495
|
-
g.current.splice(e < r ? d(r - l.length) : r, 0, ...l), g.current.filter((
|
|
496
|
-
const
|
|
497
|
-
|
|
498
|
-
const m =
|
|
504
|
+
g.current.splice(e < r ? d(r - l.length) : r, 0, ...l), g.current.filter((f) => f.declarationIndex >= 0).forEach((f, R) => f.orderIndex = R);
|
|
505
|
+
const s = g.current[e].locked && g.current[r].locked;
|
|
506
|
+
Qt(t.columnsMapRef, g.current, s || X.current), Zt(t.columnsMapRef, g.current, s || X.current), ne.current && (X.current = !1, ne.current = !1);
|
|
507
|
+
const m = N();
|
|
499
508
|
if (te(), t.gridProps.onColumnReorder) {
|
|
500
|
-
const
|
|
509
|
+
const f = {
|
|
501
510
|
target: C.current,
|
|
502
511
|
columns: m,
|
|
503
512
|
columnId: o.id,
|
|
504
513
|
nativeEvent: n
|
|
505
514
|
};
|
|
506
|
-
u(t.gridProps.onColumnReorder,
|
|
515
|
+
u(t.gridProps.onColumnReorder, f);
|
|
507
516
|
}
|
|
508
517
|
}, A = (e, r, n) => {
|
|
509
518
|
const o = typeof t.gridProps.rowReorderable == "object" ? t.gridProps.rowReorderable.enabled : t.gridProps.rowReorderable;
|
|
510
|
-
if (n === "forbidden" || !o || !
|
|
519
|
+
if (n === "forbidden" || !o || !z.current)
|
|
511
520
|
return;
|
|
512
521
|
const { slicedData: a, dataRef: d } = t, l = (a || d)[r];
|
|
513
522
|
t.gridProps.onRowReorder && u(t.gridProps.onRowReorder, {
|
|
514
|
-
draggedDataItems: [
|
|
523
|
+
draggedDataItems: [z.current],
|
|
515
524
|
droppedDataItem: l == null ? void 0 : l.dataItem,
|
|
516
525
|
dropPosition: n,
|
|
517
526
|
nativeEvent: e.originalEvent,
|
|
518
527
|
dragEvent: e,
|
|
519
528
|
target: C.current
|
|
520
|
-
}),
|
|
521
|
-
},
|
|
529
|
+
}), z.current = null;
|
|
530
|
+
}, Pt = (e, r, n) => {
|
|
522
531
|
if (t.gridProps.group === void 0)
|
|
523
532
|
return;
|
|
524
533
|
const o = t.gridProps.group.slice();
|
|
@@ -529,7 +538,7 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
529
538
|
return;
|
|
530
539
|
const a = (t.gridProps.group || []).slice();
|
|
531
540
|
a.splice(r, 0, { field: o }), Q(a, n);
|
|
532
|
-
},
|
|
541
|
+
}, ht = (e, r) => {
|
|
533
542
|
const n = S.current.getCurrentGroupsLength;
|
|
534
543
|
Ce(e, n, r);
|
|
535
544
|
}, p = () => {
|
|
@@ -543,11 +552,11 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
543
552
|
return;
|
|
544
553
|
e += parseFloat(o.toString());
|
|
545
554
|
}
|
|
546
|
-
e = Math.round(e),
|
|
547
|
-
},
|
|
555
|
+
e = Math.round(e), G.current && G.current.setWidth(e), L.current && L.current.setWidth(e), x.current && (x.current.style.width = e + "px");
|
|
556
|
+
}, U = i.useCallback(
|
|
548
557
|
(e, r, n, o, a) => {
|
|
549
558
|
var m;
|
|
550
|
-
if (!
|
|
559
|
+
if (!bt() && !n || !e)
|
|
551
560
|
return;
|
|
552
561
|
const d = {
|
|
553
562
|
type: e,
|
|
@@ -558,15 +567,15 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
558
567
|
field: a,
|
|
559
568
|
...typeof t.gridProps.clipboard != "boolean" ? t.gridProps.clipboard : {},
|
|
560
569
|
...n
|
|
561
|
-
}, l = V(),
|
|
570
|
+
}, l = V(), s = Nt({
|
|
562
571
|
event: d,
|
|
563
572
|
data: l,
|
|
564
573
|
selectedState: (m = t.gridProps.select) != null ? m : {},
|
|
565
574
|
previousCopiedItems: Ee.current
|
|
566
575
|
});
|
|
567
|
-
e !== ge.paste && (Ee.current =
|
|
576
|
+
e !== ge.paste && (Ee.current = s.copiedItems), t.gridProps.onClipboard && E && u(t.gridProps.onClipboard, {
|
|
568
577
|
...d,
|
|
569
|
-
...
|
|
578
|
+
...s
|
|
570
579
|
});
|
|
571
580
|
},
|
|
572
581
|
[
|
|
@@ -576,15 +585,15 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
576
585
|
t.gridProps.clipboard,
|
|
577
586
|
t.gridProps.onClipboard
|
|
578
587
|
]
|
|
579
|
-
),
|
|
588
|
+
), bt = () => {
|
|
580
589
|
var a, d, l;
|
|
581
590
|
if (!$)
|
|
582
591
|
return !1;
|
|
583
|
-
const e =
|
|
592
|
+
const e = Gt(v()), r = e ? e.matches(".k-table-td") ? e : (a = v()) == null ? void 0 : a.body : (d = v()) == null ? void 0 : d.body, n = r.closest(".k-grid-container"), o = r && ((l = K.current) == null ? void 0 : l.contains(r));
|
|
584
593
|
return !!(r && o && n);
|
|
585
|
-
},
|
|
594
|
+
}, It = (e, r, n, o, a, d) => {
|
|
586
595
|
p(), X.current = !0, ne.current = !0, t.gridProps.onColumnResize && E && u(t.gridProps.onColumnResize, {
|
|
587
|
-
columns:
|
|
596
|
+
columns: N(),
|
|
588
597
|
nativeEvent: o,
|
|
589
598
|
targetColumnId: d,
|
|
590
599
|
index: e,
|
|
@@ -593,7 +602,7 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
593
602
|
end: a,
|
|
594
603
|
target: C.current
|
|
595
604
|
});
|
|
596
|
-
},
|
|
605
|
+
}, Ct = () => {
|
|
597
606
|
var e;
|
|
598
607
|
return {
|
|
599
608
|
filter: t.gridProps.filter,
|
|
@@ -606,7 +615,7 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
606
615
|
nativeEvent: e && e.nativeEvent,
|
|
607
616
|
syntheticEvent: e,
|
|
608
617
|
target: C.current
|
|
609
|
-
}),
|
|
618
|
+
}), Rt = (e) => ({
|
|
610
619
|
...e,
|
|
611
620
|
nativeEvent: void 0,
|
|
612
621
|
syntheticEvent: void 0,
|
|
@@ -618,17 +627,17 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
618
627
|
e(r);
|
|
619
628
|
return;
|
|
620
629
|
}
|
|
621
|
-
e(
|
|
622
|
-
},
|
|
630
|
+
e(Rt(r));
|
|
631
|
+
}, vt = () => {
|
|
623
632
|
var e, r, n;
|
|
624
|
-
if (
|
|
633
|
+
if (F.current && ((e = F.current) == null ? void 0 : e.getElementsByClassName("k-grid-edit-row").length) > 0) {
|
|
625
634
|
ie.current = !1, (r = document.activeElement) != null && r.closest(".k-grid-edit-row") ? ae.current = document.activeElement : ae.current = void 0;
|
|
626
|
-
const o = Array.from((n =
|
|
635
|
+
const o = Array.from((n = F.current) == null ? void 0 : n.getElementsByClassName("k-grid-edit-row"));
|
|
627
636
|
o.length > se.current.length ? q.current = o.filter(
|
|
628
637
|
(a) => !se.current.includes(a)
|
|
629
638
|
)[0] : o.length === 1 && (q.current = o[0], ie.current = !0), se.current = o;
|
|
630
639
|
}
|
|
631
|
-
},
|
|
640
|
+
}, H = () => t.dataRef.filter((e) => e.rowType === "data").map((e) => e.dataItem), V = () => (t.slicedData || t.dataRef).filter((e) => e.rowType === "data").map((e) => e.dataItem), v = () => {
|
|
632
641
|
var e;
|
|
633
642
|
if ($)
|
|
634
643
|
return ((e = _()) == null ? void 0 : e.ownerDocument) || document;
|
|
@@ -650,33 +659,33 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
650
659
|
}
|
|
651
660
|
},
|
|
652
661
|
[t.gridProps.scrollable]
|
|
653
|
-
), Re = (e) => JSON.stringify(e.map((r) => ({ id: r.id, field: r.field, title: r.title, children: r.children }))),
|
|
654
|
-
|
|
655
|
-
},
|
|
662
|
+
), Re = (e) => JSON.stringify(e.map((r) => ({ id: r.id, field: r.field, title: r.title, children: r.children }))), Et = () => Re(Mt) === Re(g.current), wt = () => {
|
|
663
|
+
Et() || te();
|
|
664
|
+
}, yt = () => {
|
|
656
665
|
const { data: e, total: r } = t.gridProps;
|
|
657
666
|
return Array.isArray(e) ? e.length === r : e ? r === e.total : !1;
|
|
658
|
-
},
|
|
667
|
+
}, xt = (e, r) => {
|
|
659
668
|
var n, o;
|
|
660
669
|
if (c.current) {
|
|
661
|
-
if (c.current.fixedScroll = t.gridProps.fixedScroll || !1, c.current.PageChange =
|
|
670
|
+
if (c.current.fixedScroll = t.gridProps.fixedScroll || !1, c.current.PageChange = B, c.current.realSkip = t.gridProps.skip || 0, c.current.pageSize = (o = (n = t.gridProps.take) != null ? n : t.gridProps.pageSize) != null ? o : 0, c.current.scrollableVirtual = t.gridProps.scrollable === "virtual", c.current.total = e, c.current.propsSkip = (t.gridProps.skip || 0) + (t.gridProps.scrollable === "virtual" ? c.current.topCacheCount + (c.current.attendedSkip - (t.gridProps.skip || 0)) : 0), t.gridProps.rowHeight !== void 0 && t.gridProps.rowHeight > 0 && !r) {
|
|
662
671
|
const a = t.gridProps.rowHeight * e;
|
|
663
672
|
c.current.containerHeight = ze ? Math.min(Ne, a) : a;
|
|
664
673
|
} else
|
|
665
674
|
c.current.containerHeight = 1533915;
|
|
666
|
-
if (c.current.containerRef = j, c.current.tableBodyRef =
|
|
675
|
+
if (c.current.containerRef = j, c.current.tableBodyRef = F, c.current.table = x.current, c.current instanceof Oe) {
|
|
667
676
|
const { rowHeight: a = 0, detail: d, expandField: l } = t.gridProps;
|
|
668
|
-
let { detailRowHeight:
|
|
669
|
-
|
|
677
|
+
let { detailRowHeight: s = 0 } = t.gridProps;
|
|
678
|
+
s = d && l ? s : a, yt() ? (c.current.total = t.dataRef.length, c.current.rowHeightService = new He(
|
|
670
679
|
t.dataRef.length,
|
|
671
680
|
a,
|
|
672
|
-
|
|
681
|
+
s,
|
|
673
682
|
t.dataRef
|
|
674
|
-
)) : c.current.rowHeightService = new He(e, a,
|
|
683
|
+
)) : c.current.rowHeightService = new He(e, a, s);
|
|
675
684
|
const m = c.current.rowHeightService.totalHeight();
|
|
676
685
|
c.current.containerHeight = ze ? Math.min(Ne, m) : m;
|
|
677
686
|
}
|
|
678
687
|
}
|
|
679
|
-
},
|
|
688
|
+
}, St = () => {
|
|
680
689
|
const e = (n) => n.map((o) => ({
|
|
681
690
|
id: o.id,
|
|
682
691
|
field: o.field,
|
|
@@ -695,7 +704,7 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
695
704
|
[ee]
|
|
696
705
|
), te = () => {
|
|
697
706
|
t.gridProps.forceUpdate && t.gridProps.forceUpdate();
|
|
698
|
-
},
|
|
707
|
+
}, Dt = (e) => e.left !== void 0 ? we !== "rtl" ? { left: e.left, right: e.right } : { left: e.right, right: e.left } : {}, C = i.useRef(null), g = t.columnsRef, c = i.useRef(), w = i.useRef(), S = i.useRef(), y = i.useRef(), D = i.useRef(), W = i.useRef(), k = i.useRef(null), F = i.useRef(null), kt = i.useRef(null), j = i.useRef(null), x = i.useRef(null), re = i.useRef(null), K = i.useRef(null), L = i.useRef(null), G = i.useRef(null), ne = i.useRef(!1), oe = i.useRef(!1), q = i.useRef(), ae = i.useRef(), ie = i.useRef(!1), X = i.useRef(!0), de = i.useRef(0), ce = i.useRef(), le = i.useRef(), se = i.useRef([]), Ee = i.useRef([]), z = i.useRef(null), Kt = i.useRef(null), Tt = i.useRef(null), we = zt(K), Mt = i.useMemo(() => i.Children.toArray(t.gridProps.children), [t.gridProps.children]), b = Y((Se = t.gridProps.selectable) != null ? Se : !!t.gridProps.selectedField), ye = Ot((De = t.gridProps.editable) != null ? De : !!t.gridProps.editField);
|
|
699
708
|
i.useMemo(() => {
|
|
700
709
|
T.onConstructor({
|
|
701
710
|
navigatable: !!t.gridProps.navigatable,
|
|
@@ -706,7 +715,7 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
706
715
|
}, []), i.useMemo(() => {
|
|
707
716
|
var n;
|
|
708
717
|
(n = c.current) == null || n.reset();
|
|
709
|
-
const e = t.gridProps.groupable === !0 || typeof t.gridProps.groupable == "object" && t.gridProps.groupable.enabled !== !1, r = t.isFixedVirtualScroll ? Oe :
|
|
718
|
+
const e = t.gridProps.groupable === !0 || typeof t.gridProps.groupable == "object" && t.gridProps.groupable.enabled !== !1, r = t.isFixedVirtualScroll ? Oe : dr;
|
|
710
719
|
c.current = new r(e || t.gridProps.rowHeight === void 0 || t.gridProps.rowHeight === 0);
|
|
711
720
|
}, [
|
|
712
721
|
t.gridProps.scrollable,
|
|
@@ -716,9 +725,9 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
716
725
|
t.gridProps.groupable,
|
|
717
726
|
t.gridProps.sort,
|
|
718
727
|
t.gridProps.rowHeight
|
|
719
|
-
]), i.useEffect(() => (t.gridProps.clipboard && (W.current = new
|
|
728
|
+
]), i.useEffect(() => (t.gridProps.clipboard && (W.current = new Bt(U), W.current.addEventListeners(v())), () => {
|
|
720
729
|
W.current && W.current.removeEventListeners(v());
|
|
721
|
-
}), [t.gridProps.onClipboard, t.gridProps.clipboard,
|
|
730
|
+
}), [t.gridProps.onClipboard, t.gridProps.clipboard, U, v]), i.useEffect(() => (t.gridProps.columnVirtualization && !window.navigator.userAgent.match(tr) && (re.current && (re.current.style.display = "block"), x.current && (x.current.style.display = "block")), p(), Ae(), T.onComponentDidMount({
|
|
722
731
|
scope: K.current || void 0,
|
|
723
732
|
contextStateRef: y,
|
|
724
733
|
navigationStateRef: D
|
|
@@ -726,7 +735,7 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
726
735
|
clearTimeout(ce.current);
|
|
727
736
|
}), []), i.useEffect(() => {
|
|
728
737
|
var e;
|
|
729
|
-
p(), Ae(), (e = c.current) != null && e.tableTransform && c.current.table && (c.current.table.style.transform = c.current.tableTransform, c.current.tableTransform = ""),
|
|
738
|
+
p(), Ae(), (e = c.current) != null && e.tableTransform && c.current.table && (c.current.table.style.transform = c.current.tableTransform, c.current.tableTransform = ""), vt(), T.onComponentDidUpdate({
|
|
730
739
|
scope: K.current || void 0,
|
|
731
740
|
contextStateRef: y,
|
|
732
741
|
navigationStateRef: D,
|
|
@@ -747,7 +756,7 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
747
756
|
}, [ve]), i.useEffect(() => {
|
|
748
757
|
var r;
|
|
749
758
|
let e;
|
|
750
|
-
return $ && window.ResizeObserver && (e = new window.ResizeObserver(
|
|
759
|
+
return $ && window.ResizeObserver && (e = new window.ResizeObserver(wt), e.observe((r = v()) == null ? void 0 : r.body)), () => {
|
|
751
760
|
e == null || e.disconnect();
|
|
752
761
|
};
|
|
753
762
|
}, []), i.useImperativeHandle(
|
|
@@ -758,7 +767,7 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
758
767
|
},
|
|
759
768
|
props: t.gridProps,
|
|
760
769
|
get columns() {
|
|
761
|
-
return
|
|
770
|
+
return N();
|
|
762
771
|
},
|
|
763
772
|
scrollIntoView: (e) => {
|
|
764
773
|
var o;
|
|
@@ -778,9 +787,9 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
778
787
|
}
|
|
779
788
|
})
|
|
780
789
|
), i.useImperativeHandle(t.gridRef, () => C.current), i.useMemo(() => {
|
|
781
|
-
w.current = new
|
|
790
|
+
w.current = new pt(It);
|
|
782
791
|
}, [t.gridProps.onColumnResize]), i.useMemo(() => {
|
|
783
|
-
S.current = new
|
|
792
|
+
S.current = new er(Z, Pt, Ce);
|
|
784
793
|
}, [
|
|
785
794
|
t.gridProps.onColumnReorder,
|
|
786
795
|
t.gridProps.onGroupChange,
|
|
@@ -788,25 +797,25 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
788
797
|
t.gridProps.groupable
|
|
789
798
|
]), w.current.resizable = t.gridProps.resizable || !1, w.current.columns = g.current;
|
|
790
799
|
const xe = t.gridProps.groupable === !0 || typeof t.gridProps.groupable == "object" && t.gridProps.groupable.enabled !== !1;
|
|
791
|
-
S.current.reorderable = t.gridProps.reorderable || !1, S.current.groupable = xe, S.current.columns = g.current,
|
|
792
|
-
const
|
|
800
|
+
S.current.reorderable = t.gridProps.reorderable || !1, S.current.groupable = xe, S.current.columns = g.current, xt(t.total, xe);
|
|
801
|
+
const At = t.gridProps.columnsState || St();
|
|
793
802
|
return /* @__PURE__ */ i.createElement(
|
|
794
|
-
|
|
803
|
+
ur.Provider,
|
|
795
804
|
{
|
|
796
805
|
value: {
|
|
797
806
|
isClient: E,
|
|
798
807
|
rowReorder: A,
|
|
799
|
-
activeDragRowDataItemRef:
|
|
800
|
-
reorderRowDragTargetRef:
|
|
801
|
-
reorderRowDropTargetRef:
|
|
808
|
+
activeDragRowDataItemRef: z,
|
|
809
|
+
reorderRowDragTargetRef: Kt,
|
|
810
|
+
reorderRowDropTargetRef: Tt,
|
|
802
811
|
dir: we,
|
|
803
|
-
getCellPositionStyle:
|
|
812
|
+
getCellPositionStyle: Dt,
|
|
804
813
|
dataItemKey: t.gridProps.dataItemKey,
|
|
805
|
-
columnsState:
|
|
806
|
-
onColumnsStateChange:
|
|
814
|
+
columnsState: At,
|
|
815
|
+
onColumnsStateChange: mt,
|
|
807
816
|
groupChange: Q,
|
|
808
|
-
selectionRelease:
|
|
809
|
-
pagerPageChange:
|
|
817
|
+
selectionRelease: ot,
|
|
818
|
+
pagerPageChange: ut,
|
|
810
819
|
onContextMenu: We,
|
|
811
820
|
rowClick: Je,
|
|
812
821
|
rowDblClick: Ye,
|
|
@@ -814,10 +823,10 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
814
823
|
headerCellClick: be,
|
|
815
824
|
itemChange: et,
|
|
816
825
|
sortChange: Ie,
|
|
817
|
-
filterChange:
|
|
818
|
-
searchChange:
|
|
819
|
-
onHeaderSelectionChange:
|
|
820
|
-
columnGroupChange:
|
|
826
|
+
filterChange: gt,
|
|
827
|
+
searchChange: ft,
|
|
828
|
+
onHeaderSelectionChange: nt,
|
|
829
|
+
columnGroupChange: ht,
|
|
821
830
|
onKeyDown: qe,
|
|
822
831
|
onFocus: Xe,
|
|
823
832
|
scrollHandler: je,
|
|
@@ -828,25 +837,25 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
828
837
|
dragLogicRef: S,
|
|
829
838
|
navigationStateRef: D,
|
|
830
839
|
tableElementRef: x,
|
|
831
|
-
tableBodyElementRef:
|
|
832
|
-
headerElementRef:
|
|
840
|
+
tableBodyElementRef: F,
|
|
841
|
+
headerElementRef: kt,
|
|
833
842
|
containerElementRef: j,
|
|
834
843
|
headTableElementRef: re,
|
|
835
844
|
elementRef: K,
|
|
836
|
-
footerRef:
|
|
837
|
-
headerRef:
|
|
845
|
+
footerRef: L,
|
|
846
|
+
headerRef: G,
|
|
838
847
|
vsRef: c
|
|
839
848
|
}
|
|
840
849
|
},
|
|
841
|
-
/* @__PURE__ */ i.createElement(
|
|
850
|
+
/* @__PURE__ */ i.createElement(Ut.Provider, { value: y.current }, t.children),
|
|
842
851
|
/* @__PURE__ */ i.createElement(
|
|
843
|
-
|
|
852
|
+
cr,
|
|
844
853
|
{
|
|
845
|
-
show:
|
|
846
|
-
dataItem:
|
|
847
|
-
field:
|
|
854
|
+
show: I.show,
|
|
855
|
+
dataItem: I.dataItem,
|
|
856
|
+
field: I.field,
|
|
848
857
|
items: Ve,
|
|
849
|
-
offset:
|
|
858
|
+
offset: I.offset,
|
|
850
859
|
onClose: me,
|
|
851
860
|
onSelect: _e
|
|
852
861
|
}
|
|
@@ -854,6 +863,6 @@ const sr = i.createContext(void 0), wr = (t) => {
|
|
|
854
863
|
);
|
|
855
864
|
};
|
|
856
865
|
export {
|
|
857
|
-
|
|
858
|
-
|
|
866
|
+
yr as GridClientWrapper,
|
|
867
|
+
ur as GridContext
|
|
859
868
|
};
|