@fluid-topics/ft-size-watcher 1.1.69 → 1.1.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- !function(t,e,i,s){var h;t.FtSizeCategory=void 0,(h=t.FtSizeCategory||(t.FtSizeCategory={})).S="S",h.M="M",h.L="L",h.XL="XL",h.XXL="XXL";const r=i.css`
1
+ "use strict";(()=>{var D=Object.create;var b=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var m=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var G=(e,t,i,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of _(t))!E.call(e,s)&&s!==i&&b(e,s,{get:()=>t[s],enumerable:!(h=R(t,s))||h.enumerable});return e};var a=(e,t,i)=>(i=e!=null?D(j(e)):{},G(t||!e||!e.__esModule?b(i,"default",{value:e,enumerable:!0}):i,e));var w=m((T,v)=>{v.exports=ftGlobals.wcUtils});var d=m((W,y)=>{y.exports=ftGlobals.lit});var L=m((A,x)=>{x.exports=ftGlobals.litDecorators});var S=a(w());var O=a(d()),l=a(L()),n=a(w());var o;(function(e){e.S="S",e.M="M",e.L="L",e.XL="XL",e.XXL="XXL"})(o||(o={}));var g=a(d()),P={},X=g.css`
2
2
  .ft-size-watcher--pixel {
3
3
  width: 0;
4
4
  height: 0;
@@ -17,8 +17,8 @@
17
17
  .ft-size-watcher--local .ft-size-watcher--watcher {
18
18
  width: 100%;
19
19
  }
20
- `;var c=function(t,e,i,s){for(var h,r=arguments.length,c=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,a=t.length-1;a>=0;a--)(h=t[a])&&(c=(r<3?h(c):r>3?h(e,i,c):h(e,i))||c);return r>3&&c&&Object.defineProperty(e,i,c),c};class a extends CustomEvent{constructor(t,e){super("change",{detail:{size:t,category:e}})}}class l extends e.FtLitElement{constructor(){super(...arguments),this.debounceTimeout=100,this.local=!1,this.size=0,this.category=t.FtSizeCategory.S,this.resizeObserver=new ResizeObserver((()=>this.updateSize())),this.debouncer=new e.Debouncer}render(){return i.html`
20
+ `;var p=function(e,t,i,h){var s=arguments.length,c=s<3?t:h===null?h=Object.getOwnPropertyDescriptor(t,i):h,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(e,t,i,h);else for(var u=e.length-1;u>=0;u--)(f=e[u])&&(c=(s<3?f(c):s>3?f(t,i,c):f(t,i))||c);return s>3&&c&&Object.defineProperty(t,i,c),c},z=class extends CustomEvent{constructor(t,i){super("change",{detail:{size:t,category:i}})}},r=class extends n.FtLitElement{constructor(){super(...arguments),this.debounceTimeout=100,this.local=!1,this.size=0,this.category=o.S,this.resizeObserver=new ResizeObserver(()=>this.updateSize()),this.debouncer=new n.Debouncer}render(){return O.html`
21
21
  <div class="ft-size-watcher--pixel ${this.local?"ft-size-watcher--local":""}">
22
22
  <div class="ft-size-watcher--watcher"></div>
23
23
  </div>
24
- `}contentAvailableCallback(t){super.contentAvailableCallback(t),this.watcher&&this.resizeObserver.observe(this.watcher),this.updateSize()}updateSize(){this.debouncer.run((()=>{this.watcher&&this.size!==this.watcher.clientWidth&&(this.size=this.watcher.clientWidth,this.size<768?this.category=t.FtSizeCategory.S:this.size<976?this.category=t.FtSizeCategory.M:this.size<1024?this.category=t.FtSizeCategory.L:this.size<1440?this.category=t.FtSizeCategory.XL:this.category=t.FtSizeCategory.XXL,this.dispatchEvent(new a(this.size,this.category)))}),this.debounceTimeout)}}l.elementDefinitions={},l.styles=r,c([s.property({type:Number})],l.prototype,"debounceTimeout",void 0),c([s.property({type:Boolean})],l.prototype,"local",void 0),c([s.property({type:Number,reflect:!0})],l.prototype,"size",void 0),c([s.property({type:String,reflect:!0})],l.prototype,"category",void 0),c([s.query(".ft-size-watcher--watcher")],l.prototype,"watcher",void 0),e.customElement("ft-size-watcher")(l),t.FtSizeChangeEvent=a,t.FtSizeWatcher=l,t.FtSizeWatcherCssVariables={},t.styles=r}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
24
+ `}contentAvailableCallback(t){super.contentAvailableCallback(t),this.watcher&&this.resizeObserver.observe(this.watcher),this.updateSize()}updateSize(){this.debouncer.run(()=>{this.watcher&&this.size!==this.watcher.clientWidth&&(this.size=this.watcher.clientWidth,this.size<768?this.category=o.S:this.size<976?this.category=o.M:this.size<1024?this.category=o.L:this.size<1440?this.category=o.XL:this.category=o.XXL,this.dispatchEvent(new z(this.size,this.category)))},this.debounceTimeout)}};r.elementDefinitions={};r.styles=X;p([(0,l.property)({type:Number})],r.prototype,"debounceTimeout",void 0);p([(0,l.property)({type:Boolean})],r.prototype,"local",void 0);p([(0,l.property)({type:Number,reflect:!0})],r.prototype,"size",void 0);p([(0,l.property)({type:String,reflect:!0})],r.prototype,"category",void 0);p([(0,l.query)(".ft-size-watcher--watcher")],r.prototype,"watcher",void 0);(0,S.customElement)("ft-size-watcher")(r);})();