@progress/kendo-react-grid 11.0.0-develop.2 → 11.0.0-develop.20

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