@studiometa/js-toolkit 2.4.4-alpha.5 → 2.4.4-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Base/types.d.ts +5 -1
- package/decorators/index.cjs +9 -32
- package/decorators/index.d.ts +9 -10
- package/decorators/index.js +9 -22
- package/decorators/withBreakpointManager.cjs +6 -12
- package/decorators/withBreakpointManager.d.ts +3 -2
- package/decorators/withBreakpointManager.js +4 -4
- package/decorators/withBreakpointObserver.cjs +5 -11
- package/decorators/withBreakpointObserver.d.ts +7 -112
- package/decorators/withBreakpointObserver.js +2 -2
- package/decorators/withDrag.cjs +5 -11
- package/decorators/withDrag.d.ts +8 -93
- package/decorators/withDrag.js +4 -4
- package/decorators/withExtraConfig.cjs +1 -1
- package/decorators/withExtraConfig.d.ts +3 -96
- package/decorators/withExtraConfig.js +1 -1
- package/decorators/withFreezedOptions.cjs +1 -1
- package/decorators/withFreezedOptions.d.ts +6 -105
- package/decorators/withFreezedOptions.js +1 -1
- package/decorators/withIntersectionObserver.cjs +1 -1
- package/decorators/withIntersectionObserver.d.ts +4 -110
- package/decorators/withIntersectionObserver.js +1 -1
- package/decorators/withMountWhenInView.cjs +1 -1
- package/decorators/withMountWhenInView.d.ts +16 -116
- package/decorators/withMountWhenInView.js +1 -1
- package/decorators/withResponsiveOptions.cjs +1 -1
- package/decorators/withResponsiveOptions.d.ts +3 -98
- package/decorators/withResponsiveOptions.js +1 -1
- package/decorators/withScrolledInView.cjs +20 -18
- package/decorators/withScrolledInView.d.ts +28 -306
- package/decorators/withScrolledInView.js +20 -12
- package/decorators/withVue2.cjs +1 -1
- package/decorators/withVue2.d.ts +8 -106
- package/decorators/withVue2.js +1 -1
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/decorators/withType.cjs +0 -28
- package/decorators/withType.d.ts +0 -5
- package/decorators/withType.js +0 -6
package/Base/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Base, BaseTypeParameter } from './index.js';
|
|
2
|
+
import type { KeyServiceProps, LoadServiceProps, PointerServiceProps, RafServiceProps, ResizeServiceProps, ScrollServiceProps } from '../services/index.js';
|
|
2
3
|
export interface BaseInterface {
|
|
3
4
|
/**
|
|
4
5
|
* Mounted hook.
|
|
@@ -41,3 +42,6 @@ export interface BaseInterface {
|
|
|
41
42
|
*/
|
|
42
43
|
scrolled?(props: ScrollServiceProps): void;
|
|
43
44
|
}
|
|
45
|
+
export declare type BaseDecorator<S extends BaseInterface, T extends Base> = {
|
|
46
|
+
new <W extends BaseTypeParameter = BaseTypeParameter>(...args: unknown[]): S & T & Base<W>;
|
|
47
|
+
} & Partial<Pick<T, keyof T>>;
|
package/decorators/index.cjs
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
5
|
var __copyProps = (to, from, except, desc) => {
|
|
12
6
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
7
|
for (let key of __getOwnPropNames(from))
|
|
@@ -17,36 +11,19 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
11
|
return to;
|
|
18
12
|
};
|
|
19
13
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
14
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
15
|
|
|
26
16
|
// packages/js-toolkit/decorators/index.ts
|
|
27
17
|
var decorators_exports = {};
|
|
28
|
-
__export(decorators_exports, {
|
|
29
|
-
withBreakpointManager: () => import_withBreakpointManager.default,
|
|
30
|
-
withBreakpointObserver: () => import_withBreakpointObserver.default,
|
|
31
|
-
withDrag: () => import_withDrag.default,
|
|
32
|
-
withExtraConfig: () => import_withExtraConfig.default,
|
|
33
|
-
withFreezedOptions: () => import_withFreezedOptions.default,
|
|
34
|
-
withIntersectionObserver: () => import_withIntersectionObserver.default,
|
|
35
|
-
withMountWhenInView: () => import_withMountWhenInView.default,
|
|
36
|
-
withResponsiveOptions: () => import_withResponsiveOptions.default,
|
|
37
|
-
withType: () => import_withType.default,
|
|
38
|
-
withVue2: () => import_withVue2.default
|
|
39
|
-
});
|
|
40
18
|
module.exports = __toCommonJS(decorators_exports);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
19
|
+
__reExport(decorators_exports, require("./withBreakpointManager.cjs"), module.exports);
|
|
20
|
+
__reExport(decorators_exports, require("./withBreakpointObserver.cjs"), module.exports);
|
|
21
|
+
__reExport(decorators_exports, require("./withDrag.cjs"), module.exports);
|
|
22
|
+
__reExport(decorators_exports, require("./withExtraConfig.cjs"), module.exports);
|
|
23
|
+
__reExport(decorators_exports, require("./withFreezedOptions.cjs"), module.exports);
|
|
24
|
+
__reExport(decorators_exports, require("./withIntersectionObserver.cjs"), module.exports);
|
|
25
|
+
__reExport(decorators_exports, require("./withMountWhenInView.cjs"), module.exports);
|
|
26
|
+
__reExport(decorators_exports, require("./withResponsiveOptions.cjs"), module.exports);
|
|
49
27
|
__reExport(decorators_exports, require("./withScrolledInView.cjs"), module.exports);
|
|
50
|
-
|
|
51
|
-
var import_withVue2 = __toESM(require("./withVue2.cjs"), 1);
|
|
28
|
+
__reExport(decorators_exports, require("./withVue2.cjs"), module.exports);
|
|
52
29
|
if (module.exports.default) module.exports = module.exports.default;
|
package/decorators/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
1
|
+
export * from './withBreakpointManager.js';
|
|
2
|
+
export * from './withBreakpointObserver.js';
|
|
3
|
+
export * from './withDrag.js';
|
|
4
|
+
export * from './withExtraConfig.js';
|
|
5
|
+
export * from './withFreezedOptions.js';
|
|
6
|
+
export * from './withIntersectionObserver.js';
|
|
7
|
+
export * from './withMountWhenInView.js';
|
|
8
|
+
export * from './withResponsiveOptions.js';
|
|
9
9
|
export * from './withScrolledInView.js';
|
|
10
|
-
export
|
|
11
|
-
export { default as withVue2 } from './withVue2.js';
|
|
10
|
+
export * from './withVue2.js';
|
package/decorators/index.js
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export * from "./withBreakpointManager.js";
|
|
2
|
+
export * from "./withBreakpointObserver.js";
|
|
3
|
+
export * from "./withDrag.js";
|
|
4
|
+
export * from "./withExtraConfig.js";
|
|
5
|
+
export * from "./withFreezedOptions.js";
|
|
6
|
+
export * from "./withIntersectionObserver.js";
|
|
7
|
+
export * from "./withMountWhenInView.js";
|
|
8
|
+
export * from "./withResponsiveOptions.js";
|
|
9
9
|
export * from "./withScrolledInView.js";
|
|
10
|
-
|
|
11
|
-
import { default as default11 } from "./withVue2.js";
|
|
12
|
-
export {
|
|
13
|
-
default2 as withBreakpointManager,
|
|
14
|
-
default3 as withBreakpointObserver,
|
|
15
|
-
default4 as withDrag,
|
|
16
|
-
default5 as withExtraConfig,
|
|
17
|
-
default6 as withFreezedOptions,
|
|
18
|
-
default7 as withIntersectionObserver,
|
|
19
|
-
default8 as withMountWhenInView,
|
|
20
|
-
default9 as withResponsiveOptions,
|
|
21
|
-
default10 as withType,
|
|
22
|
-
default11 as withVue2
|
|
23
|
-
};
|
|
10
|
+
export * from "./withVue2.js";
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,22 +14,18 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
|
-
mod
|
|
22
|
-
));
|
|
23
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
18
|
|
|
25
19
|
// packages/js-toolkit/decorators/withBreakpointManager.ts
|
|
26
20
|
var withBreakpointManager_exports = {};
|
|
27
21
|
__export(withBreakpointManager_exports, {
|
|
28
|
-
|
|
22
|
+
withBreakpointManager: () => withBreakpointManager
|
|
29
23
|
});
|
|
30
24
|
module.exports = __toCommonJS(withBreakpointManager_exports);
|
|
31
|
-
var
|
|
25
|
+
var import_services = require("../services/index.cjs");
|
|
32
26
|
var import_utils = require("../utils/index.cjs");
|
|
33
27
|
function testBreakpoints(breakpoints) {
|
|
34
|
-
const { breakpoint } = (0,
|
|
28
|
+
const { breakpoint } = (0, import_services.useResize)().props();
|
|
35
29
|
breakpoints.forEach(([breakpointKeys, instance]) => {
|
|
36
30
|
if (breakpointKeys.includes(breakpoint) && !instance.$isMounted) {
|
|
37
31
|
setTimeout(() => instance.$mount(), 0);
|
|
@@ -44,7 +38,7 @@ function mountComponents(instance, breakpoints) {
|
|
|
44
38
|
return breakpoints.map(([bk, ComponentClass]) => {
|
|
45
39
|
const child = new ComponentClass(instance.$el);
|
|
46
40
|
Object.defineProperty(child, "$parent", { get: () => instance.$parent });
|
|
47
|
-
return [bk, child];
|
|
41
|
+
return [bk.split(" "), child];
|
|
48
42
|
});
|
|
49
43
|
}
|
|
50
44
|
var instances = /* @__PURE__ */ new WeakMap();
|
|
@@ -61,10 +55,10 @@ function withBreakpointManager(BaseClass, breakpoints) {
|
|
|
61
55
|
}
|
|
62
56
|
return BaseClass;
|
|
63
57
|
}
|
|
64
|
-
const { add, props } = (0,
|
|
58
|
+
const { add, props } = (0, import_services.useResize)();
|
|
65
59
|
if (!props().breakpoint) {
|
|
66
60
|
if (import_utils.isDev) {
|
|
67
|
-
throw new Error(
|
|
61
|
+
throw new Error("The `BreakpointManager` class requires breakpoints to be defined.");
|
|
68
62
|
}
|
|
69
63
|
return BaseClass;
|
|
70
64
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BaseDecorator, BaseInterface } from '../Base/types.js';
|
|
2
|
+
import type { Base, BaseConstructor } from '../Base/index.js';
|
|
2
3
|
/**
|
|
3
4
|
* BreakpointManager class.
|
|
4
5
|
*/
|
|
5
|
-
export
|
|
6
|
+
export declare function withBreakpointManager<S extends Base>(BaseClass: typeof Base, breakpoints: Array<[string, BaseConstructor<Base>]>): BaseDecorator<BaseInterface, S>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import useResize from "../services/
|
|
1
|
+
import { useResize } from "../services/index.js";
|
|
2
2
|
import { isDev, isArray } from "../utils/index.js";
|
|
3
3
|
function testBreakpoints(breakpoints) {
|
|
4
4
|
const { breakpoint } = useResize().props();
|
|
@@ -14,7 +14,7 @@ function mountComponents(instance, breakpoints) {
|
|
|
14
14
|
return breakpoints.map(([bk, ComponentClass]) => {
|
|
15
15
|
const child = new ComponentClass(instance.$el);
|
|
16
16
|
Object.defineProperty(child, "$parent", { get: () => instance.$parent });
|
|
17
|
-
return [bk, child];
|
|
17
|
+
return [bk.split(" "), child];
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
const instances = /* @__PURE__ */ new WeakMap();
|
|
@@ -34,7 +34,7 @@ function withBreakpointManager(BaseClass, breakpoints) {
|
|
|
34
34
|
const { add, props } = useResize();
|
|
35
35
|
if (!props().breakpoint) {
|
|
36
36
|
if (isDev) {
|
|
37
|
-
throw new Error(
|
|
37
|
+
throw new Error("The `BreakpointManager` class requires breakpoints to be defined.");
|
|
38
38
|
}
|
|
39
39
|
return BaseClass;
|
|
40
40
|
}
|
|
@@ -65,5 +65,5 @@ function withBreakpointManager(BaseClass, breakpoints) {
|
|
|
65
65
|
return WithBreakpointManager;
|
|
66
66
|
}
|
|
67
67
|
export {
|
|
68
|
-
withBreakpointManager
|
|
68
|
+
withBreakpointManager
|
|
69
69
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
6
|
var __export = (target, all) => {
|
|
@@ -17,10 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
19
|
var __publicField = (obj, key, value) => {
|
|
26
20
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -30,12 +24,12 @@ var __publicField = (obj, key, value) => {
|
|
|
30
24
|
// packages/js-toolkit/decorators/withBreakpointObserver.ts
|
|
31
25
|
var withBreakpointObserver_exports = {};
|
|
32
26
|
__export(withBreakpointObserver_exports, {
|
|
33
|
-
|
|
27
|
+
withBreakpointObserver: () => withBreakpointObserver
|
|
34
28
|
});
|
|
35
29
|
module.exports = __toCommonJS(withBreakpointObserver_exports);
|
|
36
|
-
var
|
|
30
|
+
var import_services = require("../services/index.cjs");
|
|
37
31
|
var import_utils = require("../utils/index.cjs");
|
|
38
|
-
function testBreakpoints(instance, breakpoint = (0,
|
|
32
|
+
function testBreakpoints(instance, breakpoint = (0, import_services.useResize)().props().breakpoint) {
|
|
39
33
|
const { activeBreakpoints, inactiveBreakpoints } = instance.$options;
|
|
40
34
|
const isInActiveBreakpoint = activeBreakpoints && activeBreakpoints.split(" ").includes(breakpoint);
|
|
41
35
|
const isInInactiveBreakpoint = inactiveBreakpoints && inactiveBreakpoints.split(" ").includes(breakpoint);
|
|
@@ -60,7 +54,7 @@ function addToResize(key, instance) {
|
|
|
60
54
|
if (import_utils.isDev) {
|
|
61
55
|
testConflictingBreakpointConfiguration(instance);
|
|
62
56
|
}
|
|
63
|
-
const { add, has } = (0,
|
|
57
|
+
const { add, has } = (0, import_services.useResize)();
|
|
64
58
|
if (!has(key)) {
|
|
65
59
|
add(key, ({ breakpoint }) => {
|
|
66
60
|
const action = testBreakpoints(instance, breakpoint);
|
|
@@ -77,7 +71,7 @@ function withBreakpointObserver(BaseClass) {
|
|
|
77
71
|
class WithBreakpointObserver extends BaseClass {
|
|
78
72
|
constructor(element) {
|
|
79
73
|
super(element);
|
|
80
|
-
const { remove, props } = (0,
|
|
74
|
+
const { remove, props } = (0, import_services.useResize)();
|
|
81
75
|
const { name } = this.$options;
|
|
82
76
|
if (!props().breakpoint) {
|
|
83
77
|
if (import_utils.isDev) {
|
|
@@ -1,120 +1,15 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { BaseDecorator, BaseInterface } from '../Base/types.js';
|
|
2
|
+
import type { Base, BaseTypeParameter } from '../Base/index.js';
|
|
3
|
+
export interface WithBreakpointObserverTypeParameter extends BaseTypeParameter {
|
|
3
4
|
$options: {
|
|
4
5
|
activeBreakpoints?: string;
|
|
5
6
|
inactiveBreakpoints?: string;
|
|
6
7
|
};
|
|
7
8
|
}
|
|
9
|
+
export interface WithBreakpointObserverInterface extends BaseInterface {
|
|
10
|
+
$mount(): this;
|
|
11
|
+
}
|
|
8
12
|
/**
|
|
9
13
|
* BreakpointObserver class.
|
|
10
14
|
*/
|
|
11
|
-
export
|
|
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): {
|
|
59
|
-
/**
|
|
60
|
-
* Override the default $mount method to prevent component's from being
|
|
61
|
-
* mounted when they should not.
|
|
62
|
-
*
|
|
63
|
-
* @returns {this}
|
|
64
|
-
*/
|
|
65
|
-
$mount(): any;
|
|
66
|
-
$parent: Base<BaseTypeParameter>;
|
|
67
|
-
$id: string;
|
|
68
|
-
$el: HTMLElement & {
|
|
69
|
-
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
70
|
-
};
|
|
71
|
-
$isMounted: boolean;
|
|
72
|
-
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
73
|
-
readonly $root: Base<BaseTypeParameter>;
|
|
74
|
-
readonly __config: import("../Base/index.js").BaseConfig;
|
|
75
|
-
__services: import("../Base/managers/ServicesManager.js").default;
|
|
76
|
-
readonly $services: import("../Base/managers/ServicesManager.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;
|
|
83
|
-
__events: import("../Base/managers/EventsManager.js").default;
|
|
84
|
-
readonly $log: (...args: unknown[]) => void;
|
|
85
|
-
readonly __debug: (...args: unknown[]) => void;
|
|
86
|
-
readonly __managers: import("../Base/index.js").Managers;
|
|
87
|
-
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
88
|
-
__hasEvent(event: string): boolean;
|
|
89
|
-
$update(): any;
|
|
90
|
-
$destroy(): any;
|
|
91
|
-
$terminate(): void;
|
|
92
|
-
__addEmits(event: string): void;
|
|
93
|
-
__removeEmits(event: string): void;
|
|
94
|
-
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
95
|
-
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
96
|
-
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
97
|
-
$emit(event: string, ...args: unknown[]): void;
|
|
98
|
-
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
99
|
-
dispatchEvent(event: Event): boolean;
|
|
100
|
-
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
101
|
-
};
|
|
102
|
-
config: {
|
|
103
|
-
name: string;
|
|
104
|
-
options: {
|
|
105
|
-
activeBreakpoints: StringConstructor;
|
|
106
|
-
inactiveBreakpoints: StringConstructor;
|
|
107
|
-
};
|
|
108
|
-
debug?: boolean;
|
|
109
|
-
log?: boolean;
|
|
110
|
-
refs?: string[];
|
|
111
|
-
emits?: string[];
|
|
112
|
-
components?: import("../Base/index.js").BaseConfigComponents;
|
|
113
|
-
};
|
|
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>;
|
|
119
|
-
};
|
|
120
|
-
export {};
|
|
15
|
+
export declare function withBreakpointObserver<S extends Base>(BaseClass: typeof Base): BaseDecorator<WithBreakpointObserverInterface, S>;
|
|
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
import useResize from "../services/
|
|
7
|
+
import { useResize } from "../services/index.js";
|
|
8
8
|
import { isDev } from "../utils/index.js";
|
|
9
9
|
function testBreakpoints(instance, breakpoint = useResize().props().breakpoint) {
|
|
10
10
|
const { activeBreakpoints, inactiveBreakpoints } = instance.$options;
|
|
@@ -98,5 +98,5 @@ function withBreakpointObserver(BaseClass) {
|
|
|
98
98
|
return WithBreakpointObserver;
|
|
99
99
|
}
|
|
100
100
|
export {
|
|
101
|
-
withBreakpointObserver
|
|
101
|
+
withBreakpointObserver
|
|
102
102
|
};
|
package/decorators/withDrag.cjs
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
6
|
var __export = (target, all) => {
|
|
@@ -17,10 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
-
mod
|
|
23
|
-
));
|
|
24
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
19
|
var __publicField = (obj, key, value) => {
|
|
26
20
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -30,18 +24,18 @@ var __publicField = (obj, key, value) => {
|
|
|
30
24
|
// packages/js-toolkit/decorators/withDrag.ts
|
|
31
25
|
var withDrag_exports = {};
|
|
32
26
|
__export(withDrag_exports, {
|
|
33
|
-
|
|
27
|
+
withDrag: () => withDrag
|
|
34
28
|
});
|
|
35
29
|
module.exports = __toCommonJS(withDrag_exports);
|
|
36
|
-
var
|
|
30
|
+
var import_services = require("../services/index.cjs");
|
|
37
31
|
function withDrag(BaseClass, { target = (instance) => instance.$el, ...options } = {}) {
|
|
38
32
|
class WithDrag extends BaseClass {
|
|
39
|
-
constructor(
|
|
40
|
-
super(
|
|
33
|
+
constructor(element) {
|
|
34
|
+
super(element);
|
|
41
35
|
this.$on("mounted", () => {
|
|
42
36
|
this.$services.register(
|
|
43
37
|
"dragged",
|
|
44
|
-
|
|
38
|
+
import_services.useDrag.bind(void 0, target.call(this, this), options)
|
|
45
39
|
);
|
|
46
40
|
this.$services.enable("dragged");
|
|
47
41
|
});
|
package/decorators/withDrag.d.ts
CHANGED
|
@@ -1,98 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
1
|
+
import type { BaseDecorator, BaseInterface } from '../Base/types.js';
|
|
2
|
+
import type { Base } from '../Base/index.js';
|
|
3
|
+
import type { DragServiceOptions, DragServiceProps } from '../services/drag.js';
|
|
4
|
+
export declare type DragDecoratorOptions = DragServiceOptions & {
|
|
4
5
|
target?: (this: Base, instance: Base) => HTMLElement;
|
|
5
6
|
};
|
|
7
|
+
export interface WithDragInterfacd extends BaseInterface {
|
|
8
|
+
dragged?(props: DragServiceProps): void;
|
|
9
|
+
}
|
|
6
10
|
/**
|
|
7
11
|
* Add dragging capabilities to a component.
|
|
8
12
|
*/
|
|
9
|
-
export
|
|
10
|
-
new (...args: any[]): {
|
|
11
|
-
$parent: Base<BaseTypeParameter>;
|
|
12
|
-
$id: string;
|
|
13
|
-
$el: HTMLElement & {
|
|
14
|
-
__base__?: WeakMap<BaseConstructor<Base<BaseTypeParameter>>, Base<BaseTypeParameter> | "terminated">;
|
|
15
|
-
};
|
|
16
|
-
$isMounted: boolean;
|
|
17
|
-
__eventHandlers: Map<string, Set<EventListenerOrEventListenerObject>>;
|
|
18
|
-
readonly $root: Base<BaseTypeParameter>;
|
|
19
|
-
readonly __config: import("../Base/index.js").BaseConfig;
|
|
20
|
-
__services: import("../Base/managers/ServicesManager.js").default;
|
|
21
|
-
readonly $services: import("../Base/managers/ServicesManager.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;
|
|
28
|
-
__events: import("../Base/managers/EventsManager.js").default;
|
|
29
|
-
readonly $log: (...args: unknown[]) => void;
|
|
30
|
-
readonly __debug: (...args: unknown[]) => void;
|
|
31
|
-
readonly __managers: import("../Base/index.js").Managers;
|
|
32
|
-
__callMethod(method: string, ...args: unknown[]): unknown;
|
|
33
|
-
__hasEvent(event: string): boolean;
|
|
34
|
-
$mount(): any;
|
|
35
|
-
$update(): any;
|
|
36
|
-
$destroy(): any;
|
|
37
|
-
$terminate(): void;
|
|
38
|
-
__addEmits(event: string): void;
|
|
39
|
-
__removeEmits(event: string): void;
|
|
40
|
-
readonly __ctor: BaseConstructor<Base<BaseTypeParameter>>;
|
|
41
|
-
$on(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): () => void;
|
|
42
|
-
$off(event: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
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;
|
|
84
|
-
addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
85
|
-
dispatchEvent(event: Event): boolean;
|
|
86
|
-
removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
87
|
-
};
|
|
88
|
-
config: {
|
|
89
|
-
name: string;
|
|
90
|
-
emits: string[];
|
|
91
|
-
};
|
|
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>;
|
|
97
|
-
};
|
|
98
|
-
export {};
|
|
13
|
+
export declare function withDrag<S extends Base>(BaseClass: typeof Base, { target, ...options }?: DragDecoratorOptions): BaseDecorator<BaseInterface, S>;
|
package/decorators/withDrag.js
CHANGED
|
@@ -4,11 +4,11 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
import useDrag from "../services/
|
|
7
|
+
import { useDrag } from "../services/index.js";
|
|
8
8
|
function withDrag(BaseClass, { target = (instance) => instance.$el, ...options } = {}) {
|
|
9
9
|
class WithDrag extends BaseClass {
|
|
10
|
-
constructor(
|
|
11
|
-
super(
|
|
10
|
+
constructor(element) {
|
|
11
|
+
super(element);
|
|
12
12
|
this.$on("mounted", () => {
|
|
13
13
|
this.$services.register(
|
|
14
14
|
"dragged",
|
|
@@ -29,5 +29,5 @@ function withDrag(BaseClass, { target = (instance) => instance.$el, ...options }
|
|
|
29
29
|
return WithDrag;
|
|
30
30
|
}
|
|
31
31
|
export {
|
|
32
|
-
withDrag
|
|
32
|
+
withDrag
|
|
33
33
|
};
|
|
@@ -30,7 +30,7 @@ var __publicField = (obj, key, value) => {
|
|
|
30
30
|
// packages/js-toolkit/decorators/withExtraConfig.ts
|
|
31
31
|
var withExtraConfig_exports = {};
|
|
32
32
|
__export(withExtraConfig_exports, {
|
|
33
|
-
|
|
33
|
+
withExtraConfig: () => withExtraConfig
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(withExtraConfig_exports);
|
|
36
36
|
var import_deepmerge = __toESM(require("deepmerge"), 1);
|