aptechka 0.26.5 → 0.27.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/vanilla/ScrollSegmentElement.d.ts +2 -60
- package/lib/scroll/vanilla/index.cjs +1 -1
- package/lib/scroll/vanilla/index.d.ts +1 -1
- package/lib/scroll/vanilla/index.js +423 -769
- package/lib/scroll-segment/index.cjs +1 -0
- package/lib/scroll-segment/index.d.ts +80 -0
- package/lib/scroll-segment/index.js +387 -0
- package/package.json +9 -1
|
@@ -1,92 +1,93 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
throw TypeError(
|
|
1
|
+
var de = Object.defineProperty;
|
|
2
|
+
var te = Object.getOwnPropertySymbols;
|
|
3
|
+
var pe = Object.prototype.hasOwnProperty, fe = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var se = (u) => {
|
|
5
|
+
throw TypeError(u);
|
|
6
6
|
};
|
|
7
|
-
var
|
|
8
|
-
for (var
|
|
9
|
-
|
|
10
|
-
if (
|
|
11
|
-
for (var
|
|
12
|
-
|
|
13
|
-
return
|
|
7
|
+
var ee = (u, n, e) => n in u ? de(u, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : u[n] = e, ie = (u, n) => {
|
|
8
|
+
for (var e in n || (n = {}))
|
|
9
|
+
pe.call(n, e) && ee(u, e, n[e]);
|
|
10
|
+
if (te)
|
|
11
|
+
for (var e of te(n))
|
|
12
|
+
fe.call(n, e) && ee(u, e, n[e]);
|
|
13
|
+
return u;
|
|
14
14
|
};
|
|
15
|
-
var
|
|
16
|
-
var t = (
|
|
17
|
-
import { S as
|
|
18
|
-
import { i as
|
|
15
|
+
var Nt = (u, n, e) => n.has(u) || se("Cannot " + e);
|
|
16
|
+
var t = (u, n, e) => (Nt(u, n, "read from private field"), e ? e.call(u) : n.get(u)), s = (u, n, e) => n.has(u) ? se("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(u) : n.set(u, e), h = (u, n, e, i) => (Nt(u, n, "write to private field"), i ? i.call(u, e) : n.set(u, e), e), d = (u, n, e) => (Nt(u, n, "access private method"), e);
|
|
17
|
+
import { S as me } from "../../Store-OTdcl6SX.js";
|
|
18
|
+
import { i as qt } from "../../browser-0zX67oeU.js";
|
|
19
19
|
import { p as be } from "../../easings-BKi40vHz.js";
|
|
20
|
-
import { d as
|
|
21
|
-
import { c as
|
|
22
|
-
import { a as
|
|
23
|
-
import { c as
|
|
20
|
+
import { d as Ut } from "../../events-CsVF98U6.js";
|
|
21
|
+
import { c as ne } from "../../jss-CjccJC-K.js";
|
|
22
|
+
import { a as Gt, g as Kt } from "../../layout-HoBT_Da2.js";
|
|
23
|
+
import { c as he } from "../../math-BOBiC4TN.js";
|
|
24
24
|
import "../../ticker/vanilla/index.js";
|
|
25
|
-
import { TICK_ORDER as
|
|
26
|
-
import { D as
|
|
25
|
+
import { TICK_ORDER as Se, RESIZE_ORDER as oe } from "../../order/index.js";
|
|
26
|
+
import { D as ge } from "../../Damped-Chu29wn-.js";
|
|
27
27
|
import { T as ve } from "../../Tweened-BUuSLSF7.js";
|
|
28
|
-
import { WheelControls as ye, KeyboardControls as Ce, DragControls as
|
|
29
|
-
import { windowResizer as
|
|
30
|
-
import { scrollEntries as
|
|
31
|
-
import { cssUnitParser as
|
|
32
|
-
import { CSSProperty as
|
|
33
|
-
import { device as
|
|
34
|
-
import { elementResizer as
|
|
35
|
-
import { s as
|
|
36
|
-
import { f as
|
|
37
|
-
import { d as
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
28
|
+
import { WheelControls as ye, KeyboardControls as Ce, DragControls as Ee, AutoplayControls as xe } from "../../controls/index.js";
|
|
29
|
+
import { windowResizer as Wt } from "../../window-resizer/vanilla/index.js";
|
|
30
|
+
import { scrollEntries as bt } from "../../scroll-entries/index.js";
|
|
31
|
+
import { cssUnitParser as re } from "../../css-unit-parser/index.js";
|
|
32
|
+
import { CSSProperty as f } from "../../css-property/index.js";
|
|
33
|
+
import { device as we } from "../../device/index.js";
|
|
34
|
+
import { elementResizer as $t } from "../../element-resizer/vanilla/index.js";
|
|
35
|
+
import { s as Pe } from "../../gestures-D2Fdra_G.js";
|
|
36
|
+
import { f as le } from "../../dom-0S_WDL4g.js";
|
|
37
|
+
import { d as Le } from "../../function-C10DGppn.js";
|
|
38
|
+
import { ScrollSegmentElement as ze } from "../../scroll-segment/index.js";
|
|
39
|
+
var m, Dt, v, et, T, N;
|
|
40
|
+
class ke {
|
|
41
|
+
constructor(n, e, i) {
|
|
42
|
+
s(this, m);
|
|
43
|
+
s(this, Dt);
|
|
44
|
+
s(this, v);
|
|
45
|
+
s(this, et, 0);
|
|
46
|
+
s(this, T, 0);
|
|
47
|
+
s(this, N, null);
|
|
48
|
+
h(this, m, n), h(this, Dt, e), h(this, v, i), bt.register(t(this, m));
|
|
48
49
|
}
|
|
49
50
|
get index() {
|
|
50
|
-
return t(this,
|
|
51
|
+
return t(this, Dt);
|
|
51
52
|
}
|
|
52
53
|
get size() {
|
|
53
|
-
return t(this,
|
|
54
|
+
return t(this, et);
|
|
54
55
|
}
|
|
55
56
|
get position() {
|
|
56
|
-
return t(this,
|
|
57
|
+
return t(this, T);
|
|
57
58
|
}
|
|
58
59
|
destroy() {
|
|
59
|
-
|
|
60
|
+
bt.unregister(t(this, m)), t(this, m).style.transform = "", this.mark(null);
|
|
60
61
|
}
|
|
61
62
|
setSize(n) {
|
|
62
|
-
n ? (t(this,
|
|
63
|
+
n ? (t(this, m).style.setProperty("--size", n + "px"), t(this, v).axisCSSProperty.current === "x" ? (t(this, m).style.width = n + "px", t(this, m).style.height = "") : (t(this, m).style.height = n + "px", t(this, m).style.width = "")) : (t(this, m).style.width = "", t(this, m).style.height = "", t(this, m).style.removeProperty("--size"));
|
|
63
64
|
}
|
|
64
65
|
resize() {
|
|
65
|
-
|
|
66
|
+
h(this, et, t(this, v).vertical ? t(this, m).offsetHeight : t(this, m).offsetWidth), h(this, T, t(this, v).vertical ? Gt(t(this, m)) : Kt(t(this, m))), h(this, T, t(this, T) - t(this, v).contentPosition);
|
|
66
67
|
}
|
|
67
68
|
transform() {
|
|
68
69
|
let n = 0;
|
|
69
|
-
const
|
|
70
|
-
t(this,
|
|
71
|
-
t(this,
|
|
72
|
-
t(this,
|
|
70
|
+
const e = t(this, v).viewportSize * t(this, v).sectionDistanceScaleCSSProperty.current;
|
|
71
|
+
t(this, v).loopCSSProperty.current && t(this, v).overscroll && t(this, T) + t(this, et) < t(this, v).currentScrollValue && (n = t(this, v).distance * -1 - t(this, v).gap), bt.update(
|
|
72
|
+
t(this, m),
|
|
73
|
+
t(this, v).axisCSSProperty.current,
|
|
73
74
|
n
|
|
74
75
|
);
|
|
75
|
-
const
|
|
76
|
-
t(this,
|
|
76
|
+
const i = t(this, v).currentScrollValue + n, r = t(this, T) - t(this, v).viewportSize - e, c = t(this, T) + t(this, et) + e, b = he(i, r, c);
|
|
77
|
+
t(this, v).vertical ? t(this, m).style.transform = `translate3d(0px, ${b * -1}px, 0px)` : t(this, m).style.transform = `translate3d(${b * -1}px, 0px, 0px)`;
|
|
77
78
|
}
|
|
78
79
|
mark(n) {
|
|
79
|
-
t(this,
|
|
80
|
+
t(this, N) !== n && (t(this, N) && t(this, m).classList.remove(t(this, N)), n && t(this, m).classList.add(n), h(this, N, n), Ut(t(this, m), "scrollSectionMarkChange", {
|
|
80
81
|
composed: !0,
|
|
81
82
|
detail: {
|
|
82
|
-
mark: t(this,
|
|
83
|
+
mark: t(this, N)
|
|
83
84
|
},
|
|
84
85
|
custom: !0
|
|
85
86
|
}));
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
|
-
|
|
89
|
-
const
|
|
89
|
+
m = new WeakMap(), Dt = new WeakMap(), v = new WeakMap(), et = new WeakMap(), T = new WeakMap(), N = new WeakMap();
|
|
90
|
+
const De = ne({
|
|
90
91
|
":host": {
|
|
91
92
|
position: "relative",
|
|
92
93
|
width: "100%",
|
|
@@ -119,306 +120,306 @@ const ze = Xs({
|
|
|
119
120
|
flexShrink: "0"
|
|
120
121
|
}
|
|
121
122
|
});
|
|
122
|
-
var
|
|
123
|
-
class
|
|
123
|
+
var a, st, P, V, R, k, H, U, G, D, E, it, rt, nt, ht, St, A, ot, K, I, _, O, Z, lt, ct, ut, p, gt, o, At, It, y, S, L, M, j, B, C, g, vt, J, at, dt, yt, F, l, zt, mt, _t, Zt, jt, Jt, z, Mt, ce, Ct, Tt, Qt, tt, Xt;
|
|
124
|
+
class kt extends HTMLElement {
|
|
124
125
|
constructor() {
|
|
125
126
|
super();
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
validate: (
|
|
127
|
+
s(this, l);
|
|
128
|
+
s(this, a, null);
|
|
129
|
+
s(this, st, new f(this, "--controls", !0));
|
|
130
|
+
s(this, P, new f(this, "--axis", "y"));
|
|
131
|
+
s(this, V, new f(this, "--direction", 0));
|
|
132
|
+
s(this, R, new f(this, "--pages", 0, {
|
|
133
|
+
validate: (e) => Math.max(0, e - 1)
|
|
133
134
|
}));
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
s(this, k, new f(this, "--split", !1));
|
|
136
|
+
s(this, H, new f(this, "--sectional", !1));
|
|
137
|
+
s(this, U, new f(this, "--auto-size", !1));
|
|
138
|
+
s(this, G, new f(
|
|
138
139
|
this,
|
|
139
140
|
"--wheel-max-delta",
|
|
140
141
|
!1
|
|
141
142
|
));
|
|
142
|
-
|
|
143
|
+
s(this, D, new f(
|
|
143
144
|
this,
|
|
144
145
|
"--sections-in-view",
|
|
145
146
|
1
|
|
146
147
|
));
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
148
|
+
s(this, E, new f(this, "--loop", !1));
|
|
149
|
+
s(this, it, new f(this, "--damping", 20));
|
|
150
|
+
s(this, rt, new f(this, "--mass", 0));
|
|
151
|
+
s(this, nt, new f(this, "--stiffness", 0));
|
|
152
|
+
s(this, ht, new f(this, "--mouse-drag", !1));
|
|
153
|
+
s(this, St, new f(
|
|
153
154
|
this,
|
|
154
155
|
"--section-distance-scale",
|
|
155
156
|
0.5
|
|
156
157
|
));
|
|
157
|
-
|
|
158
|
-
|
|
158
|
+
s(this, A, new f(this, "--autoplay", 0));
|
|
159
|
+
s(this, ot, new f(
|
|
159
160
|
this,
|
|
160
161
|
"--autoplay-pause-duration",
|
|
161
162
|
0
|
|
162
163
|
));
|
|
163
|
-
|
|
164
|
+
s(this, K, new f(
|
|
164
165
|
this,
|
|
165
166
|
"--autoplay-user-direction",
|
|
166
167
|
!1
|
|
167
168
|
));
|
|
168
|
-
|
|
169
|
-
|
|
169
|
+
s(this, I, new f(this, "--classes", !1));
|
|
170
|
+
s(this, _, new f(
|
|
170
171
|
this,
|
|
171
172
|
"--current-index-start-offset",
|
|
172
173
|
0
|
|
173
174
|
));
|
|
174
|
-
|
|
175
|
+
s(this, O, new f(
|
|
175
176
|
this,
|
|
176
177
|
"--current-index-end-offset",
|
|
177
178
|
0
|
|
178
179
|
));
|
|
179
|
-
|
|
180
|
-
|
|
180
|
+
s(this, Z, new f(this, "--focus-delay", 0));
|
|
181
|
+
s(this, lt, new f(
|
|
181
182
|
this,
|
|
182
183
|
"--focus-duration",
|
|
183
184
|
3e3
|
|
184
185
|
));
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
t(this,
|
|
208
|
-
const
|
|
209
|
-
if (
|
|
186
|
+
s(this, ct, new f(this, "--disabled", !1));
|
|
187
|
+
s(this, ut, new f(this, "--hibernated", !1));
|
|
188
|
+
s(this, p, null);
|
|
189
|
+
s(this, gt, null);
|
|
190
|
+
s(this, o, []);
|
|
191
|
+
s(this, At, 0);
|
|
192
|
+
s(this, It, 0);
|
|
193
|
+
s(this, y, 0);
|
|
194
|
+
s(this, S, 0);
|
|
195
|
+
s(this, L, 0);
|
|
196
|
+
s(this, M, null);
|
|
197
|
+
s(this, j, null);
|
|
198
|
+
s(this, B, null);
|
|
199
|
+
s(this, C, null);
|
|
200
|
+
s(this, g, new me(0));
|
|
201
|
+
s(this, vt, 0);
|
|
202
|
+
s(this, J, 0);
|
|
203
|
+
s(this, at, !0);
|
|
204
|
+
s(this, dt, !0);
|
|
205
|
+
s(this, yt);
|
|
206
|
+
s(this, F, new ve());
|
|
207
|
+
s(this, z, () => {
|
|
208
|
+
t(this, a).unlistenAnimationFrame();
|
|
209
|
+
const e = this.currentScrollValue / t(this, S) || 0, i = t(this, g).current;
|
|
210
|
+
if (h(this, At, this.vertical ? Gt(this) : Kt(this)), h(this, It, this.vertical ? Gt(t(this, p)) : Kt(t(this, p))), h(this, y, this.vertical ? this.offsetHeight : this.offsetWidth), this.vertical ? h(this, L, re.parse(
|
|
210
211
|
getComputedStyle(t(this, p)).rowGap
|
|
211
|
-
)) :
|
|
212
|
+
)) : h(this, L, re.parse(
|
|
212
213
|
getComputedStyle(t(this, p)).columnGap
|
|
213
|
-
)), t(this,
|
|
214
|
-
const
|
|
215
|
-
t(this,
|
|
216
|
-
|
|
214
|
+
)), t(this, U).current && t(this, o).length) {
|
|
215
|
+
const r = t(this, D).current, c = (t(this, y) - t(this, L) * (r - 1)) / r;
|
|
216
|
+
t(this, o).forEach((b) => {
|
|
217
|
+
b.setSize(c);
|
|
217
218
|
});
|
|
218
219
|
} else
|
|
219
|
-
t(this,
|
|
220
|
-
|
|
220
|
+
t(this, o).forEach((r) => {
|
|
221
|
+
r.setSize();
|
|
221
222
|
});
|
|
222
|
-
if (t(this,
|
|
223
|
-
|
|
224
|
-
}), t(this,
|
|
225
|
-
|
|
226
|
-
const
|
|
227
|
-
this.vertical ? (t(this, p).style.width =
|
|
223
|
+
if (t(this, o).forEach((r) => {
|
|
224
|
+
r.resize();
|
|
225
|
+
}), t(this, R).current) {
|
|
226
|
+
h(this, S, t(this, y) * t(this, R).current);
|
|
227
|
+
const r = t(this, S) + t(this, y);
|
|
228
|
+
this.vertical ? (t(this, p).style.width = r + "px", t(this, p).style.height = "100%") : (t(this, p).style.height = r + "px", t(this, p).style.width = "100%");
|
|
228
229
|
} else
|
|
229
|
-
this.vertical ? (t(this, p).style.width = "100%", t(this, p).style.height = "max-content",
|
|
230
|
-
if (!t(this,
|
|
231
|
-
const
|
|
232
|
-
|
|
230
|
+
this.vertical ? (t(this, p).style.width = "100%", t(this, p).style.height = "max-content", h(this, S, t(this, p).offsetHeight - t(this, y))) : (t(this, p).style.width = "max-content", t(this, p).style.height = "100%", h(this, S, t(this, p).offsetWidth - t(this, y)));
|
|
231
|
+
if (!t(this, E).current) {
|
|
232
|
+
const r = getComputedStyle(this), c = this.vertical ? parseFloat(r.paddingBlockStart) + parseFloat(r.paddingBlockEnd) : parseFloat(r.paddingInlineStart) + parseFloat(r.paddingInlineEnd);
|
|
233
|
+
h(this, S, t(this, S) + c), t(this, a).max = t(this, S);
|
|
233
234
|
}
|
|
234
|
-
if (t(this,
|
|
235
|
-
const
|
|
236
|
-
|
|
235
|
+
if (t(this, E).current && t(this, o).length) {
|
|
236
|
+
const r = t(this, o)[t(this, o).length - 1], c = r.position + r.size - t(this, y), b = t(this, S) - c;
|
|
237
|
+
h(this, J, r.position + r.size + b);
|
|
237
238
|
} else
|
|
238
|
-
|
|
239
|
-
if (t(this,
|
|
240
|
-
const
|
|
241
|
-
t(this,
|
|
239
|
+
h(this, J, t(this, S));
|
|
240
|
+
if (t(this, H).current && t(this, o).length) {
|
|
241
|
+
const r = t(this, o)[i];
|
|
242
|
+
t(this, a).set(r.position, {
|
|
242
243
|
equalize: !0
|
|
243
244
|
});
|
|
244
245
|
} else
|
|
245
|
-
t(this,
|
|
246
|
+
t(this, a).set(e * t(this, S), {
|
|
246
247
|
equalize: !0
|
|
247
248
|
});
|
|
248
249
|
});
|
|
249
|
-
|
|
250
|
-
const
|
|
251
|
-
if (
|
|
252
|
-
let
|
|
253
|
-
for (let
|
|
254
|
-
const
|
|
255
|
-
|
|
250
|
+
s(this, Mt, () => {
|
|
251
|
+
const e = this.currentScrollValue;
|
|
252
|
+
if (h(this, vt, Math.max(0, e - t(this, S))), t(this, o).length) {
|
|
253
|
+
let i = 0;
|
|
254
|
+
for (let r = 0; r < t(this, o).length; r++) {
|
|
255
|
+
const c = t(this, o)[r];
|
|
256
|
+
c.transform(), this.targetScrollValue + c.size / 2 >= c.position && (i = r);
|
|
256
257
|
}
|
|
257
|
-
t(this,
|
|
258
|
+
t(this, g).current = i;
|
|
258
259
|
} else
|
|
259
|
-
this.vertical ? t(this, p).style.transform = `translate3d(0px, ${
|
|
260
|
-
|
|
260
|
+
this.vertical ? t(this, p).style.transform = `translate3d(0px, ${e * -1}px, 0px)` : t(this, p).style.transform = `translate3d(${e * -1}px, 0px, 0px)`;
|
|
261
|
+
bt.update(
|
|
261
262
|
this,
|
|
262
|
-
t(this,
|
|
263
|
-
|
|
263
|
+
t(this, P).current,
|
|
264
|
+
e
|
|
264
265
|
);
|
|
265
266
|
});
|
|
266
|
-
|
|
267
|
-
t(this,
|
|
268
|
-
t(this,
|
|
269
|
-
), t(this,
|
|
267
|
+
s(this, Ct, (e, i) => {
|
|
268
|
+
t(this, st).current && (t(this, K).current && (t(this, C).pauseAndContinue(
|
|
269
|
+
t(this, ot).current
|
|
270
|
+
), t(this, C).direction = Math.sign(i) || 1), t(this, Tt).call(this, e, i));
|
|
270
271
|
});
|
|
271
|
-
|
|
272
|
-
if (t(this,
|
|
273
|
-
if (t(this,
|
|
272
|
+
s(this, Tt, (e, i) => {
|
|
273
|
+
if (t(this, V).current) {
|
|
274
|
+
if (t(this, V).current < 0 && i > 0)
|
|
274
275
|
return;
|
|
275
|
-
if (t(this,
|
|
276
|
+
if (t(this, V).current > 0 && i < 0)
|
|
276
277
|
return;
|
|
277
278
|
}
|
|
278
|
-
if (t(this,
|
|
279
|
-
const
|
|
280
|
-
|
|
279
|
+
if (t(this, F).unlistenAnimationFrame(), !t(this, A).current && t(this, Z).current && (clearInterval(t(this, yt)), h(this, yt, setTimeout(() => {
|
|
280
|
+
const r = d(this, l, Xt).call(this);
|
|
281
|
+
r && this.scrollToSection(r.index, {
|
|
281
282
|
tween: {
|
|
282
|
-
duration: t(this,
|
|
283
|
+
duration: t(this, lt).current,
|
|
283
284
|
easing: be
|
|
284
285
|
}
|
|
285
286
|
});
|
|
286
|
-
}, t(this,
|
|
287
|
-
if (t(this,
|
|
288
|
-
const
|
|
289
|
-
t(this,
|
|
287
|
+
}, t(this, Z).current))), !(e === "drag" && !we.isMobile && !t(this, ht).current))
|
|
288
|
+
if (t(this, H).current) {
|
|
289
|
+
const r = Math.sign(i);
|
|
290
|
+
t(this, o).length ? this.shiftSections(r) : t(this, a).shift(r * t(this, y));
|
|
290
291
|
} else
|
|
291
|
-
t(this,
|
|
292
|
+
t(this, a).shift(i);
|
|
292
293
|
});
|
|
293
|
-
if (
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
const
|
|
297
|
-
|
|
294
|
+
if (qt) {
|
|
295
|
+
const e = this.attachShadow({ mode: "open" });
|
|
296
|
+
e.adoptedStyleSheets.push(De);
|
|
297
|
+
const i = document.createElement("div");
|
|
298
|
+
i.className = "static", i.innerHTML = '<slot name="static"></slot>', e.appendChild(i), h(this, p, document.createElement("div")), t(this, p).className = "content", h(this, gt, document.createElement("slot")), t(this, p).appendChild(t(this, gt)), e.appendChild(t(this, p));
|
|
298
299
|
}
|
|
299
300
|
}
|
|
300
301
|
get damped() {
|
|
301
|
-
return t(this,
|
|
302
|
+
return t(this, a);
|
|
302
303
|
}
|
|
303
304
|
get controlsCSSProperty() {
|
|
304
|
-
return t(this,
|
|
305
|
+
return t(this, st);
|
|
305
306
|
}
|
|
306
307
|
get axisCSSProperty() {
|
|
307
|
-
return t(this,
|
|
308
|
+
return t(this, P);
|
|
308
309
|
}
|
|
309
310
|
get directionCSSProperty() {
|
|
310
|
-
return t(this,
|
|
311
|
+
return t(this, V);
|
|
311
312
|
}
|
|
312
313
|
get pagesCSSProperty() {
|
|
313
|
-
return t(this,
|
|
314
|
+
return t(this, R);
|
|
314
315
|
}
|
|
315
316
|
get splitCSSProperty() {
|
|
316
|
-
return t(this,
|
|
317
|
+
return t(this, k);
|
|
317
318
|
}
|
|
318
319
|
get sectionalCSSProperty() {
|
|
319
|
-
return t(this,
|
|
320
|
+
return t(this, H);
|
|
320
321
|
}
|
|
321
322
|
get autoSizeCSSProperty() {
|
|
322
|
-
return t(this,
|
|
323
|
+
return t(this, U);
|
|
323
324
|
}
|
|
324
325
|
get wheelMaxDeltaCSSProperty() {
|
|
325
|
-
return t(this,
|
|
326
|
+
return t(this, G);
|
|
326
327
|
}
|
|
327
328
|
get sectionsInViewCSSProperty() {
|
|
328
|
-
return t(this,
|
|
329
|
+
return t(this, D);
|
|
329
330
|
}
|
|
330
331
|
get loopCSSProperty() {
|
|
331
|
-
return t(this,
|
|
332
|
+
return t(this, E);
|
|
332
333
|
}
|
|
333
334
|
get dampingCSSProperty() {
|
|
334
|
-
return t(this,
|
|
335
|
+
return t(this, it);
|
|
335
336
|
}
|
|
336
337
|
get massCSSProperty() {
|
|
337
|
-
return t(this,
|
|
338
|
+
return t(this, rt);
|
|
338
339
|
}
|
|
339
340
|
get stiffnessCSSProperty() {
|
|
340
|
-
return t(this,
|
|
341
|
+
return t(this, nt);
|
|
341
342
|
}
|
|
342
343
|
get mouseDragCSSProperty() {
|
|
343
|
-
return t(this,
|
|
344
|
+
return t(this, ht);
|
|
344
345
|
}
|
|
345
346
|
get sectionDistanceScaleCSSProperty() {
|
|
346
|
-
return t(this,
|
|
347
|
+
return t(this, St);
|
|
347
348
|
}
|
|
348
349
|
get autoplayCSSProperty() {
|
|
349
|
-
return t(this,
|
|
350
|
+
return t(this, A);
|
|
350
351
|
}
|
|
351
352
|
get autoplayPauseDurationCSSProperty() {
|
|
352
|
-
return t(this,
|
|
353
|
+
return t(this, ot);
|
|
353
354
|
}
|
|
354
355
|
get autoplayUserDirectionCSSProperty() {
|
|
355
|
-
return t(this,
|
|
356
|
+
return t(this, K);
|
|
356
357
|
}
|
|
357
358
|
get classesCSSProperty() {
|
|
358
|
-
return t(this,
|
|
359
|
+
return t(this, I);
|
|
359
360
|
}
|
|
360
361
|
get currentIndexStartOffsetCSSProperty() {
|
|
361
|
-
return t(this,
|
|
362
|
+
return t(this, _);
|
|
362
363
|
}
|
|
363
364
|
get currentIndexEndOffsetCSSProperty() {
|
|
364
|
-
return t(this,
|
|
365
|
+
return t(this, O);
|
|
365
366
|
}
|
|
366
367
|
get focusDelayCSSProperty() {
|
|
367
|
-
return t(this,
|
|
368
|
+
return t(this, Z);
|
|
368
369
|
}
|
|
369
370
|
get focusDurationCSSProperty() {
|
|
370
|
-
return t(this,
|
|
371
|
+
return t(this, lt);
|
|
371
372
|
}
|
|
372
373
|
get disabledCSSProperty() {
|
|
373
|
-
return t(this,
|
|
374
|
+
return t(this, ct);
|
|
374
375
|
}
|
|
375
376
|
get hibernatedCSSProperty() {
|
|
376
|
-
return t(this,
|
|
377
|
+
return t(this, ut);
|
|
377
378
|
}
|
|
378
379
|
get currentScrollValue() {
|
|
379
|
-
return
|
|
380
|
+
return d(this, l, Qt).call(this, "current");
|
|
380
381
|
}
|
|
381
382
|
get targetScrollValue() {
|
|
382
|
-
return
|
|
383
|
+
return d(this, l, Qt).call(this, "target");
|
|
383
384
|
}
|
|
384
385
|
get contentElement() {
|
|
385
386
|
return t(this, p);
|
|
386
387
|
}
|
|
387
388
|
get sections() {
|
|
388
|
-
return t(this,
|
|
389
|
+
return t(this, o);
|
|
389
390
|
}
|
|
390
391
|
get position() {
|
|
391
|
-
return t(this,
|
|
392
|
+
return t(this, At);
|
|
392
393
|
}
|
|
393
394
|
get contentPosition() {
|
|
394
|
-
return t(this,
|
|
395
|
+
return t(this, It);
|
|
395
396
|
}
|
|
396
397
|
get viewportSize() {
|
|
397
|
-
return t(this,
|
|
398
|
+
return t(this, y);
|
|
398
399
|
}
|
|
399
400
|
get scrollSize() {
|
|
400
|
-
return t(this,
|
|
401
|
+
return t(this, S);
|
|
401
402
|
}
|
|
402
403
|
get gap() {
|
|
403
|
-
return t(this,
|
|
404
|
+
return t(this, L);
|
|
404
405
|
}
|
|
405
406
|
get counter() {
|
|
406
|
-
return t(this,
|
|
407
|
+
return t(this, g);
|
|
407
408
|
}
|
|
408
409
|
get limit() {
|
|
409
|
-
return t(this,
|
|
410
|
+
return t(this, o).length - t(this, D).current;
|
|
410
411
|
}
|
|
411
412
|
get distance() {
|
|
412
|
-
return t(this,
|
|
413
|
+
return t(this, J);
|
|
413
414
|
}
|
|
414
415
|
get loopDistance() {
|
|
415
|
-
return t(this,
|
|
416
|
+
return t(this, E).current ? t(this, J) + t(this, L) : t(this, J);
|
|
416
417
|
}
|
|
417
418
|
get overscroll() {
|
|
418
|
-
return t(this,
|
|
419
|
+
return t(this, vt);
|
|
419
420
|
}
|
|
420
421
|
get vertical() {
|
|
421
|
-
return t(this,
|
|
422
|
+
return t(this, P).current === "y";
|
|
422
423
|
}
|
|
423
424
|
get currentProgress() {
|
|
424
425
|
return this.currentScrollValue / this.loopDistance || 0;
|
|
@@ -427,212 +428,212 @@ class Hs extends HTMLElement {
|
|
|
427
428
|
return this.targetScrollValue / this.loopDistance || 0;
|
|
428
429
|
}
|
|
429
430
|
get scrollWidth() {
|
|
430
|
-
return t(this,
|
|
431
|
+
return t(this, P).current === "y" ? 0 : t(this, a).distance;
|
|
431
432
|
}
|
|
432
433
|
get scrollHeight() {
|
|
433
|
-
return t(this,
|
|
434
|
+
return t(this, P).current === "x" ? 0 : t(this, a).distance;
|
|
434
435
|
}
|
|
435
|
-
onScroll(...
|
|
436
|
-
return t(this,
|
|
436
|
+
onScroll(...e) {
|
|
437
|
+
return t(this, a).subscribe(...e);
|
|
437
438
|
}
|
|
438
|
-
offScroll(...
|
|
439
|
-
t(this,
|
|
439
|
+
offScroll(...e) {
|
|
440
|
+
t(this, a).unsubscribe(...e);
|
|
440
441
|
}
|
|
441
442
|
//https://github.com/pmndrs/drei/blob/d3282cdd02d170ef603a5e096505d83dc93cd57a/src/web/ScrollControls.tsx#L85C7-L100C9
|
|
442
|
-
range(
|
|
443
|
-
const
|
|
444
|
-
return this.currentProgress <
|
|
443
|
+
range(e, i, r = 0) {
|
|
444
|
+
const c = e - r, b = c + i + r * 2;
|
|
445
|
+
return this.currentProgress < c ? 0 : this.currentProgress > b ? 1 : (this.currentProgress - c) / (b - c);
|
|
445
446
|
}
|
|
446
|
-
curve(
|
|
447
|
-
return Math.sin(this.range(
|
|
447
|
+
curve(e, i, r = 0) {
|
|
448
|
+
return Math.sin(this.range(e, i, r) * Math.PI);
|
|
448
449
|
}
|
|
449
|
-
visible(
|
|
450
|
-
const
|
|
451
|
-
return this.currentProgress >=
|
|
450
|
+
visible(e, i, r = 0) {
|
|
451
|
+
const c = e - r, b = c + i + r * 2;
|
|
452
|
+
return this.currentProgress >= c && this.currentProgress <= b;
|
|
452
453
|
}
|
|
453
|
-
scrollToSection(
|
|
454
|
-
if (!t(this,
|
|
454
|
+
scrollToSection(e, i) {
|
|
455
|
+
if (!t(this, o).length)
|
|
455
456
|
return;
|
|
456
|
-
const
|
|
457
|
-
|
|
458
|
-
const
|
|
459
|
-
if (
|
|
460
|
-
let
|
|
461
|
-
const
|
|
462
|
-
t(this,
|
|
457
|
+
const r = t(this, g).current;
|
|
458
|
+
d(this, l, ce).call(this, e);
|
|
459
|
+
const c = t(this, o)[r], b = t(this, o)[t(this, g).current];
|
|
460
|
+
if (c && b) {
|
|
461
|
+
let w = 0;
|
|
462
|
+
const ft = d(this, l, Xt).call(this), ae = ft ? this.targetScrollValue - ft.position : 0;
|
|
463
|
+
t(this, E).current ? t(this, g).current === 0 && r === t(this, o).length - 1 ? w = t(this, S) + t(this, y) - c.position + t(this, L) : t(this, g).current === t(this, o).length - 1 && r === 0 ? w = b.position - (t(this, S) + t(this, y) + t(this, L)) : w = b.position - c.position : w = b.position - c.position, this.shiftPosition(w - ae, i);
|
|
463
464
|
}
|
|
464
465
|
}
|
|
465
|
-
shiftSections(
|
|
466
|
-
t(this,
|
|
466
|
+
shiftSections(e, i) {
|
|
467
|
+
t(this, o).length && this.scrollToSection(t(this, g).current + e, i);
|
|
467
468
|
}
|
|
468
|
-
setPosition(
|
|
469
|
-
|
|
470
|
-
equalize: (
|
|
469
|
+
setPosition(e, i) {
|
|
470
|
+
i != null && i.tween ? (t(this, F).set(t(this, a).current, { equalize: !0 }), t(this, F).set(e, ie({}, i.tween))) : t(this, a).set(e, {
|
|
471
|
+
equalize: (i == null ? void 0 : i.behaviour) === "instant"
|
|
471
472
|
});
|
|
472
473
|
}
|
|
473
|
-
shiftPosition(
|
|
474
|
-
this.setPosition(t(this,
|
|
474
|
+
shiftPosition(e, i) {
|
|
475
|
+
this.setPosition(t(this, a).target + e, i);
|
|
475
476
|
}
|
|
476
477
|
connectedCallback() {
|
|
477
|
-
|
|
478
|
+
h(this, a, new ge(0, {
|
|
478
479
|
damping: 0.01,
|
|
479
480
|
min: 0,
|
|
480
|
-
order:
|
|
481
|
-
})), this.setAttribute("tabindex", "0"),
|
|
481
|
+
order: Se.SCROLL
|
|
482
|
+
})), this.setAttribute("tabindex", "0"), h(this, M, new ye({ element: t(this, p) })), t(this, M).changeEvent.subscribe(t(this, Ct)), h(this, j, new Ce({
|
|
482
483
|
element: this
|
|
483
|
-
})), t(this,
|
|
484
|
-
t(this,
|
|
485
|
-
),
|
|
484
|
+
})), t(this, j).changeEvent.subscribe(
|
|
485
|
+
t(this, Ct)
|
|
486
|
+
), h(this, B, new Ee({ element: t(this, p) })), t(this, B).changeEvent.subscribe(t(this, Ct)), h(this, C, new xe({
|
|
486
487
|
culling: this
|
|
487
|
-
})), t(this,
|
|
488
|
-
t(this, p).style.flexDirection =
|
|
489
|
-
}), t(this,
|
|
490
|
-
t(this,
|
|
491
|
-
}), t(this,
|
|
492
|
-
this.isConnected && t(this,
|
|
493
|
-
}), t(this,
|
|
494
|
-
this.isConnected && (
|
|
495
|
-
}), t(this,
|
|
496
|
-
t(this,
|
|
497
|
-
}), t(this,
|
|
498
|
-
this.isConnected && (t(this,
|
|
499
|
-
}), t(this,
|
|
500
|
-
this.isConnected && (t(this,
|
|
501
|
-
}), t(this,
|
|
502
|
-
|
|
503
|
-
}), t(this,
|
|
504
|
-
t(this,
|
|
505
|
-
}), t(this,
|
|
506
|
-
t(this,
|
|
507
|
-
}), t(this,
|
|
508
|
-
t(this,
|
|
509
|
-
}), t(this,
|
|
510
|
-
|
|
511
|
-
}), t(this,
|
|
512
|
-
|
|
513
|
-
}), t(this,
|
|
514
|
-
t(this,
|
|
515
|
-
}), t(this,
|
|
516
|
-
|
|
517
|
-
}), t(this,
|
|
518
|
-
this.isConnected &&
|
|
519
|
-
}), t(this,
|
|
520
|
-
this.isConnected && t(this,
|
|
521
|
-
}), t(this,
|
|
522
|
-
this.isConnected && t(this,
|
|
523
|
-
}), t(this,
|
|
524
|
-
this.classList.toggle("active",
|
|
525
|
-
}), t(this,
|
|
526
|
-
t(this,
|
|
527
|
-
}), t(this,
|
|
528
|
-
t(this,
|
|
529
|
-
}), t(this,
|
|
488
|
+
})), t(this, C).changeEvent.subscribe(t(this, Tt)), t(this, P).subscribe(({ current: e }) => {
|
|
489
|
+
t(this, p).style.flexDirection = e === "x" ? "row" : "column", t(this, M).axis = t(this, G).current ? "max" : e, t(this, j).dimension = e === "x" ? "width" : "height", t(this, B).axis = e, e === "x" ? this.style.touchAction = "pan-y" : e === "y" && (this.style.touchAction = "pan-x"), this.isConnected && t(this, z).call(this);
|
|
490
|
+
}), t(this, G).subscribe((e) => {
|
|
491
|
+
t(this, M).axis = e.current ? "max" : t(this, P).current;
|
|
492
|
+
}), t(this, R).subscribe(() => {
|
|
493
|
+
this.isConnected && t(this, z).call(this);
|
|
494
|
+
}), t(this, k).subscribe(({ current: e }) => {
|
|
495
|
+
this.isConnected && (e ? d(this, l, zt).call(this) : d(this, l, mt).call(this));
|
|
496
|
+
}), t(this, H).subscribe((e) => {
|
|
497
|
+
t(this, M).debounce = e.current, t(this, B).swipe = e.current, t(this, C).interval = e.current, this.isConnected && (e.current && !e.previous && !t(this, o).length ? d(this, l, zt).call(this) : !e.current && e.previous && t(this, o).length && d(this, l, mt).call(this));
|
|
498
|
+
}), t(this, U).subscribe((e) => {
|
|
499
|
+
this.isConnected && (t(this, z).call(this), e.current && !e.previous && !t(this, o).length ? d(this, l, zt).call(this) : !e.current && e.previous && t(this, o).length && d(this, l, mt).call(this));
|
|
500
|
+
}), t(this, D).subscribe((e) => {
|
|
501
|
+
this.isConnected && (t(this, z).call(this), d(this, l, tt).call(this));
|
|
502
|
+
}), t(this, E).subscribe((e) => {
|
|
503
|
+
e.current ? (this.isConnected && (t(this, o).length || (t(this, k).current = !0)), t(this, o).length && (t(this, a).max = 1 / 0, t(this, a).min = -1 / 0)) : (h(this, vt, 0), t(this, a).max = t(this, S), t(this, a).min = 0);
|
|
504
|
+
}), t(this, it).subscribe((e) => {
|
|
505
|
+
t(this, a).damping = e.current;
|
|
506
|
+
}), t(this, rt).subscribe((e) => {
|
|
507
|
+
t(this, a).mass = e.current;
|
|
508
|
+
}), t(this, nt).subscribe((e) => {
|
|
509
|
+
t(this, a).stiffness = e.current;
|
|
510
|
+
}), t(this, ct).subscribe((e) => {
|
|
511
|
+
e.current && !e.previous ? d(this, l, _t).call(this) : !e.current && e.previous && d(this, l, Zt).call(this);
|
|
512
|
+
}), t(this, ut).subscribe((e) => {
|
|
513
|
+
e.current && !e.previous ? d(this, l, jt).call(this) : !e.current && e.previous && d(this, l, Jt).call(this);
|
|
514
|
+
}), t(this, A).subscribe((e) => {
|
|
515
|
+
t(this, C).speed = e.current, e.current && !e.previous ? t(this, C).connect() : !e.current && e.previous && t(this, C).disconnect();
|
|
516
|
+
}), t(this, K).subscribe((e) => {
|
|
517
|
+
e.current || (t(this, C).direction = 1);
|
|
518
|
+
}), t(this, I).subscribe((e) => {
|
|
519
|
+
this.isConnected && d(this, l, tt).call(this);
|
|
520
|
+
}), t(this, _).subscribe((e) => {
|
|
521
|
+
this.isConnected && t(this, I).current && d(this, l, tt).call(this);
|
|
522
|
+
}), t(this, O).subscribe((e) => {
|
|
523
|
+
this.isConnected && t(this, I).current && d(this, l, tt).call(this);
|
|
524
|
+
}), t(this, a).isRunning.subscribe((e) => {
|
|
525
|
+
this.classList.toggle("active", e.current);
|
|
526
|
+
}), t(this, g).subscribe((e) => {
|
|
527
|
+
t(this, o).length && d(this, l, tt).call(this);
|
|
528
|
+
}), t(this, F).subscribe((e) => {
|
|
529
|
+
t(this, F).isRunning.current && t(this, a).set(e.current);
|
|
530
|
+
}), t(this, st).observe(), t(this, P).observe(), t(this, V).observe(), t(this, R).observe(), t(this, k).observe(), t(this, H).observe(), t(this, U).observe(), t(this, G).observe(), t(this, D).observe(), t(this, E).observe(), t(this, it).observe(), t(this, rt).observe(), t(this, nt).observe(), t(this, ht).observe(), t(this, St).observe(), t(this, A).observe(), t(this, A).observe(), t(this, ot).observe(), t(this, K).observe(), t(this, I).observe(), t(this, _).observe(), t(this, O).observe(), t(this, Z).observe(), t(this, lt).observe(), t(this, ct).observe(), t(this, ut).observe(), d(this, l, Jt).call(this);
|
|
530
531
|
}
|
|
531
532
|
disconnectedCallback() {
|
|
532
|
-
this.setAttribute("tabindex", ""), t(this,
|
|
533
|
+
this.setAttribute("tabindex", ""), t(this, st).unobserve(), t(this, P).unobserve(), t(this, V).unobserve(), t(this, R).unobserve(), t(this, k).unobserve(), t(this, H).unobserve(), t(this, U).unobserve(), t(this, G).unobserve(), t(this, D).unobserve(), t(this, E).unobserve(), t(this, it).unobserve(), t(this, rt).unobserve(), t(this, nt).unobserve(), t(this, ht).unobserve(), t(this, St).unobserve(), t(this, A).unobserve(), t(this, ot).unobserve(), t(this, K).unobserve(), t(this, I).unobserve(), t(this, _).unobserve(), t(this, O).unobserve(), t(this, Z).unobserve(), t(this, lt).unobserve(), t(this, ct).unobserve(), t(this, ut).unobserve(), d(this, l, jt).call(this);
|
|
533
534
|
}
|
|
534
535
|
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
}), t(this, p).style.transform = "",
|
|
536
|
+
a = new WeakMap(), st = new WeakMap(), P = new WeakMap(), V = new WeakMap(), R = new WeakMap(), k = new WeakMap(), H = new WeakMap(), U = new WeakMap(), G = new WeakMap(), D = new WeakMap(), E = new WeakMap(), it = new WeakMap(), rt = new WeakMap(), nt = new WeakMap(), ht = new WeakMap(), St = new WeakMap(), A = new WeakMap(), ot = new WeakMap(), K = new WeakMap(), I = new WeakMap(), _ = new WeakMap(), O = new WeakMap(), Z = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(), ut = new WeakMap(), p = new WeakMap(), gt = new WeakMap(), o = new WeakMap(), At = new WeakMap(), It = new WeakMap(), y = new WeakMap(), S = new WeakMap(), L = new WeakMap(), M = new WeakMap(), j = new WeakMap(), B = new WeakMap(), C = new WeakMap(), g = new WeakMap(), vt = new WeakMap(), J = new WeakMap(), at = new WeakMap(), dt = new WeakMap(), yt = new WeakMap(), F = new WeakMap(), l = new WeakSet(), zt = function() {
|
|
537
|
+
d(this, l, mt).call(this), t(this, gt).assignedElements().forEach((e, i) => {
|
|
538
|
+
e instanceof HTMLElement && t(this, o).push(new ke(e, i, this));
|
|
539
|
+
}), t(this, p).style.transform = "", Ut(this, "scrollSectionsChange", {
|
|
539
540
|
custom: !0,
|
|
540
541
|
composed: !0
|
|
541
|
-
}), t(this,
|
|
542
|
-
},
|
|
543
|
-
t(this,
|
|
544
|
-
|
|
545
|
-
}),
|
|
542
|
+
}), t(this, z).call(this), d(this, l, tt).call(this);
|
|
543
|
+
}, mt = function() {
|
|
544
|
+
t(this, o).forEach((e) => {
|
|
545
|
+
e.destroy();
|
|
546
|
+
}), h(this, o, []), t(this, g).current = 0, t(this, a).reset(), Ut(this, "scrollSectionsChange", {
|
|
546
547
|
custom: !0,
|
|
547
548
|
composed: !0
|
|
548
549
|
});
|
|
549
|
-
},
|
|
550
|
-
t(this,
|
|
551
|
-
},
|
|
552
|
-
t(this,
|
|
553
|
-
},
|
|
554
|
-
t(this,
|
|
555
|
-
},
|
|
556
|
-
t(this,
|
|
557
|
-
},
|
|
558
|
-
t(this,
|
|
559
|
-
},
|
|
560
|
-
if (t(this,
|
|
561
|
-
const
|
|
562
|
-
return
|
|
550
|
+
}, _t = function() {
|
|
551
|
+
t(this, at) || (h(this, at, !0), t(this, a).unsubscribe(t(this, Mt)), t(this, a).unlistenAnimationFrame(), t(this, M).disconnect(), t(this, j).disconnect(), t(this, B).disconnect(), t(this, C).disconnect(), clearInterval(t(this, yt)), t(this, F).unlistenAnimationFrame());
|
|
552
|
+
}, Zt = function() {
|
|
553
|
+
t(this, at) && (h(this, at, !1), t(this, a).subscribe(t(this, Mt)), t(this, M).connect(), t(this, j).connect(), t(this, B).connect(), t(this, A).current && t(this, C).connect());
|
|
554
|
+
}, jt = function() {
|
|
555
|
+
t(this, dt) || (h(this, dt, !0), Wt.unsubscribe(t(this, z)), $t.unsubscribe(t(this, z)), t(this, a).reset(), d(this, l, _t).call(this), t(this, p).style.transform = "", t(this, k).current && d(this, l, mt).call(this), bt.unregister(this));
|
|
556
|
+
}, Jt = function() {
|
|
557
|
+
t(this, dt) && (h(this, dt, !1), t(this, k).current && d(this, l, zt).call(this), bt.register(this), Wt.subscribe(t(this, z), oe.SCROLL), $t.subscribe(this, t(this, z)), d(this, l, Zt).call(this));
|
|
558
|
+
}, z = new WeakMap(), Mt = new WeakMap(), ce = function(e) {
|
|
559
|
+
t(this, E).current ? (t(this, g).current = e % t(this, o).length, t(this, g).current = t(this, g).current < 0 ? t(this, o).length + t(this, g).current : t(this, g).current) : t(this, g).current = he(e, 0, this.limit);
|
|
560
|
+
}, Ct = new WeakMap(), Tt = new WeakMap(), Qt = function(e = "current") {
|
|
561
|
+
if (t(this, E).current && t(this, o).length) {
|
|
562
|
+
const i = t(this, a)[e] % (t(this, S) + t(this, y) + t(this, L));
|
|
563
|
+
return i < 0 ? t(this, S) + i + t(this, y) + t(this, L) : i;
|
|
563
564
|
} else
|
|
564
|
-
return t(this,
|
|
565
|
-
},
|
|
566
|
-
if (t(this,
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
const
|
|
570
|
-
t(this,
|
|
571
|
-
const
|
|
572
|
-
|
|
565
|
+
return t(this, a)[e];
|
|
566
|
+
}, tt = function() {
|
|
567
|
+
if (t(this, I).current && t(this, o).length) {
|
|
568
|
+
const e = t(this, g).current + t(this, _).current;
|
|
569
|
+
e === 0 ? this.classList.add("start") : this.classList.remove("start"), e === this.limit ? this.classList.add("end") : this.classList.remove("end");
|
|
570
|
+
const i = t(this, D).current + t(this, O).current;
|
|
571
|
+
t(this, o).forEach((r, c) => {
|
|
572
|
+
const b = e - this.limit - 1 + t(this, O).current, w = e + i, ft = this.sections.length - w;
|
|
573
|
+
c >= e && c < w || c <= b ? r.mark("current") : c >= w && c < w + ft / 2 || c <= b + i ? r.mark("next") : r.mark("previous");
|
|
573
574
|
});
|
|
574
575
|
}
|
|
575
|
-
},
|
|
576
|
-
let
|
|
577
|
-
for (let
|
|
578
|
-
const
|
|
579
|
-
|
|
576
|
+
}, Xt = function() {
|
|
577
|
+
let e = null, i = 1 / 0;
|
|
578
|
+
for (let r = 0; r < t(this, o).length; r++) {
|
|
579
|
+
const c = Math.abs(t(this, o)[r].position - this.targetScrollValue);
|
|
580
|
+
c < i && (i = c, e = r);
|
|
580
581
|
}
|
|
581
|
-
return
|
|
582
|
+
return e !== null ? t(this, o)[e] : null;
|
|
582
583
|
};
|
|
583
|
-
customElements.get("e-scroll") || customElements.define("e-scroll",
|
|
584
|
-
var
|
|
585
|
-
class
|
|
584
|
+
customElements.get("e-scroll") || customElements.define("e-scroll", kt);
|
|
585
|
+
var Vt;
|
|
586
|
+
class Yt extends HTMLElement {
|
|
586
587
|
constructor() {
|
|
587
588
|
super(...arguments);
|
|
588
|
-
|
|
589
|
+
s(this, Vt, null);
|
|
589
590
|
}
|
|
590
591
|
get scrollElement() {
|
|
591
|
-
return t(this,
|
|
592
|
+
return t(this, Vt);
|
|
592
593
|
}
|
|
593
594
|
connectedCallback() {
|
|
594
|
-
const
|
|
595
|
-
|
|
595
|
+
const e = le(this, kt);
|
|
596
|
+
e instanceof kt ? h(this, Vt, e) : console.error(this, "e-scroll not found");
|
|
596
597
|
}
|
|
597
598
|
}
|
|
598
|
-
|
|
599
|
-
var
|
|
600
|
-
class
|
|
599
|
+
Vt = new WeakMap();
|
|
600
|
+
var Q, x, W, $, Et, xt, pt, Rt, Ht, Ot;
|
|
601
|
+
class Ae extends Yt {
|
|
601
602
|
constructor() {
|
|
602
603
|
super();
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
const
|
|
612
|
-
|
|
604
|
+
s(this, Q, null);
|
|
605
|
+
s(this, x, null);
|
|
606
|
+
s(this, W, !1);
|
|
607
|
+
s(this, $, 0);
|
|
608
|
+
s(this, Et, 0);
|
|
609
|
+
s(this, xt, 0);
|
|
610
|
+
s(this, pt, () => {
|
|
611
|
+
h(this, W, this.offsetWidth > this.offsetHeight);
|
|
612
|
+
const e = t(this, W) ? this.offsetWidth : this.offsetHeight;
|
|
613
|
+
h(this, $, e / ((this.scrollElement.scrollSize + this.scrollElement.viewportSize) / e)), h(this, $, Math.max(t(this, $), 30)), t(this, W) ? (t(this, x).style.width = t(this, $) + "px", t(this, x).style.height = "100%") : (t(this, x).style.width = "100%", t(this, x).style.height = t(this, $) + "px"), h(this, Et, e - t(this, $)), this.scrollElement.scrollSize || (this.style.display = "none");
|
|
613
614
|
});
|
|
614
|
-
|
|
615
|
-
|
|
615
|
+
s(this, Rt, () => {
|
|
616
|
+
h(this, xt, this.scrollElement.currentProgress * t(this, Et)), t(this, W) ? t(this, x).style.transform = `translate3d(${t(this, xt)}px, 0px, 0px)` : t(this, x).style.transform = `translate3d(0px, ${t(this, xt)}px, 0px)`;
|
|
616
617
|
});
|
|
617
|
-
|
|
618
|
+
s(this, Ht, () => {
|
|
618
619
|
this.setAttribute("axis", this.scrollElement.axisCSSProperty.current);
|
|
619
620
|
});
|
|
620
|
-
|
|
621
|
-
document.documentElement.classList.add("grabbing"),
|
|
622
|
-
(
|
|
623
|
-
const
|
|
624
|
-
this.scrollElement.setPosition(
|
|
621
|
+
s(this, Ot, (e) => {
|
|
622
|
+
document.documentElement.classList.add("grabbing"), Pe(
|
|
623
|
+
(c) => {
|
|
624
|
+
const b = t(this, W) ? c.x : c.y, w = this.scrollElement.distance / t(this, Et), ft = (b - r) * w;
|
|
625
|
+
this.scrollElement.setPosition(i + ft);
|
|
625
626
|
},
|
|
626
627
|
() => {
|
|
627
628
|
document.documentElement.classList.remove("grabbing");
|
|
628
629
|
}
|
|
629
630
|
);
|
|
630
|
-
const
|
|
631
|
+
const i = this.scrollElement.damped.target, r = t(this, W) ? e.x : e.y;
|
|
631
632
|
});
|
|
632
|
-
if (
|
|
633
|
-
const
|
|
634
|
-
|
|
635
|
-
|
|
633
|
+
if (qt) {
|
|
634
|
+
const e = this.attachShadow({ mode: "open" });
|
|
635
|
+
e.adoptedStyleSheets.push(
|
|
636
|
+
ne({
|
|
636
637
|
":host": {
|
|
637
638
|
display: "inline-block",
|
|
638
639
|
zIndex: "1",
|
|
@@ -661,466 +662,119 @@ class Fe extends Ts {
|
|
|
661
662
|
touchAction: "none"
|
|
662
663
|
}
|
|
663
664
|
})
|
|
664
|
-
),
|
|
665
|
+
), h(this, Q, document.createElement("slot")), t(this, Q).innerHTML = '<div class="default-thumb"></div>', e.appendChild(t(this, Q));
|
|
665
666
|
}
|
|
666
667
|
}
|
|
667
668
|
get thumbElement() {
|
|
668
|
-
return t(this,
|
|
669
|
+
return t(this, x);
|
|
669
670
|
}
|
|
670
671
|
connectedCallback() {
|
|
671
672
|
super.connectedCallback(), this.setAttribute("drag-dead-zone", "");
|
|
672
|
-
const
|
|
673
|
-
|
|
673
|
+
const e = t(this, Q).assignedElements()[0] || t(this, Q).firstElementChild;
|
|
674
|
+
h(this, x, e), t(this, x).addEventListener("pointerdown", t(this, Ot)), Wt.subscribe(t(this, pt), oe.SCROLL), $t.subscribe(this, t(this, pt)), this.scrollElement.onScroll(t(this, Rt)), this.scrollElement.axisCSSProperty.subscribe(t(this, Ht));
|
|
674
675
|
}
|
|
675
676
|
disconnectedCallback() {
|
|
676
|
-
this.removeAttribute("drag-dead-zone"), t(this,
|
|
677
|
+
this.removeAttribute("drag-dead-zone"), t(this, x).removeEventListener("pointerdown", t(this, Ot)), Wt.unsubscribe(t(this, pt)), $t.unsubscribe(t(this, pt)), this.scrollElement.offScroll(t(this, Rt)), this.scrollElement.axisCSSProperty.unsubscribe(t(this, Ht));
|
|
677
678
|
}
|
|
678
679
|
}
|
|
679
|
-
|
|
680
|
-
customElements.get("e-scrollbar") || customElements.define("e-scrollbar",
|
|
681
|
-
class
|
|
680
|
+
Q = new WeakMap(), x = new WeakMap(), W = new WeakMap(), $ = new WeakMap(), Et = new WeakMap(), xt = new WeakMap(), pt = new WeakMap(), Rt = new WeakMap(), Ht = new WeakMap(), Ot = new WeakMap();
|
|
681
|
+
customElements.get("e-scrollbar") || customElements.define("e-scrollbar", Ae);
|
|
682
|
+
class ue extends Yt {
|
|
682
683
|
constructor() {
|
|
683
|
-
super(),
|
|
684
|
+
super(), qt && this.addEventListener("click", () => {
|
|
684
685
|
this.handleClick();
|
|
685
686
|
});
|
|
686
687
|
}
|
|
687
688
|
}
|
|
688
|
-
class
|
|
689
|
+
class Ie extends ue {
|
|
689
690
|
handleClick() {
|
|
690
|
-
const n = this.getAttribute("index"),
|
|
691
|
-
this.scrollElement.scrollToSection(parseInt(n || "0"), { behaviour:
|
|
691
|
+
const n = this.getAttribute("index"), e = this.getAttribute("behaviour");
|
|
692
|
+
this.scrollElement.scrollToSection(parseInt(n || "0"), { behaviour: e });
|
|
692
693
|
}
|
|
693
694
|
}
|
|
694
|
-
customElements.get("e-scroll-set-button") || customElements.define("e-scroll-set-button",
|
|
695
|
-
class
|
|
695
|
+
customElements.get("e-scroll-set-button") || customElements.define("e-scroll-set-button", Ie);
|
|
696
|
+
class Me extends ue {
|
|
696
697
|
handleClick() {
|
|
697
|
-
const n = this.getAttribute("step"),
|
|
698
|
-
this.scrollElement.shiftSections(parseInt(n || "1"), { behaviour:
|
|
698
|
+
const n = this.getAttribute("step"), e = this.getAttribute("behaviour");
|
|
699
|
+
this.scrollElement.shiftSections(parseInt(n || "1"), { behaviour: e });
|
|
699
700
|
}
|
|
700
701
|
}
|
|
701
|
-
customElements.get("e-scroll-step-button") || customElements.define("e-scroll-step-button",
|
|
702
|
-
var
|
|
703
|
-
class
|
|
704
|
-
constructor(n,
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
t(this,
|
|
711
|
-
behaviour: t(this,
|
|
702
|
+
customElements.get("e-scroll-step-button") || customElements.define("e-scroll-step-button", Me);
|
|
703
|
+
var q, X, wt, Bt, Ft, Pt;
|
|
704
|
+
class Te {
|
|
705
|
+
constructor(n, e, i) {
|
|
706
|
+
s(this, q, null);
|
|
707
|
+
s(this, X, null);
|
|
708
|
+
s(this, wt, null);
|
|
709
|
+
s(this, Bt, null);
|
|
710
|
+
s(this, Ft, () => {
|
|
711
|
+
t(this, X).scrollToSection(t(this, wt), {
|
|
712
|
+
behaviour: t(this, Bt)
|
|
712
713
|
});
|
|
713
714
|
});
|
|
714
|
-
|
|
715
|
-
t(this,
|
|
715
|
+
s(this, Pt, () => {
|
|
716
|
+
t(this, q).classList.toggle(
|
|
716
717
|
"current",
|
|
717
|
-
t(this,
|
|
718
|
+
t(this, X).counter.current === t(this, wt)
|
|
718
719
|
);
|
|
719
720
|
});
|
|
720
|
-
|
|
721
|
+
qt && (h(this, q, document.createElement("button")), h(this, X, n), h(this, Bt, i), h(this, wt, e), t(this, q).addEventListener("click", t(this, Ft)), t(this, X).counter.subscribe(t(this, Pt)), t(this, Pt).call(this));
|
|
721
722
|
}
|
|
722
723
|
get element() {
|
|
723
|
-
return t(this,
|
|
724
|
+
return t(this, q);
|
|
724
725
|
}
|
|
725
726
|
destroy() {
|
|
726
|
-
t(this,
|
|
727
|
+
t(this, q).removeEventListener("click", t(this, Ft)), t(this, X).counter.unsubscribe(t(this, Pt)), t(this, q).remove();
|
|
727
728
|
}
|
|
728
729
|
}
|
|
729
|
-
|
|
730
|
-
var
|
|
731
|
-
class
|
|
730
|
+
q = new WeakMap(), X = new WeakMap(), wt = new WeakMap(), Bt = new WeakMap(), Ft = new WeakMap(), Pt = new WeakMap();
|
|
731
|
+
var Y, Lt;
|
|
732
|
+
class Ve extends Yt {
|
|
732
733
|
constructor() {
|
|
733
734
|
super(...arguments);
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
t(this,
|
|
737
|
-
for (let
|
|
738
|
-
const
|
|
735
|
+
s(this, Y, []);
|
|
736
|
+
s(this, Lt, Le(() => {
|
|
737
|
+
t(this, Y).forEach((e) => e.destroy()), h(this, Y, []);
|
|
738
|
+
for (let e = 0; e < this.scrollElement.sections.length; e++) {
|
|
739
|
+
const i = new Te(
|
|
739
740
|
this.scrollElement,
|
|
740
|
-
|
|
741
|
+
e,
|
|
741
742
|
this.getAttribute("behaviour") || "smooth"
|
|
742
743
|
);
|
|
743
|
-
this.appendChild(
|
|
744
|
+
this.appendChild(i.element), t(this, Y).push(i);
|
|
744
745
|
}
|
|
745
746
|
}, 0));
|
|
746
747
|
}
|
|
747
748
|
connectedCallback() {
|
|
748
749
|
super.connectedCallback(), this.scrollElement.addEventListener(
|
|
749
750
|
"sectionsChange",
|
|
750
|
-
t(this,
|
|
751
|
-
), t(this,
|
|
751
|
+
t(this, Lt)
|
|
752
|
+
), t(this, Lt).call(this);
|
|
752
753
|
}
|
|
753
754
|
disconnectedCallback() {
|
|
754
755
|
this.scrollElement.removeEventListener(
|
|
755
756
|
"sectionsChange",
|
|
756
|
-
t(this,
|
|
757
|
-
), t(this,
|
|
757
|
+
t(this, Lt)
|
|
758
|
+
), t(this, Y).forEach((e) => e.destroy()), h(this, Y, []);
|
|
758
759
|
}
|
|
759
760
|
}
|
|
760
|
-
|
|
761
|
-
customElements.get("e-scroll-bullet-buttons") || customElements.define("e-scroll-bullet-buttons",
|
|
762
|
-
|
|
763
|
-
class Ie extends Ts {
|
|
764
|
-
constructor() {
|
|
765
|
-
super(...arguments);
|
|
766
|
-
i(this, S);
|
|
767
|
-
i(this, _t, new c(this, "--damping", 20));
|
|
768
|
-
i(this, Zt, new c(this, "--mass", 0));
|
|
769
|
-
i(this, jt, new c(this, "--stiffness", 0));
|
|
770
|
-
i(this, Jt, new c(this, "--target", ""));
|
|
771
|
-
i(this, Et, new c(this, "--disabled", !1));
|
|
772
|
-
i(this, xt, new c(
|
|
773
|
-
this,
|
|
774
|
-
"--distance-offset",
|
|
775
|
-
0,
|
|
776
|
-
{ rawValueCheck: !1 }
|
|
777
|
-
));
|
|
778
|
-
i(this, Lt, new c(this, "--start-offset", 0, {
|
|
779
|
-
rawValueCheck: !1
|
|
780
|
-
}));
|
|
781
|
-
i(this, Vt, new c(
|
|
782
|
-
this,
|
|
783
|
-
"--capture-once",
|
|
784
|
-
!1
|
|
785
|
-
));
|
|
786
|
-
i(this, V, new c(this, "--captured", ""));
|
|
787
|
-
i(this, O, new c(this, "--released", ""));
|
|
788
|
-
i(this, H, new c(
|
|
789
|
-
this,
|
|
790
|
-
"--captured-from-start",
|
|
791
|
-
""
|
|
792
|
-
));
|
|
793
|
-
i(this, B, new c(
|
|
794
|
-
this,
|
|
795
|
-
"--captured-from-finish",
|
|
796
|
-
""
|
|
797
|
-
));
|
|
798
|
-
i(this, zt, new c(
|
|
799
|
-
this,
|
|
800
|
-
"--released-from-start",
|
|
801
|
-
""
|
|
802
|
-
));
|
|
803
|
-
i(this, x, new c(
|
|
804
|
-
this,
|
|
805
|
-
"--released-from-finish",
|
|
806
|
-
""
|
|
807
|
-
));
|
|
808
|
-
i(this, ct, new c(this, "--passed-var", ""));
|
|
809
|
-
i(this, lt, new c(this, "--progress-var", ""));
|
|
810
|
-
i(this, ds, new c(
|
|
811
|
-
this,
|
|
812
|
-
"--animation-var-type",
|
|
813
|
-
"current"
|
|
814
|
-
));
|
|
815
|
-
i(this, ut, new c(this, "--distance-var", ""));
|
|
816
|
-
i(this, at, new c(this, "--start-var", ""));
|
|
817
|
-
i(this, dt, new c(this, "--finish-var", ""));
|
|
818
|
-
i(this, w, new Dt(!1));
|
|
819
|
-
i(this, $, new Dt(!1));
|
|
820
|
-
i(this, W, new Dt(!1));
|
|
821
|
-
i(this, j, new Dt(!1));
|
|
822
|
-
i(this, J, new Dt(!1));
|
|
823
|
-
i(this, q, new Dt(!1));
|
|
824
|
-
i(this, zs, []);
|
|
825
|
-
i(this, m, this);
|
|
826
|
-
i(this, Qt, 0);
|
|
827
|
-
i(this, Xt, 0);
|
|
828
|
-
i(this, Fs, 0);
|
|
829
|
-
i(this, z, new se(0, { order: te.SEGMENT, min: 0, max: 1 }));
|
|
830
|
-
i(this, Ft, 0);
|
|
831
|
-
i(this, R, 0);
|
|
832
|
-
i(this, F, 0);
|
|
833
|
-
i(this, N, 0);
|
|
834
|
-
i(this, fs, !1);
|
|
835
|
-
i(this, kt, !1);
|
|
836
|
-
i(this, P, !0);
|
|
837
|
-
i(this, ks, () => {
|
|
838
|
-
t(this, P) || (this.resize(), t(this, ps).call(this));
|
|
839
|
-
});
|
|
840
|
-
i(this, ps, () => {
|
|
841
|
-
!t(this, P) && t(this, fs) && this.tick();
|
|
842
|
-
});
|
|
843
|
-
i(this, Ds, ee(() => {
|
|
844
|
-
const s = Yt.getAll(this).reverse();
|
|
845
|
-
let e = 0;
|
|
846
|
-
s.forEach((h, a) => {
|
|
847
|
-
h.element === this.scrollElement && (e = a);
|
|
848
|
-
}), r(this, zs, s.slice(e + 1));
|
|
849
|
-
}, 0));
|
|
850
|
-
}
|
|
851
|
-
get distanceOffsetCSSProperty() {
|
|
852
|
-
return t(this, xt);
|
|
853
|
-
}
|
|
854
|
-
get startOffsetCSSProperty() {
|
|
855
|
-
return t(this, Lt);
|
|
856
|
-
}
|
|
857
|
-
get captureOnceCSSProperty() {
|
|
858
|
-
return t(this, Vt);
|
|
859
|
-
}
|
|
860
|
-
get capturedCSSProperty() {
|
|
861
|
-
return t(this, V);
|
|
862
|
-
}
|
|
863
|
-
get releasedCSSProperty() {
|
|
864
|
-
return t(this, O);
|
|
865
|
-
}
|
|
866
|
-
get capturedFromStartCSSProperty() {
|
|
867
|
-
return t(this, H);
|
|
868
|
-
}
|
|
869
|
-
get capturedFromFinishCSSProperty() {
|
|
870
|
-
return t(this, B);
|
|
871
|
-
}
|
|
872
|
-
get releasedFromStartCSSProperty() {
|
|
873
|
-
return t(this, zt);
|
|
874
|
-
}
|
|
875
|
-
get releasedFromFinishCSSProperty() {
|
|
876
|
-
return t(this, x);
|
|
877
|
-
}
|
|
878
|
-
get passedVarCSSProperty() {
|
|
879
|
-
return t(this, ct);
|
|
880
|
-
}
|
|
881
|
-
get progressVarCSSProperty() {
|
|
882
|
-
return t(this, lt);
|
|
883
|
-
}
|
|
884
|
-
get animationVarTypeCSSProperty() {
|
|
885
|
-
return t(this, ds);
|
|
886
|
-
}
|
|
887
|
-
get distanceVarCSSProperty() {
|
|
888
|
-
return t(this, ut);
|
|
889
|
-
}
|
|
890
|
-
get startVarCSSProperty() {
|
|
891
|
-
return t(this, at);
|
|
892
|
-
}
|
|
893
|
-
get finishVarCSSProperty() {
|
|
894
|
-
return t(this, dt);
|
|
895
|
-
}
|
|
896
|
-
get disabledCSSProperty() {
|
|
897
|
-
return t(this, Et);
|
|
898
|
-
}
|
|
899
|
-
get dampingCSSProperty() {
|
|
900
|
-
return t(this, _t);
|
|
901
|
-
}
|
|
902
|
-
get massCSSProperty() {
|
|
903
|
-
return t(this, Zt);
|
|
904
|
-
}
|
|
905
|
-
get stiffnessCSSProperty() {
|
|
906
|
-
return t(this, jt);
|
|
907
|
-
}
|
|
908
|
-
get targetCSSProperty() {
|
|
909
|
-
return t(this, Jt);
|
|
910
|
-
}
|
|
911
|
-
get isCaptured() {
|
|
912
|
-
return t(this, w);
|
|
913
|
-
}
|
|
914
|
-
get isReleased() {
|
|
915
|
-
return t(this, $);
|
|
916
|
-
}
|
|
917
|
-
get isCapturedFromStart() {
|
|
918
|
-
return t(this, W);
|
|
919
|
-
}
|
|
920
|
-
get isReleasedFromStart() {
|
|
921
|
-
return t(this, j);
|
|
922
|
-
}
|
|
923
|
-
get isCapturedFromFinish() {
|
|
924
|
-
return t(this, J);
|
|
925
|
-
}
|
|
926
|
-
get isReleasedFromFinish() {
|
|
927
|
-
return t(this, q);
|
|
928
|
-
}
|
|
929
|
-
get directionPosition() {
|
|
930
|
-
return t(this, Qt);
|
|
931
|
-
}
|
|
932
|
-
get directionSize() {
|
|
933
|
-
return t(this, Xt);
|
|
934
|
-
}
|
|
935
|
-
get passed() {
|
|
936
|
-
return t(this, z);
|
|
937
|
-
}
|
|
938
|
-
get progress() {
|
|
939
|
-
return t(this, Ft);
|
|
940
|
-
}
|
|
941
|
-
get start() {
|
|
942
|
-
return t(this, R);
|
|
943
|
-
}
|
|
944
|
-
get finish() {
|
|
945
|
-
return t(this, N);
|
|
946
|
-
}
|
|
947
|
-
get distance() {
|
|
948
|
-
return t(this, F);
|
|
949
|
-
}
|
|
950
|
-
get isCapturedOnce() {
|
|
951
|
-
return t(this, kt);
|
|
952
|
-
}
|
|
953
|
-
get isDisabled() {
|
|
954
|
-
return t(this, P);
|
|
955
|
-
}
|
|
956
|
-
resize() {
|
|
957
|
-
r(this, Xt, this.scrollElement.vertical ? this.offsetHeight : this.offsetWidth), r(this, Qt, this.scrollElement.vertical ? Rs(this, this.scrollElement) : As(this, this.scrollElement)), r(this, R, this.getStart()), r(this, F, this.getDistance()), r(this, R, t(this, R) + t(this, Lt).current), r(this, F, t(this, F) + t(this, xt).current), r(this, N, t(this, R) + t(this, F)), this.scrollElement.currentScrollValue > t(this, N) && !t(this, w).current && !t(this, $).current && (t(this, w).current = !0), this.setVar(t(this, at).current, t(this, R)), this.setVar(t(this, dt).current, t(this, N)), this.setVar(t(this, ut).current, t(this, F)), t(this, z).max = t(this, F), r(this, fs, !0);
|
|
958
|
-
}
|
|
959
|
-
tick() {
|
|
960
|
-
let s = this.scrollElement.currentScrollValue;
|
|
961
|
-
t(this, zs).forEach((h) => {
|
|
962
|
-
s += h.value;
|
|
963
|
-
}), t(this, z).set(s - t(this, R));
|
|
964
|
-
const e = Math.round(s);
|
|
965
|
-
t(this, w).current && (e >= t(this, R) ? t(this, W).current || o(this, S, oe).call(this) : t(this, W).current && !t(this, j).current && o(this, S, le).call(this), e < t(this, N) ? t(this, q).current && !t(this, J).current && o(this, S, ce).call(this) : t(this, W).current && !t(this, q).current && o(this, S, ue).call(this)), e >= t(this, R) && e < t(this, N) ? t(this, w).current || o(this, S, he).call(this) : t(this, w).current && (t(this, z).set(
|
|
966
|
-
ge(t(this, F) / 2, t(this, z).target, 0, t(this, F))
|
|
967
|
-
), o(this, S, ne).call(this)), t(this, kt) && t(this, Vt).current && (t(this, V).current && t(this, m).classList.add(t(this, V).current), r(this, P, !0));
|
|
968
|
-
}
|
|
969
|
-
disable() {
|
|
970
|
-
this.style.cssText = "", r(this, Qt, 0), r(this, Xt, 0), t(this, z).reset(), r(this, Ft, 0), r(this, R, 0), r(this, F, 0), r(this, N, 0), r(this, fs, !1), t(this, w).current = !1, t(this, $).current = !1, t(this, W).current = !1, t(this, j).current = !1, t(this, J).current = !1, t(this, q).current = !1, r(this, kt, !1), r(this, P, !0), o(this, S, Gs).call(this);
|
|
971
|
-
}
|
|
972
|
-
enable() {
|
|
973
|
-
r(this, P, !1);
|
|
974
|
-
}
|
|
761
|
+
Y = new WeakMap(), Lt = new WeakMap();
|
|
762
|
+
customElements.get("e-scroll-bullet-buttons") || customElements.define("e-scroll-bullet-buttons", Ve);
|
|
763
|
+
class Re extends ze {
|
|
975
764
|
connectedCallback() {
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
composed: !0,
|
|
979
|
-
custom: !0
|
|
980
|
-
});
|
|
981
|
-
}), t(this, W).subscribe((e) => {
|
|
982
|
-
e.current && Q(this, "scrollSegmentCaptureFromStart", {
|
|
983
|
-
composed: !0,
|
|
984
|
-
custom: !0
|
|
985
|
-
});
|
|
986
|
-
}), t(this, J).subscribe((e) => {
|
|
987
|
-
e.current && Q(this, "scrollSegmentCaptureFromFinish", {
|
|
988
|
-
composed: !0,
|
|
989
|
-
custom: !0
|
|
990
|
-
});
|
|
991
|
-
}), t(this, $).subscribe((e) => {
|
|
992
|
-
e.current && Q(this, "scrollSegmentRelease", {
|
|
993
|
-
composed: !0,
|
|
994
|
-
custom: !0
|
|
995
|
-
});
|
|
996
|
-
}), t(this, j).subscribe((e) => {
|
|
997
|
-
e.current && Q(this, "scrollSegmentReleaseFromStart", {
|
|
998
|
-
composed: !0,
|
|
999
|
-
custom: !0
|
|
1000
|
-
});
|
|
1001
|
-
}), t(this, q).subscribe((e) => {
|
|
1002
|
-
e.current && Q(this, "scrollSegmentReleaseFromFinish", {
|
|
1003
|
-
composed: !0,
|
|
1004
|
-
custom: !0
|
|
1005
|
-
});
|
|
1006
|
-
}), t(this, _t).observe(), t(this, Zt).observe(), t(this, jt).observe(), t(this, Jt).observe(), t(this, Et).observe(), t(this, xt).observe(), t(this, Lt).observe(), t(this, Vt).observe(), t(this, V).observe(), t(this, O).observe(), t(this, H).observe(), t(this, B).observe(), t(this, zt).observe(), t(this, x).observe(), t(this, ct).observe(), t(this, lt).observe(), t(this, ds).observe(), t(this, ut).observe(), t(this, at).observe(), t(this, dt).observe();
|
|
1007
|
-
let s = !1;
|
|
1008
|
-
this.scrollElement.addEventListener(
|
|
765
|
+
const n = le(this, kt);
|
|
766
|
+
n instanceof kt ? (this.scrollContainer = n, this.scrollContainer.addEventListener(
|
|
1009
767
|
"scrollSectionsChange",
|
|
1010
|
-
|
|
1011
|
-
)
|
|
1012
|
-
t(this, z).damping = e.current;
|
|
1013
|
-
}), t(this, Zt).subscribe((e) => {
|
|
1014
|
-
t(this, z).mass = e.current;
|
|
1015
|
-
}), t(this, jt).subscribe((e) => {
|
|
1016
|
-
t(this, z).stiffness = e.current;
|
|
1017
|
-
}), t(this, Jt).subscribe((e) => {
|
|
1018
|
-
e.previous && o(this, S, Gs).call(this), e.current ? e.current === "parent" ? r(this, m, this.parentElement || this) : r(this, m, document.querySelector(e.current) || this) : r(this, m, this);
|
|
1019
|
-
}), t(this, Et).subscribe((e) => {
|
|
1020
|
-
e.current && !e.previous ? this.disable() : !e.current && e.previous && (this.resize(), this.enable());
|
|
1021
|
-
}), t(this, Lt).subscribe(() => {
|
|
1022
|
-
s && !t(this, P) && this.resize();
|
|
1023
|
-
}), t(this, xt).subscribe(() => {
|
|
1024
|
-
s && !t(this, P) && this.resize();
|
|
1025
|
-
}), t(this, V).subscribe((e) => {
|
|
1026
|
-
o(this, S, At).call(this, e);
|
|
1027
|
-
}), t(this, H).subscribe((e) => {
|
|
1028
|
-
o(this, S, At).call(this, e);
|
|
1029
|
-
}), t(this, B).subscribe((e) => {
|
|
1030
|
-
o(this, S, At).call(this, e);
|
|
1031
|
-
}), t(this, O).subscribe((e) => {
|
|
1032
|
-
o(this, S, At).call(this, e);
|
|
1033
|
-
}), t(this, zt).subscribe((e) => {
|
|
1034
|
-
o(this, S, At).call(this, e);
|
|
1035
|
-
}), t(this, x).subscribe((e) => {
|
|
1036
|
-
o(this, S, At).call(this, e);
|
|
1037
|
-
}), t(this, Vt).subscribe((e) => {
|
|
1038
|
-
t(this, P) || !e.current && e.previous && (this.resize(), this.enable());
|
|
1039
|
-
}), t(this, ct).subscribe((e) => {
|
|
1040
|
-
t(this, P) || (this.removeVar(e.previous), this.setVar(e.current, this.passed.current));
|
|
1041
|
-
}), t(this, lt).subscribe((e) => {
|
|
1042
|
-
t(this, P) || (this.removeVar(e.previous), this.setVar(e.current, t(this, Ft)));
|
|
1043
|
-
}), t(this, at).subscribe((e) => {
|
|
1044
|
-
t(this, P) || (this.removeVar(e.previous), this.setVar(e.current, t(this, R)));
|
|
1045
|
-
}), t(this, dt).subscribe((e) => {
|
|
1046
|
-
t(this, P) || (this.removeVar(e.previous), this.setVar(e.current, t(this, N)));
|
|
1047
|
-
}), t(this, ut).subscribe((e) => {
|
|
1048
|
-
t(this, P) || (this.removeVar(e.previous), this.setVar(e.current, t(this, F)));
|
|
1049
|
-
}), t(this, z).subscribe((e) => {
|
|
1050
|
-
const h = t(this, z)[t(this, ds).current];
|
|
1051
|
-
r(this, Ft, h / t(this, F) || 0), this.setVar(t(this, ct).current, h.toFixed(6)), this.setVar(
|
|
1052
|
-
t(this, lt).current,
|
|
1053
|
-
t(this, Ft).toFixed(6)
|
|
1054
|
-
);
|
|
1055
|
-
}), ms.subscribe(t(this, ks), Ks.SCROLL), this.scrollElement.onScroll(t(this, ps)), s = !0;
|
|
1056
|
-
}
|
|
1057
|
-
disconnectedCallback() {
|
|
1058
|
-
ms.unsubscribe(t(this, ks)), this.scrollElement.offScroll(t(this, ps)), t(this, _t).close(), t(this, Zt).close(), t(this, jt).close(), t(this, Jt).close(), t(this, Et).close(), t(this, xt).close(), t(this, Lt).close(), t(this, Vt).close(), t(this, V).close(), t(this, O).close(), t(this, H).close(), t(this, B).close(), t(this, zt).close(), t(this, x).close(), t(this, ct).close(), t(this, lt).close(), t(this, ut).close(), t(this, at).close(), t(this, dt).close(), t(this, w).close(), t(this, $).close(), t(this, W).close(), t(this, j).close(), t(this, J).close(), t(this, q).close(), this.disable();
|
|
1059
|
-
}
|
|
1060
|
-
removeVar(s) {
|
|
1061
|
-
s && t(this, m).style.removeProperty(`--${s}`);
|
|
1062
|
-
}
|
|
1063
|
-
setVar(s, e) {
|
|
1064
|
-
s && t(this, m).style.setProperty(`--${s}`, e.toString());
|
|
1065
|
-
}
|
|
1066
|
-
getDistance() {
|
|
1067
|
-
return t(this, Xt) + t(this, Fs);
|
|
1068
|
-
}
|
|
1069
|
-
getStart() {
|
|
1070
|
-
return t(this, Qt) - t(this, Fs);
|
|
768
|
+
this.findAnotherScrollEntries
|
|
769
|
+
)) : console.error(this, "e-scroll not found");
|
|
1071
770
|
}
|
|
1072
771
|
}
|
|
1073
|
-
|
|
1074
|
-
t(this, w).current = !0, t(this, $).current = !1, r(this, kt, !0), t(this, O).current && t(this, m).classList.remove(t(this, O).current), t(this, x).current && t(this, m).classList.remove(
|
|
1075
|
-
t(this, x).current
|
|
1076
|
-
), t(this, x).current && t(this, m).classList.remove(
|
|
1077
|
-
t(this, x).current
|
|
1078
|
-
), t(this, V).current && t(this, m).classList.add(t(this, V).current);
|
|
1079
|
-
}, ne = function() {
|
|
1080
|
-
t(this, $).current = !0, t(this, w).current = !1, r(this, kt, !0), t(this, V).current && t(this, m).classList.remove(t(this, V).current), t(this, H).current && t(this, m).classList.remove(
|
|
1081
|
-
t(this, H).current
|
|
1082
|
-
), t(this, B).current && t(this, m).classList.remove(
|
|
1083
|
-
t(this, B).current
|
|
1084
|
-
), t(this, O).current && t(this, m).classList.add(t(this, O).current);
|
|
1085
|
-
}, oe = function() {
|
|
1086
|
-
t(this, w).current = !0, t(this, W).current = !0, t(this, j).current = !1, t(this, H).current && t(this, m).classList.add(
|
|
1087
|
-
t(this, H).current
|
|
1088
|
-
);
|
|
1089
|
-
}, ce = function() {
|
|
1090
|
-
t(this, w).current = !0, t(this, J).current = !0, t(this, q).current = !1, t(this, B).current && t(this, m).classList.add(
|
|
1091
|
-
t(this, B).current
|
|
1092
|
-
);
|
|
1093
|
-
}, le = function() {
|
|
1094
|
-
t(this, $).current = !0, t(this, j).current = !0, t(this, W).current = !1, t(this, x).current && t(this, m).classList.add(
|
|
1095
|
-
t(this, x).current
|
|
1096
|
-
);
|
|
1097
|
-
}, ue = function() {
|
|
1098
|
-
t(this, $).current = !0, t(this, q).current = !0, t(this, J).current = !1, t(this, x).current && t(this, m).classList.add(
|
|
1099
|
-
t(this, x).current
|
|
1100
|
-
);
|
|
1101
|
-
}, ks = new WeakMap(), ps = new WeakMap(), At = function(s) {
|
|
1102
|
-
if (t(this, P)) {
|
|
1103
|
-
s.previous && t(this, m).classList.remove(s.previous), s.current && t(this, m).classList.remove(s.current);
|
|
1104
|
-
return;
|
|
1105
|
-
}
|
|
1106
|
-
s.current && t(this, w).current ? (s.previous && t(this, m).classList.remove(s.previous), t(this, m).classList.add(s.current)) : !s.current && s.previous && t(this, m).classList.remove(s.previous);
|
|
1107
|
-
}, ae = function(...s) {
|
|
1108
|
-
s.forEach((e) => {
|
|
1109
|
-
e && t(this, m).classList.remove(e);
|
|
1110
|
-
});
|
|
1111
|
-
}, de = function(...s) {
|
|
1112
|
-
s.forEach((e) => {
|
|
1113
|
-
e && t(this, m).style.removeProperty(`--${e}`);
|
|
1114
|
-
});
|
|
1115
|
-
}, Gs = function() {
|
|
1116
|
-
o(this, S, ae).call(this, t(this, V).current, t(this, H).current, t(this, B).current, t(this, O).current, t(this, zt).current, t(this, x).current), o(this, S, de).call(this, t(this, ct).current, t(this, lt).current, t(this, ut).current, t(this, at).current, t(this, dt).current);
|
|
1117
|
-
}, Ds = new WeakMap();
|
|
1118
|
-
customElements.get("e-scroll-segment") || customElements.define("e-scroll-segment", Ie);
|
|
772
|
+
customElements.get("e-scroll-segment") || customElements.define("e-scroll-segment", Re);
|
|
1119
773
|
export {
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
774
|
+
Ve as ScrollBulletButtonsElement,
|
|
775
|
+
kt as ScrollElement,
|
|
776
|
+
Re as ScrollSegmentElement,
|
|
777
|
+
Ie as ScrollSetButtonElement,
|
|
778
|
+
Me as ScrollStepButtonElement,
|
|
779
|
+
Ae as ScrollbarElement
|
|
1126
780
|
};
|