index-legacy.e153d66c.js 4.2 KB

1
  1. !function(){function e(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var t,a,l=[],o=!0,i=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(l.push(t.value),!n||l.length!==n);o=!0);}catch(u){i=!0,a=u}finally{try{o||null==r.return||r.return()}finally{if(i)throw a}}return l}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return n(e,r);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,r)}(e,r)||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 r=0,t=new Array(n);r<n;r++)t[r]=e[r];return t}System.register(["./index-legacy.90c82f08.js","./index-legacy.f3e5e283.js"],(function(n){"use strict";var r,t,a,l,o,i,u,c,d,s,f,v,p,y,m,b,g,h,x,A,C,S,V,j;return{setters:[function(e){r=e.t,t=e.v,a=e.d,l=e.x,o=e.W,i=e.c,u=e.G,c=e.D,d=e.N,s=e.z,f=e.R,v=e.C,p=e.y,y=e.b2,m=e.Z,b=e.aT,g=e._,h=e.aI,x=e.am,A=e.E,C=e.ac,S=e.ay},function(e){V=e.c,j=e.C}],execute:function(){var k=e(r("collapse"),2),w=k[0],I=k[1],E=Symbol(w),N={border:t,accordion:Boolean,modelValue:{type:[String,Number,Array],default:""}};var O=a({name:w,props:N,emits:["change","update:modelValue"],setup:function(e,n){var r=n.emit,t=n.slots,a=l(E),c=a.linkChildren,d=a.children,s=function(e){r("change",e),r("update:modelValue",e)};return o({toggleAll:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.accordion){"boolean"==typeof n&&(n={expanded:n});var r=n,t=r.expanded,a=r.skipDisabled,l=d.filter((function(e){return e.disabled&&a?e.expanded.value:null!=t?t:!e.expanded.value})),o=l.map((function(e){return e.itemName.value}));s(o)}}}),c({toggle:function(n,r){var t=e.accordion,a=e.modelValue;s(t?n===a?"":n:r?a.concat(n):a.filter((function(e){return e!==n})))},isExpanded:function(n){var r=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,r)&&(r?t===n:t.includes(n))}}),function(){var n,r,a,l;return i("div",{class:[I(),(r={},a=u,l=e.border,a in r?Object.defineProperty(r,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):r[a]=l,r)]},[null==(n=t.default)?void 0:n.call(t)])}}}),z=(n("C",c(O)),e(r("collapse-item"),2)),B=z[0],R=z[1],T=["icon","title","value","label","right-icon"],D=d({},V,{name:s,isLink:t,disabled:Boolean,readonly:Boolean,lazyRender:t}),L=a({name:B,props:D,setup:function(e,n){var r=n.slots,t=f(),a=f(),l=v(E),u=l.parent,c=l.index;if(u){var d=p((function(){var n;return null!=(n=e.name)?n:c.value})),s=p((function(){return u.isExpanded(d.value)})),k=f(s.value),w=y((function(){return k.value||!e.lazyRender})),I=function(){s.value?t.value&&(t.value.style.height=""):k.value=!1};m(s,(function(e,n){null!==n&&(e&&(k.value=!0),(e?g:h)((function(){if(a.value&&t.value){var n=a.value.offsetHeight;if(n){var r="".concat(n,"px");t.value.style.height=e?"0":r,b((function(){t.value&&(t.value.style.height=e?r:"0")}))}else I()}})))}));var N=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!s.value;u.toggle(d.value,e)},O=function(){e.disabled||e.readonly||N()},z=w((function(){var e;return C(i("div",{ref:t,class:R("wrapper"),onTransitionend:I},[i("div",{ref:a,class:R("content")},[null==(e=r.default)?void 0:e.call(r)])]),[[S,k.value]])}));return o({toggle:N,expanded:s,itemName:d}),function(){return i("div",{class:[R({border:c.value&&e.border})]},[(n=e.border,t=e.disabled,a=e.readonly,l=x(e,Object.keys(V)),a&&(l.isLink=!1),(t||a)&&(l.clickable=!1),i(j,A({role:"button",class:R("title",{disabled:t,expanded:s.value,borderless:!n}),"aria-expanded":String(s.value),onClick:O},l),x(r,T))),z()]);var n,t,a,l}}console.error("[Vant] <CollapseItem> must be a child component of <Collapse>.")}});n("a",c(L))}}}))}();