aptechka 0.4.2 → 0.4.4
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/{Damped-B0eRyTcV.cjs → Damped-9h4qaGcS.cjs} +1 -1
- package/lib/{Damped-Do9H-LKf.js → Damped-HhitpTP_.js} +1 -1
- package/lib/{Derived-vGokdC4b.cjs → Derived-B-g8dYgh.cjs} +1 -1
- package/lib/{Derived-Dbjm-dob.js → Derived-kPJs5JC5.js} +1 -1
- package/lib/{SourceManager-noBYGNeX.js → SourceManager-4OHacQoQ.js} +1 -1
- package/lib/{SourceManager-CzcqsC3z.cjs → SourceManager-Bc68GDrb.cjs} +1 -1
- package/lib/Store-BQXXikps.js +156 -0
- package/lib/Store-C-1ruEIm.cjs +1 -0
- package/lib/{Viewport-CRLSlcoi.cjs → Viewport-DAjFJF5V.cjs} +1 -1
- package/lib/{Viewport-VSV_isot.js → Viewport-wlgZaIn7.js} +19 -21
- package/lib/WheelControls-0zNcnAB3.cjs +1 -0
- package/lib/WheelControls-BAyRKpRZ.js +97 -0
- package/lib/abstract-elements/index.cjs +1 -1
- package/lib/abstract-elements/index.js +3 -3
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +2 -2
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +1 -1
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +3 -3
- package/lib/controls/Controls.d.ts +1 -2
- package/lib/controls/KeyboardControls.d.ts +3 -0
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.d.ts +1 -1
- package/lib/controls/index.js +2 -2
- package/lib/{createStylesheet-CR-XQRVT.js → createStylesheet-DrkbCUJk.js} +1 -1
- package/lib/{createStylesheet-B4vLzvah.cjs → createStylesheet-u1ZQ2BI5.cjs} +1 -1
- package/lib/css-property/index.cjs +1 -0
- package/lib/css-property/index.d.ts +12 -0
- package/lib/css-property/index.js +54 -0
- package/lib/css-value-parser/index.cjs +1 -0
- package/lib/css-value-parser/index.d.ts +6 -0
- package/lib/css-value-parser/index.js +40 -0
- package/lib/dev/index.cjs +1 -0
- package/lib/dev/index.d.ts +1 -0
- package/lib/dev/index.js +14 -0
- package/lib/device/Viewport.d.ts +1 -1
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +1 -1
- package/lib/element-constructor/index.cjs +1 -1
- package/lib/element-constructor/index.js +2 -2
- package/lib/en3/index.cjs +1 -1
- package/lib/en3/index.js +2 -2
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +1 -1
- package/lib/{index-MKoD8NCT.cjs → index-CUE4tEUr.cjs} +1 -1
- package/lib/{index-D-FPaxdJ.js → index-DGji4duy.js} +3 -3
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +1 -1
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +1 -1
- package/lib/modal/index.cjs +1 -1
- package/lib/modal/index.js +8 -8
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.d.ts +5 -4
- package/lib/order/index.js +2 -2
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +1 -1
- package/lib/resized/index.cjs +1 -1
- package/lib/resized/index.js +1 -1
- package/lib/scroll/ScrollElement.d.ts +12 -10
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +178 -174
- package/lib/select/index.cjs +1 -1
- package/lib/select/index.js +1 -1
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +2 -2
- package/lib/store/Store.d.ts +1 -0
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +3 -3
- package/lib/studio/index.cjs +1 -1
- package/lib/studio/index.js +5 -5
- package/lib/{tags-D9nd9mMM.js → tags-CAxO5Rs3.js} +1 -1
- package/lib/{tags-D3-tO-m6.cjs → tags-Dz_Yisj_.cjs} +1 -1
- package/lib/theme/index.cjs +1 -1
- package/lib/theme/index.js +2 -2
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +1 -1
- package/package.json +25 -1
- package/lib/Store-DdDuj5hz.js +0 -153
- package/lib/Store-Dis8QUAR.cjs +0 -1
- package/lib/WheelControls-BqO_fTyY.js +0 -92
- package/lib/WheelControls-fiz52vcl.cjs +0 -1
package/lib/scroll/index.js
CHANGED
|
@@ -2,74 +2,75 @@ var Mt = (e, s, i) => {
|
|
|
2
2
|
if (!s.has(e))
|
|
3
3
|
throw TypeError("Cannot " + i);
|
|
4
4
|
};
|
|
5
|
-
var n = (e, s, i) => (Mt(e, s, "read from private field"), i ? i.call(e) : s.get(e)),
|
|
5
|
+
var n = (e, s, i) => (Mt(e, s, "read from private field"), i ? i.call(e) : s.get(e)), F = (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
|
+
}, V = (e, s, i, r) => (Mt(e, s, "write to private field"), r ? r.call(e, i) : s.set(e, i), i);
|
|
10
|
+
import { D as Bt } from "../Damped-HhitpTP_.js";
|
|
11
|
+
import { S as Kt } from "../Store-BQXXikps.js";
|
|
12
|
+
import { D as Gt } from "../Derived-kPJs5JC5.js";
|
|
13
|
+
import { i as zt } from "../browser-0zX67oeU.js";
|
|
14
|
+
import { a as vt, g as wt } from "../layout-HoBT_Da2.js";
|
|
15
|
+
import { c as At } from "../math-BOBiC4TN.js";
|
|
16
16
|
import "../ticker/index.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { TICK_ORDER as Zt, RESIZE_ORDER as Ot } from "../order/index.js";
|
|
17
|
+
import { W as Ut, K as Zt } from "../WheelControls-BAyRKpRZ.js";
|
|
18
|
+
import { CustomElement as $t, define as Dt } from "../custom-element/index.js";
|
|
19
|
+
import { TICK_ORDER as qt, RESIZE_ORDER as Ot } from "../order/index.js";
|
|
21
20
|
import { windowResizer as ct } from "../window-resizer/index.js";
|
|
22
|
-
import { scrollEntries as
|
|
23
|
-
import { e as Vt, D as Ct, ay as
|
|
24
|
-
import { c as
|
|
25
|
-
import { cssUnitParser as
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
import { scrollEntries as U } from "../scroll-entries/index.js";
|
|
22
|
+
import { e as Vt, D as Ct, ay as bt } from "../tags-CAxO5Rs3.js";
|
|
23
|
+
import { c as Rt } from "../createStylesheet-DrkbCUJk.js";
|
|
24
|
+
import { cssUnitParser as Jt } from "../css-unit-parser/index.js";
|
|
25
|
+
import { CSSProperty as E } from "../css-property/index.js";
|
|
26
|
+
import { f as Nt } from "../dom-0S_WDL4g.js";
|
|
27
|
+
import { aptechkaTheme as Pt } from "../theme/index.js";
|
|
28
|
+
var Qt = Object.defineProperty, Xt = Object.getOwnPropertyDescriptor, Yt = (e, s, i, r) => {
|
|
29
|
+
for (var l = r > 1 ? void 0 : r ? Xt(s, i) : s, f = e.length - 1, w; f >= 0; f--)
|
|
30
|
+
(w = e[f]) && (l = (r ? w(s, i, l) : w(l)) || l);
|
|
31
|
+
return r && l && Qt(s, i, l), l;
|
|
32
|
+
}, kt = (e, s, i) => {
|
|
32
33
|
if (!s.has(e))
|
|
33
34
|
throw TypeError("Cannot " + i);
|
|
34
|
-
}, t = (e, s, i) => (
|
|
35
|
+
}, t = (e, s, i) => (kt(e, s, "read from private field"), i ? i.call(e) : s.get(e)), h = (e, s, i) => {
|
|
35
36
|
if (s.has(e))
|
|
36
37
|
throw TypeError("Cannot add the same private member more than once");
|
|
37
38
|
s instanceof WeakSet ? s.add(e) : s.set(e, i);
|
|
38
|
-
}, d = (e, s, i, r) => (
|
|
39
|
-
class
|
|
39
|
+
}, d = (e, s, i, r) => (kt(e, s, "write to private field"), r ? r.call(e, i) : s.set(e, i), i), m = (e, s, i) => (kt(e, s, "access private method"), i), a, x, L, W, z, B, y, R, K, G, u, ut, c, j, tt, _, p, D, M, H, v, q, T, Q, pt, Z, X, ft, Et, dt, Wt, et, _t, st, St, I, gt, xt, Tt, it, rt, yt, S, g, O, C;
|
|
40
|
+
class jt {
|
|
40
41
|
constructor(s, i) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
F(this, S, void 0);
|
|
43
|
+
F(this, g, void 0);
|
|
44
|
+
F(this, O, 0);
|
|
45
|
+
F(this, C, 0);
|
|
46
|
+
V(this, S, s), V(this, g, i), U.register(n(this, S));
|
|
46
47
|
}
|
|
47
48
|
get size() {
|
|
48
|
-
return n(this,
|
|
49
|
+
return n(this, O);
|
|
49
50
|
}
|
|
50
51
|
get position() {
|
|
51
52
|
return n(this, C);
|
|
52
53
|
}
|
|
53
54
|
destroy() {
|
|
54
|
-
|
|
55
|
+
U.unregister(n(this, S)), n(this, S).style.transform = "";
|
|
55
56
|
}
|
|
56
57
|
resize() {
|
|
57
|
-
|
|
58
|
+
V(this, O, n(this, g).vertical ? n(this, S).offsetHeight : n(this, S).offsetWidth), V(this, C, n(this, g).vertical ? vt(n(this, S)) : wt(n(this, S))), V(this, C, n(this, C) - n(this, g).contentPosition);
|
|
58
59
|
}
|
|
59
60
|
transform() {
|
|
60
61
|
let s = 0;
|
|
61
|
-
const i = n(this, g).viewportSize - n(this,
|
|
62
|
-
n(this, g).
|
|
62
|
+
const i = n(this, g).viewportSize - n(this, O);
|
|
63
|
+
n(this, g).infiniteProperty.current && n(this, g).overscroll && n(this, C) + n(this, O) < n(this, g).currentScrollValue && (s = n(this, g).distance * -1 - n(this, g).gap), U.update(
|
|
63
64
|
n(this, S),
|
|
64
65
|
n(this, g).axisAttibute.current,
|
|
65
66
|
s
|
|
66
67
|
);
|
|
67
|
-
const r = n(this, g).currentScrollValue + s,
|
|
68
|
-
n(this, g).vertical ? n(this, S).style.transform = `translate3d(0px, ${
|
|
68
|
+
const r = n(this, g).currentScrollValue + s, l = n(this, C) - n(this, g).viewportSize - i, f = n(this, C) + n(this, O) + i, w = At(r, l, f);
|
|
69
|
+
n(this, g).vertical ? n(this, S).style.transform = `translate3d(0px, ${w * -1}px, 0px)` : n(this, S).style.transform = `translate3d(${w * -1}px, 0px, 0px)`;
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
|
-
S = new WeakMap(), g = new WeakMap(),
|
|
72
|
-
const
|
|
72
|
+
S = new WeakMap(), g = new WeakMap(), O = new WeakMap(), C = new WeakMap();
|
|
73
|
+
const te = Rt({
|
|
73
74
|
":host": {
|
|
74
75
|
position: "relative",
|
|
75
76
|
width: "100%",
|
|
@@ -101,135 +102,131 @@ const jt = Dt({
|
|
|
101
102
|
flexShrink: "0"
|
|
102
103
|
}
|
|
103
104
|
});
|
|
104
|
-
let mt = class extends
|
|
105
|
+
let mt = class extends $t {
|
|
105
106
|
constructor() {
|
|
106
|
-
super(), h(this, Q), h(this, Z), h(this, ft), h(this, dt), h(this, et), h(this, st), h(this, xt), h(this, rt), h(this,
|
|
107
|
+
super(), h(this, Q), h(this, Z), h(this, ft), h(this, dt), h(this, et), h(this, st), h(this, xt), h(this, rt), h(this, a, null), h(this, x, new E(this, "--axis", "y")), h(this, L, new E(this, "--pages", 0, {
|
|
107
108
|
validate: (e) => Math.max(0, e - 1)
|
|
108
|
-
})), h(this,
|
|
109
|
+
})), h(this, W, new E(this, "--split", !1)), h(this, z, new E(this, "--sectional", !1)), h(this, B, new E(
|
|
109
110
|
this,
|
|
110
|
-
"wheel-max-delta",
|
|
111
|
+
"--wheel-max-delta",
|
|
111
112
|
!1
|
|
112
|
-
)), h(this,
|
|
113
|
+
)), h(this, y, new E(this, "--infinite", !1)), h(this, R, new E(this, "--damping", 0.03)), h(this, K, new E(this, "--disabled", !1)), h(this, G, new E(this, "--hibernated", !1)), h(this, u, null), h(this, ut, null), h(this, c, []), h(this, j, 0), h(this, tt, 0), h(this, _, 0), h(this, p, 0), h(this, D, 0), h(this, M, null), h(this, H, null), h(this, v, new Kt(0)), h(this, q, 0), h(this, T, 0), h(this, I, () => {
|
|
113
114
|
const e = this.currentScrollValue / t(this, p) || 0;
|
|
114
|
-
if (d(this, j, this.vertical ?
|
|
115
|
+
if (d(this, j, this.vertical ? vt(this) : wt(this)), d(this, tt, this.vertical ? vt(t(this, u)) : wt(t(this, u))), d(this, _, this.vertical ? this.offsetHeight : this.offsetWidth), t(this, L).current) {
|
|
115
116
|
d(this, p, t(this, _) * t(this, L).current);
|
|
116
117
|
const s = t(this, p) + t(this, _);
|
|
117
118
|
this.vertical ? (t(this, u).style.width = s + "px", t(this, u).style.height = "100%") : (t(this, u).style.height = s + "px", t(this, u).style.width = "100%");
|
|
118
119
|
} else
|
|
119
120
|
this.vertical ? (t(this, u).style.width = "100%", t(this, u).style.height = "max-content", d(this, p, t(this, u).offsetHeight - t(this, _))) : (t(this, u).style.width = "max-content", t(this, u).style.height = "100%", d(this, p, t(this, u).offsetWidth - t(this, _)));
|
|
120
|
-
if (d(this,
|
|
121
|
+
if (d(this, D, Jt.parse(getComputedStyle(t(this, u)).gap)), !t(this, y).current) {
|
|
121
122
|
const s = getComputedStyle(this);
|
|
122
|
-
d(this, p, t(this, p) + (this.vertical ? parseFloat(s.paddingBlockStart) + parseFloat(s.paddingBlockEnd) : parseFloat(s.paddingInlineStart) + parseFloat(s.paddingInlineEnd))), t(this,
|
|
123
|
+
d(this, p, t(this, p) + (this.vertical ? parseFloat(s.paddingBlockStart) + parseFloat(s.paddingBlockEnd) : parseFloat(s.paddingInlineStart) + parseFloat(s.paddingInlineEnd))), t(this, a).max = t(this, p);
|
|
123
124
|
}
|
|
124
125
|
if (t(this, c).forEach((s) => {
|
|
125
126
|
s.resize(), s.transform();
|
|
126
|
-
}), t(this,
|
|
127
|
+
}), t(this, y).current && t(this, c).length) {
|
|
127
128
|
const s = t(this, c)[t(this, c).length - 1], i = s.position + s.size - t(this, _), r = t(this, p) - i;
|
|
128
129
|
d(this, T, s.position + s.size + r);
|
|
129
130
|
} else
|
|
130
131
|
d(this, T, t(this, p));
|
|
131
|
-
if (t(this,
|
|
132
|
-
const s = t(this, c)[t(this,
|
|
133
|
-
t(this,
|
|
132
|
+
if (t(this, z).current && t(this, c).length) {
|
|
133
|
+
const s = t(this, c)[t(this, v).current];
|
|
134
|
+
t(this, a).set(s.position, !0);
|
|
134
135
|
} else
|
|
135
|
-
t(this,
|
|
136
|
+
t(this, a).set(e * t(this, p), !0);
|
|
136
137
|
}), h(this, gt, () => {
|
|
137
138
|
const e = this.currentScrollValue;
|
|
138
139
|
if (d(this, q, Math.max(0, e - t(this, p))), t(this, c).length) {
|
|
139
140
|
let s = 0;
|
|
140
141
|
for (let i = 0; i < t(this, c).length; i++) {
|
|
141
142
|
const r = t(this, c)[i];
|
|
142
|
-
r.transform(),
|
|
143
|
-
this.targetScrollValue + this.viewportSize / 2 >= r.position && (s = i);
|
|
143
|
+
r.transform(), this.targetScrollValue + this.viewportSize / 2 >= r.position && (s = i);
|
|
144
144
|
}
|
|
145
|
-
t(this,
|
|
145
|
+
t(this, v).current = s;
|
|
146
146
|
} else
|
|
147
147
|
this.vertical ? t(this, u).style.transform = `translate3d(0px, ${e * -1}px, 0px)` : t(this, u).style.transform = `translate3d(${e * -1}px, 0px, 0px)`;
|
|
148
|
-
|
|
148
|
+
U.update(this, t(this, x).current, e);
|
|
149
149
|
}), h(this, it, (e) => {
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
else
|
|
157
|
-
e === "min" ? t(this, l).set(t(this, l).min) : e === "max" && t(this, l).set(t(this, l).length);
|
|
158
|
-
}), Lt && (d(this, l, new Ft(0, {
|
|
150
|
+
if (t(this, z).current) {
|
|
151
|
+
const s = Math.sign(e);
|
|
152
|
+
t(this, c).length ? this.shiftSections(s) : t(this, a).shift(s * t(this, _));
|
|
153
|
+
} else
|
|
154
|
+
t(this, a).shift(e);
|
|
155
|
+
}), zt && (d(this, a, new Bt(0, {
|
|
159
156
|
damping: 0.01,
|
|
160
157
|
min: 0,
|
|
161
|
-
order:
|
|
162
|
-
})), this.openShadow(
|
|
158
|
+
order: qt.SCROLL
|
|
159
|
+
})), this.openShadow(te), Vt(this, {
|
|
163
160
|
tabIndex: 0,
|
|
164
161
|
children: [
|
|
165
162
|
Ct({
|
|
166
163
|
class: "static",
|
|
167
|
-
children: [
|
|
164
|
+
children: [bt({ name: "static" })]
|
|
168
165
|
}),
|
|
169
166
|
Ct({
|
|
170
167
|
class: "content",
|
|
171
|
-
children: [
|
|
168
|
+
children: [bt({ ref: (e) => d(this, ut, e) })],
|
|
172
169
|
style: {
|
|
173
|
-
flexDirection: new
|
|
174
|
-
t(this,
|
|
170
|
+
flexDirection: new Gt(
|
|
171
|
+
t(this, x),
|
|
175
172
|
(e) => e === "x" ? "row" : "column"
|
|
176
173
|
)
|
|
177
174
|
},
|
|
178
175
|
ref: (e) => d(this, u, e)
|
|
179
176
|
})
|
|
180
177
|
]
|
|
181
|
-
}), d(this, M, new
|
|
182
|
-
t(this, u).style.flexDirection = e === "x" ? "row" : "column", t(this, M).axis = t(this,
|
|
183
|
-
}), t(this,
|
|
184
|
-
t(this, M).axis = e.current ? "max" : t(this,
|
|
178
|
+
}), d(this, M, new Ut({ element: this })), t(this, M).changeEvent.subscribe(t(this, it)), d(this, H, new Zt({ element: this })), t(this, H).changeEvent.subscribe(t(this, it)), t(this, x).subscribe(({ current: e }) => {
|
|
179
|
+
t(this, u).style.flexDirection = e === "x" ? "row" : "column", t(this, M).axis = t(this, B).current ? "max" : e, t(this, H).dimension = e === "x" ? "width" : "height", this.isConnected && t(this, I).call(this);
|
|
180
|
+
}), t(this, B).subscribe((e) => {
|
|
181
|
+
t(this, M).axis = e.current ? "max" : t(this, x).current;
|
|
185
182
|
}), t(this, L).subscribe(() => {
|
|
186
183
|
this.isConnected && t(this, I).call(this);
|
|
187
|
-
}), t(this,
|
|
184
|
+
}), t(this, W).subscribe(({ current: e }) => {
|
|
188
185
|
this.isConnected && (e ? m(this, Q, pt).call(this) : m(this, Z, X).call(this));
|
|
189
|
-
}), t(this,
|
|
190
|
-
t(this,
|
|
191
|
-
}), t(this,
|
|
192
|
-
e.current ? (this.isConnected && (t(this, c).length || (t(this,
|
|
186
|
+
}), t(this, z).subscribe((e) => {
|
|
187
|
+
t(this, v).current = 0, t(this, M).debounce = e.current, t(this, a).reset(), this.isConnected && (e.current && !e.previous ? m(this, Q, pt).call(this) : !e.current && e.previous && m(this, Z, X).call(this));
|
|
188
|
+
}), t(this, y).subscribe((e) => {
|
|
189
|
+
e.current ? (this.isConnected && (t(this, c).length || (t(this, W).current = !0)), t(this, c).length && (t(this, a).max = 1 / 0, t(this, a).min = -1 / 0)) : (d(this, q, 0), t(this, a).max = t(this, p), t(this, a).min = 0);
|
|
193
190
|
}), t(this, R).subscribe((e) => {
|
|
194
|
-
t(this,
|
|
195
|
-
}), t(this, B).subscribe((e) => {
|
|
196
|
-
e.current && !e.previous ? m(this, ft, Wt).call(this) : !e.current && e.previous && m(this, dt, yt).call(this);
|
|
191
|
+
t(this, a).damping = e.current;
|
|
197
192
|
}), t(this, K).subscribe((e) => {
|
|
193
|
+
e.current && !e.previous ? m(this, ft, Et).call(this) : !e.current && e.previous && m(this, dt, Wt).call(this);
|
|
194
|
+
}), t(this, G).subscribe((e) => {
|
|
198
195
|
e.current && !e.previous ? m(this, et, _t).call(this) : !e.current && e.previous && m(this, st, St).call(this);
|
|
199
196
|
}));
|
|
200
197
|
}
|
|
201
|
-
get
|
|
198
|
+
get dampingProperty() {
|
|
202
199
|
return t(this, R);
|
|
203
200
|
}
|
|
204
201
|
get axisAttibute() {
|
|
205
|
-
return t(this,
|
|
202
|
+
return t(this, x);
|
|
206
203
|
}
|
|
207
204
|
get pagesAttibute() {
|
|
208
205
|
return t(this, L);
|
|
209
206
|
}
|
|
210
207
|
get splitAttibute() {
|
|
211
|
-
return t(this,
|
|
208
|
+
return t(this, W);
|
|
212
209
|
}
|
|
213
210
|
get sectionalAttibute() {
|
|
214
|
-
return t(this,
|
|
211
|
+
return t(this, z);
|
|
215
212
|
}
|
|
216
|
-
get
|
|
217
|
-
return t(this,
|
|
213
|
+
get infiniteProperty() {
|
|
214
|
+
return t(this, y);
|
|
218
215
|
}
|
|
219
216
|
get dampingAttibute() {
|
|
220
217
|
return t(this, R);
|
|
221
218
|
}
|
|
222
219
|
get disabledAttibute() {
|
|
223
|
-
return t(this,
|
|
220
|
+
return t(this, K);
|
|
224
221
|
}
|
|
225
222
|
get hibernatedAttibute() {
|
|
226
|
-
return t(this,
|
|
223
|
+
return t(this, G);
|
|
227
224
|
}
|
|
228
225
|
get currentScrollValue() {
|
|
229
|
-
return m(this, rt,
|
|
226
|
+
return m(this, rt, yt).call(this, "current");
|
|
230
227
|
}
|
|
231
228
|
get targetScrollValue() {
|
|
232
|
-
return m(this, rt,
|
|
229
|
+
return m(this, rt, yt).call(this, "target");
|
|
233
230
|
}
|
|
234
231
|
get contentElement() {
|
|
235
232
|
return t(this, u);
|
|
@@ -247,10 +244,10 @@ let mt = class extends zt {
|
|
|
247
244
|
return t(this, p);
|
|
248
245
|
}
|
|
249
246
|
get gap() {
|
|
250
|
-
return t(this,
|
|
247
|
+
return t(this, D);
|
|
251
248
|
}
|
|
252
249
|
get counter() {
|
|
253
|
-
return t(this,
|
|
250
|
+
return t(this, v);
|
|
254
251
|
}
|
|
255
252
|
get distance() {
|
|
256
253
|
return t(this, T);
|
|
@@ -259,7 +256,7 @@ let mt = class extends zt {
|
|
|
259
256
|
return t(this, q);
|
|
260
257
|
}
|
|
261
258
|
get vertical() {
|
|
262
|
-
return t(this,
|
|
259
|
+
return t(this, x).current === "y";
|
|
263
260
|
}
|
|
264
261
|
get currentProgress() {
|
|
265
262
|
return this.currentScrollValue / t(this, T) || 0;
|
|
@@ -268,68 +265,74 @@ let mt = class extends zt {
|
|
|
268
265
|
return this.targetScrollValue / t(this, T) || 0;
|
|
269
266
|
}
|
|
270
267
|
get speed() {
|
|
271
|
-
return t(this,
|
|
268
|
+
return t(this, a).speed;
|
|
272
269
|
}
|
|
273
270
|
get direction() {
|
|
274
|
-
return t(this,
|
|
271
|
+
return t(this, a).direction;
|
|
275
272
|
}
|
|
276
273
|
get isRunning() {
|
|
277
|
-
return t(this,
|
|
274
|
+
return t(this, a).isRunning;
|
|
275
|
+
}
|
|
276
|
+
get scrollWidth() {
|
|
277
|
+
return t(this, x).current === "y" ? 0 : t(this, a).length;
|
|
278
|
+
}
|
|
279
|
+
get scrollHeight() {
|
|
280
|
+
return t(this, x).current === "x" ? 0 : t(this, a).length;
|
|
278
281
|
}
|
|
279
282
|
onScroll(...e) {
|
|
280
|
-
return t(this,
|
|
283
|
+
return t(this, a).subscribe(...e);
|
|
281
284
|
}
|
|
282
285
|
offScroll(...e) {
|
|
283
|
-
t(this,
|
|
286
|
+
t(this, a).unsubscribe(...e);
|
|
284
287
|
}
|
|
285
288
|
//https://github.com/pmndrs/drei/blob/d3282cdd02d170ef603a5e096505d83dc93cd57a/src/web/ScrollControls.tsx#L85C7-L100C9
|
|
286
289
|
range(e, s, i = 0) {
|
|
287
|
-
const r = e - i,
|
|
288
|
-
return this.currentProgress < r ? 0 : this.currentProgress >
|
|
290
|
+
const r = e - i, l = r + s + i * 2;
|
|
291
|
+
return this.currentProgress < r ? 0 : this.currentProgress > l ? 1 : (this.currentProgress - r) / (l - r);
|
|
289
292
|
}
|
|
290
293
|
curve(e, s, i = 0) {
|
|
291
294
|
return Math.sin(this.range(e, s, i) * Math.PI);
|
|
292
295
|
}
|
|
293
296
|
visible(e, s, i = 0) {
|
|
294
|
-
const r = e - i,
|
|
295
|
-
return this.currentProgress >= r && this.currentProgress <=
|
|
297
|
+
const r = e - i, l = r + s + i * 2;
|
|
298
|
+
return this.currentProgress >= r && this.currentProgress <= l;
|
|
296
299
|
}
|
|
297
300
|
// TODO: Поправить значение когда скролл не секционный ??
|
|
298
301
|
scrollToSection(e, s = "smooth") {
|
|
299
302
|
if (!t(this, c).length)
|
|
300
303
|
return;
|
|
301
|
-
const i = t(this,
|
|
302
|
-
m(this, xt,
|
|
303
|
-
const r = t(this, c)[i],
|
|
304
|
-
if (r &&
|
|
304
|
+
const i = t(this, v).current;
|
|
305
|
+
m(this, xt, Tt).call(this, e);
|
|
306
|
+
const r = t(this, c)[i], l = t(this, c)[t(this, v).current];
|
|
307
|
+
if (r && l) {
|
|
305
308
|
let f = 0;
|
|
306
|
-
const
|
|
307
|
-
t(this,
|
|
309
|
+
const w = t(this, c).length - 1;
|
|
310
|
+
t(this, y).current ? t(this, v).current === 0 && i === w ? f = t(this, p) + t(this, _) - r.position + t(this, D) : t(this, v).current === w && i === 0 ? f = l.position - (t(this, p) + t(this, _) + t(this, D)) : f = l.position - r.position : f = l.position - r.position, t(this, a).shift(f, s === "instant");
|
|
308
311
|
}
|
|
309
312
|
}
|
|
310
313
|
shiftSections(e, s = "smooth") {
|
|
311
|
-
t(this, c).length && this.scrollToSection(t(this,
|
|
314
|
+
t(this, c).length && this.scrollToSection(t(this, v).current + e, s);
|
|
312
315
|
}
|
|
313
316
|
setPosition(e, s = "smooth") {
|
|
314
|
-
t(this,
|
|
317
|
+
t(this, a).set(e, s === "instant");
|
|
315
318
|
}
|
|
316
319
|
connectedCallback() {
|
|
317
|
-
t(this,
|
|
320
|
+
t(this, x).observe(), t(this, L).observe(), t(this, W).observe(), t(this, z).observe(), t(this, B).observe(), t(this, y).observe(), t(this, R).observe(), t(this, K).observe(), t(this, G).observe(), m(this, st, St).call(this);
|
|
318
321
|
}
|
|
319
322
|
disconnectedCallback() {
|
|
320
|
-
t(this,
|
|
323
|
+
t(this, x).unobserve(), t(this, L).unobserve(), t(this, W).unobserve(), t(this, z).unobserve(), t(this, B).unobserve(), t(this, y).unobserve(), t(this, R).unobserve(), t(this, K).unobserve(), t(this, G).unobserve(), m(this, et, _t).call(this);
|
|
321
324
|
}
|
|
322
325
|
};
|
|
323
|
-
|
|
324
|
-
|
|
326
|
+
a = /* @__PURE__ */ new WeakMap();
|
|
327
|
+
x = /* @__PURE__ */ new WeakMap();
|
|
325
328
|
L = /* @__PURE__ */ new WeakMap();
|
|
329
|
+
W = /* @__PURE__ */ new WeakMap();
|
|
330
|
+
z = /* @__PURE__ */ new WeakMap();
|
|
331
|
+
B = /* @__PURE__ */ new WeakMap();
|
|
326
332
|
y = /* @__PURE__ */ new WeakMap();
|
|
327
|
-
P = /* @__PURE__ */ new WeakMap();
|
|
328
|
-
F = /* @__PURE__ */ new WeakMap();
|
|
329
|
-
x = /* @__PURE__ */ new WeakMap();
|
|
330
333
|
R = /* @__PURE__ */ new WeakMap();
|
|
331
|
-
B = /* @__PURE__ */ new WeakMap();
|
|
332
334
|
K = /* @__PURE__ */ new WeakMap();
|
|
335
|
+
G = /* @__PURE__ */ new WeakMap();
|
|
333
336
|
u = /* @__PURE__ */ new WeakMap();
|
|
334
337
|
ut = /* @__PURE__ */ new WeakMap();
|
|
335
338
|
c = /* @__PURE__ */ new WeakMap();
|
|
@@ -337,16 +340,16 @@ j = /* @__PURE__ */ new WeakMap();
|
|
|
337
340
|
tt = /* @__PURE__ */ new WeakMap();
|
|
338
341
|
_ = /* @__PURE__ */ new WeakMap();
|
|
339
342
|
p = /* @__PURE__ */ new WeakMap();
|
|
340
|
-
|
|
343
|
+
D = /* @__PURE__ */ new WeakMap();
|
|
341
344
|
M = /* @__PURE__ */ new WeakMap();
|
|
342
|
-
|
|
343
|
-
|
|
345
|
+
H = /* @__PURE__ */ new WeakMap();
|
|
346
|
+
v = /* @__PURE__ */ new WeakMap();
|
|
344
347
|
q = /* @__PURE__ */ new WeakMap();
|
|
345
348
|
T = /* @__PURE__ */ new WeakMap();
|
|
346
349
|
Q = /* @__PURE__ */ new WeakSet();
|
|
347
350
|
pt = function() {
|
|
348
351
|
m(this, Z, X).call(this), t(this, ut).assignedElements().forEach((e) => {
|
|
349
|
-
e instanceof HTMLElement && t(this, c).push(new
|
|
352
|
+
e instanceof HTMLElement && t(this, c).push(new jt(e, this));
|
|
350
353
|
}), t(this, u).style.transform = "", t(this, I).call(this);
|
|
351
354
|
};
|
|
352
355
|
Z = /* @__PURE__ */ new WeakSet();
|
|
@@ -356,71 +359,71 @@ X = function() {
|
|
|
356
359
|
}), d(this, c, []);
|
|
357
360
|
};
|
|
358
361
|
ft = /* @__PURE__ */ new WeakSet();
|
|
359
|
-
|
|
360
|
-
t(this,
|
|
362
|
+
Et = function() {
|
|
363
|
+
t(this, a).unsubscribe(t(this, gt)), t(this, a).stopAnimation(), t(this, M).disconnect(), t(this, H).disconnect();
|
|
361
364
|
};
|
|
362
365
|
dt = /* @__PURE__ */ new WeakSet();
|
|
363
|
-
|
|
364
|
-
t(this,
|
|
366
|
+
Wt = function() {
|
|
367
|
+
t(this, a).subscribe(t(this, gt)), t(this, M).connect(), t(this, H).connect();
|
|
365
368
|
};
|
|
366
369
|
et = /* @__PURE__ */ new WeakSet();
|
|
367
370
|
_t = function() {
|
|
368
|
-
ct.unsubscribe(t(this, I)), t(this,
|
|
371
|
+
ct.unsubscribe(t(this, I)), t(this, a).reset(), m(this, ft, Et).call(this), t(this, u).style.transform = "", t(this, W).current && m(this, Z, X).call(this), U.unregister(this);
|
|
369
372
|
};
|
|
370
373
|
st = /* @__PURE__ */ new WeakSet();
|
|
371
374
|
St = function() {
|
|
372
|
-
t(this,
|
|
375
|
+
t(this, W).current && m(this, Q, pt).call(this), U.register(this), ct.subscribe(t(this, I), Ot.SCROLL), m(this, dt, Wt).call(this);
|
|
373
376
|
};
|
|
374
377
|
I = /* @__PURE__ */ new WeakMap();
|
|
375
378
|
gt = /* @__PURE__ */ new WeakMap();
|
|
376
379
|
xt = /* @__PURE__ */ new WeakSet();
|
|
377
|
-
|
|
378
|
-
t(this,
|
|
380
|
+
Tt = function(e) {
|
|
381
|
+
t(this, y).current ? (t(this, v).current = e % t(this, c).length, t(this, v).current = t(this, v).current < 0 ? t(this, c).length + t(this, v).current : t(this, v).current) : t(this, v).current = At(e, 0, t(this, c).length - 1);
|
|
379
382
|
};
|
|
380
383
|
it = /* @__PURE__ */ new WeakMap();
|
|
381
384
|
rt = /* @__PURE__ */ new WeakSet();
|
|
382
|
-
|
|
383
|
-
if (t(this,
|
|
384
|
-
const s = t(this,
|
|
385
|
-
return s < 0 ? t(this, p) + s + t(this, _) + t(this,
|
|
385
|
+
yt = function(e = "current") {
|
|
386
|
+
if (t(this, y).current && t(this, c).length) {
|
|
387
|
+
const s = t(this, a)[e] % (t(this, p) + t(this, _) + t(this, D));
|
|
388
|
+
return s < 0 ? t(this, p) + s + t(this, _) + t(this, D) : s;
|
|
386
389
|
} else
|
|
387
|
-
return t(this,
|
|
390
|
+
return t(this, a)[e];
|
|
388
391
|
};
|
|
389
|
-
mt =
|
|
390
|
-
|
|
392
|
+
mt = Yt([
|
|
393
|
+
Dt("e-scroll")
|
|
391
394
|
], mt);
|
|
392
395
|
var Y;
|
|
393
|
-
class
|
|
396
|
+
class ee extends $t {
|
|
394
397
|
constructor() {
|
|
395
398
|
super(...arguments);
|
|
396
|
-
|
|
399
|
+
F(this, Y, null);
|
|
397
400
|
}
|
|
398
401
|
get scrollElement() {
|
|
399
402
|
return n(this, Y);
|
|
400
403
|
}
|
|
401
404
|
connectedCallback() {
|
|
402
|
-
const i =
|
|
403
|
-
i instanceof mt ?
|
|
405
|
+
const i = Nt(this, mt);
|
|
406
|
+
i instanceof mt ? V(this, Y, i) : console.error(this, "e-scroll not found");
|
|
404
407
|
}
|
|
405
408
|
}
|
|
406
409
|
Y = new WeakMap();
|
|
407
|
-
var
|
|
408
|
-
for (var
|
|
409
|
-
(
|
|
410
|
-
return r &&
|
|
411
|
-
},
|
|
410
|
+
var se = Object.defineProperty, ie = Object.getOwnPropertyDescriptor, re = (e, s, i, r) => {
|
|
411
|
+
for (var l = r > 1 ? void 0 : r ? ie(s, i) : s, f = e.length - 1, w; f >= 0; f--)
|
|
412
|
+
(w = e[f]) && (l = (r ? w(s, i, l) : w(l)) || l);
|
|
413
|
+
return r && l && se(s, i, l), l;
|
|
414
|
+
}, Ht = (e, s, i) => {
|
|
412
415
|
if (!s.has(e))
|
|
413
416
|
throw TypeError("Cannot " + i);
|
|
414
|
-
}, o = (e, s, i) => (
|
|
417
|
+
}, o = (e, s, i) => (Ht(e, s, "read from private field"), i ? i.call(e) : s.get(e)), k = (e, s, i) => {
|
|
415
418
|
if (s.has(e))
|
|
416
419
|
throw TypeError("Cannot add the same private member more than once");
|
|
417
420
|
s instanceof WeakSet ? s.add(e) : s.set(e, i);
|
|
418
|
-
},
|
|
419
|
-
const
|
|
421
|
+
}, P = (e, s, i, r) => (Ht(e, s, "write to private field"), r ? r.call(e, i) : s.set(e, i), i), nt, b, A, $, J, N, ht, ot, lt, at;
|
|
422
|
+
const ne = Rt({
|
|
420
423
|
":host": {
|
|
421
424
|
display: "inline-block",
|
|
422
425
|
zIndex: "1",
|
|
423
|
-
backgroundColor:
|
|
426
|
+
backgroundColor: Pt.colorLight.var
|
|
424
427
|
},
|
|
425
428
|
':host([axis="y"])': {
|
|
426
429
|
position: "absolute",
|
|
@@ -437,7 +440,7 @@ const re = Dt({
|
|
|
437
440
|
height: "1vmin"
|
|
438
441
|
},
|
|
439
442
|
".default-thumb": {
|
|
440
|
-
backgroundColor:
|
|
443
|
+
backgroundColor: Pt.colorDark.var,
|
|
441
444
|
borderRadius: "1vmin",
|
|
442
445
|
touchAction: "none"
|
|
443
446
|
},
|
|
@@ -445,44 +448,45 @@ const re = Dt({
|
|
|
445
448
|
touchAction: "none"
|
|
446
449
|
}
|
|
447
450
|
});
|
|
448
|
-
let
|
|
451
|
+
let Lt = class extends ee {
|
|
449
452
|
constructor() {
|
|
450
|
-
super(), k(this, nt, null), k(this,
|
|
451
|
-
|
|
452
|
-
const e = o(this,
|
|
453
|
-
|
|
453
|
+
super(), k(this, nt, null), k(this, b, null), k(this, A, !1), k(this, $, 0), k(this, J, 0), k(this, N, 0), k(this, ht, () => {
|
|
454
|
+
P(this, A, this.offsetWidth > this.offsetHeight);
|
|
455
|
+
const e = o(this, A) ? this.offsetWidth : this.offsetHeight;
|
|
456
|
+
P(this, $, e / ((this.scrollElement.scrollSize + this.scrollElement.viewportSize) / e)), P(this, $, Math.max(o(this, $), 30)), o(this, A) ? (o(this, b).style.width = o(this, $) + "px", o(this, b).style.height = "100%") : (o(this, b).style.width = "100%", o(this, b).style.height = o(this, $) + "px"), P(this, J, e - o(this, $)), this.scrollElement.scrollSize || (this.style.display = "none");
|
|
454
457
|
}), k(this, ot, () => {
|
|
455
|
-
|
|
458
|
+
P(this, N, this.scrollElement.currentProgress * o(this, J)), o(this, A) ? o(this, b).style.transform = `translate3d(${o(this, N)}px, 0px, 0px)` : o(this, b).style.transform = `translate3d(0px, ${o(this, N)}px, 0px)`;
|
|
456
459
|
}), k(this, lt, () => {
|
|
457
460
|
this.setAttribute("axis", this.scrollElement.axisAttibute.current);
|
|
458
461
|
}), k(this, at, (e) => {
|
|
459
462
|
const s = (f) => {
|
|
460
|
-
const
|
|
461
|
-
this.scrollElement.setPosition(r +
|
|
463
|
+
const w = o(this, A) ? f.x : f.y, It = this.scrollElement.distance / o(this, J), Ft = (w - l) * It;
|
|
464
|
+
this.scrollElement.setPosition(r + Ft);
|
|
462
465
|
}, i = () => {
|
|
463
466
|
removeEventListener("pointermove", s), removeEventListener("pointerup", i), removeEventListener("touchend", i);
|
|
464
467
|
};
|
|
465
468
|
addEventListener("pointermove", s), addEventListener("pointerup", i), addEventListener("touchend", i);
|
|
466
|
-
const r = this.scrollElement.targetScrollValue,
|
|
467
|
-
}),
|
|
468
|
-
|
|
469
|
+
const r = this.scrollElement.targetScrollValue, l = o(this, A) ? e.x : e.y;
|
|
470
|
+
}), zt && (this.openShadow(ne), Vt(this, {
|
|
471
|
+
slot: "static",
|
|
472
|
+
children: [bt({ ref: (e) => P(this, nt, e) })]
|
|
469
473
|
}));
|
|
470
474
|
}
|
|
471
475
|
get thumbElement() {
|
|
472
|
-
return o(this,
|
|
476
|
+
return o(this, b);
|
|
473
477
|
}
|
|
474
478
|
connectedCallback() {
|
|
475
479
|
super.connectedCallback();
|
|
476
480
|
const e = o(this, nt).assignedElements()[0];
|
|
477
|
-
e instanceof HTMLElement ?
|
|
481
|
+
e instanceof HTMLElement ? P(this, b, e) : (P(this, b, document.createElement("div")), o(this, b).classList.add("default-thumb"), this.shadowRoot.appendChild(o(this, b))), o(this, b).addEventListener("pointerdown", o(this, at)), ct.subscribe(o(this, ht), Ot.SCROLL + 1), this.scrollElement.onScroll(o(this, ot)), this.scrollElement.axisAttibute.subscribe(o(this, lt));
|
|
478
482
|
}
|
|
479
483
|
disconnectedCallback() {
|
|
480
|
-
o(this,
|
|
484
|
+
o(this, b).removeEventListener("pointerdown", o(this, at)), ct.unsubscribe(o(this, ht)), this.scrollElement.offScroll(o(this, ot)), this.scrollElement.axisAttibute.unsubscribe(o(this, lt));
|
|
481
485
|
}
|
|
482
486
|
};
|
|
483
487
|
nt = /* @__PURE__ */ new WeakMap();
|
|
484
|
-
|
|
485
|
-
|
|
488
|
+
b = /* @__PURE__ */ new WeakMap();
|
|
489
|
+
A = /* @__PURE__ */ new WeakMap();
|
|
486
490
|
$ = /* @__PURE__ */ new WeakMap();
|
|
487
491
|
J = /* @__PURE__ */ new WeakMap();
|
|
488
492
|
N = /* @__PURE__ */ new WeakMap();
|
|
@@ -490,10 +494,10 @@ ht = /* @__PURE__ */ new WeakMap();
|
|
|
490
494
|
ot = /* @__PURE__ */ new WeakMap();
|
|
491
495
|
lt = /* @__PURE__ */ new WeakMap();
|
|
492
496
|
at = /* @__PURE__ */ new WeakMap();
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
],
|
|
497
|
+
Lt = re([
|
|
498
|
+
Dt("e-scrollbar")
|
|
499
|
+
], Lt);
|
|
496
500
|
export {
|
|
497
501
|
mt as ScrollElement,
|
|
498
|
-
|
|
502
|
+
Lt as ScrollbarElement
|
|
499
503
|
};
|