@studiometa/js-toolkit 2.4.4-alpha.2 → 2.4.4-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Base/index.cjs +2 -2
- package/Base/index.d.ts +76 -216
- package/Base/index.js +1 -1
- package/Base/managers/AbstractManager.d.ts +2 -2
- package/Base/managers/ChildrenManager.cjs +2 -4
- package/Base/managers/ChildrenManager.d.ts +2 -10
- package/Base/managers/ChildrenManager.js +1 -3
- package/Base/managers/EventsManager.cjs +3 -3
- package/Base/managers/EventsManager.d.ts +9 -15
- package/Base/managers/EventsManager.js +2 -2
- package/Base/managers/OptionsManager.d.ts +1 -1
- package/Base/managers/ServicesManager.d.ts +1 -1
- package/Base/utils.cjs +1 -1
- package/Base/utils.d.ts +5 -21
- package/decorators/index.cjs +4 -2
- package/decorators/index.d.ts +2 -1
- package/decorators/index.js +3 -2
- package/decorators/withBreakpointManager.cjs +3 -2
- package/decorators/withBreakpointManager.d.ts +2 -84
- package/decorators/withBreakpointManager.js +3 -2
- package/decorators/withBreakpointObserver.cjs +6 -4
- package/decorators/withBreakpointObserver.d.ts +76 -49
- package/decorators/withBreakpointObserver.js +6 -4
- package/decorators/withDrag.cjs +5 -4
- package/decorators/withDrag.d.ts +63 -49
- package/decorators/withDrag.js +5 -4
- package/decorators/withExtraConfig.cjs +4 -3
- package/decorators/withExtraConfig.d.ts +63 -48
- package/decorators/withExtraConfig.js +4 -3
- package/decorators/withFreezedOptions.cjs +3 -2
- package/decorators/withFreezedOptions.d.ts +71 -47
- package/decorators/withFreezedOptions.js +3 -2
- package/decorators/withIntersectionObserver.cjs +6 -4
- package/decorators/withIntersectionObserver.d.ts +67 -48
- package/decorators/withIntersectionObserver.js +6 -4
- package/decorators/withMountWhenInView.cjs +10 -5
- package/decorators/withMountWhenInView.d.ts +76 -49
- package/decorators/withMountWhenInView.js +10 -5
- package/decorators/withResponsiveOptions.cjs +3 -2
- package/decorators/withResponsiveOptions.d.ts +68 -48
- package/decorators/withResponsiveOptions.js +3 -2
- package/decorators/withScrolledInView.cjs +12 -7
- package/decorators/withScrolledInView.d.ts +224 -80
- package/decorators/withScrolledInView.js +12 -7
- package/decorators/withType.cjs +28 -0
- package/decorators/withType.d.ts +5 -0
- package/decorators/withType.js +6 -0
- package/decorators/withVue2.cjs +7 -4
- package/decorators/withVue2.d.ts +64 -48
- package/decorators/withVue2.js +7 -4
- package/helpers/createApp.cjs +1 -1
- package/helpers/createApp.d.ts +2 -10
- package/helpers/getDirectChildren.cjs +5 -5
- package/helpers/getDirectChildren.d.ts +3 -13
- package/helpers/getDirectChildren.js +4 -4
- package/helpers/getInstanceFromElement.cjs +3 -4
- package/helpers/getInstanceFromElement.d.ts +2 -11
- package/helpers/getInstanceFromElement.js +2 -3
- package/helpers/importOnInteraction.cjs +1 -1
- package/helpers/importOnInteraction.d.ts +4 -9
- package/helpers/importWhenIdle.cjs +3 -5
- package/helpers/importWhenIdle.d.ts +7 -10
- package/helpers/importWhenIdle.js +2 -4
- package/helpers/importWhenVisible.cjs +1 -1
- package/helpers/importWhenVisible.d.ts +2 -7
- package/helpers/index.cjs +1 -1
- package/helpers/index.d.ts +6 -6
- package/helpers/utils.cjs +1 -1
- package/helpers/utils.d.ts +1 -1
- package/index.cjs +2 -8
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
package/decorators/index.cjs
CHANGED
|
@@ -16,6 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
}
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
22
|
mod
|
|
@@ -33,7 +34,7 @@ __export(decorators_exports, {
|
|
|
33
34
|
withIntersectionObserver: () => import_withIntersectionObserver.default,
|
|
34
35
|
withMountWhenInView: () => import_withMountWhenInView.default,
|
|
35
36
|
withResponsiveOptions: () => import_withResponsiveOptions.default,
|
|
36
|
-
|
|
37
|
+
withType: () => import_withType.default,
|
|
37
38
|
withVue2: () => import_withVue2.default
|
|
38
39
|
});
|
|
39
40
|
module.exports = __toCommonJS(decorators_exports);
|
|
@@ -45,6 +46,7 @@ var import_withFreezedOptions = __toESM(require("./withFreezedOptions.cjs"), 1);
|
|
|
45
46
|
var import_withIntersectionObserver = __toESM(require("./withIntersectionObserver.cjs"), 1);
|
|
46
47
|
var import_withMountWhenInView = __toESM(require("./withMountWhenInView.cjs"), 1);
|
|
47
48
|
var import_withResponsiveOptions = __toESM(require("./withResponsiveOptions.cjs"), 1);
|
|
48
|
-
|
|
49
|
+
__reExport(decorators_exports, require("./withScrolledInView.cjs"), module.exports);
|
|
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
|
@@ -6,5 +6,6 @@ export { default as withFreezedOptions } from './withFreezedOptions.js';
|
|
|
6
6
|
export { default as withIntersectionObserver } from './withIntersectionObserver.js';
|
|
7
7
|
export { default as withMountWhenInView } from './withMountWhenInView.js';
|
|
8
8
|
export { default as withResponsiveOptions } from './withResponsiveOptions.js';
|
|
9
|
-
export
|
|
9
|
+
export * 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
|
@@ -6,7 +6,8 @@ import { default as default6 } from "./withFreezedOptions.js";
|
|
|
6
6
|
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
|
+
export * from "./withScrolledInView.js";
|
|
10
|
+
import { default as default10 } from "./withType.js";
|
|
10
11
|
import { default as default11 } from "./withVue2.js";
|
|
11
12
|
export {
|
|
12
13
|
default2 as withBreakpointManager,
|
|
@@ -17,6 +18,6 @@ export {
|
|
|
17
18
|
default7 as withIntersectionObserver,
|
|
18
19
|
default8 as withMountWhenInView,
|
|
19
20
|
default9 as withResponsiveOptions,
|
|
20
|
-
default10 as
|
|
21
|
+
default10 as withType,
|
|
21
22
|
default11 as withVue2
|
|
22
23
|
};
|
|
@@ -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;
|
package/decorators/withDrag.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type Base from '../Base/index.js';
|
|
2
|
-
import type { BaseTypeParameter, BaseConstructor } from '../Base/index.js';
|
|
1
|
+
import type { Base, BaseTypeParameter, BaseConstructor } from '../Base/index.js';
|
|
3
2
|
import type { DragServiceOptions } from '../services/drag.js';
|
|
4
3
|
declare type DragDecoratorOptions = DragServiceOptions & {
|
|
5
4
|
target?: (this: Base, instance: Base) => HTMLElement;
|
|
@@ -7,51 +6,30 @@ declare type DragDecoratorOptions = DragServiceOptions & {
|
|
|
7
6
|
/**
|
|
8
7
|
* Add dragging capabilities to a component.
|
|
9
8
|
*/
|
|
10
|
-
export default function withDrag<T extends BaseTypeParameter = BaseTypeParameter>(BaseClass:
|
|
11
|
-
new
|
|
12
|
-
$parent: Base<
|
|
13
|
-
$el: HTMLElement;
|
|
14
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
15
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
16
|
-
$children: {
|
|
17
|
-
[name: string]: Base<any> | Promise<Base<any>>;
|
|
18
|
-
};
|
|
19
|
-
}>;
|
|
9
|
+
export default function withDrag<S extends BaseConstructor<Base>, T extends BaseTypeParameter = BaseTypeParameter>(BaseClass: S, { target, ...options }?: DragDecoratorOptions): {
|
|
10
|
+
new (...args: any[]): {
|
|
11
|
+
$parent: Base<BaseTypeParameter>;
|
|
20
12
|
$id: string;
|
|
21
|
-
$el:
|
|
22
|
-
__base__?: WeakMap<
|
|
23
|
-
$el: HTMLElement;
|
|
24
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
25
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
26
|
-
$children: {
|
|
27
|
-
[name: string]: Base<any> | Promise<Base<any>>;
|
|
28
|
-
};
|
|
29
|
-
}> | "terminated">;
|
|
13
|
+
$el: HTMLElement & {
|
|
14
|
+
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
30
15
|
};
|
|
31
16
|
$isMounted: boolean;
|
|
32
17
|
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
33
|
-
readonly $root: Base<
|
|
34
|
-
$el: HTMLElement;
|
|
35
|
-
$options: import("../Base/index.js").BaseOptions;
|
|
36
|
-
$refs: import("../Base/index.js").BaseRefs;
|
|
37
|
-
$children: {
|
|
38
|
-
[name: string]: Base<any> | Promise<Base<any>>;
|
|
39
|
-
};
|
|
40
|
-
}>;
|
|
18
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
41
19
|
readonly __config: import("../Base/index.js").BaseConfig;
|
|
42
20
|
__services: import("../Base/managers/ServicesManager.js").default;
|
|
43
21
|
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
44
|
-
__refs: import("../Base/managers/RefsManager.js").default &
|
|
45
|
-
readonly $refs: import("../Base/managers/RefsManager.js").default &
|
|
46
|
-
__options: import("../Base/managers/OptionsManager.js").default &
|
|
47
|
-
readonly $options: import("../Base/managers/OptionsManager.js").default &
|
|
48
|
-
__children: import("../Base/managers/ChildrenManager.js").default &
|
|
49
|
-
readonly $children: import("../Base/managers/ChildrenManager.js").default &
|
|
22
|
+
__refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
23
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
24
|
+
__options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
25
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
26
|
+
__children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
27
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
50
28
|
__events: import("../Base/managers/EventsManager.js").default;
|
|
51
|
-
readonly $log: (...args:
|
|
52
|
-
readonly __debug: (...args:
|
|
29
|
+
readonly $log: (...args: unknown[]) => void;
|
|
30
|
+
readonly __debug: (...args: unknown[]) => void;
|
|
53
31
|
readonly __managers: import("../Base/index.js").Managers;
|
|
54
|
-
__callMethod(method: string, ...args:
|
|
32
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
55
33
|
__hasEvent(event: string): boolean;
|
|
56
34
|
$mount(): any;
|
|
57
35
|
$update(): any;
|
|
@@ -59,10 +37,50 @@ export default function withDrag<T extends BaseTypeParameter = BaseTypeParameter
|
|
|
59
37
|
$terminate(): void;
|
|
60
38
|
__addEmits(event: string): void;
|
|
61
39
|
__removeEmits(event: string): void;
|
|
62
|
-
readonly __ctor:
|
|
40
|
+
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
63
41
|
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
64
42
|
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
65
|
-
$emit(event: string, ...args:
|
|
43
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
44
|
+
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
45
|
+
dispatchEvent(event: Event): boolean;
|
|
46
|
+
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
47
|
+
};
|
|
48
|
+
prototype: Base<BaseTypeParameter>;
|
|
49
|
+
} & Pick<typeof Base, "prototype" | "$isBase" | "config" | "$factory"> & Pick<{
|
|
50
|
+
new (el: any): {
|
|
51
|
+
$parent: Base<BaseTypeParameter>;
|
|
52
|
+
$id: string;
|
|
53
|
+
$el: HTMLElement & {
|
|
54
|
+
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
55
|
+
};
|
|
56
|
+
$isMounted: boolean;
|
|
57
|
+
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
58
|
+
readonly $root: Base<BaseTypeParameter>;
|
|
59
|
+
readonly __config: import("../Base/index.js").BaseConfig;
|
|
60
|
+
__services: import("../Base/managers/ServicesManager.js").default;
|
|
61
|
+
readonly $services: import("../Base/managers/ServicesManager.js").default;
|
|
62
|
+
__refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
63
|
+
readonly $refs: import("../Base/managers/RefsManager.js").default & import("../Base/index.js").BaseRefs;
|
|
64
|
+
__options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
65
|
+
readonly $options: import("../Base/managers/OptionsManager.js").default & import("../Base/index.js").BaseOptions;
|
|
66
|
+
__children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
67
|
+
readonly $children: import("../Base/managers/ChildrenManager.js").default & import("../Base/index.js").BaseChildren;
|
|
68
|
+
__events: import("../Base/managers/EventsManager.js").default;
|
|
69
|
+
readonly $log: (...args: unknown[]) => void;
|
|
70
|
+
readonly __debug: (...args: unknown[]) => void;
|
|
71
|
+
readonly __managers: import("../Base/index.js").Managers;
|
|
72
|
+
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
73
|
+
__hasEvent(event: string): boolean;
|
|
74
|
+
$mount(): any;
|
|
75
|
+
$update(): any;
|
|
76
|
+
$destroy(): any;
|
|
77
|
+
$terminate(): void;
|
|
78
|
+
__addEmits(event: string): void;
|
|
79
|
+
__removeEmits(event: string): void;
|
|
80
|
+
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
81
|
+
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
82
|
+
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
83
|
+
$emit(event: string, ...args: unknown[]): void;
|
|
66
84
|
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
67
85
|
dispatchEvent(event: Event): boolean;
|
|
68
86
|
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
@@ -71,14 +89,10 @@ export default function withDrag<T extends BaseTypeParameter = BaseTypeParameter
|
|
|
71
89
|
name: string;
|
|
72
90
|
emits: string[];
|
|
73
91
|
};
|
|
74
|
-
readonly $isBase:
|
|
75
|
-
$factory
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
$children: {
|
|
80
|
-
[name: string]: Base<any> | Promise<Base<any>>;
|
|
81
|
-
};
|
|
82
|
-
}>[];
|
|
92
|
+
readonly $isBase: true;
|
|
93
|
+
$factory: typeof Base.$factory;
|
|
94
|
+
} & S, "prototype" | "$isBase" | "config" | "$factory" | keyof S> & S & {
|
|
95
|
+
new (...args: any[]): Base<T>;
|
|
96
|
+
prototype: Base<BaseTypeParameter>;
|
|
83
97
|
};
|
|
84
98
|
export {};
|
package/decorators/withDrag.js
CHANGED
|
@@ -6,8 +6,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6
6
|
};
|
|
7
7
|
import useDrag from "../services/drag.js";
|
|
8
8
|
function withDrag(BaseClass, { target = (instance) => instance.$el, ...options } = {}) {
|
|
9
|
-
|
|
10
|
-
return _a = class extends BaseClass {
|
|
9
|
+
class WithDrag extends BaseClass {
|
|
11
10
|
constructor(el) {
|
|
12
11
|
super(el);
|
|
13
12
|
this.$on("mounted", () => {
|
|
@@ -22,10 +21,12 @@ function withDrag(BaseClass, { target = (instance) => instance.$el, ...options }
|
|
|
22
21
|
this.$services.unregister("dragged");
|
|
23
22
|
});
|
|
24
23
|
}
|
|
25
|
-
}
|
|
24
|
+
}
|
|
25
|
+
__publicField(WithDrag, "config", {
|
|
26
26
|
name: `${BaseClass.config.name}WithDrag`,
|
|
27
27
|
emits: ["dragged"]
|
|
28
|
-
})
|
|
28
|
+
});
|
|
29
|
+
return WithDrag;
|
|
29
30
|
}
|
|
30
31
|
export {
|
|
31
32
|
withDrag as default
|
|
@@ -35,12 +35,13 @@ __export(withExtraConfig_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(withExtraConfig_exports);
|
|
36
36
|
var import_deepmerge = __toESM(require("deepmerge"), 1);
|
|
37
37
|
function withExtraConfig(BaseClass, config, options = {}) {
|
|
38
|
-
var _a;
|
|
39
38
|
const newConfig = (0, import_deepmerge.default)(BaseClass.config, config, options);
|
|
40
39
|
if (newConfig.name === BaseClass.config.name) {
|
|
41
40
|
newConfig.name = `${BaseClass.config.name}WithExtraConfig`;
|
|
42
41
|
}
|
|
43
|
-
|
|
44
|
-
}
|
|
42
|
+
class WithExtraConfig extends BaseClass {
|
|
43
|
+
}
|
|
44
|
+
__publicField(WithExtraConfig, "config", newConfig);
|
|
45
|
+
return WithExtraConfig;
|
|
45
46
|
}
|
|
46
47
|
if (module.exports.default) module.exports = module.exports.default;
|