@fluid-topics/ft-size-watcher 1.4.5 → 2.0.1
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.d.ts +1 -0
- package/build/define.js +3 -0
- package/build/ft-size-watcher.light.js +2 -2
- package/build/ft-size-watcher.min.js +1 -1
- package/build/index.js +0 -3
- package/package.json +24 -24
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/define.js
ADDED
|
@@ -1,4 +1,4 @@
|
|
|
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
|
|
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 w=(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 d=w((T,v)=>{v.exports=ftGlobals.wcUtils});var m=w((W,y)=>{y.exports=ftGlobals.lit});var L=w((A,x)=>{x.exports=ftGlobals.litDecorators});var S=a(d());var O=a(m()),l=a(L()),f=a(d());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;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
.ft-size-watcher--local .ft-size-watcher--watcher {
|
|
18
18
|
width: 100%;
|
|
19
19
|
}
|
|
20
|
-
`;var p=function(e,t,i,h){var s=arguments.length,c=s<3?t:h===null?h=Object.getOwnPropertyDescriptor(t,i):h,
|
|
20
|
+
`;var p=function(e,t,i,h){var s=arguments.length,c=s<3?t:h===null?h=Object.getOwnPropertyDescriptor(t,i):h,n;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--)(n=e[u])&&(c=(s<3?n(c):s>3?n(t,i,c):n(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 f.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 f.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>
|
|
@@ -82,7 +82,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
|
|
|
82
82
|
<li>${this.helperText}</li>
|
|
83
83
|
`)}
|
|
84
84
|
</ul>
|
|
85
|
-
`}resolveStatus(){return this.forceStatus?this.forceStatus:this.errorMessages.length?Ye.error:this.warningMessages.length?Ye.warning:Ye.default}processRules(n){return n.map(a=>a(this.value)).filter(a=>a!==!0).map(a=>a)}}return G([k()],e.prototype,"warningRules",void 0),G([k()],e.prototype,"errorRules",void 0),G([k()],e.prototype,"validateOn",void 0),G([k({type:Boolean})],e.prototype,"validateAtRender",void 0),G([k()],e.prototype,"label",void 0),G([k({type:Boolean})],e.prototype,"hideLabel",void 0),G([k()],e.prototype,"name",void 0),G([k({type:Boolean})],e.prototype,"disabled",void 0),G([k()],e.prototype,"helperText",void 0),G([k()],e.prototype,"forceStatus",void 0),G([k({reflect:!0})],e.prototype,"value",void 0),G([ce()],e.prototype,"errorMessages",void 0),G([ce()],e.prototype,"warningMessages",void 0),G([ce()],e.prototype,"status",void 0),G([ce()],e.prototype,"focused",void 0),G([ce()],e.prototype,"additionalWarningRules",void 0),G([ce()],e.prototype,"additionalErrorRules",void 0),e});var jt=(t,e)=>{let o=t._$AN;if(o===void 0)return!1;for(let n of o)n._$AO?.(e,!1),jt(n,e);return!0},Er=t=>{let e,o;do{if((e=t._$AM)===void 0)break;o=e._$AN,o.delete(t),t=e}while(o?.size===0)},Ts=t=>{for(let e;e=t._$AM;t=e){let o=e._$AN;if(o===void 0)e._$AN=o=new Set;else if(o.has(t))break;o.add(t),Hd(e)}};function zd(t){this._$AN!==void 0?(Er(this),this._$AM=t,Ts(this)):this._$AM=t}function $d(t,e=!1,o=0){let n=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(e)if(Array.isArray(n))for(let i=o;i<n.length;i++)jt(n[i],!1),Er(n[i]);else n!=null&&(jt(n,!1),Er(n));else jt(this,t)}var Hd=t=>{t.type==le.CHILD&&(t._$AP??=$d,t._$AQ??=zd)},wr=class extends J{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,o,n){super._$AT(e,o,n),Ts(this),this.isConnected=e._$AU}_$AO(e,o=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),o&&(jt(this,e),Er(this))}setValue(e){if(Xn(this._$Ct))this._$Ct._$AI(e,this);else{let o=[...this._$Ct._$AH];o[this._$Ci]=e,this._$Ct._$AI(o,this,0)}}disconnected(){}reconnected(){}};var Ps;(function(t){t.sm="sm",t.md="md",t.lg="lg",t.xl="xl"})(Ps||(Ps={}));var Wd={sm:640,md:768,lg:1024,xl:1280},In=class extends wr{constructor(e){super(e),this.size=0,this.onResize=()=>{let o=window.innerWidth;this.size!==o&&(this.size=o,this.lastArgs&&this.setValue(this.render(...this.lastArgs)))},this.size=window.innerWidth,window.addEventListener("resize",this.onResize)}disconnected(){window.removeEventListener("resize",this.onResize)}reconnected(){window.addEventListener("resize",this.onResize)}update(e,[o,n,a]){return this.lastArgs=[o,n,a],this.render(o,n,a)}render(e,o,n){let a=this.resolveThreshold(e),i=n??(()=>B);return this.size>a?o():i()}resolveThreshold(e){return typeof e=="number"?e:Wd[e]}},bb=oe(In);var Tn,Pn,Nn,Ln,Gd=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((Nn=(Pn=(Tn=window.safari)===null||Tn===void 0?void 0:Tn.pushNotification)===null||Pn===void 0?void 0:Pn.toString())!==null&&Nn!==void 0?Nn:"")==="[object SafariRemoteNotification]",jd="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(Ln=window.ftGlobals)!==null&&Ln!==void 0?Ln:{lit:Mr,litDecorators:Br,litRepeat:zr,litClassMap:$r,litStyleMap:Hr,litUnsafeHTML:Wr,wcUtils:{...Qr,...jr,...no,...On,...ao,...co,...po,...Xr,...Ro,...An,...Rs,...gn,..._o,...fo,...ko,...vn,...No,...Rn,...di,...Zr,...Fo,...ho,...Mo,..._s,...fi,...Bo,...pn,...wn,...Io,...Po,...bn,...to,isSafari:Gd,isTouchScreen:jd,setVariable:rt}};var be;(function(t){t.S="S",t.M="M",t.L="L",t.XL="XL",t.XXL="XXL"})(be||(be={}));var
|
|
85
|
+
`}resolveStatus(){return this.forceStatus?this.forceStatus:this.errorMessages.length?Ye.error:this.warningMessages.length?Ye.warning:Ye.default}processRules(n){return n.map(a=>a(this.value)).filter(a=>a!==!0).map(a=>a)}}return G([k()],e.prototype,"warningRules",void 0),G([k()],e.prototype,"errorRules",void 0),G([k()],e.prototype,"validateOn",void 0),G([k({type:Boolean})],e.prototype,"validateAtRender",void 0),G([k()],e.prototype,"label",void 0),G([k({type:Boolean})],e.prototype,"hideLabel",void 0),G([k()],e.prototype,"name",void 0),G([k({type:Boolean})],e.prototype,"disabled",void 0),G([k()],e.prototype,"helperText",void 0),G([k()],e.prototype,"forceStatus",void 0),G([k({reflect:!0})],e.prototype,"value",void 0),G([ce()],e.prototype,"errorMessages",void 0),G([ce()],e.prototype,"warningMessages",void 0),G([ce()],e.prototype,"status",void 0),G([ce()],e.prototype,"focused",void 0),G([ce()],e.prototype,"additionalWarningRules",void 0),G([ce()],e.prototype,"additionalErrorRules",void 0),e});var jt=(t,e)=>{let o=t._$AN;if(o===void 0)return!1;for(let n of o)n._$AO?.(e,!1),jt(n,e);return!0},Er=t=>{let e,o;do{if((e=t._$AM)===void 0)break;o=e._$AN,o.delete(t),t=e}while(o?.size===0)},Ts=t=>{for(let e;e=t._$AM;t=e){let o=e._$AN;if(o===void 0)e._$AN=o=new Set;else if(o.has(t))break;o.add(t),Hd(e)}};function zd(t){this._$AN!==void 0?(Er(this),this._$AM=t,Ts(this)):this._$AM=t}function $d(t,e=!1,o=0){let n=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(e)if(Array.isArray(n))for(let i=o;i<n.length;i++)jt(n[i],!1),Er(n[i]);else n!=null&&(jt(n,!1),Er(n));else jt(this,t)}var Hd=t=>{t.type==le.CHILD&&(t._$AP??=$d,t._$AQ??=zd)},wr=class extends J{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,o,n){super._$AT(e,o,n),Ts(this),this.isConnected=e._$AU}_$AO(e,o=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),o&&(jt(this,e),Er(this))}setValue(e){if(Xn(this._$Ct))this._$Ct._$AI(e,this);else{let o=[...this._$Ct._$AH];o[this._$Ci]=e,this._$Ct._$AI(o,this,0)}}disconnected(){}reconnected(){}};var Ps;(function(t){t.sm="sm",t.md="md",t.lg="lg",t.xl="xl"})(Ps||(Ps={}));var Wd={sm:640,md:768,lg:1024,xl:1280},In=class extends wr{constructor(e){super(e),this.size=0,this.onResize=()=>{let o=window.innerWidth;this.size!==o&&(this.size=o,this.lastArgs&&this.setValue(this.render(...this.lastArgs)))},this.size=window.innerWidth,window.addEventListener("resize",this.onResize)}disconnected(){window.removeEventListener("resize",this.onResize)}reconnected(){window.addEventListener("resize",this.onResize)}update(e,[o,n,a]){return this.lastArgs=[o,n,a],this.render(o,n,a)}render(e,o,n){let a=this.resolveThreshold(e),i=n??(()=>B);return this.size>a?o():i()}resolveThreshold(e){return typeof e=="number"?e:Wd[e]}},bb=oe(In);var Tn,Pn,Nn,Ln,Gd=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((Nn=(Pn=(Tn=window.safari)===null||Tn===void 0?void 0:Tn.pushNotification)===null||Pn===void 0?void 0:Pn.toString())!==null&&Nn!==void 0?Nn:"")==="[object SafariRemoteNotification]",jd="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(Ln=window.ftGlobals)!==null&&Ln!==void 0?Ln:{lit:Mr,litDecorators:Br,litRepeat:zr,litClassMap:$r,litStyleMap:Hr,litUnsafeHTML:Wr,wcUtils:{...Qr,...jr,...no,...On,...ao,...co,...po,...Xr,...Ro,...An,...Rs,...gn,..._o,...fo,...ko,...vn,...No,...Rn,...di,...Zr,...Fo,...ho,...Mo,..._s,...fi,...Bo,...pn,...wn,...Io,...Po,...bn,...to,isSafari:Gd,isTouchScreen:jd,setVariable:rt}};var be;(function(t){t.S="S",t.M="M",t.L="L",t.XL="XL",t.XXL="XXL"})(be||(be={}));var Ns=$`
|
|
86
86
|
.ft-size-watcher--pixel {
|
|
87
87
|
width: 0;
|
|
88
88
|
height: 0;
|
package/build/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { customElement } from "@fluid-topics/ft-wc-utils";
|
|
2
|
-
import { FtSizeWatcher } from "./ft-size-watcher";
|
|
3
1
|
export * from "./ft-size-watcher";
|
|
4
2
|
export * from "./ft-size-watcher.styles";
|
|
5
3
|
export * from "./ft-size-watcher.properties";
|
|
6
|
-
customElement("ft-size-watcher")(FtSizeWatcher);
|
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
2
|
+
"name": "@fluid-topics/ft-size-watcher",
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "Pixel component used to get viewport size",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Lit"
|
|
7
|
+
],
|
|
8
|
+
"author": "Fluid Topics <devtopics@antidot.net>",
|
|
9
|
+
"license": "ISC",
|
|
10
|
+
"main": "build/index.js",
|
|
11
|
+
"web": "build/ft-size-watcher.min.js",
|
|
12
|
+
"typings": "build/index",
|
|
13
|
+
"files": [
|
|
14
|
+
"build/**/*.ts",
|
|
15
|
+
"build/**/*.js"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "2.0.1",
|
|
23
|
+
"lit": "3.1.0"
|
|
24
|
+
},
|
|
25
|
+
"gitHead": "26bf1bd750f8272124b045d597e18b1eff63c518"
|
|
26
26
|
}
|