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