@cbpds/web-components
Version:
Web components for the CBP Design System.
5 lines • 1.05 kB
JavaScript
/*!
* CPB Design System web components - built with Stencil
*/
import{r as t,c as e,h as s,a as i,g as r}from"./p-436f46fe.js";const o="cbp-resize-observer{max-width:100%;display:block;overflow:visible}";const h=o;const c=class{constructor(s){t(this,s);this.resized=e(this,"resized",7);this.debounce=0}async getCurrentSize(){return this.getClientRect()}getClientRect(){return this.host.getBoundingClientRect()}componentDidLoad(){this.observedEl=this.host;this.observer=new ResizeObserver((([{contentRect:t}])=>{const{width:e,height:s,top:i,bottom:r,left:o,right:h,x:c,y:b}=t;const n={host:this.host,width:e,height:s,top:i,bottom:r,left:o,right:h,x:c,y:b};this.resized.emit(n)}));this.observer.observe(this.observedEl)}disconnectedCallback(){if(this.observer){this.observer.unobserve(this.observedEl)}}render(){return s(i,{key:"cf5ffc573fe64cbc9e7cb469edbe2758c6a4fd66"},s("slot",{key:"77b1f2e34121b5c5bb5106199bbfaa23bb015716"}))}get host(){return r(this)}};c.style=h;export{c as cbp_resize_observer};
//# sourceMappingURL=p-544aa780.entry.js.map