@progress/kendo-vue-dropdowns 8.0.0-develop.3 → 8.0.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 +60 -59
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +268 -218
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +91 -90
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +35 -34
- package/common/DropDownBase.js +1 -1
- package/common/DropDownBase.mjs +117 -104
- package/common/List.js +1 -1
- package/common/List.mjs +127 -79
- package/common/ListGroupItem.js +1 -1
- package/common/ListGroupItem.mjs +36 -21
- package/common/ListItem.js +1 -1
- package/common/ListItem.mjs +65 -19
- package/common/ListItemIcon.js +8 -0
- package/common/ListItemIcon.mjs +34 -0
- package/common/utils.js +1 -1
- package/common/utils.mjs +53 -54
- package/dist/cdn/js/kendo-vue-dropdowns.js +1 -1
- package/index.d.mts +37 -0
- package/index.d.ts +37 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
|
@@ -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 n=require("vue"),i=require("@progress/kendo-vue-common"),E=require("@progress/kendo-vue-buttons"),ce=require("../common/ListContainer.js"),he=require("../common/ListFilter.js"),fe=require("../common/ListDefaultItem.js"),ge=require("../common/List.js"),me=require("../common/DropDownBase.js"),P=require("../common/GroupStickyHeader.js"),F=require("../messages/main.js"),ve=require("@progress/kendo-vue-intl"),_=require("../common/constants.js"),be=require("@progress/kendo-vue-layout"),p=require("../common/utils.js"),j=require("@progress/kendo-svg-icons"),{sizeMap:L,roundedMap:ye}=i.kendoThemeMaps;function Ie(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!n.isVNode(e)}const Se="Please select a value from the list!",ke=n.defineComponent({name:"KendoDropDownList",model:{event:"changemodel"},props:{id:String,title:String,dataItemKey:{type:[Object,String]},defaultValue:{type:[String,Object,Number,Boolean],default:void 0},name:String,modelValue:{type:[String,Object,Number,Boolean],default:void 0},value:{type:[String,Object,Number,Boolean],default:void 0},label:{type:String},required:{type:Boolean,default:!1},leftRightKeysNavigation:{type:Boolean,default:!0},valid:{type:Boolean,default:void 0},validate:{type:Boolean},validationMessage:{type:String,default:void 0},validityStyles:{type:Boolean,default:!0},delay:{type:Number,default:500},ignoreCase:{type:Boolean,default:!0},icon:String,svgIcon:Object,iconClassName:String,defaultItem:[Object,String],valueRender:[String,Function,Object],valueMap:Function,opened:{type:Boolean,default:void 0},disabled:Boolean,dir:{type:String,default:void 0},tabIndex:{type:Number,default:0},accessKey:String,dataItems:Array,textField:String,valueField:String,valuePrimitive:Boolean,className:String,loading:Boolean,popupSettings:{type:Object,default:{animate:!0,height:"200px",anchor:""}},itemRender:[String,Function,Object],groupHeaderItemRender:[String,Function,Object],groupStickyHeaderItemRender:[String,Function,Object],listNoDataRender:[String,Function,Object],focusedItemIndex:Function,header:[String,Function,Object],footer:[String,Function,Object],filterable:Boolean,filter:{type:String,default:void 0},virtual:{type:Object,default:void 0},ariaLabelledBy:String,ariaLabel:String,ariaDescribedBy:String,rounded:{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["small","medium","large"].includes(e)}},groupField:{type:String},adaptive:{type:Boolean,default:void 0},adaptiveTitle:{type:String,default:void 0},onChange:Function},inject:{kendoLocalizationService:{default:null},adaptiveModeBreakpoints:{default:{small:_.MOBILE_SMALL_DEVICE,medium:_.MOBILE_MEDIUM_DEVICE}}},data(){return{hasMounted:!1,currentText:"",currentValue:"",currentFocused:!1,currentOpened:!1,searchState:{word:"",last:""},_skipFocusEvent:!1,valueDuringOnChange:{},_navigated:!1,group:void 0,isScrolling:!1,itemHeight:0,state:void 0,popupWidth:void 0,windowWidth: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),this.virtualHasChanged=!0},isOpen:function(){setTimeout(()=>{const e=document.querySelector(".k-list-item");this.itemHeight=this.base.getListItemHeight(e)},100)}},created(){this.observer=null,this.valueDuringOnChange=void 0,this.currentText=void 0,this.currentValue=void 0,this.prevCurrentValue=this.computedValue(),this.currentFocused=void 0,this.currentOpened=void 0,this.base=new me(this),this.anchor=i.guid(),this.inputId=i.guid()},setup(){const e=n.ref(null),t=n.ref(null),a=n.ref(null);return{selectRef:e,baseWrapperRef:t,kendoAnchorRef:a}},mounted(){this.observer=i.canUseDOM&&window.ResizeObserver&&new ResizeObserver(this.calculateMedia),document!=null&&document.body&&this.observer&&this.observer.observe(document.body),this.hasMounted=!0,this.select=i.getRef(this,"select"),this.base.wrapper=i.getRef(this,"kendoAnchor"),this.base.didMount(),this.setValidity()},updated(){var I;const{dataItems:e=[],dataItemKey:t,virtual:a,groupField:r,textField:o}=this.$props,s=this.isOpen,d=this.prevOpened!==void 0?this.prevOpened:this.prevCurrentOpened,l=!d&&s,u=this.$refs.list,f=this.$refs.filterInput,c=this.$refs.scrollElement;if(this.$refs.scroller,u&&(this.base.vs.list=u.list,this.base.list=u.list),c&&(this.base.vs.scrollElement=c),f&&(this.filterInput=f),u&&e.length&&this.base.vs.scrollerRef(u.$el),this.$props.popupSettings.animate||l&&this.onPopupOpened(),a&&this.virtualTotalHasChanged)this.base.vs.calcScrollElementHeight(),this.base.vs.reset(),this.virtualTotalHasChanged=!1;else{const v=this.computedValue(),m=this.prevCurrentValue;let h=e.findIndex(b=>p.areSame(b,v,t));r&&(h=(I=this.base.getGroupedDataModernMode(e,r))==null?void 0:I.indexOf(v));const S=!p.areSame(m,v,t);l&&a?(this.base.scrollToVirtualItem(a,h),this.prevCurrentOpened=!0):l&&!a?(e&&e.length!==0&&this.base.resetGroupStickyHeader(e[0][r],this),this.base.scrollToItem(h),this.prevCurrentOpened=!0):s&&d&&v&&S&&!this._navigated?this.base.scrollToItem(h):s&&d&&this._navigated&&(this._navigated&&a&&a.skip===0?this.base.vs.reset():this._navigated&&a&&a.skip===a.total-a.pageSize&&this.base.vs.scrollToEnd())}this._navigated=!1,this.prevCurrentValue=this.computedValue(),this.setValidity()},computed:{index(){const{dataItems:e=[],dataItemKey:t}=this.$props,a=this.computedValue();return e.findIndex(r=>p.areSame(r,a,t))},spanClassNames(){const e=!this.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-floating-label-container":!0,"k-focus":this.currentFocused,"k-empty":!this.computedValue(),"k-invalid":!e&&e!==void 0,"k-rtl":this.$props.dir==="rtl"}},dropDownListId(){return`value-${this.base.guid}${this.$props.ariaDescribedBy?" "+this.$props.ariaDescribedBy:""}`},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}},methods:{focus(){this.base.wrapper&&this.base.wrapper.focus()},computedValue(){let e;return this.valueDuringOnChange!==void 0?e=this.valueDuringOnChange:this.$props.value!==void 0?e=this.$props.value:this.$props.modelValue!==void 0?e=this.$props.modelValue:this.currentValue!==void 0?e=this.currentValue:this.$props.defaultValue!==void 0&&(e=this.$props.defaultValue),!p.isPresent(e)&&this.$props.defaultItem!==void 0&&(e=this.$props.defaultItem),this.valuePrimitive&&this.findByFieldValue(this.valueField,e)||e},findByFieldValue(e,t){const a=this.dataItems.findIndex(r=>p.getItemValue(r,e)===t);return this.dataItems[a]},primitiveValue(){const e=this.computedValue();return this.valuePrimitive?p.getItemValue(e,this.valueField):e},validity(){const e=this.$props.validationMessage!==void 0,t=!this.$props.required||this.computedValue()!==null&&this.computedValue()!==""&&this.computedValue()!==void 0,a=this.$props.valid!==void 0?this.$props.valid:t;return{customError:e,valid:a,valueMissing:this.computedValue()===null}},handleItemSelect(e,t){const{dataItems:a=[],virtual:r,dataItemKey:o,defaultItem:s}=this.$props,d=r?r.skip:0,l=e===-1&&s!==void 0?s:a[e-d],u=!p.areSame(l,this.computedValue(),o);this.triggerOnChange(l,t),u&&this.base.triggerPageChangeCornerItems(l,t)},onNavigate(e,t){const{dataItems:a=[],defaultItem:r,dataItemKey:o,virtual:s={skip:0,total:0,pageSize:0}}=this.$props,d=this.base.vs,l=this.computedValue(),u=a.findIndex(c=>p.areSame(c,l,o)),f=this.base.navigation.navigate({current:s.skip+u,max:(d.enabled?s.total:a.length)-1,min:r!==void 0?-1:0,keyCode:t});f!==void 0&&this.handleItemSelect(f,e),this.applyState(e)},search(e){clearTimeout(this.typingTimeout),this.$props.filterable||(this.typingTimeout=setTimeout(()=>this.searchState.word="",this.$props.delay),this.selectNext(e))},selectNext(e){const{dataItems:t=[],dataItemKey:a}=this.$props;let r=t.map((b,x)=>({item:b,itemIndex:x}));const o=this.searchState.word,s=this.searchState.last,d=p.sameCharsOnly(o,s);let l=r.length,u=Math.max(0,t.findIndex(b=>p.areSame(b,this.computedValue(),a))),f;this.$props.defaultItem&&(f={item:this.$props.defaultItem,itemIndex:-1},l+=1,u+=1),u+=d?1:0,r=p.shuffleData(r,u,f);let c,I,v,m=0;const{textField:h,ignoreCase:S}=this.$props;for(;m<l;){if(c=p.getItemValue(r[m].item,h),I=d&&p.matchText(c,s,S),v=p.matchText(c,o,S),I||v){m=r[m].itemIndex;break}m++}if(m!==l){const b=this.base.initState();b.event=e,this.handleItemSelect(m,b),this.applyState(b),this.valueDuringOnChange=void 0}},handleKeyDown(e){this.isScrolling&&(this.isScrolling=!1);const{dataItems:t=[],leftRightKeysNavigation:a,filterable:r,disabled:o,virtual:s={skip:0,total:0,pageSize:0}}=this.$props,d=this.isOpen,l=e.keyCode,u=l===i.Keys.home||l===i.Keys.end,f=l===i.Keys.up||l===i.Keys.down,c=!d&&(e.altKey&&l===i.Keys.down||l===i.Keys.enter||l===i.Keys.space),I=d&&(e.altKey&&l===i.Keys.up||l===i.Keys.esc),v=a&&(l===i.Keys.left||l===i.Keys.right),m=f||!r&&(v||u),h=this.base.initState();if(h.event=e,!o){if(u&&this.base.vs.enabled)l===i.Keys.home?s.skip!==0?(this.base.triggerOnPageChange(h,0,s.pageSize),this._navigated=!0):this.triggerOnChange(t[0],h):s.skip<s.total-s.pageSize?(this.base.triggerOnPageChange(h,s.total-s.pageSize,s.pageSize),this._navigated=!0):this.triggerOnChange(t[t.length-1],h);else if(d&&l===i.Keys.enter){const S=this.focusedIndex();S!==void 0&&this.handleItemSelect(S,h),this.base.togglePopup(h),e.preventDefault()}else c||I?(this.adaptiveState&&this.handleWrapperClick(e),this.base.togglePopup(h),e.preventDefault()):m&&(this.onNavigate(h,l),e.preventDefault());this.applyState(h)}},handleItemClick(e,t){this.base.handleItemClick(e,t),this.valueDuringOnChange=void 0},handleFocus(e){this._skipFocusEvent||this.base.handleFocus(e)},handleBlur(e){if(this._skipFocusEvent||!this.currentFocused)return;const t=this.isOpen,a=this.base.initState();a.event=e,a.data.currentFocused=!1,a.events.push({type:"blur"}),t&&!this.adaptiveState&&this.base.togglePopup(a),this.applyState(a)},handleDefaultItemClick(e){const t=this.base.initState();t.event=e,this.base.togglePopup(t),this.triggerOnChange(this.$props.defaultItem,t),this.applyState(t)},handleWrapperClick(e){const t=this.base.initState();t.event=e,this.currentFocused||(t.data.currentFocused=!0),this.base.togglePopup(t),this.applyState(t)},handleKeyPress(e){if(this.$props.filterable||e.keyCode===i.Keys.enter)return;let t=String.fromCharCode(e.charCode||e.keyCode);this.$props.ignoreCase&&(t=t.toLowerCase()),t===" "&&e.preventDefault(),this.searchState={word:this.searchState.word+t,last:this.searchState.last+t},this.search(e)},handleListFilterChange(e){const t=this.base.initState();t.event=e,this.$props.filter===void 0&&(t.data.currentText=e.target.value),this.base.filterChanged(e.target.value,t),t.data.group=void 0,this.applyState(t)},onPopupOpened(){this.filterInput&&this.focusElement(this.filterInput.input)},onPopupClosed(){this.currentFocused&&setTimeout(()=>{this.currentFocused&&this.base.wrapper&&this.focusElement(this.base.wrapper)})},focusedIndex(){const e=p.isPresent(this.$props.filter)?this.$props.filter:this.currentText,{dataItems:t=[],virtual:a={skip:0},dataItemKey:r,textField:o,focusedItemIndex:s}=this.$props,d=this.computedValue(),u=!(t.findIndex(f=>p.areSame(f,d,r))<0&&!this.$props.defaultItem);return!u&&e&&a.skip===0?s?s(t,e,o):t.indexOf(p.getFocusedItem(t,e,o)):!u&&a.skip===0?0:void 0},focusElement(e){this._skipFocusEvent=!0,e.focus(),setTimeout(()=>this._skipFocusEvent=!1,30)},setValidity(){this.select&&this.select.setCustomValidity&&this.select.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||Se)},triggerOnChange(e,t){p.areSame(this.computedValue(),e,this.$props.dataItemKey)||(this.$props.value===void 0&&(this.currentValue=e),this.valueDuringOnChange=e,t.events.push({type:"change"}))},applyState(e){this.base.applyState(e),this.valueDuringOnChange=void 0},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:a}=this.base;t.scrollHandler(e);const r=this.base.initState(),{groupField:o}=this.$props;let{dataItems:s=[]}=this.$props,d;if(!o||!s.length)return;const l=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:a?a.children[0].offsetHeight:0),f=e.target.scrollTop-t.skip*l;o&&(s=this.base.getGroupedDataModernMode(s,o),d=s[0][o]);for(let c=1;c<s.length&&!(l*c>f);c++)s[c]&&s[c][o]&&(d=s[c][o]);d!==this.group&&(r.data.group=d,this.applyState(r))}},render(){const{style:e,className:t,label:a,dir:r,virtual:o={skip:0},size:s,rounded:d,fillMode:l,dataItemKey:u,dataItems:f=[],disabled:c,tabIndex:I,loading:v,icon:m,svgIcon:h,iconClassName:S,adaptiveTitle:b,header:x,footer:M,groupStickyHeaderItemRender:q}=this.$props,C=this.isOpen,z=p.getItemValue(this.computedValue(),this.$props.textField),A=!this.$props.validityStyles||this.validity().valid,k=this.base,V=k.vs,w=this.$props.id||this.inputId;V.enabled=this.$props.virtual!==void 0;const O=Object.assign({},{animate:!0,height:"200px"},this.$props.popupSettings),W=ve.provideLocalizationService(this).toLanguageString(F.selectButton,F.messages[F.selectButton]),N=this.adaptiveState;this.group===void 0&&this.$props.groupField!==void 0&&(this.group=p.getItemValue(this.$props.dataItems[0],this.$props.groupField));const G=i.templateRendering.call(this,this.$props.valueRender,i.getListeners.call(this)),U=this.currentFocused,T=this.primitiveValue(),Y=f.findIndex(g=>p.areSame(g,T,u)),J=n.createVNode("span",{class:"k-input-inner",id:this.dropDownListId},[n.createVNode("span",{class:"k-input-value-text"},[z])]);let Q=i.getTemplate.call(this,{h:n.h,template:G,defaultRendering:J,additionalProps:{value:this.computedValue(),...this.$data}});const X=function(g){return n.createVNode("select",{name:this.$props.name,id:w,ref:i.setRef(this,"select"),tabindex:-1,"aria-hidden":!0,title:this.$props.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},[n.createVNode("option",{value:this.$props.valueMap?this.$props.valueMap.call(void 0,g):g},null)])},Z=()=>[n.createVNode("div",{class:"k-actionsheet-titlebar-group k-hbox"},[n.createVNode("div",{class:"k-actionsheet-title"},[n.createVNode("div",{class:"k-text-center"},[b]),n.createVNode("div",{class:"k-actionsheet-subtitle k-text-center"},null)]),n.createVNode("div",{class:"k-actionsheet-actions"},[n.createVNode(E.Button,{tabIndex:5,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.handleWrapperClick,icon:"x",svgIcon:j.xIcon},null)])]),n.createVNode("div",{class:"k-actionsheet-titlebar-group k-actionsheet-filter"},[K.call(this)])],ee=i.templateRendering.call(this,Z,i.getListeners.call(this)),te=()=>{const g=k.getTemplateDef.call(this,x,n.h),y=k.getTemplateDef.call(this,M,n.h),$=i.templateRendering.call(this,q,i.getListeners.call(this));return n.createVNode("div",{class:"k-list-container"},[g&&n.createVNode("div",{class:"k-list-header"},[g]),n.createVNode("div",{class:i.classNames("k-list",{[`k-list-${L[s]||s}`]:N?!1:s,"k-list-lg":!!N,"k-virtual-list":V.enabled})},[B.call(this),this.group&&f.length!==0&&n.createVNode(P.GroupStickyHeader,{group:this.group,render:$},null),R.call(this),y&&n.createVNode("div",{class:"k-list-footer"},[y])])])},ie=i.templateRendering.call(this,te,i.getListeners.call(this)),se=function(){return n.createVNode(be.ActionSheet,{expand:C,animation:!0,animationStyles:this.animationStyles,className:this.classNameAdaptive,contentClassName:"!k-overflow-hidden",header:ee,content:ie,onClose:this.handleWrapperClick,navigatableElements:["input.k-input-inner",".k-actionsheet-actions > button"]},null)},B=function(){const{textField:g,defaultItem:y}=this.$props;return y!==void 0&&n.createVNode(fe.ListDefaultItem,{defaultItem:y,textField:g,selected:p.areSame(this.computedValue(),y,u),key:"defaultitemkey",onDefaultitemclick:this.handleDefaultItemClick},null)},R=function(){let g;const{textField:y,groupField:$}=this.$props;let D=this.$props.dataItems||[];const re=i.templateRendering.call(this,this.$props.itemRender,i.getListeners.call(this)),oe=i.templateRendering.call(this,this.$props.groupHeaderItemRender,i.getListeners.call(this)),de=i.templateRendering.call(this,this.$props.listNoDataRender,i.getListeners.call(this)),ue=o.skip,pe=`translateY(${V.translate}px)`;return $&&(D=this.base.getGroupedDataModernMode(D,$)),n.createVNode(ge.List,{id:this.base.listBoxId,show:C,dataItems:D.slice(),focusedIndex:this.focusedIndex(),value:this.computedValue(),textField:y,valueField:u,optionsGuid:this.base.guid,ref:"list",wrapperStyle:{maxHeight:O.height},wrapperCssClass:"k-list-content",listStyle:V.enabled?{transform:pe}:void 0,key:"listkey",skip:ue,onListclick:this.handleItemClick,itemRender:re,groupHeaderItemRender:oe,noDataRender:de,groupField:$,onScroll:this.onScroll},Ie(g=ae.call(this))?g:{default:()=>[g]})},K=function(){const g=this.$props.filter!==void 0?this.$props.filter:this.currentText;return this.$props.filterable&&n.createVNode(he.ListFilter,{value:g,ref:"filterInput",onChange:this.handleListFilterChange,onKeydown:this.handleKeyDown,size:this.$props.size,rounded:this.$props.rounded,fillMode:this.$props.fillMode,ariaControlsId:this.base.listBoxId,ariaActivedescendantId:`option-${this.base.guid}-${this.focusedIndex()}`},null)},ae=function(){return V.enabled&&n.createVNode("div",{ref:"scrollElement",key:"scrollElementKey"},null)},ne=function(){const g=i.templateRendering.call(this,this.$props.groupStickyHeaderItemRender,i.getListeners.call(this)),y=k.getTemplateDef.call(this,x),$=k.getTemplateDef.call(this,M);return n.createVNode(ce.ListContainer,{ref:"container",onMousedown:p.preventDefaultNonInputs,dir:r!==void 0?r:k.dirCalculated,width:this.popupWidth,popupSettings:{...O,popupClass:i.classNames(O.popupClass,"k-list",{[`k-list-${L[s]||s}`]:s,"k-virtual-list":this.base.vs.enabled}),className:i.classNames("k-list-container",O.className),anchor:this.anchor,show:C},onOpen:this.onPopupOpened,onClose:this.onPopupClosed,onBlur:this.handleBlur},{default:()=>[K.call(this),B.call(this),this.group&&f.length!==0&&n.createVNode(P.GroupStickyHeader,{group:this.group,render:g},null),y&&n.createVNode("div",{class:"k-list-header"},[y]),R.call(this),$&&n.createVNode("div",{class:"k-list-footer"},[$])]})};this.$props.virtual!==void 0&&(k.vs.skip=o.skip,k.vs.total=o.total,k.vs.pageSize=o.pageSize);const le=function(){return n.createVNode("span",{ref:i.setRef(this,"kendoAnchor"),class:i.classNames("k-dropdownlist k-picker",t,{[`k-picker-${L[s]||s}`]:s,[`k-rounded-${ye[d]||d}`]:d,[`k-picker-${l}`]:l,"k-focus":U,"k-disabled":c,"k-invalid":!A,"k-loading":v,"k-required":this.required}),style:a?{...e,width:void 0}:e,dir:r,onMousedown:C?p.preventDefaultNonInputs:i.noop,onFocusin:this.handleFocus,onFocusout:this.handleBlur,tabindex:i.getTabIndex(I,c),accesskey:this.$props.accessKey,onKeydown:this.handleKeyDown,onKeypress:this.handleKeyPress,role:"combobox",onClick:c?i.noop:this.handleWrapperClick,"aria-disabled":c||void 0,"aria-haspopup":!0,"aria-expanded":C||!1,"aria-owns":this.base.listBoxId,"aria-activedescendant":C?"option-"+this.base.guid+"-"+(Y+(o?o.skip:0)):void 0,"aria-label":this.$props.ariaLabel||this.$props.label,"aria-labelledby":this.$props.ariaLabelledBy,"aria-describedBy":this.dropDownListId,title:this.$props.title},[Q,v&&n.createVNode(i.Icon,{name:"loading",class:"k-input-loading-icon",key:"loading"},null),n.createVNode(E.Button,{type:"button",tabIndex:-1,size:s,fillMode:l,rounded:null,ariaLabel:W,class:"k-input-button",icon:m||"caret-alt-down",svgIcon:h||j.caretAltDownIcon,iconClass:S},null),X.call(this,T),!N&&ne.call(this)])},H=[n.h(le.call(this),{...this.$attrs}),N&&se.call(this)];return a?n.createVNode("span",{class:this.spanClassNames,onFocusin:this.handleFocus,onFocusout:this.handleBlur,dir:this.$props.dir},[H,this.$props.label?w?n.createVNode("label",{for:w,class:"k-floating-label"},[this.$props.label]):n.createVNode("span",{class:"k-label"},[this.$props.label]):null]):H}});exports.DropDownList=ke;
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),i=require("@progress/kendo-vue-common"),E=require("@progress/kendo-vue-buttons"),ce=require("../common/ListContainer.js"),he=require("../common/ListFilter.js"),fe=require("../common/ListDefaultItem.js"),ge=require("../common/List.js"),me=require("../common/DropDownBase.js"),P=require("../common/GroupStickyHeader.js"),F=require("../messages/main.js"),ve=require("@progress/kendo-vue-intl"),_=require("../common/constants.js"),be=require("@progress/kendo-vue-layout"),p=require("../common/utils.js"),j=require("@progress/kendo-svg-icons"),{sizeMap:L,roundedMap:ye}=i.kendoThemeMaps;function Ie(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!n.isVNode(e)}const Se="Please select a value from the list!",ke=n.defineComponent({name:"KendoDropDownList",model:{event:"changemodel"},props:{id:String,title:String,dataItemKey:{type:[Object,String]},defaultValue:{type:[String,Object,Number,Boolean],default:void 0},name:String,modelValue:{type:[String,Object,Number,Boolean],default:void 0},value:{type:[String,Object,Number,Boolean],default:void 0},label:{type:String},required:{type:Boolean,default:!1},leftRightKeysNavigation:{type:Boolean,default:!0},valid:{type:Boolean,default:void 0},validate:{type:Boolean},validationMessage:{type:String,default:void 0},validityStyles:{type:Boolean,default:!0},delay:{type:Number,default:500},ignoreCase:{type:Boolean,default:!0},icon:String,svgIcon:Object,iconClassName:String,defaultItem:[Object,String],valueRender:[String,Function,Object],valueMap:Function,opened:{type:Boolean,default:void 0},disabled:Boolean,dir:{type:String,default:void 0},tabIndex:{type:Number,default:0},accessKey:String,dataItems:Array,textField:String,valueField:String,valuePrimitive:Boolean,className:String,loading:Boolean,popupSettings:{type:Object,default:{animate:!0,height:"200px",anchor:""}},itemRender:[String,Function,Object],groupHeaderItemRender:[String,Function,Object],groupStickyHeaderItemRender:[String,Function,Object],listNoDataRender:[String,Function,Object],focusedItemIndex:Function,header:[String,Function,Object],footer:[String,Function,Object],filterable:Boolean,filter:{type:String,default:void 0},virtual:{type:Object,default:void 0},ariaLabelledBy:String,ariaLabel:String,ariaDescribedBy:String,rounded:{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["small","medium","large"].includes(e)}},groupField:{type:String},adaptive:{type:Boolean,default:void 0},adaptiveTitle:{type:String,default:void 0},onChange:Function},inject:{kendoLocalizationService:{default:null},adaptiveModeBreakpoints:{default:{small:_.MOBILE_SMALL_DEVICE,medium:_.MOBILE_MEDIUM_DEVICE}}},data(){return{hasMounted:!1,currentText:"",currentValue:"",currentFocused:!1,currentOpened:!1,searchState:{word:"",last:""},_skipFocusEvent:!1,valueDuringOnChange:{},_navigated:!1,group:void 0,isScrolling:!1,itemHeight:0,state:void 0,popupWidth:void 0,windowWidth: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),this.virtualHasChanged=!0},isOpen:function(){setTimeout(()=>{const e=document.querySelector(".k-list-item");this.itemHeight=this.base.getListItemHeight(e)},100)}},created(){this.observer=null,this.valueDuringOnChange=void 0,this.currentText=void 0,this.currentValue=void 0,this.prevCurrentValue=this.computedValue(),this.currentFocused=void 0,this.currentOpened=void 0,this.base=new me(this),this.anchor=i.guid(),this.inputId=i.guid()},setup(){const e=n.ref(null),t=n.ref(null),a=n.ref(null);return{selectRef:e,baseWrapperRef:t,kendoAnchorRef:a}},mounted(){this.observer=i.canUseDOM&&window.ResizeObserver&&new ResizeObserver(this.calculateMedia),document!=null&&document.body&&this.observer&&this.observer.observe(document.body),this.hasMounted=!0,this.select=i.getRef(this,"select"),this.base.wrapper=i.getRef(this,"kendoAnchor"),this.base.didMount(),this.setValidity()},updated(){var b;const{dataItems:e=[],dataItemKey:t,virtual:a,groupField:r,textField:o}=this.$props,s=this.isOpen,u=this.prevOpened!==void 0?this.prevOpened:this.prevCurrentOpened,l=!u&&s,d=this.$refs.list,f=this.$refs.filterInput,g=this.$refs.scrollElement;if(this.$refs.scroller,d&&(this.base.vs.list=d.list,this.base.list=d.list),g&&(this.base.vs.scrollElement=g),f&&(this.filterInput=f),d&&e.length&&this.base.vs.scrollerRef(d.$el),this.$props.popupSettings.animate||l&&this.onPopupOpened(),a&&this.virtualTotalHasChanged)this.base.vs.calcScrollElementHeight(),this.base.vs.reset(),this.virtualTotalHasChanged=!1;else{const c=this.computedValue(),v=this.prevCurrentValue;let h=e.findIndex(y=>p.areSame(y,c,t));r&&(h=(b=this.base.getGroupedDataModernMode(e,r))==null?void 0:b.indexOf(c));const S=!p.areSame(v,c,t);l&&a?(this.base.scrollToVirtualItem(a,h),this.prevCurrentOpened=!0):l&&!a?(e&&e.length!==0&&this.base.resetGroupStickyHeader(e[0][r],this),this.base.scrollToItem(h),this.prevCurrentOpened=!0):s&&u&&c&&S&&!this._navigated?this.base.scrollToItem(h):s&&u&&this._navigated&&(this._navigated&&a&&a.skip===0?this.base.vs.reset():this._navigated&&a&&a.skip===a.total-a.pageSize&&this.base.vs.scrollToEnd())}this._navigated=!1,this.prevCurrentValue=this.computedValue(),this.setValidity()},computed:{index(){const{dataItems:e=[],dataItemKey:t}=this.$props,a=this.computedValue();return e.findIndex(r=>p.areSame(r,a,t))},spanClassNames(){const e=!this.hasMounted||!this.$props.validityStyles||this.validity().valid;return{"k-floating-label-container":!0,"k-focus":this.currentFocused,"k-empty":!this.computedValue(),"k-invalid":!e&&e!==void 0,"k-rtl":this.$props.dir==="rtl"}},dropDownListId(){return`value-${this.base.guid}${this.$props.ariaDescribedBy?" "+this.$props.ariaDescribedBy:""}`},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}},methods:{focus(){this.base.wrapper&&this.base.wrapper.focus()},computedValue(){let e;return this.valueDuringOnChange!==void 0?e=this.valueDuringOnChange:this.$props.value!==void 0?e=this.$props.value:this.$props.modelValue!==void 0?e=this.$props.modelValue:this.currentValue!==void 0?e=this.currentValue:this.$props.defaultValue!==void 0&&(e=this.$props.defaultValue),!p.isPresent(e)&&this.$props.defaultItem!==void 0&&(e=this.$props.defaultItem),this.valuePrimitive&&this.findByFieldValue(this.valueField,e)||e},findByFieldValue(e,t){const a=this.dataItems.findIndex(r=>p.getItemValue(r,e)===t);return this.dataItems[a]},primitiveValue(){const e=this.computedValue();return this.valuePrimitive?p.getItemValue(e,this.valueField):e},validity(){const e=this.$props.validationMessage!==void 0,t=!this.$props.required||this.computedValue()!==null&&this.computedValue()!==""&&this.computedValue()!==void 0,a=this.$props.valid!==void 0?this.$props.valid:t;return{customError:e,valid:a,valueMissing:this.computedValue()===null}},handleItemSelect(e,t){const{dataItems:a=[],virtual:r,dataItemKey:o,defaultItem:s}=this.$props,u=r?r.skip:0,l=e===-1&&s!==void 0?s:a[e-u],d=!p.areSame(l,this.computedValue(),o);this.triggerOnChange(l,t),d&&this.base.triggerPageChangeCornerItems(l,t)},onNavigate(e,t){const{dataItems:a=[],defaultItem:r,dataItemKey:o,virtual:s={skip:0,total:0,pageSize:0}}=this.$props,u=this.base.vs,l=this.computedValue(),d=a.findIndex(g=>p.areSame(g,l,o)),f=this.base.navigation.navigate({current:s.skip+d,max:(u.enabled?s.total:a.length)-1,min:r!==void 0?-1:0,keyCode:t});f!==void 0&&this.handleItemSelect(f,e),this.applyState(e)},search(e){clearTimeout(this.typingTimeout),this.$props.filterable||(this.typingTimeout=setTimeout(()=>this.searchState.word="",this.$props.delay),this.selectNext(e))},selectNext(e){const{dataItems:t=[],dataItemKey:a}=this.$props;let r=t.map((y,x)=>({item:y,itemIndex:x}));const o=this.searchState.word,s=this.searchState.last,u=p.sameCharsOnly(o,s);let l=r.length,d=Math.max(0,t.findIndex(y=>p.areSame(y,this.computedValue(),a))),f;this.$props.defaultItem&&(f={item:this.$props.defaultItem,itemIndex:-1},l+=1,d+=1),d+=u?1:0,r=p.shuffleData(r,d,f);let g,b,c,v=0;const{textField:h,ignoreCase:S}=this.$props;for(;v<l;){if(g=p.getItemValue(r[v].item,h),b=u&&p.matchText(g,s,S),c=p.matchText(g,o,S),b||c){v=r[v].itemIndex;break}v++}if(v!==l){const y=this.base.initState();y.event=e,this.handleItemSelect(v,y),this.applyState(y),this.valueDuringOnChange=void 0}},handleKeyDown(e){this.isScrolling&&(this.isScrolling=!1);const{dataItems:t=[],leftRightKeysNavigation:a,filterable:r,disabled:o,virtual:s={skip:0,total:0,pageSize:0}}=this.$props,u=this.isOpen,l=e.keyCode,d=l===i.Keys.home||l===i.Keys.end,f=l===i.Keys.up||l===i.Keys.down,g=!u&&(e.altKey&&l===i.Keys.down||l===i.Keys.enter||l===i.Keys.space),b=u&&(e.altKey&&l===i.Keys.up||l===i.Keys.esc),c=a&&(l===i.Keys.left||l===i.Keys.right),v=f||!r&&(c||d),h=this.base.initState();if(h.event=e,!o){if(d&&this.base.vs.enabled)l===i.Keys.home?s.skip!==0?(this.base.triggerOnPageChange(h,0,s.pageSize),this._navigated=!0):this.triggerOnChange(t[0],h):s.skip<s.total-s.pageSize?(this.base.triggerOnPageChange(h,s.total-s.pageSize,s.pageSize),this._navigated=!0):this.triggerOnChange(t[t.length-1],h);else if(u&&l===i.Keys.enter){const S=this.focusedIndex();S!==void 0&&this.handleItemSelect(S,h),this.base.togglePopup(h),e.preventDefault()}else g||b?(this.adaptiveState&&this.handleWrapperClick(e),this.base.togglePopup(h),e.preventDefault()):v&&(this.onNavigate(h,l),e.preventDefault());this.applyState(h)}},handleItemClick(e,t){this.base.handleItemClick(e,t),this.valueDuringOnChange=void 0},handleFocus(e){this._skipFocusEvent||this.base.handleFocus(e)},handleBlur(e){if(this._skipFocusEvent||!this.currentFocused)return;const t=this.isOpen,a=this.base.initState();a.event=e,a.data.currentFocused=!1,a.events.push({type:"blur"}),t&&!this.adaptiveState&&this.base.togglePopup(a),this.applyState(a)},handleDefaultItemClick(e){const t=this.base.initState();t.event=e,this.base.togglePopup(t),this.triggerOnChange(this.$props.defaultItem,t),this.applyState(t)},handleWrapperClick(e){const t=this.base.initState();t.event=e,this.currentFocused||(t.data.currentFocused=!0),this.base.togglePopup(t),this.applyState(t)},handleKeyPress(e){if(this.$props.filterable||e.keyCode===i.Keys.enter)return;let t=String.fromCharCode(e.charCode||e.keyCode);this.$props.ignoreCase&&(t=t.toLowerCase()),t===" "&&e.preventDefault(),this.searchState={word:this.searchState.word+t,last:this.searchState.last+t},this.search(e)},handleListFilterChange(e){const t=this.base.initState();t.event=e,this.$props.filter===void 0&&(t.data.currentText=e.target.value),this.base.filterChanged(e.target.value,t),t.data.group=void 0,this.applyState(t)},onPopupOpened(){this.filterInput&&this.focusElement(this.filterInput.input)},onPopupClosed(){this.currentFocused&&setTimeout(()=>{this.currentFocused&&this.base.wrapper&&this.focusElement(this.base.wrapper)})},focusedIndex(){const e=p.isPresent(this.$props.filter)?this.$props.filter:this.currentText,{dataItems:t=[],virtual:a={skip:0},dataItemKey:r,textField:o,focusedItemIndex:s}=this.$props,u=this.computedValue(),d=!(t.findIndex(f=>p.areSame(f,u,r))<0&&!this.$props.defaultItem);return!d&&e&&a.skip===0?s?s(t,e,o):t.indexOf(p.getFocusedItem(t,e,o)):!d&&a.skip===0?0:void 0},focusElement(e){this._skipFocusEvent=!0,e.focus(),setTimeout(()=>this._skipFocusEvent=!1,30)},setValidity(){this.select&&this.select.setCustomValidity&&this.select.setCustomValidity(this.validity().valid?"":this.$props.validationMessage||Se)},triggerOnChange(e,t){p.areSame(this.computedValue(),e,this.$props.dataItemKey)||(this.$props.value===void 0&&(this.currentValue=e),this.valueDuringOnChange=e,t.events.push({type:"change"}))},applyState(e){this.base.applyState(e),this.valueDuringOnChange=void 0},calculateMedia(e){for(let t of e)this.windowWidth=t.target.clientWidth},repositionPopup(){this.base.repositionPopup()},onScroll(e){var b;this.isScrolling=!0;const{vs:t,list:a}=this.base;t.scrollHandler(e);const r=this.base.initState(),{groupField:o}=this.$props;let{dataItems:s=[]}=this.$props,u;if(!o||!s.length)return;const l=a&&((b=a.querySelector(".k-list-item"))==null?void 0:b.offsetHeight)||0,d=this.itemHeight=this.itemHeight||(t.enabled?t.itemHeight:l),g=e.target.scrollTop-t.skip*d;o&&(s=this.base.getGroupedDataModernMode(s,o),u=s[0][o]);for(let c=1;c<s.length&&!(d*c>g);c++)s[c]&&s[c][o]&&(u=s[c][o]);u!==this.group&&(r.data.group=u,this.applyState(r))}},render(){const{style:e,className:t,label:a,dir:r,virtual:o={skip:0},size:s,rounded:u,fillMode:l,dataItemKey:d,dataItems:f=[],disabled:g,tabIndex:b,loading:c,icon:v,svgIcon:h,iconClassName:S,adaptiveTitle:y,header:x,footer:M,groupStickyHeaderItemRender:q}=this.$props,C=this.isOpen,z=p.getItemValue(this.computedValue(),this.$props.textField),A=!this.$props.validityStyles||this.validity().valid,k=this.base,V=k.vs,w=this.$props.id||this.inputId;V.enabled=this.$props.virtual!==void 0;const O=Object.assign({},{animate:!0,height:"200px"},this.$props.popupSettings),W=ve.provideLocalizationService(this).toLanguageString(F.selectButton,F.messages[F.selectButton]),N=this.adaptiveState;this.group===void 0&&this.$props.groupField!==void 0&&(this.group=p.getItemValue(this.$props.dataItems[0],this.$props.groupField));const G=i.templateRendering.call(this,this.$props.valueRender,i.getListeners.call(this)),U=this.currentFocused,T=this.primitiveValue(),Y=f.findIndex(m=>p.areSame(m,T,d)),J=n.createVNode("span",{class:"k-input-inner",id:this.dropDownListId},[n.createVNode("span",{class:"k-input-value-text"},[z])]);let Q=i.getTemplate.call(this,{h:n.h,template:G,defaultRendering:J,additionalProps:{value:this.computedValue(),...this.$data}});const X=function(m){return n.createVNode("select",{name:this.$props.name,id:w,ref:i.setRef(this,"select"),tabindex:-1,"aria-hidden":!0,title:this.$props.label,style:{opacity:0,width:1,border:0,zIndex:-1,position:"absolute",left:"50%"}},[n.createVNode("option",{value:this.$props.valueMap?this.$props.valueMap.call(void 0,m):m},null)])},Z=()=>[n.createVNode("div",{class:"k-actionsheet-titlebar-group k-hbox"},[n.createVNode("div",{class:"k-actionsheet-title"},[n.createVNode("div",{class:"k-text-center"},[y]),n.createVNode("div",{class:"k-actionsheet-subtitle k-text-center"},null)]),n.createVNode("div",{class:"k-actionsheet-actions"},[n.createVNode(E.Button,{tabIndex:5,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",onClick:this.handleWrapperClick,icon:"x",svgIcon:j.xIcon},null)])]),n.createVNode("div",{class:"k-actionsheet-titlebar-group k-actionsheet-filter"},[K.call(this)])],ee=i.templateRendering.call(this,Z,i.getListeners.call(this)),te=()=>{const m=k.getTemplateDef.call(this,x,n.h),I=k.getTemplateDef.call(this,M,n.h),$=i.templateRendering.call(this,q,i.getListeners.call(this));return n.createVNode("div",{class:"k-list-container"},[m&&n.createVNode("div",{class:"k-list-header"},[m]),n.createVNode("div",{class:i.classNames("k-list",{[`k-list-${L[s]||s}`]:N?!1:s,"k-list-lg":!!N,"k-virtual-list":V.enabled})},[B.call(this),this.group&&f.length!==0&&n.createVNode(P.GroupStickyHeader,{group:this.group,render:$},null),R.call(this),I&&n.createVNode("div",{class:"k-list-footer"},[I])])])},ie=i.templateRendering.call(this,te,i.getListeners.call(this)),se=function(){return n.createVNode(be.ActionSheet,{expand:C,animation:!0,animationStyles:this.animationStyles,className:this.classNameAdaptive,contentClassName:"!k-overflow-hidden",header:ee,content:ie,onClose:this.handleWrapperClick,navigatableElements:["input.k-input-inner",".k-actionsheet-actions > button"]},null)},B=function(){const{textField:m,defaultItem:I}=this.$props;return I!==void 0&&n.createVNode(fe.ListDefaultItem,{defaultItem:I,textField:m,selected:p.areSame(this.computedValue(),I,d),key:"defaultitemkey",onDefaultitemclick:this.handleDefaultItemClick},null)},R=function(){let m;const{textField:I,groupField:$}=this.$props;let D=this.$props.dataItems||[];const re=i.templateRendering.call(this,this.$props.itemRender,i.getListeners.call(this)),oe=i.templateRendering.call(this,this.$props.groupHeaderItemRender,i.getListeners.call(this)),de=i.templateRendering.call(this,this.$props.listNoDataRender,i.getListeners.call(this)),ue=o.skip,pe=`translateY(${V.translate}px)`;return $&&(D=this.base.getGroupedDataModernMode(D,$)),n.createVNode(ge.List,{id:this.base.listBoxId,show:C,dataItems:D.slice(),focusedIndex:this.focusedIndex(),value:this.computedValue(),textField:I,valueField:d,optionsGuid:this.base.guid,ref:"list",wrapperStyle:{maxHeight:O.height},wrapperCssClass:"k-list-content",listStyle:V.enabled?{transform:pe}:void 0,key:"listkey",skip:ue,onListclick:this.handleItemClick,itemRender:re,groupHeaderItemRender:oe,noDataRender:de,groupField:$,onScroll:this.onScroll},Ie(m=ae.call(this))?m:{default:()=>[m]})},K=function(){const m=this.$props.filter!==void 0?this.$props.filter:this.currentText;return this.$props.filterable&&n.createVNode(he.ListFilter,{value:m,ref:"filterInput",onChange:this.handleListFilterChange,onKeydown:this.handleKeyDown,size:this.$props.size,rounded:this.$props.rounded,fillMode:this.$props.fillMode,ariaControlsId:this.base.listBoxId,ariaActivedescendantId:`option-${this.base.guid}-${this.focusedIndex()}`},null)},ae=function(){return V.enabled&&n.createVNode("div",{ref:"scrollElement",key:"scrollElementKey"},null)},ne=function(){const m=i.templateRendering.call(this,this.$props.groupStickyHeaderItemRender,i.getListeners.call(this)),I=k.getTemplateDef.call(this,x),$=k.getTemplateDef.call(this,M);return n.createVNode(ce.ListContainer,{ref:"container",onMousedown:p.preventDefaultNonInputs,dir:r!==void 0?r:k.dirCalculated,width:this.popupWidth,popupSettings:{...O,popupClass:i.classNames(O.popupClass,"k-list",{[`k-list-${L[s]||s}`]:s,"k-virtual-list":this.base.vs.enabled}),className:i.classNames("k-list-container",O.className),anchor:this.anchor,show:C},onOpen:this.onPopupOpened,onClose:this.onPopupClosed,onBlur:this.handleBlur},{default:()=>[K.call(this),B.call(this),this.group&&f.length!==0&&n.createVNode(P.GroupStickyHeader,{group:this.group,render:m},null),I&&n.createVNode("div",{class:"k-list-header"},[I]),R.call(this),$&&n.createVNode("div",{class:"k-list-footer"},[$])]})};this.$props.virtual!==void 0&&(k.vs.skip=o.skip,k.vs.total=o.total,k.vs.pageSize=o.pageSize);const le=function(){return n.createVNode("span",{ref:i.setRef(this,"kendoAnchor"),class:i.classNames("k-dropdownlist k-picker",t,{[`k-picker-${L[s]||s}`]:s,[`k-rounded-${ye[u]||u}`]:u,[`k-picker-${l}`]:l,"k-focus":U,"k-disabled":g,"k-invalid":!A,"k-loading":c,"k-required":this.required}),style:a?{...e,width:void 0}:e,dir:r,onMousedown:C?p.preventDefaultNonInputs:i.noop,onFocusin:this.handleFocus,onFocusout:this.handleBlur,tabindex:i.getTabIndex(b,g),accesskey:this.$props.accessKey,onKeydown:this.handleKeyDown,onKeypress:this.handleKeyPress,role:"combobox",onClick:g?i.noop:this.handleWrapperClick,"aria-disabled":g||void 0,"aria-haspopup":!0,"aria-expanded":C||!1,"aria-owns":this.base.listBoxId,"aria-activedescendant":C?"option-"+this.base.guid+"-"+(Y+(o?o.skip:0)):void 0,"aria-label":this.$props.ariaLabel||this.$props.label,"aria-labelledby":this.$props.ariaLabelledBy,"aria-describedBy":this.dropDownListId,title:this.$props.title},[Q,c&&n.createVNode(i.Icon,{name:"loading",class:"k-input-loading-icon",key:"loading"},null),n.createVNode(E.Button,{type:"button",tabIndex:-1,size:s,fillMode:l,rounded:null,ariaLabel:W,class:"k-input-button",icon:v||"caret-alt-down",svgIcon:h||j.caretAltDownIcon,iconClass:S},null),X.call(this,T),!N&&ne.call(this)])},H=[n.h(le.call(this),{...this.$attrs}),N&&se.call(this)];return a?n.createVNode("span",{class:this.spanClassNames,onFocusin:this.handleFocus,onFocusout:this.handleBlur,dir:this.$props.dir},[H,this.$props.label?w?n.createVNode("label",{for:w,class:"k-floating-label"},[this.$props.label]):n.createVNode("span",{class:"k-label"},[this.$props.label]):null]):H}});exports.DropDownList=ke;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import { defineComponent as Se, createVNode as n, h as T, ref as N, isVNode as $e } from "vue";
|
|
9
|
-
import { kendoThemeMaps as Ce, templateRendering as C, getListeners as x, getTemplate as xe, Keys as
|
|
9
|
+
import { kendoThemeMaps as Ce, templateRendering as C, getListeners as x, getTemplate as xe, Keys as m, canUseDOM as Oe, getRef as A, guid as W, classNames as B, noop as G, getTabIndex as we, setRef as q, Icon as Fe } from "@progress/kendo-vue-common";
|
|
10
10
|
import { Button as U } from "@progress/kendo-vue-buttons";
|
|
11
11
|
import { ListContainer as De } from "../common/ListContainer.mjs";
|
|
12
12
|
import { ListFilter as Ve } from "../common/ListFilter.mjs";
|
|
@@ -17,8 +17,8 @@ import { GroupStickyHeader as Y } from "../common/GroupStickyHeader.mjs";
|
|
|
17
17
|
import { selectButton as J, messages as Le } from "../messages/main.mjs";
|
|
18
18
|
import { provideLocalizationService as Re } from "@progress/kendo-vue-intl";
|
|
19
19
|
import { MOBILE_MEDIUM_DEVICE as Ne, MOBILE_SMALL_DEVICE as Ee } from "../common/constants.mjs";
|
|
20
|
-
import { ActionSheet as
|
|
21
|
-
import { getItemValue as F, areSame as
|
|
20
|
+
import { ActionSheet as He } from "@progress/kendo-vue-layout";
|
|
21
|
+
import { getItemValue as F, areSame as I, isPresent as Q, getFocusedItem as Ke, sameCharsOnly as Pe, shuffleData as _e, matchText as X, preventDefaultNonInputs as Z } from "../common/utils.mjs";
|
|
22
22
|
import { xIcon as je, caretAltDownIcon as ze } from "@progress/kendo-svg-icons";
|
|
23
23
|
const {
|
|
24
24
|
sizeMap: E,
|
|
@@ -234,22 +234,22 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
234
234
|
this.observer = Oe && window.ResizeObserver && new ResizeObserver(this.calculateMedia), document != null && document.body && this.observer && this.observer.observe(document.body), this.hasMounted = !0, this.select = A(this, "select"), this.base.wrapper = A(this, "kendoAnchor"), this.base.didMount(), this.setValidity();
|
|
235
235
|
},
|
|
236
236
|
updated() {
|
|
237
|
-
var
|
|
237
|
+
var v;
|
|
238
238
|
const {
|
|
239
239
|
dataItems: e = [],
|
|
240
240
|
dataItemKey: t,
|
|
241
241
|
virtual: s,
|
|
242
242
|
groupField: l,
|
|
243
243
|
textField: o
|
|
244
|
-
} = this.$props, i = this.isOpen,
|
|
245
|
-
if (this.$refs.scroller,
|
|
244
|
+
} = this.$props, i = this.isOpen, d = this.prevOpened !== void 0 ? this.prevOpened : this.prevCurrentOpened, a = !d && i, r = this.$refs.list, h = this.$refs.filterInput, c = this.$refs.scrollElement;
|
|
245
|
+
if (this.$refs.scroller, r && (this.base.vs.list = r.list, this.base.list = r.list), c && (this.base.vs.scrollElement = c), h && (this.filterInput = h), r && e.length && this.base.vs.scrollerRef(r.$el), this.$props.popupSettings.animate || a && this.onPopupOpened(), s && this.virtualTotalHasChanged)
|
|
246
246
|
this.base.vs.calcScrollElementHeight(), this.base.vs.reset(), this.virtualTotalHasChanged = !1;
|
|
247
247
|
else {
|
|
248
|
-
const
|
|
249
|
-
let u = e.findIndex((
|
|
250
|
-
l && (u = (
|
|
251
|
-
const k = !
|
|
252
|
-
a && s ? (this.base.scrollToVirtualItem(s, u), this.prevCurrentOpened = !0) : a && !s ? (e && e.length !== 0 && this.base.resetGroupStickyHeader(e[0][l], this), this.base.scrollToItem(u), this.prevCurrentOpened = !0) : i &&
|
|
248
|
+
const p = this.computedValue(), g = this.prevCurrentValue;
|
|
249
|
+
let u = e.findIndex((b) => I(b, p, t));
|
|
250
|
+
l && (u = (v = this.base.getGroupedDataModernMode(e, l)) == null ? void 0 : v.indexOf(p));
|
|
251
|
+
const k = !I(g, p, t);
|
|
252
|
+
a && s ? (this.base.scrollToVirtualItem(s, u), this.prevCurrentOpened = !0) : a && !s ? (e && e.length !== 0 && this.base.resetGroupStickyHeader(e[0][l], this), this.base.scrollToItem(u), this.prevCurrentOpened = !0) : i && d && p && k && !this._navigated ? this.base.scrollToItem(u) : i && d && this._navigated && (this._navigated && s && s.skip === 0 ? this.base.vs.reset() : this._navigated && s && s.skip === s.total - s.pageSize && this.base.vs.scrollToEnd());
|
|
253
253
|
}
|
|
254
254
|
this._navigated = !1, this.prevCurrentValue = this.computedValue(), this.setValidity();
|
|
255
255
|
},
|
|
@@ -259,7 +259,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
259
259
|
dataItems: e = [],
|
|
260
260
|
dataItemKey: t
|
|
261
261
|
} = this.$props, s = this.computedValue();
|
|
262
|
-
return e.findIndex((l) =>
|
|
262
|
+
return e.findIndex((l) => I(l, s, t));
|
|
263
263
|
},
|
|
264
264
|
spanClassNames() {
|
|
265
265
|
const e = !this.hasMounted || !this.$props.validityStyles || this.validity().valid;
|
|
@@ -321,8 +321,8 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
321
321
|
virtual: l,
|
|
322
322
|
dataItemKey: o,
|
|
323
323
|
defaultItem: i
|
|
324
|
-
} = this.$props,
|
|
325
|
-
this.triggerOnChange(a, t),
|
|
324
|
+
} = this.$props, d = l ? l.skip : 0, a = e === -1 && i !== void 0 ? i : s[e - d], r = !I(a, this.computedValue(), o);
|
|
325
|
+
this.triggerOnChange(a, t), r && this.base.triggerPageChangeCornerItems(a, t);
|
|
326
326
|
},
|
|
327
327
|
onNavigate(e, t) {
|
|
328
328
|
const {
|
|
@@ -334,9 +334,9 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
334
334
|
total: 0,
|
|
335
335
|
pageSize: 0
|
|
336
336
|
}
|
|
337
|
-
} = this.$props,
|
|
338
|
-
current: i.skip +
|
|
339
|
-
max: (
|
|
337
|
+
} = this.$props, d = this.base.vs, a = this.computedValue(), r = s.findIndex((c) => I(c, a, o)), h = this.base.navigation.navigate({
|
|
338
|
+
current: i.skip + r,
|
|
339
|
+
max: (d.enabled ? i.total : s.length) - 1,
|
|
340
340
|
min: l !== void 0 ? -1 : 0,
|
|
341
341
|
keyCode: t
|
|
342
342
|
});
|
|
@@ -350,31 +350,31 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
350
350
|
dataItems: t = [],
|
|
351
351
|
dataItemKey: s
|
|
352
352
|
} = this.$props;
|
|
353
|
-
let l = t.map((
|
|
354
|
-
item:
|
|
353
|
+
let l = t.map((b, D) => ({
|
|
354
|
+
item: b,
|
|
355
355
|
itemIndex: D
|
|
356
356
|
}));
|
|
357
|
-
const o = this.searchState.word, i = this.searchState.last,
|
|
358
|
-
let a = l.length,
|
|
357
|
+
const o = this.searchState.word, i = this.searchState.last, d = Pe(o, i);
|
|
358
|
+
let a = l.length, r = Math.max(0, t.findIndex((b) => I(b, this.computedValue(), s))), h;
|
|
359
359
|
this.$props.defaultItem && (h = {
|
|
360
360
|
item: this.$props.defaultItem,
|
|
361
361
|
itemIndex: -1
|
|
362
|
-
}, a += 1,
|
|
363
|
-
let
|
|
362
|
+
}, a += 1, r += 1), r += d ? 1 : 0, l = _e(l, r, h);
|
|
363
|
+
let c, v, p, g = 0;
|
|
364
364
|
const {
|
|
365
365
|
textField: u,
|
|
366
366
|
ignoreCase: k
|
|
367
367
|
} = this.$props;
|
|
368
|
-
for (;
|
|
369
|
-
if (
|
|
370
|
-
|
|
368
|
+
for (; g < a; ) {
|
|
369
|
+
if (c = F(l[g].item, u), v = d && X(c, i, k), p = X(c, o, k), v || p) {
|
|
370
|
+
g = l[g].itemIndex;
|
|
371
371
|
break;
|
|
372
372
|
}
|
|
373
|
-
|
|
373
|
+
g++;
|
|
374
374
|
}
|
|
375
|
-
if (
|
|
376
|
-
const
|
|
377
|
-
|
|
375
|
+
if (g !== a) {
|
|
376
|
+
const b = this.base.initState();
|
|
377
|
+
b.event = e, this.handleItemSelect(g, b), this.applyState(b), this.valueDuringOnChange = void 0;
|
|
378
378
|
}
|
|
379
379
|
},
|
|
380
380
|
handleKeyDown(e) {
|
|
@@ -389,14 +389,14 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
389
389
|
total: 0,
|
|
390
390
|
pageSize: 0
|
|
391
391
|
}
|
|
392
|
-
} = this.$props,
|
|
392
|
+
} = this.$props, d = this.isOpen, a = e.keyCode, r = a === m.home || a === m.end, h = a === m.up || a === m.down, c = !d && (e.altKey && a === m.down || a === m.enter || a === m.space), v = d && (e.altKey && a === m.up || a === m.esc), p = s && (a === m.left || a === m.right), g = h || !l && (p || r), u = this.base.initState();
|
|
393
393
|
if (u.event = e, !o) {
|
|
394
|
-
if (
|
|
395
|
-
a ===
|
|
396
|
-
else if (
|
|
394
|
+
if (r && this.base.vs.enabled)
|
|
395
|
+
a === m.home ? i.skip !== 0 ? (this.base.triggerOnPageChange(u, 0, i.pageSize), this._navigated = !0) : this.triggerOnChange(t[0], u) : i.skip < i.total - i.pageSize ? (this.base.triggerOnPageChange(u, i.total - i.pageSize, i.pageSize), this._navigated = !0) : this.triggerOnChange(t[t.length - 1], u);
|
|
396
|
+
else if (d && a === m.enter) {
|
|
397
397
|
const k = this.focusedIndex();
|
|
398
398
|
k !== void 0 && this.handleItemSelect(k, u), this.base.togglePopup(u), e.preventDefault();
|
|
399
|
-
} else
|
|
399
|
+
} else c || v ? (this.adaptiveState && this.handleWrapperClick(e), this.base.togglePopup(u), e.preventDefault()) : g && (this.onNavigate(u, a), e.preventDefault());
|
|
400
400
|
this.applyState(u);
|
|
401
401
|
}
|
|
402
402
|
},
|
|
@@ -423,7 +423,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
423
423
|
t.event = e, this.currentFocused || (t.data.currentFocused = !0), this.base.togglePopup(t), this.applyState(t);
|
|
424
424
|
},
|
|
425
425
|
handleKeyPress(e) {
|
|
426
|
-
if (this.$props.filterable || e.keyCode ===
|
|
426
|
+
if (this.$props.filterable || e.keyCode === m.enter)
|
|
427
427
|
return;
|
|
428
428
|
let t = String.fromCharCode(e.charCode || e.keyCode);
|
|
429
429
|
this.$props.ignoreCase && (t = t.toLowerCase()), t === " " && e.preventDefault(), this.searchState = {
|
|
@@ -452,8 +452,8 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
452
452
|
dataItemKey: l,
|
|
453
453
|
textField: o,
|
|
454
454
|
focusedItemIndex: i
|
|
455
|
-
} = this.$props,
|
|
456
|
-
return !
|
|
455
|
+
} = this.$props, d = this.computedValue(), r = !(t.findIndex((h) => I(h, d, l)) < 0 && !this.$props.defaultItem);
|
|
456
|
+
return !r && e && s.skip === 0 ? i ? i(t, e, o) : t.indexOf(Ke(t, e, o)) : !r && s.skip === 0 ? 0 : void 0;
|
|
457
457
|
},
|
|
458
458
|
focusElement(e) {
|
|
459
459
|
this._skipFocusEvent = !0, e.focus(), setTimeout(() => this._skipFocusEvent = !1, 30);
|
|
@@ -462,7 +462,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
462
462
|
this.select && this.select.setCustomValidity && this.select.setCustomValidity(this.validity().valid ? "" : this.$props.validationMessage || Ge);
|
|
463
463
|
},
|
|
464
464
|
triggerOnChange(e, t) {
|
|
465
|
-
|
|
465
|
+
I(this.computedValue(), e, this.$props.dataItemKey) || (this.$props.value === void 0 && (this.currentValue = e), this.valueDuringOnChange = e, t.events.push({
|
|
466
466
|
type: "change"
|
|
467
467
|
}));
|
|
468
468
|
},
|
|
@@ -477,6 +477,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
477
477
|
this.base.repositionPopup();
|
|
478
478
|
},
|
|
479
479
|
onScroll(e) {
|
|
480
|
+
var v;
|
|
480
481
|
this.isScrolling = !0;
|
|
481
482
|
const {
|
|
482
483
|
vs: t,
|
|
@@ -488,14 +489,14 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
488
489
|
} = this.$props;
|
|
489
490
|
let {
|
|
490
491
|
dataItems: i = []
|
|
491
|
-
} = this.$props,
|
|
492
|
+
} = this.$props, d;
|
|
492
493
|
if (!o || !i.length)
|
|
493
494
|
return;
|
|
494
|
-
const a = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight :
|
|
495
|
-
o && (i = this.base.getGroupedDataModernMode(i, o),
|
|
496
|
-
for (let p = 1; p < i.length && !(
|
|
497
|
-
i[p] && i[p][o] && (
|
|
498
|
-
|
|
495
|
+
const a = s && ((v = s.querySelector(".k-list-item")) == null ? void 0 : v.offsetHeight) || 0, r = this.itemHeight = this.itemHeight || (t.enabled ? t.itemHeight : a), c = e.target.scrollTop - t.skip * r;
|
|
496
|
+
o && (i = this.base.getGroupedDataModernMode(i, o), d = i[0][o]);
|
|
497
|
+
for (let p = 1; p < i.length && !(r * p > c); p++)
|
|
498
|
+
i[p] && i[p][o] && (d = i[p][o]);
|
|
499
|
+
d !== this.group && (l.data.group = d, this.applyState(l));
|
|
499
500
|
}
|
|
500
501
|
},
|
|
501
502
|
render() {
|
|
@@ -508,19 +509,19 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
508
509
|
skip: 0
|
|
509
510
|
},
|
|
510
511
|
size: i,
|
|
511
|
-
rounded:
|
|
512
|
+
rounded: d,
|
|
512
513
|
fillMode: a,
|
|
513
|
-
dataItemKey:
|
|
514
|
+
dataItemKey: r,
|
|
514
515
|
dataItems: h = [],
|
|
515
|
-
disabled:
|
|
516
|
-
tabIndex:
|
|
517
|
-
loading:
|
|
518
|
-
icon:
|
|
516
|
+
disabled: c,
|
|
517
|
+
tabIndex: v,
|
|
518
|
+
loading: p,
|
|
519
|
+
icon: g,
|
|
519
520
|
svgIcon: u,
|
|
520
521
|
iconClassName: k,
|
|
521
|
-
adaptiveTitle:
|
|
522
|
+
adaptiveTitle: b,
|
|
522
523
|
header: D,
|
|
523
|
-
footer:
|
|
524
|
+
footer: H,
|
|
524
525
|
groupStickyHeaderItemRender: ee
|
|
525
526
|
} = this.$props, O = this.isOpen, te = F(this.computedValue(), this.$props.textField), ie = !this.$props.validityStyles || this.validity().valid, S = this.base, w = S.vs, L = this.$props.id || this.inputId;
|
|
526
527
|
w.enabled = this.$props.virtual !== void 0;
|
|
@@ -529,7 +530,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
529
530
|
height: "200px"
|
|
530
531
|
}, this.$props.popupSettings), se = Re(this).toLanguageString(J, Le[J]), M = this.adaptiveState;
|
|
531
532
|
this.group === void 0 && this.$props.groupField !== void 0 && (this.group = F(this.$props.dataItems[0], this.$props.groupField));
|
|
532
|
-
const ae = C.call(this, this.$props.valueRender, x.call(this)), ne = this.currentFocused,
|
|
533
|
+
const ae = C.call(this, this.$props.valueRender, x.call(this)), ne = this.currentFocused, K = this.primitiveValue(), le = h.findIndex((f) => I(f, K, r)), oe = n("span", {
|
|
533
534
|
class: "k-input-inner",
|
|
534
535
|
id: this.dropDownListId
|
|
535
536
|
}, [n("span", {
|
|
@@ -544,7 +545,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
544
545
|
...this.$data
|
|
545
546
|
}
|
|
546
547
|
});
|
|
547
|
-
const de = function(
|
|
548
|
+
const de = function(f) {
|
|
548
549
|
return n("select", {
|
|
549
550
|
name: this.$props.name,
|
|
550
551
|
id: L,
|
|
@@ -561,7 +562,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
561
562
|
left: "50%"
|
|
562
563
|
}
|
|
563
564
|
}, [n("option", {
|
|
564
|
-
value: this.$props.valueMap ? this.$props.valueMap.call(void 0,
|
|
565
|
+
value: this.$props.valueMap ? this.$props.valueMap.call(void 0, f) : f
|
|
565
566
|
}, null)]);
|
|
566
567
|
}, pe = () => [n("div", {
|
|
567
568
|
class: "k-actionsheet-titlebar-group k-hbox"
|
|
@@ -569,7 +570,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
569
570
|
class: "k-actionsheet-title"
|
|
570
571
|
}, [n("div", {
|
|
571
572
|
class: "k-text-center"
|
|
572
|
-
}, [
|
|
573
|
+
}, [b]), n("div", {
|
|
573
574
|
class: "k-actionsheet-subtitle k-text-center"
|
|
574
575
|
}, null)]), n("div", {
|
|
575
576
|
class: "k-actionsheet-actions"
|
|
@@ -585,12 +586,12 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
585
586
|
}, null)])]), n("div", {
|
|
586
587
|
class: "k-actionsheet-titlebar-group k-actionsheet-filter"
|
|
587
588
|
}, [j.call(this)])], ue = C.call(this, pe, x.call(this)), he = () => {
|
|
588
|
-
const
|
|
589
|
+
const f = S.getTemplateDef.call(this, D, T), y = S.getTemplateDef.call(this, H, T), $ = C.call(this, ee, x.call(this));
|
|
589
590
|
return n("div", {
|
|
590
591
|
class: "k-list-container"
|
|
591
|
-
}, [
|
|
592
|
+
}, [f && n("div", {
|
|
592
593
|
class: "k-list-header"
|
|
593
|
-
}, [
|
|
594
|
+
}, [f]), n("div", {
|
|
594
595
|
class: B("k-list", {
|
|
595
596
|
[`k-list-${E[i] || i}`]: M ? !1 : i,
|
|
596
597
|
"k-list-lg": !!M,
|
|
@@ -599,11 +600,11 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
599
600
|
}, [P.call(this), this.group && h.length !== 0 && n(Y, {
|
|
600
601
|
group: this.group,
|
|
601
602
|
render: $
|
|
602
|
-
}, null), _.call(this),
|
|
603
|
+
}, null), _.call(this), y && n("div", {
|
|
603
604
|
class: "k-list-footer"
|
|
604
|
-
}, [
|
|
605
|
+
}, [y])])]);
|
|
605
606
|
}, ce = C.call(this, he, x.call(this)), fe = function() {
|
|
606
|
-
return n(
|
|
607
|
+
return n(He, {
|
|
607
608
|
expand: O,
|
|
608
609
|
animation: !0,
|
|
609
610
|
animationStyles: this.animationStyles,
|
|
@@ -616,20 +617,20 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
616
617
|
}, null);
|
|
617
618
|
}, P = function() {
|
|
618
619
|
const {
|
|
619
|
-
textField:
|
|
620
|
-
defaultItem:
|
|
620
|
+
textField: f,
|
|
621
|
+
defaultItem: y
|
|
621
622
|
} = this.$props;
|
|
622
|
-
return
|
|
623
|
-
defaultItem:
|
|
624
|
-
textField:
|
|
625
|
-
selected:
|
|
623
|
+
return y !== void 0 && n(Me, {
|
|
624
|
+
defaultItem: y,
|
|
625
|
+
textField: f,
|
|
626
|
+
selected: I(this.computedValue(), y, r),
|
|
626
627
|
key: "defaultitemkey",
|
|
627
628
|
onDefaultitemclick: this.handleDefaultItemClick
|
|
628
629
|
}, null);
|
|
629
630
|
}, _ = function() {
|
|
630
|
-
let
|
|
631
|
+
let f;
|
|
631
632
|
const {
|
|
632
|
-
textField:
|
|
633
|
+
textField: y,
|
|
633
634
|
groupField: $
|
|
634
635
|
} = this.$props;
|
|
635
636
|
let R = this.$props.dataItems || [];
|
|
@@ -640,8 +641,8 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
640
641
|
dataItems: R.slice(),
|
|
641
642
|
focusedIndex: this.focusedIndex(),
|
|
642
643
|
value: this.computedValue(),
|
|
643
|
-
textField:
|
|
644
|
-
valueField:
|
|
644
|
+
textField: y,
|
|
645
|
+
valueField: r,
|
|
645
646
|
optionsGuid: this.base.guid,
|
|
646
647
|
ref: "list",
|
|
647
648
|
wrapperStyle: {
|
|
@@ -659,13 +660,13 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
659
660
|
noDataRender: ye,
|
|
660
661
|
groupField: $,
|
|
661
662
|
onScroll: this.onScroll
|
|
662
|
-
}, We(
|
|
663
|
-
default: () => [
|
|
663
|
+
}, We(f = me.call(this)) ? f : {
|
|
664
|
+
default: () => [f]
|
|
664
665
|
});
|
|
665
666
|
}, j = function() {
|
|
666
|
-
const
|
|
667
|
+
const f = this.$props.filter !== void 0 ? this.$props.filter : this.currentText;
|
|
667
668
|
return this.$props.filterable && n(Ve, {
|
|
668
|
-
value:
|
|
669
|
+
value: f,
|
|
669
670
|
ref: "filterInput",
|
|
670
671
|
onChange: this.handleListFilterChange,
|
|
671
672
|
onKeydown: this.handleKeyDown,
|
|
@@ -681,7 +682,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
681
682
|
key: "scrollElementKey"
|
|
682
683
|
}, null);
|
|
683
684
|
}, ge = function() {
|
|
684
|
-
const
|
|
685
|
+
const f = C.call(this, this.$props.groupStickyHeaderItemRender, x.call(this)), y = S.getTemplateDef.call(this, D), $ = S.getTemplateDef.call(this, H);
|
|
685
686
|
return n(De, {
|
|
686
687
|
ref: "container",
|
|
687
688
|
onMousedown: Z,
|
|
@@ -703,10 +704,10 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
703
704
|
}, {
|
|
704
705
|
default: () => [j.call(this), P.call(this), this.group && h.length !== 0 && n(Y, {
|
|
705
706
|
group: this.group,
|
|
706
|
-
render:
|
|
707
|
-
}, null),
|
|
707
|
+
render: f
|
|
708
|
+
}, null), y && n("div", {
|
|
708
709
|
class: "k-list-header"
|
|
709
|
-
}, [
|
|
710
|
+
}, [y]), _.call(this), $ && n("div", {
|
|
710
711
|
class: "k-list-footer"
|
|
711
712
|
}, [$])]
|
|
712
713
|
});
|
|
@@ -717,12 +718,12 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
717
718
|
ref: q(this, "kendoAnchor"),
|
|
718
719
|
class: B("k-dropdownlist k-picker", t, {
|
|
719
720
|
[`k-picker-${E[i] || i}`]: i,
|
|
720
|
-
[`k-rounded-${Ae[
|
|
721
|
+
[`k-rounded-${Ae[d] || d}`]: d,
|
|
721
722
|
[`k-picker-${a}`]: a,
|
|
722
723
|
"k-focus": ne,
|
|
723
|
-
"k-disabled":
|
|
724
|
+
"k-disabled": c,
|
|
724
725
|
"k-invalid": !ie,
|
|
725
|
-
"k-loading":
|
|
726
|
+
"k-loading": p,
|
|
726
727
|
"k-required": this.required
|
|
727
728
|
}),
|
|
728
729
|
style: s ? {
|
|
@@ -733,13 +734,13 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
733
734
|
onMousedown: O ? Z : G,
|
|
734
735
|
onFocusin: this.handleFocus,
|
|
735
736
|
onFocusout: this.handleBlur,
|
|
736
|
-
tabindex: we(
|
|
737
|
+
tabindex: we(v, c),
|
|
737
738
|
accesskey: this.$props.accessKey,
|
|
738
739
|
onKeydown: this.handleKeyDown,
|
|
739
740
|
onKeypress: this.handleKeyPress,
|
|
740
741
|
role: "combobox",
|
|
741
|
-
onClick:
|
|
742
|
-
"aria-disabled":
|
|
742
|
+
onClick: c ? G : this.handleWrapperClick,
|
|
743
|
+
"aria-disabled": c || void 0,
|
|
743
744
|
"aria-haspopup": !0,
|
|
744
745
|
"aria-expanded": O || !1,
|
|
745
746
|
"aria-owns": this.base.listBoxId,
|
|
@@ -748,7 +749,7 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
748
749
|
"aria-labelledby": this.$props.ariaLabelledBy,
|
|
749
750
|
"aria-describedBy": this.dropDownListId,
|
|
750
751
|
title: this.$props.title
|
|
751
|
-
}, [re,
|
|
752
|
+
}, [re, p && n(Fe, {
|
|
752
753
|
name: "loading",
|
|
753
754
|
class: "k-input-loading-icon",
|
|
754
755
|
key: "loading"
|
|
@@ -760,10 +761,10 @@ const Ge = "Please select a value from the list!", dt = /* @__PURE__ */ Se({
|
|
|
760
761
|
rounded: null,
|
|
761
762
|
ariaLabel: se,
|
|
762
763
|
class: "k-input-button",
|
|
763
|
-
icon:
|
|
764
|
+
icon: g || "caret-alt-down",
|
|
764
765
|
svgIcon: u || ze,
|
|
765
766
|
iconClass: k
|
|
766
|
-
}, null), de.call(this,
|
|
767
|
+
}, null), de.call(this, K), !M && ge.call(this)]);
|
|
767
768
|
}.call(this), {
|
|
768
769
|
...this.$attrs
|
|
769
770
|
}), M && fe.call(this)];
|