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