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