aptechka 0.56.4 → 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,42 +1,42 @@
|
|
|
1
|
-
var
|
|
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
|
-
import { b as
|
|
7
|
+
import { b as $ } from "../dom-CVWzyXPH.js";
|
|
8
8
|
import { CSSProperty as T } from "../css-property/index.js";
|
|
9
|
-
import { d as
|
|
10
|
-
import { s as
|
|
11
|
-
import { l as
|
|
12
|
-
var v, p, L,
|
|
9
|
+
import { d as G } from "../events-CsVF98U6.js";
|
|
10
|
+
import { s as J } from "../gestures-CcXV6fCp.js";
|
|
11
|
+
import { l as K } from "../number-CbdpfO3u.js";
|
|
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)
|
|
37
37
|
return;
|
|
38
38
|
let n = 0;
|
|
39
|
-
|
|
39
|
+
J(
|
|
40
40
|
(h) => {
|
|
41
41
|
const E = e.x - h.x, P = e.y - h.y;
|
|
42
42
|
t(this, p).current === "x" ? Math.abs(E) > Math.abs(P) && (n = Math.sign(E)) : t(this, p).current === "y" && Math.abs(P) > Math.abs(E) && (n = Math.sign(P));
|
|
@@ -51,37 +51,39 @@ 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,
|
|
68
|
-
...this.querySelectorAll(
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
a(this, c, [
|
|
68
|
+
...this.querySelectorAll(
|
|
69
|
+
`[data-billboard-item="${this.id || ""}"]`
|
|
70
|
+
)
|
|
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));
|
|
71
73
|
}), t(this, v).observe(), t(this, p).observe(), this.addEventListener("pointerdown", t(this, H));
|
|
72
74
|
}
|
|
73
75
|
disconnectedCallback() {
|
|
74
|
-
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));
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
|
-
v = new WeakMap(), p = new WeakMap(), L = new WeakMap(),
|
|
78
|
-
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");
|
|
79
81
|
}, y = function() {
|
|
80
82
|
t(this, v).current !== !1 && t(this, S).call(this);
|
|
81
|
-
},
|
|
82
|
-
a(this, b,
|
|
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) => {
|
|
83
85
|
h === t(this, b) ? n.classList.add("current") : n.classList.remove("current");
|
|
84
|
-
}),
|
|
86
|
+
}), G(this, "billboardChange", {
|
|
85
87
|
detail: {
|
|
86
88
|
counter: t(this, b)
|
|
87
89
|
}
|
|
@@ -90,37 +92,37 @@ v = new WeakMap(), p = new WeakMap(), L = new WeakMap(), x = new WeakMap(), o =
|
|
|
90
92
|
}, 0);
|
|
91
93
|
}, A = new WeakMap(), H = new WeakMap();
|
|
92
94
|
customElements.get("e-billboard") || customElements.define("e-billboard", D);
|
|
93
|
-
var
|
|
94
|
-
class
|
|
95
|
+
var o, u, M, x;
|
|
96
|
+
class O extends HTMLElement {
|
|
95
97
|
constructor() {
|
|
96
98
|
super(...arguments);
|
|
97
|
-
i(this,
|
|
99
|
+
i(this, o, null);
|
|
98
100
|
i(this, u, []);
|
|
99
101
|
i(this, M, (e) => {
|
|
100
102
|
const n = e.currentTarget, h = t(this, u).findIndex((E) => E === n);
|
|
101
|
-
h >= 0 && t(this,
|
|
103
|
+
h >= 0 && t(this, o).set(h);
|
|
102
104
|
});
|
|
103
|
-
i(this,
|
|
105
|
+
i(this, x, () => {
|
|
104
106
|
t(this, u).forEach((e, n) => {
|
|
105
|
-
n === t(this,
|
|
107
|
+
n === t(this, o).counter ? e.classList.add("current") : e.classList.remove("current");
|
|
106
108
|
});
|
|
107
109
|
});
|
|
108
110
|
}
|
|
109
111
|
connectedCallback() {
|
|
110
|
-
a(this,
|
|
112
|
+
a(this, o, $(this, D)), t(this, o) && customElements.whenDefined("e-billboard").then(() => {
|
|
111
113
|
var e;
|
|
112
114
|
if (this.isConnected) {
|
|
113
|
-
const n = t(this,
|
|
115
|
+
const n = t(this, o).itemElements.length;
|
|
114
116
|
for (let h = 0; h < n; h++) {
|
|
115
117
|
const E = document.createElement("button");
|
|
116
118
|
t(this, u).push(E), this.appendChild(E);
|
|
117
119
|
}
|
|
118
120
|
t(this, u).forEach((h) => {
|
|
119
121
|
h.addEventListener("click", t(this, M));
|
|
120
|
-
}), (e = t(this,
|
|
122
|
+
}), (e = t(this, o)) == null || e.addEventListener(
|
|
121
123
|
"billboardChange",
|
|
122
|
-
t(this,
|
|
123
|
-
), t(this,
|
|
124
|
+
t(this, x)
|
|
125
|
+
), t(this, x).call(this);
|
|
124
126
|
}
|
|
125
127
|
});
|
|
126
128
|
}
|
|
@@ -128,16 +130,16 @@ class Q extends HTMLElement {
|
|
|
128
130
|
var e;
|
|
129
131
|
t(this, u).forEach((n) => {
|
|
130
132
|
n.removeEventListener("click", t(this, M));
|
|
131
|
-
}), (e = t(this,
|
|
133
|
+
}), (e = t(this, o)) == null || e.removeEventListener(
|
|
132
134
|
"billboardChange",
|
|
133
|
-
t(this,
|
|
135
|
+
t(this, x)
|
|
134
136
|
), this.innerHTML = "", a(this, u, []);
|
|
135
137
|
}
|
|
136
138
|
}
|
|
137
|
-
|
|
138
|
-
N && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets",
|
|
139
|
+
o = new WeakMap(), u = new WeakMap(), M = new WeakMap(), x = new WeakMap();
|
|
140
|
+
N && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", O);
|
|
139
141
|
var m, f, g;
|
|
140
|
-
class
|
|
142
|
+
class Q extends HTMLElement {
|
|
141
143
|
constructor() {
|
|
142
144
|
super();
|
|
143
145
|
i(this, m, new T(this, "--index", 0));
|
|
@@ -146,13 +148,13 @@ class R extends HTMLElement {
|
|
|
146
148
|
var e;
|
|
147
149
|
t(this, m).current === ((e = t(this, f)) == null ? void 0 : e.counter) ? this.classList.add("current") : this.classList.remove("current");
|
|
148
150
|
});
|
|
149
|
-
this.addEventListener("click", () => {
|
|
150
|
-
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);
|
|
151
153
|
});
|
|
152
154
|
}
|
|
153
155
|
connectedCallback() {
|
|
154
156
|
var e;
|
|
155
|
-
this.tabIndex = 0, a(this, f,
|
|
157
|
+
this.tabIndex = 0, a(this, f, $(this, D)), (e = t(this, f)) == null || e.addEventListener(
|
|
156
158
|
"billboardChange",
|
|
157
159
|
t(this, g)
|
|
158
160
|
), customElements.whenDefined("e-billboard").then(() => {
|
|
@@ -168,29 +170,29 @@ class R extends HTMLElement {
|
|
|
168
170
|
}
|
|
169
171
|
}
|
|
170
172
|
m = new WeakMap(), f = new WeakMap(), g = new WeakMap();
|
|
171
|
-
N && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button",
|
|
173
|
+
N && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", Q);
|
|
172
174
|
var w, I;
|
|
173
|
-
class
|
|
175
|
+
class R extends HTMLElement {
|
|
174
176
|
constructor() {
|
|
175
177
|
super();
|
|
176
178
|
i(this, w, new T(this, "--step", 1));
|
|
177
179
|
i(this, I, null);
|
|
178
|
-
this.addEventListener("click", () => {
|
|
179
|
-
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);
|
|
180
182
|
});
|
|
181
183
|
}
|
|
182
184
|
connectedCallback() {
|
|
183
|
-
this.tabIndex = 0, a(this, I,
|
|
185
|
+
this.tabIndex = 0, a(this, I, $(this, D)), t(this, w).observe();
|
|
184
186
|
}
|
|
185
187
|
disconnectedCallback() {
|
|
186
188
|
this.removeAttribute("tabindex"), t(this, w).unobserve();
|
|
187
189
|
}
|
|
188
190
|
}
|
|
189
191
|
w = new WeakMap(), I = new WeakMap();
|
|
190
|
-
N && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button",
|
|
192
|
+
N && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", R);
|
|
191
193
|
export {
|
|
192
|
-
|
|
194
|
+
O as BillboardBulletsElement,
|
|
193
195
|
D as BillboardElement,
|
|
194
|
-
|
|
195
|
-
|
|
196
|
+
Q as BillboardSetButtonElement,
|
|
197
|
+
R as BillboardStepButtonElement
|
|
196
198
|
};
|