morghulis 1.0.31 → 1.0.32

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.
Files changed (42) hide show
  1. package/README.md +74 -350
  2. package/dist/index.css +1 -1
  3. package/dist/index.d.ts +1 -374
  4. package/dist/index.js +2857 -7666
  5. package/dist/index.js.map +1 -0
  6. package/package.json +25 -48
  7. package/dist/components/cell/MCell.vue.d.ts +0 -11
  8. package/dist/components/cell/char/CharCell.vue.d.ts +0 -15
  9. package/dist/components/cell/date/DateCell.vue.d.ts +0 -15
  10. package/dist/components/cell/refer/SelectCell.vue.d.ts +0 -15
  11. package/dist/components/cell/simple/BooleanCell.vue.d.ts +0 -15
  12. package/dist/components/cell/simple/DefaultCell.vue.d.ts +0 -15
  13. package/dist/components/cell/simple/NumberCell.vue.d.ts +0 -18
  14. package/dist/components/cell/useCellComponents.d.ts +0 -2
  15. package/dist/components/common/MCtrlBtn.vue.d.ts +0 -30
  16. package/dist/components/common/MOption.vue.d.ts +0 -10
  17. package/dist/components/dialog/MDialog.vue.d.ts +0 -57
  18. package/dist/components/dialog/MDialogHeader.vue.d.ts +0 -9
  19. package/dist/components/form/MForm.vue.d.ts +0 -13
  20. package/dist/components/table/MTable.vue.d.ts +0 -65
  21. package/dist/components/table/MTableButtons.vue.d.ts +0 -17
  22. package/dist/components/table/MTableHeader.vue.d.ts +0 -17
  23. package/dist/components/table/data/DCell.vue.d.ts +0 -18
  24. package/dist/components/table/data/DForm.vue.d.ts +0 -16
  25. package/dist/components/table/data/DTable.vue.d.ts +0 -78
  26. package/dist/components/table/data/DTableController.vue.d.ts +0 -19
  27. package/dist/components/table/data/DTablePopController.vue.d.ts +0 -13
  28. package/dist/components/table/data/useDTable.d.ts +0 -77
  29. package/dist/components/table/data/useDTableCell.d.ts +0 -6
  30. package/dist/components/table/useMTable.d.ts +0 -25
  31. package/dist/hooks/authorize.d.ts +0 -13
  32. package/dist/hooks/channel.d.ts +0 -13
  33. package/dist/hooks/cookies.d.ts +0 -6
  34. package/dist/hooks/request.d.ts +0 -5
  35. package/dist/hooks/socket.d.ts +0 -7
  36. package/dist/index.umd.cjs +0 -38
  37. package/dist/tools/dao.d.ts +0 -27
  38. package/dist/tools/feedback.d.ts +0 -4
  39. package/dist/tools/query.d.ts +0 -20
  40. package/dist/types/dialog/dialog.types.d.ts +0 -41
  41. package/dist/types/index.d.ts +0 -1
  42. package/dist/types/table/m.table.types.d.ts +0 -55
