@progress/kendo-vue-dropdowns 6.0.2-develop.1 → 6.1.0-develop.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoComplete/AutoComplete.js +2 -2
- package/AutoComplete/AutoComplete.mjs +76 -73
- package/ComboBox/ComboBox.js +2 -2
- package/ComboBox/ComboBox.mjs +72 -69
- package/DropDownList/DropDownList.js +2 -2
- package/DropDownList/DropDownList.mjs +4 -2
- package/DropDownTree/DropDownTree.js +1 -1
- package/DropDownTree/DropDownTree.mjs +1 -1
- package/DropDownTree/ListNoData.js +1 -1
- package/DropDownTree/ListNoData.mjs +1 -1
- package/MultiSelect/MultiSelect.js +2 -2
- package/MultiSelect/MultiSelect.mjs +83 -80
- package/MultiSelect/TagList.js +1 -1
- package/MultiSelect/TagList.mjs +1 -1
- package/MultiSelectTree/MultiSelectTree.js +1 -1
- package/MultiSelectTree/MultiSelectTree.mjs +1 -1
- package/MultiSelectTree/utils.js +1 -1
- package/MultiSelectTree/utils.mjs +1 -1
- package/README.md +1 -1
- package/common/ClearButton.js +1 -1
- package/common/ClearButton.mjs +1 -1
- package/common/DropDownBase.js +1 -1
- package/common/DropDownBase.mjs +1 -1
- package/common/GroupStickyHeader.js +1 -1
- package/common/GroupStickyHeader.mjs +1 -1
- package/common/List.js +1 -1
- package/common/List.mjs +1 -1
- package/common/ListContainer.js +1 -1
- package/common/ListContainer.mjs +1 -1
- package/common/ListDefaultItem.js +1 -1
- package/common/ListDefaultItem.mjs +1 -1
- package/common/ListFilter.js +1 -1
- package/common/ListFilter.mjs +1 -1
- package/common/ListGroupItem.js +1 -1
- package/common/ListGroupItem.mjs +1 -1
- package/common/ListItem.js +1 -1
- package/common/ListItem.mjs +1 -1
- package/common/Navigation.js +1 -1
- package/common/Navigation.mjs +1 -1
- package/common/SearchBar.js +2 -2
- package/common/SearchBar.mjs +13 -12
- package/common/VirtualScroll.js +1 -1
- package/common/VirtualScroll.mjs +1 -1
- package/common/constants.js +1 -1
- package/common/constants.mjs +1 -1
- package/common/settings.js +1 -1
- package/common/settings.mjs +1 -1
- package/common/utils.js +1 -1
- package/common/utils.mjs +1 -1
- package/dist/cdn/js/kendo-vue-dropdowns.js +2 -2
- package/index.d.mts +22 -1
- package/index.d.ts +22 -1
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/messages/main.js +1 -1
- package/messages/main.mjs +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +9 -9
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
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 l=require("vue"),a=require("@progress/kendo-vue-common"),me=require("../common/ListContainer.js"),ve=require("../common/List.js"),Ie=require("./TagList.js"),ye=require("../common/SearchBar.js"),be=require("../common/DropDownBase.js"),U=require("../common/GroupStickyHeader.js"),Se=require("../common/ClearButton.js"),w=require("../common/settings.js"),g=require("../common/utils.js"),Y=require("@progress/kendo-svg-icons"),E=require("@progress/kendo-vue-buttons"),H=require("../common/constants.js"),ke=require("@progress/kendo-vue-layout"),Ce=require("../common/ListFilter.js"),xe=require("@progress/kendo-vue-intl"),T=require("../messages/main.js"),{sizeMap:P,roundedMap:$e}=a.kendoThemeMaps;function B(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!l.isVNode(e)}const Fe="Please enter a valid value!",Ve=e=>e.preventDefault(),J=(e,t,s)=>!!e!=!!t||e.text!==t.text?!1:e===t||g.matchDataCollections(e.data,t.data,s),Q=e=>e===y.CustomItem;var y=function(e){return e[e.None=0]="None",e[e.ListItem=1]="ListItem",e[e.CustomItem=2]="CustomItem",e}(y||{});const Te=l.defineComponent({name:"KendoMultiSelect",emits:{changemodel:null,"update:modelValue":null,filterchange:null,change:null,pagechange:null,focus:null,blur:null,open:null,close:null,scroll:null},model:{event:"changemodel"},props:{autoClose:{type:Boolean,default:!0},removeTagIcon:String,allowCustom:Boolean,modelValue:Array,opened:{type:Boolean,default:void 0},disabled:Boolean,dir:String,tabIndex:{type:Number,default:0},accessKey:String,dataItems:Array,textField:String,label:String,loading:Boolean,name:String,value:Array,defaultValue:Array,valueField:String,valuePrimitive:Boolean,dataItemKey:String,placeholder:String,tags:Array,required:{type:Boolean,default:!1},valid:{type:Boolean,default:void 0},validate:{type:Boolean},validationMessage:{type:String,default:void 0},validityStyles:{type:Boolean,default:!0},tagRender:[String,Function,Object],id:String,popupSettings:{type:Object,default:function(){return{animate:!0,height:"200px",anchor:""}}},itemRender:[String,Function,Object],groupHeaderItemRender:[String,Function,Object],groupStickyHeaderItemRender:[String,Function,Object],listNoDataRender:[String,Function,Object],focusedItemIndex:Function,virtual:{type:Object,default:void 0},header:[String,Function,Object],footer:[String,Function,Object],filterable:Boolean,filter:{type:String,default:void 0},ariaLabel:{type:String,default:void 0},ariaLabelledBy:String,ariaDescribedBy:String,rounded:{type:String,default:"medium",validator:function(e){return["small","medium","large","full"].includes(e)}},tagsRounded:{type:String,default:"medium",validator:function(e){return["small","medium","large","full"].includes(e)}},fillMode:{type:String,default:"solid",validator:function(e){return["solid","flat","outline"].includes(e)}},size:{type:String,default:"medium",validator:function(e){return["small","medium","large"].includes(e)}},groupField:{type:String},adaptive:{type:Boolean,default:void 0},adaptiveTitle:{type:String,default:void 0}},setup(){const e=l.ref(null),t=l.ref(null),s=l.inject("kendoLocalizationService",{});return{inputRef:e,kendoAnchorRef:t,kendoLocalizationService:s}},computed:{spanClassNames(){const e=!this.hasMounted||!this.$props.validityStyles||this.validity().valid,t=this.currentText||g.getItemValue(this.computedValue()[0],this.$props.textField);return{"k-floating-label-container":!0,"k-focus":this.currentFocused,"k-empty":!(t&&t!==0),"k-invalid":!e&&e!==void 0,"k-rtl":this.$props.dir==="rtl"}},isOpen(){return this.$props.opened!==void 0?this.$props.opened:this.currentOpened},animationStyles(){return this.windowWidth<=H.MOBILE_SMALL_DEVICE?{top:0,width:"100%",height:"100%"}:void 0},classNameAdaptive(){return this.windowWidth<=H.MOBILE_SMALL_DEVICE?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"},adaptiveState(){return this.windowWidth<=H.MOBILE_MEDIUM_DEVICE&&this.$props.adaptive}},created(){this.observer=null,this.valuesItemsDuringOnChange=null,this._tags=[],this._skipFocusEvent=!1,this.scrollToFocused=!1,this.base=new be(this),this.anchor=a.guid(),this.inputId=a.guid()},inject:{kendoLocalizationService:{default:null}},data(){return{hasMounted:!1,currentText:"",currentValue:"",currentFocused:!1,currentOpened:!1,currentFocusedIndex:void 0,currentFocusedTag:void 0,searchState:{word:"",last:""},suggested:"",activedescendant:w.ActiveDescendant.PopupList,group:void 0,isScrolling:!1,itemHeight:0,windowWidth:0,popupWidth:void 0,initialAdaptiveRenderingValues:void 0}},watch:{currentOpened:function(e,t){this.prevCurrentOpened=t},opened:function(e,t){this.prevOpened=t},virtual:function(e,t){e&&t&&e.total!==t.total&&(this.virtualTotalHasChanged=!0)},isOpen:function(e){e?this.initialAdaptiveRenderingValues=this.base.component.currentValue:this.initialAdaptiveRenderingValues=void 0,setTimeout(()=>{const t=document.querySelector(".k-list-item");this.itemHeight=this.base.getListItemHeight(t)},100)}},updated(){var m;const{virtual:e,groupField:t="",dataItems:s=[]}=this.$props,i=e?e.skip:0,n=this.isOpen,r=this.prevOpened!==void 0?this.prevOpened:this.prevCurrentOpened,d=!r&&n,u=r&&!n,p=Object.assign({},{animate:!0,height:"200px"},this.$props.popupSettings),o=this.$refs.list,h=this.$refs.scrollElement;if(o&&(this.base.vs.list=o.list,this.base.list=o.list),h&&(this.base.vs.scrollElement=h),o&&s.length&&this.base.vs.scrollerRef(o.$el),!p.animate&&u&&this.onPopupClosed(),!this.isScrolling)if(e&&this.virtualTotalHasChanged)this.base.vs.calcScrollElementHeight(),this.base.vs.reset(),this.virtualTotalHasChanged=!1;else{let{focusedItem:v,focusedIndex:C}=this.getFocusedState();t!==""&&(C=(m=this.base.getGroupedDataModernMode(s,t))==null?void 0:m.indexOf(v)),d&&e?(this.base.scrollToVirtualItem(e,C-i),this.prevCurrentOpened=!0):d&&!e?(s&&s.length!==0&&this.base.resetGroupStickyHeader(s[0][t],this),this.base.scrollToItem(C),this.prevCurrentOpened=!0):n&&r&&v&&this.base.scrollToItem(C-i)}this.scrollToFocused=!1,this.searchBarRef(),this.setValidity()},mounted(){this.observer=a.canUseDOM&&window.ResizeObserver&&new ResizeObserver(this.calculateMedia),document!=null&&document.body&&this.observer&&this.observer.observe(document.body),this.hasMounted=!0,this.input=this.inputRef.input,this.base.wrapper=a.getRef(this,"kendoAnchor"),this.element=a.getRef(this,"kendoAnchor"),this.base.didMount(),this.searchBarRef(),this.setValidity()},methods:{clearFilter(e){this.currentText&&(e.data.currentText=""),this.base.filterChanged("",e)},computedValue(){const e=[];return this.valuesItemsDuringOnChange?e.push(...this.valuesItemsDuringOnChange):this.$props.value?e.push(...this.$props.value):this.$props.modelValue!==void 0?e.push(...this.$props.modelValue):this.currentValue?e.push(...this.currentValue):this.$props.defaultValue&&e.push(...this.$props.defaultValue),this.valuePrimitive&&this.findByFieldValue(this.valueField,e)||e},findByFieldValue(e,t){return t.map(i=>{const n=this.dataItems.findIndex(r=>g.getItemValue(r,e)===i);return this.dataItems[n]||i})},primitiveValue(){const e=this.computedValue(),t=e.map(s=>g.getItemValue(s,this.valueField));return this.valuePrimitive?t:e},validity(){const e=this.$props.validationMessage!==void 0,t=this.computedValue(),s=!this.$props.required||t!==null&&t.length>0&&t!==void 0,i=this.$props.valid!==void 0?this.$props.valid:s;return{customError:e,valid:i,valueMissing:t===null}},handleItemSelect(e,t){const{dataItems:s=[],dataItemKey:i,virtual:n}=this.$props,r=this.computedValue(),d=n?n.skip:0,u=s[e-d],p=r.findIndex(m=>g.areSame(m,u,i));let o=[];p!==-1?(o=r,o.splice(p,1)):o=[...r,u],(this.$props.filter!==void 0?this.$props.filter:this.currentText)&&!this.adaptiveState&&this.clearFilter(t),this.currentFocusedIndex!==void 0&&(t.data.currentFocusedIndex=void 0),this.triggerOnChange(o,t),this.base.triggerPageChangeCornerItems(u,t)},onTagDelete(e,t){const s=this.isOpen,i=this.base.initState();i.event=t,s&&this.base.togglePopup(i),this.currentFocused||(i.data.currentFocused=!0);const n=this.computedValue();g.removeDataItems(n,e,this.$props.dataItemKey),this.triggerOnChange(n,i),this.applyState(i)},onNavigate(e,t){const{allowCustom:s,dataItems:i=[]}=this.$props,n=this.isOpen,r=this.$props.filter!==void 0?this.$props.filter:this.currentText,{focusedType:d,focusedIndex:u}=this.getFocusedState(),p=s&&r,o=Q(d),h=this.base,m=h.vs;if(n&&t===a.Keys.up&&o)this.currentFocusedIndex!==void 0&&(e.data.currentFocusedIndex=void 0);else{const v=h.navigation.navigate({keyCode:t,current:u,max:(m.enabled?m.total:i.length)-1,min:p?-1:0});v!==void 0&&(this.itemFocus(v,e),this.scrollToFocused=!0)}this.applyState(e)},itemFocus(e,t){const{dataItems:s=[],allowCustom:i,virtual:n}=this.$props,r=n?n.skip:0,d=this.$props.filter!==void 0?this.$props.filter:this.currentText,{focusedIndex:u}=this.getFocusedState(),p=i&&d,o=s[e-r];o&&u!==e?this.currentFocusedIndex!==e&&(t.data.currentFocusedIndex=e,t.data.activedescendant=w.ActiveDescendant.PopupList):p&&e===-1&&this.currentFocusedIndex!==void 0&&(t.data.currentFocusedIndex=void 0),this.base.triggerPageChangeCornerItems(o,t)},searchBarRef(){this.input&&this.currentFocused&&setTimeout(()=>this.input.focus(),0)},onChangeHandler(e){const t=this.base.initState(),s=e&&(e.currentTarget&&e.currentTarget.value||e.value),i=this.isOpen;t.event=e,this.$props.filter===void 0&&(t.data.currentText=s),t.data.currentFocusedIndex=void 0,i||this.base.togglePopup(t),this.base.filterChanged(s,t),this.$props.filterable&&(t.data.group=void 0),this.applyState(t)},clearButtonClick(e){const t=this.isOpen,s=this.base.initState();s.event=e,e.stopPropagation(),this.computedValue().length>0&&this.triggerOnChange([],s),this.currentFocusedIndex!==void 0&&(s.data.currentFocusedIndex=void 0),t&&this.base.togglePopup(s);const i=this.$props.filter!==void 0?this.$props.filter:this.currentText;g.isPresent(i)&&i!==""&&this.base.filterChanged("",s),this.currentText&&(s.data.currentText=""),this.applyState(s)},onInputKeyDown(e){this.isScrolling&&(this.isScrolling=!1);const t=e.keyCode,s=this.$props.filter!==void 0?this.$props.filter:this.currentText,i=this.isOpen,{focusedItem:n}=this.getFocusedState(),r=this.base.initState();if(r.event=e,!s&&this.computedValue().length>0&&(t===a.Keys.left||t===a.Keys.right||t===a.Keys.home||t===a.Keys.end||t===a.Keys.delete||t===a.Keys.backspace))return this.onTagsNavigate(e,r);const d=()=>{e.preventDefault(),this.base.togglePopup(r),this.applyState(r)};i?e.altKey&&t===a.Keys.up?d():t===a.Keys.up||t===a.Keys.down?(e.preventDefault(),this.onNavigate(r,t)):t===a.Keys.enter?(e.preventDefault(),this.$props.allowCustom&&s&&n===null?this.customItemSelect(e):this.selectFocusedItem(e)):t===a.Keys.esc&&(this.adaptiveState&&this.handleWrapperClick(e),d()):e.altKey&&t===a.Keys.down&&d()},onTagsNavigate(e,t){const s=e.keyCode,i=this.currentFocusedTag,n=this._tags,r=this.$props.dataItemKey;let d=i?n.findIndex(o=>J(o,i,r)):-1,u;const p=d!==-1;if(s===a.Keys.left)p?d=Math.max(0,d-1):d=n.length-1,u=n[d];else if(s===a.Keys.right)d===n.length-1?u=void 0:p&&(d=Math.min(n.length-1,d+1),u=n[d]);else if(s===a.Keys.home)u=n[0];else if(s===a.Keys.end)u=n[n.length-1];else if(s===a.Keys.delete){if(p){const o=this.computedValue();g.removeDataItems(o,n[d].data,r),this.triggerOnChange(o,t)}}else if(s===a.Keys.backspace){const o=this.computedValue();if(p)g.removeDataItems(o,n[d].data,r),this.triggerOnChange(o,t);else if(!p&&n.length){const h=n.pop();g.removeDataItems(o,h.data,r),this.triggerOnChange(o,t)}}u!==i&&(t.data.currentFocusedTag=u,t.data.activedescendant=w.ActiveDescendant.TagsList),this.applyState(t)},triggerOnChange(e,t){this.$props.value===void 0&&(t.data.currentValue=[...e]),this.valuesItemsDuringOnChange=[],this.setItems(e,this.valuesItemsDuringOnChange),t.events.push({type:"change"})},selectFocusedItem(e){const{dataItems:t=[],virtual:s}=this.$props,{focusedIndex:i}=this.getFocusedState(),n=s?s.skip:0;t[i-n]!==void 0&&this.handleItemClick(i,e)},setItems(e,t){t.length=0,t.push(...e)},getFocusedState(){const e=this.currentFocusedIndex,t=this.$props.filter!==void 0?this.$props.filter:this.currentText,{allowCustom:s,dataItems:i=[],dataItemKey:n,virtual:r,textField:d,focusedItemIndex:u=g.itemIndexStartsWith}=this.$props,p=r&&r.skip||0;let o;if(e!==void 0)return{focusedIndex:e,focusedItem:i[e-p],focusedType:y.ListItem};const h=this.computedValue();if(s&&t)return{focusedItem:null,focusedIndex:-1,focusedType:y.CustomItem};if(t)return o=u(i,t,d),{focusedItem:i[o],focusedIndex:o+p,focusedType:y.ListItem};if(h.length){const m=h[h.length-1];return o=i.findIndex(v=>g.areSame(v,m,n)),i[o]!==void 0?{focusedIndex:o+p,focusedItem:i[o],focusedType:y.ListItem}:{focusedType:y.None,focusedIndex:-1}}return p===0?{focusedItem:i[0],focusedIndex:0,focusedType:y.ListItem}:{focusedType:y.None,focusedIndex:-1}},customItemSelect(e){const t=this.$props.filter!==void 0?this.$props.filter:this.currentText,{textField:s}=this.$props;if(!t)return;const i=this.base.initState();i.event=e;const n=s?{[s]:t}:t;this.currentText!==void 0&&(i.data.currentText=""),i.data.currentFocusedIndex=void 0,this.base.filterChanged("",i);const r=[...this.computedValue(),n];this.triggerOnChange(r,i),this.base.togglePopup(i),this.applyState(i)},handleWrapperClick(e){const t=this.isOpen,s=this.input;!t&&s&&this.focusElement(s);const i=this.base.initState();i.event=e,this.currentFocused||(i.events.push({type:"focus"}),i.data.currentFocused=!0),this.clearFilter(i),this.base.togglePopup(i),this.applyState(i)},onCancel(e){const t=this.base.initState();t.event=e,e.stopPropagation();const s=this.isOpen;t.focusedIndex!==void 0&&(t.data.focusedIndex=void 0),s&&this.base.togglePopup(t),t.events.push({type:"onCancel"}),this.clearFilter(t),this.triggerOnChange([...this.initialAdaptiveRenderingValues],t),this.base.triggerPageChangeCornerItems([...this.initialAdaptiveRenderingValues],t),this.applyState(t)},handleItemClick(e,t){const s=this.base.initState();s.event=t,this.handleItemSelect(e,s),this.$props.autoClose&&!this.adaptiveState&&this.base.togglePopup(s),this.applyState(s)},handleBlur(e){if(!this.currentFocused||this._skipFocusEvent)return;const t=this.isOpen,s=this.base.initState(),{allowCustom:i,filterable:n}=this.$props;s.event=e,s.data.currentFocused=!1,s.events.push({type:"blur"}),t&&!this.adaptiveState&&(this.currentOpened&&(s.data.currentOpened=!1),s.events.push({type:"close"})),!i&&!n&&this.currentText&&(s.data.currentText=""),this.applyState(s)},handleFocus(e){this._skipFocusEvent||this.base.handleFocus(e)},onPopupOpened(){this.input&&this.currentFocused&&this.focusElement(this.input)},onPopupClosed(){this.currentFocused&&setTimeout(()=>{this.currentFocused&&this.focusElement(this.input)},0)},focusElement(e){this._skipFocusEvent=!0,e.focus(),setTimeout(()=>this._skipFocusEvent=!1,30)},applyState(e){this.base.applyState(e),this.valuesItemsDuringOnChange=null},setValidity(){this.input&&this.input.setCustomValidity&&this.input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||Fe)},focus(){this.input&&this.input.focus()},calculateMedia(e){for(let t of e)this.windowWidth=t.target.clientWidth},repositionPopup(){this.base.repositionPopup()},onScroll(e){this.isScrolling=!0;const{vs:t,list:s}=this.base;t.scrollHandler(e);const i=this.base.initState(),{groupField:n}=this.$props;let{dataItems:r=[]}=this.$props,d;if(!n||!r.length)return;const u=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*u;n&&(r=this.base.getGroupedDataModernMode(r,n),r=this.base.getGroupedDataModernMode(r,n),d=r[0][n]);for(let h=1;h<r.length&&!(u*h>o);h++)r[h]&&r[h][n]&&(d=r[h][n]);d!==this.group&&(i.data.group=d,this.applyState(i))}},render(){const{style:e,label:t,dir:s,disabled:i,tags:n,textField:r,dataItemKey:d,virtual:u,loading:p,size:o,fillMode:h,rounded:m,tagsRounded:v,removeTagIcon:C,adaptiveTitle:X,header:M,footer:q,groupStickyHeaderItemRender:Z,dataItems:x=[]}=this.$props,ee=this.currentFocused,N=Object.assign({},{animate:!0,height:"200px"},this.$props.popupSettings),R=this.currentFocusedTag,_=this.computedValue(),D=(this.$props.filter!==void 0?this.$props.filter:this.currentText)||"",te=!p&&(!!D||_.length>0),b=this.base.vs,A=this.$props.id||this.inputId,se=a.templateRendering.call(this,this.$props.tagRender,a.getListeners.call(this)),L=this.isOpen,$=this.adaptiveState,j=xe.provideLocalizationService(this);this.group===void 0&&this.$props.groupField!==void 0&&(this.group=g.getItemValue(this.$props.dataItems[0],this.$props.groupField)),b.enabled=u!==void 0,u!==void 0&&(b.skip=u.skip,b.total=u.total,b.pageSize=u.pageSize);let I=[];this.initialAdaptiveRenderingValues?[...this.initialAdaptiveRenderingValues].forEach(f=>{I.push({text:g.getItemValue(f,r),data:[f]})}):n===void 0?this.computedValue().forEach(c=>{I.push({text:g.getItemValue(c,r),data:[c]})}):I.push(...n),I.length>0&&this.setItems(I,this._tags);const ie=!this.$props.validityStyles||this.validity().valid,ne=function(c){const f=this.activedescendant,{placeholder:S}=this.$props,{focusedIndex:F}=this.getFocusedState(),k=I.length===0||_.length===0&&!D?S:void 0,V=f===w.ActiveDescendant.TagsList&&R!==void 0?`tag-${this.base.guid}-${R.text.replace(/\s+/g,"-")}`:`option-${this.base.guid}-${F}`;return l.createVNode(ye.SearchBar,{id:c,size:Math.max((k||"").length,D.length,1),tabIndex:this.$props.tabIndex,accessKey:this.$props.accessKey,placeholder:k,value:$?"":D,onChange:this.onChangeHandler,onBlur:this.handleBlur,onKeydown:this.onInputKeyDown,ref:O=>{this.inputRef=O},disabled:i,expanded:L,owns:this.base.listBoxId,activedescendant:V,"aria-describedBy":`tagslist-${this.base.guid}${this.$props.ariaDescribedBy?" "+this.$props.ariaDescribedBy:""}`,"aria-labelledBy":this.$props.ariaLabelledBy,"aria-label":this.$props.ariaLabel},null)},z=function(){let c;const{groupField:f}=this.$props,S=a.templateRendering.call(this,this.$props.itemRender,a.getListeners.call(this)),F=a.templateRendering.call(this,this.$props.groupHeaderItemRender,a.getListeners.call(this)),k=a.templateRendering.call(this,this.$props.listNoDataRender,a.getListeners.call(this)),V=u?u.skip:0,{focusedIndex:O}=this.getFocusedState(),K=`translateY(${b.translate}px)`;let G=x;return f&&(G=this.base.getGroupedDataModernMode(x,f)),l.createVNode(ve.List,{id:this.base.listBoxId,show:L,dataItems:G.slice(),focusedIndex:O,value:this.computedValue(),textField:r,valueField:d,optionsGuid:this.base.guid,ref:"list",wrapperStyle:{maxHeight:$?void 0:N.height},wrapperCssClass:"k-list-content",listStyle:b.enabled?{transform:K}:void 0,key:"listKey",skip:V,onListclick:this.handleItemClick,itemRender:S,groupHeaderItemRender:F,noDataRender:k,groupField:f,onScroll:this.onScroll},B(c=ae.call(this))?c:{default:()=>[c]})},ae=function(){return b.enabled&&l.createVNode("div",{ref:"scrollElement",key:"scrollElementKey"},null)},oe=function(){const c=this.base,{allowCustom:f}=this.$props,S=a.templateRendering.call(this,this.$props.groupStickyHeaderItemRender,a.getListeners.call(this)),F=c.getTemplateDef.call(this,M),k=c.getTemplateDef.call(this,q),V=this.$props.filter!==void 0?this.$props.filter:this.currentText,{focusedType:O}=this.getFocusedState(),K=f&&V&&l.createVNode("div",{class:"k-list",key:"customitem",onClick:this.customItemSelect},[l.createVNode("div",{class:a.classNames("k-item k-custom-item",{"k-focus":Q(O)})},[V,l.createVNode(a.Icon,{name:"plus",icon:Y.plusIcon,style:{float:"right"}},null)])]);return this.group===void 0&&this.$props.groupField!==void 0&&(this.group=g.getItemValue(x[0],this.$props.groupField)),l.createVNode(me.ListContainer,{ref:"container",onMousedown:Ve,dir:s!==void 0?s:c.dirCalculated,onBlur:this.handleBlur,width:this.popupWidth,popupSettings:{...N,anchor:this.anchor,show:L,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,popupClass:a.classNames(N.popupClass,"k-list",{[`k-list-${P[o]||o}`]:o,"k-virtual-list":this.base.vs.enabled}),className:a.classNames("k-list-container",N.className)},itemsCount:x.length},{default:()=>[F&&l.createVNode("div",{class:"k-list-header"},[F]),K,this.group&&x.length!==0&&l.createVNode(U.GroupStickyHeader,{group:this.group,render:S},null),z.call(this),k&&l.createVNode("div",{class:"k-list-footer"},[k]),u&&M]})},re=function(){const c=this.$props.filter!==void 0?this.$props.filter:this.currentText;return this.$props.filterable&&l.createVNode(Ce.ListFilter,{value:c,ref:"filterInput",onChange:this.onChangeHandler,onKeydown:this.onInputKeyDown,size:o,rounded:m,fillMode:h},null)},le=()=>[l.createVNode("div",{class:"k-actionsheet-titlebar-group k-hbox"},[l.createVNode("div",{class:"k-actionsheet-title"},[l.createVNode("div",{class:"k-text-center"},[X]),l.createVNode("div",{class:"k-actionsheet-subtitle k-text-center"},null)]),l.createVNode("div",{class:"k-actionsheet-actions"},[l.createVNode(E.Button,{tabIndex:5,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.onCancel,icon:"x",svgIcon:Y.xIcon},null)])]),l.createVNode("div",{class:"k-actionsheet-titlebar-group k-actionsheet-filter"},[re.call(this)])],de=a.templateRendering.call(this,le,a.getListeners.call(this)),ue=()=>{const c=j.toLanguageString(T.adaptiveModeFooterCancel,T.messages[T.adaptiveModeFooterCancel]),f=j.toLanguageString(T.adaptiveModeFooterApply,T.messages[T.adaptiveModeFooterApply]);return[l.createVNode(E.Button,{size:"large","aria-label":c,"aria-disabled":"false",type:"button",onClick:this.onCancel},B(c)?c:{default:()=>[c]}),l.createVNode(E.Button,{themeColor:"primary",size:"large","aria-label":f,"aria-disabled":"false",type:"button",onClick:this.handleWrapperClick},B(f)?f:{default:()=>[f]})]},ce=a.templateRendering.call(this,ue,a.getListeners.call(this)),pe=()=>{const c=this.base.getTemplateDef.call(this,M,l.h),f=this.base.getTemplateDef.call(this,q,l.h),S=a.templateRendering.call(this,Z,a.getListeners.call(this));return l.createVNode("div",{class:"k-list-container"},[c&&l.createVNode("div",{class:"k-list-header"},[c]),l.createVNode("div",{class:a.classNames("k-list",{[`k-list-${P[o]||o}`]:$?!1:o,"k-list-lg":!!$,"k-virtual-list":b.enabled})},[this.group&&x.length!==0&&l.createVNode(U.GroupStickyHeader,{group:this.group,render:S},null),z.call(this),f&&l.createVNode("div",{class:"k-list-footer"},[f])])])},he=a.templateRendering.call(this,pe,a.getListeners.call(this)),fe=function(){return l.createVNode(ke.ActionSheet,{expand:L,animation:!0,animationStyles:this.animationStyles,className:this.classNameAdaptive,contentClassName:"!k-overflow-hidden",footerClassName:"k-actions k-actions-stretched",header:de,content:he,footer:ce,onClose:this.onCancel,navigatableElements:["input.k-input-inner",".k-actionsheet-actions > button"]},null)},ge=function(){let c;return l.createVNode("span",{ref:a.setRef(this,"kendoAnchor"),class:a.classNames("k-multiselect","k-input",{[`k-input-${P[o]||o}`]:o,[`k-rounded-${$e[m]||m}`]:m,[`k-input-${h}`]:h,"k-focus":ee&&!i,"k-disabled":i,"k-invalid":!ie,"k-loading":p,"k-required":this.required}),style:t?{...e,width:void 0}:e,dir:s,onFocusin:this.handleFocus,onClick:this.handleWrapperClick,onMousedown:g.preventDefaultNonInputs},[l.createVNode(Ie.TagList,{removeTagIcon:C,tagsRounded:v,size:o,fillMode:h,tagRender:se,onTagdelete:this.onTagDelete,dataItems:I,guid:this.base.guid,focused:R?I.find(f=>J(f,R,d)):void 0},B(c=ne.call(this,A))?c:{default:()=>[c]}),I.length>0&&te&&l.createVNode(Se.ClearButton,{onClearclick:this.clearButtonClick},null),l.createVNode("span",{class:p?"k-input-loading-icon k-icon k-i-loading":void 0},null),!$&&oe.call(this)])},W=[l.h(ge.call(this),{...this.$attrs}),$&&fe.call(this)];return t?l.createVNode("span",{class:this.spanClassNames,dir:this.$props.dir},[W,this.$props.label?A?l.createVNode("label",{for:A,class:"k-floating-label"},[this.$props.label]):l.createVNode("span",{class:"k-label"},[this.$props.label]):null]):W}});exports.MultiSelect=Te;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue"),a=require("@progress/kendo-vue-common"),ve=require("../common/ListContainer.js"),Ie=require("../common/List.js"),be=require("./TagList.js"),ye=require("../common/SearchBar.js"),Se=require("../common/DropDownBase.js"),U=require("../common/GroupStickyHeader.js"),ke=require("../common/ClearButton.js"),w=require("../common/settings.js"),g=require("../common/utils.js"),Y=require("@progress/kendo-svg-icons"),E=require("@progress/kendo-vue-buttons"),H=require("../common/constants.js"),Ce=require("@progress/kendo-vue-layout"),xe=require("../common/ListFilter.js"),$e=require("@progress/kendo-vue-intl"),T=require("../messages/main.js"),{sizeMap:P,roundedMap:Fe}=a.kendoThemeMaps;function B(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!l.isVNode(e)}const Ve="Please enter a valid value!",Te=e=>e.preventDefault(),J=(e,t,s)=>!!e!=!!t||e.text!==t.text?!1:e===t||g.matchDataCollections(e.data,t.data,s),Q=e=>e===b.CustomItem;var b=function(e){return e[e.None=0]="None",e[e.ListItem=1]="ListItem",e[e.CustomItem=2]="CustomItem",e}(b||{});const Oe=l.defineComponent({name:"KendoMultiSelect",emits:{changemodel:null,"update:modelValue":null,filterchange:null,change:null,pagechange:null,focus:null,blur:null,open:null,close:null,scroll:null},model:{event:"changemodel"},props:{autoClose:{type:Boolean,default:!0},removeTagIcon:String,allowCustom:Boolean,modelValue:Array,opened:{type:Boolean,default:void 0},disabled:Boolean,dir:String,tabIndex:{type:Number,default:0},accessKey:String,dataItems:Array,textField:String,label:String,loading:Boolean,name:String,value:Array,defaultValue:Array,valueField:String,valuePrimitive:Boolean,dataItemKey:String,placeholder:String,tags:Array,required:{type:Boolean,default:!1},valid:{type:Boolean,default:void 0},validate:{type:Boolean},validationMessage:{type:String,default:void 0},validityStyles:{type:Boolean,default:!0},tagRender:[String,Function,Object],id:String,popupSettings:{type:Object,default:function(){return{animate:!0,height:"200px",anchor:""}}},itemRender:[String,Function,Object],groupHeaderItemRender:[String,Function,Object],groupStickyHeaderItemRender:[String,Function,Object],listNoDataRender:[String,Function,Object],focusedItemIndex:Function,virtual:{type:Object,default:void 0},header:[String,Function,Object],footer:[String,Function,Object],filterable:Boolean,filter:{type:String,default:void 0},ariaLabel:{type:String,default:void 0},ariaLabelledBy:String,ariaDescribedBy:String,rounded:{type:String,default:"medium",validator:function(e){return["small","medium","large","full"].includes(e)}},tagsRounded:{type:String,default:"medium",validator:function(e){return["small","medium","large","full"].includes(e)}},fillMode:{type:String,default:"solid",validator:function(e){return["solid","flat","outline"].includes(e)}},size:{type:String,default:"medium",validator:function(e){return["small","medium","large"].includes(e)}},groupField:{type:String},adaptive:{type:Boolean,default:void 0},adaptiveTitle:{type:String,default:void 0},inputAttributes:Object},setup(){const e=l.ref(null),t=l.ref(null),s=l.inject("kendoLocalizationService",{});return{inputRef:e,kendoAnchorRef:t,kendoLocalizationService:s}},computed:{spanClassNames(){const e=!this.hasMounted||!this.$props.validityStyles||this.validity().valid,t=this.currentText||g.getItemValue(this.computedValue()[0],this.$props.textField);return{"k-floating-label-container":!0,"k-focus":this.currentFocused,"k-empty":!(t&&t!==0),"k-invalid":!e&&e!==void 0,"k-rtl":this.$props.dir==="rtl"}},isOpen(){return this.$props.opened!==void 0?this.$props.opened:this.currentOpened},animationStyles(){return this.windowWidth<=H.MOBILE_SMALL_DEVICE?{top:0,width:"100%",height:"100%"}:void 0},classNameAdaptive(){return this.windowWidth<=H.MOBILE_SMALL_DEVICE?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"},adaptiveState(){return this.windowWidth<=H.MOBILE_MEDIUM_DEVICE&&this.$props.adaptive}},created(){this.observer=null,this.valuesItemsDuringOnChange=null,this._tags=[],this._skipFocusEvent=!1,this.scrollToFocused=!1,this.base=new Se(this),this.anchor=a.guid(),this.inputId=a.guid()},inject:{kendoLocalizationService:{default:null}},data(){return{hasMounted:!1,currentText:"",currentValue:"",currentFocused:!1,currentOpened:!1,currentFocusedIndex:void 0,currentFocusedTag:void 0,searchState:{word:"",last:""},suggested:"",activedescendant:w.ActiveDescendant.PopupList,group:void 0,isScrolling:!1,itemHeight:0,windowWidth:0,popupWidth:void 0,initialAdaptiveRenderingValues:void 0}},watch:{currentOpened:function(e,t){this.prevCurrentOpened=t},opened:function(e,t){this.prevOpened=t},virtual:function(e,t){e&&t&&e.total!==t.total&&(this.virtualTotalHasChanged=!0)},isOpen:function(e){e?this.initialAdaptiveRenderingValues=this.base.component.currentValue:this.initialAdaptiveRenderingValues=void 0,setTimeout(()=>{const t=document.querySelector(".k-list-item");this.itemHeight=this.base.getListItemHeight(t)},100)}},updated(){var m;const{virtual:e,groupField:t="",dataItems:s=[]}=this.$props,i=e?e.skip:0,n=this.isOpen,r=this.prevOpened!==void 0?this.prevOpened:this.prevCurrentOpened,d=!r&&n,u=r&&!n,p=Object.assign({},{animate:!0,height:"200px"},this.$props.popupSettings),o=this.$refs.list,h=this.$refs.scrollElement;if(o&&(this.base.vs.list=o.list,this.base.list=o.list),h&&(this.base.vs.scrollElement=h),o&&s.length&&this.base.vs.scrollerRef(o.$el),!p.animate&&u&&this.onPopupClosed(),!this.isScrolling)if(e&&this.virtualTotalHasChanged)this.base.vs.calcScrollElementHeight(),this.base.vs.reset(),this.virtualTotalHasChanged=!1;else{let{focusedItem:v,focusedIndex:C}=this.getFocusedState();t!==""&&(C=(m=this.base.getGroupedDataModernMode(s,t))==null?void 0:m.indexOf(v)),d&&e?(this.base.scrollToVirtualItem(e,C-i),this.prevCurrentOpened=!0):d&&!e?(s&&s.length!==0&&this.base.resetGroupStickyHeader(s[0][t],this),this.base.scrollToItem(C),this.prevCurrentOpened=!0):n&&r&&v&&this.base.scrollToItem(C-i)}this.scrollToFocused=!1,this.searchBarRef(),this.setValidity()},mounted(){this.observer=a.canUseDOM&&window.ResizeObserver&&new ResizeObserver(this.calculateMedia),document!=null&&document.body&&this.observer&&this.observer.observe(document.body),this.hasMounted=!0,this.input=this.inputRef.input,this.base.wrapper=a.getRef(this,"kendoAnchor"),this.element=a.getRef(this,"kendoAnchor"),this.base.didMount(),this.searchBarRef(),this.setValidity()},methods:{clearFilter(e){this.currentText&&(e.data.currentText=""),this.base.filterChanged("",e)},computedValue(){const e=[];return this.valuesItemsDuringOnChange?e.push(...this.valuesItemsDuringOnChange):this.$props.value?e.push(...this.$props.value):this.$props.modelValue!==void 0?e.push(...this.$props.modelValue):this.currentValue?e.push(...this.currentValue):this.$props.defaultValue&&e.push(...this.$props.defaultValue),this.valuePrimitive&&this.findByFieldValue(this.valueField,e)||e},findByFieldValue(e,t){return t.map(i=>{const n=this.dataItems.findIndex(r=>g.getItemValue(r,e)===i);return this.dataItems[n]||i})},primitiveValue(){const e=this.computedValue(),t=e.map(s=>g.getItemValue(s,this.valueField));return this.valuePrimitive?t:e},validity(){const e=this.$props.validationMessage!==void 0,t=this.computedValue(),s=!this.$props.required||t!==null&&t.length>0&&t!==void 0,i=this.$props.valid!==void 0?this.$props.valid:s;return{customError:e,valid:i,valueMissing:t===null}},handleItemSelect(e,t){const{dataItems:s=[],dataItemKey:i,virtual:n}=this.$props,r=this.computedValue(),d=n?n.skip:0,u=s[e-d],p=r.findIndex(m=>g.areSame(m,u,i));let o=[];p!==-1?(o=r,o.splice(p,1)):o=[...r,u],(this.$props.filter!==void 0?this.$props.filter:this.currentText)&&!this.adaptiveState&&this.clearFilter(t),this.currentFocusedIndex!==void 0&&(t.data.currentFocusedIndex=void 0),this.triggerOnChange(o,t),this.base.triggerPageChangeCornerItems(u,t)},onTagDelete(e,t){const s=this.isOpen,i=this.base.initState();i.event=t,s&&this.base.togglePopup(i),this.currentFocused||(i.data.currentFocused=!0);const n=this.computedValue();g.removeDataItems(n,e,this.$props.dataItemKey),this.triggerOnChange(n,i),this.applyState(i)},onNavigate(e,t){const{allowCustom:s,dataItems:i=[]}=this.$props,n=this.isOpen,r=this.$props.filter!==void 0?this.$props.filter:this.currentText,{focusedType:d,focusedIndex:u}=this.getFocusedState(),p=s&&r,o=Q(d),h=this.base,m=h.vs;if(n&&t===a.Keys.up&&o)this.currentFocusedIndex!==void 0&&(e.data.currentFocusedIndex=void 0);else{const v=h.navigation.navigate({keyCode:t,current:u,max:(m.enabled?m.total:i.length)-1,min:p?-1:0});v!==void 0&&(this.itemFocus(v,e),this.scrollToFocused=!0)}this.applyState(e)},itemFocus(e,t){const{dataItems:s=[],allowCustom:i,virtual:n}=this.$props,r=n?n.skip:0,d=this.$props.filter!==void 0?this.$props.filter:this.currentText,{focusedIndex:u}=this.getFocusedState(),p=i&&d,o=s[e-r];o&&u!==e?this.currentFocusedIndex!==e&&(t.data.currentFocusedIndex=e,t.data.activedescendant=w.ActiveDescendant.PopupList):p&&e===-1&&this.currentFocusedIndex!==void 0&&(t.data.currentFocusedIndex=void 0),this.base.triggerPageChangeCornerItems(o,t)},searchBarRef(){this.input&&this.currentFocused&&setTimeout(()=>this.input.focus(),0)},onChangeHandler(e){const t=this.base.initState(),s=e&&(e.currentTarget&&e.currentTarget.value||e.value),i=this.isOpen;t.event=e,this.$props.filter===void 0&&(t.data.currentText=s),t.data.currentFocusedIndex=void 0,i||this.base.togglePopup(t),this.base.filterChanged(s,t),this.$props.filterable&&(t.data.group=void 0),this.applyState(t)},clearButtonClick(e){const t=this.isOpen,s=this.base.initState();s.event=e,e.stopPropagation(),this.computedValue().length>0&&this.triggerOnChange([],s),this.currentFocusedIndex!==void 0&&(s.data.currentFocusedIndex=void 0),t&&this.base.togglePopup(s);const i=this.$props.filter!==void 0?this.$props.filter:this.currentText;g.isPresent(i)&&i!==""&&this.base.filterChanged("",s),this.currentText&&(s.data.currentText=""),this.applyState(s)},onInputKeyDown(e){this.isScrolling&&(this.isScrolling=!1);const t=e.keyCode,s=this.$props.filter!==void 0?this.$props.filter:this.currentText,i=this.isOpen,{focusedItem:n}=this.getFocusedState(),r=this.base.initState();if(r.event=e,!s&&this.computedValue().length>0&&(t===a.Keys.left||t===a.Keys.right||t===a.Keys.home||t===a.Keys.end||t===a.Keys.delete||t===a.Keys.backspace))return this.onTagsNavigate(e,r);const d=()=>{e.preventDefault(),this.base.togglePopup(r),this.applyState(r)};i?e.altKey&&t===a.Keys.up?d():t===a.Keys.up||t===a.Keys.down?(e.preventDefault(),this.onNavigate(r,t)):t===a.Keys.enter?(e.preventDefault(),this.$props.allowCustom&&s&&n===null?this.customItemSelect(e):this.selectFocusedItem(e)):t===a.Keys.esc&&(this.adaptiveState&&this.handleWrapperClick(e),d()):e.altKey&&t===a.Keys.down&&d()},onTagsNavigate(e,t){const s=e.keyCode,i=this.currentFocusedTag,n=this._tags,r=this.$props.dataItemKey;let d=i?n.findIndex(o=>J(o,i,r)):-1,u;const p=d!==-1;if(s===a.Keys.left)p?d=Math.max(0,d-1):d=n.length-1,u=n[d];else if(s===a.Keys.right)d===n.length-1?u=void 0:p&&(d=Math.min(n.length-1,d+1),u=n[d]);else if(s===a.Keys.home)u=n[0];else if(s===a.Keys.end)u=n[n.length-1];else if(s===a.Keys.delete){if(p){const o=this.computedValue();g.removeDataItems(o,n[d].data,r),this.triggerOnChange(o,t)}}else if(s===a.Keys.backspace){const o=this.computedValue();if(p)g.removeDataItems(o,n[d].data,r),this.triggerOnChange(o,t);else if(!p&&n.length){const h=n.pop();g.removeDataItems(o,h.data,r),this.triggerOnChange(o,t)}}u!==i&&(t.data.currentFocusedTag=u,t.data.activedescendant=w.ActiveDescendant.TagsList),this.applyState(t)},triggerOnChange(e,t){this.$props.value===void 0&&(t.data.currentValue=[...e]),this.valuesItemsDuringOnChange=[],this.setItems(e,this.valuesItemsDuringOnChange),t.events.push({type:"change"})},selectFocusedItem(e){const{dataItems:t=[],virtual:s}=this.$props,{focusedIndex:i}=this.getFocusedState(),n=s?s.skip:0;t[i-n]!==void 0&&this.handleItemClick(i,e)},setItems(e,t){t.length=0,t.push(...e)},getFocusedState(){const e=this.currentFocusedIndex,t=this.$props.filter!==void 0?this.$props.filter:this.currentText,{allowCustom:s,dataItems:i=[],dataItemKey:n,virtual:r,textField:d,focusedItemIndex:u=g.itemIndexStartsWith}=this.$props,p=r&&r.skip||0;let o;if(e!==void 0)return{focusedIndex:e,focusedItem:i[e-p],focusedType:b.ListItem};const h=this.computedValue();if(s&&t)return{focusedItem:null,focusedIndex:-1,focusedType:b.CustomItem};if(t)return o=u(i,t,d),{focusedItem:i[o],focusedIndex:o+p,focusedType:b.ListItem};if(h.length){const m=h[h.length-1];return o=i.findIndex(v=>g.areSame(v,m,n)),i[o]!==void 0?{focusedIndex:o+p,focusedItem:i[o],focusedType:b.ListItem}:{focusedType:b.None,focusedIndex:-1}}return p===0?{focusedItem:i[0],focusedIndex:0,focusedType:b.ListItem}:{focusedType:b.None,focusedIndex:-1}},customItemSelect(e){const t=this.$props.filter!==void 0?this.$props.filter:this.currentText,{textField:s}=this.$props;if(!t)return;const i=this.base.initState();i.event=e;const n=s?{[s]:t}:t;this.currentText!==void 0&&(i.data.currentText=""),i.data.currentFocusedIndex=void 0,this.base.filterChanged("",i);const r=[...this.computedValue(),n];this.triggerOnChange(r,i),this.base.togglePopup(i),this.applyState(i)},handleWrapperClick(e){const t=this.isOpen,s=this.input;!t&&s&&this.focusElement(s);const i=this.base.initState();i.event=e,this.currentFocused||(i.events.push({type:"focus"}),i.data.currentFocused=!0),this.clearFilter(i),this.base.togglePopup(i),this.applyState(i)},onCancel(e){const t=this.base.initState();t.event=e,e.stopPropagation();const s=this.isOpen;t.focusedIndex!==void 0&&(t.data.focusedIndex=void 0),s&&this.base.togglePopup(t),t.events.push({type:"onCancel"}),this.clearFilter(t),this.triggerOnChange([...this.initialAdaptiveRenderingValues],t),this.base.triggerPageChangeCornerItems([...this.initialAdaptiveRenderingValues],t),this.applyState(t)},handleItemClick(e,t){const s=this.base.initState();s.event=t,this.handleItemSelect(e,s),this.$props.autoClose&&!this.adaptiveState&&this.base.togglePopup(s),this.applyState(s)},handleBlur(e){if(!this.currentFocused||this._skipFocusEvent)return;const t=this.isOpen,s=this.base.initState(),{allowCustom:i,filterable:n}=this.$props;s.event=e,s.data.currentFocused=!1,s.events.push({type:"blur"}),t&&!this.adaptiveState&&(this.currentOpened&&(s.data.currentOpened=!1),s.events.push({type:"close"})),!i&&!n&&this.currentText&&(s.data.currentText=""),this.applyState(s)},handleFocus(e){this._skipFocusEvent||this.base.handleFocus(e)},onPopupOpened(){this.input&&this.currentFocused&&this.focusElement(this.input)},onPopupClosed(){this.currentFocused&&setTimeout(()=>{this.currentFocused&&this.focusElement(this.input)},0)},focusElement(e){this._skipFocusEvent=!0,e.focus(),setTimeout(()=>this._skipFocusEvent=!1,30)},applyState(e){this.base.applyState(e),this.valuesItemsDuringOnChange=null},setValidity(){this.input&&this.input.setCustomValidity&&this.input.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||Ve)},focus(){this.input&&this.input.focus()},calculateMedia(e){for(let t of e)this.windowWidth=t.target.clientWidth},repositionPopup(){this.base.repositionPopup()},onScroll(e){this.isScrolling=!0;const{vs:t,list:s}=this.base;t.scrollHandler(e);const i=this.base.initState(),{groupField:n}=this.$props;let{dataItems:r=[]}=this.$props,d;if(!n||!r.length)return;const u=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:s?s.children[0].offsetHeight:0),o=e.target.scrollTop-t.skip*u;n&&(r=this.base.getGroupedDataModernMode(r,n),r=this.base.getGroupedDataModernMode(r,n),d=r[0][n]);for(let h=1;h<r.length&&!(u*h>o);h++)r[h]&&r[h][n]&&(d=r[h][n]);d!==this.group&&(i.data.group=d,this.applyState(i))}},render(){const{style:e,label:t,dir:s,disabled:i,tags:n,textField:r,dataItemKey:d,virtual:u,loading:p,size:o,fillMode:h,rounded:m,tagsRounded:v,removeTagIcon:C,adaptiveTitle:X,header:M,footer:q,inputAttributes:Z,groupStickyHeaderItemRender:ee,dataItems:x=[]}=this.$props,te=this.currentFocused,N=Object.assign({},{animate:!0,height:"200px"},this.$props.popupSettings),R=this.currentFocusedTag,_=this.computedValue(),D=(this.$props.filter!==void 0?this.$props.filter:this.currentText)||"",se=!p&&(!!D||_.length>0),y=this.base.vs,A=this.$props.id||this.inputId,ie=a.templateRendering.call(this,this.$props.tagRender,a.getListeners.call(this)),L=this.isOpen,$=this.adaptiveState,j=$e.provideLocalizationService(this);this.group===void 0&&this.$props.groupField!==void 0&&(this.group=g.getItemValue(this.$props.dataItems[0],this.$props.groupField)),y.enabled=u!==void 0,u!==void 0&&(y.skip=u.skip,y.total=u.total,y.pageSize=u.pageSize);let I=[];this.initialAdaptiveRenderingValues?[...this.initialAdaptiveRenderingValues].forEach(f=>{I.push({text:g.getItemValue(f,r),data:[f]})}):n===void 0?this.computedValue().forEach(c=>{I.push({text:g.getItemValue(c,r),data:[c]})}):I.push(...n),I.length>0&&this.setItems(I,this._tags);const ne=!this.$props.validityStyles||this.validity().valid,ae=function(c){const f=this.activedescendant,{placeholder:S}=this.$props,{focusedIndex:F}=this.getFocusedState(),k=I.length===0||_.length===0&&!D?S:void 0,V=f===w.ActiveDescendant.TagsList&&R!==void 0?`tag-${this.base.guid}-${R.text.replace(/\s+/g,"-")}`:`option-${this.base.guid}-${F}`;return l.createVNode(ye.SearchBar,{id:c,size:Math.max((k||"").length,D.length,1),tabIndex:this.$props.tabIndex,accessKey:this.$props.accessKey,placeholder:k,value:$?"":D,onChange:this.onChangeHandler,onBlur:this.handleBlur,onKeydown:this.onInputKeyDown,ref:O=>{this.inputRef=O},disabled:i,expanded:L,owns:this.base.listBoxId,activedescendant:V,"aria-describedBy":`tagslist-${this.base.guid}${this.$props.ariaDescribedBy?" "+this.$props.ariaDescribedBy:""}`,"aria-labelledBy":this.$props.ariaLabelledBy,"aria-label":this.$props.ariaLabel,inputAttributes:Z},null)},z=function(){let c;const{groupField:f}=this.$props,S=a.templateRendering.call(this,this.$props.itemRender,a.getListeners.call(this)),F=a.templateRendering.call(this,this.$props.groupHeaderItemRender,a.getListeners.call(this)),k=a.templateRendering.call(this,this.$props.listNoDataRender,a.getListeners.call(this)),V=u?u.skip:0,{focusedIndex:O}=this.getFocusedState(),K=`translateY(${y.translate}px)`;let G=x;return f&&(G=this.base.getGroupedDataModernMode(x,f)),l.createVNode(Ie.List,{id:this.base.listBoxId,show:L,dataItems:G.slice(),focusedIndex:O,value:this.computedValue(),textField:r,valueField:d,optionsGuid:this.base.guid,ref:"list",wrapperStyle:{maxHeight:$?void 0:N.height},wrapperCssClass:"k-list-content",listStyle:y.enabled?{transform:K}:void 0,key:"listKey",skip:V,onListclick:this.handleItemClick,itemRender:S,groupHeaderItemRender:F,noDataRender:k,groupField:f,onScroll:this.onScroll},B(c=oe.call(this))?c:{default:()=>[c]})},oe=function(){return y.enabled&&l.createVNode("div",{ref:"scrollElement",key:"scrollElementKey"},null)},re=function(){const c=this.base,{allowCustom:f}=this.$props,S=a.templateRendering.call(this,this.$props.groupStickyHeaderItemRender,a.getListeners.call(this)),F=c.getTemplateDef.call(this,M),k=c.getTemplateDef.call(this,q),V=this.$props.filter!==void 0?this.$props.filter:this.currentText,{focusedType:O}=this.getFocusedState(),K=f&&V&&l.createVNode("div",{class:"k-list",key:"customitem",onClick:this.customItemSelect},[l.createVNode("div",{class:a.classNames("k-item k-custom-item",{"k-focus":Q(O)})},[V,l.createVNode(a.Icon,{name:"plus",icon:Y.plusIcon,style:{float:"right"}},null)])]);return this.group===void 0&&this.$props.groupField!==void 0&&(this.group=g.getItemValue(x[0],this.$props.groupField)),l.createVNode(ve.ListContainer,{ref:"container",onMousedown:Te,dir:s!==void 0?s:c.dirCalculated,onBlur:this.handleBlur,width:this.popupWidth,popupSettings:{...N,anchor:this.anchor,show:L,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,popupClass:a.classNames(N.popupClass,"k-list",{[`k-list-${P[o]||o}`]:o,"k-virtual-list":this.base.vs.enabled}),className:a.classNames("k-list-container",N.className)},itemsCount:x.length},{default:()=>[F&&l.createVNode("div",{class:"k-list-header"},[F]),K,this.group&&x.length!==0&&l.createVNode(U.GroupStickyHeader,{group:this.group,render:S},null),z.call(this),k&&l.createVNode("div",{class:"k-list-footer"},[k]),u&&M]})},le=function(){const c=this.$props.filter!==void 0?this.$props.filter:this.currentText;return this.$props.filterable&&l.createVNode(xe.ListFilter,{value:c,ref:"filterInput",onChange:this.onChangeHandler,onKeydown:this.onInputKeyDown,size:o,rounded:m,fillMode:h},null)},de=()=>[l.createVNode("div",{class:"k-actionsheet-titlebar-group k-hbox"},[l.createVNode("div",{class:"k-actionsheet-title"},[l.createVNode("div",{class:"k-text-center"},[X]),l.createVNode("div",{class:"k-actionsheet-subtitle k-text-center"},null)]),l.createVNode("div",{class:"k-actionsheet-actions"},[l.createVNode(E.Button,{tabIndex:5,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.onCancel,icon:"x",svgIcon:Y.xIcon},null)])]),l.createVNode("div",{class:"k-actionsheet-titlebar-group k-actionsheet-filter"},[le.call(this)])],ue=a.templateRendering.call(this,de,a.getListeners.call(this)),ce=()=>{const c=j.toLanguageString(T.adaptiveModeFooterCancel,T.messages[T.adaptiveModeFooterCancel]),f=j.toLanguageString(T.adaptiveModeFooterApply,T.messages[T.adaptiveModeFooterApply]);return[l.createVNode(E.Button,{size:"large","aria-label":c,"aria-disabled":"false",type:"button",onClick:this.onCancel},B(c)?c:{default:()=>[c]}),l.createVNode(E.Button,{themeColor:"primary",size:"large","aria-label":f,"aria-disabled":"false",type:"button",onClick:this.handleWrapperClick},B(f)?f:{default:()=>[f]})]},pe=a.templateRendering.call(this,ce,a.getListeners.call(this)),he=()=>{const c=this.base.getTemplateDef.call(this,M,l.h),f=this.base.getTemplateDef.call(this,q,l.h),S=a.templateRendering.call(this,ee,a.getListeners.call(this));return l.createVNode("div",{class:"k-list-container"},[c&&l.createVNode("div",{class:"k-list-header"},[c]),l.createVNode("div",{class:a.classNames("k-list",{[`k-list-${P[o]||o}`]:$?!1:o,"k-list-lg":!!$,"k-virtual-list":y.enabled})},[this.group&&x.length!==0&&l.createVNode(U.GroupStickyHeader,{group:this.group,render:S},null),z.call(this),f&&l.createVNode("div",{class:"k-list-footer"},[f])])])},fe=a.templateRendering.call(this,he,a.getListeners.call(this)),ge=function(){return l.createVNode(Ce.ActionSheet,{expand:L,animation:!0,animationStyles:this.animationStyles,className:this.classNameAdaptive,contentClassName:"!k-overflow-hidden",footerClassName:"k-actions k-actions-stretched",header:ue,content:fe,footer:pe,onClose:this.onCancel,navigatableElements:["input.k-input-inner",".k-actionsheet-actions > button"]},null)},me=function(){let c;return l.createVNode("span",{ref:a.setRef(this,"kendoAnchor"),class:a.classNames("k-multiselect","k-input",{[`k-input-${P[o]||o}`]:o,[`k-rounded-${Fe[m]||m}`]:m,[`k-input-${h}`]:h,"k-focus":te&&!i,"k-disabled":i,"k-invalid":!ne,"k-loading":p,"k-required":this.required}),style:t?{...e,width:void 0}:e,dir:s,onFocusin:this.handleFocus,onClick:this.handleWrapperClick,onMousedown:g.preventDefaultNonInputs},[l.createVNode(be.TagList,{removeTagIcon:C,tagsRounded:v,size:o,fillMode:h,tagRender:ie,onTagdelete:this.onTagDelete,dataItems:I,guid:this.base.guid,focused:R?I.find(f=>J(f,R,d)):void 0},B(c=ae.call(this,A))?c:{default:()=>[c]}),I.length>0&&se&&l.createVNode(ke.ClearButton,{onClearclick:this.clearButtonClick},null),l.createVNode("span",{class:p?"k-input-loading-icon k-icon k-i-loading":void 0},null),!$&&re.call(this)])},W=[l.h(me.call(this),{...this.$attrs}),$&&ge.call(this)];return t?l.createVNode("span",{class:this.spanClassNames,dir:this.$props.dir},[W,this.$props.label?A?l.createVNode("label",{for:A,class:"k-floating-label"},[this.$props.label]):l.createVNode("span",{class:"k-label"},[this.$props.label]):null]):W}});exports.MultiSelect=Oe;
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
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 { guid as X, canUseDOM as
|
|
10
|
-
import { ListContainer as
|
|
11
|
-
import { List as
|
|
12
|
-
import { TagList as
|
|
8
|
+
import { defineComponent as Fe, ref as Q, inject as Te, h as _, createVNode as r, isVNode as Oe } from "vue";
|
|
9
|
+
import { guid as X, canUseDOM as Ve, getRef as Z, Keys as f, templateRendering as b, getListeners as I, classNames as R, setRef as we, kendoThemeMaps as Re, Icon as De } from "@progress/kendo-vue-common";
|
|
10
|
+
import { ListContainer as Be } from "../common/ListContainer.mjs";
|
|
11
|
+
import { List as Me } from "../common/List.mjs";
|
|
12
|
+
import { TagList as Ae } from "./TagList.mjs";
|
|
13
13
|
import { SearchBar as Le } from "../common/SearchBar.mjs";
|
|
14
|
-
import
|
|
14
|
+
import He from "../common/DropDownBase.mjs";
|
|
15
15
|
import { GroupStickyHeader as ee } from "../common/GroupStickyHeader.mjs";
|
|
16
|
-
import { ClearButton as
|
|
17
|
-
import { ActiveDescendant as
|
|
18
|
-
import { getItemValue as x, areSame as te, removeDataItems as H, isPresent as
|
|
19
|
-
import { xIcon as
|
|
20
|
-
import { Button as
|
|
21
|
-
import { MOBILE_SMALL_DEVICE as se, MOBILE_MEDIUM_DEVICE as
|
|
22
|
-
import { ActionSheet as
|
|
23
|
-
import { ListFilter as
|
|
24
|
-
import { provideLocalizationService as
|
|
16
|
+
import { ClearButton as Ee } from "../common/ClearButton.mjs";
|
|
17
|
+
import { ActiveDescendant as L } from "../common/settings.mjs";
|
|
18
|
+
import { getItemValue as x, areSame as te, removeDataItems as H, isPresent as Pe, matchDataCollections as Ne, itemIndexStartsWith as Ke, preventDefaultNonInputs as _e } from "../common/utils.mjs";
|
|
19
|
+
import { xIcon as je, plusIcon as ze } from "@progress/kendo-svg-icons";
|
|
20
|
+
import { Button as j } from "@progress/kendo-vue-buttons";
|
|
21
|
+
import { MOBILE_SMALL_DEVICE as se, MOBILE_MEDIUM_DEVICE as We } from "../common/constants.mjs";
|
|
22
|
+
import { ActionSheet as Ge } from "@progress/kendo-vue-layout";
|
|
23
|
+
import { ListFilter as qe } from "../common/ListFilter.mjs";
|
|
24
|
+
import { provideLocalizationService as Ue } from "@progress/kendo-vue-intl";
|
|
25
25
|
import { adaptiveModeFooterCancel as ie, messages as ne, adaptiveModeFooterApply as ae } from "../messages/main.mjs";
|
|
26
26
|
const {
|
|
27
|
-
sizeMap:
|
|
28
|
-
roundedMap:
|
|
29
|
-
} =
|
|
27
|
+
sizeMap: z,
|
|
28
|
+
roundedMap: Ye
|
|
29
|
+
} = Re;
|
|
30
30
|
function E(e) {
|
|
31
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !
|
|
31
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Oe(e);
|
|
32
32
|
}
|
|
33
|
-
const
|
|
33
|
+
const Je = "Please enter a valid value!", Qe = (e) => e.preventDefault(), oe = (e, t, s) => !!e != !!t || e.text !== t.text ? !1 : e === t || Ne(e.data, t.data, s), le = (e) => e === S.CustomItem;
|
|
34
34
|
var S = /* @__PURE__ */ function(e) {
|
|
35
35
|
return e[e.None = 0] = "None", e[e.ListItem = 1] = "ListItem", e[e.CustomItem = 2] = "CustomItem", e;
|
|
36
36
|
}(S || {});
|
|
37
|
-
const
|
|
37
|
+
const vt = /* @__PURE__ */ Fe({
|
|
38
38
|
name: "KendoMultiSelect",
|
|
39
39
|
emits: {
|
|
40
40
|
changemodel: null,
|
|
@@ -173,10 +173,11 @@ const mt = /* @__PURE__ */ $e({
|
|
|
173
173
|
adaptiveTitle: {
|
|
174
174
|
type: String,
|
|
175
175
|
default: void 0
|
|
176
|
-
}
|
|
176
|
+
},
|
|
177
|
+
inputAttributes: Object
|
|
177
178
|
},
|
|
178
179
|
setup() {
|
|
179
|
-
const e = Q(null), t = Q(null), s =
|
|
180
|
+
const e = Q(null), t = Q(null), s = Te("kendoLocalizationService", {});
|
|
180
181
|
return {
|
|
181
182
|
inputRef: e,
|
|
182
183
|
kendoAnchorRef: t,
|
|
@@ -208,11 +209,11 @@ const mt = /* @__PURE__ */ $e({
|
|
|
208
209
|
return this.windowWidth <= se ? "k-adaptive-actionsheet k-actionsheet-fullscreen" : "k-adaptive-actionsheet k-actionsheet-bottom";
|
|
209
210
|
},
|
|
210
211
|
adaptiveState() {
|
|
211
|
-
return this.windowWidth <=
|
|
212
|
+
return this.windowWidth <= We && this.$props.adaptive;
|
|
212
213
|
}
|
|
213
214
|
},
|
|
214
215
|
created() {
|
|
215
|
-
this.observer = null, this.valuesItemsDuringOnChange = null, this._tags = [], this._skipFocusEvent = !1, this.scrollToFocused = !1, this.base = new
|
|
216
|
+
this.observer = null, this.valuesItemsDuringOnChange = null, this._tags = [], this._skipFocusEvent = !1, this.scrollToFocused = !1, this.base = new He(this), this.anchor = X(), this.inputId = X();
|
|
216
217
|
},
|
|
217
218
|
inject: {
|
|
218
219
|
kendoLocalizationService: {
|
|
@@ -233,7 +234,7 @@ const mt = /* @__PURE__ */ $e({
|
|
|
233
234
|
last: ""
|
|
234
235
|
},
|
|
235
236
|
suggested: "",
|
|
236
|
-
activedescendant:
|
|
237
|
+
activedescendant: L.PopupList,
|
|
237
238
|
group: void 0,
|
|
238
239
|
isScrolling: !1,
|
|
239
240
|
itemHeight: 0,
|
|
@@ -282,7 +283,7 @@ const mt = /* @__PURE__ */ $e({
|
|
|
282
283
|
this.scrollToFocused = !1, this.searchBarRef(), this.setValidity();
|
|
283
284
|
},
|
|
284
285
|
mounted() {
|
|
285
|
-
this.observer =
|
|
286
|
+
this.observer = Ve && window.ResizeObserver && new ResizeObserver(this.calculateMedia), document != null && document.body && this.observer && this.observer.observe(document.body), this.hasMounted = !0, this.input = this.inputRef.input, this.base.wrapper = Z(this, "kendoAnchor"), this.element = Z(this, "kendoAnchor"), this.base.didMount(), this.searchBarRef(), this.setValidity();
|
|
286
287
|
},
|
|
287
288
|
methods: {
|
|
288
289
|
clearFilter(e) {
|
|
@@ -354,7 +355,7 @@ const mt = /* @__PURE__ */ $e({
|
|
|
354
355
|
} = this.$props, o = n ? n.skip : 0, l = this.$props.filter !== void 0 ? this.$props.filter : this.currentText, {
|
|
355
356
|
focusedIndex: d
|
|
356
357
|
} = this.getFocusedState(), c = i && l, a = s[e - o];
|
|
357
|
-
a && d !== e ? this.currentFocusedIndex !== e && (t.data.currentFocusedIndex = e, t.data.activedescendant =
|
|
358
|
+
a && d !== e ? this.currentFocusedIndex !== e && (t.data.currentFocusedIndex = e, t.data.activedescendant = L.PopupList) : c && e === -1 && this.currentFocusedIndex !== void 0 && (t.data.currentFocusedIndex = void 0), this.base.triggerPageChangeCornerItems(a, t);
|
|
358
359
|
},
|
|
359
360
|
searchBarRef() {
|
|
360
361
|
this.input && this.currentFocused && setTimeout(() => this.input.focus(), 0);
|
|
@@ -367,7 +368,7 @@ const mt = /* @__PURE__ */ $e({
|
|
|
367
368
|
const t = this.isOpen, s = this.base.initState();
|
|
368
369
|
s.event = e, e.stopPropagation(), this.computedValue().length > 0 && this.triggerOnChange([], s), this.currentFocusedIndex !== void 0 && (s.data.currentFocusedIndex = void 0), t && this.base.togglePopup(s);
|
|
369
370
|
const i = this.$props.filter !== void 0 ? this.$props.filter : this.currentText;
|
|
370
|
-
|
|
371
|
+
Pe(i) && i !== "" && this.base.filterChanged("", s), this.currentText && (s.data.currentText = ""), this.applyState(s);
|
|
371
372
|
},
|
|
372
373
|
onInputKeyDown(e) {
|
|
373
374
|
this.isScrolling && (this.isScrolling = !1);
|
|
@@ -407,7 +408,7 @@ const mt = /* @__PURE__ */ $e({
|
|
|
407
408
|
H(a, p.data, o), this.triggerOnChange(a, t);
|
|
408
409
|
}
|
|
409
410
|
}
|
|
410
|
-
d !== i && (t.data.currentFocusedTag = d, t.data.activedescendant =
|
|
411
|
+
d !== i && (t.data.currentFocusedTag = d, t.data.activedescendant = L.TagsList), this.applyState(t);
|
|
411
412
|
},
|
|
412
413
|
triggerOnChange(e, t) {
|
|
413
414
|
this.$props.value === void 0 && (t.data.currentValue = [...e]), this.valuesItemsDuringOnChange = [], this.setItems(e, this.valuesItemsDuringOnChange), t.events.push({
|
|
@@ -433,7 +434,7 @@ const mt = /* @__PURE__ */ $e({
|
|
|
433
434
|
dataItemKey: n,
|
|
434
435
|
virtual: o,
|
|
435
436
|
textField: l,
|
|
436
|
-
focusedItemIndex: d =
|
|
437
|
+
focusedItemIndex: d = Ke
|
|
437
438
|
} = this.$props, c = o && o.skip || 0;
|
|
438
439
|
let a;
|
|
439
440
|
if (e !== void 0)
|
|
@@ -541,7 +542,7 @@ const mt = /* @__PURE__ */ $e({
|
|
|
541
542
|
this.base.applyState(e), this.valuesItemsDuringOnChange = null;
|
|
542
543
|
},
|
|
543
544
|
setValidity() {
|
|
544
|
-
this.input && this.input.setCustomValidity && this.input.setCustomValidity(this.validity().valid ? "" : this.$props.validationMessage ||
|
|
545
|
+
this.input && this.input.setCustomValidity && this.input.setCustomValidity(this.validity().valid ? "" : this.$props.validationMessage || Je);
|
|
545
546
|
},
|
|
546
547
|
focus() {
|
|
547
548
|
this.input && this.input.focus();
|
|
@@ -594,12 +595,13 @@ const mt = /* @__PURE__ */ $e({
|
|
|
594
595
|
adaptiveTitle: re,
|
|
595
596
|
header: P,
|
|
596
597
|
footer: W,
|
|
597
|
-
|
|
598
|
+
inputAttributes: de,
|
|
599
|
+
groupStickyHeaderItemRender: ue,
|
|
598
600
|
dataItems: F = []
|
|
599
|
-
} = this.$props,
|
|
601
|
+
} = this.$props, ce = this.currentFocused, D = Object.assign({}, {
|
|
600
602
|
animate: !0,
|
|
601
603
|
height: "200px"
|
|
602
|
-
}, this.$props.popupSettings), B = this.currentFocusedTag, G = this.computedValue(), M = (this.$props.filter !== void 0 ? this.$props.filter : this.currentText) || "",
|
|
604
|
+
}, this.$props.popupSettings), B = this.currentFocusedTag, G = this.computedValue(), M = (this.$props.filter !== void 0 ? this.$props.filter : this.currentText) || "", pe = !c && (!!M || G.length > 0), y = this.base.vs, N = this.$props.id || this.inputId, he = b.call(this, this.$props.tagRender, I.call(this)), A = this.isOpen, T = this.adaptiveState, q = Ue(this);
|
|
603
605
|
this.group === void 0 && this.$props.groupField !== void 0 && (this.group = x(this.$props.dataItems[0], this.$props.groupField)), y.enabled = d !== void 0, d !== void 0 && (y.skip = d.skip, y.total = d.total, y.pageSize = d.pageSize);
|
|
604
606
|
let v = [];
|
|
605
607
|
this.initialAdaptiveRenderingValues ? [...this.initialAdaptiveRenderingValues].forEach((h) => {
|
|
@@ -613,12 +615,12 @@ const mt = /* @__PURE__ */ $e({
|
|
|
613
615
|
data: [u]
|
|
614
616
|
});
|
|
615
617
|
}) : v.push(...n), v.length > 0 && this.setItems(v, this._tags);
|
|
616
|
-
const
|
|
618
|
+
const fe = !this.$props.validityStyles || this.validity().valid, ge = function(u) {
|
|
617
619
|
const h = this.activedescendant, {
|
|
618
620
|
placeholder: k
|
|
619
621
|
} = this.$props, {
|
|
620
622
|
focusedIndex: O
|
|
621
|
-
} = this.getFocusedState(), C = v.length === 0 || G.length === 0 && !M ? k : void 0, V = h ===
|
|
623
|
+
} = this.getFocusedState(), C = v.length === 0 || G.length === 0 && !M ? k : void 0, V = h === L.TagsList && B !== void 0 ? `tag-${this.base.guid}-${B.text.replace(/\s+/g, "-")}` : `option-${this.base.guid}-${O}`;
|
|
622
624
|
return r(Le, {
|
|
623
625
|
id: u,
|
|
624
626
|
size: Math.max((C || "").length, M.length, 1),
|
|
@@ -633,12 +635,13 @@ const mt = /* @__PURE__ */ $e({
|
|
|
633
635
|
this.inputRef = w;
|
|
634
636
|
},
|
|
635
637
|
disabled: i,
|
|
636
|
-
expanded:
|
|
638
|
+
expanded: A,
|
|
637
639
|
owns: this.base.listBoxId,
|
|
638
640
|
activedescendant: V,
|
|
639
641
|
"aria-describedBy": `tagslist-${this.base.guid}${this.$props.ariaDescribedBy ? " " + this.$props.ariaDescribedBy : ""}`,
|
|
640
642
|
"aria-labelledBy": this.$props.ariaLabelledBy,
|
|
641
|
-
"aria-label": this.$props.ariaLabel
|
|
643
|
+
"aria-label": this.$props.ariaLabel,
|
|
644
|
+
inputAttributes: de
|
|
642
645
|
}, null);
|
|
643
646
|
}, U = function() {
|
|
644
647
|
let u;
|
|
@@ -648,9 +651,9 @@ const mt = /* @__PURE__ */ $e({
|
|
|
648
651
|
focusedIndex: w
|
|
649
652
|
} = this.getFocusedState(), K = `translateY(${y.translate}px)`;
|
|
650
653
|
let J = F;
|
|
651
|
-
return h && (J = this.base.getGroupedDataModernMode(F, h)), r(
|
|
654
|
+
return h && (J = this.base.getGroupedDataModernMode(F, h)), r(Me, {
|
|
652
655
|
id: this.base.listBoxId,
|
|
653
|
-
show:
|
|
656
|
+
show: A,
|
|
654
657
|
dataItems: J.slice(),
|
|
655
658
|
focusedIndex: w,
|
|
656
659
|
value: this.computedValue(),
|
|
@@ -673,15 +676,15 @@ const mt = /* @__PURE__ */ $e({
|
|
|
673
676
|
noDataRender: C,
|
|
674
677
|
groupField: h,
|
|
675
678
|
onScroll: this.onScroll
|
|
676
|
-
}, E(u =
|
|
679
|
+
}, E(u = me.call(this)) ? u : {
|
|
677
680
|
default: () => [u]
|
|
678
681
|
});
|
|
679
|
-
},
|
|
682
|
+
}, me = function() {
|
|
680
683
|
return y.enabled && r("div", {
|
|
681
684
|
ref: "scrollElement",
|
|
682
685
|
key: "scrollElementKey"
|
|
683
686
|
}, null);
|
|
684
|
-
},
|
|
687
|
+
}, ve = function() {
|
|
685
688
|
const u = this.base, {
|
|
686
689
|
allowCustom: h
|
|
687
690
|
} = this.$props, k = b.call(this, this.$props.groupStickyHeaderItemRender, I.call(this)), O = u.getTemplateDef.call(this, P), C = u.getTemplateDef.call(this, W), V = this.$props.filter !== void 0 ? this.$props.filter : this.currentText, {
|
|
@@ -694,27 +697,27 @@ const mt = /* @__PURE__ */ $e({
|
|
|
694
697
|
class: R("k-item k-custom-item", {
|
|
695
698
|
"k-focus": le(w)
|
|
696
699
|
})
|
|
697
|
-
}, [V, r(
|
|
700
|
+
}, [V, r(De, {
|
|
698
701
|
name: "plus",
|
|
699
702
|
icon: ze,
|
|
700
703
|
style: {
|
|
701
704
|
float: "right"
|
|
702
705
|
}
|
|
703
706
|
}, null)])]);
|
|
704
|
-
return this.group === void 0 && this.$props.groupField !== void 0 && (this.group = x(F[0], this.$props.groupField)), r(
|
|
707
|
+
return this.group === void 0 && this.$props.groupField !== void 0 && (this.group = x(F[0], this.$props.groupField)), r(Be, {
|
|
705
708
|
ref: "container",
|
|
706
|
-
onMousedown:
|
|
709
|
+
onMousedown: Qe,
|
|
707
710
|
dir: s !== void 0 ? s : u.dirCalculated,
|
|
708
711
|
onBlur: this.handleBlur,
|
|
709
712
|
width: this.popupWidth,
|
|
710
713
|
popupSettings: {
|
|
711
714
|
...D,
|
|
712
715
|
anchor: this.anchor,
|
|
713
|
-
show:
|
|
716
|
+
show: A,
|
|
714
717
|
onOpen: this.onPopupOpened,
|
|
715
718
|
onClose: this.onPopupClosed,
|
|
716
719
|
popupClass: R(D.popupClass, "k-list", {
|
|
717
|
-
[`k-list-${
|
|
720
|
+
[`k-list-${z[a] || a}`]: a,
|
|
718
721
|
"k-virtual-list": this.base.vs.enabled
|
|
719
722
|
}),
|
|
720
723
|
className: R("k-list-container", D.className)
|
|
@@ -730,9 +733,9 @@ const mt = /* @__PURE__ */ $e({
|
|
|
730
733
|
class: "k-list-footer"
|
|
731
734
|
}, [C]), d && P]
|
|
732
735
|
});
|
|
733
|
-
},
|
|
736
|
+
}, be = function() {
|
|
734
737
|
const u = this.$props.filter !== void 0 ? this.$props.filter : this.currentText;
|
|
735
|
-
return this.$props.filterable && r(
|
|
738
|
+
return this.$props.filterable && r(qe, {
|
|
736
739
|
value: u,
|
|
737
740
|
ref: "filterInput",
|
|
738
741
|
onChange: this.onChangeHandler,
|
|
@@ -741,7 +744,7 @@ const mt = /* @__PURE__ */ $e({
|
|
|
741
744
|
rounded: g,
|
|
742
745
|
fillMode: p
|
|
743
746
|
}, null);
|
|
744
|
-
},
|
|
747
|
+
}, Ie = () => [r("div", {
|
|
745
748
|
class: "k-actionsheet-titlebar-group k-hbox"
|
|
746
749
|
}, [r("div", {
|
|
747
750
|
class: "k-actionsheet-title"
|
|
@@ -751,7 +754,7 @@ const mt = /* @__PURE__ */ $e({
|
|
|
751
754
|
class: "k-actionsheet-subtitle k-text-center"
|
|
752
755
|
}, null)]), r("div", {
|
|
753
756
|
class: "k-actionsheet-actions"
|
|
754
|
-
}, [r(
|
|
757
|
+
}, [r(j, {
|
|
755
758
|
tabIndex: 5,
|
|
756
759
|
"aria-label": "Cancel",
|
|
757
760
|
"aria-disabled": "false",
|
|
@@ -759,12 +762,12 @@ const mt = /* @__PURE__ */ $e({
|
|
|
759
762
|
fillMode: "flat",
|
|
760
763
|
onClick: this.onCancel,
|
|
761
764
|
icon: "x",
|
|
762
|
-
svgIcon:
|
|
765
|
+
svgIcon: je
|
|
763
766
|
}, null)])]), r("div", {
|
|
764
767
|
class: "k-actionsheet-titlebar-group k-actionsheet-filter"
|
|
765
|
-
}, [
|
|
768
|
+
}, [be.call(this)])], Se = b.call(this, Ie, I.call(this)), ye = () => {
|
|
766
769
|
const u = q.toLanguageString(ie, ne[ie]), h = q.toLanguageString(ae, ne[ae]);
|
|
767
|
-
return [r(
|
|
770
|
+
return [r(j, {
|
|
768
771
|
size: "large",
|
|
769
772
|
"aria-label": u,
|
|
770
773
|
"aria-disabled": "false",
|
|
@@ -772,7 +775,7 @@ const mt = /* @__PURE__ */ $e({
|
|
|
772
775
|
onClick: this.onCancel
|
|
773
776
|
}, E(u) ? u : {
|
|
774
777
|
default: () => [u]
|
|
775
|
-
}), r(
|
|
778
|
+
}), r(j, {
|
|
776
779
|
themeColor: "primary",
|
|
777
780
|
size: "large",
|
|
778
781
|
"aria-label": h,
|
|
@@ -782,15 +785,15 @@ const mt = /* @__PURE__ */ $e({
|
|
|
782
785
|
}, E(h) ? h : {
|
|
783
786
|
default: () => [h]
|
|
784
787
|
})];
|
|
785
|
-
},
|
|
786
|
-
const u = this.base.getTemplateDef.call(this, P, _), h = this.base.getTemplateDef.call(this, W, _), k = b.call(this,
|
|
788
|
+
}, ke = b.call(this, ye, I.call(this)), Ce = () => {
|
|
789
|
+
const u = this.base.getTemplateDef.call(this, P, _), h = this.base.getTemplateDef.call(this, W, _), k = b.call(this, ue, I.call(this));
|
|
787
790
|
return r("div", {
|
|
788
791
|
class: "k-list-container"
|
|
789
792
|
}, [u && r("div", {
|
|
790
793
|
class: "k-list-header"
|
|
791
794
|
}, [u]), r("div", {
|
|
792
795
|
class: R("k-list", {
|
|
793
|
-
[`k-list-${
|
|
796
|
+
[`k-list-${z[a] || a}`]: T ? !1 : a,
|
|
794
797
|
"k-list-lg": !!T,
|
|
795
798
|
"k-virtual-list": y.enabled
|
|
796
799
|
})
|
|
@@ -800,31 +803,31 @@ const mt = /* @__PURE__ */ $e({
|
|
|
800
803
|
}, null), U.call(this), h && r("div", {
|
|
801
804
|
class: "k-list-footer"
|
|
802
805
|
}, [h])])]);
|
|
803
|
-
},
|
|
804
|
-
return r(
|
|
805
|
-
expand:
|
|
806
|
+
}, xe = b.call(this, Ce, I.call(this)), $e = function() {
|
|
807
|
+
return r(Ge, {
|
|
808
|
+
expand: A,
|
|
806
809
|
animation: !0,
|
|
807
810
|
animationStyles: this.animationStyles,
|
|
808
811
|
className: this.classNameAdaptive,
|
|
809
812
|
contentClassName: "!k-overflow-hidden",
|
|
810
813
|
footerClassName: "k-actions k-actions-stretched",
|
|
811
|
-
header:
|
|
812
|
-
content:
|
|
813
|
-
footer:
|
|
814
|
+
header: Se,
|
|
815
|
+
content: xe,
|
|
816
|
+
footer: ke,
|
|
814
817
|
onClose: this.onCancel,
|
|
815
818
|
navigatableElements: ["input.k-input-inner", ".k-actionsheet-actions > button"]
|
|
816
819
|
}, null);
|
|
817
820
|
}, Y = [_(function() {
|
|
818
821
|
let u;
|
|
819
822
|
return r("span", {
|
|
820
|
-
ref:
|
|
823
|
+
ref: we(this, "kendoAnchor"),
|
|
821
824
|
class: R("k-multiselect", "k-input", {
|
|
822
|
-
[`k-input-${
|
|
823
|
-
[`k-rounded-${
|
|
825
|
+
[`k-input-${z[a] || a}`]: a,
|
|
826
|
+
[`k-rounded-${Ye[g] || g}`]: g,
|
|
824
827
|
[`k-input-${p}`]: p,
|
|
825
|
-
"k-focus":
|
|
828
|
+
"k-focus": ce && !i,
|
|
826
829
|
"k-disabled": i,
|
|
827
|
-
"k-invalid": !
|
|
830
|
+
"k-invalid": !fe,
|
|
828
831
|
"k-loading": c,
|
|
829
832
|
"k-required": this.required
|
|
830
833
|
}),
|
|
@@ -835,27 +838,27 @@ const mt = /* @__PURE__ */ $e({
|
|
|
835
838
|
dir: s,
|
|
836
839
|
onFocusin: this.handleFocus,
|
|
837
840
|
onClick: this.handleWrapperClick,
|
|
838
|
-
onMousedown:
|
|
839
|
-
}, [r(
|
|
841
|
+
onMousedown: _e
|
|
842
|
+
}, [r(Ae, {
|
|
840
843
|
removeTagIcon: $,
|
|
841
844
|
tagsRounded: m,
|
|
842
845
|
size: a,
|
|
843
846
|
fillMode: p,
|
|
844
|
-
tagRender:
|
|
847
|
+
tagRender: he,
|
|
845
848
|
onTagdelete: this.onTagDelete,
|
|
846
849
|
dataItems: v,
|
|
847
850
|
guid: this.base.guid,
|
|
848
851
|
focused: B ? v.find((h) => oe(h, B, l)) : void 0
|
|
849
|
-
}, E(u =
|
|
852
|
+
}, E(u = ge.call(this, N)) ? u : {
|
|
850
853
|
default: () => [u]
|
|
851
|
-
}), v.length > 0 &&
|
|
854
|
+
}), v.length > 0 && pe && r(Ee, {
|
|
852
855
|
onClearclick: this.clearButtonClick
|
|
853
856
|
}, null), r("span", {
|
|
854
857
|
class: c ? "k-input-loading-icon k-icon k-i-loading" : void 0
|
|
855
|
-
}, null), !T &&
|
|
858
|
+
}, null), !T && ve.call(this)]);
|
|
856
859
|
}.call(this), {
|
|
857
860
|
...this.$attrs
|
|
858
|
-
}), T &&
|
|
861
|
+
}), T && $e.call(this)];
|
|
859
862
|
return t ? r("span", {
|
|
860
863
|
class: this.spanClassNames,
|
|
861
864
|
dir: this.$props.dir
|
|
@@ -868,5 +871,5 @@ const mt = /* @__PURE__ */ $e({
|
|
|
868
871
|
}
|
|
869
872
|
});
|
|
870
873
|
export {
|
|
871
|
-
|
|
874
|
+
vt as MultiSelect
|
|
872
875
|
};
|
package/MultiSelect/TagList.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
package/MultiSelect/TagList.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
package/MultiSelectTree/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
package/README.md
CHANGED
|
@@ -58,6 +58,6 @@ For any issues you might encounter while working with the Kendo UI for Vue DropD
|
|
|
58
58
|
* [Demos, documentation, and component reference](https://www.telerik.com/kendo-vue-ui/components/?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-dropdowns)
|
|
59
59
|
* [Kendo UI for Vue pricing and licensing](https://www.telerik.com/purchase/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-vue-trial-npm-dropdowns)
|
|
60
60
|
|
|
61
|
-
*Copyright ©
|
|
61
|
+
*Copyright © 2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.*
|
|
62
62
|
|
|
63
63
|
*Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries.*
|
package/common/ClearButton.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|