UNPKG

@aplus-frontend/ui

Version:

2 lines (1 loc) 1.17 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("vue");function w(l,e){return l.collapsible&&e.collapsible?l.showCollapsibleIcon===!0||e.showCollapsibleIcon===!0?!0:l.showCollapsibleIcon==="auto"||e.showCollapsibleIcon==="auto"?"auto":!1:l.collapsible?l.showCollapsibleIcon:e.collapsible?e.showCollapsibleIcon:!1}const R=(l,e,i)=>b.computed(()=>{const r=[],c=b.unref(l),p=b.unref(e);for(let o=0;o<c.length-1;o+=1){const d=c[o],f=c[o+1],s=p[o],n=p[o+1],{resizable:z=!0,min:S,collapsible:t}=d,{resizable:m=!0,min:x,collapsible:a}=f,E=z&&m&&(s!==0||!S)&&(n!==0||!x),g=!!t.end&&s>0,v=!!a.start&&n===0&&s>0,u=t.end&&s>0||a.start&&n===0&&s>0,M=!!a.start&&n>0,y=!!t.end&&s===0&&n>0,C=a.start&&n>0||t.end&&s===0&&n>0,I=w({collapsible:g,showCollapsibleIcon:t.showCollapsibleIcon},{collapsible:v,showCollapsibleIcon:a.showCollapsibleIcon}),h=w({collapsible:M,showCollapsibleIcon:a.showCollapsibleIcon},{collapsible:y,showCollapsibleIcon:t.showCollapsibleIcon});r[o]={resizable:E,startCollapsible:!!(i?C:u),endCollapsible:!!(i?u:C),showStartCollapsibleIcon:i?h:I,showEndCollapsibleIcon:i?I:h}}return r});exports.useResizable=R;