@progress/kendo-react-grid 7.5.0-develop.11 → 7.5.0-develop.13
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 +262 -259
- package/constants/index.js +1 -1
- package/constants/index.mjs +4 -3
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
package/Grid.mjs
CHANGED
|
@@ -7,41 +7,42 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as r from "react";
|
|
10
|
-
import
|
|
11
|
-
import { RowHeightService as
|
|
12
|
-
import { tableKeyboardNavigation as x, getSelectionOptions 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 { provideLocalizationService as
|
|
22
|
-
import { pagerMessagesMap as
|
|
23
|
-
import { VirtualScroll as
|
|
24
|
-
import { VirtualScrollFixed as
|
|
25
|
-
import { ColumnResize as
|
|
26
|
-
import { CommonDragLogic as
|
|
27
|
-
import { firefox as
|
|
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
|
|
10
|
+
import i from "prop-types";
|
|
11
|
+
import { RowHeightService as re, dispatchEvent as Ge, canUseDOM as V, getActiveElement as Ke, memoizeOne as S, validatePackage as Oe, shouldShowValidationUI as Pe, setScrollbarWidth as ae, getter as Ve, classNames as F, kendoThemeMaps as G, WatermarkOverlay as Ue } from "@progress/kendo-react-common";
|
|
12
|
+
import { tableKeyboardNavigation as x, getSelectionOptions as le, mapColumns as We, ClipboardService as Be, TableKeyboardNavigationContext as U, isRtl as $e, tableKeyboardNavigationTools as N, tableColumnsVirtualization as je, Pager as qe, tableKeyboardNavigationScopeAttributes as ne, TableSelection as he, tableKeyboardNavigationBodyAttributes as pe, DropClue as de, DragClue as ce, updateLeft as Xe, updateRight as Je } from "@progress/kendo-react-data-tools";
|
|
13
|
+
import { GridSelectionCell as Qe } from "./cells/GridSelectionCell.mjs";
|
|
14
|
+
import { GridHierarchyCell as Ye } from "./cells/GridHierarchyCell.mjs";
|
|
15
|
+
import { GridEditCell as Ze } from "./cells/GridEditCell.mjs";
|
|
16
|
+
import { Header as et } from "./header/Header.mjs";
|
|
17
|
+
import { HeaderRow as tt } from "./header/HeaderRow.mjs";
|
|
18
|
+
import { FilterRow as st } from "./header/FilterRow.mjs";
|
|
19
|
+
import { GroupPanel as it } from "./header/GroupPanel.mjs";
|
|
20
|
+
import { Footer as ot } from "./footer/Footer.mjs";
|
|
21
|
+
import { provideLocalizationService as rt, registerForLocalization as at } from "@progress/kendo-react-intl";
|
|
22
|
+
import { pagerMessagesMap as lt, gridAriaLabel as ue, messages as nt } from "./messages/index.mjs";
|
|
23
|
+
import { VirtualScroll as ht } from "./VirtualScroll.mjs";
|
|
24
|
+
import { VirtualScrollFixed as ge } from "./VirtualScrollFixed.mjs";
|
|
25
|
+
import { ColumnResize as pt } from "./drag/ColumnResize.mjs";
|
|
26
|
+
import { CommonDragLogic as dt } from "./drag/CommonDragLogic.mjs";
|
|
27
|
+
import { firefox as me, firefoxMaxHeight as fe, flatData as ct, readColumns as ut, sanitizeColumns as gt, getColumnWidth as W, autoGenerateColumns as mt, getNestedValue as be, resolveCells as ft } from "./utils/index.mjs";
|
|
28
|
+
import { GridCell as bt } from "./cells/GridCell.mjs";
|
|
29
|
+
import { GridGroupCell as ve } from "./cells/GridGroupCell.mjs";
|
|
30
|
+
import { GridRow as vt } from "./rows/GridRow.mjs";
|
|
31
|
+
import { GridHeaderSelectionCell as Ct } from "./header/GridHeaderSelectionCell.mjs";
|
|
32
|
+
import { GridNoRecords as Rt } from "./GridNoRecords.mjs";
|
|
33
|
+
import { operators as Ce } from "./filterCommon.mjs";
|
|
34
|
+
import { FooterRow as yt } from "./footer/FooterRow.mjs";
|
|
35
|
+
import { normalize as wt } from "./paging/GridPagerSettings.mjs";
|
|
36
|
+
import { packageMetadata as Re } from "./package-metadata.mjs";
|
|
37
|
+
import { GridDetailCell as St } from "./cells/GridDetailCell.mjs";
|
|
38
|
+
import { GridDetailHierarchyCell as kt } from "./cells/GridDetailHierarchyCell.mjs";
|
|
39
|
+
import { SAFARI_REGEX as Et } from "./constants/index.mjs";
|
|
39
40
|
const _ = class _ extends r.Component {
|
|
40
41
|
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
|
+
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.headTable = null, this.observer = null, this.handleIntersection = (e) => {
|
|
42
43
|
const t = { rowIndex: this.rowIndex };
|
|
43
|
-
e.forEach((
|
|
44
|
-
|
|
44
|
+
e.forEach((o) => {
|
|
45
|
+
o.isIntersecting || this.setCurrentOnTop(t);
|
|
45
46
|
});
|
|
46
47
|
}, this.setCurrentOnTop = (e) => {
|
|
47
48
|
if (!this.vs.container || this.props.scrollable === "none")
|
|
@@ -51,35 +52,35 @@ const _ = class _ extends r.Component {
|
|
|
51
52
|
if (this.props.scrollable === "virtual")
|
|
52
53
|
this.vs.askedSkip = t, this.vs.container.scroll(0, Math.round(this.vs.askedSkip / this.vs.total * this.vs.container.scrollHeight));
|
|
53
54
|
else if (this.element) {
|
|
54
|
-
const
|
|
55
|
-
|
|
55
|
+
const o = t < 1 ? this.element.querySelector("tbody > tr:nth-child(1)") : this.element.querySelector(`tbody > tr:nth-child(${t + 1})`);
|
|
56
|
+
o && this.containerRef.current && (this.containerRef.current.scrollTop = o.offsetTop);
|
|
56
57
|
}
|
|
57
58
|
}, this.scrollIntoView = (e) => {
|
|
58
59
|
if (!this.vs.container || this.props.scrollable === "none")
|
|
59
60
|
return;
|
|
60
61
|
this.rowIndex = e.rowIndex;
|
|
61
|
-
const { rowIndex: t } = e,
|
|
62
|
-
if (this.observer &&
|
|
62
|
+
const { rowIndex: t } = e, o = this.element;
|
|
63
|
+
if (this.observer && o) {
|
|
63
64
|
this.observer.disconnect();
|
|
64
|
-
const n =
|
|
65
|
+
const n = o.querySelector(`[absolute-row-index="${t}"]`);
|
|
65
66
|
n ? this.observer.observe(n) : this.setCurrentOnTop(e);
|
|
66
67
|
}
|
|
67
68
|
}, this.fitColumns = (e) => {
|
|
68
69
|
this.columnResize.dblClickHandler(null, e);
|
|
69
|
-
}, this.onContextMenu = (e, t,
|
|
70
|
+
}, this.onContextMenu = (e, t, o) => {
|
|
70
71
|
if (this.props.onContextMenu) {
|
|
71
72
|
const n = {
|
|
72
73
|
target: this,
|
|
73
74
|
syntheticEvent: e,
|
|
74
75
|
nativeEvent: e.nativeEvent,
|
|
75
76
|
dataItem: t,
|
|
76
|
-
field:
|
|
77
|
+
field: o
|
|
77
78
|
};
|
|
78
79
|
this.props.onContextMenu.call(void 0, n);
|
|
79
80
|
}
|
|
80
81
|
}, this.getVirtualScroll = (e) => {
|
|
81
|
-
const { rowHeight: t, detailRowHeight:
|
|
82
|
-
return !f ||
|
|
82
|
+
const { rowHeight: t, detailRowHeight: o, detail: n, expandField: h, groupable: l } = e, d = this.isAllData(), f = t !== void 0 && t > 0, R = o !== void 0 && o > 0, E = l === !0 || typeof l == "object" && l.enabled !== !1;
|
|
83
|
+
return !f || E && !d || !!(n && h) && (!R || !d) ? ht : ge;
|
|
83
84
|
}, this.isAllData = () => {
|
|
84
85
|
const { data: e, total: t } = this.props;
|
|
85
86
|
return Array.isArray(e) ? e.length === t : e ? t === e.total : !1;
|
|
@@ -92,35 +93,35 @@ const _ = class _ extends r.Component {
|
|
|
92
93
|
this.props.sort,
|
|
93
94
|
t || this.props.rowHeight === void 0 || this.props.rowHeight === 0
|
|
94
95
|
), 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
|
|
96
|
-
this.vs.containerHeight =
|
|
96
|
+
const o = this.props.rowHeight * e;
|
|
97
|
+
this.vs.containerHeight = me ? Math.min(fe, o) : o;
|
|
97
98
|
} else
|
|
98
99
|
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
|
|
100
|
-
const { rowHeight:
|
|
100
|
+
if (this.vs.containerRef = this.containerRef, this.vs.tableBodyRef = this.tableBodyRef, this.vs.table = this.tableElement, this._slicedData = void 0, this.vs instanceof ge) {
|
|
101
|
+
const { rowHeight: o = 0, detail: n, expandField: h } = this.props;
|
|
101
102
|
let { detailRowHeight: l = 0 } = this.props;
|
|
102
|
-
l = n && h ? l :
|
|
103
|
+
l = n && h ? l : o, 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, o, l, this._data)) : this.vs.rowHeightService = new re(e, o, l);
|
|
103
104
|
const d = this.vs.rowHeightService.totalHeight();
|
|
104
|
-
this.vs.containerHeight =
|
|
105
|
+
this.vs.containerHeight = me ? Math.min(fe, d) : d;
|
|
105
106
|
}
|
|
106
107
|
}, this.scrollHandler = (e) => {
|
|
107
108
|
if (e.target !== e.currentTarget)
|
|
108
109
|
return;
|
|
109
110
|
clearTimeout(this.forceUpdateTimeout), this.vs.table = this.tableElement;
|
|
110
|
-
const t = e.currentTarget.scrollLeft,
|
|
111
|
-
this.props.columnVirtualization && (!this.vs.scrollableVirtual ||
|
|
111
|
+
const t = e.currentTarget.scrollLeft, o = e.currentTarget.scrollTop;
|
|
112
|
+
this.props.columnVirtualization && (!this.vs.scrollableVirtual || o === this.wrapperScrollTop) && (this.forceUpdateTimeout = window.setTimeout(() => {
|
|
112
113
|
this.forceUpdate();
|
|
113
|
-
}, 0)), this._header && this._header.setScrollLeft(t), this._footer && this._footer.setScrollLeft(t), this.vs &&
|
|
114
|
+
}, 0)), this._header && this._header.setScrollLeft(t), this._footer && this._footer.setScrollLeft(t), this.vs && o !== this.wrapperScrollTop && this.vs.scrollHandler(e), Ge(this.props.onScroll, e, this, void 0), this.wrapperScrollTop = o;
|
|
114
115
|
}, this.onKeyDown = (e) => {
|
|
115
116
|
if (x.onKeyDown(e, {
|
|
116
117
|
contextStateRef: this.contextStateRef,
|
|
117
118
|
navigationStateRef: this.navigationStateRef,
|
|
118
119
|
onNavigationAction: this.onNavigationAction
|
|
119
120
|
}), this.props.onKeyDown) {
|
|
120
|
-
const { mode: t, cell:
|
|
121
|
+
const { mode: t, cell: o } = le(this.props.selectable), n = {
|
|
121
122
|
dataItems: this.getLeafDataItems(),
|
|
122
123
|
mode: t,
|
|
123
|
-
cell:
|
|
124
|
+
cell: o,
|
|
124
125
|
componentId: this._gridId,
|
|
125
126
|
selectedField: this.props.selectedField,
|
|
126
127
|
...this.getArguments(e)
|
|
@@ -158,8 +159,8 @@ const _ = class _ extends r.Component {
|
|
|
158
159
|
}, this.itemChange = (e) => {
|
|
159
160
|
const t = this.props.onItemChange;
|
|
160
161
|
if (e.field === this.props.expandField || this.props.group && e.field === void 0) {
|
|
161
|
-
const
|
|
162
|
-
|
|
162
|
+
const o = this.props.onExpandChange;
|
|
163
|
+
o && o.call(
|
|
163
164
|
void 0,
|
|
164
165
|
{
|
|
165
166
|
...this.getArguments(e.syntheticEvent),
|
|
@@ -204,13 +205,13 @@ const _ = class _ extends r.Component {
|
|
|
204
205
|
};
|
|
205
206
|
this.props.onSelectionChange.call(void 0, t);
|
|
206
207
|
}
|
|
207
|
-
}, this.pageChange = (e, t,
|
|
208
|
+
}, this.pageChange = (e, t, o) => {
|
|
208
209
|
this.raiseDataEvent(
|
|
209
210
|
this.props.onPageChange,
|
|
210
211
|
{ page: e },
|
|
211
212
|
{ skip: e.skip, take: e.take },
|
|
212
213
|
t,
|
|
213
|
-
|
|
214
|
+
o
|
|
214
215
|
);
|
|
215
216
|
}, this.pagerPageChange = (e) => {
|
|
216
217
|
this.pageChange({ skip: e.skip, take: e.take }, e.syntheticEvent, e.targetEvent);
|
|
@@ -229,12 +230,12 @@ const _ = class _ extends r.Component {
|
|
|
229
230
|
t
|
|
230
231
|
);
|
|
231
232
|
}, this.groupChange = (e, t) => {
|
|
232
|
-
const
|
|
233
|
+
const o = t.nativeEvent ? t : { nativeEvent: t.nativeEvent || t.originalEvent };
|
|
233
234
|
this.raiseDataEvent(
|
|
234
235
|
this.props.onGroupChange,
|
|
235
236
|
{ group: e },
|
|
236
237
|
{ group: e, skip: 0 },
|
|
237
|
-
|
|
238
|
+
o
|
|
238
239
|
);
|
|
239
240
|
}, this.onClipboard = (e, t) => {
|
|
240
241
|
if (this.props.onClipboard) {
|
|
@@ -255,9 +256,9 @@ const _ = class _ extends r.Component {
|
|
|
255
256
|
var h, l, d;
|
|
256
257
|
if (!V)
|
|
257
258
|
return !1;
|
|
258
|
-
const e =
|
|
259
|
-
return !!(t && n &&
|
|
260
|
-
}, this.onResize = (e, t,
|
|
259
|
+
const e = Ke(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, o = t.closest(".k-grid-container"), n = t && ((d = this._element) == null ? void 0 : d.contains(t));
|
|
260
|
+
return !!(t && n && o);
|
|
261
|
+
}, this.onResize = (e, t, o, n, h, l) => {
|
|
261
262
|
this.resetTableWidth(), this._shouldUpdateLeftRight = !0, this._resized = !0, this._columnsMutations++, this.props.onColumnResize && this.props.onColumnResize.call(
|
|
262
263
|
void 0,
|
|
263
264
|
{
|
|
@@ -266,35 +267,35 @@ const _ = class _ extends r.Component {
|
|
|
266
267
|
targetColumnId: l,
|
|
267
268
|
index: e,
|
|
268
269
|
newWidth: t,
|
|
269
|
-
oldWidth:
|
|
270
|
+
oldWidth: o,
|
|
270
271
|
end: h,
|
|
271
272
|
target: this
|
|
272
273
|
}
|
|
273
274
|
);
|
|
274
|
-
}, this.reInitVirtualization = S((e, t,
|
|
275
|
+
}, this.reInitVirtualization = S((e, t, o, n, h, l) => {
|
|
275
276
|
this.vs.reset();
|
|
276
277
|
const d = this.getVirtualScroll(this.props);
|
|
277
278
|
this.vs = new d(l);
|
|
278
|
-
}), this.flatData = S((e, t,
|
|
279
|
-
const f = [], R =
|
|
279
|
+
}), this.flatData = S((e, t, o, n, h, l, d) => {
|
|
280
|
+
const f = [], R = ct(
|
|
280
281
|
f,
|
|
281
282
|
e,
|
|
282
283
|
t,
|
|
283
|
-
{ index:
|
|
284
|
+
{ index: o },
|
|
284
285
|
n !== void 0,
|
|
285
286
|
h
|
|
286
287
|
);
|
|
287
288
|
return { flattedData: f, resolvedGroupsCount: R };
|
|
288
|
-
}), this.rowHeightService = S((e, t,
|
|
289
|
-
(e, t,
|
|
289
|
+
}), this.rowHeightService = S((e, t, o, n, h) => new re(t, o, n, h)), this.childrenToArray = S((e) => r.Children.toArray(e)), this.readColumns = S(
|
|
290
|
+
(e, t, o) => {
|
|
290
291
|
const n = e.filter((h) => h && h.type && h.type.displayName === "KendoReactGridColumn");
|
|
291
|
-
return
|
|
292
|
+
return ut(n, this.columns, { prevId: 0, idPrefix: t });
|
|
292
293
|
}
|
|
293
294
|
), this.mapColumns = S(
|
|
294
|
-
(e, t) =>
|
|
295
|
-
), this.configureColumns = S((e, t,
|
|
295
|
+
(e, t) => We(e, t)
|
|
296
|
+
), this.configureColumns = S((e, t, o) => {
|
|
296
297
|
this.props.selectedField && e.filter((l) => l.field === this.props.selectedField).forEach((l) => {
|
|
297
|
-
l.width = l.width || "50px", l.cell = l.cell ||
|
|
298
|
+
l.width = l.width || "50px", l.cell = l.cell || Qe, l.headerCell = l.headerCell || Ct;
|
|
298
299
|
});
|
|
299
300
|
const n = {
|
|
300
301
|
id: "",
|
|
@@ -318,7 +319,7 @@ const _ = class _ extends r.Component {
|
|
|
318
319
|
let h = 0;
|
|
319
320
|
this.props.expandField && this.props.onExpandChange && this.props.detail && (e.unshift({
|
|
320
321
|
...n,
|
|
321
|
-
cell:
|
|
322
|
+
cell: Ye,
|
|
322
323
|
field: this.props.expandField,
|
|
323
324
|
headerClassName: "k-hierarchy-cell k-header"
|
|
324
325
|
}), h++);
|
|
@@ -326,19 +327,19 @@ const _ = class _ extends r.Component {
|
|
|
326
327
|
e.unshift({
|
|
327
328
|
...n,
|
|
328
329
|
isAccessible: !1,
|
|
329
|
-
cell:
|
|
330
|
+
cell: ve,
|
|
330
331
|
field: "value",
|
|
331
332
|
locked: this.props.lockGroups
|
|
332
333
|
}), h++;
|
|
333
334
|
e.slice(h).forEach((l) => l.parentIndex >= 0 && (l.parentIndex += h));
|
|
334
|
-
}), this.getHeaderRow = S((e, t,
|
|
335
|
-
|
|
335
|
+
}), this.getHeaderRow = S((e, t, o, n, h, l, d, f, R, E, z, C) => /* @__PURE__ */ r.createElement(
|
|
336
|
+
tt,
|
|
336
337
|
{
|
|
337
338
|
cells: this.props.cells,
|
|
338
339
|
sort: e,
|
|
339
340
|
sortable: t,
|
|
340
341
|
sortChange: this.sortChange,
|
|
341
|
-
group:
|
|
342
|
+
group: o || [],
|
|
342
343
|
groupable: n,
|
|
343
344
|
groupChange: this.groupChange,
|
|
344
345
|
filter: h,
|
|
@@ -347,7 +348,7 @@ const _ = class _ extends r.Component {
|
|
|
347
348
|
filterChange: this.filterChange,
|
|
348
349
|
columnMenu: R,
|
|
349
350
|
selectionChange: this.onHeaderSelectionChange,
|
|
350
|
-
columns:
|
|
351
|
+
columns: E,
|
|
351
352
|
columnResize: this.columnResize,
|
|
352
353
|
pressHandler: this.dragLogic.pressHandler,
|
|
353
354
|
dragHandler: this.dragLogic.dragHandler,
|
|
@@ -362,15 +363,15 @@ const _ = class _ extends r.Component {
|
|
|
362
363
|
columnGroupChange: this.columnGroupChange
|
|
363
364
|
}
|
|
364
365
|
)), this.resolveTitle = (e) => {
|
|
365
|
-
const t = this._columns.find((n) => n.field === e),
|
|
366
|
-
return
|
|
367
|
-
}, this.getLeafDataItems = () => this._data.filter((e) => e.rowType === "data").map((e) => e.dataItem),
|
|
366
|
+
const t = this._columns.find((n) => n.field === e), o = t && (t.title || t.field);
|
|
367
|
+
return o === void 0 ? e : o;
|
|
368
|
+
}, this.getLeafDataItems = () => this._data.filter((e) => e.rowType === "data").map((e) => e.dataItem), Oe(Re), this.showLicenseWatermark = Pe(Re);
|
|
368
369
|
const p = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1, c = this.getVirtualScroll(a);
|
|
369
|
-
this.vs = new c(p || a.rowHeight === void 0 || a.rowHeight === 0), this.dragLogic = new
|
|
370
|
+
this.vs = new c(p || a.rowHeight === void 0 || a.rowHeight === 0), this.dragLogic = new dt(
|
|
370
371
|
this.columnReorder.bind(this),
|
|
371
372
|
this.groupReorder.bind(this),
|
|
372
373
|
this.columnToGroup.bind(this)
|
|
373
|
-
), this.columnGroupChange = this.columnGroupChange.bind(this), this.columnResize = new
|
|
374
|
+
), this.columnGroupChange = this.columnGroupChange.bind(this), this.columnResize = new pt(this.onResize), this.props.clipboard && (this.clipboardService = new Be(this.onClipboard)), x.onConstructor({
|
|
374
375
|
navigatable: !!a.navigatable,
|
|
375
376
|
contextStateRef: this.contextStateRef,
|
|
376
377
|
navigationStateRef: this.navigationStateRef,
|
|
@@ -419,7 +420,7 @@ const _ = class _ extends r.Component {
|
|
|
419
420
|
// tslint:enable:max-line-length
|
|
420
421
|
get columns() {
|
|
421
422
|
const a = this._columns.filter((p) => p.declarationIndex >= 0 && p.parentIndex === -1);
|
|
422
|
-
return
|
|
423
|
+
return gt(a);
|
|
423
424
|
}
|
|
424
425
|
/**
|
|
425
426
|
* Returns the HTML element of the Grid component.
|
|
@@ -441,8 +442,8 @@ const _ = class _ extends r.Component {
|
|
|
441
442
|
* @hidden
|
|
442
443
|
*/
|
|
443
444
|
componentDidMount() {
|
|
444
|
-
this.resetTableWidth(),
|
|
445
|
-
const a =
|
|
445
|
+
navigator.userAgent.match(Et) || (this.headTable && (this.headTable.style.display = "block"), this.tableElement && (this.tableElement.style.display = "block")), this.resetTableWidth(), ae();
|
|
446
|
+
const a = $e(this.element);
|
|
446
447
|
this.isRtl = a, x.onComponentDidMount({
|
|
447
448
|
scope: this.element || void 0,
|
|
448
449
|
contextStateRef: this.contextStateRef,
|
|
@@ -468,7 +469,7 @@ const _ = class _ extends r.Component {
|
|
|
468
469
|
* @hidden
|
|
469
470
|
*/
|
|
470
471
|
componentDidUpdate() {
|
|
471
|
-
this.resetTableWidth(),
|
|
472
|
+
this.resetTableWidth(), ae(), this.vs.tableTransform && this.vs.table && (this.vs.table.style.transform = this.vs.tableTransform, this.vs.tableTransform = ""), x.onComponentDidUpdate({
|
|
472
473
|
scope: this.element || void 0,
|
|
473
474
|
contextStateRef: this.contextStateRef,
|
|
474
475
|
navigationStateRef: this.navigationStateRef
|
|
@@ -484,12 +485,12 @@ const _ = class _ extends r.Component {
|
|
|
484
485
|
* @hidden
|
|
485
486
|
*/
|
|
486
487
|
render() {
|
|
487
|
-
var
|
|
488
|
+
var ie;
|
|
488
489
|
let a = this.props.total || 0;
|
|
489
|
-
const p = N.getIdPrefix(this.navigationStateRef), c =
|
|
490
|
+
const p = N.getIdPrefix(this.navigationStateRef), c = rt(this);
|
|
490
491
|
let e = [];
|
|
491
492
|
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);
|
|
492
|
-
const t = typeof this.props.groupable == "object" && this.props.groupable.footer || "none",
|
|
493
|
+
const t = typeof this.props.groupable == "object" && this.props.groupable.footer || "none", o = this.props.scrollable === "virtual", { resolvedGroupsCount: n, flattedData: h } = this.flatData(
|
|
493
494
|
e,
|
|
494
495
|
t,
|
|
495
496
|
this.props.skip || 0,
|
|
@@ -505,8 +506,8 @@ const _ = class _ extends r.Component {
|
|
|
505
506
|
this.initializeVirtualization(a, l);
|
|
506
507
|
const f = this.childrenToArray(this.props.children);
|
|
507
508
|
this.initColumns(f, n);
|
|
508
|
-
const R = f.map((
|
|
509
|
-
|
|
509
|
+
const R = f.map((s) => s && s.type && s.type.displayName === "KendoReactGridToolbar" ? r.cloneElement(s, { ...s.props, ariaControls: this._gridId }) : null), E = f.filter((s) => s && s.type && s.type.displayName === "KendoReactGridNoRecords"), z = f.filter((s) => s && s.type && s.type.displayName === "KendoReactGridStatusBar"), C = this._columns.filter((s) => s.children.length === 0), $ = l && /* @__PURE__ */ r.createElement(
|
|
510
|
+
it,
|
|
510
511
|
{
|
|
511
512
|
group: this.props.group || [],
|
|
512
513
|
groupChange: this.groupChange,
|
|
@@ -518,8 +519,8 @@ const _ = class _ extends r.Component {
|
|
|
518
519
|
ariaControls: this._gridId,
|
|
519
520
|
onContextMenu: this.onContextMenu
|
|
520
521
|
}
|
|
521
|
-
), { sort:
|
|
522
|
-
|
|
522
|
+
), { sort: ye, sortable: we, group: Se, filter: ke, filterable: Ee, filterOperators: Ie = Ce, headerCellRender: xe, columnMenu: _e } = this.props, j = /* @__PURE__ */ r.createElement(
|
|
523
|
+
et,
|
|
523
524
|
{
|
|
524
525
|
size: this.props.size,
|
|
525
526
|
columnResize: this.columnResize,
|
|
@@ -529,27 +530,27 @@ const _ = class _ extends r.Component {
|
|
|
529
530
|
ref: this.headerRef,
|
|
530
531
|
elemRef: this.headerElementRef,
|
|
531
532
|
headerRow: this.getHeaderRow(
|
|
533
|
+
ye,
|
|
532
534
|
we,
|
|
533
535
|
Se,
|
|
534
|
-
ke,
|
|
535
536
|
l,
|
|
536
|
-
|
|
537
|
+
ke,
|
|
537
538
|
Ee,
|
|
539
|
+
Ie,
|
|
538
540
|
xe,
|
|
539
541
|
_e,
|
|
540
|
-
ze,
|
|
541
542
|
this._columns,
|
|
542
543
|
this._columnsMap,
|
|
543
544
|
this.isRtl
|
|
544
545
|
),
|
|
545
546
|
filterRow: this.props.filterable && /* @__PURE__ */ r.createElement(
|
|
546
|
-
|
|
547
|
+
st,
|
|
547
548
|
{
|
|
548
549
|
cells: this.props.cells,
|
|
549
550
|
size: this.props.size,
|
|
550
551
|
columns: this._columns,
|
|
551
552
|
filter: this.props.filter,
|
|
552
|
-
filterOperators: this.props.filterOperators ||
|
|
553
|
+
filterOperators: this.props.filterOperators || Ce,
|
|
553
554
|
filterChange: this.filterChange,
|
|
554
555
|
sort: this.props.sort,
|
|
555
556
|
cellRender: this.props.filterCellRender,
|
|
@@ -557,33 +558,33 @@ const _ = class _ extends r.Component {
|
|
|
557
558
|
ariaRowIndex: this._columnsMap.length + 1
|
|
558
559
|
}
|
|
559
560
|
) || void 0,
|
|
560
|
-
cols: C.map((
|
|
561
|
+
cols: C.map((s, g) => /* @__PURE__ */ r.createElement(
|
|
561
562
|
"col",
|
|
562
563
|
{
|
|
563
564
|
key: g.toString(),
|
|
564
|
-
width: W(
|
|
565
|
+
width: W(s)
|
|
565
566
|
}
|
|
566
567
|
))
|
|
567
568
|
}
|
|
568
|
-
),
|
|
569
|
+
), ze = this.vs && this.vs.container && this.vs.container.scrollLeft || 0, De = parseFloat(((this.props.style || {}).width || "").toString()), { colSpans: He, hiddenColumns: Te } = je({
|
|
569
570
|
enabled: this.props.columnVirtualization,
|
|
570
571
|
columns: C,
|
|
571
|
-
tableViewPortWidth:
|
|
572
|
-
scrollLeft:
|
|
573
|
-
}),
|
|
574
|
-
let
|
|
575
|
-
const k = this.props.selectedField ?
|
|
572
|
+
tableViewPortWidth: De,
|
|
573
|
+
scrollLeft: ze
|
|
574
|
+
}), Le = (s, g, m) => {
|
|
575
|
+
let I = !1;
|
|
576
|
+
const k = this.props.selectedField ? be(this.props.selectedField, s.dataItem) : void 0;
|
|
576
577
|
return {
|
|
577
578
|
row: C.map((u, b) => {
|
|
578
|
-
if (
|
|
579
|
+
if (Te[b])
|
|
579
580
|
return null;
|
|
580
581
|
const H = u.id ? u.id : b, 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 } : {};
|
|
581
582
|
let w = !1;
|
|
582
583
|
if (u.editable && this.props.editField) {
|
|
583
|
-
const v =
|
|
584
|
-
v && (v === !0 || v === u.field) && (
|
|
584
|
+
const v = be(this.props.editField, s.dataItem);
|
|
585
|
+
v && (v === !0 || v === u.field) && (I = !0, w = !0);
|
|
585
586
|
}
|
|
586
|
-
const P = u.cell || w &&
|
|
587
|
+
const P = u.cell || w && Ze || bt, L = this.props.expandField && this.props.detail && u.field === this.props.expandField;
|
|
587
588
|
return /* @__PURE__ */ r.createElement(
|
|
588
589
|
P,
|
|
589
590
|
{
|
|
@@ -595,63 +596,63 @@ const _ = class _ extends r.Component {
|
|
|
595
596
|
p,
|
|
596
597
|
L ? "nodata" : "cell"
|
|
597
598
|
),
|
|
598
|
-
colSpan:
|
|
599
|
-
dataItem:
|
|
599
|
+
colSpan: He[b],
|
|
600
|
+
dataItem: s.dataItem,
|
|
600
601
|
field: u.field,
|
|
601
602
|
editor: u.editor,
|
|
602
603
|
format: u.format,
|
|
603
604
|
className: T,
|
|
604
605
|
render: this.props.cellRender,
|
|
605
|
-
cells:
|
|
606
|
+
cells: ft(this.props.cells, u.cells),
|
|
606
607
|
onChange: this.itemChange,
|
|
607
608
|
selectionChange: this.props.onSelectionChange ? (v) => {
|
|
608
|
-
this.selectionChange({ event: v, dataItem:
|
|
609
|
+
this.selectionChange({ event: v, dataItem: s.dataItem, dataIndex: m, columnIndex: b });
|
|
609
610
|
} : void 0,
|
|
610
611
|
columnIndex: b,
|
|
611
612
|
columnsCount: C.length,
|
|
612
|
-
rowType:
|
|
613
|
-
level:
|
|
614
|
-
expanded:
|
|
615
|
-
dataIndex:
|
|
613
|
+
rowType: s.rowType,
|
|
614
|
+
level: s.level,
|
|
615
|
+
expanded: s.expanded,
|
|
616
|
+
dataIndex: s.dataIndex,
|
|
616
617
|
style: y,
|
|
617
618
|
ariaColumnIndex: u.ariaColumnIndex,
|
|
618
619
|
isSelected: Array.isArray(k) && k.indexOf(b) > -1
|
|
619
620
|
}
|
|
620
621
|
);
|
|
621
622
|
}),
|
|
622
|
-
isInEdit:
|
|
623
|
+
isInEdit: I,
|
|
623
624
|
isSelected: typeof k == "boolean" && k
|
|
624
625
|
};
|
|
625
626
|
};
|
|
626
627
|
let q = 0;
|
|
627
|
-
if (
|
|
628
|
-
for (let
|
|
628
|
+
if (o)
|
|
629
|
+
for (let s = 0; s < this.vs.topCacheCount + this.vs.attendedSkip - (this.props.skip || 0); s++) {
|
|
629
630
|
const g = this._data.shift();
|
|
630
631
|
if (g)
|
|
631
|
-
this._data.push(g), q++, g.rowType === "groupHeader" &&
|
|
632
|
+
this._data.push(g), q++, g.rowType === "groupHeader" && s--;
|
|
632
633
|
else
|
|
633
634
|
break;
|
|
634
635
|
}
|
|
635
|
-
const
|
|
636
|
-
let
|
|
636
|
+
const X = (s) => s >= this._data.length - q;
|
|
637
|
+
let J = this.vs.realSkip || 0;
|
|
637
638
|
const A = [];
|
|
638
639
|
let K = !1;
|
|
639
640
|
const O = this._columnsMap.length + (this.props.filterable ? 1 : 0) + 1;
|
|
640
641
|
let D = 0;
|
|
641
642
|
if (this._data.length) {
|
|
642
|
-
let
|
|
643
|
-
(this._slicedData || this._data).forEach((m,
|
|
644
|
-
m.rowType === "data" && (
|
|
645
|
-
const k =
|
|
643
|
+
let s = -1, g = 0;
|
|
644
|
+
(this._slicedData || this._data).forEach((m, I) => {
|
|
645
|
+
m.rowType === "data" && (J++, s++);
|
|
646
|
+
const k = J % 2 === 0, u = this.props.dataItemKey && Ve(this.props.dataItemKey)(m.dataItem), b = I + (this.vs.realSkip || 0), H = u || "ai" + b, T = H + "_1", y = Le(m, H, s);
|
|
646
647
|
if (D = b + O + g, A.push(/* @__PURE__ */ r.createElement(
|
|
647
|
-
|
|
648
|
+
vt,
|
|
648
649
|
{
|
|
649
650
|
key: H,
|
|
650
651
|
dataItem: m.dataItem,
|
|
651
652
|
isAltRow: k,
|
|
652
653
|
isInEdit: y.isInEdit,
|
|
653
654
|
rowType: m.rowType,
|
|
654
|
-
isHidden:
|
|
655
|
+
isHidden: X(I),
|
|
655
656
|
onClick: (w) => this.rowClick(w, m),
|
|
656
657
|
onDoubleClick: (w) => this.rowDblClick(w, m),
|
|
657
658
|
selectedField: this.props.selectedField,
|
|
@@ -659,7 +660,7 @@ const _ = class _ extends r.Component {
|
|
|
659
660
|
render: this.props.rowRender,
|
|
660
661
|
ariaRowIndex: D,
|
|
661
662
|
absoluteRowIndex: b,
|
|
662
|
-
dataIndex: this.vs.scrollableVirtual ? b :
|
|
663
|
+
dataIndex: this.vs.scrollableVirtual ? b : s,
|
|
663
664
|
isSelected: y.isSelected
|
|
664
665
|
},
|
|
665
666
|
y.row
|
|
@@ -673,22 +674,22 @@ const _ = class _ extends r.Component {
|
|
|
673
674
|
"k-table-row",
|
|
674
675
|
k ? "k-detail-row k-table-alt-row k-alt" : "k-detail-row"
|
|
675
676
|
),
|
|
676
|
-
style: { visibility:
|
|
677
|
+
style: { visibility: X(I) ? "hidden" : "", height: this.props.detailRowHeight },
|
|
677
678
|
role: "row",
|
|
678
679
|
"aria-rowindex": D
|
|
679
680
|
},
|
|
680
681
|
this.props.group && this.props.group.map((P, L) => {
|
|
681
|
-
var
|
|
682
|
-
const v = (
|
|
682
|
+
var oe;
|
|
683
|
+
const v = (oe = y == null ? void 0 : y.row[L]) == null ? void 0 : oe.props.style, Me = v ? this.isRtl ? { left: v.right, right: v.left } : { left: v.left, right: v.right } : {};
|
|
683
684
|
return /* @__PURE__ */ r.createElement(
|
|
684
|
-
|
|
685
|
+
ve,
|
|
685
686
|
{
|
|
686
687
|
id: "",
|
|
687
688
|
dataIndex: m.dataIndex,
|
|
688
689
|
field: P.field,
|
|
689
690
|
dataItem: m.dataItem,
|
|
690
691
|
key: L,
|
|
691
|
-
style:
|
|
692
|
+
style: Me,
|
|
692
693
|
ariaColumnIndex: 1 + L,
|
|
693
694
|
isSelected: !1,
|
|
694
695
|
locked: this.props.lockGroups,
|
|
@@ -698,13 +699,13 @@ const _ = class _ extends r.Component {
|
|
|
698
699
|
);
|
|
699
700
|
}),
|
|
700
701
|
this.props.expandField && /* @__PURE__ */ r.createElement(
|
|
701
|
-
|
|
702
|
+
kt,
|
|
702
703
|
{
|
|
703
704
|
id: N.generateNavigatableId(`${T}-dhcell`, p)
|
|
704
705
|
}
|
|
705
706
|
),
|
|
706
707
|
/* @__PURE__ */ r.createElement(
|
|
707
|
-
|
|
708
|
+
St,
|
|
708
709
|
{
|
|
709
710
|
onContextMenu: this.onContextMenu,
|
|
710
711
|
dataItem: m.dataItem,
|
|
@@ -720,38 +721,38 @@ const _ = class _ extends r.Component {
|
|
|
720
721
|
});
|
|
721
722
|
} else
|
|
722
723
|
K = !0;
|
|
723
|
-
const
|
|
724
|
-
const
|
|
725
|
-
return
|
|
726
|
-
},
|
|
724
|
+
const Fe = () => {
|
|
725
|
+
const s = this._header;
|
|
726
|
+
return s && s.table.clientWidth;
|
|
727
|
+
}, Q = () => /* @__PURE__ */ r.createElement("div", { key: "no-records", className: "k-grid-norecords", "aria-rowindex": O, style: { width: Fe() } }, /* @__PURE__ */ r.createElement("div", { className: "k-grid-norecords-template" }, E.length ? E : /* @__PURE__ */ r.createElement(Rt, null))), Y = {
|
|
727
728
|
size: this.props.size,
|
|
728
729
|
onPageChange: this.pagerPageChange,
|
|
729
730
|
total: a,
|
|
730
731
|
dir: this.isRtl ? "rtl" : void 0,
|
|
731
732
|
skip: this.vs.propsSkip || 0,
|
|
732
733
|
take: (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 10,
|
|
733
|
-
messagesMap:
|
|
734
|
-
...
|
|
735
|
-
}, Z = this.props.pager ? /* @__PURE__ */ r.createElement(this.props.pager, { ...Y }) : /* @__PURE__ */ r.createElement(
|
|
734
|
+
messagesMap: lt,
|
|
735
|
+
...wt(this.props.pageable || {})
|
|
736
|
+
}, Z = this.props.pager ? /* @__PURE__ */ r.createElement(this.props.pager, { ...Y }) : /* @__PURE__ */ r.createElement(qe, { className: "k-grid-pager", ...Y }), Ne = (s) => this.props.sort && this.props.sort.filter((g) => g.field === s).length > 0, Ae = (s, g) => /* @__PURE__ */ r.createElement(
|
|
736
737
|
"col",
|
|
737
738
|
{
|
|
738
739
|
key: g.toString(),
|
|
739
|
-
width: W(
|
|
740
|
+
width: W(s)
|
|
740
741
|
}
|
|
741
|
-
), ee = (
|
|
742
|
-
(
|
|
742
|
+
), ee = (ie = this.props.cells) != null && ie.footerCell || this._columns.some(
|
|
743
|
+
(s) => {
|
|
743
744
|
var g;
|
|
744
|
-
return !!(
|
|
745
|
+
return !!(s.footerCell || (g = s.cells) != null && g.footerCell);
|
|
745
746
|
}
|
|
746
747
|
) ? /* @__PURE__ */ r.createElement(
|
|
747
|
-
|
|
748
|
+
ot,
|
|
748
749
|
{
|
|
749
750
|
size: this.props.size,
|
|
750
751
|
columnResize: this.columnResize,
|
|
751
752
|
staticHeaders: this.props.scrollable !== "none",
|
|
752
|
-
ref: (
|
|
753
|
+
ref: (s) => this._footer = s,
|
|
753
754
|
row: /* @__PURE__ */ r.createElement(
|
|
754
|
-
|
|
755
|
+
yt,
|
|
755
756
|
{
|
|
756
757
|
cells: this.props.cells,
|
|
757
758
|
columns: this._columns,
|
|
@@ -759,26 +760,26 @@ const _ = class _ extends r.Component {
|
|
|
759
760
|
ariaRowIndex: D + 1
|
|
760
761
|
}
|
|
761
762
|
),
|
|
762
|
-
cols: C.map(
|
|
763
|
+
cols: C.map(Ae)
|
|
763
764
|
}
|
|
764
765
|
) : null, te = /* @__PURE__ */ r.createElement(
|
|
765
766
|
"colgroup",
|
|
766
767
|
{
|
|
767
|
-
ref: (
|
|
768
|
-
this.columnResize.colGroupMain =
|
|
768
|
+
ref: (s) => {
|
|
769
|
+
this.columnResize.colGroupMain = s;
|
|
769
770
|
}
|
|
770
771
|
},
|
|
771
772
|
C.map(
|
|
772
|
-
(
|
|
773
|
+
(s, g) => /* @__PURE__ */ r.createElement(
|
|
773
774
|
"col",
|
|
774
775
|
{
|
|
775
776
|
key: g.toString(),
|
|
776
|
-
className:
|
|
777
|
-
width: W(
|
|
777
|
+
className: Ne(s.field) ? "k-sorted" : void 0,
|
|
778
|
+
width: W(s)
|
|
778
779
|
}
|
|
779
780
|
)
|
|
780
781
|
)
|
|
781
|
-
), se = this.dragLogic.reorderable || this.dragLogic.groupable
|
|
782
|
+
), se = this.dragLogic.reorderable || this.dragLogic.groupable;
|
|
782
783
|
if (this.props.scrollable === "none")
|
|
783
784
|
return /* @__PURE__ */ r.createElement(U.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
784
785
|
"div",
|
|
@@ -793,45 +794,46 @@ const _ = class _ extends r.Component {
|
|
|
793
794
|
},
|
|
794
795
|
this.props.className
|
|
795
796
|
),
|
|
796
|
-
ref: (
|
|
797
|
-
this._element =
|
|
797
|
+
ref: (s) => {
|
|
798
|
+
this._element = s;
|
|
798
799
|
},
|
|
799
800
|
"aria-label": this.props.ariaLabel,
|
|
800
801
|
onKeyDown: this.onKeyDown,
|
|
801
802
|
onFocus: this.onFocus,
|
|
802
|
-
...
|
|
803
|
+
...ne
|
|
803
804
|
},
|
|
804
805
|
R,
|
|
805
806
|
$,
|
|
806
807
|
/* @__PURE__ */ r.createElement(
|
|
807
|
-
|
|
808
|
+
he,
|
|
808
809
|
{
|
|
809
810
|
selectable: this.props.selectable,
|
|
810
811
|
onRelease: this.selectionRelease,
|
|
811
|
-
childRef: (
|
|
812
|
-
this.tableElement =
|
|
812
|
+
childRef: (s) => {
|
|
813
|
+
this.tableElement = s, this.headTable = s;
|
|
813
814
|
}
|
|
814
815
|
},
|
|
815
816
|
/* @__PURE__ */ r.createElement(
|
|
816
817
|
"table",
|
|
817
818
|
{
|
|
819
|
+
ref: (s) => this.headTable = s,
|
|
818
820
|
className: F(
|
|
819
821
|
"k-table k-grid-table",
|
|
820
822
|
{ [`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size }
|
|
821
823
|
),
|
|
822
|
-
style: { userSelect: d
|
|
824
|
+
style: { userSelect: d }
|
|
823
825
|
},
|
|
824
826
|
te,
|
|
825
827
|
j,
|
|
826
|
-
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...
|
|
828
|
+
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...pe }, A),
|
|
827
829
|
ee
|
|
828
830
|
)
|
|
829
831
|
),
|
|
830
|
-
K &&
|
|
831
|
-
se && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
832
|
+
K && Q(),
|
|
833
|
+
se && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(de, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(ce, { ref: this.dragLogic.refDragElementClue }))
|
|
832
834
|
), z, this.props.pageable && Z);
|
|
833
835
|
let M = this.props.style || {};
|
|
834
|
-
return
|
|
836
|
+
return o && (M.height || (M = Object.assign({}, M, { height: "450px" }))), /* @__PURE__ */ r.createElement(U.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
835
837
|
"div",
|
|
836
838
|
{
|
|
837
839
|
id: this.props.id,
|
|
@@ -841,17 +843,17 @@ const _ = class _ extends r.Component {
|
|
|
841
843
|
{
|
|
842
844
|
"k-grid-md": !this.props.size,
|
|
843
845
|
[`k-grid-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size,
|
|
844
|
-
"k-grid-virtual":
|
|
846
|
+
"k-grid-virtual": o
|
|
845
847
|
},
|
|
846
848
|
this.props.className
|
|
847
849
|
),
|
|
848
|
-
ref: (
|
|
849
|
-
this._element =
|
|
850
|
+
ref: (s) => {
|
|
851
|
+
this._element = s;
|
|
850
852
|
},
|
|
851
853
|
"aria-label": this.props.ariaLabel,
|
|
852
854
|
onKeyDown: this.onKeyDown,
|
|
853
855
|
onFocus: this.onFocus,
|
|
854
|
-
...
|
|
856
|
+
...ne
|
|
855
857
|
},
|
|
856
858
|
R,
|
|
857
859
|
$,
|
|
@@ -863,7 +865,7 @@ const _ = class _ extends r.Component {
|
|
|
863
865
|
"aria-colcount": C.length,
|
|
864
866
|
"aria-rowcount": a,
|
|
865
867
|
id: this._gridId,
|
|
866
|
-
"aria-label": c.toLanguageString(
|
|
868
|
+
"aria-label": c.toLanguageString(ue, nt[ue])
|
|
867
869
|
},
|
|
868
870
|
j,
|
|
869
871
|
/* @__PURE__ */ r.createElement("div", { className: "k-grid-container", role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
@@ -875,17 +877,18 @@ const _ = class _ extends r.Component {
|
|
|
875
877
|
role: "presentation"
|
|
876
878
|
},
|
|
877
879
|
/* @__PURE__ */ r.createElement("div", { className: "k-grid-table-wrap", role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
878
|
-
|
|
880
|
+
he,
|
|
879
881
|
{
|
|
880
882
|
selectable: this.props.selectable,
|
|
881
883
|
onRelease: this.selectionRelease,
|
|
882
|
-
childRef: (
|
|
883
|
-
this.tableElement =
|
|
884
|
+
childRef: (s) => {
|
|
885
|
+
this.tableElement = s;
|
|
884
886
|
}
|
|
885
887
|
},
|
|
886
888
|
/* @__PURE__ */ r.createElement(
|
|
887
889
|
"table",
|
|
888
890
|
{
|
|
891
|
+
ref: (s) => this.tableElement = s,
|
|
889
892
|
className: F(
|
|
890
893
|
"k-table k-grid-table",
|
|
891
894
|
{
|
|
@@ -894,7 +897,7 @@ const _ = class _ extends r.Component {
|
|
|
894
897
|
}
|
|
895
898
|
),
|
|
896
899
|
role: "presentation",
|
|
897
|
-
style: { userSelect: d
|
|
900
|
+
style: { userSelect: d }
|
|
898
901
|
},
|
|
899
902
|
te,
|
|
900
903
|
/* @__PURE__ */ r.createElement(
|
|
@@ -903,22 +906,22 @@ const _ = class _ extends r.Component {
|
|
|
903
906
|
className: "k-table-tbody",
|
|
904
907
|
ref: this.tableBodyRef,
|
|
905
908
|
role: "rowgroup",
|
|
906
|
-
...
|
|
909
|
+
...pe
|
|
907
910
|
},
|
|
908
911
|
A
|
|
909
912
|
)
|
|
910
913
|
)
|
|
911
|
-
), K &&
|
|
912
|
-
|
|
914
|
+
), K && Q()),
|
|
915
|
+
o && /* @__PURE__ */ r.createElement("div", { className: "k-height-container", role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
913
916
|
"div",
|
|
914
917
|
{
|
|
915
|
-
style:
|
|
918
|
+
style: o ? { height: this.vs.containerHeight + "px" } : {}
|
|
916
919
|
}
|
|
917
920
|
))
|
|
918
921
|
)),
|
|
919
922
|
ee,
|
|
920
|
-
se && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(
|
|
921
|
-
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(
|
|
923
|
+
se && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(de, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(ce, { ref: this.dragLogic.refDragElementClue })),
|
|
924
|
+
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(Ue, null)
|
|
922
925
|
),
|
|
923
926
|
z,
|
|
924
927
|
this.props.pageable && Z
|
|
@@ -926,7 +929,7 @@ const _ = class _ extends r.Component {
|
|
|
926
929
|
}
|
|
927
930
|
selectionChange(a) {
|
|
928
931
|
if (this.props.onSelectionChange) {
|
|
929
|
-
const { event: p, dataItem: c, dataIndex: e, columnIndex: t } = a, { mode:
|
|
932
|
+
const { event: p, dataItem: c, dataIndex: e, columnIndex: t } = a, { mode: o, cell: n } = le(this.props.selectable), h = {
|
|
930
933
|
...this.getArguments(p.syntheticEvent),
|
|
931
934
|
dataItem: c,
|
|
932
935
|
startColIndex: t,
|
|
@@ -938,7 +941,7 @@ const _ = class _ extends r.Component {
|
|
|
938
941
|
ctrlKey: !1,
|
|
939
942
|
shiftKey: !1,
|
|
940
943
|
metaKey: !1,
|
|
941
|
-
mode:
|
|
944
|
+
mode: o,
|
|
942
945
|
cell: n,
|
|
943
946
|
isDrag: !1,
|
|
944
947
|
componentId: this._gridId,
|
|
@@ -948,12 +951,12 @@ const _ = class _ extends r.Component {
|
|
|
948
951
|
}
|
|
949
952
|
}
|
|
950
953
|
raiseDataEvent(a, p, c, e, t) {
|
|
951
|
-
const
|
|
954
|
+
const o = this.props.onDataStateChange;
|
|
952
955
|
if (a) {
|
|
953
956
|
const n = { ...this.getArguments(e), ...p, targetEvent: t };
|
|
954
957
|
a.call(void 0, n);
|
|
955
958
|
} else
|
|
956
|
-
|
|
959
|
+
o && o.call(
|
|
957
960
|
void 0,
|
|
958
961
|
{
|
|
959
962
|
...this.getArguments(e),
|
|
@@ -966,15 +969,15 @@ const _ = class _ extends r.Component {
|
|
|
966
969
|
);
|
|
967
970
|
}
|
|
968
971
|
columnReorder(a, p, c) {
|
|
969
|
-
const e = this._columns[a], t = e.depth,
|
|
972
|
+
const e = this._columns[a], t = e.depth, o = (d) => {
|
|
970
973
|
do
|
|
971
974
|
d++;
|
|
972
975
|
while (d < this._columns.length && this._columns[d].depth > t);
|
|
973
976
|
return d;
|
|
974
|
-
}, n = this._columns.splice(a,
|
|
975
|
-
this._columns.splice(a < p ?
|
|
977
|
+
}, n = this._columns.splice(a, o(a) - a);
|
|
978
|
+
this._columns.splice(a < p ? o(p - n.length) : p, 0, ...n), this._columns.filter((d) => d.declarationIndex >= 0).forEach((d, f) => d.orderIndex = f), this._columnsMutations++;
|
|
976
979
|
const h = this._columns[a].locked && this._columns[p].locked;
|
|
977
|
-
|
|
980
|
+
Xe(this._columnsMap, this._columns, h || this._shouldUpdateLeftRight), Je(this._columnsMap, this._columns, h || this._shouldUpdateLeftRight), this._resized && (this._shouldUpdateLeftRight = !1, this._resized = !1);
|
|
978
981
|
const l = this.columns;
|
|
979
982
|
if (this.forceUpdate(), this.props.onColumnReorder) {
|
|
980
983
|
const d = {
|
|
@@ -1018,7 +1021,7 @@ const _ = class _ extends r.Component {
|
|
|
1018
1021
|
}
|
|
1019
1022
|
initColumns(a, p) {
|
|
1020
1023
|
const c = N.getIdPrefix(this.navigationStateRef), e = this.readColumns(a, c, this._columnsMutations), t = e.length !== this._columns.length;
|
|
1021
|
-
this._columns = e, this._columns.length === 0 && (this._columns =
|
|
1024
|
+
this._columns = e, this._columns.length === 0 && (this._columns = mt(this.props.data, this.props.group, this.props.expandField, { prevId: 0, idPrefix: c })), this.configureColumns(this._columns, p, c), this._columnsMap = this.mapColumns(this._columns, t), this.columnResize.columns = this._columns, this.dragLogic.columns = this._columns;
|
|
1022
1025
|
}
|
|
1023
1026
|
getDataState() {
|
|
1024
1027
|
return {
|
|
@@ -1040,84 +1043,84 @@ const _ = class _ extends r.Component {
|
|
|
1040
1043
|
_.displayName = "KendoReactGrid", _.defaultProps = {
|
|
1041
1044
|
// never use this
|
|
1042
1045
|
}, _.propTypes = {
|
|
1043
|
-
data:
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
data:
|
|
1047
|
-
total:
|
|
1046
|
+
data: i.oneOfType([
|
|
1047
|
+
i.array,
|
|
1048
|
+
i.shape({
|
|
1049
|
+
data: i.array,
|
|
1050
|
+
total: i.number
|
|
1048
1051
|
})
|
|
1049
1052
|
]),
|
|
1050
|
-
sortable:
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
mode:
|
|
1054
|
-
allowUnsort:
|
|
1053
|
+
sortable: i.oneOfType([
|
|
1054
|
+
i.bool,
|
|
1055
|
+
i.shape({
|
|
1056
|
+
mode: i.oneOf(["single", "multiple"]),
|
|
1057
|
+
allowUnsort: i.bool
|
|
1055
1058
|
})
|
|
1056
1059
|
]),
|
|
1057
|
-
onSortChange:
|
|
1058
|
-
sort:
|
|
1059
|
-
filterable:
|
|
1060
|
-
filter:
|
|
1061
|
-
onFilterChange:
|
|
1062
|
-
pageable:
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
buttonCount:
|
|
1066
|
-
responsive:
|
|
1067
|
-
info:
|
|
1068
|
-
type:
|
|
1069
|
-
pageSizes:
|
|
1060
|
+
onSortChange: i.func,
|
|
1061
|
+
sort: i.array,
|
|
1062
|
+
filterable: i.bool,
|
|
1063
|
+
filter: i.any,
|
|
1064
|
+
onFilterChange: i.func,
|
|
1065
|
+
pageable: i.oneOfType([
|
|
1066
|
+
i.bool,
|
|
1067
|
+
i.shape({
|
|
1068
|
+
buttonCount: i.number,
|
|
1069
|
+
responsive: i.bool,
|
|
1070
|
+
info: i.bool,
|
|
1071
|
+
type: i.oneOf(["numeric", "input"]),
|
|
1072
|
+
pageSizes: i.oneOfType(
|
|
1070
1073
|
[
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1074
|
+
i.bool,
|
|
1075
|
+
i.arrayOf(i.oneOfType([
|
|
1076
|
+
i.string,
|
|
1077
|
+
i.number
|
|
1075
1078
|
]))
|
|
1076
1079
|
]
|
|
1077
1080
|
),
|
|
1078
|
-
previousNext:
|
|
1081
|
+
previousNext: i.bool
|
|
1079
1082
|
})
|
|
1080
1083
|
]),
|
|
1081
|
-
pageSize:
|
|
1082
|
-
onPageChange:
|
|
1083
|
-
total:
|
|
1084
|
-
skip:
|
|
1085
|
-
take:
|
|
1086
|
-
fixedScroll:
|
|
1087
|
-
onExpandChange:
|
|
1088
|
-
expandField:
|
|
1089
|
-
selectedField:
|
|
1090
|
-
onSelectionChange:
|
|
1091
|
-
onHeaderSelectionChange:
|
|
1092
|
-
resizable:
|
|
1093
|
-
reorderable:
|
|
1094
|
-
group:
|
|
1095
|
-
groupable:
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
enabled:
|
|
1099
|
-
footer:
|
|
1084
|
+
pageSize: i.number,
|
|
1085
|
+
onPageChange: i.func,
|
|
1086
|
+
total: i.number,
|
|
1087
|
+
skip: i.number,
|
|
1088
|
+
take: i.number,
|
|
1089
|
+
fixedScroll: i.bool,
|
|
1090
|
+
onExpandChange: i.func,
|
|
1091
|
+
expandField: i.string,
|
|
1092
|
+
selectedField: i.string,
|
|
1093
|
+
onSelectionChange: i.func,
|
|
1094
|
+
onHeaderSelectionChange: i.func,
|
|
1095
|
+
resizable: i.bool,
|
|
1096
|
+
reorderable: i.bool,
|
|
1097
|
+
group: i.any,
|
|
1098
|
+
groupable: i.oneOfType([
|
|
1099
|
+
i.bool,
|
|
1100
|
+
i.shape({
|
|
1101
|
+
enabled: i.bool,
|
|
1102
|
+
footer: i.oneOf(["always", "visible", "none"])
|
|
1100
1103
|
})
|
|
1101
1104
|
]),
|
|
1102
|
-
onGroupChange:
|
|
1103
|
-
onRowClick:
|
|
1104
|
-
onRowDoubleClick:
|
|
1105
|
-
onItemChange:
|
|
1106
|
-
editField:
|
|
1107
|
-
scrollable:
|
|
1108
|
-
rowHeight:
|
|
1109
|
-
detailRowHeight:
|
|
1110
|
-
detail:
|
|
1111
|
-
style:
|
|
1112
|
-
onDataStateChange:
|
|
1113
|
-
onColumnResize:
|
|
1114
|
-
onColumnReorder:
|
|
1115
|
-
dataItemKey:
|
|
1116
|
-
navigatable:
|
|
1117
|
-
size:
|
|
1105
|
+
onGroupChange: i.func,
|
|
1106
|
+
onRowClick: i.func,
|
|
1107
|
+
onRowDoubleClick: i.func,
|
|
1108
|
+
onItemChange: i.func,
|
|
1109
|
+
editField: i.string,
|
|
1110
|
+
scrollable: i.oneOf(["none", "scrollable", "virtual"]),
|
|
1111
|
+
rowHeight: i.number,
|
|
1112
|
+
detailRowHeight: i.number,
|
|
1113
|
+
detail: i.any,
|
|
1114
|
+
style: i.object,
|
|
1115
|
+
onDataStateChange: i.func,
|
|
1116
|
+
onColumnResize: i.func,
|
|
1117
|
+
onColumnReorder: i.func,
|
|
1118
|
+
dataItemKey: i.string,
|
|
1119
|
+
navigatable: i.bool,
|
|
1120
|
+
size: i.oneOf(["small", "medium"])
|
|
1118
1121
|
}, _.contextType = U;
|
|
1119
1122
|
let B = _;
|
|
1120
|
-
|
|
1123
|
+
at(B);
|
|
1121
1124
|
export {
|
|
1122
1125
|
B as Grid
|
|
1123
1126
|
};
|