vevet 1.4.27 → 2.0.1-dev.3
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/LICENSE +1 -1
- package/README.md +7 -71
- package/build/cdn/index.js +12 -0
- package/build/cdn/index.js.LICENSE.txt +14 -0
- package/build/cjs/app/Application.js +297 -0
- package/build/cjs/app/events/PageLoad.js +74 -0
- package/build/cjs/app/events/Viewport.js +303 -0
- package/build/cjs/base/Callbacks.js +232 -0
- package/build/cjs/base/Component.js +56 -0
- package/build/cjs/base/Module.js +262 -0
- package/build/cjs/base/MutableProp.js +165 -0
- package/build/cjs/base/Plugin.js +56 -0
- package/build/cjs/components/animation-frame/AnimationFrame.js +183 -0
- package/build/cjs/components/canvas/Ctx2D.js +200 -0
- package/build/cjs/components/canvas/Ctx2DPrerender.js +72 -0
- package/build/cjs/components/cursor/CustomCursor.js +344 -0
- package/build/cjs/components/dragger/Dragger.js +229 -0
- package/build/cjs/components/dragger/DraggerDirection.js +77 -0
- package/build/cjs/components/dragger/DraggerMove.js +84 -0
- package/build/cjs/components/loading/Preloader.js +229 -0
- package/build/cjs/components/loading/ProgressPreloader.js +377 -0
- package/build/cjs/components/page/Page.js +353 -0
- package/build/cjs/components/scroll/custom-scroll/CustomScroll.js +517 -0
- package/build/cjs/components/scroll/plugins/SmoothScrollDragPlugin.js +178 -0
- package/build/cjs/components/scroll/plugins/SmoothScrollKeyboardPlugin.js +138 -0
- package/build/cjs/components/scroll/scrollable/ScrollEventsBase.js +133 -0
- package/build/cjs/components/scroll/scrollable/ScrollView.js +315 -0
- package/build/cjs/components/scroll/scrollbar/Bar.js +315 -0
- package/build/cjs/components/scroll/scrollbar/ScrollBar.js +206 -0
- package/build/cjs/components/scroll/smooth-scroll/SmoothScroll.js +625 -0
- package/build/cjs/components/scroll/types.js +2 -0
- package/build/cjs/components/split-text/SplitText.js +233 -0
- package/build/cjs/components/text/SplitText.js +329 -0
- package/build/cjs/components/timeline/StaticTimeline.js +137 -0
- package/build/cjs/components/timeline/Timeline.js +190 -0
- package/build/cjs/index.js +87 -0
- package/build/cjs/utils/common/index.js +12 -0
- package/build/cjs/utils/common/mergeWithoutArrays.js +19 -0
- package/build/cjs/utils/common/randID.js +11 -0
- package/build/cjs/utils/common/timeoutCallback.js +17 -0
- package/build/cjs/utils/errors.js +8 -0
- package/build/cjs/utils/listeners/index.js +10 -0
- package/build/cjs/utils/listeners/intersectionObserverSupported.js +11 -0
- package/build/cjs/utils/listeners/onScroll.js +47 -0
- package/build/cjs/utils/math/boundVal.js +16 -0
- package/build/cjs/utils/math/index.js +12 -0
- package/build/cjs/utils/math/lerp.js +15 -0
- package/build/cjs/utils/math/scopeProgress.js +25 -0
- package/build/cjs/utils/types/general.js +2 -0
- package/build/cjs/utils/types/utility.js +2 -0
- package/build/es/app/Application.js +210 -0
- package/build/es/app/events/PageLoad.js +47 -0
- package/build/es/app/events/Viewport.js +232 -0
- package/build/es/base/Callbacks.js +205 -0
- package/build/es/base/Component.js +32 -0
- package/build/es/base/Module.js +225 -0
- package/build/es/base/MutableProp.js +152 -0
- package/build/es/base/Plugin.js +31 -0
- package/build/es/components/animation-frame/AnimationFrame.js +145 -0
- package/build/es/components/canvas/Ctx2D.js +133 -0
- package/build/es/components/canvas/Ctx2DPrerender.js +37 -0
- package/build/es/components/cursor/CustomCursor.js +274 -0
- package/build/es/components/dragger/Dragger.js +175 -0
- package/build/es/components/dragger/DraggerDirection.js +42 -0
- package/build/es/components/dragger/DraggerMove.js +56 -0
- package/build/es/components/loading/Preloader.js +164 -0
- package/build/es/components/loading/ProgressPreloader.js +304 -0
- package/build/es/components/page/Page.js +283 -0
- package/build/es/components/scroll/custom-scroll/CustomScroll.js +486 -0
- package/build/es/components/scroll/plugins/SmoothScrollDragPlugin.js +140 -0
- package/build/es/components/scroll/plugins/SmoothScrollKeyboardPlugin.js +109 -0
- package/build/es/components/scroll/scrollable/ScrollEventsBase.js +79 -0
- package/build/es/components/scroll/scrollable/ScrollView.js +264 -0
- package/build/es/components/scroll/scrollbar/Bar.js +262 -0
- package/build/es/components/scroll/scrollbar/ScrollBar.js +152 -0
- package/build/es/components/scroll/smooth-scroll/SmoothScroll.js +519 -0
- package/build/es/components/scroll/types.js +1 -0
- package/build/es/components/split-text/SplitText.js +199 -0
- package/build/es/components/text/SplitText.js +270 -0
- package/build/es/components/timeline/StaticTimeline.js +92 -0
- package/build/es/components/timeline/Timeline.js +141 -0
- package/build/es/index.js +37 -0
- package/build/es/utils/common/index.js +4 -0
- package/build/es/utils/common/mergeWithoutArrays.js +13 -0
- package/build/es/utils/common/randID.js +7 -0
- package/build/es/utils/common/timeoutCallback.js +14 -0
- package/build/es/utils/errors.js +5 -0
- package/build/es/utils/listeners/index.js +3 -0
- package/build/es/utils/listeners/intersectionObserverSupported.js +8 -0
- package/build/es/utils/listeners/onScroll.js +44 -0
- package/build/es/utils/math/boundVal.js +12 -0
- package/build/es/utils/math/index.js +4 -0
- package/build/es/utils/math/lerp.js +11 -0
- package/build/es/utils/math/scopeProgress.js +22 -0
- package/build/es/utils/types/general.js +1 -0
- package/build/es/utils/types/utility.js +1 -0
- package/build/types/app/Application.d.ts +161 -0
- package/build/types/app/Application.d.ts.map +1 -0
- package/build/types/app/events/PageLoad.d.ts +28 -0
- package/build/types/app/events/PageLoad.d.ts.map +1 -0
- package/build/types/app/events/Viewport.d.ts +137 -0
- package/build/types/app/events/Viewport.d.ts.map +1 -0
- package/build/types/base/Callbacks.d.ts +174 -0
- package/build/types/base/Callbacks.d.ts.map +1 -0
- package/build/types/base/Component.d.ts +48 -0
- package/build/types/base/Component.d.ts.map +1 -0
- package/build/types/base/Module.d.ts +179 -0
- package/build/types/base/Module.d.ts.map +1 -0
- package/build/types/base/MutableProp.d.ts +142 -0
- package/build/types/base/MutableProp.d.ts.map +1 -0
- package/build/types/base/Plugin.d.ts +35 -0
- package/build/types/base/Plugin.d.ts.map +1 -0
- package/build/types/components/animation-frame/AnimationFrame.d.ts +96 -0
- package/build/types/components/animation-frame/AnimationFrame.d.ts.map +1 -0
- package/build/types/components/canvas/Ctx2D.d.ts +111 -0
- package/build/types/components/canvas/Ctx2D.d.ts.map +1 -0
- package/build/types/components/canvas/Ctx2DPrerender.d.ts +41 -0
- package/build/types/components/canvas/Ctx2DPrerender.d.ts.map +1 -0
- package/build/types/components/cursor/CustomCursor.d.ts +181 -0
- package/build/types/components/cursor/CustomCursor.d.ts.map +1 -0
- package/build/types/components/dragger/Dragger.d.ts +120 -0
- package/build/types/components/dragger/Dragger.d.ts.map +1 -0
- package/build/types/components/dragger/DraggerDirection.d.ts +39 -0
- package/build/types/components/dragger/DraggerDirection.d.ts.map +1 -0
- package/build/types/components/dragger/DraggerMove.d.ts +49 -0
- package/build/types/components/dragger/DraggerMove.d.ts.map +1 -0
- package/build/types/components/loading/Preloader.d.ts +107 -0
- package/build/types/components/loading/Preloader.d.ts.map +1 -0
- package/build/types/components/loading/ProgressPreloader.d.ts +166 -0
- package/build/types/components/loading/ProgressPreloader.d.ts.map +1 -0
- package/build/types/components/page/Page.d.ts +126 -0
- package/build/types/components/page/Page.d.ts.map +1 -0
- package/build/types/components/scroll/custom-scroll/CustomScroll.d.ts +322 -0
- package/build/types/components/scroll/custom-scroll/CustomScroll.d.ts.map +1 -0
- package/build/types/components/scroll/plugins/SmoothScrollDragPlugin.d.ts +97 -0
- package/build/types/components/scroll/plugins/SmoothScrollDragPlugin.d.ts.map +1 -0
- package/build/types/components/scroll/plugins/SmoothScrollKeyboardPlugin.d.ts +34 -0
- package/build/types/components/scroll/plugins/SmoothScrollKeyboardPlugin.d.ts.map +1 -0
- package/build/types/components/scroll/scrollable/ScrollEventsBase.d.ts +60 -0
- package/build/types/components/scroll/scrollable/ScrollEventsBase.d.ts.map +1 -0
- package/build/types/components/scroll/scrollable/ScrollView.d.ts +140 -0
- package/build/types/components/scroll/scrollable/ScrollView.d.ts.map +1 -0
- package/build/types/components/scroll/scrollbar/Bar.d.ts +84 -0
- package/build/types/components/scroll/scrollbar/Bar.d.ts.map +1 -0
- package/build/types/components/scroll/scrollbar/ScrollBar.d.ts +109 -0
- package/build/types/components/scroll/scrollbar/ScrollBar.d.ts.map +1 -0
- package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts +307 -0
- package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts.map +1 -0
- package/build/types/components/scroll/types.d.ts +11 -0
- package/build/types/components/scroll/types.d.ts.map +1 -0
- package/build/types/components/split-text/SplitText.d.ts +118 -0
- package/build/types/components/split-text/SplitText.d.ts.map +1 -0
- package/build/types/components/text/SplitText.d.ts +118 -0
- package/build/types/components/text/SplitText.d.ts.map +1 -0
- package/build/types/components/timeline/StaticTimeline.d.ts +92 -0
- package/build/types/components/timeline/StaticTimeline.d.ts.map +1 -0
- package/build/types/components/timeline/Timeline.d.ts +101 -0
- package/build/types/components/timeline/Timeline.d.ts.map +1 -0
- package/build/types/index.d.ts +38 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/utils/common/index.d.ts +5 -0
- package/build/types/utils/common/index.d.ts.map +1 -0
- package/build/types/utils/common/mergeWithoutArrays.d.ts +6 -0
- package/build/types/utils/common/mergeWithoutArrays.d.ts.map +1 -0
- package/build/types/utils/common/randID.d.ts +5 -0
- package/build/types/utils/common/randID.d.ts.map +1 -0
- package/build/types/utils/common/timeoutCallback.d.ts +6 -0
- package/build/types/utils/common/timeoutCallback.d.ts.map +1 -0
- package/build/types/utils/errors.d.ts +3 -0
- package/build/types/utils/errors.d.ts.map +1 -0
- package/build/types/utils/listeners/index.d.ts +4 -0
- package/build/types/utils/listeners/index.d.ts.map +1 -0
- package/build/types/utils/listeners/intersectionObserverSupported.d.ts +2 -0
- package/build/types/utils/listeners/intersectionObserverSupported.d.ts.map +1 -0
- package/build/types/utils/listeners/onScroll.d.ts +10 -0
- package/build/types/utils/listeners/onScroll.d.ts.map +1 -0
- package/build/types/utils/math/boundVal.d.ts +5 -0
- package/build/types/utils/math/boundVal.d.ts.map +1 -0
- package/build/types/utils/math/index.d.ts +5 -0
- package/build/types/utils/math/index.d.ts.map +1 -0
- package/build/types/utils/math/lerp.d.ts +5 -0
- package/build/types/utils/math/lerp.d.ts.map +1 -0
- package/build/types/utils/math/scopeProgress.d.ts +20 -0
- package/build/types/utils/math/scopeProgress.d.ts.map +1 -0
- package/build/types/utils/types/general.d.ts +7 -0
- package/build/types/utils/types/general.d.ts.map +1 -0
- package/build/types/utils/types/utility.d.ts +14 -0
- package/build/types/utils/types/utility.d.ts.map +1 -0
- package/package.json +88 -82
- package/src/cdn/index.js +3 -0
- package/src/sass/base.scss +3 -0
- package/src/sass/components/cursor/_custom-cursor.scss +63 -0
- package/src/sass/components/index.scss +6 -0
- package/src/sass/components/loading/_preloader.scss +15 -0
- package/src/sass/components/scroll/_scrollbar.scss +73 -0
- package/src/sass/components/scroll/_smooth-scroll.scss +17 -0
- package/src/sass/index.scss +3 -0
- package/src/sass/mixins/_scroll.scss +7 -0
- package/{dist/scss → src/sass}/mixins/_transition.scss +8 -4
- package/src/sass/mixins/_viewport.scss +69 -0
- package/src/sass/mixins/index.scss +3 -0
- package/src/ts/app/Application.ts +350 -0
- package/src/ts/app/events/PageLoad.ts +79 -0
- package/src/ts/app/events/Viewport.ts +365 -0
- package/src/ts/base/Callbacks.ts +380 -0
- package/src/ts/base/Component.ts +83 -0
- package/src/ts/base/Module.ts +385 -0
- package/src/ts/base/MutableProp.ts +242 -0
- package/src/ts/base/Plugin.ts +76 -0
- package/src/ts/components/animation-frame/AnimationFrame.ts +264 -0
- package/src/ts/components/canvas/Ctx2D.ts +260 -0
- package/src/ts/components/canvas/Ctx2DPrerender.ts +96 -0
- package/src/ts/components/cursor/CustomCursor.ts +462 -0
- package/src/ts/components/dragger/Dragger.ts +313 -0
- package/src/ts/components/dragger/DraggerDirection.ts +106 -0
- package/src/ts/components/dragger/DraggerMove.ts +114 -0
- package/src/ts/components/loading/Preloader.ts +279 -0
- package/src/ts/components/loading/ProgressPreloader.ts +484 -0
- package/src/ts/components/page/Page.ts +421 -0
- package/src/ts/components/scroll/plugins/SmoothScrollDragPlugin.ts +251 -0
- package/src/ts/components/scroll/plugins/SmoothScrollKeyboardPlugin.ts +166 -0
- package/src/ts/components/scroll/scrollable/ScrollEventsBase.ts +151 -0
- package/src/ts/components/scroll/scrollable/ScrollView.ts +435 -0
- package/src/ts/components/scroll/scrollbar/Bar.ts +364 -0
- package/src/ts/components/scroll/scrollbar/ScrollBar.ts +292 -0
- package/src/ts/components/scroll/smooth-scroll/SmoothScroll.ts +861 -0
- package/src/ts/components/scroll/types.ts +10 -0
- package/src/ts/components/text/SplitText.ts +418 -0
- package/src/ts/components/timeline/StaticTimeline.ts +197 -0
- package/src/ts/components/timeline/Timeline.ts +256 -0
- package/src/ts/index.ts +94 -0
- package/src/ts/utils/common/index.ts +9 -0
- package/src/ts/utils/common/mergeWithoutArrays.ts +20 -0
- package/src/ts/utils/common/randID.ts +9 -0
- package/src/ts/utils/common/timeoutCallback.ts +16 -0
- package/src/ts/utils/errors.ts +6 -0
- package/src/ts/utils/listeners/index.ts +7 -0
- package/src/ts/utils/listeners/intersectionObserverSupported.ts +10 -0
- package/src/ts/utils/listeners/onScroll.ts +56 -0
- package/src/ts/utils/math/boundVal.ts +15 -0
- package/src/ts/utils/math/index.ts +9 -0
- package/src/ts/utils/math/lerp.ts +16 -0
- package/src/ts/utils/math/scopeProgress.ts +23 -0
- package/src/ts/utils/types/general.ts +7 -0
- package/src/ts/utils/types/utility.ts +34 -0
- package/dist/js/AJAXEvent.js +0 -355
- package/dist/js/Application.js +0 -345
- package/dist/js/ColumnsModule.js +0 -392
- package/dist/js/CursorModule.js +0 -390
- package/dist/js/DraggerModule.js +0 -792
- package/dist/js/Event.js +0 -538
- package/dist/js/FilterModule.js +0 -943
- package/dist/js/FormModule.js +0 -706
- package/dist/js/FrameModule.js +0 -229
- package/dist/js/IntervalModule.js +0 -270
- package/dist/js/KeydownModule.js +0 -293
- package/dist/js/LoadEvent.js +0 -106
- package/dist/js/MenuBaseModule.js +0 -292
- package/dist/js/MenuModule.js +0 -265
- package/dist/js/MenuTimelineModule.js +0 -321
- package/dist/js/Module.js +0 -478
- package/dist/js/PageAjaxModule.js +0 -1010
- package/dist/js/PageLoadMediaPlugin.js +0 -285
- package/dist/js/PageModule.js +0 -440
- package/dist/js/PaginationModule.js +0 -961
- package/dist/js/PaginationScrollPlugin.js +0 -209
- package/dist/js/Plugin.js +0 -114
- package/dist/js/PopupModule.js +0 -942
- package/dist/js/PreloaderModule.js +0 -724
- package/dist/js/ResponsiveProp.js +0 -301
- package/dist/js/ScrollAnchorModule.js +0 -554
- package/dist/js/ScrollAnimateModule.js +0 -419
- package/dist/js/ScrollBarPlugin.js +0 -594
- package/dist/js/ScrollDragPlugin.js +0 -396
- package/dist/js/ScrollModule.js +0 -1071
- package/dist/js/ScrollViewModule.js +0 -388
- package/dist/js/SelectModule.js +0 -860
- package/dist/js/SliderCanvasModule.js +0 -733
- package/dist/js/SliderControlsPlugin.js +0 -247
- package/dist/js/SliderCounterPlugin.js +0 -278
- package/dist/js/SliderDotsPlugin.js +0 -270
- package/dist/js/SliderDragSwipePlugin.js +0 -245
- package/dist/js/SliderIntervalPlugin.js +0 -192
- package/dist/js/SliderKeydownPlugin.js +0 -185
- package/dist/js/SliderModule.js +0 -1062
- package/dist/js/SliderWheelPlugin.js +0 -194
- package/dist/js/TextAnimateModule.js +0 -663
- package/dist/js/TextSplitModule.js +0 -785
- package/dist/js/TimelineBaseModule.js +0 -405
- package/dist/js/TimelineModule.js +0 -494
- package/dist/js/URLEvent.js +0 -239
- package/dist/js/ViewportEvent.js +0 -465
- package/dist/js/WheelEventModule.js +0 -295
- package/dist/js/domChildOf.js +0 -46
- package/dist/js/domChildren.js +0 -47
- package/dist/js/domInsertAfter.js +0 -32
- package/dist/js/domRemoveChildren.js +0 -26
- package/dist/js/easing.js +0 -363
- package/dist/js/eventListenerAdd.js +0 -87
- package/dist/js/eventListenerGet.js +0 -49
- package/dist/js/eventListenerRemove.js +0 -36
- package/dist/js/generateId.js +0 -29
- package/dist/js/getBrowserName.js +0 -60
- package/dist/js/getOsName.js +0 -39
- package/dist/js/getVevetProperties.js +0 -22
- package/dist/js/index.js +0 -519
- package/dist/js/mathScopeProgress.js +0 -32
- package/dist/js/mathSpreadScopeProgress.js +0 -35
- package/dist/js/merge.js +0 -33
- package/dist/js/normalizeWheel.js +0 -97
- package/dist/js/text_animate_module_addons/_composite_elementary.js +0 -196
- package/dist/js/text_animate_module_addons/_elementary.js +0 -88
- package/dist/js/timeoutCallback.js +0 -26
- package/dist/js/vevet.js +0 -10
- package/dist/scss/_prefix.scss +0 -1
- package/dist/scss/classes/_clear.scss +0 -5
- package/dist/scss/classes/_col-row.scss +0 -48
- package/dist/scss/classes/_display.scss +0 -65
- package/dist/scss/classes/_document-reset.scss +0 -28
- package/dist/scss/classes/_document.scss +0 -7
- package/dist/scss/classes/_overflow.scss +0 -39
- package/dist/scss/classes/_position.scss +0 -55
- package/dist/scss/classes/_text.scss +0 -24
- package/dist/scss/classes/_transition.scss +0 -22
- package/dist/scss/classes/_wrap.scss +0 -31
- package/dist/scss/classes/index.scss +0 -14
- package/dist/scss/index.scss +0 -3
- package/dist/scss/mixins/_clear.scss +0 -6
- package/dist/scss/mixins/_display.scss +0 -6
- package/dist/scss/mixins/_form.scss +0 -14
- package/dist/scss/mixins/_position.scss +0 -42
- package/dist/scss/mixins/_reset.scss +0 -17
- package/dist/scss/mixins/_responsive.scss +0 -88
- package/dist/scss/mixins/index.scss +0 -7
- package/dist/scss/modules/columns/_settings.scss +0 -1
- package/dist/scss/modules/columns/index.scss +0 -19
- package/dist/scss/modules/cursor/_settings.scss +0 -7
- package/dist/scss/modules/cursor/index.scss +0 -15
- package/dist/scss/modules/form/_settings.scss +0 -15
- package/dist/scss/modules/form/index.scss +0 -57
- package/dist/scss/modules/index.scss +0 -11
- package/dist/scss/modules/menu/_button.scss +0 -58
- package/dist/scss/modules/menu/_menu.scss +0 -25
- package/dist/scss/modules/menu/_settings.scss +0 -23
- package/dist/scss/modules/menu/index.scss +0 -3
- package/dist/scss/modules/pagination/_settings.scss +0 -6
- package/dist/scss/modules/pagination/index.scss +0 -24
- package/dist/scss/modules/popup/_settings.scss +0 -26
- package/dist/scss/modules/popup/index.scss +0 -294
- package/dist/scss/modules/preloader/_settings.scss +0 -3
- package/dist/scss/modules/preloader/index.scss +0 -19
- package/dist/scss/modules/scroll/_settings.scss +0 -22
- package/dist/scss/modules/scroll/index.scss +0 -94
- package/dist/scss/modules/select/_settings.scss +0 -28
- package/dist/scss/modules/select/index.scss +0 -142
- package/dist/scss/modules/slider/_settings.scss +0 -35
- package/dist/scss/modules/slider/index.scss +0 -153
- package/dist/scss/modules/text/_settings.scss +0 -1
- package/dist/scss/modules/text/index.scss +0 -19
- package/dist/types/types.d.ts +0 -18763
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var vevet_dom_1 = require("vevet-dom");
|
|
7
|
+
var onScroll_1 = __importDefault(require("../../../utils/listeners/onScroll"));
|
|
8
|
+
var boundVal_1 = __importDefault(require("../../../utils/math/boundVal"));
|
|
9
|
+
var DraggerMove_1 = require("../../dragger/DraggerMove");
|
|
10
|
+
var SmoothScroll_1 = require("../smooth-scroll/SmoothScroll");
|
|
11
|
+
var Bar = /** @class */ (function () {
|
|
12
|
+
function Bar(_prop) {
|
|
13
|
+
this._prop = _prop;
|
|
14
|
+
var prefix = _prop.prefix, dir = _prop.dir, domParent = _prop.domParent, container = _prop.container, autoHide = _prop.autoHide;
|
|
15
|
+
// set default vars
|
|
16
|
+
this._outerHeight = 0;
|
|
17
|
+
this._outerWidth = 0;
|
|
18
|
+
this._thumbHeight = 0;
|
|
19
|
+
this._thumbWidth = 0;
|
|
20
|
+
this._scrollVal = 0;
|
|
21
|
+
this._coordsAtDragStart = {
|
|
22
|
+
left: 0,
|
|
23
|
+
top: 0,
|
|
24
|
+
};
|
|
25
|
+
// create outer
|
|
26
|
+
var outerClassNames = prefix + " " + prefix + "_" + dir;
|
|
27
|
+
if (container instanceof Window) {
|
|
28
|
+
outerClassNames += ' in-window';
|
|
29
|
+
}
|
|
30
|
+
this._outer = vevet_dom_1.createElement('div', {
|
|
31
|
+
parent: domParent,
|
|
32
|
+
class: outerClassNames,
|
|
33
|
+
});
|
|
34
|
+
// create a thumb
|
|
35
|
+
this._thumb = vevet_dom_1.createElement('div', {
|
|
36
|
+
parent: this._outer,
|
|
37
|
+
class: prefix + "__thumb " + prefix + "__thumb_" + dir,
|
|
38
|
+
});
|
|
39
|
+
// set auto hide classes
|
|
40
|
+
if (autoHide) {
|
|
41
|
+
this.outer.classList.add('auto-hide');
|
|
42
|
+
}
|
|
43
|
+
// set events
|
|
44
|
+
this._listeners = [];
|
|
45
|
+
this._setEvents();
|
|
46
|
+
}
|
|
47
|
+
Object.defineProperty(Bar.prototype, "outer", {
|
|
48
|
+
get: function () {
|
|
49
|
+
return this._outer;
|
|
50
|
+
},
|
|
51
|
+
enumerable: false,
|
|
52
|
+
configurable: true
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(Bar.prototype, "thumb", {
|
|
55
|
+
get: function () {
|
|
56
|
+
return this._thumb;
|
|
57
|
+
},
|
|
58
|
+
enumerable: false,
|
|
59
|
+
configurable: true
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(Bar.prototype, "prefix", {
|
|
62
|
+
// global
|
|
63
|
+
get: function () {
|
|
64
|
+
return this._prop.prefix;
|
|
65
|
+
},
|
|
66
|
+
enumerable: false,
|
|
67
|
+
configurable: true
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(Bar.prototype, "isX", {
|
|
70
|
+
get: function () {
|
|
71
|
+
return this.prop.dir === 'x';
|
|
72
|
+
},
|
|
73
|
+
enumerable: false,
|
|
74
|
+
configurable: true
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(Bar.prototype, "isY", {
|
|
77
|
+
get: function () {
|
|
78
|
+
return !this.isX;
|
|
79
|
+
},
|
|
80
|
+
enumerable: false,
|
|
81
|
+
configurable: true
|
|
82
|
+
});
|
|
83
|
+
Object.defineProperty(Bar.prototype, "scrollElement", {
|
|
84
|
+
get: function () {
|
|
85
|
+
return this.prop.container instanceof Window
|
|
86
|
+
? document.documentElement : this.prop.container;
|
|
87
|
+
},
|
|
88
|
+
enumerable: false,
|
|
89
|
+
configurable: true
|
|
90
|
+
});
|
|
91
|
+
Object.defineProperty(Bar.prototype, "scrollLine", {
|
|
92
|
+
get: function () {
|
|
93
|
+
var scrollElement = this.scrollElement;
|
|
94
|
+
return this.isX
|
|
95
|
+
? scrollElement.scrollWidth - scrollElement.clientWidth
|
|
96
|
+
: scrollElement.scrollHeight - scrollElement.clientHeight;
|
|
97
|
+
},
|
|
98
|
+
enumerable: false,
|
|
99
|
+
configurable: true
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(Bar.prototype, "scrollWidth", {
|
|
102
|
+
get: function () {
|
|
103
|
+
return this.scrollElement.scrollWidth;
|
|
104
|
+
},
|
|
105
|
+
enumerable: false,
|
|
106
|
+
configurable: true
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(Bar.prototype, "scrollHeight", {
|
|
109
|
+
get: function () {
|
|
110
|
+
return this.scrollElement.scrollHeight;
|
|
111
|
+
},
|
|
112
|
+
enumerable: false,
|
|
113
|
+
configurable: true
|
|
114
|
+
});
|
|
115
|
+
Object.defineProperty(Bar.prototype, "prop", {
|
|
116
|
+
get: function () {
|
|
117
|
+
return this._prop;
|
|
118
|
+
},
|
|
119
|
+
enumerable: false,
|
|
120
|
+
configurable: true
|
|
121
|
+
});
|
|
122
|
+
Object.defineProperty(Bar.prototype, "scrollValues", {
|
|
123
|
+
get: function () {
|
|
124
|
+
var container = this.prop.container;
|
|
125
|
+
var top = 0;
|
|
126
|
+
var left = 0;
|
|
127
|
+
if (container instanceof Window) {
|
|
128
|
+
top = container.pageYOffset;
|
|
129
|
+
left = container.pageXOffset;
|
|
130
|
+
}
|
|
131
|
+
else if (container instanceof SmoothScroll_1.SmoothScroll) {
|
|
132
|
+
top = container.targetTop;
|
|
133
|
+
left = container.targetLeft;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
top = container.scrollTop;
|
|
137
|
+
left = container.scrollLeft;
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
left: left,
|
|
141
|
+
top: top,
|
|
142
|
+
};
|
|
143
|
+
},
|
|
144
|
+
enumerable: false,
|
|
145
|
+
configurable: true
|
|
146
|
+
});
|
|
147
|
+
/**
|
|
148
|
+
* Set scrolblar events
|
|
149
|
+
*/
|
|
150
|
+
Bar.prototype._setEvents = function () {
|
|
151
|
+
var _this = this;
|
|
152
|
+
// set hover events
|
|
153
|
+
this._listeners.push(vevet_dom_1.addEventListener(this.outer, 'mouseenter', this._handleHover.bind(this, true)));
|
|
154
|
+
this._listeners.push(vevet_dom_1.addEventListener(this.outer, 'mouseleave', this._handleHover.bind(this, false)));
|
|
155
|
+
// set scroll events
|
|
156
|
+
this._scrollEvent = onScroll_1.default(this.prop.container, function (data) {
|
|
157
|
+
_this._handleScroll(data);
|
|
158
|
+
});
|
|
159
|
+
// set dragger
|
|
160
|
+
if (this.prop.isDraggable) {
|
|
161
|
+
this._dragger = new DraggerMove_1.DraggerMove({
|
|
162
|
+
container: this.thumb,
|
|
163
|
+
});
|
|
164
|
+
this._dragger.addCallback('start', function () {
|
|
165
|
+
_this.thumb.classList.add('in-action');
|
|
166
|
+
_this._disableScrollBehaviour(true);
|
|
167
|
+
_this._coordsAtDragStart = _this.scrollValues;
|
|
168
|
+
});
|
|
169
|
+
this._dragger.addCallback('move', function (data) {
|
|
170
|
+
_this._handleThumbDrag(data);
|
|
171
|
+
});
|
|
172
|
+
this._dragger.addCallback('end', function () {
|
|
173
|
+
_this.thumb.classList.remove('in-action');
|
|
174
|
+
_this._disableScrollBehaviour(false);
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Toggle scrollBehavior: disable & reset smooth scrolling
|
|
180
|
+
*/
|
|
181
|
+
Bar.prototype._disableScrollBehaviour = function (bool) {
|
|
182
|
+
var val = bool ? 'auto' : 'unset';
|
|
183
|
+
if (this.prop.container instanceof Window) {
|
|
184
|
+
document.documentElement.style.scrollBehavior = val;
|
|
185
|
+
}
|
|
186
|
+
else if (this.prop.container instanceof HTMLElement) {
|
|
187
|
+
document.documentElement.style.scrollBehavior = val;
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* Handle hover state
|
|
192
|
+
*/
|
|
193
|
+
Bar.prototype._handleHover = function (bool) {
|
|
194
|
+
this.outer.classList.toggle('is-hovered', bool);
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* Handle Scroll Event
|
|
198
|
+
*/
|
|
199
|
+
Bar.prototype._handleScroll = function (data) {
|
|
200
|
+
var _this = this;
|
|
201
|
+
// resize if needed
|
|
202
|
+
if (!this.prop.optimizeCalculations) {
|
|
203
|
+
this.resize();
|
|
204
|
+
}
|
|
205
|
+
// check if changes happened
|
|
206
|
+
var hasChanged = false;
|
|
207
|
+
if (this.isX) {
|
|
208
|
+
hasChanged = data.scrollLeft !== this._scrollVal;
|
|
209
|
+
this._scrollVal = data.scrollLeft;
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
hasChanged = data.scrollTop !== this._scrollVal;
|
|
213
|
+
this._scrollVal = data.scrollTop;
|
|
214
|
+
}
|
|
215
|
+
if (!hasChanged) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
// set auto hide
|
|
219
|
+
if (this.prop.autoHide && hasChanged) {
|
|
220
|
+
this.outer.classList.add('in-action');
|
|
221
|
+
if (this._actionTimeout) {
|
|
222
|
+
clearTimeout(this._actionTimeout);
|
|
223
|
+
this._actionTimeout = undefined;
|
|
224
|
+
}
|
|
225
|
+
this._actionTimeout = setTimeout(function () {
|
|
226
|
+
_this.outer.classList.remove('in-action');
|
|
227
|
+
}, 500);
|
|
228
|
+
}
|
|
229
|
+
// render thumb
|
|
230
|
+
if (this.prop.optimizeCalculations) {
|
|
231
|
+
this._renderThumb();
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* Event on dragger move
|
|
236
|
+
*/
|
|
237
|
+
Bar.prototype._handleThumbDrag = function (data) {
|
|
238
|
+
data.evt.preventDefault();
|
|
239
|
+
var container = this.prop.container;
|
|
240
|
+
// calculate scroll iterators
|
|
241
|
+
var leftIterator = ((data.coords.x - data.start.x) / (this._outerWidth - this._thumbWidth)) * this.scrollLine;
|
|
242
|
+
var topIterator = ((data.coords.y - data.start.y) / (this._outerHeight - this._thumbHeight)) * this.scrollLine;
|
|
243
|
+
// calculate new scroll values
|
|
244
|
+
var _a = this._coordsAtDragStart, left = _a.left, top = _a.top;
|
|
245
|
+
if (this.isX) {
|
|
246
|
+
left += leftIterator;
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
top += topIterator;
|
|
250
|
+
}
|
|
251
|
+
// apply the values
|
|
252
|
+
container.scrollTo({
|
|
253
|
+
top: top,
|
|
254
|
+
left: left,
|
|
255
|
+
behavior: container instanceof SmoothScroll_1.SmoothScroll ? this.prop.draggableScrollBehavior : 'auto',
|
|
256
|
+
});
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* Render the thumb
|
|
260
|
+
*/
|
|
261
|
+
Bar.prototype._renderThumb = function () {
|
|
262
|
+
// calculate progress
|
|
263
|
+
var progress = boundVal_1.default(this._scrollVal / this.scrollLine, [0, 1]);
|
|
264
|
+
// calculate transforms
|
|
265
|
+
var x = this.isX ? (this._outerWidth - this._thumbWidth) * progress : 0;
|
|
266
|
+
var y = this.isY ? (this._outerHeight - this._thumbHeight) * progress : 0;
|
|
267
|
+
// render the thumb
|
|
268
|
+
this._thumb.style.transform = "translate(" + x + "px, " + y + "px)";
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* Resize the scene
|
|
272
|
+
*/
|
|
273
|
+
Bar.prototype.resize = function () {
|
|
274
|
+
var _a = this, outer = _a.outer, thumb = _a.thumb, scrollLine = _a.scrollLine;
|
|
275
|
+
var minSize = this.prop.minSize;
|
|
276
|
+
// get outer sizes
|
|
277
|
+
this._outerHeight = outer.clientHeight;
|
|
278
|
+
this._outerWidth = outer.clientWidth;
|
|
279
|
+
// calculate thumb sizes
|
|
280
|
+
if (this.prop.autoSize) {
|
|
281
|
+
if (this.isX) {
|
|
282
|
+
var barSize = boundVal_1.default(this._outerWidth / (this.scrollWidth / (this.scrollWidth - scrollLine)), [minSize, Infinity]);
|
|
283
|
+
thumb.style.width = barSize + "px";
|
|
284
|
+
}
|
|
285
|
+
else {
|
|
286
|
+
var barSize = boundVal_1.default(this._outerHeight / (this.scrollHeight / (this.scrollHeight - scrollLine)), [minSize, Infinity]);
|
|
287
|
+
thumb.style.height = barSize + "px";
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
// get thumb sizes
|
|
291
|
+
this._thumbHeight = thumb.clientHeight;
|
|
292
|
+
this._thumbWidth = thumb.clientWidth;
|
|
293
|
+
// define if empty
|
|
294
|
+
outer.classList.toggle('is-empty', scrollLine === 0);
|
|
295
|
+
// render the scrollbar thumb
|
|
296
|
+
this._renderThumb();
|
|
297
|
+
};
|
|
298
|
+
Bar.prototype.destroy = function () {
|
|
299
|
+
this._listeners.forEach(function (listener) {
|
|
300
|
+
listener.remove();
|
|
301
|
+
});
|
|
302
|
+
if (this._scrollEvent) {
|
|
303
|
+
this._scrollEvent.remove();
|
|
304
|
+
}
|
|
305
|
+
if (this._actionTimeout) {
|
|
306
|
+
clearTimeout(this._actionTimeout);
|
|
307
|
+
}
|
|
308
|
+
if (this._dragger) {
|
|
309
|
+
this._dragger.destroy();
|
|
310
|
+
}
|
|
311
|
+
this._outer.remove();
|
|
312
|
+
};
|
|
313
|
+
return Bar;
|
|
314
|
+
}());
|
|
315
|
+
exports.default = Bar;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.ScrollBar = void 0;
|
|
33
|
+
var vevet_dom_1 = require("vevet-dom");
|
|
34
|
+
var Component_1 = require("../../../base/Component");
|
|
35
|
+
var SmoothScroll_1 = require("../smooth-scroll/SmoothScroll");
|
|
36
|
+
var Bar_1 = __importDefault(require("./Bar"));
|
|
37
|
+
/**
|
|
38
|
+
* Create custom scroll bar
|
|
39
|
+
*/
|
|
40
|
+
var ScrollBar = /** @class */ (function (_super) {
|
|
41
|
+
__extends(ScrollBar, _super);
|
|
42
|
+
function ScrollBar(initialProp, init) {
|
|
43
|
+
if (init === void 0) { init = true; }
|
|
44
|
+
var _this = _super.call(this, initialProp, false) || this;
|
|
45
|
+
var _a = _this.prop, autoHide = _a.autoHide, autoSize = _a.autoSize, minSize = _a.minSize, optimizeCalculations = _a.optimizeCalculations, isDraggable = _a.isDraggable, draggableScrollBehavior = _a.draggableScrollBehavior;
|
|
46
|
+
// get container
|
|
47
|
+
if (typeof _this.prop.container === 'string') {
|
|
48
|
+
var el = vevet_dom_1.selectOne(_this.prop.container);
|
|
49
|
+
if (el) {
|
|
50
|
+
_this._container = el;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
throw new Error('No scroll container');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
_this._container = _this.prop.container;
|
|
58
|
+
}
|
|
59
|
+
// create scrollBarsParent if needed
|
|
60
|
+
if (_this.container instanceof Element) {
|
|
61
|
+
var parentElement = _this.container.parentElement;
|
|
62
|
+
if (parentElement) {
|
|
63
|
+
_this._scrollWrapper = vevet_dom_1.createElement('div');
|
|
64
|
+
_this._scrollWrapper.style.position = 'relative';
|
|
65
|
+
_this._scrollWrapper.style.display = 'inline-block';
|
|
66
|
+
parentElement.insertBefore(_this._scrollWrapper, _this.container);
|
|
67
|
+
_this._scrollWrapper.appendChild(_this.container);
|
|
68
|
+
_this._scrollWrapper.classList.add(_this.prefix + "-wrapper");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// create bars
|
|
72
|
+
var barMainProp = {
|
|
73
|
+
container: _this.container,
|
|
74
|
+
domParent: _this.domParent,
|
|
75
|
+
autoHide: autoHide,
|
|
76
|
+
autoSize: autoSize,
|
|
77
|
+
minSize: minSize,
|
|
78
|
+
optimizeCalculations: optimizeCalculations,
|
|
79
|
+
prefix: _this.prefix,
|
|
80
|
+
isDraggable: isDraggable,
|
|
81
|
+
draggableScrollBehavior: draggableScrollBehavior,
|
|
82
|
+
};
|
|
83
|
+
_this._xBar = new Bar_1.default(__assign({ dir: 'x' }, barMainProp));
|
|
84
|
+
_this._yBar = new Bar_1.default(__assign({ dir: 'y' }, barMainProp));
|
|
85
|
+
// add styles
|
|
86
|
+
_this.scrollableElement.classList.add(_this.prefix + "-parent");
|
|
87
|
+
// initialize the class
|
|
88
|
+
if (init) {
|
|
89
|
+
_this.init();
|
|
90
|
+
}
|
|
91
|
+
return _this;
|
|
92
|
+
}
|
|
93
|
+
ScrollBar.prototype._getDefaultProp = function () {
|
|
94
|
+
return __assign(__assign({}, _super.prototype._getDefaultProp.call(this)), { container: window, domParent: false, draggable: true, autoSize: true, autoHide: true, minSize: 50, optimizeCalculations: false, isDraggable: true, draggableScrollBehavior: 'smooth' });
|
|
95
|
+
};
|
|
96
|
+
Object.defineProperty(ScrollBar.prototype, "prefix", {
|
|
97
|
+
get: function () {
|
|
98
|
+
return this._app.prefix + "scrollbar";
|
|
99
|
+
},
|
|
100
|
+
enumerable: false,
|
|
101
|
+
configurable: true
|
|
102
|
+
});
|
|
103
|
+
Object.defineProperty(ScrollBar.prototype, "container", {
|
|
104
|
+
/**
|
|
105
|
+
* Scroll container
|
|
106
|
+
*/
|
|
107
|
+
get: function () {
|
|
108
|
+
return this._container;
|
|
109
|
+
},
|
|
110
|
+
enumerable: false,
|
|
111
|
+
configurable: true
|
|
112
|
+
});
|
|
113
|
+
Object.defineProperty(ScrollBar.prototype, "scrollableElement", {
|
|
114
|
+
/**
|
|
115
|
+
* Get scrollable element
|
|
116
|
+
*/
|
|
117
|
+
get: function () {
|
|
118
|
+
var container = this.container;
|
|
119
|
+
if (container instanceof Window) {
|
|
120
|
+
return this._app.body;
|
|
121
|
+
}
|
|
122
|
+
if (container instanceof Element) {
|
|
123
|
+
return container;
|
|
124
|
+
}
|
|
125
|
+
return container.outer;
|
|
126
|
+
},
|
|
127
|
+
enumerable: false,
|
|
128
|
+
configurable: true
|
|
129
|
+
});
|
|
130
|
+
Object.defineProperty(ScrollBar.prototype, "domParent", {
|
|
131
|
+
/**
|
|
132
|
+
* The element into wchich scroll bars will be appended
|
|
133
|
+
*/
|
|
134
|
+
get: function () {
|
|
135
|
+
var domParent = this.prop.domParent;
|
|
136
|
+
var container = this.container;
|
|
137
|
+
if (!domParent) {
|
|
138
|
+
if (this._scrollWrapper) {
|
|
139
|
+
return this._scrollWrapper;
|
|
140
|
+
}
|
|
141
|
+
if (container instanceof Window) {
|
|
142
|
+
return this._app.body;
|
|
143
|
+
}
|
|
144
|
+
if (container instanceof Element) {
|
|
145
|
+
return container;
|
|
146
|
+
}
|
|
147
|
+
return container.outer;
|
|
148
|
+
}
|
|
149
|
+
return domParent;
|
|
150
|
+
},
|
|
151
|
+
enumerable: false,
|
|
152
|
+
configurable: true
|
|
153
|
+
});
|
|
154
|
+
// Set Module Events
|
|
155
|
+
ScrollBar.prototype._setEvents = function () {
|
|
156
|
+
var _this = this;
|
|
157
|
+
_super.prototype._setEvents.call(this);
|
|
158
|
+
var container = this.container;
|
|
159
|
+
// set resize event
|
|
160
|
+
if (container instanceof SmoothScroll_1.SmoothScroll) {
|
|
161
|
+
container.addCallback('resize', function () {
|
|
162
|
+
_this.resize();
|
|
163
|
+
}, {
|
|
164
|
+
name: this.name,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
this.addViewportCallback('', function () {
|
|
169
|
+
_this.resize();
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
this.resize();
|
|
173
|
+
};
|
|
174
|
+
ScrollBar.prototype._onPropMutate = function () {
|
|
175
|
+
_super.prototype._onPropMutate.call(this);
|
|
176
|
+
this.resize();
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Resize the canvas
|
|
180
|
+
*/
|
|
181
|
+
ScrollBar.prototype.resize = function () {
|
|
182
|
+
this._xBar.resize();
|
|
183
|
+
this._yBar.resize();
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Destroy the module
|
|
187
|
+
*/
|
|
188
|
+
ScrollBar.prototype._destroy = function () {
|
|
189
|
+
_super.prototype._destroy.call(this);
|
|
190
|
+
// destroy bars
|
|
191
|
+
this._xBar.destroy();
|
|
192
|
+
this._yBar.destroy();
|
|
193
|
+
// remove scrollbars parent
|
|
194
|
+
if (!!this._scrollWrapper && this.container instanceof Element) {
|
|
195
|
+
var parentElement = this._scrollWrapper.parentElement;
|
|
196
|
+
if (parentElement) {
|
|
197
|
+
parentElement.insertBefore(this.container, this._scrollWrapper);
|
|
198
|
+
}
|
|
199
|
+
this._scrollWrapper.remove();
|
|
200
|
+
}
|
|
201
|
+
// reset styles
|
|
202
|
+
this.scrollableElement.classList.remove(this.prefix + "-parent");
|
|
203
|
+
};
|
|
204
|
+
return ScrollBar;
|
|
205
|
+
}(Component_1.Component));
|
|
206
|
+
exports.ScrollBar = ScrollBar;
|