morghulis 1.0.43 → 1.0.46

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 CHANGED
@@ -1,7 +1,11 @@
1
- import type { App } from 'vue';
1
+ import type { App, DefineComponent } from 'vue';
2
+ import type * as ElementPlus from 'element-plus';
3
+
4
+ // 导出Element Plus的所有类型
5
+ export * from 'element-plus';
2
6
 
3
7
  /**
4
- * Morghulis库的主配置选项
8
+ * 核心配置选项
5
9
  */
6
10
  export interface MOptions {
7
11
  /**
@@ -96,6 +100,42 @@ export interface MBox {
96
100
  show: (content: string, title?: string, type?: MFeedback) => void;
97
101
  }
98
102
 
103
+ /**
104
+ * 对话框配置选项
105
+ */
106
+ export interface MDialogConfig {
107
+ /**
108
+ * 对话框标题
109
+ */
110
+ title?: string;
111
+ /**
112
+ * 对话框副标题
113
+ */
114
+ subtitle?: string;
115
+ }
116
+
117
+ /**
118
+ * 对话框属性选项
119
+ */
120
+ export interface MDialogProps extends MDialogConfig {
121
+ /**
122
+ * 对话框宽度
123
+ */
124
+ width?: string | number;
125
+ /**
126
+ * 对话框距顶部距离
127
+ */
128
+ top?: string;
129
+ /**
130
+ * 确认回调函数
131
+ */
132
+ confirm?: (data: any, done: () => void) => void;
133
+ /**
134
+ * 取消回调函数
135
+ */
136
+ cancel?: (data: any, done: () => void) => void;
137
+ }
138
+
99
139
  /**
100
140
  * 系统关键字常量
101
141
  */
@@ -227,4 +267,41 @@ export function useMoRequest(): {
227
267
  */
228
268
  export function createMorghulis(options?: MOptions): {
229
269
  install: (Vue: App) => void;
230
- };
270
+ };
271
+
272
+ /**
273
+ * MDialog组件类型
274
+ */
275
+ export interface MDialogInstance {
276
+ /**
277
+ * 打开对话框
278
+ * @param data 传递给对话框的数据
279
+ * @param config 对话框配置
280
+ */
281
+ open: (data?: any, config?: MDialogConfig) => void;
282
+
283
+ /**
284
+ * 关闭对话框
285
+ */
286
+ close: () => void;
287
+ }
288
+
289
+ /**
290
+ * 对话框组件
291
+ */
292
+ export const MDialog: DefineComponent<MDialogProps, {}, any, {}, {}, {}, {}, {
293
+ open: (data?: any, config?: MDialogConfig) => void;
294
+ close: () => void;
295
+ }>;
296
+
297
+ /**
298
+ * 对话框头部组件
299
+ */
300
+ export const MDialogHeader: DefineComponent<{
301
+ title: string,
302
+ subtitle: string,
303
+ config: MDialogConfig
304
+ }>;
305
+
306
+ // 导出Element Plus组件
307
+ export const ElementPlusComponents: typeof ElementPlus;