@wyfex/ivue 0.6.0 → 0.7.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.
- package/README.md +1 -1
- package/dist/index.es.js +11 -4
- package/dist/index.umd.cjs +11 -4
- package/dist/ivue.css +1 -1
- package/dist/types/UseElSelect/hook.d.ts +14 -0
- package/dist/types/UseElSelect/index.vue.d.ts +93 -0
- package/dist/types/UseElSelect/props.d.ts +41 -0
- package/dist/types/UseElSelect/types.d.ts +7 -0
- package/dist/types/UseRender/hook.d.ts +2 -0
- package/dist/types/UseRender/index.vue.d.ts +27 -0
- package/dist/types/UseRender/props.d.ts +12 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +4 -4
- package/src/components/UseElInput/types.ts +3 -1
- package/src/components/UseElSelect/props.ts +71 -0
- package/src/components/UseElSelect/types.ts +21 -0
- package/src/components/UseRender/props.ts +25 -4
- package/src/types/index.ts +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wyfex/ivue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "万有前端 X 体系下基于 Vite8 + Vue3 + Typescript6 + ElementPlus2 构建的 iVue 组件库",
|
|
5
5
|
"homepage": "https://wyfe.top/idocs/ivue",
|
|
6
6
|
"type": "module",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"vue": ">=3.2.0 <4.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@types/node": "^25.9.
|
|
53
|
+
"@types/node": "^25.9.3",
|
|
54
54
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
55
55
|
"@vue/tsconfig": "^0.9.1",
|
|
56
56
|
"@wyfex/iutils": "^0.30.0",
|
|
57
|
-
"element-plus": "^2.14.
|
|
57
|
+
"element-plus": "^2.14.2",
|
|
58
58
|
"sass-embedded": "^1.100.0",
|
|
59
59
|
"typescript": "~6.0.3",
|
|
60
60
|
"unplugin-auto-import": "^21.0.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"unplugin-vue-components": "^32.1.0",
|
|
63
63
|
"vite": "^8.0.16",
|
|
64
64
|
"vite-svg-loader": "^5.1.1",
|
|
65
|
-
"vue": "^3.5.
|
|
65
|
+
"vue": "^3.5.38",
|
|
66
66
|
"vue-tsc": "^3.3.4"
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { PropType } from 'vue'
|
|
2
|
+
import type { DictProps, RenderConfig } from '@/types'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 组件props
|
|
6
|
+
*/
|
|
7
|
+
export default {
|
|
8
|
+
/**
|
|
9
|
+
* 双向绑定数据源
|
|
10
|
+
*/
|
|
11
|
+
modelValue: {
|
|
12
|
+
type: [String, Number, Boolean, Array],
|
|
13
|
+
default: ''
|
|
14
|
+
},
|
|
15
|
+
/**
|
|
16
|
+
* 选项数据源
|
|
17
|
+
*/
|
|
18
|
+
options: {
|
|
19
|
+
type: Array as PropType<Record<string, any>[]>,
|
|
20
|
+
default: () => []
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* 字典属性 默认为{ value: 'value', label: 'label', children: 'children' },可通过全局配置进行设置,为适配全局配置此处不再设置默认值
|
|
24
|
+
*/
|
|
25
|
+
dictProps: {
|
|
26
|
+
type: Object as PropType<DictProps>,
|
|
27
|
+
default: () => ({})
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* 是否使用渲染器 默认否
|
|
31
|
+
*/
|
|
32
|
+
useRender: {
|
|
33
|
+
type: [Boolean, Object] as PropType<boolean | RenderConfig>,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
/**
|
|
37
|
+
* 是否使用v2版本 默认是
|
|
38
|
+
*/
|
|
39
|
+
useV2: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: true
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* 是否可清空 默认是
|
|
45
|
+
*/
|
|
46
|
+
clearable: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* 开启多选时是否将选中的数组转为以逗号分隔的字符串 默认否
|
|
52
|
+
*/
|
|
53
|
+
toJoin: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* placeholder 默认请选择
|
|
59
|
+
*/
|
|
60
|
+
placeholder: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: '请选择'
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* 宽度,默认100%
|
|
66
|
+
*/
|
|
67
|
+
width: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: '100%'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
/**
|
|
14
|
+
* 更新value值
|
|
15
|
+
*/
|
|
16
|
+
(e: 'update:modelValue', value: string | number | (string | number)[]): void
|
|
17
|
+
/**
|
|
18
|
+
* 更新label值
|
|
19
|
+
*/
|
|
20
|
+
(e: 'update:label', label: string | string[]): void
|
|
21
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type PropType } from 'vue'
|
|
2
2
|
import type { RenderContent } from '@/types'
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -9,18 +9,39 @@ export default {
|
|
|
9
9
|
* 渲染内容 必传
|
|
10
10
|
*/
|
|
11
11
|
content: {
|
|
12
|
-
type: [String, Number, Boolean, Object] as PropType<RenderContent>,
|
|
12
|
+
type: [String, Number, Boolean, Array, Object] as PropType<RenderContent>,
|
|
13
13
|
required: true
|
|
14
14
|
},
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* content为Array类型时转为字符串的分隔符 默认、
|
|
17
|
+
*/
|
|
18
|
+
separator: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: '、'
|
|
21
|
+
},
|
|
22
|
+
/**
|
|
23
|
+
* content为对象数组时需要转为字符串的key 默认label
|
|
24
|
+
*/
|
|
25
|
+
convertKey: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: 'label'
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* 当content为空时展示的文本 默认—
|
|
31
|
+
*/
|
|
32
|
+
emptyText: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: '—'
|
|
35
|
+
},
|
|
36
|
+
/**
|
|
37
|
+
* 样式类名 仅TextContent和ArrayContent有效
|
|
17
38
|
*/
|
|
18
39
|
class: {
|
|
19
40
|
type: String,
|
|
20
41
|
default: ''
|
|
21
42
|
},
|
|
22
43
|
/**
|
|
23
|
-
* 内联样式 仅
|
|
44
|
+
* 内联样式 仅TextContent和ArrayContent有效
|
|
24
45
|
*/
|
|
25
46
|
style: {
|
|
26
47
|
type: [String, Object] as PropType<string | Record<string, any>>,
|
package/src/types/index.ts
CHANGED
|
@@ -4,7 +4,13 @@ import type { Component, VNode } from 'vue'
|
|
|
4
4
|
/**
|
|
5
5
|
* 渲染器内容类型
|
|
6
6
|
*/
|
|
7
|
-
export type RenderContent =
|
|
7
|
+
export type RenderContent =
|
|
8
|
+
| string
|
|
9
|
+
| number
|
|
10
|
+
| boolean
|
|
11
|
+
| unknown[]
|
|
12
|
+
| VNode
|
|
13
|
+
| Component
|
|
8
14
|
|
|
9
15
|
/**
|
|
10
16
|
* 渲染器配置接口
|