@studiometa/js-toolkit 2.4.4-alpha.2 → 2.4.4-alpha.5
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/Base/index.cjs +2 -2
- package/Base/index.d.ts +76 -216
- package/Base/index.js +1 -1
- package/Base/managers/AbstractManager.d.ts +2 -2
- package/Base/managers/ChildrenManager.cjs +2 -4
- package/Base/managers/ChildrenManager.d.ts +2 -10
- package/Base/managers/ChildrenManager.js +1 -3
- package/Base/managers/EventsManager.cjs +3 -3
- package/Base/managers/EventsManager.d.ts +9 -15
- package/Base/managers/EventsManager.js +2 -2
- package/Base/managers/OptionsManager.d.ts +1 -1
- package/Base/managers/ServicesManager.d.ts +1 -1
- package/Base/utils.cjs +1 -1
- package/Base/utils.d.ts +5 -21
- package/decorators/index.cjs +4 -2
- package/decorators/index.d.ts +2 -1
- package/decorators/index.js +3 -2
- package/decorators/withBreakpointManager.cjs +3 -2
- package/decorators/withBreakpointManager.d.ts +2 -84
- package/decorators/withBreakpointManager.js +3 -2
- package/decorators/withBreakpointObserver.cjs +6 -4
- package/decorators/withBreakpointObserver.d.ts +76 -49
- package/decorators/withBreakpointObserver.js +6 -4
- package/decorators/withDrag.cjs +5 -4
- package/decorators/withDrag.d.ts +63 -49
- package/decorators/withDrag.js +5 -4
- package/decorators/withExtraConfig.cjs +4 -3
- package/decorators/withExtraConfig.d.ts +63 -48
- package/decorators/withExtraConfig.js +4 -3
- package/decorators/withFreezedOptions.cjs +3 -2
- package/decorators/withFreezedOptions.d.ts +71 -47
- package/decorators/withFreezedOptions.js +3 -2
- package/decorators/withIntersectionObserver.cjs +6 -4
- package/decorators/withIntersectionObserver.d.ts +67 -48
- package/decorators/withIntersectionObserver.js +6 -4
- package/decorators/withMountWhenInView.cjs +10 -5
- package/decorators/withMountWhenInView.d.ts +76 -49
- package/decorators/withMountWhenInView.js +10 -5
- package/decorators/withResponsiveOptions.cjs +3 -2
- package/decorators/withResponsiveOptions.d.ts +68 -48
- package/decorators/withResponsiveOptions.js +3 -2
- package/decorators/withScrolledInView.cjs +12 -7
- package/decorators/withScrolledInView.d.ts +224 -80
- package/decorators/withScrolledInView.js +12 -7
- package/decorators/withType.cjs +28 -0
- package/decorators/withType.d.ts +5 -0
- package/decorators/withType.js +6 -0
- package/decorators/withVue2.cjs +7 -4
- package/decorators/withVue2.d.ts +64 -48
- package/decorators/withVue2.js +7 -4
- package/helpers/createApp.cjs +1 -1
- package/helpers/createApp.d.ts +2 -10
- package/helpers/getDirectChildren.cjs +5 -5
- package/helpers/getDirectChildren.d.ts +3 -13
- package/helpers/getDirectChildren.js +4 -4
- package/helpers/getInstanceFromElement.cjs +3 -4
- package/helpers/getInstanceFromElement.d.ts +2 -11
- package/helpers/getInstanceFromElement.js +2 -3
- package/helpers/importOnInteraction.cjs +1 -1
- package/helpers/importOnInteraction.d.ts +4 -9
- package/helpers/importWhenIdle.cjs +3 -5
- package/helpers/importWhenIdle.d.ts +7 -10
- package/helpers/importWhenIdle.js +2 -4
- package/helpers/importWhenVisible.cjs +1 -1
- package/helpers/importWhenVisible.d.ts +2 -7
- package/helpers/index.cjs +1 -1
- package/helpers/index.d.ts +6 -6
- package/helpers/utils.cjs +1 -1
- package/helpers/utils.d.ts +1 -1
- package/index.cjs +2 -8
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { BaseTypeParameter, BaseConstructor, BaseConfig } from '../Base/index.js';
|
|
2
|
-
|
|
1
|
+
import type { Base, BaseTypeParameter, BaseConstructor, BaseConfig } from '../Base/index.js';
|
|
2
|
+
import type { RafServiceProps, ScrollServiceProps, ResizeServiceProps } from '../services/index.js';
|
|
3
|
+
export declare type ScrollInViewProps = {
|
|
3
4
|
start: {
|
|
4
5
|
x: number;
|
|
5
6
|
y: number;
|
|
@@ -31,148 +32,207 @@ declare type withScrolledInViewOptions = IntersectionObserverInit & {
|
|
|
31
32
|
/**
|
|
32
33
|
* Add scrolled in view capabilities to a component.
|
|
33
34
|
*/
|
|
34
|
-
export
|
|
35
|
-
new
|
|
35
|
+
export declare function withScrolledInView<S extends BaseConstructor<Base>, T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: S, options?: withScrolledInViewOptions): {
|
|
36
|
+
new (...args: any[]): {
|
|
36
37
|
__props: ScrollInViewProps;
|
|
37
38
|
/**
|
|
38
39
|
* Factor used for the `dampedProgress` props.
|
|
39
40
|
*/
|
|
40
|
-
dampFactor: number;
|
|
41
|
+
readonly dampFactor: number;
|
|
41
42
|
/**
|
|
42
43
|
* Precision for the `dampedProgress` props.
|
|
43
44
|
*/
|
|
44
|
-
dampPrecision: number;
|
|
45
|
+
readonly dampPrecision: number;
|
|
45
46
|
/**
|
|
46
47
|
* Mounted hook.
|
|
47
|
-
*
|
|
48
|
-
* @returns {void}
|
|
49
48
|
*/
|
|
50
49
|
mounted(): void;
|
|
51
50
|
/**
|
|
52
51
|
* Resized hook.
|
|
53
|
-
*
|
|
54
|
-
* @param {import('../services/resize').ResizeServiceProps} props
|
|
55
|
-
* @returns {void}
|
|
56
52
|
*/
|
|
57
|
-
resized(props:
|
|
53
|
+
resized(props: ResizeServiceProps): void;
|
|
58
54
|
/**
|
|
59
55
|
* Scrolled hook.
|
|
60
|
-
*
|
|
61
|
-
* @param {import('../services/scroll').ScrollServiceProps} props
|
|
62
|
-
* @returns {void}
|
|
63
56
|
*/
|
|
64
|
-
scrolled(props:
|
|
57
|
+
scrolled(props: ScrollServiceProps): void;
|
|
65
58
|
/**
|
|
66
59
|
* Ticked hook.
|
|
67
|
-
*
|
|
68
|
-
* @param {import('../services/raf').RafServiceProps} props
|
|
69
|
-
* @returns {void}
|
|
70
60
|
*/
|
|
71
|
-
ticked(props:
|
|
61
|
+
ticked(props: RafServiceProps): void;
|
|
72
62
|
/**
|
|
73
63
|
* Destroyed hook.
|
|
74
|
-
*
|
|
75
|
-
* @returns {void}
|
|
76
64
|
*/
|
|
77
65
|
destroyed(): void;
|
|
78
66
|
/**
|
|
79
67
|
* Set the decorator props.
|
|
80
|
-
*
|
|
81
|
-
* @returns {void}
|
|
82
68
|
*/
|
|
83
69
|
__setProps(): void;
|
|
84
70
|
__isVisible: boolean;
|
|
85
71
|
__observer: IntersectionObserver;
|
|
86
|
-
$mount()
|
|
87
|
-
$parent:
|
|
88
|
-
$el: HTMLElement;
|
|
89
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
90
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
91
|
-
$children: {
|
|
92
|
-
[name: string]: import("../Base/index.js").default<any> | Promise<import("../Base/index.js").default<any>>;
|
|
93
|
-
};
|
|
94
|
-
}>;
|
|
72
|
+
$mount: (() => any) & (() => any);
|
|
73
|
+
$parent: Base<BaseTypeParameter>;
|
|
95
74
|
$id: string;
|
|
96
|
-
$el:
|
|
75
|
+
$el: HTMLElement & {
|
|
76
|
+
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
77
|
+
} & (T & {
|
|
97
78
|
$options: {
|
|
98
79
|
intersectionObserver: IntersectionObserverInit;
|
|
99
80
|
};
|
|
100
|
-
}
|
|
101
|
-
__base__?: WeakMap<typeof import("../Base/index.js").default, import("../Base/index.js").default<{
|
|
102
|
-
$el: HTMLElement;
|
|
103
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
104
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
105
|
-
$children: {
|
|
106
|
-
[name: string]: import("../Base/index.js").default<any> | Promise<import("../Base/index.js").default<any>>;
|
|
107
|
-
};
|
|
108
|
-
}> | "terminated">;
|
|
109
|
-
};
|
|
81
|
+
})["$el"];
|
|
110
82
|
$isMounted: boolean;
|
|
111
83
|
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
112
|
-
readonly $root:
|
|
113
|
-
$el: HTMLElement;
|
|
114
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
115
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
116
|
-
$children: {
|
|
117
|
-
[name: string]: import("../Base/index.js").default<any> | Promise<import("../Base/index.js").default<any>>;
|
|
118
|
-
};
|
|
119
|
-
}>;
|
|
84
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
120
85
|
readonly __config: BaseConfig;
|
|
121
86
|
__services: import("../Base/managers/ServicesManager.js").default;
|
|
122
87
|
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
123
|
-
__refs: import("../Base/managers/RefsManager.js").default & ({
|
|
88
|
+
__refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs & (T & {
|
|
124
89
|
$options: {
|
|
125
90
|
intersectionObserver: IntersectionObserverInit;
|
|
126
91
|
};
|
|
127
|
-
}
|
|
128
|
-
readonly $refs: import("../Base/managers/RefsManager.js").default & ({
|
|
92
|
+
})["$refs"];
|
|
93
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs & (T & {
|
|
94
|
+
$options: {
|
|
95
|
+
intersectionObserver: IntersectionObserverInit;
|
|
96
|
+
};
|
|
97
|
+
})["$refs"];
|
|
98
|
+
__options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions & (T & {
|
|
99
|
+
$options: {
|
|
100
|
+
intersectionObserver: IntersectionObserverInit;
|
|
101
|
+
};
|
|
102
|
+
})["$options"];
|
|
103
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions & (T & {
|
|
104
|
+
$options: {
|
|
105
|
+
intersectionObserver: IntersectionObserverInit;
|
|
106
|
+
};
|
|
107
|
+
})["$options"];
|
|
108
|
+
__children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren & (T & {
|
|
109
|
+
$options: {
|
|
110
|
+
intersectionObserver: IntersectionObserverInit;
|
|
111
|
+
};
|
|
112
|
+
})["$children"];
|
|
113
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren & (T & {
|
|
114
|
+
$options: {
|
|
115
|
+
intersectionObserver: IntersectionObserverInit;
|
|
116
|
+
};
|
|
117
|
+
})["$children"];
|
|
118
|
+
__events: import("../Base/managers/EventsManager.js").default;
|
|
119
|
+
readonly $log: (...args: unknown[]) => void;
|
|
120
|
+
readonly __debug: (...args: unknown[]) => void;
|
|
121
|
+
readonly __managers: import("../Base/index.js").Managers;
|
|
122
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
123
|
+
__hasEvent(event: string): boolean;
|
|
124
|
+
$update(): any;
|
|
125
|
+
$destroy(): any;
|
|
126
|
+
$terminate(): void;
|
|
127
|
+
__addEmits(event: string): void;
|
|
128
|
+
__removeEmits(event: string): void;
|
|
129
|
+
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
130
|
+
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
131
|
+
$off: ((event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions) => void) & ((event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions) => void);
|
|
132
|
+
$emit: ((event: string, ...args: unknown[]) => void) & ((event: string, ...args: unknown[]) => void);
|
|
133
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
134
|
+
dispatchEvent(event: Event): boolean;
|
|
135
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
136
|
+
};
|
|
137
|
+
prototype: Base<BaseTypeParameter>;
|
|
138
|
+
} & Pick<typeof Base, "prototype" | "$isBase" | "config" | "$factory"> & Pick<{
|
|
139
|
+
new (element: HTMLElement): {
|
|
140
|
+
__props: ScrollInViewProps;
|
|
141
|
+
/**
|
|
142
|
+
* Factor used for the `dampedProgress` props.
|
|
143
|
+
*/
|
|
144
|
+
readonly dampFactor: number;
|
|
145
|
+
/**
|
|
146
|
+
* Precision for the `dampedProgress` props.
|
|
147
|
+
*/
|
|
148
|
+
readonly dampPrecision: number;
|
|
149
|
+
/**
|
|
150
|
+
* Mounted hook.
|
|
151
|
+
*/
|
|
152
|
+
mounted(): void;
|
|
153
|
+
/**
|
|
154
|
+
* Resized hook.
|
|
155
|
+
*/
|
|
156
|
+
resized(props: ResizeServiceProps): void;
|
|
157
|
+
/**
|
|
158
|
+
* Scrolled hook.
|
|
159
|
+
*/
|
|
160
|
+
scrolled(props: ScrollServiceProps): void;
|
|
161
|
+
/**
|
|
162
|
+
* Ticked hook.
|
|
163
|
+
*/
|
|
164
|
+
ticked(props: RafServiceProps): void;
|
|
165
|
+
/**
|
|
166
|
+
* Destroyed hook.
|
|
167
|
+
*/
|
|
168
|
+
destroyed(): void;
|
|
169
|
+
/**
|
|
170
|
+
* Set the decorator props.
|
|
171
|
+
*/
|
|
172
|
+
__setProps(): void;
|
|
173
|
+
__isVisible: boolean;
|
|
174
|
+
__observer: IntersectionObserver;
|
|
175
|
+
$mount: (() => any) & (() => any);
|
|
176
|
+
$parent: Base<BaseTypeParameter>;
|
|
177
|
+
$id: string;
|
|
178
|
+
$el: HTMLElement & {
|
|
179
|
+
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
180
|
+
} & (T & {
|
|
129
181
|
$options: {
|
|
130
182
|
intersectionObserver: IntersectionObserverInit;
|
|
131
183
|
};
|
|
132
|
-
}
|
|
133
|
-
|
|
184
|
+
})["$el"];
|
|
185
|
+
$isMounted: boolean;
|
|
186
|
+
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
187
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
188
|
+
readonly __config: BaseConfig;
|
|
189
|
+
__services: import("../Base/managers/ServicesManager.js").default;
|
|
190
|
+
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
191
|
+
__refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs & (T & {
|
|
134
192
|
$options: {
|
|
135
193
|
intersectionObserver: IntersectionObserverInit;
|
|
136
194
|
};
|
|
137
|
-
}
|
|
138
|
-
readonly $
|
|
195
|
+
})["$refs"];
|
|
196
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs & (T & {
|
|
139
197
|
$options: {
|
|
140
198
|
intersectionObserver: IntersectionObserverInit;
|
|
141
199
|
};
|
|
142
|
-
}
|
|
143
|
-
|
|
200
|
+
})["$refs"];
|
|
201
|
+
__options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions & (T & {
|
|
144
202
|
$options: {
|
|
145
203
|
intersectionObserver: IntersectionObserverInit;
|
|
146
204
|
};
|
|
147
|
-
}
|
|
205
|
+
})["$options"];
|
|
206
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions & (T & {
|
|
148
207
|
$options: {
|
|
149
208
|
intersectionObserver: IntersectionObserverInit;
|
|
150
209
|
};
|
|
151
|
-
}
|
|
152
|
-
|
|
210
|
+
})["$options"];
|
|
211
|
+
__children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren & (T & {
|
|
153
212
|
$options: {
|
|
154
213
|
intersectionObserver: IntersectionObserverInit;
|
|
155
214
|
};
|
|
156
|
-
}
|
|
215
|
+
})["$children"];
|
|
216
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren & (T & {
|
|
157
217
|
$options: {
|
|
158
218
|
intersectionObserver: IntersectionObserverInit;
|
|
159
219
|
};
|
|
160
|
-
}
|
|
220
|
+
})["$children"];
|
|
161
221
|
__events: import("../Base/managers/EventsManager.js").default;
|
|
162
|
-
readonly $log: (...args:
|
|
163
|
-
readonly __debug: (...args:
|
|
222
|
+
readonly $log: (...args: unknown[]) => void;
|
|
223
|
+
readonly __debug: (...args: unknown[]) => void;
|
|
164
224
|
readonly __managers: import("../Base/index.js").Managers;
|
|
165
|
-
__callMethod(method: string, ...args:
|
|
225
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
166
226
|
__hasEvent(event: string): boolean;
|
|
167
227
|
$update(): any;
|
|
168
228
|
$destroy(): any;
|
|
169
229
|
$terminate(): void;
|
|
170
230
|
__addEmits(event: string): void;
|
|
171
231
|
__removeEmits(event: string): void;
|
|
172
|
-
readonly __ctor:
|
|
232
|
+
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
173
233
|
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
174
|
-
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
175
|
-
$emit(event: string, ...args:
|
|
234
|
+
$off: ((event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions) => void) & ((event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions) => void);
|
|
235
|
+
$emit: ((event: string, ...args: unknown[]) => void) & ((event: string, ...args: unknown[]) => void);
|
|
176
236
|
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
177
237
|
dispatchEvent(event: Event): boolean;
|
|
178
238
|
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
@@ -181,14 +241,98 @@ export default function withScrolledInView<T extends BaseTypeParameter = BaseTyp
|
|
|
181
241
|
* Config.
|
|
182
242
|
*/
|
|
183
243
|
config: BaseConfig;
|
|
184
|
-
readonly $isBase:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
244
|
+
readonly $isBase: true & ({
|
|
245
|
+
new (element: HTMLElement): {
|
|
246
|
+
__isVisible: boolean;
|
|
247
|
+
__observer: IntersectionObserver;
|
|
248
|
+
$mount(): any;
|
|
249
|
+
$parent: Base<BaseTypeParameter>;
|
|
250
|
+
$id: string;
|
|
251
|
+
$el: HTMLElement & {
|
|
252
|
+
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
253
|
+
};
|
|
254
|
+
$isMounted: boolean;
|
|
255
|
+
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
256
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
257
|
+
readonly __config: BaseConfig;
|
|
258
|
+
__services: import("../Base/managers/ServicesManager.js").default;
|
|
259
|
+
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
260
|
+
__refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
261
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
262
|
+
__options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
263
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
264
|
+
__children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
265
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
266
|
+
__events: import("../Base/managers/EventsManager.js").default;
|
|
267
|
+
readonly $log: (...args: unknown[]) => void;
|
|
268
|
+
readonly __debug: (...args: unknown[]) => void;
|
|
269
|
+
readonly __managers: import("../Base/index.js").Managers;
|
|
270
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
271
|
+
__hasEvent(event: string): boolean;
|
|
272
|
+
$update(): any;
|
|
273
|
+
$destroy(): any;
|
|
274
|
+
$terminate(): void;
|
|
275
|
+
__addEmits(event: string): void;
|
|
276
|
+
__removeEmits(event: string): void;
|
|
277
|
+
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
278
|
+
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
279
|
+
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
280
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
281
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
282
|
+
dispatchEvent(event: Event): boolean;
|
|
283
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
284
|
+
};
|
|
285
|
+
config: BaseConfig;
|
|
286
|
+
readonly $isBase: true;
|
|
287
|
+
$factory: typeof Base.$factory;
|
|
288
|
+
} & S)["$isBase"];
|
|
289
|
+
$factory: typeof Base.$factory & ({
|
|
290
|
+
new (element: HTMLElement): {
|
|
291
|
+
__isVisible: boolean;
|
|
292
|
+
__observer: IntersectionObserver;
|
|
293
|
+
$mount(): any;
|
|
294
|
+
$parent: Base<BaseTypeParameter>;
|
|
295
|
+
$id: string;
|
|
296
|
+
$el: HTMLElement & {
|
|
297
|
+
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
298
|
+
};
|
|
299
|
+
$isMounted: boolean;
|
|
300
|
+
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
301
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
302
|
+
readonly __config: BaseConfig;
|
|
303
|
+
__services: import("../Base/managers/ServicesManager.js").default;
|
|
304
|
+
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
305
|
+
__refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
306
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
307
|
+
__options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
308
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
309
|
+
__children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
310
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
311
|
+
__events: import("../Base/managers/EventsManager.js").default;
|
|
312
|
+
readonly $log: (...args: unknown[]) => void;
|
|
313
|
+
readonly __debug: (...args: unknown[]) => void;
|
|
314
|
+
readonly __managers: import("../Base/index.js").Managers;
|
|
315
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
316
|
+
__hasEvent(event: string): boolean;
|
|
317
|
+
$update(): any;
|
|
318
|
+
$destroy(): any;
|
|
319
|
+
$terminate(): void;
|
|
320
|
+
__addEmits(event: string): void;
|
|
321
|
+
__removeEmits(event: string): void;
|
|
322
|
+
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
323
|
+
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
324
|
+
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
325
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
326
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
327
|
+
dispatchEvent(event: Event): boolean;
|
|
328
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
191
329
|
};
|
|
192
|
-
|
|
330
|
+
config: BaseConfig;
|
|
331
|
+
readonly $isBase: true;
|
|
332
|
+
$factory: typeof Base.$factory;
|
|
333
|
+
} & S)["$factory"];
|
|
334
|
+
} & S, "prototype" | "$isBase" | "config" | "$factory" | keyof S> & S & {
|
|
335
|
+
new (...args: any[]): Base<T>;
|
|
336
|
+
prototype: Base<BaseTypeParameter>;
|
|
193
337
|
};
|
|
194
338
|
export {};
|
|
@@ -27,9 +27,8 @@ function updateProps(props, dampFactor, dampPrecision, axis = "x") {
|
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
29
|
function withScrolledInView(BaseClass, options = {}) {
|
|
30
|
-
var _a;
|
|
31
30
|
const WithMountWhenInView = withMountWhenInView(BaseClass, options);
|
|
32
|
-
|
|
31
|
+
class WithScrolledInView extends WithMountWhenInView {
|
|
33
32
|
constructor(element) {
|
|
34
33
|
super(element);
|
|
35
34
|
__publicField(this, "__props", {
|
|
@@ -58,8 +57,6 @@ function withScrolledInView(BaseClass, options = {}) {
|
|
|
58
57
|
y: 0
|
|
59
58
|
}
|
|
60
59
|
});
|
|
61
|
-
__publicField(this, "dampFactor", 0.1);
|
|
62
|
-
__publicField(this, "dampPrecision", 1e-3);
|
|
63
60
|
const render = () => {
|
|
64
61
|
scheduler.update(() => {
|
|
65
62
|
const renderFn = this.__callMethod("scrolledInView", this.__props);
|
|
@@ -110,6 +107,12 @@ function withScrolledInView(BaseClass, options = {}) {
|
|
|
110
107
|
render();
|
|
111
108
|
});
|
|
112
109
|
}
|
|
110
|
+
get dampFactor() {
|
|
111
|
+
return 0.1;
|
|
112
|
+
}
|
|
113
|
+
get dampPrecision() {
|
|
114
|
+
return 1e-3;
|
|
115
|
+
}
|
|
113
116
|
mounted() {
|
|
114
117
|
if (isFunction(super.mounted)) {
|
|
115
118
|
super.mounted();
|
|
@@ -172,11 +175,13 @@ function withScrolledInView(BaseClass, options = {}) {
|
|
|
172
175
|
(this.__props.dampedCurrent.y - yStart) / (yEnd - yStart)
|
|
173
176
|
);
|
|
174
177
|
}
|
|
175
|
-
}
|
|
178
|
+
}
|
|
179
|
+
__publicField(WithScrolledInView, "config", {
|
|
176
180
|
name: `${BaseClass.config.name}WithMountWhenInView`,
|
|
177
181
|
emits: ["scrolledInView"]
|
|
178
|
-
})
|
|
182
|
+
});
|
|
183
|
+
return WithScrolledInView;
|
|
179
184
|
}
|
|
180
185
|
export {
|
|
181
|
-
withScrolledInView
|
|
186
|
+
withScrolledInView
|
|
182
187
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// packages/js-toolkit/decorators/withType.ts
|
|
20
|
+
var withType_exports = {};
|
|
21
|
+
__export(withType_exports, {
|
|
22
|
+
default: () => withType
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(withType_exports);
|
|
25
|
+
function withType(BaseClass) {
|
|
26
|
+
return BaseClass;
|
|
27
|
+
}
|
|
28
|
+
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Base, BaseTypeParameter, BaseConstructor } from '../Base/index.js';
|
|
2
|
+
export default function withType<T extends BaseConstructor<Base>, U extends BaseTypeParameter = BaseTypeParameter>(BaseClass: T): T & {
|
|
3
|
+
new (...args: any[]): Base<U>;
|
|
4
|
+
prototype: Base<BaseTypeParameter>;
|
|
5
|
+
} & Pick<typeof Base, "prototype" | "$isBase" | "config" | "$factory">;
|
package/decorators/withVue2.cjs
CHANGED
|
@@ -29,8 +29,8 @@ __export(withVue2_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(withVue2_exports);
|
|
30
30
|
var import_utils = require("../utils/index.cjs");
|
|
31
31
|
function withVue2(BaseClass, VueCtor) {
|
|
32
|
-
var _a, _b
|
|
33
|
-
|
|
32
|
+
var _a, _b;
|
|
33
|
+
class WithVue2 extends BaseClass {
|
|
34
34
|
constructor(element) {
|
|
35
35
|
var _a2;
|
|
36
36
|
super(element);
|
|
@@ -59,10 +59,13 @@ function withVue2(BaseClass, VueCtor) {
|
|
|
59
59
|
this.$vue.$destroy();
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
}
|
|
62
|
+
}
|
|
63
|
+
__publicField(WithVue2, "config", {
|
|
63
64
|
...BaseClass.config,
|
|
64
65
|
name: `${BaseClass.config.name}WithVue`,
|
|
65
66
|
refs: [...(_b = (_a = BaseClass.config) == null ? void 0 : _a.refs) != null ? _b : [], "vue"]
|
|
66
|
-
})
|
|
67
|
+
});
|
|
68
|
+
__publicField(WithVue2, "vueConfig");
|
|
69
|
+
return WithVue2;
|
|
67
70
|
}
|
|
68
71
|
if (module.exports.default) module.exports = module.exports.default;
|