Files
qhmes/deploy-qhmes/frontend/js/freeTableBorders-DHo40MDb.js
2026-05-15 11:34:12 +08:00

2 lines
1.6 KiB
Java

import{l as k}from"./freeTableTracks-CfeiVurn.js";import{g as T}from"./freeTableGrid-BXWKfNhh.js";function z(r){const t=r==null?void 0:r.outerBorder;return{top:(t==null?void 0:t.top)!==!1,right:(t==null?void 0:t.right)!==!1,bottom:(t==null?void 0:t.bottom)!==!1,left:(t==null?void 0:t.left)!==!1}}function h(r){const t=r==null?void 0:r.innerBorder;return{horizontal:(t==null?void 0:t.horizontal)!==!1,vertical:(t==null?void 0:t.vertical)!==!1}}function E(r,t,e,i,f,d,b,u,B){const a=z(r),$=h(r),x=i+d-1,F=f+b-1;let g=i===0?a.top:$.horizontal,p=F===B-1?a.right:$.vertical,m=x===u-1?a.bottom:$.horizontal,v=f===0?a.left:$.vertical;if((e==null?void 0:e.hideBorderTop)===!0&&(g=!1),(e==null?void 0:e.hideBorderRight)===!0&&(p=!1),(e==null?void 0:e.hideBorderBottom)===!0&&(m=!1),(e==null?void 0:e.hideBorderLeft)===!0&&(v=!1),g&&i>0)for(let s=f;s<=f+b-1;s+=1){const o=T(t,i-1,s);if((o==null?void 0:o.hideBorderBottom)===!0){g=!1;break}}if(m&&x<u-1){const s=i+d;for(let o=f;o<=f+b-1;o+=1){const n=T(t,s,o);if((n==null?void 0:n.hideBorderTop)===!0){m=!1;break}}}if(v&&f>0)for(let s=i;s<=i+d-1;s+=1){const o=T(t,s,f-1);if((o==null?void 0:o.hideBorderRight)===!0){v=!1;break}}if(p&&F<B-1){const s=f+b;for(let o=i;o<=i+d-1;o+=1){const n=T(t,o,s);if((n==null?void 0:n.hideBorderLeft)===!0){p=!1;break}}}return{top:g,right:p,bottom:m,left:v}}function L(r,t,e,i){const f=a=>i?k(i[a]):"solid",d=r.top?`${t}px ${f("top")} ${e}`:"none",b=r.right?`${t}px ${f("right")} ${e}`:"none",u=r.bottom?`${t}px ${f("bottom")} ${e}`:"none",B=r.left?`${t}px ${f("left")} ${e}`:"none";return`border-top:${d};border-right:${b};border-bottom:${u};border-left:${B};`}export{L as b,E as r};