@progress/kendo-vue-grid 8.3.0-develop.3 → 8.3.0
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 +1 -0
- package/Grid.js +1 -1
- package/Grid.mjs +127 -122
- package/cells/GridSelectionCell.d.ts +1 -1
- package/cells/GridSelectionCell.js +1 -1
- package/cells/GridSelectionCell.mjs +24 -21
- package/dist/cdn/js/kendo-vue-grid.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -13
|
@@ -38,7 +38,7 @@ declare const GridSelectionCell: import('vue').DefineComponent<import('vue').Ext
|
|
|
38
38
|
'k-table-td': boolean;
|
|
39
39
|
};
|
|
40
40
|
}, {
|
|
41
|
-
|
|
41
|
+
handleKeyDown(e: any): void;
|
|
42
42
|
handleOnChange(event: any): void;
|
|
43
43
|
triggerContextMenu(e: MouseEvent): void;
|
|
44
44
|
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
@@ -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 n=require("vue"),c=require("../utils/main.js"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),c=require("../utils/main.js"),s=require("@progress/kendo-vue-common"),a=require("@progress/kendo-vue-data-tools"),p=e=>{var t,o;return(o=(t=e.cells)==null?void 0:t.select)==null?void 0:o[e.rowType||"data"]},u=n.defineComponent({name:"KendoGridSelectionCell",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,render:[String,Function,Object],isSelected:Boolean,ariaColumnIndex:Number,editor:String,isRtl:Boolean,cells:Object},emits:{selectionchange:null,cellkeydown:null},inject:{kendoIntlService:{default:null},getKeyboardNavigationAttributes:{default:s.noop}},data(){return{inputId:s.guid()}},computed:{tdClass(){const{className:e}=this.$props;return{"k-table-td":!0,[e]:e}}},methods:{handleKeyDown(e){this.$emit("cellkeydown",{event:e,dataItem:this.$props.dataItem,field:this.$props.field}),(e.keyCode===s.Keys.enter||e.keyCode===s.Keys.space)&&this.$emit("selectionchange",{event:e,dataItem:this.$props.dataItem})},handleOnChange(e){this.$emit("selectionchange",{event:e,dataItem:this.$props.dataItem})},triggerContextMenu(e){var t,o;(o=(t=this.gridContext)==null?void 0:t.onContextMenu)==null||o.call(t,e,this.$props.dataItem,this.$props.field)}},setup(){return{gridContext:n.inject("gridContext",null)}},render(){let e,t=null;const o=this.$props.isSelected||c.getNestedValue(this.$props.field,this.$props.dataItem),r=typeof o=="boolean"&&o,i=this.$props.render,l=this.getKeyboardNavigationAttributes(this.$props.id),d=this.$props.rowType!=="groupHeader"?(e={style:this.$attrs.style,colspan:this.$props.colSpan,class:this.tdClass,"aria-colindex":this.$props.ariaColumnIndex,role:"gridcell",tabindex:l.tabIndex,"data-keyboardnavlevel":l[a.KEYBOARD_NAV_DATA_LEVEL],"data-keyboardnavid":l[a.KEYBOARD_NAV_DATA_ID]},t=n.createVNode(n.Fragment,null,[n.createVNode("span",{class:"k-checkbox-wrap"},[n.createVNode("input",{checked:r,id:this.inputId,type:"checkbox",class:"k-checkbox k-checkbox-md k-rounded-md",onChange:this.handleOnChange},null)]),n.createVNode("label",{class:"k-checkbox-label",for:this.inputId},null)]),n.createVNode("td",n.mergeProps(e,{onKeydown:this.handleKeyDown}),[t])):null;return s.getTemplate.call(this,{h:n.h,template:i||p(this.$props),defaultRendering:d,additionalProps:{...this.$props,tdProps:e},additionalListeners:{keydown:this.handleKeyDown,change:this.handleOnChange,contextmenu:this.triggerContextMenu},defaultSlots:t})}});exports.GridSelectionCell=u;
|
|
@@ -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
|
|
9
|
-
import { getNestedValue as
|
|
10
|
-
import { noop as g, getTemplate as
|
|
11
|
-
import { KEYBOARD_NAV_DATA_ID as
|
|
12
|
-
const
|
|
8
|
+
import { defineComponent as d, createVNode as o, Fragment as p, mergeProps as c, h, inject as u } from "vue";
|
|
9
|
+
import { getNestedValue as m } from "../utils/main.mjs";
|
|
10
|
+
import { noop as g, getTemplate as b, Keys as s, guid as C } from "@progress/kendo-vue-common";
|
|
11
|
+
import { KEYBOARD_NAV_DATA_ID as y, KEYBOARD_NAV_DATA_LEVEL as f } from "@progress/kendo-vue-data-tools";
|
|
12
|
+
const x = (e) => {
|
|
13
13
|
var t, n;
|
|
14
14
|
return (n = (t = e.cells) == null ? void 0 : t.select) == null ? void 0 : n[e.rowType || "data"];
|
|
15
|
-
},
|
|
15
|
+
}, N = /* @__PURE__ */ d({
|
|
16
16
|
name: "KendoGridSelectionCell",
|
|
17
17
|
inheritAttrs: !1,
|
|
18
18
|
props: {
|
|
@@ -49,7 +49,7 @@ const f = (e) => {
|
|
|
49
49
|
},
|
|
50
50
|
data() {
|
|
51
51
|
return {
|
|
52
|
-
inputId:
|
|
52
|
+
inputId: C()
|
|
53
53
|
};
|
|
54
54
|
},
|
|
55
55
|
computed: {
|
|
@@ -64,11 +64,14 @@ const f = (e) => {
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
methods: {
|
|
67
|
-
|
|
67
|
+
handleKeyDown(e) {
|
|
68
68
|
this.$emit("cellkeydown", {
|
|
69
69
|
event: e,
|
|
70
70
|
dataItem: this.$props.dataItem,
|
|
71
71
|
field: this.$props.field
|
|
72
|
+
}), (e.keyCode === s.enter || e.keyCode === s.space) && this.$emit("selectionchange", {
|
|
73
|
+
event: e,
|
|
74
|
+
dataItem: this.$props.dataItem
|
|
72
75
|
});
|
|
73
76
|
},
|
|
74
77
|
handleOnChange(e) {
|
|
@@ -89,16 +92,16 @@ const f = (e) => {
|
|
|
89
92
|
},
|
|
90
93
|
render() {
|
|
91
94
|
let e, t = null;
|
|
92
|
-
const n = this.$props.isSelected ||
|
|
95
|
+
const n = this.$props.isSelected || m(this.$props.field, this.$props.dataItem), i = typeof n == "boolean" && n, r = this.$props.render, l = this.getKeyboardNavigationAttributes(this.$props.id), a = this.$props.rowType !== "groupHeader" ? (e = {
|
|
93
96
|
style: this.$attrs.style,
|
|
94
97
|
colspan: this.$props.colSpan,
|
|
95
98
|
class: this.tdClass,
|
|
96
99
|
"aria-colindex": this.$props.ariaColumnIndex,
|
|
97
100
|
role: "gridcell",
|
|
98
|
-
tabindex:
|
|
99
|
-
"data-keyboardnavlevel":
|
|
100
|
-
"data-keyboardnavid":
|
|
101
|
-
}, t = o(
|
|
101
|
+
tabindex: l.tabIndex,
|
|
102
|
+
"data-keyboardnavlevel": l[f],
|
|
103
|
+
"data-keyboardnavid": l[y]
|
|
104
|
+
}, t = o(p, null, [o("span", {
|
|
102
105
|
class: "k-checkbox-wrap"
|
|
103
106
|
}, [o("input", {
|
|
104
107
|
checked: i,
|
|
@@ -109,19 +112,19 @@ const f = (e) => {
|
|
|
109
112
|
}, null)]), o("label", {
|
|
110
113
|
class: "k-checkbox-label",
|
|
111
114
|
for: this.inputId
|
|
112
|
-
}, null)]), o("td",
|
|
113
|
-
onKeydown: this.
|
|
115
|
+
}, null)]), o("td", c(e, {
|
|
116
|
+
onKeydown: this.handleKeyDown
|
|
114
117
|
}), [t])) : null;
|
|
115
|
-
return
|
|
116
|
-
h
|
|
117
|
-
template:
|
|
118
|
-
defaultRendering:
|
|
118
|
+
return b.call(this, {
|
|
119
|
+
h,
|
|
120
|
+
template: r || x(this.$props),
|
|
121
|
+
defaultRendering: a,
|
|
119
122
|
additionalProps: {
|
|
120
123
|
...this.$props,
|
|
121
124
|
tdProps: e
|
|
122
125
|
},
|
|
123
126
|
additionalListeners: {
|
|
124
|
-
keydown: this.
|
|
127
|
+
keydown: this.handleKeyDown,
|
|
125
128
|
change: this.handleOnChange,
|
|
126
129
|
contextmenu: this.triggerContextMenu
|
|
127
130
|
},
|
|
@@ -130,5 +133,5 @@ const f = (e) => {
|
|
|
130
133
|
}
|
|
131
134
|
});
|
|
132
135
|
export {
|
|
133
|
-
|
|
136
|
+
N as GridSelectionCell
|
|
134
137
|
};
|