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 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollView.d.ts","sourceRoot":"","sources":["../../../../../src/ts/components/scroll/scrollable/ScrollView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,WAAW,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAQlE,yBAAiB,WAAW,CAAC;IAEzB;;OAEG;IACH,UAAiB,UAAW,SAAQ,iBAAiB,CAAC,UAAU;QAC5D;;;WAGG;QACH,QAAQ,CAAC,EAAE,WAAW,CAAC;QACvB;;;;WAIG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB;;;WAGG;QACH,MAAM,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC;QACxB;;;WAGG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB;;;WAGG;QACH,QAAQ,CAAC,EAAE,KAAK,GAAG;YACf,G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AS,CAAC,SAAS,EAAG,WAAW,CAAC,EAAE,EAAE,CAAC;IACvC;;OAEG;IACH,IAAI,QAAQ,qBAEX;IAED;;OAEG;IACI,cAAc;IA2BrB;;OAEG;IACH,SAAS,CAAC,2BAA2B,CACjC,IAAI,EAAE,yBAAyB,EAAE;IAuBrC;;OAEG;IACH,SAAS,CAAC,aAAa;IAIvB;;;OAGG;IACI,YAAY;IAwBnB;;OAEG;IACH,SAAS,CAAC,sBAAsB,CAC5B,EAAE,EAAE,OAAO,EACX,cAAc,EAAE,iBAAiB,CAAC,YAAY;;;;IA6ClD;;OAEG;IACH,SAAS,CAAC,YAAY,CAClB,EAAE,EAAE,WAAW,CAAC,EAAE,EAClB,UAAU,EAAE,OAAO,EACnB,KAAK,SAAI;IA8Bb;;OAEG;IACH,SAAS,CAAC,sBAAsB;IAgBhC;;OAEG;IACH,SAAS,CAAC,QAAQ;CAIrB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IAddEventListener } from 'vevet-dom';
|
|
3
|
+
import { IRemovable } from '../../../utils/types/general';
|
|
4
|
+
import { DraggerMove, NDraggerMove } from '../../dragger/DraggerMove';
|
|
5
|
+
import { SmoothScroll } from '../smooth-scroll/SmoothScroll';
|
|
6
|
+
interface Data {
|
|
7
|
+
container: Window | SmoothScroll | Element;
|
|
8
|
+
domParent: Element;
|
|
9
|
+
dir: 'x' | 'y';
|
|
10
|
+
autoHide: boolean;
|
|
11
|
+
autoSize: boolean;
|
|
12
|
+
minSize: number;
|
|
13
|
+
optimizeCalculations: boolean;
|
|
14
|
+
prefix: string;
|
|
15
|
+
isDraggable: boolean;
|
|
16
|
+
draggableScrollBehavior: 'smooth' | 'auto';
|
|
17
|
+
}
|
|
18
|
+
export default class Bar {
|
|
19
|
+
protected _prop: Data;
|
|
20
|
+
protected _outer: HTMLElement;
|
|
21
|
+
get outer(): HTMLElement;
|
|
22
|
+
protected _thumb: HTMLElement;
|
|
23
|
+
get thumb(): HTMLElement;
|
|
24
|
+
get prefix(): string;
|
|
25
|
+
get isX(): boolean;
|
|
26
|
+
get isY(): boolean;
|
|
27
|
+
protected _outerHeight: number;
|
|
28
|
+
protected _outerWidth: number;
|
|
29
|
+
protected _thumbHeight: number;
|
|
30
|
+
protected _thumbWidth: number;
|
|
31
|
+
get scrollElement(): Element | SmoothScroll<import("../smooth-scroll/SmoothScroll").NSmoothScroll.StaticProp, import("../smooth-scroll/SmoothScroll").NSmoothScroll.ChangeableProp, import("../smooth-scroll/SmoothScroll").NSmoothScroll.CallbacksTypes>;
|
|
32
|
+
get scrollLine(): number;
|
|
33
|
+
get scrollWidth(): number;
|
|
34
|
+
get scrollHeight(): number;
|
|
35
|
+
protected _scrollVal: number;
|
|
36
|
+
protected _coordsAtDragStart: {
|
|
37
|
+
left: number;
|
|
38
|
+
top: number;
|
|
39
|
+
};
|
|
40
|
+
protected _listeners: IAddEventListener[];
|
|
41
|
+
protected _scrollEvent?: IRemovable;
|
|
42
|
+
protected _actionTimeout?: NodeJS.Timeout;
|
|
43
|
+
protected _dragger?: DraggerMove;
|
|
44
|
+
get prop(): Data;
|
|
45
|
+
constructor(_prop: Data);
|
|
46
|
+
get scrollValues(): {
|
|
47
|
+
left: number;
|
|
48
|
+
top: number;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Set scrolblar events
|
|
52
|
+
*/
|
|
53
|
+
protected _setEvents(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Toggle scrollBehavior: disable & reset smooth scrolling
|
|
56
|
+
*/
|
|
57
|
+
protected _disableScrollBehaviour(bool: boolean): void;
|
|
58
|
+
/**
|
|
59
|
+
* Handle hover state
|
|
60
|
+
*/
|
|
61
|
+
protected _handleHover(bool: boolean): void;
|
|
62
|
+
/**
|
|
63
|
+
* Handle Scroll Event
|
|
64
|
+
*/
|
|
65
|
+
protected _handleScroll(data: {
|
|
66
|
+
scrollTop: number;
|
|
67
|
+
scrollLeft: number;
|
|
68
|
+
}): void;
|
|
69
|
+
/**
|
|
70
|
+
* Event on dragger move
|
|
71
|
+
*/
|
|
72
|
+
protected _handleThumbDrag(data: NDraggerMove.CallbacksTypes['move']): void;
|
|
73
|
+
/**
|
|
74
|
+
* Render the thumb
|
|
75
|
+
*/
|
|
76
|
+
protected _renderThumb(): void;
|
|
77
|
+
/**
|
|
78
|
+
* Resize the scene
|
|
79
|
+
*/
|
|
80
|
+
resize(): void;
|
|
81
|
+
destroy(): void;
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
84
|
+
//# sourceMappingURL=Bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bar.d.ts","sourceRoot":"","sources":["../../../../../src/ts/components/scroll/scrollbar/Bar.ts"],"names":[],"mappings":";AAAA,OAAO,EAAmC,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,UAAU,IAAI;IACV,SAAS,EAAE,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC;IAC3C,SAAS,EAAE,OAAO,CAAC;IACnB,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,uBAAuB,EAAE,QAAQ,GAAG,MAAM,CAAC;CAC9C;AAED,MAAM,CAAC,OAAO,OAAO,GAAG;IAmEhB,SAAS,CAAC,KAAK,EAAE,IAAI;IAjEzB,SAAS,CAAC,MAAM,EAAE,WAAW,CAAC;IAC9B,IAAI,KAAK,g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;;OAEG;IACH,SAAS,CAAC,YAAY;IAgBtB;;OAEG;IACI,MAAM;IA0CN,OAAO;CAejB"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Component, NComponent } from '../../../base/Component';
|
|
2
|
+
import { RequiredModuleProp } from '../../../utils/types/utility';
|
|
3
|
+
import { SmoothScroll } from '../smooth-scroll/SmoothScroll';
|
|
4
|
+
import Bar from './Bar';
|
|
5
|
+
export declare namespace NScrollBar {
|
|
6
|
+
/**
|
|
7
|
+
* Static properties
|
|
8
|
+
*/
|
|
9
|
+
interface StaticProp extends NComponent.StaticProp {
|
|
10
|
+
/**
|
|
11
|
+
* The scrollable element
|
|
12
|
+
* @default window
|
|
13
|
+
*/
|
|
14
|
+
container?: Window | SmoothScroll | Element | string;
|
|
15
|
+
/**
|
|
16
|
+
* The element that will contain the scrollbar.
|
|
17
|
+
* If false, the property 'container' will be taken into consideration.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
domParent?: false | Element;
|
|
21
|
+
/**
|
|
22
|
+
* If the scrollbar must be interactive
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
draggable?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Automatically define the size of the scrollbar thumb
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
autoSize?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Automatically hide scrollbars
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
autoHide?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Minimum size of the scrollbar thumb
|
|
38
|
+
* @default 50
|
|
39
|
+
*/
|
|
40
|
+
minSize?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Optimize sizes calculation.
|
|
43
|
+
* If true, the sizes are calculated only when calling the "resize" method.
|
|
44
|
+
* Subsequently, if content changes, the scrollbar may be of false sizes.
|
|
45
|
+
* @default false
|
|
46
|
+
*/
|
|
47
|
+
optimizeCalculations?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* If the scroll bar is draggable
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
isDraggable?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* What scroll behavior should be used when dragging the ScrollBar thumb.
|
|
55
|
+
* Only for SmoothScroll
|
|
56
|
+
* @default 'smooth'
|
|
57
|
+
*/
|
|
58
|
+
draggableScrollBehavior?: 'smooth' | 'auto';
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Changeable properties
|
|
62
|
+
*/
|
|
63
|
+
interface ChangeableProp extends NComponent.ChangeableProp {
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Available callbacks
|
|
67
|
+
*/
|
|
68
|
+
interface CallbacksTypes extends NComponent.CallbacksTypes {
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Create custom scroll bar
|
|
73
|
+
*/
|
|
74
|
+
export declare class ScrollBar<StaticProp extends NScrollBar.StaticProp = NScrollBar.StaticProp, ChangeableProp extends NScrollBar.ChangeableProp = NScrollBar.ChangeableProp, CallbacksTypes extends NScrollBar.CallbacksTypes = NScrollBar.CallbacksTypes> extends Component<StaticProp, ChangeableProp, CallbacksTypes> {
|
|
75
|
+
protected _getDefaultProp<T extends RequiredModuleProp<StaticProp & ChangeableProp>>(): T;
|
|
76
|
+
get prefix(): string;
|
|
77
|
+
/**
|
|
78
|
+
* Scroll container
|
|
79
|
+
*/
|
|
80
|
+
get container(): Element | Window | SmoothScroll<import("../smooth-scroll/SmoothScroll").NSmoothScroll.StaticProp, import("../smooth-scroll/SmoothScroll").NSmoothScroll.ChangeableProp, import("../smooth-scroll/SmoothScroll").NSmoothScroll.CallbacksTypes>;
|
|
81
|
+
protected _container: Element | Window | SmoothScroll;
|
|
82
|
+
/**
|
|
83
|
+
* Get scrollable element
|
|
84
|
+
*/
|
|
85
|
+
get scrollableElement(): Element;
|
|
86
|
+
/**
|
|
87
|
+
* The element into wchich scroll bars will be appended
|
|
88
|
+
*/
|
|
89
|
+
get domParent(): Element;
|
|
90
|
+
/**
|
|
91
|
+
* The scroll wrapper.
|
|
92
|
+
* Used for wrapper scroll
|
|
93
|
+
*/
|
|
94
|
+
protected _scrollWrapper?: HTMLElement;
|
|
95
|
+
protected _xBar: Bar;
|
|
96
|
+
protected _yBar: Bar;
|
|
97
|
+
constructor(initialProp?: (StaticProp & ChangeableProp), init?: boolean);
|
|
98
|
+
protected _setEvents(): void;
|
|
99
|
+
protected _onPropMutate(): void;
|
|
100
|
+
/**
|
|
101
|
+
* Resize the canvas
|
|
102
|
+
*/
|
|
103
|
+
resize(): void;
|
|
104
|
+
/**
|
|
105
|
+
* Destroy the module
|
|
106
|
+
*/
|
|
107
|
+
protected _destroy(): void;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=ScrollBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollBar.d.ts","sourceRoot":"","sources":["../../../../../src/ts/components/scroll/scrollbar/ScrollBar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,GAAG,MAAM,OAAO,CAAC;AAIxB,yBAAiB,UAAU,CAAC;IAExB;;OAEG;IACH,UAAiB,UAAW,SAAQ,UAAU,CAAC,UAAU;QACrD;;;WAGG;QACH,SAAS,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,OAAO,GAAG,MAAM,CAAC;QACrD;;;;WAIG;QACH,SAAS,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;QAC5B;;;WAGG;QACH,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB;;;WAGG;QACH,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB;;;WAGG;QACH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B;;OAEG;IACI,MAAM;IAOb;;OAEG;IACH,SAAS,CAAC,QAAQ;CAmBrB"}
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
import { Component, NComponent } from '../../../base/Component';
|
|
2
|
+
import { RequiredModuleProp } from '../../../utils/types/utility';
|
|
3
|
+
import { AnimationFrame } from '../../animation-frame/AnimationFrame';
|
|
4
|
+
import { ScrollableElement } from '../types';
|
|
5
|
+
import { NCallbacks } from '../../../base/Callbacks';
|
|
6
|
+
export declare namespace NSmoothScroll {
|
|
7
|
+
/**
|
|
8
|
+
* Static properties
|
|
9
|
+
*/
|
|
10
|
+
interface StaticProp extends NComponent.StaticProp {
|
|
11
|
+
/**
|
|
12
|
+
* Scroll elements
|
|
13
|
+
*/
|
|
14
|
+
selectors?: {
|
|
15
|
+
/**
|
|
16
|
+
* Scrollable wrapper.
|
|
17
|
+
* You may pass either a CSS selector to find the element or the element itself.
|
|
18
|
+
* @default '#v-smooth-scroll'
|
|
19
|
+
*/
|
|
20
|
+
outer?: string | HTMLElement;
|
|
21
|
+
/**
|
|
22
|
+
* Scrollable elements inside the wrapper.
|
|
23
|
+
* You may pass either a CSS selector to find the elements or the elements themselves.
|
|
24
|
+
* @default '#v-smooth-scroll'
|
|
25
|
+
*/
|
|
26
|
+
elements?: false | string | NodeListOf<HTMLElement> | HTMLElement | HTMLElement[];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Animation frame.
|
|
30
|
+
* Pass an AnimationFrame instance if you want to control the scrolling outside this class.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
animationFrame?: false | AnimationFrame;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Changeable properties
|
|
37
|
+
*/
|
|
38
|
+
interface ChangeableProp extends NComponent.ChangeableProp {
|
|
39
|
+
/**
|
|
40
|
+
* If scrolling is enabled
|
|
41
|
+
* @default true
|
|
42
|
+
*/
|
|
43
|
+
enabled?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Recalculate sizes on each scroll update
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
recalculateSizes?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Use wheel event
|
|
51
|
+
* @default true
|
|
52
|
+
*/
|
|
53
|
+
useWheel?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* If scrolling is horizontal
|
|
56
|
+
* @default false
|
|
57
|
+
*/
|
|
58
|
+
isHorizontal?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Automatically stop scrolling after the target and current values are approximated.
|
|
61
|
+
* @default true
|
|
62
|
+
*/
|
|
63
|
+
autoStop?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Stop propagation when scrolling the block
|
|
66
|
+
* @default true
|
|
67
|
+
*/
|
|
68
|
+
stopPropagation?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* If need to add will-change to scrollable elements
|
|
71
|
+
* @default true
|
|
72
|
+
*/
|
|
73
|
+
useWillChange?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Animation options
|
|
76
|
+
*/
|
|
77
|
+
render?: {
|
|
78
|
+
/**
|
|
79
|
+
* Linear interpolation ease
|
|
80
|
+
* @default 0.1
|
|
81
|
+
*/
|
|
82
|
+
lerp?: number;
|
|
83
|
+
/**
|
|
84
|
+
* Sometimes scrolling may be choppy because of large decimal values in transforms.
|
|
85
|
+
* In such cases you may want to use this property.
|
|
86
|
+
* It works on the basis of "toFixed()" method. Only integers
|
|
87
|
+
* @default 2
|
|
88
|
+
*/
|
|
89
|
+
lerpToFixed?: false | number;
|
|
90
|
+
/**
|
|
91
|
+
* @default 0.1
|
|
92
|
+
*/
|
|
93
|
+
approximation?: 0.1;
|
|
94
|
+
/**
|
|
95
|
+
* On different screens with different FPS, scrolling may be faster or slower.
|
|
96
|
+
* This property is to normalize scrolling speed across different FPS.
|
|
97
|
+
* @default false
|
|
98
|
+
*/
|
|
99
|
+
normalizeLerp?: boolean;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Overscroll options
|
|
103
|
+
*/
|
|
104
|
+
overscroll?: false | {
|
|
105
|
+
/**
|
|
106
|
+
* Maximum overscroll
|
|
107
|
+
* @default 250
|
|
108
|
+
*/
|
|
109
|
+
max?: number;
|
|
110
|
+
/**
|
|
111
|
+
* Maximum overscroll
|
|
112
|
+
* @default .5
|
|
113
|
+
*/
|
|
114
|
+
friction?: number;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Available callbacks
|
|
119
|
+
*/
|
|
120
|
+
interface CallbacksTypes extends NComponent.CallbacksTypes {
|
|
121
|
+
'scroll': false;
|
|
122
|
+
'resize': false;
|
|
123
|
+
'approximate': false;
|
|
124
|
+
'wheel': WheelEvent;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export interface ScrollInnerElement extends HTMLElement {
|
|
128
|
+
smoothScrollTop: number;
|
|
129
|
+
smoothScrollLeft: number;
|
|
130
|
+
smoothScrollLerpEase: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Create smooth scrolling.
|
|
134
|
+
*/
|
|
135
|
+
export declare class SmoothScroll<StaticProp extends NSmoothScroll.StaticProp = NSmoothScroll.StaticProp, ChangeableProp extends NSmoothScroll.ChangeableProp = NSmoothScroll.ChangeableProp, CallbacksTypes extends NSmoothScroll.CallbacksTypes = NSmoothScroll.CallbacksTypes> extends Component<StaticProp, ChangeableProp, CallbacksTypes> implements ScrollableElement {
|
|
136
|
+
get prefix(): string;
|
|
137
|
+
/**
|
|
138
|
+
* Scroll parent
|
|
139
|
+
*/
|
|
140
|
+
protected _outer: HTMLElement;
|
|
141
|
+
get outer(): HTMLElement;
|
|
142
|
+
/**
|
|
143
|
+
* Scroll container. If the element does not exist indide the outer,
|
|
144
|
+
* it will be created automatically
|
|
145
|
+
*/
|
|
146
|
+
protected _container: HTMLElement;
|
|
147
|
+
get container(): HTMLElement;
|
|
148
|
+
/**
|
|
149
|
+
* If the container element existed before the class initialization
|
|
150
|
+
*/
|
|
151
|
+
protected _containerExists: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* Scrollable elements
|
|
154
|
+
*/
|
|
155
|
+
protected _elements: ScrollInnerElement[];
|
|
156
|
+
get elements(): ScrollInnerElement[];
|
|
157
|
+
protected _elementsLength: number;
|
|
158
|
+
/**
|
|
159
|
+
* Scroll target value
|
|
160
|
+
*/
|
|
161
|
+
protected _targetLeft: number;
|
|
162
|
+
get targetLeft(): number;
|
|
163
|
+
set targetLeft(val: number);
|
|
164
|
+
/**
|
|
165
|
+
* Set value without animation request
|
|
166
|
+
*/
|
|
167
|
+
protected set targetLeftBound(val: number);
|
|
168
|
+
protected get targetLeftBound(): number;
|
|
169
|
+
/**
|
|
170
|
+
* Scroll target value
|
|
171
|
+
*/
|
|
172
|
+
protected _targetTop: number;
|
|
173
|
+
get targetTop(): number;
|
|
174
|
+
set targetTop(val: number);
|
|
175
|
+
/**
|
|
176
|
+
* Set value without animation request
|
|
177
|
+
*/
|
|
178
|
+
protected set targetTopBound(val: number);
|
|
179
|
+
protected get targetTopBound(): number;
|
|
180
|
+
/**
|
|
181
|
+
* Scroll left
|
|
182
|
+
*/
|
|
183
|
+
protected _scrollLeft: number;
|
|
184
|
+
get scrollLeft(): number;
|
|
185
|
+
set scrollLeft(val: number);
|
|
186
|
+
/**
|
|
187
|
+
* Scroll top
|
|
188
|
+
*/
|
|
189
|
+
protected _scrollTop: number;
|
|
190
|
+
get scrollTop(): number;
|
|
191
|
+
set scrollTop(val: number);
|
|
192
|
+
/**
|
|
193
|
+
* Scroll width
|
|
194
|
+
*/
|
|
195
|
+
protected _scrollWidth: number;
|
|
196
|
+
get scrollWidth(): number;
|
|
197
|
+
/**
|
|
198
|
+
* Scroll height
|
|
199
|
+
*/
|
|
200
|
+
protected _scrollHeight: number;
|
|
201
|
+
get scrollHeight(): number;
|
|
202
|
+
/**
|
|
203
|
+
* Parent width
|
|
204
|
+
*/
|
|
205
|
+
protected _clientWidth: number;
|
|
206
|
+
get clientWidth(): number;
|
|
207
|
+
/**
|
|
208
|
+
* Parent height
|
|
209
|
+
*/
|
|
210
|
+
protected _clientHeight: number;
|
|
211
|
+
get clientHeight(): number;
|
|
212
|
+
/**
|
|
213
|
+
* Maximum scrollable area of the X axis
|
|
214
|
+
*/
|
|
215
|
+
get maxScrollableWidth(): number;
|
|
216
|
+
/**
|
|
217
|
+
* Maximum scrollable area of the Y axis
|
|
218
|
+
*/
|
|
219
|
+
get maxScrollableHeight(): number;
|
|
220
|
+
/**
|
|
221
|
+
* If the approximation between the target and current scroll values must be instantaneous
|
|
222
|
+
*/
|
|
223
|
+
protected _instant: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* Inner AnimationFrame.
|
|
226
|
+
* The AnimationFrame is not create if an outer AnimationFrame is passed in properties.
|
|
227
|
+
*/
|
|
228
|
+
protected _animationFrame?: AnimationFrame;
|
|
229
|
+
/**
|
|
230
|
+
* AnimationFrame callback is used for outer AnimationFrame only.
|
|
231
|
+
*/
|
|
232
|
+
protected _outerAnimationFrameEvent?: NCallbacks.AddedCallback;
|
|
233
|
+
/**
|
|
234
|
+
* Current FPS. Used to normalize LERP ease
|
|
235
|
+
*/
|
|
236
|
+
protected _currentFPS: number;
|
|
237
|
+
constructor(initialProp?: (StaticProp & ChangeableProp), init?: boolean);
|
|
238
|
+
protected _getDefaultProp<T extends RequiredModuleProp<StaticProp & ChangeableProp>>(): T;
|
|
239
|
+
protected _constructor(): void;
|
|
240
|
+
protected _setEvents(): void;
|
|
241
|
+
protected _onPropMutate(): void;
|
|
242
|
+
/**
|
|
243
|
+
* Recalculate scroll sizes
|
|
244
|
+
*/
|
|
245
|
+
resize(
|
|
246
|
+
/**
|
|
247
|
+
* If the method was called natively on window resize
|
|
248
|
+
*/
|
|
249
|
+
native?: boolean): void;
|
|
250
|
+
/**
|
|
251
|
+
* Recalculate scroll sizes
|
|
252
|
+
*/
|
|
253
|
+
protected _recalculateSizes(): void;
|
|
254
|
+
/**
|
|
255
|
+
* Update elements' properties
|
|
256
|
+
*/
|
|
257
|
+
protected _updateElementsProp(): void;
|
|
258
|
+
/**
|
|
259
|
+
* Event on wheel
|
|
260
|
+
*/
|
|
261
|
+
protected _handleWheel(evt: WheelEvent): void;
|
|
262
|
+
/**
|
|
263
|
+
* Toggle animation: Enable / Disable scrolling
|
|
264
|
+
*/
|
|
265
|
+
protected _toggle(): void;
|
|
266
|
+
/**
|
|
267
|
+
* Enable scrolling
|
|
268
|
+
*/
|
|
269
|
+
protected _enable(): void;
|
|
270
|
+
/**
|
|
271
|
+
* Disable scrolling
|
|
272
|
+
*/
|
|
273
|
+
protected _disable(): void;
|
|
274
|
+
/**
|
|
275
|
+
* Render elements
|
|
276
|
+
*/
|
|
277
|
+
render(): void;
|
|
278
|
+
/**
|
|
279
|
+
* Calculate scroll value
|
|
280
|
+
*/
|
|
281
|
+
protected _calcScroll(): void;
|
|
282
|
+
/**
|
|
283
|
+
* Calculate elements' values.
|
|
284
|
+
*/
|
|
285
|
+
protected _calcElements(): void;
|
|
286
|
+
/**
|
|
287
|
+
* Interpolate values
|
|
288
|
+
*/
|
|
289
|
+
protected _lerp(current: number, target: number, ease?: number): number;
|
|
290
|
+
/**
|
|
291
|
+
* Get element ease
|
|
292
|
+
*/
|
|
293
|
+
protected _getLerpEase(el?: ScrollInnerElement | false): number;
|
|
294
|
+
/**
|
|
295
|
+
* Render elements
|
|
296
|
+
*/
|
|
297
|
+
protected _renderElements(): void;
|
|
298
|
+
/**
|
|
299
|
+
* Scroll to
|
|
300
|
+
*/
|
|
301
|
+
scrollTo(): void;
|
|
302
|
+
/**
|
|
303
|
+
* Destroy the scroll
|
|
304
|
+
*/
|
|
305
|
+
protected _destroy(): void;
|
|
306
|
+
}
|
|
307
|
+
//# sourceMappingURL=SmoothScroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SmoothScroll.d.ts","sourceRoot":"","sources":["../../../../../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2
|
+
scrollTop: number;
|
|
3
|
+
scrollTo(options: ScrollToOptions): void;
|
|
4
|
+
scrollTo(x: number, y: number): void;
|
|
5
|
+
scrollLeft: number;
|
|
6
|
+
scrollWidth: number;
|
|
7
|
+
scrollHeight: number;
|
|
8
|
+
clientWidth: number;
|
|
9
|
+
clientHeight: number;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ts/components/scroll/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Component, NComponent } from '../../base/Component';
|
|
2
|
+
import { DeepRequired } from '../../utils/types/utility';
|
|
3
|
+
export declare namespace NSplitText {
|
|
4
|
+
/**
|
|
5
|
+
* Static properties
|
|
6
|
+
*/
|
|
7
|
+
interface StaticProp extends NComponent.StaticProp {
|
|
8
|
+
/**
|
|
9
|
+
* Text container
|
|
10
|
+
*/
|
|
11
|
+
container?: string | Element;
|
|
12
|
+
/**
|
|
13
|
+
* Timeout before lines are updated when the window is resized.
|
|
14
|
+
* @default 0
|
|
15
|
+
*/
|
|
16
|
+
resizeTimeout?: number;
|
|
17
|
+
append?: {
|
|
18
|
+
/**
|
|
19
|
+
* If you need to wrap each letter into a single element.
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
letters: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* If you need to wrap each word into a single element.
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
words: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* If you need to wrap each line into a single element.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
lines: boolean;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Changeable properties
|
|
37
|
+
*/
|
|
38
|
+
interface ChangeableProp extends NComponent.ChangeableProp {
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Available callbacks
|
|
42
|
+
*/
|
|
43
|
+
interface CallbacksTypes extends NComponent.CallbacksTypes {
|
|
44
|
+
'resize': false;
|
|
45
|
+
'split': false;
|
|
46
|
+
}
|
|
47
|
+
interface Letter {
|
|
48
|
+
el: HTMLElement | false;
|
|
49
|
+
content: string;
|
|
50
|
+
newLine: boolean;
|
|
51
|
+
whitespace: boolean;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The class splits text in an element into words, letters, and lines.
|
|
56
|
+
* This may be useful when animating the text.
|
|
57
|
+
*/
|
|
58
|
+
export declare class SplitText<StaticProp extends NSplitText.StaticProp = NSplitText.StaticProp, ChangeableProp extends NSplitText.ChangeableProp = NSplitText.ChangeableProp, CallbacksTypes extends NSplitText.CallbacksTypes = NSplitText.CallbacksTypes> extends Component<StaticProp, ChangeableProp, CallbacksTypes> {
|
|
59
|
+
protected _getDefaultProp(): DeepRequired<StaticProp & ChangeableProp> & {
|
|
60
|
+
container: string | Element;
|
|
61
|
+
append: {
|
|
62
|
+
letters: boolean;
|
|
63
|
+
words: boolean;
|
|
64
|
+
lines: boolean;
|
|
65
|
+
};
|
|
66
|
+
resizeTimeout: number;
|
|
67
|
+
};
|
|
68
|
+
protected _constructor(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Text container
|
|
71
|
+
*/
|
|
72
|
+
protected _container: Element | null;
|
|
73
|
+
/**
|
|
74
|
+
* Get text container
|
|
75
|
+
*/
|
|
76
|
+
get container(): Element;
|
|
77
|
+
/**
|
|
78
|
+
* innerHTML of the container
|
|
79
|
+
*/
|
|
80
|
+
protected _html: string;
|
|
81
|
+
/**
|
|
82
|
+
* textContent of the container
|
|
83
|
+
*/
|
|
84
|
+
protected _text: string | null;
|
|
85
|
+
/**
|
|
86
|
+
* Defines if the text is already split
|
|
87
|
+
*/
|
|
88
|
+
protected _isSplit: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Text letters
|
|
91
|
+
*/
|
|
92
|
+
protected _letters: NSplitText.Letter[];
|
|
93
|
+
/**
|
|
94
|
+
* Get text letters
|
|
95
|
+
*/
|
|
96
|
+
get letters(): NSplitText.Letter[];
|
|
97
|
+
/**
|
|
98
|
+
* Create split text
|
|
99
|
+
*/
|
|
100
|
+
protected _create(): void;
|
|
101
|
+
/**
|
|
102
|
+
* Set events
|
|
103
|
+
*/
|
|
104
|
+
protected _setEvents(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Resize the text
|
|
107
|
+
*/
|
|
108
|
+
protected _resize(): void;
|
|
109
|
+
/**
|
|
110
|
+
* Split the text
|
|
111
|
+
*/
|
|
112
|
+
split(): void;
|
|
113
|
+
/**
|
|
114
|
+
* Split text into words
|
|
115
|
+
*/
|
|
116
|
+
protected _splitToWords(text: string): void;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=SplitText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SplitText.d.ts","sourceRoot":"","sources":["../../../../src/ts/components/split-text/SplitText.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAG7D,OAAO,EAAmB,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI1E,yBAAiB,UAAU,CAAC;IAExB;;OAEG;IACH,UAAiB,UAAW,SAAQ,UAAU,CAAC,UAAU;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