@fmdevui/fm-dev 1.0.10 → 1.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.
Files changed (66) hide show
  1. package/es/component.mjs +6 -1
  2. package/es/core/hook/useVxeTableOptionsHook.d.ts +4 -4
  3. package/es/core/index.d.ts +1 -0
  4. package/es/core/ui/components/index.d.ts +4 -0
  5. package/es/core/ui/components/noticeBar/index.vue.d.ts +114 -0
  6. package/es/core/ui/components/noticeBar/style/css.d.ts +1 -0
  7. package/es/core/ui/components/noticeBar/style/index.d.ts +1 -0
  8. package/es/core/ui/components/svgIcon/index.d.ts +7 -0
  9. package/es/core/ui/components/svgIcon/svgicon.vue.d.ts +27 -0
  10. package/es/core/ui/components/transfer/index.vue.d.ts +59 -0
  11. package/es/core/ui/components/transfer/style/css.d.ts +1 -0
  12. package/es/core/ui/components/transfer/style/index.d.ts +1 -0
  13. package/es/index.mjs +3 -0
  14. package/es/make-installer.mjs +4 -0
  15. package/es/packages/core/index.mjs +4 -0
  16. package/es/packages/core/ui/components/index.mjs +5 -0
  17. package/es/packages/core/ui/components/noticeBar/index.vue.mjs +5 -0
  18. package/es/packages/core/ui/components/noticeBar/index.vue2.mjs +126 -0
  19. package/es/packages/core/ui/components/noticeBar/style/css.mjs +1 -0
  20. package/es/packages/core/ui/components/noticeBar/style/index.mjs +1 -0
  21. package/es/packages/core/ui/components/svgIcon/index.mjs +13 -0
  22. package/es/packages/core/ui/components/svgIcon/svgicon.vue.mjs +5 -0
  23. package/es/packages/core/ui/components/svgIcon/svgicon.vue2.mjs +87 -0
  24. package/es/packages/core/ui/components/transfer/index.vue.mjs +5 -0
  25. package/es/packages/core/ui/components/transfer/index.vue2.mjs +370 -0
  26. package/es/packages/core/ui/components/transfer/style/css.mjs +1 -0
  27. package/es/packages/core/ui/components/transfer/style/index.mjs +1 -0
  28. package/index.css +1 -0
  29. package/index.js +6647 -2
  30. package/index.min.js +30 -25
  31. package/index.min.mjs +29 -24
  32. package/index.mjs +6646 -4
  33. package/lib/component.js +6 -1
  34. package/lib/core/hook/useVxeTableOptionsHook.d.ts +4 -4
  35. package/lib/core/index.d.ts +1 -0
  36. package/lib/core/ui/components/index.d.ts +4 -0
  37. package/lib/core/ui/components/noticeBar/index.vue.d.ts +114 -0
  38. package/lib/core/ui/components/noticeBar/style/css.d.ts +1 -0
  39. package/lib/core/ui/components/noticeBar/style/index.d.ts +1 -0
  40. package/lib/core/ui/components/svgIcon/index.d.ts +7 -0
  41. package/lib/core/ui/components/svgIcon/svgicon.vue.d.ts +27 -0
  42. package/lib/core/ui/components/transfer/index.vue.d.ts +59 -0
  43. package/lib/core/ui/components/transfer/style/css.d.ts +1 -0
  44. package/lib/core/ui/components/transfer/style/index.d.ts +1 -0
  45. package/lib/index.js +51 -45
  46. package/lib/make-installer.js +4 -0
  47. package/lib/packages/core/index.js +52 -45
  48. package/lib/packages/core/ui/components/index.js +13 -0
  49. package/lib/packages/core/ui/components/noticeBar/index.vue.js +9 -0
  50. package/lib/packages/core/ui/components/noticeBar/index.vue2.js +130 -0
  51. package/lib/packages/core/ui/components/noticeBar/style/css.js +4 -0
  52. package/lib/packages/core/ui/components/noticeBar/style/index.js +4 -0
  53. package/lib/packages/core/ui/components/svgIcon/index.js +34 -0
  54. package/lib/packages/core/ui/components/svgIcon/svgicon.vue.js +9 -0
  55. package/lib/packages/core/ui/components/svgIcon/svgicon.vue2.js +91 -0
  56. package/lib/packages/core/ui/components/transfer/index.vue.js +9 -0
  57. package/lib/packages/core/ui/components/transfer/index.vue2.js +374 -0
  58. package/lib/packages/core/ui/components/transfer/style/css.js +4 -0
  59. package/lib/packages/core/ui/components/transfer/style/index.js +4 -0
  60. package/package.json +1 -1
  61. package/theme-chalk/index.css +1 -0
  62. package/theme-chalk/src/index.scss +2 -0
  63. package/theme-chalk/src/t-noticebar.scss +32 -0
  64. package/theme-chalk/src/t-transfer.scss +46 -0
  65. package/theme-chalk/t-t-noticebar.css +1 -0
  66. package/theme-chalk/t-t-transfer.css +1 -0
