aptechka 0.4.4 → 0.4.6
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/checkbox/index.cjs +1 -0
- package/lib/checkbox/index.d.ts +16 -0
- package/lib/checkbox/index.js +120 -0
- package/lib/{index-DGji4duy.js → index-BigQay-N.js} +112 -109
- package/lib/index-DTrWxWOM.cjs +9 -0
- package/lib/popover/PopoverButtonElement.d.ts +3 -3
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +60 -47
- package/lib/router/index.js +1 -3
- package/lib/scroll/ScrollBulletButtonsElement.d.ts +12 -0
- package/lib/scroll/ScrollButtonElement.d.ts +6 -0
- package/lib/scroll/ScrollElement.d.ts +15 -1
- package/lib/scroll/ScrollSetButtonElement.d.ts +10 -0
- package/lib/scroll/ScrollStepButtonElement.d.ts +10 -0
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.d.ts +3 -0
- package/lib/scroll/index.js +388 -252
- package/lib/select/index.cjs +1 -1
- package/lib/select/index.js +1 -1
- package/lib/source/SourceClass.d.ts +1 -1
- package/lib/theme/index.cjs +1 -1
- package/lib/theme/index.d.ts +5 -0
- package/lib/theme/index.js +5 -4
- package/lib/{studio/tweaker → tweaker}/TweakerBooleanManagerElement.d.ts +1 -1
- package/lib/{studio/tweaker → tweaker}/TweakerColorManagerElement.d.ts +1 -1
- package/lib/{studio/tweaker → tweaker}/TweakerElement.d.ts +1 -1
- package/lib/{studio/tweaker → tweaker}/TweakerFieldElement.d.ts +4 -4
- package/lib/{studio/tweaker → tweaker}/TweakerFolderElement.d.ts +4 -4
- package/lib/{studio/tweaker → tweaker}/TweakerLinkManagerElement.d.ts +1 -1
- package/lib/{studio/tweaker → tweaker}/TweakerNumberManagerElement.d.ts +1 -1
- package/lib/{studio/tweaker → tweaker}/TweakerRangeManagerElement.d.ts +1 -1
- package/lib/{studio/tweaker → tweaker}/TweakerSelectManagerElement.d.ts +1 -1
- package/lib/tweaker/TweakerStoreManagerElement.d.ts +11 -0
- package/lib/{studio/tweaker → tweaker}/TweakerStringManagerElement.d.ts +1 -1
- package/lib/tweaker/index.cjs +10 -0
- package/lib/tweaker/index.d.ts +1 -0
- package/lib/{studio → tweaker}/index.js +276 -311
- package/lib/{studio/tweaker → tweaker}/tweakerManagerConstructors.d.ts +1 -1
- package/lib/{studio/studioStorage.d.ts → tweaker/tweakerStorage.d.ts} +3 -3
- package/package.json +17 -14
- package/lib/abstract-elements/AbstractButtonElement.d.ts +0 -6
- package/lib/abstract-elements/index.cjs +0 -1
- package/lib/abstract-elements/index.d.ts +0 -1
- package/lib/abstract-elements/index.js +0 -27
- package/lib/index-CUE4tEUr.cjs +0 -9
- package/lib/studio/StudioElement.d.ts +0 -13
- package/lib/studio/index.cjs +0 -10
- package/lib/studio/index.d.ts +0 -1
- package/lib/studio/tweaker/TweakerStoreManagerElement.d.ts +0 -11
package/lib/scroll/index.js
CHANGED
|
@@ -1,76 +1,77 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Ft = (e, s, i) => {
|
|
2
2
|
if (!s.has(e))
|
|
3
3
|
throw TypeError("Cannot " + i);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
5
|
+
var h = (e, s, i) => (Ft(e, s, "read from private field"), i ? i.call(e) : s.get(e)), S = (e, s, i) => {
|
|
6
6
|
if (s.has(e))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
s instanceof WeakSet ? s.add(e) : s.set(e, i);
|
|
9
|
-
},
|
|
10
|
-
import { D as
|
|
11
|
-
import { S as
|
|
12
|
-
import { D as
|
|
13
|
-
import { i as
|
|
14
|
-
import { a as
|
|
15
|
-
import { c as
|
|
9
|
+
}, y = (e, s, i, r) => (Ft(e, s, "write to private field"), r ? r.call(e, i) : s.set(e, i), i);
|
|
10
|
+
import { D as ne } from "../Damped-HhitpTP_.js";
|
|
11
|
+
import { S as he } from "../Store-BQXXikps.js";
|
|
12
|
+
import { D as oe } from "../Derived-kPJs5JC5.js";
|
|
13
|
+
import { i as Dt } from "../browser-0zX67oeU.js";
|
|
14
|
+
import { a as Pt, g as Mt } from "../layout-HoBT_Da2.js";
|
|
15
|
+
import { c as Qt } from "../math-BOBiC4TN.js";
|
|
16
16
|
import "../ticker/index.js";
|
|
17
|
-
import { W as
|
|
18
|
-
import { CustomElement as
|
|
19
|
-
import { TICK_ORDER as
|
|
20
|
-
import { windowResizer as
|
|
21
|
-
import { scrollEntries as
|
|
22
|
-
import { e as
|
|
23
|
-
import { c as
|
|
24
|
-
import { cssUnitParser as
|
|
25
|
-
import { CSSProperty as
|
|
26
|
-
import { f as
|
|
27
|
-
import { aptechkaTheme as
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
import { W as le, K as ae } from "../WheelControls-BAyRKpRZ.js";
|
|
18
|
+
import { CustomElement as Xt, define as at } from "../custom-element/index.js";
|
|
19
|
+
import { TICK_ORDER as ce, RESIZE_ORDER as Yt } from "../order/index.js";
|
|
20
|
+
import { windowResizer as _t } from "../window-resizer/index.js";
|
|
21
|
+
import { scrollEntries as N } from "../scroll-entries/index.js";
|
|
22
|
+
import { e as Tt, D as Lt, ay as St, p as ue } from "../tags-CAxO5Rs3.js";
|
|
23
|
+
import { c as Vt } from "../createStylesheet-DrkbCUJk.js";
|
|
24
|
+
import { cssUnitParser as pe } from "../css-unit-parser/index.js";
|
|
25
|
+
import { CSSProperty as k } from "../css-property/index.js";
|
|
26
|
+
import { f as fe } from "../dom-0S_WDL4g.js";
|
|
27
|
+
import { aptechkaTheme as Gt } from "../theme/index.js";
|
|
28
|
+
import { d as de } from "../function-C10DGppn.js";
|
|
29
|
+
var ve = Object.defineProperty, me = Object.getOwnPropertyDescriptor, ge = (e, s, i, r) => {
|
|
30
|
+
for (var n = r > 1 ? void 0 : r ? me(s, i) : s, a = e.length - 1, u; a >= 0; a--)
|
|
31
|
+
(u = e[a]) && (n = (r ? u(s, i, n) : u(n)) || n);
|
|
32
|
+
return r && n && ve(s, i, n), n;
|
|
33
|
+
}, Rt = (e, s, i) => {
|
|
33
34
|
if (!s.has(e))
|
|
34
35
|
throw TypeError("Cannot " + i);
|
|
35
|
-
}, t = (e, s, i) => (
|
|
36
|
+
}, t = (e, s, i) => (Rt(e, s, "read from private field"), i ? i.call(e) : s.get(e)), o = (e, s, i) => {
|
|
36
37
|
if (s.has(e))
|
|
37
38
|
throw TypeError("Cannot add the same private member more than once");
|
|
38
39
|
s instanceof WeakSet ? s.add(e) : s.set(e, i);
|
|
39
|
-
},
|
|
40
|
-
class
|
|
40
|
+
}, v = (e, s, i, r) => (Rt(e, s, "write to private field"), r ? r.call(e, i) : s.set(e, i), i), m = (e, s, i) => (Rt(e, s, "access private method"), i), c, E, O, P, z, Z, C, B, q, J, f, Et, p, ct, ut, w, d, T, M, G, b, j, H, rt, xt, Q, nt, yt, It, Ct, Bt, pt, $t, ft, Ot, K, kt, zt, jt, dt, vt, At, _, g, V, L;
|
|
41
|
+
class be {
|
|
41
42
|
constructor(s, i) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
S(this, _, void 0);
|
|
44
|
+
S(this, g, void 0);
|
|
45
|
+
S(this, V, 0);
|
|
46
|
+
S(this, L, 0);
|
|
47
|
+
y(this, _, s), y(this, g, i), N.register(h(this, _));
|
|
47
48
|
}
|
|
48
49
|
get size() {
|
|
49
|
-
return
|
|
50
|
+
return h(this, V);
|
|
50
51
|
}
|
|
51
52
|
get position() {
|
|
52
|
-
return
|
|
53
|
+
return h(this, L);
|
|
53
54
|
}
|
|
54
55
|
destroy() {
|
|
55
|
-
|
|
56
|
+
N.unregister(h(this, _)), h(this, _).style.transform = "";
|
|
56
57
|
}
|
|
57
58
|
resize() {
|
|
58
|
-
|
|
59
|
+
y(this, V, h(this, g).vertical ? h(this, _).offsetHeight : h(this, _).offsetWidth), y(this, L, h(this, g).vertical ? Pt(h(this, _)) : Mt(h(this, _))), y(this, L, h(this, L) - h(this, g).contentPosition);
|
|
59
60
|
}
|
|
60
61
|
transform() {
|
|
61
62
|
let s = 0;
|
|
62
|
-
const i =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
const i = h(this, g).viewportSize - h(this, V);
|
|
64
|
+
h(this, g).infiniteProperty.current && h(this, g).overscroll && h(this, L) + h(this, V) < h(this, g).currentScrollValue && (s = h(this, g).distance * -1 - h(this, g).gap), N.update(
|
|
65
|
+
h(this, _),
|
|
66
|
+
h(this, g).axisAttibute.current,
|
|
66
67
|
s
|
|
67
68
|
);
|
|
68
|
-
const r =
|
|
69
|
-
|
|
69
|
+
const r = h(this, g).currentScrollValue + s, n = h(this, L) - h(this, g).viewportSize - i, a = h(this, L) + h(this, V) + i, u = Qt(r, n, a);
|
|
70
|
+
h(this, g).vertical ? h(this, _).style.transform = `translate3d(0px, ${u * -1}px, 0px)` : h(this, _).style.transform = `translate3d(${u * -1}px, 0px, 0px)`;
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
-
const
|
|
73
|
+
_ = new WeakMap(), g = new WeakMap(), V = new WeakMap(), L = new WeakMap();
|
|
74
|
+
const we = Vt({
|
|
74
75
|
":host": {
|
|
75
76
|
position: "relative",
|
|
76
77
|
width: "100%",
|
|
@@ -102,328 +103,339 @@ const te = Rt({
|
|
|
102
103
|
flexShrink: "0"
|
|
103
104
|
}
|
|
104
105
|
});
|
|
105
|
-
let
|
|
106
|
+
let Wt = class extends Xt {
|
|
106
107
|
constructor() {
|
|
107
|
-
super(),
|
|
108
|
+
super(), o(this, rt), o(this, Q), o(this, yt), o(this, Ct), o(this, pt), o(this, ft), o(this, zt), o(this, vt), o(this, c, null), o(this, E, new k(this, "--axis", "y")), o(this, O, new k(this, "--pages", 0, {
|
|
108
109
|
validate: (e) => Math.max(0, e - 1)
|
|
109
|
-
})),
|
|
110
|
+
})), o(this, P, new k(this, "--split", !1)), o(this, z, new k(this, "--sectional", !1)), o(this, Z, new k(
|
|
110
111
|
this,
|
|
111
112
|
"--wheel-max-delta",
|
|
112
113
|
!1
|
|
113
|
-
)),
|
|
114
|
-
const e = this.currentScrollValue / t(this,
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
const s = t(this,
|
|
118
|
-
this.vertical ? (t(this,
|
|
114
|
+
)), o(this, C, new k(this, "--infinite", !1)), o(this, B, new k(this, "--damping", 0.03)), o(this, q, new k(this, "--disabled", !1)), o(this, J, new k(this, "--hibernated", !1)), o(this, f, null), o(this, Et, null), o(this, p, []), o(this, ct, 0), o(this, ut, 0), o(this, w, 0), o(this, d, 0), o(this, T, 0), o(this, M, null), o(this, G, null), o(this, b, new he(0)), o(this, j, 0), o(this, H, 0), o(this, K, () => {
|
|
115
|
+
const e = this.currentScrollValue / t(this, d) || 0;
|
|
116
|
+
if (v(this, ct, this.vertical ? Pt(this) : Mt(this)), v(this, ut, this.vertical ? Pt(t(this, f)) : Mt(t(this, f))), v(this, w, this.vertical ? this.offsetHeight : this.offsetWidth), t(this, O).current) {
|
|
117
|
+
v(this, d, t(this, w) * t(this, O).current);
|
|
118
|
+
const s = t(this, d) + t(this, w);
|
|
119
|
+
this.vertical ? (t(this, f).style.width = s + "px", t(this, f).style.height = "100%") : (t(this, f).style.height = s + "px", t(this, f).style.width = "100%");
|
|
119
120
|
} else
|
|
120
|
-
this.vertical ? (t(this,
|
|
121
|
-
if (
|
|
121
|
+
this.vertical ? (t(this, f).style.width = "100%", t(this, f).style.height = "max-content", v(this, d, t(this, f).offsetHeight - t(this, w))) : (t(this, f).style.width = "max-content", t(this, f).style.height = "100%", v(this, d, t(this, f).offsetWidth - t(this, w)));
|
|
122
|
+
if (v(this, T, pe.parse(getComputedStyle(t(this, f)).gap)), !t(this, C).current) {
|
|
122
123
|
const s = getComputedStyle(this);
|
|
123
|
-
|
|
124
|
+
v(this, d, t(this, d) + (this.vertical ? parseFloat(s.paddingBlockStart) + parseFloat(s.paddingBlockEnd) : parseFloat(s.paddingInlineStart) + parseFloat(s.paddingInlineEnd))), t(this, c).max = t(this, d);
|
|
124
125
|
}
|
|
125
|
-
if (t(this,
|
|
126
|
+
if (t(this, p).forEach((s) => {
|
|
126
127
|
s.resize(), s.transform();
|
|
127
|
-
}), t(this,
|
|
128
|
-
const s = t(this,
|
|
129
|
-
|
|
128
|
+
}), t(this, C).current && t(this, p).length) {
|
|
129
|
+
const s = t(this, p)[t(this, p).length - 1], i = s.position + s.size - t(this, w), r = t(this, d) - i;
|
|
130
|
+
v(this, H, s.position + s.size + r);
|
|
130
131
|
} else
|
|
131
|
-
|
|
132
|
-
if (t(this, z).current && t(this,
|
|
133
|
-
const s = t(this,
|
|
134
|
-
t(this,
|
|
132
|
+
v(this, H, t(this, d));
|
|
133
|
+
if (t(this, z).current && t(this, p).length) {
|
|
134
|
+
const s = t(this, p)[t(this, b).current];
|
|
135
|
+
t(this, c).set(s.position, !0);
|
|
135
136
|
} else
|
|
136
|
-
t(this,
|
|
137
|
-
}),
|
|
137
|
+
t(this, c).set(e * t(this, d), !0);
|
|
138
|
+
}), o(this, kt, () => {
|
|
138
139
|
const e = this.currentScrollValue;
|
|
139
|
-
if (
|
|
140
|
+
if (v(this, j, Math.max(0, e - t(this, d))), t(this, p).length) {
|
|
140
141
|
let s = 0;
|
|
141
|
-
for (let i = 0; i < t(this,
|
|
142
|
-
const r = t(this,
|
|
142
|
+
for (let i = 0; i < t(this, p).length; i++) {
|
|
143
|
+
const r = t(this, p)[i];
|
|
143
144
|
r.transform(), this.targetScrollValue + this.viewportSize / 2 >= r.position && (s = i);
|
|
144
145
|
}
|
|
145
|
-
t(this,
|
|
146
|
+
t(this, b).current = s;
|
|
146
147
|
} else
|
|
147
|
-
this.vertical ? t(this,
|
|
148
|
-
|
|
149
|
-
}),
|
|
148
|
+
this.vertical ? t(this, f).style.transform = `translate3d(0px, ${e * -1}px, 0px)` : t(this, f).style.transform = `translate3d(${e * -1}px, 0px, 0px)`;
|
|
149
|
+
N.update(this, t(this, E).current, e);
|
|
150
|
+
}), o(this, dt, (e) => {
|
|
150
151
|
if (t(this, z).current) {
|
|
151
152
|
const s = Math.sign(e);
|
|
152
|
-
t(this,
|
|
153
|
+
t(this, p).length ? this.shiftSections(s) : t(this, c).shift(s * t(this, w));
|
|
153
154
|
} else
|
|
154
|
-
t(this,
|
|
155
|
-
}),
|
|
155
|
+
t(this, c).shift(e);
|
|
156
|
+
}), Dt && (v(this, c, new ne(0, {
|
|
156
157
|
damping: 0.01,
|
|
157
158
|
min: 0,
|
|
158
|
-
order:
|
|
159
|
-
})), this.openShadow(
|
|
159
|
+
order: ce.SCROLL
|
|
160
|
+
})), this.openShadow(we), Tt(this, {
|
|
160
161
|
tabIndex: 0,
|
|
161
162
|
children: [
|
|
162
|
-
|
|
163
|
+
Lt({
|
|
163
164
|
class: "static",
|
|
164
|
-
children: [
|
|
165
|
+
children: [St({ name: "static" })]
|
|
165
166
|
}),
|
|
166
|
-
|
|
167
|
+
Lt({
|
|
167
168
|
class: "content",
|
|
168
|
-
children: [
|
|
169
|
+
children: [St({ ref: (e) => v(this, Et, e) })],
|
|
169
170
|
style: {
|
|
170
|
-
flexDirection: new
|
|
171
|
-
t(this,
|
|
171
|
+
flexDirection: new oe(
|
|
172
|
+
t(this, E),
|
|
172
173
|
(e) => e === "x" ? "row" : "column"
|
|
173
174
|
)
|
|
174
175
|
},
|
|
175
|
-
ref: (e) =>
|
|
176
|
+
ref: (e) => v(this, f, e)
|
|
176
177
|
})
|
|
177
178
|
]
|
|
178
|
-
}),
|
|
179
|
-
t(this,
|
|
180
|
-
}), t(this,
|
|
181
|
-
t(this, M).axis = e.current ? "max" : t(this,
|
|
182
|
-
}), t(this,
|
|
183
|
-
this.isConnected && t(this,
|
|
184
|
-
}), t(this,
|
|
185
|
-
this.isConnected && (e ? m(this,
|
|
179
|
+
}), v(this, M, new le({ element: this })), t(this, M).changeEvent.subscribe(t(this, dt)), v(this, G, new ae({ element: this })), t(this, G).changeEvent.subscribe(t(this, dt)), t(this, E).subscribe(({ current: e }) => {
|
|
180
|
+
t(this, f).style.flexDirection = e === "x" ? "row" : "column", t(this, M).axis = t(this, Z).current ? "max" : e, t(this, G).dimension = e === "x" ? "width" : "height", this.isConnected && t(this, K).call(this);
|
|
181
|
+
}), t(this, Z).subscribe((e) => {
|
|
182
|
+
t(this, M).axis = e.current ? "max" : t(this, E).current;
|
|
183
|
+
}), t(this, O).subscribe(() => {
|
|
184
|
+
this.isConnected && t(this, K).call(this);
|
|
185
|
+
}), t(this, P).subscribe(({ current: e }) => {
|
|
186
|
+
this.isConnected && (e ? m(this, rt, xt).call(this) : m(this, Q, nt).call(this));
|
|
186
187
|
}), t(this, z).subscribe((e) => {
|
|
187
|
-
t(this,
|
|
188
|
-
}), t(this,
|
|
189
|
-
e.current ? (this.isConnected && (t(this,
|
|
190
|
-
}), t(this,
|
|
191
|
-
t(this,
|
|
192
|
-
}), t(this,
|
|
193
|
-
e.current && !e.previous ? m(this,
|
|
194
|
-
}), t(this,
|
|
195
|
-
e.current && !e.previous ? m(this,
|
|
188
|
+
t(this, b).current = 0, t(this, M).debounce = e.current, t(this, c).reset(), this.isConnected && (e.current && !e.previous ? m(this, rt, xt).call(this) : !e.current && e.previous && m(this, Q, nt).call(this));
|
|
189
|
+
}), t(this, C).subscribe((e) => {
|
|
190
|
+
e.current ? (this.isConnected && (t(this, p).length || (t(this, P).current = !0)), t(this, p).length && (t(this, c).max = 1 / 0, t(this, c).min = -1 / 0)) : (v(this, j, 0), t(this, c).max = t(this, d), t(this, c).min = 0);
|
|
191
|
+
}), t(this, B).subscribe((e) => {
|
|
192
|
+
t(this, c).damping = e.current;
|
|
193
|
+
}), t(this, q).subscribe((e) => {
|
|
194
|
+
e.current && !e.previous ? m(this, yt, It).call(this) : !e.current && e.previous && m(this, Ct, Bt).call(this);
|
|
195
|
+
}), t(this, J).subscribe((e) => {
|
|
196
|
+
e.current && !e.previous ? m(this, pt, $t).call(this) : !e.current && e.previous && m(this, ft, Ot).call(this);
|
|
196
197
|
}));
|
|
197
198
|
}
|
|
198
199
|
get dampingProperty() {
|
|
199
|
-
return t(this,
|
|
200
|
+
return t(this, B);
|
|
200
201
|
}
|
|
201
202
|
get axisAttibute() {
|
|
202
|
-
return t(this,
|
|
203
|
+
return t(this, E);
|
|
203
204
|
}
|
|
204
205
|
get pagesAttibute() {
|
|
205
|
-
return t(this,
|
|
206
|
+
return t(this, O);
|
|
206
207
|
}
|
|
207
208
|
get splitAttibute() {
|
|
208
|
-
return t(this,
|
|
209
|
+
return t(this, P);
|
|
209
210
|
}
|
|
210
211
|
get sectionalAttibute() {
|
|
211
212
|
return t(this, z);
|
|
212
213
|
}
|
|
213
214
|
get infiniteProperty() {
|
|
214
|
-
return t(this,
|
|
215
|
+
return t(this, C);
|
|
215
216
|
}
|
|
216
217
|
get dampingAttibute() {
|
|
217
|
-
return t(this,
|
|
218
|
+
return t(this, B);
|
|
218
219
|
}
|
|
219
220
|
get disabledAttibute() {
|
|
220
|
-
return t(this,
|
|
221
|
+
return t(this, q);
|
|
221
222
|
}
|
|
222
223
|
get hibernatedAttibute() {
|
|
223
|
-
return t(this,
|
|
224
|
+
return t(this, J);
|
|
224
225
|
}
|
|
225
226
|
get currentScrollValue() {
|
|
226
|
-
return m(this,
|
|
227
|
+
return m(this, vt, At).call(this, "current");
|
|
227
228
|
}
|
|
228
229
|
get targetScrollValue() {
|
|
229
|
-
return m(this,
|
|
230
|
+
return m(this, vt, At).call(this, "target");
|
|
230
231
|
}
|
|
231
232
|
get contentElement() {
|
|
232
|
-
return t(this,
|
|
233
|
+
return t(this, f);
|
|
234
|
+
}
|
|
235
|
+
get sections() {
|
|
236
|
+
return t(this, p);
|
|
233
237
|
}
|
|
234
238
|
get position() {
|
|
235
|
-
return t(this,
|
|
239
|
+
return t(this, ct);
|
|
236
240
|
}
|
|
237
241
|
get contentPosition() {
|
|
238
|
-
return t(this,
|
|
242
|
+
return t(this, ut);
|
|
239
243
|
}
|
|
240
244
|
get viewportSize() {
|
|
241
|
-
return t(this,
|
|
245
|
+
return t(this, w);
|
|
242
246
|
}
|
|
243
247
|
get scrollSize() {
|
|
244
|
-
return t(this,
|
|
248
|
+
return t(this, d);
|
|
245
249
|
}
|
|
246
250
|
get gap() {
|
|
247
|
-
return t(this,
|
|
251
|
+
return t(this, T);
|
|
248
252
|
}
|
|
249
253
|
get counter() {
|
|
250
|
-
return t(this,
|
|
254
|
+
return t(this, b);
|
|
251
255
|
}
|
|
252
256
|
get distance() {
|
|
253
|
-
return t(this,
|
|
257
|
+
return t(this, H);
|
|
254
258
|
}
|
|
255
259
|
get overscroll() {
|
|
256
|
-
return t(this,
|
|
260
|
+
return t(this, j);
|
|
257
261
|
}
|
|
258
262
|
get vertical() {
|
|
259
|
-
return t(this,
|
|
263
|
+
return t(this, E).current === "y";
|
|
260
264
|
}
|
|
261
265
|
get currentProgress() {
|
|
262
|
-
return this.currentScrollValue / t(this,
|
|
266
|
+
return this.currentScrollValue / t(this, H) || 0;
|
|
263
267
|
}
|
|
264
268
|
get targetProgress() {
|
|
265
|
-
return this.targetScrollValue / t(this,
|
|
269
|
+
return this.targetScrollValue / t(this, H) || 0;
|
|
266
270
|
}
|
|
267
271
|
get speed() {
|
|
268
|
-
return t(this,
|
|
272
|
+
return t(this, c).speed;
|
|
269
273
|
}
|
|
270
274
|
get direction() {
|
|
271
|
-
return t(this,
|
|
275
|
+
return t(this, c).direction;
|
|
272
276
|
}
|
|
273
277
|
get isRunning() {
|
|
274
|
-
return t(this,
|
|
278
|
+
return t(this, c).isRunning;
|
|
275
279
|
}
|
|
276
280
|
get scrollWidth() {
|
|
277
|
-
return t(this,
|
|
281
|
+
return t(this, E).current === "y" ? 0 : t(this, c).length;
|
|
278
282
|
}
|
|
279
283
|
get scrollHeight() {
|
|
280
|
-
return t(this,
|
|
284
|
+
return t(this, E).current === "x" ? 0 : t(this, c).length;
|
|
281
285
|
}
|
|
282
286
|
onScroll(...e) {
|
|
283
|
-
return t(this,
|
|
287
|
+
return t(this, c).subscribe(...e);
|
|
284
288
|
}
|
|
285
289
|
offScroll(...e) {
|
|
286
|
-
t(this,
|
|
290
|
+
t(this, c).unsubscribe(...e);
|
|
287
291
|
}
|
|
288
292
|
//https://github.com/pmndrs/drei/blob/d3282cdd02d170ef603a5e096505d83dc93cd57a/src/web/ScrollControls.tsx#L85C7-L100C9
|
|
289
293
|
range(e, s, i = 0) {
|
|
290
|
-
const r = e - i,
|
|
291
|
-
return this.currentProgress < r ? 0 : this.currentProgress >
|
|
294
|
+
const r = e - i, n = r + s + i * 2;
|
|
295
|
+
return this.currentProgress < r ? 0 : this.currentProgress > n ? 1 : (this.currentProgress - r) / (n - r);
|
|
292
296
|
}
|
|
293
297
|
curve(e, s, i = 0) {
|
|
294
298
|
return Math.sin(this.range(e, s, i) * Math.PI);
|
|
295
299
|
}
|
|
296
300
|
visible(e, s, i = 0) {
|
|
297
|
-
const r = e - i,
|
|
298
|
-
return this.currentProgress >= r && this.currentProgress <=
|
|
301
|
+
const r = e - i, n = r + s + i * 2;
|
|
302
|
+
return this.currentProgress >= r && this.currentProgress <= n;
|
|
299
303
|
}
|
|
300
304
|
// TODO: Поправить значение когда скролл не секционный ??
|
|
301
305
|
scrollToSection(e, s = "smooth") {
|
|
302
|
-
if (!t(this,
|
|
306
|
+
if (!t(this, p).length)
|
|
303
307
|
return;
|
|
304
|
-
const i = t(this,
|
|
305
|
-
m(this,
|
|
306
|
-
const r = t(this,
|
|
307
|
-
if (r &&
|
|
308
|
-
let
|
|
309
|
-
const
|
|
310
|
-
t(this,
|
|
308
|
+
const i = t(this, b).current;
|
|
309
|
+
m(this, zt, jt).call(this, e);
|
|
310
|
+
const r = t(this, p)[i], n = t(this, p)[t(this, b).current];
|
|
311
|
+
if (r && n) {
|
|
312
|
+
let a = 0;
|
|
313
|
+
const u = t(this, p).length - 1;
|
|
314
|
+
t(this, C).current ? t(this, b).current === 0 && i === u ? a = t(this, d) + t(this, w) - r.position + t(this, T) : t(this, b).current === u && i === 0 ? a = n.position - (t(this, d) + t(this, w) + t(this, T)) : a = n.position - r.position : a = n.position - r.position, t(this, c).shift(a, s === "instant");
|
|
311
315
|
}
|
|
312
316
|
}
|
|
313
317
|
shiftSections(e, s = "smooth") {
|
|
314
|
-
t(this,
|
|
318
|
+
t(this, p).length && this.scrollToSection(t(this, b).current + e, s);
|
|
315
319
|
}
|
|
316
320
|
setPosition(e, s = "smooth") {
|
|
317
|
-
t(this,
|
|
321
|
+
t(this, c).set(e, s === "instant");
|
|
318
322
|
}
|
|
319
323
|
connectedCallback() {
|
|
320
|
-
t(this,
|
|
324
|
+
t(this, E).observe(), t(this, O).observe(), t(this, P).observe(), t(this, z).observe(), t(this, Z).observe(), t(this, C).observe(), t(this, B).observe(), t(this, q).observe(), t(this, J).observe(), m(this, ft, Ot).call(this);
|
|
321
325
|
}
|
|
322
326
|
disconnectedCallback() {
|
|
323
|
-
t(this,
|
|
327
|
+
t(this, E).unobserve(), t(this, O).unobserve(), t(this, P).unobserve(), t(this, z).unobserve(), t(this, Z).unobserve(), t(this, C).unobserve(), t(this, B).unobserve(), t(this, q).unobserve(), t(this, J).unobserve(), m(this, pt, $t).call(this);
|
|
324
328
|
}
|
|
325
329
|
};
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
+
c = /* @__PURE__ */ new WeakMap();
|
|
331
|
+
E = /* @__PURE__ */ new WeakMap();
|
|
332
|
+
O = /* @__PURE__ */ new WeakMap();
|
|
333
|
+
P = /* @__PURE__ */ new WeakMap();
|
|
330
334
|
z = /* @__PURE__ */ new WeakMap();
|
|
335
|
+
Z = /* @__PURE__ */ new WeakMap();
|
|
336
|
+
C = /* @__PURE__ */ new WeakMap();
|
|
331
337
|
B = /* @__PURE__ */ new WeakMap();
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
u = /* @__PURE__ */ new WeakMap();
|
|
337
|
-
ut = /* @__PURE__ */ new WeakMap();
|
|
338
|
-
c = /* @__PURE__ */ new WeakMap();
|
|
339
|
-
j = /* @__PURE__ */ new WeakMap();
|
|
340
|
-
tt = /* @__PURE__ */ new WeakMap();
|
|
341
|
-
_ = /* @__PURE__ */ new WeakMap();
|
|
338
|
+
q = /* @__PURE__ */ new WeakMap();
|
|
339
|
+
J = /* @__PURE__ */ new WeakMap();
|
|
340
|
+
f = /* @__PURE__ */ new WeakMap();
|
|
341
|
+
Et = /* @__PURE__ */ new WeakMap();
|
|
342
342
|
p = /* @__PURE__ */ new WeakMap();
|
|
343
|
-
|
|
343
|
+
ct = /* @__PURE__ */ new WeakMap();
|
|
344
|
+
ut = /* @__PURE__ */ new WeakMap();
|
|
345
|
+
w = /* @__PURE__ */ new WeakMap();
|
|
346
|
+
d = /* @__PURE__ */ new WeakMap();
|
|
347
|
+
T = /* @__PURE__ */ new WeakMap();
|
|
344
348
|
M = /* @__PURE__ */ new WeakMap();
|
|
349
|
+
G = /* @__PURE__ */ new WeakMap();
|
|
350
|
+
b = /* @__PURE__ */ new WeakMap();
|
|
351
|
+
j = /* @__PURE__ */ new WeakMap();
|
|
345
352
|
H = /* @__PURE__ */ new WeakMap();
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
353
|
+
rt = /* @__PURE__ */ new WeakSet();
|
|
354
|
+
xt = function() {
|
|
355
|
+
m(this, Q, nt).call(this), t(this, Et).assignedElements().forEach((e) => {
|
|
356
|
+
e instanceof HTMLElement && t(this, p).push(new be(e, this));
|
|
357
|
+
}), t(this, f).style.transform = "", this.dispatchEvent(
|
|
358
|
+
new CustomEvent("sectionsChange", {
|
|
359
|
+
composed: !0
|
|
360
|
+
})
|
|
361
|
+
), t(this, K).call(this);
|
|
354
362
|
};
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
t(this,
|
|
363
|
+
Q = /* @__PURE__ */ new WeakSet();
|
|
364
|
+
nt = function() {
|
|
365
|
+
t(this, p).forEach((e) => {
|
|
358
366
|
e.destroy();
|
|
359
|
-
}),
|
|
367
|
+
}), v(this, p, []), this.dispatchEvent(
|
|
368
|
+
new CustomEvent("sectionsChange", {
|
|
369
|
+
composed: !0
|
|
370
|
+
})
|
|
371
|
+
);
|
|
360
372
|
};
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
t(this,
|
|
373
|
+
yt = /* @__PURE__ */ new WeakSet();
|
|
374
|
+
It = function() {
|
|
375
|
+
t(this, c).unsubscribe(t(this, kt)), t(this, c).stopAnimation(), t(this, M).disconnect(), t(this, G).disconnect();
|
|
364
376
|
};
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
t(this,
|
|
377
|
+
Ct = /* @__PURE__ */ new WeakSet();
|
|
378
|
+
Bt = function() {
|
|
379
|
+
t(this, c).subscribe(t(this, kt)), t(this, M).connect(), t(this, G).connect();
|
|
368
380
|
};
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
381
|
+
pt = /* @__PURE__ */ new WeakSet();
|
|
382
|
+
$t = function() {
|
|
383
|
+
_t.unsubscribe(t(this, K)), t(this, c).reset(), m(this, yt, It).call(this), t(this, f).style.transform = "", t(this, P).current && m(this, Q, nt).call(this), N.unregister(this);
|
|
372
384
|
};
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
t(this,
|
|
385
|
+
ft = /* @__PURE__ */ new WeakSet();
|
|
386
|
+
Ot = function() {
|
|
387
|
+
t(this, P).current && m(this, rt, xt).call(this), N.register(this), _t.subscribe(t(this, K), Yt.SCROLL), m(this, Ct, Bt).call(this);
|
|
376
388
|
};
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
t(this,
|
|
389
|
+
K = /* @__PURE__ */ new WeakMap();
|
|
390
|
+
kt = /* @__PURE__ */ new WeakMap();
|
|
391
|
+
zt = /* @__PURE__ */ new WeakSet();
|
|
392
|
+
jt = function(e) {
|
|
393
|
+
t(this, C).current ? (t(this, b).current = e % t(this, p).length, t(this, b).current = t(this, b).current < 0 ? t(this, p).length + t(this, b).current : t(this, b).current) : t(this, b).current = Qt(e, 0, t(this, p).length - 1);
|
|
382
394
|
};
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
if (t(this,
|
|
387
|
-
const s = t(this,
|
|
388
|
-
return s < 0 ? t(this,
|
|
395
|
+
dt = /* @__PURE__ */ new WeakMap();
|
|
396
|
+
vt = /* @__PURE__ */ new WeakSet();
|
|
397
|
+
At = function(e = "current") {
|
|
398
|
+
if (t(this, C).current && t(this, p).length) {
|
|
399
|
+
const s = t(this, c)[e] % (t(this, d) + t(this, w) + t(this, T));
|
|
400
|
+
return s < 0 ? t(this, d) + s + t(this, w) + t(this, T) : s;
|
|
389
401
|
} else
|
|
390
|
-
return t(this,
|
|
402
|
+
return t(this, c)[e];
|
|
391
403
|
};
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
],
|
|
395
|
-
var
|
|
396
|
-
class
|
|
404
|
+
Wt = ge([
|
|
405
|
+
at("e-scroll")
|
|
406
|
+
], Wt);
|
|
407
|
+
var ht;
|
|
408
|
+
class Ht extends Xt {
|
|
397
409
|
constructor() {
|
|
398
410
|
super(...arguments);
|
|
399
|
-
|
|
411
|
+
S(this, ht, null);
|
|
400
412
|
}
|
|
401
413
|
get scrollElement() {
|
|
402
|
-
return
|
|
414
|
+
return h(this, ht);
|
|
403
415
|
}
|
|
404
416
|
connectedCallback() {
|
|
405
|
-
const i =
|
|
406
|
-
i instanceof
|
|
417
|
+
const i = fe(this, Wt);
|
|
418
|
+
i instanceof Wt ? y(this, ht, i) : console.error(this, "e-scroll not found");
|
|
407
419
|
}
|
|
408
420
|
}
|
|
409
|
-
|
|
410
|
-
var
|
|
411
|
-
for (var
|
|
412
|
-
(
|
|
413
|
-
return r &&
|
|
414
|
-
},
|
|
421
|
+
ht = new WeakMap();
|
|
422
|
+
var _e = Object.defineProperty, Se = Object.getOwnPropertyDescriptor, Ee = (e, s, i, r) => {
|
|
423
|
+
for (var n = r > 1 ? void 0 : r ? Se(s, i) : s, a = e.length - 1, u; a >= 0; a--)
|
|
424
|
+
(u = e[a]) && (n = (r ? u(s, i, n) : u(n)) || n);
|
|
425
|
+
return r && n && _e(s, i, n), n;
|
|
426
|
+
}, te = (e, s, i) => {
|
|
415
427
|
if (!s.has(e))
|
|
416
428
|
throw TypeError("Cannot " + i);
|
|
417
|
-
},
|
|
429
|
+
}, l = (e, s, i) => (te(e, s, "read from private field"), i ? i.call(e) : s.get(e)), W = (e, s, i) => {
|
|
418
430
|
if (s.has(e))
|
|
419
431
|
throw TypeError("Cannot add the same private member more than once");
|
|
420
432
|
s instanceof WeakSet ? s.add(e) : s.set(e, i);
|
|
421
|
-
},
|
|
422
|
-
const
|
|
433
|
+
}, I = (e, s, i, r) => (te(e, s, "write to private field"), r ? r.call(e, i) : s.set(e, i), i), tt, x, A, D, et, st, mt, gt, bt, wt;
|
|
434
|
+
const xe = Vt({
|
|
423
435
|
":host": {
|
|
424
436
|
display: "inline-block",
|
|
425
437
|
zIndex: "1",
|
|
426
|
-
backgroundColor:
|
|
438
|
+
backgroundColor: Gt.colorLight.var
|
|
427
439
|
},
|
|
428
440
|
':host([axis="y"])': {
|
|
429
441
|
position: "absolute",
|
|
@@ -440,7 +452,7 @@ const ne = Rt({
|
|
|
440
452
|
height: "1vmin"
|
|
441
453
|
},
|
|
442
454
|
".default-thumb": {
|
|
443
|
-
backgroundColor:
|
|
455
|
+
backgroundColor: Gt.colorDark.var,
|
|
444
456
|
borderRadius: "1vmin",
|
|
445
457
|
touchAction: "none"
|
|
446
458
|
},
|
|
@@ -448,56 +460,180 @@ const ne = Rt({
|
|
|
448
460
|
touchAction: "none"
|
|
449
461
|
}
|
|
450
462
|
});
|
|
451
|
-
let
|
|
463
|
+
let Kt = class extends Ht {
|
|
452
464
|
constructor() {
|
|
453
|
-
super(),
|
|
454
|
-
|
|
455
|
-
const e =
|
|
456
|
-
|
|
457
|
-
}),
|
|
458
|
-
|
|
459
|
-
}),
|
|
465
|
+
super(), W(this, tt, null), W(this, x, null), W(this, A, !1), W(this, D, 0), W(this, et, 0), W(this, st, 0), W(this, mt, () => {
|
|
466
|
+
I(this, A, this.offsetWidth > this.offsetHeight);
|
|
467
|
+
const e = l(this, A) ? this.offsetWidth : this.offsetHeight;
|
|
468
|
+
I(this, D, e / ((this.scrollElement.scrollSize + this.scrollElement.viewportSize) / e)), I(this, D, Math.max(l(this, D), 30)), l(this, A) ? (l(this, x).style.width = l(this, D) + "px", l(this, x).style.height = "100%") : (l(this, x).style.width = "100%", l(this, x).style.height = l(this, D) + "px"), I(this, et, e - l(this, D)), this.scrollElement.scrollSize || (this.style.display = "none");
|
|
469
|
+
}), W(this, gt, () => {
|
|
470
|
+
I(this, st, this.scrollElement.currentProgress * l(this, et)), l(this, A) ? l(this, x).style.transform = `translate3d(${l(this, st)}px, 0px, 0px)` : l(this, x).style.transform = `translate3d(0px, ${l(this, st)}px, 0px)`;
|
|
471
|
+
}), W(this, bt, () => {
|
|
460
472
|
this.setAttribute("axis", this.scrollElement.axisAttibute.current);
|
|
461
|
-
}),
|
|
462
|
-
const s = (
|
|
463
|
-
const
|
|
464
|
-
this.scrollElement.setPosition(r +
|
|
473
|
+
}), W(this, wt, (e) => {
|
|
474
|
+
const s = (a) => {
|
|
475
|
+
const u = l(this, A) ? a.x : a.y, ie = this.scrollElement.distance / l(this, et), re = (u - n) * ie;
|
|
476
|
+
this.scrollElement.setPosition(r + re);
|
|
465
477
|
}, i = () => {
|
|
466
478
|
removeEventListener("pointermove", s), removeEventListener("pointerup", i), removeEventListener("touchend", i);
|
|
467
479
|
};
|
|
468
480
|
addEventListener("pointermove", s), addEventListener("pointerup", i), addEventListener("touchend", i);
|
|
469
|
-
const r = this.scrollElement.targetScrollValue,
|
|
470
|
-
}),
|
|
481
|
+
const r = this.scrollElement.targetScrollValue, n = l(this, A) ? e.x : e.y;
|
|
482
|
+
}), Dt && (this.openShadow(xe), Tt(this, {
|
|
471
483
|
slot: "static",
|
|
472
|
-
children: [
|
|
484
|
+
children: [
|
|
485
|
+
St({
|
|
486
|
+
ref: (e) => I(this, tt, e),
|
|
487
|
+
children: Lt({ class: "default-thumb" })
|
|
488
|
+
})
|
|
489
|
+
]
|
|
473
490
|
}));
|
|
474
491
|
}
|
|
475
492
|
get thumbElement() {
|
|
476
|
-
return
|
|
493
|
+
return l(this, x);
|
|
477
494
|
}
|
|
478
495
|
connectedCallback() {
|
|
479
496
|
super.connectedCallback();
|
|
480
|
-
const e =
|
|
481
|
-
|
|
497
|
+
const e = l(this, tt).assignedElements()[0] || l(this, tt).firstElementChild;
|
|
498
|
+
I(this, x, e), l(this, x).addEventListener("pointerdown", l(this, wt)), _t.subscribe(l(this, mt), Yt.SCROLL + 1), this.scrollElement.onScroll(l(this, gt)), this.scrollElement.axisAttibute.subscribe(l(this, bt));
|
|
482
499
|
}
|
|
483
500
|
disconnectedCallback() {
|
|
484
|
-
|
|
501
|
+
l(this, x).removeEventListener("pointerdown", l(this, wt)), _t.unsubscribe(l(this, mt)), this.scrollElement.offScroll(l(this, gt)), this.scrollElement.axisAttibute.unsubscribe(l(this, bt));
|
|
485
502
|
}
|
|
486
503
|
};
|
|
487
|
-
|
|
488
|
-
|
|
504
|
+
tt = /* @__PURE__ */ new WeakMap();
|
|
505
|
+
x = /* @__PURE__ */ new WeakMap();
|
|
489
506
|
A = /* @__PURE__ */ new WeakMap();
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
],
|
|
507
|
+
D = /* @__PURE__ */ new WeakMap();
|
|
508
|
+
et = /* @__PURE__ */ new WeakMap();
|
|
509
|
+
st = /* @__PURE__ */ new WeakMap();
|
|
510
|
+
mt = /* @__PURE__ */ new WeakMap();
|
|
511
|
+
gt = /* @__PURE__ */ new WeakMap();
|
|
512
|
+
bt = /* @__PURE__ */ new WeakMap();
|
|
513
|
+
wt = /* @__PURE__ */ new WeakMap();
|
|
514
|
+
Kt = Ee([
|
|
515
|
+
at("e-scrollbar")
|
|
516
|
+
], Kt);
|
|
517
|
+
const ye = Vt({
|
|
518
|
+
button: {
|
|
519
|
+
all: "inherit"
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
class ee extends Ht {
|
|
523
|
+
constructor() {
|
|
524
|
+
super(), this.openShadow(ye), Dt && Tt(this, {
|
|
525
|
+
children: [
|
|
526
|
+
ue({
|
|
527
|
+
onClick: () => {
|
|
528
|
+
this.handleClick();
|
|
529
|
+
},
|
|
530
|
+
children: [St()]
|
|
531
|
+
})
|
|
532
|
+
]
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
var Ce = Object.defineProperty, We = Object.getOwnPropertyDescriptor, ke = (e, s, i, r) => {
|
|
537
|
+
for (var n = r > 1 ? void 0 : r ? We(s, i) : s, a = e.length - 1, u; a >= 0; a--)
|
|
538
|
+
(u = e[a]) && (n = (r ? u(s, i, n) : u(n)) || n);
|
|
539
|
+
return r && n && Ce(s, i, n), n;
|
|
540
|
+
};
|
|
541
|
+
let Ut = class extends ee {
|
|
542
|
+
handleClick() {
|
|
543
|
+
const e = this.getAttribute("index"), s = this.getAttribute("behaviour");
|
|
544
|
+
this.scrollElement.scrollToSection(parseInt(e || "0"), s);
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
Ut = ke([
|
|
548
|
+
at("e-scroll-set-button")
|
|
549
|
+
], Ut);
|
|
550
|
+
var Pe = Object.defineProperty, Me = Object.getOwnPropertyDescriptor, Le = (e, s, i, r) => {
|
|
551
|
+
for (var n = r > 1 ? void 0 : r ? Me(s, i) : s, a = e.length - 1, u; a >= 0; a--)
|
|
552
|
+
(u = e[a]) && (n = (r ? u(s, i, n) : u(n)) || n);
|
|
553
|
+
return r && n && Pe(s, i, n), n;
|
|
554
|
+
};
|
|
555
|
+
let Zt = class extends ee {
|
|
556
|
+
handleClick() {
|
|
557
|
+
const e = this.getAttribute("step"), s = this.getAttribute("behaviour");
|
|
558
|
+
this.scrollElement.shiftSections(parseInt(e || "1"), s);
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
Zt = Le([
|
|
562
|
+
at("e-scroll-step-button")
|
|
563
|
+
], Zt);
|
|
564
|
+
var $e = Object.defineProperty, Oe = Object.getOwnPropertyDescriptor, ze = (e, s, i, r) => {
|
|
565
|
+
for (var n = r > 1 ? void 0 : r ? Oe(s, i) : s, a = e.length - 1, u; a >= 0; a--)
|
|
566
|
+
(u = e[a]) && (n = (r ? u(s, i, n) : u(n)) || n);
|
|
567
|
+
return r && n && $e(s, i, n), n;
|
|
568
|
+
}, se = (e, s, i) => {
|
|
569
|
+
if (!s.has(e))
|
|
570
|
+
throw TypeError("Cannot " + i);
|
|
571
|
+
}, U = (e, s, i) => (se(e, s, "read from private field"), i ? i.call(e) : s.get(e)), qt = (e, s, i) => {
|
|
572
|
+
if (s.has(e))
|
|
573
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
574
|
+
s instanceof WeakSet ? s.add(e) : s.set(e, i);
|
|
575
|
+
}, Jt = (e, s, i, r) => (se(e, s, "write to private field"), r ? r.call(e, i) : s.set(e, i), i), F, it, $, R, X, ot, lt, Y;
|
|
576
|
+
class Ae {
|
|
577
|
+
constructor(s, i, r) {
|
|
578
|
+
S(this, $, void 0);
|
|
579
|
+
S(this, R, void 0);
|
|
580
|
+
S(this, X, void 0);
|
|
581
|
+
S(this, ot, void 0);
|
|
582
|
+
S(this, lt, () => {
|
|
583
|
+
h(this, R).scrollToSection(h(this, X), h(this, ot));
|
|
584
|
+
});
|
|
585
|
+
S(this, Y, () => {
|
|
586
|
+
h(this, $).classList.toggle(
|
|
587
|
+
"current",
|
|
588
|
+
h(this, R).counter.current === h(this, X)
|
|
589
|
+
);
|
|
590
|
+
});
|
|
591
|
+
y(this, $, document.createElement("button")), y(this, R, s), y(this, ot, r), y(this, X, i), h(this, $).addEventListener("click", h(this, lt)), h(this, R).counter.subscribe(h(this, Y)), h(this, Y).call(this);
|
|
592
|
+
}
|
|
593
|
+
get element() {
|
|
594
|
+
return h(this, $);
|
|
595
|
+
}
|
|
596
|
+
destroy() {
|
|
597
|
+
h(this, $).removeEventListener("click", h(this, lt)), h(this, R).counter.unsubscribe(h(this, Y)), h(this, $).remove();
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
$ = new WeakMap(), R = new WeakMap(), X = new WeakMap(), ot = new WeakMap(), lt = new WeakMap(), Y = new WeakMap();
|
|
601
|
+
let Nt = class extends Ht {
|
|
602
|
+
constructor() {
|
|
603
|
+
super(...arguments), qt(this, F, []), qt(this, it, de(() => {
|
|
604
|
+
U(this, F).forEach((e) => e.destroy()), Jt(this, F, []);
|
|
605
|
+
for (let e = 0; e < this.scrollElement.sections.length; e++) {
|
|
606
|
+
const s = new Ae(
|
|
607
|
+
this.scrollElement,
|
|
608
|
+
e,
|
|
609
|
+
this.getAttribute("behaviour") || "smooth"
|
|
610
|
+
);
|
|
611
|
+
this.appendChild(s.element), U(this, F).push(s);
|
|
612
|
+
}
|
|
613
|
+
}, 0));
|
|
614
|
+
}
|
|
615
|
+
connectedCallback() {
|
|
616
|
+
super.connectedCallback(), this.scrollElement.addEventListener(
|
|
617
|
+
"sectionsChange",
|
|
618
|
+
U(this, it)
|
|
619
|
+
), U(this, it).call(this);
|
|
620
|
+
}
|
|
621
|
+
disconnectedCallback() {
|
|
622
|
+
this.scrollElement.removeEventListener(
|
|
623
|
+
"sectionsChange",
|
|
624
|
+
U(this, it)
|
|
625
|
+
), U(this, F).forEach((e) => e.destroy()), Jt(this, F, []);
|
|
626
|
+
}
|
|
627
|
+
};
|
|
628
|
+
F = /* @__PURE__ */ new WeakMap();
|
|
629
|
+
it = /* @__PURE__ */ new WeakMap();
|
|
630
|
+
Nt = ze([
|
|
631
|
+
at("e-scroll-bullet-buttons")
|
|
632
|
+
], Nt);
|
|
500
633
|
export {
|
|
501
|
-
|
|
502
|
-
|
|
634
|
+
Nt as ScrollBulletButtonsElement,
|
|
635
|
+
Wt as ScrollElement,
|
|
636
|
+
Ut as ScrollSetButtonElement,
|
|
637
|
+
Zt as ScrollStepButtonElement,
|
|
638
|
+
Kt as ScrollbarElement
|
|
503
639
|
};
|