package/dist/index.d.ts CHANGED
@@ -1,374 +1 @@
1
- import type { App } from 'vue';
2
- import type { ElDialog, ElButton, ElText, ElDivider, ElSpace } from 'element-plus';
3
-
4
- // 导入Vue组件实例类型
5
- import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, EmitsOptions, Component } from 'vue';
6
-
7
- // 如果这些类型错误是由于TypeScript版本不匹配导致的,我们可以使用更灵活的导入方式
8
- declare namespace Vue {
9
- interface App {}
10
- interface Component {}
11
- interface ComponentOptionsMixin {}
12
- interface VNodeProps {}
13
- interface AllowedComponentProps {}
14
- interface ComponentCustomProps {}
15
- interface EmitsOptions {}
16
- interface DefineComponent<P = {}, S = {}, M = {}> {
17
- new (): {
18
- $props: P
19
- }
20
- }
21
- }
22
-
23
- type DefineComponent<P = {}> = Vue.DefineComponent<P>;
24
-
25
- // 基础类型定义
26
- export type UIFeedbackTypes = "success" | "info" | "warning" | "error";
27
- export type UITextTypes = "success" | "info" | "warning" | "danger" | 'primary';
28
- export type UISizeTypes = 'default' | 'small' | 'large' | "";
29
-
30
- // 直接在类型定义文件中定义MorDialogProps,避免相对路径引用
31
- export interface MorDialogProps {
32
- modelValue?: boolean,
33
- title?: string,
34
- subTitle?: string,
35
- width?: string | number,
36
- fullscreen?: boolean,
37
- top?: string,
38
- modal?: boolean,
39
- modalClass?: string,
40
- headerClass?: string,
41
- bodyClass?: string,
42
- footerClass?: string,
43
- appendToBody?: boolean,
44
- appendTo?: string,
45
- lockScroll?: boolean,
46
- openDelay?: number,
47
- closeDelay?: number,
48
- closeOnClickModal?: boolean,
49
- closeOnPressEscape?: boolean,
50
- showClose?: boolean,
51
- beforeClose?: (done: () => void) => void,
52
- draggable?: boolean,
53
- overFlow?: boolean,
54
- center?: boolean,
55
- alignCenter?: boolean,
56
- destroyOnClose?: boolean,
57
- closeIcon?: string,
58
- zIndex?: number,
59
- headerAriaLevel?: string,
60
- confirm?: (data: any, done: () => void) => void,
61
- cancel?: (data: any, done: () => void) => void,
62
- confirmButtonText?: string,
63
- cancelButtonText?: string,
64
- data?: any
65
- }
66
-
67
- // 定义MorDialogConfig接口
68
- export interface MorDialogConfig {
69
- title?: string,
70
- subTitle?: string
71
- }
72
-
73
- // 定义MorOption接口
74
- export interface MorOption {
75
- baseURL?: string,
76
- minioURL?: string,
77
- [key: string]: any
78
- }
79
-
80
- // 定义表格相关类型
81
- export interface DataItem {
82
- [key: string]: any;
83
- }
84
-
85
- export type Orders = Array<{
86
- column: string;
87
- asc?: boolean;
88
- }>;
89
-
90
- export interface DaoTypes {
91
- add: (entity: string, bean: DataItem) => Promise<any>;
92
- update: (entity: string, bean: DataItem) => Promise<any>;
93
- delete: (entity: string, id: string | number) => Promise<any>;
94
- get: (entity: string, id: string | number, options?: any) => Promise<any>;
95
- list: (entity: string, options?: any) => Promise<any>;
96
- page: (entity: string, page: number, size: number, options?: any) => Promise<any>;
97
- }
98
-
99
- export interface MetaField {
100
- code: string;
101
- name: string;
102
- type: string;
103
- options?: any[];
104
- required?: boolean;
105
- readonly?: boolean;
106
- hidden?: boolean;
107
- [key: string]: any;
108
- }
109
-
110
- export interface MetaView {
111
- code: string;
112
- name: string;
113
- fields: MetaField[];
114
- [key: string]: any;
115
- }
116
-
117
- export type SortableCallbackFn = (newIndex: number, oldIndex: number) => void;
118
-
119
- export type MTableButton = {
120
- size?: UISizeTypes;
121
- handler?: (row: any, event?: Event) => void;
122
- title?: string | Function;
123
- type?: UITextTypes | Function;
124
- link?: boolean | Function;
125
- plain?: boolean | Function;
126
- text?: boolean | Function;
127
- round?: boolean | Function;
128
- circle?: boolean | Function;
129
- disabled?: boolean | Function;
130
- dark?: boolean | Function;
131
- color?: string | Function;
132
- tag?: string | Function;
133
- };
134
-
135
- export type MTableColumn = {
136
- label: string;
137
- component: Component;
138
- width?: string | number;
139
- };
140
-
141
- export interface TableProps {
142
- data?: any[];
143
- height?: string | number;
144
- maxHeight?: string | number;
145
- stripe?: boolean;
146
- border?: boolean;
147
- size?: string;
148
- fit?: boolean;
149
- showHeader?: boolean;
150
- highlightCurrentRow?: boolean;
151
- currentRowKey?: string | number;
152
- rowClassName?: string | ((param: { row: any, rowIndex: number }) => string);
153
- rowStyle?: object | ((param: { row: any, rowIndex: number }) => object);
154
- cellClassName?: string | ((param: { row: any, column: any, rowIndex: number, columnIndex: number }) => string);
155
- cellStyle?: object | ((param: { row: any, column: any, rowIndex: number, columnIndex: number }) => object);
156
- headerRowClassName?: string | ((param: { row: any, rowIndex: number }) => string);
157
- headerRowStyle?: object | ((param: { row: any, rowIndex: number }) => object);
158
- headerCellClassName?: string | ((param: { row: any, column: any, rowIndex: number, columnIndex: number }) => string);
159
- headerCellStyle?: object | ((param: { row: any, column: any, rowIndex: number, columnIndex: number }) => object);
160
- rowKey?: string | ((row: any) => string);
161
- emptyText?: string;
162
- defaultExpandAll?: boolean;
163
- expandRowKeys?: any[];
164
- defaultSort?: { prop: string, order: string };
165
- tooltipEffect?: string;
166
- showSummary?: boolean;
167
- sumText?: string;
168
- summaryMethod?: (param: { columns: any[], data: any[] }) => any[];
169
- spanMethod?: (param: { row: any, column: any, rowIndex: number, columnIndex: number }) => number[] | { rowspan: number, colspan: number };
170
- selectOnIndeterminate?: boolean;
171
- indent?: number;
172
- lazy?: boolean;
173
- load?: (row: any, treeNode: any, resolve: (data: any[]) => void) => void;
174
- treeProps?: { children: string, hasChildren: string };
175
- }
176
-
177
- export interface MorghulisTableProps extends TableProps {
178
- loading?: boolean;
179
- view: MetaView;
180
- buttons?: MTableButton[];
181
- columns?: MTableColumn[];
182
- sortableCallback?: SortableCallbackFn;
183
- }
184
-
185
- export interface DTableProps {
186
- auth?: boolean;
187
- db: DaoTypes;
188
- entity: string;
189
- code?: string;
190
- size?: number;
191
- page?: number;
192
- includes?: DataItem;
193
- excludes?: DataItem;
194
- orders?: Orders;
195
- buttons?: MTableButton[];
196
- columns?: MTableColumn[];
197
- }
198
-
199
- export interface DCellProps {
200
- view: MetaView;
201
- prop: string;
202
- bean: DataItem;
203
- db: DaoTypes;
204
- disabled?: boolean;
205
- }
206
-
207
- // 定义MFormProps接口
208
- export interface MFormProps {
209
- item: DataItem;
210
- view: MetaView;
211
- db: DaoTypes;
212
- }
213
-
214
- // 定义DFormProps接口
215
- export interface DFormProps {
216
- selection: any[];
217
- view: MetaView;
218
- db: DaoTypes;
219
- bean: DataItem;
220
- }
221
-
222
- // 定义useMorghulisAuthorize函数的返回类型
223
- export interface MorghulisAuthorize {
224
- $client: string;
225
- user: () => any;
226
- check: (uid?: any) => boolean;
227
- login: (uid: any) => void;
228
- logout: () => void;
229
- bearer: () => string | null;
230
- }
231
-
232
- // 创建库的入口函数
233
- export declare function createMorghulis(options?: MorOption): {
234
- install: (Vue: App) => void;
235
- };
236
-
237
- // 导出更详细的组件类型
238
-
239
- // 导出MDialog组件类型增强
240
- export declare interface MDialogInstance {
241
- open: (data?: any, config?: MorDialogConfig) => void;
242
- close: () => void;
243
- }
244
-
245
- // 添加v-model和事件支持
246
- export interface ModelDirectives {
247
- 'v-model'?: any;
248
- 'v-model:modelValue'?: any;
249
- 'v-model:title'?: string;
250
- 'v-model:subTitle'?: string;
251
- }
252
-
253
- // 更新MDialog类型
254
- export declare const MDialog: DefineComponent<MorDialogProps & {
255
- 'onUpdate:modelValue'?: (value: boolean) => any;
256
- 'onUpdate:title'?: (value: string) => any;
257
- 'onUpdate:subTitle'?: (value: string) => any;
258
- 'onClose'?: () => any;
259
- } & ModelDirectives> & MDialogInstance;
260
-
261
- // 导出MTable组件类型增强
262
- export declare interface MTableInstance {
263
- getSelection: () => any[];
264
- setSelection: (rows: any[]) => void;
265
- closePopover: () => void;
266
- }
267
-
268
- // 更新MTable类型
269
- export declare const MTable: DefineComponent<MorghulisTableProps & {
270
- 'onSelection-change'?: (selection: any[]) => any;
271
- 'onSort'?: (column: any, prop: string, order: string) => any;
272
- }> & MTableInstance;
273
-
274
- // 导出MForm组件类型增强
275
- export declare interface MFormInstance {
276
- getData: () => any;
277
- reset: (prop: string) => void;
278
- }
279
- export declare const MForm: DefineComponent<MFormProps> & MFormInstance;
280
-
281
- // 导出DTable组件类型增强
282
- export declare interface DTableInstance {
283
- refresh: () => void;
284
- add: () => void;
285
- edit: (row: any) => void;
286
- remove: (row: any) => void;
287
- handlePageSizeChange: (size: number) => void;
288
- handleCurrentPageChange: (page: number) => void;
289
- load: () => void;
290
- upload: (data: any[]) => void;
291
- }
292
- export declare const DTable: DefineComponent<DTableProps> & DTableInstance;
293
-
294
- // 导出DForm组件类型增强
295
- export declare interface DFormInstance {
296
- getData: () => any[];
297
- }
298
- export declare const DForm: DefineComponent<DFormProps> & DFormInstance;
299
-
300
- // 导出DCell组件类型增强
301
- export declare interface DCellEvents {
302
- onCancel: (...args: any[]) => any;
303
- onSave: (...args: any[]) => any;
304
- }
305
- export declare const DCell: DefineComponent<DCellProps & DCellEvents>;
306
-
307
- // 导出MCell组件
308
- export declare const MCell: DefineComponent;
309
-
310
- // 导出DController组件
311
- export declare const DController: DefineComponent;
312
-
313
- // 声明useMorghulisAuthorize函数
314
- export declare function useMorghulisAuthorize(): MorghulisAuthorize;
315
-
316
- // 其他hooks
317
- export declare function useMorghulisChannel(): any;
318
- export declare function useMorghulisSockets(baseURL?: string): any;
319
- export declare function loadMorghulisSockets(baseURL?: string): any;
320
- export declare function useMorghulisRequest(): {
321
- get: <T = any>(url: string, params?: any, config?: any) => Promise<T>;
322
- post: <T = any>(url: string, data?: any, config?: any) => Promise<T>;
323
- put: <T = any>(url: string, data?: any, config?: any) => Promise<T>;
324
- delete: <T = any>(url: string, data?: any, config?: any) => Promise<T>;
325
- };
326
- export declare function useMorghulisCookies(): {
327
- get: (key: string, defaultValue?: any) => any;
328
- set: (key: string, value: any, options?: any) => void;
329
- remove: (key: string, options?: any) => void;
330
- load: (key: string, defaultValue?: any) => any;
331
- };
332
-
333
- // 声明全局组件类型
334
- declare module '@vue/runtime-core' {
335
- export interface GlobalComponents {
336
- // Morghulis组件
337
- MDialog: typeof MDialog;
338
- MTable: typeof MTable;
339
- MForm: typeof MForm;
340
- MCell: typeof MCell;
341
- DTable: typeof DTable;
342
- DCell: typeof DCell;
343
- DForm: typeof DForm;
344
- DController: typeof DController;
345
-
346
- // Element Plus组件
347
- ElButton: typeof ElButton;
348
- ElDialog: typeof ElDialog;
349
- ElText: typeof ElText;
350
- ElDivider: typeof ElDivider;
351
- ElSpace: typeof ElSpace;
352
- // 可以根据需要添加更多Element Plus组件
353
-
354
- // PascalCase 形式
355
- MTable: typeof import('morghulis')['MTable']
356
- MDialog: typeof import('morghulis')['MDialog']
357
- MForm: typeof import('morghulis')['MForm']
358
- DTable: typeof import('morghulis')['DTable']
359
- DCell: typeof import('morghulis')['DCell']
360
- DForm: typeof import('morghulis')['DForm']
361
- DController: typeof import('morghulis')['DController']
362
- MCell: typeof import('morghulis')['MCell']
363
-
364
- // kebab-case 形式
365
- 'm-table': typeof import('morghulis')['MTable']
366
- 'm-dialog': typeof import('morghulis')['MDialog']
367
- 'm-form': typeof import('morghulis')['MForm']
368
- 'd-table': typeof import('morghulis')['DTable']
369
- 'd-cell': typeof import('morghulis')['DCell']
370
- 'd-form': typeof import('morghulis')['DForm']
371
- 'd-controller': typeof import('morghulis')['DController']
372
- 'm-cell': typeof import('morghulis')['MCell']
373
- }
374
- }
1
+ export { }