package/es/component.mjs CHANGED
@@ -1,7 +1,12 @@
1
1
  import { FmLogin } from './packages/core/ui/login/index.mjs';
2
+ import './packages/core/ui/components/index.mjs';
3
+ import _sfc_main from './packages/core/ui/components/transfer/index.vue2.mjs';
4
+ import _sfc_main$1 from './packages/core/ui/components/noticeBar/index.vue2.mjs';
2
5
 
3
6
  const plugins = [
4
- FmLogin
7
+ FmLogin,
8
+ _sfc_main,
9
+ _sfc_main$1
5
10
  ];
6
11
 
7
12
  export { plugins as default };
@@ -688,13 +688,13 @@ export declare const useVxeTable: <T>(opt: iVxeOption, extras?: VxeGridProps<T>)
688
688
  title?: import("vxe-table").VxeButtonPropTypes.Title | undefined;
689
689
  circle?: import("vxe-table").VxeButtonPropTypes.Circle | undefined;
690
690
  type?: import("vxe-table").VxeButtonPropTypes.Type | undefined;
691
- icon?: import("vxe-table").VxeButtonPropTypes.Icon | undefined;
691
+ disabled?: import("vxe-table").VxeButtonPropTypes.Disabled | undefined;
692
692
  mode?: import("vxe-table").VxeButtonPropTypes.Mode | undefined;
693
+ icon?: import("vxe-table").VxeButtonPropTypes.Icon | undefined;
693
694
  round?: import("vxe-table").VxeButtonPropTypes.Round | undefined;
694
695
  loading?: import("vxe-table").VxeButtonPropTypes.Loading | undefined;
695
696
  align?: import("vxe-table").VxeButtonPropTypes.Align | undefined;
696
697
  className?: import("vxe-table").VxeButtonPropTypes.ClassName | undefined;
697
- disabled?: import("vxe-table").VxeButtonPropTypes.Disabled | undefined;
698
698
  content?: import("vxe-table").VxeButtonPropTypes.Content | undefined;
