yc-pro-components 0.0.5 → 0.0.7

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.
Files changed (187) hide show
  1. package/es/components/check-card/index.d.ts +57 -57
  2. package/es/components/check-card/src/index.vue.d.ts +14 -14
  3. package/es/components/check-card-group/index.d.ts +22 -22
  4. package/es/components/check-card-group/src/index.vue.d.ts +19 -19
  5. package/es/components/date-picker/index.d.ts +1 -1
  6. package/es/components/date-picker/src/index.vue.d.ts +1 -1
  7. package/es/components/descriptions/index.d.ts +39 -39
  8. package/es/components/descriptions/src/index.vue.d.ts +2 -2
  9. package/es/components/dialog/index.d.ts +19 -19
  10. package/es/components/dialog/src/index.vue.d.ts +1 -1
  11. package/es/components/dialog-form/index.d.ts +47 -47
  12. package/es/components/dialog-form/src/index.vue.d.ts +7 -7
  13. package/es/components/display-item/index.d.ts +12 -12
  14. package/es/components/display-item/src/index.vue.d.ts +12 -12
  15. package/es/components/drawer-form/index.d.ts +28 -28
  16. package/es/components/drawer-form/src/index.vue.d.ts +6 -6
  17. package/es/components/form/index.d.ts +107 -107
  18. package/es/components/form/src/form-content.vue.d.ts +17 -17
  19. package/es/components/form/src/index.vue.d.ts +16 -16
  20. package/es/components/form-item/index.d.ts +106 -106
  21. package/es/components/form-item/src/index.vue.d.ts +14 -14
  22. package/es/components/header/index.d.ts +19 -19
  23. package/es/components/header/src/index.vue.d.ts +1 -1
  24. package/es/components/index.d.ts +0 -1
  25. package/es/components/index.mjs +0 -2
  26. package/es/components/input-tag/index.d.ts +11 -11
  27. package/es/components/input-tag/src/index.vue.d.ts +3 -3
  28. package/es/components/page/index.d.ts +900 -900
  29. package/es/components/page/src/index.vue.d.ts +289 -289
  30. package/es/components/pagination/index.d.ts +4 -4
  31. package/es/components/pagination/src/index.vue.d.ts +1 -1
  32. package/es/components/radio/index.d.ts +26 -26
  33. package/es/components/radio/src/index.vue.d.ts +26 -26
  34. package/es/components/render/index.d.ts +17 -17
  35. package/es/components/render/src/index.vue.d.ts +2 -2
  36. package/es/components/search/index.d.ts +328 -328
  37. package/es/components/search/src/index.vue.d.ts +95 -95
  38. package/es/components/steps-form/index.d.ts +23 -23
  39. package/es/components/steps-form/src/index.vue.d.ts +2 -2
  40. package/es/components/table/index.d.ts +74 -74
  41. package/es/components/table/src/index.vue.d.ts +19 -19
  42. package/es/components/table/src/table-action-bar.vue.d.ts +3 -3
  43. package/es/components/table/src/table-column-drag-sort.vue.d.ts +18 -18
  44. package/es/components/table/src/table-column.vue.d.ts +12 -12
  45. package/es/components/utils/index.d.ts +15 -15
  46. package/es/components/yc-count-to/index.d.ts +1 -1
  47. package/es/components/yc-count-to/src/normal/index.d.ts +1 -1
  48. package/es/components/yc-download-dialog/index.d.ts +19 -19
  49. package/es/components/yc-download-dialog/src/index.vue.d.ts +1 -1
  50. package/es/components/yc-drawer/store.d.ts +6 -6
  51. package/es/components/yc-form-container-header/index.d.ts +12 -12
  52. package/es/components/yc-more-actions/index.d.ts +46 -46
  53. package/es/components/yc-more-actions/src/index.vue.d.ts +3 -3
  54. package/es/components/yc-plus-page/src/index.vue.d.ts +677 -677
  55. package/es/components/yc-plus-tree/src/index.vue.d.ts +1 -1
  56. package/es/components/yc-segmented/index.d.ts +1 -1
  57. package/es/components/yc-segmented/src/index.d.ts +1 -1
  58. package/es/components/yc-select-v2/src/index.vue.d.ts +3 -3
  59. package/es/components/yc-status-dialog/src/index.vue.d.ts +2 -2
  60. package/es/components/yc-status-dialog/src/index.vue.mjs +1 -1
  61. package/es/components/yc-text/src/index.vue.d.ts +2 -2
  62. package/es/hooks/usePlusFormReset.d.ts +193 -193
  63. package/es/index.css +2 -2
  64. package/es/index.mjs +0 -2
  65. package/index.css +19 -14
  66. package/index.js +10 -2049
  67. package/index.min.css +2 -2
  68. package/index.min.js +7 -7
  69. package/index.min.mjs +7 -7
  70. package/index.mjs +11 -2043
  71. package/lib/components/check-card/index.d.ts +57 -57
  72. package/lib/components/check-card/src/index.vue.d.ts +14 -14
  73. package/lib/components/check-card-group/index.d.ts +22 -22
  74. package/lib/components/check-card-group/src/index.vue.d.ts +19 -19
  75. package/lib/components/date-picker/index.d.ts +1 -1
  76. package/lib/components/date-picker/src/index.vue.d.ts +1 -1
  77. package/lib/components/descriptions/index.d.ts +39 -39
  78. package/lib/components/descriptions/src/index.vue.d.ts +2 -2
  79. package/lib/components/dialog/index.d.ts +19 -19
  80. package/lib/components/dialog/src/index.vue.d.ts +1 -1
  81. package/lib/components/dialog-form/index.d.ts +47 -47
  82. package/lib/components/dialog-form/src/index.vue.d.ts +7 -7
  83. package/lib/components/display-item/index.d.ts +12 -12
  84. package/lib/components/display-item/src/index.vue.d.ts +12 -12
  85. package/lib/components/drawer-form/index.d.ts +28 -28
  86. package/lib/components/drawer-form/src/index.vue.d.ts +6 -6
  87. package/lib/components/form/index.d.ts +107 -107
  88. package/lib/components/form/src/form-content.vue.d.ts +17 -17
  89. package/lib/components/form/src/index.vue.d.ts +16 -16
  90. package/lib/components/form-item/index.d.ts +106 -106
  91. package/lib/components/form-item/src/index.vue.d.ts +14 -14
  92. package/lib/components/header/index.d.ts +19 -19
  93. package/lib/components/header/src/index.vue.d.ts +1 -1
  94. package/lib/components/index.d.ts +0 -1
  95. package/lib/components/index.js +10 -19
  96. package/lib/components/input-tag/index.d.ts +11 -11
  97. package/lib/components/input-tag/src/index.vue.d.ts +3 -3
  98. package/lib/components/page/index.d.ts +900 -900
  99. package/lib/components/page/src/index.vue.d.ts +289 -289
  100. package/lib/components/pagination/index.d.ts +4 -4
  101. package/lib/components/pagination/src/index.vue.d.ts +1 -1
  102. package/lib/components/radio/index.d.ts +26 -26
  103. package/lib/components/radio/src/index.vue.d.ts +26 -26
  104. package/lib/components/render/index.d.ts +17 -17
  105. package/lib/components/render/src/index.vue.d.ts +2 -2
  106. package/lib/components/search/index.d.ts +328 -328
  107. package/lib/components/search/src/index.vue.d.ts +95 -95
  108. package/lib/components/steps-form/index.d.ts +23 -23
  109. package/lib/components/steps-form/src/index.vue.d.ts +2 -2
  110. package/lib/components/table/index.d.ts +74 -74
  111. package/lib/components/table/src/index.vue.d.ts +19 -19
  112. package/lib/components/table/src/table-action-bar.vue.d.ts +3 -3
  113. package/lib/components/table/src/table-column-drag-sort.vue.d.ts +18 -18
  114. package/lib/components/table/src/table-column.vue.d.ts +12 -12
  115. package/lib/components/utils/index.d.ts +15 -15
  116. package/lib/components/yc-count-to/index.d.ts +1 -1
  117. package/lib/components/yc-count-to/src/normal/index.d.ts +1 -1
  118. package/lib/components/yc-download-dialog/index.d.ts +19 -19
  119. package/lib/components/yc-download-dialog/src/index.vue.d.ts +1 -1
  120. package/lib/components/yc-drawer/store.d.ts +6 -6
  121. package/lib/components/yc-form-container-header/index.d.ts +12 -12
  122. package/lib/components/yc-more-actions/index.d.ts +46 -46
  123. package/lib/components/yc-more-actions/src/index.vue.d.ts +3 -3
  124. package/lib/components/yc-plus-page/src/index.vue.d.ts +677 -677
  125. package/lib/components/yc-plus-tree/src/index.vue.d.ts +1 -1
  126. package/lib/components/yc-segmented/index.d.ts +1 -1
  127. package/lib/components/yc-segmented/src/index.d.ts +1 -1
  128. package/lib/components/yc-select-v2/src/index.vue.d.ts +3 -3
  129. package/lib/components/yc-status-dialog/src/index.vue.d.ts +2 -2
  130. package/lib/components/yc-status-dialog/src/index.vue.js +1 -1
  131. package/lib/components/yc-text/src/index.vue.d.ts +2 -2
  132. package/lib/hooks/usePlusFormReset.d.ts +193 -193
  133. package/lib/index.css +2 -2
  134. package/lib/index.js +10 -19
  135. package/locale/en.js +1 -1
  136. package/locale/en.min.js +1 -1
  137. package/locale/en.min.mjs +1 -1
  138. package/locale/en.mjs +1 -1
  139. package/locale/ja.js +1 -1
  140. package/locale/ja.min.js +1 -1
  141. package/locale/ja.min.mjs +1 -1
  142. package/locale/ja.mjs +1 -1
  143. package/locale/ko.js +1 -1
  144. package/locale/ko.min.js +1 -1
  145. package/locale/ko.min.mjs +1 -1
  146. package/locale/ko.mjs +1 -1
  147. package/locale/zh-cn.js +1 -1
  148. package/locale/zh-cn.min.js +1 -1
  149. package/locale/zh-cn.min.mjs +1 -1
  150. package/locale/zh-cn.mjs +1 -1
  151. package/locale/zh-tw.js +1 -1
  152. package/locale/zh-tw.min.js +1 -1
  153. package/locale/zh-tw.min.mjs +1 -1
  154. package/locale/zh-tw.mjs +1 -1
  155. package/package.json +1 -2
  156. package/theme-chalk/index.css +1 -1
  157. package/theme-chalk/plus-yc-line-tree.css +1 -0
  158. package/theme-chalk/plus-yc-plus-tree.css +1 -1
  159. package/theme-chalk/plus-yc-status-dialog.css +1 -1
  160. package/theme-chalk/src/index.scss +1 -0
  161. package/theme-chalk/src/yc-line-tree.scss +64 -0
  162. package/theme-chalk/src/yc-plus-tree.scss +102 -0
  163. package/theme-chalk/src/yc-status-dialog.scss +7 -4
  164. package/es/components/yc-icon/index.d.ts +0 -49
  165. package/es/components/yc-icon/index.mjs +0 -10
  166. package/es/components/yc-icon/src/hooks.d.ts +0 -11
  167. package/es/components/yc-icon/src/hooks.mjs +0 -80
  168. package/es/components/yc-icon/src/iconfont.d.ts +0 -21
  169. package/es/components/yc-icon/src/iconfont.mjs +0 -45
  170. package/es/components/yc-icon/src/iconifyIconOffline.d.ts +0 -34
  171. package/es/components/yc-icon/src/iconifyIconOffline.mjs +0 -51
  172. package/es/components/yc-icon/src/iconifyIconOnline.d.ts +0 -19
  173. package/es/components/yc-icon/src/iconifyIconOnline.mjs +0 -30
  174. package/es/components/yc-icon/src/types.d.ts +0 -35
  175. package/es/components/yc-icon/src/types.mjs +0 -1
  176. package/lib/components/yc-icon/index.d.ts +0 -49
  177. package/lib/components/yc-icon/index.js +0 -18
  178. package/lib/components/yc-icon/src/hooks.d.ts +0 -11
  179. package/lib/components/yc-icon/src/hooks.js +0 -82
  180. package/lib/components/yc-icon/src/iconfont.d.ts +0 -21
  181. package/lib/components/yc-icon/src/iconfont.js +0 -49
  182. package/lib/components/yc-icon/src/iconifyIconOffline.d.ts +0 -34
  183. package/lib/components/yc-icon/src/iconifyIconOffline.js +0 -55
  184. package/lib/components/yc-icon/src/iconifyIconOnline.d.ts +0 -19
  185. package/lib/components/yc-icon/src/iconifyIconOnline.js +0 -34
  186. package/lib/components/yc-icon/src/types.d.ts +0 -35
  187. package/lib/components/yc-icon/src/types.js +0 -2
