@progress/kendo-react-grid 8.2.0-develop.3 → 8.2.0-develop.30
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 +228 -219
- package/cells/GridEditCell.js +1 -1
- package/cells/GridEditCell.mjs +27 -27
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/footer/Footer.js +1 -1
- package/footer/Footer.mjs +7 -7
- package/header/FilterRow.js +1 -1
- package/header/FilterRow.mjs +1 -1
- package/header/Header.js +1 -1
- package/header/Header.mjs +1 -1
- package/index.d.mts +25 -9
- package/index.d.ts +25 -9
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/utils/index.js +1 -1
- package/utils/index.mjs +82 -82
package/Grid.mjs
CHANGED
|
@@ -8,38 +8,38 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as r from "react";
|
|
10
10
|
import o from "prop-types";
|
|
11
|
-
import { RowHeightService as re, dispatchEvent as Ge, canUseDOM as
|
|
12
|
-
import {
|
|
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
|
|
11
|
+
import { RowHeightService as re, getScrollbarWidth as Pe, dispatchEvent as Ge, canUseDOM as N, getActiveElement as Ke, memoizeOne as E, validatePackage as We, shouldShowValidationUI as Be, setScrollbarWidth as ae, getter as Ve, classNames as L, kendoThemeMaps as G, WatermarkOverlay as Ue } from "@progress/kendo-react-common";
|
|
12
|
+
import { tableKeyboardNavigation as _, getSelectionOptions as le, mapColumns as $e, ClipboardService as je, TableKeyboardNavigationContext as B, isRtl as qe, tableKeyboardNavigationTools as x, tableColumnsVirtualization as Je, Pager as Xe, tableKeyboardNavigationScopeAttributes as ne, TableSelection as he, tableKeyboardNavigationBodyAttributes as pe, DropClue as de, DragClue as ce, updateLeft as Ye, updateRight as Qe, KEYBOARD_NAV_DATA_ID as Ze } from "@progress/kendo-react-data-tools";
|
|
13
|
+
import { GridSelectionCell as et } from "./cells/GridSelectionCell.mjs";
|
|
14
|
+
import { GridHierarchyCell as tt } from "./cells/GridHierarchyCell.mjs";
|
|
15
|
+
import { GridEditCell as st } from "./cells/GridEditCell.mjs";
|
|
16
|
+
import { Header as it } from "./header/Header.mjs";
|
|
17
|
+
import { HeaderRow as ot } from "./header/HeaderRow.mjs";
|
|
18
|
+
import { FilterRow as rt } from "./header/FilterRow.mjs";
|
|
19
|
+
import { GroupPanel as at } from "./header/GroupPanel.mjs";
|
|
20
|
+
import { Footer as lt } from "./footer/Footer.mjs";
|
|
21
|
+
import { provideLocalizationService as nt, registerForLocalization as ht } from "@progress/kendo-react-intl";
|
|
22
|
+
import { pagerMessagesMap as pt, gridAriaLabel as ue, messages as dt } from "./messages/index.mjs";
|
|
23
|
+
import { VirtualScroll as ct } from "./VirtualScroll.mjs";
|
|
24
24
|
import { VirtualScrollFixed as ge } from "./VirtualScrollFixed.mjs";
|
|
25
|
-
import { ColumnResize as
|
|
26
|
-
import { CommonDragLogic as
|
|
27
|
-
import { firefox as me, firefoxMaxHeight as fe, flatData as
|
|
28
|
-
import { GridCell as
|
|
29
|
-
import { GridGroupCell as
|
|
30
|
-
import { GridRow as
|
|
25
|
+
import { ColumnResize as ut } from "./drag/ColumnResize.mjs";
|
|
26
|
+
import { CommonDragLogic as gt } from "./drag/CommonDragLogic.mjs";
|
|
27
|
+
import { firefox as me, firefoxMaxHeight as fe, flatData as mt, readColumns as ft, sanitizeColumns as bt, getColumnWidth as V, autoGenerateColumns as vt, getNestedValue as be, resolveCells as Ct } from "./utils/index.mjs";
|
|
28
|
+
import { GridCell as Rt } from "./cells/GridCell.mjs";
|
|
29
|
+
import { GridGroupCell as ve } from "./cells/GridGroupCell.mjs";
|
|
30
|
+
import { GridRow as wt } from "./rows/GridRow.mjs";
|
|
31
31
|
import { GridHeaderSelectionCell as yt } from "./header/GridHeaderSelectionCell.mjs";
|
|
32
|
-
import { GridNoRecords as
|
|
32
|
+
import { GridNoRecords as Et } from "./GridNoRecords.mjs";
|
|
33
33
|
import { operators as Ce } from "./filterCommon.mjs";
|
|
34
34
|
import { FooterRow as St } from "./footer/FooterRow.mjs";
|
|
35
35
|
import { normalize as It } from "./paging/GridPagerSettings.mjs";
|
|
36
36
|
import { packageMetadata as Re } from "./package-metadata.mjs";
|
|
37
37
|
import { GridDetailCell as kt } from "./cells/GridDetailCell.mjs";
|
|
38
|
-
import { GridDetailHierarchyCell as
|
|
38
|
+
import { GridDetailHierarchyCell as _t } from "./cells/GridDetailHierarchyCell.mjs";
|
|
39
39
|
import { SAFARI_REGEX as xt } from "./constants/index.mjs";
|
|
40
40
|
const z = class z extends r.Component {
|
|
41
41
|
constructor(a) {
|
|
42
|
-
super(a), this._columns = [], this._columnsMap = [[]], this._columnsMutations = 0, this._resized = !1, this._focusFirst = !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
|
+
super(a), this._columns = [], this._columnsMap = [[]], this._columnsMutations = 0, this._resized = !1, this._focusFirst = !1, this._singleEditRow = !1, this._shouldUpdateLeftRight = !0, this._scrollbarWidth = void 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.rowsInEdit = [], this.observer = null, this.handleIntersection = (e) => {
|
|
43
43
|
const t = { rowIndex: this.rowIndex };
|
|
44
44
|
e.forEach((s) => {
|
|
45
45
|
s.isIntersecting || this.setCurrentOnTop(t);
|
|
@@ -68,8 +68,8 @@ const z = class z extends r.Component {
|
|
|
68
68
|
}, this.fitColumns = (e) => {
|
|
69
69
|
this.columnResize.dblClickHandler(null, e);
|
|
70
70
|
}, this.getColumnsEssentialProps = (e) => JSON.stringify(e.map((t) => ({ id: t.id, field: t.field, title: t.title, children: t.children }))), this.checkMatchMediaColumnsDifferece = () => {
|
|
71
|
-
const e = this.childrenToArray(this.props.children)
|
|
72
|
-
return this.getColumnsEssentialProps(
|
|
71
|
+
const e = this.childrenToArray(this.props.children);
|
|
72
|
+
return this.getColumnsEssentialProps(e) === this.getColumnsEssentialProps(this._columns);
|
|
73
73
|
}, this.onContextMenu = (e, t, s) => {
|
|
74
74
|
if (this.props.onContextMenu) {
|
|
75
75
|
const l = {
|
|
@@ -82,8 +82,8 @@ const z = class z extends r.Component {
|
|
|
82
82
|
this.props.onContextMenu.call(void 0, l);
|
|
83
83
|
}
|
|
84
84
|
}, this.getVirtualScroll = (e) => {
|
|
85
|
-
const { rowHeight: t, detailRowHeight: s, detail: l, expandField:
|
|
86
|
-
return !f ||
|
|
85
|
+
const { rowHeight: t, detailRowHeight: s, detail: l, expandField: h, groupable: n } = e, d = this.isAllData(), f = t !== void 0 && t > 0, R = s !== void 0 && s > 0, I = n === !0 || typeof n == "object" && n.enabled !== !1;
|
|
86
|
+
return !f || I && !d || !!(l && h) && (!R || !d) ? ct : ge;
|
|
87
87
|
}, this.isAllData = () => {
|
|
88
88
|
const { data: e, total: t } = this.props;
|
|
89
89
|
return Array.isArray(e) ? e.length === t : e ? t === e.total : !1;
|
|
@@ -101,13 +101,13 @@ const z = class z extends r.Component {
|
|
|
101
101
|
} else
|
|
102
102
|
this.vs.containerHeight = 1533915;
|
|
103
103
|
if (this.vs.containerRef = this.containerRef, this.vs.tableBodyRef = this.tableBodyRef, this.vs.table = this.tableElement, this._slicedData = void 0, this.vs instanceof ge) {
|
|
104
|
-
const { rowHeight: s = 0, detail: l, expandField:
|
|
104
|
+
const { rowHeight: s = 0, detail: l, expandField: h } = this.props;
|
|
105
105
|
let { detailRowHeight: n = 0 } = this.props;
|
|
106
|
-
n = l &&
|
|
106
|
+
n = l && h ? n : 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(this.vs, this._data.length, s, n, this._data)) : this.vs.rowHeightService = new re(e, s, n);
|
|
107
107
|
const d = this.vs.rowHeightService.totalHeight();
|
|
108
108
|
this.vs.containerHeight = me ? Math.min(fe, d) : d;
|
|
109
109
|
}
|
|
110
|
-
}, this.scrollHandler = (e) => {
|
|
110
|
+
}, this.getCachedScrollbarWidth = () => (this._scrollbarWidth || (this._scrollbarWidth = Pe() || void 0), this._scrollbarWidth), this.scrollHandler = (e) => {
|
|
111
111
|
if (e.target !== e.currentTarget)
|
|
112
112
|
return;
|
|
113
113
|
clearTimeout(this.forceUpdateTimeout), this.vs.table = this.tableElement;
|
|
@@ -117,9 +117,11 @@ const z = class z extends r.Component {
|
|
|
117
117
|
}, 0)), this._header && this._header.setScrollLeft(t), this._footer && this._footer.setScrollLeft(t), this.vs && s !== this.wrapperScrollTop && this.vs.scrollHandler(e), Ge(this.props.onScroll, e, this, void 0), this.wrapperScrollTop = s;
|
|
118
118
|
}, this.onKeyDown = (e) => {
|
|
119
119
|
if (_.onKeyDown(e, {
|
|
120
|
+
navigatable: this.props.navigatable || !1,
|
|
120
121
|
contextStateRef: this.contextStateRef,
|
|
121
122
|
navigationStateRef: this.navigationStateRef,
|
|
122
|
-
onNavigationAction: this.onNavigationAction
|
|
123
|
+
onNavigationAction: this.onNavigationAction,
|
|
124
|
+
columns: this.columns
|
|
123
125
|
}), this.props.onKeyDown) {
|
|
124
126
|
const { mode: t, cell: s } = le(this.props.selectable), l = {
|
|
125
127
|
dataItems: this.getLeafDataItems(),
|
|
@@ -133,6 +135,7 @@ const z = class z extends r.Component {
|
|
|
133
135
|
}
|
|
134
136
|
}, this.onFocus = (e) => {
|
|
135
137
|
_.onFocus(e, {
|
|
138
|
+
navigatable: !!this.props.navigatable,
|
|
136
139
|
contextStateRef: this.contextStateRef
|
|
137
140
|
});
|
|
138
141
|
}, this.onNavigationAction = (e) => {
|
|
@@ -275,12 +278,12 @@ const z = class z extends r.Component {
|
|
|
275
278
|
);
|
|
276
279
|
}
|
|
277
280
|
}, this.inActiveElement = () => {
|
|
278
|
-
var
|
|
279
|
-
if (!
|
|
281
|
+
var h, n, d;
|
|
282
|
+
if (!N)
|
|
280
283
|
return !1;
|
|
281
|
-
const e =
|
|
284
|
+
const e = Ke(this.document), t = e ? e.matches(".k-table-td") ? e : (h = this.document) == null ? void 0 : h.body : (n = this.document) == null ? void 0 : n.body, s = t.closest(".k-grid-container"), l = t && ((d = this._element) == null ? void 0 : d.contains(t));
|
|
282
285
|
return !!(t && l && s);
|
|
283
|
-
}, this.onResize = (e, t, s, l,
|
|
286
|
+
}, this.onResize = (e, t, s, l, h, n) => {
|
|
284
287
|
this.resetTableWidth(), this._shouldUpdateLeftRight = !0, this._resized = !0, this._columnsMutations++, this.props.onColumnResize && this.props.onColumnResize.call(
|
|
285
288
|
void 0,
|
|
286
289
|
{
|
|
@@ -290,46 +293,34 @@ const z = class z extends r.Component {
|
|
|
290
293
|
index: e,
|
|
291
294
|
newWidth: t,
|
|
292
295
|
oldWidth: s,
|
|
293
|
-
end:
|
|
296
|
+
end: h,
|
|
294
297
|
target: this
|
|
295
298
|
}
|
|
296
299
|
);
|
|
297
|
-
}, this.reInitVirtualization =
|
|
300
|
+
}, this.reInitVirtualization = E((e, t, s, l, h, n) => {
|
|
298
301
|
this.vs.reset();
|
|
299
302
|
const d = this.getVirtualScroll(this.props);
|
|
300
303
|
this.vs = new d(n);
|
|
301
|
-
}), this.flatData =
|
|
302
|
-
const f = [], R =
|
|
304
|
+
}), this.flatData = E((e, t, s, l, h, n, d) => {
|
|
305
|
+
const f = [], R = mt(
|
|
303
306
|
f,
|
|
304
307
|
e,
|
|
305
308
|
t,
|
|
306
309
|
{ index: s },
|
|
307
310
|
l !== void 0,
|
|
308
|
-
|
|
311
|
+
h
|
|
309
312
|
);
|
|
310
313
|
return { flattedData: f, resolvedGroupsCount: R };
|
|
311
|
-
}), this.rowHeightService =
|
|
314
|
+
}), this.rowHeightService = E((e, t, s, l, h) => new re(t, s, l, h)), this.childrenToArray = E((e) => r.Children.toArray(e)), this.readColumns = E(
|
|
312
315
|
(e, t, s) => {
|
|
313
|
-
const l = e.filter((
|
|
314
|
-
return
|
|
316
|
+
const l = e.filter((h) => h && h.type && h.type.displayName === "KendoReactGridColumn");
|
|
317
|
+
return ft(l, this.columns, { prevId: 0, idPrefix: t });
|
|
315
318
|
}
|
|
316
|
-
), this.mapColumns =
|
|
317
|
-
(e, t) =>
|
|
318
|
-
), this.
|
|
319
|
-
const t = (s) => {
|
|
320
|
-
const l = s;
|
|
321
|
-
return {
|
|
322
|
-
...l,
|
|
323
|
-
props: {
|
|
324
|
-
...l.props,
|
|
325
|
-
children: l.props.children && l.props.children.length > 0 ? this.filterHiddenColumns(l.props.children) : l.props.children
|
|
326
|
-
}
|
|
327
|
-
};
|
|
328
|
-
};
|
|
329
|
-
return [...e].filter((s) => r.isValidElement(s) && !s.props.hidden).filter((s) => L && s && r.isValidElement(s) && s.props.media ? window.matchMedia(s.props.media).matches : s).map((s) => t(s));
|
|
330
|
-
}, this.configureColumns = S((e, t, s) => {
|
|
319
|
+
), this.mapColumns = E(
|
|
320
|
+
(e, t) => $e(e, !0)
|
|
321
|
+
), this.filterColumnsByMediaProp = (e) => e.filter((t) => N && t && t.media ? window.matchMedia(t.media).matches : t), this.configureColumns = E((e, t, s) => {
|
|
331
322
|
this.props.selectedField && e.filter((n) => n.field === this.props.selectedField).forEach((n) => {
|
|
332
|
-
n.width = n.width || "50px", n.cell = n.cell ||
|
|
323
|
+
n.width = n.width || "50px", n.cell = n.cell || et, n.headerCell = n.headerCell || yt;
|
|
333
324
|
});
|
|
334
325
|
const l = {
|
|
335
326
|
id: "",
|
|
@@ -350,24 +341,24 @@ const z = class z extends r.Component {
|
|
|
350
341
|
ariaColumnIndex: 0,
|
|
351
342
|
isAccessible: !0
|
|
352
343
|
};
|
|
353
|
-
let
|
|
344
|
+
let h = 0;
|
|
354
345
|
this.props.expandField && this.props.onExpandChange && this.props.detail && (e.unshift({
|
|
355
346
|
...l,
|
|
356
|
-
cell:
|
|
347
|
+
cell: tt,
|
|
357
348
|
field: this.props.expandField,
|
|
358
349
|
headerClassName: "k-hierarchy-cell k-header"
|
|
359
|
-
}),
|
|
350
|
+
}), h++);
|
|
360
351
|
for (let n = 0; n < t; n++)
|
|
361
352
|
e.unshift({
|
|
362
353
|
...l,
|
|
363
354
|
isAccessible: !1,
|
|
364
|
-
cell:
|
|
355
|
+
cell: ve,
|
|
365
356
|
field: "value",
|
|
366
357
|
locked: this.props.lockGroups
|
|
367
|
-
}),
|
|
368
|
-
e.slice(
|
|
369
|
-
}), this.getHeaderRow =
|
|
370
|
-
|
|
358
|
+
}), h++;
|
|
359
|
+
e.slice(h).forEach((n) => n.parentIndex >= 0 && (n.parentIndex += h));
|
|
360
|
+
}), this.getHeaderRow = E((e, t, s, l, h, n, d, f, R, I, T, C, M) => /* @__PURE__ */ r.createElement(
|
|
361
|
+
ot,
|
|
371
362
|
{
|
|
372
363
|
cells: this.props.cells,
|
|
373
364
|
sort: e,
|
|
@@ -376,37 +367,44 @@ const z = class z extends r.Component {
|
|
|
376
367
|
group: s || [],
|
|
377
368
|
groupable: l,
|
|
378
369
|
groupChange: this.groupChange,
|
|
379
|
-
filter:
|
|
370
|
+
filter: h,
|
|
380
371
|
filterable: n,
|
|
381
372
|
filterOperators: d,
|
|
382
373
|
filterChange: this.filterChange,
|
|
383
374
|
columnMenu: R,
|
|
384
|
-
columnMenuIcon:
|
|
375
|
+
columnMenuIcon: I,
|
|
385
376
|
selectionChange: this.onHeaderSelectionChange,
|
|
386
|
-
columns:
|
|
377
|
+
columns: T,
|
|
387
378
|
columnResize: this.columnResize,
|
|
388
379
|
pressHandler: this.dragLogic.pressHandler,
|
|
389
380
|
dragHandler: this.dragLogic.dragHandler,
|
|
390
381
|
releaseHandler: this.dragLogic.releaseHandler,
|
|
391
382
|
columnsMap: C,
|
|
392
383
|
cellRender: f,
|
|
393
|
-
isRtl:
|
|
384
|
+
isRtl: M,
|
|
394
385
|
dragClue: this.dragLogic.dragClueRef,
|
|
395
386
|
headerRef: this.headerElementRef,
|
|
396
387
|
containerRef: this.containerRef,
|
|
397
|
-
navigatable: this.props.navigatable,
|
|
388
|
+
navigatable: !!this.props.navigatable,
|
|
398
389
|
columnGroupChange: this.columnGroupChange
|
|
399
390
|
}
|
|
400
391
|
)), this.resolveTitle = (e) => {
|
|
401
392
|
const t = this._columns.find((l) => l.field === e), s = t && (t.title || t.field);
|
|
402
393
|
return s === void 0 ? e : s;
|
|
403
|
-
}, this.getLeafDataItems = () => this._data.filter((e) => e.rowType === "data").map((e) => e.dataItem), this.getSlicedLeafDataItems = () => (this._slicedData || this._data).filter((e) => e.rowType === "data").map((e) => e.dataItem),
|
|
404
|
-
|
|
405
|
-
|
|
394
|
+
}, this.getLeafDataItems = () => this._data.filter((e) => e.rowType === "data").map((e) => e.dataItem), this.getSlicedLeafDataItems = () => (this._slicedData || this._data).filter((e) => e.rowType === "data").map((e) => e.dataItem), this.handleFocusInEditableRows = () => {
|
|
395
|
+
var e, t, s;
|
|
396
|
+
if (this.tableBodyRef.current && ((e = this.tableBodyRef.current) == null ? void 0 : e.getElementsByClassName("k-grid-edit-row").length) > 0) {
|
|
397
|
+
this._singleEditRow = !1, (t = document.activeElement) != null && t.closest(".k-grid-edit-row") ? this._lastActiveElement = document.activeElement : this._lastActiveElement = void 0;
|
|
398
|
+
const l = Array.from((s = this.tableBodyRef.current) == null ? void 0 : s.getElementsByClassName("k-grid-edit-row"));
|
|
399
|
+
l.length > this.rowsInEdit.length ? this._newEditableRow = l.filter((h) => !this.rowsInEdit.includes(h))[0] : l.length === 1 && (this._newEditableRow = l[0], this._singleEditRow = !0), this.rowsInEdit = l;
|
|
400
|
+
}
|
|
401
|
+
}, We(Re), this.showLicenseWatermark = Be(Re);
|
|
402
|
+
const p = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1, c = this.getVirtualScroll(a);
|
|
403
|
+
this.vs = new c(p || a.rowHeight === void 0 || a.rowHeight === 0), this.dragLogic = new gt(
|
|
406
404
|
this.columnReorder.bind(this),
|
|
407
405
|
this.groupReorder.bind(this),
|
|
408
406
|
this.columnToGroup.bind(this)
|
|
409
|
-
), this.columnGroupChange = this.columnGroupChange.bind(this), this.columnResize = new
|
|
407
|
+
), this.columnGroupChange = this.columnGroupChange.bind(this), this.columnResize = new ut(this.onResize), this.props.clipboard && (this.clipboardService = new je(this.onClipboard)), _.onConstructor({
|
|
410
408
|
navigatable: !!a.navigatable,
|
|
411
409
|
contextStateRef: this.contextStateRef,
|
|
412
410
|
navigationStateRef: this.navigationStateRef,
|
|
@@ -454,8 +452,8 @@ const z = class z extends r.Component {
|
|
|
454
452
|
*/
|
|
455
453
|
// tslint:enable:max-line-length
|
|
456
454
|
get columns() {
|
|
457
|
-
const a = this._columns.filter((
|
|
458
|
-
return
|
|
455
|
+
const a = this._columns.filter((p) => p.declarationIndex >= 0 && p.parentIndex === -1);
|
|
456
|
+
return bt(a);
|
|
459
457
|
}
|
|
460
458
|
/**
|
|
461
459
|
* Returns the HTML element of the Grid component.
|
|
@@ -464,7 +462,7 @@ const z = class z extends r.Component {
|
|
|
464
462
|
return this._element;
|
|
465
463
|
}
|
|
466
464
|
get document() {
|
|
467
|
-
if (
|
|
465
|
+
if (N)
|
|
468
466
|
return this.element && this.element.ownerDocument || document;
|
|
469
467
|
}
|
|
470
468
|
get _header() {
|
|
@@ -478,18 +476,18 @@ const z = class z extends r.Component {
|
|
|
478
476
|
*/
|
|
479
477
|
componentDidMount() {
|
|
480
478
|
var c;
|
|
481
|
-
this.props.columnVirtualization && !navigator.userAgent.match(xt) && (this.headTable && (this.headTable.style.display = "block"), this.tableElement && (this.tableElement.style.display = "block")), this.resetTableWidth(), ae();
|
|
482
|
-
const a =
|
|
479
|
+
this.props.columnVirtualization && !navigator.userAgent.match(xt) && (this.headTable && (this.headTable.style.display = "block"), this.tableElement && (this.tableElement.style.display = "block")), this.resetTableWidth(), ae(this.getCachedScrollbarWidth());
|
|
480
|
+
const a = qe(this.element);
|
|
483
481
|
this.isRtl = a, _.onComponentDidMount({
|
|
484
482
|
scope: this.element || void 0,
|
|
485
483
|
contextStateRef: this.contextStateRef,
|
|
486
484
|
navigationStateRef: this.navigationStateRef
|
|
487
485
|
}), this.isRtl && this.forceUpdate();
|
|
488
|
-
const
|
|
486
|
+
const p = {
|
|
489
487
|
rootMargin: "0px",
|
|
490
488
|
threshold: 0.9
|
|
491
489
|
};
|
|
492
|
-
this.clipboardService && this.clipboardService.addEventListeners(this.document), this.observer =
|
|
490
|
+
this.clipboardService && this.clipboardService.addEventListeners(this.document), this.observer = N && window.IntersectionObserver && new window.IntersectionObserver(this.handleIntersection, p) || null, this.resizeObserver = N && window.ResizeObserver && new window.ResizeObserver(this.calculateMedia.bind(this)), (c = this.document) != null && c.body && this.resizeObserver && this.resizeObserver.observe(this.document.body);
|
|
493
491
|
}
|
|
494
492
|
/**
|
|
495
493
|
* @hidden
|
|
@@ -505,12 +503,16 @@ const z = class z extends r.Component {
|
|
|
505
503
|
* @hidden
|
|
506
504
|
*/
|
|
507
505
|
componentDidUpdate() {
|
|
508
|
-
this.resetTableWidth(), ae(), this.vs.tableTransform && this.vs.table && (this.vs.table.style.transform = this.vs.tableTransform, this.vs.tableTransform = ""), _.onComponentDidUpdate({
|
|
506
|
+
this.resetTableWidth(), ae(this.getCachedScrollbarWidth()), this.vs.tableTransform && this.vs.table && (this.vs.table.style.transform = this.vs.tableTransform, this.vs.tableTransform = ""), this.handleFocusInEditableRows(), _.onComponentDidUpdate({
|
|
509
507
|
scope: this.element || void 0,
|
|
510
508
|
contextStateRef: this.contextStateRef,
|
|
511
509
|
navigationStateRef: this.navigationStateRef,
|
|
512
|
-
focusFirst: this._focusFirst
|
|
513
|
-
|
|
510
|
+
focusFirst: this._focusFirst,
|
|
511
|
+
newEditableRow: this._newEditableRow,
|
|
512
|
+
singleEditRow: this._singleEditRow,
|
|
513
|
+
lastActiveElement: this._lastActiveElement,
|
|
514
|
+
navigatable: this.props.navigatable
|
|
515
|
+
}), this._focusFirst = !1, this._newEditableRow = void 0;
|
|
514
516
|
}
|
|
515
517
|
/**
|
|
516
518
|
* @hidden
|
|
@@ -525,10 +527,10 @@ const z = class z extends r.Component {
|
|
|
525
527
|
render() {
|
|
526
528
|
var ie;
|
|
527
529
|
let a = this.props.total || 0;
|
|
528
|
-
const
|
|
530
|
+
const p = x.getIdPrefix(this.navigationStateRef), c = nt(this);
|
|
529
531
|
let e = [];
|
|
530
532
|
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);
|
|
531
|
-
const t = typeof this.props.groupable == "object" && this.props.groupable.footer || "none", s = this.props.scrollable === "virtual", { resolvedGroupsCount: l, flattedData:
|
|
533
|
+
const t = typeof this.props.groupable == "object" && this.props.groupable.footer || "none", s = this.props.scrollable === "virtual", { resolvedGroupsCount: l, flattedData: h } = this.flatData(
|
|
532
534
|
e,
|
|
533
535
|
t,
|
|
534
536
|
this.props.skip || 0,
|
|
@@ -537,15 +539,15 @@ const z = class z extends r.Component {
|
|
|
537
539
|
this.props.filter,
|
|
538
540
|
this.props.sort
|
|
539
541
|
);
|
|
540
|
-
this._data =
|
|
542
|
+
this._data = h;
|
|
541
543
|
const n = this.props.groupable === !0 || typeof this.props.groupable == "object" && this.props.groupable.enabled !== !1;
|
|
542
544
|
this.columnResize.resizable = this.props.resizable || !1, this.dragLogic.reorderable = this.props.reorderable || !1, this.dragLogic.groupable = n;
|
|
543
545
|
const d = this.props.selectable && this.props.selectable.drag ? "none" : void 0;
|
|
544
546
|
this.initializeVirtualization(a, n);
|
|
545
547
|
const f = this.childrenToArray(this.props.children);
|
|
546
548
|
this.initColumns(f, l);
|
|
547
|
-
const R = f.map((i) => i && i.type && i.type.displayName === "KendoReactGridToolbar" ? r.cloneElement(i, { ...i.props, ariaControls: this._gridId }) : null),
|
|
548
|
-
|
|
549
|
+
const R = f.map((i) => i && i.type && i.type.displayName === "KendoReactGridToolbar" ? r.cloneElement(i, { ...i.props, ariaControls: this._gridId }) : null), I = f.filter((i) => i && i.type && i.type.displayName === "KendoReactGridNoRecords"), T = f.filter((i) => i && i.type && i.type.displayName === "KendoReactGridStatusBar"), C = this._columns.filter((i) => i.children.length === 0), M = n && /* @__PURE__ */ r.createElement(
|
|
550
|
+
at,
|
|
549
551
|
{
|
|
550
552
|
group: this.props.group || [],
|
|
551
553
|
groupChange: this.groupChange,
|
|
@@ -557,33 +559,34 @@ const z = class z extends r.Component {
|
|
|
557
559
|
ariaControls: this._gridId,
|
|
558
560
|
onContextMenu: this.onContextMenu
|
|
559
561
|
}
|
|
560
|
-
), { sort:
|
|
561
|
-
|
|
562
|
+
), { sort: we, sortable: ye, group: Ee, filter: Se, filterable: Ie, filterOperators: ke = Ce, headerCellRender: _e, columnMenu: xe, columnMenuIcon: ze } = this.props, $ = /* @__PURE__ */ r.createElement(
|
|
563
|
+
it,
|
|
562
564
|
{
|
|
563
565
|
size: this.props.size,
|
|
564
566
|
columnResize: this.columnResize,
|
|
565
567
|
staticHeaders: this.props.scrollable !== "none",
|
|
566
568
|
scrollableDataElement: () => this.vs.container,
|
|
569
|
+
hasScrollbarWidth: !!this.getCachedScrollbarWidth(),
|
|
567
570
|
draggable: this.props.reorderable || n,
|
|
568
571
|
ref: this.headerRef,
|
|
569
572
|
elemRef: this.headerElementRef,
|
|
570
573
|
headerRow: this.getHeaderRow(
|
|
571
|
-
ye,
|
|
572
574
|
we,
|
|
573
|
-
|
|
575
|
+
ye,
|
|
576
|
+
Ee,
|
|
574
577
|
n,
|
|
578
|
+
Se,
|
|
575
579
|
Ie,
|
|
576
580
|
ke,
|
|
577
|
-
Ee,
|
|
578
|
-
xe,
|
|
579
581
|
_e,
|
|
582
|
+
xe,
|
|
580
583
|
ze,
|
|
581
584
|
this._columns,
|
|
582
585
|
this._columnsMap,
|
|
583
586
|
this.isRtl
|
|
584
587
|
),
|
|
585
588
|
filterRow: this.props.filterable && /* @__PURE__ */ r.createElement(
|
|
586
|
-
|
|
589
|
+
rt,
|
|
587
590
|
{
|
|
588
591
|
cells: this.props.cells,
|
|
589
592
|
size: this.props.size,
|
|
@@ -594,6 +597,7 @@ const z = class z extends r.Component {
|
|
|
594
597
|
sort: this.props.sort,
|
|
595
598
|
cellRender: this.props.filterCellRender,
|
|
596
599
|
isRtl: this.isRtl,
|
|
600
|
+
navigatable: !!this.props.navigatable,
|
|
597
601
|
ariaRowIndex: this._columnsMap.length + 1
|
|
598
602
|
}
|
|
599
603
|
) || void 0,
|
|
@@ -601,66 +605,66 @@ const z = class z extends r.Component {
|
|
|
601
605
|
"col",
|
|
602
606
|
{
|
|
603
607
|
key: g.toString(),
|
|
604
|
-
width:
|
|
608
|
+
width: V(i)
|
|
605
609
|
}
|
|
606
610
|
))
|
|
607
611
|
}
|
|
608
|
-
),
|
|
612
|
+
), Te = this.vs && this.vs.container && this.vs.container.scrollLeft || 0, De = parseFloat(((this.props.style || {}).width || "").toString()), { colSpans: He, hiddenColumns: Ae } = Je({
|
|
609
613
|
enabled: this.props.columnVirtualization,
|
|
610
614
|
columns: C,
|
|
611
|
-
tableViewPortWidth:
|
|
612
|
-
scrollLeft:
|
|
613
|
-
}),
|
|
614
|
-
let
|
|
615
|
-
const
|
|
615
|
+
tableViewPortWidth: De,
|
|
616
|
+
scrollLeft: Te
|
|
617
|
+
}), Fe = (i, g, m) => {
|
|
618
|
+
let k = !1;
|
|
619
|
+
const S = this.props.selectedField ? be(this.props.selectedField, i.dataItem) : void 0;
|
|
616
620
|
return {
|
|
617
|
-
row: C.map((u,
|
|
618
|
-
if (
|
|
621
|
+
row: C.map((u, b) => {
|
|
622
|
+
if (Ae[b])
|
|
619
623
|
return null;
|
|
620
|
-
const H = u.id ? u.id :
|
|
621
|
-
let
|
|
624
|
+
const H = u.id ? u.id : b, A = `${u.className ? u.className + " " : ""}${u.locked ? "k-grid-content-sticky" : ""}`, w = u.left !== void 0 ? this.isRtl ? { left: u.right, right: u.left } : { left: u.left, right: u.right } : {};
|
|
625
|
+
let y = !1;
|
|
622
626
|
if (u.editable && this.props.editField) {
|
|
623
|
-
const
|
|
624
|
-
|
|
627
|
+
const v = be(this.props.editField, i.dataItem);
|
|
628
|
+
v && (v === !0 || v === u.field) && (k = !0, y = !0);
|
|
625
629
|
}
|
|
626
|
-
const
|
|
630
|
+
const W = u.cell || y && st || Rt, F = this.props.expandField && this.props.detail && u.field === this.props.expandField;
|
|
627
631
|
return /* @__PURE__ */ r.createElement(
|
|
628
|
-
|
|
632
|
+
W,
|
|
629
633
|
{
|
|
630
634
|
onContextMenu: this.onContextMenu,
|
|
631
635
|
key: H,
|
|
632
636
|
locked: this.props.lockGroups,
|
|
633
|
-
id:
|
|
634
|
-
`${g}-${String(
|
|
635
|
-
|
|
636
|
-
|
|
637
|
+
id: x.generateNavigatableId(
|
|
638
|
+
`${g}-${String(b)}`,
|
|
639
|
+
p,
|
|
640
|
+
F || i.rowType === "groupHeader" || i.rowType === "groupFooter" || u.field === "value" ? "nodata" : "cell"
|
|
637
641
|
),
|
|
638
|
-
colSpan: He[
|
|
642
|
+
colSpan: He[b],
|
|
639
643
|
dataItem: i.dataItem,
|
|
640
644
|
field: u.field,
|
|
641
645
|
editor: u.editor,
|
|
642
646
|
format: u.format,
|
|
643
|
-
className:
|
|
647
|
+
className: A,
|
|
644
648
|
render: this.props.cellRender,
|
|
645
|
-
cells:
|
|
649
|
+
cells: Ct(this.props.cells, u.cells),
|
|
646
650
|
onChange: this.itemChange,
|
|
647
|
-
selectionChange: this.props.onSelectionChange ? (
|
|
648
|
-
this.selectionChange({ event:
|
|
651
|
+
selectionChange: this.props.onSelectionChange ? (v) => {
|
|
652
|
+
this.selectionChange({ event: v, dataItem: i.dataItem, dataIndex: m, columnIndex: b });
|
|
649
653
|
} : void 0,
|
|
650
|
-
columnIndex:
|
|
654
|
+
columnIndex: b,
|
|
651
655
|
columnsCount: C.length,
|
|
652
656
|
rowType: i.rowType,
|
|
653
657
|
level: i.level,
|
|
654
658
|
expanded: i.expanded,
|
|
655
659
|
dataIndex: i.dataIndex,
|
|
656
|
-
style:
|
|
660
|
+
style: w,
|
|
657
661
|
ariaColumnIndex: u.ariaColumnIndex,
|
|
658
|
-
isSelected: Array.isArray(
|
|
662
|
+
isSelected: Array.isArray(S) && S.indexOf(b) > -1
|
|
659
663
|
}
|
|
660
664
|
);
|
|
661
665
|
}),
|
|
662
|
-
isInEdit:
|
|
663
|
-
isSelected: typeof
|
|
666
|
+
isInEdit: k,
|
|
667
|
+
isSelected: typeof S == "boolean" && S
|
|
664
668
|
};
|
|
665
669
|
};
|
|
666
670
|
let j = 0;
|
|
@@ -674,62 +678,62 @@ const z = class z extends r.Component {
|
|
|
674
678
|
}
|
|
675
679
|
const q = (i) => i >= this._data.length - j;
|
|
676
680
|
let J = this.vs.realSkip || 0;
|
|
677
|
-
const
|
|
681
|
+
const O = [];
|
|
678
682
|
let K = !1;
|
|
679
683
|
const X = this._columnsMap.length + (this.props.filterable ? 1 : 0) + 1;
|
|
680
|
-
let
|
|
684
|
+
let D = 0;
|
|
681
685
|
if (this._data.length) {
|
|
682
686
|
let i = -1, g = 0;
|
|
683
|
-
(this._slicedData || this._data).forEach((m,
|
|
687
|
+
(this._slicedData || this._data).forEach((m, k) => {
|
|
684
688
|
m.rowType === "data" && (J++, i++);
|
|
685
|
-
const
|
|
686
|
-
if (
|
|
687
|
-
|
|
689
|
+
const S = J % 2 === 0, u = this.props.dataItemKey && Ve(this.props.dataItemKey)(m.dataItem), b = k + (this.vs.realSkip || 0), H = u || "ai" + b, A = H + "_1", w = Fe(m, H, i);
|
|
690
|
+
if (D = b + X + g, O.push(/* @__PURE__ */ r.createElement(
|
|
691
|
+
wt,
|
|
688
692
|
{
|
|
689
693
|
key: H,
|
|
690
694
|
dataItem: m.dataItem,
|
|
691
|
-
isAltRow:
|
|
692
|
-
isInEdit:
|
|
695
|
+
isAltRow: S,
|
|
696
|
+
isInEdit: w.isInEdit,
|
|
693
697
|
rowType: m.rowType,
|
|
694
|
-
isHidden: q(
|
|
695
|
-
onClick: (
|
|
696
|
-
onDoubleClick: (
|
|
698
|
+
isHidden: q(k),
|
|
699
|
+
onClick: (y) => this.rowClick(y, m),
|
|
700
|
+
onDoubleClick: (y) => this.rowDblClick(y, m),
|
|
697
701
|
selectedField: this.props.selectedField,
|
|
698
702
|
rowHeight: this.props.rowHeight,
|
|
699
703
|
render: this.props.rowRender,
|
|
700
|
-
ariaRowIndex:
|
|
701
|
-
absoluteRowIndex:
|
|
702
|
-
dataIndex: this.vs.scrollableVirtual && !this.props.groupable ?
|
|
703
|
-
isSelected:
|
|
704
|
+
ariaRowIndex: D,
|
|
705
|
+
absoluteRowIndex: b,
|
|
706
|
+
dataIndex: this.vs.scrollableVirtual && !this.props.groupable ? b : i,
|
|
707
|
+
isSelected: w.isSelected
|
|
704
708
|
},
|
|
705
|
-
|
|
709
|
+
w.row
|
|
706
710
|
)), this.props.detail && m.rowType === "data" && m.expanded) {
|
|
707
|
-
const
|
|
708
|
-
g++,
|
|
711
|
+
const y = C.length - (this.props.expandField ? 1 : 0) - (this.props.group ? this.props.group.length : 0) || 1;
|
|
712
|
+
g++, D = b + X + g, O.push(/* @__PURE__ */ r.createElement(
|
|
709
713
|
"tr",
|
|
710
714
|
{
|
|
711
|
-
key:
|
|
712
|
-
className:
|
|
715
|
+
key: A,
|
|
716
|
+
className: L(
|
|
713
717
|
"k-table-row",
|
|
714
|
-
|
|
718
|
+
S ? "k-detail-row k-table-alt-row k-alt" : "k-detail-row"
|
|
715
719
|
),
|
|
716
|
-
style: { visibility: q(
|
|
720
|
+
style: { visibility: q(k) ? "hidden" : "", height: this.props.detailRowHeight },
|
|
717
721
|
role: "row",
|
|
718
|
-
"aria-rowindex":
|
|
722
|
+
"aria-rowindex": D
|
|
719
723
|
},
|
|
720
|
-
this.props.group && this.props.group.map((
|
|
724
|
+
this.props.group && this.props.group.map((W, F) => {
|
|
721
725
|
var oe;
|
|
722
|
-
const
|
|
726
|
+
const v = (oe = w == null ? void 0 : w.row[F]) == null ? void 0 : oe.props.style, Oe = v ? this.isRtl ? { left: v.right, right: v.left } : { left: v.left, right: v.right } : {};
|
|
723
727
|
return /* @__PURE__ */ r.createElement(
|
|
724
|
-
|
|
728
|
+
ve,
|
|
725
729
|
{
|
|
726
730
|
id: "",
|
|
727
731
|
dataIndex: m.dataIndex,
|
|
728
|
-
field:
|
|
732
|
+
field: W.field,
|
|
729
733
|
dataItem: m.dataItem,
|
|
730
|
-
key:
|
|
731
|
-
style:
|
|
732
|
-
ariaColumnIndex: 1 +
|
|
734
|
+
key: F,
|
|
735
|
+
style: Oe,
|
|
736
|
+
ariaColumnIndex: 1 + F,
|
|
733
737
|
isSelected: !1,
|
|
734
738
|
locked: this.props.lockGroups,
|
|
735
739
|
isRtl: this.isRtl,
|
|
@@ -738,9 +742,9 @@ const z = class z extends r.Component {
|
|
|
738
742
|
);
|
|
739
743
|
}),
|
|
740
744
|
this.props.expandField && /* @__PURE__ */ r.createElement(
|
|
741
|
-
|
|
745
|
+
_t,
|
|
742
746
|
{
|
|
743
|
-
id:
|
|
747
|
+
id: x.generateNavigatableId(`${A}-dhcell`, p)
|
|
744
748
|
}
|
|
745
749
|
),
|
|
746
750
|
/* @__PURE__ */ r.createElement(
|
|
@@ -749,10 +753,10 @@ const z = class z extends r.Component {
|
|
|
749
753
|
onContextMenu: this.onContextMenu,
|
|
750
754
|
dataItem: m.dataItem,
|
|
751
755
|
dataIndex: m.dataIndex,
|
|
752
|
-
colSpan:
|
|
756
|
+
colSpan: y,
|
|
753
757
|
ariaColIndex: 2 + (this.props.group ? this.props.group.length : 0),
|
|
754
758
|
detail: this.props.detail,
|
|
755
|
-
id:
|
|
759
|
+
id: x.generateNavigatableId(`${A}-dcell`, p)
|
|
756
760
|
}
|
|
757
761
|
)
|
|
758
762
|
));
|
|
@@ -760,7 +764,7 @@ const z = class z extends r.Component {
|
|
|
760
764
|
});
|
|
761
765
|
} else
|
|
762
766
|
K = !0;
|
|
763
|
-
const
|
|
767
|
+
const Ne = () => {
|
|
764
768
|
const i = this._header;
|
|
765
769
|
return i && i.table && i.table.clientWidth;
|
|
766
770
|
}, Y = () => /* @__PURE__ */ r.createElement(
|
|
@@ -768,9 +772,9 @@ const z = class z extends r.Component {
|
|
|
768
772
|
{
|
|
769
773
|
key: "no-records",
|
|
770
774
|
className: "k-grid-norecords",
|
|
771
|
-
style: { width:
|
|
775
|
+
style: { width: Ne() }
|
|
772
776
|
},
|
|
773
|
-
/* @__PURE__ */ r.createElement("div", { className: "k-grid-norecords-template", [
|
|
777
|
+
/* @__PURE__ */ r.createElement("div", { className: "k-grid-norecords-template", [Ze]: x.generateNavigatableId("no-records", p) }, I.length ? I : /* @__PURE__ */ r.createElement(Et, null))
|
|
774
778
|
), Q = {
|
|
775
779
|
size: this.props.size,
|
|
776
780
|
onPageChange: this.pagerPageChange,
|
|
@@ -778,14 +782,13 @@ const z = class z extends r.Component {
|
|
|
778
782
|
dir: this.isRtl ? "rtl" : void 0,
|
|
779
783
|
skip: this.vs.propsSkip || 0,
|
|
780
784
|
take: (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 10,
|
|
781
|
-
messagesMap:
|
|
782
|
-
navigatable: this.props.navigatable,
|
|
785
|
+
messagesMap: pt,
|
|
783
786
|
...It(this.props.pageable || {})
|
|
784
|
-
}, Z = this.props.pager ? /* @__PURE__ */ r.createElement(this.props.pager, { ...Q }) : /* @__PURE__ */ r.createElement(
|
|
787
|
+
}, Z = this.props.pager ? /* @__PURE__ */ r.createElement(this.props.pager, { ...Q }) : /* @__PURE__ */ r.createElement(Xe, { className: "k-grid-pager", ...Q }), Le = (i) => this.props.sort && this.props.sort.filter((g) => g.field === i).length > 0, Me = (i, g) => /* @__PURE__ */ r.createElement(
|
|
785
788
|
"col",
|
|
786
789
|
{
|
|
787
790
|
key: g.toString(),
|
|
788
|
-
width:
|
|
791
|
+
width: V(i)
|
|
789
792
|
}
|
|
790
793
|
), ee = (ie = this.props.cells) != null && ie.footerCell || this._columns.some(
|
|
791
794
|
(i) => {
|
|
@@ -793,23 +796,24 @@ const z = class z extends r.Component {
|
|
|
793
796
|
return !!(i.footerCell || (g = i.cells) != null && g.footerCell);
|
|
794
797
|
}
|
|
795
798
|
) ? /* @__PURE__ */ r.createElement(
|
|
796
|
-
|
|
799
|
+
lt,
|
|
797
800
|
{
|
|
798
801
|
size: this.props.size,
|
|
799
802
|
columnResize: this.columnResize,
|
|
800
803
|
staticHeaders: this.props.scrollable !== "none",
|
|
804
|
+
hasScrollbarWidth: !!this.getCachedScrollbarWidth(),
|
|
801
805
|
ref: (i) => this._footer = i,
|
|
802
806
|
row: /* @__PURE__ */ r.createElement(
|
|
803
807
|
St,
|
|
804
808
|
{
|
|
805
809
|
cells: this.props.cells,
|
|
806
|
-
idPrefix:
|
|
810
|
+
idPrefix: p,
|
|
807
811
|
columns: this._columns,
|
|
808
812
|
isRtl: this.isRtl,
|
|
809
|
-
ariaRowIndex:
|
|
813
|
+
ariaRowIndex: D + 1
|
|
810
814
|
}
|
|
811
815
|
),
|
|
812
|
-
cols: C.map(
|
|
816
|
+
cols: C.map(Me)
|
|
813
817
|
}
|
|
814
818
|
) : null, te = /* @__PURE__ */ r.createElement(
|
|
815
819
|
"colgroup",
|
|
@@ -823,23 +827,23 @@ const z = class z extends r.Component {
|
|
|
823
827
|
"col",
|
|
824
828
|
{
|
|
825
829
|
key: g.toString(),
|
|
826
|
-
className:
|
|
827
|
-
width:
|
|
830
|
+
className: Le(i.field) ? "k-sorted" : void 0,
|
|
831
|
+
width: V(i)
|
|
828
832
|
}
|
|
829
833
|
)
|
|
830
834
|
)
|
|
831
835
|
), se = this.dragLogic.reorderable || this.dragLogic.groupable;
|
|
832
836
|
if (this.props.scrollable === "none")
|
|
833
|
-
return /* @__PURE__ */ r.createElement(
|
|
837
|
+
return /* @__PURE__ */ r.createElement(B.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
834
838
|
"div",
|
|
835
839
|
{
|
|
836
840
|
id: this.props.id,
|
|
837
841
|
style: this.props.style,
|
|
838
|
-
className:
|
|
842
|
+
className: L(
|
|
839
843
|
"k-grid",
|
|
840
844
|
{
|
|
841
845
|
"k-grid-md": !this.props.size,
|
|
842
|
-
[`k-grid-${
|
|
846
|
+
[`k-grid-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
843
847
|
},
|
|
844
848
|
this.props.className
|
|
845
849
|
),
|
|
@@ -852,7 +856,7 @@ const z = class z extends r.Component {
|
|
|
852
856
|
...ne
|
|
853
857
|
},
|
|
854
858
|
R,
|
|
855
|
-
|
|
859
|
+
M,
|
|
856
860
|
/* @__PURE__ */ r.createElement(
|
|
857
861
|
he,
|
|
858
862
|
{
|
|
@@ -866,32 +870,32 @@ const z = class z extends r.Component {
|
|
|
866
870
|
"table",
|
|
867
871
|
{
|
|
868
872
|
ref: (i) => this.headTable = i,
|
|
869
|
-
className:
|
|
873
|
+
className: L(
|
|
870
874
|
"k-table k-grid-table",
|
|
871
|
-
{ [`k-table-${
|
|
875
|
+
{ [`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size }
|
|
872
876
|
),
|
|
873
877
|
style: { userSelect: d }
|
|
874
878
|
},
|
|
875
879
|
te,
|
|
876
880
|
$,
|
|
877
|
-
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...pe },
|
|
881
|
+
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...pe }, O),
|
|
878
882
|
ee
|
|
879
883
|
)
|
|
880
884
|
),
|
|
881
885
|
K && Y(),
|
|
882
886
|
se && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(de, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(ce, { ref: this.dragLogic.refDragElementClue }))
|
|
883
|
-
),
|
|
884
|
-
let
|
|
885
|
-
return s && (
|
|
887
|
+
), T, this.props.pageable && Z);
|
|
888
|
+
let P = this.props.style || {};
|
|
889
|
+
return s && (P.height || (P = Object.assign({}, P, { height: "450px" }))), /* @__PURE__ */ r.createElement(B.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
886
890
|
"div",
|
|
887
891
|
{
|
|
888
892
|
id: this.props.id,
|
|
889
|
-
style:
|
|
890
|
-
className:
|
|
893
|
+
style: P,
|
|
894
|
+
className: L(
|
|
891
895
|
"k-grid",
|
|
892
896
|
{
|
|
893
897
|
"k-grid-md": !this.props.size,
|
|
894
|
-
[`k-grid-${
|
|
898
|
+
[`k-grid-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size,
|
|
895
899
|
"k-grid-virtual": s
|
|
896
900
|
},
|
|
897
901
|
this.props.className
|
|
@@ -905,7 +909,7 @@ const z = class z extends r.Component {
|
|
|
905
909
|
...ne
|
|
906
910
|
},
|
|
907
911
|
R,
|
|
908
|
-
|
|
912
|
+
M,
|
|
909
913
|
/* @__PURE__ */ r.createElement(
|
|
910
914
|
"div",
|
|
911
915
|
{
|
|
@@ -914,7 +918,7 @@ const z = class z extends r.Component {
|
|
|
914
918
|
"aria-colcount": C.length,
|
|
915
919
|
"aria-rowcount": a,
|
|
916
920
|
id: this._gridId,
|
|
917
|
-
"aria-label": c.toLanguageString(ue,
|
|
921
|
+
"aria-label": c.toLanguageString(ue, dt[ue])
|
|
918
922
|
},
|
|
919
923
|
$,
|
|
920
924
|
/* @__PURE__ */ r.createElement("div", { className: "k-grid-container", role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
@@ -938,11 +942,11 @@ const z = class z extends r.Component {
|
|
|
938
942
|
"table",
|
|
939
943
|
{
|
|
940
944
|
ref: (i) => this.tableElement = i,
|
|
941
|
-
className:
|
|
945
|
+
className: L(
|
|
942
946
|
"k-table k-grid-table",
|
|
943
947
|
{
|
|
944
948
|
"k-table-md": !this.props.size,
|
|
945
|
-
[`k-table-${
|
|
949
|
+
[`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
946
950
|
}
|
|
947
951
|
),
|
|
948
952
|
role: "presentation",
|
|
@@ -957,7 +961,7 @@ const z = class z extends r.Component {
|
|
|
957
961
|
role: "rowgroup",
|
|
958
962
|
...pe
|
|
959
963
|
},
|
|
960
|
-
|
|
964
|
+
O
|
|
961
965
|
)
|
|
962
966
|
)
|
|
963
967
|
), K && Y()),
|
|
@@ -970,9 +974,9 @@ const z = class z extends r.Component {
|
|
|
970
974
|
)),
|
|
971
975
|
ee,
|
|
972
976
|
se && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(de, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(ce, { ref: this.dragLogic.refDragElementClue })),
|
|
973
|
-
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(
|
|
977
|
+
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(Ue, null)
|
|
974
978
|
),
|
|
975
|
-
|
|
979
|
+
T,
|
|
976
980
|
this.props.pageable && Z
|
|
977
981
|
));
|
|
978
982
|
}
|
|
@@ -981,8 +985,8 @@ const z = class z extends r.Component {
|
|
|
981
985
|
}
|
|
982
986
|
selectionChange(a) {
|
|
983
987
|
if (this.props.onSelectionChange) {
|
|
984
|
-
const { event:
|
|
985
|
-
...this.getArguments(
|
|
988
|
+
const { event: p, dataItem: c, dataIndex: e, columnIndex: t } = a, { mode: s, cell: l } = le(this.props.selectable), h = {
|
|
989
|
+
...this.getArguments(p.syntheticEvent),
|
|
986
990
|
dataItem: c,
|
|
987
991
|
startColIndex: t,
|
|
988
992
|
endColIndex: t,
|
|
@@ -999,13 +1003,13 @@ const z = class z extends r.Component {
|
|
|
999
1003
|
componentId: this._gridId,
|
|
1000
1004
|
selectedField: this.props.selectedField || ""
|
|
1001
1005
|
};
|
|
1002
|
-
this.props.onSelectionChange.call(void 0,
|
|
1006
|
+
this.props.onSelectionChange.call(void 0, h);
|
|
1003
1007
|
}
|
|
1004
1008
|
}
|
|
1005
|
-
raiseDataEvent(a,
|
|
1009
|
+
raiseDataEvent(a, p, c, e, t) {
|
|
1006
1010
|
const s = this.props.onDataStateChange;
|
|
1007
1011
|
if (a) {
|
|
1008
|
-
const l = { ...this.getArguments(e), ...
|
|
1012
|
+
const l = { ...this.getArguments(e), ...p, targetEvent: t };
|
|
1009
1013
|
a.call(void 0, l);
|
|
1010
1014
|
} else
|
|
1011
1015
|
s && s.call(
|
|
@@ -1020,16 +1024,16 @@ const z = class z extends r.Component {
|
|
|
1020
1024
|
}
|
|
1021
1025
|
);
|
|
1022
1026
|
}
|
|
1023
|
-
columnReorder(a,
|
|
1027
|
+
columnReorder(a, p, c) {
|
|
1024
1028
|
const e = this._columns[a], t = e.depth, s = (d) => {
|
|
1025
1029
|
do
|
|
1026
1030
|
d++;
|
|
1027
1031
|
while (d < this._columns.length && this._columns[d].depth > t);
|
|
1028
1032
|
return d;
|
|
1029
1033
|
}, l = this._columns.splice(a, s(a) - a);
|
|
1030
|
-
this._columns.splice(a <
|
|
1031
|
-
const
|
|
1032
|
-
|
|
1034
|
+
this._columns.splice(a < p ? s(p - l.length) : p, 0, ...l), this._columns.filter((d) => d.declarationIndex >= 0).forEach((d, f) => d.orderIndex = f), this._columnsMutations++;
|
|
1035
|
+
const h = this._columns[a].locked && this._columns[p].locked;
|
|
1036
|
+
Ye(this._columnsMap, this._columns, h || this._shouldUpdateLeftRight), Qe(this._columnsMap, this._columns, h || this._shouldUpdateLeftRight), this._resized && (this._shouldUpdateLeftRight = !1, this._resized = !1);
|
|
1033
1037
|
const n = this.columns;
|
|
1034
1038
|
if (this.forceUpdate(), this.props.onColumnReorder) {
|
|
1035
1039
|
const d = {
|
|
@@ -1041,39 +1045,39 @@ const z = class z extends r.Component {
|
|
|
1041
1045
|
this.props.onColumnReorder.call(void 0, d);
|
|
1042
1046
|
}
|
|
1043
1047
|
}
|
|
1044
|
-
groupReorder(a,
|
|
1048
|
+
groupReorder(a, p, c) {
|
|
1045
1049
|
if (this.props.group === void 0)
|
|
1046
1050
|
return;
|
|
1047
1051
|
const e = this.props.group.slice();
|
|
1048
|
-
e.splice(
|
|
1052
|
+
e.splice(p, 0, ...e.splice(a, 1)), this.groupChange(e, c);
|
|
1049
1053
|
}
|
|
1050
|
-
columnToGroup(a,
|
|
1054
|
+
columnToGroup(a, p, c) {
|
|
1051
1055
|
const e = this._columns[a].field;
|
|
1052
1056
|
if (!e)
|
|
1053
1057
|
return;
|
|
1054
1058
|
const t = (this.props.group || []).slice();
|
|
1055
|
-
t.splice(
|
|
1059
|
+
t.splice(p, 0, { field: e }), this.groupChange(t, c);
|
|
1056
1060
|
}
|
|
1057
|
-
columnGroupChange(a,
|
|
1061
|
+
columnGroupChange(a, p) {
|
|
1058
1062
|
const c = this.dragLogic.getCurrentGroupsLength;
|
|
1059
|
-
this.columnToGroup(a, c,
|
|
1063
|
+
this.columnToGroup(a, c, p);
|
|
1060
1064
|
}
|
|
1061
1065
|
resetTableWidth() {
|
|
1062
1066
|
let a = 0;
|
|
1063
1067
|
if (!this.columnResize.colGroupMain)
|
|
1064
1068
|
return;
|
|
1065
|
-
const
|
|
1066
|
-
for (let c = 0; c <
|
|
1067
|
-
const e =
|
|
1069
|
+
const p = this.columnResize.colGroupMain.children;
|
|
1070
|
+
for (let c = 0; c < p.length; c++) {
|
|
1071
|
+
const e = p[c].width;
|
|
1068
1072
|
if (!e)
|
|
1069
1073
|
return;
|
|
1070
1074
|
a += parseFloat(e.toString());
|
|
1071
1075
|
}
|
|
1072
1076
|
a = Math.round(a), this._header && this._header.setWidth(a), this._footer && this._footer.setWidth(a), this.tableElement && (this.tableElement.style.width = a + "px");
|
|
1073
1077
|
}
|
|
1074
|
-
initColumns(a,
|
|
1075
|
-
const c =
|
|
1076
|
-
this._columns = t, this._columns.length === 0 && (this._columns = vt(this.props.data, this.props.group, this.props.expandField, { prevId: 0, idPrefix: c })), this.configureColumns(this._columns,
|
|
1078
|
+
initColumns(a, p) {
|
|
1079
|
+
const c = x.getIdPrefix(this.navigationStateRef), e = this.readColumns(a, c, this._columnsMutations), t = this.filterColumnsByMediaProp(e);
|
|
1080
|
+
this._columns = t, this._columns.length === 0 && (this._columns = vt(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, this._columnsMutations), this.columnResize.columns = this._columns, this.dragLogic.columns = this._columns;
|
|
1077
1081
|
}
|
|
1078
1082
|
getDataState() {
|
|
1079
1083
|
return {
|
|
@@ -1168,11 +1172,16 @@ z.displayName = "KendoReactGrid", z.defaultProps = {
|
|
|
1168
1172
|
onColumnResize: o.func,
|
|
1169
1173
|
onColumnReorder: o.func,
|
|
1170
1174
|
dataItemKey: o.string,
|
|
1171
|
-
navigatable: o.
|
|
1175
|
+
navigatable: o.oneOfType([
|
|
1176
|
+
o.bool,
|
|
1177
|
+
o.shape({
|
|
1178
|
+
mode: o.oneOf(["incell", "inline", "popup"])
|
|
1179
|
+
})
|
|
1180
|
+
]),
|
|
1172
1181
|
size: o.oneOf(["small", "medium"])
|
|
1173
|
-
}, z.contextType =
|
|
1174
|
-
let
|
|
1175
|
-
|
|
1182
|
+
}, z.contextType = B;
|
|
1183
|
+
let U = z;
|
|
1184
|
+
ht(U);
|
|
1176
1185
|
export {
|
|
1177
|
-
|
|
1186
|
+
U as Grid
|
|
1178
1187
|
};
|