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