aptechka 0.61.5 → 0.61.7
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 +80 -79
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +110 -109
- package/package.json +1 -1
package/lib/billboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Q=
|
|
1
|
+
"use strict";var Q=i=>{throw TypeError(i)};var G=(i,r,e)=>r.has(i)||Q("Cannot "+e);var t=(i,r,e)=>(G(i,r,"read from private field"),e?e.call(i):r.get(i)),s=(i,r,e)=>r.has(i)?Q("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,e),d=(i,r,e,n)=>(G(i,r,"write to private field"),n?n.call(i,e):r.set(i,e),e),b=(i,r,e)=>(G(i,r,"access private method"),e);var J=(i,r,e)=>new Promise((n,l)=>{var a=x=>{try{N(e.next(x))}catch(O){l(O)}},S=x=>{try{N(e.throw(x))}catch(O){l(O)}},N=x=>x.done?n(x.value):Promise.resolve(x.value).then(a,S);N((e=e.apply(i,r)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("../index-Cqw2NKev.cjs"),K=require("../dom-JBOkFLTh.cjs"),q=require("../css-property/index.cjs"),W=require("../events-KVanG9sR.cjs"),X=require("../gestures-C7gbKx11.cjs"),Y=require("../math-GDWEqu7y.cjs"),Z=require("../number-DyefJ5a1.cjs");var k,f,E,L,y,u,h,o,D,M,j,_,$,z,F;class H extends HTMLElement{constructor(){super(...arguments);s(this,o);s(this,k,new q.CSSProperty(this,"--loop",!0));s(this,f,new q.CSSProperty(this,"--autoplay",!1));s(this,E,new q.CSSProperty(this,"--swipe","x"));s(this,L);s(this,y,!1);s(this,u,[]);s(this,h,0);s(this,M,e=>{d(this,y,e.isIntersecting),t(this,y)?b(this,o,D).call(this):clearInterval(t(this,L))});s(this,j,()=>{clearInterval(t(this,L)),t(this,y)&&d(this,L,setInterval(t(this,z),parseFloat(t(this,f).current||"0")*1e3))});s(this,z,()=>{b(this,o,$).call(this,t(this,h)+1)});s(this,F,e=>{if(!t(this,E).current)return;let n=0;X.setupDrag(l=>{const a=e.x-l.x,S=e.y-l.y;t(this,E).current==="x"?Math.abs(a)>Math.abs(S)&&Math.abs(a)>10&&(n=Math.sign(a)):t(this,E).current==="y"&&Math.abs(S)>Math.abs(a)&&Math.abs(S)>10&&(n=Math.sign(S))},()=>{n&&this.shift(n)})})}get counter(){return t(this,h)}get loop(){return t(this,k)}get autoplay(){return t(this,f)}get swipe(){return t(this,E)}get itemElements(){return t(this,u)}addItem(e){t(this,u).push(e),b(this,o,_).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(b(this,o,$).call(this,e),b(this,o,D).call(this))}shift(e){this.set(t(this,h)+e)}connectedCallback(){var e;d(this,u,[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)]),(e=t(this,u)[0])==null||e.classList.add("current"),b(this,o,_).call(this),t(this,f).subscribe(n=>{n.current?(B.intersector.subscribe(this,t(this,M)),b(this,o,D).call(this)):(d(this,y,!0),B.intersector.unsubscribe(t(this,M)),clearInterval(t(this,L)),b(this,o,$).call(this,0))}),t(this,f).observe(),t(this,E).observe(),t(this,k).observe(),this.addEventListener("pointerdown",t(this,F))}disconnectedCallback(){t(this,f).unobserve(),t(this,E).unobserve(),t(this,k).unobserve(),B.intersector.unsubscribe(t(this,M)),clearInterval(t(this,L))}}k=new WeakMap,f=new WeakMap,E=new WeakMap,L=new WeakMap,y=new WeakMap,u=new WeakMap,h=new WeakMap,o=new WeakSet,D=function(){t(this,f).current!==!1&&t(this,j).call(this)},M=new WeakMap,j=new WeakMap,_=function(){this.classList.toggle("has-length",t(this,u).length>1),this.classList.toggle("start",t(this,h)===0),this.classList.toggle("end",t(this,h)===t(this,u).length-1)},$=function(e){const n=t(this,h);t(this,k).current?d(this,h,Z.loopNumber(e,t(this,u).length)):d(this,h,Y.clamp(e,0,t(this,u).length-1)),this.classList.remove("forward","backward"),t(this,h)-n>=0?this.classList.add("forward"):t(this,h)-n<0&&this.classList.add("backward"),t(this,u).forEach((l,a)=>{l.classList.remove("current","previous","next"),a===t(this,h)?l.classList.add("current"):a<t(this,h)?l.classList.add("previous"):a>t(this,h)&&l.classList.add("next")}),b(this,o,_).call(this),W.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,h)}}),setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0)},z=new WeakMap,F=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",H);var m,I,p,A,P;class R extends HTMLElement{constructor(){super(...arguments);s(this,m,null);s(this,I,null);s(this,p,[]);s(this,A,e=>{const n=e.currentTarget,l=t(this,p).findIndex(a=>a===n);l>=0&&t(this,m).set(l)});s(this,P,()=>{t(this,p).forEach((e,n)=>{n===t(this,m).counter?e.classList.add("current"):e.classList.remove("current")})})}connectedCallback(){return J(this,null,function*(){var e;if(d(this,m,K.findParentElement(this,H)),t(this,m)&&(yield customElements.whenDefined("e-billboard"),this.isConnected)){this.innerHTML="";const n=t(this,m).itemElements.length;d(this,I,document.createElement("div"));for(let l=0;l<n;l++){const a=document.createElement("button");t(this,p).push(a),t(this,I).appendChild(a)}this.appendChild(t(this,I)),t(this,p).forEach(l=>{l.addEventListener("click",t(this,A))}),(e=t(this,m))==null||e.addEventListener("billboardChange",t(this,P)),t(this,P).call(this)}})}disconnectedCallback(){var e;t(this,p).forEach(n=>{n.removeEventListener("click",t(this,A))}),(e=t(this,m))==null||e.removeEventListener("billboardChange",t(this,P)),this.innerHTML="",d(this,p,[])}}m=new WeakMap,I=new WeakMap,p=new WeakMap,A=new WeakMap,P=new WeakMap;B.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",R);var v,g,C;class U extends HTMLElement{constructor(){super();s(this,v,new q.CSSProperty(this,"--index",0));s(this,g,null);s(this,C,()=>{var e;t(this,v).current===((e=t(this,g))==null?void 0:e.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",e=>{t(this,g)&&(!this.handleClick||this.handleClick(e))&&t(this,g).set(t(this,v).current)})}connectedCallback(){var e;this.tabIndex=0,d(this,g,K.findParentElement(this,H)),(e=t(this,g))==null||e.addEventListener("billboardChange",t(this,C)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&t(this,C).call(this)}),t(this,v).subscribe(t(this,C)),t(this,v).observe()}disconnectedCallback(){var e;this.removeAttribute("tabindex"),t(this,v).unsubscribe(t(this,C)),t(this,v).unobserve(),(e=t(this,g))==null||e.removeEventListener("billboardChange",t(this,C))}}v=new WeakMap,g=new WeakMap,C=new WeakMap;B.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",U);var w,c,T;class V extends HTMLElement{constructor(){super();s(this,w,new q.CSSProperty(this,"--step",1));s(this,c,null);s(this,T,()=>{t(this,c)&&(!t(this,c).loop.current&&(t(this,c).counter===0&&t(this,w).current<=0||t(this,c).counter===t(this,c).itemElements.length-1&&t(this,w).current>=0)?this.setAttribute("disabled",""):this.removeAttribute("disabled"))});this.addEventListener("click",e=>{t(this,c)&&(!this.handleClick||this.handleClick(e))&&t(this,c).shift(t(this,w).current)})}connectedCallback(){return J(this,null,function*(){var e;yield customElements.whenDefined("e-billboard"),t(this,w).observe(),this.tabIndex=0,d(this,c,K.findParentElement(this,H)),(e=t(this,c))==null||e.addEventListener("billboardChange",t(this,T)),t(this,T).call(this)})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),t(this,w).unobserve(),(e=t(this,c))==null||e.removeEventListener("billboardChange",t(this,T))}}w=new WeakMap,c=new WeakMap,T=new WeakMap;B.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",V);exports.BillboardBulletsElement=R;exports.BillboardElement=H;exports.BillboardSetButtonElement=U;exports.BillboardStepButtonElement=V;
|
package/lib/billboard/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var U = (
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var U = (i) => {
|
|
2
|
+
throw TypeError(i);
|
|
3
3
|
};
|
|
4
|
-
var J = (
|
|
5
|
-
var t = (
|
|
6
|
-
var K = (
|
|
7
|
-
var
|
|
4
|
+
var J = (i, r, e) => r.has(i) || U("Cannot " + e);
|
|
5
|
+
var t = (i, r, e) => (J(i, r, "read from private field"), e ? e.call(i) : r.get(i)), s = (i, r, e) => r.has(i) ? U("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(i) : r.set(i, e), d = (i, r, e, n) => (J(i, r, "write to private field"), n ? n.call(i, e) : r.set(i, e), e), u = (i, r, e) => (J(i, r, "access private method"), e);
|
|
6
|
+
var K = (i, r, e) => new Promise((n, h) => {
|
|
7
|
+
var a = (x) => {
|
|
8
8
|
try {
|
|
9
|
-
j(e.next(
|
|
9
|
+
j(e.next(x));
|
|
10
10
|
} catch (G) {
|
|
11
|
-
|
|
11
|
+
h(G);
|
|
12
12
|
}
|
|
13
|
-
}, y = (
|
|
13
|
+
}, y = (x) => {
|
|
14
14
|
try {
|
|
15
|
-
j(e.throw(
|
|
15
|
+
j(e.throw(x));
|
|
16
16
|
} catch (G) {
|
|
17
|
-
|
|
17
|
+
h(G);
|
|
18
18
|
}
|
|
19
|
-
}, j = (
|
|
20
|
-
j((e = e.apply(
|
|
19
|
+
}, j = (x) => x.done ? n(x.value) : Promise.resolve(x.value).then(a, y);
|
|
20
|
+
j((e = e.apply(i, r)).next());
|
|
21
21
|
});
|
|
22
22
|
import { a as O, i as Q } from "../index-euf5anj6.js";
|
|
23
23
|
import { b as R } from "../dom-CVWzyXPH.js";
|
|
@@ -26,41 +26,41 @@ import { d as V } from "../events-CsVF98U6.js";
|
|
|
26
26
|
import { s as W } from "../gestures-CcXV6fCp.js";
|
|
27
27
|
import { c as X } from "../math-BOBiC4TN.js";
|
|
28
28
|
import { l as Y } from "../number-CbdpfO3u.js";
|
|
29
|
-
var k, f, p, L, M,
|
|
29
|
+
var k, f, p, L, M, b, l, o, D, I, q, P, $, z, F;
|
|
30
30
|
class N extends HTMLElement {
|
|
31
31
|
constructor() {
|
|
32
32
|
super(...arguments);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
s(this, o);
|
|
34
|
+
s(this, k, new A(this, "--loop", !0));
|
|
35
|
+
s(this, f, new A(this, "--autoplay", !1));
|
|
36
|
+
s(this, p, new A(this, "--swipe", "x"));
|
|
37
|
+
s(this, L);
|
|
38
|
+
s(this, M, !1);
|
|
39
|
+
s(this, b, []);
|
|
40
|
+
s(this, l, 0);
|
|
41
|
+
s(this, I, (e) => {
|
|
42
|
+
d(this, M, e.isIntersecting), t(this, M) ? u(this, o, D).call(this) : clearInterval(t(this, L));
|
|
43
43
|
});
|
|
44
|
-
|
|
45
|
-
clearInterval(t(this, L)), t(this, M) &&
|
|
44
|
+
s(this, q, () => {
|
|
45
|
+
clearInterval(t(this, L)), t(this, M) && d(this, L, setInterval(
|
|
46
46
|
t(this, z),
|
|
47
47
|
parseFloat(t(this, f).current || "0") * 1e3
|
|
48
48
|
));
|
|
49
49
|
});
|
|
50
|
-
|
|
51
|
-
u(this,
|
|
50
|
+
s(this, z, () => {
|
|
51
|
+
u(this, o, $).call(this, t(this, l) + 1);
|
|
52
52
|
});
|
|
53
|
-
|
|
53
|
+
s(this, F, (e) => {
|
|
54
54
|
if (!t(this, p).current)
|
|
55
55
|
return;
|
|
56
|
-
let
|
|
56
|
+
let n = 0;
|
|
57
57
|
W(
|
|
58
|
-
(
|
|
59
|
-
const
|
|
60
|
-
t(this, p).current === "x" ? Math.abs(
|
|
58
|
+
(h) => {
|
|
59
|
+
const a = e.x - h.x, y = e.y - h.y;
|
|
60
|
+
t(this, p).current === "x" ? Math.abs(a) > Math.abs(y) && Math.abs(a) > 10 && (n = Math.sign(a)) : t(this, p).current === "y" && Math.abs(y) > Math.abs(a) && Math.abs(y) > 10 && (n = Math.sign(y));
|
|
61
61
|
},
|
|
62
62
|
() => {
|
|
63
|
-
|
|
63
|
+
n && this.shift(n);
|
|
64
64
|
}
|
|
65
65
|
);
|
|
66
66
|
});
|
|
@@ -78,42 +78,43 @@ class N extends HTMLElement {
|
|
|
78
78
|
return t(this, p);
|
|
79
79
|
}
|
|
80
80
|
get itemElements() {
|
|
81
|
-
return t(this,
|
|
81
|
+
return t(this, b);
|
|
82
82
|
}
|
|
83
83
|
addItem(e) {
|
|
84
|
-
t(this,
|
|
84
|
+
t(this, b).push(e), u(this, o, P).call(this);
|
|
85
85
|
}
|
|
86
86
|
set(e) {
|
|
87
|
-
(!this.handleSet || this.handleSet(e)) && (u(this,
|
|
87
|
+
(!this.handleSet || this.handleSet(e)) && (u(this, o, $).call(this, e), u(this, o, D).call(this));
|
|
88
88
|
}
|
|
89
89
|
shift(e) {
|
|
90
90
|
this.set(t(this, l) + e);
|
|
91
91
|
}
|
|
92
92
|
connectedCallback() {
|
|
93
93
|
var e;
|
|
94
|
-
|
|
94
|
+
d(this, b, [
|
|
95
95
|
...this.querySelectorAll(
|
|
96
96
|
`[data-billboard-item${this.id ? `="${this.id}"` : ""}]`
|
|
97
97
|
)
|
|
98
|
-
]), (e = t(this,
|
|
99
|
-
|
|
98
|
+
]), (e = t(this, b)[0]) == null || e.classList.add("current"), u(this, o, P).call(this), t(this, f).subscribe((n) => {
|
|
99
|
+
n.current ? (O.subscribe(this, t(this, I)), u(this, o, D).call(this)) : (d(this, M, !0), O.unsubscribe(t(this, I)), clearInterval(t(this, L)), u(this, o, $).call(this, 0));
|
|
100
100
|
}), t(this, f).observe(), t(this, p).observe(), t(this, k).observe(), this.addEventListener("pointerdown", t(this, F));
|
|
101
101
|
}
|
|
102
102
|
disconnectedCallback() {
|
|
103
103
|
t(this, f).unobserve(), t(this, p).unobserve(), t(this, k).unobserve(), O.unsubscribe(t(this, I)), clearInterval(t(this, L));
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
k = new WeakMap(), f = new WeakMap(), p = new WeakMap(), L = new WeakMap(), M = new WeakMap(),
|
|
106
|
+
k = new WeakMap(), f = new WeakMap(), p = new WeakMap(), L = new WeakMap(), M = new WeakMap(), b = new WeakMap(), l = new WeakMap(), o = new WeakSet(), D = function() {
|
|
107
107
|
t(this, f).current !== !1 && t(this, q).call(this);
|
|
108
108
|
}, I = new WeakMap(), q = new WeakMap(), P = function() {
|
|
109
|
-
this.classList.toggle("has-length", t(this,
|
|
109
|
+
this.classList.toggle("has-length", t(this, b).length > 1), this.classList.toggle("start", t(this, l) === 0), this.classList.toggle(
|
|
110
110
|
"end",
|
|
111
|
-
t(this, l) === t(this,
|
|
111
|
+
t(this, l) === t(this, b).length - 1
|
|
112
112
|
);
|
|
113
113
|
}, $ = function(e) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
const n = t(this, l);
|
|
115
|
+
t(this, k).current ? d(this, l, Y(e, t(this, b).length)) : d(this, l, X(e, 0, t(this, b).length - 1)), this.classList.remove("forward", "backward"), t(this, l) - n >= 0 ? this.classList.add("forward") : t(this, l) - n < 0 && this.classList.add("backward"), t(this, b).forEach((h, a) => {
|
|
116
|
+
h.classList.remove("current", "previous", "next"), a === t(this, l) ? h.classList.add("current") : a < t(this, l) ? h.classList.add("previous") : a > t(this, l) && h.classList.add("next");
|
|
117
|
+
}), u(this, o, P).call(this), V(this, "billboardChange", {
|
|
117
118
|
detail: {
|
|
118
119
|
counter: t(this, l)
|
|
119
120
|
}
|
|
@@ -126,32 +127,32 @@ var m, B, E, H, S;
|
|
|
126
127
|
class Z extends HTMLElement {
|
|
127
128
|
constructor() {
|
|
128
129
|
super(...arguments);
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
130
|
+
s(this, m, null);
|
|
131
|
+
s(this, B, null);
|
|
132
|
+
s(this, E, []);
|
|
133
|
+
s(this, H, (e) => {
|
|
134
|
+
const n = e.currentTarget, h = t(this, E).findIndex((a) => a === n);
|
|
135
|
+
h >= 0 && t(this, m).set(h);
|
|
135
136
|
});
|
|
136
|
-
|
|
137
|
-
t(this, E).forEach((e,
|
|
138
|
-
|
|
137
|
+
s(this, S, () => {
|
|
138
|
+
t(this, E).forEach((e, n) => {
|
|
139
|
+
n === t(this, m).counter ? e.classList.add("current") : e.classList.remove("current");
|
|
139
140
|
});
|
|
140
141
|
});
|
|
141
142
|
}
|
|
142
143
|
connectedCallback() {
|
|
143
144
|
return K(this, null, function* () {
|
|
144
145
|
var e;
|
|
145
|
-
if (
|
|
146
|
+
if (d(this, m, R(this, N)), t(this, m) && (yield customElements.whenDefined("e-billboard"), this.isConnected)) {
|
|
146
147
|
this.innerHTML = "";
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
for (let
|
|
150
|
-
const
|
|
151
|
-
t(this, E).push(
|
|
148
|
+
const n = t(this, m).itemElements.length;
|
|
149
|
+
d(this, B, document.createElement("div"));
|
|
150
|
+
for (let h = 0; h < n; h++) {
|
|
151
|
+
const a = document.createElement("button");
|
|
152
|
+
t(this, E).push(a), t(this, B).appendChild(a);
|
|
152
153
|
}
|
|
153
|
-
this.appendChild(t(this, B)), t(this, E).forEach((
|
|
154
|
-
|
|
154
|
+
this.appendChild(t(this, B)), t(this, E).forEach((h) => {
|
|
155
|
+
h.addEventListener("click", t(this, H));
|
|
155
156
|
}), (e = t(this, m)) == null || e.addEventListener(
|
|
156
157
|
"billboardChange",
|
|
157
158
|
t(this, S)
|
|
@@ -161,12 +162,12 @@ class Z extends HTMLElement {
|
|
|
161
162
|
}
|
|
162
163
|
disconnectedCallback() {
|
|
163
164
|
var e;
|
|
164
|
-
t(this, E).forEach((
|
|
165
|
-
|
|
165
|
+
t(this, E).forEach((n) => {
|
|
166
|
+
n.removeEventListener("click", t(this, H));
|
|
166
167
|
}), (e = t(this, m)) == null || e.removeEventListener(
|
|
167
168
|
"billboardChange",
|
|
168
169
|
t(this, S)
|
|
169
|
-
), this.innerHTML = "",
|
|
170
|
+
), this.innerHTML = "", d(this, E, []);
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
173
|
m = new WeakMap(), B = new WeakMap(), E = new WeakMap(), H = new WeakMap(), S = new WeakMap();
|
|
@@ -175,9 +176,9 @@ var v, g, C;
|
|
|
175
176
|
class _ extends HTMLElement {
|
|
176
177
|
constructor() {
|
|
177
178
|
super();
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
179
|
+
s(this, v, new A(this, "--index", 0));
|
|
180
|
+
s(this, g, null);
|
|
181
|
+
s(this, C, () => {
|
|
181
182
|
var e;
|
|
182
183
|
t(this, v).current === ((e = t(this, g)) == null ? void 0 : e.counter) ? this.classList.add("current") : this.classList.remove("current");
|
|
183
184
|
});
|
|
@@ -187,7 +188,7 @@ class _ extends HTMLElement {
|
|
|
187
188
|
}
|
|
188
189
|
connectedCallback() {
|
|
189
190
|
var e;
|
|
190
|
-
this.tabIndex = 0,
|
|
191
|
+
this.tabIndex = 0, d(this, g, R(this, N)), (e = t(this, g)) == null || e.addEventListener(
|
|
191
192
|
"billboardChange",
|
|
192
193
|
t(this, C)
|
|
193
194
|
), customElements.whenDefined("e-billboard").then(() => {
|
|
@@ -204,23 +205,23 @@ class _ extends HTMLElement {
|
|
|
204
205
|
}
|
|
205
206
|
v = new WeakMap(), g = new WeakMap(), C = new WeakMap();
|
|
206
207
|
Q && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", _);
|
|
207
|
-
var
|
|
208
|
+
var w, c, T;
|
|
208
209
|
class tt extends HTMLElement {
|
|
209
210
|
constructor() {
|
|
210
211
|
super();
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
t(this,
|
|
212
|
+
s(this, w, new A(this, "--step", 1));
|
|
213
|
+
s(this, c, null);
|
|
214
|
+
s(this, T, () => {
|
|
215
|
+
t(this, c) && (!t(this, c).loop.current && (t(this, c).counter === 0 && t(this, w).current <= 0 || t(this, c).counter === t(this, c).itemElements.length - 1 && t(this, w).current >= 0) ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"));
|
|
215
216
|
});
|
|
216
217
|
this.addEventListener("click", (e) => {
|
|
217
|
-
t(this,
|
|
218
|
+
t(this, c) && (!this.handleClick || this.handleClick(e)) && t(this, c).shift(t(this, w).current);
|
|
218
219
|
});
|
|
219
220
|
}
|
|
220
221
|
connectedCallback() {
|
|
221
222
|
return K(this, null, function* () {
|
|
222
223
|
var e;
|
|
223
|
-
yield customElements.whenDefined("e-billboard"), t(this,
|
|
224
|
+
yield customElements.whenDefined("e-billboard"), t(this, w).observe(), this.tabIndex = 0, d(this, c, R(this, N)), (e = t(this, c)) == null || e.addEventListener(
|
|
224
225
|
"billboardChange",
|
|
225
226
|
t(this, T)
|
|
226
227
|
), t(this, T).call(this);
|
|
@@ -228,13 +229,13 @@ class tt extends HTMLElement {
|
|
|
228
229
|
}
|
|
229
230
|
disconnectedCallback() {
|
|
230
231
|
var e;
|
|
231
|
-
this.removeAttribute("tabindex"), t(this,
|
|
232
|
+
this.removeAttribute("tabindex"), t(this, w).unobserve(), (e = t(this, c)) == null || e.removeEventListener(
|
|
232
233
|
"billboardChange",
|
|
233
234
|
t(this, T)
|
|
234
235
|
);
|
|
235
236
|
}
|
|
236
237
|
}
|
|
237
|
-
|
|
238
|
+
w = new WeakMap(), c = new WeakMap(), T = new WeakMap();
|
|
238
239
|
Q && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", tt);
|
|
239
240
|
export {
|
|
240
241
|
Z as BillboardBulletsElement,
|
package/lib/controls/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var p=r=>{throw TypeError(r)};var
|
|
1
|
+
"use strict";var p=r=>{throw TypeError(r)};var G=(r,a,e)=>a.has(r)||p("Cannot "+e);var t=(r,a,e)=>(G(r,a,"read from private field"),e?e.call(r):a.get(r)),s=(r,a,e)=>a.has(r)?p("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(r):a.set(r,e),i=(r,a,e,h)=>(G(r,a,"write to private field"),h?h.call(r,e):a.set(r,e),e),T=(r,a,e)=>(G(r,a,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ee=require("../notifier/index.cjs"),w=require("../index-Cqw2NKev.cjs"),_=require("../dom-JBOkFLTh.cjs"),B=require("../ticker/index.cjs");require("../Store-GokLe_g-.cjs");const te=require("../easings-GegIwET5.cjs"),ie=require("../Tweened-BsL9FamJ.cjs"),se=require("../gestures-C7gbKx11.cjs"),he=require("../number-DyefJ5a1.cjs"),re=require("../order/index.cjs");var V;class F{constructor(){s(this,V,new ee.Notifier)}get changeEvent(){return t(this,V)}}V=new WeakMap;var y,c,u,N;class ne extends F{constructor(e){super();s(this,y,null);s(this,c,null);s(this,u,"offsetHeight");s(this,N,e=>{const h=e.shiftKey?-1:1;let n;e.code==="Space"?n=h*t(this,c)[t(this,u)]*.4:e.code==="ArrowLeft"?n=-1*t(this,c)[t(this,u)]*.2:e.code==="ArrowRight"?n=1*t(this,c)[t(this,u)]*.2:e.code==="ArrowUp"?n=-1*t(this,c)[t(this,u)]*.2:e.code==="ArrowDown"?n=1*t(this,c)[t(this,u)]*.2:e.code==="PageUp"?n=-1*t(this,c)[t(this,u)]:e.code==="PageDown"?n=1*t(this,c)[t(this,u)]:e.code==="Home"?n=0:e.code==="End"&&(n=t(this,u)==="offsetWidth"?t(this,c).scrollWidth:t(this,c).scrollHeight),n&&(e.stopPropagation(),this.changeEvent.notify("keyboard",n,e))});w.isBrowser&&(i(this,y,e!=null&&e.element&&_.getElement(e.element)||window),i(this,c,t(this,y)instanceof HTMLElement?t(this,y):document.documentElement),this.dimension=e==null?void 0:e.dimension)}set dimension(e){i(this,u,e==="width"?"offsetWidth":"offsetHeight")}connect(){w.isBrowser&&t(this,y).addEventListener("keydown",t(this,N))}disconnect(){w.isBrowser&&t(this,y).removeEventListener("keydown",t(this,N))}}y=new WeakMap,c=new WeakMap,u=new WeakMap,N=new WeakMap;var x,k,O,R,d,A,m,g,Q,J,D,X,I;class ae extends F{constructor(e){super();s(this,g);s(this,x);s(this,k);s(this,O);s(this,R);s(this,d);s(this,A);s(this,m);s(this,D);s(this,X);s(this,I);this.direction=1,i(this,d,new ie.Tweened(0,{easing:te.easeInQuad})),i(this,m,!1),i(this,D,h=>{t(this,d).current!==1&&this.changeEvent.notify("autoplay",h.timeBetweenFrames*t(this,x)*this.direction*(1-t(this,d).current),h)}),i(this,X,()=>{t(this,d).current!==1&&this.changeEvent.notify("autoplay",Math.sign(t(this,x))*this.direction*(1-t(this,d).current),null)}),i(this,I,()=>{t(this,k)&&(document.hidden?t(this,d).set(1,{equalize:!0}):t(this,d).set(0,{equalize:!0}))}),i(this,x,(e==null?void 0:e.speed)||1),i(this,k,(e==null?void 0:e.interval)||!1),i(this,O,e)}set interval(e){i(this,k,e),t(this,m)&&T(this,g,Q).call(this)}set speed(e){i(this,x,e),t(this,m)&&T(this,g,Q).call(this)}connect(){t(this,m)||(i(this,m,!0),T(this,g,Q).call(this))}disconnect(){t(this,m)&&(i(this,m,!1),T(this,g,J).call(this))}pauseAndContinue(e,h){t(this,m)&&e&&(clearTimeout(t(this,A)),t(this,d).set(1,{duration:Math.min(e,1e3),equalize:h}),i(this,A,setTimeout(()=>{t(this,d).set(0,{duration:Math.min(e,5e3),equalize:h})},e)))}}x=new WeakMap,k=new WeakMap,O=new WeakMap,R=new WeakMap,d=new WeakMap,A=new WeakMap,m=new WeakMap,g=new WeakSet,Q=function(){T(this,g,J).call(this),t(this,k)?i(this,R,setInterval(t(this,X),Math.abs(t(this,x)))):B.ticker.subscribe(t(this,D),t(this,O)),document.addEventListener("visibilitychange",t(this,I))},J=function(){clearInterval(t(this,R)),B.ticker.unsubscribe(t(this,D)),clearTimeout(t(this,A)),t(this,d).close(),document.removeEventListener("visibilitychange",t(this,I))},D=new WeakMap,X=new WeakMap,I=new WeakMap;var H,M,P,Y;class le extends F{constructor(e){super();s(this,H,null);s(this,M);s(this,P);s(this,Y,e=>{let h=0;const n=Math.abs(e.deltaY),b=Math.abs(e.deltaX);if(!(this.axis==="x"&&n>b||this.axis==="y"&&b>n)&&(e.preventDefault(),!(this.debounce&&this.axis==="x"&&b<5||this.axis==="y"&&n<5)))if(h=(this.axis==="max"?b>n?e.deltaX:e.deltaY:this.axis==="x"?e.deltaX:e.deltaY)*this.speed,e.stopPropagation(),this.debounce){const K=Date.now();if(K-t(this,P)>40&&(h=100*Math.sign(h)),i(this,P,K),Math.abs(h)<100||t(this,M))return;this.changeEvent.notify("wheel",h,e),i(this,M,setTimeout(()=>{i(this,M,void 0)},80))}else this.changeEvent.notify("wheel",h,e)});this.axis=(e==null?void 0:e.axis)||"y",this.speed=(e==null?void 0:e.speed)||1,this.debounce=(e==null?void 0:e.debounce)||!1,i(this,P,Date.now()),w.isBrowser&&i(this,H,e!=null&&e.element&&_.getElement(e.element)||window)}connect(){w.isBrowser&&t(this,H).addEventListener("wheel",t(this,Y),{passive:!1})}disconnect(){w.isBrowser&&(t(this,H).removeEventListener("wheel",t(this,Y)),clearTimeout(t(this,M)))}}H=new WeakMap,M=new WeakMap,P=new WeakMap,Y=new WeakMap;var q,z,o,l,C,E,S,W,L;const v=class v extends F{constructor(e){super();s(this,z);s(this,o);s(this,l);s(this,C);s(this,E);s(this,S);s(this,W);s(this,L);this.inertion=1,i(this,z,null),i(this,o,null),i(this,l,0),i(this,C,[]),i(this,E,0),i(this,S,h=>{Math.abs(t(this,E))>2&&h.preventDefault()}),i(this,W,h=>{if(i(this,E,0),i(this,l,0),h.button!==0||h.composedPath().find(f=>f instanceof HTMLElement&&f.hasAttribute("drag-dead-zone")))return;this.swipe||B.ticker.unsubscribe(t(this,L));let n=h,b=!1;document.documentElement.classList.add("grabbing");let K=0,$=0,U=0,j=0;se.setupDrag(f=>{t(v,q)&&t(v,q)!==t(this,o)||(K=n.x-f.x,$=n.y-f.y,U=f.x-h.x,j=f.y-h.y,this.axis==="x"?(i(this,E,U),i(this,l,K)):(i(this,E,j),i(this,l,$)),n=f,b=this.axis==="x"&&Math.abs(U)>Math.abs(j)||this.axis==="y"&&Math.abs(j)>Math.abs(U),b&&(document.documentElement.classList.add("dragging"),i(v,q,t(this,o)),this.changeEvent.notify("drag",t(this,l),f)))},f=>{i(v,q,null),b&&(!this.swipe&&this.inertion?(i(this,l,t(this,l)*this.inertion),B.ticker.subscribe(t(this,L),{order:re.TICK_ORDER.CONTROLS-1})):this.swipe&&this.changeEvent.notify("drag-end",t(this,l),f)),document.documentElement.classList.remove("grabbing"),document.documentElement.classList.remove("dragging")})}),i(this,L,()=>{Math.floor(Math.abs(t(this,l)))||B.ticker.unsubscribe(t(this,L)),i(this,l,t(this,l)*.95),i(this,l,he.preciseNumber(t(this,l),3)),this.changeEvent.notify("drag",t(this,l),null)}),this.axis=(e==null?void 0:e.axis)||"y",this.swipe=(e==null?void 0:e.swipe)||!1,w.isBrowser&&(i(this,o,e!=null&&e.element&&_.getElement(e.element)||document.documentElement),i(this,z,(e==null?void 0:e.rootElement)||t(this,o)))}connect(){w.isBrowser&&(i(this,C,[...t(this,z).querySelectorAll("a")]),t(this,C).forEach(e=>{e.addEventListener("click",t(this,S))}),t(this,o).addEventListener("pointerdown",t(this,W)))}disconnect(){w.isBrowser&&(t(this,C).forEach(e=>{e.removeEventListener("click",t(this,S))}),t(this,o).removeEventListener("pointerdown",t(this,W)),B.ticker.unsubscribe(t(this,L)))}};q=new WeakMap,z=new WeakMap,o=new WeakMap,l=new WeakMap,C=new WeakMap,E=new WeakMap,S=new WeakMap,W=new WeakMap,L=new WeakMap,s(v,q,null);let Z=v;exports.AutoplayControls=ae;exports.Controls=F;exports.DragControls=Z;exports.KeyboardControls=ne;exports.WheelControls=le;
|
package/lib/controls/index.js
CHANGED
|
@@ -1,223 +1,224 @@
|
|
|
1
|
-
var _ = (
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var _ = (n) => {
|
|
2
|
+
throw TypeError(n);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var t = (
|
|
4
|
+
var G = (n, r, e) => r.has(n) || _("Cannot " + e);
|
|
5
|
+
var t = (n, r, e) => (G(n, r, "read from private field"), e ? e.call(n) : r.get(n)), s = (n, r, e) => r.has(n) ? _("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(n) : r.set(n, e), i = (n, r, e, h) => (G(n, r, "write to private field"), h ? h.call(n, e) : r.set(n, e), e), A = (n, r, e) => (G(n, r, "access private method"), e);
|
|
6
6
|
import { Notifier as ee } from "../notifier/index.js";
|
|
7
7
|
import { i as b } from "../index-euf5anj6.js";
|
|
8
|
-
import { g as
|
|
9
|
-
import { ticker as
|
|
8
|
+
import { g as Z } from "../dom-CVWzyXPH.js";
|
|
9
|
+
import { ticker as D } from "../ticker/index.js";
|
|
10
10
|
import "../Store-swP_0ymB.js";
|
|
11
11
|
import { b as te } from "../easings-Bni3YAAW.js";
|
|
12
12
|
import { T as ie } from "../Tweened-C4xgzPkR.js";
|
|
13
13
|
import { s as se } from "../gestures-CcXV6fCp.js";
|
|
14
14
|
import { p as he } from "../number-CbdpfO3u.js";
|
|
15
|
-
import { TICK_ORDER as
|
|
16
|
-
var
|
|
17
|
-
class
|
|
15
|
+
import { TICK_ORDER as ne } from "../order/index.js";
|
|
16
|
+
var V;
|
|
17
|
+
class j {
|
|
18
18
|
constructor() {
|
|
19
|
-
s(this,
|
|
19
|
+
s(this, V, new ee());
|
|
20
20
|
}
|
|
21
21
|
get changeEvent() {
|
|
22
|
-
return t(this,
|
|
22
|
+
return t(this, V);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
class ge extends
|
|
25
|
+
V = new WeakMap();
|
|
26
|
+
var y, c, u, Y;
|
|
27
|
+
class ge extends j {
|
|
28
28
|
constructor(e) {
|
|
29
29
|
super();
|
|
30
|
-
s(this,
|
|
31
|
-
s(this,
|
|
30
|
+
s(this, y, null);
|
|
31
|
+
s(this, c, null);
|
|
32
32
|
s(this, u, "offsetHeight");
|
|
33
|
-
s(this,
|
|
33
|
+
s(this, Y, (e) => {
|
|
34
34
|
const h = e.shiftKey ? -1 : 1;
|
|
35
|
-
let
|
|
36
|
-
e.code === "Space" ?
|
|
35
|
+
let a;
|
|
36
|
+
e.code === "Space" ? a = h * t(this, c)[t(this, u)] * 0.4 : e.code === "ArrowLeft" ? a = -1 * t(this, c)[t(this, u)] * 0.2 : e.code === "ArrowRight" ? a = 1 * t(this, c)[t(this, u)] * 0.2 : e.code === "ArrowUp" ? a = -1 * t(this, c)[t(this, u)] * 0.2 : e.code === "ArrowDown" ? a = 1 * t(this, c)[t(this, u)] * 0.2 : e.code === "PageUp" ? a = -1 * t(this, c)[t(this, u)] : e.code === "PageDown" ? a = 1 * t(this, c)[t(this, u)] : e.code === "Home" ? a = 0 : e.code === "End" && (a = t(this, u) === "offsetWidth" ? t(this, c).scrollWidth : t(this, c).scrollHeight), a && (e.stopPropagation(), this.changeEvent.notify("keyboard", a, e));
|
|
37
37
|
});
|
|
38
|
-
b && (i(this,
|
|
38
|
+
b && (i(this, y, e != null && e.element && Z(e.element) || window), i(this, c, t(this, y) instanceof HTMLElement ? t(this, y) : document.documentElement), this.dimension = e == null ? void 0 : e.dimension);
|
|
39
39
|
}
|
|
40
40
|
set dimension(e) {
|
|
41
41
|
i(this, u, e === "width" ? "offsetWidth" : "offsetHeight");
|
|
42
42
|
}
|
|
43
43
|
connect() {
|
|
44
|
-
b && t(this,
|
|
44
|
+
b && t(this, y).addEventListener(
|
|
45
45
|
"keydown",
|
|
46
|
-
t(this,
|
|
46
|
+
t(this, Y)
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
disconnect() {
|
|
50
|
-
b && t(this,
|
|
50
|
+
b && t(this, y).removeEventListener(
|
|
51
51
|
"keydown",
|
|
52
|
-
t(this,
|
|
52
|
+
t(this, Y)
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
var
|
|
58
|
-
class ye extends
|
|
56
|
+
y = new WeakMap(), c = new WeakMap(), u = new WeakMap(), Y = new WeakMap();
|
|
57
|
+
var E, M, K, O, d, I, m, w, Q, J, H, S, q;
|
|
58
|
+
class ye extends j {
|
|
59
59
|
constructor(e) {
|
|
60
60
|
super();
|
|
61
61
|
s(this, w);
|
|
62
|
-
s(this,
|
|
62
|
+
s(this, E);
|
|
63
63
|
s(this, M);
|
|
64
|
-
s(this, R);
|
|
65
|
-
s(this, W);
|
|
66
|
-
s(this, c);
|
|
67
|
-
s(this, D);
|
|
68
|
-
s(this, m);
|
|
69
|
-
s(this, I);
|
|
70
64
|
s(this, K);
|
|
65
|
+
s(this, O);
|
|
66
|
+
s(this, d);
|
|
67
|
+
s(this, I);
|
|
68
|
+
s(this, m);
|
|
71
69
|
s(this, H);
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
s(this, S);
|
|
71
|
+
s(this, q);
|
|
72
|
+
this.direction = 1, i(this, d, new ie(0, { easing: te })), i(this, m, !1), i(this, H, (h) => {
|
|
73
|
+
t(this, d).current !== 1 && this.changeEvent.notify(
|
|
74
74
|
"autoplay",
|
|
75
|
-
h.timeBetweenFrames * t(this,
|
|
75
|
+
h.timeBetweenFrames * t(this, E) * this.direction * (1 - t(this, d).current),
|
|
76
76
|
h
|
|
77
77
|
);
|
|
78
|
-
}), i(this,
|
|
79
|
-
t(this,
|
|
78
|
+
}), i(this, S, () => {
|
|
79
|
+
t(this, d).current !== 1 && this.changeEvent.notify(
|
|
80
80
|
"autoplay",
|
|
81
|
-
Math.sign(t(this,
|
|
81
|
+
Math.sign(t(this, E)) * this.direction * (1 - t(this, d).current),
|
|
82
82
|
null
|
|
83
83
|
);
|
|
84
|
-
}), i(this,
|
|
85
|
-
t(this, M) && (document.hidden ? t(this,
|
|
86
|
-
}), i(this,
|
|
84
|
+
}), i(this, q, () => {
|
|
85
|
+
t(this, M) && (document.hidden ? t(this, d).set(1, { equalize: !0 }) : t(this, d).set(0, { equalize: !0 }));
|
|
86
|
+
}), i(this, E, (e == null ? void 0 : e.speed) || 1), i(this, M, (e == null ? void 0 : e.interval) || !1), i(this, K, e);
|
|
87
87
|
}
|
|
88
88
|
set interval(e) {
|
|
89
|
-
i(this, M, e), t(this, m) &&
|
|
89
|
+
i(this, M, e), t(this, m) && A(this, w, Q).call(this);
|
|
90
90
|
}
|
|
91
91
|
set speed(e) {
|
|
92
|
-
i(this,
|
|
92
|
+
i(this, E, e), t(this, m) && A(this, w, Q).call(this);
|
|
93
93
|
}
|
|
94
94
|
connect() {
|
|
95
|
-
t(this, m) || (i(this, m, !0),
|
|
95
|
+
t(this, m) || (i(this, m, !0), A(this, w, Q).call(this));
|
|
96
96
|
}
|
|
97
97
|
disconnect() {
|
|
98
|
-
t(this, m) && (i(this, m, !1),
|
|
98
|
+
t(this, m) && (i(this, m, !1), A(this, w, J).call(this));
|
|
99
99
|
}
|
|
100
100
|
pauseAndContinue(e, h) {
|
|
101
|
-
t(this, m) && e && (clearTimeout(t(this,
|
|
101
|
+
t(this, m) && e && (clearTimeout(t(this, I)), t(this, d).set(1, {
|
|
102
102
|
duration: Math.min(e, 1e3),
|
|
103
103
|
equalize: h
|
|
104
|
-
}), i(this,
|
|
105
|
-
t(this,
|
|
104
|
+
}), i(this, I, setTimeout(() => {
|
|
105
|
+
t(this, d).set(0, {
|
|
106
106
|
duration: Math.min(e, 5e3),
|
|
107
107
|
equalize: h
|
|
108
108
|
});
|
|
109
109
|
}, e)));
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
t(this,
|
|
115
|
-
Math.abs(t(this,
|
|
116
|
-
)) :
|
|
112
|
+
E = new WeakMap(), M = new WeakMap(), K = new WeakMap(), O = new WeakMap(), d = new WeakMap(), I = new WeakMap(), m = new WeakMap(), w = new WeakSet(), Q = function() {
|
|
113
|
+
A(this, w, J).call(this), t(this, M) ? i(this, O, setInterval(
|
|
114
|
+
t(this, S),
|
|
115
|
+
Math.abs(t(this, E))
|
|
116
|
+
)) : D.subscribe(t(this, H), t(this, K)), document.addEventListener(
|
|
117
117
|
"visibilitychange",
|
|
118
|
-
t(this,
|
|
118
|
+
t(this, q)
|
|
119
119
|
);
|
|
120
|
-
},
|
|
121
|
-
clearInterval(t(this,
|
|
120
|
+
}, J = function() {
|
|
121
|
+
clearInterval(t(this, O)), D.unsubscribe(t(this, H)), clearTimeout(t(this, I)), t(this, d).close(), document.removeEventListener(
|
|
122
122
|
"visibilitychange",
|
|
123
|
-
t(this,
|
|
123
|
+
t(this, q)
|
|
124
124
|
);
|
|
125
|
-
},
|
|
126
|
-
var
|
|
127
|
-
class Ee extends
|
|
125
|
+
}, H = new WeakMap(), S = new WeakMap(), q = new WeakMap();
|
|
126
|
+
var z, k, P, B;
|
|
127
|
+
class Ee extends j {
|
|
128
128
|
constructor(e) {
|
|
129
129
|
super();
|
|
130
|
-
s(this,
|
|
131
|
-
s(this,
|
|
132
|
-
s(this,
|
|
133
|
-
s(this,
|
|
130
|
+
s(this, z, null);
|
|
131
|
+
s(this, k);
|
|
132
|
+
s(this, P);
|
|
133
|
+
s(this, B, (e) => {
|
|
134
134
|
let h = 0;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
const a = Math.abs(e.deltaY), g = Math.abs(e.deltaX);
|
|
136
|
+
if (!(this.axis === "x" && a > g || this.axis === "y" && g > a) && (e.preventDefault(), !(this.debounce && this.axis === "x" && g < 5 || this.axis === "y" && a < 5)))
|
|
137
|
+
if (h = (this.axis === "max" ? g > a ? e.deltaX : e.deltaY : this.axis === "x" ? e.deltaX : e.deltaY) * this.speed, e.stopPropagation(), this.debounce) {
|
|
138
|
+
const X = Date.now();
|
|
139
|
+
if (X - t(this, P) > 40 && (h = 100 * Math.sign(h)), i(this, P, X), Math.abs(h) < 100 || t(this, k))
|
|
139
140
|
return;
|
|
140
|
-
this.changeEvent.notify("wheel", h, e), i(this,
|
|
141
|
-
i(this,
|
|
141
|
+
this.changeEvent.notify("wheel", h, e), i(this, k, setTimeout(() => {
|
|
142
|
+
i(this, k, void 0);
|
|
142
143
|
}, 80));
|
|
143
144
|
} else
|
|
144
145
|
this.changeEvent.notify("wheel", h, e);
|
|
145
146
|
});
|
|
146
|
-
this.axis = (e == null ? void 0 : e.axis) || "y", this.speed = (e == null ? void 0 : e.speed) || 1, this.debounce = (e == null ? void 0 : e.debounce) || !1, i(this,
|
|
147
|
+
this.axis = (e == null ? void 0 : e.axis) || "y", this.speed = (e == null ? void 0 : e.speed) || 1, this.debounce = (e == null ? void 0 : e.debounce) || !1, i(this, P, Date.now()), b && i(this, z, e != null && e.element && Z(e.element) || window);
|
|
147
148
|
}
|
|
148
149
|
connect() {
|
|
149
|
-
b && t(this,
|
|
150
|
+
b && t(this, z).addEventListener(
|
|
150
151
|
"wheel",
|
|
151
|
-
t(this,
|
|
152
|
+
t(this, B),
|
|
152
153
|
{
|
|
153
154
|
passive: !1
|
|
154
155
|
}
|
|
155
156
|
);
|
|
156
157
|
}
|
|
157
158
|
disconnect() {
|
|
158
|
-
b && (t(this,
|
|
159
|
+
b && (t(this, z).removeEventListener(
|
|
159
160
|
"wheel",
|
|
160
|
-
t(this,
|
|
161
|
-
), clearTimeout(t(this,
|
|
161
|
+
t(this, B)
|
|
162
|
+
), clearTimeout(t(this, k)));
|
|
162
163
|
}
|
|
163
164
|
}
|
|
164
|
-
|
|
165
|
-
var
|
|
166
|
-
const
|
|
165
|
+
z = new WeakMap(), k = new WeakMap(), P = new WeakMap(), B = new WeakMap();
|
|
166
|
+
var T, N, o, l, C, x, R, W, L;
|
|
167
|
+
const v = class v extends j {
|
|
167
168
|
constructor(e) {
|
|
168
169
|
super();
|
|
169
|
-
s(this,
|
|
170
|
+
s(this, N);
|
|
170
171
|
s(this, o);
|
|
171
172
|
s(this, l);
|
|
172
|
-
s(this,
|
|
173
|
-
s(this, E);
|
|
174
|
-
s(this, X);
|
|
175
|
-
s(this, Y);
|
|
173
|
+
s(this, C);
|
|
176
174
|
s(this, x);
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
175
|
+
s(this, R);
|
|
176
|
+
s(this, W);
|
|
177
|
+
s(this, L);
|
|
178
|
+
this.inertion = 1, i(this, N, null), i(this, o, null), i(this, l, 0), i(this, C, []), i(this, x, 0), i(this, R, (h) => {
|
|
179
|
+
Math.abs(t(this, x)) > 2 && h.preventDefault();
|
|
180
|
+
}), i(this, W, (h) => {
|
|
181
|
+
if (i(this, x, 0), i(this, l, 0), h.button !== 0 || h.composedPath().find(
|
|
181
182
|
(f) => f instanceof HTMLElement && f.hasAttribute("drag-dead-zone")
|
|
182
183
|
))
|
|
183
184
|
return;
|
|
184
|
-
this.swipe ||
|
|
185
|
-
let
|
|
185
|
+
this.swipe || D.unsubscribe(t(this, L));
|
|
186
|
+
let a = h, g = !1;
|
|
186
187
|
document.documentElement.classList.add("grabbing");
|
|
187
|
-
let
|
|
188
|
+
let X = 0, $ = 0, F = 0, U = 0;
|
|
188
189
|
se(
|
|
189
190
|
(f) => {
|
|
190
|
-
t(
|
|
191
|
+
t(v, T) && t(v, T) !== t(this, o) || (X = a.x - f.x, $ = a.y - f.y, F = f.x - h.x, U = f.y - h.y, this.axis === "x" ? (i(this, x, F), i(this, l, X)) : (i(this, x, U), i(this, l, $)), a = f, g = this.axis === "x" && Math.abs(F) > Math.abs(U) || this.axis === "y" && Math.abs(U) > Math.abs(F), g && (document.documentElement.classList.add("dragging"), i(v, T, t(this, o)), this.changeEvent.notify("drag", t(this, l), f)));
|
|
191
192
|
},
|
|
192
193
|
(f) => {
|
|
193
|
-
i(
|
|
194
|
-
order:
|
|
194
|
+
i(v, T, null), g && (!this.swipe && this.inertion ? (i(this, l, t(this, l) * this.inertion), D.subscribe(t(this, L), {
|
|
195
|
+
order: ne.CONTROLS - 1
|
|
195
196
|
})) : this.swipe && this.changeEvent.notify("drag-end", t(this, l), f)), document.documentElement.classList.remove("grabbing"), document.documentElement.classList.remove("dragging");
|
|
196
197
|
}
|
|
197
198
|
);
|
|
198
|
-
}), i(this,
|
|
199
|
-
Math.floor(Math.abs(t(this, l))) ||
|
|
200
|
-
}), this.axis = (e == null ? void 0 : e.axis) || "y", this.swipe = (e == null ? void 0 : e.swipe) || !1, b && (i(this, o, e != null && e.element &&
|
|
199
|
+
}), i(this, L, () => {
|
|
200
|
+
Math.floor(Math.abs(t(this, l))) || D.unsubscribe(t(this, L)), i(this, l, t(this, l) * 0.95), i(this, l, he(t(this, l), 3)), this.changeEvent.notify("drag", t(this, l), null);
|
|
201
|
+
}), this.axis = (e == null ? void 0 : e.axis) || "y", this.swipe = (e == null ? void 0 : e.swipe) || !1, b && (i(this, o, e != null && e.element && Z(e.element) || document.documentElement), i(this, N, (e == null ? void 0 : e.rootElement) || t(this, o)));
|
|
201
202
|
}
|
|
202
203
|
connect() {
|
|
203
|
-
b && (i(this,
|
|
204
|
-
e.addEventListener("click", t(this,
|
|
205
|
-
}), t(this, o).addEventListener("pointerdown", t(this,
|
|
204
|
+
b && (i(this, C, [...t(this, N).querySelectorAll("a")]), t(this, C).forEach((e) => {
|
|
205
|
+
e.addEventListener("click", t(this, R));
|
|
206
|
+
}), t(this, o).addEventListener("pointerdown", t(this, W)));
|
|
206
207
|
}
|
|
207
208
|
disconnect() {
|
|
208
|
-
b && (t(this,
|
|
209
|
-
e.removeEventListener("click", t(this,
|
|
209
|
+
b && (t(this, C).forEach((e) => {
|
|
210
|
+
e.removeEventListener("click", t(this, R));
|
|
210
211
|
}), t(this, o).removeEventListener(
|
|
211
212
|
"pointerdown",
|
|
212
|
-
t(this,
|
|
213
|
-
),
|
|
213
|
+
t(this, W)
|
|
214
|
+
), D.unsubscribe(t(this, L)));
|
|
214
215
|
}
|
|
215
216
|
};
|
|
216
|
-
|
|
217
|
-
let p =
|
|
217
|
+
T = new WeakMap(), N = new WeakMap(), o = new WeakMap(), l = new WeakMap(), C = new WeakMap(), x = new WeakMap(), R = new WeakMap(), W = new WeakMap(), L = new WeakMap(), s(v, T, null);
|
|
218
|
+
let p = v;
|
|
218
219
|
export {
|
|
219
220
|
ye as AutoplayControls,
|
|
220
|
-
|
|
221
|
+
j as Controls,
|
|
221
222
|
p as DragControls,
|
|
222
223
|
ge as KeyboardControls,
|
|
223
224
|
Ee as WheelControls
|