morghulis 1.0.27 → 1.0.29

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 CHANGED
@@ -15,6 +15,7 @@ npm install morghulis
15
15
  ```typescript
16
16
  import { createApp } from 'vue'
17
17
  import { createMorghulis } from 'morghulis'
18
+ import 'morghulis/dist/index.css'
18
19
  import App from './App.vue'
19
20
 
20
21
  const app = createApp(App)
@@ -31,18 +32,37 @@ app.use(createMorghulis({
31
32
  app.mount('#app')
32
33
  ```
33
34
 
35
+ ### 样式导入
36
+
37
+ 你可以通过以下任意方式导入样式:
38
+
39
+ ```typescript
40
+ // 推荐方式
41
+ import 'morghulis/dist/index.css'
42
+
43
+ // 或使用以下方式之一
44
+ import 'morghulis/style'
45
+ import 'morghulis/dist/style'
46
+ import 'morghulis/dist/style.css'
47
+ ```
48
+
34
49
  ### 单独使用组件
35
50
 
36
51
  ```typescript
37
- import { MTable, MDialog, MForm, DTable } from 'morghulis'
52
+ import { MDialog, MTable, MForm, DTable, DCell, DForm, DController, MCell } from 'morghulis'
53
+ import 'morghulis/dist/index.css'
38
54
 
39
55
  // 在组件中使用
40
56
  export default {
41
57
  components: {
42
- MTable,
43
58
  MDialog,
59
+ MTable,
44
60
  MForm,
45
- DTable
61
+ DTable,
62
+ DCell,
63
+ DForm,
64
+ DController,
65
+ MCell
46
66
  }
47
67
  }
48
68
  ```
