@fluid-topics/ft-size-watcher 2.0.26 → 2.0.28
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.
- package/build/define.js +3 -3
- package/build/definitions.d.ts +5 -0
- package/build/definitions.js +4 -0
- package/build/ft-size-watcher.light.js +2 -2
- package/build/ft-size-watcher.min.js +27 -129
- package/package.json +3 -3
package/build/define.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { customElements } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import definitions from "./definitions";
|
|
3
|
+
customElements(definitions);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
1
|
+
"use strict";(()=>{var R=Object.create;var b=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var M=(e,t,i,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of j(t))!G.call(e,s)&&s!==i&&b(e,s,{get:()=>t[s],enumerable:!(h=_(t,s))||h.enumerable});return e};var a=(e,t,i)=>(i=e!=null?R(E(e)):{},M(t||!e||!e.__esModule?b(i,"default",{value:e,enumerable:!0}):i,e));var w=d((W,v)=>{v.exports=ftGlobals.wcUtils});var m=d((A,y)=>{y.exports=ftGlobals.lit});var L=d((N,x)=>{x.exports=ftGlobals.litDecorators});var D=a(w());var O=a(m()),l=a(L()),f=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(m());var X=g.css`
|
|
2
2
|
.ft-size-watcher--pixel {
|
|
3
3
|
width: 0;
|
|
4
4
|
height: 0;
|
|
@@ -21,4 +21,4 @@
|
|
|
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=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);
|
|
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);var S={"ft-size-watcher":r};(0,D.customElements)(S);})();
|