@progress/kendo-vue-grid 8.1.2-develop.1 → 8.2.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Grid.d.ts +36 -3
- package/Grid.js +1 -1
- package/Grid.mjs +706 -496
- package/GridSearchBox.js +1 -1
- package/GridSearchBox.mjs +5 -5
- package/GridState.d.ts +6 -0
- package/NOTICE.txt +117 -53
- package/RootGrid.d.ts +6 -10
- package/cells/GridCell.d.ts +2 -0
- package/cells/GridCell.js +1 -1
- package/cells/GridCell.mjs +52 -43
- package/cells/GridDetailCell.d.ts +4 -1
- package/cells/GridDetailCell.js +1 -1
- package/cells/GridDetailCell.mjs +27 -18
- package/cells/GridEditCell.d.ts +2 -0
- package/cells/GridEditCell.js +1 -1
- package/cells/GridEditCell.mjs +21 -14
- package/cells/GridGroupCell.d.ts +1 -0
- package/cells/GridGroupCell.js +1 -1
- package/cells/GridGroupCell.mjs +45 -40
- package/cells/GridHierarchyCell.d.ts +1 -0
- package/cells/GridHierarchyCell.js +1 -1
- package/cells/GridHierarchyCell.mjs +25 -20
- package/cells/GridSelectionCell.d.ts +4 -1
- package/cells/GridSelectionCell.js +1 -1
- package/cells/GridSelectionCell.mjs +31 -21
- package/cells/pincell/GridPinCell.d.ts +6 -2
- package/cells/pincell/GridPinCell.js +1 -1
- package/cells/pincell/GridPinCell.mjs +67 -42
- package/cells/pincell/GridPinDropdownButton.js +1 -1
- package/cells/pincell/GridPinDropdownButton.mjs +25 -25
- package/common.d.ts +3 -0
- package/common.js +1 -1
- package/common.mjs +4 -1
- package/components/PinnedRowsTable.js +1 -1
- package/components/PinnedRowsTable.mjs +46 -34
- package/components/table/GridTable.js +1 -1
- package/components/table/GridTable.mjs +6 -6
- package/components/table/GridTableScrollable.js +1 -1
- package/components/table/GridTableScrollable.mjs +4 -4
- package/contextMenu/GridContextMenu.d.ts +155 -0
- package/contextMenu/GridContextMenu.js +8 -0
- package/contextMenu/GridContextMenu.mjs +336 -0
- package/contextMenu/enums.d.ts +40 -0
- package/contextMenu/enums.js +8 -0
- package/contextMenu/enums.mjs +12 -0
- package/dist/cdn/js/kendo-vue-grid.js +1 -1
- package/header/HeaderRow.d.ts +1 -0
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +92 -81
- package/index.d.mts +3 -0
- package/index.d.ts +3 -0
- package/index.js +1 -1
- package/index.mjs +61 -53
- package/interfaces/GridProps.d.ts +31 -1
- package/interfaces/events.d.ts +38 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -13
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as
|
|
8
|
+
import { defineComponent as x, createVNode as s, mergeProps as G, inject as j, computed as a, ref as k } from "vue";
|
|
9
9
|
import { setRef as c, classNames as f, uGrid as R, getter as K, getRef as l } from "@progress/kendo-vue-common";
|
|
10
10
|
import { TableSelection as z, tableKeyboardNavigationTopPinnedAttributes as B, tableKeyboardNavigationBottomPinnedAttributes as E } from "@progress/kendo-vue-data-tools";
|
|
11
|
-
import { provideLocalizationService as
|
|
11
|
+
import { provideLocalizationService as w } from "@progress/kendo-vue-intl";
|
|
12
12
|
import { GridRow as H } from "../rows/GridRow.mjs";
|
|
13
|
-
import { getRowContents as
|
|
14
|
-
import { pinnedTopRowsAriaLabel as h, messages as
|
|
15
|
-
const M = /* @__PURE__ */
|
|
13
|
+
import { getRowContents as D } from "../getRowContents.mjs";
|
|
14
|
+
import { pinnedTopRowsAriaLabel as h, messages as p, pinnedBottomRowsAriaLabel as g } from "../messages/main.mjs";
|
|
15
|
+
const M = /* @__PURE__ */ x({
|
|
16
16
|
name: "PinnedRowsTable",
|
|
17
17
|
props: {
|
|
18
18
|
size: String,
|
|
@@ -49,27 +49,39 @@ const M = /* @__PURE__ */ G({
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
setup(e) {
|
|
52
|
-
const n = j("
|
|
52
|
+
const n = j("gridContext", {}), d = a(() => e.position === "top"), S = a(() => d.value ? n.pinnedTopRef : n.pinnedBottomRef), y = k(!1), I = (o) => {
|
|
53
53
|
const t = n.containerElementRef;
|
|
54
54
|
if (!t || y.value)
|
|
55
55
|
return;
|
|
56
56
|
const i = o.currentTarget.scrollLeft;
|
|
57
57
|
t.scrollLeft !== i && (t.scrollLeft = i);
|
|
58
|
-
},
|
|
59
|
-
|
|
58
|
+
}, v = a(() => {
|
|
59
|
+
if (!e.rows)
|
|
60
|
+
return;
|
|
61
|
+
const {
|
|
62
|
+
pinnedData: o,
|
|
63
|
+
...t
|
|
64
|
+
} = e.rows;
|
|
65
|
+
return o ? {
|
|
66
|
+
...t,
|
|
67
|
+
data: o
|
|
68
|
+
} : e.rows;
|
|
69
|
+
}), L = a(() => !e.pinnedItems || !e.dataRowContext ? [] : e.pinnedItems.map((o, t) => {
|
|
70
|
+
var m;
|
|
60
71
|
const i = {
|
|
61
72
|
dataItem: o,
|
|
62
73
|
rowType: "data",
|
|
63
74
|
level: 0,
|
|
64
75
|
expanded: !1,
|
|
65
76
|
dataIndex: t
|
|
66
|
-
}, r = e.dataRowContext.dataItemKey,
|
|
77
|
+
}, r = e.dataRowContext.dataItemKey, u = "pinned_" + ((r ? K(r)(o) : void 0) || "ai" + t), b = D(e.dataRowContext, i, u, t);
|
|
78
|
+
return (m = e.rows) != null && m.pinnedData ? {
|
|
67
79
|
...e.rows,
|
|
68
80
|
data: e.rows.pinnedData
|
|
69
|
-
} : e.rows
|
|
70
|
-
|
|
71
|
-
key: b,
|
|
81
|
+
} : e.rows, s(H, {
|
|
82
|
+
key: u,
|
|
72
83
|
rowType: "data",
|
|
84
|
+
isPinned: !0,
|
|
73
85
|
item: i,
|
|
74
86
|
dataIndex: t,
|
|
75
87
|
ariaRowIndex: t + 1,
|
|
@@ -77,58 +89,58 @@ const M = /* @__PURE__ */ G({
|
|
|
77
89
|
isAltRow: t % 2 !== 0,
|
|
78
90
|
isHidden: !1,
|
|
79
91
|
rowHeight: e.rowHeight,
|
|
80
|
-
isSelected:
|
|
81
|
-
rows:
|
|
92
|
+
isSelected: b.isSelected,
|
|
93
|
+
rows: v.value
|
|
82
94
|
}, {
|
|
83
|
-
default: () => [
|
|
95
|
+
default: () => [b.row]
|
|
84
96
|
});
|
|
85
|
-
})),
|
|
97
|
+
})), C = a(() => f("k-grid-pinned-container", {
|
|
86
98
|
"k-pos-bottom": !d.value
|
|
87
|
-
})),
|
|
99
|
+
})), T = a(() => f(R.table({
|
|
88
100
|
size: e.size
|
|
89
|
-
}))),
|
|
101
|
+
}))), A = (o) => {
|
|
90
102
|
var i, r;
|
|
91
103
|
const t = (i = e.pinnedItems) == null ? void 0 : i[o.startRowIndex];
|
|
92
104
|
t && ((r = n.pinnedSelectionRelease) == null || r.call(n, o, t));
|
|
93
|
-
},
|
|
105
|
+
}, N = a(() => e.selectable ? {
|
|
94
106
|
...typeof e.selectable == "object" ? e.selectable : {},
|
|
95
107
|
enabled: !0,
|
|
96
108
|
drag: !1
|
|
97
|
-
} : e.selectable),
|
|
109
|
+
} : e.selectable), P = a(() => d.value ? B : E);
|
|
98
110
|
return {
|
|
99
111
|
isTop: d,
|
|
100
112
|
pinnedRef: S,
|
|
101
113
|
handlePinnedScroll: I,
|
|
102
114
|
pinnedRows: L,
|
|
103
|
-
containerClassName:
|
|
104
|
-
tableClassName:
|
|
105
|
-
handleSelectionRelease:
|
|
106
|
-
pinnedSelectable:
|
|
107
|
-
pinnedBodyAttributes:
|
|
115
|
+
containerClassName: C,
|
|
116
|
+
tableClassName: T,
|
|
117
|
+
handleSelectionRelease: A,
|
|
118
|
+
pinnedSelectable: N,
|
|
119
|
+
pinnedBodyAttributes: P
|
|
108
120
|
};
|
|
109
121
|
},
|
|
110
122
|
render() {
|
|
111
|
-
return
|
|
123
|
+
return s("div", {
|
|
112
124
|
class: this.containerClassName,
|
|
113
125
|
role: "presentation",
|
|
114
|
-
style: {
|
|
115
|
-
display:
|
|
126
|
+
style: this.pinnedRows.length ? void 0 : {
|
|
127
|
+
display: "none"
|
|
116
128
|
}
|
|
117
|
-
}, [
|
|
129
|
+
}, [s("div", {
|
|
118
130
|
class: "k-grid-pinned-wrap",
|
|
119
131
|
ref: c(this, "pinnedRef"),
|
|
120
132
|
onScroll: this.handlePinnedScroll
|
|
121
|
-
}, [
|
|
133
|
+
}, [s(z, {
|
|
122
134
|
selectable: this.pinnedSelectable,
|
|
123
135
|
onRelease: this.handleSelectionRelease
|
|
124
136
|
}, {
|
|
125
|
-
default: () => [
|
|
137
|
+
default: () => [s("table", {
|
|
126
138
|
ref: c(this, "table"),
|
|
127
139
|
class: this.tableClassName,
|
|
128
|
-
"aria-label": this.isTop ?
|
|
129
|
-
}, [
|
|
140
|
+
"aria-label": this.isTop ? w(this).toLanguageString(h, p[h]) : w(this).toLanguageString(g, p[g])
|
|
141
|
+
}, [s("colgroup", {
|
|
130
142
|
ref: c(this, "colGroup")
|
|
131
|
-
}, [this.$props.cols]),
|
|
143
|
+
}, [this.$props.cols]), s("tbody", G({
|
|
132
144
|
class: f(R.tbody({}))
|
|
133
145
|
}, this.pinnedBodyAttributes), [this.pinnedRows])])]
|
|
134
146
|
})])]);
|
|
@@ -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 e=require("vue"),r=require("@progress/kendo-vue-data-tools"),o=e.defineComponent({name:"GridTable",props:{selectable:Object,tableClassName:String},setup(a,{slots:t}){const{selectionRelease:n}=e.inject("
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("@progress/kendo-vue-data-tools"),o=e.defineComponent({name:"GridTable",props:{selectable:Object,tableClassName:String},setup(a,{slots:t}){const{selectionRelease:n}=e.inject("gridContext",{});return()=>e.createVNode(r.TableSelection,{selectable:a.selectable,onRelease:n},{default:()=>{var l;return[e.createVNode("table",{style:{tableLayout:"fixed"},role:"none",class:a.tableClassName},[(l=t.default)==null?void 0:l.call(t)])]}})}});exports.GridTable=o;
|
|
@@ -13,25 +13,25 @@ const d = /* @__PURE__ */ r({
|
|
|
13
13
|
selectable: Object,
|
|
14
14
|
tableClassName: String
|
|
15
15
|
},
|
|
16
|
-
setup(
|
|
16
|
+
setup(t, {
|
|
17
17
|
slots: e
|
|
18
18
|
}) {
|
|
19
19
|
const {
|
|
20
20
|
selectionRelease: n
|
|
21
|
-
} = o("
|
|
21
|
+
} = o("gridContext", {});
|
|
22
22
|
return () => l(b, {
|
|
23
|
-
selectable:
|
|
23
|
+
selectable: t.selectable,
|
|
24
24
|
onRelease: n
|
|
25
25
|
}, {
|
|
26
26
|
default: () => {
|
|
27
|
-
var
|
|
27
|
+
var a;
|
|
28
28
|
return [l("table", {
|
|
29
29
|
style: {
|
|
30
30
|
tableLayout: "fixed"
|
|
31
31
|
},
|
|
32
32
|
role: "none",
|
|
33
|
-
class:
|
|
34
|
-
}, [(
|
|
33
|
+
class: t.tableClassName
|
|
34
|
+
}, [(a = e.default) == null ? void 0 : a.call(e)])];
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
}
|
|
@@ -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 e=require("vue"),n=require("@progress/kendo-vue-data-tools"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("@progress/kendo-vue-data-tools"),r=e.defineComponent({name:"GridTableScrollable",props:{selectable:Object,tableClassName:Object,tableStyle:Object},setup(l,{slots:t}){const{selectionRelease:c}=e.inject("gridContext",{});return()=>{const b={...l.tableStyle};return e.createVNode(n.TableSelection,{selectable:l.selectable,onRelease:c},{default:()=>{var a;return[e.createVNode("table",{role:"none",class:l.tableClassName,style:b},[(a=t.default)==null?void 0:a.call(t)])]}})}}});exports.GridTableScrollable=r;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as n, inject as
|
|
9
|
-
import { TableSelection as
|
|
8
|
+
import { defineComponent as n, inject as r, createVNode as a } from "vue";
|
|
9
|
+
import { TableSelection as o } from "@progress/kendo-vue-data-tools";
|
|
10
10
|
const s = /* @__PURE__ */ n({
|
|
11
11
|
name: "GridTableScrollable",
|
|
12
12
|
props: {
|
|
@@ -19,12 +19,12 @@ const s = /* @__PURE__ */ n({
|
|
|
19
19
|
}) {
|
|
20
20
|
const {
|
|
21
21
|
selectionRelease: b
|
|
22
|
-
} =
|
|
22
|
+
} = r("gridContext", {});
|
|
23
23
|
return () => {
|
|
24
24
|
const c = {
|
|
25
25
|
...e.tableStyle
|
|
26
26
|
};
|
|
27
|
-
return a(
|
|
27
|
+
return a(o, {
|
|
28
28
|
selectable: e.selectable,
|
|
29
29
|
onRelease: b
|
|
30
30
|
}, {
|
|
@@ -0,0 +1,155 @@
|
|
|
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 { LocalizationService } from '@progress/kendo-vue-intl';
|
|
10
|
+
import { MenuItemModel, MenuSelectEvent } from '@progress/kendo-vue-layout';
|
|
11
|
+
import { Offset } from '@progress/kendo-vue-popup';
|
|
12
|
+
import { GridContextMenuItemNames } from './enums';
|
|
13
|
+
/**
|
|
14
|
+
* Represents the `GridContextMenuOptions`.
|
|
15
|
+
*/
|
|
16
|
+
export interface GridContextMenuOptions {
|
|
17
|
+
/**
|
|
18
|
+
* The contextmenu settings for the head of the data table.
|
|
19
|
+
*/
|
|
20
|
+
head?: boolean | (GridContextMenuItemNames | MenuItemModel)[];
|
|
21
|
+
/**
|
|
22
|
+
* The contextmenu settings for the body of the data table.
|
|
23
|
+
*/
|
|
24
|
+
body?: boolean | (GridContextMenuItemNames | MenuItemModel)[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Represents the `GridCellBaseOptions` object that are passed to the handler.
|
|
28
|
+
*/
|
|
29
|
+
export interface GridCellBaseOptions {
|
|
30
|
+
/**
|
|
31
|
+
* The data item associated with the cell.
|
|
32
|
+
*/
|
|
33
|
+
dataItem?: any;
|
|
34
|
+
/**
|
|
35
|
+
* The field name of the column associated with the cell.
|
|
36
|
+
*/
|
|
37
|
+
field?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @hidden
|
|
41
|
+
*/
|
|
42
|
+
export interface GridContextMenuItem extends MenuItemModel {
|
|
43
|
+
name?: string;
|
|
44
|
+
options?: string;
|
|
45
|
+
items?: GridContextMenuItem[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @hidden
|
|
49
|
+
*/
|
|
50
|
+
export interface GridContextMenuProps {
|
|
51
|
+
show: boolean;
|
|
52
|
+
offset: Offset;
|
|
53
|
+
onClose: () => void;
|
|
54
|
+
onSelect: (e: {
|
|
55
|
+
event: MenuSelectEvent;
|
|
56
|
+
dataItem?: any;
|
|
57
|
+
field?: string;
|
|
58
|
+
}) => void;
|
|
59
|
+
dataItem?: any;
|
|
60
|
+
field?: string;
|
|
61
|
+
items?: (GridContextMenuItemNames | GridContextMenuItem)[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @hidden
|
|
65
|
+
*/
|
|
66
|
+
export declare const contextMenuItemsMap: Record<string, GridContextMenuItem>;
|
|
67
|
+
/**
|
|
68
|
+
* @hidden
|
|
69
|
+
*/
|
|
70
|
+
export declare const getDefaultHeadContextMenuItems: (options: {
|
|
71
|
+
pdf?: boolean;
|
|
72
|
+
sortable?: boolean;
|
|
73
|
+
selectable?: boolean;
|
|
74
|
+
editable?: boolean;
|
|
75
|
+
reorderable?: boolean;
|
|
76
|
+
clipboard?: boolean;
|
|
77
|
+
}) => GridContextMenuItemNames[];
|
|
78
|
+
/**
|
|
79
|
+
* @hidden
|
|
80
|
+
*/
|
|
81
|
+
export declare const getDefaultBodyContextMenuItems: (options: {
|
|
82
|
+
pdf?: boolean;
|
|
83
|
+
sortable?: boolean;
|
|
84
|
+
selectable?: boolean;
|
|
85
|
+
editable?: boolean;
|
|
86
|
+
rowReorderable?: boolean;
|
|
87
|
+
clipboard?: boolean;
|
|
88
|
+
pinnable?: boolean;
|
|
89
|
+
}) => GridContextMenuItemNames[];
|
|
90
|
+
/**
|
|
91
|
+
* @hidden
|
|
92
|
+
*/
|
|
93
|
+
export declare const GridContextMenu: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
94
|
+
show: {
|
|
95
|
+
type: BooleanConstructor;
|
|
96
|
+
default: boolean;
|
|
97
|
+
};
|
|
98
|
+
offset: {
|
|
99
|
+
type: PropType<Offset>;
|
|
100
|
+
default: () => {
|
|
101
|
+
left: number;
|
|
102
|
+
top: number;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
dataItem: {
|
|
106
|
+
type: ObjectConstructor;
|
|
107
|
+
default: any;
|
|
108
|
+
};
|
|
109
|
+
field: {
|
|
110
|
+
type: StringConstructor;
|
|
111
|
+
default: any;
|
|
112
|
+
};
|
|
113
|
+
items: {
|
|
114
|
+
type: PropType<(GridContextMenuItemNames | GridContextMenuItem)[]>;
|
|
115
|
+
default: any;
|
|
116
|
+
};
|
|
117
|
+
}>, {}, {}, {}, {
|
|
118
|
+
localizeItem(item: GridContextMenuItem, ls: LocalizationService): GridContextMenuItem;
|
|
119
|
+
menuItems(): GridContextMenuItem[] | undefined;
|
|
120
|
+
handleSelect(event: MenuSelectEvent): void;
|
|
121
|
+
handleClose(): void;
|
|
122
|
+
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("select" | "close")[], "select" | "close", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
123
|
+
show: {
|
|
124
|
+
type: BooleanConstructor;
|
|
125
|
+
default: boolean;
|
|
126
|
+
};
|
|
127
|
+
offset: {
|
|
128
|
+
type: PropType<Offset>;
|
|
129
|
+
default: () => {
|
|
130
|
+
left: number;
|
|
131
|
+
top: number;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
dataItem: {
|
|
135
|
+
type: ObjectConstructor;
|
|
136
|
+
default: any;
|
|
137
|
+
};
|
|
138
|
+
field: {
|
|
139
|
+
type: StringConstructor;
|
|
140
|
+
default: any;
|
|
141
|
+
};
|
|
142
|
+
items: {
|
|
143
|
+
type: PropType<(GridContextMenuItemNames | GridContextMenuItem)[]>;
|
|
144
|
+
default: any;
|
|
145
|
+
};
|
|
146
|
+
}>> & Readonly<{
|
|
147
|
+
onSelect?: (...args: any[]) => any;
|
|
148
|
+
onClose?: (...args: any[]) => any;
|
|
149
|
+
}>, {
|
|
150
|
+
field: string;
|
|
151
|
+
dataItem: Record<string, any>;
|
|
152
|
+
items: (GridContextMenuItemNames | GridContextMenuItem)[];
|
|
153
|
+
offset: Offset;
|
|
154
|
+
show: boolean;
|
|
155
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -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 c=require("vue"),s=require("@progress/kendo-vue-intl"),d=require("@progress/kendo-vue-layout"),o=require("@progress/kendo-svg-icons"),t=require("./enums.js"),m={[t.GridContextMenuItemNames.create]:{name:"create",text:"Add",icon:"plus",svgIcon:o.plusIcon,data:{action:"AddCommand"}},[t.GridContextMenuItemNames.edit]:{name:"edit",text:"Edit",icon:"pencil",svgIcon:o.pencilIcon,data:{action:"EditCommand"}},[t.GridContextMenuItemNames.delete]:{name:"delete",text:"Delete",icon:"trash",svgIcon:o.trashIcon,data:{action:"DeleteCommand"}},[t.GridContextMenuItemNames.select]:{name:"select",text:"Select",icon:"table-body",svgIcon:o.tableBodyIcon,items:[{name:"selectRow",text:"Row",icon:"table-row-groups",svgIcon:o.tableRowGroupsIcon,data:{action:"SelectRowCommand"}},{name:"selectAllRows",text:"All rows",icon:"grid",svgIcon:o.gridIcon,data:{action:"SelectAllRowsCommand"}},{name:"clearSelection",text:"Clear selection",icon:"table-unmerge",svgIcon:o.tableUnmergeIcon,data:{action:"ClearSelectionCommand"}}]},[t.GridContextMenuItemNames.pinRow]:{name:"pinRow",text:"Pin row",icon:"pin-outline",svgIcon:o.pinOutlineIcon,items:[{name:"pinTop",text:"Pin to Top",icon:"pin-outline-top",svgIcon:o.pinOutlineTopIcon,data:{action:"PinTopCommand"}},{name:"pinBottom",text:"Pin to Bottom",icon:"pin-outline-bottom",svgIcon:o.pinOutlineBottomIcon,data:{action:"PinBottomCommand"}},{name:"unpin",text:"Unpin",icon:"unpin-outline",svgIcon:o.unpinOutlineIcon,data:{action:"UnpinCommand"}}]},[t.GridContextMenuItemNames.pinTop]:{name:"pinTop",text:"Pin to Top",icon:"pin-outline-top",svgIcon:o.pinOutlineTopIcon,data:{action:"PinTopCommand"}},[t.GridContextMenuItemNames.pinBottom]:{name:"pinBottom",text:"Pin to Bottom",icon:"pin-outline-bottom",svgIcon:o.pinOutlineBottomIcon,data:{action:"PinBottomCommand"}},[t.GridContextMenuItemNames.unpin]:{name:"unpin",text:"Unpin",icon:"unpin-outline",svgIcon:o.unpinOutlineIcon,data:{action:"UnpinCommand"}},[t.GridContextMenuItemNames.copySelection]:{name:"copySelection",text:"Copy selection",icon:"page-header-section",svgIcon:o.pageHeaderSectionIcon,data:{action:"CopySelectionCommand"},options:"withHeaders"},[t.GridContextMenuItemNames.copySelectionNoHeaders]:{name:"copySelectionNoHeaders",text:"Copy selection (No Headers)",icon:"file-txt",svgIcon:o.fileTxtIcon,data:{action:"CopySelectionCommand"}},[t.GridContextMenuItemNames.paste]:{name:"paste",text:"Paste (use CTRL/⌘ + V)",icon:"clipboard",svgIcon:o.clipboardIcon,data:{action:"PasteCommand"}},[t.GridContextMenuItemNames.reorderRow]:{name:"reorderRow",text:"Reorder row",icon:"caret-alt-expand",svgIcon:o.caretAltExpandIcon,items:[{name:"reorderRowUp",text:"Up",icon:"caret-alt-up",svgIcon:o.caretAltUpIcon,data:{action:"ReorderRowCommand"}},{name:"reorderRowDown",text:"Down",icon:"caret-alt-down",svgIcon:o.caretAltDownIcon,data:{action:"ReorderRowCommand"}},{name:"reorderRowTop",text:"Top",icon:"caret-alt-to-top",svgIcon:o.caretAltToTopIcon,data:{action:"ReorderRowCommand"}},{name:"reorderRowBottom",text:"Bottom",icon:"caret-alt-to-bottom",svgIcon:o.caretAltToBottomIcon,data:{action:"ReorderRowCommand"}}]},[t.GridContextMenuItemNames.exportPDF]:{name:"exportPDF",text:"Export to PDF",icon:"file-pdf",svgIcon:o.filePdfIcon,data:{action:"ExportPDFCommand"}},[t.GridContextMenuItemNames.exportExcel]:{name:"exportExcel",text:"Export to Excel",icon:"file-excel",svgIcon:o.fileExcelIcon,items:[{name:"exportToExcelAll",text:"All",data:{action:"ExportExcelCommand"}},{name:"exportToExcelSelection",text:"Selection",data:{action:"ExportExcelCommand"},options:"selection,withHeaders"},{name:"exportToExcelSelectionNoHeaders",text:"Selection (No Headers)",data:{action:"ExportExcelCommand"},options:"selection"}]},[t.GridContextMenuItemNames.separator]:{name:"separator",separator:!0},[t.GridContextMenuItemNames.sortAsc]:{name:"sortAsc",text:"Sort Ascending",icon:"sort-asc-small",svgIcon:o.sortAscSmallIcon,data:{action:"SortCommand"}},[t.GridContextMenuItemNames.sortDesc]:{name:"sortDesc",text:"Sort Descending",icon:"sort-desc-small",svgIcon:o.sortDescSmallIcon,data:{action:"SortCommand"}}},l=n=>{let e=[];return n.sortable&&(e=e.concat([t.GridContextMenuItemNames.sortAsc,t.GridContextMenuItemNames.sortDesc])),n.pdf&&(e.length&&(e=e.concat([t.GridContextMenuItemNames.separator])),e=e.concat([t.GridContextMenuItemNames.exportPDF])),e},p=n=>{let e=[];return n.clipboard&&(e=e.concat([t.GridContextMenuItemNames.copySelection,t.GridContextMenuItemNames.copySelectionNoHeaders,t.GridContextMenuItemNames.paste])),n.editable&&(e.length&&(e=e.concat([t.GridContextMenuItemNames.separator])),e=e.concat([t.GridContextMenuItemNames.create,t.GridContextMenuItemNames.edit,t.GridContextMenuItemNames.delete])),n.selectable&&(e.length&&(e=e.concat([t.GridContextMenuItemNames.separator])),e=e.concat([t.GridContextMenuItemNames.select])),n.rowReorderable&&(e.length&&(e=e.concat([t.GridContextMenuItemNames.separator])),e=e.concat([t.GridContextMenuItemNames.reorderRow])),n.pdf&&(e.length&&(e=e.concat([t.GridContextMenuItemNames.separator])),e=e.concat([t.GridContextMenuItemNames.exportPDF])),n.pinnable&&(e.length&&(e=e.concat([t.GridContextMenuItemNames.separator])),e=e.concat([t.GridContextMenuItemNames.pinRow])),e},u=c.defineComponent({name:"GridContextMenu",props:{show:{type:Boolean,default:!1},offset:{type:Object,default:()=>({left:0,top:0})},dataItem:{type:Object,default:void 0},field:{type:String,default:void 0},items:{type:Array,default:void 0}},inject:{kendoLocalizationService:{default:null}},emits:["close","select"],methods:{localizeItem(n,e){const a={...n};return a.text&&a.name&&(a.text=e.toLanguageString(`contextMenu.${a.name}`,a.text||"")),a.items&&Array.isArray(a.items)&&(a.items=a.items.map(i=>this.localizeItem(i,e))),a},menuItems(){if(this.$props.items)return this.$props.items.map(n=>typeof n=="string"?{...m[n]}:{...n})},handleSelect(n){this.$emit("select",{event:n,dataItem:this.$props.dataItem,field:this.$props.field})},handleClose(){this.$emit("close")}},render(){const n=s.provideLocalizationService(this),e=this.menuItems(),a=e==null?void 0:e.map(r=>this.localizeItem(r,n)),i=!!(this.$props.show&&(a!=null&&a.length));return c.createVNode(d.ContextMenu,{show:i,offset:this.$props.offset,items:a,onClose:this.handleClose,onSelect:this.handleSelect},null)}});exports.GridContextMenu=u;exports.contextMenuItemsMap=m;exports.getDefaultBodyContextMenuItems=p;exports.getDefaultHeadContextMenuItems=l;
|