@progress/kendo-vue-grid 7.1.0-develop.4 → 7.1.0-develop.6

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";
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({
8
+ import { defineComponent as at, createVNode as n, h as De, createTextVNode as ot, ref as x, inject as nt, markRaw as _ } from "vue";
9
+ import { isObject as A, cloneArray as dt, canUseDOM as Q, WatermarkOverlay as ht, getter as X, getTemplate as Te, setRef as G, hasListener as L, getRef as $, RowHeightService as pt, setScrollbarWidth as ut, kendoThemeMaps as Ge, uGrid as ct, isRtl as Fe, validatePackage as gt, shouldShowValidationUI as ft, getLicenseMessage as mt, guid as Le, getNestedValue as Pe } from "@progress/kendo-vue-common";
10
+ import { tableKeyboardNavigationTools as E, combineFilters as Ct, Pager as bt, normalize as $t, TableKeyboardNavigationProvider as Me, updateLeft as Rt, updateRight as xt, groupExpandReducer as vt, detailExpandReducer as wt, getDetailExpandableOptions as It, getGroupExpandableOptions as St } from "@progress/kendo-vue-data-tools";
11
+ import { Loader as yt } from "@progress/kendo-vue-indicators";
12
+ import { GridNav as Ae } from "./GridNav.mjs";
13
+ import { GridSelectionCell as Ve } from "./cells/GridSelectionCell.mjs";
14
+ import { GridHierarchyCell as Y } from "./cells/GridHierarchyCell.mjs";
15
+ import { GridDetailHierarchyCell as Ht } from "./cells/GridDetailHierarchyCell.mjs";
16
+ import { GridDetailCell as kt } from "./cells/GridDetailCell.mjs";
17
+ import { GridEditCell as _t } from "./cells/GridEditCell.mjs";
18
+ import { Header as Et } from "./header/Header.mjs";
19
+ import { HeaderRow as zt } from "./header/HeaderRow.mjs";
20
+ import { FilterRow as Dt } from "./header/FilterRow.mjs";
21
+ import { GroupPanel as Tt } from "./header/GroupPanel.mjs";
22
+ import { Footer as Gt } from "./footer/Footer.mjs";
23
+ import { FooterRow as Ft } from "./footer/FooterRow.mjs";
24
+ import { operators as Ne } from "./filterCommon.mjs";
25
+ import { VirtualScroll as Lt } from "./VirtualScroll.mjs";
26
+ import { ColumnResize as Pt } from "./drag/ColumnResize.mjs";
27
+ import { CommonDragLogic as Mt } from "./drag/CommonDragLogic.mjs";
28
+ import { DragClue as At } from "./drag/DragClue.mjs";
29
+ import { DropClue as Vt } from "./drag/DropClue.mjs";
30
+ import { applyExpandedState as Nt, getColSpan as Ot, autoGenerateColumns as Wt, mapColumns as Kt, getFlatColumnsState as Oe, getRowSpanOptions as We, groupedFirstItemValue as Ke, calcRowHeight as Ut, flatData as Bt, readColumns as jt } from "./utils/main.mjs";
31
+ import { GridCell as qt } from "./cells/GridCell.mjs";
32
+ import { GridGroupCell as Z } from "./cells/GridGroupCell.mjs";
33
+ import { GridRow as Jt } from "./rows/GridRow.mjs";
34
+ import { gridProps as Qt } from "./common.mjs";
35
+ import { GridHeaderSelectionCell as Ue } from "./header/GridHeaderSelectionCell.mjs";
36
+ import { GridNoRecords as Be } from "./components/noRecords/GridNoRecords.mjs";
37
+ import { GridNoRecordsContainer as je } from "./components/noRecords/GridNoRecordsContainer.mjs";
38
+ import { packageMetadata as ee } from "./package-metadata.mjs";
39
+ import { pagerMessagesMap as qe } from "./messages/messagesMap.mjs";
40
+ import { process as Xt } from "@progress/kendo-data-query";
41
+ import { KendoKey as Yt } from "./key.mjs";
42
+ import { getVirtualCellsToRender as Zt } from "./utils/virtualColumns.mjs";
43
+ const Pi = /* @__PURE__ */ at({
44
44
  name: "KendoGrid",
45
45
  inheritAttrs: !1,
46
46
  props: {
47
- ...Kt,
47
+ ...Qt,
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
+ gt(ee), this.showLicenseWatermark = ft(ee), this.licenseMessage = mt(ee), this.initialHeight = null, this._columns = [], this.vsRef = new Lt(), this.dragLogic = new Mt(this.columnReorder.bind(this), this.groupReorder.bind(this), this.columnToGroup.bind(this)), this.columnResize = new Pt(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 = Le(), this._gridRoleElementId = Le(), 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 = Fe(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 = Fe(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 St(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 ct.hierarchyCell({});
107
121
  },
108
- rowSpannable() {
109
- return Ne(this.$props.rowSpannable);
122
+ computedRowSpannable() {
123
+ return We(this.$props.rowSpannable);
110
124
  },
111
125
  detailExpandable() {
112
- return Ct(!!this.$props.detail);
126
+ return It(!!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-${Ge.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-${Ge.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,47 +174,50 @@ 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 jt(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 h = [], c = Bt(h, e, t, {
219
+ index: i
220
+ }, s !== void 0, r, l, this.groupExpandable.defaultExpand, d, this.$props.expandField);
204
221
  return {
205
222
  flattedData: h,
206
223
  resolvedGroupsCount: c
@@ -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,46 +252,40 @@ 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
260
  colSpan: h,
244
261
  rowSpan: c,
245
- index: g,
262
+ index: m,
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: C,
265
+ ...R
266
+ } = s;
267
+ return C.length ? {
268
+ children: t(C),
269
+ ...R
270
+ } : R;
254
271
  }));
255
272
  return t(e);
256
273
  },
257
274
  setRefs() {
258
275
  let e = "$el";
259
- const t = R(this, "gridNav");
276
+ const t = $(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 = $(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 = $(this, "dropElementClue"), r = $(this, "dragElementClue");
284
+ this.dragLogic.refDropElementClue(s), this.dragLogic.refDragElementClue(r), this.columnResize.colGroupMain = $(this, "colGroup"), this._header = $(this, "header"), this._footer = $(this, "footer"), this.resetTableWidth(), ut();
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);
298
+ },
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);
302
+ },
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 = $(this, "scrollContainer"), e.tableBody = $(this, "tableBody"), e.scrollHeightContainer = $(this, "scrollHeightContainer"), e.table = $(this, "table"), (!e.rowHeightService || e.total !== this._virtualTotal) && t && (e.total = this._virtualTotal, e.rowHeightService = new pt(this._virtualTotal, t)));
308
306
  },
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));
307
+ setContainerHeight() {
308
+ const e = $(this, "scrollContainer");
309
+ this._containerHeightRef = (e == null ? void 0 : e.offsetHeight) || 0;
311
310
  },
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();
311
+ setMinRowHeight() {
312
+ if (!this._minRowHeightRef && !this.$props.rowHeight) {
313
+ const t = Ut($(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
+ let t = this.computedCollapsed, i = t[e.level];
346
+ const s = this.$props.uniqueField, r = function(h, c) {
345
347
  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);
348
+ }, l = this.allGroupedItems ? this.loopGroupedItems(this.allGroupedItems.data, r, 0, null) : e.dataItem, d = Ke(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 h = i.indexOf(d);
352
+ h > -1 && i.splice(h, 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 = L.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
+ L.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,130 +467,141 @@ 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 = wt(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 = vt(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 (L.call(this, e))
496
+ this.$emit(e, {
497
+ ...this.getArguments(s),
498
+ ...t
499
+ });
500
+ else if (L.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 = Oe(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
518
  }, 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);
519
+ this._columns.splice(e < t ? d(t - h.length) : t, 0, ...h), this._columns.filter((u) => u.declarationIndex >= 0).forEach((u, C) => {
520
+ u.orderIndex = C;
521
+ const R = r.find((I) => I.id === u.id);
522
+ R && (R.orderIndex = C);
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
+ Rt(this._columnsMap, this._columns, c || this.shouldUpdateLeftRightRef), xt(this._columnsMap, this._columns, c || this.shouldUpdateLeftRightRef), this.resizedRef && (this.shouldUpdateLeftRightRef = !1, this.resizedRef = !1);
526
+ const m = this.getColumns();
517
527
  this.$emit("columnreorder", {
518
528
  target: this,
519
- columns: g,
520
- event: s,
529
+ columns: m,
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() {
553
+ var s;
543
554
  let e = 0;
544
555
  if (!this.columnResize.colGroupMain)
545
556
  return;
546
- const t = this.columnResize.colGroupMain.children;
547
- for (let s = 0; s < t.length; s++) {
548
- const i = t[s].width;
549
- if (!i)
557
+ const t = (s = this.columnResize.colGroupMain) == null ? void 0 : s.children;
558
+ for (let r = 0; r < t.length; r++) {
559
+ const l = t[r].width;
560
+ if (!l)
550
561
  return;
551
- e += parseFloat(i.toString());
562
+ e += parseFloat(l.toString());
552
563
  }
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");
564
+ e = Math.round(e), this._header && this._header.setWidth(e), this._footer && this._footer.setWidth(e);
565
+ const i = $(this, "table");
566
+ i && e && (i.style.width = e + "px");
554
567
  },
555
- onResize(e, t, s, i, l, a, d) {
568
+ onResize(e, t, i, s, r, l, d) {
556
569
  this.resetTableWidth(), this.shouldUpdateLeftRightRef = !0, this.resizedRef = !0, this.$emit("columnresize", {
557
570
  columns: this.getColumns(),
558
571
  index: e,
559
572
  targetColumnId: d,
560
- event: i,
573
+ event: s,
561
574
  newWidth: t,
562
- oldWidth: s,
563
- end: l,
575
+ oldWidth: i,
576
+ end: r,
564
577
  target: this
565
- }), l && this.gridContext.columnsstatechange({
566
- columnsState: a
578
+ }), r && this.gridContext.columnsstatechange({
579
+ columnsState: l
567
580
  });
568
581
  },
569
582
  initColumnsState(e, t) {
570
- const s = (i) => {
571
- var a;
572
- const l = t.find((d) => d.id === i.id);
573
- if (l) {
583
+ const i = (s) => {
584
+ var l;
585
+ const r = t.find((d) => d.id === s.id);
586
+ if (r) {
574
587
  const d = {
575
- ...l
588
+ ...r
576
589
  };
577
- return d.children = (a = i.children) == null ? void 0 : a.map(s), d;
590
+ return d.children = (l = s.children) == null ? void 0 : l.map(i), d;
578
591
  }
579
- return i;
592
+ return s;
580
593
  };
581
- this.currentColumnsState = e.filter((i) => i.parentIndex === -1).map(s);
594
+ this.currentColumnsState = e.filter((s) => s.parentIndex === -1).map(i);
582
595
  },
583
596
  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);
597
+ e.filter((l) => l.columnType === "checkbox").forEach((l) => {
598
+ l.width = l.width || "50px", l.defaultCell = _(Ve), l.defaultHeaderCell = _(Ue), l._type = "edit";
599
+ }), this.$props.selectedField && this._columns.filter((l) => l.field === this.$props.selectedField).forEach((l) => {
600
+ l.width = l.width || "50px", l.internalCell = _(Ve), l.internalHeaderCell = _(Ue);
588
601
  });
589
- const s = Ve(this.currentColumnsState);
590
- this.initColumnsState(e, s);
591
- const i = {
602
+ const i = Oe(this.currentColumnsState);
603
+ this.initColumnsState(e, i);
604
+ const s = {
592
605
  id: "",
593
606
  resizable: !0,
594
607
  width: "32px",
@@ -608,85 +621,87 @@ const Gs = /* @__PURE__ */ st({
608
621
  ariaColumnIndex: 0,
609
622
  isAccessible: !0
610
623
  };
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,
624
+ let r = 0;
625
+ if (this.detailExpandable.enabled && this.$props.detail && !this.$props.expandField) {
626
+ const l = {
627
+ ...s,
615
628
  _type: "expand",
616
- id: H.generateNavigatableId(`${l++}`, "expand", "column"),
617
- defaultCell: k(J),
618
- internalCell: k(J),
629
+ id: E.generateNavigatableId(`${r++}`, "expand", "column"),
630
+ defaultCell: _(Y),
631
+ internalCell: _(Y),
619
632
  field: this.detailExpandable.column,
620
633
  headerClassName: this.hierarchClass
621
634
  };
622
- e.unshift(a), this.currentColumnsState.unshift(s.find((d) => d.id === a.id) || a);
635
+ e.unshift(l), this.currentColumnsState.unshift(i.find((d) => d.id === l.id) || l);
623
636
  }
624
- this.$props.expandField && z.call(this, "expandchange") && this.$props.detail && (e.unshift({
625
- ...i,
626
- internalCell: k(J),
637
+ this.$props.expandField && L.call(this, "expandchange") && this.$props.detail && (e.unshift({
638
+ ...s,
639
+ internalCell: _(Y),
627
640
  field: this.$props.expandField,
628
641
  headerClassName: "k-hierarchy-cell k-header",
629
- id: H.generateNavigatableId(`${e.length}`, this.idPrefix, "column"),
642
+ id: E.generateNavigatableId(`${e.length}`, this.idPrefix, "column"),
630
643
  ...this.expandColumn
631
- }), l++);
632
- for (let a = 0; a < t; a++) {
644
+ }), r++);
645
+ for (let l = 0; l < t; l++) {
633
646
  const d = {
634
- ...i,
647
+ ...s,
635
648
  isAccessible: !1,
636
- defaultCell: k(X),
637
- internalCell: k(X),
638
- id: H.generateNavigatableId(`${l++}`, "group", "column"),
649
+ defaultCell: _(Z),
650
+ internalCell: _(Z),
651
+ id: E.generateNavigatableId(`${r++}`, "group", "column"),
639
652
  field: "value",
640
653
  locked: this.$props.lockGroups
641
654
  };
642
- e.unshift(d), this.currentColumnsState.unshift(s.find((h) => h.id === d.id) || d);
655
+ e.unshift(d), this.currentColumnsState.unshift(i.find((h) => h.id === d.id) || d);
643
656
  }
644
- e.slice(l).forEach((a) => {
645
- a.parentIndex >= 0 && (a.parentIndex += l), a.rowSpannable = a.rowSpannable !== void 0 ? Ne(a.rowSpannable) : this.rowSpannable;
657
+ e.slice(r).forEach((l) => {
658
+ l.parentIndex >= 0 && (l.parentIndex += r), l.rowSpannable = l.rowSpannable !== void 0 ? We(l.rowSpannable) : this.computedRowSpannable;
646
659
  });
647
660
  },
648
661
  initColumns(e, t) {
649
- var a;
662
+ var l;
650
663
  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, {
664
+ const i = (l = this.gridContext.group) == null ? void 0 : l.value;
665
+ this._columns.filter((d) => !d.hidden).length === 0 && (this._columns = Wt(e, i, {
653
666
  column: this.$props.expandField ? this.$props.expandField : this.groupExpandable.column
654
667
  }, {
655
668
  prevId: 0,
656
669
  idPrefix: this.idPrefix
657
670
  })), 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);
671
+ const [s, r] = this.filterColumns(this._columns);
672
+ this._columns = s, this.hiddenColumnsRef = r, this._columnsMap = Kt(this._columns, !0);
660
673
  },
661
674
  resolveTitle(e) {
662
- const t = this.findColumnByField(e), s = t && (t.title || t.field);
663
- return s === void 0 ? e : s;
675
+ const t = this.findColumnByField(e), i = t && (t.title || t.field);
676
+ return i === void 0 ? e : i;
664
677
  },
665
678
  findColumnByField(e) {
666
679
  let t;
667
- return this.$props.columns.forEach((s) => {
668
- const i = this.searchColumn(s, e);
669
- i && (t = i);
680
+ return this.$props.columns.forEach((i) => {
681
+ const s = this.searchColumn(i, e);
682
+ s && (t = s);
670
683
  }), t;
671
684
  },
672
685
  searchColumn(e, t) {
673
686
  if (e.field === t)
674
687
  return e;
675
688
  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;
689
+ let i, s = null;
690
+ for (i = 0; s == null && i < e.children.length; i++)
691
+ s = this.searchColumn(e.children[i], t);
692
+ return s;
680
693
  }
681
694
  return null;
682
695
  },
683
696
  getDataState() {
697
+ var l, d, h, c, m;
698
+ const e = (l = this.gridContext.sort) == null ? void 0 : l.value, t = (d = this.gridContext.filter) == null ? void 0 : d.value, i = (h = this.gridContext.skip) == null ? void 0 : h.value, s = (c = this.gridContext.take) == null ? void 0 : c.value, r = (m = this.gridContext.group) == null ? void 0 : m.value;
684
699
  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
700
+ filter: t,
701
+ sort: e,
702
+ skip: i,
703
+ take: s !== void 0 ? s : this.$props.pageSize,
704
+ group: r
690
705
  };
691
706
  },
692
707
  getArguments(e) {
@@ -703,59 +718,76 @@ const Gs = /* @__PURE__ */ st({
703
718
  return e && (t = this.addSubItems(e, t)), t;
704
719
  },
705
720
  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++;
721
+ return e.forEach((i) => {
722
+ 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
723
  }), t;
709
724
  },
710
725
  searchChange(e) {
711
- const t = this.$props.searchFields || this._columns.map((l) => l.field) || [], s = e.event.target.value, i = {
726
+ const t = this.$props.searchFields || this._columns.map((r) => r.field) || [], i = e.event.target.value, s = {
712
727
  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,
728
+ filters: t.filter((r) => r !== void 0).map((r) => {
729
+ var l;
730
+ return typeof r == "string" ? {
731
+ field: r,
732
+ value: i,
718
733
  operator: "contains"
719
734
  } : {
720
- value: s,
721
- operator: (a = l.operator) != null ? a : "contains",
722
- field: l.field,
723
- ignoreCase: l.ignoreCase
735
+ value: i,
736
+ operator: (l = r.operator) != null ? l : "contains",
737
+ field: r.field,
738
+ ignoreCase: r.ignoreCase
724
739
  };
725
740
  })
726
741
  };
727
742
  this.raiseDataEvent("searchchange", {
728
- search: i
743
+ search: s
729
744
  }, {
730
745
  skip: 0
731
746
  }, e);
732
747
  },
733
748
  getCellsToRender(e, t) {
734
- var a;
735
- const s = [];
736
- let i = null, l = 0;
749
+ var l;
750
+ const i = [];
751
+ let s = null, r = 0;
737
752
  if (t.forEach((d, h) => {
738
753
  const c = parseFloat((d.width || "").toString()) || 10;
739
- if (l) {
740
- l--, i && (i.width += c);
754
+ if (r) {
755
+ r--, s && (s.width += c);
741
756
  return;
742
757
  }
743
- const g = Math.min(Ft(d, e), t.length - h);
744
- l = g - 1, i = {
758
+ const m = Math.min(Ot(d, e), t.length - h);
759
+ r = m - 1, s = {
745
760
  width: c,
746
- colSpan: g,
761
+ colSpan: m,
747
762
  columnIndex: h
748
- }, s.push(i);
763
+ }, i.push(s);
749
764
  }), 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,
765
+ const d = this.scrollLeftRef || 0, h = this.tableWidth || parseFloat((((l = this.$attrs.style) == null ? void 0 : l.width) || "").toString());
766
+ return Zt({
767
+ cellModels: i,
753
768
  columns: t,
754
769
  tableViewPortWidth: h,
755
770
  scrollLeft: d
756
771
  });
757
772
  }
758
- return s;
773
+ return i;
774
+ },
775
+ calcVirtualPageSize() {
776
+ const {
777
+ pageable: e,
778
+ take: t,
779
+ pageSize: i
780
+ } = this.$props;
781
+ if (!this.isVirtualScroll)
782
+ return 0;
783
+ if (!e) {
784
+ if (t)
785
+ return t;
786
+ if (i)
787
+ return i;
788
+ }
789
+ const s = this.$props.rowHeight || this._minRowHeightRef, r = this._containerHeightRef;
790
+ return r && s ? Math.ceil(r / s * 1.5) : 0;
759
791
  }
760
792
  },
761
793
  provide() {
@@ -769,89 +801,101 @@ const Gs = /* @__PURE__ */ st({
769
801
  };
770
802
  },
771
803
  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, {});
804
+ const t = x(null), i = x(null), s = x(null), r = x(null), l = x(null), d = x(null), h = x(null), c = x(null), m = x(null), u = x(null), C = x(!0), R = x(!1), I = nt(Yt, {});
773
805
  return {
774
806
  groupPanelDivRef: t,
775
- dropElementClueRef: s,
776
- dragElementClueRef: i,
777
- headerRef: l,
778
- footerRef: a,
807
+ dropElementClueRef: i,
808
+ dragElementClueRef: s,
809
+ headerRef: r,
810
+ footerRef: l,
779
811
  gridNavRef: d,
780
812
  colGroupRef: h,
781
813
  scrollContainerRef: c,
782
- scrollTableRef: g,
814
+ scrollTableRef: m,
783
815
  scrollTableBodyRef: u,
784
- gridContext: E,
785
- shouldUpdateLeftRightRef: v,
786
- resizedRef: f,
816
+ gridContext: I,
817
+ shouldUpdateLeftRightRef: C,
818
+ resizedRef: R,
787
819
  currentColumnsState: e.columnsState
788
820
  };
789
821
  },
790
822
  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 ? {
823
+ var ge, fe, me, Ce, be, $e, Re, xe, ve, we, Ie;
824
+ 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, h = (xe = this.gridContext.detailExpand) == null ? void 0 : xe.value, c = !!(l != null && l.length);
825
+ let m;
826
+ this.currentColumnsState = (ve = this.gridContext.columnsState) == null ? void 0 : ve.value;
827
+ const u = this.$props.autoProcessData === !0 ? {
795
828
  group: !0,
796
829
  sort: !0,
797
830
  filter: !0,
798
831
  search: !0,
799
832
  page: !0
800
833
  } : 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
834
+ let C = this.$props.total || 0;
835
+ const R = E.getIdPrefix(this.navigation);
836
+ let I = [];
837
+ Array.isArray(this.$props.dataItems) ? I = this.$props.dataItems : this.$props.dataItems && (I = Nt(this.$props.dataItems, this.$props.collapsedGroups.length ? this.computedCollapsed : [], this.$props.uniqueField).data, C = C || this.$props.dataItems.total);
838
+ const te = this.$props.groupable === !0 || A(this.$props.groupable) && this.$props.groupable.enabled !== !1;
839
+ this.dragLogic.reorderable = this.$props.reorderable || !1, this.dragLogic.groupable = te, this._virtualPageSize = this.calcVirtualPageSize();
840
+ const V = I.length === C, Je = A(this.$props.groupable) && this.$props.groupable.footer || "none";
841
+ if (this.currentData = [], u) {
842
+ const a = u.page && !(this.isVirtualScroll && !this.$props.pageable), {
843
+ data: f,
844
+ total: S
845
+ } = Xt(I, {
846
+ group: u.group ? l : void 0,
847
+ sort: u.sort ? e : void 0,
848
+ filter: Ct(u.filter ? t : void 0, u.search ? i : void 0),
849
+ ...a ? {
850
+ take: this.$props.pageable ? r || 10 : r,
851
+ skip: s || 0
819
852
  } : {}
820
853
  });
821
- f = p, u = (we = this.$props.total) != null ? we : x;
854
+ I = f, C = (we = this.$props.total) != null ? we : S;
822
855
  }
823
856
  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;
857
+ resolvedGroupsCount: Qe,
858
+ flattedData: Xe
859
+ } = this.getFlatData(I, Je, V ? 0 : this.$props.skip || 0, l, h, d, this.$props.dataItemKey);
860
+ this.currentData = Xe;
861
+ const N = this._virtualSkipRef || 0;
862
+ if (this._virtualTotal = C, this.isVirtualScroll) {
863
+ let a = s || 0;
864
+ if ((c || this.$props.pageable) && (a = N, this._virtualTotal = this.currentData.length), V || c || this.$props.pageable)
865
+ if (this._virtualPageSize === 0) {
866
+ const f = Math.min(r || this.$props.pageSize || 20, this.currentData.length);
867
+ m = this.currentData.slice(a, a + f);
868
+ } else
869
+ m = this.currentData.slice(a, a + this._virtualPageSize);
870
+ }
871
+ this.initializeVirtualization(), this.initColumns(this.$props.dataItems, Qe), this.columnResize.resizable = this.$props.resizable || !1, this.columnResize.columns = this._columns, this.columnResize.columnsState = dt(this.currentColumnsState || []), this.dragLogic.columns = this._columns;
872
+ const ie = this.$props.toolbar, P = this.$props.noRecords, z = this._columns.filter((a) => a.children.length === 0), se = te && n(Tt, {
873
+ ref: (a) => {
874
+ this.groupPanelDivRef = a;
831
875
  },
832
- group: a || [],
876
+ group: l || [],
833
877
  ariaControls: this._gridRoleElementId,
834
878
  onGroupChange: this.groupChangeHandler,
835
879
  onPressHandler: this.dragLogic.pressHandler,
836
880
  onDragHandler: this.dragLogic.dragHandler,
837
881
  onReleaseHandler: this.dragLogic.releaseHandler,
838
882
  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;
883
+ }, null), re = (this.dragLogic.reorderable || this.dragLogic.groupable) && Q && document && document.body, le = [re && n(Vt, {
884
+ ref: (a) => {
885
+ this.dropElementClueRef = a;
842
886
  }
843
- }, null), se && o(zt, {
844
- ref: (r) => {
845
- this.dragElementClueRef = r;
887
+ }, null), re && n(At, {
888
+ ref: (a) => {
889
+ this.dragElementClueRef = a;
846
890
  }
847
- }, null)], re = o(wt, {
891
+ }, null)], ae = n(Et, {
848
892
  size: this.$props.size,
849
893
  columnResize: this.columnResize,
850
894
  staticHeaders: this.$props.scrollable !== "none",
851
- ref: (r) => {
852
- this.headerRef = r;
895
+ ref: (a) => {
896
+ this.headerRef = a;
853
897
  },
854
- headerRow: o(Rt, {
898
+ headerRow: n(zt, {
855
899
  grid: this,
856
900
  sort: e,
857
901
  groupable: this.$props.groupable,
@@ -860,7 +904,7 @@ const Gs = /* @__PURE__ */ st({
860
904
  onSortChange: this.sortChangeHandler,
861
905
  filter: t,
862
906
  filterable: this.$props.filterable,
863
- filterOperators: this.$props.filterOperators || Ae,
907
+ filterOperators: this.$props.filterOperators || Ne,
864
908
  onFilterChange: this.filterChangeHandler,
865
909
  columnMenu: this.$props.columnMenu,
866
910
  columnMenuIcon: this.$props.columnMenuIcon,
@@ -876,12 +920,12 @@ const Gs = /* @__PURE__ */ st({
876
920
  cellRender: this.$props.headerCellRender,
877
921
  isRtl: this.isRtl,
878
922
  isColCountDefined: this.getAriaColCount !== void 0,
879
- filterRow: this.$props.filterable && o(kt, {
923
+ filterRow: this.$props.filterable && n(Dt, {
880
924
  grid: this,
881
925
  size: this.$props.size,
882
926
  columns: this._columns,
883
927
  filter: t,
884
- filterOperators: this.$props.filterOperators || Ae,
928
+ filterOperators: this.$props.filterOperators || Ne,
885
929
  onFilterchange: this.filterChangeHandler,
886
930
  sort: this.$props.sort,
887
931
  cellRender: this.$props.filterCellRender,
@@ -889,127 +933,138 @@ const Gs = /* @__PURE__ */ st({
889
933
  ariaRowIndex: this._columnsMap.length + 1
890
934
  }, null) || void 0
891
935
  }, null),
892
- cols: y.map(function(r, p) {
893
- return o("col", {
894
- key: p.toString(),
895
- width: r.width !== void 0 ? Math.floor(parseFloat(r.width.toString())) + "px" : void 0
936
+ cols: z.map(function(a, f) {
937
+ return n("col", {
938
+ key: f.toString(),
939
+ width: a.width !== void 0 ? Math.floor(parseFloat(a.width.toString())) : void 0
896
940
  }, null);
897
941
  }, this)
898
- }, null), le = this._columns.some((r) => !!r.footerCell) ? o(St, {
942
+ }, null), oe = this._columns.some((a) => !!a.footerCell) ? n(Gt, {
899
943
  size: this.$props.size,
900
944
  columnResize: this.columnResize,
901
945
  staticHeaders: this.$props.scrollable !== "none",
902
- ref: (r) => {
903
- this.footerRef = r;
946
+ ref: (a) => {
947
+ this.footerRef = a;
904
948
  },
905
- row: o(Ht, {
949
+ row: n(Ft, {
906
950
  isRtl: this.isRtl,
907
951
  rowIndex: this.getAriaRowCount + 1,
908
952
  columns: this._columns
909
953
  }, null),
910
- cols: y.map(function(r, p) {
911
- return o("col", {
912
- key: p.toString(),
913
- width: r.width !== void 0 ? Math.floor(parseFloat(r.width.toString())) + "px" : void 0
954
+ cols: z.map(function(a, f) {
955
+ return n("col", {
956
+ key: f.toString(),
957
+ width: a.width !== void 0 ? Math.floor(parseFloat(a.width.toString())) : void 0
914
958
  }, null);
915
959
  }, this)
916
- }, null) : o("span", null, null), Je = this.showLicenseWatermark ? o(lt, {
960
+ }, null) : n("span", null, null), Ye = this.showLicenseWatermark ? n(ht, {
917
961
  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
962
+ }, null) : null, O = this.$attrs.style, Ze = O && A(O) && O["width"] || "";
963
+ this.tableWidth = parseFloat(Ze.toString());
964
+ const ne = z.findIndex((a) => typeof a.colSpan == "function") > -1;
965
+ let W;
966
+ ne || (W = this.getCellsToRender(null, z));
967
+ const et = function(a, f, S, Se, k) {
968
+ let p = !1;
969
+ const D = this.$props.selectedField, y = D ? Pe(D, a.dataItem) : void 0, v = 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;
970
+ return ne && (W = this.getCellsToRender(a.dataItem, z)), {
971
+ row: W.map(function({
972
+ columnIndex: b,
973
+ colSpan: T
930
974
  }) {
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"
975
+ var ke, _e, Ee, ze;
976
+ const o = z[b];
977
+ let w;
978
+ if ((ke = o.rowSpannable) != null && ke.enabled && a.rowType === "data" && o.field && k) {
979
+ const g = o.field ? (Ee = (_e = o.rowSpannable).valueGetter) == null ? void 0 : Ee.call(_e, a.dataItem, o.field) : null;
980
+ w = {
981
+ value: g,
982
+ count: 1
983
+ }, k[o.field] && ((ze = k[o.field]) == null ? void 0 : ze.value) === g && k[o.field] !== null ? (k[o.field].count++, w.count = null) : k[o.field] = w;
984
+ }
985
+ const F = `${o.className ? o.className + " " : ""}${o.locked ? "k-grid-content-sticky" : ""}`, H = o.left !== void 0 ? this.isRtl ? {
986
+ left: o.right + "px",
987
+ right: o.left + "px"
934
988
  } : {
935
- left: n.left + "px",
936
- right: n.right + "px"
989
+ left: o.left + "px",
990
+ right: o.right + "px"
937
991
  } : {};
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);
992
+ let ye = !1;
993
+ if (o.editable && this.$props.editField) {
994
+ const g = Pe(this.$props.editField, a.dataItem);
995
+ (g === !0 || g === o.field) && (p = !0, ye = !0);
942
996
  }
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,
997
+ let M;
998
+ o.cell && (M = o.cell);
999
+ const He = this.computedCollapsed && this.computedCollapsed[a.level] && this.computedCollapsed[a.level].some((g) => g === Ke(a.dataItem, this.$props.uniqueField)), j = o.id ? o.id : b, q = He ? !He : a.expanded || a.dataItem.expanded, lt = o._type === "expand", J = E.generateNavigatableId(`${f}-${String(b)}`, R, lt || a.rowType === "groupHeader" || a.rowType === "groupFooter" || o.field === "value" ? "nodata" : "cell");
1000
+ return o.internalCell ? n(o.internalCell, {
1001
+ key: j,
1002
+ id: J,
1003
+ colSpan: T,
1004
+ dataItem: a.dataItem,
1005
+ field: o.field || "",
1006
+ editor: o.editor,
1007
+ format: o.format,
1008
+ readFormat: o.readFormat,
1009
+ type: o.type,
1010
+ className: F,
1011
+ render: M || this.$props.cellRender,
958
1012
  onChange: this.itemChange,
959
- onSelectionchange: (m) => this.selectionChangeHandler({
960
- event: m,
961
- dataItem: r.dataItem,
962
- dataIndex: x,
963
- columnIndex: C
1013
+ onSelectionchange: (g) => this.selectionChangeHandler({
1014
+ event: g,
1015
+ dataItem: a.dataItem,
1016
+ dataIndex: S,
1017
+ columnIndex: b
964
1018
  }),
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,
1019
+ columnIndex: b,
1020
+ columnsCount: this._columns.filter((g) => !g.children.length).length,
1021
+ rowType: a.rowType,
1022
+ level: a.level,
1023
+ expanded: q,
1024
+ dataIndex: a.dataIndex,
1025
+ style: H,
1026
+ ariaColumnIndex: o.ariaColumnIndex,
973
1027
  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,
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,
1028
+ isSelected: Array.isArray(y) && y.indexOf(b) > -1,
1029
+ isHighlighted: !!(typeof v != "boolean" && v && o.field && v[o.field] === !0),
1030
+ group: a.group,
1031
+ rowSpan: w
1032
+ }, null) : ye ? n(_t, {
1033
+ id: J,
1034
+ key: j,
1035
+ colSpan: T,
1036
+ dataItem: a.dataItem,
1037
+ field: o.field || "",
1038
+ editor: o.editor,
1039
+ format: o.format,
1040
+ readFormat: o.readFormat,
1041
+ type: o.type,
1042
+ className: F,
1043
+ render: M || this.$props.cellRender,
989
1044
  onEdit: this.editHandler,
990
1045
  onRemove: this.removeHandler,
991
1046
  onSave: this.saveHandler,
992
1047
  onCancel: this.cancelHandler,
993
1048
  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,
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,
1049
+ columnIndex: b,
1050
+ columnsCount: this._columns.filter((g) => !g.children.length).length,
1051
+ rowType: a.rowType,
1052
+ level: a.level,
1053
+ expanded: q,
1054
+ dataIndex: a.dataIndex,
1055
+ style: H
1056
+ }, null) : n(qt, {
1057
+ key: j,
1058
+ id: J,
1059
+ colSpan: T,
1060
+ dataItem: a.dataItem,
1061
+ field: o.field || "",
1062
+ editor: o.editor,
1063
+ format: o.format,
1064
+ readFormat: o.readFormat,
1065
+ type: o.type,
1066
+ className: F,
1067
+ render: M || this.$props.cellRender,
1013
1068
  onCellclick: this.cellClickHandler,
1014
1069
  onCellkeydown: this.cellKeydownHandler,
1015
1070
  onEdit: this.editHandler,
@@ -1017,232 +1072,236 @@ const Gs = /* @__PURE__ */ st({
1017
1072
  onSave: this.saveHandler,
1018
1073
  onCancel: this.cancelHandler,
1019
1074
  onChange: this.itemChange,
1020
- onSelectionchange: (m) => this.selectionChangeHandler({
1021
- event: m,
1022
- dataItem: r.dataItem,
1023
- dataIndex: x,
1024
- columnIndex: C
1075
+ onSelectionchange: (g) => this.selectionChangeHandler({
1076
+ event: g,
1077
+ dataItem: a.dataItem,
1078
+ dataIndex: S,
1079
+ columnIndex: b
1025
1080
  }),
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)
1081
+ columnIndex: b,
1082
+ columnsCount: this._columns.filter((g) => !g.children.length).length,
1083
+ rowType: a.rowType,
1084
+ level: a.level,
1085
+ expanded: q,
1086
+ dataIndex: a.dataIndex,
1087
+ style: H,
1088
+ rowSpan: w,
1089
+ isSelected: Array.isArray(y) && y.indexOf(b) > -1,
1090
+ isHighlighted: !!(typeof v != "boolean" && v && o.field && v[o.field] === !0)
1035
1091
  }, null);
1036
1092
  }, this),
1037
- isInEdit: D,
1038
- isSelected: typeof I == "boolean" && I,
1039
- isHighlighted: typeof $ == "boolean" && $
1093
+ isInEdit: p,
1094
+ isSelected: typeof y == "boolean" && y,
1095
+ isHighlighted: typeof v == "boolean" && v
1040
1096
  };
1041
1097
  };
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++;
1098
+ let tt = 0, K = [];
1099
+ const U = !this.currentData.length, de = (a) => a >= this.currentData.length - tt;
1100
+ let B = 0;
1101
+ if (this.currentData.length) {
1102
+ const a = this._columnsMap.length + (this.$props.filterable ? 1 : 0) + 1;
1103
+ let f = this.$props.skip || 0, S = -1, Se = 0;
1104
+ const k = this.computedRowSpannable.enabled ? {} : void 0;
1105
+ if (this.isVirtualScroll) {
1106
+ if (N > 0) {
1107
+ const p = this.currentData.slice(0, N).filter((D) => D.rowType === "data").length;
1108
+ S += p, f += p;
1109
+ }
1110
+ !this.$props.pageable && V && (S += this.$props.skip || 0);
1052
1111
  }
1112
+ K = (m || this.currentData).map(function(p, D) {
1113
+ p.rowType === "data" && S++;
1114
+ const y = p.dataIndex % 2 !== 0, v = this.$props.dataItemKey && X(this.$props.dataItemKey)(p.dataItem), b = D + f, T = v || "ai" + b, o = T + "_1", w = et.call(this, p, T, S, y, k), F = z.length - (this.detailExpandable.enabled ? 1 : 0) - ((l == null ? void 0 : l.length) || 0) || 1;
1115
+ return B = b + a + Se, [n(Jt, {
1116
+ key: T,
1117
+ item: p,
1118
+ dataIndex: S,
1119
+ ariaRowIndex: B,
1120
+ absoluteRowIndex: b,
1121
+ isAltRow: y,
1122
+ isHidden: de(D),
1123
+ rowHeight: this.$props.rowHeight,
1124
+ isSelected: w.isSelected,
1125
+ isHighlighted: w.isHighlighted,
1126
+ isInEdit: w.isInEdit,
1127
+ rowType: p.rowType,
1128
+ onRowclick: (H) => this.rowClick(H, p),
1129
+ onRowdblclick: (H) => this.rowDoubleClick(H, p),
1130
+ render: this.$props.rowRender,
1131
+ class: this.$props.rowClass ? this.$props.rowClass(p) : ""
1132
+ }, {
1133
+ default: () => [w.row]
1134
+ }), this.$props.detail && p.rowType === "data" && (p.expanded || p.dataItem.expanded) && n("tr", {
1135
+ key: o,
1136
+ class: y ? "k-table-row k-table-alt-row k-detail-row" : "k-table-row k-detail-row",
1137
+ style: {
1138
+ visibility: de(D) ? "hidden" : "",
1139
+ height: this.$props.detailRowHeight + "px"
1140
+ },
1141
+ role: "row",
1142
+ "aria-rowindex": B
1143
+ }, [l == null ? void 0 : l.map(function(H) {
1144
+ return n(Z, {
1145
+ id: "",
1146
+ dataIndex: p.dataIndex,
1147
+ field: H.field,
1148
+ dataItem: p.dataItem,
1149
+ key: `group-${H.field}-${p.dataIndex}`,
1150
+ group: p.group
1151
+ }, null);
1152
+ }, this), (this.$props.expandField || this.detailExpandable.enabled) && n(Ht, {
1153
+ id: E.generateNavigatableId(`${o}-dhcell`, R)
1154
+ }, null), n(kt, {
1155
+ dataItem: p.dataItem,
1156
+ dataIndex: p.dataIndex,
1157
+ colSpan: F,
1158
+ ariaColIndex: 2 + (l ? l.length : 0),
1159
+ detail: this.$props.detail ? this.$props.detail : void 0,
1160
+ id: E.generateNavigatableId(`${o}-dcell`, R)
1161
+ }, null)])];
1162
+ }, this);
1053
1163
  }
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, {
1164
+ const it = this.$props.pageable && n(bt, {
1118
1165
  class: "k-grid-pager",
1119
1166
  onPagesizechange: this.pageChangeHandler,
1120
1167
  onPagechange: this.pageChangeHandler,
1121
1168
  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,
1169
+ total: C,
1170
+ skip: s || 0,
1171
+ pageSize: (r !== void 0 ? r : this.$props.pageSize) || 10,
1172
+ messagesMap: qe,
1173
+ settings: $t(this.$props.pageable || {})
1174
+ }, null), he = Te.call(this, {
1175
+ h: De,
1129
1176
  template: this.$props.pager,
1130
- defaultRendering: Ye,
1177
+ defaultRendering: it,
1131
1178
  additionalProps: {
1132
1179
  ...this.$props,
1133
- skip: this.vs.propsSkip || 0,
1134
- messagesMap: Ke
1180
+ skip: this.$props.skip || 0,
1181
+ messagesMap: qe
1135
1182
  },
1136
1183
  additionalListeners: {
1137
1184
  pagesizechange: this.pageChangeHandler,
1138
1185
  pagechange: this.pageChangeHandler
1139
1186
  }
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) {
1143
- 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
1187
+ }), st = (a) => e && e.filter((f) => f.field === a).length > 0, pe = n("colgroup", {
1188
+ ref: G(this, "colGroup")
1189
+ }, [z.map(function(a, f) {
1190
+ return n("col", {
1191
+ key: f.toString(),
1192
+ class: st(a.field) ? "k-sorted" : void 0,
1193
+ width: a.width !== void 0 ? a.width.toString().indexOf("%") !== -1 ? a.width : Math.floor(parseFloat(a.width.toString())) + "px" : void 0
1147
1194
  }, null);
1148
1195
  }, this)]), ue = {
1149
1196
  height: this.getCorrectHeight,
1150
1197
  ...this.$attrs.style
1151
- }, et = this.$props.loader && o("div", {
1198
+ }, rt = this.$props.loader && n("div", {
1152
1199
  class: "k-loader-container k-loader-container-md k-loader-top"
1153
- }, [o("div", {
1200
+ }, [n("div", {
1154
1201
  class: "k-loader-container-overlay k-overlay-light"
1155
- }, null), o("div", {
1202
+ }, null), n("div", {
1156
1203
  class: "k-loader-container-inner"
1157
- }, [o(bt, {
1204
+ }, [n(yt, {
1158
1205
  size: "large",
1159
1206
  type: "infinite-spinner"
1160
- }, null)])]), ce = ((ye = this.$props.showLoader) != null ? ye : !!this.$props.loader) && _e.call(this, {
1161
- h: Ee,
1207
+ }, null)])]), ce = ((Ie = this.$props.showLoader) != null ? Ie : !!this.$props.loader) && Te.call(this, {
1208
+ h: De,
1162
1209
  template: this.$props.loader,
1163
- defaultRendering: et
1210
+ defaultRendering: rt
1164
1211
  });
1165
- return this.$props.scrollable === "none" ? o(Fe, {
1212
+ return this.$props.scrollable === "none" ? n(Me, {
1166
1213
  ref: "navRef",
1167
1214
  id: this._gridId,
1168
1215
  navigatable: this.$props.navigatable
1169
1216
  }, {
1170
- default: () => [o(Le, {
1171
- ref: (r) => {
1172
- this.gridNavRef = r;
1217
+ default: () => [n(Ae, {
1218
+ ref: (a) => {
1219
+ this.gridNavRef = a;
1173
1220
  },
1174
1221
  currentData: this.currentData,
1222
+ id: this.$props.id,
1175
1223
  style: ue,
1176
1224
  class: this.nonscrollableWrapperClass
1177
1225
  }, {
1178
- default: () => [Z, te, o("div", {
1226
+ default: () => [ie, se, n("div", {
1179
1227
  role: "grid",
1180
1228
  class: "k-grid-aria-root",
1181
1229
  id: this._gridRoleElementId,
1182
1230
  "aria-colcount": this.getAriaColCount,
1183
1231
  "aria-rowcount": this.getAriaRowCount
1184
- }, [o("table", {
1232
+ }, [n("table", {
1185
1233
  class: "k-table",
1186
1234
  style: {
1187
1235
  tableLayout: "fixed"
1188
1236
  },
1237
+ ref: G(this, "table"),
1189
1238
  role: "none"
1190
- }, [pe, re, o("tbody", {
1239
+ }, [ot(" "), pe, ae, n("tbody", {
1191
1240
  class: "k-table-tbody",
1192
1241
  "data-keyboardnavbody": !0
1193
- }, [de, ce]), le])]), he, ie]
1242
+ }, [K, ce]), oe]), U && n(je, {
1243
+ id: E.generateNavigatableId("no-records", R)
1244
+ }, {
1245
+ default: () => [P.length ? P : n(Be, null, null)]
1246
+ })]), he, le]
1194
1247
  })]
1195
- }) : o(Fe, {
1248
+ }) : n(Me, {
1196
1249
  ref: "navRef",
1197
1250
  id: this._gridId,
1198
1251
  navigatable: this.$props.navigatable
1199
1252
  }, {
1200
- default: () => [o(Le, {
1201
- ref: (r) => {
1202
- this.gridNavRef = r;
1253
+ default: () => [n(Ae, {
1254
+ ref: (a) => {
1255
+ this.gridNavRef = a;
1203
1256
  },
1204
1257
  currentData: this.currentData,
1258
+ id: this.$props.id,
1205
1259
  style: ue,
1206
1260
  class: this.scrollableWrapperClass
1207
1261
  }, {
1208
- default: () => [Z, te, o("div", {
1262
+ default: () => [ie, se, n("div", {
1209
1263
  role: "grid",
1210
1264
  class: "k-grid-aria-root",
1211
1265
  id: this._gridRoleElementId,
1212
1266
  "aria-colcount": this.getAriaColCount,
1213
1267
  "aria-rowcount": this.getAriaRowCount
1214
- }, [re, o("div", {
1268
+ }, [ae, n("div", {
1215
1269
  class: "k-grid-container",
1216
1270
  role: "presentation"
1217
- }, [o("div", {
1271
+ }, [n("div", {
1218
1272
  role: "presentation",
1219
- ref: A(this, "scrollContainer"),
1273
+ ref: G(this, "scrollContainer"),
1220
1274
  class: "k-grid-content k-virtual-content",
1221
1275
  onScroll: this.scrollHandler
1222
- }, [o("div", {
1276
+ }, [n("div", {
1223
1277
  class: "k-grid-table-wrap",
1224
1278
  role: "presentation"
1225
- }, [o("table", {
1279
+ }, [n("table", {
1226
1280
  role: "none",
1227
1281
  class: this.gridTableClass,
1228
- ref: A(this, "scrollTable")
1229
- }, [pe, o("tbody", {
1282
+ ref: G(this, "table")
1283
+ }, [pe, n("tbody", {
1230
1284
  class: "k-table-tbody",
1231
1285
  role: "rowgroup",
1232
1286
  "data-keyboardnavbody": !0,
1233
- ref: A(this, "scrollTableBody")
1234
- }, [de])])]), o("div", {
1287
+ ref: G(this, "tableBody")
1288
+ }, [K])]), U && n(je, {
1289
+ id: E.generateNavigatableId("no-records", R)
1290
+ }, {
1291
+ default: () => [P.length ? P : n(Be, null, null)]
1292
+ })]), !U && n("div", {
1235
1293
  class: "k-height-container",
1236
1294
  role: "presentation"
1237
- }, [o("div", {
1295
+ }, [n("div", {
1296
+ ref: G(this, "scrollHeightContainer"),
1238
1297
  style: this.$props.scrollable === "virtual" ? {
1239
- height: this.vs.containerHeight + "px"
1298
+ height: this._containerHeightRef + "px"
1240
1299
  } : {}
1241
- }, null)])]), ce]), le, Je]), he, ie]
1300
+ }, null)])]), ce]), oe, Ye]), he, le]
1242
1301
  })]
1243
1302
  });
1244
1303
  }
1245
1304
  });
1246
1305
  export {
1247
- Gs as Grid
1306
+ Pi as Grid
1248
1307
  };