color-star-custom-components 0.0.3
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.
- package/es/GlassProxy.mjs +168 -0
- package/es/IconEmpty.mjs +7 -0
- package/es/IconRenderer.mjs +75 -0
- package/es/IconSelect.mjs +158 -0
- package/es/assets/GlassProxy.css +1 -0
- package/es/assets/IconSelect.css +1 -0
- package/es/assets/layout.css +0 -0
- package/es/chunks/_plugin-vue_export-helper.CHgC5LLL.js +9 -0
- package/es/chunks/config.BOO9PtC2.js +24 -0
- package/es/chunks/global.CCbNdFdD.js +9858 -0
- package/es/chunks/global.DUSYZ3SI.js +17026 -0
- package/es/chunks/index.bCzIhWFw.js +7 -0
- package/es/chunks/layout.DBgjqaxe.js +66 -0
- package/es/index.mjs +29 -0
- package/lib/GlassProxy.js +1 -0
- package/lib/IconEmpty.js +1 -0
- package/lib/IconRenderer.js +1 -0
- package/lib/IconSelect.js +1 -0
- package/lib/assets/GlassProxy.css +1 -0
- package/lib/assets/IconSelect.css +1 -0
- package/lib/assets/layout.css +0 -0
- package/lib/chunks/_plugin-vue_export-helper.BHFhmbuH.js +1 -0
- package/lib/chunks/config.BbElhKS6.js +1 -0
- package/lib/chunks/global.ZGY3DYHI.js +1 -0
- package/lib/chunks/global.lWIoINdc.js +1 -0
- package/lib/chunks/index.CkihWzK6.js +1 -0
- package/lib/chunks/layout.B8d4J538.js +1 -0
- package/lib/index.js +1 -0
- package/package.json +197 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { computed as n, createElementBlock as i, openBlock as o, createVNode as r, createElementVNode as l, unref as a, withCtx as m, createBlock as s, resolveDynamicComponent as p, normalizeStyle as y, toDisplayString as f } from "vue";
|
|
2
|
+
import { IconEmpty as u } from "color-message-lingyun-vue";
|
|
3
|
+
import { ElIcon as d } from "element-plus";
|
|
4
|
+
import { _ as x } from "./_plugin-vue_export-helper.CHgC5LLL.js";
|
|
5
|
+
import '../assets/layout.css';const S = { class: "icon-empty flex flex-col items-center justify-center" }, z = /* @__PURE__ */ Object.assign({
|
|
6
|
+
name: "IconEmpty"
|
|
7
|
+
}, {
|
|
8
|
+
__name: "layout",
|
|
9
|
+
props: {
|
|
10
|
+
// 图标组件
|
|
11
|
+
icon: {
|
|
12
|
+
type: Object,
|
|
13
|
+
default: u
|
|
14
|
+
},
|
|
15
|
+
// 图标大小
|
|
16
|
+
iconSize: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 64
|
|
19
|
+
},
|
|
20
|
+
// 图标颜色
|
|
21
|
+
iconColor: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "#c0c4cc"
|
|
24
|
+
},
|
|
25
|
+
// 显示文字
|
|
26
|
+
text: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: "暂无数据"
|
|
29
|
+
},
|
|
30
|
+
// 文字颜色
|
|
31
|
+
textColor: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "#909399"
|
|
34
|
+
},
|
|
35
|
+
// 文字字号
|
|
36
|
+
textSize: {
|
|
37
|
+
type: Number,
|
|
38
|
+
default: 14
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
setup(t) {
|
|
42
|
+
const e = t, c = n(() => ({
|
|
43
|
+
color: e.textColor,
|
|
44
|
+
fontSize: `${e.textSize}px`
|
|
45
|
+
}));
|
|
46
|
+
return (E, I) => (o(), i("div", S, [
|
|
47
|
+
r(a(d), {
|
|
48
|
+
size: t.iconSize,
|
|
49
|
+
color: t.iconColor,
|
|
50
|
+
class: "icon-empty-icon"
|
|
51
|
+
}, {
|
|
52
|
+
default: m(() => [
|
|
53
|
+
(o(), s(p(t.icon)))
|
|
54
|
+
]),
|
|
55
|
+
_: 1
|
|
56
|
+
}, 8, ["size", "color"]),
|
|
57
|
+
l("div", {
|
|
58
|
+
class: "icon-empty-text",
|
|
59
|
+
style: y(c.value)
|
|
60
|
+
}, f(t.text), 5)
|
|
61
|
+
]));
|
|
62
|
+
}
|
|
63
|
+
}), b = /* @__PURE__ */ x(z, [["__scopeId", "data-v-c69a2cce"]]);
|
|
64
|
+
export {
|
|
65
|
+
b as I
|
|
66
|
+
};
|
package/es/index.mjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IconRenderer as e } from "./IconRenderer.mjs";
|
|
2
|
+
import { IconSelect as n } from "./IconSelect.mjs";
|
|
3
|
+
import { IconEmpty as i } from "./IconEmpty.mjs";
|
|
4
|
+
import { GlassProxy as m } from "./GlassProxy.mjs";
|
|
5
|
+
import { i as c } from "./chunks/config.BOO9PtC2.js";
|
|
6
|
+
import { dayjs as s } from "element-plus";
|
|
7
|
+
const o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
8
|
+
__proto__: null,
|
|
9
|
+
GlassProxy: m,
|
|
10
|
+
IconEmpty: i,
|
|
11
|
+
IconRenderer: e,
|
|
12
|
+
IconSelect: n,
|
|
13
|
+
iconLibraryMap: c
|
|
14
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
15
|
+
s.en.weekStart = 1;
|
|
16
|
+
const a = (t) => {
|
|
17
|
+
for (const r in o)
|
|
18
|
+
o[r].install && t.use(o[r]);
|
|
19
|
+
}, b = {
|
|
20
|
+
install: a
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
m as GlassProxy,
|
|
24
|
+
i as IconEmpty,
|
|
25
|
+
e as IconRenderer,
|
|
26
|
+
n as IconSelect,
|
|
27
|
+
b as default,
|
|
28
|
+
c as iconLibraryMap
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/GlassProxy.css');const U=require("./chunks/index.CkihWzK6.js"),e=require("vue"),W=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),j=["width","height"],Q=["width","height"],Z=["width","height"],J=["scale"],K=["stdDeviation"],X=Object.assign({name:"GlassProxy"},{__name:"layout",props:{cornerRadius:{type:Number,default:16},saturation:{type:Number,default:100},blurAmount:{type:Number,default:0},displacementScale:{type:Number,default:20},padding:{type:String,default:"0"},customClass:{type:String,default:""},background:{type:String,default:"transparent"},enableLiquidEffect:{type:Boolean,default:!0}},setup(c){const n=c,q=`liquid-filter-${Math.random().toString(36).substr(2,9)}`,u=e.ref(null),v=e.ref(null),h=e.ref(100),p=e.ref(100);let m=null;function w(t,o,l){return l=Math.max(0,Math.min(1,(l-t)/(o-t))),l*l*(3-2*l)}function _(t,o){return Math.sqrt(t*t+o*o)}function I(t,o,l,d,a){const s=Math.abs(t)-l+a,i=Math.abs(o)-d+a;return Math.min(Math.max(s,i),0)+_(Math.max(s,0),Math.max(i,0))-a}const y=()=>{if(!u.value||!v.value||!n.enableLiquidEffect)return;const t=u.value.getBoundingClientRect(),o=Math.floor(t.width),l=Math.floor(t.height);if(o===0||l===0)return;h.value=o,p.value=l;const d=window.devicePixelRatio||1,a=Math.floor(o*d),s=Math.floor(l*d),i=document.createElement("canvas");i.width=a,i.height=s;const x=i.getContext("2d");if(!x)return;const k=x.createImageData(a,s),g=k.data,r=a/s,C=(r>1?.5*r:.5)-.02,D=(r>1?.5:.5/r)-.02,P=Math.min(a,s),A=n.cornerRadius*d/P;for(let f=0;f<a*s;f++){const $=f%a,V=Math.floor(f/a),G=$/a,O=V/s;let S=G-.5,R=O-.5;r>1?S*=r:R/=r;const T=I(S,R,C,D,A),M=w(.2,0,T),F=127.5+S*M*255,H=127.5+R*M*255,b=f*4;g[b]=F,g[b+1]=H,g[b+2]=0,g[b+3]=255}x.putImageData(k,0,0),v.value.setAttribute("href",i.toDataURL("image/png",1))},B=e.computed(()=>({padding:n.padding,borderRadius:`${n.cornerRadius}px`,position:"relative",display:"block",boxSizing:"border-box"})),z=e.computed(()=>({position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:`${n.cornerRadius}px`,background:n.background,backdropFilter:`blur(10px) saturate(${n.saturation/100})`,boxShadow:"0 8px 32px 0 rgba(31, 38, 135, 0.07)",zIndex:0,transform:"translateZ(0)"})),N=e.computed(()=>({position:"absolute",top:0,left:0,width:"100%",height:"100%",borderRadius:`${n.cornerRadius}px`,background:"transparent",backdropFilter:"blur(12px)",boxShadow:"0 4px 12px rgba(0,0,0,0.05)",zIndex:0})),L=e.computed(()=>({borderRadius:`${n.cornerRadius}px`,"--corner-radius":`${n.cornerRadius}px`}));return e.onMounted(()=>{n.enableLiquidEffect&&e.nextTick(()=>{y(),u.value&&(m=new ResizeObserver(()=>{requestAnimationFrame(y)}),m.observe(u.value))})}),e.onUnmounted(()=>{m&&m.disconnect()}),e.watch(()=>n.enableLiquidEffect,t=>{t&&e.nextTick(y)}),(t,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:u,class:e.normalizeClass(["aibox-glass-proxy",c.customClass]),style:e.normalizeStyle(B.value)},[c.enableLiquidEffect?(e.openBlock(),e.createElementBlock("svg",{key:0,class:"glass-svg-defs",width:h.value,height:p.value,style:e.normalizeStyle({position:"absolute",pointerEvents:"none",zIndex:-1,top:0,left:0,clipPath:`inset(0 round ${n.cornerRadius}px)`})},[e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:q,filterUnits:"userSpaceOnUse",x:"0",y:"0",width:h.value,height:p.value,"color-interpolation-filters":"sRGB"},[e.createElementVNode("feImage",{ref_key:"feImageRef",ref:v,result:"DISPLACEMENT_MAP",width:h.value,height:p.value,preserveAspectRatio:"none","image-rendering":"optimizeQuality"},null,8,Z),e.createElementVNode("feDisplacementMap",{in:"SourceGraphic",in2:"DISPLACEMENT_MAP",scale:c.displacementScale,xChannelSelector:"R",yChannelSelector:"G"},null,8,J),e.createElementVNode("feGaussianBlur",{stdDeviation:c.blurAmount},null,8,K)],8,Q)])],12,j)):e.createCommentVNode("",!0),c.enableLiquidEffect?(e.openBlock(),e.createElementBlock("div",{key:1,class:"glass-liquid-bg",style:e.normalizeStyle(z.value)},null,4)):(e.openBlock(),e.createElementBlock("div",{key:2,class:"glass-fallback-bg",style:e.normalizeStyle(N.value)},null,4)),e.createElementVNode("div",{class:"glass-content-layer",style:e.normalizeStyle(L.value)},[e.renderSlot(t.$slots,"default",{},void 0,!0)],4)],6))}}),Y=W._export_sfc(X,[["__scopeId","data-v-f301f72e"]]),E=U.withInstall(Y);exports.GlassProxy=E;exports.default=E;
|
package/lib/IconEmpty.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./chunks/index.CkihWzK6.js"),o=require("./chunks/layout.B8d4J538.js"),e=t.withInstall(o.IconEmpty);exports.IconEmpty=e;exports.default=e;
|
|
@@ -0,0 +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.BbElhKS6.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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/IconSelect.css');const I=require("./chunks/index.CkihWzK6.js"),e=require("vue"),i=require("element-plus"),k=require("color-message-lingyun-vue"),V=require("./chunks/layout.B8d4J538.js"),w=require("ling-yun-methods"),m=require("./chunks/config.BbElhKS6.js"),_=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),B={class:"icon-select-content flex flex-col overflow-hidden"},C={class:"icon-select-grid overflow-y-auto display-grid"},E={key:0,class:"loading-text flex items-center justify-center w-full"},S={key:1,class:"no-data flex items-center justify-center w-full"},N=["title","onClick"],M=Object.assign({name:"IconSelect"},{__name:"layout",props:{modelValue:{type:String,default:""},placeholder:{type:String,default:"请选择图标"},width:{type:Number,default:520},iconSize:{type:Number,default:62},library:{type:String,default:m.iconLibraryMap.lingyun,validator:a=>Object.values(m.iconLibraryMap).includes(a)}},emits:[w.emitsMap.updateModelValue],setup(a,{emit:x}){const c=a,b=x,f=e.ref(!1),s=e.ref(""),n=e.ref(c.modelValue),r=e.ref(null),u=e.ref([]),v=e.ref(!1),p=async()=>{v.value=!0;try{const t=await m.getIconLibrary(c.library);u.value=Object.entries(t).filter(([o])=>o.toLowerCase().includes("menu")).map(([o,l])=>({name:o,component:e.markRaw(l)}))}catch(t){console.error("Failed to load icons:",t),u.value=[]}finally{v.value=!1}},y=e.computed(()=>s.value?u.value.filter(t=>t.name.toLowerCase().includes(s.value.toLowerCase())):u.value),d=async()=>{if(!n.value){r.value=null;return}const t=await m.getIconComponent(c.library,n.value);r.value=t?e.markRaw(t):null},h=t=>{n.value=t.name,b(w.emitsMap.updateModelValue,t.name),f.value=!1};return e.watch(()=>c.modelValue,t=>{n.value=t,d()}),e.watch(()=>c.library,()=>{p(),d()}),e.watch(()=>n.value,()=>{d()}),e.onMounted(()=>{p(),d()}),(t,o)=>(e.openBlock(),e.createBlock(e.unref(i.ElPopover),{visible:f.value,"onUpdate:visible":o[1]||(o[1]=l=>f.value=l),placement:"bottom-start",width:a.width,trigger:"click"},{reference:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center pointer radius-16 justify-center w-icon-item",{"select-icon-box bg-fcfdff text-202434 fz-14 flex-col":!r.value,"icon-item":n.value}])},[r.value?(e.openBlock(),e.createBlock(e.unref(i.ElIcon),{key:0,size:a.iconSize},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value)))]),_:1},8,["size"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(e.unref(i.ElIcon),{size:16},{default:e.withCtx(()=>[e.createVNode(e.unref(k.IconAdd))]),_:1}),o[2]||(o[2]=e.createTextVNode(" 上传 ",-1))],64))],2)]),default:e.withCtx(()=>[e.createElementVNode("div",B,[e.createVNode(e.unref(i.ElInput),{class:"mg-b-12",modelValue:s.value,"onUpdate:modelValue":o[0]||(o[0]=l=>s.value=l),placeholder:"搜索图标","prefix-icon":e.unref(k.IconSearch),clearable:""},null,8,["modelValue","prefix-icon"]),e.createElementVNode("div",C,[v.value?(e.openBlock(),e.createElementBlock("div",E," 加载中... ")):y.value.length===0?(e.openBlock(),e.createElementBlock("div",S,[e.createVNode(V.IconEmpty,{text:"未找到相关图标"})])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(y.value,l=>(e.openBlock(),e.createElementBlock("div",{key:l.name,class:e.normalizeClass(["icon-item radius-8 justify-center items-center pointer flex w-icon-item",{active:n.value===l.name}]),title:l.name,onClick:L=>h(l)},[e.createVNode(e.unref(i.ElIcon),{size:50},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.component)))]),_:2},1024)],10,N))),128))])])]),_:1},8,["visible","width"]))}}),z=_._export_sfc(M,[["__scopeId","data-v-5eacfea2"]]),g=I.withInstall(z);exports.IconSelect=g;exports.default=g;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.aibox-glass-proxy[data-v-f301f72e]{isolation:isolate}.glass-content-layer[data-v-f301f72e]{position:relative;z-index:2;width:calc(100% - 1px);height:calc(100% - 1px);box-sizing:border-box;color:var(--color-text-base, #303133);text-shadow:none!important;box-shadow:inset 0 4px 20px #29314f0f,0 4px 10px #29314f14;border-width:.8px;border-style:solid;border-color:transparent;border-image:none}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.icon-select-content[data-v-5eacfea2]{max-height:290px}.icon-select-grid[data-v-5eacfea2]{grid-template-columns:repeat(auto-fill,minmax(70px,1fr));gap:12px}.w-icon-item[data-v-5eacfea2]{width:70px;height:70px}.icon-item[data-v-5eacfea2]{background:#e6e9f2}.icon-item.active[data-v-5eacfea2]{background:#dbdee9}.select-icon-box[data-v-5eacfea2]{border:1px dashed var(--border-color)}.bg-fcfdff[data-v-5eacfea2]{background:#fcfdff}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=(t,o)=>{const c=t.__vccOpts||t;for(const[r,s]of o)c[r]=s;return c};exports._export_sfc=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e={lingyun:"lingyun",aibox:"aibox"},t=async n=>{switch(n){case e.lingyun:return await Promise.resolve().then(()=>require("./global.lWIoINdc.js"));case e.aibox:return await Promise.resolve().then(()=>require("./global.ZGY3DYHI.js"))}return null},i=async(n,r)=>{if(!r)return null;try{return(await t(n))[r]||null}catch(o){return console.warn(`Failed to load icon ${r} from ${n} library:`,o),null}};exports.getIconComponent=i;exports.getIconLibrary=t;exports.iconLibraryMap=e;
|