@progress/kendo-react-grid 10.1.1-develop.1 → 10.2.0-develop.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,8 +7,8 @@
7
7
  */
8
8
  "use client";
9
9
  import * as i from "react";
10
- import { canUseDOM as Z, getActiveElement as At, useDir as Ht, setScrollbarWidth as Ae, cloneArray as Ft, getter as p, RowHeightService as He } from "@progress/kendo-react-common";
11
- import { getSelectionOptions as ee, populateClipboardData as Lt, ClipboardActionType as he, getEditableOptions as Gt, tableKeyboardNavigation as T, ClipboardService as zt, TableKeyboardNavigationContext as Nt, editReducer as Ot, EDIT_ACTION as Bt, getDetailExpandableOptions as Ut, detailExpandReducer as Fe, getGroupExpandableOptions as Vt, groupExpandReducer as _t, DETAIL_EXPAND_ACTION as Wt, getSelectedState as Le, getSelectedStateFromKeyDown as jt, closestTagName as Ge, getColumnIndex as qt, getRowIndex as Xt, updateLeft as $t, updateRight as Jt } from "@progress/kendo-react-data-tools";
10
+ import { canUseDOM as p, getActiveElement as At, useDir as Ht, setScrollbarWidth as Ae, cloneArray as Ft, getter as ee, RowHeightService as He } from "@progress/kendo-react-common";
11
+ import { getSelectionOptions as te, populateClipboardData as Lt, ClipboardActionType as Ie, getEditableOptions as Gt, tableKeyboardNavigation as T, ClipboardService as zt, TableKeyboardNavigationContext as Nt, editReducer as Ot, EDIT_ACTION as Bt, getDetailExpandableOptions as Ut, detailExpandReducer as Fe, getGroupExpandableOptions as Vt, groupExpandReducer as _t, DETAIL_EXPAND_ACTION as Wt, getSelectedState as Le, getSelectedStateFromKeyDown as jt, closestTagName as Ge, getColumnIndex as qt, getRowIndex as Xt, updateLeft as $t, updateRight as Jt } from "@progress/kendo-react-data-tools";
12
12
  import { ColumnResize as Yt } from "./drag/ColumnResize.mjs";
13
13
  import { CommonDragLogic as Qt } from "./drag/CommonDragLogic.mjs";
14
14
  import { SAFARI_REGEX as Zt } from "./constants/index.mjs";
@@ -20,9 +20,9 @@ import { GridContextMenuAnchorPart as Be } from "./contextMenu/enums.mjs";
20
20
  import { normalizeSortable as cn, firstLevelSortSeqMap as ln } from "./sortCommon.mjs";
