@progress/kendo-vue-grid 10.2.0-develop.9 → 11.0.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Grid.d.ts +3 -1
- package/Grid.js +1 -1
- package/Grid.mjs +108 -102
- package/RootGrid.d.ts +1789 -6
- package/RootGrid.js +1 -1
- package/RootGrid.mjs +19 -20
- package/codemods/v11/grid-handle-export-as-pdf.js +12 -0
- package/codemods/v11/index.js +8 -0
- package/codemods/v8/grid-default-appearance-rendering-changes.js +21 -0
- package/codemods/v8/grid-loader-binding.js +14 -0
- package/codemods/v8/grid-loader-show-loader.js +15 -0
- package/codemods/v8/grid-ref-api.js +12 -0
- package/codemods/v8/grid-ref-get-columns.js +11 -0
- package/codemods/v8/grid-row-render-item.js +12 -0
- package/codemods/v8/index.js +8 -0
- package/codemods/v8/utils.js +8 -0
- package/codemods/v9/grid-rendering-changes.js +12 -0
- package/codemods/v9/index.js +8 -0
- package/codemods/v9/utils.js +8 -0
- package/dist/cdn/js/kendo-vue-grid.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +74 -14
- package/EULA.pdf +0 -0
- package/EULA.rtf +0 -2730
package/Grid.mjs
CHANGED
|
@@ -28,7 +28,7 @@ import { ColumnResize as is } from "./drag/ColumnResize.mjs";
|
|
|
28
28
|
import { CommonDragLogic as os } from "./drag/CommonDragLogic.mjs";
|
|
29
29
|
import { DragClue as ns } from "./drag/DragClue.mjs";
|
|
30
30
|
import { DropClue as rs } from "./drag/DropClue.mjs";
|
|
31
|
-
import { applyExpandedState as
|
|
31
|
+
import { applyExpandedState as ls, getColSpan as as, autoGenerateColumns as ds, mapColumns as hs, getFlatColumnsState as Ze, getRowSpanOptions as et, getDataAsArray as cs, groupedFirstItemValue as ps, calcRowHeight as us, flatData as fs, readColumns as ms } from "./utils/main.mjs";
|
|
32
32
|
import { GridGroupCell as tt } from "./cells/GridGroupCell.mjs";
|
|
33
33
|
import { GridRow as gs } from "./rows/GridRow.mjs";
|
|
34
34
|
import { gridProps as Rs } from "./common.mjs";
|
|
@@ -40,10 +40,10 @@ import { pagerMessagesMap as nt } from "./messages/messagesMap.mjs";
|
|
|
40
40
|
import { process as Cs, orderBy as rt } from "@progress/kendo-data-query";
|
|
41
41
|
import { KendoKey as bs } from "./key.mjs";
|
|
42
42
|
import { getVirtualCellsToRender as Ss } from "./utils/virtualColumns.mjs";
|
|
43
|
-
import { StickyGroupTable as
|
|
43
|
+
import { StickyGroupTable as lt } from "./components/StickyGroupTable.mjs";
|
|
44
44
|
import { getRowContents as xs } from "./getRowContents.mjs";
|
|
45
45
|
import { useStickyGroups as Is } from "./hooks/useStickyGroups.mjs";
|
|
46
|
-
import { PinnedRowsTable as
|
|
46
|
+
import { PinnedRowsTable as at } from "./components/PinnedRowsTable.mjs";
|
|
47
47
|
import { GridPinCell as vs } from "./cells/pincell/GridPinCell.mjs";
|
|
48
48
|
import { BaseCSVExport as $s } from "./BaseCSVExport.mjs";
|
|
49
49
|
import { contextMenuItemsMap as ws, GridContextMenu as ys, getDefaultBodyContextMenuItems as ks, getDefaultHeadContextMenuItems as Hs } from "./contextMenu/GridContextMenu.mjs";
|
|
@@ -330,15 +330,15 @@ const bi = /* @__PURE__ */ bt({
|
|
|
330
330
|
field: o,
|
|
331
331
|
...typeof this.$props.clipboard != "boolean" ? this.$props.clipboard : {},
|
|
332
332
|
...s
|
|
333
|
-
}, r = this.getLeafDataItems(),
|
|
333
|
+
}, r = this.getLeafDataItems(), l = Bt({
|
|
334
334
|
event: n,
|
|
335
335
|
data: r,
|
|
336
336
|
selectedState: (p = (u = this.$props.select) != null ? u : (h = this.gridStateContext.select) == null ? void 0 : h.value) != null ? p : {},
|
|
337
337
|
previousCopiedItems: this.previousCopiedItems
|
|
338
338
|
});
|
|
339
|
-
e !== he.paste && (this.previousCopiedItems =
|
|
339
|
+
e !== he.paste && (this.previousCopiedItems = l.copiedItems), K.call(this, "clipboard") && this.$emit("clipboard", {
|
|
340
340
|
...n,
|
|
341
|
-
...
|
|
341
|
+
...l
|
|
342
342
|
});
|
|
343
343
|
},
|
|
344
344
|
handleContextMenuSelect(e) {
|
|
@@ -362,17 +362,17 @@ const bi = /* @__PURE__ */ bt({
|
|
|
362
362
|
},
|
|
363
363
|
filterPinContextMenuItems(e) {
|
|
364
364
|
var h, u;
|
|
365
|
-
const t = this.$props.dataItemKey || "", s = this.contextMenuState.dataItem, i = ((h = this.gridStateContext.pinnedTopRows) == null ? void 0 : h.value) || [], o = ((u = this.gridStateContext.pinnedBottomRows) == null ? void 0 : u.value) || [], n = t && s ? s[t] : void 0, r = n !== void 0 && i.some((p) => p[t] === n),
|
|
365
|
+
const t = this.$props.dataItemKey || "", s = this.contextMenuState.dataItem, i = ((h = this.gridStateContext.pinnedTopRows) == null ? void 0 : h.value) || [], o = ((u = this.gridStateContext.pinnedBottomRows) == null ? void 0 : u.value) || [], n = t && s ? s[t] : void 0, r = n !== void 0 && i.some((p) => p[t] === n), l = n !== void 0 && o.some((p) => p[t] === n);
|
|
366
366
|
return e.map((p) => {
|
|
367
367
|
const c = typeof p == "string" ? ws[p] : p;
|
|
368
368
|
return (c == null ? void 0 : c.name) === Q.pinRow && c.items ? {
|
|
369
369
|
...c,
|
|
370
|
-
items: c.items.filter((f) => f.name === Q.pinTop ? !r : f.name === Q.pinBottom ? !
|
|
370
|
+
items: c.items.filter((f) => f.name === Q.pinTop ? !r : f.name === Q.pinBottom ? !l : f.name === Q.unpin ? r || l : !0)
|
|
371
371
|
} : p;
|
|
372
372
|
});
|
|
373
373
|
},
|
|
374
374
|
handleContextMenuItemClick(e) {
|
|
375
|
-
var i, o, n, r,
|
|
375
|
+
var i, o, n, r, l, h, u, p;
|
|
376
376
|
const t = e.event.event.item, s = {
|
|
377
377
|
event: e.event,
|
|
378
378
|
menuItem: t,
|
|
@@ -386,7 +386,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
386
386
|
var b;
|
|
387
387
|
return H.field !== ((b = this.contextMenuColumn) == null ? void 0 : b.field);
|
|
388
388
|
});
|
|
389
|
-
C && ((
|
|
389
|
+
C && ((l = this.contextMenuColumn) != null && l.field) && v.push({
|
|
390
390
|
field: this.contextMenuColumn.field,
|
|
391
391
|
dir: C
|
|
392
392
|
}), this.sortChangeHandler(v, {
|
|
@@ -500,7 +500,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
500
500
|
},
|
|
501
501
|
handleIntersection(e) {
|
|
502
502
|
const t = {
|
|
503
|
-
rowIndex: this.rowIndexRef
|
|
503
|
+
rowIndex: this.rowIndexRef
|
|
504
504
|
};
|
|
505
505
|
e.forEach((s) => {
|
|
506
506
|
s.boundingClientRect.height !== s.intersectionRect.height && this.setCurrentOnTop(t);
|
|
@@ -513,11 +513,11 @@ const bi = /* @__PURE__ */ bt({
|
|
|
513
513
|
const {
|
|
514
514
|
rowIndex: t
|
|
515
515
|
} = e;
|
|
516
|
-
this.rowIndexRef
|
|
516
|
+
this.rowIndexRef = t;
|
|
517
517
|
const s = this._element;
|
|
518
518
|
if (this.observerRef && s) {
|
|
519
519
|
this.observerRef.disconnect();
|
|
520
|
-
const o = s.querySelector(`[absolute-row-index="${this.rowIndexRef
|
|
520
|
+
const o = s.querySelector(`[absolute-row-index="${this.rowIndexRef}"]`);
|
|
521
521
|
o ? this.observerRef.observe(o) : this.setCurrentOnTop(e);
|
|
522
522
|
}
|
|
523
523
|
},
|
|
@@ -534,13 +534,19 @@ const bi = /* @__PURE__ */ bt({
|
|
|
534
534
|
this.vsRef.container.scroll(0, n);
|
|
535
535
|
} else if (s) {
|
|
536
536
|
const n = t < 1 ? s.querySelector("tbody > tr:nth-child(1)") : s.querySelector(`tbody > tr:nth-child(${t + 1})`);
|
|
537
|
-
n && this.
|
|
537
|
+
n && this.scrollContainerRef && (this.scrollContainerRef.scrollTop = n.offsetTop);
|
|
538
538
|
}
|
|
539
539
|
},
|
|
540
540
|
getTotal() {
|
|
541
541
|
let e = this.$props.total || 0;
|
|
542
542
|
return Array.isArray(this.$props.dataItems) ? e = e || this.$props.dataItems.length : this.$props.dataItems && (e = e || this.$props.dataItems.total), e;
|
|
543
543
|
},
|
|
544
|
+
getElement() {
|
|
545
|
+
return this._element || null;
|
|
546
|
+
},
|
|
547
|
+
fitColumns(e) {
|
|
548
|
+
this.columnResize.dblClickHandler(null, e);
|
|
549
|
+
},
|
|
544
550
|
exportAsCsv() {
|
|
545
551
|
this.csvExportRef && this.csvExportRef.save();
|
|
546
552
|
},
|
|
@@ -574,11 +580,11 @@ const bi = /* @__PURE__ */ bt({
|
|
|
574
580
|
})];
|
|
575
581
|
},
|
|
576
582
|
getFlatData(e, t, s, i, o, n, r) {
|
|
577
|
-
const
|
|
583
|
+
const l = [], h = fs(l, e, t, {
|
|
578
584
|
index: s
|
|
579
585
|
}, i !== void 0, o, n, this.groupExpandable.defaultExpand, r, this.$props.expandField);
|
|
580
586
|
return {
|
|
581
|
-
flattedData:
|
|
587
|
+
flattedData: l,
|
|
582
588
|
resolvedGroupsCount: h
|
|
583
589
|
};
|
|
584
590
|
},
|
|
@@ -616,7 +622,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
616
622
|
declarationIndex: o,
|
|
617
623
|
parentIndex: n,
|
|
618
624
|
depth: r,
|
|
619
|
-
colSpan:
|
|
625
|
+
colSpan: l,
|
|
620
626
|
rowSpan: h,
|
|
621
627
|
index: u,
|
|
622
628
|
kFirst: p,
|
|
@@ -631,7 +637,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
631
637
|
return t(e);
|
|
632
638
|
},
|
|
633
639
|
setRefs() {
|
|
634
|
-
var n, r,
|
|
640
|
+
var n, r, l, h;
|
|
635
641
|
let e = "$el";
|
|
636
642
|
const t = x(this, "gridNav");
|
|
637
643
|
t && (this._element = t[e]);
|
|
@@ -642,7 +648,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
642
648
|
}
|
|
643
649
|
this.stickyHeaderRef = x(this, "stickyHeader"), this.stickyFooterRef = x(this, "stickyFooter"), this.pinnedTopRef = x(this, "pinnedTop"), this.pinnedBottomRef = x(this, "pinnedBottom");
|
|
644
650
|
const i = x(this, "dropElementClue"), o = x(this, "dragElementClue");
|
|
645
|
-
this.dragLogic.refDropElementClue(i), this.dragLogic.refDragElementClue(o), this.columnResize.colGroupMain = x(this, "colGroup"), this.columnResize.colGroupStickyHeader = (n = this.stickyHeaderRef) == null ? void 0 : n.colGroupRef, this.columnResize.colGroupStickyFooter = (r = this.stickyFooterRef) == null ? void 0 : r.colGroupRef, this.columnResize.colGroupPinnedTop = (
|
|
651
|
+
this.dragLogic.refDropElementClue(i), this.dragLogic.refDragElementClue(o), this.columnResize.colGroupMain = x(this, "colGroup"), this.columnResize.colGroupStickyHeader = (n = this.stickyHeaderRef) == null ? void 0 : n.colGroupRef, this.columnResize.colGroupStickyFooter = (r = this.stickyFooterRef) == null ? void 0 : r.colGroupRef, this.columnResize.colGroupPinnedTop = (l = this.pinnedTopRef) == null ? void 0 : l.colGroupRef, this.columnResize.colGroupPinnedBottom = (h = this.pinnedBottomRef) == null ? void 0 : h.colGroupRef, this._header = x(this, "header"), this._footer = x(this, "footer"), this.resetTableWidth(), wt();
|
|
646
652
|
},
|
|
647
653
|
gridUnmounted() {
|
|
648
654
|
clearTimeout(this.forceUpdateTimeout), this.columnResize.columns = [], this.dragLogic.columns = [], this.dragLogic && this.dragLogic.dragElementClue && (this.dragLogic.dragElementClue.$el.remove(), this.dragLogic.dropElementClue.$el.remove()), this.dataRef = [], this.columnsRef = [], document != null && document.body && this.resizeObserver && this.resizeObserver.disconnect(), this.observerRef && (this.observerRef.disconnect(), this.observerRef = null), this.clipboardServiceRef && (this.clipboardServiceRef.removeEventListeners(document), this.clipboardServiceRef = null);
|
|
@@ -716,13 +722,13 @@ const bi = /* @__PURE__ */ bt({
|
|
|
716
722
|
},
|
|
717
723
|
updateGroupCollapsed(e) {
|
|
718
724
|
let t = this.computedCollapsed, s = t[e.level];
|
|
719
|
-
const i = this.$props.uniqueField, o = function(
|
|
720
|
-
return
|
|
725
|
+
const i = this.$props.uniqueField, o = function(l, h) {
|
|
726
|
+
return l.value === e.dataItem.value && h === e.level;
|
|
721
727
|
}, n = this.allGroupedItems ? this.loopGroupedItems(this.allGroupedItems.data, o, 0, null) : e.dataItem, r = ps(n || e.dataItem, i);
|
|
722
728
|
if (e.value) {
|
|
723
729
|
if (s && s.length) {
|
|
724
|
-
const
|
|
725
|
-
|
|
730
|
+
const l = s.indexOf(r);
|
|
731
|
+
l > -1 && s.splice(l, 1);
|
|
726
732
|
}
|
|
727
733
|
} else
|
|
728
734
|
s ? s.includes(r) || s.push(r) : s = [r];
|
|
@@ -786,12 +792,12 @@ const bi = /* @__PURE__ */ bt({
|
|
|
786
792
|
event: o,
|
|
787
793
|
dataItem: n,
|
|
788
794
|
dataIndex: r,
|
|
789
|
-
columnIndex:
|
|
795
|
+
columnIndex: l
|
|
790
796
|
} = e, h = {
|
|
791
797
|
...this.getArguments(o),
|
|
792
798
|
dataItem: n,
|
|
793
|
-
startColIndex:
|
|
794
|
-
endColIndex:
|
|
799
|
+
startColIndex: l,
|
|
800
|
+
endColIndex: l,
|
|
795
801
|
startRowIndex: r,
|
|
796
802
|
endRowIndex: r,
|
|
797
803
|
dataItems: this.getLeafDataItems(),
|
|
@@ -833,19 +839,19 @@ const bi = /* @__PURE__ */ bt({
|
|
|
833
839
|
});
|
|
834
840
|
if (i === t)
|
|
835
841
|
return;
|
|
836
|
-
const o = e.target, n = je(o, "TD"), r = je(o, "TR"),
|
|
837
|
-
if (
|
|
842
|
+
const o = e.target, n = je(o, "TD"), r = je(o, "TR"), l = _t(n), h = At(r);
|
|
843
|
+
if (l !== void 0 && h !== void 0) {
|
|
838
844
|
const c = (p = cs(this.$props.dataItems)) == null ? void 0 : p[h];
|
|
839
845
|
this.gridStateContext.selectionchange({
|
|
840
846
|
...s,
|
|
841
847
|
select: i,
|
|
842
848
|
dataItem: c,
|
|
843
849
|
startRowIndex: h,
|
|
844
|
-
startColIndex:
|
|
850
|
+
startColIndex: l,
|
|
845
851
|
startDataItem: c,
|
|
846
852
|
endDataItem: c,
|
|
847
853
|
endRowIndex: h,
|
|
848
|
-
endColIndex:
|
|
854
|
+
endColIndex: l,
|
|
849
855
|
ctrlKey: e.ctrlKey,
|
|
850
856
|
altKey: e.altKey,
|
|
851
857
|
metaKey: e.metaKey,
|
|
@@ -869,7 +875,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
869
875
|
selectionRelease(e) {
|
|
870
876
|
var t, s, i;
|
|
871
877
|
if (this.computedSelectable.enabled) {
|
|
872
|
-
const o = this.getLeafDataItems(), n = o[e.startRowIndex], r = o[e.endRowIndex],
|
|
878
|
+
const o = this.getLeafDataItems(), n = o[e.startRowIndex], r = o[e.endRowIndex], l = {
|
|
873
879
|
event: void 0,
|
|
874
880
|
target: this,
|
|
875
881
|
selectedField: "",
|
|
@@ -880,13 +886,13 @@ const bi = /* @__PURE__ */ bt({
|
|
|
880
886
|
endDataItem: r,
|
|
881
887
|
...e
|
|
882
888
|
}, h = Ue({
|
|
883
|
-
event:
|
|
889
|
+
event: l,
|
|
884
890
|
selectedState: (i = (s = this.$props.select) != null ? s : (t = this.gridStateContext.select) == null ? void 0 : t.value) != null ? i : {},
|
|
885
891
|
// Thats kinda strange, even through the `dataItemKey` is required by the `getSelectedState`
|
|
886
892
|
// it does work correctly even without it
|
|
887
893
|
dataItemKey: this.$props.dataItemKey
|
|
888
894
|
});
|
|
889
|
-
this.raiseSelectionEvent(
|
|
895
|
+
this.raiseSelectionEvent(l, h);
|
|
890
896
|
}
|
|
891
897
|
},
|
|
892
898
|
clearSelection(e) {
|
|
@@ -899,8 +905,8 @@ const bi = /* @__PURE__ */ bt({
|
|
|
899
905
|
});
|
|
900
906
|
},
|
|
901
907
|
moveToNextPage(e) {
|
|
902
|
-
var o, n, r,
|
|
903
|
-
const t = (r = (n = (o = this.gridStateContext.take) == null ? void 0 : o.value) != null ? n : this.$props.pageSize) != null ? r : 0, s = (((
|
|
908
|
+
var o, n, r, l;
|
|
909
|
+
const t = (r = (n = (o = this.gridStateContext.take) == null ? void 0 : o.value) != null ? n : this.$props.pageSize) != null ? r : 0, s = (((l = this.gridStateContext.skip) == null ? void 0 : l.value) || 0) + t, i = this.getTotal();
|
|
904
910
|
s < i && this.pageChangeHandler({
|
|
905
911
|
skip: s,
|
|
906
912
|
take: t
|
|
@@ -996,8 +1002,8 @@ const bi = /* @__PURE__ */ bt({
|
|
|
996
1002
|
p++;
|
|
997
1003
|
while (p < this.columnsRef.length && this.columnsRef[p].depth > n);
|
|
998
1004
|
return p;
|
|
999
|
-
},
|
|
1000
|
-
this.columnsRef.splice(e < t ? r(t -
|
|
1005
|
+
}, l = this.columnsRef.splice(e, r(e) - e);
|
|
1006
|
+
this.columnsRef.splice(e < t ? r(t - l.length) : t, 0, ...l), this.columnsRef.filter((p) => p.declarationIndex >= 0).forEach((p, c) => {
|
|
1001
1007
|
p.orderIndex = c;
|
|
1002
1008
|
const f = o.find((m) => m.id === p.id);
|
|
1003
1009
|
f && (f.orderIndex = c);
|
|
@@ -1138,7 +1144,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1138
1144
|
locked: this.$props.lockGroups,
|
|
1139
1145
|
columnMenu: !1
|
|
1140
1146
|
};
|
|
1141
|
-
e.unshift(r), this.currentColumnsState.unshift(s.find((
|
|
1147
|
+
e.unshift(r), this.currentColumnsState.unshift(s.find((l) => l.id === r.id) || r);
|
|
1142
1148
|
}
|
|
1143
1149
|
e.slice(o).forEach((n) => {
|
|
1144
1150
|
n.parentIndex >= 0 && (n.parentIndex += o), n.rowSpannable = n.rowSpannable !== void 0 ? et(n.rowSpannable) : this.computedRowSpannable;
|
|
@@ -1180,8 +1186,8 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1180
1186
|
return null;
|
|
1181
1187
|
},
|
|
1182
1188
|
getDataState() {
|
|
1183
|
-
var n, r,
|
|
1184
|
-
const e = (n = this.gridStateContext.sort) == null ? void 0 : n.value, t = (r = this.gridStateContext.filter) == null ? void 0 : r.value, s = (
|
|
1189
|
+
var n, r, l, h, u;
|
|
1190
|
+
const e = (n = this.gridStateContext.sort) == null ? void 0 : n.value, t = (r = this.gridStateContext.filter) == null ? void 0 : r.value, s = (l = this.gridStateContext.skip) == null ? void 0 : l.value, i = (h = this.gridStateContext.take) == null ? void 0 : h.value, o = (u = this.gridStateContext.group) == null ? void 0 : u.value;
|
|
1185
1191
|
return {
|
|
1186
1192
|
filter: t,
|
|
1187
1193
|
sort: e,
|
|
@@ -1235,24 +1241,24 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1235
1241
|
var n;
|
|
1236
1242
|
const s = [];
|
|
1237
1243
|
let i = null, o = 0;
|
|
1238
|
-
if (t.forEach((r,
|
|
1244
|
+
if (t.forEach((r, l) => {
|
|
1239
1245
|
const h = parseFloat((r.width || "").toString()) || 10;
|
|
1240
1246
|
if (o) {
|
|
1241
1247
|
o--, i && (i.width += h);
|
|
1242
1248
|
return;
|
|
1243
1249
|
}
|
|
1244
|
-
const u = Math.min(
|
|
1250
|
+
const u = Math.min(as(r, e), t.length - l);
|
|
1245
1251
|
o = u - 1, i = {
|
|
1246
1252
|
width: h,
|
|
1247
1253
|
colSpan: u,
|
|
1248
|
-
columnIndex:
|
|
1254
|
+
columnIndex: l
|
|
1249
1255
|
}, s.push(i);
|
|
1250
1256
|
}), this.$props.columnVirtualization) {
|
|
1251
|
-
const r = this.scrollLeftRef || 0,
|
|
1257
|
+
const r = this.scrollLeftRef || 0, l = this.tableWidth || parseFloat((((n = this.$attrs.style) == null ? void 0 : n.width) || "").toString());
|
|
1252
1258
|
return Ss({
|
|
1253
1259
|
cellModels: s,
|
|
1254
1260
|
columns: t,
|
|
1255
|
-
tableViewPortWidth:
|
|
1261
|
+
tableViewPortWidth: l,
|
|
1256
1262
|
scrollLeft: r
|
|
1257
1263
|
});
|
|
1258
1264
|
}
|
|
@@ -1283,7 +1289,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1283
1289
|
if (!t || !e)
|
|
1284
1290
|
return "none";
|
|
1285
1291
|
const o = e[t];
|
|
1286
|
-
return s != null && s.some((
|
|
1292
|
+
return s != null && s.some((l) => l[t] === o) ? "top" : i != null && i.some((l) => l[t] === o) ? "bottom" : "none";
|
|
1287
1293
|
},
|
|
1288
1294
|
handleRowPin(e, t) {
|
|
1289
1295
|
var u, p, c, f;
|
|
@@ -1291,27 +1297,27 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1291
1297
|
return;
|
|
1292
1298
|
const {
|
|
1293
1299
|
dataItemKey: s = ""
|
|
1294
|
-
} = this.$props, i = ((u = this.gridStateContext.pinnedTopRows) == null ? void 0 : u.value) || [], o = ((p = this.gridStateContext.pinnedBottomRows) == null ? void 0 : p.value) || [], n = t[s], r = i.filter((m) => m[s] !== n),
|
|
1300
|
+
} = this.$props, i = ((u = this.gridStateContext.pinnedTopRows) == null ? void 0 : u.value) || [], o = ((p = this.gridStateContext.pinnedBottomRows) == null ? void 0 : p.value) || [], n = t[s], r = i.filter((m) => m[s] !== n), l = o.filter((m) => m[s] !== n);
|
|
1295
1301
|
let h;
|
|
1296
1302
|
switch (e) {
|
|
1297
1303
|
case "pinTop":
|
|
1298
1304
|
h = {
|
|
1299
1305
|
pinnedTopRows: [...r, t],
|
|
1300
|
-
pinnedBottomRows:
|
|
1306
|
+
pinnedBottomRows: l,
|
|
1301
1307
|
dataItem: t
|
|
1302
1308
|
};
|
|
1303
1309
|
break;
|
|
1304
1310
|
case "pinBottom":
|
|
1305
1311
|
h = {
|
|
1306
1312
|
pinnedTopRows: r,
|
|
1307
|
-
pinnedBottomRows: [...
|
|
1313
|
+
pinnedBottomRows: [...l, t],
|
|
1308
1314
|
dataItem: t
|
|
1309
1315
|
};
|
|
1310
1316
|
break;
|
|
1311
1317
|
case "unpin":
|
|
1312
1318
|
h = {
|
|
1313
1319
|
pinnedTopRows: r,
|
|
1314
|
-
pinnedBottomRows:
|
|
1320
|
+
pinnedBottomRows: l,
|
|
1315
1321
|
dataItem: t
|
|
1316
1322
|
};
|
|
1317
1323
|
break;
|
|
@@ -1352,7 +1358,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1352
1358
|
};
|
|
1353
1359
|
},
|
|
1354
1360
|
setup(e) {
|
|
1355
|
-
const t = R(null), s = R(null), i = R(null), o = R(null), n = R(null), r = R(null),
|
|
1361
|
+
const t = R(null), s = R(null), i = R(null), o = R(null), n = R(null), r = R(null), l = R(null), h = R([]), u = R([]), p = R(null), c = R(null), f = R(null), m = R(null), I = R(null), C = R(null), $ = R(null), v = R(!0), H = R(!1), b = new ss(), P = R(0), V = xt(bs, {}), Z = typeof e.groupable == "object" && !!e.groupable.stickyHeaders, z = typeof e.groupable == "object" && !!e.groupable.stickyFooters, O = R([]), N = _e(() => {
|
|
1356
1362
|
var q, G;
|
|
1357
1363
|
return !!((G = (q = V.group) == null ? void 0 : q.value) != null && G.length);
|
|
1358
1364
|
}), D = null, T = R(void 0), W = R({
|
|
@@ -1384,7 +1390,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1384
1390
|
headerRef: o,
|
|
1385
1391
|
footerRef: n,
|
|
1386
1392
|
gridNavRef: r,
|
|
1387
|
-
colGroupRef:
|
|
1393
|
+
colGroupRef: l,
|
|
1388
1394
|
scrollContainerRef: p,
|
|
1389
1395
|
tableBodyRef: C,
|
|
1390
1396
|
gridStateContext: V,
|
|
@@ -1407,7 +1413,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1407
1413
|
},
|
|
1408
1414
|
render() {
|
|
1409
1415
|
var Ce, be, Se, xe, Ie, ve, $e, we, ye, ke, He, Te, Ee, Me, Pe, ze, De, Ge;
|
|
1410
|
-
const e = (Ce = this.gridStateContext.sort) == null ? void 0 : Ce.value, t = (be = this.gridStateContext.filter) == null ? void 0 : be.value, s = (Se = this.gridStateContext.search) == null ? void 0 : Se.value, i = (xe = this.gridStateContext.select) == null ? void 0 : xe.value, o = (Ie = this.gridStateContext.skip) == null ? void 0 : Ie.value, n = (ve = this.gridStateContext.take) == null ? void 0 : ve.value, r = ($e = this.gridStateContext.group) == null ? void 0 : $e.value,
|
|
1416
|
+
const e = (Ce = this.gridStateContext.sort) == null ? void 0 : Ce.value, t = (be = this.gridStateContext.filter) == null ? void 0 : be.value, s = (Se = this.gridStateContext.search) == null ? void 0 : Se.value, i = (xe = this.gridStateContext.select) == null ? void 0 : xe.value, o = (Ie = this.gridStateContext.skip) == null ? void 0 : Ie.value, n = (ve = this.gridStateContext.take) == null ? void 0 : ve.value, r = ($e = this.gridStateContext.group) == null ? void 0 : $e.value, l = (we = this.gridStateContext.groupExpand) == null ? void 0 : we.value, h = (ye = this.gridStateContext.detailExpand) == null ? void 0 : ye.value, u = (r == null ? void 0 : r.length) || 0, p = typeof this.$props.groupable == "object" && !!this.$props.groupable.stickyHeaders, c = typeof this.$props.groupable == "object" && !!this.$props.groupable.stickyFooters, f = !!(r != null && r.length);
|
|
1411
1417
|
let m;
|
|
1412
1418
|
this.currentColumnsState = (ke = this.gridStateContext.columnsState) == null ? void 0 : ke.value;
|
|
1413
1419
|
const I = this.$props.autoProcessData === !0 ? {
|
|
@@ -1420,19 +1426,19 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1420
1426
|
let C;
|
|
1421
1427
|
const $ = M.getIdPrefix(this.navigation);
|
|
1422
1428
|
let v = [];
|
|
1423
|
-
Array.isArray(this.$props.dataItems) ? (v = this.$props.dataItems, C = (He = this.$props.total) != null ? He : v.length) : (v = ((Te =
|
|
1429
|
+
Array.isArray(this.$props.dataItems) ? (v = this.$props.dataItems, C = (He = this.$props.total) != null ? He : v.length) : (v = ((Te = ls(this.$props.dataItems, this.$props.collapsedGroups.length ? this.computedCollapsed : [], this.$props.uniqueField)) == null ? void 0 : Te.data) || [], C = (Pe = (Me = this.$props.total) != null ? Me : (Ee = this.$props.dataItems) == null ? void 0 : Ee.total) != null ? Pe : v.length);
|
|
1424
1430
|
const H = this.$props.groupable === !0 || Y(this.$props.groupable) && this.$props.groupable.enabled !== !1;
|
|
1425
1431
|
this.dragLogic.reorderable = this.$props.reorderable || !1, this.dragLogic.groupable = H, this._virtualPageSize = this.calcVirtualPageSize();
|
|
1426
1432
|
const b = v.length === C, P = Y(this.$props.groupable) && this.$props.groupable.footer || "none";
|
|
1427
1433
|
if (I) {
|
|
1428
|
-
const
|
|
1434
|
+
const a = I.page && !(this.isVirtualScroll && !this.$props.pageable), {
|
|
1429
1435
|
data: S,
|
|
1430
1436
|
total: y
|
|
1431
1437
|
} = Cs(v, {
|
|
1432
1438
|
group: I.group ? r : void 0,
|
|
1433
1439
|
sort: I.sort ? e : void 0,
|
|
1434
1440
|
filter: Et(I.filter ? t : void 0, I.search ? s : void 0),
|
|
1435
|
-
...
|
|
1441
|
+
...a ? {
|
|
1436
1442
|
take: this.$props.pageable ? n || 10 : n,
|
|
1437
1443
|
skip: o || 0
|
|
1438
1444
|
} : {}
|
|
@@ -1442,24 +1448,24 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1442
1448
|
const {
|
|
1443
1449
|
resolvedGroupsCount: V,
|
|
1444
1450
|
flattedData: Z
|
|
1445
|
-
} = this.getFlatData(v, P, b ? 0 : this.$props.skip || 0, r, h,
|
|
1451
|
+
} = this.getFlatData(v, P, b ? 0 : this.$props.skip || 0, r, h, l, this.$props.dataItemKey);
|
|
1446
1452
|
this.dataRef = Z;
|
|
1447
1453
|
const z = this.virtualSkipRef || 0;
|
|
1448
1454
|
if (this._virtualTotal = C, this.isVirtualScroll) {
|
|
1449
|
-
let
|
|
1450
|
-
if ((f || this.$props.pageable) && (
|
|
1455
|
+
let a = o || 0;
|
|
1456
|
+
if ((f || this.$props.pageable) && (a = z, this._virtualTotal = this.dataRef.length), b || f || this.$props.pageable)
|
|
1451
1457
|
if (this._virtualPageSize === 0) {
|
|
1452
1458
|
const S = Math.min(n || this.$props.pageSize || 20, this.dataRef.length);
|
|
1453
|
-
m = this.dataRef.slice(
|
|
1459
|
+
m = this.dataRef.slice(a, a + S);
|
|
1454
1460
|
} else
|
|
1455
|
-
m = this.dataRef.slice(
|
|
1461
|
+
m = this.dataRef.slice(a, a + this._virtualPageSize);
|
|
1456
1462
|
}
|
|
1457
1463
|
this.initializeVirtualization();
|
|
1458
1464
|
const O = (De = this.selectable) != null && De.drag ? "none" : void 0;
|
|
1459
1465
|
this.initColumns(this.$props.dataItems, V), this.columnResize.resizable = this.$props.resizable || !1, this.columnResize.columns = this.columnsRef, this.columnResize.columnsState = It(this.currentColumnsState || []), this.dragLogic.columns = this.columnsRef;
|
|
1460
|
-
const N = this.$props.toolbar, D = this.$props.noRecords, T = this.columnsRef.filter((
|
|
1461
|
-
ref: (
|
|
1462
|
-
this.groupPanelDivRef =
|
|
1466
|
+
const N = this.$props.toolbar, D = this.$props.noRecords, T = this.columnsRef.filter((a) => a.children.length === 0), W = H && d(Yt, {
|
|
1467
|
+
ref: (a) => {
|
|
1468
|
+
this.groupPanelDivRef = a;
|
|
1463
1469
|
},
|
|
1464
1470
|
group: r || [],
|
|
1465
1471
|
ariaControls: this._gridRoleElementId,
|
|
@@ -1469,31 +1475,31 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1469
1475
|
onReleaseHandler: this.dragLogic.releaseHandler,
|
|
1470
1476
|
resolveTitle: this.resolveTitle
|
|
1471
1477
|
}, null), U = (this.dragLogic.reorderable || this.dragLogic.groupable) && B && document && document.body, j = [U && d(rs, {
|
|
1472
|
-
ref: (
|
|
1473
|
-
this.dropElementClueRef =
|
|
1478
|
+
ref: (a) => {
|
|
1479
|
+
this.dropElementClueRef = a;
|
|
1474
1480
|
}
|
|
1475
1481
|
}, null), U && d(ns, {
|
|
1476
|
-
ref: (
|
|
1477
|
-
this.dragElementClueRef =
|
|
1482
|
+
ref: (a) => {
|
|
1483
|
+
this.dragElementClueRef = a;
|
|
1478
1484
|
}
|
|
1479
1485
|
}, null)], q = this.showLicenseWatermark ? d(vt, {
|
|
1480
1486
|
message: this.licenseMessage
|
|
1481
1487
|
}, null) : null, G = this.$attrs.style, ht = G && Y(G) && G["width"] || "";
|
|
1482
1488
|
this.tableWidth = parseFloat(ht.toString());
|
|
1483
|
-
const ct = T.findIndex((
|
|
1489
|
+
const ct = T.findIndex((a) => typeof a.colSpan == "function") > -1;
|
|
1484
1490
|
let J;
|
|
1485
1491
|
J = this.getCellsToRender({}, T);
|
|
1486
|
-
const F = T.map(function(
|
|
1492
|
+
const F = T.map(function(a, S) {
|
|
1487
1493
|
return d("col", {
|
|
1488
|
-
key:
|
|
1489
|
-
width:
|
|
1494
|
+
key: a.id || `col-${S}`,
|
|
1495
|
+
width: a.width !== void 0 ? Math.floor(parseFloat(a.width.toString())) : void 0
|
|
1490
1496
|
}, null);
|
|
1491
1497
|
}, this), pe = d(qt, {
|
|
1492
1498
|
size: this.$props.size,
|
|
1493
1499
|
columnResize: this.columnResize,
|
|
1494
1500
|
staticHeaders: this.$props.scrollable !== "none",
|
|
1495
|
-
ref: (
|
|
1496
|
-
this.headerRef =
|
|
1501
|
+
ref: (a) => {
|
|
1502
|
+
this.headerRef = a;
|
|
1497
1503
|
},
|
|
1498
1504
|
onHeaderscroll: this.onHeaderScroll,
|
|
1499
1505
|
headerRow: d(Jt, {
|
|
@@ -1524,7 +1530,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1524
1530
|
cells: this.$props.cells,
|
|
1525
1531
|
isRtl: this.isRtl,
|
|
1526
1532
|
isColCountDefined: this.getAriaColCount !== void 0,
|
|
1527
|
-
headerSelectionValue: !!(i && this.dataRef.filter((
|
|
1533
|
+
headerSelectionValue: !!(i && this.dataRef.filter((a) => a.rowType === "data").every((a) => i && this.$props.dataItemKey && E(this.$props.dataItemKey)(a.dataItem) !== void 0 ? i[E(this.$props.dataItemKey)(a.dataItem)] : void 0)),
|
|
1528
1534
|
filterRow: this.$props.filterable && d(Xt, {
|
|
1529
1535
|
grid: this,
|
|
1530
1536
|
size: this.$props.size,
|
|
@@ -1543,15 +1549,15 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1543
1549
|
}, null) || void 0
|
|
1544
1550
|
}, null),
|
|
1545
1551
|
cols: F
|
|
1546
|
-
}, null), ue = this.columnsRef.some((
|
|
1552
|
+
}, null), ue = this.columnsRef.some((a) => {
|
|
1547
1553
|
var S;
|
|
1548
|
-
return !!(
|
|
1554
|
+
return !!(a.footerCell || (S = a.cells) != null && S.footerCell);
|
|
1549
1555
|
}) || (Ge = this.$props.cells) != null && Ge.footerCell ? d(Qt, {
|
|
1550
1556
|
size: this.$props.size,
|
|
1551
1557
|
columnResize: this.columnResize,
|
|
1552
1558
|
staticHeaders: this.$props.scrollable !== "none",
|
|
1553
|
-
ref: (
|
|
1554
|
-
this.footerRef =
|
|
1559
|
+
ref: (a) => {
|
|
1560
|
+
this.footerRef = a;
|
|
1555
1561
|
},
|
|
1556
1562
|
row: d(Zt, {
|
|
1557
1563
|
isRtl: this.isRtl,
|
|
@@ -1585,14 +1591,14 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1585
1591
|
columnsRef: this.columnsRef,
|
|
1586
1592
|
isRtl: this.isRtl,
|
|
1587
1593
|
idPrefix: $
|
|
1588
|
-
}, pt = function(
|
|
1589
|
-
return xs(_,
|
|
1594
|
+
}, pt = function(a, S, y, oe, ne) {
|
|
1595
|
+
return xs(_, a, S, y, oe, ne);
|
|
1590
1596
|
};
|
|
1591
1597
|
let ut = 0, ee = [];
|
|
1592
|
-
const te = !this.dataRef.length, fe = (
|
|
1598
|
+
const te = !this.dataRef.length, fe = (a) => a >= this.dataRef.length - ut;
|
|
1593
1599
|
let se = 0;
|
|
1594
1600
|
if (this.dataRef.length) {
|
|
1595
|
-
const
|
|
1601
|
+
const a = this._columnsMap.length + (this.$props.filterable ? 1 : 0) + 1;
|
|
1596
1602
|
let S = this.$props.skip || 0, y = -1, oe = 0;
|
|
1597
1603
|
const ne = this.computedRowSpannable.enabled ? {} : void 0;
|
|
1598
1604
|
if (this.isVirtualScroll) {
|
|
@@ -1604,13 +1610,13 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1604
1610
|
}
|
|
1605
1611
|
ee = (m || this.dataRef).map(function(g, A) {
|
|
1606
1612
|
g.rowType === "data" && y++;
|
|
1607
|
-
const re = g.dataIndex % 2 !== 0, Fe = this.$props.dataItemKey && E(this.$props.dataItemKey)(g.dataItem),
|
|
1608
|
-
return se =
|
|
1609
|
-
key:
|
|
1613
|
+
const re = g.dataIndex % 2 !== 0, Fe = this.$props.dataItemKey && E(this.$props.dataItemKey)(g.dataItem), le = A + S, ae = Fe || "ai" + le, de = ae + "_1", X = pt.call(this, g, ae, y, re, ne), Rt = g.rowType === "data" ? this.pinnedSourceSet.has(g.dataItem) : !1, Ct = T.length - (this.detailExpandable.enabled ? 1 : 0) - ((r == null ? void 0 : r.length) || 0) || 1;
|
|
1614
|
+
return se = le + a + oe, [d(gs, {
|
|
1615
|
+
key: ae,
|
|
1610
1616
|
item: g,
|
|
1611
1617
|
dataIndex: y,
|
|
1612
1618
|
ariaRowIndex: se,
|
|
1613
|
-
absoluteRowIndex:
|
|
1619
|
+
absoluteRowIndex: le,
|
|
1614
1620
|
isAltRow: re,
|
|
1615
1621
|
isHidden: fe(A),
|
|
1616
1622
|
rowHeight: this.$props.rowHeight,
|
|
@@ -1680,13 +1686,13 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1680
1686
|
pagesizechange: this.pageChangeHandler,
|
|
1681
1687
|
pagechange: this.pageChangeHandler
|
|
1682
1688
|
}
|
|
1683
|
-
}), mt = (
|
|
1689
|
+
}), mt = (a) => e && e.filter((S) => S.field === a).length > 0, ge = d("colgroup", {
|
|
1684
1690
|
ref: w(this, "colGroup")
|
|
1685
|
-
}, [T.map(function(
|
|
1691
|
+
}, [T.map(function(a, S) {
|
|
1686
1692
|
return d("col", {
|
|
1687
|
-
key:
|
|
1688
|
-
class: mt(
|
|
1689
|
-
width:
|
|
1693
|
+
key: a.id || `col-${S}`,
|
|
1694
|
+
class: mt(a.field) ? "k-sorted" : void 0,
|
|
1695
|
+
width: a.width !== void 0 ? a.width.toString().indexOf("%") !== -1 ? a.width : Math.floor(parseFloat(a.width.toString())) + "px" : void 0
|
|
1690
1696
|
}, null);
|
|
1691
1697
|
}, this)]), Re = {
|
|
1692
1698
|
height: this.getCorrectHeight,
|
|
@@ -1718,8 +1724,8 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1718
1724
|
columnVirtualization: this.$props.columnVirtualization
|
|
1719
1725
|
}, {
|
|
1720
1726
|
default: () => [d(Je, {
|
|
1721
|
-
ref: (
|
|
1722
|
-
this.gridNavRef =
|
|
1727
|
+
ref: (a) => {
|
|
1728
|
+
this.gridNavRef = a;
|
|
1723
1729
|
},
|
|
1724
1730
|
columnsRef: this.columnsRef,
|
|
1725
1731
|
dataRef: this.dataRef,
|
|
@@ -1763,8 +1769,8 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1763
1769
|
columnVirtualization: this.$props.columnVirtualization
|
|
1764
1770
|
}, {
|
|
1765
1771
|
default: () => [d(Je, {
|
|
1766
|
-
ref: (
|
|
1767
|
-
this.gridNavRef =
|
|
1772
|
+
ref: (a) => {
|
|
1773
|
+
this.gridNavRef = a;
|
|
1768
1774
|
},
|
|
1769
1775
|
dataRef: this.dataRef,
|
|
1770
1776
|
id: this.$props.id,
|
|
@@ -1784,7 +1790,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1784
1790
|
id: this._gridRoleElementId,
|
|
1785
1791
|
"aria-colcount": this.getAriaColCount,
|
|
1786
1792
|
"aria-rowcount": this.getAriaRowCount
|
|
1787
|
-
}, [pe, this.hasPinnedTopRows && d(
|
|
1793
|
+
}, [pe, this.hasPinnedTopRows && d(at, {
|
|
1788
1794
|
ref: w(this, "pinnedTop"),
|
|
1789
1795
|
size: this.$props.size,
|
|
1790
1796
|
cols: F,
|
|
@@ -1797,7 +1803,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1797
1803
|
}, null), d("div", {
|
|
1798
1804
|
class: "k-grid-container",
|
|
1799
1805
|
role: "presentation"
|
|
1800
|
-
}, [f && p && d(
|
|
1806
|
+
}, [f && p && d(lt, {
|
|
1801
1807
|
ref: w(this, "stickyHeader"),
|
|
1802
1808
|
size: this.$props.size,
|
|
1803
1809
|
cols: F,
|
|
@@ -1839,7 +1845,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1839
1845
|
style: this.$props.scrollable === "virtual" ? {
|
|
1840
1846
|
height: this._containerHeightRef + "px"
|
|
1841
1847
|
} : {}
|
|
1842
|
-
}, null)])]), f && c && d(
|
|
1848
|
+
}, null)])]), f && c && d(lt, {
|
|
1843
1849
|
ref: w(this, "stickyFooter"),
|
|
1844
1850
|
size: this.$props.size,
|
|
1845
1851
|
cols: F,
|
|
@@ -1847,7 +1853,7 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1847
1853
|
position: "bottom",
|
|
1848
1854
|
groupLevelCount: u,
|
|
1849
1855
|
rowHeight: this.$props.rowHeight
|
|
1850
|
-
}, null)]), this.hasPinnedBottomRows && d(
|
|
1856
|
+
}, null)]), this.hasPinnedBottomRows && d(at, {
|
|
1851
1857
|
ref: w(this, "pinnedBottom"),
|
|
1852
1858
|
size: this.$props.size,
|
|
1853
1859
|
cols: F,
|
|
@@ -1860,8 +1866,8 @@ const bi = /* @__PURE__ */ bt({
|
|
|
1860
1866
|
}, null), ue, q]), me, ie, j]
|
|
1861
1867
|
})]
|
|
1862
1868
|
}), this.renderContextMenu(), this.$props.csv && d($s, {
|
|
1863
|
-
ref: (
|
|
1864
|
-
this.csvExportRef =
|
|
1869
|
+
ref: (a) => {
|
|
1870
|
+
this.csvExportRef = a;
|
|
1865
1871
|
},
|
|
1866
1872
|
gridProps: this.$props,
|
|
1867
1873
|
csv: this.$props.csv,
|