@progress/kendo-vue-dropdowns 8.4.0-develop.3 → 8.4.0-develop.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoComplete/AutoComplete.js +1 -1
- package/AutoComplete/AutoComplete.mjs +1 -1
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +1 -2
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +108 -105
- package/DropDownTree/DropDownTree.js +1 -1
- package/DropDownTree/DropDownTree.mjs +2 -2
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +88 -88
- package/MultiSelect/TagList.js +1 -1
- package/MultiSelect/TagList.mjs +22 -24
- package/MultiSelectTree/MultiSelectTree.js +1 -1
- package/MultiSelectTree/MultiSelectTree.mjs +15 -17
- package/common/SearchBar.js +1 -1
- package/common/SearchBar.mjs +3 -2
- package/dist/cdn/js/kendo-vue-dropdowns.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +16 -11
|
@@ -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 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"),G=require("../common/GroupStickyHeader.js"),ke=require("../common/ClearButton.js"),w=require("../common/settings.js"),m=require("../common/utils.js"),U=require("@progress/kendo-svg-icons"),E=require("@progress/kendo-vue-buttons"),Y=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 A(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||m.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:e=>!0,"update:modelValue":e=>!0,filterchange:e=>!0,change:e=>!0,pagechange:e=>!0,focus:e=>!0,blur:e=>!0,open:e=>!0,close:e=>!0,scroll:e=>!0},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,validator:function(e){return["none","small","medium","large","full"].includes(e)}},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)}},size:{type:String,validator:function(e){return["none","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||m.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<=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}},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},adaptiveModeBreakpoints:{default:{small:Y.MOBILE_SMALL_DEVICE,medium:Y.MOBILE_MEDIUM_DEVICE}}},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 g;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,f=this.$refs.scrollElement;if(o&&(this.base.vs.list=o.list,this.base.list=o.list),f&&(this.base.vs.scrollElement=f),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=(g=this.base.getGroupedDataModernMode(s,t))==null?void 0:g.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=>m.getItemValue(r,e)===i);return this.dataItems[n]||i})},primitiveValue(){const e=this.computedValue(),t=e.map(s=>m.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(g=>m.areSame(g,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();m.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),f=this.base,g=f.vs;if(n&&t===a.Keys.up&&o)this.currentFocusedIndex!==void 0&&(e.data.currentFocusedIndex=void 0);else{const v=f.navigation.navigate({keyCode:t,current:u,max:(g.enabled?g.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;m.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();m.removeDataItems(o,n[d].data,r),this.triggerOnChange(o,t)}}else if(s===a.Keys.backspace){const o=this.computedValue();if(p)m.removeDataItems(o,n[d].data,r),this.triggerOnChange(o,t);else if(!p&&n.length){const f=n.pop();m.removeDataItems(o,f.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=m.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 f=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(f.length){const g=f[f.length-1];return o=i.findIndex(v=>m.areSame(v,g,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){var g;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=s&&((g=s.querySelector(".k-list-item"))==null?void 0:g.offsetHeight)||0,p=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:u),f=e.target.scrollTop-t.skip*p;n&&(r=this.base.getGroupedDataModernMode(r,n),r=this.base.getGroupedDataModernMode(r,n),d=r[0][n]);for(let v=1;v<r.length&&!(p*v>f);v++)r[v]&&r[v][n]&&(d=r[v][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:f,rounded:g,tagsRounded:v,removeTagIcon:C,adaptiveTitle:X,header:K,footer:q,inputAttributes:Z,groupStickyHeaderItemRender:ee,dataItems:x=[]}=this.$props,te=this.currentFocused,R=Object.assign({},{animate:!0,height:"200px"},this.$props.popupSettings),D=this.currentFocusedTag,j=this.computedValue(),B=(this.$props.filter!==void 0?this.$props.filter:this.currentText)||"",se=!p&&!i&&(!!B||j.length>0),y=this.base.vs,H=this.$props.id||this.inputId,ie=a.templateRendering.call(this,this.$props.tagRender,a.getListeners.call(this)),L=this.isOpen,$=this.adaptiveState,_=$e.provideLocalizationService(this);this.group===void 0&&this.$props.groupField!==void 0&&(this.group=m.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(h=>{I.push({text:m.getItemValue(h,r),data:[h]})}):n===void 0?this.computedValue().forEach(c=>{I.push({text:m.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 h=this.activedescendant,{placeholder:S}=this.$props,{focusedIndex:F}=this.getFocusedState(),k=I.length===0||j.length===0&&!B?S:void 0,V=h===w.ActiveDescendant.TagsList&&D!==void 0?`tag-${this.base.guid}-${D.text.replace(/\s+/g,"-")}`:`option-${this.base.guid}-${F}`,O=this.$props.ariaDescribedBy?" "+this.$props.ariaDescribedBy:"",N=I.length>0?`tagslist-${this.base.guid}${O}`:this.$props.ariaDescribedBy;return l.createVNode(ye.SearchBar,{id:c,size:Math.max((k||"").length,B.length,1),tabIndex:this.$props.tabIndex,accessKey:this.$props.accessKey,placeholder:k,value:$?"":B,onChange:this.onChangeHandler,onBlur:this.handleBlur,onKeydown:this.onInputKeyDown,ref:M=>{this.inputRef=M},disabled:i,expanded:L,owns:this.base.listBoxId,activedescendant:V,ariaDescribedBy:N,"aria-labelledBy":this.$props.ariaLabelledBy,"aria-label":this.$props.ariaLabel,inputAttributes:Z},null)},z=function(){let c;const{groupField:h}=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(),N=`translateY(${y.translate}px)`;let M=x;return h&&(M=this.base.getGroupedDataModernMode(x,h)),l.createVNode(Ie.List,{id:this.base.listBoxId,show:L,dataItems:M.slice(),focusedIndex:O,value:this.computedValue(),textField:r,valueField:d,optionsGuid:this.base.guid,ref:"list",wrapperStyle:{maxHeight:$?void 0:R.height},wrapperCssClass:"k-list-content",listStyle:y.enabled?{transform:N}:void 0,key:"listKey",skip:V,onListclick:this.handleItemClick,itemRender:S,groupHeaderItemRender:F,noDataRender:k,groupField:h,onScroll:this.onScroll},A(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:h}=this.$props,S=a.templateRendering.call(this,this.$props.groupStickyHeaderItemRender,a.getListeners.call(this)),F=c.getTemplateDef.call(this,K),k=c.getTemplateDef.call(this,q),V=this.$props.filter!==void 0?this.$props.filter:this.currentText,{focusedType:O}=this.getFocusedState(),N=h&&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:U.plusIcon,style:{float:"right"}},null)])]);return this.group===void 0&&this.$props.groupField!==void 0&&(this.group=m.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:{...R,anchor:this.anchor,show:L,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,popupClass:a.classNames(R.popupClass,"k-list",{[`k-list-${P[o]||o}`]:o,"k-virtual-list":this.base.vs.enabled}),className:a.classNames("k-list-container",R.className)},itemsCount:x.length},{default:()=>[F&&l.createVNode("div",{class:"k-list-header"},[F]),N,this.group&&x.length!==0&&l.createVNode(G.GroupStickyHeader,{group:this.group,render:S},null),z.call(this),k&&l.createVNode("div",{class:"k-list-footer"},[k]),u&&K]})},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:g,fillMode:f},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:U.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=_.toLanguageString(T.adaptiveModeFooterCancel,T.messages[T.adaptiveModeFooterCancel]),h=_.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},A(c)?c:{default:()=>[c]}),l.createVNode(E.Button,{themeColor:"primary",size:"large","aria-label":h,"aria-disabled":"false",type:"button",onClick:this.handleWrapperClick},A(h)?h:{default:()=>[h]})]},pe=a.templateRendering.call(this,ce,a.getListeners.call(this)),he=()=>{const c=this.base.getTemplateDef.call(this,K,l.h),h=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(G.GroupStickyHeader,{group:this.group,render:S},null),z.call(this),h&&l.createVNode("div",{class:"k-list-footer"},[h])])])},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[g]||g}`]:g,[`k-input-${f}`]:f,"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:m.preventDefaultNonInputs},[l.createVNode(be.TagList,{removeTagIcon:C,tagsRounded:v,size:o,fillMode:f,tagRender:ie,onTagdelete:this.onTagDelete,dataItems:I,guid:this.base.guid,focused:D?I.find(h=>J(h,D,d)):void 0},A(c=ae.call(this,H))?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?H?l.createVNode("label",{for:H,class:"k-floating-label"},[this.$props.label]):l.createVNode("span",{class:"k-label"},[this.$props.label]):null]):W}});exports.MultiSelect=Oe;
|
|
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"),G=require("../common/GroupStickyHeader.js"),ke=require("../common/ClearButton.js"),L=require("../common/settings.js"),m=require("../common/utils.js"),U=require("@progress/kendo-svg-icons"),H=require("@progress/kendo-vue-buttons"),Y=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:E,roundedMap:Fe}=a.kendoThemeMaps;function M(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||m.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:e=>!0,"update:modelValue":e=>!0,filterchange:e=>!0,change:e=>!0,pagechange:e=>!0,focus:e=>!0,blur:e=>!0,open:e=>!0,close:e=>!0,scroll:e=>!0},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,validator:function(e){return["none","small","medium","large","full"].includes(e)}},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)}},size:{type:String,validator:function(e){return["none","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||m.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<=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}},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},adaptiveModeBreakpoints:{default:{small:Y.MOBILE_SMALL_DEVICE,medium:Y.MOBILE_MEDIUM_DEVICE}}},data(){return{hasMounted:!1,currentText:"",currentValue:"",currentFocused:!1,currentOpened:!1,currentFocusedIndex:void 0,currentFocusedTag:void 0,searchState:{word:"",last:""},suggested:"",activedescendant:L.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 g;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,f=this.$refs.scrollElement;if(o&&(this.base.vs.list=o.list,this.base.list=o.list),f&&(this.base.vs.scrollElement=f),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=(g=this.base.getGroupedDataModernMode(s,t))==null?void 0:g.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=>m.getItemValue(r,e)===i);return this.dataItems[n]||i})},primitiveValue(){const e=this.computedValue(),t=e.map(s=>m.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(g=>m.areSame(g,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();m.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),f=this.base,g=f.vs;if(n&&t===a.Keys.up&&o)this.currentFocusedIndex!==void 0&&(e.data.currentFocusedIndex=void 0);else{const v=f.navigation.navigate({keyCode:t,current:u,max:(g.enabled?g.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=L.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;m.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();m.removeDataItems(o,n[d].data,r),this.triggerOnChange(o,t)}}else if(s===a.Keys.backspace){const o=this.computedValue();if(p)m.removeDataItems(o,n[d].data,r),this.triggerOnChange(o,t);else if(!p&&n.length){const f=n.pop();m.removeDataItems(o,f.data,r),this.triggerOnChange(o,t)}}u!==i&&(t.data.currentFocusedTag=u,t.data.activedescendant=L.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=m.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 f=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(f.length){const g=f[f.length-1];return o=i.findIndex(v=>m.areSame(v,g,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){var g;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=s&&((g=s.querySelector(".k-list-item"))==null?void 0:g.offsetHeight)||0,p=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:u),f=e.target.scrollTop-t.skip*p;n&&(r=this.base.getGroupedDataModernMode(r,n),r=this.base.getGroupedDataModernMode(r,n),d=r[0][n]);for(let v=1;v<r.length&&!(p*v>f);v++)r[v]&&r[v][n]&&(d=r[v][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:f,rounded:g,tagsRounded:v,removeTagIcon:C,adaptiveTitle:X,header:w,footer:P,inputAttributes:Z,groupStickyHeaderItemRender:ee,dataItems:x=[]}=this.$props,te=this.currentFocused,N=Object.assign({},{animate:!0,height:"200px"},this.$props.popupSettings),R=this.currentFocusedTag,q=this.computedValue(),D=(this.$props.filter!==void 0?this.$props.filter:this.currentText)||"",se=!p&&(!!D||q.length>0),y=this.base.vs,A=this.$props.id||this.inputId,ie=a.templateRendering.call(this,this.$props.tagRender,a.getListeners.call(this)),B=this.isOpen,$=this.adaptiveState,j=$e.provideLocalizationService(this);this.group===void 0&&this.$props.groupField!==void 0&&(this.group=m.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(h=>{I.push({text:m.getItemValue(h,r),data:[h]})}):n===void 0?this.computedValue().forEach(c=>{I.push({text:m.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 h=this.activedescendant,{placeholder:S}=this.$props,{focusedIndex:F}=this.getFocusedState(),k=I.length===0||q.length===0&&!D?S:void 0,V=h===L.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:B,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)},_=function(){let c;const{groupField:h}=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 W=x;return h&&(W=this.base.getGroupedDataModernMode(x,h)),l.createVNode(Ie.List,{id:this.base.listBoxId,show:B,dataItems:W.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:h,onScroll:this.onScroll},M(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:h}=this.$props,S=a.templateRendering.call(this,this.$props.groupStickyHeaderItemRender,a.getListeners.call(this)),F=c.getTemplateDef.call(this,w),k=c.getTemplateDef.call(this,P),V=this.$props.filter!==void 0?this.$props.filter:this.currentText,{focusedType:O}=this.getFocusedState(),K=h&&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:U.plusIcon,style:{float:"right"}},null)])]);return this.group===void 0&&this.$props.groupField!==void 0&&(this.group=m.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:B,onOpen:this.onPopupOpened,onClose:this.onPopupClosed,popupClass:a.classNames(N.popupClass,"k-list",{[`k-list-${E[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(G.GroupStickyHeader,{group:this.group,render:S},null),_.call(this),k&&l.createVNode("div",{class:"k-list-footer"},[k]),u&&w]})},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:g,fillMode:f},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(H.Button,{tabIndex:5,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.onCancel,icon:"x",svgIcon:U.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]),h=j.toLanguageString(T.adaptiveModeFooterApply,T.messages[T.adaptiveModeFooterApply]);return[l.createVNode(H.Button,{size:"large","aria-label":c,"aria-disabled":"false",type:"button",onClick:this.onCancel},M(c)?c:{default:()=>[c]}),l.createVNode(H.Button,{themeColor:"primary",size:"large","aria-label":h,"aria-disabled":"false",type:"button",onClick:this.handleWrapperClick},M(h)?h:{default:()=>[h]})]},pe=a.templateRendering.call(this,ce,a.getListeners.call(this)),he=()=>{const c=this.base.getTemplateDef.call(this,w,l.h),h=this.base.getTemplateDef.call(this,P,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-${E[o]||o}`]:$?!1:o,"k-list-lg":!!$,"k-virtual-list":y.enabled})},[this.group&&x.length!==0&&l.createVNode(G.GroupStickyHeader,{group:this.group,render:S},null),_.call(this),h&&l.createVNode("div",{class:"k-list-footer"},[h])])])},fe=a.templateRendering.call(this,he,a.getListeners.call(this)),ge=function(){return l.createVNode(Ce.ActionSheet,{expand:B,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-${E[o]||o}`]:o,[`k-rounded-${Fe[g]||g}`]:g,[`k-input-${f}`]:f,"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:m.preventDefaultNonInputs},[l.createVNode(be.TagList,{removeTagIcon:C,tagsRounded:v,size:o,fillMode:f,tagRender:ie,onTagdelete:this.onTagDelete,dataItems:I,guid:this.base.guid,focused:R?I.find(h=>J(h,R,d)):void 0},M(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)])},z=[l.h(me.call(this),{...this.$attrs}),$&&ge.call(this)];return t?l.createVNode("span",{class:this.spanClassNames,dir:this.$props.dir},[z,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]):z}});exports.MultiSelect=Oe;
|
|
@@ -5,29 +5,29 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as $e, h as
|
|
9
|
-
import { templateRendering as b, getListeners as I, Keys as f, canUseDOM as Oe, getRef as X, guid as Z, classNames as
|
|
10
|
-
import { ListContainer as
|
|
11
|
-
import { List as
|
|
8
|
+
import { defineComponent as $e, h as _, createVNode as l, ref as Q, inject as Fe, isVNode as Te } from "vue";
|
|
9
|
+
import { templateRendering as b, getListeners as I, Keys as f, canUseDOM as Oe, getRef as X, guid as Z, classNames as R, kendoThemeMaps as Ve, setRef as we, Icon as Re } from "@progress/kendo-vue-common";
|
|
10
|
+
import { ListContainer as De } from "../common/ListContainer.mjs";
|
|
11
|
+
import { List as Be } from "../common/List.mjs";
|
|
12
12
|
import { TagList as Me } from "./TagList.mjs";
|
|
13
13
|
import { SearchBar as Ae } from "../common/SearchBar.mjs";
|
|
14
14
|
import Le from "../common/DropDownBase.mjs";
|
|
15
15
|
import { GroupStickyHeader as ee } from "../common/GroupStickyHeader.mjs";
|
|
16
16
|
import { ClearButton as He } from "../common/ClearButton.mjs";
|
|
17
|
-
import { ActiveDescendant as
|
|
18
|
-
import { getItemValue as
|
|
17
|
+
import { ActiveDescendant as L } from "../common/settings.mjs";
|
|
18
|
+
import { getItemValue as x, itemIndexStartsWith as Ee, areSame as te, removeDataItems as H, isPresent as Pe, preventDefaultNonInputs as Ne, matchDataCollections as Ke } from "../common/utils.mjs";
|
|
19
19
|
import { xIcon as _e, plusIcon as je } from "@progress/kendo-svg-icons";
|
|
20
|
-
import { Button as
|
|
20
|
+
import { Button as j } from "@progress/kendo-vue-buttons";
|
|
21
21
|
import { MOBILE_MEDIUM_DEVICE as ze, MOBILE_SMALL_DEVICE as We } from "../common/constants.mjs";
|
|
22
22
|
import { ActionSheet as Ge } from "@progress/kendo-vue-layout";
|
|
23
23
|
import { ListFilter as qe } from "../common/ListFilter.mjs";
|
|
24
24
|
import { provideLocalizationService as Ue } from "@progress/kendo-vue-intl";
|
|
25
25
|
import { adaptiveModeFooterCancel as se, messages as ie, adaptiveModeFooterApply as ne } from "../messages/main.mjs";
|
|
26
26
|
const {
|
|
27
|
-
sizeMap:
|
|
27
|
+
sizeMap: z,
|
|
28
28
|
roundedMap: Ye
|
|
29
|
-
} =
|
|
30
|
-
function
|
|
29
|
+
} = Ve;
|
|
30
|
+
function E(e) {
|
|
31
31
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Te(e);
|
|
32
32
|
}
|
|
33
33
|
const Je = "Please enter a valid value!", Qe = (e) => e.preventDefault(), ae = (e, t, s) => !!e != !!t || e.text !== t.text ? !1 : e === t || Ke(e.data, t.data, s), oe = (e) => e === S.CustomItem;
|
|
@@ -182,7 +182,7 @@ const vt = /* @__PURE__ */ $e({
|
|
|
182
182
|
},
|
|
183
183
|
computed: {
|
|
184
184
|
spanClassNames() {
|
|
185
|
-
const e = !this.hasMounted || !this.$props.validityStyles || this.validity().valid, t = this.currentText ||
|
|
185
|
+
const e = !this.hasMounted || !this.$props.validityStyles || this.validity().valid, t = this.currentText || x(this.computedValue()[0], this.$props.textField);
|
|
186
186
|
return {
|
|
187
187
|
"k-floating-label-container": !0,
|
|
188
188
|
"k-focus": this.currentFocused,
|
|
@@ -236,7 +236,7 @@ const vt = /* @__PURE__ */ $e({
|
|
|
236
236
|
last: ""
|
|
237
237
|
},
|
|
238
238
|
suggested: "",
|
|
239
|
-
activedescendant:
|
|
239
|
+
activedescendant: L.PopupList,
|
|
240
240
|
group: void 0,
|
|
241
241
|
isScrolling: !1,
|
|
242
242
|
itemHeight: 0,
|
|
@@ -297,12 +297,12 @@ const vt = /* @__PURE__ */ $e({
|
|
|
297
297
|
},
|
|
298
298
|
findByFieldValue(e, t) {
|
|
299
299
|
return t.map((i) => {
|
|
300
|
-
const n = this.dataItems.findIndex((o) =>
|
|
300
|
+
const n = this.dataItems.findIndex((o) => x(o, e) === i);
|
|
301
301
|
return this.dataItems[n] || i;
|
|
302
302
|
});
|
|
303
303
|
},
|
|
304
304
|
primitiveValue() {
|
|
305
|
-
const e = this.computedValue(), t = e.map((s) =>
|
|
305
|
+
const e = this.computedValue(), t = e.map((s) => x(s, this.valueField));
|
|
306
306
|
return this.valuePrimitive ? t : e;
|
|
307
307
|
},
|
|
308
308
|
validity() {
|
|
@@ -326,7 +326,7 @@ const vt = /* @__PURE__ */ $e({
|
|
|
326
326
|
const s = this.isOpen, i = this.base.initState();
|
|
327
327
|
i.event = t, s && this.base.togglePopup(i), this.currentFocused || (i.data.currentFocused = !0);
|
|
328
328
|
const n = this.computedValue();
|
|
329
|
-
|
|
329
|
+
H(n, e, this.$props.dataItemKey), this.triggerOnChange(n, i), this.applyState(i);
|
|
330
330
|
},
|
|
331
331
|
onNavigate(e, t) {
|
|
332
332
|
const {
|
|
@@ -357,7 +357,7 @@ const vt = /* @__PURE__ */ $e({
|
|
|
357
357
|
} = this.$props, o = n ? n.skip : 0, r = this.$props.filter !== void 0 ? this.$props.filter : this.currentText, {
|
|
358
358
|
focusedIndex: d
|
|
359
359
|
} = this.getFocusedState(), c = i && r, a = s[e - o];
|
|
360
|
-
a && d !== e ? this.currentFocusedIndex !== e && (t.data.currentFocusedIndex = e, t.data.activedescendant =
|
|
360
|
+
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);
|
|
361
361
|
},
|
|
362
362
|
searchBarRef() {
|
|
363
363
|
this.input && this.currentFocused && setTimeout(() => this.input.focus(), 0);
|
|
@@ -399,18 +399,18 @@ const vt = /* @__PURE__ */ $e({
|
|
|
399
399
|
else if (s === f.delete) {
|
|
400
400
|
if (c) {
|
|
401
401
|
const a = this.computedValue();
|
|
402
|
-
|
|
402
|
+
H(a, n[r].data, o), this.triggerOnChange(a, t);
|
|
403
403
|
}
|
|
404
404
|
} else if (s === f.backspace) {
|
|
405
405
|
const a = this.computedValue();
|
|
406
406
|
if (c)
|
|
407
|
-
|
|
407
|
+
H(a, n[r].data, o), this.triggerOnChange(a, t);
|
|
408
408
|
else if (!c && n.length) {
|
|
409
409
|
const h = n.pop();
|
|
410
|
-
|
|
410
|
+
H(a, h.data, o), this.triggerOnChange(a, t);
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
d !== i && (t.data.currentFocusedTag = d, t.data.activedescendant =
|
|
413
|
+
d !== i && (t.data.currentFocusedTag = d, t.data.activedescendant = L.TagsList), this.applyState(t);
|
|
414
414
|
},
|
|
415
415
|
triggerOnChange(e, t) {
|
|
416
416
|
this.$props.value === void 0 && (t.data.currentValue = [...e]), this.valuesItemsDuringOnChange = [], this.setItems(e, this.valuesItemsDuringOnChange), t.events.push({
|
|
@@ -596,25 +596,25 @@ const vt = /* @__PURE__ */ $e({
|
|
|
596
596
|
tagsRounded: m,
|
|
597
597
|
removeTagIcon: $,
|
|
598
598
|
adaptiveTitle: re,
|
|
599
|
-
header:
|
|
600
|
-
footer:
|
|
599
|
+
header: P,
|
|
600
|
+
footer: W,
|
|
601
601
|
inputAttributes: le,
|
|
602
602
|
groupStickyHeaderItemRender: de,
|
|
603
603
|
dataItems: F = []
|
|
604
|
-
} = this.$props, ue = this.currentFocused,
|
|
604
|
+
} = this.$props, ue = this.currentFocused, D = Object.assign({}, {
|
|
605
605
|
animate: !0,
|
|
606
606
|
height: "200px"
|
|
607
|
-
}, this.$props.popupSettings),
|
|
608
|
-
this.group === void 0 && this.$props.groupField !== void 0 && (this.group =
|
|
607
|
+
}, this.$props.popupSettings), B = this.currentFocusedTag, G = this.computedValue(), M = (this.$props.filter !== void 0 ? this.$props.filter : this.currentText) || "", ce = !c && (!!M || G.length > 0), y = this.base.vs, N = this.$props.id || this.inputId, pe = b.call(this, this.$props.tagRender, I.call(this)), A = this.isOpen, T = this.adaptiveState, q = Ue(this);
|
|
608
|
+
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);
|
|
609
609
|
let v = [];
|
|
610
610
|
this.initialAdaptiveRenderingValues ? [...this.initialAdaptiveRenderingValues].forEach((p) => {
|
|
611
611
|
v.push({
|
|
612
|
-
text:
|
|
612
|
+
text: x(p, o),
|
|
613
613
|
data: [p]
|
|
614
614
|
});
|
|
615
615
|
}) : n === void 0 ? this.computedValue().forEach((u) => {
|
|
616
616
|
v.push({
|
|
617
|
-
text:
|
|
617
|
+
text: x(u, o),
|
|
618
618
|
data: [u]
|
|
619
619
|
});
|
|
620
620
|
}) : v.push(...n), v.length > 0 && this.setItems(v, this._tags);
|
|
@@ -623,63 +623,63 @@ const vt = /* @__PURE__ */ $e({
|
|
|
623
623
|
placeholder: k
|
|
624
624
|
} = this.$props, {
|
|
625
625
|
focusedIndex: O
|
|
626
|
-
} = this.getFocusedState(),
|
|
626
|
+
} = this.getFocusedState(), C = v.length === 0 || G.length === 0 && !M ? k : void 0, V = p === L.TagsList && B !== void 0 ? `tag-${this.base.guid}-${B.text.replace(/\s+/g, "-")}` : `option-${this.base.guid}-${O}`;
|
|
627
627
|
return l(Ae, {
|
|
628
628
|
id: u,
|
|
629
|
-
size: Math.max((
|
|
629
|
+
size: Math.max((C || "").length, M.length, 1),
|
|
630
630
|
tabIndex: this.$props.tabIndex,
|
|
631
631
|
accessKey: this.$props.accessKey,
|
|
632
|
-
placeholder:
|
|
633
|
-
value: T ? "" :
|
|
632
|
+
placeholder: C,
|
|
633
|
+
value: T ? "" : M,
|
|
634
634
|
onChange: this.onChangeHandler,
|
|
635
635
|
onBlur: this.handleBlur,
|
|
636
636
|
onKeydown: this.onInputKeyDown,
|
|
637
|
-
ref: (
|
|
638
|
-
this.inputRef =
|
|
637
|
+
ref: (w) => {
|
|
638
|
+
this.inputRef = w;
|
|
639
639
|
},
|
|
640
640
|
disabled: i,
|
|
641
|
-
expanded:
|
|
641
|
+
expanded: A,
|
|
642
642
|
owns: this.base.listBoxId,
|
|
643
|
-
activedescendant:
|
|
644
|
-
ariaDescribedBy:
|
|
643
|
+
activedescendant: V,
|
|
644
|
+
"aria-describedBy": `tagslist-${this.base.guid}${this.$props.ariaDescribedBy ? " " + this.$props.ariaDescribedBy : ""}`,
|
|
645
645
|
"aria-labelledBy": this.$props.ariaLabelledBy,
|
|
646
646
|
"aria-label": this.$props.ariaLabel,
|
|
647
647
|
inputAttributes: le
|
|
648
648
|
}, null);
|
|
649
|
-
},
|
|
649
|
+
}, U = function() {
|
|
650
650
|
let u;
|
|
651
651
|
const {
|
|
652
652
|
groupField: p
|
|
653
|
-
} = this.$props, k = b.call(this, this.$props.itemRender, I.call(this)), O = b.call(this, this.$props.groupHeaderItemRender, I.call(this)),
|
|
654
|
-
focusedIndex:
|
|
655
|
-
} = this.getFocusedState(),
|
|
656
|
-
let
|
|
657
|
-
return p && (
|
|
653
|
+
} = this.$props, k = b.call(this, this.$props.itemRender, I.call(this)), O = b.call(this, this.$props.groupHeaderItemRender, I.call(this)), C = b.call(this, this.$props.listNoDataRender, I.call(this)), V = d ? d.skip : 0, {
|
|
654
|
+
focusedIndex: w
|
|
655
|
+
} = this.getFocusedState(), K = `translateY(${y.translate}px)`;
|
|
656
|
+
let J = F;
|
|
657
|
+
return p && (J = this.base.getGroupedDataModernMode(F, p)), l(Be, {
|
|
658
658
|
id: this.base.listBoxId,
|
|
659
|
-
show:
|
|
660
|
-
dataItems:
|
|
661
|
-
focusedIndex:
|
|
659
|
+
show: A,
|
|
660
|
+
dataItems: J.slice(),
|
|
661
|
+
focusedIndex: w,
|
|
662
662
|
value: this.computedValue(),
|
|
663
663
|
textField: o,
|
|
664
664
|
valueField: r,
|
|
665
665
|
optionsGuid: this.base.guid,
|
|
666
666
|
ref: "list",
|
|
667
667
|
wrapperStyle: {
|
|
668
|
-
maxHeight: T ? void 0 :
|
|
668
|
+
maxHeight: T ? void 0 : D.height
|
|
669
669
|
},
|
|
670
670
|
wrapperCssClass: "k-list-content",
|
|
671
671
|
listStyle: y.enabled ? {
|
|
672
|
-
transform:
|
|
672
|
+
transform: K
|
|
673
673
|
} : void 0,
|
|
674
674
|
key: "listKey",
|
|
675
|
-
skip:
|
|
675
|
+
skip: V,
|
|
676
676
|
onListclick: this.handleItemClick,
|
|
677
677
|
itemRender: k,
|
|
678
678
|
groupHeaderItemRender: O,
|
|
679
|
-
noDataRender:
|
|
679
|
+
noDataRender: C,
|
|
680
680
|
groupField: p,
|
|
681
681
|
onScroll: this.onScroll
|
|
682
|
-
},
|
|
682
|
+
}, E(u = ge.call(this)) ? u : {
|
|
683
683
|
default: () => [u]
|
|
684
684
|
});
|
|
685
685
|
}, ge = function() {
|
|
@@ -690,51 +690,51 @@ const vt = /* @__PURE__ */ $e({
|
|
|
690
690
|
}, me = function() {
|
|
691
691
|
const u = this.base, {
|
|
692
692
|
allowCustom: p
|
|
693
|
-
} = this.$props, k = b.call(this, this.$props.groupStickyHeaderItemRender, I.call(this)), O = u.getTemplateDef.call(this,
|
|
694
|
-
focusedType:
|
|
695
|
-
} = this.getFocusedState(),
|
|
693
|
+
} = 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
|
+
focusedType: w
|
|
695
|
+
} = this.getFocusedState(), K = p && V && l("div", {
|
|
696
696
|
class: "k-list",
|
|
697
697
|
key: "customitem",
|
|
698
698
|
onClick: this.customItemSelect
|
|
699
699
|
}, [l("div", {
|
|
700
|
-
class:
|
|
701
|
-
"k-focus": oe(
|
|
700
|
+
class: R("k-item k-custom-item", {
|
|
701
|
+
"k-focus": oe(w)
|
|
702
702
|
})
|
|
703
|
-
}, [
|
|
703
|
+
}, [V, l(Re, {
|
|
704
704
|
name: "plus",
|
|
705
705
|
icon: je,
|
|
706
706
|
style: {
|
|
707
707
|
float: "right"
|
|
708
708
|
}
|
|
709
709
|
}, null)])]);
|
|
710
|
-
return this.group === void 0 && this.$props.groupField !== void 0 && (this.group =
|
|
710
|
+
return this.group === void 0 && this.$props.groupField !== void 0 && (this.group = x(F[0], this.$props.groupField)), l(De, {
|
|
711
711
|
ref: "container",
|
|
712
712
|
onMousedown: Qe,
|
|
713
713
|
dir: s !== void 0 ? s : u.dirCalculated,
|
|
714
714
|
onBlur: this.handleBlur,
|
|
715
715
|
width: this.popupWidth,
|
|
716
716
|
popupSettings: {
|
|
717
|
-
...
|
|
717
|
+
...D,
|
|
718
718
|
anchor: this.anchor,
|
|
719
|
-
show:
|
|
719
|
+
show: A,
|
|
720
720
|
onOpen: this.onPopupOpened,
|
|
721
721
|
onClose: this.onPopupClosed,
|
|
722
|
-
popupClass:
|
|
723
|
-
[`k-list-${
|
|
722
|
+
popupClass: R(D.popupClass, "k-list", {
|
|
723
|
+
[`k-list-${z[a] || a}`]: a,
|
|
724
724
|
"k-virtual-list": this.base.vs.enabled
|
|
725
725
|
}),
|
|
726
|
-
className:
|
|
726
|
+
className: R("k-list-container", D.className)
|
|
727
727
|
},
|
|
728
728
|
itemsCount: F.length
|
|
729
729
|
}, {
|
|
730
730
|
default: () => [O && l("div", {
|
|
731
731
|
class: "k-list-header"
|
|
732
|
-
}, [O]),
|
|
732
|
+
}, [O]), K, this.group && F.length !== 0 && l(ee, {
|
|
733
733
|
group: this.group,
|
|
734
734
|
render: k
|
|
735
|
-
}, null),
|
|
735
|
+
}, null), U.call(this), C && l("div", {
|
|
736
736
|
class: "k-list-footer"
|
|
737
|
-
}, [
|
|
737
|
+
}, [C]), d && P]
|
|
738
738
|
});
|
|
739
739
|
}, ve = function() {
|
|
740
740
|
const u = this.$props.filter !== void 0 ? this.$props.filter : this.currentText;
|
|
@@ -757,7 +757,7 @@ const vt = /* @__PURE__ */ $e({
|
|
|
757
757
|
class: "k-actionsheet-subtitle k-text-center"
|
|
758
758
|
}, null)]), l("div", {
|
|
759
759
|
class: "k-actionsheet-actions"
|
|
760
|
-
}, [l(
|
|
760
|
+
}, [l(j, {
|
|
761
761
|
tabIndex: 5,
|
|
762
762
|
"aria-label": "Cancel",
|
|
763
763
|
"aria-disabled": "false",
|
|
@@ -769,63 +769,63 @@ const vt = /* @__PURE__ */ $e({
|
|
|
769
769
|
}, null)])]), l("div", {
|
|
770
770
|
class: "k-actionsheet-titlebar-group k-actionsheet-filter"
|
|
771
771
|
}, [ve.call(this)])], Ie = b.call(this, be, I.call(this)), Se = () => {
|
|
772
|
-
const u =
|
|
773
|
-
return [l(
|
|
772
|
+
const u = q.toLanguageString(se, ie[se]), p = q.toLanguageString(ne, ie[ne]);
|
|
773
|
+
return [l(j, {
|
|
774
774
|
size: "large",
|
|
775
775
|
"aria-label": u,
|
|
776
776
|
"aria-disabled": "false",
|
|
777
777
|
type: "button",
|
|
778
778
|
onClick: this.onCancel
|
|
779
|
-
},
|
|
779
|
+
}, E(u) ? u : {
|
|
780
780
|
default: () => [u]
|
|
781
|
-
}), l(
|
|
781
|
+
}), l(j, {
|
|
782
782
|
themeColor: "primary",
|
|
783
783
|
size: "large",
|
|
784
784
|
"aria-label": p,
|
|
785
785
|
"aria-disabled": "false",
|
|
786
786
|
type: "button",
|
|
787
787
|
onClick: this.handleWrapperClick
|
|
788
|
-
},
|
|
788
|
+
}, E(p) ? p : {
|
|
789
789
|
default: () => [p]
|
|
790
790
|
})];
|
|
791
791
|
}, ye = b.call(this, Se, I.call(this)), ke = () => {
|
|
792
|
-
const u = this.base.getTemplateDef.call(this,
|
|
792
|
+
const u = this.base.getTemplateDef.call(this, P, _), p = this.base.getTemplateDef.call(this, W, _), k = b.call(this, de, I.call(this));
|
|
793
793
|
return l("div", {
|
|
794
794
|
class: "k-list-container"
|
|
795
795
|
}, [u && l("div", {
|
|
796
796
|
class: "k-list-header"
|
|
797
797
|
}, [u]), l("div", {
|
|
798
|
-
class:
|
|
799
|
-
[`k-list-${
|
|
798
|
+
class: R("k-list", {
|
|
799
|
+
[`k-list-${z[a] || a}`]: T ? !1 : a,
|
|
800
800
|
"k-list-lg": !!T,
|
|
801
801
|
"k-virtual-list": y.enabled
|
|
802
802
|
})
|
|
803
803
|
}, [this.group && F.length !== 0 && l(ee, {
|
|
804
804
|
group: this.group,
|
|
805
805
|
render: k
|
|
806
|
-
}, null),
|
|
806
|
+
}, null), U.call(this), p && l("div", {
|
|
807
807
|
class: "k-list-footer"
|
|
808
808
|
}, [p])])]);
|
|
809
|
-
},
|
|
809
|
+
}, Ce = b.call(this, ke, I.call(this)), xe = function() {
|
|
810
810
|
return l(Ge, {
|
|
811
|
-
expand:
|
|
811
|
+
expand: A,
|
|
812
812
|
animation: !0,
|
|
813
813
|
animationStyles: this.animationStyles,
|
|
814
814
|
className: this.classNameAdaptive,
|
|
815
815
|
contentClassName: "!k-overflow-hidden",
|
|
816
816
|
footerClassName: "k-actions k-actions-stretched",
|
|
817
817
|
header: Ie,
|
|
818
|
-
content:
|
|
818
|
+
content: Ce,
|
|
819
819
|
footer: ye,
|
|
820
820
|
onClose: this.onCancel,
|
|
821
821
|
navigatableElements: ["input.k-input-inner", ".k-actionsheet-actions > button"]
|
|
822
822
|
}, null);
|
|
823
|
-
},
|
|
823
|
+
}, Y = [_(function() {
|
|
824
824
|
let u;
|
|
825
825
|
return l("span", {
|
|
826
|
-
ref:
|
|
827
|
-
class:
|
|
828
|
-
[`k-input-${
|
|
826
|
+
ref: we(this, "kendoAnchor"),
|
|
827
|
+
class: R("k-multiselect", "k-input", {
|
|
828
|
+
[`k-input-${z[a] || a}`]: a,
|
|
829
829
|
[`k-rounded-${Ye[g] || g}`]: g,
|
|
830
830
|
[`k-input-${h}`]: h,
|
|
831
831
|
"k-focus": ue && !i,
|
|
@@ -851,8 +851,8 @@ const vt = /* @__PURE__ */ $e({
|
|
|
851
851
|
onTagdelete: this.onTagDelete,
|
|
852
852
|
dataItems: v,
|
|
853
853
|
guid: this.base.guid,
|
|
854
|
-
focused:
|
|
855
|
-
},
|
|
854
|
+
focused: B ? v.find((p) => ae(p, B, r)) : void 0
|
|
855
|
+
}, E(u = fe.call(this, N)) ? u : {
|
|
856
856
|
default: () => [u]
|
|
857
857
|
}), v.length > 0 && ce && l(He, {
|
|
858
858
|
onClearclick: this.clearButtonClick
|
|
@@ -861,16 +861,16 @@ const vt = /* @__PURE__ */ $e({
|
|
|
861
861
|
}, null), !T && me.call(this)]);
|
|
862
862
|
}.call(this), {
|
|
863
863
|
...this.$attrs
|
|
864
|
-
}), T &&
|
|
864
|
+
}), T && xe.call(this)];
|
|
865
865
|
return t ? l("span", {
|
|
866
866
|
class: this.spanClassNames,
|
|
867
867
|
dir: this.$props.dir
|
|
868
|
-
}, [
|
|
869
|
-
for:
|
|
868
|
+
}, [Y, this.$props.label ? N ? l("label", {
|
|
869
|
+
for: N,
|
|
870
870
|
class: "k-floating-label"
|
|
871
871
|
}, [this.$props.label]) : l("span", {
|
|
872
872
|
class: "k-label"
|
|
873
|
-
}, [this.$props.label]) : null]) :
|
|
873
|
+
}, [this.$props.label]) : null]) : Y;
|
|
874
874
|
}
|
|
875
875
|
});
|
|
876
876
|
export {
|
package/MultiSelect/TagList.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),n=require("@progress/kendo-vue-common"),v=require("@progress/kendo-vue-buttons"),S=e=>e.preventDefault(),
|
|
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;
|