699
699
  routerLink?: {
700
700
  path?: string | undefined;
@@ -774,13 +774,13 @@ export declare const useVxeTable: <T>(opt: iVxeOption, extras?: VxeGridProps<T>)
774
774
  title?: import("vxe-table").VxeButtonPropTypes.Title | undefined;
775
775
  circle?: import("vxe-table").VxeButtonPropTypes.Circle | undefined;
776
776
  type?: import("vxe-table").VxeButtonPropTypes.Type | undefined;
777
- icon?: import("vxe-table").VxeButtonPropTypes.Icon | undefined;
777
+ disabled?: import("vxe-table").VxeButtonPropTypes.Disabled | undefined;
778
778
  mode?: import("vxe-table").VxeButtonPropTypes.Mode | undefined;
779
+ icon?: import("vxe-table").VxeButtonPropTypes.Icon | undefined;
779
780
  round?: import("vxe-table").VxeButtonPropTypes.Round | undefined;
780
781
  loading?: import("vxe-table").VxeButtonPropTypes.Loading | undefined;
781
782
  align?: import("vxe-table").VxeButtonPropTypes.Align | undefined;
782
783
  className?: import("vxe-table").VxeButtonPropTypes.ClassName | undefined;
783
- disabled?: import("vxe-table").VxeButtonPropTypes.Disabled | undefined;
784
784
  content?: import("vxe-table").VxeButtonPropTypes.Content | undefined;
785
785
  routerLink?: {
786
786
  path?: string | undefined;
@@ -1,3 +1,4 @@
1
+ export * from './ui/components';
1
2
  export * from './ui/login';
2
3
  export * from './ui/loading';
3
4
  export * from './api';
@@ -0,0 +1,4 @@
1
+ import { default as FmTransfer } from './transfer/index.vue';
2
+ import { default as FmNoticeBar } from './noticeBar/index.vue';
3
+ import { elSvg } from './svgIcon';
4
+ export { FmTransfer, FmNoticeBar, elSvg };
@@ -0,0 +1,114 @@
1
+ import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<ExtractPropTypes<{
3
+ mode: {
4
+ type: StringConstructor;
5
+ default: string;
6
+ };
7
+ text: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ color: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
15
+ background: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ };
19
+ size: {
20
+ type: (StringConstructor | NumberConstructor)[];
21
+ default: number;
22
+ };
23
+ height: {
24
+ type: NumberConstructor;
25
+ default: number;
26
+ };
27
+ delay: {
28
+ type: NumberConstructor;
29
+ default: number;
30
+ };
31
+ speed: {
32
+ type: NumberConstructor;
33
+ default: number;
34
+ };
35
+ scrollable: {
36
+ type: BooleanConstructor;
37
+ default: boolean;
38
+ };
39
+ leftIcon: {
40
+ type: StringConstructor;
41
+ default: string;
42
+ };
43
+ rightIcon: {
44
+ type: StringConstructor;
45
+ default: string;
46
+ };
47
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
48
+ close: (...args: any[]) => void;
49
+ link: (...args: any[]) => void;
50
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
51
+ mode: {
52
+ type: StringConstructor;
53
+ default: string;
54
+ };
55
+ text: {
56
+ type: StringConstructor;
57
+ default: string;
58
+ };
59
+ color: {
60
+ type: StringConstructor;
61
+ default: string;
62
+ };
63
+ background: {
64
+ type: StringConstructor;
65
+ default: string;
66
+ };
67
+ size: {
68
+ type: (StringConstructor | NumberConstructor)[];
69
+ default: number;
70
+ };
71
+ height: {
72
+ type: NumberConstructor;
73
+ default: number;
74
+ };
75
+ delay: {
76
+ type: NumberConstructor;
77
+ default: number;
78
+ };
79
+ speed: {
80
+ type: NumberConstructor;
81
+ default: number;
82
+ };
83
+ scrollable: {
84
+ type: BooleanConstructor;
85
+ default: boolean;
86
+ };
87
+ leftIcon: {
88
+ type: StringConstructor;
89
+ default: string;
90
+ };
91
+ rightIcon: {
92
+ type: StringConstructor;
93
+ default: string;
94
+ };
95
+ }>> & Readonly<{
96
+ onClose?: ((...args: any[]) => any) | undefined;
97
+ onLink?: ((...args: any[]) => any) | undefined;
98
+ }>, {
99
+ text: string;
100
+ size: string | number;
101
+ mode: string;
102
+ color: string;
103
+ background: string;
104
+ height: number;
105
+ delay: number;
106
+ speed: number;
107
+ scrollable: boolean;
108
+ leftIcon: string;
109
+ rightIcon: string;
110
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {
111
+ noticeBarWarpRef: HTMLDivElement;
112
+ noticeBarTextRef: HTMLDivElement;
113
+ }, HTMLDivElement>;
114
+ export default _default;
@@ -0,0 +1 @@
1
+ import "fm-dev/theme-chalk/t-noticebar.css";
@@ -0,0 +1 @@
1
+ import "fm-dev/theme-chalk/src/t-noticebar.scss";
@@ -0,0 +1,7 @@
1
+ import { App } from 'vue';
2
+ /**
3
+ * 导出全局注册 element plus svg 图标
4
+ * @param app vue 实例
5
+ * @description 使用:https://element-plus.gitee.io/zh-CN/component/icon.html
6
+ */
7
+ export declare function elSvg(app: App): void;
@@ -0,0 +1,27 @@
1
+ import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<ExtractPropTypes<{
3
+ name: {
4
+ type: StringConstructor;
5
+ };
6
+ size: {
7
+ type: NumberConstructor;
8
+ default: () => number;
9
+ };
10
+ color: {
11
+ type: StringConstructor;
12
+ };
13
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
14
+ name: {
15
+ type: StringConstructor;
16
+ };
17
+ size: {
18
+ type: NumberConstructor;
19
+ default: () => number;
20
+ };
21
+ color: {
22
+ type: StringConstructor;
23
+ };
24
+ }>> & Readonly<{}>, {
25
+ size: number;
26
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
27
+ export default _default;
@@ -0,0 +1,59 @@
1
+ import { DefineComponent, ExtractPropTypes, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<ExtractPropTypes<{
3
+ leftTitle: StringConstructor;
4
+ rightTitle: StringConstructor;
5
+ options: {
6
+ type: ObjectConstructor;
7
+ default: () => {
8
+ value: string;
9
+ label: string;
10
+ disabled: string;
11
+ };
12
+ };
13
+ leftData: {
14
+ type: ArrayConstructor;
15
+ default: () => never[];
16
+ };
17
+ rightData: {
18
+ type: ArrayConstructor;
19
+ default: () => never[];
20
+ };
21
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
22
+ left: (...args: any[]) => void;
23
+ right: (...args: any[]) => void;
24
+ allLeft: (...args: any[]) => void;
25
+ allRight: (...args: any[]) => void;
26
+ "update:leftData": (...args: any[]) => void;
27
+ "update:rightData": (...args: any[]) => void;
28
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
29
+ leftTitle: StringConstructor;
30
+ rightTitle: StringConstructor;
31
+ options: {
32
+ type: ObjectConstructor;
33
+ default: () => {
34
+ value: string;
35
+ label: string;
36
+ disabled: string;
37
+ };
38
+ };
39
+ leftData: {
40
+ type: ArrayConstructor;
41
+ default: () => never[];
42
+ };
43
+ rightData: {
44
+ type: ArrayConstructor;
45
+ default: () => never[];
46
+ };
47
+ }>> & Readonly<{
48
+ onLeft?: ((...args: any[]) => any) | undefined;
49
+ onRight?: ((...args: any[]) => any) | undefined;
50
+ onAllLeft?: ((...args: any[]) => any) | undefined;
51
+ onAllRight?: ((...args: any[]) => any) | undefined;
52
+ "onUpdate:leftData"?: ((...args: any[]) => any) | undefined;
53
+ "onUpdate:rightData"?: ((...args: any[]) => any) | undefined;
54
+ }>, {
55
+ options: Record<string, any>;
56
+ leftData: unknown[];
57
+ rightData: unknown[];
58
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
59
+ export default _default;
@@ -0,0 +1 @@
1
+ import "fm-dev/theme-chalk/t-transfer.css";
@@ -0,0 +1 @@
1
+ import "fm-dev/theme-chalk/src/t-transfer.scss";
package/es/index.mjs CHANGED
@@ -1,6 +1,9 @@
1
1
  import installer from './defaults.mjs';
2
2
  import './packages/core/index.mjs';
3
3
  export { version } from './version.mjs';
4
+ export { default as FmTransfer } from './packages/core/ui/components/transfer/index.vue2.mjs';
5
+ export { default as FmNoticeBar } from './packages/core/ui/components/noticeBar/index.vue2.mjs';
6
+ export { elSvg } from './packages/core/ui/components/svgIcon/index.mjs';
4
7
  export { FmLogin } from './packages/core/ui/login/index.mjs';
5
8
  export { NextLoading } from './packages/core/ui/loading/index.mjs';
6
9
  export { useBaseApi } from './packages/core/api/base/index.mjs';
@@ -1,6 +1,10 @@
1
+ import './packages/core/ui/components/index.mjs';
2
+ import { elSvg } from './packages/core/ui/components/svgIcon/index.mjs';
3
+
1
4
  const makeInstaller = (components = []) => {
2
5
  const install = (app) => {
3
6
  components.forEach((component) => app.component(component.name, component));
7
+ elSvg(app);
4
8
  };
5
9
  return {
6
10
  install
@@ -1,3 +1,4 @@
1
+ import './ui/components/index.mjs';
1
2
  export { FmLogin } from './ui/login/index.mjs';
2
3
  export { NextLoading } from './ui/loading/index.mjs';
3
4
  import './api/index.mjs';
@@ -9,6 +10,9 @@ export { auth, authAll, auths, hAuth, hAuthAll, hAuths } from './auth/index.mjs'
9
10
  export { useDateTimeShortCust } from './hook/dateTimeShortCust.mjs';
10
11
  export { useVxeTable } from './hook/useVxeTableOptionsHook.mjs';
11
12
  import './types/index.mjs';
13
+ export { default as FmTransfer } from './ui/components/transfer/index.vue2.mjs';
14
+ export { default as FmNoticeBar } from './ui/components/noticeBar/index.vue2.mjs';
15
+ export { elSvg } from './ui/components/svgIcon/index.mjs';
12
16
  export { useBaseApi } from './api/base/index.mjs';
13
17
  export { feature, useSysApi } from './api/sys/index.mjs';
14
18
  export { useLoginApi } from './api/login/index.mjs';
@@ -0,0 +1,5 @@
1
+ import './transfer/index.vue.mjs';
2
+ import './noticeBar/index.vue.mjs';
3
+ export { elSvg } from './svgIcon/index.mjs';
4
+ export { default as FmTransfer } from './transfer/index.vue2.mjs';
5
+ export { default as FmNoticeBar } from './noticeBar/index.vue2.mjs';
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './index.vue2.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,126 @@
1
+ import { defineComponent, ref, reactive, onMounted, nextTick, withDirectives, openBlock, createElementBlock, normalizeStyle, createElementVNode, createCommentVNode, normalizeClass, vShow } from 'vue';
2
+
3
+ const _hoisted_1 = { class: "notice-bar-warp-text-box" };
4
+ const _hoisted_2 = ["innerHTML"];
5
+ var _sfc_main = /* @__PURE__ */ defineComponent({
6
+ __name: "index",
7
+ props: {
8
+ mode: { type: String, default: "" },
9
+ // 通知栏模式,可选值为 closeable link
10
+ text: { type: String, default: "" },
11
+ // 通知文本内容
12
+ color: { type: String, default: "var(--el-color-warning)" },
13
+ // 通知文本颜色
14
+ background: { type: String, default: "var(--el-color-warning-light-9)" },
15
+ // 通知背景色
16
+ size: { type: [Number, String], default: 14 },
17
+ // 字体大小,单位px
18
+ height: { type: Number, default: 40 },
19
+ // 通知栏高度,单位px
20
+ delay: { type: Number, default: 1 },
21
+ // 动画延迟时间 (s)
22
+ speed: { type: Number, default: 100 },
23
+ // 滚动速率 (px/s)
24
+ scrollable: { type: Boolean, default: false },
25
+ // 是否开启垂直滚动
26
+ leftIcon: { type: String, default: "iconfont icon-tongzhi2" },
27
+ // 自定义左侧图标
28
+ rightIcon: { type: String, default: "" }
29
+ // 自定义右侧图标
30
+ },
31
+ emits: ["close", "link"],
32
+ setup(__props, { emit: __emit }) {
33
+ const props = __props;
34
+ const emit = __emit;
35
+ const noticeBarWarpRef = ref(null);
36
+ const noticeBarTextRef = ref(null);
37
+ const state = reactive({
38
+ isMode: false,
39
+ warpOWidth: 0,
40
+ textOWidth: 0,
41
+ animationDuration: 0
42
+ });
43
+ onMounted(async () => {
44
+ if (!props.scrollable) initAnimation();
45
+ });
46
+ const initAnimation = () => {
47
+ nextTick(() => {
48
+ if (noticeBarWarpRef.value && noticeBarTextRef.value) {
49
+ state.warpOWidth = noticeBarWarpRef.value.offsetWidth;
50
+ state.textOWidth = noticeBarTextRef.value.scrollWidth;
51
+ state.animationDuration = (state.textOWidth + state.warpOWidth) / props.speed;
52
+ noticeBarTextRef.value.style.animation = "none";
53
+ noticeBarTextRef.value.offsetHeight;
54
+ noticeBarTextRef.value.style.animation = `marquee ${state.animationDuration}s linear infinite`;
55
+ const keyframes = `
56
+ @keyframes marquee {
57
+ 0% { transform: translateX(${state.warpOWidth}px); }
58
+ 100% { transform: translateX(-${state.textOWidth}px); }
59
+ }
60
+ `;
61
+ const styleSheet = document.createElement("style");
62
+ styleSheet.innerText = keyframes;
63
+ document.head.appendChild(styleSheet);
64
+ }
65
+ });
66
+ };
67
+ return (_ctx, _cache) => {
68
+ return withDirectives((openBlock(), createElementBlock(
69
+ "div",
70
+ {
71
+ class: "fm-notice-bar",
72
+ style: normalizeStyle({ background: __props.background, height: `${__props.height}px` })
73
+ },
74
+ [
75
+ createElementVNode(
76
+ "div",
77
+ {
78
+ class: "notice-bar-warp",
79
+ style: normalizeStyle({ color: __props.color, fontSize: `${__props.size}px` }),
80
+ ref_key: "noticeBarWarpRef",
81
+ ref: noticeBarWarpRef
82
+ },
83
+ [
84
+ __props.leftIcon ? (openBlock(), createElementBlock(
85
+ "i",
86
+ {
87
+ key: 0,
88
+ class: normalizeClass(["notice-bar-warp-left-icon", __props.leftIcon])
89
+ },
90
+ null,
91
+ 2
92
+ /* CLASS */
93
+ )) : createCommentVNode("v-if", true),
94
+ createElementVNode("div", _hoisted_1, [
95
+ createElementVNode(
96
+ "div",
97
+ {
98
+ class: "notice-bar-warp-text",
99
+ ref_key: "noticeBarTextRef",
100
+ ref: noticeBarTextRef
101
+ },
102
+ [
103
+ createElementVNode("div", {
104
+ innerHTML: props.text,
105
+ "data-slate-editor": ""
106
+ }, null, 8, _hoisted_2)
107
+ ],
108
+ 512
109
+ /* NEED_PATCH */
110
+ )
111
+ ])
112
+ ],
113
+ 4
114
+ /* STYLE */
115
+ )
116
+ ],
117
+ 4
118
+ /* STYLE */
119
+ )), [
120
+ [vShow, !state.isMode]
121
+ ]);
122
+ };
123
+ }
124
+ });
125
+
126
+ export { _sfc_main as default };
@@ -0,0 +1 @@
1
+ import 'fm-dev/theme-chalk/t-noticebar.css';
@@ -0,0 +1 @@
1
+ import 'fm-dev/theme-chalk/src/t-noticebar.scss';
@@ -0,0 +1,13 @@
1
+ import * as svg from '@element-plus/icons-vue';
2
+ import './svgicon.vue.mjs';
3
+ import _sfc_main from './svgicon.vue2.mjs';
4
+
5
+ function elSvg(app) {
6
+ const icons = svg;
7
+ for (const i in icons) {
8
+ app.component(`ele-${icons[i].name}`, icons[i]);
9
+ }
10
+ app.component("SvgIcon", _sfc_main);
11
+ }
12
+
13
+ export { elSvg };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './svgicon.vue2.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,87 @@
1
+ import { defineComponent, computed, createElementBlock, openBlock, normalizeStyle, createBlock, resolveDynamicComponent, createElementVNode, normalizeClass } from 'vue';
2
+
3
+ const _hoisted_1 = ["src"];
4
+ var _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "svgicon",
6
+ props: {
7
+ // svg 图标组件名字
8
+ name: {
9
+ type: String
10
+ },
11
+ // svg 大小
12
+ size: {
13
+ type: Number,
14
+ default: () => 14
15
+ },
16
+ // svg 颜色
17
+ color: {
18
+ type: String
19
+ }
20
+ },
21
+ setup(__props) {
22
+ const props = __props;
23
+ const linesString = ["https", "http", "/src", "/assets", "data:image", window.__env__.VITE_PUBLIC_PATH];
24
+ const getIconName = computed(() => {
25
+ return props?.name;
26
+ });
27
+ const isShowIconSvg = computed(() => {
28
+ return props?.name?.startsWith("ele-");
29
+ });
30
+ const isShowIconImg = computed(() => {
31
+ return linesString.find((str) => props.name?.startsWith(str));
32
+ });
33
+ const setIconSvgStyle = computed(() => {
34
+ return `font-size: ${props.size}px;color: ${props.color};`;
35
+ });
36
+ const setIconImgOutStyle = computed(() => {
37
+ return `width: ${props.size}px;height: ${props.size}px;display: inline-block;overflow: hidden;`;
38
+ });
39
+ const setIconSvgInsStyle = computed(() => {
40
+ const filterStyle = [];
41
+ const compatibles = ["-webkit", "-ms", "-o", "-moz"];
42
+ compatibles.forEach((j) => filterStyle.push(`${j}-filter: drop-shadow(${props.color} ${props.size}px 0);`));
43
+ return `width: ${props.size}px;height: ${props.size}px;position: relative;left: -${props.size}px;${filterStyle.join("")}`;
44
+ });
45
+ return (_ctx, _cache) => {
46
+ return isShowIconSvg.value ? (openBlock(), createElementBlock(
47
+ "i",
48
+ {
49
+ key: 0,
50
+ class: "el-icon",
51
+ style: normalizeStyle(setIconSvgStyle.value)
52
+ },
53
+ [
54
+ (openBlock(), createBlock(resolveDynamicComponent(getIconName.value)))
55
+ ],
56
+ 4
57
+ /* STYLE */
58
+ )) : isShowIconImg.value ? (openBlock(), createElementBlock(
59
+ "div",
60
+ {
61
+ key: 1,
62
+ style: normalizeStyle(setIconImgOutStyle.value)
63
+ },
64
+ [
65
+ createElementVNode("img", {
66
+ src: getIconName.value,
67
+ style: normalizeStyle(setIconSvgInsStyle.value)
68
+ }, null, 12, _hoisted_1)
69
+ ],
70
+ 4
71
+ /* STYLE */
72
+ )) : (openBlock(), createElementBlock(
73
+ "i",
74
+ {
75
+ key: 2,
76
+ class: normalizeClass(getIconName.value),
77
+ style: normalizeStyle(setIconSvgStyle.value)
78
+ },
79
+ null,
80
+ 6
81
+ /* CLASS, STYLE */
82
+ ));
83
+ };
84
+ }
85
+ });
86
+
87
+ export { _sfc_main as default };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './index.vue2.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };