2026-07-14 12:58:42 +03:30
|
|
|
import{ap as V,aD as xe,d as Se,ai as z,h as Z,g as ce,aA as Ge,b as N,a7 as ye,am as te,a6 as tn,V as jt,aF as je,a5 as on,v as Re,E as me,e as mn,F as ze,P as Xe,aK as we,x as Wt,r as He,a9 as Ae,bu as Kt,aV as bn,al as an,X as zt,ao as tt,b6 as Ut,K as Gt,aZ as _e,aX as Sn,O as We,an as Xt,be as Jt,aa as Ee,aE as Je,ag as Zt,aj as Qt,aC as ot,ae as wn,ay as qt,bx as Te,aH as Pe}from"./index-20d5dab1.js";import{_ as eo}from"./toArray-fb96c8b9.js";import{c as no,a4 as to,K as q,e as Fe,a1 as oo,a5 as ao}from"./isSymbol-f04930e1.js";import{c as at,R as ro,o as rn}from"./vnode-18b1f518.js";import{b as io,S as lo,u as uo}from"./FormItemContext-28b30746.js";import{p as Cn}from"./pickAttrs-93039156.js";import{i as co,u as jn,a as Wn}from"./useState-3cc4a0be.js";import{i as Mn,w as $e}from"./_plugin-vue_export-helper-26f60d29.js";import{W as so}from"./button.vue_vue_type_style_index_0_lang-95946c23.js";function Kn(n,e){var t=n.key,o;return"value"in n&&(o=n.value),t??(o!==void 0?o:"rc-index-key-".concat(e))}function rt(n,e){var t=n||{},o=t.label,a=t.value,r=t.options;return{label:o||(e?"children":"label"),value:a||"value",options:r||"options"}}function fo(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.fieldNames,o=e.childrenAsData,a=[],r=rt(t,!1),i=r.label,l=r.value,c=r.options;function d(f,u){f.forEach(function(s){var v=s[i];if(u||!(c in s)){var x=s[l];a.push({key:Kn(s,a.length),groupOption:u,data:s,label:v,value:x})}else{var h=v;h===void 0&&o&&(h=s.label),a.push({key:Kn(s,a.length),group:!0,data:s,label:h}),d(s[c],!0)}})}return d(n,!1),a}function gn(n){var e=V({},n);return"props"in e||Object.defineProperty(e,"props",{get:function(){return e}}),e}function vo(n,e){if(!e||!e.length)return null;var t=!1;function o(r,i){var l=eo(i),c=l[0],d=l.slice(1);if(!c)return[r];var f=r.split(c);return t=t||f.length>1,f.reduce(function(u,s){return[].concat(xe(u),xe(o(s,d)))},[]).filter(function(u){return u})}var a=o(n,e);return t?a:null}var ho=["empty"],po=function(e){var t=e===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1}}}},mo=Se({name:"SelectTrigger",inheritAttrs:!1,props:{dropdownAlign:Object,visible:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},dropdownClassName:String,dropdownStyle:z.object,placement:String,empty:{type:Boolean,default:void 0},prefixCls:String,popupClassName:String,animation:String,transitionName:String,getPopupContainer:Function,dropdownRender:Function,containerWidth:Number,dropdownMatchSelectWidth:z.oneOfType([Number,Boolean]).def(!0),popupElement:z.any,direction:String,getTriggerDOMNode:Function,onPopupVisibleChange:Function,onPopupMouseEnter:Function},setup:function(e,t){var o=t.slots,a=t.attrs,r=t.expose,i=Z(function(){var c=e.dropdownMatchSelectWidth;return po(c)}),l=ce();return r({getPopupElement:function(){return l.value}}),function(){var c=V(V({},e),a),d=c.empty,f=d===void 0?!1:d,u=Ge(c,ho),s=u.visible,v=u.dropdownAlign,x=u.prefixCls,h=u.popupElement,I=u.dropdownClassName,D=u.dropdownStyle,k=u.direction,W=k===void 0?"ltr":k,A=u.placement,L=u.dropdownMatchSelectWidth,w=u.containerWidth,C=u.dropdownRender,R=u.animation,b=u.transitionName,y=u.getPopupContainer,E=u.getTriggerDOMNode,F=u.onPopupVisibleChange,M=u.onPopupMouseEnter,p="".concat(x,"-dropdown"),m=h;C&&(m=C({menuNode:h,props:e}));var $=R?"".concat(p,"-").concat(R):b,S=V({minWidth:"".concat(w,"px")},D);return typeof L=="number"?S.width="".concat(L,"px"):L&&(S.width="".concat(w,"px")),N(no,V(V({},e),{},{showAction:F?["click"]:[],hideAction:F?["click"]:[],popupPlacement:A||(W==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:i.value,prefixCls:p,popupTransitionName:$,popupAlign:v,popupVisible:s,getPopupContainer:y,popupClassName:ye(I,te({},"".concat(p,"-empty"),f)),popupStyle:S,getTriggerDOMNode:E,onPopupVisibleChange:F}),{default:o.default,pop
|
2026-07-13 14:00:01 +03:30
|
|
|
`].includes(B)})}),m=function(g,Y,ue){var ie,le=!0,pe=g;(ie=e.onActiveValueChange)===null||ie===void 0||ie.call(e,null);var ve=ue?null:vo(g,e.tokenSeparators);if(e.mode!=="combobox"&&ve){var J;pe="",(J=e.onSearchSplit)===null||J===void 0||J.call(e,ve),M(!1),le=!1}return e.onSearch&&w.value!==pe&&e.onSearch(pe,{source:Y?"typing":"effect"}),le},$=function(g){var Y;!g||!g.trim()||(Y=e.onSearch)===null||Y===void 0||Y.call(e,g,{source:"submit"})};me(b,function(){!b.value&&!i.value&&e.mode!=="combobox"&&m("",!1,!1)},{immediate:!0,flush:"post"}),me(function(){return e.disabled},function(){R.value&&e.disabled&&y(!1)},{immediate:!0});var S=ut(),P=we(S,2),_=P[0],K=P[1],X=function(g){var Y,ue=_(),ie=g.which;if(ie===q.ENTER&&(e.mode!=="combobox"&&g.preventDefault(),b.value||M(!0)),K(!!w.value),ie===q.BACKSPACE&&!ue&&i.value&&!w.value&&e.displayValues.length){for(var le=xe(e.displayValues),pe=null,ve=le.length-1;ve>=0;ve-=1){var J=le[ve];if(!J.disabled){le.splice(ve,1),pe=J;break}}pe&&e.onDisplayValuesChange(le,{type:"remove",values:[pe]})}for(var T=arguments.length,j=new Array(T>1?T-1:0),G=1;G<T;G++)j[G-1]=arguments[G];if(b.value&&x.value){var ee;(ee=x.value).onKeydown.apply(ee,[g].concat(j))}(Y=e.onKeydown)===null||Y===void 0||Y.call.apply(Y,[e,g].concat(j))},U=function(g){for(var Y=arguments.length,ue=new Array(Y>1?Y-1:0),ie=1;ie<Y;ie++)ue[ie-1]=arguments[ie];if(b.value&&x.value){var le;(le=x.value).onKeyup.apply(le,[g].concat(ue))}e.onKeyup&&e.onKeyup.apply(e,[g].concat(ue))},O=function(g){var Y=e.displayValues.filter(function(ue){return ue!==g});e.onDisplayValuesChange(Y,{type:"remove",values:[g]})},H=ce(!1),Q=function(){k(!0),e.disabled||(e.onFocus&&!H.value&&e.onFocus.apply(e,arguments),e.showAction&&e.showAction.includes("focus")&&M(!0)),H.value=!0},re=function(){if(k(!1,function(){H.value=!1,M(!1)}),!e.disabled){var g=w.value;g&&(e.mode==="tags"?e.onSearch(g,{source:"submit"}):e.mode==="multiple"&&e.onSearch("",{source:"blur"})),e.onBlur&&e.onBlur.apply(e,arguments)}};on("VCSelectContainerEvent",{focus:Q,blur:re});var oe=[];Re(function(){oe.forEach(function(B){return clearTimeout(B)}),oe.splice(0,oe.length)}),Xe(function(){oe.forEach(function(B){return clearTimeout(B)}),oe.splice(0,oe.length)});var fe=function(g){var Y,ue,ie=g.target,le=(Y=s.value)===null||Y===void 0?void 0:Y.getPopupElement();if(le&&le.contains(ie)){var pe=setTimeout(function(){var j=oe.indexOf(pe);if(j!==-1&&oe.splice(j,1),W(),!c.value&&!le.contains(document.activeElement)){var G;(G=v.value)===null||G===void 0||G.focus()}});oe.push(pe)}for(var ve=arguments.length,J=new Array(ve>1?ve-1:0),T=1;T<ve;T++)J[T-1]=arguments[T];(ue=e.onMousedown)===null||ue===void 0||ue.call.apply(ue,[e,g].concat(J))},ae=ce(null),de=zt(),he=function(){de.update()};return Re(function(){me(F,function(){if(F.value){var B,g=Math.ceil((B=f.value)===null||B===void 0?void 0:B.offsetWidth);ae.value!==g&&!Number.isNaN(g)&&(ae.value=g)}},{immediate:!0,flush:"post"})}),$o([f,s],F,M),Po(st(V(V({},Kt(e)),{},{open:b,triggerOpen:F,showSearch:l,multiple:i,toggleOpen:M}))),function(){var B,g=V(V({},e),o),Y=g.prefixCls,ue=g.id;g.open,g.defaultOpen;var ie=g.mode;g.showSearch,g.searchValue,g.onSearch;var le=g.allowClear,pe=g.clearIcon,ve=g.showArrow,J=g.inputIcon,T=g.disabled,j=g.loading,G=g.getInputElement,ee=g.getPopupContainer,ne=g.placement,Ce=g.animation,Oe=g.transitionName,Le=g.dropdownStyle,ge=g.dropdownClassName,Ne=g.dropdownMatchSelectWidth,sn=g.dropdownRender,Rn=g.dropdownAlign;g.showAction;var Be=g.direction;g.tokenSeparators;var De=g.tagRender,Ve=g.optionLabelRender;g.onPopupScroll,g.onDropdownVisibleChange,g.onFocus,g.onBlur,g.onKeyup,g.onKeydown,g.onMousedown;var dn=g.onClear,fn=g.omitDomProps,Ln=g.getRawInputElement,Ze=g.displayValues,_t=g.onDisplayValuesChange,kt=g.emptyOptions,Rt=g.activeDescendantId,Lt=g.activeValue,Nt=g.OptionList,Vt=Ge(g,Fo),Nn=ie==="combobox"&&G&&G()||null,Ye=typeof Ln=="function"&&Ln(),vn=V({},Vt),Vn;Ye&&(Vn=function(Qe){M(Qe)}),_o.forEach(function(Me){delete vn[Me]}),fn==null||fn.forEach(function(Me){delete vn[Me]});var Hn=ve!==void 0?ve:j||!i.value&&ie!=="com
|