aptechka 0.31.1 → 0.32.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/{Animation-DN95L7Xo.js → Animation-B1AS8IQG.js} +9 -9
- package/lib/Animation-CN0h3D4p.cjs +1 -0
- package/lib/{Damped-CTsV8tl_.cjs → Damped-C3MyWa5_.cjs} +1 -1
- package/lib/{Damped-Chu29wn-.js → Damped-cQCN3d0W.js} +1 -1
- package/lib/Tweened-ChIsd14E.cjs +1 -0
- package/lib/Tweened-CynwDTYT.js +44 -0
- package/lib/animation/Tweened.d.ts +3 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/controls/DragControls.d.ts +1 -0
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +118 -120
- package/lib/easings-BEmRlrDd.js +38 -0
- package/lib/easings-GegIwET5.cjs +1 -0
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +1 -1
- package/lib/scroll/vanilla/ScrollButtonElement.d.ts +2 -1
- package/lib/scroll/vanilla/ScrollElement.d.ts +6 -3
- package/lib/scroll/vanilla/ScrollSetButtonElement.d.ts +2 -1
- package/lib/scroll/vanilla/ScrollStepButtonElement.d.ts +2 -1
- package/lib/scroll/vanilla/index.cjs +1 -1
- package/lib/scroll/vanilla/index.js +371 -337
- package/lib/scroll-segment/index.cjs +1 -1
- package/lib/scroll-segment/index.js +1 -1
- package/lib/slicer/index.cjs +4 -4
- package/lib/slicer/index.js +0 -1
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +10 -10
- package/package.json +1 -1
- package/lib/Animation-B9m8bw96.cjs +0 -1
- package/lib/Tweened-BUuSLSF7.js +0 -44
- package/lib/Tweened-BttGiyB0.cjs +0 -1
- package/lib/easings-BKi40vHz.js +0 -19
- package/lib/easings-DsS5-Kqc.cjs +0 -1
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var ve = Object.defineProperty;
|
|
2
|
+
var oe = Object.getOwnPropertySymbols;
|
|
3
|
+
var ye = Object.prototype.hasOwnProperty, Ce = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var ce = (a) => {
|
|
5
5
|
throw TypeError(a);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
8
|
-
for (var e in
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
for (var e of
|
|
12
|
-
|
|
7
|
+
var le = (a, r, e) => r in a ? ve(a, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[r] = e, ae = (a, r) => {
|
|
8
|
+
for (var e in r || (r = {}))
|
|
9
|
+
ye.call(r, e) && le(a, e, r[e]);
|
|
10
|
+
if (oe)
|
|
11
|
+
for (var e of oe(r))
|
|
12
|
+
Ce.call(r, e) && le(a, e, r[e]);
|
|
13
13
|
return a;
|
|
14
14
|
};
|
|
15
|
-
var
|
|
16
|
-
var t = (a,
|
|
17
|
-
import { S as
|
|
18
|
-
import { i as
|
|
19
|
-
import {
|
|
20
|
-
import { d as
|
|
21
|
-
import { c as
|
|
22
|
-
import { a as
|
|
23
|
-
import { c as
|
|
15
|
+
var Qt = (a, r, e) => r.has(a) || ce("Cannot " + e);
|
|
16
|
+
var t = (a, r, e) => (Qt(a, r, "read from private field"), e ? e.call(a) : r.get(a)), s = (a, r, e) => r.has(a) ? ce("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(a) : r.set(a, e), h = (a, r, e, i) => (Qt(a, r, "write to private field"), i ? i.call(a, e) : r.set(a, e), e), d = (a, r, e) => (Qt(a, r, "access private method"), e);
|
|
17
|
+
import { S as Ee } from "../../Store-OTdcl6SX.js";
|
|
18
|
+
import { i as Jt } from "../../browser-0zX67oeU.js";
|
|
19
|
+
import { q as we } from "../../easings-BEmRlrDd.js";
|
|
20
|
+
import { d as Xt } from "../../events-CsVF98U6.js";
|
|
21
|
+
import { c as de } from "../../jss-CjccJC-K.js";
|
|
22
|
+
import { a as Yt, g as te } from "../../layout-HoBT_Da2.js";
|
|
23
|
+
import { c as pe } from "../../math-BOBiC4TN.js";
|
|
24
24
|
import "../../ticker/vanilla/index.js";
|
|
25
|
-
import { TICK_ORDER as
|
|
26
|
-
import { D as
|
|
27
|
-
import { T as
|
|
28
|
-
import { WheelControls as
|
|
29
|
-
import { windowResizer as
|
|
30
|
-
import { scrollEntries as
|
|
31
|
-
import { cssUnitParser as
|
|
25
|
+
import { TICK_ORDER as xe, RESIZE_ORDER as fe } from "../../order/index.js";
|
|
26
|
+
import { D as Pe } from "../../Damped-cQCN3d0W.js";
|
|
27
|
+
import { T as Le } from "../../Tweened-CynwDTYT.js";
|
|
28
|
+
import { WheelControls as ze, KeyboardControls as ke, DragControls as Ie, AutoplayControls as De } from "../../controls/index.js";
|
|
29
|
+
import { windowResizer as Zt } from "../../window-resizer/vanilla/index.js";
|
|
30
|
+
import { scrollEntries as lt } from "../../scroll-entries/index.js";
|
|
31
|
+
import { cssUnitParser as ue } from "../../css-unit-parser/index.js";
|
|
32
32
|
import { CSSProperty as f } from "../../css-property/index.js";
|
|
33
|
-
import { device as
|
|
34
|
-
import { elementResizer as
|
|
35
|
-
import { s as
|
|
36
|
-
import { f as
|
|
37
|
-
import { d as
|
|
38
|
-
import { ScrollSegmentElement as
|
|
39
|
-
var m,
|
|
40
|
-
class
|
|
41
|
-
constructor(
|
|
33
|
+
import { device as Ae } from "../../device/index.js";
|
|
34
|
+
import { elementResizer as jt } from "../../element-resizer/vanilla/index.js";
|
|
35
|
+
import { s as Te } from "../../gestures-D2Fdra_G.js";
|
|
36
|
+
import { f as me } from "../../dom-0S_WDL4g.js";
|
|
37
|
+
import { d as Me } from "../../function-C10DGppn.js";
|
|
38
|
+
import { ScrollSegmentElement as Ve } from "../../scroll-segment/index.js";
|
|
39
|
+
var m, Rt, v, ct, V, G;
|
|
40
|
+
class Oe {
|
|
41
|
+
constructor(r, e, i) {
|
|
42
42
|
s(this, m);
|
|
43
|
-
s(this,
|
|
43
|
+
s(this, Rt);
|
|
44
44
|
s(this, v);
|
|
45
|
-
s(this,
|
|
46
|
-
s(this,
|
|
45
|
+
s(this, ct, 0);
|
|
46
|
+
s(this, V, 0);
|
|
47
47
|
s(this, G, null);
|
|
48
|
-
h(this, m,
|
|
48
|
+
h(this, m, r), h(this, Rt, e), h(this, v, i), lt.register(t(this, m));
|
|
49
49
|
}
|
|
50
50
|
get index() {
|
|
51
|
-
return t(this,
|
|
51
|
+
return t(this, Rt);
|
|
52
52
|
}
|
|
53
53
|
get size() {
|
|
54
|
-
return t(this,
|
|
54
|
+
return t(this, ct);
|
|
55
55
|
}
|
|
56
56
|
get position() {
|
|
57
|
-
return t(this,
|
|
57
|
+
return t(this, V);
|
|
58
58
|
}
|
|
59
59
|
destroy() {
|
|
60
|
-
|
|
60
|
+
lt.unregister(t(this, m)), this.unsetTransform();
|
|
61
61
|
}
|
|
62
62
|
unsetTransform() {
|
|
63
63
|
t(this, m).style.transform = "", this.mark(null);
|
|
64
64
|
}
|
|
65
|
-
setSize(
|
|
66
|
-
|
|
65
|
+
setSize(r) {
|
|
66
|
+
r ? (t(this, m).style.setProperty("--size", r + "px"), t(this, v).axisCSSProperty.current === "x" ? (t(this, m).style.width = r + "px", t(this, m).style.height = "") : (t(this, m).style.height = r + "px", t(this, m).style.width = "")) : (t(this, m).style.width = "", t(this, m).style.height = "", t(this, m).style.removeProperty("--size"));
|
|
67
67
|
}
|
|
68
68
|
resize() {
|
|
69
|
-
h(this,
|
|
69
|
+
h(this, ct, t(this, v).vertical ? t(this, m).offsetHeight : t(this, m).offsetWidth), h(this, V, t(this, v).vertical ? Yt(t(this, m)) : te(t(this, m))), h(this, V, t(this, V) - t(this, v).contentPosition);
|
|
70
70
|
}
|
|
71
71
|
transform() {
|
|
72
|
-
let
|
|
72
|
+
let r = 0;
|
|
73
73
|
const e = t(this, v).viewportSize * t(this, v).sectionDistanceScaleCSSProperty.current;
|
|
74
|
-
t(this, v).loopCSSProperty.current && t(this, v).overscroll && t(this,
|
|
74
|
+
t(this, v).loopCSSProperty.current && t(this, v).overscroll && t(this, V) + t(this, ct) < t(this, v).currentScrollValue && (r = t(this, v).distance * -1 - t(this, v).gap), lt.update(
|
|
75
75
|
t(this, m),
|
|
76
76
|
t(this, v).axisCSSProperty.current,
|
|
77
|
-
|
|
77
|
+
r
|
|
78
78
|
);
|
|
79
|
-
const i = t(this, v).currentScrollValue +
|
|
79
|
+
const i = t(this, v).currentScrollValue + r, n = t(this, V) - t(this, v).viewportSize - e, c = t(this, V) + t(this, ct) + e, b = pe(i, n, c);
|
|
80
80
|
t(this, v).vertical ? t(this, m).style.transform = `translate3d(0px, ${b * -1}px, 0px)` : t(this, m).style.transform = `translate3d(${b * -1}px, 0px, 0px)`;
|
|
81
81
|
}
|
|
82
|
-
mark(
|
|
83
|
-
t(this, G) !==
|
|
82
|
+
mark(r) {
|
|
83
|
+
t(this, G) !== r && (t(this, G) && t(this, m).classList.remove(t(this, G)), r && t(this, m).classList.add(r), h(this, G, r), Xt(t(this, m), "scrollSectionMarkChange", {
|
|
84
84
|
composed: !0,
|
|
85
85
|
detail: {
|
|
86
86
|
mark: t(this, G)
|
|
@@ -89,8 +89,8 @@ class Ie {
|
|
|
89
89
|
}));
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
m = new WeakMap(),
|
|
93
|
-
const
|
|
92
|
+
m = new WeakMap(), Rt = new WeakMap(), v = new WeakMap(), ct = new WeakMap(), V = new WeakMap(), G = new WeakMap();
|
|
93
|
+
const Re = de({
|
|
94
94
|
":host": {
|
|
95
95
|
position: "relative",
|
|
96
96
|
width: "100%",
|
|
@@ -128,273 +128,299 @@ const Me = le({
|
|
|
128
128
|
flexShrink: "0"
|
|
129
129
|
}
|
|
130
130
|
});
|
|
131
|
-
var u,
|
|
132
|
-
class
|
|
131
|
+
var u, at, P, O, R, H, I, K, _, B, Z, ut, D, C, dt, pt, ft, mt, wt, k, bt, j, A, J, F, Q, gt, St, X, Y, p, xt, l, Ht, Bt, y, S, L, T, tt, M, E, g, Pt, et, W, st, vt, Lt, it, $, o, Vt, Et, Kt, _t, ee, se, z, zt, be, kt, Ft, ie, re, ot, ne;
|
|
132
|
+
class Ot extends HTMLElement {
|
|
133
133
|
constructor() {
|
|
134
134
|
super();
|
|
135
135
|
s(this, o);
|
|
136
136
|
s(this, u, null);
|
|
137
|
-
s(this,
|
|
137
|
+
s(this, at, new f(this, "--controls", !0));
|
|
138
138
|
s(this, P, new f(this, "--axis", "y"));
|
|
139
|
-
s(this,
|
|
140
|
-
s(this,
|
|
139
|
+
s(this, O, new f(this, "--direction", 0));
|
|
140
|
+
s(this, R, new f(this, "--pages", 0, {
|
|
141
141
|
validate: (e) => Math.max(0, e - 1)
|
|
142
142
|
}));
|
|
143
|
-
s(this,
|
|
144
|
-
s(this,
|
|
145
|
-
s(this, H, new f(this, "--auto-size", !1));
|
|
143
|
+
s(this, H, new f(this, "--split", !1));
|
|
144
|
+
s(this, I, new f(this, "--sectional", !1));
|
|
146
145
|
s(this, K, new f(
|
|
146
|
+
this,
|
|
147
|
+
"--easing",
|
|
148
|
+
!1
|
|
149
|
+
));
|
|
150
|
+
s(this, _, new f(
|
|
151
|
+
this,
|
|
152
|
+
"--duration",
|
|
153
|
+
!1
|
|
154
|
+
));
|
|
155
|
+
s(this, B, new f(this, "--auto-size", !1));
|
|
156
|
+
s(this, Z, new f(
|
|
147
157
|
this,
|
|
148
158
|
"--wheel-max-delta",
|
|
149
159
|
!1
|
|
150
160
|
));
|
|
151
|
-
s(this,
|
|
161
|
+
s(this, ut, new f(this, "--drag-inertion", 1));
|
|
162
|
+
s(this, D, new f(
|
|
152
163
|
this,
|
|
153
164
|
"--sections-in-view",
|
|
154
165
|
1
|
|
155
166
|
));
|
|
156
167
|
s(this, C, new f(this, "--loop", !1));
|
|
157
|
-
s(this,
|
|
158
|
-
s(this,
|
|
159
|
-
s(this,
|
|
160
|
-
s(this,
|
|
161
|
-
s(this,
|
|
168
|
+
s(this, dt, new f(this, "--damping", 20));
|
|
169
|
+
s(this, pt, new f(this, "--mass", 0));
|
|
170
|
+
s(this, ft, new f(this, "--stiffness", 0));
|
|
171
|
+
s(this, mt, new f(this, "--mouse-drag", !1));
|
|
172
|
+
s(this, wt, new f(
|
|
162
173
|
this,
|
|
163
174
|
"--section-distance-scale",
|
|
164
175
|
0.5
|
|
165
176
|
));
|
|
166
177
|
s(this, k, new f(this, "--autoplay", 0));
|
|
167
|
-
s(this,
|
|
178
|
+
s(this, bt, new f(
|
|
168
179
|
this,
|
|
169
180
|
"--autoplay-pause-duration",
|
|
170
181
|
0
|
|
171
182
|
));
|
|
172
|
-
s(this,
|
|
183
|
+
s(this, j, new f(
|
|
173
184
|
this,
|
|
174
185
|
"--autoplay-user-direction",
|
|
175
186
|
!1
|
|
176
187
|
));
|
|
177
|
-
s(this,
|
|
178
|
-
s(this,
|
|
188
|
+
s(this, A, new f(this, "--classes", !1));
|
|
189
|
+
s(this, J, new f(
|
|
179
190
|
this,
|
|
180
191
|
"--current-index-start-offset",
|
|
181
192
|
0
|
|
182
193
|
));
|
|
183
|
-
s(this,
|
|
194
|
+
s(this, F, new f(
|
|
184
195
|
this,
|
|
185
196
|
"--current-index-end-offset",
|
|
186
197
|
0
|
|
187
198
|
));
|
|
188
|
-
s(this,
|
|
189
|
-
s(this,
|
|
199
|
+
s(this, Q, new f(this, "--focus-delay", 0));
|
|
200
|
+
s(this, gt, new f(
|
|
190
201
|
this,
|
|
191
202
|
"--focus-duration",
|
|
192
203
|
3e3
|
|
193
204
|
));
|
|
194
|
-
s(this,
|
|
195
|
-
s(this,
|
|
196
|
-
s(this,
|
|
205
|
+
s(this, St, new f(this, "--disabled", !1));
|
|
206
|
+
s(this, X, new f(this, "--hibernated", !1));
|
|
207
|
+
s(this, Y, null);
|
|
197
208
|
s(this, p, null);
|
|
198
|
-
s(this,
|
|
209
|
+
s(this, xt, null);
|
|
199
210
|
s(this, l, []);
|
|
200
|
-
s(this,
|
|
201
|
-
s(this,
|
|
211
|
+
s(this, Ht, 0);
|
|
212
|
+
s(this, Bt, 0);
|
|
202
213
|
s(this, y, 0);
|
|
203
214
|
s(this, S, 0);
|
|
204
215
|
s(this, L, 0);
|
|
216
|
+
s(this, T, null);
|
|
217
|
+
s(this, tt, null);
|
|
205
218
|
s(this, M, null);
|
|
206
|
-
s(this, X, null);
|
|
207
|
-
s(this, W, null);
|
|
208
219
|
s(this, E, null);
|
|
209
|
-
s(this, g, new
|
|
210
|
-
s(this,
|
|
211
|
-
s(this,
|
|
212
|
-
s(this,
|
|
213
|
-
s(this,
|
|
214
|
-
s(this,
|
|
215
|
-
s(this,
|
|
216
|
-
s(this,
|
|
220
|
+
s(this, g, new Ee(0));
|
|
221
|
+
s(this, Pt, 0);
|
|
222
|
+
s(this, et, 0);
|
|
223
|
+
s(this, W, !1);
|
|
224
|
+
s(this, st, !0);
|
|
225
|
+
s(this, vt, !0);
|
|
226
|
+
s(this, Lt);
|
|
227
|
+
s(this, it);
|
|
228
|
+
s(this, $, new Le());
|
|
217
229
|
s(this, z, () => {
|
|
218
230
|
t(this, u).unlistenAnimationFrame();
|
|
219
231
|
const e = this.currentScrollValue / t(this, S) || 0, i = t(this, g).current;
|
|
220
|
-
if (h(this,
|
|
232
|
+
if (h(this, Ht, this.vertical ? Yt(this) : te(this)), h(this, Bt, this.vertical ? Yt(t(this, p)) : te(t(this, p))), h(this, y, this.vertical ? this.offsetHeight : this.offsetWidth), this.vertical ? h(this, L, ue.parse(
|
|
221
233
|
getComputedStyle(t(this, p)).rowGap
|
|
222
|
-
)) : h(this, L,
|
|
234
|
+
)) : h(this, L, ue.parse(
|
|
223
235
|
getComputedStyle(t(this, p)).columnGap
|
|
224
|
-
)), t(this,
|
|
225
|
-
const
|
|
236
|
+
)), t(this, B).current && t(this, l).length) {
|
|
237
|
+
const n = t(this, D).current, c = (t(this, y) - t(this, L) * (n - 1)) / n;
|
|
226
238
|
t(this, l).forEach((b) => {
|
|
227
239
|
b.setSize(c);
|
|
228
240
|
});
|
|
229
241
|
} else
|
|
230
|
-
t(this, l).forEach((
|
|
231
|
-
|
|
242
|
+
t(this, l).forEach((n) => {
|
|
243
|
+
n.setSize();
|
|
232
244
|
});
|
|
233
|
-
if (t(this, l).forEach((
|
|
234
|
-
|
|
235
|
-
}), t(this,
|
|
236
|
-
h(this, S, t(this, y) * t(this,
|
|
237
|
-
const
|
|
238
|
-
this.vertical ? (t(this, p).style.width =
|
|
245
|
+
if (t(this, l).forEach((n) => {
|
|
246
|
+
n.resize();
|
|
247
|
+
}), t(this, R).current) {
|
|
248
|
+
h(this, S, t(this, y) * t(this, R).current);
|
|
249
|
+
const n = t(this, S) + t(this, y);
|
|
250
|
+
this.vertical ? (t(this, p).style.width = n + "px", t(this, p).style.height = "100%") : (t(this, p).style.height = n + "px", t(this, p).style.width = "100%");
|
|
239
251
|
} else
|
|
240
252
|
this.vertical ? (t(this, p).style.width = "100%", t(this, p).style.height = "max-content", h(this, S, t(this, p).offsetHeight - t(this, y))) : (t(this, p).style.width = "max-content", t(this, p).style.height = "100%", h(this, S, t(this, p).offsetWidth - t(this, y)));
|
|
241
253
|
if (!t(this, C).current) {
|
|
242
|
-
const
|
|
254
|
+
const n = getComputedStyle(this), c = this.vertical ? parseFloat(n.paddingBlockStart) + parseFloat(n.paddingBlockEnd) : parseFloat(n.paddingInlineStart) + parseFloat(n.paddingInlineEnd);
|
|
243
255
|
h(this, S, t(this, S) + c), t(this, u).max = t(this, S);
|
|
244
256
|
}
|
|
245
257
|
if (t(this, C).current && t(this, l).length) {
|
|
246
|
-
const
|
|
247
|
-
h(this,
|
|
258
|
+
const n = t(this, l)[t(this, l).length - 1], c = n.position + n.size - t(this, y), b = t(this, S) - c;
|
|
259
|
+
h(this, et, n.position + n.size + b);
|
|
248
260
|
} else
|
|
249
|
-
h(this,
|
|
250
|
-
if (t(this,
|
|
251
|
-
const
|
|
252
|
-
t(this, u).set(
|
|
261
|
+
h(this, et, t(this, S));
|
|
262
|
+
if (t(this, I).current && t(this, l).length) {
|
|
263
|
+
const n = t(this, l)[i];
|
|
264
|
+
t(this, u).set(n.position, {
|
|
253
265
|
equalize: !0
|
|
254
266
|
});
|
|
255
267
|
} else
|
|
256
268
|
t(this, u).set(e * t(this, S), {
|
|
257
269
|
equalize: !0
|
|
258
270
|
});
|
|
259
|
-
h(this,
|
|
271
|
+
h(this, W, (this.vertical ? t(this, p).offsetHeight : t(this, p).offsetWidth) > t(this, y)), this.classList.toggle("has-overflow", t(this, W)), t(this, W) ? d(this, o, _t).call(this) : d(this, o, Kt).call(this), t(this, zt).call(this);
|
|
260
272
|
});
|
|
261
|
-
s(this,
|
|
262
|
-
if (!t(this,
|
|
273
|
+
s(this, zt, () => {
|
|
274
|
+
if (!t(this, W))
|
|
263
275
|
return;
|
|
264
276
|
const e = this.currentScrollValue;
|
|
265
|
-
if (h(this,
|
|
277
|
+
if (h(this, Pt, Math.max(0, e - t(this, S))), t(this, l).length) {
|
|
266
278
|
let i = 0;
|
|
267
|
-
for (let
|
|
268
|
-
const c = t(this, l)[
|
|
269
|
-
c.transform(), this.targetScrollValue + c.size / 2 >= c.position && (i =
|
|
279
|
+
for (let n = 0; n < t(this, l).length; n++) {
|
|
280
|
+
const c = t(this, l)[n];
|
|
281
|
+
c.transform(), this.targetScrollValue + c.size / 2 >= c.position && (i = n);
|
|
270
282
|
}
|
|
271
283
|
t(this, g).current = i;
|
|
272
284
|
} else
|
|
273
285
|
this.vertical ? t(this, p).style.transform = `translate3d(0px, ${e * -1}px, 0px)` : t(this, p).style.transform = `translate3d(${e * -1}px, 0px, 0px)`;
|
|
274
|
-
|
|
286
|
+
lt.update(
|
|
275
287
|
this,
|
|
276
288
|
t(this, P).current,
|
|
277
289
|
e
|
|
278
290
|
);
|
|
279
291
|
});
|
|
280
|
-
s(this,
|
|
281
|
-
t(this,
|
|
292
|
+
s(this, kt, (e, i) => {
|
|
293
|
+
t(this, at).current && (d(this, o, ie).call(this, Math.sign(i) || 1), t(this, Ft).call(this, e, i));
|
|
282
294
|
});
|
|
283
|
-
s(this,
|
|
284
|
-
if (t(this,
|
|
285
|
-
if (t(this,
|
|
295
|
+
s(this, Ft, (e, i) => {
|
|
296
|
+
if (t(this, O).current) {
|
|
297
|
+
if (t(this, O).current < 0 && i > 0)
|
|
286
298
|
return;
|
|
287
|
-
if (t(this,
|
|
299
|
+
if (t(this, O).current > 0 && i < 0)
|
|
288
300
|
return;
|
|
289
301
|
}
|
|
290
|
-
if (t(this, $).unlistenAnimationFrame(), !t(this, k).current && t(this,
|
|
291
|
-
const
|
|
292
|
-
|
|
302
|
+
if (t(this, it) || t(this, $).unlistenAnimationFrame(), !t(this, k).current && t(this, Q).current && (clearInterval(t(this, Lt)), h(this, Lt, setTimeout(() => {
|
|
303
|
+
const n = d(this, o, ne).call(this);
|
|
304
|
+
n && this.scrollToSection(n.index, {
|
|
293
305
|
tween: {
|
|
294
|
-
duration: t(this,
|
|
295
|
-
easing:
|
|
306
|
+
duration: t(this, gt).current,
|
|
307
|
+
easing: we
|
|
296
308
|
}
|
|
297
309
|
});
|
|
298
|
-
}, t(this,
|
|
299
|
-
if (t(this,
|
|
300
|
-
const
|
|
301
|
-
t(this, l).length ? this.shiftSections(
|
|
310
|
+
}, t(this, Q).current))), !(e.includes("drag") && !Ae.isMobile && !t(this, mt).current))
|
|
311
|
+
if (t(this, I).current && e === "drag-end") {
|
|
312
|
+
const n = Math.sign(i);
|
|
313
|
+
t(this, l).length ? this.shiftSections(n, {
|
|
314
|
+
tween: t(this, K).current || t(this, _).current ? {
|
|
315
|
+
easing: t(this, K).current || "easeInOutCubic",
|
|
316
|
+
duration: t(this, _).current || 500
|
|
317
|
+
} : void 0
|
|
318
|
+
}) : t(this, u).shift(n * t(this, y));
|
|
302
319
|
} else
|
|
303
320
|
t(this, u).shift(i);
|
|
304
321
|
});
|
|
305
|
-
if (
|
|
322
|
+
if (Jt) {
|
|
306
323
|
const e = this.attachShadow({ mode: "open" });
|
|
307
|
-
e.adoptedStyleSheets.push(
|
|
324
|
+
e.adoptedStyleSheets.push(Re);
|
|
308
325
|
const i = document.createElement("div");
|
|
309
|
-
i.className = "static", i.innerHTML = '<slot name="static"></slot>', e.appendChild(i), h(this,
|
|
326
|
+
i.className = "static", i.innerHTML = '<slot name="static"></slot>', e.appendChild(i), h(this, Y, document.createElement("div")), t(this, Y).className = "content-wrapper", h(this, p, document.createElement("div")), t(this, p).className = "content", h(this, xt, document.createElement("slot")), t(this, p).appendChild(t(this, xt)), t(this, Y).appendChild(t(this, p)), e.appendChild(t(this, Y));
|
|
310
327
|
}
|
|
311
328
|
}
|
|
312
329
|
get damped() {
|
|
313
330
|
return t(this, u);
|
|
314
331
|
}
|
|
315
332
|
get controlsCSSProperty() {
|
|
316
|
-
return t(this,
|
|
333
|
+
return t(this, at);
|
|
317
334
|
}
|
|
318
335
|
get axisCSSProperty() {
|
|
319
336
|
return t(this, P);
|
|
320
337
|
}
|
|
321
338
|
get directionCSSProperty() {
|
|
322
|
-
return t(this,
|
|
339
|
+
return t(this, O);
|
|
323
340
|
}
|
|
324
341
|
get pagesCSSProperty() {
|
|
325
|
-
return t(this,
|
|
342
|
+
return t(this, R);
|
|
326
343
|
}
|
|
327
344
|
get splitCSSProperty() {
|
|
328
|
-
return t(this,
|
|
345
|
+
return t(this, H);
|
|
329
346
|
}
|
|
330
347
|
get sectionalCSSProperty() {
|
|
331
|
-
return t(this,
|
|
348
|
+
return t(this, I);
|
|
349
|
+
}
|
|
350
|
+
get easingCSSProperty() {
|
|
351
|
+
return t(this, K);
|
|
352
|
+
}
|
|
353
|
+
get durationCSSProperty() {
|
|
354
|
+
return t(this, _);
|
|
332
355
|
}
|
|
333
356
|
get autoSizeCSSProperty() {
|
|
334
|
-
return t(this,
|
|
357
|
+
return t(this, B);
|
|
335
358
|
}
|
|
336
359
|
get wheelMaxDeltaCSSProperty() {
|
|
337
|
-
return t(this,
|
|
360
|
+
return t(this, Z);
|
|
361
|
+
}
|
|
362
|
+
get dragInertionCSSProperty() {
|
|
363
|
+
return t(this, ut);
|
|
338
364
|
}
|
|
339
365
|
get sectionsInViewCSSProperty() {
|
|
340
|
-
return t(this,
|
|
366
|
+
return t(this, D);
|
|
341
367
|
}
|
|
342
368
|
get loopCSSProperty() {
|
|
343
369
|
return t(this, C);
|
|
344
370
|
}
|
|
345
371
|
get dampingCSSProperty() {
|
|
346
|
-
return t(this,
|
|
372
|
+
return t(this, dt);
|
|
347
373
|
}
|
|
348
374
|
get massCSSProperty() {
|
|
349
|
-
return t(this,
|
|
375
|
+
return t(this, pt);
|
|
350
376
|
}
|
|
351
377
|
get stiffnessCSSProperty() {
|
|
352
|
-
return t(this,
|
|
378
|
+
return t(this, ft);
|
|
353
379
|
}
|
|
354
380
|
get mouseDragCSSProperty() {
|
|
355
|
-
return t(this,
|
|
381
|
+
return t(this, mt);
|
|
356
382
|
}
|
|
357
383
|
get sectionDistanceScaleCSSProperty() {
|
|
358
|
-
return t(this,
|
|
384
|
+
return t(this, wt);
|
|
359
385
|
}
|
|
360
386
|
get autoplayCSSProperty() {
|
|
361
387
|
return t(this, k);
|
|
362
388
|
}
|
|
363
389
|
get autoplayPauseDurationCSSProperty() {
|
|
364
|
-
return t(this,
|
|
390
|
+
return t(this, bt);
|
|
365
391
|
}
|
|
366
392
|
get autoplayUserDirectionCSSProperty() {
|
|
367
|
-
return t(this,
|
|
393
|
+
return t(this, j);
|
|
368
394
|
}
|
|
369
395
|
get classesCSSProperty() {
|
|
370
|
-
return t(this,
|
|
396
|
+
return t(this, A);
|
|
371
397
|
}
|
|
372
398
|
get currentIndexStartOffsetCSSProperty() {
|
|
373
|
-
return t(this,
|
|
399
|
+
return t(this, J);
|
|
374
400
|
}
|
|
375
401
|
get currentIndexEndOffsetCSSProperty() {
|
|
376
|
-
return t(this,
|
|
402
|
+
return t(this, F);
|
|
377
403
|
}
|
|
378
404
|
get focusDelayCSSProperty() {
|
|
379
|
-
return t(this,
|
|
405
|
+
return t(this, Q);
|
|
380
406
|
}
|
|
381
407
|
get focusDurationCSSProperty() {
|
|
382
|
-
return t(this,
|
|
408
|
+
return t(this, gt);
|
|
383
409
|
}
|
|
384
410
|
get disabledCSSProperty() {
|
|
385
|
-
return t(this,
|
|
411
|
+
return t(this, St);
|
|
386
412
|
}
|
|
387
413
|
get hibernatedCSSProperty() {
|
|
388
|
-
return t(this,
|
|
414
|
+
return t(this, X);
|
|
389
415
|
}
|
|
390
416
|
get currentScrollValue() {
|
|
391
|
-
return d(this, o,
|
|
417
|
+
return d(this, o, re).call(this, "current");
|
|
392
418
|
}
|
|
393
419
|
get targetScrollValue() {
|
|
394
|
-
return d(this, o,
|
|
420
|
+
return d(this, o, re).call(this, "target");
|
|
395
421
|
}
|
|
396
422
|
get contentWrapperElement() {
|
|
397
|
-
return t(this,
|
|
423
|
+
return t(this, Y);
|
|
398
424
|
}
|
|
399
425
|
get contentElement() {
|
|
400
426
|
return t(this, p);
|
|
@@ -403,10 +429,10 @@ class It extends HTMLElement {
|
|
|
403
429
|
return t(this, l);
|
|
404
430
|
}
|
|
405
431
|
get position() {
|
|
406
|
-
return t(this,
|
|
432
|
+
return t(this, Ht);
|
|
407
433
|
}
|
|
408
434
|
get contentPosition() {
|
|
409
|
-
return t(this,
|
|
435
|
+
return t(this, Bt);
|
|
410
436
|
}
|
|
411
437
|
get viewportSize() {
|
|
412
438
|
return t(this, y);
|
|
@@ -421,19 +447,19 @@ class It extends HTMLElement {
|
|
|
421
447
|
return t(this, g);
|
|
422
448
|
}
|
|
423
449
|
get limit() {
|
|
424
|
-
return t(this, l).length - t(this,
|
|
450
|
+
return t(this, l).length - t(this, D).current;
|
|
425
451
|
}
|
|
426
452
|
get distance() {
|
|
427
|
-
return t(this,
|
|
453
|
+
return t(this, et);
|
|
428
454
|
}
|
|
429
455
|
get loopDistance() {
|
|
430
|
-
return t(this, C).current ? t(this,
|
|
456
|
+
return t(this, C).current ? t(this, et) + t(this, L) : t(this, et);
|
|
431
457
|
}
|
|
432
458
|
get hasOverflow() {
|
|
433
|
-
return t(this,
|
|
459
|
+
return t(this, W);
|
|
434
460
|
}
|
|
435
461
|
get overscroll() {
|
|
436
|
-
return t(this,
|
|
462
|
+
return t(this, Pt);
|
|
437
463
|
}
|
|
438
464
|
get vertical() {
|
|
439
465
|
return t(this, P).current === "y";
|
|
@@ -457,34 +483,36 @@ class It extends HTMLElement {
|
|
|
457
483
|
t(this, u).unsubscribe(...e);
|
|
458
484
|
}
|
|
459
485
|
//https://github.com/pmndrs/drei/blob/d3282cdd02d170ef603a5e096505d83dc93cd57a/src/web/ScrollControls.tsx#L85C7-L100C9
|
|
460
|
-
range(e, i,
|
|
461
|
-
const c = e -
|
|
486
|
+
range(e, i, n = 0) {
|
|
487
|
+
const c = e - n, b = c + i + n * 2;
|
|
462
488
|
return this.currentProgress < c ? 0 : this.currentProgress > b ? 1 : (this.currentProgress - c) / (b - c);
|
|
463
489
|
}
|
|
464
|
-
curve(e, i,
|
|
465
|
-
return Math.sin(this.range(e, i,
|
|
490
|
+
curve(e, i, n = 0) {
|
|
491
|
+
return Math.sin(this.range(e, i, n) * Math.PI);
|
|
466
492
|
}
|
|
467
|
-
visible(e, i,
|
|
468
|
-
const c = e -
|
|
493
|
+
visible(e, i, n = 0) {
|
|
494
|
+
const c = e - n, b = c + i + n * 2;
|
|
469
495
|
return this.currentProgress >= c && this.currentProgress <= b;
|
|
470
496
|
}
|
|
471
497
|
scrollToSection(e, i) {
|
|
472
498
|
if (!t(this, l).length)
|
|
473
499
|
return;
|
|
474
|
-
const
|
|
475
|
-
d(this, o,
|
|
476
|
-
const c = t(this, l)[
|
|
500
|
+
const n = t(this, g).current;
|
|
501
|
+
d(this, o, be).call(this, e);
|
|
502
|
+
const c = t(this, l)[n], b = t(this, l)[t(this, g).current];
|
|
477
503
|
if (c && b) {
|
|
478
504
|
let x = 0;
|
|
479
|
-
const
|
|
480
|
-
t(this, C).current ? t(this, g).current === 0 &&
|
|
505
|
+
const Ct = d(this, o, ne).call(this), Se = Ct ? this.targetScrollValue - Ct.position : 0;
|
|
506
|
+
t(this, C).current ? t(this, g).current === 0 && n === t(this, l).length - 1 ? x = t(this, S) + t(this, y) - c.position + t(this, L) : t(this, g).current === t(this, l).length - 1 && n === 0 ? x = b.position - (t(this, S) + t(this, y) + t(this, L)) : x = b.position - c.position : x = b.position - c.position, this.shiftPosition(x - Se, i);
|
|
481
507
|
}
|
|
482
508
|
}
|
|
483
509
|
shiftSections(e, i) {
|
|
484
510
|
t(this, l).length && this.scrollToSection(t(this, g).current + e, i);
|
|
485
511
|
}
|
|
486
512
|
setPosition(e, i) {
|
|
487
|
-
d(this, o,
|
|
513
|
+
d(this, o, ie).call(this, Math.sign(e) || 1), i != null && i.tween ? t(this, it) || (t(this, $).set(t(this, u).current, { equalize: !0 }), t(this, $).set(e, ae({}, i.tween)), h(this, it, setTimeout(() => {
|
|
514
|
+
h(this, it, void 0);
|
|
515
|
+
}, i.tween.duration))) : t(this, u).set(e, {
|
|
488
516
|
equalize: (i == null ? void 0 : i.behaviour) === "instant"
|
|
489
517
|
});
|
|
490
518
|
}
|
|
@@ -492,172 +520,174 @@ class It extends HTMLElement {
|
|
|
492
520
|
this.setPosition(t(this, u).target + e, i);
|
|
493
521
|
}
|
|
494
522
|
connectedCallback() {
|
|
495
|
-
|
|
523
|
+
lt.register(this), h(this, u, new Pe(0, {
|
|
496
524
|
damping: 0.01,
|
|
497
525
|
min: 0,
|
|
498
|
-
order:
|
|
499
|
-
})), this.setAttribute("tabindex", "0"), h(this,
|
|
526
|
+
order: xe.SCROLL
|
|
527
|
+
})), this.setAttribute("tabindex", "0"), h(this, T, new ze({ element: t(this, p) })), t(this, T).changeEvent.subscribe(t(this, kt)), h(this, tt, new ke({
|
|
500
528
|
element: this
|
|
501
|
-
})), t(this,
|
|
502
|
-
t(this,
|
|
503
|
-
), h(this,
|
|
529
|
+
})), t(this, tt).changeEvent.subscribe(
|
|
530
|
+
t(this, kt)
|
|
531
|
+
), h(this, M, new Ie({ element: t(this, p) })), t(this, M).changeEvent.subscribe(t(this, kt)), h(this, E, new De({
|
|
504
532
|
culling: this
|
|
505
|
-
})), t(this, E).changeEvent.subscribe(t(this,
|
|
506
|
-
t(this, p).style.flexDirection = e === "x" ? "row" : "column", t(this,
|
|
507
|
-
}), t(this,
|
|
508
|
-
t(this,
|
|
509
|
-
}), t(this,
|
|
533
|
+
})), t(this, E).changeEvent.subscribe(t(this, Ft)), t(this, P).subscribe(({ current: e }) => {
|
|
534
|
+
t(this, p).style.flexDirection = e === "x" ? "row" : "column", t(this, T).axis = t(this, Z).current ? "max" : e, t(this, tt).dimension = e === "x" ? "width" : "height", t(this, M).axis = e, e === "x" ? this.style.touchAction = "pan-y" : e === "y" && (this.style.touchAction = "pan-x"), this.isConnected && t(this, z).call(this);
|
|
535
|
+
}), t(this, Z).subscribe((e) => {
|
|
536
|
+
t(this, T).axis = e.current ? "max" : t(this, P).current;
|
|
537
|
+
}), t(this, ut).subscribe((e) => {
|
|
538
|
+
t(this, M).inertion = typeof e.current == "number" ? e.current : 1;
|
|
539
|
+
}), t(this, R).subscribe(() => {
|
|
510
540
|
this.isConnected && t(this, z).call(this);
|
|
511
|
-
}), t(this,
|
|
512
|
-
this.isConnected && (e ? d(this, o,
|
|
541
|
+
}), t(this, H).subscribe(({ current: e }) => {
|
|
542
|
+
this.isConnected && (e ? d(this, o, Vt).call(this) : d(this, o, Et).call(this));
|
|
543
|
+
}), t(this, I).subscribe((e) => {
|
|
544
|
+
t(this, T).debounce = e.current, t(this, M).swipe = e.current, t(this, E).interval = e.current, this.isConnected && (e.current && !e.previous && !t(this, l).length ? d(this, o, Vt).call(this) : !e.current && e.previous && t(this, l).length && d(this, o, Et).call(this));
|
|
545
|
+
}), t(this, B).subscribe((e) => {
|
|
546
|
+
this.isConnected && (t(this, z).call(this), e.current && !e.previous && !t(this, l).length ? d(this, o, Vt).call(this) : !e.current && e.previous && t(this, l).length && d(this, o, Et).call(this));
|
|
513
547
|
}), t(this, D).subscribe((e) => {
|
|
514
|
-
|
|
515
|
-
}), t(this, H).subscribe((e) => {
|
|
516
|
-
this.isConnected && (t(this, z).call(this), e.current && !e.previous && !t(this, l).length ? d(this, o, At).call(this) : !e.current && e.previous && t(this, l).length && d(this, o, St).call(this));
|
|
517
|
-
}), t(this, A).subscribe((e) => {
|
|
518
|
-
this.isConnected && (t(this, z).call(this), d(this, o, rt).call(this));
|
|
548
|
+
this.isConnected && (t(this, z).call(this), d(this, o, ot).call(this));
|
|
519
549
|
}), t(this, C).subscribe((e) => {
|
|
520
|
-
e.current ? (this.isConnected && (t(this, l).length || (t(this,
|
|
521
|
-
}), t(this,
|
|
550
|
+
e.current ? (this.isConnected && (t(this, l).length || (t(this, H).current = !0)), t(this, l).length && (t(this, u).max = 1 / 0, t(this, u).min = -1 / 0)) : (h(this, Pt, 0), t(this, u).max = t(this, S), t(this, u).min = 0);
|
|
551
|
+
}), t(this, dt).subscribe((e) => {
|
|
522
552
|
t(this, u).damping = e.current;
|
|
523
|
-
}), t(this,
|
|
553
|
+
}), t(this, pt).subscribe((e) => {
|
|
524
554
|
t(this, u).mass = e.current;
|
|
525
|
-
}), t(this,
|
|
555
|
+
}), t(this, ft).subscribe((e) => {
|
|
526
556
|
t(this, u).stiffness = e.current;
|
|
527
557
|
}), t(this, k).subscribe((e) => {
|
|
528
|
-
t(this, E).speed = e.current, !t(this,
|
|
529
|
-
}), t(this,
|
|
558
|
+
t(this, E).speed = e.current, !t(this, st) && e.current && !e.previous ? t(this, E).connect() : !e.current && e.previous && t(this, E).disconnect();
|
|
559
|
+
}), t(this, j).subscribe((e) => {
|
|
530
560
|
e.current || (t(this, E).direction = 1);
|
|
531
|
-
}), t(this,
|
|
532
|
-
this.isConnected && d(this, o,
|
|
533
|
-
}), t(this,
|
|
534
|
-
this.isConnected && t(this,
|
|
535
|
-
}), t(this,
|
|
536
|
-
this.isConnected && t(this,
|
|
561
|
+
}), t(this, A).subscribe((e) => {
|
|
562
|
+
this.isConnected && d(this, o, ot).call(this);
|
|
563
|
+
}), t(this, J).subscribe((e) => {
|
|
564
|
+
this.isConnected && t(this, A).current && d(this, o, ot).call(this);
|
|
565
|
+
}), t(this, F).subscribe((e) => {
|
|
566
|
+
this.isConnected && t(this, A).current && d(this, o, ot).call(this);
|
|
537
567
|
}), t(this, u).isRunning.subscribe((e) => {
|
|
538
568
|
this.classList.toggle("active", e.current);
|
|
539
569
|
}), t(this, g).subscribe((e) => {
|
|
540
|
-
t(this, l).length && d(this, o,
|
|
570
|
+
t(this, l).length && d(this, o, ot).call(this);
|
|
541
571
|
}), t(this, $).subscribe((e) => {
|
|
542
|
-
t(this, $).isRunning.current && t(this, u).set(e.current);
|
|
543
|
-
}), t(this,
|
|
544
|
-
e.current && !e.previous ? d(this, o,
|
|
545
|
-
}), t(this,
|
|
546
|
-
e.current && !e.previous ? d(this, o,
|
|
547
|
-
}), t(this,
|
|
572
|
+
t(this, $).isRunning.current && t(this, u).set(e.current, { equalize: !0 });
|
|
573
|
+
}), t(this, St).subscribe((e) => {
|
|
574
|
+
e.current && !e.previous ? d(this, o, Kt).call(this) : !e.current && e.previous && d(this, o, _t).call(this);
|
|
575
|
+
}), t(this, X).subscribe((e) => {
|
|
576
|
+
e.current && !e.previous ? d(this, o, ee).call(this) : !e.current && e.previous && d(this, o, se).call(this);
|
|
577
|
+
}), t(this, at).observe(), t(this, P).observe(), t(this, O).observe(), t(this, R).observe(), t(this, H).observe(), t(this, I).observe(), t(this, K).observe(), t(this, _).observe(), t(this, B).observe(), t(this, Z).observe(), t(this, ut).observe(), t(this, D).observe(), t(this, C).observe(), t(this, dt).observe(), t(this, pt).observe(), t(this, ft).observe(), t(this, mt).observe(), t(this, wt).observe(), t(this, k).observe(), t(this, k).observe(), t(this, bt).observe(), t(this, j).observe(), t(this, A).observe(), t(this, J).observe(), t(this, F).observe(), t(this, Q).observe(), t(this, gt).observe(), t(this, St).observe(), t(this, X).observe(), t(this, X).current || d(this, o, se).call(this);
|
|
548
578
|
}
|
|
549
579
|
disconnectedCallback() {
|
|
550
|
-
this.removeAttribute("tabindex"), this.classList.remove("has-overflow"), t(this,
|
|
580
|
+
this.removeAttribute("tabindex"), this.classList.remove("has-overflow"), t(this, at).unobserve(), t(this, P).unobserve(), t(this, O).unobserve(), t(this, R).unobserve(), t(this, H).unobserve(), t(this, I).unobserve(), t(this, K).unobserve(), t(this, _).unobserve(), t(this, B).unobserve(), t(this, Z).unobserve(), t(this, ut).unobserve(), t(this, D).unobserve(), t(this, C).unobserve(), t(this, dt).unobserve(), t(this, pt).unobserve(), t(this, ft).unobserve(), t(this, mt).unobserve(), t(this, wt).unobserve(), t(this, k).unobserve(), t(this, bt).unobserve(), t(this, j).unobserve(), t(this, A).unobserve(), t(this, J).unobserve(), t(this, F).unobserve(), t(this, Q).unobserve(), t(this, gt).unobserve(), t(this, St).unobserve(), t(this, X).unobserve(), d(this, o, ee).call(this);
|
|
551
581
|
}
|
|
552
582
|
}
|
|
553
|
-
u = new WeakMap(),
|
|
554
|
-
d(this, o,
|
|
555
|
-
e instanceof HTMLElement && t(this, l).push(new
|
|
556
|
-
}), t(this, p).style.transform = "",
|
|
583
|
+
u = new WeakMap(), at = new WeakMap(), P = new WeakMap(), O = new WeakMap(), R = new WeakMap(), H = new WeakMap(), I = new WeakMap(), K = new WeakMap(), _ = new WeakMap(), B = new WeakMap(), Z = new WeakMap(), ut = new WeakMap(), D = new WeakMap(), C = new WeakMap(), dt = new WeakMap(), pt = new WeakMap(), ft = new WeakMap(), mt = new WeakMap(), wt = new WeakMap(), k = new WeakMap(), bt = new WeakMap(), j = new WeakMap(), A = new WeakMap(), J = new WeakMap(), F = new WeakMap(), Q = new WeakMap(), gt = new WeakMap(), St = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), p = new WeakMap(), xt = new WeakMap(), l = new WeakMap(), Ht = new WeakMap(), Bt = new WeakMap(), y = new WeakMap(), S = new WeakMap(), L = new WeakMap(), T = new WeakMap(), tt = new WeakMap(), M = new WeakMap(), E = new WeakMap(), g = new WeakMap(), Pt = new WeakMap(), et = new WeakMap(), W = new WeakMap(), st = new WeakMap(), vt = new WeakMap(), Lt = new WeakMap(), it = new WeakMap(), $ = new WeakMap(), o = new WeakSet(), Vt = function() {
|
|
584
|
+
d(this, o, Et).call(this), t(this, xt).assignedElements().forEach((e, i) => {
|
|
585
|
+
e instanceof HTMLElement && t(this, l).push(new Oe(e, i, this));
|
|
586
|
+
}), t(this, p).style.transform = "", Xt(this, "scrollSectionsChange", {
|
|
557
587
|
custom: !0,
|
|
558
588
|
composed: !0
|
|
559
|
-
}), t(this, z).call(this), d(this, o,
|
|
560
|
-
},
|
|
589
|
+
}), t(this, z).call(this), d(this, o, ot).call(this);
|
|
590
|
+
}, Et = function() {
|
|
561
591
|
t(this, l).forEach((e) => {
|
|
562
592
|
e.destroy();
|
|
563
|
-
}), h(this, l, []), t(this, g).reset(), t(this, u).reset(),
|
|
593
|
+
}), h(this, l, []), t(this, g).reset(), t(this, u).reset(), Xt(this, "scrollSectionsChange", {
|
|
564
594
|
custom: !0,
|
|
565
595
|
composed: !0
|
|
566
596
|
});
|
|
567
|
-
},
|
|
568
|
-
t(this,
|
|
597
|
+
}, Kt = function() {
|
|
598
|
+
t(this, st) || (h(this, st, !0), t(this, u).unsubscribe(t(this, zt)), t(this, u).unlistenAnimationFrame(), clearInterval(t(this, Lt)), clearInterval(t(this, it)), t(this, $).unlistenAnimationFrame(), t(this, T).disconnect(), t(this, tt).disconnect(), t(this, M).disconnect(), t(this, E).disconnect(), t(this, W) || this.sections.forEach((e) => {
|
|
569
599
|
e.unsetTransform();
|
|
570
600
|
}));
|
|
571
|
-
},
|
|
572
|
-
t(this,
|
|
573
|
-
},
|
|
574
|
-
t(this,
|
|
575
|
-
},
|
|
576
|
-
t(this,
|
|
577
|
-
}, z = new WeakMap(),
|
|
578
|
-
t(this, C).current ? (t(this, g).current = e % t(this, l).length, t(this, g).current = t(this, g).current < 0 ? t(this, l).length + t(this, g).current : t(this, g).current) : t(this, g).current =
|
|
579
|
-
},
|
|
580
|
-
t(this,
|
|
581
|
-
t(this,
|
|
601
|
+
}, _t = function() {
|
|
602
|
+
t(this, st) && (h(this, st, !1), t(this, u).subscribe(t(this, zt)), t(this, T).connect(), t(this, tt).connect(), t(this, M).connect(), t(this, k).current && t(this, E).connect());
|
|
603
|
+
}, ee = function() {
|
|
604
|
+
t(this, vt) || (h(this, vt, !0), Zt.unsubscribe(t(this, z)), jt.unsubscribe(t(this, z)), d(this, o, Kt).call(this), t(this, p).style.transform = "", t(this, l).length ? d(this, o, Et).call(this) : (t(this, g).reset(), t(this, u).reset()), lt.unregister(this));
|
|
605
|
+
}, se = function() {
|
|
606
|
+
t(this, vt) && (h(this, vt, !1), lt.register(this), (t(this, C).current || t(this, H).current || t(this, C).current || t(this, B).current || t(this, I).current) && d(this, o, Vt).call(this), d(this, o, _t).call(this), Zt.subscribe(t(this, z), fe.SCROLL), jt.subscribe(this, t(this, z)));
|
|
607
|
+
}, z = new WeakMap(), zt = new WeakMap(), be = function(e) {
|
|
608
|
+
t(this, C).current ? (t(this, g).current = e % t(this, l).length, t(this, g).current = t(this, g).current < 0 ? t(this, l).length + t(this, g).current : t(this, g).current) : t(this, g).current = pe(e, 0, this.limit);
|
|
609
|
+
}, kt = new WeakMap(), Ft = new WeakMap(), ie = function(e = 1) {
|
|
610
|
+
t(this, j).current && (t(this, E).direction = e), t(this, k).current && t(this, E).pauseAndContinue(
|
|
611
|
+
t(this, bt).current,
|
|
582
612
|
this.sectionalCSSProperty.current
|
|
583
613
|
);
|
|
584
|
-
},
|
|
614
|
+
}, re = function(e = "current") {
|
|
585
615
|
if (t(this, C).current && t(this, l).length) {
|
|
586
616
|
const i = t(this, u)[e] % (t(this, S) + t(this, y) + t(this, L));
|
|
587
617
|
return i < 0 ? t(this, S) + i + t(this, y) + t(this, L) : i;
|
|
588
618
|
} else
|
|
589
619
|
return t(this, u)[e];
|
|
590
|
-
},
|
|
591
|
-
if (t(this,
|
|
592
|
-
const e = t(this, g).current + t(this,
|
|
620
|
+
}, ot = function() {
|
|
621
|
+
if (t(this, A).current && t(this, l).length) {
|
|
622
|
+
const e = t(this, g).current + t(this, J).current;
|
|
593
623
|
e === 0 ? this.classList.add("start") : this.classList.remove("start"), e === this.limit ? this.classList.add("end") : this.classList.remove("end");
|
|
594
|
-
const i = t(this,
|
|
595
|
-
t(this, l).forEach((
|
|
596
|
-
const b = e - this.limit - 1 + t(this,
|
|
597
|
-
c >= e && c < x || c <= b ?
|
|
624
|
+
const i = t(this, D).current + t(this, F).current;
|
|
625
|
+
t(this, l).forEach((n, c) => {
|
|
626
|
+
const b = e - this.limit - 1 + t(this, F).current, x = e + i, Ct = this.sections.length - x;
|
|
627
|
+
c >= e && c < x || c <= b ? n.mark("current") : c >= x && c < x + Ct / 2 || c <= b + i ? n.mark("next") : n.mark("previous");
|
|
598
628
|
});
|
|
599
629
|
}
|
|
600
|
-
},
|
|
601
|
-
let
|
|
602
|
-
for (let
|
|
603
|
-
const
|
|
604
|
-
|
|
630
|
+
}, ne = function(e = this.targetScrollValue) {
|
|
631
|
+
let i = null, n = 1 / 0;
|
|
632
|
+
for (let c = 0; c < t(this, l).length; c++) {
|
|
633
|
+
const b = Math.abs(t(this, l)[c].position - e);
|
|
634
|
+
b < n && (n = b, i = c);
|
|
605
635
|
}
|
|
606
|
-
return
|
|
636
|
+
return i !== null ? t(this, l)[i] : null;
|
|
607
637
|
};
|
|
608
|
-
customElements.get("e-scroll") || customElements.define("e-scroll",
|
|
609
|
-
var
|
|
610
|
-
class
|
|
638
|
+
customElements.get("e-scroll") || customElements.define("e-scroll", Ot);
|
|
639
|
+
var Wt;
|
|
640
|
+
class he extends HTMLElement {
|
|
611
641
|
constructor() {
|
|
612
642
|
super(...arguments);
|
|
613
|
-
s(this,
|
|
643
|
+
s(this, Wt, null);
|
|
614
644
|
}
|
|
615
645
|
get scrollElement() {
|
|
616
|
-
return t(this,
|
|
646
|
+
return t(this, Wt);
|
|
617
647
|
}
|
|
618
648
|
connectedCallback() {
|
|
619
|
-
const e =
|
|
620
|
-
e instanceof
|
|
649
|
+
const e = me(this, Ot);
|
|
650
|
+
e instanceof Ot ? h(this, Wt, e) : console.error(this, "e-scroll not found");
|
|
621
651
|
}
|
|
622
652
|
}
|
|
623
|
-
|
|
624
|
-
var
|
|
625
|
-
class
|
|
653
|
+
Wt = new WeakMap();
|
|
654
|
+
var rt, w, q, N, It, Dt, yt, $t, qt, Nt;
|
|
655
|
+
class He extends he {
|
|
626
656
|
constructor() {
|
|
627
657
|
super();
|
|
628
|
-
s(this,
|
|
658
|
+
s(this, rt, null);
|
|
629
659
|
s(this, w, null);
|
|
630
|
-
s(this,
|
|
631
|
-
s(this,
|
|
632
|
-
s(this,
|
|
633
|
-
s(this,
|
|
634
|
-
s(this,
|
|
635
|
-
h(this,
|
|
636
|
-
const e = t(this,
|
|
637
|
-
h(this,
|
|
660
|
+
s(this, q, !1);
|
|
661
|
+
s(this, N, 0);
|
|
662
|
+
s(this, It, 0);
|
|
663
|
+
s(this, Dt, 0);
|
|
664
|
+
s(this, yt, () => {
|
|
665
|
+
h(this, q, this.offsetWidth > this.offsetHeight);
|
|
666
|
+
const e = t(this, q) ? this.offsetWidth : this.offsetHeight;
|
|
667
|
+
h(this, N, e / ((this.scrollElement.scrollSize + this.scrollElement.viewportSize) / e)), h(this, N, Math.max(t(this, N), 30)), t(this, q) ? (t(this, w).style.width = t(this, N) + "px", t(this, w).style.height = "100%") : (t(this, w).style.width = "100%", t(this, w).style.height = t(this, N) + "px"), h(this, It, e - t(this, N)), this.scrollElement.scrollSize || (this.style.display = "none");
|
|
638
668
|
});
|
|
639
|
-
s(this,
|
|
640
|
-
h(this,
|
|
669
|
+
s(this, $t, () => {
|
|
670
|
+
h(this, Dt, this.scrollElement.currentProgress * t(this, It)), t(this, q) ? t(this, w).style.transform = `translate3d(${t(this, Dt)}px, 0px, 0px)` : t(this, w).style.transform = `translate3d(0px, ${t(this, Dt)}px, 0px)`;
|
|
641
671
|
});
|
|
642
|
-
s(this,
|
|
672
|
+
s(this, qt, () => {
|
|
643
673
|
this.setAttribute("axis", this.scrollElement.axisCSSProperty.current);
|
|
644
674
|
});
|
|
645
|
-
s(this,
|
|
646
|
-
document.documentElement.classList.add("grabbing"),
|
|
675
|
+
s(this, Nt, (e) => {
|
|
676
|
+
document.documentElement.classList.add("grabbing"), Te(
|
|
647
677
|
(c) => {
|
|
648
|
-
const b = t(this,
|
|
649
|
-
this.scrollElement.setPosition(i +
|
|
678
|
+
const b = t(this, q) ? c.x : c.y, x = this.scrollElement.distance / t(this, It), Ct = (b - n) * x;
|
|
679
|
+
this.scrollElement.setPosition(i + Ct);
|
|
650
680
|
},
|
|
651
681
|
() => {
|
|
652
682
|
document.documentElement.classList.remove("grabbing");
|
|
653
683
|
}
|
|
654
684
|
);
|
|
655
|
-
const i = this.scrollElement.damped.target,
|
|
685
|
+
const i = this.scrollElement.damped.target, n = t(this, q) ? e.x : e.y;
|
|
656
686
|
});
|
|
657
|
-
if (
|
|
687
|
+
if (Jt) {
|
|
658
688
|
const e = this.attachShadow({ mode: "open" });
|
|
659
689
|
e.adoptedStyleSheets.push(
|
|
660
|
-
|
|
690
|
+
de({
|
|
661
691
|
":host": {
|
|
662
692
|
display: "inline-block",
|
|
663
693
|
zIndex: "1",
|
|
@@ -686,7 +716,7 @@ class Te extends se {
|
|
|
686
716
|
touchAction: "none"
|
|
687
717
|
}
|
|
688
718
|
})
|
|
689
|
-
), h(this,
|
|
719
|
+
), h(this, rt, document.createElement("slot")), t(this, rt).innerHTML = '<div class="default-thumb"></div>', e.appendChild(t(this, rt));
|
|
690
720
|
}
|
|
691
721
|
}
|
|
692
722
|
get thumbElement() {
|
|
@@ -694,111 +724,115 @@ class Te extends se {
|
|
|
694
724
|
}
|
|
695
725
|
connectedCallback() {
|
|
696
726
|
super.connectedCallback(), this.setAttribute("drag-dead-zone", "");
|
|
697
|
-
const e = t(this,
|
|
698
|
-
h(this, w, e), t(this, w).addEventListener("pointerdown", t(this,
|
|
727
|
+
const e = t(this, rt).assignedElements()[0] || t(this, rt).firstElementChild;
|
|
728
|
+
h(this, w, e), t(this, w).addEventListener("pointerdown", t(this, Nt)), Zt.subscribe(t(this, yt), fe.SCROLL), jt.subscribe(this, t(this, yt)), this.scrollElement.onScroll(t(this, $t)), this.scrollElement.axisCSSProperty.subscribe(t(this, qt));
|
|
699
729
|
}
|
|
700
730
|
disconnectedCallback() {
|
|
701
|
-
this.removeAttribute("drag-dead-zone"), t(this, w).removeEventListener("pointerdown", t(this,
|
|
731
|
+
this.removeAttribute("drag-dead-zone"), t(this, w).removeEventListener("pointerdown", t(this, Nt)), Zt.unsubscribe(t(this, yt)), jt.unsubscribe(t(this, yt)), this.scrollElement.offScroll(t(this, $t)), this.scrollElement.axisCSSProperty.unsubscribe(t(this, qt));
|
|
702
732
|
}
|
|
703
733
|
}
|
|
704
|
-
|
|
705
|
-
customElements.get("e-scrollbar") || customElements.define("e-scrollbar",
|
|
706
|
-
class
|
|
734
|
+
rt = new WeakMap(), w = new WeakMap(), q = new WeakMap(), N = new WeakMap(), It = new WeakMap(), Dt = new WeakMap(), yt = new WeakMap(), $t = new WeakMap(), qt = new WeakMap(), Nt = new WeakMap();
|
|
735
|
+
customElements.get("e-scrollbar") || customElements.define("e-scrollbar", He);
|
|
736
|
+
class ge extends he {
|
|
707
737
|
constructor() {
|
|
708
|
-
super(),
|
|
709
|
-
this.
|
|
738
|
+
super(), Jt && this.addEventListener("click", () => {
|
|
739
|
+
const r = this.getAttribute("behaviour"), e = this.getAttribute("easing") || void 0, i = e ? parseFloat(this.getAttribute("duration") || "0") : void 0;
|
|
740
|
+
this.handleClick({
|
|
741
|
+
behaviour: r,
|
|
742
|
+
tween: e ? { easing: e, duration: i } : void 0
|
|
743
|
+
});
|
|
710
744
|
});
|
|
711
745
|
}
|
|
712
746
|
}
|
|
713
|
-
class
|
|
714
|
-
handleClick() {
|
|
715
|
-
const
|
|
716
|
-
this.scrollElement.scrollToSection(parseInt(
|
|
747
|
+
class Be extends ge {
|
|
748
|
+
handleClick(r) {
|
|
749
|
+
const e = this.getAttribute("index");
|
|
750
|
+
this.scrollElement.scrollToSection(parseInt(e || "0"), r);
|
|
717
751
|
}
|
|
718
752
|
}
|
|
719
|
-
customElements.get("e-scroll-set-button") || customElements.define("e-scroll-set-button",
|
|
720
|
-
class
|
|
721
|
-
handleClick() {
|
|
722
|
-
const
|
|
723
|
-
this.scrollElement.shiftSections(parseInt(
|
|
753
|
+
customElements.get("e-scroll-set-button") || customElements.define("e-scroll-set-button", Be);
|
|
754
|
+
class Fe extends ge {
|
|
755
|
+
handleClick(r) {
|
|
756
|
+
const e = this.getAttribute("step");
|
|
757
|
+
this.scrollElement.shiftSections(parseInt(e || "1"), r);
|
|
724
758
|
}
|
|
725
759
|
}
|
|
726
|
-
customElements.get("e-scroll-step-button") || customElements.define("e-scroll-step-button",
|
|
727
|
-
var U,
|
|
728
|
-
class
|
|
729
|
-
constructor(
|
|
760
|
+
customElements.get("e-scroll-step-button") || customElements.define("e-scroll-step-button", Fe);
|
|
761
|
+
var U, nt, At, Ut, Gt, Tt;
|
|
762
|
+
class We {
|
|
763
|
+
constructor(r, e, i) {
|
|
730
764
|
s(this, U, null);
|
|
731
|
-
s(this,
|
|
732
|
-
s(this,
|
|
733
|
-
s(this,
|
|
734
|
-
s(this,
|
|
735
|
-
t(this,
|
|
736
|
-
behaviour: t(this,
|
|
765
|
+
s(this, nt, null);
|
|
766
|
+
s(this, At, null);
|
|
767
|
+
s(this, Ut, null);
|
|
768
|
+
s(this, Gt, () => {
|
|
769
|
+
t(this, nt).scrollToSection(t(this, At), {
|
|
770
|
+
behaviour: t(this, Ut)
|
|
737
771
|
});
|
|
738
772
|
});
|
|
739
|
-
s(this,
|
|
773
|
+
s(this, Tt, () => {
|
|
740
774
|
t(this, U).classList.toggle(
|
|
741
775
|
"current",
|
|
742
|
-
t(this,
|
|
776
|
+
t(this, nt).counter.current === t(this, At)
|
|
743
777
|
);
|
|
744
778
|
});
|
|
745
|
-
|
|
779
|
+
Jt && (h(this, U, document.createElement("button")), h(this, nt, r), h(this, Ut, i), h(this, At, e), t(this, U).addEventListener("click", t(this, Gt)), t(this, nt).counter.subscribe(t(this, Tt)), t(this, Tt).call(this));
|
|
746
780
|
}
|
|
747
781
|
get element() {
|
|
748
782
|
return t(this, U);
|
|
749
783
|
}
|
|
750
784
|
destroy() {
|
|
751
|
-
t(this, U).removeEventListener("click", t(this,
|
|
785
|
+
t(this, U).removeEventListener("click", t(this, Gt)), t(this, nt).counter.unsubscribe(t(this, Tt)), t(this, U).remove();
|
|
752
786
|
}
|
|
753
787
|
}
|
|
754
|
-
U = new WeakMap(),
|
|
755
|
-
var
|
|
756
|
-
class
|
|
788
|
+
U = new WeakMap(), nt = new WeakMap(), At = new WeakMap(), Ut = new WeakMap(), Gt = new WeakMap(), Tt = new WeakMap();
|
|
789
|
+
var ht, Mt;
|
|
790
|
+
class $e extends he {
|
|
757
791
|
constructor() {
|
|
758
792
|
super(...arguments);
|
|
759
|
-
s(this,
|
|
760
|
-
s(this,
|
|
761
|
-
t(this,
|
|
793
|
+
s(this, ht, []);
|
|
794
|
+
s(this, Mt, Me(() => {
|
|
795
|
+
t(this, ht).forEach((e) => e.destroy()), h(this, ht, []);
|
|
762
796
|
for (let e = 0; e < this.scrollElement.sections.length; e++) {
|
|
763
|
-
const i = new
|
|
797
|
+
const i = new We(
|
|
764
798
|
this.scrollElement,
|
|
765
799
|
e,
|
|
766
800
|
this.getAttribute("behaviour") || "smooth"
|
|
767
801
|
);
|
|
768
|
-
this.appendChild(i.element), t(this,
|
|
802
|
+
this.appendChild(i.element), t(this, ht).push(i);
|
|
769
803
|
}
|
|
770
804
|
}, 0));
|
|
771
805
|
}
|
|
772
806
|
connectedCallback() {
|
|
773
807
|
super.connectedCallback(), this.scrollElement.addEventListener(
|
|
774
808
|
"sectionsChange",
|
|
775
|
-
t(this,
|
|
776
|
-
), t(this,
|
|
809
|
+
t(this, Mt)
|
|
810
|
+
), t(this, Mt).call(this);
|
|
777
811
|
}
|
|
778
812
|
disconnectedCallback() {
|
|
779
813
|
this.scrollElement.removeEventListener(
|
|
780
814
|
"sectionsChange",
|
|
781
|
-
t(this,
|
|
782
|
-
), t(this,
|
|
815
|
+
t(this, Mt)
|
|
816
|
+
), t(this, ht).forEach((e) => e.destroy()), h(this, ht, []);
|
|
783
817
|
}
|
|
784
818
|
}
|
|
785
|
-
|
|
786
|
-
customElements.get("e-scroll-bullet-buttons") || customElements.define("e-scroll-bullet-buttons",
|
|
787
|
-
class
|
|
819
|
+
ht = new WeakMap(), Mt = new WeakMap();
|
|
820
|
+
customElements.get("e-scroll-bullet-buttons") || customElements.define("e-scroll-bullet-buttons", $e);
|
|
821
|
+
class qe extends Ve {
|
|
788
822
|
connectedCallback() {
|
|
789
|
-
const
|
|
790
|
-
|
|
823
|
+
const r = me(this, Ot);
|
|
824
|
+
r instanceof Ot ? (this.scrollContainer = r, this.scrollContainer.addEventListener(
|
|
791
825
|
"scrollSectionsChange",
|
|
792
826
|
this.findAnotherScrollEntries
|
|
793
827
|
)) : console.error(this, "e-scroll not found");
|
|
794
828
|
}
|
|
795
829
|
}
|
|
796
|
-
customElements.get("e-scroll-segment") || customElements.define("e-scroll-segment",
|
|
830
|
+
customElements.get("e-scroll-segment") || customElements.define("e-scroll-segment", qe);
|
|
797
831
|
export {
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
832
|
+
$e as ScrollBulletButtonsElement,
|
|
833
|
+
Ot as ScrollElement,
|
|
834
|
+
qe as ScrollSegmentElement,
|
|
835
|
+
Be as ScrollSetButtonElement,
|
|
836
|
+
Fe as ScrollStepButtonElement,
|
|
837
|
+
He as ScrollbarElement
|
|
804
838
|
};
|