@progress/kendo-vue-grid 7.0.3-develop.1 → 7.1.0-develop.2

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