@progress/kendo-vue-dropdowns 9.3.0-develop.2 → 9.3.0-develop.4

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.
@@ -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
  }
@@ -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<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
101
+ }>> & Readonly<{}>, {
102
+ summarizeAfter: number;
103
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
90
104
  export { TagList };
@@ -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"),n=require("@progress/kendo-vue-common"),v=require("@progress/kendo-vue-buttons"),S=e=>e.preventDefault(),T=e=>e.event.stopPropagation(),b=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)}},onTagdelete:Function},computed:{wrapperClass(){const{size:e,disabled:t}=this.$props;return{"k-chip-list":!0,[`k-chip-list-${n.kendoThemeMaps.sizeMap[e]||e}`]:e,"k-disabled":t}}},methods:{onTagDelete(e,t){this.$emit("tagdelete",e,t)}},render(){const e=n.getDefaultSlots(this),{dataItems:t,guid:o,size:d,disabled:l,tagsRounded:u,removeTagIcon:c,id:p,className:g}=this.$props;return i.createVNode("div",{class:n.classNames("k-input-values",g),id:p,style:this.$attrs.style},[i.createVNode("div",{class:this.wrapperClass,role:"listbox",id:"tagslist-"+o},[t.map(function(s,r){const m=`tag-${o}-${s.text.toString().replace(/\s+/g,"-")}`,a=s===this.$props.focused,h=i.createVNode(v.Chip,{id:m,tabIndex:-1,"aria-selected":a,role:"option","aria-setsize":t.length,key:s.text+r,text:s.text,disabled:l,removable:!0,onRemove:f=>this.onTagDelete(s.data,f),removeIcon:c,onMousedown:S,onClick:T,class:a?"k-focus":void 0,rounded:u,size:d},null);return n.getTemplate.call(this,{h:i.h,template:this.$props.tagRender,defaultRendering:h,additionalProps:{...this.$props,tagData:s,index:r},additionalListeners:{tagdelete:this.onTagDelete}})},this)]),e])}});exports.TagList=b;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),o=require("@progress/kendo-vue-common"),m=require("@progress/kendo-vue-buttons"),p=e=>e.preventDefault(),g=e=>e.event.stopPropagation(),x=n.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,b=s&&t.length>s?t.slice(0,s):t,T=s&&t.length>s,y=t.length-(s||0);return n.createVNode("div",{class:o.classNames("k-input-values",v),id:f,style:this.$attrs.style},[n.createVNode("div",{class:this.wrapperClass,role:"listbox","aria-label":"chip list","aria-orientation":"horizontal",id:"tagslist-"+r},[b.map(function(i,u){const k=`tag-${r}-${i.text.toString().replace(/\s+/g,"-")}`,c=i===this.$props.focused,$=n.createVNode(m.Chip,{id:k,tabIndex:-1,"aria-selected":c,role:"option","aria-setsize":t.length,key:i.text+u,text:i.text,disabled:l,removable:!0,onRemove:z=>this.onTagDelete(i.data,z),removeIcon:h,onMousedown:p,onClick:g,class:c?"k-focus":void 0,rounded:d,size:a},null);return o.getTemplate.call(this,{h:n.h,template:this.$props.tagRender,defaultRendering:$,additionalProps:{...this.$props,tagData:i,index:u},additionalListeners:{tagdelete:this.onTagDelete}})},this),T&&n.createVNode(m.Chip,{text:S||`+${y} more`,disabled:l,removable:!1,onMousedown:p,onClick:g,rounded:d,size:a},null)]),e])}});exports.TagList=x;
@@ -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 h, createVNode as i, h as v } from "vue";
9
- import { getDefaultSlots as S, classNames as T, getTemplate as $, kendoThemeMaps as b } from "@progress/kendo-vue-common";
10
- import { Chip as k } from "@progress/kendo-vue-buttons";
11
- const x = (e) => e.preventDefault(), y = (e) => e.event.stopPropagation(), C = /* @__PURE__ */ h({
8
+ import { defineComponent as z, createVNode as n, h as k } 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 c } from "@progress/kendo-vue-buttons";
11
+ const m = (e) => e.preventDefault(), p = (e) => e.event.stopPropagation(), F = /* @__PURE__ */ z({
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-${b.sizeMap[e] || e}`]: e,
55
+ [`k-chip-list-${w.sizeMap[e] || e}`]: e,
51
56
  "k-disabled": t
52
57
  };
53
58
  }
@@ -58,59 +63,71 @@ const x = (e) => e.preventDefault(), y = (e) => e.event.stopPropagation(), C = /
58
63
  }
59
64
  },
60
65
  render() {
61
- const e = S(this), {
66
+ const e = R(this), {
62
67
  dataItems: t,
63
- guid: n,
64
- size: a,
65
- disabled: l,
66
- tagsRounded: d,
67
- removeTagIcon: u,
68
- id: p,
69
- className: c
70
- } = this.$props;
71
- return i("div", {
72
- class: T("k-input-values", c),
73
- id: p,
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, b = s && t.length > s, T = 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
- }, [i("div", {
82
+ }, [n("div", {
76
83
  class: this.wrapperClass,
77
84
  role: "listbox",
78
- id: "tagslist-" + n
79
- }, [t.map(function(s, o) {
80
- const g = `tag-${n}-${s.text.toString().replace(/\s+/g, "-")}`, r = s === this.$props.focused, m = i(k, {
81
- id: g,
85
+ "aria-label": "chip list",
86
+ "aria-orientation": "horizontal",
87
+ id: "tagslist-" + o
88
+ }, [S.map(function(i, d) {
89
+ const y = `tag-${o}-${i.text.toString().replace(/\s+/g, "-")}`, u = i === this.$props.focused, $ = n(c, {
90
+ id: y,
82
91
  tabIndex: -1,
83
- "aria-selected": r,
92
+ "aria-selected": u,
84
93
  role: "option",
85
94
  "aria-setsize": t.length,
86
- key: s.text + o,
87
- text: s.text,
88
- disabled: l,
95
+ key: i.text + d,
96
+ text: i.text,
97
+ disabled: a,
89
98
  removable: !0,
90
- onRemove: (f) => this.onTagDelete(s.data, f),
91
- removeIcon: u,
92
- onMousedown: x,
93
- onClick: y,
94
- class: r ? "k-focus" : void 0,
95
- rounded: d,
96
- size: a
99
+ onRemove: (x) => this.onTagDelete(i.data, x),
100
+ removeIcon: g,
101
+ onMousedown: m,
102
+ onClick: p,
103
+ class: u ? "k-focus" : void 0,
104
+ rounded: l,
105
+ size: r
97
106
  }, null);
98
- return $.call(this, {
99
- h: v,
107
+ return I.call(this, {
108
+ h: k,
100
109
  template: this.$props.tagRender,
101
- defaultRendering: m,
110
+ defaultRendering: $,
102
111
  additionalProps: {
103
112
  ...this.$props,
104
- tagData: s,
105
- index: o
113
+ tagData: i,
114
+ index: d
106
115
  },
107
116
  additionalListeners: {
108
117
  tagdelete: this.onTagDelete
109
118
  }
110
119
  });
111
- }, this)]), e]);
120
+ }, this), b && n(c, {
121
+ text: v || `+${T} more`,
122
+ disabled: a,
123
+ removable: !1,
124
+ onMousedown: m,
125
+ onClick: p,
126
+ rounded: l,
127
+ size: r
128
+ }, null)]), e]);
112
129
  }
113
130
  });
114
131
  export {
115
- C as TagList
132
+ F as TagList
116
133
  };
@@ -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 s=require("vue"),t=require("@progress/kendo-vue-common"),ne=require("@progress/kendo-vue-popup"),oe=require("@progress/kendo-vue-intl"),E=require("@progress/kendo-vue-treeview"),$=require("../package-metadata.js"),y=require("../common/utils.js"),le=require("../DropDownTree/ListNoData.js"),p=require("../messages/main.js"),re=require("@progress/kendo-vue-labels"),I=require("@progress/kendo-vue-buttons"),de=require("../MultiSelect/TagList.js"),ce=require("../common/ClearButton.js"),L=require("../common/ListFilter.js"),he=require("./utils.js"),q=require("../common/constants.js"),ue=require("@progress/kendo-vue-layout"),pe=require("@progress/kendo-svg-icons"),fe=require("../common/DropDownBase.js");function F(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!s.isVNode(e)}const ge="Please select a value from the list!",{sizeMap:A,roundedMap:me}=t.kendoThemeMaps,ve=e=>e.split("_").map(i=>parseInt(i,10)),O=(e,i)=>{const{validationMessage:a,valid:n,required:o}=e;return{customError:a!==void 0,valid:!!(n!==void 0?n:!o||i),valueMissing:!i}},ye=s.defineComponent({name:"KendoMultiSelectTree",model:{event:"changemodel"},emits:{open:e=>!0,close:e=>!0,focus:e=>!0,blur:e=>!0,change:e=>!0,filterchange:e=>!0,expandchange:e=>!0,changemodel:e=>!0,"update:modelValue":e=>!0},props:{opened:{type:Boolean,default:void 0},disabled:Boolean,dir:String,tabIndex:Number,accessKey:String,dataItems:{type:Array,default:function(){return[]}},value:Array,modelValue:Array,valueMap:Function,placeholder:String,dataItemKey:{type:String,required:!0},textField:{type:String,required:!0},checkField:{type:String,default:"checkField"},checkIndeterminateField:{type:String,default:"checkIndeterminateField"},expandField:String,subItemsField:{type:String,default:"items"},className:String,label:String,validationMessage:String,validityStyles:{type:Boolean,default:!0},valid:{type:Boolean,default:void 0},required:Boolean,name:String,id:String,ariaLabelledBy:String,ariaDescribedBy:String,filterable:Boolean,filter:String,loading:Boolean,tags:Array,popupSettings:{type:Object,default:function(){return{animate:!0,height:"200px",anchor:""}}},size:{type:String,validator:function(e){return["small","medium","large"].includes(e)}},rounded:{type:String,validator:function(e){return["none","small","medium","large","full"].includes(e)}},fillMode:{type:String,validator:function(e){return["flat","outline","solid"].includes(e)}},item:[String,Function,Object],tag:[String,Function,Object],header:[String,Function,Object],footer:[String,Function,Object],listNoData:[String,Function,Object],adaptive:{type:Boolean,default:void 0},adaptiveTitle:{type:String,default:void 0}},inject:{kendoLocalizationService:{default:null},adaptiveModeBreakpoints:{default:{small:q.MOBILE_SMALL_DEVICE,medium:q.MOBILE_MEDIUM_DEVICE}}},created(){this.observer=null,t.validatePackage($.packageMetadata),this.showLicenseWatermark=t.shouldShowValidationUI($.packageMetadata),this.licenseMessage=t.getLicenseMessage($.packageMetadata),this.base=new fe(this),this.componentGuid=t.guid(),this.anchor=t.guid()},data(){return{showLicenseWatermark:!1,licenseMessage:void 0,focusedTagState:void 0,openState:!1,focusedState:!1,filterState:"",currentValue:[],popupWidth:"200px",windowWidth:0,initialAdaptiveRenderingValues:void 0}},computed:{animationStyles(){return this.windowWidth<=this.adaptiveModeBreakpoints.small?{top:0,width:"100%",height:"100%"}:void 0},classNameAdaptive(){return this.windowWidth<=this.adaptiveModeBreakpoints.small?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"},adaptiveState(){return this.windowWidth<=this.adaptiveModeBreakpoints.medium&&this.$props.adaptive},isOpen(){return this.opened!==void 0?this.opened:this.openState},computedValue(){return this.value!==void 0?this.value:this.$props.modelValue!==void 0?this.$props.modelValue:this.currentValue},hasValue(){return!!this.computedValue.length},tagsToRenderRef(){if(this.initialAdaptiveRenderingValues===void 0)return this.tags===void 0?this.computedValue.map(e=>({text:y.getItemValue(e,this.$props.textField),data:[e]})):[...this.tags];{const e=this.initialAdaptiveRenderingValues;return e.length>0&&e.map(i=>({text:y.getItemValue(i,this.$props.textField),data:[i]}))}}},watch:{isOpen:function(e){e&&this.value?this.initialAdaptiveRenderingValues=[...this.value]:this.initialAdaptiveRenderingValues=void 0}},mounted(){this.observer=t.canUseDOM&&window.ResizeObserver&&new ResizeObserver(this.calculateMedia),document!=null&&document.body&&this.observer&&this.observer.observe(document.body),this.elementRef=t.getRef(this,"kendoAnchor"),this.inputRef=t.getRef(this,"input"),this.selectRef=t.getRef(this,"select"),this.treeViewRef=t.getRef(this,"treeView"),this.skipFocusRef=!1,this.popupRef=t.getRef(this,"popup"),this.calculatePopupWidth()},updated(){this.inputRef=t.getRef(this,"input"),this.treeViewRef=t.getRef(this,"treeView"),this.popupRef&&this.isOpen&&this.hasValue&&this.popupRef.reposition(),this.setValidity(),this.calculatePopupWidth()},render(){let e;const i=this.$props.id||this.componentGuid,{dataItems:a,dataItemKey:n,popupSettings:o={},disabled:d,placeholder:l,label:r,name:c,checkField:g,checkIndeterminateField:k,subItemsField:M,validationMessage:P,valid:W,value:K,required:R,validityStyles:z,adaptiveTitle:j}=this.$props,V=t.getTabIndex(this.$props.tabIndex,d),w=oe.provideLocalizationService(this),_=O({validationMessage:P,valid:W,required:R},this.hasValue),b=this.$props.dir,C=this.adaptiveState,N=t.templateRendering.call(this,this.item,t.getListeners.call(this)),G=t.templateRendering.call(this,this.tag,t.getListeners.call(this)),H=t.templateRendering.call(this,this.$props.header,t.getListeners.call(this)),U=t.templateRendering.call(this,this.$props.footer,t.getListeners.call(this)),x=t.getTemplate.call(this,{h:s.h,template:H}),T=t.getTemplate.call(this,{h:s.h,template:U}),J=t.templateRendering.call(this,this.$props.listNoData,t.getListeners.call(this)),Q=s.createVNode(le.ListNoData,null,F(e=w.toLanguageString(p.nodata,p.messages[p.nodata]))?e:{default:()=>[e]}),B=t.getTemplate.call(this,{h:s.h,defaultRendering:Q,template:J}),D=!z||_.valid,{size:h,rounded:m,fillMode:v}=this.$props,X=()=>[s.createVNode("div",{class:"k-actionsheet-titlebar-group k-hbox"},[s.createVNode("div",{class:"k-actionsheet-title"},[s.createVNode("div",{class:"k-text-center"},[j]),s.createVNode("div",{class:"k-actionsheet-subtitle k-text-center"},[l])]),s.createVNode("div",{class:"k-actionsheet-actions"},[s.createVNode(I.Button,{tabIndex:5,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.onCancel,icon:"x",svgIcon:pe.xIcon},null)])]),s.createVNode("div",{class:"k-actionsheet-titlebar-group k-actionsheet-filter"},[this.$props.filterable&&s.createVNode(L.ListFilter,{value:this.$props.filter===void 0?this.filterState:this.$props.filter,ref:t.setRef(this,"input"),onChange:this.onFilterChange,onKeydown:this.onInputKeyDown,size:h,rounded:m,fillMode:v,onFocus:this.onFocus,onBlur:this.onBlur},null)])],Y=t.templateRendering.call(this,X,t.getListeners.call(this)),Z=()=>{const u=w.toLanguageString(p.adaptiveModeFooterCancel,p.messages[p.adaptiveModeFooterCancel]),f=w.toLanguageString(p.adaptiveModeFooterApply,p.messages[p.adaptiveModeFooterApply]);return[s.createVNode(I.Button,{size:"large","aria-label":u,"aria-disabled":"false",type:"button",onClick:this.onCancel},F(u)?u:{default:()=>[u]}),s.createVNode(I.Button,{themeColor:"primary",size:"large","aria-label":f,"aria-disabled":"false",type:"button",onClick:this.closePopup},F(f)?f:{default:()=>[f]})]},ee=t.templateRendering.call(this,Z,t.getListeners.call(this)),te=()=>{const u=this.base.getTemplateDef.call(this,x,s.h),f=this.base.getTemplateDef.call(this,T,s.h);return[u&&s.createVNode("div",{class:"k-list-header"},[u]),a.length>0?s.createVNode(E.TreeView,{ref:t.setRef(this,"treeView"),tabIndex:V,dataItems:a,focusIdField:n,textField:this.$props.textField,checkField:g,checkIndeterminateField:k,expandField:this.$props.expandField,childrenField:M,expandIcons:!0,onCheckchange:this.onChange,onExpandchange:this.onExpand,onFocus:this.onFocus,onBlur:this.onBlur,onKeydown:this.onWrapperKeyDown,checkboxes:!0,size:"large",item:N},null):B,f&&s.createVNode("div",{class:"k-list-footer"},[f])]},ie=t.templateRendering.call(this,te,t.getListeners.call(this)),se=function(){return s.createVNode(ue.ActionSheet,{expand:this.isOpen,animation:!0,animationStyles:this.animationStyles,className:this.classNameAdaptive,footerClassName:"k-actions k-actions-stretched",contentClassName:"!k-overflow-hidden",header:Y,content:ie,footer:ee,onClose:this.onCancel,navigatableElements:["input.k-input-inner",".k-actionsheet-actions > button"]},null)},ae=function(){return s.createVNode("span",{ref:t.setRef(this,"kendoAnchor"),class:t.classNames("k-multiselecttree k-input",this.$props.className,{[`k-input-${A[h]||h}`]:h,[`k-rounded-${me[m]||m}`]:m,[`k-input-${v}`]:v,"k-focus":this.focusedState&&!d,"k-invalid":!D,"k-disabled":d,"k-loading":this.$props.loading,"k-required":R}),tabindex:V,accesskey:this.$props.accessKey,id:i,dir:b,onKeydown:this.onWrapperKeyDown,onMousedown:this.onWrapperMouseDown,onFocusin:this.onFocus,onFocusout:this.onBlur,role:"combobox","aria-haspopup":"tree","aria-expanded":this.isOpen,"aria-disabled":d,"aria-label":r,"aria-labelledby":this.$props.ariaLabelledBy,"aria-describedby":this.$props.ariaLabelledBy?this.$props.ariaLabelledBy:"tagslist-"+i,"aria-required":this.$props.required,onClick:this.onWrapperClick},[this.tagsToRenderRef.length>0&&s.createVNode(de.TagList,{id:"tagslist-"+i,class:t.classNames("k-input-values k-chip-list k-selection-multiple",{[`k-chip-list-${A[h]||h}`]:h,"k-readonly":this.hasValue}),tagRender:G,onTagdelete:this.onTagDelete,dataItems:this.tagsToRenderRef,guid:i,focused:this.focusedTagState?this.tagsToRenderRef.find(u=>this.focusedTagState&&y.matchTags(u,this.focusedTagState,n)):void 0,tagsRounded:m,size:h,fillMode:v},null),s.createVNode("span",{class:"k-input-inner",role:"combobox",tabindex:V,"aria-expanded":this.isOpen,"aria-describedby":"tagslist-"+i,"aria-label":this.$props.ariaLabelledBy},[this.tagsToRenderRef.length===0&&s.createVNode("span",{class:"k-input-value-text"},[l])]),this.$props.loading&&s.createVNode(t.Icon,{class:"k-input-loading-icon",name:"loading"},null),this.hasValue&&!d&&s.createVNode(ce.ClearButton,{onClearclick:this.onClear},null),s.createVNode("select",{name:c,ref:t.setRef(this,"select"),tabindex:-1,"aria-hidden":!0,required:R,title:r,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},[s.createVNode("option",{value:this.$props.valueMap?this.$props.valueMap.call(void 0,K):K},null)]),this.showLicenseWatermark?s.createVNode(t.WatermarkOverlay,{message:this.licenseMessage},null):null,!C&&s.createVNode(ne.Popup,{style:{width:this.popupWidth,direction:b},popupClass:t.classNames(o.popupClass,"k-multiselecttree-popup","popup-"+this.componentGuid),class:t.classNames(o.className,{"k-rtl":b==="rtl"}),animate:o.animate,anchor:this.anchor,show:this.isOpen,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,appendTo:o.appendTo,ref:t.setRef(this,"popup")},{default:()=>[this.$props.filterable&&s.createVNode(L.ListFilter,{value:this.$props.filter===void 0?this.filterState:this.$props.filter,ref:t.setRef(this,"input"),onChange:this.onFilterChange,onKeydown:this.onInputKeyDown,size:h,rounded:m,fillMode:v,onFocus:this.onFocus,onBlur:this.onBlur},null),x&&s.createVNode("div",{class:"k-list-header"},[x]),a.length>0?s.createVNode(E.TreeView,{ref:t.setRef(this,"treeView"),tabIndex:V,dataItems:a,focusIdField:n,textField:this.$props.textField,checkField:g,checkIndeterminateField:k,expandField:this.$props.expandField,childrenField:M,expandIcons:!0,onCheckchange:this.onChange,onExpandchange:this.onExpand,onFocus:this.onFocus,onBlur:this.onBlur,onKeydown:this.onWrapperKeyDown,checkboxes:!0,size:h,item:N},null):B,T&&s.createVNode("div",{class:"k-list-footer"},[T])]})])},S=[s.h(ae.call(this),{...this.$attrs}),C&&se.call(this)];return r?s.createVNode(re.FloatingLabel,{label:r,editorValue:this.hasValue,editorPlaceholder:l,editorValid:D,editorDisabled:d,editorId:i,dir:b},F(S)?S:{default:()=>[S]}):S},methods:{clearFilter(e){this.onFilterChange(e,"")},onCancel(e){const i={event:e,target:this},a={items:[],operation:"toggle",value:this.initialAdaptiveRenderingValues,...i};this.$emit("change",a),this.closePopup(e)},calculateMedia(e){for(let i of e)this.windowWidth=i.target.clientWidth},calculatePopupWidth(){this.elementRef&&(this.popupWidth=this.popupSettings.width!==void 0?this.popupSettings.width:this.elementRef.offsetWidth+"px")},focus(){this.$el&&this.$el.focus()},setValidity(){if(this.selectRef&&this.selectRef.setCustomValidity){const{validationMessage:e,valid:i,required:a}=this.$props,n=O({validationMessage:e,valid:i,required:a},this.hasValue);this.selectRef.setCustomValidity(n.valid?"":this.validationMessage===void 0?ge:this.validationMessage)}},changeValue(e,i,a){const n={dataItemKey:this.dataItemKey,checkField:this.checkField,checkIndeterminateField:this.checkIndeterminateField,expandField:this.expandField,subItemsField:this.subItemsField},o=he.getMultiSelectTreeValue(this.dataItems,{...n,items:i,operation:a,value:this.computedValue}),d={items:i,operation:a,value:o,...e};this.$emit("changemodel",o),this.$emit("update:modelValue",o),this.$emit("change",d)},onChange(e){if(y.areSame(e.item,this.computedValue,this.dataItemKey))return;const{item:i,event:a}=e,n={event:a,target:this};this.changeValue(n,[i],"toggle")},openPopup(e){if(!this.isOpen){const i={...e};this.$emit("open",i),this.opened===void 0&&(this.openState=!0)}},closePopup(e){if(this.$props.filterable&&this.clearFilter({...e,target:{...e.target,value:""}}),this.isOpen){const i={...e};this.$emit("close",i),this.opened===void 0&&(this.openState=!1)}},switchFocus(e){this.skipFocusRef=!0,e(),window.setTimeout(()=>this.skipFocusRef=!1,0)},focusElement(e){e&&this.switchFocus(()=>e.focus())},onPopupOpened(){if(!this.focusedState&&this.isOpen)this.closePopup({target:this});else if(this.$props.filterable){const e=this.inputRef&&this.inputRef.input;this.focusElement(e)}else this.focusElement(this.treeViewRef&&this.treeViewRef.input)},onPopupClosed(){this.focusedState&&this.focusElement(this.elementRef)},onFocus(e){if(!this.focusedState&&!this.skipFocusRef){this.focusedState=!0;const i={event:e,target:this};this.$emit("focus",i)}},onBlur(e){var i;if(this.focusedState&&!this.skipFocusRef&&!this.adaptiveState){this.focusedTagState=void 0,this.focusedState=!1;const a={event:e,target:this},n={...a},o=e.relatedTarget||((i=e.event)==null?void 0:i.relatedTarget);o!=null&&o.closest(".popup-"+this.componentGuid)||(this.$emit("blur",n),this.closePopup(a))}},onWrapperMouseDown(){this.focusedState&&this.switchFocus(t.noop)},onWrapperClick(e){if(!this.$props.disabled&&!e.defaultPrevented){this.focusedState=!0;const i={event:e,target:this};this.isOpen||this.openPopup(i)}},onWrapperKeyDown(e){const{keyCode:i,altKey:a}=e,n=this.treeViewRef&&this.treeViewRef.$el,o=this.inputRef&&this.inputRef.input;if(this.$props.disabled||e.defaultPrevented&&o===e.target)return;const d={event:e,target:this};if(this.computedValue&&this.computedValue.length>0&&(i===t.Keys.left||i===t.Keys.right||i===t.Keys.home||i===t.Keys.end||i===t.Keys.delete||i===t.Keys.backspace)){const l=this.tagsToRenderRef;let r=this.focusedTagState?l.findIndex(k=>y.matchTags(k,this.focusedTagState,this.dataItemKey)):-1,c;const g=r!==-1;i===t.Keys.left?(g?r=Math.max(0,r-1):r=l.length-1,c=l[r]):i===t.Keys.right?g?(r=Math.min(l.length-1,r+1),c=l[r]):c=l[0]:i===t.Keys.home?c=l[0]:i===t.Keys.end?c=l[l.length-1]:(i===t.Keys.delete||i===t.Keys.backspace)&&g&&this.changeValue(d,l[r].data,"delete"),c!==this.focusedTagState&&(this.focusedTagState=c)}if(this.isOpen)if(i===t.Keys.esc||a&&i===t.Keys.up)e.preventDefault(),this.switchFocus(()=>{this.focusElement(this.elementRef)}),this.closePopup(d);else if(n&&n.querySelector(".k-focus")&&(i===t.Keys.up||i===t.Keys.down||i===t.Keys.left||i===t.Keys.right||i===t.Keys.home||i===t.Keys.end)){if(i===t.Keys.up){const l=Array.from(n.querySelectorAll(".k-treeview-item")),r=[...l].reverse().find(c=>!!(c&&c.querySelector(".k-focus")));if(r&&l.indexOf(r)===0)return this.switchFocus(()=>{this.focusElement(o||this.elementRef)})}this.switchFocus(t.noop)}else i===t.Keys.down&&this.switchFocus(()=>{this.focusElement(o||n)});else a&&i===t.Keys.down&&(e.preventDefault(),this.openPopup(d))},onInputKeyDown(e){const{keyCode:i,altKey:a}=e;(i===t.Keys.esc||a&&i===t.Keys.up)&&(e.preventDefault(),this.switchFocus(()=>{this.focusElement(this.elementRef)}),i===t.Keys.esc&&this.adaptiveState?this.onCancel(e):this.closePopup(e)),!(a||i!==t.Keys.up&&i!==t.Keys.down)&&(e.preventDefault(),this.switchFocus(i===t.Keys.up?()=>{this.focusElement(this.elementRef)}:()=>{this.focusElement(this.treeViewRef&&this.treeViewRef.$el)}))},onClear(e){const i={event:e,target:this};this.changeValue(i,[],"clear"),this.closePopup(i),this.filterState="",e.preventDefault()},onTagDelete(e,i){if(this.closePopup({target:this}),!this.focusedState){const a=this.inputRef&&this.inputRef.input;this.focusElement(a)}this.changeValue({event:i,target:this},e,"delete")},onExpand(e){const{item:i,itemHierarchicalIndex:a,event:n}=e,o={level:ve(a),item:i,event:n,target:this};this.$emit("expandchange",o)},onFilterChange(e,i){const a=i?"":e.target.value,o={filter:{field:this.$props.textField,operator:"contains",value:a},event:e,target:this};this.$emit("filterchange",o),this.$props.filter===void 0&&(this.filterState=a)}}});exports.MultiSelectTree=ye;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),t=require("@progress/kendo-vue-common"),ne=require("@progress/kendo-vue-popup"),oe=require("@progress/kendo-vue-intl"),E=require("@progress/kendo-vue-treeview"),$=require("../package-metadata.js"),y=require("../common/utils.js"),le=require("../DropDownTree/ListNoData.js"),p=require("../messages/main.js"),re=require("@progress/kendo-vue-labels"),I=require("@progress/kendo-vue-buttons"),de=require("../MultiSelect/TagList.js"),ce=require("../common/ClearButton.js"),L=require("../common/ListFilter.js"),he=require("./utils.js"),q=require("../common/constants.js"),ue=require("@progress/kendo-vue-layout"),pe=require("@progress/kendo-svg-icons"),fe=require("../common/DropDownBase.js");function F(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!s.isVNode(e)}const ge="Please select a value from the list!",{sizeMap:A,roundedMap:me}=t.kendoThemeMaps,ve=e=>e.split("_").map(i=>parseInt(i,10)),O=(e,i)=>{const{validationMessage:a,valid:n,required:o}=e;return{customError:a!==void 0,valid:!!(n!==void 0?n:!o||i),valueMissing:!i}},ye=s.defineComponent({name:"KendoMultiSelectTree",model:{event:"changemodel"},emits:{open:e=>!0,close:e=>!0,focus:e=>!0,blur:e=>!0,change:e=>!0,filterchange:e=>!0,expandchange:e=>!0,changemodel:e=>!0,"update:modelValue":e=>!0},props:{opened:{type:Boolean,default:void 0},disabled:Boolean,dir:String,tabIndex:Number,accessKey:String,dataItems:{type:Array,default:function(){return[]}},value:Array,modelValue:Array,valueMap:Function,placeholder:String,dataItemKey:{type:String,required:!0},textField:{type:String,required:!0},checkField:{type:String,default:"checkField"},checkIndeterminateField:{type:String,default:"checkIndeterminateField"},expandField:String,subItemsField:{type:String,default:"items"},className:String,label:String,validationMessage:String,validityStyles:{type:Boolean,default:!0},valid:{type:Boolean,default:void 0},required:Boolean,name:String,id:String,ariaLabelledBy:String,ariaDescribedBy:String,filterable:Boolean,filter:String,loading:Boolean,tags:Array,popupSettings:{type:Object,default:function(){return{animate:!0,height:"200px",anchor:""}}},size:{type:String,validator:function(e){return["small","medium","large"].includes(e)}},rounded:{type:String,validator:function(e){return["none","small","medium","large","full"].includes(e)}},fillMode:{type:String,validator:function(e){return["flat","outline","solid"].includes(e)}},item:[String,Function,Object],tag:[String,Function,Object],header:[String,Function,Object],footer:[String,Function,Object],listNoData:[String,Function,Object],adaptive:{type:Boolean,default:void 0},adaptiveTitle:{type:String,default:void 0}},inject:{kendoLocalizationService:{default:null},adaptiveModeBreakpoints:{default:{small:q.MOBILE_SMALL_DEVICE,medium:q.MOBILE_MEDIUM_DEVICE}}},created(){this.observer=null,t.validatePackage($.packageMetadata),this.showLicenseWatermark=t.shouldShowValidationUI($.packageMetadata),this.licenseMessage=t.getLicenseMessage($.packageMetadata),this.base=new fe(this),this.componentGuid=t.guid(),this.anchor=t.guid()},data(){return{showLicenseWatermark:!1,licenseMessage:void 0,focusedTagState:void 0,openState:!1,focusedState:!1,filterState:"",currentValue:[],popupWidth:"200px",windowWidth:0,initialAdaptiveRenderingValues:void 0}},computed:{animationStyles(){return this.windowWidth<=this.adaptiveModeBreakpoints.small?{top:0,width:"100%",height:"100%"}:void 0},classNameAdaptive(){return this.windowWidth<=this.adaptiveModeBreakpoints.small?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"},adaptiveState(){return this.windowWidth<=this.adaptiveModeBreakpoints.medium&&this.$props.adaptive},isOpen(){return this.opened!==void 0?this.opened:this.openState},computedValue(){return this.value!==void 0?this.value:this.$props.modelValue!==void 0?this.$props.modelValue:this.currentValue},hasValue(){return!!this.computedValue.length},tagsToRenderRef(){if(this.initialAdaptiveRenderingValues===void 0)return this.tags===void 0?this.computedValue.map(e=>({text:y.getItemValue(e,this.$props.textField),data:[e]})):[...this.tags];{const e=this.initialAdaptiveRenderingValues;return e.length>0&&e.map(i=>({text:y.getItemValue(i,this.$props.textField),data:[i]}))}}},watch:{isOpen:function(e){e&&this.value?this.initialAdaptiveRenderingValues=[...this.value]:this.initialAdaptiveRenderingValues=void 0}},mounted(){this.observer=t.canUseDOM&&window.ResizeObserver&&new ResizeObserver(this.calculateMedia),document!=null&&document.body&&this.observer&&this.observer.observe(document.body),this.elementRef=t.getRef(this,"kendoAnchor"),this.inputRef=t.getRef(this,"input"),this.selectRef=t.getRef(this,"select"),this.treeViewRef=t.getRef(this,"treeView"),this.skipFocusRef=!1,this.popupRef=t.getRef(this,"popup"),this.calculatePopupWidth()},updated(){this.inputRef=t.getRef(this,"input"),this.treeViewRef=t.getRef(this,"treeView"),this.popupRef&&this.isOpen&&this.hasValue&&this.popupRef.reposition(),this.setValidity(),this.calculatePopupWidth()},render(){let e;const i=this.$props.id||this.componentGuid,{dataItems:a,dataItemKey:n,popupSettings:o={},disabled:d,placeholder:l,label:r,name:c,checkField:g,checkIndeterminateField:k,subItemsField:M,validationMessage:P,valid:W,value:K,required:R,validityStyles:z,adaptiveTitle:j}=this.$props,V=t.getTabIndex(this.$props.tabIndex,d),w=oe.provideLocalizationService(this),_=O({validationMessage:P,valid:W,required:R},this.hasValue),b=this.$props.dir,C=this.adaptiveState,N=t.templateRendering.call(this,this.item,t.getListeners.call(this)),G=t.templateRendering.call(this,this.tag,t.getListeners.call(this)),H=t.templateRendering.call(this,this.$props.header,t.getListeners.call(this)),U=t.templateRendering.call(this,this.$props.footer,t.getListeners.call(this)),x=t.getTemplate.call(this,{h:s.h,template:H}),T=t.getTemplate.call(this,{h:s.h,template:U}),J=t.templateRendering.call(this,this.$props.listNoData,t.getListeners.call(this)),Q=s.createVNode(le.ListNoData,null,F(e=w.toLanguageString(p.nodata,p.messages[p.nodata]))?e:{default:()=>[e]}),B=t.getTemplate.call(this,{h:s.h,defaultRendering:Q,template:J}),D=!z||_.valid,{size:h,rounded:m,fillMode:v}=this.$props,X=()=>[s.createVNode("div",{class:"k-actionsheet-titlebar-group k-hbox"},[s.createVNode("div",{class:"k-actionsheet-title"},[s.createVNode("div",{class:"k-text-center"},[j]),s.createVNode("div",{class:"k-actionsheet-subtitle k-text-center"},[l])]),s.createVNode("div",{class:"k-actionsheet-actions"},[s.createVNode(I.Button,{tabIndex:5,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.onCancel,icon:"x",svgIcon:pe.xIcon},null)])]),s.createVNode("div",{class:"k-actionsheet-titlebar-group k-actionsheet-filter"},[this.$props.filterable&&s.createVNode(L.ListFilter,{value:this.$props.filter===void 0?this.filterState:this.$props.filter,ref:t.setRef(this,"input"),onChange:this.onFilterChange,onKeydown:this.onInputKeyDown,size:h,rounded:m,fillMode:v,onFocus:this.onFocus,onBlur:this.onBlur},null)])],Y=t.templateRendering.call(this,X,t.getListeners.call(this)),Z=()=>{const u=w.toLanguageString(p.adaptiveModeFooterCancel,p.messages[p.adaptiveModeFooterCancel]),f=w.toLanguageString(p.adaptiveModeFooterApply,p.messages[p.adaptiveModeFooterApply]);return[s.createVNode(I.Button,{size:"large","aria-label":u,"aria-disabled":"false",type:"button",onClick:this.onCancel},F(u)?u:{default:()=>[u]}),s.createVNode(I.Button,{themeColor:"primary",size:"large","aria-label":f,"aria-disabled":"false",type:"button",onClick:this.closePopup},F(f)?f:{default:()=>[f]})]},ee=t.templateRendering.call(this,Z,t.getListeners.call(this)),te=()=>{const u=this.base.getTemplateDef.call(this,x,s.h),f=this.base.getTemplateDef.call(this,T,s.h);return[u&&s.createVNode("div",{class:"k-list-header"},[u]),a.length>0?s.createVNode(E.TreeView,{ref:t.setRef(this,"treeView"),tabIndex:V,dataItems:a,focusIdField:n,textField:this.$props.textField,checkField:g,checkIndeterminateField:k,expandField:this.$props.expandField,childrenField:M,expandIcons:!0,onCheckchange:this.onChange,onExpandchange:this.onExpand,onFocus:this.onFocus,onBlur:this.onBlur,onKeydown:this.onWrapperKeyDown,checkboxes:!0,size:"large",item:N},null):B,f&&s.createVNode("div",{class:"k-list-footer"},[f])]},ie=t.templateRendering.call(this,te,t.getListeners.call(this)),se=function(){return s.createVNode(ue.ActionSheet,{expand:this.isOpen,animation:!0,animationStyles:this.animationStyles,className:this.classNameAdaptive,footerClassName:"k-actions k-actions-stretched",contentClassName:"!k-overflow-hidden",header:Y,content:ie,footer:ee,onClose:this.onCancel,navigatableElements:["input.k-input-inner",".k-actionsheet-actions > button"]},null)},ae=function(){return s.createVNode("span",{ref:t.setRef(this,"kendoAnchor"),class:t.classNames("k-multiselecttree k-input",this.$props.className,{[`k-input-${A[h]||h}`]:h,[`k-rounded-${me[m]||m}`]:m,[`k-input-${v}`]:v,"k-focus":this.focusedState&&!d,"k-invalid":!D,"k-disabled":d,"k-loading":this.$props.loading,"k-required":R}),tabindex:V,accesskey:this.$props.accessKey,id:i,dir:b,onKeydown:this.onWrapperKeyDown,onMousedown:this.onWrapperMouseDown,onFocusin:this.onFocus,onFocusout:this.onBlur,role:"combobox","aria-haspopup":"tree","aria-expanded":this.isOpen,"aria-disabled":d||void 0,"aria-label":r,"aria-labelledby":this.$props.ariaLabelledBy,"aria-describedby":this.$props.ariaLabelledBy?this.$props.ariaLabelledBy:"tagslist-"+i,"aria-required":this.$props.required||void 0,onClick:this.onWrapperClick},[this.tagsToRenderRef.length>0&&s.createVNode(de.TagList,{id:"tagslist-"+i,class:t.classNames("k-input-values k-chip-list k-selection-multiple",{[`k-chip-list-${A[h]||h}`]:h,"k-readonly":this.hasValue}),tagRender:G,onTagdelete:this.onTagDelete,dataItems:this.tagsToRenderRef,guid:i,focused:this.focusedTagState?this.tagsToRenderRef.find(u=>this.focusedTagState&&y.matchTags(u,this.focusedTagState,n)):void 0,tagsRounded:m,size:h,fillMode:v},null),s.createVNode("span",{class:"k-input-inner",role:"combobox",tabindex:V,"aria-expanded":this.isOpen,"aria-describedby":"tagslist-"+i,"aria-label":this.$props.ariaLabelledBy},[this.tagsToRenderRef.length===0&&s.createVNode("span",{class:"k-input-value-text"},[l])]),this.$props.loading&&s.createVNode(t.Icon,{class:"k-input-loading-icon",name:"loading"},null),this.hasValue&&!d&&s.createVNode(ce.ClearButton,{onClearclick:this.onClear},null),s.createVNode("select",{name:c,ref:t.setRef(this,"select"),tabindex:-1,"aria-hidden":!0,required:R,title:r,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},[s.createVNode("option",{value:this.$props.valueMap?this.$props.valueMap.call(void 0,K):K},null)]),this.showLicenseWatermark?s.createVNode(t.WatermarkOverlay,{message:this.licenseMessage},null):null,!C&&s.createVNode(ne.Popup,{style:{width:this.popupWidth,direction:b},popupClass:t.classNames(o.popupClass,"k-multiselecttree-popup","popup-"+this.componentGuid),class:t.classNames(o.className,{"k-rtl":b==="rtl"}),animate:o.animate,anchor:this.anchor,show:this.isOpen,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,appendTo:o.appendTo,ref:t.setRef(this,"popup")},{default:()=>[this.$props.filterable&&s.createVNode(L.ListFilter,{value:this.$props.filter===void 0?this.filterState:this.$props.filter,ref:t.setRef(this,"input"),onChange:this.onFilterChange,onKeydown:this.onInputKeyDown,size:h,rounded:m,fillMode:v,onFocus:this.onFocus,onBlur:this.onBlur},null),x&&s.createVNode("div",{class:"k-list-header"},[x]),a.length>0?s.createVNode(E.TreeView,{ref:t.setRef(this,"treeView"),tabIndex:V,dataItems:a,focusIdField:n,textField:this.$props.textField,checkField:g,checkIndeterminateField:k,expandField:this.$props.expandField,childrenField:M,expandIcons:!0,onCheckchange:this.onChange,onExpandchange:this.onExpand,onFocus:this.onFocus,onBlur:this.onBlur,onKeydown:this.onWrapperKeyDown,checkboxes:!0,size:h,item:N},null):B,T&&s.createVNode("div",{class:"k-list-footer"},[T])]})])},S=[s.h(ae.call(this),{...this.$attrs}),C&&se.call(this)];return r?s.createVNode(re.FloatingLabel,{label:r,editorValue:this.hasValue,editorPlaceholder:l,editorValid:D,editorDisabled:d,editorId:i,dir:b},F(S)?S:{default:()=>[S]}):S},methods:{clearFilter(e){this.onFilterChange(e,"")},onCancel(e){const i={event:e,target:this},a={items:[],operation:"toggle",value:this.initialAdaptiveRenderingValues,...i};this.$emit("change",a),this.closePopup(e)},calculateMedia(e){for(let i of e)this.windowWidth=i.target.clientWidth},calculatePopupWidth(){this.elementRef&&(this.popupWidth=this.popupSettings.width!==void 0?this.popupSettings.width:this.elementRef.offsetWidth+"px")},focus(){this.$el&&this.$el.focus()},setValidity(){if(this.selectRef&&this.selectRef.setCustomValidity){const{validationMessage:e,valid:i,required:a}=this.$props,n=O({validationMessage:e,valid:i,required:a},this.hasValue);this.selectRef.setCustomValidity(n.valid?"":this.validationMessage===void 0?ge:this.validationMessage)}},changeValue(e,i,a){const n={dataItemKey:this.dataItemKey,checkField:this.checkField,checkIndeterminateField:this.checkIndeterminateField,expandField:this.expandField,subItemsField:this.subItemsField},o=he.getMultiSelectTreeValue(this.dataItems,{...n,items:i,operation:a,value:this.computedValue}),d={items:i,operation:a,value:o,...e};this.$emit("changemodel",o),this.$emit("update:modelValue",o),this.$emit("change",d)},onChange(e){if(y.areSame(e.item,this.computedValue,this.dataItemKey))return;const{item:i,event:a}=e,n={event:a,target:this};this.changeValue(n,[i],"toggle")},openPopup(e){if(!this.isOpen){const i={...e};this.$emit("open",i),this.opened===void 0&&(this.openState=!0)}},closePopup(e){if(this.$props.filterable&&this.clearFilter({...e,target:{...e.target,value:""}}),this.isOpen){const i={...e};this.$emit("close",i),this.opened===void 0&&(this.openState=!1)}},switchFocus(e){this.skipFocusRef=!0,e(),window.setTimeout(()=>this.skipFocusRef=!1,0)},focusElement(e){e&&this.switchFocus(()=>e.focus())},onPopupOpened(){if(!this.focusedState&&this.isOpen)this.closePopup({target:this});else if(this.$props.filterable){const e=this.inputRef&&this.inputRef.input;this.focusElement(e)}else this.focusElement(this.treeViewRef&&this.treeViewRef.input)},onPopupClosed(){this.focusedState&&this.focusElement(this.elementRef)},onFocus(e){if(!this.focusedState&&!this.skipFocusRef){this.focusedState=!0;const i={event:e,target:this};this.$emit("focus",i)}},onBlur(e){var i;if(this.focusedState&&!this.skipFocusRef&&!this.adaptiveState){this.focusedTagState=void 0,this.focusedState=!1;const a={event:e,target:this},n={...a},o=e.relatedTarget||((i=e.event)==null?void 0:i.relatedTarget);o!=null&&o.closest(".popup-"+this.componentGuid)||(this.$emit("blur",n),this.closePopup(a))}},onWrapperMouseDown(){this.focusedState&&this.switchFocus(t.noop)},onWrapperClick(e){if(!this.$props.disabled&&!e.defaultPrevented){this.focusedState=!0;const i={event:e,target:this};this.isOpen||this.openPopup(i)}},onWrapperKeyDown(e){const{keyCode:i,altKey:a}=e,n=this.treeViewRef&&this.treeViewRef.$el,o=this.inputRef&&this.inputRef.input;if(this.$props.disabled||e.defaultPrevented&&o===e.target)return;const d={event:e,target:this};if(this.computedValue&&this.computedValue.length>0&&(i===t.Keys.left||i===t.Keys.right||i===t.Keys.home||i===t.Keys.end||i===t.Keys.delete||i===t.Keys.backspace)){const l=this.tagsToRenderRef;let r=this.focusedTagState?l.findIndex(k=>y.matchTags(k,this.focusedTagState,this.dataItemKey)):-1,c;const g=r!==-1;i===t.Keys.left?(g?r=Math.max(0,r-1):r=l.length-1,c=l[r]):i===t.Keys.right?g?(r=Math.min(l.length-1,r+1),c=l[r]):c=l[0]:i===t.Keys.home?c=l[0]:i===t.Keys.end?c=l[l.length-1]:(i===t.Keys.delete||i===t.Keys.backspace)&&g&&this.changeValue(d,l[r].data,"delete"),c!==this.focusedTagState&&(this.focusedTagState=c)}if(this.isOpen)if(i===t.Keys.esc||a&&i===t.Keys.up)e.preventDefault(),this.switchFocus(()=>{this.focusElement(this.elementRef)}),this.closePopup(d);else if(n&&n.querySelector(".k-focus")&&(i===t.Keys.up||i===t.Keys.down||i===t.Keys.left||i===t.Keys.right||i===t.Keys.home||i===t.Keys.end)){if(i===t.Keys.up){const l=Array.from(n.querySelectorAll(".k-treeview-item")),r=[...l].reverse().find(c=>!!(c&&c.querySelector(".k-focus")));if(r&&l.indexOf(r)===0)return this.switchFocus(()=>{this.focusElement(o||this.elementRef)})}this.switchFocus(t.noop)}else i===t.Keys.down&&this.switchFocus(()=>{this.focusElement(o||n)});else a&&i===t.Keys.down&&(e.preventDefault(),this.openPopup(d))},onInputKeyDown(e){const{keyCode:i,altKey:a}=e;(i===t.Keys.esc||a&&i===t.Keys.up)&&(e.preventDefault(),this.switchFocus(()=>{this.focusElement(this.elementRef)}),i===t.Keys.esc&&this.adaptiveState?this.onCancel(e):this.closePopup(e)),!(a||i!==t.Keys.up&&i!==t.Keys.down)&&(e.preventDefault(),this.switchFocus(i===t.Keys.up?()=>{this.focusElement(this.elementRef)}:()=>{this.focusElement(this.treeViewRef&&this.treeViewRef.$el)}))},onClear(e){const i={event:e,target:this};this.changeValue(i,[],"clear"),this.closePopup(i),this.filterState="",e.preventDefault()},onTagDelete(e,i){if(this.closePopup({target:this}),!this.focusedState){const a=this.inputRef&&this.inputRef.input;this.focusElement(a)}this.changeValue({event:i,target:this},e,"delete")},onExpand(e){const{item:i,itemHierarchicalIndex:a,event:n}=e,o={level:ve(a),item:i,event:n,target:this};this.$emit("expandchange",o)},onFilterChange(e,i){const a=i?"":e.target.value,o={filter:{field:this.$props.textField,operator:"contains",value:a},event:e,target:this};this.$emit("filterchange",o),this.$props.filter===void 0&&(this.filterState=a)}}});exports.MultiSelectTree=ye;
@@ -391,11 +391,11 @@ const We = "Please select a value from the list!", {
391
391
  role: "combobox",
392
392
  "aria-haspopup": "tree",
393
393
  "aria-expanded": this.isOpen,
394
- "aria-disabled": d,
394
+ "aria-disabled": d || void 0,
395
395
  "aria-label": r,
396
396
  "aria-labelledby": this.$props.ariaLabelledBy,
397
397
  "aria-describedby": this.$props.ariaLabelledBy ? this.$props.ariaLabelledBy : "tagslist-" + t,
398
- "aria-required": this.$props.required,
398
+ "aria-required": this.$props.required || void 0,
399
399
  onClick: this.onWrapperClick
400
400
  }, [
401
401
  this.tagsToRenderRef.length > 0 && s(Me, {
@@ -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,o)=>t in c?f(c,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):c[t]=o;var p=(c,t,o)=>S(c,typeof t!="symbol"?t+"":t,o);const v=require("./VirtualScroll.js"),k=require("./Navigation.js"),l=require("./utils.js"),a=require("@progress/kendo-vue-common"),y=require("../package-metadata.js");class g{constructor(t){p(this,"vs",new v);p(this,"navigation",new k.Navigation);p(this,"handleItemClick",(t,o)=>{const e=this.initState();e.event=o,this.component.handleItemSelect(t,e),this.togglePopup(e),this.applyState(e)});p(this,"handleFocus",t=>{if(!this.component.currentFocused){const o=this.initState();o.data.currentFocused=!0,o.events.push({type:"focus"}),o.event=t,this.applyState(o)}});p(this,"filterChanged",(t,o)=>{const e=this.component,{textField:i,filterable:n}=e.$props;n&&(o.events.push({type:"filterchange",filter:{field:i,operator:"contains",ignoreCase:!0,value:t}}),this.repositionPopup())});p(this,"togglePopup",t=>{const o=this.component.$props,e=o.opened!==void 0?o.opened:this.component.currentOpened;o.opened===void 0&&(t.data.currentOpened=!e),e?t.events.push({type:"close"}):(t.events.push({type:"open"}),this.calculatePopupWidth())});p(this,"pageChange",(t,o)=>{const e=this.initState();e.event=o,this.triggerOnPageChange(e,t.skip,t.take),this.applyState(e)});p(this,"scrollChange",t=>{this.component.$emit("scroll",t)});p(this,"scrollToVirtualItem",(t,o)=>{const e=this.vs;if(e.enabled=!1,t.skip===0)e.reset();else if(t.skip+t.pageSize===t.total)e.scrollToEnd();else{let i=e.translate;i===0&&(e.calcScrollElementHeight(),i=e.itemHeight*t.skip,e.translateTo(i-e.itemHeight)),e.container&&(e.container.scrollTop=i),this.scrollToItem(o,!0)}setTimeout(()=>e.enabled=!0,10)});p(this,"getGroupedDataModernMode",(t,o)=>{const e=[];return t.forEach((i,n)=>{t[n-1]&&i[o]!==t[n-1][o]&&e.push({[o]:i[o]}),e.push(t[n])}),e});p(this,"resetGroupStickyHeader",(t,o)=>{const e=this.initState();t!==o.group&&o.state&&(o.state.data.group=t,this.applyState(e))});a.validatePackage(y.packageMetadata),this.listBoxId=a.guid(),this.guid=a.guid(),this.component=t,this.vs.PageChange=this.pageChange,this.vs.ScrollChange=this.scrollChange}didMount(){const t=this.component.$props,o=t.popupSettings,e=t.style,i=o&&o.width;let n=t.opened===!0;i===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,o=t.popupSettings,e=o&&o.width;this.wrapper&&!e&&(this.component.popupWidth=t.popupSettings.width!==void 0?t.popupSettings.width:this.wrapper.offsetWidth+"px")}scrollVirtualized(t){const o=this.list||this.vs.list,e=o==null?void 0:o.querySelector(".k-list-item");if(!e)return;const i=this.vs,n=i.container||(o==null?void 0:o.parentNode);n&&l.scrollToItem(n,e.offsetHeight,t,i.translate)}scrollNonVirtualized(t,o){const e=o.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(),r=s.top-h.top+e.scrollTop,d=r+s.height,u=e.scrollTop,m=u+e.offsetHeight;d>m?e.scrollTop=r+s.height-e.offsetHeight:r<u&&(e.scrollTop=r)}scrollToItem(t,o){const e=this.list||this.vs.list;if(!e||t<0)return;(o!=null?o:this.vs.enabled)?this.scrollVirtualized(t):this.scrollNonVirtualized(t,e)}repositionPopup(){const t=this.component;setTimeout(function(){const o=t.$refs.container;if(o){const e=o.$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(i=>{this.component[i]=t.data[i]});const o=this.component.primitiveValue(),e={event:t.event,component:this.component,target:{name:this.component.$props.name,value:o},value:o};t.events.forEach(i=>{const{type:n}=i;delete i.type,n&&(n==="change"&&(this.component.$emit("changemodel",o),this.component.$emit("update:modelValue",o)),this.component.$emit(n,{...e,...i}))})}triggerOnPageChange(t,o,e){const i=this.component.$props.virtual;if(i){const n=Math.min(Math.max(0,o),Math.max(0,i.total-e));n!==i.skip&&t.events.push({type:"pagechange",page:{skip:n,take:e}})}}triggerPageChangeCornerItems(t,o){const e=this.component.$props,{dataItems:i=[],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,i[0],n)?this.triggerOnPageChange(o,s.skip-1,s.pageSize):s.skip+s.pageSize<s.total&&l.areSame(t,i[i.length-1],n)?this.triggerOnPageChange(o,s.skip+1,s.pageSize):!h&&s.skip+s.pageSize<s.total&&l.areSame(t,i[i.length-1],n)&&this.triggerOnPageChange(o,s.skip+1,s.pageSize))}getTemplateDef(t,o){const e=a.templateRendering.call(this,t,a.getListeners.call(this));return a.getTemplate.call(this,{h:o,template:e})}getListItemHeight(t){const o=t&&window.getComputedStyle(t);return o?o.height.slice(0,o.height.length-2):0}}p(g,"defaultProps",{popupSettings:{animate:!0,height:"200px"},required:!1,validityStyles:!0});module.exports=g;
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;
@@ -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 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);
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.enabled = !1, t.skip === 0)
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 - e.itemHeight)), e.container && (e.container.scrollTop = i), this.scrollToItem(o, !0);
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(() => e.enabled = !0, 10);
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(), 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);
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, 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));
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"),_=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;
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;