morghulis 1.0.46 → 1.0.48

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
@@ -116,8 +116,9 @@ export interface MDialogConfig {
116
116
 
117
117
  /**
118
118
  * 对话框属性选项
119
+ * 结合了Element Plus的Dialog组件属性和自定义属性
119
120
  */
120
- export interface MDialogProps extends MDialogConfig {
121
+ export interface MDialogProps extends Partial<ElementPlus.DialogProps>, MDialogConfig {
121
122
  /**
122
123
  * 对话框宽度
123
124
  */
@@ -134,6 +135,80 @@ export interface MDialogProps extends MDialogConfig {
134
135
  * 取消回调函数
135
136
  */
136
137
  cancel?: (data: any, done: () => void) => void;
138
+ /**
139
+ * 对话框标题
140
+ */
141
+ title?: string;
142
+ /**
143
+ * 对话框副标题
144
+ */
145
+ subtitle?: string;
146
+ /**
147
+ * 是否显示关闭按钮
148
+ */
149
+ showClose?: boolean;
150
+ /**
151
+ * 是否全屏显示
152
+ */
153
+ fullscreen?: boolean;
154
+ /**
155
+ * 是否可拖动
156
+ */
157
+ draggable?: boolean;
158
+ /**
159
+ * 是否居中显示
160
+ */
161
+ center?: boolean;
162
+ /**
163
+ * 关闭前的回调
164
+ */
165
+ beforeClose?: (done: () => void) => void;
166
+ /**
167
+ * 自定义类名
168
+ */
169
+ customClass?: string;
170
+ /**
171
+ * 是否在关闭时销毁
172
+ */
173
+ destroyOnClose?: boolean;
174
+ /**
175
+ * 是否显示遮罩层
176
+ */
177
+ modal?: boolean;
178
+ /**
179
+ * 是否在点击遮罩层时关闭
180
+ */
181
+ closeOnClickModal?: boolean;
182
+ /**
183
+ * 是否在按下ESC时关闭
184
+ */
185
+ closeOnPressEscape?: boolean;
186
+ /**
187
+ * 是否锁定屏幕滚动
188
+ */
189
+ lockScroll?: boolean;
190
+ /**
191
+ * 是否将对话框插入到body元素
192
+ */
193
+ appendToBody?: boolean;
194
+ }
195
+
196
+ /**
197
+ * 对话框头部组件属性
198
+ */
199
+ export interface MDialogHeaderProps {
200
+ /**
201
+ * 标题
202
+ */
203
+ title?: string;
204
+ /**
205
+ * 副标题
206
+ */
207
+ subtitle?: string;
208
+ /**
209
+ * 配置选项
210
+ */
211
+ config: MDialogConfig;
137
212
  }
138
213
 
139
214
  /**
@@ -270,38 +345,27 @@ export function createMorghulis(options?: MOptions): {
270
345
  };
271
346
 
272
347
  /**
273
- * MDialog组件类型
348
+ * 对话框组件
349
+ * 提供基于Element Plus对话框的增强版本
274
350
  */
275
- export interface MDialogInstance {
351
+ export const MDialog: DefineComponent<MDialogProps, {}, {
276
352
  /**
277
353
  * 打开对话框
278
- * @param data 传递给对话框的数据
354
+ * @param data 要传递的数据
279
355
  * @param config 对话框配置
280
356
  */
281
357
  open: (data?: any, config?: MDialogConfig) => void;
282
-
283
358
  /**
284
359
  * 关闭对话框
285
360
  */
286
361
  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
362
  }>;
296
363
 
297
364
  /**
298
365
  * 对话框头部组件
366
+ * 用于显示对话框标题和副标题
299
367
  */
300
- export const MDialogHeader: DefineComponent<{
301
- title: string,
302
- subtitle: string,
303
- config: MDialogConfig
304
- }>;
368
+ export const MDialogHeader: DefineComponent<MDialogHeaderProps>;
305
369
 
306
370
  // 导出Element Plus组件
307
371
  export const ElementPlusComponents: typeof ElementPlus;