@studiometa/js-toolkit 2.4.4-alpha.8 → 2.4.6
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/managers/EventsManager.cjs +1 -1
- package/Base/managers/EventsManager.js +1 -1
- package/Base/types.d.ts +3 -3
- package/decorators/withBreakpointObserver.d.ts +1 -1
- package/decorators/withFreezedOptions.d.ts +2 -2
- package/decorators/withIntersectionObserver.d.ts +1 -1
- package/decorators/withMountWhenInView.d.ts +1 -1
- package/decorators/withScrolledInView.d.ts +1 -1
- package/decorators/withVue2.d.ts +1 -1
- package/package.json +1 -1
|
@@ -89,7 +89,7 @@ function manageRef(that, name, elements, mode = "add") {
|
|
|
89
89
|
const methods = getEventMethodsByName(that, name);
|
|
90
90
|
methods.forEach((method) => {
|
|
91
91
|
const event = getEventNameByMethod(method, name);
|
|
92
|
-
elements.forEach((element) => element[action](event, that.__refsHandler));
|
|
92
|
+
elements.filter((element) => element).forEach((element) => element[action](event, that.__refsHandler));
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
function manageChild(that, name, instance, mode = "add") {
|
|
@@ -58,7 +58,7 @@ function manageRef(that, name, elements, mode = "add") {
|
|
|
58
58
|
const methods = getEventMethodsByName(that, name);
|
|
59
59
|
methods.forEach((method) => {
|
|
60
60
|
const event = getEventNameByMethod(method, name);
|
|
61
|
-
elements.forEach((element) => element[action](event, that.__refsHandler));
|
|
61
|
+
elements.filter((element) => element).forEach((element) => element[action](event, that.__refsHandler));
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
function manageChild(that, name, instance, mode = "add") {
|
package/Base/types.d.ts
CHANGED
|
@@ -42,6 +42,6 @@ export interface BaseInterface {
|
|
|
42
42
|
*/
|
|
43
43
|
scrolled?(props: ScrollServiceProps): void;
|
|
44
44
|
}
|
|
45
|
-
export declare type BaseDecorator<S extends BaseInterface, T extends Base> = {
|
|
46
|
-
new <W extends BaseProps = BaseProps>(...args: unknown[]): S & T & Base<W>;
|
|
47
|
-
} & Partial<Pick<T, keyof T
|
|
45
|
+
export declare type BaseDecorator<S extends BaseInterface, T extends Base, U extends BaseProps = BaseProps> = {
|
|
46
|
+
new <W extends BaseProps = BaseProps>(...args: unknown[]): S & T & Base<W & U>;
|
|
47
|
+
} & Partial<Pick<T, keyof T>> & Pick<typeof Base, keyof typeof Base>;
|
|
@@ -12,4 +12,4 @@ export interface WithBreakpointObserverInterface extends BaseInterface {
|
|
|
12
12
|
/**
|
|
13
13
|
* BreakpointObserver class.
|
|
14
14
|
*/
|
|
15
|
-
export declare function withBreakpointObserver<S extends Base>(BaseClass: typeof Base): BaseDecorator<WithBreakpointObserverInterface, S>;
|
|
15
|
+
export declare function withBreakpointObserver<S extends Base>(BaseClass: typeof Base): BaseDecorator<WithBreakpointObserverInterface, S, WithBreakpointObserverProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BaseDecorator, BaseInterface } from '../Base/types.js';
|
|
2
|
-
import type { Base } from '../Base/index.js';
|
|
2
|
+
import type { Base, BaseOptions } from '../Base/index.js';
|
|
3
3
|
export interface WithFreezedOptionsInterface extends BaseInterface {
|
|
4
|
-
readonly $options:
|
|
4
|
+
readonly $options: Readonly<BaseOptions>;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* Freeze the `$options` property to improve performance.
|
|
@@ -13,4 +13,4 @@ export interface WithIntersectionObserverInterface extends BaseInterface {
|
|
|
13
13
|
/**
|
|
14
14
|
* IntersectionObserver decoration.
|
|
15
15
|
*/
|
|
16
|
-
export declare function withIntersectionObserver<S extends Base>(BaseClass: typeof Base, defaultOptions?: IntersectionObserverInit): BaseDecorator<WithIntersectionObserverInterface, S>;
|
|
16
|
+
export declare function withIntersectionObserver<S extends Base>(BaseClass: typeof Base, defaultOptions?: IntersectionObserverInit): BaseDecorator<WithIntersectionObserverInterface, S, WithIntersectionObserverProps>;
|
|
@@ -19,4 +19,4 @@ export interface WithMountWhenInViewInterface extends BaseInterface {
|
|
|
19
19
|
/**
|
|
20
20
|
* IntersectionObserver decoration.
|
|
21
21
|
*/
|
|
22
|
-
export declare function withMountWhenInView<S extends Base = Base>(BaseClass: typeof Base, defaultOptions?: IntersectionObserverInit): BaseDecorator<WithMountWhenInViewInterface, S>;
|
|
22
|
+
export declare function withMountWhenInView<S extends Base = Base>(BaseClass: typeof Base, defaultOptions?: IntersectionObserverInit): BaseDecorator<WithMountWhenInViewInterface, S, WithMountWhenInViewProps>;
|
|
@@ -57,4 +57,4 @@ export interface WithScrolledInViewInterface extends BaseInterface {
|
|
|
57
57
|
/**
|
|
58
58
|
* Add scrolled in view capabilities to a component.
|
|
59
59
|
*/
|
|
60
|
-
export declare function withScrolledInView<S extends Base = Base>(BaseClass: typeof Base, options?: WithScrolledInViewOptions): BaseDecorator<WithScrolledInViewInterface, S>;
|
|
60
|
+
export declare function withScrolledInView<S extends Base = Base>(BaseClass: typeof Base, options?: WithScrolledInViewOptions): BaseDecorator<WithScrolledInViewInterface, S, WithScrolledInViewProps>;
|
package/decorators/withVue2.d.ts
CHANGED
|
@@ -13,4 +13,4 @@ export interface WithVue2Interface extends BaseInterface {
|
|
|
13
13
|
/**
|
|
14
14
|
* withVue decorator.
|
|
15
15
|
*/
|
|
16
|
-
export declare function withVue2<S extends Base, T extends Vue = Vue>(BaseClass: typeof Base, VueCtor: VueConstructor): BaseDecorator<WithVue2Interface, S>;
|
|
16
|
+
export declare function withVue2<S extends Base, T extends Vue = Vue>(BaseClass: typeof Base, VueCtor: VueConstructor): BaseDecorator<WithVue2Interface, S, WithVue2Props>;
|