@progress/kendo-react-grid 6.1.1 → 7.0.0-develop.1
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/{dist/es/Grid.d.ts → Grid.d.ts} +5 -1
- package/{dist/npm/GridColumn.d.ts → GridColumn.d.ts} +4 -0
- package/{dist/npm/GridNoRecords.d.ts → GridNoRecords.d.ts} +4 -0
- package/{dist/npm/GridToolbar.d.ts → GridToolbar.d.ts} +5 -1
- package/LICENSE.md +1 -1
- package/ScrollMode.d.ts +5 -0
- package/{dist/es/StatusBar.d.ts → StatusBar.d.ts} +4 -0
- package/{dist/npm/VirtualScroll.d.ts → VirtualScroll.d.ts} +4 -0
- package/{dist/es/VirtualScrollFixed.d.ts → VirtualScrollFixed.d.ts} +4 -0
- package/cells/GridCell.d.ts +6 -0
- package/{dist/es/cells → cells}/GridDetailCell.d.ts +5 -1
- package/cells/GridDetailHierarchyCell.d.ts +10 -0
- package/cells/GridEditCell.d.ts +9 -0
- package/cells/GridFilterCell.d.ts +20 -0
- package/cells/GridGroupCell.d.ts +9 -0
- package/cells/GridHierarchyCell.d.ts +9 -0
- package/cells/GridSelectionCell.d.ts +9 -0
- package/{dist/npm/columnMenu → columnMenu}/GridColumnMenuCheckboxFilter.d.ts +5 -1
- package/{dist/npm/columnMenu → columnMenu}/GridColumnMenuColumnsList.d.ts +4 -0
- package/{dist/npm/columnMenu → columnMenu}/GridColumnMenuFilter.d.ts +5 -1
- package/{dist/npm/columnMenu → columnMenu}/GridColumnMenuFilterCell.d.ts +5 -1
- package/columnMenu/GridColumnMenuFilterUI.d.ts +12 -0
- package/{dist/es/columnMenu → columnMenu}/GridColumnMenuGroup.d.ts +5 -1
- package/{dist/es/columnMenu → columnMenu}/GridColumnMenuItem.d.ts +5 -1
- package/{dist/es/columnMenu → columnMenu}/GridColumnMenuItemContent.d.ts +5 -1
- package/{dist/es/columnMenu → columnMenu}/GridColumnMenuItemGroup.d.ts +5 -1
- package/{dist/es/columnMenu → columnMenu}/GridColumnMenuSort.d.ts +5 -1
- package/{dist/npm/columnMenu → columnMenu}/GridColumnMenuWrapper.d.ts +5 -1
- package/{dist/es/constants → constants}/index.d.ts +4 -0
- package/dist/cdn/js/kendo-react-grid.js +5 -1
- package/{dist/npm/drag → drag}/ColumnDraggable.d.ts +5 -1
- package/{dist/es/drag → drag}/ColumnResize.d.ts +4 -0
- package/{dist/es/drag → drag}/CommonDragLogic.d.ts +5 -1
- package/{dist/npm/drag → drag}/GroupingIndicator.d.ts +5 -1
- package/{dist/es/filterCommon.d.ts → filterCommon.d.ts} +5 -1
- package/{dist/npm/footer → footer}/Footer.d.ts +5 -1
- package/{dist/npm/footer → footer}/FooterRow.d.ts +5 -1
- package/{dist/npm/header → header}/FilterRow.d.ts +5 -1
- package/{dist/npm/header → header}/GridHeaderCell.d.ts +5 -1
- package/header/GridHeaderSelectionCell.d.ts +13 -0
- package/{dist/npm/header → header}/GroupPanel.d.ts +5 -1
- package/{dist/es/header → header}/Header.d.ts +5 -1
- package/{dist/npm/header → header}/HeaderRow.d.ts +6 -2
- package/{dist/es/main.d.ts → index.d.ts} +31 -27
- package/index.js +5 -0
- package/index.mjs +3814 -0
- package/{dist/npm/interfaces → interfaces}/GridCellProps.d.ts +4 -1
- package/{dist/es/interfaces → interfaces}/GridCellsSettings.d.ts +4 -0
- package/interfaces/GridColumnMenuBaseProps.d.ts +18 -0
- package/{dist/es/interfaces → interfaces}/GridColumnMenuColumnProps.d.ts +4 -0
- package/{dist/es/interfaces → interfaces}/GridColumnMenuFilterBaseProps.d.ts +4 -1
- package/{dist/es/interfaces → interfaces}/GridColumnMenuFilterUIProps.d.ts +4 -0
- package/{dist/npm/interfaces → interfaces}/GridColumnMenuGroupBaseProps.d.ts +4 -1
- package/{dist/es/interfaces → interfaces}/GridColumnMenuProps.d.ts +4 -0
- package/{dist/npm/interfaces → interfaces}/GridColumnMenuSortBaseProps.d.ts +4 -1
- package/{dist/es/interfaces → interfaces}/GridColumnProps.d.ts +4 -0
- package/interfaces/GridDetailRowProps.d.ts +17 -0
- package/{dist/npm/interfaces → interfaces}/GridFilterCellProps.d.ts +4 -1
- package/interfaces/GridFilterOperator.d.ts +10 -0
- package/{dist/es/interfaces → interfaces}/GridFilterOperators.d.ts +4 -0
- package/{dist/npm/interfaces → interfaces}/GridFooterCellProps.d.ts +4 -1
- package/{dist/es/interfaces → interfaces}/GridGroupableSettings.d.ts +4 -0
- package/{dist/npm/interfaces → interfaces}/GridHeaderCellProps.d.ts +4 -1
- package/interfaces/GridNoRecordsProps.d.ts +13 -0
- package/{dist/npm/interfaces → interfaces}/GridProps.d.ts +4 -0
- package/{dist/es/interfaces → interfaces}/GridRowProps.d.ts +4 -1
- package/interfaces/GridRowType.d.ts +13 -0
- package/{dist/npm/interfaces → interfaces}/GridSelectableSettings.d.ts +5 -1
- package/interfaces/GridSortSettings.d.ts +17 -0
- package/{dist/es/interfaces → interfaces}/GridToolbarProps.d.ts +4 -1
- package/{dist/es/interfaces → interfaces}/VirtualScrollInterface.d.ts +4 -0
- package/{dist/npm/interfaces → interfaces}/events.d.ts +4 -1
- package/{dist/npm/messages → messages}/index.d.ts +4 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +36 -59
- package/{dist/es/paging → paging}/GridPagerSettings.d.ts +6 -2
- package/paging/Page.d.ts +17 -0
- package/{dist/npm/rows → rows}/GridDetailRow.d.ts +4 -0
- package/rows/GridRow.d.ts +15 -0
- package/{dist/es/utils → utils}/index.d.ts +11 -7
- package/about.md +0 -3
- package/dist/es/Grid.js +0 -1042
- package/dist/es/GridColumn.d.ts +0 -24
- package/dist/es/GridColumn.js +0 -54
- package/dist/es/GridNoRecords.d.ts +0 -36
- package/dist/es/GridNoRecords.js +0 -63
- package/dist/es/GridToolbar.d.ts +0 -50
- package/dist/es/GridToolbar.js +0 -78
- package/dist/es/ScrollMode.d.ts +0 -1
- package/dist/es/ScrollMode.js +0 -1
- package/dist/es/StatusBar.js +0 -109
- package/dist/es/VirtualScroll.d.ts +0 -47
- package/dist/es/VirtualScroll.js +0 -243
- package/dist/es/VirtualScrollFixed.js +0 -153
- package/dist/es/cells/GridCell.d.ts +0 -3
- package/dist/es/cells/GridCell.js +0 -59
- package/dist/es/cells/GridDetailCell.js +0 -25
- package/dist/es/cells/GridDetailHierarchyCell.d.ts +0 -7
- package/dist/es/cells/GridDetailHierarchyCell.js +0 -18
- package/dist/es/cells/GridEditCell.d.ts +0 -6
- package/dist/es/cells/GridEditCell.js +0 -96
- package/dist/es/cells/GridFilterCell.d.ts +0 -16
- package/dist/es/cells/GridFilterCell.js +0 -102
- package/dist/es/cells/GridGroupCell.d.ts +0 -6
- package/dist/es/cells/GridGroupCell.js +0 -114
- package/dist/es/cells/GridHierarchyCell.d.ts +0 -6
- package/dist/es/cells/GridHierarchyCell.js +0 -77
- package/dist/es/cells/GridSelectionCell.d.ts +0 -6
- package/dist/es/cells/GridSelectionCell.js +0 -44
- package/dist/es/columnMenu/GridColumnMenuCheckboxFilter.d.ts +0 -118
- package/dist/es/columnMenu/GridColumnMenuCheckboxFilter.js +0 -328
- package/dist/es/columnMenu/GridColumnMenuColumnsList.d.ts +0 -27
- package/dist/es/columnMenu/GridColumnMenuColumnsList.js +0 -57
- package/dist/es/columnMenu/GridColumnMenuFilter.d.ts +0 -161
- package/dist/es/columnMenu/GridColumnMenuFilter.js +0 -377
- package/dist/es/columnMenu/GridColumnMenuFilterCell.d.ts +0 -33
- package/dist/es/columnMenu/GridColumnMenuFilterCell.js +0 -72
- package/dist/es/columnMenu/GridColumnMenuFilterUI.d.ts +0 -8
- package/dist/es/columnMenu/GridColumnMenuFilterUI.js +0 -48
- package/dist/es/columnMenu/GridColumnMenuGroup.js +0 -125
- package/dist/es/columnMenu/GridColumnMenuItem.js +0 -37
- package/dist/es/columnMenu/GridColumnMenuItemContent.js +0 -36
- package/dist/es/columnMenu/GridColumnMenuItemGroup.js +0 -35
- package/dist/es/columnMenu/GridColumnMenuSort.js +0 -189
- package/dist/es/columnMenu/GridColumnMenuWrapper.d.ts +0 -45
- package/dist/es/columnMenu/GridColumnMenuWrapper.js +0 -120
- package/dist/es/constants/index.js +0 -7
- package/dist/es/drag/ColumnDraggable.d.ts +0 -34
- package/dist/es/drag/ColumnDraggable.js +0 -62
- package/dist/es/drag/ColumnResize.js +0 -234
- package/dist/es/drag/CommonDragLogic.js +0 -209
- package/dist/es/drag/GroupingIndicator.d.ts +0 -37
- package/dist/es/drag/GroupingIndicator.js +0 -107
- package/dist/es/filterCommon.js +0 -165
- package/dist/es/footer/Footer.d.ts +0 -34
- package/dist/es/footer/Footer.js +0 -70
- package/dist/es/footer/FooterRow.d.ts +0 -21
- package/dist/es/footer/FooterRow.js +0 -75
- package/dist/es/header/FilterRow.d.ts +0 -34
- package/dist/es/header/FilterRow.js +0 -139
- package/dist/es/header/GridHeaderCell.d.ts +0 -52
- package/dist/es/header/GridHeaderCell.js +0 -101
- package/dist/es/header/GridHeaderSelectionCell.d.ts +0 -9
- package/dist/es/header/GridHeaderSelectionCell.js +0 -59
- package/dist/es/header/GroupPanel.d.ts +0 -22
- package/dist/es/header/GroupPanel.js +0 -57
- package/dist/es/header/Header.js +0 -112
- package/dist/es/header/HeaderRow.d.ts +0 -47
- package/dist/es/header/HeaderRow.js +0 -180
- package/dist/es/interfaces/GridCellProps.d.ts +0 -70
- package/dist/es/interfaces/GridCellProps.js +0 -2
- package/dist/es/interfaces/GridCellsSettings.js +0 -1
- package/dist/es/interfaces/GridColumnMenuBaseProps.d.ts +0 -14
- package/dist/es/interfaces/GridColumnMenuBaseProps.js +0 -1
- package/dist/es/interfaces/GridColumnMenuColumnProps.js +0 -1
- package/dist/es/interfaces/GridColumnMenuFilterBaseProps.js +0 -1
- package/dist/es/interfaces/GridColumnMenuFilterUIProps.js +0 -1
- package/dist/es/interfaces/GridColumnMenuGroupBaseProps.d.ts +0 -20
- package/dist/es/interfaces/GridColumnMenuGroupBaseProps.js +0 -1
- package/dist/es/interfaces/GridColumnMenuProps.js +0 -1
- package/dist/es/interfaces/GridColumnMenuSortBaseProps.d.ts +0 -21
- package/dist/es/interfaces/GridColumnMenuSortBaseProps.js +0 -1
- package/dist/es/interfaces/GridColumnProps.js +0 -2
- package/dist/es/interfaces/GridDetailRowProps.d.ts +0 -13
- package/dist/es/interfaces/GridDetailRowProps.js +0 -1
- package/dist/es/interfaces/GridFilterCellProps.d.ts +0 -65
- package/dist/es/interfaces/GridFilterCellProps.js +0 -1
- package/dist/es/interfaces/GridFilterOperator.d.ts +0 -6
- package/dist/es/interfaces/GridFilterOperator.js +0 -1
- package/dist/es/interfaces/GridFilterOperators.js +0 -1
- package/dist/es/interfaces/GridFooterCellProps.d.ts +0 -23
- package/dist/es/interfaces/GridFooterCellProps.js +0 -1
- package/dist/es/interfaces/GridGroupableSettings.js +0 -1
- package/dist/es/interfaces/GridHeaderCellProps.d.ts +0 -17
- package/dist/es/interfaces/GridHeaderCellProps.js +0 -1
- package/dist/es/interfaces/GridNoRecordsProps.d.ts +0 -10
- package/dist/es/interfaces/GridNoRecordsProps.js +0 -1
- package/dist/es/interfaces/GridProps.d.ts +0 -317
- package/dist/es/interfaces/GridProps.js +0 -2
- package/dist/es/interfaces/GridRowProps.js +0 -2
- package/dist/es/interfaces/GridRowType.d.ts +0 -9
- package/dist/es/interfaces/GridRowType.js +0 -1
- package/dist/es/interfaces/GridSelectableSettings.d.ts +0 -18
- package/dist/es/interfaces/GridSelectableSettings.js +0 -2
- package/dist/es/interfaces/GridSortSettings.d.ts +0 -13
- package/dist/es/interfaces/GridSortSettings.js +0 -19
- package/dist/es/interfaces/GridToolbarProps.js +0 -1
- package/dist/es/interfaces/VirtualScrollInterface.js +0 -1
- package/dist/es/interfaces/events.d.ts +0 -229
- package/dist/es/interfaces/events.js +0 -1
- package/dist/es/main.js +0 -33
- package/dist/es/messages/index.d.ts +0 -190
- package/dist/es/messages/index.js +0 -191
- package/dist/es/package-metadata.d.ts +0 -5
- package/dist/es/package-metadata.js +0 -11
- package/dist/es/paging/GridPagerSettings.js +0 -21
- package/dist/es/paging/Page.d.ts +0 -13
- package/dist/es/paging/Page.js +0 -1
- package/dist/es/rows/GridDetailRow.d.ts +0 -51
- package/dist/es/rows/GridDetailRow.js +0 -75
- package/dist/es/rows/GridRow.d.ts +0 -11
- package/dist/es/rows/GridRow.js +0 -64
- package/dist/es/utils/index.js +0 -263
- package/dist/npm/Grid.d.ts +0 -255
- package/dist/npm/Grid.js +0 -1045
- package/dist/npm/GridColumn.js +0 -58
- package/dist/npm/GridNoRecords.js +0 -66
- package/dist/npm/GridToolbar.js +0 -81
- package/dist/npm/ScrollMode.d.ts +0 -1
- package/dist/npm/ScrollMode.js +0 -2
- package/dist/npm/StatusBar.d.ts +0 -47
- package/dist/npm/StatusBar.js +0 -115
- package/dist/npm/VirtualScroll.js +0 -246
- package/dist/npm/VirtualScrollFixed.d.ts +0 -49
- package/dist/npm/VirtualScrollFixed.js +0 -156
- package/dist/npm/cells/GridCell.d.ts +0 -3
- package/dist/npm/cells/GridCell.js +0 -63
- package/dist/npm/cells/GridDetailCell.d.ts +0 -14
- package/dist/npm/cells/GridDetailCell.js +0 -29
- package/dist/npm/cells/GridDetailHierarchyCell.d.ts +0 -7
- package/dist/npm/cells/GridDetailHierarchyCell.js +0 -22
- package/dist/npm/cells/GridEditCell.d.ts +0 -6
- package/dist/npm/cells/GridEditCell.js +0 -100
- package/dist/npm/cells/GridFilterCell.d.ts +0 -16
- package/dist/npm/cells/GridFilterCell.js +0 -105
- package/dist/npm/cells/GridGroupCell.d.ts +0 -6
- package/dist/npm/cells/GridGroupCell.js +0 -118
- package/dist/npm/cells/GridHierarchyCell.d.ts +0 -6
- package/dist/npm/cells/GridHierarchyCell.js +0 -81
- package/dist/npm/cells/GridSelectionCell.d.ts +0 -6
- package/dist/npm/cells/GridSelectionCell.js +0 -48
- package/dist/npm/columnMenu/GridColumnMenuCheckboxFilter.js +0 -331
- package/dist/npm/columnMenu/GridColumnMenuColumnsList.js +0 -61
- package/dist/npm/columnMenu/GridColumnMenuFilter.js +0 -382
- package/dist/npm/columnMenu/GridColumnMenuFilterCell.js +0 -75
- package/dist/npm/columnMenu/GridColumnMenuFilterUI.d.ts +0 -8
- package/dist/npm/columnMenu/GridColumnMenuFilterUI.js +0 -51
- package/dist/npm/columnMenu/GridColumnMenuGroup.d.ts +0 -73
- package/dist/npm/columnMenu/GridColumnMenuGroup.js +0 -128
- package/dist/npm/columnMenu/GridColumnMenuItem.d.ts +0 -36
- package/dist/npm/columnMenu/GridColumnMenuItem.js +0 -40
- package/dist/npm/columnMenu/GridColumnMenuItemContent.d.ts +0 -20
- package/dist/npm/columnMenu/GridColumnMenuItemContent.js +0 -39
- package/dist/npm/columnMenu/GridColumnMenuItemGroup.d.ts +0 -16
- package/dist/npm/columnMenu/GridColumnMenuItemGroup.js +0 -38
- package/dist/npm/columnMenu/GridColumnMenuSort.d.ts +0 -85
- package/dist/npm/columnMenu/GridColumnMenuSort.js +0 -192
- package/dist/npm/columnMenu/GridColumnMenuWrapper.js +0 -123
- package/dist/npm/constants/index.d.ts +0 -6
- package/dist/npm/constants/index.js +0 -10
- package/dist/npm/drag/ColumnDraggable.js +0 -65
- package/dist/npm/drag/ColumnResize.d.ts +0 -33
- package/dist/npm/drag/ColumnResize.js +0 -237
- package/dist/npm/drag/CommonDragLogic.d.ts +0 -40
- package/dist/npm/drag/CommonDragLogic.js +0 -212
- package/dist/npm/drag/GroupingIndicator.js +0 -110
- package/dist/npm/filterCommon.d.ts +0 -69
- package/dist/npm/filterCommon.js +0 -175
- package/dist/npm/footer/Footer.js +0 -73
- package/dist/npm/footer/FooterRow.js +0 -78
- package/dist/npm/header/FilterRow.js +0 -142
- package/dist/npm/header/GridHeaderCell.js +0 -104
- package/dist/npm/header/GridHeaderSelectionCell.d.ts +0 -9
- package/dist/npm/header/GridHeaderSelectionCell.js +0 -62
- package/dist/npm/header/GroupPanel.js +0 -60
- package/dist/npm/header/Header.d.ts +0 -42
- package/dist/npm/header/Header.js +0 -115
- package/dist/npm/header/HeaderRow.js +0 -183
- package/dist/npm/interfaces/GridCellProps.js +0 -3
- package/dist/npm/interfaces/GridCellsSettings.d.ts +0 -111
- package/dist/npm/interfaces/GridCellsSettings.js +0 -3
- package/dist/npm/interfaces/GridColumnMenuBaseProps.d.ts +0 -14
- package/dist/npm/interfaces/GridColumnMenuBaseProps.js +0 -2
- package/dist/npm/interfaces/GridColumnMenuColumnProps.d.ts +0 -25
- package/dist/npm/interfaces/GridColumnMenuColumnProps.js +0 -2
- package/dist/npm/interfaces/GridColumnMenuFilterBaseProps.d.ts +0 -25
- package/dist/npm/interfaces/GridColumnMenuFilterBaseProps.js +0 -2
- package/dist/npm/interfaces/GridColumnMenuFilterUIProps.d.ts +0 -31
- package/dist/npm/interfaces/GridColumnMenuFilterUIProps.js +0 -2
- package/dist/npm/interfaces/GridColumnMenuGroupBaseProps.js +0 -2
- package/dist/npm/interfaces/GridColumnMenuProps.d.ts +0 -8
- package/dist/npm/interfaces/GridColumnMenuProps.js +0 -2
- package/dist/npm/interfaces/GridColumnMenuSortBaseProps.js +0 -2
- package/dist/npm/interfaces/GridColumnProps.d.ts +0 -88
- package/dist/npm/interfaces/GridColumnProps.js +0 -3
- package/dist/npm/interfaces/GridDetailRowProps.d.ts +0 -13
- package/dist/npm/interfaces/GridDetailRowProps.js +0 -2
- package/dist/npm/interfaces/GridFilterCellProps.js +0 -2
- package/dist/npm/interfaces/GridFilterOperator.d.ts +0 -6
- package/dist/npm/interfaces/GridFilterOperator.js +0 -2
- package/dist/npm/interfaces/GridFilterOperators.d.ts +0 -49
- package/dist/npm/interfaces/GridFilterOperators.js +0 -2
- package/dist/npm/interfaces/GridFooterCellProps.js +0 -2
- package/dist/npm/interfaces/GridGroupableSettings.d.ts +0 -13
- package/dist/npm/interfaces/GridGroupableSettings.js +0 -2
- package/dist/npm/interfaces/GridHeaderCellProps.js +0 -2
- package/dist/npm/interfaces/GridNoRecordsProps.d.ts +0 -10
- package/dist/npm/interfaces/GridNoRecordsProps.js +0 -2
- package/dist/npm/interfaces/GridProps.js +0 -3
- package/dist/npm/interfaces/GridRowProps.d.ts +0 -64
- package/dist/npm/interfaces/GridRowProps.js +0 -3
- package/dist/npm/interfaces/GridRowType.d.ts +0 -9
- package/dist/npm/interfaces/GridRowType.js +0 -2
- package/dist/npm/interfaces/GridSelectableSettings.js +0 -3
- package/dist/npm/interfaces/GridSortSettings.d.ts +0 -13
- package/dist/npm/interfaces/GridSortSettings.js +0 -23
- package/dist/npm/interfaces/GridToolbarProps.d.ts +0 -34
- package/dist/npm/interfaces/GridToolbarProps.js +0 -2
- package/dist/npm/interfaces/VirtualScrollInterface.d.ts +0 -27
- package/dist/npm/interfaces/VirtualScrollInterface.js +0 -2
- package/dist/npm/interfaces/events.js +0 -2
- package/dist/npm/main.d.ts +0 -51
- package/dist/npm/main.js +0 -90
- package/dist/npm/messages/index.js +0 -195
- package/dist/npm/package-metadata.d.ts +0 -5
- package/dist/npm/package-metadata.js +0 -14
- package/dist/npm/paging/GridPagerSettings.d.ts +0 -67
- package/dist/npm/paging/GridPagerSettings.js +0 -25
- package/dist/npm/paging/Page.d.ts +0 -13
- package/dist/npm/paging/Page.js +0 -2
- package/dist/npm/rows/GridDetailRow.js +0 -78
- package/dist/npm/rows/GridRow.d.ts +0 -11
- package/dist/npm/rows/GridRow.js +0 -67
- package/dist/npm/utils/index.d.ts +0 -69
- package/dist/npm/utils/index.js +0 -275
- package/dist/systemjs/kendo-react-grid.js +0 -1
- package/e2e-legacy/snapshots/column-menu.png +0 -0
- package/e2e-next/basic.tests.ts +0 -25
package/dist/es/Grid.js
DELETED
|
@@ -1,1042 +0,0 @@
|
|
|
1
|
-
var __extends = (this && this.__extends) || (function () {
|
|
2
|
-
var extendStatics = function (d, b) {
|
|
3
|
-
extendStatics = Object.setPrototypeOf ||
|
|
4
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
-
return extendStatics(d, b);
|
|
7
|
-
};
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
var __assign = (this && this.__assign) || function () {
|
|
17
|
-
__assign = Object.assign || function(t) {
|
|
18
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
-
s = arguments[i];
|
|
20
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
-
t[p] = s[p];
|
|
22
|
-
}
|
|
23
|
-
return t;
|
|
24
|
-
};
|
|
25
|
-
return __assign.apply(this, arguments);
|
|
26
|
-
};
|
|
27
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
28
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
29
|
-
if (ar || !(i in from)) {
|
|
30
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
31
|
-
ar[i] = from[i];
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
35
|
-
};
|
|
36
|
-
import * as React from 'react';
|
|
37
|
-
import * as PropTypes from 'prop-types';
|
|
38
|
-
import { dispatchEvent, classNames, getter, guid, setScrollbarWidth, canUseDOM, memoizeOne, kendoThemeMaps } from '@progress/kendo-react-common';
|
|
39
|
-
import { tableColumnsVirtualization, Pager, mapColumns, updateLeft, updateRight, isRtl, tableKeyboardNavigation, TableKeyboardNavigationContext, tableKeyboardNavigationScopeAttributes, tableKeyboardNavigationTools as navigationTools, tableKeyboardNavigationBodyAttributes, getSelectionOptions, TableSelection, DropClue, DragClue } from '@progress/kendo-react-data-tools';
|
|
40
|
-
import { GridSelectionCell } from './cells/GridSelectionCell';
|
|
41
|
-
import { GridHierarchyCell } from './cells/GridHierarchyCell';
|
|
42
|
-
import { GridEditCell } from './cells/GridEditCell';
|
|
43
|
-
import { Header } from './header/Header';
|
|
44
|
-
import { HeaderRow } from './header/HeaderRow';
|
|
45
|
-
import { FilterRow } from './header/FilterRow';
|
|
46
|
-
import { GroupPanel } from './header/GroupPanel';
|
|
47
|
-
import { Footer } from './footer/Footer';
|
|
48
|
-
import { VirtualScroll } from './VirtualScroll';
|
|
49
|
-
import { RowHeightService, VirtualScrollFixed } from './VirtualScrollFixed';
|
|
50
|
-
import { ColumnResize } from './drag/ColumnResize';
|
|
51
|
-
import { CommonDragLogic } from './drag/CommonDragLogic';
|
|
52
|
-
import { getNestedValue, flatData, readColumns, autoGenerateColumns, firefox, firefoxMaxHeight, sanitizeColumns, resolveCells, getColumnWidth } from './utils/index';
|
|
53
|
-
import { GridCell } from './cells/GridCell';
|
|
54
|
-
import { GridGroupCell } from './cells/GridGroupCell';
|
|
55
|
-
import { GridRow } from './rows/GridRow';
|
|
56
|
-
import { GridHeaderSelectionCell } from './header/GridHeaderSelectionCell';
|
|
57
|
-
import { GridNoRecords } from './GridNoRecords';
|
|
58
|
-
import { operators } from './filterCommon';
|
|
59
|
-
import { FooterRow } from './footer/FooterRow';
|
|
60
|
-
import { normalize } from './paging/GridPagerSettings';
|
|
61
|
-
import { pagerMessagesMap } from './messages';
|
|
62
|
-
import { validatePackage, shouldShowValidationUI, WatermarkOverlay } from '@progress/kendo-react-common';
|
|
63
|
-
import { packageMetadata } from './package-metadata';
|
|
64
|
-
import { GridDetailCell } from './cells/GridDetailCell';
|
|
65
|
-
import { GridDetailHierarchyCell } from './cells/GridDetailHierarchyCell';
|
|
66
|
-
/**
|
|
67
|
-
* Represents the [KendoReact Grid component]({% slug overview_grid %}).
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* ```jsx
|
|
71
|
-
* class App extends React.Component {
|
|
72
|
-
* constructor(props) {
|
|
73
|
-
* super(props);
|
|
74
|
-
* this.state = {
|
|
75
|
-
* data: [
|
|
76
|
-
* { 'foo': 'A1', 'bar': 'B1' },
|
|
77
|
-
* { 'foo': 'A2', 'bar': 'B2' },
|
|
78
|
-
* { 'foo': 'A3', 'bar': 'B2' }
|
|
79
|
-
* ]
|
|
80
|
-
* };
|
|
81
|
-
* }
|
|
82
|
-
* render() {
|
|
83
|
-
* return (
|
|
84
|
-
* <Grid
|
|
85
|
-
* data={this.state.data}
|
|
86
|
-
* reorderable={true}
|
|
87
|
-
* >
|
|
88
|
-
* <GridColumn field="foo" />
|
|
89
|
-
* <GridColumn field="bar" />
|
|
90
|
-
* </Grid>
|
|
91
|
-
* );
|
|
92
|
-
* }
|
|
93
|
-
* }
|
|
94
|
-
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
var Grid = /** @class */ (function (_super) {
|
|
98
|
-
__extends(Grid, _super);
|
|
99
|
-
function Grid(props) {
|
|
100
|
-
var _this = _super.call(this, props) || this;
|
|
101
|
-
_this._columns = [];
|
|
102
|
-
_this._columnsMap = [[]];
|
|
103
|
-
_this._columnsMutations = 0;
|
|
104
|
-
_this._resized = false;
|
|
105
|
-
_this._shouldUpdateLeftRight = true;
|
|
106
|
-
_this.contextStateRef = { current: undefined };
|
|
107
|
-
_this.navigationStateRef = { current: undefined };
|
|
108
|
-
_this._data = [];
|
|
109
|
-
_this._slicedData = undefined;
|
|
110
|
-
_this.wrapperScrollTop = 0;
|
|
111
|
-
_this.showLicenseWatermark = false;
|
|
112
|
-
_this.headerRef = React.createRef();
|
|
113
|
-
_this.headerElementRef = React.createRef();
|
|
114
|
-
_this._element = null;
|
|
115
|
-
_this.tableElement = null;
|
|
116
|
-
_this.containerRef = React.createRef();
|
|
117
|
-
_this.tableBodyRef = React.createRef();
|
|
118
|
-
_this._footer = null;
|
|
119
|
-
_this.forceUpdateTimeout = undefined;
|
|
120
|
-
_this.isRtl = false;
|
|
121
|
-
_this._gridId = guid();
|
|
122
|
-
_this._gridRoleElementId = guid(); // Needed for aria-control accessibility attribute
|
|
123
|
-
_this.observer = null;
|
|
124
|
-
_this.handleIntersection = function (entries) {
|
|
125
|
-
var options = { rowIndex: _this.rowIndex };
|
|
126
|
-
entries.forEach(function (entry) {
|
|
127
|
-
if (!entry.isIntersecting) {
|
|
128
|
-
_this.setCurrentOnTop(options);
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
_this.setCurrentOnTop = function (options) {
|
|
133
|
-
if (!_this.vs.container || _this.props.scrollable === 'none') {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
if (_this.observer) {
|
|
137
|
-
_this.observer.disconnect();
|
|
138
|
-
}
|
|
139
|
-
var rowIndex = options.rowIndex;
|
|
140
|
-
if (_this.props.scrollable === 'virtual') {
|
|
141
|
-
_this.vs.askedSkip = rowIndex;
|
|
142
|
-
_this.vs.container.scroll(0, Math.round(_this.vs.askedSkip / _this.vs.total * _this.vs.container.scrollHeight));
|
|
143
|
-
}
|
|
144
|
-
else if (_this.element) {
|
|
145
|
-
var selectedRow = rowIndex < 1
|
|
146
|
-
? _this.element.querySelector("tbody > tr:nth-child(".concat(1, ")"))
|
|
147
|
-
: _this.element.querySelector("tbody > tr:nth-child(".concat(rowIndex + 1, ")"));
|
|
148
|
-
if (selectedRow && _this.containerRef.current) {
|
|
149
|
-
_this.containerRef.current.scrollTop = selectedRow.offsetTop;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* Method to allow the scroll to be set to a specific row index when the Grid is scrollable. It is zero based.
|
|
155
|
-
*
|
|
156
|
-
* @param options - Object, containing the rowIndex to which is going to be scrolled.
|
|
157
|
-
*/
|
|
158
|
-
_this.scrollIntoView = function (options) {
|
|
159
|
-
if (!_this.vs.container || _this.props.scrollable === 'none') {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
_this.rowIndex = options.rowIndex;
|
|
163
|
-
var rowIndex = options.rowIndex;
|
|
164
|
-
var element = _this.element;
|
|
165
|
-
if (_this.observer && element) {
|
|
166
|
-
_this.observer.disconnect();
|
|
167
|
-
var target = element.querySelector("[absolute-row-index=\"".concat(rowIndex, "\"]"));
|
|
168
|
-
if (target) {
|
|
169
|
-
_this.observer.observe(target);
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
_this.setCurrentOnTop(options);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
/**
|
|
177
|
-
* Method to fit columns according to their content.
|
|
178
|
-
*
|
|
179
|
-
* @param columnIds - Array of column ids to be fitted.
|
|
180
|
-
*/
|
|
181
|
-
_this.fitColumns = function (columnIds) {
|
|
182
|
-
_this.columnResize.dblClickHandler(null, columnIds);
|
|
183
|
-
};
|
|
184
|
-
_this.onContextMenu = function (event, dataItem, field) {
|
|
185
|
-
if (_this.props.onContextMenu) {
|
|
186
|
-
var ev = {
|
|
187
|
-
target: _this,
|
|
188
|
-
syntheticEvent: event,
|
|
189
|
-
nativeEvent: event.nativeEvent,
|
|
190
|
-
dataItem: dataItem,
|
|
191
|
-
field: field
|
|
192
|
-
};
|
|
193
|
-
_this.props.onContextMenu.call(undefined, ev);
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
_this.getVirtualScroll = function (props) {
|
|
197
|
-
var rowHeight = props.rowHeight, detailRowHeight = props.detailRowHeight, detail = props.detail, expandField = props.expandField, groupable = props.groupable;
|
|
198
|
-
var hasAllData = _this.isAllData();
|
|
199
|
-
var hasRowHeight = rowHeight !== undefined && rowHeight > 0;
|
|
200
|
-
var hasDetailRowHeight = detailRowHeight !== undefined && detailRowHeight > 0;
|
|
201
|
-
var isGroupable = groupable === true || (typeof groupable === 'object' && groupable.enabled !== false);
|
|
202
|
-
var hasDetails = Boolean(detail && expandField);
|
|
203
|
-
if (!hasRowHeight ||
|
|
204
|
-
(isGroupable && !hasAllData) ||
|
|
205
|
-
(hasDetails && (!hasDetailRowHeight || !hasAllData))) {
|
|
206
|
-
return VirtualScroll;
|
|
207
|
-
}
|
|
208
|
-
return VirtualScrollFixed;
|
|
209
|
-
};
|
|
210
|
-
_this.isAllData = function () {
|
|
211
|
-
var _a = _this.props, data = _a.data, total = _a.total;
|
|
212
|
-
if (Array.isArray(data)) {
|
|
213
|
-
return data.length === total;
|
|
214
|
-
}
|
|
215
|
-
else if (data) {
|
|
216
|
-
return total === data.total;
|
|
217
|
-
}
|
|
218
|
-
return false;
|
|
219
|
-
};
|
|
220
|
-
_this.initializeVirtualization = function (total, groupable) {
|
|
221
|
-
_this.reInitVirtualization(_this.props.scrollable === 'virtual', _this.props.total, _this.props.filter, _this.props.group, _this.props.sort, groupable || _this.props.rowHeight === undefined || _this.props.rowHeight === 0);
|
|
222
|
-
_this.vs.fixedScroll = _this.props.fixedScroll || false;
|
|
223
|
-
_this.vs.PageChange = _this.pageChange;
|
|
224
|
-
_this.vs.realSkip = _this.props.skip || 0;
|
|
225
|
-
_this.vs.pageSize = (_this.props.take !== undefined ? _this.props.take : _this.props.pageSize) || 0;
|
|
226
|
-
_this.vs.scrollableVirtual = (_this.props.scrollable === 'virtual');
|
|
227
|
-
_this.vs.total = total;
|
|
228
|
-
_this.vs.propsSkip = (_this.props.skip || 0) + (_this.props.scrollable === 'virtual' ?
|
|
229
|
-
_this.vs.topCacheCount + (_this.vs.attendedSkip - (_this.props.skip || 0)) : 0);
|
|
230
|
-
if (_this.props.rowHeight !== undefined && _this.props.rowHeight > 0 && !groupable) {
|
|
231
|
-
var containerHeight = _this.props.rowHeight * total;
|
|
232
|
-
_this.vs.containerHeight = firefox ? Math.min(firefoxMaxHeight, containerHeight) : containerHeight;
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
_this.vs.containerHeight = 1533915;
|
|
236
|
-
}
|
|
237
|
-
_this.vs.containerRef = _this.containerRef;
|
|
238
|
-
_this.vs.tableBodyRef = _this.tableBodyRef;
|
|
239
|
-
_this.vs.table = _this.tableElement;
|
|
240
|
-
_this._slicedData = undefined;
|
|
241
|
-
if (_this.vs instanceof VirtualScrollFixed) {
|
|
242
|
-
var _a = _this.props, _b = _a.rowHeight, rowHeight = _b === void 0 ? 0 : _b, detail = _a.detail, expandField = _a.expandField;
|
|
243
|
-
var _c = _this.props.detailRowHeight, detailRowHeight = _c === void 0 ? 0 : _c;
|
|
244
|
-
detailRowHeight = Boolean(detail && expandField) ? detailRowHeight : rowHeight;
|
|
245
|
-
if (_this.isAllData()) {
|
|
246
|
-
_this.vs.total = _this._data.length;
|
|
247
|
-
_this._slicedData = _this._data.slice(_this.vs.realSkip, _this.vs.realSkip + _this.vs.pageSize);
|
|
248
|
-
_this.vs.rowHeightService = _this.rowHeightService(_this.vs, _this._data.length, rowHeight, detailRowHeight, _this._data);
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
_this.vs.rowHeightService = new RowHeightService(total, rowHeight, detailRowHeight);
|
|
252
|
-
}
|
|
253
|
-
var containerHeight = _this.vs.rowHeightService.totalHeight();
|
|
254
|
-
_this.vs.containerHeight = firefox ? Math.min(firefoxMaxHeight, containerHeight) : containerHeight;
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
_this.scrollHandler = function (event) {
|
|
258
|
-
if (event.target !== event.currentTarget) {
|
|
259
|
-
return;
|
|
260
|
-
}
|
|
261
|
-
clearTimeout(_this.forceUpdateTimeout);
|
|
262
|
-
_this.vs.table = _this.tableElement;
|
|
263
|
-
var scrollLeft = event.currentTarget.scrollLeft;
|
|
264
|
-
var scrollTop = event.currentTarget.scrollTop;
|
|
265
|
-
if (_this.props.columnVirtualization && (!_this.vs.scrollableVirtual || scrollTop === _this.wrapperScrollTop)) {
|
|
266
|
-
_this.forceUpdateTimeout = window.setTimeout(function () { _this.forceUpdate(); }, 0);
|
|
267
|
-
}
|
|
268
|
-
if (_this._header) {
|
|
269
|
-
_this._header.setScrollLeft(scrollLeft);
|
|
270
|
-
}
|
|
271
|
-
if (_this._footer) {
|
|
272
|
-
_this._footer.setScrollLeft(scrollLeft);
|
|
273
|
-
}
|
|
274
|
-
if (_this.vs && scrollTop !== _this.wrapperScrollTop) {
|
|
275
|
-
_this.vs.scrollHandler(event);
|
|
276
|
-
}
|
|
277
|
-
dispatchEvent(_this.props.onScroll, event, _this, undefined);
|
|
278
|
-
_this.wrapperScrollTop = scrollTop;
|
|
279
|
-
};
|
|
280
|
-
_this.onKeyDown = function (event) {
|
|
281
|
-
tableKeyboardNavigation.onKeyDown(event, {
|
|
282
|
-
contextStateRef: _this.contextStateRef,
|
|
283
|
-
navigationStateRef: _this.navigationStateRef,
|
|
284
|
-
onNavigationAction: _this.onNavigationAction
|
|
285
|
-
});
|
|
286
|
-
if (_this.props.onKeyDown) {
|
|
287
|
-
var _a = getSelectionOptions(_this.props.selectable), mode = _a.mode, cell = _a.cell;
|
|
288
|
-
var ev = __assign({ dataItems: _this.getLeafDataItems(), mode: mode, cell: cell, componentId: _this._gridId, selectedField: _this.props.selectedField }, _this.getArguments(event));
|
|
289
|
-
_this.props.onKeyDown.call(undefined, ev);
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
_this.onFocus = function (event) {
|
|
293
|
-
tableKeyboardNavigation.onFocus(event, {
|
|
294
|
-
contextStateRef: _this.contextStateRef
|
|
295
|
-
});
|
|
296
|
-
};
|
|
297
|
-
_this.onNavigationAction = function (options) {
|
|
298
|
-
if (_this.props.onNavigationAction) {
|
|
299
|
-
var ev = __assign({ focusElement: options.focusElement }, _this.getArguments(options.event));
|
|
300
|
-
_this.props.onNavigationAction.call(undefined, ev);
|
|
301
|
-
}
|
|
302
|
-
};
|
|
303
|
-
_this.rowClick = function (e, item) {
|
|
304
|
-
if (_this.props.onRowClick && e.target.nodeName === 'TD') {
|
|
305
|
-
_this.props.onRowClick.call(undefined, __assign({ dataItem: item.dataItem }, _this.getArguments(e)));
|
|
306
|
-
}
|
|
307
|
-
};
|
|
308
|
-
_this.rowDblClick = function (e, item) {
|
|
309
|
-
if (_this.props.onRowDoubleClick && e.target.nodeName === 'TD') {
|
|
310
|
-
_this.props.onRowDoubleClick.call(undefined, __assign({ dataItem: item.dataItem }, _this.getArguments(e)));
|
|
311
|
-
}
|
|
312
|
-
};
|
|
313
|
-
_this.itemChange = function (event) {
|
|
314
|
-
var itemChange = _this.props.onItemChange;
|
|
315
|
-
if (event.field === _this.props.expandField || _this.props.group && event.field === undefined) {
|
|
316
|
-
var expandChange = _this.props.onExpandChange;
|
|
317
|
-
if (expandChange) {
|
|
318
|
-
expandChange.call(undefined, __assign(__assign({}, _this.getArguments(event.syntheticEvent)), { dataItem: event.dataItem, dataIndex: event.dataIndex, value: event.value }));
|
|
319
|
-
}
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
if (itemChange) {
|
|
323
|
-
itemChange.call(undefined, __assign(__assign({}, _this.getArguments(event.syntheticEvent)), { dataItem: event.dataItem, field: event.field, value: event.value }));
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
_this.onHeaderSelectionChange = function (event) {
|
|
327
|
-
if (_this.props.onHeaderSelectionChange) {
|
|
328
|
-
_this.props.onHeaderSelectionChange.call(undefined, {
|
|
329
|
-
field: event.field,
|
|
330
|
-
nativeEvent: event.syntheticEvent && event.syntheticEvent.nativeEvent,
|
|
331
|
-
syntheticEvent: event.syntheticEvent,
|
|
332
|
-
target: _this,
|
|
333
|
-
dataItems: _this.getLeafDataItems(),
|
|
334
|
-
selectedField: _this.props.selectedField
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
_this.selectionRelease = function (event) {
|
|
339
|
-
if (_this.props.onSelectionChange) {
|
|
340
|
-
var selectionEvent = __assign({ syntheticEvent: undefined, target: _this, selectedField: _this.props.selectedField || '', componentId: _this._gridId, dataItems: _this.getLeafDataItems(), dataItem: null }, event);
|
|
341
|
-
_this.props.onSelectionChange.call(undefined, selectionEvent);
|
|
342
|
-
}
|
|
343
|
-
};
|
|
344
|
-
_this.pageChange = function (page, syntheticEvent, targetEvent) {
|
|
345
|
-
_this.raiseDataEvent(_this.props.onPageChange, { page: page }, { skip: page.skip, take: page.take }, syntheticEvent, targetEvent);
|
|
346
|
-
};
|
|
347
|
-
_this.pagerPageChange = function (event) {
|
|
348
|
-
_this.pageChange({ skip: event.skip, take: event.take }, event.syntheticEvent, event.targetEvent);
|
|
349
|
-
};
|
|
350
|
-
_this.sortChange = function (sort, syntheticEvent) {
|
|
351
|
-
_this.raiseDataEvent(_this.props.onSortChange, { sort: sort }, __assign({ sort: sort }, (_this.props.scrollable === 'virtual' ? { skip: 0 } : {})), syntheticEvent);
|
|
352
|
-
};
|
|
353
|
-
_this.filterChange = function (filter, syntheticEvent) {
|
|
354
|
-
_this.raiseDataEvent(_this.props.onFilterChange, { filter: filter }, { filter: filter || undefined, skip: 0 }, syntheticEvent);
|
|
355
|
-
};
|
|
356
|
-
_this.groupChange = function (groups, event) {
|
|
357
|
-
var syntheticEvent = event.nativeEvent ?
|
|
358
|
-
event : { nativeEvent: event.nativeEvent || event.originalEvent };
|
|
359
|
-
_this.raiseDataEvent(_this.props.onGroupChange, { group: groups }, { group: groups, skip: 0 }, syntheticEvent);
|
|
360
|
-
};
|
|
361
|
-
_this.onResize = function (index, newWidth, oldWidth, nativeEvent, end, targetId) {
|
|
362
|
-
_this.resetTableWidth();
|
|
363
|
-
_this._shouldUpdateLeftRight = true;
|
|
364
|
-
_this._resized = true;
|
|
365
|
-
_this._columnsMutations++;
|
|
366
|
-
if (_this.props.onColumnResize) {
|
|
367
|
-
_this.props.onColumnResize.call(undefined, {
|
|
368
|
-
columns: _this.columns,
|
|
369
|
-
nativeEvent: nativeEvent,
|
|
370
|
-
targetColumnId: targetId,
|
|
371
|
-
index: index,
|
|
372
|
-
newWidth: newWidth,
|
|
373
|
-
oldWidth: oldWidth,
|
|
374
|
-
end: end,
|
|
375
|
-
target: _this
|
|
376
|
-
});
|
|
377
|
-
}
|
|
378
|
-
};
|
|
379
|
-
_this.reInitVirtualization = memoizeOne(function (_vScrolling, _total, _filter, _group, _sort, useCached) {
|
|
380
|
-
_this.vs.reset();
|
|
381
|
-
var VS = _this.getVirtualScroll(_this.props);
|
|
382
|
-
_this.vs = new VS(useCached);
|
|
383
|
-
});
|
|
384
|
-
_this.flatData = memoizeOne(function (propsData, groupingFooter, skip, group, expandField, _filter, _sort) {
|
|
385
|
-
var flattedData = [];
|
|
386
|
-
var resolvedGroupsCount = flatData(flattedData, propsData, groupingFooter, { index: skip }, group !== undefined, expandField);
|
|
387
|
-
return { flattedData: flattedData, resolvedGroupsCount: resolvedGroupsCount };
|
|
388
|
-
});
|
|
389
|
-
_this.rowHeightService = memoizeOne(function (_vs, total, rowHeight, detailRowHeight, data) {
|
|
390
|
-
return new RowHeightService(total, rowHeight, detailRowHeight, data);
|
|
391
|
-
});
|
|
392
|
-
_this.childrenToArray = memoizeOne(function (children) {
|
|
393
|
-
return React.Children.toArray(children);
|
|
394
|
-
});
|
|
395
|
-
_this.readColumns = memoizeOne(function (children, idPrefix, _mutationsCount) {
|
|
396
|
-
var columnElements = children.filter(function (child) { return child && child.type && child.type.displayName === 'KendoReactGridColumn'; });
|
|
397
|
-
return readColumns(columnElements, _this.columns, { prevId: 0, idPrefix: idPrefix });
|
|
398
|
-
});
|
|
399
|
-
_this.mapColumns = memoizeOne(function (columns) {
|
|
400
|
-
return mapColumns(columns);
|
|
401
|
-
});
|
|
402
|
-
_this.configureColumns = memoizeOne(function (columns, groupCount, idPrefix) {
|
|
403
|
-
if (_this.props.selectedField) {
|
|
404
|
-
columns.filter(function (c) { return c.field === _this.props.selectedField; }).forEach(function (c) {
|
|
405
|
-
c.width = c.width || '50px';
|
|
406
|
-
c.cell = c.cell || GridSelectionCell;
|
|
407
|
-
c.headerCell = c.headerCell || GridHeaderSelectionCell;
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
var defaultServiceProps = {
|
|
411
|
-
id: '',
|
|
412
|
-
resizable: true,
|
|
413
|
-
width: '32px',
|
|
414
|
-
title: ' ',
|
|
415
|
-
declarationIndex: -1,
|
|
416
|
-
orderIndex: -1,
|
|
417
|
-
children: [],
|
|
418
|
-
parentIndex: -1,
|
|
419
|
-
depth: 0,
|
|
420
|
-
colSpan: 0,
|
|
421
|
-
rowSpan: 0,
|
|
422
|
-
left: 0,
|
|
423
|
-
right: 0,
|
|
424
|
-
index: 0,
|
|
425
|
-
rightBorder: false,
|
|
426
|
-
ariaColumnIndex: 0,
|
|
427
|
-
isAccessible: true
|
|
428
|
-
};
|
|
429
|
-
var columnIndexOffset = 0;
|
|
430
|
-
if (_this.props.expandField && (_this.props.onExpandChange) && _this.props.detail) {
|
|
431
|
-
columns.unshift(__assign(__assign({}, defaultServiceProps), { cell: GridHierarchyCell, field: _this.props.expandField, headerClassName: 'k-hierarchy-cell k-header', id: navigationTools.generateNavigatableId("".concat(_this._columns.length), idPrefix, 'column') }));
|
|
432
|
-
columnIndexOffset++;
|
|
433
|
-
}
|
|
434
|
-
for (var i = 0; i < groupCount; i++) {
|
|
435
|
-
columns.unshift(__assign(__assign({}, defaultServiceProps), { isAccessible: false, cell: GridGroupCell, field: 'value', locked: _this.props.lockGroups }));
|
|
436
|
-
columnIndexOffset++;
|
|
437
|
-
}
|
|
438
|
-
columns.slice(columnIndexOffset).forEach(function (c) { return c.parentIndex >= 0 && (c.parentIndex += columnIndexOffset); });
|
|
439
|
-
});
|
|
440
|
-
_this.getHeaderRow = memoizeOne(function (sort, sortable, group, groupable, filter, filterable, filterOperators, headerCellRender, columnMenu, columns, columnsMap, isHeaderRtl) {
|
|
441
|
-
return (React.createElement(HeaderRow, { cells: _this.props.cells, sort: sort, sortable: sortable, sortChange: _this.sortChange, group: group || [], groupable: groupable, groupChange: _this.groupChange, filter: filter, filterable: filterable, filterOperators: filterOperators, filterChange: _this.filterChange, columnMenu: columnMenu, selectionChange: _this.onHeaderSelectionChange, columns: columns, columnResize: _this.columnResize, pressHandler: _this.dragLogic.pressHandler, dragHandler: _this.dragLogic.dragHandler, releaseHandler: _this.dragLogic.releaseHandler, columnsMap: columnsMap, cellRender: headerCellRender, isRtl: isHeaderRtl, dragClue: _this.dragLogic.dragClueRef, headerRef: _this.headerElementRef, containerRef: _this.containerRef }));
|
|
442
|
-
});
|
|
443
|
-
_this.resolveTitle = function (field) {
|
|
444
|
-
var column = _this._columns.find(function (c) { return c.field === field; });
|
|
445
|
-
var title = column && (column.title || column.field);
|
|
446
|
-
return title === undefined ? field : title;
|
|
447
|
-
};
|
|
448
|
-
_this.getLeafDataItems = function () {
|
|
449
|
-
return _this._data.filter(function (item) { return item.rowType === 'data'; }).map(function (item) { return item.dataItem; });
|
|
450
|
-
};
|
|
451
|
-
validatePackage(packageMetadata);
|
|
452
|
-
_this.showLicenseWatermark = shouldShowValidationUI(packageMetadata);
|
|
453
|
-
var groupable = _this.props.groupable === true ||
|
|
454
|
-
(typeof _this.props.groupable === 'object') && _this.props.groupable.enabled !== false;
|
|
455
|
-
var VS = _this.getVirtualScroll(props);
|
|
456
|
-
_this.vs = new VS(groupable || props.rowHeight === undefined || props.rowHeight === 0);
|
|
457
|
-
_this.dragLogic = new CommonDragLogic(_this.columnReorder.bind(_this), _this.groupReorder.bind(_this), _this.columnToGroup.bind(_this));
|
|
458
|
-
_this.columnResize = new ColumnResize(_this.onResize);
|
|
459
|
-
tableKeyboardNavigation.onConstructor({
|
|
460
|
-
navigatable: Boolean(props.navigatable),
|
|
461
|
-
contextStateRef: _this.contextStateRef,
|
|
462
|
-
navigationStateRef: _this.navigationStateRef,
|
|
463
|
-
idPrefix: _this._gridId
|
|
464
|
-
});
|
|
465
|
-
return _this;
|
|
466
|
-
}
|
|
467
|
-
Object.defineProperty(Grid.prototype, "columns", {
|
|
468
|
-
/* eslint-disable max-len */
|
|
469
|
-
/**
|
|
470
|
-
* A getter of the current columns. Gets the current column width or current columns, or any other [`GridColumnProps`]({% slug api_grid_gridcolumnprops %}) for each defined column. Can be used on each Grid instance. To obtain the instance of the rendered Grid, use the `ref` callback. The following example demonstrates how to reorder the columns by dragging their handlers and check the properties afterwards. You can check the result in the browser console.
|
|
471
|
-
*
|
|
472
|
-
* @example
|
|
473
|
-
* ```jsx
|
|
474
|
-
* class App extends React.Component {
|
|
475
|
-
* constructor(props) {
|
|
476
|
-
* super(props);
|
|
477
|
-
* this.state = {
|
|
478
|
-
* data: [
|
|
479
|
-
* { 'foo': 'A1', 'bar': 'B1' },
|
|
480
|
-
* { 'foo': 'A2', 'bar': 'B2' },
|
|
481
|
-
* { 'foo': 'A3', 'bar': 'B2' }
|
|
482
|
-
* ]
|
|
483
|
-
* };
|
|
484
|
-
* this.grid = null;
|
|
485
|
-
* }
|
|
486
|
-
* render() {
|
|
487
|
-
* return (
|
|
488
|
-
* <div>
|
|
489
|
-
* <Grid
|
|
490
|
-
* data={this.state.data}
|
|
491
|
-
* reorderable={true}
|
|
492
|
-
* ref={(g) => { this.grid = g; }}
|
|
493
|
-
* >
|
|
494
|
-
* <GridColumn field="foo" />
|
|
495
|
-
* <GridColumn field="bar" />
|
|
496
|
-
* </Grid>
|
|
497
|
-
* <button onClick={() => console.log(JSON.stringify(this.grid.columns))}>
|
|
498
|
-
* log current properties into browser console.
|
|
499
|
-
* </button>
|
|
500
|
-
* </div>
|
|
501
|
-
* );
|
|
502
|
-
* }
|
|
503
|
-
* }
|
|
504
|
-
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
505
|
-
* ```
|
|
506
|
-
*/
|
|
507
|
-
// tslint:enable:max-line-length
|
|
508
|
-
get: function () {
|
|
509
|
-
var shuffledColumns = this._columns.filter(function (q) { return q.declarationIndex >= 0 && q.parentIndex === -1; });
|
|
510
|
-
return sanitizeColumns(shuffledColumns);
|
|
511
|
-
},
|
|
512
|
-
enumerable: false,
|
|
513
|
-
configurable: true
|
|
514
|
-
});
|
|
515
|
-
Object.defineProperty(Grid.prototype, "element", {
|
|
516
|
-
/**
|
|
517
|
-
* Returns the HTML element of the Grid component.
|
|
518
|
-
*/
|
|
519
|
-
get: function () {
|
|
520
|
-
return this._element;
|
|
521
|
-
},
|
|
522
|
-
enumerable: false,
|
|
523
|
-
configurable: true
|
|
524
|
-
});
|
|
525
|
-
Object.defineProperty(Grid.prototype, "document", {
|
|
526
|
-
get: function () {
|
|
527
|
-
if (!canUseDOM) {
|
|
528
|
-
return;
|
|
529
|
-
}
|
|
530
|
-
// useful only for user actions
|
|
531
|
-
return (this.element && this.element.ownerDocument) || document;
|
|
532
|
-
},
|
|
533
|
-
enumerable: false,
|
|
534
|
-
configurable: true
|
|
535
|
-
});
|
|
536
|
-
Object.defineProperty(Grid.prototype, "_header", {
|
|
537
|
-
get: function () {
|
|
538
|
-
return this.headerRef.current;
|
|
539
|
-
},
|
|
540
|
-
enumerable: false,
|
|
541
|
-
configurable: true
|
|
542
|
-
});
|
|
543
|
-
/**
|
|
544
|
-
* @hidden
|
|
545
|
-
*/
|
|
546
|
-
Grid.prototype.componentDidMount = function () {
|
|
547
|
-
this.resetTableWidth();
|
|
548
|
-
setScrollbarWidth();
|
|
549
|
-
var rtl = isRtl(this.element);
|
|
550
|
-
this.isRtl = rtl;
|
|
551
|
-
tableKeyboardNavigation.onComponentDidMount({
|
|
552
|
-
scope: this.element || undefined,
|
|
553
|
-
contextStateRef: this.contextStateRef,
|
|
554
|
-
navigationStateRef: this.navigationStateRef
|
|
555
|
-
});
|
|
556
|
-
if (this.isRtl) {
|
|
557
|
-
this.forceUpdate();
|
|
558
|
-
}
|
|
559
|
-
var observerOptions = {
|
|
560
|
-
rootMargin: '0px',
|
|
561
|
-
threshold: 0.9
|
|
562
|
-
};
|
|
563
|
-
this.observer = (canUseDOM && window.IntersectionObserver &&
|
|
564
|
-
new window.IntersectionObserver(this.handleIntersection, observerOptions) || null);
|
|
565
|
-
};
|
|
566
|
-
/**
|
|
567
|
-
* @hidden
|
|
568
|
-
*/
|
|
569
|
-
Grid.prototype.getSnapshotBeforeUpdate = function () {
|
|
570
|
-
tableKeyboardNavigation.onGetSnapshotBeforeUpdate({
|
|
571
|
-
document: this.document,
|
|
572
|
-
contextStateRef: this.contextStateRef,
|
|
573
|
-
navigationStateRef: this.navigationStateRef
|
|
574
|
-
});
|
|
575
|
-
return null;
|
|
576
|
-
};
|
|
577
|
-
/**
|
|
578
|
-
* @hidden
|
|
579
|
-
*/
|
|
580
|
-
Grid.prototype.componentDidUpdate = function () {
|
|
581
|
-
this.resetTableWidth();
|
|
582
|
-
setScrollbarWidth();
|
|
583
|
-
if (this.vs.tableTransform && this.vs.table) {
|
|
584
|
-
this.vs.table.style.transform = this.vs.tableTransform;
|
|
585
|
-
this.vs.tableTransform = '';
|
|
586
|
-
}
|
|
587
|
-
tableKeyboardNavigation.onComponentDidUpdate({
|
|
588
|
-
scope: this.element || undefined,
|
|
589
|
-
contextStateRef: this.contextStateRef,
|
|
590
|
-
navigationStateRef: this.navigationStateRef
|
|
591
|
-
});
|
|
592
|
-
};
|
|
593
|
-
/**
|
|
594
|
-
* @hidden
|
|
595
|
-
*/
|
|
596
|
-
Grid.prototype.componentWillUnmount = function () {
|
|
597
|
-
clearTimeout(this.forceUpdateTimeout);
|
|
598
|
-
};
|
|
599
|
-
/**
|
|
600
|
-
* @hidden
|
|
601
|
-
*/
|
|
602
|
-
Grid.prototype.render = function () {
|
|
603
|
-
var _a, _b, _c, _d;
|
|
604
|
-
var _this = this;
|
|
605
|
-
var _e;
|
|
606
|
-
var total = this.props.total || 0;
|
|
607
|
-
var idPrefix = navigationTools.getIdPrefix(this.navigationStateRef);
|
|
608
|
-
var propsData = [];
|
|
609
|
-
if (Array.isArray(this.props.data)) {
|
|
610
|
-
propsData = this.props.data;
|
|
611
|
-
total = total || this.props.data.length;
|
|
612
|
-
}
|
|
613
|
-
else if (this.props.data) {
|
|
614
|
-
propsData = this.props.data.data;
|
|
615
|
-
total = total || this.props.data.total;
|
|
616
|
-
}
|
|
617
|
-
var groupingFooter = (typeof this.props.groupable === 'object') && this.props.groupable.footer || 'none';
|
|
618
|
-
var _f = this.flatData(propsData, groupingFooter, this.props.skip || 0, this.props.group, this.props.expandField, this.props.filter, this.props.sort), resolvedGroupsCount = _f.resolvedGroupsCount, flattedData = _f.flattedData;
|
|
619
|
-
this._data = flattedData;
|
|
620
|
-
var groupable = this.props.groupable === true ||
|
|
621
|
-
(typeof this.props.groupable === 'object') && this.props.groupable.enabled !== false;
|
|
622
|
-
this.columnResize.resizable = this.props.resizable || false;
|
|
623
|
-
this.dragLogic.reorderable = this.props.reorderable || false;
|
|
624
|
-
this.dragLogic.groupable = groupable;
|
|
625
|
-
var tableUserSelect = this.props.selectable && this.props.selectable.drag ? 'none' : undefined;
|
|
626
|
-
this.initializeVirtualization(total, groupable);
|
|
627
|
-
var children = this.childrenToArray(this.props.children);
|
|
628
|
-
this.initColumns(children, resolvedGroupsCount);
|
|
629
|
-
var toolbar = children.map(function (child) {
|
|
630
|
-
if (child && child.type && child.type.displayName === 'KendoReactGridToolbar') {
|
|
631
|
-
return React.cloneElement(child, __assign(__assign({}, child.props), { ariaControls: _this._gridRoleElementId }));
|
|
632
|
-
}
|
|
633
|
-
return null;
|
|
634
|
-
});
|
|
635
|
-
var noRecords = children.filter(function (child) { return child && child.type &&
|
|
636
|
-
child.type.displayName === 'KendoReactGridNoRecords'; });
|
|
637
|
-
var statusBar = children.filter(function (child) { return child && child.type &&
|
|
638
|
-
child.type.displayName === 'KendoReactGridStatusBar'; });
|
|
639
|
-
var leafColumns = this._columns.filter(function (c) { return c.children.length === 0; });
|
|
640
|
-
var groupingPanel = groupable && (React.createElement(GroupPanel, { group: this.props.group || [], groupChange: this.groupChange, pressHandler: this.dragLogic.pressHandler, dragHandler: this.dragLogic.dragHandler, releaseHandler: this.dragLogic.releaseHandler, refCallback: this.dragLogic.refGroupPanelDiv, resolveTitle: this.resolveTitle, ariaControls: this._gridRoleElementId, onContextMenu: this.onContextMenu }));
|
|
641
|
-
var _g = this.props, sort = _g.sort, sortable = _g.sortable, group = _g.group, filter = _g.filter, filterable = _g.filterable, _h = _g.filterOperators, filterOperators = _h === void 0 ? operators : _h, headerCellRender = _g.headerCellRender, columnMenu = _g.columnMenu;
|
|
642
|
-
var header = (React.createElement(Header, { size: this.props.size, columnResize: this.columnResize, staticHeaders: this.props.scrollable !== 'none', scrollableDataElement: function () { return _this.vs.container; }, draggable: this.props.reorderable || groupable, ref: this.headerRef, elemRef: this.headerElementRef, headerRow: this.getHeaderRow(sort, sortable, group, groupable, filter, filterable, filterOperators, headerCellRender, columnMenu, this._columns, this._columnsMap, this.isRtl), filterRow: this.props.filterable && React.createElement(FilterRow, { cells: this.props.cells, size: this.props.size, columns: this._columns, filter: this.props.filter, filterOperators: this.props.filterOperators || operators, filterChange: this.filterChange, sort: this.props.sort, cellRender: this.props.filterCellRender, isRtl: this.isRtl, ariaRowIndex: this._columnsMap.length + 1 }) || undefined, cols: leafColumns.map(function (column, index) { return (React.createElement("col", { key: index.toString(), width: getColumnWidth(column) })); }) }));
|
|
643
|
-
var scrollLeft = this.vs && this.vs.container && this.vs.container.scrollLeft || 0;
|
|
644
|
-
var tableWidth = parseFloat(((this.props.style || {}).width || '').toString());
|
|
645
|
-
var _j = tableColumnsVirtualization({
|
|
646
|
-
enabled: this.props.columnVirtualization,
|
|
647
|
-
columns: leafColumns,
|
|
648
|
-
tableViewPortWidth: tableWidth,
|
|
649
|
-
scrollLeft: scrollLeft
|
|
650
|
-
}), colSpans = _j.colSpans, isColHidden = _j.hiddenColumns;
|
|
651
|
-
var dataRow = function (item, rowId, rowDataIndex) {
|
|
652
|
-
var isInEdit = false;
|
|
653
|
-
var selectedValue = _this.props.selectedField ? getNestedValue(_this.props.selectedField, item.dataItem) : undefined;
|
|
654
|
-
return {
|
|
655
|
-
row: leafColumns.map(function (column, columnIndex) {
|
|
656
|
-
if (isColHidden[columnIndex]) {
|
|
657
|
-
return null;
|
|
658
|
-
}
|
|
659
|
-
var columnKey = column.id ? column.id : columnIndex;
|
|
660
|
-
var className = "".concat(column.className ? column.className + ' ' : '')
|
|
661
|
-
+ "".concat(column.locked ? 'k-grid-content-sticky' : '');
|
|
662
|
-
var style = column.left !== undefined
|
|
663
|
-
? !_this.isRtl
|
|
664
|
-
? { left: column.left, right: column.right }
|
|
665
|
-
: { left: column.right, right: column.left }
|
|
666
|
-
: {};
|
|
667
|
-
var currentColumnIsInEdit = false;
|
|
668
|
-
if (column.editable && _this.props.editField) {
|
|
669
|
-
var inEdit = getNestedValue(_this.props.editField, item.dataItem);
|
|
670
|
-
if (inEdit && (inEdit === true || inEdit === column.field)) {
|
|
671
|
-
isInEdit = true;
|
|
672
|
-
currentColumnIsInEdit = true;
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
var Cell = column.cell || (currentColumnIsInEdit && GridEditCell) || GridCell;
|
|
676
|
-
return (React.createElement(Cell, { onContextMenu: _this.onContextMenu, key: columnKey, locked: _this.props.lockGroups, id: navigationTools.generateNavigatableId("".concat(rowId, "-").concat(String(columnIndex)), idPrefix), colSpan: colSpans[columnIndex], dataItem: item.dataItem, field: column.field, editor: column.editor, format: column.format, className: className, render: _this.props.cellRender, cells: resolveCells(_this.props.cells, column.cells), onChange: _this.itemChange, selectionChange: (_this.props.onSelectionChange) ?
|
|
677
|
-
(function (e) { _this.selectionChange({ event: e, dataItem: item.dataItem, dataIndex: rowDataIndex, columnIndex: columnIndex }); }) :
|
|
678
|
-
undefined, columnIndex: columnIndex, columnsCount: leafColumns.length, rowType: item.rowType, level: item.level, expanded: item.expanded, dataIndex: item.dataIndex, style: style, ariaColumnIndex: column.ariaColumnIndex, isSelected: Array.isArray(selectedValue) && selectedValue.indexOf(columnIndex) > -1 }));
|
|
679
|
-
}),
|
|
680
|
-
isInEdit: isInEdit,
|
|
681
|
-
isSelected: typeof selectedValue === 'boolean' && selectedValue
|
|
682
|
-
};
|
|
683
|
-
};
|
|
684
|
-
var hiddenRows = 0;
|
|
685
|
-
if (this.props.scrollable === 'virtual') {
|
|
686
|
-
for (var i = 0; i < this.vs.topCacheCount + this.vs.attendedSkip - (this.props.skip || 0); i++) {
|
|
687
|
-
var item = this._data.shift();
|
|
688
|
-
if (item) {
|
|
689
|
-
this._data.push(item);
|
|
690
|
-
hiddenRows++;
|
|
691
|
-
if (item.rowType === 'groupHeader') {
|
|
692
|
-
i--;
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
else {
|
|
696
|
-
break;
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
var hidden = function (index) {
|
|
701
|
-
return (index >= _this._data.length - hiddenRows);
|
|
702
|
-
};
|
|
703
|
-
var absoluteDataIndex = this.vs.realSkip || 0;
|
|
704
|
-
var body = [];
|
|
705
|
-
var rowIndexStart = this._columnsMap.length + (this.props.filterable ? 1 : 0) + 1;
|
|
706
|
-
var currentAriaRowIndex = 0;
|
|
707
|
-
if (this._data.length) {
|
|
708
|
-
var dataIndex_1 = -1;
|
|
709
|
-
var detailRowCount_1 = 0;
|
|
710
|
-
(this._slicedData || this._data).forEach(function (item, rowIndex) {
|
|
711
|
-
if (item.rowType === 'data') {
|
|
712
|
-
absoluteDataIndex++;
|
|
713
|
-
dataIndex_1++;
|
|
714
|
-
}
|
|
715
|
-
var isAlt = absoluteDataIndex % 2 === 0;
|
|
716
|
-
var dataItemKey = _this.props.dataItemKey && getter(_this.props.dataItemKey)(item.dataItem);
|
|
717
|
-
var absoluteIndex = rowIndex + (_this.vs.realSkip || 0);
|
|
718
|
-
var rowId = dataItemKey ? dataItemKey : 'ai' + absoluteIndex;
|
|
719
|
-
var detailRowId = rowId + '_1';
|
|
720
|
-
var gridRow = dataRow(item, rowId, dataIndex_1);
|
|
721
|
-
currentAriaRowIndex = absoluteIndex + rowIndexStart + detailRowCount_1;
|
|
722
|
-
body.push((React.createElement(GridRow, { key: rowId, dataItem: item.dataItem, isAltRow: isAlt, isInEdit: gridRow.isInEdit, rowType: item.rowType, isHidden: hidden(rowIndex), onClick: function (e) { return _this.rowClick(e, item); }, onDoubleClick: function (e) { return _this.rowDblClick(e, item); }, selectedField: _this.props.selectedField, rowHeight: _this.props.rowHeight, render: _this.props.rowRender, ariaRowIndex: currentAriaRowIndex, absoluteRowIndex: absoluteIndex, dataIndex: dataIndex_1, isSelected: gridRow.isSelected }, gridRow.row)));
|
|
723
|
-
if (_this.props.detail && item.rowType === 'data' && item.expanded) {
|
|
724
|
-
var detailColspan = (leafColumns.length
|
|
725
|
-
- (_this.props.expandField ? 1 : 0)
|
|
726
|
-
- (_this.props.group ? _this.props.group.length : 0)) || 1;
|
|
727
|
-
detailRowCount_1++;
|
|
728
|
-
currentAriaRowIndex = absoluteIndex + rowIndexStart + detailRowCount_1;
|
|
729
|
-
body.push((React.createElement("tr", { key: detailRowId, className: classNames('k-table-row', isAlt ? 'k-detail-row k-table-alt-row k-alt' : 'k-detail-row'), style: { visibility: hidden(rowIndex) ? 'hidden' : '', height: _this.props.detailRowHeight }, role: "row", "aria-rowindex": currentAriaRowIndex },
|
|
730
|
-
_this.props.group && _this.props.group.map(function (gr, idx) {
|
|
731
|
-
var _a;
|
|
732
|
-
var columnStyle = (_a = gridRow === null || gridRow === void 0 ? void 0 : gridRow.row[idx]) === null || _a === void 0 ? void 0 : _a.props.style;
|
|
733
|
-
var style = columnStyle
|
|
734
|
-
? !_this.isRtl
|
|
735
|
-
? { left: columnStyle.left, right: columnStyle.right }
|
|
736
|
-
: { left: columnStyle.right, right: columnStyle.left }
|
|
737
|
-
: {};
|
|
738
|
-
return (React.createElement(GridGroupCell, { id: '', dataIndex: item.dataIndex, field: gr.field, dataItem: item.dataItem, key: idx, style: style, ariaColumnIndex: 1 + idx, isSelected: false, locked: _this.props.lockGroups, isRtl: _this.isRtl, cells: _this.props.cells }));
|
|
739
|
-
}),
|
|
740
|
-
_this.props.expandField &&
|
|
741
|
-
React.createElement(GridDetailHierarchyCell, { id: navigationTools.generateNavigatableId("".concat(detailRowId, "-dhcell"), idPrefix) }),
|
|
742
|
-
React.createElement(GridDetailCell, { onContextMenu: _this.onContextMenu, dataItem: item.dataItem, dataIndex: item.dataIndex, colSpan: detailColspan, ariaColIndex: 2 + (_this.props.group ? _this.props.group.length : 0), detail: _this.props.detail, id: navigationTools.generateNavigatableId("".concat(detailRowId, "-dcell"), idPrefix) }))));
|
|
743
|
-
}
|
|
744
|
-
});
|
|
745
|
-
}
|
|
746
|
-
else {
|
|
747
|
-
body.push((React.createElement("tr", { key: "no-records", className: "k-table-row k-grid-norecords", role: 'row', "aria-rowindex": rowIndexStart },
|
|
748
|
-
React.createElement("td", { className: 'k-table-td', colSpan: leafColumns.length, role: 'gridcell' }, noRecords.length ? noRecords : React.createElement(GridNoRecords, null)))));
|
|
749
|
-
}
|
|
750
|
-
var pagerProps = __assign({ size: this.props.size, onPageChange: this.pagerPageChange, total: total, dir: this.isRtl ? 'rtl' : undefined, skip: this.vs.propsSkip || 0, take: (this.props.take !== undefined ? this.props.take : this.props.pageSize) || 10, messagesMap: pagerMessagesMap }, (normalize(this.props.pageable || {})));
|
|
751
|
-
var pager = this.props.pager ? React.createElement(this.props.pager, __assign({}, pagerProps)) : React.createElement(Pager, __assign({ className: "k-grid-pager" }, pagerProps));
|
|
752
|
-
var sorted = function (field) {
|
|
753
|
-
return _this.props.sort && _this.props.sort.filter(function (descriptor) { return descriptor.field === field; }).length > 0;
|
|
754
|
-
};
|
|
755
|
-
var footerCols = function (column, index) {
|
|
756
|
-
return (React.createElement("col", { key: index.toString(), width: getColumnWidth(column) }));
|
|
757
|
-
};
|
|
758
|
-
var footer = (Boolean((_e = this.props.cells) === null || _e === void 0 ? void 0 : _e.footerCell)
|
|
759
|
-
|| this._columns.some(function (c) { var _a; return Boolean(c.footerCell || Boolean((_a = c.cells) === null || _a === void 0 ? void 0 : _a.footerCell)); }))
|
|
760
|
-
? (React.createElement(Footer, { size: this.props.size, columnResize: this.columnResize, staticHeaders: this.props.scrollable !== 'none', ref: function (f) { return _this._footer = f; }, row: React.createElement(FooterRow, { cells: this.props.cells, columns: this._columns, isRtl: this.isRtl, ariaRowIndex: currentAriaRowIndex + 1 }), cols: leafColumns.map(footerCols) })) : null;
|
|
761
|
-
var colGroups = (React.createElement("colgroup", { ref: function (c) {
|
|
762
|
-
_this.columnResize.colGroupMain = c;
|
|
763
|
-
} }, leafColumns.map(function (column, index) { return (React.createElement("col", { key: index.toString(), className: sorted(column.field) ? 'k-sorted' : undefined, width: getColumnWidth(column) })); })));
|
|
764
|
-
var enableDragClues = this.dragLogic.reorderable || this.dragLogic.groupable;
|
|
765
|
-
var tableDisplay = this.props.columnVirtualization ? 'block' : 'table';
|
|
766
|
-
if (this.props.scrollable === 'none') {
|
|
767
|
-
return (React.createElement(TableKeyboardNavigationContext.Provider, { value: this.contextStateRef.current },
|
|
768
|
-
React.createElement("div", __assign({ id: this.props.id, style: this.props.style, className: classNames('k-grid', (_a = {
|
|
769
|
-
'k-grid-md': !this.props.size
|
|
770
|
-
},
|
|
771
|
-
_a["k-grid-".concat(kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,
|
|
772
|
-
_a), this.props.className), ref: function (el) { _this._element = el; }, "aria-label": this.props.ariaLabel, onKeyDown: this.onKeyDown, onFocus: this.onFocus }, tableKeyboardNavigationScopeAttributes),
|
|
773
|
-
toolbar,
|
|
774
|
-
groupingPanel,
|
|
775
|
-
React.createElement(TableSelection, { selectable: this.props.selectable, onRelease: this.selectionRelease, childRef: function (table) { _this.tableElement = table; } },
|
|
776
|
-
React.createElement("table", { className: classNames('k-table k-grid-table', (_b = {}, _b["k-table-".concat(kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size, _b)), style: { userSelect: tableUserSelect, display: tableDisplay } },
|
|
777
|
-
colGroups,
|
|
778
|
-
header,
|
|
779
|
-
React.createElement("tbody", __assign({ role: 'rowgroup', className: 'k-table-tbody' }, tableKeyboardNavigationBodyAttributes), body),
|
|
780
|
-
footer)),
|
|
781
|
-
enableDragClues && (React.createElement(React.Fragment, null,
|
|
782
|
-
React.createElement(DropClue, { ref: this.dragLogic.refDropElementClue }),
|
|
783
|
-
React.createElement(DragClue, { ref: this.dragLogic.refDragElementClue })))),
|
|
784
|
-
statusBar,
|
|
785
|
-
this.props.pageable && pager));
|
|
786
|
-
}
|
|
787
|
-
var wrapperStyle = this.props.style || {};
|
|
788
|
-
if (this.props.scrollable === 'virtual') {
|
|
789
|
-
// Set the default height for vs if not existing.
|
|
790
|
-
if (!wrapperStyle.height) {
|
|
791
|
-
wrapperStyle = Object.assign({}, wrapperStyle, { height: '450px' });
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
return (React.createElement(TableKeyboardNavigationContext.Provider, { value: this.contextStateRef.current },
|
|
795
|
-
React.createElement("div", __assign({ id: this.props.id, style: wrapperStyle, className: classNames('k-grid', (_c = {
|
|
796
|
-
'k-grid-md': !this.props.size
|
|
797
|
-
},
|
|
798
|
-
_c["k-grid-".concat(kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,
|
|
799
|
-
_c['k-grid-virtual'] = this.props.scrollable === 'virtual',
|
|
800
|
-
_c), this.props.className), ref: function (el) {
|
|
801
|
-
_this._element = el;
|
|
802
|
-
}, "aria-label": this.props.ariaLabel, onKeyDown: this.onKeyDown, onFocus: this.onFocus }, tableKeyboardNavigationScopeAttributes),
|
|
803
|
-
toolbar,
|
|
804
|
-
groupingPanel,
|
|
805
|
-
React.createElement("div", { className: 'k-grid-aria-root', role: "grid", "aria-colcount": leafColumns.length, "aria-rowcount": total, id: this._gridRoleElementId },
|
|
806
|
-
header,
|
|
807
|
-
React.createElement("div", { className: "k-grid-container", role: "presentation" },
|
|
808
|
-
React.createElement("div", { ref: this.containerRef, className: "k-grid-content k-virtual-content", onScroll: this.scrollHandler, role: "presentation" },
|
|
809
|
-
React.createElement("div", { className: 'k-grid-table-wrap', role: "presentation" },
|
|
810
|
-
React.createElement(TableSelection, { selectable: this.props.selectable, onRelease: this.selectionRelease, childRef: function (table) {
|
|
811
|
-
_this.tableElement = table;
|
|
812
|
-
} },
|
|
813
|
-
React.createElement("table", { className: classNames('k-table k-grid-table', (_d = {
|
|
814
|
-
'k-table-md': !this.props.size
|
|
815
|
-
},
|
|
816
|
-
_d["k-table-".concat(kendoThemeMaps.sizeMap[this.props.size] || this.props.size)] = this.props.size,
|
|
817
|
-
_d)), role: "presentation", style: { userSelect: tableUserSelect, display: tableDisplay } },
|
|
818
|
-
colGroups,
|
|
819
|
-
React.createElement("tbody", __assign({ className: 'k-table-tbody', ref: this.tableBodyRef, role: 'rowgroup' }, tableKeyboardNavigationBodyAttributes), body)))),
|
|
820
|
-
React.createElement("div", { className: "k-height-container", role: "presentation" },
|
|
821
|
-
React.createElement("div", { style: this.props.scrollable === 'virtual' ?
|
|
822
|
-
{ 'height': (this.vs.containerHeight) + 'px' } : {} })))),
|
|
823
|
-
footer,
|
|
824
|
-
enableDragClues && (React.createElement(React.Fragment, null,
|
|
825
|
-
React.createElement(DropClue, { ref: this.dragLogic.refDropElementClue }),
|
|
826
|
-
React.createElement(DragClue, { ref: this.dragLogic.refDragElementClue }))),
|
|
827
|
-
this.showLicenseWatermark && React.createElement(WatermarkOverlay, null)),
|
|
828
|
-
statusBar,
|
|
829
|
-
this.props.pageable && pager)));
|
|
830
|
-
};
|
|
831
|
-
Grid.prototype.selectionChange = function (options) {
|
|
832
|
-
if (this.props.onSelectionChange) {
|
|
833
|
-
var event_1 = options.event, dataItem = options.dataItem, dataIndex = options.dataIndex, columnIndex = options.columnIndex;
|
|
834
|
-
var _a = getSelectionOptions(this.props.selectable), mode = _a.mode, cell = _a.cell;
|
|
835
|
-
var selectionEvent = __assign(__assign({}, this.getArguments(event_1.syntheticEvent)), { dataItem: dataItem, startColIndex: columnIndex, endColIndex: columnIndex, startRowIndex: dataIndex, endRowIndex: dataIndex, dataItems: this.getLeafDataItems(), altKey: false, ctrlKey: false, shiftKey: false, metaKey: false, mode: mode, cell: cell, isDrag: false, componentId: this._gridId, selectedField: this.props.selectedField || '' });
|
|
836
|
-
this.props.onSelectionChange.call(undefined, selectionEvent);
|
|
837
|
-
}
|
|
838
|
-
};
|
|
839
|
-
Grid.prototype.raiseDataEvent = function (handler, data, moreData, syntheticEvent, targetEvent) {
|
|
840
|
-
var dataStateChange = this.props.onDataStateChange;
|
|
841
|
-
if (handler) {
|
|
842
|
-
var ev = __assign(__assign(__assign({}, this.getArguments(syntheticEvent)), data), { targetEvent: targetEvent });
|
|
843
|
-
handler.call(undefined, ev);
|
|
844
|
-
}
|
|
845
|
-
else if (dataStateChange) {
|
|
846
|
-
dataStateChange.call(undefined, __assign(__assign({}, this.getArguments(syntheticEvent)), { targetEvent: targetEvent || {}, dataState: __assign(__assign({}, this.getDataState()), moreData) }));
|
|
847
|
-
}
|
|
848
|
-
};
|
|
849
|
-
Grid.prototype.columnReorder = function (prev, next, nativeEvent) {
|
|
850
|
-
var _a;
|
|
851
|
-
var _this = this;
|
|
852
|
-
var column = this._columns[prev];
|
|
853
|
-
var depth = column.depth;
|
|
854
|
-
var end = function (index) {
|
|
855
|
-
do {
|
|
856
|
-
index++;
|
|
857
|
-
} while (index < _this._columns.length && _this._columns[index].depth > depth);
|
|
858
|
-
return index;
|
|
859
|
-
};
|
|
860
|
-
var spliced = this._columns.splice(prev, end(prev) - prev);
|
|
861
|
-
(_a = this._columns).splice.apply(_a, __spreadArray([prev < next ? end(next - spliced.length) : next, 0], spliced, false));
|
|
862
|
-
this._columns.filter(function (q) { return q.declarationIndex >= 0; }).forEach(function (c, i) { return c.orderIndex = i; });
|
|
863
|
-
this._columnsMutations++;
|
|
864
|
-
var shouldUpdateRL = this._columns[prev].locked && this._columns[next].locked;
|
|
865
|
-
updateLeft(this._columnsMap, this._columns, shouldUpdateRL || this._shouldUpdateLeftRight);
|
|
866
|
-
updateRight(this._columnsMap, this._columns, shouldUpdateRL || this._shouldUpdateLeftRight);
|
|
867
|
-
if (this._resized) {
|
|
868
|
-
this._shouldUpdateLeftRight = false;
|
|
869
|
-
this._resized = false;
|
|
870
|
-
}
|
|
871
|
-
var eventColumnProps = this.columns;
|
|
872
|
-
this.forceUpdate();
|
|
873
|
-
if (this.props.onColumnReorder) {
|
|
874
|
-
var reorderEvent = {
|
|
875
|
-
target: this,
|
|
876
|
-
columns: eventColumnProps,
|
|
877
|
-
columnId: column.id,
|
|
878
|
-
nativeEvent: nativeEvent
|
|
879
|
-
};
|
|
880
|
-
this.props.onColumnReorder.call(undefined, reorderEvent);
|
|
881
|
-
}
|
|
882
|
-
};
|
|
883
|
-
Grid.prototype.groupReorder = function (prevIndex, nextIndex, nativeEvent) {
|
|
884
|
-
if (this.props.group === undefined) {
|
|
885
|
-
return;
|
|
886
|
-
}
|
|
887
|
-
var group = this.props.group.slice();
|
|
888
|
-
group.splice.apply(group, __spreadArray([nextIndex, 0], group.splice(prevIndex, 1), false));
|
|
889
|
-
this.groupChange(group, nativeEvent);
|
|
890
|
-
};
|
|
891
|
-
Grid.prototype.columnToGroup = function (columnIndex, groupIndex, nativeEvent) {
|
|
892
|
-
var field = this._columns[columnIndex].field;
|
|
893
|
-
if (!field) {
|
|
894
|
-
return;
|
|
895
|
-
}
|
|
896
|
-
var group = (this.props.group || []).slice();
|
|
897
|
-
group.splice(groupIndex, 0, { field: field });
|
|
898
|
-
this.groupChange(group, nativeEvent);
|
|
899
|
-
};
|
|
900
|
-
Grid.prototype.resetTableWidth = function () {
|
|
901
|
-
var totalWidth = 0;
|
|
902
|
-
if (!this.columnResize.colGroupMain) {
|
|
903
|
-
return;
|
|
904
|
-
}
|
|
905
|
-
var colElements = this.columnResize.colGroupMain.children;
|
|
906
|
-
for (var i = 0; i < colElements.length; i++) {
|
|
907
|
-
var width = colElements[i].width;
|
|
908
|
-
if (!width) {
|
|
909
|
-
return;
|
|
910
|
-
}
|
|
911
|
-
totalWidth += parseFloat(width.toString());
|
|
912
|
-
}
|
|
913
|
-
totalWidth = Math.round(totalWidth);
|
|
914
|
-
if (this._header) {
|
|
915
|
-
this._header.setWidth(totalWidth);
|
|
916
|
-
}
|
|
917
|
-
if (this._footer) {
|
|
918
|
-
this._footer.setWidth(totalWidth);
|
|
919
|
-
}
|
|
920
|
-
if (this.tableElement) {
|
|
921
|
-
this.tableElement.style.width = totalWidth + 'px';
|
|
922
|
-
}
|
|
923
|
-
};
|
|
924
|
-
Grid.prototype.initColumns = function (children, groupCount) {
|
|
925
|
-
var idPrefix = navigationTools.getIdPrefix(this.navigationStateRef);
|
|
926
|
-
this._columns = this.readColumns(children, idPrefix, this._columnsMutations);
|
|
927
|
-
if (this._columns.length === 0) {
|
|
928
|
-
this._columns = autoGenerateColumns(this.props.data, this.props.group, this.props.expandField, { prevId: 0, idPrefix: idPrefix });
|
|
929
|
-
}
|
|
930
|
-
this.configureColumns(this._columns, groupCount, idPrefix);
|
|
931
|
-
this._columnsMap = this.mapColumns(this._columns);
|
|
932
|
-
this.columnResize.columns = this._columns;
|
|
933
|
-
this.dragLogic.columns = this._columns;
|
|
934
|
-
};
|
|
935
|
-
Grid.prototype.getDataState = function () {
|
|
936
|
-
return {
|
|
937
|
-
filter: this.props.filter,
|
|
938
|
-
sort: this.props.sort,
|
|
939
|
-
skip: this.props.skip,
|
|
940
|
-
take: (this.props.take !== undefined ? this.props.take : this.props.pageSize),
|
|
941
|
-
group: this.props.group
|
|
942
|
-
};
|
|
943
|
-
};
|
|
944
|
-
Grid.prototype.getArguments = function (syntheticEvent) {
|
|
945
|
-
return {
|
|
946
|
-
nativeEvent: syntheticEvent && syntheticEvent.nativeEvent,
|
|
947
|
-
syntheticEvent: syntheticEvent,
|
|
948
|
-
target: this
|
|
949
|
-
};
|
|
950
|
-
};
|
|
951
|
-
/**
|
|
952
|
-
* @hidden
|
|
953
|
-
*/
|
|
954
|
-
Grid.displayName = 'KendoReactGrid';
|
|
955
|
-
/**
|
|
956
|
-
* @hidden
|
|
957
|
-
*/
|
|
958
|
-
Grid.defaultProps = {
|
|
959
|
-
// never use this
|
|
960
|
-
};
|
|
961
|
-
/**
|
|
962
|
-
* @hidden
|
|
963
|
-
*/
|
|
964
|
-
Grid.propTypes = {
|
|
965
|
-
data: PropTypes.oneOfType([
|
|
966
|
-
PropTypes.array,
|
|
967
|
-
PropTypes.shape({
|
|
968
|
-
data: PropTypes.array,
|
|
969
|
-
total: PropTypes.number
|
|
970
|
-
})
|
|
971
|
-
]),
|
|
972
|
-
sortable: PropTypes.oneOfType([
|
|
973
|
-
PropTypes.bool,
|
|
974
|
-
PropTypes.shape({
|
|
975
|
-
mode: PropTypes.oneOf(['single', 'multiple']),
|
|
976
|
-
allowUnsort: PropTypes.bool
|
|
977
|
-
})
|
|
978
|
-
]),
|
|
979
|
-
onSortChange: PropTypes.func,
|
|
980
|
-
sort: PropTypes.array,
|
|
981
|
-
filterable: PropTypes.bool,
|
|
982
|
-
filter: PropTypes.any,
|
|
983
|
-
onFilterChange: PropTypes.func,
|
|
984
|
-
pageable: PropTypes.oneOfType([
|
|
985
|
-
PropTypes.bool,
|
|
986
|
-
PropTypes.shape({
|
|
987
|
-
buttonCount: PropTypes.number,
|
|
988
|
-
info: PropTypes.bool,
|
|
989
|
-
type: PropTypes.oneOf(['numeric', 'input']),
|
|
990
|
-
pageSizes: PropTypes.oneOfType([
|
|
991
|
-
PropTypes.bool,
|
|
992
|
-
PropTypes.arrayOf(PropTypes.oneOfType([
|
|
993
|
-
PropTypes.string,
|
|
994
|
-
PropTypes.number
|
|
995
|
-
]))
|
|
996
|
-
]),
|
|
997
|
-
previousNext: PropTypes.bool
|
|
998
|
-
})
|
|
999
|
-
]),
|
|
1000
|
-
pageSize: PropTypes.number,
|
|
1001
|
-
onPageChange: PropTypes.func,
|
|
1002
|
-
total: PropTypes.number,
|
|
1003
|
-
skip: PropTypes.number,
|
|
1004
|
-
take: PropTypes.number,
|
|
1005
|
-
fixedScroll: PropTypes.bool,
|
|
1006
|
-
onExpandChange: PropTypes.func,
|
|
1007
|
-
expandField: PropTypes.string,
|
|
1008
|
-
selectedField: PropTypes.string,
|
|
1009
|
-
onSelectionChange: PropTypes.func,
|
|
1010
|
-
onHeaderSelectionChange: PropTypes.func,
|
|
1011
|
-
resizable: PropTypes.bool,
|
|
1012
|
-
reorderable: PropTypes.bool,
|
|
1013
|
-
group: PropTypes.any,
|
|
1014
|
-
groupable: PropTypes.oneOfType([
|
|
1015
|
-
PropTypes.bool,
|
|
1016
|
-
PropTypes.shape({
|
|
1017
|
-
enabled: PropTypes.bool,
|
|
1018
|
-
footer: PropTypes.oneOf(['always', 'visible', 'none'])
|
|
1019
|
-
})
|
|
1020
|
-
]),
|
|
1021
|
-
onGroupChange: PropTypes.func,
|
|
1022
|
-
onRowClick: PropTypes.func,
|
|
1023
|
-
onRowDoubleClick: PropTypes.func,
|
|
1024
|
-
onItemChange: PropTypes.func,
|
|
1025
|
-
editField: PropTypes.string,
|
|
1026
|
-
scrollable: PropTypes.oneOf(['none', 'scrollable', 'virtual']),
|
|
1027
|
-
rowHeight: PropTypes.number,
|
|
1028
|
-
detailRowHeight: PropTypes.number,
|
|
1029
|
-
detail: PropTypes.any,
|
|
1030
|
-
style: PropTypes.object,
|
|
1031
|
-
onDataStateChange: PropTypes.func,
|
|
1032
|
-
onColumnResize: PropTypes.func,
|
|
1033
|
-
onColumnReorder: PropTypes.func,
|
|
1034
|
-
dataItemKey: PropTypes.string,
|
|
1035
|
-
navigatable: PropTypes.bool,
|
|
1036
|
-
size: PropTypes.oneOf(['small', 'medium'])
|
|
1037
|
-
};
|
|
1038
|
-
/** @hidden */
|
|
1039
|
-
Grid.contextType = TableKeyboardNavigationContext;
|
|
1040
|
-
return Grid;
|
|
1041
|
-
}(React.Component));
|
|
1042
|
-
export { Grid };
|