@techui/scifi 0.0.4-alpha.1 → 0.0.5-alpha.1

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 +1 @@
1
- import*as J from"echarts";import{$c as b}from"@techui/colors";const q=o=>{const{chart:e,common:l,font:r,scifi:t}=o,{bg:i,bd:s}=l,{line:{weak:a,base:c,strong:h},bubble:{fc:d,bg:n,hlite:y},map:{fc:S,fc_hov:m,fc_act:w,bg:p,bd:x,bg_hov:C,bd_hov:g,bg_act:W,bd_act:f,glow:L,shadow:u},palette_pri:k,palette_sec:A,visual:B}=e,{hlite:T,focus:_}=t,{weaker:v,weak:z,base:J,strong:N,stronger:O}=r;let q=b.scale(k,6,"lch"),D=b.scale(A,6,"lch"),F=b.scale(B,4,"lch");return JSON.stringify({color:q,textStyle:{},title:{textStyle:{color:J},subtextStyle:{color:z}},line:{label:{color:"inherit",textBorderColor:i,textBorderWidth:5},itemStyle:{borderWidth:"2"},lineStyle:{width:"3"},symbolSize:"7",symbol:"emptyCircle",smooth:!0},radar:{splitLine:{lineStyle:{show:!0,color:c,type:"dashed"}},axisLine:{show:!0,lineStyle:{color:c,type:"dashed"}},axisName:{show:!0,color:J},splitArea:{areaStyle:{color:[a,i]}},symbolSize:"7",symbol:"emptyCircle",markLine:{label:{color:"inherit",textBorderColor:i,textBorderWidth:5}},smooth:!0},bar:{itemStyle:{barBorderWidth:0,barBorderColor:a},markLine:{label:{color:"inherit",textBorderColor:i,textBorderWidth:5}}},pie:{itemStyle:{borderWidth:0,borderColor:i}},scatter:{label:{show:!0,color:d},emphasis:{labele:{fontWeight:"bold"}},itemStyle:{color:{type:"radial",x:.3,y:.3,r:.5,colorStops:[{offset:0,color:y},{offset:1,color:n}],global:!1},borderWidth:0,borderColor:a}},boxplot:{itemStyle:{borderWidth:0,borderColor:a}},parallel:{itemStyle:{borderWidth:0,borderColor:a}},sankey:{itemStyle:{borderWidth:0,borderColor:a}},funnel:{itemStyle:{borderWidth:0,borderColor:a}},gauge:{itemStyle:{borderWidth:0,borderColor:h},axisLine:{show:!0,lineStyle:{color:[[1,a]]}},axisTick:{show:!0,lineStyle:{color:h}},axisLabel:{show:!0,color:J},splitLine:{show:!0,lineStyle:{color:h}},detail:{color:"inherit"}},graph:{itemStyle:{borderWidth:0,borderColor:a},lineStyle:{width:1,color:c},symbolSize:"7",symbol:"circle",smooth:!0,color:D,label:{color:J}},map:{itemStyle:{areaColor:p,borderColor:x,borderWidth:.5},label:{color:J},emphasis:{itemStyle:{areaColor:C,borderColor:x,borderWidth:1},label:{color:J}}},geo:{scaleLimit:{min:.5,max:7},itemStyle:{areaColor:p,borderColor:x,shadowColor:u,shadowOffsetY:0,shadowBlur:5,borderWidth:.5},label:{show:!0,fontSize:12,color:S},emphasis:{itemStyle:{areaColor:C,borderColor:g,borderWidth:1},label:{fontSize:14,color:m}},select:{itemStyle:{areaColor:W,borderColor:f,borderWidth:1},label:{fontSize:14,color:w}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:c}},splitLine:{show:!1,lineStyle:{color:a}},axisTick:{show:!1,lineStyle:{color:a}},axisLabel:{show:!0,color:J},splitArea:{show:!1}},valueAxis:{axisLine:{show:!0,lineStyle:{color:c}},axisTick:{show:!1,lineStyle:{color:a}},axisLabel:{show:!0,color:J},splitLine:{show:!0,lineStyle:{color:a}},splitArea:{show:!1}},logAxis:{axisLine:{show:!0,lineStyle:{color:c}},axisTick:{show:!1,lineStyle:{color:a}},axisLabel:{show:!0,color:J},splitLine:{show:!1,lineStyle:{color:a}},splitArea:{show:!1}},timeAxis:{axisLine:{show:!0,lineStyle:{color:c}},axisTick:{show:!1,lineStyle:{color:a}},axisLabel:{show:!0,color:J},splitLine:{show:!1,lineStyle:{color:a}},splitArea:{show:!1}},toolbox:{iconStyle:{borderColor:J},emphasis:{iconStyle:{borderColor:N}}},legend:{y:"bottom",x:"center",textStyle:{color:J},itemStyle:{borderColor:"transparent",borderWidth:1,opacity:1}},tooltip:{backgroundColor:i,textStyle:{color:J},axisPointer:{lineStyle:{color:J,width:1},crossStyle:{color:J,width:1}}},timeline:{symbol:"circle",progress:{itemStyle:{color:T,borderColor:"white",borderWidth:0},lineStyle:{color:T,shadowColor:"rgba(0, 0, 0, 0)"}},lineStyle:{color:_,width:1,shadowColor:"rgba(0, 0, 0, 0)"},itemStyle:{color:_,borderColor:"white",borderWidth:0},controlStyle:{color:v,borderColor:"white",borderWidth:0},checkpointStyle:{symbol:"circle",color:T,borderColor:"white",borderWidth:0,shadowColor:"rgba(0, 0, 0, 0)"},label:{color:J},emphasis:{itemStyle:{color:_},controlStyle:{color:J,borderWidth:0},label:{color:N}}},visualMap:{color:F,textStyle:{color:J},zlevel:10}})};let F=null;function D(o){if(o)try{const e=JSON.parse(q(o));J.registerTheme("eTheme",e),F=o}catch(o){}}export{D as registerEchartsTheme};
1
+ import*as N from"echarts";import{$c as y}from"@techui/colors";const O=o=>{const{chart:e,common:r,font:l,scifi:t}=o,{bg:i,bd:s}=r,{line:{weak:a,base:c,strong:h},bubble:{fc:d,bg:b,hlite:n},map:{fc:S,fc_hov:m,fc_act:w,bg:x,bd:p,bg_hov:C,bd_hov:g,bg_act:W,bd_act:f,glow:L,shadow:u},palette:k,visual:T}=e,{hlite:A,focus:B}=t,{weaker:v,weak:z,base:_,strong:N,stronger:O}=l;let J=y.scale(k,6,"lch"),E=y.scale(T,4,"lch");return JSON.stringify({color:J,textStyle:{},title:{textStyle:{color:_},subtextStyle:{color:z}},line:{label:{color:"inherit",textBorderColor:i,textBorderWidth:5},itemStyle:{borderWidth:"2"},lineStyle:{width:"3"},symbolSize:"7",symbol:"emptyCircle",smooth:!0},radar:{splitLine:{lineStyle:{show:!0,color:c,type:"dashed"}},axisLine:{show:!0,lineStyle:{color:c,type:"dashed"}},axisName:{show:!0,color:_},splitArea:{areaStyle:{color:[a,i]}},symbolSize:"7",symbol:"emptyCircle",markLine:{label:{color:"inherit",textBorderColor:i,textBorderWidth:5}},smooth:!0},bar:{itemStyle:{barBorderWidth:0,barBorderColor:a},markLine:{label:{color:"inherit",textBorderColor:i,textBorderWidth:5}}},pie:{itemStyle:{borderWidth:0,borderColor:i}},scatter:{label:{show:!0,color:d},emphasis:{labele:{fontWeight:"bold"}},itemStyle:{color:{type:"radial",x:.3,y:.3,r:.5,colorStops:[{offset:0,color:n},{offset:1,color:b}],global:!1},borderWidth:0,borderColor:a}},boxplot:{itemStyle:{borderWidth:0,borderColor:a}},parallel:{itemStyle:{borderWidth:0,borderColor:a}},sankey:{itemStyle:{borderWidth:0,borderColor:a}},funnel:{itemStyle:{borderWidth:0,borderColor:a}},gauge:{itemStyle:{borderWidth:0,borderColor:h},axisLine:{show:!0,lineStyle:{color:[[1,a]]}},axisTick:{show:!0,lineStyle:{color:h}},axisLabel:{show:!0,color:_},splitLine:{show:!0,lineStyle:{color:h}},detail:{color:"inherit"}},graph:{itemStyle:{borderWidth:0,borderColor:a},lineStyle:{width:1,color:c},symbolSize:"7",symbol:"circle",smooth:!0,color:J,label:{color:_}},map:{itemStyle:{areaColor:x,borderColor:p,borderWidth:.5},label:{color:_},emphasis:{itemStyle:{areaColor:C,borderColor:p,borderWidth:1},label:{color:_}}},geo:{scaleLimit:{min:.5,max:7},itemStyle:{areaColor:x,borderColor:p,shadowColor:u,shadowOffsetY:0,shadowBlur:5,borderWidth:.5},label:{show:!0,fontSize:12,color:S},emphasis:{itemStyle:{areaColor:C,borderColor:g,borderWidth:1},label:{fontSize:14,color:m}},select:{itemStyle:{areaColor:W,borderColor:f,borderWidth:1},label:{fontSize:14,color:w}}},categoryAxis:{axisLine:{show:!0,lineStyle:{color:c}},splitLine:{show:!1,lineStyle:{color:a}},axisTick:{show:!1,lineStyle:{color:a}},axisLabel:{show:!0,color:_},splitArea:{show:!1}},valueAxis:{axisLine:{show:!0,lineStyle:{color:c}},axisTick:{show:!1,lineStyle:{color:a}},axisLabel:{show:!0,color:_},splitLine:{show:!0,lineStyle:{color:a}},splitArea:{show:!1}},logAxis:{axisLine:{show:!0,lineStyle:{color:c}},axisTick:{show:!1,lineStyle:{color:a}},axisLabel:{show:!0,color:_},splitLine:{show:!1,lineStyle:{color:a}},splitArea:{show:!1}},timeAxis:{axisLine:{show:!0,lineStyle:{color:c}},axisTick:{show:!1,lineStyle:{color:a}},axisLabel:{show:!0,color:_},splitLine:{show:!1,lineStyle:{color:a}},splitArea:{show:!1}},toolbox:{iconStyle:{borderColor:_},emphasis:{iconStyle:{borderColor:N}}},legend:{y:"bottom",x:"center",textStyle:{color:_},itemStyle:{borderColor:"transparent",borderWidth:1,opacity:1}},tooltip:{backgroundColor:i,textStyle:{color:_},axisPointer:{lineStyle:{color:_,width:1},crossStyle:{color:_,width:1}}},timeline:{symbol:"circle",progress:{itemStyle:{color:A,borderColor:"white",borderWidth:0},lineStyle:{color:A,shadowColor:"rgba(0, 0, 0, 0)"}},lineStyle:{color:B,width:1,shadowColor:"rgba(0, 0, 0, 0)"},itemStyle:{color:B,borderColor:"white",borderWidth:0},controlStyle:{color:v,borderColor:"white",borderWidth:0},checkpointStyle:{symbol:"circle",color:A,borderColor:"white",borderWidth:0,shadowColor:"rgba(0, 0, 0, 0)"},label:{color:_},emphasis:{itemStyle:{color:B},controlStyle:{color:_,borderWidth:0},label:{color:N}}},visualMap:{color:E,textStyle:{color:_},zlevel:10}})};let J=null;function $(o){if(o)try{const e=JSON.parse(O(o));N.registerTheme("eTheme",e),J=o}catch(o){console.error("registerEchartsTheme: Failed to register theme",o)}else console.warn("registerEchartsTheme: themePalette is required!")}export{$ as registerEchartsTheme};
@@ -1 +1 @@
1
- import{inject as D,ref as I,shallowRef as U,reactive as q,watch as h,nextTick as f,computed as H,onMounted as L,onBeforeUnmount as W,resolveComponent as F,resolveDirective as V,createBlock as Q,openBlock as J,withCtx as K,withDirectives as X,createElementVNode as Y,normalizeStyle as Z,normalizeClass as ee,unref as B}from"vue";import{cidGen as te,cssVarGen as ie}from"@techui/scifi";import{tQuery as T,tClass as E,tStr as ae,tType as _}from"@techui/utils";import*as re from"echarts";import{$c as ne}from"@techui/colors";const oe=(e,t,a="358")=>{const i=T.get1stParent(e,".tui-3d-panel");if(!i)return;if(E.has(i,"is-3doff"))return;if(!(e&&e instanceof HTMLElement&&"string"==typeof t&&""!==t.trim()))return;const r=e.querySelector("svg");if(!r)return;const l="pathG"+t,n=r.querySelector(`g#${CSS.escape(l)}`);n&&r.removeChild(n);const s=r.querySelectorAll("path"),o=[];if(s.forEach((e=>{const t=e.getAttribute("stroke-width");null!=t&&""!==t.trim()&&String(t).includes(a)&&o.push(e)})),o.length>0){const e=document.createElementNS("http://www.w3.org/2000/svg","g");e.setAttribute("id",l),o.forEach((t=>{const a=t.getAttribute("fill"),i=t.getAttribute("stroke");t.setAttribute("class","ori-svg-item");const r=t.cloneNode(!0);r.setAttribute("class","t3d-shadow-item"),r.setAttribute("style",`--tui-t3d-thickcolor:${ne.darken("none"!=a?a:i,2.5)}`),e.appendChild(r)})),r.insertBefore(e,r.firstChild)}},le=e=>{const t="pathG"+e,a=T.el(`#${t}`);a&&a.remove()},P="TuiEcharts",he=Object.assign({name:P},{__name:"tuiEcharts",props:{width:[Number,String],height:[Number,String],chartOption:{type:Object,required:!0},initOptions:{type:Object,default:()=>({})},loading:{type:Boolean,default:!0},initT3DShadow:{type:Boolean,default:!1},t3DShadowUpdate:{type:String,default:"finished",validator:e=>["rendered","finished"].includes(e)},initHold:{type:Boolean,default:!1},dataOpacity:Number,dataBlur:Number,initDelay:{type:Number,default:0},resizeObserver:{type:String,default:"global",validator:e=>["self","global","none"].includes(e)}},emits:["chartClick","chartDblClick","chartMouseDown","chartMouseUp","chartMouseOver","chartGlobalOut","chartInit","chartReady","chartRendered","chartFinished","update:loading"],setup(e,{expose:t,emit:a}){const{$gT3D:i,$gTheme:r,$optResizeCounter:l,initResizeBy:n}=D("$global"),s=n(),o=te(P),u="echart_"+ae.rdm(),c=e,d=a,p=I(null),v=U(null);let g=null;const m=q({loading:!0,inited:!1,resizing:!0}),b=async()=>{if(p.value)try{if(S(),v.value)return;await f(),v.value=re.init(p.value,"eTheme",{...c.initOptions,renderer:"svg"}),d("chartInit",v.value),v.value.setOption(c.chartOption),y(),await f(),v.value&&d("chartReady",v.value)}catch(e){}},y=()=>{if(!v.value)return;const e=(e,t)=>{v.value&&v.value.on(e,t)};e("click",(e=>d("chartClick",e))),e("dblclick",(e=>d("chartDblClick",e))),e("mousedown",(e=>d("chartMouseDown",e))),e("mouseup",(e=>d("chartMouseUp",e))),e("mouseover",(e=>d("chartMouseOver",e))),e("globalout",(e=>d("chartGlobalOut",e))),e("rendered",(()=>{v.value&&"rendered"==c.t3DShadowUpdate&&w(),d("chartRendered")})),e("finished",(function(){v.value&&("finished"==c.t3DShadowUpdate&&w(),d("chartFinished"),d("update:loading",!1),m.loading=!1,m.inited=!1)}))},w=()=>{if(!p.value)return;let e=!0;const t=T.get1stParent(p.value,".tui-3d-panel");(!t||t&&E.has(t,"is-3doff"))&&(e=!1),c.initT3DShadow&&e?oe(p.value,u):le(u)},O=D("TuiT3DPanel");h((()=>[i.value,c.initT3DShadow,O?.view3d?.value]),(([e,t,a])=>{w()})),h((()=>r.value),(async e=>{v.value&&(await f(),v.value.setTheme("eTheme"))}));const S=()=>{v.value&&(v.value.dispose(),v.value=null)},z=()=>{v.value&&v.value.resize()};h((()=>c.initHold),(e=>{e||b()})),h((()=>c.chartOption),(()=>{v.value&&f((()=>{v.value&&(v.value.setOption(c.chartOption),m.loading=!1,d("update:loading",!1))}))}),{deep:!0}),h((()=>c.loading),(e=>{null!=e&&(m.loading=e)}),{immediate:!0});const k=H((()=>ie("cpt-echart",{...c.width&&{width:_.join("number",c.width,"px")},...c.height&&{height:_.join("number",c.height,"px")},...c.dataOpacity&&{opa:c.dataOpacity},...c.dataBlur&&{blur:c.dataBlur+"px"}})));h((()=>l.value),((e,t)=>{"root"==s.value(c.resizeObserver)&&e>t&&C()}));const C=async()=>{m.resizing=!0,z(),await f(),setTimeout((()=>{m?.resizing&&(m.resizing=!1)}),500)};return L((()=>{c.initHold||(c.initDelay>0?g=setTimeout((()=>{g=null,p.value&&b()}),c.initDelay):f((()=>{b()})))})),W((()=>{g&&(clearTimeout(g),g=null),S()})),t({resize:z,getChart:()=>v.value,setOption:(e,t)=>{v.value&&v.value.setOption(e,t)},clear:()=>{v.value&&v.value.clear()},dispose:S}),(t,a)=>{const i=F("TuiLoaderPanel"),r=V("tui-resize");return J(),Q(i,{loading:m.loading,inited:m.inited},{default:K((()=>[X(Y("div",{ref_key:"chartRef",ref:p,class:ee(["tui-echarts",{"is-resizing":m.resizing}]),style:Z(k.value)},null,6),[[r,{callback:C,uid:u,cid:B(o),disabled:"self"!=B(s)(e.resizeObserver)}]])])),_:1},8,["loading","inited"])}}});export{he as default};
1
+ import{inject as D,ref as U,shallowRef as q,reactive as L,computed as B,watch as v,nextTick as h,onMounted as W,onBeforeUnmount as F,resolveComponent as V,resolveDirective as H,createBlock as Q,openBlock as J,withCtx as K,withDirectives as X,renderSlot as Y,createElementVNode as Z,normalizeStyle as ee,normalizeClass as te,unref as P}from"vue";import{cidGen as ie,cssVarGen as ae}from"@techui/scifi";import{tQuery as z,tClass as R,tStr as re,tType as _}from"@techui/utils";import*as ne from"echarts";import{$c as oe}from"@techui/colors";const se=(e,t,a="358")=>{const i=z.get1stParent(e,".tui-3d-panel");if(!i)return;if(R.has(i,"is-3doff"))return;if(!(e&&e instanceof HTMLElement&&"string"==typeof t&&""!==t.trim()))return;const r=e.querySelector("svg");if(!r)return;const l="pathG"+t,n=r.querySelector(`g#${CSS.escape(l)}`);n&&r.removeChild(n);const s=r.querySelectorAll("path"),o=[];if(s.forEach((e=>{const t=e.getAttribute("stroke-width");null!=t&&""!==t.trim()&&String(t).includes(a)&&o.push(e)})),o.length>0){const e=document.createElementNS("http://www.w3.org/2000/svg","g");e.setAttribute("id",l),o.forEach((t=>{const a=t.getAttribute("fill"),i=t.getAttribute("stroke");t.setAttribute("class","ori-svg-item");const r=t.cloneNode(!0);r.setAttribute("class","t3d-shadow-item"),r.setAttribute("style",`--tui-t3d-thickcolor:${oe.darken("none"!=a?a:i,2.5)}`),e.appendChild(r)})),r.insertBefore(e,r.firstChild)}},le=e=>{const t="pathG"+e,a=z.el(`#${t}`);a&&a.remove()},E="TuiEcharts",fe=Object.assign({name:E},{__name:"tuiEcharts",props:{width:[Number,String],height:[Number,String],chartOption:{type:Object,required:!0},initOptions:{type:Object,default:()=>({})},loading:{type:Boolean,default:null},initT3DShadow:{type:Boolean,default:!1},t3DShadowUpdate:{type:String,default:"finished",validator:e=>["rendered","finished"].includes(e)},renderer:{type:String,default:"canvas",validator:e=>["svg","canvas"].includes(e)},ready:{type:Boolean,default:!1},dataOpacity:Number,dataBlur:Number,resizeObserver:{type:String,default:"global",validator:e=>["self","global","none"].includes(e)}},emits:["chartClick","chartDblClick","chartMouseDown","chartMouseUp","chartMouseOver","chartGlobalOut","chartInit","chartReady","chartRendered","chartFinished","update:loading"],setup(e,{expose:t,emit:a}){const{$gT3D:i,$gTheme:r,$optResizeCounter:l,initResizeBy:n}=D("$global",null),s=n(),o=ie(E),u="echart_"+re.rdm(),c=e,d=a,p=U(null),f=q(null),g=L({loading:!0,inited:!1,resizing:!0}),m=B({get:()=>c.loading??g.loading,set:e=>{null!==c.loading?d("update:loading",e):g.loading=e}}),b=async()=>{if(p.value)try{if(S(),f.value)return;await h(),f.value=ne.init(p.value,"eTheme",{...c.initOptions,renderer:c.initT3DShadow?"svg":c.renderer}),d("chartInit",f.value),f.value.setOption(c.chartOption),y(),await h(),f.value&&(d("chartReady",f.value),m.value=!1)}catch(e){console.error("ECharts initialization failed:",e)}},y=()=>{if(!f.value)return;const e=(e,t)=>{f.value&&f.value.on(e,t)};e("click",(e=>d("chartClick",e))),e("dblclick",(e=>d("chartDblClick",e))),e("mousedown",(e=>d("chartMouseDown",e))),e("mouseup",(e=>d("chartMouseUp",e))),e("mouseover",(e=>d("chartMouseOver",e))),e("globalout",(e=>d("chartGlobalOut",e))),e("rendered",(()=>{f.value&&"rendered"==c.t3DShadowUpdate&&w(),d("chartRendered")})),e("finished",(function(){f.value&&("finished"==c.t3DShadowUpdate&&w(),d("chartFinished"),m.value=!1,g.inited=!1)}))},w=()=>{if(!p.value)return;let e=!0;const t=z.get1stParent(p.value,".tui-3d-panel");(!t||t&&R.has(t,"is-3doff"))&&(e=!1),c.initT3DShadow&&e?se(p.value,u):le(u)},O=D("TuiT3DPanel",null);v((()=>[i.value,c.initT3DShadow,O?.view3d?.value]),(([e,t,a])=>{w()})),v((()=>r.value),(async e=>{f.value&&(await h(),f.value.setTheme("eTheme"))}));const S=()=>{f.value&&(f.value.dispose(),f.value=null)},T=()=>{f.value&&f.value.resize()};v((()=>c.ready),(e=>{e&&b()})),v((()=>c.chartOption),(()=>{f.value&&h((()=>{f.value&&(f.value.setOption(c.chartOption),m.value=!1)}))}),{deep:!0});const C=B((()=>ae("cpt-echart",{...c.width&&{width:_.join("number",c.width,"px")},...c.height&&{height:_.join("number",c.height,"px")},...c.dataOpacity&&{opa:c.dataOpacity},...c.dataBlur&&{blur:c.dataBlur+"px"}})));v((()=>l.value),((e,t)=>{"root"==s.value(c.resizeObserver)&&e>t&&k()}));const k=async()=>{g.resizing=!0,T(),await h(),setTimeout((()=>{g?.resizing&&(g.resizing=!1)}),500)};return W((()=>{c.ready&&h((()=>{b()}))})),F((()=>{S()})),t({resize:T,getChart:()=>f.value,setOption:(e,t)=>{f.value&&f.value.setOption(e,t)},clear:()=>{f.value&&f.value.clear()},initChart:b,dispose:S}),(t,a)=>{const i=V("TuiLoaderPanel"),r=H("tui-resize");return J(),Q(i,{loading:m.value,inited:g.inited},{default:K((()=>[X(Z("div",{ref_key:"chartRef",ref:p,class:te(["tui-echarts",{"is-resizing":g.resizing}]),style:ee(C.value)},null,6),[[r,{callback:k,uid:u,cid:P(o),disabled:"self"!=P(s)(e.resizeObserver)}]]),Y(t.$slots,"default")])),_:3},8,["loading","inited"])}}});export{fe as default};
@@ -1 +1 @@
1
- import{nextTick as y,markRaw as Q,inject as W,ref as Z,shallowRef as I,reactive as ee,computed as T,watch as b,onMounted as te,onBeforeUnmount as ae,resolveComponent as ie,resolveDirective as re,createBlock as oe,openBlock as C,withCtx as ne,withDirectives as le,createElementBlock as D,createCommentVNode as ue,createElementVNode as B,normalizeStyle as x,normalizeClass as ce,unref as N,Fragment as se,renderList as de,toDisplayString as fe}from"vue";import{cidGen as pe,cssVarGen as ve}from"@techui/scifi";import{tEvent as me,tStr as ge,tType as j}from"@techui/utils";import*as U from"echarts";const he=(e,a,t,i,l)=>{if(!e.value)return;const r=(a,t)=>{e.value&&e.value.on(a,t)};r("click",me.debounce((t=>{let l,r=t;if(t.value&&!a.chartOption.geo3D)l=e.value.convertToPixel("geo",[t.value[0],t.value[1]]),r.domPosition=l;else if("geo"==t.componentType&&t.event?.offsetX){const{offsetX:a,offsetY:i}=t.event;l=e.value.convertFromPixel("geo",[a,i]),r.coordPosition=l}i("chartClick",r,t)}),500,!0)),r("dblclick",(e=>i("chartDblClick",e))),r("mousedown",(e=>i("chartMouseDown",e))),r("mouseup",(e=>i("chartMouseUp",e))),r("mouseover",(e=>i("chartMouseOver",e))),r("globalout",(e=>i("chartGlobalOut",e))),r("geoRoam",(e=>i("chartGeoRoam",e))),r("timelinechanged",(t=>{const{allAreaCodes:l,chartOption:{timeline:r}}=a;let o=t;if("geoTitle"==r.titleType){let a=r.data[t.currentIndex],i=l.find((e=>e.name.includes(a))),n=e.value.convertToPixel("geo",[i.lng,i.lat]);o.domPosition=n,o.current=i}i("chartTimelinechanged",o)})),r("rendered",(()=>{e.value&&"rendered"===a.t3DShadowUpdate&&P(l),i("chartRendered")})),r("finished",(()=>{e.value&&("finished"===a.t3DShadowUpdate&&P(l),i("chartFinished"),i("update:loading",!1),t.loading=!1,t.inited=!0)}))},P=e=>{e.value},be=e=>{e.value&&e.value.resize()},ye=e=>e.value,Oe=(e,a,t)=>{e.value&&e.value.setOption(a,t)},Ce=e=>{e.value&&e.value.clear()},ke=e=>{if(e.value)try{const a=e.value.getOption();a.geo&&a.geo[0]&&(a.geo[0].roam=!0,a.geo[0].zoom=1,a.geo[0].center=null,e.value.setOption(a,!1))}catch(e){}},G=(e,a)=>{try{return!!a&&(U.registerMap(e,a),!0)}catch(e){return!1}},we=async(e,a,t,i,l,r)=>{if(e.value)try{if(F(a),a.value)return;if(!G(t.mapName,t.geoJsonData))return;await y(),a.value=Q(U.init(e.value,"eTheme",{...t.initOptions,notMerge:!1})),l("chartInit",a.value),a.value.setOption(t.chartOption),r(),await y(),a.value&&l("chartReady",a.value)}catch(e){}},ze=(e,a,t,i,l=!1)=>{e.value&&(e.value.setOption(a,l),t.loading=!1,i("update:loading",!1),i("chartUpdate"))},F=e=>{e.value&&(e.value.dispose(),e.value=null)},Te=["onClick"],De={class:"breadcrumb-text"},E="TuiEchartsMap",Se=Object.assign({name:E},{__name:"tuiEchartsMap",props:{width:[Number,String],height:[Number,String],chartOption:{type:Object,required:!0},geoJsonData:{type:Object,required:!0},allAreaCodes:Object,mapName:{type:String,required:!0},initOptions:{type:Object,default:()=>({})},loading:{type:Boolean,default:!0},initT3DShadow:{type:Boolean,default:!1},t3DShadowUpdate:{type:String,default:"finished",validator:e=>["rendered","finished"].includes(e)},initHold:{type:Boolean,default:!1},dataOpacity:Number,dataBlur:Number,initDelay:{type:Number,default:0},resizeObserver:{type:String,default:"global",validator:e=>["self","global","none"].includes(e)},updateReplace:{type:Boolean,default:!0},enableBreadcrumb:{type:Boolean,default:!1},breadcrumbConfig:{type:Object,default:()=>({data:[{code:1e5,name:"全国"}],position:{top:"5%",left:"5%"}})}},emits:["chartClick","chartDblClick","chartMouseDown","chartMouseUp","chartMouseOver","chartGlobalOut","chartInit","chartReady","chartRendered","chartFinished","chartGeoRoam","chartUpdate","chartTimelinechanged","breadcrumbClick","update:loading"],setup(e,{expose:a,emit:t}){const{$gT3D:i,$gTheme:l,$optResizeCounter:r,initResizeBy:o}=W("$global"),n=o(),u=pe(E),s="echart_map_"+ge.rdm(),c=Z(null),d=I(null);let p=null;const m=e,h=t,v=ee({loading:!0,inited:!1,resizing:!0}),g=T((()=>m.breadcrumbConfig?.data||[])),f=T((()=>{let e=m.breadcrumbConfig?.position||{},a={};for(let t in e)"number"==typeof e[t]?a[t]=e[t]+"px":a[t]=e[t];return a})),O=async()=>{await we(c,d,m,0,h,k,m.updateReplace)},w=()=>{ze(d,m.chartOption,v,h,m.updateReplace)},k=()=>{he(d,m,v,h,c)},z=()=>{F(d)},R=()=>{be(d)},S=T((()=>ve("cpt-echart-map",{...m.width&&{width:j.join("number",m.width,"px")},...m.height&&{height:j.join("number",m.height,"px")},...m.dataOpacity&&{opa:m.dataOpacity},...m.dataBlur&&{blur:m.dataBlur+"px"}})));b((()=>m.geoJsonData),(()=>{d.value&&(G(m.mapName,m.geoJsonData),y((()=>{w()})))}),{deep:!0}),b((()=>m.initHold),(e=>{e||O()})),b((()=>m.chartOption),(()=>{d.value&&y((()=>{w()}))}),{deep:!0}),b((()=>m.loading),(e=>{void 0!==e&&(v.loading=e)}),{immediate:!0}),b((()=>l.value),(e=>{d.value&&d.value.setTheme("eTheme")})),b((()=>r.value),((e,a)=>{"root"==n.value(m.resizeObserver)&&e>a&&M()}));const M=async()=>{v.resizing=!0,R(),await y(),setTimeout((()=>{v?.resizing&&(v.resizing=!1)}),500)};return te((()=>{m.initHold||(m.initDelay>0?p=setTimeout((()=>{p=null,c.value&&O()}),m.initDelay):y((()=>{O()})))})),ae((()=>{p&&(clearTimeout(p),p=null),z()})),a({resize:R,getChart:()=>ye(d),setOption:(e,a)=>{Oe(d,e,a)},clear:()=>{Ce(d)},resetMapView:()=>{ke(d)},dispose:z}),(a,t)=>{const i=ie("TuiLoaderPanel"),l=re("tui-resize");return C(),oe(i,{loading:v.loading,inited:v.inited},{default:ne((()=>[le(B("div",{ref_key:"mapRef",ref:c,class:ce(["tui-echarts-map",{"is-resizing":v.resizing}]),style:x(S.value)},null,6),[[l,{callback:M,uid:s,cid:N(u),disabled:"self"!=N(n)(e.resizeObserver)}]]),e.enableBreadcrumb&&g.value.length>0?(C(),D("div",{key:0,class:"tui-map-breadcrumb",style:x(f.value)},[(C(!0),D(se,null,de(g.value,((e,a)=>(C(),D("div",{key:`${e.code}-${a}`,class:"breadcrumb-item",onClick:t=>((e,a)=>{const t=g.value.slice(0,a+1);h("breadcrumbClick",{item:e,index:a,breadcrumb:t,chart:d.value})})(e,a)},[B("span",De,fe(e.name),1)],8,Te)))),128)),t[0]||(t[0]=B("i",{class:"tui-icon ti-map breadcrumb-icon"},null,-1))],4)):ue("",!0)])),_:1},8,["loading","inited"])}}});export{Se as default};
1
+ import{nextTick as m,markRaw as K,inject as Q,ref as W,shallowRef as Z,reactive as I,computed as C,watch as y,onMounted as ee,onBeforeUnmount as te,resolveComponent as ae,resolveDirective as re,createBlock as ie,openBlock as k,withCtx as oe,withDirectives as ne,createElementBlock as B,createCommentVNode as le,renderSlot as ce,createElementVNode as M,normalizeStyle as x,normalizeClass as ue,unref as N,Fragment as se,renderList as de,toDisplayString as pe}from"vue";import{cidGen as fe,cssVarGen as ve}from"@techui/scifi";import{tEvent as ge,tStr as me,tType as S}from"@techui/utils";import*as E from"echarts";const be=(e,a,t,i,r)=>{if(!e.value)return;const o=(a,t)=>{e.value&&e.value.on(a,t)};o("click",ge.debounce((t=>{let r,o=t;if(t.value&&!a.chartOption.geo3D)r=e.value.convertToPixel("geo",[t.value[0],t.value[1]]),o.domPosition=r;else if("geo"==t.componentType&&t.event?.offsetX){const{offsetX:a,offsetY:i}=t.event;r=e.value.convertFromPixel("geo",[a,i]),o.coordPosition=r}i("chartClick",o,t)}),500,!0)),o("dblclick",(e=>i("chartDblClick",e))),o("mousedown",(e=>i("chartMouseDown",e))),o("mouseup",(e=>i("chartMouseUp",e))),o("mouseover",(e=>i("chartMouseOver",e))),o("globalout",(e=>i("chartGlobalOut",e))),o("geoRoam",(e=>i("chartGeoRoam",e))),o("timelinechanged",(t=>{const{allAreaCodes:r,chartOption:{timeline:o}}=a;let l=t;if("geoTitle"==o.titleType){let a=o.data[t.currentIndex],i=r.find((e=>e.name.includes(a))),n=e.value.convertToPixel("geo",[i.lng,i.lat]);l.domPosition=n,l.current=i}i("chartTimelinechanged",l)})),o("rendered",(()=>{i("chartRendered")})),o("finished",(()=>{e.value&&(i("chartFinished"),t.inited=!0)}))},he=e=>{e.value&&e.value.resize()},ye=e=>e.value,Oe=(e,a,t)=>{e.value&&e.value.setOption(a,t)},Ce=e=>{e.value&&e.value.clear()},ke=e=>{if(e.value)try{const a=e.value.getOption();a.geo&&a.geo[0]&&(a.geo[0].roam=!0,a.geo[0].zoom=1,a.geo[0].center=null,e.value.setOption(a,!1))}catch(e){console.error("Failed to reset map view:",e)}},G=(e,a)=>{try{return a?(E.registerMap(e,a),!0):(console.warn("GeoJSON data is missing"),!1)}catch(e){return console.error("Failed to register map:",e),!1}},ze=async(e,a,t,i,r,o)=>{if(e.value)try{if(F(a),a.value)return;if(!G(t.mapName,t.geoJsonData))return void console.error("Map registration failed, aborting chart initialization");await m(),a.value=K(E.init(e.value,"eTheme",{...t.initOptions,notMerge:!1,renderer:t.renderer})),r("chartInit",a.value),a.value.setOption(t.chartOption),o(),await m(),a.value&&(r("chartReady",a.value),i.value=!1)}catch(e){console.error("ECharts Map initialization failed:",e)}},we=(e,a,t,i,r=!1)=>{e.value&&(e.value.setOption(a,r),t.value=!1,i("chartUpdate"))},F=e=>{e.value&&(e.value.dispose(),e.value=null)},Te=["onClick"],Be={class:"breadcrumb-text"},P="TuiEchartsMap",_e=Object.assign({name:P},{__name:"tuiEchartsMap",props:{width:[Number,String],height:[Number,String],chartOption:{type:Object,required:!0},geoJsonData:{type:Object,required:!0},allAreaCodes:Object,mapName:{type:String,required:!0},initOptions:{type:Object,default:()=>({})},loading:{type:Boolean,default:null},renderer:{type:String,default:"canvas",validator:e=>["svg","canvas"].includes(e)},ready:{type:Boolean,default:!1},dataOpacity:Number,dataBlur:Number,resizeObserver:{type:String,default:"global",validator:e=>["self","global","none"].includes(e)},updateReplace:{type:Boolean,default:!0},enableBreadcrumb:{type:Boolean,default:!1},breadcrumbConfig:{type:Object,default:()=>({data:[{code:1e5,name:"全国"}],position:{top:"5%",left:"5%"}})}},emits:["chartClick","chartDblClick","chartMouseDown","chartMouseUp","chartMouseOver","chartGlobalOut","chartInit","chartReady","chartRendered","chartFinished","chartGeoRoam","chartUpdate","chartTimelinechanged","breadcrumbClick","update:loading"],setup(e,{expose:a,emit:t}){const{$gT3D:i,$gTheme:r,$optResizeCounter:o,initResizeBy:l}=Q("$global",null),n=l(),s=fe(P),c="echart_map_"+me.rdm(),u=W(null),d=Z(null),p=e,v=t,h=I({loading:!0,inited:!1,resizing:!0}),g=C({get:()=>p.loading??h.loading,set:e=>{null!==p.loading?v("update:loading",e):h.loading=e}}),b=C((()=>p.breadcrumbConfig?.data||[])),f=C((()=>{let e=p.breadcrumbConfig?.position||{},a={};for(let t in e)"number"==typeof e[t]?a[t]=e[t]+"px":a[t]=e[t];return a})),O=async()=>{await ze(u,d,p,g,v,z,p.updateReplace)},w=()=>{we(d,p.chartOption,g,v,p.updateReplace)},z=()=>{be(d,p,h,v)},T=()=>{F(d)},R=()=>{he(d)},D=C((()=>ve("cpt-echart-map",{...p.width&&{width:S.join("number",p.width,"px")},...p.height&&{height:S.join("number",p.height,"px")},...p.dataOpacity&&{opa:p.dataOpacity},...p.dataBlur&&{blur:p.dataBlur+"px"}})));y((()=>p.geoJsonData),(()=>{d.value&&(G(p.mapName,p.geoJsonData),m((()=>{w()})))}),{deep:!0}),y((()=>p.ready),(e=>{e&&O()})),y((()=>p.chartOption),(()=>{d.value&&m((()=>{w()}))}),{deep:!0}),y((()=>r.value),(e=>{d.value&&m((()=>{d.value.setTheme("eTheme")}))})),y((()=>o.value),((e,a)=>{"root"==n.value(p.resizeObserver)&&e>a&&j()}));const j=async()=>{h.resizing=!0,R(),await m(),setTimeout((()=>{h?.resizing&&(h.resizing=!1)}),500)};return ee((()=>{p.ready&&m((()=>{O()}))})),te((()=>{T()})),a({resize:R,getChart:()=>ye(d),setOption:(e,a)=>{Oe(d,e,a)},initChart:O,clear:()=>{Ce(d)},resetMapView:()=>{ke(d)},dispose:T}),(a,t)=>{const i=ae("TuiLoaderPanel"),r=re("tui-resize");return k(),ie(i,{loading:g.value,inited:h.inited},{default:oe((()=>[ne(M("div",{ref_key:"mapRef",ref:u,class:ue(["tui-echarts-map",{"is-resizing":h.resizing}]),style:x(D.value)},null,6),[[r,{callback:j,uid:c,cid:N(s),disabled:"self"!=N(n)(e.resizeObserver)}]]),e.enableBreadcrumb&&b.value.length>0?(k(),B("div",{key:0,class:"tui-map-breadcrumb",style:x(f.value)},[(k(!0),B(se,null,de(b.value,((e,a)=>(k(),B("div",{key:`${e.code}-${a}`,class:"breadcrumb-item",onClick:t=>((e,a)=>{const t=b.value.slice(0,a+1);v("breadcrumbClick",{item:e,index:a,breadcrumb:t,chart:d.value})})(e,a)},[M("span",Be,pe(e.name),1)],8,Te)))),128)),t[0]||(t[0]=M("i",{class:"tui-icon ti-map breadcrumb-icon"},null,-1))],4)):le("",!0),ce(a.$slots,"default")])),_:3},8,["loading","inited"])}}});export{_e as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techui/scifi",
3
- "version": "0.0.4-alpha.1",
3
+ "version": "0.0.5-alpha.1",
4
4
  "description": "TechUI Scifi is a sci-fi SVG component library developed based on Vue3. It uses dynamically calculated SVG elements to generate a variety of cool, futuristic, and technological components.",
5
5
  "author": "aYin <ayin86cn@gmail.com> <wechat:jay1986cn>",
6
6
  "homepage": "https://techui.net",
@@ -41,13 +41,13 @@
41
41
  ],
