color-star-custom-components 0.0.10 → 0.0.11

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,8 +1,9 @@
1
1
  import { w as s } from "./chunks/index.bCzIhWFw.js";
2
- import { shallowRef as u, ref as m, watch as f, onMounted as d, createBlock as l, createCommentVNode as p, openBlock as c, unref as y, mergeProps as v, withCtx as g, resolveDynamicComponent as b } from "vue";
3
- import { ElIcon as N } from "element-plus";
4
- import { i, g as h } from "./chunks/config.DuuYqasP.js";
5
- const w = /* @__PURE__ */ Object.assign({
2
+ import { useCssVars as u, shallowRef as m, ref as f, watch as d, onMounted as p, createBlock as c, createCommentVNode as y, openBlock as l, unref as v, mergeProps as g, withCtx as b, resolveDynamicComponent as C } from "vue";
3
+ import { ElIcon as I } from "element-plus";
4
+ import { i, g as N } from "./chunks/config.DuuYqasP.js";
5
+ import { _ as h } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
6
+ import './assets/IconRenderer.css';const w = /* @__PURE__ */ Object.assign({
6
7
  name: "IconRenderer"
7
8
  }, {
8
9
  __name: "layout",
@@ -30,46 +31,49 @@ const w = /* @__PURE__ */ Object.assign({
30
31
  }
31
32
  },
32
33
  setup(e) {
33
- const o = e, n = u(null), a = m(!1), r = async () => {
34
- if (!o.iconName) {
35
- n.value = null;
34
+ u((o) => ({
35
+ c078896a: e.color
36
+ }));
37
+ const n = e, t = m(null), a = f(!1), r = async () => {
38
+ if (!n.iconName) {
39
+ t.value = null;
36
40
  return;
37
41
  }
38
42
  if (!a.value) {
39
43
  a.value = !0;
40
44
  try {
41
- const t = await h(o.iconLibrary, o.iconName);
42
- n.value = t;
43
- } catch (t) {
44
- console.error("Failed to load icon component:", t), n.value = null;
45
+ const o = await N(n.iconLibrary, n.iconName);
46
+ t.value = o;
47
+ } catch (o) {
48
+ console.error("Failed to load icon component:", o), t.value = null;
45
49
  } finally {
46
50
  a.value = !1;
47
51
  }
48
52
  }
49
53
  };
50
- return f(
51
- () => [o.iconLibrary, o.iconName],
54
+ return d(
55
+ () => [n.iconLibrary, n.iconName],
52
56
  () => {
53
57
  r();
54
58
  },
55
59
  { immediate: !1 }
56
60
  // 初始加载在 onMounted 中处理
57
- ), d(() => {
61
+ ), p(() => {
58
62
  r();
59
- }), (t, C) => e.iconName && n.value ? (c(), l(y(N), v({
63
+ }), (o, _) => e.iconName && t.value ? (l(), c(v(I), g({
60
64
  key: 0,
61
65
  size: e.size,
62
66
  color: e.color
63
- }, t.$attrs), {
64
- default: g(() => [
65
- (c(), l(b(n.value)))
67
+ }, o.$attrs), {
68
+ default: b(() => [
69
+ (l(), c(C(t.value)))
66
70
  ]),
67
71
  _: 1
68
- }, 16, ["size", "color"])) : p("", !0);
72
+ }, 16, ["size", "color"])) : y("", !0);
69
73
  }
70
- }), R = s(w);
74
+ }), L = /* @__PURE__ */ h(w, [["__scopeId", "data-v-563503ea"]]), j = s(L);
71
75
  export {
72
- R as IconRenderer,
73
- R as default,
76
+ j as IconRenderer,
77
+ j as default,
74
78
  i as iconLibraryMap
75
79
  };
@@ -0,0 +1 @@
1
+ svg[data-v-563503ea]{fill:var(--c078896a)}
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("./chunks/index.CkihWzK6.js"),e=require("vue"),s=require("element-plus"),a=require("./chunks/config.-Zz1ib9f.js"),m=Object.assign({name:"IconRenderer"},{__name:"layout",props:{iconName:{type:String,default:""},iconLibrary:{type:String,default:a.iconLibraryMap.lingyun,validator:n=>Object.values(a.iconLibraryMap).includes(n)},size:{type:Number,default:16},color:{type:String,default:""}},setup(n){const o=n,r=e.shallowRef(null),c=e.ref(!1),i=async()=>{if(!o.iconName){r.value=null;return}if(!c.value){c.value=!0;try{const t=await a.getIconComponent(o.iconLibrary,o.iconName);r.value=t}catch(t){console.error("Failed to load icon component:",t),r.value=null}finally{c.value=!1}}};return e.watch(()=>[o.iconLibrary,o.iconName],()=>{i()},{immediate:!1}),e.onMounted(()=>{i()}),(t,d)=>n.iconName&&r.value?(e.openBlock(),e.createBlock(e.unref(s.ElIcon),e.mergeProps({key:0,size:n.size,color:n.color},t.$attrs),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value)))]),_:1},16,["size","color"])):e.createCommentVNode("",!0)}}),l=u.withInstall(m);exports.iconLibraryMap=a.iconLibraryMap;exports.IconRenderer=l;exports.default=l;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/IconRenderer.css');const u=require("./chunks/index.CkihWzK6.js"),e=require("vue"),s=require("element-plus"),a=require("./chunks/config.-Zz1ib9f.js"),d=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),m=Object.assign({name:"IconRenderer"},{__name:"layout",props:{iconName:{type:String,default:""},iconLibrary:{type:String,default:a.iconLibraryMap.lingyun,validator:o=>Object.values(a.iconLibraryMap).includes(o)},size:{type:Number,default:16},color:{type:String,default:""}},setup(o){e.useCssVars(n=>({c078896a:o.color}));const t=o,r=e.shallowRef(null),c=e.ref(!1),l=async()=>{if(!t.iconName){r.value=null;return}if(!c.value){c.value=!0;try{const n=await a.getIconComponent(t.iconLibrary,t.iconName);r.value=n}catch(n){console.error("Failed to load icon component:",n),r.value=null}finally{c.value=!1}}};return e.watch(()=>[t.iconLibrary,t.iconName],()=>{l()},{immediate:!1}),e.onMounted(()=>{l()}),(n,y)=>o.iconName&&r.value?(e.openBlock(),e.createBlock(e.unref(s.ElIcon),e.mergeProps({key:0,size:o.size,color:o.color},n.$attrs),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value)))]),_:1},16,["size","color"])):e.createCommentVNode("",!0)}}),p=d._export_sfc(m,[["__scopeId","data-v-563503ea"]]),i=u.withInstall(p);exports.iconLibraryMap=a.iconLibraryMap;exports.IconRenderer=i;exports.default=i;
@@ -0,0 +1 @@
1
+ svg[data-v-563503ea]{fill:var(--c078896a)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "color-star-custom-components",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "keywords": [
5
5
  "color-star-custom-components",
6
6
  "component library",
@@ -174,10 +174,10 @@
174
174
  "peerDependencies": {
175
175
  "axios": "^1.8.2",
176
176
  "vue": "^3.5.25",
177
- "color-message-aibox-vue": "0.0.75",
178
177
  "color-star-atom-style": "0.0.2",
179
- "color-star-custom-methods": "0.0.14",
180
- "color-message-lingyun-vue": "0.0.30"
178
+ "color-message-lingyun-vue": "0.0.30",
179
+ "color-message-aibox-vue": "0.0.76",
180
+ "color-star-custom-methods": "0.0.14"
181
181
  },
182
182
  "optionalDependencies": {
183
183
  "@ast-grep/napi-linux-x64-musl": "^0.39.6",