@wyfex/ivue 0.21.0 → 0.22.0

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.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/dist/index.es.js +1 -1
  3. package/dist/index.umd.cjs +10 -10
  4. package/dist/ivue.css +1 -1
  5. package/dist/types/UseCrud/hook.d.ts +2 -3
  6. package/dist/types/UseElDescriptions/hook.d.ts +2 -6
  7. package/dist/types/UseElDescriptions/types.d.ts +2 -2
  8. package/dist/types/UseElForm/components/QueryForm.vue.d.ts +2 -6
  9. package/dist/types/UseElForm/components/RowForm.vue.d.ts +2 -6
  10. package/dist/types/UseElForm/hooks/useElForm.d.ts +2 -6
  11. package/dist/types/UseElForm/index.vue.d.ts +20 -16
  12. package/dist/types/UseElForm/types.d.ts +6 -0
  13. package/dist/types/UseElInput/types.d.ts +2 -2
  14. package/dist/types/UseElSelect/types.d.ts +2 -2
  15. package/dist/types/UseElTable/hooks/useElTable.d.ts +2 -3
  16. package/dist/types/UseElTable/hooks/useSelection.d.ts +1 -0
  17. package/dist/types/UseElTable/index.vue.d.ts +1 -0
  18. package/dist/types/UseElUpload/types.d.ts +2 -2
  19. package/dist/types/UseProtocolInput/index.vue.d.ts +19 -0
  20. package/dist/types/index.d.ts +1 -0
  21. package/package.json +5 -5
  22. package/src/components/UseElDescriptions/props.ts +1 -1
  23. package/src/components/UseElDescriptions/types.ts +2 -2
  24. package/src/components/UseElDialog/props.ts +1 -1
  25. package/src/components/UseElDrawer/props.ts +1 -1
  26. package/src/components/UseElForm/props.ts +1 -1
  27. package/src/components/UseElForm/types.ts +48 -114
  28. package/src/components/UseElInput/types.ts +3 -5
  29. package/src/components/UseElSelect/types.ts +4 -8
  30. package/src/components/UseElTable/props.ts +1 -1
  31. package/src/components/UseElUpload/types.ts +2 -2
  32. package/src/components/UseLineTitle/defaultExtConfig.ts +3 -15
  33. package/src/components/UseLineTitle/types.ts +2 -0
  34. package/src/types/index.ts +38 -115
@@ -1,4 +1,5 @@
1
1
  import type { ExtractPropTypes } from 'vue'
2
+ import type { FormInstance } from 'element-plus'
2
3
  import componentProps from './props'
3
4
  import type { RenderConfig, UseDict } from '@/types'
4
5
 
@@ -74,45 +75,25 @@ export interface InputConfig {
74
75
  resize?: string
75
76
  showPassword?: boolean
76
77
  placeholder?: string
77
- /**
78
- * 默认el-input的width为100% 可设置width为''或具体宽度值,为''则使用默认的el-input宽度
79
- */
78
+ /** 默认el-input的width为100% 可设置width为''或具体宽度值,为''则使用默认的el-input宽度 */
80
79
  width?: string
81
- /**
82
- * 为true则对el-input使用v-focus聚焦指令
83
- */
80
+ /** 为true则对el-input使用v-focus聚焦指令 */
84
81
  autoFocus?: boolean
85
- /**
86
- * el-input头部插槽内容
87
- */
82
+ /** el-input头部插槽内容 */
88
83
  prefixContent?: string | object
89
- /**
90
- * el-input尾部插槽内容
91
- */
84
+ /** el-input尾部插槽内容 */
92
85
  suffixContent?: string | object
93
- /**
94
- * el-input前置插槽内容
95
- */
86
+ /** el-input前置插槽内容 */
96
87
  prependContent?: string | object
97
- /**
98
- * el-input后置插槽内容
99
- */
88
+ /** el-input后置插槽内容 */
100
89
  appendContent?: string | object
101
- /**
102
- * 在el-input右外部显示单位
103
- */
90
+ /** 在el-input右外部显示单位 */
104
91
  unit?: string | object
105
- /**
106
- * el-input的clear事件
107
- */
92
+ /** el-input的clear事件 */
108
93
  onClear?: Function
109
- /**
110
- * el-input的input事件
111
- */
94
+ /** el-input的input事件 */
112
95
  inputEvent?: Function
113
- /**
114
- * el-input的keyup.enter事件
115
- */
96
+ /** el-input的keyup.enter事件 */
116
97
  onKeyupEnter?: Function
117
98
  }