21
21
  const sn = i.createContext(void 0), wn = (t) => {
22
22
  var Te, Me;
23
- const w = t.gridProps.isClient, [I, be] = i.useState({}), Ue = (e) => {
23
+ const w = t.gridProps.isClient, [b, be] = i.useState({}), Ue = (e) => {
24
24
  e.event.preventDefault(), be({
25
- ...I,
25
+ ...b,
26
26
  show: !0,
27
27
  offset: {
28
28
  left: e.event.pageX,
@@ -31,43 +31,43 @@ const sn = i.createContext(void 0), wn = (t) => {
31
31
  dataItem: e.dataItem,
32
32
  field: e.field
33
33
  });
34
- }, Ie = () => {
34
+ }, Re = () => {
35
35
  be({});
36
- }, m = i.useMemo(() => t.columnsRef.find((e) => e.field === I.field), [t.columnsRef, I]), Re = i.useMemo(() => {
36
+ }, m = i.useMemo(() => t.columnsRef.find((e) => e.field === b.field), [t.columnsRef, b]), Ce = i.useMemo(() => {
37
37
  const e = t.gridProps.sortable && (m == null ? void 0 : m.sortable);
38
38
  return pt({
39
39
  sortable: !!e,
40
- selectable: ee(t.gridProps.selectable).enabled,
40
+ selectable: te(t.gridProps.selectable).enabled,
41
41
  clipboard: !!t.gridProps.clipboard
42
42
  });
43
- }, [m, t.gridProps.sortable, t.gridProps.selectable, t.gridProps.clipboard]), Ce = i.useMemo(() => {
43
+ }, [m, t.gridProps.sortable, t.gridProps.selectable, t.gridProps.clipboard]), ve = i.useMemo(() => {
44
44
  const e = t.gridProps.sortable && (m == null ? void 0 : m.sortable);
45
45
  return en({
46
46
  sortable: !!e,
47
- selectable: ee(t.gridProps.selectable).enabled,
47
+ selectable: te(t.gridProps.selectable).enabled,
48
48
  clipboard: !!t.gridProps.clipboard,
49
49
  rowReorderable: tn(t.gridProps.rowReorderable)
50
50
  });
51
51
  }, [m, t.gridProps.sortable, t.gridProps.selectable, t.gridProps.clipboard]), Ve = i.useMemo(() => {
52
- const e = (m == null ? void 0 : m.contextMenu) || t.gridProps.contextMenu, n = typeof e == "function" ? e(I) : e;
53
- if (n && I.offset) {
54
- const r = I.dataItem ? Be.body : Be.head, a = n[r], o = I.dataItem ? Ce : Re;
55
- return a === !1 ? void 0 : a === !0 || a === void 0 ? o : a;
52
+ const e = (m == null ? void 0 : m.contextMenu) || t.gridProps.contextMenu, n = typeof e == "function" ? e(b) : e;
53
+ if (n && b.offset) {
54
+ const a = b.dataItem ? Be.body : Be.head, r = n[a], o = b.dataItem ? ve : Ce;
55
+ return r === !1 ? void 0 : r === !0 || r === void 0 ? o : r;
56
56
  }
57
- }, [t.gridProps.contextMenu, I, Ce, Re, m]), _e = (e) => {
58
- var l, u, g, f, C, Q, b, N, O;
59
- const n = e.event.item, r = {
57
+ }, [t.gridProps.contextMenu, b, ve, Ce, m]), _e = (e) => {
58
+ var l, u, g, f, C, Z, I, N, O;
59
+ const n = e.event.item, a = {
60
60
  target: R.current,
61
61
  syntheticEvent: e.event.syntheticEvent,
62
62
  nativeEvent: e.event.nativeEvent,
63
63
  menuItem: n,
64
64
  ...e
65
65
  };
66
- t.gridProps.onContextMenuItemClick && s(t.gridProps.onContextMenuItemClick, r);
67
- const a = j(), o = {
66
+ t.gridProps.onContextMenuItemClick && s(t.gridProps.onContextMenuItemClick, a);
67
+ const r = j(), o = {
68
68
  selectedField: t.gridProps.selectedField || "",
69
69
  componentId: t.id,
70
- dataItems: a,
70
+ dataItems: r,
71
71
  dataItem: e.dataItem,
72
72
  startRowIndex: -1,
73
73
  endRowIndex: -1,
@@ -78,14 +78,14 @@ const sn = i.createContext(void 0), wn = (t) => {
78
78
  metaKey: !1,
79
79
  shiftKey: !1,
80
80
  isDrag: !1,
81
- ...ee(t.gridProps.selectable),
82
- ...r
83
- }, d = a.findIndex((B) => B === e.dataItem);
81
+ ...te(t.gridProps.selectable),
82
+ ...a
83
+ }, d = r.findIndex((B) => B === e.dataItem);
84
84
  switch ((l = n.data) == null ? void 0 : l.action) {
85
85
  case "SortCommand":
86
86
  if (m) {
87
87
  const B = (u = n.name) == null ? void 0 : u.toLowerCase().includes("asc"), Kt = ((g = n.name) == null ? void 0 : g.toLowerCase().includes("desc")) ? "desc" : void 0, Tt = B ? "asc" : Kt, Mt = n.name ? Tt : void 0;
88
- ve(e.event.syntheticEvent, m, Mt);
88
+ Ee(e.event.syntheticEvent, m, Mt);
89
89
  }
90
90
  break;
91
91
  case "SelectRowCommand":
@@ -98,11 +98,11 @@ const sn = i.createContext(void 0), wn = (t) => {
98
98
  dt(o);
99
99
  break;
100
100
  case "ReorderRowCommand":
101
- z.current = e.dataItem, (f = n.name) != null && f.toLowerCase().includes("rowup") && d > 0 && A(e.event.syntheticEvent, d - 1, "before"), (C = n.name) != null && C.toLowerCase().includes("rowdown") && d < a.length - 1 && A(e.event.syntheticEvent, d + 1, "after"), (Q = n.name) != null && Q.toLowerCase().includes("rowtop") && A(e.event.syntheticEvent, 0, "before"), (b = n.name) != null && b.toLowerCase().includes("rowbottom") && A(e.event.syntheticEvent, a.length - 1, "after");
101
+ z.current = e.dataItem, (f = n.name) != null && f.toLowerCase().includes("rowup") && d > 0 && A(e.event.syntheticEvent, d - 1, "before"), (C = n.name) != null && C.toLowerCase().includes("rowdown") && d < r.length - 1 && A(e.event.syntheticEvent, d + 1, "after"), (Z = n.name) != null && Z.toLowerCase().includes("rowtop") && A(e.event.syntheticEvent, 0, "before"), (I = n.name) != null && I.toLowerCase().includes("rowbottom") && A(e.event.syntheticEvent, r.length - 1, "after");
102
102
  break;
103
103
  case "CopySelectionCommand":
104
104
  W(
105
- he.copy,
105
+ Ie.copy,
106
106
  e.event.nativeEvent,
107
107
  {
108
108
  copyHeaders: !((N = n.name) != null && N.toLowerCase().includes("noheaders"))
@@ -113,7 +113,7 @@ const sn = i.createContext(void 0), wn = (t) => {
113
113
  break;
114
114
  case "PasteCommand":
115
115
  W(
116
- he.paste,
116
+ Ie.paste,
117
117
  e.event.nativeEvent,
118
118
  {
119
119
  copyHeaders: !((O = n.name) != null && O.toLowerCase().includes("noheaders"))
@@ -123,36 +123,36 @@ const sn = i.createContext(void 0), wn = (t) => {
123
123
  );
124
124
  break;
125
125
  }
126
- Ie();
126
+ Re();
127
127
  }, U = () => {
128
128
  const e = t.columnsRef.filter((n) => n.declarationIndex >= 0 && n.parentIndex === -1);
129
129
  return nn(e);
130
- }, We = (e, n, r) => {
130
+ }, We = (e, n, a) => {
131
131
  if (t.gridProps.onContextMenu && w) {
132
- const a = {
132
+ const r = {
133
133
  target: R.current,
134
134
  syntheticEvent: e,
135
135
  nativeEvent: e.nativeEvent,
136
136
  dataItem: n,
137
- field: r
137
+ field: a
138
138
  };
139
- s(t.gridProps.onContextMenu, a);
139
+ s(t.gridProps.onContextMenu, r);
140
140
  }
141
141
  t.gridProps.contextMenu && Ue({
142
142
  event: e,
143
143
  dataItem: n,
144
- field: r
144
+ field: a
145
145
  });
146
146
  }, je = (e) => {
147
147
  if (e.target !== e.currentTarget)
148
148
  return;
149
- clearTimeout(fe.current), c.current && (c.current.table = x.current);
150
- const n = e.currentTarget.scrollLeft, r = e.currentTarget.scrollTop, a = t.gridProps.scrollable === "virtual";
151
- t.gridProps.columnVirtualization && (!a || r === ge.current) && (fe.current = window.setTimeout(() => {
152
- ie();
153
- }, 0)), t.gridProps.scrollLeftRef && (t.gridProps.scrollLeftRef.current = n), G.current && G.current.setScrollLeft(n), L.current && L.current.setScrollLeft(n), c.current && r !== ge.current && c.current.scrollHandler(e), t.gridProps.onScroll && w && s(t.gridProps.onScroll, {
149
+ clearTimeout(me.current), c.current && (c.current.table = x.current);
150
+ const n = e.currentTarget.scrollLeft, a = e.currentTarget.scrollTop, r = t.gridProps.scrollable === "virtual";
151
+ t.gridProps.columnVirtualization && (!r || a === fe.current) && (me.current = window.setTimeout(() => {
152
+ de();
153
+ }, 0)), t.gridProps.scrollLeftRef && (t.gridProps.scrollLeftRef.current = n), G.current && G.current.setScrollLeft(n), L.current && L.current.setScrollLeft(n), c.current && a !== fe.current && c.current.scrollHandler(e), t.gridProps.onScroll && w && s(t.gridProps.onScroll, {
154
154
  ...P(e)
155
- }), ge.current = r;
155
+ }), fe.current = a;
156
156
  }, qe = (e) => {
157
157
  T.onKeyDown(e, {
158
158
  navigatable: t.gridProps.navigatable || !1,
@@ -182,11 +182,11 @@ const sn = i.createContext(void 0), wn = (t) => {
182
182
  }, $e = (e) => {
183
183
  if (e.action === "moveToNextPage" && lt(e.event), e.action === "moveToPrevPage" && st(e.event), e.focusElement && e.action === "reorderToRight") {
184
184
  const n = parseInt(e.focusElement.ariaColIndex, 10) - 1;
185
- n < t.columnsRef.length - 1 && re(n, n + 1, e.event);
185
+ n < t.columnsRef.length - 1 && ae(n, n + 1, e.event);
186
186
  }
187
187
  if (e.focusElement && e.action === "reorderToLeft") {
188
188
  const n = parseInt(e.focusElement.ariaColIndex, 10) - 1;
189
- n > 0 && re(n, n - 1, e.event);
189
+ n > 0 && ae(n, n - 1, e.event);
190
190
  }
191
191
  if (e.action === "select" && nt(e.event), t.gridProps.onNavigationAction && w) {
192
192
  const n = {
@@ -205,56 +205,56 @@ const sn = i.createContext(void 0), wn = (t) => {
205
205
  dataItem: n,
206
206
  ...P(e)
207
207
  });
208
- }, Qe = (e, n, r) => {
209
- if (De.enabled && De.mode === "incell" && t.gridProps.dataItemKey) {
210
- const a = Ot(t.gridProps.edit, {
208
+ }, Qe = (e, n, a) => {
209
+ if (Ke.enabled && Ke.mode === "incell" && t.gridProps.dataItemKey) {
210
+ const r = Ot(t.gridProps.edit, {
211
211
  type: Bt.ENTER_FIELD_EDIT,
212
- payload: { id: n[t.gridProps.dataItemKey], field: r }
212
+ payload: { id: n[t.gridProps.dataItemKey], field: a }
213
213
  });
214
214
  t.gridProps.onEditChange && s(t.gridProps.onEditChange, {
215
- edit: a,
215
+ edit: r,
216
216
  ...P(e)
217
217
  });
218
218
  }
219
219
  }, Ze = (e, n) => {
220
- var a;
220
+ var r;
221
221
  if (Ut(t.detailExpandable).enabled) {
222
- const o = Fe((a = t.gridProps.detailExpand) != null ? a : {}, e);
222
+ const o = Fe((r = t.gridProps.detailExpand) != null ? r : {}, e);
223
223
  t.gridProps.onDetailExpandChange && s(t.gridProps.onDetailExpandChange, {
224
224
  ...P(n),
225
225
  detailExpand: o
226
226
  });
227
227
  }
228
228
  }, pe = (e, n) => {
229
- var a;
230
- const r = Vt(
229
+ var r;
230
+ const a = Vt(
231
231
  typeof t.gridProps.groupable == "object" ? t.gridProps.groupable.expandable !== !1 : t.gridProps.groupable
232
232
  );
233
- if (r.enabled) {
234
- const o = _t((a = t.gridProps.groupExpand) != null ? a : [], e, r);
233
+ if (a.enabled) {
234
+ const o = _t((r = t.gridProps.groupExpand) != null ? r : [], e, a);
235
235
  t.gridProps.onGroupExpandChange && s(t.gridProps.onGroupExpandChange, {
236
236
  ...P(n),
237
237
  groupExpand: o
238
238
  });
239
239
  }
240
- }, ve = (e, n, r) => {
241
- const { allowUnsort: a, mode: o } = cn(
240
+ }, Ee = (e, n, a) => {
241
+ const { allowUnsort: r, mode: o } = cn(
242
242
  t.gridProps.sortable || !1,
243
243
  n.sortable || !1
244
- ), d = (t.gridProps.sort || []).filter((g) => g.field === n.field)[0], l = r || ln[a][d && d.dir || ""], u = o === "single" ? [] : (t.gridProps.sort || []).filter((g) => g.field !== n.field);
245
- l !== "" && n.field && u.push({ field: n.field, dir: l }), Ee(u, e);
244
+ ), d = (t.gridProps.sort || []).filter((g) => g.field === n.field)[0], l = a || ln[r][d && d.dir || ""], u = o === "single" ? [] : (t.gridProps.sort || []).filter((g) => g.field !== n.field);
245
+ l !== "" && n.field && u.push({ field: n.field, dir: l }), we(u, e);
246
246
  }, et = (e) => {
247
247
  var n;
248
248
  if (e.field === t.gridProps.expandField || e._expand || t.gridProps.group && e.field === void 0) {
249
249
  if (t.gridProps.onExpandChange) {
250
- const r = t.gridProps.dataItemKey ? Fe((n = t.gridProps.detailExpand) != null ? n : {}, {
250
+ const a = t.gridProps.dataItemKey ? Fe((n = t.gridProps.detailExpand) != null ? n : {}, {
251
251
  type: Wt.SET,
252
252
  id: e.dataItem[t.gridProps.dataItemKey],
253
253
  payload: e.value
254
254
  }) : t.gridProps.detailExpand;
255
255
  s(t.gridProps.onExpandChange, {
256
256
  ...P(e.syntheticEvent),
257
- expand: r,
257
+ expand: a,
258
258
  dataItem: e.dataItem,
259
259
  dataIndex: e.dataIndex,
260
260
  value: e.value
@@ -272,9 +272,9 @@ const sn = i.createContext(void 0), wn = (t) => {
272
272
  }, tt = (e) => {
273
273
  var n;
274
274
  if (t.gridProps.onSelectionChange && h.enabled) {
275
- const { event: r, dataItem: a, dataIndex: o, columnIndex: d } = e, l = {
276
- ...P(r.syntheticEvent),
277
- dataItem: a,
275
+ const { event: a, dataItem: r, dataIndex: o, columnIndex: d } = e, l = {
276
+ ...P(a.syntheticEvent),
277
+ dataItem: r,
278
278
  startColIndex: d,
279
279
  endColIndex: d,
280
280
  startRowIndex: o,
@@ -310,19 +310,19 @@ const sn = i.createContext(void 0), wn = (t) => {
310
310
  componentId: t.id,
311
311
  selectedField: t.gridProps.selectedField,
312
312
  ...P(e)
313
- }, r = jt({
313
+ }, a = jt({
314
314
  event: n,
315
315
  selectedState: (g = t.gridProps.select) != null ? g : {},
316
316
  dataItemKey: t.gridProps.dataItemKey
317
317
  });
318
- if (r === t.gridProps.select)
318
+ if (a === t.gridProps.select)
319
319
  return;
320
- const a = e.target, o = Ge(a, "TD"), d = Ge(a, "TR"), l = qt(o), u = Xt(d);
320
+ const r = e.target, o = Ge(r, "TD"), d = Ge(r, "TR"), l = qt(o), u = Xt(d);
321
321
  if (l !== void 0 && u !== void 0) {
322
322
  const C = (f = rn(t.gridProps.data)) == null ? void 0 : f[u];
323
323
  t.gridProps.onSelectionChange && s(t.gridProps.onSelectionChange, {
324
324
  ...n,
325
- select: r,
325
+ select: a,
326
326
  dataItem: C,
327
327
  startRowIndex: u,
328
328
  startColIndex: l,
@@ -340,14 +340,14 @@ const sn = i.createContext(void 0), wn = (t) => {
340
340
  }, rt = (e) => {
341
341
  var n;
342
342
  if (t.gridProps.onHeaderSelectionChange && h.enabled) {
343
- const r = H();
343
+ const a = H();
344
344
  s(t.gridProps.onHeaderSelectionChange, {
345
- select: e.syntheticEvent.target.checked ? r.reduce((a, o) => (t.gridProps.dataItemKey && p(t.gridProps.dataItemKey)(o) !== void 0 && (a[p(t.gridProps.dataItemKey)(o)] = !0), a), {}) : {},
345
+ select: e.syntheticEvent.target.checked ? a.reduce((r, o) => (t.gridProps.dataItemKey && ee(t.gridProps.dataItemKey)(o) !== void 0 && (r[ee(t.gridProps.dataItemKey)(o)] = !0), r), {}) : {},
346
346
  field: e.field,
347
347
  nativeEvent: e.syntheticEvent && e.syntheticEvent.nativeEvent,
348
348
  syntheticEvent: e.syntheticEvent,
349
349
  target: R.current,
350
- dataItems: r,
350
+ dataItems: a,
351
351
  selectedField: (n = t.gridProps.selectedField) != null ? n : ""
352
352
  });
353
353
  }
@@ -359,15 +359,15 @@ const sn = i.createContext(void 0), wn = (t) => {
359
359
  }, at = (e) => {
360
360
  var n;
361
361
  if (t.gridProps.onSelectionChange && h.enabled) {
362
- const r = j()[e.startRowIndex], a = j()[e.endRowIndex], o = {
362
+ const a = j()[e.startRowIndex], r = j()[e.endRowIndex], o = {
363
363
  syntheticEvent: void 0,
364
364
  target: R.current,
365
365
  selectedField: t.gridProps.selectedField || "",
366
366
  componentId: t.id,
367
367
  dataItems: H(),
368
368
  dataItem: null,
369
- startDataItem: r,
370
- endDataItem: a,
369
+ startDataItem: a,
370
+ endDataItem: r,
371
371
  ...e
372
372
  }, d = Le({
373
373
  event: o,
@@ -380,23 +380,23 @@ const sn = i.createContext(void 0), wn = (t) => {
380
380
  }
381
381
  }, ot = (e) => {
382
382
  if (t.gridProps.onSelectionChange && h.enabled) {
383
- const n = e.dataItems[0], r = e.dataItems[e.dataItems.length - 1], a = {}, o = {
383
+ const n = e.dataItems[0], a = e.dataItems[e.dataItems.length - 1], r = {}, o = {
384
384
  ...e,
385
385
  startDataItem: n,
386
- endDataItem: r,
386
+ endDataItem: a,
387
387
  startRowIndex: 0,
388
388
  endRowIndex: e.dataItems.length - 1,
389
389
  startColIndex: 0,
390
390
  endColIndex: t.columnsRef.length - 1
391
391
  };
392
392
  e.dataItems.forEach((d) => {
393
- const u = p(t.gridProps.dataItemKey)(d);
394
- a[u] = e.cell ? [...Array(t.columnsRef.length).keys()] : !0;
395
- }), V(o, a);
393
+ const u = ee(t.gridProps.dataItemKey)(d);
394
+ r[u] = e.cell ? [...Array(t.columnsRef.length).keys()] : !0;
395
+ }), V(o, r);
396
396
  }
397
397
  }, it = (e) => {
398
398
  if (t.gridProps.onSelectionChange && h.enabled) {
399
- const r = p(t.gridProps.dataItemKey)(e.dataItem), a = 0, o = t.columnsRef.length - 1, d = e.dataItems.findIndex(
399
+ const a = ee(t.gridProps.dataItemKey)(e.dataItem), r = 0, o = t.columnsRef.length - 1, d = e.dataItems.findIndex(
400
400
  (C) => C[t.gridProps.dataItemKey] === e.dataItem[t.gridProps.dataItemKey]
401
401
  ), g = {
402
402
  ...e,
@@ -404,48 +404,48 @@ const sn = i.createContext(void 0), wn = (t) => {
404
404
  endDataItem: d,
405
405
  startRowIndex: d,
406
406
  endRowIndex: d,
407
- startColIndex: a,
407
+ startColIndex: r,
408
408
  endColIndex: o
409
409
  }, f = e.mode === "multiple" ? t.gridProps.select || {} : {};
410
- f[r] === !0 || Array.isArray(f[r]) && f[r].length === t.columnsRef.length ? delete f[r] : f[r] = e.cell ? [...Array(t.columnsRef.length).keys()] : !0, V(g, f);
410
+ f[a] === !0 || Array.isArray(f[a]) && f[a].length === t.columnsRef.length ? delete f[a] : f[a] = e.cell ? [...Array(t.columnsRef.length).keys()] : !0, V(g, f);
411
411
  }
412
412
  }, dt = (e) => {
413
413
  t.gridProps.onSelectionChange && h.enabled && V(e, {});
414
- }, M = (e, n, r, a, o) => {
414
+ }, M = (e, n, a, r, o) => {
415
415
  const d = t.gridProps.onDataStateChange;
416
416
  if (e) {
417
- const l = { ...P(a), ...n, targetEvent: o };
417
+ const l = { ...P(r), ...n, targetEvent: o };
418
418
  s(e, l);
419
419
  } else d && s(d, {
420
- ...P(a),
420
+ ...P(r),
421
421
  targetEvent: o || {},
422
422
  dataState: {
423
- ...It(),
424
- ...r
423
+ ...bt(),
424
+ ...a
425
425
  }
426
426
  });
427
- }, _ = (e, n, r) => {
427
+ }, _ = (e, n, a) => {
428
428
  M(
429
429
  t.gridProps.onPageChange,
430
430
  { page: e },
431
431
  { skip: e.skip, take: e.take },
432
432
  n,
433
- r
433
+ a
434
434
  );
435
435
  }, ct = () => {
436
436
  let e = t.gridProps.total || 0;
437
437
  return Array.isArray(t.gridProps.data) ? e = e || t.gridProps.data.length : t.gridProps.data && (e = e || t.gridProps.data.total), e;
438
438
  }, lt = (e) => {
439
439
  var o, d;
440
- const n = (d = (o = t.gridProps.take) != null ? o : t.gridProps.pageSize) != null ? d : 0, r = (t.gridProps.skip || 0) + n, a = ct();
441
- r < a && _({ skip: r, take: n }, e);
440
+ const n = (d = (o = t.gridProps.take) != null ? o : t.gridProps.pageSize) != null ? d : 0, a = (t.gridProps.skip || 0) + n, r = ct();
441
+ a < r && _({ skip: a, take: n }, e);
442
442
  }, st = (e) => {
443
- var a, o;
444
- const n = (o = (a = t.gridProps.take) != null ? a : t.gridProps.pageSize) != null ? o : 0, r = (t.gridProps.skip || 0) - n;
445
- r >= 0 && _({ skip: r, take: n }, e);
443
+ var r, o;
444
+ const n = (o = (r = t.gridProps.take) != null ? r : t.gridProps.pageSize) != null ? o : 0, a = (t.gridProps.skip || 0) - n;
445
+ a >= 0 && _({ skip: a, take: n }, e);
446
446
  }, ut = (e) => {
447
447
  _({ skip: e.skip, take: e.take }, e.syntheticEvent, e.targetEvent);
448
- }, Ee = (e, n) => {
448
+ }, we = (e, n) => {
449
449
  M(
450
450
  t.gridProps.onSortChange,
451
451
  { sort: e },
@@ -460,12 +460,12 @@ const sn = i.createContext(void 0), wn = (t) => {
460
460
  n
461
461
  );
462
462
  }, ft = (e) => {
463
- const n = t.gridProps.searchFields || t.columnsRef.map((o) => o.field) || [], r = e.nativeEvent.target.value, a = {
463
+ const n = t.gridProps.searchFields || t.columnsRef.map((o) => o.field) || [], a = e.nativeEvent.target.value, r = {
464
464
  logic: "or",
465
465
  filters: n.filter((o) => o !== void 0).map((o) => {
466
466
  var d;
467
- return typeof o == "string" ? { field: o, value: r, operator: "contains" } : {
468
- value: r,
467
+ return typeof o == "string" ? { field: o, value: a, operator: "contains" } : {
468
+ value: a,
469
469
  operator: (d = o.operator) != null ? d : "contains",
470
470
  field: o.field,
471
471
  ignoreCase: o.ignoreCase
@@ -475,20 +475,20 @@ const sn = i.createContext(void 0), wn = (t) => {
475
475
  M(
476
476
  t.gridProps.onSearchChange,
477
477
  {
478
- search: a
478
+ search: r
479
479
  },
480
480
  {},
481
481
  e.syntheticEvent
482
482
  );
483
- }, te = (e, n) => {
484
- const r = n.nativeEvent ? n : { nativeEvent: n.nativeEvent || n.originalEvent };
485
- e.length === 0 && t.gridProps.navigatable && (le.current = !0), M(
483
+ }, ne = (e, n) => {
484
+ const a = n.nativeEvent ? n : { nativeEvent: n.nativeEvent || n.originalEvent };
485
+ e.length === 0 && t.gridProps.navigatable && (se.current = !0), M(
486
486
  t.gridProps.onGroupChange,
487
487
  { group: e },
488
488
  { group: e, skip: 0 },
489
- r
489
+ a
490
490
  );
491
- }, ne = (e) => {
491
+ }, re = (e) => {
492
492
  if (t.gridProps.onColumnsStateChange) {
493
493
  const n = {
494
494
  target: R.current,
@@ -496,93 +496,93 @@ const sn = i.createContext(void 0), wn = (t) => {
496
496
  };
497
497
  s(t.gridProps.onColumnsStateChange, n);
498
498
  }
499
- }, re = (e, n, r) => {
500
- const { columnsRef: a, columnsState: o } = t, d = a[e], l = an(o), u = d.depth, g = (b) => {
499
+ }, ae = (e, n, a) => {
500
+ const { columnsRef: r, columnsState: o } = t, d = r[e], l = an(o), u = d.depth, g = (I) => {
501
501
  do
502
- b++;
503
- while (b < a.length && a[b].depth > u);
504
- return b;
505
- }, f = a.splice(e, g(e) - e);
506
- a.splice(e < n ? g(n - f.length) : n, 0, ...f), a.filter((b) => b.declarationIndex >= 0).forEach((b, N) => {
507
- b.orderIndex = N;
508
- const O = l.find((B) => B.id === b.id);
502
+ I++;
503
+ while (I < r.length && r[I].depth > u);
504
+ return I;
505
+ }, f = r.splice(e, g(e) - e);
506
+ r.splice(e < n ? g(n - f.length) : n, 0, ...f), r.filter((I) => I.declarationIndex >= 0).forEach((I, N) => {
507
+ I.orderIndex = N;
508
+ const O = l.find((B) => B.id === I.id);
509
509
  O && (O.orderIndex = N);
510
510
  });
511
- const C = a[e].locked && a[n].locked;
512
- $t(t.columnsMapRef, a, C || Y.current), Jt(t.columnsMapRef, a, C || Y.current), ce.current && (Y.current = !1, ce.current = !1);
513
- const Q = U();
514
- if (ie(), t.gridProps.onColumnReorder) {
515
- const b = {
511
+ const C = r[e].locked && r[n].locked;
512
+ $t(t.columnsMapRef, r, C || Y.current), Jt(t.columnsMapRef, r, C || Y.current), le.current && (Y.current = !1, le.current = !1);
513
+ const Z = U();
514
+ if (de(), t.gridProps.onColumnReorder) {
515
+ const I = {
516
516
  target: R.current,
517
- columns: Q,
517
+ columns: Z,
518
518
  columnId: d.id,
519
- nativeEvent: r
519
+ nativeEvent: a
520
520
  };
521
- s(t.gridProps.onColumnReorder, b);
521
+ s(t.gridProps.onColumnReorder, I);
522
522
  }
523
- ne(o);
524
- }, A = (e, n, r) => {
525
- const a = typeof t.gridProps.rowReorderable == "object" ? t.gridProps.rowReorderable.enabled : t.gridProps.rowReorderable;
526
- if (r === "forbidden" || !a || !z.current)
523
+ re(o);
524
+ }, A = (e, n, a) => {
525
+ const r = typeof t.gridProps.rowReorderable == "object" ? t.gridProps.rowReorderable.enabled : t.gridProps.rowReorderable;
526
+ if (a === "forbidden" || !r || !z.current)
527
527
  return;
528
528
  const { slicedData: o, dataRef: d } = t, l = (o || d)[n];
529
529
  t.gridProps.onRowReorder && s(t.gridProps.onRowReorder, {
530
530
  draggedDataItems: [z.current],
531
531
  droppedDataItem: l == null ? void 0 : l.dataItem,
532
- dropPosition: r,
532
+ dropPosition: a,
533
533
  nativeEvent: e.originalEvent,
534
534
  dragEvent: e,
535
535
  target: R.current
536
536
  }), z.current = null;
537
- }, mt = (e, n, r) => {
537
+ }, mt = (e, n, a) => {
538
538
  if (t.gridProps.group === void 0)
539
539
  return;
540
- const a = t.gridProps.group.slice();
541
- a.splice(n, 0, ...a.splice(e, 1)), te(a, r);
542
- }, we = (e, n, r) => {
543
- const a = t.columnsRef[e].field;
544
- if (!a)
540
+ const r = t.gridProps.group.slice();
541
+ r.splice(n, 0, ...r.splice(e, 1)), ne(r, a);
542
+ }, ye = (e, n, a) => {
543
+ const r = t.columnsRef[e].field;
544
+ if (!r)
545
545
  return;
546
546
  const o = (t.gridProps.group || []).slice();
547
- o.splice(n, 0, { field: a }), te(o, r);
547
+ o.splice(n, 0, { field: r }), ne(o, a);
548
548
  }, Pt = (e, n) => {
549
- const r = S.current.getCurrentGroupsLength;
550
- we(e, r, n);
551
- }, ae = () => {
549
+ const a = S.current.getCurrentGroupsLength;
550
+ ye(e, a, n);
551
+ }, oe = () => {
552
552
  let e = 0;
553
553
  if (!E.current.colGroupMain)
554
554
  return;
555
555
  const n = E.current.colGroupMain.children;
556
- for (let r = 0; r < n.length; r++) {
557
- const a = n[r].width;
558
- if (!a) {
556
+ for (let a = 0; a < n.length; a++) {
557
+ const r = n[a].width;
558
+ if (!r) {
559
559
  e = 0;
560
560
  break;
561
561
  }
562
- e += parseFloat(a.toString());
562
+ e += parseFloat(r.toString());
563
563
  }
564
564
  e = Math.round(e), G.current && G.current.setWidth(e), L.current && L.current.setWidth(e), x.current && (x.current.style.width = e ? e + "px" : "");
565
565
  }, W = i.useCallback(
566
- (e, n, r, a, o) => {
566
+ (e, n, a, r, o) => {
567
567
  var g;
568
- if (!ht() && !r || !e)
568
+ if (!ht() && !a || !e)
569
569
  return;
570
570
  const d = {
571
571
  type: e,
572
572
  nativeEvent: n,
573
573
  columns: t.columnsRef,
574
574
  dataItemKey: t.gridProps.dataItemKey || "",
575
- dataItem: a,
575
+ dataItem: r,
576
576
  field: o,
577
577
  ...typeof t.gridProps.clipboard != "boolean" ? t.gridProps.clipboard : {},
578
- ...r
578
+ ...a
579
579
  }, l = j(), u = Lt({
580
580
  event: d,
581
581
  data: l,
582
582
  selectedState: (g = t.gridProps.select) != null ? g : {},
583
- previousCopiedItems: Se.current
583
+ previousCopiedItems: ke.current
584
584
  });
585
- e !== he.paste && (Se.current = u.copiedItems), t.gridProps.onClipboard && w && s(t.gridProps.onClipboard, {
585
+ e !== Ie.paste && (ke.current = u.copiedItems), t.gridProps.onClipboard && w && s(t.gridProps.onClipboard, {
586
586
  ...d,
587
587
  ...u
588
588
  });
@@ -596,22 +596,22 @@ const sn = i.createContext(void 0), wn = (t) => {
596
596
  ]
597
597
  ), ht = () => {
598
598
  var o, d, l;
599
- if (!Z)
599
+ if (!p)
600
600
  return !1;
601
- const e = At(v()), n = e ? e.matches(".k-table-td") ? e : (o = v()) == null ? void 0 : o.body : (d = v()) == null ? void 0 : d.body, r = n.closest(".k-grid-container"), a = n && ((l = K.current) == null ? void 0 : l.contains(n));
602
- return !!(n && a && r);
603
- }, bt = (e, n, r, a, o, d, l) => {
604
- ae(), Y.current = !0, ce.current = !0, t.gridProps.onColumnResize && w && s(t.gridProps.onColumnResize, {
601
+ const e = At(v()), n = e ? e.matches(".k-table-td") ? e : (o = v()) == null ? void 0 : o.body : (d = v()) == null ? void 0 : d.body, a = n.closest(".k-grid-container"), r = n && ((l = K.current) == null ? void 0 : l.contains(n));
602
+ return !!(n && r && a);
603
+ }, It = (e, n, a, r, o, d, l) => {
604
+ oe(), Y.current = !0, le.current = !0, t.gridProps.onColumnResize && w && s(t.gridProps.onColumnResize, {
605
605
  columns: U(),
606
- nativeEvent: a,
606
+ nativeEvent: r,
607
607
  targetColumnId: l,
608
608
  index: e,
609
609
  newWidth: n,
610
- oldWidth: r,
610
+ oldWidth: a,
611
611
  end: o,
612
612
  target: R.current
613
- }), o && ne(d);
614
- }, It = () => {
613
+ }), o && re(d);
614
+ }, bt = () => {
615
615
  var e;
616
616
  return {
617
617
  filter: t.gridProps.filter,
@@ -638,71 +638,71 @@ const sn = i.createContext(void 0), wn = (t) => {
638
638
  }
639
639
  e(Rt(n));
640
640
  }, Ct = () => {
641
- var e, n, r;
641
+ var e, n, a;
642
642
  if (F.current && ((e = F.current) == null ? void 0 : e.getElementsByClassName("k-grid-edit-row").length) > 0) {
643
- ue.current = !1, (n = document.activeElement) != null && n.closest(".k-grid-edit-row") ? se.current = document.activeElement : se.current = void 0;
644
- const a = Array.from((r = F.current) == null ? void 0 : r.getElementsByClassName("k-grid-edit-row"));
645
- a.length > Pe.current.length ? J.current = a.filter(
646
- (o) => !Pe.current.includes(o)
647
- )[0] : a.length === 1 && (J.current = a[0], ue.current = !0), Pe.current = a;
643
+ ge.current = !1, (n = document.activeElement) != null && n.closest(".k-grid-edit-row") ? ue.current = document.activeElement : ue.current = void 0;
644
+ const r = Array.from((a = F.current) == null ? void 0 : a.getElementsByClassName("k-grid-edit-row"));
645
+ r.length > he.current.length ? J.current = r.filter(
646
+ (o) => !he.current.includes(o)
647
+ )[0] : r.length === 1 && (J.current = r[0], ge.current = !0), he.current = r;
648
648
  }
649
649
  }, H = () => t.dataRef.filter((e) => e.rowType === "data").map((e) => e.dataItem), j = () => (t.slicedData || t.dataRef).filter((e) => e.rowType === "data").map((e) => e.dataItem), v = () => {
650
650
  var e;
651
- if (Z)
651
+ if (p)
652
652
  return ((e = q()) == null ? void 0 : e.ownerDocument) || document;
653
- }, q = () => K.current, oe = i.useCallback(
653
+ }, q = () => K.current, ie = i.useCallback(
654
654
  (e) => {
655
- var a;
656
- if (!c.current || !((a = c.current) != null && a.container) || t.gridProps.scrollable === "none")
655
+ var r;
656
+ if (!c.current || !((r = c.current) != null && r.container) || t.gridProps.scrollable === "none")
657
657
  return;
658
658
  D.current && D.current.disconnect();
659
- const { rowIndex: n } = e, r = q();
659
+ const { rowIndex: n } = e, a = q();
660
660
  if (t.gridProps.scrollable === "virtual")
661
661
  c.current.askedSkip = n, c.current.container.scroll(
662
662
  0,
663
663
  Math.round(c.current.askedSkip / c.current.total * c.current.container.scrollHeight)
664
664
  );
665
- else if (r) {
666
- const o = n < 1 ? r.querySelector("tbody > tr:nth-child(1)") : r.querySelector(`tbody > tr:nth-child(${n + 1})`);
665
+ else if (a) {
666
+ const o = n < 1 ? a.querySelector("tbody > tr:nth-child(1)") : a.querySelector(`tbody > tr:nth-child(${n + 1})`);
667
667
  o && $.current && ($.current.scrollTop = o.offsetTop);
668
668
  }
669
669
  },
670
670
  [t.gridProps.scrollable]
671
- ), ye = (e) => JSON.stringify(e.map((n) => ({ id: n.id, field: n.field, title: n.title, children: n.children }))), vt = () => ye(Dt) === ye(t.columnsRef), Et = () => {
672
- vt() || ie();
673
- }, wt = (e, n) => {
674
- var r, a;
671
+ ), xe = (e) => JSON.stringify(e.map((n) => ({ id: n.id, field: n.field, title: n.title, children: n.children }))), vt = () => xe(Dt) === xe(t.columnsRef), Et = () => {
672
+ vt() || de();
673
+ }, wt = (e) => {
674
+ var n, a;
675
675
  if (c.current) {
676
- if (c.current.fixedScroll = t.gridProps.fixedScroll || !1, c.current.PageChange = _, c.current.realSkip = t.gridProps.skip || 0, c.current.pageSize = (a = (r = t.gridProps.take) != null ? r : t.gridProps.pageSize) != null ? a : 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 && !n) {
677
- const o = t.gridProps.rowHeight * e;
678
- c.current.containerHeight = ze ? Math.min(Ne, o) : o;
676
+ if (c.current.fixedScroll = t.gridProps.fixedScroll || !1, c.current.PageChange = _, c.current.realSkip = t.gridProps.skip || 0, c.current.pageSize = (a = (n = t.gridProps.take) != null ? n : t.gridProps.pageSize) != null ? a : 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 && !Q) {
677
+ const r = t.gridProps.rowHeight * e;
678
+ c.current.containerHeight = ze ? Math.min(Ne, r) : r;
679
679
  } else
680
680
  c.current.containerHeight = 1533915;
681
681
  if (c.current.containerRef = $, c.current.tableBodyRef = F, c.current.table = x.current, c.current instanceof Oe) {
682
- const { rowHeight: o = 0, detail: d, expandField: l } = t.gridProps;
683
- let { detailRowHeight: u = 0 } = t.gridProps;
684
- u = d && l ? u : o, t.isAllData ? (c.current.total = t.dataRef.length, c.current.rowHeightService = new He(
682
+ const { rowHeight: r = 0, detail: o, expandField: d } = t.gridProps;
683
+ let { detailRowHeight: l = 0 } = t.gridProps;
684
+ l = o && d ? l : r, t.isAllData ? (c.current.total = t.dataRef.length, c.current.rowHeightService = new He(
685
685
  t.dataRef.length,
686
- o,
687
- u,
686
+ r,
687
+ l,
688
688
  t.dataRef
689
- )) : c.current.rowHeightService = new He(e, o, u);
690
- const g = c.current.rowHeightService.totalHeight();
691
- c.current.containerHeight = ze ? Math.min(Ne, g) : g;
689
+ )) : c.current.rowHeightService = new He(e, r, l);
690
+ const u = c.current.rowHeightService.totalHeight();
691
+ c.current.containerHeight = ze ? Math.min(Ne, u) : u;
692
692
  }
693
693
  }
694
- }, xe = i.useCallback(
694
+ }, Se = i.useCallback(
695
695
  (e) => {
696
- const n = { rowIndex: me.current };
697
- e.forEach((r) => {
698
- r.isIntersecting || oe(n);
696
+ const n = { rowIndex: Pe.current };
697
+ e.forEach((a) => {
698
+ a.isIntersecting || ie(n);
699
699
  });
700
700
  },
701
- [oe]
702
- ), ie = () => {
701
+ [ie]
702
+ ), de = () => {
703
703
  t.gridProps.forceUpdate && t.gridProps.forceUpdate();
704
- }, yt = (e) => e.left !== void 0 ? ke !== "rtl" ? { left: e.left, right: e.right } : { left: e.right, right: e.left } : {}, R = i.useRef(null), c = i.useRef(), E = i.useRef(), S = i.useRef(), y = i.useRef(), k = i.useRef(), X = i.useRef(), D = i.useRef(null), F = i.useRef(null), xt = i.useRef(null), $ = i.useRef(null), x = i.useRef(null), de = i.useRef(null), K = i.useRef(null), L = i.useRef(null), G = i.useRef(null), ce = i.useRef(!1), le = i.useRef(!1), J = i.useRef(), se = i.useRef(), ue = i.useRef(!1), Y = i.useRef(!0), ge = i.useRef(0), fe = i.useRef(), me = i.useRef(), Pe = i.useRef([]), Se = i.useRef([]), z = i.useRef(null), St = i.useRef(null), kt = i.useRef(null), ke = Ht(K), Dt = i.useMemo(() => i.Children.toArray(t.gridProps.children), [t.gridProps.children]), h = ee((Te = t.gridProps.selectable) != null ? Te : !!t.gridProps.selectedField), De = Gt((Me = t.gridProps.editable) != null ? Me : !!t.gridProps.editField);
705
- i.useMemo(() => {
704
+ }, yt = (e) => e.left !== void 0 ? De !== "rtl" ? { left: e.left, right: e.right } : { left: e.right, right: e.left } : {}, R = i.useRef(null), c = i.useRef(), E = i.useRef(), S = i.useRef(), y = i.useRef(), k = i.useRef(), X = i.useRef(), D = i.useRef(null), F = i.useRef(null), xt = i.useRef(null), $ = i.useRef(null), x = i.useRef(null), ce = i.useRef(null), K = i.useRef(null), L = i.useRef(null), G = i.useRef(null), le = i.useRef(!1), se = i.useRef(!1), J = i.useRef(), ue = i.useRef(), ge = i.useRef(!1), Y = i.useRef(!0), fe = i.useRef(0), me = i.useRef(), Pe = i.useRef(), he = i.useRef([]), ke = i.useRef([]), z = i.useRef(null), St = i.useRef(null), kt = i.useRef(null), De = Ht(K), Dt = i.useMemo(() => i.Children.toArray(t.gridProps.children), [t.gridProps.children]), Q = t.gridProps.groupable === !0 || typeof t.gridProps.groupable == "object" && t.gridProps.groupable.enabled !== !1, h = te((Te = t.gridProps.selectable) != null ? Te : !!t.gridProps.selectedField), Ke = Gt((Me = t.gridProps.editable) != null ? Me : !!t.gridProps.editField);
705
+ return i.useMemo(() => {
706
706
  T.onConstructor({
707
707
  navigatable: !!t.gridProps.navigatable,
708
708
  contextStateRef: y,
@@ -710,50 +710,50 @@ const sn = i.createContext(void 0), wn = (t) => {
710
710
  idPrefix: t.id
711
711
  });
712
712
  }, []), i.useMemo(() => {
713
- var r;
714
- (r = c.current) == null || r.reset();
715
- const e = t.gridProps.groupable === !0 || typeof t.gridProps.groupable == "object" && t.gridProps.groupable.enabled !== !1, n = t.isFixedVirtualScroll ? Oe : on;
716
- c.current = new n(e || t.gridProps.rowHeight === void 0 || t.gridProps.rowHeight === 0);
713
+ var n;
714
+ (n = c.current) == null || n.reset();
715
+ const e = t.isFixedVirtualScroll ? Oe : on;
716
+ c.current = new e(Q || t.gridProps.rowHeight === void 0 || t.gridProps.rowHeight === 0);
717
717
  }, [
718
718
  t.gridProps.scrollable,
719
719
  t.gridProps.total,
720
720
  t.gridProps.filter,
721
721
  t.gridProps.group,
722
- t.gridProps.groupable,
722
+ Q,
723
723
  t.gridProps.sort,
724
724
  t.gridProps.rowHeight
725
725
  ]), i.useEffect(() => (t.gridProps.clipboard && (X.current = new zt(W), X.current.addEventListeners(v())), () => {
726
726
  X.current && X.current.removeEventListeners(v());
727
- }), [t.gridProps.onClipboard, t.gridProps.clipboard, W, v]), i.useEffect(() => (t.gridProps.columnVirtualization && !window.navigator.userAgent.match(Zt) && (de.current && (de.current.style.display = "block"), x.current && (x.current.style.display = "block")), ae(), Ae(), T.onComponentDidMount({
727
+ }), [t.gridProps.onClipboard, t.gridProps.clipboard, W, v]), i.useEffect(() => (t.gridProps.columnVirtualization && !window.navigator.userAgent.match(Zt) && (ce.current && (ce.current.style.display = "block"), x.current && (x.current.style.display = "block")), oe(), Ae(), T.onComponentDidMount({
728
728
  scope: K.current || void 0,
729
729
  contextStateRef: y,
730
730
  navigationStateRef: k
731
731
  }), () => {
732
- clearTimeout(fe.current);
732
+ clearTimeout(me.current);
733
733
  }), []), i.useEffect(() => {
734
734
  var e;
735
- ae(), Ae(), (e = c.current) != null && e.tableTransform && c.current.table && (c.current.table.style.transform = c.current.tableTransform, c.current.tableTransform = ""), Ct(), T.onComponentDidUpdate({
735
+ oe(), Ae(), (e = c.current) != null && e.tableTransform && c.current.table && (c.current.table.style.transform = c.current.tableTransform, c.current.tableTransform = ""), Ct(), T.onComponentDidUpdate({
736
736
  scope: K.current || void 0,
737
737
  contextStateRef: y,
738
738
  navigationStateRef: k,
739
- focusFirst: le.current,
739
+ focusFirst: se.current,
740
740
  newEditableRow: J.current,
741
- singleEditRow: ue.current,
742
- lastActiveElement: se.current,
741
+ singleEditRow: ge.current,
742
+ lastActiveElement: ue.current,
743
743
  navigatable: t.gridProps.navigatable
744
- }), le.current = !1, J.current = void 0;
744
+ }), se.current = !1, J.current = void 0;
745
745
  }), i.useEffect(() => {
746
- if (Z) {
746
+ if (p) {
747
747
  const e = {
748
748
  rootMargin: "0px",
749
749
  threshold: 0.9
750
750
  };
751
- D.current = window.IntersectionObserver && new window.IntersectionObserver(xe, e) || null;
751
+ D.current = window.IntersectionObserver && new window.IntersectionObserver(Se, e) || null;
752
752
  }
753
- }, [xe]), i.useEffect(() => {
753
+ }, [Se]), i.useEffect(() => {
754
754
  var n;
755
755
  let e;
756
- return Z && window.ResizeObserver && (e = new window.ResizeObserver(Et), e.observe((n = v()) == null ? void 0 : n.body)), () => {
756
+ return p && window.ResizeObserver && (e = new window.ResizeObserver(Et), e.observe((n = v()) == null ? void 0 : n.body)), () => {
757
757
  e == null || e.disconnect();
758
758
  };
759
759
  }, []), i.useImperativeHandle(
@@ -767,16 +767,16 @@ const sn = i.createContext(void 0), wn = (t) => {
767
767
  return U();
768
768
  },
769
769
  scrollIntoView: (e) => {
770
- var a;
771
- if (!((a = c.current) != null && a.container) || t.gridProps.scrollable === "none")
770
+ var r;
771
+ if (!((r = c.current) != null && r.container) || t.gridProps.scrollable === "none")
772
772
  return;
773
773
  const { rowIndex: n } = e;
774
- me.current = n;
775
- const r = q();
776
- if (D.current && r) {
774
+ Pe.current = n;
775
+ const a = q();
776
+ if (D.current && a) {
777
777
  D.current.disconnect();
778
- const o = r.querySelector(`[absolute-row-index="${me.current}"]`);
779
- o ? D.current.observe(o) : oe(e);
778
+ const o = a.querySelector(`[absolute-row-index="${Pe.current}"]`);
779
+ o ? D.current.observe(o) : ie(e);
780
780
  }
781
781
  },
782
782
  fitColumns: (e) => {
@@ -784,18 +784,16 @@ const sn = i.createContext(void 0), wn = (t) => {
784
784
  }
785
785
  })
786
786
  ), i.useImperativeHandle(t.gridRef, () => R.current), i.useMemo(() => {
787
- E.current = new Yt(bt);
787
+ E.current = new Yt(It);
788
788
  }, [t.gridProps.onColumnResize, t.columnsRef]), i.useMemo(() => {
789
- S.current = new Qt(re, mt, we);
789
+ S.current = new Qt(ae, mt, ye);
790
790
  }, [
791
791
  t.gridProps.onColumnReorder,
792
792
  t.gridProps.onGroupChange,
793
793
  t.gridProps.group,
794
794
  t.columnsRef,
795
795
  t.gridProps.groupable
796
- ]), E.current.resizable = t.gridProps.resizable || !1, E.current.columns = t.columnsRef, E.current.columnsState = Ft(t.columnsState);
797
- const Ke = t.gridProps.groupable === !0 || typeof t.gridProps.groupable == "object" && t.gridProps.groupable.enabled !== !1;
798
- return S.current.reorderable = t.gridProps.reorderable || !1, S.current.groupable = Ke, S.current.columns = t.columnsRef, wt(t.total, Ke), /* @__PURE__ */ i.createElement(
796
+ ]), E.current.resizable = t.gridProps.resizable || !1, E.current.columns = t.columnsRef, E.current.columnsState = Ft(t.columnsState), S.current.reorderable = t.gridProps.reorderable || !1, S.current.groupable = Q, S.current.columns = t.columnsRef, wt(t.total), /* @__PURE__ */ i.createElement(
799
797
  sn.Provider,
800
798
  {
801
799
  value: {
@@ -804,21 +802,21 @@ const sn = i.createContext(void 0), wn = (t) => {
804
802
  activeDragRowDataItemRef: z,
805
803
  reorderRowDragTargetRef: St,
806
804
  reorderRowDropTargetRef: kt,
807
- dir: ke,
805
+ dir: De,
808
806
  getCellPositionStyle: yt,
809
807
  dataItemKey: t.gridProps.dataItemKey,
810
808
  columnsState: t.columnsState,
811
- onColumnsStateChange: ne,
812
- groupChange: te,
809
+ onColumnsStateChange: re,
810
+ groupChange: ne,
813
811
  selectionRelease: at,
814
812
  pagerPageChange: ut,
815
813
  onContextMenu: We,
816
814
  rowClick: Je,
817
815
  rowDblClick: Ye,
818
816
  cellClick: Qe,
819
- headerCellClick: ve,
817
+ headerCellClick: Ee,
820
818
  itemChange: et,
821
- sortChange: Ee,
819
+ sortChange: we,
822
820
  filterChange: gt,
823
821
  searchChange: ft,
824
822
  onHeaderSelectionChange: rt,
@@ -836,7 +834,7 @@ const sn = i.createContext(void 0), wn = (t) => {
836
834
  tableBodyElementRef: F,
837
835
  headerElementRef: xt,
838
836
  containerElementRef: $,
839
- headTableElementRef: de,
837
+ headTableElementRef: ce,
840
838
  elementRef: K,
841
839
  footerRef: L,
842
840
  headerRef: G,
@@ -847,12 +845,12 @@ const sn = i.createContext(void 0), wn = (t) => {
847
845
  /* @__PURE__ */ i.createElement(
848
846
  dn,
849
847
  {
850
- show: I.show,
851
- dataItem: I.dataItem,
852
- field: I.field,
848
+ show: b.show,
849
+ dataItem: b.dataItem,
850
+ field: b.field,
853
851
  items: Ve,
854
- offset: I.offset,
855
- onClose: Ie,
852
+ offset: b.offset,
853
+ onClose: Re,
856
854
  onSelect: _e
857
855
  }
858
856
  )