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(["./index-legacy.fba2875c.js","./index-legacy.7dcec7b3.js"],(function(n){"use strict";var a,t,r,o,l,i,c,d,s,u,v,p,f,m,b,g,h,y,_,x,A,k,w,C;return{setters:[function(e){a=e.A,t=e.G,r=e.d,o=e.ai,l=e.j,i=e.ax,c=e.N,d=e.I,s=e.E,u=e.S,v=e.as,p=e.V,f=e.bA,m=e.a2,b=e.aq,g=e.aj,h=e.W,y=e.at,_=e.aA,x=e.a7,A=e.a5,k=e.aE},function(e){w=e.c,C=e.C}],execute:function(){var S=e(a("collapse"),2),j=S[0],V=S[1],z=Symbol(j),E={border:t,accordion:Boolean,modelValue:{type:[String,Number,Array],default:""}};var I=r({name:j,props:E,emits:["change","update:modelValue"],setup:function(e,n){var a=n.emit,t=n.slots,r=o(z).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:[V(),(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)])}}}),O=(n("C",c(I)),e(a("collapse-item"),2)),B=O[0],L=O[1],T=["icon","title","value","label","right-icon"],H=d({},w,{name:s,isLink:t,disabled:Boolean,readonly:Boolean,lazyRender:t}),M=r({name:B,props:H,setup:function(e,n){var a=n.slots,t=u(),r=u(),o=v(z),i=o.parent,c=o.index;if(i){var d=p((function(){var n;return null!=(n=e.name)?n:c.value})),s=p((function(){return i.isExpanded(d.value)})),S=u(s.value),j=f((function(){return S.value||!e.lazyRender})),V=function(){s.value?t.value&&(t.value.style.height=""):S.value=!1};m(s,(function(e,n){null!==n&&(e&&(S.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 V()}})))}));var E=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!s.value;i.toggle(d.value,e)},I=function(){e.disabled||e.readonly||E()},O=j((function(){var e;return A(l("div",{ref:t,class:L("wrapper"),onTransitionend:V},[l("div",{ref:r,class:L("content")},[null==(e=a.default)?void 0:e.call(a)])]),[[k,S.value]])}));return g({toggle:E}),function(){return l("div",{class:[L({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:L("title",{disabled:t,expanded:s.value,borderless:!n}),"aria-expanded":String(s.value),onClick:I},o),_(a,T))),O()]);var n,t,r,o}}console.error("[Vant] <CollapseItem> must be a child component of <Collapse>.")}});n("a",c(M))}}}))}();
|