@progress/kendo-vue-grid 7.1.0-develop.3 → 7.1.0-develop.5

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