index-legacy-c347537c.js 5.7 KB

1
  1. !function(){function e(t){return e="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},e(t)}function t(t,n,o){return(n=function(t){var n=function(t,n){if("object"!==e(t)||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var r=o.call(t,n||"default");if("object"!==e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"===e(n)?n:String(n)}(n))in t?Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[n]=o,t}function n(e,t){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){var o,r,i,l,a=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(o=i.call(n)).done)&&(a.push(o.value),a.length!==t);u=!0);}catch(s){c=!0,r=s}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw r}}return a}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e,t)||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 o(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-64376843.js","./index-legacy-a7502a0a.js"],(function(e,o){"use strict";var r,i,l,a,u,c,s,f,p,d,v,y,m,b,h,g,w,O,S,x,C,P,j,k,I,z,A,V,E,W,T,D;return{setters:[function(e){r=e.j,i=e.v,l=e.t,a=e.ao,u=e.n,c=e.d,s=e.aG,f=e.i,p=e.ac,d=e.aD,v=e.E,y=e.ay,m=e.u,b=e.ak,h=e.g,g=e.Y,w=e.ar,O=e.as,S=e.O,x=e.ae,C=e.aH,P=e.q,j=e.x,k=e.aI,I=e.az,z=e.aA,A=e.P,V=e.m,E=e.ap,W=e.I,T=e.D},function(e){D=e.C}],execute:function(){var o=n(r("dropdown-menu"),2),R=o[0],U=o[1],q={overlay:i,zIndex:l,duration:a(.2),direction:u("down"),activeColor:String,closeOnClickOutside:i,closeOnClickOverlay:i},B=Symbol(R),G=c({name:R,props:q,setup:function(e,n){var o=n.slots,r=s(),i=f(),l=f(),a=f(0),u=p(B),c=u.children,S=u.linkChildren,x=d(i),C=v((function(){return c.some((function(e){return e.state.showWrapper}))})),P=v((function(){if(C.value&&y(e.zIndex))return{zIndex:+e.zIndex+1}})),j=function(){if(l.value){var t=g(l);"down"===e.direction?a.value=t.bottom:a.value=w.value-t.top}},k=function(n,o){var i=n.state.showPopup,l=n.disabled,a=n.titleClass;return h("div",{id:"".concat(r,"-").concat(o),role:"button",tabindex:l?void 0:0,class:[U("item",{disabled:l}),t({},O,!l)],onClick:function(){var e;l||(e=o,c.forEach((function(t,n){n===e?t.toggle():t.state.showPopup&&t.toggle(!1,{immediate:!0})})))}},[h("span",{class:[U("title",{down:i===("down"===e.direction),active:i}),a],style:{color:i?e.activeColor:""}},[h("div",{class:"van-ellipsis"},[n.renderTitle()])])])};return S({id:r,props:e,offset:a,updateOffset:j}),m(i,(function(){e.closeOnClickOutside&&c.forEach((function(e){e.toggle(!1)}))})),b("scroll",(function(){C.value&&j()}),{target:x,passive:!0}),function(){var e;return h("div",{ref:i,class:U()},[h("div",{ref:l,style:P.value,class:U("bar",{opened:C.value})},[c.map(k)]),null==(e=o.default)?void 0:e.call(o)])}}}),H=n(r("dropdown-item"),2),M=H[0],N=H[1],Y={title:String,options:P(),disabled:Boolean,teleport:[String,Object],lazyRender:i,modelValue:j,titleClass:j},$=c({name:M,inheritAttrs:!1,props:Y,emits:["open","opened","close","closed","change","update:modelValue"],setup:function(e,t){var n=t.emit,o=t.slots,r=t.attrs,i=S({showPopup:!1,transition:!0,showWrapper:!1}),l=x(B),a=l.parent,u=l.index;if(a){var c=function(e){return function(){return n(e)}},s=c("open"),f=c("close"),p=c("opened"),d=function(){i.showWrapper=!1,n("closed")},v=function(t){e.teleport&&t.stopPropagation()},y=function(t){var o=a.props.activeColor,r=t.value===e.modelValue;return h(D,{role:"menuitem",key:t.value,icon:t.icon,title:t.text,class:N("option",{active:r}),style:{color:r?o:""},tabindex:r?0:-1,clickable:!0,onClick:function(){i.showPopup=!1,t.value!==e.modelValue&&(n("update:modelValue",t.value),n("change",t.value))}},{value:function(){if(r)return h(W,{class:N("icon"),color:o,name:"success"},null)}})},m=function(){var t=a.offset,n=a.props,l=n.zIndex,c=n.overlay,m=n.duration,b=n.direction,g=n.closeOnClickOverlay,w=k(l);return"down"===b?w.top="".concat(t.value,"px"):w.bottom="".concat(t.value,"px"),I(h("div",V({style:w,class:N([b]),onClick:v},r),[h(A,{show:i.showPopup,"onUpdate:show":function(e){return i.showPopup=e},role:"menu",class:N("content"),overlay:c,position:"down"===b?"top":"bottom",duration:i.transition?m:0,lazyRender:e.lazyRender,overlayStyle:{position:"absolute"},"aria-labelledby":"".concat(a.id,"-").concat(u.value),closeOnClickOverlay:g,onOpen:s,onClose:f,onOpened:p,onClosed:d},{default:function(){var t;return[e.options.map(y),null==(t=o.default)?void 0:t.call(o)]}})]),[[z,i.showWrapper]])};return E({state:i,toggle:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!i.showPopup,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e!==i.showPopup&&(i.showPopup=e,i.transition=!t.immediate,e&&(a.updateOffset(),i.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?h(C,{to:e.teleport},{default:function(){return[m()]}}):m()}}}});e("a",T($)),e("D",T(G))}}}))}();