mv-iconfront 1.0.7 → 1.0.8

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,5 @@
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 s, getCurrentInstance as f, inject as i, computed as d, createElementBlock as u, openBlock as m, mergeProps as C } from "vue";
2
+ const g = s({
3
3
  name: "MvIconfront",
4
4
  props: {
5
5
  // The specific icon class, e.g. "icon-home"
@@ -29,36 +29,36 @@ const d = r({
29
29
  }
30
30
  },
31
31
  setup(e) {
32
- const o = c("mvIconfrontDefaultColor", "#FFFFFF");
32
+ const o = f(), n = i("mvIconfrontDefaultColor"), l = o == null ? void 0 : o.appContext.config.globalProperties.$mvIconfrontDefaultColor, r = n || l || "#FFFFFF";
33
33
  return {
34
- iconStyle: a(() => {
34
+ iconStyle: d(() => {
35
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) {
37
- const n = e.size.toString();
38
- t.fontSize = n.endsWith("px") || n.endsWith("rem") ? n : `${n}px`;
36
+ if (e.disabled ? t.color = "#C0C4CC !important" : e.isRed ? t.color = "#f56c6c !important" : e.color ? t.color = `${e.color} !important` : t.color = `${r} !important`, e.size) {
37
+ const c = e.size.toString();
38
+ t.fontSize = c.endsWith("px") || c.endsWith("rem") ? c : `${c}px`;
39
39
  }
40
40
  return t;
41
41
  })
42
42
  };
43
43
  }
44
- }), u = (e, o) => {
45
- const l = e.__vccOpts || e;
46
- for (const [t, n] of o)
47
- l[t] = n;
48
- return l;
44
+ }), p = (e, o) => {
45
+ const n = e.__vccOpts || e;
46
+ for (const [l, r] of o)
47
+ n[l] = r;
48
+ return n;
49
49
  };
50
- function m(e, o, l, t, n, g) {
51
- return i(), f("i", s({
50
+ function y(e, o, n, l, r, a) {
51
+ return m(), u("i", C({
52
52
  class: ["icon2", e.name, { "is-disabled": e.disabled }],
53
53
  style: e.iconStyle
54
54
  }, e.$attrs), null, 16);
55
55
  }
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
56
+ const v = /* @__PURE__ */ p(g, [["render", y]]), $ = (e, o) => {
57
+ o != null && o.defaultColor && (e.config.globalProperties.$mvIconfrontDefaultColor = o.defaultColor, e.provide("mvIconfrontDefaultColor", o.defaultColor)), e.component("MvIconfront", v);
58
+ }, I = {
59
+ install: $
60
60
  };
61
61
  export {
62
- C as MvIconfront,
63
- v as default
62
+ v as MvIconfront,
63
+ I as default
64
64
  };
@@ -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(n,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n.MvIconfront={},n.Vue))})(this,function(n,t){"use strict";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=t.getCurrentInstance(),r=t.inject("mvIconfrontDefaultColor"),c=o==null?void 0:o.appContext.config.globalProperties.$mvIconfrontDefaultColor,i=r||c||"#FFFFFF";return{iconStyle:t.computed(()=>{const l={};if(e.disabled?l.color="#C0C4CC !important":e.isRed?l.color="#f56c6c !important":e.color?l.color=`${e.color} !important`:l.color=`${i} !important`,e.size){const f=e.size.toString();l.fontSize=f.endsWith("px")||f.endsWith("rem")?f:`${f}px`}return l})}}}),d=(e,o)=>{const r=e.__vccOpts||e;for(const[c,i]of o)r[c]=i;return r};function u(e,o,r,c,i,p){return t.openBlock(),t.createElementBlock("i",t.mergeProps({class:["icon2",e.name,{"is-disabled":e.disabled}],style:e.iconStyle},e.$attrs),null,16)}const s=d(a,[["render",u]]),m={install:(e,o)=>{o!=null&&o.defaultColor&&(e.config.globalProperties.$mvIconfrontDefaultColor=o.defaultColor,e.provide("mvIconfrontDefaultColor",o.defaultColor)),e.component("MvIconfront",s)}};n.MvIconfront=s,n.default=m,Object.defineProperties(n,{__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.8",
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",