vevet 2.3.0 → 2.5.1
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/build/cdn/index.js +1 -1
- package/build/cjs/components/scroll/section/ScrollSectionProgress.js +261 -0
- package/build/cjs/index.js +5 -1
- package/build/cjs/utils/scroll/getScrollValues.js +20 -0
- package/build/cjs/utils/scroll/index.js +12 -0
- package/build/cjs/utils/scroll/scrollTo.js +41 -0
- package/build/cjs/utils/scroll/scrollToElement.js +39 -0
- package/build/cjs/utils/scroll/to.js +41 -0
- package/build/es/components/scroll/section/ScrollSectionProgress.js +181 -0
- package/build/es/index.js +4 -1
- package/build/es/utils/scroll/getScrollValues.js +16 -0
- package/build/es/utils/scroll/index.js +4 -0
- package/build/es/utils/scroll/scrollTo.js +34 -0
- package/build/es/utils/scroll/scrollToElement.js +32 -0
- package/build/es/utils/scroll/to.js +34 -0
- package/build/types/components/scroll/section/ScrollSectionProgress.d.ts +131 -0
- package/build/types/components/scroll/section/ScrollSectionProgress.d.ts.map +1 -0
- package/build/types/components/scroll/types.d.ts +2 -5
- package/build/types/components/scroll/types.d.ts.map +1 -1
- package/build/types/index.d.ts +4 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/utils/scroll/getScrollValues.d.ts +9 -0
- package/build/types/utils/scroll/getScrollValues.d.ts.map +1 -0
- package/build/types/utils/scroll/index.d.ts +5 -0
- package/build/types/utils/scroll/index.d.ts.map +1 -0
- package/build/types/utils/scroll/scrollTo.d.ts +28 -0
- package/build/types/utils/scroll/scrollTo.d.ts.map +1 -0
- package/build/types/utils/scroll/scrollToElement.d.ts +32 -0
- package/build/types/utils/scroll/scrollToElement.d.ts.map +1 -0
- package/build/types/utils/scroll/to.d.ts +28 -0
- package/build/types/utils/scroll/to.d.ts.map +1 -0
- package/build/types/utils/types/general.d.ts +6 -0
- package/build/types/utils/types/general.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ts/components/scroll/section/ScrollSectionProgress.ts +344 -0
- package/src/ts/components/scroll/types.ts +3 -5
- package/src/ts/index.ts +4 -0
- package/src/ts/utils/scroll/getScrollValues.ts +20 -0
- package/src/ts/utils/scroll/index.ts +9 -0
- package/src/ts/utils/scroll/scrollTo.ts +65 -0
- package/src/ts/utils/scroll/scrollToElement.ts +74 -0
- package/src/ts/utils/types/general.ts +7 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Timeline } from '../../components/timeline/Timeline';
|
|
2
|
+
import getScrollValues from './getScrollValues';
|
|
3
|
+
/**
|
|
4
|
+
* Scroll to coordinates
|
|
5
|
+
*/
|
|
6
|
+
export default function scrollTo({ container = window, top = 0, left = 0, duration = 250, }) {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
// save start values
|
|
9
|
+
const startValues = getScrollValues(container);
|
|
10
|
+
if (startValues) {
|
|
11
|
+
// create animation
|
|
12
|
+
const timeline = new Timeline({
|
|
13
|
+
duration,
|
|
14
|
+
});
|
|
15
|
+
timeline.addCallback('progress', (data) => {
|
|
16
|
+
if (container) {
|
|
17
|
+
container.scrollTo({
|
|
18
|
+
top: startValues.scrollTop
|
|
19
|
+
+ (top - startValues.scrollTop) * data.easing,
|
|
20
|
+
left: startValues.scrollLeft
|
|
21
|
+
+ (left - startValues.scrollLeft) * data.easing,
|
|
22
|
+
behavior: 'auto',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
timeline.addCallback('end', () => {
|
|
27
|
+
resolve();
|
|
28
|
+
});
|
|
29
|
+
timeline.play();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
reject();
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { selectOne } from 'vevet-dom';
|
|
2
|
+
import getScrollValues from './getScrollValues';
|
|
3
|
+
import clamp from '../math/clamp';
|
|
4
|
+
import scrollTo from './scrollTo';
|
|
5
|
+
/**
|
|
6
|
+
* Scroll to element
|
|
7
|
+
*/
|
|
8
|
+
export default function scrollToElement({ container = window, el, top = 0, left = 0, duration = 250, }) {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
const startValues = getScrollValues(container);
|
|
11
|
+
if (startValues) {
|
|
12
|
+
const element = selectOne(el);
|
|
13
|
+
if (element) {
|
|
14
|
+
const bounding = element.getBoundingClientRect();
|
|
15
|
+
const toTop = clamp(bounding.top + startValues.scrollTop - top, [0, Infinity]);
|
|
16
|
+
const toLeft = clamp(bounding.left + startValues.scrollLeft - left, [0, Infinity]);
|
|
17
|
+
scrollTo({
|
|
18
|
+
container,
|
|
19
|
+
top: toTop,
|
|
20
|
+
left: toLeft,
|
|
21
|
+
duration,
|
|
22
|
+
}).then(() => {
|
|
23
|
+
resolve();
|
|
24
|
+
}).catch(() => {
|
|
25
|
+
reject();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
reject();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Timeline } from '../../components/timeline/Timeline';
|
|
2
|
+
import getScrollValues from './getScrollValues';
|
|
3
|
+
/**
|
|
4
|
+
* Scroll to coordinates
|
|
5
|
+
*/
|
|
6
|
+
export default function scrollTo({ container = window, top = 0, left = 0, duration = 250, }) {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
// save start values
|
|
9
|
+
const startValues = getScrollValues(container);
|
|
10
|
+
if (startValues) {
|
|
11
|
+
// create animation
|
|
12
|
+
const timeline = new Timeline({
|
|
13
|
+
duration,
|
|
14
|
+
});
|
|
15
|
+
timeline.addCallback('progress', (data) => {
|
|
16
|
+
if (container) {
|
|
17
|
+
container.scrollTo({
|
|
18
|
+
top: startValues.scrollTop
|
|
19
|
+
+ (top - startValues.scrollTop) * data.easing,
|
|
20
|
+
left: startValues.scrollLeft
|
|
21
|
+
+ (left - startValues.scrollLeft) * data.easing,
|
|
22
|
+
behavior: 'auto',
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
timeline.addCallback('end', () => {
|
|
27
|
+
resolve();
|
|
28
|
+
});
|
|
29
|
+
timeline.play();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
reject();
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import PCancelable from 'p-cancelable';
|
|
2
|
+
import { IRemovable } from '../../../utils/types/general';
|
|
3
|
+
import { RequiredModuleProp } from '../../../utils/types/utility';
|
|
4
|
+
import { Component, NComponent } from '../../../base/Component';
|
|
5
|
+
import { NViewport } from '../../../app/events/Viewport';
|
|
6
|
+
import { SmoothScroll } from '../smooth-scroll/SmoothScroll';
|
|
7
|
+
import getScrollValues from '../../../utils/scroll/getScrollValues';
|
|
8
|
+
export declare namespace NScrollSectionProgress {
|
|
9
|
+
/**
|
|
10
|
+
* Static properties
|
|
11
|
+
*/
|
|
12
|
+
interface StaticProp extends NComponent.StaticProp {
|
|
13
|
+
/**
|
|
14
|
+
* The scrollable container
|
|
15
|
+
* @default window
|
|
16
|
+
*/
|
|
17
|
+
container?: string | Element | SmoothScroll | Window;
|
|
18
|
+
/**
|
|
19
|
+
* The scrollable element
|
|
20
|
+
*/
|
|
21
|
+
section: string | Element;
|
|
22
|
+
/**
|
|
23
|
+
* Update sizes on resize
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
viewportTarget?: keyof NViewport.CallbacksTypes;
|
|
27
|
+
/**
|
|
28
|
+
* @default 0
|
|
29
|
+
*/
|
|
30
|
+
resizeTimeout?: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Changeable properties
|
|
34
|
+
*/
|
|
35
|
+
interface ChangeableProp extends NComponent.ChangeableProp {
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Available callbacks
|
|
39
|
+
*/
|
|
40
|
+
interface CallbacksTypes extends NComponent.CallbacksTypes {
|
|
41
|
+
'render': false;
|
|
42
|
+
'resize': false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Elements into viewport
|
|
47
|
+
*/
|
|
48
|
+
export declare class ScrollSectionProgress<StaticProp extends NScrollSectionProgress.StaticProp = NScrollSectionProgress.StaticProp, ChangeableProp extends NScrollSectionProgress.ChangeableProp = NScrollSectionProgress.ChangeableProp, CallbacksTypes extends NScrollSectionProgress.CallbacksTypes = NScrollSectionProgress.CallbacksTypes> extends Component<StaticProp, ChangeableProp, CallbacksTypes> {
|
|
49
|
+
protected _getDefaultProp<T extends RequiredModuleProp<StaticProp & ChangeableProp>>(): T;
|
|
50
|
+
/**
|
|
51
|
+
* Scroll container
|
|
52
|
+
*/
|
|
53
|
+
protected _scrollContainer: Element | SmoothScroll | Window;
|
|
54
|
+
get scrollContainer(): Element | Window | SmoothScroll<import("../smooth-scroll/SmoothScroll").NSmoothScroll.StaticProp, import("../smooth-scroll/SmoothScroll").NSmoothScroll.ChangeableProp, import("../smooth-scroll/SmoothScroll").NSmoothScroll.CallbacksTypes>;
|
|
55
|
+
/**
|
|
56
|
+
* Section element
|
|
57
|
+
*/
|
|
58
|
+
protected _section: Element;
|
|
59
|
+
get section(): Element;
|
|
60
|
+
/**
|
|
61
|
+
* Scroll event
|
|
62
|
+
*/
|
|
63
|
+
protected _scrollEvent?: IRemovable;
|
|
64
|
+
/**
|
|
65
|
+
* Loaded event
|
|
66
|
+
*/
|
|
67
|
+
protected _loadedEvent?: PCancelable<any>;
|
|
68
|
+
/**
|
|
69
|
+
* Scrolling scope
|
|
70
|
+
*/
|
|
71
|
+
protected _scopeScroll: [number, number];
|
|
72
|
+
get scopeScroll(): [number, number];
|
|
73
|
+
/**
|
|
74
|
+
* 'In' scope relative to the global progress
|
|
75
|
+
*/
|
|
76
|
+
protected _scopeIn: [number, number];
|
|
77
|
+
protected get scopeIn(): [number, number];
|
|
78
|
+
/**
|
|
79
|
+
* 'Move' scope relative to the global progress
|
|
80
|
+
*/
|
|
81
|
+
protected _scopeMove: [number, number];
|
|
82
|
+
get scopeMove(): [number, number];
|
|
83
|
+
/**
|
|
84
|
+
* 'Move' scope relative to the global progress
|
|
85
|
+
*/
|
|
86
|
+
protected _scopeOut: [number, number];
|
|
87
|
+
get scopeOut(): [number, number];
|
|
88
|
+
protected _progress: number;
|
|
89
|
+
/**
|
|
90
|
+
* Global progress
|
|
91
|
+
*/
|
|
92
|
+
get progress(): number;
|
|
93
|
+
set progress(val: number);
|
|
94
|
+
constructor(initialProp?: (StaticProp & ChangeableProp), init?: boolean);
|
|
95
|
+
init(): void;
|
|
96
|
+
protected _setEvents(): void;
|
|
97
|
+
protected _onPropMutate(): void;
|
|
98
|
+
/**
|
|
99
|
+
* 'in' progress
|
|
100
|
+
*/
|
|
101
|
+
get progressIn(): number;
|
|
102
|
+
/**
|
|
103
|
+
* 'out' progress
|
|
104
|
+
*/
|
|
105
|
+
get progressOut(): number;
|
|
106
|
+
/**
|
|
107
|
+
* 'move' progress
|
|
108
|
+
*/
|
|
109
|
+
get progressMove(): number;
|
|
110
|
+
/**
|
|
111
|
+
* Handle scroll event
|
|
112
|
+
*/
|
|
113
|
+
protected _handleScroll(): void;
|
|
114
|
+
/**
|
|
115
|
+
* Resize the scene
|
|
116
|
+
*/
|
|
117
|
+
resize(): void;
|
|
118
|
+
/**
|
|
119
|
+
* Render the scene
|
|
120
|
+
*/
|
|
121
|
+
protected _render(scrollData: ReturnType<typeof getScrollValues>, force?: boolean): void;
|
|
122
|
+
/**
|
|
123
|
+
* Check if the section can be rendered
|
|
124
|
+
*/
|
|
125
|
+
protected _canRender(scrollData: ReturnType<typeof getScrollValues>, force?: boolean): boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Destroy the module
|
|
128
|
+
*/
|
|
129
|
+
protected _destroy(): void;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=ScrollSectionProgress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollSectionProgress.d.ts","sourceRoot":"","sources":["../../../../../src/ts/components/scroll/section/ScrollSectionProgress.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,eAAe,MAAM,uCAAuC,CAAC;AAIpE,yBAAiB,sBAAsB,CAAC;IAEpC;;OAEG;IACH,UAAiB,UAAW,SAAQ,UAAU,CAAC,UAAU;QACrD;;;WAGG;QACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,MAAM,CAAC;QACrD;;WAEG;QACH,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAC1B;;;WAGG;QACH,cAAc,CAAC,EAAE,MAAM,SAAS,CAAC,cAAc,CAAC;QAChD;;WAEG;QACH,aAAa,CAAC,EAAE,MAAM,CAAC;KAC1B;IAED;;OAEG;IACH,UAAiB,cAAe,SAAQ,UAAU,CAAC,cAAc;KAAI;IAErE;;OAEG;IACH,UAAiB,cAAe,SAAQ,UAAU,CAAC,cAAc;QAC7D,QAAQ,EAAE,KAAK,CAAC;QAChB,QAAQ,EAAE,KAAK,CAAC;KACnB;CAEJ;AAID;;GAEG;AACH,qBAAa,qBAAqB,CAC9B,UAAU,SAAS,sBAAsB,CAAC,UAAU,GAC9C,sBAAsB,CAAC,UAAU,EACvC,cAAc,SAAS,sBAAsB,CAAC,cAAc,GACtD,sBAAsB,CAAC,cAAc,EAC3C,cAAc,SAAS,sBAAsB,CAAC,cAAc,GACtD,sBAAsB,CAAC,c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;IAED;;OAEG;IACH,IAAI,YAAY,WAKf;IAID;;OAEG;IACH,SAAS,CAAC,aAAa;IAWvB;;OAEG;IACI,MAAM;IA6Bb;;OAEG;IACH,SAAS,CAAC,OAAO,CACb,UAAU,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,EAC9C,KAAK,UAAQ;IASjB;;OAEG;IACH,SAAS,CAAC,UAAU,CAChB,UAAU,EAAE,UAAU,CAAC,OAAO,eAAe,CAAC,EAC9C,KAAK,UAAQ;IAkBjB;;OAEG;IACH,SAAS,CAAC,QAAQ;CAKrB"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
scrollTo(options: ScrollToOptions): void;
|
|
4
|
-
scrollTo(x: number, y: number): void;
|
|
5
|
-
scrollLeft: number;
|
|
1
|
+
import { ScrollLike } from '../../utils/types/general';
|
|
2
|
+
export interface ScrollableElement extends ScrollLike {
|
|
6
3
|
scrollWidth: number;
|
|
7
4
|
scrollHeight: number;
|
|
8
5
|
clientWidth: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ts/components/scroll/types.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/ts/components/scroll/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACxB"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as common from './utils/common';
|
|
2
2
|
import * as listeners from './utils/listeners';
|
|
3
3
|
import * as math from './utils/math';
|
|
4
|
+
import * as scroll from './utils/scroll';
|
|
4
5
|
import * as GeneralTypes from './utils/types/general';
|
|
5
6
|
import { Application, NApplication } from './app/Application';
|
|
6
7
|
import { Viewport, NViewport } from './app/events/Viewport';
|
|
@@ -28,12 +29,14 @@ import { ScrollEventsBase, NScrollEventsBase } from './components/scroll/scrolla
|
|
|
28
29
|
import { ScrollView, NScrollView } from './components/scroll/scrollable/ScrollView';
|
|
29
30
|
import { SmoothScrollKeyboardPlugin, NSmoothScrollKeyboardPlugin } from './components/scroll/plugins/SmoothScrollKeyboardPlugin';
|
|
30
31
|
import { SmoothScrollDragPlugin, NSmoothScrollDragPlugin } from './components/scroll/plugins/SmoothScrollDragPlugin';
|
|
32
|
+
import { ScrollSectionProgress, NScrollSectionProgress } from './components/scroll/section/ScrollSectionProgress';
|
|
31
33
|
import { SplitText, NSplitText } from './components/text/SplitText';
|
|
32
34
|
import { CustomCursor, NCustomCursor } from './components/cursor/CustomCursor';
|
|
33
35
|
declare const utils: {
|
|
34
36
|
common: typeof common;
|
|
35
37
|
listeners: typeof listeners;
|
|
36
38
|
math: typeof math;
|
|
39
|
+
scroll: typeof scroll;
|
|
37
40
|
};
|
|
38
|
-
export { utils, GeneralTypes, Application, NApplication, Viewport, NViewport, PageLoad, NPageLoad, Callbacks, NCallbacks, MutableProp, NMutableProp, Module, NModule, Component, NComponent, Plugin, NPlugin, Page, NPage, WheelHandler, NWheelHandler, AnimationFrame, NAnimationFrame, StaticTimeline, NStaticTimeline, Timeline, NTimeline, Preloader, NPreloader, ProgressPreloader, NProgressPreloader, Dragger, NDragger, DraggerMove, NDraggerMove, DraggerDirection, NDraggerDirection, Ctx2D, NCtx2D, Ctx2DPrerender, NCtx2DPrerender, SmoothScroll, NSmoothScroll, ScrollBar, NScrollBar, ScrollEventsBase, NScrollEventsBase, ScrollView, NScrollView, SmoothScrollKeyboardPlugin, NSmoothScrollKeyboardPlugin, SmoothScrollDragPlugin, NSmoothScrollDragPlugin, SplitText, NSplitText, CustomCursor, NCustomCursor, };
|
|
41
|
+
export { utils, GeneralTypes, Application, NApplication, Viewport, NViewport, PageLoad, NPageLoad, Callbacks, NCallbacks, MutableProp, NMutableProp, Module, NModule, Component, NComponent, Plugin, NPlugin, Page, NPage, WheelHandler, NWheelHandler, AnimationFrame, NAnimationFrame, StaticTimeline, NStaticTimeline, Timeline, NTimeline, Preloader, NPreloader, ProgressPreloader, NProgressPreloader, Dragger, NDragger, DraggerMove, NDraggerMove, DraggerDirection, NDraggerDirection, Ctx2D, NCtx2D, Ctx2DPrerender, NCtx2DPrerender, SmoothScroll, NSmoothScroll, ScrollBar, NScrollBar, ScrollEventsBase, NScrollEventsBase, ScrollView, NScrollView, SmoothScrollKeyboardPlugin, NSmoothScrollKeyboardPlugin, SmoothScrollDragPlugin, NSmoothScrollDragPlugin, ScrollSectionProgress, NScrollSectionProgress, SplitText, NSplitText, CustomCursor, NCustomCursor, };
|
|
39
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AACzC,OAAO,KAAK,SAAS,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,IAAI,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAEzC,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,uBAAuB,C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E,uBAAuB,EAC/C,qBAAqB,EAAE,sBAAsB,EAE7C,SAAS,EAAE,UAAU,EAErB,YAAY,EAAE,aAAa,GAC9B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ScrollLike } from '../types/general';
|
|
2
|
+
/**
|
|
3
|
+
* Get scroll values of a certain element
|
|
4
|
+
*/
|
|
5
|
+
export default function getScrollValues(selector?: (Window | Element | ScrollLike | undefined)): {
|
|
6
|
+
scrollTop: number;
|
|
7
|
+
scrollLeft: number;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=getScrollValues.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getScrollValues.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/scroll/getScrollValues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACnC,QAAQ,GAAE,CAAC,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAU;;;EAajE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/scroll/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACH,SAAS,EACT,QAAQ,IAAI,EAAE,EACd,eAAe,IAAI,SAAS,GAC/B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ScrollLike } from '../types/general';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* @default window
|
|
5
|
+
*/
|
|
6
|
+
container?: Window | Element | ScrollLike;
|
|
7
|
+
/**
|
|
8
|
+
* top padding
|
|
9
|
+
* @default 0
|
|
10
|
+
*/
|
|
11
|
+
top?: number;
|
|
12
|
+
/**
|
|
13
|
+
* left padding
|
|
14
|
+
* @default 0
|
|
15
|
+
*/
|
|
16
|
+
left?: number;
|
|
17
|
+
/**
|
|
18
|
+
* scroll duration
|
|
19
|
+
* @default 250
|
|
20
|
+
*/
|
|
21
|
+
duration?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Scroll to coordinates
|
|
25
|
+
*/
|
|
26
|
+
export default function scrollTo({ container, top, left, duration, }: Props): Promise<void>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=scrollTo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrollTo.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/scroll/scrollTo.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,UAAU,KAAK;IACX;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IAC1C;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAE,EAC9B,SAAkB,EAClB,GAAO,EACP,IAAQ,EACR,QAAc,GACjB,EAAE,KAAK,iBA8BP"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ScrollLike } from '../types/general';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* @default window
|
|
5
|
+
*/
|
|
6
|
+
container?: Window | Element | ScrollLike;
|
|
7
|
+
/**
|
|
8
|
+
* The target element
|
|
9
|
+
*/
|
|
10
|
+
el: Element | string;
|
|
11
|
+
/**
|
|
12
|
+
* top padding
|
|
13
|
+
* @default 0
|
|
14
|
+
*/
|
|
15
|
+
top?: number;
|
|
16
|
+
/**
|
|
17
|
+
* left padding
|
|
18
|
+
* @default 0
|
|
19
|
+
*/
|
|
20
|
+
left?: number;
|
|
21
|
+
/**
|
|
22
|
+
* scroll duration
|
|
23
|
+
* @default 250
|
|
24
|
+
*/
|
|
25
|
+
duration?: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Scroll to element
|
|
29
|
+
*/
|
|
30
|
+
export default function scrollToElement({ container, el, top, left, duration, }: Props): Promise<void>;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=scrollToElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scrollToElement.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/scroll/scrollToElement.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAK9C,UAAU,KAAK;IACX;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IAC1C;;OAEG;IACH,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC;IACrB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAE,EACrC,SAAkB,EAClB,EAAE,EACF,GAAO,EACP,IAAQ,EACR,QAAc,GACjB,EAAE,KAAK,iBAgCP"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ScrollLike } from '../types/general';
|
|
2
|
+
interface Props {
|
|
3
|
+
/**
|
|
4
|
+
* @default window
|
|
5
|
+
*/
|
|
6
|
+
container?: Window | Element | ScrollLike;
|
|
7
|
+
/**
|
|
8
|
+
* top padding
|
|
9
|
+
* @default 0
|
|
10
|
+
*/
|
|
11
|
+
top?: number;
|
|
12
|
+
/**
|
|
13
|
+
* left padding
|
|
14
|
+
* @default 0
|
|
15
|
+
*/
|
|
16
|
+
left?: number;
|
|
17
|
+
/**
|
|
18
|
+
* scroll duration
|
|
19
|
+
* @default 250
|
|
20
|
+
*/
|
|
21
|
+
duration?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Scroll to coordinates
|
|
25
|
+
*/
|
|
26
|
+
export default function scrollTo({ container, top, left, duration, }: Props): Promise<void>;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=to.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/scroll/to.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,UAAU,KAAK;IACX;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IAC1C;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAE,EAC9B,SAAkB,EAClB,GAAO,EACP,IAAQ,EACR,QAAc,GACjB,EAAE,KAAK,iBA8BP"}
|
|
@@ -4,4 +4,10 @@ export interface IRemovable {
|
|
|
4
4
|
export interface IDestroyable {
|
|
5
5
|
destroy: () => void;
|
|
6
6
|
}
|
|
7
|
+
export interface ScrollLike {
|
|
8
|
+
scrollTop: number;
|
|
9
|
+
scrollLeft: number;
|
|
10
|
+
scrollTo(options: ScrollToOptions): void;
|
|
11
|
+
scrollTo(x: number, y: number): void;
|
|
12
|
+
}
|
|
7
13
|
//# sourceMappingURL=general.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/types/general.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB"}
|
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../../src/ts/utils/types/general.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACvB,MAAM,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IACzC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC"}
|