1 |
- !function(){function e(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||r(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t&&(l=l.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,l)}return n}function n(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){l(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=r(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var l=0,o=function(){};return{s:o,n:function(){return l>=e.length?{done:!0}:{done:!1,value:e[l++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}function r(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,l=new Array(t);n<t;n++)l[n]=e[n];return l}System.register(["./index-legacy.4dc2f84c.js","./index2-legacy.8bdc7bd4.js"],(function(t){"use strict";var r,a,u,s,c,p,d,f,v,h,m,b,y,g,S,C,O,x,w,I,L,T,P,M,V,k,D,E,B,z,A,q,W,F,j,K,H,R,_,Q,$,N,G,U,X,Y,Z,J,ee,te,ne,le,oe,ie,re,ae,ue,se,ce,pe,de,fe,ve,he,me,be,ye,ge,Se,Ce,Oe,xe;return{setters:[function(e){r=e.Q,a=e.R,u=e.S,s=e.U,c=e.j,p=e.W,d=e.w,f=e.X,v=e.A,h=e.Y,m=e.d,b=e.s,y=e.r,g=e.Z,S=e.g,C=e.n,O=e._,x=e.$,w=e.a0,I=e.t,L=e.v,T=e.y,P=e.x,M=e.a1,V=e.z,k=e.D,D=e.e,E=e.o,B=e.a2,z=e.I,A=e.a3,q=e.a4,W=e.a5,F=e.a6,j=e.q,K=e.a7,H=e.a8,R=e.a9,_=e.aa,Q=e.ab,$=e.ac,N=e.ad,G=e.ae,U=e.af,X=e.ag,Y=e.ah,Z=e.E,J=e.ai,ee=e.aj,te=e.G,ne=e.ak,le=e.al,oe=e.am,ie=e.an,re=e.p,ae=e.k,ue=e.ao,se=e.c,ce=e.C,pe=e.B,de=e.F,fe=e.ap,ve=e.H,he=e.T,me=e.aq,be=e.ar,ye=e.as,ge=e.at,Se=e.K,Ce=e.au},function(e){Oe=e.E,xe=e.t}],execute:function(){var we,Ie=new Map;function Le(e,t){var n=[];return Array.isArray(t.arg)?n=t.arg:u(t.arg)&&n.push(t.arg),function(l,o){var i=t.instance.popperRef,r=l.target,a=null==o?void 0:o.target,u=!t||!t.instance,s=!r||!a,c=e.contains(r)||e.contains(a),p=e===r,d=n.length&&n.some((function(e){return null==e?void 0:e.contains(r)}))||n.length&&n.includes(a),f=i&&(i.contains(r)||i.contains(a));u||s||c||p||d||f||t.value(l,o)}}a&&(document.addEventListener("mousedown",(function(e){return we=e})),document.addEventListener("mouseup",(function(e){var t,n=i(Ie.values());try{for(n.s();!(t=n.n()).done;){var l,o=i(t.value);try{for(o.s();!(l=o.n()).done;){(0,l.value.documentHandler)(e,we)}}catch(r){o.e(r)}finally{o.f()}}}catch(r){n.e(r)}finally{n.f()}})));var Te=t("C",{beforeMount:function(e,t){Ie.has(e)||Ie.set(e,[]),Ie.get(e).push({documentHandler:Le(e,t),bindingFn:t.value})},updated:function(e,t){Ie.has(e)||Ie.set(e,[]);var n=Ie.get(e),l=n.findIndex((function(e){return e.bindingFn===t.oldValue})),o={documentHandler:Le(e,t),bindingFn:t.value};l>=0?n.splice(l,1,o):n.push(o)},unmounted:function(e){Ie.delete(e)}}),Pe="ElSelectGroup",Me="ElSelect";var Ve=m({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:{type:Boolean,default:!1}},setup:function(e){var t=b("select"),n=y({index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}),l=function(e,t){var n=s(Me),l=s(Pe,{disabled:!1}),i=c((function(){return"[object object]"===Object.prototype.toString.call(e.value).toLowerCase()})),r=c((function(){return n.props.multiple?g(n.props.modelValue,e.value):S(e.value,n.props.modelValue)})),a=c((function(){if(n.props.multiple){var e=n.props.modelValue||[];return!r.value&&e.length>=n.props.multipleLimit&&n.props.multipleLimit>0}return!1})),u=c((function(){return e.label||(i.value?"":e.value)})),m=c((function(){return e.value||e.label||""})),b=c((function(){return e.disabled||t.groupDisabled||a.value})),y=h(),g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;if(i.value){var l=n.props.valueKey;return e&&e.some((function(e){return p(e,l)===p(t,l)}))}return e&&e.includes(t)},S=function(e,t){if(i.value){var l=n.props.valueKey;return p(e,l)===p(t,l)}return e===t};d((function(){return u.value}),(function(){e.created||n.props.remote||n.setSelected()})),d((function(){return e.value}),(function(t,l){var i=n.props,r=i.remote,a=i.valueKey;if(!e.created&&!r){if(a&&"object"===o(t)&&"object"===o(l)&&t[a]===l[a])return;n.setSelected()}})),d((function(){return l.disabled}),(function(){t.groupDisabled=l.disabled}),{immediate:!0});var C=f(n).queryChange;return d(C,(function(l){var o=v(l).query,i=new RegExp(function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(o),"i");t.visible=i.test(u.value)||e.created,t.visible||n.filteredOptionsCount--})),{select:n,currentLabel:u,currentValue:m,itemSelected:r,isDisabled:b,hoverItem:function(){e.disabled||l.disabled||(n.hoverIndex=n.optionsArray.indexOf(y.proxy))}}}(e,n),i=l.currentLabel,r=l.itemSelected,a=l.isDisabled,u=l.select,m=l.hoverItem,O=g(n),x=O.visible,w=O.hover,I=h().proxy,L=I.value;return u.onOptionCreate(I),S((function(){var e=u.selected,t=(u.props.multiple?e:[e]).some((function(e){return e.value===I.value}));u.cachedOptions.get(L)!==I||t||C((function(){u.cachedOptions.delete(L)})),u.onOptionDestroy(L,I)})),{ns:t,currentLabel:i,itemSelected:r,isDisabled:a,select:u,hoverItem:m,visible:x,hover:w,selectOptionClick:function(){!0!==e.disabled&&!0!==n.groupDisabled&&u.handleOptionSelect(I,!0)},states:n}}});var ke=O(Ve,[["render",function(e,t,n,l,o,i){return x((I(),L("li",{class:V([e.ns.be("dropdown","item"),e.ns.is("disabled",e.isDisabled),{selected:e.itemSelected,hover:e.hover}]),onMouseenter:t[0]||(t[0]=function(){return e.hoverItem&&e.hoverItem.apply(e,arguments)}),onClick:t[1]||(t[1]=k((function(){return e.selectOptionClick&&e.selectOptionClick.apply(e,arguments)}),["stop"]))},[T(e.$slots,"default",{},(function(){return[P("span",null,M(e.currentLabel),1)]}))],34)),[[w,e.visible]])}],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/option.vue"]]),De=m({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup:function(){var e=s(Me),t=b("select"),n=c((function(){return e.props.popperClass})),l=c((function(){return e.props.multiple})),o=c((function(){return e.props.fitInputWidth})),i=D("");function r(){var t;i.value="".concat(null==(t=e.selectWrapper)?void 0:t.getBoundingClientRect().width,"px")}return E((function(){r(),B(e.selectWrapper,r)})),{ns:t,minWidth:i,popperClass:n,isMultiple:l,isFitInputWidth:o}}});var Ee=function(e,t,n){var l=A().t,o=b("select"),u=D(null),f=D(null),v=D(null),h=D(null),m=D(null),y=D(null),g=D(-1),S=q({query:""}),O=q(""),x=s(W,{}),w=s(F,{}),I=c((function(){return!e.filterable||e.multiple||!t.visible})),L=c((function(){return e.disabled||x.disabled})),T=c((function(){var n=e.multiple?Array.isArray(e.modelValue)&&e.modelValue.length>0:void 0!==e.modelValue&&null!==e.modelValue&&""!==e.modelValue;return e.clearable&&!L.value&&t.inputHovering&&n})),P=c((function(){return e.remote&&e.filterable?"":e.suffixIcon})),M=c((function(){return o.is("reverse",P.value&&t.visible)})),V=c((function(){return e.remote?300:0})),k=c((function(){return e.loading?e.loadingText||l("el.select.loading"):(!e.remote||""!==t.query||0!==t.options.size)&&(e.filterable&&t.query&&t.options.size>0&&0===t.filteredOptionsCount?e.noMatchText||l("el.select.noMatch"):0===t.options.size?e.noDataText||l("el.select.noData"):null)})),E=c((function(){return Array.from(t.options.values())})),B=c((function(){return Array.from(t.cachedOptions.values())})),z=c((function(){var n=E.value.filter((function(e){return!e.created})).some((function(e){return e.currentLabel===t.query}));return e.filterable&&e.allowCreate&&""!==t.query&&!n})),Z=j(),J=c((function(){return["small"].includes(Z.value)?"small":"default"})),ee=c({get:function(){return t.visible&&!1!==k.value},set:function(e){t.visible=e}});d([function(){return L.value},function(){return Z.value},function(){return x.size}],(function(){C((function(){te()}))})),d((function(){return e.placeholder}),(function(e){t.cachedPlaceHolder=t.currentPlaceholder=e})),d((function(){return e.modelValue}),(function(n,l){var o;e.multiple&&(te(),n&&n.length>0||f.value&&""!==t.query?t.currentPlaceholder="":t.currentPlaceholder=t.cachedPlaceHolder,e.filterable&&!e.reserveKeyword&&(t.query="",ne(t.query))),ie(),e.filterable&&!e.multiple&&(t.inputLength=20),K(n,l)||null==(o=w.validate)||o.call(w,"change").catch((function(e){return H()}))}),{flush:"post",deep:!0}),d((function(){return t.visible}),(function(l){var o,i,r;l?(null==(i=null==(o=v.value)?void 0:o.updatePopper)||i.call(o),e.filterable&&(t.filteredOptionsCount=t.optionsCount,t.query=e.remote?"":t.selectedLabel,e.multiple?null==(r=f.value)||r.focus():t.selectedLabel&&(t.currentPlaceholder="".concat(t.selectedLabel),t.selectedLabel=""),ne(t.query),e.multiple||e.remote||(S.value.query="",R(S),R(O)))):(f.value&&f.value.blur(),t.query="",t.previousQuery=null,t.selectedLabel="",t.inputLength=20,t.menuVisibleOnFocus=!1,ae(),C((function(){f.value&&""===f.value.value&&0===t.selected.length&&(t.currentPlaceholder=t.cachedPlaceHolder)})),e.multiple||(t.selected&&(e.filterable&&e.allowCreate&&t.createdSelected&&t.createdLabel?t.selectedLabel=t.createdLabel:t.selectedLabel=t.selected.currentLabel,e.filterable&&(t.query=t.selectedLabel)),e.filterable&&(t.currentPlaceholder=t.cachedPlaceHolder))),n.emit("visible-change",l)})),d((function(){return t.options.entries()}),(function(){var n,l,o;if(a){null==(l=null==(n=v.value)?void 0:n.updatePopper)||l.call(n),e.multiple&&te();var i=(null==(o=m.value)?void 0:o.querySelectorAll("input"))||[];Array.from(i).includes(document.activeElement)||ie(),e.defaultFirstOption&&(e.filterable||e.remote)&&t.filteredOptionsCount&&oe()}}),{flush:"post"}),d((function(){return t.hoverIndex}),(function(e){"number"==typeof e&&e>-1&&(g.value=E.value[e]||{}),E.value.forEach((function(e){e.hover=g.value===e}))}));var te=function(){e.collapseTags&&!e.filterable||C((function(){var e,n;if(u.value){var l,o=u.value.$el.querySelector("input"),i=h.value,a=(l=Z.value||x.size,r[l||"default"]);o.style.height="".concat(0===t.selected.length?a:Math.max(i?i.clientHeight+(i.clientHeight>a?6:0):0,a)-2,"px"),t.tagInMultiLine=Number.parseFloat(o.style.height)>=a,t.visible&&!1!==k.value&&(null==(n=null==(e=v.value)?void 0:e.updatePopper)||n.call(e))}}))},ne=function(n){t.previousQuery===n||t.isOnComposition||(null!==t.previousQuery||"function"!=typeof e.filterMethod&&"function"!=typeof e.remoteMethod?(t.previousQuery=n,C((function(){var e,n;t.visible&&(null==(n=null==(e=v.value)?void 0:e.updatePopper)||n.call(e))})),t.hoverIndex=-1,e.multiple&&e.filterable&&C((function(){var n=15*f.value.value.length+20;t.inputLength=e.collapseTags?Math.min(50,n):n,le(),te()})),e.remote&&"function"==typeof e.remoteMethod?(t.hoverIndex=-1,e.remoteMethod(n)):"function"==typeof e.filterMethod?(e.filterMethod(n),R(O)):(t.filteredOptionsCount=t.optionsCount,S.value.query=n,R(S),R(O)),e.defaultFirstOption&&(e.filterable||e.remote)&&t.filteredOptionsCount&&oe()):t.previousQuery=n)},le=function(){""!==t.currentPlaceholder&&(t.currentPlaceholder=f.value.value?"":t.cachedPlaceHolder)},oe=function(){var e=E.value.filter((function(e){return e.visible&&!e.disabled&&!e.states.groupDisabled})),n=e.find((function(e){return e.created})),l=e[0];t.hoverIndex=ve(E.value,n||l)},ie=function(){var n;if(!e.multiple){var l=re(e.modelValue);return(null==(n=l.props)?void 0:n.created)?(t.createdLabel=l.props.value,t.createdSelected=!0):t.createdSelected=!1,t.selectedLabel=l.currentLabel,t.selected=l,void(e.filterable&&(t.query=t.selectedLabel))}t.selectedLabel="";var o=[];Array.isArray(e.modelValue)&&e.modelValue.forEach((function(e){o.push(re(e))})),t.selected=o,C((function(){te()}))},re=function(n){for(var l,o="object"===_(n).toLowerCase(),i="null"===_(n).toLowerCase(),r="undefined"===_(n).toLowerCase(),a=t.cachedOptions.size-1;a>=0;a--){var u=B.value[a];if(o?p(u.value,e.valueKey)===p(n,e.valueKey):u.value===n){l={value:n,currentLabel:u.currentLabel,isDisabled:u.isDisabled};break}}if(l)return l;var s={value:n,currentLabel:o?n.label:i||r?"":n};return e.multiple&&(s.hitState=!1),s},ae=function(){setTimeout((function(){var n=e.valueKey;e.multiple?t.selected.length>0?t.hoverIndex=Math.min.apply(null,t.selected.map((function(e){return E.value.findIndex((function(t){return p(t,n)===p(e,n)}))}))):t.hoverIndex=-1:t.hoverIndex=E.value.findIndex((function(e){return ge(e)===ge(t.selected)}))}),300)},ue=function(){var e;t.inputWidth=null==(e=u.value)?void 0:e.$el.getBoundingClientRect().width},se=Q((function(){e.filterable&&t.query!==t.selectedLabel&&(t.query=t.selectedLabel,ne(t.query))}),V.value),ce=Q((function(e){ne(e.target.value)}),V.value),pe=function(t){K(e.modelValue,t)||n.emit(Y,t)},de=function(l){l.stopPropagation();var o=e.multiple?[]:"";if("string"!=typeof o){var r,a=i(t.selected);try{for(a.s();!(r=a.n()).done;){var u=r.value;u.isDisabled&&o.push(u.value)}}catch(s){a.e(s)}finally{a.f()}}n.emit(N,o),pe(o),t.visible=!1,n.emit("clear")},fe=function(l,o){var i;if(e.multiple){var r=(e.modelValue||[]).slice(),a=ve(r,l.value);a>-1?r.splice(a,1):(e.multipleLimit<=0||r.length<e.multipleLimit)&&r.push(l.value),n.emit(N,r),pe(r),l.created&&(t.query="",ne(""),t.inputLength=20),e.filterable&&(null==(i=f.value)||i.focus())}else n.emit(N,l.value),pe(l.value),t.visible=!1;t.isSilentBlur=o,he(),t.visible||C((function(){me(l)}))},ve=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(!$(n))return t.indexOf(n);var l=e.valueKey,o=-1;return t.some((function(e,t){return p(e,l)===p(n,l)&&(o=t,!0)})),o},he=function(){t.softFocus=!0;var e=f.value||u.value;e&&(null==e||e.focus())},me=function(e){var t,n,l,i,r,a=Array.isArray(e)?e[0]:e,u=null;if(null==a?void 0:a.value){var s=E.value.filter((function(e){return e.value===a.value}));s.length>0&&(u=s[0].$el)}if(v.value&&u){var c=null==(i=null==(l=null==(n=null==(t=v.value)?void 0:t.popperRef)?void 0:n.contentRef)?void 0:l.querySelector)?void 0:i.call(l,".".concat(o.be("dropdown","wrap")));c&&G(c,u)}null==(r=y.value)||r.handleScroll()},be=function(e){if(Array.isArray(t.selected)){var n=t.selected[t.selected.length-1];if(n)return!0===e||!1===e?(n.hitState=e,e):(n.hitState=!n.hitState,n.hitState)}},ye=function(){var n;e.automaticDropdown||L.value||(t.menuVisibleOnFocus?t.menuVisibleOnFocus=!1:t.visible=!t.visible,t.visible&&(null==(n=f.value||u.value)||n.focus()))},ge=function(t){return $(t.value)?p(t.value,e.valueKey):t.value},Se=c((function(){return E.value.filter((function(e){return e.visible})).every((function(e){return e.disabled}))}));return{optionsArray:E,selectSize:Z,handleResize:function(){var t,n;ue(),null==(n=null==(t=v.value)?void 0:t.updatePopper)||n.call(t),e.multiple&&!e.filterable&&te()},debouncedOnInputChange:se,debouncedQueryChange:ce,deletePrevTag:function(l){if(l.target.value.length<=0&&!be()){var o=e.modelValue.slice();o.pop(),n.emit(N,o),pe(o)}1===l.target.value.length&&0===e.modelValue.length&&(t.currentPlaceholder=t.cachedPlaceHolder)},deleteTag:function(l,o){var i=t.selected.indexOf(o);if(i>-1&&!L.value){var r=e.modelValue.slice();r.splice(i,1),n.emit(N,r),pe(r),n.emit("remove-tag",o.value)}l.stopPropagation()},deleteSelected:de,handleOptionSelect:fe,scrollToOption:me,readonly:I,resetInputHeight:te,showClose:T,iconComponent:P,iconReverse:M,showNewOption:z,collapseTagSize:J,setSelected:ie,managePlaceholder:le,selectDisabled:L,emptyText:k,toggleLastOptionHitState:be,resetInputState:function(e){e.code!==U.backspace&&be(!1),t.inputLength=15*f.value.value.length+20,te()},handleComposition:function(e){var n=e.target.value;if("compositionend"===e.type)t.isOnComposition=!1,C((function(){return ne(n)}));else{var l=n[n.length-1]||"";t.isOnComposition=!X(l)}},onOptionCreate:function(e){t.optionsCount++,t.filteredOptionsCount++,t.options.set(e.value,e),t.cachedOptions.set(e.value,e)},onOptionDestroy:function(e,n){t.options.get(e)===n&&(t.optionsCount--,t.filteredOptionsCount--,t.options.delete(e))},handleMenuEnter:function(){C((function(){return me(t.selected)}))},handleFocus:function(l){t.softFocus?t.softFocus=!1:((e.automaticDropdown||e.filterable)&&(e.filterable&&!t.visible&&(t.menuVisibleOnFocus=!0),t.visible=!0),n.emit("focus",l))},blur:function(){var e;t.visible=!1,null==(e=u.value)||e.blur()},handleBlur:function(e){C((function(){t.isSilentBlur?t.isSilentBlur=!1:n.emit("blur",e)})),t.softFocus=!1},handleClearClick:function(e){de(e)},handleClose:function(){t.visible=!1},handleKeydownEscape:function(e){t.visible&&(e.preventDefault(),e.stopPropagation(),t.visible=!1)},toggleMenu:ye,selectOption:function(){t.visible?E.value[t.hoverIndex]&&fe(E.value[t.hoverIndex],void 0):ye()},getValueKey:ge,navigateOptions:function e(n){if(t.visible){if(0!==t.options.size&&0!==t.filteredOptionsCount&&!t.isOnComposition&&!Se.value){"next"===n?(t.hoverIndex++,t.hoverIndex===t.options.size&&(t.hoverIndex=0)):"prev"===n&&(t.hoverIndex--,t.hoverIndex<0&&(t.hoverIndex=t.options.size-1));var l=E.value[t.hoverIndex];!0!==l.disabled&&!0!==l.states.groupDisabled&&l.visible||e(n),C((function(){return me(g.value)}))}}else t.visible=!0},dropMenuVisible:ee,queryChange:S,groupQueryChange:O,reference:u,input:f,tooltipRef:v,tags:h,selectWrapper:m,scrollbar:y}},Be="ElSelect",ze=m({name:Be,componentName:Be,components:{ElInput:Z,ElSelectMenu:O(De,[["render",function(e,t,n,o,i,r){return I(),L("div",{class:V([e.ns.b("dropdown"),e.ns.is("multiple",e.isMultiple),e.popperClass]),style:z(l({},e.isFitInputWidth?"width":"minWidth",e.minWidth))},[T(e.$slots,"default")],6)}],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/select-dropdown.vue"]]),ElOption:ke,ElTag:Oe,ElScrollbar:J,ElTooltip:ee,ElIcon:te},directives:{ClickOutside:Te},props:{name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:{type:String,validator:ne},effect:{type:String,default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:{type:Boolean,default:!1},teleported:le.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:[String,Object],default:oe},fitInputWidth:{type:Boolean,default:!1},suffixIcon:{type:[String,Object],default:ie},tagType:n(n({},xe.type),{},{default:"info"})},emits:[N,Y,"remove-tag","clear","visible-change","focus","blur"],setup:function(e,t){var n,l=b("select"),o=b("input"),i=A().t,r=function(e){var t=A().t;return y({options:new Map,cachedOptions:new Map,createdLabel:null,createdSelected:!1,selected:e.multiple?[]:{},inputLength:20,inputWidth:0,optionsCount:0,filteredOptionsCount:0,visible:!1,softFocus:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,cachedPlaceHolder:"",currentPlaceholder:t("el.select.placeholder"),menuVisibleOnFocus:!1,isOnComposition:!1,isSilentBlur:!1,prefixWidth:11,tagInMultiLine:!1})}(e),a=Ee(e,r,t),u=a.optionsArray,s=a.selectSize,p=a.readonly,d=a.handleResize,f=a.collapseTagSize,h=a.debouncedOnInputChange,m=a.debouncedQueryChange,S=a.deletePrevTag,O=a.deleteTag,x=a.deleteSelected,w=a.handleOptionSelect,I=a.scrollToOption,L=a.setSelected,T=a.resetInputHeight,P=a.managePlaceholder,M=a.showClose,V=a.selectDisabled,k=a.iconComponent,D=a.iconReverse,z=a.showNewOption,q=a.emptyText,W=a.toggleLastOptionHitState,F=a.resetInputState,j=a.handleComposition,K=a.onOptionCreate,H=a.onOptionDestroy,R=a.handleMenuEnter,_=a.handleFocus,Q=a.blur,$=a.handleBlur,G=a.handleClearClick,U=a.handleClose,X=a.handleKeydownEscape,Y=a.toggleMenu,Z=a.selectOption,J=a.getValueKey,ee=a.navigateOptions,te=a.dropMenuVisible,ne=a.reference,le=a.input,oe=a.tooltipRef,ie=a.tags,ae=a.selectWrapper,ue=a.scrollbar,se=a.queryChange,ce=a.groupQueryChange,pe=(n=ne,{focus:function(){var e,t;null==(t=null==(e=n.value)?void 0:e.focus)||t.call(e)}}).focus,de=g(r),fe=de.inputWidth,ve=de.selected,he=de.inputLength,me=de.filteredOptionsCount,be=de.visible,ye=de.softFocus,ge=de.selectedLabel,Se=de.hoverIndex,Ce=de.query,Oe=de.inputHovering,xe=de.currentPlaceholder,we=de.menuVisibleOnFocus,Ie=de.isOnComposition,Le=de.isSilentBlur,Te=de.options,Pe=de.cachedOptions,Ve=de.optionsCount,ke=de.prefixWidth,De=de.tagInMultiLine,Be=c((function(){var t=[l.b()],n=v(s);return n&&t.push(l.m(n)),e.disabled&&t.push(l.m("disabled")),t})),ze=c((function(){return{maxWidth:"".concat(v(fe)-32,"px"),width:"100%"}}));re(Me,y({props:e,options:Te,optionsArray:u,cachedOptions:Pe,optionsCount:Ve,filteredOptionsCount:me,hoverIndex:Se,handleOptionSelect:w,onOptionCreate:K,onOptionDestroy:H,selectWrapper:ae,selected:ve,setSelected:L,queryChange:se,groupQueryChange:ce})),E((function(){r.cachedPlaceHolder=xe.value=e.placeholder||i("el.select.placeholder"),e.multiple&&Array.isArray(e.modelValue)&&e.modelValue.length>0&&(xe.value=""),B(ae,d),e.remote&&e.multiple&&T(),C((function(){var e=ne.value&&ne.value.$el;if(e&&(fe.value=e.getBoundingClientRect().width,t.slots.prefix)){var n=e.querySelector(".".concat(o.e("prefix")));ke.value=Math.max(n.getBoundingClientRect().width+5,30)}})),L()})),e.multiple&&!Array.isArray(e.modelValue)&&t.emit(N,[]),!e.multiple&&Array.isArray(e.modelValue)&&t.emit(N,"");var Ae=c((function(){var e,t;return null==(t=null==(e=oe.value)?void 0:e.popperRef)?void 0:t.contentRef}));return{tagInMultiLine:De,prefixWidth:ke,selectSize:s,readonly:p,handleResize:d,collapseTagSize:f,debouncedOnInputChange:h,debouncedQueryChange:m,deletePrevTag:S,deleteTag:O,deleteSelected:x,handleOptionSelect:w,scrollToOption:I,inputWidth:fe,selected:ve,inputLength:he,filteredOptionsCount:me,visible:be,softFocus:ye,selectedLabel:ge,hoverIndex:Se,query:Ce,inputHovering:Oe,currentPlaceholder:xe,menuVisibleOnFocus:we,isOnComposition:Ie,isSilentBlur:Le,options:Te,resetInputHeight:T,managePlaceholder:P,showClose:M,selectDisabled:V,iconComponent:k,iconReverse:D,showNewOption:z,emptyText:q,toggleLastOptionHitState:W,resetInputState:F,handleComposition:j,handleMenuEnter:R,handleFocus:_,blur:Q,handleBlur:$,handleClearClick:G,handleClose:U,handleKeydownEscape:X,toggleMenu:Y,selectOption:Z,getValueKey:J,navigateOptions:ee,dropMenuVisible:te,focus:pe,reference:ne,input:le,tooltipRef:oe,popperPaneRef:Ae,tags:ie,selectWrapper:ae,scrollbar:ue,wrapperKls:Be,selectTagsStyle:ze,nsSelect:l}}}),Ae={class:"select-trigger"},qe=["disabled","autocomplete"],We={style:{height:"100%",display:"flex","justify-content":"center","align-items":"center"}};var Fe=O(ze,[["render",function(e,t,n,l,o,i){var r=ae("el-tag"),a=ae("el-tooltip"),u=ae("el-icon"),s=ae("el-input"),c=ae("el-option"),p=ae("el-scrollbar"),d=ae("el-select-menu"),f=ue("click-outside");return x((I(),L("div",{ref:"selectWrapper",class:V(e.wrapperKls),onClick:t[23]||(t[23]=k((function(){return e.toggleMenu&&e.toggleMenu.apply(e,arguments)}),["stop"]))},[se(a,{ref:"tooltipRef",visible:e.dropMenuVisible,"onUpdate:visible":t[22]||(t[22]=function(t){return e.dropMenuVisible=t}),placement:"bottom-start",teleported:e.teleported,"popper-class":[e.nsSelect.e("popper"),e.popperClass],"fallback-placements":["bottom-start","top-start","right","left"],effect:e.effect,pure:"",trigger:"click",transition:"".concat(e.nsSelect.namespace.value,"-zoom-in-top"),"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:e.persistent,onShow:e.handleMenuEnter},{default:ce((function(){return[P("div",Ae,[e.multiple?(I(),L("div",{key:0,ref:"tags",class:V(e.nsSelect.e("tags")),style:z(e.selectTagsStyle)},[e.collapseTags&&e.selected.length?(I(),L("span",{key:0,class:V([e.nsSelect.b("tags-wrapper"),{"has-prefix":e.prefixWidth&&e.selected.length}])},[se(r,{closable:!e.selectDisabled&&!e.selected[0].isDisabled,size:e.collapseTagSize,hit:e.selected[0].hitState,type:e.tagType,"disable-transitions":"",onClose:t[0]||(t[0]=function(t){return e.deleteTag(t,e.selected[0])})},{default:ce((function(){return[P("span",{class:V(e.nsSelect.e("tags-text")),style:z({maxWidth:e.inputWidth-123+"px"})},M(e.selected[0].currentLabel),7)]})),_:1},8,["closable","size","hit","type"]),e.selected.length>1?(I(),pe(r,{key:0,closable:!1,size:e.collapseTagSize,type:e.tagType,"disable-transitions":""},{default:ce((function(){return[e.collapseTagsTooltip?(I(),pe(a,{key:0,disabled:e.dropMenuVisible,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:!1},{default:ce((function(){return[P("span",{class:V(e.nsSelect.e("tags-text"))},"+ "+M(e.selected.length-1),3)]})),content:ce((function(){return[P("div",{class:V(e.nsSelect.e("collapse-tags"))},[(I(!0),L(de,null,fe(e.selected,(function(t,n){return I(),L("div",{key:n,class:V(e.nsSelect.e("collapse-tag"))},[(I(),pe(r,{key:e.getValueKey(t),class:"in-tooltip",closable:!e.selectDisabled&&!t.isDisabled,size:e.collapseTagSize,hit:t.hitState,type:e.tagType,"disable-transitions":"",style:{margin:"2px"},onClose:function(n){return e.deleteTag(n,t)}},{default:ce((function(){return[P("span",{class:V(e.nsSelect.e("tags-text")),style:z({maxWidth:e.inputWidth-75+"px"})},M(t.currentLabel),7)]})),_:2},1032,["closable","size","hit","type","onClose"]))],2)})),128))],2)]})),_:1},8,["disabled","effect"])):(I(),L("span",{key:1,class:V(e.nsSelect.e("tags-text"))},"+ "+M(e.selected.length-1),3))]})),_:1},8,["size","type"])):ve("v-if",!0)],2)):ve("v-if",!0),ve(" <div> "),e.collapseTags?ve("v-if",!0):(I(),pe(he,{key:1,onAfterLeave:e.resetInputHeight},{default:ce((function(){return[P("span",{class:V([e.nsSelect.b("tags-wrapper"),{"has-prefix":e.prefixWidth&&e.selected.length}])},[(I(!0),L(de,null,fe(e.selected,(function(t){return I(),pe(r,{key:e.getValueKey(t),closable:!e.selectDisabled&&!t.isDisabled,size:e.collapseTagSize,hit:t.hitState,type:e.tagType,"disable-transitions":"",onClose:function(n){return e.deleteTag(n,t)}},{default:ce((function(){return[P("span",{class:V(e.nsSelect.e("tags-text")),style:z({maxWidth:e.inputWidth-75+"px"})},M(t.currentLabel),7)]})),_:2},1032,["closable","size","hit","type","onClose"])})),128))],2)]})),_:1},8,["onAfterLeave"])),ve(" </div> "),e.filterable?x((I(),L("input",{key:2,ref:"input","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.query=t}),type:"text",class:V([e.nsSelect.e("input"),e.nsSelect.is(e.selectSize)]),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:z({marginLeft:e.prefixWidth&&!e.selected.length||e.tagInMultiLine?"".concat(e.prefixWidth,"px"):"",flexGrow:1,width:"".concat(e.inputLength/(e.inputWidth-32),"%"),maxWidth:"".concat(e.inputWidth-42,"px")}),onFocus:t[2]||(t[2]=function(){return e.handleFocus&&e.handleFocus.apply(e,arguments)}),onBlur:t[3]||(t[3]=function(){return e.handleBlur&&e.handleBlur.apply(e,arguments)}),onKeyup:t[4]||(t[4]=function(){return e.managePlaceholder&&e.managePlaceholder.apply(e,arguments)}),onKeydown:[t[5]||(t[5]=function(){return e.resetInputState&&e.resetInputState.apply(e,arguments)}),t[6]||(t[6]=me(k((function(t){return e.navigateOptions("next")}),["prevent"]),["down"])),t[7]||(t[7]=me(k((function(t){return e.navigateOptions("prev")}),["prevent"]),["up"])),t[8]||(t[8]=me((function(){return e.handleKeydownEscape&&e.handleKeydownEscape.apply(e,arguments)}),["esc"])),t[9]||(t[9]=me(k((function(){return e.selectOption&&e.selectOption.apply(e,arguments)}),["stop","prevent"]),["enter"])),t[10]||(t[10]=me((function(){return e.deletePrevTag&&e.deletePrevTag.apply(e,arguments)}),["delete"])),t[11]||(t[11]=me((function(t){return e.visible=!1}),["tab"]))],onCompositionstart:t[12]||(t[12]=function(){return e.handleComposition&&e.handleComposition.apply(e,arguments)}),onCompositionupdate:t[13]||(t[13]=function(){return e.handleComposition&&e.handleComposition.apply(e,arguments)}),onCompositionend:t[14]||(t[14]=function(){return e.handleComposition&&e.handleComposition.apply(e,arguments)}),onInput:t[15]||(t[15]=function(){return e.debouncedQueryChange&&e.debouncedQueryChange.apply(e,arguments)})},null,46,qe)),[[be,e.query]]):ve("v-if",!0)],6)):ve("v-if",!0),se(s,{id:e.id,ref:"reference",modelValue:e.selectedLabel,"onUpdate:modelValue":t[16]||(t[16]=function(t){return e.selectedLabel=t}),type:"text",placeholder:e.currentPlaceholder,name:e.name,autocomplete:e.autocomplete,size:e.selectSize,disabled:e.selectDisabled,readonly:e.readonly,"validate-event":!1,class:V([e.nsSelect.is("focus",e.visible)]),tabindex:e.multiple&&e.filterable?-1:void 0,onFocus:e.handleFocus,onBlur:e.handleBlur,onInput:e.debouncedOnInputChange,onPaste:e.debouncedOnInputChange,onCompositionstart:e.handleComposition,onCompositionupdate:e.handleComposition,onCompositionend:e.handleComposition,onKeydown:[t[17]||(t[17]=me(k((function(t){return e.navigateOptions("next")}),["stop","prevent"]),["down"])),t[18]||(t[18]=me(k((function(t){return e.navigateOptions("prev")}),["stop","prevent"]),["up"])),me(k(e.selectOption,["stop","prevent"]),["enter"]),me(e.handleKeydownEscape,["esc"]),t[19]||(t[19]=me((function(t){return e.visible=!1}),["tab"]))],onMouseenter:t[20]||(t[20]=function(t){return e.inputHovering=!0}),onMouseleave:t[21]||(t[21]=function(t){return e.inputHovering=!1})},ye({suffix:ce((function(){return[e.iconComponent&&!e.showClose?(I(),pe(u,{key:0,class:V([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:ce((function(){return[(I(),pe(ge(e.iconComponent)))]})),_:1},8,["class"])):ve("v-if",!0),e.showClose&&e.clearIcon?(I(),pe(u,{key:1,class:V([e.nsSelect.e("caret"),e.nsSelect.e("icon")]),onClick:e.handleClearClick},{default:ce((function(){return[(I(),pe(ge(e.clearIcon)))]})),_:1},8,["class","onClick"])):ve("v-if",!0)]})),_:2},[e.$slots.prefix?{name:"prefix",fn:ce((function(){return[P("div",We,[T(e.$slots,"prefix")])]}))}:void 0]),1032,["id","modelValue","placeholder","name","autocomplete","size","disabled","readonly","class","tabindex","onFocus","onBlur","onInput","onPaste","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown"])])]})),content:ce((function(){return[se(d,null,{default:ce((function(){return[x(se(p,{ref:"scrollbar",tag:"ul","wrap-class":e.nsSelect.be("dropdown","wrap"),"view-class":e.nsSelect.be("dropdown","list"),class:V([e.nsSelect.is("empty",!e.allowCreate&&Boolean(e.query)&&0===e.filteredOptionsCount)])},{default:ce((function(){return[e.showNewOption?(I(),pe(c,{key:0,value:e.query,created:!0},null,8,["value"])):ve("v-if",!0),T(e.$slots,"default")]})),_:3},8,["wrap-class","view-class","class"]),[[w,e.options.size>0&&!e.loading]]),e.emptyText&&(!e.allowCreate||e.loading||e.allowCreate&&0===e.options.size)?(I(),L(de,{key:0},[e.$slots.empty?T(e.$slots,"empty",{key:0}):(I(),L("p",{key:1,class:V(e.nsSelect.be("dropdown","empty"))},M(e.emptyText),3))],64)):ve("v-if",!0)]})),_:3})]})),_:3},8,["visible","teleported","popper-class","effect","transition","persistent","onShow"])],2)),[[f,e.handleClose,e.popperPaneRef]])}],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/select.vue"]]),je=m({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:{type:Boolean,default:!1}},setup:function(t){var l=b("select"),o=D(!0),i=h(),r=D([]);re(Pe,y(n({},g(t))));var a=s(Me);E((function(){r.value=u(i.subTree)}));var u=function t(n){var l=[];return Array.isArray(n.children)&&n.children.forEach((function(n){var o;n.type&&"ElOption"===n.type.name&&n.component&&n.component.proxy?l.push(n.component.proxy):(null==(o=n.children)?void 0:o.length)&&l.push.apply(l,e(t(n)))})),l},c=f(a).groupQueryChange;return d(c,(function(){o.value=r.value.some((function(e){return!0===e.visible}))})),{visible:o,ns:l}}});var Ke=O(je,[["render",function(e,t,n,l,o,i){return x((I(),L("ul",{class:V(e.ns.be("group","wrap"))},[P("li",{class:V(e.ns.be("group","title"))},M(e.label),3),P("li",null,[P("ul",{class:V(e.ns.b("group"))},[T(e.$slots,"default")],2)])],2)),[[w,e.visible]])}],["__file","/home/runner/work/element-plus/element-plus/packages/components/select/src/option-group.vue"]]);t("E",Se(Fe,{Option:ke,OptionGroup:Ke})),t("a",Ce(ke)),t("b",Ce(Ke))}}}))}();
|