@progress/kendo-vue-grid 8.3.0 → 8.4.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/BaseCSVExport.d.ts +98 -0
- package/BaseCSVExport.js +8 -0
- package/BaseCSVExport.mjs +121 -0
- package/Grid.d.ts +17 -14
- package/Grid.js +1 -1
- package/Grid.mjs +195 -177
- package/GridCsvExportButton.d.ts +98 -0
- package/GridCsvExportButton.js +8 -0
- package/GridCsvExportButton.mjs +71 -0
- package/GridState.d.ts +6 -14
- package/RootGrid.d.ts +6 -14
- package/common.d.ts +3 -7
- package/common.js +1 -1
- package/common.mjs +3 -1
- package/dist/cdn/js/kendo-vue-grid.js +1 -1
- package/index.d.mts +2 -0
- package/index.d.ts +2 -0
- package/index.js +1 -1
- package/index.mjs +27 -24
- package/interfaces/GridProps.d.ts +83 -7
- package/messages/main.d.ts +5 -0
- package/messages/main.js +2 -2
- package/messages/main.mjs +111 -109
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +15 -13
- package/utils/dataProcessing.d.ts +68 -0
- package/utils/dataProcessing.js +8 -0
- package/utils/dataProcessing.mjs +49 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { PropType } from 'vue';
|
|
9
|
+
import { GridProps, GridCSVExportOptions } from './interfaces/GridProps';
|
|
10
|
+
/**
|
|
11
|
+
* @hidden
|
|
12
|
+
*/
|
|
13
|
+
export interface BaseCSVExportProps {
|
|
14
|
+
gridProps: GridProps;
|
|
15
|
+
csv?: GridProps['csv'];
|
|
16
|
+
fileName?: string;
|
|
17
|
+
onCsvexport?: (data: any[]) => any[];
|
|
18
|
+
columnsState?: Array<{
|
|
19
|
+
field?: string;
|
|
20
|
+
title?: string;
|
|
21
|
+
hidden?: boolean;
|
|
22
|
+
show?: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @hidden
|
|
27
|
+
*/
|
|
28
|
+
export interface BaseCSVExportMethods {
|
|
29
|
+
save: () => void;
|
|
30
|
+
getBlob: () => Blob;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @hidden
|
|
34
|
+
*/
|
|
35
|
+
declare const BaseCSVExport: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
36
|
+
gridProps: {
|
|
37
|
+
type: PropType<GridProps>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
csv: {
|
|
41
|
+
type: PropType<boolean | GridCSVExportOptions>;
|
|
42
|
+
default: any;
|
|
43
|
+
};
|
|
44
|
+
fileName: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
default: string;
|
|
47
|
+
};
|
|
48
|
+
onCsvexport: {
|
|
49
|
+
type: PropType<(data: any[]) => any[]>;
|
|
50
|
+
default: any;
|
|
51
|
+
};
|
|
52
|
+
columnsState: {
|
|
53
|
+
type: PropType<{
|
|
54
|
+
field?: string;
|
|
55
|
+
title?: string;
|
|
56
|
+
hidden?: boolean;
|
|
57
|
+
show?: boolean;
|
|
58
|
+
}[]>;
|
|
59
|
+
default: any;
|
|
60
|
+
};
|
|
61
|
+
}>, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
62
|
+
gridProps: {
|
|
63
|
+
type: PropType<GridProps>;
|
|
64
|
+
required: true;
|
|
65
|
+
};
|
|
66
|
+
csv: {
|
|
67
|
+
type: PropType<boolean | GridCSVExportOptions>;
|
|
68
|
+
default: any;
|
|
69
|
+
};
|
|
70
|
+
fileName: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
default: string;
|
|
73
|
+
};
|
|
74
|
+
onCsvexport: {
|
|
75
|
+
type: PropType<(data: any[]) => any[]>;
|
|
76
|
+
default: any;
|
|
77
|
+
};
|
|
78
|
+
columnsState: {
|
|
79
|
+
type: PropType<{
|
|
80
|
+
field?: string;
|
|
81
|
+
title?: string;
|
|
82
|
+
hidden?: boolean;
|
|
83
|
+
show?: boolean;
|
|
84
|
+
}[]>;
|
|
85
|
+
default: any;
|
|
86
|
+
};
|
|
87
|
+
}>> & Readonly<{}>, {
|
|
88
|
+
columnsState: {
|
|
89
|
+
field?: string;
|
|
90
|
+
title?: string;
|
|
91
|
+
hidden?: boolean;
|
|
92
|
+
show?: boolean;
|
|
93
|
+
}[];
|
|
94
|
+
csv: any;
|
|
95
|
+
onCsvexport: (data: any[]) => any[];
|
|
96
|
+
fileName: string;
|
|
97
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
98
|
+
export { BaseCSVExport };
|
package/BaseCSVExport.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("vue"),g=require("@progress/kendo-csv"),b=require("@progress/kendo-file-saver"),m=require("@progress/kendo-data-query"),i=require("./utils/dataProcessing.js"),f=e=>e&&typeof e=="object"&&"items"in e&&"field"in e,S=e=>e&&typeof e=="object"&&"data"in e?e.data||[]:Array.isArray(e)?e:[],C=(e,t)=>{const u=[],a=[];return e.length>0?e.forEach(({field:n,title:o})=>{u.push(n),a.push(o)}):t.length>0&&!Array.isArray(t[0])&&!f(t[0])&&Object.keys(t[0]).forEach(n=>{u.push(n),a.push(n)}),{autoKeys:u,autoNames:a}},A=(e,t,u)=>{const a=u.allPages!==!1,n=i.normalizeAutoProcessData(t.autoProcessData);if(n)return i.processData(e,{autoProcessData:n,group:t.group,defaultGroup:t.defaultGroup,sort:t.sort,defaultSort:t.defaultSort,filter:t.filter,defaultFilter:t.defaultFilter,search:t.search,pageable:t.pageable,take:t.take,skip:t.skip,includePaging:!a}).data;const o=t.group||t.defaultGroup;return o&&o.length>0?m.process(e,{group:o}).data:e},x=(e,t,u)=>{var o,s;let a=(o=e.keys)!=null?o:void 0,n=(s=e.names)!=null?s:void 0;if(!a||!n){const{autoKeys:l,autoNames:c}=C(t,u);a!=null||(a=l.length>0?l:void 0),n!=null||(n=c.length>0?c:void 0)}return{keys:a,names:n}},j=p.defineComponent({name:"BaseCSVExport",props:{gridProps:{type:Object,required:!0},csv:{type:[Boolean,Object],default:void 0},fileName:{type:String,default:"grid-export.csv"},onCsvexport:{type:Function,default:void 0},columnsState:{type:Array,default:void 0}},setup(e,{expose:t}){const u=()=>{const n=typeof e.csv=="object"&&e.csv!==null?e.csv:{},o=n.data||e.gridProps.dataItems||[];let s=S(o);const l=e.onCsvexport;l&&(s=l(s)),s=A(s,e.gridProps,n);const c=(e.columnsState||[]).filter(r=>r.field&&!r.hidden&&r.show!==!1).map(r=>({field:r.field,title:r.title||r.field})),{keys:d,names:v}=x(n,c,s),y=s.length>0&&f(s[0])?{data:s,total:s.length}:s,h={...n,data:y,keys:d,names:v};return g.toCSVBlob(h)};return t({save:()=>{const n=typeof e.csv=="object"&&e.csv!==null?e.csv:{},o=u(),s=n.fileName||e.fileName||"grid-export.csv";b.saveAs(o,s)},getBlob:u}),()=>null}});exports.BaseCSVExport=j;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { defineComponent as v } from "vue";
|
|
9
|
+
import { toCSVBlob as y } from "@progress/kendo-csv";
|
|
10
|
+
import { saveAs as h } from "@progress/kendo-file-saver";
|
|
11
|
+
import { process as b } from "@progress/kendo-data-query";
|
|
12
|
+
import { normalizeAutoProcessData as g, processData as A } from "./utils/dataProcessing.mjs";
|
|
13
|
+
const f = (e) => e && typeof e == "object" && "items" in e && "field" in e, S = (e) => e && typeof e == "object" && "data" in e ? e.data || [] : Array.isArray(e) ? e : [], x = (e, t) => {
|
|
14
|
+
const l = [], o = [];
|
|
15
|
+
return e.length > 0 ? e.forEach(({
|
|
16
|
+
field: n,
|
|
17
|
+
title: a
|
|
18
|
+
}) => {
|
|
19
|
+
l.push(n), o.push(a);
|
|
20
|
+
}) : t.length > 0 && !Array.isArray(t[0]) && !f(t[0]) && Object.keys(t[0]).forEach((n) => {
|
|
21
|
+
l.push(n), o.push(n);
|
|
22
|
+
}), {
|
|
23
|
+
autoKeys: l,
|
|
24
|
+
autoNames: o
|
|
25
|
+
};
|
|
26
|
+
}, C = (e, t, l) => {
|
|
27
|
+
const o = l.allPages !== !1, n = g(t.autoProcessData);
|
|
28
|
+
if (n)
|
|
29
|
+
return A(e, {
|
|
30
|
+
autoProcessData: n,
|
|
31
|
+
group: t.group,
|
|
32
|
+
defaultGroup: t.defaultGroup,
|
|
33
|
+
sort: t.sort,
|
|
34
|
+
defaultSort: t.defaultSort,
|
|
35
|
+
filter: t.filter,
|
|
36
|
+
defaultFilter: t.defaultFilter,
|
|
37
|
+
search: t.search,
|
|
38
|
+
pageable: t.pageable,
|
|
39
|
+
take: t.take,
|
|
40
|
+
skip: t.skip,
|
|
41
|
+
includePaging: !o
|
|
42
|
+
}).data;
|
|
43
|
+
const a = t.group || t.defaultGroup;
|
|
44
|
+
return a && a.length > 0 ? b(e, {
|
|
45
|
+
group: a
|
|
46
|
+
}).data : e;
|
|
47
|
+
}, G = (e, t, l) => {
|
|
48
|
+
var a, s;
|
|
49
|
+
let o = (a = e.keys) != null ? a : void 0, n = (s = e.names) != null ? s : void 0;
|
|
50
|
+
if (!o || !n) {
|
|
51
|
+
const {
|
|
52
|
+
autoKeys: r,
|
|
53
|
+
autoNames: c
|
|
54
|
+
} = x(t, l);
|
|
55
|
+
o != null || (o = r.length > 0 ? r : void 0), n != null || (n = c.length > 0 ? c : void 0);
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
keys: o,
|
|
59
|
+
names: n
|
|
60
|
+
};
|
|
61
|
+
}, F = /* @__PURE__ */ v({
|
|
62
|
+
name: "BaseCSVExport",
|
|
63
|
+
props: {
|
|
64
|
+
gridProps: {
|
|
65
|
+
type: Object,
|
|
66
|
+
required: !0
|
|
67
|
+
},
|
|
68
|
+
csv: {
|
|
69
|
+
type: [Boolean, Object],
|
|
70
|
+
default: void 0
|
|
71
|
+
},
|
|
72
|
+
fileName: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: "grid-export.csv"
|
|
75
|
+
},
|
|
76
|
+
onCsvexport: {
|
|
77
|
+
type: Function,
|
|
78
|
+
default: void 0
|
|
79
|
+
},
|
|
80
|
+
columnsState: {
|
|
81
|
+
type: Array,
|
|
82
|
+
default: void 0
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
setup(e, {
|
|
86
|
+
expose: t
|
|
87
|
+
}) {
|
|
88
|
+
const l = () => {
|
|
89
|
+
const n = typeof e.csv == "object" && e.csv !== null ? e.csv : {}, a = n.data || e.gridProps.dataItems || [];
|
|
90
|
+
let s = S(a);
|
|
91
|
+
const r = e.onCsvexport;
|
|
92
|
+
r && (s = r(s)), s = C(s, e.gridProps, n);
|
|
93
|
+
const c = (e.columnsState || []).filter((u) => u.field && !u.hidden && u.show !== !1).map((u) => ({
|
|
94
|
+
field: u.field,
|
|
95
|
+
title: u.title || u.field
|
|
96
|
+
})), {
|
|
97
|
+
keys: i,
|
|
98
|
+
names: d
|
|
99
|
+
} = G(n, c, s), m = s.length > 0 && f(s[0]) ? {
|
|
100
|
+
data: s,
|
|
101
|
+
total: s.length
|
|
102
|
+
} : s, p = {
|
|
103
|
+
...n,
|
|
104
|
+
data: m,
|
|
105
|
+
keys: i,
|
|
106
|
+
names: d
|
|
107
|
+
};
|
|
108
|
+
return y(p);
|
|
109
|
+
};
|
|
110
|
+
return t({
|
|
111
|
+
save: () => {
|
|
112
|
+
const n = typeof e.csv == "object" && e.csv !== null ? e.csv : {}, a = l(), s = n.fileName || e.fileName || "grid-export.csv";
|
|
113
|
+
h(a, s);
|
|
114
|
+
},
|
|
115
|
+
getBlob: l
|
|
116
|
+
}), () => null;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
export {
|
|
120
|
+
F as BaseCSVExport
|
|
121
|
+
};
|
package/Grid.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { GridColumnState } from './interfaces/GridColumnState';
|
|
|
16
16
|
import { GridCellRenderModel } from './interfaces/GridCellRenderModel';
|
|
17
17
|
import { GridCellProps } from './interfaces/GridCellProps';
|
|
18
18
|
import { GridGroupableSettings } from './interfaces/GridGroupableSettings';
|
|
19
|
+
import { BaseCSVExportMethods } from './BaseCSVExport';
|
|
19
20
|
import { GridContextMenuOptions } from './contextMenu/GridContextMenu';
|
|
20
21
|
import { GridContextMenuItemNames } from './contextMenu/enums';
|
|
21
22
|
/**
|
|
@@ -29,13 +30,7 @@ declare const Grid: import('vue').DefineComponent<import('vue').ExtractPropTypes
|
|
|
29
30
|
type: ObjectConstructor;
|
|
30
31
|
};
|
|
31
32
|
id: import('vue').PropType<string>;
|
|
32
|
-
autoProcessData: import('vue').PropType<boolean |
|
|
33
|
-
filter?: boolean;
|
|
34
|
-
search?: boolean;
|
|
35
|
-
sort?: boolean;
|
|
36
|
-
group?: boolean;
|
|
37
|
-
page?: boolean;
|
|
38
|
-
}>;
|
|
33
|
+
autoProcessData: import('vue').PropType<boolean | import('./utils/dataProcessing').AutoProcessDataConfig>;
|
|
39
34
|
topCacheCount: {
|
|
40
35
|
type: import('vue').PropType<number>;
|
|
41
36
|
default: number;
|
|
@@ -218,6 +213,8 @@ declare const Grid: import('vue').DefineComponent<import('vue').ExtractPropTypes
|
|
|
218
213
|
onContextmenuitemclick: import('vue').PropType<(event: GridContextMenuItemClickEvent) => void>;
|
|
219
214
|
clipboard: import('vue').PropType<boolean | ClipboardSettings>;
|
|
220
215
|
onClipboard: import('vue').PropType<(event: GridClipboardEvent) => void>;
|
|
216
|
+
csv: import('vue').PropType<boolean | import('.').GridCSVExportOptions>;
|
|
217
|
+
onCsvexport: import('vue').PropType<(data: any[]) => any[]>;
|
|
221
218
|
}>, {
|
|
222
219
|
rowIndexRef: import('vue').Ref<any, any>;
|
|
223
220
|
observerRef: IntersectionObserver;
|
|
@@ -243,6 +240,13 @@ declare const Grid: import('vue').DefineComponent<import('vue').ExtractPropTypes
|
|
|
243
240
|
stickyFooterRef: import('vue').Ref<any, any>;
|
|
244
241
|
pinnedTopRef: import('vue').Ref<any, any>;
|
|
245
242
|
pinnedBottomRef: import('vue').Ref<any, any>;
|
|
243
|
+
csvExportRef: import('vue').Ref<{
|
|
244
|
+
save: () => void;
|
|
245
|
+
getBlob: () => Blob;
|
|
246
|
+
}, BaseCSVExportMethods | {
|
|
247
|
+
save: () => void;
|
|
248
|
+
getBlob: () => Blob;
|
|
249
|
+
}>;
|
|
246
250
|
sticky: import('vue').Ref<{
|
|
247
251
|
headerItems: any[];
|
|
248
252
|
footerItems: any[];
|
|
@@ -334,6 +338,8 @@ declare const Grid: import('vue').DefineComponent<import('vue').ExtractPropTypes
|
|
|
334
338
|
rowIndex: number;
|
|
335
339
|
}): void;
|
|
336
340
|
getTotal(): any;
|
|
341
|
+
exportAsCsv(): void;
|
|
342
|
+
getCsvBlob(): Blob | null;
|
|
337
343
|
readColumnElements(): ExtendedColumnProps[];
|
|
338
344
|
getResolvedFlatColumnsState(): GridColumnState[];
|
|
339
345
|
filterColumns(columns: ExtendedColumnProps[]): ExtendedColumnProps[][];
|
|
@@ -448,13 +454,7 @@ declare const Grid: import('vue').DefineComponent<import('vue').ExtractPropTypes
|
|
|
448
454
|
type: ObjectConstructor;
|
|
449
455
|
};
|
|
450
456
|
id: import('vue').PropType<string>;
|
|
451
|
-
autoProcessData: import('vue').PropType<boolean |
|
|
452
|
-
filter?: boolean;
|
|
453
|
-
search?: boolean;
|
|
454
|
-
sort?: boolean;
|
|
455
|
-
group?: boolean;
|
|
456
|
-
page?: boolean;
|
|
457
|
-
}>;
|
|
457
|
+
autoProcessData: import('vue').PropType<boolean | import('./utils/dataProcessing').AutoProcessDataConfig>;
|
|
458
458
|
topCacheCount: {
|
|
459
459
|
type: import('vue').PropType<number>;
|
|
460
460
|
default: number;
|
|
@@ -637,6 +637,8 @@ declare const Grid: import('vue').DefineComponent<import('vue').ExtractPropTypes
|
|
|
637
637
|
onContextmenuitemclick: import('vue').PropType<(event: GridContextMenuItemClickEvent) => void>;
|
|
638
638
|
clipboard: import('vue').PropType<boolean | ClipboardSettings>;
|
|
639
639
|
onClipboard: import('vue').PropType<(event: GridClipboardEvent) => void>;
|
|
640
|
+
csv: import('vue').PropType<boolean | import('.').GridCSVExportOptions>;
|
|
641
|
+
onCsvexport: import('vue').PropType<(data: any[]) => any[]>;
|
|
640
642
|
}>> & Readonly<{}>, {
|
|
641
643
|
size: string;
|
|
642
644
|
scrollable: string;
|
|
@@ -660,6 +662,7 @@ declare const Grid: import('vue').DefineComponent<import('vue').ExtractPropTypes
|
|
|
660
662
|
onRowPin: any;
|
|
661
663
|
getRowPinPosition: any;
|
|
662
664
|
onContextMenu: any;
|
|
665
|
+
exportAsCsv: any;
|
|
663
666
|
};
|
|
664
667
|
sticky: any;
|
|
665
668
|
}, true, {}, any>;
|
package/Grid.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),l=require("@progress/kendo-vue-common"),f=require("@progress/kendo-vue-data-tools"),Ye=require("@progress/kendo-vue-indicators"),Ee=require("./GridNav.js"),Pe=require("./cells/GridSelectionCell.js"),De=require("./cells/GridHierarchyCell.js"),Ze=require("./cells/GridDetailHierarchyCell.js"),et=require("./cells/GridDetailCell.js"),tt=require("./header/Header.js"),st=require("./header/HeaderRow.js"),it=require("./header/FilterRow.js"),ot=require("./header/GroupPanel.js"),nt=require("./footer/Footer.js"),rt=require("./footer/FooterRow.js"),at=require("./components/table/GridTable.js"),lt=require("./components/table/GridTableScrollable.js"),Ne=require("./filterCommon.js"),dt=require("./VirtualScroll.js"),ht=require("./drag/ColumnResize.js"),ct=require("./drag/CommonDragLogic.js"),pt=require("./drag/DragClue.js"),ut=require("./drag/DropClue.js"),w=require("./utils/main.js"),ze=require("./cells/GridGroupCell.js"),ft=require("./rows/GridRow.js"),gt=require("./common.js"),Ve=require("./header/GridHeaderSelectionCell.js"),Fe=require("./components/noRecords/GridNoRecords.js"),Le=require("./components/noRecords/GridNoRecordsContainer.js"),ne=require("./package-metadata.js"),Ke=require("./messages/messagesMap.js"),re=require("@progress/kendo-data-query"),mt=require("./key.js"),Rt=require("./utils/virtualColumns.js"),_e=require("./components/StickyGroupTable.js"),Ct=require("./getRowContents.js"),bt=require("./hooks/useStickyGroups.js"),Ae=require("./components/PinnedRowsTable.js"),St=require("./cells/pincell/GridPinCell.js"),q=require("./contextMenu/GridContextMenu.js"),D=require("./contextMenu/enums.js"),It=a.defineComponent({name:"KendoGrid",inheritAttrs:!1,props:{...gt.gridProps,toolbar:{type:Object},noRecords:{type:Object}},data(){return{isRtl:!1,context:void 0,navigation:void 0,showLicenseWatermark:!1,licenseMessage:void 0,notHiddenColumns:[],contextMenuState:{show:!1,offset:{left:0,top:0},dataItem:void 0,field:void 0}}},watch:{clipboard:function(e){e?this.clipboardServiceRef||(this.clipboardServiceRef=new f.ClipboardService(this.handleClipboardEvent),this.clipboardServiceRef.addEventListeners(document)):this.clipboardServiceRef&&(this.clipboardServiceRef.removeEventListeners(document),this.clipboardServiceRef=null)},rowHeight:function(e,t){var s;this.onRowHeightChanged(e,t),(s=this.vsRef)==null||s.reset()},scrollable:function(){var e;(e=this.vsRef)==null||e.reset()},filter:function(){var e;(e=this.vsRef)==null||e.reset()},group:function(){var e;(e=this.vsRef)==null||e.reset()},currentGroupable:function(){var e;(e=this.vsRef)==null||e.reset()},sort:function(){var e;(e=this.vsRef)==null||e.reset()}},created(){l.validatePackage(ne.packageMetadata),this.showLicenseWatermark=l.shouldShowValidationUI(ne.packageMetadata),this.licenseMessage=l.getLicenseMessage(ne.packageMetadata),this.initialHeight=null,this.columnsRef=[],this.dragLogic=new ct.CommonDragLogic(this.columnReorder.bind(this),this.groupReorder.bind(this),this.columnToGroup.bind(this)),this.columnResize=new ht.ColumnResize(this.onResize.bind(this)),this._columnsMap=[[]],this._header=null,this._footer=null,this.tableRef=null,this.scrollHeightContainerRef=null,this.forceUpdateTimeout=void 0,this._gridId=l.guid(),this._gridRoleElementId=l.guid(),this.slicedCurrentData=void 0,this._prevTotal=void 0,this._containerHeightRef=0,this._minRowHeightRef=0,this.wrapperScrollTopRef=0,this.scrollLeftRef=0,this.previousCopiedItems=[],this.clipboardServiceRef=null},mounted(){var t,s;this.setRefs();const e=l.isRtl(this._element);if(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=l.canUseDOM&&(window==null?void 0:window.ResizeObserver)&&new ResizeObserver(this.calculateMedia),document!=null&&document.body&&this.resizeObserver&&this.resizeObserver.observe(document.body),l.canUseDOM){const i={rootMargin:"0px",threshold:.9};this.observerRef=window.IntersectionObserver&&new window.IntersectionObserver(this.handleIntersection,i)||null}this.$props.clipboard&&(this.clipboardServiceRef=new f.ClipboardService(this.handleClipboardEvent),this.clipboardServiceRef.addEventListeners(document))},updated(){var s;this.setRefs();const e=l.isRtl(this._element);this.isRtl=e,this._prevTotal=this.$props.total,this.vsRef.tableTransform&&this.vsRef.table&&(this.vsRef.table.style.transform=this.vsRef.tableTransform,this.vsRef.tableTransform="");const t=this.updateStickyGroups();this.sticky.headerItems=t==null?void 0:t.stickyHeaderItems,this.sticky.footerItems=t==null?void 0:t.stickyFooterItems,this.isVirtualScroll&&(this.setContainerHeight(),this.setMinRowHeight(),(s=this.vsRef)==null||s.update())},unmounted(){this.gridUnmounted()},computed:{gridId(){return this.$props.id+"-role-element-id"},idPrefix(){return this.$props.navigatable?this.gridId:""},groupExpandable(){return f.getGroupExpandableOptions(typeof this.$props.groupable=="object"&&this.$props.groupable.enabled!==!1?this.$props.groupable.expandable:this.$props.groupable)},hierarchClass(){return l.uGrid.hierarchyCell({})},computedRowSpannable(){return w.getRowSpanOptions(this.$props.rowSpannable)},computedSelectable(){return f.getSelectionOptions(this.$props.selectable)},detailExpandable(){return f.getDetailExpandableOptions(!!this.$props.detail)},nonscrollableWrapperClass(){const{size:e}=this.$props,t=this.$attrs.class;return{"k-grid":!0,"k-grid-md":!e,[`k-grid-${l.kendoThemeMaps.sizeMap[e]||e}`]:e,[t]:!!t}},scrollableWrapperClass(){const{scrollable:e}=this.$props;return{...this.nonscrollableWrapperClass,"k-grid-virtual":e==="virtual"}},gridTableClass(){const{size:e}=this.$props;return{"k-table":!0,"k-grid-table":!0,"k-grid-md":!e,[`k-table-${l.kendoThemeMaps.sizeMap[e]||e}`]:e}},getCorrectHeight(){return this.$props.scrollable==="virtual"?this.initialHeight||"450px":null},currentGroupable(){var t;const e=(t=this.gridStateContext.group)==null?void 0:t.value;return this.$props.groupable===!0&&(e==null?void 0:e.length)||l.isObject(this.$props.groupable)&&this.$props.groupable.enabled!==!1},computedCollapsed(){let e=[];if(this.$props.group)for(let t=0;t<this.$props.group.length;t++)this.$props.collapsedGroups[t]?e.push(this.$props.collapsedGroups[t]):e.push([]);return e},getAriaRowCount(){var s,i;const e=this.$props.dataItems,t=this.$props.total||(e==null?void 0:e.total)||(e==null?void 0:e.length)||0;return this.$props.detail?this._columnsMap.length+(this.$props.filterable?1:0)+t*2+(this.columnsRef.some(o=>{var n;return!!(o.footerCell||(n=o.cells)!=null&&n.footerCell)})||(s=this.$props.cells)!=null&&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.columnsRef.some(o=>{var n;return!!(o.footerCell||(n=o.cells)!=null&&n.footerCell)})||(i=this.$props.cells)!=null&&i.footerCell?1:0)},getAriaColCount(){const e=this.$props.columns,t=this.$props.columnVirtualization,s=(e==null?void 0:e.filter(i=>i.hidden!==void 0).length)!==0;if(t||s)return(e==null?void 0:e.length)!==0?e==null?void 0:e.length:-1},isVirtualScroll(){return this.$props.scrollable==="virtual"||this.$props.scrollable===void 0||!1},pinnedSourceSet(){var t,s;const e=new Set;return(t=this.gridStateContext.pinnedTopRows)!=null&&t.value&&this.gridStateContext.pinnedTopRows.value.forEach(i=>e.add(i)),(s=this.gridStateContext.pinnedBottomRows)!=null&&s.value&&this.gridStateContext.pinnedBottomRows.value.forEach(i=>e.add(i)),e},sortedPinnedTopRows(){var s,i;const e=((s=this.gridStateContext.pinnedTopRows)==null?void 0:s.value)||[],t=(i=this.gridStateContext.sort)==null?void 0:i.value;return this.autoProcessData&&(t!=null&&t.length)?re.orderBy([...e],t):e},sortedPinnedBottomRows(){var s,i;const e=((s=this.gridStateContext.pinnedBottomRows)==null?void 0:s.value)||[],t=(i=this.gridStateContext.sort)==null?void 0:i.value;return this.autoProcessData&&(t!=null&&t.length)?re.orderBy([...e],t):e},hasPinnedTopRows(){return this.$props.pinnable&&this.sortedPinnedTopRows.length>0},hasPinnedBottomRows(){return this.$props.pinnable&&this.sortedPinnedBottomRows.length>0},contextMenuColumn(){return this.columnsRef.find(e=>e.field===this.contextMenuState.field)},headMenuItems(){var t;const e=this.$props.sortable&&((t=this.contextMenuColumn)==null?void 0:t.sortable);return q.getDefaultHeadContextMenuItems({sortable:!!e,selectable:this.computedSelectable.enabled})},bodyMenuItems(){var e;return this.$props.sortable&&((e=this.contextMenuColumn)==null||e.sortable),q.getDefaultBodyContextMenuItems({selectable:this.computedSelectable.enabled,pinnable:!!this.$props.pinnable,clipboard:!!this.$props.clipboard})},contextMenuItems(){var s;const e=((s=this.contextMenuColumn)==null?void 0:s.contextMenu)||this.$props.contextMenu,t=typeof e=="function"?e(this.contextMenuState):e;if(t&&this.contextMenuState.offset){const i=this.contextMenuState.dataItem?D.GridContextMenuAnchorPart.body:D.GridContextMenuAnchorPart.head,o=t[i],n=this.contextMenuState.dataItem?this.bodyMenuItems:this.headMenuItems;let r;return o===!0||o===void 0?r=n:o!==!1&&(r=o),this.$props.pinnable&&r&&this.contextMenuState.dataItem?this.filterPinContextMenuItems(r):r}}},methods:{getCellPositionStyle(e,t){return e.left!==void 0?t?{left:e.right+"px",right:e.left+"px"}:{left:e.left+"px",right:e.right+"px"}:{}},handleContextMenuOpen(e,t,s){e.preventDefault(),this.contextMenuState={show:!0,offset:{left:e.pageX,top:e.pageY},dataItem:t,field:s}},handleContextMenuClose(){this.contextMenuState={show:!1,offset:{left:0,top:0},dataItem:void 0,field:void 0}},inActiveElement(){var o;if(!l.canUseDOM)return!1;const e=document==null?void 0:document.activeElement;let t=document==null?void 0:document.body;e!=null&&e.matches(".k-table-td")&&(t=e);const s=t==null?void 0:t.closest(".k-grid-container"),i=t&&((o=this._element)==null?void 0:o.contains(t));return!!(t&&i&&s)},handleClipboardEvent(e,t,s,i,o){var c,g,u;if(!this.inActiveElement()&&!s||!e)return;const n={type:e,nativeEvent:t,columns:this.columnsRef,dataItemKey:this.$props.dataItemKey||"",dataItem:i,field:o,...typeof this.$props.clipboard!="boolean"?this.$props.clipboard:{},...s},r=this.getLeafDataItems(),d=f.populateClipboardData({event:n,data:r,selectedState:(u=(g=this.$props.select)!=null?g:(c=this.gridStateContext.select)==null?void 0:c.value)!=null?u:{},previousCopiedItems:this.previousCopiedItems});e!==f.ClipboardActionType.paste&&(this.previousCopiedItems=d.copiedItems),l.hasListener.call(this,"clipboard")&&this.$emit("clipboard",{...n,...d})},handleContextMenuSelect(e){this.handleContextMenuItemClick({event:e,dataItem:this.contextMenuState.dataItem,field:this.contextMenuState.field})},renderContextMenu(){var e;return a.createVNode(q.GridContextMenu,{show:!!(this.contextMenuState.show&&((e=this.contextMenuItems)!=null&&e.length)),dataItem:this.contextMenuState.dataItem,field:this.contextMenuState.field,items:this.contextMenuItems,offset:this.contextMenuState.offset,onClose:this.handleContextMenuClose,onSelect:this.handleContextMenuSelect},null)},filterPinContextMenuItems(e){var c,g;const t=this.$props.dataItemKey||"",s=this.contextMenuState.dataItem,i=((c=this.gridStateContext.pinnedTopRows)==null?void 0:c.value)||[],o=((g=this.gridStateContext.pinnedBottomRows)==null?void 0:g.value)||[],n=t?s[t]:void 0,r=n!==void 0&&i.some(u=>u[t]===n),d=n!==void 0&&o.some(u=>u[t]===n);return e.map(u=>{const p=typeof u=="string"?q.contextMenuItemsMap[u]:u;return(p==null?void 0:p.name)===D.GridContextMenuItemNames.pinRow&&p.items?{...p,items:p.items.filter(m=>m.name===D.GridContextMenuItemNames.pinTop?!r:m.name===D.GridContextMenuItemNames.pinBottom?!d:m.name===D.GridContextMenuItemNames.unpin?r||d:!0)}:u})},handleContextMenuItemClick(e){var i,o,n,r,d,c,g,u;const t=e.event.event.item,s={event:e.event,menuItem:t,dataItem:e.dataItem,field:e.field};switch(this.$emit("contextmenuitemclick",s),(i=t.data)==null?void 0:i.action){case"SortCommand":if(this.contextMenuColumn){const p=(o=t.name)==null?void 0:o.toLowerCase().includes("asc"),R=((n=t.name)==null?void 0:n.toLowerCase().includes("desc"))?"desc":void 0,x=p?"asc":R,b=t.name?x:void 0,v=(((r=this.gridStateContext.sort)==null?void 0:r.value)||[]).filter(y=>{var I;return y.field!==((I=this.contextMenuColumn)==null?void 0:I.field)});b&&((d=this.contextMenuColumn)!=null&&d.field)&&v.push({field:this.contextMenuColumn.field,dir:b}),this.sortChangeHandler(v,{event:e.event})}break;case"SelectRowCommand":{const p=e.dataItem;if(this.computedSelectable.enabled&&p&&this.$props.dataItemKey){const R=l.getter(this.$props.dataItemKey)(p),x=this.getLeafDataItems(),b=x.findIndex(M=>M[this.$props.dataItemKey]===p[this.$props.dataItemKey]),$=0,v=this.columnsRef.length-1,y={...this.getArguments(e.event),dataItem:p,startDataItem:b,endDataItem:b,startRowIndex:b,endRowIndex:b,startColIndex:$,endColIndex:v,dataItems:x,ctrlKey:!1,altKey:!1,metaKey:!1,shiftKey:!1,isDrag:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""},I=this.computedSelectable.mode==="multiple"?{...(g=(c=this.gridStateContext.select)==null?void 0:c.value)!=null?g:{}}:{};I[R]===!0||Array.isArray(I[R])&&I[R].length===this.columnsRef.length?delete I[R]:I[R]=this.computedSelectable.cell?[...Array(this.columnsRef.length).keys()]:!0,this.raiseSelectionEvent(y,I)}break}case"SelectAllRowsCommand":{if(this.computedSelectable.enabled&&this.$props.dataItemKey){const p=this.getLeafDataItems(),m={},R=p[0],x=p[p.length-1];p.forEach(b=>{const $=l.getter(this.$props.dataItemKey)(b);m[$]=this.computedSelectable.cell?[...Array(this.columnsRef.length).keys()]:!0}),this.raiseSelectionEvent({...this.getArguments(e.event),dataItems:p,dataItem:R,startDataItem:R,endDataItem:x,startRowIndex:0,endRowIndex:p.length-1,startColIndex:0,endColIndex:this.columnsRef.length-1,ctrlKey:!1,altKey:!1,metaKey:!1,shiftKey:!1,isDrag:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""},m)}break}case"ClearSelectionCommand":this.computedSelectable.enabled&&this.clearSelection({...this.getArguments(e.event),dataItems:this.getLeafDataItems(),startRowIndex:-1,endRowIndex:-1,startColIndex:-1,endColIndex:-1,ctrlKey:!1,altKey:!1,metaKey:!1,shiftKey:!1,isDrag:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""});break;case"PinTopCommand":this.handleRowPin("pinTop",e.dataItem);break;case"PinBottomCommand":this.handleRowPin("pinBottom",e.dataItem);break;case"UnpinCommand":this.handleRowPin("unpin",e.dataItem);break;case"CopySelectionCommand":this.handleClipboardEvent(f.ClipboardActionType.copy,e.event.nativeEvent,{copyHeaders:!((u=t.name)!=null&&u.toLowerCase().includes("noheaders"))},e.dataItem,e.field);break;case"PasteCommand":this.handleClipboardEvent(f.ClipboardActionType.paste,e.event.nativeEvent,{},e.dataItem,e.field);break}this.handleContextMenuClose()},triggerCellContextMenu(e,t,s){this.$emit("contextmenu",{dataItem:t,field:s,event:e}),this.$props.contextMenu&&this.handleContextMenuOpen(e,t,s)},handleIntersection(e){const t={rowIndex:this.rowIndexRef.value};e.forEach(s=>{s.boundingClientRect.height!==s.intersectionRect.height&&this.setCurrentOnTop(t)})},scrollIntoView(e){var i;if(!((i=this.vsRef)!=null&&i.container)||this.$props.scrollable==="none")return;const{rowIndex:t}=e;this.rowIndexRef.value=t;const s=this._element;if(this.observerRef&&s){this.observerRef.disconnect();const o=s.querySelector(`[absolute-row-index="${this.rowIndexRef.value}"]`);o?this.observerRef.observe(o):this.setCurrentOnTop(e)}},setCurrentOnTop(e){var i,o;if(!((i=this.vsRef)!=null&&i.container)||this.$props.scrollable==="none")return;this.observerRef&&this.observerRef.disconnect();const{rowIndex:t}=e,s=this._element;if(this.isVirtualScroll){const n=((o=this.vsRef.rowHeightService)==null?void 0:o.offset(t))||0;this.vsRef.container.scroll(0,n)}else if(s){const n=t<1?s.querySelector("tbody > tr:nth-child(1)"):s.querySelector(`tbody > tr:nth-child(${t+1})`);n&&this.containerElementRef&&(this.containerElementRef.scrollTop=n.offsetTop)}},getTotal(){let e=this.$props.total||0;return Array.isArray(this.$props.dataItems)?e=e||this.$props.dataItems.length:this.$props.dataItems&&(e=e||this.$props.dataItems.total),e},readColumnElements(){return w.readColumns(this.$props.columns,this.currentColumnsState,{prevId:0,idPrefix:this.idPrefix})},getResolvedFlatColumnsState(){const e=[],t=(s,i)=>s==null?void 0:s.forEach(o=>{const n=o.hidden||i;e.push({...o,hidden:n}),t(o.children,n)});return t(this.currentColumnsState,!1),e},filterColumns(e){const t=this.getResolvedFlatColumnsState();return[e.filter(s=>{var i;return!s.hidden&&!((i=t.find(o=>o.id===s.id))!=null&&i.hidden)}),e.filter(s=>{var i;return s.hidden||((i=t.find(o=>o.id===s.id))==null?void 0:i.hidden)})]},getFlatData(e,t,s,i,o,n,r){const d=[],c=w.flatData(d,e,t,{index:s},i!==void 0,o,n,this.groupExpandable.defaultExpand,r,this.$props.expandField);return{flattedData:d,resolvedGroupsCount:c}},getColumnsEssentialProps(e){return e&&JSON.stringify(e.map(t=>({id:t.id,field:t.field,title:t.title,children:t.children})))},calculateMedia(){const e=this.filterHiddenColumns(this.$props.columns||[]);this.getColumnsEssentialProps(this.notHiddenColumns)!==this.getColumnsEssentialProps(e)&&this.$forceUpdate()},filterHiddenColumns(e){if(!e||e.length===0)return e;const t=s=>({...s,children:s.children&&s.children.length>0?this.filterHiddenColumns(s.children):s.children});return[...e].filter(s=>!s.hidden).filter(s=>l.canUseDOM&&s&&s.media?window.matchMedia(s.media).matches:s).map(s=>t(s))},getColumns(){const e=this.columnsRef.filter(s=>s.declarationIndex>=0&&s.parentIndex===-1),t=s=>(s.sort((i,o)=>i.declarationIndex-o.declarationIndex),s.map(i=>{const{declarationIndex:o,parentIndex:n,depth:r,colSpan:d,rowSpan:c,index:g,kFirst:u,children:p,...m}=i;return p.length?{children:t(p),...m}:m}));return t(e)},setRefs(){var n,r,d,c;let e="$el";const t=l.getRef(this,"gridNav");t&&(this._element=t[e]);const s=l.getRef(this,"groupPanelDiv");if(s){let g=s[e]||null;this.dragLogic.refGroupPanelDiv(g)}this.stickyHeaderRef=l.getRef(this,"stickyHeader"),this.stickyFooterRef=l.getRef(this,"stickyFooter"),this.pinnedTopRef=l.getRef(this,"pinnedTop"),this.pinnedBottomRef=l.getRef(this,"pinnedBottom");const i=l.getRef(this,"dropElementClue"),o=l.getRef(this,"dragElementClue");this.dragLogic.refDropElementClue(i),this.dragLogic.refDragElementClue(o),this.columnResize.colGroupMain=l.getRef(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=(d=this.pinnedTopRef)==null?void 0:d.colGroupRef,this.columnResize.colGroupPinnedBottom=(c=this.pinnedBottomRef)==null?void 0:c.colGroupRef,this._header=l.getRef(this,"header"),this._footer=l.getRef(this,"footer"),this.resetTableWidth(),l.setScrollbarWidth()},gridUnmounted(){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)},isAllData(){const{dataItems:e,total:t}=this.$props;return Array.isArray(e)?e.length===t:e?t===e.total:!1},resetVirtualSkip(){this.isVirtualScroll&&this.virtualSkipRef&&(this.virtualSkipRef=0)},virtualPageChange(e,t){var i;const s=(i=this.gridStateContext.group)==null?void 0:i.value;this.$props.pageable||s!=null&&s.length?(this.virtualSkipRef=e.skip,this.$forceUpdate()):this.pageChangeHandler(e,t)},initializeVirtualization(){const e=this.vsRef,t=this.$props.rowHeight||this._minRowHeightRef||0;this.tableBodyRef=l.getRef(this,"tableBody"),this.scrollTableRef=l.getComponentElementRef(this,"table"),e&&(e.fixedScroll=this.$props.fixedScroll||!1,e.PageChange=this.virtualPageChange,e.pageSize=this._virtualPageSize,e.scrollableVirtual=this.isVirtualScroll,this.scrollContainerRef=e.container=l.getRef(this,"scrollContainer"),e.tableBody=this.tableBodyRef,e.scrollHeightContainer=l.getRef(this,"scrollHeightContainer"),e.table=this.scrollTableRef,(!e.rowHeightService||e.total!==this._virtualTotal)&&t&&(e.total=this._virtualTotal,e.rowHeightService=new l.RowHeightService(this._virtualTotal,t)))},setContainerHeight(){const e=l.getRef(this,"scrollContainer");this._containerHeightRef=(e==null?void 0:e.offsetHeight)||0},setMinRowHeight(){if(!this._minRowHeightRef&&!this.$props.rowHeight){const t=w.calcRowHeight(l.getRef(this,"tableBody"));t&&(this._minRowHeightRef=t,this.$forceUpdate())}},onRowHeightChanged(e,t){this.setRefs()},onHeaderScroll(e){const s=e.target.scrollLeft,i=l.getRef(this,"scrollContainer");i&&(i.scrollLeft=s),this.scrollLeftRef=s},scrollHandler(e){clearTimeout(this.forceUpdateTimeout);const t=e.currentTarget.scrollLeft,s=e.currentTarget.scrollTop;this.$props.columnVirtualization&&(!this.isVirtualScroll||s===this.wrapperScrollTopRef)&&(this.forceUpdateTimeout=setTimeout(()=>{this.$forceUpdate()},0)),this.scrollLeftRef=t,this._header&&this._header.setScrollLeft(e.currentTarget.scrollLeft),this._footer&&this._footer.setScrollLeft(e.currentTarget.scrollLeft),this.stickyHeaderRef&&this.stickyHeaderRef.setScrollLeft(e.currentTarget.scrollLeft),this.stickyFooterRef&&this.stickyFooterRef.setScrollLeft(e.currentTarget.scrollLeft),this.pinnedTopRef&&this.pinnedTopRef.setScrollLeft(t),this.pinnedBottomRef&&this.pinnedBottomRef.setScrollLeft(t),this.vsRef&&s!==this.wrapperScrollTopRef&&this.vsRef.scrollHandler(e);const i=this.virtualSkipRef;this.vsRef&&s!==this.wrapperScrollTopRef&&this.vsRef.scrollHandler(e);const o=this.isVirtualScroll&&this.virtualSkipRef!==i;if(this.$emit("scroll",e),this.wrapperScrollTopRef=s,!o){const n=this.updateStickyGroups();this.sticky.headerItems=n==null?void 0:n.stickyHeaderItems,this.sticky.footerItems=n==null?void 0:n.stickyFooterItems}},rowClick(e,t){e.target.type!=="checkbox"&&this.$emit("rowclick",{dataItem:t.dataItem,...this.getArguments(e)})},rowDoubleClick(e,t){e.target.type!=="checkbox"&&this.$emit("rowdblclick",{dataItem:t.dataItem,...this.getArguments(e)})},loopGroupedItems(e,t,s=0,i=null){return e.forEach(o=>{!i&&t(o,s)&&(i=o),o.items&&o.items.length&&!i&&(i=this.loopGroupedItems(o.items,t,s+1,i))}),i},updateGroupCollapsed(e){let t=this.computedCollapsed,s=t[e.level];const i=this.$props.uniqueField,o=function(d,c){return d.value===e.dataItem.value&&c===e.level},n=this.allGroupedItems?this.loopGroupedItems(this.allGroupedItems.data,o,0,null):e.dataItem,r=w.groupedFirstItemValue(n||e.dataItem,i);if(e.value){if(s&&s.length){const d=s.indexOf(r);d>-1&&s.splice(d,1)}}else s?s.includes(r)||s.push(r):s=[r];return t},itemChange(e){var i;const t=l.hasListener.call(this,"itemchange"),s=(i=this.gridStateContext.group)==null?void 0:i.value;if(e.field===this.$props.expandField||(s||this.$props.detail)&&e.field===void 0){l.hasListener.call(this,"expandchange")&&e.dataItem&&this.$emit("expandchange",{...this.getArguments(e.event),collapsedGroups:this.updateGroupCollapsed(e),dataItem:e.dataItem,value:e.value});return}t&&this.$emit("itemchange",{...this.getArguments(e.event),dataItem:e.dataItem,field:e.field,value:e.value})},cellClickHandler(e){this.$emit("cellclick",{dataItem:e.dataItem,field:e.field})},cellKeydownHandler(e){this.$emit("cellkeydown",e)},navigationActionHandler(e){this.$emit("navigationaction",e)},editHandler(e){this.$emit("edit",{dataItem:e})},removeHandler(e){this.$emit("remove",{dataItem:e})},saveHandler(e){this.$emit("save",{dataItem:e})},cancelHandler(e){this.$emit("cancel",{dataItem:e})},selectionChangeHandler(e){var t,s,i;if(this.computedSelectable.enabled){const{event:o,dataItem:n,dataIndex:r,columnIndex:d}=e,c={...this.getArguments(o),dataItem:n,startColIndex:d,endColIndex:d,startRowIndex:r,endRowIndex:r,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,isDrag:!1,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""};this.gridStateContext.selectionchange({...c,select:this.$props.dataItemKey?f.getSelectedState({event:c,selectedState:(i=(s=this.$props.select)!=null?s:(t=this.gridStateContext.select)==null?void 0:t.value)!=null?i:{},dataItemKey:this.$props.dataItemKey}):{}})}},onKeyboardSelectionChangeHandler(e){var g,u;if(!this.computedSelectable.enabled||!this.$props.dataItemKey)return;const t=(g=this.gridStateContext.select)==null?void 0:g.value,s={dataItems:this.getLeafDataItems(),mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id,selectedField:"",...this.getArguments(e)},i=f.getSelectedStateFromKeyDown({event:s,selectedState:t!=null?t:{},dataItemKey:this.$props.dataItemKey});if(i===t)return;const o=e.target,n=f.closestTagName(o,"TD"),r=f.closestTagName(o,"TR"),d=f.getColumnIndex(n),c=f.getRowIndex(r);if(d!==void 0&&c!==void 0){const p=(u=w.getDataAsArray(this.$props.dataItems))==null?void 0:u[c];this.gridStateContext.selectionchange({...s,select:i,dataItem:p,startRowIndex:c,startColIndex:d,startDataItem:p,endDataItem:p,endRowIndex:c,endColIndex:d,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey,isDrag:!1})}},onHeaderSelectionChangeHandler(e){if(this.computedSelectable.enabled){const t=this.getLeafDataItems();this.gridStateContext.headerselectionchange({select:e.event.target.checked?t.reduce((s,i)=>(this.$props.dataItemKey&&l.getter(this.$props.dataItemKey)(i)!==void 0&&(s[l.getter(this.$props.dataItemKey)(i)]=!0),s),{}):{},field:e.field,event:e.event,target:this,dataItems:t})}},selectionRelease(e){var t,s,i;if(this.computedSelectable.enabled){const o=this.getLeafDataItems(),n=o[e.startRowIndex],r=o[e.endRowIndex],d={event:void 0,target:this,selectedField:"",componentId:this.$props.id||this._gridId,dataItems:o,dataItem:null,startDataItem:n,endDataItem:r,...e},c=f.getSelectedState({event:d,selectedState:(i=(s=this.$props.select)!=null?s:(t=this.gridStateContext.select)==null?void 0:t.value)!=null?i:{},dataItemKey:this.$props.dataItemKey});this.raiseSelectionEvent(d,c)}},clearSelection(e){this.computedSelectable.enabled&&this.raiseSelectionEvent(e,{})},raiseSelectionEvent(e,t){this.computedSelectable.enabled&&this.gridStateContext.selectionchange({...e,select:t})},moveToNextPage(e){var o,n,r,d;const t=(r=(n=(o=this.gridStateContext.take)==null?void 0:o.value)!=null?n:this.$props.pageSize)!=null?r:0,s=(((d=this.gridStateContext.skip)==null?void 0:d.value)||0)+t,i=this.getTotal();s<i&&this.pageChangeHandler({skip:s,take:t},e)},moveToPrevPage(e){var i,o,n,r;const t=(n=(o=(i=this.gridStateContext.take)==null?void 0:i.value)!=null?o:this.$props.pageSize)!=null?n:0,s=(((r=this.gridStateContext.skip)==null?void 0:r.value)||0)-t;s>=0&&this.pageChangeHandler({skip:s,take:t},e)},pageChangeHandler(e,t){this.raiseDataEvent("pagechange",{page:e,event:t},{skip:e.skip,take:e.take},t)},sortChangeHandler(e,t){this.raiseDataEvent("sortchange",{sort:e},{sort:e},t)},filterChangeHandler(e,t){this.raiseDataEvent("filterchange",{filter:e},{filter:e,skip:0},t)},groupChangeHandler(e,t){this.raiseDataEvent("groupchange",{group:e},{group:e,skip:0},t)},handleDetailExpandAction(e,t){var s;if(this.detailExpandable.enabled){const i=(s=this.gridStateContext.detailExpand)==null?void 0:s.value,o=f.detailExpandReducer(i!=null?i:{},e);this.gridStateContext.detailexpandchange({...this.getArguments(t),detailExpand:o})}},handleGroupExpandAction(e,t){var s;if(this.groupExpandable.enabled){const i=(s=this.gridStateContext.groupExpand)==null?void 0:s.value,o=f.groupExpandReducer(i!=null?i:[],e,this.groupExpandable);this.$props.expandField||this.gridStateContext.groupexpandchange({...this.getArguments(t),groupExpand:o})}this.scrollToStickyGroup(e.group)},raiseDataEvent(e,t,s,i){if(this.resetVirtualSkip(),this.$props.autoProcessData)this.gridStateContext[e]({...this.getArguments(i),...t});else if(l.hasListener.call(this,e))this.$emit(e,{...this.getArguments(i),...t});else if(l.hasListener.call(this,"datastatechange")){const o={...this.getDataState(),...s};this.gridStateContext.datastatechange({...this.getArguments(i),data:o,dataState:o})}},columnReorder(e,t,s){const i=this.columnsRef[e],o=w.getFlatColumnsState(this.currentColumnsState),n=i.depth,r=u=>{do u++;while(u<this.columnsRef.length&&this.columnsRef[u].depth>n);return u},d=this.columnsRef.splice(e,r(e)-e);this.columnsRef.splice(e<t?r(t-d.length):t,0,...d),this.columnsRef.filter(u=>u.declarationIndex>=0).forEach((u,p)=>{u.orderIndex=p;const m=o.find(R=>R.id===u.id);m&&(m.orderIndex=p)});const c=this.columnsRef[e].locked&&this.columnsRef[t].locked;f.updateLeft(this._columnsMap,this.columnsRef,c||this.shouldUpdateLeftRightRef),f.updateRight(this._columnsMap,this.columnsRef,c||this.shouldUpdateLeftRightRef),this.resizedRef&&(this.shouldUpdateLeftRightRef=!1,this.resizedRef=!1);const g=this.getColumns();this.$emit("columnreorder",{target:this,columns:g,event:s,prev:e,next:t}),this.gridStateContext.columnsstatechange({columnsState:this.currentColumnsState})},groupReorder(e,t,s){var o;const i=(o=this.gridStateContext.group)==null?void 0:o.value;i!==void 0&&(i.splice(t,0,...i.splice(e,1)),this.groupChangeHandler(i,s))},columnToGroup(e,t,s){var n;const i=this.columnsRef[e].field;if(!i)return;const o=(((n=this.gridStateContext.group)==null?void 0:n.value)||[]).slice();o.splice(t,0,{field:i}),this.groupChangeHandler(o,s)},resetTableWidth(){var i;let e=0;if(!this.columnResize.colGroupMain)return;const t=(i=this.columnResize.colGroupMain)==null?void 0:i.children;for(let o=0;o<t.length;o++){const n=t[o].width;if(!n)return;e+=parseFloat(n.toString())}e=Math.round(e),this._header&&this._header.setWidth(e),this._footer&&this._footer.setWidth(e),this.stickyHeaderRef&&this.stickyHeaderRef.setWidth(e),this.stickyFooterRef&&this.stickyFooterRef.setWidth(e),this.pinnedTopRef&&this.pinnedTopRef.setWidth(e),this.pinnedBottomRef&&this.pinnedBottomRef.setWidth(e);const s=l.getComponentElementRef(this,"table");s&&e&&(s.style.width=e+"px"),this.stickyFooterRef&&this.setStickyFooterOffset()},setStickyFooterOffset(){const e=this.containerElementRef,t=e?e.scrollWidth>e.clientWidth:!1;this.stickyFooterRef&&(this.stickyFooterRef.$el.style.marginBlockEnd=t?"var(--kendo-scrollbar-width, 0px)":"")},onResize(e,t,s,i,o,n,r){this.resetTableWidth(),this.shouldUpdateLeftRightRef=!0,this.resizedRef=!0,this.$emit("columnresize",{columns:this.getColumns(),index:e,targetColumnId:r,event:i,newWidth:t,oldWidth:s,end:o,target:this}),o&&this.gridStateContext.columnsstatechange({columnsState:n})},initColumnsState(e,t){const s=i=>{var n;const o=t.find(r=>r.id===i.id);if(o){const r={...o};return r.children=(n=i.children)==null?void 0:n.map(s),r}return i};this.currentColumnsState=e.filter(i=>i.parentIndex===-1).map(s)},configureColumns(e,t){e.filter(n=>n.columnType==="checkbox").forEach(n=>{n.width=n.width||"50px",n.defaultCell=a.markRaw(Pe.GridSelectionCell),n.defaultHeaderCell=a.markRaw(Ve.GridHeaderSelectionCell),n._type="edit",n.columnMenu=!1}),this.$props.selectedField&&this.columnsRef.filter(n=>n.field===this.$props.selectedField).forEach(n=>{n.width=n.width||"50px",n.defaultCell=a.markRaw(Pe.GridSelectionCell),n.defaultHeaderCell=a.markRaw(Ve.GridHeaderSelectionCell),n.columnMenu=!1}),this.$props.pinnable&&e.filter(n=>n.columnType==="pin").forEach(n=>{n.width=n.width||"48px",n.defaultCell=a.markRaw(St.GridPinCell),n.defaultHeaderCell=a.markRaw(f.HeaderCell),n.sortable=!1,n.filterable=!1,n.editable=!1});const s=w.getFlatColumnsState(this.currentColumnsState);this.initColumnsState(e,s);const i={id:"",resizable:!0,width:"32px",title:" ",declarationIndex:-1,orderIndex:-1,children:[],parentIndex:-1,depth:0,colSpan:0,headerColSpan:0,rowSpan:0,left:0,right:0,index:0,rightBorder:!1,ariaColumnIndex:0,isAccessible:!0};let o=0;if(this.detailExpandable.enabled&&this.$props.detail&&!this.$props.expandField){const n={...i,_type:"expand",id:f.tableKeyboardNavigationTools.generateNavigatableId(`${o++}`,"expand","column"),defaultCell:a.markRaw(De.GridHierarchyCell),field:this.detailExpandable.column,headerClassName:this.hierarchClass};e.unshift(n),this.currentColumnsState.unshift(s.find(r=>r.id===n.id)||n)}this.$props.expandField&&l.hasListener.call(this,"expandchange")&&this.$props.detail&&(e.unshift({...i,defaultCell:a.markRaw(De.GridHierarchyCell),field:this.$props.expandField,headerClassName:"k-hierarchy-cell k-header",id:f.tableKeyboardNavigationTools.generateNavigatableId(`${e.length}`,this.idPrefix,"column"),...this.expandColumn}),o++);for(let n=0;n<t;n++){const r={...i,isAccessible:!1,defaultCell:a.markRaw(ze.GridGroupCell),id:f.tableKeyboardNavigationTools.generateNavigatableId(`${o++}`,"group","column"),field:"value",locked:this.$props.lockGroups,columnMenu:!1};e.unshift(r),this.currentColumnsState.unshift(s.find(d=>d.id===r.id)||r)}e.slice(o).forEach(n=>{n.parentIndex>=0&&(n.parentIndex+=o),n.rowSpannable=n.rowSpannable!==void 0?w.getRowSpanOptions(n.rowSpannable):this.computedRowSpannable})},initColumns(e,t){var n;this.columnsRef=this.readColumnElements();const s=(n=this.gridStateContext.group)==null?void 0:n.value;this.columnsRef.filter(r=>!r.hidden).length===0&&(this.columnsRef=w.autoGenerateColumns(e,s,{column:this.$props.expandField?this.$props.expandField:this.groupExpandable.column},{prevId:0,idPrefix:this.idPrefix})),this.configureColumns(this.columnsRef,t);const[i,o]=this.filterColumns(this.columnsRef);this.columnsRef=i,this.hiddenColumnsRef=o,this._columnsMap=w.mapColumns(this.columnsRef,!0)},resolveTitle(e){const t=this.findColumnByField(e),s=t&&(t.title||t.field);return s===void 0?e:s},findColumnByField(e){let t;return this.$props.columns.forEach(s=>{const i=this.searchColumn(s,e);i&&(t=i)}),t},searchColumn(e,t){if(e.field===t)return e;if(e.children){let s,i=null;for(s=0;i==null&&s<e.children.length;s++)i=this.searchColumn(e.children[s],t);return i}return null},getDataState(){var n,r,d,c,g;const e=(n=this.gridStateContext.sort)==null?void 0:n.value,t=(r=this.gridStateContext.filter)==null?void 0:r.value,s=(d=this.gridStateContext.skip)==null?void 0:d.value,i=(c=this.gridStateContext.take)==null?void 0:c.value,o=(g=this.gridStateContext.group)==null?void 0:g.value;return{filter:t,sort:e,skip:s,take:i!==void 0?i:this.$props.pageSize,group:o}},getArguments(e){return{event:e,target:this}},getLeafDataItems(){return this.dataRef.filter(e=>e.rowType==="data").map(e=>e.dataItem)},totalGroupedRows(e){let t=0;return e&&(t=this.addSubItems(e,t)),t},addSubItems(e,t){return e.forEach(s=>{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++}),t},searchChange(e){const t=this.$props.searchFields||this.columnsRef.map(o=>o.field)||[],s=e.event.target.value,i={logic:"or",filters:t.filter(o=>o!==void 0).map(o=>{var n;return typeof o=="string"?{field:o,value:s,operator:"contains"}:{value:s,operator:(n=o.operator)!=null?n:"contains",field:o.field,ignoreCase:o.ignoreCase}})};this.raiseDataEvent("searchchange",{search:i},{skip:0},e)},getCellsToRender(e,t){var n;const s=[];let i=null,o=0;if(t.forEach((r,d)=>{const c=parseFloat((r.width||"").toString())||10;if(o){o--,i&&(i.width+=c);return}const g=Math.min(w.getColSpan(r,e),t.length-d);o=g-1,i={width:c,colSpan:g,columnIndex:d},s.push(i)}),this.$props.columnVirtualization){const r=this.scrollLeftRef||0,d=this.tableWidth||parseFloat((((n=this.$attrs.style)==null?void 0:n.width)||"").toString());return Rt.getVirtualCellsToRender({cellModels:s,columns:t,tableViewPortWidth:d,scrollLeft:r})}return s},calcVirtualPageSize(){const{pageable:e,take:t,pageSize:s}=this.$props;if(!this.isVirtualScroll)return 0;if(!e){if(t)return t;if(s)return s}const i=this.$props.rowHeight||this._minRowHeightRef,o=this._containerHeightRef;return o&&i?Math.ceil(o/i*1.5):0},getRowPinPosition(e){var n,r;const{dataItemKey:t=""}=this.$props,s=((n=this.gridStateContext.pinnedTopRows)==null?void 0:n.value)||[],i=((r=this.gridStateContext.pinnedBottomRows)==null?void 0:r.value)||[];if(!t||!e)return"none";const o=e[t];return s!=null&&s.some(d=>d[t]===o)?"top":i!=null&&i.some(d=>d[t]===o)?"bottom":"none"},handleRowPin(e,t){var g,u,p,m;if(!this.$props.pinnable)return;const{dataItemKey:s=""}=this.$props,i=((g=this.gridStateContext.pinnedTopRows)==null?void 0:g.value)||[],o=((u=this.gridStateContext.pinnedBottomRows)==null?void 0:u.value)||[],n=t[s],r=i.filter(R=>R[s]!==n),d=o.filter(R=>R[s]!==n);let c;switch(e){case"pinTop":c={pinnedTopRows:[...r,t],pinnedBottomRows:d,dataItem:t};break;case"pinBottom":c={pinnedTopRows:r,pinnedBottomRows:[...d,t],dataItem:t};break;case"unpin":c={pinnedTopRows:r,pinnedBottomRows:d,dataItem:t};break;default:return}(m=(p=this.gridStateContext).rowpinchange)==null||m.call(p,c)},pinnedSelectionRelease(e,t){const s=this.$props.dataItemKey;if(!s||!t)return;const i=l.getter(s),o=this.getLeafDataItems().findIndex(n=>i(n)===i(t));o!==-1&&this.selectionRelease({...e,startRowIndex:o,endRowIndex:o})}},provide(){return{gridContext:{dataItemKey:this.$props.dataItemKey,searchChange:this.searchChange,selectionRelease:this.selectionRelease,pinnedSelectionRelease:this.pinnedSelectionRelease,dispatchGroupExpand:this.handleGroupExpandAction,dispatchDetailExpand:this.handleDetailExpandAction,scrollToStickyGroup:this.scrollToStickyGroup,getCellPositionStyle:this.getCellPositionStyle,onRowPin:this.handleRowPin,getRowPinPosition:this.getRowPinPosition,onContextMenu:this.triggerCellContextMenu},sticky:this.sticky}},setup(e){const t=a.ref(null),s=a.ref(null),i=a.ref(null),o=a.ref(null),n=a.ref(null),r=a.ref(null),d=a.ref(null),c=a.ref([]),g=a.ref([]),u=a.ref(null),p=a.ref(null),m=a.ref(null),R=a.ref(null),x=a.ref(null),b=a.ref(null),$=a.ref(!0),v=a.ref(!1),y=new dt.VirtualScroll,I=a.ref(0),M=a.inject(mt.KendoKey,{}),O=typeof e.groupable=="object"&&!!e.groupable.stickyHeaders,W=typeof e.groupable=="object"&&!!e.groupable.stickyFooters,T=a.ref([]),U=a.computed(()=>{var N,_;return!!((_=(N=M.group)==null?void 0:N.value)!=null&&_.length)}),F=null,G=a.ref(void 0),H=a.ref({headerItems:[],footerItems:[]}),{scrollToStickyGroup:L,update:K}=bt.useStickyGroups({enabled:O,enabledFooters:W,flatData:T,containerRef:u,stickyHeaderRef:p,stickyFooterRef:m,tableBodyRef:b,rowHeight:e.rowHeight,isGrouped:U,virtualSkipRef:I,rowHeightServiceRef:a.computed(()=>y==null?void 0:y.rowHeightService)});return{rowIndexRef:G,observerRef:F,dataRef:T,groupPanelDivRef:t,dropElementClueRef:s,dragElementClueRef:i,headerRef:o,footerRef:n,gridNavRef:r,colGroupRef:d,scrollContainerRef:u,tableBodyRef:b,gridStateContext:M,shouldUpdateLeftRightRef:$,resizedRef:v,currentColumnsState:e.columnsState,vsRef:y,virtualSkipRef:I,stickyHeaderItems:c,stickyHeaderRef:p,stickyFooterItems:g,stickyFooterRef:m,pinnedTopRef:R,pinnedBottomRef:x,sticky:H,scrollToStickyGroup:L,updateStickyGroups:K}},render(){var ue,fe,ge,me,Re,Ce,be,Se,Ie,xe,ve,we,$e,ye,ke,He,Te,Me;const e=(ue=this.gridStateContext.sort)==null?void 0:ue.value,t=(fe=this.gridStateContext.filter)==null?void 0:fe.value,s=(ge=this.gridStateContext.search)==null?void 0:ge.value,i=(me=this.gridStateContext.select)==null?void 0:me.value,o=(Re=this.gridStateContext.skip)==null?void 0:Re.value,n=(Ce=this.gridStateContext.take)==null?void 0:Ce.value,r=(be=this.gridStateContext.group)==null?void 0:be.value,d=(Se=this.gridStateContext.groupExpand)==null?void 0:Se.value,c=(Ie=this.gridStateContext.detailExpand)==null?void 0:Ie.value,g=(r==null?void 0:r.length)||0,u=typeof this.$props.groupable=="object"&&!!this.$props.groupable.stickyHeaders,p=typeof this.$props.groupable=="object"&&!!this.$props.groupable.stickyFooters,m=!!(r!=null&&r.length);let R;this.currentColumnsState=(xe=this.gridStateContext.columnsState)==null?void 0:xe.value;const x=this.$props.autoProcessData===!0?{group:!0,sort:!0,filter:!0,search:!0,page:!0}:this.$props.autoProcessData;let b;const $=f.tableKeyboardNavigationTools.getIdPrefix(this.navigation);let v=[];Array.isArray(this.$props.dataItems)?(v=this.$props.dataItems,b=(ve=this.$props.total)!=null?ve:v.length):(v=((we=w.applyExpandedState(this.$props.dataItems,this.$props.collapsedGroups.length?this.computedCollapsed:[],this.$props.uniqueField))==null?void 0:we.data)||[],b=(ke=(ye=this.$props.total)!=null?ye:($e=this.$props.dataItems)==null?void 0:$e.total)!=null?ke:v.length);const y=this.$props.groupable===!0||l.isObject(this.$props.groupable)&&this.$props.groupable.enabled!==!1;this.dragLogic.reorderable=this.$props.reorderable||!1,this.dragLogic.groupable=y,this._virtualPageSize=this.calcVirtualPageSize();const I=v.length===b,M=l.isObject(this.$props.groupable)&&this.$props.groupable.footer||"none";if(x){const h=x.page&&!(this.isVirtualScroll&&!this.$props.pageable),{data:S,total:k}=re.process(v,{group:x.group?r:void 0,sort:x.sort?e:void 0,filter:f.combineFilters(x.filter?t:void 0,x.search?s:void 0),...h?{take:this.$props.pageable?n||10:n,skip:o||0}:{}});v=S,b=(He=this.$props.total)!=null?He:k}const{resolvedGroupsCount:O,flattedData:W}=this.getFlatData(v,M,I?0:this.$props.skip||0,r,c,d,this.$props.dataItemKey);this.dataRef=W;const T=this.virtualSkipRef||0;if(this._virtualTotal=b,this.isVirtualScroll){let h=o||0;if((m||this.$props.pageable)&&(h=T,this._virtualTotal=this.dataRef.length),I||m||this.$props.pageable)if(this._virtualPageSize===0){const S=Math.min(n||this.$props.pageSize||20,this.dataRef.length);R=this.dataRef.slice(h,h+S)}else R=this.dataRef.slice(h,h+this._virtualPageSize)}this.initializeVirtualization();const U=(Te=this.selectable)!=null&&Te.drag?"none":void 0;this.initColumns(this.$props.dataItems,O),this.columnResize.resizable=this.$props.resizable||!1,this.columnResize.columns=this.columnsRef,this.columnResize.columnsState=l.cloneArray(this.currentColumnsState||[]),this.dragLogic.columns=this.columnsRef;const F=this.$props.toolbar,G=this.$props.noRecords,H=this.columnsRef.filter(h=>h.children.length===0),L=y&&a.createVNode(ot.GroupPanel,{ref:h=>{this.groupPanelDivRef=h},group:r||[],ariaControls:this._gridRoleElementId,onGroupChange:this.groupChangeHandler,onPressHandler:this.dragLogic.pressHandler,onDragHandler:this.dragLogic.dragHandler,onReleaseHandler:this.dragLogic.releaseHandler,resolveTitle:this.resolveTitle},null),K=(this.dragLogic.reorderable||this.dragLogic.groupable)&&l.canUseDOM&&document&&document.body,N=[K&&a.createVNode(ut.DropClue,{ref:h=>{this.dropElementClueRef=h}},null),K&&a.createVNode(pt.DragClue,{ref:h=>{this.dragElementClueRef=h}},null)],_=this.showLicenseWatermark?a.createVNode(l.WatermarkOverlay,{message:this.licenseMessage},null):null,j=this.$attrs.style,Be=j&&l.isObject(j)&&j["width"]||"";this.tableWidth=parseFloat(Be.toString());const qe=H.findIndex(h=>typeof h.colSpan=="function")>-1;let A;A=this.getCellsToRender({},H);const E=H.map(function(h,S){return a.createVNode("col",{key:h.id||`col-${S}`,width:h.width!==void 0?Math.floor(parseFloat(h.width.toString())):void 0},null)},this),ae=a.createVNode(tt.Header,{size:this.$props.size,columnResize:this.columnResize,staticHeaders:this.$props.scrollable!=="none",ref:h=>{this.headerRef=h},onHeaderscroll:this.onHeaderScroll,headerRow:a.createVNode(st.HeaderRow,{grid:this,sort:e,groupable:this.$props.groupable,reorderable:this.$props.reorderable,sortable:this.$props.sortable,onSortChange:this.sortChangeHandler,filter:t,filterable:this.$props.filterable,filterOperators:this.$props.filterOperators||Ne.operators,onFilterChange:this.filterChangeHandler,columnMenu:this.$props.columnMenu,columnMenuIcon:this.$props.columnMenuIcon,columnMenuAnimate:this.$props.columnMenuAnimate,onSelectionchange:this.onHeaderSelectionChangeHandler,columns:this.columnsRef,cellsToRender:A,columnVirtualization:this.$props.columnVirtualization,columnsInitial:this.$props.columns,columnResize:this.columnResize,onPressHandler:this.dragLogic.pressHandler,onDragHandler:this.dragLogic.dragHandler,onReleaseHandler:this.dragLogic.releaseHandler,columnsMap:this._columnsMap,cellRender:this.$props.headerCellRender,cells:this.$props.cells,isRtl:this.isRtl,isColCountDefined:this.getAriaColCount!==void 0,headerSelectionValue:!!(i&&this.dataRef.filter(h=>h.rowType==="data").every(h=>i&&this.$props.dataItemKey&&l.getter(this.$props.dataItemKey)(h.dataItem)!==void 0?i[l.getter(this.$props.dataItemKey)(h.dataItem)]:void 0)),filterRow:this.$props.filterable&&a.createVNode(it.FilterRow,{grid:this,size:this.$props.size,columns:this.columnsRef,columnsMap:this._columnsMap,cellsToRender:A,columnVirtualization:this.$props.columnVirtualization,filter:t,filterOperators:this.$props.filterOperators||Ne.operators,onFilterchange:this.filterChangeHandler,sort:this.$props.sort,cellRender:this.$props.filterCellRender,cells:this.$props.cells,isRtl:this.isRtl,ariaRowIndex:this._columnsMap.length+1},null)||void 0},null),cols:E},null),le=this.columnsRef.some(h=>{var S;return!!(h.footerCell||(S=h.cells)!=null&&S.footerCell)})||(Me=this.$props.cells)!=null&&Me.footerCell?a.createVNode(nt.Footer,{size:this.$props.size,columnResize:this.columnResize,staticHeaders:this.$props.scrollable!=="none",ref:h=>{this.footerRef=h},row:a.createVNode(rt.FooterRow,{isRtl:this.isRtl,rowIndex:this.getAriaRowCount+1,columns:this.columnsRef,cells:this.$props.cells},null),cols:E},null):a.createVNode("span",null,null),z={leafColumns:H,cellsToRender:A,selectedField:this.$props.selectedField,dataItemKey:this.$props.dataItemKey,select:i,highlight:this.$props.highlight,editField:this.$props.editField,cellRender:this.$props.cellRender,cells:this.$props.cells,getCellsToRender:this.getCellsToRender,hasDynamicColSpan:qe,itemChange:this.itemChange,selectionChangeHandler:this.selectionChangeHandler,editHandler:this.editHandler,removeHandler:this.removeHandler,saveHandler:this.saveHandler,cancelHandler:this.cancelHandler,cellClickHandler:this.cellClickHandler,cellKeydownHandler:this.cellKeydownHandler,computedCollapsed:this.computedCollapsed,uniqueField:this.$props.uniqueField,columnsRef:this.columnsRef,isRtl:this.isRtl,idPrefix:$},Oe=function(h,S,k,Z,ee){return Ct.getRowContents(z,h,S,k,Z,ee)};let We=0,J=[];const Q=!this.dataRef.length,de=h=>h>=this.dataRef.length-We;let X=0;if(this.dataRef.length){const h=this._columnsMap.length+(this.$props.filterable?1:0)+1;let S=this.$props.skip||0,k=-1,Z=0;const ee=this.computedRowSpannable.enabled?{}:void 0;if(this.isVirtualScroll){if(T>0){const C=this.dataRef.slice(0,T).filter(V=>V.rowType==="data").length;k+=C,S+=T}!this.$props.pageable&&I&&(k+=this.$props.skip||0)}J=(R||this.dataRef).map(function(C,V){C.rowType==="data"&&k++;const te=C.dataIndex%2!==0,Ge=this.$props.dataItemKey&&l.getter(this.$props.dataItemKey)(C.dataItem),se=V+S,ie=Ge||"ai"+se,oe=ie+"_1",B=Oe.call(this,C,ie,k,te,ee),Qe=C.rowType==="data"?this.pinnedSourceSet.has(C.dataItem):!1,Xe=H.length-(this.detailExpandable.enabled?1:0)-((r==null?void 0:r.length)||0)||1;return X=se+h+Z,[a.createVNode(ft.GridRow,{key:ie,item:C,dataIndex:k,ariaRowIndex:X,absoluteRowIndex:se,isAltRow:te,isHidden:de(V),rowHeight:this.$props.rowHeight,isSelected:B.isSelected,isHighlighted:B.isHighlighted,isInEdit:B.isInEdit,rowType:C.rowType,onRowclick:P=>this.rowClick(P,C),onRowdblclick:P=>this.rowDoubleClick(P,C),render:this.$props.rowRender,class:this.$props.rowClass?this.$props.rowClass(C):"",isPinned:Qe,rows:this.$props.rows},{default:()=>[B.row]}),this.$props.detail&&C.rowType==="data"&&(C.expanded||C.dataItem.expanded)&&a.createVNode("tr",{key:oe,class:te?"k-table-row k-table-alt-row k-detail-row":"k-table-row k-detail-row",style:{visibility:de(V)?"hidden":"",height:this.$props.detailRowHeight+"px"},role:"row","aria-rowindex":X},[r==null?void 0:r.map(function(P){return a.createVNode(ze.GridGroupCell,{id:"",dataIndex:C.dataIndex,field:P.field,dataItem:C.dataItem,key:`group-${P.field}-${C.dataIndex}`,locked:this.$props.lockGroups,group:C.group},null)},this),(this.$props.expandField||this.detailExpandable.enabled)&&a.createVNode(Ze.GridDetailHierarchyCell,{id:f.tableKeyboardNavigationTools.generateNavigatableId(`${oe}-dhcell`,$)},null),a.createVNode(et.GridDetailCell,{dataItem:C.dataItem,dataIndex:C.dataIndex,colSpan:Xe,ariaColIndex:2+(r?r.length:0),detail:this.$props.detail?this.$props.detail:void 0,id:f.tableKeyboardNavigationTools.generateNavigatableId(`${oe}-dcell`,$)},null)])]},this)}const Ue=this.$props.pageable&&a.createVNode(f.Pager,{class:"k-grid-pager",onPagesizechange:this.pageChangeHandler,onPagechange:this.pageChangeHandler,size:this.$props.size,total:b,skip:o||0,pageSize:(n!==void 0?n:this.$props.pageSize)||10,messagesMap:Ke.pagerMessagesMap,settings:f.normalize(this.$props.pageable||{})},null),he=l.getTemplate.call(this,{h:a.h,template:this.$props.pager,defaultRendering:Ue,additionalProps:{...this.$props,skip:this.$props.skip||0,messagesMap:Ke.pagerMessagesMap},additionalListeners:{pagesizechange:this.pageChangeHandler,pagechange:this.pageChangeHandler}}),je=h=>e&&e.filter(S=>S.field===h).length>0,ce=a.createVNode("colgroup",{ref:l.setRef(this,"colGroup")},[H.map(function(h,S){return a.createVNode("col",{key:h.id||`col-${S}`,class:je(h.field)?"k-sorted":void 0,width:h.width!==void 0?h.width.toString().indexOf("%")!==-1?h.width:Math.floor(parseFloat(h.width.toString()))+"px":void 0},null)},this)]),pe={height:this.getCorrectHeight,...this.$attrs.style},Je=a.createVNode("div",{class:"k-loading-mask"},[a.createVNode("div",{class:"k-loading-color"},null),a.createVNode("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},[a.createVNode(Ye.Loader,{size:"large",type:"converging-spinner"},null)])]),Y=this.$props.showLoader&&l.getTemplate.call(this,{h:a.h,template:this.$props.loader,defaultRendering:Je});return this.$props.scrollable==="none"?a.createVNode(a.Fragment,null,[a.createVNode(f.TableKeyboardNavigationProvider,{ref:"navRef",id:this._gridId,navigatable:this.$props.navigatable,scrollable:this.$props.scrollable,columnVirtualization:this.$props.columnVirtualization},{default:()=>[a.createVNode(Ee.GridNav,{ref:h=>{this.gridNavRef=h},columnsRef:this.columnsRef,dataRef:this.dataRef,id:this.$props.id,dir:this.$props.dir,style:pe,class:this.nonscrollableWrapperClass,onMovetonextpage:this.moveToNextPage,onMovetoprevpage:this.moveToPrevPage,onColumnreorder:this.columnReorder,onKeyboardselectionchange:this.onKeyboardSelectionChangeHandler,onNavigationaction:this.navigationActionHandler},{default:()=>[F,L,a.createVNode("div",{role:"grid",class:"k-grid-aria-root",id:this._gridRoleElementId,"aria-colcount":this.getAriaColCount,"aria-rowcount":this.getAriaRowCount},[a.createVNode(at.GridTable,{selectable:this.computedSelectable,class:"k-table",ref:l.setRef(this,"table")},{default:()=>[ce,ae,a.createVNode("tbody",{class:"k-table-tbody","data-keyboardnavbody":!0,ref:l.setRef(this,"tableBody")},[J,a.createTextVNode(" "),Y]),le]}),Q&&a.createVNode(Le.GridNoRecordsContainer,{id:f.tableKeyboardNavigationTools.generateNavigatableId("no-records",$)},{default:()=>[G.length?G:a.createVNode(Fe.GridNoRecords,null,null)]})]),he,Y,N]})]}),this.renderContextMenu()]):a.createVNode(a.Fragment,null,[a.createVNode(f.TableKeyboardNavigationProvider,{ref:"navRef",id:this._gridId,navigatable:this.$props.navigatable,scrollable:this.$props.scrollable,columnVirtualization:this.$props.columnVirtualization},{default:()=>[a.createVNode(Ee.GridNav,{ref:h=>{this.gridNavRef=h},dataRef:this.dataRef,id:this.$props.id,dir:this.$props.dir,style:pe,class:this.scrollableWrapperClass,onMovetonextpage:this.moveToNextPage,onMovetoprevpage:this.moveToPrevPage,onColumnreorder:this.columnReorder,onKeyboardselectionchange:this.onKeyboardSelectionChangeHandler,onSetcurrentontop:this.setCurrentOnTop,onNavigationaction:this.navigationActionHandler},{default:()=>[F,L,a.createVNode("div",{role:"grid",class:"k-grid-aria-root",id:this._gridRoleElementId,"aria-colcount":this.getAriaColCount,"aria-rowcount":this.getAriaRowCount},[ae,this.hasPinnedTopRows&&a.createVNode(Ae.PinnedRowsTable,{ref:l.setRef(this,"pinnedTop"),size:this.$props.size,cols:E,dataRowContext:z,position:"top",pinnedItems:this.sortedPinnedTopRows,rowHeight:this.$props.rowHeight,rows:this.$props.rows,selectable:this.computedSelectable},null),a.createVNode("div",{class:"k-grid-container",role:"presentation"},[m&&u&&a.createVNode(_e.StickyGroupTable,{ref:l.setRef(this,"stickyHeader"),size:this.$props.size,cols:E,dataRowContext:z,position:"top",groupLevelCount:g,rowHeight:this.$props.rowHeight},null),a.createVNode("div",{role:"presentation",ref:l.setRef(this,"scrollContainer"),class:"k-grid-content k-virtual-content",onScroll:this.scrollHandler},[a.createVNode("div",{class:"k-grid-table-wrap",role:"presentation"},[a.createVNode(lt.GridTableScrollable,{selectable:this.computedSelectable,tableClassName:this.gridTableClass,tableStyle:{userSelect:U},ref:l.setRef(this,"table")},{default:()=>[ce,a.createVNode("tbody",{class:"k-table-tbody",role:"rowgroup","data-keyboardnavbody":!0,ref:l.setRef(this,"tableBody")},[J])]}),Q&&a.createVNode(Le.GridNoRecordsContainer,{id:f.tableKeyboardNavigationTools.generateNavigatableId("no-records",$)},{default:()=>[G.length?G:a.createVNode(Fe.GridNoRecords,null,null)]})]),!Q&&a.createVNode("div",{class:"k-height-container",role:"presentation"},[a.createVNode("div",{ref:l.setRef(this,"scrollHeightContainer"),style:this.$props.scrollable==="virtual"?{height:this._containerHeightRef+"px"}:{}},null)])]),m&&p&&a.createVNode(_e.StickyGroupTable,{ref:l.setRef(this,"stickyFooter"),size:this.$props.size,cols:E,dataRowContext:z,position:"bottom",groupLevelCount:g,rowHeight:this.$props.rowHeight},null)]),this.hasPinnedBottomRows&&a.createVNode(Ae.PinnedRowsTable,{ref:l.setRef(this,"pinnedBottom"),size:this.$props.size,cols:E,dataRowContext:z,position:"bottom",pinnedItems:this.sortedPinnedBottomRows,rowHeight:this.$props.rowHeight,rows:this.$props.rows,selectable:this.computedSelectable},null),le,_]),he,Y,N]})]}),this.renderContextMenu()])}});exports.Grid=It;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),l=require("@progress/kendo-vue-common"),f=require("@progress/kendo-vue-data-tools"),Ye=require("@progress/kendo-vue-indicators"),Ee=require("./GridNav.js"),Pe=require("./cells/GridSelectionCell.js"),De=require("./cells/GridHierarchyCell.js"),Ze=require("./cells/GridDetailHierarchyCell.js"),et=require("./cells/GridDetailCell.js"),tt=require("./header/Header.js"),st=require("./header/HeaderRow.js"),it=require("./header/FilterRow.js"),ot=require("./header/GroupPanel.js"),nt=require("./footer/Footer.js"),rt=require("./footer/FooterRow.js"),at=require("./components/table/GridTable.js"),lt=require("./components/table/GridTableScrollable.js"),Ne=require("./filterCommon.js"),dt=require("./VirtualScroll.js"),ht=require("./drag/ColumnResize.js"),ct=require("./drag/CommonDragLogic.js"),pt=require("./drag/DragClue.js"),ut=require("./drag/DropClue.js"),$=require("./utils/main.js"),Ve=require("./cells/GridGroupCell.js"),ft=require("./rows/GridRow.js"),gt=require("./common.js"),ze=require("./header/GridHeaderSelectionCell.js"),Fe=require("./components/noRecords/GridNoRecords.js"),Le=require("./components/noRecords/GridNoRecordsContainer.js"),ne=require("./package-metadata.js"),Ke=require("./messages/messagesMap.js"),re=require("@progress/kendo-data-query"),mt=require("./key.js"),Rt=require("./utils/virtualColumns.js"),_e=require("./components/StickyGroupTable.js"),Ct=require("./getRowContents.js"),bt=require("./hooks/useStickyGroups.js"),Ae=require("./components/PinnedRowsTable.js"),St=require("./cells/pincell/GridPinCell.js"),vt=require("./BaseCSVExport.js"),U=require("./contextMenu/GridContextMenu.js"),N=require("./contextMenu/enums.js"),xt=a.defineComponent({name:"KendoGrid",inheritAttrs:!1,props:{...gt.gridProps,toolbar:{type:Object},noRecords:{type:Object}},data(){return{isRtl:!1,context:void 0,navigation:void 0,showLicenseWatermark:!1,licenseMessage:void 0,notHiddenColumns:[],contextMenuState:{show:!1,offset:{left:0,top:0},dataItem:void 0,field:void 0}}},watch:{clipboard:function(e){e?this.clipboardServiceRef||(this.clipboardServiceRef=new f.ClipboardService(this.handleClipboardEvent),this.clipboardServiceRef.addEventListeners(document)):this.clipboardServiceRef&&(this.clipboardServiceRef.removeEventListeners(document),this.clipboardServiceRef=null)},rowHeight:function(e,t){var s;this.onRowHeightChanged(e,t),(s=this.vsRef)==null||s.reset()},scrollable:function(){var e;(e=this.vsRef)==null||e.reset()},filter:function(){var e;(e=this.vsRef)==null||e.reset()},group:function(){var e;(e=this.vsRef)==null||e.reset()},currentGroupable:function(){var e;(e=this.vsRef)==null||e.reset()},sort:function(){var e;(e=this.vsRef)==null||e.reset()}},created(){l.validatePackage(ne.packageMetadata),this.showLicenseWatermark=l.shouldShowValidationUI(ne.packageMetadata),this.licenseMessage=l.getLicenseMessage(ne.packageMetadata),this.initialHeight=null,this.columnsRef=[],this.dragLogic=new ct.CommonDragLogic(this.columnReorder.bind(this),this.groupReorder.bind(this),this.columnToGroup.bind(this)),this.columnResize=new ht.ColumnResize(this.onResize.bind(this)),this._columnsMap=[[]],this._header=null,this._footer=null,this.tableRef=null,this.scrollHeightContainerRef=null,this.forceUpdateTimeout=void 0,this._gridId=l.guid(),this._gridRoleElementId=l.guid(),this.slicedCurrentData=void 0,this._prevTotal=void 0,this._containerHeightRef=0,this._minRowHeightRef=0,this.wrapperScrollTopRef=0,this.scrollLeftRef=0,this.previousCopiedItems=[],this.clipboardServiceRef=null},mounted(){var t,s;this.setRefs();const e=l.isRtl(this._element);if(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=l.canUseDOM&&(window==null?void 0:window.ResizeObserver)&&new ResizeObserver(this.calculateMedia),document!=null&&document.body&&this.resizeObserver&&this.resizeObserver.observe(document.body),l.canUseDOM){const i={rootMargin:"0px",threshold:.9};this.observerRef=window.IntersectionObserver&&new window.IntersectionObserver(this.handleIntersection,i)||null}this.$props.clipboard&&(this.clipboardServiceRef=new f.ClipboardService(this.handleClipboardEvent),this.clipboardServiceRef.addEventListeners(document))},updated(){var s;this.setRefs();const e=l.isRtl(this._element);this.isRtl=e,this._prevTotal=this.$props.total,this.vsRef.tableTransform&&this.vsRef.table&&(this.vsRef.table.style.transform=this.vsRef.tableTransform,this.vsRef.tableTransform="");const t=this.updateStickyGroups();this.sticky.headerItems=t==null?void 0:t.stickyHeaderItems,this.sticky.footerItems=t==null?void 0:t.stickyFooterItems,this.isVirtualScroll&&(this.setContainerHeight(),this.setMinRowHeight(),(s=this.vsRef)==null||s.update())},unmounted(){this.gridUnmounted()},computed:{gridId(){return this.$props.id+"-role-element-id"},idPrefix(){return this.$props.navigatable?this.gridId:""},groupExpandable(){return f.getGroupExpandableOptions(typeof this.$props.groupable=="object"&&this.$props.groupable.enabled!==!1?this.$props.groupable.expandable:this.$props.groupable)},hierarchClass(){return l.uGrid.hierarchyCell({})},computedRowSpannable(){return $.getRowSpanOptions(this.$props.rowSpannable)},computedSelectable(){return f.getSelectionOptions(this.$props.selectable)},detailExpandable(){return f.getDetailExpandableOptions(!!this.$props.detail)},nonscrollableWrapperClass(){const{size:e}=this.$props,t=this.$attrs.class;return{"k-grid":!0,"k-grid-md":!e,[`k-grid-${l.kendoThemeMaps.sizeMap[e]||e}`]:e,[t]:!!t}},scrollableWrapperClass(){const{scrollable:e}=this.$props;return{...this.nonscrollableWrapperClass,"k-grid-virtual":e==="virtual"}},gridTableClass(){const{size:e}=this.$props;return{"k-table":!0,"k-grid-table":!0,"k-grid-md":!e,[`k-table-${l.kendoThemeMaps.sizeMap[e]||e}`]:e}},getCorrectHeight(){return this.$props.scrollable==="virtual"?this.initialHeight||"450px":null},currentGroupable(){var t;const e=(t=this.gridStateContext.group)==null?void 0:t.value;return this.$props.groupable===!0&&(e==null?void 0:e.length)||l.isObject(this.$props.groupable)&&this.$props.groupable.enabled!==!1},computedCollapsed(){let e=[];if(this.$props.group)for(let t=0;t<this.$props.group.length;t++)this.$props.collapsedGroups[t]?e.push(this.$props.collapsedGroups[t]):e.push([]);return e},getAriaRowCount(){var s,i;const e=this.$props.dataItems,t=this.$props.total||(e==null?void 0:e.total)||(e==null?void 0:e.length)||0;return this.$props.detail?this._columnsMap.length+(this.$props.filterable?1:0)+t*2+(this.columnsRef.some(o=>{var n;return!!(o.footerCell||(n=o.cells)!=null&&n.footerCell)})||(s=this.$props.cells)!=null&&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.columnsRef.some(o=>{var n;return!!(o.footerCell||(n=o.cells)!=null&&n.footerCell)})||(i=this.$props.cells)!=null&&i.footerCell?1:0)},getAriaColCount(){const e=this.$props.columns,t=this.$props.columnVirtualization,s=(e==null?void 0:e.filter(i=>i.hidden!==void 0).length)!==0;if(t||s)return(e==null?void 0:e.length)!==0?e==null?void 0:e.length:-1},isVirtualScroll(){return this.$props.scrollable==="virtual"||this.$props.scrollable===void 0||!1},pinnedSourceSet(){var t,s;const e=new Set;return(t=this.gridStateContext.pinnedTopRows)!=null&&t.value&&this.gridStateContext.pinnedTopRows.value.forEach(i=>e.add(i)),(s=this.gridStateContext.pinnedBottomRows)!=null&&s.value&&this.gridStateContext.pinnedBottomRows.value.forEach(i=>e.add(i)),e},sortedPinnedTopRows(){var s,i;const e=((s=this.gridStateContext.pinnedTopRows)==null?void 0:s.value)||[],t=(i=this.gridStateContext.sort)==null?void 0:i.value;return this.autoProcessData&&(t!=null&&t.length)?re.orderBy([...e],t):e},sortedPinnedBottomRows(){var s,i;const e=((s=this.gridStateContext.pinnedBottomRows)==null?void 0:s.value)||[],t=(i=this.gridStateContext.sort)==null?void 0:i.value;return this.autoProcessData&&(t!=null&&t.length)?re.orderBy([...e],t):e},hasPinnedTopRows(){return this.$props.pinnable&&this.sortedPinnedTopRows.length>0},hasPinnedBottomRows(){return this.$props.pinnable&&this.sortedPinnedBottomRows.length>0},contextMenuColumn(){return this.columnsRef.find(e=>e.field===this.contextMenuState.field)},headMenuItems(){var t;const e=this.$props.sortable&&((t=this.contextMenuColumn)==null?void 0:t.sortable);return U.getDefaultHeadContextMenuItems({sortable:!!e,selectable:this.computedSelectable.enabled})},bodyMenuItems(){var e;return this.$props.sortable&&((e=this.contextMenuColumn)==null||e.sortable),U.getDefaultBodyContextMenuItems({selectable:this.computedSelectable.enabled,pinnable:!!this.$props.pinnable,clipboard:!!this.$props.clipboard})},contextMenuItems(){var s;const e=((s=this.contextMenuColumn)==null?void 0:s.contextMenu)||this.$props.contextMenu,t=typeof e=="function"?e(this.contextMenuState):e;if(t&&this.contextMenuState.offset){const i=this.contextMenuState.dataItem?N.GridContextMenuAnchorPart.body:N.GridContextMenuAnchorPart.head,o=t[i],n=this.contextMenuState.dataItem?this.bodyMenuItems:this.headMenuItems;let r;return o===!0||o===void 0?r=n:o!==!1&&(r=o),this.$props.pinnable&&r&&this.contextMenuState.dataItem?this.filterPinContextMenuItems(r):r}}},methods:{getCellPositionStyle(e,t){return e.left!==void 0?t?{left:e.right+"px",right:e.left+"px"}:{left:e.left+"px",right:e.right+"px"}:{}},handleContextMenuOpen(e,t,s){e.preventDefault(),this.contextMenuState={show:!0,offset:{left:e.pageX,top:e.pageY},dataItem:t,field:s}},handleContextMenuClose(){this.contextMenuState={show:!1,offset:{left:0,top:0},dataItem:void 0,field:void 0}},inActiveElement(){var o;if(!l.canUseDOM)return!1;const e=document==null?void 0:document.activeElement;let t=document==null?void 0:document.body;e!=null&&e.matches(".k-table-td")&&(t=e);const s=t==null?void 0:t.closest(".k-grid-container"),i=t&&((o=this._element)==null?void 0:o.contains(t));return!!(t&&i&&s)},handleClipboardEvent(e,t,s,i,o){var c,g,u;if(!this.inActiveElement()&&!s||!e)return;const n={type:e,nativeEvent:t,columns:this.columnsRef,dataItemKey:this.$props.dataItemKey||"",dataItem:i,field:o,...typeof this.$props.clipboard!="boolean"?this.$props.clipboard:{},...s},r=this.getLeafDataItems(),d=f.populateClipboardData({event:n,data:r,selectedState:(u=(g=this.$props.select)!=null?g:(c=this.gridStateContext.select)==null?void 0:c.value)!=null?u:{},previousCopiedItems:this.previousCopiedItems});e!==f.ClipboardActionType.paste&&(this.previousCopiedItems=d.copiedItems),l.hasListener.call(this,"clipboard")&&this.$emit("clipboard",{...n,...d})},handleContextMenuSelect(e){this.handleContextMenuItemClick({event:e,dataItem:this.contextMenuState.dataItem,field:this.contextMenuState.field})},renderContextMenu(){var e;return a.createVNode(U.GridContextMenu,{show:!!(this.contextMenuState.show&&((e=this.contextMenuItems)!=null&&e.length)),dataItem:this.contextMenuState.dataItem,field:this.contextMenuState.field,items:this.contextMenuItems,offset:this.contextMenuState.offset,onClose:this.handleContextMenuClose,onSelect:this.handleContextMenuSelect},null)},filterPinContextMenuItems(e){var c,g;const t=this.$props.dataItemKey||"",s=this.contextMenuState.dataItem,i=((c=this.gridStateContext.pinnedTopRows)==null?void 0:c.value)||[],o=((g=this.gridStateContext.pinnedBottomRows)==null?void 0:g.value)||[],n=t?s[t]:void 0,r=n!==void 0&&i.some(u=>u[t]===n),d=n!==void 0&&o.some(u=>u[t]===n);return e.map(u=>{const p=typeof u=="string"?U.contextMenuItemsMap[u]:u;return(p==null?void 0:p.name)===N.GridContextMenuItemNames.pinRow&&p.items?{...p,items:p.items.filter(m=>m.name===N.GridContextMenuItemNames.pinTop?!r:m.name===N.GridContextMenuItemNames.pinBottom?!d:m.name===N.GridContextMenuItemNames.unpin?r||d:!0)}:u})},handleContextMenuItemClick(e){var i,o,n,r,d,c,g,u;const t=e.event.event.item,s={event:e.event,menuItem:t,dataItem:e.dataItem,field:e.field};switch(this.$emit("contextmenuitemclick",s),(i=t.data)==null?void 0:i.action){case"SortCommand":if(this.contextMenuColumn){const p=(o=t.name)==null?void 0:o.toLowerCase().includes("asc"),R=((n=t.name)==null?void 0:n.toLowerCase().includes("desc"))?"desc":void 0,x=p?"asc":R,b=t.name?x:void 0,I=(((r=this.gridStateContext.sort)==null?void 0:r.value)||[]).filter(k=>{var S;return k.field!==((S=this.contextMenuColumn)==null?void 0:S.field)});b&&((d=this.contextMenuColumn)!=null&&d.field)&&I.push({field:this.contextMenuColumn.field,dir:b}),this.sortChangeHandler(I,{event:e.event})}break;case"SelectRowCommand":{const p=e.dataItem;if(this.computedSelectable.enabled&&p&&this.$props.dataItemKey){const R=l.getter(this.$props.dataItemKey)(p),x=this.getLeafDataItems(),b=x.findIndex(T=>T[this.$props.dataItemKey]===p[this.$props.dataItemKey]),w=0,I=this.columnsRef.length-1,k={...this.getArguments(e.event),dataItem:p,startDataItem:b,endDataItem:b,startRowIndex:b,endRowIndex:b,startColIndex:w,endColIndex:I,dataItems:x,ctrlKey:!1,altKey:!1,metaKey:!1,shiftKey:!1,isDrag:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""},S=this.computedSelectable.mode==="multiple"?{...(g=(c=this.gridStateContext.select)==null?void 0:c.value)!=null?g:{}}:{};S[R]===!0||Array.isArray(S[R])&&S[R].length===this.columnsRef.length?delete S[R]:S[R]=this.computedSelectable.cell?[...Array(this.columnsRef.length).keys()]:!0,this.raiseSelectionEvent(k,S)}break}case"SelectAllRowsCommand":{if(this.computedSelectable.enabled&&this.$props.dataItemKey){const p=this.getLeafDataItems(),m={},R=p[0],x=p[p.length-1];p.forEach(b=>{const w=l.getter(this.$props.dataItemKey)(b);m[w]=this.computedSelectable.cell?[...Array(this.columnsRef.length).keys()]:!0}),this.raiseSelectionEvent({...this.getArguments(e.event),dataItems:p,dataItem:R,startDataItem:R,endDataItem:x,startRowIndex:0,endRowIndex:p.length-1,startColIndex:0,endColIndex:this.columnsRef.length-1,ctrlKey:!1,altKey:!1,metaKey:!1,shiftKey:!1,isDrag:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""},m)}break}case"ClearSelectionCommand":this.computedSelectable.enabled&&this.clearSelection({...this.getArguments(e.event),dataItems:this.getLeafDataItems(),startRowIndex:-1,endRowIndex:-1,startColIndex:-1,endColIndex:-1,ctrlKey:!1,altKey:!1,metaKey:!1,shiftKey:!1,isDrag:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""});break;case"PinTopCommand":this.handleRowPin("pinTop",e.dataItem);break;case"PinBottomCommand":this.handleRowPin("pinBottom",e.dataItem);break;case"UnpinCommand":this.handleRowPin("unpin",e.dataItem);break;case"CopySelectionCommand":this.handleClipboardEvent(f.ClipboardActionType.copy,e.event.nativeEvent,{copyHeaders:!((u=t.name)!=null&&u.toLowerCase().includes("noheaders"))},e.dataItem,e.field);break;case"PasteCommand":this.handleClipboardEvent(f.ClipboardActionType.paste,e.event.nativeEvent,{},e.dataItem,e.field);break}this.handleContextMenuClose()},triggerCellContextMenu(e,t,s){this.$emit("contextmenu",{dataItem:t,field:s,event:e}),this.$props.contextMenu&&this.handleContextMenuOpen(e,t,s)},handleIntersection(e){const t={rowIndex:this.rowIndexRef.value};e.forEach(s=>{s.boundingClientRect.height!==s.intersectionRect.height&&this.setCurrentOnTop(t)})},scrollIntoView(e){var i;if(!((i=this.vsRef)!=null&&i.container)||this.$props.scrollable==="none")return;const{rowIndex:t}=e;this.rowIndexRef.value=t;const s=this._element;if(this.observerRef&&s){this.observerRef.disconnect();const o=s.querySelector(`[absolute-row-index="${this.rowIndexRef.value}"]`);o?this.observerRef.observe(o):this.setCurrentOnTop(e)}},setCurrentOnTop(e){var i,o;if(!((i=this.vsRef)!=null&&i.container)||this.$props.scrollable==="none")return;this.observerRef&&this.observerRef.disconnect();const{rowIndex:t}=e,s=this._element;if(this.isVirtualScroll){const n=((o=this.vsRef.rowHeightService)==null?void 0:o.offset(t))||0;this.vsRef.container.scroll(0,n)}else if(s){const n=t<1?s.querySelector("tbody > tr:nth-child(1)"):s.querySelector(`tbody > tr:nth-child(${t+1})`);n&&this.containerElementRef&&(this.containerElementRef.scrollTop=n.offsetTop)}},getTotal(){let e=this.$props.total||0;return Array.isArray(this.$props.dataItems)?e=e||this.$props.dataItems.length:this.$props.dataItems&&(e=e||this.$props.dataItems.total),e},exportAsCsv(){this.csvExportRef&&this.csvExportRef.save()},getCsvBlob(){return this.csvExportRef?this.csvExportRef.getBlob():null},readColumnElements(){return $.readColumns(this.$props.columns,this.currentColumnsState,{prevId:0,idPrefix:this.idPrefix})},getResolvedFlatColumnsState(){const e=[],t=(s,i)=>s==null?void 0:s.forEach(o=>{const n=o.hidden||i;e.push({...o,hidden:n}),t(o.children,n)});return t(this.currentColumnsState,!1),e},filterColumns(e){const t=this.getResolvedFlatColumnsState();return[e.filter(s=>{var i;return!s.hidden&&!((i=t.find(o=>o.id===s.id))!=null&&i.hidden)}),e.filter(s=>{var i;return s.hidden||((i=t.find(o=>o.id===s.id))==null?void 0:i.hidden)})]},getFlatData(e,t,s,i,o,n,r){const d=[],c=$.flatData(d,e,t,{index:s},i!==void 0,o,n,this.groupExpandable.defaultExpand,r,this.$props.expandField);return{flattedData:d,resolvedGroupsCount:c}},getColumnsEssentialProps(e){return e&&JSON.stringify(e.map(t=>({id:t.id,field:t.field,title:t.title,children:t.children})))},calculateMedia(){const e=this.filterHiddenColumns(this.$props.columns||[]);this.getColumnsEssentialProps(this.notHiddenColumns)!==this.getColumnsEssentialProps(e)&&this.$forceUpdate()},filterHiddenColumns(e){if(!e||e.length===0)return e;const t=s=>({...s,children:s.children&&s.children.length>0?this.filterHiddenColumns(s.children):s.children});return[...e].filter(s=>!s.hidden).filter(s=>l.canUseDOM&&s&&s.media?window.matchMedia(s.media).matches:s).map(s=>t(s))},getColumns(){const e=this.columnsRef.filter(s=>s.declarationIndex>=0&&s.parentIndex===-1),t=s=>(s.sort((i,o)=>i.declarationIndex-o.declarationIndex),s.map(i=>{const{declarationIndex:o,parentIndex:n,depth:r,colSpan:d,rowSpan:c,index:g,kFirst:u,children:p,...m}=i;return p.length?{children:t(p),...m}:m}));return t(e)},setRefs(){var n,r,d,c;let e="$el";const t=l.getRef(this,"gridNav");t&&(this._element=t[e]);const s=l.getRef(this,"groupPanelDiv");if(s){let g=s[e]||null;this.dragLogic.refGroupPanelDiv(g)}this.stickyHeaderRef=l.getRef(this,"stickyHeader"),this.stickyFooterRef=l.getRef(this,"stickyFooter"),this.pinnedTopRef=l.getRef(this,"pinnedTop"),this.pinnedBottomRef=l.getRef(this,"pinnedBottom");const i=l.getRef(this,"dropElementClue"),o=l.getRef(this,"dragElementClue");this.dragLogic.refDropElementClue(i),this.dragLogic.refDragElementClue(o),this.columnResize.colGroupMain=l.getRef(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=(d=this.pinnedTopRef)==null?void 0:d.colGroupRef,this.columnResize.colGroupPinnedBottom=(c=this.pinnedBottomRef)==null?void 0:c.colGroupRef,this._header=l.getRef(this,"header"),this._footer=l.getRef(this,"footer"),this.resetTableWidth(),l.setScrollbarWidth()},gridUnmounted(){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)},isAllData(){const{dataItems:e,total:t}=this.$props;return Array.isArray(e)?e.length===t:e?t===e.total:!1},resetVirtualSkip(){this.isVirtualScroll&&this.virtualSkipRef&&(this.virtualSkipRef=0)},virtualPageChange(e,t){var i;const s=(i=this.gridStateContext.group)==null?void 0:i.value;this.$props.pageable||s!=null&&s.length?(this.virtualSkipRef=e.skip,this.$forceUpdate()):this.pageChangeHandler(e,t)},initializeVirtualization(){const e=this.vsRef,t=this.$props.rowHeight||this._minRowHeightRef||0;this.tableBodyRef=l.getRef(this,"tableBody"),this.scrollTableRef=l.getComponentElementRef(this,"table"),e&&(e.fixedScroll=this.$props.fixedScroll||!1,e.PageChange=this.virtualPageChange,e.pageSize=this._virtualPageSize,e.scrollableVirtual=this.isVirtualScroll,this.scrollContainerRef=e.container=l.getRef(this,"scrollContainer"),e.tableBody=this.tableBodyRef,e.scrollHeightContainer=l.getRef(this,"scrollHeightContainer"),e.table=this.scrollTableRef,(!e.rowHeightService||e.total!==this._virtualTotal)&&t&&(e.total=this._virtualTotal,e.rowHeightService=new l.RowHeightService(this._virtualTotal,t)))},setContainerHeight(){const e=l.getRef(this,"scrollContainer");this._containerHeightRef=(e==null?void 0:e.offsetHeight)||0},setMinRowHeight(){if(!this._minRowHeightRef&&!this.$props.rowHeight){const t=$.calcRowHeight(l.getRef(this,"tableBody"));t&&(this._minRowHeightRef=t,this.$forceUpdate())}},onRowHeightChanged(e,t){this.setRefs()},onHeaderScroll(e){const s=e.target.scrollLeft,i=l.getRef(this,"scrollContainer");i&&(i.scrollLeft=s),this.scrollLeftRef=s},scrollHandler(e){clearTimeout(this.forceUpdateTimeout);const t=e.currentTarget.scrollLeft,s=e.currentTarget.scrollTop;this.$props.columnVirtualization&&(!this.isVirtualScroll||s===this.wrapperScrollTopRef)&&(this.forceUpdateTimeout=setTimeout(()=>{this.$forceUpdate()},0)),this.scrollLeftRef=t,this._header&&this._header.setScrollLeft(e.currentTarget.scrollLeft),this._footer&&this._footer.setScrollLeft(e.currentTarget.scrollLeft),this.stickyHeaderRef&&this.stickyHeaderRef.setScrollLeft(e.currentTarget.scrollLeft),this.stickyFooterRef&&this.stickyFooterRef.setScrollLeft(e.currentTarget.scrollLeft),this.pinnedTopRef&&this.pinnedTopRef.setScrollLeft(t),this.pinnedBottomRef&&this.pinnedBottomRef.setScrollLeft(t),this.vsRef&&s!==this.wrapperScrollTopRef&&this.vsRef.scrollHandler(e);const i=this.virtualSkipRef;this.vsRef&&s!==this.wrapperScrollTopRef&&this.vsRef.scrollHandler(e);const o=this.isVirtualScroll&&this.virtualSkipRef!==i;if(this.$emit("scroll",e),this.wrapperScrollTopRef=s,!o){const n=this.updateStickyGroups();this.sticky.headerItems=n==null?void 0:n.stickyHeaderItems,this.sticky.footerItems=n==null?void 0:n.stickyFooterItems}},rowClick(e,t){e.target.type!=="checkbox"&&this.$emit("rowclick",{dataItem:t.dataItem,...this.getArguments(e)})},rowDoubleClick(e,t){e.target.type!=="checkbox"&&this.$emit("rowdblclick",{dataItem:t.dataItem,...this.getArguments(e)})},loopGroupedItems(e,t,s=0,i=null){return e.forEach(o=>{!i&&t(o,s)&&(i=o),o.items&&o.items.length&&!i&&(i=this.loopGroupedItems(o.items,t,s+1,i))}),i},updateGroupCollapsed(e){let t=this.computedCollapsed,s=t[e.level];const i=this.$props.uniqueField,o=function(d,c){return d.value===e.dataItem.value&&c===e.level},n=this.allGroupedItems?this.loopGroupedItems(this.allGroupedItems.data,o,0,null):e.dataItem,r=$.groupedFirstItemValue(n||e.dataItem,i);if(e.value){if(s&&s.length){const d=s.indexOf(r);d>-1&&s.splice(d,1)}}else s?s.includes(r)||s.push(r):s=[r];return t},itemChange(e){var i;const t=l.hasListener.call(this,"itemchange"),s=(i=this.gridStateContext.group)==null?void 0:i.value;if(e.field===this.$props.expandField||(s||this.$props.detail)&&e.field===void 0){l.hasListener.call(this,"expandchange")&&e.dataItem&&this.$emit("expandchange",{...this.getArguments(e.event),collapsedGroups:this.updateGroupCollapsed(e),dataItem:e.dataItem,value:e.value});return}t&&this.$emit("itemchange",{...this.getArguments(e.event),dataItem:e.dataItem,field:e.field,value:e.value})},cellClickHandler(e){this.$emit("cellclick",{dataItem:e.dataItem,field:e.field})},cellKeydownHandler(e){this.$emit("cellkeydown",e)},navigationActionHandler(e){this.$emit("navigationaction",e)},editHandler(e){this.$emit("edit",{dataItem:e})},removeHandler(e){this.$emit("remove",{dataItem:e})},saveHandler(e){this.$emit("save",{dataItem:e})},cancelHandler(e){this.$emit("cancel",{dataItem:e})},selectionChangeHandler(e){var t,s,i;if(this.computedSelectable.enabled){const{event:o,dataItem:n,dataIndex:r,columnIndex:d}=e,c={...this.getArguments(o),dataItem:n,startColIndex:d,endColIndex:d,startRowIndex:r,endRowIndex:r,dataItems:this.getLeafDataItems(),altKey:!1,ctrlKey:!1,shiftKey:!1,metaKey:!1,mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,isDrag:!1,componentId:this.$props.id||this._gridId,selectedField:this.$props.selectedField||""};this.gridStateContext.selectionchange({...c,select:this.$props.dataItemKey?f.getSelectedState({event:c,selectedState:(i=(s=this.$props.select)!=null?s:(t=this.gridStateContext.select)==null?void 0:t.value)!=null?i:{},dataItemKey:this.$props.dataItemKey}):{}})}},onKeyboardSelectionChangeHandler(e){var g,u;if(!this.computedSelectable.enabled||!this.$props.dataItemKey)return;const t=(g=this.gridStateContext.select)==null?void 0:g.value,s={dataItems:this.getLeafDataItems(),mode:this.computedSelectable.mode,cell:this.computedSelectable.cell,componentId:this.$props.id,selectedField:"",...this.getArguments(e)},i=f.getSelectedStateFromKeyDown({event:s,selectedState:t!=null?t:{},dataItemKey:this.$props.dataItemKey});if(i===t)return;const o=e.target,n=f.closestTagName(o,"TD"),r=f.closestTagName(o,"TR"),d=f.getColumnIndex(n),c=f.getRowIndex(r);if(d!==void 0&&c!==void 0){const p=(u=$.getDataAsArray(this.$props.dataItems))==null?void 0:u[c];this.gridStateContext.selectionchange({...s,select:i,dataItem:p,startRowIndex:c,startColIndex:d,startDataItem:p,endDataItem:p,endRowIndex:c,endColIndex:d,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey,isDrag:!1})}},onHeaderSelectionChangeHandler(e){if(this.computedSelectable.enabled){const t=this.getLeafDataItems();this.gridStateContext.headerselectionchange({select:e.event.target.checked?t.reduce((s,i)=>(this.$props.dataItemKey&&l.getter(this.$props.dataItemKey)(i)!==void 0&&(s[l.getter(this.$props.dataItemKey)(i)]=!0),s),{}):{},field:e.field,event:e.event,target:this,dataItems:t})}},selectionRelease(e){var t,s,i;if(this.computedSelectable.enabled){const o=this.getLeafDataItems(),n=o[e.startRowIndex],r=o[e.endRowIndex],d={event:void 0,target:this,selectedField:"",componentId:this.$props.id||this._gridId,dataItems:o,dataItem:null,startDataItem:n,endDataItem:r,...e},c=f.getSelectedState({event:d,selectedState:(i=(s=this.$props.select)!=null?s:(t=this.gridStateContext.select)==null?void 0:t.value)!=null?i:{},dataItemKey:this.$props.dataItemKey});this.raiseSelectionEvent(d,c)}},clearSelection(e){this.computedSelectable.enabled&&this.raiseSelectionEvent(e,{})},raiseSelectionEvent(e,t){this.computedSelectable.enabled&&this.gridStateContext.selectionchange({...e,select:t})},moveToNextPage(e){var o,n,r,d;const t=(r=(n=(o=this.gridStateContext.take)==null?void 0:o.value)!=null?n:this.$props.pageSize)!=null?r:0,s=(((d=this.gridStateContext.skip)==null?void 0:d.value)||0)+t,i=this.getTotal();s<i&&this.pageChangeHandler({skip:s,take:t},e)},moveToPrevPage(e){var i,o,n,r;const t=(n=(o=(i=this.gridStateContext.take)==null?void 0:i.value)!=null?o:this.$props.pageSize)!=null?n:0,s=(((r=this.gridStateContext.skip)==null?void 0:r.value)||0)-t;s>=0&&this.pageChangeHandler({skip:s,take:t},e)},pageChangeHandler(e,t){this.raiseDataEvent("pagechange",{page:e,event:t},{skip:e.skip,take:e.take},t)},sortChangeHandler(e,t){this.raiseDataEvent("sortchange",{sort:e},{sort:e},t)},filterChangeHandler(e,t){this.raiseDataEvent("filterchange",{filter:e},{filter:e,skip:0},t)},groupChangeHandler(e,t){this.raiseDataEvent("groupchange",{group:e},{group:e,skip:0},t)},handleDetailExpandAction(e,t){var s;if(this.detailExpandable.enabled){const i=(s=this.gridStateContext.detailExpand)==null?void 0:s.value,o=f.detailExpandReducer(i!=null?i:{},e);this.gridStateContext.detailexpandchange({...this.getArguments(t),detailExpand:o})}},handleGroupExpandAction(e,t){var s;if(this.groupExpandable.enabled){const i=(s=this.gridStateContext.groupExpand)==null?void 0:s.value,o=f.groupExpandReducer(i!=null?i:[],e,this.groupExpandable);this.$props.expandField||this.gridStateContext.groupexpandchange({...this.getArguments(t),groupExpand:o})}this.scrollToStickyGroup(e.group)},raiseDataEvent(e,t,s,i){if(this.resetVirtualSkip(),this.$props.autoProcessData)this.gridStateContext[e]({...this.getArguments(i),...t});else if(l.hasListener.call(this,e))this.$emit(e,{...this.getArguments(i),...t});else if(l.hasListener.call(this,"datastatechange")){const o={...this.getDataState(),...s};this.gridStateContext.datastatechange({...this.getArguments(i),data:o,dataState:o})}},columnReorder(e,t,s){const i=this.columnsRef[e],o=$.getFlatColumnsState(this.currentColumnsState),n=i.depth,r=u=>{do u++;while(u<this.columnsRef.length&&this.columnsRef[u].depth>n);return u},d=this.columnsRef.splice(e,r(e)-e);this.columnsRef.splice(e<t?r(t-d.length):t,0,...d),this.columnsRef.filter(u=>u.declarationIndex>=0).forEach((u,p)=>{u.orderIndex=p;const m=o.find(R=>R.id===u.id);m&&(m.orderIndex=p)});const c=this.columnsRef[e].locked&&this.columnsRef[t].locked;f.updateLeft(this._columnsMap,this.columnsRef,c||this.shouldUpdateLeftRightRef),f.updateRight(this._columnsMap,this.columnsRef,c||this.shouldUpdateLeftRightRef),this.resizedRef&&(this.shouldUpdateLeftRightRef=!1,this.resizedRef=!1);const g=this.getColumns();this.$emit("columnreorder",{target:this,columns:g,event:s,prev:e,next:t}),this.gridStateContext.columnsstatechange({columnsState:this.currentColumnsState})},groupReorder(e,t,s){var o;const i=(o=this.gridStateContext.group)==null?void 0:o.value;i!==void 0&&(i.splice(t,0,...i.splice(e,1)),this.groupChangeHandler(i,s))},columnToGroup(e,t,s){var n;const i=this.columnsRef[e].field;if(!i)return;const o=(((n=this.gridStateContext.group)==null?void 0:n.value)||[]).slice();o.splice(t,0,{field:i}),this.groupChangeHandler(o,s)},resetTableWidth(){var i;let e=0;if(!this.columnResize.colGroupMain)return;const t=(i=this.columnResize.colGroupMain)==null?void 0:i.children;for(let o=0;o<t.length;o++){const n=t[o].width;if(!n)return;e+=parseFloat(n.toString())}e=Math.round(e),this._header&&this._header.setWidth(e),this._footer&&this._footer.setWidth(e),this.stickyHeaderRef&&this.stickyHeaderRef.setWidth(e),this.stickyFooterRef&&this.stickyFooterRef.setWidth(e),this.pinnedTopRef&&this.pinnedTopRef.setWidth(e),this.pinnedBottomRef&&this.pinnedBottomRef.setWidth(e);const s=l.getComponentElementRef(this,"table");s&&e&&(s.style.width=e+"px"),this.stickyFooterRef&&this.setStickyFooterOffset()},setStickyFooterOffset(){const e=this.containerElementRef,t=e?e.scrollWidth>e.clientWidth:!1;this.stickyFooterRef&&(this.stickyFooterRef.$el.style.marginBlockEnd=t?"var(--kendo-scrollbar-width, 0px)":"")},onResize(e,t,s,i,o,n,r){this.resetTableWidth(),this.shouldUpdateLeftRightRef=!0,this.resizedRef=!0,this.$emit("columnresize",{columns:this.getColumns(),index:e,targetColumnId:r,event:i,newWidth:t,oldWidth:s,end:o,target:this}),o&&this.gridStateContext.columnsstatechange({columnsState:n})},initColumnsState(e,t){const s=i=>{var n;const o=t.find(r=>r.id===i.id);if(o){const r={...o};return r.children=(n=i.children)==null?void 0:n.map(s),r}return i};this.currentColumnsState=e.filter(i=>i.parentIndex===-1).map(s)},configureColumns(e,t){e.filter(n=>n.columnType==="checkbox").forEach(n=>{n.width=n.width||"50px",n.defaultCell=a.markRaw(Pe.GridSelectionCell),n.defaultHeaderCell=a.markRaw(ze.GridHeaderSelectionCell),n._type="edit",n.columnMenu=!1}),this.$props.selectedField&&this.columnsRef.filter(n=>n.field===this.$props.selectedField).forEach(n=>{n.width=n.width||"50px",n.defaultCell=a.markRaw(Pe.GridSelectionCell),n.defaultHeaderCell=a.markRaw(ze.GridHeaderSelectionCell),n.columnMenu=!1}),this.$props.pinnable&&e.filter(n=>n.columnType==="pin").forEach(n=>{n.width=n.width||"48px",n.defaultCell=a.markRaw(St.GridPinCell),n.defaultHeaderCell=a.markRaw(f.HeaderCell),n.sortable=!1,n.filterable=!1,n.editable=!1});const s=$.getFlatColumnsState(this.currentColumnsState);this.initColumnsState(e,s);const i={id:"",resizable:!0,width:"32px",title:" ",declarationIndex:-1,orderIndex:-1,children:[],parentIndex:-1,depth:0,colSpan:0,headerColSpan:0,rowSpan:0,left:0,right:0,index:0,rightBorder:!1,ariaColumnIndex:0,isAccessible:!0};let o=0;if(this.detailExpandable.enabled&&this.$props.detail&&!this.$props.expandField){const n={...i,_type:"expand",id:f.tableKeyboardNavigationTools.generateNavigatableId(`${o++}`,"expand","column"),defaultCell:a.markRaw(De.GridHierarchyCell),field:this.detailExpandable.column,headerClassName:this.hierarchClass};e.unshift(n),this.currentColumnsState.unshift(s.find(r=>r.id===n.id)||n)}this.$props.expandField&&l.hasListener.call(this,"expandchange")&&this.$props.detail&&(e.unshift({...i,defaultCell:a.markRaw(De.GridHierarchyCell),field:this.$props.expandField,headerClassName:"k-hierarchy-cell k-header",id:f.tableKeyboardNavigationTools.generateNavigatableId(`${e.length}`,this.idPrefix,"column"),...this.expandColumn}),o++);for(let n=0;n<t;n++){const r={...i,isAccessible:!1,defaultCell:a.markRaw(Ve.GridGroupCell),id:f.tableKeyboardNavigationTools.generateNavigatableId(`${o++}`,"group","column"),field:"value",locked:this.$props.lockGroups,columnMenu:!1};e.unshift(r),this.currentColumnsState.unshift(s.find(d=>d.id===r.id)||r)}e.slice(o).forEach(n=>{n.parentIndex>=0&&(n.parentIndex+=o),n.rowSpannable=n.rowSpannable!==void 0?$.getRowSpanOptions(n.rowSpannable):this.computedRowSpannable})},initColumns(e,t){var n;this.columnsRef=this.readColumnElements();const s=(n=this.gridStateContext.group)==null?void 0:n.value;this.columnsRef.filter(r=>!r.hidden).length===0&&(this.columnsRef=$.autoGenerateColumns(e,s,{column:this.$props.expandField?this.$props.expandField:this.groupExpandable.column},{prevId:0,idPrefix:this.idPrefix})),this.configureColumns(this.columnsRef,t);const[i,o]=this.filterColumns(this.columnsRef);this.columnsRef=i,this.hiddenColumnsRef=o,this._columnsMap=$.mapColumns(this.columnsRef,!0)},resolveTitle(e){const t=this.findColumnByField(e),s=t&&(t.title||t.field);return s===void 0?e:s},findColumnByField(e){let t;return this.$props.columns.forEach(s=>{const i=this.searchColumn(s,e);i&&(t=i)}),t},searchColumn(e,t){if(e.field===t)return e;if(e.children){let s,i=null;for(s=0;i==null&&s<e.children.length;s++)i=this.searchColumn(e.children[s],t);return i}return null},getDataState(){var n,r,d,c,g;const e=(n=this.gridStateContext.sort)==null?void 0:n.value,t=(r=this.gridStateContext.filter)==null?void 0:r.value,s=(d=this.gridStateContext.skip)==null?void 0:d.value,i=(c=this.gridStateContext.take)==null?void 0:c.value,o=(g=this.gridStateContext.group)==null?void 0:g.value;return{filter:t,sort:e,skip:s,take:i!==void 0?i:this.$props.pageSize,group:o}},getArguments(e){return{event:e,target:this}},getLeafDataItems(){return this.dataRef.filter(e=>e.rowType==="data").map(e=>e.dataItem)},totalGroupedRows(e){let t=0;return e&&(t=this.addSubItems(e,t)),t},addSubItems(e,t){return e.forEach(s=>{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++}),t},searchChange(e){const t=this.$props.searchFields||this.columnsRef.map(o=>o.field)||[],s=e.event.target.value,i={logic:"or",filters:t.filter(o=>o!==void 0).map(o=>{var n;return typeof o=="string"?{field:o,value:s,operator:"contains"}:{value:s,operator:(n=o.operator)!=null?n:"contains",field:o.field,ignoreCase:o.ignoreCase}})};this.raiseDataEvent("searchchange",{search:i},{skip:0},e)},getCellsToRender(e,t){var n;const s=[];let i=null,o=0;if(t.forEach((r,d)=>{const c=parseFloat((r.width||"").toString())||10;if(o){o--,i&&(i.width+=c);return}const g=Math.min($.getColSpan(r,e),t.length-d);o=g-1,i={width:c,colSpan:g,columnIndex:d},s.push(i)}),this.$props.columnVirtualization){const r=this.scrollLeftRef||0,d=this.tableWidth||parseFloat((((n=this.$attrs.style)==null?void 0:n.width)||"").toString());return Rt.getVirtualCellsToRender({cellModels:s,columns:t,tableViewPortWidth:d,scrollLeft:r})}return s},calcVirtualPageSize(){const{pageable:e,take:t,pageSize:s}=this.$props;if(!this.isVirtualScroll)return 0;if(!e){if(t)return t;if(s)return s}const i=this.$props.rowHeight||this._minRowHeightRef,o=this._containerHeightRef;return o&&i?Math.ceil(o/i*1.5):0},getRowPinPosition(e){var n,r;const{dataItemKey:t=""}=this.$props,s=((n=this.gridStateContext.pinnedTopRows)==null?void 0:n.value)||[],i=((r=this.gridStateContext.pinnedBottomRows)==null?void 0:r.value)||[];if(!t||!e)return"none";const o=e[t];return s!=null&&s.some(d=>d[t]===o)?"top":i!=null&&i.some(d=>d[t]===o)?"bottom":"none"},handleRowPin(e,t){var g,u,p,m;if(!this.$props.pinnable)return;const{dataItemKey:s=""}=this.$props,i=((g=this.gridStateContext.pinnedTopRows)==null?void 0:g.value)||[],o=((u=this.gridStateContext.pinnedBottomRows)==null?void 0:u.value)||[],n=t[s],r=i.filter(R=>R[s]!==n),d=o.filter(R=>R[s]!==n);let c;switch(e){case"pinTop":c={pinnedTopRows:[...r,t],pinnedBottomRows:d,dataItem:t};break;case"pinBottom":c={pinnedTopRows:r,pinnedBottomRows:[...d,t],dataItem:t};break;case"unpin":c={pinnedTopRows:r,pinnedBottomRows:d,dataItem:t};break;default:return}(m=(p=this.gridStateContext).rowpinchange)==null||m.call(p,c)},pinnedSelectionRelease(e,t){const s=this.$props.dataItemKey;if(!s||!t)return;const i=l.getter(s),o=this.getLeafDataItems().findIndex(n=>i(n)===i(t));o!==-1&&this.selectionRelease({...e,startRowIndex:o,endRowIndex:o})}},provide(){return{gridContext:{dataItemKey:this.$props.dataItemKey,searchChange:this.searchChange,selectionRelease:this.selectionRelease,pinnedSelectionRelease:this.pinnedSelectionRelease,dispatchGroupExpand:this.handleGroupExpandAction,dispatchDetailExpand:this.handleDetailExpandAction,scrollToStickyGroup:this.scrollToStickyGroup,getCellPositionStyle:this.getCellPositionStyle,onRowPin:this.handleRowPin,getRowPinPosition:this.getRowPinPosition,onContextMenu:this.triggerCellContextMenu,exportAsCsv:this.exportAsCsv},sticky:this.sticky}},setup(e){const t=a.ref(null),s=a.ref(null),i=a.ref(null),o=a.ref(null),n=a.ref(null),r=a.ref(null),d=a.ref(null),c=a.ref([]),g=a.ref([]),u=a.ref(null),p=a.ref(null),m=a.ref(null),R=a.ref(null),x=a.ref(null),b=a.ref(null),w=a.ref(null),I=a.ref(!0),k=a.ref(!1),S=new dt.VirtualScroll,T=a.ref(0),F=a.inject(mt.KendoKey,{}),j=typeof e.groupable=="object"&&!!e.groupable.stickyHeaders,M=typeof e.groupable=="object"&&!!e.groupable.stickyFooters,L=a.ref([]),K=a.computed(()=>{var q,E;return!!((E=(q=F.group)==null?void 0:q.value)!=null&&E.length)}),G=null,H=a.ref(void 0),_=a.ref({headerItems:[],footerItems:[]}),{scrollToStickyGroup:A,update:B}=bt.useStickyGroups({enabled:j,enabledFooters:M,flatData:L,containerRef:u,stickyHeaderRef:p,stickyFooterRef:m,tableBodyRef:b,rowHeight:e.rowHeight,isGrouped:K,virtualSkipRef:T,rowHeightServiceRef:a.computed(()=>S==null?void 0:S.rowHeightService)});return{rowIndexRef:H,observerRef:G,dataRef:L,groupPanelDivRef:t,dropElementClueRef:s,dragElementClueRef:i,headerRef:o,footerRef:n,gridNavRef:r,colGroupRef:d,scrollContainerRef:u,tableBodyRef:b,gridStateContext:F,shouldUpdateLeftRightRef:I,resizedRef:k,currentColumnsState:e.columnsState,vsRef:S,virtualSkipRef:T,stickyHeaderItems:c,stickyHeaderRef:p,stickyFooterItems:g,stickyFooterRef:m,pinnedTopRef:R,pinnedBottomRef:x,csvExportRef:w,sticky:_,scrollToStickyGroup:A,updateStickyGroups:B}},render(){var ue,fe,ge,me,Re,Ce,be,Se,ve,xe,Ie,$e,we,ye,ke,He,Te,Me;const e=(ue=this.gridStateContext.sort)==null?void 0:ue.value,t=(fe=this.gridStateContext.filter)==null?void 0:fe.value,s=(ge=this.gridStateContext.search)==null?void 0:ge.value,i=(me=this.gridStateContext.select)==null?void 0:me.value,o=(Re=this.gridStateContext.skip)==null?void 0:Re.value,n=(Ce=this.gridStateContext.take)==null?void 0:Ce.value,r=(be=this.gridStateContext.group)==null?void 0:be.value,d=(Se=this.gridStateContext.groupExpand)==null?void 0:Se.value,c=(ve=this.gridStateContext.detailExpand)==null?void 0:ve.value,g=(r==null?void 0:r.length)||0,u=typeof this.$props.groupable=="object"&&!!this.$props.groupable.stickyHeaders,p=typeof this.$props.groupable=="object"&&!!this.$props.groupable.stickyFooters,m=!!(r!=null&&r.length);let R;this.currentColumnsState=(xe=this.gridStateContext.columnsState)==null?void 0:xe.value;const x=this.$props.autoProcessData===!0?{group:!0,sort:!0,filter:!0,search:!0,page:!0}:this.$props.autoProcessData;let b;const w=f.tableKeyboardNavigationTools.getIdPrefix(this.navigation);let I=[];Array.isArray(this.$props.dataItems)?(I=this.$props.dataItems,b=(Ie=this.$props.total)!=null?Ie:I.length):(I=(($e=$.applyExpandedState(this.$props.dataItems,this.$props.collapsedGroups.length?this.computedCollapsed:[],this.$props.uniqueField))==null?void 0:$e.data)||[],b=(ke=(ye=this.$props.total)!=null?ye:(we=this.$props.dataItems)==null?void 0:we.total)!=null?ke:I.length);const k=this.$props.groupable===!0||l.isObject(this.$props.groupable)&&this.$props.groupable.enabled!==!1;this.dragLogic.reorderable=this.$props.reorderable||!1,this.dragLogic.groupable=k,this._virtualPageSize=this.calcVirtualPageSize();const S=I.length===b,T=l.isObject(this.$props.groupable)&&this.$props.groupable.footer||"none";if(x){const h=x.page&&!(this.isVirtualScroll&&!this.$props.pageable),{data:v,total:y}=re.process(I,{group:x.group?r:void 0,sort:x.sort?e:void 0,filter:f.combineFilters(x.filter?t:void 0,x.search?s:void 0),...h?{take:this.$props.pageable?n||10:n,skip:o||0}:{}});I=v,b=(He=this.$props.total)!=null?He:y}const{resolvedGroupsCount:F,flattedData:j}=this.getFlatData(I,T,S?0:this.$props.skip||0,r,c,d,this.$props.dataItemKey);this.dataRef=j;const M=this.virtualSkipRef||0;if(this._virtualTotal=b,this.isVirtualScroll){let h=o||0;if((m||this.$props.pageable)&&(h=M,this._virtualTotal=this.dataRef.length),S||m||this.$props.pageable)if(this._virtualPageSize===0){const v=Math.min(n||this.$props.pageSize||20,this.dataRef.length);R=this.dataRef.slice(h,h+v)}else R=this.dataRef.slice(h,h+this._virtualPageSize)}this.initializeVirtualization();const L=(Te=this.selectable)!=null&&Te.drag?"none":void 0;this.initColumns(this.$props.dataItems,F),this.columnResize.resizable=this.$props.resizable||!1,this.columnResize.columns=this.columnsRef,this.columnResize.columnsState=l.cloneArray(this.currentColumnsState||[]),this.dragLogic.columns=this.columnsRef;const K=this.$props.toolbar,G=this.$props.noRecords,H=this.columnsRef.filter(h=>h.children.length===0),_=k&&a.createVNode(ot.GroupPanel,{ref:h=>{this.groupPanelDivRef=h},group:r||[],ariaControls:this._gridRoleElementId,onGroupChange:this.groupChangeHandler,onPressHandler:this.dragLogic.pressHandler,onDragHandler:this.dragLogic.dragHandler,onReleaseHandler:this.dragLogic.releaseHandler,resolveTitle:this.resolveTitle},null),A=(this.dragLogic.reorderable||this.dragLogic.groupable)&&l.canUseDOM&&document&&document.body,B=[A&&a.createVNode(ut.DropClue,{ref:h=>{this.dropElementClueRef=h}},null),A&&a.createVNode(pt.DragClue,{ref:h=>{this.dragElementClueRef=h}},null)],q=this.showLicenseWatermark?a.createVNode(l.WatermarkOverlay,{message:this.licenseMessage},null):null,E=this.$attrs.style,Be=E&&l.isObject(E)&&E["width"]||"";this.tableWidth=parseFloat(Be.toString());const qe=H.findIndex(h=>typeof h.colSpan=="function")>-1;let O;O=this.getCellsToRender({},H);const P=H.map(function(h,v){return a.createVNode("col",{key:h.id||`col-${v}`,width:h.width!==void 0?Math.floor(parseFloat(h.width.toString())):void 0},null)},this),ae=a.createVNode(tt.Header,{size:this.$props.size,columnResize:this.columnResize,staticHeaders:this.$props.scrollable!=="none",ref:h=>{this.headerRef=h},onHeaderscroll:this.onHeaderScroll,headerRow:a.createVNode(st.HeaderRow,{grid:this,sort:e,groupable:this.$props.groupable,reorderable:this.$props.reorderable,sortable:this.$props.sortable,onSortChange:this.sortChangeHandler,filter:t,filterable:this.$props.filterable,filterOperators:this.$props.filterOperators||Ne.operators,onFilterChange:this.filterChangeHandler,columnMenu:this.$props.columnMenu,columnMenuIcon:this.$props.columnMenuIcon,columnMenuAnimate:this.$props.columnMenuAnimate,onSelectionchange:this.onHeaderSelectionChangeHandler,columns:this.columnsRef,cellsToRender:O,columnVirtualization:this.$props.columnVirtualization,columnsInitial:this.$props.columns,columnResize:this.columnResize,onPressHandler:this.dragLogic.pressHandler,onDragHandler:this.dragLogic.dragHandler,onReleaseHandler:this.dragLogic.releaseHandler,columnsMap:this._columnsMap,cellRender:this.$props.headerCellRender,cells:this.$props.cells,isRtl:this.isRtl,isColCountDefined:this.getAriaColCount!==void 0,headerSelectionValue:!!(i&&this.dataRef.filter(h=>h.rowType==="data").every(h=>i&&this.$props.dataItemKey&&l.getter(this.$props.dataItemKey)(h.dataItem)!==void 0?i[l.getter(this.$props.dataItemKey)(h.dataItem)]:void 0)),filterRow:this.$props.filterable&&a.createVNode(it.FilterRow,{grid:this,size:this.$props.size,columns:this.columnsRef,columnsMap:this._columnsMap,cellsToRender:O,columnVirtualization:this.$props.columnVirtualization,filter:t,filterOperators:this.$props.filterOperators||Ne.operators,onFilterchange:this.filterChangeHandler,sort:this.$props.sort,cellRender:this.$props.filterCellRender,cells:this.$props.cells,isRtl:this.isRtl,ariaRowIndex:this._columnsMap.length+1},null)||void 0},null),cols:P},null),le=this.columnsRef.some(h=>{var v;return!!(h.footerCell||(v=h.cells)!=null&&v.footerCell)})||(Me=this.$props.cells)!=null&&Me.footerCell?a.createVNode(nt.Footer,{size:this.$props.size,columnResize:this.columnResize,staticHeaders:this.$props.scrollable!=="none",ref:h=>{this.footerRef=h},row:a.createVNode(rt.FooterRow,{isRtl:this.isRtl,rowIndex:this.getAriaRowCount+1,columns:this.columnsRef,cells:this.$props.cells},null),cols:P},null):a.createVNode("span",null,null),V={leafColumns:H,cellsToRender:O,selectedField:this.$props.selectedField,dataItemKey:this.$props.dataItemKey,select:i,highlight:this.$props.highlight,editField:this.$props.editField,cellRender:this.$props.cellRender,cells:this.$props.cells,getCellsToRender:this.getCellsToRender,hasDynamicColSpan:qe,itemChange:this.itemChange,selectionChangeHandler:this.selectionChangeHandler,editHandler:this.editHandler,removeHandler:this.removeHandler,saveHandler:this.saveHandler,cancelHandler:this.cancelHandler,cellClickHandler:this.cellClickHandler,cellKeydownHandler:this.cellKeydownHandler,computedCollapsed:this.computedCollapsed,uniqueField:this.$props.uniqueField,columnsRef:this.columnsRef,isRtl:this.isRtl,idPrefix:w},Oe=function(h,v,y,Z,ee){return Ct.getRowContents(V,h,v,y,Z,ee)};let We=0,J=[];const Q=!this.dataRef.length,de=h=>h>=this.dataRef.length-We;let X=0;if(this.dataRef.length){const h=this._columnsMap.length+(this.$props.filterable?1:0)+1;let v=this.$props.skip||0,y=-1,Z=0;const ee=this.computedRowSpannable.enabled?{}:void 0;if(this.isVirtualScroll){if(M>0){const C=this.dataRef.slice(0,M).filter(z=>z.rowType==="data").length;y+=C,v+=M}!this.$props.pageable&&S&&(y+=this.$props.skip||0)}J=(R||this.dataRef).map(function(C,z){C.rowType==="data"&&y++;const te=C.dataIndex%2!==0,Ge=this.$props.dataItemKey&&l.getter(this.$props.dataItemKey)(C.dataItem),se=z+v,ie=Ge||"ai"+se,oe=ie+"_1",W=Oe.call(this,C,ie,y,te,ee),Qe=C.rowType==="data"?this.pinnedSourceSet.has(C.dataItem):!1,Xe=H.length-(this.detailExpandable.enabled?1:0)-((r==null?void 0:r.length)||0)||1;return X=se+h+Z,[a.createVNode(ft.GridRow,{key:ie,item:C,dataIndex:y,ariaRowIndex:X,absoluteRowIndex:se,isAltRow:te,isHidden:de(z),rowHeight:this.$props.rowHeight,isSelected:W.isSelected,isHighlighted:W.isHighlighted,isInEdit:W.isInEdit,rowType:C.rowType,onRowclick:D=>this.rowClick(D,C),onRowdblclick:D=>this.rowDoubleClick(D,C),render:this.$props.rowRender,class:this.$props.rowClass?this.$props.rowClass(C):"",isPinned:Qe,rows:this.$props.rows},{default:()=>[W.row]}),this.$props.detail&&C.rowType==="data"&&(C.expanded||C.dataItem.expanded)&&a.createVNode("tr",{key:oe,class:te?"k-table-row k-table-alt-row k-detail-row":"k-table-row k-detail-row",style:{visibility:de(z)?"hidden":"",height:this.$props.detailRowHeight+"px"},role:"row","aria-rowindex":X},[r==null?void 0:r.map(function(D){return a.createVNode(Ve.GridGroupCell,{id:"",dataIndex:C.dataIndex,field:D.field,dataItem:C.dataItem,key:`group-${D.field}-${C.dataIndex}`,locked:this.$props.lockGroups,group:C.group},null)},this),(this.$props.expandField||this.detailExpandable.enabled)&&a.createVNode(Ze.GridDetailHierarchyCell,{id:f.tableKeyboardNavigationTools.generateNavigatableId(`${oe}-dhcell`,w)},null),a.createVNode(et.GridDetailCell,{dataItem:C.dataItem,dataIndex:C.dataIndex,colSpan:Xe,ariaColIndex:2+(r?r.length:0),detail:this.$props.detail?this.$props.detail:void 0,id:f.tableKeyboardNavigationTools.generateNavigatableId(`${oe}-dcell`,w)},null)])]},this)}const Ue=this.$props.pageable&&a.createVNode(f.Pager,{class:"k-grid-pager",onPagesizechange:this.pageChangeHandler,onPagechange:this.pageChangeHandler,size:this.$props.size,total:b,skip:o||0,pageSize:(n!==void 0?n:this.$props.pageSize)||10,messagesMap:Ke.pagerMessagesMap,settings:f.normalize(this.$props.pageable||{})},null),he=l.getTemplate.call(this,{h:a.h,template:this.$props.pager,defaultRendering:Ue,additionalProps:{...this.$props,skip:this.$props.skip||0,messagesMap:Ke.pagerMessagesMap},additionalListeners:{pagesizechange:this.pageChangeHandler,pagechange:this.pageChangeHandler}}),je=h=>e&&e.filter(v=>v.field===h).length>0,ce=a.createVNode("colgroup",{ref:l.setRef(this,"colGroup")},[H.map(function(h,v){return a.createVNode("col",{key:h.id||`col-${v}`,class:je(h.field)?"k-sorted":void 0,width:h.width!==void 0?h.width.toString().indexOf("%")!==-1?h.width:Math.floor(parseFloat(h.width.toString()))+"px":void 0},null)},this)]),pe={height:this.getCorrectHeight,...this.$attrs.style},Je=a.createVNode("div",{class:"k-loading-mask"},[a.createVNode("div",{class:"k-loading-color"},null),a.createVNode("div",{style:{height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},[a.createVNode(Ye.Loader,{size:"large",type:"converging-spinner"},null)])]),Y=this.$props.showLoader&&l.getTemplate.call(this,{h:a.h,template:this.$props.loader,defaultRendering:Je});return this.$props.scrollable==="none"?a.createVNode(a.Fragment,null,[a.createVNode(f.TableKeyboardNavigationProvider,{ref:"navRef",id:this._gridId,navigatable:this.$props.navigatable,scrollable:this.$props.scrollable,columnVirtualization:this.$props.columnVirtualization},{default:()=>[a.createVNode(Ee.GridNav,{ref:h=>{this.gridNavRef=h},columnsRef:this.columnsRef,dataRef:this.dataRef,id:this.$props.id,dir:this.$props.dir,style:pe,class:this.nonscrollableWrapperClass,onMovetonextpage:this.moveToNextPage,onMovetoprevpage:this.moveToPrevPage,onColumnreorder:this.columnReorder,onKeyboardselectionchange:this.onKeyboardSelectionChangeHandler,onNavigationaction:this.navigationActionHandler},{default:()=>[K,_,a.createVNode("div",{role:"grid",class:"k-grid-aria-root",id:this._gridRoleElementId,"aria-colcount":this.getAriaColCount,"aria-rowcount":this.getAriaRowCount},[a.createVNode(at.GridTable,{selectable:this.computedSelectable,class:"k-table",ref:l.setRef(this,"table")},{default:()=>[ce,ae,a.createVNode("tbody",{class:"k-table-tbody","data-keyboardnavbody":!0,ref:l.setRef(this,"tableBody")},[J,a.createTextVNode(" "),Y]),le]}),Q&&a.createVNode(Le.GridNoRecordsContainer,{id:f.tableKeyboardNavigationTools.generateNavigatableId("no-records",w)},{default:()=>[G.length?G:a.createVNode(Fe.GridNoRecords,null,null)]})]),he,Y,B]})]}),this.renderContextMenu()]):a.createVNode(a.Fragment,null,[a.createVNode(f.TableKeyboardNavigationProvider,{ref:"navRef",id:this._gridId,navigatable:this.$props.navigatable,scrollable:this.$props.scrollable,columnVirtualization:this.$props.columnVirtualization},{default:()=>[a.createVNode(Ee.GridNav,{ref:h=>{this.gridNavRef=h},dataRef:this.dataRef,id:this.$props.id,dir:this.$props.dir,style:pe,class:this.scrollableWrapperClass,onMovetonextpage:this.moveToNextPage,onMovetoprevpage:this.moveToPrevPage,onColumnreorder:this.columnReorder,onKeyboardselectionchange:this.onKeyboardSelectionChangeHandler,onSetcurrentontop:this.setCurrentOnTop,onNavigationaction:this.navigationActionHandler},{default:()=>[K,_,a.createVNode("div",{role:"grid",class:"k-grid-aria-root",id:this._gridRoleElementId,"aria-colcount":this.getAriaColCount,"aria-rowcount":this.getAriaRowCount},[ae,this.hasPinnedTopRows&&a.createVNode(Ae.PinnedRowsTable,{ref:l.setRef(this,"pinnedTop"),size:this.$props.size,cols:P,dataRowContext:V,position:"top",pinnedItems:this.sortedPinnedTopRows,rowHeight:this.$props.rowHeight,rows:this.$props.rows,selectable:this.computedSelectable},null),a.createVNode("div",{class:"k-grid-container",role:"presentation"},[m&&u&&a.createVNode(_e.StickyGroupTable,{ref:l.setRef(this,"stickyHeader"),size:this.$props.size,cols:P,dataRowContext:V,position:"top",groupLevelCount:g,rowHeight:this.$props.rowHeight},null),a.createVNode("div",{role:"presentation",ref:l.setRef(this,"scrollContainer"),class:"k-grid-content k-virtual-content",onScroll:this.scrollHandler},[a.createVNode("div",{class:"k-grid-table-wrap",role:"presentation"},[a.createVNode(lt.GridTableScrollable,{selectable:this.computedSelectable,tableClassName:this.gridTableClass,tableStyle:{userSelect:L},ref:l.setRef(this,"table")},{default:()=>[ce,a.createVNode("tbody",{class:"k-table-tbody",role:"rowgroup","data-keyboardnavbody":!0,ref:l.setRef(this,"tableBody")},[J])]}),Q&&a.createVNode(Le.GridNoRecordsContainer,{id:f.tableKeyboardNavigationTools.generateNavigatableId("no-records",w)},{default:()=>[G.length?G:a.createVNode(Fe.GridNoRecords,null,null)]})]),!Q&&a.createVNode("div",{class:"k-height-container",role:"presentation"},[a.createVNode("div",{ref:l.setRef(this,"scrollHeightContainer"),style:this.$props.scrollable==="virtual"?{height:this._containerHeightRef+"px"}:{}},null)])]),m&&p&&a.createVNode(_e.StickyGroupTable,{ref:l.setRef(this,"stickyFooter"),size:this.$props.size,cols:P,dataRowContext:V,position:"bottom",groupLevelCount:g,rowHeight:this.$props.rowHeight},null)]),this.hasPinnedBottomRows&&a.createVNode(Ae.PinnedRowsTable,{ref:l.setRef(this,"pinnedBottom"),size:this.$props.size,cols:P,dataRowContext:V,position:"bottom",pinnedItems:this.sortedPinnedBottomRows,rowHeight:this.$props.rowHeight,rows:this.$props.rows,selectable:this.computedSelectable},null),le,q]),he,Y,B]})]}),this.renderContextMenu(),this.$props.csv&&a.createVNode(vt.BaseCSVExport,{ref:h=>{this.csvExportRef=h},gridProps:this.$props,csv:this.$props.csv,fileName:typeof this.$props.csv=="object"?this.$props.csv.fileName:void 0,onCsvexport:this.$props.onCsvexport,columnsState:this.currentColumnsState},null)])}});exports.Grid=xt;
|