index-legacy-c71dc9a3.js 2.5 KB

1
  1. System.register(["./index-legacy-8f644dad.js","./index-legacy-fd9ee597.js"],(function(e,a){"use strict";var l,n,t,r,d,o,s,i,u,c,v,p,g,m,b,f,y,x,h,k,j,V,z,B;return{setters:[e=>{l=e.x,n=e.d,t=e.af,r=e.ad,d=e.a,o=e.aj,s=e.E,i=e.w,u=e.a6,c=e.z,v=e.H,p=e.ar,g=e.c,m=e.aR,b=e.j,f=e.at,y=e.K,x=e.Y,h=e.az,k=e.G,j=e.av,V=e.aB},e=>{z=e.c,B=e.C}],execute:function(){const[a,C]=l("collapse"),S=Symbol(a),E={border:s,accordion:Boolean,modelValue:{type:[String,Number,Array],"default":""}};var N=n({name:a,props:E,emits:["change","update:modelValue"],setup(e,{emit:a,slots:l}){const{linkChildren:n,children:s}=t(S),i=e=>{a("change",e),a("update:modelValue",e)};return r({toggleAll:(a={})=>{if(e.accordion)return;"boolean"==typeof a&&(a={expanded:a});const{expanded:l,skipDisabled:n}=a,t=s.filter((e=>e.disabled&&n?e.expanded.value:null!=l?l:!e.expanded.value)).map((e=>e.itemName.value));i(t)}}),n({toggle:(a,l)=>{const{accordion:n,modelValue:t}=e;i(n?a===t?"":a:l?t.concat(a):t.filter((e=>e!==a)))},isExpanded:a=>{const{accordion:l,modelValue:n}=e;return l?n===a:n.includes(a)}}),()=>{var a;return d("div",{"class":[C(),{[o]:e.border}]},[null==(a=l["default"])?void 0:a.call(l)])}}});e("a",i(N));const[R,w]=l("collapse-item"),A=["icon","title","value","label","right-icon"],H=u({},z,{name:c,isLink:s,disabled:Boolean,readonly:Boolean,lazyRender:s});var L=n({name:R,props:H,setup(e,{slots:a}){const l=v(),n=v(),{parent:t,index:o}=p(S);if(!t)return;const s=g((()=>{var a;return null!=(a=e.name)?a:o.value})),i=g((()=>t.isExpanded(s.value))),u=v(i.value),c=m((()=>u.value||!e.lazyRender)),C=()=>{i.value?l.value&&(l.value.style.height=""):u.value=!1};b(i,((e,a)=>{null!==a&&(e&&(u.value=!0),(e?y:x)((()=>{if(!n.value||!l.value)return;const{offsetHeight:a}=n.value;if(a){const n=`${a}px`;l.value.style.height=e?"0":n,f((()=>{l.value&&(l.value.style.height=e?n:"0")}))}else C()})))}));const E=(e=!i.value)=>{t.toggle(s.value,e)},N=()=>{e.disabled||e.readonly||E()},R=()=>{const{border:l,disabled:n,readonly:t}=e,r=h(e,Object.keys(z));return t&&(r.isLink=!1),(n||t)&&(r.clickable=!1),d(B,k({role:"button","class":w("title",{disabled:n,expanded:i.value,borderless:!l}),"aria-expanded":String(i.value),onClick:N},r),h(a,A))},H=c((()=>{var e;return j(d("div",{ref:l,"class":w("wrapper"),onTransitionend:C},[d("div",{ref:n,"class":w("content")},[null==(e=a["default"])?void 0:e.call(a)])]),[[V,u.value]])}));return r({toggle:E,expanded:i,itemName:s}),()=>d("div",{"class":[w({border:o.value&&e.border})]},[R(),H()])}});e("C",i(L))}}}));