118
99
 
@@ -127,9 +108,7 @@ export interface InputNumberConfig {
127
108
  precision?: number
128
109
  placeholder?: string
129
110
  disabledScientific?: boolean
130
- /**
131
- * 在el-input-number右外部显示单位
132
- */
111
+ /** 在el-input-number右外部显示单位 */
133
112
  unit?: string | object
134
113
  }
135
114
 
@@ -138,21 +117,13 @@ export interface InputNumberConfig {
138
117
  */
139
118
  export interface RadioConfig {
140
119
  useRender?: boolean | RenderConfig
141
- /**
142
- * el-radio的选项集
143
- */
120
+ /** el-radio的选项集 */
144
121
  options?: Array<{ label: string; value: string | number }>
145
- /**
146
- * el-radio的props配置项
147
- */
122
+ /** el-radio的props配置项 */
148
123
  props?: { value: string; label?: string }
149
- /**
150
- * 是否反转单选框和标签的位置
151
- */
124
+ /** 是否反转单选框和标签的位置 */
152
125
  reverse?: boolean
153
- /**
154
- * el-radio的change事件
155
- */
126
+ /** el-radio的change事件 */
156
127
  onChange?: Function
157
128
  }
158
129
 
@@ -167,25 +138,15 @@ export interface SelectConfig {
167
138
  placeholder?: string
168
139
  options?: Array<{ label: string; value: string | number }>
169
140
  props?: { value: string; label?: string }
170
- /**
171
- * 是否使用v2版本
172
- */
141
+ /** 是否使用v2版本 */
173
142
  useV2: boolean
174
- /**
175
- * 是否反转
176
- */
143
+ /** 是否反转 */
177
144
  reverse?: boolean
178
- /**
179
- * 是否将值为数组转为以逗号分隔的字符串
180
- */
145
+ /** 是否将值为数组转为以逗号分隔的字符串 */
181
146
  toJoin?: boolean
182
- /**
183
- * 默认el-select的width为100% 可设置width为''或具体宽度值,为''则使用默认的el-select宽度
184
- */
147
+ /** 默认el-select的width为100% 可设置width为''或具体宽度值,为''则使用默认的el-select宽度 */
185
148
  width?: string
186
- /**
187
- * el-select的change事件
188
- */
149
+ /** el-select的change事件 */
189
150
  onChange?: Function
190
151
  }
191
152
 
@@ -195,21 +156,13 @@ export interface SelectConfig {
195
156
  export interface CascaderConfig {
196
157
  useRender?: boolean | RenderConfig
197
158
  clearable?: boolean
198
- /**
199
- * el-cascader的选项集
200
- */
159
+ /** el-cascader的选项集 */
201
160
  options?: Array<{ label: string; value: string | number }>
202
- /**
203
- * el-cascader的props配置项
204
- */
161
+ /** el-cascader的props配置项 */
205
162
  props?: { value: string; label?: string }
206
- /**
207
- * 默认el-cascader的width为100% 可设置width为''或具体宽度值,为''则使用默认的el-cascader宽度
208
- */
163
+ /** 默认el-cascader的width为100% 可设置width为''或具体宽度值,为''则使用默认的el-cascader宽度 */
209
164
  width?: string
210
- /**
211
- * el-select的change事件
212
- */
165
+ /** el-select的change事件 */
213
166
  onChange?: Function
214
167
  }
215
168
 
@@ -239,21 +192,13 @@ export interface DatePickerConfig {
239
192
  startPlaceholder?: string
240
193
  endPlaceholder?: string
241
194
  rangeSeparator?: string
242
- /**
243
- * 默认el-date-picker的width为100% 可设置width为''或具体宽度值,为''则使用默认的el-date-picker宽度
244
- */
195
+ /** 默认el-date-picker的width为100% 可设置width为''或具体宽度值,为''则使用默认的el-date-picker宽度 */
245
196
  width?: string
246
- /**
247
- * el-date-picker的calendar-change事件
248
- */
197
+ /** el-date-picker的calendar-change事件 */
249
198
  onCalendarChange?: Function
250
- /**
251
- * el-date-picker的clear事件
252
- */
199
+ /** el-date-picker的clear事件 */
253
200
  onClear?: Function
254
- /**
255
- * el-date-picker的change事件
256
- */
201
+ /** el-date-picker的change事件 */
257
202
  onChange?: Function
258
203
  }
259
204
 
@@ -269,9 +214,7 @@ export interface TimePickerConfig {
269
214
  editable?: boolean
270
215
  format?: string
271
216
  valueFormat?: string
272
- /**
273
- * el-date-picker的change事件
274
- */
217
+ /** el-date-picker的change事件 */
275
218
  onChange?: Function
276
219
  }
277
220
 
@@ -280,13 +223,9 @@ export interface TimePickerConfig {
280
223
  */
281
224
  export interface TimeSelectConfig {
282
225
  useRender?: boolean | RenderConfig
283
- /**
284
- * 时间选择范围开始时间在formModel中的属性名
285
- */
226
+ /** 时间选择范围开始时间在formModel中的属性名 */
286
227
  startProp: string
287
- /**
288
- * 时间选择范围结束时间在formModel中的属性名
289
- */
228
+ /** 时间选择范围结束时间在formModel中的属性名 */
290
229
  endProp: string
291
230
  }
292
231
 
@@ -297,9 +236,7 @@ export interface SwitchConfig {
297
236
  useRender?: boolean | RenderConfig
298
237
  activeValue?: string | number | boolean
299
238
  inactiveValue?: string | number | boolean
300
- /**
301
- * el-switch的change事件
302
- */
239
+ /** el-switch的change事件 */
303
240
  onChange?: Function
304
241
  }
305
242
 
@@ -307,13 +244,9 @@ export interface SwitchConfig {
307
244
  * inputRangeConfig接口
308
245
  */
309
246
  export interface InputRangeConfig {
310
- /**
311
- * 输入范围开始值在formModel中的属性名
312
- */
247
+ /** 输入范围开始值在formModel中的属性名 */
313
248
  startProp: string
314
- /**
315
- * 输入范围结束值在formModel中的属性名
316
- */
249
+ /** 输入范围结束值在formModel中的属性名 */
317
250
  endProp: string
318
251
  startPlaceholder?: string
319
252
  endPlaceholder?: string
@@ -327,9 +260,7 @@ export interface InputRangeConfig {
327
260
  export interface TreeSelectConfig {
328
261
  useRender?: boolean | RenderConfig
329
262
  data: Record<string, unknown>[]
330
- /**
331
- * 是否反转
332
- */
263
+ /** 是否反转 */
333
264
  reverse?: boolean
334
265
  width?: string
335
266
  placeholder?: string
@@ -340,18 +271,15 @@ export interface TreeSelectConfig {
340
271
  defaultExpandedKeys?: Array<string | number>
341
272
  }
342
273
 
274
+ /**
275
+ * 必填配置项
276
+ */
343
277
  export interface IRequired {
344
- /**
345
- * 是否必填
346
- */
278
+ /** 是否必填 */
347
279
  isRequired?: boolean
348
- /**
349
- * 内置校验器
350
- */
280
+ /** 内置校验器 */
351
281
  validator: 'mobile' | 'nonNegativeDecimal'
352
- /**
353
- * 参数
354
- */
282
+ /** 参数 */
355
283
  parmas?: any
356
284
  }
357
285
 
@@ -474,3 +402,9 @@ export interface FormColumn {
474
402
  */
475
403
  inputRangeConfig?: InputRangeConfig
476
404
  }
405
+
406
+ export interface FormComponentInstance {
407
+ efRef: FormInstance
408
+ showQueryForm: boolean
409
+ handleDisplayQueryForm: Function
410
+ }
@@ -7,11 +7,9 @@ import componentProps from './props'
7
7
  export type Props = ExtractPropTypes<typeof componentProps>
8
8
 
9
9
  /**
10
- * emits接口
10
+ * emits类型
11
11
  */
12
- export interface Emits {
13
- /**
14
- * 更新value值
15
- */
12
+ export type Emits = {
13
+ /** 更新value值 */
16
14
  (e: 'update:modelValue', value: string): void
17
15
  }
@@ -7,15 +7,11 @@ import componentProps from './props'
7
7
  export type Props = ExtractPropTypes<typeof componentProps>
8
8
 
9
9
  /**
10
- * emits接口
10
+ * emits类型
11
11
  */
12
- export interface Emits {
13
- /**
14
- * 更新value值
15
- */
12
+ export type Emits = {
13
+ /** 更新value值 */
16
14
  (e: 'update:modelValue', value: string | number | (string | number)[]): void
17
- /**
18
- * 更新label值
19
- */
15
+ /** 更新label值 */
20
16
  (e: 'update:label', label: string | string[]): void
21
17
  }
@@ -38,7 +38,7 @@ export default {
38
38
  validator: (val: string) => ['left', 'center', 'right'].includes(val)
39
39
  },
40
40
  /**
41
- * 字典映射 数据结构为{ tableColumns[][label | useDict | useDict.data]: Array<{ label: string, value: any }> }
41
+ * 字典映射 数据结构为{ tableColumns[][label | useDict | useDict.key]: Array<{ label: string, value: any }> }
42
42
  */
43
43
  dictMap: {
44
44
  type: Object as PropType<DictMap>,
@@ -7,9 +7,9 @@ import componentProps from './props'
7
7
  export type Props = ExtractPropTypes<typeof componentProps>
8
8
 
9
9
  /**
10
- * emits接口
10
+ * emits类型
11
11
  */
12
- export interface Emits {
12
+ export type Emits = {
13
13
  'update:fileId': [value: string | number]
14
14
  'update:linkUrl': [url: string]
15
15
  onFileObj: [file: Record<string, any>]
@@ -4,26 +4,14 @@ import type { ExtConfig } from './types'
4
4
  * 默认扩展配置
5
5
  */
6
6
  export default {
7
- /**
8
- * 外边距配置项
9
- */
10
- margin: {
11
- top: '0px',
12
- bottom: '20px'
13
- },
14
- /**
15
- * 线条配置项
16
- */
7
+ margin: { top: '0px', bottom: '20px' },
17
8
  line: {
18
- width: '4px', //作用于position为left和bottom
19
- height: '2px', //作用于position为between
9
+ width: '4px',
10
+ height: '2px',
20
11
  color: 'var(--theme-color,var(--el-color-primary))',
21
12
  position: 'left',
22
13
  verticalPadding: '0px'
23
14
  },
24
- /**
25
- * 底部border配置项
26
- */
27
15
  borderBottom: {
28
16
  show: false,
29
17
  color: 'var(--el-border-color-light)',
@@ -10,7 +10,9 @@ export type Props = ExtractPropTypes<typeof componentProps>
10
10
  * 线条接口
11
11
  */
12
12
  export interface Line {
13
+ /** 作用于position为left和bottom */
13
14
  width: string
15
+ /** 作用于position为between */
14
16
  height: string
15
17
  color: string
16
18
  position: 'left' | 'bottom' | 'between'
@@ -17,25 +17,15 @@ export type RenderContent =
17
17
  * 渲染器配置接口
18
18
  */
19
19
  export interface RenderConfig {
20
- /**
21
- * 内容
22
- */
20
+ /** 内容 */
23
21
  content?: RenderContent
24
- /**
25
- * 样式类名
26
- */
22
+ /** 样式类名 */
27
23
  class?: string
28
- /**
29
- * 内联样式
30
- */
24
+ /** 内联样式 */
31
25
  style?: string
32
- /**
33
- * 内联样式字段
34
- */
26
+ /** 内联样式字段 */
35
27
  styleField?: string
36
- /**
37
- * 单位
38
- */
28
+ /** 单位 */
39
29
  unit?: string
40
30
  }
41
31
  // =========================== 渲染器相关接口 end ===========================
@@ -45,17 +35,11 @@ export interface RenderConfig {
45
35
  * 字典属性接口 共用于其它props配置属性
46
36
  */
47
37
  export interface DictProps {
48
- /**
49
- * 指定选项label为选项对象的某个属性值
50
- */
38
+ /** 指定选项label为选项对象的某个属性值 */
51
39
  label: string
52
- /**
53
- * 指定选项value为选项对象的某个属性值
54
- */
40
+ /** 指定选项value为选项对象的某个属性值 */
55
41
  value: string
56
- /**
57
- * 指定选项children为选项对象的某个属性值
58
- */
42
+ /** 指定选项children为选项对象的某个属性值 */
59
43
  children: string
60
44
  }
61
45
 
@@ -63,9 +47,7 @@ export interface DictProps {
63
47
  * 字典映射接口
64
48
  */
65
49
  export interface DictMap {
66
- /**
67
- * 形如:{ 性别: [{ label: '男', value: 1 },{ label: '女', value: 2 }] }
68
- */
50
+ /** 形如:{ 性别: [{ label: '男', value: 1 },{ label: '女', value: 2 }] } */
69
51
  [key: string]: Record<DictProps['label'] | DictProps['value'], any>[]
70
52
  }
71
53
 
@@ -73,29 +55,17 @@ export interface DictMap {
73
55
  * 使用字典接口
74
56
  */
75
57
  export interface UseDict {
76
- /**
77
- * 字典key 即dictMap的key,为boolean则以label作为dictMap的key
78
- */
58
+ /** 字典key 即dictMap的key,为boolean则以label作为dictMap的key */
79
59
  key?: string | boolean
80
- /**
81
- * 字典属性
82
- */
60
+ /** 字典属性 */
83
61
  props?: DictProps
84
- /**
85
- * 字典类名
86
- */
62
+ /** 字典类名 */
87
63
  class?: string
88
- /**
89
- * 内联样式
90
- */
64
+ /** 内联样式 */
91
65
  inlineStyle?: string
92
- /**
93
- * 字典样式字段
94
- */
66
+ /** 字典样式字段 */
95
67
  styleField?: string
96
- /**
97
- * 字典分割符 默认为逗号(,)
98
- */
68
+ /** 字典分割符 默认为逗号(,) */
99
69
  separator?: string
100
70
  }
101
71
  // =========================== 字典相关接口 end ===========================
@@ -105,21 +75,13 @@ export interface UseDict {
105
75
  * 上传配置接口
106
76
  */
107
77
  export interface UploadConfig {
108
- /**
109
- * 上传地址
110
- */
78
+ /** 上传地址 */
111
79
  action?: string
112
- /**
113
- * 请求头
114
- */
80
+ /** 请求头 */
115
81
  headers?: Record<string, unknown>
116
- /**
117
- * 上传数据
118
- */
82
+ /** 上传数据 */
119
83
  data?: Record<string, unknown>
120
- /**
121
- * 其他配置项
122
- */
84
+ /** 其他配置项 */
123
85
  [key: string]: any
124
86
  }
125
87
 
@@ -127,45 +89,25 @@ export interface UploadConfig {
127
89
  * 全局配置接口 其他组件声明globalConfig类型时需要
128
90
  */
129
91
  export interface GlobalConfig {
130
- /**
131
- * 最终语言
132
- */
92
+ /** 最终语言 */
133
93
  finalLanguage: string
134
- /**
135
- * 最终字典属性
136
- */
94
+ /** 最终字典属性 */
137
95
  finalDictProps: DictProps
138
- /**
139
- * 最终字典映射
140
- */
96
+ /** 最终字典映射 */
141
97
  finalDictMap: DictMap
142
- /**
143
- * 最终crud表格页面高度
144
- */
98
+ /** 最终crud表格页面高度 */
145
99
  finalCrudTablePageHeight: string
146
- /**
147
- * 最终crud表格弹窗高度
148
- */
100
+ /** 最终crud表格弹窗高度 */
149
101
  finalCrudTableModalHeight: string
150
- /**
151
- * 最终表格页面高度
152
- */
102
+ /** 最终表格页面高度 */
153
103
  finalTablePageHeight: string
154
- /**
155
- * 最终表格弹窗高度
156
- */
104
+ /** 最终表格弹窗高度 */
157
105
  finalTableModalHeight: string
158
- /**
159
- * 最终表格页面底部预留偏移
160
- */
106
+ /** 最终表格页面底部预留偏移 */
161
107
  finalTablePageBottomOffset: number
162
- /**
163
- * 最终表格弹窗底部预留偏移 tableMode=modal生效
164
- */
108
+ /** 最终表格弹窗底部预留偏移 tableMode=modal生效 */
165
109
  finalTableModalBottomOffset: number
166
- /**
167
- * 最终上传配置
168
- */
110
+ /** 最终上传配置 */
169
111
  finalUploadConfig: UploadConfig
170
112
  }
171
113
 
@@ -178,17 +120,11 @@ export type InputEventName = 'nonNegativeDecimal'
178
120
  * input事件接口
179
121
  */
180
122
  export interface InputEvent {
181
- /**
182
- * input事件名称
183
- */
123
+ /** input事件名称 */
184
124
  name: InputEventName
185
- /**
186
- * 保留的小数位数
187
- */
125
+ /** 保留的小数位数 */
188
126
  digits?: number
189
- /**
190
- * 回调函数
191
- */
127
+ /** 回调函数 */
192
128
  cb?: Function
193
129
  }
194
130
 
@@ -196,30 +132,17 @@ export interface InputEvent {
196
132
  * 编辑配置属性接口
197
133
  */
198
134
  export interface EditAttrs {
199
- /**
200
- * 是否追加label到placeholder后面 默认是
201
- * 不需要可显式设置appendLabelToPlaceholder为false
202
- */
135
+ /** 是否追加label到placeholder后面 默认是,不需要可显式设置appendLabelToPlaceholder为false */
203
136
  appendLabelToPlaceholder?: boolean
204
- /**
205
- * UseElSelect等组件的options
206
- */
137
+ /** UseElSelect等组件的options */
207
138
  options?: Record<string, any>[]
208
- /**
209
- * UseElSelect等组件的props
210
- */
139
+ /** UseElSelect等组件的props */
211
140
  props?: DictProps
212
- /**
213
- * change事件
214
- */
141
+ /** change事件 */
215
142
  changeEvent?: Function
216
- /**
217
- * focus事件
218
- */
143
+ /** focus事件 */
219
144
  focusEvent?: Function
220
- /**
221
- * input事件
222
- */
145
+ /** input事件 */
223
146
  inputEvent?: Function | InputEventName | InputEvent
224
147
  }
225
148
  // =========================== 其他接口 end ===========================