@progress/kendo-vue-grid 7.0.3-develop.1 → 7.1.0-develop.2
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 +658 -509
- package/GridColumn.js +8 -0
- package/GridColumn.mjs +18 -0
- package/GridSearchBox.js +8 -0
- package/GridSearchBox.mjs +60 -0
- package/GridState.js +8 -0
- package/GridState.mjs +94 -0
- package/RootGrid.js +8 -0
- package/RootGrid.mjs +98 -0
- package/cells/GridGroupCell.js +1 -1
- package/cells/GridGroupCell.mjs +38 -26
- package/cells/GridHierarchyCell.js +1 -1
- package/cells/GridHierarchyCell.mjs +23 -13
- package/common.js +8 -0
- package/common.mjs +121 -0
- package/dist/cdn/js/kendo-vue-grid.js +1 -1
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +131 -50
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +1 -1
- package/index.d.mts +567 -235
- package/index.d.ts +567 -235
- package/index.js +1 -1
- package/index.mjs +55 -46
- package/key.js +8 -0
- package/key.mjs +11 -0
- package/messages/main.js +2 -1
- package/messages/main.mjs +158 -80
- package/messages/messagesMap.js +8 -0
- package/messages/messagesMap.mjs +18 -0
- 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 +188 -172
- package/utils/virtualColumns.js +8 -0
- package/utils/virtualColumns.mjs +38 -0
package/Grid.mjs
CHANGED
|
@@ -5,117 +5,52 @@
|
|
|
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 {
|
|
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 { GridEditCell as
|
|
18
|
-
import { Header as
|
|
19
|
-
import { HeaderRow as
|
|
20
|
-
import { FilterRow as
|
|
21
|
-
import { GroupPanel as
|
|
22
|
-
import { Footer as
|
|
23
|
-
import { FooterRow as
|
|
24
|
-
import { operators as
|
|
25
|
-
import { VirtualScroll as
|
|
26
|
-
import { VirtualScrollFixed as
|
|
27
|
-
import { ColumnResize as
|
|
28
|
-
import { CommonDragLogic as
|
|
29
|
-
import { DragClue as
|
|
30
|
-
import { DropClue as
|
|
31
|
-
import { applyExpandedState as
|
|
32
|
-
import { GridCell as
|
|
33
|
-
import { GridGroupCell as
|
|
34
|
-
import { GridRow as
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
|
|
8
|
+
import { defineComponent as st, createVNode as o, h as Ee, ref as b, inject as it, markRaw as k } from "vue";
|
|
9
|
+
import { isObject as M, cloneArray as rt, canUseDOM as j, WatermarkOverlay as lt, getter as q, getTemplate as _e, setRef as A, hasListener as z, getRef as R, kendoThemeMaps as De, uGrid as at, isRtl as Ge, validatePackage as ot, shouldShowValidationUI as nt, getLicenseMessage as dt, guid as ze, getNestedValue as Te } from "@progress/kendo-vue-common";
|
|
10
|
+
import { tableKeyboardNavigationTools as H, combineFilters as ht, Pager as pt, normalize as ut, TableKeyboardNavigationProvider as Fe, updateLeft as ct, updateRight as gt, groupExpandReducer as ft, detailExpandReducer as mt, getDetailExpandableOptions as Ct, getGroupExpandableOptions as $t } from "@progress/kendo-vue-data-tools";
|
|
11
|
+
import { Loader as bt } from "@progress/kendo-vue-indicators";
|
|
12
|
+
import { GridNav as Le } from "./GridNav.mjs";
|
|
13
|
+
import { GridSelectionCell as Me } from "./cells/GridSelectionCell.mjs";
|
|
14
|
+
import { GridHierarchyCell as J } from "./cells/GridHierarchyCell.mjs";
|
|
15
|
+
import { GridDetailHierarchyCell as vt } from "./cells/GridDetailHierarchyCell.mjs";
|
|
16
|
+
import { GridDetailCell as xt } from "./cells/GridDetailCell.mjs";
|
|
17
|
+
import { GridEditCell as It } from "./cells/GridEditCell.mjs";
|
|
18
|
+
import { Header as wt } from "./header/Header.mjs";
|
|
19
|
+
import { HeaderRow as Rt } from "./header/HeaderRow.mjs";
|
|
20
|
+
import { FilterRow as kt } from "./header/FilterRow.mjs";
|
|
21
|
+
import { GroupPanel as yt } from "./header/GroupPanel.mjs";
|
|
22
|
+
import { Footer as St } from "./footer/Footer.mjs";
|
|
23
|
+
import { FooterRow as Ht } from "./footer/FooterRow.mjs";
|
|
24
|
+
import { operators as Ae } from "./filterCommon.mjs";
|
|
25
|
+
import { VirtualScroll as Q } from "./VirtualScroll.mjs";
|
|
26
|
+
import { VirtualScrollFixed as Et, RowHeightService as _t } from "./VirtualScrollFixed.mjs";
|
|
27
|
+
import { ColumnResize as Dt } from "./drag/ColumnResize.mjs";
|
|
28
|
+
import { CommonDragLogic as Gt } from "./drag/CommonDragLogic.mjs";
|
|
29
|
+
import { DragClue as zt } from "./drag/DragClue.mjs";
|
|
30
|
+
import { DropClue as Tt } from "./drag/DropClue.mjs";
|
|
31
|
+
import { applyExpandedState as Pe, getColSpan as Ft, autoGenerateColumns as Lt, mapColumns as Mt, getFlatColumnsState as Ve, getRowSpanOptions as Ne, groupedFirstItemValue as Oe, firefox as At, firefoxMaxHeight as Pt, flatData as Vt, readColumns as Nt } from "./utils/main.mjs";
|
|
32
|
+
import { GridCell as Ot } from "./cells/GridCell.mjs";
|
|
33
|
+
import { GridGroupCell as X } from "./cells/GridGroupCell.mjs";
|
|
34
|
+
import { GridRow as Wt } from "./rows/GridRow.mjs";
|
|
35
|
+
import { gridProps as Kt } from "./common.mjs";
|
|
36
|
+
import { GridHeaderSelectionCell as We } from "./header/GridHeaderSelectionCell.mjs";
|
|
37
|
+
import { GridNoRecords as Ut } from "./GridNoRecords.mjs";
|
|
38
|
+
import { packageMetadata as Y } from "./package-metadata.mjs";
|
|
39
|
+
import { pagerMessagesMap as Ke } from "./messages/messagesMap.mjs";
|
|
40
|
+
import { process as Bt } from "@progress/kendo-data-query";
|
|
41
|
+
import { KendoKey as jt } from "./key.mjs";
|
|
42
|
+
import { getVirtualCellsToRender as qt } from "./utils/virtualColumns.mjs";
|
|
43
|
+
const Gs = /* @__PURE__ */ st({
|
|
40
44
|
name: "KendoGrid",
|
|
45
|
+
inheritAttrs: !1,
|
|
41
46
|
props: {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
collapsedGroups: {
|
|
47
|
-
type: Array,
|
|
48
|
-
default: function() {
|
|
49
|
-
return [];
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
uniqueField: String,
|
|
53
|
-
totalGroupedHeight: Number,
|
|
54
|
-
allGroupedItems: Object,
|
|
55
|
-
alternatePerGroup: Boolean,
|
|
56
|
-
columns: Array,
|
|
57
|
-
columnVirtualization: Boolean,
|
|
58
|
-
dataItems: [Array, Object],
|
|
59
|
-
sortable: [Boolean, Object],
|
|
60
|
-
sort: Array,
|
|
61
|
-
filterable: Boolean,
|
|
62
|
-
filterOperators: Object,
|
|
63
|
-
filterCellRender: [String, Function, Object],
|
|
64
|
-
headerCellRender: [String, Function, Object],
|
|
65
|
-
loader: [String, Function, Object, Boolean],
|
|
66
|
-
filter: Object,
|
|
67
|
-
highlight: Object,
|
|
68
|
-
pageable: [Boolean, Object],
|
|
69
|
-
pageSize: Number,
|
|
70
|
-
total: Number,
|
|
71
|
-
skip: Number,
|
|
72
|
-
take: Number,
|
|
73
|
-
expandField: String,
|
|
74
|
-
expandColumn: Object,
|
|
75
|
-
selectedField: String,
|
|
76
|
-
cellRender: [String, Function, Object],
|
|
77
|
-
rowRender: [String, Function, Object],
|
|
78
|
-
resizable: Boolean,
|
|
79
|
-
reorderable: Boolean,
|
|
80
|
-
group: Array,
|
|
81
|
-
groupable: [Boolean, Object],
|
|
82
|
-
editField: String,
|
|
83
|
-
rowClass: Function,
|
|
84
|
-
scrollable: {
|
|
85
|
-
type: String,
|
|
86
|
-
default: "scrollable"
|
|
87
|
-
},
|
|
88
|
-
size: {
|
|
89
|
-
type: String,
|
|
90
|
-
default: "medium",
|
|
91
|
-
validator: function(e) {
|
|
92
|
-
return ["small", "medium"].includes(e);
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
pager: [String, Function, Object],
|
|
96
|
-
rowHeight: Number,
|
|
97
|
-
detailRowHeight: Number,
|
|
98
|
-
detail: [String, Function, Object],
|
|
99
|
-
columnMenu: [Boolean, String, Function, Object],
|
|
100
|
-
columnMenuAnimate: {
|
|
101
|
-
type: [Boolean, Object],
|
|
102
|
-
default: function() {
|
|
103
|
-
return !0;
|
|
104
|
-
}
|
|
47
|
+
...Kt,
|
|
48
|
+
toolbar: {
|
|
49
|
+
type: Object
|
|
105
50
|
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
type: Boolean,
|
|
110
|
-
default: !1
|
|
111
|
-
},
|
|
112
|
-
onItemchange: Function,
|
|
113
|
-
onExpandchange: Function,
|
|
114
|
-
onDatastatechange: Function,
|
|
115
|
-
onPagechange: Function,
|
|
116
|
-
onSortchange: Function,
|
|
117
|
-
onFilterchange: Function,
|
|
118
|
-
onGroupchange: Function
|
|
51
|
+
noRecords: {
|
|
52
|
+
type: Object
|
|
53
|
+
}
|
|
119
54
|
},
|
|
120
55
|
data() {
|
|
121
56
|
return {
|
|
@@ -139,32 +74,52 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
139
74
|
}
|
|
140
75
|
},
|
|
141
76
|
created() {
|
|
142
|
-
|
|
77
|
+
ot(Y), this.showLicenseWatermark = nt(Y), this.licenseMessage = dt(Y), this.initialHeight = null, this._columns = [];
|
|
143
78
|
const e = this.currentGroupable, t = this.getVirtualScroll();
|
|
144
|
-
this.vs = new t(e || this.$props.rowHeight === void 0 || this.$props.rowHeight === 0, this.$props.topCacheCount), this.dragLogic = new
|
|
79
|
+
this.vs = new t(e || this.$props.rowHeight === void 0 || this.$props.rowHeight === 0, this.$props.topCacheCount), this.dragLogic = new Gt(this.columnReorder.bind(this), this.groupReorder.bind(this), this.columnToGroup.bind(this)), this.columnResize = new Dt(this.onResize.bind(this)), this._columnsMap = [[]], this._header = null, this._footer = null, this.forceUpdateTimeout = void 0, this._gridId = ze(), this._gridRoleElementId = ze(), this.slicedCurrentData = void 0, this._prevTotal = void 0;
|
|
145
80
|
},
|
|
146
81
|
mounted() {
|
|
82
|
+
var t, s;
|
|
147
83
|
this.setRefs();
|
|
148
|
-
const e =
|
|
149
|
-
this._prevTotal = this.$props.total, this.isRtl = e, this.initialHeight = this._element.style ?
|
|
84
|
+
const e = Ge(this._element);
|
|
85
|
+
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 = j && (window == null ? void 0 : window.ResizeObserver) && new ResizeObserver(this.calculateMedia), document != null && document.body && this.resizeObserver && this.resizeObserver.observe(document.body);
|
|
150
86
|
},
|
|
151
87
|
updated() {
|
|
152
88
|
this.setRefs();
|
|
153
|
-
const e =
|
|
89
|
+
const e = Ge(this._element);
|
|
154
90
|
this.isRtl = e, this._prevTotal = this.$props.total, this.vs.tableTransform && this.vs.table && (this.vs.table.style.transform = this.vs.tableTransform, this.vs.tableTransform = "");
|
|
155
91
|
},
|
|
156
92
|
unmounted() {
|
|
157
93
|
this.gridUnmounted();
|
|
158
94
|
},
|
|
159
95
|
computed: {
|
|
96
|
+
gridId() {
|
|
97
|
+
return this.$props.id + "-role-element-id";
|
|
98
|
+
},
|
|
99
|
+
idPrefix() {
|
|
100
|
+
return this.$props.navigatable ? this.gridId : "";
|
|
101
|
+
},
|
|
102
|
+
groupExpandable() {
|
|
103
|
+
return $t(typeof this.$props.groupable == "object" && this.$props.groupable.enabled !== !1 ? this.$props.groupable.expandable : this.$props.groupable);
|
|
104
|
+
},
|
|
105
|
+
hierarchClass() {
|
|
106
|
+
return at.hierarchyCell({});
|
|
107
|
+
},
|
|
108
|
+
rowSpannable() {
|
|
109
|
+
return Ne(this.$props.rowSpannable);
|
|
110
|
+
},
|
|
111
|
+
detailExpandable() {
|
|
112
|
+
return Ct(!!this.$props.detail);
|
|
113
|
+
},
|
|
160
114
|
nonscrollableWrapperClass() {
|
|
161
115
|
const {
|
|
162
116
|
size: e
|
|
163
|
-
} = this.$props;
|
|
117
|
+
} = this.$props, t = this.$attrs.class;
|
|
164
118
|
return {
|
|
165
119
|
"k-grid": !0,
|
|
166
120
|
"k-grid-md": !e,
|
|
167
|
-
[`k-grid-${
|
|
121
|
+
[`k-grid-${De.sizeMap[e] || e}`]: e,
|
|
122
|
+
[t]: !!t
|
|
168
123
|
};
|
|
169
124
|
},
|
|
170
125
|
scrollableWrapperClass() {
|
|
@@ -184,14 +139,16 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
184
139
|
"k-table": !0,
|
|
185
140
|
"k-grid-table": !0,
|
|
186
141
|
"k-grid-md": !e,
|
|
187
|
-
[`k-table-${
|
|
142
|
+
[`k-table-${De.sizeMap[e] || e}`]: e
|
|
188
143
|
};
|
|
189
144
|
},
|
|
190
145
|
getCorrectHeight() {
|
|
191
146
|
return this.$props.scrollable === "virtual" ? this.initialHeight || "450px" : null;
|
|
192
147
|
},
|
|
193
148
|
currentGroupable() {
|
|
194
|
-
|
|
149
|
+
var t;
|
|
150
|
+
const e = (t = this.gridContext.group) == null ? void 0 : t.value;
|
|
151
|
+
return this.$props.groupable === !0 && (e == null ? void 0 : e.length) || M(this.$props.groupable) && this.$props.groupable.enabled !== !1;
|
|
195
152
|
},
|
|
196
153
|
computedCollapsed() {
|
|
197
154
|
let e = [];
|
|
@@ -202,18 +159,53 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
202
159
|
},
|
|
203
160
|
// Calculates the value of the ariaRowcount attribute.
|
|
204
161
|
getAriaRowCount() {
|
|
205
|
-
const e = this.$props.dataItems, t = this.$props.total
|
|
206
|
-
return this.$props.detail ? this._columnsMap.length + (this.$props.filterable ? 1 : 0) + t * 2 + (this._columns.some((
|
|
162
|
+
const e = this.$props.dataItems, t = this.$props.total || (e == null ? void 0 : e.total) || (e == null ? void 0 : e.length) || 0;
|
|
163
|
+
return this.$props.detail ? this._columnsMap.length + (this.$props.filterable ? 1 : 0) + t * 2 + (this._columns.some((s) => !!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._columns.some((s) => !!s.footerCell) ? 1 : 0);
|
|
207
164
|
},
|
|
208
165
|
// Calculates the value of the ariaColcount attribute.
|
|
209
166
|
// Based on the result of this method the ariaColIndex is rendered or not in the HeaderRow TH elements
|
|
210
167
|
getAriaColCount() {
|
|
211
|
-
const e = this.$props.columns, t = this.$props.columnVirtualization,
|
|
212
|
-
if (t ||
|
|
213
|
-
return e.length !== 0 ? e.length : -1;
|
|
168
|
+
const e = this.$props.columns, t = this.$props.columnVirtualization, s = (e == null ? void 0 : e.filter((i) => i.hidden !== void 0).length) !== 0;
|
|
169
|
+
if (t || s)
|
|
170
|
+
return (e == null ? void 0 : e.length) !== 0 ? e == null ? void 0 : e.length : -1;
|
|
214
171
|
}
|
|
215
172
|
},
|
|
216
173
|
methods: {
|
|
174
|
+
readColumnElements() {
|
|
175
|
+
return Nt(this.$props.columns, this.currentColumnsState, {
|
|
176
|
+
prevId: 0,
|
|
177
|
+
idPrefix: this.idPrefix
|
|
178
|
+
});
|
|
179
|
+
},
|
|
180
|
+
getResolvedFlatColumnsState() {
|
|
181
|
+
const e = [], t = (s, i) => s == null ? void 0 : s.forEach((l) => {
|
|
182
|
+
const a = l.hidden || i;
|
|
183
|
+
e.push({
|
|
184
|
+
...l,
|
|
185
|
+
hidden: a
|
|
186
|
+
}), t(l.children, a);
|
|
187
|
+
});
|
|
188
|
+
return t(this.currentColumnsState, !1), e;
|
|
189
|
+
},
|
|
190
|
+
filterColumns(e) {
|
|
191
|
+
const t = this.getResolvedFlatColumnsState();
|
|
192
|
+
return [e.filter((s) => {
|
|
193
|
+
var i;
|
|
194
|
+
return !s.hidden && !((i = t.find((l) => l.id === s.id)) != null && i.hidden);
|
|
195
|
+
}), e.filter((s) => {
|
|
196
|
+
var i;
|
|
197
|
+
return s.hidden || ((i = t.find((l) => l.id === s.id)) == null ? void 0 : i.hidden);
|
|
198
|
+
})];
|
|
199
|
+
},
|
|
200
|
+
getFlatData(e, t, s, i, l, a, d) {
|
|
201
|
+
const h = [], c = Vt(h, e, t, {
|
|
202
|
+
index: s
|
|
203
|
+
}, i !== void 0, l, a, this.groupExpandable.defaultExpand, d, this.$props.expandField);
|
|
204
|
+
return {
|
|
205
|
+
flattedData: h,
|
|
206
|
+
resolvedGroupsCount: c
|
|
207
|
+
};
|
|
208
|
+
},
|
|
217
209
|
getColumnsEssentialProps(e) {
|
|
218
210
|
return e && JSON.stringify(e.map((t) => ({
|
|
219
211
|
id: t.id,
|
|
@@ -229,11 +221,11 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
229
221
|
filterHiddenColumns(e) {
|
|
230
222
|
if (!e || e.length === 0)
|
|
231
223
|
return e;
|
|
232
|
-
const t = (
|
|
233
|
-
...
|
|
234
|
-
children:
|
|
224
|
+
const t = (s) => ({
|
|
225
|
+
...s,
|
|
226
|
+
children: s.children && s.children.length > 0 ? this.filterHiddenColumns(s.children) : s.children
|
|
235
227
|
});
|
|
236
|
-
return [...e].filter((
|
|
228
|
+
return [...e].filter((s) => !s.hidden).filter((s) => j && s && s.media ? window.matchMedia(s.media).matches : s).map((s) => t(s));
|
|
237
229
|
},
|
|
238
230
|
/**
|
|
239
231
|
* A getter of the current columns. Gets the current column width or current columns,
|
|
@@ -243,36 +235,36 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
243
235
|
* and check the properties afterwards. You can check the result in the browser console.
|
|
244
236
|
*/
|
|
245
237
|
getColumns() {
|
|
246
|
-
const e = this._columns.filter((
|
|
238
|
+
const e = this._columns.filter((s) => s.declarationIndex >= 0 && s.parentIndex === -1), t = (s) => (s.sort((i, l) => i.declarationIndex - l.declarationIndex), s.map((i) => {
|
|
247
239
|
const {
|
|
248
240
|
declarationIndex: l,
|
|
249
|
-
parentIndex:
|
|
250
|
-
depth:
|
|
251
|
-
colSpan:
|
|
252
|
-
rowSpan:
|
|
253
|
-
index:
|
|
254
|
-
kFirst:
|
|
255
|
-
children:
|
|
256
|
-
...
|
|
257
|
-
} =
|
|
258
|
-
return
|
|
259
|
-
children: t(
|
|
260
|
-
...
|
|
261
|
-
} :
|
|
241
|
+
parentIndex: a,
|
|
242
|
+
depth: d,
|
|
243
|
+
colSpan: h,
|
|
244
|
+
rowSpan: c,
|
|
245
|
+
index: g,
|
|
246
|
+
kFirst: u,
|
|
247
|
+
children: v,
|
|
248
|
+
...f
|
|
249
|
+
} = i;
|
|
250
|
+
return v.length ? {
|
|
251
|
+
children: t(v),
|
|
252
|
+
...f
|
|
253
|
+
} : f;
|
|
262
254
|
}));
|
|
263
255
|
return t(e);
|
|
264
256
|
},
|
|
265
257
|
setRefs() {
|
|
266
258
|
let e = "$el";
|
|
267
|
-
const t =
|
|
259
|
+
const t = R(this, "gridNav");
|
|
268
260
|
t && (this._element = t[e]);
|
|
269
|
-
const
|
|
270
|
-
if (
|
|
271
|
-
let
|
|
272
|
-
this.dragLogic.refGroupPanelDiv(
|
|
261
|
+
const s = R(this, "groupPanelDiv");
|
|
262
|
+
if (s) {
|
|
263
|
+
let a = s[e] || null;
|
|
264
|
+
this.dragLogic.refGroupPanelDiv(a);
|
|
273
265
|
}
|
|
274
|
-
const
|
|
275
|
-
this.dragLogic.refDropElementClue(
|
|
266
|
+
const i = R(this, "dropElementClue"), l = R(this, "dragElementClue");
|
|
267
|
+
this.dragLogic.refDropElementClue(i), this.dragLogic.refDragElementClue(l), this.columnResize.colGroupMain = R(this, "colGroup"), this._header = R(this, "header"), this._footer = R(this, "footer"), this.vs.containerRef = R(this, "scrollContainer"), this.vs.table = R(this, "scrollTable"), this.resetTableWidth(), this.vs.tableBodyRef = R(this, "scrollTableBody");
|
|
276
268
|
},
|
|
277
269
|
gridUnmounted() {
|
|
278
270
|
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.currentData = [], this._columns = [], document != null && document.body && this.resizeObserver && this.resizeObserver.disconnect();
|
|
@@ -281,7 +273,7 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
281
273
|
this.vs.PageChange = this.pageChangeHandler, this.vs.realSkip = this.$props.skip || 0, this.vs.pageSize = (this.$props.take !== void 0 ? this.$props.take : this.$props.pageSize) || 0, this.vs.scrollableVirtual = this.$props.scrollable === "virtual", this.vs.propsSkip = (this.$props.skip || 0) + (this.$props.scrollable === "virtual" ? this.vs.topCacheCount + (this.vs.attendedSkip - (this.$props.skip || 0)) : 0);
|
|
282
274
|
},
|
|
283
275
|
getVirtualScroll() {
|
|
284
|
-
return
|
|
276
|
+
return Q;
|
|
285
277
|
},
|
|
286
278
|
isAllData() {
|
|
287
279
|
const {
|
|
@@ -296,34 +288,34 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
296
288
|
else if (this.$props.totalGroupedHeight)
|
|
297
289
|
this.vs.containerHeight = Math.min(1533915, this.$props.totalGroupedHeight);
|
|
298
290
|
else if (this.$props.allGroupedItems && this.$props.allGroupedItems.data) {
|
|
299
|
-
const t = this.totalGroupedRows(
|
|
291
|
+
const t = this.totalGroupedRows(Pe(this.$props.allGroupedItems, this.computedCollapsed, this.$props.uniqueField).data);
|
|
300
292
|
this.vs.containerHeight = Math.min(1533915, this.$props.rowHeight * t);
|
|
301
293
|
} else
|
|
302
294
|
this.vs.containerHeight = 1533915;
|
|
303
|
-
if (this.slicedCurrentData = void 0, this.vs instanceof
|
|
295
|
+
if (this.slicedCurrentData = void 0, this.vs instanceof Et) {
|
|
304
296
|
const {
|
|
305
297
|
rowHeight: t = 0,
|
|
306
|
-
detail:
|
|
307
|
-
expandField:
|
|
298
|
+
detail: s,
|
|
299
|
+
expandField: i
|
|
308
300
|
} = this.$props;
|
|
309
301
|
let {
|
|
310
302
|
detailRowHeight: l = 0
|
|
311
303
|
} = this.$props;
|
|
312
|
-
l =
|
|
313
|
-
const
|
|
314
|
-
this.vs.containerHeight =
|
|
304
|
+
l = s && i ? l : t, this.isAllData() ? (this.vs.total = this.currentData.length, this.slicedCurrentData = this.currentData.slice(this.vs.realSkip, this.vs.realSkip + this.vs.pageSize), this.vs.rowHeightService = this.rowHeightService(this.vs, this.currentData.length, t, l, this.currentData)) : this.vs.rowHeightService = new _t(e, t, l);
|
|
305
|
+
const a = this.vs.rowHeightService.totalHeight();
|
|
306
|
+
this.vs.containerHeight = At ? Math.min(Pt, a) : a;
|
|
315
307
|
}
|
|
316
308
|
},
|
|
317
309
|
onSkipChanged(e, t) {
|
|
318
310
|
Math.max(0, this.vs.attendedSkip) !== e && e !== void 0 && (this.vs.attendedSkip = e, this.vs.propsSkip = (e || 0) + (this.$props.scrollable === "virtual" ? this.vs.topCacheCount + (this.vs.attendedSkip - (e || 0)) : 0));
|
|
319
311
|
},
|
|
320
312
|
onTotalChanged(e, t) {
|
|
321
|
-
const
|
|
322
|
-
this.vs.reset(), this.vs = new
|
|
313
|
+
const s = this.currentGroupable;
|
|
314
|
+
this.vs.reset(), this.vs = new Q(s || this.$props.rowHeight === void 0 || this.$props.rowHeight === 0, this.$props.topCacheCount), this.resetVirtual(), this.setRefs();
|
|
323
315
|
},
|
|
324
316
|
onRowHeightChanged(e, t) {
|
|
325
|
-
const
|
|
326
|
-
this.vs.reset(), this.vs = new
|
|
317
|
+
const s = this.currentGroupable;
|
|
318
|
+
this.vs.reset(), this.vs = new Q(s || this.$props.rowHeight === void 0 || this.$props.rowHeight === 0, this.$props.topCacheCount), this.resetVirtual(), this.setRefs();
|
|
327
319
|
},
|
|
328
320
|
scrollHandler(e) {
|
|
329
321
|
clearTimeout(this.forceUpdateTimeout), this.$props.columnVirtualization && !this.vs.scrollableVirtual && (this.forceUpdateTimeout = setTimeout(() => {
|
|
@@ -342,29 +334,30 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
342
334
|
...this.getArguments(e)
|
|
343
335
|
});
|
|
344
336
|
},
|
|
345
|
-
loopGroupedItems(e, t,
|
|
337
|
+
loopGroupedItems(e, t, s = 0, i = null) {
|
|
346
338
|
return e.forEach((l) => {
|
|
347
|
-
!
|
|
348
|
-
}),
|
|
339
|
+
!i && t(l, s) && (i = l), l.items && l.items.length && !i && (i = this.loopGroupedItems(l.items, t, s + 1, i));
|
|
340
|
+
}), i;
|
|
349
341
|
},
|
|
350
342
|
updateGroupCollapsed(e) {
|
|
351
|
-
let t = this.computedCollapsed,
|
|
352
|
-
const
|
|
353
|
-
return
|
|
354
|
-
},
|
|
343
|
+
let t = this.computedCollapsed, s = t[e.level];
|
|
344
|
+
const i = this.$props.uniqueField, l = function(h, c) {
|
|
345
|
+
return h.value === e.dataItem.value && c === e.level;
|
|
346
|
+
}, a = this.allGroupedItems ? this.loopGroupedItems(this.allGroupedItems.data, l, 0, null) : e.dataItem, d = Oe(a || e.dataItem, i);
|
|
355
347
|
if (e.value) {
|
|
356
|
-
if (
|
|
357
|
-
const
|
|
358
|
-
|
|
348
|
+
if (s && s.length) {
|
|
349
|
+
const h = s.indexOf(d);
|
|
350
|
+
h > -1 && s.splice(h, 1);
|
|
359
351
|
}
|
|
360
352
|
} else
|
|
361
|
-
|
|
353
|
+
s ? s.includes(d) || s.push(d) : s = [d];
|
|
362
354
|
return t;
|
|
363
355
|
},
|
|
364
356
|
itemChange(e) {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
357
|
+
var i;
|
|
358
|
+
const t = z.call(this, "itemchange"), s = (i = this.gridContext.group) == null ? void 0 : i.value;
|
|
359
|
+
if (e.field === this.$props.expandField || (s || this.$props.detail) && e.field === void 0) {
|
|
360
|
+
z.call(this, "expandchange") && e.dataItem && this.$emit("expandchange", {
|
|
368
361
|
...this.getArguments(e.event),
|
|
369
362
|
collapsedGroups: this.updateGroupCollapsed(e),
|
|
370
363
|
dataItem: e.dataItem,
|
|
@@ -411,17 +404,17 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
411
404
|
selectionChangeHandler(e) {
|
|
412
405
|
const {
|
|
413
406
|
event: t,
|
|
414
|
-
dataItem:
|
|
415
|
-
dataIndex:
|
|
407
|
+
dataItem: s,
|
|
408
|
+
dataIndex: i,
|
|
416
409
|
columnIndex: l
|
|
417
410
|
} = e;
|
|
418
411
|
this.$emit("selectionchange", {
|
|
419
412
|
...this.getArguments(t.event),
|
|
420
|
-
dataItem:
|
|
413
|
+
dataItem: s,
|
|
421
414
|
startColIndex: l,
|
|
422
415
|
endColIndex: l,
|
|
423
|
-
startRowIndex:
|
|
424
|
-
endRowIndex:
|
|
416
|
+
startRowIndex: i,
|
|
417
|
+
endRowIndex: i,
|
|
425
418
|
dataItems: this.getLeafDataItems(),
|
|
426
419
|
altKey: !1,
|
|
427
420
|
ctrlKey: !1,
|
|
@@ -471,90 +464,131 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
471
464
|
skip: 0
|
|
472
465
|
}, t);
|
|
473
466
|
},
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
467
|
+
handleDetailExpandAction(e, t) {
|
|
468
|
+
var s;
|
|
469
|
+
if (this.detailExpandable.enabled) {
|
|
470
|
+
const i = (s = this.gridContext.detailExpand) == null ? void 0 : s.value, l = mt(i != null ? i : {}, e);
|
|
471
|
+
this.raiseDataEvent("detailexpandchange", {
|
|
472
|
+
...this.getArguments(t),
|
|
473
|
+
detailExpand: l
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
handleGroupExpandAction(e, t) {
|
|
478
|
+
var s;
|
|
479
|
+
if (this.groupExpandable.enabled) {
|
|
480
|
+
const i = (s = this.gridContext.groupExpand) == null ? void 0 : s.value, l = ft(i != null ? i : [], e, this.groupExpandable);
|
|
481
|
+
this.$props.expandField || this.raiseDataEvent("groupexpandchange", {
|
|
482
|
+
...this.getArguments(t),
|
|
483
|
+
groupExpand: l
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
raiseDataEvent(e, t, s, i) {
|
|
488
|
+
this.$props.autoProcessData ? this.gridContext[e]({
|
|
489
|
+
...this.getArguments(i),
|
|
490
|
+
...t
|
|
491
|
+
}) : z.call(this, e) ? this.$emit(e, {
|
|
492
|
+
...this.getArguments(i),
|
|
477
493
|
...t
|
|
478
|
-
}) :
|
|
479
|
-
...this.getArguments(
|
|
494
|
+
}) : z.call(this, "datastatechange") && this.$emit("datastatechange", {
|
|
495
|
+
...this.getArguments(i),
|
|
480
496
|
data: {
|
|
481
497
|
...this.getDataState(),
|
|
482
|
-
...
|
|
498
|
+
...s
|
|
483
499
|
}
|
|
484
500
|
});
|
|
485
501
|
},
|
|
486
|
-
columnReorder(e, t,
|
|
487
|
-
const
|
|
502
|
+
columnReorder(e, t, s) {
|
|
503
|
+
const i = this._columns[e], l = Ve(this.currentColumnsState), a = i.depth, d = (u) => {
|
|
488
504
|
do
|
|
489
|
-
|
|
490
|
-
while (
|
|
491
|
-
return
|
|
492
|
-
},
|
|
493
|
-
this._columns.splice(e < t ?
|
|
505
|
+
u++;
|
|
506
|
+
while (u < this._columns.length && this._columns[u].depth > a);
|
|
507
|
+
return u;
|
|
508
|
+
}, h = this._columns.splice(e, d(e) - e);
|
|
509
|
+
this._columns.splice(e < t ? d(t - h.length) : t, 0, ...h), this._columns.filter((u) => u.declarationIndex >= 0).forEach((u, v) => {
|
|
510
|
+
u.orderIndex = v;
|
|
511
|
+
const f = l.find((E) => E.id === u.id);
|
|
512
|
+
f && (f.orderIndex = v);
|
|
513
|
+
});
|
|
514
|
+
const c = this._columns[e].locked && this._columns[t].locked;
|
|
515
|
+
ct(this._columnsMap, this._columns, c || this.shouldUpdateLeftRightRef), gt(this._columnsMap, this._columns, c || this.shouldUpdateLeftRightRef), this.resizedRef && (this.shouldUpdateLeftRightRef = !1, this.resizedRef = !1);
|
|
494
516
|
const g = this.getColumns();
|
|
495
517
|
this.$emit("columnreorder", {
|
|
496
518
|
target: this,
|
|
497
519
|
columns: g,
|
|
498
|
-
event:
|
|
520
|
+
event: s,
|
|
499
521
|
prev: e,
|
|
500
522
|
next: t
|
|
523
|
+
}), this.gridContext.columnsstatechange({
|
|
524
|
+
columnsState: this.currentColumnsState
|
|
501
525
|
});
|
|
502
526
|
},
|
|
503
|
-
groupReorder(e, t,
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
r.splice(t, 0, ...r.splice(e, 1)), this.groupChangeHandler(r, i);
|
|
527
|
+
groupReorder(e, t, s) {
|
|
528
|
+
var l;
|
|
529
|
+
const i = (l = this.gridContext.group) == null ? void 0 : l.value;
|
|
530
|
+
i !== void 0 && (i.splice(t, 0, ...i.splice(e, 1)), this.groupChangeHandler(i, s));
|
|
508
531
|
},
|
|
509
|
-
columnToGroup(e, t,
|
|
510
|
-
|
|
511
|
-
|
|
532
|
+
columnToGroup(e, t, s) {
|
|
533
|
+
var a;
|
|
534
|
+
const i = this._columns[e].field;
|
|
535
|
+
if (!i)
|
|
512
536
|
return;
|
|
513
|
-
const l = (this
|
|
537
|
+
const l = (((a = this.gridContext.group) == null ? void 0 : a.value) || []).slice();
|
|
514
538
|
l.splice(t, 0, {
|
|
515
|
-
field:
|
|
516
|
-
}), this.groupChangeHandler(l,
|
|
539
|
+
field: i
|
|
540
|
+
}), this.groupChangeHandler(l, s);
|
|
517
541
|
},
|
|
518
542
|
resetTableWidth() {
|
|
519
543
|
let e = 0;
|
|
520
544
|
if (!this.columnResize.colGroupMain)
|
|
521
545
|
return;
|
|
522
546
|
const t = this.columnResize.colGroupMain.children;
|
|
523
|
-
for (let
|
|
524
|
-
const
|
|
525
|
-
if (!
|
|
547
|
+
for (let s = 0; s < t.length; s++) {
|
|
548
|
+
const i = t[s].width;
|
|
549
|
+
if (!i)
|
|
526
550
|
return;
|
|
527
|
-
e += parseFloat(
|
|
551
|
+
e += parseFloat(i.toString());
|
|
528
552
|
}
|
|
529
553
|
e = Math.round(e), this._header && this._header.setWidth(e), this._footer && this._footer.setWidth(e), this.vs.table && (this.vs.table.style.width = e + "px");
|
|
530
554
|
},
|
|
531
|
-
onResize(e, t, i,
|
|
532
|
-
this.resetTableWidth(), this.$emit("columnresize", {
|
|
555
|
+
onResize(e, t, s, i, l, a, d) {
|
|
556
|
+
this.resetTableWidth(), this.shouldUpdateLeftRightRef = !0, this.resizedRef = !0, this.$emit("columnresize", {
|
|
533
557
|
columns: this.getColumns(),
|
|
534
558
|
index: e,
|
|
535
|
-
|
|
559
|
+
targetColumnId: d,
|
|
560
|
+
event: i,
|
|
536
561
|
newWidth: t,
|
|
537
|
-
oldWidth:
|
|
562
|
+
oldWidth: s,
|
|
538
563
|
end: l,
|
|
539
564
|
target: this
|
|
565
|
+
}), l && this.gridContext.columnsstatechange({
|
|
566
|
+
columnsState: a
|
|
540
567
|
});
|
|
541
568
|
},
|
|
542
|
-
|
|
543
|
-
const
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
}
|
|
554
|
-
this
|
|
555
|
-
|
|
569
|
+
initColumnsState(e, t) {
|
|
570
|
+
const s = (i) => {
|
|
571
|
+
var a;
|
|
572
|
+
const l = t.find((d) => d.id === i.id);
|
|
573
|
+
if (l) {
|
|
574
|
+
const d = {
|
|
575
|
+
...l
|
|
576
|
+
};
|
|
577
|
+
return d.children = (a = i.children) == null ? void 0 : a.map(s), d;
|
|
578
|
+
}
|
|
579
|
+
return i;
|
|
580
|
+
};
|
|
581
|
+
this.currentColumnsState = e.filter((i) => i.parentIndex === -1).map(s);
|
|
582
|
+
},
|
|
583
|
+
configureColumns(e, t) {
|
|
584
|
+
e.filter((a) => a.columnType === "checkbox").forEach((a) => {
|
|
585
|
+
a.width = a.width || "50px", a.defaultCell = k(Me), a.defaultHeaderCell = k(We), a._type = "edit";
|
|
586
|
+
}), this.$props.selectedField && this._columns.filter((a) => a.field === this.$props.selectedField).forEach((a) => {
|
|
587
|
+
a.width = a.width || "50px", a.internalCell = k(Me), a.internalHeaderCell = k(We);
|
|
556
588
|
});
|
|
557
|
-
const
|
|
589
|
+
const s = Ve(this.currentColumnsState);
|
|
590
|
+
this.initColumnsState(e, s);
|
|
591
|
+
const i = {
|
|
558
592
|
id: "",
|
|
559
593
|
resizable: !0,
|
|
560
594
|
width: "32px",
|
|
@@ -565,52 +599,84 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
565
599
|
parentIndex: -1,
|
|
566
600
|
depth: 0,
|
|
567
601
|
colSpan: 0,
|
|
602
|
+
headerColSpan: 0,
|
|
568
603
|
rowSpan: 0,
|
|
569
604
|
left: 0,
|
|
570
605
|
right: 0,
|
|
571
|
-
// position: 'sticky',
|
|
572
606
|
index: 0,
|
|
573
607
|
rightBorder: !1,
|
|
574
|
-
ariaColumnIndex:
|
|
608
|
+
ariaColumnIndex: 0,
|
|
575
609
|
isAccessible: !0
|
|
576
610
|
};
|
|
577
611
|
let l = 0;
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
612
|
+
if (console.log(this.detailExpandable.enabled, this.$props.detail), this.detailExpandable.enabled && this.$props.detail && !this.$props.expandField) {
|
|
613
|
+
const a = {
|
|
614
|
+
...i,
|
|
615
|
+
_type: "expand",
|
|
616
|
+
id: H.generateNavigatableId(`${l++}`, "expand", "column"),
|
|
617
|
+
defaultCell: k(J),
|
|
618
|
+
internalCell: k(J),
|
|
619
|
+
field: this.detailExpandable.column,
|
|
620
|
+
headerClassName: this.hierarchClass
|
|
621
|
+
};
|
|
622
|
+
e.unshift(a), this.currentColumnsState.unshift(s.find((d) => d.id === a.id) || a);
|
|
623
|
+
}
|
|
624
|
+
this.$props.expandField && z.call(this, "expandchange") && this.$props.detail && (e.unshift({
|
|
625
|
+
...i,
|
|
626
|
+
internalCell: k(J),
|
|
581
627
|
field: this.$props.expandField,
|
|
582
628
|
headerClassName: "k-hierarchy-cell k-header",
|
|
583
|
-
id:
|
|
629
|
+
id: H.generateNavigatableId(`${e.length}`, this.idPrefix, "column"),
|
|
584
630
|
...this.expandColumn
|
|
585
631
|
}), l++);
|
|
586
|
-
for (let
|
|
587
|
-
|
|
588
|
-
...
|
|
632
|
+
for (let a = 0; a < t; a++) {
|
|
633
|
+
const d = {
|
|
634
|
+
...i,
|
|
589
635
|
isAccessible: !1,
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
636
|
+
defaultCell: k(X),
|
|
637
|
+
internalCell: k(X),
|
|
638
|
+
id: H.generateNavigatableId(`${l++}`, "group", "column"),
|
|
639
|
+
field: "value",
|
|
640
|
+
locked: this.$props.lockGroups
|
|
641
|
+
};
|
|
642
|
+
e.unshift(d), this.currentColumnsState.unshift(s.find((h) => h.id === d.id) || d);
|
|
643
|
+
}
|
|
644
|
+
e.slice(l).forEach((a) => {
|
|
645
|
+
a.parentIndex >= 0 && (a.parentIndex += l), a.rowSpannable = a.rowSpannable !== void 0 ? Ne(a.rowSpannable) : this.rowSpannable;
|
|
646
|
+
});
|
|
647
|
+
},
|
|
648
|
+
initColumns(e, t) {
|
|
649
|
+
var a;
|
|
650
|
+
this._columns = this.readColumnElements();
|
|
651
|
+
const s = (a = this.gridContext.group) == null ? void 0 : a.value;
|
|
652
|
+
this._columns.filter((d) => !d.hidden).length === 0 && (this._columns = Lt(e, s, {
|
|
653
|
+
column: this.$props.expandField ? this.$props.expandField : this.groupExpandable.column
|
|
654
|
+
}, {
|
|
655
|
+
prevId: 0,
|
|
656
|
+
idPrefix: this.idPrefix
|
|
657
|
+
})), this.configureColumns(this._columns, t);
|
|
658
|
+
const [i, l] = this.filterColumns(this._columns);
|
|
659
|
+
this._columns = i, this.hiddenColumnsRef = l, this._columnsMap = Mt(this._columns, !0);
|
|
594
660
|
},
|
|
595
661
|
resolveTitle(e) {
|
|
596
|
-
const t = this.findColumnByField(e),
|
|
597
|
-
return
|
|
662
|
+
const t = this.findColumnByField(e), s = t && (t.title || t.field);
|
|
663
|
+
return s === void 0 ? e : s;
|
|
598
664
|
},
|
|
599
665
|
findColumnByField(e) {
|
|
600
666
|
let t;
|
|
601
|
-
return this.$props.columns.forEach((
|
|
602
|
-
const
|
|
603
|
-
|
|
667
|
+
return this.$props.columns.forEach((s) => {
|
|
668
|
+
const i = this.searchColumn(s, e);
|
|
669
|
+
i && (t = i);
|
|
604
670
|
}), t;
|
|
605
671
|
},
|
|
606
672
|
searchColumn(e, t) {
|
|
607
673
|
if (e.field === t)
|
|
608
674
|
return e;
|
|
609
675
|
if (e.children) {
|
|
610
|
-
let
|
|
611
|
-
for (
|
|
612
|
-
|
|
613
|
-
return
|
|
676
|
+
let s, i = null;
|
|
677
|
+
for (s = 0; i == null && s < e.children.length; s++)
|
|
678
|
+
i = this.searchColumn(e.children[s], t);
|
|
679
|
+
return i;
|
|
614
680
|
}
|
|
615
681
|
return null;
|
|
616
682
|
},
|
|
@@ -637,76 +703,164 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
637
703
|
return e && (t = this.addSubItems(e, t)), t;
|
|
638
704
|
},
|
|
639
705
|
addSubItems(e, t) {
|
|
640
|
-
return e.forEach((
|
|
641
|
-
t++,
|
|
706
|
+
return e.forEach((s) => {
|
|
707
|
+
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++;
|
|
642
708
|
}), t;
|
|
709
|
+
},
|
|
710
|
+
searchChange(e) {
|
|
711
|
+
const t = this.$props.searchFields || this._columns.map((l) => l.field) || [], s = e.event.target.value, i = {
|
|
712
|
+
logic: "or",
|
|
713
|
+
filters: t.filter((l) => l !== void 0).map((l) => {
|
|
714
|
+
var a;
|
|
715
|
+
return typeof l == "string" ? {
|
|
716
|
+
field: l,
|
|
717
|
+
value: s,
|
|
718
|
+
operator: "contains"
|
|
719
|
+
} : {
|
|
720
|
+
value: s,
|
|
721
|
+
operator: (a = l.operator) != null ? a : "contains",
|
|
722
|
+
field: l.field,
|
|
723
|
+
ignoreCase: l.ignoreCase
|
|
724
|
+
};
|
|
725
|
+
})
|
|
726
|
+
};
|
|
727
|
+
this.raiseDataEvent("searchchange", {
|
|
728
|
+
search: i
|
|
729
|
+
}, {
|
|
730
|
+
skip: 0
|
|
731
|
+
}, e);
|
|
732
|
+
},
|
|
733
|
+
getCellsToRender(e, t) {
|
|
734
|
+
var a;
|
|
735
|
+
const s = [];
|
|
736
|
+
let i = null, l = 0;
|
|
737
|
+
if (t.forEach((d, h) => {
|
|
738
|
+
const c = parseFloat((d.width || "").toString()) || 10;
|
|
739
|
+
if (l) {
|
|
740
|
+
l--, i && (i.width += c);
|
|
741
|
+
return;
|
|
742
|
+
}
|
|
743
|
+
const g = Math.min(Ft(d, e), t.length - h);
|
|
744
|
+
l = g - 1, i = {
|
|
745
|
+
width: c,
|
|
746
|
+
colSpan: g,
|
|
747
|
+
columnIndex: h
|
|
748
|
+
}, s.push(i);
|
|
749
|
+
}), this.$props.columnVirtualization) {
|
|
750
|
+
const d = this.scrollLeft || 0, h = this.tableWidth || parseFloat((((a = this.$attrs.style) == null ? void 0 : a.width) || "").toString());
|
|
751
|
+
return qt({
|
|
752
|
+
cellModels: s,
|
|
753
|
+
columns: t,
|
|
754
|
+
tableViewPortWidth: h,
|
|
755
|
+
scrollLeft: d
|
|
756
|
+
});
|
|
757
|
+
}
|
|
758
|
+
return s;
|
|
643
759
|
}
|
|
644
760
|
},
|
|
645
|
-
|
|
646
|
-
const e = $(null), t = $(null), i = $(null), r = $(null), l = $(null), n = $(null), g = $(null), p = $(null), C = $(null), k = $(null);
|
|
761
|
+
provide() {
|
|
647
762
|
return {
|
|
648
|
-
|
|
649
|
-
|
|
763
|
+
kendo: {
|
|
764
|
+
dataItemKey: this.$props.dataItemKey,
|
|
765
|
+
searchChange: this.searchChange,
|
|
766
|
+
dispatchGroupExpand: this.handleGroupExpandAction,
|
|
767
|
+
dispatchDetailExpand: this.handleDetailExpandAction
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
},
|
|
771
|
+
setup(e) {
|
|
772
|
+
const t = b(null), s = b(null), i = b(null), l = b(null), a = b(null), d = b(null), h = b(null), c = b(null), g = b(null), u = b(null), v = b(!0), f = b(!1), E = it(jt, {});
|
|
773
|
+
return {
|
|
774
|
+
groupPanelDivRef: t,
|
|
775
|
+
dropElementClueRef: s,
|
|
650
776
|
dragElementClueRef: i,
|
|
651
|
-
headerRef:
|
|
652
|
-
footerRef:
|
|
653
|
-
gridNavRef:
|
|
654
|
-
colGroupRef:
|
|
655
|
-
scrollContainerRef:
|
|
656
|
-
scrollTableRef:
|
|
657
|
-
scrollTableBodyRef:
|
|
777
|
+
headerRef: l,
|
|
778
|
+
footerRef: a,
|
|
779
|
+
gridNavRef: d,
|
|
780
|
+
colGroupRef: h,
|
|
781
|
+
scrollContainerRef: c,
|
|
782
|
+
scrollTableRef: g,
|
|
783
|
+
scrollTableBodyRef: u,
|
|
784
|
+
gridContext: E,
|
|
785
|
+
shouldUpdateLeftRightRef: v,
|
|
786
|
+
resizedRef: f,
|
|
787
|
+
currentColumnsState: e.columnsState
|
|
658
788
|
};
|
|
659
789
|
},
|
|
660
790
|
render() {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
791
|
+
var ge, fe, me, Ce, $e, be, ve, xe, Ie, we, Re, ke, ye;
|
|
792
|
+
const e = (ge = this.gridContext.sort) == null ? void 0 : ge.value, t = (fe = this.gridContext.filter) == null ? void 0 : fe.value, s = (me = this.gridContext.search) == null ? void 0 : me.value, i = (Ce = this.gridContext.skip) == null ? void 0 : Ce.value, l = ($e = this.gridContext.take) == null ? void 0 : $e.value, a = (be = this.gridContext.group) == null ? void 0 : be.value, d = (ve = this.gridContext.groupExpand) == null ? void 0 : ve.value, h = (xe = this.gridContext.detailExpand) == null ? void 0 : xe.value;
|
|
793
|
+
this.currentColumnsState = (Ie = this.gridContext.columnsState) == null ? void 0 : Ie.value, console.log("detailExpand", h);
|
|
794
|
+
const c = this.$props.scrollable === "virtual" || this.$props.scrollable === void 0 && this.$props.isClient || !1, g = this.$props.autoProcessData === !0 ? {
|
|
795
|
+
group: !0,
|
|
796
|
+
sort: !0,
|
|
797
|
+
filter: !0,
|
|
798
|
+
search: !0,
|
|
799
|
+
page: !0
|
|
800
|
+
} : this.$props.autoProcessData;
|
|
801
|
+
let u = this.$props.total || 0;
|
|
802
|
+
const v = H.getIdPrefix(this.navigation);
|
|
803
|
+
let f = [];
|
|
804
|
+
Array.isArray(this.$props.dataItems) ? f = this.$props.dataItems : this.$props.dataItems && (f = Pe(this.$props.dataItems, this.$props.collapsedGroups.length ? this.computedCollapsed : [], this.$props.uniqueField).data, u = u || this.$props.dataItems.total);
|
|
805
|
+
const E = this.$props.groupable === !0 || M(this.$props.groupable) && this.$props.groupable.enabled !== !1;
|
|
806
|
+
this.dragLogic.reorderable = this.$props.reorderable || !1, this.dragLogic.groupable = E, this.initializeVirtualization(u);
|
|
807
|
+
const Ue = f.length === u, Be = M(this.$props.groupable) && this.$props.groupable.footer || "none";
|
|
808
|
+
if (this.currentData = [], g) {
|
|
809
|
+
const r = g.page && !(c && !this.$props.pageable), {
|
|
810
|
+
data: p,
|
|
811
|
+
total: x
|
|
812
|
+
} = Bt(f, {
|
|
813
|
+
group: g.group ? a : void 0,
|
|
814
|
+
sort: g.sort ? e : void 0,
|
|
815
|
+
filter: ht(g.filter ? t : void 0, g.search ? s : void 0),
|
|
816
|
+
...r ? {
|
|
817
|
+
take: this.$props.pageable ? l || 10 : l,
|
|
818
|
+
skip: i || 0
|
|
819
|
+
} : {}
|
|
820
|
+
});
|
|
821
|
+
f = p, u = (we = this.$props.total) != null ? we : x;
|
|
822
|
+
}
|
|
823
|
+
const {
|
|
824
|
+
resolvedGroupsCount: je,
|
|
825
|
+
flattedData: qe
|
|
826
|
+
} = this.getFlatData(f, Be, Ue ? 0 : this.$props.skip || 0, a, h, d, this.$props.dataItemKey);
|
|
827
|
+
this.currentData = qe, this.initColumns(this.$props.dataItems, je), this.columnResize.resizable = this.$props.resizable || !1, this.columnResize.columns = this._columns, this.columnResize.columnsState = rt(this.currentColumnsState || []), this.dragLogic.columns = this._columns;
|
|
828
|
+
const Z = this.$props.toolbar, ee = this.$props.noRecords, y = this._columns.filter((r) => r.children.length === 0), te = E && o(yt, {
|
|
829
|
+
ref: (r) => {
|
|
830
|
+
this.groupPanelDivRef = r;
|
|
677
831
|
},
|
|
678
|
-
group:
|
|
832
|
+
group: a || [],
|
|
679
833
|
ariaControls: this._gridRoleElementId,
|
|
680
834
|
onGroupChange: this.groupChangeHandler,
|
|
681
835
|
onPressHandler: this.dragLogic.pressHandler,
|
|
682
836
|
onDragHandler: this.dragLogic.dragHandler,
|
|
683
837
|
onReleaseHandler: this.dragLogic.releaseHandler,
|
|
684
838
|
resolveTitle: this.resolveTitle
|
|
685
|
-
}, null),
|
|
686
|
-
ref: (
|
|
687
|
-
this.dropElementClueRef =
|
|
839
|
+
}, null), se = (this.dragLogic.reorderable || this.dragLogic.groupable) && j && document && document.body, ie = [se && o(Tt, {
|
|
840
|
+
ref: (r) => {
|
|
841
|
+
this.dropElementClueRef = r;
|
|
688
842
|
}
|
|
689
|
-
}, null),
|
|
690
|
-
ref: (
|
|
691
|
-
this.dragElementClueRef =
|
|
843
|
+
}, null), se && o(zt, {
|
|
844
|
+
ref: (r) => {
|
|
845
|
+
this.dragElementClueRef = r;
|
|
692
846
|
}
|
|
693
|
-
}, null)],
|
|
847
|
+
}, null)], re = o(wt, {
|
|
694
848
|
size: this.$props.size,
|
|
695
849
|
columnResize: this.columnResize,
|
|
696
850
|
staticHeaders: this.$props.scrollable !== "none",
|
|
697
|
-
ref: (
|
|
698
|
-
this.headerRef =
|
|
851
|
+
ref: (r) => {
|
|
852
|
+
this.headerRef = r;
|
|
699
853
|
},
|
|
700
|
-
headerRow: o(
|
|
854
|
+
headerRow: o(Rt, {
|
|
701
855
|
grid: this,
|
|
702
|
-
sort:
|
|
856
|
+
sort: e,
|
|
703
857
|
groupable: this.$props.groupable,
|
|
704
858
|
reorderable: this.$props.reorderable,
|
|
705
859
|
sortable: this.$props.sortable,
|
|
706
860
|
onSortChange: this.sortChangeHandler,
|
|
707
|
-
filter:
|
|
861
|
+
filter: t,
|
|
708
862
|
filterable: this.$props.filterable,
|
|
709
|
-
filterOperators: this.$props.filterOperators ||
|
|
863
|
+
filterOperators: this.$props.filterOperators || Ae,
|
|
710
864
|
onFilterChange: this.filterChangeHandler,
|
|
711
865
|
columnMenu: this.$props.columnMenu,
|
|
712
866
|
columnMenuIcon: this.$props.columnMenuIcon,
|
|
@@ -722,12 +876,12 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
722
876
|
cellRender: this.$props.headerCellRender,
|
|
723
877
|
isRtl: this.isRtl,
|
|
724
878
|
isColCountDefined: this.getAriaColCount !== void 0,
|
|
725
|
-
filterRow: this.$props.filterable && o(
|
|
879
|
+
filterRow: this.$props.filterable && o(kt, {
|
|
726
880
|
grid: this,
|
|
727
881
|
size: this.$props.size,
|
|
728
882
|
columns: this._columns,
|
|
729
|
-
filter:
|
|
730
|
-
filterOperators: this.$props.filterOperators ||
|
|
883
|
+
filter: t,
|
|
884
|
+
filterOperators: this.$props.filterOperators || Ae,
|
|
731
885
|
onFilterchange: this.filterChangeHandler,
|
|
732
886
|
sort: this.$props.sort,
|
|
733
887
|
cellRender: this.$props.filterCellRender,
|
|
@@ -735,133 +889,127 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
735
889
|
ariaRowIndex: this._columnsMap.length + 1
|
|
736
890
|
}, null) || void 0
|
|
737
891
|
}, null),
|
|
738
|
-
cols:
|
|
892
|
+
cols: y.map(function(r, p) {
|
|
739
893
|
return o("col", {
|
|
740
|
-
key:
|
|
741
|
-
width:
|
|
894
|
+
key: p.toString(),
|
|
895
|
+
width: r.width !== void 0 ? Math.floor(parseFloat(r.width.toString())) + "px" : void 0
|
|
742
896
|
}, null);
|
|
743
897
|
}, this)
|
|
744
|
-
}, null),
|
|
898
|
+
}, null), le = this._columns.some((r) => !!r.footerCell) ? o(St, {
|
|
745
899
|
size: this.$props.size,
|
|
746
900
|
columnResize: this.columnResize,
|
|
747
901
|
staticHeaders: this.$props.scrollable !== "none",
|
|
748
|
-
ref: (
|
|
749
|
-
this.footerRef =
|
|
902
|
+
ref: (r) => {
|
|
903
|
+
this.footerRef = r;
|
|
750
904
|
},
|
|
751
|
-
row: o(
|
|
905
|
+
row: o(Ht, {
|
|
752
906
|
isRtl: this.isRtl,
|
|
753
907
|
rowIndex: this.getAriaRowCount + 1,
|
|
754
|
-
columns: this._columns
|
|
755
|
-
return {
|
|
756
|
-
...s,
|
|
757
|
-
footerCell: y.call(this, s.footerCell, R.call(this))
|
|
758
|
-
};
|
|
759
|
-
}, this)
|
|
908
|
+
columns: this._columns
|
|
760
909
|
}, null),
|
|
761
|
-
cols:
|
|
910
|
+
cols: y.map(function(r, p) {
|
|
762
911
|
return o("col", {
|
|
763
|
-
key:
|
|
764
|
-
width:
|
|
912
|
+
key: p.toString(),
|
|
913
|
+
width: r.width !== void 0 ? Math.floor(parseFloat(r.width.toString())) + "px" : void 0
|
|
765
914
|
}, null);
|
|
766
915
|
}, this)
|
|
767
|
-
}, null) : o("span", null, null),
|
|
916
|
+
}, null) : o("span", null, null), Je = this.showLicenseWatermark ? o(lt, {
|
|
768
917
|
message: this.licenseMessage
|
|
769
|
-
}, null) : null,
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
left: a.right + "px",
|
|
786
|
-
right: a.left + "px"
|
|
918
|
+
}, null) : null, P = this.$attrs.style, Qe = P && M(P) && P["width"] || "";
|
|
919
|
+
this.tableWidth = parseFloat(Qe.toString()), this.scrollLeft = ((ke = (Re = this.vs) == null ? void 0 : Re.container) == null ? void 0 : ke.scrollLeft) || 0;
|
|
920
|
+
const ae = y.findIndex((r) => typeof r.colSpan == "function") > -1;
|
|
921
|
+
let V;
|
|
922
|
+
ae || (V = this.getCellsToRender(null, y));
|
|
923
|
+
const Xe = function(r, p, x) {
|
|
924
|
+
let D = !1;
|
|
925
|
+
const _ = this.$props.selectedField, I = _ ? Te(_, r.dataItem) : void 0, $ = this.$props.highlight && this.$props.dataItemKey && q(this.$props.dataItemKey)(r.dataItem) !== void 0 ? this.$props.highlight[q(this.$props.dataItemKey)(r.dataItem)] : void 0;
|
|
926
|
+
return ae && (V = this.getCellsToRender(r.dataItem, y)), {
|
|
927
|
+
row: V.map(function({
|
|
928
|
+
columnIndex: C,
|
|
929
|
+
colSpan: G
|
|
930
|
+
}) {
|
|
931
|
+
const n = y[C], S = `${n.className ? n.className + " " : ""}${n.locked ? "k-grid-content-sticky" : ""}`, w = n.left !== void 0 ? this.isRtl ? {
|
|
932
|
+
left: n.right + "px",
|
|
933
|
+
right: n.left + "px"
|
|
787
934
|
} : {
|
|
788
|
-
left:
|
|
789
|
-
right:
|
|
935
|
+
left: n.left + "px",
|
|
936
|
+
right: n.right + "px"
|
|
790
937
|
} : {};
|
|
791
|
-
let
|
|
792
|
-
if (
|
|
793
|
-
const
|
|
794
|
-
(
|
|
938
|
+
let Se = !1;
|
|
939
|
+
if (n.editable && this.$props.editField) {
|
|
940
|
+
const m = Te(this.$props.editField, r.dataItem);
|
|
941
|
+
(m === !0 || m === n.field) && (D = !0, Se = !0);
|
|
795
942
|
}
|
|
796
|
-
let
|
|
797
|
-
|
|
798
|
-
const
|
|
799
|
-
return
|
|
800
|
-
key:
|
|
801
|
-
id:
|
|
802
|
-
colSpan:
|
|
803
|
-
dataItem:
|
|
804
|
-
field:
|
|
805
|
-
editor:
|
|
806
|
-
format:
|
|
807
|
-
readFormat:
|
|
808
|
-
type:
|
|
809
|
-
className:
|
|
810
|
-
render:
|
|
943
|
+
let L;
|
|
944
|
+
n.cell && (L = n.cell);
|
|
945
|
+
const He = this.computedCollapsed && this.computedCollapsed[r.level] && this.computedCollapsed[r.level].some((m) => m === Oe(r.dataItem, this.$props.uniqueField)), K = n.id ? n.id : C, U = He ? !He : r.expanded, tt = n._type === "expand", B = H.generateNavigatableId(`${p}-${String(C)}`, v, tt || r.rowType === "groupHeader" || r.rowType === "groupFooter" || n.field === "value" ? "nodata" : "cell");
|
|
946
|
+
return n.internalCell ? o(n.internalCell, {
|
|
947
|
+
key: K,
|
|
948
|
+
id: B,
|
|
949
|
+
colSpan: G,
|
|
950
|
+
dataItem: r.dataItem,
|
|
951
|
+
field: n.field || "",
|
|
952
|
+
editor: n.editor,
|
|
953
|
+
format: n.format,
|
|
954
|
+
readFormat: n.readFormat,
|
|
955
|
+
type: n.type,
|
|
956
|
+
className: S,
|
|
957
|
+
render: L || this.$props.cellRender,
|
|
811
958
|
onChange: this.itemChange,
|
|
812
|
-
onSelectionchange: (
|
|
813
|
-
event:
|
|
814
|
-
dataItem:
|
|
815
|
-
dataIndex:
|
|
816
|
-
columnIndex:
|
|
959
|
+
onSelectionchange: (m) => this.selectionChangeHandler({
|
|
960
|
+
event: m,
|
|
961
|
+
dataItem: r.dataItem,
|
|
962
|
+
dataIndex: x,
|
|
963
|
+
columnIndex: C
|
|
817
964
|
}),
|
|
818
|
-
columnIndex:
|
|
819
|
-
columnsCount: this._columns.filter((
|
|
820
|
-
rowType:
|
|
821
|
-
level:
|
|
822
|
-
expanded:
|
|
823
|
-
dataIndex:
|
|
824
|
-
style:
|
|
825
|
-
ariaColumnIndex:
|
|
965
|
+
columnIndex: C,
|
|
966
|
+
columnsCount: this._columns.filter((m) => !m.children.length).length,
|
|
967
|
+
rowType: r.rowType,
|
|
968
|
+
level: r.level,
|
|
969
|
+
expanded: U,
|
|
970
|
+
dataIndex: r.dataIndex,
|
|
971
|
+
style: w,
|
|
972
|
+
ariaColumnIndex: n.ariaColumnIndex,
|
|
826
973
|
isRtl: this.isRtl,
|
|
827
|
-
isSelected: Array.isArray(
|
|
828
|
-
isHighlighted: !!(typeof
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
974
|
+
isSelected: Array.isArray(I) && I.indexOf(C) > -1,
|
|
975
|
+
isHighlighted: !!(typeof $ != "boolean" && $ && n.field && $[n.field] === !0),
|
|
976
|
+
group: r.group
|
|
977
|
+
}, null) : Se ? o(It, {
|
|
978
|
+
id: B,
|
|
979
|
+
key: K,
|
|
980
|
+
colSpan: G,
|
|
981
|
+
dataItem: r.dataItem,
|
|
982
|
+
field: n.field || "",
|
|
983
|
+
editor: n.editor,
|
|
984
|
+
format: n.format,
|
|
985
|
+
readFormat: n.readFormat,
|
|
986
|
+
type: n.type,
|
|
987
|
+
className: S,
|
|
988
|
+
render: L || this.$props.cellRender,
|
|
841
989
|
onEdit: this.editHandler,
|
|
842
990
|
onRemove: this.removeHandler,
|
|
843
991
|
onSave: this.saveHandler,
|
|
844
992
|
onCancel: this.cancelHandler,
|
|
845
993
|
onChange: this.itemChange,
|
|
846
|
-
columnIndex:
|
|
847
|
-
columnsCount: this._columns.filter((
|
|
848
|
-
rowType:
|
|
849
|
-
level:
|
|
850
|
-
expanded:
|
|
851
|
-
dataIndex:
|
|
852
|
-
style:
|
|
853
|
-
}, null) : o(
|
|
854
|
-
key:
|
|
855
|
-
id:
|
|
856
|
-
colSpan:
|
|
857
|
-
dataItem:
|
|
858
|
-
field:
|
|
859
|
-
editor:
|
|
860
|
-
format:
|
|
861
|
-
readFormat:
|
|
862
|
-
type:
|
|
863
|
-
className:
|
|
864
|
-
render:
|
|
994
|
+
columnIndex: C,
|
|
995
|
+
columnsCount: this._columns.filter((m) => !m.children.length).length,
|
|
996
|
+
rowType: r.rowType,
|
|
997
|
+
level: r.level,
|
|
998
|
+
expanded: U,
|
|
999
|
+
dataIndex: r.dataIndex,
|
|
1000
|
+
style: w
|
|
1001
|
+
}, null) : o(Ot, {
|
|
1002
|
+
key: K,
|
|
1003
|
+
id: B,
|
|
1004
|
+
colSpan: G,
|
|
1005
|
+
dataItem: r.dataItem,
|
|
1006
|
+
field: n.field || "",
|
|
1007
|
+
editor: n.editor,
|
|
1008
|
+
format: n.format,
|
|
1009
|
+
readFormat: n.readFormat,
|
|
1010
|
+
type: n.type,
|
|
1011
|
+
className: S,
|
|
1012
|
+
render: L || this.$props.cellRender,
|
|
865
1013
|
onCellclick: this.cellClickHandler,
|
|
866
1014
|
onCellkeydown: this.cellKeydownHandler,
|
|
867
1015
|
onEdit: this.editHandler,
|
|
@@ -869,164 +1017,165 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
869
1017
|
onSave: this.saveHandler,
|
|
870
1018
|
onCancel: this.cancelHandler,
|
|
871
1019
|
onChange: this.itemChange,
|
|
872
|
-
onSelectionchange: (
|
|
873
|
-
event:
|
|
874
|
-
dataItem:
|
|
875
|
-
dataIndex:
|
|
876
|
-
columnIndex:
|
|
1020
|
+
onSelectionchange: (m) => this.selectionChangeHandler({
|
|
1021
|
+
event: m,
|
|
1022
|
+
dataItem: r.dataItem,
|
|
1023
|
+
dataIndex: x,
|
|
1024
|
+
columnIndex: C
|
|
877
1025
|
}),
|
|
878
|
-
columnIndex:
|
|
879
|
-
columnsCount: this._columns.filter((
|
|
880
|
-
rowType:
|
|
881
|
-
level:
|
|
882
|
-
expanded:
|
|
883
|
-
dataIndex:
|
|
884
|
-
style:
|
|
885
|
-
isSelected: Array.isArray(
|
|
886
|
-
isHighlighted: !!(typeof
|
|
1026
|
+
columnIndex: C,
|
|
1027
|
+
columnsCount: this._columns.filter((m) => !m.children.length).length,
|
|
1028
|
+
rowType: r.rowType,
|
|
1029
|
+
level: r.level,
|
|
1030
|
+
expanded: U,
|
|
1031
|
+
dataIndex: r.dataIndex,
|
|
1032
|
+
style: w,
|
|
1033
|
+
isSelected: Array.isArray(I) && I.indexOf(C) > -1,
|
|
1034
|
+
isHighlighted: !!(typeof $ != "boolean" && $ && n.field && $[n.field] === !0)
|
|
887
1035
|
}, null);
|
|
888
1036
|
}, this),
|
|
889
|
-
isInEdit:
|
|
890
|
-
isSelected: typeof
|
|
891
|
-
isHighlighted: typeof
|
|
1037
|
+
isInEdit: D,
|
|
1038
|
+
isSelected: typeof I == "boolean" && I,
|
|
1039
|
+
isHighlighted: typeof $ == "boolean" && $
|
|
892
1040
|
};
|
|
893
1041
|
};
|
|
894
|
-
let
|
|
1042
|
+
let oe = 0;
|
|
895
1043
|
if (this.$props.scrollable === "virtual" && this.totalGroupedRows(this.currentData) / 2 > this.$props.take) {
|
|
896
|
-
const
|
|
897
|
-
for (let
|
|
898
|
-
const
|
|
899
|
-
if (
|
|
900
|
-
this.currentData.push(
|
|
1044
|
+
const r = this.vs.topCacheCount + this.vs.attendedSkip - (this.$props.skip || 0);
|
|
1045
|
+
for (let p = 0; p < r; ) {
|
|
1046
|
+
const x = this.currentData.shift();
|
|
1047
|
+
if (x)
|
|
1048
|
+
this.currentData.push(x), oe++, x.rowType === "groupHeader" && p--;
|
|
901
1049
|
else
|
|
902
1050
|
break;
|
|
903
|
-
|
|
1051
|
+
p++;
|
|
904
1052
|
}
|
|
905
1053
|
}
|
|
906
|
-
const
|
|
907
|
-
let
|
|
1054
|
+
const ne = (r) => r >= this.currentData.length - oe;
|
|
1055
|
+
let N = this.vs.propsSkip || 0;
|
|
908
1056
|
const T = this._columnsMap.length + (this.$props.filterable ? 1 : 0) + 1;
|
|
909
|
-
let
|
|
910
|
-
const
|
|
911
|
-
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
onRowdblclick: (m) => this.rowDoubleClick(m, s),
|
|
1057
|
+
let F, O = -1, W = 0;
|
|
1058
|
+
const de = this.currentData.length && this.currentData.map(function(r, p) {
|
|
1059
|
+
r.rowType === "data" && (N++, O++), this.$props.alternatePerGroup && r.rowType === "groupHeader" && (N = 0);
|
|
1060
|
+
const x = N % 2 === 0, D = this.$props.dataItemKey && q(this.$props.dataItemKey)(r.dataItem), _ = p + (this.vs.propsSkip || 0), I = D || "ai" + _, $ = I + "_1";
|
|
1061
|
+
F = _ + T + W;
|
|
1062
|
+
let C;
|
|
1063
|
+
this.$props.detail && r.rowType === "data" && (r.expanded || r.dataItem.expanded) && (C = y.length - (this.detailExpandable.enabled || this.$props.expandField ? 1 : 0) - (a ? a.length : 0) || 1, W++, F = _ + T + W);
|
|
1064
|
+
const G = p * 2 + T, n = p * 2 + T + 1, S = Xe.call(this, r, I, O);
|
|
1065
|
+
return [o(Wt, {
|
|
1066
|
+
key: I,
|
|
1067
|
+
dataItem: r.dataItem,
|
|
1068
|
+
isAltRow: x,
|
|
1069
|
+
isInEdit: S.isInEdit,
|
|
1070
|
+
isSelected: S.isSelected,
|
|
1071
|
+
isHighlighted: S.isHighlighted,
|
|
1072
|
+
rowType: r.rowType,
|
|
1073
|
+
isHidden: ne(p),
|
|
1074
|
+
onRowclick: (w) => this.rowClick(w, r),
|
|
1075
|
+
onRowdblclick: (w) => this.rowDoubleClick(w, r),
|
|
929
1076
|
selectedField: this.$props.selectedField,
|
|
930
1077
|
rowHeight: this.$props.rowHeight,
|
|
931
|
-
render:
|
|
932
|
-
ariaRowIndex: this.$props.detail ?
|
|
933
|
-
dataIndex:
|
|
934
|
-
class: this.$props.rowClass ? this.$props.rowClass(
|
|
1078
|
+
render: this.$props.rowRender,
|
|
1079
|
+
ariaRowIndex: this.$props.detail ? G : F,
|
|
1080
|
+
dataIndex: O,
|
|
1081
|
+
class: this.$props.rowClass ? this.$props.rowClass(r) : ""
|
|
935
1082
|
}, {
|
|
936
|
-
default: () => [
|
|
937
|
-
}), this.$props.detail &&
|
|
938
|
-
key:
|
|
939
|
-
class:
|
|
1083
|
+
default: () => [S.row]
|
|
1084
|
+
}), this.$props.detail && r.rowType === "data" && (r.expanded || r.dataItem.expanded) && o("tr", {
|
|
1085
|
+
key: $,
|
|
1086
|
+
class: x ? "k-table-row k-table-alt-row k-detail-row" : "k-table-row k-detail-row",
|
|
940
1087
|
style: {
|
|
941
|
-
visibility:
|
|
1088
|
+
visibility: ne(p) ? "hidden" : "",
|
|
942
1089
|
height: this.$props.detailRowHeight + "px"
|
|
943
1090
|
},
|
|
944
1091
|
role: "row",
|
|
945
|
-
"aria-rowindex": this.$props.detail ?
|
|
946
|
-
}, [
|
|
947
|
-
return o(
|
|
1092
|
+
"aria-rowindex": this.$props.detail ? n : F
|
|
1093
|
+
}, [a == null ? void 0 : a.map(function(w) {
|
|
1094
|
+
return o(X, {
|
|
948
1095
|
id: "",
|
|
949
|
-
dataIndex:
|
|
950
|
-
field:
|
|
951
|
-
dataItem:
|
|
952
|
-
key:
|
|
1096
|
+
dataIndex: r.dataIndex,
|
|
1097
|
+
field: w.field,
|
|
1098
|
+
dataItem: r.dataItem,
|
|
1099
|
+
key: `group-${w.field}-${r.dataIndex}`,
|
|
1100
|
+
group: r.group
|
|
953
1101
|
}, null);
|
|
954
|
-
}, this), this.$props.expandField && o(
|
|
955
|
-
id:
|
|
956
|
-
}, null), o(
|
|
957
|
-
dataItem:
|
|
958
|
-
dataIndex:
|
|
959
|
-
colSpan:
|
|
960
|
-
ariaColIndex: 2 + (
|
|
961
|
-
detail: this.$props.detail ?
|
|
962
|
-
id:
|
|
1102
|
+
}, this), (this.$props.expandField || this.detailExpandable.enabled) && o(vt, {
|
|
1103
|
+
id: H.generateNavigatableId(`${$}-dhcell`, v)
|
|
1104
|
+
}, null), o(xt, {
|
|
1105
|
+
dataItem: r.dataItem,
|
|
1106
|
+
dataIndex: r.dataIndex,
|
|
1107
|
+
colSpan: C,
|
|
1108
|
+
ariaColIndex: 2 + (a ? a.length : 0),
|
|
1109
|
+
detail: this.$props.detail ? this.$props.detail : void 0,
|
|
1110
|
+
id: H.generateNavigatableId(`${$}-dcell`, v)
|
|
963
1111
|
}, null)])];
|
|
964
1112
|
}, this) || o("tr", {
|
|
965
1113
|
class: "k-table-row k-grid-norecords"
|
|
966
1114
|
}, [o("td", {
|
|
967
1115
|
class: "k-table-td",
|
|
968
|
-
colspan: this._columns.filter((
|
|
969
|
-
}, [
|
|
1116
|
+
colspan: this._columns.filter((r) => !r.children.length).length
|
|
1117
|
+
}, [ee.length ? ee : o(Ut, null, null)])]), Ye = this.$props.pageable && o(pt, {
|
|
970
1118
|
class: "k-grid-pager",
|
|
971
1119
|
onPagesizechange: this.pageChangeHandler,
|
|
972
1120
|
onPagechange: this.pageChangeHandler,
|
|
973
1121
|
size: this.$props.size,
|
|
974
|
-
total:
|
|
1122
|
+
total: u,
|
|
975
1123
|
skip: this.vs.propsSkip || 0,
|
|
976
1124
|
pageSize: (this.$props.take !== void 0 ? this.$props.take : this.$props.pageSize) || 10,
|
|
977
|
-
messagesMap:
|
|
978
|
-
settings:
|
|
979
|
-
}, null),
|
|
980
|
-
h:
|
|
981
|
-
template:
|
|
982
|
-
defaultRendering:
|
|
1125
|
+
messagesMap: Ke,
|
|
1126
|
+
settings: ut(this.$props.pageable || {})
|
|
1127
|
+
}, null), he = _e.call(this, {
|
|
1128
|
+
h: Ee,
|
|
1129
|
+
template: this.$props.pager,
|
|
1130
|
+
defaultRendering: Ye,
|
|
983
1131
|
additionalProps: {
|
|
984
1132
|
...this.$props,
|
|
985
1133
|
skip: this.vs.propsSkip || 0,
|
|
986
|
-
messagesMap:
|
|
1134
|
+
messagesMap: Ke
|
|
987
1135
|
},
|
|
988
1136
|
additionalListeners: {
|
|
989
1137
|
pagesizechange: this.pageChangeHandler,
|
|
990
1138
|
pagechange: this.pageChangeHandler
|
|
991
1139
|
}
|
|
992
|
-
}),
|
|
1140
|
+
}), Ze = (r) => e && e.filter((p) => p.field === r).length > 0, pe = o("colgroup", {
|
|
993
1141
|
ref: A(this, "colGroup")
|
|
994
|
-
}, [
|
|
1142
|
+
}, [y.map(function(r, p) {
|
|
995
1143
|
return o("col", {
|
|
996
|
-
key:
|
|
997
|
-
class:
|
|
998
|
-
width:
|
|
1144
|
+
key: p.toString(),
|
|
1145
|
+
class: Ze(r.field) ? "k-sorted" : void 0,
|
|
1146
|
+
width: r.width !== void 0 ? r.width.toString().indexOf("%") !== -1 ? r.width : Math.floor(parseFloat(r.width.toString())) + "px" : void 0
|
|
999
1147
|
}, null);
|
|
1000
|
-
}, this)]),
|
|
1001
|
-
height: this.getCorrectHeight
|
|
1002
|
-
|
|
1148
|
+
}, this)]), ue = {
|
|
1149
|
+
height: this.getCorrectHeight,
|
|
1150
|
+
...this.$attrs.style
|
|
1151
|
+
}, et = this.$props.loader && o("div", {
|
|
1003
1152
|
class: "k-loader-container k-loader-container-md k-loader-top"
|
|
1004
1153
|
}, [o("div", {
|
|
1005
1154
|
class: "k-loader-container-overlay k-overlay-light"
|
|
1006
1155
|
}, null), o("div", {
|
|
1007
1156
|
class: "k-loader-container-inner"
|
|
1008
|
-
}, [o(
|
|
1157
|
+
}, [o(bt, {
|
|
1009
1158
|
size: "large",
|
|
1010
1159
|
type: "infinite-spinner"
|
|
1011
|
-
}, null)])]),
|
|
1012
|
-
h:
|
|
1013
|
-
template:
|
|
1014
|
-
defaultRendering:
|
|
1160
|
+
}, null)])]), ce = ((ye = this.$props.showLoader) != null ? ye : !!this.$props.loader) && _e.call(this, {
|
|
1161
|
+
h: Ee,
|
|
1162
|
+
template: this.$props.loader,
|
|
1163
|
+
defaultRendering: et
|
|
1015
1164
|
});
|
|
1016
|
-
return this.$props.scrollable === "none" ? o(
|
|
1165
|
+
return this.$props.scrollable === "none" ? o(Fe, {
|
|
1017
1166
|
ref: "navRef",
|
|
1018
1167
|
id: this._gridId,
|
|
1019
1168
|
navigatable: this.$props.navigatable
|
|
1020
1169
|
}, {
|
|
1021
|
-
default: () => [o(
|
|
1022
|
-
ref: (
|
|
1023
|
-
this.gridNavRef =
|
|
1170
|
+
default: () => [o(Le, {
|
|
1171
|
+
ref: (r) => {
|
|
1172
|
+
this.gridNavRef = r;
|
|
1024
1173
|
},
|
|
1025
1174
|
currentData: this.currentData,
|
|
1026
|
-
style:
|
|
1175
|
+
style: ue,
|
|
1027
1176
|
class: this.nonscrollableWrapperClass
|
|
1028
1177
|
}, {
|
|
1029
|
-
default: () => [
|
|
1178
|
+
default: () => [Z, te, o("div", {
|
|
1030
1179
|
role: "grid",
|
|
1031
1180
|
class: "k-grid-aria-root",
|
|
1032
1181
|
id: this._gridRoleElementId,
|
|
@@ -1038,31 +1187,31 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
1038
1187
|
tableLayout: "fixed"
|
|
1039
1188
|
},
|
|
1040
1189
|
role: "none"
|
|
1041
|
-
}, [
|
|
1190
|
+
}, [pe, re, o("tbody", {
|
|
1042
1191
|
class: "k-table-tbody",
|
|
1043
1192
|
"data-keyboardnavbody": !0
|
|
1044
|
-
}, [
|
|
1193
|
+
}, [de, ce]), le])]), he, ie]
|
|
1045
1194
|
})]
|
|
1046
|
-
}) : o(
|
|
1195
|
+
}) : o(Fe, {
|
|
1047
1196
|
ref: "navRef",
|
|
1048
1197
|
id: this._gridId,
|
|
1049
1198
|
navigatable: this.$props.navigatable
|
|
1050
1199
|
}, {
|
|
1051
|
-
default: () => [o(
|
|
1052
|
-
ref: (
|
|
1053
|
-
this.gridNavRef =
|
|
1200
|
+
default: () => [o(Le, {
|
|
1201
|
+
ref: (r) => {
|
|
1202
|
+
this.gridNavRef = r;
|
|
1054
1203
|
},
|
|
1055
1204
|
currentData: this.currentData,
|
|
1056
|
-
style:
|
|
1205
|
+
style: ue,
|
|
1057
1206
|
class: this.scrollableWrapperClass
|
|
1058
1207
|
}, {
|
|
1059
|
-
default: () => [
|
|
1208
|
+
default: () => [Z, te, o("div", {
|
|
1060
1209
|
role: "grid",
|
|
1061
1210
|
class: "k-grid-aria-root",
|
|
1062
1211
|
id: this._gridRoleElementId,
|
|
1063
1212
|
"aria-colcount": this.getAriaColCount,
|
|
1064
1213
|
"aria-rowcount": this.getAriaRowCount
|
|
1065
|
-
}, [
|
|
1214
|
+
}, [re, o("div", {
|
|
1066
1215
|
class: "k-grid-container",
|
|
1067
1216
|
role: "presentation"
|
|
1068
1217
|
}, [o("div", {
|
|
@@ -1077,23 +1226,23 @@ const Jt = /* @__PURE__ */ Ge({
|
|
|
1077
1226
|
role: "none",
|
|
1078
1227
|
class: this.gridTableClass,
|
|
1079
1228
|
ref: A(this, "scrollTable")
|
|
1080
|
-
}, [
|
|
1229
|
+
}, [pe, o("tbody", {
|
|
1081
1230
|
class: "k-table-tbody",
|
|
1082
1231
|
role: "rowgroup",
|
|
1083
1232
|
"data-keyboardnavbody": !0,
|
|
1084
1233
|
ref: A(this, "scrollTableBody")
|
|
1085
|
-
}, [
|
|
1234
|
+
}, [de])])]), o("div", {
|
|
1086
1235
|
class: "k-height-container",
|
|
1087
1236
|
role: "presentation"
|
|
1088
1237
|
}, [o("div", {
|
|
1089
1238
|
style: this.$props.scrollable === "virtual" ? {
|
|
1090
1239
|
height: this.vs.containerHeight + "px"
|
|
1091
1240
|
} : {}
|
|
1092
|
-
}, null)])]),
|
|
1241
|
+
}, null)])]), ce]), le, Je]), he, ie]
|
|
1093
1242
|
})]
|
|
1094
1243
|
});
|
|
1095
1244
|
}
|
|
1096
1245
|
});
|
|
1097
1246
|
export {
|
|
1098
|
-
|
|
1247
|
+
Gs as Grid
|
|
1099
1248
|
};
|