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
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _Plugin2 = _interopRequireDefault(require("./Plugin"));
|
|
11
|
-
|
|
12
|
-
var _merge = _interopRequireDefault(require("./merge"));
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
-
|
|
18
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
19
|
-
|
|
20
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
21
|
-
|
|
22
|
-
function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
|
|
23
|
-
|
|
24
|
-
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
25
|
-
|
|
26
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
-
|
|
28
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
-
|
|
30
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
|
-
|
|
32
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
33
|
-
|
|
34
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
-
|
|
36
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
-
|
|
38
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
-
|
|
40
|
-
var dom = require('dom-create-element');
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @classdesc Add previous and next controls to your slider. <br>
|
|
44
|
-
* <br><br> <b>import {SliderControlsPlugin} from 'vevet';</b>
|
|
45
|
-
*
|
|
46
|
-
* @class
|
|
47
|
-
* @memberof Vevet
|
|
48
|
-
* @augments Vevet.Plugin
|
|
49
|
-
*/
|
|
50
|
-
var SliderControlsPlugin = /*#__PURE__*/function (_Plugin) {
|
|
51
|
-
_inherits(SliderControlsPlugin, _Plugin);
|
|
52
|
-
|
|
53
|
-
var _super = _createSuper(SliderControlsPlugin);
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* @memberof Vevet.SliderControlsPlugin
|
|
57
|
-
* @typedef {object} Properties
|
|
58
|
-
* @augments Vevet.Plugin.Properties
|
|
59
|
-
*
|
|
60
|
-
* @property {boolean} [on=true] - If enabled.
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* @alias Vevet.SliderControlsPlugin
|
|
65
|
-
*
|
|
66
|
-
* @param {Vevet.SliderControlsPlugin.Properties} [data]
|
|
67
|
-
*/
|
|
68
|
-
function SliderControlsPlugin(data) {
|
|
69
|
-
_classCallCheck(this, SliderControlsPlugin);
|
|
70
|
-
|
|
71
|
-
return _super.call(this, data, false);
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* @readonly
|
|
75
|
-
* @type {Vevet.SliderControlsPlugin.Properties}
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
_createClass(SliderControlsPlugin, [{
|
|
80
|
-
key: "defaultProp",
|
|
81
|
-
get: function get() {
|
|
82
|
-
return (0, _merge.default)(_get(_getPrototypeOf(SliderControlsPlugin.prototype), "defaultProp", this), {
|
|
83
|
-
on: true
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* @member Vevet.SliderControlsPlugin#prop
|
|
88
|
-
* @memberof Vevet.SliderControlsPlugin
|
|
89
|
-
* @readonly
|
|
90
|
-
* @type {Vevet.SliderControlsPlugin.Properties}
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* @member Vevet.SliderControlsPlugin#_prop
|
|
95
|
-
* @memberof Vevet.SliderControlsPlugin
|
|
96
|
-
* @protected
|
|
97
|
-
* @type {Vevet.SliderControlsPlugin.Properties}
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* @function Vevet.SliderControlsPlugin#changeProp
|
|
102
|
-
* @memberof Vevet.SliderControlsPlugin
|
|
103
|
-
* @param {Vevet.SliderControlsPlugin.Properties} [prop]
|
|
104
|
-
*/
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* @member Vevet.SliderControlsPlugin#_m
|
|
108
|
-
* @memberof Vevet.SliderControlsPlugin
|
|
109
|
-
* @protected
|
|
110
|
-
* @type {Vevet.SliderModule}
|
|
111
|
-
*/
|
|
112
|
-
// Extra Constructor
|
|
113
|
-
|
|
114
|
-
}, {
|
|
115
|
-
key: "_extra",
|
|
116
|
-
value: function _extra() {
|
|
117
|
-
_get(_getPrototypeOf(SliderControlsPlugin.prototype), "_extra", this).call(this); // get module
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
var module = this._m,
|
|
121
|
-
prefix = module.prefix,
|
|
122
|
-
outer = module._outer; // vars
|
|
123
|
-
|
|
124
|
-
var controlClass = "".concat(prefix, "__control");
|
|
125
|
-
/**
|
|
126
|
-
* @description Module events IDs.
|
|
127
|
-
* @protected
|
|
128
|
-
* @member {Array<string>}
|
|
129
|
-
*/
|
|
130
|
-
|
|
131
|
-
this._me = []; // create controls
|
|
132
|
-
|
|
133
|
-
var prev = dom({
|
|
134
|
-
selector: 'button',
|
|
135
|
-
styles: "".concat(controlClass, " ").concat(controlClass, "_prev")
|
|
136
|
-
});
|
|
137
|
-
outer.appendChild(prev);
|
|
138
|
-
var next = dom({
|
|
139
|
-
selector: 'button',
|
|
140
|
-
styles: "".concat(controlClass, " ").concat(controlClass, "_next")
|
|
141
|
-
});
|
|
142
|
-
outer.appendChild(next);
|
|
143
|
-
/**
|
|
144
|
-
* @description Previous control button.
|
|
145
|
-
* @protected
|
|
146
|
-
* @member {HTMLElement}
|
|
147
|
-
*/
|
|
148
|
-
|
|
149
|
-
this._prev = prev;
|
|
150
|
-
/**
|
|
151
|
-
* @description Next control button.
|
|
152
|
-
* @protected
|
|
153
|
-
* @member {HTMLElement}
|
|
154
|
-
*/
|
|
155
|
-
|
|
156
|
-
this._next = next; // set classes
|
|
157
|
-
|
|
158
|
-
this._classes();
|
|
159
|
-
} // Set events
|
|
160
|
-
|
|
161
|
-
}, {
|
|
162
|
-
key: "_setEvents",
|
|
163
|
-
value: function _setEvents() {
|
|
164
|
-
var module = this._m; // controls
|
|
165
|
-
|
|
166
|
-
this.listener(this._prev, 'click', function () {
|
|
167
|
-
module.prev('control');
|
|
168
|
-
});
|
|
169
|
-
this.listener(this._next, 'click', function () {
|
|
170
|
-
module.next('control');
|
|
171
|
-
}); // events
|
|
172
|
-
|
|
173
|
-
this._me.push(module.on("changeProp", this._classes.bind(this)));
|
|
174
|
-
|
|
175
|
-
this._me.push(module.on("show", this._classes.bind(this)));
|
|
176
|
-
|
|
177
|
-
this._me.push(module.on("hide", this._classes.bind(this)));
|
|
178
|
-
|
|
179
|
-
this._me.push(module.on("start", this._classes.bind(this)));
|
|
180
|
-
} // When properties are changed.
|
|
181
|
-
|
|
182
|
-
}, {
|
|
183
|
-
key: "_changeProp",
|
|
184
|
-
value: function _changeProp() {
|
|
185
|
-
// set classes
|
|
186
|
-
this._classes();
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* @description Set classes.
|
|
190
|
-
* @protected
|
|
191
|
-
*/
|
|
192
|
-
|
|
193
|
-
}, {
|
|
194
|
-
key: "_classes",
|
|
195
|
-
value: function _classes() {
|
|
196
|
-
var prop = this._prop,
|
|
197
|
-
module = this._m,
|
|
198
|
-
outer = module._outer,
|
|
199
|
-
prefix = module.prefix,
|
|
200
|
-
hiddenClass = "".concat(prefix, "_controls-hidden"),
|
|
201
|
-
active = module.active,
|
|
202
|
-
moduleProp = module.prop,
|
|
203
|
-
disabledAttr = "disabled"; // show & hide
|
|
204
|
-
|
|
205
|
-
if (!prop.on) {
|
|
206
|
-
outer.classList.add(hiddenClass);
|
|
207
|
-
} else {
|
|
208
|
-
outer.classList.remove(hiddenClass);
|
|
209
|
-
} // if disabled
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
if (active === 0 & !moduleProp.loop || !moduleProp.prev) {
|
|
213
|
-
this._prev.setAttribute(disabledAttr, true);
|
|
214
|
-
} else {
|
|
215
|
-
this._prev.removeAttribute(disabledAttr);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (active === module.total - 1 & !moduleProp.loop || !moduleProp.next) {
|
|
219
|
-
this._next.setAttribute(disabledAttr, true);
|
|
220
|
-
} else {
|
|
221
|
-
this._next.removeAttribute(disabledAttr);
|
|
222
|
-
}
|
|
223
|
-
} // Destroy events
|
|
224
|
-
|
|
225
|
-
}, {
|
|
226
|
-
key: "_destroy",
|
|
227
|
-
value: function _destroy() {
|
|
228
|
-
_get(_getPrototypeOf(SliderControlsPlugin.prototype), "_destroy", this).call(this); // get module
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
var module = this._m; // remove elements
|
|
232
|
-
|
|
233
|
-
this._prev.remove();
|
|
234
|
-
|
|
235
|
-
this._next.remove(); // remove events
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
this._me.forEach(function (id) {
|
|
239
|
-
module.remove(id);
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
}]);
|
|
243
|
-
|
|
244
|
-
return SliderControlsPlugin;
|
|
245
|
-
}(_Plugin2.default);
|
|
246
|
-
|
|
247
|
-
exports.default = SliderControlsPlugin;
|
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _Plugin2 = _interopRequireDefault(require("./Plugin"));
|
|
11
|
-
|
|
12
|
-
var _merge = _interopRequireDefault(require("./merge"));
|
|
13
|
-
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
-
|
|
18
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
19
|
-
|
|
20
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
21
|
-
|
|
22
|
-
function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
|
|
23
|
-
|
|
24
|
-
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
25
|
-
|
|
26
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
-
|
|
28
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
-
|
|
30
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
|
-
|
|
32
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
33
|
-
|
|
34
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
-
|
|
36
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
-
|
|
38
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
-
|
|
40
|
-
var dom = require('dom-create-element');
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* @classdesc Add a counter to control your slider. <br>
|
|
44
|
-
* <br><br> <b>import {SliderCounterPlugin} from 'vevet';</b>
|
|
45
|
-
*
|
|
46
|
-
* @class
|
|
47
|
-
* @memberof Vevet
|
|
48
|
-
* @augments Vevet.Plugin
|
|
49
|
-
*/
|
|
50
|
-
var SliderCounterPlugin = /*#__PURE__*/function (_Plugin) {
|
|
51
|
-
_inherits(SliderCounterPlugin, _Plugin);
|
|
52
|
-
|
|
53
|
-
var _super = _createSuper(SliderCounterPlugin);
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* @memberof Vevet.SliderCounterPlugin
|
|
57
|
-
* @typedef {object} Properties
|
|
58
|
-
* @augments Vevet.Plugin.Properties
|
|
59
|
-
*
|
|
60
|
-
* @property {boolean} [on=true] - If enabled.
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* @alias Vevet.SliderCounterPlugin
|
|
65
|
-
*
|
|
66
|
-
* @param {Vevet.SliderCounterPlugin.Properties} [data]
|
|
67
|
-
*/
|
|
68
|
-
function SliderCounterPlugin(data) {
|
|
69
|
-
_classCallCheck(this, SliderCounterPlugin);
|
|
70
|
-
|
|
71
|
-
return _super.call(this, data, false);
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* @readonly
|
|
75
|
-
* @type {Vevet.SliderCounterPlugin.Properties}
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
_createClass(SliderCounterPlugin, [{
|
|
80
|
-
key: "defaultProp",
|
|
81
|
-
get: function get() {
|
|
82
|
-
return (0, _merge.default)(_get(_getPrototypeOf(SliderCounterPlugin.prototype), "defaultProp", this), {
|
|
83
|
-
on: true
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* @member Vevet.SliderCounterPlugin#prop
|
|
88
|
-
* @memberof Vevet.SliderCounterPlugin
|
|
89
|
-
* @readonly
|
|
90
|
-
* @type {Vevet.SliderCounterPlugin.Properties}
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* @member Vevet.SliderCounterPlugin#_prop
|
|
95
|
-
* @memberof Vevet.SliderCounterPlugin
|
|
96
|
-
* @protected
|
|
97
|
-
* @type {Vevet.SliderCounterPlugin.Properties}
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* @function Vevet.SliderCounterPlugin#changeProp
|
|
102
|
-
* @memberof Vevet.SliderCounterPlugin
|
|
103
|
-
* @param {Vevet.SliderCounterPlugin.Properties} [prop]
|
|
104
|
-
*/
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* @member Vevet.SliderCounterPlugin#_m
|
|
108
|
-
* @memberof Vevet.SliderCounterPlugin
|
|
109
|
-
* @protected
|
|
110
|
-
* @type {Vevet.SliderModule|Vevet.SliderCanvasModule}
|
|
111
|
-
*/
|
|
112
|
-
// Extra Constructor
|
|
113
|
-
|
|
114
|
-
}, {
|
|
115
|
-
key: "_extra",
|
|
116
|
-
value: function _extra() {
|
|
117
|
-
_get(_getPrototypeOf(SliderCounterPlugin.prototype), "_extra", this).call(this); // get module
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
var module = this._m,
|
|
121
|
-
prefix = module.prefix,
|
|
122
|
-
outer = module._outer,
|
|
123
|
-
count = module.total;
|
|
124
|
-
/**
|
|
125
|
-
* @description Module events IDs.
|
|
126
|
-
* @protected
|
|
127
|
-
* @member {Array<string>}
|
|
128
|
-
*/
|
|
129
|
-
|
|
130
|
-
this._me = [];
|
|
131
|
-
/**
|
|
132
|
-
* @description Counter outer element.
|
|
133
|
-
* @protected
|
|
134
|
-
* @member {HTMLElement}
|
|
135
|
-
*/
|
|
136
|
-
|
|
137
|
-
this._outer = dom({
|
|
138
|
-
selector: 'div',
|
|
139
|
-
styles: "".concat(prefix, "__counter")
|
|
140
|
-
});
|
|
141
|
-
outer.appendChild(this._outer); // create currents
|
|
142
|
-
|
|
143
|
-
var currents = dom({
|
|
144
|
-
selector: 'div',
|
|
145
|
-
styles: "".concat(prefix, "__currents")
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
this._outer.appendChild(currents);
|
|
149
|
-
/**
|
|
150
|
-
* @description Numbers.
|
|
151
|
-
* @protected
|
|
152
|
-
* @member {Array<HTMLElement>}
|
|
153
|
-
*/
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
this._currents = [];
|
|
157
|
-
|
|
158
|
-
for (var i = 0; i < count; i++) {
|
|
159
|
-
var el = dom({
|
|
160
|
-
selector: 'div',
|
|
161
|
-
styles: "".concat(prefix, "__current")
|
|
162
|
-
});
|
|
163
|
-
currents.appendChild(el);
|
|
164
|
-
|
|
165
|
-
this._currents.push(el);
|
|
166
|
-
|
|
167
|
-
var _num = i + 1;
|
|
168
|
-
|
|
169
|
-
_num = _num < 10 ? "0".concat(_num) : _num;
|
|
170
|
-
el.innerHTML = _num;
|
|
171
|
-
} // create line
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
var line = dom({
|
|
175
|
-
selector: 'div',
|
|
176
|
-
styles: "".concat(prefix, "__line")
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
this._outer.appendChild(line); // create total
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
var total = dom({
|
|
183
|
-
selector: 'div',
|
|
184
|
-
styles: "".concat(prefix, "__total")
|
|
185
|
-
});
|
|
186
|
-
var num = count < 10 ? "0".concat(count) : count;
|
|
187
|
-
total.innerHTML = num;
|
|
188
|
-
|
|
189
|
-
this._outer.appendChild(total); // set classes
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
this._classes();
|
|
193
|
-
|
|
194
|
-
this._classesActive(module.active);
|
|
195
|
-
} // Set events
|
|
196
|
-
|
|
197
|
-
}, {
|
|
198
|
-
key: "_setEvents",
|
|
199
|
-
value: function _setEvents() {
|
|
200
|
-
var _this = this;
|
|
201
|
-
|
|
202
|
-
var module = this._m; // events
|
|
203
|
-
|
|
204
|
-
this._me.push(module.on("start", function (data) {
|
|
205
|
-
_this._classesActive(data.next);
|
|
206
|
-
}));
|
|
207
|
-
} // When properties are changed.
|
|
208
|
-
|
|
209
|
-
}, {
|
|
210
|
-
key: "_changeProp",
|
|
211
|
-
value: function _changeProp() {
|
|
212
|
-
// set classes
|
|
213
|
-
this._classes();
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* @description Set classes.
|
|
217
|
-
* @protected
|
|
218
|
-
*/
|
|
219
|
-
|
|
220
|
-
}, {
|
|
221
|
-
key: "_classes",
|
|
222
|
-
value: function _classes() {
|
|
223
|
-
var prop = this._prop,
|
|
224
|
-
module = this._m,
|
|
225
|
-
outer = module._outer,
|
|
226
|
-
prefix = module.prefix,
|
|
227
|
-
hiddenClass = "".concat(prefix, "_counter-hidden"); // show & hide
|
|
228
|
-
|
|
229
|
-
if (!prop.on) {
|
|
230
|
-
outer.classList.add(hiddenClass);
|
|
231
|
-
} else {
|
|
232
|
-
outer.classList.remove(hiddenClass);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* @description Set active classes.
|
|
237
|
-
* @param {number} num
|
|
238
|
-
* @protected
|
|
239
|
-
*/
|
|
240
|
-
|
|
241
|
-
}, {
|
|
242
|
-
key: "_classesActive",
|
|
243
|
-
value: function _classesActive(num) {
|
|
244
|
-
var module = this._m,
|
|
245
|
-
prefix = module.prefix,
|
|
246
|
-
activeClass = "".concat(prefix, "__current_active"),
|
|
247
|
-
currents = this._currents; // set classes
|
|
248
|
-
|
|
249
|
-
for (var i = 0; i < currents.length; i++) {
|
|
250
|
-
if (i == num) {
|
|
251
|
-
currents[i].classList.add(activeClass);
|
|
252
|
-
} else {
|
|
253
|
-
currents[i].classList.remove(activeClass);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
} // Destroy events
|
|
257
|
-
|
|
258
|
-
}, {
|
|
259
|
-
key: "_destroy",
|
|
260
|
-
value: function _destroy() {
|
|
261
|
-
_get(_getPrototypeOf(SliderCounterPlugin.prototype), "_destroy", this).call(this); // get module
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
var module = this._m; // remove elements
|
|
265
|
-
|
|
266
|
-
this._outer.remove(); // remove events
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
this._me.forEach(function (id) {
|
|
270
|
-
module.remove(id);
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
}]);
|
|
274
|
-
|
|
275
|
-
return SliderCounterPlugin;
|
|
276
|
-
}(_Plugin2.default);
|
|
277
|
-
|
|
278
|
-
exports.default = SliderCounterPlugin;
|