@progress/kendo-react-grid 7.2.4-develop.3 → 7.3.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/Grid.js +8 -0
- package/Grid.mjs +1111 -0
- package/GridColumn.js +8 -0
- package/GridColumn.mjs +53 -0
- package/GridNoRecords.js +8 -0
- package/GridNoRecords.mjs +25 -0
- package/GridToolbar.js +8 -0
- package/GridToolbar.mjs +39 -0
- package/StatusBar.js +8 -0
- package/StatusBar.mjs +53 -0
- package/VirtualScroll.js +8 -0
- package/VirtualScroll.mjs +128 -0
- package/VirtualScrollFixed.js +8 -0
- package/VirtualScrollFixed.mjs +86 -0
- package/cells/GridCell.js +8 -0
- package/cells/GridCell.mjs +57 -0
- package/cells/GridDetailCell.js +8 -0
- package/cells/GridDetailCell.mjs +30 -0
- package/cells/GridDetailHierarchyCell.js +8 -0
- package/cells/GridDetailHierarchyCell.mjs +17 -0
- package/cells/GridEditCell.js +8 -0
- package/cells/GridEditCell.mjs +172 -0
- package/cells/GridFilterCell.js +8 -0
- package/cells/GridFilterCell.mjs +145 -0
- package/cells/GridGroupCell.js +8 -0
- package/cells/GridGroupCell.mjs +115 -0
- package/cells/GridHierarchyCell.js +8 -0
- package/cells/GridHierarchyCell.mjs +84 -0
- package/cells/GridSelectionCell.js +8 -0
- package/cells/GridSelectionCell.mjs +54 -0
- package/columnMenu/GridColumnMenuCheckboxFilter.js +8 -0
- package/columnMenu/GridColumnMenuCheckboxFilter.mjs +199 -0
- package/columnMenu/GridColumnMenuColumnsList.js +8 -0
- package/columnMenu/GridColumnMenuColumnsList.mjs +60 -0
- package/columnMenu/GridColumnMenuFilter.js +8 -0
- package/columnMenu/GridColumnMenuFilter.mjs +188 -0
- package/columnMenu/GridColumnMenuFilterCell.js +8 -0
- package/columnMenu/GridColumnMenuFilterCell.mjs +96 -0
- package/columnMenu/GridColumnMenuFilterUI.js +8 -0
- package/columnMenu/GridColumnMenuFilterUI.mjs +36 -0
- package/columnMenu/GridColumnMenuGroup.js +8 -0
- package/columnMenu/GridColumnMenuGroup.mjs +50 -0
- package/columnMenu/GridColumnMenuItem.js +8 -0
- package/columnMenu/GridColumnMenuItem.mjs +22 -0
- package/columnMenu/GridColumnMenuItemContent.js +8 -0
- package/columnMenu/GridColumnMenuItemContent.mjs +30 -0
- package/columnMenu/GridColumnMenuItemGroup.js +8 -0
- package/columnMenu/GridColumnMenuItemGroup.mjs +30 -0
- package/columnMenu/GridColumnMenuSort.js +8 -0
- package/columnMenu/GridColumnMenuSort.mjs +75 -0
- package/columnMenu/GridColumnMenuWrapper.js +8 -0
- package/columnMenu/GridColumnMenuWrapper.mjs +91 -0
- package/constants/index.js +8 -0
- package/constants/index.mjs +15 -0
- package/dist/cdn/js/kendo-react-grid.js +8 -5
- package/drag/ColumnDraggable.js +8 -0
- package/drag/ColumnDraggable.mjs +43 -0
- package/drag/ColumnResize.js +8 -0
- package/drag/ColumnResize.mjs +128 -0
- package/drag/CommonDragLogic.js +8 -0
- package/drag/CommonDragLogic.mjs +104 -0
- package/drag/GroupingIndicator.js +8 -0
- package/drag/GroupingIndicator.mjs +91 -0
- package/filterCommon.js +8 -0
- package/filterCommon.mjs +103 -0
- package/footer/Footer.js +8 -0
- package/footer/Footer.mjs +76 -0
- package/footer/FooterRow.js +8 -0
- package/footer/FooterRow.mjs +46 -0
- package/header/FilterRow.js +8 -0
- package/header/FilterRow.mjs +96 -0
- package/header/GridHeaderCell.js +8 -0
- package/header/GridHeaderCell.mjs +38 -0
- package/header/GridHeaderSelectionCell.js +8 -0
- package/header/GridHeaderSelectionCell.mjs +44 -0
- package/header/GroupPanel.js +8 -0
- package/header/GroupPanel.mjs +60 -0
- package/header/Header.js +8 -0
- package/header/Header.mjs +107 -0
- package/header/HeaderRow.js +8 -0
- package/header/HeaderRow.mjs +155 -0
- package/index.d.mts +2777 -5
- package/index.d.ts +2777 -57
- package/index.js +8 -5
- package/index.mjs +89 -3845
- package/interfaces/GridSortSettings.js +8 -0
- package/interfaces/GridSortSettings.mjs +12 -0
- package/messages/index.js +8 -0
- package/messages/index.mjs +107 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +10 -10
- package/paging/GridPagerSettings.js +8 -0
- package/paging/GridPagerSettings.mjs +28 -0
- package/rows/GridDetailRow.js +8 -0
- package/rows/GridDetailRow.mjs +20 -0
- package/rows/GridRow.js +8 -0
- package/rows/GridRow.mjs +51 -0
- package/utils/index.js +8 -0
- package/utils/index.mjs +180 -0
- package/Grid.d.ts +0 -267
- package/GridColumn.d.ts +0 -28
- package/GridNoRecords.d.ts +0 -40
- package/GridToolbar.d.ts +0 -54
- package/ScrollMode.d.ts +0 -5
- package/StatusBar.d.ts +0 -51
- package/VirtualScroll.d.ts +0 -51
- package/VirtualScrollFixed.d.ts +0 -53
- package/cells/GridCell.d.ts +0 -6
- package/cells/GridDetailCell.d.ts +0 -18
- package/cells/GridDetailHierarchyCell.d.ts +0 -10
- package/cells/GridEditCell.d.ts +0 -9
- package/cells/GridFilterCell.d.ts +0 -20
- package/cells/GridGroupCell.d.ts +0 -9
- package/cells/GridHierarchyCell.d.ts +0 -9
- package/cells/GridSelectionCell.d.ts +0 -9
- package/columnMenu/GridColumnMenuCheckboxFilter.d.ts +0 -122
- package/columnMenu/GridColumnMenuColumnsList.d.ts +0 -31
- package/columnMenu/GridColumnMenuFilter.d.ts +0 -165
- package/columnMenu/GridColumnMenuFilterCell.d.ts +0 -37
- package/columnMenu/GridColumnMenuFilterUI.d.ts +0 -12
- package/columnMenu/GridColumnMenuGroup.d.ts +0 -77
- package/columnMenu/GridColumnMenuItem.d.ts +0 -40
- package/columnMenu/GridColumnMenuItemContent.d.ts +0 -24
- package/columnMenu/GridColumnMenuItemGroup.d.ts +0 -20
- package/columnMenu/GridColumnMenuSort.d.ts +0 -89
- package/columnMenu/GridColumnMenuWrapper.d.ts +0 -49
- package/constants/index.d.ts +0 -10
- package/drag/ColumnDraggable.d.ts +0 -38
- package/drag/ColumnResize.d.ts +0 -37
- package/drag/CommonDragLogic.d.ts +0 -44
- package/drag/GroupingIndicator.d.ts +0 -41
- package/filterCommon.d.ts +0 -73
- package/footer/Footer.d.ts +0 -38
- package/footer/FooterRow.d.ts +0 -25
- package/header/FilterRow.d.ts +0 -38
- package/header/GridHeaderCell.d.ts +0 -56
- package/header/GridHeaderSelectionCell.d.ts +0 -10
- package/header/GroupPanel.d.ts +0 -26
- package/header/Header.d.ts +0 -46
- package/header/HeaderRow.d.ts +0 -51
- package/interfaces/GridCellProps.d.ts +0 -73
- package/interfaces/GridCellsSettings.d.ts +0 -115
- package/interfaces/GridColumnMenuBaseProps.d.ts +0 -18
- package/interfaces/GridColumnMenuColumnProps.d.ts +0 -29
- package/interfaces/GridColumnMenuFilterBaseProps.d.ts +0 -28
- package/interfaces/GridColumnMenuFilterUIProps.d.ts +0 -35
- package/interfaces/GridColumnMenuGroupBaseProps.d.ts +0 -23
- package/interfaces/GridColumnMenuProps.d.ts +0 -12
- package/interfaces/GridColumnMenuSortBaseProps.d.ts +0 -24
- package/interfaces/GridColumnProps.d.ts +0 -92
- package/interfaces/GridDetailRowProps.d.ts +0 -17
- package/interfaces/GridFilterCellProps.d.ts +0 -68
- package/interfaces/GridFilterOperator.d.ts +0 -10
- package/interfaces/GridFilterOperators.d.ts +0 -53
- package/interfaces/GridFooterCellProps.d.ts +0 -26
- package/interfaces/GridGroupableSettings.d.ts +0 -17
- package/interfaces/GridHeaderCellProps.d.ts +0 -24
- package/interfaces/GridNoRecordsProps.d.ts +0 -13
- package/interfaces/GridProps.d.ts +0 -333
- package/interfaces/GridRowProps.d.ts +0 -67
- package/interfaces/GridRowType.d.ts +0 -13
- package/interfaces/GridSelectableSettings.d.ts +0 -22
- package/interfaces/GridSortSettings.d.ts +0 -17
- package/interfaces/GridToolbarProps.d.ts +0 -37
- package/interfaces/VirtualScrollInterface.d.ts +0 -31
- package/interfaces/events.d.ts +0 -232
- package/messages/index.d.ts +0 -199
- package/package-metadata.d.ts +0 -9
- package/paging/GridPagerSettings.d.ts +0 -71
- package/paging/Page.d.ts +0 -17
- package/rows/GridDetailRow.d.ts +0 -55
- package/rows/GridRow.d.ts +0 -15
- package/utils/index.d.ts +0 -73
package/Grid.mjs
ADDED
|
@@ -0,0 +1,1111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as r from "react";
|
|
10
|
+
import s from "prop-types";
|
|
11
|
+
import { dispatchEvent as Ae, canUseDOM as U, getActiveElement as Ge, memoizeOne as S, validatePackage as Ke, shouldShowValidationUI as Oe, setScrollbarWidth as re, getter as Pe, classNames as L, kendoThemeMaps as G, WatermarkOverlay as Ue } from "@progress/kendo-react-common";
|
|
12
|
+
import { tableKeyboardNavigation as x, getSelectionOptions as ae, mapColumns as Ve, tableKeyboardNavigationTools as _, ClipboardService as We, TableKeyboardNavigationContext as V, isRtl as Be, tableColumnsVirtualization as $e, Pager as je, tableKeyboardNavigationScopeAttributes as le, TableSelection as ne, tableKeyboardNavigationBodyAttributes as he, DropClue as pe, DragClue as de, updateLeft as qe, updateRight as Je } from "@progress/kendo-react-data-tools";
|
|
13
|
+
import { GridSelectionCell as Qe } from "./cells/GridSelectionCell.mjs";
|
|
14
|
+
import { GridHierarchyCell as Xe } from "./cells/GridHierarchyCell.mjs";
|
|
15
|
+
import { GridEditCell as Ye } from "./cells/GridEditCell.mjs";
|
|
16
|
+
import { Header as Ze } from "./header/Header.mjs";
|
|
17
|
+
import { HeaderRow as et } from "./header/HeaderRow.mjs";
|
|
18
|
+
import { FilterRow as tt } from "./header/FilterRow.mjs";
|
|
19
|
+
import { GroupPanel as st } from "./header/GroupPanel.mjs";
|
|
20
|
+
import { Footer as it } from "./footer/Footer.mjs";
|
|
21
|
+
import { provideLocalizationService as ot, registerForLocalization as rt } from "@progress/kendo-react-intl";
|
|
22
|
+
import { pagerMessagesMap as at, gridAriaLabel as ce, messages as lt } from "./messages/index.mjs";
|
|
23
|
+
import { VirtualScroll as nt } from "./VirtualScroll.mjs";
|
|
24
|
+
import { VirtualScrollFixed as ue, RowHeightService as ge } from "./VirtualScrollFixed.mjs";
|
|
25
|
+
import { ColumnResize as ht } from "./drag/ColumnResize.mjs";
|
|
26
|
+
import { CommonDragLogic as pt } from "./drag/CommonDragLogic.mjs";
|
|
27
|
+
import { firefox as me, firefoxMaxHeight as fe, flatData as dt, readColumns as ct, sanitizeColumns as ut, getColumnWidth as W, autoGenerateColumns as gt, getNestedValue as ve, resolveCells as mt } from "./utils/index.mjs";
|
|
28
|
+
import { GridCell as ft } from "./cells/GridCell.mjs";
|
|
29
|
+
import { GridGroupCell as be } from "./cells/GridGroupCell.mjs";
|
|
30
|
+
import { GridRow as vt } from "./rows/GridRow.mjs";
|
|
31
|
+
import { GridHeaderSelectionCell as bt } from "./header/GridHeaderSelectionCell.mjs";
|
|
32
|
+
import { GridNoRecords as Ct } from "./GridNoRecords.mjs";
|
|
33
|
+
import { operators as Ce } from "./filterCommon.mjs";
|
|
34
|
+
import { FooterRow as Rt } from "./footer/FooterRow.mjs";
|
|
35
|
+
import { normalize as yt } from "./paging/GridPagerSettings.mjs";
|
|
36
|
+
import { packageMetadata as Re } from "./package-metadata.mjs";
|
|
37
|
+
import { GridDetailCell as wt } from "./cells/GridDetailCell.mjs";
|
|
38
|
+
import { GridDetailHierarchyCell as St } from "./cells/GridDetailHierarchyCell.mjs";
|
|
39
|
+
const z = class z extends r.Component {
|
|
40
|
+
constructor(a) {
|
|
41
|
+
super(a), this._columns = [], this._columnsMap = [[]], this._columnsMutations = 0, this._resized = !1, this._shouldUpdateLeftRight = !0, this.contextStateRef = { current: void 0 }, this.navigationStateRef = { current: void 0 }, this._data = [], this._slicedData = void 0, this.wrapperScrollTop = 0, this.showLicenseWatermark = !1, this.headerRef = r.createRef(), this.headerElementRef = r.createRef(), this._element = null, this.tableElement = null, this.containerRef = r.createRef(), this.tableBodyRef = r.createRef(), this._footer = null, this.forceUpdateTimeout = void 0, this.isRtl = !1, this.observer = null, this.handleIntersection = (e) => {
|
|
42
|
+
const t = { rowIndex: this.rowIndex };
|
|
43
|
+
e.forEach((i) => {
|
|
44
|
+
i.isIntersecting || this.setCurrentOnTop(t);
|
|
45
|
+
});
|
|
46
|
+
}, this.setCurrentOnTop = (e) => {
|
|
47
|
+
if (!this.vs.container || this.props.scrollable === "none")
|
|
48
|
+
return;
|
|
49
|
+
this.observer && this.observer.disconnect();
|
|
50
|
+
const { rowIndex: t } = e;
|
|
51
|
+
if (this.props.scrollable === "virtual")
|
|
52
|
+
this.vs.askedSkip = t, this.vs.container.scroll(0, Math.round(this.vs.askedSkip / this.vs.total * this.vs.container.scrollHeight));
|
|
53
|
+
else if (this.element) {
|
|
54
|
+
const i = t < 1 ? this.element.querySelector("tbody > tr:nth-child(1)") : this.element.querySelector(`tbody > tr:nth-child(${t + 1})`);
|
|
55
|
+
i && this.containerRef.current && (this.containerRef.current.scrollTop = i.offsetTop);
|
|
56
|
+
}
|
|
57
|
+
}, this.scrollIntoView = (e) => {
|
|
58
|
+
if (!this.vs.container || this.props.scrollable === "none")
|
|
59
|
+
return;
|
|
60
|
+
this.rowIndex = e.rowIndex;
|
|
61
|
+
const { rowIndex: t } = e, i = this.element;
|
|
62
|
+
if (this.observer && i) {
|
|
63
|
+
this.observer.disconnect();
|
|
64
|
+
const n = i.querySelector(`[absolute-row-index="${t}"]`);
|
|
65
|
+
n ? this.observer.observe(n) : this.setCurrentOnTop(e);
|
|
66
|
+
}
|
|
67
|
+
}, this.fitColumns = (e) => {
|
|
68
|
+
this.columnResize.dblClickHandler(null, e);
|
|
69
|
+
}, this.onContextMenu = (e, t, i) => {
|
|
70
|
+
if (this.props.onContextMenu) {
|
|
71
|
+
const n = {
|
|
72
|
+
target: this,
|
|
73
|
+
syntheticEvent: e,
|
|
74
|
+
nativeEvent: e.nativeEvent,
|
|
75
|
+
dataItem: t,
|
|
76
|
+
field: i
|
|
77
|
+
};
|
|
78
|
+
this.props.onContextMenu.call(void 0, n);
|
|
79
|
+
}
|
|
80
|
+
}, this.getVirtualScroll = (e) => {
|
|
81
|
+
const { rowHeight: t, detailRowHeight: i, detail: n, expandField: h, groupable: l } = e, p = this.isAllData(), v = t !== void 0 && t > 0, R = i !== void 0 && i > 0, I = l === !0 || typeof l == "object" && l.enabled !== !1;
|
|
82
|
+
return !v || I && !p || !!(n && h) && (!R || !p) ? nt : ue;
|
|
83
|
+
}, this.isAllData = () => {
|
|
84
|
+
const { data: e, total: t } = this.props;
|
|
85
|
+
return Array.isArray(e) ? e.length === t : e ? t === e.total : !1;
|
|
86
|
+
}, this.initializeVirtualization = (e, t) => {
|
|
87
|
+
if (this.reInitVirtualization(
|
|
88
|
+
this.props.scrollable === "virtual",
|
|
89
|
+
this.props.total,
|
|
90
|
+
this.props.filter,
|
|
91
|
+
this.props.group,
|
|
92
|
+
this.props.sort,
|
|
93
|
+
t || this.props.rowHeight === void 0 || this.props.rowHeight === 0
|
|
94
|
+
), this.vs.fixedScroll = this.props.fixedScroll || !1, this.vs.PageChange = this.pageChange, this.vs.realSkip = this.props.skip || 0, this.vs.pageSize = (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 0, this.vs.scrollableVirtual = this.props.scrollable === "virtual", this.vs.total = e, this.vs.propsSkip = (this.props.skip || 0) + (this.props.scrollable === "virtual" ? this.vs.topCacheCount + (this.vs.attendedSkip - (this.props.skip || 0)) : 0), this.props.rowHeight !== void 0 && this.props.rowHeight > 0 && !t) {
|
|
95
|
+
const i = this.props.rowHeight * e;
|
|
96
|
+
this.vs.containerHeight = me ? Math.min(fe, i) : i;
|
|
97
|
+
} else
|
|
98
|
+
this.vs.containerHeight = 1533915;
|
|
99
|
+
if (this.vs.containerRef = this.containerRef, this.vs.tableBodyRef = this.tableBodyRef, this.vs.table = this.tableElement, this._slicedData = void 0, this.vs instanceof ue) {
|
|
100
|
+
const { rowHeight: i = 0, detail: n, expandField: h } = this.props;
|
|
101
|
+
let { detailRowHeight: l = 0 } = this.props;
|
|
102
|
+
l = n && h ? l : i, this.isAllData() ? (this.vs.total = this._data.length, this._slicedData = this._data.slice(this.vs.realSkip, this.vs.realSkip + this.vs.pageSize), this.vs.rowHeightService = this.rowHeightService(this.vs, this._data.length, i, l, this._data)) : this.vs.rowHeightService = new ge(e, i, l);
|
|
103
|
+
const p = this.vs.rowHeightService.totalHeight();
|
|
104
|
+
this.vs.containerHeight = me ? Math.min(fe, p) : p;
|
|
105
|
+
}
|
|
106
|
+
}, this.scrollHandler = (e) => {
|
|
107
|
+
if (e.target !== e.currentTarget)
|
|
108
|
+
return;
|
|
109
|
+
clearTimeout(this.forceUpdateTimeout), this.vs.table = this.tableElement;
|
|
110
|
+
const t = e.currentTarget.scrollLeft, i = e.currentTarget.scrollTop;
|
|
111
|
+
this.props.columnVirtualization && (!this.vs.scrollableVirtual || i === this.wrapperScrollTop) && (this.forceUpdateTimeout = window.setTimeout(() => {
|
|
112
|
+
this.forceUpdate();
|
|
113
|
+
}, 0)), this._header && this._header.setScrollLeft(t), this._footer && this._footer.setScrollLeft(t), this.vs && i !== this.wrapperScrollTop && this.vs.scrollHandler(e), Ae(this.props.onScroll, e, this, void 0), this.wrapperScrollTop = i;
|
|
114
|
+
}, this.onKeyDown = (e) => {
|
|
115
|
+
if (x.onKeyDown(e, {
|
|
116
|
+
contextStateRef: this.contextStateRef,
|
|
117
|
+
navigationStateRef: this.navigationStateRef,
|
|
118
|
+
onNavigationAction: this.onNavigationAction
|
|
119
|
+
}), this.props.onKeyDown) {
|
|
120
|
+
const { mode: t, cell: i } = ae(this.props.selectable), n = {
|
|
121
|
+
dataItems: this.getLeafDataItems(),
|
|
122
|
+
mode: t,
|
|
123
|
+
cell: i,
|
|
124
|
+
componentId: this._gridId,
|
|
125
|
+
selectedField: this.props.selectedField,
|
|
126
|
+
...this.getArguments(e)
|
|
127
|
+
};
|
|
128
|
+
this.props.onKeyDown.call(void 0, n);
|
|
129
|
+
}
|
|
130
|
+
}, this.onFocus = (e) => {
|
|
131
|
+
x.onFocus(e, {
|
|
132
|
+
contextStateRef: this.contextStateRef
|
|
133
|
+
});
|
|
134
|
+
}, this.onNavigationAction = (e) => {
|
|
135
|
+
if (this.props.onNavigationAction) {
|
|
136
|
+
const t = {
|
|
137
|
+
focusElement: e.focusElement,
|
|
138
|
+
...this.getArguments(e.event)
|
|
139
|
+
};
|
|
140
|
+
this.props.onNavigationAction.call(void 0, t);
|
|
141
|
+
}
|
|
142
|
+
}, this.rowClick = (e, t) => {
|
|
143
|
+
this.props.onRowClick && e.target.nodeName === "TD" && this.props.onRowClick.call(
|
|
144
|
+
void 0,
|
|
145
|
+
{
|
|
146
|
+
dataItem: t.dataItem,
|
|
147
|
+
...this.getArguments(e)
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}, this.rowDblClick = (e, t) => {
|
|
151
|
+
this.props.onRowDoubleClick && e.target.nodeName === "TD" && this.props.onRowDoubleClick.call(
|
|
152
|
+
void 0,
|
|
153
|
+
{
|
|
154
|
+
dataItem: t.dataItem,
|
|
155
|
+
...this.getArguments(e)
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}, this.itemChange = (e) => {
|
|
159
|
+
const t = this.props.onItemChange;
|
|
160
|
+
if (e.field === this.props.expandField || this.props.group && e.field === void 0) {
|
|
161
|
+
const i = this.props.onExpandChange;
|
|
162
|
+
i && i.call(
|
|
163
|
+
void 0,
|
|
164
|
+
{
|
|
165
|
+
...this.getArguments(e.syntheticEvent),
|
|
166
|
+
dataItem: e.dataItem,
|
|
167
|
+
dataIndex: e.dataIndex,
|
|
168
|
+
value: e.value
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
t && t.call(
|
|
174
|
+
void 0,
|
|
175
|
+
{
|
|
176
|
+
...this.getArguments(e.syntheticEvent),
|
|
177
|
+
dataItem: e.dataItem,
|
|
178
|
+
field: e.field,
|
|
179
|
+
value: e.value
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}, this.onHeaderSelectionChange = (e) => {
|
|
183
|
+
this.props.onHeaderSelectionChange && this.props.onHeaderSelectionChange.call(
|
|
184
|
+
void 0,
|
|
185
|
+
{
|
|
186
|
+
field: e.field,
|
|
187
|
+
nativeEvent: e.syntheticEvent && e.syntheticEvent.nativeEvent,
|
|
188
|
+
syntheticEvent: e.syntheticEvent,
|
|
189
|
+
target: this,
|
|
190
|
+
dataItems: this.getLeafDataItems(),
|
|
191
|
+
selectedField: this.props.selectedField
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
}, this.selectionRelease = (e) => {
|
|
195
|
+
if (this.props.onSelectionChange) {
|
|
196
|
+
const t = {
|
|
197
|
+
syntheticEvent: void 0,
|
|
198
|
+
target: this,
|
|
199
|
+
selectedField: this.props.selectedField || "",
|
|
200
|
+
componentId: this._gridId,
|
|
201
|
+
dataItems: this.getLeafDataItems(),
|
|
202
|
+
dataItem: null,
|
|
203
|
+
...e
|
|
204
|
+
};
|
|
205
|
+
this.props.onSelectionChange.call(void 0, t);
|
|
206
|
+
}
|
|
207
|
+
}, this.pageChange = (e, t, i) => {
|
|
208
|
+
this.raiseDataEvent(
|
|
209
|
+
this.props.onPageChange,
|
|
210
|
+
{ page: e },
|
|
211
|
+
{ skip: e.skip, take: e.take },
|
|
212
|
+
t,
|
|
213
|
+
i
|
|
214
|
+
);
|
|
215
|
+
}, this.pagerPageChange = (e) => {
|
|
216
|
+
this.pageChange({ skip: e.skip, take: e.take }, e.syntheticEvent, e.targetEvent);
|
|
217
|
+
}, this.sortChange = (e, t) => {
|
|
218
|
+
this.raiseDataEvent(
|
|
219
|
+
this.props.onSortChange,
|
|
220
|
+
{ sort: e },
|
|
221
|
+
{ sort: e, ...this.props.scrollable === "virtual" ? { skip: 0 } : {} },
|
|
222
|
+
t
|
|
223
|
+
);
|
|
224
|
+
}, this.filterChange = (e, t) => {
|
|
225
|
+
this.raiseDataEvent(
|
|
226
|
+
this.props.onFilterChange,
|
|
227
|
+
{ filter: e },
|
|
228
|
+
{ filter: e || void 0, skip: 0 },
|
|
229
|
+
t
|
|
230
|
+
);
|
|
231
|
+
}, this.groupChange = (e, t) => {
|
|
232
|
+
const i = t.nativeEvent ? t : { nativeEvent: t.nativeEvent || t.originalEvent };
|
|
233
|
+
this.raiseDataEvent(
|
|
234
|
+
this.props.onGroupChange,
|
|
235
|
+
{ group: e },
|
|
236
|
+
{ group: e, skip: 0 },
|
|
237
|
+
i
|
|
238
|
+
);
|
|
239
|
+
}, this.onClipboard = (e, t) => {
|
|
240
|
+
if (this.props.onClipboard) {
|
|
241
|
+
if (!this.inActiveElement() || !e)
|
|
242
|
+
return;
|
|
243
|
+
this.props.onClipboard.call(
|
|
244
|
+
void 0,
|
|
245
|
+
{
|
|
246
|
+
type: e,
|
|
247
|
+
nativeEvent: t,
|
|
248
|
+
columns: this._columns,
|
|
249
|
+
dataItemKey: this.props.dataItemKey || "",
|
|
250
|
+
...typeof this.props.clipboard != "boolean" ? this.props.clipboard : {}
|
|
251
|
+
}
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
}, this.inActiveElement = () => {
|
|
255
|
+
var h, l, p;
|
|
256
|
+
if (!U)
|
|
257
|
+
return !1;
|
|
258
|
+
const e = Ge(this.document), t = e ? e.matches(".k-table-td") ? e : (h = this.document) == null ? void 0 : h.body : (l = this.document) == null ? void 0 : l.body, i = t.closest(".k-grid-container"), n = t && ((p = this._element) == null ? void 0 : p.contains(t));
|
|
259
|
+
return !!(t && n && i);
|
|
260
|
+
}, this.onResize = (e, t, i, n, h, l) => {
|
|
261
|
+
this.resetTableWidth(), this._shouldUpdateLeftRight = !0, this._resized = !0, this._columnsMutations++, this.props.onColumnResize && this.props.onColumnResize.call(
|
|
262
|
+
void 0,
|
|
263
|
+
{
|
|
264
|
+
columns: this.columns,
|
|
265
|
+
nativeEvent: n,
|
|
266
|
+
targetColumnId: l,
|
|
267
|
+
index: e,
|
|
268
|
+
newWidth: t,
|
|
269
|
+
oldWidth: i,
|
|
270
|
+
end: h,
|
|
271
|
+
target: this
|
|
272
|
+
}
|
|
273
|
+
);
|
|
274
|
+
}, this.reInitVirtualization = S((e, t, i, n, h, l) => {
|
|
275
|
+
this.vs.reset();
|
|
276
|
+
const p = this.getVirtualScroll(this.props);
|
|
277
|
+
this.vs = new p(l);
|
|
278
|
+
}), this.flatData = S((e, t, i, n, h, l, p) => {
|
|
279
|
+
const v = [], R = dt(
|
|
280
|
+
v,
|
|
281
|
+
e,
|
|
282
|
+
t,
|
|
283
|
+
{ index: i },
|
|
284
|
+
n !== void 0,
|
|
285
|
+
h
|
|
286
|
+
);
|
|
287
|
+
return { flattedData: v, resolvedGroupsCount: R };
|
|
288
|
+
}), this.rowHeightService = S((e, t, i, n, h) => new ge(t, i, n, h)), this.childrenToArray = S((e) => r.Children.toArray(e)), this.readColumns = S(
|
|
289
|
+
(e, t, i) => {
|
|
290
|
+
const n = e.filter((h) => h && h.type && h.type.displayName === "KendoReactGridColumn");
|
|
291
|
+
return ct(n, this.columns, { prevId: 0, idPrefix: t });
|
|
292
|
+
}
|
|
293
|
+
), this.mapColumns = S(
|
|
294
|
+
(e) => Ve(e)
|
|
295
|
+
), this.configureColumns = S((e, t, i) => {
|
|
296
|
+
this.props.selectedField && e.forEach((l) => {
|
|
297
|
+
l.field === this.props.selectedField ? (l.width = l.width || "50px", l.cell = l.cell || Qe, l.headerCell = l.headerCell || bt) : l.width = void 0;
|
|
298
|
+
});
|
|
299
|
+
const n = {
|
|
300
|
+
id: "",
|
|
301
|
+
resizable: !0,
|
|
302
|
+
width: "32px",
|
|
303
|
+
title: " ",
|
|
304
|
+
declarationIndex: -1,
|
|
305
|
+
orderIndex: -1,
|
|
306
|
+
children: [],
|
|
307
|
+
parentIndex: -1,
|
|
308
|
+
depth: 0,
|
|
309
|
+
colSpan: 0,
|
|
310
|
+
rowSpan: 0,
|
|
311
|
+
left: 0,
|
|
312
|
+
right: 0,
|
|
313
|
+
index: 0,
|
|
314
|
+
rightBorder: !1,
|
|
315
|
+
ariaColumnIndex: 0,
|
|
316
|
+
isAccessible: !0
|
|
317
|
+
};
|
|
318
|
+
let h = 0;
|
|
319
|
+
this.props.expandField && this.props.onExpandChange && this.props.detail && (e.unshift({
|
|
320
|
+
...n,
|
|
321
|
+
cell: Xe,
|
|
322
|
+
field: this.props.expandField,
|
|
323
|
+
headerClassName: "k-hierarchy-cell k-header",
|
|
324
|
+
id: _.generateNavigatableId(`${this._columns.length}`, i, "column")
|
|
325
|
+
}), h++);
|
|
326
|
+
for (let l = 0; l < t; l++)
|
|
327
|
+
e.unshift({
|
|
328
|
+
...n,
|
|
329
|
+
isAccessible: !1,
|
|
330
|
+
cell: be,
|
|
331
|
+
field: "value",
|
|
332
|
+
locked: this.props.lockGroups
|
|
333
|
+
}), h++;
|
|
334
|
+
e.slice(h).forEach((l) => l.parentIndex >= 0 && (l.parentIndex += h));
|
|
335
|
+
}), this.getHeaderRow = S((e, t, i, n, h, l, p, v, R, I, b, F) => /* @__PURE__ */ r.createElement(
|
|
336
|
+
et,
|
|
337
|
+
{
|
|
338
|
+
cells: this.props.cells,
|
|
339
|
+
sort: e,
|
|
340
|
+
sortable: t,
|
|
341
|
+
sortChange: this.sortChange,
|
|
342
|
+
group: i || [],
|
|
343
|
+
groupable: n,
|
|
344
|
+
groupChange: this.groupChange,
|
|
345
|
+
filter: h,
|
|
346
|
+
filterable: l,
|
|
347
|
+
filterOperators: p,
|
|
348
|
+
filterChange: this.filterChange,
|
|
349
|
+
columnMenu: R,
|
|
350
|
+
selectionChange: this.onHeaderSelectionChange,
|
|
351
|
+
columns: I,
|
|
352
|
+
columnResize: this.columnResize,
|
|
353
|
+
pressHandler: this.dragLogic.pressHandler,
|
|
354
|
+
dragHandler: this.dragLogic.dragHandler,
|
|
355
|
+
releaseHandler: this.dragLogic.releaseHandler,
|
|
356
|
+
columnsMap: b,
|
|
357
|
+
cellRender: v,
|
|
358
|
+
isRtl: F,
|
|
359
|
+
dragClue: this.dragLogic.dragClueRef,
|
|
360
|
+
headerRef: this.headerElementRef,
|
|
361
|
+
containerRef: this.containerRef
|
|
362
|
+
}
|
|
363
|
+
)), this.resolveTitle = (e) => {
|
|
364
|
+
const t = this._columns.find((n) => n.field === e), i = t && (t.title || t.field);
|
|
365
|
+
return i === void 0 ? e : i;
|
|
366
|
+
}, this.getLeafDataItems = () => this._data.filter((e) => e.rowType === "data").map((e) => e.dataItem), Ke(Re), this.showLicenseWatermark = Oe(Re);
|
|
367
|
+
const d = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1, c = this.getVirtualScroll(a);
|
|
368
|
+
this.vs = new c(d || a.rowHeight === void 0 || a.rowHeight === 0), this.dragLogic = new pt(
|
|
369
|
+
this.columnReorder.bind(this),
|
|
370
|
+
this.groupReorder.bind(this),
|
|
371
|
+
this.columnToGroup.bind(this)
|
|
372
|
+
), this.columnResize = new ht(this.onResize), this.props.clipboard && (this.clipboardService = new We(this.onClipboard)), x.onConstructor({
|
|
373
|
+
navigatable: !!a.navigatable,
|
|
374
|
+
contextStateRef: this.contextStateRef,
|
|
375
|
+
navigationStateRef: this.navigationStateRef,
|
|
376
|
+
idPrefix: this._gridId
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
/* eslint-disable max-len */
|
|
380
|
+
/**
|
|
381
|
+
* 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.
|
|
382
|
+
*
|
|
383
|
+
* @example
|
|
384
|
+
* ```jsx
|
|
385
|
+
* class App extends React.Component {
|
|
386
|
+
* constructor(props) {
|
|
387
|
+
* super(props);
|
|
388
|
+
* this.state = {
|
|
389
|
+
* data: [
|
|
390
|
+
* { 'foo': 'A1', 'bar': 'B1' },
|
|
391
|
+
* { 'foo': 'A2', 'bar': 'B2' },
|
|
392
|
+
* { 'foo': 'A3', 'bar': 'B2' }
|
|
393
|
+
* ]
|
|
394
|
+
* };
|
|
395
|
+
* this.grid = null;
|
|
396
|
+
* }
|
|
397
|
+
* render() {
|
|
398
|
+
* return (
|
|
399
|
+
* <div>
|
|
400
|
+
* <Grid
|
|
401
|
+
* data={this.state.data}
|
|
402
|
+
* reorderable={true}
|
|
403
|
+
* ref={(g) => { this.grid = g; }}
|
|
404
|
+
* >
|
|
405
|
+
* <GridColumn field="foo" />
|
|
406
|
+
* <GridColumn field="bar" />
|
|
407
|
+
* </Grid>
|
|
408
|
+
* <button onClick={() => console.log(JSON.stringify(this.grid.columns))}>
|
|
409
|
+
* log current properties into browser console.
|
|
410
|
+
* </button>
|
|
411
|
+
* </div>
|
|
412
|
+
* );
|
|
413
|
+
* }
|
|
414
|
+
* }
|
|
415
|
+
* ReactDOM.render(<App />, document.querySelector('my-app'));
|
|
416
|
+
* ```
|
|
417
|
+
*/
|
|
418
|
+
// tslint:enable:max-line-length
|
|
419
|
+
get columns() {
|
|
420
|
+
const a = this._columns.filter((d) => d.declarationIndex >= 0 && d.parentIndex === -1);
|
|
421
|
+
return ut(a);
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Returns the HTML element of the Grid component.
|
|
425
|
+
*/
|
|
426
|
+
get element() {
|
|
427
|
+
return this._element;
|
|
428
|
+
}
|
|
429
|
+
get document() {
|
|
430
|
+
if (U)
|
|
431
|
+
return this.element && this.element.ownerDocument || document;
|
|
432
|
+
}
|
|
433
|
+
get _header() {
|
|
434
|
+
return this.headerRef.current;
|
|
435
|
+
}
|
|
436
|
+
get _gridId() {
|
|
437
|
+
return this.props.id + "-role-element-id";
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* @hidden
|
|
441
|
+
*/
|
|
442
|
+
componentDidMount() {
|
|
443
|
+
this.resetTableWidth(), re();
|
|
444
|
+
const a = Be(this.element);
|
|
445
|
+
this.isRtl = a, x.onComponentDidMount({
|
|
446
|
+
scope: this.element || void 0,
|
|
447
|
+
contextStateRef: this.contextStateRef,
|
|
448
|
+
navigationStateRef: this.navigationStateRef
|
|
449
|
+
}), this.isRtl && this.forceUpdate();
|
|
450
|
+
const d = {
|
|
451
|
+
rootMargin: "0px",
|
|
452
|
+
threshold: 0.9
|
|
453
|
+
};
|
|
454
|
+
this.clipboardService && this.clipboardService.addEventListeners(this.document), this.observer = U && window.IntersectionObserver && new window.IntersectionObserver(this.handleIntersection, d) || null;
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* @hidden
|
|
458
|
+
*/
|
|
459
|
+
getSnapshotBeforeUpdate() {
|
|
460
|
+
return x.onGetSnapshotBeforeUpdate({
|
|
461
|
+
document: this.document,
|
|
462
|
+
contextStateRef: this.contextStateRef,
|
|
463
|
+
navigationStateRef: this.navigationStateRef
|
|
464
|
+
}), null;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* @hidden
|
|
468
|
+
*/
|
|
469
|
+
componentDidUpdate() {
|
|
470
|
+
this.resetTableWidth(), re(), this.vs.tableTransform && this.vs.table && (this.vs.table.style.transform = this.vs.tableTransform, this.vs.tableTransform = ""), x.onComponentDidUpdate({
|
|
471
|
+
scope: this.element || void 0,
|
|
472
|
+
contextStateRef: this.contextStateRef,
|
|
473
|
+
navigationStateRef: this.navigationStateRef
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* @hidden
|
|
478
|
+
*/
|
|
479
|
+
componentWillUnmount() {
|
|
480
|
+
clearTimeout(this.forceUpdateTimeout), this.clipboardService && this.clipboardService.removeEventListeners(this.document);
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* @hidden
|
|
484
|
+
*/
|
|
485
|
+
render() {
|
|
486
|
+
var ie;
|
|
487
|
+
let a = this.props.total || 0;
|
|
488
|
+
const d = _.getIdPrefix(this.navigationStateRef), c = ot(this);
|
|
489
|
+
let e = [];
|
|
490
|
+
Array.isArray(this.props.data) ? (e = this.props.data, a = a || this.props.data.length) : this.props.data && (e = this.props.data.data, a = a || this.props.data.total);
|
|
491
|
+
const t = typeof this.props.groupable == "object" && this.props.groupable.footer || "none", { resolvedGroupsCount: i, flattedData: n } = this.flatData(
|
|
492
|
+
e,
|
|
493
|
+
t,
|
|
494
|
+
this.props.skip || 0,
|
|
495
|
+
this.props.group,
|
|
496
|
+
this.props.expandField,
|
|
497
|
+
this.props.filter,
|
|
498
|
+
this.props.sort
|
|
499
|
+
);
|
|
500
|
+
this._data = n;
|
|
501
|
+
const h = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1;
|
|
502
|
+
this.columnResize.resizable = this.props.resizable || !1, this.dragLogic.reorderable = this.props.reorderable || !1, this.dragLogic.groupable = h;
|
|
503
|
+
const l = this.props.selectable && this.props.selectable.drag ? "none" : void 0;
|
|
504
|
+
this.initializeVirtualization(a, h);
|
|
505
|
+
const p = this.childrenToArray(this.props.children);
|
|
506
|
+
this.initColumns(p, i);
|
|
507
|
+
const v = p.map((o) => o && o.type && o.type.displayName === "KendoReactGridToolbar" ? r.cloneElement(o, { ...o.props, ariaControls: this._gridId }) : null), R = p.filter((o) => o && o.type && o.type.displayName === "KendoReactGridNoRecords"), I = p.filter((o) => o && o.type && o.type.displayName === "KendoReactGridStatusBar"), b = this._columns.filter((o) => o.children.length === 0), F = h && /* @__PURE__ */ r.createElement(
|
|
508
|
+
st,
|
|
509
|
+
{
|
|
510
|
+
group: this.props.group || [],
|
|
511
|
+
groupChange: this.groupChange,
|
|
512
|
+
pressHandler: this.dragLogic.pressHandler,
|
|
513
|
+
dragHandler: this.dragLogic.dragHandler,
|
|
514
|
+
releaseHandler: this.dragLogic.releaseHandler,
|
|
515
|
+
refCallback: this.dragLogic.refGroupPanelDiv,
|
|
516
|
+
resolveTitle: this.resolveTitle,
|
|
517
|
+
ariaControls: this._gridId,
|
|
518
|
+
onContextMenu: this.onContextMenu
|
|
519
|
+
}
|
|
520
|
+
), { sort: ye, sortable: we, group: Se, filter: ke, filterable: Ie, filterOperators: Ee = Ce, headerCellRender: xe, columnMenu: _e } = this.props, $ = /* @__PURE__ */ r.createElement(
|
|
521
|
+
Ze,
|
|
522
|
+
{
|
|
523
|
+
size: this.props.size,
|
|
524
|
+
columnResize: this.columnResize,
|
|
525
|
+
staticHeaders: this.props.scrollable !== "none",
|
|
526
|
+
scrollableDataElement: () => this.vs.container,
|
|
527
|
+
draggable: this.props.reorderable || h,
|
|
528
|
+
ref: this.headerRef,
|
|
529
|
+
elemRef: this.headerElementRef,
|
|
530
|
+
headerRow: this.getHeaderRow(
|
|
531
|
+
ye,
|
|
532
|
+
we,
|
|
533
|
+
Se,
|
|
534
|
+
h,
|
|
535
|
+
ke,
|
|
536
|
+
Ie,
|
|
537
|
+
Ee,
|
|
538
|
+
xe,
|
|
539
|
+
_e,
|
|
540
|
+
this._columns,
|
|
541
|
+
this._columnsMap,
|
|
542
|
+
this.isRtl
|
|
543
|
+
),
|
|
544
|
+
filterRow: this.props.filterable && /* @__PURE__ */ r.createElement(
|
|
545
|
+
tt,
|
|
546
|
+
{
|
|
547
|
+
cells: this.props.cells,
|
|
548
|
+
size: this.props.size,
|
|
549
|
+
columns: this._columns,
|
|
550
|
+
filter: this.props.filter,
|
|
551
|
+
filterOperators: this.props.filterOperators || Ce,
|
|
552
|
+
filterChange: this.filterChange,
|
|
553
|
+
sort: this.props.sort,
|
|
554
|
+
cellRender: this.props.filterCellRender,
|
|
555
|
+
isRtl: this.isRtl,
|
|
556
|
+
ariaRowIndex: this._columnsMap.length + 1
|
|
557
|
+
}
|
|
558
|
+
) || void 0,
|
|
559
|
+
cols: b.map((o, g) => /* @__PURE__ */ r.createElement(
|
|
560
|
+
"col",
|
|
561
|
+
{
|
|
562
|
+
key: g.toString(),
|
|
563
|
+
width: W(o)
|
|
564
|
+
}
|
|
565
|
+
))
|
|
566
|
+
}
|
|
567
|
+
), ze = this.vs && this.vs.container && this.vs.container.scrollLeft || 0, De = parseFloat(((this.props.style || {}).width || "").toString()), { colSpans: He, hiddenColumns: Te } = $e({
|
|
568
|
+
enabled: this.props.columnVirtualization,
|
|
569
|
+
columns: b,
|
|
570
|
+
tableViewPortWidth: De,
|
|
571
|
+
scrollLeft: ze
|
|
572
|
+
}), Ne = (o, g, m) => {
|
|
573
|
+
let E = !1;
|
|
574
|
+
const k = this.props.selectedField ? ve(this.props.selectedField, o.dataItem) : void 0;
|
|
575
|
+
return {
|
|
576
|
+
row: b.map((u, f) => {
|
|
577
|
+
if (Te[f])
|
|
578
|
+
return null;
|
|
579
|
+
const H = u.id ? u.id : f, T = `${u.className ? u.className + " " : ""}${u.locked ? "k-grid-content-sticky" : ""}`, y = u.left !== void 0 ? this.isRtl ? { left: u.right, right: u.left } : { left: u.left, right: u.right } : {};
|
|
580
|
+
let w = !1;
|
|
581
|
+
if (u.editable && this.props.editField) {
|
|
582
|
+
const C = ve(this.props.editField, o.dataItem);
|
|
583
|
+
C && (C === !0 || C === u.field) && (E = !0, w = !0);
|
|
584
|
+
}
|
|
585
|
+
const P = u.cell || w && Ye || ft;
|
|
586
|
+
return /* @__PURE__ */ r.createElement(
|
|
587
|
+
P,
|
|
588
|
+
{
|
|
589
|
+
onContextMenu: this.onContextMenu,
|
|
590
|
+
key: H,
|
|
591
|
+
locked: this.props.lockGroups,
|
|
592
|
+
id: _.generateNavigatableId(`${g}-${String(f)}`, d),
|
|
593
|
+
colSpan: He[f],
|
|
594
|
+
dataItem: o.dataItem,
|
|
595
|
+
field: u.field,
|
|
596
|
+
editor: u.editor,
|
|
597
|
+
format: u.format,
|
|
598
|
+
className: T,
|
|
599
|
+
render: this.props.cellRender,
|
|
600
|
+
cells: mt(this.props.cells, u.cells),
|
|
601
|
+
onChange: this.itemChange,
|
|
602
|
+
selectionChange: this.props.onSelectionChange ? (C) => {
|
|
603
|
+
this.selectionChange({ event: C, dataItem: o.dataItem, dataIndex: m, columnIndex: f });
|
|
604
|
+
} : void 0,
|
|
605
|
+
columnIndex: f,
|
|
606
|
+
columnsCount: b.length,
|
|
607
|
+
rowType: o.rowType,
|
|
608
|
+
level: o.level,
|
|
609
|
+
expanded: o.expanded,
|
|
610
|
+
dataIndex: o.dataIndex,
|
|
611
|
+
style: y,
|
|
612
|
+
ariaColumnIndex: u.ariaColumnIndex,
|
|
613
|
+
isSelected: Array.isArray(k) && k.indexOf(f) > -1
|
|
614
|
+
}
|
|
615
|
+
);
|
|
616
|
+
}),
|
|
617
|
+
isInEdit: E,
|
|
618
|
+
isSelected: typeof k == "boolean" && k
|
|
619
|
+
};
|
|
620
|
+
};
|
|
621
|
+
let j = 0;
|
|
622
|
+
if (this.props.scrollable === "virtual")
|
|
623
|
+
for (let o = 0; o < this.vs.topCacheCount + this.vs.attendedSkip - (this.props.skip || 0); o++) {
|
|
624
|
+
const g = this._data.shift();
|
|
625
|
+
if (g)
|
|
626
|
+
this._data.push(g), j++, g.rowType === "groupHeader" && o--;
|
|
627
|
+
else
|
|
628
|
+
break;
|
|
629
|
+
}
|
|
630
|
+
const q = (o) => o >= this._data.length - j;
|
|
631
|
+
let J = this.vs.realSkip || 0;
|
|
632
|
+
const M = [];
|
|
633
|
+
let K = !1;
|
|
634
|
+
const O = this._columnsMap.length + (this.props.filterable ? 1 : 0) + 1, Q = /* @__PURE__ */ r.createElement("div", { key: "no-records", className: "k-grid-norecords", "aria-rowindex": O }, /* @__PURE__ */ r.createElement("div", { className: "k-grid-norecords-template" }, R.length ? R : /* @__PURE__ */ r.createElement(Ct, null)));
|
|
635
|
+
let D = 0;
|
|
636
|
+
if (this._data.length) {
|
|
637
|
+
let o = -1, g = 0;
|
|
638
|
+
(this._slicedData || this._data).forEach((m, E) => {
|
|
639
|
+
m.rowType === "data" && (J++, o++);
|
|
640
|
+
const k = J % 2 === 0, u = this.props.dataItemKey && Pe(this.props.dataItemKey)(m.dataItem), f = E + (this.vs.realSkip || 0), H = u || "ai" + f, T = H + "_1", y = Ne(m, H, o);
|
|
641
|
+
if (D = f + O + g, M.push(/* @__PURE__ */ r.createElement(
|
|
642
|
+
vt,
|
|
643
|
+
{
|
|
644
|
+
key: H,
|
|
645
|
+
dataItem: m.dataItem,
|
|
646
|
+
isAltRow: k,
|
|
647
|
+
isInEdit: y.isInEdit,
|
|
648
|
+
rowType: m.rowType,
|
|
649
|
+
isHidden: q(E),
|
|
650
|
+
onClick: (w) => this.rowClick(w, m),
|
|
651
|
+
onDoubleClick: (w) => this.rowDblClick(w, m),
|
|
652
|
+
selectedField: this.props.selectedField,
|
|
653
|
+
rowHeight: this.props.rowHeight,
|
|
654
|
+
render: this.props.rowRender,
|
|
655
|
+
ariaRowIndex: D,
|
|
656
|
+
absoluteRowIndex: f,
|
|
657
|
+
dataIndex: o,
|
|
658
|
+
isSelected: y.isSelected
|
|
659
|
+
},
|
|
660
|
+
y.row
|
|
661
|
+
)), this.props.detail && m.rowType === "data" && m.expanded) {
|
|
662
|
+
const w = b.length - (this.props.expandField ? 1 : 0) - (this.props.group ? this.props.group.length : 0) || 1;
|
|
663
|
+
g++, D = f + O + g, M.push(/* @__PURE__ */ r.createElement(
|
|
664
|
+
"tr",
|
|
665
|
+
{
|
|
666
|
+
key: T,
|
|
667
|
+
className: L(
|
|
668
|
+
"k-table-row",
|
|
669
|
+
k ? "k-detail-row k-table-alt-row k-alt" : "k-detail-row"
|
|
670
|
+
),
|
|
671
|
+
style: { visibility: q(E) ? "hidden" : "", height: this.props.detailRowHeight },
|
|
672
|
+
role: "row",
|
|
673
|
+
"aria-rowindex": D
|
|
674
|
+
},
|
|
675
|
+
this.props.group && this.props.group.map((P, C) => {
|
|
676
|
+
var oe;
|
|
677
|
+
const N = (oe = y == null ? void 0 : y.row[C]) == null ? void 0 : oe.props.style, Me = N ? this.isRtl ? { left: N.right, right: N.left } : { left: N.left, right: N.right } : {};
|
|
678
|
+
return /* @__PURE__ */ r.createElement(
|
|
679
|
+
be,
|
|
680
|
+
{
|
|
681
|
+
id: "",
|
|
682
|
+
dataIndex: m.dataIndex,
|
|
683
|
+
field: P.field,
|
|
684
|
+
dataItem: m.dataItem,
|
|
685
|
+
key: C,
|
|
686
|
+
style: Me,
|
|
687
|
+
ariaColumnIndex: 1 + C,
|
|
688
|
+
isSelected: !1,
|
|
689
|
+
locked: this.props.lockGroups,
|
|
690
|
+
isRtl: this.isRtl,
|
|
691
|
+
cells: this.props.cells
|
|
692
|
+
}
|
|
693
|
+
);
|
|
694
|
+
}),
|
|
695
|
+
this.props.expandField && /* @__PURE__ */ r.createElement(
|
|
696
|
+
St,
|
|
697
|
+
{
|
|
698
|
+
id: _.generateNavigatableId(`${T}-dhcell`, d)
|
|
699
|
+
}
|
|
700
|
+
),
|
|
701
|
+
/* @__PURE__ */ r.createElement(
|
|
702
|
+
wt,
|
|
703
|
+
{
|
|
704
|
+
onContextMenu: this.onContextMenu,
|
|
705
|
+
dataItem: m.dataItem,
|
|
706
|
+
dataIndex: m.dataIndex,
|
|
707
|
+
colSpan: w,
|
|
708
|
+
ariaColIndex: 2 + (this.props.group ? this.props.group.length : 0),
|
|
709
|
+
detail: this.props.detail,
|
|
710
|
+
id: _.generateNavigatableId(`${T}-dcell`, d)
|
|
711
|
+
}
|
|
712
|
+
)
|
|
713
|
+
));
|
|
714
|
+
}
|
|
715
|
+
});
|
|
716
|
+
} else
|
|
717
|
+
K = !0;
|
|
718
|
+
const X = {
|
|
719
|
+
size: this.props.size,
|
|
720
|
+
onPageChange: this.pagerPageChange,
|
|
721
|
+
total: a,
|
|
722
|
+
dir: this.isRtl ? "rtl" : void 0,
|
|
723
|
+
skip: this.vs.propsSkip || 0,
|
|
724
|
+
take: (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 10,
|
|
725
|
+
messagesMap: at,
|
|
726
|
+
...yt(this.props.pageable || {})
|
|
727
|
+
}, Y = this.props.pager ? /* @__PURE__ */ r.createElement(this.props.pager, { ...X }) : /* @__PURE__ */ r.createElement(je, { className: "k-grid-pager", ...X }), Le = (o) => this.props.sort && this.props.sort.filter((g) => g.field === o).length > 0, Fe = (o, g) => /* @__PURE__ */ r.createElement(
|
|
728
|
+
"col",
|
|
729
|
+
{
|
|
730
|
+
key: g.toString(),
|
|
731
|
+
width: W(o)
|
|
732
|
+
}
|
|
733
|
+
), Z = (ie = this.props.cells) != null && ie.footerCell || this._columns.some(
|
|
734
|
+
(o) => {
|
|
735
|
+
var g;
|
|
736
|
+
return !!(o.footerCell || (g = o.cells) != null && g.footerCell);
|
|
737
|
+
}
|
|
738
|
+
) ? /* @__PURE__ */ r.createElement(
|
|
739
|
+
it,
|
|
740
|
+
{
|
|
741
|
+
size: this.props.size,
|
|
742
|
+
columnResize: this.columnResize,
|
|
743
|
+
staticHeaders: this.props.scrollable !== "none",
|
|
744
|
+
ref: (o) => this._footer = o,
|
|
745
|
+
row: /* @__PURE__ */ r.createElement(
|
|
746
|
+
Rt,
|
|
747
|
+
{
|
|
748
|
+
cells: this.props.cells,
|
|
749
|
+
columns: this._columns,
|
|
750
|
+
isRtl: this.isRtl,
|
|
751
|
+
ariaRowIndex: D + 1
|
|
752
|
+
}
|
|
753
|
+
),
|
|
754
|
+
cols: b.map(Fe)
|
|
755
|
+
}
|
|
756
|
+
) : null, ee = /* @__PURE__ */ r.createElement(
|
|
757
|
+
"colgroup",
|
|
758
|
+
{
|
|
759
|
+
ref: (o) => {
|
|
760
|
+
this.columnResize.colGroupMain = o;
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
b.map(
|
|
764
|
+
(o, g) => /* @__PURE__ */ r.createElement(
|
|
765
|
+
"col",
|
|
766
|
+
{
|
|
767
|
+
key: g.toString(),
|
|
768
|
+
className: Le(o.field) ? "k-sorted" : void 0,
|
|
769
|
+
width: W(o)
|
|
770
|
+
}
|
|
771
|
+
)
|
|
772
|
+
)
|
|
773
|
+
), te = this.dragLogic.reorderable || this.dragLogic.groupable, se = this.props.columnVirtualization ? "block" : "table";
|
|
774
|
+
if (this.props.scrollable === "none")
|
|
775
|
+
return /* @__PURE__ */ r.createElement(V.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
776
|
+
"div",
|
|
777
|
+
{
|
|
778
|
+
id: this.props.id,
|
|
779
|
+
style: this.props.style,
|
|
780
|
+
className: L(
|
|
781
|
+
"k-grid",
|
|
782
|
+
{
|
|
783
|
+
"k-grid-md": !this.props.size,
|
|
784
|
+
[`k-grid-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
785
|
+
},
|
|
786
|
+
this.props.className
|
|
787
|
+
),
|
|
788
|
+
ref: (o) => {
|
|
789
|
+
this._element = o;
|
|
790
|
+
},
|
|
791
|
+
"aria-label": this.props.ariaLabel,
|
|
792
|
+
onKeyDown: this.onKeyDown,
|
|
793
|
+
onFocus: this.onFocus,
|
|
794
|
+
...le
|
|
795
|
+
},
|
|
796
|
+
v,
|
|
797
|
+
F,
|
|
798
|
+
/* @__PURE__ */ r.createElement(
|
|
799
|
+
ne,
|
|
800
|
+
{
|
|
801
|
+
selectable: this.props.selectable,
|
|
802
|
+
onRelease: this.selectionRelease,
|
|
803
|
+
childRef: (o) => {
|
|
804
|
+
this.tableElement = o;
|
|
805
|
+
}
|
|
806
|
+
},
|
|
807
|
+
/* @__PURE__ */ r.createElement(
|
|
808
|
+
"table",
|
|
809
|
+
{
|
|
810
|
+
className: L(
|
|
811
|
+
"k-table k-grid-table",
|
|
812
|
+
{ [`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size }
|
|
813
|
+
),
|
|
814
|
+
style: { userSelect: l, display: se }
|
|
815
|
+
},
|
|
816
|
+
ee,
|
|
817
|
+
$,
|
|
818
|
+
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...he }, M),
|
|
819
|
+
Z
|
|
820
|
+
)
|
|
821
|
+
),
|
|
822
|
+
K && Q,
|
|
823
|
+
te && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(pe, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(de, { ref: this.dragLogic.refDragElementClue }))
|
|
824
|
+
), I, this.props.pageable && Y);
|
|
825
|
+
let A = this.props.style || {};
|
|
826
|
+
return this.props.scrollable === "virtual" && (A.height || (A = Object.assign({}, A, { height: "450px" }))), /* @__PURE__ */ r.createElement(V.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
827
|
+
"div",
|
|
828
|
+
{
|
|
829
|
+
id: this.props.id,
|
|
830
|
+
style: A,
|
|
831
|
+
className: L(
|
|
832
|
+
"k-grid",
|
|
833
|
+
{
|
|
834
|
+
"k-grid-md": !this.props.size,
|
|
835
|
+
[`k-grid-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size,
|
|
836
|
+
"k-grid-virtual": this.props.scrollable === "virtual"
|
|
837
|
+
},
|
|
838
|
+
this.props.className
|
|
839
|
+
),
|
|
840
|
+
ref: (o) => {
|
|
841
|
+
this._element = o;
|
|
842
|
+
},
|
|
843
|
+
"aria-label": this.props.ariaLabel,
|
|
844
|
+
onKeyDown: this.onKeyDown,
|
|
845
|
+
onFocus: this.onFocus,
|
|
846
|
+
...le
|
|
847
|
+
},
|
|
848
|
+
v,
|
|
849
|
+
F,
|
|
850
|
+
/* @__PURE__ */ r.createElement(
|
|
851
|
+
"div",
|
|
852
|
+
{
|
|
853
|
+
className: "k-grid-aria-root",
|
|
854
|
+
role: "grid",
|
|
855
|
+
"aria-colcount": b.length,
|
|
856
|
+
"aria-rowcount": a,
|
|
857
|
+
id: this._gridId,
|
|
858
|
+
"aria-label": c.toLanguageString(ce, lt[ce])
|
|
859
|
+
},
|
|
860
|
+
$,
|
|
861
|
+
/* @__PURE__ */ r.createElement("div", { className: "k-grid-container", role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
862
|
+
"div",
|
|
863
|
+
{
|
|
864
|
+
ref: this.containerRef,
|
|
865
|
+
className: "k-grid-content k-virtual-content",
|
|
866
|
+
onScroll: this.scrollHandler,
|
|
867
|
+
role: "presentation"
|
|
868
|
+
},
|
|
869
|
+
/* @__PURE__ */ r.createElement("div", { className: "k-grid-table-wrap", role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
870
|
+
ne,
|
|
871
|
+
{
|
|
872
|
+
selectable: this.props.selectable,
|
|
873
|
+
onRelease: this.selectionRelease,
|
|
874
|
+
childRef: (o) => {
|
|
875
|
+
this.tableElement = o;
|
|
876
|
+
}
|
|
877
|
+
},
|
|
878
|
+
/* @__PURE__ */ r.createElement(
|
|
879
|
+
"table",
|
|
880
|
+
{
|
|
881
|
+
className: L(
|
|
882
|
+
"k-table k-grid-table",
|
|
883
|
+
{
|
|
884
|
+
"k-table-md": !this.props.size,
|
|
885
|
+
[`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
886
|
+
}
|
|
887
|
+
),
|
|
888
|
+
role: "presentation",
|
|
889
|
+
style: { userSelect: l, display: se }
|
|
890
|
+
},
|
|
891
|
+
ee,
|
|
892
|
+
/* @__PURE__ */ r.createElement(
|
|
893
|
+
"tbody",
|
|
894
|
+
{
|
|
895
|
+
className: "k-table-tbody",
|
|
896
|
+
ref: this.tableBodyRef,
|
|
897
|
+
role: "rowgroup",
|
|
898
|
+
...he
|
|
899
|
+
},
|
|
900
|
+
M
|
|
901
|
+
)
|
|
902
|
+
)
|
|
903
|
+
), K && Q),
|
|
904
|
+
/* @__PURE__ */ r.createElement("div", { className: "k-height-container", role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
905
|
+
"div",
|
|
906
|
+
{
|
|
907
|
+
style: this.props.scrollable === "virtual" ? { height: this.vs.containerHeight + "px" } : {}
|
|
908
|
+
}
|
|
909
|
+
))
|
|
910
|
+
)),
|
|
911
|
+
Z,
|
|
912
|
+
te && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(pe, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(de, { ref: this.dragLogic.refDragElementClue })),
|
|
913
|
+
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(Ue, null)
|
|
914
|
+
),
|
|
915
|
+
I,
|
|
916
|
+
this.props.pageable && Y
|
|
917
|
+
));
|
|
918
|
+
}
|
|
919
|
+
selectionChange(a) {
|
|
920
|
+
if (this.props.onSelectionChange) {
|
|
921
|
+
const { event: d, dataItem: c, dataIndex: e, columnIndex: t } = a, { mode: i, cell: n } = ae(this.props.selectable), h = {
|
|
922
|
+
...this.getArguments(d.syntheticEvent),
|
|
923
|
+
dataItem: c,
|
|
924
|
+
startColIndex: t,
|
|
925
|
+
endColIndex: t,
|
|
926
|
+
startRowIndex: e,
|
|
927
|
+
endRowIndex: e,
|
|
928
|
+
dataItems: this.getLeafDataItems(),
|
|
929
|
+
altKey: !1,
|
|
930
|
+
ctrlKey: !1,
|
|
931
|
+
shiftKey: !1,
|
|
932
|
+
metaKey: !1,
|
|
933
|
+
mode: i,
|
|
934
|
+
cell: n,
|
|
935
|
+
isDrag: !1,
|
|
936
|
+
componentId: this._gridId,
|
|
937
|
+
selectedField: this.props.selectedField || ""
|
|
938
|
+
};
|
|
939
|
+
this.props.onSelectionChange.call(void 0, h);
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
raiseDataEvent(a, d, c, e, t) {
|
|
943
|
+
const i = this.props.onDataStateChange;
|
|
944
|
+
if (a) {
|
|
945
|
+
const n = { ...this.getArguments(e), ...d, targetEvent: t };
|
|
946
|
+
a.call(void 0, n);
|
|
947
|
+
} else
|
|
948
|
+
i && i.call(
|
|
949
|
+
void 0,
|
|
950
|
+
{
|
|
951
|
+
...this.getArguments(e),
|
|
952
|
+
targetEvent: t || {},
|
|
953
|
+
dataState: {
|
|
954
|
+
...this.getDataState(),
|
|
955
|
+
...c
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
);
|
|
959
|
+
}
|
|
960
|
+
columnReorder(a, d, c) {
|
|
961
|
+
const e = this._columns[a], t = e.depth, i = (p) => {
|
|
962
|
+
do
|
|
963
|
+
p++;
|
|
964
|
+
while (p < this._columns.length && this._columns[p].depth > t);
|
|
965
|
+
return p;
|
|
966
|
+
}, n = this._columns.splice(a, i(a) - a);
|
|
967
|
+
this._columns.splice(a < d ? i(d - n.length) : d, 0, ...n), this._columns.filter((p) => p.declarationIndex >= 0).forEach((p, v) => p.orderIndex = v), this._columnsMutations++;
|
|
968
|
+
const h = this._columns[a].locked && this._columns[d].locked;
|
|
969
|
+
qe(this._columnsMap, this._columns, h || this._shouldUpdateLeftRight), Je(this._columnsMap, this._columns, h || this._shouldUpdateLeftRight), this._resized && (this._shouldUpdateLeftRight = !1, this._resized = !1);
|
|
970
|
+
const l = this.columns;
|
|
971
|
+
if (this.forceUpdate(), this.props.onColumnReorder) {
|
|
972
|
+
const p = {
|
|
973
|
+
target: this,
|
|
974
|
+
columns: l,
|
|
975
|
+
columnId: e.id,
|
|
976
|
+
nativeEvent: c
|
|
977
|
+
};
|
|
978
|
+
this.props.onColumnReorder.call(void 0, p);
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
groupReorder(a, d, c) {
|
|
982
|
+
if (this.props.group === void 0)
|
|
983
|
+
return;
|
|
984
|
+
const e = this.props.group.slice();
|
|
985
|
+
e.splice(d, 0, ...e.splice(a, 1)), this.groupChange(e, c);
|
|
986
|
+
}
|
|
987
|
+
columnToGroup(a, d, c) {
|
|
988
|
+
const e = this._columns[a].field;
|
|
989
|
+
if (!e)
|
|
990
|
+
return;
|
|
991
|
+
const t = (this.props.group || []).slice();
|
|
992
|
+
t.splice(d, 0, { field: e }), this.groupChange(t, c);
|
|
993
|
+
}
|
|
994
|
+
resetTableWidth() {
|
|
995
|
+
let a = 0;
|
|
996
|
+
if (!this.columnResize.colGroupMain)
|
|
997
|
+
return;
|
|
998
|
+
const d = this.columnResize.colGroupMain.children;
|
|
999
|
+
for (let c = 0; c < d.length; c++) {
|
|
1000
|
+
const e = d[c].width;
|
|
1001
|
+
if (!e)
|
|
1002
|
+
return;
|
|
1003
|
+
a += parseFloat(e.toString());
|
|
1004
|
+
}
|
|
1005
|
+
a = Math.round(a), this._header && this._header.setWidth(a), this._footer && this._footer.setWidth(a), this.tableElement && (this.tableElement.style.width = a + "px");
|
|
1006
|
+
}
|
|
1007
|
+
initColumns(a, d) {
|
|
1008
|
+
const c = _.getIdPrefix(this.navigationStateRef);
|
|
1009
|
+
this._columns = this.readColumns(a, c, this._columnsMutations), this._columns.length === 0 && (this._columns = gt(this.props.data, this.props.group, this.props.expandField, { prevId: 0, idPrefix: c })), this.configureColumns(this._columns, d, c), this._columnsMap = this.mapColumns(this._columns), this.columnResize.columns = this._columns, this.dragLogic.columns = this._columns;
|
|
1010
|
+
}
|
|
1011
|
+
getDataState() {
|
|
1012
|
+
return {
|
|
1013
|
+
filter: this.props.filter,
|
|
1014
|
+
sort: this.props.sort,
|
|
1015
|
+
skip: this.props.skip,
|
|
1016
|
+
take: this.props.take !== void 0 ? this.props.take : this.props.pageSize,
|
|
1017
|
+
group: this.props.group
|
|
1018
|
+
};
|
|
1019
|
+
}
|
|
1020
|
+
getArguments(a) {
|
|
1021
|
+
return {
|
|
1022
|
+
nativeEvent: a && a.nativeEvent,
|
|
1023
|
+
syntheticEvent: a,
|
|
1024
|
+
target: this
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
};
|
|
1028
|
+
z.displayName = "KendoReactGrid", z.defaultProps = {
|
|
1029
|
+
// never use this
|
|
1030
|
+
}, z.propTypes = {
|
|
1031
|
+
data: s.oneOfType([
|
|
1032
|
+
s.array,
|
|
1033
|
+
s.shape({
|
|
1034
|
+
data: s.array,
|
|
1035
|
+
total: s.number
|
|
1036
|
+
})
|
|
1037
|
+
]),
|
|
1038
|
+
sortable: s.oneOfType([
|
|
1039
|
+
s.bool,
|
|
1040
|
+
s.shape({
|
|
1041
|
+
mode: s.oneOf(["single", "multiple"]),
|
|
1042
|
+
allowUnsort: s.bool
|
|
1043
|
+
})
|
|
1044
|
+
]),
|
|
1045
|
+
onSortChange: s.func,
|
|
1046
|
+
sort: s.array,
|
|
1047
|
+
filterable: s.bool,
|
|
1048
|
+
filter: s.any,
|
|
1049
|
+
onFilterChange: s.func,
|
|
1050
|
+
pageable: s.oneOfType([
|
|
1051
|
+
s.bool,
|
|
1052
|
+
s.shape({
|
|
1053
|
+
buttonCount: s.number,
|
|
1054
|
+
responsive: s.bool,
|
|
1055
|
+
info: s.bool,
|
|
1056
|
+
type: s.oneOf(["numeric", "input"]),
|
|
1057
|
+
pageSizes: s.oneOfType(
|
|
1058
|
+
[
|
|
1059
|
+
s.bool,
|
|
1060
|
+
s.arrayOf(s.oneOfType([
|
|
1061
|
+
s.string,
|
|
1062
|
+
s.number
|
|
1063
|
+
]))
|
|
1064
|
+
]
|
|
1065
|
+
),
|
|
1066
|
+
previousNext: s.bool
|
|
1067
|
+
})
|
|
1068
|
+
]),
|
|
1069
|
+
pageSize: s.number,
|
|
1070
|
+
onPageChange: s.func,
|
|
1071
|
+
total: s.number,
|
|
1072
|
+
skip: s.number,
|
|
1073
|
+
take: s.number,
|
|
1074
|
+
fixedScroll: s.bool,
|
|
1075
|
+
onExpandChange: s.func,
|
|
1076
|
+
expandField: s.string,
|
|
1077
|
+
selectedField: s.string,
|
|
1078
|
+
onSelectionChange: s.func,
|
|
1079
|
+
onHeaderSelectionChange: s.func,
|
|
1080
|
+
resizable: s.bool,
|
|
1081
|
+
reorderable: s.bool,
|
|
1082
|
+
group: s.any,
|
|
1083
|
+
groupable: s.oneOfType([
|
|
1084
|
+
s.bool,
|
|
1085
|
+
s.shape({
|
|
1086
|
+
enabled: s.bool,
|
|
1087
|
+
footer: s.oneOf(["always", "visible", "none"])
|
|
1088
|
+
})
|
|
1089
|
+
]),
|
|
1090
|
+
onGroupChange: s.func,
|
|
1091
|
+
onRowClick: s.func,
|
|
1092
|
+
onRowDoubleClick: s.func,
|
|
1093
|
+
onItemChange: s.func,
|
|
1094
|
+
editField: s.string,
|
|
1095
|
+
scrollable: s.oneOf(["none", "scrollable", "virtual"]),
|
|
1096
|
+
rowHeight: s.number,
|
|
1097
|
+
detailRowHeight: s.number,
|
|
1098
|
+
detail: s.any,
|
|
1099
|
+
style: s.object,
|
|
1100
|
+
onDataStateChange: s.func,
|
|
1101
|
+
onColumnResize: s.func,
|
|
1102
|
+
onColumnReorder: s.func,
|
|
1103
|
+
dataItemKey: s.string,
|
|
1104
|
+
navigatable: s.bool,
|
|
1105
|
+
size: s.oneOf(["small", "medium"])
|
|
1106
|
+
}, z.contextType = V;
|
|
1107
|
+
let B = z;
|
|
1108
|
+
rt(B);
|
|
1109
|
+
export {
|
|
1110
|
+
B as Grid
|
|
1111
|
+
};
|