@wyfex/ivue 0.10.0 → 0.11.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,54 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
+ name: {
3
+ type: StringConstructor;
4
+ required: boolean;
5
+ };
6
+ size: {
7
+ type: (StringConstructor | NumberConstructor)[];
8
+ default: number;
9
+ validator(val: any): any;
10
+ };
11
+ color: {
12
+ type: import('vue').PropType<string | Record<string, any>[]>;
13
+ validator(val: any): any;
14
+ };
15
+ margin: {
16
+ type: StringConstructor;
17
+ };
18
+ clickable: {
19
+ type: BooleanConstructor;
20
+ default: boolean;
21
+ };
22
+ hoverClass: {
23
+ type: StringConstructor;
24
+ };
25
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
26
+ name: {
27
+ type: StringConstructor;
28
+ required: boolean;
29
+ };
30
+ size: {
31
+ type: (StringConstructor | NumberConstructor)[];
32
+ default: number;
33
+ validator(val: any): any;
34
+ };
35
+ color: {
36
+ type: import('vue').PropType<string | Record<string, any>[]>;
37
+ validator(val: any): any;
38
+ };
39
+ margin: {
40
+ type: StringConstructor;
41
+ };
42
+ clickable: {
43
+ type: BooleanConstructor;
44
+ default: boolean;
45
+ };
46
+ hoverClass: {
47
+ type: StringConstructor;
48
+ };
49
+ }>> & Readonly<{}>, {
50
+ size: string | number;
51
+ clickable: boolean;
52
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
53
+ declare const _default: typeof __VLS_export;
54
+ export default _default;
@@ -0,0 +1,27 @@
1
+ import { PropType } from 'vue';
2
+ declare const _default: {
3
+ name: {
4
+ type: StringConstructor;
5
+ required: boolean;
6
+ };
7
+ size: {
8
+ type: (StringConstructor | NumberConstructor)[];
9
+ default: number;
10
+ validator(val: any): any;
11
+ };
12
+ color: {
13
+ type: PropType<string | Record<string, any>[]>;
14
+ validator(val: any): any;
15
+ };
16
+ margin: {
17
+ type: StringConstructor;
18
+ };
19
+ clickable: {
20
+ type: BooleanConstructor;
21
+ default: boolean;
22
+ };
23
+ hoverClass: {
24
+ type: StringConstructor;
25
+ };
26
+ };
27
+ export default _default;
@@ -8,3 +8,4 @@ export { default as UseElInput } from './UseElInput/index.vue';
8
8
  export { default as UseElSelect } from './UseElSelect/index.vue';
9
9
  export { default as UseElTable } from './UseElTable/index.vue';
10
10
  export { default as UseRender } from './UseRender/index.vue';
11
+ export { default as UseSvgIcon } from './UseSvgIcon/index.vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wyfex/ivue",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "万有前端 X 体系下基于 Vite8 + Vue3 + Typescript6 + ElementPlus2 构建的 iVue 组件库",
5
5
  "homepage": "https://wyfe.top/idocs/ivue",
6
6
  "type": "module",
@@ -0,0 +1,59 @@
1
+ import type { PropType } from 'vue'
2
+ import { isArray } from '@wyfex/iutils'
3
+ import { parseUnit, isValidUnit } from '@/utils'
4
+
5
+ /**
6
+ * 组件props
7
+ */
8
+ export default {
9
+ /**
10
+ * 图标名称 必传
11
+ */
12
+ name: {
13
+ type: String,
14
+ required: true
15
+ },
16
+ /**
17
+ * 图标大小 默认类型为数字(单位为px);可传带单位的字符串,如:20px、0.2rem
18
+ */
19
+ size: {
20
+ type: [Number, String],
21
+ default: 28,
22
+ validator(val: any) {
23
+ if (typeof val === 'number') return val
24
+ return isValidUnit(parseUnit(val)) && val
25
+ }
26
+ },
27
+ /**
28
+ * 图标颜色 可传String或Array
29
+ * 若传Array,只能传两项 第一项为默认图标颜色 第二项为暗黑模式下图标颜色
30
+ */
31
+ color: {
32
+ type: [String, Array] as PropType<string | Record<string, any>[]>,
33
+ validator(val: any) {
34
+ if (!isArray(val)) return val
35
+ if (!val.length) throw new Error(`color类型为Array时length不能为0`)
36
+ if (val.length > 2) throw new Error(`color类型为Array时length最大为2`)
37
+ return val
38
+ }
39
+ },
40
+ /**
41
+ * 图标的margin外边距 同css的margin规则
42
+ */
43
+ margin: {
44
+ type: String
45
+ },
46
+ /**
47
+ * 是否可点击
48
+ */
49
+ clickable: {
50
+ type: Boolean,
51
+ default: false
52
+ },
53
+ /**
54
+ * hover类名
55
+ */
56
+ hoverClass: {
57
+ type: String
58
+ }
59
+ }