1 |
- !function(){function e(e,o){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==o)return;var t,r,a=[],i=!0,l=!1;try{for(o=o.call(e);!(i=(t=o.next()).done)&&(a.push(t.value),!n||a.length!==n);i=!0);}catch(d){l=!0,r=d}finally{try{i||null==o.return||o.return()}finally{if(l)throw r}}return a}(e,o)||function(e,o){if(!e)return;if("string"==typeof e)return n(e,o);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return n(e,o)}(e,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 n(e,n){(null==n||n>e.length)&&(n=e.length);for(var o=0,t=new Array(n);o<n;o++)t[o]=e[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(["./ResizeObserver.es-legacy.44b91b4c.js","./index-legacy.c8c5bc4e.js","./use-id-legacy.ef8b5e97.js"],(function(n){"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(e){o=e.E,t=e.H,r=e.G,a=e.ab,i=e.a0,l=e.d,d=e.U,u=e.aj,c=e.ac,p=e.W,s=e.M,v=e.bx,m=e.af,f=e.j,w=e.aU,h=e.Y,g=e.am,b=e.aY,y=e.I,x=e.S,_=e.at,C=e.ak,z=e.by,k=e.ae,O=e.a6,S=e.aF,j=e.aS,P=e.N,I=e.O},function(e){V=e.C},function(e){A=e.u}],execute:function(){var W=e(o("dropdown-menu"),2),E=W[0],M=W[1],R={overlay:t,zIndex:r,duration:a(.2),direction:i("down"),activeColor:String,closeOnClickOutside:t,closeOnClickOverlay:t},T=Symbol(E),U=l({name:E,props:R,setup:function(e,n){var o=n.slots,t=A(),r=d(),a=d(),i=d(0),l=u(T),b=l.children,y=l.linkChildren,x=c(r),_=p((function(){return b.some((function(e){return e.state.showWrapper}))})),C=p((function(){if(_.value&&s(e.zIndex))return{zIndex:+e.zIndex+1}})),z=function(){if(a.value){var n=h(a);"down"===e.direction?i.value=n.bottom:i.value=g.value-n.top}},k=function(n,o){var r,a,i,l=n.state.showPopup,d=n.disabled,u=n.titleClass;return f("div",{id:"".concat(t,"-").concat(o),role:"button",tabindex:d?void 0:0,class:[M("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 e;d||(e=o,b.forEach((function(n,o){o===e?(z(),n.toggle()):n.state.showPopup&&n.toggle(!1,{immediate:!0})})))}},[f("span",{class:[M("title",{down:l===("down"===e.direction),active:l}),u],style:{color:l?e.activeColor:""}},[f("div",{class:"van-ellipsis"},[n.renderTitle()])])])};return y({id:t,props:e,offset:i}),v(r,(function(){e.closeOnClickOutside&&b.forEach((function(e){e.toggle(!1)}))})),m("scroll",(function(){_.value&&z()}),{target:x}),function(){var e;return f("div",{ref:r,class:M()},[f("div",{ref:a,style:C.value,class:M("bar",{opened:_.value})},[b.map(k)]),null==(e=o.default)?void 0:e.call(o)])}}}),D=e(o("dropdown-item"),2),H=D[0],Y=D[1],B={title:String,options:b(),disabled:Boolean,teleport:[String,Object],lazyRender:t,modelValue:y,titleClass:y},F=l({name:H,props:B,emits:["open","opened","close","closed","change","update:modelValue"],setup:function(e,n){var o=n.emit,t=n.slots,r=x({showPopup:!1,transition:!0,showWrapper:!1}),a=_(T),i=a.parent,l=a.index;if(i){var d=function(e){return function(){return o(e)}},u=d("open"),c=d("close"),p=d("opened"),s=function(){r.showWrapper=!1,o("closed")},v=function(n){e.teleport&&n.stopPropagation()},m=function(n){var t=i.props.activeColor,a=n.value===e.modelValue;return f(V,{role:"menuitem",key:n.value,icon:n.icon,title:n.text,class:Y("option",{active:a}),style:{color:a?t:""},tabindex:a?0:-1,clickable:!0,onClick:function(){r.showPopup=!1,n.value!==e.modelValue&&(o("update:modelValue",n.value),o("change",n.value))}},{value:function(){if(a)return f(P,{class:Y("icon"),color:t,name:"success"},null)}})},w=function(){var n=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(n.value,"px"):b.bottom="".concat(n.value,"px"),O(f("div",{style:b,class:Y([h]),onClick:v},[f(j,{show:r.showPopup,"onUpdate:show":function(e){return r.showPopup=e},role:"menu",class:Y("content"),overlay:d,position:"down"===h?"top":"bottom",duration:r.transition?w:0,lazyRender:e.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 n;return[e.options.map(m),null==(n=t.default)?void 0:n.call(t)]}})]),[[S,r.showWrapper]])};return C({state:r,toggle:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!r.showPopup,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e!==r.showPopup&&(r.showPopup=e,r.transition=!n.immediate,e&&(r.showWrapper=!0))},renderTitle:function(){if(t.title)return t.title();if(e.title)return e.title;var n=e.options.find((function(n){return n.value===e.modelValue}));return n?n.text:""}}),function(){return e.teleport?f(z,{to:e.teleport},{default:function(){return[w()]}}):w()}}console.error("[Vant] <DropdownItem> must be a child component of <DropdownMenu>.")}});n("a",I(F)),n("D",I(U))}}}))}();
|