aptechka 0.52.3 → 0.53.1
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/scroll/ScrollSection.d.ts +2 -0
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +375 -352
- package/package.json +1 -1
package/lib/scroll/index.js
CHANGED
|
@@ -1,64 +1,72 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var _e = Object.defineProperty;
|
|
2
|
+
var Oe = Object.getOwnPropertySymbols;
|
|
3
|
+
var Ze = Object.prototype.hasOwnProperty, je = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var $e = (d) => {
|
|
5
5
|
throw TypeError(d);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
7
|
+
var He = (d, n, e) => n in d ? _e(d, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[n] = e, Be = (d, n) => {
|
|
8
8
|
for (var e in n || (n = {}))
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
for (var e of
|
|
12
|
-
|
|
9
|
+
Ze.call(n, e) && He(d, e, n[e]);
|
|
10
|
+
if (Oe)
|
|
11
|
+
for (var e of Oe(n))
|
|
12
|
+
je.call(n, e) && He(d, e, n[e]);
|
|
13
13
|
return d;
|
|
14
14
|
};
|
|
15
|
-
var
|
|
16
|
-
var t = (d, n, e) => (
|
|
17
|
-
import { S as
|
|
15
|
+
var Pe = (d, n, e) => n.has(d) || $e("Cannot " + e);
|
|
16
|
+
var t = (d, n, e) => (Pe(d, n, "read from private field"), e ? e.call(d) : n.get(d)), s = (d, n, e) => n.has(d) ? $e("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(d) : n.set(d, e), h = (d, n, e, i) => (Pe(d, n, "write to private field"), i ? i.call(d, e) : n.set(d, e), e), c = (d, n, e) => (Pe(d, n, "access private method"), e);
|
|
17
|
+
import { S as Je } from "../Store-swP_0ymB.js";
|
|
18
18
|
import { i as H } from "../index-euf5anj6.js";
|
|
19
|
-
import { q as
|
|
20
|
-
import { d as
|
|
21
|
-
import { d as
|
|
22
|
-
import { c as
|
|
23
|
-
import { a as
|
|
24
|
-
import { c as
|
|
25
|
-
import { p as
|
|
19
|
+
import { q as Qe } from "../easings-BEmRlrDd.js";
|
|
20
|
+
import { d as ie } from "../events-CsVF98U6.js";
|
|
21
|
+
import { d as Le } from "../function-C10DGppn.js";
|
|
22
|
+
import { c as Fe } from "../jss-DtnXPEnq.js";
|
|
23
|
+
import { a as ze, g as Ie } from "../layout-DpZo-I0y.js";
|
|
24
|
+
import { c as Ne } from "../math-BOBiC4TN.js";
|
|
25
|
+
import { p as Xe, l as Ye } from "../number-DwCxt_Ck.js";
|
|
26
26
|
import "../ticker/index.js";
|
|
27
|
-
import { TICK_ORDER as
|
|
28
|
-
import { D as
|
|
29
|
-
import { T as
|
|
30
|
-
import { WheelControls as
|
|
31
|
-
import { windowResizer as
|
|
27
|
+
import { TICK_ORDER as ts, RESIZE_ORDER as ke } from "../order/index.js";
|
|
28
|
+
import { D as es } from "../Damped-GyAS-U-z.js";
|
|
29
|
+
import { T as ss } from "../Tweened-BWPx3jJR.js";
|
|
30
|
+
import { WheelControls as is, KeyboardControls as rs, DragControls as ns, AutoplayControls as hs } from "../controls/index.js";
|
|
31
|
+
import { windowResizer as Ot } from "../window-resizer/index.js";
|
|
32
32
|
import { scrollEntries as vt } from "../scroll-entries/index.js";
|
|
33
|
-
import { cssUnitParser as
|
|
34
|
-
import { CSSProperty as
|
|
35
|
-
import { device as
|
|
36
|
-
import { elementResizer as
|
|
37
|
-
import { s as
|
|
38
|
-
import { b as
|
|
39
|
-
import { ScrollSegmentElement as
|
|
40
|
-
var
|
|
41
|
-
class
|
|
33
|
+
import { cssUnitParser as We } from "../css-unit-parser/index.js";
|
|
34
|
+
import { CSSProperty as f } from "../css-property/index.js";
|
|
35
|
+
import { device as os } from "../device/index.js";
|
|
36
|
+
import { elementResizer as oe } from "../element-resizer/index.js";
|
|
37
|
+
import { s as ls } from "../gestures-CcXV6fCp.js";
|
|
38
|
+
import { b as qe } from "../dom-CVWzyXPH.js";
|
|
39
|
+
import { ScrollSegmentElement as cs } from "../scroll-segment/index.js";
|
|
40
|
+
var p, $t, g, le, ce, yt, $, et, Ct, xt, re;
|
|
41
|
+
class as {
|
|
42
42
|
constructor(n, e, i) {
|
|
43
|
-
s(this,
|
|
44
|
-
s(this,
|
|
45
|
-
s(this,
|
|
43
|
+
s(this, xt);
|
|
44
|
+
s(this, p);
|
|
45
|
+
s(this, $t);
|
|
46
46
|
s(this, g);
|
|
47
|
+
s(this, le, 0);
|
|
48
|
+
s(this, ce, 0);
|
|
47
49
|
s(this, yt, 0);
|
|
48
50
|
s(this, $, 0);
|
|
49
|
-
s(this,
|
|
51
|
+
s(this, et, null);
|
|
50
52
|
s(this, Ct, 0);
|
|
51
|
-
h(this,
|
|
53
|
+
h(this, p, n), h(this, $t, e), h(this, g, i), vt.register(t(this, p)), this.setIndex(t(this, $t));
|
|
52
54
|
}
|
|
53
55
|
get element() {
|
|
54
|
-
return t(this,
|
|
56
|
+
return t(this, p);
|
|
55
57
|
}
|
|
56
58
|
get index() {
|
|
57
|
-
return t(this,
|
|
59
|
+
return t(this, $t);
|
|
58
60
|
}
|
|
59
61
|
get size() {
|
|
60
62
|
return t(this, yt);
|
|
61
63
|
}
|
|
64
|
+
get width() {
|
|
65
|
+
return t(this, le);
|
|
66
|
+
}
|
|
67
|
+
get height() {
|
|
68
|
+
return t(this, ce);
|
|
69
|
+
}
|
|
62
70
|
get position() {
|
|
63
71
|
return t(this, $);
|
|
64
72
|
}
|
|
@@ -66,58 +74,58 @@ class ns {
|
|
|
66
74
|
return t(this, Ct);
|
|
67
75
|
}
|
|
68
76
|
destroy() {
|
|
69
|
-
vt.unregister(t(this,
|
|
77
|
+
vt.unregister(t(this, p)), this.unsetTransform();
|
|
70
78
|
}
|
|
71
79
|
unsetTransform() {
|
|
72
|
-
t(this,
|
|
80
|
+
t(this, p).style.transform = "", this.setMark(null), this.setIndex(null), this.setCurrentIndex(null), this.setCurrentIndexArc(null), this.setCurrentIndexArcAbs(null), this.setMiddle(!1), this.setSize();
|
|
73
81
|
}
|
|
74
82
|
setSize(n) {
|
|
75
|
-
n ? (t(this,
|
|
83
|
+
n ? (t(this, p).style.setProperty("--size", n + "px"), t(this, g).axisCSSProperty.current === "x" ? (t(this, p).style.width = n + "px", t(this, p).style.height = "") : (t(this, p).style.height = n + "px", t(this, p).style.width = "")) : (t(this, p).style.width = "", t(this, p).style.height = "", t(this, p).style.removeProperty("--size"));
|
|
76
84
|
}
|
|
77
85
|
resize() {
|
|
78
|
-
h(this, yt, t(this, g).vertical ? t(this,
|
|
86
|
+
h(this, le, t(this, p).offsetWidth), h(this, ce, t(this, p).offsetHeight), h(this, yt, t(this, g).vertical ? t(this, p).offsetHeight : t(this, p).offsetWidth), h(this, $, t(this, g).vertical ? ze(t(this, p)) : Ie(t(this, p))), h(this, $, t(this, $) - t(this, g).contentPosition);
|
|
79
87
|
}
|
|
80
88
|
transform() {
|
|
81
89
|
const n = t(this, g).shiftSectionPositionCSSProperty.current;
|
|
82
90
|
let e = n;
|
|
83
91
|
const i = t(this, g).viewportSize * t(this, g).sectionDistanceScaleCSSProperty.current;
|
|
84
92
|
t(this, g).loopCSSProperty.current && t(this, $) + t(this, yt) <= t(this, g).currentScrollValue - n / 2 && (e = (t(this, g).distance - n) * -1 - t(this, g).gap), vt.update(
|
|
85
|
-
t(this,
|
|
93
|
+
t(this, p),
|
|
86
94
|
t(this, g).axisCSSProperty.current,
|
|
87
95
|
e
|
|
88
96
|
);
|
|
89
|
-
const r = t(this, g).currentScrollValue + e, a = t(this, $) - t(this, g).viewportSize - i,
|
|
90
|
-
h(this, Ct, v * -1), t(this, g).vertical ? t(this,
|
|
97
|
+
const r = t(this, g).currentScrollValue + e, a = t(this, $) - t(this, g).viewportSize - i, b = t(this, $) + t(this, yt) + i, v = Xe(Ne(r, a, b), 3);
|
|
98
|
+
h(this, Ct, v * -1), t(this, g).vertical ? t(this, p).style.transform = `translate3d(0px, ${t(this, Ct)}px, 0px)` : t(this, p).style.transform = `translate3d(${t(this, Ct)}px, 0px, 0px)`;
|
|
91
99
|
}
|
|
92
100
|
setMark(n) {
|
|
93
|
-
t(this,
|
|
101
|
+
t(this, et) !== n && (t(this, et) && t(this, p).classList.remove(t(this, et)), n && t(this, p).classList.add(n), h(this, et, n), ie(t(this, p), "scrollSectionMarkChange", {
|
|
94
102
|
composed: !0,
|
|
95
103
|
detail: {
|
|
96
|
-
mark: t(this,
|
|
104
|
+
mark: t(this, et)
|
|
97
105
|
},
|
|
98
106
|
custom: !0
|
|
99
107
|
}));
|
|
100
108
|
}
|
|
101
109
|
setMiddle(n) {
|
|
102
|
-
t(this,
|
|
110
|
+
t(this, p).classList.toggle("middle", n);
|
|
103
111
|
}
|
|
104
112
|
setIndex(n) {
|
|
105
|
-
c(this,
|
|
113
|
+
c(this, xt, re).call(this, "index", n);
|
|
106
114
|
}
|
|
107
115
|
setCurrentIndex(n) {
|
|
108
|
-
c(this,
|
|
116
|
+
c(this, xt, re).call(this, "current-index", n);
|
|
109
117
|
}
|
|
110
118
|
setCurrentIndexArc(n) {
|
|
111
|
-
c(this,
|
|
119
|
+
c(this, xt, re).call(this, "current-index-arc", n);
|
|
112
120
|
}
|
|
113
121
|
setCurrentIndexArcAbs(n) {
|
|
114
|
-
c(this,
|
|
122
|
+
c(this, xt, re).call(this, "current-index-arc-abs", n);
|
|
115
123
|
}
|
|
116
124
|
}
|
|
117
|
-
|
|
118
|
-
e !== null ? (t(this,
|
|
125
|
+
p = new WeakMap(), $t = new WeakMap(), g = new WeakMap(), le = new WeakMap(), ce = new WeakMap(), yt = new WeakMap(), $ = new WeakMap(), et = new WeakMap(), Ct = new WeakMap(), xt = new WeakSet(), re = function(n, e) {
|
|
126
|
+
e !== null ? (t(this, p).style.setProperty(`--${n}`, e.toString()), t(this, p).setAttribute(`data-${n}`, e.toString())) : (t(this, p).style.removeProperty(`--${n}`), t(this, p).removeAttribute(`data-${n}`));
|
|
119
127
|
};
|
|
120
|
-
const
|
|
128
|
+
const us = Fe({
|
|
121
129
|
":host": {
|
|
122
130
|
position: "relative",
|
|
123
131
|
width: "100%",
|
|
@@ -155,180 +163,195 @@ const hs = Oe({
|
|
|
155
163
|
flexShrink: "0"
|
|
156
164
|
}
|
|
157
165
|
});
|
|
158
|
-
var u,
|
|
159
|
-
class
|
|
166
|
+
var u, Et, w, st, B, W, F, T, it, rt, N, nt, wt, D, C, Pt, Lt, zt, It, Bt, A, kt, ht, M, ot, q, At, lt, Mt, ct, at, ut, m, Wt, l, ae, ue, y, S, k, V, dt, R, E, P, Ft, U, G, K, _, Nt, ft, Z, qt, O, x, Ut, j, Tt, Gt, o, Ae, ne, Rt, xe, Ee, Me, Te, L, de, Ue, Kt, fe, De, Ve, gt, Ge, pe, he, me;
|
|
167
|
+
class Ht extends HTMLElement {
|
|
160
168
|
constructor() {
|
|
161
169
|
super();
|
|
162
170
|
s(this, o);
|
|
163
171
|
s(this, u, null);
|
|
164
|
-
s(this,
|
|
165
|
-
s(this,
|
|
166
|
-
s(this,
|
|
167
|
-
s(this, B, new
|
|
168
|
-
s(this, W, new
|
|
172
|
+
s(this, Et, new f(this, "--controls", !0));
|
|
173
|
+
s(this, w, new f(this, "--axis", "y"));
|
|
174
|
+
s(this, st, new f(this, "--reverse", !1));
|
|
175
|
+
s(this, B, new f(this, "--direction", 0));
|
|
176
|
+
s(this, W, new f(this, "--pages", 0, {
|
|
169
177
|
validate: (e) => Math.max(0, e - 1)
|
|
170
178
|
}));
|
|
171
|
-
s(this, F, new
|
|
172
|
-
s(this, T, new
|
|
173
|
-
s(this,
|
|
179
|
+
s(this, F, new f(this, "--split", !1));
|
|
180
|
+
s(this, T, new f(this, "--sectional", !1));
|
|
181
|
+
s(this, it, new f(
|
|
174
182
|
this,
|
|
175
183
|
"--tween-easing",
|
|
176
184
|
!1
|
|
177
185
|
));
|
|
178
|
-
s(this,
|
|
186
|
+
s(this, rt, new f(
|
|
179
187
|
this,
|
|
180
188
|
"--tween-duration",
|
|
181
189
|
!1
|
|
182
190
|
));
|
|
183
|
-
s(this, N, new
|
|
184
|
-
s(this,
|
|
191
|
+
s(this, N, new f(this, "--auto-size", !1));
|
|
192
|
+
s(this, nt, new f(
|
|
185
193
|
this,
|
|
186
194
|
"--wheel-max-delta",
|
|
187
195
|
!1
|
|
188
196
|
));
|
|
189
|
-
s(this,
|
|
190
|
-
s(this, D, new
|
|
197
|
+
s(this, wt, new f(this, "--drag-inertion", 1));
|
|
198
|
+
s(this, D, new f(
|
|
191
199
|
this,
|
|
192
200
|
"--sections-in-view",
|
|
193
201
|
1
|
|
194
202
|
));
|
|
195
|
-
s(this, C, new
|
|
196
|
-
s(this, Pt, new
|
|
197
|
-
s(this, Lt, new
|
|
198
|
-
s(this, zt, new
|
|
199
|
-
s(this, It, new
|
|
200
|
-
s(this,
|
|
203
|
+
s(this, C, new f(this, "--loop", !1));
|
|
204
|
+
s(this, Pt, new f(this, "--damping", 20));
|
|
205
|
+
s(this, Lt, new f(this, "--mass", 0));
|
|
206
|
+
s(this, zt, new f(this, "--stiffness", 0));
|
|
207
|
+
s(this, It, new f(this, "--mouse-drag", !1));
|
|
208
|
+
s(this, Bt, new f(
|
|
201
209
|
this,
|
|
202
210
|
"--section-distance-scale",
|
|
203
211
|
0.5
|
|
204
212
|
));
|
|
205
|
-
s(this, A, new
|
|
206
|
-
s(this, kt, new
|
|
213
|
+
s(this, A, new f(this, "--autoplay", 0));
|
|
214
|
+
s(this, kt, new f(
|
|
207
215
|
this,
|
|
208
216
|
"--autoplay-pause-duration",
|
|
209
217
|
0
|
|
210
218
|
));
|
|
211
|
-
s(this,
|
|
219
|
+
s(this, ht, new f(
|
|
212
220
|
this,
|
|
213
221
|
"--autoplay-user-direction",
|
|
214
222
|
!1
|
|
215
223
|
));
|
|
216
|
-
s(this, M, new
|
|
217
|
-
s(this,
|
|
224
|
+
s(this, M, new f(this, "--classes", !1));
|
|
225
|
+
s(this, ot, new f(
|
|
218
226
|
this,
|
|
219
227
|
"--current-index-start-offset",
|
|
220
228
|
0
|
|
221
229
|
));
|
|
222
|
-
s(this, q, new
|
|
230
|
+
s(this, q, new f(
|
|
223
231
|
this,
|
|
224
232
|
"--current-index-end-offset",
|
|
225
233
|
0
|
|
226
234
|
));
|
|
227
|
-
s(this, At, new
|
|
235
|
+
s(this, At, new f(
|
|
228
236
|
this,
|
|
229
237
|
"--shift-section-position",
|
|
230
238
|
0,
|
|
231
239
|
{ rawValueCheck: !1 }
|
|
232
240
|
));
|
|
233
|
-
s(this,
|
|
234
|
-
s(this, Mt, new
|
|
241
|
+
s(this, lt, new f(this, "--focus-delay", 0));
|
|
242
|
+
s(this, Mt, new f(
|
|
235
243
|
this,
|
|
236
244
|
"--focus-duration",
|
|
237
245
|
3e3
|
|
238
246
|
));
|
|
239
|
-
s(this,
|
|
240
|
-
s(this,
|
|
241
|
-
s(this,
|
|
242
|
-
s(this,
|
|
243
|
-
s(this,
|
|
247
|
+
s(this, ct, new f(this, "--disabled", !1));
|
|
248
|
+
s(this, at, new f(this, "--hibernate", !1));
|
|
249
|
+
s(this, ut, null);
|
|
250
|
+
s(this, m, null);
|
|
251
|
+
s(this, Wt, null);
|
|
244
252
|
s(this, l, []);
|
|
245
|
-
s(this,
|
|
246
|
-
s(this,
|
|
253
|
+
s(this, ae, 0);
|
|
254
|
+
s(this, ue, 0);
|
|
247
255
|
s(this, y, 0);
|
|
248
256
|
s(this, S, 0);
|
|
249
257
|
s(this, k, 0);
|
|
250
258
|
s(this, V, null);
|
|
251
|
-
s(this,
|
|
259
|
+
s(this, dt, null);
|
|
252
260
|
s(this, R, null);
|
|
253
|
-
s(this,
|
|
254
|
-
s(this, P, new
|
|
255
|
-
s(this,
|
|
261
|
+
s(this, E, null);
|
|
262
|
+
s(this, P, new Je(0));
|
|
263
|
+
s(this, Ft, 0);
|
|
256
264
|
s(this, U, 0);
|
|
257
265
|
s(this, G, !1);
|
|
258
266
|
s(this, K, !0);
|
|
259
267
|
s(this, _, !0);
|
|
260
|
-
s(this,
|
|
261
|
-
s(this,
|
|
262
|
-
s(this, Z, new
|
|
263
|
-
s(this,
|
|
268
|
+
s(this, Nt);
|
|
269
|
+
s(this, ft);
|
|
270
|
+
s(this, Z, new ss());
|
|
271
|
+
s(this, qt, !1);
|
|
264
272
|
s(this, O, null);
|
|
265
|
-
s(this,
|
|
266
|
-
s(this,
|
|
267
|
-
s(this,
|
|
268
|
-
s(this,
|
|
273
|
+
s(this, x, !1);
|
|
274
|
+
s(this, Ut, null);
|
|
275
|
+
s(this, j, []);
|
|
276
|
+
s(this, Tt, !1);
|
|
277
|
+
s(this, Gt);
|
|
278
|
+
s(this, L, (e) => {
|
|
279
|
+
if (e && t(this, Tt)) {
|
|
280
|
+
h(this, Tt, !1);
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
269
283
|
this.resize();
|
|
270
284
|
});
|
|
271
|
-
s(this,
|
|
285
|
+
s(this, de, () => {
|
|
272
286
|
if (!t(this, G) || t(this, _) || t(this, K))
|
|
273
287
|
return;
|
|
274
288
|
const e = this.currentScrollValue;
|
|
275
|
-
if (h(this,
|
|
289
|
+
if (h(this, Ft, Math.max(0, e - t(this, S))), t(this, l).length) {
|
|
276
290
|
for (let i = 0; i < t(this, l).length; i++)
|
|
277
291
|
t(this, l)[i].transform();
|
|
278
|
-
t(this, P).current = c(this, o,
|
|
292
|
+
t(this, P).current = c(this, o, he).call(this);
|
|
279
293
|
} else
|
|
280
|
-
this.vertical ? t(this,
|
|
281
|
-
c(this, o,
|
|
294
|
+
this.vertical ? t(this, m).style.transform = `translate3d(0px, ${e * -1}px, 0px)` : t(this, m).style.transform = `translate3d(${e * -1}px, 0px, 0px)`;
|
|
295
|
+
c(this, o, Ge).call(this), vt.update(
|
|
282
296
|
this,
|
|
283
|
-
t(this,
|
|
297
|
+
t(this, w).current,
|
|
284
298
|
e
|
|
285
299
|
);
|
|
286
300
|
});
|
|
287
|
-
s(this,
|
|
288
|
-
t(this,
|
|
301
|
+
s(this, Kt, (e, i) => {
|
|
302
|
+
t(this, Et).current && (c(this, o, De).call(this, Math.sign(i) || 1), t(this, fe).call(this, e, i));
|
|
289
303
|
});
|
|
290
|
-
s(this,
|
|
304
|
+
s(this, fe, (e, i) => {
|
|
291
305
|
if (t(this, B).current) {
|
|
292
306
|
if (t(this, B).current < 0 && i > 0)
|
|
293
307
|
return;
|
|
294
308
|
if (t(this, B).current > 0 && i < 0)
|
|
295
309
|
return;
|
|
296
310
|
}
|
|
297
|
-
if (t(this,
|
|
298
|
-
const r = t(this, l)[c(this, o,
|
|
311
|
+
if (t(this, ft) || t(this, Z).unlistenAnimationFrame(), !t(this, A).current && t(this, lt).current && (clearInterval(t(this, Nt)), h(this, Nt, setTimeout(() => {
|
|
312
|
+
const r = t(this, l)[c(this, o, he).call(this)];
|
|
299
313
|
r && this.scrollToSection(r.index, {
|
|
300
314
|
tween: {
|
|
301
315
|
duration: t(this, Mt).current,
|
|
302
|
-
easing:
|
|
316
|
+
easing: Qe
|
|
303
317
|
}
|
|
304
318
|
});
|
|
305
|
-
}, t(this,
|
|
319
|
+
}, t(this, lt).current))), !(e.includes("drag") && !os.isTouch && !t(this, It).current)) {
|
|
306
320
|
if (t(this, T).current && e !== "drag") {
|
|
307
321
|
const r = Math.sign(i);
|
|
308
322
|
if (t(this, l).length) {
|
|
309
323
|
const a = {
|
|
310
|
-
tween: t(this,
|
|
311
|
-
easing: t(this,
|
|
312
|
-
duration: t(this,
|
|
324
|
+
tween: t(this, it).current || t(this, rt).current ? {
|
|
325
|
+
easing: t(this, it).current || "easeInOutCubic",
|
|
326
|
+
duration: t(this, rt).current || 500
|
|
313
327
|
} : void 0
|
|
314
328
|
};
|
|
315
|
-
t(this,
|
|
329
|
+
t(this, qt) ? this.scrollToSection(c(this, o, he).call(this, !0), a) : this.shiftSections(r, a);
|
|
316
330
|
} else
|
|
317
331
|
t(this, u).shift(r * t(this, y));
|
|
318
332
|
} else
|
|
319
333
|
t(this, u).shift(i);
|
|
320
|
-
h(this,
|
|
334
|
+
h(this, qt, e === "drag");
|
|
321
335
|
}
|
|
322
336
|
});
|
|
323
|
-
s(this,
|
|
324
|
-
|
|
337
|
+
s(this, pe, Le(() => {
|
|
338
|
+
const e = t(this, j).reduce((i, r) => {
|
|
339
|
+
const a = this.vertical ? r.width : r.height;
|
|
340
|
+
return a > i ? a : i;
|
|
341
|
+
}, 0);
|
|
342
|
+
clearTimeout(t(this, Gt)), h(this, Tt, !0), this.style.setProperty("--max-section-size", ""), h(this, Gt, setTimeout(() => {
|
|
343
|
+
h(this, Tt, !0), this.style.setProperty("--max-section-size", e + "px");
|
|
344
|
+
}, 10));
|
|
345
|
+
}, 20));
|
|
346
|
+
s(this, me, () => {
|
|
347
|
+
h(this, x, !0), this.hibernatedCSSProperty.current || c(this, o, Te).call(this);
|
|
325
348
|
});
|
|
326
349
|
if (H) {
|
|
327
350
|
const e = this.attachShadow({ mode: "open" });
|
|
328
|
-
e.adoptedStyleSheets = [
|
|
351
|
+
e.adoptedStyleSheets = [us];
|
|
329
352
|
const i = document.createElement("div");
|
|
330
|
-
i.className = "static", i.innerHTML = '<slot name="static"></slot>', e.appendChild(i), h(this,
|
|
331
|
-
|
|
353
|
+
i.className = "static", i.innerHTML = '<slot name="static"></slot>', e.appendChild(i), h(this, ut, document.createElement("div")), t(this, ut).className = "content-wrapper", h(this, m, document.createElement("div")), t(this, m).className = "content", h(this, Wt, document.createElement("slot")), t(this, m).appendChild(t(this, Wt)), t(this, ut).appendChild(t(this, m)), e.appendChild(t(this, ut)), h(this, Ut, new MutationObserver(
|
|
354
|
+
Le(() => {
|
|
332
355
|
this.tryResplit();
|
|
333
356
|
}, 10)
|
|
334
357
|
));
|
|
@@ -338,13 +361,13 @@ class Ot extends HTMLElement {
|
|
|
338
361
|
return t(this, u);
|
|
339
362
|
}
|
|
340
363
|
get controlsCSSProperty() {
|
|
341
|
-
return t(this,
|
|
364
|
+
return t(this, Et);
|
|
342
365
|
}
|
|
343
366
|
get axisCSSProperty() {
|
|
344
|
-
return t(this,
|
|
367
|
+
return t(this, w);
|
|
345
368
|
}
|
|
346
369
|
get reverseCSSProperty() {
|
|
347
|
-
return t(this,
|
|
370
|
+
return t(this, st);
|
|
348
371
|
}
|
|
349
372
|
get directionCSSProperty() {
|
|
350
373
|
return t(this, B);
|
|
@@ -359,19 +382,19 @@ class Ot extends HTMLElement {
|
|
|
359
382
|
return t(this, T);
|
|
360
383
|
}
|
|
361
384
|
get easingCSSProperty() {
|
|
362
|
-
return t(this,
|
|
385
|
+
return t(this, it);
|
|
363
386
|
}
|
|
364
387
|
get durationCSSProperty() {
|
|
365
|
-
return t(this,
|
|
388
|
+
return t(this, rt);
|
|
366
389
|
}
|
|
367
390
|
get autoSizeCSSProperty() {
|
|
368
391
|
return t(this, N);
|
|
369
392
|
}
|
|
370
393
|
get wheelMaxDeltaCSSProperty() {
|
|
371
|
-
return t(this,
|
|
394
|
+
return t(this, nt);
|
|
372
395
|
}
|
|
373
396
|
get dragInertionCSSProperty() {
|
|
374
|
-
return t(this,
|
|
397
|
+
return t(this, wt);
|
|
375
398
|
}
|
|
376
399
|
get sectionsInViewCSSProperty() {
|
|
377
400
|
return t(this, D);
|
|
@@ -392,7 +415,7 @@ class Ot extends HTMLElement {
|
|
|
392
415
|
return t(this, It);
|
|
393
416
|
}
|
|
394
417
|
get sectionDistanceScaleCSSProperty() {
|
|
395
|
-
return t(this,
|
|
418
|
+
return t(this, Bt);
|
|
396
419
|
}
|
|
397
420
|
get autoplayCSSProperty() {
|
|
398
421
|
return t(this, A);
|
|
@@ -401,13 +424,13 @@ class Ot extends HTMLElement {
|
|
|
401
424
|
return t(this, kt);
|
|
402
425
|
}
|
|
403
426
|
get autoplayUserDirectionCSSProperty() {
|
|
404
|
-
return t(this,
|
|
427
|
+
return t(this, ht);
|
|
405
428
|
}
|
|
406
429
|
get classesCSSProperty() {
|
|
407
430
|
return t(this, M);
|
|
408
431
|
}
|
|
409
432
|
get currentIndexStartOffsetCSSProperty() {
|
|
410
|
-
return t(this,
|
|
433
|
+
return t(this, ot);
|
|
411
434
|
}
|
|
412
435
|
get currentIndexEndOffsetCSSProperty() {
|
|
413
436
|
return t(this, q);
|
|
@@ -416,37 +439,37 @@ class Ot extends HTMLElement {
|
|
|
416
439
|
return t(this, At);
|
|
417
440
|
}
|
|
418
441
|
get focusDelayCSSProperty() {
|
|
419
|
-
return t(this,
|
|
442
|
+
return t(this, lt);
|
|
420
443
|
}
|
|
421
444
|
get focusDurationCSSProperty() {
|
|
422
445
|
return t(this, Mt);
|
|
423
446
|
}
|
|
424
447
|
get disabledCSSProperty() {
|
|
425
|
-
return t(this,
|
|
448
|
+
return t(this, ct);
|
|
426
449
|
}
|
|
427
450
|
get hibernatedCSSProperty() {
|
|
428
|
-
return t(this,
|
|
451
|
+
return t(this, at);
|
|
429
452
|
}
|
|
430
453
|
get currentScrollValue() {
|
|
431
|
-
return c(this, o,
|
|
454
|
+
return c(this, o, Ve).call(this, "current");
|
|
432
455
|
}
|
|
433
456
|
get targetScrollValue() {
|
|
434
|
-
return c(this, o,
|
|
457
|
+
return c(this, o, Ve).call(this, "target");
|
|
435
458
|
}
|
|
436
459
|
get contentWrapperElement() {
|
|
437
|
-
return t(this,
|
|
460
|
+
return t(this, ut);
|
|
438
461
|
}
|
|
439
462
|
get contentElement() {
|
|
440
|
-
return t(this,
|
|
463
|
+
return t(this, m);
|
|
441
464
|
}
|
|
442
465
|
get sections() {
|
|
443
466
|
return t(this, l);
|
|
444
467
|
}
|
|
445
468
|
get position() {
|
|
446
|
-
return t(this,
|
|
469
|
+
return t(this, ae);
|
|
447
470
|
}
|
|
448
471
|
get contentPosition() {
|
|
449
|
-
return t(this,
|
|
472
|
+
return t(this, ue);
|
|
450
473
|
}
|
|
451
474
|
get viewportSize() {
|
|
452
475
|
return t(this, y);
|
|
@@ -475,13 +498,13 @@ class Ot extends HTMLElement {
|
|
|
475
498
|
return t(this, G);
|
|
476
499
|
}
|
|
477
500
|
get overscroll() {
|
|
478
|
-
return t(this,
|
|
501
|
+
return t(this, Ft);
|
|
479
502
|
}
|
|
480
503
|
get scrollLine() {
|
|
481
504
|
return t(this, O);
|
|
482
505
|
}
|
|
483
506
|
get vertical() {
|
|
484
|
-
return t(this,
|
|
507
|
+
return t(this, w).current === "y";
|
|
485
508
|
}
|
|
486
509
|
get currentProgress() {
|
|
487
510
|
return this.currentScrollValue / this.loopDistance || 0;
|
|
@@ -490,13 +513,13 @@ class Ot extends HTMLElement {
|
|
|
490
513
|
return this.targetScrollValue / this.loopDistance || 0;
|
|
491
514
|
}
|
|
492
515
|
get scrollWidth() {
|
|
493
|
-
return t(this,
|
|
516
|
+
return t(this, w).current === "y" ? 0 : t(this, u).distance;
|
|
494
517
|
}
|
|
495
518
|
get scrollHeight() {
|
|
496
|
-
return t(this,
|
|
519
|
+
return t(this, w).current === "x" ? 0 : t(this, u).distance;
|
|
497
520
|
}
|
|
498
521
|
tryResplit() {
|
|
499
|
-
!t(this, _) && (t(this, C).current || t(this, F).current || t(this, C).current || t(this, N).current || t(this, T).current) && c(this, o,
|
|
522
|
+
!t(this, _) && (t(this, C).current || t(this, F).current || t(this, C).current || t(this, N).current || t(this, T).current) && c(this, o, ne).call(this);
|
|
500
523
|
}
|
|
501
524
|
onScroll(...e) {
|
|
502
525
|
return t(this, u).subscribe(...e);
|
|
@@ -506,32 +529,32 @@ class Ot extends HTMLElement {
|
|
|
506
529
|
}
|
|
507
530
|
//https://github.com/pmndrs/drei/blob/d3282cdd02d170ef603a5e096505d83dc93cd57a/src/web/ScrollControls.tsx#L85C7-L100C9
|
|
508
531
|
range(e, i, r = 0) {
|
|
509
|
-
const a = e - r,
|
|
510
|
-
return this.currentProgress < a ? 0 : this.currentProgress >
|
|
532
|
+
const a = e - r, b = a + i + r * 2;
|
|
533
|
+
return this.currentProgress < a ? 0 : this.currentProgress > b ? 1 : (this.currentProgress - a) / (b - a);
|
|
511
534
|
}
|
|
512
535
|
curve(e, i, r = 0) {
|
|
513
536
|
return Math.sin(this.range(e, i, r) * Math.PI);
|
|
514
537
|
}
|
|
515
538
|
visible(e, i, r = 0) {
|
|
516
|
-
const a = e - r,
|
|
517
|
-
return this.currentProgress >= a && this.currentProgress <=
|
|
539
|
+
const a = e - r, b = a + i + r * 2;
|
|
540
|
+
return this.currentProgress >= a && this.currentProgress <= b;
|
|
518
541
|
}
|
|
519
542
|
scrollToSection(e, i) {
|
|
520
543
|
if (!t(this, l).length)
|
|
521
544
|
return;
|
|
522
|
-
const r = t(this, P).current, a = c(this, o,
|
|
523
|
-
if (
|
|
545
|
+
const r = t(this, P).current, a = c(this, o, Ue).call(this, e), b = t(this, l)[r], v = t(this, l)[a];
|
|
546
|
+
if (b && v) {
|
|
524
547
|
let I = 0;
|
|
525
|
-
const
|
|
526
|
-
t(this, C).current ? a === 0 && r === t(this, l).length - 1 ? I = t(this, S) + t(this, y) -
|
|
548
|
+
const we = c(this, o, he).call(this), Vt = t(this, l)[we], Ce = Vt ? this.targetScrollValue - Vt.position : 0;
|
|
549
|
+
t(this, C).current ? a === 0 && r === t(this, l).length - 1 ? I = t(this, S) + t(this, y) - b.position + t(this, k) : a === t(this, l).length - 1 && r === 0 ? I = v.position - (t(this, S) + t(this, y) + t(this, k)) : I = v.position - b.position : I = v.position - b.position, this.shiftPosition(I - Ce, i);
|
|
527
550
|
}
|
|
528
551
|
}
|
|
529
552
|
shiftSections(e, i) {
|
|
530
553
|
t(this, l).length && this.scrollToSection(t(this, P).current + e, i);
|
|
531
554
|
}
|
|
532
555
|
setPosition(e, i) {
|
|
533
|
-
c(this, o,
|
|
534
|
-
h(this,
|
|
556
|
+
c(this, o, De).call(this, Math.sign(e) || 1), i != null && i.tween ? t(this, ft) || (t(this, Z).set(t(this, u).current, { equalize: !0 }), t(this, Z).set(e, Be({}, i.tween)), h(this, ft, setTimeout(() => {
|
|
557
|
+
h(this, ft, void 0);
|
|
535
558
|
}, i.tween.duration || 0))) : t(this, u).set(e, {
|
|
536
559
|
equalize: (i == null ? void 0 : i.behaviour) === "instant"
|
|
537
560
|
});
|
|
@@ -540,18 +563,18 @@ class Ot extends HTMLElement {
|
|
|
540
563
|
this.setPosition(t(this, u).target + e, i);
|
|
541
564
|
}
|
|
542
565
|
resize() {
|
|
543
|
-
if (t(this,
|
|
566
|
+
if (t(this, at).current)
|
|
544
567
|
return;
|
|
545
568
|
t(this, u).unlistenAnimationFrame();
|
|
546
569
|
const e = this.currentScrollValue / t(this, S) || 0, i = t(this, P).current;
|
|
547
|
-
if (h(this,
|
|
548
|
-
getComputedStyle(t(this,
|
|
549
|
-
)) : h(this, k,
|
|
550
|
-
getComputedStyle(t(this,
|
|
570
|
+
if (h(this, ae, this.vertical ? ze(this) : Ie(this)), h(this, ue, this.vertical ? ze(t(this, m)) : Ie(t(this, m))), h(this, y, this.vertical ? this.offsetHeight : this.offsetWidth), this.vertical ? h(this, k, We.parse(
|
|
571
|
+
getComputedStyle(t(this, m)).rowGap
|
|
572
|
+
)) : h(this, k, We.parse(
|
|
573
|
+
getComputedStyle(t(this, m)).columnGap
|
|
551
574
|
)), t(this, N).current && t(this, l).length) {
|
|
552
575
|
const r = t(this, D).current, a = (t(this, y) - t(this, k) * (r - 1)) / r;
|
|
553
|
-
t(this, l).forEach((
|
|
554
|
-
|
|
576
|
+
t(this, l).forEach((b) => {
|
|
577
|
+
b.setSize(a);
|
|
555
578
|
});
|
|
556
579
|
} else
|
|
557
580
|
t(this, l).forEach((r) => {
|
|
@@ -562,16 +585,16 @@ class Ot extends HTMLElement {
|
|
|
562
585
|
}), t(this, W).current) {
|
|
563
586
|
h(this, S, t(this, y) * t(this, W).current);
|
|
564
587
|
const r = t(this, S) + t(this, y);
|
|
565
|
-
this.vertical ? (t(this,
|
|
588
|
+
this.vertical ? (t(this, m).style.width = r + "px", t(this, m).style.height = "100%") : (t(this, m).style.height = r + "px", t(this, m).style.width = "100%");
|
|
566
589
|
} else
|
|
567
|
-
this.vertical ? (t(this,
|
|
590
|
+
this.vertical ? (t(this, m).style.width = "100%", t(this, m).style.height = "max-content", h(this, S, t(this, m).offsetHeight - t(this, y))) : (t(this, m).style.width = "max-content", t(this, m).style.height = "100%", h(this, S, t(this, m).offsetWidth - t(this, y)));
|
|
568
591
|
if (!t(this, C).current) {
|
|
569
592
|
const r = getComputedStyle(this), a = this.vertical ? parseFloat(r.paddingBlockStart) + parseFloat(r.paddingBlockEnd) : parseFloat(r.paddingInlineStart) + parseFloat(r.paddingInlineEnd);
|
|
570
593
|
h(this, S, t(this, S) + a), t(this, u).max = t(this, S);
|
|
571
594
|
}
|
|
572
595
|
if (t(this, C).current && t(this, l).length) {
|
|
573
|
-
const r = t(this, l)[t(this, l).length - 1], a = r.position + r.size - t(this, y),
|
|
574
|
-
h(this, U, r.position + r.size +
|
|
596
|
+
const r = t(this, l)[t(this, l).length - 1], a = r.position + r.size - t(this, y), b = t(this, S) - a;
|
|
597
|
+
h(this, U, r.position + r.size + b);
|
|
575
598
|
} else
|
|
576
599
|
h(this, U, t(this, S));
|
|
577
600
|
if (t(this, T).current && t(this, l).length) {
|
|
@@ -583,42 +606,42 @@ class Ot extends HTMLElement {
|
|
|
583
606
|
t(this, u).set(e * t(this, S), {
|
|
584
607
|
equalize: !0
|
|
585
608
|
});
|
|
586
|
-
h(this, G, (this.vertical ? t(this,
|
|
609
|
+
h(this, G, (this.vertical ? t(this, m).offsetHeight : t(this, m).offsetWidth) > t(this, y)), this.classList.toggle("has-overflow", t(this, G)), t(this, G) ? t(this, ct).current || c(this, o, Ee).call(this) : c(this, o, xe).call(this), t(this, pe).call(this), ie(this, "scrollResize", { custom: !0 }), t(this, u).notify();
|
|
587
610
|
}
|
|
588
611
|
connectedCallback() {
|
|
589
|
-
vt.register(this), h(this, u, new
|
|
612
|
+
vt.register(this), h(this, u, new es(0, {
|
|
590
613
|
damping: 0.01,
|
|
591
614
|
min: 0,
|
|
592
|
-
order:
|
|
593
|
-
})), this.setAttribute("tabindex", "0"), h(this, V, new
|
|
615
|
+
order: ts.SCROLL
|
|
616
|
+
})), this.setAttribute("tabindex", "0"), h(this, V, new is({ element: t(this, m) })), t(this, V).changeEvent.subscribe(t(this, Kt)), h(this, dt, new rs({
|
|
594
617
|
element: this
|
|
595
|
-
})), t(this,
|
|
596
|
-
t(this,
|
|
597
|
-
), h(this, R, new
|
|
598
|
-
element: t(this,
|
|
618
|
+
})), t(this, dt).changeEvent.subscribe(
|
|
619
|
+
t(this, Kt)
|
|
620
|
+
), h(this, R, new ns({
|
|
621
|
+
element: t(this, m),
|
|
599
622
|
rootElement: this
|
|
600
|
-
})), t(this, R).changeEvent.subscribe(t(this,
|
|
623
|
+
})), t(this, R).changeEvent.subscribe(t(this, Kt)), h(this, E, new hs({
|
|
601
624
|
culling: this
|
|
602
|
-
})), t(this,
|
|
603
|
-
c(this, o,
|
|
604
|
-
}), t(this,
|
|
605
|
-
c(this, o,
|
|
606
|
-
}), t(this,
|
|
607
|
-
t(this, V).axis = e.current ? "max" : t(this,
|
|
608
|
-
}), t(this,
|
|
625
|
+
})), t(this, E).changeEvent.subscribe(t(this, fe)), t(this, w).subscribe(() => {
|
|
626
|
+
c(this, o, Ae).call(this);
|
|
627
|
+
}), t(this, st).subscribe(() => {
|
|
628
|
+
c(this, o, Ae).call(this);
|
|
629
|
+
}), t(this, nt).subscribe((e) => {
|
|
630
|
+
t(this, V).axis = e.current ? "max" : t(this, w).current;
|
|
631
|
+
}), t(this, wt).subscribe((e) => {
|
|
609
632
|
t(this, R).inertion = typeof e.current == "number" ? e.current : 1;
|
|
610
633
|
}), t(this, W).subscribe(() => {
|
|
611
|
-
t(this,
|
|
634
|
+
t(this, x) && t(this, L).call(this);
|
|
612
635
|
}), t(this, F).subscribe(({ current: e }) => {
|
|
613
|
-
t(this,
|
|
636
|
+
t(this, x) && (e ? c(this, o, ne).call(this) : c(this, o, Rt).call(this));
|
|
614
637
|
}), t(this, T).subscribe((e) => {
|
|
615
|
-
t(this, V).debounce = e.current, t(this, R).swipe = e.current, t(this,
|
|
638
|
+
t(this, V).debounce = e.current, t(this, R).swipe = e.current, t(this, E).interval = e.current, t(this, x) && (e.current && !e.previous && !t(this, l).length ? c(this, o, ne).call(this) : !e.current && e.previous && t(this, l).length && c(this, o, Rt).call(this));
|
|
616
639
|
}), t(this, N).subscribe((e) => {
|
|
617
|
-
t(this,
|
|
640
|
+
t(this, x) && (t(this, L).call(this), e.current && !e.previous && !t(this, l).length ? c(this, o, ne).call(this) : !e.current && e.previous && t(this, l).length && c(this, o, Rt).call(this));
|
|
618
641
|
}), t(this, D).subscribe((e) => {
|
|
619
|
-
t(this,
|
|
642
|
+
t(this, x) && (t(this, L).call(this), c(this, o, gt).call(this));
|
|
620
643
|
}), t(this, C).subscribe((e) => {
|
|
621
|
-
e.current ? (t(this,
|
|
644
|
+
e.current ? (t(this, x) && (t(this, l).length || (t(this, F).current = !0)), t(this, u).max = 1 / 0, t(this, u).min = -1 / 0) : (h(this, Ft, 0), t(this, u).max = t(this, S), t(this, u).min = 0);
|
|
622
645
|
}), t(this, Pt).subscribe((e) => {
|
|
623
646
|
t(this, u).damping = e.current;
|
|
624
647
|
}), t(this, Lt).subscribe((e) => {
|
|
@@ -626,69 +649,69 @@ class Ot extends HTMLElement {
|
|
|
626
649
|
}), t(this, zt).subscribe((e) => {
|
|
627
650
|
t(this, u).stiffness = e.current;
|
|
628
651
|
}), t(this, A).subscribe((e) => {
|
|
629
|
-
t(this,
|
|
630
|
-
}), t(this, nt).subscribe((e) => {
|
|
631
|
-
e.current || (t(this, w).direction = 1);
|
|
632
|
-
}), t(this, M).subscribe((e) => {
|
|
633
|
-
t(this, E) && c(this, o, gt).call(this);
|
|
652
|
+
t(this, E).speed = e.current, !t(this, K) && e.current && !e.previous ? t(this, E).connect() : !e.current && e.previous && t(this, E).disconnect();
|
|
634
653
|
}), t(this, ht).subscribe((e) => {
|
|
635
|
-
|
|
654
|
+
e.current || (t(this, E).direction = 1);
|
|
655
|
+
}), t(this, M).subscribe((e) => {
|
|
656
|
+
t(this, x) && c(this, o, gt).call(this);
|
|
657
|
+
}), t(this, ot).subscribe((e) => {
|
|
658
|
+
t(this, x) && t(this, M).current && c(this, o, gt).call(this);
|
|
636
659
|
}), t(this, q).subscribe((e) => {
|
|
637
|
-
t(this,
|
|
660
|
+
t(this, x) && t(this, M).current && c(this, o, gt).call(this);
|
|
638
661
|
}), t(this, At).subscribe((e) => {
|
|
639
|
-
t(this,
|
|
662
|
+
t(this, x) && t(this, u).notify();
|
|
640
663
|
}), t(this, u).isRunning.subscribe((e) => {
|
|
641
664
|
this.classList.toggle("active", e.current);
|
|
642
665
|
}), t(this, P).subscribe((e) => {
|
|
643
666
|
t(this, l).length && c(this, o, gt).call(this), this.style.setProperty("--counter", e.current + "");
|
|
644
667
|
}), t(this, Z).subscribe((e) => {
|
|
645
668
|
t(this, Z).isRunning.current && t(this, u).set(e.current, { equalize: !0 });
|
|
646
|
-
}), t(this, lt).subscribe((e) => {
|
|
647
|
-
e.current && !e.previous ? (this.classList.add("disabled"), c(this, o, Se).call(this)) : !e.current && e.previous && (this.classList.remove("disabled"), c(this, o, ge).call(this));
|
|
648
669
|
}), t(this, ct).subscribe((e) => {
|
|
649
|
-
e.current && !e.previous ? (this.classList.add("
|
|
650
|
-
}), t(this,
|
|
670
|
+
e.current && !e.previous ? (this.classList.add("disabled"), c(this, o, xe).call(this)) : !e.current && e.previous && (this.classList.remove("disabled"), c(this, o, Ee).call(this));
|
|
671
|
+
}), t(this, at).subscribe((e) => {
|
|
672
|
+
e.current && !e.previous ? (this.classList.add("hibernated"), c(this, o, Me).call(this)) : !e.current && e.previous && (this.classList.remove("hibernated"), c(this, o, Te).call(this));
|
|
673
|
+
}), t(this, Et).observe(), t(this, w).observe(), t(this, st).observe(), t(this, B).observe(), t(this, W).observe(), t(this, F).observe(), t(this, T).observe(), t(this, it).observe(), t(this, rt).observe(), t(this, N).observe(), t(this, nt).observe(), t(this, wt).observe(), t(this, D).observe(), t(this, C).observe(), t(this, Pt).observe(), t(this, Lt).observe(), t(this, zt).observe(), t(this, It).observe(), t(this, Bt).observe(), t(this, A).observe(), t(this, A).observe(), t(this, kt).observe(), t(this, ht).observe(), t(this, M).observe(), t(this, ot).observe(), t(this, q).observe(), t(this, At).observe(), t(this, lt).observe(), t(this, Mt).observe(), t(this, ct).observe(), t(this, at).observe(), Ot.subscribe(t(this, me), ke.LAST), oe.subscribe(this, t(this, L)), t(this, Ut).observe(this, { childList: !0 });
|
|
651
674
|
}
|
|
652
675
|
disconnectedCallback() {
|
|
653
|
-
this.removeAttribute("tabindex"), this.classList.remove("disabled"), this.classList.remove("hibernated"), t(this,
|
|
676
|
+
this.removeAttribute("tabindex"), this.classList.remove("disabled"), this.classList.remove("hibernated"), t(this, Et).unobserve(), t(this, w).unobserve(), t(this, st).unobserve(), t(this, B).unobserve(), t(this, W).unobserve(), t(this, F).unobserve(), t(this, T).unobserve(), t(this, it).unobserve(), t(this, rt).unobserve(), t(this, N).unobserve(), t(this, nt).unobserve(), t(this, wt).unobserve(), t(this, D).unobserve(), t(this, C).unobserve(), t(this, Pt).unobserve(), t(this, Lt).unobserve(), t(this, zt).unobserve(), t(this, It).unobserve(), t(this, Bt).unobserve(), t(this, A).unobserve(), t(this, kt).unobserve(), t(this, ht).unobserve(), t(this, M).unobserve(), t(this, ot).unobserve(), t(this, q).unobserve(), t(this, At).unobserve(), t(this, lt).unobserve(), t(this, Mt).unobserve(), t(this, ct).unobserve(), t(this, at).unobserve(), Ot.unsubscribe(t(this, me)), oe.unsubscribe(t(this, L)), c(this, o, Me).call(this), t(this, Ut).disconnect();
|
|
654
677
|
}
|
|
655
678
|
}
|
|
656
|
-
u = new WeakMap(),
|
|
657
|
-
const e = t(this,
|
|
658
|
-
t(this,
|
|
659
|
-
},
|
|
660
|
-
c(this, o,
|
|
661
|
-
e instanceof HTMLElement && t(this, l).push(new
|
|
662
|
-
}), t(this,
|
|
679
|
+
u = new WeakMap(), Et = new WeakMap(), w = new WeakMap(), st = new WeakMap(), B = new WeakMap(), W = new WeakMap(), F = new WeakMap(), T = new WeakMap(), it = new WeakMap(), rt = new WeakMap(), N = new WeakMap(), nt = new WeakMap(), wt = new WeakMap(), D = new WeakMap(), C = new WeakMap(), Pt = new WeakMap(), Lt = new WeakMap(), zt = new WeakMap(), It = new WeakMap(), Bt = new WeakMap(), A = new WeakMap(), kt = new WeakMap(), ht = new WeakMap(), M = new WeakMap(), ot = new WeakMap(), q = new WeakMap(), At = new WeakMap(), lt = new WeakMap(), Mt = new WeakMap(), ct = new WeakMap(), at = new WeakMap(), ut = new WeakMap(), m = new WeakMap(), Wt = new WeakMap(), l = new WeakMap(), ae = new WeakMap(), ue = new WeakMap(), y = new WeakMap(), S = new WeakMap(), k = new WeakMap(), V = new WeakMap(), dt = new WeakMap(), R = new WeakMap(), E = new WeakMap(), P = new WeakMap(), Ft = new WeakMap(), U = new WeakMap(), G = new WeakMap(), K = new WeakMap(), _ = new WeakMap(), Nt = new WeakMap(), ft = new WeakMap(), Z = new WeakMap(), qt = new WeakMap(), O = new WeakMap(), x = new WeakMap(), Ut = new WeakMap(), j = new WeakMap(), Tt = new WeakMap(), Gt = new WeakMap(), o = new WeakSet(), Ae = function() {
|
|
680
|
+
const e = t(this, w).current, i = t(this, st).current ? "-reverse" : "";
|
|
681
|
+
t(this, m).style.flexDirection = e === "x" ? `row${i}` : `column${i}`, t(this, V).axis = t(this, nt).current ? "max" : e, t(this, dt).dimension = e === "x" ? "width" : "height", t(this, R).axis = e, e === "x" ? this.style.touchAction = "pan-y" : e === "y" && (this.style.touchAction = "pan-x"), t(this, x) && t(this, L).call(this);
|
|
682
|
+
}, ne = function() {
|
|
683
|
+
c(this, o, Rt).call(this), t(this, Wt).assignedElements().forEach((e, i) => {
|
|
684
|
+
e instanceof HTMLElement && t(this, l).push(new as(e, i, this));
|
|
685
|
+
}), t(this, m).style.transform = "", this.style.setProperty("--sections", t(this, l).length.toString()), ie(this, "scrollSectionsChange", {
|
|
663
686
|
custom: !0,
|
|
664
687
|
composed: !0
|
|
665
688
|
}), t(this, L).call(this), c(this, o, gt).call(this);
|
|
666
|
-
},
|
|
689
|
+
}, Rt = function() {
|
|
667
690
|
t(this, l).forEach((e) => {
|
|
668
691
|
e.destroy();
|
|
669
|
-
}), h(this, l, []), t(this, P).reset(), t(this, u).reset(),
|
|
692
|
+
}), h(this, l, []), t(this, P).reset(), t(this, u).reset(), this.style.removeProperty("--max-section-size"), ie(this, "scrollSectionsChange", {
|
|
670
693
|
custom: !0,
|
|
671
694
|
composed: !0
|
|
672
695
|
});
|
|
673
|
-
},
|
|
674
|
-
t(this, K) || (h(this, K, !0), t(this, u).unsubscribe(t(this,
|
|
696
|
+
}, xe = function() {
|
|
697
|
+
t(this, K) || (h(this, K, !0), t(this, u).unsubscribe(t(this, de)), t(this, u).unlistenAnimationFrame(), clearInterval(t(this, Nt)), clearInterval(t(this, ft)), t(this, Z).unlistenAnimationFrame(), t(this, V).disconnect(), t(this, dt).disconnect(), t(this, R).disconnect(), t(this, E).disconnect(), t(this, G) || (this.sections.forEach((e) => {
|
|
675
698
|
e.unsetTransform();
|
|
676
699
|
}), t(this, L).call(this)));
|
|
677
|
-
},
|
|
678
|
-
t(this, K) && (h(this, K, !1), t(this, u).subscribe(t(this,
|
|
679
|
-
},
|
|
680
|
-
t(this, _) || (h(this, _, !0),
|
|
681
|
-
},
|
|
682
|
-
t(this, _) && (h(this, _, !1), vt.register(this), this.tryResplit(), c(this, o,
|
|
683
|
-
}, L = new WeakMap(),
|
|
700
|
+
}, Ee = function() {
|
|
701
|
+
t(this, K) && (h(this, K, !1), t(this, u).subscribe(t(this, de), -1e4), t(this, u).notify(), t(this, V).connect(), t(this, dt).connect(), t(this, R).connect(), t(this, A).current && t(this, E).connect());
|
|
702
|
+
}, Me = function() {
|
|
703
|
+
t(this, _) || (h(this, _, !0), clearTimeout(t(this, Gt)), Ot.unsubscribe(t(this, L)), c(this, o, xe).call(this), t(this, m).style.transform = "", t(this, m).style.height = "", t(this, m).style.width = "", this.classList.remove("has-overflow", "start", "end"), t(this, l).length ? c(this, o, Rt).call(this) : (t(this, P).reset(), t(this, u).reset()), vt.unregister(this));
|
|
704
|
+
}, Te = function() {
|
|
705
|
+
t(this, _) && (h(this, _, !1), vt.register(this), this.tryResplit(), c(this, o, Ee).call(this), Ot.subscribe(t(this, L), ke.SCROLL));
|
|
706
|
+
}, L = new WeakMap(), de = new WeakMap(), Ue = function(e) {
|
|
684
707
|
let i = t(this, P).current;
|
|
685
|
-
return t(this, C).current ? i =
|
|
686
|
-
},
|
|
687
|
-
t(this,
|
|
708
|
+
return t(this, C).current ? i = Ye(e, t(this, l).length) : i = Ne(e, 0, this.limit), i;
|
|
709
|
+
}, Kt = new WeakMap(), fe = new WeakMap(), De = function(e = 1) {
|
|
710
|
+
t(this, ht).current && (t(this, E).direction = e), t(this, A).current && t(this, E).pauseAndContinue(
|
|
688
711
|
t(this, kt).current,
|
|
689
712
|
this.sectionalCSSProperty.current
|
|
690
713
|
);
|
|
691
|
-
},
|
|
714
|
+
}, Ve = function(e = "current") {
|
|
692
715
|
if (t(this, C).current && t(this, l).length) {
|
|
693
716
|
const i = t(this, u)[e] % Math.round(t(this, S) + t(this, y) + t(this, k));
|
|
694
717
|
return i < 0 ? t(this, S) + i + t(this, y) + t(this, k) : i;
|
|
@@ -696,92 +719,92 @@ u = new WeakMap(), wt = new WeakMap(), x = new WeakMap(), et = new WeakMap(), B
|
|
|
696
719
|
return t(this, u)[e];
|
|
697
720
|
}, gt = function() {
|
|
698
721
|
if (t(this, l).length) {
|
|
699
|
-
const e = t(this, P).current + t(this,
|
|
700
|
-
if (e === 0 ? h(this, O, "start") : e === this.limit ? h(this, O, "end") : h(this, O, null),
|
|
722
|
+
const e = t(this, P).current + t(this, ot).current;
|
|
723
|
+
if (e === 0 ? h(this, O, "start") : e === this.limit ? h(this, O, "end") : h(this, O, null), ie(this, "scrollLine", {
|
|
701
724
|
detail: { line: t(this, O) }
|
|
702
725
|
}), t(this, M).current) {
|
|
703
726
|
this.classList.remove("end", "start"), t(this, O) && this.classList.add(t(this, O));
|
|
704
727
|
const i = t(this, D).current + t(this, q).current;
|
|
705
|
-
h(this,
|
|
728
|
+
h(this, j, []), t(this, l).forEach((r, a) => {
|
|
706
729
|
r.setCurrentIndex(null), r.setCurrentIndexArc(null), r.setCurrentIndexArcAbs(null), r.setMiddle(!1);
|
|
707
|
-
const
|
|
708
|
-
a >= e && a < v || a <=
|
|
709
|
-
});
|
|
730
|
+
const b = e - this.limit - 1 + t(this, q).current, v = e + i, I = this.sections.length - v;
|
|
731
|
+
a >= e && a < v || a <= b ? (r.setMark("current"), t(this, j).push(r)) : a >= v && a < v + I / 2 || a <= b + i ? r.setMark("next") : r.setMark("previous");
|
|
732
|
+
}), t(this, pe).call(this);
|
|
710
733
|
}
|
|
711
734
|
}
|
|
712
|
-
},
|
|
735
|
+
}, Ge = function() {
|
|
713
736
|
if (t(this, M).current) {
|
|
714
|
-
const e = Math.floor(t(this,
|
|
715
|
-
t(this,
|
|
737
|
+
const e = Math.floor(t(this, j).length / 2);
|
|
738
|
+
t(this, j).sort((i, r) => i.element.getBoundingClientRect().left - r.element.getBoundingClientRect().left), t(this, j).forEach((i, r) => {
|
|
716
739
|
const a = r - e;
|
|
717
740
|
i.setCurrentIndex(r), i.setCurrentIndexArc(a), i.setCurrentIndexArcAbs(Math.abs(a)), i.setMiddle(r === e);
|
|
718
741
|
});
|
|
719
742
|
}
|
|
720
|
-
},
|
|
743
|
+
}, pe = new WeakMap(), he = function(e = !1) {
|
|
721
744
|
let i = this.targetScrollValue, r = 1 / 0, a = 0;
|
|
722
|
-
const
|
|
745
|
+
const b = t(this, u).direction;
|
|
723
746
|
for (let v = 0; v < t(this, l).length; v++) {
|
|
724
747
|
const I = t(this, l)[v];
|
|
725
|
-
let
|
|
726
|
-
this.overscroll &&
|
|
727
|
-
let
|
|
728
|
-
|
|
748
|
+
let we = t(this, qt) ? I.size * b * -1 * 0.4 : 0, Vt = I.position;
|
|
749
|
+
this.overscroll && Vt === 0 && e && (Vt = t(this, U));
|
|
750
|
+
let Ce = Math.abs(Vt + we - i);
|
|
751
|
+
Ce <= r && (r = Ce, a = v);
|
|
729
752
|
}
|
|
730
753
|
return a;
|
|
731
|
-
},
|
|
732
|
-
H && !customElements.get("e-scroll") && customElements.define("e-scroll",
|
|
733
|
-
var
|
|
734
|
-
class
|
|
754
|
+
}, me = new WeakMap();
|
|
755
|
+
H && !customElements.get("e-scroll") && customElements.define("e-scroll", Ht);
|
|
756
|
+
var be;
|
|
757
|
+
class Re extends HTMLElement {
|
|
735
758
|
constructor() {
|
|
736
759
|
super(...arguments);
|
|
737
|
-
s(this,
|
|
760
|
+
s(this, be, null);
|
|
738
761
|
}
|
|
739
762
|
get scrollElement() {
|
|
740
|
-
return t(this,
|
|
763
|
+
return t(this, be);
|
|
741
764
|
}
|
|
742
765
|
connectedCallback() {
|
|
743
|
-
const e =
|
|
744
|
-
e instanceof
|
|
766
|
+
const e = qe(this, Ht);
|
|
767
|
+
e instanceof Ht ? h(this, be, e) : console.error(this, "e-scroll not found");
|
|
745
768
|
}
|
|
746
769
|
}
|
|
747
|
-
|
|
748
|
-
var
|
|
749
|
-
class
|
|
770
|
+
be = new WeakMap();
|
|
771
|
+
var pt, z, J, Q, _t, Zt, mt, jt, Se, ge;
|
|
772
|
+
class ds extends Re {
|
|
750
773
|
constructor() {
|
|
751
774
|
super();
|
|
752
|
-
s(this,
|
|
775
|
+
s(this, pt, null);
|
|
753
776
|
s(this, z, null);
|
|
754
|
-
s(this,
|
|
755
|
-
s(this,
|
|
756
|
-
s(this,
|
|
757
|
-
s(this,
|
|
758
|
-
s(this,
|
|
759
|
-
h(this,
|
|
760
|
-
const e = t(this,
|
|
761
|
-
h(this,
|
|
777
|
+
s(this, J, !1);
|
|
778
|
+
s(this, Q, 0);
|
|
779
|
+
s(this, _t, 0);
|
|
780
|
+
s(this, Zt, 0);
|
|
781
|
+
s(this, mt, () => {
|
|
782
|
+
h(this, J, this.offsetWidth > this.offsetHeight);
|
|
783
|
+
const e = t(this, J) ? this.offsetWidth : this.offsetHeight;
|
|
784
|
+
h(this, Q, e / ((this.scrollElement.scrollSize + this.scrollElement.viewportSize) / e)), h(this, Q, Math.max(t(this, Q), 30)), t(this, J) ? (t(this, z).style.width = t(this, Q) + "px", t(this, z).style.height = "100%") : (t(this, z).style.width = "100%", t(this, z).style.height = t(this, Q) + "px"), h(this, _t, e - t(this, Q)), this.scrollElement.scrollSize <= 0 ? this.style.display = "none" : this.style.display = "", t(this, jt).call(this);
|
|
762
785
|
});
|
|
763
|
-
s(this,
|
|
764
|
-
h(this,
|
|
786
|
+
s(this, jt, () => {
|
|
787
|
+
h(this, Zt, this.scrollElement.currentProgress * t(this, _t)), t(this, J) ? t(this, z).style.transform = `translate3d(${t(this, Zt)}px, 0px, 0px)` : t(this, z).style.transform = `translate3d(0px, ${t(this, Zt)}px, 0px)`;
|
|
765
788
|
});
|
|
766
|
-
s(this,
|
|
789
|
+
s(this, Se, () => {
|
|
767
790
|
this.setAttribute("axis", this.scrollElement.axisCSSProperty.current);
|
|
768
791
|
});
|
|
769
|
-
s(this,
|
|
770
|
-
document.documentElement.classList.add("grabbing"),
|
|
792
|
+
s(this, ge, (e) => {
|
|
793
|
+
document.documentElement.classList.add("grabbing"), ls(
|
|
771
794
|
(a) => {
|
|
772
|
-
const
|
|
795
|
+
const b = t(this, J) ? a.x : a.y, v = this.scrollElement.distance / t(this, _t), I = (b - r) * v;
|
|
773
796
|
this.scrollElement.setPosition(i + I);
|
|
774
797
|
},
|
|
775
798
|
() => {
|
|
776
799
|
document.documentElement.classList.remove("grabbing");
|
|
777
800
|
}
|
|
778
801
|
);
|
|
779
|
-
const i = this.scrollElement.damped.target, r = t(this,
|
|
802
|
+
const i = this.scrollElement.damped.target, r = t(this, J) ? e.x : e.y;
|
|
780
803
|
});
|
|
781
804
|
if (H) {
|
|
782
805
|
const e = this.attachShadow({ mode: "open" });
|
|
783
806
|
e.adoptedStyleSheets = [
|
|
784
|
-
|
|
807
|
+
Fe({
|
|
785
808
|
":host": {
|
|
786
809
|
display: "inline-block",
|
|
787
810
|
zIndex: "1",
|
|
@@ -810,7 +833,7 @@ class os extends ke {
|
|
|
810
833
|
touchAction: "none"
|
|
811
834
|
}
|
|
812
835
|
})
|
|
813
|
-
], h(this,
|
|
836
|
+
], h(this, pt, document.createElement("slot")), t(this, pt).innerHTML = '<div class="default-thumb"></div>', e.appendChild(t(this, pt));
|
|
814
837
|
}
|
|
815
838
|
}
|
|
816
839
|
get thumbElement() {
|
|
@@ -818,28 +841,28 @@ class os extends ke {
|
|
|
818
841
|
}
|
|
819
842
|
connectedCallback() {
|
|
820
843
|
super.connectedCallback(), this.setAttribute("drag-dead-zone", "");
|
|
821
|
-
const e = t(this,
|
|
822
|
-
h(this, z, e), t(this, z).addEventListener("pointerdown", t(this,
|
|
844
|
+
const e = t(this, pt).assignedElements()[0] || t(this, pt).firstElementChild;
|
|
845
|
+
h(this, z, e), t(this, z).addEventListener("pointerdown", t(this, ge)), Ot.subscribe(t(this, mt), ke.SCROLL), oe.subscribe(this, t(this, mt)), oe.subscribe(this.scrollElement, t(this, mt)), this.scrollElement.onScroll(t(this, jt)), this.scrollElement.axisCSSProperty.subscribe(t(this, Se));
|
|
823
846
|
}
|
|
824
847
|
disconnectedCallback() {
|
|
825
|
-
this.removeAttribute("drag-dead-zone"), this.style.display = "", t(this, z).removeEventListener("pointerdown", t(this,
|
|
848
|
+
this.removeAttribute("drag-dead-zone"), this.style.display = "", t(this, z).removeEventListener("pointerdown", t(this, ge)), Ot.unsubscribe(t(this, mt)), oe.unsubscribe(t(this, mt)), this.scrollElement.offScroll(t(this, jt)), this.scrollElement.axisCSSProperty.unsubscribe(t(this, Se));
|
|
826
849
|
}
|
|
827
850
|
}
|
|
828
|
-
|
|
829
|
-
H && !customElements.get("e-scrollbar") && customElements.define("e-scrollbar",
|
|
830
|
-
var
|
|
831
|
-
class
|
|
851
|
+
pt = new WeakMap(), z = new WeakMap(), J = new WeakMap(), Q = new WeakMap(), _t = new WeakMap(), Zt = new WeakMap(), mt = new WeakMap(), jt = new WeakMap(), Se = new WeakMap(), ge = new WeakMap();
|
|
852
|
+
H && !customElements.get("e-scrollbar") && customElements.define("e-scrollbar", ds);
|
|
853
|
+
var Jt, Qt, Xt;
|
|
854
|
+
class Ke extends Re {
|
|
832
855
|
constructor() {
|
|
833
856
|
super();
|
|
834
|
-
s(this,
|
|
835
|
-
s(this,
|
|
857
|
+
s(this, Jt, new f(this, "--behaviour", "smooth"));
|
|
858
|
+
s(this, Qt, new f(
|
|
836
859
|
this,
|
|
837
860
|
"--tween-easing",
|
|
838
861
|
!1
|
|
839
862
|
));
|
|
840
|
-
s(this,
|
|
863
|
+
s(this, Xt, new f(this, "--tween-duration", 0));
|
|
841
864
|
H && this.addEventListener("click", () => {
|
|
842
|
-
const e = t(this,
|
|
865
|
+
const e = t(this, Jt).current, i = t(this, Qt).current, r = t(this, Xt).current;
|
|
843
866
|
this.handleClick({
|
|
844
867
|
behaviour: e,
|
|
845
868
|
tween: i || r ? { easing: i, duration: r } : void 0
|
|
@@ -847,145 +870,145 @@ class Fe extends ke {
|
|
|
847
870
|
});
|
|
848
871
|
}
|
|
849
872
|
connectedCallback() {
|
|
850
|
-
super.connectedCallback(), t(this,
|
|
873
|
+
super.connectedCallback(), t(this, Jt).observe(), t(this, Qt).observe(), t(this, Xt).observe();
|
|
851
874
|
}
|
|
852
875
|
disconnectedCallback() {
|
|
853
|
-
t(this,
|
|
876
|
+
t(this, Jt).close(), t(this, Qt).close(), t(this, Xt).close();
|
|
854
877
|
}
|
|
855
878
|
}
|
|
856
|
-
|
|
857
|
-
var
|
|
858
|
-
class
|
|
879
|
+
Jt = new WeakMap(), Qt = new WeakMap(), Xt = new WeakMap();
|
|
880
|
+
var Yt;
|
|
881
|
+
class fs extends Ke {
|
|
859
882
|
constructor() {
|
|
860
883
|
super(...arguments);
|
|
861
|
-
s(this,
|
|
884
|
+
s(this, Yt, new f(this, "--set", 1));
|
|
862
885
|
}
|
|
863
886
|
handleClick(e) {
|
|
864
|
-
this.scrollElement.scrollToSection(t(this,
|
|
887
|
+
this.scrollElement.scrollToSection(t(this, Yt).current, e);
|
|
865
888
|
}
|
|
866
889
|
connectedCallback() {
|
|
867
|
-
super.connectedCallback(), t(this,
|
|
890
|
+
super.connectedCallback(), t(this, Yt).observe();
|
|
868
891
|
}
|
|
869
892
|
disconnectedCallback() {
|
|
870
|
-
super.disconnectedCallback(), t(this,
|
|
893
|
+
super.disconnectedCallback(), t(this, Yt).close();
|
|
871
894
|
}
|
|
872
895
|
}
|
|
873
|
-
|
|
874
|
-
H && !customElements.get("e-scroll-set-button") && customElements.define("e-scroll-set-button",
|
|
875
|
-
var
|
|
876
|
-
class
|
|
896
|
+
Yt = new WeakMap();
|
|
897
|
+
H && !customElements.get("e-scroll-set-button") && customElements.define("e-scroll-set-button", fs);
|
|
898
|
+
var X, te;
|
|
899
|
+
class ps extends Ke {
|
|
877
900
|
constructor() {
|
|
878
901
|
super(...arguments);
|
|
879
|
-
s(this,
|
|
880
|
-
s(this,
|
|
881
|
-
this.scrollElement.loopCSSProperty.current ? this.removeAttribute("disabled") : t(this,
|
|
902
|
+
s(this, X, new f(this, "--step", 1));
|
|
903
|
+
s(this, te, () => {
|
|
904
|
+
this.scrollElement.loopCSSProperty.current ? this.removeAttribute("disabled") : t(this, X).current > 0 && this.scrollElement.scrollLine === "end" || t(this, X).current < 0 && this.scrollElement.scrollLine === "start" ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
|
|
882
905
|
});
|
|
883
906
|
}
|
|
884
907
|
handleClick(e) {
|
|
885
|
-
this.scrollElement.shiftSections(t(this,
|
|
908
|
+
this.scrollElement.shiftSections(t(this, X).current, e);
|
|
886
909
|
}
|
|
887
910
|
connectedCallback() {
|
|
888
|
-
super.connectedCallback(), this.scrollElement && (t(this,
|
|
889
|
-
t(this,
|
|
890
|
-
}), t(this,
|
|
911
|
+
super.connectedCallback(), this.scrollElement && (t(this, X).subscribe(() => {
|
|
912
|
+
t(this, te).call(this);
|
|
913
|
+
}), t(this, X).observe(), this.scrollElement.addEventListener(
|
|
891
914
|
"scrollLine",
|
|
892
|
-
t(this,
|
|
893
|
-
), t(this,
|
|
915
|
+
t(this, te)
|
|
916
|
+
), t(this, te).call(this));
|
|
894
917
|
}
|
|
895
918
|
disconnectedCallback() {
|
|
896
|
-
super.disconnectedCallback(), t(this,
|
|
919
|
+
super.disconnectedCallback(), t(this, X).close(), this.removeAttribute("disabled");
|
|
897
920
|
}
|
|
898
921
|
}
|
|
899
|
-
|
|
900
|
-
H && !customElements.get("e-scroll-step-button") && customElements.define("e-scroll-step-button",
|
|
901
|
-
var
|
|
902
|
-
class
|
|
922
|
+
X = new WeakMap(), te = new WeakMap();
|
|
923
|
+
H && !customElements.get("e-scroll-step-button") && customElements.define("e-scroll-step-button", ps);
|
|
924
|
+
var Y, bt, ee, ve, ye, se;
|
|
925
|
+
class ms {
|
|
903
926
|
constructor(n, e, i) {
|
|
904
|
-
s(this,
|
|
905
|
-
s(this,
|
|
906
|
-
s(this,
|
|
907
|
-
s(this,
|
|
908
|
-
s(this,
|
|
909
|
-
t(this,
|
|
910
|
-
behaviour: t(this,
|
|
927
|
+
s(this, Y, null);
|
|
928
|
+
s(this, bt, null);
|
|
929
|
+
s(this, ee, null);
|
|
930
|
+
s(this, ve, null);
|
|
931
|
+
s(this, ye, () => {
|
|
932
|
+
t(this, bt).scrollToSection(t(this, ee), {
|
|
933
|
+
behaviour: t(this, ve)
|
|
911
934
|
});
|
|
912
935
|
});
|
|
913
|
-
s(this,
|
|
914
|
-
t(this,
|
|
936
|
+
s(this, se, () => {
|
|
937
|
+
t(this, Y).classList.toggle(
|
|
915
938
|
"current",
|
|
916
|
-
t(this,
|
|
939
|
+
t(this, bt).counter.current === t(this, ee)
|
|
917
940
|
);
|
|
918
941
|
});
|
|
919
|
-
H && (h(this,
|
|
942
|
+
H && (h(this, Y, document.createElement("button")), h(this, bt, n), h(this, ve, i), h(this, ee, e), t(this, Y).addEventListener("click", t(this, ye)), t(this, bt).counter.subscribe(t(this, se)), t(this, se).call(this));
|
|
920
943
|
}
|
|
921
944
|
get element() {
|
|
922
|
-
return t(this,
|
|
945
|
+
return t(this, Y);
|
|
923
946
|
}
|
|
924
947
|
destroy() {
|
|
925
|
-
t(this,
|
|
948
|
+
t(this, Y).removeEventListener("click", t(this, ye)), t(this, bt).counter.unsubscribe(t(this, se)), t(this, Y).remove();
|
|
926
949
|
}
|
|
927
950
|
}
|
|
928
|
-
|
|
929
|
-
var
|
|
930
|
-
class
|
|
951
|
+
Y = new WeakMap(), bt = new WeakMap(), ee = new WeakMap(), ve = new WeakMap(), ye = new WeakMap(), se = new WeakMap();
|
|
952
|
+
var Dt, St, tt;
|
|
953
|
+
class bs extends Re {
|
|
931
954
|
constructor() {
|
|
932
955
|
super(...arguments);
|
|
933
|
-
s(this,
|
|
956
|
+
s(this, Dt, null);
|
|
934
957
|
s(this, St, []);
|
|
935
|
-
s(this,
|
|
958
|
+
s(this, tt, Le(() => {
|
|
936
959
|
t(this, St).forEach((i) => i.destroy()), h(this, St, []);
|
|
937
960
|
let e = 0;
|
|
938
961
|
this.scrollElement.loopCSSProperty.current ? e = this.scrollElement.sections.length : e = this.scrollElement.sections.length - Math.max(this.scrollElement.sectionsInViewCSSProperty.current - 1, 0);
|
|
939
962
|
for (let i = 0; i < e; i++) {
|
|
940
|
-
const r = new
|
|
963
|
+
const r = new ms(
|
|
941
964
|
this.scrollElement,
|
|
942
965
|
i,
|
|
943
966
|
this.getAttribute("behaviour") || "smooth"
|
|
944
967
|
);
|
|
945
|
-
t(this,
|
|
968
|
+
t(this, Dt).appendChild(r.element), t(this, St).push(r);
|
|
946
969
|
}
|
|
947
970
|
}, 0));
|
|
948
971
|
}
|
|
949
972
|
connectedCallback() {
|
|
950
973
|
super.connectedCallback(), this.scrollElement.addEventListener(
|
|
951
974
|
"scrollSectionsChange",
|
|
952
|
-
t(this,
|
|
975
|
+
t(this, tt)
|
|
953
976
|
), this.scrollElement.sectionsInViewCSSProperty.subscribe(
|
|
954
|
-
t(this,
|
|
955
|
-
), this.scrollElement.loopCSSProperty.subscribe(t(this,
|
|
977
|
+
t(this, tt)
|
|
978
|
+
), this.scrollElement.loopCSSProperty.subscribe(t(this, tt)), h(this, Dt, document.createElement("div")), this.appendChild(t(this, Dt));
|
|
956
979
|
}
|
|
957
980
|
disconnectedCallback() {
|
|
958
981
|
this.scrollElement.removeEventListener(
|
|
959
982
|
"scrollSectionsChange",
|
|
960
|
-
t(this,
|
|
983
|
+
t(this, tt)
|
|
961
984
|
), this.scrollElement.sectionsInViewCSSProperty.unsubscribe(
|
|
962
|
-
t(this,
|
|
963
|
-
), this.scrollElement.loopCSSProperty.unsubscribe(t(this,
|
|
985
|
+
t(this, tt)
|
|
986
|
+
), this.scrollElement.loopCSSProperty.unsubscribe(t(this, tt)), t(this, St).forEach((e) => e.destroy()), h(this, St, []), t(this, Dt).remove();
|
|
964
987
|
}
|
|
965
988
|
}
|
|
966
|
-
|
|
967
|
-
H && !customElements.get("e-scroll-bullet-buttons") && customElements.define("e-scroll-bullet-buttons",
|
|
968
|
-
class
|
|
989
|
+
Dt = new WeakMap(), St = new WeakMap(), tt = new WeakMap();
|
|
990
|
+
H && !customElements.get("e-scroll-bullet-buttons") && customElements.define("e-scroll-bullet-buttons", bs);
|
|
991
|
+
class Ss extends cs {
|
|
969
992
|
connectedCallback() {
|
|
970
|
-
const n =
|
|
971
|
-
n instanceof
|
|
993
|
+
const n = qe(this, Ht);
|
|
994
|
+
n instanceof Ht ? (this.scrollContainer = n, this.scrollContainer.addEventListener(
|
|
972
995
|
"scrollSectionsChange",
|
|
973
996
|
this.findAnotherScrollEntries
|
|
974
997
|
), this.scrollContainer.addEventListener("scrollResize", this.resize), this.resize()) : console.error(this, "e-scroll not found");
|
|
975
998
|
}
|
|
976
999
|
disconnectedCallback() {
|
|
977
|
-
super.disconnectedCallback(), this.scrollContainer instanceof
|
|
1000
|
+
super.disconnectedCallback(), this.scrollContainer instanceof Ht && (this.scrollContainer.removeEventListener(
|
|
978
1001
|
"scrollSectionsChange",
|
|
979
1002
|
this.findAnotherScrollEntries
|
|
980
1003
|
), this.scrollContainer.removeEventListener("scrollResize", this.resize));
|
|
981
1004
|
}
|
|
982
1005
|
}
|
|
983
|
-
H && !customElements.get("e-scroll-segment") && customElements.define("e-scroll-segment",
|
|
1006
|
+
H && !customElements.get("e-scroll-segment") && customElements.define("e-scroll-segment", Ss);
|
|
984
1007
|
export {
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
1008
|
+
bs as ScrollBulletButtonsElement,
|
|
1009
|
+
Ht as ScrollElement,
|
|
1010
|
+
Ss as ScrollSegmentElement,
|
|
1011
|
+
fs as ScrollSetButtonElement,
|
|
1012
|
+
ps as ScrollStepButtonElement,
|
|
1013
|
+
ds as ScrollbarElement
|
|
991
1014
|
};
|