@progress/kendo-vue-grid 8.1.0-develop.5 → 8.1.0-develop.7
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 +32 -17
- package/Grid.js +1 -1
- package/Grid.mjs +568 -449
- package/GridState.d.ts +17 -1
- package/GridState.js +1 -1
- package/GridState.mjs +84 -71
- package/RootGrid.d.ts +29 -0
- package/RootGrid.js +1 -1
- package/RootGrid.mjs +23 -8
- package/cells/GridCell.d.ts +2 -0
- package/cells/GridCell.js +1 -1
- package/cells/GridCell.mjs +35 -30
- package/cells/GridDetailCell.js +1 -1
- package/cells/GridDetailCell.mjs +20 -20
- package/cells/GridFilterCell.js +1 -1
- package/cells/GridFilterCell.mjs +42 -37
- package/cells/GridGroupCell.d.ts +2 -0
- package/cells/GridGroupCell.js +1 -1
- package/cells/GridGroupCell.mjs +69 -55
- package/cells/GridHierarchyCell.d.ts +2 -0
- package/cells/GridHierarchyCell.js +1 -1
- package/cells/GridHierarchyCell.mjs +51 -41
- package/cells/GridSelectionCell.d.ts +2 -0
- package/cells/GridSelectionCell.js +1 -1
- package/cells/GridSelectionCell.mjs +35 -24
- package/cells/pincell/GridPinCell.d.ts +72 -0
- package/cells/pincell/GridPinCell.js +8 -0
- package/cells/pincell/GridPinCell.mjs +111 -0
- package/cells/pincell/GridPinDropdownButton.d.ts +27 -0
- package/cells/pincell/GridPinDropdownButton.js +8 -0
- package/cells/pincell/GridPinDropdownButton.mjs +111 -0
- package/common.d.ts +6 -0
- package/common.js +1 -1
- package/common.mjs +8 -2
- package/components/PinnedRowsTable.d.ts +62 -0
- package/components/PinnedRowsTable.js +8 -0
- package/components/PinnedRowsTable.mjs +135 -0
- package/components/StickyGroupTable.d.ts +0 -1
- package/components/StickyGroupTable.js +1 -1
- package/components/StickyGroupTable.mjs +24 -30
- package/constants/main.d.ts +15 -0
- package/dist/cdn/js/kendo-vue-grid.js +1 -1
- package/drag/ColumnResize.d.ts +2 -0
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +139 -123
- package/footer/FooterCell.js +1 -1
- package/footer/FooterCell.mjs +22 -20
- package/getRowContents.js +1 -1
- package/getRowContents.mjs +50 -48
- package/header/FilterRow.d.ts +4 -0
- package/header/FilterRow.js +1 -1
- package/header/FilterRow.mjs +52 -50
- package/header/HeaderRow.d.ts +4 -0
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +114 -105
- package/index.js +1 -1
- package/index.mjs +15 -14
- package/interfaces/ColumnType.d.ts +1 -1
- package/interfaces/GridCellProps.d.ts +5 -0
- package/interfaces/GridCellsSettings.d.ts +23 -0
- package/interfaces/GridColumnProps.d.ts +2 -2
- package/interfaces/GridProps.d.ts +102 -31
- package/interfaces/GridRowProps.d.ts +13 -4
- package/interfaces/GridRowsSettings.d.ts +48 -0
- package/interfaces/events.d.ts +19 -2
- package/messages/main.d.ts +30 -0
- package/messages/main.js +2 -2
- package/messages/main.mjs +108 -96
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -12
- package/rows/GridRow.d.ts +6 -10
- package/rows/GridRow.js +1 -1
- package/rows/GridRow.mjs +31 -26
- package/utils/main.d.ts +5 -0
- package/utils/main.js +1 -1
- package/utils/main.mjs +199 -167
- package/utils/virtualColumns.js +1 -1
- package/utils/virtualColumns.mjs +121 -105
package/cells/GridDetailCell.mjs
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
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
|
-
import { KEYBOARD_NAV_DATA_ID as
|
|
11
|
-
const
|
|
8
|
+
import { defineComponent as c, createVNode as s, inject as p, h as m } from "vue";
|
|
9
|
+
import { noop as b, getTemplate as u } from "@progress/kendo-vue-common";
|
|
10
|
+
import { KEYBOARD_NAV_DATA_ID as I, KEYBOARD_NAV_DATA_LEVEL as A } from "@progress/kendo-vue-data-tools";
|
|
11
|
+
const S = /* @__PURE__ */ c({
|
|
12
12
|
props: {
|
|
13
13
|
colSpan: Number,
|
|
14
14
|
ariaColIndex: Number,
|
|
@@ -19,12 +19,12 @@ const x = /* @__PURE__ */ l({
|
|
|
19
19
|
},
|
|
20
20
|
inject: {
|
|
21
21
|
getKeyboardNavigationAttributes: {
|
|
22
|
-
default:
|
|
22
|
+
default: b
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
setup() {
|
|
26
26
|
return {
|
|
27
|
-
kendoIntlService:
|
|
27
|
+
kendoIntlService: p("kendoIntlService", {})
|
|
28
28
|
};
|
|
29
29
|
},
|
|
30
30
|
render() {
|
|
@@ -33,28 +33,28 @@ const x = /* @__PURE__ */ l({
|
|
|
33
33
|
ariaColIndex: a,
|
|
34
34
|
dataItem: n,
|
|
35
35
|
dataIndex: r,
|
|
36
|
-
id:
|
|
37
|
-
} = this.$props, t = this.getKeyboardNavigationAttributes(
|
|
38
|
-
return b.call(this, {
|
|
39
|
-
h: p,
|
|
40
|
-
template: this.$props.detail,
|
|
41
|
-
additionalProps: o
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
return c("td", {
|
|
36
|
+
id: d
|
|
37
|
+
} = this.$props, t = this.getKeyboardNavigationAttributes(d), o = {
|
|
45
38
|
class: "k-table-td k-detail-cell",
|
|
46
39
|
colspan: e,
|
|
47
40
|
"aria-colindex": a,
|
|
48
41
|
role: "gridcell",
|
|
49
42
|
tabindex: t.tabIndex,
|
|
50
|
-
"data-keyboardnavlevel": t[
|
|
51
|
-
"data-keyboardnavid": t[
|
|
52
|
-
},
|
|
43
|
+
"data-keyboardnavlevel": t[A],
|
|
44
|
+
"data-keyboardnavid": t[I]
|
|
45
|
+
}, i = function(l) {
|
|
46
|
+
return u.call(this, {
|
|
47
|
+
h: m,
|
|
48
|
+
template: this.$props.detail,
|
|
49
|
+
additionalProps: l
|
|
50
|
+
});
|
|
51
|
+
}.call(this, {
|
|
53
52
|
dataItem: n,
|
|
54
53
|
dataIndex: r
|
|
55
|
-
})
|
|
54
|
+
});
|
|
55
|
+
return s("td", o, [i]);
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
export {
|
|
59
|
-
|
|
59
|
+
S as GridDetailCell
|
|
60
60
|
};
|
package/cells/GridFilterCell.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 r=require("vue")
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),b=require("@progress/kendo-vue-buttons"),n=require("../messages/main.js"),d=require("@progress/kendo-vue-dropdowns"),h=require("@progress/kendo-vue-inputs"),S=require("@progress/kendo-vue-dateinputs"),g=require("@progress/kendo-svg-icons"),m=require("@progress/kendo-vue-intl"),c=require("../filterCommon.js"),$=require("@progress/kendo-vue-common"),k=r.defineComponent({name:"KendoGridFilterCell",inheritAttrs:!1,props:{id:String,grid:Object,field:String,filterType:String,colSpan:Number,title:String,value:[String,Number,Boolean,Date],operator:[String,Function],operators:Array,booleanValues:Array,onChange:Function,render:[String,Function,Object],ariaLabel:String,size:String},inject:{kendoLocalizationService:{default:null},kendoIntlService:{default:null}},methods:{inputChange(e,t){const i=c.cellInputChange(e,t,this.$props);this.triggerChange(i)},operatorChange(e,t){const i=c.cellOperatorChange(e.value.operator,t,this.$props.value);this.triggerChange(i)},boolDropdownChange(e,t){const i=c.cellBoolDropdownChange(e.value.operator,t);this.triggerChange(i)},clear(e){e.preventDefault(),this.triggerChange({value:"",operator:"",event:e})},triggerChange(e){e.field=this.$props.field,this.$emit("change",e)}},setup(){const e=r.inject("kendoIntlService",{}),t=r.inject("kendoLocalizationService",{});return{kendoIntlService:e,kendoLocalizationService:t}},render(){const e=m.provideLocalizationService(this),{size:t}=this.$props,i=this.$props.operators.find(l=>l.operator===this.$props.operator)||null,f=function(){if(this.$props.filterType!=="boolean")return r.createVNode(d.DropDownList,{onChange:this.operatorChange,value:i,size:t,class:"k-dropdown-operator",icon:"filter",svgIcon:g.filterIcon,iconClassName:"filter k-button-icon","data-items":this.$props.operators,textField:"text",title:e.toLanguageString(n.filterChooseOperator,n.messages[n.filterChooseOperator]),popupSettings:{width:"",anchor:""},ariaLabel:this.ariaLabel},null)},C=function(l,a){let s;switch(l){case"numeric":return r.createVNode(h.NumericTextBox,{size:t,value:a,onChange:o=>{this.inputChange(o.value,o.event)},title:this.$props.title,ariaLabel:this.ariaLabel},null);case"date":return r.createVNode(S.DatePicker,{size:t,value:a,onChange:o=>{this.inputChange(o.value,o)},title:this.$props.title,ariaLabel:this.ariaLabel},null);case"boolean":return s=this.$props.booleanValues,r.createVNode(d.DropDownList,{onChange:this.boolDropdownChange,size:t,value:s.find(o=>o.operator===(a!==null?a:"")),"data-items":s,textField:"text",title:this.$props.title,ariaLabel:this.ariaLabel},null);default:return r.createVNode(h.TextBox,{value:a||"",size:t,onInput:o=>{this.inputChange(o.target.value,o)},title:this.$props.title,"aria-label":this.ariaLabel},null)}},p={class:"k-filtercell",style:this.$attrs.style},u=r.createVNode("div",{class:"k-filtercell-wrapper"},[C.call(this,this.$props.filterType,this.$props.value),r.createVNode("div",{class:"k-filtercell-operator"},[f.call(this),r.createTextVNode(" "),r.createVNode(b.Button,{type:"button",size:t,icon:"filter-clear",svgIcon:g.filterClearIcon,class:{"k-disabled":!(!(this.$props.value===null||this.$props.value==="")||this.$props.operator)},title:e.toLanguageString(n.filterClearButton,n.messages[n.filterClearButton]),onClick:this.clear},null)])]),v=r.createVNode("div",p,[u]);return $.getTemplate.call(this,{h:r.h,template:this.$props.render,defaultRendering:v,additionalProps:{...this.$props,tdProps:p},additionalListeners:{change:this.triggerChange},defaultSlots:u,swapDefaultSlots:!0})}});exports.GridFilterCell=k;
|
package/cells/GridFilterCell.mjs
CHANGED
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as v, createVNode as i, createTextVNode as b, h as
|
|
9
|
-
import { Button as
|
|
10
|
-
import { filterClearButton as
|
|
11
|
-
import { DropDownList as
|
|
8
|
+
import { defineComponent as v, createVNode as i, createTextVNode as b, h as S, inject as c } from "vue";
|
|
9
|
+
import { Button as $ } from "@progress/kendo-vue-buttons";
|
|
10
|
+
import { filterClearButton as h, messages as u, filterChooseOperator as g } from "../messages/main.mjs";
|
|
11
|
+
import { DropDownList as d } from "@progress/kendo-vue-dropdowns";
|
|
12
12
|
import { TextBox as L, NumericTextBox as k } from "@progress/kendo-vue-inputs";
|
|
13
13
|
import { DatePicker as z } from "@progress/kendo-vue-dateinputs";
|
|
14
|
-
import { filterClearIcon as x, filterIcon as
|
|
15
|
-
import { provideLocalizationService as
|
|
16
|
-
import { cellBoolDropdownChange as
|
|
17
|
-
import {
|
|
18
|
-
const
|
|
14
|
+
import { filterClearIcon as x, filterIcon as w } from "@progress/kendo-svg-icons";
|
|
15
|
+
import { provideLocalizationService as D } from "@progress/kendo-vue-intl";
|
|
16
|
+
import { cellBoolDropdownChange as I, cellOperatorChange as y, cellInputChange as F } from "../filterCommon.mjs";
|
|
17
|
+
import { getTemplate as T } from "@progress/kendo-vue-common";
|
|
18
|
+
const K = /* @__PURE__ */ v({
|
|
19
19
|
name: "KendoGridFilterCell",
|
|
20
20
|
inheritAttrs: !1,
|
|
21
21
|
props: {
|
|
@@ -48,11 +48,11 @@ const H = /* @__PURE__ */ v({
|
|
|
48
48
|
this.triggerChange(o);
|
|
49
49
|
},
|
|
50
50
|
operatorChange(e, t) {
|
|
51
|
-
const o =
|
|
51
|
+
const o = y(e.value.operator, t, this.$props.value);
|
|
52
52
|
this.triggerChange(o);
|
|
53
53
|
},
|
|
54
54
|
boolDropdownChange(e, t) {
|
|
55
|
-
const o =
|
|
55
|
+
const o = I(e.value.operator, t);
|
|
56
56
|
this.triggerChange(o);
|
|
57
57
|
},
|
|
58
58
|
clear(e) {
|
|
@@ -67,41 +67,41 @@ const H = /* @__PURE__ */ v({
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
setup() {
|
|
70
|
-
const e =
|
|
70
|
+
const e = c("kendoIntlService", {}), t = c("kendoLocalizationService", {});
|
|
71
71
|
return {
|
|
72
72
|
kendoIntlService: e,
|
|
73
73
|
kendoLocalizationService: t
|
|
74
74
|
};
|
|
75
75
|
},
|
|
76
76
|
render() {
|
|
77
|
-
const e =
|
|
77
|
+
const e = D(this), {
|
|
78
78
|
size: t
|
|
79
|
-
} = this.$props, o = this.$props.operators.find((
|
|
79
|
+
} = this.$props, o = this.$props.operators.find((n) => n.operator === this.$props.operator) || null, f = function() {
|
|
80
80
|
if (this.$props.filterType !== "boolean")
|
|
81
|
-
return i(
|
|
81
|
+
return i(d, {
|
|
82
82
|
onChange: this.operatorChange,
|
|
83
83
|
value: o,
|
|
84
84
|
size: t,
|
|
85
85
|
class: "k-dropdown-operator",
|
|
86
86
|
icon: "filter",
|
|
87
|
-
svgIcon:
|
|
87
|
+
svgIcon: w,
|
|
88
88
|
iconClassName: "filter k-button-icon",
|
|
89
89
|
"data-items": this.$props.operators,
|
|
90
90
|
textField: "text",
|
|
91
|
-
title: e.toLanguageString(
|
|
91
|
+
title: e.toLanguageString(g, u[g]),
|
|
92
92
|
popupSettings: {
|
|
93
93
|
width: "",
|
|
94
94
|
anchor: ""
|
|
95
95
|
},
|
|
96
96
|
ariaLabel: this.ariaLabel
|
|
97
97
|
}, null);
|
|
98
|
-
},
|
|
98
|
+
}, m = function(n, a) {
|
|
99
99
|
let l;
|
|
100
|
-
switch (
|
|
100
|
+
switch (n) {
|
|
101
101
|
case "numeric":
|
|
102
102
|
return i(k, {
|
|
103
103
|
size: t,
|
|
104
|
-
value:
|
|
104
|
+
value: a,
|
|
105
105
|
onChange: (r) => {
|
|
106
106
|
this.inputChange(r.value, r.event);
|
|
107
107
|
},
|
|
@@ -111,7 +111,7 @@ const H = /* @__PURE__ */ v({
|
|
|
111
111
|
case "date":
|
|
112
112
|
return i(z, {
|
|
113
113
|
size: t,
|
|
114
|
-
value:
|
|
114
|
+
value: a,
|
|
115
115
|
onChange: (r) => {
|
|
116
116
|
this.inputChange(r.value, r);
|
|
117
117
|
},
|
|
@@ -119,10 +119,10 @@ const H = /* @__PURE__ */ v({
|
|
|
119
119
|
ariaLabel: this.ariaLabel
|
|
120
120
|
}, null);
|
|
121
121
|
case "boolean":
|
|
122
|
-
return l = this.$props.booleanValues, i(
|
|
122
|
+
return l = this.$props.booleanValues, i(d, {
|
|
123
123
|
onChange: this.boolDropdownChange,
|
|
124
124
|
size: t,
|
|
125
|
-
value: l.find((r) => r.operator === (
|
|
125
|
+
value: l.find((r) => r.operator === (a !== null ? a : "")),
|
|
126
126
|
"data-items": l,
|
|
127
127
|
textField: "text",
|
|
128
128
|
title: this.$props.title,
|
|
@@ -130,7 +130,7 @@ const H = /* @__PURE__ */ v({
|
|
|
130
130
|
}, null);
|
|
131
131
|
default:
|
|
132
132
|
return i(L, {
|
|
133
|
-
value:
|
|
133
|
+
value: a || "",
|
|
134
134
|
size: t,
|
|
135
135
|
onInput: (r) => {
|
|
136
136
|
this.inputChange(r.target.value, r);
|
|
@@ -139,14 +139,14 @@ const H = /* @__PURE__ */ v({
|
|
|
139
139
|
"aria-label": this.ariaLabel
|
|
140
140
|
}, null);
|
|
141
141
|
}
|
|
142
|
-
},
|
|
142
|
+
}, s = {
|
|
143
143
|
class: "k-filtercell",
|
|
144
144
|
style: this.$attrs.style
|
|
145
|
-
},
|
|
145
|
+
}, p = i("div", {
|
|
146
146
|
class: "k-filtercell-wrapper"
|
|
147
|
-
}, [
|
|
147
|
+
}, [m.call(this, this.$props.filterType, this.$props.value), i("div", {
|
|
148
148
|
class: "k-filtercell-operator"
|
|
149
|
-
}, [
|
|
149
|
+
}, [f.call(this), b(" "), i($, {
|
|
150
150
|
type: "button",
|
|
151
151
|
size: t,
|
|
152
152
|
icon: "filter-clear",
|
|
@@ -155,20 +155,25 @@ const H = /* @__PURE__ */ v({
|
|
|
155
155
|
/* button is always visible if there is either value or operator */
|
|
156
156
|
"k-disabled": !(!(this.$props.value === null || this.$props.value === "") || this.$props.operator)
|
|
157
157
|
},
|
|
158
|
-
title: e.toLanguageString(
|
|
158
|
+
title: e.toLanguageString(h, u[h]),
|
|
159
159
|
onClick: this.clear
|
|
160
|
-
}, null)])])
|
|
161
|
-
return
|
|
162
|
-
h:
|
|
163
|
-
template:
|
|
164
|
-
defaultRendering:
|
|
165
|
-
additionalProps:
|
|
160
|
+
}, null)])]), C = i("div", s, [p]);
|
|
161
|
+
return T.call(this, {
|
|
162
|
+
h: S,
|
|
163
|
+
template: this.$props.render,
|
|
164
|
+
defaultRendering: C,
|
|
165
|
+
additionalProps: {
|
|
166
|
+
...this.$props,
|
|
167
|
+
tdProps: s
|
|
168
|
+
},
|
|
166
169
|
additionalListeners: {
|
|
167
170
|
change: this.triggerChange
|
|
168
|
-
}
|
|
171
|
+
},
|
|
172
|
+
defaultSlots: p,
|
|
173
|
+
swapDefaultSlots: !0
|
|
169
174
|
});
|
|
170
175
|
}
|
|
171
176
|
});
|
|
172
177
|
export {
|
|
173
|
-
|
|
178
|
+
K as GridFilterCell
|
|
174
179
|
};
|
package/cells/GridGroupCell.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ declare const GridGroupCell: import('vue').DefineComponent<import('vue').Extract
|
|
|
30
30
|
ariaColumnIndex: PropType<number>;
|
|
31
31
|
group: PropType<import('@progress/kendo-vue-data-tools').GroupState>;
|
|
32
32
|
render: PropType<any>;
|
|
33
|
+
cells: PropType<import('..').GridCellsSettings>;
|
|
33
34
|
}>, {}, {}, {
|
|
34
35
|
tdClass(): {
|
|
35
36
|
[x: number]: any;
|
|
@@ -71,6 +72,7 @@ declare const GridGroupCell: import('vue').DefineComponent<import('vue').Extract
|
|
|
71
72
|
ariaColumnIndex: PropType<number>;
|
|
72
73
|
group: PropType<import('@progress/kendo-vue-data-tools').GroupState>;
|
|
73
74
|
render: PropType<any>;
|
|
75
|
+
cells: PropType<import('..').GridCellsSettings>;
|
|
74
76
|
}>> & Readonly<{
|
|
75
77
|
onChange?: (...args: any[] | unknown[]) => any;
|
|
76
78
|
onCellkeydown?: (...args: any[] | unknown[]) => any;
|
package/cells/GridGroupCell.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"),i=require("@progress/kendo-vue-common"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),i=require("@progress/kendo-vue-common"),f=require("@progress/kendo-vue-data-tools"),o=require("../messages/main.js"),S=require("@progress/kendo-vue-intl"),k=require("@progress/kendo-svg-icons"),x=e=>{var t,l;return(l=(t=e.cells)==null?void 0:t.groupHeader)==null?void 0:l[e.rowType||"data"]},A=a.defineComponent({name:"KendoGridGroupCell",inheritAttrs:!1,props:{id:String,field:String,dataItem:Object,format:String,type:String,colSpan:Number,className:String,columnIndex:Number,columnsCount:Number,rowType:String,level:Number,locked:Boolean,expanded:Boolean,editor:String,dataIndex:Number,isSelected:Boolean,isRtl:Boolean,ariaColumnIndex:Number,group:Object,render:[String,Function,Object],cells:Object},emits:{change:null,cellkeydown:null},inject:{kendo:{default:null},kendoIntlService:{default:null},kendoLocalizationService:{default:null},getKeyboardNavigationAttributes:{default:i.noop}},computed:{tdClass(){const{className:e,locked:t}=this.$props;return{"k-table-td":!0,"k-grid-content-sticky":t,[e]:e}},tdStyle(){const{locked:e}=this.$props,t=e?{position:"sticky",zIndex:2}:{};return{...this.$attrs.style,...t}},groupTdClass(){const{className:e,locked:t}=this.$props;return{"k-table-td":!0,"k-group-cell":!0,"k-grid-content-sticky":t,[e]:e}}},methods:{triggerStateChange(){var t;const e=this.kendo;(t=e==null?void 0:e.dispatchGroupExpand)==null||t.call(e,{type:f.GROUP_EXPAND_ACTION.TOGGLE,group:this.$props.group})},triggerKeydown(e,t){this.$emit("cellkeydown",{event:e,dataItem:this.$props.dataItem,dataIndex:this.$props.dataIndex,field:this.$props.field,expanded:this.$props.expanded}),!e.defaultPrevented&&e.keyCode===i.Keys.enter&&(e.preventDefault(),this.$emit("change",{dataItem:this.$props.dataItem,dataIndex:this.$props.dataIndex,event:e,level:this.$props.level,field:void 0,value:!t}),this.triggerStateChange())},clickHandler(e,t,l){e.preventDefault(),this.$emit("change",{dataItem:t,dataIndex:this.$props.dataIndex,event:e,level:this.$props.level,field:void 0,value:!l}),this.triggerStateChange()}},render(){let e=null,t,l,s=null;const{columnIndex:n,level:c,columnsCount:p,rowType:v,dataItem:d,field:u,expanded:r,render:$,locked:g}=this.$props,h=this.getKeyboardNavigationAttributes(this.$props.id),b=S.provideLocalizationService(this).toLanguageString(o.groupCaretAriaLabelCollapse,o.messages[o.groupCaretAriaLabelCollapse]),y=S.provideLocalizationService(this).toLanguageString(o.groupCaretAriaLabelExpand,o.messages[o.groupCaretAriaLabelExpand]);if(n===void 0||c===void 0||n<c||p===void 0||v!=="groupHeader"||d[u]===void 0)t={style:this.$attrs.style,key:"g"+n,class:this.groupTdClass},e=a.createVNode("td",t,null);else if(n<=c){t={style:this.tdStyle,key:"g-colspan",class:g?"k-table-td":this.tdClass,colspan:g?0:p-n,role:"gridcell","aria-colindex":this.$props.ariaColumnIndex,"aria-selected":this.$props.isSelected,"aria-expanded":r,"data-grid-col-index":this.$props.columnIndex,tabindex:h.tabIndex,"data-keyboardnavlevel":h[f.KEYBOARD_NAV_DATA_LEVEL],"data-keyboardnavid":h[f.KEYBOARD_NAV_DATA_ID]},s=a.createVNode("p",{class:"k-reset"},[a.createVNode("a",{onClick:m=>{this.clickHandler(m,d,r)},href:"#",tabindex:-1,title:r?b:y,"aria-label":r?b:y},[a.createVNode(i.Icon,{name:r?"caret-alt-down":this.isRtl?"caret-alt-left":"caret-alt-right",icon:r?k.caretAltDownIcon:this.isRtl?k.caretAltLeftIcon:k.caretAltRightIcon},null)]),d[u]?d[u].toString():""]);const C=a.createVNode("td",a.mergeProps(t,{onKeydown:m=>{this.triggerKeydown(m,r)}}),[s]);l={className:"k-table-td",role:"gridcell",colSpan:p-n,style:{borderLeftWidth:0,borderRightWidth:0}};const I=g?a.createVNode("td",l,null):null;e=I?[C,I]:C}return i.getTemplate.call(this,{h:a.h,template:$||x(this.$props),defaultRendering:e,additionalProps:{...this.$props,tdProps:t,td2Props:l},additionalListeners:{keydown:this.triggerKeydown,click:this.clickHandler},defaultSlots:s,swapDefaultSlots:!0})}});exports.GridGroupCell=A;
|
package/cells/GridGroupCell.mjs
CHANGED
|
@@ -5,13 +5,16 @@
|
|
|
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
|
-
import { KEYBOARD_NAV_DATA_ID as
|
|
11
|
-
import { groupCaretAriaLabelCollapse as
|
|
12
|
-
import { provideLocalizationService as
|
|
13
|
-
import { caretAltDownIcon as
|
|
14
|
-
const
|
|
8
|
+
import { defineComponent as x, createVNode as n, mergeProps as A, h as v } from "vue";
|
|
9
|
+
import { noop as N, Icon as L, getTemplate as w, Keys as D } from "@progress/kendo-vue-common";
|
|
10
|
+
import { KEYBOARD_NAV_DATA_ID as K, KEYBOARD_NAV_DATA_LEVEL as R, GROUP_EXPAND_ACTION as T } from "@progress/kendo-vue-data-tools";
|
|
11
|
+
import { groupCaretAriaLabelCollapse as y, messages as b, groupCaretAriaLabelExpand as I } from "../messages/main.mjs";
|
|
12
|
+
import { provideLocalizationService as S } from "@progress/kendo-vue-intl";
|
|
13
|
+
import { caretAltDownIcon as E, caretAltRightIcon as O, caretAltLeftIcon as G } from "@progress/kendo-svg-icons";
|
|
14
|
+
const _ = (e) => {
|
|
15
|
+
var t, l;
|
|
16
|
+
return (l = (t = e.cells) == null ? void 0 : t.groupHeader) == null ? void 0 : l[e.rowType || "data"];
|
|
17
|
+
}, W = /* @__PURE__ */ x({
|
|
15
18
|
name: "KendoGridGroupCell",
|
|
16
19
|
inheritAttrs: !1,
|
|
17
20
|
props: {
|
|
@@ -34,7 +37,8 @@ const P = /* @__PURE__ */ S({
|
|
|
34
37
|
isRtl: Boolean,
|
|
35
38
|
ariaColumnIndex: Number,
|
|
36
39
|
group: Object,
|
|
37
|
-
render: [String, Function, Object]
|
|
40
|
+
render: [String, Function, Object],
|
|
41
|
+
cells: Object
|
|
38
42
|
},
|
|
39
43
|
emits: {
|
|
40
44
|
change: null,
|
|
@@ -51,7 +55,7 @@ const P = /* @__PURE__ */ S({
|
|
|
51
55
|
default: null
|
|
52
56
|
},
|
|
53
57
|
getKeyboardNavigationAttributes: {
|
|
54
|
-
default:
|
|
58
|
+
default: N
|
|
55
59
|
}
|
|
56
60
|
},
|
|
57
61
|
computed: {
|
|
@@ -96,7 +100,7 @@ const P = /* @__PURE__ */ S({
|
|
|
96
100
|
var t;
|
|
97
101
|
const e = this.kendo;
|
|
98
102
|
(t = e == null ? void 0 : e.dispatchGroupExpand) == null || t.call(e, {
|
|
99
|
-
type:
|
|
103
|
+
type: T.TOGGLE,
|
|
100
104
|
group: this.$props.group
|
|
101
105
|
});
|
|
102
106
|
},
|
|
@@ -107,7 +111,7 @@ const P = /* @__PURE__ */ S({
|
|
|
107
111
|
dataIndex: this.$props.dataIndex,
|
|
108
112
|
field: this.$props.field,
|
|
109
113
|
expanded: this.$props.expanded
|
|
110
|
-
}), !e.defaultPrevented && e.keyCode ===
|
|
114
|
+
}), !e.defaultPrevented && e.keyCode === D.enter && (e.preventDefault(), this.$emit("change", {
|
|
111
115
|
dataItem: this.$props.dataItem,
|
|
112
116
|
dataIndex: this.$props.dataIndex,
|
|
113
117
|
event: e,
|
|
@@ -116,89 +120,99 @@ const P = /* @__PURE__ */ S({
|
|
|
116
120
|
value: !t
|
|
117
121
|
}), this.triggerStateChange());
|
|
118
122
|
},
|
|
119
|
-
clickHandler(e, t,
|
|
123
|
+
clickHandler(e, t, l) {
|
|
120
124
|
e.preventDefault(), this.$emit("change", {
|
|
121
125
|
dataItem: t,
|
|
122
126
|
dataIndex: this.$props.dataIndex,
|
|
123
127
|
event: e,
|
|
124
128
|
level: this.$props.level,
|
|
125
129
|
field: void 0,
|
|
126
|
-
value: !
|
|
130
|
+
value: !l
|
|
127
131
|
}), this.triggerStateChange();
|
|
128
132
|
}
|
|
129
133
|
},
|
|
130
134
|
render() {
|
|
131
|
-
let e = null;
|
|
135
|
+
let e = null, t, l, o = null;
|
|
132
136
|
const {
|
|
133
|
-
columnIndex:
|
|
134
|
-
level:
|
|
135
|
-
columnsCount:
|
|
136
|
-
rowType:
|
|
137
|
-
dataItem:
|
|
138
|
-
field:
|
|
137
|
+
columnIndex: r,
|
|
138
|
+
level: d,
|
|
139
|
+
columnsCount: s,
|
|
140
|
+
rowType: C,
|
|
141
|
+
dataItem: i,
|
|
142
|
+
field: p,
|
|
139
143
|
expanded: a,
|
|
140
|
-
render:
|
|
141
|
-
locked:
|
|
142
|
-
} = this.$props,
|
|
143
|
-
if (
|
|
144
|
-
|
|
144
|
+
render: $,
|
|
145
|
+
locked: c
|
|
146
|
+
} = this.$props, u = this.getKeyboardNavigationAttributes(this.$props.id), h = S(this).toLanguageString(y, b[y]), m = S(this).toLanguageString(I, b[I]);
|
|
147
|
+
if (r === void 0 || d === void 0 || r < d || s === void 0 || C !== "groupHeader" || i[p] === void 0)
|
|
148
|
+
t = {
|
|
145
149
|
style: this.$attrs.style,
|
|
146
|
-
key: "g" +
|
|
150
|
+
key: "g" + r,
|
|
147
151
|
class: this.groupTdClass
|
|
148
|
-
}, null);
|
|
149
|
-
else if (
|
|
150
|
-
|
|
152
|
+
}, e = n("td", t, null);
|
|
153
|
+
else if (r <= d) {
|
|
154
|
+
t = {
|
|
151
155
|
style: this.tdStyle,
|
|
152
|
-
onKeydown: (p) => {
|
|
153
|
-
this.triggerKeydown(p, a);
|
|
154
|
-
},
|
|
155
156
|
key: "g-colspan",
|
|
156
|
-
class:
|
|
157
|
-
colspan:
|
|
157
|
+
class: c ? "k-table-td" : this.tdClass,
|
|
158
|
+
colspan: c ? 0 : s - r,
|
|
158
159
|
role: "gridcell",
|
|
159
160
|
"aria-colindex": this.$props.ariaColumnIndex,
|
|
160
161
|
"aria-selected": this.$props.isSelected,
|
|
161
162
|
"aria-expanded": a,
|
|
162
163
|
"data-grid-col-index": this.$props.columnIndex,
|
|
163
|
-
tabindex:
|
|
164
|
-
"data-keyboardnavlevel":
|
|
165
|
-
"data-keyboardnavid":
|
|
166
|
-
},
|
|
164
|
+
tabindex: u.tabIndex,
|
|
165
|
+
"data-keyboardnavlevel": u[R],
|
|
166
|
+
"data-keyboardnavid": u[K]
|
|
167
|
+
}, o = n("p", {
|
|
167
168
|
class: "k-reset"
|
|
168
|
-
}, [
|
|
169
|
-
onClick: (
|
|
170
|
-
this.clickHandler(
|
|
169
|
+
}, [n("a", {
|
|
170
|
+
onClick: (g) => {
|
|
171
|
+
this.clickHandler(g, i, a);
|
|
171
172
|
},
|
|
172
173
|
href: "#",
|
|
173
174
|
tabindex: -1,
|
|
174
|
-
title: a ?
|
|
175
|
-
"aria-label": a ?
|
|
176
|
-
}, [
|
|
175
|
+
title: a ? h : m,
|
|
176
|
+
"aria-label": a ? h : m
|
|
177
|
+
}, [n(L, {
|
|
177
178
|
name: a ? "caret-alt-down" : this.isRtl ? "caret-alt-left" : "caret-alt-right",
|
|
178
|
-
icon: a ?
|
|
179
|
-
}, null)]),
|
|
179
|
+
icon: a ? E : this.isRtl ? G : O
|
|
180
|
+
}, null)]), i[p] ? i[p].toString() : ""]);
|
|
181
|
+
const f = n("td", A(t, {
|
|
182
|
+
onKeydown: (g) => {
|
|
183
|
+
this.triggerKeydown(g, a);
|
|
184
|
+
}
|
|
185
|
+
}), [o]);
|
|
186
|
+
l = {
|
|
180
187
|
className: "k-table-td",
|
|
181
188
|
role: "gridcell",
|
|
182
|
-
colSpan:
|
|
189
|
+
colSpan: s - r,
|
|
183
190
|
style: {
|
|
184
191
|
borderLeftWidth: 0,
|
|
185
192
|
borderRightWidth: 0
|
|
186
193
|
}
|
|
187
|
-
}
|
|
188
|
-
|
|
194
|
+
};
|
|
195
|
+
const k = c ? n("td", l, null) : null;
|
|
196
|
+
e = k ? [f, k] : f;
|
|
189
197
|
}
|
|
190
|
-
return
|
|
191
|
-
h:
|
|
192
|
-
template:
|
|
198
|
+
return w.call(this, {
|
|
199
|
+
h: v,
|
|
200
|
+
template: $ || _(this.$props),
|
|
193
201
|
defaultRendering: e,
|
|
194
|
-
additionalProps:
|
|
202
|
+
additionalProps: {
|
|
203
|
+
...this.$props,
|
|
204
|
+
tdProps: t,
|
|
205
|
+
td2Props: l
|
|
206
|
+
},
|
|
195
207
|
additionalListeners: {
|
|
196
208
|
keydown: this.triggerKeydown,
|
|
197
209
|
click: this.clickHandler
|
|
198
|
-
}
|
|
210
|
+
},
|
|
211
|
+
defaultSlots: o,
|
|
212
|
+
swapDefaultSlots: !0
|
|
199
213
|
});
|
|
200
214
|
}
|
|
201
215
|
});
|
|
202
216
|
export {
|
|
203
|
-
|
|
217
|
+
W as GridGroupCell
|
|
204
218
|
};
|
|
@@ -28,6 +28,7 @@ declare const GridHierarchyCell: import('vue').DefineComponent<import('vue').Ext
|
|
|
28
28
|
ariaColumnIndex: PropType<number>;
|
|
29
29
|
render: PropType<any>;
|
|
30
30
|
isRtl: PropType<boolean>;
|
|
31
|
+
cells: PropType<import('..').GridCellsSettings>;
|
|
31
32
|
}>, {}, {}, {
|
|
32
33
|
wrapperClass(): {
|
|
33
34
|
[x: number]: any;
|
|
@@ -60,6 +61,7 @@ declare const GridHierarchyCell: import('vue').DefineComponent<import('vue').Ext
|
|
|
60
61
|
ariaColumnIndex: PropType<number>;
|
|
61
62
|
render: PropType<any>;
|
|
62
63
|
isRtl: PropType<boolean>;
|
|
64
|
+
cells: PropType<import('..').GridCellsSettings>;
|
|
63
65
|
}>> & Readonly<{
|
|
64
66
|
onChange?: (...args: any[] | unknown[]) => any;
|
|
65
67
|
onCellkeydown?: (...args: any[] | unknown[]) => any;
|
|
@@ -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 i=require("vue"),l=require("@progress/kendo-vue-common"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),l=require("@progress/kendo-vue-common"),d=require("@progress/kendo-vue-data-tools"),g=require("@progress/kendo-vue-intl"),n=require("../messages/main.js"),h=require("@progress/kendo-svg-icons"),m=e=>{var t,a;return(a=(t=e.cells)==null?void 0:t.hierarchy)==null?void 0:a[e.rowType||"data"]},f=i.defineComponent({name:"KendoGridHierarchyCell",inheritAttrs:!1,props:{id:String,field:String,dataItem:Object,format:String,type:String,className:String,colSpan:Number,columnIndex:Number,columnsCount:Number,rowType:String,level:Number,expanded:Boolean,editor:String,isSelected:Boolean,dataIndex:Number,ariaColumnIndex:Number,render:[String,Function,Object],isRtl:Boolean,cells:Object},emits:{change:null,cellkeydown:null},inject:{kendo:{default:null},kendoIntlService:{default:null},kendoLocalizationService:{default:null},getKeyboardNavigationAttributes:{default:l.noop}},methods:{triggerStateChange(){const e=this.kendo;e.dataItemKey&&this.$props.dataItem[e.dataItemKey]!==void 0&&(e==null||e.dispatchDetailExpand({type:d.DETAIL_EXPAND_ACTION.TOGGLE,id:this.$props.dataItem[e.dataItemKey]}))},triggerKeydown(e,t){this.$emit("cellkeydown",{event:e,dataItem:this.$props.dataItem,field:this.$props.field,expanded:t}),!e.defaultPrevented&&e.keyCode===l.Keys.enter&&(e.preventDefault(),this.$emit("change",{dataItem:this.$props.dataItem,dataIndex:this.$props.dataIndex,event:e,field:this.$props.field,value:!t}),this.triggerStateChange())},clickHandler(e,t,a){e.preventDefault(),this.$emit("change",{dataItem:t,event:e,field:void 0,value:!a}),this.triggerStateChange()}},computed:{wrapperClass(){return{"k-table-td":!0,"k-hierarchy-cell":!0,[this.className||""]:this.className}}},render(){let e=null,t,a=null;const s=this.getKeyboardNavigationAttributes(this.$props.id),c=g.provideLocalizationService(this),p=c.toLanguageString(n.collapseDetailAriaLabel,n.messages[n.collapseDetailAriaLabel]),u=c.toLanguageString(n.expandDetailAriaLabel,n.messages[n.expandDetailAriaLabel]);if(this.$props.rowType==="groupFooter")t={class:this.wrapperClass},e=i.createVNode("td",t,null);else if(this.$props.rowType!=="groupHeader"){const r=this.$props.expanded;t={style:this.$attrs.style,class:this.wrapperClass,"aria-expanded":r?"true":"false",role:"gridcell","aria-colindex":this.$props.ariaColumnIndex,tabindex:s.tabIndex,"data-keyboardnavlevel":s[d.KEYBOARD_NAV_DATA_LEVEL],"data-keyboardnavid":s[d.KEYBOARD_NAV_DATA_ID]},a=i.createVNode("a",{onClick:o=>{this.clickHandler(o,this.$props.dataItem,r)},href:"#",tabindex:-1,title:r?p:u,"aria-label":r?p:u},[i.createVNode(l.Icon,{name:r?"minus":"plus",icon:r?h.minusIcon:h.plusIcon},null)]),e=i.createVNode("td",i.mergeProps(t,{onKeydown:o=>{this.triggerKeydown(o,r)}}),[a])}return l.getTemplate.call(this,{h:i.h,template:this.$props.render||m(this.$props),defaultRendering:e,additionalProps:{...this.$props,tdProps:t},additionalListeners:{keydown:this.triggerKeydown,click:this.clickHandler},defaultSlots:a,swapDefaultSlots:!0})}});exports.GridHierarchyCell=f;
|