@progress/kendo-react-grid 9.4.0-develop.2 → 9.4.0-develop.21

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