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