index-legacy.3fd38cb5.js 7.7 KB

1
  1. !function(){function n(n,o){return function(n){if(Array.isArray(n))return n}(n)||function(n,e){var o=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null==o)return;var t,r,a=[],i=!0,l=!1;try{for(o=o.call(n);!(i=(t=o.next()).done)&&(a.push(t.value),!e||a.length!==e);i=!0);}catch(d){l=!0,r=d}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}(n,o)||function(n,o){if(!n)return;if("string"==typeof n)return e(n,o);var t=Object.prototype.toString.call(n).slice(8,-1);"Object"===t&&n.constructor&&(t=n.constructor.name);if("Map"===t||"Set"===t)return Array.from(n);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return e(n,o)}(n,o)||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 e(n,e){(null==e||e>n.length)&&(e=n.length);for(var o=0,t=new Array(e);o<e;o++)t[o]=n[o];return t}var o=document.createElement("style");o.innerHTML=':root{--van-dropdown-menu-height: 1.28rem;--van-dropdown-menu-background-color: var(--van-background-color-light);--van-dropdown-menu-box-shadow: 0 .05333rem .32rem rgba(100, 101, 102, .12);--van-dropdown-menu-title-font-size: .4rem;--van-dropdown-menu-title-text-color: var(--van-text-color);--van-dropdown-menu-title-active-text-color: var(--van-danger-color);--van-dropdown-menu-title-disabled-text-color: var(--van-text-color-2);--van-dropdown-menu-title-padding: 0 var(--van-padding-xs);--van-dropdown-menu-title-line-height: var(--van-line-height-lg);--van-dropdown-menu-option-active-color: var(--van-danger-color);--van-dropdown-menu-content-max-height: 80%}.van-dropdown-menu{-webkit-user-select:none;-moz-user-select:none;user-select:none}.van-dropdown-menu__bar{position:relative;display:flex;height:var(--van-dropdown-menu-height);background:var(--van-dropdown-menu-background-color);box-shadow:var(--van-dropdown-menu-box-shadow)}.van-dropdown-menu__bar--opened{z-index:calc(var(--van-dropdown-item-z-index) + 1)}.van-dropdown-menu__item{display:flex;flex:1;align-items:center;justify-content:center;min-width:0}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:var(--van-dropdown-menu-title-disabled-text-color)}.van-dropdown-menu__title{position:relative;box-sizing:border-box;max-width:100%;padding:var(--van-dropdown-menu-title-padding);color:var(--van-dropdown-menu-title-text-color);font-size:var(--van-dropdown-menu-title-font-size);line-height:var(--van-dropdown-menu-title-line-height)}.van-dropdown-menu__title:after{position:absolute;top:50%;right:-.10667rem;margin-top:-.13333rem;border:.08rem solid;border-color:transparent transparent var(--van-gray-4) var(--van-gray-4);transform:rotate(-45deg);opacity:.8;content:""}.van-dropdown-menu__title--active{color:var(--van-dropdown-menu-title-active-text-color)}.van-dropdown-menu__title--active:after{border-color:transparent transparent currentColor currentColor}.van-dropdown-menu__title--down:after{margin-top:-.02667rem;transform:rotate(135deg)}:root{--van-dropdown-item-z-index: 10}.van-dropdown-item{position:fixed;right:0;left:0;z-index:var(--van-dropdown-item-z-index);overflow:hidden}.van-dropdown-item__icon{display:block;line-height:inherit}.van-dropdown-item__option{text-align:left}.van-dropdown-item__option--active,.van-dropdown-item__option--active .van-dropdown-item__icon{color:var(--van-dropdown-menu-option-active-color)}.van-dropdown-item--up{top:0}.van-dropdown-item--down{bottom:0}.van-dropdown-item__content{position:absolute;max-height:var(--van-dropdown-menu-content-max-height)}\n',document.head.appendChild(o),System.register(["./index-legacy.b903c881.js","./index-legacy.b7f666cc.js","./use-id-legacy.29724920.js"],(function(e){"use strict";var o,t,r,a,i,l,d,u,c,p,s,v,m,f,w,h,g,b,y,x,_,C,z,k,O,S,j,P,I,V,A;return{setters:[function(n){o=n.A,t=n.G,r=n.E,a=n.aa,i=n.$,l=n.d,d=n.S,u=n.ai,c=n.ab,p=n.V,s=n.L,v=n.bt,m=n.ae,f=n.j,w=n.aT,h=n.X,g=n.al,b=n.aX,y=n.H,x=n.Q,_=n.as,C=n.aj,z=n.bv,k=n.ad,O=n.a5,S=n.aE,j=n.aR,P=n.M,I=n.N},function(n){V=n.C},function(n){A=n.u}],execute:function(){var E=n(o("dropdown-menu"),2),T=E[0],W=E[1],M={overlay:t,zIndex:r,duration:a(.2),direction:i("down"),activeColor:String,closeOnClickOutside:t,closeOnClickOverlay:t},R=Symbol(T),D=l({name:T,props:M,setup:function(n,e){var o=e.slots,t=A(),r=d(),a=d(),i=d(0),l=u(R),b=l.children,y=l.linkChildren,x=c(r),_=p((function(){return b.some((function(n){return n.state.showWrapper}))})),C=p((function(){if(_.value&&s(n.zIndex))return{zIndex:+n.zIndex+1}})),z=function(){if(a.value){var e=h(a);"down"===n.direction?i.value=e.bottom:i.value=g.value-e.top}},k=function(e,o){var r,a,i,l=e.state.showPopup,d=e.disabled,u=e.titleClass;return f("div",{id:"".concat(t,"-").concat(o),role:"button",tabindex:d?void 0:0,class:[W("item",{disabled:d}),(r={},a=w,i=!d,a in r?Object.defineProperty(r,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[a]=i,r)],onClick:function(){var n;d||(n=o,b.forEach((function(e,o){o===n?(z(),e.toggle()):e.state.showPopup&&e.toggle(!1,{immediate:!0})})))}},[f("span",{class:[W("title",{down:l===("down"===n.direction),active:l}),u],style:{color:l?n.activeColor:""}},[f("div",{class:"van-ellipsis"},[e.renderTitle()])])])};return y({id:t,props:n,offset:i}),v(r,(function(){n.closeOnClickOutside&&b.forEach((function(n){n.toggle(!1)}))})),m("scroll",(function(){_.value&&z()}),{target:x}),function(){var n;return f("div",{ref:r,class:W()},[f("div",{ref:a,style:C.value,class:W("bar",{opened:_.value})},[b.map(k)]),null==(n=o.default)?void 0:n.call(o)])}}}),H=n(o("dropdown-item"),2),L=H[0],U=H[1],X={title:String,options:b(),disabled:Boolean,teleport:[String,Object],lazyRender:t,modelValue:y,titleClass:y},$=l({name:L,props:X,emits:["open","opened","close","closed","change","update:modelValue"],setup:function(n,e){var o=e.emit,t=e.slots,r=x({showPopup:!1,transition:!0,showWrapper:!1}),a=_(R),i=a.parent,l=a.index;if(i){var d=function(n){return function(){return o(n)}},u=d("open"),c=d("close"),p=d("opened"),s=function(){r.showWrapper=!1,o("closed")},v=function(e){n.teleport&&e.stopPropagation()},m=function(e){var t=i.props.activeColor,a=e.value===n.modelValue;return f(V,{role:"menuitem",key:e.value,icon:e.icon,title:e.text,class:U("option",{active:a}),style:{color:a?t:""},tabindex:a?0:-1,clickable:!0,onClick:function(){r.showPopup=!1,e.value!==n.modelValue&&(o("update:modelValue",e.value),o("change",e.value))}},{value:function(){if(a)return f(P,{class:U("icon"),color:t,name:"success"},null)}})},w=function(){var e=i.offset,o=i.props,a=o.zIndex,d=o.overlay,w=o.duration,h=o.direction,g=o.closeOnClickOverlay,b=k(a);return"down"===h?b.top="".concat(e.value,"px"):b.bottom="".concat(e.value,"px"),O(f("div",{style:b,class:U([h]),onClick:v},[f(j,{show:r.showPopup,"onUpdate:show":function(n){return r.showPopup=n},role:"menu",class:U("content"),overlay:d,position:"down"===h?"top":"bottom",duration:r.transition?w:0,lazyRender:n.lazyRender,overlayStyle:{position:"absolute"},"aria-labelledby":"".concat(i.id,"-").concat(l.value),closeOnClickOverlay:g,onOpen:u,onClose:c,onOpened:p,onClosed:s},{default:function(){var e;return[n.options.map(m),null==(e=t.default)?void 0:e.call(t)]}})]),[[S,r.showWrapper]])};return C({state:r,toggle:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!r.showPopup,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n!==r.showPopup&&(r.showPopup=n,r.transition=!e.immediate,n&&(r.showWrapper=!0))},renderTitle:function(){if(t.title)return t.title();if(n.title)return n.title;var e=n.options.find((function(e){return e.value===n.modelValue}));return e?e.text:""}}),function(){return n.teleport?f(z,{to:n.teleport},{default:function(){return[w()]}}):w()}}console.error("[Vant] <DropdownItem> must be a child component of <DropdownMenu>.")}});e("a",I($)),e("D",I(D))}}}))}();