@studiometa/js-toolkit 2.4.1 → 2.4.4-alpha.0
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 +10 -3
- package/Base/index.js +6 -2
- package/Base/managers/AbstractManager.cjs +13 -8
- package/Base/managers/AbstractManager.js +13 -8
- package/Base/managers/ChildrenManager.cjs +10 -3
- package/Base/managers/ChildrenManager.js +6 -2
- package/Base/managers/EventsManager.cjs +17 -4
- package/Base/managers/EventsManager.js +13 -3
- package/Base/managers/OptionsManager.cjs +18 -5
- package/Base/managers/OptionsManager.js +14 -4
- package/Base/managers/RefsManager.cjs +17 -4
- package/Base/managers/RefsManager.js +13 -3
- package/Base/managers/ResponsiveOptionsManager.cjs +4 -1
- package/Base/managers/ServicesManager.cjs +12 -5
- package/Base/managers/ServicesManager.js +8 -4
- package/Base/utils.cjs +5 -1
- package/Base/utils.js +5 -1
- package/decorators/index.cjs +5 -2
- package/decorators/withBreakpointManager.cjs +6 -4
- package/decorators/withBreakpointManager.js +1 -2
- package/decorators/withBreakpointObserver.cjs +12 -5
- package/decorators/withBreakpointObserver.js +7 -3
- package/decorators/withDrag.cjs +9 -3
- package/decorators/withDrag.js +4 -1
- package/decorators/withExtraConfig.cjs +5 -2
- package/decorators/withFreezedOptions.cjs +9 -7
- package/decorators/withFreezedOptions.js +8 -6
- package/decorators/withIntersectionObserver.cjs +11 -7
- package/decorators/withIntersectionObserver.js +10 -6
- package/decorators/withMountWhenInView.cjs +14 -11
- package/decorators/withMountWhenInView.js +13 -10
- package/decorators/withResponsiveOptions.cjs +6 -3
- package/decorators/withResponsiveOptions.js +1 -1
- package/decorators/withScrolledInView.cjs +77 -25
- package/decorators/withScrolledInView.js +72 -23
- package/decorators/withVue2.cjs +4 -4
- package/decorators/withVue2.js +3 -3
- package/helpers/importWhenIdle.cjs +8 -5
- package/helpers/importWhenIdle.js +8 -5
- package/helpers/index.cjs +4 -1
- package/index.cjs +5 -2
- package/package.json +2 -2
- package/services/drag.cjs +4 -1
- package/services/index.cjs +4 -1
- package/services/index.d.ts +7 -0
- package/services/key.cjs +4 -1
- package/services/resize.cjs +4 -1
- package/services/scroll.cjs +4 -1
- package/utils/collide/index.cjs +4 -1
- package/utils/css/animate.cjs +24 -13
- package/utils/css/animate.js +20 -12
- package/utils/css/index.cjs +4 -1
- package/utils/css/transition.cjs +4 -4
- package/utils/css/transition.js +0 -3
- package/utils/focusTrap.cjs +4 -1
- package/utils/history.cjs +4 -1
- package/utils/history.js +4 -1
- package/utils/index.cjs +4 -1
- package/utils/math/clamp01.cjs +4 -1
- package/utils/math/index.cjs +4 -1
- package/utils/math/inertiaFinalValue.cjs +4 -1
- package/utils/nextTick.cjs +5 -3
- package/utils/nextTick.js +5 -3
- package/utils/object/autoBind.cjs +4 -1
- package/utils/object/index.cjs +4 -1
- package/utils/scrollTo.cjs +4 -1
- package/utils/string/index.cjs +4 -1
- package/utils/string/withLeadingCharacters.cjs +4 -1
- package/utils/string/withLeadingSlash.cjs +4 -1
- package/utils/string/withTrailingCharacters.cjs +4 -1
- package/utils/string/withTrailingSlash.cjs +4 -1
- package/utils/string/withoutLeadingCharactersRecursive.cjs +4 -1
- package/utils/string/withoutLeadingSlash.cjs +4 -1
- package/utils/string/withoutTrailingCharactersRecursive.cjs +4 -1
- package/utils/string/withoutTrailingSlash.cjs +4 -1
- package/utils/tween.cjs +4 -1
- package/Base/index.d.ts +0 -290
- package/Base/managers/AbstractManager.d.ts +0 -44
- package/Base/managers/ChildrenManager.d.ts +0 -41
- package/Base/managers/EventsManager.d.ts +0 -112
- package/Base/managers/OptionsManager.d.ts +0 -87
- package/Base/managers/RefsManager.d.ts +0 -32
- package/Base/managers/ResponsiveOptionsManager.d.ts +0 -26
- package/Base/managers/ServicesManager.d.ts +0 -109
- package/Base/utils.d.ts +0 -40
- package/decorators/index.d.ts +0 -10
- package/decorators/withBreakpointManager.d.ts +0 -10
- package/decorators/withBreakpointObserver.d.ts +0 -17
- package/decorators/withDrag.d.ts +0 -23
- package/decorators/withExtraConfig.d.ts +0 -18
- package/decorators/withFreezedOptions.d.ts +0 -14
- package/decorators/withIntersectionObserver.d.ts +0 -23
- package/decorators/withMountWhenInView.d.ts +0 -33
- package/decorators/withResponsiveOptions.d.ts +0 -8
- package/decorators/withScrolledInView.d.ts +0 -19
- package/decorators/withVue2.d.ts +0 -7
- package/helpers/createApp.d.ts +0 -14
- package/helpers/getDirectChildren.d.ts +0 -24
- package/helpers/getInstanceFromElement.d.ts +0 -14
- package/helpers/importOnInteraction.d.ts +0 -23
- package/helpers/importWhenIdle.d.ts +0 -21
- package/helpers/importWhenVisible.d.ts +0 -23
- package/helpers/index.d.ts +0 -6
- package/helpers/utils.d.ts +0 -10
- package/index.d.ts +0 -4
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {typeof SERVICES_MAP & Record<string, () => ServiceInterface>} Services
|
|
3
|
-
* @typedef {keyof SERVICES_MAP|string} ServiceName
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Services management for the Base class.
|
|
7
|
-
*
|
|
8
|
-
* @todo Add support for disabled services on mount when the method is defined.
|
|
9
|
-
*/
|
|
10
|
-
export default class ServicesManager extends AbstractManager {
|
|
11
|
-
/**
|
|
12
|
-
* @type {Record<string, () => ServiceInterface>}
|
|
13
|
-
*/
|
|
14
|
-
__customServices: Record<string, () => ServiceInterface>;
|
|
15
|
-
/**
|
|
16
|
-
* @returns {Record<string, () => ServiceInterface>}
|
|
17
|
-
*/
|
|
18
|
-
get __services(): Record<string, () => ServiceInterface>;
|
|
19
|
-
/**
|
|
20
|
-
* Test if the given service is registered.
|
|
21
|
-
*
|
|
22
|
-
* @param {ServiceName} service The name of the service.
|
|
23
|
-
* @returns {boolean}
|
|
24
|
-
*/
|
|
25
|
-
has(service: ServiceName): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Get a service props by name.
|
|
28
|
-
* @param {ServiceName} service The name of the service.
|
|
29
|
-
* @returns {ReturnType<ServiceInterface['props']>}
|
|
30
|
-
*/
|
|
31
|
-
get(service: ServiceName): ReturnType<ServiceInterface['props']>;
|
|
32
|
-
/**
|
|
33
|
-
* Init the given service and bind it to the given instance.
|
|
34
|
-
*
|
|
35
|
-
* @param {ServiceName} service The name of the service.
|
|
36
|
-
* @returns {() => void} A function to unbind the service.
|
|
37
|
-
*/
|
|
38
|
-
enable(service: ServiceName): () => void;
|
|
39
|
-
/**
|
|
40
|
-
* Enable all services and return methods to disable them.
|
|
41
|
-
*
|
|
42
|
-
* @returns {Function[]}
|
|
43
|
-
*/
|
|
44
|
-
enableAll(): Function[];
|
|
45
|
-
/**
|
|
46
|
-
* Disable all services.
|
|
47
|
-
*
|
|
48
|
-
* @returns {void}
|
|
49
|
-
*/
|
|
50
|
-
disableAll(): void;
|
|
51
|
-
/**
|
|
52
|
-
* Disable a service.
|
|
53
|
-
*
|
|
54
|
-
* @param {string} service The name of the service.
|
|
55
|
-
* @returns {void}
|
|
56
|
-
*/
|
|
57
|
-
disable(service: string): void;
|
|
58
|
-
/**
|
|
59
|
-
* Toggle a service.
|
|
60
|
-
* @param {string} service The name of the service.
|
|
61
|
-
* @param {boolean} [force] The state to force.
|
|
62
|
-
* @returns {void}
|
|
63
|
-
*/
|
|
64
|
-
toggle(service: string, force?: boolean): void;
|
|
65
|
-
/**
|
|
66
|
-
* Register a new service to be enabled/disabled.
|
|
67
|
-
*
|
|
68
|
-
* @param {string} name
|
|
69
|
-
* The name of the service hook.
|
|
70
|
-
* @param {() => ServiceInterface} useFunction
|
|
71
|
-
* The `use...` function for the service.
|
|
72
|
-
*/
|
|
73
|
-
register(name: string, useFunction: () => ServiceInterface): void;
|
|
74
|
-
/**
|
|
75
|
-
* Unregister a new service to be enabled disabled.
|
|
76
|
-
*
|
|
77
|
-
* @param {string} name
|
|
78
|
-
* The name of the service hook.
|
|
79
|
-
*/
|
|
80
|
-
unregister(name: string): void;
|
|
81
|
-
}
|
|
82
|
-
export type Base = import('../index').default;
|
|
83
|
-
export type BaseConstructor = import('../index').BaseConstructor;
|
|
84
|
-
export type ServiceInterface = import('../../services').ServiceInterface<any>;
|
|
85
|
-
export type Services = typeof SERVICES_MAP & Record<string, () => ServiceInterface>;
|
|
86
|
-
export type ServiceName = keyof {
|
|
87
|
-
scrolled: typeof useScroll;
|
|
88
|
-
resized: typeof useResize;
|
|
89
|
-
ticked: typeof useRaf;
|
|
90
|
-
moved: typeof usePointer;
|
|
91
|
-
keyed: typeof useKey;
|
|
92
|
-
loaded: typeof useLoad;
|
|
93
|
-
} | string;
|
|
94
|
-
import AbstractManager from "./AbstractManager.js";
|
|
95
|
-
declare namespace SERVICES_MAP {
|
|
96
|
-
export { useScroll as scrolled };
|
|
97
|
-
export { useResize as resized };
|
|
98
|
-
export { useRaf as ticked };
|
|
99
|
-
export { usePointer as moved };
|
|
100
|
-
export { useKey as keyed };
|
|
101
|
-
export { useLoad as loaded };
|
|
102
|
-
}
|
|
103
|
-
import useScroll from "../../services/scroll.js";
|
|
104
|
-
import useResize from "../../services/resize.js";
|
|
105
|
-
import useRaf from "../../services/raf.js";
|
|
106
|
-
import usePointer from "../../services/pointer.js";
|
|
107
|
-
import useKey from "../../services/key.js";
|
|
108
|
-
import useLoad from "../../services/load.js";
|
|
109
|
-
export {};
|
package/Base/utils.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
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;
|
package/decorators/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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";
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BreakpointManager class.
|
|
3
|
-
* @template {BaseConstructor} T
|
|
4
|
-
* @param {T} BaseClass
|
|
5
|
-
* @param {Array<[string, BaseConstructor]>} breakpoints
|
|
6
|
-
* @returns {T}
|
|
7
|
-
*/
|
|
8
|
-
export default function withBreakpointManager<T extends typeof import("../Base").default>(BaseClass: T, breakpoints: Array<[string, BaseConstructor]>): T;
|
|
9
|
-
export type Base = import('../Base').default;
|
|
10
|
-
export type BaseConstructor = import('../Base').BaseConstructor;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BreakpointObserver class.
|
|
3
|
-
*
|
|
4
|
-
* @template {BaseConstructor} T
|
|
5
|
-
* @param {T} BaseClass The Base class to extend from.
|
|
6
|
-
* @returns {T}
|
|
7
|
-
*/
|
|
8
|
-
export default function withBreakpointObserver<T extends typeof import("../Base").default>(BaseClass: T): T;
|
|
9
|
-
export type Base = import('../Base').default;
|
|
10
|
-
export type BaseConstructor = import('../Base').BaseConstructor;
|
|
11
|
-
export type WithBreakpointObserverOptions = {
|
|
12
|
-
activeBreakpoints?: string;
|
|
13
|
-
inactiveBreakpoints?: string;
|
|
14
|
-
};
|
|
15
|
-
export type WithBreakpointObserverInterface = {
|
|
16
|
-
$options: WithBreakpointObserverOptions;
|
|
17
|
-
};
|
package/decorators/withDrag.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../Base').default} Base
|
|
3
|
-
* @typedef {import('../Base').BaseConstructor} BaseConstructor
|
|
4
|
-
* @typedef {import('../services/drag').DragServiceOptions} DragServiceOptions
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* @typedef {DragServiceOptions & { target?: (this:Base, Base) => HTMLElement }} DragDecoratorOptions
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Add dragging capabilities to a component.
|
|
11
|
-
*
|
|
12
|
-
* @template {BaseConstructor} T
|
|
13
|
-
* @param {T} BaseClass
|
|
14
|
-
* @param {DragDecoratorOptions} options
|
|
15
|
-
* @returns {T}
|
|
16
|
-
*/
|
|
17
|
-
export default function withDrag<T extends typeof import("../Base").default>(BaseClass: T, { target, ...options }?: DragDecoratorOptions): T;
|
|
18
|
-
export type Base = import('../Base').default;
|
|
19
|
-
export type BaseConstructor = import('../Base').BaseConstructor;
|
|
20
|
-
export type DragServiceOptions = import('../services/drag').DragServiceOptions;
|
|
21
|
-
export type DragDecoratorOptions = import("../services/drag.js").DragServiceOptions & {
|
|
22
|
-
target?: (this: import("../Base").default, Base: any) => HTMLElement;
|
|
23
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('deepmerge').Options} DeepmergeOptions
|
|
3
|
-
* @typedef {import('../Base').BaseConfig} BaseConfig
|
|
4
|
-
* @typedef {import('../Base').BaseConstructor} BaseConstructor
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Extends the configuration of an existing class.
|
|
8
|
-
*
|
|
9
|
-
* @template {BaseConstructor} T
|
|
10
|
-
* @param {T} BaseClass The Base class to extend.
|
|
11
|
-
* @param {Partial<BaseConfig>} config Extra configuration to merge.
|
|
12
|
-
* @param {DeepmergeOptions} options Options for the `deepmerge` function. {@link https://github.com/TehShrike/deepmerge#options}
|
|
13
|
-
* @returns {T}
|
|
14
|
-
*/
|
|
15
|
-
export default function withExtraConfig<T extends typeof import("../Base").default>(BaseClass: T, config: Partial<BaseConfig>, options?: DeepmergeOptions): T;
|
|
16
|
-
export type DeepmergeOptions = import('deepmerge').Options;
|
|
17
|
-
export type BaseConfig = import('../Base').BaseConfig;
|
|
18
|
-
export type BaseConstructor = import('../Base').BaseConstructor;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../Base').BaseOptions} BaseOptions
|
|
3
|
-
* @typedef {import('../Base').BaseConstructor} BaseConstructor
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Freeze the `$options` property to improve performance.
|
|
7
|
-
*
|
|
8
|
-
* @template {BaseConstructor} T
|
|
9
|
-
* @param {T} BaseClass The Base class to extend.
|
|
10
|
-
* @returns {T}
|
|
11
|
-
*/
|
|
12
|
-
export default function withFreezedOptions<T extends typeof import("../Base").default>(BaseClass: T): T;
|
|
13
|
-
export type BaseOptions = import('../Base').BaseOptions;
|
|
14
|
-
export type BaseConstructor = import('../Base').BaseConstructor;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* IntersectionObserver decoration.
|
|
3
|
-
*
|
|
4
|
-
* @template {BaseConstructor} T
|
|
5
|
-
* @param {T} BaseClass The Base class to extend.
|
|
6
|
-
* @param {Object} [defaultOptions] The options for the IntersectionObserver instance.
|
|
7
|
-
* @returns {T & { new: (element:HTMLElement) => { $observer: IntersectionObserver }}}
|
|
8
|
-
*/
|
|
9
|
-
export default function withIntersectionObserver<T extends typeof import("../Base").default>(BaseClass: T, defaultOptions?: any): T & {
|
|
10
|
-
new: (element: HTMLElement) => {
|
|
11
|
-
$observer: IntersectionObserver;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export type Base = import('../Base').default;
|
|
15
|
-
export type BaseConstructor = import('../Base').BaseConstructor;
|
|
16
|
-
export type WithIntersectionObserverOptions = {
|
|
17
|
-
intersectionObserver: any;
|
|
18
|
-
};
|
|
19
|
-
export type WithIntersectionObserverInterface = {
|
|
20
|
-
$options: WithIntersectionObserverOptions;
|
|
21
|
-
$observer: IntersectionObserver;
|
|
22
|
-
intersected: (entries: IntersectionObserverEntry[]) => void;
|
|
23
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../Base').default} Base
|
|
3
|
-
* @typedef {import('../Base').BaseOptions} BaseOptions
|
|
4
|
-
* @typedef {import('../Base').BaseConstructor} BaseConstructor
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* @typedef {Object} WithMountWhenInViewOptions
|
|
8
|
-
* @property {IntersectionObserverInit} intersectionObserver
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* @typedef {Object} WithMountWhenInViewInterface
|
|
12
|
-
* @property {() => void} terminated
|
|
13
|
-
* @property {WithMountWhenInViewOptions & BaseOptions} $options
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* IntersectionObserver decoration.
|
|
17
|
-
*
|
|
18
|
-
* @template {BaseConstructor} T
|
|
19
|
-
* @param {T} BaseClass The Base class to extend.
|
|
20
|
-
* @param {IntersectionObserverInit} [defaultOptions] The options for the IntersectionObserver instance.
|
|
21
|
-
* @returns {T}
|
|
22
|
-
*/
|
|
23
|
-
export default function withMountWhenInView<T extends typeof import("../Base").default>(BaseClass: T, defaultOptions?: IntersectionObserverInit): T;
|
|
24
|
-
export type Base = import('../Base').default;
|
|
25
|
-
export type BaseOptions = import('../Base').BaseOptions;
|
|
26
|
-
export type BaseConstructor = import('../Base').BaseConstructor;
|
|
27
|
-
export type WithMountWhenInViewOptions = {
|
|
28
|
-
intersectionObserver: IntersectionObserverInit;
|
|
29
|
-
};
|
|
30
|
-
export type WithMountWhenInViewInterface = {
|
|
31
|
-
terminated: () => void;
|
|
32
|
-
$options: WithMountWhenInViewOptions & BaseOptions;
|
|
33
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extends the configuration of an existing class.
|
|
3
|
-
*
|
|
4
|
-
* @template {import('../Base').BaseConstructor} T
|
|
5
|
-
* @param {T} BaseClass The Base class to extend.
|
|
6
|
-
* @returns {T}
|
|
7
|
-
*/
|
|
8
|
-
export default function withResponsiveOptions<T extends typeof import("../Base").default>(BaseClass: T): T;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../Base').default} Base
|
|
3
|
-
* @typedef {import('../Base').BaseConstructor} BaseConstructor
|
|
4
|
-
* @typedef {import('../Base').BaseConfig} BaseConfig
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Add scrolled in view capabilities to a component.
|
|
8
|
-
*
|
|
9
|
-
* @template {BaseConstructor} T
|
|
10
|
-
* @param {T} BaseClass
|
|
11
|
-
* @param {IntersectionObserverInit & { useOffsetSizes?: boolean }} options
|
|
12
|
-
* @returns {T}
|
|
13
|
-
*/
|
|
14
|
-
export default function withScrolledInView<T extends typeof import("../Base").default>(BaseClass: T, options?: IntersectionObserverInit & {
|
|
15
|
-
useOffsetSizes?: boolean;
|
|
16
|
-
}): T;
|
|
17
|
-
export type Base = import('../Base').default;
|
|
18
|
-
export type BaseConstructor = import('../Base').BaseConstructor;
|
|
19
|
-
export type BaseConfig = import('../Base').BaseConfig;
|
package/decorators/withVue2.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare function _default<T extends typeof import("../Base").default>(BaseClass: T, Vue: import('vue').VueConstructor): T;
|
|
2
|
-
export default _default;
|
|
3
|
-
export type Base = import('../Base').default;
|
|
4
|
-
export type BaseConstructor = import('../Base').BaseConstructor;
|
|
5
|
-
export type WithVue2Refs = {
|
|
6
|
-
vue: HTMLElement;
|
|
7
|
-
};
|
package/helpers/createApp.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../Base/index.js').BaseConstructor} BaseConstructor
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Instantiate and mount the given component on the given root element when the page has been loaded
|
|
6
|
-
* and return a function to use the app instance when it is ready.
|
|
7
|
-
*
|
|
8
|
-
* @template {BaseConstructor} T
|
|
9
|
-
* @param {T} App
|
|
10
|
-
* @param {HTMLElement} [rootElement]
|
|
11
|
-
* @returns {() => Promise<InstanceType<T>>}
|
|
12
|
-
*/
|
|
13
|
-
export default function createApp<T extends typeof import("../Base/index.js").default>(App: T, rootElement?: HTMLElement): () => Promise<InstanceType<T>>;
|
|
14
|
-
export type BaseConstructor = import('../Base/index.js').BaseConstructor;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../Base/index.js').default} Base
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Get direct children from a parent when working with nested components.
|
|
6
|
-
*
|
|
7
|
-
* @template {Base} T
|
|
8
|
-
* @param {Base} parentInstance
|
|
9
|
-
* @param {string} parentName
|
|
10
|
-
* @param {string} childrenName
|
|
11
|
-
* @returns {Array<T>}
|
|
12
|
-
*/
|
|
13
|
-
export function getDirectChildren<T extends import("../Base/index.js").default>(parentInstance: Base, parentName: string, childrenName: string): T[];
|
|
14
|
-
/**
|
|
15
|
-
* Test if a component instance is a direct child from the given component.
|
|
16
|
-
*
|
|
17
|
-
* @param {Base} parentInstance
|
|
18
|
-
* @param {string} parentName
|
|
19
|
-
* @param {string} childrenName
|
|
20
|
-
* @param {Base} childInstance
|
|
21
|
-
* @returns {boolean}
|
|
22
|
-
*/
|
|
23
|
-
export function isDirectChild(parentInstance: Base, parentName: string, childrenName: string, childInstance: Base): boolean;
|
|
24
|
-
export type Base = import('../Base/index.js').default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../Base/index.js').BaseConstructor} BaseConstructor
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Get a component instance from a DOM element.
|
|
6
|
-
* @template {BaseConstructor} T
|
|
7
|
-
* @param {HTMLElement & { __base__?: WeakMap<T, InstanceType<T>> }} element
|
|
8
|
-
* @param {T} Constructor
|
|
9
|
-
* @returns {null|InstanceType<T>}
|
|
10
|
-
*/
|
|
11
|
-
export default function getInstanceFromElement<T extends typeof import("../Base/index.js").default>(element: HTMLElement & {
|
|
12
|
-
__base__?: WeakMap<T, InstanceType<T>>;
|
|
13
|
-
}, Constructor: T): InstanceType<T>;
|
|
14
|
-
export type BaseConstructor = import('../Base/index.js').BaseConstructor;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../Base/index.js').BaseConstructor} BaseConstructor
|
|
3
|
-
* @typedef {import('../Base/index.js').default} Base
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Import a component on an interaction.
|
|
7
|
-
*
|
|
8
|
-
* @template {BaseConstructor} T
|
|
9
|
-
* @param {() => Promise<T|{default:T}>} fn
|
|
10
|
-
* The import function.
|
|
11
|
-
* @param {string|HTMLElement|HTMLElement[]} nameOrSelectorOrElement
|
|
12
|
-
* The name or selector for the component.
|
|
13
|
-
* @param {string|string[]} events
|
|
14
|
-
* The events to listen to to trigger the import.
|
|
15
|
-
* @param {Base} [parent]
|
|
16
|
-
* The parent component.
|
|
17
|
-
* @returns {Promise<T>}
|
|
18
|
-
*/
|
|
19
|
-
export default function importOnInteraction<T extends typeof import("../Base/index.js").default>(fn: () => Promise<T | {
|
|
20
|
-
default: T;
|
|
21
|
-
}>, nameOrSelectorOrElement: string | HTMLElement | HTMLElement[], events: string | string[], parent?: Base): Promise<T>;
|
|
22
|
-
export type BaseConstructor = import('../Base/index.js').BaseConstructor;
|
|
23
|
-
export type Base = import('../Base/index.js').default;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../Base/index.js').BaseConstructor} BaseConstructor
|
|
3
|
-
* @typedef {{ timeout?: number }} ImportWhenIdleOptions
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Import a component when user is idle.
|
|
7
|
-
*
|
|
8
|
-
* @template {BaseConstructor} T
|
|
9
|
-
* @param {() => Promise<T|{default:T}>} fn
|
|
10
|
-
* The import function.
|
|
11
|
-
* @param {ImportWhenIdleOptions} [options]
|
|
12
|
-
* The time to wait before triggering the callback if never idle.
|
|
13
|
-
* @returns {Promise<T>}
|
|
14
|
-
*/
|
|
15
|
-
export default function importWhenIdle<T extends typeof import("../Base/index.js").default>(fn: () => Promise<T | {
|
|
16
|
-
default: T;
|
|
17
|
-
}>, options?: ImportWhenIdleOptions): Promise<T>;
|
|
18
|
-
export type BaseConstructor = import('../Base/index.js').BaseConstructor;
|
|
19
|
-
export type ImportWhenIdleOptions = {
|
|
20
|
-
timeout?: number;
|
|
21
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../Base/index.js').default} Base
|
|
3
|
-
* @typedef {import('../Base/index.js').BaseConstructor} BaseConstructor
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Import a component when it is visible.
|
|
7
|
-
*
|
|
8
|
-
* @template {BaseConstructor} T
|
|
9
|
-
* @param {() => Promise<T|{default:T}>} fn
|
|
10
|
-
* The import function.
|
|
11
|
-
* @param {string|HTMLElement|HTMLElement[]} nameOrSelectorOrElement
|
|
12
|
-
* The name or selector for the component.
|
|
13
|
-
* @param {Base} [parent]
|
|
14
|
-
* The parent component.
|
|
15
|
-
* @param {IntersectionObserverInit} [observerOptions]
|
|
16
|
-
* Options for the `IntersectionObserver` instance.
|
|
17
|
-
* @returns {Promise<T>}
|
|
18
|
-
*/
|
|
19
|
-
export default function importWhenVisible<T extends typeof import("../Base/index.js").default>(fn: () => Promise<T | {
|
|
20
|
-
default: T;
|
|
21
|
-
}>, nameOrSelectorOrElement: string | HTMLElement | HTMLElement[], parent?: Base, observerOptions?: IntersectionObserverInit): Promise<T>;
|
|
22
|
-
export type Base = import('../Base/index.js').default;
|
|
23
|
-
export type BaseConstructor = import('../Base/index.js').BaseConstructor;
|
package/helpers/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { default as createApp } from "./createApp.js";
|
|
2
|
-
export * from "./getDirectChildren.js";
|
|
3
|
-
export { default as getInstanceFromElement } from "./getInstanceFromElement.js";
|
|
4
|
-
export { default as importOnInteraction } from "./importOnInteraction.js";
|
|
5
|
-
export { default as importWhenIdle } from "./importWhenIdle.js";
|
|
6
|
-
export { default as importWhenVisible } from "./importWhenVisible.js";
|
package/helpers/utils.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get the target elements for the lazy import helper functions.
|
|
3
|
-
*
|
|
4
|
-
* @param {string|HTMLElement|HTMLElement[]} nameOrSelectorOrElement
|
|
5
|
-
* The original selector or element, or list of elements.
|
|
6
|
-
* @param {HTMLElement} [context]
|
|
7
|
-
* The optional context to use to query for elements.
|
|
8
|
-
* @returns {HTMLElement[]} A normalized list of elements.
|
|
9
|
-
*/
|
|
10
|
-
export function getTargetElements(nameOrSelectorOrElement: string | HTMLElement | HTMLElement[], context?: HTMLElement): HTMLElement[];
|
package/index.d.ts
DELETED