@wyfex/ivue 0.5.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.
@@ -0,0 +1,93 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
+ modelValue: {
3
+ type: (StringConstructor | BooleanConstructor | NumberConstructor | ArrayConstructor)[];
4
+ default: string;
5
+ };
6
+ options: {
7
+ type: import('vue').PropType<Record<string, any>[]>;
8
+ default: () => never[];
9
+ };
10
+ dictProps: {
11
+ type: import('vue').PropType<import('../../types').DictProps>;
12
+ default: () => {};
13
+ };
14
+ useRender: {
15
+ type: import('vue').PropType<boolean | import('../../types').RenderConfig>;
16
+ default: boolean;
17
+ };
18
+ useV2: {
19
+ type: BooleanConstructor;
20
+ default: boolean;
21
+ };
22
+ clearable: {
23
+ type: BooleanConstructor;
24
+ default: boolean;
25
+ };
26
+ toJoin: {
27
+ type: BooleanConstructor;
28
+ default: boolean;
29
+ };
30
+ placeholder: {
31
+ type: StringConstructor;
32
+ default: string;
33
+ };
34
+ width: {
35
+ type: StringConstructor;
36
+ default: string;
37
+ };
38
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
39
+ "update:modelValue": (value: string | number | (string | number)[]) => any;
40
+ "update:label": (label: string | string[]) => any;
41
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
42
+ modelValue: {
43
+ type: (StringConstructor | BooleanConstructor | NumberConstructor | ArrayConstructor)[];
44
+ default: string;
45
+ };
46
+ options: {
47
+ type: import('vue').PropType<Record<string, any>[]>;
48
+ default: () => never[];
49
+ };
50
+ dictProps: {
51
+ type: import('vue').PropType<import('../../types').DictProps>;
52
+ default: () => {};
53
+ };
54
+ useRender: {
55
+ type: import('vue').PropType<boolean | import('../../types').RenderConfig>;
56
+ default: boolean;
57
+ };
58
+ useV2: {
59
+ type: BooleanConstructor;
60
+ default: boolean;
61
+ };
62
+ clearable: {
63
+ type: BooleanConstructor;
64
+ default: boolean;
65
+ };
66
+ toJoin: {
67
+ type: BooleanConstructor;
68
+ default: boolean;
69
+ };
70
+ placeholder: {
71
+ type: StringConstructor;
72
+ default: string;
73
+ };
74
+ width: {
75
+ type: StringConstructor;
76
+ default: string;
77
+ };
78
+ }>> & Readonly<{
79
+ "onUpdate:modelValue"?: ((value: string | number | (string | number)[]) => any) | undefined;
80
+ "onUpdate:label"?: ((label: string | string[]) => any) | undefined;
81
+ }>, {
82
+ toJoin: boolean;
83
+ modelValue: string | number | boolean | unknown[];
84
+ useRender: boolean | import('../../types').RenderConfig;
85
+ placeholder: string;
86
+ dictProps: import('../../types').DictProps;
87
+ width: string;
88
+ clearable: boolean;
89
+ options: Record<string, any>[];
90
+ useV2: boolean;
91
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
92
+ declare const _default: typeof __VLS_export;
93
+ export default _default;
@@ -0,0 +1,41 @@
1
+ import { PropType } from 'vue';
2
+ import { DictProps, RenderConfig } from '../../../types';
3
+ declare const _default: {
4
+ modelValue: {
5
+ type: (StringConstructor | BooleanConstructor | NumberConstructor | ArrayConstructor)[];
6
+ default: string;
7
+ };
8
+ options: {
9
+ type: PropType<Record<string, any>[]>;
10
+ default: () => never[];
11
+ };
12
+ dictProps: {
13
+ type: PropType<DictProps>;
14
+ default: () => {};
15
+ };
16
+ useRender: {
17
+ type: PropType<boolean | RenderConfig>;
18
+ default: boolean;
19
+ };
20
+ useV2: {
21
+ type: BooleanConstructor;
22
+ default: boolean;
23
+ };
24
+ clearable: {
25
+ type: BooleanConstructor;
26
+ default: boolean;
27
+ };
28
+ toJoin: {
29
+ type: BooleanConstructor;
30
+ default: boolean;
31
+ };
32
+ placeholder: {
33
+ type: StringConstructor;
34
+ default: string;
35
+ };
36
+ width: {
37
+ type: StringConstructor;
38
+ default: string;
39
+ };
40
+ };
41
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+ import { default as componentProps } from './props';
3
+ export type Props = ExtractPropTypes<typeof componentProps>;
4
+ export interface Emits {
5
+ (e: 'update:modelValue', value: string | number | (string | number)[]): void;
6
+ (e: 'update:label', label: string | string[]): void;
7
+ }
@@ -2,5 +2,7 @@ import { Props } from './types';
2
2
  export declare const useRender: (props: Props) => {
3
3
  isVueComponent: import('vue').ComputedRef<boolean>;
4
4
  isTextContent: import('vue').ComputedRef<boolean>;
5
+ isArrayContent: import('vue').ComputedRef<boolean>;
5
6
  isVNodeContent: import('vue').ComputedRef<boolean>;
7
+ processArrayContent: import('vue').ComputedRef<string>;
6
8
  };
@@ -3,6 +3,18 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
3
3
  type: import('vue').PropType<import('../../types').RenderContent>;
4
4
  required: boolean;
5
5
  };
