vevet 5.2.0 → 5.2.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/lib/cdn/vevet.iife.min.js +29 -29
- package/lib/cjs/base/Callbacks/index.js +6 -3
- package/lib/cjs/base/Callbacks/index.js.map +1 -1
- package/lib/cjs/base/Module/index.js +12 -10
- package/lib/cjs/base/Module/index.js.map +1 -1
- package/lib/cjs/components/Canvas/index.js +2 -2
- package/lib/cjs/components/Canvas/index.js.map +1 -1
- package/lib/cjs/components/CanvasMedia/index.js +2 -2
- package/lib/cjs/components/CanvasMedia/index.js.map +1 -1
- package/lib/cjs/components/Cursor/index.js +2 -2
- package/lib/cjs/components/Cursor/index.js.map +1 -1
- package/lib/cjs/components/InView/index.js +2 -2
- package/lib/cjs/components/InView/index.js.map +1 -1
- package/lib/cjs/components/Marquee/index.js +2 -2
- package/lib/cjs/components/Marquee/index.js.map +1 -1
- package/lib/cjs/components/Pointers/index.js +2 -2
- package/lib/cjs/components/Pointers/index.js.map +1 -1
- package/lib/cjs/components/Preloader/index.js +2 -2
- package/lib/cjs/components/Preloader/index.js.map +1 -1
- package/lib/cjs/components/ProgressPreloader/index.js +2 -2
- package/lib/cjs/components/ProgressPreloader/index.js.map +1 -1
- package/lib/cjs/components/Raf/index.js +2 -2
- package/lib/cjs/components/Raf/index.js.map +1 -1
- package/lib/cjs/components/ScrollProgress/index.js +2 -2
- package/lib/cjs/components/ScrollProgress/index.js.map +1 -1
- package/lib/cjs/components/Scrollbar/index.js +2 -2
- package/lib/cjs/components/Scrollbar/index.js.map +1 -1
- package/lib/cjs/components/Snap/index.js +2 -2
- package/lib/cjs/components/Snap/index.js.map +1 -1
- package/lib/cjs/components/SplitText/index.js +2 -2
- package/lib/cjs/components/SplitText/index.js.map +1 -1
- package/lib/cjs/components/Swipe/index.js +5 -5
- package/lib/cjs/components/Swipe/index.js.map +1 -1
- package/lib/cjs/components/Timeline/index.js +2 -2
- package/lib/cjs/components/Timeline/index.js.map +1 -1
- package/lib/cjs/manifest.json +1 -1
- package/lib/esm/base/Callbacks/index.js +5 -3
- package/lib/esm/base/Callbacks/index.js.map +1 -1
- package/lib/esm/base/Module/index.js +10 -8
- package/lib/esm/base/Module/index.js.map +1 -1
- package/lib/esm/components/Canvas/index.js +2 -2
- package/lib/esm/components/Canvas/index.js.map +1 -1
- package/lib/esm/components/CanvasMedia/index.js +2 -2
- package/lib/esm/components/CanvasMedia/index.js.map +1 -1
- package/lib/esm/components/Cursor/index.js +2 -2
- package/lib/esm/components/Cursor/index.js.map +1 -1
- package/lib/esm/components/InView/index.js +2 -2
- package/lib/esm/components/InView/index.js.map +1 -1
- package/lib/esm/components/Marquee/index.js +2 -2
- package/lib/esm/components/Marquee/index.js.map +1 -1
- package/lib/esm/components/Pointers/index.js +2 -2
- package/lib/esm/components/Pointers/index.js.map +1 -1
- package/lib/esm/components/Preloader/index.js +2 -2
- package/lib/esm/components/Preloader/index.js.map +1 -1
- package/lib/esm/components/ProgressPreloader/index.js +2 -2
- package/lib/esm/components/ProgressPreloader/index.js.map +1 -1
- package/lib/esm/components/Raf/index.js +2 -2
- package/lib/esm/components/Raf/index.js.map +1 -1
- package/lib/esm/components/ScrollProgress/index.js +2 -2
- package/lib/esm/components/ScrollProgress/index.js.map +1 -1
- package/lib/esm/components/Scrollbar/index.js +2 -2
- package/lib/esm/components/Scrollbar/index.js.map +1 -1
- package/lib/esm/components/Snap/index.js +2 -2
- package/lib/esm/components/Snap/index.js.map +1 -1
- package/lib/esm/components/SplitText/index.js +2 -2
- package/lib/esm/components/SplitText/index.js.map +1 -1
- package/lib/esm/components/Swipe/index.js +5 -5
- package/lib/esm/components/Swipe/index.js.map +1 -1
- package/lib/esm/components/Timeline/index.js +2 -2
- package/lib/esm/components/Timeline/index.js.map +1 -1
- package/lib/esm/manifest.json +1 -1
- package/lib/types/base/Callbacks/index.d.ts +7 -5
- package/lib/types/base/Callbacks/index.d.ts.map +1 -1
- package/lib/types/base/Callbacks/types.d.ts +9 -5
- package/lib/types/base/Callbacks/types.d.ts.map +1 -1
- package/lib/types/base/Module/index.d.ts +5 -5
- package/lib/types/base/Module/index.d.ts.map +1 -1
- package/lib/types/base/Module/types.d.ts +3 -3
- package/lib/types/base/Module/types.d.ts.map +1 -1
- package/lib/types/base/Responsive/types.d.ts +2 -2
- package/lib/types/base/Responsive/types.d.ts.map +1 -1
- package/lib/types/components/Canvas/index.d.ts +5 -5
- package/lib/types/components/Canvas/index.d.ts.map +1 -1
- package/lib/types/components/CanvasMedia/index.d.ts +5 -5
- package/lib/types/components/CanvasMedia/index.d.ts.map +1 -1
- package/lib/types/components/Cursor/index.d.ts +5 -5
- package/lib/types/components/Cursor/index.d.ts.map +1 -1
- package/lib/types/components/InView/index.d.ts +5 -5
- package/lib/types/components/InView/index.d.ts.map +1 -1
- package/lib/types/components/InView/types.d.ts.map +1 -1
- package/lib/types/components/Marquee/index.d.ts +5 -5
- package/lib/types/components/Marquee/index.d.ts.map +1 -1
- package/lib/types/components/Pointers/index.d.ts +5 -5
- package/lib/types/components/Pointers/index.d.ts.map +1 -1
- package/lib/types/components/Preloader/index.d.ts +5 -5
- package/lib/types/components/Preloader/index.d.ts.map +1 -1
- package/lib/types/components/ProgressPreloader/index.d.ts +5 -5
- package/lib/types/components/ProgressPreloader/index.d.ts.map +1 -1
- package/lib/types/components/Raf/index.d.ts +5 -5
- package/lib/types/components/Raf/index.d.ts.map +1 -1
- package/lib/types/components/ScrollProgress/index.d.ts +5 -5
- package/lib/types/components/ScrollProgress/index.d.ts.map +1 -1
- package/lib/types/components/Scrollbar/index.d.ts +5 -5
- package/lib/types/components/Scrollbar/index.d.ts.map +1 -1
- package/lib/types/components/Snap/index.d.ts +5 -5
- package/lib/types/components/Snap/index.d.ts.map +1 -1
- package/lib/types/components/SplitText/index.d.ts +5 -5
- package/lib/types/components/SplitText/index.d.ts.map +1 -1
- package/lib/types/components/Swipe/index.d.ts +5 -5
- package/lib/types/components/Swipe/index.d.ts.map +1 -1
- package/lib/types/components/Swipe/types.d.ts +5 -0
- package/lib/types/components/Swipe/types.d.ts.map +1 -1
- package/lib/types/components/Timeline/index.d.ts +5 -5
- package/lib/types/components/Timeline/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/base/Callbacks/index.ts +15 -7
- package/src/base/Callbacks/types.ts +12 -7
- package/src/base/Module/index.ts +24 -15
- package/src/base/Module/types.ts +3 -3
- package/src/base/Responsive/types.ts +4 -5
- package/src/components/Canvas/index.ts +12 -11
- package/src/components/CanvasMedia/index.ts +12 -11
- package/src/components/Cursor/index.ts +12 -11
- package/src/components/InView/index.ts +12 -11
- package/src/components/InView/types.ts +2 -6
- package/src/components/Marquee/index.ts +12 -11
- package/src/components/Pointers/index.ts +12 -11
- package/src/components/Preloader/index.ts +12 -11
- package/src/components/ProgressPreloader/index.ts +12 -14
- package/src/components/Raf/index.ts +14 -13
- package/src/components/ScrollProgress/index.ts +12 -13
- package/src/components/Scrollbar/index.ts +12 -11
- package/src/components/Snap/index.ts +12 -11
- package/src/components/SplitText/index.ts +12 -11
- package/src/components/Swipe/index.ts +15 -13
- package/src/components/Swipe/types.ts +6 -0
- package/src/components/Timeline/index.ts +12 -11
- package/src/manifest.json +1 -1
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
IScrollProgressMutableProps,
|
|
5
5
|
IScrollProgressStaticProps,
|
|
6
6
|
} from './types';
|
|
7
|
-
import { Module,
|
|
7
|
+
import { Module, TModuleOnCallbacksProps } from '@/base';
|
|
8
8
|
import { TRequiredProps } from '@/internal/requiredProps';
|
|
9
9
|
import { initVevet } from '@/global/initVevet';
|
|
10
10
|
import { addEventListener, clampScope } from '@/utils';
|
|
@@ -22,25 +22,23 @@ export * from './types';
|
|
|
22
22
|
* @group Components
|
|
23
23
|
*/
|
|
24
24
|
export class ScrollProgress<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
IScrollProgressMutableProps = IScrollProgressMutableProps,
|
|
30
|
-
> extends Module<CallbacksMap, StaticProps, MutableProps> {
|
|
25
|
+
C extends IScrollProgressCallbacksMap = IScrollProgressCallbacksMap,
|
|
26
|
+
S extends IScrollProgressStaticProps = IScrollProgressStaticProps,
|
|
27
|
+
M extends IScrollProgressMutableProps = IScrollProgressMutableProps,
|
|
28
|
+
> extends Module<C, S, M> {
|
|
31
29
|
/** Retrieves the default static properties. */
|
|
32
|
-
public _getStatic(): TRequiredProps<
|
|
30
|
+
public _getStatic(): TRequiredProps<S> {
|
|
33
31
|
return {
|
|
34
32
|
...super._getStatic(),
|
|
35
33
|
root: null,
|
|
36
34
|
optimized: true,
|
|
37
35
|
useSvh: false,
|
|
38
|
-
} as TRequiredProps<
|
|
36
|
+
} as TRequiredProps<S>;
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
/** Retrieves the default mutable properties. */
|
|
42
|
-
public _getMutable(): TRequiredProps<
|
|
43
|
-
return { ...super._getMutable() } as TRequiredProps<
|
|
40
|
+
public _getMutable(): TRequiredProps<M> {
|
|
41
|
+
return { ...super._getMutable() } as TRequiredProps<M>;
|
|
44
42
|
}
|
|
45
43
|
|
|
46
44
|
/**
|
|
@@ -85,9 +83,10 @@ export class ScrollProgress<
|
|
|
85
83
|
}
|
|
86
84
|
|
|
87
85
|
constructor(
|
|
88
|
-
props?:
|
|
86
|
+
props?: S & M,
|
|
87
|
+
onCallbacks?: TModuleOnCallbacksProps<C, ScrollProgress<C, S, M>>,
|
|
89
88
|
) {
|
|
90
|
-
super(props);
|
|
89
|
+
super(props, onCallbacks as any);
|
|
91
90
|
|
|
92
91
|
this._isVisible = !this.props.optimized;
|
|
93
92
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TRequiredProps } from '@/internal/requiredProps';
|
|
2
|
-
import { Module,
|
|
2
|
+
import { Module, TModuleOnCallbacksProps } from '@/base';
|
|
3
3
|
import {
|
|
4
4
|
IScrollbarCallbacksMap,
|
|
5
5
|
IScrollbarMutableProps,
|
|
@@ -24,12 +24,12 @@ export * from './types';
|
|
|
24
24
|
* @group Components
|
|
25
25
|
*/
|
|
26
26
|
export class Scrollbar<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
> extends Module<
|
|
27
|
+
C extends IScrollbarCallbacksMap = IScrollbarCallbacksMap,
|
|
28
|
+
S extends IScrollbarStaticProps = IScrollbarStaticProps,
|
|
29
|
+
M extends IScrollbarMutableProps = IScrollbarMutableProps,
|
|
30
|
+
> extends Module<C, S, M> {
|
|
31
31
|
/** Get default static properties. */
|
|
32
|
-
public _getStatic(): TRequiredProps<
|
|
32
|
+
public _getStatic(): TRequiredProps<S> {
|
|
33
33
|
return {
|
|
34
34
|
...super._getStatic(),
|
|
35
35
|
container: window,
|
|
@@ -39,16 +39,16 @@ export class Scrollbar<
|
|
|
39
39
|
draggable: true,
|
|
40
40
|
autoHide: true,
|
|
41
41
|
resizeDebounce: 10,
|
|
42
|
-
} as TRequiredProps<
|
|
42
|
+
} as TRequiredProps<S>;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/** Get default mutable properties. */
|
|
46
|
-
public _getMutable(): TRequiredProps<
|
|
46
|
+
public _getMutable(): TRequiredProps<M> {
|
|
47
47
|
return {
|
|
48
48
|
...super._getMutable(),
|
|
49
49
|
minSize: 50,
|
|
50
50
|
autoSize: true,
|
|
51
|
-
} as TRequiredProps<
|
|
51
|
+
} as TRequiredProps<M>;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
get prefix() {
|
|
@@ -114,9 +114,10 @@ export class Scrollbar<
|
|
|
114
114
|
protected _isRtl = false;
|
|
115
115
|
|
|
116
116
|
constructor(
|
|
117
|
-
props?:
|
|
117
|
+
props?: S & M,
|
|
118
|
+
onCallbacks?: TModuleOnCallbacksProps<C, Scrollbar<C, S, M>>,
|
|
118
119
|
) {
|
|
119
|
-
super(props);
|
|
120
|
+
super(props, onCallbacks as any);
|
|
120
121
|
|
|
121
122
|
// detect features
|
|
122
123
|
this._isRtl = getTextDirection(this.parent) === 'rtl';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Module,
|
|
1
|
+
import { Module, TModuleOnCallbacksProps } from '@/base';
|
|
2
2
|
import { Timeline } from '../Timeline';
|
|
3
3
|
import {
|
|
4
4
|
ISnapCallbacksMap,
|
|
@@ -50,21 +50,21 @@ export * from './Slide';
|
|
|
50
50
|
* @group Components
|
|
51
51
|
*/
|
|
52
52
|
export class Snap<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
> extends Module<
|
|
53
|
+
C extends ISnapCallbacksMap = ISnapCallbacksMap,
|
|
54
|
+
S extends ISnapStaticProps = ISnapStaticProps,
|
|
55
|
+
M extends ISnapMutableProps = ISnapMutableProps,
|
|
56
|
+
> extends Module<C, S, M> {
|
|
57
57
|
/** Retrieves the default static properties. */
|
|
58
|
-
public _getStatic(): TRequiredProps<
|
|
58
|
+
public _getStatic(): TRequiredProps<S> {
|
|
59
59
|
return {
|
|
60
60
|
...super._getStatic(),
|
|
61
61
|
eventsEmitter: null,
|
|
62
62
|
activeIndex: 0,
|
|
63
|
-
} as TRequiredProps<
|
|
63
|
+
} as TRequiredProps<S>;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/** Retrieves the default mutable properties. */
|
|
67
|
-
public _getMutable(): TRequiredProps<
|
|
67
|
+
public _getMutable(): TRequiredProps<M> {
|
|
68
68
|
return {
|
|
69
69
|
...super._getMutable(),
|
|
70
70
|
slides: false,
|
|
@@ -100,7 +100,7 @@ export class Snap<
|
|
|
100
100
|
stickOnWheelEnd: true,
|
|
101
101
|
stickOnWheelEndThreshold: 30,
|
|
102
102
|
slideSize: 'auto',
|
|
103
|
-
} as TRequiredProps<
|
|
103
|
+
} as TRequiredProps<M>;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
/** Animation frame for smooth animations */
|
|
@@ -140,9 +140,10 @@ export class Snap<
|
|
|
140
140
|
protected _targetIndex?: number;
|
|
141
141
|
|
|
142
142
|
constructor(
|
|
143
|
-
props?:
|
|
143
|
+
props?: S & M,
|
|
144
|
+
onCallbacks?: TModuleOnCallbacksProps<C, Snap<C, S, M>>,
|
|
144
145
|
) {
|
|
145
|
-
super(props);
|
|
146
|
+
super(props, onCallbacks as any);
|
|
146
147
|
|
|
147
148
|
const { container, activeIndex } = this.props;
|
|
148
149
|
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
ISplitTextStaticProps,
|
|
10
10
|
ISplitTextWordMeta,
|
|
11
11
|
} from './types';
|
|
12
|
-
import { Module,
|
|
12
|
+
import { Module, TModuleOnCallbacksProps } from '@/base';
|
|
13
13
|
import { TRequiredProps } from '@/internal/requiredProps';
|
|
14
14
|
import { initVevet } from '@/global/initVevet';
|
|
15
15
|
import { saveInitialNodes } from './utils/saveInitialNodes';
|
|
@@ -33,14 +33,14 @@ export * from './types';
|
|
|
33
33
|
* @group Components
|
|
34
34
|
*/
|
|
35
35
|
export class SplitText<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
> extends Module<
|
|
36
|
+
C extends ISplitTextCallbacksMap = ISplitTextCallbacksMap,
|
|
37
|
+
S extends ISplitTextStaticProps = ISplitTextStaticProps,
|
|
38
|
+
M extends ISplitTextMutableProps = ISplitTextMutableProps,
|
|
39
|
+
> extends Module<C, S, M> {
|
|
40
40
|
/**
|
|
41
41
|
* Retrieves the default static properties.
|
|
42
42
|
*/
|
|
43
|
-
public _getStatic(): TRequiredProps<
|
|
43
|
+
public _getStatic(): TRequiredProps<S> {
|
|
44
44
|
return {
|
|
45
45
|
...super._getStatic(),
|
|
46
46
|
letters: false,
|
|
@@ -58,14 +58,14 @@ export class SplitText<
|
|
|
58
58
|
prepareText: (text) => text,
|
|
59
59
|
wordDelimiter: String.fromCharCode(32),
|
|
60
60
|
wordDelimiterOutput: null,
|
|
61
|
-
} as TRequiredProps<
|
|
61
|
+
} as TRequiredProps<S>;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* Retrieves the default mutable properties.
|
|
66
66
|
*/
|
|
67
|
-
public _getMutable(): TRequiredProps<
|
|
68
|
-
return { ...super._getMutable() } as TRequiredProps<
|
|
67
|
+
public _getMutable(): TRequiredProps<M> {
|
|
68
|
+
return { ...super._getMutable() } as TRequiredProps<M>;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/**
|
|
@@ -151,9 +151,10 @@ export class SplitText<
|
|
|
151
151
|
* Initializes the SplitText instance and saves the initial state.
|
|
152
152
|
*/
|
|
153
153
|
constructor(
|
|
154
|
-
props?:
|
|
154
|
+
props?: S & M,
|
|
155
|
+
onCallbacks?: TModuleOnCallbacksProps<C, SplitText<C, S, M>>,
|
|
155
156
|
) {
|
|
156
|
-
super(props);
|
|
157
|
+
super(props, onCallbacks as any);
|
|
157
158
|
|
|
158
159
|
const { container } = this.props;
|
|
159
160
|
const { style } = container;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Module,
|
|
1
|
+
import { Module, TModuleOnCallbacksProps } from '@/base';
|
|
2
2
|
import { TRequiredProps } from '@/internal/requiredProps';
|
|
3
3
|
import {
|
|
4
4
|
ISwipeCallbacksMap,
|
|
@@ -35,26 +35,27 @@ const VELOCITIES_COUNT = 4;
|
|
|
35
35
|
* @group Components
|
|
36
36
|
*/
|
|
37
37
|
export class Swipe<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
> extends Module<
|
|
38
|
+
C extends ISwipeCallbacksMap = ISwipeCallbacksMap,
|
|
39
|
+
S extends ISwipeStaticProps = ISwipeStaticProps,
|
|
40
|
+
M extends ISwipeMutableProps = ISwipeMutableProps,
|
|
41
|
+
> extends Module<C, S, M> {
|
|
42
42
|
/**
|
|
43
43
|
* Returns default static properties.
|
|
44
44
|
*/
|
|
45
|
-
public _getStatic(): TRequiredProps<
|
|
45
|
+
public _getStatic(): TRequiredProps<S> {
|
|
46
46
|
return {
|
|
47
47
|
...super._getStatic(),
|
|
48
|
+
thumb: null,
|
|
48
49
|
buttons: [0],
|
|
49
50
|
pointers: 1,
|
|
50
51
|
disableUserSelect: true,
|
|
51
|
-
} as TRequiredProps<
|
|
52
|
+
} as TRequiredProps<S>;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
/**
|
|
55
56
|
* Returns default mutable properties.
|
|
56
57
|
*/
|
|
57
|
-
public _getMutable(): TRequiredProps<
|
|
58
|
+
public _getMutable(): TRequiredProps<M> {
|
|
58
59
|
return {
|
|
59
60
|
...super._getMutable(),
|
|
60
61
|
enabled: true,
|
|
@@ -77,7 +78,7 @@ export class Swipe<
|
|
|
77
78
|
distanceModifier: false,
|
|
78
79
|
inertiaRatio: 1,
|
|
79
80
|
inertiaDistanceThreshold: 50,
|
|
80
|
-
} as TRequiredProps<
|
|
81
|
+
} as TRequiredProps<M>;
|
|
81
82
|
}
|
|
82
83
|
|
|
83
84
|
/** Pointer event manager */
|
|
@@ -128,11 +129,12 @@ export class Swipe<
|
|
|
128
129
|
protected _cursorStyles: HTMLStyleElement;
|
|
129
130
|
|
|
130
131
|
constructor(
|
|
131
|
-
props?:
|
|
132
|
+
props?: S & M,
|
|
133
|
+
onCallbacks?: TModuleOnCallbacksProps<C, Swipe<C, S, M>>,
|
|
132
134
|
) {
|
|
133
|
-
super(props);
|
|
135
|
+
super(props, onCallbacks as any);
|
|
134
136
|
|
|
135
|
-
const { container, buttons, pointers } = this.props;
|
|
137
|
+
const { container, thumb, buttons, pointers } = this.props;
|
|
136
138
|
|
|
137
139
|
// set default data
|
|
138
140
|
this._coords = {
|
|
@@ -151,7 +153,7 @@ export class Swipe<
|
|
|
151
153
|
|
|
152
154
|
// create pointers
|
|
153
155
|
this._pointers = new Pointers({
|
|
154
|
-
container,
|
|
156
|
+
container: thumb || container,
|
|
155
157
|
buttons,
|
|
156
158
|
minPointers: pointers,
|
|
157
159
|
maxPointers: pointers,
|
|
@@ -9,6 +9,12 @@ export interface ISwipeStaticProps extends IModuleStaticProps {
|
|
|
9
9
|
/** Event listener container. */
|
|
10
10
|
container: HTMLElement | SVGElement;
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* An element that triggers the swipe start.
|
|
14
|
+
* Calculations remain relative to the container regardless of this element.
|
|
15
|
+
*/
|
|
16
|
+
thumb?: HTMLElement | SVGElement | null;
|
|
17
|
+
|
|
12
18
|
/**
|
|
13
19
|
* Determines which mouse buttons trigger events.
|
|
14
20
|
* - 0: Main button pressed, usually the left button or the un-initialized state
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TRequiredProps } from '@/internal/requiredProps';
|
|
2
|
-
import { Module,
|
|
2
|
+
import { Module, TModuleOnCallbacksProps } from '@/base/Module';
|
|
3
3
|
import { clamp, easing } from '@/utils/math';
|
|
4
4
|
import {
|
|
5
5
|
ITimelineCallbacksMap,
|
|
@@ -21,22 +21,22 @@ export * from './types';
|
|
|
21
21
|
* @group Components
|
|
22
22
|
*/
|
|
23
23
|
export class Timeline<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
> extends Module<
|
|
24
|
+
C extends ITimelineCallbacksMap = ITimelineCallbacksMap,
|
|
25
|
+
S extends ITimelineStaticProps = ITimelineStaticProps,
|
|
26
|
+
M extends ITimelineMutableProps = ITimelineMutableProps,
|
|
27
|
+
> extends Module<C, S, M> {
|
|
28
28
|
/** Get default static properties. */
|
|
29
|
-
public _getStatic(): TRequiredProps<
|
|
30
|
-
return { ...super._getStatic() } as TRequiredProps<
|
|
29
|
+
public _getStatic(): TRequiredProps<S> {
|
|
30
|
+
return { ...super._getStatic() } as TRequiredProps<S>;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/** Get default mutable properties. */
|
|
34
|
-
public _getMutable(): TRequiredProps<
|
|
34
|
+
public _getMutable(): TRequiredProps<M> {
|
|
35
35
|
return {
|
|
36
36
|
...super._getMutable(),
|
|
37
37
|
easing: initVevet().props.easing,
|
|
38
38
|
duration: 1000,
|
|
39
|
-
} as TRequiredProps<
|
|
39
|
+
} as TRequiredProps<M>;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/** Current linear progress of the timeline (0 to 1). */
|
|
@@ -113,9 +113,10 @@ export class Timeline<
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
constructor(
|
|
116
|
-
props?:
|
|
116
|
+
props?: S & M,
|
|
117
|
+
onCallbacks?: TModuleOnCallbacksProps<C, Timeline<C, S, M>>,
|
|
117
118
|
) {
|
|
118
|
-
super(props);
|
|
119
|
+
super(props, onCallbacks as any);
|
|
119
120
|
|
|
120
121
|
// Initialize default values
|
|
121
122
|
this._progress = 0;
|
package/src/manifest.json
CHANGED