isVisible-MVh6baoz.js 1.8 KB

12
  1. "use strict";const o=require("./base-component-njT02uAw.js"),v=require("./fadeClass-Co6nOzNJ.js"),r=require("./showClass-D_Ms1FgG.js"),a=require("./popupContainer-DTYSNPih.js"),R="Modal",k="Offcanvas",x="fixed-top",E="fixed-bottom",h="sticky-top",C="position-sticky",m=s=>[...o.jo(x,s),...o.jo(E,s),...o.jo(h,s),...o.jo(C,s),...o.jo("is-fixed",s)],I=s=>{const e=o.So(s);o.Eo(e,{paddingRight:"",overflow:""});const t=m(e);t.length&&t.forEach(c=>{o.Eo(c,{paddingRight:"",marginRight:""})})},y=s=>{const{clientWidth:e}=o.w(s),{innerWidth:t}=o.ve(s);return Math.abs(t-e)},j=(s,e)=>{const t=o.So(s),c=parseInt(o.f(t,"paddingRight"),10),l=o.f(t,"overflow")==="hidden"&&c?0:y(s),f=m(t);e&&(o.Eo(t,{overflow:"hidden",paddingRight:`${c+l}px`}),f.length&&f.forEach(i=>{const w=o.f(i,"paddingRight");if(i.style.paddingRight=`${parseInt(w,10)+l}px`,[h,C].some(d=>o._n(i,d))){const d=o.f(i,"marginRight");i.style.marginRight=`${parseInt(d,10)-l}px`}}))},u="backdrop",p=`${a.modalString}-${u}`,g=`${a.offcanvasString}-${u}`,b=`.${a.modalString}.${r.showClass}`,S=`.${a.offcanvasString}.${r.showClass}`,n=o.se("div"),O=s=>o.Wo(`${b},${S}`,o.d(s)),$=s=>{const e=s?p:g;[p,g].forEach(t=>{o.Zn(n,t)}),o.Gn(n,e)},P=(s,e,t)=>{$(t),a.appendPopup(n,o.So(s)),e&&o.Gn(n,v.fadeClass)},q=()=>{o._n(n,r.showClass)||(o.Gn(n,r.showClass),o.bo(n))},A=()=>{o.Zn(n,r.showClass)},T=s=>{O(s)||(o.Zn(n,v.fadeClass),a.removePopup(n,o.So(s)),I(s))},V=s=>o.b(s)&&o.f(s,"visibility")!=="hidden"&&s.offsetParent!==null;exports.appendOverlay=P;exports.getCurrentOpen=O;exports.hideOverlay=A;exports.isVisible=V;exports.measureScrollbar=y;exports.modalActiveSelector=b;exports.modalComponent=R;exports.offcanvasActiveSelector=S;exports.offcanvasComponent=k;exports.overlay=n;exports.removeOverlay=T;exports.setScrollbar=j;exports.showOverlay=q;exports.toggleOverlayType=$;
  2. //# sourceMappingURL=isVisible-MVh6baoz.js.map