morghulis 1.0.48 → 1.0.49
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.d.ts +31 -3
- package/package.json +5 -3
- package/types/morghulis.d.ts +146 -0
- package/types/tsconfig.json +24 -0
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
import type { App, DefineComponent } from 'vue';
|
1
|
+
import type { App, DefineComponent, Component } from 'vue';
|
2
2
|
import type * as ElementPlus from 'element-plus';
|
3
|
+
import type { DialogProps } from 'element-plus';
|
3
4
|
|
4
5
|
// 导出Element Plus的所有类型
|
5
6
|
export * from 'element-plus';
|
@@ -118,7 +119,7 @@ export interface MDialogConfig {
|
|
118
119
|
* 对话框属性选项
|
119
120
|
* 结合了Element Plus的Dialog组件属性和自定义属性
|
120
121
|
*/
|
121
|
-
export interface MDialogProps extends Partial<
|
122
|
+
export interface MDialogProps extends Partial<DialogProps>, MDialogConfig {
|
122
123
|
/**
|
123
124
|
* 对话框宽度
|
124
125
|
*/
|
@@ -191,6 +192,18 @@ export interface MDialogProps extends Partial<ElementPlus.DialogProps>, MDialogC
|
|
191
192
|
* 是否将对话框插入到body元素
|
192
193
|
*/
|
193
194
|
appendToBody?: boolean;
|
195
|
+
/**
|
196
|
+
* 确认按钮文本
|
197
|
+
*/
|
198
|
+
confirmButtonText?: string;
|
199
|
+
/**
|
200
|
+
* 取消按钮文本
|
201
|
+
*/
|
202
|
+
cancelButtonText?: string;
|
203
|
+
/**
|
204
|
+
* 初始数据
|
205
|
+
*/
|
206
|
+
data?: any;
|
194
207
|
}
|
195
208
|
|
196
209
|
/**
|
@@ -368,4 +381,19 @@ export const MDialog: DefineComponent<MDialogProps, {}, {
|
|
368
381
|
export const MDialogHeader: DefineComponent<MDialogHeaderProps>;
|
369
382
|
|
370
383
|
// 导出Element Plus组件
|
371
|
-
export const ElementPlusComponents: typeof ElementPlus;
|
384
|
+
export const ElementPlusComponents: typeof ElementPlus;
|
385
|
+
|
386
|
+
// 默认导出
|
387
|
+
export default createMorghulis;
|
388
|
+
|
389
|
+
// 为了支持全局组件类型声明,扩展Vue的内置类型
|
390
|
+
declare module '@vue/runtime-core' {
|
391
|
+
export interface GlobalComponents {
|
392
|
+
// Morghulis组件
|
393
|
+
MDialog: DefineComponent<MDialogProps, {}, {
|
394
|
+
open: (data?: any, config?: MDialogConfig) => void;
|
395
|
+
close: () => void;
|
396
|
+
}>;
|
397
|
+
MDialogHeader: DefineComponent<MDialogHeaderProps>;
|
398
|
+
}
|
399
|
+
}
|
package/package.json
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
{
|
2
2
|
"name": "morghulis",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.49",
|
4
4
|
"description": "数据库模型",
|
5
5
|
"private": false,
|
6
6
|
"type": "module",
|
7
7
|
"main": "dist/index.js",
|
8
8
|
"module": "dist/index.js",
|
9
|
-
"types": "
|
9
|
+
"types": "types/morghulis.d.ts",
|
10
|
+
"typings": "types/morghulis.d.ts",
|
10
11
|
"bin": {
|
11
12
|
"install-element-plus": "install-deps.cjs"
|
12
13
|
},
|
13
14
|
"files": [
|
14
15
|
"dist",
|
15
|
-
"install-deps.cjs"
|
16
|
+
"install-deps.cjs",
|
17
|
+
"types"
|
16
18
|
],
|
17
19
|
"scripts": {
|
18
20
|
"dev": "vite",
|
@@ -0,0 +1,146 @@
|
|
1
|
+
// 这个文件用于声明Morghulis组件库的类型,确保TypeScript能够正确识别组件和API
|
2
|
+
import type { App, Component, DefineComponent } from 'vue';
|
3
|
+
import type { DialogProps } from 'element-plus';
|
4
|
+
|
5
|
+
declare module 'morghulis' {
|
6
|
+
// 组件库配置选项
|
7
|
+
export interface MOptions {
|
8
|
+
baseURL: string;
|
9
|
+
minioURL: string;
|
10
|
+
[key: string]: any;
|
11
|
+
}
|
12
|
+
|
13
|
+
// 对话框配置
|
14
|
+
export interface MDialogConfig {
|
15
|
+
title?: string;
|
16
|
+
subtitle?: string;
|
17
|
+
}
|
18
|
+
|
19
|
+
// 对话框组件属性
|
20
|
+
export interface MDialogProps extends Partial<DialogProps> {
|
21
|
+
// 对话框标题与副标题
|
22
|
+
title?: string;
|
23
|
+
subtitle?: string;
|
24
|
+
|
25
|
+
// 对话框尺寸与位置
|
26
|
+
width?: string | number;
|
27
|
+
top?: string;
|
28
|
+
fullscreen?: boolean;
|
29
|
+
|
30
|
+
// 对话框配置
|
31
|
+
modal?: boolean;
|
32
|
+
modalClass?: string;
|
33
|
+
headerClass?: string;
|
34
|
+
bodyClass?: string;
|
35
|
+
footerClass?: string;
|
36
|
+
appendToBody?: boolean;
|
37
|
+
lockScroll?: boolean;
|
38
|
+
openDelay?: number;
|
39
|
+
closeDelay?: number;
|
40
|
+
closeOnClickModal?: boolean;
|
41
|
+
closeOnPressEscape?: boolean;
|
42
|
+
showClose?: boolean;
|
43
|
+
beforeClose?: (done: () => void) => void;
|
44
|
+
draggable?: boolean;
|
45
|
+
center?: boolean;
|
46
|
+
alignCenter?: boolean;
|
47
|
+
destroyOnClose?: boolean;
|
48
|
+
customClass?: string;
|
49
|
+
|
50
|
+
// MDialog特有属性
|
51
|
+
confirm?: (data: any, done: () => void) => void;
|
52
|
+
cancel?: (data: any, done: () => void) => void;
|
53
|
+
confirmButtonText?: string;
|
54
|
+
cancelButtonText?: string;
|
55
|
+
data?: any;
|
56
|
+
}
|
57
|
+
|
58
|
+
// 对话框头部组件属性
|
59
|
+
export interface MDialogHeaderProps {
|
60
|
+
title?: string;
|
61
|
+
subtitle?: string;
|
62
|
+
config: MDialogConfig;
|
63
|
+
}
|
64
|
+
|
65
|
+
// 组件导出
|
66
|
+
export const MDialog: DefineComponent<MDialogProps, {}, {
|
67
|
+
open: (data?: any, config?: MDialogConfig) => void;
|
68
|
+
close: () => void;
|
69
|
+
}>;
|
70
|
+
|
71
|
+
export const MDialogHeader: DefineComponent<MDialogHeaderProps>;
|
72
|
+
|
73
|
+
// 工具导出
|
74
|
+
export const $message: {
|
75
|
+
info: (content: string) => void;
|
76
|
+
success: (content: string) => void;
|
77
|
+
warning: (content: string) => void;
|
78
|
+
error: (content: string) => void;
|
79
|
+
show: (content: string, type?: "success" | "info" | "warning" | "error") => void;
|
80
|
+
};
|
81
|
+
|
82
|
+
export const $alert: {
|
83
|
+
info: (content: string, title?: string) => Promise<any>;
|
84
|
+
success: (content: string, title?: string) => Promise<any>;
|
85
|
+
warning: (content: string, title?: string) => Promise<any>;
|
86
|
+
error: (content: string, title?: string) => Promise<any>;
|
87
|
+
show: (content: string, title?: string, type?: "success" | "info" | "warning" | "error") => void;
|
88
|
+
};
|
89
|
+
|
90
|
+
export const $confirm: {
|
91
|
+
info: (content: string, title?: string) => Promise<any>;
|
92
|
+
success: (content: string, title?: string) => Promise<any>;
|
93
|
+
warning: (content: string, title?: string) => Promise<any>;
|
94
|
+
error: (content: string, title?: string) => Promise<any>;
|
95
|
+
show: (content: string, title?: string, type?: "success" | "info" | "warning" | "error") => void;
|
96
|
+
};
|
97
|
+
|
98
|
+
// 钩子函数
|
99
|
+
export function useMCookies(): {
|
100
|
+
get: (path: string) => any;
|
101
|
+
set: (path: string, value?: any) => void;
|
102
|
+
load: (key: string, value?: any) => any;
|
103
|
+
remove: (path: string) => void;
|
104
|
+
};
|
105
|
+
|
106
|
+
export function useMAuthorize(): {
|
107
|
+
$client: string;
|
108
|
+
user: () => any;
|
109
|
+
check: (uid?: any) => boolean;
|
110
|
+
login: (uid: any) => void;
|
111
|
+
logout: () => void;
|
112
|
+
bearer: () => string | null;
|
113
|
+
};
|
114
|
+
|
115
|
+
export function useMoRequest(): {
|
116
|
+
getHttpRequest: (auth?: boolean) => any;
|
117
|
+
getMinioRequest: () => any;
|
118
|
+
};
|
119
|
+
|
120
|
+
// 核心系统常量
|
121
|
+
export const SYSTEM_KEY: {
|
122
|
+
CLIENT: string;
|
123
|
+
USER: string;
|
124
|
+
AUTH: string;
|
125
|
+
};
|
126
|
+
|
127
|
+
// 创建实例函数
|
128
|
+
export function createMorghulis(options?: MOptions): {
|
129
|
+
install: (app: App) => void;
|
130
|
+
};
|
131
|
+
|
132
|
+
// 默认导出
|
133
|
+
export default createMorghulis;
|
134
|
+
}
|
135
|
+
|
136
|
+
// 为Vue全局组件扩展类型
|
137
|
+
declare module '@vue/runtime-core' {
|
138
|
+
interface GlobalComponents {
|
139
|
+
// Morghulis组件
|
140
|
+
MDialog: DefineComponent<import('morghulis').MDialogProps, {}, {
|
141
|
+
open: (data?: any, config?: import('morghulis').MDialogConfig) => void;
|
142
|
+
close: () => void;
|
143
|
+
}>;
|
144
|
+
MDialogHeader: DefineComponent<import('morghulis').MDialogHeaderProps, {}, {}>;
|
145
|
+
}
|
146
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"target": "ES2020",
|
4
|
+
"module": "ESNext",
|
5
|
+
"moduleResolution": "Node",
|
6
|
+
"declaration": true,
|
7
|
+
"strict": true,
|
8
|
+
"noImplicitAny": true,
|
9
|
+
"strictNullChecks": true,
|
10
|
+
"strictFunctionTypes": true,
|
11
|
+
"strictBindCallApply": true,
|
12
|
+
"strictPropertyInitialization": true,
|
13
|
+
"noImplicitThis": true,
|
14
|
+
"alwaysStrict": true,
|
15
|
+
"noUnusedLocals": true,
|
16
|
+
"noUnusedParameters": true,
|
17
|
+
"noImplicitReturns": true,
|
18
|
+
"noFallthroughCasesInSwitch": true,
|
19
|
+
"esModuleInterop": true,
|
20
|
+
"skipLibCheck": true,
|
21
|
+
"forceConsistentCasingInFileNames": true
|
22
|
+
},
|
23
|
+
"include": ["*.d.ts"]
|
24
|
+
}
|