6
+ separator: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ convertKey: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
14
+ emptyText: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ };
6
18
  class: {
7
19
  type: StringConstructor;
8
20
  default: string;
@@ -16,6 +28,18 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
16
28
  type: import('vue').PropType<import('../../types').RenderContent>;
17
29
  required: boolean;
18
30
  };
31
+ separator: {
32
+ type: StringConstructor;
33
+ default: string;
34
+ };
35
+ convertKey: {
36
+ type: StringConstructor;
37
+ default: string;
38
+ };
39
+ emptyText: {
40
+ type: StringConstructor;
41
+ default: string;
42
+ };
19
43
  class: {
20
44
  type: StringConstructor;
21
45
  default: string;
@@ -27,6 +51,9 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
27
51
  }>> & Readonly<{}>, {
28
52
  style: string | Record<string, any>;
29
53
  class: string;
54
+ separator: string;
55
+ convertKey: string;
56
+ emptyText: string;
30
57
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
31
58
  declare const _default: typeof __VLS_export;
32
59
  export default _default;
@@ -5,6 +5,18 @@ declare const _default: {
5
5
  type: PropType<RenderContent>;
6
6
  required: boolean;
7
7
  };
8
+ separator: {
9
+ type: StringConstructor;
10
+ default: string;
11
+ };
12
+ convertKey: {
13
+ type: StringConstructor;
14
+ default: string;
15
+ };
16
+ emptyText: {
17
+ type: StringConstructor;
18
+ default: string;
19
+ };
8
20
  class: {
9
21
  type: StringConstructor;
10
22
  default: string;
@@ -2,4 +2,6 @@ export { default as UseElButton } from './UseElButton/index.vue';
2
2
  export { default as UseElConfigProvider } from './UseElConfigProvider/index.vue';
3
3
  export { default as UseElDatePicker } from './UseElDatePicker/index.vue';
4
4
  export { default as UseElDescriptions } from './UseElDescriptions/index.vue';
5
+ export { default as UseElInput } from './UseElInput/index.vue';
6
+ export { default as UseElSelect } from './UseElSelect/index.vue';
5
7
  export { default as UseRender } from './UseRender/index.vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wyfex/ivue",
3
- "version": "0.5.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.2",
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.1",
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.35",
65
+ "vue": "^3.5.38",
66
66
  "vue-tsc": "^3.3.4"
67
67
  }
68
68
  }
@@ -0,0 +1,92 @@
1
+ import type { PropType } from 'vue'
2
+ import type { RenderConfig } from '@/types'
3
+
4
+ /**
5
+ * 组件props
6
+ */
7
+ export default {
8
+ /**
9
+ * 双向绑定数据源
10
+ */
11
+ modelValue: {
12
+ type: [String, Number],
13
+ default: ''
14
+ },
15
+ /**
16
+ * el-input组件的宽度
17
+ */
18
+ width: {
19
+ type: String,
20
+ default: '100%'
21
+ },
22
+ /**
23
+ * placeholder
24
+ */
25
+ placeholder: {
26
+ type: String,
27
+ default: '请输入'
28
+ },
29
+ /**
30
+ * 是否可清空 默认是
31
+ */
32
+ clearable: {
33
+ type: Boolean,
34
+ default: true
35
+ },
36
+ /**
37
+ * 是否使用渲染器 默认否
38
+ */
39
+ useRender: {
40
+ type: [Boolean, Object] as PropType<boolean | RenderConfig>,
41
+ default: false
42
+ },
43
+ /**
44
+ * el-input头部插槽内容
45
+ */
46
+ prefixContent: {
47
+ type: [String, Object],
48
+ default: ''
49
+ },
50
+ /**
51
+ * el-input尾部插槽内容
52
+ */
53
+ suffixContent: {
54
+ type: [String, Object],
55
+ default: ''
56
+ },
57
+ /**
58
+ * el-input前置插槽内容
59
+ */
60
+ prependContent: {
61
+ type: [String, Object],
62
+ default: ''
63
+ },
64
+ /**
65
+ * el-input后置插槽内容
66
+ */
67
+ appendContent: {
68
+ type: [String, Object],
69
+ default: ''
70
+ },
71
+ /**
72
+ * 单位 显示在el-input的右外部
73
+ */
74
+ unit: {
75
+ type: [String, Object],
76
+ default: ''
77
+ },
78
+ /**
79
+ * 控制是否能被用户缩放 仅type=textare生效
80
+ */
81
+ resize: {
82
+ type: String,
83
+ default: 'none'
84
+ },
85
+ /**
86
+ * 输入框行数 仅type=textare生效
87
+ */
88
+ rows: {
89
+ type: Number,
90
+ default: 6
91
+ }
92
+ }
@@ -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
+ /**
14
+ * 更新value值
15
+ */
16
+ (e: 'update:modelValue', value: string): void
17
+ }
@@ -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 { PropType } from 'vue'
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
- * 样式类名 仅content为String和Number有效
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
- * 内联样式 仅content为StringNumber有效
44
+ * 内联样式 仅TextContentArrayContent有效
24
45
  */
25
46
  style: {
26
47
  type: [String, Object] as PropType<string | Record<string, any>>,
@@ -4,7 +4,13 @@ import type { Component, VNode } from 'vue'
4
4
  /**
5
5
  * 渲染器内容类型
6
6
  */
7
- export type RenderContent = string | number | boolean | VNode | Component
7
+ export type RenderContent =
8
+ | string
9
+ | number
10
+ | boolean
11
+ | unknown[]
12
+ | VNode
13
+ | Component
8
14
 
9
15
  /**
10
16
  * 渲染器配置接口