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