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
package/dist/js/KeydownModule.js
DELETED
|
@@ -1,293 +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 _Module2 = _interopRequireDefault(require("./Module"));
|
|
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
|
-
/**
|
|
41
|
-
* @classdesc Keydown events.
|
|
42
|
-
* Available targets:
|
|
43
|
-
* <ul>
|
|
44
|
-
* <li>queue - The combination of keys dialed in order<li>
|
|
45
|
-
* <li>once - One pressed key</li>
|
|
46
|
-
* <li>multi - A combination of keys dialed simultaneously</li>
|
|
47
|
-
* </ul>
|
|
48
|
-
* <br><br> <b>import {KeydownModule} from 'vevet';</b>
|
|
49
|
-
*
|
|
50
|
-
* @class
|
|
51
|
-
* @memberof Vevet
|
|
52
|
-
* @augments Vevet.Module
|
|
53
|
-
*/
|
|
54
|
-
var KeydownModule = /*#__PURE__*/function (_Module) {
|
|
55
|
-
_inherits(KeydownModule, _Module);
|
|
56
|
-
|
|
57
|
-
var _super = _createSuper(KeydownModule);
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @memberof Vevet.KeydownModule
|
|
61
|
-
* @typedef {object} Properties
|
|
62
|
-
* @augments Vevet.Module.Properties
|
|
63
|
-
*
|
|
64
|
-
* @property {number} [interval=250] - Maximum interval between keydowns when using the target 'queue'.
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @alias Vevet.KeydownModule
|
|
69
|
-
*
|
|
70
|
-
* @param {Vevet.KeydownModule.Properties} [data]
|
|
71
|
-
*/
|
|
72
|
-
function KeydownModule(data) {
|
|
73
|
-
_classCallCheck(this, KeydownModule);
|
|
74
|
-
|
|
75
|
-
return _super.call(this, data);
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* @readonly
|
|
79
|
-
* @type {Vevet.KeydownModule.Properties}
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
_createClass(KeydownModule, [{
|
|
84
|
-
key: "defaultProp",
|
|
85
|
-
get: function get() {
|
|
86
|
-
return (0, _merge.default)(_get(_getPrototypeOf(KeydownModule.prototype), "defaultProp", this), {
|
|
87
|
-
interval: 250
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* @member Vevet.KeydownModule#prop
|
|
92
|
-
* @memberof Vevet.KeydownModule
|
|
93
|
-
* @readonly
|
|
94
|
-
* @type {Vevet.KeydownModule.Properties}
|
|
95
|
-
*/
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* @member Vevet.KeydownModule#_prop
|
|
99
|
-
* @memberof Vevet.KeydownModule
|
|
100
|
-
* @protected
|
|
101
|
-
* @type {Vevet.KeydownModule.Properties}
|
|
102
|
-
*/
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* @function Vevet.KeydownModule#changeProp
|
|
106
|
-
* @memberof Vevet.KeydownModule
|
|
107
|
-
* @param {Vevet.KeydownModule.Properties} [prop]
|
|
108
|
-
*/
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* @memberof Vevet.KeydownModule
|
|
112
|
-
* @callback _callback
|
|
113
|
-
* @param {KeyboardEvent} data
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* @memberof Vevet.KeydownModule
|
|
118
|
-
* @typedef {object} EventData
|
|
119
|
-
* @augments Vevet.Event.EventData
|
|
120
|
-
* @property {Vevet.KeydownModule.EventObj} data
|
|
121
|
-
*/
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* @memberof Vevet.KeydownModule
|
|
125
|
-
* @typedef {object} EventObj
|
|
126
|
-
* @augments Vevet.KeydownModule.EventObjSettings
|
|
127
|
-
* @property {'queue'|'once'|'multi'} target
|
|
128
|
-
* @property {Vevet.KeydownModule._callback} do
|
|
129
|
-
*/
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* @memberof Vevet.KeydownModule
|
|
133
|
-
* @typedef {object} EventObjSettings
|
|
134
|
-
* @augments Vevet.Event.EventObjSettings
|
|
135
|
-
* @property {Array<number>} [keys] An array of key codes.
|
|
136
|
-
* @property {string} [input] You can also use a string to define keys instead of 'keys'.
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* @description Add a callback.
|
|
141
|
-
*
|
|
142
|
-
* @param {Vevet.KeydownModule.EventObj} data - Callback data.
|
|
143
|
-
* @param {boolean} [bool=true] - Defines if the event is enabled.
|
|
144
|
-
*
|
|
145
|
-
* @returns {string} Returns a string with the callback's id.
|
|
146
|
-
*
|
|
147
|
-
* @example
|
|
148
|
-
* let id = keydown.add({
|
|
149
|
-
* target: 'queue',
|
|
150
|
-
* keys: [72, 73],
|
|
151
|
-
* // input: 'hello',
|
|
152
|
-
* do: () => {
|
|
153
|
-
* alert("callback launched");
|
|
154
|
-
* }
|
|
155
|
-
* }, true);
|
|
156
|
-
*/
|
|
157
|
-
|
|
158
|
-
}, {
|
|
159
|
-
key: "add",
|
|
160
|
-
value: function add(data) {
|
|
161
|
-
var bool = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
162
|
-
|
|
163
|
-
if (typeof data.input != 'undefined') {
|
|
164
|
-
data.input = data.input.toUpperCase();
|
|
165
|
-
data.keys = [];
|
|
166
|
-
|
|
167
|
-
for (var i = 0; i < data.input.length; i++) {
|
|
168
|
-
data.keys.push(data.input[i].charCodeAt(0));
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return _get(_getPrototypeOf(KeydownModule.prototype), "add", this).call(this, data, bool);
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* @function Vevet.KeydownModule#on
|
|
176
|
-
* @memberof Vevet.KeydownModule
|
|
177
|
-
*
|
|
178
|
-
* @param {'queue'|'once'|'multi'} target
|
|
179
|
-
* @param {Vevet.KeydownModule._callback} callback
|
|
180
|
-
* @param {Vevet.KeydownModule.EventObjSettings} prop
|
|
181
|
-
*
|
|
182
|
-
* @returns {string}
|
|
183
|
-
*/
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* @member Vevet.KeydownModule#_events
|
|
187
|
-
* @memberof Vevet.KeydownModule
|
|
188
|
-
* @protected
|
|
189
|
-
* @type {Array<Vevet.KeydownModule.EventData>}
|
|
190
|
-
*/
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* @member Vevet.KeydownModule#events
|
|
194
|
-
* @memberof Vevet.KeydownModule
|
|
195
|
-
* @readonly
|
|
196
|
-
* @type {Array<Vevet.KeydownModule.EventData>}
|
|
197
|
-
*/
|
|
198
|
-
// Set Events
|
|
199
|
-
|
|
200
|
-
}, {
|
|
201
|
-
key: "_setEvents",
|
|
202
|
-
value: function _setEvents() {
|
|
203
|
-
var _this = this;
|
|
204
|
-
|
|
205
|
-
this.listener(window, 'keydown', function (e) {
|
|
206
|
-
_this._implement(e);
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* @description Launch callbacks on keydown.
|
|
211
|
-
*
|
|
212
|
-
* @param {KeyboardEvent} e - Keydown Event object.
|
|
213
|
-
*
|
|
214
|
-
* @protected
|
|
215
|
-
*/
|
|
216
|
-
|
|
217
|
-
}, {
|
|
218
|
-
key: "_implement",
|
|
219
|
-
value: function _implement(e) {
|
|
220
|
-
var _this2 = this;
|
|
221
|
-
|
|
222
|
-
// go thru all events
|
|
223
|
-
this._events.forEach(function (el) {
|
|
224
|
-
// check if event is enabled
|
|
225
|
-
if (!el.on) return; // data copy
|
|
226
|
-
|
|
227
|
-
var data = el.data; // once target
|
|
228
|
-
|
|
229
|
-
if (data.target === 'once') {
|
|
230
|
-
if (e.keyCode === data.keys[0]) {
|
|
231
|
-
_this2._launch(el, e);
|
|
232
|
-
}
|
|
233
|
-
} // queue target
|
|
234
|
-
else if (data.target === 'queue') {
|
|
235
|
-
// create a string of keys if not exists
|
|
236
|
-
if (typeof el.string == "undefined") {
|
|
237
|
-
el.string = '';
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
el.string += '-' + e.keyCode; // create a comparative string of keys
|
|
241
|
-
|
|
242
|
-
if (typeof el.compareString == "undefined") {
|
|
243
|
-
el.compareString = '';
|
|
244
|
-
|
|
245
|
-
for (var a = 0; a < data.keys.length; a++) {
|
|
246
|
-
el.compareString += '-' + data.keys[a];
|
|
247
|
-
}
|
|
248
|
-
} // compare strings
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
if (el.string.includes(el.compareString)) {
|
|
252
|
-
_this2._launch(el, e);
|
|
253
|
-
|
|
254
|
-
el.string = '';
|
|
255
|
-
}
|
|
256
|
-
} // multiple keys
|
|
257
|
-
else if (data.target === 'multi') {
|
|
258
|
-
// comparative array
|
|
259
|
-
if (typeof el.array == "undefined") {
|
|
260
|
-
el.array = [];
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
el.array.push(e.keyCode); // interval to clear the array
|
|
264
|
-
|
|
265
|
-
setTimeout(function () {
|
|
266
|
-
el.array = [];
|
|
267
|
-
}, _this2._prop.interval); // get overlapings
|
|
268
|
-
|
|
269
|
-
var overlaps = 0;
|
|
270
|
-
|
|
271
|
-
for (var _a = 0; _a < data.keys.length; _a++) {
|
|
272
|
-
for (var b = 0; b < el.array.length; b++) {
|
|
273
|
-
if (data.keys[_a] === el.array[b]) {
|
|
274
|
-
overlaps++;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
} // compare count of overlapings
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
if (data.keys.length === overlaps) {
|
|
281
|
-
_this2._launch(el, e);
|
|
282
|
-
|
|
283
|
-
el.array = [];
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
}]);
|
|
289
|
-
|
|
290
|
-
return KeydownModule;
|
|
291
|
-
}(_Module2.default);
|
|
292
|
-
|
|
293
|
-
exports.default = KeydownModule;
|
package/dist/js/LoadEvent.js
DELETED
|
@@ -1,106 +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 _Event2 = _interopRequireDefault(require("./Event"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
15
|
-
|
|
16
|
-
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); } }
|
|
17
|
-
|
|
18
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
19
|
-
|
|
20
|
-
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); }
|
|
21
|
-
|
|
22
|
-
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
23
|
-
|
|
24
|
-
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); }
|
|
25
|
-
|
|
26
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
27
|
-
|
|
28
|
-
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); }; }
|
|
29
|
-
|
|
30
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
31
|
-
|
|
32
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
33
|
-
|
|
34
|
-
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; } }
|
|
35
|
-
|
|
36
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @classdesc Callbacks on page loaded.
|
|
40
|
-
* <br><br> <b>import {LoadEvent} from 'vevet';</b>
|
|
41
|
-
* @class
|
|
42
|
-
* @memberof Vevet
|
|
43
|
-
* @augments Vevet.Event
|
|
44
|
-
*/
|
|
45
|
-
var LoadEvent = /*#__PURE__*/function (_Event) {
|
|
46
|
-
_inherits(LoadEvent, _Event);
|
|
47
|
-
|
|
48
|
-
var _super = _createSuper(LoadEvent);
|
|
49
|
-
|
|
50
|
-
function LoadEvent() {
|
|
51
|
-
_classCallCheck(this, LoadEvent);
|
|
52
|
-
|
|
53
|
-
return _super.apply(this, arguments);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
_createClass(LoadEvent, [{
|
|
57
|
-
key: "_extra",
|
|
58
|
-
value: function _extra() {
|
|
59
|
-
_get(_getPrototypeOf(LoadEvent.prototype), "_extra", this).call(this);
|
|
60
|
-
/**
|
|
61
|
-
* @description If the page is loaded.
|
|
62
|
-
* @type {boolean}
|
|
63
|
-
* @protected
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
this._loaded = false;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* @description If page is loaded.
|
|
71
|
-
* @default false
|
|
72
|
-
* @readonly
|
|
73
|
-
* @type {boolean}
|
|
74
|
-
*/
|
|
75
|
-
|
|
76
|
-
}, {
|
|
77
|
-
key: "loaded",
|
|
78
|
-
get: function get() {
|
|
79
|
-
return this._loaded;
|
|
80
|
-
}
|
|
81
|
-
}, {
|
|
82
|
-
key: "_setEvents",
|
|
83
|
-
value: function _setEvents() {
|
|
84
|
-
var _this = this;
|
|
85
|
-
|
|
86
|
-
// add callbacks
|
|
87
|
-
this.add({
|
|
88
|
-
do: function _do() {
|
|
89
|
-
var prefix = _this._vp.prefix;
|
|
90
|
-
_this._loaded = true;
|
|
91
|
-
|
|
92
|
-
_this._v.html.classList.remove("".concat(prefix, "loading"));
|
|
93
|
-
|
|
94
|
-
_this._v.body.classList.remove("".concat(prefix, "loading"));
|
|
95
|
-
},
|
|
96
|
-
protected: true
|
|
97
|
-
}); // launch callbacks on loaded
|
|
98
|
-
|
|
99
|
-
window.addEventListener("load", this.launchAll.bind(this));
|
|
100
|
-
}
|
|
101
|
-
}]);
|
|
102
|
-
|
|
103
|
-
return LoadEvent;
|
|
104
|
-
}(_Event2.default);
|
|
105
|
-
|
|
106
|
-
exports.default = LoadEvent;
|
|
@@ -1,292 +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 _Module2 = _interopRequireDefault(require("./Module"));
|
|
11
|
-
|
|
12
|
-
var _merge = _interopRequireDefault(require("./merge"));
|
|
13
|
-
|
|
14
|
-
var _timeoutCallback = _interopRequireDefault(require("./timeoutCallback"));
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
|
-
|
|
20
|
-
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); } }
|
|
21
|
-
|
|
22
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
23
|
-
|
|
24
|
-
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); }
|
|
25
|
-
|
|
26
|
-
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
27
|
-
|
|
28
|
-
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); }
|
|
29
|
-
|
|
30
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
31
|
-
|
|
32
|
-
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); }; }
|
|
33
|
-
|
|
34
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
35
|
-
|
|
36
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
37
|
-
|
|
38
|
-
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; } }
|
|
39
|
-
|
|
40
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
41
|
-
|
|
42
|
-
var selectEl = require('select-el');
|
|
43
|
-
/**
|
|
44
|
-
* @classdesc A base class for creating pop-up menus.
|
|
45
|
-
* It is used by {@linkcode Vevet.MenuModule} & {@linkcode Vevet.MenuTimelineModule}. <br>
|
|
46
|
-
* Available targets:
|
|
47
|
-
* <ul>
|
|
48
|
-
* <li>show - when the menu is being opened.</li>
|
|
49
|
-
* <li>hide - when the menu is being hidden.</li>
|
|
50
|
-
* </ul>
|
|
51
|
-
* <br><br> <b>import {MenuBaseModule} from 'vevet';</b>
|
|
52
|
-
*
|
|
53
|
-
* @vevetModuleCallback { Vevet.MenuBaseModule : show : }
|
|
54
|
-
* @vevetModuleCallback { Vevet.MenuBaseModule : hide : }
|
|
55
|
-
*
|
|
56
|
-
* @class
|
|
57
|
-
* @memberof Vevet
|
|
58
|
-
* @augments Vevet.Module
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var MenuBaseModule = /*#__PURE__*/function (_Module) {
|
|
63
|
-
_inherits(MenuBaseModule, _Module);
|
|
64
|
-
|
|
65
|
-
var _super = _createSuper(MenuBaseModule);
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @memberof Vevet.MenuBaseModule
|
|
69
|
-
* @typedef {object} Properties
|
|
70
|
-
* @augments Vevet.Module.Properties
|
|
71
|
-
*
|
|
72
|
-
* @property {boolean} [events=true] - Defines if events are active: click on the menu button.
|
|
73
|
-
*
|
|
74
|
-
* @property {object} [selectors] - ***
|
|
75
|
-
* @property {string|HTMLElement} [selectors.outer=.vevet-menu] - The outer of the menu.
|
|
76
|
-
* @property {string|HTMLElement} [selectors.button=.vevet-menu-button] - The button that opens the menu.
|
|
77
|
-
*
|
|
78
|
-
* @property {object} [delays]
|
|
79
|
-
* @property {number} [delays.show=0] - Delay before the menu starts opening.
|
|
80
|
-
* @property {number} [delays.hide=0] - Delay before the menu starts closing.
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @alias Vevet.MenuBaseModule
|
|
85
|
-
*
|
|
86
|
-
* @param {Vevet.MenuBaseModule.Properties} [data]
|
|
87
|
-
*/
|
|
88
|
-
function MenuBaseModule(data) {
|
|
89
|
-
_classCallCheck(this, MenuBaseModule);
|
|
90
|
-
|
|
91
|
-
return _super.call(this, data);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
_createClass(MenuBaseModule, [{
|
|
95
|
-
key: "prefix",
|
|
96
|
-
get: function get() {
|
|
97
|
-
return "".concat(this._v.prefix, "menu");
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* @readonly
|
|
101
|
-
* @type {Vevet.MenuBaseModule.Properties}
|
|
102
|
-
*/
|
|
103
|
-
|
|
104
|
-
}, {
|
|
105
|
-
key: "defaultProp",
|
|
106
|
-
get: function get() {
|
|
107
|
-
return (0, _merge.default)(_get(_getPrototypeOf(MenuBaseModule.prototype), "defaultProp", this), {
|
|
108
|
-
events: true,
|
|
109
|
-
selectors: {
|
|
110
|
-
outer: ".".concat(this._prefix),
|
|
111
|
-
button: ".".concat(this._prefix, "-button")
|
|
112
|
-
},
|
|
113
|
-
delays: {
|
|
114
|
-
show: 0,
|
|
115
|
-
hide: 0
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* @member Vevet.MenuBaseModule#prop
|
|
121
|
-
* @memberof Vevet.MenuBaseModule
|
|
122
|
-
* @readonly
|
|
123
|
-
* @type {Vevet.MenuBaseModule.Properties}
|
|
124
|
-
*/
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* @member Vevet.MenuBaseModule#_prop
|
|
128
|
-
* @memberof Vevet.MenuBaseModule
|
|
129
|
-
* @protected
|
|
130
|
-
* @type {Vevet.MenuBaseModule.Properties}
|
|
131
|
-
*/
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* @function Vevet.MenuBaseModule#changeProp
|
|
135
|
-
* @memberof Vevet.MenuBaseModule
|
|
136
|
-
* @param {Vevet.MenuBaseModule.Properties} [prop]
|
|
137
|
-
*/
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* @description If menu is shown.
|
|
141
|
-
* @default false
|
|
142
|
-
* @readonly
|
|
143
|
-
* @type {boolean}
|
|
144
|
-
*/
|
|
145
|
-
|
|
146
|
-
}, {
|
|
147
|
-
key: "shown",
|
|
148
|
-
get: function get() {
|
|
149
|
-
return this._shown;
|
|
150
|
-
} // Extra Constructor
|
|
151
|
-
|
|
152
|
-
}, {
|
|
153
|
-
key: "_extra",
|
|
154
|
-
value: function _extra() {
|
|
155
|
-
_get(_getPrototypeOf(MenuBaseModule.prototype), "_extra", this).call(this);
|
|
156
|
-
/**
|
|
157
|
-
* @description If menu is shown
|
|
158
|
-
* @member {boolean}
|
|
159
|
-
* @protected
|
|
160
|
-
*/
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
this._shown = false; // get elements
|
|
164
|
-
|
|
165
|
-
this._getElements();
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* @description Get elements.
|
|
169
|
-
* @protected
|
|
170
|
-
*/
|
|
171
|
-
|
|
172
|
-
}, {
|
|
173
|
-
key: "_getElements",
|
|
174
|
-
value: function _getElements() {
|
|
175
|
-
var selectors = this._prop.selectors;
|
|
176
|
-
/**
|
|
177
|
-
* @description Menu outer element.
|
|
178
|
-
* @protected
|
|
179
|
-
* @member {HTMLElement}
|
|
180
|
-
*/
|
|
181
|
-
|
|
182
|
-
this._outer = selectEl.one(selectors.outer);
|
|
183
|
-
/**
|
|
184
|
-
* @description Menu button element.
|
|
185
|
-
* @protected
|
|
186
|
-
* @member {HTMLElement}
|
|
187
|
-
*/
|
|
188
|
-
|
|
189
|
-
this._button = selectEl.one(selectors.button);
|
|
190
|
-
} // Set listeners on elements.
|
|
191
|
-
|
|
192
|
-
}, {
|
|
193
|
-
key: "_setEvents",
|
|
194
|
-
value: function _setEvents() {
|
|
195
|
-
_get(_getPrototypeOf(MenuBaseModule.prototype), "_setEvents", this).call(this); // button click
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
if (this._button) {
|
|
199
|
-
this.listener(this._button, 'click', this._buttonClick.bind(this));
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* @description Click on button.
|
|
204
|
-
* @protected
|
|
205
|
-
* @param {object} e
|
|
206
|
-
*/
|
|
207
|
-
|
|
208
|
-
}, {
|
|
209
|
-
key: "_buttonClick",
|
|
210
|
-
value: function _buttonClick(e) {
|
|
211
|
-
if (this._prop.events) {
|
|
212
|
-
e.preventDefault();
|
|
213
|
-
this.toggle();
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* @description Show the menu.
|
|
218
|
-
* @returns {boolean} Returns true if the menu can be opened.
|
|
219
|
-
*/
|
|
220
|
-
|
|
221
|
-
}, {
|
|
222
|
-
key: "show",
|
|
223
|
-
value: function show() {
|
|
224
|
-
if (this._shown) {
|
|
225
|
-
return false;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
return this.toggle();
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* @description Hide the menu.
|
|
232
|
-
* @returns {boolean} Returns true if the menu can be closed.
|
|
233
|
-
*/
|
|
234
|
-
|
|
235
|
-
}, {
|
|
236
|
-
key: "hide",
|
|
237
|
-
value: function hide() {
|
|
238
|
-
if (!this._shown) {
|
|
239
|
-
return false;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
return this.toggle();
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* @description Show/Hide the menu.
|
|
246
|
-
* @returns {boolean} Returns true if the menu can be opened or closed.
|
|
247
|
-
*/
|
|
248
|
-
|
|
249
|
-
}, {
|
|
250
|
-
key: "toggle",
|
|
251
|
-
value: function toggle() {
|
|
252
|
-
var delays = this._prop.delays; // hide menu
|
|
253
|
-
|
|
254
|
-
if (this._shown) {
|
|
255
|
-
(0, _timeoutCallback.default)(this._hide.bind(this), delays.hide);
|
|
256
|
-
} // show menu
|
|
257
|
-
else {
|
|
258
|
-
(0, _timeoutCallback.default)(this._show.bind(this), delays.show);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
return true;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* @description Show the menu.
|
|
265
|
-
* @protected
|
|
266
|
-
*/
|
|
267
|
-
|
|
268
|
-
}, {
|
|
269
|
-
key: "_show",
|
|
270
|
-
value: function _show() {
|
|
271
|
-
this.lbt("show"); // change vars
|
|
272
|
-
|
|
273
|
-
this._shown = true;
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* @description Hide the menu.
|
|
277
|
-
* @protected
|
|
278
|
-
*/
|
|
279
|
-
|
|
280
|
-
}, {
|
|
281
|
-
key: "_hide",
|
|
282
|
-
value: function _hide() {
|
|
283
|
-
this.lbt("hide"); // change vars
|
|
284
|
-
|
|
285
|
-
this._shown = false;
|
|
286
|
-
}
|
|
287
|
-
}]);
|
|
288
|
-
|
|
289
|
-
return MenuBaseModule;
|
|
290
|
-
}(_Module2.default);
|
|
291
|
-
|
|
292
|
-
exports.default = MenuBaseModule;
|