morghulis 3.1.0 → 3.1.2
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/dist/index.css +1 -1
- package/dist/morghulis.es.js +30085 -6860
- package/dist/morghulis.es.js.map +1 -1
- package/dist/morghulis.umd.js +64 -26
- package/dist/morghulis.umd.js.map +1 -1
- package/dist/types/components/dialog/DDialog.vue.d.ts +17 -0
- package/dist/types/components/dialog/MButtonDialog.vue.d.ts +2 -0
- package/dist/types/components/{table/data/widgets → form}/DForm.vue.d.ts +3 -3
- package/dist/types/components/form/MForm.vue.d.ts +1 -0
- package/dist/types/components/meta/edit/EditMetaField.vue.d.ts +10 -0
- package/dist/types/components/meta/field/AddField.vue.d.ts +10 -0
- package/dist/types/components/meta/field/MetaFieldFormat.vue.d.ts +6 -0
- package/dist/types/components/meta/field/MetaFieldRefer.vue.d.ts +6 -0
- package/dist/types/components/meta/field/formats/CharFormats.vue.d.ts +2 -0
- package/dist/types/components/meta/field/formats/FileFormats.vue.d.ts +2 -0
- package/dist/types/components/meta/field/formats/NumberFormats.vue.d.ts +2 -0
- package/dist/types/components/meta/widgets/MetaSelect.vue.d.ts +10 -0
- package/dist/types/components/table/aoa/ATable.vue.d.ts +10 -0
- package/dist/types/components/table/data/DTable.vue.d.ts +6 -3
- package/dist/types/{hooks/use-table/data/index.d.ts → components/table/data/hook.d.ts} +41 -31
- package/dist/types/components/table/data/slots/DTableCell.vue.d.ts +10 -0
- package/dist/types/components/table/data/slots/DTableEmpty.vue.d.ts +2 -0
- package/dist/types/components/table/data/slots/DTableFooter.vue.d.ts +13 -0
- package/dist/types/components/table/data/slots/DTableFooterTool.vue.d.ts +10 -0
- package/dist/types/components/table/data/{widgets → slots}/DTableHeader.vue.d.ts +2 -2
- package/dist/types/components/table/data/slots/DTableHeaderCell.vue.d.ts +2 -0
- package/dist/types/components/table/data/{controller/DTableController.vue.d.ts → slots/DTableHeaderTool.vue.d.ts} +16 -9
- package/dist/types/components/table/data/{widgets/DPopoverWrapper.vue.d.ts → slots/DTablePop.vue.d.ts} +4 -4
- package/dist/types/components/table/data/types.d.ts +7 -11
- package/dist/types/components/table/simple/MTable.vue.d.ts +21 -31
- package/dist/types/components/table/simple/buttons/MTableButtonWrapper.vue.d.ts +1 -1
- package/dist/types/components/table/simple/hook.d.ts +17 -0
- package/dist/types/components/table/simple/tool.d.ts +19 -0
- package/dist/types/components/table/simple/types.d.ts +25 -163
- package/dist/types/components/table/simple/widgets/MTableHeader.vue.d.ts +1 -2
- package/dist/types/components/table/simple/widgets/MTableIndex.vue.d.ts +8 -9
- package/dist/types/components/table/upload/DTableUpload.vue.d.ts +11 -0
- package/dist/types/components/table/upload/control/DTableUploadActivator.vue.d.ts +6 -0
- package/dist/types/components/table/upload/control/DTableUploadButtons.vue.d.ts +12 -0
- package/dist/types/components/table/{simple/buttons/MTableButtons.vue.d.ts → upload/control/DTableUploadController.vue.d.ts} +9 -7
- package/dist/types/components/table/upload/types.d.ts +5 -0
- package/dist/types/components/table/virtual/VTable.vue.d.ts +23 -1
- package/dist/types/components/tree/data/DTree.vue.d.ts +6 -0
- package/dist/types/components/tree/data/hook.d.ts +109 -0
- package/dist/types/components/tree/data/slots/DTreePop.vue.d.ts +8 -0
- package/dist/types/components/tree/data/types.d.ts +10 -0
- package/dist/types/components/tree/simple/MTree.vue.d.ts +31 -0
- package/dist/types/components/tree/simple/hook.d.ts +21 -0
- package/dist/types/components/tree/simple/tool.d.ts +4 -0
- package/dist/types/components/tree/simple/types.d.ts +18 -0
- package/dist/types/components/tree/simple/widgets/MTreeExpand.vue.d.ts +12 -0
- package/dist/types/components/tree/simple/widgets/MTreeIcon.vue.d.ts +11 -0
- package/dist/types/components/tree/tool.d.ts +7 -0
- package/dist/types/components/tree/types.d.ts +20 -0
- package/dist/types/components/wrapper/MWrapper.vue.d.ts +33 -0
- package/dist/types/components/wrapper/types.d.ts +1 -0
- package/dist/types/hooks/use-admin/index.d.ts +4 -0
- package/dist/types/hooks/use-channel/index.d.ts +9 -4
- package/dist/types/hooks/use-channel/types.d.ts +35 -16
- package/dist/types/hooks/use-dao/index.d.ts +166 -12
- package/dist/types/hooks/use-dao/tool.d.ts +2 -0
- package/dist/types/hooks/use-dao/types.d.ts +2 -2
- package/dist/types/hooks/use-mata/types.d.ts +12 -9
- package/dist/types/hooks/use-morghulis/types.d.ts +2 -2
- package/dist/types/hooks/use-paster/index.d.ts +5 -0
- package/dist/types/hooks/use-paster/tool.d.ts +7 -0
- package/dist/types/hooks/use-paster/types.d.ts +4 -0
- package/dist/types/hooks/use-query/index.d.ts +35 -3
- package/dist/types/hooks/use-query/tool.d.ts +6 -2
- package/dist/types/hooks/use-query/types.d.ts +17 -2
- package/dist/types/hooks/use-sortable/index.d.ts +3 -0
- package/dist/types/hooks/use-tree/tools.d.ts +0 -0
- package/dist/types/hooks/use-tree/types.d.ts +0 -0
- package/dist/types/index.d.ts +6 -3
- package/package.json +8 -6
- package/dist/types/components/table/simple/widgets/MTablePopover.vue.d.ts +0 -16
- package/dist/types/hooks/use-channel/tools.d.ts +0 -3
- package/dist/types/hooks/use-table/simple/index.d.ts +0 -40
- /package/dist/types/{hooks/use-table/simple/types.d.ts → components/table/data/tool.d.ts} +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
export type MWrapperPopperType = 'meta' | 'search' | 'field' | 'cell' | 'index';
|
@@ -1,5 +1,10 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
import { Ref } from "vue";
|
2
|
+
import { ChannelParam } from "./types";
|
3
|
+
export declare function useMChannel(param: Ref<ChannelParam>, auth?: boolean): {
|
4
|
+
activate: (data: any) => void;
|
5
|
+
channels: import("./types").ChannelContainer;
|
6
|
+
status: {
|
7
|
+
loading: boolean;
|
8
|
+
payload: any;
|
9
|
+
};
|
5
10
|
};
|
@@ -1,22 +1,41 @@
|
|
1
|
-
import {
|
2
|
-
|
1
|
+
import { Reactive } from "vue";
|
2
|
+
import { AxiosInstance } from "axios";
|
3
|
+
export type ChannelConfig = {
|
4
|
+
url?: string;
|
3
5
|
onStart?: () => void;
|
4
6
|
onStop?: () => void;
|
5
7
|
onProceed?: (payload: any) => void;
|
6
8
|
};
|
7
|
-
export type
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
export type ChannelParam = {
|
10
|
+
handlerKey: string;
|
11
|
+
channelKey: string;
|
12
|
+
config: ChannelConfig;
|
11
13
|
};
|
12
|
-
export type
|
13
|
-
|
14
|
-
|
15
|
-
activate: (body: any) => void;
|
16
|
-
$start: () => void;
|
17
|
-
$stop: () => void;
|
18
|
-
$proceed: (payload: any) => void;
|
19
|
-
};
|
20
|
-
export type MorghulisChannels = {
|
21
|
-
[key: string]: MorghulisChannel;
|
14
|
+
export type ChannelStatus = {
|
15
|
+
loading: boolean;
|
16
|
+
payload: any;
|
22
17
|
};
|
18
|
+
/**
|
19
|
+
* handler is just the entity
|
20
|
+
*/
|
21
|
+
export declare class ChannelContainer {
|
22
|
+
container: {
|
23
|
+
[handlerKey: string]: {
|
24
|
+
[channelKey: string]: Channel;
|
25
|
+
};
|
26
|
+
};
|
27
|
+
constructor();
|
28
|
+
getChannel(handlerKey: string, channelKey: string): Channel;
|
29
|
+
destroy(handlerKey: string, channelKey: string): void;
|
30
|
+
register(handlerKey: string, channelKey: string | undefined, config: ChannelConfig, status: Reactive<ChannelStatus>): void;
|
31
|
+
execute(request: AxiosInstance, handlerKey: string, channelKey: string, data: any): void;
|
32
|
+
}
|
33
|
+
export declare class Channel {
|
34
|
+
config: ChannelConfig;
|
35
|
+
private status;
|
36
|
+
constructor(config: ChannelConfig, status: Reactive<ChannelStatus>);
|
37
|
+
ready(loading?: boolean, payload?: any): void;
|
38
|
+
start(): void;
|
39
|
+
stop(): void;
|
40
|
+
proceed(data: any): void;
|
41
|
+
}
|
@@ -1,20 +1,169 @@
|
|
1
1
|
import { type Ref } from "vue";
|
2
2
|
import { type Meta, MetaView } from "../use-mata/types";
|
3
|
-
import {
|
4
|
-
import { DataItem, IQuery, Query } from "../use-query/types";
|
5
|
-
|
3
|
+
import { ChannelConfig } from "../use-channel/types";
|
4
|
+
import { DataItem, DataItemId, IQuery, Query, QueryConfig, QueryInfo, TreeItem, TreeMapping } from "../use-query/types";
|
5
|
+
import { TreeModel } from "../../components/tree/types";
|
6
|
+
export type QueryDaoParams = {
|
7
|
+
isTree?: boolean;
|
8
|
+
callback: (ids?: DataItemId[]) => void;
|
9
|
+
};
|
10
|
+
export declare function useQueryDao(props: QueryConfig & Meta, selection: Ref<any[]>, params: QueryDaoParams): {
|
11
|
+
isAdmin: Ref<boolean, boolean>;
|
12
|
+
admin: Ref<boolean, boolean>;
|
13
|
+
config: Ref<{
|
14
|
+
includes?: {
|
15
|
+
[x: string]: any;
|
16
|
+
id?: DataItemId | undefined;
|
17
|
+
} | undefined;
|
18
|
+
excludes?: {
|
19
|
+
[x: string]: any;
|
20
|
+
id?: DataItemId | undefined;
|
21
|
+
} | undefined;
|
22
|
+
orders?: import("../use-query/types").Orders | undefined;
|
23
|
+
page?: number | undefined;
|
24
|
+
size?: number | undefined;
|
25
|
+
root?: number | undefined;
|
26
|
+
finder?: import("../use-query/types").Finder | undefined;
|
27
|
+
}, QueryConfig | {
|
28
|
+
includes?: {
|
29
|
+
[x: string]: any;
|
30
|
+
id?: DataItemId | undefined;
|
31
|
+
} | undefined;
|
32
|
+
excludes?: {
|
33
|
+
[x: string]: any;
|
34
|
+
id?: DataItemId | undefined;
|
35
|
+
} | undefined;
|
36
|
+
orders?: import("../use-query/types").Orders | undefined;
|
37
|
+
page?: number | undefined;
|
38
|
+
size?: number | undefined;
|
39
|
+
root?: number | undefined;
|
40
|
+
finder?: import("../use-query/types").Finder | undefined;
|
41
|
+
}>;
|
42
|
+
query: import("vue").ComputedRef<Query>;
|
43
|
+
meta: import("vue").ComputedRef<Meta>;
|
44
|
+
switchAdmin: () => void;
|
45
|
+
load: () => void;
|
46
|
+
reload: () => void;
|
47
|
+
status: {
|
48
|
+
loading: boolean;
|
49
|
+
payload: any;
|
50
|
+
};
|
51
|
+
find_many: (query: Query | IQuery, code?: string) => Promise<{
|
52
|
+
results: DataItem[];
|
53
|
+
total?: number;
|
54
|
+
}>;
|
55
|
+
save_one: (item: DataItem) => Promise<{
|
56
|
+
item: DataItem;
|
57
|
+
}>;
|
58
|
+
delete_one: (id: string | number) => Promise<boolean>;
|
59
|
+
find_one: (id: string | number) => Promise<{
|
60
|
+
item: DataItem;
|
61
|
+
}>;
|
62
|
+
delete_many: (query: Query | IQuery) => Promise<boolean>;
|
63
|
+
update_many: (query: Query | IQuery, template: DataItem) => Promise<boolean>;
|
64
|
+
load_view: (code?: string) => Promise<MetaView>;
|
65
|
+
save_many: (array: DataItem[]) => void;
|
66
|
+
find_tree: (query: Query | IQuery) => Promise<TreeModel>;
|
67
|
+
view: Ref<{
|
68
|
+
id?: number | undefined;
|
69
|
+
fields?: {
|
70
|
+
[key: string]: import("../use-mata/types").MetaField;
|
71
|
+
} | undefined;
|
72
|
+
entity?: string | undefined;
|
73
|
+
code?: string | undefined;
|
74
|
+
meta_name?: string | undefined;
|
75
|
+
view_name?: string | undefined;
|
76
|
+
form_width?: number | undefined;
|
77
|
+
form_height?: number | undefined;
|
78
|
+
table_width?: number | undefined;
|
79
|
+
table_height?: number | undefined;
|
80
|
+
enable?: boolean | undefined;
|
81
|
+
show_header?: boolean | undefined;
|
82
|
+
allow_batch?: boolean | undefined;
|
83
|
+
allow_search?: boolean | undefined;
|
84
|
+
allow_sort?: boolean | undefined;
|
85
|
+
allow_pop?: boolean | undefined;
|
86
|
+
allow_insert?: boolean | undefined;
|
87
|
+
allow_edit?: boolean | undefined;
|
88
|
+
allow_remove?: boolean | undefined;
|
89
|
+
allow_download?: boolean | undefined;
|
90
|
+
allow_upload?: boolean | undefined;
|
91
|
+
}, MetaView | {
|
92
|
+
id?: number | undefined;
|
93
|
+
fields?: {
|
94
|
+
[key: string]: import("../use-mata/types").MetaField;
|
95
|
+
} | undefined;
|
96
|
+
entity?: string | undefined;
|
97
|
+
code?: string | undefined;
|
98
|
+
meta_name?: string | undefined;
|
99
|
+
view_name?: string | undefined;
|
100
|
+
form_width?: number | undefined;
|
101
|
+
form_height?: number | undefined;
|
102
|
+
table_width?: number | undefined;
|
103
|
+
table_height?: number | undefined;
|
104
|
+
enable?: boolean | undefined;
|
105
|
+
show_header?: boolean | undefined;
|
106
|
+
allow_batch?: boolean | undefined;
|
107
|
+
allow_search?: boolean | undefined;
|
108
|
+
allow_sort?: boolean | undefined;
|
109
|
+
allow_pop?: boolean | undefined;
|
110
|
+
allow_insert?: boolean | undefined;
|
111
|
+
allow_edit?: boolean | undefined;
|
112
|
+
allow_remove?: boolean | undefined;
|
113
|
+
allow_download?: boolean | undefined;
|
114
|
+
allow_upload?: boolean | undefined;
|
115
|
+
}>;
|
116
|
+
results: Ref<{
|
117
|
+
[x: string]: any;
|
118
|
+
id?: DataItemId | undefined;
|
119
|
+
}[], DataItem[] | {
|
120
|
+
[x: string]: any;
|
121
|
+
id?: DataItemId | undefined;
|
122
|
+
}[]>;
|
123
|
+
info: Ref<{
|
124
|
+
current: number;
|
125
|
+
total: number;
|
126
|
+
}, QueryInfo | {
|
127
|
+
current: number;
|
128
|
+
total: number;
|
129
|
+
}>;
|
130
|
+
options: Ref<{
|
131
|
+
[x: string]: any;
|
132
|
+
pid: number | string;
|
133
|
+
isLeaf: boolean;
|
134
|
+
children: /*elided*/ any[];
|
135
|
+
id?: DataItemId | undefined;
|
136
|
+
}[], TreeItem[] | {
|
137
|
+
[x: string]: any;
|
138
|
+
pid: number | string;
|
139
|
+
isLeaf: boolean;
|
140
|
+
children: /*elided*/ any[];
|
141
|
+
id?: DataItemId | undefined;
|
142
|
+
}[]>;
|
143
|
+
mapping: Ref<TreeMapping, TreeMapping>;
|
144
|
+
remove: () => void;
|
145
|
+
clip: () => void;
|
146
|
+
clone: () => void;
|
147
|
+
collect: (callback: (item: DataItem) => void) => void;
|
148
|
+
};
|
149
|
+
export declare function useDao(meta: Meta, channelConfig?: ChannelConfig): {
|
150
|
+
channels: import("../use-channel/types").ChannelContainer;
|
6
151
|
meta: Ref<{
|
7
152
|
db: import("../use-mata/types").MetaDatabase;
|
8
153
|
entity: string;
|
9
154
|
code?: string | undefined;
|
155
|
+
lock?: boolean | undefined;
|
10
156
|
}, Meta | {
|
11
157
|
db: import("../use-mata/types").MetaDatabase;
|
12
158
|
entity: string;
|
13
159
|
code?: string | undefined;
|
160
|
+
lock?: boolean | undefined;
|
14
161
|
}>;
|
15
|
-
|
16
|
-
|
17
|
-
|
162
|
+
status: {
|
163
|
+
loading: boolean;
|
164
|
+
payload: any;
|
165
|
+
};
|
166
|
+
find_many: (query: Query | IQuery, code?: string) => Promise<{
|
18
167
|
results: DataItem[];
|
19
168
|
total?: number;
|
20
169
|
}>;
|
@@ -27,16 +176,21 @@ export declare function useDao(meta: Meta, auth?: boolean): {
|
|
27
176
|
}>;
|
28
177
|
delete_many: (query: Query | IQuery) => Promise<boolean>;
|
29
178
|
update_many: (query: Query | IQuery, template: DataItem) => Promise<boolean>;
|
30
|
-
load_view: () => Promise<MetaView>;
|
179
|
+
load_view: (code?: string) => Promise<MetaView>;
|
31
180
|
save_many: (array: DataItem[]) => void;
|
181
|
+
find_tree: (query: Query | IQuery) => Promise<TreeModel>;
|
32
182
|
};
|
33
183
|
/**
|
34
184
|
* http和socket的loading冲突问题
|
35
185
|
*/
|
36
|
-
export declare function useMDao(meta: Ref<Meta>, channelConfig?:
|
37
|
-
|
38
|
-
|
39
|
-
|
186
|
+
export declare function useMDao(meta: Ref<Meta>, channelConfig?: ChannelConfig, auth?: boolean): {
|
187
|
+
find_tree: (query: Query | IQuery) => Promise<TreeModel>;
|
188
|
+
channels: import("../use-channel/types").ChannelContainer;
|
189
|
+
status: {
|
190
|
+
loading: boolean;
|
191
|
+
payload: any;
|
192
|
+
};
|
193
|
+
find_many: (query: Query | IQuery, code?: string) => Promise<{
|
40
194
|
results: DataItem[];
|
41
195
|
total?: number;
|
42
196
|
}>;
|
@@ -49,6 +203,6 @@ export declare function useMDao(meta: Ref<Meta>, channelConfig?: MorghulisChanne
|
|
49
203
|
}>;
|
50
204
|
delete_many: (query: Query | IQuery) => Promise<boolean>;
|
51
205
|
update_many: (query: Query | IQuery, template: DataItem) => Promise<boolean>;
|
52
|
-
load_view: () => Promise<MetaView>;
|
206
|
+
load_view: (code?: string) => Promise<MetaView>;
|
53
207
|
save_many: (array: DataItem[]) => void;
|
54
208
|
};
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { DataItem, Query } from "../use-query/types";
|
2
2
|
import { MetaView } from "../use-mata/types";
|
3
3
|
import { ComputedRef } from "vue";
|
4
|
-
import {
|
4
|
+
import { ChannelConfig } from "../use-channel/types";
|
5
5
|
export type DaoConfig = {
|
6
6
|
auth?: boolean;
|
7
|
-
channel:
|
7
|
+
channel: ChannelConfig;
|
8
8
|
};
|
9
9
|
export type DaoPayload = {
|
10
10
|
results: DataItem[];
|
@@ -3,6 +3,7 @@ export type Meta = {
|
|
3
3
|
db: MetaDatabase;
|
4
4
|
entity: string;
|
5
5
|
code?: string;
|
6
|
+
lock?: boolean;
|
6
7
|
};
|
7
8
|
export type MetaView = {
|
8
9
|
id?: number;
|
@@ -36,30 +37,32 @@ export type NumberField = 'IntegerField' | 'FloatField' | 'BigIntegerField' | 'D
|
|
36
37
|
export type DateField = 'DateField' | 'DateTimeField' | 'TimeField';
|
37
38
|
export type SpecialField = 'JSONField' | 'FileField';
|
38
39
|
export type ReadonlyField = 'UUIDField' | 'BigAutoField' | 'Custom';
|
40
|
+
export type MetaFieldDomain = SimpleField | ManyField | RefField | SpecialField | ReadonlyField | NumberField | DateField;
|
39
41
|
export type MetaField = {
|
42
|
+
id?: string | number;
|
40
43
|
prop?: string;
|
41
44
|
label?: string;
|
42
45
|
name?: string;
|
43
|
-
domain?:
|
46
|
+
domain?: MetaFieldDomain;
|
44
47
|
tool?: string;
|
45
48
|
refer?: MetaRefer;
|
46
49
|
format?: MetaFormat;
|
47
50
|
unit?: string | null;
|
51
|
+
align?: 'left' | 'center' | 'right';
|
52
|
+
fixed?: '' | 'left' | 'right';
|
53
|
+
header_color?: string | null;
|
54
|
+
cell_color?: string | null;
|
55
|
+
span?: number;
|
56
|
+
column_width?: number;
|
48
57
|
not_null?: boolean;
|
49
|
-
|
50
|
-
|
58
|
+
allow_sort?: boolean;
|
59
|
+
allow_edit?: boolean;
|
51
60
|
allow_search?: boolean;
|
52
61
|
allow_download?: boolean;
|
53
62
|
allow_upload?: boolean;
|
54
63
|
allow_update?: boolean;
|
55
|
-
column_width?: number;
|
56
|
-
align?: 'left' | 'center' | 'right';
|
57
|
-
fixed?: '' | 'left' | 'right';
|
58
|
-
header_color?: string | null;
|
59
|
-
cell_color?: string | null;
|
60
64
|
edit_on_table?: boolean;
|
61
65
|
hide_on_table?: boolean;
|
62
|
-
span?: number;
|
63
66
|
hide_on_form?: boolean;
|
64
67
|
hide_on_form_edit?: boolean;
|
65
68
|
hide_on_form_insert?: boolean;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Ref } from "vue";
|
2
|
-
import {
|
2
|
+
import { ChannelContainer } from "../use-channel/types";
|
3
3
|
export type MorghulisOptions = {
|
4
4
|
baseURL?: string;
|
5
5
|
minioURL?: string;
|
@@ -7,6 +7,6 @@ export type MorghulisOptions = {
|
|
7
7
|
export type MorghulisCore = {
|
8
8
|
status: Ref<string>;
|
9
9
|
open: () => void;
|
10
|
-
channels:
|
10
|
+
channels: ChannelContainer;
|
11
11
|
options: MorghulisOptions;
|
12
12
|
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Aoa, AoaMap } from "./types";
|
2
|
+
import { UploadFile } from "element-plus";
|
3
|
+
import { MetaView } from "../use-mata/types";
|
4
|
+
import { DataItem } from "../use-query/types";
|
5
|
+
export declare function textToAoa(text: string): string[][];
|
6
|
+
export declare function excelToAoa(file: UploadFile, callback: (mapping: AoaMap) => void): void;
|
7
|
+
export declare function AoaToDataItems(aoa: Aoa, view: MetaView): DataItem[];
|
@@ -1,3 +1,35 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
export declare function
|
1
|
+
import { QueryConfig } from "./types";
|
2
|
+
import { Meta } from "../use-mata/types";
|
3
|
+
export declare function useQuery(props: QueryConfig & Meta): {
|
4
|
+
config: import("vue").Ref<{
|
5
|
+
includes?: {
|
6
|
+
[x: string]: any;
|
7
|
+
id?: import("./types").DataItemId | undefined;
|
8
|
+
} | undefined;
|
9
|
+
excludes?: {
|
10
|
+
[x: string]: any;
|
11
|
+
id?: import("./types").DataItemId | undefined;
|
12
|
+
} | undefined;
|
13
|
+
orders?: import("./types").Orders | undefined;
|
14
|
+
page?: number | undefined;
|
15
|
+
size?: number | undefined;
|
16
|
+
root?: number | undefined;
|
17
|
+
finder?: import("./types").Finder | undefined;
|
18
|
+
}, QueryConfig | {
|
19
|
+
includes?: {
|
20
|
+
[x: string]: any;
|
21
|
+
id?: import("./types").DataItemId | undefined;
|
22
|
+
} | undefined;
|
23
|
+
excludes?: {
|
24
|
+
[x: string]: any;
|
25
|
+
id?: import("./types").DataItemId | undefined;
|
26
|
+
} | undefined;
|
27
|
+
orders?: import("./types").Orders | undefined;
|
28
|
+
page?: number | undefined;
|
29
|
+
size?: number | undefined;
|
30
|
+
root?: number | undefined;
|
31
|
+
finder?: import("./types").Finder | undefined;
|
32
|
+
}>;
|
33
|
+
query: import("vue").ComputedRef<import("./types").Query>;
|
34
|
+
meta: import("vue").ComputedRef<Meta>;
|
35
|
+
};
|
@@ -1,4 +1,8 @@
|
|
1
|
-
import { Query, SearchParam } from "./types";
|
1
|
+
import { DataItem, Query, QueryConfig, SearchParam } from "./types";
|
2
|
+
import _ from "lodash";
|
2
3
|
import { MetaView } from "../use-mata/types";
|
3
|
-
export declare function
|
4
|
+
export declare function transformQuery(config?: QueryConfig): Query;
|
5
|
+
export declare function clearCondition(cond?: DataItem): _.Omit<DataItem, string>;
|
6
|
+
export declare function getTemplate(includes?: DataItem): Pick<DataItem, string>;
|
7
|
+
export declare function convertQuery(query: Query, view: MetaView): Query;
|
4
8
|
export declare function checkFinder(param: SearchParam): boolean;
|
@@ -2,7 +2,15 @@ export type DataItem = {
|
|
2
2
|
id?: DataItemId;
|
3
3
|
[key: string]: any;
|
4
4
|
};
|
5
|
-
type
|
5
|
+
export type TreeItem = {
|
6
|
+
pid: number | string;
|
7
|
+
isLeaf: boolean;
|
8
|
+
children: TreeItem[];
|
9
|
+
} & DataItem;
|
10
|
+
export type TreeMapping = {
|
11
|
+
[id: string | number]: TreeItem;
|
12
|
+
};
|
13
|
+
export type DataItemId = string | number;
|
6
14
|
export type Orders = {
|
7
15
|
[key: string]: 1 | -1;
|
8
16
|
};
|
@@ -10,12 +18,18 @@ export type Condition = {
|
|
10
18
|
includes?: DataItem;
|
11
19
|
excludes?: DataItem;
|
12
20
|
};
|
21
|
+
export type QueryInfo = {
|
22
|
+
current: number;
|
23
|
+
total: number;
|
24
|
+
};
|
13
25
|
export type QueryConfig = {
|
14
26
|
includes?: DataItem;
|
15
27
|
excludes?: DataItem;
|
16
28
|
orders?: Orders;
|
17
29
|
page?: number;
|
18
30
|
size?: number;
|
31
|
+
root?: number;
|
32
|
+
finder?: Finder;
|
19
33
|
};
|
20
34
|
export type Query = {
|
21
35
|
condition: Condition;
|
@@ -25,6 +39,7 @@ export type Query = {
|
|
25
39
|
template: DataItem;
|
26
40
|
search: Condition[];
|
27
41
|
finder: Finder;
|
42
|
+
root?: number;
|
28
43
|
};
|
29
44
|
export type IQuery = {
|
30
45
|
condition?: Condition;
|
@@ -34,6 +49,7 @@ export type IQuery = {
|
|
34
49
|
template?: DataItem;
|
35
50
|
search?: Condition[];
|
36
51
|
finder?: Finder;
|
52
|
+
root?: number;
|
37
53
|
};
|
38
54
|
export type Finder = {
|
39
55
|
[key: string]: SearchParam;
|
@@ -45,4 +61,3 @@ export type SearchParam = {
|
|
45
61
|
suffix: 'contains' | 'exact' | 'startswith' | 'endswith' | 'gt' | 'lt' | 'isnull';
|
46
62
|
value: any;
|
47
63
|
};
|
48
|
-
export {};
|
File without changes
|
File without changes
|
package/dist/types/index.d.ts
CHANGED
@@ -4,15 +4,17 @@ import { useMRequest } from "./hooks/use-request";
|
|
4
4
|
import { useMChannel } from "./hooks/use-channel";
|
5
5
|
import { useMSockets } from "./hooks/use-socket";
|
6
6
|
import { MorghulisOptions } from "./hooks/use-morghulis/types";
|
7
|
-
import type { MorghulisChannelConfig } from "./hooks/use-channel/types";
|
8
7
|
import MDialog from "./components/dialog/MDialog.vue";
|
9
8
|
import MApp from "./MApp.vue";
|
10
9
|
import MTable from "./components/table/simple/MTable.vue";
|
11
10
|
import DTable from "./components/table/data/DTable.vue";
|
12
11
|
import VTable from './components/table/virtual/VTable.vue';
|
13
12
|
import MForm from "./components/form/MForm.vue";
|
13
|
+
import type { DataItem, Query } from "./hooks/use-query/types";
|
14
|
+
import MTree from "./components/tree/simple/MTree.vue";
|
15
|
+
import type { MetaField, MetaView } from "./hooks/use-mata/types";
|
14
16
|
import type { MTableButton, MTableColumn } from "./components/table/simple/types";
|
15
|
-
import type {
|
17
|
+
import type { ChannelConfig } from "./hooks/use-channel/types";
|
16
18
|
declare module "vue" {
|
17
19
|
interface GlobalComponents {
|
18
20
|
MApp: typeof MApp;
|
@@ -21,9 +23,10 @@ declare module "vue" {
|
|
21
23
|
DTable: typeof DTable;
|
22
24
|
VTable: typeof VTable;
|
23
25
|
MForm: typeof MForm;
|
26
|
+
MTree: typeof MTree;
|
24
27
|
}
|
25
28
|
}
|
26
29
|
declare const createMorghulis: (options?: MorghulisOptions) => {
|
27
30
|
install(Vue: App): void;
|
28
31
|
};
|
29
|
-
export { MApp, MDialog, MTable, DTable, VTable, MForm, createMorghulis, useMRequest, useMChannel, useMSockets,
|
32
|
+
export { MApp, MDialog, MTable, DTable, VTable, MForm, MTree, createMorghulis, useMRequest, useMChannel, useMSockets, ChannelConfig, MTableButton, MTableColumn, DataItem, Query, MetaView, MetaField };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "morghulis",
|
3
|
-
"version": "3.1.
|
3
|
+
"version": "3.1.2",
|
4
4
|
"type": "module",
|
5
5
|
"files": [
|
6
6
|
"dist"
|
@@ -25,18 +25,20 @@
|
|
25
25
|
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
26
26
|
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
27
27
|
"@fortawesome/vue-fontawesome": "^3.0.8",
|
28
|
+
"@vueuse/core": "^13.1.0",
|
28
29
|
"axios": "^1.8.1",
|
29
|
-
"nprogress": "^0.2.0",
|
30
|
-
"sortablejs": "^1.15.6",
|
31
30
|
"element-plus": "^2.9.8",
|
32
31
|
"js-cookie": "^3.0.5",
|
33
|
-
"
|
32
|
+
"nprogress": "^0.2.0",
|
33
|
+
"sortablejs": "^1.15.6",
|
34
|
+
"vue": "^3.5.13",
|
35
|
+
"xlsx": "^0.18.5"
|
34
36
|
},
|
35
37
|
"devDependencies": {
|
36
|
-
"@types/nprogress": "^0.2.3",
|
37
|
-
"@types/sortablejs": "^1.15.8",
|
38
38
|
"@types/js-cookie": "^3.0.6",
|
39
39
|
"@types/node": "^22.14.0",
|
40
|
+
"@types/nprogress": "^0.2.3",
|
41
|
+
"@types/sortablejs": "^1.15.8",
|
40
42
|
"@vitejs/plugin-vue": "^5.2.3",
|
41
43
|
"typescript": "~5.8.0",
|
42
44
|
"vite": "^6.2.4",
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import { MTablePopper } from "../types";
|
2
|
-
declare var __VLS_6: {
|
3
|
-
type: import("../types").MTablePopperType;
|
4
|
-
data: any;
|
5
|
-
};
|
6
|
-
type __VLS_Slots = {} & {
|
7
|
-
default?: (props: typeof __VLS_6) => any;
|
8
|
-
};
|
9
|
-
declare const __VLS_component: import("vue").DefineComponent<MTablePopper, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<MTablePopper> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
10
|
-
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
11
|
-
export default _default;
|
12
|
-
type __VLS_WithSlots<T, S> = T & {
|
13
|
-
new (): {
|
14
|
-
$slots: S;
|
15
|
-
};
|
16
|
-
};
|
@@ -1,40 +0,0 @@
|
|
1
|
-
import { type Ref } from "vue";
|
2
|
-
import { MTablePopperType, MTableProps } from "../../../components/table/simple/types";
|
3
|
-
export declare function useMTable(table: Ref, props: MTableProps): {
|
4
|
-
handleOrder: (prop: string, dir: 1 | -1) => void;
|
5
|
-
check: (flag: boolean) => void;
|
6
|
-
visible: import("vue").ComputedRef<{
|
7
|
-
popover: {
|
8
|
-
meta: boolean;
|
9
|
-
search: boolean;
|
10
|
-
field: boolean;
|
11
|
-
index: boolean;
|
12
|
-
cell: boolean;
|
13
|
-
};
|
14
|
-
header: boolean;
|
15
|
-
footer: boolean;
|
16
|
-
}>;
|
17
|
-
popover: {
|
18
|
-
vRef: {
|
19
|
-
getBoundingClientRect: () => {
|
20
|
-
x: number;
|
21
|
-
y: number;
|
22
|
-
};
|
23
|
-
};
|
24
|
-
visible: boolean;
|
25
|
-
type: MTablePopperType;
|
26
|
-
data: any;
|
27
|
-
placement?: "left" | "right" | "top" | "bottom" | null | string | undefined;
|
28
|
-
};
|
29
|
-
selection: import("vue").ComputedRef<any>;
|
30
|
-
tableCellClassName: (data: any) => "m-table-cell" | "m-table-index" | "m-table-custom";
|
31
|
-
tableRowClassName: (payload: any) => "" | "m-table-current" | "m-table-highlight";
|
32
|
-
handleCellClick: (row: object, column: any, cell: any, event: any) => void;
|
33
|
-
handleCellContextMenu: (row: any, column: any, cell: any, event: any) => void;
|
34
|
-
showPopover: (event: {
|
35
|
-
clientX: number;
|
36
|
-
clientY: number;
|
37
|
-
}, type: MTablePopperType, data?: any, placement?: string) => void;
|
38
|
-
closePopover: () => boolean;
|
39
|
-
setSelection: (keys: any[]) => void;
|
40
|
-
};
|
File without changes
|