@progress/kendo-react-grid 15.2.0-develop.7 → 15.2.0-develop.8

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