aptechka 0.83.1 → 0.84.1
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/Animation-BUD5w3AB.js +110 -0
- package/lib/Animation-BtUdarQ7.cjs +1 -0
- package/lib/Composed-BI5oe4Ij.cjs +1 -0
- package/lib/Composed-BaevH-MP.js +75 -0
- package/lib/Damped-BHm2IuyN.cjs +1 -0
- package/lib/Damped-Ds17AUU-.js +57 -0
- package/lib/DerivedArray-BePrxcLC.js +63 -0
- package/lib/DerivedArray-xYBpcTp8.cjs +1 -0
- package/lib/DragControls-BgTBgiue.js +233 -0
- package/lib/DragControls-FmiuZDKq.cjs +1 -0
- package/lib/LocalLinks-BdqYzt1b.js +65 -0
- package/lib/LocalLinks-D1mYcA-B.cjs +1 -0
- package/lib/PageAnnouncerElement-CJ-MfwJ8.cjs +1 -0
- package/lib/PageAnnouncerElement-HcphPbXZ.js +28 -0
- package/lib/PageScroll-CrfCwDA4.js +65 -0
- package/lib/PageScroll-IlOCUUte.cjs +1 -0
- package/lib/SourceElement-DC726HMy.js +265 -0
- package/lib/SourceElement-DNyrQby1.cjs +5 -0
- package/lib/Store-BRTHeZmO.js +158 -0
- package/lib/Store-DZnOrofs.cjs +1 -0
- package/lib/Tweened-3UYSwrvs.cjs +1 -0
- package/lib/Tweened-DabaFaHX.js +48 -0
- package/lib/Viewport-0n1C_IoN.js +113 -0
- package/lib/Viewport-D26fEJOk.cjs +1 -0
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +97 -93
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +6 -6
- package/lib/api-fetcher/index.cjs +1 -1
- package/lib/api-fetcher/index.js +67 -66
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +37 -34
- package/lib/attributes-BADnRZpK.cjs +1 -0
- package/lib/attributes-FObgMNCf.js +36 -0
- package/lib/billboard/index.cjs +1 -1
- package/lib/billboard/index.js +240 -232
- package/lib/cache/index.cjs +1 -1
- package/lib/cache/index.js +26 -23
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +61 -59
- package/lib/canvas-BP1ceie3.cjs +1 -0
- package/lib/canvas-DsglKco1.js +40 -0
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.js +44 -41
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +6 -6
- package/lib/coordinates--JG1U6kQ.js +29 -0
- package/lib/coordinates-DQ9XV9M1.cjs +1 -0
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.d.ts +1 -1
- package/lib/css-property/index.js +40 -37
- package/lib/css-unit-parser/index.cjs +2 -2
- package/lib/css-unit-parser/index.js +22 -19
- package/lib/css-value-parser/index.cjs +1 -1
- package/lib/css-value-parser/index.js +13 -11
- package/lib/custom-elements-BfZCJde6.cjs +1 -0
- package/lib/custom-elements-HEMuF7yH.js +27 -0
- package/lib/dev/index.cjs +2 -1
- package/lib/dev/index.d.ts +1 -0
- package/lib/dev/index.js +24 -10
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +5 -5
- package/lib/dom-B40i6NXw.cjs +1 -0
- package/lib/dom-D8D-_9ty.js +108 -0
- package/lib/easings-BSGJFMAo.js +40 -0
- package/lib/easings-BWq0pPLq.cjs +1 -0
- package/lib/element-CqD0jqBJ.cjs +1 -0
- package/lib/element-DKw5H-Tu.js +10 -0
- package/lib/element-linked-store/index.cjs +1 -1
- package/lib/element-linked-store/index.js +53 -52
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.js +47 -44
- package/lib/en3/index.cjs +4 -4
- package/lib/en3/index.js +191 -185
- package/lib/events-Ds-TuvYW.js +9 -0
- package/lib/events-UlGk63iC.cjs +1 -0
- package/lib/file-DwQs6bB6.js +28 -0
- package/lib/file-RHfA3OS-.cjs +1 -0
- package/lib/function-H4b_gTg6.cjs +1 -0
- package/lib/function-UmbPrOHm.js +19 -0
- package/lib/gestures-DmKKNnh4.js +14 -0
- package/lib/gestures-DtYbQr49.cjs +1 -0
- package/lib/history/index.cjs +1 -1
- package/lib/history/index.js +24 -21
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +27 -24
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +17 -13
- package/lib/index-ClTMVKJp.js +183 -0
- package/lib/index-DZ44osDT.cjs +1 -0
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.js +3 -3
- package/lib/jsx/ComponentElement.d.ts +4 -0
- package/lib/jsx/h.d.ts +7 -16
- package/lib/jsx/hooks/component/useStylesheet.d.ts +1 -1
- package/lib/jsx/hooks/cssProperty.d.ts +6 -0
- package/lib/jsx/hooks/resize.d.ts +4 -0
- package/lib/jsx/hooks/store.d.ts +1 -2
- package/lib/jsx/hooks/ticker.d.ts +5 -0
- package/lib/jsx/index.cjs +1 -1
- package/lib/jsx/index.d.ts +4 -4
- package/lib/jsx/index.js +170 -349
- package/lib/jsx/plugins/vite/index.cjs +49 -0
- package/lib/jsx/plugins/vite/index.d.ts +38 -0
- package/lib/jsx/plugins/vite/index.js +104 -0
- package/lib/jsx/render.d.ts +2 -0
- package/lib/jsx/type.d.ts +228 -190
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +86 -84
- package/lib/layout-C26zkY7D.js +35 -0
- package/lib/layout-CnGLl7oe.cjs +1 -0
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +220 -217
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.js +48 -45
- package/lib/local-links/index.cjs +1 -1
- package/lib/local-links/index.js +2 -2
- package/lib/masonry-layout/index.cjs +1 -1
- package/lib/masonry-layout/index.js +48 -45
- package/lib/math-C-knY2TL.cjs +1 -0
- package/lib/math-r8V23YFe.js +57 -0
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +28 -25
- package/lib/metadata-BNdkmeeD.js +15 -0
- package/lib/metadata-BrHUfpV9.cjs +1 -0
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +561 -556
- package/lib/morph-BtgB1YQP.js +256 -0
- package/lib/morph-Buhxq-X0.cjs +1 -0
- package/lib/need_redo_tweaker/index.cjs +4 -4
- package/lib/need_redo_tweaker/index.js +862 -835
- package/lib/notifier/index.cjs +1 -1
- package/lib/notifier/index.js +29 -26
- package/lib/number-Bu4sGvW7.cjs +1 -0
- package/lib/number-DiVt2xnh.js +47 -0
- package/lib/object-CiIdEmJx.js +98 -0
- package/lib/object-DTY_W6xG.cjs +1 -0
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.js +3 -3
- package/lib/page-announcer/index.cjs +1 -1
- package/lib/page-announcer/index.js +2 -2
- package/lib/page-scroll/index.cjs +1 -1
- package/lib/page-scroll/index.js +2 -2
- package/lib/pixel-perfect/index.cjs +4 -4
- package/lib/pixel-perfect/index.js +43 -40
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +125 -123
- package/lib/polyfills-CG1XJNia.js +28 -0
- package/lib/polyfills-DZCuDBkA.cjs +1 -0
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +249 -245
- package/lib/radio/index.cjs +1 -1
- package/lib/radio/index.js +58 -55
- package/lib/render-H9BjFLZ3.cjs +1 -0
- package/lib/render-LpimRXgl.js +354 -0
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +196 -194
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +890 -878
- package/lib/scroll-D2tOpCnP.cjs +1 -0
- package/lib/scroll-DoNeuIgT.js +41 -0
- package/lib/scroll-entries/index.cjs +1 -1
- package/lib/scroll-entries/index.js +37 -34
- package/lib/scroll-kit/index.cjs +1 -1
- package/lib/scroll-kit/index.js +213 -209
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +102 -98
- package/lib/size-element/index.cjs +1 -1
- package/lib/size-element/index.js +29 -26
- package/lib/slicer/index.cjs +1 -1
- package/lib/slicer/index.js +118 -113
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +5 -5
- package/lib/spa/index.cjs +1 -1
- package/lib/spa/index.js +94 -94
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.d.ts +2 -2
- package/lib/store/index.js +10 -8
- package/lib/string-B3lm2b7v.js +84 -0
- package/lib/string-CbRNzmd9.cjs +1 -0
- package/lib/style-DBoQWK0d.js +14 -0
- package/lib/style-IDJ6db6n.cjs +1 -0
- package/lib/stylesheet-CBTuup4f.js +28 -0
- package/lib/stylesheet-xM7sMeuo.cjs +1 -0
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.js +4 -120
- package/lib/url-CPCO10Sy.cjs +1 -0
- package/lib/url-CWCY_qe_.js +124 -0
- package/lib/utils/attributes.d.ts +2 -0
- package/lib/utils/dom.d.ts +1 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +260 -226
- package/lib/utils/polyfills.d.ts +1 -1
- package/lib/utils/timeouts.d.ts +6 -1
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +35 -33
- package/lib/window-resizer/index.cjs +1 -1
- package/lib/window-resizer/index.js +27 -24
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +56 -54
- package/package.json +11 -24
- package/lib/Animation-BzTjZIE-.js +0 -108
- package/lib/Animation-C39Ah-LM.cjs +0 -1
- package/lib/Composed-C-TV9te3.cjs +0 -1
- package/lib/Composed-DyAWjEXE.js +0 -121
- package/lib/Damped-CRusiRIV.js +0 -56
- package/lib/Damped-Prr0iKu1.cjs +0 -1
- package/lib/DragControls-8rNZwQrs.cjs +0 -1
- package/lib/DragControls-DBNdMBA4.js +0 -228
- package/lib/LocalLinks-BxhSFv_Q.cjs +0 -1
- package/lib/LocalLinks-DFZFpbjs.js +0 -62
- package/lib/PageAnnouncerElement-0LxZjtVH.js +0 -24
- package/lib/PageAnnouncerElement-AQ0Ja6HM.cjs +0 -1
- package/lib/PageScroll-0LxFblry.js +0 -62
- package/lib/PageScroll-BXJUQwG7.cjs +0 -1
- package/lib/SourceElement-BHqPFbna.cjs +0 -5
- package/lib/SourceElement-DjbHjynf.js +0 -260
- package/lib/Store-Blf4msDz.cjs +0 -1
- package/lib/Store-ZThXYBQd.js +0 -152
- package/lib/Tweened-Bw1Cn1PJ.js +0 -47
- package/lib/Tweened-DWtk9E-O.cjs +0 -1
- package/lib/Viewport-BxCr0GlB.cjs +0 -1
- package/lib/Viewport-Dt-d9DPi.js +0 -109
- package/lib/attributes-69we3byR.js +0 -10
- package/lib/attributes-Bf2svn4j.cjs +0 -1
- package/lib/canvas-CU5Xjahf.cjs +0 -1
- package/lib/canvas-DeZ0SLUJ.js +0 -34
- package/lib/coordinates-CgdGoSYs.js +0 -24
- package/lib/coordinates-D8Np3cPD.cjs +0 -1
- package/lib/custom-elements-DBnCK7Zx.js +0 -24
- package/lib/custom-elements-Dh4TWRDJ.cjs +0 -1
- package/lib/dom-BETkVSSZ.js +0 -82
- package/lib/dom-CBLlqORw.cjs +0 -1
- package/lib/easings-BEmRlrDd.js +0 -38
- package/lib/easings-GegIwET5.cjs +0 -1
- package/lib/element-CGVl1jA-.js +0 -7
- package/lib/element-yhcBhsho.cjs +0 -1
- package/lib/events-CsVF98U6.js +0 -6
- package/lib/events-KVanG9sR.cjs +0 -1
- package/lib/file-DSpfWdd9.cjs +0 -1
- package/lib/file-GHShUlue.js +0 -24
- package/lib/function-C10DGppn.js +0 -17
- package/lib/function-MthRj-GJ.cjs +0 -1
- package/lib/gestures-C7gbKx11.cjs +0 -1
- package/lib/gestures-CcXV6fCp.js +0 -11
- package/lib/index-OE2INULi.cjs +0 -1
- package/lib/index-e9eDuagL.js +0 -65
- package/lib/jsx/hydrate.d.ts +0 -1
- package/lib/jsx/integrations/astro/client.cjs +0 -1
- package/lib/jsx/integrations/astro/client.d.ts +0 -2
- package/lib/jsx/integrations/astro/client.js +0 -50
- package/lib/jsx/integrations/astro/index.cjs +0 -1
- package/lib/jsx/integrations/astro/index.d.ts +0 -2
- package/lib/jsx/integrations/astro/index.js +0 -54
- package/lib/jsx/integrations/astro/server.cjs +0 -1
- package/lib/jsx/integrations/astro/server.d.ts +0 -3
- package/lib/jsx/integrations/astro/server.js +0 -35
- package/lib/jsx/plugins/vite.d.ts +0 -21
- package/lib/layout-BSMtwCga.js +0 -29
- package/lib/layout-Ctc2p3uz.cjs +0 -1
- package/lib/math-BOBiC4TN.js +0 -45
- package/lib/math-GDWEqu7y.cjs +0 -1
- package/lib/metadata-BcYZ5w3T.cjs +0 -1
- package/lib/metadata-jfowcCyz.js +0 -12
- package/lib/morph-B6sGhLCi.cjs +0 -1
- package/lib/morph-BQErz7qP.js +0 -242
- package/lib/number-ChAm68cm.cjs +0 -1
- package/lib/number-CumqY64S.js +0 -40
- package/lib/object-CcMK4y_r.js +0 -87
- package/lib/object-baN9pgbU.cjs +0 -1
- package/lib/polyfills-DJrTJQky.js +0 -24
- package/lib/polyfills-Df4r-ETT.cjs +0 -1
- package/lib/render-DQs7rIoN.cjs +0 -1
- package/lib/render-D_0FCWEu.js +0 -18
- package/lib/scroll-BA2WnUrb.cjs +0 -1
- package/lib/scroll-DY5senkF.js +0 -37
- package/lib/string-BlMQbe8b.js +0 -70
- package/lib/string-DUXXtU8v.cjs +0 -1
- package/lib/style-At6aDoqG.cjs +0 -1
- package/lib/style-j2TwriJ_.js +0 -10
- package/lib/stylesheet-5_o7PFzM.cjs +0 -1
- package/lib/stylesheet-DdBzowZY.js +0 -24
- package/lib/url-CHgcNwJ1.cjs +0 -1
- package/lib/url-CYgo5vrG.js +0 -113
- package/lib/vite-C-i3hVDL.js +0 -75
- package/lib/vite-DzanPumM.cjs +0 -44
package/lib/scroll/index.js
CHANGED
|
@@ -1,151 +1,152 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
throw TypeError(
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __propIsEnum = Object.prototype.propertyIsEnumerable, __reflectGet = Reflect.get;
|
|
3
|
+
var __typeError = (msg) => {
|
|
4
|
+
throw TypeError(msg);
|
|
5
5
|
};
|
|
6
|
-
var
|
|
7
|
-
for (var
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
for (var
|
|
11
|
-
|
|
12
|
-
return
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
__hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
9
|
+
if (__getOwnPropSymbols)
|
|
10
|
+
for (var prop of __getOwnPropSymbols(b))
|
|
11
|
+
__propIsEnum.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
12
|
+
return a;
|
|
13
13
|
};
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
|
|
14
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
15
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
16
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value), __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
17
|
+
var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
|
|
18
|
+
var __async = (__this, __arguments, generator) => new Promise((resolve, reject) => {
|
|
19
|
+
var fulfilled = (value) => {
|
|
19
20
|
try {
|
|
20
|
-
|
|
21
|
-
} catch (
|
|
22
|
-
|
|
21
|
+
step2(generator.next(value));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(e);
|
|
23
24
|
}
|
|
24
|
-
},
|
|
25
|
+
}, rejected = (value) => {
|
|
25
26
|
try {
|
|
26
|
-
|
|
27
|
-
} catch (
|
|
28
|
-
|
|
27
|
+
step2(generator.throw(value));
|
|
28
|
+
} catch (e) {
|
|
29
|
+
reject(e);
|
|
29
30
|
}
|
|
30
|
-
},
|
|
31
|
-
|
|
31
|
+
}, step2 = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
32
|
+
step2((generator = generator.apply(__this, __arguments)).next());
|
|
32
33
|
});
|
|
33
|
-
import { S as
|
|
34
|
-
import { i as
|
|
35
|
-
import { q as
|
|
36
|
-
import { i as
|
|
37
|
-
import { d as
|
|
38
|
-
import { d as
|
|
39
|
-
import { a as
|
|
40
|
-
import { c as
|
|
41
|
-
import { p as
|
|
42
|
-
import { c as
|
|
43
|
-
import "../
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import { d as wi } from "../Viewport-Dt-d9DPi.js";
|
|
34
|
+
import { S as Store } from "../Store-BRTHeZmO.js";
|
|
35
|
+
import { i as isBrowser } from "../index-ClTMVKJp.js";
|
|
36
|
+
import { q as easeInOutExpo } from "../easings-BSGJFMAo.js";
|
|
37
|
+
import { i as isElementVisible } from "../element-DKw5H-Tu.js";
|
|
38
|
+
import { d as dispatchEvent } from "../events-Ds-TuvYW.js";
|
|
39
|
+
import { d as debounce } from "../function-UmbPrOHm.js";
|
|
40
|
+
import { a as getCumulativeOffsetTop, g as getCumulativeOffsetLeft, b as getStickyOffset } from "../layout-C26zkY7D.js";
|
|
41
|
+
import { c as clamp, s as step } from "../math-r8V23YFe.js";
|
|
42
|
+
import { p as preciseNumber, l as loopNumber } from "../number-DiVt2xnh.js";
|
|
43
|
+
import { c as createStylesheet } from "../stylesheet-CBTuup4f.js";
|
|
44
|
+
import { TICK_ORDER, RESIZE_ORDER } from "../order/index.js";
|
|
45
|
+
import { D as Damped } from "../Damped-Ds17AUU-.js";
|
|
46
|
+
import { T as Tweened } from "../Tweened-DabaFaHX.js";
|
|
47
|
+
import { W as WheelControls, K as KeyboardControls, D as DragControls, A as AutoplayControls } from "../DragControls-BgTBgiue.js";
|
|
48
|
+
import { windowResizer } from "../window-resizer/index.js";
|
|
49
|
+
import { scrollEntries } from "../scroll-entries/index.js";
|
|
50
|
+
import { cssUnitParser } from "../css-unit-parser/index.js";
|
|
51
|
+
import { CSSProperty } from "../css-property/index.js";
|
|
52
|
+
import { d as device } from "../Viewport-0n1C_IoN.js";
|
|
53
53
|
import "construct-style-sheets-polyfill";
|
|
54
|
-
import { elementResizer
|
|
55
|
-
import { s as
|
|
56
|
-
import { b as
|
|
57
|
-
var
|
|
58
|
-
class
|
|
59
|
-
constructor(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
54
|
+
import { elementResizer } from "../element-resizer/index.js";
|
|
55
|
+
import { s as setupDrag } from "../gestures-DmKKNnh4.js";
|
|
56
|
+
import { b as findParentElement } from "../dom-D8D-_9ty.js";
|
|
57
|
+
var _element, _index, _scrollElement, _width, _height, _size, _position, _currentMark, _transformPosition, _ScrollSection_instances, setVar_fn;
|
|
58
|
+
const _ScrollSection = class _ScrollSection {
|
|
59
|
+
constructor(element, index, scrollElement) {
|
|
60
|
+
__privateAdd(this, _ScrollSection_instances);
|
|
61
|
+
__privateAdd(this, _element);
|
|
62
|
+
__privateAdd(this, _index);
|
|
63
|
+
__privateAdd(this, _scrollElement);
|
|
64
|
+
__privateAdd(this, _width, 0);
|
|
65
|
+
__privateAdd(this, _height, 0);
|
|
66
|
+
__privateAdd(this, _size, 0);
|
|
67
|
+
__privateAdd(this, _position, 0);
|
|
68
|
+
__privateAdd(this, _currentMark, null);
|
|
69
|
+
__privateAdd(this, _transformPosition, 0);
|
|
70
|
+
__privateSet(this, _element, element), __privateSet(this, _index, index), __privateSet(this, _scrollElement, scrollElement), scrollEntries.register(__privateGet(this, _element)), this.setIndex(__privateGet(this, _index));
|
|
71
71
|
}
|
|
72
72
|
get element() {
|
|
73
|
-
return
|
|
73
|
+
return __privateGet(this, _element);
|
|
74
74
|
}
|
|
75
75
|
get index() {
|
|
76
|
-
return
|
|
76
|
+
return __privateGet(this, _index);
|
|
77
77
|
}
|
|
78
78
|
get size() {
|
|
79
|
-
return
|
|
79
|
+
return __privateGet(this, _size);
|
|
80
80
|
}
|
|
81
81
|
get width() {
|
|
82
|
-
return
|
|
82
|
+
return __privateGet(this, _width);
|
|
83
83
|
}
|
|
84
84
|
get height() {
|
|
85
|
-
return
|
|
85
|
+
return __privateGet(this, _height);
|
|
86
86
|
}
|
|
87
87
|
get position() {
|
|
88
|
-
return
|
|
88
|
+
return __privateGet(this, _position);
|
|
89
89
|
}
|
|
90
90
|
get transformPosition() {
|
|
91
|
-
return
|
|
91
|
+
return __privateGet(this, _transformPosition);
|
|
92
92
|
}
|
|
93
93
|
destroy() {
|
|
94
|
-
|
|
94
|
+
scrollEntries.unregister(__privateGet(this, _element)), this.unsetTransform();
|
|
95
95
|
}
|
|
96
96
|
unsetTransform() {
|
|
97
|
-
|
|
97
|
+
__privateGet(this, _element).style.transform = "", this.setMark(null), this.setIndex(null), this.setCurrentIndex(null), this.setCurrentIndexArc(null), this.setCurrentIndexArcAbs(null), this.setOffsetIndex(null), this.setMiddle(!1), this.setSize();
|
|
98
98
|
}
|
|
99
|
-
setSize(
|
|
100
|
-
|
|
99
|
+
setSize(value) {
|
|
100
|
+
value ? (__privateGet(this, _element).style.setProperty("--size", value + "px"), __privateGet(this, _scrollElement).axisCSSProperty.current === "x" ? (__privateGet(this, _element).style.width = value + "px", __privateGet(this, _element).style.height = "") : (__privateGet(this, _element).style.height = value + "px", __privateGet(this, _element).style.width = "")) : (__privateGet(this, _element).style.width = "", __privateGet(this, _element).style.height = "", __privateGet(this, _element).style.removeProperty("--size"));
|
|
101
101
|
}
|
|
102
102
|
resize() {
|
|
103
|
-
|
|
103
|
+
__privateSet(this, _width, __privateGet(this, _element).offsetWidth), __privateSet(this, _height, __privateGet(this, _element).offsetHeight), __privateSet(this, _size, __privateGet(this, _scrollElement).vertical ? __privateGet(this, _element).offsetHeight : __privateGet(this, _element).offsetWidth), __privateSet(this, _position, __privateGet(this, _scrollElement).vertical ? getCumulativeOffsetTop(__privateGet(this, _element)) : getCumulativeOffsetLeft(__privateGet(this, _element))), __privateSet(this, _position, __privateGet(this, _position) - __privateGet(this, _scrollElement).contentPosition);
|
|
104
104
|
}
|
|
105
105
|
transform() {
|
|
106
|
-
const
|
|
107
|
-
let
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
106
|
+
const cssOffset = __privateGet(this, _scrollElement).shiftSectionPositionCSSProperty.current;
|
|
107
|
+
let offset = cssOffset;
|
|
108
|
+
const distanceAddition = __privateGet(this, _scrollElement).viewportSize * __privateGet(this, _scrollElement).sectionDistanceScaleCSSProperty.current;
|
|
109
|
+
__privateGet(this, _scrollElement).loopCSSProperty.current && __privateGet(this, _position) + __privateGet(this, _size) <= __privateGet(this, _scrollElement).currentScrollValue - cssOffset / 2 && (offset = (__privateGet(this, _scrollElement).distance - cssOffset) * -1 - __privateGet(this, _scrollElement).gap), scrollEntries.update(
|
|
110
|
+
__privateGet(this, _element),
|
|
111
|
+
__privateGet(this, _scrollElement).axisCSSProperty.current,
|
|
112
|
+
offset
|
|
113
113
|
);
|
|
114
|
-
const
|
|
115
|
-
|
|
114
|
+
const valueToClamp = __privateGet(this, _scrollElement).currentScrollValue + offset, min = __privateGet(this, _position) - __privateGet(this, _scrollElement).viewportSize - distanceAddition, max = __privateGet(this, _position) + __privateGet(this, _size) + distanceAddition, value = preciseNumber(clamp(valueToClamp, min, max), 3);
|
|
115
|
+
__privateSet(this, _transformPosition, value * -1), __privateGet(this, _scrollElement).vertical ? __privateGet(this, _element).style.transform = `translate3d(0px, ${__privateGet(this, _transformPosition)}px, 0px)` : __privateGet(this, _element).style.transform = `translate3d(${__privateGet(this, _transformPosition)}px, 0px, 0px)`;
|
|
116
116
|
}
|
|
117
|
-
setMark(
|
|
118
|
-
|
|
117
|
+
setMark(mark) {
|
|
118
|
+
__privateGet(this, _currentMark) !== mark && (__privateGet(this, _currentMark) && __privateGet(this, _element).classList.remove(__privateGet(this, _currentMark)), mark && __privateGet(this, _element).classList.add(mark), __privateSet(this, _currentMark, mark), dispatchEvent(__privateGet(this, _element), "scrollSectionMarkChange", {
|
|
119
119
|
composed: !0,
|
|
120
120
|
detail: {
|
|
121
|
-
mark:
|
|
121
|
+
mark: __privateGet(this, _currentMark)
|
|
122
122
|
},
|
|
123
123
|
custom: !0
|
|
124
124
|
}));
|
|
125
125
|
}
|
|
126
|
-
setMiddle(
|
|
127
|
-
|
|
126
|
+
setMiddle(bool) {
|
|
127
|
+
__privateGet(this, _element).classList.toggle("middle", bool);
|
|
128
128
|
}
|
|
129
|
-
setIndex(
|
|
130
|
-
|
|
129
|
+
setIndex(value) {
|
|
130
|
+
__privateMethod(this, _ScrollSection_instances, setVar_fn).call(this, "index", value);
|
|
131
131
|
}
|
|
132
|
-
setCurrentIndex(
|
|
133
|
-
|
|
132
|
+
setCurrentIndex(value) {
|
|
133
|
+
__privateMethod(this, _ScrollSection_instances, setVar_fn).call(this, "current-index", value);
|
|
134
134
|
}
|
|
135
|
-
setCurrentIndexArc(
|
|
136
|
-
|
|
135
|
+
setCurrentIndexArc(value) {
|
|
136
|
+
__privateMethod(this, _ScrollSection_instances, setVar_fn).call(this, "current-index-arc", value);
|
|
137
137
|
}
|
|
138
|
-
setOffsetIndex(
|
|
139
|
-
|
|
138
|
+
setOffsetIndex(value) {
|
|
139
|
+
__privateMethod(this, _ScrollSection_instances, setVar_fn).call(this, "offset-index", value);
|
|
140
140
|
}
|
|
141
|
-
setCurrentIndexArcAbs(
|
|
142
|
-
|
|
141
|
+
setCurrentIndexArcAbs(value) {
|
|
142
|
+
__privateMethod(this, _ScrollSection_instances, setVar_fn).call(this, "current-index-arc-abs", value);
|
|
143
143
|
}
|
|
144
|
-
}
|
|
145
|
-
p = new WeakMap(), Re = new WeakMap(), E = new WeakMap(), us = new WeakMap(), as = new WeakMap(), pe = new WeakMap(), bt = new WeakMap(), $t = new WeakMap(), be = new WeakMap(), Bt = new WeakSet(), Fe = function(n, e) {
|
|
146
|
-
e !== null ? (t(this, p).style.setProperty(`--${n}`, e.toString()), t(this, p).setAttribute(`data-${n}`, e.toString())) : (t(this, p).style.removeProperty(`--${n}`), t(this, p).removeAttribute(`data-${n}`));
|
|
147
144
|
};
|
|
148
|
-
|
|
145
|
+
_element = new WeakMap(), _index = new WeakMap(), _scrollElement = new WeakMap(), _width = new WeakMap(), _height = new WeakMap(), _size = new WeakMap(), _position = new WeakMap(), _currentMark = new WeakMap(), _transformPosition = new WeakMap(), _ScrollSection_instances = new WeakSet(), setVar_fn = /* @__PURE__ */ __name(function(name, value) {
|
|
146
|
+
value !== null ? (__privateGet(this, _element).style.setProperty(`--${name}`, value.toString()), __privateGet(this, _element).setAttribute(`data-${name}`, value.toString())) : (__privateGet(this, _element).style.removeProperty(`--${name}`), __privateGet(this, _element).removeAttribute(`data-${name}`));
|
|
147
|
+
}, "#setVar"), __name(_ScrollSection, "ScrollSection");
|
|
148
|
+
let ScrollSection = _ScrollSection;
|
|
149
|
+
const stylesheet = createStylesheet({
|
|
149
150
|
":host": {
|
|
150
151
|
position: "relative",
|
|
151
152
|
width: "100%",
|
|
@@ -184,358 +185,358 @@ const Vi = Js({
|
|
|
184
185
|
flexShrink: "0"
|
|
185
186
|
}
|
|
186
187
|
});
|
|
187
|
-
var
|
|
188
|
-
class
|
|
188
|
+
var _damped, _controlsCSSProperty, _axisCSSProperty, _reverseCSSProperty, _directionCSSProperty, _pagesCSSProperty, _splitCSSProperty, _sectionalCSSProperty, _easingCSSProperty, _durationCSSProperty, _autoSizeCSSProperty, _wheelMaxDeltaCSSProperty, _dragInertionCSSProperty, _sectionsInViewCSSProperty, _loopCSSProperty, _dampingCSSProperty, _massCSSProperty, _stiffnessCSSProperty, _mouseDragCSSProperty, _sectionDistanceScaleCSSProperty, _startSectionCSSProperty, _autoplayCSSProperty, _autoplayPauseDurationCSSProperty, _autoplayUserDirectionCSSProperty, _classesCSSProperty, _currentIndexStartOffsetCSSProperty, _currentIndexEndOffsetCSSProperty, _shiftSectionPositionCSSProperty, _focusDelayCSSProperty, _focusDurationCSSProperty, _shiftLimitCSSProperty, _disabledCSSProperty, _hibernatedCSSProperty, _contentWrapperElement, _contentElement, _slotElement, _sections, _visibleSections, _position2, _contentPosition, _viewportSize, _scrollSize, _gap, _wheelControls, _keyboardControls, _dragControls, _autoplayControls, _counter, _overscroll, _distance, _hasOverflow, _disabled, _hibernated, _focusTimeoutId, _tweenTimeoutId, _setTween, _isGrabbing, _scrollLine, _isConnected, _mutationObserver, _currentSections, _skipNextResize, _maxSectionSizeTimeoutId, _ScrollElement_instances, updateAxis_fn, split_fn, unsplit_fn, disable_fn, enable_fn, hibernate_fn, awake_fn, _resizeListener, _animatedChangeListener, clampCounter_fn, _notAutoplayControlListener, _controlsListener, processAutoplay_fn, getScrollValue_fn, updateMarks_fn, updateIndexes_fn, _updateMaxSectionsSize, getNearestSectionIndex_fn, _connectListener;
|
|
189
|
+
const _ScrollElement = class _ScrollElement extends HTMLElement {
|
|
189
190
|
constructor() {
|
|
190
191
|
super();
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
validate: (
|
|
192
|
+
__privateAdd(this, _ScrollElement_instances);
|
|
193
|
+
__privateAdd(this, _damped, null);
|
|
194
|
+
__privateAdd(this, _controlsCSSProperty, new CSSProperty(this, "--controls", !0));
|
|
195
|
+
__privateAdd(this, _axisCSSProperty, new CSSProperty(this, "--axis", "y"));
|
|
196
|
+
__privateAdd(this, _reverseCSSProperty, new CSSProperty(this, "--reverse", !1));
|
|
197
|
+
__privateAdd(this, _directionCSSProperty, new CSSProperty(this, "--direction", 0));
|
|
198
|
+
__privateAdd(this, _pagesCSSProperty, new CSSProperty(this, "--pages", 0, {
|
|
199
|
+
validate: /* @__PURE__ */ __name((v) => Math.max(0, v - 1), "validate")
|
|
199
200
|
}));
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
__privateAdd(this, _splitCSSProperty, new CSSProperty(this, "--split", !1));
|
|
202
|
+
__privateAdd(this, _sectionalCSSProperty, new CSSProperty(this, "--sectional", !1));
|
|
203
|
+
__privateAdd(this, _easingCSSProperty, new CSSProperty(
|
|
203
204
|
this,
|
|
204
205
|
"--tween-easing",
|
|
205
206
|
!1
|
|
206
207
|
));
|
|
207
|
-
|
|
208
|
+
__privateAdd(this, _durationCSSProperty, new CSSProperty(
|
|
208
209
|
this,
|
|
209
210
|
"--tween-duration",
|
|
210
211
|
!1
|
|
211
212
|
));
|
|
212
|
-
|
|
213
|
-
|
|
213
|
+
__privateAdd(this, _autoSizeCSSProperty, new CSSProperty(this, "--auto-size", !1));
|
|
214
|
+
__privateAdd(this, _wheelMaxDeltaCSSProperty, new CSSProperty(
|
|
214
215
|
this,
|
|
215
216
|
"--wheel-max-delta",
|
|
216
217
|
!1
|
|
217
218
|
));
|
|
218
|
-
|
|
219
|
-
|
|
219
|
+
__privateAdd(this, _dragInertionCSSProperty, new CSSProperty(this, "--drag-inertion", 1));
|
|
220
|
+
__privateAdd(this, _sectionsInViewCSSProperty, new CSSProperty(
|
|
220
221
|
this,
|
|
221
222
|
"--sections-in-view",
|
|
222
223
|
1
|
|
223
224
|
));
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
225
|
+
__privateAdd(this, _loopCSSProperty, new CSSProperty(this, "--loop", !1));
|
|
226
|
+
__privateAdd(this, _dampingCSSProperty, new CSSProperty(this, "--damping", 20));
|
|
227
|
+
__privateAdd(this, _massCSSProperty, new CSSProperty(this, "--mass", 0));
|
|
228
|
+
__privateAdd(this, _stiffnessCSSProperty, new CSSProperty(this, "--stiffness", 0));
|
|
229
|
+
__privateAdd(this, _mouseDragCSSProperty, new CSSProperty(this, "--mouse-drag", !1));
|
|
230
|
+
__privateAdd(this, _sectionDistanceScaleCSSProperty, new CSSProperty(
|
|
230
231
|
this,
|
|
231
232
|
"--section-distance-scale",
|
|
232
233
|
0.5
|
|
233
234
|
));
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
235
|
+
__privateAdd(this, _startSectionCSSProperty, new CSSProperty(this, "--start-section", 0));
|
|
236
|
+
__privateAdd(this, _autoplayCSSProperty, new CSSProperty(this, "--autoplay", 0));
|
|
237
|
+
__privateAdd(this, _autoplayPauseDurationCSSProperty, new CSSProperty(
|
|
237
238
|
this,
|
|
238
239
|
"--autoplay-pause-duration",
|
|
239
240
|
0
|
|
240
241
|
));
|
|
241
|
-
|
|
242
|
+
__privateAdd(this, _autoplayUserDirectionCSSProperty, new CSSProperty(
|
|
242
243
|
this,
|
|
243
244
|
"--autoplay-user-direction",
|
|
244
245
|
!1
|
|
245
246
|
));
|
|
246
|
-
|
|
247
|
-
|
|
247
|
+
__privateAdd(this, _classesCSSProperty, new CSSProperty(this, "--classes", !1));
|
|
248
|
+
__privateAdd(this, _currentIndexStartOffsetCSSProperty, new CSSProperty(
|
|
248
249
|
this,
|
|
249
250
|
"--current-index-start-offset",
|
|
250
251
|
0
|
|
251
252
|
));
|
|
252
|
-
|
|
253
|
+
__privateAdd(this, _currentIndexEndOffsetCSSProperty, new CSSProperty(
|
|
253
254
|
this,
|
|
254
255
|
"--current-index-end-offset",
|
|
255
256
|
0
|
|
256
257
|
));
|
|
257
|
-
|
|
258
|
+
__privateAdd(this, _shiftSectionPositionCSSProperty, new CSSProperty(
|
|
258
259
|
this,
|
|
259
260
|
"--shift-section-position",
|
|
260
261
|
0,
|
|
261
262
|
{ rawValueCheck: !1 }
|
|
262
263
|
));
|
|
263
|
-
|
|
264
|
-
|
|
264
|
+
__privateAdd(this, _focusDelayCSSProperty, new CSSProperty(this, "--focus-delay", 0));
|
|
265
|
+
__privateAdd(this, _focusDurationCSSProperty, new CSSProperty(
|
|
265
266
|
this,
|
|
266
267
|
"--focus-duration",
|
|
267
268
|
3e3
|
|
268
269
|
));
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
if (e &&
|
|
304
|
-
|
|
270
|
+
__privateAdd(this, _shiftLimitCSSProperty, new CSSProperty(this, "--shift-limit", 0));
|
|
271
|
+
__privateAdd(this, _disabledCSSProperty, new CSSProperty(this, "--disabled", !1));
|
|
272
|
+
__privateAdd(this, _hibernatedCSSProperty, new CSSProperty(this, "--hibernate", !1));
|
|
273
|
+
__privateAdd(this, _contentWrapperElement, null);
|
|
274
|
+
__privateAdd(this, _contentElement, null);
|
|
275
|
+
__privateAdd(this, _slotElement, null);
|
|
276
|
+
__privateAdd(this, _sections, []);
|
|
277
|
+
__privateAdd(this, _visibleSections, []);
|
|
278
|
+
__privateAdd(this, _position2, 0);
|
|
279
|
+
__privateAdd(this, _contentPosition, 0);
|
|
280
|
+
__privateAdd(this, _viewportSize, 0);
|
|
281
|
+
__privateAdd(this, _scrollSize, 0);
|
|
282
|
+
__privateAdd(this, _gap, 0);
|
|
283
|
+
__privateAdd(this, _wheelControls, null);
|
|
284
|
+
__privateAdd(this, _keyboardControls, null);
|
|
285
|
+
__privateAdd(this, _dragControls, null);
|
|
286
|
+
__privateAdd(this, _autoplayControls, null);
|
|
287
|
+
__privateAdd(this, _counter, new Store(0));
|
|
288
|
+
__privateAdd(this, _overscroll, 0);
|
|
289
|
+
__privateAdd(this, _distance, 0);
|
|
290
|
+
__privateAdd(this, _hasOverflow, !1);
|
|
291
|
+
__privateAdd(this, _disabled, !0);
|
|
292
|
+
__privateAdd(this, _hibernated, !0);
|
|
293
|
+
__privateAdd(this, _focusTimeoutId);
|
|
294
|
+
__privateAdd(this, _tweenTimeoutId);
|
|
295
|
+
__privateAdd(this, _setTween, new Tweened());
|
|
296
|
+
__privateAdd(this, _isGrabbing, !1);
|
|
297
|
+
__privateAdd(this, _scrollLine, null);
|
|
298
|
+
__privateAdd(this, _isConnected, !1);
|
|
299
|
+
__privateAdd(this, _mutationObserver, null);
|
|
300
|
+
__privateAdd(this, _currentSections, []);
|
|
301
|
+
__privateAdd(this, _skipNextResize, !1);
|
|
302
|
+
__privateAdd(this, _maxSectionSizeTimeoutId);
|
|
303
|
+
__privateAdd(this, _resizeListener, /* @__PURE__ */ __name((e) => {
|
|
304
|
+
if (e && __privateGet(this, _skipNextResize)) {
|
|
305
|
+
__privateSet(this, _skipNextResize, !1);
|
|
305
306
|
return;
|
|
306
307
|
}
|
|
307
308
|
this.resize();
|
|
308
|
-
});
|
|
309
|
-
|
|
310
|
-
if (!
|
|
309
|
+
}, "#resizeListener"));
|
|
310
|
+
__privateAdd(this, _animatedChangeListener, /* @__PURE__ */ __name(() => {
|
|
311
|
+
if (!__privateGet(this, _hasOverflow) || __privateGet(this, _hibernated) || __privateGet(this, _disabled))
|
|
311
312
|
return;
|
|
312
|
-
const
|
|
313
|
-
if (
|
|
314
|
-
for (let
|
|
315
|
-
|
|
316
|
-
(
|
|
313
|
+
const currentScrollValue = this.currentScrollValue;
|
|
314
|
+
if (__privateSet(this, _overscroll, Math.max(0, currentScrollValue - __privateGet(this, _scrollSize))), __privateGet(this, _visibleSections).length) {
|
|
315
|
+
for (let i = 0; i < __privateGet(this, _sections).length; i++)
|
|
316
|
+
__privateGet(this, _sections)[i].transform();
|
|
317
|
+
(__privateGet(this, _isGrabbing) || !__privateGet(this, _sectionalCSSProperty).current) && (__privateGet(this, _counter).current = __privateMethod(this, _ScrollElement_instances, getNearestSectionIndex_fn).call(this));
|
|
317
318
|
} else
|
|
318
|
-
this.vertical ?
|
|
319
|
-
|
|
319
|
+
this.vertical ? __privateGet(this, _contentElement).style.transform = `translate3d(0px, ${currentScrollValue * -1}px, 0px)` : __privateGet(this, _contentElement).style.transform = `translate3d(${currentScrollValue * -1}px, 0px, 0px)`;
|
|
320
|
+
__privateMethod(this, _ScrollElement_instances, updateIndexes_fn).call(this), scrollEntries.update(
|
|
320
321
|
this,
|
|
321
|
-
|
|
322
|
-
|
|
322
|
+
__privateGet(this, _axisCSSProperty).current,
|
|
323
|
+
currentScrollValue
|
|
323
324
|
);
|
|
324
|
-
});
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
});
|
|
328
|
-
|
|
329
|
-
if (!
|
|
330
|
-
if (
|
|
331
|
-
if (
|
|
325
|
+
}, "#animatedChangeListener"));
|
|
326
|
+
__privateAdd(this, _notAutoplayControlListener, /* @__PURE__ */ __name((type, value) => {
|
|
327
|
+
__privateGet(this, _controlsCSSProperty).current && (__privateMethod(this, _ScrollElement_instances, processAutoplay_fn).call(this, Math.sign(value) || 1), __privateGet(this, _controlsListener).call(this, type, value));
|
|
328
|
+
}, "#notAutoplayControlListener"));
|
|
329
|
+
__privateAdd(this, _controlsListener, /* @__PURE__ */ __name((type, value) => {
|
|
330
|
+
if (!__privateGet(this, _tweenTimeoutId)) {
|
|
331
|
+
if (__privateGet(this, _directionCSSProperty).current) {
|
|
332
|
+
if (__privateGet(this, _directionCSSProperty).current < 0 && value > 0)
|
|
332
333
|
return;
|
|
333
|
-
if (
|
|
334
|
+
if (__privateGet(this, _directionCSSProperty).current > 0 && value < 0)
|
|
334
335
|
return;
|
|
335
336
|
}
|
|
336
|
-
if (!
|
|
337
|
-
const
|
|
338
|
-
|
|
337
|
+
if (!__privateGet(this, _autoplayCSSProperty).current && __privateGet(this, _focusDelayCSSProperty).current && (clearInterval(__privateGet(this, _focusTimeoutId)), __privateSet(this, _focusTimeoutId, setTimeout(() => {
|
|
338
|
+
const section = __privateGet(this, _visibleSections)[__privateMethod(this, _ScrollElement_instances, getNearestSectionIndex_fn).call(this)];
|
|
339
|
+
section && this.scrollToSection(section.index, {
|
|
339
340
|
tween: {
|
|
340
|
-
duration:
|
|
341
|
-
easing:
|
|
341
|
+
duration: __privateGet(this, _focusDurationCSSProperty).current,
|
|
342
|
+
easing: easeInOutExpo
|
|
342
343
|
}
|
|
343
344
|
});
|
|
344
|
-
},
|
|
345
|
-
if (
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
tween:
|
|
349
|
-
easing:
|
|
350
|
-
duration:
|
|
345
|
+
}, __privateGet(this, _focusDelayCSSProperty).current))), !(type.includes("drag") && !device.isTouch && !__privateGet(this, _mouseDragCSSProperty).current)) {
|
|
346
|
+
if (__privateGet(this, _sectionalCSSProperty).current && type !== "drag") {
|
|
347
|
+
const direction = Math.sign(value);
|
|
348
|
+
__privateGet(this, _visibleSections).length ? __privateGet(this, _isGrabbing) ? this.scrollToSection(__privateMethod(this, _ScrollElement_instances, getNearestSectionIndex_fn).call(this, !0)) : this.shiftSections(direction, {
|
|
349
|
+
tween: __privateGet(this, _easingCSSProperty).current || __privateGet(this, _durationCSSProperty).current ? {
|
|
350
|
+
easing: __privateGet(this, _easingCSSProperty).current || "easeInOutCubic",
|
|
351
|
+
duration: __privateGet(this, _durationCSSProperty).current || 500
|
|
351
352
|
} : void 0
|
|
352
|
-
}) :
|
|
353
|
+
}) : __privateGet(this, _damped).shift(direction * __privateGet(this, _viewportSize));
|
|
353
354
|
} else
|
|
354
|
-
|
|
355
|
-
|
|
355
|
+
__privateGet(this, _damped).shift(value);
|
|
356
|
+
__privateSet(this, _isGrabbing, type === "drag");
|
|
356
357
|
}
|
|
357
358
|
}
|
|
358
|
-
});
|
|
359
|
-
|
|
360
|
-
const
|
|
361
|
-
const
|
|
362
|
-
return
|
|
359
|
+
}, "#controlsListener"));
|
|
360
|
+
__privateAdd(this, _updateMaxSectionsSize, debounce(() => {
|
|
361
|
+
const maxSectionSize = __privateGet(this, _currentSections).reduce((p, c) => {
|
|
362
|
+
const s = this.vertical ? c.width : c.height;
|
|
363
|
+
return s > p ? s : p;
|
|
363
364
|
}, 0);
|
|
364
|
-
clearTimeout(
|
|
365
|
-
|
|
365
|
+
clearTimeout(__privateGet(this, _maxSectionSizeTimeoutId)), __privateSet(this, _skipNextResize, !0), this.style.setProperty("--max-section-size", ""), __privateSet(this, _maxSectionSizeTimeoutId, setTimeout(() => {
|
|
366
|
+
__privateSet(this, _skipNextResize, !0), this.style.setProperty("--max-section-size", maxSectionSize + "px");
|
|
366
367
|
}, 10));
|
|
367
368
|
}, 20));
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
});
|
|
371
|
-
if (
|
|
372
|
-
const
|
|
373
|
-
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
|
|
369
|
+
__privateAdd(this, _connectListener, /* @__PURE__ */ __name(() => {
|
|
370
|
+
__privateSet(this, _isConnected, !0), this.hibernatedCSSProperty.current || __privateMethod(this, _ScrollElement_instances, awake_fn).call(this), elementResizer.subscribe(this, __privateGet(this, _resizeListener)), windowResizer.unsubscribe(__privateGet(this, _connectListener));
|
|
371
|
+
}, "#connectListener"));
|
|
372
|
+
if (isBrowser) {
|
|
373
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
374
|
+
shadow.adoptedStyleSheets = [stylesheet];
|
|
375
|
+
const staticElement = document.createElement("div");
|
|
376
|
+
staticElement.className = "static", staticElement.innerHTML = '<slot name="static"></slot>', shadow.appendChild(staticElement), __privateSet(this, _contentWrapperElement, document.createElement("div")), __privateGet(this, _contentWrapperElement).className = "content-wrapper", __privateSet(this, _contentElement, document.createElement("div")), __privateGet(this, _contentElement).className = "content", __privateSet(this, _slotElement, document.createElement("slot")), __privateGet(this, _contentElement).appendChild(__privateGet(this, _slotElement)), __privateGet(this, _contentWrapperElement).appendChild(__privateGet(this, _contentElement)), shadow.appendChild(__privateGet(this, _contentWrapperElement)), __privateSet(this, _mutationObserver, new MutationObserver(
|
|
377
|
+
debounce(() => {
|
|
377
378
|
this.tryResplit();
|
|
378
379
|
}, 10)
|
|
379
380
|
));
|
|
380
381
|
}
|
|
381
382
|
}
|
|
382
383
|
get damped() {
|
|
383
|
-
return
|
|
384
|
+
return __privateGet(this, _damped);
|
|
384
385
|
}
|
|
385
386
|
get controlsCSSProperty() {
|
|
386
|
-
return
|
|
387
|
+
return __privateGet(this, _controlsCSSProperty);
|
|
387
388
|
}
|
|
388
389
|
get axisCSSProperty() {
|
|
389
|
-
return
|
|
390
|
+
return __privateGet(this, _axisCSSProperty);
|
|
390
391
|
}
|
|
391
392
|
get reverseCSSProperty() {
|
|
392
|
-
return
|
|
393
|
+
return __privateGet(this, _reverseCSSProperty);
|
|
393
394
|
}
|
|
394
395
|
get directionCSSProperty() {
|
|
395
|
-
return
|
|
396
|
+
return __privateGet(this, _directionCSSProperty);
|
|
396
397
|
}
|
|
397
398
|
get pagesCSSProperty() {
|
|
398
|
-
return
|
|
399
|
+
return __privateGet(this, _pagesCSSProperty);
|
|
399
400
|
}
|
|
400
401
|
get splitCSSProperty() {
|
|
401
|
-
return
|
|
402
|
+
return __privateGet(this, _splitCSSProperty);
|
|
402
403
|
}
|
|
403
404
|
get sectionalCSSProperty() {
|
|
404
|
-
return
|
|
405
|
+
return __privateGet(this, _sectionalCSSProperty);
|
|
405
406
|
}
|
|
406
407
|
get easingCSSProperty() {
|
|
407
|
-
return
|
|
408
|
+
return __privateGet(this, _easingCSSProperty);
|
|
408
409
|
}
|
|
409
410
|
get durationCSSProperty() {
|
|
410
|
-
return
|
|
411
|
+
return __privateGet(this, _durationCSSProperty);
|
|
411
412
|
}
|
|
412
413
|
get autoSizeCSSProperty() {
|
|
413
|
-
return
|
|
414
|
+
return __privateGet(this, _autoSizeCSSProperty);
|
|
414
415
|
}
|
|
415
416
|
get wheelMaxDeltaCSSProperty() {
|
|
416
|
-
return
|
|
417
|
+
return __privateGet(this, _wheelMaxDeltaCSSProperty);
|
|
417
418
|
}
|
|
418
419
|
get dragInertionCSSProperty() {
|
|
419
|
-
return
|
|
420
|
+
return __privateGet(this, _dragInertionCSSProperty);
|
|
420
421
|
}
|
|
421
422
|
get sectionsInViewCSSProperty() {
|
|
422
|
-
return
|
|
423
|
+
return __privateGet(this, _sectionsInViewCSSProperty);
|
|
423
424
|
}
|
|
424
425
|
get loopCSSProperty() {
|
|
425
|
-
return
|
|
426
|
+
return __privateGet(this, _loopCSSProperty);
|
|
426
427
|
}
|
|
427
428
|
get dampingCSSProperty() {
|
|
428
|
-
return
|
|
429
|
+
return __privateGet(this, _dampingCSSProperty);
|
|
429
430
|
}
|
|
430
431
|
get massCSSProperty() {
|
|
431
|
-
return
|
|
432
|
+
return __privateGet(this, _massCSSProperty);
|
|
432
433
|
}
|
|
433
434
|
get stiffnessCSSProperty() {
|
|
434
|
-
return
|
|
435
|
+
return __privateGet(this, _stiffnessCSSProperty);
|
|
435
436
|
}
|
|
436
437
|
get mouseDragCSSProperty() {
|
|
437
|
-
return
|
|
438
|
+
return __privateGet(this, _mouseDragCSSProperty);
|
|
438
439
|
}
|
|
439
440
|
get sectionDistanceScaleCSSProperty() {
|
|
440
|
-
return
|
|
441
|
+
return __privateGet(this, _sectionDistanceScaleCSSProperty);
|
|
441
442
|
}
|
|
442
443
|
get startSectionCSSProperty() {
|
|
443
|
-
return
|
|
444
|
+
return __privateGet(this, _startSectionCSSProperty);
|
|
444
445
|
}
|
|
445
446
|
get autoplayCSSProperty() {
|
|
446
|
-
return
|
|
447
|
+
return __privateGet(this, _autoplayCSSProperty);
|
|
447
448
|
}
|
|
448
449
|
get autoplayPauseDurationCSSProperty() {
|
|
449
|
-
return
|
|
450
|
+
return __privateGet(this, _autoplayPauseDurationCSSProperty);
|
|
450
451
|
}
|
|
451
452
|
get autoplayUserDirectionCSSProperty() {
|
|
452
|
-
return
|
|
453
|
+
return __privateGet(this, _autoplayUserDirectionCSSProperty);
|
|
453
454
|
}
|
|
454
455
|
get classesCSSProperty() {
|
|
455
|
-
return
|
|
456
|
+
return __privateGet(this, _classesCSSProperty);
|
|
456
457
|
}
|
|
457
458
|
get currentIndexStartOffsetCSSProperty() {
|
|
458
|
-
return
|
|
459
|
+
return __privateGet(this, _currentIndexStartOffsetCSSProperty);
|
|
459
460
|
}
|
|
460
461
|
get currentIndexEndOffsetCSSProperty() {
|
|
461
|
-
return
|
|
462
|
+
return __privateGet(this, _currentIndexEndOffsetCSSProperty);
|
|
462
463
|
}
|
|
463
464
|
get shiftSectionPositionCSSProperty() {
|
|
464
|
-
return
|
|
465
|
+
return __privateGet(this, _shiftSectionPositionCSSProperty);
|
|
465
466
|
}
|
|
466
467
|
get focusDelayCSSProperty() {
|
|
467
|
-
return
|
|
468
|
+
return __privateGet(this, _focusDelayCSSProperty);
|
|
468
469
|
}
|
|
469
470
|
get focusDurationCSSProperty() {
|
|
470
|
-
return
|
|
471
|
+
return __privateGet(this, _focusDurationCSSProperty);
|
|
471
472
|
}
|
|
472
473
|
get shiftLimitCSSProperty() {
|
|
473
|
-
return
|
|
474
|
+
return __privateGet(this, _shiftLimitCSSProperty);
|
|
474
475
|
}
|
|
475
476
|
get disabledCSSProperty() {
|
|
476
|
-
return
|
|
477
|
+
return __privateGet(this, _disabledCSSProperty);
|
|
477
478
|
}
|
|
478
479
|
get hibernatedCSSProperty() {
|
|
479
|
-
return
|
|
480
|
+
return __privateGet(this, _hibernatedCSSProperty);
|
|
480
481
|
}
|
|
481
482
|
get currentScrollValue() {
|
|
482
|
-
return
|
|
483
|
+
return __privateMethod(this, _ScrollElement_instances, getScrollValue_fn).call(this, "current");
|
|
483
484
|
}
|
|
484
485
|
get targetScrollValue() {
|
|
485
|
-
return
|
|
486
|
+
return __privateMethod(this, _ScrollElement_instances, getScrollValue_fn).call(this, "target");
|
|
486
487
|
}
|
|
487
488
|
get contentWrapperElement() {
|
|
488
|
-
return
|
|
489
|
+
return __privateGet(this, _contentWrapperElement);
|
|
489
490
|
}
|
|
490
491
|
get contentElement() {
|
|
491
|
-
return
|
|
492
|
+
return __privateGet(this, _contentElement);
|
|
492
493
|
}
|
|
493
494
|
get sections() {
|
|
494
|
-
return
|
|
495
|
+
return __privateGet(this, _sections);
|
|
495
496
|
}
|
|
496
497
|
get visibleSections() {
|
|
497
|
-
return
|
|
498
|
+
return __privateGet(this, _visibleSections);
|
|
498
499
|
}
|
|
499
500
|
get position() {
|
|
500
|
-
return
|
|
501
|
+
return __privateGet(this, _position2);
|
|
501
502
|
}
|
|
502
503
|
get contentPosition() {
|
|
503
|
-
return
|
|
504
|
+
return __privateGet(this, _contentPosition);
|
|
504
505
|
}
|
|
505
506
|
get viewportSize() {
|
|
506
|
-
return
|
|
507
|
+
return __privateGet(this, _viewportSize);
|
|
507
508
|
}
|
|
508
509
|
get scrollSize() {
|
|
509
|
-
return
|
|
510
|
+
return __privateGet(this, _scrollSize);
|
|
510
511
|
}
|
|
511
512
|
get gap() {
|
|
512
|
-
return
|
|
513
|
+
return __privateGet(this, _gap);
|
|
513
514
|
}
|
|
514
515
|
get counter() {
|
|
515
|
-
return
|
|
516
|
+
return __privateGet(this, _counter);
|
|
516
517
|
}
|
|
517
518
|
get limit() {
|
|
518
519
|
return Math.ceil(
|
|
519
|
-
|
|
520
|
+
__privateGet(this, _visibleSections).length - __privateGet(this, _sectionsInViewCSSProperty).current + __privateGet(this, _shiftLimitCSSProperty).current
|
|
520
521
|
);
|
|
521
522
|
}
|
|
522
523
|
get distance() {
|
|
523
|
-
return
|
|
524
|
+
return __privateGet(this, _distance);
|
|
524
525
|
}
|
|
525
526
|
get loopDistance() {
|
|
526
|
-
return
|
|
527
|
+
return __privateGet(this, _loopCSSProperty).current ? __privateGet(this, _distance) + __privateGet(this, _gap) : __privateGet(this, _distance);
|
|
527
528
|
}
|
|
528
529
|
get hasOverflow() {
|
|
529
|
-
return
|
|
530
|
+
return __privateGet(this, _hasOverflow);
|
|
530
531
|
}
|
|
531
532
|
get overscroll() {
|
|
532
|
-
return
|
|
533
|
+
return __privateGet(this, _overscroll);
|
|
533
534
|
}
|
|
534
535
|
get scrollLine() {
|
|
535
|
-
return
|
|
536
|
+
return __privateGet(this, _scrollLine);
|
|
536
537
|
}
|
|
537
538
|
get vertical() {
|
|
538
|
-
return
|
|
539
|
+
return __privateGet(this, _axisCSSProperty).current === "y";
|
|
539
540
|
}
|
|
540
541
|
get currentProgress() {
|
|
541
542
|
return this.currentScrollValue / this.loopDistance || 0;
|
|
@@ -544,307 +545,309 @@ class As extends HTMLElement {
|
|
|
544
545
|
return this.targetScrollValue / this.loopDistance || 0;
|
|
545
546
|
}
|
|
546
547
|
get scrollWidth() {
|
|
547
|
-
return
|
|
548
|
+
return __privateGet(this, _axisCSSProperty).current === "y" ? 0 : __privateGet(this, _damped).distance;
|
|
548
549
|
}
|
|
549
550
|
get scrollHeight() {
|
|
550
|
-
return
|
|
551
|
+
return __privateGet(this, _axisCSSProperty).current === "x" ? 0 : __privateGet(this, _damped).distance;
|
|
551
552
|
}
|
|
552
553
|
tryResplit() {
|
|
553
|
-
!
|
|
554
|
+
!__privateGet(this, _hibernated) && (__privateGet(this, _loopCSSProperty).current || __privateGet(this, _splitCSSProperty).current || __privateGet(this, _loopCSSProperty).current || __privateGet(this, _autoSizeCSSProperty).current || __privateGet(this, _sectionalCSSProperty).current) && __privateMethod(this, _ScrollElement_instances, split_fn).call(this);
|
|
554
555
|
}
|
|
555
|
-
onScroll(...
|
|
556
|
-
return
|
|
556
|
+
onScroll(...parameters) {
|
|
557
|
+
return __privateGet(this, _damped).subscribe(...parameters);
|
|
557
558
|
}
|
|
558
|
-
offScroll(...
|
|
559
|
-
|
|
559
|
+
offScroll(...parameters) {
|
|
560
|
+
__privateGet(this, _damped).unsubscribe(...parameters);
|
|
560
561
|
}
|
|
561
562
|
//https://github.com/pmndrs/drei/blob/d3282cdd02d170ef603a5e096505d83dc93cd57a/src/web/ScrollControls.tsx#L85C7-L100C9
|
|
562
|
-
range(
|
|
563
|
-
const
|
|
564
|
-
return this.currentProgress <
|
|
563
|
+
range(from, distance, margin = 0) {
|
|
564
|
+
const start = from - margin, end = start + distance + margin * 2;
|
|
565
|
+
return this.currentProgress < start ? 0 : this.currentProgress > end ? 1 : (this.currentProgress - start) / (end - start);
|
|
565
566
|
}
|
|
566
|
-
curve(
|
|
567
|
-
return Math.sin(this.range(
|
|
567
|
+
curve(from, distance, margin = 0) {
|
|
568
|
+
return Math.sin(this.range(from, distance, margin) * Math.PI);
|
|
568
569
|
}
|
|
569
|
-
visible(
|
|
570
|
-
const
|
|
571
|
-
return this.currentProgress >=
|
|
570
|
+
visible(from, distance, margin = 0) {
|
|
571
|
+
const start = from - margin, end = start + distance + margin * 2;
|
|
572
|
+
return this.currentProgress >= start && this.currentProgress <= end;
|
|
572
573
|
}
|
|
573
|
-
scrollToSection(
|
|
574
|
-
if (!
|
|
574
|
+
scrollToSection(sectionIndex, options) {
|
|
575
|
+
if (!__privateGet(this, _visibleSections).length || __privateGet(this, _hibernated) || __privateGet(this, _tweenTimeoutId))
|
|
575
576
|
return;
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
const
|
|
579
|
-
if (
|
|
580
|
-
let
|
|
581
|
-
const
|
|
582
|
-
let
|
|
583
|
-
|
|
577
|
+
const previousCounter = __privateGet(this, _counter).current, newCounterValue = __privateMethod(this, _ScrollElement_instances, clampCounter_fn).call(this, sectionIndex);
|
|
578
|
+
__privateGet(this, _isGrabbing) || (__privateGet(this, _counter).current = newCounterValue);
|
|
579
|
+
const previousSection = __privateGet(this, _visibleSections)[previousCounter], currentSection = __privateGet(this, _visibleSections)[newCounterValue];
|
|
580
|
+
if (previousSection && currentSection) {
|
|
581
|
+
let shiftValue = 0;
|
|
582
|
+
const nearestSectionIndex = __privateMethod(this, _ScrollElement_instances, getNearestSectionIndex_fn).call(this), nearestSection = __privateGet(this, _visibleSections)[nearestSectionIndex];
|
|
583
|
+
let scrolledFromNearestSection = nearestSection ? this.targetScrollValue - nearestSection.position : 0;
|
|
584
|
+
__privateGet(this, _loopCSSProperty).current ? newCounterValue === 0 && previousCounter === __privateGet(this, _visibleSections).length - 1 ? (shiftValue = __privateGet(this, _scrollSize) + __privateGet(this, _viewportSize) - previousSection.position + __privateGet(this, _gap), __privateGet(this, _isGrabbing) || (scrolledFromNearestSection = 0)) : newCounterValue === __privateGet(this, _visibleSections).length - 1 && previousCounter === 0 ? shiftValue = currentSection.position - (__privateGet(this, _scrollSize) + __privateGet(this, _viewportSize) + __privateGet(this, _gap)) : shiftValue = currentSection.position - previousSection.position : shiftValue = currentSection.position - previousSection.position, this.shiftPosition(shiftValue - scrolledFromNearestSection, options);
|
|
584
585
|
}
|
|
585
586
|
}
|
|
586
|
-
shiftSections(
|
|
587
|
-
|
|
587
|
+
shiftSections(step2, options) {
|
|
588
|
+
__privateGet(this, _visibleSections).length && this.scrollToSection(__privateGet(this, _counter).current + step2, options);
|
|
588
589
|
}
|
|
589
|
-
setPosition(
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
},
|
|
593
|
-
equalize: (
|
|
590
|
+
setPosition(value, options) {
|
|
591
|
+
__privateGet(this, _hibernated) || (__privateMethod(this, _ScrollElement_instances, processAutoplay_fn).call(this, Math.sign(value) || 1), options != null && options.tween ? (clearTimeout(__privateGet(this, _tweenTimeoutId)), __privateGet(this, _setTween).set(__privateGet(this, _damped).current, { equalize: !0 }), __privateGet(this, _setTween).set(value, __spreadValues({}, options.tween)), __privateSet(this, _tweenTimeoutId, setTimeout(() => {
|
|
592
|
+
__privateSet(this, _tweenTimeoutId, void 0);
|
|
593
|
+
}, options.tween.duration || 0))) : __privateGet(this, _damped).set(value, {
|
|
594
|
+
equalize: (options == null ? void 0 : options.behaviour) === "instant"
|
|
594
595
|
}));
|
|
595
596
|
}
|
|
596
|
-
shiftPosition(
|
|
597
|
-
this.setPosition(
|
|
597
|
+
shiftPosition(value, options) {
|
|
598
|
+
this.setPosition(__privateGet(this, _damped).target + value, options);
|
|
598
599
|
}
|
|
599
600
|
resize() {
|
|
600
|
-
if (
|
|
601
|
+
if (__privateGet(this, _hibernatedCSSProperty).current)
|
|
601
602
|
return;
|
|
602
|
-
|
|
603
|
-
(
|
|
603
|
+
__privateSet(this, _visibleSections, __privateGet(this, _sections).filter(
|
|
604
|
+
(s) => isElementVisible(s.element)
|
|
604
605
|
)), this.style.setProperty(
|
|
605
606
|
"--sections",
|
|
606
|
-
|
|
607
|
-
),
|
|
608
|
-
const
|
|
609
|
-
if (
|
|
610
|
-
getComputedStyle(
|
|
611
|
-
)) :
|
|
612
|
-
getComputedStyle(
|
|
613
|
-
)),
|
|
614
|
-
const
|
|
615
|
-
|
|
616
|
-
|
|
607
|
+
__privateGet(this, _visibleSections).length.toString()
|
|
608
|
+
), __privateGet(this, _damped).unlistenAnimationFrame();
|
|
609
|
+
const prevProgress = this.currentScrollValue / __privateGet(this, _scrollSize) || 0, prevCounter = __privateGet(this, _counter).current;
|
|
610
|
+
if (__privateSet(this, _position2, this.vertical ? getCumulativeOffsetTop(this) : getCumulativeOffsetLeft(this)), __privateSet(this, _contentPosition, this.vertical ? getCumulativeOffsetTop(__privateGet(this, _contentElement)) : getCumulativeOffsetLeft(__privateGet(this, _contentElement))), __privateSet(this, _viewportSize, this.vertical ? this.offsetHeight : this.offsetWidth), this.vertical ? __privateSet(this, _gap, cssUnitParser.parse(
|
|
611
|
+
getComputedStyle(__privateGet(this, _contentElement)).rowGap
|
|
612
|
+
)) : __privateSet(this, _gap, cssUnitParser.parse(
|
|
613
|
+
getComputedStyle(__privateGet(this, _contentElement)).columnGap
|
|
614
|
+
)), __privateGet(this, _autoSizeCSSProperty).current && __privateGet(this, _visibleSections).length) {
|
|
615
|
+
const ivc = __privateGet(this, _sectionsInViewCSSProperty).current, sectionSize = (__privateGet(this, _viewportSize) - __privateGet(this, _gap) * (ivc - 1)) / ivc;
|
|
616
|
+
__privateGet(this, _visibleSections).forEach((section) => {
|
|
617
|
+
section.setSize(sectionSize);
|
|
617
618
|
});
|
|
618
619
|
} else
|
|
619
|
-
|
|
620
|
-
|
|
620
|
+
__privateGet(this, _visibleSections).forEach((section) => {
|
|
621
|
+
section.setSize();
|
|
621
622
|
});
|
|
622
|
-
if (
|
|
623
|
-
|
|
624
|
-
}),
|
|
625
|
-
|
|
626
|
-
const
|
|
627
|
-
this.vertical ? (
|
|
623
|
+
if (__privateGet(this, _visibleSections).forEach((section) => {
|
|
624
|
+
section.resize();
|
|
625
|
+
}), __privateGet(this, _pagesCSSProperty).current) {
|
|
626
|
+
__privateSet(this, _scrollSize, __privateGet(this, _viewportSize) * __privateGet(this, _pagesCSSProperty).current);
|
|
627
|
+
const contentSize = __privateGet(this, _scrollSize) + __privateGet(this, _viewportSize);
|
|
628
|
+
this.vertical ? (__privateGet(this, _contentElement).style.width = contentSize + "px", __privateGet(this, _contentElement).style.height = "100%") : (__privateGet(this, _contentElement).style.height = contentSize + "px", __privateGet(this, _contentElement).style.width = "100%");
|
|
628
629
|
} else
|
|
629
|
-
this.vertical ? (
|
|
630
|
-
if (!
|
|
631
|
-
const
|
|
632
|
-
|
|
630
|
+
this.vertical ? (__privateGet(this, _contentElement).style.width = "100%", __privateGet(this, _contentElement).style.height = "max-content", __privateSet(this, _scrollSize, __privateGet(this, _contentElement).offsetHeight - __privateGet(this, _viewportSize))) : (__privateGet(this, _contentElement).style.width = "max-content", __privateGet(this, _contentElement).style.height = "100%", __privateSet(this, _scrollSize, __privateGet(this, _contentElement).offsetWidth - __privateGet(this, _viewportSize)));
|
|
631
|
+
if (!__privateGet(this, _loopCSSProperty).current) {
|
|
632
|
+
const cs = getComputedStyle(this), padding = this.vertical ? parseFloat(cs.paddingBlockStart) + parseFloat(cs.paddingBlockEnd) : parseFloat(cs.paddingInlineStart) + parseFloat(cs.paddingInlineEnd);
|
|
633
|
+
__privateSet(this, _scrollSize, __privateGet(this, _scrollSize) + padding), __privateGet(this, _damped).max = __privateGet(this, _scrollSize);
|
|
633
634
|
}
|
|
634
|
-
if (
|
|
635
|
-
const
|
|
636
|
-
|
|
635
|
+
if (__privateGet(this, _loopCSSProperty).current && __privateGet(this, _visibleSections).length) {
|
|
636
|
+
const lastSection = __privateGet(this, _visibleSections)[__privateGet(this, _visibleSections).length - 1], lastSectionMax = lastSection.position + lastSection.size - __privateGet(this, _viewportSize), lastSectionMargin = __privateGet(this, _scrollSize) - lastSectionMax;
|
|
637
|
+
__privateSet(this, _distance, lastSection.position + lastSection.size + lastSectionMargin);
|
|
637
638
|
} else
|
|
638
|
-
|
|
639
|
-
if (
|
|
640
|
-
const
|
|
641
|
-
|
|
639
|
+
__privateSet(this, _distance, __privateGet(this, _scrollSize));
|
|
640
|
+
if (__privateGet(this, _sectionalCSSProperty).current && __privateGet(this, _visibleSections).length) {
|
|
641
|
+
const section = __privateGet(this, _visibleSections)[prevCounter];
|
|
642
|
+
__privateGet(this, _damped).set(section.position, {
|
|
642
643
|
equalize: !0
|
|
643
644
|
});
|
|
644
645
|
} else
|
|
645
|
-
|
|
646
|
+
__privateGet(this, _damped).set(prevProgress * __privateGet(this, _scrollSize), {
|
|
646
647
|
equalize: !0
|
|
647
648
|
});
|
|
648
|
-
|
|
649
|
+
__privateSet(this, _hasOverflow, (this.vertical ? __privateGet(this, _contentElement).offsetHeight : __privateGet(this, _contentElement).offsetWidth) > __privateGet(this, _viewportSize)), this.classList.toggle("has-overflow", __privateGet(this, _hasOverflow)), __privateGet(this, _hasOverflow) ? __privateGet(this, _disabledCSSProperty).current || __privateMethod(this, _ScrollElement_instances, enable_fn).call(this) : __privateMethod(this, _ScrollElement_instances, disable_fn).call(this), __privateGet(this, _updateMaxSectionsSize).call(this), dispatchEvent(this, "scrollResize", { custom: !0 }), __privateGet(this, _damped).notify();
|
|
649
650
|
}
|
|
650
651
|
connectedCallback() {
|
|
651
|
-
|
|
652
|
+
scrollEntries.register(this), __privateSet(this, _damped, new Damped(0, {
|
|
652
653
|
damping: 0.01,
|
|
653
654
|
min: 0,
|
|
654
|
-
order:
|
|
655
|
-
})), this.setAttribute("tabindex", "0"),
|
|
655
|
+
order: TICK_ORDER.SCROLL
|
|
656
|
+
})), this.setAttribute("tabindex", "0"), __privateSet(this, _wheelControls, new WheelControls({ element: __privateGet(this, _contentElement) })), __privateGet(this, _wheelControls).changeEvent.subscribe(__privateGet(this, _notAutoplayControlListener)), __privateSet(this, _keyboardControls, new KeyboardControls({
|
|
656
657
|
element: this
|
|
657
|
-
})),
|
|
658
|
-
|
|
659
|
-
),
|
|
660
|
-
element:
|
|
658
|
+
})), __privateGet(this, _keyboardControls).changeEvent.subscribe(
|
|
659
|
+
__privateGet(this, _notAutoplayControlListener)
|
|
660
|
+
), __privateSet(this, _dragControls, new DragControls({
|
|
661
|
+
element: __privateGet(this, _contentElement),
|
|
661
662
|
rootElement: this
|
|
662
|
-
})),
|
|
663
|
+
})), __privateGet(this, _dragControls).changeEvent.subscribe(__privateGet(this, _notAutoplayControlListener)), __privateSet(this, _autoplayControls, new AutoplayControls({
|
|
663
664
|
culling: this
|
|
664
|
-
})),
|
|
665
|
-
|
|
666
|
-
}),
|
|
667
|
-
|
|
668
|
-
}),
|
|
669
|
-
|
|
670
|
-
}),
|
|
671
|
-
|
|
672
|
-
}),
|
|
673
|
-
|
|
674
|
-
}),
|
|
675
|
-
|
|
676
|
-
}),
|
|
677
|
-
|
|
678
|
-
}),
|
|
679
|
-
|
|
680
|
-
}),
|
|
681
|
-
|
|
682
|
-
}),
|
|
683
|
-
e.current ? (
|
|
684
|
-
}),
|
|
685
|
-
|
|
686
|
-
}),
|
|
687
|
-
|
|
688
|
-
}),
|
|
689
|
-
|
|
690
|
-
}),
|
|
691
|
-
|
|
692
|
-
}),
|
|
693
|
-
e.current || (
|
|
694
|
-
}),
|
|
695
|
-
|
|
696
|
-
}),
|
|
697
|
-
|
|
698
|
-
}),
|
|
699
|
-
|
|
700
|
-
}),
|
|
701
|
-
|
|
702
|
-
}),
|
|
665
|
+
})), __privateGet(this, _autoplayControls).changeEvent.subscribe(__privateGet(this, _controlsListener)), __privateGet(this, _axisCSSProperty).subscribe(() => {
|
|
666
|
+
__privateMethod(this, _ScrollElement_instances, updateAxis_fn).call(this);
|
|
667
|
+
}), __privateGet(this, _reverseCSSProperty).subscribe(() => {
|
|
668
|
+
__privateMethod(this, _ScrollElement_instances, updateAxis_fn).call(this);
|
|
669
|
+
}), __privateGet(this, _wheelMaxDeltaCSSProperty).subscribe((e) => {
|
|
670
|
+
__privateGet(this, _wheelControls).axis = e.current ? "max" : __privateGet(this, _axisCSSProperty).current;
|
|
671
|
+
}), __privateGet(this, _dragInertionCSSProperty).subscribe((e) => {
|
|
672
|
+
__privateGet(this, _dragControls).inertion = typeof e.current == "number" ? e.current : 1;
|
|
673
|
+
}), __privateGet(this, _pagesCSSProperty).subscribe(() => {
|
|
674
|
+
__privateGet(this, _isConnected) && __privateGet(this, _resizeListener).call(this);
|
|
675
|
+
}), __privateGet(this, _splitCSSProperty).subscribe(({ current }) => {
|
|
676
|
+
__privateGet(this, _isConnected) && (current ? __privateMethod(this, _ScrollElement_instances, split_fn).call(this) : __privateMethod(this, _ScrollElement_instances, unsplit_fn).call(this));
|
|
677
|
+
}), __privateGet(this, _sectionalCSSProperty).subscribe((e) => {
|
|
678
|
+
__privateGet(this, _wheelControls).debounce = e.current, __privateGet(this, _dragControls).swipe = e.current, __privateGet(this, _autoplayControls).interval = e.current, __privateGet(this, _isConnected) && (e.current && !e.previous && !__privateGet(this, _visibleSections).length ? __privateMethod(this, _ScrollElement_instances, split_fn).call(this) : !e.current && e.previous && __privateGet(this, _visibleSections).length && __privateMethod(this, _ScrollElement_instances, unsplit_fn).call(this));
|
|
679
|
+
}), __privateGet(this, _autoSizeCSSProperty).subscribe((e) => {
|
|
680
|
+
__privateGet(this, _isConnected) && (__privateGet(this, _resizeListener).call(this), e.current && !e.previous && !__privateGet(this, _visibleSections).length ? __privateMethod(this, _ScrollElement_instances, split_fn).call(this) : !e.current && e.previous && __privateGet(this, _visibleSections).length && __privateMethod(this, _ScrollElement_instances, unsplit_fn).call(this));
|
|
681
|
+
}), __privateGet(this, _sectionsInViewCSSProperty).subscribe((e) => {
|
|
682
|
+
__privateGet(this, _isConnected) && (__privateGet(this, _resizeListener).call(this), __privateMethod(this, _ScrollElement_instances, updateMarks_fn).call(this));
|
|
683
|
+
}), __privateGet(this, _loopCSSProperty).subscribe((e) => {
|
|
684
|
+
e.current ? (__privateGet(this, _isConnected) && (__privateGet(this, _visibleSections).length || (__privateGet(this, _splitCSSProperty).current = !0)), __privateGet(this, _damped).max = 1 / 0, __privateGet(this, _damped).min = -1 / 0) : (__privateSet(this, _overscroll, 0), __privateGet(this, _damped).max = __privateGet(this, _scrollSize), __privateGet(this, _damped).min = 0), this.classList.toggle("loop", !!e.current);
|
|
685
|
+
}), __privateGet(this, _dampingCSSProperty).subscribe((e) => {
|
|
686
|
+
__privateGet(this, _damped).damping = e.current;
|
|
687
|
+
}), __privateGet(this, _massCSSProperty).subscribe((e) => {
|
|
688
|
+
__privateGet(this, _damped).mass = e.current;
|
|
689
|
+
}), __privateGet(this, _stiffnessCSSProperty).subscribe((e) => {
|
|
690
|
+
__privateGet(this, _damped).stiffness = e.current;
|
|
691
|
+
}), __privateGet(this, _autoplayCSSProperty).subscribe((e) => {
|
|
692
|
+
__privateGet(this, _autoplayControls).speed = e.current, !__privateGet(this, _disabled) && e.current && !e.previous ? __privateGet(this, _autoplayControls).connect() : !e.current && e.previous && __privateGet(this, _autoplayControls).disconnect();
|
|
693
|
+
}), __privateGet(this, _autoplayUserDirectionCSSProperty).subscribe((e) => {
|
|
694
|
+
e.current || (__privateGet(this, _autoplayControls).direction = 1);
|
|
695
|
+
}), __privateGet(this, _classesCSSProperty).subscribe((e) => {
|
|
696
|
+
__privateGet(this, _isConnected) && __privateMethod(this, _ScrollElement_instances, updateMarks_fn).call(this);
|
|
697
|
+
}), __privateGet(this, _currentIndexStartOffsetCSSProperty).subscribe((e) => {
|
|
698
|
+
__privateGet(this, _isConnected) && __privateGet(this, _classesCSSProperty).current && __privateMethod(this, _ScrollElement_instances, updateMarks_fn).call(this);
|
|
699
|
+
}), __privateGet(this, _currentIndexEndOffsetCSSProperty).subscribe((e) => {
|
|
700
|
+
__privateGet(this, _isConnected) && __privateGet(this, _classesCSSProperty).current && __privateMethod(this, _ScrollElement_instances, updateMarks_fn).call(this);
|
|
701
|
+
}), __privateGet(this, _shiftSectionPositionCSSProperty).subscribe((e) => {
|
|
702
|
+
__privateGet(this, _isConnected) && __privateGet(this, _damped).notify();
|
|
703
|
+
}), __privateGet(this, _damped).isRunning.subscribe((e) => {
|
|
703
704
|
this.classList.toggle("active", e.current);
|
|
704
|
-
}),
|
|
705
|
-
|
|
706
|
-
}),
|
|
707
|
-
|
|
708
|
-
}),
|
|
709
|
-
e.current && !e.previous ? (this.classList.add("disabled"),
|
|
710
|
-
}),
|
|
711
|
-
e.current && !e.previous ? (this.classList.add("hibernated"),
|
|
712
|
-
}),
|
|
705
|
+
}), __privateGet(this, _counter).subscribe((e) => {
|
|
706
|
+
__privateGet(this, _hibernated) || (__privateGet(this, _visibleSections).length && __privateMethod(this, _ScrollElement_instances, updateMarks_fn).call(this), this.style.setProperty("--counter", e.current + ""));
|
|
707
|
+
}), __privateGet(this, _setTween).subscribe((e) => {
|
|
708
|
+
__privateGet(this, _setTween).isRunning.current && __privateGet(this, _damped).set(e.current, { equalize: !0 });
|
|
709
|
+
}), __privateGet(this, _disabledCSSProperty).subscribe((e) => {
|
|
710
|
+
e.current && !e.previous ? (this.classList.add("disabled"), __privateMethod(this, _ScrollElement_instances, disable_fn).call(this)) : !e.current && e.previous && (this.classList.remove("disabled"), __privateMethod(this, _ScrollElement_instances, enable_fn).call(this));
|
|
711
|
+
}), __privateGet(this, _hibernatedCSSProperty).subscribe((e) => {
|
|
712
|
+
e.current && !e.previous ? (this.classList.add("hibernated"), __privateMethod(this, _ScrollElement_instances, hibernate_fn).call(this)) : !e.current && e.previous && (this.classList.remove("hibernated"), __privateMethod(this, _ScrollElement_instances, awake_fn).call(this));
|
|
713
|
+
}), __privateGet(this, _controlsCSSProperty).observe(), __privateGet(this, _axisCSSProperty).observe(), __privateGet(this, _reverseCSSProperty).observe(), __privateGet(this, _directionCSSProperty).observe(), __privateGet(this, _pagesCSSProperty).observe(), __privateGet(this, _splitCSSProperty).observe(), __privateGet(this, _sectionalCSSProperty).observe(), __privateGet(this, _easingCSSProperty).observe(), __privateGet(this, _durationCSSProperty).observe(), __privateGet(this, _autoSizeCSSProperty).observe(), __privateGet(this, _wheelMaxDeltaCSSProperty).observe(), __privateGet(this, _dragInertionCSSProperty).observe(), __privateGet(this, _sectionsInViewCSSProperty).observe(), __privateGet(this, _loopCSSProperty).observe(), __privateGet(this, _dampingCSSProperty).observe(), __privateGet(this, _massCSSProperty).observe(), __privateGet(this, _stiffnessCSSProperty).observe(), __privateGet(this, _mouseDragCSSProperty).observe(), __privateGet(this, _sectionDistanceScaleCSSProperty).observe(), __privateGet(this, _startSectionCSSProperty).observe(), __privateGet(this, _autoplayCSSProperty).observe(), __privateGet(this, _autoplayCSSProperty).observe(), __privateGet(this, _autoplayPauseDurationCSSProperty).observe(), __privateGet(this, _autoplayUserDirectionCSSProperty).observe(), __privateGet(this, _classesCSSProperty).observe(), __privateGet(this, _currentIndexStartOffsetCSSProperty).observe(), __privateGet(this, _currentIndexEndOffsetCSSProperty).observe(), __privateGet(this, _shiftSectionPositionCSSProperty).observe(), __privateGet(this, _focusDelayCSSProperty).observe(), __privateGet(this, _focusDurationCSSProperty).observe(), __privateGet(this, _shiftLimitCSSProperty).observe(), __privateGet(this, _disabledCSSProperty).observe(), __privateGet(this, _hibernatedCSSProperty).observe(), windowResizer.subscribe(__privateGet(this, _connectListener), RESIZE_ORDER.LAST), __privateGet(this, _mutationObserver).observe(this, { childList: !0 });
|
|
713
714
|
}
|
|
714
715
|
disconnectedCallback() {
|
|
715
|
-
this.removeAttribute("tabindex"), this.classList.remove("disabled"), this.classList.remove("hibernated"),
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
},
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
}),
|
|
716
|
+
this.removeAttribute("tabindex"), this.classList.remove("disabled"), this.classList.remove("hibernated"), __privateGet(this, _controlsCSSProperty).unobserve(), __privateGet(this, _axisCSSProperty).unobserve(), __privateGet(this, _reverseCSSProperty).unobserve(), __privateGet(this, _directionCSSProperty).unobserve(), __privateGet(this, _pagesCSSProperty).unobserve(), __privateGet(this, _splitCSSProperty).unobserve(), __privateGet(this, _sectionalCSSProperty).unobserve(), __privateGet(this, _easingCSSProperty).unobserve(), __privateGet(this, _durationCSSProperty).unobserve(), __privateGet(this, _autoSizeCSSProperty).unobserve(), __privateGet(this, _wheelMaxDeltaCSSProperty).unobserve(), __privateGet(this, _dragInertionCSSProperty).unobserve(), __privateGet(this, _sectionsInViewCSSProperty).unobserve(), __privateGet(this, _loopCSSProperty).unobserve(), __privateGet(this, _dampingCSSProperty).unobserve(), __privateGet(this, _massCSSProperty).unobserve(), __privateGet(this, _stiffnessCSSProperty).unobserve(), __privateGet(this, _mouseDragCSSProperty).unobserve(), __privateGet(this, _sectionDistanceScaleCSSProperty).unobserve(), __privateGet(this, _startSectionCSSProperty).unobserve(), __privateGet(this, _autoplayCSSProperty).unobserve(), __privateGet(this, _autoplayPauseDurationCSSProperty).unobserve(), __privateGet(this, _autoplayUserDirectionCSSProperty).unobserve(), __privateGet(this, _classesCSSProperty).unobserve(), __privateGet(this, _currentIndexStartOffsetCSSProperty).unobserve(), __privateGet(this, _currentIndexEndOffsetCSSProperty).unobserve(), __privateGet(this, _shiftSectionPositionCSSProperty).unobserve(), __privateGet(this, _focusDelayCSSProperty).unobserve(), __privateGet(this, _focusDurationCSSProperty).unobserve(), __privateGet(this, _shiftLimitCSSProperty).unobserve(), __privateGet(this, _disabledCSSProperty).unobserve(), __privateGet(this, _hibernatedCSSProperty).unobserve(), windowResizer.unsubscribe(__privateGet(this, _connectListener)), windowResizer.unsubscribe(__privateGet(this, _resizeListener)), elementResizer.unsubscribe(__privateGet(this, _resizeListener)), __privateMethod(this, _ScrollElement_instances, hibernate_fn).call(this), __privateGet(this, _mutationObserver).disconnect();
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
_damped = new WeakMap(), _controlsCSSProperty = new WeakMap(), _axisCSSProperty = new WeakMap(), _reverseCSSProperty = new WeakMap(), _directionCSSProperty = new WeakMap(), _pagesCSSProperty = new WeakMap(), _splitCSSProperty = new WeakMap(), _sectionalCSSProperty = new WeakMap(), _easingCSSProperty = new WeakMap(), _durationCSSProperty = new WeakMap(), _autoSizeCSSProperty = new WeakMap(), _wheelMaxDeltaCSSProperty = new WeakMap(), _dragInertionCSSProperty = new WeakMap(), _sectionsInViewCSSProperty = new WeakMap(), _loopCSSProperty = new WeakMap(), _dampingCSSProperty = new WeakMap(), _massCSSProperty = new WeakMap(), _stiffnessCSSProperty = new WeakMap(), _mouseDragCSSProperty = new WeakMap(), _sectionDistanceScaleCSSProperty = new WeakMap(), _startSectionCSSProperty = new WeakMap(), _autoplayCSSProperty = new WeakMap(), _autoplayPauseDurationCSSProperty = new WeakMap(), _autoplayUserDirectionCSSProperty = new WeakMap(), _classesCSSProperty = new WeakMap(), _currentIndexStartOffsetCSSProperty = new WeakMap(), _currentIndexEndOffsetCSSProperty = new WeakMap(), _shiftSectionPositionCSSProperty = new WeakMap(), _focusDelayCSSProperty = new WeakMap(), _focusDurationCSSProperty = new WeakMap(), _shiftLimitCSSProperty = new WeakMap(), _disabledCSSProperty = new WeakMap(), _hibernatedCSSProperty = new WeakMap(), _contentWrapperElement = new WeakMap(), _contentElement = new WeakMap(), _slotElement = new WeakMap(), _sections = new WeakMap(), _visibleSections = new WeakMap(), _position2 = new WeakMap(), _contentPosition = new WeakMap(), _viewportSize = new WeakMap(), _scrollSize = new WeakMap(), _gap = new WeakMap(), _wheelControls = new WeakMap(), _keyboardControls = new WeakMap(), _dragControls = new WeakMap(), _autoplayControls = new WeakMap(), _counter = new WeakMap(), _overscroll = new WeakMap(), _distance = new WeakMap(), _hasOverflow = new WeakMap(), _disabled = new WeakMap(), _hibernated = new WeakMap(), _focusTimeoutId = new WeakMap(), _tweenTimeoutId = new WeakMap(), _setTween = new WeakMap(), _isGrabbing = new WeakMap(), _scrollLine = new WeakMap(), _isConnected = new WeakMap(), _mutationObserver = new WeakMap(), _currentSections = new WeakMap(), _skipNextResize = new WeakMap(), _maxSectionSizeTimeoutId = new WeakMap(), _ScrollElement_instances = new WeakSet(), updateAxis_fn = /* @__PURE__ */ __name(function() {
|
|
720
|
+
const axis = __privateGet(this, _axisCSSProperty).current, reverse = __privateGet(this, _reverseCSSProperty).current ? "-reverse" : "";
|
|
721
|
+
__privateGet(this, _contentElement).style.flexDirection = axis === "x" ? `row${reverse}` : `column${reverse}`, __privateGet(this, _wheelControls).axis = __privateGet(this, _wheelMaxDeltaCSSProperty).current ? "max" : axis, __privateGet(this, _keyboardControls).dimension = axis === "x" ? "width" : "height", __privateGet(this, _dragControls).axis = axis, axis === "x" ? this.style.touchAction = "pan-y" : axis === "y" && (this.style.touchAction = "pan-x"), __privateGet(this, _isConnected) && __privateGet(this, _resizeListener).call(this);
|
|
722
|
+
}, "#updateAxis"), split_fn = /* @__PURE__ */ __name(function() {
|
|
723
|
+
__privateMethod(this, _ScrollElement_instances, unsplit_fn).call(this), __privateGet(this, _slotElement).assignedElements().forEach((element, i) => {
|
|
724
|
+
element instanceof HTMLElement && element.tagName !== "SCRIPT" && __privateGet(this, _sections).push(new ScrollSection(element, i, this));
|
|
725
|
+
}), __privateSet(this, _visibleSections, [...__privateGet(this, _sections)]), __privateGet(this, _contentElement).style.transform = "", dispatchEvent(this, "scrollSectionsChange", {
|
|
725
726
|
custom: !0,
|
|
726
727
|
composed: !0
|
|
727
|
-
}),
|
|
728
|
-
},
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
}),
|
|
728
|
+
}), __privateGet(this, _resizeListener).call(this), __privateMethod(this, _ScrollElement_instances, updateMarks_fn).call(this);
|
|
729
|
+
}, "#split"), unsplit_fn = /* @__PURE__ */ __name(function() {
|
|
730
|
+
__privateGet(this, _sections).forEach((section) => {
|
|
731
|
+
section.destroy();
|
|
732
|
+
}), __privateSet(this, _sections, []), __privateSet(this, _visibleSections, []), __privateGet(this, _counter).reset(), __privateGet(this, _damped).reset(), this.style.removeProperty("--max-section-size"), dispatchEvent(this, "scrollSectionsChange", {
|
|
732
733
|
custom: !0,
|
|
733
734
|
composed: !0
|
|
734
735
|
});
|
|
735
|
-
},
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
}),
|
|
739
|
-
},
|
|
740
|
-
|
|
741
|
-
},
|
|
742
|
-
|
|
743
|
-
},
|
|
744
|
-
|
|
736
|
+
}, "#unsplit"), disable_fn = /* @__PURE__ */ __name(function() {
|
|
737
|
+
__privateGet(this, _disabled) || (__privateSet(this, _disabled, !0), __privateGet(this, _damped).unsubscribe(__privateGet(this, _animatedChangeListener)), __privateGet(this, _damped).unlistenAnimationFrame(), clearInterval(__privateGet(this, _focusTimeoutId)), clearInterval(__privateGet(this, _tweenTimeoutId)), __privateGet(this, _setTween).unlistenAnimationFrame(), __privateGet(this, _wheelControls).disconnect(), __privateGet(this, _keyboardControls).disconnect(), __privateGet(this, _dragControls).disconnect(), __privateGet(this, _autoplayControls).disconnect(), __privateGet(this, _hasOverflow) || (this.sections.forEach((section) => {
|
|
738
|
+
section.unsetTransform();
|
|
739
|
+
}), __privateGet(this, _resizeListener).call(this)));
|
|
740
|
+
}, "#disable"), enable_fn = /* @__PURE__ */ __name(function() {
|
|
741
|
+
__privateGet(this, _disabled) && (__privateSet(this, _disabled, !1), __privateGet(this, _damped).subscribe(__privateGet(this, _animatedChangeListener), -1e4), __privateGet(this, _damped).notify(), __privateGet(this, _wheelControls).connect(), __privateGet(this, _keyboardControls).connect(), __privateGet(this, _dragControls).connect(), __privateGet(this, _autoplayCSSProperty).current && __privateGet(this, _autoplayControls).connect());
|
|
742
|
+
}, "#enable"), hibernate_fn = /* @__PURE__ */ __name(function() {
|
|
743
|
+
__privateGet(this, _hibernated) || (__privateSet(this, _hibernated, !0), clearTimeout(__privateGet(this, _maxSectionSizeTimeoutId)), windowResizer.unsubscribe(__privateGet(this, _resizeListener)), __privateMethod(this, _ScrollElement_instances, disable_fn).call(this), __privateGet(this, _contentElement).style.transform = "", __privateGet(this, _contentElement).style.height = "", __privateGet(this, _contentElement).style.width = "", this.classList.remove("has-overflow", "start", "end"), this.style.removeProperty("--counter"), __privateGet(this, _sections).length ? __privateMethod(this, _ScrollElement_instances, unsplit_fn).call(this) : (__privateGet(this, _counter).reset(), __privateGet(this, _damped).reset()), scrollEntries.unregister(this));
|
|
744
|
+
}, "#hibernate"), awake_fn = /* @__PURE__ */ __name(function() {
|
|
745
|
+
__privateGet(this, _hibernated) && (__privateSet(this, _hibernated, !1), scrollEntries.register(this), this.tryResplit(), __privateMethod(this, _ScrollElement_instances, enable_fn).call(this), this.scrollToSection(__privateGet(this, _startSectionCSSProperty).current, {
|
|
745
746
|
behaviour: "instant"
|
|
746
|
-
}),
|
|
747
|
-
},
|
|
748
|
-
let
|
|
749
|
-
return
|
|
750
|
-
},
|
|
751
|
-
|
|
752
|
-
|
|
747
|
+
}), windowResizer.subscribe(__privateGet(this, _resizeListener), RESIZE_ORDER.SCROLL));
|
|
748
|
+
}, "#awake"), _resizeListener = new WeakMap(), _animatedChangeListener = new WeakMap(), clampCounter_fn = /* @__PURE__ */ __name(function(value) {
|
|
749
|
+
let counter = __privateGet(this, _counter).current;
|
|
750
|
+
return __privateGet(this, _loopCSSProperty).current ? counter = loopNumber(value, __privateGet(this, _visibleSections).length) : counter = clamp(value, 0, this.limit), counter;
|
|
751
|
+
}, "#clampCounter"), _notAutoplayControlListener = new WeakMap(), _controlsListener = new WeakMap(), processAutoplay_fn = /* @__PURE__ */ __name(function(direction = 1) {
|
|
752
|
+
__privateGet(this, _autoplayUserDirectionCSSProperty).current && (__privateGet(this, _autoplayControls).direction = direction), __privateGet(this, _autoplayCSSProperty).current && __privateGet(this, _autoplayControls).pauseAndContinue(
|
|
753
|
+
__privateGet(this, _autoplayPauseDurationCSSProperty).current,
|
|
753
754
|
this.sectionalCSSProperty.current
|
|
754
755
|
);
|
|
755
|
-
},
|
|
756
|
-
if (
|
|
757
|
-
const
|
|
758
|
-
return
|
|
756
|
+
}, "#processAutoplay"), getScrollValue_fn = /* @__PURE__ */ __name(function(type = "current") {
|
|
757
|
+
if (__privateGet(this, _loopCSSProperty).current && __privateGet(this, _visibleSections).length) {
|
|
758
|
+
const mod = Math.floor(__privateGet(this, _damped)[type]) % Math.floor(__privateGet(this, _scrollSize) + __privateGet(this, _viewportSize) + __privateGet(this, _gap));
|
|
759
|
+
return mod < 0 ? __privateGet(this, _scrollSize) + mod + __privateGet(this, _viewportSize) + __privateGet(this, _gap) : mod;
|
|
759
760
|
} else
|
|
760
|
-
return
|
|
761
|
-
},
|
|
762
|
-
if (
|
|
763
|
-
const
|
|
764
|
-
if (
|
|
765
|
-
detail: { line:
|
|
766
|
-
}),
|
|
767
|
-
this.classList.remove("end", "start"),
|
|
768
|
-
const
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
const
|
|
772
|
-
|
|
773
|
-
}),
|
|
761
|
+
return __privateGet(this, _damped)[type];
|
|
762
|
+
}, "#getScrollValue"), updateMarks_fn = /* @__PURE__ */ __name(function() {
|
|
763
|
+
if (__privateGet(this, _visibleSections).length) {
|
|
764
|
+
const counter = __privateGet(this, _counter).current + __privateGet(this, _currentIndexStartOffsetCSSProperty).current;
|
|
765
|
+
if (counter === __privateGet(this, _currentIndexStartOffsetCSSProperty).current ? __privateSet(this, _scrollLine, "start") : counter === this.limit ? __privateSet(this, _scrollLine, "end") : __privateSet(this, _scrollLine, null), dispatchEvent(this, "scrollLine", {
|
|
766
|
+
detail: { line: __privateGet(this, _scrollLine) }
|
|
767
|
+
}), __privateGet(this, _classesCSSProperty).current) {
|
|
768
|
+
this.classList.remove("end", "start"), __privateGet(this, _scrollLine) && this.classList.add(__privateGet(this, _scrollLine));
|
|
769
|
+
const sectionsInView = __privateGet(this, _sectionsInViewCSSProperty).current + __privateGet(this, _currentIndexEndOffsetCSSProperty).current;
|
|
770
|
+
__privateSet(this, _currentSections, []), __privateGet(this, _visibleSections).forEach((section, index) => {
|
|
771
|
+
section.setCurrentIndex(null), section.setCurrentIndexArc(null), section.setCurrentIndexArcAbs(null), section.setMiddle(!1);
|
|
772
|
+
const overflow = counter - this.limit - 1 + __privateGet(this, _currentIndexEndOffsetCSSProperty).current, currentRange = counter + sectionsInView, vv = this.sections.length - currentRange;
|
|
773
|
+
index >= counter && index < currentRange || index <= overflow ? (section.setMark("current"), __privateGet(this, _currentSections).push(section)) : index >= currentRange && index < currentRange + vv / 2 || index <= overflow + sectionsInView ? section.setMark("next") : section.setMark("previous");
|
|
774
|
+
}), __privateGet(this, _updateMaxSectionsSize).call(this);
|
|
774
775
|
}
|
|
775
776
|
}
|
|
776
|
-
},
|
|
777
|
-
if (
|
|
778
|
-
const
|
|
779
|
-
|
|
780
|
-
const
|
|
781
|
-
|
|
782
|
-
}),
|
|
783
|
-
|
|
784
|
-
|
|
777
|
+
}, "#updateMarks"), updateIndexes_fn = /* @__PURE__ */ __name(function() {
|
|
778
|
+
if (__privateGet(this, _classesCSSProperty).current) {
|
|
779
|
+
const middle = Math.floor(__privateGet(this, _currentSections).length / 2);
|
|
780
|
+
__privateGet(this, _currentSections).sort((a, b) => a.element.getBoundingClientRect().left - b.element.getBoundingClientRect().left), __privateGet(this, _currentSections).forEach((section, i) => {
|
|
781
|
+
const arcIndex = i - middle;
|
|
782
|
+
section.setCurrentIndex(i), section.setCurrentIndexArc(arcIndex), section.setCurrentIndexArcAbs(Math.abs(arcIndex)), section.setMiddle(i === middle);
|
|
783
|
+
}), __privateGet(this, _visibleSections).forEach((section, i) => {
|
|
784
|
+
section.setOffsetIndex(
|
|
785
|
+
i - (__privateGet(this, _counter).current + __privateGet(this, _sectionsInViewCSSProperty).current)
|
|
785
786
|
);
|
|
786
787
|
});
|
|
787
788
|
}
|
|
788
|
-
},
|
|
789
|
-
let
|
|
790
|
-
const
|
|
791
|
-
for (let
|
|
792
|
-
const
|
|
793
|
-
let
|
|
794
|
-
this.overscroll &&
|
|
795
|
-
let
|
|
796
|
-
|
|
797
|
-
}
|
|
798
|
-
return
|
|
799
|
-
},
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
789
|
+
}, "#updateIndexes"), _updateMaxSectionsSize = new WeakMap(), getNearestSectionIndex_fn = /* @__PURE__ */ __name(function(NAMEIT = !1) {
|
|
790
|
+
let scrollValue = this.targetScrollValue, minDiff = 1 / 0, nearestIndex = 0;
|
|
791
|
+
const dir = __privateGet(this, _damped).direction;
|
|
792
|
+
for (let i = 0; i < __privateGet(this, _visibleSections).length; i++) {
|
|
793
|
+
const section = __privateGet(this, _visibleSections)[i];
|
|
794
|
+
let offset = __privateGet(this, _isGrabbing) ? section.size * dir * -1 * 0.4 : 0, position = section.position;
|
|
795
|
+
this.overscroll && position === 0 && NAMEIT && (position = __privateGet(this, _distance));
|
|
796
|
+
let diff = Math.abs(position + offset - scrollValue);
|
|
797
|
+
diff <= minDiff && (minDiff = diff, nearestIndex = i);
|
|
798
|
+
}
|
|
799
|
+
return nearestIndex;
|
|
800
|
+
}, "#getNearestSectionIndex"), _connectListener = new WeakMap(), __name(_ScrollElement, "ScrollElement");
|
|
801
|
+
let ScrollElement = _ScrollElement;
|
|
802
|
+
isBrowser && !customElements.get("e-scroll") && customElements.define("e-scroll", ScrollElement);
|
|
803
|
+
var _scrollElement2;
|
|
804
|
+
const _ScrollUserElement = class _ScrollUserElement extends HTMLElement {
|
|
803
805
|
constructor() {
|
|
804
806
|
super(...arguments);
|
|
805
|
-
|
|
807
|
+
__privateAdd(this, _scrollElement2, null);
|
|
806
808
|
}
|
|
807
809
|
get scrollElement() {
|
|
808
|
-
return
|
|
810
|
+
return __privateGet(this, _scrollElement2);
|
|
809
811
|
}
|
|
810
812
|
connectedCallback() {
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
+
const scrollElement = findParentElement(this, ScrollElement);
|
|
814
|
+
scrollElement instanceof ScrollElement ? __privateSet(this, _scrollElement2, scrollElement) : console.error(this, "e-scroll not found");
|
|
813
815
|
}
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
816
|
+
};
|
|
817
|
+
_scrollElement2 = new WeakMap(), __name(_ScrollUserElement, "ScrollUserElement");
|
|
818
|
+
let ScrollUserElement = _ScrollUserElement;
|
|
819
|
+
var _slotElement2, _thumbElement, _isHorisontal, _thumbSize, _thumbScrollSize, _position3, _resizeListener2, _scrollListener, _axisListener, _grabListener;
|
|
820
|
+
const _ScrollScrollbarElement = class _ScrollScrollbarElement extends ScrollUserElement {
|
|
818
821
|
constructor() {
|
|
819
822
|
super();
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
const
|
|
829
|
-
|
|
830
|
-
});
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
});
|
|
834
|
-
|
|
823
|
+
__privateAdd(this, _slotElement2, null);
|
|
824
|
+
__privateAdd(this, _thumbElement, null);
|
|
825
|
+
__privateAdd(this, _isHorisontal, !1);
|
|
826
|
+
__privateAdd(this, _thumbSize, 0);
|
|
827
|
+
__privateAdd(this, _thumbScrollSize, 0);
|
|
828
|
+
__privateAdd(this, _position3, 0);
|
|
829
|
+
__privateAdd(this, _resizeListener2, /* @__PURE__ */ __name(() => {
|
|
830
|
+
__privateSet(this, _isHorisontal, this.offsetWidth > this.offsetHeight);
|
|
831
|
+
const barSize = __privateGet(this, _isHorisontal) ? this.offsetWidth : this.offsetHeight;
|
|
832
|
+
__privateSet(this, _thumbSize, barSize / ((this.scrollElement.scrollSize + this.scrollElement.viewportSize) / barSize)), __privateSet(this, _thumbSize, Math.max(__privateGet(this, _thumbSize), 30)), __privateGet(this, _isHorisontal) ? (__privateGet(this, _thumbElement).style.width = __privateGet(this, _thumbSize) + "px", __privateGet(this, _thumbElement).style.height = "100%") : (__privateGet(this, _thumbElement).style.width = "100%", __privateGet(this, _thumbElement).style.height = __privateGet(this, _thumbSize) + "px"), __privateSet(this, _thumbScrollSize, barSize - __privateGet(this, _thumbSize)), this.scrollElement.scrollSize <= 0 ? this.style.display = "none" : this.style.display = "", __privateGet(this, _scrollListener).call(this);
|
|
833
|
+
}, "#resizeListener"));
|
|
834
|
+
__privateAdd(this, _scrollListener, /* @__PURE__ */ __name(() => {
|
|
835
|
+
__privateSet(this, _position3, this.scrollElement.currentProgress * __privateGet(this, _thumbScrollSize)), __privateGet(this, _isHorisontal) ? __privateGet(this, _thumbElement).style.transform = `translate3d(${__privateGet(this, _position3)}px, 0px, 0px)` : __privateGet(this, _thumbElement).style.transform = `translate3d(0px, ${__privateGet(this, _position3)}px, 0px)`;
|
|
836
|
+
}, "#scrollListener"));
|
|
837
|
+
__privateAdd(this, _axisListener, /* @__PURE__ */ __name(() => {
|
|
835
838
|
this.setAttribute("axis", this.scrollElement.axisCSSProperty.current);
|
|
836
|
-
});
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
const
|
|
840
|
-
this.scrollElement.setPosition(
|
|
839
|
+
}, "#axisListener"));
|
|
840
|
+
__privateAdd(this, _grabListener, /* @__PURE__ */ __name((grabEvent) => {
|
|
841
|
+
setupDrag((moveEvent) => {
|
|
842
|
+
const moveCursor = __privateGet(this, _isHorisontal) ? moveEvent.x : moveEvent.y, mult = this.scrollElement.distance / __privateGet(this, _thumbScrollSize), delta = (moveCursor - grabCursor) * mult;
|
|
843
|
+
this.scrollElement.setPosition(startValue + delta);
|
|
841
844
|
});
|
|
842
|
-
const
|
|
843
|
-
});
|
|
844
|
-
if (
|
|
845
|
-
const
|
|
846
|
-
|
|
847
|
-
|
|
845
|
+
const startValue = this.scrollElement.damped.target, grabCursor = __privateGet(this, _isHorisontal) ? grabEvent.x : grabEvent.y;
|
|
846
|
+
}, "#grabListener"));
|
|
847
|
+
if (isBrowser) {
|
|
848
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
849
|
+
shadow.adoptedStyleSheets = [
|
|
850
|
+
createStylesheet({
|
|
848
851
|
":host": {
|
|
849
852
|
display: "inline-block",
|
|
850
853
|
zIndex: "1",
|
|
@@ -873,562 +876,569 @@ class zi extends is {
|
|
|
873
876
|
touchAction: "none"
|
|
874
877
|
}
|
|
875
878
|
})
|
|
876
|
-
],
|
|
879
|
+
], __privateSet(this, _slotElement2, document.createElement("slot")), __privateGet(this, _slotElement2).innerHTML = '<div class="default-thumb"></div>', shadow.appendChild(__privateGet(this, _slotElement2));
|
|
877
880
|
}
|
|
878
881
|
}
|
|
879
882
|
get thumbElement() {
|
|
880
|
-
return
|
|
883
|
+
return __privateGet(this, _thumbElement);
|
|
881
884
|
}
|
|
882
885
|
connectedCallback() {
|
|
883
886
|
super.connectedCallback(), this.setAttribute("drag-dead-zone", "");
|
|
884
|
-
const
|
|
885
|
-
|
|
887
|
+
const slottedThumb = __privateGet(this, _slotElement2).assignedElements()[0] || __privateGet(this, _slotElement2).firstElementChild;
|
|
888
|
+
__privateSet(this, _thumbElement, slottedThumb), __privateGet(this, _thumbElement).addEventListener("pointerdown", __privateGet(this, _grabListener)), windowResizer.subscribe(__privateGet(this, _resizeListener2), RESIZE_ORDER.SCROLL), elementResizer.subscribe(this, __privateGet(this, _resizeListener2)), elementResizer.subscribe(this.scrollElement, __privateGet(this, _resizeListener2)), this.scrollElement.onScroll(__privateGet(this, _scrollListener)), this.scrollElement.axisCSSProperty.subscribe(__privateGet(this, _axisListener));
|
|
886
889
|
}
|
|
887
890
|
disconnectedCallback() {
|
|
888
|
-
this.removeAttribute("drag-dead-zone"), this.style.display = "",
|
|
891
|
+
this.removeAttribute("drag-dead-zone"), this.style.display = "", __privateGet(this, _thumbElement).removeEventListener("pointerdown", __privateGet(this, _grabListener)), windowResizer.unsubscribe(__privateGet(this, _resizeListener2)), elementResizer.unsubscribe(__privateGet(this, _resizeListener2)), this.scrollElement.offScroll(__privateGet(this, _scrollListener)), this.scrollElement.axisCSSProperty.unsubscribe(__privateGet(this, _axisListener));
|
|
889
892
|
}
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
893
|
+
};
|
|
894
|
+
_slotElement2 = new WeakMap(), _thumbElement = new WeakMap(), _isHorisontal = new WeakMap(), _thumbSize = new WeakMap(), _thumbScrollSize = new WeakMap(), _position3 = new WeakMap(), _resizeListener2 = new WeakMap(), _scrollListener = new WeakMap(), _axisListener = new WeakMap(), _grabListener = new WeakMap(), __name(_ScrollScrollbarElement, "ScrollScrollbarElement");
|
|
895
|
+
let ScrollScrollbarElement = _ScrollScrollbarElement;
|
|
896
|
+
isBrowser && !customElements.get("e-scroll-scrollbar") && customElements.define("e-scroll-scrollbar", ScrollScrollbarElement);
|
|
897
|
+
var _behaviour, _easing, _duration;
|
|
898
|
+
const _ScrollButtonElement = class _ScrollButtonElement extends ScrollUserElement {
|
|
895
899
|
constructor() {
|
|
896
900
|
super();
|
|
897
|
-
|
|
898
|
-
|
|
901
|
+
__privateAdd(this, _behaviour, new CSSProperty(this, "--behaviour", "smooth"));
|
|
902
|
+
__privateAdd(this, _easing, new CSSProperty(
|
|
899
903
|
this,
|
|
900
904
|
"--tween-easing",
|
|
901
905
|
!1
|
|
902
906
|
));
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
const
|
|
907
|
+
__privateAdd(this, _duration, new CSSProperty(this, "--tween-duration", 0));
|
|
908
|
+
isBrowser && this.addEventListener("click", () => {
|
|
909
|
+
const behaviour = __privateGet(this, _behaviour).current, easing = __privateGet(this, _easing).current, duration = __privateGet(this, _duration).current;
|
|
906
910
|
this.handleClick({
|
|
907
|
-
behaviour
|
|
908
|
-
tween:
|
|
911
|
+
behaviour,
|
|
912
|
+
tween: easing || duration ? { easing, duration } : void 0
|
|
909
913
|
});
|
|
910
914
|
});
|
|
911
915
|
}
|
|
912
916
|
connectedCallback() {
|
|
913
|
-
super.connectedCallback(), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"),
|
|
917
|
+
super.connectedCallback(), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), __privateGet(this, _behaviour).observe(), __privateGet(this, _easing).observe(), __privateGet(this, _duration).observe();
|
|
914
918
|
}
|
|
915
919
|
disconnectedCallback() {
|
|
916
|
-
this.removeAttribute("tabindex"), this.removeAttribute("role"),
|
|
920
|
+
this.removeAttribute("tabindex"), this.removeAttribute("role"), __privateGet(this, _behaviour).close(), __privateGet(this, _easing).close(), __privateGet(this, _duration).close();
|
|
917
921
|
}
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
+
};
|
|
923
|
+
_behaviour = new WeakMap(), _easing = new WeakMap(), _duration = new WeakMap(), __name(_ScrollButtonElement, "ScrollButtonElement");
|
|
924
|
+
let ScrollButtonElement = _ScrollButtonElement;
|
|
925
|
+
var _set;
|
|
926
|
+
const _ScrollSetButtonElement = class _ScrollSetButtonElement extends ScrollButtonElement {
|
|
922
927
|
constructor() {
|
|
923
928
|
super(...arguments);
|
|
924
|
-
|
|
929
|
+
__privateAdd(this, _set, new CSSProperty(this, "--set", 1));
|
|
925
930
|
}
|
|
926
|
-
handleClick(
|
|
927
|
-
this.scrollElement.scrollToSection(
|
|
931
|
+
handleClick(options) {
|
|
932
|
+
this.scrollElement.scrollToSection(__privateGet(this, _set).current, options);
|
|
928
933
|
}
|
|
929
934
|
connectedCallback() {
|
|
930
|
-
super.connectedCallback(),
|
|
935
|
+
super.connectedCallback(), __privateGet(this, _set).observe();
|
|
931
936
|
}
|
|
932
937
|
disconnectedCallback() {
|
|
933
|
-
super.disconnectedCallback(),
|
|
938
|
+
super.disconnectedCallback(), __privateGet(this, _set).close();
|
|
934
939
|
}
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
+
};
|
|
941
|
+
_set = new WeakMap(), __name(_ScrollSetButtonElement, "ScrollSetButtonElement");
|
|
942
|
+
let ScrollSetButtonElement = _ScrollSetButtonElement;
|
|
943
|
+
isBrowser && !customElements.get("e-scroll-set-button") && customElements.define("e-scroll-set-button", ScrollSetButtonElement);
|
|
944
|
+
var _step, _scrollLineListener;
|
|
945
|
+
const _ScrollStepButtonElement = class _ScrollStepButtonElement extends ScrollButtonElement {
|
|
940
946
|
constructor() {
|
|
941
947
|
super(...arguments);
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
this.scrollElement.loopCSSProperty.current ? this.removeAttribute("disabled") :
|
|
945
|
-
});
|
|
948
|
+
__privateAdd(this, _step, new CSSProperty(this, "--step", 1));
|
|
949
|
+
__privateAdd(this, _scrollLineListener, /* @__PURE__ */ __name(() => {
|
|
950
|
+
this.scrollElement.loopCSSProperty.current ? this.removeAttribute("disabled") : __privateGet(this, _step).current > 0 && this.scrollElement.scrollLine === "end" || __privateGet(this, _step).current < 0 && this.scrollElement.scrollLine === "start" ? this.setAttribute("disabled", "") : this.removeAttribute("disabled");
|
|
951
|
+
}, "#scrollLineListener"));
|
|
946
952
|
}
|
|
947
|
-
handleClick(
|
|
948
|
-
this.scrollElement.shiftSections(
|
|
953
|
+
handleClick(options) {
|
|
954
|
+
this.scrollElement.shiftSections(__privateGet(this, _step).current, options);
|
|
949
955
|
}
|
|
950
956
|
connectedCallback() {
|
|
951
|
-
super.connectedCallback(), this.scrollElement && (
|
|
952
|
-
|
|
953
|
-
}),
|
|
957
|
+
super.connectedCallback(), this.scrollElement && (__privateGet(this, _step).subscribe(() => {
|
|
958
|
+
__privateGet(this, _scrollLineListener).call(this);
|
|
959
|
+
}), __privateGet(this, _step).observe(), this.scrollElement.addEventListener(
|
|
954
960
|
"scrollLine",
|
|
955
|
-
|
|
956
|
-
),
|
|
961
|
+
__privateGet(this, _scrollLineListener)
|
|
962
|
+
), __privateGet(this, _scrollLineListener).call(this));
|
|
957
963
|
}
|
|
958
964
|
disconnectedCallback() {
|
|
959
|
-
super.disconnectedCallback(),
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
965
|
+
super.disconnectedCallback(), __privateGet(this, _step).close(), this.removeAttribute("disabled");
|
|
966
|
+
}
|
|
967
|
+
};
|
|
968
|
+
_step = new WeakMap(), _scrollLineListener = new WeakMap(), __name(_ScrollStepButtonElement, "ScrollStepButtonElement");
|
|
969
|
+
let ScrollStepButtonElement = _ScrollStepButtonElement;
|
|
970
|
+
isBrowser && !customElements.get("e-scroll-step-button") && customElements.define("e-scroll-step-button", ScrollStepButtonElement);
|
|
971
|
+
var _element2, _scrollElement3, _index2, _behaviour2, _clickListener, _counterChangeListener;
|
|
972
|
+
const _BulletButton = class _BulletButton {
|
|
973
|
+
constructor(scrollElement, index, behaviour) {
|
|
974
|
+
__privateAdd(this, _element2, null);
|
|
975
|
+
__privateAdd(this, _scrollElement3, null);
|
|
976
|
+
__privateAdd(this, _index2, null);
|
|
977
|
+
__privateAdd(this, _behaviour2, null);
|
|
978
|
+
__privateAdd(this, _clickListener, /* @__PURE__ */ __name(() => {
|
|
979
|
+
__privateGet(this, _scrollElement3).scrollToSection(__privateGet(this, _index2), {
|
|
980
|
+
behaviour: __privateGet(this, _behaviour2)
|
|
974
981
|
});
|
|
975
|
-
});
|
|
976
|
-
|
|
977
|
-
|
|
982
|
+
}, "#clickListener"));
|
|
983
|
+
__privateAdd(this, _counterChangeListener, /* @__PURE__ */ __name(() => {
|
|
984
|
+
__privateGet(this, _element2).classList.toggle(
|
|
978
985
|
"current",
|
|
979
|
-
|
|
986
|
+
__privateGet(this, _scrollElement3).counter.current === __privateGet(this, _index2)
|
|
980
987
|
);
|
|
981
|
-
});
|
|
982
|
-
|
|
988
|
+
}, "#counterChangeListener"));
|
|
989
|
+
isBrowser && (__privateSet(this, _element2, document.createElement("button")), __privateGet(this, _element2).setAttribute("aria-label", `Go to section ${index + 1}`), __privateSet(this, _scrollElement3, scrollElement), __privateSet(this, _behaviour2, behaviour), __privateSet(this, _index2, index), __privateGet(this, _element2).addEventListener("click", __privateGet(this, _clickListener)), __privateGet(this, _scrollElement3).counter.subscribe(__privateGet(this, _counterChangeListener)), __privateGet(this, _counterChangeListener).call(this));
|
|
983
990
|
}
|
|
984
991
|
get element() {
|
|
985
|
-
return
|
|
992
|
+
return __privateGet(this, _element2);
|
|
986
993
|
}
|
|
987
994
|
destroy() {
|
|
988
|
-
|
|
995
|
+
__privateGet(this, _element2).removeEventListener("click", __privateGet(this, _clickListener)), __privateGet(this, _scrollElement3).counter.unsubscribe(__privateGet(this, _counterChangeListener)), __privateGet(this, _element2).remove();
|
|
989
996
|
}
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
997
|
+
};
|
|
998
|
+
_element2 = new WeakMap(), _scrollElement3 = new WeakMap(), _index2 = new WeakMap(), _behaviour2 = new WeakMap(), _clickListener = new WeakMap(), _counterChangeListener = new WeakMap(), __name(_BulletButton, "BulletButton");
|
|
999
|
+
let BulletButton = _BulletButton;
|
|
1000
|
+
var _contentElement2, _buttons, _sectionsChangeListener;
|
|
1001
|
+
const _ScrollBulletButtonsElement = class _ScrollBulletButtonsElement extends ScrollUserElement {
|
|
994
1002
|
constructor() {
|
|
995
1003
|
super(...arguments);
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
let
|
|
1001
|
-
this.scrollElement.loopCSSProperty.current ?
|
|
1002
|
-
for (let
|
|
1003
|
-
const
|
|
1004
|
+
__privateAdd(this, _contentElement2, null);
|
|
1005
|
+
__privateAdd(this, _buttons, []);
|
|
1006
|
+
__privateAdd(this, _sectionsChangeListener, debounce(() => {
|
|
1007
|
+
__privateGet(this, _buttons).forEach((b) => b.destroy()), __privateSet(this, _buttons, []);
|
|
1008
|
+
let length = 0;
|
|
1009
|
+
this.scrollElement.loopCSSProperty.current ? length = this.scrollElement.visibleSections.length : length = this.scrollElement.visibleSections.length - Math.max(this.scrollElement.sectionsInViewCSSProperty.current - 1, 0);
|
|
1010
|
+
for (let index = 0; index < length; index++) {
|
|
1011
|
+
const button = new BulletButton(
|
|
1004
1012
|
this.scrollElement,
|
|
1005
|
-
|
|
1013
|
+
index,
|
|
1006
1014
|
this.getAttribute("behaviour") || "smooth"
|
|
1007
1015
|
);
|
|
1008
|
-
|
|
1016
|
+
__privateGet(this, _contentElement2).appendChild(button.element), __privateGet(this, _buttons).push(button);
|
|
1009
1017
|
}
|
|
1010
1018
|
}, 0));
|
|
1011
1019
|
}
|
|
1012
1020
|
connectedCallback() {
|
|
1013
|
-
super.connectedCallback(), this.innerHTML = "",
|
|
1021
|
+
super.connectedCallback(), this.innerHTML = "", __privateSet(this, _contentElement2, document.createElement("div")), this.appendChild(__privateGet(this, _contentElement2)), this.scrollElement.addEventListener(
|
|
1014
1022
|
"scrollSectionsChange",
|
|
1015
|
-
|
|
1023
|
+
__privateGet(this, _sectionsChangeListener)
|
|
1016
1024
|
), this.scrollElement.sectionsInViewCSSProperty.subscribe(
|
|
1017
|
-
|
|
1018
|
-
), this.scrollElement.loopCSSProperty.subscribe(
|
|
1025
|
+
__privateGet(this, _sectionsChangeListener)
|
|
1026
|
+
), this.scrollElement.loopCSSProperty.subscribe(__privateGet(this, _sectionsChangeListener)), __privateGet(this, _sectionsChangeListener).call(this);
|
|
1019
1027
|
}
|
|
1020
1028
|
disconnectedCallback() {
|
|
1021
1029
|
this.scrollElement.removeEventListener(
|
|
1022
1030
|
"scrollSectionsChange",
|
|
1023
|
-
|
|
1031
|
+
__privateGet(this, _sectionsChangeListener)
|
|
1024
1032
|
), this.scrollElement.sectionsInViewCSSProperty.unsubscribe(
|
|
1025
|
-
|
|
1026
|
-
), this.scrollElement.loopCSSProperty.unsubscribe(
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
+
__privateGet(this, _sectionsChangeListener)
|
|
1034
|
+
), this.scrollElement.loopCSSProperty.unsubscribe(__privateGet(this, _sectionsChangeListener)), __privateGet(this, _buttons).forEach((b) => b.destroy()), __privateSet(this, _buttons, []), __privateGet(this, _contentElement2).remove();
|
|
1035
|
+
}
|
|
1036
|
+
};
|
|
1037
|
+
_contentElement2 = new WeakMap(), _buttons = new WeakMap(), _sectionsChangeListener = new WeakMap(), __name(_ScrollBulletButtonsElement, "ScrollBulletButtonsElement");
|
|
1038
|
+
let ScrollBulletButtonsElement = _ScrollBulletButtonsElement;
|
|
1039
|
+
isBrowser && !customElements.get("e-scroll-bullet-buttons") && customElements.define("e-scroll-bullet-buttons", ScrollBulletButtonsElement);
|
|
1040
|
+
var _dampingCSSProperty2, _massCSSProperty2, _stiffnessCSSProperty2, _targetCSSProperty, _disabledCSSProperty2, _distanceOffsetCSSProperty, _startOffsetCSSProperty, _captureOnceCSSProperty, _capturedCSSProperty, _releasedCSSProperty, _capturedFromStartCSSProperty, _capturedFromFinishCSSProperty, _releasedFromStartCSSProperty, _releasedFromFinishCSSProperty, _passedVarCSSProperty, _progressVarCSSProperty, _progressArcVarCSSProperty, _progressArcMultCSSProperty, _animationVarTypeCSSProperty, _distanceVarCSSProperty, _startVarCSSProperty, _finishVarCSSProperty, _isCaptured, _isReleased, _isCapturedFromStart, _isReleasedFromStart, _isCapturedFromFinish, _isReleasedFromFinish, _anotherScrollEntries, _targetElement, _directionPosition, _directionSize, _moverDirectionSize, _passed, _progress, _start, _distance2, _finish, _isResized, _isCapturedOnce, _isDisabled, _skipPassNotification, _ScrollSegmentElement_instances, captureListener_fn, releaseListener_fn, captureFromStartListener_fn, captureFromFinishListener_fn, releaseFromStartListener_fn, releaseFromFinishListener_fn, _resizeListener3, _tickListener, updateProgress_fn, handleClassSetting_fn, removeClasses_fn, removeVars_fn, removeCurrentMarks_fn;
|
|
1041
|
+
const _ScrollSegmentElement = class _ScrollSegmentElement extends ScrollUserElement {
|
|
1033
1042
|
constructor() {
|
|
1034
1043
|
super(...arguments);
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1044
|
+
__privateAdd(this, _ScrollSegmentElement_instances);
|
|
1045
|
+
__privateAdd(this, _dampingCSSProperty2);
|
|
1046
|
+
__privateAdd(this, _massCSSProperty2);
|
|
1047
|
+
__privateAdd(this, _stiffnessCSSProperty2);
|
|
1048
|
+
__privateAdd(this, _targetCSSProperty);
|
|
1049
|
+
__privateAdd(this, _disabledCSSProperty2);
|
|
1050
|
+
__privateAdd(this, _distanceOffsetCSSProperty);
|
|
1051
|
+
__privateAdd(this, _startOffsetCSSProperty);
|
|
1052
|
+
__privateAdd(this, _captureOnceCSSProperty);
|
|
1053
|
+
__privateAdd(this, _capturedCSSProperty);
|
|
1054
|
+
__privateAdd(this, _releasedCSSProperty);
|
|
1055
|
+
__privateAdd(this, _capturedFromStartCSSProperty);
|
|
1056
|
+
__privateAdd(this, _capturedFromFinishCSSProperty);
|
|
1057
|
+
__privateAdd(this, _releasedFromStartCSSProperty);
|
|
1058
|
+
__privateAdd(this, _releasedFromFinishCSSProperty);
|
|
1059
|
+
__privateAdd(this, _passedVarCSSProperty);
|
|
1060
|
+
__privateAdd(this, _progressVarCSSProperty);
|
|
1061
|
+
__privateAdd(this, _progressArcVarCSSProperty);
|
|
1062
|
+
__privateAdd(this, _progressArcMultCSSProperty);
|
|
1063
|
+
__privateAdd(this, _animationVarTypeCSSProperty);
|
|
1064
|
+
__privateAdd(this, _distanceVarCSSProperty);
|
|
1065
|
+
__privateAdd(this, _startVarCSSProperty);
|
|
1066
|
+
__privateAdd(this, _finishVarCSSProperty);
|
|
1067
|
+
__privateAdd(this, _isCaptured);
|
|
1068
|
+
__privateAdd(this, _isReleased);
|
|
1069
|
+
__privateAdd(this, _isCapturedFromStart);
|
|
1070
|
+
__privateAdd(this, _isReleasedFromStart);
|
|
1071
|
+
__privateAdd(this, _isCapturedFromFinish);
|
|
1072
|
+
__privateAdd(this, _isReleasedFromFinish);
|
|
1073
|
+
__privateAdd(this, _anotherScrollEntries);
|
|
1074
|
+
__privateAdd(this, _targetElement);
|
|
1075
|
+
__privateAdd(this, _directionPosition);
|
|
1076
|
+
__privateAdd(this, _directionSize);
|
|
1077
|
+
__privateAdd(this, _moverDirectionSize);
|
|
1078
|
+
__privateAdd(this, _passed);
|
|
1079
|
+
__privateAdd(this, _progress);
|
|
1080
|
+
__privateAdd(this, _start);
|
|
1081
|
+
__privateAdd(this, _distance2);
|
|
1082
|
+
__privateAdd(this, _finish);
|
|
1083
|
+
__privateAdd(this, _isResized);
|
|
1084
|
+
__privateAdd(this, _isCapturedOnce);
|
|
1085
|
+
__privateAdd(this, _isDisabled);
|
|
1086
|
+
__privateAdd(this, _skipPassNotification);
|
|
1087
|
+
__privateAdd(this, _resizeListener3);
|
|
1088
|
+
__privateAdd(this, _tickListener);
|
|
1089
|
+
__privateSet(this, _dampingCSSProperty2, new CSSProperty(this, "--damping", 20)), __privateSet(this, _massCSSProperty2, new CSSProperty(this, "--mass", 0)), __privateSet(this, _stiffnessCSSProperty2, new CSSProperty(this, "--stiffness", 0)), __privateSet(this, _targetCSSProperty, new CSSProperty(this, "--target", "")), __privateSet(this, _disabledCSSProperty2, new CSSProperty(this, "--disabled", !1)), __privateSet(this, _distanceOffsetCSSProperty, new CSSProperty(
|
|
1081
1090
|
this,
|
|
1082
1091
|
"--distance-offset",
|
|
1083
1092
|
0,
|
|
1084
1093
|
{ rawValueCheck: !1 }
|
|
1085
|
-
)),
|
|
1094
|
+
)), __privateSet(this, _startOffsetCSSProperty, new CSSProperty(this, "--start-offset", 0, {
|
|
1086
1095
|
rawValueCheck: !1
|
|
1087
|
-
})),
|
|
1096
|
+
})), __privateSet(this, _captureOnceCSSProperty, new CSSProperty(
|
|
1088
1097
|
this,
|
|
1089
1098
|
"--capture-once",
|
|
1090
1099
|
!1
|
|
1091
|
-
)),
|
|
1100
|
+
)), __privateSet(this, _capturedCSSProperty, new CSSProperty(this, "--captured", "")), __privateSet(this, _releasedCSSProperty, new CSSProperty(this, "--released", "")), __privateSet(this, _capturedFromStartCSSProperty, new CSSProperty(
|
|
1092
1101
|
this,
|
|
1093
1102
|
"--captured-from-start",
|
|
1094
1103
|
""
|
|
1095
|
-
)),
|
|
1104
|
+
)), __privateSet(this, _capturedFromFinishCSSProperty, new CSSProperty(
|
|
1096
1105
|
this,
|
|
1097
1106
|
"--captured-from-finish",
|
|
1098
1107
|
""
|
|
1099
|
-
)),
|
|
1108
|
+
)), __privateSet(this, _releasedFromStartCSSProperty, new CSSProperty(
|
|
1100
1109
|
this,
|
|
1101
1110
|
"--released-from-start",
|
|
1102
1111
|
""
|
|
1103
|
-
)),
|
|
1112
|
+
)), __privateSet(this, _releasedFromFinishCSSProperty, new CSSProperty(
|
|
1104
1113
|
this,
|
|
1105
1114
|
"--released-from-finish",
|
|
1106
1115
|
""
|
|
1107
|
-
)),
|
|
1116
|
+
)), __privateSet(this, _passedVarCSSProperty, new CSSProperty(this, "--passed-var", "")), __privateSet(this, _progressVarCSSProperty, new CSSProperty(this, "--progress-var", "")), __privateSet(this, _progressArcVarCSSProperty, new CSSProperty(
|
|
1108
1117
|
this,
|
|
1109
1118
|
"--progress-arc-var",
|
|
1110
1119
|
""
|
|
1111
|
-
)),
|
|
1120
|
+
)), __privateSet(this, _progressArcMultCSSProperty, new CSSProperty(
|
|
1112
1121
|
this,
|
|
1113
1122
|
"--progress-arc-mult",
|
|
1114
1123
|
1
|
|
1115
|
-
)),
|
|
1124
|
+
)), __privateSet(this, _animationVarTypeCSSProperty, new CSSProperty(
|
|
1116
1125
|
this,
|
|
1117
1126
|
"--animation-var-type",
|
|
1118
1127
|
"target"
|
|
1119
|
-
)),
|
|
1120
|
-
|
|
1121
|
-
const
|
|
1128
|
+
)), __privateSet(this, _distanceVarCSSProperty, new CSSProperty(this, "--distance-var", "")), __privateSet(this, _startVarCSSProperty, new CSSProperty(this, "--start-var", "")), __privateSet(this, _finishVarCSSProperty, new CSSProperty(this, "--finish-var", "")), __privateSet(this, _isCaptured, new Store(!1)), __privateSet(this, _isReleased, new Store(!1)), __privateSet(this, _isCapturedFromStart, new Store(!1)), __privateSet(this, _isReleasedFromStart, new Store(!1)), __privateSet(this, _isCapturedFromFinish, new Store(!1)), __privateSet(this, _isReleasedFromFinish, new Store(!1)), __privateSet(this, _anotherScrollEntries, []), __privateSet(this, _targetElement, this), __privateSet(this, _directionPosition, 0), __privateSet(this, _directionSize, 0), __privateSet(this, _moverDirectionSize, 0), __privateSet(this, _passed, new Damped(0, { order: TICK_ORDER.SEGMENT, min: 0, max: 1 })), __privateSet(this, _progress, 0), __privateSet(this, _start, 0), __privateSet(this, _distance2, 0), __privateSet(this, _finish, 0), __privateSet(this, _isResized, !1), __privateSet(this, _isCapturedOnce, !1), __privateSet(this, _isDisabled, !0), __privateSet(this, _skipPassNotification, !1), this.resize = () => {
|
|
1129
|
+
__privateSet(this, _directionSize, this.scrollElement.vertical ? this.offsetHeight : this.offsetWidth), __privateSet(this, _directionPosition, this.scrollElement.vertical ? getCumulativeOffsetTop(this, this.scrollElement) : getCumulativeOffsetLeft(this, this.scrollElement));
|
|
1130
|
+
const stickyOffset = getStickyOffset(
|
|
1122
1131
|
this,
|
|
1123
1132
|
this.scrollElement.vertical ? "top" : "left"
|
|
1124
1133
|
);
|
|
1125
|
-
|
|
1126
|
-
}, this.findAnotherScrollEntries =
|
|
1127
|
-
const
|
|
1128
|
-
let
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
}),
|
|
1132
|
-
}, 0),
|
|
1133
|
-
|
|
1134
|
-
}),
|
|
1135
|
-
!
|
|
1134
|
+
__privateSet(this, _directionPosition, __privateGet(this, _directionPosition) - stickyOffset), __privateSet(this, _start, this.getStart()), __privateSet(this, _distance2, this.getDistance()), __privateSet(this, _start, __privateGet(this, _start) + __privateGet(this, _startOffsetCSSProperty).current), __privateSet(this, _distance2, __privateGet(this, _distance2) + __privateGet(this, _distanceOffsetCSSProperty).current), __privateSet(this, _finish, __privateGet(this, _start) + __privateGet(this, _distance2)), this.scrollElement.currentScrollValue > __privateGet(this, _finish) && !__privateGet(this, _isCaptured).current && !__privateGet(this, _isReleased).current && (__privateGet(this, _isCaptured).current = !0), this.setVar(__privateGet(this, _startVarCSSProperty).current, __privateGet(this, _start)), this.setVar(__privateGet(this, _finishVarCSSProperty).current, __privateGet(this, _finish)), this.setVar(__privateGet(this, _distanceVarCSSProperty).current, __privateGet(this, _distance2)), __privateGet(this, _passed).max = __privateGet(this, _distance2), __privateSet(this, _isResized, !0), __privateGet(this, _tickListener).call(this);
|
|
1135
|
+
}, this.findAnotherScrollEntries = debounce(() => {
|
|
1136
|
+
const allScrollEntriesAbove = scrollEntries.getAll(this).reverse();
|
|
1137
|
+
let scrollIndex = 0;
|
|
1138
|
+
allScrollEntriesAbove.forEach((entry, i) => {
|
|
1139
|
+
entry.element === this.scrollElement && (scrollIndex = i);
|
|
1140
|
+
}), __privateSet(this, _anotherScrollEntries, allScrollEntriesAbove.slice(scrollIndex + 1)), this.tick();
|
|
1141
|
+
}, 0), __privateSet(this, _resizeListener3, () => {
|
|
1142
|
+
__privateGet(this, _isDisabled) || this.resize();
|
|
1143
|
+
}), __privateSet(this, _tickListener, () => {
|
|
1144
|
+
!__privateGet(this, _isDisabled) && __privateGet(this, _isResized) && this.tick();
|
|
1136
1145
|
});
|
|
1137
1146
|
}
|
|
1138
1147
|
get distanceOffsetCSSProperty() {
|
|
1139
|
-
return
|
|
1148
|
+
return __privateGet(this, _distanceOffsetCSSProperty);
|
|
1140
1149
|
}
|
|
1141
1150
|
get startOffsetCSSProperty() {
|
|
1142
|
-
return
|
|
1151
|
+
return __privateGet(this, _startOffsetCSSProperty);
|
|
1143
1152
|
}
|
|
1144
1153
|
get captureOnceCSSProperty() {
|
|
1145
|
-
return
|
|
1154
|
+
return __privateGet(this, _captureOnceCSSProperty);
|
|
1146
1155
|
}
|
|
1147
1156
|
get capturedCSSProperty() {
|
|
1148
|
-
return
|
|
1157
|
+
return __privateGet(this, _capturedCSSProperty);
|
|
1149
1158
|
}
|
|
1150
1159
|
get releasedCSSProperty() {
|
|
1151
|
-
return
|
|
1160
|
+
return __privateGet(this, _releasedCSSProperty);
|
|
1152
1161
|
}
|
|
1153
1162
|
get capturedFromStartCSSProperty() {
|
|
1154
|
-
return
|
|
1163
|
+
return __privateGet(this, _capturedFromStartCSSProperty);
|
|
1155
1164
|
}
|
|
1156
1165
|
get capturedFromFinishCSSProperty() {
|
|
1157
|
-
return
|
|
1166
|
+
return __privateGet(this, _capturedFromFinishCSSProperty);
|
|
1158
1167
|
}
|
|
1159
1168
|
get releasedFromStartCSSProperty() {
|
|
1160
|
-
return
|
|
1169
|
+
return __privateGet(this, _releasedFromStartCSSProperty);
|
|
1161
1170
|
}
|
|
1162
1171
|
get releasedFromFinishCSSProperty() {
|
|
1163
|
-
return
|
|
1172
|
+
return __privateGet(this, _releasedFromFinishCSSProperty);
|
|
1164
1173
|
}
|
|
1165
1174
|
get passedVarCSSProperty() {
|
|
1166
|
-
return
|
|
1175
|
+
return __privateGet(this, _passedVarCSSProperty);
|
|
1167
1176
|
}
|
|
1168
1177
|
get progressVarCSSProperty() {
|
|
1169
|
-
return
|
|
1178
|
+
return __privateGet(this, _progressVarCSSProperty);
|
|
1170
1179
|
}
|
|
1171
1180
|
get progressArcVarCSSProperty() {
|
|
1172
|
-
return
|
|
1181
|
+
return __privateGet(this, _progressArcVarCSSProperty);
|
|
1173
1182
|
}
|
|
1174
1183
|
get progressArcMultCSSProperty() {
|
|
1175
|
-
return
|
|
1184
|
+
return __privateGet(this, _progressArcMultCSSProperty);
|
|
1176
1185
|
}
|
|
1177
1186
|
get animationVarTypeCSSProperty() {
|
|
1178
|
-
return
|
|
1187
|
+
return __privateGet(this, _animationVarTypeCSSProperty);
|
|
1179
1188
|
}
|
|
1180
1189
|
get distanceVarCSSProperty() {
|
|
1181
|
-
return
|
|
1190
|
+
return __privateGet(this, _distanceVarCSSProperty);
|
|
1182
1191
|
}
|
|
1183
1192
|
get startVarCSSProperty() {
|
|
1184
|
-
return
|
|
1193
|
+
return __privateGet(this, _startVarCSSProperty);
|
|
1185
1194
|
}
|
|
1186
1195
|
get finishVarCSSProperty() {
|
|
1187
|
-
return
|
|
1196
|
+
return __privateGet(this, _finishVarCSSProperty);
|
|
1188
1197
|
}
|
|
1189
1198
|
get disabledCSSProperty() {
|
|
1190
|
-
return
|
|
1199
|
+
return __privateGet(this, _disabledCSSProperty2);
|
|
1191
1200
|
}
|
|
1192
1201
|
get dampingCSSProperty() {
|
|
1193
|
-
return
|
|
1202
|
+
return __privateGet(this, _dampingCSSProperty2);
|
|
1194
1203
|
}
|
|
1195
1204
|
get massCSSProperty() {
|
|
1196
|
-
return
|
|
1205
|
+
return __privateGet(this, _massCSSProperty2);
|
|
1197
1206
|
}
|
|
1198
1207
|
get stiffnessCSSProperty() {
|
|
1199
|
-
return
|
|
1208
|
+
return __privateGet(this, _stiffnessCSSProperty2);
|
|
1200
1209
|
}
|
|
1201
1210
|
get targetCSSProperty() {
|
|
1202
|
-
return
|
|
1211
|
+
return __privateGet(this, _targetCSSProperty);
|
|
1203
1212
|
}
|
|
1204
1213
|
get isCaptured() {
|
|
1205
|
-
return
|
|
1214
|
+
return __privateGet(this, _isCaptured);
|
|
1206
1215
|
}
|
|
1207
1216
|
get isReleased() {
|
|
1208
|
-
return
|
|
1217
|
+
return __privateGet(this, _isReleased);
|
|
1209
1218
|
}
|
|
1210
1219
|
get isCapturedFromStart() {
|
|
1211
|
-
return
|
|
1220
|
+
return __privateGet(this, _isCapturedFromStart);
|
|
1212
1221
|
}
|
|
1213
1222
|
get isReleasedFromStart() {
|
|
1214
|
-
return
|
|
1223
|
+
return __privateGet(this, _isReleasedFromStart);
|
|
1215
1224
|
}
|
|
1216
1225
|
get isCapturedFromFinish() {
|
|
1217
|
-
return
|
|
1226
|
+
return __privateGet(this, _isCapturedFromFinish);
|
|
1218
1227
|
}
|
|
1219
1228
|
get isReleasedFromFinish() {
|
|
1220
|
-
return
|
|
1229
|
+
return __privateGet(this, _isReleasedFromFinish);
|
|
1221
1230
|
}
|
|
1222
1231
|
get directionPosition() {
|
|
1223
|
-
return
|
|
1232
|
+
return __privateGet(this, _directionPosition);
|
|
1224
1233
|
}
|
|
1225
1234
|
get directionSize() {
|
|
1226
|
-
return
|
|
1235
|
+
return __privateGet(this, _directionSize);
|
|
1227
1236
|
}
|
|
1228
1237
|
get passed() {
|
|
1229
|
-
return
|
|
1238
|
+
return __privateGet(this, _passed);
|
|
1230
1239
|
}
|
|
1231
1240
|
get progress() {
|
|
1232
|
-
return
|
|
1241
|
+
return __privateGet(this, _progress);
|
|
1233
1242
|
}
|
|
1234
1243
|
get progressArc() {
|
|
1235
|
-
return Math.abs(Math.cos(
|
|
1244
|
+
return Math.abs(Math.cos(__privateGet(this, _progress) * Math.PI)) * __privateGet(this, _progressArcMultCSSProperty).current;
|
|
1236
1245
|
}
|
|
1237
1246
|
get start() {
|
|
1238
|
-
return
|
|
1247
|
+
return __privateGet(this, _start);
|
|
1239
1248
|
}
|
|
1240
1249
|
get finish() {
|
|
1241
|
-
return
|
|
1250
|
+
return __privateGet(this, _finish);
|
|
1242
1251
|
}
|
|
1243
1252
|
get distance() {
|
|
1244
|
-
return
|
|
1253
|
+
return __privateGet(this, _distance2);
|
|
1245
1254
|
}
|
|
1246
1255
|
get isCapturedOnce() {
|
|
1247
|
-
return
|
|
1256
|
+
return __privateGet(this, _isCapturedOnce);
|
|
1248
1257
|
}
|
|
1249
1258
|
get isDisabled() {
|
|
1250
|
-
return
|
|
1259
|
+
return __privateGet(this, _isDisabled);
|
|
1251
1260
|
}
|
|
1252
1261
|
tick() {
|
|
1253
|
-
let
|
|
1254
|
-
|
|
1255
|
-
|
|
1262
|
+
let scrollValue = this.scrollElement.currentScrollValue;
|
|
1263
|
+
__privateGet(this, _anotherScrollEntries).forEach((se) => {
|
|
1264
|
+
scrollValue += se.value;
|
|
1256
1265
|
});
|
|
1257
|
-
const
|
|
1258
|
-
|
|
1259
|
-
const
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
),
|
|
1266
|
+
const delta = scrollValue - __privateGet(this, _start);
|
|
1267
|
+
__privateGet(this, _skipPassNotification) || __privateSet(this, _skipPassNotification, __privateGet(this, _passed).previous ? Math.abs(__privateGet(this, _passed).previous - delta) > 1e3 : !1), __privateGet(this, _passed).set(delta);
|
|
1268
|
+
const fscrollValue = Math.round(scrollValue);
|
|
1269
|
+
__privateGet(this, _isCaptured).current && (fscrollValue >= __privateGet(this, _start) ? __privateGet(this, _isCapturedFromStart).current || __privateMethod(this, _ScrollSegmentElement_instances, captureFromStartListener_fn).call(this) : __privateGet(this, _isCapturedFromStart).current && !__privateGet(this, _isReleasedFromStart).current && __privateMethod(this, _ScrollSegmentElement_instances, releaseFromStartListener_fn).call(this), fscrollValue < __privateGet(this, _finish) ? __privateGet(this, _isReleasedFromFinish).current && !__privateGet(this, _isCapturedFromFinish).current && __privateMethod(this, _ScrollSegmentElement_instances, captureFromFinishListener_fn).call(this) : __privateGet(this, _isCapturedFromStart).current && !__privateGet(this, _isReleasedFromFinish).current && __privateMethod(this, _ScrollSegmentElement_instances, releaseFromFinishListener_fn).call(this)), fscrollValue >= __privateGet(this, _start) && fscrollValue < __privateGet(this, _finish) ? __privateGet(this, _isCaptured).current || __privateMethod(this, _ScrollSegmentElement_instances, captureListener_fn).call(this) : __privateGet(this, _isCaptured).current && (__privateGet(this, _passed).set(
|
|
1270
|
+
step(__privateGet(this, _distance2) / 2, __privateGet(this, _passed).target, 0, __privateGet(this, _distance2))
|
|
1271
|
+
), __privateMethod(this, _ScrollSegmentElement_instances, releaseListener_fn).call(this)), __privateGet(this, _isCapturedOnce) && __privateGet(this, _captureOnceCSSProperty).current && (__privateGet(this, _capturedCSSProperty).current && __privateGet(this, _targetElement).classList.add(__privateGet(this, _capturedCSSProperty).current), __privateSet(this, _isDisabled, !0));
|
|
1263
1272
|
}
|
|
1264
1273
|
disable() {
|
|
1265
|
-
this.style.cssText = "",
|
|
1274
|
+
this.style.cssText = "", __privateSet(this, _directionPosition, 0), __privateSet(this, _directionSize, 0), __privateGet(this, _passed).reset(), __privateSet(this, _progress, 0), __privateSet(this, _start, 0), __privateSet(this, _distance2, 0), __privateSet(this, _finish, 0), __privateSet(this, _isResized, !1), __privateGet(this, _isCaptured).current = !1, __privateGet(this, _isReleased).current = !1, __privateGet(this, _isCapturedFromStart).current = !1, __privateGet(this, _isReleasedFromStart).current = !1, __privateGet(this, _isCapturedFromFinish).current = !1, __privateGet(this, _isReleasedFromFinish).current = !1, __privateSet(this, _isCapturedOnce, !1), __privateSet(this, _isDisabled, !0), __privateMethod(this, _ScrollSegmentElement_instances, removeCurrentMarks_fn).call(this);
|
|
1266
1275
|
}
|
|
1267
1276
|
enable() {
|
|
1268
|
-
|
|
1277
|
+
__privateSet(this, _isDisabled, !1);
|
|
1269
1278
|
}
|
|
1270
1279
|
connectedCallback() {
|
|
1271
|
-
super.connectedCallback(),
|
|
1272
|
-
|
|
1280
|
+
super.connectedCallback(), __privateGet(this, _isCaptured).subscribe((state) => {
|
|
1281
|
+
state.current && dispatchEvent(this, "scrollSegmentCapture", {
|
|
1273
1282
|
composed: !0,
|
|
1274
1283
|
custom: !0
|
|
1275
1284
|
});
|
|
1276
|
-
}),
|
|
1277
|
-
|
|
1285
|
+
}), __privateGet(this, _isCapturedFromStart).subscribe((state) => {
|
|
1286
|
+
state.current && dispatchEvent(this, "scrollSegmentCaptureFromStart", {
|
|
1278
1287
|
composed: !0,
|
|
1279
1288
|
custom: !0
|
|
1280
1289
|
});
|
|
1281
|
-
}),
|
|
1282
|
-
|
|
1290
|
+
}), __privateGet(this, _isCapturedFromFinish).subscribe((state) => {
|
|
1291
|
+
state.current && dispatchEvent(this, "scrollSegmentCaptureFromFinish", {
|
|
1283
1292
|
composed: !0,
|
|
1284
1293
|
custom: !0
|
|
1285
1294
|
});
|
|
1286
|
-
}),
|
|
1287
|
-
|
|
1295
|
+
}), __privateGet(this, _isReleased).subscribe((state) => {
|
|
1296
|
+
state.current && dispatchEvent(this, "scrollSegmentRelease", {
|
|
1288
1297
|
composed: !0,
|
|
1289
1298
|
custom: !0
|
|
1290
1299
|
});
|
|
1291
|
-
}),
|
|
1292
|
-
|
|
1300
|
+
}), __privateGet(this, _isReleasedFromStart).subscribe((state) => {
|
|
1301
|
+
state.current && dispatchEvent(this, "scrollSegmentReleaseFromStart", {
|
|
1293
1302
|
composed: !0,
|
|
1294
1303
|
custom: !0
|
|
1295
1304
|
});
|
|
1296
|
-
}),
|
|
1297
|
-
|
|
1305
|
+
}), __privateGet(this, _isReleasedFromFinish).subscribe((state) => {
|
|
1306
|
+
state.current && dispatchEvent(this, "scrollSegmentReleaseFromFinish", {
|
|
1298
1307
|
composed: !0,
|
|
1299
1308
|
custom: !0
|
|
1300
1309
|
});
|
|
1301
|
-
}),
|
|
1302
|
-
let
|
|
1303
|
-
this.findAnotherScrollEntries(),
|
|
1304
|
-
|
|
1305
|
-
}),
|
|
1306
|
-
|
|
1307
|
-
}),
|
|
1308
|
-
|
|
1309
|
-
}),
|
|
1310
|
-
|
|
1311
|
-
}),
|
|
1312
|
-
|
|
1313
|
-
}),
|
|
1314
|
-
|
|
1315
|
-
}),
|
|
1316
|
-
|
|
1317
|
-
}),
|
|
1318
|
-
|
|
1319
|
-
}),
|
|
1320
|
-
|
|
1321
|
-
}),
|
|
1322
|
-
|
|
1323
|
-
}),
|
|
1324
|
-
|
|
1325
|
-
}),
|
|
1326
|
-
|
|
1327
|
-
}),
|
|
1328
|
-
|
|
1329
|
-
}),
|
|
1330
|
-
|
|
1331
|
-
}),
|
|
1332
|
-
|
|
1333
|
-
}),
|
|
1334
|
-
|
|
1335
|
-
}),
|
|
1336
|
-
|
|
1337
|
-
}),
|
|
1338
|
-
|
|
1339
|
-
}),
|
|
1340
|
-
|
|
1341
|
-
}),
|
|
1342
|
-
|
|
1343
|
-
}),
|
|
1344
|
-
|
|
1345
|
-
}),
|
|
1346
|
-
if (
|
|
1347
|
-
|
|
1310
|
+
}), __privateGet(this, _dampingCSSProperty2).observe(), __privateGet(this, _massCSSProperty2).observe(), __privateGet(this, _stiffnessCSSProperty2).observe(), __privateGet(this, _targetCSSProperty).observe(), __privateGet(this, _disabledCSSProperty2).observe(), __privateGet(this, _distanceOffsetCSSProperty).observe(), __privateGet(this, _startOffsetCSSProperty).observe(), __privateGet(this, _captureOnceCSSProperty).observe(), __privateGet(this, _capturedCSSProperty).observe(), __privateGet(this, _releasedCSSProperty).observe(), __privateGet(this, _capturedFromStartCSSProperty).observe(), __privateGet(this, _capturedFromFinishCSSProperty).observe(), __privateGet(this, _releasedFromStartCSSProperty).observe(), __privateGet(this, _releasedFromFinishCSSProperty).observe(), __privateGet(this, _passedVarCSSProperty).observe(), __privateGet(this, _progressVarCSSProperty).observe(), __privateGet(this, _progressArcVarCSSProperty).observe(), __privateGet(this, _progressArcMultCSSProperty).observe(), __privateGet(this, _animationVarTypeCSSProperty).observe(), __privateGet(this, _distanceVarCSSProperty).observe(), __privateGet(this, _startVarCSSProperty).observe(), __privateGet(this, _finishVarCSSProperty).observe();
|
|
1311
|
+
let isConnected = !1;
|
|
1312
|
+
this.findAnotherScrollEntries(), __privateGet(this, _disabledCSSProperty2).current || this.enable(), __privateGet(this, _dampingCSSProperty2).subscribe((e) => {
|
|
1313
|
+
__privateGet(this, _passed).damping = e.current;
|
|
1314
|
+
}), __privateGet(this, _massCSSProperty2).subscribe((e) => {
|
|
1315
|
+
__privateGet(this, _passed).mass = e.current;
|
|
1316
|
+
}), __privateGet(this, _stiffnessCSSProperty2).subscribe((e) => {
|
|
1317
|
+
__privateGet(this, _passed).stiffness = e.current;
|
|
1318
|
+
}), __privateGet(this, _targetCSSProperty).subscribe((e) => {
|
|
1319
|
+
e.previous && __privateMethod(this, _ScrollSegmentElement_instances, removeCurrentMarks_fn).call(this), e.current ? e.current === "parent" ? __privateSet(this, _targetElement, this.parentElement || this) : __privateSet(this, _targetElement, document.querySelector(e.current) || this) : __privateSet(this, _targetElement, this);
|
|
1320
|
+
}), __privateGet(this, _disabledCSSProperty2).subscribe((e) => {
|
|
1321
|
+
e.current && !e.previous ? this.disable() : !e.current && e.previous && (this.resize(), this.enable());
|
|
1322
|
+
}), __privateGet(this, _startOffsetCSSProperty).subscribe(() => {
|
|
1323
|
+
isConnected && !__privateGet(this, _isDisabled) && this.resize();
|
|
1324
|
+
}), __privateGet(this, _distanceOffsetCSSProperty).subscribe(() => {
|
|
1325
|
+
isConnected && !__privateGet(this, _isDisabled) && this.resize();
|
|
1326
|
+
}), __privateGet(this, _capturedCSSProperty).subscribe((e) => {
|
|
1327
|
+
__privateMethod(this, _ScrollSegmentElement_instances, handleClassSetting_fn).call(this, e);
|
|
1328
|
+
}), __privateGet(this, _capturedFromStartCSSProperty).subscribe((e) => {
|
|
1329
|
+
__privateMethod(this, _ScrollSegmentElement_instances, handleClassSetting_fn).call(this, e);
|
|
1330
|
+
}), __privateGet(this, _capturedFromFinishCSSProperty).subscribe((e) => {
|
|
1331
|
+
__privateMethod(this, _ScrollSegmentElement_instances, handleClassSetting_fn).call(this, e);
|
|
1332
|
+
}), __privateGet(this, _releasedCSSProperty).subscribe((e) => {
|
|
1333
|
+
__privateMethod(this, _ScrollSegmentElement_instances, handleClassSetting_fn).call(this, e);
|
|
1334
|
+
}), __privateGet(this, _releasedFromStartCSSProperty).subscribe((e) => {
|
|
1335
|
+
__privateMethod(this, _ScrollSegmentElement_instances, handleClassSetting_fn).call(this, e);
|
|
1336
|
+
}), __privateGet(this, _releasedFromFinishCSSProperty).subscribe((e) => {
|
|
1337
|
+
__privateMethod(this, _ScrollSegmentElement_instances, handleClassSetting_fn).call(this, e);
|
|
1338
|
+
}), __privateGet(this, _captureOnceCSSProperty).subscribe((v) => {
|
|
1339
|
+
__privateGet(this, _isDisabled) || !v.current && v.previous && (this.resize(), this.enable());
|
|
1340
|
+
}), __privateGet(this, _passedVarCSSProperty).subscribe((v) => {
|
|
1341
|
+
__privateGet(this, _isDisabled) || (this.removeVar(v.previous), this.setVar(v.current, this.passed.current));
|
|
1342
|
+
}), __privateGet(this, _progressVarCSSProperty).subscribe((v) => {
|
|
1343
|
+
__privateGet(this, _isDisabled) || (this.removeVar(v.previous), this.setVar(v.current, __privateGet(this, _progress)));
|
|
1344
|
+
}), __privateGet(this, _progressArcVarCSSProperty).subscribe((v) => {
|
|
1345
|
+
__privateGet(this, _isDisabled) || (this.removeVar(v.previous), this.setVar(v.current, this.progressArc));
|
|
1346
|
+
}), __privateGet(this, _progressArcMultCSSProperty).subscribe((v) => {
|
|
1347
|
+
__privateGet(this, _isDisabled) || __privateMethod(this, _ScrollSegmentElement_instances, updateProgress_fn).call(this);
|
|
1348
|
+
}), __privateGet(this, _startVarCSSProperty).subscribe((v) => {
|
|
1349
|
+
__privateGet(this, _isDisabled) || (this.removeVar(v.previous), this.setVar(v.current, __privateGet(this, _start)));
|
|
1350
|
+
}), __privateGet(this, _finishVarCSSProperty).subscribe((v) => {
|
|
1351
|
+
__privateGet(this, _isDisabled) || (this.removeVar(v.previous), this.setVar(v.current, __privateGet(this, _finish)));
|
|
1352
|
+
}), __privateGet(this, _distanceVarCSSProperty).subscribe((v) => {
|
|
1353
|
+
__privateGet(this, _isDisabled) || (this.removeVar(v.previous), this.setVar(v.current, __privateGet(this, _distance2)));
|
|
1354
|
+
}), __privateGet(this, _passed).subscribe((e) => {
|
|
1355
|
+
if (__privateGet(this, _skipPassNotification)) {
|
|
1356
|
+
__privateSet(this, _skipPassNotification, !1);
|
|
1348
1357
|
return;
|
|
1349
1358
|
}
|
|
1350
|
-
|
|
1359
|
+
__privateMethod(this, _ScrollSegmentElement_instances, updateProgress_fn).call(this);
|
|
1351
1360
|
}), this.scrollElement.addEventListener(
|
|
1352
1361
|
"scrollSectionsChange",
|
|
1353
1362
|
this.findAnotherScrollEntries
|
|
1354
|
-
), this.scrollElement.addEventListener("scrollResize", this.resize),
|
|
1363
|
+
), this.scrollElement.addEventListener("scrollResize", this.resize), windowResizer.subscribe(__privateGet(this, _resizeListener3), RESIZE_ORDER.SCROLL + 1), this.scrollElement.onScroll(__privateGet(this, _tickListener)), isConnected = !0;
|
|
1355
1364
|
}
|
|
1356
1365
|
disconnectedCallback() {
|
|
1357
|
-
|
|
1366
|
+
windowResizer.unsubscribe(__privateGet(this, _resizeListener3)), this.scrollElement.offScroll(__privateGet(this, _tickListener)), this.scrollElement.removeEventListener(
|
|
1358
1367
|
"scrollSectionsChange",
|
|
1359
1368
|
this.findAnotherScrollEntries
|
|
1360
|
-
), this.scrollElement.removeEventListener("scrollResize", this.resize),
|
|
1369
|
+
), this.scrollElement.removeEventListener("scrollResize", this.resize), __privateGet(this, _dampingCSSProperty2).close(), __privateGet(this, _massCSSProperty2).close(), __privateGet(this, _stiffnessCSSProperty2).close(), __privateGet(this, _targetCSSProperty).close(), __privateGet(this, _disabledCSSProperty2).close(), __privateGet(this, _distanceOffsetCSSProperty).close(), __privateGet(this, _startOffsetCSSProperty).close(), __privateGet(this, _captureOnceCSSProperty).close(), __privateGet(this, _capturedCSSProperty).close(), __privateGet(this, _releasedCSSProperty).close(), __privateGet(this, _capturedFromStartCSSProperty).close(), __privateGet(this, _capturedFromFinishCSSProperty).close(), __privateGet(this, _releasedFromStartCSSProperty).close(), __privateGet(this, _releasedFromFinishCSSProperty).close(), __privateGet(this, _passedVarCSSProperty).close(), __privateGet(this, _progressVarCSSProperty).close(), __privateGet(this, _progressArcVarCSSProperty).close(), __privateGet(this, _progressArcMultCSSProperty).close(), __privateGet(this, _distanceVarCSSProperty).close(), __privateGet(this, _startVarCSSProperty).close(), __privateGet(this, _finishVarCSSProperty).close(), __privateGet(this, _isCaptured).close(), __privateGet(this, _isReleased).close(), __privateGet(this, _isCapturedFromStart).close(), __privateGet(this, _isReleasedFromStart).close(), __privateGet(this, _isCapturedFromFinish).close(), __privateGet(this, _isReleasedFromFinish).close(), this.disable(), __privateGet(this, _passed).close();
|
|
1361
1370
|
}
|
|
1362
|
-
removeVar(
|
|
1363
|
-
|
|
1371
|
+
removeVar(name) {
|
|
1372
|
+
name && __privateGet(this, _targetElement).style.removeProperty(`--${name}`);
|
|
1364
1373
|
}
|
|
1365
|
-
setVar(
|
|
1366
|
-
if (
|
|
1367
|
-
const
|
|
1368
|
-
|
|
1374
|
+
setVar(name, value) {
|
|
1375
|
+
if (name) {
|
|
1376
|
+
const v = typeof value == "number" ? value.toFixed(6) : value;
|
|
1377
|
+
__privateGet(this, _targetElement).style.setProperty(`--${name}`, v);
|
|
1369
1378
|
}
|
|
1370
1379
|
}
|
|
1371
1380
|
getDistance() {
|
|
1372
|
-
return
|
|
1381
|
+
return __privateGet(this, _directionSize) + __privateGet(this, _moverDirectionSize);
|
|
1373
1382
|
}
|
|
1374
1383
|
getStart() {
|
|
1375
|
-
return
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
),
|
|
1382
|
-
|
|
1383
|
-
),
|
|
1384
|
-
},
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
),
|
|
1388
|
-
|
|
1389
|
-
),
|
|
1390
|
-
},
|
|
1391
|
-
|
|
1392
|
-
|
|
1384
|
+
return __privateGet(this, _directionPosition) - __privateGet(this, _moverDirectionSize);
|
|
1385
|
+
}
|
|
1386
|
+
};
|
|
1387
|
+
_dampingCSSProperty2 = new WeakMap(), _massCSSProperty2 = new WeakMap(), _stiffnessCSSProperty2 = new WeakMap(), _targetCSSProperty = new WeakMap(), _disabledCSSProperty2 = new WeakMap(), _distanceOffsetCSSProperty = new WeakMap(), _startOffsetCSSProperty = new WeakMap(), _captureOnceCSSProperty = new WeakMap(), _capturedCSSProperty = new WeakMap(), _releasedCSSProperty = new WeakMap(), _capturedFromStartCSSProperty = new WeakMap(), _capturedFromFinishCSSProperty = new WeakMap(), _releasedFromStartCSSProperty = new WeakMap(), _releasedFromFinishCSSProperty = new WeakMap(), _passedVarCSSProperty = new WeakMap(), _progressVarCSSProperty = new WeakMap(), _progressArcVarCSSProperty = new WeakMap(), _progressArcMultCSSProperty = new WeakMap(), _animationVarTypeCSSProperty = new WeakMap(), _distanceVarCSSProperty = new WeakMap(), _startVarCSSProperty = new WeakMap(), _finishVarCSSProperty = new WeakMap(), _isCaptured = new WeakMap(), _isReleased = new WeakMap(), _isCapturedFromStart = new WeakMap(), _isReleasedFromStart = new WeakMap(), _isCapturedFromFinish = new WeakMap(), _isReleasedFromFinish = new WeakMap(), _anotherScrollEntries = new WeakMap(), _targetElement = new WeakMap(), _directionPosition = new WeakMap(), _directionSize = new WeakMap(), _moverDirectionSize = new WeakMap(), _passed = new WeakMap(), _progress = new WeakMap(), _start = new WeakMap(), _distance2 = new WeakMap(), _finish = new WeakMap(), _isResized = new WeakMap(), _isCapturedOnce = new WeakMap(), _isDisabled = new WeakMap(), _skipPassNotification = new WeakMap(), _ScrollSegmentElement_instances = new WeakSet(), captureListener_fn = /* @__PURE__ */ __name(function() {
|
|
1388
|
+
__privateGet(this, _isCaptured).current = !0, __privateGet(this, _isReleased).current = !1, __privateSet(this, _isCapturedOnce, !0), __privateGet(this, _releasedCSSProperty).current && __privateGet(this, _targetElement).classList.remove(__privateGet(this, _releasedCSSProperty).current), __privateGet(this, _releasedFromFinishCSSProperty).current && __privateGet(this, _targetElement).classList.remove(
|
|
1389
|
+
__privateGet(this, _releasedFromFinishCSSProperty).current
|
|
1390
|
+
), __privateGet(this, _releasedFromFinishCSSProperty).current && __privateGet(this, _targetElement).classList.remove(
|
|
1391
|
+
__privateGet(this, _releasedFromFinishCSSProperty).current
|
|
1392
|
+
), __privateGet(this, _capturedCSSProperty).current && __privateGet(this, _targetElement).classList.add(__privateGet(this, _capturedCSSProperty).current);
|
|
1393
|
+
}, "#captureListener"), releaseListener_fn = /* @__PURE__ */ __name(function() {
|
|
1394
|
+
__privateGet(this, _isReleased).current = !0, __privateGet(this, _isCaptured).current = !1, __privateSet(this, _isCapturedOnce, !0), __privateGet(this, _capturedCSSProperty).current && __privateGet(this, _targetElement).classList.remove(__privateGet(this, _capturedCSSProperty).current), __privateGet(this, _capturedFromStartCSSProperty).current && __privateGet(this, _targetElement).classList.remove(
|
|
1395
|
+
__privateGet(this, _capturedFromStartCSSProperty).current
|
|
1396
|
+
), __privateGet(this, _capturedFromFinishCSSProperty).current && __privateGet(this, _targetElement).classList.remove(
|
|
1397
|
+
__privateGet(this, _capturedFromFinishCSSProperty).current
|
|
1398
|
+
), __privateGet(this, _releasedCSSProperty).current && __privateGet(this, _targetElement).classList.add(__privateGet(this, _releasedCSSProperty).current);
|
|
1399
|
+
}, "#releaseListener"), captureFromStartListener_fn = /* @__PURE__ */ __name(function() {
|
|
1400
|
+
__privateGet(this, _isCaptured).current = !0, __privateGet(this, _isCapturedFromStart).current = !0, __privateGet(this, _isReleasedFromStart).current = !1, __privateGet(this, _capturedFromStartCSSProperty).current && __privateGet(this, _targetElement).classList.add(
|
|
1401
|
+
__privateGet(this, _capturedFromStartCSSProperty).current
|
|
1393
1402
|
);
|
|
1394
|
-
},
|
|
1395
|
-
|
|
1396
|
-
|
|
1403
|
+
}, "#captureFromStartListener"), captureFromFinishListener_fn = /* @__PURE__ */ __name(function() {
|
|
1404
|
+
__privateGet(this, _isCaptured).current = !0, __privateGet(this, _isCapturedFromFinish).current = !0, __privateGet(this, _isReleasedFromFinish).current = !1, __privateGet(this, _capturedFromFinishCSSProperty).current && __privateGet(this, _targetElement).classList.add(
|
|
1405
|
+
__privateGet(this, _capturedFromFinishCSSProperty).current
|
|
1397
1406
|
);
|
|
1398
|
-
},
|
|
1399
|
-
|
|
1400
|
-
|
|
1407
|
+
}, "#captureFromFinishListener"), releaseFromStartListener_fn = /* @__PURE__ */ __name(function() {
|
|
1408
|
+
__privateGet(this, _isReleased).current = !0, __privateGet(this, _isReleasedFromStart).current = !0, __privateGet(this, _isCapturedFromStart).current = !1, __privateGet(this, _releasedFromFinishCSSProperty).current && __privateGet(this, _targetElement).classList.add(
|
|
1409
|
+
__privateGet(this, _releasedFromFinishCSSProperty).current
|
|
1401
1410
|
);
|
|
1402
|
-
},
|
|
1403
|
-
|
|
1404
|
-
|
|
1411
|
+
}, "#releaseFromStartListener"), releaseFromFinishListener_fn = /* @__PURE__ */ __name(function() {
|
|
1412
|
+
__privateGet(this, _isReleased).current = !0, __privateGet(this, _isReleasedFromFinish).current = !0, __privateGet(this, _isCapturedFromFinish).current = !1, __privateGet(this, _releasedFromFinishCSSProperty).current && __privateGet(this, _targetElement).classList.add(
|
|
1413
|
+
__privateGet(this, _releasedFromFinishCSSProperty).current
|
|
1405
1414
|
);
|
|
1406
|
-
},
|
|
1407
|
-
const
|
|
1408
|
-
this.setVar(
|
|
1409
|
-
},
|
|
1410
|
-
if (
|
|
1411
|
-
e.previous &&
|
|
1415
|
+
}, "#releaseFromFinishListener"), _resizeListener3 = new WeakMap(), _tickListener = new WeakMap(), updateProgress_fn = /* @__PURE__ */ __name(function() {
|
|
1416
|
+
const passedValue = __privateGet(this, _passed)[__privateGet(this, _animationVarTypeCSSProperty).current];
|
|
1417
|
+
this.setVar(__privateGet(this, _passedVarCSSProperty).current, passedValue), __privateSet(this, _progress, passedValue / __privateGet(this, _distance2) || 0), this.setVar(__privateGet(this, _progressVarCSSProperty).current, __privateGet(this, _progress)), __privateGet(this, _progressArcVarCSSProperty).current && this.setVar(__privateGet(this, _progressArcVarCSSProperty).current, this.progressArc);
|
|
1418
|
+
}, "#updateProgress"), handleClassSetting_fn = /* @__PURE__ */ __name(function(e) {
|
|
1419
|
+
if (__privateGet(this, _isDisabled)) {
|
|
1420
|
+
e.previous && __privateGet(this, _targetElement).classList.remove(e.previous), e.current && __privateGet(this, _targetElement).classList.remove(e.current);
|
|
1412
1421
|
return;
|
|
1413
1422
|
}
|
|
1414
|
-
e.current &&
|
|
1415
|
-
},
|
|
1416
|
-
|
|
1417
|
-
|
|
1423
|
+
e.current && __privateGet(this, _isCaptured).current ? (e.previous && __privateGet(this, _targetElement).classList.remove(e.previous), __privateGet(this, _targetElement).classList.add(e.current)) : !e.current && e.previous && __privateGet(this, _targetElement).classList.remove(e.previous);
|
|
1424
|
+
}, "#handleClassSetting"), removeClasses_fn = /* @__PURE__ */ __name(function(...className) {
|
|
1425
|
+
className.forEach((c) => {
|
|
1426
|
+
c && __privateGet(this, _targetElement).classList.remove(c);
|
|
1418
1427
|
});
|
|
1419
|
-
},
|
|
1420
|
-
|
|
1421
|
-
|
|
1428
|
+
}, "#removeClasses"), removeVars_fn = /* @__PURE__ */ __name(function(...vars) {
|
|
1429
|
+
vars.forEach((v) => {
|
|
1430
|
+
v && __privateGet(this, _targetElement).style.removeProperty(`--${v}`);
|
|
1422
1431
|
});
|
|
1423
|
-
},
|
|
1424
|
-
|
|
1425
|
-
};
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1432
|
+
}, "#removeVars"), removeCurrentMarks_fn = /* @__PURE__ */ __name(function() {
|
|
1433
|
+
__privateMethod(this, _ScrollSegmentElement_instances, removeClasses_fn).call(this, __privateGet(this, _capturedCSSProperty).current, __privateGet(this, _capturedFromStartCSSProperty).current, __privateGet(this, _capturedFromFinishCSSProperty).current, __privateGet(this, _releasedCSSProperty).current, __privateGet(this, _releasedFromStartCSSProperty).current, __privateGet(this, _releasedFromFinishCSSProperty).current), __privateMethod(this, _ScrollSegmentElement_instances, removeVars_fn).call(this, __privateGet(this, _passedVarCSSProperty).current, __privateGet(this, _progressVarCSSProperty).current, __privateGet(this, _progressArcVarCSSProperty).current, __privateGet(this, _distanceVarCSSProperty).current, __privateGet(this, _startVarCSSProperty).current, __privateGet(this, _finishVarCSSProperty).current);
|
|
1434
|
+
}, "#removeCurrentMarks"), __name(_ScrollSegmentElement, "ScrollSegmentElement");
|
|
1435
|
+
let ScrollSegmentElement = _ScrollSegmentElement;
|
|
1436
|
+
isBrowser && !customElements.get("e-scroll-segment") && customElements.define("e-scroll-segment", ScrollSegmentElement);
|
|
1437
|
+
const _ScrollSectionButtonElement = class _ScrollSectionButtonElement extends ScrollButtonElement {
|
|
1438
|
+
handleClick(options) {
|
|
1429
1439
|
this.scrollElement.setPosition(
|
|
1430
|
-
this.scrollElement.vertical ?
|
|
1431
|
-
|
|
1440
|
+
this.scrollElement.vertical ? getCumulativeOffsetTop(this) : getCumulativeOffsetLeft(this),
|
|
1441
|
+
options
|
|
1432
1442
|
);
|
|
1433
1443
|
}
|
|
1434
1444
|
connectedCallback() {
|
|
@@ -1437,68 +1447,70 @@ class Ri extends Bs {
|
|
|
1437
1447
|
disconnectedCallback() {
|
|
1438
1448
|
super.disconnectedCallback();
|
|
1439
1449
|
}
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1450
|
+
};
|
|
1451
|
+
__name(_ScrollSectionButtonElement, "ScrollSectionButtonElement");
|
|
1452
|
+
let ScrollSectionButtonElement = _ScrollSectionButtonElement;
|
|
1453
|
+
isBrowser && !customElements.get("e-scroll-section-button") && customElements.define("e-scroll-section-button", ScrollSectionButtonElement);
|
|
1454
|
+
var _counterChangeListener2;
|
|
1455
|
+
const _ScrollCounterElement = class _ScrollCounterElement extends ScrollUserElement {
|
|
1444
1456
|
constructor() {
|
|
1445
1457
|
super(...arguments);
|
|
1446
|
-
|
|
1447
|
-
const
|
|
1448
|
-
this.textContent =
|
|
1449
|
-
});
|
|
1458
|
+
__privateAdd(this, _counterChangeListener2, /* @__PURE__ */ __name(() => {
|
|
1459
|
+
const value = this.scrollElement.counter.current + 1, pad = parseInt(this.getAttribute("pad") || "0");
|
|
1460
|
+
this.textContent = value.toString().padStart(pad, "0");
|
|
1461
|
+
}, "#counterChangeListener"));
|
|
1450
1462
|
}
|
|
1451
1463
|
connectedCallback() {
|
|
1452
|
-
return
|
|
1453
|
-
|
|
1464
|
+
return __async(this, null, function* () {
|
|
1465
|
+
__superGet(_ScrollCounterElement.prototype, this, "connectedCallback").call(this), this.scrollElement.counter.subscribe(__privateGet(this, _counterChangeListener2));
|
|
1454
1466
|
});
|
|
1455
1467
|
}
|
|
1456
1468
|
disconnectedCallback() {
|
|
1457
|
-
this.scrollElement.counter.unsubscribe(
|
|
1469
|
+
this.scrollElement.counter.unsubscribe(__privateGet(this, _counterChangeListener2));
|
|
1458
1470
|
}
|
|
1459
1471
|
};
|
|
1460
|
-
|
|
1461
|
-
let
|
|
1462
|
-
|
|
1463
|
-
var
|
|
1464
|
-
const
|
|
1472
|
+
_counterChangeListener2 = new WeakMap(), __name(_ScrollCounterElement, "ScrollCounterElement");
|
|
1473
|
+
let ScrollCounterElement = _ScrollCounterElement;
|
|
1474
|
+
isBrowser && !customElements.get("e-scroll-counter") && customElements.define("e-scroll-counter", ScrollCounterElement);
|
|
1475
|
+
var _sectionsChangeListener2;
|
|
1476
|
+
const _ScrollTotalElement = class _ScrollTotalElement extends ScrollUserElement {
|
|
1465
1477
|
constructor() {
|
|
1466
1478
|
super(...arguments);
|
|
1467
|
-
|
|
1468
|
-
const
|
|
1469
|
-
this.textContent =
|
|
1470
|
-
});
|
|
1479
|
+
__privateAdd(this, _sectionsChangeListener2, /* @__PURE__ */ __name(() => {
|
|
1480
|
+
const value = this.scrollElement.limit + 1, pad = parseInt(this.getAttribute("pad") || "0");
|
|
1481
|
+
this.textContent = value.toString().padStart(pad, "0");
|
|
1482
|
+
}, "#sectionsChangeListener"));
|
|
1471
1483
|
}
|
|
1472
1484
|
connectedCallback() {
|
|
1473
|
-
return
|
|
1474
|
-
|
|
1475
|
-
|
|
1485
|
+
return __async(this, null, function* () {
|
|
1486
|
+
__superGet(_ScrollTotalElement.prototype, this, "connectedCallback").call(this), this.scrollElement.sectionsInViewCSSProperty.subscribe(
|
|
1487
|
+
__privateGet(this, _sectionsChangeListener2)
|
|
1476
1488
|
), this.scrollElement.addEventListener(
|
|
1477
1489
|
"scrollSectionsChange",
|
|
1478
|
-
|
|
1479
|
-
),
|
|
1490
|
+
__privateGet(this, _sectionsChangeListener2)
|
|
1491
|
+
), __privateGet(this, _sectionsChangeListener2).call(this);
|
|
1480
1492
|
});
|
|
1481
1493
|
}
|
|
1482
1494
|
disconnectedCallback() {
|
|
1483
1495
|
this.scrollElement.sectionsInViewCSSProperty.unsubscribe(
|
|
1484
|
-
|
|
1496
|
+
__privateGet(this, _sectionsChangeListener2)
|
|
1485
1497
|
), this.scrollElement.removeEventListener(
|
|
1486
1498
|
"scrollSectionsChange",
|
|
1487
|
-
|
|
1499
|
+
__privateGet(this, _sectionsChangeListener2)
|
|
1488
1500
|
);
|
|
1489
1501
|
}
|
|
1490
1502
|
};
|
|
1491
|
-
|
|
1492
|
-
let
|
|
1493
|
-
|
|
1503
|
+
_sectionsChangeListener2 = new WeakMap(), __name(_ScrollTotalElement, "ScrollTotalElement");
|
|
1504
|
+
let ScrollTotalElement = _ScrollTotalElement;
|
|
1505
|
+
isBrowser && !customElements.get("e-scroll-total") && customElements.define("e-scroll-total", ScrollTotalElement);
|
|
1494
1506
|
export {
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1507
|
+
ScrollBulletButtonsElement,
|
|
1508
|
+
ScrollCounterElement,
|
|
1509
|
+
ScrollElement,
|
|
1510
|
+
ScrollScrollbarElement,
|
|
1511
|
+
ScrollSectionButtonElement,
|
|
1512
|
+
ScrollSegmentElement,
|
|
1513
|
+
ScrollSetButtonElement,
|
|
1514
|
+
ScrollStepButtonElement,
|
|
1515
|
+
ScrollTotalElement
|
|
1504
1516
|
};
|