42
42
 
43
43
  "dependencies": {
44
- "@techui/icons": "*",
45
- "@techui/libs": "*",
46
- "@techui/colors": "^1.0.1",
47
- "@techui/lessmixins": "^1.0.0",
48
- "@techui/locales": "0.0.4",
49
- "@techui/themes": "0.0.4",
50
- "@techui/utils": "0.0.4",
44
+ "@techui/icons": "1.0.2",
45
+ "@techui/colors": "1.0.1",
46
+ "@techui/lessmixins": "0.0.5",
47
+ "@techui/libs": "0.0.5",
48
+ "@techui/locales": "0.0.5",
49
+ "@techui/themes": "0.0.5",
50
+ "@techui/utils": "0.0.5",
51
51
  "vue": "^3.4.27",
52
52
  "vue-router": "^4.3.2"
53
53
  },
package/core/package.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "name": "core",
3
- "collaborators": [
4
- "ayin86 <ayin86cn@gmail.com>"
5
- ],
6
- "description": "It's a private project.",
7
- "version": "0.3.0",
8
- "license": "none",
9
- "repository": {
10
- "type": "git",
11
- "url": "https://github.com/jason86cn"
12
- },
13
- "files": [
14
- "core_bg.wasm",
15
- "core.js",
16
- "core.d.ts",
17
- "LICENSE_APACHE",
18
- "LICENSE_MIT"
19
- ],
20
- "module": "core.js",
21
- "types": "core.d.ts",
22
- "sideEffects": [
23
- "./snippets/*"
24
- ]
25
- }
package/index-bak.js DELETED
@@ -1,156 +0,0 @@
1
- import "@techui/icons";
2
- import tuiLocales from "@techui/locales";
3
- import "./dist/index.css";
4
- import { dynamicEcharts, toComps, toDirective, toGlobal, toRoot } from "./dist/index.js";
5
-
6
- const initComps=(app,license,features,debug=false)=>{
7
- const {echarts=false,advanced=false,}=features
8
- app.use(toGlobal.$gMask)
9
- app.use(toGlobal.$gLoading)
10
- app.directive('tuiResize', toDirective.$dResize)
11
- app.directive('tuiDrag', toDirective.$dDrag)
12
- app.directive('tuiVcid', toDirective.$dVcid)
13
- const tService=toRoot.tuiService(advanced,debug)
14
- app.config.globalProperties.$tStoreLocales = tuiLocales
15
- app.config.globalProperties.$tBus = toRoot.tuiBus
16
- app.config.globalProperties.$tService = tService
17
- app.config.globalProperties.$tState = tService.state
18
- app.config.globalProperties.isActAdvFeatures = advanced||license!=null
19
- app.config.globalProperties.isActEchartsFeatures = echarts
20
- app.config.globalProperties.isActAdminFeatures=false
21
- const advanceComps=[
22
- "Tui3DPanel",
23
- "TuiBar3D",
24
- "TuiBar3DGroup",
25
- "TuiPie",
26
- ]
27
- dynamicEcharts(app,echarts);
28
- toComps.forEach((com) => {
29
- if(com.name){
30
- const isAdvanced = advanceComps.includes(com.name);
31
- const isEcharts = com.name.includes("Echarts");
32
- const skipAdvanced = isAdvanced && !advanced && !license;
33
- const skipEcharts = isEcharts && !echarts;
34
- const shouldSkip = skipAdvanced || skipEcharts;
35
- if (!shouldSkip) {
36
- app.component(com.name, com);
37
- }
38
- }else{
39
- console.warn("TechUI Warning: Missing component name",com);
40
- }
41
- });
42
- };
43
-
44
- import { sysLang } from "@techui/utils";
45
-
46
- import init, {
47
- coreInfo,
48
- techuiCoreInit
49
- } from './core/core.js';
50
-
51
- export {
52
- adptCalc, bar3DPathGen, cidGen, cidVaild, coreConsoleError, coreConsoleInfo, coreConsoleWarn, cssVarGen, floatInfo, getEnv, getVer,
53
- md5Enc, openDec, openEnc, pieArcPathGen,
54
-
55
- //button
56
- scifiButtonA1, scifiButtonA2, scifiButtonA3, scifiButtonA4, scifiButtonA5,
57
-
58
- //deco
59
- scifiDecoA1, scifiDecoB1, scifiDecoB2, scifiDecoB3, scifiDecoD1,
60
-
61
- //geometry
62
- scifiGeomeParallelogram, scifiGeomeRectangle, scifiGeomeTrapezoid, scifiGeomeTriangle, scifiGeomHexagon,
63
-
64
- //header
65
- scifiHeaderA1, scifiHeaderA2, scifiHeaderA3, scifiHeaderA4,
66
-
67
- //panel
68
- scifiPanelA1, scifiPanelA2, scifiPanelA3,
69
- scifiPanelB1, scifiPanelB2, scifiPanelB3, scifiPanelB4,
70
- scifiPanelDV1, scifiPanelDV2, scifiPanelDV3, scifiPanelDV4, scifiPanelDV5,
71
- scifiPanelDV6, scifiPanelDV7, scifiPanelDV8, scifiPanelDV9,
72
-
73
- //panel title
74
- scifiPanelTitleA1, scifiPanelTitleA2, scifiPanelTitleA3,
75
-
76
- svgPatBlocks,
77
- svgPatCircuitDiagram,
78
- svgPatCircularOverlayA,
79
- svgPatCircularOverlayB,
80
- svgPatContourLine,
81
- svgPatCrosshairA,
82
- svgPatCrosshairB,
83
- svgPatCubeA,
84
- svgPatCubeB,
85
- svgPatCubeC,
86
- svgPatDiamondFlipped,
87
- svgPatDiamondLattice,
88
- svgPatDiamondPixel,
89
- svgPatDiamondWeaving,
90
- svgPatDots,
91
- svgPatHexagonA,
92
- svgPatHexagonB,
93
- svgPatHexagonC,
94
- svgPatHexagonCurved,
95
- svgPatHexagonD,
96
- svgPatLineGrid,
97
- svgPatLineWeaving,
98
- svgPatMazeA,
99
- svgPatMazeB,
100
- svgPatMazeC,
101
- svgPatMountains,
102
- svgPatRain,
103
- svgPatRectWeavingA,
104
- svgPatRectWeavingB,
105
- svgPatRectWeavingC,
106
- svgPatShellA,
107
- svgPatShellB,
108
- svgPatSlashParallel,
109
- svgPatTest,
110
- svgPatTotem,
111
- svgPatTriangleA,
112
- svgPatTriangleB,
113
- svgPatWaveA,
114
- svgPatWaveB,
115
- svgPatZigzagA,
116
- svgPatZigzagB,
117
-
118
- svgSpinBarsA,
119
- svgSpinBarsB,
120
- svgSpinBarsC,
121
- svgSpinBlocksA,
122
- svgSpinBlocksB,
123
- svgSpinBlocksC,
124
- svgSpinClock,
125
- svgSpinPointA,
126
- svgSpinPointB,
127
- svgSpinPointC,
128
- svgSpinPulseDotA,
129
- svgSpinPulseDotB,
130
- svgSpinPulseDotC,
131
- svgSpinPulseRingA,
132
- svgSpinPulseRingB,
133
- svgSpinPulseRingC,
134
- svgSpinRingA,
135
- svgSpinRingB,
136
- svgSpinRingC,
137
-
138
- t3dCoeffCalc,
139
- t3dUpdateOrient,
140
- t3dUpdateRotate
141
- } from './core/core.js';
142
-
143
- const coreEnt=async ({
144
- app,
145
- license=null,
146
- subLicense=null,
147
- features={},
148
- debug=false
149
- })=>{
150
- sysLang();
151
- await init();
152
- window.tuiCoreInfo=coreInfo
153
- techuiCoreInit(license,subLicense,coreEnt.toString());
154
- app.use(initComps,license,features,debug)
155
- };
156
- export default coreEnt