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