@progress/kendo-react-grid 8.2.0-develop.9 → 8.2.1-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Grid.js +1 -1
- package/Grid.mjs +193 -185
- package/cells/GridEditCell.js +1 -1
- package/cells/GridEditCell.mjs +27 -27
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/header/FilterRow.js +1 -1
- package/header/FilterRow.mjs +1 -1
- package/header/Header.js +1 -1
- package/header/Header.mjs +8 -6
- package/index.d.mts +27 -9
- package/index.d.ts +27 -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,8 +8,8 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as r from "react";
|
|
10
10
|
import o from "prop-types";
|
|
11
|
-
import { RowHeightService as re, getScrollbarWidth as
|
|
12
|
-
import {
|
|
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
13
|
import { GridSelectionCell as et } from "./cells/GridSelectionCell.mjs";
|
|
14
14
|
import { GridHierarchyCell as tt } from "./cells/GridHierarchyCell.mjs";
|
|
15
15
|
import { GridEditCell as st } from "./cells/GridEditCell.mjs";
|
|
@@ -24,22 +24,22 @@ import { VirtualScroll as ct } from "./VirtualScroll.mjs";
|
|
|
24
24
|
import { VirtualScrollFixed as ge } from "./VirtualScrollFixed.mjs";
|
|
25
25
|
import { ColumnResize as ut } from "./drag/ColumnResize.mjs";
|
|
26
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
|
|
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
28
|
import { GridCell as Rt } from "./cells/GridCell.mjs";
|
|
29
29
|
import { GridGroupCell as ve } from "./cells/GridGroupCell.mjs";
|
|
30
|
-
import { GridRow as
|
|
31
|
-
import { GridHeaderSelectionCell as
|
|
32
|
-
import { GridNoRecords as
|
|
30
|
+
import { GridRow as wt } from "./rows/GridRow.mjs";
|
|
31
|
+
import { GridHeaderSelectionCell as yt } from "./header/GridHeaderSelectionCell.mjs";
|
|
32
|
+
import { GridNoRecords as Et } from "./GridNoRecords.mjs";
|
|
33
33
|
import { operators as Ce } from "./filterCommon.mjs";
|
|
34
|
-
import { FooterRow as
|
|
35
|
-
import { normalize as
|
|
34
|
+
import { FooterRow as St } from "./footer/FooterRow.mjs";
|
|
35
|
+
import { normalize as It } from "./paging/GridPagerSettings.mjs";
|
|
36
36
|
import { packageMetadata as Re } from "./package-metadata.mjs";
|
|
37
|
-
import { GridDetailCell as
|
|
38
|
-
import { GridDetailHierarchyCell as
|
|
39
|
-
import { SAFARI_REGEX as
|
|
37
|
+
import { GridDetailCell as kt } from "./cells/GridDetailCell.mjs";
|
|
38
|
+
import { GridDetailHierarchyCell as _t } from "./cells/GridDetailHierarchyCell.mjs";
|
|
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._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.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,25 +101,27 @@ 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.getCachedScrollbarWidth = () => (this._scrollbarWidth || (this._scrollbarWidth =
|
|
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;
|
|
114
114
|
const t = e.currentTarget.scrollLeft, s = e.currentTarget.scrollTop;
|
|
115
115
|
this.props.columnVirtualization && (!this.vs.scrollableVirtual || s === this.wrapperScrollTop) && (this.forceUpdateTimeout = window.setTimeout(() => {
|
|
116
116
|
this.forceUpdate();
|
|
117
|
-
}, 0)), this._header && this._header.setScrollLeft(t), this._footer && this._footer.setScrollLeft(t), this.vs && s !== this.wrapperScrollTop && this.vs.scrollHandler(e),
|
|
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 = Ke(this.document), t = e ? e.matches(".k-table-td") ? 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 =
|
|
304
|
+
}), this.flatData = E((e, t, s, l, h, n, d) => {
|
|
302
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((
|
|
316
|
+
const l = e.filter((h) => h && h.type && h.type.displayName === "KendoReactGridColumn");
|
|
314
317
|
return ft(l, this.columns, { prevId: 0, idPrefix: t });
|
|
315
318
|
}
|
|
316
|
-
), this.mapColumns =
|
|
319
|
+
), this.mapColumns = E(
|
|
317
320
|
(e, t) => $e(e, !0)
|
|
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 = w((e, t, s) => {
|
|
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 || et, n.headerCell = n.headerCell ||
|
|
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,13 +341,13 @@ 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
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,
|
|
@@ -364,9 +355,9 @@ const z = class z extends r.Component {
|
|
|
364
355
|
cell: ve,
|
|
365
356
|
field: "value",
|
|
366
357
|
locked: this.props.lockGroups
|
|
367
|
-
}),
|
|
368
|
-
e.slice(
|
|
369
|
-
}), this.getHeaderRow =
|
|
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(
|
|
370
361
|
ot,
|
|
371
362
|
{
|
|
372
363
|
cells: this.props.cells,
|
|
@@ -376,33 +367,40 @@ 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)
|
|
@@ -454,7 +452,7 @@ 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((
|
|
455
|
+
const a = this._columns.filter((p) => p.declarationIndex >= 0 && p.parentIndex === -1);
|
|
458
456
|
return bt(a);
|
|
459
457
|
}
|
|
460
458
|
/**
|
|
@@ -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(
|
|
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());
|
|
482
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.getCachedScrollbarWidth()), 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,14 +539,14 @@ 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),
|
|
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(
|
|
548
550
|
at,
|
|
549
551
|
{
|
|
550
552
|
group: this.props.group || [],
|
|
@@ -557,7 +559,7 @@ const z = class z extends r.Component {
|
|
|
557
559
|
ariaControls: this._gridId,
|
|
558
560
|
onContextMenu: this.onContextMenu
|
|
559
561
|
}
|
|
560
|
-
), { sort:
|
|
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(
|
|
561
563
|
it,
|
|
562
564
|
{
|
|
563
565
|
size: this.props.size,
|
|
@@ -568,16 +570,17 @@ const z = class z extends r.Component {
|
|
|
568
570
|
draggable: this.props.reorderable || n,
|
|
569
571
|
ref: this.headerRef,
|
|
570
572
|
elemRef: this.headerElementRef,
|
|
573
|
+
className: this.props.headerClassName,
|
|
571
574
|
headerRow: this.getHeaderRow(
|
|
572
|
-
ye,
|
|
573
|
-
Se,
|
|
574
575
|
we,
|
|
576
|
+
ye,
|
|
577
|
+
Ee,
|
|
575
578
|
n,
|
|
579
|
+
Se,
|
|
576
580
|
Ie,
|
|
577
581
|
ke,
|
|
578
|
-
Ee,
|
|
579
|
-
xe,
|
|
580
582
|
_e,
|
|
583
|
+
xe,
|
|
581
584
|
ze,
|
|
582
585
|
this._columns,
|
|
583
586
|
this._columnsMap,
|
|
@@ -595,6 +598,7 @@ const z = class z extends r.Component {
|
|
|
595
598
|
sort: this.props.sort,
|
|
596
599
|
cellRender: this.props.filterCellRender,
|
|
597
600
|
isRtl: this.isRtl,
|
|
601
|
+
navigatable: !!this.props.navigatable,
|
|
598
602
|
ariaRowIndex: this._columnsMap.length + 1
|
|
599
603
|
}
|
|
600
604
|
) || void 0,
|
|
@@ -602,46 +606,46 @@ const z = class z extends r.Component {
|
|
|
602
606
|
"col",
|
|
603
607
|
{
|
|
604
608
|
key: g.toString(),
|
|
605
|
-
width:
|
|
609
|
+
width: V(i)
|
|
606
610
|
}
|
|
607
611
|
))
|
|
608
612
|
}
|
|
609
|
-
),
|
|
613
|
+
), Te = this.vs && this.vs.container && this.vs.container.scrollLeft || 0, De = parseFloat(((this.props.style || {}).width || "").toString()), { colSpans: He, hiddenColumns: Ne } = Je({
|
|
610
614
|
enabled: this.props.columnVirtualization,
|
|
611
615
|
columns: C,
|
|
612
|
-
tableViewPortWidth:
|
|
613
|
-
scrollLeft:
|
|
614
|
-
}),
|
|
615
|
-
let
|
|
616
|
-
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;
|
|
617
621
|
return {
|
|
618
622
|
row: C.map((u, b) => {
|
|
619
|
-
if (
|
|
623
|
+
if (Ne[b])
|
|
620
624
|
return null;
|
|
621
|
-
const H = u.id ? u.id : b,
|
|
622
|
-
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;
|
|
623
627
|
if (u.editable && this.props.editField) {
|
|
624
628
|
const v = be(this.props.editField, i.dataItem);
|
|
625
|
-
v && (v === !0 || v === u.field) && (
|
|
629
|
+
v && (v === !0 || v === u.field) && (k = !0, y = !0);
|
|
626
630
|
}
|
|
627
|
-
const W = u.cell ||
|
|
631
|
+
const W = u.cell || y && st || Rt, A = this.props.expandField && this.props.detail && u.field === this.props.expandField;
|
|
628
632
|
return /* @__PURE__ */ r.createElement(
|
|
629
633
|
W,
|
|
630
634
|
{
|
|
631
635
|
onContextMenu: this.onContextMenu,
|
|
632
636
|
key: H,
|
|
633
637
|
locked: this.props.lockGroups,
|
|
634
|
-
id:
|
|
638
|
+
id: x.generateNavigatableId(
|
|
635
639
|
`${g}-${String(b)}`,
|
|
636
|
-
|
|
637
|
-
|
|
640
|
+
p,
|
|
641
|
+
A || i.rowType === "groupHeader" || i.rowType === "groupFooter" || u.field === "value" ? "nodata" : "cell"
|
|
638
642
|
),
|
|
639
643
|
colSpan: He[b],
|
|
640
644
|
dataItem: i.dataItem,
|
|
641
645
|
field: u.field,
|
|
642
646
|
editor: u.editor,
|
|
643
647
|
format: u.format,
|
|
644
|
-
className:
|
|
648
|
+
className: N,
|
|
645
649
|
render: this.props.cellRender,
|
|
646
650
|
cells: Ct(this.props.cells, u.cells),
|
|
647
651
|
onChange: this.itemChange,
|
|
@@ -654,14 +658,14 @@ const z = class z extends r.Component {
|
|
|
654
658
|
level: i.level,
|
|
655
659
|
expanded: i.expanded,
|
|
656
660
|
dataIndex: i.dataIndex,
|
|
657
|
-
style:
|
|
661
|
+
style: w,
|
|
658
662
|
ariaColumnIndex: u.ariaColumnIndex,
|
|
659
|
-
isSelected: Array.isArray(
|
|
663
|
+
isSelected: Array.isArray(S) && S.indexOf(b) > -1
|
|
660
664
|
}
|
|
661
665
|
);
|
|
662
666
|
}),
|
|
663
|
-
isInEdit:
|
|
664
|
-
isSelected: typeof
|
|
667
|
+
isInEdit: k,
|
|
668
|
+
isSelected: typeof S == "boolean" && S
|
|
665
669
|
};
|
|
666
670
|
};
|
|
667
671
|
let j = 0;
|
|
@@ -675,52 +679,52 @@ const z = class z extends r.Component {
|
|
|
675
679
|
}
|
|
676
680
|
const q = (i) => i >= this._data.length - j;
|
|
677
681
|
let J = this.vs.realSkip || 0;
|
|
678
|
-
const
|
|
682
|
+
const O = [];
|
|
679
683
|
let K = !1;
|
|
680
684
|
const X = this._columnsMap.length + (this.props.filterable ? 1 : 0) + 1;
|
|
681
|
-
let
|
|
685
|
+
let D = 0;
|
|
682
686
|
if (this._data.length) {
|
|
683
687
|
let i = -1, g = 0;
|
|
684
|
-
(this._slicedData || this._data).forEach((m,
|
|
688
|
+
(this._slicedData || this._data).forEach((m, k) => {
|
|
685
689
|
m.rowType === "data" && (J++, i++);
|
|
686
|
-
const
|
|
687
|
-
if (
|
|
688
|
-
|
|
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,
|
|
689
693
|
{
|
|
690
694
|
key: H,
|
|
691
695
|
dataItem: m.dataItem,
|
|
692
|
-
isAltRow:
|
|
693
|
-
isInEdit:
|
|
696
|
+
isAltRow: S,
|
|
697
|
+
isInEdit: w.isInEdit,
|
|
694
698
|
rowType: m.rowType,
|
|
695
|
-
isHidden: q(
|
|
696
|
-
onClick: (
|
|
697
|
-
onDoubleClick: (
|
|
699
|
+
isHidden: q(k),
|
|
700
|
+
onClick: (y) => this.rowClick(y, m),
|
|
701
|
+
onDoubleClick: (y) => this.rowDblClick(y, m),
|
|
698
702
|
selectedField: this.props.selectedField,
|
|
699
703
|
rowHeight: this.props.rowHeight,
|
|
700
704
|
render: this.props.rowRender,
|
|
701
|
-
ariaRowIndex:
|
|
705
|
+
ariaRowIndex: D,
|
|
702
706
|
absoluteRowIndex: b,
|
|
703
707
|
dataIndex: this.vs.scrollableVirtual && !this.props.groupable ? b : i,
|
|
704
|
-
isSelected:
|
|
708
|
+
isSelected: w.isSelected
|
|
705
709
|
},
|
|
706
|
-
|
|
710
|
+
w.row
|
|
707
711
|
)), this.props.detail && m.rowType === "data" && m.expanded) {
|
|
708
|
-
const
|
|
709
|
-
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(
|
|
710
714
|
"tr",
|
|
711
715
|
{
|
|
712
|
-
key:
|
|
713
|
-
className:
|
|
716
|
+
key: N,
|
|
717
|
+
className: L(
|
|
714
718
|
"k-table-row",
|
|
715
|
-
|
|
719
|
+
S ? "k-detail-row k-table-alt-row k-alt" : "k-detail-row"
|
|
716
720
|
),
|
|
717
|
-
style: { visibility: q(
|
|
721
|
+
style: { visibility: q(k) ? "hidden" : "", height: this.props.detailRowHeight },
|
|
718
722
|
role: "row",
|
|
719
|
-
"aria-rowindex":
|
|
723
|
+
"aria-rowindex": D
|
|
720
724
|
},
|
|
721
|
-
this.props.group && this.props.group.map((W,
|
|
725
|
+
this.props.group && this.props.group.map((W, A) => {
|
|
722
726
|
var oe;
|
|
723
|
-
const v = (oe =
|
|
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 } : {};
|
|
724
728
|
return /* @__PURE__ */ r.createElement(
|
|
725
729
|
ve,
|
|
726
730
|
{
|
|
@@ -728,9 +732,9 @@ const z = class z extends r.Component {
|
|
|
728
732
|
dataIndex: m.dataIndex,
|
|
729
733
|
field: W.field,
|
|
730
734
|
dataItem: m.dataItem,
|
|
731
|
-
key:
|
|
732
|
-
style:
|
|
733
|
-
ariaColumnIndex: 1 +
|
|
735
|
+
key: A,
|
|
736
|
+
style: Oe,
|
|
737
|
+
ariaColumnIndex: 1 + A,
|
|
734
738
|
isSelected: !1,
|
|
735
739
|
locked: this.props.lockGroups,
|
|
736
740
|
isRtl: this.isRtl,
|
|
@@ -739,21 +743,21 @@ const z = class z extends r.Component {
|
|
|
739
743
|
);
|
|
740
744
|
}),
|
|
741
745
|
this.props.expandField && /* @__PURE__ */ r.createElement(
|
|
742
|
-
|
|
746
|
+
_t,
|
|
743
747
|
{
|
|
744
|
-
id:
|
|
748
|
+
id: x.generateNavigatableId(`${N}-dhcell`, p)
|
|
745
749
|
}
|
|
746
750
|
),
|
|
747
751
|
/* @__PURE__ */ r.createElement(
|
|
748
|
-
|
|
752
|
+
kt,
|
|
749
753
|
{
|
|
750
754
|
onContextMenu: this.onContextMenu,
|
|
751
755
|
dataItem: m.dataItem,
|
|
752
756
|
dataIndex: m.dataIndex,
|
|
753
|
-
colSpan:
|
|
757
|
+
colSpan: y,
|
|
754
758
|
ariaColIndex: 2 + (this.props.group ? this.props.group.length : 0),
|
|
755
759
|
detail: this.props.detail,
|
|
756
|
-
id:
|
|
760
|
+
id: x.generateNavigatableId(`${N}-dcell`, p)
|
|
757
761
|
}
|
|
758
762
|
)
|
|
759
763
|
));
|
|
@@ -761,7 +765,7 @@ const z = class z extends r.Component {
|
|
|
761
765
|
});
|
|
762
766
|
} else
|
|
763
767
|
K = !0;
|
|
764
|
-
const
|
|
768
|
+
const Fe = () => {
|
|
765
769
|
const i = this._header;
|
|
766
770
|
return i && i.table && i.table.clientWidth;
|
|
767
771
|
}, Y = () => /* @__PURE__ */ r.createElement(
|
|
@@ -769,9 +773,9 @@ const z = class z extends r.Component {
|
|
|
769
773
|
{
|
|
770
774
|
key: "no-records",
|
|
771
775
|
className: "k-grid-norecords",
|
|
772
|
-
style: { width:
|
|
776
|
+
style: { width: Fe() }
|
|
773
777
|
},
|
|
774
|
-
/* @__PURE__ */ r.createElement("div", { className: "k-grid-norecords-template", [Ze]:
|
|
778
|
+
/* @__PURE__ */ r.createElement("div", { className: "k-grid-norecords-template", [Ze]: x.generateNavigatableId("no-records", p) }, I.length ? I : /* @__PURE__ */ r.createElement(Et, null))
|
|
775
779
|
), Q = {
|
|
776
780
|
size: this.props.size,
|
|
777
781
|
onPageChange: this.pagerPageChange,
|
|
@@ -780,13 +784,12 @@ const z = class z extends r.Component {
|
|
|
780
784
|
skip: this.vs.propsSkip || 0,
|
|
781
785
|
take: (this.props.take !== void 0 ? this.props.take : this.props.pageSize) || 10,
|
|
782
786
|
messagesMap: pt,
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
}, Z = this.props.pager ? /* @__PURE__ */ r.createElement(this.props.pager, { ...Q }) : /* @__PURE__ */ r.createElement(Xe, { className: "k-grid-pager", ...Q }), Me = (i) => this.props.sort && this.props.sort.filter((g) => g.field === i).length > 0, Ae = (i, g) => /* @__PURE__ */ r.createElement(
|
|
787
|
+
...It(this.props.pageable || {})
|
|
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(
|
|
786
789
|
"col",
|
|
787
790
|
{
|
|
788
791
|
key: g.toString(),
|
|
789
|
-
width:
|
|
792
|
+
width: V(i)
|
|
790
793
|
}
|
|
791
794
|
), ee = (ie = this.props.cells) != null && ie.footerCell || this._columns.some(
|
|
792
795
|
(i) => {
|
|
@@ -802,16 +805,16 @@ const z = class z extends r.Component {
|
|
|
802
805
|
hasScrollbarWidth: !!this.getCachedScrollbarWidth(),
|
|
803
806
|
ref: (i) => this._footer = i,
|
|
804
807
|
row: /* @__PURE__ */ r.createElement(
|
|
805
|
-
|
|
808
|
+
St,
|
|
806
809
|
{
|
|
807
810
|
cells: this.props.cells,
|
|
808
|
-
idPrefix:
|
|
811
|
+
idPrefix: p,
|
|
809
812
|
columns: this._columns,
|
|
810
813
|
isRtl: this.isRtl,
|
|
811
|
-
ariaRowIndex:
|
|
814
|
+
ariaRowIndex: D + 1
|
|
812
815
|
}
|
|
813
816
|
),
|
|
814
|
-
cols: C.map(
|
|
817
|
+
cols: C.map(Me)
|
|
815
818
|
}
|
|
816
819
|
) : null, te = /* @__PURE__ */ r.createElement(
|
|
817
820
|
"colgroup",
|
|
@@ -825,23 +828,23 @@ const z = class z extends r.Component {
|
|
|
825
828
|
"col",
|
|
826
829
|
{
|
|
827
830
|
key: g.toString(),
|
|
828
|
-
className:
|
|
829
|
-
width:
|
|
831
|
+
className: Le(i.field) ? "k-sorted" : void 0,
|
|
832
|
+
width: V(i)
|
|
830
833
|
}
|
|
831
834
|
)
|
|
832
835
|
)
|
|
833
836
|
), se = this.dragLogic.reorderable || this.dragLogic.groupable;
|
|
834
837
|
if (this.props.scrollable === "none")
|
|
835
|
-
return /* @__PURE__ */ r.createElement(
|
|
838
|
+
return /* @__PURE__ */ r.createElement(B.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ r.createElement(
|
|
836
839
|
"div",
|
|
837
840
|
{
|
|
838
841
|
id: this.props.id,
|
|
839
842
|
style: this.props.style,
|
|
840
|
-
className:
|
|
843
|
+
className: L(
|
|
841
844
|
"k-grid",
|
|
842
845
|
{
|
|
843
846
|
"k-grid-md": !this.props.size,
|
|
844
|
-
[`k-grid-${
|
|
847
|
+
[`k-grid-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
845
848
|
},
|
|
846
849
|
this.props.className
|
|
847
850
|
),
|
|
@@ -854,7 +857,7 @@ const z = class z extends r.Component {
|
|
|
854
857
|
...ne
|
|
855
858
|
},
|
|
856
859
|
R,
|
|
857
|
-
|
|
860
|
+
M,
|
|
858
861
|
/* @__PURE__ */ r.createElement(
|
|
859
862
|
he,
|
|
860
863
|
{
|
|
@@ -868,32 +871,32 @@ const z = class z extends r.Component {
|
|
|
868
871
|
"table",
|
|
869
872
|
{
|
|
870
873
|
ref: (i) => this.headTable = i,
|
|
871
|
-
className:
|
|
874
|
+
className: L(
|
|
872
875
|
"k-table k-grid-table",
|
|
873
|
-
{ [`k-table-${
|
|
876
|
+
{ [`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size }
|
|
874
877
|
),
|
|
875
878
|
style: { userSelect: d }
|
|
876
879
|
},
|
|
877
880
|
te,
|
|
878
881
|
$,
|
|
879
|
-
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...pe },
|
|
882
|
+
/* @__PURE__ */ r.createElement("tbody", { role: "rowgroup", className: "k-table-tbody", ...pe }, O),
|
|
880
883
|
ee
|
|
881
884
|
)
|
|
882
885
|
),
|
|
883
886
|
K && Y(),
|
|
884
887
|
se && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(de, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(ce, { ref: this.dragLogic.refDragElementClue }))
|
|
885
|
-
),
|
|
886
|
-
let
|
|
887
|
-
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(
|
|
888
891
|
"div",
|
|
889
892
|
{
|
|
890
893
|
id: this.props.id,
|
|
891
|
-
style:
|
|
892
|
-
className:
|
|
894
|
+
style: P,
|
|
895
|
+
className: L(
|
|
893
896
|
"k-grid",
|
|
894
897
|
{
|
|
895
898
|
"k-grid-md": !this.props.size,
|
|
896
|
-
[`k-grid-${
|
|
899
|
+
[`k-grid-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size,
|
|
897
900
|
"k-grid-virtual": s
|
|
898
901
|
},
|
|
899
902
|
this.props.className
|
|
@@ -907,7 +910,7 @@ const z = class z extends r.Component {
|
|
|
907
910
|
...ne
|
|
908
911
|
},
|
|
909
912
|
R,
|
|
910
|
-
|
|
913
|
+
M,
|
|
911
914
|
/* @__PURE__ */ r.createElement(
|
|
912
915
|
"div",
|
|
913
916
|
{
|
|
@@ -940,11 +943,11 @@ const z = class z extends r.Component {
|
|
|
940
943
|
"table",
|
|
941
944
|
{
|
|
942
945
|
ref: (i) => this.tableElement = i,
|
|
943
|
-
className:
|
|
946
|
+
className: L(
|
|
944
947
|
"k-table k-grid-table",
|
|
945
948
|
{
|
|
946
949
|
"k-table-md": !this.props.size,
|
|
947
|
-
[`k-table-${
|
|
950
|
+
[`k-table-${G.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
948
951
|
}
|
|
949
952
|
),
|
|
950
953
|
role: "presentation",
|
|
@@ -959,7 +962,7 @@ const z = class z extends r.Component {
|
|
|
959
962
|
role: "rowgroup",
|
|
960
963
|
...pe
|
|
961
964
|
},
|
|
962
|
-
|
|
965
|
+
O
|
|
963
966
|
)
|
|
964
967
|
)
|
|
965
968
|
), K && Y()),
|
|
@@ -972,9 +975,9 @@ const z = class z extends r.Component {
|
|
|
972
975
|
)),
|
|
973
976
|
ee,
|
|
974
977
|
se && /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(de, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ r.createElement(ce, { ref: this.dragLogic.refDragElementClue })),
|
|
975
|
-
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(
|
|
978
|
+
this.showLicenseWatermark && /* @__PURE__ */ r.createElement(Ue, null)
|
|
976
979
|
),
|
|
977
|
-
|
|
980
|
+
T,
|
|
978
981
|
this.props.pageable && Z
|
|
979
982
|
));
|
|
980
983
|
}
|
|
@@ -983,8 +986,8 @@ const z = class z extends r.Component {
|
|
|
983
986
|
}
|
|
984
987
|
selectionChange(a) {
|
|
985
988
|
if (this.props.onSelectionChange) {
|
|
986
|
-
const { event:
|
|
987
|
-
...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),
|
|
988
991
|
dataItem: c,
|
|
989
992
|
startColIndex: t,
|
|
990
993
|
endColIndex: t,
|
|
@@ -1001,13 +1004,13 @@ const z = class z extends r.Component {
|
|
|
1001
1004
|
componentId: this._gridId,
|
|
1002
1005
|
selectedField: this.props.selectedField || ""
|
|
1003
1006
|
};
|
|
1004
|
-
this.props.onSelectionChange.call(void 0,
|
|
1007
|
+
this.props.onSelectionChange.call(void 0, h);
|
|
1005
1008
|
}
|
|
1006
1009
|
}
|
|
1007
|
-
raiseDataEvent(a,
|
|
1010
|
+
raiseDataEvent(a, p, c, e, t) {
|
|
1008
1011
|
const s = this.props.onDataStateChange;
|
|
1009
1012
|
if (a) {
|
|
1010
|
-
const l = { ...this.getArguments(e), ...
|
|
1013
|
+
const l = { ...this.getArguments(e), ...p, targetEvent: t };
|
|
1011
1014
|
a.call(void 0, l);
|
|
1012
1015
|
} else
|
|
1013
1016
|
s && s.call(
|
|
@@ -1022,16 +1025,16 @@ const z = class z extends r.Component {
|
|
|
1022
1025
|
}
|
|
1023
1026
|
);
|
|
1024
1027
|
}
|
|
1025
|
-
columnReorder(a,
|
|
1028
|
+
columnReorder(a, p, c) {
|
|
1026
1029
|
const e = this._columns[a], t = e.depth, s = (d) => {
|
|
1027
1030
|
do
|
|
1028
1031
|
d++;
|
|
1029
1032
|
while (d < this._columns.length && this._columns[d].depth > t);
|
|
1030
1033
|
return d;
|
|
1031
1034
|
}, l = this._columns.splice(a, s(a) - a);
|
|
1032
|
-
this._columns.splice(a <
|
|
1033
|
-
const
|
|
1034
|
-
Ye(this._columnsMap, this._columns,
|
|
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);
|
|
1035
1038
|
const n = this.columns;
|
|
1036
1039
|
if (this.forceUpdate(), this.props.onColumnReorder) {
|
|
1037
1040
|
const d = {
|
|
@@ -1043,39 +1046,39 @@ const z = class z extends r.Component {
|
|
|
1043
1046
|
this.props.onColumnReorder.call(void 0, d);
|
|
1044
1047
|
}
|
|
1045
1048
|
}
|
|
1046
|
-
groupReorder(a,
|
|
1049
|
+
groupReorder(a, p, c) {
|
|
1047
1050
|
if (this.props.group === void 0)
|
|
1048
1051
|
return;
|
|
1049
1052
|
const e = this.props.group.slice();
|
|
1050
|
-
e.splice(
|
|
1053
|
+
e.splice(p, 0, ...e.splice(a, 1)), this.groupChange(e, c);
|
|
1051
1054
|
}
|
|
1052
|
-
columnToGroup(a,
|
|
1055
|
+
columnToGroup(a, p, c) {
|
|
1053
1056
|
const e = this._columns[a].field;
|
|
1054
1057
|
if (!e)
|
|
1055
1058
|
return;
|
|
1056
1059
|
const t = (this.props.group || []).slice();
|
|
1057
|
-
t.splice(
|
|
1060
|
+
t.splice(p, 0, { field: e }), this.groupChange(t, c);
|
|
1058
1061
|
}
|
|
1059
|
-
columnGroupChange(a,
|
|
1062
|
+
columnGroupChange(a, p) {
|
|
1060
1063
|
const c = this.dragLogic.getCurrentGroupsLength;
|
|
1061
|
-
this.columnToGroup(a, c,
|
|
1064
|
+
this.columnToGroup(a, c, p);
|
|
1062
1065
|
}
|
|
1063
1066
|
resetTableWidth() {
|
|
1064
1067
|
let a = 0;
|
|
1065
1068
|
if (!this.columnResize.colGroupMain)
|
|
1066
1069
|
return;
|
|
1067
|
-
const
|
|
1068
|
-
for (let c = 0; c <
|
|
1069
|
-
const e =
|
|
1070
|
+
const p = this.columnResize.colGroupMain.children;
|
|
1071
|
+
for (let c = 0; c < p.length; c++) {
|
|
1072
|
+
const e = p[c].width;
|
|
1070
1073
|
if (!e)
|
|
1071
1074
|
return;
|
|
1072
1075
|
a += parseFloat(e.toString());
|
|
1073
1076
|
}
|
|
1074
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");
|
|
1075
1078
|
}
|
|
1076
|
-
initColumns(a,
|
|
1077
|
-
const c =
|
|
1078
|
-
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;
|
|
1079
1082
|
}
|
|
1080
1083
|
getDataState() {
|
|
1081
1084
|
return {
|
|
@@ -1170,11 +1173,16 @@ z.displayName = "KendoReactGrid", z.defaultProps = {
|
|
|
1170
1173
|
onColumnResize: o.func,
|
|
1171
1174
|
onColumnReorder: o.func,
|
|
1172
1175
|
dataItemKey: o.string,
|
|
1173
|
-
navigatable: o.
|
|
1176
|
+
navigatable: o.oneOfType([
|
|
1177
|
+
o.bool,
|
|
1178
|
+
o.shape({
|
|
1179
|
+
mode: o.oneOf(["incell", "inline", "popup"])
|
|
1180
|
+
})
|
|
1181
|
+
]),
|
|
1174
1182
|
size: o.oneOf(["small", "medium"])
|
|
1175
|
-
}, z.contextType =
|
|
1176
|
-
let
|
|
1177
|
-
ht(
|
|
1183
|
+
}, z.contextType = B;
|
|
1184
|
+
let U = z;
|
|
1185
|
+
ht(U);
|
|
1178
1186
|
export {
|
|
1179
|
-
|
|
1187
|
+
U as Grid
|
|
1180
1188
|
};
|