@progress/kendo-react-grid 9.4.0-develop.23 → 9.4.0-develop.3

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