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