@studiometa/js-toolkit 2.4.4-alpha.1 → 2.4.4-alpha.4
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 +78 -218
- 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/types.cjs +18 -0
- package/Base/types.d.ts +43 -0
- package/Base/types.js +0 -0
- package/Base/utils.cjs +1 -1
- package/Base/utils.d.ts +5 -21
- package/decorators/index.cjs +2 -0
- package/decorators/index.d.ts +1 -0
- package/decorators/index.js +4 -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 +5 -4
- package/decorators/withScrolledInView.d.ts +219 -79
- package/decorators/withScrolledInView.js +5 -4
- 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 +5 -10
- 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 +2 -1
- package/index.js +2 -2
- package/package.json +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.cjs
CHANGED
|
@@ -16,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
18
|
|
|
19
|
-
// packages/js-toolkit/Base/utils.
|
|
19
|
+
// packages/js-toolkit/Base/utils.ts
|
|
20
20
|
var utils_exports = {};
|
|
21
21
|
__export(utils_exports, {
|
|
22
22
|
eventIsDefinedInConfig: () => eventIsDefinedInConfig,
|
package/Base/utils.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @typedef {import('./index.js').default} Base
|
|
3
|
-
*/
|
|
1
|
+
import type { Base, BaseConfig } from './index.js';
|
|
4
2
|
/**
|
|
5
3
|
* Get a list of elements based on the name of a component.
|
|
6
4
|
*
|
|
@@ -11,30 +9,16 @@
|
|
|
11
9
|
* @returns {Array<HTMLElement>}
|
|
12
10
|
* A list of elements on which the component should be mounted.
|
|
13
11
|
*/
|
|
14
|
-
export function getComponentElements(nameOrSelector: string, element?: HTMLElement | Document):
|
|
12
|
+
export declare function getComponentElements(nameOrSelector: string, element?: HTMLElement | Document): HTMLElement[];
|
|
15
13
|
/**
|
|
16
14
|
* 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
15
|
*/
|
|
22
|
-
export function eventIsDefinedInConfig(event: string, config:
|
|
16
|
+
export declare function eventIsDefinedInConfig(event: string, config: BaseConfig): boolean;
|
|
23
17
|
/**
|
|
24
18
|
* Test if an event can be used on the given element.
|
|
25
|
-
*
|
|
26
|
-
* @param {string} event
|
|
27
|
-
* @param {HTMLElement} element
|
|
28
|
-
* @returns {boolean}
|
|
29
19
|
*/
|
|
30
|
-
export function eventIsNative(event: string, element: HTMLElement): boolean;
|
|
20
|
+
export declare function eventIsNative(event: string, element: HTMLElement): boolean;
|
|
31
21
|
/**
|
|
32
22
|
* 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
23
|
*/
|
|
39
|
-
export function getEventTarget(instance: Base, event: string, config:
|
|
40
|
-
export type Base = import('./index.js').default;
|
|
24
|
+
export declare function getEventTarget(instance: Base, event: string, config: BaseConfig): Base | Base['$el'];
|
package/decorators/index.cjs
CHANGED
|
@@ -34,6 +34,7 @@ __export(decorators_exports, {
|
|
|
34
34
|
withMountWhenInView: () => import_withMountWhenInView.default,
|
|
35
35
|
withResponsiveOptions: () => import_withResponsiveOptions.default,
|
|
36
36
|
withScrolledInView: () => import_withScrolledInView.default,
|
|
37
|
+
withType: () => import_withType.default,
|
|
37
38
|
withVue2: () => import_withVue2.default
|
|
38
39
|
});
|
|
39
40
|
module.exports = __toCommonJS(decorators_exports);
|
|
@@ -46,5 +47,6 @@ var import_withIntersectionObserver = __toESM(require("./withIntersectionObserve
|
|
|
46
47
|
var import_withMountWhenInView = __toESM(require("./withMountWhenInView.cjs"), 1);
|
|
47
48
|
var import_withResponsiveOptions = __toESM(require("./withResponsiveOptions.cjs"), 1);
|
|
48
49
|
var import_withScrolledInView = __toESM(require("./withScrolledInView.cjs"), 1);
|
|
50
|
+
var import_withType = __toESM(require("./withType.cjs"), 1);
|
|
49
51
|
var import_withVue2 = __toESM(require("./withVue2.cjs"), 1);
|
|
50
52
|
if (module.exports.default) module.exports = module.exports.default;
|
package/decorators/index.d.ts
CHANGED
|
@@ -7,4 +7,5 @@ export { default as withIntersectionObserver } from './withIntersectionObserver.
|
|
|
7
7
|
export { default as withMountWhenInView } from './withMountWhenInView.js';
|
|
8
8
|
export { default as withResponsiveOptions } from './withResponsiveOptions.js';
|
|
9
9
|
export { default as withScrolledInView } from './withScrolledInView.js';
|
|
10
|
+
export { default as withType } from './withType.js';
|
|
10
11
|
export { default as withVue2 } from './withVue2.js';
|
package/decorators/index.js
CHANGED
|
@@ -7,7 +7,8 @@ import { default as default7 } from "./withIntersectionObserver.js";
|
|
|
7
7
|
import { default as default8 } from "./withMountWhenInView.js";
|
|
8
8
|
import { default as default9 } from "./withResponsiveOptions.js";
|
|
9
9
|
import { default as default10 } from "./withScrolledInView.js";
|
|
10
|
-
import { default as default11 } from "./
|
|
10
|
+
import { default as default11 } from "./withType.js";
|
|
11
|
+
import { default as default12 } from "./withVue2.js";
|
|
11
12
|
export {
|
|
12
13
|
default2 as withBreakpointManager,
|
|
13
14
|
default3 as withBreakpointObserver,
|
|
@@ -18,5 +19,6 @@ export {
|
|
|
18
19
|
default8 as withMountWhenInView,
|
|
19
20
|
default9 as withResponsiveOptions,
|
|
20
21
|
default10 as withScrolledInView,
|
|
21
|
-
default11 as
|
|
22
|
+
default11 as withType,
|
|
23
|
+
default12 as withVue2
|
|
22
24
|
};
|
|
@@ -68,7 +68,7 @@ function withBreakpointManager(BaseClass, breakpoints) {
|
|
|
68
68
|
}
|
|
69
69
|
return BaseClass;
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
class WithBreakpointManager extends BaseClass {
|
|
72
72
|
constructor(element) {
|
|
73
73
|
super(element);
|
|
74
74
|
if (!instances.has(this)) {
|
|
@@ -91,6 +91,7 @@ function withBreakpointManager(BaseClass, breakpoints) {
|
|
|
91
91
|
}
|
|
92
92
|
return super.$destroy();
|
|
93
93
|
}
|
|
94
|
-
}
|
|
94
|
+
}
|
|
95
|
+
return WithBreakpointManager;
|
|
95
96
|
}
|
|
96
97
|
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -1,87 +1,5 @@
|
|
|
1
|
-
import type Base from '../Base/index.js';
|
|
2
|
-
import type { BaseConstructor, BaseTypeParameter } from '../Base/index.js';
|
|
1
|
+
import type { Base, BaseConstructor, BaseTypeParameter } from '../Base/index.js';
|
|
3
2
|
/**
|
|
4
3
|
* BreakpointManager class.
|
|
5
4
|
*/
|
|
6
|
-
export default function withBreakpointManager<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass:
|
|
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<{
|
|
22
|
-
$el: HTMLElement;
|
|
23
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
24
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
25
|
-
$children: {
|
|
26
|
-
[name: string]: Base<any> | Promise<Base<any>>;
|
|
27
|
-
};
|
|
28
|
-
}>;
|
|
29
|
-
$id: string;
|
|
30
|
-
$el: (T & U)["$el"] & HTMLElement & {
|
|
31
|
-
__base__?: WeakMap<typeof Base, Base<{
|
|
32
|
-
$el: HTMLElement;
|
|
33
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
34
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
35
|
-
$children: {
|
|
36
|
-
[name: string]: Base<any> | Promise<Base<any>>;
|
|
37
|
-
};
|
|
38
|
-
}> | "terminated">;
|
|
39
|
-
};
|
|
40
|
-
$isMounted: boolean;
|
|
41
|
-
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
42
|
-
readonly $root: Base<{
|
|
43
|
-
$el: HTMLElement;
|
|
44
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
45
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
46
|
-
$children: {
|
|
47
|
-
[name: string]: Base<any> | Promise<Base<any>>;
|
|
48
|
-
};
|
|
49
|
-
}>;
|
|
50
|
-
readonly __config: import("../Base/index.js").BaseConfig;
|
|
51
|
-
__services: import("../Base/managers/ServicesManager.js").default;
|
|
52
|
-
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
53
|
-
__refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
54
|
-
readonly $refs: import("../Base/managers/RefsManager.js").default & (T & U)["$refs"] & import("../Base/index.js").BaseRefs;
|
|
55
|
-
__options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
|
|
56
|
-
readonly $options: import("../Base/managers/OptionsManager.js").default & (T & U)["$options"] & import("../Base/index.js").BaseOptions;
|
|
57
|
-
__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;
|
|
58
|
-
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;
|
|
59
|
-
__events: import("../Base/managers/EventsManager.js").default;
|
|
60
|
-
readonly $log: (...args: any) => void;
|
|
61
|
-
readonly __debug: (...args: any) => void;
|
|
62
|
-
readonly __managers: import("../Base/index.js").Managers;
|
|
63
|
-
__callMethod(method: string, ...args: any[]): any;
|
|
64
|
-
__hasEvent(event: string): boolean;
|
|
65
|
-
$update(): any;
|
|
66
|
-
$terminate(): void;
|
|
67
|
-
__addEmits(event: string): void;
|
|
68
|
-
__removeEmits(event: string): void;
|
|
69
|
-
readonly __ctor: typeof Base;
|
|
70
|
-
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
71
|
-
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
72
|
-
$emit(event: string, ...args: any[]): void;
|
|
73
|
-
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
74
|
-
dispatchEvent(event: Event): boolean;
|
|
75
|
-
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
76
|
-
};
|
|
77
|
-
readonly $isBase: boolean;
|
|
78
|
-
config: import("../Base/index.js").BaseConfig;
|
|
79
|
-
$factory(nameOrSelector: string): Base<{
|
|
80
|
-
$el: HTMLElement;
|
|
81
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
82
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
83
|
-
$children: {
|
|
84
|
-
[name: string]: Base<any> | Promise<Base<any>>;
|
|
85
|
-
};
|
|
86
|
-
}>[];
|
|
87
|
-
};
|
|
5
|
+
export default function withBreakpointManager<S extends BaseConstructor<Base>, T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: S, breakpoints: Array<[string, BaseConstructor<Base>]>): S;
|
|
@@ -38,7 +38,7 @@ function withBreakpointManager(BaseClass, breakpoints) {
|
|
|
38
38
|
}
|
|
39
39
|
return BaseClass;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
class WithBreakpointManager extends BaseClass {
|
|
42
42
|
constructor(element) {
|
|
43
43
|
super(element);
|
|
44
44
|
if (!instances.has(this)) {
|
|
@@ -61,7 +61,8 @@ function withBreakpointManager(BaseClass, breakpoints) {
|
|
|
61
61
|
}
|
|
62
62
|
return super.$destroy();
|
|
63
63
|
}
|
|
64
|
-
}
|
|
64
|
+
}
|
|
65
|
+
return WithBreakpointManager;
|
|
65
66
|
}
|
|
66
67
|
export {
|
|
67
68
|
withBreakpointManager as default
|
|
@@ -73,8 +73,8 @@ function addToResize(key, instance) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
function withBreakpointObserver(BaseClass) {
|
|
76
|
-
var _a
|
|
77
|
-
|
|
76
|
+
var _a;
|
|
77
|
+
class WithBreakpointObserver extends BaseClass {
|
|
78
78
|
constructor(element) {
|
|
79
79
|
super(element);
|
|
80
80
|
const { remove, props } = (0, import_resize.default)();
|
|
@@ -114,7 +114,8 @@ function withBreakpointObserver(BaseClass) {
|
|
|
114
114
|
}
|
|
115
115
|
return this;
|
|
116
116
|
}
|
|
117
|
-
}
|
|
117
|
+
}
|
|
118
|
+
__publicField(WithBreakpointObserver, "config", {
|
|
118
119
|
...BaseClass.config,
|
|
119
120
|
name: `${BaseClass.config.name}WithBreakpointObserver`,
|
|
120
121
|
options: {
|
|
@@ -122,6 +123,7 @@ function withBreakpointObserver(BaseClass) {
|
|
|
122
123
|
activeBreakpoints: String,
|
|
123
124
|
inactiveBreakpoints: String
|
|
124
125
|
}
|
|
125
|
-
})
|
|
126
|
+
});
|
|
127
|
+
return WithBreakpointObserver;
|
|
126
128
|
}
|
|
127
129
|
if (module.exports.default) module.exports = module.exports.default;
|
|
@@ -1,10 +1,61 @@
|
|
|
1
|
-
import type Base from '../Base/index.js';
|
|
2
|
-
|
|
1
|
+
import type { Base, BaseConstructor, BaseTypeParameter } from '../Base/index.js';
|
|
2
|
+
interface WithBreakpointObserverInterface {
|
|
3
|
+
$options: {
|
|
4
|
+
activeBreakpoints?: string;
|
|
5
|
+
inactiveBreakpoints?: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
3
8
|
/**
|
|
4
9
|
* BreakpointObserver class.
|
|
5
10
|
*/
|
|
6
|
-
export default function withBreakpointObserver<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass:
|
|
7
|
-
new
|
|
11
|
+
export default function withBreakpointObserver<S extends BaseConstructor<Base>, T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: S): {
|
|
12
|
+
new (...args: any[]): {
|
|
13
|
+
/**
|
|
14
|
+
* Override the default $mount method to prevent component's from being
|
|
15
|
+
* mounted when they should not.
|
|
16
|
+
*
|
|
17
|
+
* @returns {this}
|
|
18
|
+
*/
|
|
19
|
+
$mount(): any;
|
|
20
|
+
$parent: Base<BaseTypeParameter>;
|
|
21
|
+
$id: string;
|
|
22
|
+
$el: HTMLElement & {
|
|
23
|
+
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
24
|
+
};
|
|
25
|
+
$isMounted: boolean;
|
|
26
|
+
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
27
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
28
|
+
readonly __config: import("../Base/index.js").BaseConfig;
|
|
29
|
+
__services: import("../Base/managers/ServicesManager.js").default;
|
|
30
|
+
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
31
|
+
__refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
32
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
33
|
+
__options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
34
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
35
|
+
__children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
36
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
37
|
+
__events: import("../Base/managers/EventsManager.js").default;
|
|
38
|
+
readonly $log: (...args: unknown[]) => void;
|
|
39
|
+
readonly __debug: (...args: unknown[]) => void;
|
|
40
|
+
readonly __managers: import("../Base/index.js").Managers;
|
|
41
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
42
|
+
__hasEvent(event: string): boolean;
|
|
43
|
+
$update(): any;
|
|
44
|
+
$destroy(): any;
|
|
45
|
+
$terminate(): void;
|
|
46
|
+
__addEmits(event: string): void;
|
|
47
|
+
__removeEmits(event: string): void;
|
|
48
|
+
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
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
|
+
prototype: Base<BaseTypeParameter>;
|
|
57
|
+
} & Pick<typeof Base, "prototype" | "$isBase" | "config" | "$factory"> & Pick<{
|
|
58
|
+
new (element: any): {
|
|
8
59
|
/**
|
|
9
60
|
* Override the default $mount method to prevent component's from being
|
|
10
61
|
* mounted when they should not.
|
|
@@ -12,59 +63,38 @@ export default function withBreakpointObserver<T extends BaseTypeParameter = Bas
|
|
|
12
63
|
* @returns {this}
|
|
13
64
|
*/
|
|
14
65
|
$mount(): any;
|
|
15
|
-
$parent: Base<
|
|
16
|
-
$el: HTMLElement;
|
|
17
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
18
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
19
|
-
$children: {
|
|
20
|
-
[name: string]: Base<any> | Promise<Base<any>>;
|
|
21
|
-
};
|
|
22
|
-
}>;
|
|
66
|
+
$parent: Base<BaseTypeParameter>;
|
|
23
67
|
$id: string;
|
|
24
|
-
$el:
|
|
25
|
-
__base__?: WeakMap<
|
|
26
|
-
$el: HTMLElement;
|
|
27
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
28
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
29
|
-
$children: {
|
|
30
|
-
[name: string]: Base<any> | Promise<Base<any>>;
|
|
31
|
-
};
|
|
32
|
-
}> | "terminated">;
|
|
68
|
+
$el: HTMLElement & {
|
|
69
|
+
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
33
70
|
};
|
|
34
71
|
$isMounted: boolean;
|
|
35
72
|
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
36
|
-
readonly $root: Base<
|
|
37
|
-
$el: HTMLElement;
|
|
38
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
39
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
40
|
-
$children: {
|
|
41
|
-
[name: string]: Base<any> | Promise<Base<any>>;
|
|
42
|
-
};
|
|
43
|
-
}>;
|
|
73
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
44
74
|
readonly __config: import("../Base/index.js").BaseConfig;
|
|
45
75
|
__services: import("../Base/managers/ServicesManager.js").default;
|
|
46
76
|
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
47
|
-
__refs: import("../Base/managers/RefsManager.js").default &
|
|
48
|
-
readonly $refs: import("../Base/managers/RefsManager.js").default &
|
|
49
|
-
__options: import("../Base/managers/OptionsManager.js").default &
|
|
50
|
-
readonly $options: import("../Base/managers/OptionsManager.js").default &
|
|
51
|
-
__children: import("../Base/managers/ChildrenManager.js").default &
|
|
52
|
-
readonly $children: import("../Base/managers/ChildrenManager.js").default &
|
|
77
|
+
__refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
78
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
79
|
+
__options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
80
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
81
|
+
__children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
82
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
53
83
|
__events: import("../Base/managers/EventsManager.js").default;
|
|
54
|
-
readonly $log: (...args:
|
|
55
|
-
readonly __debug: (...args:
|
|
84
|
+
readonly $log: (...args: unknown[]) => void;
|
|
85
|
+
readonly __debug: (...args: unknown[]) => void;
|
|
56
86
|
readonly __managers: import("../Base/index.js").Managers;
|
|
57
|
-
__callMethod(method: string, ...args:
|
|
87
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
58
88
|
__hasEvent(event: string): boolean;
|
|
59
89
|
$update(): any;
|
|
60
90
|
$destroy(): any;
|
|
61
91
|
$terminate(): void;
|
|
62
92
|
__addEmits(event: string): void;
|
|
63
93
|
__removeEmits(event: string): void;
|
|
64
|
-
readonly __ctor:
|
|
94
|
+
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
65
95
|
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
66
96
|
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
67
|
-
$emit(event: string, ...args:
|
|
97
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
68
98
|
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
69
99
|
dispatchEvent(event: Event): boolean;
|
|
70
100
|
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
@@ -81,13 +111,10 @@ export default function withBreakpointObserver<T extends BaseTypeParameter = Bas
|
|
|
81
111
|
emits?: string[];
|
|
82
112
|
components?: import("../Base/index.js").BaseConfigComponents;
|
|
83
113
|
};
|
|
84
|
-
readonly $isBase:
|
|
85
|
-
$factory
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
$children: {
|
|
90
|
-
[name: string]: Base<any> | Promise<Base<any>>;
|
|
91
|
-
};
|
|
92
|
-
}>[];
|
|
114
|
+
readonly $isBase: true;
|
|
115
|
+
$factory: typeof Base.$factory;
|
|
116
|
+
} & S, "prototype" | "$isBase" | "config" | "$factory" | keyof S> & S & {
|
|
117
|
+
new (...args: any[]): Base<T & WithBreakpointObserverInterface>;
|
|
118
|
+
prototype: Base<BaseTypeParameter>;
|
|
93
119
|
};
|
|
120
|
+
export {};
|
|
@@ -44,8 +44,8 @@ function addToResize(key, instance) {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
function withBreakpointObserver(BaseClass) {
|
|
47
|
-
var _a
|
|
48
|
-
|
|
47
|
+
var _a;
|
|
48
|
+
class WithBreakpointObserver extends BaseClass {
|
|
49
49
|
constructor(element) {
|
|
50
50
|
super(element);
|
|
51
51
|
const { remove, props } = useResize();
|
|
@@ -85,7 +85,8 @@ function withBreakpointObserver(BaseClass) {
|
|
|
85
85
|
}
|
|
86
86
|
return this;
|
|
87
87
|
}
|
|
88
|
-
}
|
|
88
|
+
}
|
|
89
|
+
__publicField(WithBreakpointObserver, "config", {
|
|
89
90
|
...BaseClass.config,
|
|
90
91
|
name: `${BaseClass.config.name}WithBreakpointObserver`,
|
|
91
92
|
options: {
|
|
@@ -93,7 +94,8 @@ function withBreakpointObserver(BaseClass) {
|
|
|
93
94
|
activeBreakpoints: String,
|
|
94
95
|
inactiveBreakpoints: String
|
|
95
96
|
}
|
|
96
|
-
})
|
|
97
|
+
});
|
|
98
|
+
return WithBreakpointObserver;
|
|
97
99
|
}
|
|
98
100
|
export {
|
|
99
101
|
withBreakpointObserver as default
|
package/decorators/withDrag.cjs
CHANGED
|
@@ -35,8 +35,7 @@ __export(withDrag_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(withDrag_exports);
|
|
36
36
|
var import_drag = __toESM(require("../services/drag.cjs"), 1);
|
|
37
37
|
function withDrag(BaseClass, { target = (instance) => instance.$el, ...options } = {}) {
|
|
38
|
-
|
|
39
|
-
return _a = class extends BaseClass {
|
|
38
|
+
class WithDrag extends BaseClass {
|
|
40
39
|
constructor(el) {
|
|
41
40
|
super(el);
|
|
42
41
|
this.$on("mounted", () => {
|
|
@@ -51,9 +50,11 @@ function withDrag(BaseClass, { target = (instance) => instance.$el, ...options }
|
|
|
51
50
|
this.$services.unregister("dragged");
|
|
52
51
|
});
|
|
53
52
|
}
|
|
54
|
-
}
|
|
53
|
+
}
|
|
54
|
+
__publicField(WithDrag, "config", {
|
|
55
55
|
name: `${BaseClass.config.name}WithDrag`,
|
|
56
56
|
emits: ["dragged"]
|
|
57
|
-
})
|
|
57
|
+
});
|
|
58
|
+
return WithDrag;
|
|
58
59
|
}
|
|
59
60
|
if (module.exports.default) module.exports = module.exports.default;
|