aptechka 0.70.13 → 0.70.14
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/lib/size-element/index.cjs +1 -1
- package/lib/size-element/index.js +23 -19
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var f=t=>{throw TypeError(t)};var d=(t,i,e)=>i.has(t)||f("Cannot "+e);var h=(t,i,e)=>(d(t,i,"read from private field"),e?e.call(t):i.get(t)),m=(t,i,e)=>i.has(t)?f("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(t):i.set(t,e),u=(t,i,e,s)=>(d(t,i,"write to private field"),s?s.call(t,e):i.set(t,e),e),o=(t,i,e)=>(d(t,i,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../element-resizer/index.cjs"),y=require("../index-DekP7OZe.cjs");require("construct-style-sheets-polyfill");var r,n,l,c;class p extends HTMLElement{constructor(){super(...arguments);m(this,n);m(this,r,this);m(this,c,()=>{h(this,r).style.removeProperty("--width"),h(this,r).style.removeProperty("--height"),o(this,n,l).call(this,"width"),o(this,n,l).call(this,"height"),setTimeout(()=>{const e=this.offsetWidth,s=this.offsetHeight;o(this,n,l).call(this,"width",e+"px"),o(this,n,l).call(this,"height",s+"px")},0)})}connectedCallback(){var s;const e=(s=this.getAttribute("target"))==null?void 0:s.trim();e&&(e==="parent"?u(this,r,this.parentElement||this):u(this,r,document.querySelector(e)||this)),g.elementResizer.subscribe(this,h(this,c))}disconnectedCallback(){g.elementResizer.unsubscribe(h(this,c))}}r=new WeakMap,n=new WeakSet,l=function(e,s){const a=this.dataset.prefix||"";s?h(this,r).style.setProperty(`--${a}${e}`,s):h(this,r).style.removeProperty(`--${a}${e}`)},c=new WeakMap;y.isBrowser&&!customElements.get("e-size-element")&&customElements.define("e-size-element",p);exports.SizeElement=p;
|
|
@@ -1,34 +1,38 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var d = (t) => {
|
|
2
|
+
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var r = (
|
|
6
|
-
import { elementResizer as
|
|
4
|
+
var p = (t, s, e) => s.has(t) || d("Cannot " + e);
|
|
5
|
+
var r = (t, s, e) => (p(t, s, "read from private field"), e ? e.call(t) : s.get(t)), c = (t, s, e) => s.has(t) ? d("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), f = (t, s, e, i) => (p(t, s, "write to private field"), i ? i.call(t, e) : s.set(t, e), e), n = (t, s, e) => (p(t, s, "access private method"), e);
|
|
6
|
+
import { elementResizer as g } from "../element-resizer/index.js";
|
|
7
7
|
import { i as y } from "../index-Bv9zgfdb.js";
|
|
8
8
|
import "construct-style-sheets-polyfill";
|
|
9
|
-
var
|
|
10
|
-
class
|
|
9
|
+
var h, o, m, l;
|
|
10
|
+
class u extends HTMLElement {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
c(this, o);
|
|
14
|
+
c(this, h, this);
|
|
15
|
+
c(this, l, () => {
|
|
16
|
+
r(this, h).style.removeProperty("--width"), r(this, h).style.removeProperty("--height"), n(this, o, m).call(this, "width"), n(this, o, m).call(this, "height"), setTimeout(() => {
|
|
17
|
+
const e = this.offsetWidth, i = this.offsetHeight;
|
|
18
|
+
n(this, o, m).call(this, "width", e + "px"), n(this, o, m).call(this, "height", i + "px");
|
|
18
19
|
}, 0);
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
connectedCallback() {
|
|
22
|
-
var
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
var i;
|
|
24
|
+
const e = (i = this.getAttribute("target")) == null ? void 0 : i.trim();
|
|
25
|
+
e && (e === "parent" ? f(this, h, this.parentElement || this) : f(this, h, document.querySelector(e) || this)), g.subscribe(this, r(this, l));
|
|
25
26
|
}
|
|
26
27
|
disconnectedCallback() {
|
|
27
|
-
|
|
28
|
+
g.unsubscribe(r(this, l));
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
h = new WeakMap(), o = new WeakSet(), m = function(e, i) {
|
|
32
|
+
const a = this.dataset.prefix || "";
|
|
33
|
+
i ? r(this, h).style.setProperty(`--${a}${e}`, i) : r(this, h).style.removeProperty(`--${a}${e}`);
|
|
34
|
+
}, l = new WeakMap();
|
|
35
|
+
y && !customElements.get("e-size-element") && customElements.define("e-size-element", u);
|
|
32
36
|
export {
|
|
33
|
-
|
|
37
|
+
u as SizeElement
|
|
34
38
|
};
|