aptechka 0.69.2 → 0.69.3
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 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var v=t=>{throw TypeError(t)};var m=(t,s,e)=>s.has(t)||v("Cannot "+e);var o=(t,s,e)=>(m(t,s,"read from private field"),e?e.call(t):s.get(t)),r=(t,s,e)=>s.has(t)?v("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),y=(t,s,e,i)=>(m(t,s,"write to private field"),i?i.call(t,e):s.set(t,e),e),p=(t,s,e)=>(m(t,s,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../css-property/index.cjs"),E=require("../index-DekP7OZe.cjs"),w=require("../events-KVanG9sR.cjs"),S=require("../stylesheet-HWF2a3nr.cjs");var n,c,l,h,d,b;class L extends HTMLElement{constructor(){super();r(this,d);r(this,n,new g.CSSProperty(this,"--columns",2));r(this,c,[]);r(this,l,null);r(this,h,()=>{p(this,d,b).call(this)});const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[S.createStylesheet({":host":{display:"grid",gridTemplateColumns:"repeat(var(--columns), 1fr)"},".column":{display:"grid",width:"100%",gap:"var(--gap, 0rem)",gridAutoRows:"max-content"}})]}get columnElements(){return o(this,c)}connectedCallback(){y(this,l,new MutationObserver(o(this,h))),o(this,l).observe(this,{childList:!0}),o(this,n).subscribe(e=>{var i;this.shadowRoot.innerHTML="",y(this,c,[]);for(let a=0;a<e.current;a++){const u=document.createElement("div");u.classList.add("column"),u.innerHTML=`<slot name="col-${a}"></slot>`,o(this,c).push(u),(i=this.shadowRoot)==null||i.appendChild(u)}p(this,d,b).call(this)}),o(this,n).observe()}disconnectedCallback(){o(this,n).close(),o(this,l).disconnect(),this.classList.remove("distributed")}}n=new WeakMap,c=new WeakMap,l=new WeakMap,h=new WeakMap,d=new WeakSet,b=function(){[...this.children].forEach((i,a)=>{i.slot=`col-${a%o(this,n).current}`}),this.classList.add("distributed"),w.dispatchEvent(this,"masonryLayoutDistributed",{custom:!0})};E.isBrowser&&!customElements.get("e-masonry-layout")&&customElements.define("e-masonry-layout",L);exports.MasonryLayoutElement=L;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
export interface MasonryLayoutElementEvents {
|
|
2
|
+
masonryLayoutDistributed: CustomEvent;
|
|
3
|
+
}
|
|
1
4
|
export declare class MasonryLayoutElement extends HTMLElement {
|
|
2
5
|
#private;
|
|
3
6
|
constructor();
|
|
7
|
+
get columnElements(): HTMLElement[];
|
|
4
8
|
protected connectedCallback(): void;
|
|
5
9
|
protected disconnectedCallback(): void;
|
|
6
10
|
}
|
|
@@ -8,4 +12,6 @@ declare global {
|
|
|
8
12
|
interface HTMLElementTagNameMap {
|
|
9
13
|
'e-masonry-layout': MasonryLayoutElement;
|
|
10
14
|
}
|
|
15
|
+
interface HTMLElementEventMap extends MasonryLayoutElementEvents {
|
|
16
|
+
}
|
|
11
17
|
}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
var L = (t) => {
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
|
-
var u = (t,
|
|
5
|
-
var o = (t,
|
|
4
|
+
var u = (t, e, s) => e.has(t) || L("Cannot " + s);
|
|
5
|
+
var o = (t, e, s) => (u(t, e, "read from private field"), s ? s.call(t) : e.get(t)), n = (t, e, s) => e.has(t) ? L("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), p = (t, e, s, i) => (u(t, e, "write to private field"), i ? i.call(t, s) : e.set(t, s), s), y = (t, e, s) => (u(t, e, "access private method"), s);
|
|
6
6
|
import { CSSProperty as f } from "../css-property/index.js";
|
|
7
7
|
import { i as v } from "../index-Bv9zgfdb.js";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import { d as E } from "../events-CsVF98U6.js";
|
|
9
|
+
import { c as g } from "../stylesheet-DpnWNVyD.js";
|
|
10
|
+
var r, c, a, h, d, b;
|
|
11
|
+
class w extends HTMLElement {
|
|
11
12
|
constructor() {
|
|
12
13
|
super();
|
|
13
14
|
n(this, d);
|
|
14
15
|
n(this, r, new f(this, "--columns", 2));
|
|
15
|
-
n(this,
|
|
16
|
-
n(this,
|
|
17
|
-
n(this,
|
|
18
|
-
|
|
16
|
+
n(this, c, []);
|
|
17
|
+
n(this, a, null);
|
|
18
|
+
n(this, h, () => {
|
|
19
|
+
y(this, d, b).call(this);
|
|
19
20
|
});
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const s = this.attachShadow({ mode: "open" });
|
|
22
|
+
s.adoptedStyleSheets = [
|
|
23
|
+
g({
|
|
23
24
|
":host": {
|
|
24
25
|
display: "grid",
|
|
25
26
|
gridTemplateColumns: "repeat(var(--columns), 1fr)"
|
|
@@ -33,29 +34,32 @@ class g extends HTMLElement {
|
|
|
33
34
|
})
|
|
34
35
|
];
|
|
35
36
|
}
|
|
37
|
+
get columnElements() {
|
|
38
|
+
return o(this, c);
|
|
39
|
+
}
|
|
36
40
|
connectedCallback() {
|
|
37
|
-
p(this,
|
|
41
|
+
p(this, a, new MutationObserver(o(this, h))), o(this, a).observe(this, {
|
|
38
42
|
childList: !0
|
|
39
|
-
}), o(this, r).subscribe((
|
|
43
|
+
}), o(this, r).subscribe((s) => {
|
|
40
44
|
var i;
|
|
41
|
-
this.shadowRoot.innerHTML = "", p(this,
|
|
42
|
-
for (let l = 0; l <
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
+
this.shadowRoot.innerHTML = "", p(this, c, []);
|
|
46
|
+
for (let l = 0; l < s.current; l++) {
|
|
47
|
+
const m = document.createElement("div");
|
|
48
|
+
m.classList.add("column"), m.innerHTML = `<slot name="col-${l}"></slot>`, o(this, c).push(m), (i = this.shadowRoot) == null || i.appendChild(m);
|
|
45
49
|
}
|
|
46
|
-
|
|
50
|
+
y(this, d, b).call(this);
|
|
47
51
|
}), o(this, r).observe();
|
|
48
52
|
}
|
|
49
53
|
disconnectedCallback() {
|
|
50
|
-
o(this, r).close(), o(this,
|
|
54
|
+
o(this, r).close(), o(this, a).disconnect(), this.classList.remove("distributed");
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
|
-
r = new WeakMap(),
|
|
57
|
+
r = new WeakMap(), c = new WeakMap(), a = new WeakMap(), h = new WeakMap(), d = new WeakSet(), b = function() {
|
|
54
58
|
[...this.children].forEach((i, l) => {
|
|
55
59
|
i.slot = `col-${l % o(this, r).current}`;
|
|
56
|
-
}), this.classList.add("distributed");
|
|
60
|
+
}), this.classList.add("distributed"), E(this, "masonryLayoutDistributed", { custom: !0 });
|
|
57
61
|
};
|
|
58
|
-
v && !customElements.get("e-masonry-layout") && customElements.define("e-masonry-layout",
|
|
62
|
+
v && !customElements.get("e-masonry-layout") && customElements.define("e-masonry-layout", w);
|
|
59
63
|
export {
|
|
60
|
-
|
|
64
|
+
w as MasonryLayoutElement
|
|
61
65
|
};
|