@progress/kendo-react-grid 8.2.0-develop.4 → 8.2.0-develop.40
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 +229 -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 +9 -7
- package/index.d.mts +29 -9
- package/index.d.ts +29 -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 F, 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 (!F)
|
|
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) => F && 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 (F)
|
|
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 = F && window.IntersectionObserver && new window.IntersectionObserver(this.handleIntersection, p) || null, this.resizeObserver = F && 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,35 @@ 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,
|
|
573
|
+
className: this.props.headerClassName,
|
|
570
574
|
headerRow: this.getHeaderRow(
|
|
571
|
-
ye,
|
|
572
575
|
we,
|
|
573
|
-
|
|
576
|
+
ye,
|
|
577
|
+
Ee,
|
|
574
578
|
n,
|
|
579
|
+
Se,
|
|
575
580
|
Ie,
|
|
576
581
|
ke,
|
|
577
|
-
Ee,
|
|
578
|
-
xe,
|
|
579
582
|
_e,
|
|
583
|
+
xe,
|
|
580
584
|
ze,
|
|
581
585
|
this._columns,
|
|
582
586
|
this._columnsMap,
|
|
583
587
|
this.isRtl
|
|
584
588
|
),
|
|
585
589
|
filterRow: this.props.filterable && /* @__PURE__ */ r.createElement(
|
|
586
|
-
|
|
590
|
+
rt,
|
|
587
591
|
{
|
|
588
592
|
cells: this.props.cells,
|
|
589
593
|
size: this.props.size,
|
|
@@ -594,6 +598,7 @@ const z = class z extends r.Component {
|
|
|
594
598
|
sort: this.props.sort,
|
|
595
599
|
cellRender: this.props.filterCellRender,
|
|
596
600
|
isRtl: this.isRtl,
|
|
601
|
+
navigatable: !!this.props.navigatable,
|
|
597
602
|
ariaRowIndex: this._columnsMap.length + 1
|
|
598
603
|
}
|
|
599
604
|
) || void 0,
|
|
@@ -601,66 +606,66 @@ const z = class z extends r.Component {
|
|
|
601
606
|
"col",
|
|
602
607
|
{
|
|
603
608
|
key: g.toString(),
|
|
604
|
-
width:
|
|
609
|
+
width: V(i)
|
|
605
610
|
}
|
|
606
611
|
))
|
|
607
612
|
}
|
|
608
|
-
),
|
|
613
|
+
), Te = this.vs && this.vs.container && this.vs.container.scrollLeft || 0, De = parseFloat(((this.props.style || {}).width || "").toString()), { colSpans: He, hiddenColumns: Ne } = Je({
|
|
609
614
|
enabled: this.props.columnVirtualization,
|
|
610
615
|
columns: C,
|
|
611
|
-
tableViewPortWidth:
|
|
612
|
-
scrollLeft:
|
|
613
|
-
}),
|
|
614
|
-
let
|
|
615
|
-
const
|
|
616
|
+
tableViewPortWidth: De,
|
|
617
|
+
scrollLeft: Te
|
|
618
|
+
}), Ae = (i, g, m) => {
|
|
619
|
+
let k = !1;
|
|
620
|
+
const S = this.props.selectedField ? be(this.props.selectedField, i.dataItem) : void 0;
|
|
616
621
|
return {
|
|
617
|
-
row: C.map((u,
|
|
618
|
-
if (
|
|
622
|
+
row: C.map((u, b) => {
|
|
623
|
+
if (Ne[b])
|
|
619
624
|
return null;
|
|
620
|
-
const H = u.id ? u.id :
|
|
621
|
-
let
|
|
625
|
+
const H = u.id ? u.id : b, N = `${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 } : {};
|
|
626
|
+
let y = !1;
|
|
622
627
|
if (u.editable && this.props.editField) {
|
|
623
|
-
const
|
|
624
|
-
|
|
628
|
+
const v = be(this.props.editField, i.dataItem);
|
|
629
|
+
v && (v === !0 || v === u.field) && (k = !0, y = !0);
|
|
625
630
|
}
|
|
626
|
-
const
|
|
631
|
+
const W = u.cell || y && st || Rt, A = this.props.expandField && this.props.detail && u.field === this.props.expandField;
|
|
627
632
|
return /* @__PURE__ */ r.createElement(
|
|
628
|
-
|
|
633
|
+
W,
|
|
629
634
|
{
|
|
630
635
|
onContextMenu: this.onContextMenu,
|
|
631
636
|
key: H,
|
|
632
637
|
locked: this.props.lockGroups,
|
|
633
|
-
id:
|
|
634
|
-
`${g}-${String(
|
|
635
|
-
|
|
636
|
-
|
|
638
|
+
id: x.generateNavigatableId(
|
|
639
|
+
`${g}-${String(b)}`,
|
|
640
|
+
p,
|
|
641
|
+
A || i.rowType === "groupHeader" || i.rowType === "groupFooter" || u.field === "value" ? "nodata" : "cell"
|
|
637
642
|
),
|
|
638
|
-
colSpan: He[
|
|
643
|
+
colSpan: He[b],
|
|
639
644
|
dataItem: i.dataItem,
|
|
640
645
|
field: u.field,
|
|
641
646
|
editor: u.editor,
|
|
642
647
|
format: u.format,
|
|
643
|
-
className:
|
|
648
|
+
className: N,
|
|
644
649
|
render: this.props.cellRender,
|
|
645
|
-
cells:
|
|
650
|
+
cells: Ct(this.props.cells, u.cells),
|
|
646
651
|
onChange: this.itemChange,
|
|
647
|
-
selectionChange: this.props.onSelectionChange ? (
|
|
648
|
-
this.selectionChange({ event:
|
|
652
|
+
selectionChange: this.props.onSelectionChange ? (v) => {
|
|
653
|
+
this.selectionChange({ event: v, dataItem: i.dataItem, dataIndex: m, columnIndex: b });
|
|
649
654
|
} : void 0,
|
|
650
|
-
columnIndex:
|
|
655
|
+
columnIndex: b,
|
|
651
656
|
columnsCount: C.length,
|
|
652
657
|
rowType: i.rowType,
|
|
653
658
|
level: i.level,
|
|
654
659
|
expanded: i.expanded,
|
|
655
660
|
dataIndex: i.dataIndex,
|
|
656
|
-
style:
|
|
661
|
+
style: w,
|
|
657
662
|
ariaColumnIndex: u.ariaColumnIndex,
|
|
658
|
-
isSelected: Array.isArray(
|
|
663
|
+
isSelected: Array.isArray(S) && S.indexOf(b) > -1
|
|
659
664
|
}
|
|
660
665
|
);
|
|
661
666
|
}),
|
|
662
|
-
isInEdit:
|
|
663
|
-
isSelected: typeof
|
|
667
|
+
isInEdit: k,
|
|
668
|
+
isSelected: typeof S == "boolean" && S
|
|
664
669
|
};
|
|
665
670
|
};
|
|
666
671
|
let j = 0;
|
|
@@ -674,62 +679,62 @@ const z = class z extends r.Component {
|
|
|
674
679
|
}
|
|
675
680
|
const q = (i) => i >= this._data.length - j;
|
|
676
681
|
let J = this.vs.realSkip || 0;
|
|
677
|
-
const
|
|
682
|
+
const O = [];
|
|
678
683
|
let K = !1;
|
|
679
684
|
const X = this._columnsMap.length + (this.props.filterable ? 1 : 0) + 1;
|
|
680
|
-
let
|
|
685
|
+
let D = 0;
|
|
681
686
|
if (this._data.length) {
|
|
682
687
|
let i = -1, g = 0;
|
|
683
|
-
(this._slicedData || this._data).forEach((m,
|
|
688
|
+
(this._slicedData || this._data).forEach((m, k) => {
|
|
684
689
|
m.rowType === "data" && (J++, i++);
|
|
685
|
-
const
|
|
686
|
-
if (
|
|
687
|
-
|
|
690
|
+
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, N = H + "_1", w = Ae(m, H, i);
|
|
691
|
+
if (D = b + X + g, O.push(/* @__PURE__ */ r.createElement(
|
|
692
|
+
wt,
|
|
688
693
|
{
|
|
689
694
|
key: H,
|
|
690
695
|
dataItem: m.dataItem,
|
|
691
|
-
isAltRow:
|
|
692
|
-
isInEdit:
|
|
696
|
+
isAltRow: S,
|
|
697
|
+
isInEdit: w.isInEdit,
|
|
693
698
|
rowType: m.rowType,
|
|
694
|
-
isHidden: q(
|
|
695
|
-
onClick: (
|
|
696
|
-
onDoubleClick: (
|
|
699
|
+
isHidden: q(k),
|
|
700
|
+
onClick: (y) => this.rowClick(y, m),
|
|
701
|
+
onDoubleClick: (y) => this.rowDblClick(y, m),
|
|
697
702
|
selectedField: this.props.selectedField,
|
|
698
703
|
rowHeight: this.props.rowHeight,
|
|
699
704
|
render: this.props.rowRender,
|
|
700
|
-
ariaRowIndex:
|
|
701
|
-
absoluteRowIndex:
|
|
702
|
-
dataIndex: this.vs.scrollableVirtual && !this.props.groupable ?
|
|
703
|
-
isSelected:
|
|
705
|
+
ariaRowIndex: D,
|
|
706
|
+
absoluteRowIndex: b,
|
|
707
|
+
dataIndex: this.vs.scrollableVirtual && !this.props.groupable ? b : i,
|
|
708
|
+
isSelected: w.isSelected
|
|
704
709
|
},
|
|
705
|
-
|
|
710
|
+
w.row
|
|
706
711
|
)), this.props.detail && m.rowType === "data" && m.expanded) {
|
|
707
|
-
const
|
|
708
|
-
g++,
|
|
712
|
+
const y = C.length - (this.props.expandField ? 1 : 0) - (this.props.group ? this.props.group.length : 0) || 1;
|
|
713
|
+
g++, D = b + X + g, O.push(/* @__PURE__ */ r.createElement(
|
|
709
714
|
"tr",
|
|
710
715
|
{
|
|
711
|
-
key:
|
|
712
|
-
className:
|
|
716
|
+
key: N,
|
|
717
|
+
className: L(
|
|
713
718
|
"k-table-row",
|
|
714
|
-
|
|
719
|
+
S ? "k-detail-row k-table-alt-row k-alt" : "k-detail-row"
|
|
715
720
|
),
|
|
716
|
-
style: { visibility: q(
|
|
721
|
+
style: { visibility: q(k) ? "hidden" : "", height: this.props.detailRowHeight },
|
|
717
722
|
role: "row",
|
|
718
|
-
"aria-rowindex":
|
|
723
|
+
"aria-rowindex": D
|
|
719
724
|
},
|
|
720
|
-
this.props.group && this.props.group.map((
|
|
725
|
+
this.props.group && this.props.group.map((W, A) => {
|
|
721
726
|
var oe;
|
|
722
|
-
const
|
|
727
|
+
const v = (oe = w == null ? void 0 : w.row[A]) == null ? void 0 : oe.props.style, Oe = v ? this.isRtl ? { left: v.right, right: v.left } : { left: v.left, right: v.right } : {};
|
|
723
728
|
return /* @__PURE__ */ r.createElement(
|
|
724
|
-
|
|
729
|
+
ve,
|
|
725
730
|
{
|
|
726
731
|
id: "",
|
|
727
732
|
dataIndex: m.dataIndex,
|
|
728
|
-
field:
|
|
733
|
+
field: W.field,
|
|
729
734
|
dataItem: m.dataItem,
|
|
730
|
-
key:
|
|
731
|
-
style:
|
|
732
|
-
ariaColumnIndex: 1 +
|
|
735
|
+
key: A,
|
|
736
|
+
style: Oe,
|
|
737
|
+
ariaColumnIndex: 1 + A,
|
|
733
738
|
isSelected: !1,
|
|
734
739
|
locked: this.props.lockGroups,
|
|
735
740
|
isRtl: this.isRtl,
|
|
@@ -738,9 +743,9 @@ const z = class z extends r.Component {
|
|
|
738
743
|
);
|
|
739
744
|
}),
|
|
740
745
|
this.props.expandField && /* @__PURE__ */ r.createElement(
|
|
741
|
-
|
|
746
|
+
_t,
|
|
742
747
|
{
|
|
743
|
-
id:
|
|
748
|
+
id: x.generateNavigatableId(`${N}-dhcell`, p)
|
|
744
749
|
}
|
|
745
750
|
),
|
|
746
751
|
/* @__PURE__ */ r.createElement(
|
|
@@ -749,10 +754,10 @@ const z = class z extends r.Component {
|
|
|
749
754
|
onContextMenu: this.onContextMenu,
|
|
750
755
|
dataItem: m.dataItem,
|
|
751
756
|
dataIndex: m.dataIndex,
|
|
752
|
-
colSpan:
|
|
757
|
+
colSpan: y,
|
|
753
758
|
ariaColIndex: 2 + (this.props.group ? this.props.group.length : 0),
|
|
754
759
|
detail: this.props.detail,
|
|
755
|
-
id:
|
|
760
|
+
id: x.generateNavigatableId(`${N}-dcell`, p)
|
|
756
761
|
}
|
|
757
762
|
)
|
|
758
763
|
));
|
|
@@ -760,7 +765,7 @@ const z = class z extends r.Component {
|
|
|
760
765
|
});
|
|
761
766
|
} else
|
|
762
767
|
K = !0;
|
|
763
|
-
const
|
|
768
|
+
const Fe = () => {
|
|
764
769
|
const i = this._header;
|
|
765
770
|
return i && i.table && i.table.clientWidth;
|
|
766
771
|
}, Y = () => /* @__PURE__ */ r.createElement(
|
|
@@ -768,9 +773,9 @@ const z = class z extends r.Component {
|
|
|
768
773
|
{
|
|
769
774
|
key: "no-records",
|
|
770
775
|
className: "k-grid-norecords",
|
|
771
|
-
style: { width:
|
|
776
|
+
style: { width: Fe() }
|
|
772
777
|
},
|
|
773
|
-
/* @__PURE__ */ r.createElement("div", { className: "k-grid-norecords-template", [
|
|
778
|
+
/* @__PURE__ */ r.createElement("div", { className: "k-grid-norecords-template", [Ze]: x.generateNavigatableId("no-records", p) }, I.length ? I : /* @__PURE__ */ r.createElement(Et, null))
|
|
774
779
|
), Q = {
|
|
775
780
|
size: this.props.size,
|
|
776
781
|
onPageChange: this.pagerPageChange,
|
|
@@ -778,14 +783,13 @@ const z = class z extends r.Component {
|
|
|
778
783
|
dir: this.isRtl ? "rtl" : void 0,
|
|
779
784
|
skip: this.vs.propsSkip || 0,
|
|
780
785
|
take: (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 10,
|
|
781
|
-
messagesMap:
|
|
782
|
-
navigatable: this.props.navigatable,
|
|
786
|
+
messagesMap: pt,
|
|
783
787
|
...It(this.props.pageable || {})
|
|
784
|
-
}, Z = this.props.pager ? /* @__PURE__ */ r.createElement(this.props.pager, { ...Q }) : /* @__PURE__ */ r.createElement(
|
|
788
|
+
}, 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
789
|
"col",
|
|
786
790
|
{
|
|
787
791
|
key: g.toString(),
|
|
788
|
-
width:
|
|
792
|
+
width: V(i)
|
|
789
793
|
}
|
|
790
794
|
), ee = (ie = this.props.cells) != null && ie.footerCell || this._columns.some(
|
|
791
795
|
(i) => {
|
|
@@ -793,23 +797,24 @@ const z = class z extends r.Component {
|
|
|
793
797
|
return !!(i.footerCell || (g = i.cells) != null && g.footerCell);
|
|
794
798
|
}
|
|
795
799
|
) ? /* @__PURE__ */ r.createElement(
|
|
796
|
-
|
|
800
|
+
lt,
|
|
797
801
|
{
|
|
798
802
|
size: this.props.size,
|
|
799
803
|
columnResize: this.columnResize,
|
|
800
804
|
staticHeaders: this.props.scrollable !== "none",
|
|
805
|
+
hasScrollbarWidth: !!this.getCachedScrollbarWidth(),
|
|
801
806
|
ref: (i) => this._footer = i,
|
|
802
807
|
row: /* @__PURE__ */ r.createElement(
|
|
803
808
|
St,
|
|
804
809
|
{
|
|
805
810
|
cells: this.props.cells,
|
|
806
|
-
idPrefix:
|
|
811
|
+
idPrefix: p,
|
|
807
812
|
columns: this._columns,
|
|
808
813
|
isRtl: this.isRtl,
|
|
809
|
-
ariaRowIndex:
|
|
814
|
+
ariaRowIndex: D + 1
|
|
810
815
|
}
|
|
811
816
|
),
|
|
812
|
-
cols: C.map(
|
|
817
|
+
cols: C.map(Me)
|
|
813
818
|
}
|
|
814
819
|
) : null, te = /* @__PURE__ */ r.createElement(
|
|
815
820
|
"colgroup",
|
|
@@ -823,23 +828,23 @@ const z = class z extends r.Component {
|
|
|
823
828
|
"col",
|
|
824
829
|
{
|
|
825
830
|
key: g.toString(),
|
|
826
|
-
className:
|
|
827
|
-
width:
|
|
831
|
+
className: Le(i.field) ? "k-sorted" : void 0,
|
|
832
|
+
width: V(i)
|
|
828
833
|
}
|
|
829
834
|
)
|
|
830
835
|
)
|
|
831
836
|
), se = this.dragLogic.reorderable || this.dragLogic.groupable;
|
|
832
837
|
if (this.props.scrollable === "none")
|
|
833
|
-
return /* @__PURE__ */ r.createElement(
|
|
838
|
+
return /* @__PURE__ */ r.createElement(B.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
834
839
|
"div",
|
|
835
840
|
{
|
|
836
841
|
id: this.props.id,
|
|
837
842
|
style: this.props.style,
|
|
838
|
-
className:
|
|
843
|
+
className: L(
|
|
839
844
|
"k-grid",
|
|
840
845
|
{
|
|
841
846
|
"k-grid-md": !this.props.size,
|
|
842
|
-
[`k-grid-${
|
|
847
|
+
[`k-grid-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
843
848
|
},
|
|
844
849
|
this.props.className
|
|
845
850
|
),
|
|
@@ -852,7 +857,7 @@ const z = class z extends r.Component {
|
|
|
852
857
|
...ne
|
|
853
858
|
},
|
|
854
859
|
R,
|
|
855
|
-
|
|
860
|
+
M,
|
|
856
861
|
/* @__PURE__ */ r.createElement(
|
|
857
862
|
he,
|
|
858
863
|
{
|
|
@@ -866,32 +871,32 @@ const z = class z extends r.Component {
|
|
|
866
871
|
"table",
|
|
867
872
|
{
|
|
868
873
|
ref: (i) => this.headTable = i,
|
|
869
|
-
className:
|
|
874
|
+
className: L(
|
|
870
875
|
"k-table k-grid-table",
|
|
871
|
-
{ [`k-table-${
|
|
876
|
+
{ [`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size }
|
|
872
877
|
),
|
|
873
878
|
style: { userSelect: d }
|
|
874
879
|
},
|
|
875
880
|
te,
|
|
876
881
|
$,
|
|
877
|
-
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...pe },
|
|
882
|
+
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...pe }, O),
|
|
878
883
|
ee
|
|
879
884
|
)
|
|
880
885
|
),
|
|
881
886
|
K && Y(),
|
|
882
887
|
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 && (
|
|
888
|
+
), T, this.props.pageable && Z);
|
|
889
|
+
let P = this.props.style || {};
|
|
890
|
+
return s && (P.height || (P = Object.assign({}, P, { height: "450px" }))), /* @__PURE__ */ r.createElement(B.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
886
891
|
"div",
|
|
887
892
|
{
|
|
888
893
|
id: this.props.id,
|
|
889
|
-
style:
|
|
890
|
-
className:
|
|
894
|
+
style: P,
|
|
895
|
+
className: L(
|
|
891
896
|
"k-grid",
|
|
892
897
|
{
|
|
893
898
|
"k-grid-md": !this.props.size,
|
|
894
|
-
[`k-grid-${
|
|
899
|
+
[`k-grid-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size,
|
|
895
900
|
"k-grid-virtual": s
|
|
896
901
|
},
|
|
897
902
|
this.props.className
|
|
@@ -905,7 +910,7 @@ const z = class z extends r.Component {
|
|
|
905
910
|
...ne
|
|
906
911
|
},
|
|
907
912
|
R,
|
|
908
|
-
|
|
913
|
+
M,
|
|
909
914
|
/* @__PURE__ */ r.createElement(
|
|
910
915
|
"div",
|
|
911
916
|
{
|
|
@@ -914,7 +919,7 @@ const z = class z extends r.Component {
|
|
|
914
919
|
"aria-colcount": C.length,
|
|
915
920
|
"aria-rowcount": a,
|
|
916
921
|
id: this._gridId,
|
|
917
|
-
"aria-label": c.toLanguageString(ue,
|
|
922
|
+
"aria-label": c.toLanguageString(ue, dt[ue])
|
|
918
923
|
},
|
|
919
924
|
$,
|
|
920
925
|
/* @__PURE__ */ r.createElement("div", { className: "k-grid-container", role: "presentation" }, /* @__PURE__ */ r.createElement(
|
|
@@ -938,11 +943,11 @@ const z = class z extends r.Component {
|
|
|
938
943
|
"table",
|
|
939
944
|
{
|
|
940
945
|
ref: (i) => this.tableElement = i,
|
|
941
|
-
className:
|
|
946
|
+
className: L(
|
|
942
947
|
"k-table k-grid-table",
|
|
943
948
|
{
|
|
944
949
|
"k-table-md": !this.props.size,
|
|
945
|
-
[`k-table-${
|
|
950
|
+
[`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
946
951
|
}
|
|
947
952
|
),
|
|
948
953
|
role: "presentation",
|
|
@@ -957,7 +962,7 @@ const z = class z extends r.Component {
|
|
|
957
962
|
role: "rowgroup",
|
|
958
963
|
...pe
|
|
959
964
|
},
|
|
960
|
-
|
|
965
|
+
O
|
|
961
966
|
)
|
|
962
967
|
)
|
|
963
968
|
), K && Y()),
|
|
@@ -970,9 +975,9 @@ const z = class z extends r.Component {
|
|
|
970
975
|
)),
|
|
971
976
|
ee,
|
|
972
977
|
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(
|
|
978
|
+
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(Ue, null)
|
|
974
979
|
),
|
|
975
|
-
|
|
980
|
+
T,
|
|
976
981
|
this.props.pageable && Z
|
|
977
982
|
));
|
|
978
983
|
}
|
|
@@ -981,8 +986,8 @@ const z = class z extends r.Component {
|
|
|
981
986
|
}
|
|
982
987
|
selectionChange(a) {
|
|
983
988
|
if (this.props.onSelectionChange) {
|
|
984
|
-
const { event:
|
|
985
|
-
...this.getArguments(
|
|
989
|
+
const { event: p, dataItem: c, dataIndex: e, columnIndex: t } = a, { mode: s, cell: l } = le(this.props.selectable), h = {
|
|
990
|
+
...this.getArguments(p.syntheticEvent),
|
|
986
991
|
dataItem: c,
|
|
987
992
|
startColIndex: t,
|
|
988
993
|
endColIndex: t,
|
|
@@ -999,13 +1004,13 @@ const z = class z extends r.Component {
|
|
|
999
1004
|
componentId: this._gridId,
|
|
1000
1005
|
selectedField: this.props.selectedField || ""
|
|
1001
1006
|
};
|
|
1002
|
-
this.props.onSelectionChange.call(void 0,
|
|
1007
|
+
this.props.onSelectionChange.call(void 0, h);
|
|
1003
1008
|
}
|
|
1004
1009
|
}
|
|
1005
|
-
raiseDataEvent(a,
|
|
1010
|
+
raiseDataEvent(a, p, c, e, t) {
|
|
1006
1011
|
const s = this.props.onDataStateChange;
|
|
1007
1012
|
if (a) {
|
|
1008
|
-
const l = { ...this.getArguments(e), ...
|
|
1013
|
+
const l = { ...this.getArguments(e), ...p, targetEvent: t };
|
|
1009
1014
|
a.call(void 0, l);
|
|
1010
1015
|
} else
|
|
1011
1016
|
s && s.call(
|
|
@@ -1020,16 +1025,16 @@ const z = class z extends r.Component {
|
|
|
1020
1025
|
}
|
|
1021
1026
|
);
|
|
1022
1027
|
}
|
|
1023
|
-
columnReorder(a,
|
|
1028
|
+
columnReorder(a, p, c) {
|
|
1024
1029
|
const e = this._columns[a], t = e.depth, s = (d) => {
|
|
1025
1030
|
do
|
|
1026
1031
|
d++;
|
|
1027
1032
|
while (d < this._columns.length && this._columns[d].depth > t);
|
|
1028
1033
|
return d;
|
|
1029
1034
|
}, l = this._columns.splice(a, s(a) - a);
|
|
1030
|
-
this._columns.splice(a <
|
|
1031
|
-
const
|
|
1032
|
-
|
|
1035
|
+
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++;
|
|
1036
|
+
const h = this._columns[a].locked && this._columns[p].locked;
|
|
1037
|
+
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
1038
|
const n = this.columns;
|
|
1034
1039
|
if (this.forceUpdate(), this.props.onColumnReorder) {
|
|
1035
1040
|
const d = {
|
|
@@ -1041,39 +1046,39 @@ const z = class z extends r.Component {
|
|
|
1041
1046
|
this.props.onColumnReorder.call(void 0, d);
|
|
1042
1047
|
}
|
|
1043
1048
|
}
|
|
1044
|
-
groupReorder(a,
|
|
1049
|
+
groupReorder(a, p, c) {
|
|
1045
1050
|
if (this.props.group === void 0)
|
|
1046
1051
|
return;
|
|
1047
1052
|
const e = this.props.group.slice();
|
|
1048
|
-
e.splice(
|
|
1053
|
+
e.splice(p, 0, ...e.splice(a, 1)), this.groupChange(e, c);
|
|
1049
1054
|
}
|
|
1050
|
-
columnToGroup(a,
|
|
1055
|
+
columnToGroup(a, p, c) {
|
|
1051
1056
|
const e = this._columns[a].field;
|
|
1052
1057
|
if (!e)
|
|
1053
1058
|
return;
|
|
1054
1059
|
const t = (this.props.group || []).slice();
|
|
1055
|
-
t.splice(
|
|
1060
|
+
t.splice(p, 0, { field: e }), this.groupChange(t, c);
|
|
1056
1061
|
}
|
|
1057
|
-
columnGroupChange(a,
|
|
1062
|
+
columnGroupChange(a, p) {
|
|
1058
1063
|
const c = this.dragLogic.getCurrentGroupsLength;
|
|
1059
|
-
this.columnToGroup(a, c,
|
|
1064
|
+
this.columnToGroup(a, c, p);
|
|
1060
1065
|
}
|
|
1061
1066
|
resetTableWidth() {
|
|
1062
1067
|
let a = 0;
|
|
1063
1068
|
if (!this.columnResize.colGroupMain)
|
|
1064
1069
|
return;
|
|
1065
|
-
const
|
|
1066
|
-
for (let c = 0; c <
|
|
1067
|
-
const e =
|
|
1070
|
+
const p = this.columnResize.colGroupMain.children;
|
|
1071
|
+
for (let c = 0; c < p.length; c++) {
|
|
1072
|
+
const e = p[c].width;
|
|
1068
1073
|
if (!e)
|
|
1069
1074
|
return;
|
|
1070
1075
|
a += parseFloat(e.toString());
|
|
1071
1076
|
}
|
|
1072
1077
|
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
1078
|
}
|
|
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,
|
|
1079
|
+
initColumns(a, p) {
|
|
1080
|
+
const c = x.getIdPrefix(this.navigationStateRef), e = this.readColumns(a, c, this._columnsMutations), t = this.filterColumnsByMediaProp(e);
|
|
1081
|
+
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
1082
|
}
|
|
1078
1083
|
getDataState() {
|
|
1079
1084
|
return {
|
|
@@ -1168,11 +1173,16 @@ z.displayName = "KendoReactGrid", z.defaultProps = {
|
|
|
1168
1173
|
onColumnResize: o.func,
|
|
1169
1174
|
onColumnReorder: o.func,
|
|
1170
1175
|
dataItemKey: o.string,
|
|
1171
|
-
navigatable: o.
|
|
1176
|
+
navigatable: o.oneOfType([
|
|
1177
|
+
o.bool,
|
|
1178
|
+
o.shape({
|
|
1179
|
+
mode: o.oneOf(["incell", "inline", "popup"])
|
|
1180
|
+
})
|
|
1181
|
+
]),
|
|
1172
1182
|
size: o.oneOf(["small", "medium"])
|
|
1173
|
-
}, z.contextType =
|
|
1174
|
-
let
|
|
1175
|
-
|
|
1183
|
+
}, z.contextType = B;
|
|
1184
|
+
let U = z;
|
|
1185
|
+
ht(U);
|
|
1176
1186
|
export {
|
|
1177
|
-
|
|
1187
|
+
U as Grid
|
|
1178
1188
|
};
|