aptechka 0.65.2 → 0.65.3
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 +151 -138
- package/package.json +1 -1
package/lib/billboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var W=n=>{throw TypeError(n)};var Q=(n,l,e)=>l.has(n)||W("Cannot "+e);var t=(n,l,e)=>(Q(n,l,"read from private field"),e?e.call(n):l.get(n)),i=(n,l,e)=>l.has(n)?W("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,e),c=(n,l,e,s)=>(Q(n,l,"write to private field"),s?s.call(n,e):l.set(n,e),e),d=(n,l,e)=>(Q(n,l,"access private method"),e);var F=(n,l,e)=>new Promise((s,r)=>{var o=g=>{try{x(e.next(g))}catch(N){r(N)}},f=g=>{try{x(e.throw(g))}catch(N){r(N)}},x=g=>g.done?s(g.value):Promise.resolve(g.value).then(o,f);x((e=e.apply(n,l)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../index-DekP7OZe.cjs"),V=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const P=require("../css-property/index.cjs"),et=require("../events-KVanG9sR.cjs"),st=require("../gestures-C7gbKx11.cjs"),it=require("../math-GDWEqu7y.cjs"),X=require("../number-DyefJ5a1.cjs");var T,A,v,E,y,B,$,m,h,b,a,R,G,q,O,U,M,J,K;class j extends HTMLElement{constructor(){super(...arguments);i(this,a);i(this,T,new P.CSSProperty(this,"--resize",!0));i(this,A,new P.CSSProperty(this,"--loop",!0));i(this,v,new P.CSSProperty(this,"--autoplay",!1));i(this,E,new P.CSSProperty(this,"--swipe","x"));i(this,y);i(this,B,!1);i(this,$,[]);i(this,m,new Map);i(this,h,0);i(this,b,0);i(this,q,e=>{c(this,B,e.isIntersecting),t(this,B)?d(this,a,G).call(this):clearInterval(t(this,y))});i(this,O,()=>{clearInterval(t(this,y)),t(this,B)&&c(this,y,setInterval(t(this,J),parseFloat(t(this,v).current||"0")*1e3))});i(this,J,()=>{d(this,a,M).call(this,t(this,h)+1)});i(this,K,e=>{if(!t(this,E).current)return;let s=0;st.setupDrag(r=>{const o=e.x-r.x,f=e.y-r.y;t(this,E).current==="x"?Math.abs(o)>Math.abs(f)&&Math.abs(o)>10&&(s=Math.sign(o)):t(this,E).current==="y"&&Math.abs(f)>Math.abs(o)&&Math.abs(f)>10&&(s=Math.sign(f))},()=>{s&&this.shift(s)})})}get counter(){return t(this,h)}get loop(){return t(this,A)}get autoplay(){return t(this,v)}get swipe(){return t(this,E)}get itemElements(){return t(this,$)}get groups(){return t(this,m)}get length(){return t(this,b)}addItem(e){d(this,a,R).call(this,e),d(this,a,M).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(d(this,a,M).call(this,e),d(this,a,G).call(this))}shift(e){this.set(t(this,h)+e)}connectedCallback(){[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)].forEach(s=>{d(this,a,R).call(this,s)}),t(this,m).forEach(s=>{var r;(r=s[0])==null||r.classList.add("current")}),t(this,v).subscribe(s=>{s.current?(I.intersector.subscribe(this,t(this,q)),d(this,a,G).call(this)):(c(this,B,!0),I.intersector.unsubscribe(t(this,q)),clearInterval(t(this,y)),d(this,a,M).call(this,0))}),t(this,v).observe(),t(this,E).observe(),t(this,A).observe(),t(this,T).observe(),d(this,a,M).call(this,0),this.addEventListener("pointerdown",t(this,K))}disconnectedCallback(){t(this,v).unobserve(),t(this,E).unobserve(),t(this,A).unobserve(),t(this,T).unobserve(),t(this,m).clear(),I.intersector.unsubscribe(t(this,q)),clearInterval(t(this,y))}}T=new WeakMap,A=new WeakMap,v=new WeakMap,E=new WeakMap,y=new WeakMap,B=new WeakMap,$=new WeakMap,m=new WeakMap,h=new WeakMap,b=new WeakMap,a=new WeakSet,R=function(e){t(this,$).push(e);const s=e.getAttribute("data-billboard-item-group")||"default";let r=t(this,m).get(s);r||(r=[],t(this,m).set(s,r)),r.push(e),c(this,b,0),t(this,m).forEach(o=>{o.length>t(this,b)&&c(this,b,o.length)})},G=function(){t(this,v).current!==!1&&t(this,O).call(this)},q=new WeakMap,O=new WeakMap,U=function(e,s){e.classList.remove("current","previous","next","previous-sibling","next-sibling"),s===t(this,h)?e.classList.add("current"):s<t(this,h)?e.classList.add("previous"):s>t(this,h)&&e.classList.add("next"),s===X.loopNumber(t(this,h)-1,this.length)?e.classList.add("previous-sibling"):s===(t(this,h)+1)%this.length&&e.classList.add("next-sibling")},M=function(){return F(this,arguments,function*(e=t(this,h)){const s=t(this,h);t(this,A).current?c(this,h,X.loopNumber(e,t(this,b))):c(this,h,it.clamp(e,0,t(this,b)-1)),this.classList.remove("forward","backward"),t(this,h)-s>=0?this.classList.add("forward"):t(this,h)-s<0&&this.classList.add("backward");let r=[];t(this,m).forEach(o=>{o.forEach((f,x)=>{const g=f.classList.contains("visited");x===t(this,h)&&!g?(f.classList.add("visited"),r.push(new Promise(N=>{setTimeout(()=>{d(this,a,U).call(this,f,x),N()},0)}))):d(this,a,U).call(this,f,x)})}),r.length&&(yield Promise.all(r)),this.classList.toggle("has-length",t(this,b)>1),this.classList.toggle("start",t(this,h)===0),this.classList.toggle("end",t(this,h)===t(this,b)-1),this.style.setProperty("--counter",t(this,h).toString()),this.style.setProperty("--sections",t(this,b).toString()),t(this,h)!==s&&(et.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,h)}}),t(this,T).current&&setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0))})},J=new WeakMap,K=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",j);var p,D,L,_,H;class Y extends HTMLElement{constructor(){super(...arguments);i(this,p,null);i(this,D,null);i(this,L,[]);i(this,_,e=>{const s=e.currentTarget,r=t(this,L).findIndex(o=>o===s);r>=0&&t(this,p).set(r)});i(this,H,()=>{t(this,L).forEach((e,s)=>{s===t(this,p).counter?e.classList.add("current"):e.classList.remove("current")})})}connectedCallback(){return F(this,null,function*(){var e;if(c(this,p,V.findParentElement(this,j)),t(this,p)&&(yield customElements.whenDefined("e-billboard"),this.isConnected)){this.innerHTML="";const s=t(this,p).length;c(this,D,document.createElement("div"));for(let r=0;r<s;r++){const o=document.createElement("button");o.setAttribute("aria-label",`Go to item ${r+1}`),t(this,L).push(o),t(this,D).appendChild(o)}this.appendChild(t(this,D)),t(this,L).forEach(r=>{r.addEventListener("click",t(this,_))}),(e=t(this,p))==null||e.addEventListener("billboardChange",t(this,H)),t(this,H).call(this)}})}disconnectedCallback(){var e;t(this,L).forEach(s=>{s.removeEventListener("click",t(this,_))}),(e=t(this,p))==null||e.removeEventListener("billboardChange",t(this,H)),this.innerHTML="",c(this,L,[])}}p=new WeakMap,D=new WeakMap,L=new WeakMap,_=new WeakMap,H=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",Y);var w,C,k;class Z extends HTMLElement{constructor(){super();i(this,w,new P.CSSProperty(this,"--index",0));i(this,C,null);i(this,k,()=>{var e;t(this,w).current===((e=t(this,C))==null?void 0:e.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",e=>{t(this,C)&&(!this.handleClick||this.handleClick(e))&&t(this,C).set(t(this,w).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){var e;this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),c(this,C,V.findParentElement(this,j)),(e=t(this,C))==null||e.addEventListener("billboardChange",t(this,k)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&t(this,k).call(this)}),t(this,w).subscribe(t(this,k)),t(this,w).observe()}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,w).unsubscribe(t(this,k)),t(this,w).unobserve(),(e=t(this,C))==null||e.removeEventListener("billboardChange",t(this,k))}}w=new WeakMap,C=new WeakMap,k=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",Z);var S,u,z;class tt extends HTMLElement{constructor(){super();i(this,S,new P.CSSProperty(this,"--step",1));i(this,u,null);i(this,z,()=>{t(this,u)&&(!t(this,u).loop.current&&(t(this,u).counter===0&&t(this,S).current<=0||t(this,u).counter===t(this,u).length-1&&t(this,S).current>=0)?this.setAttribute("disabled",""):this.removeAttribute("disabled"))});this.addEventListener("click",e=>{t(this,u)&&(!this.handleClick||this.handleClick(e))&&t(this,u).shift(t(this,S).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return F(this,null,function*(){var e;yield customElements.whenDefined("e-billboard"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),t(this,S).observe(),this.tabIndex=0,c(this,u,V.findParentElement(this,j)),(e=t(this,u))==null||e.addEventListener("billboardChange",t(this,z)),setTimeout(()=>{t(this,z).call(this)},0)})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,S).unobserve(),(e=t(this,u))==null||e.removeEventListener("billboardChange",t(this,z))}}S=new WeakMap,u=new WeakMap,z=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",tt);exports.BillboardBulletsElement=Y;exports.BillboardElement=j;exports.BillboardSetButtonElement=Z;exports.BillboardStepButtonElement=tt;
|
package/lib/billboard/index.js
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Y = (n) => {
|
|
2
2
|
throw TypeError(n);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var t = (n,
|
|
6
|
-
var
|
|
7
|
-
var
|
|
4
|
+
var Q = (n, l, e) => l.has(n) || Y("Cannot " + e);
|
|
5
|
+
var t = (n, l, e) => (Q(n, l, "read from private field"), e ? e.call(n) : l.get(n)), i = (n, l, e) => l.has(n) ? Y("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(n) : l.set(n, e), c = (n, l, e, s) => (Q(n, l, "write to private field"), s ? s.call(n, e) : l.set(n, e), e), d = (n, l, e) => (Q(n, l, "access private method"), e);
|
|
6
|
+
var F = (n, l, e) => new Promise((s, r) => {
|
|
7
|
+
var o = (g) => {
|
|
8
8
|
try {
|
|
9
|
-
|
|
10
|
-
} catch (
|
|
11
|
-
r(
|
|
9
|
+
A(e.next(g));
|
|
10
|
+
} catch ($) {
|
|
11
|
+
r($);
|
|
12
12
|
}
|
|
13
|
-
},
|
|
13
|
+
}, f = (g) => {
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
} catch (
|
|
17
|
-
r(
|
|
15
|
+
A(e.throw(g));
|
|
16
|
+
} catch ($) {
|
|
17
|
+
r($);
|
|
18
18
|
}
|
|
19
|
-
},
|
|
20
|
-
|
|
19
|
+
}, A = (g) => g.done ? s(g.value) : Promise.resolve(g.value).then(o, f);
|
|
20
|
+
A((e = e.apply(n, l)).next());
|
|
21
21
|
});
|
|
22
|
-
import { a as R, i as
|
|
23
|
-
import { b as
|
|
22
|
+
import { a as R, i as W } from "../index-Bv9zgfdb.js";
|
|
23
|
+
import { b as X } from "../dom-CVWzyXPH.js";
|
|
24
24
|
import "construct-style-sheets-polyfill";
|
|
25
|
-
import { CSSProperty as
|
|
26
|
-
import { d as
|
|
27
|
-
import { s as
|
|
28
|
-
import { c as
|
|
29
|
-
import { l as
|
|
30
|
-
var
|
|
31
|
-
class
|
|
25
|
+
import { CSSProperty as T } from "../css-property/index.js";
|
|
26
|
+
import { d as _ } from "../events-CsVF98U6.js";
|
|
27
|
+
import { s as tt } from "../gestures-CcXV6fCp.js";
|
|
28
|
+
import { c as et } from "../math-BOBiC4TN.js";
|
|
29
|
+
import { l as Z } from "../number-CbdpfO3u.js";
|
|
30
|
+
var B, M, v, E, C, I, N, m, h, u, a, U, G, D, j, V, S, J, K;
|
|
31
|
+
class O extends HTMLElement {
|
|
32
32
|
constructor() {
|
|
33
33
|
super(...arguments);
|
|
34
|
-
i(this,
|
|
35
|
-
i(this,
|
|
36
|
-
i(this,
|
|
37
|
-
i(this,
|
|
38
|
-
i(this,
|
|
39
|
-
i(this,
|
|
40
|
-
i(this,
|
|
41
|
-
i(this,
|
|
34
|
+
i(this, a);
|
|
35
|
+
i(this, B, new T(this, "--resize", !0));
|
|
36
|
+
i(this, M, new T(this, "--loop", !0));
|
|
37
|
+
i(this, v, new T(this, "--autoplay", !1));
|
|
38
|
+
i(this, E, new T(this, "--swipe", "x"));
|
|
39
|
+
i(this, C);
|
|
40
|
+
i(this, I, !1);
|
|
41
|
+
i(this, N, []);
|
|
42
42
|
i(this, m, /* @__PURE__ */ new Map());
|
|
43
|
-
i(this,
|
|
43
|
+
i(this, h, 0);
|
|
44
44
|
i(this, u, 0);
|
|
45
|
-
i(this,
|
|
46
|
-
c(this,
|
|
45
|
+
i(this, D, (e) => {
|
|
46
|
+
c(this, I, e.isIntersecting), t(this, I) ? d(this, a, G).call(this) : clearInterval(t(this, C));
|
|
47
47
|
});
|
|
48
|
-
i(this,
|
|
49
|
-
clearInterval(t(this,
|
|
50
|
-
t(this,
|
|
51
|
-
parseFloat(t(this,
|
|
48
|
+
i(this, j, () => {
|
|
49
|
+
clearInterval(t(this, C)), t(this, I) && c(this, C, setInterval(
|
|
50
|
+
t(this, J),
|
|
51
|
+
parseFloat(t(this, v).current || "0") * 1e3
|
|
52
52
|
));
|
|
53
53
|
});
|
|
54
|
-
i(this,
|
|
55
|
-
|
|
54
|
+
i(this, J, () => {
|
|
55
|
+
d(this, a, S).call(this, t(this, h) + 1);
|
|
56
56
|
});
|
|
57
|
-
i(this,
|
|
58
|
-
if (!t(this,
|
|
57
|
+
i(this, K, (e) => {
|
|
58
|
+
if (!t(this, E).current)
|
|
59
59
|
return;
|
|
60
60
|
let s = 0;
|
|
61
|
-
|
|
61
|
+
tt(
|
|
62
62
|
(r) => {
|
|
63
|
-
const
|
|
64
|
-
t(this,
|
|
63
|
+
const o = e.x - r.x, f = e.y - r.y;
|
|
64
|
+
t(this, E).current === "x" ? Math.abs(o) > Math.abs(f) && Math.abs(o) > 10 && (s = Math.sign(o)) : t(this, E).current === "y" && Math.abs(f) > Math.abs(o) && Math.abs(f) > 10 && (s = Math.sign(f));
|
|
65
65
|
},
|
|
66
66
|
() => {
|
|
67
67
|
s && this.shift(s);
|
|
@@ -70,19 +70,19 @@ class j extends HTMLElement {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
get counter() {
|
|
73
|
-
return t(this,
|
|
73
|
+
return t(this, h);
|
|
74
74
|
}
|
|
75
75
|
get loop() {
|
|
76
|
-
return t(this,
|
|
76
|
+
return t(this, M);
|
|
77
77
|
}
|
|
78
78
|
get autoplay() {
|
|
79
|
-
return t(this,
|
|
79
|
+
return t(this, v);
|
|
80
80
|
}
|
|
81
81
|
get swipe() {
|
|
82
|
-
return t(this,
|
|
82
|
+
return t(this, E);
|
|
83
83
|
}
|
|
84
84
|
get itemElements() {
|
|
85
|
-
return t(this,
|
|
85
|
+
return t(this, N);
|
|
86
86
|
}
|
|
87
87
|
get groups() {
|
|
88
88
|
return t(this, m);
|
|
@@ -91,13 +91,13 @@ class j extends HTMLElement {
|
|
|
91
91
|
return t(this, u);
|
|
92
92
|
}
|
|
93
93
|
addItem(e) {
|
|
94
|
-
|
|
94
|
+
d(this, a, U).call(this, e), d(this, a, S).call(this);
|
|
95
95
|
}
|
|
96
96
|
set(e) {
|
|
97
|
-
(!this.handleSet || this.handleSet(e)) && (
|
|
97
|
+
(!this.handleSet || this.handleSet(e)) && (d(this, a, S).call(this, e), d(this, a, G).call(this));
|
|
98
98
|
}
|
|
99
99
|
shift(e) {
|
|
100
|
-
this.set(t(this,
|
|
100
|
+
this.set(t(this, h) + e);
|
|
101
101
|
}
|
|
102
102
|
connectedCallback() {
|
|
103
103
|
[
|
|
@@ -105,171 +105,184 @@ class j extends HTMLElement {
|
|
|
105
105
|
`[data-billboard-item${this.id ? `="${this.id}"` : ""}]`
|
|
106
106
|
)
|
|
107
107
|
].forEach((s) => {
|
|
108
|
-
|
|
108
|
+
d(this, a, U).call(this, s);
|
|
109
109
|
}), t(this, m).forEach((s) => {
|
|
110
110
|
var r;
|
|
111
111
|
(r = s[0]) == null || r.classList.add("current");
|
|
112
|
-
}), t(this,
|
|
113
|
-
s.current ? (R.subscribe(this, t(this,
|
|
114
|
-
}), t(this,
|
|
112
|
+
}), t(this, v).subscribe((s) => {
|
|
113
|
+
s.current ? (R.subscribe(this, t(this, D)), d(this, a, G).call(this)) : (c(this, I, !0), R.unsubscribe(t(this, D)), clearInterval(t(this, C)), d(this, a, S).call(this, 0));
|
|
114
|
+
}), t(this, v).observe(), t(this, E).observe(), t(this, M).observe(), t(this, B).observe(), d(this, a, S).call(this, 0), this.addEventListener("pointerdown", t(this, K));
|
|
115
115
|
}
|
|
116
116
|
disconnectedCallback() {
|
|
117
|
-
t(this,
|
|
117
|
+
t(this, v).unobserve(), t(this, E).unobserve(), t(this, M).unobserve(), t(this, B).unobserve(), t(this, m).clear(), R.unsubscribe(t(this, D)), clearInterval(t(this, C));
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
|
|
121
|
-
t(this,
|
|
120
|
+
B = new WeakMap(), M = new WeakMap(), v = new WeakMap(), E = new WeakMap(), C = new WeakMap(), I = new WeakMap(), N = new WeakMap(), m = new WeakMap(), h = new WeakMap(), u = new WeakMap(), a = new WeakSet(), U = function(e) {
|
|
121
|
+
t(this, N).push(e);
|
|
122
122
|
const s = e.getAttribute("data-billboard-item-group") || "default";
|
|
123
123
|
let r = t(this, m).get(s);
|
|
124
|
-
r || (r = [], t(this, m).set(s, r)), r.push(e), c(this, u, 0), t(this, m).forEach((
|
|
125
|
-
|
|
124
|
+
r || (r = [], t(this, m).set(s, r)), r.push(e), c(this, u, 0), t(this, m).forEach((o) => {
|
|
125
|
+
o.length > t(this, u) && c(this, u, o.length);
|
|
126
126
|
});
|
|
127
|
-
},
|
|
128
|
-
t(this,
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
127
|
+
}, G = function() {
|
|
128
|
+
t(this, v).current !== !1 && t(this, j).call(this);
|
|
129
|
+
}, D = new WeakMap(), j = new WeakMap(), V = function(e, s) {
|
|
130
|
+
e.classList.remove(
|
|
131
|
+
"current",
|
|
132
|
+
"previous",
|
|
133
|
+
"next",
|
|
134
|
+
"previous-sibling",
|
|
135
|
+
"next-sibling"
|
|
136
|
+
), s === t(this, h) ? e.classList.add("current") : s < t(this, h) ? e.classList.add("previous") : s > t(this, h) && e.classList.add("next"), s === Z(t(this, h) - 1, this.length) ? e.classList.add("previous-sibling") : s === (t(this, h) + 1) % this.length && e.classList.add("next-sibling");
|
|
137
|
+
}, S = function() {
|
|
138
|
+
return F(this, arguments, function* (e = t(this, h)) {
|
|
139
|
+
const s = t(this, h);
|
|
140
|
+
t(this, M).current ? c(this, h, Z(e, t(this, u))) : c(this, h, et(e, 0, t(this, u) - 1)), this.classList.remove("forward", "backward"), t(this, h) - s >= 0 ? this.classList.add("forward") : t(this, h) - s < 0 && this.classList.add("backward");
|
|
141
|
+
let r = [];
|
|
142
|
+
t(this, m).forEach((o) => {
|
|
143
|
+
o.forEach((f, A) => {
|
|
144
|
+
const g = f.classList.contains("visited");
|
|
145
|
+
A === t(this, h) && !g ? (f.classList.add("visited"), r.push(
|
|
146
|
+
new Promise(($) => {
|
|
147
|
+
setTimeout(() => {
|
|
148
|
+
d(this, a, V).call(this, f, A), $();
|
|
149
|
+
}, 0);
|
|
150
|
+
})
|
|
151
|
+
)) : d(this, a, V).call(this, f, A);
|
|
152
|
+
});
|
|
153
|
+
}), r.length && (yield Promise.all(r)), this.classList.toggle("has-length", t(this, u) > 1), this.classList.toggle("start", t(this, h) === 0), this.classList.toggle("end", t(this, h) === t(this, u) - 1), this.style.setProperty("--counter", t(this, h).toString()), this.style.setProperty("--sections", t(this, u).toString()), t(this, h) !== s && (_(this, "billboardChange", {
|
|
154
|
+
detail: {
|
|
155
|
+
counter: t(this, h)
|
|
156
|
+
}
|
|
157
|
+
}), t(this, B).current && setTimeout(() => {
|
|
158
|
+
window.dispatchEvent(new Event("resize"));
|
|
159
|
+
}, 0));
|
|
160
|
+
});
|
|
161
|
+
}, J = new WeakMap(), K = new WeakMap();
|
|
162
|
+
customElements.get("e-billboard") || customElements.define("e-billboard", O);
|
|
163
|
+
var p, H, L, q, P;
|
|
164
|
+
class st extends HTMLElement {
|
|
152
165
|
constructor() {
|
|
153
166
|
super(...arguments);
|
|
154
167
|
i(this, p, null);
|
|
155
|
-
i(this,
|
|
156
|
-
i(this,
|
|
157
|
-
i(this,
|
|
158
|
-
const s = e.currentTarget, r = t(this,
|
|
168
|
+
i(this, H, null);
|
|
169
|
+
i(this, L, []);
|
|
170
|
+
i(this, q, (e) => {
|
|
171
|
+
const s = e.currentTarget, r = t(this, L).findIndex((o) => o === s);
|
|
159
172
|
r >= 0 && t(this, p).set(r);
|
|
160
173
|
});
|
|
161
|
-
i(this,
|
|
162
|
-
t(this,
|
|
174
|
+
i(this, P, () => {
|
|
175
|
+
t(this, L).forEach((e, s) => {
|
|
163
176
|
s === t(this, p).counter ? e.classList.add("current") : e.classList.remove("current");
|
|
164
177
|
});
|
|
165
178
|
});
|
|
166
179
|
}
|
|
167
180
|
connectedCallback() {
|
|
168
|
-
return
|
|
181
|
+
return F(this, null, function* () {
|
|
169
182
|
var e;
|
|
170
|
-
if (c(this, p,
|
|
183
|
+
if (c(this, p, X(this, O)), t(this, p) && (yield customElements.whenDefined("e-billboard"), this.isConnected)) {
|
|
171
184
|
this.innerHTML = "";
|
|
172
185
|
const s = t(this, p).length;
|
|
173
|
-
c(this,
|
|
186
|
+
c(this, H, document.createElement("div"));
|
|
174
187
|
for (let r = 0; r < s; r++) {
|
|
175
|
-
const
|
|
176
|
-
|
|
188
|
+
const o = document.createElement("button");
|
|
189
|
+
o.setAttribute("aria-label", `Go to item ${r + 1}`), t(this, L).push(o), t(this, H).appendChild(o);
|
|
177
190
|
}
|
|
178
|
-
this.appendChild(t(this,
|
|
179
|
-
r.addEventListener("click", t(this,
|
|
191
|
+
this.appendChild(t(this, H)), t(this, L).forEach((r) => {
|
|
192
|
+
r.addEventListener("click", t(this, q));
|
|
180
193
|
}), (e = t(this, p)) == null || e.addEventListener(
|
|
181
194
|
"billboardChange",
|
|
182
|
-
t(this,
|
|
183
|
-
), t(this,
|
|
195
|
+
t(this, P)
|
|
196
|
+
), t(this, P).call(this);
|
|
184
197
|
}
|
|
185
198
|
});
|
|
186
199
|
}
|
|
187
200
|
disconnectedCallback() {
|
|
188
201
|
var e;
|
|
189
|
-
t(this,
|
|
190
|
-
s.removeEventListener("click", t(this,
|
|
202
|
+
t(this, L).forEach((s) => {
|
|
203
|
+
s.removeEventListener("click", t(this, q));
|
|
191
204
|
}), (e = t(this, p)) == null || e.removeEventListener(
|
|
192
205
|
"billboardChange",
|
|
193
|
-
t(this,
|
|
194
|
-
), this.innerHTML = "", c(this,
|
|
206
|
+
t(this, P)
|
|
207
|
+
), this.innerHTML = "", c(this, L, []);
|
|
195
208
|
}
|
|
196
209
|
}
|
|
197
|
-
p = new WeakMap(),
|
|
198
|
-
|
|
199
|
-
var
|
|
200
|
-
class
|
|
210
|
+
p = new WeakMap(), H = new WeakMap(), L = new WeakMap(), q = new WeakMap(), P = new WeakMap();
|
|
211
|
+
W && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", st);
|
|
212
|
+
var w, k, x;
|
|
213
|
+
class it extends HTMLElement {
|
|
201
214
|
constructor() {
|
|
202
215
|
super();
|
|
203
|
-
i(this,
|
|
204
|
-
i(this,
|
|
216
|
+
i(this, w, new T(this, "--index", 0));
|
|
217
|
+
i(this, k, null);
|
|
205
218
|
i(this, x, () => {
|
|
206
219
|
var e;
|
|
207
|
-
t(this,
|
|
220
|
+
t(this, w).current === ((e = t(this, k)) == null ? void 0 : e.counter) ? this.classList.add("current") : this.classList.remove("current");
|
|
208
221
|
});
|
|
209
222
|
this.addEventListener("click", (e) => {
|
|
210
|
-
t(this,
|
|
223
|
+
t(this, k) && (!this.handleClick || this.handleClick(e)) && t(this, k).set(t(this, w).current);
|
|
211
224
|
}), this.addEventListener("keydown", (e) => {
|
|
212
225
|
e.code === "Space" && !this.hasAttribute("keydown-disabled") && (e.preventDefault(), this.click());
|
|
213
226
|
});
|
|
214
227
|
}
|
|
215
228
|
connectedCallback() {
|
|
216
229
|
var e;
|
|
217
|
-
this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), c(this,
|
|
230
|
+
this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), c(this, k, X(this, O)), (e = t(this, k)) == null || e.addEventListener(
|
|
218
231
|
"billboardChange",
|
|
219
232
|
t(this, x)
|
|
220
233
|
), customElements.whenDefined("e-billboard").then(() => {
|
|
221
234
|
this.isConnected && t(this, x).call(this);
|
|
222
|
-
}), t(this,
|
|
235
|
+
}), t(this, w).subscribe(t(this, x)), t(this, w).observe();
|
|
223
236
|
}
|
|
224
237
|
disconnectedCallback() {
|
|
225
238
|
var e;
|
|
226
|
-
this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this,
|
|
239
|
+
this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, w).unsubscribe(t(this, x)), t(this, w).unobserve(), (e = t(this, k)) == null || e.removeEventListener(
|
|
227
240
|
"billboardChange",
|
|
228
241
|
t(this, x)
|
|
229
242
|
);
|
|
230
243
|
}
|
|
231
244
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
var
|
|
235
|
-
class
|
|
245
|
+
w = new WeakMap(), k = new WeakMap(), x = new WeakMap();
|
|
246
|
+
W && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", it);
|
|
247
|
+
var y, b, z;
|
|
248
|
+
class rt extends HTMLElement {
|
|
236
249
|
constructor() {
|
|
237
250
|
super();
|
|
238
|
-
i(this,
|
|
239
|
-
i(this,
|
|
240
|
-
i(this,
|
|
241
|
-
t(this,
|
|
251
|
+
i(this, y, new T(this, "--step", 1));
|
|
252
|
+
i(this, b, null);
|
|
253
|
+
i(this, z, () => {
|
|
254
|
+
t(this, b) && (!t(this, b).loop.current && (t(this, b).counter === 0 && t(this, y).current <= 0 || t(this, b).counter === t(this, b).length - 1 && t(this, y).current >= 0) ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"));
|
|
242
255
|
});
|
|
243
256
|
this.addEventListener("click", (e) => {
|
|
244
|
-
t(this,
|
|
257
|
+
t(this, b) && (!this.handleClick || this.handleClick(e)) && t(this, b).shift(t(this, y).current);
|
|
245
258
|
}), this.addEventListener("keydown", (e) => {
|
|
246
259
|
e.code === "Space" && !this.hasAttribute("keydown-disabled") && (e.preventDefault(), this.click());
|
|
247
260
|
});
|
|
248
261
|
}
|
|
249
262
|
connectedCallback() {
|
|
250
|
-
return
|
|
263
|
+
return F(this, null, function* () {
|
|
251
264
|
var e;
|
|
252
|
-
yield customElements.whenDefined("e-billboard"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), t(this,
|
|
265
|
+
yield customElements.whenDefined("e-billboard"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), t(this, y).observe(), this.tabIndex = 0, c(this, b, X(this, O)), (e = t(this, b)) == null || e.addEventListener(
|
|
253
266
|
"billboardChange",
|
|
254
|
-
t(this,
|
|
267
|
+
t(this, z)
|
|
255
268
|
), setTimeout(() => {
|
|
256
|
-
t(this,
|
|
269
|
+
t(this, z).call(this);
|
|
257
270
|
}, 0);
|
|
258
271
|
});
|
|
259
272
|
}
|
|
260
273
|
disconnectedCallback() {
|
|
261
274
|
var e;
|
|
262
|
-
this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this,
|
|
275
|
+
this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, y).unobserve(), (e = t(this, b)) == null || e.removeEventListener(
|
|
263
276
|
"billboardChange",
|
|
264
|
-
t(this,
|
|
277
|
+
t(this, z)
|
|
265
278
|
);
|
|
266
279
|
}
|
|
267
280
|
}
|
|
268
|
-
|
|
269
|
-
|
|
281
|
+
y = new WeakMap(), b = new WeakMap(), z = new WeakMap();
|
|
282
|
+
W && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", rt);
|
|
270
283
|
export {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
284
|
+
st as BillboardBulletsElement,
|
|
285
|
+
O as BillboardElement,
|
|
286
|
+
it as BillboardSetButtonElement,
|
|
287
|
+
rt as BillboardStepButtonElement
|
|
275
288
|
};
|