@progress/kendo-vue-grid 8.1.0-develop.2 → 8.1.0-develop.3
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.d.ts +56 -5
- package/Grid.js +1 -1
- package/Grid.mjs +667 -649
- package/GridNav.d.ts +24 -4
- package/GridNav.js +1 -1
- package/GridNav.mjs +62 -22
- package/GridState.d.ts +4 -0
- package/RootGrid.d.ts +32 -11
- package/RootGrid.js +1 -1
- package/RootGrid.mjs +96 -57
- package/cells/GridCell.js +1 -1
- package/cells/GridCell.mjs +35 -26
- package/cells/GridGroupCell.d.ts +10 -0
- package/cells/GridGroupCell.js +1 -1
- package/cells/GridGroupCell.mjs +95 -53
- package/columnMenu/GridColumnMenuCheckboxFilter.d.ts +1 -1
- package/columnMenu/GridColumnMenuCheckboxFilter.js +1 -1
- package/columnMenu/GridColumnMenuCheckboxFilter.mjs +11 -11
- package/common.d.ts +2 -0
- package/common.js +1 -1
- package/common.mjs +2 -0
- package/components/StickyGroupTable.d.ts +85 -0
- package/components/StickyGroupTable.js +8 -0
- package/components/StickyGroupTable.mjs +113 -0
- package/dist/cdn/js/kendo-vue-grid.js +1 -1
- package/drag/ColumnResize.d.ts +10 -1
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +129 -104
- package/drag/GroupingIndicator.d.ts +1 -0
- package/drag/GroupingIndicator.js +1 -1
- package/drag/GroupingIndicator.mjs +28 -18
- package/footer/FooterCell.d.ts +43 -0
- package/footer/FooterCell.js +8 -0
- package/footer/FooterCell.mjs +68 -0
- package/footer/FooterRow.d.ts +5 -6
- package/footer/FooterRow.js +1 -1
- package/footer/FooterRow.mjs +16 -39
- package/getRowContents.d.ts +85 -0
- package/getRowContents.js +8 -0
- package/getRowContents.mjs +172 -0
- package/header/GridHeaderGroupSpacerCell.d.ts +11 -0
- package/hooks/useStickyGroups.d.ts +72 -0
- package/hooks/useStickyGroups.js +8 -0
- package/hooks/useStickyGroups.mjs +350 -0
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +74 -73
- package/interfaces/GridCellProps.d.ts +4 -0
- package/interfaces/GridCellsSettings.d.ts +320 -0
- package/interfaces/GridColumnProps.d.ts +11 -1
- package/interfaces/GridGroupableSettings.d.ts +23 -0
- package/interfaces/GridProps.d.ts +33 -0
- package/messages/main.d.ts +5 -0
- package/messages/main.js +2 -2
- package/messages/main.mjs +15 -13
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -12
- package/utils/main.js +1 -1
- package/utils/main.mjs +80 -76
package/Grid.mjs
CHANGED
|
@@ -5,48 +5,49 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import { isObject as
|
|
10
|
-
import { tableKeyboardNavigationTools as
|
|
11
|
-
import { Loader as
|
|
12
|
-
import { GridNav as
|
|
13
|
-
import { GridSelectionCell as
|
|
14
|
-
import { GridHierarchyCell as
|
|
15
|
-
import { GridDetailHierarchyCell as
|
|
16
|
-
import { GridDetailCell as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
|
|
8
|
+
import { defineComponent as pt, createVNode as n, h as _e, createTextVNode as ct, ref as c, inject as ut, computed as Pe, markRaw as x } from "vue";
|
|
9
|
+
import { isObject as W, cloneArray as ft, canUseDOM as B, WatermarkOverlay as gt, getter as P, getTemplate as Me, setRef as w, hasListener as M, getComponentElementRef as Ke, getRef as m, RowHeightService as mt, setScrollbarWidth as Rt, kendoThemeMaps as Ae, uGrid as Ct, isRtl as Ve, validatePackage as bt, shouldShowValidationUI as $t, getLicenseMessage as It, guid as Oe } from "@progress/kendo-vue-common";
|
|
10
|
+
import { tableKeyboardNavigationTools as H, combineFilters as vt, Pager as xt, normalize as wt, TableKeyboardNavigationProvider as Ne, updateLeft as St, updateRight as yt, groupExpandReducer as kt, detailExpandReducer as Ht, getSelectedState as We, getSelectedStateFromKeyDown as Tt, closestTagName as Be, getColumnIndex as zt, getRowIndex as Et, getDetailExpandableOptions as Gt, getSelectionOptions as Ft, getGroupExpandableOptions as Dt } from "@progress/kendo-vue-data-tools";
|
|
11
|
+
import { Loader as Lt } from "@progress/kendo-vue-indicators";
|
|
12
|
+
import { GridNav as Ue } from "./GridNav.mjs";
|
|
13
|
+
import { GridSelectionCell as je } from "./cells/GridSelectionCell.mjs";
|
|
14
|
+
import { GridHierarchyCell as ae } from "./cells/GridHierarchyCell.mjs";
|
|
15
|
+
import { GridDetailHierarchyCell as _t } from "./cells/GridDetailHierarchyCell.mjs";
|
|
16
|
+
import { GridDetailCell as Pt } from "./cells/GridDetailCell.mjs";
|
|
17
|
+
import { Header as Mt } from "./header/Header.mjs";
|
|
18
|
+
import { HeaderRow as Kt } from "./header/HeaderRow.mjs";
|
|
19
|
+
import { FilterRow as At } from "./header/FilterRow.mjs";
|
|
20
|
+
import { GroupPanel as Vt } from "./header/GroupPanel.mjs";
|
|
21
|
+
import { Footer as Ot } from "./footer/Footer.mjs";
|
|
22
|
+
import { FooterRow as Nt } from "./footer/FooterRow.mjs";
|
|
23
|
+
import { GridTable as Wt } from "./components/table/GridTable.mjs";
|
|
24
|
+
import { GridTableScrollable as Bt } from "./components/table/GridTableScrollable.mjs";
|
|
25
|
+
import { operators as qe } from "./filterCommon.mjs";
|
|
26
|
+
import { VirtualScroll as Ut } from "./VirtualScroll.mjs";
|
|
27
|
+
import { ColumnResize as jt } from "./drag/ColumnResize.mjs";
|
|
28
|
+
import { CommonDragLogic as qt } from "./drag/CommonDragLogic.mjs";
|
|
29
|
+
import { DragClue as Jt } from "./drag/DragClue.mjs";
|
|
30
|
+
import { DropClue as Qt } from "./drag/DropClue.mjs";
|
|
31
|
+
import { applyExpandedState as Xt, getColSpan as Yt, autoGenerateColumns as Zt, mapColumns as es, getFlatColumnsState as Je, getRowSpanOptions as Qe, getDataAsArray as ts, groupedFirstItemValue as ss, calcRowHeight as is, flatData as os, readColumns as rs } from "./utils/main.mjs";
|
|
32
|
+
import { GridGroupCell as ne } from "./cells/GridGroupCell.mjs";
|
|
33
|
+
import { GridRow as ls } from "./rows/GridRow.mjs";
|
|
34
|
+
import { gridProps as as } from "./common.mjs";
|
|
35
|
+
import { GridHeaderSelectionCell as Xe } from "./header/GridHeaderSelectionCell.mjs";
|
|
36
|
+
import { GridNoRecords as Ye } from "./components/noRecords/GridNoRecords.mjs";
|
|
37
|
+
import { GridNoRecordsContainer as Ze } from "./components/noRecords/GridNoRecordsContainer.mjs";
|
|
38
|
+
import { packageMetadata as de } from "./package-metadata.mjs";
|
|
39
|
+
import { pagerMessagesMap as et } from "./messages/messagesMap.mjs";
|
|
40
|
+
import { process as ns } from "@progress/kendo-data-query";
|
|
41
|
+
import { KendoKey as ds } from "./key.mjs";
|
|
42
|
+
import { getVirtualCellsToRender as hs } from "./utils/virtualColumns.mjs";
|
|
43
|
+
import { StickyGroupTable as tt } from "./components/StickyGroupTable.mjs";
|
|
44
|
+
import { getRowContents as ps } from "./getRowContents.mjs";
|
|
45
|
+
import { useStickyGroups as cs } from "./hooks/useStickyGroups.mjs";
|
|
46
|
+
const Ys = /* @__PURE__ */ pt({
|
|
46
47
|
name: "KendoGrid",
|
|
47
48
|
inheritAttrs: !1,
|
|
48
49
|
props: {
|
|
49
|
-
...
|
|
50
|
+
...as,
|
|
50
51
|
toolbar: {
|
|
51
52
|
type: Object
|
|
52
53
|
},
|
|
@@ -66,8 +67,8 @@ const rs = /* @__PURE__ */ $t({
|
|
|
66
67
|
},
|
|
67
68
|
watch: {
|
|
68
69
|
rowHeight: function(e, t) {
|
|
69
|
-
var
|
|
70
|
-
this.onRowHeightChanged(e, t), (
|
|
70
|
+
var s;
|
|
71
|
+
this.onRowHeightChanged(e, t), (s = this.vsRef) == null || s.reset();
|
|
71
72
|
},
|
|
72
73
|
scrollable: function() {
|
|
73
74
|
var e;
|
|
@@ -91,19 +92,27 @@ const rs = /* @__PURE__ */ $t({
|
|
|
91
92
|
}
|
|
92
93
|
},
|
|
93
94
|
created() {
|
|
94
|
-
|
|
95
|
+
bt(de), this.showLicenseWatermark = $t(de), this.licenseMessage = It(de), this.initialHeight = null, this.columnsRef = [], this.dragLogic = new qt(this.columnReorder.bind(this), this.groupReorder.bind(this), this.columnToGroup.bind(this)), this.columnResize = new jt(this.onResize.bind(this)), this._columnsMap = [[]], this._header = null, this._footer = null, this.tableRef = null, this.scrollHeightContainerRef = null, this.forceUpdateTimeout = void 0, this._gridId = Oe(), this._gridRoleElementId = Oe(), this.slicedCurrentData = void 0, this._prevTotal = void 0, this._containerHeightRef = 0, this._minRowHeightRef = 0, this.wrapperScrollTopRef = 0, this.scrollLeftRef = 0;
|
|
95
96
|
},
|
|
96
97
|
mounted() {
|
|
97
|
-
var t,
|
|
98
|
+
var t, s;
|
|
98
99
|
this.setRefs();
|
|
99
|
-
const e =
|
|
100
|
-
this._prevTotal = this.$props.total, this.isRtl = e, this.initialHeight = ((
|
|
100
|
+
const e = Ve(this._element);
|
|
101
|
+
if (this._prevTotal = this.$props.total, this.isRtl = e, this.initialHeight = ((s = (t = this._element) == null ? void 0 : t.style) == null ? void 0 : s.height) || null, this.resizeObserver = B && (window == null ? void 0 : window.ResizeObserver) && new ResizeObserver(this.calculateMedia), document != null && document.body && this.resizeObserver && this.resizeObserver.observe(document.body), B) {
|
|
102
|
+
const i = {
|
|
103
|
+
rootMargin: "0px",
|
|
104
|
+
threshold: 0.9
|
|
105
|
+
};
|
|
106
|
+
this.observerRef = window.IntersectionObserver && new window.IntersectionObserver(this.handleIntersection, i) || null;
|
|
107
|
+
}
|
|
101
108
|
},
|
|
102
109
|
updated() {
|
|
103
|
-
var
|
|
110
|
+
var s;
|
|
104
111
|
this.setRefs();
|
|
105
|
-
const e =
|
|
106
|
-
this.isRtl = e, this._prevTotal = this.$props.total, this.vsRef.tableTransform && this.vsRef.table && (this.vsRef.table.style.transform = this.vsRef.tableTransform, this.vsRef.tableTransform = "")
|
|
112
|
+
const e = Ve(this._element);
|
|
113
|
+
this.isRtl = e, this._prevTotal = this.$props.total, this.vsRef.tableTransform && this.vsRef.table && (this.vsRef.table.style.transform = this.vsRef.tableTransform, this.vsRef.tableTransform = "");
|
|
114
|
+
const t = this.updateStickyGroups();
|
|
115
|
+
this.sticky.headerItems = t == null ? void 0 : t.stickyHeaderItems, this.sticky.footerItems = t == null ? void 0 : t.stickyFooterItems, this.isVirtualScroll && (this.setContainerHeight(), this.setMinRowHeight(), (s = this.vsRef) == null || s.update());
|
|
107
116
|
},
|
|
108
117
|
unmounted() {
|
|
109
118
|
this.gridUnmounted();
|
|
@@ -116,19 +125,19 @@ const rs = /* @__PURE__ */ $t({
|
|
|
116
125
|
return this.$props.navigatable ? this.gridId : "";
|
|
117
126
|
},
|
|
118
127
|
groupExpandable() {
|
|
119
|
-
return
|
|
128
|
+
return Dt(typeof this.$props.groupable == "object" && this.$props.groupable.enabled !== !1 ? this.$props.groupable.expandable : this.$props.groupable);
|
|
120
129
|
},
|
|
121
130
|
hierarchClass() {
|
|
122
|
-
return
|
|
131
|
+
return Ct.hierarchyCell({});
|
|
123
132
|
},
|
|
124
133
|
computedRowSpannable() {
|
|
125
|
-
return
|
|
134
|
+
return Qe(this.$props.rowSpannable);
|
|
126
135
|
},
|
|
127
136
|
computedSelectable() {
|
|
128
|
-
return
|
|
137
|
+
return Ft(this.$props.selectable);
|
|
129
138
|
},
|
|
130
139
|
detailExpandable() {
|
|
131
|
-
return
|
|
140
|
+
return Gt(!!this.$props.detail);
|
|
132
141
|
},
|
|
133
142
|
nonscrollableWrapperClass() {
|
|
134
143
|
const {
|
|
@@ -137,7 +146,7 @@ const rs = /* @__PURE__ */ $t({
|
|
|
137
146
|
return {
|
|
138
147
|
"k-grid": !0,
|
|
139
148
|
"k-grid-md": !e,
|
|
140
|
-
[`k-grid-${
|
|
149
|
+
[`k-grid-${Ae.sizeMap[e] || e}`]: e,
|
|
141
150
|
[t]: !!t
|
|
142
151
|
};
|
|
143
152
|
},
|
|
@@ -158,7 +167,7 @@ const rs = /* @__PURE__ */ $t({
|
|
|
158
167
|
"k-table": !0,
|
|
159
168
|
"k-grid-table": !0,
|
|
160
169
|
"k-grid-md": !e,
|
|
161
|
-
[`k-table-${
|
|
170
|
+
[`k-table-${Ae.sizeMap[e] || e}`]: e
|
|
162
171
|
};
|
|
163
172
|
},
|
|
164
173
|
getCorrectHeight() {
|
|
@@ -167,7 +176,7 @@ const rs = /* @__PURE__ */ $t({
|
|
|
167
176
|
currentGroupable() {
|
|
168
177
|
var t;
|
|
169
178
|
const e = (t = this.gridContext.group) == null ? void 0 : t.value;
|
|
170
|
-
return this.$props.groupable === !0 && (e == null ? void 0 : e.length) ||
|
|
179
|
+
return this.$props.groupable === !0 && (e == null ? void 0 : e.length) || W(this.$props.groupable) && this.$props.groupable.enabled !== !1;
|
|
171
180
|
},
|
|
172
181
|
computedCollapsed() {
|
|
173
182
|
let e = [];
|
|
@@ -178,14 +187,21 @@ const rs = /* @__PURE__ */ $t({
|
|
|
178
187
|
},
|
|
179
188
|
// Calculates the value of the ariaRowcount attribute.
|
|
180
189
|
getAriaRowCount() {
|
|
190
|
+
var s, i;
|
|
181
191
|
const e = this.$props.dataItems, t = this.$props.total || (e == null ? void 0 : e.total) || (e == null ? void 0 : e.length) || 0;
|
|
182
|
-
return this.$props.detail ? this._columnsMap.length + (this.$props.filterable ? 1 : 0) + t * 2 + (this.columnsRef.some((
|
|
192
|
+
return this.$props.detail ? this._columnsMap.length + (this.$props.filterable ? 1 : 0) + t * 2 + (this.columnsRef.some((o) => {
|
|
193
|
+
var r;
|
|
194
|
+
return !!(o.footerCell || (r = o.cells) != null && r.footerCell);
|
|
195
|
+
}) || (s = this.$props.cells) != null && s.footerCell ? 1 : 0) : !this.$props.pageable && this.$props.scrollable === "scrollable" ? void 0 : this.$props.groupable ? -1 : this._columnsMap.length + (this.$props.filterable ? 1 : 0) + t + (this.columnsRef.some((o) => {
|
|
196
|
+
var r;
|
|
197
|
+
return !!(o.footerCell || (r = o.cells) != null && r.footerCell);
|
|
198
|
+
}) || (i = this.$props.cells) != null && i.footerCell ? 1 : 0);
|
|
183
199
|
},
|
|
184
200
|
// Calculates the value of the ariaColcount attribute.
|
|
185
201
|
// Based on the result of this method the ariaColIndex is rendered or not in the HeaderRow TH elements
|
|
186
202
|
getAriaColCount() {
|
|
187
|
-
const e = this.$props.columns, t = this.$props.columnVirtualization,
|
|
188
|
-
if (t ||
|
|
203
|
+
const e = this.$props.columns, t = this.$props.columnVirtualization, s = (e == null ? void 0 : e.filter((i) => i.hidden !== void 0).length) !== 0;
|
|
204
|
+
if (t || s)
|
|
189
205
|
return (e == null ? void 0 : e.length) !== 0 ? e == null ? void 0 : e.length : -1;
|
|
190
206
|
},
|
|
191
207
|
isVirtualScroll() {
|
|
@@ -193,43 +209,82 @@ const rs = /* @__PURE__ */ $t({
|
|
|
193
209
|
}
|
|
194
210
|
},
|
|
195
211
|
methods: {
|
|
212
|
+
handleIntersection(e) {
|
|
213
|
+
const t = {
|
|
214
|
+
rowIndex: this.rowIndexRef.value
|
|
215
|
+
};
|
|
216
|
+
e.forEach((s) => {
|
|
217
|
+
s.boundingClientRect.height !== s.intersectionRect.height && this.setCurrentOnTop(t);
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
scrollIntoView(e) {
|
|
221
|
+
var i;
|
|
222
|
+
if (!((i = this.vsRef) != null && i.container) || this.$props.scrollable === "none")
|
|
223
|
+
return;
|
|
224
|
+
const {
|
|
225
|
+
rowIndex: t
|
|
226
|
+
} = e;
|
|
227
|
+
this.rowIndexRef.value = t;
|
|
228
|
+
const s = this._element;
|
|
229
|
+
if (this.observerRef.value && s) {
|
|
230
|
+
this.observerRef.value.disconnect();
|
|
231
|
+
const o = s.querySelector(`[absolute-row-index="${this.rowIndexRef.value}"]`);
|
|
232
|
+
o ? this.observerRef.value.observe(o) : this.setCurrentOnTop(e);
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
setCurrentOnTop(e) {
|
|
236
|
+
var i, o;
|
|
237
|
+
if (!((i = this.vsRef) != null && i.container) || this.$props.scrollable === "none")
|
|
238
|
+
return;
|
|
239
|
+
this.observerRef.value && this.observerRef.value.disconnect();
|
|
240
|
+
const {
|
|
241
|
+
rowIndex: t
|
|
242
|
+
} = e, s = this._element;
|
|
243
|
+
if (this.isVirtualScroll) {
|
|
244
|
+
const r = ((o = this.vsRef.rowHeightService) == null ? void 0 : o.offset(t)) || 0;
|
|
245
|
+
this.vsRef.container.scroll(0, r);
|
|
246
|
+
} else if (s) {
|
|
247
|
+
const r = t < 1 ? s.querySelector("tbody > tr:nth-child(1)") : s.querySelector(`tbody > tr:nth-child(${t + 1})`);
|
|
248
|
+
r && this.containerElementRef && (this.containerElementRef.scrollTop = r.offsetTop);
|
|
249
|
+
}
|
|
250
|
+
},
|
|
196
251
|
getTotal() {
|
|
197
252
|
let e = this.$props.total || 0;
|
|
198
253
|
return Array.isArray(this.$props.dataItems) ? e = e || this.$props.dataItems.length : this.$props.dataItems && (e = e || this.$props.dataItems.total), e;
|
|
199
254
|
},
|
|
200
255
|
readColumnElements() {
|
|
201
|
-
return
|
|
256
|
+
return rs(this.$props.columns, this.currentColumnsState, {
|
|
202
257
|
prevId: 0,
|
|
203
258
|
idPrefix: this.idPrefix
|
|
204
259
|
});
|
|
205
260
|
},
|
|
206
261
|
getResolvedFlatColumnsState() {
|
|
207
|
-
const e = [], t = (
|
|
208
|
-
const
|
|
262
|
+
const e = [], t = (s, i) => s == null ? void 0 : s.forEach((o) => {
|
|
263
|
+
const r = o.hidden || i;
|
|
209
264
|
e.push({
|
|
210
|
-
...
|
|
211
|
-
hidden:
|
|
212
|
-
}), t(
|
|
265
|
+
...o,
|
|
266
|
+
hidden: r
|
|
267
|
+
}), t(o.children, r);
|
|
213
268
|
});
|
|
214
269
|
return t(this.currentColumnsState, !1), e;
|
|
215
270
|
},
|
|
216
271
|
filterColumns(e) {
|
|
217
272
|
const t = this.getResolvedFlatColumnsState();
|
|
218
|
-
return [e.filter((
|
|
219
|
-
var
|
|
220
|
-
return !
|
|
221
|
-
}), e.filter((
|
|
222
|
-
var
|
|
223
|
-
return
|
|
273
|
+
return [e.filter((s) => {
|
|
274
|
+
var i;
|
|
275
|
+
return !s.hidden && !((i = t.find((o) => o.id === s.id)) != null && i.hidden);
|
|
276
|
+
}), e.filter((s) => {
|
|
277
|
+
var i;
|
|
278
|
+
return s.hidden || ((i = t.find((o) => o.id === s.id)) == null ? void 0 : i.hidden);
|
|
224
279
|
})];
|
|
225
280
|
},
|
|
226
|
-
getFlatData(e, t,
|
|
227
|
-
const
|
|
228
|
-
index:
|
|
229
|
-
},
|
|
281
|
+
getFlatData(e, t, s, i, o, r, l) {
|
|
282
|
+
const d = [], h = os(d, e, t, {
|
|
283
|
+
index: s
|
|
284
|
+
}, i !== void 0, o, r, this.groupExpandable.defaultExpand, l, this.$props.expandField);
|
|
230
285
|
return {
|
|
231
|
-
flattedData:
|
|
232
|
-
resolvedGroupsCount:
|
|
286
|
+
flattedData: d,
|
|
287
|
+
resolvedGroupsCount: h
|
|
233
288
|
};
|
|
234
289
|
},
|
|
235
290
|
getColumnsEssentialProps(e) {
|
|
@@ -247,11 +302,11 @@ const rs = /* @__PURE__ */ $t({
|
|
|
247
302
|
filterHiddenColumns(e) {
|
|
248
303
|
if (!e || e.length === 0)
|
|
249
304
|
return e;
|
|
250
|
-
const t = (
|
|
251
|
-
...
|
|
252
|
-
children:
|
|
305
|
+
const t = (s) => ({
|
|
306
|
+
...s,
|
|
307
|
+
children: s.children && s.children.length > 0 ? this.filterHiddenColumns(s.children) : s.children
|
|
253
308
|
});
|
|
254
|
-
return [...e].filter((
|
|
309
|
+
return [...e].filter((s) => !s.hidden).filter((s) => B && s && s.media ? window.matchMedia(s.media).matches : s).map((s) => t(s));
|
|
255
310
|
},
|
|
256
311
|
/**
|
|
257
312
|
* A getter of the current columns. Gets the current column width or current columns,
|
|
@@ -261,39 +316,41 @@ const rs = /* @__PURE__ */ $t({
|
|
|
261
316
|
* and check the properties afterwards. You can check the result in the browser console.
|
|
262
317
|
*/
|
|
263
318
|
getColumns() {
|
|
264
|
-
const e = this.columnsRef.filter((
|
|
319
|
+
const e = this.columnsRef.filter((s) => s.declarationIndex >= 0 && s.parentIndex === -1), t = (s) => (s.sort((i, o) => i.declarationIndex - o.declarationIndex), s.map((i) => {
|
|
265
320
|
const {
|
|
266
|
-
declarationIndex:
|
|
267
|
-
parentIndex:
|
|
268
|
-
depth:
|
|
269
|
-
colSpan:
|
|
270
|
-
rowSpan:
|
|
271
|
-
index:
|
|
321
|
+
declarationIndex: o,
|
|
322
|
+
parentIndex: r,
|
|
323
|
+
depth: l,
|
|
324
|
+
colSpan: d,
|
|
325
|
+
rowSpan: h,
|
|
326
|
+
index: g,
|
|
272
327
|
kFirst: u,
|
|
273
|
-
children:
|
|
328
|
+
children: R,
|
|
274
329
|
...C
|
|
275
|
-
} =
|
|
276
|
-
return
|
|
277
|
-
children: t(
|
|
330
|
+
} = i;
|
|
331
|
+
return R.length ? {
|
|
332
|
+
children: t(R),
|
|
278
333
|
...C
|
|
279
334
|
} : C;
|
|
280
335
|
}));
|
|
281
336
|
return t(e);
|
|
282
337
|
},
|
|
283
338
|
setRefs() {
|
|
339
|
+
var r, l;
|
|
284
340
|
let e = "$el";
|
|
285
|
-
const t =
|
|
341
|
+
const t = m(this, "gridNav");
|
|
286
342
|
t && (this._element = t[e]);
|
|
287
|
-
const
|
|
288
|
-
if (
|
|
289
|
-
let
|
|
290
|
-
this.dragLogic.refGroupPanelDiv(
|
|
343
|
+
const s = m(this, "groupPanelDiv");
|
|
344
|
+
if (s) {
|
|
345
|
+
let d = s[e] || null;
|
|
346
|
+
this.dragLogic.refGroupPanelDiv(d);
|
|
291
347
|
}
|
|
292
|
-
|
|
293
|
-
|
|
348
|
+
this.stickyHeaderRef = m(this, "stickyHeader"), this.stickyFooterRef = m(this, "stickyFooter");
|
|
349
|
+
const i = m(this, "dropElementClue"), o = m(this, "dragElementClue");
|
|
350
|
+
this.dragLogic.refDropElementClue(i), this.dragLogic.refDragElementClue(o), this.columnResize.colGroupMain = m(this, "colGroup"), this.columnResize.colGroupStickyHeader = (r = this.stickyHeaderRef) == null ? void 0 : r.colGroupRef, this.columnResize.colGroupStickyFooter = (l = this.stickyFooterRef) == null ? void 0 : l.colGroupRef, this._header = m(this, "header"), this._footer = m(this, "footer"), this.resetTableWidth(), Rt();
|
|
294
351
|
},
|
|
295
352
|
gridUnmounted() {
|
|
296
|
-
clearTimeout(this.forceUpdateTimeout), this.columnResize.columns = [], this.dragLogic.columns = [], this.dragLogic && this.dragLogic.dragElementClue && (this.dragLogic.dragElementClue.$el.remove(), this.dragLogic.dropElementClue.$el.remove()), this.
|
|
353
|
+
clearTimeout(this.forceUpdateTimeout), this.columnResize.columns = [], this.dragLogic.columns = [], this.dragLogic && this.dragLogic.dragElementClue && (this.dragLogic.dragElementClue.$el.remove(), this.dragLogic.dropElementClue.$el.remove()), this.dataRef = [], this.columnsRef = [], document != null && document.body && this.resizeObserver && this.resizeObserver.disconnect();
|
|
297
354
|
},
|
|
298
355
|
isAllData() {
|
|
299
356
|
const {
|
|
@@ -303,23 +360,24 @@ const rs = /* @__PURE__ */ $t({
|
|
|
303
360
|
return Array.isArray(e) ? e.length === t : e ? t === e.total : !1;
|
|
304
361
|
},
|
|
305
362
|
resetVirtualSkip() {
|
|
306
|
-
this.isVirtualScroll && this.
|
|
363
|
+
this.isVirtualScroll && this.virtualSkipRef && (this.virtualSkipRef = 0);
|
|
307
364
|
},
|
|
308
365
|
virtualPageChange(e, t) {
|
|
309
366
|
var i;
|
|
310
|
-
|
|
367
|
+
const s = (i = this.gridContext.group) == null ? void 0 : i.value;
|
|
368
|
+
this.$props.pageable || s != null && s.length ? (this.virtualSkipRef = e.skip, this.$forceUpdate()) : this.pageChangeHandler(e, t);
|
|
311
369
|
},
|
|
312
370
|
initializeVirtualization() {
|
|
313
371
|
const e = this.vsRef, t = this.$props.rowHeight || this._minRowHeightRef || 0;
|
|
314
|
-
e && (e.fixedScroll = this.$props.fixedScroll || !1, e.PageChange = this.virtualPageChange, e.pageSize = this._virtualPageSize, e.scrollableVirtual = this.isVirtualScroll, e.container =
|
|
372
|
+
this.tableBodyRef = m(this, "tableBody"), this.scrollTableRef = Ke(this, "table"), e && (e.fixedScroll = this.$props.fixedScroll || !1, e.PageChange = this.virtualPageChange, e.pageSize = this._virtualPageSize, e.scrollableVirtual = this.isVirtualScroll, this.scrollContainerRef = e.container = m(this, "scrollContainer"), e.tableBody = this.tableBodyRef, e.scrollHeightContainer = m(this, "scrollHeightContainer"), e.table = this.scrollTableRef, (!e.rowHeightService || e.total !== this._virtualTotal) && t && (e.total = this._virtualTotal, e.rowHeightService = new mt(this._virtualTotal, t)));
|
|
315
373
|
},
|
|
316
374
|
setContainerHeight() {
|
|
317
|
-
const e =
|
|
375
|
+
const e = m(this, "scrollContainer");
|
|
318
376
|
this._containerHeightRef = (e == null ? void 0 : e.offsetHeight) || 0;
|
|
319
377
|
},
|
|
320
378
|
setMinRowHeight() {
|
|
321
379
|
if (!this._minRowHeightRef && !this.$props.rowHeight) {
|
|
322
|
-
const t =
|
|
380
|
+
const t = is(m(this, "tableBody"));
|
|
323
381
|
t && (this._minRowHeightRef = t, this.$forceUpdate());
|
|
324
382
|
}
|
|
325
383
|
},
|
|
@@ -327,15 +385,23 @@ const rs = /* @__PURE__ */ $t({
|
|
|
327
385
|
this.setRefs();
|
|
328
386
|
},
|
|
329
387
|
onHeaderScroll(e) {
|
|
330
|
-
const
|
|
331
|
-
|
|
388
|
+
const s = e.target.scrollLeft, i = m(this, "scrollContainer");
|
|
389
|
+
i && (i.scrollLeft = s), this.scrollLeftRef = s;
|
|
332
390
|
},
|
|
333
391
|
scrollHandler(e) {
|
|
392
|
+
var r, l;
|
|
334
393
|
clearTimeout(this.forceUpdateTimeout);
|
|
335
|
-
const t = e.currentTarget.scrollLeft,
|
|
336
|
-
this.$props.columnVirtualization && (!this.isVirtualScroll ||
|
|
394
|
+
const t = e.currentTarget.scrollLeft, s = e.currentTarget.scrollTop;
|
|
395
|
+
this.$props.columnVirtualization && (!this.isVirtualScroll || s === this.wrapperScrollTopRef) && (this.forceUpdateTimeout = setTimeout(() => {
|
|
337
396
|
this.$forceUpdate();
|
|
338
|
-
}, 0)), this.scrollLeftRef = t, this._header && this._header.setScrollLeft(e.currentTarget.scrollLeft), this._footer && this._footer.setScrollLeft(e.currentTarget.scrollLeft), this.
|
|
397
|
+
}, 0)), this.scrollLeftRef = t, this._header && this._header.setScrollLeft(e.currentTarget.scrollLeft), this._footer && this._footer.setScrollLeft(e.currentTarget.scrollLeft), this.stickyHeaderRef && this.stickyHeaderRef.setScrollLeft(e.currentTarget.scrollLeft), this.stickyFooterRef && this.stickyFooterRef.setScrollLeft(e.currentTarget.scrollLeft), this.vsRef && s !== this.wrapperScrollTopRef && this.vsRef.scrollHandler(e);
|
|
398
|
+
const i = (r = this.virtualSkipRef) == null ? void 0 : r.current;
|
|
399
|
+
this.vsRef.current && s !== this.wrapperScrollTopRef && this.vsRef.current.scrollHandler(e);
|
|
400
|
+
const o = this.isVirtualScroll && ((l = this.virtualSkipRef) == null ? void 0 : l.current) !== i;
|
|
401
|
+
if (this.$emit("scroll", e), this.wrapperScrollTopRef = s, !o) {
|
|
402
|
+
const d = this.updateStickyGroups();
|
|
403
|
+
this.sticky.headerItems = d == null ? void 0 : d.stickyHeaderItems, this.sticky.footerItems = d == null ? void 0 : d.stickyFooterItems;
|
|
404
|
+
}
|
|
339
405
|
},
|
|
340
406
|
rowClick(e, t) {
|
|
341
407
|
e.target.type !== "checkbox" && this.$emit("rowclick", {
|
|
@@ -349,29 +415,29 @@ const rs = /* @__PURE__ */ $t({
|
|
|
349
415
|
...this.getArguments(e)
|
|
350
416
|
});
|
|
351
417
|
},
|
|
352
|
-
loopGroupedItems(e, t,
|
|
353
|
-
return e.forEach((
|
|
354
|
-
!
|
|
355
|
-
}),
|
|
418
|
+
loopGroupedItems(e, t, s = 0, i = null) {
|
|
419
|
+
return e.forEach((o) => {
|
|
420
|
+
!i && t(o, s) && (i = o), o.items && o.items.length && !i && (i = this.loopGroupedItems(o.items, t, s + 1, i));
|
|
421
|
+
}), i;
|
|
356
422
|
},
|
|
357
423
|
updateGroupCollapsed(e) {
|
|
358
|
-
let t = this.computedCollapsed,
|
|
359
|
-
const
|
|
360
|
-
return
|
|
361
|
-
},
|
|
424
|
+
let t = this.computedCollapsed, s = t[e.level];
|
|
425
|
+
const i = this.$props.uniqueField, o = function(d, h) {
|
|
426
|
+
return d.value === e.dataItem.value && h === e.level;
|
|
427
|
+
}, r = this.allGroupedItems ? this.loopGroupedItems(this.allGroupedItems.data, o, 0, null) : e.dataItem, l = ss(r || e.dataItem, i);
|
|
362
428
|
if (e.value) {
|
|
363
|
-
if (
|
|
364
|
-
const
|
|
365
|
-
|
|
429
|
+
if (s && s.length) {
|
|
430
|
+
const d = s.indexOf(l);
|
|
431
|
+
d > -1 && s.splice(d, 1);
|
|
366
432
|
}
|
|
367
433
|
} else
|
|
368
|
-
|
|
434
|
+
s ? s.includes(l) || s.push(l) : s = [l];
|
|
369
435
|
return t;
|
|
370
436
|
},
|
|
371
437
|
itemChange(e) {
|
|
372
|
-
var
|
|
373
|
-
const t = M.call(this, "itemchange"),
|
|
374
|
-
if (e.field === this.$props.expandField || (
|
|
438
|
+
var i;
|
|
439
|
+
const t = M.call(this, "itemchange"), s = (i = this.gridContext.group) == null ? void 0 : i.value;
|
|
440
|
+
if (e.field === this.$props.expandField || (s || this.$props.detail) && e.field === void 0) {
|
|
375
441
|
M.call(this, "expandchange") && e.dataItem && this.$emit("expandchange", {
|
|
376
442
|
...this.getArguments(e.event),
|
|
377
443
|
collapsedGroups: this.updateGroupCollapsed(e),
|
|
@@ -420,17 +486,17 @@ const rs = /* @__PURE__ */ $t({
|
|
|
420
486
|
var t;
|
|
421
487
|
if (this.computedSelectable.enabled) {
|
|
422
488
|
const {
|
|
423
|
-
event:
|
|
424
|
-
dataItem:
|
|
425
|
-
dataIndex:
|
|
426
|
-
columnIndex:
|
|
427
|
-
} = e,
|
|
428
|
-
...this.getArguments(
|
|
429
|
-
dataItem:
|
|
430
|
-
startColIndex:
|
|
431
|
-
endColIndex:
|
|
432
|
-
startRowIndex:
|
|
433
|
-
endRowIndex:
|
|
489
|
+
event: s,
|
|
490
|
+
dataItem: i,
|
|
491
|
+
dataIndex: o,
|
|
492
|
+
columnIndex: r
|
|
493
|
+
} = e, l = {
|
|
494
|
+
...this.getArguments(s),
|
|
495
|
+
dataItem: i,
|
|
496
|
+
startColIndex: r,
|
|
497
|
+
endColIndex: r,
|
|
498
|
+
startRowIndex: o,
|
|
499
|
+
endRowIndex: o,
|
|
434
500
|
dataItems: this.getLeafDataItems(),
|
|
435
501
|
altKey: !1,
|
|
436
502
|
ctrlKey: !1,
|
|
@@ -443,9 +509,9 @@ const rs = /* @__PURE__ */ $t({
|
|
|
443
509
|
selectedField: this.$props.selectedField || ""
|
|
444
510
|
};
|
|
445
511
|
this.gridContext.selectionchange({
|
|
446
|
-
...
|
|
447
|
-
select: this.$props.dataItemKey ?
|
|
448
|
-
event:
|
|
512
|
+
...l,
|
|
513
|
+
select: this.$props.dataItemKey ? We({
|
|
514
|
+
event: l,
|
|
449
515
|
selectedState: (t = this.$props.select) != null ? t : {},
|
|
450
516
|
dataItemKey: this.$props.dataItemKey
|
|
451
517
|
}) : {}
|
|
@@ -453,36 +519,36 @@ const rs = /* @__PURE__ */ $t({
|
|
|
453
519
|
}
|
|
454
520
|
},
|
|
455
521
|
onKeyboardSelectionChangeHandler(e) {
|
|
456
|
-
var
|
|
522
|
+
var g, u;
|
|
457
523
|
if (!this.computedSelectable.enabled || !this.$props.dataItemKey)
|
|
458
524
|
return;
|
|
459
|
-
const t = (
|
|
525
|
+
const t = (g = this.gridContext.select) == null ? void 0 : g.value, s = {
|
|
460
526
|
dataItems: this.getLeafDataItems(),
|
|
461
527
|
mode: this.computedSelectable.mode,
|
|
462
528
|
cell: this.computedSelectable.cell,
|
|
463
529
|
componentId: this.$props.id,
|
|
464
530
|
selectedField: "",
|
|
465
531
|
...this.getArguments(e)
|
|
466
|
-
},
|
|
467
|
-
event:
|
|
532
|
+
}, i = Tt({
|
|
533
|
+
event: s,
|
|
468
534
|
selectedState: t != null ? t : {},
|
|
469
535
|
dataItemKey: this.$props.dataItemKey
|
|
470
536
|
});
|
|
471
|
-
if (
|
|
537
|
+
if (i === t)
|
|
472
538
|
return;
|
|
473
|
-
const
|
|
474
|
-
if (
|
|
475
|
-
const
|
|
539
|
+
const o = e.target, r = Be(o, "TD"), l = Be(o, "TR"), d = zt(r), h = Et(l);
|
|
540
|
+
if (d !== void 0 && h !== void 0) {
|
|
541
|
+
const R = (u = ts(this.$props.dataItems)) == null ? void 0 : u[h];
|
|
476
542
|
this.gridContext.selectionchange({
|
|
477
|
-
...
|
|
478
|
-
select:
|
|
479
|
-
dataItem:
|
|
480
|
-
startRowIndex:
|
|
481
|
-
startColIndex:
|
|
482
|
-
startDataItem:
|
|
483
|
-
endDataItem:
|
|
484
|
-
endRowIndex:
|
|
485
|
-
endColIndex:
|
|
543
|
+
...s,
|
|
544
|
+
select: i,
|
|
545
|
+
dataItem: R,
|
|
546
|
+
startRowIndex: h,
|
|
547
|
+
startColIndex: d,
|
|
548
|
+
startDataItem: R,
|
|
549
|
+
endDataItem: R,
|
|
550
|
+
endRowIndex: h,
|
|
551
|
+
endColIndex: d,
|
|
486
552
|
ctrlKey: e.ctrlKey,
|
|
487
553
|
altKey: e.altKey,
|
|
488
554
|
metaKey: e.metaKey,
|
|
@@ -495,7 +561,7 @@ const rs = /* @__PURE__ */ $t({
|
|
|
495
561
|
if (this.computedSelectable.enabled) {
|
|
496
562
|
const t = this.getLeafDataItems();
|
|
497
563
|
this.gridContext.headerselectionchange({
|
|
498
|
-
select: e.event.target.checked ? t.reduce((
|
|
564
|
+
select: e.event.target.checked ? t.reduce((s, i) => (this.$props.dataItemKey && P(this.$props.dataItemKey)(i) !== void 0 && (s[P(this.$props.dataItemKey)(i)] = !0), s), {}) : {},
|
|
499
565
|
field: e.field,
|
|
500
566
|
event: e.event,
|
|
501
567
|
target: this,
|
|
@@ -506,24 +572,24 @@ const rs = /* @__PURE__ */ $t({
|
|
|
506
572
|
selectionRelease(e) {
|
|
507
573
|
var t;
|
|
508
574
|
if (this.computedSelectable.enabled) {
|
|
509
|
-
const
|
|
575
|
+
const s = this.getLeafDataItems(), i = s[e.startRowIndex], o = s[e.endRowIndex], r = {
|
|
510
576
|
event: void 0,
|
|
511
577
|
target: this,
|
|
512
578
|
selectedField: "",
|
|
513
579
|
componentId: this.$props.id || this._gridId,
|
|
514
|
-
dataItems:
|
|
580
|
+
dataItems: s,
|
|
515
581
|
dataItem: null,
|
|
516
|
-
startDataItem:
|
|
517
|
-
endDataItem:
|
|
582
|
+
startDataItem: i,
|
|
583
|
+
endDataItem: o,
|
|
518
584
|
...e
|
|
519
|
-
},
|
|
520
|
-
event:
|
|
585
|
+
}, l = We({
|
|
586
|
+
event: r,
|
|
521
587
|
selectedState: (t = this.$props.select) != null ? t : {},
|
|
522
588
|
// Thats kinda strange, even through the `dataItemKey` is required by the `getSelectedState`
|
|
523
589
|
// it does work correctly even without it
|
|
524
590
|
dataItemKey: this.$props.dataItemKey
|
|
525
591
|
});
|
|
526
|
-
this.raiseSelectionEvent(
|
|
592
|
+
this.raiseSelectionEvent(r, l);
|
|
527
593
|
}
|
|
528
594
|
},
|
|
529
595
|
clearSelection(e) {
|
|
@@ -536,18 +602,18 @@ const rs = /* @__PURE__ */ $t({
|
|
|
536
602
|
});
|
|
537
603
|
},
|
|
538
604
|
moveToNextPage(e) {
|
|
539
|
-
var
|
|
540
|
-
const t = (
|
|
541
|
-
|
|
542
|
-
skip:
|
|
605
|
+
var o, r, l, d;
|
|
606
|
+
const t = (l = (r = (o = this.gridContext.take) == null ? void 0 : o.value) != null ? r : this.$props.pageSize) != null ? l : 0, s = (((d = this.gridContext.skip) == null ? void 0 : d.value) || 0) + t, i = this.getTotal();
|
|
607
|
+
s < i && this.pageChangeHandler({
|
|
608
|
+
skip: s,
|
|
543
609
|
take: t
|
|
544
610
|
}, e);
|
|
545
611
|
},
|
|
546
612
|
moveToPrevPage(e) {
|
|
547
|
-
var
|
|
548
|
-
const t = (
|
|
549
|
-
|
|
550
|
-
skip:
|
|
613
|
+
var i, o, r, l;
|
|
614
|
+
const t = (r = (o = (i = this.gridContext.take) == null ? void 0 : i.value) != null ? o : this.$props.pageSize) != null ? r : 0, s = (((l = this.gridContext.skip) == null ? void 0 : l.value) || 0) - t;
|
|
615
|
+
s >= 0 && this.pageChangeHandler({
|
|
616
|
+
skip: s,
|
|
551
617
|
take: t
|
|
552
618
|
}, e);
|
|
553
619
|
},
|
|
@@ -584,141 +650,142 @@ const rs = /* @__PURE__ */ $t({
|
|
|
584
650
|
}, t);
|
|
585
651
|
},
|
|
586
652
|
handleDetailExpandAction(e, t) {
|
|
587
|
-
var
|
|
653
|
+
var s;
|
|
588
654
|
if (this.detailExpandable.enabled) {
|
|
589
|
-
const
|
|
655
|
+
const i = (s = this.gridContext.detailExpand) == null ? void 0 : s.value, o = Ht(i != null ? i : {}, e);
|
|
590
656
|
this.gridContext.detailexpandchange({
|
|
591
657
|
...this.getArguments(t),
|
|
592
|
-
detailExpand:
|
|
658
|
+
detailExpand: o
|
|
593
659
|
});
|
|
594
660
|
}
|
|
595
661
|
},
|
|
596
662
|
handleGroupExpandAction(e, t) {
|
|
597
|
-
var
|
|
663
|
+
var s;
|
|
598
664
|
if (this.groupExpandable.enabled) {
|
|
599
|
-
const
|
|
665
|
+
const i = (s = this.gridContext.groupExpand) == null ? void 0 : s.value, o = kt(i != null ? i : [], e, this.groupExpandable);
|
|
600
666
|
this.$props.expandField || this.gridContext.groupexpandchange({
|
|
601
667
|
...this.getArguments(t),
|
|
602
|
-
groupExpand:
|
|
668
|
+
groupExpand: o
|
|
603
669
|
});
|
|
604
670
|
}
|
|
671
|
+
this.scrollToStickyGroup(e.group);
|
|
605
672
|
},
|
|
606
|
-
raiseDataEvent(e, t,
|
|
673
|
+
raiseDataEvent(e, t, s, i) {
|
|
607
674
|
if (this.resetVirtualSkip(), this.$props.autoProcessData)
|
|
608
675
|
this.gridContext[e]({
|
|
609
|
-
...this.getArguments(
|
|
676
|
+
...this.getArguments(i),
|
|
610
677
|
...t
|
|
611
678
|
});
|
|
612
679
|
else if (M.call(this, e))
|
|
613
680
|
this.$emit(e, {
|
|
614
|
-
...this.getArguments(
|
|
681
|
+
...this.getArguments(i),
|
|
615
682
|
...t
|
|
616
683
|
});
|
|
617
684
|
else if (M.call(this, "datastatechange")) {
|
|
618
|
-
const
|
|
685
|
+
const o = {
|
|
619
686
|
...this.getDataState(),
|
|
620
|
-
...
|
|
687
|
+
...s
|
|
621
688
|
};
|
|
622
689
|
this.gridContext.datastatechange({
|
|
623
|
-
...this.getArguments(
|
|
624
|
-
data:
|
|
625
|
-
dataState:
|
|
690
|
+
...this.getArguments(i),
|
|
691
|
+
data: o,
|
|
692
|
+
dataState: o
|
|
626
693
|
});
|
|
627
694
|
}
|
|
628
695
|
},
|
|
629
|
-
columnReorder(e, t,
|
|
630
|
-
const
|
|
696
|
+
columnReorder(e, t, s) {
|
|
697
|
+
const i = this.columnsRef[e], o = Je(this.currentColumnsState), r = i.depth, l = (u) => {
|
|
631
698
|
do
|
|
632
699
|
u++;
|
|
633
|
-
while (u < this.columnsRef.length && this.columnsRef[u].depth >
|
|
700
|
+
while (u < this.columnsRef.length && this.columnsRef[u].depth > r);
|
|
634
701
|
return u;
|
|
635
|
-
},
|
|
636
|
-
this.columnsRef.splice(e < t ?
|
|
637
|
-
u.orderIndex =
|
|
638
|
-
const C =
|
|
639
|
-
C && (C.orderIndex =
|
|
702
|
+
}, d = this.columnsRef.splice(e, l(e) - e);
|
|
703
|
+
this.columnsRef.splice(e < t ? l(t - d.length) : t, 0, ...d), this.columnsRef.filter((u) => u.declarationIndex >= 0).forEach((u, R) => {
|
|
704
|
+
u.orderIndex = R;
|
|
705
|
+
const C = o.find((S) => S.id === u.id);
|
|
706
|
+
C && (C.orderIndex = R);
|
|
640
707
|
});
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
const
|
|
708
|
+
const h = this.columnsRef[e].locked && this.columnsRef[t].locked;
|
|
709
|
+
St(this._columnsMap, this.columnsRef, h || this.shouldUpdateLeftRightRef), yt(this._columnsMap, this.columnsRef, h || this.shouldUpdateLeftRightRef), this.resizedRef && (this.shouldUpdateLeftRightRef = !1, this.resizedRef = !1);
|
|
710
|
+
const g = this.getColumns();
|
|
644
711
|
this.$emit("columnreorder", {
|
|
645
712
|
target: this,
|
|
646
|
-
columns:
|
|
647
|
-
event:
|
|
713
|
+
columns: g,
|
|
714
|
+
event: s,
|
|
648
715
|
prev: e,
|
|
649
716
|
next: t
|
|
650
717
|
}), this.gridContext.columnsstatechange({
|
|
651
718
|
columnsState: this.currentColumnsState
|
|
652
719
|
});
|
|
653
720
|
},
|
|
654
|
-
groupReorder(e, t,
|
|
655
|
-
var
|
|
656
|
-
const
|
|
657
|
-
|
|
721
|
+
groupReorder(e, t, s) {
|
|
722
|
+
var o;
|
|
723
|
+
const i = (o = this.gridContext.group) == null ? void 0 : o.value;
|
|
724
|
+
i !== void 0 && (i.splice(t, 0, ...i.splice(e, 1)), this.groupChangeHandler(i, s));
|
|
658
725
|
},
|
|
659
|
-
columnToGroup(e, t,
|
|
660
|
-
var
|
|
661
|
-
const
|
|
662
|
-
if (!
|
|
726
|
+
columnToGroup(e, t, s) {
|
|
727
|
+
var r;
|
|
728
|
+
const i = this.columnsRef[e].field;
|
|
729
|
+
if (!i)
|
|
663
730
|
return;
|
|
664
|
-
const
|
|
665
|
-
|
|
666
|
-
field:
|
|
667
|
-
}), this.groupChangeHandler(
|
|
731
|
+
const o = (((r = this.gridContext.group) == null ? void 0 : r.value) || []).slice();
|
|
732
|
+
o.splice(t, 0, {
|
|
733
|
+
field: i
|
|
734
|
+
}), this.groupChangeHandler(o, s);
|
|
668
735
|
},
|
|
669
736
|
resetTableWidth() {
|
|
670
|
-
var
|
|
737
|
+
var i;
|
|
671
738
|
let e = 0;
|
|
672
739
|
if (!this.columnResize.colGroupMain)
|
|
673
740
|
return;
|
|
674
|
-
const t = (
|
|
675
|
-
for (let
|
|
676
|
-
const
|
|
677
|
-
if (!
|
|
741
|
+
const t = (i = this.columnResize.colGroupMain) == null ? void 0 : i.children;
|
|
742
|
+
for (let o = 0; o < t.length; o++) {
|
|
743
|
+
const r = t[o].width;
|
|
744
|
+
if (!r)
|
|
678
745
|
return;
|
|
679
|
-
e += parseFloat(
|
|
746
|
+
e += parseFloat(r.toString());
|
|
680
747
|
}
|
|
681
|
-
e = Math.round(e), this._header && this._header.setWidth(e), this._footer && this._footer.setWidth(e);
|
|
682
|
-
const
|
|
683
|
-
|
|
748
|
+
e = Math.round(e), this._header && this._header.setWidth(e), this._footer && this._footer.setWidth(e), this.stickyHeaderRef && this.stickyHeaderRef.setWidth(e), this.stickyFooterRef && this.stickyFooterRef.setWidth(e);
|
|
749
|
+
const s = Ke(this, "table");
|
|
750
|
+
s && e && (s.style.width = e + "px");
|
|
684
751
|
},
|
|
685
|
-
onResize(e, t,
|
|
752
|
+
onResize(e, t, s, i, o, r, l) {
|
|
686
753
|
this.resetTableWidth(), this.shouldUpdateLeftRightRef = !0, this.resizedRef = !0, this.$emit("columnresize", {
|
|
687
754
|
columns: this.getColumns(),
|
|
688
755
|
index: e,
|
|
689
|
-
targetColumnId:
|
|
690
|
-
event:
|
|
756
|
+
targetColumnId: l,
|
|
757
|
+
event: i,
|
|
691
758
|
newWidth: t,
|
|
692
|
-
oldWidth:
|
|
693
|
-
end:
|
|
759
|
+
oldWidth: s,
|
|
760
|
+
end: o,
|
|
694
761
|
target: this
|
|
695
|
-
}),
|
|
696
|
-
columnsState:
|
|
762
|
+
}), o && this.gridContext.columnsstatechange({
|
|
763
|
+
columnsState: r
|
|
697
764
|
});
|
|
698
765
|
},
|
|
699
766
|
initColumnsState(e, t) {
|
|
700
|
-
const
|
|
701
|
-
var
|
|
702
|
-
const
|
|
703
|
-
if (
|
|
704
|
-
const
|
|
705
|
-
...
|
|
767
|
+
const s = (i) => {
|
|
768
|
+
var r;
|
|
769
|
+
const o = t.find((l) => l.id === i.id);
|
|
770
|
+
if (o) {
|
|
771
|
+
const l = {
|
|
772
|
+
...o
|
|
706
773
|
};
|
|
707
|
-
return
|
|
774
|
+
return l.children = (r = i.children) == null ? void 0 : r.map(s), l;
|
|
708
775
|
}
|
|
709
|
-
return
|
|
776
|
+
return i;
|
|
710
777
|
};
|
|
711
|
-
this.currentColumnsState = e.filter((
|
|
778
|
+
this.currentColumnsState = e.filter((i) => i.parentIndex === -1).map(s);
|
|
712
779
|
},
|
|
713
780
|
configureColumns(e, t) {
|
|
714
|
-
e.filter((
|
|
715
|
-
|
|
716
|
-
}), this.$props.selectedField && this.columnsRef.filter((
|
|
717
|
-
|
|
781
|
+
e.filter((r) => r.columnType === "checkbox").forEach((r) => {
|
|
782
|
+
r.width = r.width || "50px", r.internalCell = x(je), r.internalHeaderCell = x(Xe), r._type = "edit", r.columnMenu = !1;
|
|
783
|
+
}), this.$props.selectedField && this.columnsRef.filter((r) => r.field === this.$props.selectedField).forEach((r) => {
|
|
784
|
+
r.width = r.width || "50px", r.internalCell = x(je), r.internalHeaderCell = x(Xe), r.columnMenu = !1;
|
|
718
785
|
});
|
|
719
|
-
const
|
|
720
|
-
this.initColumnsState(e,
|
|
721
|
-
const
|
|
786
|
+
const s = Je(this.currentColumnsState);
|
|
787
|
+
this.initColumnsState(e, s);
|
|
788
|
+
const i = {
|
|
722
789
|
id: "",
|
|
723
790
|
resizable: !0,
|
|
724
791
|
width: "32px",
|
|
@@ -738,88 +805,88 @@ const rs = /* @__PURE__ */ $t({
|
|
|
738
805
|
ariaColumnIndex: 0,
|
|
739
806
|
isAccessible: !0
|
|
740
807
|
};
|
|
741
|
-
let
|
|
808
|
+
let o = 0;
|
|
742
809
|
if (this.detailExpandable.enabled && this.$props.detail && !this.$props.expandField) {
|
|
743
|
-
const
|
|
744
|
-
...
|
|
810
|
+
const r = {
|
|
811
|
+
...i,
|
|
745
812
|
_type: "expand",
|
|
746
|
-
id:
|
|
747
|
-
defaultCell:
|
|
748
|
-
internalCell:
|
|
813
|
+
id: H.generateNavigatableId(`${o++}`, "expand", "column"),
|
|
814
|
+
defaultCell: x(ae),
|
|
815
|
+
internalCell: x(ae),
|
|
749
816
|
field: this.detailExpandable.column,
|
|
750
817
|
headerClassName: this.hierarchClass
|
|
751
818
|
};
|
|
752
|
-
e.unshift(
|
|
819
|
+
e.unshift(r), this.currentColumnsState.unshift(s.find((l) => l.id === r.id) || r);
|
|
753
820
|
}
|
|
754
821
|
this.$props.expandField && M.call(this, "expandchange") && this.$props.detail && (e.unshift({
|
|
755
|
-
...
|
|
756
|
-
internalCell:
|
|
822
|
+
...i,
|
|
823
|
+
internalCell: x(ae),
|
|
757
824
|
field: this.$props.expandField,
|
|
758
825
|
headerClassName: "k-hierarchy-cell k-header",
|
|
759
|
-
id:
|
|
826
|
+
id: H.generateNavigatableId(`${e.length}`, this.idPrefix, "column"),
|
|
760
827
|
...this.expandColumn
|
|
761
|
-
}),
|
|
762
|
-
for (let
|
|
763
|
-
const
|
|
764
|
-
...
|
|
828
|
+
}), o++);
|
|
829
|
+
for (let r = 0; r < t; r++) {
|
|
830
|
+
const l = {
|
|
831
|
+
...i,
|
|
765
832
|
isAccessible: !1,
|
|
766
|
-
defaultCell:
|
|
767
|
-
internalCell:
|
|
768
|
-
id:
|
|
833
|
+
defaultCell: x(ne),
|
|
834
|
+
internalCell: x(ne),
|
|
835
|
+
id: H.generateNavigatableId(`${o++}`, "group", "column"),
|
|
769
836
|
field: "value",
|
|
770
837
|
locked: this.$props.lockGroups,
|
|
771
838
|
columnMenu: !1
|
|
772
839
|
};
|
|
773
|
-
e.unshift(
|
|
840
|
+
e.unshift(l), this.currentColumnsState.unshift(s.find((d) => d.id === l.id) || l);
|
|
774
841
|
}
|
|
775
|
-
e.slice(
|
|
776
|
-
|
|
842
|
+
e.slice(o).forEach((r) => {
|
|
843
|
+
r.parentIndex >= 0 && (r.parentIndex += o), r.rowSpannable = r.rowSpannable !== void 0 ? Qe(r.rowSpannable) : this.computedRowSpannable;
|
|
777
844
|
});
|
|
778
845
|
},
|
|
779
846
|
initColumns(e, t) {
|
|
780
|
-
var
|
|
847
|
+
var r;
|
|
781
848
|
this.columnsRef = this.readColumnElements();
|
|
782
|
-
const
|
|
783
|
-
this.columnsRef.filter((
|
|
849
|
+
const s = (r = this.gridContext.group) == null ? void 0 : r.value;
|
|
850
|
+
this.columnsRef.filter((l) => !l.hidden).length === 0 && (this.columnsRef = Zt(e, s, {
|
|
784
851
|
column: this.$props.expandField ? this.$props.expandField : this.groupExpandable.column
|
|
785
852
|
}, {
|
|
786
853
|
prevId: 0,
|
|
787
854
|
idPrefix: this.idPrefix
|
|
788
855
|
})), this.configureColumns(this.columnsRef, t);
|
|
789
|
-
const [
|
|
790
|
-
this.columnsRef =
|
|
856
|
+
const [i, o] = this.filterColumns(this.columnsRef);
|
|
857
|
+
this.columnsRef = i, this.hiddenColumnsRef = o, this._columnsMap = es(this.columnsRef, !0);
|
|
791
858
|
},
|
|
792
859
|
resolveTitle(e) {
|
|
793
|
-
const t = this.findColumnByField(e),
|
|
794
|
-
return
|
|
860
|
+
const t = this.findColumnByField(e), s = t && (t.title || t.field);
|
|
861
|
+
return s === void 0 ? e : s;
|
|
795
862
|
},
|
|
796
863
|
findColumnByField(e) {
|
|
797
864
|
let t;
|
|
798
|
-
return this.$props.columns.forEach((
|
|
799
|
-
const
|
|
800
|
-
|
|
865
|
+
return this.$props.columns.forEach((s) => {
|
|
866
|
+
const i = this.searchColumn(s, e);
|
|
867
|
+
i && (t = i);
|
|
801
868
|
}), t;
|
|
802
869
|
},
|
|
803
870
|
searchColumn(e, t) {
|
|
804
871
|
if (e.field === t)
|
|
805
872
|
return e;
|
|
806
873
|
if (e.children) {
|
|
807
|
-
let
|
|
808
|
-
for (
|
|
809
|
-
|
|
810
|
-
return
|
|
874
|
+
let s, i = null;
|
|
875
|
+
for (s = 0; i == null && s < e.children.length; s++)
|
|
876
|
+
i = this.searchColumn(e.children[s], t);
|
|
877
|
+
return i;
|
|
811
878
|
}
|
|
812
879
|
return null;
|
|
813
880
|
},
|
|
814
881
|
getDataState() {
|
|
815
|
-
var
|
|
816
|
-
const e = (
|
|
882
|
+
var r, l, d, h, g;
|
|
883
|
+
const e = (r = this.gridContext.sort) == null ? void 0 : r.value, t = (l = this.gridContext.filter) == null ? void 0 : l.value, s = (d = this.gridContext.skip) == null ? void 0 : d.value, i = (h = this.gridContext.take) == null ? void 0 : h.value, o = (g = this.gridContext.group) == null ? void 0 : g.value;
|
|
817
884
|
return {
|
|
818
885
|
filter: t,
|
|
819
886
|
sort: e,
|
|
820
|
-
skip:
|
|
821
|
-
take:
|
|
822
|
-
group:
|
|
887
|
+
skip: s,
|
|
888
|
+
take: i !== void 0 ? i : this.$props.pageSize,
|
|
889
|
+
group: o
|
|
823
890
|
};
|
|
824
891
|
},
|
|
825
892
|
getArguments(e) {
|
|
@@ -829,83 +896,83 @@ const rs = /* @__PURE__ */ $t({
|
|
|
829
896
|
};
|
|
830
897
|
},
|
|
831
898
|
getLeafDataItems() {
|
|
832
|
-
return this.
|
|
899
|
+
return this.dataRef.filter((e) => e.rowType === "data").map((e) => e.dataItem);
|
|
833
900
|
},
|
|
834
901
|
totalGroupedRows(e) {
|
|
835
902
|
let t = 0;
|
|
836
903
|
return e && (t = this.addSubItems(e, t)), t;
|
|
837
904
|
},
|
|
838
905
|
addSubItems(e, t) {
|
|
839
|
-
return e.forEach((
|
|
840
|
-
t++,
|
|
906
|
+
return e.forEach((s) => {
|
|
907
|
+
t++, s.expanded !== !1 && s.items && (t = this.addSubItems(s.items, t)), this.group && this.group.length && (this.$props.groupable.footer === "always" || s.expanded !== !1 && s.items && this.$props.groupable.footer === "visible") && t++;
|
|
841
908
|
}), t;
|
|
842
909
|
},
|
|
843
910
|
searchChange(e) {
|
|
844
|
-
const t = this.$props.searchFields || this.columnsRef.map((
|
|
911
|
+
const t = this.$props.searchFields || this.columnsRef.map((o) => o.field) || [], s = e.event.target.value, i = {
|
|
845
912
|
logic: "or",
|
|
846
|
-
filters: t.filter((
|
|
847
|
-
var
|
|
848
|
-
return typeof
|
|
849
|
-
field:
|
|
850
|
-
value:
|
|
913
|
+
filters: t.filter((o) => o !== void 0).map((o) => {
|
|
914
|
+
var r;
|
|
915
|
+
return typeof o == "string" ? {
|
|
916
|
+
field: o,
|
|
917
|
+
value: s,
|
|
851
918
|
operator: "contains"
|
|
852
919
|
} : {
|
|
853
|
-
value:
|
|
854
|
-
operator: (
|
|
855
|
-
field:
|
|
856
|
-
ignoreCase:
|
|
920
|
+
value: s,
|
|
921
|
+
operator: (r = o.operator) != null ? r : "contains",
|
|
922
|
+
field: o.field,
|
|
923
|
+
ignoreCase: o.ignoreCase
|
|
857
924
|
};
|
|
858
925
|
})
|
|
859
926
|
};
|
|
860
927
|
this.raiseDataEvent("searchchange", {
|
|
861
|
-
search:
|
|
928
|
+
search: i
|
|
862
929
|
}, {
|
|
863
930
|
skip: 0
|
|
864
931
|
}, e);
|
|
865
932
|
},
|
|
866
933
|
getCellsToRender(e, t) {
|
|
867
|
-
var
|
|
868
|
-
const
|
|
869
|
-
let
|
|
870
|
-
if (t.forEach((
|
|
871
|
-
const
|
|
872
|
-
if (
|
|
873
|
-
|
|
934
|
+
var r;
|
|
935
|
+
const s = [];
|
|
936
|
+
let i = null, o = 0;
|
|
937
|
+
if (t.forEach((l, d) => {
|
|
938
|
+
const h = parseFloat((l.width || "").toString()) || 10;
|
|
939
|
+
if (o) {
|
|
940
|
+
o--, i && (i.width += h);
|
|
874
941
|
return;
|
|
875
942
|
}
|
|
876
|
-
const
|
|
877
|
-
|
|
878
|
-
width:
|
|
879
|
-
colSpan:
|
|
880
|
-
columnIndex:
|
|
881
|
-
},
|
|
943
|
+
const g = Math.min(Yt(l, e), t.length - d);
|
|
944
|
+
o = g - 1, i = {
|
|
945
|
+
width: h,
|
|
946
|
+
colSpan: g,
|
|
947
|
+
columnIndex: d
|
|
948
|
+
}, s.push(i);
|
|
882
949
|
}), this.$props.columnVirtualization) {
|
|
883
|
-
const
|
|
884
|
-
return
|
|
885
|
-
cellModels:
|
|
950
|
+
const l = this.scrollLeftRef || 0, d = this.tableWidth || parseFloat((((r = this.$attrs.style) == null ? void 0 : r.width) || "").toString());
|
|
951
|
+
return hs({
|
|
952
|
+
cellModels: s,
|
|
886
953
|
columns: t,
|
|
887
|
-
tableViewPortWidth:
|
|
888
|
-
scrollLeft:
|
|
954
|
+
tableViewPortWidth: d,
|
|
955
|
+
scrollLeft: l
|
|
889
956
|
});
|
|
890
957
|
}
|
|
891
|
-
return
|
|
958
|
+
return s;
|
|
892
959
|
},
|
|
893
960
|
calcVirtualPageSize() {
|
|
894
961
|
const {
|
|
895
962
|
pageable: e,
|
|
896
963
|
take: t,
|
|
897
|
-
pageSize:
|
|
964
|
+
pageSize: s
|
|
898
965
|
} = this.$props;
|
|
899
966
|
if (!this.isVirtualScroll)
|
|
900
967
|
return 0;
|
|
901
968
|
if (!e) {
|
|
902
969
|
if (t)
|
|
903
970
|
return t;
|
|
904
|
-
if (
|
|
905
|
-
return
|
|
971
|
+
if (s)
|
|
972
|
+
return s;
|
|
906
973
|
}
|
|
907
|
-
const
|
|
908
|
-
return
|
|
974
|
+
const i = this.$props.rowHeight || this._minRowHeightRef, o = this._containerHeightRef;
|
|
975
|
+
return o && i ? Math.ceil(o / i * 1.5) : 0;
|
|
909
976
|
}
|
|
910
977
|
},
|
|
911
978
|
provide() {
|
|
@@ -915,123 +982,157 @@ const rs = /* @__PURE__ */ $t({
|
|
|
915
982
|
searchChange: this.searchChange,
|
|
916
983
|
selectionRelease: this.selectionRelease,
|
|
917
984
|
dispatchGroupExpand: this.handleGroupExpandAction,
|
|
918
|
-
dispatchDetailExpand: this.handleDetailExpandAction
|
|
919
|
-
|
|
985
|
+
dispatchDetailExpand: this.handleDetailExpandAction,
|
|
986
|
+
scrollToStickyGroup: this.scrollToStickyGroup
|
|
987
|
+
},
|
|
988
|
+
sticky: this.sticky
|
|
920
989
|
};
|
|
921
990
|
},
|
|
922
991
|
setup(e) {
|
|
923
|
-
const t =
|
|
992
|
+
const t = c(null), s = c(null), i = c(null), o = c(null), r = c(null), l = c(null), d = c(null), h = c([]), g = c([]), u = c(null), R = c(null), C = c(null), S = c(null), y = c(!0), k = c(!1), $ = new Ut(), b = c(0), G = ut(ds, {}), F = typeof e.groupable == "object" && !!e.groupable.stickyHeaders, U = typeof e.groupable == "object" && !!e.groupable.stickyFooters, K = c([]), j = Pe(() => {
|
|
993
|
+
var D, L;
|
|
994
|
+
return !!((L = (D = G.group) == null ? void 0 : D.value) != null && L.length);
|
|
995
|
+
}), T = c(null), q = c(void 0), A = c({
|
|
996
|
+
headerItems: [],
|
|
997
|
+
footerItems: []
|
|
998
|
+
}), {
|
|
999
|
+
scrollToStickyGroup: z,
|
|
1000
|
+
update: I
|
|
1001
|
+
} = cs({
|
|
1002
|
+
enabled: F,
|
|
1003
|
+
enabledFooters: U,
|
|
1004
|
+
flatData: K,
|
|
1005
|
+
containerRef: u,
|
|
1006
|
+
stickyHeaderRef: R,
|
|
1007
|
+
stickyFooterRef: C,
|
|
1008
|
+
tableBodyRef: S,
|
|
1009
|
+
rowHeight: e.rowHeight,
|
|
1010
|
+
isGrouped: j,
|
|
1011
|
+
virtualSkipRef: b,
|
|
1012
|
+
rowHeightServiceRef: Pe(() => $ == null ? void 0 : $.rowHeightService)
|
|
1013
|
+
});
|
|
924
1014
|
return {
|
|
1015
|
+
rowIndexRef: q,
|
|
1016
|
+
observerRef: T,
|
|
1017
|
+
dataRef: K,
|
|
925
1018
|
groupPanelDivRef: t,
|
|
926
|
-
dropElementClueRef:
|
|
927
|
-
dragElementClueRef:
|
|
928
|
-
headerRef:
|
|
929
|
-
footerRef:
|
|
930
|
-
gridNavRef:
|
|
931
|
-
colGroupRef:
|
|
932
|
-
scrollContainerRef:
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
1019
|
+
dropElementClueRef: s,
|
|
1020
|
+
dragElementClueRef: i,
|
|
1021
|
+
headerRef: o,
|
|
1022
|
+
footerRef: r,
|
|
1023
|
+
gridNavRef: l,
|
|
1024
|
+
colGroupRef: d,
|
|
1025
|
+
scrollContainerRef: u,
|
|
1026
|
+
tableBodyRef: S,
|
|
1027
|
+
gridContext: G,
|
|
1028
|
+
shouldUpdateLeftRightRef: y,
|
|
1029
|
+
resizedRef: k,
|
|
1030
|
+
currentColumnsState: e.columnsState,
|
|
1031
|
+
vsRef: $,
|
|
1032
|
+
virtualSkipRef: b,
|
|
1033
|
+
stickyHeaderItems: h,
|
|
1034
|
+
stickyHeaderRef: R,
|
|
1035
|
+
stickyFooterItems: g,
|
|
1036
|
+
stickyFooterRef: C,
|
|
1037
|
+
sticky: A,
|
|
1038
|
+
scrollToStickyGroup: z,
|
|
1039
|
+
updateStickyGroups: I
|
|
939
1040
|
};
|
|
940
1041
|
},
|
|
941
1042
|
render() {
|
|
942
|
-
var Ce, be,
|
|
943
|
-
const e = (
|
|
944
|
-
let
|
|
945
|
-
this.currentColumnsState = (
|
|
946
|
-
const
|
|
1043
|
+
var Re, Ce, be, $e, Ie, ve, xe, we, Se, ye, ke, He, Te, ze, Ee, Ge, Fe, De;
|
|
1044
|
+
const e = (Re = this.gridContext.sort) == null ? void 0 : Re.value, t = (Ce = this.gridContext.filter) == null ? void 0 : Ce.value, s = (be = this.gridContext.search) == null ? void 0 : be.value, i = ($e = this.gridContext.select) == null ? void 0 : $e.value, o = (Ie = this.gridContext.skip) == null ? void 0 : Ie.value, r = (ve = this.gridContext.take) == null ? void 0 : ve.value, l = (xe = this.gridContext.group) == null ? void 0 : xe.value, d = (we = this.gridContext.groupExpand) == null ? void 0 : we.value, h = (Se = this.gridContext.detailExpand) == null ? void 0 : Se.value, g = (l == null ? void 0 : l.length) || 0, u = typeof this.$props.groupable == "object" && !!this.$props.groupable.stickyHeaders, R = typeof this.$props.groupable == "object" && !!this.$props.groupable.stickyFooters, C = !!(l != null && l.length);
|
|
1045
|
+
let S;
|
|
1046
|
+
this.currentColumnsState = (ye = this.gridContext.columnsState) == null ? void 0 : ye.value;
|
|
1047
|
+
const y = this.$props.autoProcessData === !0 ? {
|
|
947
1048
|
group: !0,
|
|
948
1049
|
sort: !0,
|
|
949
1050
|
filter: !0,
|
|
950
1051
|
search: !0,
|
|
951
1052
|
page: !0
|
|
952
1053
|
} : this.$props.autoProcessData;
|
|
953
|
-
let
|
|
954
|
-
const
|
|
955
|
-
let
|
|
956
|
-
Array.isArray(this.$props.dataItems) ? (
|
|
957
|
-
const
|
|
958
|
-
this.dragLogic.reorderable = this.$props.reorderable || !1, this.dragLogic.groupable =
|
|
959
|
-
const
|
|
960
|
-
if (
|
|
961
|
-
const
|
|
962
|
-
data:
|
|
963
|
-
total:
|
|
964
|
-
} =
|
|
965
|
-
group:
|
|
966
|
-
sort:
|
|
967
|
-
filter:
|
|
968
|
-
...
|
|
969
|
-
take: this.$props.pageable ?
|
|
970
|
-
skip:
|
|
1054
|
+
let k;
|
|
1055
|
+
const $ = H.getIdPrefix(this.navigation);
|
|
1056
|
+
let b = [];
|
|
1057
|
+
Array.isArray(this.$props.dataItems) ? (b = this.$props.dataItems, k = (ke = this.$props.total) != null ? ke : b.length) : (b = ((He = Xt(this.$props.dataItems, this.$props.collapsedGroups.length ? this.computedCollapsed : [], this.$props.uniqueField)) == null ? void 0 : He.data) || [], k = (Ee = (ze = this.$props.total) != null ? ze : (Te = this.$props.dataItems) == null ? void 0 : Te.total) != null ? Ee : b.length);
|
|
1058
|
+
const G = this.$props.groupable === !0 || W(this.$props.groupable) && this.$props.groupable.enabled !== !1;
|
|
1059
|
+
this.dragLogic.reorderable = this.$props.reorderable || !1, this.dragLogic.groupable = G, this._virtualPageSize = this.calcVirtualPageSize();
|
|
1060
|
+
const F = b.length === k, U = W(this.$props.groupable) && this.$props.groupable.footer || "none";
|
|
1061
|
+
if (y) {
|
|
1062
|
+
const a = y.page && !(this.isVirtualScroll && !this.$props.pageable), {
|
|
1063
|
+
data: f,
|
|
1064
|
+
total: v
|
|
1065
|
+
} = ns(b, {
|
|
1066
|
+
group: y.group ? l : void 0,
|
|
1067
|
+
sort: y.sort ? e : void 0,
|
|
1068
|
+
filter: vt(y.filter ? t : void 0, y.search ? s : void 0),
|
|
1069
|
+
...a ? {
|
|
1070
|
+
take: this.$props.pageable ? r || 10 : r,
|
|
1071
|
+
skip: o || 0
|
|
971
1072
|
} : {}
|
|
972
1073
|
});
|
|
973
|
-
|
|
1074
|
+
b = f, k = (Ge = this.$props.total) != null ? Ge : v;
|
|
974
1075
|
}
|
|
975
1076
|
const {
|
|
976
|
-
resolvedGroupsCount:
|
|
977
|
-
flattedData:
|
|
978
|
-
} = this.getFlatData(
|
|
979
|
-
this.
|
|
980
|
-
const
|
|
981
|
-
if (this._virtualTotal =
|
|
982
|
-
let
|
|
983
|
-
if ((
|
|
1077
|
+
resolvedGroupsCount: K,
|
|
1078
|
+
flattedData: j
|
|
1079
|
+
} = this.getFlatData(b, U, F ? 0 : this.$props.skip || 0, l, h, d, this.$props.dataItemKey);
|
|
1080
|
+
this.dataRef = j;
|
|
1081
|
+
const T = this.virtualSkipRef || 0;
|
|
1082
|
+
if (this._virtualTotal = k, this.isVirtualScroll) {
|
|
1083
|
+
let a = o || 0;
|
|
1084
|
+
if ((C || this.$props.pageable) && (a = T, this._virtualTotal = this.dataRef.length), F || C || this.$props.pageable)
|
|
984
1085
|
if (this._virtualPageSize === 0) {
|
|
985
|
-
const
|
|
986
|
-
|
|
1086
|
+
const f = Math.min(r || this.$props.pageSize || 20, this.dataRef.length);
|
|
1087
|
+
S = this.dataRef.slice(a, a + f);
|
|
987
1088
|
} else
|
|
988
|
-
|
|
1089
|
+
S = this.dataRef.slice(a, a + this._virtualPageSize);
|
|
989
1090
|
}
|
|
990
1091
|
this.initializeVirtualization();
|
|
991
|
-
const
|
|
992
|
-
this.initColumns(this.$props.dataItems,
|
|
993
|
-
const
|
|
994
|
-
ref: (
|
|
995
|
-
this.groupPanelDivRef =
|
|
1092
|
+
const q = (Fe = this.selectable) != null && Fe.drag ? "none" : void 0;
|
|
1093
|
+
this.initColumns(this.$props.dataItems, K), this.columnResize.resizable = this.$props.resizable || !1, this.columnResize.columns = this.columnsRef, this.columnResize.columnsState = ft(this.currentColumnsState || []), this.dragLogic.columns = this.columnsRef;
|
|
1094
|
+
const A = this.$props.toolbar, z = this.$props.noRecords, I = this.columnsRef.filter((a) => a.children.length === 0), D = G && n(Vt, {
|
|
1095
|
+
ref: (a) => {
|
|
1096
|
+
this.groupPanelDivRef = a;
|
|
996
1097
|
},
|
|
997
|
-
group:
|
|
1098
|
+
group: l || [],
|
|
998
1099
|
ariaControls: this._gridRoleElementId,
|
|
999
1100
|
onGroupChange: this.groupChangeHandler,
|
|
1000
1101
|
onPressHandler: this.dragLogic.pressHandler,
|
|
1001
1102
|
onDragHandler: this.dragLogic.dragHandler,
|
|
1002
1103
|
onReleaseHandler: this.dragLogic.releaseHandler,
|
|
1003
1104
|
resolveTitle: this.resolveTitle
|
|
1004
|
-
}, null),
|
|
1005
|
-
ref: (
|
|
1006
|
-
this.dropElementClueRef =
|
|
1105
|
+
}, null), L = (this.dragLogic.reorderable || this.dragLogic.groupable) && B && document && document.body, he = [L && n(Qt, {
|
|
1106
|
+
ref: (a) => {
|
|
1107
|
+
this.dropElementClueRef = a;
|
|
1007
1108
|
}
|
|
1008
|
-
}, null),
|
|
1009
|
-
ref: (
|
|
1010
|
-
this.dragElementClueRef =
|
|
1109
|
+
}, null), L && n(Jt, {
|
|
1110
|
+
ref: (a) => {
|
|
1111
|
+
this.dragElementClueRef = a;
|
|
1011
1112
|
}
|
|
1012
|
-
}, null)],
|
|
1113
|
+
}, null)], st = this.showLicenseWatermark ? n(gt, {
|
|
1013
1114
|
message: this.licenseMessage
|
|
1014
|
-
}, null) : null,
|
|
1015
|
-
this.tableWidth = parseFloat(
|
|
1016
|
-
const
|
|
1017
|
-
let
|
|
1018
|
-
|
|
1019
|
-
const
|
|
1020
|
-
columnIndex:
|
|
1021
|
-
}) =>
|
|
1022
|
-
return
|
|
1023
|
-
key:
|
|
1024
|
-
width:
|
|
1115
|
+
}, null) : null, J = this.$attrs.style, it = J && W(J) && J["width"] || "";
|
|
1116
|
+
this.tableWidth = parseFloat(it.toString());
|
|
1117
|
+
const ot = I.findIndex((a) => typeof a.colSpan == "function") > -1;
|
|
1118
|
+
let V;
|
|
1119
|
+
V = this.getCellsToRender({}, I);
|
|
1120
|
+
const O = (this.$props.columnVirtualization ? this.getCellsToRender({}, I).map(({
|
|
1121
|
+
columnIndex: a
|
|
1122
|
+
}) => I[a]) : I).map(function(a, f) {
|
|
1123
|
+
return n("col", {
|
|
1124
|
+
key: a.id || `col-${f}`,
|
|
1125
|
+
width: a.width !== void 0 ? Math.floor(parseFloat(a.width.toString())) : void 0
|
|
1025
1126
|
}, null);
|
|
1026
|
-
}, this), pe =
|
|
1127
|
+
}, this), pe = n(Mt, {
|
|
1027
1128
|
size: this.$props.size,
|
|
1028
1129
|
columnResize: this.columnResize,
|
|
1029
1130
|
staticHeaders: this.$props.scrollable !== "none",
|
|
1030
|
-
ref: (
|
|
1031
|
-
this.headerRef =
|
|
1131
|
+
ref: (a) => {
|
|
1132
|
+
this.headerRef = a;
|
|
1032
1133
|
},
|
|
1033
1134
|
onHeaderscroll: this.onHeaderScroll,
|
|
1034
|
-
headerRow:
|
|
1135
|
+
headerRow: n(Kt, {
|
|
1035
1136
|
grid: this,
|
|
1036
1137
|
sort: e,
|
|
1037
1138
|
groupable: this.$props.groupable,
|
|
@@ -1040,14 +1141,14 @@ const rs = /* @__PURE__ */ $t({
|
|
|
1040
1141
|
onSortChange: this.sortChangeHandler,
|
|
1041
1142
|
filter: t,
|
|
1042
1143
|
filterable: this.$props.filterable,
|
|
1043
|
-
filterOperators: this.$props.filterOperators ||
|
|
1144
|
+
filterOperators: this.$props.filterOperators || qe,
|
|
1044
1145
|
onFilterChange: this.filterChangeHandler,
|
|
1045
1146
|
columnMenu: this.$props.columnMenu,
|
|
1046
1147
|
columnMenuIcon: this.$props.columnMenuIcon,
|
|
1047
1148
|
columnMenuAnimate: this.$props.columnMenuAnimate,
|
|
1048
1149
|
onSelectionchange: this.onHeaderSelectionChangeHandler,
|
|
1049
1150
|
columns: this.columnsRef,
|
|
1050
|
-
cellsToRender:
|
|
1151
|
+
cellsToRender: V,
|
|
1051
1152
|
columnVirtualization: this.$props.columnVirtualization,
|
|
1052
1153
|
columnsInitial: this.$props.columns,
|
|
1053
1154
|
columnResize: this.columnResize,
|
|
@@ -1058,16 +1159,16 @@ const rs = /* @__PURE__ */ $t({
|
|
|
1058
1159
|
cellRender: this.$props.headerCellRender,
|
|
1059
1160
|
isRtl: this.isRtl,
|
|
1060
1161
|
isColCountDefined: this.getAriaColCount !== void 0,
|
|
1061
|
-
headerSelectionValue: !!(
|
|
1062
|
-
filterRow: this.$props.filterable &&
|
|
1162
|
+
headerSelectionValue: !!(i && this.dataRef.filter((a) => a.rowType === "data").every((a) => i && this.$props.dataItemKey && P(this.$props.dataItemKey)(a.dataItem) !== void 0 ? i[P(this.$props.dataItemKey)(a.dataItem)] : void 0)),
|
|
1163
|
+
filterRow: this.$props.filterable && n(At, {
|
|
1063
1164
|
grid: this,
|
|
1064
1165
|
size: this.$props.size,
|
|
1065
1166
|
columns: this.columnsRef,
|
|
1066
1167
|
columnsMap: this._columnsMap,
|
|
1067
|
-
cellsToRender:
|
|
1168
|
+
cellsToRender: V,
|
|
1068
1169
|
columnVirtualization: this.$props.columnVirtualization,
|
|
1069
1170
|
filter: t,
|
|
1070
|
-
filterOperators: this.$props.filterOperators ||
|
|
1171
|
+
filterOperators: this.$props.filterOperators || qe,
|
|
1071
1172
|
onFilterchange: this.filterChangeHandler,
|
|
1072
1173
|
sort: this.$props.sort,
|
|
1073
1174
|
cellRender: this.$props.filterCellRender,
|
|
@@ -1075,286 +1176,185 @@ const rs = /* @__PURE__ */ $t({
|
|
|
1075
1176
|
ariaRowIndex: this._columnsMap.length + 1
|
|
1076
1177
|
}, null) || void 0
|
|
1077
1178
|
}, null),
|
|
1078
|
-
cols:
|
|
1079
|
-
}, null), ce = this.columnsRef.some((
|
|
1179
|
+
cols: O
|
|
1180
|
+
}, null), ce = this.columnsRef.some((a) => {
|
|
1181
|
+
var f;
|
|
1182
|
+
return !!(a.footerCell || (f = a.cells) != null && f.footerCell);
|
|
1183
|
+
}) || (De = this.$props.cells) != null && De.footerCell ? n(Ot, {
|
|
1080
1184
|
size: this.$props.size,
|
|
1081
1185
|
columnResize: this.columnResize,
|
|
1082
1186
|
staticHeaders: this.$props.scrollable !== "none",
|
|
1083
|
-
ref: (
|
|
1084
|
-
this.footerRef =
|
|
1187
|
+
ref: (a) => {
|
|
1188
|
+
this.footerRef = a;
|
|
1085
1189
|
},
|
|
1086
|
-
row:
|
|
1190
|
+
row: n(Nt, {
|
|
1087
1191
|
isRtl: this.isRtl,
|
|
1088
1192
|
rowIndex: this.getAriaRowCount + 1,
|
|
1089
|
-
columns: this.columnsRef
|
|
1193
|
+
columns: this.columnsRef,
|
|
1194
|
+
cells: this.$props.cells
|
|
1090
1195
|
}, null),
|
|
1091
|
-
cols:
|
|
1092
|
-
}, null) :
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
const g = je(this.$props.editField, r.dataItem);
|
|
1120
|
-
(g === !0 || g === n.field) && (p = !0, Le = !0);
|
|
1121
|
-
}
|
|
1122
|
-
let V;
|
|
1123
|
-
n.cell && (V = n.cell);
|
|
1124
|
-
const Fe = this.computedCollapsed && this.computedCollapsed[r.level] && this.computedCollapsed[r.level].some((g) => g === it(r.dataItem, this.$props.uniqueField)), Y = n.id ? n.id : R, Z = Fe ? !Fe : r.expanded || r.dataItem.expanded, Rt = n._type === "expand", ee = D.generateNavigatableId(`${b}-${String(R)}`, w, Rt || r.rowType === "groupHeader" || r.rowType === "groupFooter" || n.field === "value" ? "nodata" : "cell");
|
|
1125
|
-
return n.internalCell ? d(n.internalCell, {
|
|
1126
|
-
key: Y,
|
|
1127
|
-
id: ee,
|
|
1128
|
-
colSpan: P,
|
|
1129
|
-
dataItem: r.dataItem,
|
|
1130
|
-
field: n.field || "",
|
|
1131
|
-
editor: n.editor,
|
|
1132
|
-
format: n.format,
|
|
1133
|
-
readFormat: n.readFormat,
|
|
1134
|
-
type: n.type,
|
|
1135
|
-
columnType: n.columnType,
|
|
1136
|
-
className: Q,
|
|
1137
|
-
render: V || this.$props.cellRender,
|
|
1138
|
-
onChange: this.itemChange,
|
|
1139
|
-
onSelectionchange: (g) => this.selectionChangeHandler({
|
|
1140
|
-
event: g,
|
|
1141
|
-
dataItem: r.dataItem,
|
|
1142
|
-
dataIndex: y,
|
|
1143
|
-
columnIndex: R
|
|
1144
|
-
}),
|
|
1145
|
-
columnIndex: R,
|
|
1146
|
-
columnsCount: this.columnsRef.filter((g) => !g.children.length).length,
|
|
1147
|
-
rowType: r.rowType,
|
|
1148
|
-
level: r.level,
|
|
1149
|
-
expanded: Z,
|
|
1150
|
-
dataIndex: r.dataIndex,
|
|
1151
|
-
style: X,
|
|
1152
|
-
ariaColumnIndex: n.ariaColumnIndex,
|
|
1153
|
-
isRtl: this.isRtl,
|
|
1154
|
-
isSelected: !!((n == null ? void 0 : n._type) === "edit" ? x : Array.isArray(x) && x.indexOf(R) > -1),
|
|
1155
|
-
isHighlighted: !!(typeof v != "boolean" && v && n.field && v[n.field] === !0),
|
|
1156
|
-
group: r.group,
|
|
1157
|
-
rowSpan: $
|
|
1158
|
-
}, null) : Le ? d(jt, {
|
|
1159
|
-
id: ee,
|
|
1160
|
-
key: Y,
|
|
1161
|
-
colSpan: P,
|
|
1162
|
-
dataItem: r.dataItem,
|
|
1163
|
-
field: n.field || "",
|
|
1164
|
-
editor: n.editor,
|
|
1165
|
-
format: n.format,
|
|
1166
|
-
readFormat: n.readFormat,
|
|
1167
|
-
type: n.type,
|
|
1168
|
-
columnType: n.columnType,
|
|
1169
|
-
className: Q,
|
|
1170
|
-
render: V || this.$props.cellRender,
|
|
1171
|
-
onEdit: this.editHandler,
|
|
1172
|
-
onRemove: this.removeHandler,
|
|
1173
|
-
onSave: this.saveHandler,
|
|
1174
|
-
onCancel: this.cancelHandler,
|
|
1175
|
-
onChange: this.itemChange,
|
|
1176
|
-
columnIndex: R,
|
|
1177
|
-
columnsCount: this.columnsRef.filter((g) => !g.children.length).length,
|
|
1178
|
-
rowType: r.rowType,
|
|
1179
|
-
level: r.level,
|
|
1180
|
-
expanded: Z,
|
|
1181
|
-
dataIndex: r.dataIndex,
|
|
1182
|
-
style: X
|
|
1183
|
-
}, null) : d(gi, {
|
|
1184
|
-
key: Y,
|
|
1185
|
-
id: ee,
|
|
1186
|
-
colSpan: P,
|
|
1187
|
-
dataItem: r.dataItem,
|
|
1188
|
-
field: n.field || "",
|
|
1189
|
-
editor: n.editor,
|
|
1190
|
-
format: n.format,
|
|
1191
|
-
readFormat: n.readFormat,
|
|
1192
|
-
type: n.type,
|
|
1193
|
-
columnType: n.columnType,
|
|
1194
|
-
className: Q,
|
|
1195
|
-
render: V || this.$props.cellRender,
|
|
1196
|
-
onCellclick: this.cellClickHandler,
|
|
1197
|
-
onCellkeydown: this.cellKeydownHandler,
|
|
1198
|
-
onEdit: this.editHandler,
|
|
1199
|
-
onRemove: this.removeHandler,
|
|
1200
|
-
onSave: this.saveHandler,
|
|
1201
|
-
onCancel: this.cancelHandler,
|
|
1202
|
-
onChange: this.itemChange,
|
|
1203
|
-
onSelectionchange: (g) => this.selectionChangeHandler({
|
|
1204
|
-
event: g,
|
|
1205
|
-
dataItem: r.dataItem,
|
|
1206
|
-
dataIndex: y,
|
|
1207
|
-
columnIndex: R
|
|
1208
|
-
}),
|
|
1209
|
-
columnIndex: R,
|
|
1210
|
-
columnsCount: this.columnsRef.filter((g) => !g.children.length).length,
|
|
1211
|
-
rowType: r.rowType,
|
|
1212
|
-
level: r.level,
|
|
1213
|
-
expanded: Z,
|
|
1214
|
-
dataIndex: r.dataIndex,
|
|
1215
|
-
style: X,
|
|
1216
|
-
rowSpan: $,
|
|
1217
|
-
isSelected: !!((n == null ? void 0 : n._type) === "edit" ? x : Array.isArray(x) && x.indexOf(R) > -1),
|
|
1218
|
-
isHighlighted: !!(typeof v != "boolean" && v && n.field && v[n.field] === !0)
|
|
1219
|
-
}, null);
|
|
1220
|
-
}, this),
|
|
1221
|
-
isInEdit: p,
|
|
1222
|
-
isSelected: typeof x == "boolean" && x,
|
|
1223
|
-
isHighlighted: typeof v == "boolean" && v
|
|
1224
|
-
};
|
|
1196
|
+
cols: O
|
|
1197
|
+
}, null) : n("span", null, null), Q = {
|
|
1198
|
+
leafColumns: I,
|
|
1199
|
+
cellsToRender: V,
|
|
1200
|
+
selectedField: this.$props.selectedField,
|
|
1201
|
+
dataItemKey: this.$props.dataItemKey,
|
|
1202
|
+
select: i,
|
|
1203
|
+
highlight: this.$props.highlight,
|
|
1204
|
+
editField: this.$props.editField,
|
|
1205
|
+
cellRender: this.$props.cellRender,
|
|
1206
|
+
cells: this.$props.cells,
|
|
1207
|
+
getCellsToRender: this.getCellsToRender,
|
|
1208
|
+
hasDynamicColSpan: ot,
|
|
1209
|
+
itemChange: this.itemChange,
|
|
1210
|
+
selectionChangeHandler: this.selectionChangeHandler,
|
|
1211
|
+
editHandler: this.editHandler,
|
|
1212
|
+
removeHandler: this.removeHandler,
|
|
1213
|
+
saveHandler: this.saveHandler,
|
|
1214
|
+
cancelHandler: this.cancelHandler,
|
|
1215
|
+
cellClickHandler: this.cellClickHandler,
|
|
1216
|
+
cellKeydownHandler: this.cellKeydownHandler,
|
|
1217
|
+
computedCollapsed: this.computedCollapsed,
|
|
1218
|
+
uniqueField: this.$props.uniqueField,
|
|
1219
|
+
columnsRef: this.columnsRef,
|
|
1220
|
+
isRtl: this.isRtl,
|
|
1221
|
+
idPrefix: $
|
|
1222
|
+
}, rt = function(a, f, v, te, se) {
|
|
1223
|
+
return ps(Q, a, f, v, te, se);
|
|
1225
1224
|
};
|
|
1226
|
-
let
|
|
1227
|
-
const
|
|
1228
|
-
let
|
|
1229
|
-
if (this.
|
|
1230
|
-
const
|
|
1231
|
-
let
|
|
1232
|
-
const
|
|
1225
|
+
let lt = 0, X = [];
|
|
1226
|
+
const Y = !this.dataRef.length, ue = (a) => a >= this.dataRef.length - lt;
|
|
1227
|
+
let Z = 0;
|
|
1228
|
+
if (this.dataRef.length) {
|
|
1229
|
+
const a = this._columnsMap.length + (this.$props.filterable ? 1 : 0) + 1;
|
|
1230
|
+
let f = this.$props.skip || 0, v = -1, te = 0;
|
|
1231
|
+
const se = this.computedRowSpannable.enabled ? {} : void 0;
|
|
1233
1232
|
if (this.isVirtualScroll) {
|
|
1234
|
-
if (
|
|
1235
|
-
const p = this.
|
|
1236
|
-
|
|
1233
|
+
if (T > 0) {
|
|
1234
|
+
const p = this.dataRef.slice(0, T).filter((_) => _.rowType === "data").length;
|
|
1235
|
+
v += p, f += T;
|
|
1237
1236
|
}
|
|
1238
|
-
!this.$props.pageable &&
|
|
1237
|
+
!this.$props.pageable && F && (v += this.$props.skip || 0);
|
|
1239
1238
|
}
|
|
1240
|
-
|
|
1241
|
-
p.rowType === "data" &&
|
|
1242
|
-
const
|
|
1243
|
-
return
|
|
1244
|
-
key:
|
|
1239
|
+
X = (S || this.dataRef).map(function(p, _) {
|
|
1240
|
+
p.rowType === "data" && v++;
|
|
1241
|
+
const ie = p.dataIndex % 2 !== 0, Le = this.$props.dataItemKey && P(this.$props.dataItemKey)(p.dataItem), oe = _ + f, re = Le || "ai" + oe, le = re + "_1", N = rt.call(this, p, re, v, ie, se), ht = I.length - (this.detailExpandable.enabled ? 1 : 0) - ((l == null ? void 0 : l.length) || 0) || 1;
|
|
1242
|
+
return Z = oe + a + te, [n(ls, {
|
|
1243
|
+
key: re,
|
|
1245
1244
|
item: p,
|
|
1246
|
-
dataIndex:
|
|
1247
|
-
ariaRowIndex:
|
|
1248
|
-
absoluteRowIndex:
|
|
1249
|
-
isAltRow:
|
|
1245
|
+
dataIndex: v,
|
|
1246
|
+
ariaRowIndex: Z,
|
|
1247
|
+
absoluteRowIndex: oe,
|
|
1248
|
+
isAltRow: ie,
|
|
1250
1249
|
isHidden: ue(_),
|
|
1251
1250
|
rowHeight: this.$props.rowHeight,
|
|
1252
|
-
isSelected:
|
|
1253
|
-
isHighlighted:
|
|
1254
|
-
isInEdit:
|
|
1251
|
+
isSelected: N.isSelected,
|
|
1252
|
+
isHighlighted: N.isHighlighted,
|
|
1253
|
+
isInEdit: N.isInEdit,
|
|
1255
1254
|
rowType: p.rowType,
|
|
1256
|
-
onRowclick: (
|
|
1257
|
-
onRowdblclick: (
|
|
1255
|
+
onRowclick: (E) => this.rowClick(E, p),
|
|
1256
|
+
onRowdblclick: (E) => this.rowDoubleClick(E, p),
|
|
1258
1257
|
render: this.$props.rowRender,
|
|
1259
1258
|
class: this.$props.rowClass ? this.$props.rowClass(p) : ""
|
|
1260
1259
|
}, {
|
|
1261
|
-
default: () => [
|
|
1262
|
-
}), this.$props.detail && p.rowType === "data" && (p.expanded || p.dataItem.expanded) &&
|
|
1263
|
-
key:
|
|
1264
|
-
class:
|
|
1260
|
+
default: () => [N.row]
|
|
1261
|
+
}), this.$props.detail && p.rowType === "data" && (p.expanded || p.dataItem.expanded) && n("tr", {
|
|
1262
|
+
key: le,
|
|
1263
|
+
class: ie ? "k-table-row k-table-alt-row k-detail-row" : "k-table-row k-detail-row",
|
|
1265
1264
|
style: {
|
|
1266
1265
|
visibility: ue(_) ? "hidden" : "",
|
|
1267
1266
|
height: this.$props.detailRowHeight + "px"
|
|
1268
1267
|
},
|
|
1269
1268
|
role: "row",
|
|
1270
|
-
"aria-rowindex":
|
|
1271
|
-
}, [
|
|
1272
|
-
return
|
|
1269
|
+
"aria-rowindex": Z
|
|
1270
|
+
}, [l == null ? void 0 : l.map(function(E) {
|
|
1271
|
+
return n(ne, {
|
|
1273
1272
|
id: "",
|
|
1274
1273
|
dataIndex: p.dataIndex,
|
|
1275
|
-
field:
|
|
1274
|
+
field: E.field,
|
|
1276
1275
|
dataItem: p.dataItem,
|
|
1277
|
-
key: `group-${
|
|
1276
|
+
key: `group-${E.field}-${p.dataIndex}`,
|
|
1277
|
+
locked: this.$props.lockGroups,
|
|
1278
1278
|
group: p.group
|
|
1279
1279
|
}, null);
|
|
1280
|
-
}, this), (this.$props.expandField || this.detailExpandable.enabled) &&
|
|
1281
|
-
id:
|
|
1282
|
-
}, null),
|
|
1280
|
+
}, this), (this.$props.expandField || this.detailExpandable.enabled) && n(_t, {
|
|
1281
|
+
id: H.generateNavigatableId(`${le}-dhcell`, $)
|
|
1282
|
+
}, null), n(Pt, {
|
|
1283
1283
|
dataItem: p.dataItem,
|
|
1284
1284
|
dataIndex: p.dataIndex,
|
|
1285
|
-
colSpan:
|
|
1286
|
-
ariaColIndex: 2 + (
|
|
1285
|
+
colSpan: ht,
|
|
1286
|
+
ariaColIndex: 2 + (l ? l.length : 0),
|
|
1287
1287
|
detail: this.$props.detail ? this.$props.detail : void 0,
|
|
1288
|
-
id:
|
|
1288
|
+
id: H.generateNavigatableId(`${le}-dcell`, $)
|
|
1289
1289
|
}, null)])];
|
|
1290
1290
|
}, this);
|
|
1291
1291
|
}
|
|
1292
|
-
const
|
|
1292
|
+
const at = this.$props.pageable && n(xt, {
|
|
1293
1293
|
class: "k-grid-pager",
|
|
1294
1294
|
onPagesizechange: this.pageChangeHandler,
|
|
1295
1295
|
onPagechange: this.pageChangeHandler,
|
|
1296
1296
|
size: this.$props.size,
|
|
1297
|
-
total:
|
|
1298
|
-
skip:
|
|
1299
|
-
pageSize: (
|
|
1300
|
-
messagesMap:
|
|
1301
|
-
settings:
|
|
1302
|
-
}, null), fe =
|
|
1303
|
-
h:
|
|
1297
|
+
total: k,
|
|
1298
|
+
skip: o || 0,
|
|
1299
|
+
pageSize: (r !== void 0 ? r : this.$props.pageSize) || 10,
|
|
1300
|
+
messagesMap: et,
|
|
1301
|
+
settings: wt(this.$props.pageable || {})
|
|
1302
|
+
}, null), fe = Me.call(this, {
|
|
1303
|
+
h: _e,
|
|
1304
1304
|
template: this.$props.pager,
|
|
1305
|
-
defaultRendering:
|
|
1305
|
+
defaultRendering: at,
|
|
1306
1306
|
additionalProps: {
|
|
1307
1307
|
...this.$props,
|
|
1308
1308
|
skip: this.$props.skip || 0,
|
|
1309
|
-
messagesMap:
|
|
1309
|
+
messagesMap: et
|
|
1310
1310
|
},
|
|
1311
1311
|
additionalListeners: {
|
|
1312
1312
|
pagesizechange: this.pageChangeHandler,
|
|
1313
1313
|
pagechange: this.pageChangeHandler
|
|
1314
1314
|
}
|
|
1315
|
-
}),
|
|
1316
|
-
ref:
|
|
1317
|
-
}, [
|
|
1318
|
-
return
|
|
1319
|
-
key:
|
|
1320
|
-
class:
|
|
1321
|
-
width:
|
|
1315
|
+
}), nt = (a) => e && e.filter((f) => f.field === a).length > 0, ge = n("colgroup", {
|
|
1316
|
+
ref: w(this, "colGroup")
|
|
1317
|
+
}, [I.map(function(a, f) {
|
|
1318
|
+
return n("col", {
|
|
1319
|
+
key: a.id || `col-${f}`,
|
|
1320
|
+
class: nt(a.field) ? "k-sorted" : void 0,
|
|
1321
|
+
width: a.width !== void 0 ? a.width.toString().indexOf("%") !== -1 ? a.width : Math.floor(parseFloat(a.width.toString())) + "px" : void 0
|
|
1322
1322
|
}, null);
|
|
1323
1323
|
}, this)]), me = {
|
|
1324
1324
|
height: this.getCorrectHeight,
|
|
1325
1325
|
...this.$attrs.style
|
|
1326
|
-
},
|
|
1326
|
+
}, dt = n("div", {
|
|
1327
1327
|
class: "k-loading-mask"
|
|
1328
|
-
}, [
|
|
1328
|
+
}, [n("div", {
|
|
1329
1329
|
class: "k-loading-color"
|
|
1330
|
-
}, null),
|
|
1330
|
+
}, null), n("div", {
|
|
1331
1331
|
style: {
|
|
1332
1332
|
height: "100%",
|
|
1333
1333
|
display: "flex",
|
|
1334
1334
|
justifyContent: "center",
|
|
1335
1335
|
alignItems: "center"
|
|
1336
1336
|
}
|
|
1337
|
-
}, [
|
|
1337
|
+
}, [n(Lt, {
|
|
1338
1338
|
size: "large",
|
|
1339
1339
|
type: "converging-spinner"
|
|
1340
|
-
}, null)])]),
|
|
1341
|
-
h:
|
|
1340
|
+
}, null)])]), ee = this.$props.showLoader && Me.call(this, {
|
|
1341
|
+
h: _e,
|
|
1342
1342
|
template: this.$props.loader,
|
|
1343
|
-
defaultRendering:
|
|
1343
|
+
defaultRendering: dt
|
|
1344
1344
|
});
|
|
1345
|
-
return this.$props.scrollable === "none" ?
|
|
1345
|
+
return this.$props.scrollable === "none" ? n(Ne, {
|
|
1346
1346
|
ref: "navRef",
|
|
1347
1347
|
id: this._gridId,
|
|
1348
1348
|
navigatable: this.$props.navigatable,
|
|
1349
1349
|
scrollable: this.$props.scrollable,
|
|
1350
1350
|
columnVirtualization: this.$props.columnVirtualization
|
|
1351
1351
|
}, {
|
|
1352
|
-
default: () => [
|
|
1353
|
-
ref: (
|
|
1354
|
-
this.gridNavRef =
|
|
1352
|
+
default: () => [n(Ue, {
|
|
1353
|
+
ref: (a) => {
|
|
1354
|
+
this.gridNavRef = a;
|
|
1355
1355
|
},
|
|
1356
1356
|
columnsRef: this.columnsRef,
|
|
1357
|
-
|
|
1357
|
+
dataRef: this.dataRef,
|
|
1358
1358
|
id: this.$props.id,
|
|
1359
1359
|
style: me,
|
|
1360
1360
|
class: this.nonscrollableWrapperClass,
|
|
@@ -1363,95 +1363,113 @@ const rs = /* @__PURE__ */ $t({
|
|
|
1363
1363
|
onColumnreorder: this.columnReorder,
|
|
1364
1364
|
onKeyboardselectionchange: this.onKeyboardSelectionChangeHandler
|
|
1365
1365
|
}, {
|
|
1366
|
-
default: () => [
|
|
1366
|
+
default: () => [A, D, n("div", {
|
|
1367
1367
|
role: "grid",
|
|
1368
1368
|
class: "k-grid-aria-root",
|
|
1369
1369
|
id: this._gridRoleElementId,
|
|
1370
1370
|
"aria-colcount": this.getAriaColCount,
|
|
1371
1371
|
"aria-rowcount": this.getAriaRowCount
|
|
1372
|
-
}, [
|
|
1372
|
+
}, [n(Wt, {
|
|
1373
1373
|
selectable: this.computedSelectable,
|
|
1374
1374
|
class: "k-table",
|
|
1375
|
-
ref:
|
|
1375
|
+
ref: w(this, "table")
|
|
1376
1376
|
}, {
|
|
1377
|
-
default: () => [ge, pe,
|
|
1377
|
+
default: () => [ge, pe, n("tbody", {
|
|
1378
1378
|
class: "k-table-tbody",
|
|
1379
|
-
"data-keyboardnavbody": !0
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1379
|
+
"data-keyboardnavbody": !0,
|
|
1380
|
+
ref: w(this, "tableBody")
|
|
1381
|
+
}, [X, ct(" "), ee]), ce]
|
|
1382
|
+
}), Y && n(Ze, {
|
|
1383
|
+
id: H.generateNavigatableId("no-records", $)
|
|
1383
1384
|
}, {
|
|
1384
|
-
default: () => [
|
|
1385
|
-
})]), fe,
|
|
1385
|
+
default: () => [z.length ? z : n(Ye, null, null)]
|
|
1386
|
+
})]), fe, ee, he]
|
|
1386
1387
|
})]
|
|
1387
|
-
}) :
|
|
1388
|
+
}) : n(Ne, {
|
|
1388
1389
|
ref: "navRef",
|
|
1389
1390
|
id: this._gridId,
|
|
1390
1391
|
navigatable: this.$props.navigatable,
|
|
1391
1392
|
scrollable: this.$props.scrollable,
|
|
1392
1393
|
columnVirtualization: this.$props.columnVirtualization
|
|
1393
1394
|
}, {
|
|
1394
|
-
default: () => [
|
|
1395
|
-
ref: (
|
|
1396
|
-
this.gridNavRef =
|
|
1395
|
+
default: () => [n(Ue, {
|
|
1396
|
+
ref: (a) => {
|
|
1397
|
+
this.gridNavRef = a;
|
|
1397
1398
|
},
|
|
1398
|
-
|
|
1399
|
+
dataRef: this.dataRef,
|
|
1399
1400
|
id: this.$props.id,
|
|
1400
1401
|
style: me,
|
|
1401
1402
|
class: this.scrollableWrapperClass,
|
|
1402
1403
|
onMovetonextpage: this.moveToNextPage,
|
|
1403
1404
|
onMovetoprevpage: this.moveToPrevPage,
|
|
1404
1405
|
onColumnreorder: this.columnReorder,
|
|
1405
|
-
onKeyboardselectionchange: this.onKeyboardSelectionChangeHandler
|
|
1406
|
+
onKeyboardselectionchange: this.onKeyboardSelectionChangeHandler,
|
|
1407
|
+
onSetcurrentontop: this.setCurrentOnTop
|
|
1406
1408
|
}, {
|
|
1407
|
-
default: () => [
|
|
1409
|
+
default: () => [A, D, n("div", {
|
|
1408
1410
|
role: "grid",
|
|
1409
1411
|
class: "k-grid-aria-root",
|
|
1410
1412
|
id: this._gridRoleElementId,
|
|
1411
1413
|
"aria-colcount": this.getAriaColCount,
|
|
1412
1414
|
"aria-rowcount": this.getAriaRowCount
|
|
1413
|
-
}, [pe,
|
|
1415
|
+
}, [pe, n("div", {
|
|
1414
1416
|
class: "k-grid-container",
|
|
1415
1417
|
role: "presentation"
|
|
1416
|
-
}, [
|
|
1418
|
+
}, [C && u && n(tt, {
|
|
1419
|
+
ref: w(this, "stickyHeader"),
|
|
1420
|
+
size: this.$props.size,
|
|
1421
|
+
cols: O,
|
|
1422
|
+
dataRowContext: Q,
|
|
1423
|
+
position: "top",
|
|
1424
|
+
groupLevelCount: g,
|
|
1425
|
+
rowHeight: this.$props.rowHeight
|
|
1426
|
+
}, null), n("div", {
|
|
1417
1427
|
role: "presentation",
|
|
1418
|
-
ref:
|
|
1428
|
+
ref: w(this, "scrollContainer"),
|
|
1419
1429
|
class: "k-grid-content k-virtual-content",
|
|
1420
1430
|
onScroll: this.scrollHandler
|
|
1421
|
-
}, [
|
|
1431
|
+
}, [n("div", {
|
|
1422
1432
|
class: "k-grid-table-wrap",
|
|
1423
1433
|
role: "presentation"
|
|
1424
|
-
}, [
|
|
1434
|
+
}, [n(Bt, {
|
|
1425
1435
|
selectable: this.computedSelectable,
|
|
1426
1436
|
tableClassName: this.gridTableClass,
|
|
1427
1437
|
tableStyle: {
|
|
1428
|
-
userSelect:
|
|
1438
|
+
userSelect: q
|
|
1429
1439
|
},
|
|
1430
|
-
ref:
|
|
1440
|
+
ref: w(this, "table")
|
|
1431
1441
|
}, {
|
|
1432
|
-
default: () => [ge,
|
|
1442
|
+
default: () => [ge, n("tbody", {
|
|
1433
1443
|
class: "k-table-tbody",
|
|
1434
1444
|
role: "rowgroup",
|
|
1435
1445
|
"data-keyboardnavbody": !0,
|
|
1436
|
-
ref:
|
|
1437
|
-
}, [
|
|
1438
|
-
}),
|
|
1439
|
-
id:
|
|
1446
|
+
ref: w(this, "tableBody")
|
|
1447
|
+
}, [X])]
|
|
1448
|
+
}), Y && n(Ze, {
|
|
1449
|
+
id: H.generateNavigatableId("no-records", $)
|
|
1440
1450
|
}, {
|
|
1441
|
-
default: () => [
|
|
1442
|
-
})]), !
|
|
1451
|
+
default: () => [z.length ? z : n(Ye, null, null)]
|
|
1452
|
+
})]), !Y && n("div", {
|
|
1443
1453
|
class: "k-height-container",
|
|
1444
1454
|
role: "presentation"
|
|
1445
|
-
}, [
|
|
1446
|
-
ref:
|
|
1455
|
+
}, [n("div", {
|
|
1456
|
+
ref: w(this, "scrollHeightContainer"),
|
|
1447
1457
|
style: this.$props.scrollable === "virtual" ? {
|
|
1448
1458
|
height: this._containerHeightRef + "px"
|
|
1449
1459
|
} : {}
|
|
1450
|
-
}, null)])])
|
|
1460
|
+
}, null)])]), C && R && n(tt, {
|
|
1461
|
+
ref: w(this, "stickyFooter"),
|
|
1462
|
+
size: this.$props.size,
|
|
1463
|
+
cols: O,
|
|
1464
|
+
dataRowContext: Q,
|
|
1465
|
+
position: "bottom",
|
|
1466
|
+
groupLevelCount: g,
|
|
1467
|
+
rowHeight: this.$props.rowHeight
|
|
1468
|
+
}, null)]), ce, st]), fe, ee, he]
|
|
1451
1469
|
})]
|
|
1452
1470
|
});
|
|
1453
1471
|
}
|
|
1454
1472
|
});
|
|
1455
1473
|
export {
|
|
1456
|
-
|
|
1474
|
+
Ys as Grid
|
|
1457
1475
|
};
|