@progress/kendo-vue-dropdowns 8.0.0-develop.4 → 8.0.0-develop.6
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/AutoComplete/AutoComplete.js +1 -1
- package/AutoComplete/AutoComplete.mjs +60 -59
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +268 -218
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +91 -90
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +35 -34
- package/common/DropDownBase.js +1 -1
- package/common/DropDownBase.mjs +117 -104
- package/common/List.js +1 -1
- package/common/List.mjs +127 -79
- package/common/ListGroupItem.js +1 -1
- package/common/ListGroupItem.mjs +36 -21
- package/common/ListItem.js +1 -1
- package/common/ListItem.mjs +65 -19
- package/common/ListItemIcon.js +8 -0
- package/common/ListItemIcon.mjs +34 -0
- package/common/utils.js +1 -1
- package/common/utils.mjs +53 -54
- package/dist/cdn/js/kendo-vue-dropdowns.js +1 -1
- package/index.d.mts +37 -0
- package/index.d.ts +37 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
package/common/DropDownBase.mjs
CHANGED
|
@@ -5,115 +5,128 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var p = (
|
|
11
|
-
import
|
|
12
|
-
import { Navigation as
|
|
13
|
-
import { scrollToItem as
|
|
14
|
-
import { validatePackage as
|
|
15
|
-
import { packageMetadata as
|
|
16
|
-
class
|
|
17
|
-
constructor(
|
|
18
|
-
p(this, "vs", new
|
|
19
|
-
p(this, "navigation", new
|
|
20
|
-
p(this, "handleItemClick", (
|
|
21
|
-
const
|
|
22
|
-
|
|
8
|
+
var m = Object.defineProperty;
|
|
9
|
+
var f = (l, t, o) => t in l ? m(l, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : l[t] = o;
|
|
10
|
+
var p = (l, t, o) => f(l, typeof t != "symbol" ? t + "" : t, o);
|
|
11
|
+
import S from "./VirtualScroll.mjs";
|
|
12
|
+
import { Navigation as v } from "./Navigation.mjs";
|
|
13
|
+
import { scrollToItem as y, areSame as a } from "./utils.mjs";
|
|
14
|
+
import { validatePackage as k, guid as u, templateRendering as C, getListeners as T, getTemplate as w } from "@progress/kendo-vue-common";
|
|
15
|
+
import { packageMetadata as P } from "../package-metadata.mjs";
|
|
16
|
+
class $ {
|
|
17
|
+
constructor(t) {
|
|
18
|
+
p(this, "vs", new S());
|
|
19
|
+
p(this, "navigation", new v());
|
|
20
|
+
p(this, "handleItemClick", (t, o) => {
|
|
21
|
+
const e = this.initState();
|
|
22
|
+
e.event = o, this.component.handleItemSelect(t, e), this.togglePopup(e), this.applyState(e);
|
|
23
23
|
});
|
|
24
|
-
p(this, "handleFocus", (
|
|
24
|
+
p(this, "handleFocus", (t) => {
|
|
25
25
|
if (!this.component.currentFocused) {
|
|
26
|
-
const
|
|
27
|
-
|
|
26
|
+
const o = this.initState();
|
|
27
|
+
o.data.currentFocused = !0, o.events.push({
|
|
28
28
|
type: "focus"
|
|
29
|
-
}),
|
|
29
|
+
}), o.event = t, this.applyState(o);
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
-
p(this, "filterChanged", (
|
|
33
|
-
const
|
|
32
|
+
p(this, "filterChanged", (t, o) => {
|
|
33
|
+
const e = this.component, {
|
|
34
34
|
textField: i,
|
|
35
|
-
filterable:
|
|
36
|
-
} =
|
|
37
|
-
|
|
35
|
+
filterable: n
|
|
36
|
+
} = e.$props;
|
|
37
|
+
n && (o.events.push({
|
|
38
38
|
type: "filterchange",
|
|
39
39
|
filter: {
|
|
40
40
|
field: i,
|
|
41
41
|
operator: "contains",
|
|
42
42
|
ignoreCase: !0,
|
|
43
|
-
value:
|
|
43
|
+
value: t
|
|
44
44
|
}
|
|
45
45
|
}), this.repositionPopup());
|
|
46
46
|
});
|
|
47
|
-
p(this, "togglePopup", (
|
|
48
|
-
const
|
|
49
|
-
|
|
47
|
+
p(this, "togglePopup", (t) => {
|
|
48
|
+
const o = this.component.$props, e = o.opened !== void 0 ? o.opened : this.component.currentOpened;
|
|
49
|
+
o.opened === void 0 && (t.data.currentOpened = !e), e ? t.events.push({
|
|
50
50
|
type: "close"
|
|
51
|
-
}) : (
|
|
51
|
+
}) : (t.events.push({
|
|
52
52
|
type: "open"
|
|
53
53
|
}), this.calculatePopupWidth());
|
|
54
54
|
});
|
|
55
|
-
p(this, "pageChange", (
|
|
56
|
-
const
|
|
57
|
-
|
|
55
|
+
p(this, "pageChange", (t, o) => {
|
|
56
|
+
const e = this.initState();
|
|
57
|
+
e.event = o, this.triggerOnPageChange(e, t.skip, t.take), this.applyState(e);
|
|
58
58
|
});
|
|
59
|
-
p(this, "scrollChange", (
|
|
60
|
-
this.component.$emit("scroll",
|
|
59
|
+
p(this, "scrollChange", (t) => {
|
|
60
|
+
this.component.$emit("scroll", t);
|
|
61
61
|
});
|
|
62
|
-
p(this, "scrollToVirtualItem", (
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
else if (
|
|
67
|
-
|
|
62
|
+
p(this, "scrollToVirtualItem", (t, o) => {
|
|
63
|
+
const e = this.vs;
|
|
64
|
+
if (e.enabled = !1, t.skip === 0)
|
|
65
|
+
e.reset();
|
|
66
|
+
else if (t.skip + t.pageSize === t.total)
|
|
67
|
+
e.scrollToEnd();
|
|
68
68
|
else {
|
|
69
|
-
let i =
|
|
70
|
-
i === 0 && (
|
|
69
|
+
let i = e.translate;
|
|
70
|
+
i === 0 && (e.calcScrollElementHeight(), i = e.itemHeight * t.skip, e.translateTo(i - e.itemHeight)), e.container && (e.container.scrollTop = i), this.scrollToItem(o, !0);
|
|
71
71
|
}
|
|
72
|
-
setTimeout(() =>
|
|
72
|
+
setTimeout(() => e.enabled = !0, 10);
|
|
73
73
|
});
|
|
74
|
-
p(this, "getGroupedDataModernMode", (
|
|
75
|
-
const
|
|
76
|
-
return
|
|
77
|
-
|
|
78
|
-
[
|
|
79
|
-
}),
|
|
80
|
-
}),
|
|
74
|
+
p(this, "getGroupedDataModernMode", (t, o) => {
|
|
75
|
+
const e = [];
|
|
76
|
+
return t.forEach((i, n) => {
|
|
77
|
+
t[n - 1] && i[o] !== t[n - 1][o] && e.push({
|
|
78
|
+
[o]: i[o]
|
|
79
|
+
}), e.push(t[n]);
|
|
80
|
+
}), e;
|
|
81
81
|
});
|
|
82
|
-
p(this, "resetGroupStickyHeader", (
|
|
83
|
-
const
|
|
84
|
-
|
|
82
|
+
p(this, "resetGroupStickyHeader", (t, o) => {
|
|
83
|
+
const e = this.initState();
|
|
84
|
+
t !== o.group && o.state && (o.state.data.group = t, this.applyState(e));
|
|
85
85
|
});
|
|
86
|
-
|
|
86
|
+
k(P), this.listBoxId = u(), this.guid = u(), this.component = t, this.vs.PageChange = this.pageChange, this.vs.ScrollChange = this.scrollChange;
|
|
87
87
|
}
|
|
88
88
|
didMount() {
|
|
89
|
-
const
|
|
90
|
-
let
|
|
91
|
-
i === void 0 && this.calculatePopupWidth(),
|
|
89
|
+
const t = this.component.$props, o = t.popupSettings, e = t.style, i = o && o.width;
|
|
90
|
+
let n = t.opened === !0;
|
|
91
|
+
i === void 0 && this.calculatePopupWidth(), t.dir === void 0 && e && e.direction === void 0 && (this.calculateDir(), n = !0), n && this.component.$forceUpdate();
|
|
92
92
|
}
|
|
93
93
|
calculateDir() {
|
|
94
94
|
this.component.element && (this.dirCalculated = window.getComputedStyle(this.component.element).direction || void 0);
|
|
95
95
|
}
|
|
96
96
|
calculatePopupWidth() {
|
|
97
|
-
const
|
|
98
|
-
this.wrapper && !
|
|
97
|
+
const t = this.component.$props, o = t.popupSettings, e = o && o.width;
|
|
98
|
+
this.wrapper && !e && (this.component.popupWidth = t.popupSettings.width !== void 0 ? t.popupSettings.width : this.wrapper.offsetWidth + "px");
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
100
|
+
scrollVirtualized(t) {
|
|
101
|
+
const o = this.list || this.vs.list, e = o == null ? void 0 : o.querySelector(".k-list-item");
|
|
102
|
+
if (!e)
|
|
103
|
+
return;
|
|
104
|
+
const i = this.vs, n = i.container || o.parentNode;
|
|
105
|
+
n && y(n, e.offsetHeight, t, i.translate);
|
|
106
|
+
}
|
|
107
|
+
scrollNonVirtualized(t, o) {
|
|
108
|
+
const e = o.parentNode;
|
|
109
|
+
if (!e || e.scrollHeight <= e.offsetHeight)
|
|
110
|
+
return;
|
|
111
|
+
const n = e.querySelectorAll(".k-list-item, .k-list-group-item")[t];
|
|
112
|
+
if (!n)
|
|
113
|
+
return;
|
|
114
|
+
const s = n.getBoundingClientRect(), c = e.getBoundingClientRect(), r = s.top - c.top + e.scrollTop, g = r + s.height, h = e.scrollTop, d = h + e.offsetHeight;
|
|
115
|
+
g > d ? e.scrollTop = r + s.height - e.offsetHeight : r < h && (e.scrollTop = r);
|
|
116
|
+
}
|
|
117
|
+
scrollToItem(t, o) {
|
|
118
|
+
const e = this.list || this.vs.list;
|
|
119
|
+
if (!e || t < 0)
|
|
120
|
+
return;
|
|
121
|
+
(o != null ? o : this.vs.enabled) ? this.scrollVirtualized(t) : this.scrollNonVirtualized(t, e);
|
|
109
122
|
}
|
|
110
123
|
repositionPopup() {
|
|
111
|
-
const
|
|
124
|
+
const t = this.component;
|
|
112
125
|
setTimeout(function() {
|
|
113
|
-
const
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
116
|
-
|
|
126
|
+
const o = t.$refs.container;
|
|
127
|
+
if (o) {
|
|
128
|
+
const e = o.$refs.popup;
|
|
129
|
+
e && e.show && e.reposition();
|
|
117
130
|
}
|
|
118
131
|
}, 5);
|
|
119
132
|
}
|
|
@@ -124,63 +137,63 @@ class C {
|
|
|
124
137
|
event: void 0
|
|
125
138
|
};
|
|
126
139
|
}
|
|
127
|
-
applyState(
|
|
128
|
-
Object.keys(
|
|
129
|
-
this.component[i] =
|
|
140
|
+
applyState(t) {
|
|
141
|
+
Object.keys(t.data).length > 0 && Object.keys(t.data).forEach((i) => {
|
|
142
|
+
this.component[i] = t.data[i];
|
|
130
143
|
});
|
|
131
|
-
const
|
|
132
|
-
event:
|
|
144
|
+
const o = this.component.primitiveValue(), e = {
|
|
145
|
+
event: t.event,
|
|
133
146
|
component: this.component,
|
|
134
147
|
target: {
|
|
135
148
|
name: this.component.$props.name,
|
|
136
|
-
value:
|
|
149
|
+
value: o
|
|
137
150
|
},
|
|
138
|
-
value:
|
|
151
|
+
value: o
|
|
139
152
|
};
|
|
140
|
-
|
|
153
|
+
t.events.forEach((i) => {
|
|
141
154
|
const {
|
|
142
|
-
type:
|
|
155
|
+
type: n
|
|
143
156
|
} = i;
|
|
144
|
-
delete i.type,
|
|
145
|
-
...
|
|
157
|
+
delete i.type, n && (n === "change" && (this.component.$emit("changemodel", o), this.component.$emit("update:modelValue", o)), this.component.$emit(n, {
|
|
158
|
+
...e,
|
|
146
159
|
...i
|
|
147
160
|
}));
|
|
148
161
|
});
|
|
149
162
|
}
|
|
150
|
-
triggerOnPageChange(
|
|
163
|
+
triggerOnPageChange(t, o, e) {
|
|
151
164
|
const i = this.component.$props.virtual;
|
|
152
165
|
if (i) {
|
|
153
|
-
const
|
|
154
|
-
|
|
166
|
+
const n = Math.min(Math.max(0, o), Math.max(0, i.total - e));
|
|
167
|
+
n !== i.skip && t.events.push({
|
|
155
168
|
type: "pagechange",
|
|
156
169
|
page: {
|
|
157
|
-
skip:
|
|
158
|
-
take:
|
|
170
|
+
skip: n,
|
|
171
|
+
take: e
|
|
159
172
|
}
|
|
160
173
|
});
|
|
161
174
|
}
|
|
162
175
|
}
|
|
163
|
-
triggerPageChangeCornerItems(
|
|
164
|
-
const
|
|
176
|
+
triggerPageChangeCornerItems(t, o) {
|
|
177
|
+
const e = this.component.$props, {
|
|
165
178
|
dataItems: i = [],
|
|
166
|
-
dataItemKey:
|
|
179
|
+
dataItemKey: n,
|
|
167
180
|
virtual: s
|
|
168
|
-
} =
|
|
169
|
-
|
|
181
|
+
} = e, c = e.opened !== void 0 ? e.opened : this.component.currentOpened;
|
|
182
|
+
t && s && this.vs.enabled && (s.skip > 0 && a(t, i[0], n) ? this.triggerOnPageChange(o, s.skip - 1, s.pageSize) : s.skip + s.pageSize < s.total && a(t, i[i.length - 1], n) ? this.triggerOnPageChange(o, s.skip + 1, s.pageSize) : !c && s.skip + s.pageSize < s.total && a(t, i[i.length - 1], n) && this.triggerOnPageChange(o, s.skip + 1, s.pageSize));
|
|
170
183
|
}
|
|
171
|
-
getTemplateDef(
|
|
172
|
-
const
|
|
173
|
-
return
|
|
174
|
-
h:
|
|
175
|
-
template:
|
|
184
|
+
getTemplateDef(t, o) {
|
|
185
|
+
const e = C.call(this, t, T.call(this));
|
|
186
|
+
return w.call(this, {
|
|
187
|
+
h: o,
|
|
188
|
+
template: e
|
|
176
189
|
});
|
|
177
190
|
}
|
|
178
|
-
getListItemHeight(
|
|
179
|
-
const
|
|
180
|
-
return
|
|
191
|
+
getListItemHeight(t) {
|
|
192
|
+
const o = t && window.getComputedStyle(t);
|
|
193
|
+
return o ? o.height.slice(0, o.height.length - 2) : 0;
|
|
181
194
|
}
|
|
182
195
|
}
|
|
183
|
-
p(
|
|
196
|
+
p($, "defaultProps", {
|
|
184
197
|
popupSettings: {
|
|
185
198
|
animate: !0,
|
|
186
199
|
height: "200px"
|
|
@@ -189,5 +202,5 @@ p(C, "defaultProps", {
|
|
|
189
202
|
validityStyles: !0
|
|
190
203
|
});
|
|
191
204
|
export {
|
|
192
|
-
|
|
205
|
+
$ as default
|
|
193
206
|
};
|
package/common/List.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"),_=require("./ListItem.js"),E=require("./ListGroupItem.js"),j=require("./utils.js"),p=require("@progress/kendo-vue-common"),H=require("@progress/kendo-vue-intl"),S=require("../messages/main.js"),T=i.defineComponent({name:"list",emits:{listclick:s=>!0,scroll:s=>!0},inheritAttrs:!1,props:{id:String,show:Boolean,dataItems:Array,value:[Object,String,Number,Boolean,Array],textField:String,valueField:String,optionsGuid:String,wrapperCssClass:String,wrapperStyle:Object,listStyle:Object,skip:Number,focusedIndex:Number,highlightSelected:{type:Boolean,default:!0},itemRender:[String,Function,Object],groupHeaderItemRender:[String,Function,Object],noDataRender:[String,Function,Object],scroller:Boolean,groupField:String,actionsField:String,descriptionField:String,iconField:String,svgIconField:String,checkboxField:String},inject:{kendoLocalizationService:{default:null}},setup(){const s=i.ref(null),a=i.inject("kendoLocalizationService",{});return{listRef:s,kendoLocalizationService:a}},mounted(){this.list=p.getRef(this,"list")},methods:{handleClick(s,a){this.$emit("listclick",s,a)},handleScroll(s){this.$emit("scroll",s)}},render(){const s=p.getDefaultSlots(this),a=H.provideLocalizationService(this),{id:F,show:y,wrapperCssClass:V,wrapperStyle:C,listStyle:m,listRef:M}=this.$props,b=function(){const t=this.$props.noDataRender,n=i.createVNode("div",{class:"k-nodata","aria-live":"polite"},[i.createVNode("div",null,[a.toLanguageString(S.nodata,S.messages[S.nodata])])]);return p.getTemplate.call(this,{h:i.h,template:t,defaultRendering:n})},k=function(){const{textField:t,valueField:n,optionsGuid:e,skip:u=0,focusedIndex:c,highlightSelected:r,value:d,groupField:o,itemRender:I,groupHeaderItemRender:h,dataItems:g,actionsField:q,descriptionField:w,iconField:x,svgIconField:L,checkboxField:A}=this.$props,N=Array.isArray(d);let $=0;return g.map(function(l,R){const G=u+R;if(o&&(l==null?void 0:l[o])!==void 0&&(t?l[t]===void 0:Object.keys(l).length===1))return i.createVNode(E.ListGroupItem,{id:`option-${e}-${G}`,key:R+"-group-item",group:l[o],render:h,iconField:x,svgIconField:L,groupItem:l},null);const f=u+$;$+=1;const z=r&&(!N&&j.areSame(l,d,n)||N&&d.findIndex(B=>j.areSame(B,l,n))!==-1),D=c===f;return i.createVNode(_.ListItem,{id:`option-${e}-${G}`,dataItem:l,selected:z,focused:D,index:f,key:`item-${f}`,onItemClick:this.handleClick,textField:t,render:I,actionsField:q,descriptionField:w,iconField:x,svgIconField:L,checkboxField:A},null)},this)}.call(this),v=k.filter(t=>t),O=function(){if(!this.$props.groupField)return i.createVNode("ul",{id:F,role:"listbox","aria-hidden":y?void 0:!0,class:"k-list-ul",ref:p.setRef(this,"list"),style:m},[v]);const t=[];let n=[];return v.forEach(e=>{var r,d;(((r=e==null?void 0:e.type)==null?void 0:r.name)||((d=e==null?void 0:e.type)==null?void 0:d.__name)||"")==="ListGroupItem"?(n.length>0&&t.push(n),n=[e]):e&&n.push(e)}),n.length>0&&t.push(n),t.map((e,u)=>{var d;const c=e.find(o=>{var h,g;return(((h=o==null?void 0:o.type)==null?void 0:h.name)||((g=o==null?void 0:o.type)==null?void 0:g.__name)||"")==="ListGroupItem"}),r=(d=c==null?void 0:c.props)==null?void 0:d.id;return i.createVNode("ul",{id:r?void 0:F,key:r||`group-${u}`,role:r?"group":void 0,"aria-labelledby":r,class:"k-list-ul",ref:r?void 0:p.setRef(this,"list"),style:m},[e])})};return k.length?i.createVNode("div",{class:V,style:C,role:this.$props.groupField?"listbox":void 0,"aria-hidden":this.$props.groupField&&!y?!0:void 0,unselectable:"on",onScroll:this.handleScroll},[O.call(this),s]):b.call(this)}});exports.List=T;
|
package/common/List.mjs
CHANGED
|
@@ -5,18 +5,18 @@
|
|
|
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 { ListItem as
|
|
10
|
-
import { ListGroupItem as
|
|
11
|
-
import { areSame as
|
|
12
|
-
import { getDefaultSlots as
|
|
13
|
-
import { provideLocalizationService as
|
|
14
|
-
import { nodata as
|
|
15
|
-
const
|
|
8
|
+
import { defineComponent as H, createVNode as d, ref as V, inject as T, h as q } from "vue";
|
|
9
|
+
import { ListItem as J } from "./ListItem.mjs";
|
|
10
|
+
import { ListGroupItem as K } from "./ListGroupItem.mjs";
|
|
11
|
+
import { areSame as G } from "./utils.mjs";
|
|
12
|
+
import { getDefaultSlots as M, getRef as P, getTemplate as Q, setRef as j } from "@progress/kendo-vue-common";
|
|
13
|
+
import { provideLocalizationService as U } from "@progress/kendo-vue-intl";
|
|
14
|
+
import { nodata as N, messages as W } from "../messages/main.mjs";
|
|
15
|
+
const de = /* @__PURE__ */ H({
|
|
16
16
|
name: "list",
|
|
17
17
|
emits: {
|
|
18
|
-
listclick: (
|
|
19
|
-
scroll: (
|
|
18
|
+
listclick: (l) => !0,
|
|
19
|
+
scroll: (l) => !0
|
|
20
20
|
},
|
|
21
21
|
inheritAttrs: !1,
|
|
22
22
|
props: {
|
|
@@ -40,7 +40,12 @@ const te = /* @__PURE__ */ D({
|
|
|
40
40
|
groupHeaderItemRender: [String, Function, Object],
|
|
41
41
|
noDataRender: [String, Function, Object],
|
|
42
42
|
scroller: Boolean,
|
|
43
|
-
groupField: String
|
|
43
|
+
groupField: String,
|
|
44
|
+
actionsField: String,
|
|
45
|
+
descriptionField: String,
|
|
46
|
+
iconField: String,
|
|
47
|
+
svgIconField: String,
|
|
48
|
+
checkboxField: String
|
|
44
49
|
},
|
|
45
50
|
inject: {
|
|
46
51
|
kendoLocalizationService: {
|
|
@@ -48,92 +53,135 @@ const te = /* @__PURE__ */ D({
|
|
|
48
53
|
}
|
|
49
54
|
},
|
|
50
55
|
setup() {
|
|
51
|
-
const
|
|
56
|
+
const l = V(null), a = T("kendoLocalizationService", {});
|
|
52
57
|
return {
|
|
53
|
-
listRef:
|
|
54
|
-
kendoLocalizationService:
|
|
58
|
+
listRef: l,
|
|
59
|
+
kendoLocalizationService: a
|
|
55
60
|
};
|
|
56
61
|
},
|
|
57
62
|
mounted() {
|
|
58
|
-
this.list =
|
|
63
|
+
this.list = P(this, "list");
|
|
59
64
|
},
|
|
60
65
|
methods: {
|
|
61
|
-
handleClick(
|
|
62
|
-
this.$emit("listclick",
|
|
66
|
+
handleClick(l, a) {
|
|
67
|
+
this.$emit("listclick", l, a);
|
|
63
68
|
},
|
|
64
|
-
handleScroll(
|
|
65
|
-
this.$emit("scroll",
|
|
69
|
+
handleScroll(l) {
|
|
70
|
+
this.$emit("scroll", l);
|
|
66
71
|
}
|
|
67
72
|
},
|
|
68
73
|
render() {
|
|
69
|
-
const
|
|
70
|
-
id:
|
|
71
|
-
show:
|
|
72
|
-
wrapperCssClass:
|
|
73
|
-
wrapperStyle:
|
|
74
|
-
listStyle:
|
|
75
|
-
listRef:
|
|
76
|
-
} = this.$props,
|
|
77
|
-
const
|
|
78
|
-
class: "k-nodata"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
74
|
+
const l = M(this), a = U(this), {
|
|
75
|
+
id: g,
|
|
76
|
+
show: S,
|
|
77
|
+
wrapperCssClass: C,
|
|
78
|
+
wrapperStyle: O,
|
|
79
|
+
listStyle: m,
|
|
80
|
+
listRef: X
|
|
81
|
+
} = this.$props, b = function() {
|
|
82
|
+
const t = this.$props.noDataRender, i = d("div", {
|
|
83
|
+
class: "k-nodata",
|
|
84
|
+
"aria-live": "polite"
|
|
85
|
+
}, [d("div", null, [a.toLanguageString(N, W[N])])]);
|
|
86
|
+
return Q.call(this, {
|
|
87
|
+
h: q,
|
|
88
|
+
template: t,
|
|
89
|
+
defaultRendering: i
|
|
84
90
|
});
|
|
85
|
-
},
|
|
91
|
+
}, F = function() {
|
|
86
92
|
const {
|
|
87
|
-
textField:
|
|
88
|
-
valueField:
|
|
89
|
-
optionsGuid:
|
|
90
|
-
skip:
|
|
91
|
-
focusedIndex:
|
|
92
|
-
highlightSelected:
|
|
93
|
-
value:
|
|
94
|
-
groupField:
|
|
95
|
-
itemRender:
|
|
96
|
-
groupHeaderItemRender:
|
|
97
|
-
dataItems:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
93
|
+
textField: t,
|
|
94
|
+
valueField: i,
|
|
95
|
+
optionsGuid: e,
|
|
96
|
+
skip: p = 0,
|
|
97
|
+
focusedIndex: c,
|
|
98
|
+
highlightSelected: n,
|
|
99
|
+
value: s,
|
|
100
|
+
groupField: r,
|
|
101
|
+
itemRender: k,
|
|
102
|
+
groupHeaderItemRender: u,
|
|
103
|
+
dataItems: h,
|
|
104
|
+
actionsField: A,
|
|
105
|
+
descriptionField: z,
|
|
106
|
+
iconField: v,
|
|
107
|
+
svgIconField: I,
|
|
108
|
+
checkboxField: D
|
|
109
|
+
} = this.$props, x = Array.isArray(s);
|
|
110
|
+
let $ = 0;
|
|
111
|
+
return h.map(function(o, L) {
|
|
112
|
+
const R = p + L;
|
|
113
|
+
if (r && (o == null ? void 0 : o[r]) !== void 0 && (t ? o[t] === void 0 : Object.keys(o).length === 1))
|
|
114
|
+
return d(K, {
|
|
115
|
+
id: `option-${e}-${R}`,
|
|
116
|
+
key: L + "-group-item",
|
|
117
|
+
group: o[r],
|
|
118
|
+
render: u,
|
|
119
|
+
iconField: v,
|
|
120
|
+
svgIconField: I,
|
|
121
|
+
groupItem: o
|
|
122
|
+
}, null);
|
|
123
|
+
const f = p + $;
|
|
124
|
+
$ += 1;
|
|
125
|
+
const B = n && (!x && G(o, s, i) || x && s.findIndex((E) => G(E, o, i)) !== -1), _ = c === f;
|
|
126
|
+
return d(J, {
|
|
127
|
+
id: `option-${e}-${R}`,
|
|
128
|
+
dataItem: o,
|
|
129
|
+
selected: B,
|
|
130
|
+
focused: _,
|
|
131
|
+
index: f,
|
|
132
|
+
key: `item-${f}`,
|
|
115
133
|
onItemClick: this.handleClick,
|
|
116
|
-
textField:
|
|
117
|
-
render:
|
|
134
|
+
textField: t,
|
|
135
|
+
render: k,
|
|
136
|
+
actionsField: A,
|
|
137
|
+
descriptionField: z,
|
|
138
|
+
iconField: v,
|
|
139
|
+
svgIconField: I,
|
|
140
|
+
checkboxField: D
|
|
118
141
|
}, null);
|
|
119
142
|
}, this);
|
|
120
|
-
}.call(this)
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
143
|
+
}.call(this), y = F.filter((t) => t), w = function() {
|
|
144
|
+
if (!this.$props.groupField)
|
|
145
|
+
return d("ul", {
|
|
146
|
+
id: g,
|
|
147
|
+
role: "listbox",
|
|
148
|
+
"aria-hidden": S ? void 0 : !0,
|
|
149
|
+
class: "k-list-ul",
|
|
150
|
+
ref: j(this, "list"),
|
|
151
|
+
style: m
|
|
152
|
+
}, [y]);
|
|
153
|
+
const t = [];
|
|
154
|
+
let i = [];
|
|
155
|
+
return y.forEach((e) => {
|
|
156
|
+
var n, s;
|
|
157
|
+
(((n = e == null ? void 0 : e.type) == null ? void 0 : n.name) || ((s = e == null ? void 0 : e.type) == null ? void 0 : s.__name) || "") === "ListGroupItem" ? (i.length > 0 && t.push(i), i = [e]) : e && i.push(e);
|
|
158
|
+
}), i.length > 0 && t.push(i), t.map((e, p) => {
|
|
159
|
+
var s;
|
|
160
|
+
const c = e.find((r) => {
|
|
161
|
+
var u, h;
|
|
162
|
+
return (((u = r == null ? void 0 : r.type) == null ? void 0 : u.name) || ((h = r == null ? void 0 : r.type) == null ? void 0 : h.__name) || "") === "ListGroupItem";
|
|
163
|
+
}), n = (s = c == null ? void 0 : c.props) == null ? void 0 : s.id;
|
|
164
|
+
return d("ul", {
|
|
165
|
+
id: n ? void 0 : g,
|
|
166
|
+
key: n || `group-${p}`,
|
|
167
|
+
role: n ? "group" : void 0,
|
|
168
|
+
"aria-labelledby": n,
|
|
169
|
+
class: "k-list-ul",
|
|
170
|
+
ref: n ? void 0 : j(this, "list"),
|
|
171
|
+
style: m
|
|
172
|
+
}, [e]);
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
return F.length ? d("div", {
|
|
176
|
+
class: C,
|
|
177
|
+
style: O,
|
|
178
|
+
role: this.$props.groupField ? "listbox" : void 0,
|
|
179
|
+
"aria-hidden": this.$props.groupField && !S ? !0 : void 0,
|
|
124
180
|
unselectable: "on",
|
|
125
181
|
onScroll: this.handleScroll
|
|
126
|
-
}, [
|
|
127
|
-
id: I,
|
|
128
|
-
role: "listbox",
|
|
129
|
-
"aria-live": "polite",
|
|
130
|
-
"aria-hidden": b ? void 0 : !0,
|
|
131
|
-
class: "k-list-ul",
|
|
132
|
-
ref: T(this, "list"),
|
|
133
|
-
style: F
|
|
134
|
-
}, [f]), e]) : C.call(this);
|
|
182
|
+
}, [w.call(this), l]) : b.call(this);
|
|
135
183
|
}
|
|
136
184
|
});
|
|
137
185
|
export {
|
|
138
|
-
|
|
186
|
+
de as List
|
|
139
187
|
};
|
package/common/ListGroupItem.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 t=require("vue"),c=require("@progress/kendo-vue-common"),a=require("./ListItemIcon.js"),p=t.defineComponent({name:"ListGroupItem",inheritAttrs:!1,props:{id:String,group:String,render:Object,iconField:String,svgIconField:String,groupItem:Object,isMultiColumn:Boolean},render(){const{id:r,group:s,virtual:i,render:l,iconField:n,svgIconField:o,groupItem:e,isMultiColumn:d=!1}=this.$props,u=t.createVNode("li",{id:r,role:"presentation",class:"k-list-group-item",style:d?{boxSizing:"inherit",position:i?"relative":"unset"}:{position:i?"relative":"unset"}},[(o||n)&&t.createVNode(a.ListItemIcon,{icon:n?e==null?void 0:e.groupIcon:void 0,svgIcon:o?e==null?void 0:e.groupSvgIcon:void 0},null),t.createVNode("span",{class:l?void 0:"k-list-item-text"},[s])]);return c.getTemplate.call(this,{h:t.h,template:this.$props.render,defaultRendering:u,additionalProps:{...this.$props}})}});exports.ListGroupItem=p;
|