@@ -50,36 +70,334 @@ export default {
50
70
  ### 使用工具函数
51
71
 
52
72
  ```typescript
53
- import { useMorghulisRequest, useMorghulisCookies } from 'morghulis'
73
+ import { useMorghulisAuthorize, useMorghulisRequest, useMorghulisCookies } from 'morghulis'
54
74
 
55
75
  // 在组件中使用
56
76
  setup() {
57
77
  const { get, post } = useMorghulisRequest()
58
78
  const { get: getCookie, set: setCookie } = useMorghulisCookies()
79
+ const { login, logout, check, bearer } = useMorghulisAuthorize()
59
80
 
60
81
  // 使用这些函数...
61
82
  }
62
83
  ```
63
84
 
64
- ## 组件
85
+ ## 组件详解
65
86
 
66
- - `MTable`: 表格组件
67
- - `MDialog`: 对话框组件
68
- - `MForm`: 表单组件
69
- - `DTable`: 数据表格组件
87
+ ### MDialog 对话框组件
70
88
 
71
- ## 工具函数
89
+ 对话框组件,用于创建自定义对话框。
90
+
91
+ #### 属性
92
+
93
+ ```typescript
94
+ import { MDialog } from 'morghulis'
95
+ import type { MorDialogProps, MorDialogConfig } from 'morghulis'
96
+
97
+ // 在模板中使用
98
+ <MDialog
99
+ v-model="dialogVisible" // 控制对话框显示/隐藏
100
+ title="标题" // 对话框标题
101
+ subTitle="副标题" // 对话框副标题
102
+ :width="600" // 宽度,支持数字或字符串
103
+ :fullscreen="false" // 是否全屏
104
+ :modal="true" // 是否显示遮罩层
105
+ :modalClass="'custom-modal'" // 遮罩层自定义类名
106
+ :headerClass="'custom-header'" // 头部自定义类名
107
+ :bodyClass="'custom-body'" // 内容区自定义类名
108
+ :footerClass="'custom-footer'" // 底部自定义类名
109
+ :appendToBody="true" // 是否将对话框插入至body元素
110
+ :lockScroll="true" // 是否在显示对话框时将body滚动锁定
111
+ :closeOnClickModal="false" // 是否可通过点击遮罩层关闭对话框
112
+ :closeOnPressEscape="false" // 是否可通过按ESC键关闭对话框
113
+ :showClose="true" // 是否显示关闭按钮
114
+ :draggable="true" // 是否可拖拽
115
+ :center="false" // 是否居中布局
116
+ :destroyOnClose="true" // 关闭时销毁其中的元素
117
+ :confirmButtonText="'确认'" // 确认按钮文字
118
+ :cancelButtonText="'取消'" // 取消按钮文字
119
+ :confirm="handleConfirm" // 确认回调,接收(data, done)参数
120
+ :cancel="handleCancel" // 取消回调,接收(data, done)参数
121
+ @close="handleClose"
122
+ @update:modelValue="(val) => dialogVisible = val"
123
+ @update:title="(val) => title = val"
124
+ @update:subTitle="(val) => subTitle = val"
125
+ />
126
+ ```
127
+
128
+ #### 方法
129
+
130
+ ```typescript
131
+ // 在组件中使用方法
132
+ const dialog = ref()
133
+
134
+ // 打开对话框,可传入数据和配置
135
+ dialog.value.open(
136
+ { id: 1, name: '张三' }, // 传递给对话框的数据
137
+ { title: '用户详情', subTitle: '编辑用户信息' } // 可选配置
138
+ )
139
+
140
+ // 关闭对话框
141
+ dialog.value.close()
142
+ ```
143
+
144
+ ### MTable 表格组件
145
+
146
+ 通用数据表格组件,支持自定义列和操作按钮。
147
+
148
+ #### 属性
149
+
150
+ ```typescript
151
+ import { MTable } from 'morghulis'
152
+ import type { MorghulisTableProps, MTableButton, MTableColumn } from 'morghulis'
153
+
154
+ <MTable
155
+ :data="tableData" // 表格数据
156
+ :view="metaView" // 元数据视图,定义表格结构
157
+ :loading="isLoading" // 加载状态
158
+ :buttons="tableButtons" // 操作按钮配置
159
+ :columns="tableColumns" // 自定义列配置
160
+ :sortableCallback="handleSort" // 排序回调
161
+
162
+ // 以下是基础表格属性
163
+ :border="true" // 是否带有边框
164
+ :stripe="true" // 是否为斑马纹表格
165
+ :highlightCurrentRow="true" // 是否高亮当前行
166
+ :row-key="'id'" // 行数据的唯一标识
167
+ :headerCellClassName="'custom-header'" // 表头单元格类名
168
+
169
+ @selection-change="handleSelectionChange" // 选择项变化事件
170
+ @sort="handleColumnSort" // 排序事件
171
+ >
172
+ <!-- 自定义插槽 -->
173
+ <template #header>
174
+ <!-- 自定义表格头部内容 -->
175
+ </template>
176
+
177
+ <template #header-tool>
178
+ <!-- 自定义表格头部工具区 -->
179
+ </template>
180
+
181
+ <template #cell="{ field, row, prop }">
182
+ <!-- 自定义单元格内容 -->
183
+ </template>
184
+
185
+ <template #footer>
186
+ <!-- 自定义表格底部内容 -->
187
+ </template>
188
+
189
+ <template #footer-tool>
190
+ <!-- 自定义表格底部工具区 -->
191
+ </template>
192
+ </MTable>
193
+ ```
194
+
195
+ #### 方法
196
+
197
+ ```typescript
198
+ // 引用表格组件
199
+ const table = ref()
200
+
201
+ // 获取当前选中的行
202
+ const selectedRows = table.value.getSelection()
203
+
204
+ // 设置选中的行
205
+ table.value.setSelection(rows)
206
+
207
+ // 关闭弹出框
208
+ table.value.closePopover()
209
+ ```
72
210
 
73
- - `useMorghulisAuthorize`: 授权相关函数
74
- - `useMorghulisChannel`: 通道相关函数
75
- - `useMorghulisSockets`: Socket相关函数
76
- - `useMorghulisRequest`: 请求相关函数
77
- - `useMorghulisCookies`: Cookie相关函数
211
+ ### MForm 表单组件
78
212
 
79
- ## 类型
213
+ 表单组件,支持自动生成表单字段和字段验证。
80
214
 
81
- 所有类型都已导出,可以直接导入使用:
215
+ #### 属性
82
216
 
83
217
  ```typescript
84
- import { MorghulisOptions, UIFeedbackTypes } from 'morghulis'
218
+ import { MForm } from 'morghulis'
219
+ import type { MFormProps } from 'morghulis'
220
+
221
+ <MForm
222
+ :item="formData" // 表单数据
223
+ :view="metaView" // 元数据视图,定义表单结构
224
+ :db="databaseObject" // 数据库对象,用于CRUD操作
225
+ />
226
+ ```
227
+
228
+ #### 方法
229
+
230
+ ```typescript
231
+ // 引用表单组件
232
+ const form = ref()
233
+
234
+ // 获取表单数据
235
+ const formData = form.value.getData()
236
+
237
+ // 重置特定字段
238
+ form.value.reset('fieldName')
239
+ ```
240
+
241
+ ### DTable 数据表格组件
242
+
243
+ 基于MTable的数据表格组件,提供完整的CRUD功能。
244
+
245
+ #### 属性
246
+
247
+ ```typescript
248
+ import { DTable } from 'morghulis'
249
+ import type { DTableProps } from 'morghulis'
250
+
251
+ <DTable
252
+ :db="databaseObject" // 数据库对象,用于CRUD操作
253
+ :entity="'users'" // 实体名称,对应后端接口
254
+ :code="'user'" // 代码标识,用于元数据
255
+ :size="10" // 每页数量
256
+ :page="1" // 当前页码
257
+ :includes="includeFields" // 包含的字段
258
+ :excludes="excludeFields" // 排除的字段
259
+ :orders="orderConfig" // 排序配置
260
+ :buttons="actionButtons" // 操作按钮
261
+ :columns="customColumns" // 自定义列
262
+ :auth="requireAuth" // 是否需要授权
263
+ >
264
+ <!-- 自定义插槽 -->
265
+ <template #header>
266
+ <!-- 自定义头部 -->
267
+ </template>
268
+
269
+ <template #cell="{ field, row, prop }">
270
+ <!-- 自定义单元格 -->
271
+ </template>
272
+ </DTable>
273
+ ```
274
+
275
+ #### 方法
276
+
277
+ ```typescript
278
+ // 引用数据表格组件
279
+ const dataTable = ref()
280
+
281
+ // 刷新表格数据
282
+ dataTable.value.refresh()
283
+
284
+ // 添加新记录
285
+ dataTable.value.add()
286
+
287
+ // 编辑某条记录
288
+ dataTable.value.edit(row)
289
+
290
+ // 删除某条记录
291
+ dataTable.value.remove(row)
292
+
293
+ // 加载数据
294
+ dataTable.value.load()
295
+
296
+ // 上传数据
297
+ dataTable.value.upload(dataArray)
298
+
299
+ // 修改每页显示数量
300
+ dataTable.value.handlePageSizeChange(20)
301
+
302
+ // 修改当前页码
303
+ dataTable.value.handleCurrentPageChange(2)
304
+ ```
305
+
306
+ ### DForm 数据表单组件
307
+
308
+ 用于数据操作的表单组件。
309
+
310
+ #### 属性
311
+
312
+ ```typescript
313
+ import { DForm } from 'morghulis'
314
+ import type { DFormProps } from 'morghulis'
315
+
316
+ <DForm
317
+ :selection="selectedRows" // 选中的数据行
318
+ :view="metaView" // 元数据视图
319
+ :db="databaseObject" // 数据库对象
320
+ :bean="formData" // 表单数据
321
+ />
322
+ ```
323
+
324
+ #### 方法
325
+
326
+ ```typescript
327
+ // 引用数据表单
328
+ const dataForm = ref()
329
+
330
+ // 获取表单数据
331
+ const formData = dataForm.value.getData()
332
+ ```
333
+
334
+ ### DCell 数据单元格组件
335
+
336
+ 用于表格中单个数据单元格的编辑。
337
+
338
+ #### 属性
339
+
340
+ ```typescript
341
+ import { DCell } from 'morghulis'
342
+ import type { DCellProps } from 'morghulis'
343
+
344
+ <DCell
345
+ :view="metaView" // 元数据视图
346
+ :prop="fieldName" // 字段名称
347
+ :bean="rowData" // 行数据
348
+ :db="databaseObject" // 数据库对象
349
+ :disabled="false" // 是否禁用
350
+ @cancel="handleCancel" // 取消事件
351
+ @save="handleSave" // 保存事件
352
+ />
353
+ ```
354
+
355
+ ## 全局类型支持
356
+
357
+ 组件库提供全局类型支持,导入后可以在模板中直接使用组件名称,TypeScript 会自动提供类型检查和属性提示:
358
+
359
+ ```vue
360
+ <template>
361
+ <MDialog
362
+ v-model="dialogVisible"
363
+ title="标题"
364
+ @close="handleClose"
365
+ />
366
+
367
+ <!-- Element Plus 组件也有类型提示 -->
368
+ <ElButton type="primary">按钮</ElButton>
369
+ </template>
370
+
371
+ <script setup lang="ts">
372
+ import { ref } from 'vue'
373
+ // 无需导入组件,但需要导入库
374
+ import 'morghulis'
375
+
376
+ const dialogVisible = ref(false)
377
+ const handleClose = () => {
378
+ dialogVisible.value = false
379
+ }
380
+ </script>
381
+ ```
382
+
383
+ ## 版本历史
384
+
385
+ ### 1.0.29
386
+ - 增强了类型定义,补充了 MTable, MForm, DTable 组件的方法导出
387
+ - 更新了 README.md,添加了详细的组件属性和方法说明
388
+
389
+ ### 1.0.28
390
+ - 修复了类型声明冲突问题
391
+ - 添加了完整的组件类型定义
392
+ - 增加了全局类型支持,现在可以在模板中获得完整的属性提示
393
+ - 解决了CSS导入问题,支持多种导入路径
394
+
395
+ ### 1.0.27
396
+ - 修改了类型定义,避免与 Vue 内置类型冲突
397
+ - 优化了组件属性和事件定义
398
+
399
+ ## 工具函数
400
+
401
+ ### 授权功能
402
+
85
403
  ```
package/dist/index.d.ts CHANGED
@@ -2,7 +2,12 @@ import type { App } from 'vue';
2
2
  import type { ElDialog, ElButton, ElText, ElDivider, ElSpace } from 'element-plus';
3
3
 
4
4
  // 导入Vue组件实例类型
5
- import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, EmitsOptions } from 'vue';
5
+ import type { DefineComponent, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, EmitsOptions, Component } from 'vue';
6
+
7
+ // 基础类型定义
8
+ export type UIFeedbackTypes = "success" | "info" | "warning" | "error";
9
+ export type UITextTypes = "success" | "info" | "warning" | "danger" | 'primary';
10
+ export type UISizeTypes = 'default' | 'small' | 'large' | "";
6
11
 
7
12
  // 直接在类型定义文件中定义MorDialogProps,避免相对路径引用
8
13
  export interface MorDialogProps {
@@ -54,6 +59,140 @@ export interface MorOption {
54
59
  [key: string]: any
55
60
  }
56
61
 
62
+ // 定义表格相关类型
63
+ export interface DataItem {
64
+ [key: string]: any;
65
+ }
66
+
67
+ export type Orders = Array<{
68
+ column: string;
69
+ asc?: boolean;
70
+ }>;
71
+
72
+ export interface DaoTypes {
73
+ add: (entity: string, bean: DataItem) => Promise<any>;
74
+ update: (entity: string, bean: DataItem) => Promise<any>;
75
+ delete: (entity: string, id: string | number) => Promise<any>;
76
+ get: (entity: string, id: string | number, options?: any) => Promise<any>;
77
+ list: (entity: string, options?: any) => Promise<any>;
78
+ page: (entity: string, page: number, size: number, options?: any) => Promise<any>;
79
+ }
80
+
81
+ export interface MetaField {
82
+ code: string;
83
+ name: string;
84
+ type: string;
85
+ options?: any[];
86
+ required?: boolean;
87
+ readonly?: boolean;
88
+ hidden?: boolean;
89
+ [key: string]: any;
90
+ }
91
+
92
+ export interface MetaView {
93
+ code: string;
94
+ name: string;
95
+ fields: MetaField[];
96
+ [key: string]: any;
97
+ }
98
+
99
+ export type SortableCallbackFn = (newIndex: number, oldIndex: number) => void;
100
+
101
+ export type MTableButton = {
102
+ size?: UISizeTypes;
103
+ handler?: (row: any, event?: Event) => void;
104
+ title?: string | Function;
105
+ type?: UITextTypes | Function;
106
+ link?: boolean | Function;
107
+ plain?: boolean | Function;
108
+ text?: boolean | Function;
109
+ round?: boolean | Function;
110
+ circle?: boolean | Function;
111
+ disabled?: boolean | Function;
112
+ dark?: boolean | Function;
113
+ color?: string | Function;
114
+ tag?: string | Function;
115
+ };
116
+
117
+ export type MTableColumn = {
118
+ label: string;
119
+ component: Component;
120
+ width?: string | number;
121
+ };
122
+
123
+ export interface TableProps {
124
+ data?: any[];
125
+ height?: string | number;
126
+ maxHeight?: string | number;
127
+ stripe?: boolean;
128
+ border?: boolean;
129
+ size?: string;
130
+ fit?: boolean;
131
+ showHeader?: boolean;
132
+ highlightCurrentRow?: boolean;
133
+ currentRowKey?: string | number;
134
+ rowClassName?: string | ((param: { row: any, rowIndex: number }) => string);
135
+ rowStyle?: object | ((param: { row: any, rowIndex: number }) => object);
136
+ cellClassName?: string | ((param: { row: any, column: any, rowIndex: number, columnIndex: number }) => string);
137
+ cellStyle?: object | ((param: { row: any, column: any, rowIndex: number, columnIndex: number }) => object);
138
+ headerRowClassName?: string | ((param: { row: any, rowIndex: number }) => string);
139
+ headerRowStyle?: object | ((param: { row: any, rowIndex: number }) => object);
140
+ headerCellClassName?: string | ((param: { row: any, column: any, rowIndex: number, columnIndex: number }) => string);
141
+ headerCellStyle?: object | ((param: { row: any, column: any, rowIndex: number, columnIndex: number }) => object);
142
+ rowKey?: string | ((row: any) => string);
143
+ emptyText?: string;
144
+ defaultExpandAll?: boolean;
145
+ expandRowKeys?: any[];
146
+ defaultSort?: { prop: string, order: string };
147
+ tooltipEffect?: string;
148
+ showSummary?: boolean;
149
+ sumText?: string;
150
+ summaryMethod?: (param: { columns: any[], data: any[] }) => any[];
151
+ spanMethod?: (param: { row: any, column: any, rowIndex: number, columnIndex: number }) => number[] | { rowspan: number, colspan: number };
152
+ selectOnIndeterminate?: boolean;
153
+ indent?: number;
154
+ lazy?: boolean;
155
+ load?: (row: any, treeNode: any, resolve: (data: any[]) => void) => void;
156
+ treeProps?: { children: string, hasChildren: string };
157
+ }
158
+
159
+ export interface MorghulisTableProps extends TableProps {
160
+ loading?: boolean;
161
+ view: MetaView;
162
+ buttons?: MTableButton[];
163
+ columns?: MTableColumn[];
164
+ sortableCallback?: SortableCallbackFn;
165
+ }
166
+
167
+ export interface DTableProps {
168
+ auth?: boolean;
169
+ db: DaoTypes;
170
+ entity: string;
171
+ code?: string;
172
+ size?: number;
173
+ page?: number;
174
+ includes?: DataItem;
175
+ excludes?: DataItem;
176
+ orders?: Orders;
177
+ buttons?: MTableButton[];
178
+ columns?: MTableColumn[];
179
+ }
180
+
181
+ export interface DCellProps {
182
+ view: MetaView;
183
+ prop: string;
184
+ bean: DataItem;
185
+ db: DaoTypes;
186
+ disabled?: boolean;
187
+ }
188
+
189
+ export interface DFormProps {
190
+ selection: any[];
191
+ view: MetaView;
192
+ db: DaoTypes;
193
+ bean: DataItem;
194
+ }
195
+
57
196
  // 定义useMorghulisAuthorize函数的返回类型
58
197
  export interface MorghulisAuthorize {
59
198
  $client: string;
@@ -127,21 +266,158 @@ export declare const MDialog: DefineComponent<
127
266
  // 导出MCell组件
128
267
  export declare const MCell: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<{}>, {}>;
129
268
 
269
+ // 导出MTable组件
270
+ export declare const MTable: DefineComponent<
271
+ MorghulisTableProps,
272
+ {},
273
+ {},
274
+ {},
275
+ {},
276
+ ComponentOptionsMixin,
277
+ ComponentOptionsMixin,
278
+ {
279
+ 'selection-change': (selection: any[]) => true;
280
+ 'sort': (column: any, prop: string, order: string) => true;
281
+ },
282
+ string,
283
+ VNodeProps & AllowedComponentProps & ComponentCustomProps,
284
+ Readonly<MorghulisTableProps> & {
285
+ 'onSelection-change'?: (selection: any[]) => any;
286
+ 'onSort'?: (column: any, prop: string, order: string) => any;
287
+ },
288
+ {}
289
+ > & {
290
+ getSelection: () => any[];
291
+ setSelection: (rows: any[]) => void;
292
+ closePopover: () => void;
293
+ };
294
+
295
+ // 更新MForm接口,添加缺失的属性
296
+ export interface MFormProps {
297
+ item: DataItem;
298
+ view: MetaView;
299
+ db: DaoTypes;
300
+ }
301
+
302
+ // 导出MForm组件
303
+ export declare const MForm: DefineComponent<
304
+ MFormProps,
305
+ {},
306
+ {},
307
+ {},
308
+ {},
309
+ ComponentOptionsMixin,
310
+ ComponentOptionsMixin,
311
+ {},
312
+ string,
313
+ VNodeProps & AllowedComponentProps & ComponentCustomProps,
314
+ Readonly<MFormProps>,
315
+ {}
316
+ > & {
317
+ getData: () => any;
318
+ reset: (prop: string) => void;
319
+ };
320
+
130
321
  // 导出数据表格相关组件
131
- export declare const DTable: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<{}>, {}>;
132
- export declare const DForm: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<{}>, {}>;
133
- export declare const DCell: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<{}>, {}>;
322
+ export declare const DTable: DefineComponent<
323
+ DTableProps,
324
+ {},
325
+ {},
326
+ {},
327
+ {},
328
+ ComponentOptionsMixin,
329
+ ComponentOptionsMixin,
330
+ {},
331
+ string,
332
+ VNodeProps & AllowedComponentProps & ComponentCustomProps,
333
+ Readonly<DTableProps>,
334
+ {
335
+ size: number;
336
+ page: number;
337
+ }
338
+ > & {
339
+ refresh: () => void;
340
+ add: () => void;
341
+ edit: (row: any) => void;
342
+ remove: (row: any) => void;
343
+ handlePageSizeChange: (size: number) => void;
344
+ handleCurrentPageChange: (page: number) => void;
345
+ load: () => void;
346
+ upload: (data: any[]) => void;
347
+ };
348
+
349
+ export declare const DCell: DefineComponent<
350
+ DCellProps,
351
+ {},
352
+ {},
353
+ {},
354
+ {},
355
+ ComponentOptionsMixin,
356
+ ComponentOptionsMixin,
357
+ {
358
+ cancel: (...args: any[]) => void;
359
+ save: (...args: any[]) => void;
360
+ },
361
+ string,
362
+ VNodeProps & AllowedComponentProps & ComponentCustomProps,
363
+ Readonly<DCellProps> & {
364
+ onCancel?: (...args: any[]) => any;
365
+ onSave?: (...args: any[]) => any;
366
+ },
367
+ {}
368
+ >;
369
+
370
+ export declare const DForm: DefineComponent<
371
+ DFormProps,
372
+ {},
373
+ {},
374
+ {},
375
+ {},
376
+ ComponentOptionsMixin,
377
+ ComponentOptionsMixin,
378
+ {},
379
+ string,
380
+ VNodeProps & AllowedComponentProps & ComponentCustomProps,
381
+ Readonly<DFormProps>,
382
+ {}
383
+ > & {
384
+ getData: () => any[];
385
+ };
386
+
134
387
  export declare const DController: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<{}>, {}>;
135
388
 
136
389
  // 声明useMorghulisAuthorize函数
137
390
  export declare function useMorghulisAuthorize(): MorghulisAuthorize;
138
391
 
392
+ // 其他hooks
393
+ export declare function useMorghulisChannel(): any;
394
+ export declare function useMorghulisSockets(baseURL?: string): any;
395
+ export declare function loadMorghulisSockets(baseURL?: string): any;
396
+ export declare function useMorghulisRequest(): {
397
+ get: <T = any>(url: string, params?: any, config?: any) => Promise<T>;
398
+ post: <T = any>(url: string, data?: any, config?: any) => Promise<T>;
399
+ put: <T = any>(url: string, data?: any, config?: any) => Promise<T>;
400
+ delete: <T = any>(url: string, data?: any, config?: any) => Promise<T>;
401
+ };
402
+ export declare function useMorghulisCookies(): {
403
+ get: (key: string, defaultValue?: any) => any;
404
+ set: (key: string, value: any, options?: any) => void;
405
+ remove: (key: string, options?: any) => void;
406
+ load: (key: string, defaultValue?: any) => any;
407
+ };
408
+
139
409
  // 声明全局组件类型
140
410
  declare module '@vue/runtime-core' {
141
411
  export interface GlobalComponents {
142
412
  // Morghulis组件
143
413
  MDialog: typeof MDialog;
414
+ MTable: typeof MTable;
415
+ MForm: typeof MForm;
144
416
  MCell: typeof MCell;
417
+ DTable: typeof DTable;
418
+ DCell: typeof DCell;
419
+ DForm: typeof DForm;
420
+ DController: typeof DController;
145
421
 
146
422
  // Element Plus组件
147
423
  ElButton: typeof ElButton;
@@ -1,4 +1,4 @@
1
- (function(de,Ae){typeof exports=="object"&&typeof module<"u"?Ae(exports,require("element-plus"),require("@fortawesome/fontawesome-svg-core"),require("@fortawesome/free-solid-svg-icons"),require("@fortawesome/vue-fontawesome"),require("vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","element-plus","@fortawesome/fontawesome-svg-core","@fortawesome/free-solid-svg-icons","@fortawesome/vue-fontawesome","vue","@vueuse/core"],Ae):(de=typeof globalThis<"u"?globalThis:de||self,Ae(de.morghulis={},de.ElementPlus,de.fontawesomeSvgCore,de.freeSolidSvgIcons,de.vueFontawesome,de.Vue,de.core))})(this,function(de,Ae,Bn,mf,_f,l,wa){"use strict";var Kb=Object.defineProperty;var Jb=(de,Ae,Bn)=>Ae in de?Kb(de,Ae,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):de[Ae]=Bn;var On=(de,Ae,Bn)=>Jb(de,typeof Ae!="symbol"?Ae+"":Ae,Bn);var yf={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}},Vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ba(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var nr={exports:{}};/**
1
+ (function(de,Ae){typeof exports=="object"&&typeof module<"u"?Ae(exports,require("element-plus"),require("@fortawesome/fontawesome-svg-core"),require("@fortawesome/free-solid-svg-icons"),require("@fortawesome/vue-fontawesome"),require("vue"),require("@vueuse/core")):typeof define=="function"&&define.amd?define(["exports","element-plus","@fortawesome/fontawesome-svg-core","@fortawesome/free-solid-svg-icons","@fortawesome/vue-fontawesome","vue","@vueuse/core"],Ae):(de=typeof globalThis<"u"?globalThis:de||self,Ae(de.morghulis={},de.ElementPlus,de.FontawesomeSvgCore,de.FreeSolidSvgIcons,de.VueFontawesome,de.Vue,de.VueUseCore))})(this,function(de,Ae,Bn,mf,_f,l,wa){"use strict";var Kb=Object.defineProperty;var Jb=(de,Ae,Bn)=>Ae in de?Kb(de,Ae,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):de[Ae]=Bn;var On=(de,Ae,Bn)=>Jb(de,typeof Ae!="symbol"?Ae+"":Ae,Bn);var yf={name:"zh-cn",el:{breadcrumb:{label:"面包屑"},colorpicker:{confirm:"确定",clear:"清空",defaultLabel:"颜色选择器",description:"当前颜色 {color},按 Enter 键选择新颜色",alphaLabel:"选择透明度的值"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",dateTablePrompt:"使用方向键与 Enter 键可选择日期",monthTablePrompt:"使用方向键与 Enter 键可选择月份",yearTablePrompt:"使用方向键与 Enter 键可选择年份",selectedDate:"已选日期",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},weeksFull:{sun:"星期日",mon:"星期一",tue:"星期二",wed:"星期三",thu:"星期四",fri:"星期五",sat:"星期六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},inputNumber:{decrease:"减少数值",increase:"增加数值"},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},dropdown:{toggleDropdown:"切换下拉选项"},mention:{loading:"加载中"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},dialog:{close:"关闭此对话框"},drawer:{close:"关闭此对话框"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!",close:"关闭此对话框"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},slider:{defaultLabel:"滑块介于 {min} 至 {max}",defaultRangeStartLabel:"选择起始值",defaultRangeEndLabel:"选择结束值"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tour:{next:"下一步",previous:"上一步",finish:"结束导览"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"},carousel:{leftArrow:"上一张幻灯片",rightArrow:"下一张幻灯片",indicator:"幻灯片切换至索引 {index}"}}},Vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ba(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var nr={exports:{}};/**
2
2
  * @license
3
3
  * Lodash <https://lodash.com/>
4
4
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "morghulis",
3
- "version": "1.0.27",
3
+ "version": "1.0.29",
4
4
  "private": false,
5
5
  "description": "Vue 3组件库",
6
6
  "type": "module",
@@ -12,11 +12,14 @@
12
12
  ],
13
13
  "exports": {
14
14
  ".": {
15
+ "types": "./dist/index.d.ts",
15
16
  "import": "./dist/index.js",
16
- "require": "./dist/index.umd.cjs",
17
- "types": "./dist/index.d.ts"
17
+ "require": "./dist/index.umd.cjs"
18
18
  },
19
- "./dist/style.css": "./dist/index.css"
19
+ "./dist/index.css": "./dist/index.css",
20
+ "./dist/style.css": "./dist/index.css",
21
+ "./style": "./dist/index.css",
22
+ "./dist/style": "./dist/index.css"
20
23
  },
21
24
  "typesVersions": {
22
25
  "*": {