aptechka 0.50.3 → 0.50.5
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 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 g=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 E,f,v,c,b,r,A,w,p,T,P,q;class I extends HTMLElement{constructor(){super(...arguments);i(this,r);i(this,E,new D.CSSProperty(this,"--autoplay",!1));i(this,f);i(this,v,!1);i(this,c,[]);i(this,b,0);i(this,p,t=>{h(this,v,t.isIntersecting),e(this,v)?d(this,r,w).call(this):clearInterval(e(this,f))});i(this,T,()=>{clearInterval(e(this,f)),e(this,v)&&h(this,f,setInterval(e(this,q),parseFloat(e(this,E).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,E).subscribe(l=>{l.current?(g.intersector.subscribe(this,e(this,p)),d(this,r,w).call(this)):(h(this,v,!0),g.intersector.unsubscribe(e(this,p)),clearInterval(e(this,f)),d(this,r,P).call(this,0))}),e(this,E).observe()}disconnectedCallback(){e(this,E).unobserve(),g.intersector.unsubscribe(e(this,p)),clearInterval(e(this,f))}}E=new WeakMap,f=new WeakMap,v=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,E).current!==!1&&e(this,T).call(this)},p=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,C;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,C,()=>{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,C)),e(this,C).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,C)),this.innerHTML="",h(this,u,[])}}o=new WeakMap,u=new WeakMap,S=new WeakMap,C=new WeakMap;g.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",j);var L,m,B;class F extends HTMLElement{constructor(){super();i(this,L,new D.CSSProperty(this,"--index",0));i(this,m,null);i(this,B,()=>{var t;e(this,L).current===((t=e(this,m))==null?void 0:t.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",()=>{e(this,m)&&e(this,m).set(e(this,L).current)})}connectedCallback(){var t;this.tabIndex=0,h(this,m,H.findParentElement(this,I)),(t=e(this,m))==null||t.addEventListener("billboardChange",e(this,B)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&e(this,B).call(this)}),e(this,L).observe()}disconnectedCallback(){var t;this.removeAttribute("tabindex"),e(this,L).unobserve(),(t=e(this,m))==null||t.removeEventListener("billboardChange",e(this,B))}}L=new WeakMap,m=new WeakMap,B=new WeakMap;g.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;g.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.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,144 +1,178 @@
|
|
|
1
|
-
var
|
|
1
|
+
var N = (s) => {
|
|
2
2
|
throw TypeError(s);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var t = (s,
|
|
6
|
-
import { a as
|
|
7
|
-
import { b as
|
|
8
|
-
import { CSSProperty as
|
|
9
|
-
import { d as
|
|
10
|
-
import { l as
|
|
11
|
-
var
|
|
4
|
+
var H = (s, n, e) => n.has(s) || N("Cannot " + e);
|
|
5
|
+
var t = (s, n, e) => (H(s, n, "read from private field"), e ? e.call(s) : n.get(s)), i = (s, n, e) => n.has(s) ? N("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(s) : n.set(s, e), h = (s, n, e, l) => (H(s, n, "write to private field"), l ? l.call(s, e) : n.set(s, e), e), d = (s, n, e) => (H(s, n, "access private method"), e);
|
|
6
|
+
import { a as M, i as P } from "../index-euf5anj6.js";
|
|
7
|
+
import { b as q } from "../dom-CVWzyXPH.js";
|
|
8
|
+
import { CSSProperty as F } from "../css-property/index.js";
|
|
9
|
+
import { d as j } from "../events-CsVF98U6.js";
|
|
10
|
+
import { l as z } from "../number-DwCxt_Ck.js";
|
|
11
|
+
var f, E, v, a, b, r, D, w, p, S, y, T;
|
|
12
12
|
class A extends HTMLElement {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
i(this, r);
|
|
16
|
+
i(this, f, new F(this, "--autoplay", !1));
|
|
17
|
+
i(this, E);
|
|
18
|
+
i(this, v, !1);
|
|
19
|
+
i(this, a, []);
|
|
20
|
+
i(this, b, 0);
|
|
21
|
+
i(this, p, (e) => {
|
|
22
|
+
h(this, v, e.isIntersecting), t(this, v) ? d(this, r, w).call(this) : clearInterval(t(this, E));
|
|
23
23
|
});
|
|
24
|
-
|
|
25
|
-
clearInterval(t(this,
|
|
26
|
-
t(this,
|
|
27
|
-
parseFloat(t(this,
|
|
24
|
+
i(this, S, () => {
|
|
25
|
+
clearInterval(t(this, E)), t(this, v) && h(this, E, setInterval(
|
|
26
|
+
t(this, T),
|
|
27
|
+
parseFloat(t(this, f).current || "0") * 1e3
|
|
28
28
|
));
|
|
29
29
|
});
|
|
30
|
-
|
|
31
|
-
d(this, r,
|
|
30
|
+
i(this, T, () => {
|
|
31
|
+
d(this, r, y).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, D).call(this);
|
|
42
42
|
}
|
|
43
43
|
set(e) {
|
|
44
|
-
d(this, r,
|
|
44
|
+
d(this, r, y).call(this, e), d(this, r, w).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 ? (
|
|
55
|
-
}), t(this,
|
|
53
|
+
]), (e = t(this, a)[0]) == null || e.classList.add("current"), d(this, r, D).call(this), t(this, f).subscribe((l) => {
|
|
54
|
+
l.current ? (M.subscribe(this, t(this, p)), d(this, r, w).call(this)) : (h(this, v, !0), M.unsubscribe(t(this, p)), clearInterval(t(this, E)), d(this, r, y).call(this, 0));
|
|
55
|
+
}), t(this, f).observe();
|
|
56
56
|
}
|
|
57
57
|
disconnectedCallback() {
|
|
58
|
-
t(this,
|
|
58
|
+
t(this, f).unobserve(), M.unsubscribe(t(this, p)), clearInterval(t(this, E));
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
t(this,
|
|
63
|
-
},
|
|
64
|
-
t(this,
|
|
65
|
-
}, p = new WeakMap(),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}),
|
|
61
|
+
f = new WeakMap(), E = new WeakMap(), v = new WeakMap(), a = new WeakMap(), b = new WeakMap(), r = new WeakSet(), D = function() {
|
|
62
|
+
t(this, a).length > 1 ? this.classList.add("has-length") : this.classList.remove("has-length");
|
|
63
|
+
}, w = function() {
|
|
64
|
+
t(this, f).current !== !1 && t(this, S).call(this);
|
|
65
|
+
}, p = new WeakMap(), S = new WeakMap(), y = function(e) {
|
|
66
|
+
h(this, b, z(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
|
+
}), j(this, "billboardChange", {
|
|
69
69
|
detail: {
|
|
70
70
|
counter: t(this, b)
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
-
},
|
|
73
|
+
}, T = new WeakMap();
|
|
74
74
|
customElements.get("e-billboard") || customElements.define("e-billboard", A);
|
|
75
|
-
var
|
|
76
|
-
class
|
|
75
|
+
var c, u, I, g;
|
|
76
|
+
class G extends HTMLElement {
|
|
77
77
|
constructor() {
|
|
78
78
|
super(...arguments);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const l = e.currentTarget,
|
|
83
|
-
|
|
79
|
+
i(this, c, null);
|
|
80
|
+
i(this, u, []);
|
|
81
|
+
i(this, I, (e) => {
|
|
82
|
+
const l = e.currentTarget, o = t(this, u).findIndex((B) => B === l);
|
|
83
|
+
o >= 0 && t(this, c).set(o);
|
|
84
84
|
});
|
|
85
|
-
|
|
85
|
+
i(this, g, () => {
|
|
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, A)), 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 B = document.createElement("button");
|
|
98
|
+
t(this, u).push(B), this.appendChild(B);
|
|
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
|
-
t(this,
|
|
105
|
-
), t(this,
|
|
104
|
+
t(this, g)
|
|
105
|
+
), t(this, g).call(this);
|
|
106
106
|
}
|
|
107
107
|
});
|
|
108
108
|
}
|
|
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
|
-
t(this,
|
|
116
|
-
), this.innerHTML = "",
|
|
115
|
+
t(this, g)
|
|
116
|
+
), this.innerHTML = "", h(this, u, []);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
var L,
|
|
122
|
-
class
|
|
119
|
+
c = new WeakMap(), u = new WeakMap(), I = new WeakMap(), g = new WeakMap();
|
|
120
|
+
P && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", G);
|
|
121
|
+
var L, m, C;
|
|
122
|
+
class J extends HTMLElement {
|
|
123
123
|
constructor() {
|
|
124
124
|
super();
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
i(this, L, new F(this, "--index", 0));
|
|
126
|
+
i(this, m, null);
|
|
127
|
+
i(this, C, () => {
|
|
128
|
+
var e;
|
|
129
|
+
t(this, L).current === ((e = t(this, m)) == null ? void 0 : e.counter) ? this.classList.add("current") : this.classList.remove("current");
|
|
130
|
+
});
|
|
131
|
+
this.addEventListener("click", () => {
|
|
132
|
+
t(this, m) && t(this, m).set(t(this, L).current);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
connectedCallback() {
|
|
136
|
+
var e;
|
|
137
|
+
this.tabIndex = 0, h(this, m, q(this, A)), (e = t(this, m)) == null || e.addEventListener(
|
|
138
|
+
"billboardChange",
|
|
139
|
+
t(this, C)
|
|
140
|
+
), customElements.whenDefined("e-billboard").then(() => {
|
|
141
|
+
this.isConnected && t(this, C).call(this);
|
|
142
|
+
}), t(this, L).observe();
|
|
143
|
+
}
|
|
144
|
+
disconnectedCallback() {
|
|
145
|
+
var e;
|
|
146
|
+
this.removeAttribute("tabindex"), t(this, L).unobserve(), (e = t(this, m)) == null || e.removeEventListener(
|
|
147
|
+
"billboardChange",
|
|
148
|
+
t(this, C)
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
L = new WeakMap(), m = new WeakMap(), C = new WeakMap();
|
|
153
|
+
P && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", J);
|
|
154
|
+
var k, x;
|
|
155
|
+
class K extends HTMLElement {
|
|
156
|
+
constructor() {
|
|
157
|
+
super();
|
|
158
|
+
i(this, k, new F(this, "--step", 1));
|
|
159
|
+
i(this, x, null);
|
|
127
160
|
this.addEventListener("click", () => {
|
|
128
|
-
t(this,
|
|
161
|
+
t(this, x) && t(this, x).shift(t(this, k).current);
|
|
129
162
|
});
|
|
130
163
|
}
|
|
131
164
|
connectedCallback() {
|
|
132
|
-
this.tabIndex = 0,
|
|
165
|
+
this.tabIndex = 0, h(this, x, q(this, A)), t(this, k).observe();
|
|
133
166
|
}
|
|
134
167
|
disconnectedCallback() {
|
|
135
|
-
this.removeAttribute("tabindex"), t(this,
|
|
168
|
+
this.removeAttribute("tabindex"), t(this, k).unobserve();
|
|
136
169
|
}
|
|
137
170
|
}
|
|
138
|
-
|
|
139
|
-
|
|
171
|
+
k = new WeakMap(), x = new WeakMap();
|
|
172
|
+
P && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", K);
|
|
140
173
|
export {
|
|
141
|
-
|
|
174
|
+
G as BillboardBulletsElement,
|
|
142
175
|
A as BillboardElement,
|
|
143
|
-
|
|
176
|
+
J as BillboardSetButtonElement,
|
|
177
|
+
K as BillboardStepButtonElement
|
|
144
178
|
};
|