1 |
- !function(){function e(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var o,r,a=[],l=!0,i=!1;try{for(n=n.call(e);!(l=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);l=!0);}catch(u){i=!0,r=u}finally{try{l||null==n.return||n.return()}finally{if(i)throw r}}return a}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return t(e,n);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return t(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}System.register(["./index-legacy.90c82f08.js","./index-legacy.f3e5e283.js"],(function(t){"use strict";var n,o,r,a,l,i,u,c,s,d,p,f,v,m,y,h,w,b,g,C,x,O,P,k,S,z,I,j,A,V,W,D;return{setters:[function(e){n=e.t,o=e.v,r=e.z,a=e.w,l=e.u,i=e.d,u=e.Q,c=e.R,s=e.x,d=e.ap,p=e.y,f=e.a1,v=e.as,m=e.a0,y=e.c,h=e.at,w=e.an,b=e.au,g=e.av,C=e.O,x=e.r,O=e.C,P=e.W,k=e.aw,S=e.ax,z=e.ac,I=e.ay,j=e.P,A=e.E,V=e.a5,W=e.D},function(e){D=e.C}],execute:function(){var E=e(n("dropdown-menu"),2),R=E[0],T=E[1],M={overlay:o,zIndex:r,duration:a(.2),direction:l("down"),activeColor:String,closeOnClickOutside:o,closeOnClickOverlay:o},U=Symbol(R),B=i({name:R,props:M,setup:function(e,t){var n=t.slots,o=u(),r=c(),a=c(),l=c(0),i=s(U),g=i.children,C=i.linkChildren,x=d(r),O=p((function(){return g.some((function(e){return e.state.showWrapper}))})),P=p((function(){if(O.value&&f(e.zIndex))return{zIndex:+e.zIndex+1}})),k=function(){if(a.value){var t=w(a);"down"===e.direction?l.value=t.bottom:l.value=b.value-t.top}},S=function(t,n){var r,a,l,i=t.state.showPopup,u=t.disabled,c=t.titleClass;return y("div",{id:"".concat(o,"-").concat(n),role:"button",tabindex:u?void 0:0,class:[T("item",{disabled:u}),(r={},a=h,l=!u,a in r?Object.defineProperty(r,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):r[a]=l,r)],onClick:function(){var e;u||(e=n,g.forEach((function(t,n){n===e?(k(),t.toggle()):t.state.showPopup&&t.toggle(!1,{immediate:!0})})))}},[y("span",{class:[T("title",{down:i===("down"===e.direction),active:i}),c],style:{color:i?e.activeColor:""}},[y("div",{class:"van-ellipsis"},[t.renderTitle()])])])};return C({id:o,props:e,offset:l}),v(r,(function(){e.closeOnClickOutside&&g.forEach((function(e){e.toggle(!1)}))})),m("scroll",(function(){O.value&&k()}),{target:x,passive:!0}),function(){var e;return y("div",{ref:r,class:T()},[y("div",{ref:a,style:P.value,class:T("bar",{opened:O.value})},[g.map(S)]),null==(e=n.default)?void 0:e.call(n)])}}}),Q=e(n("dropdown-item"),2),$=Q[0],q=Q[1],F={title:String,options:g(),disabled:Boolean,teleport:[String,Object],lazyRender:o,modelValue:C,titleClass:C},G=i({name:$,inheritAttrs:!1,props:F,emits:["open","opened","close","closed","change","update:modelValue"],setup:function(e,t){var n=t.emit,o=t.slots,r=t.attrs,a=x({showPopup:!1,transition:!0,showWrapper:!1}),l=O(U),i=l.parent,u=l.index;if(i){var c=function(e){return function(){return n(e)}},s=c("open"),d=c("close"),p=c("opened"),f=function(){a.showWrapper=!1,n("closed")},v=function(t){e.teleport&&t.stopPropagation()},m=function(t){var o=i.props.activeColor,r=t.value===e.modelValue;return y(D,{role:"menuitem",key:t.value,icon:t.icon,title:t.text,class:q("option",{active:r}),style:{color:r?o:""},tabindex:r?0:-1,clickable:!0,onClick:function(){a.showPopup=!1,t.value!==e.modelValue&&(n("update:modelValue",t.value),n("change",t.value))}},{value:function(){if(r)return y(V,{class:q("icon"),color:o,name:"success"},null)}})},h=function(){var t=i.offset,n=i.props,l=n.zIndex,c=n.overlay,h=n.duration,w=n.direction,b=n.closeOnClickOverlay,g=S(l);return"down"===w?g.top="".concat(t.value,"px"):g.bottom="".concat(t.value,"px"),z(y("div",A({style:g,class:q([w]),onClick:v},r),[y(j,{show:a.showPopup,"onUpdate:show":function(e){return a.showPopup=e},role:"menu",class:q("content"),overlay:c,position:"down"===w?"top":"bottom",duration:a.transition?h:0,lazyRender:e.lazyRender,overlayStyle:{position:"absolute"},"aria-labelledby":"".concat(i.id,"-").concat(u.value),closeOnClickOverlay:b,onOpen:s,onClose:d,onOpened:p,onClosed:f},{default:function(){var t;return[e.options.map(m),null==(t=o.default)?void 0:t.call(o)]}})]),[[I,a.showWrapper]])};return P({state:a,toggle:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!a.showPopup,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e!==a.showPopup&&(a.showPopup=e,a.transition=!t.immediate,e&&(a.showWrapper=!0))},renderTitle:function(){if(o.title)return o.title();if(e.title)return e.title;var t=e.options.find((function(t){return t.value===e.modelValue}));return t?t.text:""}}),function(){return e.teleport?y(k,{to:e.teleport},{default:function(){return[h()]}}):h()}}console.error("[Vant] <DropdownItem> must be a child component of <DropdownMenu>.")}});t("a",W(G)),t("D",W(B))}}}))}();
|