@wyfex/ivue 0.18.0 → 0.19.1
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 +2 -2
- package/dist/index.es.js +14 -9
- package/dist/index.umd.cjs +14 -9
- package/dist/ivue.css +1 -1
- package/dist/types/UseElButton/types.d.ts +2 -2
- package/dist/types/UseElConfigProvider/defaultExtConfig.d.ts +2 -7
- package/dist/types/UseElConfigProvider/types.d.ts +4 -9
- package/dist/types/UseElSelect/index.vue.d.ts +2 -2
- package/dist/types/UseElSelect/props.d.ts +1 -1
- package/dist/types/UseElSwitch/index.vue.d.ts +4 -4
- package/dist/types/UseElSwitch/props.d.ts +2 -2
- package/dist/types/UseElTable/components/RecTableColumn.vue.d.ts +1 -1
- package/dist/types/UseElTable/defaultExtConfig.d.ts +2 -2
- package/dist/types/UseElTable/hooks/useElTable.d.ts +5 -2
- package/dist/types/UseElTable/hooks/useSelection.d.ts +1 -1
- package/dist/types/UseElTable/index.vue.d.ts +2 -11
- package/dist/types/UseElTable/props.d.ts +0 -4
- package/dist/types/UseElTable/types.d.ts +8 -7
- package/dist/types/UseElUpload/hook.d.ts +21 -0
- package/dist/types/UseElUpload/index.vue.d.ts +101 -0
- package/dist/types/UseElUpload/props.d.ts +42 -0
- package/dist/types/UseElUpload/types.d.ts +9 -0
- package/dist/types/UseElUpload/utils.d.ts +3 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +4 -4
- package/src/components/UseElButton/types.ts +3 -4
- package/src/components/UseElConfigProvider/defaultExtConfig.ts +1 -8
- package/src/components/UseElConfigProvider/types.ts +10 -24
- package/src/components/UseElTable/defaultExtConfig.ts +1 -46
- package/src/components/UseElTable/props.ts +0 -7
- package/src/components/UseElTable/types.ts +175 -31
- package/src/components/UseElUpload/props.ts +84 -0
- package/src/components/UseElUpload/types.ts +17 -0
- package/src/components/UseSvgIcon/props.ts +2 -2
- package/src/types/index.ts +119 -41
- package/dist/types/UseElTable/hooks/useTableHeightAdaptive.d.ts +0 -11
- package/dist/useLog-DrLGlf1g.js +0 -1
|
@@ -8,18 +8,28 @@ import componentProps from './props'
|
|
|
8
8
|
export type Props = ExtractPropTypes<typeof componentProps>
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* emits
|
|
11
|
+
* emits类型
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
14
|
-
|
|
13
|
+
export type Emits = {
|
|
14
|
+
/**
|
|
15
|
+
* dictKeys事件
|
|
16
|
+
*/
|
|
15
17
|
(e: 'onDictKeys', value?: string[]): void
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* 选中数据更新事件 v-model:selectionData
|
|
20
|
+
*/
|
|
21
|
+
(e: 'update:selectionData', selectionData: any[]): void
|
|
22
|
+
/**
|
|
23
|
+
* 当前行更新事件 v-model:currentRow
|
|
24
|
+
*/
|
|
19
25
|
(e: 'update:currentRow', currentRow: any): void
|
|
20
|
-
|
|
26
|
+
/**
|
|
27
|
+
* 当前页码更新事件 v-model:currentPage
|
|
28
|
+
*/
|
|
21
29
|
(e: 'update:currentPage', currentPage: number): void
|
|
22
|
-
|
|
30
|
+
/**
|
|
31
|
+
* 每页条数更新事件 v-model:pageSize
|
|
32
|
+
*/
|
|
23
33
|
(e: 'update:pageSize', pageSize: number): void
|
|
24
34
|
}
|
|
25
35
|
|
|
@@ -27,9 +37,21 @@ export interface Emits {
|
|
|
27
37
|
* EditableCell和SpanVue组件的props接口
|
|
28
38
|
*/
|
|
29
39
|
export interface EditableCellAndSpanVueProps {
|
|
40
|
+
/**
|
|
41
|
+
* 行数据
|
|
42
|
+
*/
|
|
30
43
|
row: Record<string, any>
|
|
44
|
+
/**
|
|
45
|
+
* 表格配置项
|
|
46
|
+
*/
|
|
31
47
|
item: TableColumn
|
|
48
|
+
/**
|
|
49
|
+
* 合并后的props
|
|
50
|
+
*/
|
|
32
51
|
mergedProps: Props
|
|
52
|
+
/**
|
|
53
|
+
* 全局配置
|
|
54
|
+
*/
|
|
33
55
|
globalConfig: GlobalConfig
|
|
34
56
|
}
|
|
35
57
|
|
|
@@ -37,11 +59,17 @@ export interface EditableCellAndSpanVueProps {
|
|
|
37
59
|
* 表头配置接口
|
|
38
60
|
*/
|
|
39
61
|
export interface Header {
|
|
40
|
-
|
|
62
|
+
/**
|
|
63
|
+
* 表头具名插槽 为true则在模板代码中添加`<template #prop-header="{ item }"></template>`即可,可传入string自定义具名插槽名称
|
|
64
|
+
*/
|
|
41
65
|
slot?: boolean | string
|
|
42
|
-
|
|
66
|
+
/**
|
|
67
|
+
* 表头是否必填 必填表头默认在表头名称前添加*号
|
|
68
|
+
*/
|
|
43
69
|
required?: boolean
|
|
44
|
-
|
|
70
|
+
/**
|
|
71
|
+
* 必填表头*号位置 默认为before
|
|
72
|
+
*/
|
|
45
73
|
asteriskPosition?: 'before' | 'after'
|
|
46
74
|
}
|
|
47
75
|
|
|
@@ -49,7 +77,13 @@ export interface Header {
|
|
|
49
77
|
* 编辑配置接口
|
|
50
78
|
*/
|
|
51
79
|
export interface Edit {
|
|
80
|
+
/**
|
|
81
|
+
* 组件
|
|
82
|
+
*/
|
|
52
83
|
component: Component
|
|
84
|
+
/**
|
|
85
|
+
* 属性
|
|
86
|
+
*/
|
|
53
87
|
attrs?: EditAttrs
|
|
54
88
|
}
|
|
55
89
|
|
|
@@ -57,17 +91,29 @@ export interface Edit {
|
|
|
57
91
|
* tableColumn的extConfig接口
|
|
58
92
|
*/
|
|
59
93
|
export interface TableColumnExtConfig {
|
|
60
|
-
|
|
94
|
+
/**
|
|
95
|
+
* 表头配置
|
|
96
|
+
*/
|
|
61
97
|
header?: Header
|
|
62
|
-
|
|
98
|
+
/**
|
|
99
|
+
* 编辑配置
|
|
100
|
+
*/
|
|
63
101
|
edit?: Edit
|
|
64
|
-
|
|
102
|
+
/**
|
|
103
|
+
* 过滤器
|
|
104
|
+
*/
|
|
65
105
|
formatter?: Function
|
|
66
|
-
|
|
106
|
+
/**
|
|
107
|
+
* 类名
|
|
108
|
+
*/
|
|
67
109
|
class?: string | string[]
|
|
68
|
-
|
|
110
|
+
/**
|
|
111
|
+
* 样式
|
|
112
|
+
*/
|
|
69
113
|
style?: string | Record<string, unknown>
|
|
70
|
-
|
|
114
|
+
/**
|
|
115
|
+
* 插槽 为true则在模板代码中添加`<template #prop="{ row }"></template>`即可,可传入string自定义具名插槽名称
|
|
116
|
+
*/
|
|
71
117
|
slot?: boolean | string
|
|
72
118
|
}
|
|
73
119
|
|
|
@@ -75,22 +121,55 @@ export interface TableColumnExtConfig {
|
|
|
75
121
|
* tableColumn接口
|
|
76
122
|
*/
|
|
77
123
|
export interface TableColumn {
|
|
124
|
+
/**
|
|
125
|
+
* 表格列的标签
|
|
126
|
+
*/
|
|
78
127
|
label?: string
|
|
79
|
-
|
|
128
|
+
/**
|
|
129
|
+
* 表格列的属性 多级表头的父级表头可不传
|
|
130
|
+
*/
|
|
131
|
+
prop?: string
|
|
80
132
|
/**
|
|
81
133
|
* 使用字典
|
|
82
134
|
* 如为boolean则将label作为dictMap的key
|
|
83
135
|
* 如为string或dict.data为string则将dict或dict.data作为dictMap的key
|
|
84
136
|
*/
|
|
85
137
|
useDict?: boolean | string | UseDict
|
|
138
|
+
/**
|
|
139
|
+
* 表格列的宽度
|
|
140
|
+
*/
|
|
86
141
|
width?: string | number
|
|
142
|
+
/**
|
|
143
|
+
* 表格列的最小宽度
|
|
144
|
+
*/
|
|
87
145
|
minWidth?: string | number
|
|
146
|
+
/**
|
|
147
|
+
* 是否显示表格列
|
|
148
|
+
*/
|
|
88
149
|
show?: boolean
|
|
150
|
+
/**
|
|
151
|
+
* 表格列的排列方式
|
|
152
|
+
*/
|
|
89
153
|
align?: string
|
|
154
|
+
/**
|
|
155
|
+
* 表格列是否固定
|
|
156
|
+
*/
|
|
90
157
|
fixed?: boolean | string
|
|
158
|
+
/**
|
|
159
|
+
* 表格列是否开启排序
|
|
160
|
+
*/
|
|
91
161
|
sortable?: boolean
|
|
162
|
+
/**
|
|
163
|
+
* 表格列溢出是否显示省略号
|
|
164
|
+
*/
|
|
92
165
|
showOverflowTooltip?: boolean
|
|
166
|
+
/**
|
|
167
|
+
* 表格列扩展配置
|
|
168
|
+
*/
|
|
93
169
|
extConfig?: TableColumnExtConfig
|
|
170
|
+
/**
|
|
171
|
+
* 表格列的子表格列
|
|
172
|
+
*/
|
|
94
173
|
children?: TableColumn[]
|
|
95
174
|
}
|
|
96
175
|
|
|
@@ -98,16 +177,43 @@ export interface TableColumn {
|
|
|
98
177
|
* 选择器配置项
|
|
99
178
|
*/
|
|
100
179
|
export interface Selection {
|
|
180
|
+
/**
|
|
181
|
+
* 选择器的标签
|
|
182
|
+
*/
|
|
101
183
|
label?: string
|
|
102
|
-
|
|
184
|
+
/**
|
|
185
|
+
* 选择器的类型
|
|
186
|
+
*/
|
|
187
|
+
type?: 'CHECKBOX' | 'CHECKBOXRADIO' | 'RADIO'
|
|
188
|
+
/**
|
|
189
|
+
* 选择器的宽度
|
|
190
|
+
*/
|
|
103
191
|
width?: number
|
|
192
|
+
/**
|
|
193
|
+
* 选择器的唯一键
|
|
194
|
+
*/
|
|
104
195
|
key?: string
|
|
196
|
+
/**
|
|
197
|
+
* 是否允许点击行触发选择器勾选
|
|
198
|
+
*/
|
|
105
199
|
enableRowClick?: boolean
|
|
200
|
+
/**
|
|
201
|
+
* 自定义选择器功能函数
|
|
202
|
+
*/
|
|
106
203
|
selectable?: Function
|
|
204
|
+
/**
|
|
205
|
+
* 选择器禁止勾选配置
|
|
206
|
+
*/
|
|
107
207
|
disabledConfig?:
|
|
108
208
|
| Record<string, string | number | string[] | number[]>
|
|
109
209
|
| Array<{ key: string; value: string | number | string[] | number[] }>
|
|
210
|
+
/**
|
|
211
|
+
* 选择器排列方式
|
|
212
|
+
*/
|
|
110
213
|
align?: string
|
|
214
|
+
/**
|
|
215
|
+
* 选择器是否固定
|
|
216
|
+
*/
|
|
111
217
|
fixed?: boolean
|
|
112
218
|
}
|
|
113
219
|
|
|
@@ -115,26 +221,64 @@ export interface Selection {
|
|
|
115
221
|
* UseElTable的extConfig接口
|
|
116
222
|
*/
|
|
117
223
|
export interface ExtConfig {
|
|
118
|
-
|
|
224
|
+
/**
|
|
225
|
+
* 额外表头配置项
|
|
226
|
+
* border:是否显示边框线 默认和el-table的border保持一致
|
|
227
|
+
* class:额外表头类名
|
|
228
|
+
* style:额外表头样式对象
|
|
229
|
+
*/
|
|
119
230
|
extraHeader?: {
|
|
231
|
+
border?: boolean
|
|
120
232
|
class?: string
|
|
121
233
|
style?: { padding?: string; borderBottom?: string }
|
|
122
234
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
235
|
+
/**
|
|
236
|
+
* 模式配置项
|
|
237
|
+
* type:模式类型 可选值:PAGE(页面) | MODAL(弹窗)
|
|
238
|
+
* height:表格高度 不设置则默认高度自适应,该配置项设置的是UseELTable组件整体高度,非ElTable组件的高度
|
|
239
|
+
* bottomOffset:表格高度自适应表格底部预留偏移 该配置项由UseElConfigProvider组件统一提供默认值
|
|
240
|
+
*/
|
|
241
|
+
mode?: { type?: 'PAGE' | 'MODAL'; height?: string; bottomOffset?: number }
|
|
242
|
+
/**
|
|
243
|
+
* 选择器配置项
|
|
244
|
+
* 绑定v-model:selectionData="selectionData"则开启选择器 不显式设置type则默认为CHECKBOX复选
|
|
245
|
+
* type:选择类型 可选值:CHECKBOX(复选) | CHECKBOXRADIO(复选框单选) | RADIO(单选)
|
|
246
|
+
* label:type为CHECKBOXRADIO、RADIO时表头全选复选框的文本 不设置则为空显示
|
|
247
|
+
* key:选中数据的唯一键 对应tableData中的唯一键 如id
|
|
248
|
+
* selectable:决定当前行复选框是否可以勾选 传入function,如果是简单禁用逻辑推荐优先使用disabledConfig配置项,复杂逻辑才建议使用本配置项
|
|
249
|
+
* disabledConfig:禁用配置 可传对象或对象数组
|
|
250
|
+
* enableRowClick:允许通过点击行触发单选/复选 默认否 PS:默认不高亮当前行,若需高亮当前行,只需给UseElTable组件设置highlightCurrentRow属性即可
|
|
251
|
+
* width:选择器的列宽 默认为40px
|
|
252
|
+
* align:选择器的排列方式 默认为center居中
|
|
253
|
+
* fixed:是否固定 默认为true
|
|
254
|
+
*/
|
|
130
255
|
selection?: Selection
|
|
131
|
-
|
|
256
|
+
/**
|
|
257
|
+
* 序号列配置项
|
|
258
|
+
* label:序号列表头文本 不显式设置则不显示序号列
|
|
259
|
+
* width、align、fixed同选择器配置项
|
|
260
|
+
*/
|
|
132
261
|
index?: { label?: string; width?: number; align?: string; fixed?: boolean }
|
|
133
|
-
|
|
262
|
+
/**
|
|
263
|
+
* 展开列配置项
|
|
264
|
+
* show:是否显示展开列
|
|
265
|
+
* width:展开列宽度
|
|
266
|
+
*/
|
|
134
267
|
expand?: { show?: boolean; width?: number }
|
|
135
|
-
|
|
268
|
+
/**
|
|
269
|
+
* 操作列配置项
|
|
270
|
+
* label:操作列文案 显式设置则开启操作列
|
|
271
|
+
* width:操作列宽度 默认为128px
|
|
272
|
+
* fixed:固定方向 默认固定在右侧
|
|
273
|
+
*/
|
|
136
274
|
operation?: { label?: string; width?: number; fixed?: string }
|
|
137
|
-
|
|
275
|
+
/**
|
|
276
|
+
* 分页器配置项
|
|
277
|
+
* total:分页总数 为-1时不显示分页器
|
|
278
|
+
* marginTop:分页器与表格的间距 默认20px
|
|
279
|
+
* func:分页方法 显式设置则在组件内部自动处理分页逻辑
|
|
280
|
+
* position:分页器位置 默认为right 可选值:left | center | right
|
|
281
|
+
*/
|
|
138
282
|
pagination?: {
|
|
139
283
|
total?: number
|
|
140
284
|
marginTop?: number
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { PropType } from 'vue'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 组件props
|
|
5
|
+
*/
|
|
6
|
+
export default {
|
|
7
|
+
/**
|
|
8
|
+
* 文件id
|
|
9
|
+
*/
|
|
10
|
+
fileId: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: ''
|
|
13
|
+
},
|
|
14
|
+
/**
|
|
15
|
+
* 链接地址
|
|
16
|
+
*/
|
|
17
|
+
linkUrl: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ''
|
|
20
|
+
},
|
|
21
|
+
/**
|
|
22
|
+
* 上传配置
|
|
23
|
+
* action:请求URL,eg:'/api/file/upload'
|
|
24
|
+
* headers:设置上传的请求头部,eg:{ Authorization: `Bearer ${token}` }
|
|
25
|
+
* data:上传时附带的额外参数,eg:{ referer: window.location.href }
|
|
26
|
+
*/
|
|
27
|
+
uploadConfig: {
|
|
28
|
+
type: Object as PropType<Record<string, unknown>>,
|
|
29
|
+
default: () => ({
|
|
30
|
+
// action: '/api/file/upload',
|
|
31
|
+
// headers: { Authorization: `Bearer ${token}` },
|
|
32
|
+
// data: { referer: window.location.href }
|
|
33
|
+
})
|
|
34
|
+
},
|
|
35
|
+
/**
|
|
36
|
+
* 上传类型
|
|
37
|
+
* 为ALL支持所有文件格式
|
|
38
|
+
* 为IMG仅可上传支持的图片格式且按照片墙形式展示
|
|
39
|
+
* 为VIDEO仅可上传支持的视频格式
|
|
40
|
+
* 为EXCLUDE_VIDEO可上传除视频格式外的所有支持的文件格式
|
|
41
|
+
*/
|
|
42
|
+
uploadType: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: 'ALL',
|
|
45
|
+
validator: (value: string) =>
|
|
46
|
+
['ALL', 'IMG', 'VIDEO', 'EXCLUDE_VIDEO'].includes(value)
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* 上传提示
|
|
50
|
+
*/
|
|
51
|
+
uploadTip: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: ''
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* 上传列表 用于数据回显
|
|
57
|
+
*/
|
|
58
|
+
uploadList: {
|
|
59
|
+
type: Array as PropType<Record<string, unknown>[]>,
|
|
60
|
+
default: () => []
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* 上传数量限制 默认1
|
|
64
|
+
*/
|
|
65
|
+
limit: {
|
|
66
|
+
type: Number,
|
|
67
|
+
default: 1,
|
|
68
|
+
validator: (value: number) => value >= 1
|
|
69
|
+
},
|
|
70
|
+
/**
|
|
71
|
+
* 是否禁用上传 默认否
|
|
72
|
+
*/
|
|
73
|
+
disabled: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false
|
|
76
|
+
},
|
|
77
|
+
/**
|
|
78
|
+
* 最大文件大小 默认2GB
|
|
79
|
+
*/
|
|
80
|
+
maxSize: {
|
|
81
|
+
type: Number,
|
|
82
|
+
default: 2
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ExtractPropTypes } from 'vue'
|
|
2
|
+
import componentProps from './props'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* props类型
|
|
6
|
+
*/
|
|
7
|
+
export type Props = ExtractPropTypes<typeof componentProps>
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* emits接口
|
|
11
|
+
*/
|
|
12
|
+
export interface Emits {
|
|
13
|
+
'update:fileId': [value: string | number]
|
|
14
|
+
'update:linkUrl': [url: string]
|
|
15
|
+
onFileObj: [file: Record<string, any>]
|
|
16
|
+
onError: [error: Error | string]
|
|
17
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PropType } from 'vue'
|
|
2
|
-
import { isArray } from '@wyfex/iutils'
|
|
2
|
+
import { isArray, isNumber } from '@wyfex/iutils'
|
|
3
3
|
import { parseUnit, isValidUnit } from '@/utils'
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -20,7 +20,7 @@ export default {
|
|
|
20
20
|
type: [Number, String],
|
|
21
21
|
default: 28,
|
|
22
22
|
validator(val: any) {
|
|
23
|
-
if (
|
|
23
|
+
if (isNumber(val)) return val
|
|
24
24
|
return isValidUnit(parseUnit(val)) && val
|
|
25
25
|
}
|
|
26
26
|
},
|
package/src/types/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Component, VNode } from 'vue'
|
|
2
2
|
|
|
3
|
-
//
|
|
3
|
+
// =========================== 渲染器相关接口 start ===========================
|
|
4
4
|
/**
|
|
5
5
|
* 渲染器内容类型
|
|
6
6
|
*/
|
|
@@ -17,29 +17,45 @@ export type RenderContent =
|
|
|
17
17
|
* 渲染器配置接口
|
|
18
18
|
*/
|
|
19
19
|
export interface RenderConfig {
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* 内容
|
|
22
|
+
*/
|
|
21
23
|
content?: RenderContent
|
|
22
|
-
|
|
24
|
+
/**
|
|
25
|
+
* 样式类名
|
|
26
|
+
*/
|
|
23
27
|
class?: string
|
|
24
|
-
|
|
28
|
+
/**
|
|
29
|
+
* 内联样式
|
|
30
|
+
*/
|
|
25
31
|
style?: string
|
|
26
|
-
|
|
32
|
+
/**
|
|
33
|
+
* 内联样式字段
|
|
34
|
+
*/
|
|
27
35
|
styleField?: string
|
|
28
|
-
|
|
36
|
+
/**
|
|
37
|
+
* 单位
|
|
38
|
+
*/
|
|
29
39
|
unit?: string
|
|
30
40
|
}
|
|
31
|
-
//
|
|
41
|
+
// =========================== 渲染器相关接口 end ===========================
|
|
32
42
|
|
|
33
|
-
//
|
|
43
|
+
// =========================== 字典相关接口 start ===========================
|
|
34
44
|
/**
|
|
35
45
|
* 字典属性接口 共用于其它props配置属性
|
|
36
46
|
*/
|
|
37
47
|
export interface DictProps {
|
|
38
|
-
|
|
48
|
+
/**
|
|
49
|
+
* 指定选项label为选项对象的某个属性值
|
|
50
|
+
*/
|
|
39
51
|
label: string
|
|
40
|
-
|
|
52
|
+
/**
|
|
53
|
+
* 指定选项value为选项对象的某个属性值
|
|
54
|
+
*/
|
|
41
55
|
value: string
|
|
42
|
-
|
|
56
|
+
/**
|
|
57
|
+
* 指定选项children为选项对象的某个属性值
|
|
58
|
+
*/
|
|
43
59
|
children: string
|
|
44
60
|
}
|
|
45
61
|
|
|
@@ -47,44 +63,63 @@ export interface DictProps {
|
|
|
47
63
|
* 字典映射接口
|
|
48
64
|
*/
|
|
49
65
|
export interface DictMap {
|
|
50
|
-
|
|
66
|
+
/**
|
|
67
|
+
* 形如:{ 性别: [{ label: '男', value: 1 },{ label: '女', value: 2 }] }
|
|
68
|
+
*/
|
|
51
69
|
[key: string]: Record<DictProps['label'] | DictProps['value'], any>[]
|
|
52
70
|
}
|
|
53
|
-
// export interface DictMap {
|
|
54
|
-
// // 形如:{ 性别: [{ label: '男', value: 1 },{ label: '女', value: 2 }] }
|
|
55
|
-
// [key: string]: Array<{ label: string; value: string | number | boolean }>
|
|
56
|
-
// }
|
|
57
71
|
|
|
58
72
|
/**
|
|
59
73
|
* 使用字典接口
|
|
60
74
|
*/
|
|
61
75
|
export interface UseDict {
|
|
62
|
-
|
|
76
|
+
/**
|
|
77
|
+
* 字典key 即dictMap的key,为boolean则以label作为dictMap的key
|
|
78
|
+
*/
|
|
63
79
|
key?: string | boolean
|
|
64
|
-
|
|
80
|
+
/**
|
|
81
|
+
* 字典属性
|
|
82
|
+
*/
|
|
65
83
|
props?: DictProps
|
|
66
|
-
|
|
84
|
+
/**
|
|
85
|
+
* 字典类名
|
|
86
|
+
*/
|
|
67
87
|
class?: string
|
|
68
|
-
|
|
88
|
+
/**
|
|
89
|
+
* 内联样式
|
|
90
|
+
*/
|
|
69
91
|
inlineStyle?: string
|
|
70
|
-
|
|
92
|
+
/**
|
|
93
|
+
* 字典样式字段
|
|
94
|
+
*/
|
|
71
95
|
styleField?: string
|
|
72
|
-
|
|
96
|
+
/**
|
|
97
|
+
* 字典分割符 默认为逗号(,)
|
|
98
|
+
*/
|
|
73
99
|
separator?: string
|
|
74
100
|
}
|
|
75
|
-
//
|
|
101
|
+
// =========================== 字典相关接口 end ===========================
|
|
76
102
|
|
|
103
|
+
// =========================== 其他接口 start ===========================
|
|
77
104
|
/**
|
|
78
105
|
* 上传配置接口
|
|
79
106
|
*/
|
|
80
107
|
export interface UploadConfig {
|
|
81
|
-
|
|
108
|
+
/**
|
|
109
|
+
* 上传地址
|
|
110
|
+
*/
|
|
82
111
|
action?: string
|
|
83
|
-
|
|
112
|
+
/**
|
|
113
|
+
* 请求头
|
|
114
|
+
*/
|
|
84
115
|
headers?: Record<string, unknown>
|
|
85
|
-
|
|
116
|
+
/**
|
|
117
|
+
* 上传数据
|
|
118
|
+
*/
|
|
86
119
|
data?: Record<string, unknown>
|
|
87
|
-
|
|
120
|
+
/**
|
|
121
|
+
* 其他配置项
|
|
122
|
+
*/
|
|
88
123
|
[key: string]: any
|
|
89
124
|
}
|
|
90
125
|
|
|
@@ -92,17 +127,37 @@ export interface UploadConfig {
|
|
|
92
127
|
* 全局配置接口 其他组件声明globalConfig类型时需要
|
|
93
128
|
*/
|
|
94
129
|
export interface GlobalConfig {
|
|
95
|
-
|
|
130
|
+
/**
|
|
131
|
+
* 最终语言
|
|
132
|
+
*/
|
|
96
133
|
finalLanguage: string
|
|
97
|
-
|
|
134
|
+
/**
|
|
135
|
+
* 最终字典属性
|
|
136
|
+
*/
|
|
98
137
|
finalDictProps: DictProps
|
|
99
|
-
|
|
138
|
+
/**
|
|
139
|
+
* 最终字典映射
|
|
140
|
+
*/
|
|
100
141
|
finalDictMap: DictMap
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
142
|
+
/**
|
|
143
|
+
* 最终表格页面高度
|
|
144
|
+
*/
|
|
145
|
+
finalTablePageHeight: string
|
|
146
|
+
/**
|
|
147
|
+
* 最终表格弹窗高度
|
|
148
|
+
*/
|
|
149
|
+
finalTableModalHeight: string
|
|
150
|
+
/**
|
|
151
|
+
* 最终表格页面底部预留偏移
|
|
152
|
+
*/
|
|
153
|
+
finalTablePageBottomOffset: number
|
|
154
|
+
/**
|
|
155
|
+
* 最终表格弹窗底部预留偏移 tableMode=modal生效
|
|
156
|
+
*/
|
|
157
|
+
finalTableModalBottomOffset: number
|
|
158
|
+
/**
|
|
159
|
+
* 最终上传配置
|
|
160
|
+
*/
|
|
106
161
|
finalUploadConfig: UploadConfig
|
|
107
162
|
}
|
|
108
163
|
|
|
@@ -115,8 +170,17 @@ export type InputEventName = 'nonNegativeDecimal'
|
|
|
115
170
|
* input事件接口
|
|
116
171
|
*/
|
|
117
172
|
export interface InputEvent {
|
|
173
|
+
/**
|
|
174
|
+
* input事件名称
|
|
175
|
+
*/
|
|
118
176
|
name: InputEventName
|
|
177
|
+
/**
|
|
178
|
+
* 保留的小数位数
|
|
179
|
+
*/
|
|
119
180
|
digits?: number
|
|
181
|
+
/**
|
|
182
|
+
* 回调函数
|
|
183
|
+
*/
|
|
120
184
|
cb?: Function
|
|
121
185
|
}
|
|
122
186
|
|
|
@@ -124,16 +188,30 @@ export interface InputEvent {
|
|
|
124
188
|
* 编辑配置属性接口
|
|
125
189
|
*/
|
|
126
190
|
export interface EditAttrs {
|
|
127
|
-
|
|
191
|
+
/**
|
|
192
|
+
* 是否追加label到placeholder后面 默认是
|
|
193
|
+
* 不需要可显式设置appendLabelToPlaceholder为false
|
|
194
|
+
*/
|
|
128
195
|
appendLabelToPlaceholder?: boolean
|
|
129
|
-
|
|
196
|
+
/**
|
|
197
|
+
* UseElSelect等组件的options
|
|
198
|
+
*/
|
|
130
199
|
options?: Record<string, any>[]
|
|
131
|
-
|
|
200
|
+
/**
|
|
201
|
+
* UseElSelect等组件的props
|
|
202
|
+
*/
|
|
132
203
|
props?: DictProps
|
|
133
|
-
|
|
204
|
+
/**
|
|
205
|
+
* change事件
|
|
206
|
+
*/
|
|
134
207
|
changeEvent?: Function
|
|
135
|
-
|
|
208
|
+
/**
|
|
209
|
+
* focus事件
|
|
210
|
+
*/
|
|
136
211
|
focusEvent?: Function
|
|
137
|
-
|
|
212
|
+
/**
|
|
213
|
+
* input事件
|
|
214
|
+
*/
|
|
138
215
|
inputEvent?: Function | InputEventName | InputEvent
|
|
139
216
|
}
|
|
217
|
+
// =========================== 其他接口 end ===========================
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ComputedRef, Ref } from 'vue';
|
|
2
|
-
import { Props } from '../types';
|
|
3
|
-
import { GlobalConfig } from '../../../types';
|
|
4
|
-
export declare const useTableHeightAdaptive: ({ rootRef, tableWrapperRef, mergedProps, globalConfig }: {
|
|
5
|
-
rootRef: Ref<HTMLDivElement | null>;
|
|
6
|
-
tableWrapperRef: Ref<HTMLDivElement | null>;
|
|
7
|
-
mergedProps: ComputedRef<Props>;
|
|
8
|
-
globalConfig: ComputedRef<GlobalConfig>;
|
|
9
|
-
}) => {
|
|
10
|
-
tableRealHeight: Ref<string, string>;
|
|
11
|
-
};
|
package/dist/useLog-DrLGlf1g.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={primary:`color:#1677ff;font-weight:bold;`,success:`color:#52c41a;font-weight:bold;`,warn:`color:#fa8c14;font-weight:bold;`,error:`color:#f5222d;font-weight:bold;`,block:`color:#4e5969;font-weight:bold;`,json:`color:#20b2aa;font-weight:bold;`},t={primary:`🔧`,success:`✅`,warn:`⚠️`,error:`❌`,block:`📦`,json:`📄`},n=`background:#000; padding:10px 8px;`,r=r=>{let i=(i,a,o,s)=>{let c=`${t[i]} [${r}]`;if(!s||o===void 0){console.log(`%c${c}%c ${a}`,e[i],``,o);return}let l=JSON.stringify(o,null,2);console.log(`%c${c}%c ${a}\n%c${l}`,e[i],``,n)};return{primary:(e,t,n)=>i(`primary`,e,t,n),success:(e,t,n)=>i(`success`,e,t,n),warn:(e,t,n)=>i(`warn`,e,t,n),error:(e,t,n)=>i(`error`,e,t,n),block:(i,a,o)=>{console.log(`%c- - - - - - - - - - - - - - - - - - - - - - -`,`color:#888`);let s=`${t.block} [${r}]`;if(!o||a===void 0)console.log(`%c${s}%c ${i}`,e.block,``,a);else{let t=JSON.stringify(a,null,2);console.log(`%c${s}%c ${i}\n%c${t}`,e.block,``,n)}console.log(`%c- - - - - - - - - - - - - - - - - - - - - - -`,`color:#888`)},json:(i,a)=>{let o=`${t.json} [${r}]`,s=JSON.stringify(a,null,2);console.log(`%c${o}%c ${i}\n%c${s}`,e.json,``,n)}}};export{r as useLog};
|