@progress/kendo-vue-dropdowns 9.3.0-develop.2 → 9.3.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/MultiSelect/MultiSelect.d.ts +27 -1
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +447 -281
- package/MultiSelect/MultiSelectProps.d.ts +53 -0
- package/MultiSelect/TagList.d.ts +15 -1
- package/MultiSelect/TagList.js +1 -1
- package/MultiSelect/TagList.mjs +55 -40
- package/common/DropDownBase.js +1 -1
- package/common/DropDownBase.mjs +13 -13
- package/common/List.d.ts +3 -0
- package/common/List.js +1 -1
- package/common/List.mjs +61 -58
- package/common/ListItem.d.ts +7 -0
- package/common/ListItem.js +1 -1
- package/common/ListItem.mjs +36 -29
- package/common/VirtualScroll.d.ts +1 -1
- package/dist/cdn/js/kendo-vue-dropdowns.js +1 -1
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/messages/main.d.ts +15 -0
- package/messages/main.js +1 -1
- package/messages/main.mjs +19 -13
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
|
@@ -44,6 +44,31 @@ export interface MultiSelectBlurEvent extends BlurEvent {
|
|
|
44
44
|
*/
|
|
45
45
|
export interface MultiSelectPageChangeEvent extends PageChangeEvent {
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Represents the object of the `selectAllChange` MultiSelect event.
|
|
49
|
+
*/
|
|
50
|
+
export interface MultiSelectSelectAllChangeEvent {
|
|
51
|
+
/**
|
|
52
|
+
* A native DOM event.
|
|
53
|
+
*/
|
|
54
|
+
event: any;
|
|
55
|
+
/**
|
|
56
|
+
* An event target.
|
|
57
|
+
*/
|
|
58
|
+
target: any;
|
|
59
|
+
/**
|
|
60
|
+
* Indicates whether all items should be selected (`true`) or deselected (`false`).
|
|
61
|
+
*/
|
|
62
|
+
allSelected: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Indicates whether `preventDefault()` was called on this event.
|
|
65
|
+
*/
|
|
66
|
+
defaultPrevented?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Call this method to skip the built-in select-all toggle and apply custom selection logic instead.
|
|
69
|
+
*/
|
|
70
|
+
preventDefault(): void;
|
|
71
|
+
}
|
|
47
72
|
/**
|
|
48
73
|
* Represents the props of the [Kendo UI for Vue MultiSelect component]({% slug overview_multiselect %}).
|
|
49
74
|
*/
|
|
@@ -297,4 +322,32 @@ export interface MultiSelectProps extends FormComponentProps {
|
|
|
297
322
|
* Attributes which are essential for certain component functionalities cannot be changed.
|
|
298
323
|
*/
|
|
299
324
|
inputAttributes?: Object;
|
|
325
|
+
/**
|
|
326
|
+
* Controls whether a built-in `Select all` option appears at the top of the popup list.
|
|
327
|
+
* Selecting this option toggles all currently applicable items.
|
|
328
|
+
*
|
|
329
|
+
* @default false
|
|
330
|
+
*/
|
|
331
|
+
selectAll?: boolean;
|
|
332
|
+
/**
|
|
333
|
+
* Controls whether checkboxes are rendered in the select-all header and in each list item.
|
|
334
|
+
* The checkbox state reflects the selected state of the items.
|
|
335
|
+
*
|
|
336
|
+
* @default false
|
|
337
|
+
*/
|
|
338
|
+
checkboxes?: boolean;
|
|
339
|
+
/**
|
|
340
|
+
* Specifies the maximum number of individual tag chips to display before showing a summary tag.
|
|
341
|
+
* When the number of selected items exceeds this value, the first `summarizeAfter` items
|
|
342
|
+
* are shown as individual chips and the remaining items are collapsed into a summary chip.
|
|
343
|
+
*
|
|
344
|
+
* @default 10
|
|
345
|
+
*/
|
|
346
|
+
summarizeAfter?: number;
|
|
347
|
+
/**
|
|
348
|
+
* Fires when the select-all item is clicked.
|
|
349
|
+
* When provided, the component delegates the select-all logic to the consumer.
|
|
350
|
+
* Useful for virtualization scenarios where the consumer manages the full dataset.
|
|
351
|
+
*/
|
|
352
|
+
onSelectAllChange?: (event: MultiSelectSelectAllChangeEvent) => void;
|
|
300
353
|
}
|
package/MultiSelect/TagList.d.ts
CHANGED
|
@@ -32,6 +32,8 @@ export interface TagListProps {
|
|
|
32
32
|
size?: 'small' | 'medium' | 'large';
|
|
33
33
|
fillMode?: 'solid' | 'outline' | 'flat';
|
|
34
34
|
tagsRounded?: 'none' | 'small' | 'medium' | 'large' | 'full';
|
|
35
|
+
summarizeAfter?: number;
|
|
36
|
+
summaryText?: string;
|
|
35
37
|
}
|
|
36
38
|
/**
|
|
37
39
|
* @hidden
|
|
@@ -56,6 +58,11 @@ declare const TagList: import('vue').DefineComponent<import('vue').ExtractPropTy
|
|
|
56
58
|
type: StringConstructor;
|
|
57
59
|
validator: (value: string) => boolean;
|
|
58
60
|
};
|
|
61
|
+
summarizeAfter: {
|
|
62
|
+
type: NumberConstructor;
|
|
63
|
+
default: number;
|
|
64
|
+
};
|
|
65
|
+
summaryText: StringConstructor;
|
|
59
66
|
onTagdelete: FunctionConstructor;
|
|
60
67
|
}>, {}, {}, {
|
|
61
68
|
wrapperClass(): {
|
|
@@ -85,6 +92,13 @@ declare const TagList: import('vue').DefineComponent<import('vue').ExtractPropTy
|
|
|
85
92
|
type: StringConstructor;
|
|
86
93
|
validator: (value: string) => boolean;
|
|
87
94
|
};
|
|
95
|
+
summarizeAfter: {
|
|
96
|
+
type: NumberConstructor;
|
|
97
|
+
default: number;
|
|
98
|
+
};
|
|
99
|
+
summaryText: StringConstructor;
|
|
88
100
|
onTagdelete: FunctionConstructor;
|
|
89
|
-
}>> & Readonly<{}>, {
|
|
101
|
+
}>> & Readonly<{}>, {
|
|
102
|
+
summarizeAfter: number;
|
|
103
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
90
104
|
export { TagList };
|
package/MultiSelect/TagList.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 i=require("vue"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),o=require("@progress/kendo-vue-common"),m=require("@progress/kendo-vue-buttons"),p=e=>e.preventDefault(),g=e=>e.event.stopPropagation(),z=i.defineComponent({name:"TagList",inheritAttrs:!1,props:{removeTagIcon:String,dataItems:Array,guid:String,focused:Object,tagRender:[String,Function,Object],tagsRounded:{type:String,validator:function(e){return["none","small","medium","large","full"].includes(e)}},fillMode:{type:String,validator:function(e){return["solid","flat","outline"].includes(e)}},id:String,className:String,size:{type:String,validator:function(e){return["small","medium","large"].includes(e)}},summarizeAfter:{type:Number,default:10},summaryText:String,onTagdelete:Function},computed:{wrapperClass(){const{size:e,disabled:t}=this.$props;return{"k-chip-list":!0,[`k-chip-list-${o.kendoThemeMaps.sizeMap[e]||e}`]:e,"k-disabled":t}}},methods:{onTagDelete(e,t){this.$emit("tagdelete",e,t)}},render(){const e=o.getDefaultSlots(this),{dataItems:t,guid:r,size:a,disabled:l,tagsRounded:d,removeTagIcon:h,id:f,className:v,summarizeAfter:s,summaryText:S}=this.$props,T=s&&t.length>s?t.slice(0,s):t,b=s&&t.length>s,y=t.length-(s||0);return i.createVNode("div",{class:o.classNames("k-input-values",v),id:f,style:this.$attrs.style},[i.createVNode("div",{class:this.wrapperClass,role:"listbox",id:"tagslist-"+r},[T.map(function(n,u){const k=`tag-${r}-${n.text.toString().replace(/\s+/g,"-")}`,c=n===this.$props.focused,$=i.createVNode(m.Chip,{id:k,tabIndex:-1,"aria-selected":c,role:"option","aria-setsize":t.length,key:n.text+u,text:n.text,disabled:l,removable:!0,onRemove:x=>this.onTagDelete(n.data,x),removeIcon:h,onMousedown:p,onClick:g,class:c?"k-focus":void 0,rounded:d,size:a},null);return o.getTemplate.call(this,{h:i.h,template:this.$props.tagRender,defaultRendering:$,additionalProps:{...this.$props,tagData:n,index:u},additionalListeners:{tagdelete:this.onTagDelete}})},this),b&&i.createVNode(m.Chip,{text:S||`+${y} more`,disabled:l,removable:!1,onMousedown:p,onClick:g,rounded:d,size:a},null)]),e])}});exports.TagList=z;
|
package/MultiSelect/TagList.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 { getDefaultSlots as
|
|
10
|
-
import { Chip as
|
|
11
|
-
const
|
|
8
|
+
import { defineComponent as k, createVNode as n, h as z } from "vue";
|
|
9
|
+
import { getDefaultSlots as R, classNames as C, getTemplate as I, kendoThemeMaps as w } from "@progress/kendo-vue-common";
|
|
10
|
+
import { Chip as m } from "@progress/kendo-vue-buttons";
|
|
11
|
+
const c = (e) => e.preventDefault(), p = (e) => e.event.stopPropagation(), F = /* @__PURE__ */ k({
|
|
12
12
|
name: "TagList",
|
|
13
13
|
inheritAttrs: !1,
|
|
14
14
|
props: {
|
|
@@ -37,6 +37,11 @@ const x = (e) => e.preventDefault(), y = (e) => e.event.stopPropagation(), C = /
|
|
|
37
37
|
return ["small", "medium", "large"].includes(e);
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
|
+
summarizeAfter: {
|
|
41
|
+
type: Number,
|
|
42
|
+
default: 10
|
|
43
|
+
},
|
|
44
|
+
summaryText: String,
|
|
40
45
|
onTagdelete: Function
|
|
41
46
|
},
|
|
42
47
|
computed: {
|
|
@@ -47,7 +52,7 @@ const x = (e) => e.preventDefault(), y = (e) => e.event.stopPropagation(), C = /
|
|
|
47
52
|
} = this.$props;
|
|
48
53
|
return {
|
|
49
54
|
"k-chip-list": !0,
|
|
50
|
-
[`k-chip-list-${
|
|
55
|
+
[`k-chip-list-${w.sizeMap[e] || e}`]: e,
|
|
51
56
|
"k-disabled": t
|
|
52
57
|
};
|
|
53
58
|
}
|
|
@@ -58,59 +63,69 @@ const x = (e) => e.preventDefault(), y = (e) => e.event.stopPropagation(), C = /
|
|
|
58
63
|
}
|
|
59
64
|
},
|
|
60
65
|
render() {
|
|
61
|
-
const e =
|
|
66
|
+
const e = R(this), {
|
|
62
67
|
dataItems: t,
|
|
63
|
-
guid:
|
|
64
|
-
size:
|
|
65
|
-
disabled:
|
|
66
|
-
tagsRounded:
|
|
67
|
-
removeTagIcon:
|
|
68
|
-
id:
|
|
69
|
-
className:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
68
|
+
guid: o,
|
|
69
|
+
size: r,
|
|
70
|
+
disabled: a,
|
|
71
|
+
tagsRounded: l,
|
|
72
|
+
removeTagIcon: g,
|
|
73
|
+
id: h,
|
|
74
|
+
className: f,
|
|
75
|
+
summarizeAfter: s,
|
|
76
|
+
summaryText: v
|
|
77
|
+
} = this.$props, S = s && t.length > s ? t.slice(0, s) : t, T = s && t.length > s, b = t.length - (s || 0);
|
|
78
|
+
return n("div", {
|
|
79
|
+
class: C("k-input-values", f),
|
|
80
|
+
id: h,
|
|
74
81
|
style: this.$attrs.style
|
|
75
|
-
}, [
|
|
82
|
+
}, [n("div", {
|
|
76
83
|
class: this.wrapperClass,
|
|
77
84
|
role: "listbox",
|
|
78
|
-
id: "tagslist-" +
|
|
79
|
-
}, [
|
|
80
|
-
const
|
|
81
|
-
id:
|
|
85
|
+
id: "tagslist-" + o
|
|
86
|
+
}, [S.map(function(i, d) {
|
|
87
|
+
const y = `tag-${o}-${i.text.toString().replace(/\s+/g, "-")}`, u = i === this.$props.focused, $ = n(m, {
|
|
88
|
+
id: y,
|
|
82
89
|
tabIndex: -1,
|
|
83
|
-
"aria-selected":
|
|
90
|
+
"aria-selected": u,
|
|
84
91
|
role: "option",
|
|
85
92
|
"aria-setsize": t.length,
|
|
86
|
-
key:
|
|
87
|
-
text:
|
|
88
|
-
disabled:
|
|
93
|
+
key: i.text + d,
|
|
94
|
+
text: i.text,
|
|
95
|
+
disabled: a,
|
|
89
96
|
removable: !0,
|
|
90
|
-
onRemove: (
|
|
91
|
-
removeIcon:
|
|
92
|
-
onMousedown:
|
|
93
|
-
onClick:
|
|
94
|
-
class:
|
|
95
|
-
rounded:
|
|
96
|
-
size:
|
|
97
|
+
onRemove: (x) => this.onTagDelete(i.data, x),
|
|
98
|
+
removeIcon: g,
|
|
99
|
+
onMousedown: c,
|
|
100
|
+
onClick: p,
|
|
101
|
+
class: u ? "k-focus" : void 0,
|
|
102
|
+
rounded: l,
|
|
103
|
+
size: r
|
|
97
104
|
}, null);
|
|
98
|
-
return
|
|
99
|
-
h:
|
|
105
|
+
return I.call(this, {
|
|
106
|
+
h: z,
|
|
100
107
|
template: this.$props.tagRender,
|
|
101
|
-
defaultRendering:
|
|
108
|
+
defaultRendering: $,
|
|
102
109
|
additionalProps: {
|
|
103
110
|
...this.$props,
|
|
104
|
-
tagData:
|
|
105
|
-
index:
|
|
111
|
+
tagData: i,
|
|
112
|
+
index: d
|
|
106
113
|
},
|
|
107
114
|
additionalListeners: {
|
|
108
115
|
tagdelete: this.onTagDelete
|
|
109
116
|
}
|
|
110
117
|
});
|
|
111
|
-
}, this)
|
|
118
|
+
}, this), T && n(m, {
|
|
119
|
+
text: v || `+${b} more`,
|
|
120
|
+
disabled: a,
|
|
121
|
+
removable: !1,
|
|
122
|
+
onMousedown: c,
|
|
123
|
+
onClick: p,
|
|
124
|
+
rounded: l,
|
|
125
|
+
size: r
|
|
126
|
+
}, null)]), e]);
|
|
112
127
|
}
|
|
113
128
|
});
|
|
114
129
|
export {
|
|
115
|
-
|
|
130
|
+
F as TagList
|
|
116
131
|
};
|
package/common/DropDownBase.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";var f=Object.defineProperty;var S=(c,t,
|
|
8
|
+
"use strict";var f=Object.defineProperty;var S=(c,t,i)=>t in c?f(c,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[t]=i;var p=(c,t,i)=>S(c,typeof t!="symbol"?t+"":t,i);const v=require("./VirtualScroll.js"),y=require("./Navigation.js"),l=require("./utils.js"),r=require("@progress/kendo-vue-common"),k=require("../package-metadata.js");class g{constructor(t){p(this,"vs",new v);p(this,"navigation",new y.Navigation);p(this,"handleItemClick",(t,i)=>{const e=this.initState();e.event=i,this.component.handleItemSelect(t,e),this.togglePopup(e),this.applyState(e)});p(this,"handleFocus",t=>{if(!this.component.currentFocused){const i=this.initState();i.data.currentFocused=!0,i.events.push({type:"focus"}),i.event=t,this.applyState(i)}});p(this,"filterChanged",(t,i)=>{const e=this.component,{textField:o,filterable:n}=e.$props;n&&(i.events.push({type:"filterchange",filter:{field:o,operator:"contains",ignoreCase:!0,value:t}}),this.repositionPopup())});p(this,"togglePopup",t=>{const i=this.component.$props,e=i.opened!==void 0?i.opened:this.component.currentOpened;i.opened===void 0&&(t.data.currentOpened=!e),e?t.events.push({type:"close"}):(t.events.push({type:"open"}),this.calculatePopupWidth())});p(this,"pageChange",(t,i)=>{const e=this.initState();e.event=i,this.triggerOnPageChange(e,t.skip,t.take),this.applyState(e)});p(this,"scrollChange",t=>{this.component.$emit("scroll",t)});p(this,"scrollToVirtualItem",(t,i)=>{const e=this.vs;if(e.scrollSyncing=!0,t.skip===0)e.reset(),i>0&&e.container&&e.itemHeight>0&&(e.container.scrollTop=e.itemHeight*i);else{let o=e.translate;o===0&&(e.calcScrollElementHeight(),o=e.itemHeight*t.skip,e.translateTo(o)),i<0&&o>0&&(o+=e.itemHeight*(t.pageSize/4)),e.container&&(e.container.scrollTop=o),this.scrollToItem(i,!0)}setTimeout(()=>{e.scrollSyncing=!1},0)});p(this,"getGroupedDataModernMode",(t,i)=>{const e=[];return t.forEach((o,n)=>{t[n-1]&&o[i]!==t[n-1][i]&&e.push({[i]:o[i]}),e.push(t[n])}),e});p(this,"resetGroupStickyHeader",(t,i)=>{const e=this.initState();t!==i.group&&i.state&&(i.state.data.group=t,this.applyState(e))});r.validatePackage(k.packageMetadata),this.listBoxId=r.guid(),this.guid=r.guid(),this.component=t,this.vs.PageChange=this.pageChange,this.vs.ScrollChange=this.scrollChange}didMount(){const t=this.component.$props,i=t.popupSettings,e=t.style,o=i&&i.width;let n=t.opened===!0;o===void 0&&this.calculatePopupWidth(),t.dir===void 0&&e&&e.direction===void 0&&(this.calculateDir(),n=!0),n&&this.component.$forceUpdate()}calculateDir(){this.component.element&&(this.dirCalculated=window.getComputedStyle(this.component.element).direction||void 0)}calculatePopupWidth(){const t=this.component.$props,i=t.popupSettings,e=i&&i.width;this.wrapper&&!e&&(this.component.popupWidth=t.popupSettings.width!==void 0?t.popupSettings.width:this.wrapper.offsetWidth+"px")}scrollVirtualized(t){const i=this.list||this.vs.list,e=i==null?void 0:i.querySelector(".k-list-item");if(!e)return;const o=this.vs,n=o.container||(i==null?void 0:i.parentNode);n&&l.scrollToItem(n,e.offsetHeight,t,o.translate)}scrollNonVirtualized(t,i){const e=i.parentNode;if(!e||e.scrollHeight<=e.offsetHeight)return;const n=e.querySelectorAll(".k-list-item, .k-list-group-item")[t];if(!n)return;const s=n.getBoundingClientRect(),h=e.getBoundingClientRect(),a=s.top-h.top+e.scrollTop,d=a+s.height,u=e.scrollTop,m=u+e.offsetHeight;d>m?e.scrollTop=a+s.height-e.offsetHeight:a<u&&(e.scrollTop=a)}scrollToItem(t,i){const e=this.list||this.vs.list;if(!e||t<0)return;(i!=null?i:this.vs.enabled)?this.scrollVirtualized(t):this.scrollNonVirtualized(t,e)}repositionPopup(){const t=this.component;setTimeout(function(){const i=t.$refs.container;if(i){const e=i.$refs.popup;e&&e.show&&e.reposition()}},5)}initState(){return{data:{},events:[],event:void 0}}applyState(t){Object.keys(t.data).length>0&&Object.keys(t.data).forEach(o=>{this.component[o]=t.data[o]});const i=this.component.primitiveValue(),e={event:t.event,component:this.component,target:{name:this.component.$props.name,value:i},value:i};t.events.forEach(o=>{const{type:n}=o;delete o.type,n&&(n==="change"&&(this.component.$emit("changemodel",i),this.component.$emit("update:modelValue",i)),this.component.$emit(n,{...e,...o}))})}triggerOnPageChange(t,i,e){const o=this.component.$props.virtual;if(o){const n=Math.min(Math.max(0,i),Math.max(0,o.total-e));n!==o.skip&&t.events.push({type:"pagechange",page:{skip:n,take:e}})}}triggerPageChangeCornerItems(t,i){const e=this.component.$props,{dataItems:o=[],dataItemKey:n,virtual:s}=e,h=e.opened!==void 0?e.opened:this.component.currentOpened;t&&s&&this.vs.enabled&&(s.skip>0&&l.areSame(t,o[0],n)?this.triggerOnPageChange(i,s.skip-1,s.pageSize):s.skip+s.pageSize<s.total&&l.areSame(t,o[o.length-1],n)?this.triggerOnPageChange(i,s.skip+1,s.pageSize):!h&&s.skip+s.pageSize<s.total&&l.areSame(t,o[o.length-1],n)&&this.triggerOnPageChange(i,s.skip+1,s.pageSize))}getTemplateDef(t,i){const e=r.templateRendering.call(this,t,r.getListeners.call(this));return r.getTemplate.call(this,{h:i,template:e})}getListItemHeight(t){const i=t&&window.getComputedStyle(t);return i?i.height.slice(0,i.height.length-2):0}}p(g,"defaultProps",{popupSettings:{animate:!0,height:"200px"},required:!1,validityStyles:!0});module.exports=g;
|
package/common/DropDownBase.mjs
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
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 = (
|
|
8
|
+
var f = Object.defineProperty;
|
|
9
|
+
var d = (r, t, o) => t in r ? f(r, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[t] = o;
|
|
10
|
+
var p = (r, t, o) => d(r, typeof t != "symbol" ? t + "" : t, o);
|
|
11
11
|
import S from "./VirtualScroll.mjs";
|
|
12
12
|
import { Navigation as v } from "./Navigation.mjs";
|
|
13
13
|
import { scrollToItem as y, areSame as a } from "./utils.mjs";
|
|
@@ -61,15 +61,15 @@ class $ {
|
|
|
61
61
|
});
|
|
62
62
|
p(this, "scrollToVirtualItem", (t, o) => {
|
|
63
63
|
const e = this.vs;
|
|
64
|
-
if (e.
|
|
65
|
-
e.reset();
|
|
66
|
-
else if (t.skip + t.pageSize === t.total)
|
|
67
|
-
e.scrollToEnd();
|
|
64
|
+
if (e.scrollSyncing = !0, t.skip === 0)
|
|
65
|
+
e.reset(), o > 0 && e.container && e.itemHeight > 0 && (e.container.scrollTop = e.itemHeight * o);
|
|
68
66
|
else {
|
|
69
67
|
let i = e.translate;
|
|
70
|
-
i === 0 && (e.calcScrollElementHeight(), i = e.itemHeight * t.skip, e.translateTo(i
|
|
68
|
+
i === 0 && (e.calcScrollElementHeight(), i = e.itemHeight * t.skip, e.translateTo(i)), o < 0 && i > 0 && (i += e.itemHeight * (t.pageSize / 4)), e.container && (e.container.scrollTop = i), this.scrollToItem(o, !0);
|
|
71
69
|
}
|
|
72
|
-
setTimeout(() =>
|
|
70
|
+
setTimeout(() => {
|
|
71
|
+
e.scrollSyncing = !1;
|
|
72
|
+
}, 0);
|
|
73
73
|
});
|
|
74
74
|
p(this, "getGroupedDataModernMode", (t, o) => {
|
|
75
75
|
const e = [];
|
|
@@ -111,8 +111,8 @@ class $ {
|
|
|
111
111
|
const n = e.querySelectorAll(".k-list-item, .k-list-group-item")[t];
|
|
112
112
|
if (!n)
|
|
113
113
|
return;
|
|
114
|
-
const s = n.getBoundingClientRect(),
|
|
115
|
-
g >
|
|
114
|
+
const s = n.getBoundingClientRect(), l = e.getBoundingClientRect(), c = s.top - l.top + e.scrollTop, g = c + s.height, h = e.scrollTop, m = h + e.offsetHeight;
|
|
115
|
+
g > m ? e.scrollTop = c + s.height - e.offsetHeight : c < h && (e.scrollTop = c);
|
|
116
116
|
}
|
|
117
117
|
scrollToItem(t, o) {
|
|
118
118
|
const e = this.list || this.vs.list;
|
|
@@ -178,8 +178,8 @@ class $ {
|
|
|
178
178
|
dataItems: i = [],
|
|
179
179
|
dataItemKey: n,
|
|
180
180
|
virtual: s
|
|
181
|
-
} = e,
|
|
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) : !
|
|
181
|
+
} = e, l = 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) : !l && s.skip + s.pageSize < s.total && a(t, i[i.length - 1], n) && this.triggerOnPageChange(o, s.skip + 1, s.pageSize));
|
|
183
183
|
}
|
|
184
184
|
getTemplateDef(t, o) {
|
|
185
185
|
const e = C.call(this, t, T.call(this));
|
package/common/List.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export interface ListProps {
|
|
|
35
35
|
iconField?: string;
|
|
36
36
|
svgIconField?: string;
|
|
37
37
|
checkboxField?: string;
|
|
38
|
+
showSelectionCheckbox?: boolean;
|
|
38
39
|
}
|
|
39
40
|
/**
|
|
40
41
|
* @hidden
|
|
@@ -66,6 +67,7 @@ declare const List: import('vue').DefineComponent<import('vue').ExtractPropTypes
|
|
|
66
67
|
iconField: PropType<string>;
|
|
67
68
|
svgIconField: PropType<string>;
|
|
68
69
|
checkboxField: PropType<string>;
|
|
70
|
+
showSelectionCheckbox: PropType<boolean>;
|
|
69
71
|
}>, {
|
|
70
72
|
listRef: import('vue').Ref<any, any>;
|
|
71
73
|
kendoLocalizationService: {};
|
|
@@ -102,6 +104,7 @@ declare const List: import('vue').DefineComponent<import('vue').ExtractPropTypes
|
|
|
102
104
|
iconField: PropType<string>;
|
|
103
105
|
svgIconField: PropType<string>;
|
|
104
106
|
checkboxField: PropType<string>;
|
|
107
|
+
showSelectionCheckbox: PropType<boolean>;
|
|
105
108
|
}>> & Readonly<{
|
|
106
109
|
onScroll?: (event: Event) => any;
|
|
107
110
|
onListclick?: (event: MouseEvent) => any;
|
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 i=require("vue"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),E=require("./ListItem.js"),H=require("./ListGroupItem.js"),G=require("./utils.js"),p=require("@progress/kendo-vue-common"),T=require("@progress/kendo-vue-intl"),S=require("../messages/main.js"),M=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,showSelectionCheckbox:Boolean},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=T.provideLocalizationService(this),{id:F,show:y,wrapperCssClass:b,wrapperStyle:j,listStyle:k,listRef:P}=this.$props,V=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})},m=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:O,descriptionField:q,iconField:x,svgIconField:L,checkboxField:A,showSelectionCheckbox:z}=this.$props,N=Array.isArray(d);let $=0;return g.map(function(l,R){const C=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(H.ListGroupItem,{id:`option-${e}-${C}`,key:R+"-group-item",group:l[o],render:h,iconField:x,svgIconField:L,groupItem:l},null);const f=u+$;$+=1;const B=r&&(!N&&G.areSame(l,d,n)||N&&d.findIndex(_=>G.areSame(_,l,n))!==-1),D=c===f;return i.createVNode(E.ListItem,{id:`option-${e}-${C}`,dataItem:l,selected:B,focused:D,index:f,key:`item-${f}`,onItemClick:this.handleClick,textField:t,render:I,actionsField:O,descriptionField:q,iconField:x,svgIconField:L,checkboxField:A,showSelectionCheckbox:z},null)},this)}.call(this),v=m.filter(t=>t),w=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:k},[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:k},[e])})};return m.length?i.createVNode("div",{class:b,style:j,role:this.$props.groupField?"listbox":void 0,"aria-hidden":this.$props.groupField&&!y?!0:void 0,unselectable:"on",onScroll:this.handleScroll},[w.call(this),s]):V.call(this)}});exports.List=M;
|
package/common/List.mjs
CHANGED
|
@@ -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 { 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 V, createVNode as d, ref as T, inject as q, h as J } from "vue";
|
|
9
|
+
import { ListItem as K } from "./ListItem.mjs";
|
|
10
|
+
import { ListGroupItem as M } from "./ListGroupItem.mjs";
|
|
11
|
+
import { areSame as C } from "./utils.mjs";
|
|
12
|
+
import { getDefaultSlots as P, getRef as Q, setRef as G, getTemplate as U } from "@progress/kendo-vue-common";
|
|
13
|
+
import { provideLocalizationService as W } from "@progress/kendo-vue-intl";
|
|
14
|
+
import { nodata as b, messages as X } from "../messages/main.mjs";
|
|
15
|
+
const ce = /* @__PURE__ */ V({
|
|
16
16
|
name: "list",
|
|
17
17
|
emits: {
|
|
18
18
|
listclick: (l) => !0,
|
|
@@ -45,7 +45,8 @@ const de = /* @__PURE__ */ H({
|
|
|
45
45
|
descriptionField: String,
|
|
46
46
|
iconField: String,
|
|
47
47
|
svgIconField: String,
|
|
48
|
-
checkboxField: String
|
|
48
|
+
checkboxField: String,
|
|
49
|
+
showSelectionCheckbox: Boolean
|
|
49
50
|
},
|
|
50
51
|
inject: {
|
|
51
52
|
kendoLocalizationService: {
|
|
@@ -53,14 +54,14 @@ const de = /* @__PURE__ */ H({
|
|
|
53
54
|
}
|
|
54
55
|
},
|
|
55
56
|
setup() {
|
|
56
|
-
const l =
|
|
57
|
+
const l = T(null), a = q("kendoLocalizationService", {});
|
|
57
58
|
return {
|
|
58
59
|
listRef: l,
|
|
59
60
|
kendoLocalizationService: a
|
|
60
61
|
};
|
|
61
62
|
},
|
|
62
63
|
mounted() {
|
|
63
|
-
this.list =
|
|
64
|
+
this.list = Q(this, "list");
|
|
64
65
|
},
|
|
65
66
|
methods: {
|
|
66
67
|
handleClick(l, a) {
|
|
@@ -71,63 +72,64 @@ const de = /* @__PURE__ */ H({
|
|
|
71
72
|
}
|
|
72
73
|
},
|
|
73
74
|
render() {
|
|
74
|
-
const l =
|
|
75
|
+
const l = P(this), a = W(this), {
|
|
75
76
|
id: g,
|
|
76
77
|
show: S,
|
|
77
|
-
wrapperCssClass:
|
|
78
|
-
wrapperStyle:
|
|
78
|
+
wrapperCssClass: j,
|
|
79
|
+
wrapperStyle: w,
|
|
79
80
|
listStyle: m,
|
|
80
|
-
listRef:
|
|
81
|
-
} = this.$props,
|
|
82
|
-
const t = this.$props.noDataRender,
|
|
81
|
+
listRef: Y
|
|
82
|
+
} = this.$props, N = function() {
|
|
83
|
+
const t = this.$props.noDataRender, n = d("div", {
|
|
83
84
|
class: "k-nodata",
|
|
84
85
|
"aria-live": "polite"
|
|
85
|
-
}, [d("div", null, [a.toLanguageString(
|
|
86
|
-
return
|
|
87
|
-
h:
|
|
86
|
+
}, [d("div", null, [a.toLanguageString(b, X[b])])]);
|
|
87
|
+
return U.call(this, {
|
|
88
|
+
h: J,
|
|
88
89
|
template: t,
|
|
89
|
-
defaultRendering:
|
|
90
|
+
defaultRendering: n
|
|
90
91
|
});
|
|
91
92
|
}, F = function() {
|
|
92
93
|
const {
|
|
93
94
|
textField: t,
|
|
94
|
-
valueField:
|
|
95
|
+
valueField: n,
|
|
95
96
|
optionsGuid: e,
|
|
96
97
|
skip: p = 0,
|
|
97
98
|
focusedIndex: c,
|
|
98
|
-
highlightSelected:
|
|
99
|
+
highlightSelected: i,
|
|
99
100
|
value: s,
|
|
100
|
-
groupField:
|
|
101
|
+
groupField: o,
|
|
101
102
|
itemRender: k,
|
|
102
103
|
groupHeaderItemRender: u,
|
|
103
104
|
dataItems: h,
|
|
104
105
|
actionsField: A,
|
|
105
106
|
descriptionField: z,
|
|
106
107
|
iconField: v,
|
|
107
|
-
svgIconField:
|
|
108
|
-
checkboxField:
|
|
109
|
-
|
|
108
|
+
svgIconField: x,
|
|
109
|
+
checkboxField: B,
|
|
110
|
+
showSelectionCheckbox: D
|
|
111
|
+
} = this.$props, I = Array.isArray(s);
|
|
110
112
|
let $ = 0;
|
|
111
|
-
return h.map(function(
|
|
113
|
+
return h.map(function(r, L) {
|
|
112
114
|
const R = p + L;
|
|
113
|
-
if (
|
|
114
|
-
return d(
|
|
115
|
+
if (o && (r == null ? void 0 : r[o]) !== void 0 && (t ? r[t] === void 0 : Object.keys(r).length === 1))
|
|
116
|
+
return d(M, {
|
|
115
117
|
id: `option-${e}-${R}`,
|
|
116
118
|
key: L + "-group-item",
|
|
117
|
-
group: o
|
|
119
|
+
group: r[o],
|
|
118
120
|
render: u,
|
|
119
121
|
iconField: v,
|
|
120
|
-
svgIconField:
|
|
121
|
-
groupItem:
|
|
122
|
+
svgIconField: x,
|
|
123
|
+
groupItem: r
|
|
122
124
|
}, null);
|
|
123
125
|
const f = p + $;
|
|
124
126
|
$ += 1;
|
|
125
|
-
const
|
|
126
|
-
return d(
|
|
127
|
+
const _ = i && (!I && C(r, s, n) || I && s.findIndex((H) => C(H, r, n)) !== -1), E = c === f;
|
|
128
|
+
return d(K, {
|
|
127
129
|
id: `option-${e}-${R}`,
|
|
128
|
-
dataItem:
|
|
129
|
-
selected:
|
|
130
|
-
focused:
|
|
130
|
+
dataItem: r,
|
|
131
|
+
selected: _,
|
|
132
|
+
focused: E,
|
|
131
133
|
index: f,
|
|
132
134
|
key: `item-${f}`,
|
|
133
135
|
onItemClick: this.handleClick,
|
|
@@ -136,52 +138,53 @@ const de = /* @__PURE__ */ H({
|
|
|
136
138
|
actionsField: A,
|
|
137
139
|
descriptionField: z,
|
|
138
140
|
iconField: v,
|
|
139
|
-
svgIconField:
|
|
140
|
-
checkboxField:
|
|
141
|
+
svgIconField: x,
|
|
142
|
+
checkboxField: B,
|
|
143
|
+
showSelectionCheckbox: D
|
|
141
144
|
}, null);
|
|
142
145
|
}, this);
|
|
143
|
-
}.call(this), y = F.filter((t) => t),
|
|
146
|
+
}.call(this), y = F.filter((t) => t), O = function() {
|
|
144
147
|
if (!this.$props.groupField)
|
|
145
148
|
return d("ul", {
|
|
146
149
|
id: g,
|
|
147
150
|
role: "listbox",
|
|
148
151
|
"aria-hidden": S ? void 0 : !0,
|
|
149
152
|
class: "k-list-ul",
|
|
150
|
-
ref:
|
|
153
|
+
ref: G(this, "list"),
|
|
151
154
|
style: m
|
|
152
155
|
}, [y]);
|
|
153
156
|
const t = [];
|
|
154
|
-
let
|
|
157
|
+
let n = [];
|
|
155
158
|
return y.forEach((e) => {
|
|
156
|
-
var
|
|
157
|
-
(((
|
|
158
|
-
}),
|
|
159
|
+
var i, s;
|
|
160
|
+
(((i = e == null ? void 0 : e.type) == null ? void 0 : i.name) || ((s = e == null ? void 0 : e.type) == null ? void 0 : s.__name) || "") === "ListGroupItem" ? (n.length > 0 && t.push(n), n = [e]) : e && n.push(e);
|
|
161
|
+
}), n.length > 0 && t.push(n), t.map((e, p) => {
|
|
159
162
|
var s;
|
|
160
|
-
const c = e.find((
|
|
163
|
+
const c = e.find((o) => {
|
|
161
164
|
var u, h;
|
|
162
|
-
return (((u =
|
|
163
|
-
}),
|
|
165
|
+
return (((u = o == null ? void 0 : o.type) == null ? void 0 : u.name) || ((h = o == null ? void 0 : o.type) == null ? void 0 : h.__name) || "") === "ListGroupItem";
|
|
166
|
+
}), i = (s = c == null ? void 0 : c.props) == null ? void 0 : s.id;
|
|
164
167
|
return d("ul", {
|
|
165
|
-
id:
|
|
166
|
-
key:
|
|
167
|
-
role:
|
|
168
|
-
"aria-labelledby":
|
|
168
|
+
id: i ? void 0 : g,
|
|
169
|
+
key: i || `group-${p}`,
|
|
170
|
+
role: i ? "group" : void 0,
|
|
171
|
+
"aria-labelledby": i,
|
|
169
172
|
class: "k-list-ul",
|
|
170
|
-
ref:
|
|
173
|
+
ref: i ? void 0 : G(this, "list"),
|
|
171
174
|
style: m
|
|
172
175
|
}, [e]);
|
|
173
176
|
});
|
|
174
177
|
};
|
|
175
178
|
return F.length ? d("div", {
|
|
176
|
-
class:
|
|
177
|
-
style:
|
|
179
|
+
class: j,
|
|
180
|
+
style: w,
|
|
178
181
|
role: this.$props.groupField ? "listbox" : void 0,
|
|
179
182
|
"aria-hidden": this.$props.groupField && !S ? !0 : void 0,
|
|
180
183
|
unselectable: "on",
|
|
181
184
|
onScroll: this.handleScroll
|
|
182
|
-
}, [
|
|
185
|
+
}, [O.call(this), l]) : N.call(this);
|
|
183
186
|
}
|
|
184
187
|
});
|
|
185
188
|
export {
|
|
186
|
-
|
|
189
|
+
ce as List
|
|
187
190
|
};
|
package/common/ListItem.d.ts
CHANGED
|
@@ -79,6 +79,11 @@ export interface ListItemProps {
|
|
|
79
79
|
* The field name in the dataItem that contains the checkbox state.
|
|
80
80
|
*/
|
|
81
81
|
checkboxField?: string;
|
|
82
|
+
/**
|
|
83
|
+
* @hidden
|
|
84
|
+
* When true, renders a checkbox whose checked state reflects the item's selected state.
|
|
85
|
+
*/
|
|
86
|
+
showSelectionCheckbox?: boolean;
|
|
82
87
|
}
|
|
83
88
|
/**
|
|
84
89
|
* @hidden
|
|
@@ -100,6 +105,7 @@ declare const ListItem: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
100
105
|
iconField: PropType<string>;
|
|
101
106
|
svgIconField: PropType<string>;
|
|
102
107
|
checkboxField: PropType<string>;
|
|
108
|
+
showSelectionCheckbox: PropType<boolean>;
|
|
103
109
|
}>, {}, {}, {
|
|
104
110
|
itemClass(): {
|
|
105
111
|
'k-list-item': boolean;
|
|
@@ -125,5 +131,6 @@ declare const ListItem: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
125
131
|
iconField: PropType<string>;
|
|
126
132
|
svgIconField: PropType<string>;
|
|
127
133
|
checkboxField: PropType<string>;
|
|
134
|
+
showSelectionCheckbox: PropType<boolean>;
|
|
128
135
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
129
136
|
export { ListItem };
|