@wyfex/ivue 0.6.0 → 0.8.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
+ isArrayOrObjectContent: import('vue').ComputedRef<boolean>;
5
6
  isVNodeContent: import('vue').ComputedRef<boolean>;
7
+ processArrayOrObjectContent: import('vue').ComputedRef<any>;
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
+ parseKey: {
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
+ parseKey: {
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
+ parseKey: 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
+ parseKey: {
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,5 +2,7 @@ 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 UseElDrawer } from './UseElDrawer/index.vue';
5
6
  export { default as UseElInput } from './UseElInput/index.vue';
7
+ export { default as UseElSelect } from './UseElSelect/index.vue';
6
8
  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.6.0",
3
+ "version": "0.8.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
- "@wyfex/iutils": "^0.30.0",
57
- "element-plus": "^2.14.1",
56
+ "@wyfex/iutils": "file:D:/20260516/wyfex/wyfex-iutils/wyfex-iutils-0.30.0.tgz",
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,121 @@
1
+ /**
2
+ * 组件props
3
+ */
4
+ export default {
5
+ /**
6
+ * el-drawer的标题
7
+ */
8
+ title: {
9
+ type: String,
10
+ default: '欢迎使用wyfex-ivue抽屉组件'
11
+ },
12
+ /**
13
+ * el-drawer的窗体的大小, 当使用number类型时, 以像素为单位, 当使用string类型时, 请传入'xx%'、'xxxpx'等,否则便会以number类型解释 默认1100px
14
+ */
15
+ size: {
16
+ type: [Number, String],
17
+ default: 1100
18
+ },
19
+ /**
20
+ * el-drawer自身是否插入至body元素上。嵌套的el-drawer必须指定该属性并赋值为 true 默认是
21
+ */
22
+ appendToBody: {
23
+ type: Boolean,
24
+ default: true
25
+ },
26
+ /**
27
+ * 控制是否在关闭el-drawer后将子元素全部销毁 默认是
28
+ */
29
+ destroyOnClose: {
30
+ type: Boolean,
31
+ default: true
32
+ },
33
+ /**
34
+ * 是否可以通过点击modal关闭el-drawer 默认否
35
+ */
36
+ closeOnClickModal: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ /**
41
+ * 是否显示全屏图标 默认是
42
+ */
43
+ showFullScreenIcon: {
44
+ type: Boolean,
45
+ default: true
46
+ },
47
+ /**
48
+ * 是否显示footer 默认显示,可通过<template #footer></template>插槽自定义footer内容
49
+ */
50
+ showFooter: {
51
+ type: Boolean,
52
+ default: true
53
+ },
54
+ /**
55
+ * 底部定位 默认left
56
+ */
57
+ footerPosition: {
58
+ type: String,
59
+ default: 'left',
60
+ validator: (val: string) => ['left', 'center', 'right'].includes(val)
61
+ },
62
+ /**
63
+ * 是否严格区分close事件 默认否 和onClose事件二选一设置一个即可
64
+ */
65
+ strictCloseEvent: {
66
+ type: Boolean,
67
+ default: false
68
+ },
69
+ /**
70
+ * 抽屉关闭图标事件 若未设置且未开启strictCloseEvent则默认执行onCancel事件
71
+ */
72
+ onClose: {
73
+ type: Function,
74
+ default: () => {}
75
+ },
76
+ /**
77
+ * 确定按钮文本
78
+ */
79
+ confirmBtnText: {
80
+ type: String,
81
+ default: '保存'
82
+ },
83
+ /**
84
+ * 取消按钮文本
85
+ */
86
+ cancelBtnText: {
87
+ type: String,
88
+ default: '取消'
89
+ },
90
+ /**
91
+ * 取消按钮类型 同ElButton类型
92
+ */
93
+ cancelBtnType: {
94
+ type: String,
95
+ default: '',
96
+ validator: (val: string) =>
97
+ [
98
+ '',
99
+ 'default',
100
+ 'primary',
101
+ 'success',
102
+ 'warning',
103
+ 'danger',
104
+ 'info'
105
+ ].includes(val)
106
+ },
107
+ /**
108
+ * 确定按钮事件
109
+ */
110
+ onConfirm: {
111
+ type: Function,
112
+ default: () => {}
113
+ },
114
+ /**
115
+ * 取消按钮事件
116
+ */
117
+ onCancel: {
118
+ type: Function,
119
+ default: () => {}
120
+ }
121
+ }
@@ -0,0 +1,7 @@
1
+ import type { ExtractPropTypes } from 'vue'
2
+ import componentProps from './props'
3
+
4
+ /**
5
+ * props类型
6
+ */
7
+ export type Props = ExtractPropTypes<typeof componentProps>
@@ -10,6 +10,8 @@ export type Props = ExtractPropTypes<typeof componentProps>
10
10
  * emits接口
11
11
  */
12
12
  export interface Emits {
13
- // 更新value值
13
+ /**
14
+ * 更新value值
15
+ */
14
16
  (e: 'update:modelValue', value: string): void
15
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
+ parseKey: {
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,14 @@ 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
+ | Record<string, any>
13
+ | VNode
14
+ | Component
8
15
 
9
16
  /**
10
17
  * 渲染器配置接口