@epie/bi-crud 2.0.1
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/README.md +226 -0
- package/dist/demo.html +1 -0
- package/dist/index.common.js +15761 -0
- package/dist/index.common.js.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.umd.js +15788 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/index.umd.min.js +20 -0
- package/dist/index.umd.min.js.map +1 -0
- package/index.d.ts +479 -0
- package/package.json +39 -0
- package/types/components/add-btn.d.ts +2 -0
- package/types/components/adv-btn.d.ts +2 -0
- package/types/components/adv-search.d.ts +48 -0
- package/types/components/context-menu/context-menu.d.ts +44 -0
- package/types/components/context-menu/index.d.ts +55 -0
- package/types/components/crud/helper.d.ts +15 -0
- package/types/components/crud/index.d.ts +184 -0
- package/types/components/custom-column.d.ts +37 -0
- package/types/components/dialog/index.d.ts +79 -0
- package/types/components/error-message.d.ts +6 -0
- package/types/components/filter-group.d.ts +41 -0
- package/types/components/filter.d.ts +6 -0
- package/types/components/flex1.d.ts +2 -0
- package/types/components/form/helper.d.ts +28 -0
- package/types/components/form/index.d.ts +11 -0
- package/types/components/form-tabs.d.ts +44 -0
- package/types/components/index.d.ts +2 -0
- package/types/components/multi-delete-btn.d.ts +2 -0
- package/types/components/pagination.d.ts +9 -0
- package/types/components/query.d.ts +35 -0
- package/types/components/refresh-btn.d.ts +2 -0
- package/types/components/search-key.d.ts +41 -0
- package/types/components/table/helper.d.ts +23 -0
- package/types/components/table/index.d.ts +59 -0
- package/types/components/upsert/index.d.ts +58 -0
- package/types/emitter.d.ts +3 -0
- package/types/hooks/browser.d.ts +4 -0
- package/types/hooks/core.d.ts +13 -0
- package/types/hooks/crud.d.ts +13 -0
- package/types/hooks/form.d.ts +6 -0
- package/types/hooks/index.d.ts +4 -0
- package/types/hooks/proxy.d.ts +1 -0
- package/types/index.d.ts +10 -0
- package/types/types/adv-search.d.ts +16 -0
- package/types/types/browser.d.ts +4 -0
- package/types/types/context-menu.d.ts +26 -0
- package/types/types/crud.d.ts +137 -0
- package/types/types/element-plus.d.ts +15 -0
- package/types/types/emitter.d.ts +16 -0
- package/types/types/form.d.ts +112 -0
- package/types/types/hook.d.ts +18 -0
- package/types/types/index.d.ts +1 -0
- package/types/types/render.d.ts +17 -0
- package/types/types/table.d.ts +91 -0
- package/types/types/test.d.ts +3 -0
- package/types/types/upsert.d.ts +29 -0
- package/types/utils/index.d.ts +18 -0
- package/types/utils/mitt.d.ts +9 -0
- package/types/utils/parse.d.ts +8 -0
- package/types/utils/test.d.ts +23 -0
- package/types/utils/vnode.d.ts +16 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/// <reference types="../index" />
|
|
2
|
+
import type { PropType } from "vue";
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
items: {
|
|
5
|
+
type: PropType<ClForm.Item[]>;
|
|
6
|
+
default: () => never[];
|
|
7
|
+
};
|
|
8
|
+
props: PropType<ElementPlus.FormProps | undefined>;
|
|
9
|
+
sync: BooleanConstructor;
|
|
10
|
+
op: PropType<{
|
|
11
|
+
hidden?: boolean | undefined;
|
|
12
|
+
saveButtonText?: string | undefined;
|
|
13
|
+
closeButtonText?: string | undefined;
|
|
14
|
+
buttons?: ("close" | "save" | Render.OpButton)[] | undefined;
|
|
15
|
+
} | undefined>;
|
|
16
|
+
dialog: PropType<{
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
title?: string | undefined;
|
|
19
|
+
width?: string | undefined;
|
|
20
|
+
hideHeader?: boolean | undefined;
|
|
21
|
+
controls?: ("close" | "fullscreen")[] | undefined;
|
|
22
|
+
} | undefined>;
|
|
23
|
+
onOpen: FunctionConstructor;
|
|
24
|
+
onClose: FunctionConstructor;
|
|
25
|
+
onInfo: FunctionConstructor;
|
|
26
|
+
onSubmit: FunctionConstructor;
|
|
27
|
+
}, any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("opened" | "closed")[], "opened" | "closed", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
28
|
+
items: {
|
|
29
|
+
type: PropType<ClForm.Item[]>;
|
|
30
|
+
default: () => never[];
|
|
31
|
+
};
|
|
32
|
+
props: PropType<ElementPlus.FormProps | undefined>;
|
|
33
|
+
sync: BooleanConstructor;
|
|
34
|
+
op: PropType<{
|
|
35
|
+
hidden?: boolean | undefined;
|
|
36
|
+
saveButtonText?: string | undefined;
|
|
37
|
+
closeButtonText?: string | undefined;
|
|
38
|
+
buttons?: ("close" | "save" | Render.OpButton)[] | undefined;
|
|
39
|
+
} | undefined>;
|
|
40
|
+
dialog: PropType<{
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
title?: string | undefined;
|
|
43
|
+
width?: string | undefined;
|
|
44
|
+
hideHeader?: boolean | undefined;
|
|
45
|
+
controls?: ("close" | "fullscreen")[] | undefined;
|
|
46
|
+
} | undefined>;
|
|
47
|
+
onOpen: FunctionConstructor;
|
|
48
|
+
onClose: FunctionConstructor;
|
|
49
|
+
onInfo: FunctionConstructor;
|
|
50
|
+
onSubmit: FunctionConstructor;
|
|
51
|
+
}>> & {
|
|
52
|
+
onClosed?: ((...args: any[]) => any) | undefined;
|
|
53
|
+
onOpened?: ((...args: any[]) => any) | undefined;
|
|
54
|
+
}, {
|
|
55
|
+
items: ClForm.Item[];
|
|
56
|
+
sync: boolean;
|
|
57
|
+
}>;
|
|
58
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="../index" />
|
|
2
|
+
export declare function useRefs(): {
|
|
3
|
+
refs: any;
|
|
4
|
+
setRefs: (index: number) => (el: HTMLElement) => void;
|
|
5
|
+
};
|
|
6
|
+
export declare function useTools(): {
|
|
7
|
+
browser: any;
|
|
8
|
+
style: any;
|
|
9
|
+
};
|
|
10
|
+
export declare function useCore(): {
|
|
11
|
+
crud: ClCrud.Provide;
|
|
12
|
+
mitt: Emitter;
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="../index" />
|
|
2
|
+
import { Ref } from "vue";
|
|
3
|
+
export declare function useCrud(options?: ClCrud.Props, cb?: (app: ClCrud.Ref) => void): Ref<ClCrud.Ref | undefined>;
|
|
4
|
+
export declare function useUpsert(options?: ClUpsert.Props): Ref<ClUpsert.Ref | undefined>;
|
|
5
|
+
export declare function useTable(options?: ClTable.Props): Ref<ClTable.Ref | undefined>;
|
|
6
|
+
export declare function useAdvSearch(options: ClAdvSearch.Props): Ref<ClAdvSearch.Ref | undefined>;
|
|
7
|
+
export declare function useForm(cb?: (app: ClForm.Ref) => void): Ref<ClForm.Ref | undefined>;
|
|
8
|
+
export declare function useDialog(options?: {
|
|
9
|
+
onFullscreen(visible: boolean): void;
|
|
10
|
+
}): {
|
|
11
|
+
fullscreen: Ref<boolean>;
|
|
12
|
+
visible: Ref<boolean>;
|
|
13
|
+
} | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useProxy(ret: any): void;
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare namespace ClAdvSearch {
|
|
2
|
+
interface Props {
|
|
3
|
+
items: ClForm.Item[];
|
|
4
|
+
title?: string;
|
|
5
|
+
size?: string | number;
|
|
6
|
+
op?: Array<"clear" | "reset" | "close" | "save">;
|
|
7
|
+
onSearch?(
|
|
8
|
+
data: any,
|
|
9
|
+
event: {
|
|
10
|
+
next(params: any): void;
|
|
11
|
+
close(): void;
|
|
12
|
+
}
|
|
13
|
+
): void;
|
|
14
|
+
}
|
|
15
|
+
interface Ref extends ClForm.Ref {}
|
|
16
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare namespace ClContextMenu {
|
|
2
|
+
interface Item {
|
|
3
|
+
label: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
prefixIcon?: string;
|
|
6
|
+
suffixIcon?: string;
|
|
7
|
+
ellipsis?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
hidden?: boolean;
|
|
10
|
+
children?: Item[];
|
|
11
|
+
showChildren?: boolean;
|
|
12
|
+
callback?(done: fun): void;
|
|
13
|
+
}
|
|
14
|
+
interface Event {
|
|
15
|
+
pageX: number;
|
|
16
|
+
pageY: number;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}
|
|
19
|
+
interface Options {
|
|
20
|
+
list: Item[];
|
|
21
|
+
}
|
|
22
|
+
interface Ref {
|
|
23
|
+
open(event: Event, options: Options): Ref;
|
|
24
|
+
close(): void;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
declare namespace ClCrud {
|
|
2
|
+
interface Dict {
|
|
3
|
+
api?: {
|
|
4
|
+
list?: string;
|
|
5
|
+
add?: string;
|
|
6
|
+
update?: string;
|
|
7
|
+
delete?: string;
|
|
8
|
+
info?: string;
|
|
9
|
+
page?: string;
|
|
10
|
+
};
|
|
11
|
+
pagination?: {
|
|
12
|
+
page?: string;
|
|
13
|
+
size?: string;
|
|
14
|
+
};
|
|
15
|
+
search?: {
|
|
16
|
+
keyWord?: string;
|
|
17
|
+
query?: string;
|
|
18
|
+
};
|
|
19
|
+
sort?: {
|
|
20
|
+
order?: string;
|
|
21
|
+
prop?: string;
|
|
22
|
+
};
|
|
23
|
+
label?: {
|
|
24
|
+
add?: string;
|
|
25
|
+
delete?: string;
|
|
26
|
+
multiDelete?: string;
|
|
27
|
+
update?: string;
|
|
28
|
+
refresh?: string;
|
|
29
|
+
advSearch?: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
interface Permission {
|
|
33
|
+
page?: boolean;
|
|
34
|
+
list?: boolean;
|
|
35
|
+
add?: boolean;
|
|
36
|
+
delete?: boolean;
|
|
37
|
+
update?: boolean;
|
|
38
|
+
info?: boolean;
|
|
39
|
+
[key: string]: any;
|
|
40
|
+
}
|
|
41
|
+
interface Service {
|
|
42
|
+
page: {
|
|
43
|
+
params: {
|
|
44
|
+
page?: number;
|
|
45
|
+
size?: number;
|
|
46
|
+
keyWord?: string;
|
|
47
|
+
[key: string]: any;
|
|
48
|
+
};
|
|
49
|
+
result: {
|
|
50
|
+
list: any[];
|
|
51
|
+
pagination?: {
|
|
52
|
+
total?: number;
|
|
53
|
+
page?: number;
|
|
54
|
+
size?: number;
|
|
55
|
+
};
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
};
|
|
58
|
+
request(
|
|
59
|
+
params?: Service["page"]["params"]
|
|
60
|
+
): Promise<Service["page"]["result"]>;
|
|
61
|
+
};
|
|
62
|
+
delete: {
|
|
63
|
+
params: {
|
|
64
|
+
ids?: Array<string | number>;
|
|
65
|
+
[key: string]: any;
|
|
66
|
+
};
|
|
67
|
+
request(params: Service["delete"]["params"]): Promise<any>;
|
|
68
|
+
};
|
|
69
|
+
info: {
|
|
70
|
+
params: {
|
|
71
|
+
id?: string | number;
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
};
|
|
74
|
+
request(params: Service["info"]["params"]): Promise<any>;
|
|
75
|
+
};
|
|
76
|
+
upsert: {
|
|
77
|
+
request(params: any): Promise<any>;
|
|
78
|
+
};
|
|
79
|
+
list: {
|
|
80
|
+
request(params: any): Promise<any[]>;
|
|
81
|
+
};
|
|
82
|
+
api: {
|
|
83
|
+
page?(params?: any): Promise<any>;
|
|
84
|
+
list?(params?: any): Promise<any>;
|
|
85
|
+
add?(params?: any): Promise<any>;
|
|
86
|
+
update?(params?: any): Promise<any>;
|
|
87
|
+
info?(params?: any): Promise<any>;
|
|
88
|
+
delete?(params?: any): Promise<any>;
|
|
89
|
+
[key: string]: any;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
interface Props {
|
|
93
|
+
service: Service["api"];
|
|
94
|
+
permission?: Permission;
|
|
95
|
+
dict?: Dict;
|
|
96
|
+
onRefresh?(
|
|
97
|
+
params: Service["page"]["params"],
|
|
98
|
+
event: {
|
|
99
|
+
done: fun;
|
|
100
|
+
next: Service["page"]["request"];
|
|
101
|
+
render: (
|
|
102
|
+
list: any[],
|
|
103
|
+
pagination?: Service["page"]["result"]["pagination"]
|
|
104
|
+
) => void;
|
|
105
|
+
}
|
|
106
|
+
): any;
|
|
107
|
+
onDelete?(
|
|
108
|
+
selection: any[],
|
|
109
|
+
event: {
|
|
110
|
+
next: Service["delete"]["request"];
|
|
111
|
+
}
|
|
112
|
+
): any;
|
|
113
|
+
}
|
|
114
|
+
interface Ref {
|
|
115
|
+
name: string;
|
|
116
|
+
routePath: string;
|
|
117
|
+
permission: Permission;
|
|
118
|
+
dict: Dict;
|
|
119
|
+
service: Service["api"];
|
|
120
|
+
loading: boolean;
|
|
121
|
+
params: any;
|
|
122
|
+
selection: any[];
|
|
123
|
+
set(key: "dict" | "style" | "service" | "permission", value: any): void;
|
|
124
|
+
done(): void;
|
|
125
|
+
getParams(): any;
|
|
126
|
+
getPermission(key?: string): boolean;
|
|
127
|
+
rowAdd(): any;
|
|
128
|
+
rowEdit(data: any): any;
|
|
129
|
+
rowAppend(data?: any): any;
|
|
130
|
+
rowClose(): any;
|
|
131
|
+
rowDelete(...selection: any[]): void;
|
|
132
|
+
refresh: Service["page"]["request"];
|
|
133
|
+
}
|
|
134
|
+
interface Provide extends Ref {
|
|
135
|
+
[key: string]: any;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare namespace ElementPlus {
|
|
2
|
+
type Size = "large" | "default" | "small";
|
|
3
|
+
interface FormProps {
|
|
4
|
+
inline?: boolean;
|
|
5
|
+
labelPosition?: "left" | "right" | "top";
|
|
6
|
+
labelWidth?: string | number;
|
|
7
|
+
labelSuffix?: string;
|
|
8
|
+
hideRequiredAsterisk?: boolean;
|
|
9
|
+
showMessage?: boolean;
|
|
10
|
+
inlineMessage?: boolean;
|
|
11
|
+
statusIcon?: boolean;
|
|
12
|
+
validateOnRuleChange?: boolean;
|
|
13
|
+
size?: Size;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare interface EmitterItem {
|
|
2
|
+
name: string;
|
|
3
|
+
callback(
|
|
4
|
+
data: any,
|
|
5
|
+
events: {
|
|
6
|
+
refresh(params: any): void;
|
|
7
|
+
crudList: ClCrud.Ref[];
|
|
8
|
+
}
|
|
9
|
+
): void;
|
|
10
|
+
}
|
|
11
|
+
declare interface Emitter {
|
|
12
|
+
list: EmitterItem[];
|
|
13
|
+
init(events: any): void;
|
|
14
|
+
emit(name: string, data?: any): void;
|
|
15
|
+
on(name: string, callback: any): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
declare namespace ClForm {
|
|
2
|
+
interface Item {
|
|
3
|
+
type?: "tabs";
|
|
4
|
+
prop?: string;
|
|
5
|
+
props?: {
|
|
6
|
+
labels?: Array<{
|
|
7
|
+
label: string;
|
|
8
|
+
value: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
}>;
|
|
11
|
+
justify?: "left" | "center" | "right";
|
|
12
|
+
color?: string;
|
|
13
|
+
mergeProp?: boolean;
|
|
14
|
+
labelWidth?: string;
|
|
15
|
+
error?: string;
|
|
16
|
+
showMessage?: boolean;
|
|
17
|
+
inlineMessage?: boolean;
|
|
18
|
+
size?: "medium" | "default" | "small";
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
};
|
|
21
|
+
hook?: Hook.Form;
|
|
22
|
+
group?: string;
|
|
23
|
+
collapse?: boolean;
|
|
24
|
+
value?: any;
|
|
25
|
+
label?:
|
|
26
|
+
| string
|
|
27
|
+
| {
|
|
28
|
+
text?: string;
|
|
29
|
+
icon?: string;
|
|
30
|
+
tip?: string;
|
|
31
|
+
};
|
|
32
|
+
span?: number;
|
|
33
|
+
flex?: boolean;
|
|
34
|
+
hidden?:
|
|
35
|
+
| boolean
|
|
36
|
+
| ((data: { scope: any; isEdit: boolean }) => boolean)
|
|
37
|
+
| ":isEdit"
|
|
38
|
+
| `@${string}`;
|
|
39
|
+
prepend?: Render.Options;
|
|
40
|
+
component?: Render.Options;
|
|
41
|
+
append?: Render.Options;
|
|
42
|
+
rules?: any;
|
|
43
|
+
required?: boolean;
|
|
44
|
+
}
|
|
45
|
+
interface Options {
|
|
46
|
+
title?: string;
|
|
47
|
+
width?: string;
|
|
48
|
+
props?: ElementPlus.FormProps;
|
|
49
|
+
items: Item[];
|
|
50
|
+
form?: any;
|
|
51
|
+
on?: {
|
|
52
|
+
open?(form: any): void;
|
|
53
|
+
close?(done: fun): void;
|
|
54
|
+
submit?(
|
|
55
|
+
data: any,
|
|
56
|
+
event: {
|
|
57
|
+
close: fun;
|
|
58
|
+
done: fun;
|
|
59
|
+
}
|
|
60
|
+
): void;
|
|
61
|
+
};
|
|
62
|
+
op?: {
|
|
63
|
+
hidden?: boolean;
|
|
64
|
+
saveButtonText?: string;
|
|
65
|
+
closeButtonText?: string;
|
|
66
|
+
buttons?: Array<"close" | "save" | Render.OpButton>;
|
|
67
|
+
};
|
|
68
|
+
dialog?: {
|
|
69
|
+
title?: string;
|
|
70
|
+
width?: string;
|
|
71
|
+
hideHeader?: boolean;
|
|
72
|
+
controls?: Array<"fullscreen" | "close">;
|
|
73
|
+
[key: string]: any;
|
|
74
|
+
};
|
|
75
|
+
[key: string]: any;
|
|
76
|
+
}
|
|
77
|
+
interface Ref {
|
|
78
|
+
form: any;
|
|
79
|
+
open(options: Options): void;
|
|
80
|
+
close(): void;
|
|
81
|
+
done(): void;
|
|
82
|
+
clear(): void;
|
|
83
|
+
reset(): void;
|
|
84
|
+
showLoading(): void;
|
|
85
|
+
hideLoading(): void;
|
|
86
|
+
bindForm(data: any): void;
|
|
87
|
+
setData(prop: string, value: any): void;
|
|
88
|
+
setOptions(
|
|
89
|
+
prop: string,
|
|
90
|
+
list: Array<{
|
|
91
|
+
label: string;
|
|
92
|
+
value?: any;
|
|
93
|
+
}>
|
|
94
|
+
): void;
|
|
95
|
+
setProps(prop: string, value: any): void;
|
|
96
|
+
getForm(prop?: string): any;
|
|
97
|
+
setForm(prop: string, value: any): void;
|
|
98
|
+
showItem(props: string[]): void;
|
|
99
|
+
hideItem(props: string[]): void;
|
|
100
|
+
toggleItem(prop: string, flag?: boolean): void;
|
|
101
|
+
resetFields(): void;
|
|
102
|
+
clearValidate(props?: string[] | string): void;
|
|
103
|
+
validateField(
|
|
104
|
+
props: string[] | string,
|
|
105
|
+
callback: (isValid: boolean, invalidFields: any[]) => void
|
|
106
|
+
): Promise<void>;
|
|
107
|
+
validate(callback: (isValid: boolean, invalidFields: any[]) => void): Promise<void>;
|
|
108
|
+
changeTab(value: any, valid?: boolean): Promise<any>;
|
|
109
|
+
setTitle(value: string): void;
|
|
110
|
+
submit(callback?: (data: any) => void): void;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare namespace Hook {
|
|
2
|
+
type FormPipe =
|
|
3
|
+
| "number"
|
|
4
|
+
| "string"
|
|
5
|
+
| "split"
|
|
6
|
+
| "join"
|
|
7
|
+
| "boolean"
|
|
8
|
+
| "booleanNumber"
|
|
9
|
+
| "datetimerange"
|
|
10
|
+
| FormPipe[]
|
|
11
|
+
| fun;
|
|
12
|
+
type Form =
|
|
13
|
+
| string
|
|
14
|
+
| {
|
|
15
|
+
bind?: FormPipe;
|
|
16
|
+
submit?: FormPipe;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare type fun = () => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare namespace Render {
|
|
2
|
+
type OpButton = `slot-${string}` | {
|
|
3
|
+
label: string;
|
|
4
|
+
onClick({ scope }: any): void;
|
|
5
|
+
};
|
|
6
|
+
interface Options {
|
|
7
|
+
name?: string;
|
|
8
|
+
options?: Array<{
|
|
9
|
+
label: string;
|
|
10
|
+
value?: any;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}> | fun;
|
|
13
|
+
props?: any;
|
|
14
|
+
vm?: any;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
declare namespace ClTable {
|
|
2
|
+
interface Column {
|
|
3
|
+
type?: "index" | "selection" | "expand" | "op";
|
|
4
|
+
hidden?: boolean;
|
|
5
|
+
component?: Render.Options;
|
|
6
|
+
dict?: Array<{
|
|
7
|
+
label: string;
|
|
8
|
+
value?: any;
|
|
9
|
+
type?: "success" | "warning" | "info" | "danger";
|
|
10
|
+
size?: "medium" | "default" | "small";
|
|
11
|
+
effect?: "dark" | "light" | "plain";
|
|
12
|
+
color?: string;
|
|
13
|
+
}>;
|
|
14
|
+
buttons?: Array<"edit" | "delete" | Render.OpButton>;
|
|
15
|
+
align?: "left" | "center" | "right";
|
|
16
|
+
label?: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
prop?: string;
|
|
19
|
+
width?: number;
|
|
20
|
+
minWidth?: number | string;
|
|
21
|
+
renderHeader?: fun;
|
|
22
|
+
sortable?:
|
|
23
|
+
| boolean
|
|
24
|
+
| "desc"
|
|
25
|
+
| "descending"
|
|
26
|
+
| "ascending"
|
|
27
|
+
| "asc"
|
|
28
|
+
| "custom"
|
|
29
|
+
| string;
|
|
30
|
+
sortMethod?: fun;
|
|
31
|
+
sortBy?: string | fun | unknown[];
|
|
32
|
+
resizable?: {
|
|
33
|
+
type: boolean;
|
|
34
|
+
default: true;
|
|
35
|
+
};
|
|
36
|
+
columnKey?: string;
|
|
37
|
+
headerAlign?: string;
|
|
38
|
+
showOverflowTooltip?: boolean;
|
|
39
|
+
fixed?: boolean | string;
|
|
40
|
+
formatter?: fun;
|
|
41
|
+
selectable?: fun;
|
|
42
|
+
reserveSelection?: boolean;
|
|
43
|
+
filterMethod?: fun;
|
|
44
|
+
filteredValue?: unknown[];
|
|
45
|
+
filters?: unknown[];
|
|
46
|
+
filterPlacement?: string;
|
|
47
|
+
filterMultiple?: {
|
|
48
|
+
type: boolean;
|
|
49
|
+
default: true;
|
|
50
|
+
};
|
|
51
|
+
index?: number | fun;
|
|
52
|
+
sortOrders?: unknown[];
|
|
53
|
+
}
|
|
54
|
+
interface Props {
|
|
55
|
+
columns: Column[];
|
|
56
|
+
contextMenu?:
|
|
57
|
+
| boolean
|
|
58
|
+
| Array<
|
|
59
|
+
| ClContextMenu.Item
|
|
60
|
+
| ((row: any) => ClContextMenu.Item)
|
|
61
|
+
| "refresh"
|
|
62
|
+
| "check"
|
|
63
|
+
| "update"
|
|
64
|
+
| "edit"
|
|
65
|
+
| "delete"
|
|
66
|
+
| "order-desc"
|
|
67
|
+
| "order-asc"
|
|
68
|
+
>;
|
|
69
|
+
}
|
|
70
|
+
interface Ref {
|
|
71
|
+
selection: any[];
|
|
72
|
+
data: any[];
|
|
73
|
+
columns: Column[];
|
|
74
|
+
showColumn(prop: string | string[], status?: boolean): void;
|
|
75
|
+
hideColumn(prop: string | string[]): void;
|
|
76
|
+
changeSort(prop: string, order: string): void;
|
|
77
|
+
clearSelection(): void;
|
|
78
|
+
getSelectionRows(): any[];
|
|
79
|
+
toggleRowSelection(row: any, selected: any[]): void;
|
|
80
|
+
toggleAllSelection(): void;
|
|
81
|
+
toggleRowExpansion(row: any, expanded: any[]): void;
|
|
82
|
+
setCurrentRow(row: any): void;
|
|
83
|
+
clearSort(): void;
|
|
84
|
+
clearFilter(columnKeys: string[]): void;
|
|
85
|
+
doLayout(): void;
|
|
86
|
+
sort(prop: string, order: string): void;
|
|
87
|
+
scrollTo(position: { top?: number; left?: number }): void;
|
|
88
|
+
setScrollTop(top: number): void;
|
|
89
|
+
setScrollLeft(left: number): void;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare namespace ClUpsert {
|
|
2
|
+
interface Props {
|
|
3
|
+
items: ClForm.Item[];
|
|
4
|
+
props?: ClForm.Options["props"];
|
|
5
|
+
sync?: boolean;
|
|
6
|
+
op?: ClForm.Options["op"];
|
|
7
|
+
dialog?: ClForm.Options["dialog"];
|
|
8
|
+
onOpen?(isEdit: boolean, data: any): void;
|
|
9
|
+
onClose?(done: fun): void;
|
|
10
|
+
onInfo?(
|
|
11
|
+
data: ClCrud.Service["info"]["params"],
|
|
12
|
+
event: {
|
|
13
|
+
close: fun;
|
|
14
|
+
done(data: any): void;
|
|
15
|
+
next: ClCrud.Service["info"]["request"];
|
|
16
|
+
}
|
|
17
|
+
): void;
|
|
18
|
+
onSubmit?(
|
|
19
|
+
isEdit: boolean,
|
|
20
|
+
data: any,
|
|
21
|
+
event: {
|
|
22
|
+
close: fun;
|
|
23
|
+
done: fun;
|
|
24
|
+
next: ClCrud.Service["upsert"]["request"];
|
|
25
|
+
}
|
|
26
|
+
): void;
|
|
27
|
+
}
|
|
28
|
+
interface Ref extends ClForm.Ref {}
|
|
29
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import cloneDeep from "clone-deep";
|
|
2
|
+
import flat from "array.prototype.flat";
|
|
3
|
+
import merge from "merge";
|
|
4
|
+
export declare function isArray(value: any): boolean;
|
|
5
|
+
export declare function isObject(value: any): boolean;
|
|
6
|
+
export declare function isNumber(value: any): boolean;
|
|
7
|
+
export declare function isFunction(value: any): boolean;
|
|
8
|
+
export declare function isString(value: any): boolean;
|
|
9
|
+
export declare function isNull(value: any): boolean;
|
|
10
|
+
export declare function isBoolean(value: any): boolean;
|
|
11
|
+
export declare function isEmpty(value: any): boolean;
|
|
12
|
+
export declare function clone(obj: any): any;
|
|
13
|
+
export declare function dataset(obj: any, key: string, value: any): any;
|
|
14
|
+
export declare function contains(parent: any, node: any): any;
|
|
15
|
+
export declare function deepMerge(a: any, b: any): any;
|
|
16
|
+
export declare function addClass(el: Element, name: string): void;
|
|
17
|
+
export declare function removeClass(el: Element, name: string): void;
|
|
18
|
+
export { cloneDeep, flat, merge };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare class Emitter {
|
|
2
|
+
id: number;
|
|
3
|
+
constructor(id?: number);
|
|
4
|
+
send(type: string, name: string, ...args: any[]): void;
|
|
5
|
+
on(name: string, ...args: any[]): void;
|
|
6
|
+
emit(name: string, ...args: any[]): void;
|
|
7
|
+
off(name: string, ...args: any[]): void;
|
|
8
|
+
}
|
|
9
|
+
export default Emitter;
|