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.c1f63540.js","./index-legacy.8a8e9c42.js"],(function(t){"use strict";var n,o,r,a,l,i,u,c,s,d,p,f,v,y,m,h,w,b,g,C,x,O,P,k,S,z,I,j,A,V,W,E;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,y=e.a0,m=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){E=e.C}],execute:function(){var R=e(n("dropdown-menu"),2),T=R[0],D=R[1],U={overlay:o,zIndex:r,duration:a(.2),direction:l("down"),activeColor:String,closeOnClickOutside:o,closeOnClickOverlay:o},B=Symbol(T),M=i({name:T,props:U,setup:function(e,t){var n=t.slots,o=u(),r=c(),a=c(),l=c(0),i=s(B),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 m("div",{id:"".concat(o,"-").concat(n),role:"button",tabindex:u?void 0:0,class:[D("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})})))}},[m("span",{class:[D("title",{down:i===("down"===e.direction),active:i}),c],style:{color:i?e.activeColor:""}},[m("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)}))})),y("scroll",(function(){O.value&&k()}),{target:x,passive:!0}),function(){var e;return m("div",{ref:r,class:D()},[m("div",{ref:a,style:P.value,class:D("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(B),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()},y=function(t){var o=i.props.activeColor,r=t.value===e.modelValue;return m(E,{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 m(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(m("div",A({style:g,class:q([w]),onClick:v},r),[m(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(y),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?m(k,{to:e.teleport},{default:function(){return[h()]}}):h()}}}});t("a",W(G)),t("D",W(M))}}}))}();
|