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