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