@test-icons/vue-next 0.0.11 → 0.0.12

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.
@@ -2,5 +2,5 @@
2
2
  * @file ACane 拐杖
3
3
  * @author Auto Generated by HaierIcons
4
4
  */
5
- declare const _default: VueConstructor<import("../runtime").IIconInstance>;
5
+ declare const _default: any;
6
6
  export default _default;
@@ -7,7 +7,7 @@ import { h } from 'vue';
7
7
  /* tslint:disable: max-line-length */
8
8
  /* eslint-disable max-len */
9
9
  import { IconWrapper } from '../runtime';
10
- export default IconWrapper('a-cane', true, (h, props) => h("svg", {
10
+ export default IconWrapper('a-cane', true, props => h("svg", {
11
11
  "attrs": {
12
12
  "width": props.size,
13
13
  "height": props.size,
@@ -2,5 +2,5 @@
2
2
  * @file Abdominal 腹部
3
3
  * @author Auto Generated by HaierIcons
4
4
  */
5
- declare const _default: VueConstructor<import("../runtime").IIconInstance>;
5
+ declare const _default: any;
6
6
  export default _default;
@@ -7,7 +7,7 @@ import { h } from 'vue';
7
7
  /* tslint:disable: max-line-length */
8
8
  /* eslint-disable max-len */
9
9
  import { IconWrapper } from '../runtime';
10
- export default IconWrapper('abdominal', false, (h, props) => h("svg", {
10
+ export default IconWrapper('abdominal', false, props => h("svg", {
11
11
  "attrs": {
12
12
  "width": props.size,
13
13
  "height": props.size,
@@ -2,5 +2,5 @@
2
2
  * @file Buou 布偶猫
3
3
  * @author Auto Generated by HaierIcons
4
4
  */
5
- declare const _default: VueConstructor<import("../runtime").IIconInstance>;
5
+ declare const _default: any;
6
6
  export default _default;
@@ -7,7 +7,7 @@ import { h } from 'vue';
7
7
  /* tslint:disable: max-line-length */
8
8
  /* eslint-disable max-len */
9
9
  import { IconWrapper } from '../runtime';
10
- export default IconWrapper('buou', false, (h, props) => h("svg", {
10
+ export default IconWrapper('buou', false, props => h("svg", {
11
11
  "attrs": {
12
12
  "t": "1781682016103",
13
13
  "viewBox": "0 0 1024 1024",
@@ -2,5 +2,5 @@
2
2
  * @file Juanxincai 卷心菜
3
3
  * @author Auto Generated by HaierIcons
4
4
  */
5
- declare const _default: VueConstructor<import("../runtime").IIconInstance>;
5
+ declare const _default: any;
6
6
  export default _default;
@@ -7,7 +7,7 @@ import { h } from 'vue';
7
7
  /* tslint:disable: max-line-length */
8
8
  /* eslint-disable max-len */
9
9
  import { IconWrapper } from '../runtime';
10
- export default IconWrapper('juanxincai', false, (h, props) => h("svg", {
10
+ export default IconWrapper('juanxincai', false, props => h("svg", {
11
11
  "attrs": {
12
12
  "t": "1781681840975",
13
13
  "viewBox": "0 0 1024 1024",
@@ -2,5 +2,5 @@
2
2
  * @file Lachang 腊肠
3
3
  * @author Auto Generated by HaierIcons
4
4
  */
5
- declare const _default: VueConstructor<import("../runtime").IIconInstance>;
5
+ declare const _default: any;
6
6
  export default _default;
@@ -7,7 +7,7 @@ import { h } from 'vue';
7
7
  /* tslint:disable: max-line-length */
8
8
  /* eslint-disable max-len */
9
9
  import { IconWrapper } from '../runtime';
10
- export default IconWrapper('lachang', false, (h, props) => h("svg", {
10
+ export default IconWrapper('lachang', false, props => h("svg", {
11
11
  "attrs": {
12
12
  "t": "1781686054355",
13
13
  "viewBox": "0 0 1024 1024",
@@ -2,5 +2,5 @@
2
2
  * @file Quanji 拳击
3
3
  * @author Auto Generated by HaierIcons
4
4
  */
5
- declare const _default: VueConstructor<import("../runtime").IIconInstance>;
5
+ declare const _default: any;
6
6
  export default _default;
@@ -7,7 +7,7 @@ import { h } from 'vue';
7
7
  /* tslint:disable: max-line-length */
8
8
  /* eslint-disable max-len */
9
9
  import { IconWrapper } from '../runtime';
10
- export default IconWrapper('quanji', false, (h, props) => h("svg", {
10
+ export default IconWrapper('quanji', false, props => h("svg", {
11
11
  "attrs": {
12
12
  "t": "1781686156830",
13
13
  "viewBox": "0 0 1024 1024",
@@ -0,0 +1,11 @@
1
+ export declare const DEFAULT_ICON_CONFIGS: {
2
+ size: string;
3
+ rtl: boolean;
4
+ prefix: string;
5
+ };
6
+ export interface ISvgIconProps {
7
+ id: string;
8
+ size: number | string;
9
+ }
10
+ export declare function IconConverter(id: string, icon: any, config: any): ISvgIconProps;
11
+ export declare function IconWrapper(name: string, rtl: boolean, render: (props: ISvgIconProps) => any): any;
@@ -1,28 +1,9 @@
1
+ import { h } from 'vue';
1
2
  /**
2
- * @file runtime 运行时
3
+ * @file runtime 运行时 (Vue 3)
3
4
  * @author Auto Generated by HaierIcons
4
5
  */
5
-
6
- import { h } from 'vue';
7
-
8
- // 包裹前的图标属性
9
-
10
- // 图标配置属性
11
-
12
- // 图标基础属性
13
-
14
- // 包裹后的图标属性
15
-
16
- // 渲染Help函数属性
17
-
18
- // 包裹前的图标实例
19
-
20
- // 包裹后的图标属性
21
- // eslint-disable-next-line max-len
22
-
23
- // 包裹前的图标渲染器
24
-
25
- // 包裹后的图标
6
+ import { defineComponent, inject, h } from 'vue';
26
7
 
27
8
  // 默认属性
28
9
  export var DEFAULT_ICON_CONFIGS = {
@@ -42,39 +23,38 @@ export function IconConverter(id, icon, config) {
42
23
  };
43
24
  }
44
25
 
45
- // 图标Wrapper
26
+ // 图标 Wrapper(Vue 3 Composition API)
46
27
  export function IconWrapper(name, rtl, render) {
47
- var options = {
28
+ return defineComponent({
48
29
  name: 'icon-' + name,
49
- inject: ['ICON_CONFIGS'],
50
- props: ['size', 'spin'],
51
- data() {
52
- return {
53
- id: guid()
54
- };
55
- },
56
- inheritAttrs: false,
57
- render() {
58
- var size = this.size,
59
- id = this.id,
60
- spin = this.spin,
61
- _this$ICON_CONFIGS = this.ICON_CONFIGS,
62
- ICON_CONFIGS = _this$ICON_CONFIGS === void 0 ? DEFAULT_ICON_CONFIGS : _this$ICON_CONFIGS;
63
- var svgProps = IconConverter(id, {
64
- size
65
- }, ICON_CONFIGS);
66
- var cls = ['hi-icon'];
67
- cls.push('hi-icon' + '-' + name);
68
- if (rtl && ICON_CONFIGS.rtl) {
69
- cls.push('hi-icon-rtl');
30
+ props: {
31
+ size: {
32
+ type: [String, Number],
33
+ default: undefined
34
+ },
35
+ spin: {
36
+ type: Boolean,
37
+ default: false
70
38
  }
71
- if (spin) {
72
- cls.push('hi-icon-spin');
73
- }
74
- return h("span", {
75
- "class": cls.join(' ')
76
- }, [render(h, svgProps)]);
39
+ },
40
+ setup(props) {
41
+ var ICON_CONFIGS = inject('ICON_CONFIGS', DEFAULT_ICON_CONFIGS);
42
+ var id = guid();
43
+ return () => {
44
+ var svgProps = IconConverter(id, {
45
+ size: props.size
46
+ }, ICON_CONFIGS);
47
+ var cls = ['hi-icon', 'hi-icon-' + name];
48
+ if (rtl && ICON_CONFIGS.rtl) {
49
+ cls.push('hi-icon-rtl');
50
+ }
51
+ if (props.spin) {
52
+ cls.push('hi-icon-spin');
53
+ }
54
+ return h('span', {
55
+ class: cls.join(' ')
56
+ }, [render(svgProps)]);
57
+ };
77
58
  }
78
- };
79
- return options;
59
+ });
80
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@test-icons/vue-next",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "Haier icon library - vue-next components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",