@yh-ui/icons 0.1.2

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,17 @@
1
+ /**
2
+ * @yh-ui/icons - High Performance Icon Library
3
+ *
4
+ * 集成 Iconify 图标库,支持 100+ 图标集,按需加载,零运行时开销
5
+ *
6
+ * 使用方式:
7
+ * 1. 通过 unplugin-icons 自动按需导入(如:<Icon icon="mdi:home" />)
8
+ * 2. 直接使用 YhIcon 组件并传入图标名称(如:<YhIcon name="mdi:home" />)
9
+ * 3. 使用预注册的图标简写(如:<YhIcon name="home" />)
10
+ */
11
+ export * from './types';
12
+ export { createIconifyComponent, parseIconName, iconExists, getIconData } from './iconify';
13
+ export type { IconifyProps } from './iconify';
14
+ export * from './presets';
15
+ export * from './collections';
16
+ export * from './vue/icon';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,cAAc,SAAS,CAAA;AAGvB,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC1F,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG7C,cAAc,WAAW,CAAA;AAGzB,cAAc,eAAe,CAAA;AAG7B,cAAc,YAAY,CAAA"}
@@ -0,0 +1,54 @@
1
+ import { IconPreset } from './types';
2
+ /**
3
+ * 预设图标集列表
4
+ */
5
+ export declare const PRESETS: IconPreset[];
6
+ /**
7
+ * 获取预设配置
8
+ * @param prefix - 图标集前缀
9
+ * @returns 预设配置
10
+ */
11
+ export declare function getPreset(prefix: string): IconPreset | undefined;
12
+ /**
13
+ * 默认启用的图标集
14
+ * 这些图标集会被默认加载
15
+ */
16
+ export declare const DEFAULT_ENABLED_PRESETS: string[];
17
+ /**
18
+ * 图标集前缀映射
19
+ * 用于简写转换
20
+ */
21
+ export declare const PREFIX_ALIAS: Record<string, string>;
22
+ /**
23
+ * 常用图标快捷方式
24
+ * 用于快速访问常用图标
25
+ */
26
+ export declare const COMMON_ICONS: {
27
+ readonly 'arrow-up': "mdi:arrow-up";
28
+ readonly 'arrow-down': "mdi:arrow-down";
29
+ readonly 'arrow-left': "mdi:arrow-left";
30
+ readonly 'arrow-right': "mdi:arrow-right";
31
+ readonly close: "mdi:close";
32
+ readonly check: "mdi:check";
33
+ readonly plus: "mdi:plus";
34
+ readonly minus: "mdi:minus";
35
+ readonly delete: "mdi:delete";
36
+ readonly edit: "mdi:pencil";
37
+ readonly search: "mdi:magnify";
38
+ readonly upload: "mdi:upload";
39
+ readonly download: "mdi:download";
40
+ readonly refresh: "mdi:refresh";
41
+ readonly settings: "mdi:cog";
42
+ readonly menu: "mdi:menu";
43
+ readonly loading: "mdi:loading";
44
+ readonly success: "mdi:check-circle";
45
+ readonly warning: "mdi:alert";
46
+ readonly error: "mdi:alert-circle";
47
+ readonly info: "mdi:information";
48
+ readonly user: "mdi:user";
49
+ readonly users: "mdi:account-group";
50
+ readonly file: "mdi:file";
51
+ readonly folder: "mdi:folder";
52
+ readonly image: "mdi:image";
53
+ };
54
+ //# sourceMappingURL=presets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../src/presets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,UAAU,EA6D/B,CAAA;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAEhE;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,UAA0C,CAAA;AAE9E;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA2B/C,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCf,CAAA"}
@@ -0,0 +1,144 @@
1
+ /**
2
+ * 图标库类型定义
3
+ */
4
+ /**
5
+ * 图标名称或图标标识符
6
+ * 支持格式:
7
+ * - 简写名称(如:'home', 'search')
8
+ * - 带前缀的图标名(如:'mdi:home', 'ep:search')
9
+ * - 完整图标标识符(如:'mdi/home', '@iconify-icons/mdi/home')
10
+ */
11
+ export type IconName = string;
12
+ /**
13
+ * 图标尺寸
14
+ */
15
+ export type IconSize = number | string;
16
+ /**
17
+ * 图标颜色
18
+ */
19
+ export type IconColor = string;
20
+ /**
21
+ * 图标旋转角度
22
+ */
23
+ export type IconRotate = number;
24
+ /**
25
+ * 预设图标集
26
+ * 每个预设代表一个常用的图标库
27
+ */
28
+ export interface IconPreset {
29
+ /** 预设名称 */
30
+ name: string;
31
+ /** 图标集前缀 */
32
+ prefix: string;
33
+ /** 图标数量 */
34
+ count: number;
35
+ /** 图标集描述 */
36
+ description?: string;
37
+ }
38
+ /**
39
+ * 图标配置选项
40
+ */
41
+ export interface IconOptions {
42
+ /** 默认图标尺寸 */
43
+ defaultSize?: IconSize;
44
+ /** 默认图标颜色 */
45
+ defaultColor?: IconColor;
46
+ /** 默认启用旋转动画 */
47
+ defaultSpin?: boolean;
48
+ /** 加载失败时显示的备用图标 */
49
+ fallbackIcon?: string;
50
+ }
51
+ /**
52
+ * 图标集配置
53
+ */
54
+ export interface IconCollection {
55
+ /** 图标集名称 */
56
+ name: string;
57
+ /** 图标集前缀 */
58
+ prefix: string;
59
+ /** 图标集作者 */
60
+ author?: string;
61
+ /** 图标集许可证 */
62
+ license?: string;
63
+ /** 图标数量 */
64
+ total: number;
65
+ }
66
+ /**
67
+ * 图标搜索结果
68
+ */
69
+ export interface IconSearchResult {
70
+ /** 图标名称 */
71
+ name: string;
72
+ /** 图标完整标识符 */
73
+ icon: string;
74
+ /** 图标集 */
75
+ collection: string;
76
+ /** 图标集前缀 */
77
+ prefix: string;
78
+ }
79
+ /**
80
+ * Vue 组件图标属性
81
+ */
82
+ export interface IconProps {
83
+ /** 图标名称 */
84
+ icon?: IconName;
85
+ /** 图标尺寸 */
86
+ size?: IconSize;
87
+ /** 图标颜色 */
88
+ color?: IconColor;
89
+ /** 是否旋转 */
90
+ spin?: boolean;
91
+ /** 旋转角度 */
92
+ rotate?: IconRotate;
93
+ }
94
+ /**
95
+ * 可用的图标集列表
96
+ * 常用的图标集
97
+ */
98
+ export declare const AVAILABLE_COLLECTIONS: readonly [{
99
+ readonly prefix: "mdi";
100
+ readonly name: "Material Design Icons";
101
+ readonly count: 7000;
102
+ }, {
103
+ readonly prefix: "ep";
104
+ readonly name: "Element Plus";
105
+ readonly count: 200;
106
+ }, {
107
+ readonly prefix: "antd";
108
+ readonly name: "Ant Design Icons";
109
+ readonly count: 800;
110
+ }, {
111
+ readonly prefix: "fa";
112
+ readonly name: "Font Awesome 6 Free";
113
+ readonly count: 2000;
114
+ }, {
115
+ readonly prefix: "heroicons";
116
+ readonly name: "Heroicons";
117
+ readonly count: 600;
118
+ }, {
119
+ readonly prefix: "lucide";
120
+ readonly name: "Lucide";
121
+ readonly count: 1500;
122
+ }, {
123
+ readonly prefix: "carbon";
124
+ readonly name: "Carbon Icons";
125
+ readonly count: 1600;
126
+ }, {
127
+ readonly prefix: "tabler";
128
+ readonly name: "Tabler Icons";
129
+ readonly count: 4600;
130
+ }, {
131
+ readonly prefix: "ri";
132
+ readonly name: "Remix Icon";
133
+ readonly count: 2500;
134
+ }, {
135
+ readonly prefix: "bi";
136
+ readonly name: "Bootstrap Icons";
137
+ readonly count: 2600;
138
+ }];
139
+ /**
140
+ * 推荐的图标集(默认启用的图标集)
141
+ */
142
+ export declare const RECOMMENDED_COLLECTIONS: readonly ["mdi", "ep", "lucide", "tabler", "ri"];
143
+ export type RecommendedCollection = typeof RECOMMENDED_COLLECTIONS[number];
144
+ //# sourceMappingURL=types.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AAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,WAAW;IACX,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,WAAW;IACX,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,WAAW;IACX,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,WAAW;IACX,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,WAAW;IACX,MAAM,CAAC,EAAE,UAAU,CAAA;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqBxB,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,uBAAuB,kDAAmD,CAAA;AAEvF,MAAM,MAAM,qBAAqB,GAAG,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAA"}
@@ -0,0 +1,278 @@
1
+ import { PropType } from 'vue';
2
+ import { IconName, IconSize, IconColor, IconRotate } from '../types';
3
+ /**
4
+ * YhIcon Vue 组件
5
+ * 保持与 @yh-ui/components 的 YhIcon 组件完全兼容
6
+ */
7
+ export declare const YhIcon: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
8
+ /**
9
+ * 图标名称
10
+ * 支持格式:
11
+ * - 简写名称(如:'home', 'search')
12
+ * - 带前缀的图标名(如:'mdi:home', 'ep:search')
13
+ */
14
+ name: {
15
+ type: PropType<IconName>;
16
+ default: string;
17
+ };
18
+ /**
19
+ * 直接使用 Iconify 图标(优先级高于 name)
20
+ */
21
+ icon: {
22
+ type: PropType<IconName>;
23
+ default: string;
24
+ };
25
+ /**
26
+ * SVG 字符串(直接渲染 SVG)
27
+ */
28
+ svg: {
29
+ type: StringConstructor;
30
+ default: string;
31
+ };
32
+ /**
33
+ * 图标组件(传入 Vue 组件)
34
+ */
35
+ component: {
36
+ type: PropType<object | ((...args: unknown[]) => unknown)>;
37
+ default: undefined;
38
+ };
39
+ /**
40
+ * 图标尺寸
41
+ */
42
+ size: {
43
+ type: PropType<IconSize>;
44
+ default: undefined;
45
+ };
46
+ /**
47
+ * 图标颜色
48
+ */
49
+ color: {
50
+ type: PropType<IconColor>;
51
+ default: undefined;
52
+ };
53
+ /**
54
+ * 是否启用旋转动画
55
+ */
56
+ spin: {
57
+ type: BooleanConstructor;
58
+ default: boolean;
59
+ };
60
+ /**
61
+ * 旋转角度(度数)
62
+ */
63
+ rotate: {
64
+ type: PropType<IconRotate>;
65
+ default: number;
66
+ };
67
+ }>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
68
+ [key: string]: any;
69
+ }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
70
+ /**
71
+ * 图标名称
72
+ * 支持格式:
73
+ * - 简写名称(如:'home', 'search')
74
+ * - 带前缀的图标名(如:'mdi:home', 'ep:search')
75
+ */
76
+ name: {
77
+ type: PropType<IconName>;
78
+ default: string;
79
+ };
80
+ /**
81
+ * 直接使用 Iconify 图标(优先级高于 name)
82
+ */
83
+ icon: {
84
+ type: PropType<IconName>;
85
+ default: string;
86
+ };
87
+ /**
88
+ * SVG 字符串(直接渲染 SVG)
89
+ */
90
+ svg: {
91
+ type: StringConstructor;
92
+ default: string;
93
+ };
94
+ /**
95
+ * 图标组件(传入 Vue 组件)
96
+ */
97
+ component: {
98
+ type: PropType<object | ((...args: unknown[]) => unknown)>;
99
+ default: undefined;
100
+ };
101
+ /**
102
+ * 图标尺寸
103
+ */
104
+ size: {
105
+ type: PropType<IconSize>;
106
+ default: undefined;
107
+ };
108
+ /**
109
+ * 图标颜色
110
+ */
111
+ color: {
112
+ type: PropType<IconColor>;
113
+ default: undefined;
114
+ };
115
+ /**
116
+ * 是否启用旋转动画
117
+ */
118
+ spin: {
119
+ type: BooleanConstructor;
120
+ default: boolean;
121
+ };
122
+ /**
123
+ * 旋转角度(度数)
124
+ */
125
+ rotate: {
126
+ type: PropType<IconRotate>;
127
+ default: number;
128
+ };
129
+ }>> & Readonly<{}>, {
130
+ icon: string;
131
+ size: IconSize;
132
+ color: string;
133
+ spin: boolean;
134
+ rotate: number;
135
+ svg: string;
136
+ name: string;
137
+ component: object | ((...args: unknown[]) => unknown);
138
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
139
+ /**
140
+ * Icon 组件 - YhIcon 的别名
141
+ */
142
+ export declare const Icon: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
143
+ /**
144
+ * 图标名称
145
+ * 支持格式:
146
+ * - 简写名称(如:'home', 'search')
147
+ * - 带前缀的图标名(如:'mdi:home', 'ep:search')
148
+ */
149
+ name: {
150
+ type: PropType<IconName>;
151
+ default: string;
152
+ };
153
+ /**
154
+ * 直接使用 Iconify 图标(优先级高于 name)
155
+ */
156
+ icon: {
157
+ type: PropType<IconName>;
158
+ default: string;
159
+ };
160
+ /**
161
+ * SVG 字符串(直接渲染 SVG)
162
+ */
163
+ svg: {
164
+ type: StringConstructor;
165
+ default: string;
166
+ };
167
+ /**
168
+ * 图标组件(传入 Vue 组件)
169
+ */
170
+ component: {
171
+ type: PropType<object | ((...args: unknown[]) => unknown)>;
172
+ default: undefined;
173
+ };
174
+ /**
175
+ * 图标尺寸
176
+ */
177
+ size: {
178
+ type: PropType<IconSize>;
179
+ default: undefined;
180
+ };
181
+ /**
182
+ * 图标颜色
183
+ */
184
+ color: {
185
+ type: PropType<IconColor>;
186
+ default: undefined;
187
+ };
188
+ /**
189
+ * 是否启用旋转动画
190
+ */
191
+ spin: {
192
+ type: BooleanConstructor;
193
+ default: boolean;
194
+ };
195
+ /**
196
+ * 旋转角度(度数)
197
+ */
198
+ rotate: {
199
+ type: PropType<IconRotate>;
200
+ default: number;
201
+ };
202
+ }>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
203
+ [key: string]: any;
204
+ }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
205
+ /**
206
+ * 图标名称
207
+ * 支持格式:
208
+ * - 简写名称(如:'home', 'search')
209
+ * - 带前缀的图标名(如:'mdi:home', 'ep:search')
210
+ */
211
+ name: {
212
+ type: PropType<IconName>;
213
+ default: string;
214
+ };
215
+ /**
216
+ * 直接使用 Iconify 图标(优先级高于 name)
217
+ */
218
+ icon: {
219
+ type: PropType<IconName>;
220
+ default: string;
221
+ };
222
+ /**
223
+ * SVG 字符串(直接渲染 SVG)
224
+ */
225
+ svg: {
226
+ type: StringConstructor;
227
+ default: string;
228
+ };
229
+ /**
230
+ * 图标组件(传入 Vue 组件)
231
+ */
232
+ component: {
233
+ type: PropType<object | ((...args: unknown[]) => unknown)>;
234
+ default: undefined;
235
+ };
236
+ /**
237
+ * 图标尺寸
238
+ */
239
+ size: {
240
+ type: PropType<IconSize>;
241
+ default: undefined;
242
+ };
243
+ /**
244
+ * 图标颜色
245
+ */
246
+ color: {
247
+ type: PropType<IconColor>;
248
+ default: undefined;
249
+ };
250
+ /**
251
+ * 是否启用旋转动画
252
+ */
253
+ spin: {
254
+ type: BooleanConstructor;
255
+ default: boolean;
256
+ };
257
+ /**
258
+ * 旋转角度(度数)
259
+ */
260
+ rotate: {
261
+ type: PropType<IconRotate>;
262
+ default: number;
263
+ };
264
+ }>> & Readonly<{}>, {
265
+ icon: string;
266
+ size: IconSize;
267
+ color: string;
268
+ spin: boolean;
269
+ rotate: number;
270
+ svg: string;
271
+ name: string;
272
+ component: object | ((...args: unknown[]) => unknown);
273
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
274
+ /**
275
+ * YhIcon Props 类型
276
+ */
277
+ export type YhIconProps = InstanceType<typeof YhIcon>['$props'];
278
+ //# sourceMappingURL=icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/vue/icon.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAA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Q,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,CAAC;;;IAGlF;;OAEG;;cAEyB,QAAQ,CAAC,QAAQ,CAAC;;;IAG9C;;OAEG;;cAEe,QAAQ,CAAC,SAAS,CAAC;;;IAGrC;;OAEG;;;;;IAKH;;OAEG;;cAEe,QAAQ,CAAC,UAAU,CAAC;;;;;;IAxDtC;;;;;OAKG;;cAEe,QAAQ,CAAC,QAAQ,CAAC;;;IAGpC;;OAEG;;cAEe,QAAQ,CAAC,QAAQ,CAAC;;;IAGpC;;OAEG;;;;;IAKH;;OAEG;;cAE2B,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,CAAC;;;IAGlF;;OAEG;;cAEyB,QAAQ,CAAC,QAAQ,CAAC;;;IAG9C;;OAEG;;cAEe,QAAQ,CAAC,SAAS,CAAC;;;IAGrC;;OAEG;;;;;IAKH;;OAEG;;cAEe,QAAQ,CAAC,UAAU,CAAC;;;;;;;;;;;mCA5BqB,OAAO,EAAE,KAAK,OAAO;4EAiH1D,CAAA;AAE1B;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAA"}
package/dist/types.mjs ADDED
@@ -0,0 +1,26 @@
1
+ const e = [
2
+ // Material Design Icons - 最流行的图标集
3
+ { prefix: "mdi", name: "Material Design Icons", count: 7e3 },
4
+ // Element Plus 图标
5
+ { prefix: "ep", name: "Element Plus", count: 200 },
6
+ // Ant Design Icons
7
+ { prefix: "antd", name: "Ant Design Icons", count: 800 },
8
+ // Font Awesome
9
+ { prefix: "fa", name: "Font Awesome 6 Free", count: 2e3 },
10
+ // Heroicons
11
+ { prefix: "heroicons", name: "Heroicons", count: 600 },
12
+ // Lucide - 现代简洁风格
13
+ { prefix: "lucide", name: "Lucide", count: 1500 },
14
+ // Carbon Icons
15
+ { prefix: "carbon", name: "Carbon Icons", count: 1600 },
16
+ // Tabler Icons
17
+ { prefix: "tabler", name: "Tabler Icons", count: 4600 },
18
+ // Remix Icon
19
+ { prefix: "ri", name: "Remix Icon", count: 2500 },
20
+ // Bootstrap Icons
21
+ { prefix: "bi", name: "Bootstrap Icons", count: 2600 }
22
+ ], n = ["mdi", "ep", "lucide", "tabler", "ri"];
23
+ export {
24
+ e as AVAILABLE_COLLECTIONS,
25
+ n as RECOMMENDED_COLLECTIONS
26
+ };
@@ -0,0 +1,132 @@
1
+ import { defineComponent as f, onMounted as d, computed as r, h as c } from "vue";
2
+ import { Icon as y } from "@iconify/vue";
3
+ import { COMMON_ICONS as l } from "../presets.mjs";
4
+ const u = "yh-icon-spin-style", m = `
5
+ @keyframes yh-icon-spin {
6
+ from { transform: rotate(0deg); }
7
+ to { transform: rotate(360deg); }
8
+ }
9
+ .yh-icons--spin {
10
+ animation: yh-icon-spin 1s linear infinite;
11
+ }
12
+ `;
13
+ function s() {
14
+ if (typeof document > "u" || document.getElementById(u)) return;
15
+ const e = document.createElement("style");
16
+ e.id = u, e.textContent = m, document.head.appendChild(e);
17
+ }
18
+ function a(e) {
19
+ return e ? e.includes(":") || e.includes("/") ? e.replace("/", ":") : e in l ? l[e] : `mdi:${e}` : "";
20
+ }
21
+ function v(e) {
22
+ const t = {};
23
+ if (e.size) {
24
+ const n = typeof e.size == "number" ? `${e.size}px` : e.size;
25
+ t.width = n, t.height = n, t.fontSize = n;
26
+ }
27
+ return e.color && (t.color = e.color), e.rotate && !e.spin && (t.transform = `rotate(${e.rotate}deg)`), Object.keys(t).length > 0 ? t : void 0;
28
+ }
29
+ const h = f({
30
+ name: "YhIconIconify",
31
+ inheritAttrs: !1,
32
+ props: {
33
+ /**
34
+ * 图标名称
35
+ * 支持格式:
36
+ * - 简写名称(如:'home', 'search')
37
+ * - 带前缀的图标名(如:'mdi:home', 'ep:search')
38
+ */
39
+ name: {
40
+ type: String,
41
+ default: ""
42
+ },
43
+ /**
44
+ * 直接使用 Iconify 图标(优先级高于 name)
45
+ */
46
+ icon: {
47
+ type: String,
48
+ default: ""
49
+ },
50
+ /**
51
+ * SVG 字符串(直接渲染 SVG)
52
+ */
53
+ svg: {
54
+ type: String,
55
+ default: ""
56
+ },
57
+ /**
58
+ * 图标组件(传入 Vue 组件)
59
+ */
60
+ component: {
61
+ type: [Object, Function],
62
+ default: void 0
63
+ },
64
+ /**
65
+ * 图标尺寸
66
+ */
67
+ size: {
68
+ type: [Number, String],
69
+ default: void 0
70
+ },
71
+ /**
72
+ * 图标颜色
73
+ */
74
+ color: {
75
+ type: String,
76
+ default: void 0
77
+ },
78
+ /**
79
+ * 是否启用旋转动画
80
+ */
81
+ spin: {
82
+ type: Boolean,
83
+ default: !1
84
+ },
85
+ /**
86
+ * 旋转角度(度数)
87
+ */
88
+ rotate: {
89
+ type: Number,
90
+ default: 0
91
+ }
92
+ },
93
+ setup(e, { attrs: t }) {
94
+ d(() => {
95
+ e.spin && s();
96
+ });
97
+ const n = r(() => e.icon ? a(e.icon) : e.name ? a(e.name) : ""), i = r(
98
+ () => v({
99
+ size: e.size,
100
+ color: e.color,
101
+ rotate: e.rotate,
102
+ spin: e.spin
103
+ })
104
+ ), o = r(() => e.spin ? "yh-icons--spin" : "");
105
+ return () => (e.spin && s(), e.component ? c(e.component, {
106
+ class: o.value,
107
+ style: i.value,
108
+ ...t
109
+ }) : e.svg ? c("svg", {
110
+ class: o.value,
111
+ style: i.value,
112
+ viewBox: "0 0 24 24",
113
+ xmlns: "http://www.w3.org/2000/svg",
114
+ "aria-hidden": "true",
115
+ innerHTML: e.svg,
116
+ ...t
117
+ }) : n.value ? c(y, {
118
+ icon: n.value,
119
+ class: o.value,
120
+ style: i.value,
121
+ ...t
122
+ }) : c("span", {
123
+ class: ["yh-icon", o.value],
124
+ style: i.value,
125
+ ...t
126
+ }));
127
+ }
128
+ }), z = h;
129
+ export {
130
+ z as Icon,
131
+ h as YhIcon
132
+ };