index-legacy-b59cd8cb.js 5.7 KB

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