aptechka 0.56.5 → 0.56.6
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/billboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var F=s=>{throw TypeError(s)};var _=(s,r,t)=>r.has(s)||F("Cannot "+t);var e=(s,r,t)=>(_(s,r,"read from private field"),t?t.call(s):r.get(s)),i=(s,r,t)=>r.has(s)?F("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,t),a=(s,r,t,n)=>(_(s,r,"write to private field"),n?n.call(s,t):r.set(s,t),t),d=(s,r,t)=>(_(s,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";var F=s=>{throw TypeError(s)};var _=(s,r,t)=>r.has(s)||F("Cannot "+t);var e=(s,r,t)=>(_(s,r,"read from private field"),t?t.call(s):r.get(s)),i=(s,r,t)=>r.has(s)?F("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,t),a=(s,r,t,n)=>(_(s,r,"write to private field"),n?n.call(s,t):r.set(s,t),t),d=(s,r,t)=>(_(s,r,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../index-Cqw2NKev.cjs"),z=require("../dom-JBOkFLTh.cjs"),T=require("../css-property/index.cjs"),G=require("../events-KVanG9sR.cjs"),J=require("../gestures-C7gbKx11.cjs"),K=require("../number-DyefJ5a1.cjs");var v,p,g,C,c,b,l,j,M,x,q,P,A,H;class I extends HTMLElement{constructor(){super(...arguments);i(this,l);i(this,v,new T.CSSProperty(this,"--autoplay",!1));i(this,p,new T.CSSProperty(this,"--swipe","x"));i(this,g);i(this,C,!1);i(this,c,[]);i(this,b,0);i(this,x,t=>{a(this,C,t.isIntersecting),e(this,C)?d(this,l,M).call(this):clearInterval(e(this,g))});i(this,q,()=>{clearInterval(e(this,g)),e(this,C)&&a(this,g,setInterval(e(this,A),parseFloat(e(this,v).current||"0")*1e3))});i(this,A,()=>{d(this,l,P).call(this,e(this,b)+1)});i(this,H,t=>{if(!e(this,p).current)return;let n=0;J.setupDrag(h=>{const E=t.x-h.x,D=t.y-h.y;e(this,p).current==="x"?Math.abs(E)>Math.abs(D)&&(n=Math.sign(E)):e(this,p).current==="y"&&Math.abs(D)>Math.abs(E)&&(n=Math.sign(D))},()=>{this.shift(n)})})}get counter(){return e(this,b)}get itemElements(){return e(this,c)}addItem(t){e(this,c).push(t),d(this,l,j).call(this)}set(t){d(this,l,P).call(this,t),d(this,l,M).call(this)}shift(t){this.set(e(this,b)+t)}connectedCallback(){var t;a(this,c,[...this.querySelectorAll(`[data-billboard-item="${this.id||""}"]`)]),(t=e(this,c)[0])==null||t.classList.add("current"),d(this,l,j).call(this),e(this,v).subscribe(n=>{n.current?(k.intersector.subscribe(this,e(this,x)),d(this,l,M).call(this)):(a(this,C,!0),k.intersector.unsubscribe(e(this,x)),clearInterval(e(this,g)),d(this,l,P).call(this,0))}),e(this,v).observe(),e(this,p).observe(),this.addEventListener("pointerdown",e(this,H))}disconnectedCallback(){e(this,v).unobserve(),e(this,p).unobserve(),k.intersector.unsubscribe(e(this,x)),clearInterval(e(this,g))}}v=new WeakMap,p=new WeakMap,g=new WeakMap,C=new WeakMap,c=new WeakMap,b=new WeakMap,l=new WeakSet,j=function(){e(this,c).length>1?this.classList.add("has-length"):this.classList.remove("has-length")},M=function(){e(this,v).current!==!1&&e(this,q).call(this)},x=new WeakMap,q=new WeakMap,P=function(t){a(this,b,K.loopNumber(t,e(this,c).length)),e(this,c).forEach((n,h)=>{h===e(this,b)?n.classList.add("current"):n.classList.remove("current")}),G.dispatchEvent(this,"billboardChange",{detail:{counter:e(this,b)}}),setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0)},A=new WeakMap,H=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",I);var o,u,S,w;class N extends HTMLElement{constructor(){super(...arguments);i(this,o,null);i(this,u,[]);i(this,S,t=>{const n=t.currentTarget,h=e(this,u).findIndex(E=>E===n);h>=0&&e(this,o).set(h)});i(this,w,()=>{e(this,u).forEach((t,n)=>{n===e(this,o).counter?t.classList.add("current"):t.classList.remove("current")})})}connectedCallback(){a(this,o,z.findParentElement(this,I)),e(this,o)&&customElements.whenDefined("e-billboard").then(()=>{var t;if(this.isConnected){const n=e(this,o).itemElements.length;for(let h=0;h<n;h++){const E=document.createElement("button");e(this,u).push(E),this.appendChild(E)}e(this,u).forEach(h=>{h.addEventListener("click",e(this,S))}),(t=e(this,o))==null||t.addEventListener("billboardChange",e(this,w)),e(this,w).call(this)}})}disconnectedCallback(){var t;e(this,u).forEach(n=>{n.removeEventListener("click",e(this,S))}),(t=e(this,o))==null||t.removeEventListener("billboardChange",e(this,w)),this.innerHTML="",a(this,u,[])}}o=new WeakMap,u=new WeakMap,S=new WeakMap,w=new WeakMap;k.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",N);var m,f,L;class O extends HTMLElement{constructor(){super();i(this,m,new T.CSSProperty(this,"--index",0));i(this,f,null);i(this,L,()=>{var t;e(this,m).current===((t=e(this,f))==null?void 0:t.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",t=>{e(this,f)&&(!this.handleClick||this.handleClick&&this.handleClick(t))&&e(this,f).set(e(this,m).current)})}connectedCallback(){var t;this.tabIndex=0,a(this,f,z.findParentElement(this,I)),(t=e(this,f))==null||t.addEventListener("billboardChange",e(this,L)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&e(this,L).call(this)}),e(this,m).subscribe(e(this,L)),e(this,m).observe()}disconnectedCallback(){var t;this.removeAttribute("tabindex"),e(this,m).unsubscribe(e(this,L)),e(this,m).unobserve(),(t=e(this,f))==null||t.removeEventListener("billboardChange",e(this,L))}}m=new WeakMap,f=new WeakMap,L=new WeakMap;k.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",O);var B,y;class $ extends HTMLElement{constructor(){super();i(this,B,new T.CSSProperty(this,"--step",1));i(this,y,null);this.addEventListener("click",t=>{e(this,y)&&(!this.handleClick||this.handleClick&&this.handleClick(t))&&e(this,y).shift(e(this,B).current)})}connectedCallback(){this.tabIndex=0,a(this,y,z.findParentElement(this,I)),e(this,B).observe()}disconnectedCallback(){this.removeAttribute("tabindex"),e(this,B).unobserve()}}B=new WeakMap,y=new WeakMap;k.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",$);exports.BillboardBulletsElement=N;exports.BillboardElement=I;exports.BillboardSetButtonElement=O;exports.BillboardStepButtonElement=$;
|
package/lib/billboard/index.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
var j = (s) => {
|
|
2
2
|
throw TypeError(s);
|
|
3
3
|
};
|
|
4
|
-
var q = (s,
|
|
5
|
-
var t = (s,
|
|
4
|
+
var q = (s, l, e) => l.has(s) || j("Cannot " + e);
|
|
5
|
+
var t = (s, l, e) => (q(s, l, "read from private field"), e ? e.call(s) : l.get(s)), i = (s, l, e) => l.has(s) ? j("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(s) : l.set(s, e), a = (s, l, e, n) => (q(s, l, "write to private field"), n ? n.call(s, e) : l.set(s, e), e), d = (s, l, e) => (q(s, l, "access private method"), e);
|
|
6
6
|
import { a as z, i as N } from "../index-euf5anj6.js";
|
|
7
7
|
import { b as $ } from "../dom-CVWzyXPH.js";
|
|
8
8
|
import { CSSProperty as T } from "../css-property/index.js";
|
|
9
9
|
import { d as G } from "../events-CsVF98U6.js";
|
|
10
10
|
import { s as J } from "../gestures-CcXV6fCp.js";
|
|
11
11
|
import { l as K } from "../number-CbdpfO3u.js";
|
|
12
|
-
var v, p, L,
|
|
12
|
+
var v, p, L, C, c, b, r, F, y, k, S, B, A, H;
|
|
13
13
|
class D extends HTMLElement {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
|
-
i(this,
|
|
16
|
+
i(this, r);
|
|
17
17
|
i(this, v, new T(this, "--autoplay", !1));
|
|
18
18
|
i(this, p, new T(this, "--swipe", "x"));
|
|
19
19
|
i(this, L);
|
|
20
|
-
i(this,
|
|
21
|
-
i(this,
|
|
20
|
+
i(this, C, !1);
|
|
21
|
+
i(this, c, []);
|
|
22
22
|
i(this, b, 0);
|
|
23
|
-
i(this,
|
|
24
|
-
a(this,
|
|
23
|
+
i(this, k, (e) => {
|
|
24
|
+
a(this, C, e.isIntersecting), t(this, C) ? d(this, r, y).call(this) : clearInterval(t(this, L));
|
|
25
25
|
});
|
|
26
26
|
i(this, S, () => {
|
|
27
|
-
clearInterval(t(this, L)), t(this,
|
|
27
|
+
clearInterval(t(this, L)), t(this, C) && a(this, L, setInterval(
|
|
28
28
|
t(this, A),
|
|
29
29
|
parseFloat(t(this, v).current || "0") * 1e3
|
|
30
30
|
));
|
|
31
31
|
});
|
|
32
32
|
i(this, A, () => {
|
|
33
|
-
d(this,
|
|
33
|
+
d(this, r, B).call(this, t(this, b) + 1);
|
|
34
34
|
});
|
|
35
35
|
i(this, H, (e) => {
|
|
36
36
|
if (!t(this, p).current)
|
|
@@ -51,37 +51,37 @@ class D extends HTMLElement {
|
|
|
51
51
|
return t(this, b);
|
|
52
52
|
}
|
|
53
53
|
get itemElements() {
|
|
54
|
-
return t(this,
|
|
54
|
+
return t(this, c);
|
|
55
55
|
}
|
|
56
56
|
addItem(e) {
|
|
57
|
-
t(this,
|
|
57
|
+
t(this, c).push(e), d(this, r, F).call(this);
|
|
58
58
|
}
|
|
59
59
|
set(e) {
|
|
60
|
-
d(this,
|
|
60
|
+
d(this, r, B).call(this, e), d(this, r, y).call(this);
|
|
61
61
|
}
|
|
62
62
|
shift(e) {
|
|
63
63
|
this.set(t(this, b) + e);
|
|
64
64
|
}
|
|
65
65
|
connectedCallback() {
|
|
66
66
|
var e;
|
|
67
|
-
a(this,
|
|
67
|
+
a(this, c, [
|
|
68
68
|
...this.querySelectorAll(
|
|
69
69
|
`[data-billboard-item="${this.id || ""}"]`
|
|
70
70
|
)
|
|
71
|
-
]), (e = t(this,
|
|
72
|
-
n.current ? (z.subscribe(this, t(this,
|
|
71
|
+
]), (e = t(this, c)[0]) == null || e.classList.add("current"), d(this, r, F).call(this), t(this, v).subscribe((n) => {
|
|
72
|
+
n.current ? (z.subscribe(this, t(this, k)), d(this, r, y).call(this)) : (a(this, C, !0), z.unsubscribe(t(this, k)), clearInterval(t(this, L)), d(this, r, B).call(this, 0));
|
|
73
73
|
}), t(this, v).observe(), t(this, p).observe(), this.addEventListener("pointerdown", t(this, H));
|
|
74
74
|
}
|
|
75
75
|
disconnectedCallback() {
|
|
76
|
-
t(this, v).unobserve(), t(this, p).unobserve(), z.unsubscribe(t(this,
|
|
76
|
+
t(this, v).unobserve(), t(this, p).unobserve(), z.unsubscribe(t(this, k)), clearInterval(t(this, L));
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
v = new WeakMap(), p = new WeakMap(), L = new WeakMap(),
|
|
80
|
-
t(this,
|
|
79
|
+
v = new WeakMap(), p = new WeakMap(), L = new WeakMap(), C = new WeakMap(), c = new WeakMap(), b = new WeakMap(), r = new WeakSet(), F = function() {
|
|
80
|
+
t(this, c).length > 1 ? this.classList.add("has-length") : this.classList.remove("has-length");
|
|
81
81
|
}, y = function() {
|
|
82
82
|
t(this, v).current !== !1 && t(this, S).call(this);
|
|
83
|
-
},
|
|
84
|
-
a(this, b, K(e, t(this,
|
|
83
|
+
}, k = new WeakMap(), S = new WeakMap(), B = function(e) {
|
|
84
|
+
a(this, b, K(e, t(this, c).length)), t(this, c).forEach((n, h) => {
|
|
85
85
|
h === t(this, b) ? n.classList.add("current") : n.classList.remove("current");
|
|
86
86
|
}), G(this, "billboardChange", {
|
|
87
87
|
detail: {
|
|
@@ -92,37 +92,37 @@ v = new WeakMap(), p = new WeakMap(), L = new WeakMap(), x = new WeakMap(), o =
|
|
|
92
92
|
}, 0);
|
|
93
93
|
}, A = new WeakMap(), H = new WeakMap();
|
|
94
94
|
customElements.get("e-billboard") || customElements.define("e-billboard", D);
|
|
95
|
-
var
|
|
95
|
+
var o, u, M, x;
|
|
96
96
|
class O extends HTMLElement {
|
|
97
97
|
constructor() {
|
|
98
98
|
super(...arguments);
|
|
99
|
-
i(this,
|
|
99
|
+
i(this, o, null);
|
|
100
100
|
i(this, u, []);
|
|
101
101
|
i(this, M, (e) => {
|
|
102
102
|
const n = e.currentTarget, h = t(this, u).findIndex((E) => E === n);
|
|
103
|
-
h >= 0 && t(this,
|
|
103
|
+
h >= 0 && t(this, o).set(h);
|
|
104
104
|
});
|
|
105
|
-
i(this,
|
|
105
|
+
i(this, x, () => {
|
|
106
106
|
t(this, u).forEach((e, n) => {
|
|
107
|
-
n === t(this,
|
|
107
|
+
n === t(this, o).counter ? e.classList.add("current") : e.classList.remove("current");
|
|
108
108
|
});
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
connectedCallback() {
|
|
112
|
-
a(this,
|
|
112
|
+
a(this, o, $(this, D)), t(this, o) && customElements.whenDefined("e-billboard").then(() => {
|
|
113
113
|
var e;
|
|
114
114
|
if (this.isConnected) {
|
|
115
|
-
const n = t(this,
|
|
115
|
+
const n = t(this, o).itemElements.length;
|
|
116
116
|
for (let h = 0; h < n; h++) {
|
|
117
117
|
const E = document.createElement("button");
|
|
118
118
|
t(this, u).push(E), this.appendChild(E);
|
|
119
119
|
}
|
|
120
120
|
t(this, u).forEach((h) => {
|
|
121
121
|
h.addEventListener("click", t(this, M));
|
|
122
|
-
}), (e = t(this,
|
|
122
|
+
}), (e = t(this, o)) == null || e.addEventListener(
|
|
123
123
|
"billboardChange",
|
|
124
|
-
t(this,
|
|
125
|
-
), t(this,
|
|
124
|
+
t(this, x)
|
|
125
|
+
), t(this, x).call(this);
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
}
|
|
@@ -130,13 +130,13 @@ class O extends HTMLElement {
|
|
|
130
130
|
var e;
|
|
131
131
|
t(this, u).forEach((n) => {
|
|
132
132
|
n.removeEventListener("click", t(this, M));
|
|
133
|
-
}), (e = t(this,
|
|
133
|
+
}), (e = t(this, o)) == null || e.removeEventListener(
|
|
134
134
|
"billboardChange",
|
|
135
|
-
t(this,
|
|
135
|
+
t(this, x)
|
|
136
136
|
), this.innerHTML = "", a(this, u, []);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
o = new WeakMap(), u = new WeakMap(), M = new WeakMap(), x = new WeakMap();
|
|
140
140
|
N && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", O);
|
|
141
141
|
var m, f, g;
|
|
142
142
|
class Q extends HTMLElement {
|
|
@@ -148,8 +148,8 @@ class Q extends HTMLElement {
|
|
|
148
148
|
var e;
|
|
149
149
|
t(this, m).current === ((e = t(this, f)) == null ? void 0 : e.counter) ? this.classList.add("current") : this.classList.remove("current");
|
|
150
150
|
});
|
|
151
|
-
this.addEventListener("click", () => {
|
|
152
|
-
t(this, f) && t(this, f).set(t(this, m).current);
|
|
151
|
+
this.addEventListener("click", (e) => {
|
|
152
|
+
t(this, f) && (!this.handleClick || this.handleClick && this.handleClick(e)) && t(this, f).set(t(this, m).current);
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
155
|
connectedCallback() {
|
|
@@ -177,8 +177,8 @@ class R extends HTMLElement {
|
|
|
177
177
|
super();
|
|
178
178
|
i(this, w, new T(this, "--step", 1));
|
|
179
179
|
i(this, I, null);
|
|
180
|
-
this.addEventListener("click", () => {
|
|
181
|
-
t(this, I) && t(this, I).shift(t(this, w).current);
|
|
180
|
+
this.addEventListener("click", (e) => {
|
|
181
|
+
t(this, I) && (!this.handleClick || this.handleClick && this.handleClick(e)) && t(this, I).shift(t(this, w).current);
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
184
|
connectedCallback() {
|