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