1 |
- !function(){function e(e,a){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var a=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==a)return;var t,r,o=[],l=!0,i=!1;try{for(a=a.call(e);!(l=(t=a.next()).done)&&(o.push(t.value),!n||o.length!==n);l=!0);}catch(c){i=!0,r=c}finally{try{l||null==a.return||a.return()}finally{if(i)throw r}}return o}(e,a)||function(e,a){if(!e)return;if("string"==typeof e)return n(e,a);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,a)}(e,a)||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 a=0,t=new Array(n);a<n;a++)t[a]=e[a];return t}var a=document.createElement("style");a.innerHTML=':root{--van-collapse-item-transition-duration: var(--van-animation-duration-base);--van-collapse-item-content-padding: var(--van-padding-sm) var(--van-padding-md);--van-collapse-item-content-font-size: var(--van-font-size-md);--van-collapse-item-content-line-height: 1.5;--van-collapse-item-content-text-color: var(--van-text-color-2);--van-collapse-item-content-background-color: var(--van-background-color-light);--van-collapse-item-title-disabled-color: var(--van-text-color-3)}.van-collapse-item{position:relative}.van-collapse-item--border:after{position:absolute;box-sizing:border-box;content:" ";pointer-events:none;top:0;right:var(--van-padding-md);left:var(--van-padding-md);border-top:.02667rem solid var(--van-border-color);transform:scaleY(.5)}.van-collapse-item__title .van-cell__right-icon:before{transform:rotate(90deg) translateZ(0);transition:transform var(--van-collapse-item-transition-duration)}.van-collapse-item__title:after{right:var(--van-padding-md);display:none}.van-collapse-item__title--expanded .van-cell__right-icon:before{transform:rotate(-90deg)}.van-collapse-item__title--expanded:after{display:block}.van-collapse-item__title--borderless:after{display:none}.van-collapse-item__title--disabled{cursor:not-allowed}.van-collapse-item__title--disabled,.van-collapse-item__title--disabled .van-cell__right-icon{color:var(--van-collapse-item-title-disabled-color)}.van-collapse-item__wrapper{overflow:hidden;transition:height var(--van-collapse-item-transition-duration) ease-in-out;will-change:height}.van-collapse-item__content{padding:var(--van-collapse-item-content-padding);color:var(--van-collapse-item-content-text-color);font-size:var(--van-collapse-item-content-font-size);line-height:var(--van-collapse-item-content-line-height);background:var(--van-collapse-item-content-background-color)}\n',document.head.appendChild(a),System.register(["./ResizeObserver.es-legacy.8d60aee1.js","./index-legacy.610f0a70.js"],(function(n){"use strict";var a,t,r,o,l,i,c,s,d,u,v,p,f,m,b,g,h,y,_,x,A,k,w,C;return{setters:[function(e){a=e.E,t=e.H,r=e.d,o=e.aj,l=e.j,i=e.ay,c=e.O,s=e.J,d=e.G,u=e.U,v=e.at,p=e.W,f=e.bD,m=e.a3,b=e.ar,g=e.ak,h=e.X,y=e.au,_=e.aB,x=e.a8,A=e.a6,k=e.aF},function(e){w=e.c,C=e.C}],execute:function(){var j=e(a("collapse"),2),S=j[0],z=j[1],V=Symbol(S),O={border:t,accordion:Boolean,modelValue:{type:[String,Number,Array],default:""}};var E=r({name:S,props:O,emits:["change","update:modelValue"],setup:function(e,n){var a=n.emit,t=n.slots,r=o(V).linkChildren,c=function(e){a("change",e),a("update:modelValue",e)};return r({toggle:function(n,a){var t=e.accordion,r=e.modelValue;c(t?n===r?"":n:a?r.concat(n):r.filter((function(e){return e!==n})))},isExpanded:function(n){var a=e.accordion,t=e.modelValue;return!!function(e,n){return n&&Array.isArray(e)?(console.error('[Vant] Collapse: "v-model" should not be Array in accordion mode'),!1):!(!n&&!Array.isArray(e)&&(console.error('[Vant] Collapse: "v-model" should be Array in non-accordion mode'),1))}(t,a)&&(a?t===n:t.includes(n))}}),function(){var n,a,r,o;return l("div",{class:[z(),(a={},r=i,o=e.border,r in a?Object.defineProperty(a,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):a[r]=o,a)]},[null==(n=t.default)?void 0:n.call(t)])}}}),B=(n("C",c(E)),e(a("collapse-item"),2)),I=B[0],H=B[1],L=["icon","title","value","label","right-icon"],R=s({},w,{name:d,isLink:t,disabled:Boolean,readonly:Boolean,lazyRender:t}),T=r({name:I,props:R,setup:function(e,n){var a=n.slots,t=u(),r=u(),o=v(V),i=o.parent,c=o.index;if(i){var s=p((function(){var n;return null!=(n=e.name)?n:c.value})),d=p((function(){return i.isExpanded(s.value)})),j=u(d.value),S=f((function(){return j.value||!e.lazyRender})),z=function(){d.value?t.value&&(t.value.style.height=""):j.value=!1};m(d,(function(e,n){null!==n&&(e&&(j.value=!0),(e?h:y)((function(){if(r.value&&t.value){var n=r.value.offsetHeight;if(n){var a="".concat(n,"px");t.value.style.height=e?"0":a,b((function(){t.value&&(t.value.style.height=e?a:"0")}))}else z()}})))}));var O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!d.value;i.toggle(s.value,e)},E=function(){e.disabled||e.readonly||O()},B=S((function(){var e;return A(l("div",{ref:t,class:H("wrapper"),onTransitionend:z},[l("div",{ref:r,class:H("content")},[null==(e=a.default)?void 0:e.call(a)])]),[[k,j.value]])}));return g({toggle:O}),function(){return l("div",{class:[H({border:c.value&&e.border})]},[(n=e.border,t=e.disabled,r=e.readonly,o=_(e,Object.keys(w)),r&&(o.isLink=!1),(t||r)&&(o.clickable=!1),l(C,x({role:"button",class:H("title",{disabled:t,expanded:d.value,borderless:!n}),"aria-expanded":String(d.value),onClick:E},o),_(a,L))),B()]);var n,t,r,o}}console.error("[Vant] <CollapseItem> must be a child component of <Collapse>.")}});n("a",c(T))}}}))}();
|