@progress/kendo-vue-grid 8.1.0-develop.1 → 8.1.0-develop.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Grid.d.ts +56 -5
- package/Grid.js +1 -1
- package/Grid.mjs +667 -649
- package/GridNav.d.ts +24 -4
- package/GridNav.js +1 -1
- package/GridNav.mjs +62 -22
- package/GridState.d.ts +4 -0
- package/RootGrid.d.ts +32 -11
- package/RootGrid.js +1 -1
- package/RootGrid.mjs +96 -57
- package/cells/GridCell.js +1 -1
- package/cells/GridCell.mjs +35 -26
- package/cells/GridGroupCell.d.ts +10 -0
- package/cells/GridGroupCell.js +1 -1
- package/cells/GridGroupCell.mjs +95 -53
- package/columnMenu/GridColumnMenuCheckboxFilter.d.ts +1 -1
- package/columnMenu/GridColumnMenuCheckboxFilter.js +1 -1
- package/columnMenu/GridColumnMenuCheckboxFilter.mjs +11 -11
- package/common.d.ts +2 -0
- package/common.js +1 -1
- package/common.mjs +2 -0
- package/components/StickyGroupTable.d.ts +85 -0
- package/components/StickyGroupTable.js +8 -0
- package/components/StickyGroupTable.mjs +113 -0
- package/dist/cdn/js/kendo-vue-grid.js +1 -1
- package/drag/ColumnResize.d.ts +10 -1
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +129 -104
- package/drag/GroupingIndicator.d.ts +1 -0
- package/drag/GroupingIndicator.js +1 -1
- package/drag/GroupingIndicator.mjs +28 -18
- package/footer/FooterCell.d.ts +43 -0
- package/footer/FooterCell.js +8 -0
- package/footer/FooterCell.mjs +68 -0
- package/footer/FooterRow.d.ts +5 -6
- package/footer/FooterRow.js +1 -1
- package/footer/FooterRow.mjs +16 -39
- package/getRowContents.d.ts +85 -0
- package/getRowContents.js +8 -0
- package/getRowContents.mjs +172 -0
- package/header/GridHeaderGroupSpacerCell.d.ts +11 -0
- package/hooks/useStickyGroups.d.ts +72 -0
- package/hooks/useStickyGroups.js +8 -0
- package/hooks/useStickyGroups.mjs +350 -0
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +74 -73
- package/interfaces/GridCellProps.d.ts +4 -0
- package/interfaces/GridCellsSettings.d.ts +320 -0
- package/interfaces/GridColumnProps.d.ts +11 -1
- package/interfaces/GridGroupableSettings.d.ts +23 -0
- package/interfaces/GridProps.d.ts +33 -0
- package/messages/main.d.ts +5 -0
- package/messages/main.js +2 -2
- package/messages/main.mjs +15 -13
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -12
- package/utils/main.js +1 -1
- package/utils/main.mjs +80 -76
package/GridNav.d.ts
CHANGED
|
@@ -10,9 +10,28 @@
|
|
|
10
10
|
*/
|
|
11
11
|
declare const GridNav: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
12
12
|
columnsRef: ArrayConstructor;
|
|
13
|
-
|
|
13
|
+
dataRef: ArrayConstructor;
|
|
14
14
|
id: StringConstructor;
|
|
15
|
-
}>, {
|
|
15
|
+
}>, {
|
|
16
|
+
pendingStickyNavRef: import('vue').Ref<{
|
|
17
|
+
navId: string;
|
|
18
|
+
key: string;
|
|
19
|
+
code: string;
|
|
20
|
+
keyCode: number;
|
|
21
|
+
}, {
|
|
22
|
+
navId: string;
|
|
23
|
+
key: string;
|
|
24
|
+
code: string;
|
|
25
|
+
keyCode: number;
|
|
26
|
+
} | {
|
|
27
|
+
navId: string;
|
|
28
|
+
key: string;
|
|
29
|
+
code: string;
|
|
30
|
+
keyCode: number;
|
|
31
|
+
}>;
|
|
32
|
+
}, {}, {}, {
|
|
33
|
+
handleStickyKeyDown(event: any): boolean;
|
|
34
|
+
handlePendingStickyNav(): void;
|
|
16
35
|
onKeyDown(event: any): void;
|
|
17
36
|
onFocus(event: any): void;
|
|
18
37
|
onNavigationAction(options: {
|
|
@@ -21,9 +40,9 @@ declare const GridNav: import('vue').DefineComponent<import('vue').ExtractPropTy
|
|
|
21
40
|
action?: 'moveToNextPage' | 'moveToPrevPage' | 'reorderToLeft' | 'reorderToRight' | 'select';
|
|
22
41
|
}): void;
|
|
23
42
|
getLeafDataItems(): any;
|
|
24
|
-
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("keydown" | "navigationaction" | "keyboardselectionchange" | "movetonextpage" | "movetoprevpage" | "columnreorder")[], "keydown" | "navigationaction" | "keyboardselectionchange" | "movetonextpage" | "movetoprevpage" | "columnreorder", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
43
|
+
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("keydown" | "navigationaction" | "keyboardselectionchange" | "movetonextpage" | "movetoprevpage" | "columnreorder" | "setcurrentontop")[], "keydown" | "navigationaction" | "keyboardselectionchange" | "movetonextpage" | "movetoprevpage" | "columnreorder" | "setcurrentontop", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
25
44
|
columnsRef: ArrayConstructor;
|
|
26
|
-
|
|
45
|
+
dataRef: ArrayConstructor;
|
|
27
46
|
id: StringConstructor;
|
|
28
47
|
}>> & Readonly<{
|
|
29
48
|
onKeydown?: (...args: any[]) => any;
|
|
@@ -32,5 +51,6 @@ declare const GridNav: import('vue').DefineComponent<import('vue').ExtractPropTy
|
|
|
32
51
|
onKeyboardselectionchange?: (...args: any[]) => any;
|
|
33
52
|
onMovetonextpage?: (...args: any[]) => any;
|
|
34
53
|
onMovetoprevpage?: (...args: any[]) => any;
|
|
54
|
+
onSetcurrentontop?: (...args: any[]) => any;
|
|
35
55
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
36
56
|
export { GridNav };
|
package/GridNav.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("vue"),i=require("@progress/kendo-vue-common"),s=d.defineComponent({name:"KendoGridNav",props:{columnsRef:Array,dataRef:Array,id:String},emits:["keydown","navigationaction","keyboardselectionchange","movetonextpage","movetoprevpage","columnreorder","setcurrentontop"],inject:{onNavKeyDown:{default:i.noop},onNavFocus:{default:i.noop},onNavMount:{default:i.noop},onNavBeforeUpdate:{default:i.noop},onNavUpdate:{default:i.noop},handleDispatchFocus:{default:i.noop},kbContext:{default:null},navigation:{default:null}},mounted(){this.onNavMount({scope:this.$el||void 0})},updated(){this.onNavUpdate({scope:this.$el||void 0}),this.handlePendingStickyNav()},setup(e,n){return{pendingStickyNavRef:d.ref(null)}},methods:{handleStickyKeyDown(e){var t,r;const n=e.target;if((e.keyCode===38||e.keyCode===40)&&n.closest(".k-grid-sticky-container")){const o=parseInt(((t=n.closest("tr"))==null?void 0:t.getAttribute("absolute-row-index"))||"",10),a=n.getAttribute("data-keyboardnavid");if(!isNaN(o)&&a&&!((r=this.$el)==null?void 0:r.querySelector(`.k-grid-content .k-table-tbody>tr[absolute-row-index="${o}"]`)))return this.pendingStickyNavRef={navId:a,key:e.key,code:e.code,keyCode:e.keyCode},e.preventDefault(),e.stopPropagation(),this.$emit("setcurrentontop",{rowIndex:o}),!0}return!1},handlePendingStickyNav(){var a;if(!this.pendingStickyNavRef||!this.$el)return;const{navId:e,key:n,code:t,keyCode:r}=this.pendingStickyNavRef,o=(a=this.$el)==null?void 0:a.querySelector(`.k-grid-content .k-table-tbody td[data-keyboardnavid="${e}"]`);o&&o.dispatchEvent(new KeyboardEvent("keydown",{key:n,code:t,keyCode:r,bubbles:!0,cancelable:!0})),this.pendingStickyNavRef=null},onKeyDown(e){this.handleStickyKeyDown(e)||(this.onNavKeyDown(e,{navigation:this.navigation,kbContext:this.kbContext,onNavigationAction:this.onNavigationAction}),this.onNavBeforeUpdate({scope:this.$el||void 0,kbContext:this.kbContext,navigation:this.navigation}),this.$emit("keydown",{dataItems:this.getLeafDataItems(),componentId:this._gridId,selectedField:this.$props.selectedField,event:e}))},onFocus(e){this.onNavFocus(e,{kbContext:this.kbContext})},onNavigationAction(e){const{columnsRef:n}=this.$props;if(e.action==="moveToNextPage"&&this.$emit("movetonextpage",e.event),e.action==="moveToPrevPage"&&this.$emit("movetoprevpage",e.event),e.focusElement&&(e.action==="reorderToRight"||e.action==="reorderToLeft")){const t=parseInt(e.focusElement.ariaColIndex,10)-1;if(!n[t].reorderable)return;if(e.action==="reorderToRight"&&t<this.$props.columnsRef.length-1){if(n[t+1].disableReorder)return;this.$emit("columnreorder",t,t+1,e.event)}if(e.action==="reorderToLeft"&&t>0){if(n[t-1].disableReorder)return;this.$emit("columnreorder",t,t-1,e.event)}}e.action==="select"&&this.$emit("keyboardselectionchange",e.event),this.$emit("navigationaction",{focusElement:e.focusElement,event:e.event})},getLeafDataItems(){return this.$props.dataRef.filter(e=>e.rowType==="data").map(e=>e.dataItem)}},render(){const e=i.getDefaultSlots(this);return d.createVNode("div",{onKeydown:this.onKeyDown,onFocusin:this.onFocus,id:this.$props.id,"data-keyboardnavscope":!0},[e])}});exports.GridNav=s;
|
package/GridNav.mjs
CHANGED
|
@@ -5,34 +5,34 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import { noop as
|
|
10
|
-
const
|
|
8
|
+
import { defineComponent as d, createVNode as s, ref as c } from "vue";
|
|
9
|
+
import { noop as i, getDefaultSlots as l } from "@progress/kendo-vue-common";
|
|
10
|
+
const v = /* @__PURE__ */ d({
|
|
11
11
|
name: "KendoGridNav",
|
|
12
12
|
props: {
|
|
13
13
|
columnsRef: Array,
|
|
14
|
-
|
|
14
|
+
dataRef: Array,
|
|
15
15
|
id: String
|
|
16
16
|
},
|
|
17
|
-
emits: ["keydown", "navigationaction", "keyboardselectionchange", "movetonextpage", "movetoprevpage", "columnreorder"],
|
|
17
|
+
emits: ["keydown", "navigationaction", "keyboardselectionchange", "movetonextpage", "movetoprevpage", "columnreorder", "setcurrentontop"],
|
|
18
18
|
inject: {
|
|
19
19
|
onNavKeyDown: {
|
|
20
|
-
default:
|
|
20
|
+
default: i
|
|
21
21
|
},
|
|
22
22
|
onNavFocus: {
|
|
23
|
-
default:
|
|
23
|
+
default: i
|
|
24
24
|
},
|
|
25
25
|
onNavMount: {
|
|
26
|
-
default:
|
|
26
|
+
default: i
|
|
27
27
|
},
|
|
28
28
|
onNavBeforeUpdate: {
|
|
29
|
-
default:
|
|
29
|
+
default: i
|
|
30
30
|
},
|
|
31
31
|
onNavUpdate: {
|
|
32
|
-
default:
|
|
32
|
+
default: i
|
|
33
33
|
},
|
|
34
34
|
handleDispatchFocus: {
|
|
35
|
-
default:
|
|
35
|
+
default: i
|
|
36
36
|
},
|
|
37
37
|
kbContext: {
|
|
38
38
|
default: null
|
|
@@ -49,11 +49,51 @@ const m = /* @__PURE__ */ i({
|
|
|
49
49
|
updated() {
|
|
50
50
|
this.onNavUpdate({
|
|
51
51
|
scope: this.$el || void 0
|
|
52
|
-
});
|
|
52
|
+
}), this.handlePendingStickyNav();
|
|
53
|
+
},
|
|
54
|
+
setup(e, n) {
|
|
55
|
+
return {
|
|
56
|
+
pendingStickyNavRef: c(null)
|
|
57
|
+
};
|
|
53
58
|
},
|
|
54
59
|
methods: {
|
|
60
|
+
handleStickyKeyDown(e) {
|
|
61
|
+
var t, r;
|
|
62
|
+
const n = e.target;
|
|
63
|
+
if ((e.keyCode === 38 || e.keyCode === 40) && n.closest(".k-grid-sticky-container")) {
|
|
64
|
+
const o = parseInt(((t = n.closest("tr")) == null ? void 0 : t.getAttribute("absolute-row-index")) || "", 10), a = n.getAttribute("data-keyboardnavid");
|
|
65
|
+
if (!isNaN(o) && a && !((r = this.$el) == null ? void 0 : r.querySelector(`.k-grid-content .k-table-tbody>tr[absolute-row-index="${o}"]`)))
|
|
66
|
+
return this.pendingStickyNavRef = {
|
|
67
|
+
navId: a,
|
|
68
|
+
key: e.key,
|
|
69
|
+
code: e.code,
|
|
70
|
+
keyCode: e.keyCode
|
|
71
|
+
}, e.preventDefault(), e.stopPropagation(), this.$emit("setcurrentontop", {
|
|
72
|
+
rowIndex: o
|
|
73
|
+
}), !0;
|
|
74
|
+
}
|
|
75
|
+
return !1;
|
|
76
|
+
},
|
|
77
|
+
handlePendingStickyNav() {
|
|
78
|
+
var a;
|
|
79
|
+
if (!this.pendingStickyNavRef || !this.$el)
|
|
80
|
+
return;
|
|
81
|
+
const {
|
|
82
|
+
navId: e,
|
|
83
|
+
key: n,
|
|
84
|
+
code: t,
|
|
85
|
+
keyCode: r
|
|
86
|
+
} = this.pendingStickyNavRef, o = (a = this.$el) == null ? void 0 : a.querySelector(`.k-grid-content .k-table-tbody td[data-keyboardnavid="${e}"]`);
|
|
87
|
+
o && o.dispatchEvent(new KeyboardEvent("keydown", {
|
|
88
|
+
key: n,
|
|
89
|
+
code: t,
|
|
90
|
+
keyCode: r,
|
|
91
|
+
bubbles: !0,
|
|
92
|
+
cancelable: !0
|
|
93
|
+
})), this.pendingStickyNavRef = null;
|
|
94
|
+
},
|
|
55
95
|
onKeyDown(e) {
|
|
56
|
-
this.onNavKeyDown(e, {
|
|
96
|
+
this.handleStickyKeyDown(e) || (this.onNavKeyDown(e, {
|
|
57
97
|
navigation: this.navigation,
|
|
58
98
|
kbContext: this.kbContext,
|
|
59
99
|
onNavigationAction: this.onNavigationAction
|
|
@@ -66,7 +106,7 @@ const m = /* @__PURE__ */ i({
|
|
|
66
106
|
componentId: this._gridId,
|
|
67
107
|
selectedField: this.$props.selectedField,
|
|
68
108
|
event: e
|
|
69
|
-
});
|
|
109
|
+
}));
|
|
70
110
|
},
|
|
71
111
|
onFocus(e) {
|
|
72
112
|
this.onNavFocus(e, {
|
|
@@ -75,19 +115,19 @@ const m = /* @__PURE__ */ i({
|
|
|
75
115
|
},
|
|
76
116
|
onNavigationAction(e) {
|
|
77
117
|
const {
|
|
78
|
-
columnsRef:
|
|
118
|
+
columnsRef: n
|
|
79
119
|
} = this.$props;
|
|
80
120
|
if (e.action === "moveToNextPage" && this.$emit("movetonextpage", e.event), e.action === "moveToPrevPage" && this.$emit("movetoprevpage", e.event), e.focusElement && (e.action === "reorderToRight" || e.action === "reorderToLeft")) {
|
|
81
121
|
const t = parseInt(e.focusElement.ariaColIndex, 10) - 1;
|
|
82
|
-
if (!
|
|
122
|
+
if (!n[t].reorderable)
|
|
83
123
|
return;
|
|
84
124
|
if (e.action === "reorderToRight" && t < this.$props.columnsRef.length - 1) {
|
|
85
|
-
if (
|
|
125
|
+
if (n[t + 1].disableReorder)
|
|
86
126
|
return;
|
|
87
127
|
this.$emit("columnreorder", t, t + 1, e.event);
|
|
88
128
|
}
|
|
89
129
|
if (e.action === "reorderToLeft" && t > 0) {
|
|
90
|
-
if (
|
|
130
|
+
if (n[t - 1].disableReorder)
|
|
91
131
|
return;
|
|
92
132
|
this.$emit("columnreorder", t, t - 1, e.event);
|
|
93
133
|
}
|
|
@@ -98,12 +138,12 @@ const m = /* @__PURE__ */ i({
|
|
|
98
138
|
});
|
|
99
139
|
},
|
|
100
140
|
getLeafDataItems() {
|
|
101
|
-
return this.$props.
|
|
141
|
+
return this.$props.dataRef.filter((e) => e.rowType === "data").map((e) => e.dataItem);
|
|
102
142
|
}
|
|
103
143
|
},
|
|
104
144
|
render() {
|
|
105
|
-
const e =
|
|
106
|
-
return
|
|
145
|
+
const e = l(this);
|
|
146
|
+
return s("div", {
|
|
107
147
|
onKeydown: this.onKeyDown,
|
|
108
148
|
onFocusin: this.onFocus,
|
|
109
149
|
id: this.$props.id,
|
|
@@ -112,5 +152,5 @@ const m = /* @__PURE__ */ i({
|
|
|
112
152
|
}
|
|
113
153
|
});
|
|
114
154
|
export {
|
|
115
|
-
|
|
155
|
+
v as GridNav
|
|
116
156
|
};
|
package/GridState.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ declare const GridStateProvider: import('vue').DefineComponent<{
|
|
|
34
34
|
alternatePerGroup?: boolean;
|
|
35
35
|
columns?: import('.').GridColumnProps[];
|
|
36
36
|
dataItems?: any[] | import('@progress/kendo-data-query').DataResult;
|
|
37
|
+
cells?: import('.').GridCellsSettings;
|
|
37
38
|
sortable?: import('.').GridSortSettings;
|
|
38
39
|
onSortchange?: (event: GridSortChangeEvent) => void;
|
|
39
40
|
defaultSort?: import('@progress/kendo-data-query').SortDescriptor[];
|
|
@@ -114,6 +115,7 @@ declare const GridStateProvider: import('vue').DefineComponent<{
|
|
|
114
115
|
headerCellRender?: any;
|
|
115
116
|
showLoader?: boolean;
|
|
116
117
|
loader?: string | Object;
|
|
118
|
+
lockGroups?: boolean;
|
|
117
119
|
pager?: string | boolean | Object;
|
|
118
120
|
columnVirtualization?: boolean;
|
|
119
121
|
navigatable?: boolean;
|
|
@@ -137,6 +139,7 @@ declare const GridStateProvider: import('vue').DefineComponent<{
|
|
|
137
139
|
alternatePerGroup?: boolean;
|
|
138
140
|
columns?: import('.').GridColumnProps[];
|
|
139
141
|
dataItems?: any[] | import('@progress/kendo-data-query').DataResult;
|
|
142
|
+
cells?: import('.').GridCellsSettings;
|
|
140
143
|
sortable?: import('.').GridSortSettings;
|
|
141
144
|
onSortchange?: (event: GridSortChangeEvent) => void;
|
|
142
145
|
defaultSort?: import('@progress/kendo-data-query').SortDescriptor[];
|
|
@@ -217,6 +220,7 @@ declare const GridStateProvider: import('vue').DefineComponent<{
|
|
|
217
220
|
headerCellRender?: any;
|
|
218
221
|
showLoader?: boolean;
|
|
219
222
|
loader?: string | Object;
|
|
223
|
+
lockGroups?: boolean;
|
|
220
224
|
pager?: string | boolean | Object;
|
|
221
225
|
columnVirtualization?: boolean;
|
|
222
226
|
navigatable?: boolean;
|
package/RootGrid.d.ts
CHANGED
|
@@ -82,12 +82,9 @@ export declare const RootGrid: import('vue').DefineComponent<import('vue').Extra
|
|
|
82
82
|
type: import('vue').PropType<import('.').GridColumnState[]>;
|
|
83
83
|
default: () => any;
|
|
84
84
|
};
|
|
85
|
+
cells: import('vue').PropType<import('.').GridCellsSettings>;
|
|
85
86
|
defaultColumnsState: {
|
|
86
|
-
type: import('vue').PropType<import('.').GridColumnState[]>;
|
|
87
|
-
* Method to allow the scroll to be set to a specific row index when the Grid is scrollable. It is zero based.
|
|
88
|
-
*
|
|
89
|
-
* @param options - Object, containing the rowIndex to which is going to be scrolled.
|
|
90
|
-
*/
|
|
87
|
+
type: import('vue').PropType<import('.').GridColumnState[]>;
|
|
91
88
|
default: () => any;
|
|
92
89
|
};
|
|
93
90
|
columnVirtualization: import('vue').PropType<boolean>;
|
|
@@ -104,6 +101,7 @@ export declare const RootGrid: import('vue').DefineComponent<import('vue').Extra
|
|
|
104
101
|
default: any;
|
|
105
102
|
};
|
|
106
103
|
loader: import('vue').PropType<string | Object | Function>;
|
|
104
|
+
lockGroups: import('vue').PropType<boolean>;
|
|
107
105
|
defaultFilter: import('vue').PropType<import('@progress/kendo-data-query').CompositeFilterDescriptor>;
|
|
108
106
|
filter: import('vue').PropType<import('@progress/kendo-data-query').CompositeFilterDescriptor>;
|
|
109
107
|
defaultSearch: import('vue').PropType<import('@progress/kendo-data-query').CompositeFilterDescriptor>;
|
|
@@ -239,7 +237,32 @@ export declare const RootGrid: import('vue').DefineComponent<import('vue').Extra
|
|
|
239
237
|
onDetailexpandchange: import('vue').PropType<(event: import('.').GridDetailExpandChangeEvent) => void>;
|
|
240
238
|
}>, void, {}, {
|
|
241
239
|
columnsWithTemplates(): any[];
|
|
242
|
-
|
|
240
|
+
cellsWithTemplates(): any;
|
|
241
|
+
}, {
|
|
242
|
+
transformTemplate(template: any, listeners: any): any;
|
|
243
|
+
transformGroupTemplates(group: any, listeners: any): {
|
|
244
|
+
groupHeader: any;
|
|
245
|
+
data: any;
|
|
246
|
+
groupFooter: any;
|
|
247
|
+
};
|
|
248
|
+
transformCellTemplates(cells: any, listeners: any): {
|
|
249
|
+
headerCell: any;
|
|
250
|
+
filterCell: any;
|
|
251
|
+
footerCell: any;
|
|
252
|
+
groupHeader: any;
|
|
253
|
+
data: any;
|
|
254
|
+
groupFooter: any;
|
|
255
|
+
select: any;
|
|
256
|
+
hierarchy: any;
|
|
257
|
+
group: any;
|
|
258
|
+
edit: {
|
|
259
|
+
text: any;
|
|
260
|
+
numeric: any;
|
|
261
|
+
boolean: any;
|
|
262
|
+
date: any;
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
243
266
|
id: import('vue').PropType<string>;
|
|
244
267
|
autoProcessData: import('vue').PropType<boolean | {
|
|
245
268
|
filter?: boolean;
|
|
@@ -267,12 +290,9 @@ export declare const RootGrid: import('vue').DefineComponent<import('vue').Extra
|
|
|
267
290
|
type: import('vue').PropType<import('.').GridColumnState[]>;
|
|
268
291
|
default: () => any;
|
|
269
292
|
};
|
|
293
|
+
cells: import('vue').PropType<import('.').GridCellsSettings>;
|
|
270
294
|
defaultColumnsState: {
|
|
271
|
-
type: import('vue').PropType<import('.').GridColumnState[]>;
|
|
272
|
-
* Method to allow the scroll to be set to a specific row index when the Grid is scrollable. It is zero based.
|
|
273
|
-
*
|
|
274
|
-
* @param options - Object, containing the rowIndex to which is going to be scrolled.
|
|
275
|
-
*/
|
|
295
|
+
type: import('vue').PropType<import('.').GridColumnState[]>;
|
|
276
296
|
default: () => any;
|
|
277
297
|
};
|
|
278
298
|
columnVirtualization: import('vue').PropType<boolean>;
|
|
@@ -289,6 +309,7 @@ export declare const RootGrid: import('vue').DefineComponent<import('vue').Extra
|
|
|
289
309
|
default: any;
|
|
290
310
|
};
|
|
291
311
|
loader: import('vue').PropType<string | Object | Function>;
|
|
312
|
+
lockGroups: import('vue').PropType<boolean>;
|
|
292
313
|
defaultFilter: import('vue').PropType<import('@progress/kendo-data-query').CompositeFilterDescriptor>;
|
|
293
314
|
filter: import('vue').PropType<import('@progress/kendo-data-query').CompositeFilterDescriptor>;
|
|
294
315
|
defaultSearch: import('vue').PropType<import('@progress/kendo-data-query').CompositeFilterDescriptor>;
|
package/RootGrid.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),g=require("./Grid.js"),C=require("./GridState.js"),G=require("./common.js"),n=require("@progress/kendo-vue-common"),O=i.defineComponent({name:"KendoVueGrid",props:G.gridProps,setup(e,{expose:t}){const r=i.ref(null);t({get element(){var a;return((a=r.value)==null?void 0:a.element)||null},get props(){return e},get columns(){var a;return((a=r.value)==null?void 0:a.columns)||[]},scrollIntoView:a=>{var s;(s=r.value)==null||s.scrollIntoView(a)},fitColumns:a=>{var s;(s=r.value)==null||s.fitColumns(a)},exportAsPdf:()=>{var a;(a=r.value)==null||a.exportAsPdf()}})},methods:{transformTemplate(e,t){return e?n.templateRendering.call(this,e,t):void 0},transformGroupTemplates(e,t){if(e)return{groupHeader:this.transformTemplate(e.groupHeader,t),data:this.transformTemplate(e.data,t),groupFooter:this.transformTemplate(e.groupFooter,t)}},transformCellTemplates(e,t){if(e)return{headerCell:this.transformTemplate(e.headerCell,t),filterCell:this.transformTemplate(e.filterCell,t),footerCell:this.transformTemplate(e.footerCell,t),groupHeader:this.transformTemplate(e.groupHeader,t),data:this.transformTemplate(e.data,t),groupFooter:this.transformTemplate(e.groupFooter,t),select:this.transformGroupTemplates(e.select,t),hierarchy:this.transformGroupTemplates(e.hierarchy,t),group:this.transformGroupTemplates(e.group,t),edit:e.edit?{text:this.transformTemplate(e.edit.text,t),numeric:this.transformTemplate(e.edit.numeric,t),boolean:this.transformTemplate(e.edit.boolean,t),date:this.transformTemplate(e.edit.date,t)}:void 0}}},computed:{columnsWithTemplates(){const e=n.getListeners.call(this);return n.mapTree(this.$props.columns||[],"children",t=>{const r={...t};return{...r,cell:this.transformTemplate(r.cell,e),headerCell:this.transformTemplate(r.headerCell,e),filterCell:this.transformTemplate(r.filterCell,e),footerCell:this.transformTemplate(r.footerCell,e),columnMenu:r.columnMenu===!1?!1:this.transformTemplate(r.columnMenu,e),cells:this.transformCellTemplates(r.cells,e)}})},cellsWithTemplates(){const e=n.getListeners.call(this);return this.transformCellTemplates(this.$props.cells,e)}},render(){const e=n.getDefaultSlots(this)||[],t=n.getListeners.call(this),r=e.filter(o=>{var l,m;return o.tag&&o.tag.toLowerCase().indexOf("toolbar")!==-1||o.componentOptions&&((l=o.componentOptions.tag)==null?void 0:l.toLowerCase().indexOf("toolbar"))!==-1||((m=o==null?void 0:o.type)==null?void 0:m.name.toLowerCase().indexOf("toolbar"))!==-1}),a=e.filter(o=>{var l,m;return o.tag&&o.tag.toLowerCase().indexOf("records")!==-1||o.componentOptions&&((l=o.componentOptions.tag)==null?void 0:l.toLowerCase().indexOf("records"))!==-1||((m=o==null?void 0:o.type)==null?void 0:m.name.toLowerCase().indexOf("records"))!==-1}),{cellRender:s,detail:u,columns:w,rowRender:f,pager:d,loader:h,...p}=this.$props,c=this.columnsWithTemplates,T=this.cellsWithTemplates;return i.createVNode(C.GridStateProvider,p,{default:()=>[i.createVNode(g.Grid,i.mergeProps(p,t,{class:this.$attrs.class,style:this.$attrs.style,columns:c,cells:T,cellRender:this.transformTemplate(s,t),rowRender:this.transformTemplate(f,t),pager:this.transformTemplate(d,t),loader:this.transformTemplate(h,t),detail:this.transformTemplate(u,t),toolbar:r,noRecords:a}),null)]})}});exports.RootGrid=O;
|
package/RootGrid.mjs
CHANGED
|
@@ -5,94 +5,133 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
9
|
-
import { Grid as
|
|
10
|
-
import { GridStateProvider as
|
|
11
|
-
import { gridProps as
|
|
12
|
-
import { getDefaultSlots as
|
|
13
|
-
const
|
|
8
|
+
import { defineComponent as g, createVNode as i, mergeProps as C, ref as x } from "vue";
|
|
9
|
+
import { Grid as w } from "./Grid.mjs";
|
|
10
|
+
import { GridStateProvider as O } from "./GridState.mjs";
|
|
11
|
+
import { gridProps as R } from "./common.mjs";
|
|
12
|
+
import { getDefaultSlots as G, getListeners as l, mapTree as b, templateRendering as L } from "@progress/kendo-vue-common";
|
|
13
|
+
const H = /* @__PURE__ */ g({
|
|
14
14
|
name: "KendoVueGrid",
|
|
15
|
-
props:
|
|
16
|
-
setup(
|
|
17
|
-
expose:
|
|
15
|
+
props: R,
|
|
16
|
+
setup(e, {
|
|
17
|
+
expose: t
|
|
18
18
|
}) {
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
const r = x(null);
|
|
20
|
+
t({
|
|
21
21
|
get element() {
|
|
22
|
-
var
|
|
23
|
-
return ((
|
|
22
|
+
var a;
|
|
23
|
+
return ((a = r.value) == null ? void 0 : a.element) || null;
|
|
24
24
|
},
|
|
25
25
|
get props() {
|
|
26
|
-
return
|
|
26
|
+
return e;
|
|
27
27
|
},
|
|
28
28
|
get columns() {
|
|
29
|
-
var
|
|
30
|
-
return ((
|
|
29
|
+
var a;
|
|
30
|
+
return ((a = r.value) == null ? void 0 : a.columns) || [];
|
|
31
31
|
},
|
|
32
|
-
scrollIntoView: (
|
|
32
|
+
scrollIntoView: (a) => {
|
|
33
33
|
var s;
|
|
34
|
-
(s =
|
|
34
|
+
(s = r.value) == null || s.scrollIntoView(a);
|
|
35
35
|
},
|
|
36
|
-
fitColumns: (
|
|
36
|
+
fitColumns: (a) => {
|
|
37
37
|
var s;
|
|
38
|
-
(s =
|
|
38
|
+
(s = r.value) == null || s.fitColumns(a);
|
|
39
39
|
},
|
|
40
40
|
exportAsPdf: () => {
|
|
41
|
-
var
|
|
42
|
-
(
|
|
41
|
+
var a;
|
|
42
|
+
(a = r.value) == null || a.exportAsPdf();
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
},
|
|
46
|
+
methods: {
|
|
47
|
+
transformTemplate(e, t) {
|
|
48
|
+
return e ? L.call(this, e, t) : void 0;
|
|
49
|
+
},
|
|
50
|
+
transformGroupTemplates(e, t) {
|
|
51
|
+
if (e)
|
|
52
|
+
return {
|
|
53
|
+
groupHeader: this.transformTemplate(e.groupHeader, t),
|
|
54
|
+
data: this.transformTemplate(e.data, t),
|
|
55
|
+
groupFooter: this.transformTemplate(e.groupFooter, t)
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
transformCellTemplates(e, t) {
|
|
59
|
+
if (e)
|
|
60
|
+
return {
|
|
61
|
+
headerCell: this.transformTemplate(e.headerCell, t),
|
|
62
|
+
filterCell: this.transformTemplate(e.filterCell, t),
|
|
63
|
+
footerCell: this.transformTemplate(e.footerCell, t),
|
|
64
|
+
groupHeader: this.transformTemplate(e.groupHeader, t),
|
|
65
|
+
data: this.transformTemplate(e.data, t),
|
|
66
|
+
groupFooter: this.transformTemplate(e.groupFooter, t),
|
|
67
|
+
select: this.transformGroupTemplates(e.select, t),
|
|
68
|
+
hierarchy: this.transformGroupTemplates(e.hierarchy, t),
|
|
69
|
+
group: this.transformGroupTemplates(e.group, t),
|
|
70
|
+
edit: e.edit ? {
|
|
71
|
+
text: this.transformTemplate(e.edit.text, t),
|
|
72
|
+
numeric: this.transformTemplate(e.edit.numeric, t),
|
|
73
|
+
boolean: this.transformTemplate(e.edit.boolean, t),
|
|
74
|
+
date: this.transformTemplate(e.edit.date, t)
|
|
75
|
+
} : void 0
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
},
|
|
46
79
|
computed: {
|
|
47
80
|
columnsWithTemplates() {
|
|
48
|
-
const
|
|
49
|
-
return
|
|
50
|
-
const
|
|
51
|
-
...
|
|
52
|
-
}
|
|
81
|
+
const e = l.call(this);
|
|
82
|
+
return b(this.$props.columns || [], "children", (t) => {
|
|
83
|
+
const r = {
|
|
84
|
+
...t
|
|
85
|
+
};
|
|
53
86
|
return {
|
|
54
|
-
...
|
|
55
|
-
cell: e,
|
|
56
|
-
headerCell:
|
|
57
|
-
filterCell:
|
|
58
|
-
footerCell:
|
|
59
|
-
columnMenu:
|
|
87
|
+
...r,
|
|
88
|
+
cell: this.transformTemplate(r.cell, e),
|
|
89
|
+
headerCell: this.transformTemplate(r.headerCell, e),
|
|
90
|
+
filterCell: this.transformTemplate(r.filterCell, e),
|
|
91
|
+
footerCell: this.transformTemplate(r.footerCell, e),
|
|
92
|
+
columnMenu: r.columnMenu === !1 ? !1 : this.transformTemplate(r.columnMenu, e),
|
|
93
|
+
cells: this.transformCellTemplates(r.cells, e)
|
|
60
94
|
};
|
|
61
95
|
});
|
|
96
|
+
},
|
|
97
|
+
cellsWithTemplates() {
|
|
98
|
+
const e = l.call(this);
|
|
99
|
+
return this.transformCellTemplates(this.$props.cells, e);
|
|
62
100
|
}
|
|
63
101
|
},
|
|
64
102
|
render() {
|
|
65
|
-
const
|
|
66
|
-
var
|
|
67
|
-
return o.tag && o.tag.toLowerCase().indexOf("toolbar") !== -1 || o.componentOptions && ((
|
|
68
|
-
}),
|
|
69
|
-
var
|
|
70
|
-
return o.tag && o.tag.toLowerCase().indexOf("records") !== -1 || o.componentOptions && ((
|
|
103
|
+
const e = G(this) || [], t = l.call(this), r = e.filter((o) => {
|
|
104
|
+
var n, m;
|
|
105
|
+
return o.tag && o.tag.toLowerCase().indexOf("toolbar") !== -1 || o.componentOptions && ((n = o.componentOptions.tag) == null ? void 0 : n.toLowerCase().indexOf("toolbar")) !== -1 || ((m = o == null ? void 0 : o.type) == null ? void 0 : m.name.toLowerCase().indexOf("toolbar")) !== -1;
|
|
106
|
+
}), a = e.filter((o) => {
|
|
107
|
+
var n, m;
|
|
108
|
+
return o.tag && o.tag.toLowerCase().indexOf("records") !== -1 || o.componentOptions && ((n = o.componentOptions.tag) == null ? void 0 : n.toLowerCase().indexOf("records")) !== -1 || ((m = o == null ? void 0 : o.type) == null ? void 0 : m.name.toLowerCase().indexOf("records")) !== -1;
|
|
71
109
|
}), {
|
|
72
110
|
cellRender: s,
|
|
73
|
-
detail:
|
|
74
|
-
columns:
|
|
75
|
-
rowRender:
|
|
76
|
-
pager:
|
|
77
|
-
loader:
|
|
78
|
-
...
|
|
79
|
-
} = this.$props,
|
|
80
|
-
return
|
|
81
|
-
default: () => [
|
|
111
|
+
detail: f,
|
|
112
|
+
columns: P,
|
|
113
|
+
rowRender: u,
|
|
114
|
+
pager: d,
|
|
115
|
+
loader: h,
|
|
116
|
+
...p
|
|
117
|
+
} = this.$props, T = this.columnsWithTemplates, c = this.cellsWithTemplates;
|
|
118
|
+
return i(O, p, {
|
|
119
|
+
default: () => [i(w, C(p, t, {
|
|
82
120
|
class: this.$attrs.class,
|
|
83
121
|
style: this.$attrs.style,
|
|
84
|
-
columns:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
122
|
+
columns: T,
|
|
123
|
+
cells: c,
|
|
124
|
+
cellRender: this.transformTemplate(s, t),
|
|
125
|
+
rowRender: this.transformTemplate(u, t),
|
|
126
|
+
pager: this.transformTemplate(d, t),
|
|
127
|
+
loader: this.transformTemplate(h, t),
|
|
128
|
+
detail: this.transformTemplate(f, t),
|
|
129
|
+
toolbar: r,
|
|
130
|
+
noRecords: a
|
|
92
131
|
}), null)]
|
|
93
132
|
});
|
|
94
133
|
}
|
|
95
134
|
});
|
|
96
135
|
export {
|
|
97
|
-
|
|
136
|
+
H as RootGrid
|
|
98
137
|
};
|
package/cells/GridCell.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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),c=require("../utils/main.js"),g=require("@progress/kendo-vue-intl"),p=require("@progress/kendo-vue-common"),o=require("@progress/kendo-vue-data-tools"),h=n.defineComponent({name:"GridCell",inheritAttrs:!1,emits:{cellclick:null,cellkeydown:null},props:{id:String,field:String,dataItem:Object,format:String,readFormat:String,className:String,columnType:String,colSpan:Number,columnIndex:Number,columnsCount:Number,dataIndex:Number,rowType:String,level:Number,expanded:Boolean,type:String,editor:String,rowSpan:[Number,Object],isSelected:Boolean,isHighlighted:Boolean,ariaColumnIndex:Number,render:[String,Function,Object],isRtl:Boolean,onEdit:Function,onSave:Function,onRemove:Function,onCancel:Function,onChange:Function,onSelectionchange:Function},inject:{kendoIntlService:{default:null},getKeyboardNavigationAttributes:{default:p.noop}},methods:{triggerClick(){this.$emit("cellclick",{dataItem:this.$props.dataItem,field:this.$props.field})},triggerKeydown(e){this.$emit("cellkeydown",{event:e,dataItem:this.$props.dataItem,field:this.$props.field})},triggerEdit(e){this.$emit("edit",e)},triggerAdd(e){this.$emit("add",e)},triggerCancel(e){this.$emit("cancel",e)},triggerSave(e){this.$emit("save",e)},triggerRemove(e){this.$emit("remove",e)}},created(){this._intl=g.provideIntlService(this)},computed:{tdClass(){const{className:e,isSelected:t,isHighlighted:i}=this.$props;return{"k-table-td":!0,"k-selected":t,"k-highlighted":i,[e]:e}}},setup(){return{kendoIntlService:n.inject("kendoIntlService",{})}},render(){var s,a,d;let e=null;const t=this.getKeyboardNavigationAttributes(this.$props.id);let i={};if(((s=this.$props.rowSpan)==null?void 0:s.count)===null)return null;if(this.$props.rowType==="groupFooter")i={class:this.tdClass,onKeydown:this.triggerKeydown,onClick:this.triggerClick,tabindex:t.tabIndex,"data-keyboardnavlevel":t[o.KEYBOARD_NAV_DATA_LEVEL],"data-keyboardnavid":t[o.KEYBOARD_NAV_DATA_ID]},e=n.createVNode("td",i,null);else if(this.$props.field!==void 0&&this.$props.rowType!=="groupHeader"){const r=c.getNestedValue(this.$props.field,this.$props.dataItem);let l="";r!=null&&(l=this.$props.format?this.$props.type?this._intl.format(this.$props.format,c.parsers[this.$props.type](r,this._intl,this.$props.readFormat)):this._intl.format(this.$props.format,r):r.toString()),i={style:this.$attrs.style,colspan:this.$props.colSpan,rowspan:(d=(a=this.$props.rowSpan)==null?void 0:a.count)!=null?d:void 0,class:this.tdClass,onKeydown:this.triggerKeydown,onClick:this.triggerClick,role:"gridcell","aria-colindex":this.$props.ariaColumnIndex,"aria-selected":this.$props.isSelected,"data-grid-col-index":this.$props.columnIndex,tabindex:t.tabIndex,"data-keyboardnavlevel":t[o.KEYBOARD_NAV_DATA_LEVEL],"data-keyboardnavid":t[o.KEYBOARD_NAV_DATA_ID]},e=n.createVNode("td",i,[l])}return p.getTemplate.call(this,{h:n.h,template:this.$props.render,defaultRendering:e,additionalProps:{...this.$props,tdProps:i},additionalListeners:{click:this.triggerClick,keydown:this.triggerKeydown,edit:this.triggerEdit,add:this.triggerAdd,cancel:this.triggerCancel,save:this.triggerSave,remove:this.triggerRemove}})}});exports.GridCell=h;
|