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