aptechka 0.57.1 → 0.57.2
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 +1 -1
- package/lib/billboard/index.js +41 -41
- package/package.json +1 -1
package/lib/billboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var J=s=>{throw TypeError(s)};var O=(s,r,e)=>r.has(s)||J("Cannot "+e);var t=(s,r,e)=>(O(s,r,"read from private field"),e?e.call(s):r.get(s)),n=(s,r,e)=>r.has(s)?J("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,e),a=(s,r,e,i)=>(O(s,r,"write to private field"),i?i.call(s,e):r.set(s,e),e),b=(s,r,e)=>(O(s,r,"access private method"),e);var K=(s,r,e)=>new Promise((i,l)=>{var d=C=>{try{F(e.next(C))}catch(N){l(N)}},
|
|
1
|
+
"use strict";var J=s=>{throw TypeError(s)};var O=(s,r,e)=>r.has(s)||J("Cannot "+e);var t=(s,r,e)=>(O(s,r,"read from private field"),e?e.call(s):r.get(s)),n=(s,r,e)=>r.has(s)?J("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(s):r.set(s,e),a=(s,r,e,i)=>(O(s,r,"write to private field"),i?i.call(s,e):r.set(s,e),e),b=(s,r,e)=>(O(s,r,"access private method"),e);var K=(s,r,e)=>new Promise((i,l)=>{var d=C=>{try{F(e.next(C))}catch(N){l(N)}},P=C=>{try{F(e.throw(C))}catch(N){l(N)}},F=C=>C.done?i(C.value):Promise.resolve(C.value).then(d,P);F((e=e.apply(s,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("../index-Cqw2NKev.cjs"),G=require("../dom-JBOkFLTh.cjs"),q=require("../css-property/index.cjs"),V=require("../events-KVanG9sR.cjs"),W=require("../gestures-C7gbKx11.cjs"),X=require("../math-GDWEqu7y.cjs"),Y=require("../number-DyefJ5a1.cjs");var k,p,v,L,x,c,o,h,$,H,w,_,D,j,z;class A extends HTMLElement{constructor(){super(...arguments);n(this,h);n(this,k,new q.CSSProperty(this,"--loop",!0));n(this,p,new q.CSSProperty(this,"--autoplay",!1));n(this,v,new q.CSSProperty(this,"--swipe","x"));n(this,L);n(this,x,!1);n(this,c,[]);n(this,o,0);n(this,w,e=>{a(this,x,e.isIntersecting),t(this,x)?b(this,h,H).call(this):clearInterval(t(this,L))});n(this,_,()=>{clearInterval(t(this,L)),t(this,x)&&a(this,L,setInterval(t(this,j),parseFloat(t(this,p).current||"0")*1e3))});n(this,j,()=>{b(this,h,D).call(this,t(this,o)+1)});n(this,z,e=>{if(!t(this,v).current)return;let i=0;W.setupDrag(l=>{const d=e.x-l.x,P=e.y-l.y;t(this,v).current==="x"?Math.abs(d)>Math.abs(P)&&(i=Math.sign(d)):t(this,v).current==="y"&&Math.abs(P)>Math.abs(d)&&(i=Math.sign(P))},()=>{this.shift(i)})})}get counter(){return t(this,o)}get itemElements(){return t(this,c)}addItem(e){t(this,c).push(e),b(this,h,$).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(b(this,h,D).call(this,e),b(this,h,H).call(this))}shift(e){this.set(t(this,o)+e)}connectedCallback(){var e;a(this,c,[...this.querySelectorAll(`[data-billboard-item="${this.id||""}"]`)]),(e=t(this,c)[0])==null||e.classList.add("current"),b(this,h,$).call(this),t(this,p).subscribe(i=>{i.current?(S.intersector.subscribe(this,t(this,w)),b(this,h,H).call(this)):(a(this,x,!0),S.intersector.unsubscribe(t(this,w)),clearInterval(t(this,L)),b(this,h,D).call(this,0))}),t(this,p).observe(),t(this,v).observe(),t(this,k).observe(),this.addEventListener("pointerdown",t(this,z))}disconnectedCallback(){t(this,p).unobserve(),t(this,v).unobserve(),t(this,k).unobserve(),S.intersector.unsubscribe(t(this,w)),clearInterval(t(this,L))}}k=new WeakMap,p=new WeakMap,v=new WeakMap,L=new WeakMap,x=new WeakMap,c=new WeakMap,o=new WeakMap,h=new WeakSet,$=function(){t(this,c).length>1?this.classList.add("has-length"):this.classList.remove("has-length")},H=function(){t(this,p).current!==!1&&t(this,_).call(this)},w=new WeakMap,_=new WeakMap,D=function(e){t(this,k).current?a(this,o,Y.loopNumber(e,t(this,c).length)):a(this,o,X.clamp(e,0,t(this,c).length-1)),t(this,c).forEach((i,l)=>{i.classList.remove("current","previous","next"),l===t(this,o)?i.classList.add("current"):l<t(this,o)?i.classList.add("previous"):l>t(this,o)&&i.classList.add("next")}),V.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,o)}}),setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0)},j=new WeakMap,z=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",A);var u,y,m,T,B;class Q extends HTMLElement{constructor(){super(...arguments);n(this,u,null);n(this,y,null);n(this,m,[]);n(this,T,e=>{const i=e.currentTarget,l=t(this,m).findIndex(d=>d===i);l>=0&&t(this,u).set(l)});n(this,B,()=>{t(this,m).forEach((e,i)=>{i===t(this,u).counter?e.classList.add("current"):e.classList.remove("current")})})}connectedCallback(){return K(this,null,function*(){var e;if(a(this,u,G.findParentElement(this,A)),t(this,u)&&(yield customElements.whenDefined("e-billboard"),this.isConnected)){const i=t(this,u).itemElements.length;a(this,y,document.createElement("div"));for(let l=0;l<i;l++){const d=document.createElement("button");t(this,m).push(d),t(this,y).appendChild(d)}this.appendChild(t(this,y)),t(this,m).forEach(l=>{l.addEventListener("click",t(this,T))}),(e=t(this,u))==null||e.addEventListener("billboardChange",t(this,B)),t(this,B).call(this)}})}disconnectedCallback(){var e;t(this,m).forEach(i=>{i.removeEventListener("click",t(this,T))}),(e=t(this,u))==null||e.removeEventListener("billboardChange",t(this,B)),this.innerHTML="",a(this,m,[])}}u=new WeakMap,y=new WeakMap,m=new WeakMap,T=new WeakMap,B=new WeakMap;S.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",Q);var f,E,g;class R extends HTMLElement{constructor(){super();n(this,f,new q.CSSProperty(this,"--index",0));n(this,E,null);n(this,g,()=>{var e;t(this,f).current===((e=t(this,E))==null?void 0:e.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",e=>{t(this,E)&&(!this.handleClick||this.handleClick(e))&&t(this,E).set(t(this,f).current)})}connectedCallback(){var e;this.tabIndex=0,a(this,E,G.findParentElement(this,A)),(e=t(this,E))==null||e.addEventListener("billboardChange",t(this,g)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&t(this,g).call(this)}),t(this,f).subscribe(t(this,g)),t(this,f).observe()}disconnectedCallback(){var e;this.removeAttribute("tabindex"),t(this,f).unsubscribe(t(this,g)),t(this,f).unobserve(),(e=t(this,E))==null||e.removeEventListener("billboardChange",t(this,g))}}f=new WeakMap,E=new WeakMap,g=new WeakMap;S.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",R);var I,M;class U extends HTMLElement{constructor(){super();n(this,I,new q.CSSProperty(this,"--step",1));n(this,M,null);this.addEventListener("click",e=>{t(this,M)&&(!this.handleClick||this.handleClick(e))&&t(this,M).shift(t(this,I).current)})}connectedCallback(){this.tabIndex=0,a(this,M,G.findParentElement(this,A)),t(this,I).observe()}disconnectedCallback(){this.removeAttribute("tabindex"),t(this,I).unobserve()}}I=new WeakMap,M=new WeakMap;S.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",U);exports.BillboardBulletsElement=Q;exports.BillboardElement=A;exports.BillboardSetButtonElement=R;exports.BillboardStepButtonElement=U;
|
package/lib/billboard/index.js
CHANGED
|
@@ -10,36 +10,36 @@ var R = (s, l, e) => new Promise((i, r) => {
|
|
|
10
10
|
} catch ($) {
|
|
11
11
|
r($);
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, S = (C) => {
|
|
14
14
|
try {
|
|
15
15
|
N(e.throw(C));
|
|
16
16
|
} catch ($) {
|
|
17
17
|
r($);
|
|
18
18
|
}
|
|
19
|
-
}, N = (C) => C.done ? i(C.value) : Promise.resolve(C.value).then(d,
|
|
19
|
+
}, N = (C) => C.done ? i(C.value) : Promise.resolve(C.value).then(d, S);
|
|
20
20
|
N((e = e.apply(s, l)).next());
|
|
21
21
|
});
|
|
22
22
|
import { a as G, i as K } from "../index-euf5anj6.js";
|
|
23
23
|
import { b as O } from "../dom-CVWzyXPH.js";
|
|
24
|
-
import { CSSProperty as
|
|
24
|
+
import { CSSProperty as T } from "../css-property/index.js";
|
|
25
25
|
import { d as U } from "../events-CsVF98U6.js";
|
|
26
26
|
import { s as V } from "../gestures-CcXV6fCp.js";
|
|
27
27
|
import { c as W } from "../math-BOBiC4TN.js";
|
|
28
28
|
import { l as X } from "../number-CbdpfO3u.js";
|
|
29
|
-
var
|
|
29
|
+
var k, E, v, L, x, o, c, h, J, H, w, P, D, q, z;
|
|
30
30
|
class F extends HTMLElement {
|
|
31
31
|
constructor() {
|
|
32
32
|
super(...arguments);
|
|
33
33
|
n(this, h);
|
|
34
|
-
n(this,
|
|
35
|
-
n(this, E, new
|
|
36
|
-
n(this, v, new
|
|
34
|
+
n(this, k, new T(this, "--loop", !0));
|
|
35
|
+
n(this, E, new T(this, "--autoplay", !1));
|
|
36
|
+
n(this, v, new T(this, "--swipe", "x"));
|
|
37
37
|
n(this, L);
|
|
38
38
|
n(this, x, !1);
|
|
39
39
|
n(this, o, []);
|
|
40
40
|
n(this, c, 0);
|
|
41
|
-
n(this,
|
|
42
|
-
a(this, x, e.isIntersecting), t(this, x) ? u(this, h,
|
|
41
|
+
n(this, w, (e) => {
|
|
42
|
+
a(this, x, e.isIntersecting), t(this, x) ? u(this, h, H).call(this) : clearInterval(t(this, L));
|
|
43
43
|
});
|
|
44
44
|
n(this, P, () => {
|
|
45
45
|
clearInterval(t(this, L)), t(this, x) && a(this, L, setInterval(
|
|
@@ -48,7 +48,7 @@ class F extends HTMLElement {
|
|
|
48
48
|
));
|
|
49
49
|
});
|
|
50
50
|
n(this, q, () => {
|
|
51
|
-
u(this, h,
|
|
51
|
+
u(this, h, D).call(this, t(this, c) + 1);
|
|
52
52
|
});
|
|
53
53
|
n(this, z, (e) => {
|
|
54
54
|
if (!t(this, v).current)
|
|
@@ -56,8 +56,8 @@ class F extends HTMLElement {
|
|
|
56
56
|
let i = 0;
|
|
57
57
|
V(
|
|
58
58
|
(r) => {
|
|
59
|
-
const d = e.x - r.x,
|
|
60
|
-
t(this, v).current === "x" ? Math.abs(d) > Math.abs(
|
|
59
|
+
const d = e.x - r.x, S = e.y - r.y;
|
|
60
|
+
t(this, v).current === "x" ? Math.abs(d) > Math.abs(S) && (i = Math.sign(d)) : t(this, v).current === "y" && Math.abs(S) > Math.abs(d) && (i = Math.sign(S));
|
|
61
61
|
},
|
|
62
62
|
() => {
|
|
63
63
|
this.shift(i);
|
|
@@ -75,7 +75,7 @@ class F extends HTMLElement {
|
|
|
75
75
|
t(this, o).push(e), u(this, h, J).call(this);
|
|
76
76
|
}
|
|
77
77
|
set(e) {
|
|
78
|
-
(!this.handleSet || this.handleSet(e)) && (u(this, h,
|
|
78
|
+
(!this.handleSet || this.handleSet(e)) && (u(this, h, D).call(this, e), u(this, h, H).call(this));
|
|
79
79
|
}
|
|
80
80
|
shift(e) {
|
|
81
81
|
this.set(t(this, c) + e);
|
|
@@ -87,19 +87,19 @@ class F extends HTMLElement {
|
|
|
87
87
|
`[data-billboard-item="${this.id || ""}"]`
|
|
88
88
|
)
|
|
89
89
|
]), (e = t(this, o)[0]) == null || e.classList.add("current"), u(this, h, J).call(this), t(this, E).subscribe((i) => {
|
|
90
|
-
i.current ? (G.subscribe(this, t(this,
|
|
91
|
-
}), t(this, E).observe(), t(this, v).observe(), this.addEventListener("pointerdown", t(this, z));
|
|
90
|
+
i.current ? (G.subscribe(this, t(this, w)), u(this, h, H).call(this)) : (a(this, x, !0), G.unsubscribe(t(this, w)), clearInterval(t(this, L)), u(this, h, D).call(this, 0));
|
|
91
|
+
}), t(this, E).observe(), t(this, v).observe(), t(this, k).observe(), this.addEventListener("pointerdown", t(this, z));
|
|
92
92
|
}
|
|
93
93
|
disconnectedCallback() {
|
|
94
|
-
t(this, E).unobserve(), t(this, v).unobserve(), G.unsubscribe(t(this,
|
|
94
|
+
t(this, E).unobserve(), t(this, v).unobserve(), t(this, k).unobserve(), G.unsubscribe(t(this, w)), clearInterval(t(this, L));
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
|
|
97
|
+
k = new WeakMap(), E = new WeakMap(), v = new WeakMap(), L = new WeakMap(), x = new WeakMap(), o = new WeakMap(), c = new WeakMap(), h = new WeakSet(), J = function() {
|
|
98
98
|
t(this, o).length > 1 ? this.classList.add("has-length") : this.classList.remove("has-length");
|
|
99
|
-
},
|
|
99
|
+
}, H = function() {
|
|
100
100
|
t(this, E).current !== !1 && t(this, P).call(this);
|
|
101
|
-
},
|
|
102
|
-
t(this,
|
|
101
|
+
}, w = new WeakMap(), P = new WeakMap(), D = function(e) {
|
|
102
|
+
t(this, k).current ? a(this, c, X(e, t(this, o).length)) : a(this, c, W(e, 0, t(this, o).length - 1)), t(this, o).forEach((i, r) => {
|
|
103
103
|
i.classList.remove("current", "previous", "next"), r === t(this, c) ? i.classList.add("current") : r < t(this, c) ? i.classList.add("previous") : r > t(this, c) && i.classList.add("next");
|
|
104
104
|
}), U(this, "billboardChange", {
|
|
105
105
|
detail: {
|
|
@@ -110,18 +110,18 @@ D = new WeakMap(), E = new WeakMap(), v = new WeakMap(), L = new WeakMap(), x =
|
|
|
110
110
|
}, 0);
|
|
111
111
|
}, q = new WeakMap(), z = new WeakMap();
|
|
112
112
|
customElements.get("e-billboard") || customElements.define("e-billboard", F);
|
|
113
|
-
var b,
|
|
113
|
+
var b, I, m, A, y;
|
|
114
114
|
class Y extends HTMLElement {
|
|
115
115
|
constructor() {
|
|
116
116
|
super(...arguments);
|
|
117
117
|
n(this, b, null);
|
|
118
|
-
n(this,
|
|
118
|
+
n(this, I, null);
|
|
119
119
|
n(this, m, []);
|
|
120
|
-
n(this,
|
|
120
|
+
n(this, A, (e) => {
|
|
121
121
|
const i = e.currentTarget, r = t(this, m).findIndex((d) => d === i);
|
|
122
122
|
r >= 0 && t(this, b).set(r);
|
|
123
123
|
});
|
|
124
|
-
n(this,
|
|
124
|
+
n(this, y, () => {
|
|
125
125
|
t(this, m).forEach((e, i) => {
|
|
126
126
|
i === t(this, b).counter ? e.classList.add("current") : e.classList.remove("current");
|
|
127
127
|
});
|
|
@@ -132,37 +132,37 @@ class Y extends HTMLElement {
|
|
|
132
132
|
var e;
|
|
133
133
|
if (a(this, b, O(this, F)), t(this, b) && (yield customElements.whenDefined("e-billboard"), this.isConnected)) {
|
|
134
134
|
const i = t(this, b).itemElements.length;
|
|
135
|
-
a(this,
|
|
135
|
+
a(this, I, document.createElement("div"));
|
|
136
136
|
for (let r = 0; r < i; r++) {
|
|
137
137
|
const d = document.createElement("button");
|
|
138
|
-
t(this, m).push(d), t(this,
|
|
138
|
+
t(this, m).push(d), t(this, I).appendChild(d);
|
|
139
139
|
}
|
|
140
|
-
this.appendChild(t(this,
|
|
141
|
-
r.addEventListener("click", t(this,
|
|
140
|
+
this.appendChild(t(this, I)), t(this, m).forEach((r) => {
|
|
141
|
+
r.addEventListener("click", t(this, A));
|
|
142
142
|
}), (e = t(this, b)) == null || e.addEventListener(
|
|
143
143
|
"billboardChange",
|
|
144
|
-
t(this,
|
|
145
|
-
), t(this,
|
|
144
|
+
t(this, y)
|
|
145
|
+
), t(this, y).call(this);
|
|
146
146
|
}
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
disconnectedCallback() {
|
|
150
150
|
var e;
|
|
151
151
|
t(this, m).forEach((i) => {
|
|
152
|
-
i.removeEventListener("click", t(this,
|
|
152
|
+
i.removeEventListener("click", t(this, A));
|
|
153
153
|
}), (e = t(this, b)) == null || e.removeEventListener(
|
|
154
154
|
"billboardChange",
|
|
155
|
-
t(this,
|
|
155
|
+
t(this, y)
|
|
156
156
|
), this.innerHTML = "", a(this, m, []);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
b = new WeakMap(),
|
|
159
|
+
b = new WeakMap(), I = new WeakMap(), m = new WeakMap(), A = new WeakMap(), y = new WeakMap();
|
|
160
160
|
K && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", Y);
|
|
161
161
|
var f, p, g;
|
|
162
162
|
class Z extends HTMLElement {
|
|
163
163
|
constructor() {
|
|
164
164
|
super();
|
|
165
|
-
n(this, f, new
|
|
165
|
+
n(this, f, new T(this, "--index", 0));
|
|
166
166
|
n(this, p, null);
|
|
167
167
|
n(this, g, () => {
|
|
168
168
|
var e;
|
|
@@ -191,24 +191,24 @@ class Z extends HTMLElement {
|
|
|
191
191
|
}
|
|
192
192
|
f = new WeakMap(), p = new WeakMap(), g = new WeakMap();
|
|
193
193
|
K && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", Z);
|
|
194
|
-
var
|
|
194
|
+
var M, B;
|
|
195
195
|
class _ extends HTMLElement {
|
|
196
196
|
constructor() {
|
|
197
197
|
super();
|
|
198
|
-
n(this,
|
|
199
|
-
n(this,
|
|
198
|
+
n(this, M, new T(this, "--step", 1));
|
|
199
|
+
n(this, B, null);
|
|
200
200
|
this.addEventListener("click", (e) => {
|
|
201
|
-
t(this,
|
|
201
|
+
t(this, B) && (!this.handleClick || this.handleClick(e)) && t(this, B).shift(t(this, M).current);
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
connectedCallback() {
|
|
205
|
-
this.tabIndex = 0, a(this,
|
|
205
|
+
this.tabIndex = 0, a(this, B, O(this, F)), t(this, M).observe();
|
|
206
206
|
}
|
|
207
207
|
disconnectedCallback() {
|
|
208
|
-
this.removeAttribute("tabindex"), t(this,
|
|
208
|
+
this.removeAttribute("tabindex"), t(this, M).unobserve();
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
-
|
|
211
|
+
M = new WeakMap(), B = new WeakMap();
|
|
212
212
|
K && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", _);
|
|
213
213
|
export {
|
|
214
214
|
Y as BillboardBulletsElement,
|