@studiometa/js-toolkit 2.4.4-alpha.0 → 2.4.4-alpha.3
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 +1 -1
- package/Base/index.d.ts +198 -0
- package/Base/managers/AbstractManager.d.ts +44 -0
- package/Base/managers/ChildrenManager.d.ts +41 -0
- package/Base/managers/EventsManager.d.ts +112 -0
- package/Base/managers/OptionsManager.d.ts +87 -0
- package/Base/managers/RefsManager.d.ts +32 -0
- package/Base/managers/ResponsiveOptionsManager.cjs +1 -1
- package/Base/managers/ResponsiveOptionsManager.d.ts +22 -0
- package/Base/managers/ServicesManager.d.ts +109 -0
- package/Base/types.cjs +18 -0
- package/Base/types.d.ts +43 -0
- package/Base/types.js +0 -0
- package/Base/utils.d.ts +40 -0
- package/decorators/index.d.ts +10 -0
- package/decorators/withBreakpointManager.d.ts +59 -0
- package/decorators/withBreakpointObserver.d.ts +65 -0
- package/decorators/withDrag.d.ts +56 -0
- package/decorators/withExtraConfig.d.ts +57 -0
- package/decorators/withFreezedOptions.d.ts +56 -0
- package/decorators/withIntersectionObserver.d.ts +69 -0
- package/decorators/withMountWhenInView.d.ts +67 -0
- package/decorators/withResponsiveOptions.d.ts +53 -0
- package/decorators/withScrolledInView.d.ts +171 -0
- package/decorators/withVue2.cjs +2 -2
- package/decorators/withVue2.d.ts +70 -0
- package/decorators/withVue2.js +2 -2
- package/helpers/createApp.d.ts +14 -0
- package/helpers/getDirectChildren.d.ts +24 -0
- package/helpers/getInstanceFromElement.d.ts +14 -0
- package/helpers/importOnInteraction.d.ts +23 -0
- package/helpers/importWhenIdle.d.ts +21 -0
- package/helpers/importWhenVisible.d.ts +23 -0
- package/helpers/index.d.ts +6 -0
- package/helpers/utils.d.ts +10 -0
- package/index.d.ts +6 -0
- package/package.json +1 -1
- package/services/drag.d.ts +1 -1
- package/services/index.cjs +1 -1
- package/services/index.d.ts +33 -25
- package/services/key.d.ts +1 -1
- package/services/load.d.ts +1 -1
- package/services/pointer.d.ts +1 -1
- package/services/raf.d.ts +1 -1
- package/services/resize.d.ts +1 -1
- package/services/scroll.d.ts +1 -1
package/Base/types.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { KeyServiceProps, LoadServiceProps, PointerServiceProps, RafServiceProps, ResizeServiceProps, ScrollServiceProps } from '../services/index.js';
|
|
2
|
+
export interface BaseInterface {
|
|
3
|
+
/**
|
|
4
|
+
* Mounted hook.
|
|
5
|
+
*/
|
|
6
|
+
mounted?(): void;
|
|
7
|
+
/**
|
|
8
|
+
* Updated hook.
|
|
9
|
+
*/
|
|
10
|
+
updated?(): void;
|
|
11
|
+
/**
|
|
12
|
+
* Destroyed hook.
|
|
13
|
+
*/
|
|
14
|
+
destroyed?(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Terminated hook.
|
|
17
|
+
*/
|
|
18
|
+
terminated?(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Key service, executed when a keyboard key is pressed or released.
|
|
21
|
+
*/
|
|
22
|
+
keyed?(props: KeyServiceProps): void;
|
|
23
|
+
/**
|
|
24
|
+
* Load service, executed when the window `load` event is fired.
|
|
25
|
+
*/
|
|
26
|
+
loaded?(props: LoadServiceProps): void;
|
|
27
|
+
/**
|
|
28
|
+
* Pointer service, executed when the pointer is moving, pressed or released.
|
|
29
|
+
*/
|
|
30
|
+
moved?(props: PointerServiceProps): void;
|
|
31
|
+
/**
|
|
32
|
+
* Raf service, executed on each rendered frame.
|
|
33
|
+
*/
|
|
34
|
+
ticked?(props: RafServiceProps): void;
|
|
35
|
+
/**
|
|
36
|
+
* Resize service, executed when the window is resized.
|
|
37
|
+
*/
|
|
38
|
+
resized?(props: ResizeServiceProps): void;
|
|
39
|
+
/**
|
|
40
|
+
* Scroll service, executed when the document is scrolled.
|
|
41
|
+
*/
|
|
42
|
+
scrolled?(props: ScrollServiceProps): void;
|
|
43
|
+
}
|
package/Base/types.js
ADDED
|
File without changes
|
package/Base/utils.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('./index.js').default} Base
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Get a list of elements based on the name of a component.
|
|
6
|
+
*
|
|
7
|
+
* @param {string} nameOrSelector
|
|
8
|
+
* The name or selector to used for this component.
|
|
9
|
+
* @param {HTMLElement|Document} element
|
|
10
|
+
* The root element on which to query the selector, defaults to `document`.
|
|
11
|
+
* @returns {Array<HTMLElement>}
|
|
12
|
+
* A list of elements on which the component should be mounted.
|
|
13
|
+
*/
|
|
14
|
+
export function getComponentElements(nameOrSelector: string, element?: HTMLElement | Document): Array<HTMLElement>;
|
|
15
|
+
/**
|
|
16
|
+
* Test if an event is defined in the given config.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} event
|
|
19
|
+
* @param {import('./index.js').BaseConfig} config
|
|
20
|
+
* @returns {boolean}
|
|
21
|
+
*/
|
|
22
|
+
export function eventIsDefinedInConfig(event: string, config: import('./index.js').BaseConfig): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Test if an event can be used on the given element.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} event
|
|
27
|
+
* @param {HTMLElement} element
|
|
28
|
+
* @returns {boolean}
|
|
29
|
+
*/
|
|
30
|
+
export function eventIsNative(event: string, element: HTMLElement): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Get the target of a given event.
|
|
33
|
+
*
|
|
34
|
+
* @param {Base} instance
|
|
35
|
+
* @param {string} event
|
|
36
|
+
* @param {import('./index.js').BaseConfig} config
|
|
37
|
+
* @returns {Base|Base['$el']}
|
|
38
|
+
*/
|
|
39
|
+
export function getEventTarget(instance: Base, event: string, config: import('./index.js').BaseConfig): Base | Base['$el'];
|
|
40
|
+
export type Base = import('./index.js').default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as withBreakpointManager } from './withBreakpointManager.js';
|
|
2
|
+
export { default as withBreakpointObserver } from './withBreakpointObserver.js';
|
|
3
|
+
export { default as withDrag } from './withDrag.js';
|
|
4
|
+
export { default as withExtraConfig } from './withExtraConfig.js';
|
|
5
|
+
export { default as withFreezedOptions } from './withFreezedOptions.js';
|
|
6
|
+
export { default as withIntersectionObserver } from './withIntersectionObserver.js';
|
|
7
|
+
export { default as withMountWhenInView } from './withMountWhenInView.js';
|
|
8
|
+
export { default as withResponsiveOptions } from './withResponsiveOptions.js';
|
|
9
|
+
export { default as withScrolledInView } from './withScrolledInView.js';
|
|
10
|
+
export { default as withVue2 } from './withVue2.js';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type Base from '../Base/index.js';
|
|
2
|
+
import type { BaseConstructor, BaseTypeParameter } from '../Base/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* BreakpointManager class.
|
|
5
|
+
*/
|
|
6
|
+
export default function withBreakpointManager<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: BaseConstructor, breakpoints: Array<[string, BaseConstructor]>): typeof Base | {
|
|
7
|
+
new <U extends BaseTypeParameter = BaseTypeParameter>(element: any): {
|
|
8
|
+
/**
|
|
9
|
+
* Override the default $mount method to prevent component's from being
|
|
10
|
+
* mounted when they should not.
|
|
11
|
+
*
|
|
12
|
+
* @returns {this}
|
|
13
|
+
*/
|
|
14
|
+
$mount(): any;
|
|
15
|
+
/**
|
|
16
|
+
* Destroy all instances when the main one is destroyed.
|
|
17
|
+
*
|
|
18
|
+
* @returns {this}
|
|
19
|
+
*/
|
|
20
|
+
$destroy(): any;
|
|
21
|
+
$parent: Base<BaseTypeParameter>;
|
|
22
|
+
$id: string;
|
|
23
|
+
$el: (T & U)["$el"] & HTMLElement & {
|
|
24
|
+
__base__?: WeakMap<typeof Base, Base<BaseTypeParameter> | "terminated">;
|
|
25
|
+
};
|
|
26
|
+
$isMounted: boolean;
|
|
27
|
+
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
28
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
29
|
+
readonly __config: import("../Base/index.js").BaseConfig;
|
|
30
|
+
__services: import("../Base/managers/ServicesManager.js").default;
|
|
31
|
+
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
32
|
+
__refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
33
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
34
|
+
__options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
|
|
35
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
|
|
36
|
+
__children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_1 ? { [key in keyof T_1]: (T & U)["$children"][key][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
37
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_2 ? { [key_1 in keyof T_2]: (T & U)["$children"][key_1][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
38
|
+
__events: import("../Base/managers/EventsManager.js").default;
|
|
39
|
+
readonly $log: (...args: any) => void;
|
|
40
|
+
readonly __debug: (...args: any) => void;
|
|
41
|
+
readonly __managers: import("../Base/index.js").Managers;
|
|
42
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
43
|
+
__hasEvent(event: string): boolean;
|
|
44
|
+
$update(): any;
|
|
45
|
+
$terminate(): void;
|
|
46
|
+
__addEmits(event: string): void;
|
|
47
|
+
__removeEmits(event: string): void;
|
|
48
|
+
readonly __ctor: typeof Base;
|
|
49
|
+
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
50
|
+
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
51
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
52
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
53
|
+
dispatchEvent(event: Event): boolean;
|
|
54
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
55
|
+
};
|
|
56
|
+
readonly $isBase: true;
|
|
57
|
+
config: import("../Base/index.js").BaseConfig;
|
|
58
|
+
$factory(nameOrSelector: string): Base<BaseTypeParameter>[];
|
|
59
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type Base from '../Base/index.js';
|
|
2
|
+
import type { BaseConstructor, BaseTypeParameter } from '../Base/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* BreakpointObserver class.
|
|
5
|
+
*/
|
|
6
|
+
export default function withBreakpointObserver<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: BaseConstructor): {
|
|
7
|
+
new <U extends BaseTypeParameter = BaseTypeParameter>(element: any): {
|
|
8
|
+
/**
|
|
9
|
+
* Override the default $mount method to prevent component's from being
|
|
10
|
+
* mounted when they should not.
|
|
11
|
+
*
|
|
12
|
+
* @returns {this}
|
|
13
|
+
*/
|
|
14
|
+
$mount(): any;
|
|
15
|
+
$parent: Base<BaseTypeParameter>;
|
|
16
|
+
$id: string;
|
|
17
|
+
$el: (T & U)["$el"] & HTMLElement & {
|
|
18
|
+
__base__?: WeakMap<typeof Base, Base<BaseTypeParameter> | "terminated">;
|
|
19
|
+
};
|
|
20
|
+
$isMounted: boolean;
|
|
21
|
+
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
22
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
23
|
+
readonly __config: import("../Base/index.js").BaseConfig;
|
|
24
|
+
__services: import("../Base/managers/ServicesManager.js").default;
|
|
25
|
+
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
26
|
+
__refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
27
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
28
|
+
__options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
|
|
29
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
|
|
30
|
+
__children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_1 ? { [key in keyof T_1]: (T & U)["$children"][key][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
31
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_2 ? { [key_1 in keyof T_2]: (T & U)["$children"][key_1][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
32
|
+
__events: import("../Base/managers/EventsManager.js").default;
|
|
33
|
+
readonly $log: (...args: any) => void;
|
|
34
|
+
readonly __debug: (...args: any) => void;
|
|
35
|
+
readonly __managers: import("../Base/index.js").Managers;
|
|
36
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
37
|
+
__hasEvent(event: string): boolean;
|
|
38
|
+
$update(): any;
|
|
39
|
+
$destroy(): any;
|
|
40
|
+
$terminate(): void;
|
|
41
|
+
__addEmits(event: string): void;
|
|
42
|
+
__removeEmits(event: string): void;
|
|
43
|
+
readonly __ctor: typeof Base;
|
|
44
|
+
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
45
|
+
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
46
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
47
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
48
|
+
dispatchEvent(event: Event): boolean;
|
|
49
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
50
|
+
};
|
|
51
|
+
config: {
|
|
52
|
+
name: string;
|
|
53
|
+
options: {
|
|
54
|
+
activeBreakpoints: StringConstructor;
|
|
55
|
+
inactiveBreakpoints: StringConstructor;
|
|
56
|
+
};
|
|
57
|
+
debug?: boolean;
|
|
58
|
+
log?: boolean;
|
|
59
|
+
refs?: string[];
|
|
60
|
+
emits?: string[];
|
|
61
|
+
components?: import("../Base/index.js").BaseConfigComponents;
|
|
62
|
+
};
|
|
63
|
+
readonly $isBase: true;
|
|
64
|
+
$factory(nameOrSelector: string): Base<BaseTypeParameter>[];
|
|
65
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type Base from '../Base/index.js';
|
|
2
|
+
import type { BaseTypeParameter, BaseConstructor } from '../Base/index.js';
|
|
3
|
+
import type { DragServiceOptions } from '../services/drag.js';
|
|
4
|
+
declare type DragDecoratorOptions = DragServiceOptions & {
|
|
5
|
+
target?: (this: Base, instance: Base) => HTMLElement;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Add dragging capabilities to a component.
|
|
9
|
+
*/
|
|
10
|
+
export default function withDrag<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: BaseConstructor, { target, ...options }?: DragDecoratorOptions): {
|
|
11
|
+
new <U extends BaseTypeParameter = BaseTypeParameter>(el: any): {
|
|
12
|
+
$parent: Base<BaseTypeParameter>;
|
|
13
|
+
$id: string;
|
|
14
|
+
$el: (T & U)["$el"] & HTMLElement & {
|
|
15
|
+
__base__?: WeakMap<typeof Base, Base<BaseTypeParameter> | "terminated">;
|
|
16
|
+
};
|
|
17
|
+
$isMounted: boolean;
|
|
18
|
+
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
19
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
20
|
+
readonly __config: import("../Base/index.js").BaseConfig;
|
|
21
|
+
__services: import("../Base/managers/ServicesManager.js").default;
|
|
22
|
+
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
23
|
+
__refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
24
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
25
|
+
__options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
|
|
26
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
|
|
27
|
+
__children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_1 ? { [key in keyof T_1]: (T & U)["$children"][key][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
28
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_2 ? { [key_1 in keyof T_2]: (T & U)["$children"][key_1][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
29
|
+
__events: import("../Base/managers/EventsManager.js").default;
|
|
30
|
+
readonly $log: (...args: any) => void;
|
|
31
|
+
readonly __debug: (...args: any) => void;
|
|
32
|
+
readonly __managers: import("../Base/index.js").Managers;
|
|
33
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
34
|
+
__hasEvent(event: string): boolean;
|
|
35
|
+
$mount(): any;
|
|
36
|
+
$update(): any;
|
|
37
|
+
$destroy(): any;
|
|
38
|
+
$terminate(): void;
|
|
39
|
+
__addEmits(event: string): void;
|
|
40
|
+
__removeEmits(event: string): void;
|
|
41
|
+
readonly __ctor: typeof Base;
|
|
42
|
+
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
43
|
+
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
44
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
45
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
46
|
+
dispatchEvent(event: Event): boolean;
|
|
47
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
48
|
+
};
|
|
49
|
+
config: {
|
|
50
|
+
name: string;
|
|
51
|
+
emits: string[];
|
|
52
|
+
};
|
|
53
|
+
readonly $isBase: true;
|
|
54
|
+
$factory(nameOrSelector: string): Base<BaseTypeParameter>[];
|
|
55
|
+
};
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Options as DeepmergeOptions } from 'deepmerge';
|
|
2
|
+
import type { BaseTypeParameter, BaseConstructor, BaseConfig } from '../Base/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Extends the configuration of an existing class.
|
|
5
|
+
*
|
|
6
|
+
* @template {BaseConstructor} T
|
|
7
|
+
* @param {T} BaseClass The Base class to extend.
|
|
8
|
+
* @param {Partial<BaseConfig>} config Extra configuration to merge.
|
|
9
|
+
* @param {DeepmergeOptions} options Options for the `deepmerge` function. {@link https://github.com/TehShrike/deepmerge#options}
|
|
10
|
+
*/
|
|
11
|
+
export default function withExtraConfig<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: BaseConstructor, config: Partial<BaseConfig>, options?: DeepmergeOptions): {
|
|
12
|
+
new <U extends BaseTypeParameter = BaseTypeParameter>(element: HTMLElement): {
|
|
13
|
+
$parent: import("../Base/index.js").default<BaseTypeParameter>;
|
|
14
|
+
$id: string;
|
|
15
|
+
$el: (T & U)["$el"] & HTMLElement & {
|
|
16
|
+
__base__?: WeakMap<typeof import("../Base/index.js").default, import("../Base/index.js").default<BaseTypeParameter> | "terminated">;
|
|
17
|
+
};
|
|
18
|
+
$isMounted: boolean;
|
|
19
|
+
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
20
|
+
readonly $root: import("../Base/index.js").default<BaseTypeParameter>;
|
|
21
|
+
readonly __config: BaseConfig;
|
|
22
|
+
__services: import("../Base/managers/ServicesManager.js").default;
|
|
23
|
+
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
24
|
+
__refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
25
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
26
|
+
__options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
|
|
27
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
|
|
28
|
+
__children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_1 ? { [key in keyof T_1]: (T & U)["$children"][key][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
29
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_2 ? { [key_1 in keyof T_2]: (T & U)["$children"][key_1][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
30
|
+
__events: import("../Base/managers/EventsManager.js").default;
|
|
31
|
+
readonly $log: (...args: any) => void;
|
|
32
|
+
readonly __debug: (...args: any) => void;
|
|
33
|
+
readonly __managers: import("../Base/index.js").Managers;
|
|
34
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
35
|
+
__hasEvent(event: string): boolean;
|
|
36
|
+
$mount(): any;
|
|
37
|
+
$update(): any;
|
|
38
|
+
$destroy(): any;
|
|
39
|
+
$terminate(): void;
|
|
40
|
+
__addEmits(event: string): void;
|
|
41
|
+
__removeEmits(event: string): void;
|
|
42
|
+
readonly __ctor: typeof import("../Base/index.js").default;
|
|
43
|
+
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
44
|
+
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
45
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
46
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
47
|
+
dispatchEvent(event: Event): boolean;
|
|
48
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Class config.
|
|
52
|
+
* @type {BaseConfig}
|
|
53
|
+
*/
|
|
54
|
+
config: BaseConfig;
|
|
55
|
+
readonly $isBase: true;
|
|
56
|
+
$factory(nameOrSelector: string): import("../Base/index.js").default<BaseTypeParameter>[];
|
|
57
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { BaseConstructor, BaseTypeParameter } from '../Base/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Freeze the `$options` property to improve performance.
|
|
4
|
+
*/
|
|
5
|
+
export default function withFreezedOptions<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: BaseConstructor): {
|
|
6
|
+
new <U extends BaseTypeParameter = BaseTypeParameter>(element: HTMLElement): {
|
|
7
|
+
/**
|
|
8
|
+
* Hold freezed options
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
__freezedOptions: any;
|
|
12
|
+
/**
|
|
13
|
+
* Lazyly freeze the `$options` property.
|
|
14
|
+
* @returns {Readonly<this['$options']>}
|
|
15
|
+
*/
|
|
16
|
+
readonly $options: any;
|
|
17
|
+
$parent: import("../Base/index.js").default<BaseTypeParameter>;
|
|
18
|
+
$id: string;
|
|
19
|
+
$el: (T & U)["$el"] & HTMLElement & {
|
|
20
|
+
__base__?: WeakMap<typeof import("../Base/index.js").default, import("../Base/index.js").default<BaseTypeParameter> | "terminated">;
|
|
21
|
+
};
|
|
22
|
+
$isMounted: boolean;
|
|
23
|
+
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
24
|
+
readonly $root: import("../Base/index.js").default<BaseTypeParameter>;
|
|
25
|
+
readonly __config: import("../Base/index.js").BaseConfig;
|
|
26
|
+
__services: import("../Base/managers/ServicesManager.js").default;
|
|
27
|
+
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
28
|
+
__refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
29
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
30
|
+
__options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
|
|
31
|
+
__children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_1 ? { [key in keyof T_1]: (T & U)["$children"][key][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
32
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & ((T & U)["$children"] extends infer T_2 ? { [key_1 in keyof T_2]: (T & U)["$children"][key_1][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
33
|
+
__events: import("../Base/managers/EventsManager.js").default;
|
|
34
|
+
readonly $log: (...args: any) => void;
|
|
35
|
+
readonly __debug: (...args: any) => void;
|
|
36
|
+
readonly __managers: import("../Base/index.js").Managers;
|
|
37
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
38
|
+
__hasEvent(event: string): boolean;
|
|
39
|
+
$mount(): any;
|
|
40
|
+
$update(): any;
|
|
41
|
+
$destroy(): any;
|
|
42
|
+
$terminate(): void;
|
|
43
|
+
__addEmits(event: string): void;
|
|
44
|
+
__removeEmits(event: string): void;
|
|
45
|
+
readonly __ctor: typeof import("../Base/index.js").default;
|
|
46
|
+
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
47
|
+
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
48
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
49
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
50
|
+
dispatchEvent(event: Event): boolean;
|
|
51
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
52
|
+
};
|
|
53
|
+
readonly $isBase: true;
|
|
54
|
+
config: import("../Base/index.js").BaseConfig;
|
|
55
|
+
$factory(nameOrSelector: string): import("../Base/index.js").default<BaseTypeParameter>[];
|
|
56
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { BaseConstructor, BaseTypeParameter } from '../Base/index.js';
|
|
2
|
+
interface WithIntersectionObserverInterface {
|
|
3
|
+
$options: {
|
|
4
|
+
intersectionObserver: IntersectionObserverInit;
|
|
5
|
+
};
|
|
6
|
+
$observer: IntersectionObserver;
|
|
7
|
+
intersected(entries: IntersectionObserverEntry[]): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* IntersectionObserver decoration.
|
|
11
|
+
*/
|
|
12
|
+
export default function withIntersectionObserver<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: BaseConstructor, defaultOptions?: IntersectionObserverInit): {
|
|
13
|
+
new <U extends BaseTypeParameter = BaseTypeParameter>(element: HTMLElement): {
|
|
14
|
+
/**
|
|
15
|
+
* Intersection observer instance.
|
|
16
|
+
*/
|
|
17
|
+
$observer: IntersectionObserver;
|
|
18
|
+
$parent: import("../Base/index.js").default<BaseTypeParameter>;
|
|
19
|
+
$id: string;
|
|
20
|
+
$el: (WithIntersectionObserverInterface & T & U)["$el"] & HTMLElement & {
|
|
21
|
+
__base__?: WeakMap<typeof import("../Base/index.js").default, import("../Base/index.js").default<BaseTypeParameter> | "terminated">;
|
|
22
|
+
};
|
|
23
|
+
$isMounted: boolean;
|
|
24
|
+
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
25
|
+
readonly $root: import("../Base/index.js").default<BaseTypeParameter>;
|
|
26
|
+
readonly __config: import("../Base/index.js").BaseConfig;
|
|
27
|
+
__services: import("../Base/managers/ServicesManager.js").default;
|
|
28
|
+
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
29
|
+
__refs: import("../Base/managers/RefsManager.js").default & (WithIntersectionObserverInterface & T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
30
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & (WithIntersectionObserverInterface & T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
31
|
+
__options: import("../Base/managers/OptionsManager.js").default & (WithIntersectionObserverInterface & T & U)["$options"] & import("../Base/index.js").BaseOptions;
|
|
32
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & (WithIntersectionObserverInterface & T & U)["$options"] & import("../Base/index.js").BaseOptions;
|
|
33
|
+
__children: import("../Base/managers/ChildrenManager.js").default & ((WithIntersectionObserverInterface & T & U)["$children"] extends infer T_1 ? { [key in keyof T_1]: (WithIntersectionObserverInterface & T & U)["$children"][key][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
34
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & ((WithIntersectionObserverInterface & T & U)["$children"] extends infer T_2 ? { [key_1 in keyof T_2]: (WithIntersectionObserverInterface & T & U)["$children"][key_1][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
35
|
+
__events: import("../Base/managers/EventsManager.js").default;
|
|
36
|
+
readonly $log: (...args: any) => void;
|
|
37
|
+
readonly __debug: (...args: any) => void;
|
|
38
|
+
readonly __managers: import("../Base/index.js").Managers;
|
|
39
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
40
|
+
__hasEvent(event: string): boolean;
|
|
41
|
+
$mount(): any;
|
|
42
|
+
$update(): any;
|
|
43
|
+
$destroy(): any;
|
|
44
|
+
$terminate(): void;
|
|
45
|
+
__addEmits(event: string): void;
|
|
46
|
+
__removeEmits(event: string): void;
|
|
47
|
+
readonly __ctor: typeof import("../Base/index.js").default;
|
|
48
|
+
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
49
|
+
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
50
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
51
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
52
|
+
dispatchEvent(event: Event): boolean;
|
|
53
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
54
|
+
};
|
|
55
|
+
config: {
|
|
56
|
+
name: string;
|
|
57
|
+
options: {
|
|
58
|
+
intersectionObserver: ObjectConstructor;
|
|
59
|
+
};
|
|
60
|
+
emits: string[];
|
|
61
|
+
debug?: boolean;
|
|
62
|
+
log?: boolean;
|
|
63
|
+
refs?: string[];
|
|
64
|
+
components?: import("../Base/index.js").BaseConfigComponents;
|
|
65
|
+
};
|
|
66
|
+
readonly $isBase: true;
|
|
67
|
+
$factory(nameOrSelector: string): import("../Base/index.js").default<BaseTypeParameter>[];
|
|
68
|
+
};
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { BaseTypeParameter, BaseConfig } from '../Base/index.js';
|
|
2
|
+
import Base from '../Base/index.js';
|
|
3
|
+
declare type WithMountWhenInViewInterface = {
|
|
4
|
+
$options: {
|
|
5
|
+
intersectionObserver: IntersectionObserverInit;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* IntersectionObserver decoration.
|
|
10
|
+
*/
|
|
11
|
+
export default function withMountWhenInView<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: typeof Base, defaultOptions?: IntersectionObserverInit): {
|
|
12
|
+
new <U extends BaseTypeParameter = BaseTypeParameter>(element: HTMLElement): {
|
|
13
|
+
/**
|
|
14
|
+
* Is the component visible?
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
__isVisible: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The component's observer.
|
|
20
|
+
* @private
|
|
21
|
+
*/
|
|
22
|
+
__observer: IntersectionObserver;
|
|
23
|
+
/**
|
|
24
|
+
* Override the mounting of the component.
|
|
25
|
+
*/
|
|
26
|
+
$mount(): any;
|
|
27
|
+
$parent: Base<BaseTypeParameter>;
|
|
28
|
+
$id: string;
|
|
29
|
+
$el: (WithMountWhenInViewInterface & T & U)["$el"] & HTMLElement & {
|
|
30
|
+
__base__?: WeakMap<typeof Base, Base<BaseTypeParameter> | "terminated">;
|
|
31
|
+
};
|
|
32
|
+
$isMounted: boolean;
|
|
33
|
+
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
34
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
35
|
+
readonly __config: BaseConfig;
|
|
36
|
+
__services: import("../Base/managers/ServicesManager.js").default;
|
|
37
|
+
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
38
|
+
__refs: import("../Base/managers/RefsManager.js").default & (WithMountWhenInViewInterface & T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
39
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & (WithMountWhenInViewInterface & T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
40
|
+
__options: import("../Base/managers/OptionsManager.js").default & (WithMountWhenInViewInterface & T & U)["$options"] & import("../Base/index.js").BaseOptions;
|
|
41
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & (WithMountWhenInViewInterface & T & U)["$options"] & import("../Base/index.js").BaseOptions;
|
|
42
|
+
__children: import("../Base/managers/ChildrenManager.js").default & ((WithMountWhenInViewInterface & T & U)["$children"] extends infer T_1 ? { [key in keyof T_1]: (WithMountWhenInViewInterface & T & U)["$children"][key][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
43
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & ((WithMountWhenInViewInterface & T & U)["$children"] extends infer T_2 ? { [key_1 in keyof T_2]: (WithMountWhenInViewInterface & T & U)["$children"][key_1][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
44
|
+
__events: import("../Base/managers/EventsManager.js").default;
|
|
45
|
+
readonly $log: (...args: any) => void;
|
|
46
|
+
readonly __debug: (...args: any) => void;
|
|
47
|
+
readonly __managers: import("../Base/index.js").Managers;
|
|
48
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
49
|
+
__hasEvent(event: string): boolean;
|
|
50
|
+
$update(): any;
|
|
51
|
+
$destroy(): any;
|
|
52
|
+
$terminate(): void;
|
|
53
|
+
__addEmits(event: string): void;
|
|
54
|
+
__removeEmits(event: string): void;
|
|
55
|
+
readonly __ctor: typeof Base;
|
|
56
|
+
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
57
|
+
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
58
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
59
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
60
|
+
dispatchEvent(event: Event): boolean;
|
|
61
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
62
|
+
};
|
|
63
|
+
config: BaseConfig;
|
|
64
|
+
readonly $isBase: true;
|
|
65
|
+
$factory(nameOrSelector: string): Base<BaseTypeParameter>[];
|
|
66
|
+
};
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { BaseTypeParameter, BaseConstructor, Managers } from '../Base/index.js';
|
|
2
|
+
import ResponsiveOptionsManager from '../Base/managers/ResponsiveOptionsManager.js';
|
|
3
|
+
/**
|
|
4
|
+
* Extends the configuration of an existing class.
|
|
5
|
+
*/
|
|
6
|
+
export default function withResponsiveOptions<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: BaseConstructor): {
|
|
7
|
+
new <U extends BaseTypeParameters = BaseTypeParameter>(element: HTMLElement): {
|
|
8
|
+
/**
|
|
9
|
+
* Get managers.
|
|
10
|
+
*/
|
|
11
|
+
readonly __managers: Managers & {
|
|
12
|
+
OptionsManager: typeof ResponsiveOptionsManager;
|
|
13
|
+
};
|
|
14
|
+
$parent: import("../Base/index.js").default<BaseTypeParameter>;
|
|
15
|
+
$id: string;
|
|
16
|
+
$el: (U & T)["$el"] & HTMLElement & {
|
|
17
|
+
__base__?: WeakMap<typeof import("../Base/index.js").default, import("../Base/index.js").default<BaseTypeParameter> | "terminated">;
|
|
18
|
+
};
|
|
19
|
+
$isMounted: boolean;
|
|
20
|
+
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
21
|
+
readonly $root: import("../Base/index.js").default<BaseTypeParameter>;
|
|
22
|
+
readonly __config: import("../Base/index.js").BaseConfig;
|
|
23
|
+
__services: import("../Base/managers/ServicesManager.js").default;
|
|
24
|
+
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
25
|
+
__refs: import("../Base/managers/RefsManager.js").default & (U & T)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
26
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & (U & T)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
27
|
+
__options: import("../Base/managers/OptionsManager.js").default & (U & T)["$options"] & import("../Base/index.js").BaseOptions;
|
|
28
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & (U & T)["$options"] & import("../Base/index.js").BaseOptions;
|
|
29
|
+
__children: import("../Base/managers/ChildrenManager.js").default & ((U & T)["$children"] extends infer T_1 ? { [key in keyof T_1]: (U & T)["$children"][key][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
30
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & ((U & T)["$children"] extends infer T_2 ? { [key_1 in keyof T_2]: (U & T)["$children"][key_1][]; } : never) & import("../Base/index.js").BaseChildren;
|
|
31
|
+
__events: import("../Base/managers/EventsManager.js").default;
|
|
32
|
+
readonly $log: (...args: any) => void;
|
|
33
|
+
readonly __debug: (...args: any) => void;
|
|
34
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
35
|
+
__hasEvent(event: string): boolean;
|
|
36
|
+
$mount(): any;
|
|
37
|
+
$update(): any;
|
|
38
|
+
$destroy(): any;
|
|
39
|
+
$terminate(): void;
|
|
40
|
+
__addEmits(event: string): void;
|
|
41
|
+
__removeEmits(event: string): void;
|
|
42
|
+
readonly __ctor: typeof import("../Base/index.js").default;
|
|
43
|
+
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
44
|
+
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
45
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
46
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
47
|
+
dispatchEvent(event: Event): boolean;
|
|
48
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
49
|
+
};
|
|
50
|
+
readonly $isBase: true;
|
|
51
|
+
config: import("../Base/index.js").BaseConfig;
|
|
52
|
+
$factory(nameOrSelector: string): import("../Base/index.js").default<BaseTypeParameter>[];
|
|
53
|
+
};
|