@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,4 @@
|
|
|
1
|
-
import type { BaseTypeParameter, BaseConfig } from '../Base/index.js';
|
|
2
|
-
import Base from '../Base/index.js';
|
|
1
|
+
import type { Base, BaseTypeParameter, BaseConfig, BaseConstructor } from '../Base/index.js';
|
|
3
2
|
declare type WithMountWhenInViewInterface = {
|
|
4
3
|
$options: {
|
|
5
4
|
intersectionObserver: IntersectionObserverInit;
|
|
@@ -8,8 +7,8 @@ declare type WithMountWhenInViewInterface = {
|
|
|
8
7
|
/**
|
|
9
8
|
* IntersectionObserver decoration.
|
|
10
9
|
*/
|
|
11
|
-
export default function withMountWhenInView<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass:
|
|
12
|
-
new
|
|
10
|
+
export default function withMountWhenInView<S extends BaseConstructor<Base>, T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: S, defaultOptions?: IntersectionObserverInit): {
|
|
11
|
+
new (...args: any[]): {
|
|
13
12
|
/**
|
|
14
13
|
* Is the component visible?
|
|
15
14
|
* @private
|
|
@@ -24,72 +23,100 @@ export default function withMountWhenInView<T extends BaseTypeParameter = BaseTy
|
|
|
24
23
|
* Override the mounting of the component.
|
|
25
24
|
*/
|
|
26
25
|
$mount(): any;
|
|
27
|
-
$parent: Base<
|
|
28
|
-
$el: HTMLElement;
|
|
29
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
30
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
31
|
-
$children: {
|
|
32
|
-
[name: string]: Base<any> | Promise<Base<any>>;
|
|
33
|
-
};
|
|
34
|
-
}>;
|
|
26
|
+
$parent: Base<BaseTypeParameter>;
|
|
35
27
|
$id: string;
|
|
36
|
-
$el:
|
|
37
|
-
__base__?: WeakMap<
|
|
38
|
-
$el: HTMLElement;
|
|
39
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
40
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
41
|
-
$children: {
|
|
42
|
-
[name: string]: Base<any> | Promise<Base<any>>;
|
|
43
|
-
};
|
|
44
|
-
}> | "terminated">;
|
|
28
|
+
$el: HTMLElement & {
|
|
29
|
+
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
45
30
|
};
|
|
46
31
|
$isMounted: boolean;
|
|
47
32
|
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
48
|
-
readonly $root: Base<
|
|
49
|
-
$el: HTMLElement;
|
|
50
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
51
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
52
|
-
$children: {
|
|
53
|
-
[name: string]: Base<any> | Promise<Base<any>>;
|
|
54
|
-
};
|
|
55
|
-
}>;
|
|
33
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
56
34
|
readonly __config: BaseConfig;
|
|
57
35
|
__services: import("../Base/managers/ServicesManager.js").default;
|
|
58
36
|
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
59
|
-
__refs: import("../Base/managers/RefsManager.js").default &
|
|
60
|
-
readonly $refs: import("../Base/managers/RefsManager.js").default &
|
|
61
|
-
__options: import("../Base/managers/OptionsManager.js").default &
|
|
62
|
-
readonly $options: import("../Base/managers/OptionsManager.js").default &
|
|
63
|
-
__children: import("../Base/managers/ChildrenManager.js").default &
|
|
64
|
-
readonly $children: import("../Base/managers/ChildrenManager.js").default &
|
|
37
|
+
__refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
38
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
39
|
+
__options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
40
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
41
|
+
__children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
42
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
65
43
|
__events: import("../Base/managers/EventsManager.js").default;
|
|
66
|
-
readonly $log: (...args:
|
|
67
|
-
readonly __debug: (...args:
|
|
44
|
+
readonly $log: (...args: unknown[]) => void;
|
|
45
|
+
readonly __debug: (...args: unknown[]) => void;
|
|
68
46
|
readonly __managers: import("../Base/index.js").Managers;
|
|
69
|
-
__callMethod(method: string, ...args:
|
|
47
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
70
48
|
__hasEvent(event: string): boolean;
|
|
71
49
|
$update(): any;
|
|
72
50
|
$destroy(): any;
|
|
73
51
|
$terminate(): void;
|
|
74
52
|
__addEmits(event: string): void;
|
|
75
53
|
__removeEmits(event: string): void;
|
|
76
|
-
readonly __ctor:
|
|
54
|
+
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
77
55
|
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
78
56
|
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
79
|
-
$emit(event: string, ...args:
|
|
57
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
80
58
|
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
81
59
|
dispatchEvent(event: Event): boolean;
|
|
82
60
|
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
83
61
|
};
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
62
|
+
prototype: Base<BaseTypeParameter>;
|
|
63
|
+
} & Pick<typeof Base, "prototype" | "$isBase" | "config" | "$factory"> & Pick<{
|
|
64
|
+
new (element: HTMLElement): {
|
|
65
|
+
/**
|
|
66
|
+
* Is the component visible?
|
|
67
|
+
* @private
|
|
68
|
+
*/
|
|
69
|
+
__isVisible: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* The component's observer.
|
|
72
|
+
* @private
|
|
73
|
+
*/
|
|
74
|
+
__observer: IntersectionObserver;
|
|
75
|
+
/**
|
|
76
|
+
* Override the mounting of the component.
|
|
77
|
+
*/
|
|
78
|
+
$mount(): any;
|
|
79
|
+
$parent: Base<BaseTypeParameter>;
|
|
80
|
+
$id: string;
|
|
81
|
+
$el: HTMLElement & {
|
|
82
|
+
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
92
83
|
};
|
|
93
|
-
|
|
84
|
+
$isMounted: boolean;
|
|
85
|
+
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
86
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
87
|
+
readonly __config: BaseConfig;
|
|
88
|
+
__services: import("../Base/managers/ServicesManager.js").default;
|
|
89
|
+
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
90
|
+
__refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
91
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
92
|
+
__options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
93
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
94
|
+
__children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
95
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
96
|
+
__events: import("../Base/managers/EventsManager.js").default;
|
|
97
|
+
readonly $log: (...args: unknown[]) => void;
|
|
98
|
+
readonly __debug: (...args: unknown[]) => void;
|
|
99
|
+
readonly __managers: import("../Base/index.js").Managers;
|
|
100
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
101
|
+
__hasEvent(event: string): boolean;
|
|
102
|
+
$update(): any;
|
|
103
|
+
$destroy(): any;
|
|
104
|
+
$terminate(): void;
|
|
105
|
+
__addEmits(event: string): void;
|
|
106
|
+
__removeEmits(event: string): void;
|
|
107
|
+
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
108
|
+
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
109
|
+
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
110
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
111
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
112
|
+
dispatchEvent(event: Event): boolean;
|
|
113
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
114
|
+
};
|
|
115
|
+
config: BaseConfig;
|
|
116
|
+
readonly $isBase: true;
|
|
117
|
+
$factory: typeof Base.$factory;
|
|
118
|
+
} & S, "prototype" | "$isBase" | "config" | "$factory" | keyof S> & S & {
|
|
119
|
+
new (...args: any[]): Base<T & WithMountWhenInViewInterface>;
|
|
120
|
+
prototype: Base<BaseTypeParameter>;
|
|
94
121
|
};
|
|
95
122
|
export {};
|
|
@@ -5,8 +5,8 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
function withMountWhenInView(BaseClass, defaultOptions = { threshold: [0, 1] }) {
|
|
8
|
-
var _a
|
|
9
|
-
|
|
8
|
+
var _a;
|
|
9
|
+
class WithMountWhenInView extends BaseClass {
|
|
10
10
|
constructor(element) {
|
|
11
11
|
super(element);
|
|
12
12
|
__publicField(this, "__isVisible", false);
|
|
@@ -23,7 +23,10 @@ function withMountWhenInView(BaseClass, defaultOptions = { threshold: [0, 1] })
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
|
-
{
|
|
26
|
+
{
|
|
27
|
+
...defaultOptions,
|
|
28
|
+
...this.$options.intersectionObserver
|
|
29
|
+
}
|
|
27
30
|
);
|
|
28
31
|
this.__observer.observe(this.$el);
|
|
29
32
|
this.$on("terminated", () => {
|
|
@@ -36,14 +39,16 @@ function withMountWhenInView(BaseClass, defaultOptions = { threshold: [0, 1] })
|
|
|
36
39
|
}
|
|
37
40
|
return this;
|
|
38
41
|
}
|
|
39
|
-
}
|
|
42
|
+
}
|
|
43
|
+
__publicField(WithMountWhenInView, "config", {
|
|
40
44
|
...BaseClass.config,
|
|
41
45
|
name: `${BaseClass.config.name}WithMountWhenInView`,
|
|
42
46
|
options: {
|
|
43
47
|
...((_a = BaseClass.config) == null ? void 0 : _a.options) || {},
|
|
44
48
|
intersectionObserver: Object
|
|
45
49
|
}
|
|
46
|
-
})
|
|
50
|
+
});
|
|
51
|
+
return WithMountWhenInView;
|
|
47
52
|
}
|
|
48
53
|
export {
|
|
49
54
|
withMountWhenInView as default
|
|
@@ -30,13 +30,14 @@ __export(withResponsiveOptions_exports, {
|
|
|
30
30
|
module.exports = __toCommonJS(withResponsiveOptions_exports);
|
|
31
31
|
var import_ResponsiveOptionsManager = __toESM(require("../Base/managers/ResponsiveOptionsManager.cjs"), 1);
|
|
32
32
|
function withResponsiveOptions(BaseClass) {
|
|
33
|
-
|
|
33
|
+
class WithResponsiveOptions extends BaseClass {
|
|
34
34
|
get __managers() {
|
|
35
35
|
return {
|
|
36
36
|
...super.__managers,
|
|
37
37
|
OptionsManager: import_ResponsiveOptionsManager.default
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
}
|
|
40
|
+
}
|
|
41
|
+
return WithResponsiveOptions;
|
|
41
42
|
}
|
|
42
43
|
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -1,58 +1,37 @@
|
|
|
1
|
-
import type { BaseTypeParameter, BaseConstructor, Managers } from '../Base/index.js';
|
|
1
|
+
import type { Base, BaseTypeParameter, BaseConstructor, Managers } from '../Base/index.js';
|
|
2
2
|
import ResponsiveOptionsManager from '../Base/managers/ResponsiveOptionsManager.js';
|
|
3
3
|
/**
|
|
4
4
|
* Extends the configuration of an existing class.
|
|
5
5
|
*/
|
|
6
|
-
export default function withResponsiveOptions<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass:
|
|
7
|
-
new
|
|
6
|
+
export default function withResponsiveOptions<S extends BaseConstructor<Base>, T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: S): {
|
|
7
|
+
new (...args: any[]): {
|
|
8
8
|
/**
|
|
9
9
|
* Get managers.
|
|
10
10
|
*/
|
|
11
11
|
readonly __managers: Managers & {
|
|
12
12
|
OptionsManager: typeof ResponsiveOptionsManager;
|
|
13
13
|
};
|
|
14
|
-
$parent:
|
|
15
|
-
$el: HTMLElement;
|
|
16
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
17
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
18
|
-
$children: {
|
|
19
|
-
[name: string]: import("../Base/index.js").default<any> | Promise<import("../Base/index.js").default<any>>;
|
|
20
|
-
};
|
|
21
|
-
}>;
|
|
14
|
+
$parent: Base<BaseTypeParameter>;
|
|
22
15
|
$id: string;
|
|
23
|
-
$el:
|
|
24
|
-
__base__?: WeakMap<
|
|
25
|
-
$el: HTMLElement;
|
|
26
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
27
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
28
|
-
$children: {
|
|
29
|
-
[name: string]: import("../Base/index.js").default<any> | Promise<import("../Base/index.js").default<any>>;
|
|
30
|
-
};
|
|
31
|
-
}> | "terminated">;
|
|
16
|
+
$el: HTMLElement & {
|
|
17
|
+
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
32
18
|
};
|
|
33
19
|
$isMounted: boolean;
|
|
34
20
|
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
35
|
-
readonly $root:
|
|
36
|
-
$el: HTMLElement;
|
|
37
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
38
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
39
|
-
$children: {
|
|
40
|
-
[name: string]: import("../Base/index.js").default<any> | Promise<import("../Base/index.js").default<any>>;
|
|
41
|
-
};
|
|
42
|
-
}>;
|
|
21
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
43
22
|
readonly __config: import("../Base/index.js").BaseConfig;
|
|
44
23
|
__services: import("../Base/managers/ServicesManager.js").default;
|
|
45
24
|
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
46
|
-
__refs: import("../Base/managers/RefsManager.js").default &
|
|
47
|
-
readonly $refs: import("../Base/managers/RefsManager.js").default &
|
|
48
|
-
__options: import("../Base/managers/OptionsManager.js").default &
|
|
49
|
-
readonly $options: import("../Base/managers/OptionsManager.js").default &
|
|
50
|
-
__children: import("../Base/managers/ChildrenManager.js").default &
|
|
51
|
-
readonly $children: import("../Base/managers/ChildrenManager.js").default &
|
|
25
|
+
__refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
26
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
27
|
+
__options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
28
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
29
|
+
__children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
30
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
52
31
|
__events: import("../Base/managers/EventsManager.js").default;
|
|
53
|
-
readonly $log: (...args:
|
|
54
|
-
readonly __debug: (...args:
|
|
55
|
-
__callMethod(method: string, ...args:
|
|
32
|
+
readonly $log: (...args: unknown[]) => void;
|
|
33
|
+
readonly __debug: (...args: unknown[]) => void;
|
|
34
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
56
35
|
__hasEvent(event: string): boolean;
|
|
57
36
|
$mount(): any;
|
|
58
37
|
$update(): any;
|
|
@@ -60,22 +39,63 @@ export default function withResponsiveOptions<T extends BaseTypeParameter = Base
|
|
|
60
39
|
$terminate(): void;
|
|
61
40
|
__addEmits(event: string): void;
|
|
62
41
|
__removeEmits(event: string): void;
|
|
63
|
-
readonly __ctor:
|
|
42
|
+
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
64
43
|
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
65
44
|
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
66
|
-
$emit(event: string, ...args:
|
|
45
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
67
46
|
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
68
47
|
dispatchEvent(event: Event): boolean;
|
|
69
48
|
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
70
49
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
50
|
+
prototype: Base<BaseTypeParameter>;
|
|
51
|
+
} & Pick<typeof Base, "prototype" | "$isBase" | "config" | "$factory"> & Pick<{
|
|
52
|
+
new (...args: any[]): {
|
|
53
|
+
/**
|
|
54
|
+
* Get managers.
|
|
55
|
+
*/
|
|
56
|
+
readonly __managers: Managers & {
|
|
57
|
+
OptionsManager: typeof ResponsiveOptionsManager;
|
|
58
|
+
};
|
|
59
|
+
$parent: Base<BaseTypeParameter>;
|
|
60
|
+
$id: string;
|
|
61
|
+
$el: HTMLElement & {
|
|
62
|
+
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
79
63
|
};
|
|
80
|
-
|
|
64
|
+
$isMounted: boolean;
|
|
65
|
+
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
66
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
67
|
+
readonly __config: import("../Base/index.js").BaseConfig;
|
|
68
|
+
__services: import("../Base/managers/ServicesManager.js").default;
|
|
69
|
+
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
70
|
+
__refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
71
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
72
|
+
__options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
73
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
74
|
+
__children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
75
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
76
|
+
__events: import("../Base/managers/EventsManager.js").default;
|
|
77
|
+
readonly $log: (...args: unknown[]) => void;
|
|
78
|
+
readonly __debug: (...args: unknown[]) => void;
|
|
79
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
80
|
+
__hasEvent(event: string): boolean;
|
|
81
|
+
$mount(): any;
|
|
82
|
+
$update(): any;
|
|
83
|
+
$destroy(): any;
|
|
84
|
+
$terminate(): void;
|
|
85
|
+
__addEmits(event: string): void;
|
|
86
|
+
__removeEmits(event: string): void;
|
|
87
|
+
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
88
|
+
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
89
|
+
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
90
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
91
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
92
|
+
dispatchEvent(event: Event): boolean;
|
|
93
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
94
|
+
};
|
|
95
|
+
readonly $isBase: true;
|
|
96
|
+
config: import("../Base/index.js").BaseConfig;
|
|
97
|
+
$factory: typeof Base.$factory;
|
|
98
|
+
} & S, "prototype" | "$isBase" | "config" | "$factory" | keyof S> & S & {
|
|
99
|
+
new (...args: any[]): Base<T>;
|
|
100
|
+
prototype: Base<BaseTypeParameter>;
|
|
81
101
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import ResponsiveOptionsManager from "../Base/managers/ResponsiveOptionsManager.js";
|
|
2
2
|
function withResponsiveOptions(BaseClass) {
|
|
3
|
-
|
|
3
|
+
class WithResponsiveOptions extends BaseClass {
|
|
4
4
|
get __managers() {
|
|
5
5
|
return {
|
|
6
6
|
...super.__managers,
|
|
7
7
|
OptionsManager: ResponsiveOptionsManager
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
|
+
return WithResponsiveOptions;
|
|
11
12
|
}
|
|
12
13
|
export {
|
|
13
14
|
withResponsiveOptions as default
|
|
@@ -30,7 +30,7 @@ var __publicField = (obj, key, value) => {
|
|
|
30
30
|
// packages/js-toolkit/decorators/withScrolledInView.ts
|
|
31
31
|
var withScrolledInView_exports = {};
|
|
32
32
|
__export(withScrolledInView_exports, {
|
|
33
|
-
|
|
33
|
+
withScrolledInView: () => withScrolledInView
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(withScrolledInView_exports);
|
|
36
36
|
var import_withMountWhenInView = __toESM(require("./withMountWhenInView.cjs"), 1);
|
|
@@ -56,9 +56,8 @@ function updateProps(props, dampFactor, dampPrecision, axis = "x") {
|
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
function withScrolledInView(BaseClass, options = {}) {
|
|
59
|
-
var _a;
|
|
60
59
|
const WithMountWhenInView = (0, import_withMountWhenInView.default)(BaseClass, options);
|
|
61
|
-
|
|
60
|
+
class WithScrolledInView extends WithMountWhenInView {
|
|
62
61
|
constructor(element) {
|
|
63
62
|
super(element);
|
|
64
63
|
__publicField(this, "__props", {
|
|
@@ -87,8 +86,6 @@ function withScrolledInView(BaseClass, options = {}) {
|
|
|
87
86
|
y: 0
|
|
88
87
|
}
|
|
89
88
|
});
|
|
90
|
-
__publicField(this, "dampFactor", 0.1);
|
|
91
|
-
__publicField(this, "dampPrecision", 1e-3);
|
|
92
89
|
const render = () => {
|
|
93
90
|
scheduler.update(() => {
|
|
94
91
|
const renderFn = this.__callMethod("scrolledInView", this.__props);
|
|
@@ -139,6 +136,12 @@ function withScrolledInView(BaseClass, options = {}) {
|
|
|
139
136
|
render();
|
|
140
137
|
});
|
|
141
138
|
}
|
|
139
|
+
get dampFactor() {
|
|
140
|
+
return 0.1;
|
|
141
|
+
}
|
|
142
|
+
get dampPrecision() {
|
|
143
|
+
return 1e-3;
|
|
144
|
+
}
|
|
142
145
|
mounted() {
|
|
143
146
|
if ((0, import_utils.isFunction)(super.mounted)) {
|
|
144
147
|
super.mounted();
|
|
@@ -201,9 +204,11 @@ function withScrolledInView(BaseClass, options = {}) {
|
|
|
201
204
|
(this.__props.dampedCurrent.y - yStart) / (yEnd - yStart)
|
|
202
205
|
);
|
|
203
206
|
}
|
|
204
|
-
}
|
|
207
|
+
}
|
|
208
|
+
__publicField(WithScrolledInView, "config", {
|
|
205
209
|
name: `${BaseClass.config.name}WithMountWhenInView`,
|
|
206
210
|
emits: ["scrolledInView"]
|
|
207
|
-
})
|
|
211
|
+
});
|
|
212
|
+
return WithScrolledInView;
|
|
208
213
|
}
|
|
209
214
|
if (module.exports.default) module.exports = module.exports.default;
|