mv-iconfront 1.0.7 → 1.0.9

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.
@@ -1,5 +1,15 @@
1
- import { defineComponent as r, inject as c, computed as a, createElementBlock as f, openBlock as i, mergeProps as s } from "vue";
2
- const d = r({
1
+ import { defineComponent as a, computed as c, createElementBlock as f, openBlock as i, mergeProps as s } from "vue";
2
+ const r = {
3
+ defaultColor: "#FFFFFF"
4
+ // Default fallback
5
+ };
6
+ function d(e) {
7
+ e.defaultColor && (r.defaultColor = e.defaultColor);
8
+ }
9
+ function u() {
10
+ return r;
11
+ }
12
+ const m = a({
3
13
  name: "MvIconfront",
4
14
  props: {
5
15
  // The specific icon class, e.g. "icon-home"
@@ -29,36 +39,36 @@ const d = r({
29
39
  }
30
40
  },
31
41
  setup(e) {
32
- const o = c("mvIconfrontDefaultColor", "#FFFFFF");
42
+ const t = u().defaultColor || "#FFFFFF";
33
43
  return {
34
- iconStyle: a(() => {
35
- const t = {};
36
- if (e.disabled ? t.color = "#C0C4CC !important" : e.isRed ? t.color = "#f56c6c !important" : e.color ? t.color = `${e.color} !important` : t.color = `${o} !important`, e.size) {
44
+ iconStyle: c(() => {
45
+ const o = {};
46
+ if (e.disabled ? o.color = "#C0C4CC !important" : e.isRed ? o.color = "#f56c6c !important" : e.color ? o.color = `${e.color} !important` : o.color = `${t} !important`, e.size) {
37
47
  const n = e.size.toString();
38
- t.fontSize = n.endsWith("px") || n.endsWith("rem") ? n : `${n}px`;
48
+ o.fontSize = n.endsWith("px") || n.endsWith("rem") ? n : `${n}px`;
39
49
  }
40
- return t;
50
+ return o;
41
51
  })
42
52
  };
43
53
  }
44
- }), u = (e, o) => {
54
+ }), C = (e, t) => {
45
55
  const l = e.__vccOpts || e;
46
- for (const [t, n] of o)
47
- l[t] = n;
56
+ for (const [o, n] of t)
57
+ l[o] = n;
48
58
  return l;
49
59
  };
50
- function m(e, o, l, t, n, g) {
60
+ function F(e, t, l, o, n, y) {
51
61
  return i(), f("i", s({
52
62
  class: ["icon2", e.name, { "is-disabled": e.disabled }],
53
63
  style: e.iconStyle
54
64
  }, e.$attrs), null, 16);
55
65
  }
56
- const C = /* @__PURE__ */ u(d, [["render", m]]), y = (e, o) => {
57
- o != null && o.defaultColor && (e.config.globalProperties.$mvIconfrontDefaultColor = o.defaultColor, e.provide("mvIconfrontDefaultColor", o.defaultColor)), e.component("MvIconfront", C);
58
- }, v = {
59
- install: y
66
+ const g = /* @__PURE__ */ C(m, [["render", F]]), p = (e, t) => {
67
+ t != null && t.defaultColor && d({ defaultColor: t.defaultColor }), e.component("MvIconfront", g);
68
+ }, $ = {
69
+ install: p
60
70
  };
61
71
  export {
62
- C as MvIconfront,
63
- v as default
72
+ g as MvIconfront,
73
+ $ as default
64
74
  };
@@ -1 +1 @@
1
- (function(l,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(l=typeof globalThis<"u"?globalThis:l||self,t(l.MvIconfront={},l.Vue))})(this,function(l,t){"use strict";const c=t.defineComponent({name:"MvIconfront",props:{name:{type:String,default:""},color:{type:String,default:""},size:{type:[String,Number],default:""},isRed:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(e){const o=t.inject("mvIconfrontDefaultColor","#FFFFFF");return{iconStyle:t.computed(()=>{const n={};if(e.disabled?n.color="#C0C4CC !important":e.isRed?n.color="#f56c6c !important":e.color?n.color=`${e.color} !important`:n.color=`${o} !important`,e.size){const r=e.size.toString();n.fontSize=r.endsWith("px")||r.endsWith("rem")?r:`${r}px`}return n})}}}),s=(e,o)=>{const i=e.__vccOpts||e;for(const[n,r]of o)i[n]=r;return i};function a(e,o,i,n,r,m){return t.openBlock(),t.createElementBlock("i",t.mergeProps({class:["icon2",e.name,{"is-disabled":e.disabled}],style:e.iconStyle},e.$attrs),null,16)}const f=s(c,[["render",a]]),d={install:(e,o)=>{o!=null&&o.defaultColor&&(e.config.globalProperties.$mvIconfrontDefaultColor=o.defaultColor,e.provide("mvIconfrontDefaultColor",o.defaultColor)),e.component("MvIconfront",f)}};l.MvIconfront=f,l.default=d,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(l,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(l=typeof globalThis<"u"?globalThis:l||self,t(l.MvIconfront={},l.Vue))})(this,function(l,t){"use strict";const f={defaultColor:"#FFFFFF"};function s(e){e.defaultColor&&(f.defaultColor=e.defaultColor)}function d(){return f}const a=t.defineComponent({name:"MvIconfront",props:{name:{type:String,default:""},color:{type:String,default:""},size:{type:[String,Number],default:""},isRed:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(e){const o=d().defaultColor||"#FFFFFF";return{iconStyle:t.computed(()=>{const n={};if(e.disabled?n.color="#C0C4CC !important":e.isRed?n.color="#f56c6c !important":e.color?n.color=`${e.color} !important`:n.color=`${o} !important`,e.size){const r=e.size.toString();n.fontSize=r.endsWith("px")||r.endsWith("rem")?r:`${r}px`}return n})}}}),u=(e,o)=>{const i=e.__vccOpts||e;for(const[n,r]of o)i[n]=r;return i};function m(e,o,i,n,r,y){return t.openBlock(),t.createElementBlock("i",t.mergeProps({class:["icon2",e.name,{"is-disabled":e.disabled}],style:e.iconStyle},e.$attrs),null,16)}const c=u(a,[["render",m]]),C={install:(e,o)=>{o!=null&&o.defaultColor&&s({defaultColor:o.defaultColor}),e.component("MvIconfront",c)}};l.MvIconfront=c,l.default=C,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mv-iconfront",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "A customized icon component for Vue 3",
5
5
  "main": "dist/mv-iconfront.umd.js",
6
6
  "module": "dist/mv-iconfront.es.js",