vevet 1.4.27 → 2.0.1-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +7 -71
- package/build/cdn/index.js +12 -0
- package/build/cdn/index.js.LICENSE.txt +14 -0
- package/build/cjs/app/Application.js +297 -0
- package/build/cjs/app/events/PageLoad.js +74 -0
- package/build/cjs/app/events/Viewport.js +303 -0
- package/build/cjs/base/Callbacks.js +232 -0
- package/build/cjs/base/Component.js +56 -0
- package/build/cjs/base/Module.js +262 -0
- package/build/cjs/base/MutableProp.js +165 -0
- package/build/cjs/base/Plugin.js +56 -0
- package/build/cjs/components/animation-frame/AnimationFrame.js +183 -0
- package/build/cjs/components/canvas/Ctx2D.js +200 -0
- package/build/cjs/components/canvas/Ctx2DPrerender.js +72 -0
- package/build/cjs/components/cursor/CustomCursor.js +344 -0
- package/build/cjs/components/dragger/Dragger.js +229 -0
- package/build/cjs/components/dragger/DraggerDirection.js +77 -0
- package/build/cjs/components/dragger/DraggerMove.js +84 -0
- package/build/cjs/components/loading/Preloader.js +229 -0
- package/build/cjs/components/loading/ProgressPreloader.js +377 -0
- package/build/cjs/components/page/Page.js +353 -0
- package/build/cjs/components/scroll/custom-scroll/CustomScroll.js +517 -0
- package/build/cjs/components/scroll/plugins/SmoothScrollDragPlugin.js +178 -0
- package/build/cjs/components/scroll/plugins/SmoothScrollKeyboardPlugin.js +138 -0
- package/build/cjs/components/scroll/scrollable/ScrollEventsBase.js +133 -0
- package/build/cjs/components/scroll/scrollable/ScrollView.js +315 -0
- package/build/cjs/components/scroll/scrollbar/Bar.js +315 -0
- package/build/cjs/components/scroll/scrollbar/ScrollBar.js +206 -0
- package/build/cjs/components/scroll/smooth-scroll/SmoothScroll.js +625 -0
- package/build/cjs/components/scroll/types.js +2 -0
- package/build/cjs/components/split-text/SplitText.js +233 -0
- package/build/cjs/components/text/SplitText.js +329 -0
- package/build/cjs/components/timeline/StaticTimeline.js +137 -0
- package/build/cjs/components/timeline/Timeline.js +190 -0
- package/build/cjs/index.js +87 -0
- package/build/cjs/utils/common/index.js +12 -0
- package/build/cjs/utils/common/mergeWithoutArrays.js +19 -0
- package/build/cjs/utils/common/randID.js +11 -0
- package/build/cjs/utils/common/timeoutCallback.js +17 -0
- package/build/cjs/utils/errors.js +8 -0
- package/build/cjs/utils/listeners/index.js +10 -0
- package/build/cjs/utils/listeners/intersectionObserverSupported.js +11 -0
- package/build/cjs/utils/listeners/onScroll.js +47 -0
- package/build/cjs/utils/math/boundVal.js +16 -0
- package/build/cjs/utils/math/index.js +12 -0
- package/build/cjs/utils/math/lerp.js +15 -0
- package/build/cjs/utils/math/scopeProgress.js +25 -0
- package/build/cjs/utils/types/general.js +2 -0
- package/build/cjs/utils/types/utility.js +2 -0
- package/build/es/app/Application.js +210 -0
- package/build/es/app/events/PageLoad.js +47 -0
- package/build/es/app/events/Viewport.js +232 -0
- package/build/es/base/Callbacks.js +205 -0
- package/build/es/base/Component.js +32 -0
- package/build/es/base/Module.js +225 -0
- package/build/es/base/MutableProp.js +152 -0
- package/build/es/base/Plugin.js +31 -0
- package/build/es/components/animation-frame/AnimationFrame.js +145 -0
- package/build/es/components/canvas/Ctx2D.js +133 -0
- package/build/es/components/canvas/Ctx2DPrerender.js +37 -0
- package/build/es/components/cursor/CustomCursor.js +274 -0
- package/build/es/components/dragger/Dragger.js +175 -0
- package/build/es/components/dragger/DraggerDirection.js +42 -0
- package/build/es/components/dragger/DraggerMove.js +56 -0
- package/build/es/components/loading/Preloader.js +164 -0
- package/build/es/components/loading/ProgressPreloader.js +304 -0
- package/build/es/components/page/Page.js +283 -0
- package/build/es/components/scroll/custom-scroll/CustomScroll.js +486 -0
- package/build/es/components/scroll/plugins/SmoothScrollDragPlugin.js +140 -0
- package/build/es/components/scroll/plugins/SmoothScrollKeyboardPlugin.js +109 -0
- package/build/es/components/scroll/scrollable/ScrollEventsBase.js +79 -0
- package/build/es/components/scroll/scrollable/ScrollView.js +264 -0
- package/build/es/components/scroll/scrollbar/Bar.js +262 -0
- package/build/es/components/scroll/scrollbar/ScrollBar.js +152 -0
- package/build/es/components/scroll/smooth-scroll/SmoothScroll.js +519 -0
- package/build/es/components/scroll/types.js +1 -0
- package/build/es/components/split-text/SplitText.js +199 -0
- package/build/es/components/text/SplitText.js +270 -0
- package/build/es/components/timeline/StaticTimeline.js +92 -0
- package/build/es/components/timeline/Timeline.js +141 -0
- package/build/es/index.js +37 -0
- package/build/es/utils/common/index.js +4 -0
- package/build/es/utils/common/mergeWithoutArrays.js +13 -0
- package/build/es/utils/common/randID.js +7 -0
- package/build/es/utils/common/timeoutCallback.js +14 -0
- package/build/es/utils/errors.js +5 -0
- package/build/es/utils/listeners/index.js +3 -0
- package/build/es/utils/listeners/intersectionObserverSupported.js +8 -0
- package/build/es/utils/listeners/onScroll.js +44 -0
- package/build/es/utils/math/boundVal.js +12 -0
- package/build/es/utils/math/index.js +4 -0
- package/build/es/utils/math/lerp.js +11 -0
- package/build/es/utils/math/scopeProgress.js +22 -0
- package/build/es/utils/types/general.js +1 -0
- package/build/es/utils/types/utility.js +1 -0
- package/build/types/app/Application.d.ts +161 -0
- package/build/types/app/Application.d.ts.map +1 -0
- package/build/types/app/events/PageLoad.d.ts +28 -0
- package/build/types/app/events/PageLoad.d.ts.map +1 -0
- package/build/types/app/events/Viewport.d.ts +137 -0
- package/build/types/app/events/Viewport.d.ts.map +1 -0
- package/build/types/base/Callbacks.d.ts +174 -0
- package/build/types/base/Callbacks.d.ts.map +1 -0
- package/build/types/base/Component.d.ts +48 -0
- package/build/types/base/Component.d.ts.map +1 -0
- package/build/types/base/Module.d.ts +179 -0
- package/build/types/base/Module.d.ts.map +1 -0
- package/build/types/base/MutableProp.d.ts +142 -0
- package/build/types/base/MutableProp.d.ts.map +1 -0
- package/build/types/base/Plugin.d.ts +35 -0
- package/build/types/base/Plugin.d.ts.map +1 -0
- package/build/types/components/animation-frame/AnimationFrame.d.ts +96 -0
- package/build/types/components/animation-frame/AnimationFrame.d.ts.map +1 -0
- package/build/types/components/canvas/Ctx2D.d.ts +111 -0
- package/build/types/components/canvas/Ctx2D.d.ts.map +1 -0
- package/build/types/components/canvas/Ctx2DPrerender.d.ts +41 -0
- package/build/types/components/canvas/Ctx2DPrerender.d.ts.map +1 -0
- package/build/types/components/cursor/CustomCursor.d.ts +181 -0
- package/build/types/components/cursor/CustomCursor.d.ts.map +1 -0
- package/build/types/components/dragger/Dragger.d.ts +120 -0
- package/build/types/components/dragger/Dragger.d.ts.map +1 -0
- package/build/types/components/dragger/DraggerDirection.d.ts +39 -0
- package/build/types/components/dragger/DraggerDirection.d.ts.map +1 -0
- package/build/types/components/dragger/DraggerMove.d.ts +49 -0
- package/build/types/components/dragger/DraggerMove.d.ts.map +1 -0
- package/build/types/components/loading/Preloader.d.ts +107 -0
- package/build/types/components/loading/Preloader.d.ts.map +1 -0
- package/build/types/components/loading/ProgressPreloader.d.ts +166 -0
- package/build/types/components/loading/ProgressPreloader.d.ts.map +1 -0
- package/build/types/components/page/Page.d.ts +126 -0
- package/build/types/components/page/Page.d.ts.map +1 -0
- package/build/types/components/scroll/custom-scroll/CustomScroll.d.ts +322 -0
- package/build/types/components/scroll/custom-scroll/CustomScroll.d.ts.map +1 -0
- package/build/types/components/scroll/plugins/SmoothScrollDragPlugin.d.ts +97 -0
- package/build/types/components/scroll/plugins/SmoothScrollDragPlugin.d.ts.map +1 -0
- package/build/types/components/scroll/plugins/SmoothScrollKeyboardPlugin.d.ts +34 -0
- package/build/types/components/scroll/plugins/SmoothScrollKeyboardPlugin.d.ts.map +1 -0
- package/build/types/components/scroll/scrollable/ScrollEventsBase.d.ts +60 -0
- package/build/types/components/scroll/scrollable/ScrollEventsBase.d.ts.map +1 -0
- package/build/types/components/scroll/scrollable/ScrollView.d.ts +140 -0
- package/build/types/components/scroll/scrollable/ScrollView.d.ts.map +1 -0
- package/build/types/components/scroll/scrollbar/Bar.d.ts +84 -0
- package/build/types/components/scroll/scrollbar/Bar.d.ts.map +1 -0
- package/build/types/components/scroll/scrollbar/ScrollBar.d.ts +109 -0
- package/build/types/components/scroll/scrollbar/ScrollBar.d.ts.map +1 -0
- package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts +307 -0
- package/build/types/components/scroll/smooth-scroll/SmoothScroll.d.ts.map +1 -0
- package/build/types/components/scroll/types.d.ts +11 -0
- package/build/types/components/scroll/types.d.ts.map +1 -0
- package/build/types/components/split-text/SplitText.d.ts +118 -0
- package/build/types/components/split-text/SplitText.d.ts.map +1 -0
- package/build/types/components/text/SplitText.d.ts +118 -0
- package/build/types/components/text/SplitText.d.ts.map +1 -0
- package/build/types/components/timeline/StaticTimeline.d.ts +92 -0
- package/build/types/components/timeline/StaticTimeline.d.ts.map +1 -0
- package/build/types/components/timeline/Timeline.d.ts +101 -0
- package/build/types/components/timeline/Timeline.d.ts.map +1 -0
- package/build/types/index.d.ts +38 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/utils/common/index.d.ts +5 -0
- package/build/types/utils/common/index.d.ts.map +1 -0
- package/build/types/utils/common/mergeWithoutArrays.d.ts +6 -0
- package/build/types/utils/common/mergeWithoutArrays.d.ts.map +1 -0
- package/build/types/utils/common/randID.d.ts +5 -0
- package/build/types/utils/common/randID.d.ts.map +1 -0
- package/build/types/utils/common/timeoutCallback.d.ts +6 -0
- package/build/types/utils/common/timeoutCallback.d.ts.map +1 -0
- package/build/types/utils/errors.d.ts +3 -0
- package/build/types/utils/errors.d.ts.map +1 -0
- package/build/types/utils/listeners/index.d.ts +4 -0
- package/build/types/utils/listeners/index.d.ts.map +1 -0
- package/build/types/utils/listeners/intersectionObserverSupported.d.ts +2 -0
- package/build/types/utils/listeners/intersectionObserverSupported.d.ts.map +1 -0
- package/build/types/utils/listeners/onScroll.d.ts +10 -0
- package/build/types/utils/listeners/onScroll.d.ts.map +1 -0
- package/build/types/utils/math/boundVal.d.ts +5 -0
- package/build/types/utils/math/boundVal.d.ts.map +1 -0
- package/build/types/utils/math/index.d.ts +5 -0
- package/build/types/utils/math/index.d.ts.map +1 -0
- package/build/types/utils/math/lerp.d.ts +5 -0
- package/build/types/utils/math/lerp.d.ts.map +1 -0
- package/build/types/utils/math/scopeProgress.d.ts +20 -0
- package/build/types/utils/math/scopeProgress.d.ts.map +1 -0
- package/build/types/utils/types/general.d.ts +7 -0
- package/build/types/utils/types/general.d.ts.map +1 -0
- package/build/types/utils/types/utility.d.ts +14 -0
- package/build/types/utils/types/utility.d.ts.map +1 -0
- package/package.json +88 -82
- package/src/cdn/index.js +3 -0
- package/src/sass/base.scss +3 -0
- package/src/sass/components/cursor/_custom-cursor.scss +63 -0
- package/src/sass/components/index.scss +6 -0
- package/src/sass/components/loading/_preloader.scss +15 -0
- package/src/sass/components/scroll/_scrollbar.scss +73 -0
- package/src/sass/components/scroll/_smooth-scroll.scss +17 -0
- package/src/sass/index.scss +3 -0
- package/src/sass/mixins/_scroll.scss +7 -0
- package/{dist/scss → src/sass}/mixins/_transition.scss +8 -4
- package/src/sass/mixins/_viewport.scss +69 -0
- package/src/sass/mixins/index.scss +3 -0
- package/src/ts/app/Application.ts +350 -0
- package/src/ts/app/events/PageLoad.ts +79 -0
- package/src/ts/app/events/Viewport.ts +365 -0
- package/src/ts/base/Callbacks.ts +380 -0
- package/src/ts/base/Component.ts +83 -0
- package/src/ts/base/Module.ts +385 -0
- package/src/ts/base/MutableProp.ts +242 -0
- package/src/ts/base/Plugin.ts +76 -0
- package/src/ts/components/animation-frame/AnimationFrame.ts +264 -0
- package/src/ts/components/canvas/Ctx2D.ts +260 -0
- package/src/ts/components/canvas/Ctx2DPrerender.ts +96 -0
- package/src/ts/components/cursor/CustomCursor.ts +462 -0
- package/src/ts/components/dragger/Dragger.ts +313 -0
- package/src/ts/components/dragger/DraggerDirection.ts +106 -0
- package/src/ts/components/dragger/DraggerMove.ts +114 -0
- package/src/ts/components/loading/Preloader.ts +279 -0
- package/src/ts/components/loading/ProgressPreloader.ts +484 -0
- package/src/ts/components/page/Page.ts +421 -0
- package/src/ts/components/scroll/plugins/SmoothScrollDragPlugin.ts +251 -0
- package/src/ts/components/scroll/plugins/SmoothScrollKeyboardPlugin.ts +166 -0
- package/src/ts/components/scroll/scrollable/ScrollEventsBase.ts +151 -0
- package/src/ts/components/scroll/scrollable/ScrollView.ts +435 -0
- package/src/ts/components/scroll/scrollbar/Bar.ts +364 -0
- package/src/ts/components/scroll/scrollbar/ScrollBar.ts +292 -0
- package/src/ts/components/scroll/smooth-scroll/SmoothScroll.ts +861 -0
- package/src/ts/components/scroll/types.ts +10 -0
- package/src/ts/components/text/SplitText.ts +418 -0
- package/src/ts/components/timeline/StaticTimeline.ts +197 -0
- package/src/ts/components/timeline/Timeline.ts +256 -0
- package/src/ts/index.ts +94 -0
- package/src/ts/utils/common/index.ts +9 -0
- package/src/ts/utils/common/mergeWithoutArrays.ts +20 -0
- package/src/ts/utils/common/randID.ts +9 -0
- package/src/ts/utils/common/timeoutCallback.ts +16 -0
- package/src/ts/utils/errors.ts +6 -0
- package/src/ts/utils/listeners/index.ts +7 -0
- package/src/ts/utils/listeners/intersectionObserverSupported.ts +10 -0
- package/src/ts/utils/listeners/onScroll.ts +56 -0
- package/src/ts/utils/math/boundVal.ts +15 -0
- package/src/ts/utils/math/index.ts +9 -0
- package/src/ts/utils/math/lerp.ts +16 -0
- package/src/ts/utils/math/scopeProgress.ts +23 -0
- package/src/ts/utils/types/general.ts +7 -0
- package/src/ts/utils/types/utility.ts +34 -0
- package/dist/js/AJAXEvent.js +0 -355
- package/dist/js/Application.js +0 -345
- package/dist/js/ColumnsModule.js +0 -392
- package/dist/js/CursorModule.js +0 -390
- package/dist/js/DraggerModule.js +0 -792
- package/dist/js/Event.js +0 -538
- package/dist/js/FilterModule.js +0 -943
- package/dist/js/FormModule.js +0 -706
- package/dist/js/FrameModule.js +0 -229
- package/dist/js/IntervalModule.js +0 -270
- package/dist/js/KeydownModule.js +0 -293
- package/dist/js/LoadEvent.js +0 -106
- package/dist/js/MenuBaseModule.js +0 -292
- package/dist/js/MenuModule.js +0 -265
- package/dist/js/MenuTimelineModule.js +0 -321
- package/dist/js/Module.js +0 -478
- package/dist/js/PageAjaxModule.js +0 -1010
- package/dist/js/PageLoadMediaPlugin.js +0 -285
- package/dist/js/PageModule.js +0 -440
- package/dist/js/PaginationModule.js +0 -961
- package/dist/js/PaginationScrollPlugin.js +0 -209
- package/dist/js/Plugin.js +0 -114
- package/dist/js/PopupModule.js +0 -942
- package/dist/js/PreloaderModule.js +0 -724
- package/dist/js/ResponsiveProp.js +0 -301
- package/dist/js/ScrollAnchorModule.js +0 -554
- package/dist/js/ScrollAnimateModule.js +0 -419
- package/dist/js/ScrollBarPlugin.js +0 -594
- package/dist/js/ScrollDragPlugin.js +0 -396
- package/dist/js/ScrollModule.js +0 -1071
- package/dist/js/ScrollViewModule.js +0 -388
- package/dist/js/SelectModule.js +0 -860
- package/dist/js/SliderCanvasModule.js +0 -733
- package/dist/js/SliderControlsPlugin.js +0 -247
- package/dist/js/SliderCounterPlugin.js +0 -278
- package/dist/js/SliderDotsPlugin.js +0 -270
- package/dist/js/SliderDragSwipePlugin.js +0 -245
- package/dist/js/SliderIntervalPlugin.js +0 -192
- package/dist/js/SliderKeydownPlugin.js +0 -185
- package/dist/js/SliderModule.js +0 -1062
- package/dist/js/SliderWheelPlugin.js +0 -194
- package/dist/js/TextAnimateModule.js +0 -663
- package/dist/js/TextSplitModule.js +0 -785
- package/dist/js/TimelineBaseModule.js +0 -405
- package/dist/js/TimelineModule.js +0 -494
- package/dist/js/URLEvent.js +0 -239
- package/dist/js/ViewportEvent.js +0 -465
- package/dist/js/WheelEventModule.js +0 -295
- package/dist/js/domChildOf.js +0 -46
- package/dist/js/domChildren.js +0 -47
- package/dist/js/domInsertAfter.js +0 -32
- package/dist/js/domRemoveChildren.js +0 -26
- package/dist/js/easing.js +0 -363
- package/dist/js/eventListenerAdd.js +0 -87
- package/dist/js/eventListenerGet.js +0 -49
- package/dist/js/eventListenerRemove.js +0 -36
- package/dist/js/generateId.js +0 -29
- package/dist/js/getBrowserName.js +0 -60
- package/dist/js/getOsName.js +0 -39
- package/dist/js/getVevetProperties.js +0 -22
- package/dist/js/index.js +0 -519
- package/dist/js/mathScopeProgress.js +0 -32
- package/dist/js/mathSpreadScopeProgress.js +0 -35
- package/dist/js/merge.js +0 -33
- package/dist/js/normalizeWheel.js +0 -97
- package/dist/js/text_animate_module_addons/_composite_elementary.js +0 -196
- package/dist/js/text_animate_module_addons/_elementary.js +0 -88
- package/dist/js/timeoutCallback.js +0 -26
- package/dist/js/vevet.js +0 -10
- package/dist/scss/_prefix.scss +0 -1
- package/dist/scss/classes/_clear.scss +0 -5
- package/dist/scss/classes/_col-row.scss +0 -48
- package/dist/scss/classes/_display.scss +0 -65
- package/dist/scss/classes/_document-reset.scss +0 -28
- package/dist/scss/classes/_document.scss +0 -7
- package/dist/scss/classes/_overflow.scss +0 -39
- package/dist/scss/classes/_position.scss +0 -55
- package/dist/scss/classes/_text.scss +0 -24
- package/dist/scss/classes/_transition.scss +0 -22
- package/dist/scss/classes/_wrap.scss +0 -31
- package/dist/scss/classes/index.scss +0 -14
- package/dist/scss/index.scss +0 -3
- package/dist/scss/mixins/_clear.scss +0 -6
- package/dist/scss/mixins/_display.scss +0 -6
- package/dist/scss/mixins/_form.scss +0 -14
- package/dist/scss/mixins/_position.scss +0 -42
- package/dist/scss/mixins/_reset.scss +0 -17
- package/dist/scss/mixins/_responsive.scss +0 -88
- package/dist/scss/mixins/index.scss +0 -7
- package/dist/scss/modules/columns/_settings.scss +0 -1
- package/dist/scss/modules/columns/index.scss +0 -19
- package/dist/scss/modules/cursor/_settings.scss +0 -7
- package/dist/scss/modules/cursor/index.scss +0 -15
- package/dist/scss/modules/form/_settings.scss +0 -15
- package/dist/scss/modules/form/index.scss +0 -57
- package/dist/scss/modules/index.scss +0 -11
- package/dist/scss/modules/menu/_button.scss +0 -58
- package/dist/scss/modules/menu/_menu.scss +0 -25
- package/dist/scss/modules/menu/_settings.scss +0 -23
- package/dist/scss/modules/menu/index.scss +0 -3
- package/dist/scss/modules/pagination/_settings.scss +0 -6
- package/dist/scss/modules/pagination/index.scss +0 -24
- package/dist/scss/modules/popup/_settings.scss +0 -26
- package/dist/scss/modules/popup/index.scss +0 -294
- package/dist/scss/modules/preloader/_settings.scss +0 -3
- package/dist/scss/modules/preloader/index.scss +0 -19
- package/dist/scss/modules/scroll/_settings.scss +0 -22
- package/dist/scss/modules/scroll/index.scss +0 -94
- package/dist/scss/modules/select/_settings.scss +0 -28
- package/dist/scss/modules/select/index.scss +0 -142
- package/dist/scss/modules/slider/_settings.scss +0 -35
- package/dist/scss/modules/slider/index.scss +0 -153
- package/dist/scss/modules/text/_settings.scss +0 -1
- package/dist/scss/modules/text/index.scss +0 -19
- package/dist/types/types.d.ts +0 -18763
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { Application } from '../app/Application';
|
|
2
|
+
export declare namespace NCallbacks {
|
|
3
|
+
/**
|
|
4
|
+
* Callbacks Properties Settings
|
|
5
|
+
*/
|
|
6
|
+
interface CallbackBaseSettings {
|
|
7
|
+
/**
|
|
8
|
+
* Name of the callback if needed.
|
|
9
|
+
*/
|
|
10
|
+
name?: string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Timeout of the callback.
|
|
13
|
+
*/
|
|
14
|
+
timeout?: number | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* If true, the callback can't be removed.
|
|
17
|
+
*/
|
|
18
|
+
protected?: boolean | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* If true, the callback is to be removed after it is called.
|
|
21
|
+
*/
|
|
22
|
+
once?: boolean | undefined;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Callbacks Settings
|
|
26
|
+
*/
|
|
27
|
+
interface CallbackSettings<Types, Target extends keyof Types> extends CallbackBaseSettings {
|
|
28
|
+
target: Target;
|
|
29
|
+
do: (arg: Types[Target]) => void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Callbacks Types
|
|
33
|
+
*/
|
|
34
|
+
interface CallbacksTypes {
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Callback Full Data
|
|
38
|
+
*/
|
|
39
|
+
type CallbacksData<Types> = {
|
|
40
|
+
/**
|
|
41
|
+
* ID of the callback
|
|
42
|
+
*/
|
|
43
|
+
id: string;
|
|
44
|
+
/**
|
|
45
|
+
* Defines if the callback is enabled
|
|
46
|
+
*/
|
|
47
|
+
on: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Callback Data
|
|
50
|
+
*/
|
|
51
|
+
data: CallbackSettings<Types, keyof Types>;
|
|
52
|
+
};
|
|
53
|
+
type SingleCallbackData<Types, Target extends keyof Types> = {
|
|
54
|
+
/**
|
|
55
|
+
* ID of the callback
|
|
56
|
+
*/
|
|
57
|
+
id: string;
|
|
58
|
+
/**
|
|
59
|
+
* Defines if the callback is enabled
|
|
60
|
+
*/
|
|
61
|
+
on: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Callback Data
|
|
64
|
+
*/
|
|
65
|
+
data: CallbackSettings<Types, Target>;
|
|
66
|
+
};
|
|
67
|
+
interface AddedCallback {
|
|
68
|
+
/**
|
|
69
|
+
* ID of the callback
|
|
70
|
+
*/
|
|
71
|
+
id: string;
|
|
72
|
+
/**
|
|
73
|
+
* Remove the callback
|
|
74
|
+
*/
|
|
75
|
+
remove: () => void;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A class for callbacks' manipulation.
|
|
80
|
+
*/
|
|
81
|
+
export declare class Callbacks<
|
|
82
|
+
/**
|
|
83
|
+
* Module Callbacks
|
|
84
|
+
*/
|
|
85
|
+
Types extends NCallbacks.CallbacksTypes = NCallbacks.CallbacksTypes> {
|
|
86
|
+
/**
|
|
87
|
+
* Vevet Application
|
|
88
|
+
*/
|
|
89
|
+
protected _app: Application;
|
|
90
|
+
/**
|
|
91
|
+
* All callbacks
|
|
92
|
+
*/
|
|
93
|
+
protected _callbacks: NCallbacks.CallbacksData<Types>[];
|
|
94
|
+
/**
|
|
95
|
+
* Get all callbacks
|
|
96
|
+
*/
|
|
97
|
+
get callbacks(): NCallbacks.CallbacksData<Types>[];
|
|
98
|
+
/**
|
|
99
|
+
* @example
|
|
100
|
+
* const callback = new Callbacks();
|
|
101
|
+
*/
|
|
102
|
+
constructor(callInit?: boolean);
|
|
103
|
+
/**
|
|
104
|
+
* Initialize the class.
|
|
105
|
+
*/
|
|
106
|
+
protected _init(): void;
|
|
107
|
+
/**
|
|
108
|
+
* An empty method that is called in {@linkcode Callbacks._init}.
|
|
109
|
+
*/
|
|
110
|
+
protected _constructor(): void;
|
|
111
|
+
/**
|
|
112
|
+
* An empty method that is called in {@linkcode Callbacks._init}.
|
|
113
|
+
*/
|
|
114
|
+
protected _setEvents(): void;
|
|
115
|
+
/**
|
|
116
|
+
* Adds a callback
|
|
117
|
+
* @param target - Callback target name
|
|
118
|
+
* @param func - Callback function
|
|
119
|
+
* @param data - Callback data
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* const onTarget = callback.add("target-name", () => {
|
|
123
|
+
* alert("callback");
|
|
124
|
+
* });
|
|
125
|
+
*/
|
|
126
|
+
add<Target extends keyof Types>(target: Target, func: NCallbacks.CallbackSettings<Types, Target>['do'], data?: NCallbacks.CallbackBaseSettings): NCallbacks.AddedCallback;
|
|
127
|
+
/**
|
|
128
|
+
* Use it to implement some actions after adding a callback.
|
|
129
|
+
*/
|
|
130
|
+
protected _onAdd(id: string): void;
|
|
131
|
+
/**
|
|
132
|
+
* Remove a callback.
|
|
133
|
+
*/
|
|
134
|
+
remove(id: string, removeProtected?: boolean): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Use it to implement some actions after removing a callback.
|
|
137
|
+
*/
|
|
138
|
+
protected _onRemove(id: string): void;
|
|
139
|
+
/**
|
|
140
|
+
* Remove all callbacks.
|
|
141
|
+
*/
|
|
142
|
+
removeAll(removeProtected?: boolean): void;
|
|
143
|
+
/**
|
|
144
|
+
* Enable/disable a callback.
|
|
145
|
+
* @param id - ID of the callback
|
|
146
|
+
* @param enabled - True to enable, false to disable.
|
|
147
|
+
*/
|
|
148
|
+
turn(id: string, enabled?: boolean): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Use it to implement some actions after enabling or disabling a callback.
|
|
151
|
+
*/
|
|
152
|
+
protected _onTurn(id: string): void;
|
|
153
|
+
/**
|
|
154
|
+
* Get a callback by id
|
|
155
|
+
*/
|
|
156
|
+
get(id: string): false | NCallbacks.CallbacksData<Types>;
|
|
157
|
+
/**
|
|
158
|
+
* Trigger a callback. It will work only if the callback is enabled.
|
|
159
|
+
*/
|
|
160
|
+
protected _trigger<Target extends keyof Types>(callback: NCallbacks.SingleCallbackData<Types, Target>, arg: Types[Target]): void;
|
|
161
|
+
/**
|
|
162
|
+
* Launch a callback's function
|
|
163
|
+
*/
|
|
164
|
+
protected _triggerFunc(func: Function, arg: false | any): void;
|
|
165
|
+
/**
|
|
166
|
+
* Trigger all enabled callbacks under a certain target name. (TBT: Trigger by target).
|
|
167
|
+
*/
|
|
168
|
+
tbt<T extends keyof Types>(target: T, arg: Types[T]): void;
|
|
169
|
+
/**
|
|
170
|
+
* Destroy the callbacks
|
|
171
|
+
*/
|
|
172
|
+
destroy(): void;
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=Callbacks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Callbacks.d.ts","sourceRoot":"","sources":["../../../src/ts/base/Callbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKjD,yBAAiB,UAAU,CAAC;IAExB;;OAEG;IACH,UAAiB,oBAAoB;QACjC;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,GAA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KAAK,EAC7B,MAAM,EAAE,CAAC,EACT,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IAWjB;;OAEG;IACI,OAAO;CAGjB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Module, NModule } from './Module';
|
|
2
|
+
import { Plugin } from './Plugin';
|
|
3
|
+
export declare namespace NComponent {
|
|
4
|
+
/**
|
|
5
|
+
* Static properties
|
|
6
|
+
*/
|
|
7
|
+
interface StaticProp extends NModule.StaticProp {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Changeable Properties
|
|
11
|
+
*/
|
|
12
|
+
interface ChangeableProp extends NModule.ChangeableProp {
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Available callbacks
|
|
16
|
+
*/
|
|
17
|
+
interface CallbacksTypes extends NModule.CallbacksTypes {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A class for Components.
|
|
22
|
+
*/
|
|
23
|
+
export declare class Component<
|
|
24
|
+
/**
|
|
25
|
+
* Static Properties (they never change)
|
|
26
|
+
*/
|
|
27
|
+
StaticProp extends NComponent.StaticProp = NComponent.StaticProp,
|
|
28
|
+
/**
|
|
29
|
+
* Mutable Properties
|
|
30
|
+
* (may change on window resize or through {@linkcode Component.changeProp})
|
|
31
|
+
*/
|
|
32
|
+
ChangeableProp extends NComponent.ChangeableProp = NComponent.ChangeableProp,
|
|
33
|
+
/**
|
|
34
|
+
* Component Callbacks
|
|
35
|
+
*/
|
|
36
|
+
CallbacksTypes extends NComponent.CallbacksTypes = NComponent.CallbacksTypes> extends Module<StaticProp, ChangeableProp, CallbacksTypes> {
|
|
37
|
+
protected _plugins?: Plugin[];
|
|
38
|
+
/**
|
|
39
|
+
* Add a single plugin
|
|
40
|
+
*/
|
|
41
|
+
addPlugin(plugin: any): void;
|
|
42
|
+
/**
|
|
43
|
+
* Destroy all plugins
|
|
44
|
+
*/
|
|
45
|
+
protected _destroyPlugins(): void;
|
|
46
|
+
protected _destroy(): void;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=Component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.d.ts","sourceRoot":"","sources":["../../../src/ts/base/Component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,yBAAiB,UAAU,CAAC;IAExB;;OAEG;IACH,UAAiB,UAAW,SAAQ,OAAO,CAAC,UAAU;KAAG;IAEzD;;OAEG;IACH,UAAiB,cAAe,SAAQ,OAAO,CAAC,cAAc;KAAG;IAEjE;;OAEG;IACH,UAAiB,cAAe,SAAQ,OAAO,CAAC,cAAc;KAAG;CAEpE;AAID;;GAEG;AACH,qBAAa,SAAS;AAClB;;GAEG;AACH,UAAU,SAAS,UAAU,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU;AAChE;;;GAGG;AACH,cAAc,SAAS,UAAU,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc;AAC5E;;GAEG;AACH,cAAc,SAAS,UAAU,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,CAC9E,SAAQ,MAAM,CACZ,UAAU,EACV,cAAc,EACd,cAAc,CACjB;IACG,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAE9B;;OAEG;IACI,SAAS,CACZ,MAAM,EAAE,GAAG;IAWf;;OAEG;IACH,SAAS,CAAC,eAAe;IAUzB,SAAS,CAAC,QAAQ;CAIrB"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { IAddEventListener, IAddEventListenerOptions, ListenerElement } from 'vevet-dom';
|
|
2
|
+
import { Callbacks, NCallbacks } from './Callbacks';
|
|
3
|
+
import { MutableProp, NMutableProp } from './MutableProp';
|
|
4
|
+
import { Application } from '../app/Application';
|
|
5
|
+
import { Viewport } from '../app/events/Viewport';
|
|
6
|
+
import { RequiredModuleProp } from '../utils/types/utility';
|
|
7
|
+
export declare namespace NModule {
|
|
8
|
+
/**
|
|
9
|
+
* Mutable Properties (may change on window resize or through {@linkcode Module.changeProp})
|
|
10
|
+
*/
|
|
11
|
+
interface ChangeableProp {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Static properties
|
|
15
|
+
*/
|
|
16
|
+
interface StaticProp {
|
|
17
|
+
/**
|
|
18
|
+
* Parent module
|
|
19
|
+
*/
|
|
20
|
+
parent?: any;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Available callbacks
|
|
24
|
+
*/
|
|
25
|
+
interface CallbacksTypes extends NCallbacks.CallbacksTypes {
|
|
26
|
+
'destroy': false;
|
|
27
|
+
'changeProp': false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A class for modules.
|
|
32
|
+
*/
|
|
33
|
+
export declare class Module<
|
|
34
|
+
/**
|
|
35
|
+
* Static Properties (they never change)
|
|
36
|
+
*/
|
|
37
|
+
StaticProp extends NModule.StaticProp = NModule.StaticProp,
|
|
38
|
+
/**
|
|
39
|
+
* Mutable Properties
|
|
40
|
+
* (may change on window resize or through {@linkcode Module.changeProp})
|
|
41
|
+
*/
|
|
42
|
+
ChangeableProp extends NModule.ChangeableProp = NModule.ChangeableProp,
|
|
43
|
+
/**
|
|
44
|
+
* Module Callbacks
|
|
45
|
+
*/
|
|
46
|
+
CallbacksTypes extends NModule.CallbacksTypes = NModule.CallbacksTypes> {
|
|
47
|
+
/**
|
|
48
|
+
* Get Default properties (should be extended)
|
|
49
|
+
*/
|
|
50
|
+
protected _getDefaultProp<T extends RequiredModuleProp<StaticProp & ChangeableProp>>(): T;
|
|
51
|
+
/**
|
|
52
|
+
* Current properties
|
|
53
|
+
*/
|
|
54
|
+
get prop(): RequiredModuleProp<(StaticProp & ChangeableProp)>;
|
|
55
|
+
/**
|
|
56
|
+
* Responsive properties
|
|
57
|
+
*/
|
|
58
|
+
protected _mutableProp: MutableProp<StaticProp, ChangeableProp>;
|
|
59
|
+
/**
|
|
60
|
+
* Module Callbacks
|
|
61
|
+
*/
|
|
62
|
+
protected _callbacks: Callbacks<CallbacksTypes>;
|
|
63
|
+
/**
|
|
64
|
+
* Module Callbacks
|
|
65
|
+
*/
|
|
66
|
+
get callbacks(): Callbacks<CallbacksTypes>;
|
|
67
|
+
/**
|
|
68
|
+
* Module listeners
|
|
69
|
+
*/
|
|
70
|
+
protected _listeners: IAddEventListener[];
|
|
71
|
+
/**
|
|
72
|
+
* Vevet Application
|
|
73
|
+
*/
|
|
74
|
+
protected _app: Application;
|
|
75
|
+
/**
|
|
76
|
+
* Module prefix
|
|
77
|
+
*/
|
|
78
|
+
get prefix(): string;
|
|
79
|
+
/**
|
|
80
|
+
* Get module name
|
|
81
|
+
*/
|
|
82
|
+
get name(): string;
|
|
83
|
+
/**
|
|
84
|
+
* If the module is initialized
|
|
85
|
+
*/
|
|
86
|
+
protected _inited: boolean;
|
|
87
|
+
get inited(): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* If the module is destroyed
|
|
90
|
+
*/
|
|
91
|
+
protected _destroyed: boolean;
|
|
92
|
+
get destroyed(): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* @example
|
|
95
|
+
* const mod = new Module();
|
|
96
|
+
*/
|
|
97
|
+
constructor(
|
|
98
|
+
/**
|
|
99
|
+
* Properties on script start
|
|
100
|
+
*/
|
|
101
|
+
initialProp?: (StaticProp & ChangeableProp),
|
|
102
|
+
/**
|
|
103
|
+
* Defines if you need to call {@linkcode Module.init} at the constructor's end.
|
|
104
|
+
* If you want to add responsive properties, set this argument to FALSE.
|
|
105
|
+
*/
|
|
106
|
+
init?: boolean);
|
|
107
|
+
/**
|
|
108
|
+
* Add responsive rules
|
|
109
|
+
*/
|
|
110
|
+
addResponsiveProp(rules: NMutableProp.Responsive<ChangeableProp>): void;
|
|
111
|
+
/**
|
|
112
|
+
* Change module properties.
|
|
113
|
+
* @example
|
|
114
|
+
*
|
|
115
|
+
* // changing properties
|
|
116
|
+
* // let's imagine that the module has the following properties:
|
|
117
|
+
* prop = {
|
|
118
|
+
* name: 'module',
|
|
119
|
+
* cute: true
|
|
120
|
+
* };
|
|
121
|
+
* // we can change some properties in it: whether one or several properties
|
|
122
|
+
* // after the properties are changed, the method _onPropChange is called.
|
|
123
|
+
* module.changeProp({
|
|
124
|
+
* cute: false
|
|
125
|
+
* });
|
|
126
|
+
*/
|
|
127
|
+
changeProp(prop?: ChangeableProp): void;
|
|
128
|
+
/**
|
|
129
|
+
* The method that is called on window resize and properties change.
|
|
130
|
+
*/
|
|
131
|
+
protected _onPropResponsive(): void;
|
|
132
|
+
/**
|
|
133
|
+
* The method that is called on properties change.
|
|
134
|
+
*/
|
|
135
|
+
protected _onPropChange(changedProp: ChangeableProp): void;
|
|
136
|
+
/**
|
|
137
|
+
* The method that is called on properties change.
|
|
138
|
+
*/
|
|
139
|
+
protected _onPropMutate(): void;
|
|
140
|
+
/**
|
|
141
|
+
* Initializes the class.
|
|
142
|
+
*/
|
|
143
|
+
init(): void;
|
|
144
|
+
/**
|
|
145
|
+
* Extra constructor
|
|
146
|
+
*/
|
|
147
|
+
protected _constructor(): void;
|
|
148
|
+
/**
|
|
149
|
+
* Set events
|
|
150
|
+
*/
|
|
151
|
+
protected _setEvents(): void;
|
|
152
|
+
/**
|
|
153
|
+
* Viewport callbacks
|
|
154
|
+
*/
|
|
155
|
+
protected _viewportCallbacks: NCallbacks.AddedCallback[];
|
|
156
|
+
/**
|
|
157
|
+
* Add a viewport callback that will be removed on class destroy
|
|
158
|
+
* {@see Viewport}
|
|
159
|
+
*/
|
|
160
|
+
addViewportCallback(target: Parameters<Viewport['add']>[0], func: Parameters<Viewport['add']>[1], data?: Parameters<Viewport['add']>[2]): NCallbacks.AddedCallback;
|
|
161
|
+
/**
|
|
162
|
+
* Add a module callback
|
|
163
|
+
* {@see Callbacks}
|
|
164
|
+
*/
|
|
165
|
+
addCallback<Target extends keyof CallbacksTypes>(target: Target, func: NCallbacks.CallbackSettings<CallbacksTypes, Target>['do'], data?: NCallbacks.CallbackBaseSettings): NCallbacks.AddedCallback;
|
|
166
|
+
/**
|
|
167
|
+
* Add a DOM event listeners
|
|
168
|
+
*/
|
|
169
|
+
addEventListeners<El extends ListenerElement, Target extends keyof HTMLElementEventMap, Callback extends (evt: HTMLElementEventMap[Target]) => void>(el: El, target: Target, callback: Callback, options?: IAddEventListenerOptions): IAddEventListener;
|
|
170
|
+
/**
|
|
171
|
+
* Destroy the module
|
|
172
|
+
*/
|
|
173
|
+
destroy(): void;
|
|
174
|
+
/**
|
|
175
|
+
* Destroy the module
|
|
176
|
+
*/
|
|
177
|
+
protected _destroy(): void;
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=Module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Module.d.ts","sourceRoot":"","sources":["../../../src/ts/base/Module.ts"],"names":[],"mappings":"AAAA,OAAO,EACe,iBAAiB,EAAE,wBAAwB,EAAE,eAAe,EACjF,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAK5D,yBAAiB,OAAO,CAAC;IAErB;;OAEG;IACH,UAAiB,cAAc;KAAI;IAEnC;;OAEG;IACH,UAAiB,UAAU;QACvB;;WAEG;QACH,MAAM,CAAC,EAAE,GAAG,CAAC;KAChB;IAED;;OAEG;IACH,UAAiB,cAAe,SAAQ,UAAU,CAAC,cAAc;QAC7D,SAAS,EAAE,KAAK,CAAC;Q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|
+
import { Application } from '../app/Application';
|
|
2
|
+
import { NCallbacks } from './Callbacks';
|
|
3
|
+
export declare namespace NMutableProp {
|
|
4
|
+
interface Responsive<S> {
|
|
5
|
+
/**
|
|
6
|
+
* Breakpoint on which the properties will change.
|
|
7
|
+
* Available breakpoints:
|
|
8
|
+
* <ul>
|
|
9
|
+
* <li>any number - width breakpoint</li>
|
|
10
|
+
* <li>'d' - for desktop size</li>
|
|
11
|
+
* <li>'t' - for tablet size</li>
|
|
12
|
+
* <li>'p' - for phone size</li>
|
|
13
|
+
* <li>'phone' - for phone devices</li>
|
|
14
|
+
* <li>'tablet' - for tablet devices</li>
|
|
15
|
+
* <li>'mobile' - for phone or tablet devices</li>
|
|
16
|
+
* </ul>
|
|
17
|
+
*/
|
|
18
|
+
breakpoint: number | 'd' | 't' | 'p' | 'phone' | 'tablet' | 'mobile';
|
|
19
|
+
settings: S;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A class for creating mutable properties that can change on window resize. <br><br>
|
|
24
|
+
*
|
|
25
|
+
* There are two ways to change properties:
|
|
26
|
+
* <ul>
|
|
27
|
+
* <li>
|
|
28
|
+
* To set a resize-listener on window (or use {@linkcode Viewport}).
|
|
29
|
+
* When the window is resized, change the properties with the help of
|
|
30
|
+
* {@linkcode MutableProp.changeProp}</li>
|
|
31
|
+
* <li>
|
|
32
|
+
* The second way is to use the MutableProp and add responsive properties
|
|
33
|
+
* with help of {@linkcode MutableProp.addResponsiveProp}.</li>
|
|
34
|
+
* </ul>
|
|
35
|
+
*/
|
|
36
|
+
export declare class MutableProp<
|
|
37
|
+
/**
|
|
38
|
+
* Static Properties (they never change)
|
|
39
|
+
*/
|
|
40
|
+
StaticProp extends Record<string, any>,
|
|
41
|
+
/**
|
|
42
|
+
* Mutable Properties
|
|
43
|
+
* (may change on window resize or through {@linkcode MutableProp.changeProp})
|
|
44
|
+
*/
|
|
45
|
+
ChangeableProp extends Record<string, any>> {
|
|
46
|
+
/**
|
|
47
|
+
* The properties that were set while initialization.
|
|
48
|
+
* These properties do not change throughout time.
|
|
49
|
+
*/
|
|
50
|
+
protected _initProp: (StaticProp & ChangeableProp);
|
|
51
|
+
/**
|
|
52
|
+
* A callback that is launched when properties are changed on window resize
|
|
53
|
+
*/
|
|
54
|
+
protected _onResponsive: () => void;
|
|
55
|
+
/**
|
|
56
|
+
* A callback that is launched when properties are changed
|
|
57
|
+
* through {@linkcode MutableProp.changeProp}
|
|
58
|
+
*/
|
|
59
|
+
protected _onChange: (prop: ChangeableProp) => void;
|
|
60
|
+
/**
|
|
61
|
+
* Name of the responsive properties.
|
|
62
|
+
*/
|
|
63
|
+
protected _name: string;
|
|
64
|
+
/**
|
|
65
|
+
* Vevet Application.
|
|
66
|
+
*/
|
|
67
|
+
protected _app: Application;
|
|
68
|
+
/**
|
|
69
|
+
* @description Reference properties.
|
|
70
|
+
* These properties may change only through {@linkcode MutableProp.changeProp}.
|
|
71
|
+
*/
|
|
72
|
+
protected _refProp: StaticProp & ChangeableProp;
|
|
73
|
+
/**
|
|
74
|
+
* Current properties.
|
|
75
|
+
* These properties may change both on {@linkcode MutableProp.changeProp} and resize.
|
|
76
|
+
*/
|
|
77
|
+
protected _prop: StaticProp & ChangeableProp;
|
|
78
|
+
/**
|
|
79
|
+
* A set of responsive rules
|
|
80
|
+
*/
|
|
81
|
+
protected _responsiveRules: NMutableProp.Responsive<ChangeableProp>[];
|
|
82
|
+
/**
|
|
83
|
+
* Get current properties
|
|
84
|
+
*/
|
|
85
|
+
get prop(): StaticProp & ChangeableProp;
|
|
86
|
+
/**
|
|
87
|
+
* Viewport callback
|
|
88
|
+
*/
|
|
89
|
+
protected _viewportCallback: NCallbacks.AddedCallback | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* @example
|
|
92
|
+
* const static = {
|
|
93
|
+
* myProp: true,
|
|
94
|
+
* };
|
|
95
|
+
* const responsive = [
|
|
96
|
+
* {
|
|
97
|
+
* breakpoint: 'm',
|
|
98
|
+
* settings: {
|
|
99
|
+
* myProp: false
|
|
100
|
+
* }
|
|
101
|
+
* }
|
|
102
|
+
* ];
|
|
103
|
+
* const prop = new MutableProp(static, responsive);
|
|
104
|
+
*/
|
|
105
|
+
constructor(
|
|
106
|
+
/**
|
|
107
|
+
* The properties that were set while initialization.
|
|
108
|
+
* These properties do not change throughout time.
|
|
109
|
+
*/
|
|
110
|
+
_initProp: (StaticProp & ChangeableProp),
|
|
111
|
+
/**
|
|
112
|
+
* A callback that is launched when properties are changed on window resize
|
|
113
|
+
*/
|
|
114
|
+
_onResponsive?: () => void,
|
|
115
|
+
/**
|
|
116
|
+
* A callback that is launched when properties are changed
|
|
117
|
+
* through {@linkcode MutableProp.changeProp}
|
|
118
|
+
*/
|
|
119
|
+
_onChange?: (prop: ChangeableProp) => void,
|
|
120
|
+
/**
|
|
121
|
+
* Name of the responsive properties.
|
|
122
|
+
*/
|
|
123
|
+
_name?: string);
|
|
124
|
+
/**
|
|
125
|
+
* Add responsive rules
|
|
126
|
+
*/
|
|
127
|
+
addResponsiveProp(rules: NMutableProp.Responsive<ChangeableProp>): void;
|
|
128
|
+
/**
|
|
129
|
+
* Change properties according to the "responsive" settings
|
|
130
|
+
* @param onResize - If the method was called on window resize.
|
|
131
|
+
*/
|
|
132
|
+
protected _responseProp(onResize?: boolean): void;
|
|
133
|
+
/**
|
|
134
|
+
* This method allows you to change the properties manually.
|
|
135
|
+
*/
|
|
136
|
+
changeProp(prop: ChangeableProp): void;
|
|
137
|
+
/**
|
|
138
|
+
* Destroy the responsive properties.
|
|
139
|
+
*/
|
|
140
|
+
destroy(): void;
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=MutableProp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MutableProp.d.ts","sourceRoot":"","sources":["../../../src/ts/base/MutableProp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,O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e;IAC9C;;;OAGG;IACO,SAAS,GAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAe;IAC9D;;OAEG;IACO,KAAK,SAAoB;IASvC;;OAEG;IACI,iBAAiB,CACpB,KAAK,EAAE,YAAY,CAAC,UAAU,CAAC,cAAc,CAAC;IAiBlD;;;OAGG;IACH,SAAS,CAAC,aAAa,CACnB,QAAQ,UAAQ;IA2DpB;;OAEG;IACI,UAAU,CACb,IAAI,EAAE,cAAc;IAWxB;;OAEG;IACI,OAAO;CAKjB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Module, NModule } from './Module';
|
|
2
|
+
export declare namespace NPlugin {
|
|
3
|
+
/**
|
|
4
|
+
* Static properties
|
|
5
|
+
*/
|
|
6
|
+
interface StaticProp {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Changeable Properties
|
|
10
|
+
*/
|
|
11
|
+
interface ChangeableProp {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Available callbacks
|
|
15
|
+
*/
|
|
16
|
+
interface CallbacksTypes extends NModule.CallbacksTypes {
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A class for Plugins.
|
|
21
|
+
*/
|
|
22
|
+
export declare abstract class Plugin<StaticProp extends NPlugin.StaticProp = NPlugin.StaticProp, ChangeableProp extends NPlugin.ChangeableProp = NPlugin.ChangeableProp, CallbacksTypes extends NPlugin.CallbacksTypes = NPlugin.CallbacksTypes, Component = any> extends Module<StaticProp, ChangeableProp, CallbacksTypes> {
|
|
23
|
+
constructor(initialProp?: (StaticProp & ChangeableProp));
|
|
24
|
+
protected _component: Component;
|
|
25
|
+
get component(): Component;
|
|
26
|
+
/**
|
|
27
|
+
* Initializes the class
|
|
28
|
+
*/
|
|
29
|
+
init(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Initialize the plugin
|
|
32
|
+
*/
|
|
33
|
+
initPlugin(parent: Component): void;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=Plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../../src/ts/base/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAI3C,yBAAiB,OAAO,CAAC;IAErB;;OAEG;IACH,UAAiB,UAAU;KAAG;IAE9B;;OAEG;IACH,UAAiB,cAAc;KAAG;IAElC;;OAEG;IACH,UAAiB,cAAe,SAAQ,OAAO,CAAC,cAAc;KAAG;CAEpE;AAID;;GAEG;AACH,8BAAsB,MAAM,CACxB,UAAU,SAAS,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,EAC1D,cAAc,SAAS,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,EACtE,cAAc,SAAS,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,EACtE,SAAS,GAAG,GAAG,CACjB,SAAQ,MAAM,CACZ,UAAU,EACV,cAAc,EACd,cAAc,CACjB;gBAEO,WAAW,CAAC,EAAE,CAAC,UAAU,GAAG,cAAc,CAAC;IAO/C,SAAS,CAAC,UAAU,EAAG,SAAS,CAAC;IACjC,IAAI,SAAS,cAEZ;IAID;;OAEG;IACI,IAAI;IAOX;;OAEG;IACI,UAAU,CACb,MAAM,EAAE,SAAS;CAQxB"}
|