comfy-tool 1.0.3 → 1.0.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/@types/components/global.d.ts +3 -0
- package/@types/components/index.d.ts +4 -3
- package/@types/components/layout/Column/Column.d.ts +9 -0
- package/@types/components/layout/Column/index.d.ts +14 -0
- package/@types/components/layout/{Expended.vue.d.ts → Expanded/Expanded.d.ts} +16 -13
- package/@types/components/layout/Expanded/index.d.ts +38 -0
- package/@types/components/layout/Row/Row.d.ts +9 -0
- package/@types/components/layout/Row/index.d.ts +14 -0
- package/@types/components/utils/layer/Component.d.ts +24 -14
- package/@types/components/utils/layer/index.d.ts +1 -1
- package/@types/components/utils/layer/layer.d.ts +13 -20
- package/@types/constants/library.d.ts +3 -0
- package/@types/demo/App.vue.d.ts +3 -0
- package/@types/demo/components/AppDialog.vue.d.ts +23 -0
- package/@types/demo/components/Child.vue.d.ts +5 -0
- package/@types/demo/components/Child2.vue.d.ts +5 -0
- package/@types/demo/components/Dialog.vue.d.ts +20 -0
- package/@types/demo/components/TestWorld.vue.d.ts +5 -0
- package/@types/demo/hooks/use-layer.d.ts +24 -0
- package/@types/demo/hooks/use-test-layer.d.ts +6 -0
- package/@types/globals.d.ts +13 -33
- package/@types/index.d.ts +2 -3
- package/@types/plugins/PopupCreator.d.ts +2 -1
- package/@types/shims-vue.d.ts +2 -1
- package/@types/utils/app/component.d.ts +1 -1
- package/@types/utils/app/installer.d.ts +8 -0
- package/@types/utils/tools.d.ts +11 -0
- package/@types/utils/ui/index.d.ts +3 -0
- package/@types/utils/util/array.d.ts +1 -0
- package/@types/utils/util/basic.d.ts +2 -6
- package/@types/utils/util/date.d.ts +1 -1
- package/@types/utils/util/{formate.d.ts → format.d.ts} +1 -0
- package/@types/utils/util/function.d.ts +1 -1
- package/@types/utils/util/index.d.ts +5 -10
- package/@types/utils/util/url.d.ts +21 -2
- package/README.md +124 -40
- package/dist/index.css +1 -1
- package/dist/index.min.js +1 -1
- package/es/index.mjs +397 -792
- package/es/utils.mjs +484 -0
- package/lib/index.js +1 -1
- package/lib/utils.js +1 -0
- package/package.json +29 -14
- package/web-types.json +1 -0
- package/@types/components/layout/Column.vue.d.ts +0 -26
- package/@types/components/layout/Row.vue.d.ts +0 -26
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
export * from './layout/Column';
|
|
2
|
+
export * from './layout/Row';
|
|
3
|
+
export * from './layout/Expanded';
|
|
4
|
+
export * from './utils/layer';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './index.scss';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
reverse: BooleanConstructor;
|
|
4
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
5
|
+
reverse: BooleanConstructor;
|
|
6
|
+
}>> & Readonly<{}>, {
|
|
7
|
+
reverse: boolean;
|
|
8
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import _Column from './Column';
|
|
2
|
+
export declare const Column: import("../../../utils/app/component").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
reverse: BooleanConstructor;
|
|
4
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
5
|
+
reverse: BooleanConstructor;
|
|
6
|
+
}>> & Readonly<{}>, {
|
|
7
|
+
reverse: boolean;
|
|
8
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
9
|
+
export default Column;
|
|
10
|
+
declare module 'vue' {
|
|
11
|
+
interface GlobalComponents {
|
|
12
|
+
column: typeof _Column;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
+
import './index.scss';
|
|
1
2
|
import { PropType } from "vue";
|
|
2
|
-
type _style = {
|
|
3
|
-
flex: string | number;
|
|
4
|
-
width?: string;
|
|
5
|
-
height?: string;
|
|
6
|
-
minWidth?: string;
|
|
7
|
-
minHeight?: string;
|
|
8
|
-
maxWidth?: string;
|
|
9
|
-
maxHeight?: string;
|
|
10
|
-
};
|
|
11
3
|
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
/** 当需要设定宽高时可能需要设置为 `-`;需要撑满容器时设置为 `100%` */
|
|
12
5
|
flex: {
|
|
13
6
|
type: PropType<"-" | "100%" | number>;
|
|
14
7
|
default: number;
|
|
@@ -18,13 +11,17 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
18
11
|
minWidth: (StringConstructor | NumberConstructor)[];
|
|
19
12
|
minHeight: (StringConstructor | NumberConstructor)[];
|
|
20
13
|
maxWidth: (StringConstructor | NumberConstructor)[];
|
|
14
|
+
/**
|
|
15
|
+
* @description 最大高度
|
|
16
|
+
* @default 'none'
|
|
17
|
+
*/
|
|
21
18
|
maxHeight: (StringConstructor | NumberConstructor)[];
|
|
19
|
+
/** 启用flexbox横向布局 */
|
|
22
20
|
row: BooleanConstructor;
|
|
21
|
+
/** 启用flexbox纵向布局 */
|
|
23
22
|
column: BooleanConstructor;
|
|
24
|
-
}>, {
|
|
25
|
-
|
|
26
|
-
className: string[];
|
|
27
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
|
+
/** 当需要设定宽高时可能需要设置为 `-`;需要撑满容器时设置为 `100%` */
|
|
28
25
|
flex: {
|
|
29
26
|
type: PropType<"-" | "100%" | number>;
|
|
30
27
|
default: number;
|
|
@@ -34,8 +31,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
34
31
|
minWidth: (StringConstructor | NumberConstructor)[];
|
|
35
32
|
minHeight: (StringConstructor | NumberConstructor)[];
|
|
36
33
|
maxWidth: (StringConstructor | NumberConstructor)[];
|
|
34
|
+
/**
|
|
35
|
+
* @description 最大高度
|
|
36
|
+
* @default 'none'
|
|
37
|
+
*/
|
|
37
38
|
maxHeight: (StringConstructor | NumberConstructor)[];
|
|
39
|
+
/** 启用flexbox横向布局 */
|
|
38
40
|
row: BooleanConstructor;
|
|
41
|
+
/** 启用flexbox纵向布局 */
|
|
39
42
|
column: BooleanConstructor;
|
|
40
43
|
}>> & Readonly<{}>, {
|
|
41
44
|
column: boolean;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import _Expanded from './Expanded';
|
|
2
|
+
export declare const Expanded: import("../../../utils/app/component").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
flex: {
|
|
4
|
+
type: import("vue").PropType<"-" | "100%" | number>;
|
|
5
|
+
default: number;
|
|
6
|
+
};
|
|
7
|
+
width: (StringConstructor | NumberConstructor)[];
|
|
8
|
+
height: (StringConstructor | NumberConstructor)[];
|
|
9
|
+
minWidth: (StringConstructor | NumberConstructor)[];
|
|
10
|
+
minHeight: (StringConstructor | NumberConstructor)[];
|
|
11
|
+
maxWidth: (StringConstructor | NumberConstructor)[];
|
|
12
|
+
maxHeight: (StringConstructor | NumberConstructor)[];
|
|
13
|
+
row: BooleanConstructor;
|
|
14
|
+
column: BooleanConstructor;
|
|
15
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
+
flex: {
|
|
17
|
+
type: import("vue").PropType<"-" | "100%" | number>;
|
|
18
|
+
default: number;
|
|
19
|
+
};
|
|
20
|
+
width: (StringConstructor | NumberConstructor)[];
|
|
21
|
+
height: (StringConstructor | NumberConstructor)[];
|
|
22
|
+
minWidth: (StringConstructor | NumberConstructor)[];
|
|
23
|
+
minHeight: (StringConstructor | NumberConstructor)[];
|
|
24
|
+
maxWidth: (StringConstructor | NumberConstructor)[];
|
|
25
|
+
maxHeight: (StringConstructor | NumberConstructor)[];
|
|
26
|
+
row: BooleanConstructor;
|
|
27
|
+
column: BooleanConstructor;
|
|
28
|
+
}>> & Readonly<{}>, {
|
|
29
|
+
column: boolean;
|
|
30
|
+
row: boolean;
|
|
31
|
+
flex: number | "-" | "100%";
|
|
32
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
33
|
+
export default Expanded;
|
|
34
|
+
declare module 'vue' {
|
|
35
|
+
interface GlobalComponents {
|
|
36
|
+
expanded: typeof _Expanded;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './index.scss';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
reverse: BooleanConstructor;
|
|
4
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
5
|
+
reverse: BooleanConstructor;
|
|
6
|
+
}>> & Readonly<{}>, {
|
|
7
|
+
reverse: boolean;
|
|
8
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import _Row from './Row';
|
|
2
|
+
export declare const Row: import("../../../utils/app/component").WithInstall<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
reverse: BooleanConstructor;
|
|
4
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
5
|
+
reverse: BooleanConstructor;
|
|
6
|
+
}>> & Readonly<{}>, {
|
|
7
|
+
reverse: boolean;
|
|
8
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
9
|
+
export default Row;
|
|
10
|
+
declare module 'vue' {
|
|
11
|
+
interface GlobalComponents {
|
|
12
|
+
row: typeof _Row;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { Ref, CSSProperties } from "vue";
|
|
1
|
+
import type { Ref, CSSProperties, PropType } from "vue";
|
|
2
2
|
import { LayerOptions } from "./layer";
|
|
3
|
-
declare const VanDialog: VueComponentConstructor;
|
|
4
|
-
type noReadonly<T> = {
|
|
5
|
-
-readonly [P in keyof T]: T[P];
|
|
6
|
-
};
|
|
7
3
|
type GetVueProps<T> = {
|
|
8
4
|
[P in keyof T]: T[P] | Ref<T[P]>;
|
|
9
5
|
};
|
|
10
|
-
|
|
6
|
+
type VueComponentConstructor = (abstract new (...args: any) => any);
|
|
7
|
+
type GetComponentProps<C extends VueComponentConstructor> = GetVueProps<InstanceType<C>['$props']>;
|
|
8
|
+
export type LayerComponent = VueComponentConstructor;
|
|
9
|
+
export type LayerComponentProps<C extends VueComponentConstructor> = GetComponentProps<C>;
|
|
11
10
|
export type LayerControler<T, C extends VueComponentConstructor, B extends VueComponentConstructor> = {
|
|
12
11
|
init(options?: Partial<LayerState<C, B> & LayerOptions<T>>, _defaultOptions?: Partial<LayerState<C, B>>): void;
|
|
13
12
|
open(options?: Partial<LayerState<C, B>>): void;
|
|
@@ -15,8 +14,9 @@ export type LayerControler<T, C extends VueComponentConstructor, B extends VueCo
|
|
|
15
14
|
close(action?: 'complete' | 'cancel'): void;
|
|
16
15
|
cancel(): void;
|
|
17
16
|
};
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
export interface LayerProps {
|
|
18
|
+
width?: string | number;
|
|
19
|
+
height?: string | number;
|
|
20
20
|
class?: string;
|
|
21
21
|
style?: CSSProperties;
|
|
22
22
|
onClose?(action?: 'complete' | 'cancel'): void;
|
|
@@ -25,15 +25,25 @@ export interface LayerState<C extends VueComponentConstructor, B extends VueComp
|
|
|
25
25
|
show: boolean;
|
|
26
26
|
keepAlive: boolean;
|
|
27
27
|
baseContent?: B;
|
|
28
|
-
baseContentProps?:
|
|
28
|
+
baseContentProps?: GetComponentProps<B>;
|
|
29
29
|
content: C;
|
|
30
|
-
contentProps?:
|
|
30
|
+
contentProps?: GetComponentProps<C>;
|
|
31
31
|
}
|
|
32
|
-
declare const _default: import("vue").DefineComponent<
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
33
|
+
baseContent: {
|
|
34
|
+
type: PropType<VueComponentConstructor>;
|
|
35
|
+
default: null;
|
|
36
|
+
};
|
|
37
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "close" | "confirm")[], "cancel" | "close" | "confirm", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
|
+
baseContent: {
|
|
39
|
+
type: PropType<VueComponentConstructor>;
|
|
40
|
+
default: null;
|
|
41
|
+
};
|
|
42
|
+
}>> & Readonly<{
|
|
35
43
|
onCancel?: ((...args: any[]) => any) | undefined;
|
|
36
44
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
37
45
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
|
38
|
-
}>, {
|
|
46
|
+
}>, {
|
|
47
|
+
baseContent: VueComponentConstructor;
|
|
48
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
39
49
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Layer } from './layer';
|
|
2
|
-
export type { LayerProps, LayerInstance, LayerOptions, LayerState, LayerControler,
|
|
2
|
+
export type { LayerProps, LayerInstance, LayerOptions, LayerState, LayerControler, LayerComponent, LayerComponentProps } from './layer';
|
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
import { PopupCreator, VueComponent } from '../../../plugins/PopupCreator';
|
|
2
|
-
import { LayerState, LayerProps,
|
|
3
|
-
export type { LayerState, LayerProps, LayerControler,
|
|
4
|
-
export type LayerOptions<T = any, C extends
|
|
2
|
+
import { LayerState, LayerProps, LayerComponent } from './Component';
|
|
3
|
+
export type { LayerState, LayerProps, LayerControler, LayerComponent, LayerComponentProps } from './Component';
|
|
4
|
+
export type LayerOptions<T = any, C extends LayerComponent = any, B extends LayerComponent = any> = Partial<LayerState<C, B>> & {
|
|
5
5
|
onConfirm?: (data: T, close: (action?: 'complete' | 'cancel') => void) => void | boolean;
|
|
6
6
|
onClose?(action?: 'complete' | 'cancel'): void;
|
|
7
7
|
};
|
|
8
|
-
export type LayerInstance<T, C extends
|
|
9
|
-
declare class _Layer<T, C extends
|
|
8
|
+
export type LayerInstance<T, C extends LayerComponent, B extends LayerComponent> = _Layer<T, C, B>;
|
|
9
|
+
declare class _Layer<T, C extends LayerComponent, B extends LayerComponent> extends PopupCreator<LayerProps, LayerState<C, B>> {
|
|
10
10
|
constructor(component: VueComponent, props: Partial<LayerProps>);
|
|
11
11
|
open(options: LayerOptions<T, C>): any;
|
|
12
|
-
static create<T, C extends
|
|
12
|
+
static create<T, C extends LayerComponent, B extends LayerComponent>(props?: LayerOptions<T, C, B>, isNew?: boolean): _Layer<T, C, B>;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* 创建并打开一个弹层组件
|
|
16
|
+
* @param options 图层配置选项,必须包含content属性
|
|
17
|
+
* @param isNew 是否为新弹层,默认为false
|
|
18
|
+
* @returns 返回一个Promise,成功时resolve弹层数据,失败时reject关闭操作
|
|
19
|
+
*/
|
|
20
|
+
export declare function Layer<T, C extends LayerComponent = any, B extends LayerComponent = any>(options: RequiredOf<LayerOptions<T, C, B>, 'content'>, isNew?: boolean): Promise<T>;
|
|
15
21
|
export declare namespace Layer {
|
|
16
22
|
var create: typeof _Layer.create;
|
|
17
23
|
var close: () => void;
|
|
18
|
-
var Component: import("vue").DefineComponent<{}, () => "" | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
19
|
-
[key: string]: any;
|
|
20
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "close" | "confirm")[], "cancel" | "close" | "confirm", import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
21
|
-
onCancel?: ((...args: any[]) => any) | undefined;
|
|
22
|
-
onClose?: ((...args: any[]) => any) | undefined;
|
|
23
|
-
onConfirm?: ((...args: any[]) => any) | undefined;
|
|
24
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any> | import("../../../utils/app/component").WithInstall<import("vue").DefineComponent<{}, () => "" | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
25
|
-
[key: string]: any;
|
|
26
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cancel" | "close" | "confirm")[], "cancel" | "close" | "confirm", import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
27
|
-
onCancel?: ((...args: any[]) => any) | undefined;
|
|
28
|
-
onClose?: ((...args: any[]) => any) | undefined;
|
|
29
|
-
onConfirm?: ((...args: any[]) => any) | undefined;
|
|
30
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>>;
|
|
31
24
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import 'element-plus/dist/index.css';
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
show: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_11: string | number, __VLS_12: {}, __VLS_15: {}, __VLS_17: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
[K in NonNullable<typeof __VLS_11>]?: (props: typeof __VLS_12) => any;
|
|
7
|
+
} & {
|
|
8
|
+
title?: (props: typeof __VLS_15) => any;
|
|
9
|
+
} & {
|
|
10
|
+
header?: (props: typeof __VLS_17) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
"update:show": (...args: any[]) => void;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
20
|
+
new (): {
|
|
21
|
+
$slots: S;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
childMessage?: string;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
childMessage?: string;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title?: string;
|
|
3
|
+
show?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_1: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_1) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
"update:show": (...args: any[]) => void;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
"onUpdate:show"?: ((...args: any[]) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title: string;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Layer, LayerComponent, LayerComponentProps } from '../../index';
|
|
2
|
+
export declare function elLayer<C extends LayerComponent>(options: {
|
|
3
|
+
content: C;
|
|
4
|
+
contentProps: LayerComponentProps<C>;
|
|
5
|
+
} & Parameters<typeof Layer>[0]): void;
|
|
6
|
+
export declare function appLayer<C extends LayerComponent>(options: {
|
|
7
|
+
content: C;
|
|
8
|
+
contentProps: LayerComponentProps<C>;
|
|
9
|
+
} & Parameters<typeof Layer>[0]): Promise<unknown>;
|
|
10
|
+
export declare namespace appLayer {
|
|
11
|
+
var create: (options: Parameters<typeof Layer>[0]) => {
|
|
12
|
+
open(options: import("../../index").LayerOptions<unknown, abstract new (...args: any) => any, any>): any;
|
|
13
|
+
component: import("../../plugins/PopupCreator.js").VueComponent;
|
|
14
|
+
appDOM: HTMLDivElement;
|
|
15
|
+
instance: import("vue").ComponentPublicInstance<any, any, S>;
|
|
16
|
+
container: HTMLDivElement;
|
|
17
|
+
properties: Partial<import("../../index").LayerProps>;
|
|
18
|
+
init(): void;
|
|
19
|
+
mount(): void;
|
|
20
|
+
unmount(): void;
|
|
21
|
+
close(): void;
|
|
22
|
+
toggle(show: boolean, options?: any): void;
|
|
23
|
+
};
|
|
24
|
+
}
|
package/@types/globals.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
+
import type { LayerControler, LayerComponent } from '.';
|
|
1
2
|
import type { Ref } from "vue";
|
|
2
|
-
import type Column from './components/layout/Column.vue.d.ts';
|
|
3
|
-
import type Row from './components/layout/Row.vue.d.ts';
|
|
4
|
-
import type Expended from './components/layout/Expended.vue.d.ts';
|
|
5
3
|
declare global {
|
|
6
4
|
interface Window {
|
|
7
5
|
|
|
@@ -10,38 +8,24 @@ declare global {
|
|
|
10
8
|
function parseFloat(string: string|number): number
|
|
11
9
|
function parseInt(string: string|number): number
|
|
12
10
|
|
|
13
|
-
type ObjectKeyType = string|number|symbol;
|
|
14
|
-
//通用图表
|
|
15
|
-
interface ChartData {
|
|
16
|
-
title: string;
|
|
17
|
-
data: string[];
|
|
18
|
-
series: {
|
|
19
|
-
name: string;
|
|
20
|
-
data: number[];
|
|
21
|
-
[key:string]:any
|
|
22
|
-
}[];
|
|
23
|
-
[key:string]:any
|
|
24
|
-
}
|
|
25
|
-
// 选项通用类型
|
|
26
|
-
type SelectedData<T=string|number> = {
|
|
27
|
-
text:string,
|
|
28
|
-
value:T
|
|
29
|
-
children?:SelectedData<T>[],
|
|
30
|
-
[key:Exclude<string, 'text'|'value'|'children'>]:any
|
|
31
|
-
}
|
|
32
11
|
/**
|
|
33
|
-
*
|
|
12
|
+
* 对象属性类型
|
|
13
|
+
*/
|
|
14
|
+
type ObjectKeyType = string|symbol;
|
|
15
|
+
/**
|
|
16
|
+
* 获取对象属性,排除指定属性
|
|
34
17
|
*/
|
|
35
18
|
type PickEx<T, K extends keyof T> = { [P in Exclude<keyof T, K>]: T[P]; }
|
|
19
|
+
/**
|
|
20
|
+
* 获取Promise函数返回值类型
|
|
21
|
+
*/
|
|
36
22
|
type PromiseReturnType<T> = T extends (...arg:any[]) => Promise<infer R> ? R : T;
|
|
37
|
-
|
|
38
|
-
type GetFirstArguments<T extends (...args: any[]) => any> = GetArguments<T>[0];
|
|
23
|
+
/** 部分属性可选 */
|
|
39
24
|
type PartialOf<T, U extends keyof T> = PickEx<T, U>&Partial<T>
|
|
25
|
+
/** 部分属性必填 */
|
|
40
26
|
type RequiredOf<T, U extends keyof T> = Required<Pick<T, U>>&Partial<T>
|
|
41
27
|
/** 获(对象或数组)取子属性 */
|
|
42
28
|
type PickChild<T, K extends keyof T> = T extends (infer R)[] ? R : T[K];
|
|
43
|
-
/** 获取数组中的元素类型 */
|
|
44
|
-
type GetElementType<T> = T extends (infer R)[] ? R : never;
|
|
45
29
|
interface ScrollToOptions {
|
|
46
30
|
target?: Ref<any>|any
|
|
47
31
|
right?: number
|
|
@@ -51,11 +35,7 @@ declare global {
|
|
|
51
35
|
beforeScroll?(next:()=>void, options:ScrollToOptions, container:HTMLElement):void
|
|
52
36
|
}
|
|
53
37
|
}
|
|
54
|
-
declare module '
|
|
55
|
-
export
|
|
56
|
-
column: typeof Column,
|
|
57
|
-
row: typeof Row,
|
|
58
|
-
expended: typeof Expended,
|
|
59
|
-
}
|
|
38
|
+
declare module 'vue' {
|
|
39
|
+
export function inject<T, C extends LayerComponent=any>(key:'Layer', d?: LayerControler<T, C>):LayerControler<T, C>|undefined;
|
|
60
40
|
}
|
|
61
41
|
export {};
|
package/@types/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { App } from 'vue';
|
|
2
2
|
import { Util } from './utils/index';
|
|
3
|
-
export
|
|
3
|
+
export * from './components';
|
|
4
|
+
export * from './utils/app/installer';
|
|
4
5
|
export { resourceLoader } from './utils/index';
|
|
5
|
-
export * from './components/utils/layer';
|
|
6
6
|
export { version } from './constants/version';
|
|
7
7
|
export declare const ComfyTool: typeof Util;
|
|
8
|
-
export declare function useComfyTool(app: App): void;
|
|
9
8
|
declare const installer: {
|
|
10
9
|
install(app: App): void;
|
|
11
10
|
};
|
|
@@ -8,13 +8,14 @@ export declare abstract class PopupCreator<P extends {
|
|
|
8
8
|
show: boolean;
|
|
9
9
|
}> {
|
|
10
10
|
component: VueComponent;
|
|
11
|
-
appDOM:
|
|
11
|
+
appDOM: HTMLDivElement;
|
|
12
12
|
instance: ComponentPublicInstance<any, any, S>;
|
|
13
13
|
container: HTMLDivElement;
|
|
14
14
|
properties: Partial<P>;
|
|
15
15
|
constructor(Component: VueComponent, properties: Partial<P>);
|
|
16
16
|
private init;
|
|
17
17
|
static use(options: typeof Config): void;
|
|
18
|
+
mount(): void;
|
|
18
19
|
unmount(): void;
|
|
19
20
|
abstract open(...args: ParamsType<P>[]): void;
|
|
20
21
|
close(): void;
|
package/@types/shims-vue.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export type WithInstall<T> = T & {
|
|
|
31
31
|
* @return {*}
|
|
32
32
|
*/
|
|
33
33
|
export declare function withInstall<T>(plugin: T): WithInstall<T>;
|
|
34
|
-
export type VNodeProps =
|
|
34
|
+
export type VNodeProps = Parameters<typeof h>[1];
|
|
35
35
|
export declare function renderComponent<T extends VNodeProps>(comp?: any, defaultComp?: any, props?: T): any;
|
|
36
36
|
export declare function isVueComponent(target: any): boolean;
|
|
37
37
|
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** 通用函数在此导入 */
|
|
2
|
+
export * from './util/url';
|
|
3
|
+
export * from './util/cloneObject';
|
|
4
|
+
export * from './util/format';
|
|
5
|
+
export * from './util/basic';
|
|
6
|
+
export * from './util/array';
|
|
7
|
+
export * from './util/number';
|
|
8
|
+
export * from './util/date';
|
|
9
|
+
export * from './util/week';
|
|
10
|
+
export * from './util/function';
|
|
11
|
+
export * from './util/string';
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export declare function noop(): void;
|
|
2
|
+
export declare function noopCatch(err: any): void;
|
|
3
|
+
export declare function errorCatch(err: string): void;
|
|
1
4
|
export declare function $toast(msg: string): void;
|
|
2
5
|
export declare function $alert(msg: string): void;
|
|
3
6
|
export declare const $loading: {
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { Util } from "..";
|
|
2
1
|
type ObjectType = 'Object' | 'Array' | 'FormData' | 'Undefined' | 'Null' | 'Number' | 'String' | 'Function' | 'Boolnean' | 'Error' | 'Promise';
|
|
3
|
-
export declare function noop(): void;
|
|
4
|
-
export declare function noopCatch(err: any): void;
|
|
5
|
-
export declare function errorCatch(err: string): void;
|
|
6
2
|
export declare const extend: {
|
|
7
3
|
<T extends {}, U>(target: T, source: U): T & U;
|
|
8
4
|
<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
|
|
@@ -26,7 +22,7 @@ export type Writeable<T> = {
|
|
|
26
22
|
* @param {boolean} [ignoreUndefined=false]
|
|
27
23
|
* @return {*}
|
|
28
24
|
*/
|
|
29
|
-
export declare function pick<T, U extends keyof T>(obj: T, keys: ReadonlyArray<U>, ignoreUndefined?: boolean):
|
|
25
|
+
export declare function pick<T, U extends keyof T>(obj: T, keys: ReadonlyArray<U>, ignoreUndefined?: boolean): Writeable<Pick<T, U>>;
|
|
30
26
|
/**
|
|
31
27
|
* 从对象中取出非指定属性
|
|
32
28
|
*
|
|
@@ -38,7 +34,7 @@ export declare function pick<T, U extends keyof T>(obj: T, keys: ReadonlyArray<U
|
|
|
38
34
|
* @param {boolean} [ignoreUndefined=false]
|
|
39
35
|
* @return {*}
|
|
40
36
|
*/
|
|
41
|
-
export declare function pickEx<T extends Object, U extends keyof T>(obj: T, keys: Array<U>, ignoreUndefined?: boolean):
|
|
37
|
+
export declare function pickEx<T extends Object, U extends keyof T>(obj: T, keys: Array<U>, ignoreUndefined?: boolean): Writeable<PickEx<T, U>>;
|
|
42
38
|
/**
|
|
43
39
|
* 类型判断
|
|
44
40
|
*
|
|
@@ -13,7 +13,7 @@ interface configDate<T> {
|
|
|
13
13
|
*
|
|
14
14
|
* @export
|
|
15
15
|
* @param {(Date|number)} date
|
|
16
|
-
* @param {string} [format] YYYY-MM-DD HH:mm:SS
|
|
16
|
+
* @param {string} [format] YYYY-MM-DD HH:mm:SS 或 YYYY-MM-DD HH:mm:ss
|
|
17
17
|
* @return {*} {string}
|
|
18
18
|
*/
|
|
19
19
|
export declare function formatDate(date: Date | number | string, format?: string): string;
|
|
@@ -35,5 +35,5 @@ export declare function throttleAsync<T extends (...a: any[]) => Promise<any>>(f
|
|
|
35
35
|
*/
|
|
36
36
|
export declare function methodApply<T extends Function | Function[]>(target: T, args?: any[]): void;
|
|
37
37
|
export declare const Fn: {
|
|
38
|
-
cacheResult<T extends (...args: any) => any>(fn: T): (this: any, ...args:
|
|
38
|
+
cacheResult<T extends (...args: any) => any>(fn: T): (this: any, ...args: Parameters<T>) => any;
|
|
39
39
|
};
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export * from '
|
|
6
|
-
export * from './number';
|
|
7
|
-
export * from './date';
|
|
8
|
-
export * from './week';
|
|
9
|
-
export * from './function';
|
|
10
|
-
export * from './string';
|
|
1
|
+
/**
|
|
2
|
+
* 基础工具(不包含Dom、UI,属于通用工具包)
|
|
3
|
+
* 通用工具包应该放在 '../tools.ts' 中,防止部分没有浏览器环境(Node环境)的使用报错(如:document不存在)
|
|
4
|
+
*/
|
|
5
|
+
export * from '../tools';
|
|
11
6
|
export * from './dom';
|
|
12
7
|
export * from './other';
|
|
13
8
|
export * from '../ui/index';
|