@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.
- package/BasePDFExport.js +8 -0
- package/BasePDFExport.mjs +52 -0
- package/Grid.js +1 -1
- package/Grid.mjs +13 -18
- package/GridClientContextReader.js +1 -1
- package/GridClientContextReader.mjs +16 -13
- package/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +459 -449
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +397 -414
- package/GridPdfExportButton.js +8 -0
- package/GridPdfExportButton.mjs +35 -0
- package/GridSearchBox.js +1 -1
- package/GridSearchBox.mjs +1 -1
- package/GridToolbar.js +1 -1
- package/GridToolbar.mjs +15 -20
- package/StatusBar.js +1 -1
- package/StatusBar.mjs +23 -23
- package/VirtualScroll.js +1 -1
- package/VirtualScroll.mjs +65 -107
- package/cells/GridDetailHierarchyCell.js +1 -1
- package/cells/GridDetailHierarchyCell.mjs +4 -4
- package/cells/GridFilterCell.js +1 -1
- package/cells/GridFilterCell.mjs +46 -46
- package/cells/datacell/GridCell.js +9 -0
- package/cells/datacell/GridCell.mjs +23 -0
- package/cells/datacell/GridCellServer.js +8 -0
- package/cells/datacell/GridCellServer.mjs +27 -0
- package/cells/datacell/GridCellServerContainer.js +9 -0
- package/cells/datacell/GridCellServerContainer.mjs +26 -0
- package/cells/datacell/useCellClientTdProps.js +9 -0
- package/cells/datacell/useCellClientTdProps.mjs +30 -0
- package/cells/datacell/utils.js +8 -0
- package/cells/datacell/utils.mjs +47 -0
- package/cells/detailcell/GridDetailCell.js +9 -0
- package/cells/detailcell/GridDetailCell.mjs +18 -0
- package/cells/detailcell/GridDetailCellServer.js +8 -0
- package/cells/detailcell/GridDetailCellServer.mjs +17 -0
- package/{codemods/index.js → cells/detailcell/GridDetailCellServerContainer.js} +2 -1
- package/cells/detailcell/GridDetailCellServerContainer.mjs +19 -0
- package/cells/detailcell/useDetailCellClientTdProps.js +9 -0
- package/cells/detailcell/useDetailCellClientTdProps.mjs +20 -0
- package/cells/detailcell/utils.js +8 -0
- package/cells/detailcell/utils.mjs +20 -0
- package/cells/editcell/GridEditCell.js +9 -0
- package/cells/editcell/GridEditCell.mjs +20 -0
- package/cells/{client → editcell}/GridEditCellEditor.js +1 -1
- package/cells/{client → editcell}/GridEditCellEditor.mjs +1 -1
- package/cells/editcell/GridEditCellServer.js +8 -0
- package/cells/editcell/GridEditCellServer.mjs +32 -0
- package/cells/editcell/GridEditCellServerContainer.js +9 -0
- package/cells/editcell/GridEditCellServerContainer.mjs +26 -0
- package/cells/editcell/useEditCellClientTdProps.js +9 -0
- package/cells/editcell/useEditCellClientTdProps.mjs +21 -0
- package/cells/editcell/utils.js +8 -0
- package/cells/editcell/utils.mjs +29 -0
- package/cells/groupcell/GridGroupCell.js +9 -0
- package/cells/groupcell/GridGroupCell.mjs +22 -0
- package/cells/groupcell/GridGroupCellServer.js +8 -0
- package/cells/groupcell/GridGroupCellServer.mjs +44 -0
- package/cells/groupcell/GridGroupCellServerContainer.js +9 -0
- package/cells/groupcell/GridGroupCellServerContainer.mjs +38 -0
- package/cells/{client → groupcell}/GridGroupCellToggle.js +1 -1
- package/cells/{client → groupcell}/GridGroupCellToggle.mjs +1 -1
- package/cells/groupcell/useGroupCellClientTdProps.js +9 -0
- package/cells/groupcell/useGroupCellClientTdProps.mjs +44 -0
- package/cells/groupcell/utils.js +8 -0
- package/cells/groupcell/utils.mjs +48 -0
- package/cells/hierarchycell/GridHierarchyCell.js +9 -0
- package/cells/hierarchycell/GridHierarchyCell.mjs +19 -0
- package/cells/hierarchycell/GridHierarchyCellServer.js +8 -0
- package/cells/hierarchycell/GridHierarchyCellServer.mjs +32 -0
- package/cells/hierarchycell/GridHierarchyCellServerContainer.js +9 -0
- package/cells/hierarchycell/GridHierarchyCellServerContainer.mjs +26 -0
- package/cells/{client → hierarchycell}/GridHierarchyCellToggle.js +1 -1
- package/cells/{client → hierarchycell}/GridHierarchyCellToggle.mjs +1 -1
- package/cells/hierarchycell/useHierarchyCellClientTdProps.js +9 -0
- package/cells/hierarchycell/useHierarchyCellClientTdProps.mjs +32 -0
- package/cells/hierarchycell/utils.js +8 -0
- package/cells/hierarchycell/utils.mjs +30 -0
- package/cells/hooks.js +9 -0
- package/cells/hooks.mjs +41 -0
- package/cells/rowreordercell/GridRowReorderCell.js +9 -0
- package/cells/rowreordercell/GridRowReorderCell.mjs +19 -0
- package/cells/rowreordercell/GridRowReorderCellServer.js +8 -0
- package/cells/rowreordercell/GridRowReorderCellServer.mjs +18 -0
- package/cells/rowreordercell/GridRowReorderCellServerContainer.js +9 -0
- package/cells/rowreordercell/GridRowReorderCellServerContainer.mjs +19 -0
- package/cells/rowreordercell/useRowReorderCellClientTdProps.js +9 -0
- package/cells/rowreordercell/useRowReorderCellClientTdProps.mjs +26 -0
- package/cells/rowreordercell/utils.js +8 -0
- package/cells/rowreordercell/utils.mjs +30 -0
- package/cells/selectioncell/GridSelectionCell.js +9 -0
- package/cells/selectioncell/GridSelectionCell.mjs +20 -0
- package/cells/{client → selectioncell}/GridSelectionCellInput.js +1 -1
- package/cells/{client → selectioncell}/GridSelectionCellInput.mjs +1 -1
- package/cells/selectioncell/GridSelectionCellServer.js +8 -0
- package/cells/selectioncell/GridSelectionCellServer.mjs +33 -0
- package/cells/selectioncell/GridSelectionCellServerContainer.js +9 -0
- package/cells/selectioncell/GridSelectionCellServerContainer.mjs +26 -0
- package/cells/selectioncell/useSelectionCellClientTdProps.js +9 -0
- package/cells/selectioncell/useSelectionCellClientTdProps.mjs +21 -0
- package/cells/selectioncell/utils.js +8 -0
- package/cells/selectioncell/utils.mjs +25 -0
- package/codemods/v11/cell-render.js +9 -0
- package/codemods/v11/column-cell.js +9 -0
- package/codemods/v11/column-filter-cell.js +9 -0
- package/codemods/v11/column-footer-cell.js +9 -0
- package/codemods/v11/column-header-cell.js +9 -0
- package/codemods/v11/detail-expand-state.js +9 -0
- package/codemods/v11/edit-state.js +9 -0
- package/codemods/v11/filter-cell-render.js +9 -0
- package/codemods/v11/group-expand-state.js +9 -0
- package/codemods/v11/header-cell-render.js +9 -0
- package/codemods/v11/index.js +9 -0
- package/codemods/v11/row-render.js +9 -0
- package/codemods/v11/selection-state.js +9 -0
- package/codemods/v11/utils.js +9 -0
- package/columnMenu/GridColumnMenuCheckboxFilter.js +1 -1
- package/columnMenu/GridColumnMenuCheckboxFilter.mjs +84 -84
- package/columnMenu/GridColumnMenuColumnsChooser.js +1 -1
- package/columnMenu/GridColumnMenuColumnsChooser.mjs +71 -72
- package/columnMenu/GridColumnMenuFilter.js +1 -1
- package/columnMenu/GridColumnMenuFilter.mjs +83 -84
- package/columnMenu/GridColumnMenuFilterCell.js +1 -1
- package/columnMenu/GridColumnMenuFilterCell.mjs +35 -28
- package/columnMenu/GridColumnMenuFilterUI.js +1 -1
- package/columnMenu/GridColumnMenuFilterUI.mjs +1 -1
- package/columnMenu/GridColumnMenuItem.js +1 -1
- package/columnMenu/GridColumnMenuItem.mjs +9 -9
- package/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +62 -49
- package/columnMenu/adaptiveContent/GridAdaptiveCheckboxFilter.js +1 -1
- package/columnMenu/adaptiveContent/GridAdaptiveCheckboxFilter.mjs +40 -34
- package/columnMenu/adaptiveContent/GridAdaptiveColumnChooser.js +1 -1
- package/columnMenu/adaptiveContent/GridAdaptiveColumnChooser.mjs +51 -45
- package/columnMenu/adaptiveContent/GridAdaptiveColumnMenu.js +1 -1
- package/columnMenu/adaptiveContent/GridAdaptiveColumnMenu.mjs +2 -2
- package/columnMenu/adaptiveContent/GridAdaptiveFilterMenu.js +1 -1
- package/columnMenu/adaptiveContent/GridAdaptiveFilterMenu.mjs +40 -33
- package/components/GridContainerElementContainer.js +1 -1
- package/components/GridContainerElementContainer.mjs +1 -1
- package/components/GridDragClue.js +1 -1
- package/components/GridDragClue.mjs +1 -1
- package/components/GridDraggableRowsContainer.js +1 -1
- package/components/GridDraggableRowsContainer.mjs +71 -67
- package/components/GridDropClue.js +1 -1
- package/components/GridDropClue.mjs +1 -1
- package/components/GridEditDialog.js +1 -1
- package/components/GridEditDialog.mjs +1 -1
- package/components/GridElementContainer.js +1 -1
- package/components/GridElementContainer.mjs +1 -1
- package/components/PagerContainer.js +1 -1
- package/components/PagerContainer.mjs +1 -1
- package/components/VirtualScrollHeightContainer.js +1 -1
- package/components/VirtualScrollHeightContainer.mjs +4 -4
- package/components/colGroup/GridColGroup.js +1 -1
- package/components/colGroup/GridColGroup.mjs +1 -1
- package/components/noRecords/GridNoRecordsContainer.js +1 -1
- package/components/noRecords/GridNoRecordsContainer.mjs +1 -1
- package/components/table/GridTable.js +1 -1
- package/components/table/GridTable.mjs +1 -1
- package/components/table/GridTableBody.js +1 -1
- package/components/table/GridTableBody.mjs +1 -1
- package/components/table/GridTableScrollable.js +1 -1
- package/components/table/GridTableScrollable.mjs +16 -15
- package/components/utils.js +1 -1
- package/components/utils.mjs +9 -10
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/footer/Footer.js +1 -1
- package/footer/Footer.mjs +1 -1
- package/footer/FooterCell.js +1 -1
- package/footer/FooterCell.mjs +14 -14
- package/footer/client/FooterCellContainer.js +1 -1
- package/footer/client/FooterCellContainer.mjs +1 -1
- package/header/FilterRow.js +1 -1
- package/header/FilterRow.mjs +42 -46
- package/header/GridHeaderCell.js +1 -1
- package/header/GridHeaderCell.mjs +11 -11
- package/header/GridHeaderSelectionCell.js +1 -1
- package/header/GridHeaderSelectionCell.mjs +14 -14
- package/header/GroupPanel.js +1 -1
- package/header/GroupPanel.mjs +1 -1
- package/header/Header.js +1 -1
- package/header/Header.mjs +1 -1
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +19 -20
- package/header/client/GridFilterCellContainer.js +1 -1
- package/header/client/GridFilterCellContainer.mjs +11 -12
- package/header/client/GridFilterCellElementContainer.js +1 -1
- package/header/client/GridFilterCellElementContainer.mjs +1 -1
- package/header/client/GridHeaderCellContainer.js +1 -1
- package/header/client/GridHeaderCellContainer.mjs +7 -8
- package/header/client/GridHeaderCellElementContainer.js +1 -1
- package/header/client/GridHeaderCellElementContainer.mjs +1 -1
- package/header/client/GridHeaderRowContainer.js +1 -1
- package/header/client/GridHeaderRowContainer.mjs +1 -1
- package/header/client/HeaderCellResizer.js +1 -1
- package/header/client/HeaderCellResizer.mjs +1 -1
- package/header/client/HeaderRowDraggable.js +1 -1
- package/header/client/HeaderRowDraggable.mjs +1 -1
- package/index.d.mts +334 -193
- package/index.d.ts +334 -193
- package/index.js +1 -1
- package/index.mjs +82 -72
- package/messages/index.js +1 -1
- package/messages/index.mjs +94 -76
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +77 -21
- package/paging/GridPagerSettings.js +1 -1
- package/paging/GridPagerSettings.mjs +17 -13
- package/rows/GridRow.js +1 -1
- package/rows/GridRow.mjs +32 -33
- package/toolbar-tools/GridToolbarCheckboxFilter.js +8 -0
- package/toolbar-tools/GridToolbarCheckboxFilter.mjs +312 -0
- package/toolbar-tools/GridToolbarColumnsChooser.js +8 -0
- package/toolbar-tools/GridToolbarColumnsChooser.mjs +178 -0
- package/toolbar-tools/GridToolbarFilter.js +8 -0
- package/toolbar-tools/GridToolbarFilter.mjs +281 -0
- package/toolbar-tools/GridToolbarSort.js +8 -0
- package/toolbar-tools/GridToolbarSort.mjs +146 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarCheckboxFilter.js +9 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarCheckboxFilter.mjs +114 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarColumnChooser.js +9 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarColumnChooser.mjs +89 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarFilter.js +9 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarFilter.mjs +98 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarSort.js +9 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarSort.mjs +68 -0
- package/toolbar-tools/adaptiveContext/GridToolbarAdaptiveContext.js +9 -0
- package/toolbar-tools/adaptiveContext/GridToolbarAdaptiveContext.mjs +17 -0
- package/utils/GridContext.js +9 -0
- package/utils/GridContext.mjs +13 -0
- package/utils/index.js +1 -1
- package/utils/index.mjs +162 -157
- package/utils/premium.js +1 -1
- package/utils/premium.mjs +18 -22
- package/utils/virtualColumns.js +1 -1
- package/utils/virtualColumns.mjs +13 -7
- package/VirtualScrollFixed.js +0 -8
- package/VirtualScrollFixed.mjs +0 -52
- package/cells/GridCell.js +0 -8
- package/cells/GridCell.mjs +0 -52
- package/cells/GridDetailCell.js +0 -8
- package/cells/GridDetailCell.mjs +0 -26
- package/cells/GridEditCell.js +0 -8
- package/cells/GridEditCell.mjs +0 -35
- package/cells/GridGroupCell.js +0 -8
- package/cells/GridGroupCell.mjs +0 -74
- package/cells/GridHierarchyCell.js +0 -8
- package/cells/GridHierarchyCell.mjs +0 -33
- package/cells/GridRowReorderCell.js +0 -8
- package/cells/GridRowReorderCell.mjs +0 -42
- package/cells/GridSelectionCell.js +0 -8
- package/cells/GridSelectionCell.mjs +0 -30
- package/cells/client/DetailCellContainer.js +0 -9
- package/cells/client/DetailCellContainer.mjs +0 -27
- package/cells/client/GridCellContainer.js +0 -9
- package/cells/client/GridCellContainer.mjs +0 -69
- package/cells/client/GridEditCellContainer.js +0 -9
- package/cells/client/GridEditCellContainer.mjs +0 -61
- package/cells/client/GridGroupCellContainer.js +0 -9
- package/cells/client/GridGroupCellContainer.mjs +0 -88
- package/cells/client/GridHierarchyCellContainer.js +0 -9
- package/cells/client/GridHierarchyCellContainer.mjs +0 -64
- package/cells/client/GridRowReorderContainer.js +0 -9
- package/cells/client/GridRowReorderContainer.mjs +0 -31
- package/cells/client/GridSelectionCellContainer.js +0 -9
- package/cells/client/GridSelectionCellContainer.mjs +0 -61
- package/components/GridCustomCellClientContainer.js +0 -9
- package/components/GridCustomCellClientContainer.mjs +0 -34
package/GridClientWrapper.mjs
CHANGED
|
@@ -6,21 +6,22 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import { useAdaptiveModeContext as Nt, canUseDOM as te, getActiveElement as
|
|
11
|
-
import { getSelectionOptions as re, populateClipboardData as
|
|
12
|
-
import { ColumnResize as
|
|
13
|
-
import { CommonDragLogic as
|
|
14
|
-
import { SAFARI_REGEX as
|
|
15
|
-
import { getDefaultHeadContextMenuItems as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
},
|
|
35
|
+
}, ye = () => {
|
|
35
36
|
Ce({});
|
|
36
|
-
}, P =
|
|
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
|
|
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 =
|
|
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
|
|
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:
|
|
52
|
+
rowReorderable: un(t.gridProps.rowReorderable)
|
|
50
53
|
});
|
|
51
|
-
}, [P, t.gridProps.sortable, t.gridProps.selectable, t.gridProps.clipboard]),
|
|
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 ?
|
|
55
|
-
return r === !1 ? void 0 : r === !0 || r === void 0 ?
|
|
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,
|
|
58
|
-
var
|
|
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:
|
|
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 &&
|
|
67
|
-
const r =
|
|
68
|
-
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((
|
|
84
|
-
switch ((
|
|
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
|
|
88
|
-
|
|
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
|
-
|
|
95
|
+
ct(i);
|
|
93
96
|
break;
|
|
94
97
|
case "SelectAllRowsCommand":
|
|
95
|
-
|
|
98
|
+
dt(i);
|
|
99
|
+
break;
|
|
100
|
+
case "ExportPDFCommand":
|
|
101
|
+
oe();
|
|
96
102
|
break;
|
|
97
103
|
case "ClearSelectionCommand":
|
|
98
|
-
|
|
104
|
+
lt(i);
|
|
99
105
|
break;
|
|
100
106
|
case "ReorderRowCommand":
|
|
101
|
-
|
|
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
|
-
|
|
105
|
-
|
|
110
|
+
X(
|
|
111
|
+
Ie.copy,
|
|
106
112
|
e.event.nativeEvent,
|
|
107
113
|
{
|
|
108
|
-
copyHeaders: !((
|
|
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
|
-
|
|
116
|
-
|
|
121
|
+
X(
|
|
122
|
+
Ie.paste,
|
|
117
123
|
e.event.nativeEvent,
|
|
118
124
|
{
|
|
119
|
-
copyHeaders: !((
|
|
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
|
-
|
|
127
|
-
},
|
|
132
|
+
ye();
|
|
133
|
+
}, _ = () => {
|
|
128
134
|
const e = t.columnsRef.filter((n) => n.declarationIndex >= 0 && n.parentIndex === -1);
|
|
129
|
-
return
|
|
130
|
-
},
|
|
131
|
-
if (t.gridProps.onContextMenu &&
|
|
135
|
+
return gn(e);
|
|
136
|
+
}, je = (e, n, o) => {
|
|
137
|
+
if (t.gridProps.onContextMenu && S) {
|
|
132
138
|
const r = {
|
|
133
|
-
target:
|
|
139
|
+
target: v.current,
|
|
134
140
|
syntheticEvent: e,
|
|
135
141
|
nativeEvent: e.nativeEvent,
|
|
136
142
|
dataItem: n,
|
|
137
143
|
field: o
|
|
138
144
|
};
|
|
139
|
-
|
|
145
|
+
l(t.gridProps.onContextMenu, r);
|
|
140
146
|
}
|
|
141
|
-
t.gridProps.contextMenu &&
|
|
147
|
+
t.gridProps.contextMenu && Be({
|
|
142
148
|
event: e,
|
|
143
149
|
dataItem: n,
|
|
144
150
|
field: o
|
|
145
151
|
});
|
|
146
|
-
},
|
|
152
|
+
}, _e = (e) => {
|
|
147
153
|
if (e.target !== e.currentTarget)
|
|
148
154
|
return;
|
|
149
|
-
clearTimeout(he.current),
|
|
150
|
-
const n = e.currentTarget.scrollLeft, o = e.currentTarget.scrollTop
|
|
151
|
-
t.gridProps.columnVirtualization && (!
|
|
152
|
-
|
|
153
|
-
}, 0)), t.gridProps.scrollLeftRef && (t.gridProps.scrollLeftRef.current = n),
|
|
154
|
-
...
|
|
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
|
-
},
|
|
157
|
-
|
|
162
|
+
}, qe = (e) => {
|
|
163
|
+
H.onKeyDown(e, {
|
|
158
164
|
navigatable: t.gridProps.navigatable || !1,
|
|
159
|
-
contextStateRef:
|
|
160
|
-
navigationStateRef:
|
|
161
|
-
onNavigationAction:
|
|
162
|
-
columns:
|
|
163
|
-
}),
|
|
164
|
-
document:
|
|
165
|
-
contextStateRef:
|
|
166
|
-
navigationStateRef:
|
|
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:
|
|
175
|
+
dataItems: C(),
|
|
170
176
|
mode: h.mode,
|
|
171
177
|
cell: h.cell,
|
|
172
178
|
componentId: t.id,
|
|
173
|
-
selectedField:
|
|
174
|
-
...
|
|
179
|
+
selectedField: "",
|
|
180
|
+
...g(e)
|
|
175
181
|
};
|
|
176
|
-
t.gridProps.onKeyDown &&
|
|
177
|
-
},
|
|
178
|
-
|
|
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:
|
|
186
|
+
contextStateRef: D
|
|
181
187
|
});
|
|
182
|
-
},
|
|
183
|
-
if (e.action === "moveToNextPage" &&
|
|
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 &&
|
|
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 &&
|
|
195
|
+
n > 0 && de(n, n - 1, e.event);
|
|
190
196
|
}
|
|
191
|
-
if (e.action === "select" &&
|
|
197
|
+
if (e.action === "select" && ot(e.event), t.gridProps.onNavigationAction && S) {
|
|
192
198
|
const n = {
|
|
193
199
|
focusElement: e.focusElement,
|
|
194
|
-
...
|
|
200
|
+
...g(e.event)
|
|
195
201
|
};
|
|
196
|
-
|
|
202
|
+
l(t.gridProps.onNavigationAction, n);
|
|
197
203
|
}
|
|
198
|
-
},
|
|
199
|
-
t.gridProps.onRowClick && e.target.nodeName === "TD" &&
|
|
204
|
+
}, Je = (e, n) => {
|
|
205
|
+
t.gridProps.onRowClick && e.target.nodeName === "TD" && l(t.gridProps.onRowClick, {
|
|
200
206
|
dataItem: n,
|
|
201
|
-
...
|
|
207
|
+
...g(e)
|
|
202
208
|
});
|
|
203
|
-
},
|
|
204
|
-
t.gridProps.onRowDoubleClick && e.target.nodeName === "TD" &&
|
|
209
|
+
}, Ye = (e, n) => {
|
|
210
|
+
t.gridProps.onRowDoubleClick && e.target.nodeName === "TD" && l(t.gridProps.onRowDoubleClick, {
|
|
205
211
|
dataItem: n,
|
|
206
|
-
...
|
|
212
|
+
...g(e)
|
|
207
213
|
});
|
|
208
|
-
},
|
|
209
|
-
t.gridProps.onItemChange &&
|
|
210
|
-
...
|
|
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
|
-
},
|
|
216
|
-
t.gridProps.onItemChange && t.gridProps.onEditChange &&
|
|
221
|
+
}, Ze = (e) => {
|
|
222
|
+
t.gridProps.onItemChange && t.gridProps.onEditChange && l(t.gridProps.onEditChange, {
|
|
217
223
|
edit: {},
|
|
218
|
-
...
|
|
224
|
+
...g(e.syntheticEvent)
|
|
219
225
|
});
|
|
220
|
-
},
|
|
221
|
-
if (
|
|
222
|
-
const r =
|
|
223
|
-
type:
|
|
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 &&
|
|
232
|
+
t.gridProps.onEditChange && l(t.gridProps.onEditChange, {
|
|
227
233
|
edit: r,
|
|
228
|
-
...
|
|
234
|
+
...g(e)
|
|
229
235
|
});
|
|
230
236
|
}
|
|
231
|
-
},
|
|
237
|
+
}, et = (e, n) => {
|
|
232
238
|
var r;
|
|
233
|
-
if (
|
|
234
|
-
const
|
|
235
|
-
t.gridProps.onDetailExpandChange &&
|
|
236
|
-
...
|
|
237
|
-
detailExpand:
|
|
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
|
-
},
|
|
246
|
+
}, tt = (e, n) => {
|
|
241
247
|
var r;
|
|
242
|
-
const o =
|
|
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
|
|
247
|
-
t.gridProps.onGroupExpandChange &&
|
|
248
|
-
...
|
|
249
|
-
groupExpand:
|
|
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
|
-
},
|
|
253
|
-
const { allowUnsort: r, mode:
|
|
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((
|
|
257
|
-
|
|
258
|
-
},
|
|
259
|
-
|
|
260
|
-
|
|
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
|
-
},
|
|
272
|
+
}, rt = (e) => {
|
|
285
273
|
var n;
|
|
286
274
|
if (t.gridProps.onSelectionChange && h.enabled) {
|
|
287
|
-
const { event: o, dataItem: r, dataIndex:
|
|
288
|
-
...
|
|
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:
|
|
293
|
-
endRowIndex:
|
|
294
|
-
dataItems:
|
|
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:
|
|
291
|
+
selectedField: ""
|
|
304
292
|
};
|
|
305
|
-
|
|
306
|
-
...
|
|
307
|
-
select: t.gridProps.dataItemKey ?
|
|
308
|
-
event:
|
|
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
|
-
},
|
|
315
|
-
var
|
|
316
|
-
if (
|
|
302
|
+
}, ot = (e) => {
|
|
303
|
+
var u, m;
|
|
304
|
+
if (!h.enabled || !t.gridProps.dataItemKey)
|
|
317
305
|
return;
|
|
318
306
|
const n = {
|
|
319
|
-
dataItems:
|
|
307
|
+
dataItems: C(),
|
|
320
308
|
mode: h.mode,
|
|
321
309
|
cell: h.cell,
|
|
322
310
|
componentId: t.id,
|
|
323
|
-
selectedField:
|
|
324
|
-
...
|
|
325
|
-
}, o =
|
|
311
|
+
selectedField: "",
|
|
312
|
+
...g(e)
|
|
313
|
+
}, o = en({
|
|
326
314
|
event: n,
|
|
327
|
-
selectedState: (
|
|
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,
|
|
333
|
-
if (
|
|
334
|
-
const
|
|
335
|
-
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:
|
|
339
|
-
startRowIndex:
|
|
340
|
-
startColIndex:
|
|
341
|
-
startDataItem:
|
|
342
|
-
endDataItem:
|
|
343
|
-
endRowIndex:
|
|
344
|
-
endColIndex:
|
|
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
|
-
},
|
|
353
|
-
var n;
|
|
340
|
+
}, it = (e) => {
|
|
354
341
|
if (t.gridProps.onHeaderSelectionChange && h.enabled) {
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
select: e.syntheticEvent.target.checked ?
|
|
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:
|
|
362
|
-
dataItems:
|
|
363
|
-
selectedField: (n = t.gridProps.selectedField) != null ? n : ""
|
|
348
|
+
target: v.current,
|
|
349
|
+
dataItems: n
|
|
364
350
|
});
|
|
365
351
|
}
|
|
366
|
-
},
|
|
367
|
-
t.gridProps.onSelectionChange && h.enabled &&
|
|
352
|
+
}, q = (e, n) => {
|
|
353
|
+
t.gridProps.onSelectionChange && h.enabled && l(t.gridProps.onSelectionChange, {
|
|
368
354
|
...e,
|
|
369
355
|
select: n
|
|
370
356
|
});
|
|
371
|
-
},
|
|
357
|
+
}, at = (e) => {
|
|
372
358
|
var n;
|
|
373
359
|
if (t.gridProps.onSelectionChange && h.enabled) {
|
|
374
|
-
const o =
|
|
360
|
+
const o = C()[e.startRowIndex], r = C()[e.endRowIndex], i = {
|
|
375
361
|
syntheticEvent: void 0,
|
|
376
|
-
target:
|
|
377
|
-
selectedField:
|
|
362
|
+
target: v.current,
|
|
363
|
+
selectedField: "",
|
|
378
364
|
componentId: t.id,
|
|
379
|
-
dataItems:
|
|
365
|
+
dataItems: C(),
|
|
380
366
|
dataItem: null,
|
|
381
367
|
startDataItem: o,
|
|
382
368
|
endDataItem: r,
|
|
383
369
|
...e
|
|
384
|
-
}, d =
|
|
385
|
-
event:
|
|
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
|
-
|
|
377
|
+
q(i, d);
|
|
392
378
|
}
|
|
393
|
-
},
|
|
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 = {},
|
|
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
|
|
406
|
-
r[
|
|
407
|
-
}),
|
|
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
|
-
},
|
|
395
|
+
}, ct = (e) => {
|
|
410
396
|
if (t.gridProps.onSelectionChange && h.enabled) {
|
|
411
|
-
const o = ne(t.gridProps.dataItemKey)(e.dataItem), r = 0,
|
|
412
|
-
(
|
|
413
|
-
),
|
|
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:
|
|
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,
|
|
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
|
-
},
|
|
425
|
-
t.gridProps.onSelectionChange && h.enabled &&
|
|
426
|
-
},
|
|
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
|
|
430
|
-
|
|
431
|
-
} else d &&
|
|
432
|
-
...
|
|
433
|
-
targetEvent:
|
|
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
|
-
...
|
|
422
|
+
...yt(),
|
|
436
423
|
...o
|
|
437
424
|
}
|
|
438
425
|
});
|
|
439
|
-
},
|
|
440
|
-
|
|
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
|
-
},
|
|
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
|
|
452
|
-
const n = (
|
|
453
|
-
o
|
|
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
|
-
|
|
456
|
-
|
|
457
|
-
|
|
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.
|
|
457
|
+
{ sort: e, ...y && !t.gridProps.pageable ? { skip: 0 } : {} },
|
|
465
458
|
n
|
|
466
459
|
);
|
|
467
|
-
},
|
|
468
|
-
|
|
460
|
+
}, ht = (e, n) => {
|
|
461
|
+
G(
|
|
469
462
|
t.gridProps.onFilterChange,
|
|
470
463
|
{ filter: e },
|
|
471
|
-
{ filter: e
|
|
464
|
+
{ filter: e, skip: 0 },
|
|
472
465
|
n
|
|
473
466
|
);
|
|
474
|
-
},
|
|
475
|
-
const n = t.gridProps.searchFields || t.columnsRef.map((
|
|
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((
|
|
470
|
+
filters: n.filter((i) => i !== void 0).map((i) => {
|
|
478
471
|
var d;
|
|
479
|
-
return typeof
|
|
472
|
+
return typeof i == "string" ? { field: i, value: o, operator: "contains" } : {
|
|
480
473
|
value: o,
|
|
481
|
-
operator: (d =
|
|
482
|
-
field:
|
|
483
|
-
ignoreCase:
|
|
474
|
+
operator: (d = i.operator) != null ? d : "contains",
|
|
475
|
+
field: i.field,
|
|
476
|
+
ignoreCase: i.ignoreCase
|
|
484
477
|
};
|
|
485
478
|
})
|
|
486
479
|
};
|
|
487
|
-
|
|
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 = (
|
|
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
|
-
|
|
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:
|
|
506
|
+
target: v.current,
|
|
507
507
|
columnsState: e
|
|
508
508
|
};
|
|
509
|
-
|
|
509
|
+
l(t.gridProps.onColumnsStateChange, n);
|
|
510
510
|
}
|
|
511
|
-
},
|
|
512
|
-
const { columnsRef: r, columnsState:
|
|
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
|
-
|
|
515
|
-
while (
|
|
516
|
-
return
|
|
517
|
-
}, m = r.splice(e,
|
|
518
|
-
r.splice(e < n ?
|
|
519
|
-
|
|
520
|
-
const
|
|
521
|
-
|
|
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
|
|
524
|
-
|
|
525
|
-
const ee =
|
|
526
|
-
if (
|
|
527
|
-
const
|
|
528
|
-
target:
|
|
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
|
-
|
|
533
|
+
l(t.gridProps.onColumnReorder, R);
|
|
534
534
|
}
|
|
535
|
-
ae(
|
|
536
|
-
},
|
|
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 || !
|
|
538
|
+
if (o === "forbidden" || !r || !U.current)
|
|
539
539
|
return;
|
|
540
|
-
const
|
|
541
|
-
t.gridProps.onRowReorder &&
|
|
542
|
-
draggedDataItems: [
|
|
543
|
-
droppedDataItem:
|
|
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:
|
|
548
|
-
}),
|
|
549
|
-
},
|
|
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)),
|
|
554
|
-
},
|
|
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
|
|
559
|
-
|
|
560
|
-
},
|
|
561
|
-
const o =
|
|
562
|
-
|
|
563
|
-
},
|
|
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 (!
|
|
565
|
+
if (!w.current.colGroupMain)
|
|
566
566
|
return;
|
|
567
|
-
const n =
|
|
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),
|
|
577
|
-
},
|
|
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.
|
|
580
|
-
},
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
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:
|
|
600
|
+
field: i,
|
|
592
601
|
...typeof t.gridProps.clipboard != "boolean" ? t.gridProps.clipboard : {},
|
|
593
602
|
...o
|
|
594
|
-
},
|
|
603
|
+
}, c = C(), s = jt({
|
|
595
604
|
event: d,
|
|
596
|
-
data:
|
|
597
|
-
selectedState: (
|
|
598
|
-
previousCopiedItems:
|
|
605
|
+
data: c,
|
|
606
|
+
selectedState: (u = t.gridProps.select) != null ? u : {},
|
|
607
|
+
previousCopiedItems: Le.current
|
|
599
608
|
});
|
|
600
|
-
e !==
|
|
609
|
+
e !== Ie.paste && (Le.current = s.copiedItems), t.gridProps.onClipboard && S && l(t.gridProps.onClipboard, {
|
|
601
610
|
...d,
|
|
602
|
-
...
|
|
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
|
-
),
|
|
613
|
-
var
|
|
621
|
+
), Et = () => {
|
|
622
|
+
var i, d, c;
|
|
614
623
|
if (!te)
|
|
615
624
|
return !1;
|
|
616
|
-
const e =
|
|
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
|
-
},
|
|
619
|
-
|
|
620
|
-
columns:
|
|
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:
|
|
631
|
+
targetColumnId: c,
|
|
623
632
|
index: e,
|
|
624
633
|
newWidth: n,
|
|
625
634
|
oldWidth: o,
|
|
626
|
-
end:
|
|
627
|
-
target:
|
|
628
|
-
}),
|
|
629
|
-
},
|
|
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
|
-
},
|
|
647
|
+
}, g = (e) => ({
|
|
639
648
|
nativeEvent: e && e.nativeEvent,
|
|
640
649
|
syntheticEvent: e,
|
|
641
|
-
target:
|
|
642
|
-
}),
|
|
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
|
-
}),
|
|
658
|
+
}), l = (e, n) => {
|
|
650
659
|
if (t.gridProps.isClient) {
|
|
651
660
|
e(n);
|
|
652
661
|
return;
|
|
653
662
|
}
|
|
654
|
-
e(
|
|
663
|
+
e(St(n));
|
|
655
664
|
}, xt = () => {
|
|
656
665
|
var e, n, o;
|
|
657
|
-
if (
|
|
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 =
|
|
660
|
-
r.length > be.current.length ?
|
|
661
|
-
(
|
|
662
|
-
)[0] : r.length === 1 && (
|
|
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
|
-
},
|
|
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 =
|
|
668
|
-
},
|
|
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 (!
|
|
679
|
+
var r, i;
|
|
680
|
+
if (!f.current || !((r = f.current) != null && r.container) || t.gridProps.scrollable === "none")
|
|
672
681
|
return;
|
|
673
|
-
|
|
674
|
-
const { rowIndex: n } = e, o =
|
|
675
|
-
if (
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
);
|
|
680
|
-
|
|
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
|
-
),
|
|
687
|
-
|
|
688
|
-
},
|
|
689
|
-
var
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
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:
|
|
701
|
+
const n = { rowIndex: Re.current };
|
|
712
702
|
e.forEach((o) => {
|
|
713
|
-
o.isIntersecting ||
|
|
703
|
+
o.isIntersecting || le(n);
|
|
714
704
|
});
|
|
715
705
|
},
|
|
716
|
-
[
|
|
717
|
-
),
|
|
706
|
+
[le]
|
|
707
|
+
), z = () => {
|
|
718
708
|
t.gridProps.forceUpdate && t.gridProps.forceUpdate();
|
|
719
|
-
},
|
|
720
|
-
return
|
|
721
|
-
|
|
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:
|
|
724
|
-
navigationStateRef:
|
|
713
|
+
contextStateRef: D,
|
|
714
|
+
navigationStateRef: M,
|
|
725
715
|
idPrefix: t.id
|
|
726
|
-
});
|
|
727
|
-
}, []),
|
|
728
|
-
var
|
|
729
|
-
(
|
|
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
|
-
|
|
725
|
+
ze,
|
|
738
726
|
t.gridProps.sort,
|
|
739
727
|
t.gridProps.rowHeight
|
|
740
|
-
]),
|
|
741
|
-
|
|
742
|
-
}), [t.gridProps.onClipboard, t.gridProps.clipboard,
|
|
743
|
-
scope:
|
|
744
|
-
contextStateRef:
|
|
745
|
-
navigationStateRef:
|
|
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
|
-
}), []),
|
|
736
|
+
}), []), a.useEffect(() => {
|
|
749
737
|
var e;
|
|
750
|
-
|
|
751
|
-
scope:
|
|
752
|
-
contextStateRef:
|
|
753
|
-
navigationStateRef:
|
|
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:
|
|
743
|
+
newEditableRow: Q.current,
|
|
756
744
|
singleEditRow: me.current,
|
|
757
745
|
lastActiveElement: fe.current,
|
|
758
746
|
navigatable: t.gridProps.navigatable
|
|
759
|
-
}), ge.current = !1,
|
|
760
|
-
}),
|
|
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
|
-
|
|
754
|
+
T.current = window.IntersectionObserver && new window.IntersectionObserver(He, e) || null;
|
|
767
755
|
}
|
|
768
|
-
}, [
|
|
756
|
+
}, [He]), a.useEffect(() => {
|
|
769
757
|
var n;
|
|
770
758
|
let e;
|
|
771
|
-
return te && window.ResizeObserver && (e = new window.ResizeObserver(
|
|
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
|
-
}, []),
|
|
775
|
-
|
|
764
|
+
}, []), a.useImperativeHandle(
|
|
765
|
+
v,
|
|
776
766
|
() => ({
|
|
777
767
|
get element() {
|
|
778
|
-
return
|
|
768
|
+
return J();
|
|
779
769
|
},
|
|
780
770
|
props: t.gridProps,
|
|
781
771
|
get columns() {
|
|
782
|
-
return
|
|
772
|
+
return _();
|
|
783
773
|
},
|
|
784
774
|
scrollIntoView: (e) => {
|
|
785
775
|
var r;
|
|
786
|
-
if (!((r =
|
|
776
|
+
if (!((r = f.current) != null && r.container) || t.gridProps.scrollable === "none")
|
|
787
777
|
return;
|
|
788
778
|
const { rowIndex: n } = e;
|
|
789
|
-
|
|
790
|
-
const o =
|
|
791
|
-
if (
|
|
792
|
-
|
|
793
|
-
const
|
|
794
|
-
|
|
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
|
-
|
|
799
|
-
}
|
|
788
|
+
w.current.dblClickHandler(null, e);
|
|
789
|
+
},
|
|
790
|
+
exportAsPdf: oe
|
|
800
791
|
})
|
|
801
|
-
),
|
|
802
|
-
|
|
803
|
-
}, [t.gridProps.onColumnResize, t.columnsRef]),
|
|
804
|
-
|
|
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
|
-
]),
|
|
812
|
-
|
|
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:
|
|
816
|
-
rowReorder:
|
|
817
|
-
activeDragRowDataItemRef:
|
|
818
|
-
reorderRowDragTargetRef:
|
|
819
|
-
reorderRowDropTargetRef:
|
|
820
|
-
dir:
|
|
821
|
-
getCellPositionStyle:
|
|
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:
|
|
826
|
-
selectionRelease:
|
|
827
|
-
pagerPageChange:
|
|
828
|
-
onContextMenu:
|
|
829
|
-
rowClick:
|
|
830
|
-
rowDblClick:
|
|
831
|
-
cellClick:
|
|
832
|
-
headerCellClick:
|
|
833
|
-
itemChange:
|
|
834
|
-
onDialogEditCancel:
|
|
835
|
-
onDialogEditSubmit:
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
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:
|
|
850
|
-
dispatchGroupExpand:
|
|
851
|
-
columnResizeRef:
|
|
852
|
-
dragLogicRef:
|
|
853
|
-
navigationStateRef:
|
|
854
|
-
tableElementRef:
|
|
855
|
-
tableBodyElementRef:
|
|
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:
|
|
857
|
+
containerElementRef: F,
|
|
858
858
|
headTableElementRef: se,
|
|
859
|
-
elementRef:
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
859
|
+
elementRef: K,
|
|
860
|
+
virtualScrollHeightContainerRef: Ge,
|
|
861
|
+
footerRef: O,
|
|
862
|
+
headerRef: N,
|
|
863
|
+
vsRef: f
|
|
863
864
|
}
|
|
864
865
|
},
|
|
865
|
-
/* @__PURE__ */
|
|
866
|
-
/* @__PURE__ */
|
|
867
|
-
|
|
866
|
+
/* @__PURE__ */ a.createElement($t.Provider, { value: D.current }, t.children),
|
|
867
|
+
/* @__PURE__ */ a.createElement(
|
|
868
|
+
Rn,
|
|
868
869
|
{
|
|
869
|
-
show: b.show && (
|
|
870
|
+
show: b.show && (j == null ? void 0 : j.length),
|
|
870
871
|
dataItem: b.dataItem,
|
|
871
872
|
field: b.field,
|
|
872
|
-
items:
|
|
873
|
+
items: j,
|
|
873
874
|
offset: b.offset,
|
|
874
|
-
onClose:
|
|
875
|
-
onSelect:
|
|
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
|
-
|
|
882
|
-
In as GridContext
|
|
892
|
+
Fn as GridClientWrapper
|
|
883
893
|
};
|