aptechka 0.83.1 → 0.84.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Animation-BUD5w3AB.js +110 -0
- package/lib/Animation-BtUdarQ7.cjs +1 -0
- package/lib/Composed-BI5oe4Ij.cjs +1 -0
- package/lib/Composed-BaevH-MP.js +75 -0
- package/lib/Damped-BHm2IuyN.cjs +1 -0
- package/lib/Damped-Ds17AUU-.js +57 -0
- package/lib/DerivedArray-BePrxcLC.js +63 -0
- package/lib/DerivedArray-xYBpcTp8.cjs +1 -0
- package/lib/DragControls-BgTBgiue.js +233 -0
- package/lib/DragControls-FmiuZDKq.cjs +1 -0
- package/lib/LocalLinks-BdqYzt1b.js +65 -0
- package/lib/LocalLinks-D1mYcA-B.cjs +1 -0
- package/lib/PageAnnouncerElement-CJ-MfwJ8.cjs +1 -0
- package/lib/PageAnnouncerElement-HcphPbXZ.js +28 -0
- package/lib/PageScroll-CrfCwDA4.js +65 -0
- package/lib/PageScroll-IlOCUUte.cjs +1 -0
- package/lib/SourceElement-DC726HMy.js +265 -0
- package/lib/SourceElement-DNyrQby1.cjs +5 -0
- package/lib/Store-BRTHeZmO.js +158 -0
- package/lib/Store-DZnOrofs.cjs +1 -0
- package/lib/Tweened-3UYSwrvs.cjs +1 -0
- package/lib/Tweened-DabaFaHX.js +48 -0
- package/lib/Viewport-0n1C_IoN.js +113 -0
- package/lib/Viewport-D26fEJOk.cjs +1 -0
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +97 -93
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +6 -6
- package/lib/api-fetcher/index.cjs +1 -1
- package/lib/api-fetcher/index.js +67 -66
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +37 -34
- package/lib/attributes-BADnRZpK.cjs +1 -0
- package/lib/attributes-FObgMNCf.js +36 -0
- package/lib/billboard/index.cjs +1 -1
- package/lib/billboard/index.js +240 -232
- package/lib/cache/index.cjs +1 -1
- package/lib/cache/index.js +26 -23
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +61 -59
- package/lib/canvas-BP1ceie3.cjs +1 -0
- package/lib/canvas-DsglKco1.js +40 -0
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.js +44 -41
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +6 -6
- package/lib/coordinates--JG1U6kQ.js +29 -0
- package/lib/coordinates-DQ9XV9M1.cjs +1 -0
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.d.ts +1 -1
- package/lib/css-property/index.js +40 -37
- package/lib/css-unit-parser/index.cjs +2 -2
- package/lib/css-unit-parser/index.js +22 -19
- package/lib/css-value-parser/index.cjs +1 -1
- package/lib/css-value-parser/index.js +13 -11
- package/lib/custom-elements-BfZCJde6.cjs +1 -0
- package/lib/custom-elements-HEMuF7yH.js +27 -0
- package/lib/dev/index.cjs +2 -1
- package/lib/dev/index.d.ts +1 -0
- package/lib/dev/index.js +24 -10
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +5 -5
- package/lib/dom-B40i6NXw.cjs +1 -0
- package/lib/dom-D8D-_9ty.js +108 -0
- package/lib/easings-BSGJFMAo.js +40 -0
- package/lib/easings-BWq0pPLq.cjs +1 -0
- package/lib/element-CqD0jqBJ.cjs +1 -0
- package/lib/element-DKw5H-Tu.js +10 -0
- package/lib/element-linked-store/index.cjs +1 -1
- package/lib/element-linked-store/index.js +53 -52
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.js +47 -44
- package/lib/en3/index.cjs +4 -4
- package/lib/en3/index.js +191 -185
- package/lib/events-Ds-TuvYW.js +9 -0
- package/lib/events-UlGk63iC.cjs +1 -0
- package/lib/file-DwQs6bB6.js +28 -0
- package/lib/file-RHfA3OS-.cjs +1 -0
- package/lib/function-H4b_gTg6.cjs +1 -0
- package/lib/function-UmbPrOHm.js +19 -0
- package/lib/gestures-DmKKNnh4.js +14 -0
- package/lib/gestures-DtYbQr49.cjs +1 -0
- package/lib/history/index.cjs +1 -1
- package/lib/history/index.js +24 -21
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +27 -24
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +17 -13
- package/lib/index-ClTMVKJp.js +183 -0
- package/lib/index-DZ44osDT.cjs +1 -0
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.js +3 -3
- package/lib/jsx/ComponentElement.d.ts +4 -0
- package/lib/jsx/h.d.ts +7 -16
- package/lib/jsx/hooks/component/useStylesheet.d.ts +1 -1
- package/lib/jsx/hooks/cssProperty.d.ts +6 -0
- package/lib/jsx/hooks/resize.d.ts +4 -0
- package/lib/jsx/hooks/store.d.ts +1 -2
- package/lib/jsx/hooks/ticker.d.ts +5 -0
- package/lib/jsx/index.cjs +1 -1
- package/lib/jsx/index.d.ts +4 -4
- package/lib/jsx/index.js +170 -349
- package/lib/jsx/plugins/vite/index.cjs +49 -0
- package/lib/jsx/plugins/vite/index.d.ts +38 -0
- package/lib/jsx/plugins/vite/index.js +104 -0
- package/lib/jsx/render.d.ts +2 -0
- package/lib/jsx/type.d.ts +228 -190
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +86 -84
- package/lib/layout-C26zkY7D.js +35 -0
- package/lib/layout-CnGLl7oe.cjs +1 -0
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +220 -217
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.js +48 -45
- package/lib/local-links/index.cjs +1 -1
- package/lib/local-links/index.js +2 -2
- package/lib/masonry-layout/index.cjs +1 -1
- package/lib/masonry-layout/index.js +48 -45
- package/lib/math-C-knY2TL.cjs +1 -0
- package/lib/math-r8V23YFe.js +57 -0
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +28 -25
- package/lib/metadata-BNdkmeeD.js +15 -0
- package/lib/metadata-BrHUfpV9.cjs +1 -0
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +561 -556
- package/lib/morph-BtgB1YQP.js +256 -0
- package/lib/morph-Buhxq-X0.cjs +1 -0
- package/lib/need_redo_tweaker/index.cjs +4 -4
- package/lib/need_redo_tweaker/index.js +862 -835
- package/lib/notifier/index.cjs +1 -1
- package/lib/notifier/index.js +29 -26
- package/lib/number-Bu4sGvW7.cjs +1 -0
- package/lib/number-DiVt2xnh.js +47 -0
- package/lib/object-CiIdEmJx.js +98 -0
- package/lib/object-DTY_W6xG.cjs +1 -0
- package/lib/order/index.cjs +1 -1
- package/lib/order/index.js +3 -3
- package/lib/page-announcer/index.cjs +1 -1
- package/lib/page-announcer/index.js +2 -2
- package/lib/page-scroll/index.cjs +1 -1
- package/lib/page-scroll/index.js +2 -2
- package/lib/pixel-perfect/index.cjs +4 -4
- package/lib/pixel-perfect/index.js +43 -40
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +125 -123
- package/lib/polyfills-CG1XJNia.js +28 -0
- package/lib/polyfills-DZCuDBkA.cjs +1 -0
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +249 -245
- package/lib/radio/index.cjs +1 -1
- package/lib/radio/index.js +58 -55
- package/lib/render-H9BjFLZ3.cjs +1 -0
- package/lib/render-LpimRXgl.js +354 -0
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +196 -194
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +890 -878
- package/lib/scroll-D2tOpCnP.cjs +1 -0
- package/lib/scroll-DoNeuIgT.js +41 -0
- package/lib/scroll-entries/index.cjs +1 -1
- package/lib/scroll-entries/index.js +37 -34
- package/lib/scroll-kit/index.cjs +1 -1
- package/lib/scroll-kit/index.js +213 -209
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +102 -98
- package/lib/size-element/index.cjs +1 -1
- package/lib/size-element/index.js +29 -26
- package/lib/slicer/index.cjs +1 -1
- package/lib/slicer/index.js +118 -113
- package/lib/source/index.cjs +1 -1
- package/lib/source/index.js +5 -5
- package/lib/spa/index.cjs +1 -1
- package/lib/spa/index.js +94 -94
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.d.ts +2 -2
- package/lib/store/index.js +10 -8
- package/lib/string-B3lm2b7v.js +84 -0
- package/lib/string-CbRNzmd9.cjs +1 -0
- package/lib/style-DBoQWK0d.js +14 -0
- package/lib/style-IDJ6db6n.cjs +1 -0
- package/lib/stylesheet-CBTuup4f.js +28 -0
- package/lib/stylesheet-xM7sMeuo.cjs +1 -0
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.js +4 -120
- package/lib/url-CPCO10Sy.cjs +1 -0
- package/lib/url-CWCY_qe_.js +124 -0
- package/lib/utils/attributes.d.ts +2 -0
- package/lib/utils/dom.d.ts +1 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +260 -226
- package/lib/utils/polyfills.d.ts +1 -1
- package/lib/utils/timeouts.d.ts +6 -1
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +35 -33
- package/lib/window-resizer/index.cjs +1 -1
- package/lib/window-resizer/index.js +27 -24
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +56 -54
- package/package.json +11 -24
- package/lib/Animation-BzTjZIE-.js +0 -108
- package/lib/Animation-C39Ah-LM.cjs +0 -1
- package/lib/Composed-C-TV9te3.cjs +0 -1
- package/lib/Composed-DyAWjEXE.js +0 -121
- package/lib/Damped-CRusiRIV.js +0 -56
- package/lib/Damped-Prr0iKu1.cjs +0 -1
- package/lib/DragControls-8rNZwQrs.cjs +0 -1
- package/lib/DragControls-DBNdMBA4.js +0 -228
- package/lib/LocalLinks-BxhSFv_Q.cjs +0 -1
- package/lib/LocalLinks-DFZFpbjs.js +0 -62
- package/lib/PageAnnouncerElement-0LxZjtVH.js +0 -24
- package/lib/PageAnnouncerElement-AQ0Ja6HM.cjs +0 -1
- package/lib/PageScroll-0LxFblry.js +0 -62
- package/lib/PageScroll-BXJUQwG7.cjs +0 -1
- package/lib/SourceElement-BHqPFbna.cjs +0 -5
- package/lib/SourceElement-DjbHjynf.js +0 -260
- package/lib/Store-Blf4msDz.cjs +0 -1
- package/lib/Store-ZThXYBQd.js +0 -152
- package/lib/Tweened-Bw1Cn1PJ.js +0 -47
- package/lib/Tweened-DWtk9E-O.cjs +0 -1
- package/lib/Viewport-BxCr0GlB.cjs +0 -1
- package/lib/Viewport-Dt-d9DPi.js +0 -109
- package/lib/attributes-69we3byR.js +0 -10
- package/lib/attributes-Bf2svn4j.cjs +0 -1
- package/lib/canvas-CU5Xjahf.cjs +0 -1
- package/lib/canvas-DeZ0SLUJ.js +0 -34
- package/lib/coordinates-CgdGoSYs.js +0 -24
- package/lib/coordinates-D8Np3cPD.cjs +0 -1
- package/lib/custom-elements-DBnCK7Zx.js +0 -24
- package/lib/custom-elements-Dh4TWRDJ.cjs +0 -1
- package/lib/dom-BETkVSSZ.js +0 -82
- package/lib/dom-CBLlqORw.cjs +0 -1
- package/lib/easings-BEmRlrDd.js +0 -38
- package/lib/easings-GegIwET5.cjs +0 -1
- package/lib/element-CGVl1jA-.js +0 -7
- package/lib/element-yhcBhsho.cjs +0 -1
- package/lib/events-CsVF98U6.js +0 -6
- package/lib/events-KVanG9sR.cjs +0 -1
- package/lib/file-DSpfWdd9.cjs +0 -1
- package/lib/file-GHShUlue.js +0 -24
- package/lib/function-C10DGppn.js +0 -17
- package/lib/function-MthRj-GJ.cjs +0 -1
- package/lib/gestures-C7gbKx11.cjs +0 -1
- package/lib/gestures-CcXV6fCp.js +0 -11
- package/lib/index-OE2INULi.cjs +0 -1
- package/lib/index-e9eDuagL.js +0 -65
- package/lib/jsx/hydrate.d.ts +0 -1
- package/lib/jsx/integrations/astro/client.cjs +0 -1
- package/lib/jsx/integrations/astro/client.d.ts +0 -2
- package/lib/jsx/integrations/astro/client.js +0 -50
- package/lib/jsx/integrations/astro/index.cjs +0 -1
- package/lib/jsx/integrations/astro/index.d.ts +0 -2
- package/lib/jsx/integrations/astro/index.js +0 -54
- package/lib/jsx/integrations/astro/server.cjs +0 -1
- package/lib/jsx/integrations/astro/server.d.ts +0 -3
- package/lib/jsx/integrations/astro/server.js +0 -35
- package/lib/jsx/plugins/vite.d.ts +0 -21
- package/lib/layout-BSMtwCga.js +0 -29
- package/lib/layout-Ctc2p3uz.cjs +0 -1
- package/lib/math-BOBiC4TN.js +0 -45
- package/lib/math-GDWEqu7y.cjs +0 -1
- package/lib/metadata-BcYZ5w3T.cjs +0 -1
- package/lib/metadata-jfowcCyz.js +0 -12
- package/lib/morph-B6sGhLCi.cjs +0 -1
- package/lib/morph-BQErz7qP.js +0 -242
- package/lib/number-ChAm68cm.cjs +0 -1
- package/lib/number-CumqY64S.js +0 -40
- package/lib/object-CcMK4y_r.js +0 -87
- package/lib/object-baN9pgbU.cjs +0 -1
- package/lib/polyfills-DJrTJQky.js +0 -24
- package/lib/polyfills-Df4r-ETT.cjs +0 -1
- package/lib/render-DQs7rIoN.cjs +0 -1
- package/lib/render-D_0FCWEu.js +0 -18
- package/lib/scroll-BA2WnUrb.cjs +0 -1
- package/lib/scroll-DY5senkF.js +0 -37
- package/lib/string-BlMQbe8b.js +0 -70
- package/lib/string-DUXXtU8v.cjs +0 -1
- package/lib/style-At6aDoqG.cjs +0 -1
- package/lib/style-j2TwriJ_.js +0 -10
- package/lib/stylesheet-5_o7PFzM.cjs +0 -1
- package/lib/stylesheet-DdBzowZY.js +0 -24
- package/lib/url-CHgcNwJ1.cjs +0 -1
- package/lib/url-CYgo5vrG.js +0 -113
- package/lib/vite-C-i3hVDL.js +0 -75
- package/lib/vite-DzanPumM.cjs +0 -44
package/lib/scroll-kit/index.js
CHANGED
|
@@ -1,86 +1,87 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __typeError = (msg) => {
|
|
3
|
+
throw TypeError(msg);
|
|
3
4
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import { f as
|
|
9
|
-
import { s as
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
|
|
6
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
7
|
+
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);
|
|
8
|
+
import { i as isBrowser, a as intersector, t as ticker } from "../index-ClTMVKJp.js";
|
|
9
|
+
import { f as findScrollParentElement } from "../dom-D8D-_9ty.js";
|
|
10
|
+
import { s as setupDrag } from "../gestures-DmKKNnh4.js";
|
|
10
11
|
import "construct-style-sheets-polyfill";
|
|
11
|
-
import { scrollEntries
|
|
12
|
-
import "../Store-
|
|
13
|
-
import { D as
|
|
14
|
-
import { CSSProperty
|
|
15
|
-
import { ElementLinkedStore
|
|
16
|
-
import { elementResizer
|
|
17
|
-
import { d as
|
|
18
|
-
import { a as
|
|
19
|
-
import { c as
|
|
20
|
-
import { windowResizer
|
|
21
|
-
var
|
|
22
|
-
class
|
|
12
|
+
import { scrollEntries } from "../scroll-entries/index.js";
|
|
13
|
+
import "../Store-BRTHeZmO.js";
|
|
14
|
+
import { D as Damped } from "../Damped-Ds17AUU-.js";
|
|
15
|
+
import { CSSProperty } from "../css-property/index.js";
|
|
16
|
+
import { ElementLinkedStore } from "../element-linked-store/index.js";
|
|
17
|
+
import { elementResizer } from "../element-resizer/index.js";
|
|
18
|
+
import { d as dispatchEvent } from "../events-Ds-TuvYW.js";
|
|
19
|
+
import { a as getCumulativeOffsetTop, b as getStickyOffset } from "../layout-C26zkY7D.js";
|
|
20
|
+
import { c as clamp } from "../math-r8V23YFe.js";
|
|
21
|
+
import { windowResizer } from "../window-resizer/index.js";
|
|
22
|
+
var _scrollElement, _thumbElement, _thumbScrollSize, _limit, _isHorizontal, _activeTimeoutId, _ScrollbarElement_instances, scrollPosition_get, scrollSize_get, scrollViewportSize_get, _scrollListener, _resizeListener, _grabListener, _tickListener, _intersectionListener;
|
|
23
|
+
const _ScrollbarElement = class _ScrollbarElement extends HTMLElement {
|
|
23
24
|
constructor() {
|
|
24
25
|
super(...arguments);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.classList.add("active"), clearTimeout(
|
|
34
|
-
const
|
|
35
|
-
|
|
26
|
+
__privateAdd(this, _ScrollbarElement_instances);
|
|
27
|
+
__privateAdd(this, _scrollElement, null);
|
|
28
|
+
__privateAdd(this, _thumbElement, null);
|
|
29
|
+
__privateAdd(this, _thumbScrollSize, 0);
|
|
30
|
+
__privateAdd(this, _limit, 0);
|
|
31
|
+
__privateAdd(this, _isHorizontal, !1);
|
|
32
|
+
__privateAdd(this, _activeTimeoutId);
|
|
33
|
+
__privateAdd(this, _scrollListener, /* @__PURE__ */ __name(() => {
|
|
34
|
+
this.classList.add("active"), clearTimeout(__privateGet(this, _activeTimeoutId));
|
|
35
|
+
const position = __privateGet(this, _ScrollbarElement_instances, scrollPosition_get) / __privateGet(this, _limit) * __privateGet(this, _thumbScrollSize);
|
|
36
|
+
__privateGet(this, _isHorizontal) ? __privateGet(this, _thumbElement).style.transform = `translate3d(${position}px, 0px, 0px)` : __privateGet(this, _thumbElement).style.transform = `translate3d(0px, ${position}px, 0px)`, __privateSet(this, _activeTimeoutId, setTimeout(() => {
|
|
36
37
|
this.classList.remove("active");
|
|
37
38
|
}, 1e3));
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
left:
|
|
39
|
+
}, "#scrollListener"));
|
|
40
|
+
__privateAdd(this, _resizeListener, /* @__PURE__ */ __name(() => {
|
|
41
|
+
const barSize = __privateGet(this, _isHorizontal) ? this.offsetWidth : this.offsetHeight, scrollSize = __privateGet(this, _ScrollbarElement_instances, scrollSize_get), viewportSize = __privateGet(this, _ScrollbarElement_instances, scrollViewportSize_get);
|
|
42
|
+
__privateSet(this, _limit, scrollSize - viewportSize);
|
|
43
|
+
let thumbSize = barSize * barSize / (__privateGet(this, _limit) + barSize);
|
|
44
|
+
thumbSize = Math.max(thumbSize, 30), __privateGet(this, _isHorizontal) ? (__privateGet(this, _thumbElement).style.width = thumbSize + "px", __privateGet(this, _thumbElement).style.height = "100%") : (__privateGet(this, _thumbElement).style.width = "100%", __privateGet(this, _thumbElement).style.height = thumbSize + "px"), __privateSet(this, _thumbScrollSize, barSize - thumbSize), scrollSize <= viewportSize ? this.style.display = "none" : this.style.display = "block";
|
|
45
|
+
}, "#resizeListener"));
|
|
46
|
+
__privateAdd(this, _grabListener, /* @__PURE__ */ __name((grabEvent) => {
|
|
47
|
+
const startValue = __privateGet(this, _ScrollbarElement_instances, scrollPosition_get), grabCursor = __privateGet(this, _isHorizontal) ? grabEvent.x : grabEvent.y;
|
|
48
|
+
setupDrag((moveEvent) => {
|
|
49
|
+
const mult = __privateGet(this, _limit) / __privateGet(this, _thumbScrollSize), delta = (__privateGet(this, _isHorizontal) ? moveEvent.x - grabCursor : moveEvent.y - grabCursor) * mult;
|
|
50
|
+
__privateGet(this, _isHorizontal) ? __privateGet(this, _scrollElement).scroll({
|
|
51
|
+
left: startValue + delta,
|
|
51
52
|
behavior: "instant"
|
|
52
|
-
}) :
|
|
53
|
-
top:
|
|
53
|
+
}) : __privateGet(this, _scrollElement).scroll({
|
|
54
|
+
top: startValue + delta,
|
|
54
55
|
behavior: "instant"
|
|
55
56
|
});
|
|
56
57
|
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
e.isIntersecting ? (
|
|
63
|
-
});
|
|
58
|
+
}, "#grabListener"));
|
|
59
|
+
__privateAdd(this, _tickListener, /* @__PURE__ */ __name(() => {
|
|
60
|
+
__privateGet(this, _resizeListener).call(this);
|
|
61
|
+
}, "#tickListener"));
|
|
62
|
+
__privateAdd(this, _intersectionListener, /* @__PURE__ */ __name((e) => {
|
|
63
|
+
e.isIntersecting ? (ticker.subscribe(__privateGet(this, _tickListener), { maxFPS: 5 }), __privateGet(this, _tickListener).call(this)) : ticker.unsubscribe(__privateGet(this, _tickListener));
|
|
64
|
+
}, "#intersectionListener"));
|
|
64
65
|
}
|
|
65
66
|
connectedCallback() {
|
|
66
|
-
const
|
|
67
|
-
let
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
67
|
+
const scrollSelector = this.getAttribute("data-scroll");
|
|
68
|
+
let scrollElement = null;
|
|
69
|
+
scrollSelector && (scrollSelector === "parent" ? scrollElement = this.parentElement : scrollElement = document.querySelector(scrollSelector)), scrollElement || (scrollElement = findScrollParentElement(this), scrollElement === document.body && (scrollElement = window)), __privateSet(this, _isHorizontal, this.hasAttribute("horisontal"));
|
|
70
|
+
const thumbElement = this.querySelector("[data-thumb]");
|
|
71
|
+
scrollElement && thumbElement && (__privateSet(this, _scrollElement, scrollElement), __privateSet(this, _thumbElement, thumbElement), __privateGet(this, _scrollElement).addEventListener("scroll", __privateGet(this, _scrollListener)), __privateGet(this, _thumbElement).addEventListener("pointerdown", __privateGet(this, _grabListener)), intersector.subscribe(
|
|
71
72
|
this.parentElement === document.body ? this : this.parentElement,
|
|
72
|
-
|
|
73
|
+
__privateGet(this, _intersectionListener)
|
|
73
74
|
));
|
|
74
75
|
}
|
|
75
76
|
disconnectedCallback() {
|
|
76
|
-
var
|
|
77
|
-
(
|
|
77
|
+
var _a, _b;
|
|
78
|
+
(_a = __privateGet(this, _scrollElement)) == null || _a.removeEventListener("scroll", __privateGet(this, _scrollListener)), (_b = __privateGet(this, _thumbElement)) == null || _b.removeEventListener("pointerdown", __privateGet(this, _grabListener)), clearTimeout(__privateGet(this, _activeTimeoutId)), intersector.unsubscribe(__privateGet(this, _intersectionListener)), ticker.unsubscribe(__privateGet(this, _tickListener));
|
|
78
79
|
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return
|
|
82
|
-
},
|
|
83
|
-
return
|
|
80
|
+
};
|
|
81
|
+
_scrollElement = new WeakMap(), _thumbElement = new WeakMap(), _thumbScrollSize = new WeakMap(), _limit = new WeakMap(), _isHorizontal = new WeakMap(), _activeTimeoutId = new WeakMap(), _ScrollbarElement_instances = new WeakSet(), scrollPosition_get = /* @__PURE__ */ __name(function() {
|
|
82
|
+
return __privateGet(this, _scrollElement) instanceof HTMLElement ? __privateGet(this, _isHorizontal) ? __privateGet(this, _scrollElement).scrollLeft : __privateGet(this, _scrollElement).scrollTop : __privateGet(this, _isHorizontal) ? __privateGet(this, _scrollElement).scrollX : __privateGet(this, _scrollElement).scrollY;
|
|
83
|
+
}, "#scrollPosition"), scrollSize_get = /* @__PURE__ */ __name(function() {
|
|
84
|
+
return __privateGet(this, _scrollElement) instanceof HTMLElement ? __privateGet(this, _isHorizontal) ? __privateGet(this, _scrollElement).scrollWidth : __privateGet(this, _scrollElement).scrollHeight : __privateGet(this, _isHorizontal) ? Math.max(
|
|
84
85
|
document.body.scrollWidth,
|
|
85
86
|
document.documentElement.scrollWidth,
|
|
86
87
|
document.body.offsetWidth,
|
|
@@ -95,11 +96,12 @@ h = new WeakMap(), b = new WeakMap(), R = new WeakMap(), H = new WeakMap(), a =
|
|
|
95
96
|
document.body.clientHeight,
|
|
96
97
|
document.documentElement.clientHeight
|
|
97
98
|
);
|
|
98
|
-
},
|
|
99
|
-
return
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
}, "#scrollSize"), scrollViewportSize_get = /* @__PURE__ */ __name(function() {
|
|
100
|
+
return __privateGet(this, _scrollElement) instanceof HTMLElement ? __privateGet(this, _isHorizontal) ? __privateGet(this, _scrollElement).offsetWidth : __privateGet(this, _scrollElement).offsetHeight : __privateGet(this, _isHorizontal) ? innerWidth : innerHeight;
|
|
101
|
+
}, "#scrollViewportSize"), _scrollListener = new WeakMap(), _resizeListener = new WeakMap(), _grabListener = new WeakMap(), _tickListener = new WeakMap(), _intersectionListener = new WeakMap(), __name(_ScrollbarElement, "ScrollbarElement");
|
|
102
|
+
let ScrollbarElement = _ScrollbarElement;
|
|
103
|
+
isBrowser && !customElements.get("e-scrollbar") && customElements.define("e-scrollbar", ScrollbarElement);
|
|
104
|
+
const scrollKeys = /* @__PURE__ */ new Set([
|
|
103
105
|
"ArrowUp",
|
|
104
106
|
"ArrowDown",
|
|
105
107
|
"ArrowLeft",
|
|
@@ -110,107 +112,108 @@ const Wt = /* @__PURE__ */ new Set([
|
|
|
110
112
|
"End",
|
|
111
113
|
"Space"
|
|
112
114
|
]);
|
|
113
|
-
var
|
|
114
|
-
class
|
|
115
|
+
var _cssDisabled, _cssDamping, _value, _currentRoundedValue, _needSync, _SmoothScrollElement_instances, checkDisabled_fn, _wheelListener, _touchListener, _pointerdownListener, _resizeListener2, _keydownListener;
|
|
116
|
+
const _SmoothScrollElement = class _SmoothScrollElement extends HTMLElement {
|
|
115
117
|
constructor() {
|
|
116
118
|
super(...arguments);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
if (!
|
|
125
|
-
if (Math.sign(e.deltaY) < 0 &&
|
|
126
|
-
const
|
|
127
|
-
if (
|
|
128
|
-
const
|
|
119
|
+
__privateAdd(this, _SmoothScrollElement_instances);
|
|
120
|
+
__privateAdd(this, _cssDisabled, new CSSProperty(this, "--smooth-scroll-disabled", !1));
|
|
121
|
+
__privateAdd(this, _cssDamping, new CSSProperty(this, "--smooth-scroll-damping", 10));
|
|
122
|
+
__privateAdd(this, _value, new Damped(0));
|
|
123
|
+
__privateAdd(this, _currentRoundedValue, 0);
|
|
124
|
+
__privateAdd(this, _needSync, !1);
|
|
125
|
+
__privateAdd(this, _wheelListener, /* @__PURE__ */ __name((e) => {
|
|
126
|
+
if (!__privateMethod(this, _SmoothScrollElement_instances, checkDisabled_fn).call(this)) {
|
|
127
|
+
if (Math.sign(e.deltaY) < 0 && __privateGet(this, _value).target === 0 && __privateGet(this, _value).direction < 0 || Math.sign(e.deltaY) > 0 && __privateGet(this, _value).target === __privateGet(this, _value).max && __privateGet(this, _value).direction > 0 || e.stopPropagation(), e.target instanceof Element) {
|
|
128
|
+
const preventElement = e.target.closest("[data-prevent-smooth-scroll]");
|
|
129
|
+
if (preventElement) {
|
|
130
|
+
const attrValue = preventElement.getAttribute(
|
|
129
131
|
"data-prevent-smooth-scroll"
|
|
130
132
|
);
|
|
131
|
-
if (
|
|
132
|
-
if (matchMedia(
|
|
133
|
+
if (attrValue) {
|
|
134
|
+
if (matchMedia(attrValue).matches)
|
|
133
135
|
return;
|
|
134
136
|
} else return;
|
|
135
137
|
}
|
|
136
138
|
}
|
|
137
139
|
Math.abs(e.deltaX) > Math.abs(e.deltaY) || (e.preventDefault(), this.shiftPosition(e.deltaY));
|
|
138
140
|
}
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
});
|
|
146
|
-
|
|
141
|
+
}, "#wheelListener"));
|
|
142
|
+
__privateAdd(this, _touchListener, /* @__PURE__ */ __name(() => {
|
|
143
|
+
__privateMethod(this, _SmoothScrollElement_instances, checkDisabled_fn).call(this) || this.stop();
|
|
144
|
+
}, "#touchListener"));
|
|
145
|
+
__privateAdd(this, _pointerdownListener, /* @__PURE__ */ __name((e) => {
|
|
146
|
+
__privateMethod(this, _SmoothScrollElement_instances, checkDisabled_fn).call(this) || e.target instanceof Element && e.target.closest("a") && this.stop();
|
|
147
|
+
}, "#pointerdownListener"));
|
|
148
|
+
__privateAdd(this, _resizeListener2, /* @__PURE__ */ __name(() => {
|
|
147
149
|
this.resize();
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
});
|
|
150
|
+
}, "#resizeListener"));
|
|
151
|
+
__privateAdd(this, _keydownListener, /* @__PURE__ */ __name((e) => {
|
|
152
|
+
__privateMethod(this, _SmoothScrollElement_instances, checkDisabled_fn).call(this) || scrollKeys.has(e.code) && this.stop();
|
|
153
|
+
}, "#keydownListener"));
|
|
152
154
|
}
|
|
153
155
|
resize() {
|
|
154
|
-
|
|
156
|
+
__privateGet(this, _value).min = 0, __privateGet(this, _value).max = this.scrollHeight - this.offsetHeight;
|
|
155
157
|
}
|
|
156
158
|
stop() {
|
|
157
|
-
|
|
159
|
+
__privateGet(this, _value).unlistenAnimationFrame(), __privateSet(this, _needSync, !0);
|
|
158
160
|
}
|
|
159
161
|
sync() {
|
|
160
|
-
const
|
|
161
|
-
(
|
|
162
|
+
const currentValue = this.scrollTop;
|
|
163
|
+
(__privateGet(this, _needSync) || Math.abs(currentValue - __privateGet(this, _value).current) > 100) && (__privateSet(this, _needSync, !1), __privateGet(this, _value).set(currentValue, { equalize: !0 }));
|
|
162
164
|
}
|
|
163
|
-
shiftPosition(
|
|
164
|
-
this.resize(), this.sync(),
|
|
165
|
+
shiftPosition(value) {
|
|
166
|
+
this.resize(), this.sync(), __privateGet(this, _value).shift(value);
|
|
165
167
|
}
|
|
166
|
-
setPosition(
|
|
167
|
-
this.resize(), this.sync(),
|
|
168
|
+
setPosition(value, options) {
|
|
169
|
+
this.resize(), this.sync(), __privateGet(this, _value).set(value, options);
|
|
168
170
|
}
|
|
169
171
|
connectedCallback() {
|
|
170
|
-
window.addEventListener("resize",
|
|
172
|
+
window.addEventListener("resize", __privateGet(this, _resizeListener2)), this.addEventListener("keydown", __privateGet(this, _keydownListener)), this.addEventListener("pointerdown", __privateGet(this, _pointerdownListener)), this.addEventListener("touchstart", __privateGet(this, _touchListener)), this.addEventListener("wheel", __privateGet(this, _wheelListener), {
|
|
171
173
|
passive: !1
|
|
172
|
-
}),
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
top:
|
|
174
|
+
}), __privateGet(this, _value).subscribe((e) => {
|
|
175
|
+
const roundedCurrent = Math.round(e.current);
|
|
176
|
+
scrollEntries.update(this, "y", e.current), roundedCurrent !== __privateGet(this, _currentRoundedValue) && this.scroll({
|
|
177
|
+
top: roundedCurrent,
|
|
176
178
|
behavior: "instant"
|
|
177
|
-
}),
|
|
178
|
-
}),
|
|
179
|
-
|
|
180
|
-
}),
|
|
179
|
+
}), __privateSet(this, _currentRoundedValue, roundedCurrent);
|
|
180
|
+
}), __privateGet(this, _cssDamping).observe(), __privateGet(this, _cssDisabled).observe(), __privateGet(this, _cssDamping).subscribe((e) => {
|
|
181
|
+
__privateGet(this, _value).damping = e.current;
|
|
182
|
+
}), scrollEntries.register(this), this.resize();
|
|
181
183
|
}
|
|
182
184
|
disconnectedCallback() {
|
|
183
|
-
|
|
185
|
+
__privateGet(this, _value).close(), __privateGet(this, _cssDamping).close(), __privateGet(this, _cssDisabled).close(), scrollEntries.unregister(this), window.removeEventListener("resize", __privateGet(this, _resizeListener2)), this.removeEventListener("keydown", __privateGet(this, _keydownListener)), this.removeEventListener("pointerdown", __privateGet(this, _pointerdownListener)), this.removeEventListener("touchstart", __privateGet(this, _touchListener)), this.removeEventListener("wheel", __privateGet(this, _wheelListener));
|
|
184
186
|
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return
|
|
188
|
-
},
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
187
|
+
};
|
|
188
|
+
_cssDisabled = new WeakMap(), _cssDamping = new WeakMap(), _value = new WeakMap(), _currentRoundedValue = new WeakMap(), _needSync = new WeakMap(), _SmoothScrollElement_instances = new WeakSet(), checkDisabled_fn = /* @__PURE__ */ __name(function() {
|
|
189
|
+
return __privateGet(this, _cssDisabled).current || getComputedStyle(this).getPropertyValue("overflow") === "hidden";
|
|
190
|
+
}, "#checkDisabled"), _wheelListener = new WeakMap(), _touchListener = new WeakMap(), _pointerdownListener = new WeakMap(), _resizeListener2 = new WeakMap(), _keydownListener = new WeakMap(), __name(_SmoothScrollElement, "SmoothScrollElement");
|
|
191
|
+
let SmoothScrollElement = _SmoothScrollElement;
|
|
192
|
+
customElements.get("e-smooth-scroll") || customElements.define("e-smooth-scroll", SmoothScrollElement);
|
|
193
|
+
var _statusHolderElement, _progressHolderElement, _scrollElement2, _statusHolderCSSProperty, _progressHolderCSSProperty, _disabledCSSProperty, _startOffsetCSSProperty, _startOffsetMinCSSProperty, _startExtraOffsetCSSProperty, _distanceCSSProperty, _distanceOffsetCSSProperty, _progressVarCSSProperty, _enterOnceCSSProperty, _status, _initialPosition, _start, _finish, _distance, _scrolled, _progress, _visible, _ScrollRegionElement_instances, addGlobalClasses_fn, removeGlobalClasses_fn, init_fn, _resizeListener3, _tickListener2, enter_fn, exit_fn, cssVar_fn, _readyStateChangeListener;
|
|
194
|
+
const _ScrollRegionElement = class _ScrollRegionElement extends HTMLElement {
|
|
192
195
|
constructor() {
|
|
193
196
|
super(...arguments);
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
__privateAdd(this, _ScrollRegionElement_instances);
|
|
198
|
+
__privateAdd(this, _statusHolderElement, this);
|
|
199
|
+
__privateAdd(this, _progressHolderElement, this);
|
|
200
|
+
__privateAdd(this, _scrollElement2, null);
|
|
201
|
+
__privateAdd(this, _statusHolderCSSProperty, new CSSProperty(
|
|
199
202
|
this,
|
|
200
203
|
"--scroll-region-status-holder",
|
|
201
204
|
!1
|
|
202
205
|
));
|
|
203
|
-
|
|
206
|
+
__privateAdd(this, _progressHolderCSSProperty, new CSSProperty(
|
|
204
207
|
this,
|
|
205
208
|
"--scroll-region-progress-holder",
|
|
206
209
|
!1
|
|
207
210
|
));
|
|
208
|
-
|
|
211
|
+
__privateAdd(this, _disabledCSSProperty, new CSSProperty(
|
|
209
212
|
this,
|
|
210
213
|
"--scroll-region-disabled",
|
|
211
214
|
!1
|
|
212
215
|
));
|
|
213
|
-
|
|
216
|
+
__privateAdd(this, _startOffsetCSSProperty, new CSSProperty(
|
|
214
217
|
this,
|
|
215
218
|
"--scroll-region-start-offset",
|
|
216
219
|
0,
|
|
@@ -218,7 +221,7 @@ class Ot extends HTMLElement {
|
|
|
218
221
|
rawValueCheck: !1
|
|
219
222
|
}
|
|
220
223
|
));
|
|
221
|
-
|
|
224
|
+
__privateAdd(this, _startOffsetMinCSSProperty, new CSSProperty(
|
|
222
225
|
this,
|
|
223
226
|
"--scroll-region-start-offset-min",
|
|
224
227
|
!1,
|
|
@@ -226,7 +229,7 @@ class Ot extends HTMLElement {
|
|
|
226
229
|
rawValueCheck: !1
|
|
227
230
|
}
|
|
228
231
|
));
|
|
229
|
-
|
|
232
|
+
__privateAdd(this, _startExtraOffsetCSSProperty, new CSSProperty(
|
|
230
233
|
this,
|
|
231
234
|
"--scroll-region-start-extra-offset",
|
|
232
235
|
0,
|
|
@@ -234,7 +237,7 @@ class Ot extends HTMLElement {
|
|
|
234
237
|
rawValueCheck: !1
|
|
235
238
|
}
|
|
236
239
|
));
|
|
237
|
-
|
|
240
|
+
__privateAdd(this, _distanceCSSProperty, new CSSProperty(
|
|
238
241
|
this,
|
|
239
242
|
"--scroll-region-distance",
|
|
240
243
|
0,
|
|
@@ -242,7 +245,7 @@ class Ot extends HTMLElement {
|
|
|
242
245
|
rawValueCheck: !1
|
|
243
246
|
}
|
|
244
247
|
));
|
|
245
|
-
|
|
248
|
+
__privateAdd(this, _distanceOffsetCSSProperty, new CSSProperty(
|
|
246
249
|
this,
|
|
247
250
|
"--scroll-region-distance-offset",
|
|
248
251
|
0,
|
|
@@ -250,138 +253,139 @@ class Ot extends HTMLElement {
|
|
|
250
253
|
rawValueCheck: !1
|
|
251
254
|
}
|
|
252
255
|
));
|
|
253
|
-
|
|
256
|
+
__privateAdd(this, _progressVarCSSProperty, new CSSProperty(
|
|
254
257
|
this,
|
|
255
258
|
"--scroll-region-progress-var",
|
|
256
259
|
""
|
|
257
260
|
));
|
|
258
|
-
|
|
261
|
+
__privateAdd(this, _enterOnceCSSProperty, new CSSProperty(
|
|
259
262
|
this,
|
|
260
263
|
"--scroll-region-enter-once",
|
|
261
264
|
!1
|
|
262
265
|
));
|
|
263
|
-
|
|
266
|
+
__privateAdd(this, _status, new ElementLinkedStore(this, {
|
|
264
267
|
enabled: !1,
|
|
265
268
|
entered: !1,
|
|
266
269
|
enteredOnLoad: !1,
|
|
267
270
|
activated: !1
|
|
268
271
|
}));
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
272
|
+
__privateAdd(this, _initialPosition, 0);
|
|
273
|
+
__privateAdd(this, _start, 0);
|
|
274
|
+
__privateAdd(this, _finish, 0);
|
|
275
|
+
__privateAdd(this, _distance, 0);
|
|
276
|
+
__privateAdd(this, _scrolled, 0);
|
|
277
|
+
__privateAdd(this, _progress, 0);
|
|
278
|
+
__privateAdd(this, _visible, !1);
|
|
279
|
+
__privateAdd(this, _resizeListener3, /* @__PURE__ */ __name(() => {
|
|
277
280
|
this.resize();
|
|
278
|
-
});
|
|
279
|
-
|
|
281
|
+
}, "#resizeListener"));
|
|
282
|
+
__privateAdd(this, _tickListener2, /* @__PURE__ */ __name(() => {
|
|
280
283
|
this.tick();
|
|
281
|
-
});
|
|
282
|
-
|
|
283
|
-
document.readyState === "complete" &&
|
|
284
|
-
});
|
|
284
|
+
}, "#tickListener"));
|
|
285
|
+
__privateAdd(this, _readyStateChangeListener, /* @__PURE__ */ __name(() => {
|
|
286
|
+
document.readyState === "complete" && __privateMethod(this, _ScrollRegionElement_instances, init_fn).call(this);
|
|
287
|
+
}, "#readyStateChangeListener"));
|
|
285
288
|
}
|
|
286
289
|
get start() {
|
|
287
|
-
return
|
|
290
|
+
return __privateGet(this, _start);
|
|
288
291
|
}
|
|
289
292
|
get finish() {
|
|
290
|
-
return
|
|
293
|
+
return __privateGet(this, _finish);
|
|
291
294
|
}
|
|
292
295
|
get distance() {
|
|
293
|
-
return
|
|
296
|
+
return __privateGet(this, _distance);
|
|
294
297
|
}
|
|
295
298
|
get scrolled() {
|
|
296
|
-
return
|
|
299
|
+
return __privateGet(this, _scrolled);
|
|
297
300
|
}
|
|
298
301
|
get progress() {
|
|
299
|
-
return
|
|
302
|
+
return __privateGet(this, _progress);
|
|
300
303
|
}
|
|
301
304
|
get status() {
|
|
302
|
-
return
|
|
305
|
+
return __privateGet(this, _status);
|
|
303
306
|
}
|
|
304
307
|
get scrollValue() {
|
|
305
|
-
return
|
|
308
|
+
return __privateGet(this, _scrollElement2) instanceof HTMLElement ? __privateGet(this, _scrollElement2).scrollTop : __privateGet(this, _scrollElement2).scrollY;
|
|
306
309
|
}
|
|
307
310
|
resize() {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
)) :
|
|
311
|
+
__privateGet(this, _disabledCSSProperty).current || (__privateSet(this, _initialPosition, getCumulativeOffsetTop(this)), __privateSet(this, _start, __privateGet(this, _initialPosition)), typeof __privateGet(this, _startOffsetMinCSSProperty).current == "number" ? __privateSet(this, _start, __privateGet(this, _start) + Math.max(
|
|
312
|
+
__privateGet(this, _startOffsetCSSProperty).current,
|
|
313
|
+
__privateGet(this, _startOffsetMinCSSProperty).current
|
|
314
|
+
)) : __privateSet(this, _start, __privateGet(this, _start) + __privateGet(this, _startOffsetCSSProperty).current), __privateSet(this, _start, __privateGet(this, _start) + __privateGet(this, _startExtraOffsetCSSProperty).current), __privateSet(this, _start, __privateGet(this, _start) - getStickyOffset(this, "top")), __privateSet(this, _finish, __privateGet(this, _start)), __privateGet(this, _distanceCSSProperty).current ? __privateSet(this, _finish, __privateGet(this, _finish) + __privateGet(this, _distanceCSSProperty).current) : __privateSet(this, _finish, __privateGet(this, _finish) + this.offsetHeight), __privateSet(this, _finish, __privateGet(this, _finish) + __privateGet(this, _distanceOffsetCSSProperty).current), __privateSet(this, _distance, __privateGet(this, _finish) - __privateGet(this, _start)), __privateSet(this, _visible, this.offsetWidth !== 0 && this.offsetHeight !== 0), this.tick());
|
|
312
315
|
}
|
|
313
316
|
tick() {
|
|
314
|
-
if (
|
|
317
|
+
if (__privateGet(this, _disabledCSSProperty).current)
|
|
315
318
|
return;
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
),
|
|
319
|
+
const scrollValue = this.scrollValue;
|
|
320
|
+
__privateSet(this, _scrolled, clamp(scrollValue - __privateGet(this, _start), 0, __privateGet(this, _distance))), __privateSet(this, _progress, __privateGet(this, _scrolled) / __privateGet(this, _distance) || 0), __privateGet(this, _progressVarCSSProperty).current && __privateGet(this, _progressHolderElement).style.setProperty(
|
|
321
|
+
__privateMethod(this, _ScrollRegionElement_instances, cssVar_fn).call(this, __privateGet(this, _progressVarCSSProperty).current),
|
|
322
|
+
__privateGet(this, _progress).toFixed(6)
|
|
323
|
+
), __privateGet(this, _status).set("activated", scrollValue >= __privateGet(this, _start)), __privateGet(this, _visible) && __privateGet(this, _status).isFalse("entered") && scrollValue >= __privateGet(this, _start) && scrollValue <= __privateGet(this, _finish) ? __privateMethod(this, _ScrollRegionElement_instances, enter_fn).call(this) : __privateGet(this, _visible) && !__privateGet(this, _enterOnceCSSProperty).current && __privateGet(this, _status).isTrue("entered") && (scrollValue < __privateGet(this, _start) || scrollValue > __privateGet(this, _finish)) && __privateMethod(this, _ScrollRegionElement_instances, exit_fn).call(this), __privateGet(this, _enterOnceCSSProperty).current && __privateGet(this, _progress) === 1 && (__privateGet(this, _status).current.entered || __privateMethod(this, _ScrollRegionElement_instances, enter_fn).call(this), this.destroy()), dispatchEvent(this, "scrollRegionProgress", {
|
|
321
324
|
detail: {
|
|
322
|
-
progress:
|
|
323
|
-
scrolled:
|
|
325
|
+
progress: __privateGet(this, _progress),
|
|
326
|
+
scrolled: __privateGet(this, _scrolled)
|
|
324
327
|
}
|
|
325
328
|
});
|
|
326
329
|
}
|
|
327
330
|
destroy() {
|
|
328
331
|
document.removeEventListener(
|
|
329
332
|
"readystatechange",
|
|
330
|
-
|
|
331
|
-
), this.disable(!1),
|
|
333
|
+
__privateGet(this, _readyStateChangeListener)
|
|
334
|
+
), this.disable(!1), __privateGet(this, _statusHolderCSSProperty).close(), __privateGet(this, _progressHolderCSSProperty).close(), __privateGet(this, _disabledCSSProperty).close(), __privateGet(this, _startOffsetCSSProperty).close(), __privateGet(this, _startOffsetMinCSSProperty).close(), __privateGet(this, _startExtraOffsetCSSProperty).close(), __privateGet(this, _distanceCSSProperty).close(), __privateGet(this, _distanceOffsetCSSProperty).close(), __privateGet(this, _progressVarCSSProperty).close(), __privateGet(this, _enterOnceCSSProperty).close();
|
|
332
335
|
}
|
|
333
336
|
enable() {
|
|
334
|
-
|
|
337
|
+
ticker.subscribe(__privateGet(this, _tickListener2), { culling: this }), elementResizer.subscribe(this, __privateGet(this, _resizeListener3)), windowResizer.subscribe(__privateGet(this, _resizeListener3)), __privateGet(this, _tickListener2).call(this), __privateGet(this, _status).set("enabled", !0);
|
|
335
338
|
}
|
|
336
|
-
disable(
|
|
337
|
-
|
|
339
|
+
disable(resetStatus = !0) {
|
|
340
|
+
ticker.unsubscribe(__privateGet(this, _tickListener2)), elementResizer.unsubscribe(__privateGet(this, _resizeListener3)), windowResizer.unsubscribe(__privateGet(this, _resizeListener3)), resetStatus && __privateGet(this, _status).reset(), __privateMethod(this, _ScrollRegionElement_instances, removeGlobalClasses_fn).call(this);
|
|
338
341
|
}
|
|
339
342
|
connectedCallback() {
|
|
340
|
-
const
|
|
341
|
-
|
|
343
|
+
const scrollSelector = this.getAttribute("data-scroll") || ".page-scroll";
|
|
344
|
+
__privateSet(this, _scrollElement2, document.querySelector(scrollSelector)), document.readyState === "complete" ? __privateGet(this, _readyStateChangeListener).call(this) : document.addEventListener(
|
|
342
345
|
"readystatechange",
|
|
343
|
-
|
|
346
|
+
__privateGet(this, _readyStateChangeListener)
|
|
344
347
|
);
|
|
345
348
|
}
|
|
346
349
|
disconnectedCallback() {
|
|
347
350
|
this.destroy();
|
|
348
351
|
}
|
|
349
|
-
}
|
|
350
|
-
|
|
352
|
+
};
|
|
353
|
+
_statusHolderElement = new WeakMap(), _progressHolderElement = new WeakMap(), _scrollElement2 = new WeakMap(), _statusHolderCSSProperty = new WeakMap(), _progressHolderCSSProperty = new WeakMap(), _disabledCSSProperty = new WeakMap(), _startOffsetCSSProperty = new WeakMap(), _startOffsetMinCSSProperty = new WeakMap(), _startExtraOffsetCSSProperty = new WeakMap(), _distanceCSSProperty = new WeakMap(), _distanceOffsetCSSProperty = new WeakMap(), _progressVarCSSProperty = new WeakMap(), _enterOnceCSSProperty = new WeakMap(), _status = new WeakMap(), _initialPosition = new WeakMap(), _start = new WeakMap(), _finish = new WeakMap(), _distance = new WeakMap(), _scrolled = new WeakMap(), _progress = new WeakMap(), _visible = new WeakMap(), _ScrollRegionElement_instances = new WeakSet(), addGlobalClasses_fn = /* @__PURE__ */ __name(function() {
|
|
351
354
|
this.hasAttribute("data-global-class") && document.documentElement.classList.add(
|
|
352
355
|
this.getAttribute("data-global-class")
|
|
353
356
|
);
|
|
354
|
-
},
|
|
357
|
+
}, "#addGlobalClasses"), removeGlobalClasses_fn = /* @__PURE__ */ __name(function() {
|
|
355
358
|
this.hasAttribute("data-global-class") && document.documentElement.classList.remove(
|
|
356
359
|
this.getAttribute("data-global-class")
|
|
357
360
|
);
|
|
358
|
-
},
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}),
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
),
|
|
365
|
-
}),
|
|
361
|
+
}, "#removeGlobalClasses"), init_fn = /* @__PURE__ */ __name(function() {
|
|
362
|
+
__privateGet(this, _statusHolderCSSProperty).subscribe((e) => {
|
|
363
|
+
__privateGet(this, _statusHolderElement) && __privateGet(this, _status).removeElement(__privateGet(this, _statusHolderElement)), __privateSet(this, _statusHolderElement, e.current ? document.querySelector(e.current) || this : this), __privateGet(this, _status).addElement(__privateGet(this, _statusHolderElement));
|
|
364
|
+
}), __privateGet(this, _progressHolderCSSProperty).subscribe((e) => {
|
|
365
|
+
__privateGet(this, _progressHolderElement) && __privateGet(this, _progressHolderElement).style.removeProperty(
|
|
366
|
+
__privateMethod(this, _ScrollRegionElement_instances, cssVar_fn).call(this, __privateGet(this, _progressVarCSSProperty).current)
|
|
367
|
+
), __privateSet(this, _progressHolderElement, e.current ? document.querySelector(e.current) || this : this);
|
|
368
|
+
}), __privateGet(this, _disabledCSSProperty).subscribe((e) => {
|
|
366
369
|
e.current && !e.previous ? this.disable() : this.enable();
|
|
367
|
-
}),
|
|
368
|
-
e.current ?
|
|
369
|
-
|
|
370
|
+
}), __privateGet(this, _progressVarCSSProperty).subscribe((e) => {
|
|
371
|
+
e.current ? __privateGet(this, _tickListener2).call(this) : e.previous && __privateGet(this, _progressHolderElement).style.removeProperty(
|
|
372
|
+
__privateMethod(this, _ScrollRegionElement_instances, cssVar_fn).call(this, e.previous)
|
|
370
373
|
);
|
|
371
|
-
}),
|
|
372
|
-
|
|
373
|
-
}),
|
|
374
|
-
},
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
},
|
|
378
|
-
|
|
379
|
-
},
|
|
380
|
-
return `--${
|
|
381
|
-
},
|
|
382
|
-
|
|
374
|
+
}), __privateGet(this, _distanceCSSProperty).subscribe(() => {
|
|
375
|
+
__privateGet(this, _resizeListener3).call(this);
|
|
376
|
+
}), __privateGet(this, _statusHolderCSSProperty).observe(), __privateGet(this, _progressHolderCSSProperty).observe(), __privateGet(this, _disabledCSSProperty).observe(), __privateGet(this, _startOffsetCSSProperty).observe(), __privateGet(this, _startOffsetMinCSSProperty).observe(), __privateGet(this, _startExtraOffsetCSSProperty).observe(), __privateGet(this, _distanceCSSProperty).observe(), __privateGet(this, _distanceOffsetCSSProperty).observe(), __privateGet(this, _progressVarCSSProperty).observe(), __privateGet(this, _enterOnceCSSProperty).observe();
|
|
377
|
+
}, "#init"), _resizeListener3 = new WeakMap(), _tickListener2 = new WeakMap(), enter_fn = /* @__PURE__ */ __name(function() {
|
|
378
|
+
const scrollValue = this.scrollValue;
|
|
379
|
+
__privateGet(this, _status).set("entered", !0), scrollValue === 0 && __privateGet(this, _status).set("enteredOnLoad", !0), __privateMethod(this, _ScrollRegionElement_instances, addGlobalClasses_fn).call(this), dispatchEvent(this, "scrollRegionEnter");
|
|
380
|
+
}, "#enter"), exit_fn = /* @__PURE__ */ __name(function() {
|
|
381
|
+
__privateGet(this, _status).set("entered", !1), __privateMethod(this, _ScrollRegionElement_instances, removeGlobalClasses_fn).call(this), dispatchEvent(this, "scrollRegionExit");
|
|
382
|
+
}, "#exit"), cssVar_fn = /* @__PURE__ */ __name(function(value) {
|
|
383
|
+
return `--${value}`;
|
|
384
|
+
}, "#cssVar"), _readyStateChangeListener = new WeakMap(), __name(_ScrollRegionElement, "ScrollRegionElement");
|
|
385
|
+
let ScrollRegionElement = _ScrollRegionElement;
|
|
386
|
+
customElements.get("e-scroll-region") || customElements.define("e-scroll-region", ScrollRegionElement);
|
|
383
387
|
export {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
388
|
+
ScrollRegionElement,
|
|
389
|
+
ScrollbarElement,
|
|
390
|
+
SmoothScrollElement
|
|
387
391
|
};
|