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-kit/index.js
CHANGED
|
@@ -1,86 +1,88 @@
|
|
|
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 {
|
|
9
|
-
import {
|
|
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 } from "../index-DpKsHe97.js";
|
|
9
|
+
import { ticker } from "../ticker/index.js";
|
|
10
|
+
import { f as findScrollParentElement } from "../dom-D8D-_9ty.js";
|
|
11
|
+
import { s as setupDrag } from "../gestures-DmKKNnh4.js";
|
|
10
12
|
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
|
|
13
|
+
import { scrollEntries } from "../scroll-entries/index.js";
|
|
14
|
+
import "../Store-uLDYY9ed.js";
|
|
15
|
+
import { D as Damped } from "../Damped-Dcz5UdMH.js";
|
|
16
|
+
import { CSSProperty } from "../css-property/index.js";
|
|
17
|
+
import { ElementLinkedStore } from "../element-linked-store/index.js";
|
|
18
|
+
import { elementResizer } from "../element-resizer/index.js";
|
|
19
|
+
import { d as dispatchEvent } from "../events-Ds-TuvYW.js";
|
|
20
|
+
import { a as getCumulativeOffsetTop, b as getStickyOffset } from "../layout-C26zkY7D.js";
|
|
21
|
+
import { c as clamp } from "../math-r8V23YFe.js";
|
|
22
|
+
import { windowResizer } from "../window-resizer/index.js";
|
|
23
|
+
var _scrollElement, _thumbElement, _thumbScrollSize, _limit, _isHorizontal, _activeTimeoutId, _ScrollbarElement_instances, scrollPosition_get, scrollSize_get, scrollViewportSize_get, _scrollListener, _resizeListener, _grabListener, _tickListener, _intersectionListener;
|
|
24
|
+
const _ScrollbarElement = class _ScrollbarElement extends HTMLElement {
|
|
23
25
|
constructor() {
|
|
24
26
|
super(...arguments);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.classList.add("active"), clearTimeout(
|
|
34
|
-
const
|
|
35
|
-
|
|
27
|
+
__privateAdd(this, _ScrollbarElement_instances);
|
|
28
|
+
__privateAdd(this, _scrollElement, null);
|
|
29
|
+
__privateAdd(this, _thumbElement, null);
|
|
30
|
+
__privateAdd(this, _thumbScrollSize, 0);
|
|
31
|
+
__privateAdd(this, _limit, 0);
|
|
32
|
+
__privateAdd(this, _isHorizontal, !1);
|
|
33
|
+
__privateAdd(this, _activeTimeoutId);
|
|
34
|
+
__privateAdd(this, _scrollListener, /* @__PURE__ */ __name(() => {
|
|
35
|
+
this.classList.add("active"), clearTimeout(__privateGet(this, _activeTimeoutId));
|
|
36
|
+
const position = __privateGet(this, _ScrollbarElement_instances, scrollPosition_get) / __privateGet(this, _limit) * __privateGet(this, _thumbScrollSize);
|
|
37
|
+
__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
38
|
this.classList.remove("active");
|
|
37
39
|
}, 1e3));
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
let
|
|
43
|
-
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
left:
|
|
40
|
+
}, "#scrollListener"));
|
|
41
|
+
__privateAdd(this, _resizeListener, /* @__PURE__ */ __name(() => {
|
|
42
|
+
const barSize = __privateGet(this, _isHorizontal) ? this.offsetWidth : this.offsetHeight, scrollSize = __privateGet(this, _ScrollbarElement_instances, scrollSize_get), viewportSize = __privateGet(this, _ScrollbarElement_instances, scrollViewportSize_get);
|
|
43
|
+
__privateSet(this, _limit, scrollSize - viewportSize);
|
|
44
|
+
let thumbSize = barSize * barSize / (__privateGet(this, _limit) + barSize);
|
|
45
|
+
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";
|
|
46
|
+
}, "#resizeListener"));
|
|
47
|
+
__privateAdd(this, _grabListener, /* @__PURE__ */ __name((grabEvent) => {
|
|
48
|
+
const startValue = __privateGet(this, _ScrollbarElement_instances, scrollPosition_get), grabCursor = __privateGet(this, _isHorizontal) ? grabEvent.x : grabEvent.y;
|
|
49
|
+
setupDrag((moveEvent) => {
|
|
50
|
+
const mult = __privateGet(this, _limit) / __privateGet(this, _thumbScrollSize), delta = (__privateGet(this, _isHorizontal) ? moveEvent.x - grabCursor : moveEvent.y - grabCursor) * mult;
|
|
51
|
+
__privateGet(this, _isHorizontal) ? __privateGet(this, _scrollElement).scroll({
|
|
52
|
+
left: startValue + delta,
|
|
51
53
|
behavior: "instant"
|
|
52
|
-
}) :
|
|
53
|
-
top:
|
|
54
|
+
}) : __privateGet(this, _scrollElement).scroll({
|
|
55
|
+
top: startValue + delta,
|
|
54
56
|
behavior: "instant"
|
|
55
57
|
});
|
|
56
58
|
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
e.isIntersecting ? (
|
|
63
|
-
});
|
|
59
|
+
}, "#grabListener"));
|
|
60
|
+
__privateAdd(this, _tickListener, /* @__PURE__ */ __name(() => {
|
|
61
|
+
__privateGet(this, _resizeListener).call(this);
|
|
62
|
+
}, "#tickListener"));
|
|
63
|
+
__privateAdd(this, _intersectionListener, /* @__PURE__ */ __name((e) => {
|
|
64
|
+
e.isIntersecting ? (ticker.subscribe(__privateGet(this, _tickListener), { maxFPS: 5 }), __privateGet(this, _tickListener).call(this)) : ticker.unsubscribe(__privateGet(this, _tickListener));
|
|
65
|
+
}, "#intersectionListener"));
|
|
64
66
|
}
|
|
65
67
|
connectedCallback() {
|
|
66
|
-
const
|
|
67
|
-
let
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
68
|
+
const scrollSelector = this.getAttribute("data-scroll");
|
|
69
|
+
let scrollElement = null;
|
|
70
|
+
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"));
|
|
71
|
+
const thumbElement = this.querySelector("[data-thumb]");
|
|
72
|
+
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
73
|
this.parentElement === document.body ? this : this.parentElement,
|
|
72
|
-
|
|
74
|
+
__privateGet(this, _intersectionListener)
|
|
73
75
|
));
|
|
74
76
|
}
|
|
75
77
|
disconnectedCallback() {
|
|
76
|
-
var
|
|
77
|
-
(
|
|
78
|
+
var _a, _b;
|
|
79
|
+
(_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
80
|
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return
|
|
82
|
-
},
|
|
83
|
-
return
|
|
81
|
+
};
|
|
82
|
+
_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() {
|
|
83
|
+
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;
|
|
84
|
+
}, "#scrollPosition"), scrollSize_get = /* @__PURE__ */ __name(function() {
|
|
85
|
+
return __privateGet(this, _scrollElement) instanceof HTMLElement ? __privateGet(this, _isHorizontal) ? __privateGet(this, _scrollElement).scrollWidth : __privateGet(this, _scrollElement).scrollHeight : __privateGet(this, _isHorizontal) ? Math.max(
|
|
84
86
|
document.body.scrollWidth,
|
|
85
87
|
document.documentElement.scrollWidth,
|
|
86
88
|
document.body.offsetWidth,
|
|
@@ -95,11 +97,12 @@ h = new WeakMap(), b = new WeakMap(), R = new WeakMap(), H = new WeakMap(), a =
|
|
|
95
97
|
document.body.clientHeight,
|
|
96
98
|
document.documentElement.clientHeight
|
|
97
99
|
);
|
|
98
|
-
},
|
|
99
|
-
return
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
}, "#scrollSize"), scrollViewportSize_get = /* @__PURE__ */ __name(function() {
|
|
101
|
+
return __privateGet(this, _scrollElement) instanceof HTMLElement ? __privateGet(this, _isHorizontal) ? __privateGet(this, _scrollElement).offsetWidth : __privateGet(this, _scrollElement).offsetHeight : __privateGet(this, _isHorizontal) ? innerWidth : innerHeight;
|
|
102
|
+
}, "#scrollViewportSize"), _scrollListener = new WeakMap(), _resizeListener = new WeakMap(), _grabListener = new WeakMap(), _tickListener = new WeakMap(), _intersectionListener = new WeakMap(), __name(_ScrollbarElement, "ScrollbarElement");
|
|
103
|
+
let ScrollbarElement = _ScrollbarElement;
|
|
104
|
+
isBrowser && !customElements.get("e-scrollbar") && customElements.define("e-scrollbar", ScrollbarElement);
|
|
105
|
+
const scrollKeys = /* @__PURE__ */ new Set([
|
|
103
106
|
"ArrowUp",
|
|
104
107
|
"ArrowDown",
|
|
105
108
|
"ArrowLeft",
|
|
@@ -110,107 +113,108 @@ const Wt = /* @__PURE__ */ new Set([
|
|
|
110
113
|
"End",
|
|
111
114
|
"Space"
|
|
112
115
|
]);
|
|
113
|
-
var
|
|
114
|
-
class
|
|
116
|
+
var _cssDisabled, _cssDamping, _value, _currentRoundedValue, _needSync, _SmoothScrollElement_instances, checkDisabled_fn, _wheelListener, _touchListener, _pointerdownListener, _resizeListener2, _keydownListener;
|
|
117
|
+
const _SmoothScrollElement = class _SmoothScrollElement extends HTMLElement {
|
|
115
118
|
constructor() {
|
|
116
119
|
super(...arguments);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
if (!
|
|
125
|
-
if (Math.sign(e.deltaY) < 0 &&
|
|
126
|
-
const
|
|
127
|
-
if (
|
|
128
|
-
const
|
|
120
|
+
__privateAdd(this, _SmoothScrollElement_instances);
|
|
121
|
+
__privateAdd(this, _cssDisabled, new CSSProperty(this, "--smooth-scroll-disabled", !1));
|
|
122
|
+
__privateAdd(this, _cssDamping, new CSSProperty(this, "--smooth-scroll-damping", 10));
|
|
123
|
+
__privateAdd(this, _value, new Damped(0));
|
|
124
|
+
__privateAdd(this, _currentRoundedValue, 0);
|
|
125
|
+
__privateAdd(this, _needSync, !1);
|
|
126
|
+
__privateAdd(this, _wheelListener, /* @__PURE__ */ __name((e) => {
|
|
127
|
+
if (!__privateMethod(this, _SmoothScrollElement_instances, checkDisabled_fn).call(this)) {
|
|
128
|
+
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) {
|
|
129
|
+
const preventElement = e.target.closest("[data-prevent-smooth-scroll]");
|
|
130
|
+
if (preventElement) {
|
|
131
|
+
const attrValue = preventElement.getAttribute(
|
|
129
132
|
"data-prevent-smooth-scroll"
|
|
130
133
|
);
|
|
131
|
-
if (
|
|
132
|
-
if (matchMedia(
|
|
134
|
+
if (attrValue) {
|
|
135
|
+
if (matchMedia(attrValue).matches)
|
|
133
136
|
return;
|
|
134
137
|
} else return;
|
|
135
138
|
}
|
|
136
139
|
}
|
|
137
140
|
Math.abs(e.deltaX) > Math.abs(e.deltaY) || (e.preventDefault(), this.shiftPosition(e.deltaY));
|
|
138
141
|
}
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
});
|
|
146
|
-
|
|
142
|
+
}, "#wheelListener"));
|
|
143
|
+
__privateAdd(this, _touchListener, /* @__PURE__ */ __name(() => {
|
|
144
|
+
__privateMethod(this, _SmoothScrollElement_instances, checkDisabled_fn).call(this) || this.stop();
|
|
145
|
+
}, "#touchListener"));
|
|
146
|
+
__privateAdd(this, _pointerdownListener, /* @__PURE__ */ __name((e) => {
|
|
147
|
+
__privateMethod(this, _SmoothScrollElement_instances, checkDisabled_fn).call(this) || e.target instanceof Element && e.target.closest("a") && this.stop();
|
|
148
|
+
}, "#pointerdownListener"));
|
|
149
|
+
__privateAdd(this, _resizeListener2, /* @__PURE__ */ __name(() => {
|
|
147
150
|
this.resize();
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
});
|
|
151
|
+
}, "#resizeListener"));
|
|
152
|
+
__privateAdd(this, _keydownListener, /* @__PURE__ */ __name((e) => {
|
|
153
|
+
__privateMethod(this, _SmoothScrollElement_instances, checkDisabled_fn).call(this) || scrollKeys.has(e.code) && this.stop();
|
|
154
|
+
}, "#keydownListener"));
|
|
152
155
|
}
|
|
153
156
|
resize() {
|
|
154
|
-
|
|
157
|
+
__privateGet(this, _value).min = 0, __privateGet(this, _value).max = this.scrollHeight - this.offsetHeight;
|
|
155
158
|
}
|
|
156
159
|
stop() {
|
|
157
|
-
|
|
160
|
+
__privateGet(this, _value).unlistenAnimationFrame(), __privateSet(this, _needSync, !0);
|
|
158
161
|
}
|
|
159
162
|
sync() {
|
|
160
|
-
const
|
|
161
|
-
(
|
|
163
|
+
const currentValue = this.scrollTop;
|
|
164
|
+
(__privateGet(this, _needSync) || Math.abs(currentValue - __privateGet(this, _value).current) > 100) && (__privateSet(this, _needSync, !1), __privateGet(this, _value).set(currentValue, { equalize: !0 }));
|
|
162
165
|
}
|
|
163
|
-
shiftPosition(
|
|
164
|
-
this.resize(), this.sync(),
|
|
166
|
+
shiftPosition(value) {
|
|
167
|
+
this.resize(), this.sync(), __privateGet(this, _value).shift(value);
|
|
165
168
|
}
|
|
166
|
-
setPosition(
|
|
167
|
-
this.resize(), this.sync(),
|
|
169
|
+
setPosition(value, options) {
|
|
170
|
+
this.resize(), this.sync(), __privateGet(this, _value).set(value, options);
|
|
168
171
|
}
|
|
169
172
|
connectedCallback() {
|
|
170
|
-
window.addEventListener("resize",
|
|
173
|
+
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
174
|
passive: !1
|
|
172
|
-
}),
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
top:
|
|
175
|
+
}), __privateGet(this, _value).subscribe((e) => {
|
|
176
|
+
const roundedCurrent = Math.round(e.current);
|
|
177
|
+
scrollEntries.update(this, "y", e.current), roundedCurrent !== __privateGet(this, _currentRoundedValue) && this.scroll({
|
|
178
|
+
top: roundedCurrent,
|
|
176
179
|
behavior: "instant"
|
|
177
|
-
}),
|
|
178
|
-
}),
|
|
179
|
-
|
|
180
|
-
}),
|
|
180
|
+
}), __privateSet(this, _currentRoundedValue, roundedCurrent);
|
|
181
|
+
}), __privateGet(this, _cssDamping).observe(), __privateGet(this, _cssDisabled).observe(), __privateGet(this, _cssDamping).subscribe((e) => {
|
|
182
|
+
__privateGet(this, _value).damping = e.current;
|
|
183
|
+
}), scrollEntries.register(this), this.resize();
|
|
181
184
|
}
|
|
182
185
|
disconnectedCallback() {
|
|
183
|
-
|
|
186
|
+
__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
187
|
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return
|
|
188
|
-
},
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
188
|
+
};
|
|
189
|
+
_cssDisabled = new WeakMap(), _cssDamping = new WeakMap(), _value = new WeakMap(), _currentRoundedValue = new WeakMap(), _needSync = new WeakMap(), _SmoothScrollElement_instances = new WeakSet(), checkDisabled_fn = /* @__PURE__ */ __name(function() {
|
|
190
|
+
return __privateGet(this, _cssDisabled).current || getComputedStyle(this).getPropertyValue("overflow") === "hidden";
|
|
191
|
+
}, "#checkDisabled"), _wheelListener = new WeakMap(), _touchListener = new WeakMap(), _pointerdownListener = new WeakMap(), _resizeListener2 = new WeakMap(), _keydownListener = new WeakMap(), __name(_SmoothScrollElement, "SmoothScrollElement");
|
|
192
|
+
let SmoothScrollElement = _SmoothScrollElement;
|
|
193
|
+
customElements.get("e-smooth-scroll") || customElements.define("e-smooth-scroll", SmoothScrollElement);
|
|
194
|
+
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;
|
|
195
|
+
const _ScrollRegionElement = class _ScrollRegionElement extends HTMLElement {
|
|
192
196
|
constructor() {
|
|
193
197
|
super(...arguments);
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
198
|
+
__privateAdd(this, _ScrollRegionElement_instances);
|
|
199
|
+
__privateAdd(this, _statusHolderElement, this);
|
|
200
|
+
__privateAdd(this, _progressHolderElement, this);
|
|
201
|
+
__privateAdd(this, _scrollElement2, null);
|
|
202
|
+
__privateAdd(this, _statusHolderCSSProperty, new CSSProperty(
|
|
199
203
|
this,
|
|
200
204
|
"--scroll-region-status-holder",
|
|
201
205
|
!1
|
|
202
206
|
));
|
|
203
|
-
|
|
207
|
+
__privateAdd(this, _progressHolderCSSProperty, new CSSProperty(
|
|
204
208
|
this,
|
|
205
209
|
"--scroll-region-progress-holder",
|
|
206
210
|
!1
|
|
207
211
|
));
|
|
208
|
-
|
|
212
|
+
__privateAdd(this, _disabledCSSProperty, new CSSProperty(
|
|
209
213
|
this,
|
|
210
214
|
"--scroll-region-disabled",
|
|
211
215
|
!1
|
|
212
216
|
));
|
|
213
|
-
|
|
217
|
+
__privateAdd(this, _startOffsetCSSProperty, new CSSProperty(
|
|
214
218
|
this,
|
|
215
219
|
"--scroll-region-start-offset",
|
|
216
220
|
0,
|
|
@@ -218,7 +222,7 @@ class Ot extends HTMLElement {
|
|
|
218
222
|
rawValueCheck: !1
|
|
219
223
|
}
|
|
220
224
|
));
|
|
221
|
-
|
|
225
|
+
__privateAdd(this, _startOffsetMinCSSProperty, new CSSProperty(
|
|
222
226
|
this,
|
|
223
227
|
"--scroll-region-start-offset-min",
|
|
224
228
|
!1,
|
|
@@ -226,7 +230,7 @@ class Ot extends HTMLElement {
|
|
|
226
230
|
rawValueCheck: !1
|
|
227
231
|
}
|
|
228
232
|
));
|
|
229
|
-
|
|
233
|
+
__privateAdd(this, _startExtraOffsetCSSProperty, new CSSProperty(
|
|
230
234
|
this,
|
|
231
235
|
"--scroll-region-start-extra-offset",
|
|
232
236
|
0,
|
|
@@ -234,7 +238,7 @@ class Ot extends HTMLElement {
|
|
|
234
238
|
rawValueCheck: !1
|
|
235
239
|
}
|
|
236
240
|
));
|
|
237
|
-
|
|
241
|
+
__privateAdd(this, _distanceCSSProperty, new CSSProperty(
|
|
238
242
|
this,
|
|
239
243
|
"--scroll-region-distance",
|
|
240
244
|
0,
|
|
@@ -242,7 +246,7 @@ class Ot extends HTMLElement {
|
|
|
242
246
|
rawValueCheck: !1
|
|
243
247
|
}
|
|
244
248
|
));
|
|
245
|
-
|
|
249
|
+
__privateAdd(this, _distanceOffsetCSSProperty, new CSSProperty(
|
|
246
250
|
this,
|
|
247
251
|
"--scroll-region-distance-offset",
|
|
248
252
|
0,
|
|
@@ -250,138 +254,139 @@ class Ot extends HTMLElement {
|
|
|
250
254
|
rawValueCheck: !1
|
|
251
255
|
}
|
|
252
256
|
));
|
|
253
|
-
|
|
257
|
+
__privateAdd(this, _progressVarCSSProperty, new CSSProperty(
|
|
254
258
|
this,
|
|
255
259
|
"--scroll-region-progress-var",
|
|
256
260
|
""
|
|
257
261
|
));
|
|
258
|
-
|
|
262
|
+
__privateAdd(this, _enterOnceCSSProperty, new CSSProperty(
|
|
259
263
|
this,
|
|
260
264
|
"--scroll-region-enter-once",
|
|
261
265
|
!1
|
|
262
266
|
));
|
|
263
|
-
|
|
267
|
+
__privateAdd(this, _status, new ElementLinkedStore(this, {
|
|
264
268
|
enabled: !1,
|
|
265
269
|
entered: !1,
|
|
266
270
|
enteredOnLoad: !1,
|
|
267
271
|
activated: !1
|
|
268
272
|
}));
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
273
|
+
__privateAdd(this, _initialPosition, 0);
|
|
274
|
+
__privateAdd(this, _start, 0);
|
|
275
|
+
__privateAdd(this, _finish, 0);
|
|
276
|
+
__privateAdd(this, _distance, 0);
|
|
277
|
+
__privateAdd(this, _scrolled, 0);
|
|
278
|
+
__privateAdd(this, _progress, 0);
|
|
279
|
+
__privateAdd(this, _visible, !1);
|
|
280
|
+
__privateAdd(this, _resizeListener3, /* @__PURE__ */ __name(() => {
|
|
277
281
|
this.resize();
|
|
278
|
-
});
|
|
279
|
-
|
|
282
|
+
}, "#resizeListener"));
|
|
283
|
+
__privateAdd(this, _tickListener2, /* @__PURE__ */ __name(() => {
|
|
280
284
|
this.tick();
|
|
281
|
-
});
|
|
282
|
-
|
|
283
|
-
document.readyState === "complete" &&
|
|
284
|
-
});
|
|
285
|
+
}, "#tickListener"));
|
|
286
|
+
__privateAdd(this, _readyStateChangeListener, /* @__PURE__ */ __name(() => {
|
|
287
|
+
document.readyState === "complete" && __privateMethod(this, _ScrollRegionElement_instances, init_fn).call(this);
|
|
288
|
+
}, "#readyStateChangeListener"));
|
|
285
289
|
}
|
|
286
290
|
get start() {
|
|
287
|
-
return
|
|
291
|
+
return __privateGet(this, _start);
|
|
288
292
|
}
|
|
289
293
|
get finish() {
|
|
290
|
-
return
|
|
294
|
+
return __privateGet(this, _finish);
|
|
291
295
|
}
|
|
292
296
|
get distance() {
|
|
293
|
-
return
|
|
297
|
+
return __privateGet(this, _distance);
|
|
294
298
|
}
|
|
295
299
|
get scrolled() {
|
|
296
|
-
return
|
|
300
|
+
return __privateGet(this, _scrolled);
|
|
297
301
|
}
|
|
298
302
|
get progress() {
|
|
299
|
-
return
|
|
303
|
+
return __privateGet(this, _progress);
|
|
300
304
|
}
|
|
301
305
|
get status() {
|
|
302
|
-
return
|
|
306
|
+
return __privateGet(this, _status);
|
|
303
307
|
}
|
|
304
308
|
get scrollValue() {
|
|
305
|
-
return
|
|
309
|
+
return __privateGet(this, _scrollElement2) instanceof HTMLElement ? __privateGet(this, _scrollElement2).scrollTop : __privateGet(this, _scrollElement2).scrollY;
|
|
306
310
|
}
|
|
307
311
|
resize() {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
)) :
|
|
312
|
+
__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(
|
|
313
|
+
__privateGet(this, _startOffsetCSSProperty).current,
|
|
314
|
+
__privateGet(this, _startOffsetMinCSSProperty).current
|
|
315
|
+
)) : __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
316
|
}
|
|
313
317
|
tick() {
|
|
314
|
-
if (
|
|
318
|
+
if (__privateGet(this, _disabledCSSProperty).current)
|
|
315
319
|
return;
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
),
|
|
320
|
+
const scrollValue = this.scrollValue;
|
|
321
|
+
__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(
|
|
322
|
+
__privateMethod(this, _ScrollRegionElement_instances, cssVar_fn).call(this, __privateGet(this, _progressVarCSSProperty).current),
|
|
323
|
+
__privateGet(this, _progress).toFixed(6)
|
|
324
|
+
), __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
325
|
detail: {
|
|
322
|
-
progress:
|
|
323
|
-
scrolled:
|
|
326
|
+
progress: __privateGet(this, _progress),
|
|
327
|
+
scrolled: __privateGet(this, _scrolled)
|
|
324
328
|
}
|
|
325
329
|
});
|
|
326
330
|
}
|
|
327
331
|
destroy() {
|
|
328
332
|
document.removeEventListener(
|
|
329
333
|
"readystatechange",
|
|
330
|
-
|
|
331
|
-
), this.disable(!1),
|
|
334
|
+
__privateGet(this, _readyStateChangeListener)
|
|
335
|
+
), 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
336
|
}
|
|
333
337
|
enable() {
|
|
334
|
-
|
|
338
|
+
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
339
|
}
|
|
336
|
-
disable(
|
|
337
|
-
|
|
340
|
+
disable(resetStatus = !0) {
|
|
341
|
+
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
342
|
}
|
|
339
343
|
connectedCallback() {
|
|
340
|
-
const
|
|
341
|
-
|
|
344
|
+
const scrollSelector = this.getAttribute("data-scroll") || ".page-scroll";
|
|
345
|
+
__privateSet(this, _scrollElement2, document.querySelector(scrollSelector)), document.readyState === "complete" ? __privateGet(this, _readyStateChangeListener).call(this) : document.addEventListener(
|
|
342
346
|
"readystatechange",
|
|
343
|
-
|
|
347
|
+
__privateGet(this, _readyStateChangeListener)
|
|
344
348
|
);
|
|
345
349
|
}
|
|
346
350
|
disconnectedCallback() {
|
|
347
351
|
this.destroy();
|
|
348
352
|
}
|
|
349
|
-
}
|
|
350
|
-
|
|
353
|
+
};
|
|
354
|
+
_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
355
|
this.hasAttribute("data-global-class") && document.documentElement.classList.add(
|
|
352
356
|
this.getAttribute("data-global-class")
|
|
353
357
|
);
|
|
354
|
-
},
|
|
358
|
+
}, "#addGlobalClasses"), removeGlobalClasses_fn = /* @__PURE__ */ __name(function() {
|
|
355
359
|
this.hasAttribute("data-global-class") && document.documentElement.classList.remove(
|
|
356
360
|
this.getAttribute("data-global-class")
|
|
357
361
|
);
|
|
358
|
-
},
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}),
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
),
|
|
365
|
-
}),
|
|
362
|
+
}, "#removeGlobalClasses"), init_fn = /* @__PURE__ */ __name(function() {
|
|
363
|
+
__privateGet(this, _statusHolderCSSProperty).subscribe((e) => {
|
|
364
|
+
__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));
|
|
365
|
+
}), __privateGet(this, _progressHolderCSSProperty).subscribe((e) => {
|
|
366
|
+
__privateGet(this, _progressHolderElement) && __privateGet(this, _progressHolderElement).style.removeProperty(
|
|
367
|
+
__privateMethod(this, _ScrollRegionElement_instances, cssVar_fn).call(this, __privateGet(this, _progressVarCSSProperty).current)
|
|
368
|
+
), __privateSet(this, _progressHolderElement, e.current ? document.querySelector(e.current) || this : this);
|
|
369
|
+
}), __privateGet(this, _disabledCSSProperty).subscribe((e) => {
|
|
366
370
|
e.current && !e.previous ? this.disable() : this.enable();
|
|
367
|
-
}),
|
|
368
|
-
e.current ?
|
|
369
|
-
|
|
371
|
+
}), __privateGet(this, _progressVarCSSProperty).subscribe((e) => {
|
|
372
|
+
e.current ? __privateGet(this, _tickListener2).call(this) : e.previous && __privateGet(this, _progressHolderElement).style.removeProperty(
|
|
373
|
+
__privateMethod(this, _ScrollRegionElement_instances, cssVar_fn).call(this, e.previous)
|
|
370
374
|
);
|
|
371
|
-
}),
|
|
372
|
-
|
|
373
|
-
}),
|
|
374
|
-
},
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
},
|
|
378
|
-
|
|
379
|
-
},
|
|
380
|
-
return `--${
|
|
381
|
-
},
|
|
382
|
-
|
|
375
|
+
}), __privateGet(this, _distanceCSSProperty).subscribe(() => {
|
|
376
|
+
__privateGet(this, _resizeListener3).call(this);
|
|
377
|
+
}), __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();
|
|
378
|
+
}, "#init"), _resizeListener3 = new WeakMap(), _tickListener2 = new WeakMap(), enter_fn = /* @__PURE__ */ __name(function() {
|
|
379
|
+
const scrollValue = this.scrollValue;
|
|
380
|
+
__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");
|
|
381
|
+
}, "#enter"), exit_fn = /* @__PURE__ */ __name(function() {
|
|
382
|
+
__privateGet(this, _status).set("entered", !1), __privateMethod(this, _ScrollRegionElement_instances, removeGlobalClasses_fn).call(this), dispatchEvent(this, "scrollRegionExit");
|
|
383
|
+
}, "#exit"), cssVar_fn = /* @__PURE__ */ __name(function(value) {
|
|
384
|
+
return `--${value}`;
|
|
385
|
+
}, "#cssVar"), _readyStateChangeListener = new WeakMap(), __name(_ScrollRegionElement, "ScrollRegionElement");
|
|
386
|
+
let ScrollRegionElement = _ScrollRegionElement;
|
|
387
|
+
customElements.get("e-scroll-region") || customElements.define("e-scroll-region", ScrollRegionElement);
|
|
383
388
|
export {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
389
|
+
ScrollRegionElement,
|
|
390
|
+
ScrollbarElement,
|
|
391
|
+
SmoothScrollElement
|
|
387
392
|
};
|