@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
package/index.d.ts
ADDED
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
declare type fun = () => void;
|
|
2
|
+
|
|
3
|
+
declare namespace Crud {
|
|
4
|
+
type Options = Array<{ label: string; value?: any; [key: string]: any }>;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
declare type Browser = {
|
|
8
|
+
screen: string;
|
|
9
|
+
isMini: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
declare namespace ClAdvSearch {
|
|
13
|
+
interface Props {
|
|
14
|
+
items: ClForm.Item[];
|
|
15
|
+
title?: string;
|
|
16
|
+
size?: string | number;
|
|
17
|
+
op?: Array<"clear" | "reset" | "close" | "save">;
|
|
18
|
+
onSearch?(data: any, event: { next(params: any): void; close(): void }): void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface Ref extends ClForm.Ref {}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare namespace ClContextMenu {
|
|
25
|
+
interface Item {
|
|
26
|
+
label: string;
|
|
27
|
+
icon?: string;
|
|
28
|
+
prefixIcon?: string;
|
|
29
|
+
suffixIcon?: string;
|
|
30
|
+
ellipsis?: boolean;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
hidden?: boolean;
|
|
33
|
+
children?: Item[];
|
|
34
|
+
showChildren?: boolean;
|
|
35
|
+
callback?(done: fun): void;
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface Event {
|
|
40
|
+
pageX: number;
|
|
41
|
+
pageY: number;
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface Options {
|
|
46
|
+
hover?:
|
|
47
|
+
| boolean
|
|
48
|
+
| {
|
|
49
|
+
target?: string;
|
|
50
|
+
className?: string;
|
|
51
|
+
};
|
|
52
|
+
list: Item[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface Ref {
|
|
56
|
+
open(event: Event, options: Options): Ref;
|
|
57
|
+
close(): void;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare namespace ClCrud {
|
|
62
|
+
interface Dict {
|
|
63
|
+
api?: {
|
|
64
|
+
list?: string;
|
|
65
|
+
add?: string;
|
|
66
|
+
update?: string;
|
|
67
|
+
delete?: string;
|
|
68
|
+
info?: string;
|
|
69
|
+
page?: string;
|
|
70
|
+
};
|
|
71
|
+
pagination?: {
|
|
72
|
+
page?: string;
|
|
73
|
+
size?: string;
|
|
74
|
+
};
|
|
75
|
+
search?: {
|
|
76
|
+
keyWord?: string;
|
|
77
|
+
query?: string;
|
|
78
|
+
};
|
|
79
|
+
sort?: {
|
|
80
|
+
order?: string;
|
|
81
|
+
prop?: string;
|
|
82
|
+
};
|
|
83
|
+
label?: {
|
|
84
|
+
add?: string;
|
|
85
|
+
delete?: string;
|
|
86
|
+
multiDelete?: string;
|
|
87
|
+
update?: string;
|
|
88
|
+
refresh?: string;
|
|
89
|
+
advSearch?: string;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
interface Permission {
|
|
94
|
+
page?: boolean;
|
|
95
|
+
list?: boolean;
|
|
96
|
+
add?: boolean;
|
|
97
|
+
delete?: boolean;
|
|
98
|
+
update?: boolean;
|
|
99
|
+
info?: boolean;
|
|
100
|
+
[key: string]: any;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
interface Service {
|
|
104
|
+
page: {
|
|
105
|
+
params: {
|
|
106
|
+
page?: number;
|
|
107
|
+
size?: number;
|
|
108
|
+
keyWord?: string;
|
|
109
|
+
[key: string]: any;
|
|
110
|
+
};
|
|
111
|
+
result: {
|
|
112
|
+
list: any[];
|
|
113
|
+
pagination?: {
|
|
114
|
+
total?: number;
|
|
115
|
+
page?: number;
|
|
116
|
+
size?: number;
|
|
117
|
+
};
|
|
118
|
+
[key: string]: any;
|
|
119
|
+
};
|
|
120
|
+
request(params?: Service["page"]["params"]): Promise<Service["page"]["result"]>;
|
|
121
|
+
};
|
|
122
|
+
delete: {
|
|
123
|
+
params: { ids?: Array<string | number>; [key: string]: any };
|
|
124
|
+
request(params: Service["delete"]["params"]): Promise<any>;
|
|
125
|
+
};
|
|
126
|
+
info: {
|
|
127
|
+
params: { id?: string | number; [key: string]: any };
|
|
128
|
+
request(params: Service["info"]["params"]): Promise<any>;
|
|
129
|
+
};
|
|
130
|
+
upsert: {
|
|
131
|
+
request(params: any): Promise<any>;
|
|
132
|
+
};
|
|
133
|
+
list: {
|
|
134
|
+
request(params: any): Promise<any[]>;
|
|
135
|
+
};
|
|
136
|
+
api: {
|
|
137
|
+
page?(params?: any): Promise<any>;
|
|
138
|
+
list?(params?: any): Promise<any>;
|
|
139
|
+
add?(params?: any): Promise<any>;
|
|
140
|
+
update?(params?: any): Promise<any>;
|
|
141
|
+
info?(params?: any): Promise<any>;
|
|
142
|
+
delete?(params?: any): Promise<any>;
|
|
143
|
+
[key: string]: any;
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
interface Props {
|
|
148
|
+
service: Service["api"] | "test";
|
|
149
|
+
permission?: Permission;
|
|
150
|
+
dict?: Dict;
|
|
151
|
+
onRefresh?(
|
|
152
|
+
params: Service["page"]["params"],
|
|
153
|
+
event: {
|
|
154
|
+
done: fun;
|
|
155
|
+
next: Service["page"]["request"];
|
|
156
|
+
render: (list: any[], pagination?: Service["page"]["result"]["pagination"]) => void;
|
|
157
|
+
}
|
|
158
|
+
): void;
|
|
159
|
+
onDelete?(
|
|
160
|
+
selection: any[],
|
|
161
|
+
event: {
|
|
162
|
+
next: Service["delete"]["request"];
|
|
163
|
+
}
|
|
164
|
+
): void;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
interface Ref {
|
|
168
|
+
name: string;
|
|
169
|
+
routePath: string;
|
|
170
|
+
permission: Permission;
|
|
171
|
+
dict: Dict;
|
|
172
|
+
service: Service["api"];
|
|
173
|
+
loading: boolean;
|
|
174
|
+
params: any;
|
|
175
|
+
selection: any[];
|
|
176
|
+
Table: ClTable.Ref;
|
|
177
|
+
set(key: "dict" | "style" | "service" | "permission", value: any): void;
|
|
178
|
+
done(): void;
|
|
179
|
+
getParams(): any;
|
|
180
|
+
getPermission(key?: string): boolean;
|
|
181
|
+
rowAdd(): any;
|
|
182
|
+
rowEdit(data: any): any;
|
|
183
|
+
rowAppend(data?: any): any;
|
|
184
|
+
rowClose(): any;
|
|
185
|
+
rowDelete(...selection: any[]): void;
|
|
186
|
+
proxy(name: string, data?: any[]): any;
|
|
187
|
+
refresh: Service["page"]["request"];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
interface Provide extends Ref {
|
|
191
|
+
[key: string]: any;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
declare namespace ElementPlus {
|
|
196
|
+
type Size = "large" | "default" | "small";
|
|
197
|
+
|
|
198
|
+
interface FormProps {
|
|
199
|
+
inline?: boolean;
|
|
200
|
+
labelPosition?: "left" | "right" | "top";
|
|
201
|
+
labelWidth?: string | number;
|
|
202
|
+
labelSuffix?: string;
|
|
203
|
+
hideRequiredAsterisk?: boolean;
|
|
204
|
+
showMessage?: boolean;
|
|
205
|
+
inlineMessage?: boolean;
|
|
206
|
+
statusIcon?: boolean;
|
|
207
|
+
validateOnRuleChange?: boolean;
|
|
208
|
+
size?: Size;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
declare interface EmitterItem {
|
|
213
|
+
name: string;
|
|
214
|
+
callback(data: any, events: { refresh(params: any): void; crudList: ClCrud.Ref[] }): void;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
declare interface Emitter {
|
|
218
|
+
list: EmitterItem[];
|
|
219
|
+
init(events: any): void;
|
|
220
|
+
emit(name: string, data?: any): void;
|
|
221
|
+
on(name: string, callback: any): void;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
declare namespace ClForm {
|
|
225
|
+
interface Item {
|
|
226
|
+
type?: "tabs";
|
|
227
|
+
prop?: string;
|
|
228
|
+
props?: {
|
|
229
|
+
labels?: Array<{ label: string; value: string; name?: string }>;
|
|
230
|
+
justify?: "left" | "center" | "right";
|
|
231
|
+
color?: string;
|
|
232
|
+
mergeProp?: boolean;
|
|
233
|
+
labelWidth?: string;
|
|
234
|
+
error?: string;
|
|
235
|
+
showMessage?: boolean;
|
|
236
|
+
inlineMessage?: boolean;
|
|
237
|
+
size?: "medium" | "default" | "small";
|
|
238
|
+
[key: string]: any;
|
|
239
|
+
};
|
|
240
|
+
hook?: Hook.Form;
|
|
241
|
+
group?: string;
|
|
242
|
+
collapse?: boolean;
|
|
243
|
+
value?: any;
|
|
244
|
+
label?: string | { text?: string; icon?: string; tip?: string };
|
|
245
|
+
span?: number;
|
|
246
|
+
flex?: boolean;
|
|
247
|
+
hidden?:
|
|
248
|
+
| boolean
|
|
249
|
+
| ((data: { scope: any; isEdit: boolean; isAdd: boolean }) => boolean)
|
|
250
|
+
| ":isAdd"
|
|
251
|
+
| ":isEdit"
|
|
252
|
+
| `@${string}`;
|
|
253
|
+
prepend?: Render.Options;
|
|
254
|
+
component?: Render.Options;
|
|
255
|
+
append?: Render.Options;
|
|
256
|
+
rules?: any;
|
|
257
|
+
required?: boolean;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
interface Options {
|
|
261
|
+
title?: string;
|
|
262
|
+
width?: string;
|
|
263
|
+
props?: ElementPlus.FormProps;
|
|
264
|
+
items: Item[];
|
|
265
|
+
form?: any;
|
|
266
|
+
on?: {
|
|
267
|
+
open?(form: any): void;
|
|
268
|
+
close?(done: fun): void;
|
|
269
|
+
submit?(data: any, event: { close: fun; done: fun }): void;
|
|
270
|
+
};
|
|
271
|
+
op?: {
|
|
272
|
+
hidden?: boolean;
|
|
273
|
+
saveButtonText?: string;
|
|
274
|
+
closeButtonText?: string;
|
|
275
|
+
buttons?: Array<"close" | "save" | Render.OpButton>;
|
|
276
|
+
};
|
|
277
|
+
dialog?: {
|
|
278
|
+
title?: string;
|
|
279
|
+
width?: string;
|
|
280
|
+
hideHeader?: boolean;
|
|
281
|
+
controls?: Array<"fullscreen" | "close">;
|
|
282
|
+
[key: string]: any;
|
|
283
|
+
};
|
|
284
|
+
[key: string]: any;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
interface Ref {
|
|
288
|
+
form: any;
|
|
289
|
+
open(options: Options): void;
|
|
290
|
+
close(): void;
|
|
291
|
+
done(): void;
|
|
292
|
+
clear(): void;
|
|
293
|
+
reset(): void;
|
|
294
|
+
showLoading(): void;
|
|
295
|
+
hideLoading(): void;
|
|
296
|
+
setData(prop: string, value: any): void;
|
|
297
|
+
bindForm(data: any): void;
|
|
298
|
+
setOptions(prop: string, list: Array<{ label: string; value?: any }>): void;
|
|
299
|
+
setProps(prop: string, value: any): void;
|
|
300
|
+
getForm(prop?: string): any;
|
|
301
|
+
setForm(prop: string, value: any): void;
|
|
302
|
+
showItem(props: string[] | string): void;
|
|
303
|
+
hideItem(props: string[] | string): void;
|
|
304
|
+
toggleItem(prop: string, flag?: boolean): void;
|
|
305
|
+
resetFields(): void;
|
|
306
|
+
clearValidate(props?: string[] | string): void;
|
|
307
|
+
validateField(
|
|
308
|
+
props: string[] | string,
|
|
309
|
+
callback: (isValid: boolean, invalidFields: any[]) => void
|
|
310
|
+
): Promise<void>;
|
|
311
|
+
validate(callback: (isValid: boolean, invalidFields: any[]) => void): Promise<void>;
|
|
312
|
+
changeTab(value: any, valid?: boolean): Promise<any>;
|
|
313
|
+
setTitle(value: string): void;
|
|
314
|
+
submit(callback?: (data: any) => void): void;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
declare namespace Hook {
|
|
319
|
+
type fn = ({ value: any, form: { [key]: string }, prop: string, [key]: string }) => any;
|
|
320
|
+
|
|
321
|
+
type FormPipe =
|
|
322
|
+
| "number"
|
|
323
|
+
| "string"
|
|
324
|
+
| "split"
|
|
325
|
+
| "join"
|
|
326
|
+
| "boolean"
|
|
327
|
+
| "booleanNumber"
|
|
328
|
+
| "datetimerange"
|
|
329
|
+
| FormPipe[]
|
|
330
|
+
| fn;
|
|
331
|
+
|
|
332
|
+
type Form =
|
|
333
|
+
| string
|
|
334
|
+
| {
|
|
335
|
+
bind?: FormPipe;
|
|
336
|
+
submit?: FormPipe;
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
declare namespace Render {
|
|
341
|
+
type OpButton =
|
|
342
|
+
| `slot-${string}`
|
|
343
|
+
| { label: string; type?: string; onClick({ scope }: any): void };
|
|
344
|
+
|
|
345
|
+
interface Options {
|
|
346
|
+
name?: string;
|
|
347
|
+
|
|
348
|
+
options?:
|
|
349
|
+
| Array<{
|
|
350
|
+
label: string;
|
|
351
|
+
value?: any;
|
|
352
|
+
[key: string]: any;
|
|
353
|
+
}>
|
|
354
|
+
| fun;
|
|
355
|
+
|
|
356
|
+
props?: any;
|
|
357
|
+
|
|
358
|
+
vm?: any;
|
|
359
|
+
|
|
360
|
+
[key: string]: any;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
declare namespace ClTable {
|
|
365
|
+
type Dict =
|
|
366
|
+
| Array<{
|
|
367
|
+
label: string;
|
|
368
|
+
value?: any;
|
|
369
|
+
type?: "success" | "warning" | "info" | "danger";
|
|
370
|
+
size?: "medium" | "default" | "small";
|
|
371
|
+
effect?: "dark" | "light" | "plain";
|
|
372
|
+
color?: string;
|
|
373
|
+
}>
|
|
374
|
+
| Ref<Dict>;
|
|
375
|
+
|
|
376
|
+
interface Column {
|
|
377
|
+
type?: "index" | "selection" | "expand" | "op";
|
|
378
|
+
hidden?: boolean;
|
|
379
|
+
component?: Render.Options;
|
|
380
|
+
dict?: Dict;
|
|
381
|
+
buttons?: Array<"edit" | "delete" | Render.OpButton>;
|
|
382
|
+
align?: "left" | "center" | "right";
|
|
383
|
+
label?: string;
|
|
384
|
+
className?: string;
|
|
385
|
+
prop?: string;
|
|
386
|
+
width?: number;
|
|
387
|
+
minWidth?: number | string;
|
|
388
|
+
renderHeader?: ({ column, $index }) => any;
|
|
389
|
+
sortable?: boolean | "desc" | "descending" | "ascending" | "asc" | "custom" | string;
|
|
390
|
+
sortMethod?: fun;
|
|
391
|
+
sortBy?: string | ((row: any, index: number) => any) | any[];
|
|
392
|
+
resizable?: {
|
|
393
|
+
type: boolean;
|
|
394
|
+
default: true;
|
|
395
|
+
};
|
|
396
|
+
columnKey?: string;
|
|
397
|
+
headerAlign?: string;
|
|
398
|
+
showOverflowTooltip?: boolean;
|
|
399
|
+
fixed?: boolean | string;
|
|
400
|
+
formatter?: (row: any, column: any, value: any, index: number) => any;
|
|
401
|
+
selectable?: (row: any, index) => boolean;
|
|
402
|
+
reserveSelection?: boolean;
|
|
403
|
+
filterMethod?: fun;
|
|
404
|
+
filteredValue?: unknown[];
|
|
405
|
+
filters?: unknown[];
|
|
406
|
+
filterPlacement?: string;
|
|
407
|
+
filterMultiple?: {
|
|
408
|
+
type: boolean;
|
|
409
|
+
default: true;
|
|
410
|
+
};
|
|
411
|
+
index?: ((index: number) => number) | number;
|
|
412
|
+
sortOrders?: unknown[];
|
|
413
|
+
children?: Column[];
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
interface Props {
|
|
417
|
+
columns?: Column[];
|
|
418
|
+
contextMenu?:
|
|
419
|
+
| boolean
|
|
420
|
+
| Array<
|
|
421
|
+
| ClContextMenu.Item
|
|
422
|
+
| ((row: any) => ClContextMenu.Item)
|
|
423
|
+
| "refresh"
|
|
424
|
+
| "check"
|
|
425
|
+
| "update"
|
|
426
|
+
| "edit"
|
|
427
|
+
| "delete"
|
|
428
|
+
| "order-desc"
|
|
429
|
+
| "order-asc"
|
|
430
|
+
>;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
interface Ref {
|
|
434
|
+
selection: any[];
|
|
435
|
+
data: any[];
|
|
436
|
+
columns: Column[];
|
|
437
|
+
reBuild(cb: fn): void;
|
|
438
|
+
setColumns(columns: Column[]): void;
|
|
439
|
+
showColumn(prop: string | string[], status?: boolean): void;
|
|
440
|
+
hideColumn(prop: string | string[]): void;
|
|
441
|
+
changeSort(prop: string, order: string): void;
|
|
442
|
+
clearSelection(): void;
|
|
443
|
+
getSelectionRows(): any[];
|
|
444
|
+
toggleRowSelection(row: any, selected?: any[]): void;
|
|
445
|
+
toggleAllSelection(): void;
|
|
446
|
+
toggleRowExpansion(row: any, expanded?: any[]): void;
|
|
447
|
+
setCurrentRow(row: any): void;
|
|
448
|
+
clearSort(): void;
|
|
449
|
+
clearFilter(columnKeys: string[]): void;
|
|
450
|
+
doLayout(): void;
|
|
451
|
+
sort(prop: string, order: string): void;
|
|
452
|
+
scrollTo(position: { top?: number; left?: number }): void;
|
|
453
|
+
setScrollTop(top: number): void;
|
|
454
|
+
setScrollLeft(left: number): void;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
declare namespace ClUpsert {
|
|
459
|
+
interface Props {
|
|
460
|
+
items: ClForm.Item[];
|
|
461
|
+
props?: ClForm.Options["props"];
|
|
462
|
+
sync?: boolean;
|
|
463
|
+
op?: ClForm.Options["op"];
|
|
464
|
+
dialog?: ClForm.Options["dialog"];
|
|
465
|
+
onOpen?(isEdit: boolean, data: any): void;
|
|
466
|
+
onClose?(done: fun): void;
|
|
467
|
+
onInfo?(
|
|
468
|
+
data: ClCrud.Service["info"]["params"],
|
|
469
|
+
event: { close: fun; done(data: any): void; next: ClCrud.Service["info"]["request"] }
|
|
470
|
+
): void;
|
|
471
|
+
onSubmit?(
|
|
472
|
+
isEdit: boolean,
|
|
473
|
+
data: any,
|
|
474
|
+
event: { close: fun; done: fun; next: ClCrud.Service["upsert"]["request"] }
|
|
475
|
+
): void;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
interface Ref extends ClForm.Ref {}
|
|
479
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@epie/bi-crud",
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "./dist/index.umd.min.js",
|
|
6
|
+
"typings": "types/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"serve": "vue-cli-service serve",
|
|
9
|
+
"build": "vue-cli-service build",
|
|
10
|
+
"lint": "vue-cli-service lint",
|
|
11
|
+
"report": "vue-cli-service build --report --target lib --name index ./src/index.ts",
|
|
12
|
+
"crud": "tsc && yarn build --target lib --name index ./src/index.ts"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"array.prototype.flat": "^1.2.4",
|
|
16
|
+
"core-js": "^3.21.1",
|
|
17
|
+
"element-plus": "^2.2.6",
|
|
18
|
+
"merge": "^2.1.1",
|
|
19
|
+
"mitt": "^3.0.0",
|
|
20
|
+
"vue": "^3.2.37"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/array.prototype.flat": "^1.2.1",
|
|
24
|
+
"@types/clone-deep": "^4.0.1",
|
|
25
|
+
"@vue/cli-plugin-babel": "^5.0.1",
|
|
26
|
+
"@vue/cli-plugin-typescript": "^5.0.3",
|
|
27
|
+
"@vue/cli-service": "^5.0.3",
|
|
28
|
+
"@vue/compiler-sfc": "^3.2.31",
|
|
29
|
+
"node-sass": "^7.0.1",
|
|
30
|
+
"prettier": "^2.4.1",
|
|
31
|
+
"sass-loader": "^12.6.0",
|
|
32
|
+
"typescript": "^4.6.2"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"types",
|
|
37
|
+
"index.d.ts"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => false | JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/// <reference types="../index" />
|
|
2
|
+
import { PropType } from "vue";
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
items: {
|
|
5
|
+
type: PropType<ClForm.Item[]>;
|
|
6
|
+
default: () => never[];
|
|
7
|
+
};
|
|
8
|
+
title: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
default: string;
|
|
11
|
+
};
|
|
12
|
+
size: {
|
|
13
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
op: {
|
|
17
|
+
type: ArrayConstructor;
|
|
18
|
+
default: () => string[];
|
|
19
|
+
};
|
|
20
|
+
onSearch: FunctionConstructor;
|
|
21
|
+
}, any, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("reset" | "clear")[], "reset" | "clear", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
items: {
|
|
23
|
+
type: PropType<ClForm.Item[]>;
|
|
24
|
+
default: () => never[];
|
|
25
|
+
};
|
|
26
|
+
title: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
size: {
|
|
31
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
op: {
|
|
35
|
+
type: ArrayConstructor;
|
|
36
|
+
default: () => string[];
|
|
37
|
+
};
|
|
38
|
+
onSearch: FunctionConstructor;
|
|
39
|
+
}>> & {
|
|
40
|
+
onReset?: ((...args: any[]) => any) | undefined;
|
|
41
|
+
onClear?: ((...args: any[]) => any) | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
title: string;
|
|
44
|
+
size: string | number;
|
|
45
|
+
items: ClForm.Item[];
|
|
46
|
+
op: unknown[];
|
|
47
|
+
}>;
|
|
48
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { PropType } from "vue";
|
|
2
|
+
declare const _default: import("vue").DefineComponent<{
|
|
3
|
+
visible: BooleanConstructor;
|
|
4
|
+
options: {
|
|
5
|
+
type: PropType<ClContextMenu.Item[]>;
|
|
6
|
+
default: () => {};
|
|
7
|
+
};
|
|
8
|
+
event: ObjectConstructor;
|
|
9
|
+
}, {
|
|
10
|
+
refs: any;
|
|
11
|
+
visible2: import("vue").Ref<boolean>;
|
|
12
|
+
ids: import("vue").Ref<string>;
|
|
13
|
+
style: any;
|
|
14
|
+
list: import("vue").Ref<{
|
|
15
|
+
label: string;
|
|
16
|
+
icon?: string | undefined;
|
|
17
|
+
prefixIcon?: string | undefined;
|
|
18
|
+
suffixIcon?: string | undefined;
|
|
19
|
+
ellipsis?: boolean | undefined;
|
|
20
|
+
disabled?: boolean | undefined;
|
|
21
|
+
hidden?: boolean | undefined;
|
|
22
|
+
children?: any[] | undefined;
|
|
23
|
+
showChildren?: boolean | undefined;
|
|
24
|
+
callback?: ((done: fun) => void) | undefined;
|
|
25
|
+
}[]>;
|
|
26
|
+
setRefs: (index: number) => (el: HTMLElement) => void;
|
|
27
|
+
open: (event: any, options?: any) => {
|
|
28
|
+
close: () => void;
|
|
29
|
+
};
|
|
30
|
+
close: () => void;
|
|
31
|
+
rowClick: (e: any, item: any, id: string) => any;
|
|
32
|
+
stopDefault: (e: any) => void;
|
|
33
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
34
|
+
visible: BooleanConstructor;
|
|
35
|
+
options: {
|
|
36
|
+
type: PropType<ClContextMenu.Item[]>;
|
|
37
|
+
default: () => {};
|
|
38
|
+
};
|
|
39
|
+
event: ObjectConstructor;
|
|
40
|
+
}>>, {
|
|
41
|
+
visible: boolean;
|
|
42
|
+
options: ClContextMenu.Item[];
|
|
43
|
+
}>;
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/// <reference types="../index" />
|
|
2
|
+
declare const ClContextMenu: import("vue").DefineComponent<{
|
|
3
|
+
show: BooleanConstructor;
|
|
4
|
+
options: {
|
|
5
|
+
type: ObjectConstructor;
|
|
6
|
+
default: () => {};
|
|
7
|
+
};
|
|
8
|
+
event: {
|
|
9
|
+
type: ObjectConstructor;
|
|
10
|
+
default: () => {};
|
|
11
|
+
};
|
|
12
|
+
}, {
|
|
13
|
+
refs: any;
|
|
14
|
+
visible: import("vue").Ref<boolean>;
|
|
15
|
+
ids: import("vue").Ref<string>;
|
|
16
|
+
style: any;
|
|
17
|
+
list: import("vue").Ref<{
|
|
18
|
+
[x: string]: any;
|
|
19
|
+
label: string;
|
|
20
|
+
icon?: string | undefined;
|
|
21
|
+
prefixIcon?: string | undefined;
|
|
22
|
+
suffixIcon?: string | undefined;
|
|
23
|
+
ellipsis?: boolean | undefined;
|
|
24
|
+
disabled?: boolean | undefined;
|
|
25
|
+
hidden?: boolean | undefined;
|
|
26
|
+
children?: any[] | undefined;
|
|
27
|
+
showChildren?: boolean | undefined;
|
|
28
|
+
callback?: ((done: fun) => void) | undefined;
|
|
29
|
+
}[]>;
|
|
30
|
+
setRefs: (index: number) => (el: HTMLElement) => void;
|
|
31
|
+
open: (event: any, options?: any) => {
|
|
32
|
+
close: () => void;
|
|
33
|
+
};
|
|
34
|
+
close: () => void;
|
|
35
|
+
rowClick: (e: any, item: any, id: string) => any;
|
|
36
|
+
stopDefault: (e: any) => void;
|
|
37
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
|
+
show: BooleanConstructor;
|
|
39
|
+
options: {
|
|
40
|
+
type: ObjectConstructor;
|
|
41
|
+
default: () => {};
|
|
42
|
+
};
|
|
43
|
+
event: {
|
|
44
|
+
type: ObjectConstructor;
|
|
45
|
+
default: () => {};
|
|
46
|
+
};
|
|
47
|
+
}>>, {
|
|
48
|
+
options: Record<string, any>;
|
|
49
|
+
show: boolean;
|
|
50
|
+
event: Record<string, any>;
|
|
51
|
+
}>;
|
|
52
|
+
export declare const ContextMenu: {
|
|
53
|
+
open(event: any, options: ClContextMenu.Options): void;
|
|
54
|
+
};
|
|
55
|
+
export default ClContextMenu;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="../index" />
|
|
2
|
+
export declare function useHelper({ mitt, props, crud }: any): {
|
|
3
|
+
proxy: (name: string, data?: any[] | undefined) => void;
|
|
4
|
+
set: (key: string, value: any) => void;
|
|
5
|
+
on: (name: string, callback: fun) => void;
|
|
6
|
+
rowAdd: () => void;
|
|
7
|
+
rowEdit: (data: any) => void;
|
|
8
|
+
rowAppend: (data: any) => void;
|
|
9
|
+
rowDelete: (...selection: any[]) => void;
|
|
10
|
+
rowClose: () => void;
|
|
11
|
+
refresh: (params?: any) => Promise<unknown>;
|
|
12
|
+
getPermission: (key: "page" | "list" | "info" | "update" | "add" | "delete") => boolean;
|
|
13
|
+
paramsReplace: (params: any) => any;
|
|
14
|
+
getParams: () => Object;
|
|
15
|
+
};
|