@@ -6,17 +6,20 @@
6
6
  }
7
7
 
8
8
  .yc-status-dialog {
9
+ // 使用 dialog 本身的 padding 控制内边距
10
+ padding: 16px !important;
11
+
9
12
  .el-dialog__header {
10
- padding: 24px 24px 16px;
11
- margin: 0;
13
+ padding: 0 !important;
14
+ margin: 0 !important;
12
15
  }
13
16
 
14
17
  .el-dialog__body {
15
- padding: 0 24px 24px;
18
+ padding: 0 !important;
16
19
  }
17
20
 
18
21
  .el-dialog__footer {
19
- padding: 0 24px 24px;
22
+ padding: 16px 0 0 !important;
20
23
  }
21
24
 
22
25
  .dialog-header {
@@ -1,49 +0,0 @@
1
- import { IconifyIconData } from './src/iconifyIconOffline';
2
- import { DefineComponent, PropType, Component, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
3
- /** 本地图标组件 */
4
- declare const YcIconifyIconOffline: DefineComponent<{
5
- icon: {
6
- type: PropType<string | Component | IconifyIconData>;
7
- default: null;
8
- };
9
- }, unknown, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
10
- icon: {
11
- type: PropType<string | Component | IconifyIconData>;
12
- default: null;
13
- };
14
- }>>, {
15
- icon: string | Component | IconifyIconData;
16
- }, {}>;
17
- /** 在线图标组件 */
18
- declare const YcIconifyIconOnline: DefineComponent<{
19
- icon: {
20
- type: StringConstructor;
21
- default: string;
22
- };
23
- }, unknown, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
24
- icon: {
25
- type: StringConstructor;
26
- default: string;
27
- };
28
- }>>, {
29
- icon: string;
30
- }, {}>;
31
- /** iconfont 组件 */
32
- declare const YcFontIcon: DefineComponent<{
33
- icon: {
34
- type: StringConstructor;
35
- default: string;
36
- };
37
- }, unknown, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
38
- icon: {
39
- type: StringConstructor;
40
- default: string;
41
- };
42
- }>>, {
43
- icon: string;
44
- }, {}>;
45
- export { YcIconifyIconOffline, YcIconifyIconOnline, YcFontIcon };
46
- export { useRenderIcon } from './src/hooks';
47
- export type { YcIconType } from './src/types';
48
- export type { IconifyIconData } from './src/iconifyIconOffline';
49
- export { YcIconifyIconOffline as IconifyIconOffline, YcIconifyIconOnline as IconifyIconOnline, YcFontIcon as FontIcon };
@@ -1,10 +0,0 @@
1
- import IconifyIconOffline from './src/iconifyIconOffline.mjs';
2
- import IconifyIconOnline from './src/iconifyIconOnline.mjs';
3
- import FontIcon from './src/iconfont.mjs';
4
- export { useRenderIcon } from './src/hooks.mjs';
5
-
6
- const YcIconifyIconOffline = IconifyIconOffline;
7
- const YcIconifyIconOnline = IconifyIconOnline;
8
- const YcFontIcon = FontIcon;
9
-
10
- export { YcFontIcon as FontIcon, YcIconifyIconOffline as IconifyIconOffline, YcIconifyIconOnline as IconifyIconOnline, YcFontIcon, YcIconifyIconOffline, YcIconifyIconOnline };
@@ -1,11 +0,0 @@
1
- import { Component } from 'vue';
2
- import { YcIconType } from './types';
3
-
4
- /**
5
- * 渲染图标的 Hook
6
- * 支持 iconfont、自定义 SVG、Iconify 以及 URL 中所有的图标
7
- * @param icon 必传 图标
8
- * @param attrs 可选 YcIconType 属性
9
- * @returns Component
10
- */
11
- export declare function useRenderIcon(icon: string | Component | Record<string, unknown>, attrs?: YcIconType): Component | undefined;
@@ -1,80 +0,0 @@
1
- import { defineComponent, h } from 'vue';
2
- import FontIcon from './iconfont.mjs';
3
- import IconifyIconOnline from './iconifyIconOnline.mjs';
4
- import IconifyIconOffline from './iconifyIconOffline.mjs';
5
- import { isString } from 'lodash-es';
6
-
7
- function isUrlIcon(icon) {
8
- return /^https?:\/\//i.test(icon);
9
- }
10
- const UrlIconComponent = defineComponent({
11
- name: "YcUrlIcon",
12
- props: {
13
- src: { type: String, required: true },
14
- size: { type: Number, default: 20 }
15
- },
16
- render() {
17
- return h("img", {
18
- src: this.src,
19
- class: "yc-url-icon",
20
- style: {
21
- width: `${this.size}px`,
22
- height: `${this.size}px`,
23
- objectFit: "contain"
24
- },
25
- alt: "icon"
26
- });
27
- }
28
- });
29
- function useRenderIcon(icon, attrs) {
30
- const ifReg = /^IF-/;
31
- if (isString(icon) && isUrlIcon(icon)) {
32
- const attrSize = (attrs == null ? void 0 : attrs.width) || (attrs == null ? void 0 : attrs.height);
33
- const size = typeof attrSize === "number" ? attrSize : 20;
34
- return h(UrlIconComponent, { src: icon, size });
35
- }
36
- if (isString(icon) && ifReg.test(icon)) {
37
- const name = icon.split(ifReg)[1];
38
- const iconName = name.slice(
39
- 0,
40
- name.indexOf(" ") == -1 ? name.length : name.indexOf(" ")
41
- );
42
- const iconType = name.slice(name.indexOf(" ") + 1, name.length);
43
- return defineComponent({
44
- name: "YcFontIconWrapper",
45
- render() {
46
- return h(FontIcon, {
47
- icon: iconName,
48
- iconType,
49
- ...attrs
50
- });
51
- }
52
- });
53
- } else if (typeof icon === "function" || typeof (icon == null ? void 0 : icon.render) === "function") {
54
- return attrs ? h(icon, { ...attrs }) : icon;
55
- } else if (typeof icon === "object") {
56
- return defineComponent({
57
- name: "YcOfflineIconWrapper",
58
- render() {
59
- return h(IconifyIconOffline, {
60
- icon,
61
- ...attrs
62
- });
63
- }
64
- });
65
- } else {
66
- return defineComponent({
67
- name: "YcIconWrapper",
68
- render() {
69
- if (!icon) return;
70
- const IconComponent = icon.includes(":") ? IconifyIconOnline : IconifyIconOffline;
71
- return h(IconComponent, {
72
- icon,
73
- ...attrs
74
- });
75
- }
76
- });
77
- }
78
- }
79
-
80
- export { useRenderIcon };
@@ -1,21 +0,0 @@
1
- import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
- /**
3
- * iconfont 组件
4
- * 封装 iconfont,默认 font-class 引用模式
5
- * 支持 unicode 引用、font-class 引用、symbol 引用
6
- * @see https://www.iconfont.cn/help/detail?helptype=code
7
- */
8
- declare const _default: DefineComponent<{
9
- icon: {
10
- type: StringConstructor;
11
- default: string;
12
- };
13
- }, unknown, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
14
- icon: {
15
- type: StringConstructor;
16
- default: string;
17
- };
18
- }>>, {
19
- icon: string;
20
- }, {}>;
21
- export default _default;
@@ -1,45 +0,0 @@
1
- import { defineComponent, h } from 'vue';
2
-
3
- var FontIcon = defineComponent({
4
- name: "YcFontIcon",
5
- props: {
6
- icon: {
7
- type: String,
8
- default: ""
9
- }
10
- },
11
- render() {
12
- const attrs = this.$attrs;
13
- if (Object.keys(attrs).includes("uni") || (attrs == null ? void 0 : attrs.iconType) === "uni") {
14
- return h(
15
- "i",
16
- {
17
- class: "iconfont",
18
- ...attrs
19
- },
20
- this.icon
21
- );
22
- } else if (Object.keys(attrs).includes("svg") || (attrs == null ? void 0 : attrs.iconType) === "svg") {
23
- return h(
24
- "svg",
25
- {
26
- class: "icon-svg"
27
- },
28
- {
29
- default: () => [
30
- h("use", {
31
- "xlink:href": `#${this.icon}`
32
- })
33
- ]
34
- }
35
- );
36
- } else {
37
- return h("i", {
38
- class: `iconfont ${this.icon}`,
39
- ...attrs
40
- });
41
- }
42
- }
43
- });
44
-
45
- export { FontIcon as default };
@@ -1,34 +0,0 @@
1
- import { PropType, Component, DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
-
3
- /**
4
- * Iconify 图标数据接口
5
- */
6
- export interface IconifyIconData {
7
- body: string;
8
- width?: number;
9
- height?: number;
10
- left?: number;
11
- top?: number;
12
- rotate?: number;
13
- hFlip?: boolean;
14
- vFlip?: boolean;
15
- }
16
- type IconType = string | IconifyIconData | Component;
17
- /**
18
- * Iconify 离线图标组件
19
- * 用于内网环境,从本地加载图标
20
- */
21
- declare const _default: DefineComponent<{
22
- icon: {
23
- type: PropType<IconType>;
24
- default: null;
25
- };
26
- }, unknown, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
27
- icon: {
28
- type: PropType<IconType>;
29
- default: null;
30
- };
31
- }>>, {
32
- icon: IconType;
33
- }, {}>;
34
- export default _default;
@@ -1,51 +0,0 @@
1
- import { defineComponent, h } from 'vue';
2
- import { Icon, addIcon } from '@iconify/vue';
3
-
4
- function isIconifyIconData(icon) {
5
- return typeof icon === "object" && icon !== null && "body" in icon && typeof icon.body === "string";
6
- }
7
- var IconifyIconOffline = defineComponent({
8
- name: "YcIconifyIconOffline",
9
- components: { IconifyIcon: Icon },
10
- props: {
11
- icon: {
12
- type: [String, Object, Function],
13
- default: null
14
- }
15
- },
16
- render() {
17
- if (isIconifyIconData(this.icon)) {
18
- const iconName = this.icon.name || "custom-icon";
19
- addIcon(iconName, this.icon);
20
- }
21
- const attrs = this.$attrs;
22
- if (typeof this.icon === "string") {
23
- return h(
24
- Icon,
25
- {
26
- icon: this.icon,
27
- "aria-hidden": false,
28
- style: (attrs == null ? void 0 : attrs.style) ? Object.assign(attrs.style, { outline: "none" }) : { outline: "none" },
29
- ...attrs
30
- },
31
- {
32
- default: () => []
33
- }
34
- );
35
- } else {
36
- return h(
37
- this.icon,
38
- {
39
- "aria-hidden": false,
40
- style: (attrs == null ? void 0 : attrs.style) ? Object.assign(attrs.style, { outline: "none" }) : { outline: "none" },
41
- ...attrs
42
- },
43
- {
44
- default: () => []
45
- }
46
- );
47
- }
48
- }
49
- });
50
-
51
- export { IconifyIconOffline as default };
@@ -1,19 +0,0 @@
1
- import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
- /**
3
- * Iconify 在线图标组件
4
- * 用于外网环境,从 CDN 加载图标
5
- */
6
- declare const _default: DefineComponent<{
7
- icon: {
8
- type: StringConstructor;
9
- default: string;
10
- };
11
- }, unknown, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
12
- icon: {
13
- type: StringConstructor;
14
- default: string;
15
- };
16
- }>>, {
17
- icon: string;
18
- }, {}>;
19
- export default _default;
@@ -1,30 +0,0 @@
1
- import { defineComponent, h } from 'vue';
2
- import { Icon } from '@iconify/vue';
3
-
4
- var IconifyIconOnline = defineComponent({
5
- name: "YcIconifyIconOnline",
6
- components: { IconifyIcon: Icon },
7
- props: {
8
- icon: {
9
- type: String,
10
- default: ""
11
- }
12
- },
13
- render() {
14
- const attrs = this.$attrs;
15
- return h(
16
- Icon,
17
- {
18
- icon: `${this.icon}`,
19
- "aria-hidden": false,
20
- style: (attrs == null ? void 0 : attrs.style) ? Object.assign(attrs.style, { outline: "none" }) : { outline: "none" },
21
- ...attrs
22
- },
23
- {
24
- default: () => []
25
- }
26
- );
27
- }
28
- });
29
-
30
- export { IconifyIconOnline as default };
@@ -1,35 +0,0 @@
1
- /**
2
- * 图标属性类型
3
- * @see https://docs.iconify.design/icon-components/vue/#properties
4
- */
5
- export interface YcIconType {
6
- /** 是否内联显示 */
7
- inline?: boolean;
8
- /** 图标宽度 */
9
- width?: string | number;
10
- /** 图标高度 */
11
- height?: string | number;
12
- /** 水平翻转 */
13
- horizontalFlip?: boolean;
14
- /** 垂直翻转 */
15
- verticalFlip?: boolean;
16
- /** 翻转方向 */
17
- flip?: string;
18
- /** 旋转角度 */
19
- rotate?: number | string;
20
- /** 颜色 */
21
- color?: string;
22
- /** 水平对齐 */
23
- horizontalAlign?: boolean;
24
- /** 垂直对齐 */
25
- verticalAlign?: boolean;
26
- /** 对齐方式 */
27
- align?: string;
28
- /** 加载完成回调 */
29
- onLoad?: Function;
30
- includes?: Function;
31
- /** SVG 填充色 */
32
- fill?: string;
33
- /** 样式对象 */
34
- style?: object;
35
- }
@@ -1 +0,0 @@
1
-
@@ -1,49 +0,0 @@
1
- import { IconifyIconData } from './src/iconifyIconOffline';
2
- import { DefineComponent, PropType, Component, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
3
- /** 本地图标组件 */
4
- declare const YcIconifyIconOffline: DefineComponent<{
5
- icon: {
6
- type: PropType<string | Component | IconifyIconData>;
7
- default: null;
8
- };
9
- }, unknown, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
10
- icon: {
11
- type: PropType<string | Component | IconifyIconData>;
12
- default: null;
13
- };
14
- }>>, {
15
- icon: string | Component | IconifyIconData;
16
- }, {}>;
17
- /** 在线图标组件 */
18
- declare const YcIconifyIconOnline: DefineComponent<{
19
- icon: {
20
- type: StringConstructor;
21
- default: string;
22
- };
23
- }, unknown, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
24
- icon: {
25
- type: StringConstructor;
26
- default: string;
27
- };
28
- }>>, {
29
- icon: string;
30
- }, {}>;
31
- /** iconfont 组件 */
32
- declare const YcFontIcon: DefineComponent<{
33
- icon: {
34
- type: StringConstructor;
35
- default: string;
36
- };
37
- }, unknown, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
38
- icon: {
39
- type: StringConstructor;
40
- default: string;
41
- };
42
- }>>, {
43
- icon: string;
44
- }, {}>;
45
- export { YcIconifyIconOffline, YcIconifyIconOnline, YcFontIcon };
46
- export { useRenderIcon } from './src/hooks';
47
- export type { YcIconType } from './src/types';
48
- export type { IconifyIconData } from './src/iconifyIconOffline';
49
- export { YcIconifyIconOffline as IconifyIconOffline, YcIconifyIconOnline as IconifyIconOnline, YcFontIcon as FontIcon };
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- var iconifyIconOffline = require('./src/iconifyIconOffline.js');
4
- var iconifyIconOnline = require('./src/iconifyIconOnline.js');
5
- var iconfont = require('./src/iconfont.js');
6
- var hooks = require('./src/hooks.js');
7
-
8
- const YcIconifyIconOffline = iconifyIconOffline.default;
9
- const YcIconifyIconOnline = iconifyIconOnline.default;
10
- const YcFontIcon = iconfont.default;
11
-
12
- exports.useRenderIcon = hooks.useRenderIcon;
13
- exports.FontIcon = YcFontIcon;
14
- exports.IconifyIconOffline = YcIconifyIconOffline;
15
- exports.IconifyIconOnline = YcIconifyIconOnline;
16
- exports.YcFontIcon = YcFontIcon;
17
- exports.YcIconifyIconOffline = YcIconifyIconOffline;
18
- exports.YcIconifyIconOnline = YcIconifyIconOnline;
@@ -1,11 +0,0 @@
1
- import { Component } from 'vue';
2
- import { YcIconType } from './types';
3
-
4
- /**
5
- * 渲染图标的 Hook
6
- * 支持 iconfont、自定义 SVG、Iconify 以及 URL 中所有的图标
7
- * @param icon 必传 图标
8
- * @param attrs 可选 YcIconType 属性
9
- * @returns Component
10
- */
11
- export declare function useRenderIcon(icon: string | Component | Record<string, unknown>, attrs?: YcIconType): Component | undefined;
@@ -1,82 +0,0 @@
1
- 'use strict';
2
-
3
- var vue = require('vue');
4
- var iconfont = require('./iconfont.js');
5
- var iconifyIconOnline = require('./iconifyIconOnline.js');
6
- var iconifyIconOffline = require('./iconifyIconOffline.js');
7
- var lodashEs = require('lodash-es');
8
-
9
- function isUrlIcon(icon) {
10
- return /^https?:\/\//i.test(icon);
11
- }
12
- const UrlIconComponent = vue.defineComponent({
13
- name: "YcUrlIcon",
14
- props: {
15
- src: { type: String, required: true },
16
- size: { type: Number, default: 20 }
17
- },
18
- render() {
19
- return vue.h("img", {
20
- src: this.src,
21
- class: "yc-url-icon",
22
- style: {
23
- width: `${this.size}px`,
24
- height: `${this.size}px`,
25
- objectFit: "contain"
26
- },
27
- alt: "icon"
28
- });
29
- }
30
- });
31
- function useRenderIcon(icon, attrs) {
32
- const ifReg = /^IF-/;
33
- if (lodashEs.isString(icon) && isUrlIcon(icon)) {
34
- const attrSize = (attrs == null ? void 0 : attrs.width) || (attrs == null ? void 0 : attrs.height);
35
- const size = typeof attrSize === "number" ? attrSize : 20;
36
- return vue.h(UrlIconComponent, { src: icon, size });
37
- }
38
- if (lodashEs.isString(icon) && ifReg.test(icon)) {
39
- const name = icon.split(ifReg)[1];
40
- const iconName = name.slice(
41
- 0,
42
- name.indexOf(" ") == -1 ? name.length : name.indexOf(" ")
43
- );
44
- const iconType = name.slice(name.indexOf(" ") + 1, name.length);
45
- return vue.defineComponent({
46
- name: "YcFontIconWrapper",
47
- render() {
48
- return vue.h(iconfont.default, {
49
- icon: iconName,
50
- iconType,
51
- ...attrs
52
- });
53
- }
54
- });
55
- } else if (typeof icon === "function" || typeof (icon == null ? void 0 : icon.render) === "function") {
56
- return attrs ? vue.h(icon, { ...attrs }) : icon;
57
- } else if (typeof icon === "object") {
58
- return vue.defineComponent({
59
- name: "YcOfflineIconWrapper",
60
- render() {
61
- return vue.h(iconifyIconOffline.default, {
62
- icon,
63
- ...attrs
64
- });
65
- }
66
- });
67
- } else {
68
- return vue.defineComponent({
69
- name: "YcIconWrapper",
70
- render() {
71
- if (!icon) return;
72
- const IconComponent = icon.includes(":") ? iconifyIconOnline.default : iconifyIconOffline.default;
73
- return vue.h(IconComponent, {
74
- icon,
75
- ...attrs
76
- });
77
- }
78
- });
79
- }
80
- }
81
-
82
- exports.useRenderIcon = useRenderIcon;
@@ -1,21 +0,0 @@
1
- import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
- /**
3
- * iconfont 组件
4
- * 封装 iconfont,默认 font-class 引用模式
5
- * 支持 unicode 引用、font-class 引用、symbol 引用
6
- * @see https://www.iconfont.cn/help/detail?helptype=code
7
- */
8
- declare const _default: DefineComponent<{
9
- icon: {
10
- type: StringConstructor;
11
- default: string;
12
- };
13
- }, unknown, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
14
- icon: {
15
- type: StringConstructor;
16
- default: string;
17
- };
18
- }>>, {
19
- icon: string;
20
- }, {}>;
21
- export default _default;
@@ -1,49 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var vue = require('vue');
6
-
7
- var FontIcon = vue.defineComponent({
8
- name: "YcFontIcon",
9
- props: {
10
- icon: {
11
- type: String,
12
- default: ""
13
- }
14
- },
15
- render() {
16
- const attrs = this.$attrs;
17
- if (Object.keys(attrs).includes("uni") || (attrs == null ? void 0 : attrs.iconType) === "uni") {
18
- return vue.h(
19
- "i",
20
- {
21
- class: "iconfont",
22
- ...attrs
23
- },
24
- this.icon
25
- );
26
- } else if (Object.keys(attrs).includes("svg") || (attrs == null ? void 0 : attrs.iconType) === "svg") {
27
- return vue.h(
28
- "svg",
29
- {
30
- class: "icon-svg"
31
- },
32
- {
33
- default: () => [
34
- vue.h("use", {
35
- "xlink:href": `#${this.icon}`
36
- })
37
- ]
38
- }
39
- );
40
- } else {
41
- return vue.h("i", {
42
- class: `iconfont ${this.icon}`,
43
- ...attrs
44
- });
45
- }
46
- }
47
- });
48
-
49
- exports.default = FontIcon;