@eaera-com/eaera-widgets-v2 0.1.66 → 0.1.68
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/dist/components/chunks/EaeraWidgetMonthlyGainChart-DR2cG9Ku.mjs +1 -0
- package/dist/components/chunks/EaeraWidgetTradeVolumeStatistics-BLr-0y-O.mjs +1 -0
- package/dist/components/custom/EaeraWidgetMonthlyGainChart.d.ts +5 -0
- package/dist/components/custom/EaeraWidgetMonthlyGainChart.mjs +1 -1
- package/dist/components/custom/EaeraWidgetTradeVolumeStatistics.d.ts +5 -0
- package/dist/components/custom/EaeraWidgetTradeVolumeStatistics.mjs +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/design-system/components/_checkbox.scss +66 -26
- package/dist/design-system/components/_tree.scss +4 -0
- package/dist/eaera-widgets-v2.es.js +975 -961
- package/dist/eaera-widgets-v2.umd.cjs +14 -14
- package/package.json +1 -1
- package/dist/components/chunks/EaeraWidgetMonthlyGainChart-CoSPr48l.mjs +0 -1
- package/dist/components/chunks/EaeraWidgetTradeVolumeStatistics-B0idFTtX.mjs +0 -1
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ElLoadingDirective as t}from"element-plus/es";import{defineComponent as e,ref as a,computed as n,resolveComponent as o,openBlock as i,createElementBlock as l,createElementVNode as r,toDisplayString as s,unref as g,normalizeClass as m,createVNode as c,createCommentVNode as u,withDirectives as d,renderSlot as y,createBlock as p}from"vue";import{useI18n as v}from"vue-i18n";import{Percent as b,DollarSign as _,BarChart3 as w}from"@lucide/vue";const x={class:"monthly-gain-widget"},f={key:0,class:"monthly-gain-widget__header"},S={class:"monthly-gain-widget__title"},N={class:"monthly-gain-widget__toggle"},D=["aria-label"],L=["aria-label"],$={class:"monthly-gain-widget__body"},k={key:0,class:"monthly-gain-widget__empty"},M={class:"monthly-gain-widget__empty-text"},T=e({__name:"EaeraWidgetMonthlyGainChart",props:{monthlyGainData:{default:()=>[]},isLoading:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},currency:{default:"USD"}},setup(e){const T=e,{t:G}=v(),z=a("percent"),C=n(()=>[...T.monthlyGainData].map(t=>{const e=(a=t.month,new Date(a));var a;const n=isNaN(e.getTime())?String(t.month):new Intl.DateTimeFormat("en-US",{month:"short"}).format(e),o="percent"===z.value?t.percentage:t.value;return{date:e,label:n,value:Number(o??0)}}).sort((t,e)=>{const a=t.date.getTime(),n=e.date.getTime();return(isNaN(a)?1/0:a)-(isNaN(n)?1/0:n)})),F=n(()=>{const t=C.value.map(t=>Math.abs(t.value)),e=t.length>0?Math.max(...t):0;return Math.max(10*Math.ceil(e/10),10)}),U=t=>{const e=Math.abs(t),a=new Intl.NumberFormat("en-US",{maximumFractionDigits:2}).format(e),n=t>=0?"+":"-";if("percent"===z.value)return`${n}${a}%`;return`${n}${"USD"===T.currency?"$":""}${a}`},A=n(()=>{const t="percent"===z.value;return{tooltip:{trigger:"axis",axisPointer:{show:!1},valueFormatter:t=>U(t)},grid:{left:48,right:12,top:24,bottom:28,containLabel:!0},xAxis:{type:"category",data:C.value.map(t=>t.label),axisLabel:{color:"var(--er-text-muted)",fontSize:11},axisLine:{show:!1},axisTick:{show:!1}},yAxis:{type:"value",min:-F.value,max:F.value,splitNumber:4,axisLabel:{color:"var(--er-text-muted)",fontSize:11,formatter:e=>t?`${e}%`:String(e)},axisLine:{show:!0,lineStyle:{color:"transparent"}},axisTick:{show:!1},splitLine:{lineStyle:{color:"var(--er-border-subtle)",type:"dashed"}}},series:[{type:"bar",barCategoryGap:"60%",label:{show:!0,position:"top",fontSize:10,fontWeight:"bold",formatter:t=>U(t.value)},data:C.value.map(t=>{const e=t.value>=0?"var(--er-text-success)":"var(--er-text-danger)",a=t.value>=0?[4,4,0,0]:[0,0,4,4];return{value:t.value,itemStyle:{color:e,borderRadius:a},emphasis:{itemStyle:{color:e,borderRadius:a}},label:{color:e}}})}]}});return(a,n)=>{const v=o("v-chart"),T=t;return i(),l("div",x,[e.showHeader?(i(),l("header",f,[r("span",S,s(g(G)("widget.monthly-gain.title")),1),r("div",N,[r("button",{type:"button",class:m(["monthly-gain-widget__toggle-btn",{"monthly-gain-widget__toggle-btn--active":"percent"===z.value}]),"aria-label":g(G)("widget.monthly-gain.percent"),onClick:n[0]||(n[0]=t=>z.value="percent")},[c(g(b),{class:"monthly-gain-widget__toggle-icon"})],10,D),r("button",{type:"button",class:m(["monthly-gain-widget__toggle-btn",{"monthly-gain-widget__toggle-btn--active":"currency"===z.value}]),"aria-label":g(G)("widget.monthly-gain.currency"),onClick:n[1]||(n[1]=t=>z.value="currency")},[c(g(_),{class:"monthly-gain-widget__toggle-icon"})],10,L)])])):u("",!0),d((i(),l("div",$,[0===e.monthlyGainData.length?(i(),l("div",k,[y(a.$slots,"empty",{},()=>[c(g(w),{class:"monthly-gain-widget__empty-icon"}),r("span",M,s(g(G)("widget.monthly-gain.no-data")),1)])])):(i(),p(v,{key:1,option:A.value,autoresize:"",class:"monthly-gain-widget__chart"},null,8,["option"]))])),[[T,e.isLoading]])])}}});export{T as _};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ElLoadingDirective as e}from"element-plus/es";import{defineComponent as t,ref as a,computed as l,resolveComponent as o,openBlock as r,createElementBlock as i,createElementVNode as d,toDisplayString as u,unref as s,normalizeClass as m,createVNode as n,createCommentVNode as g,withDirectives as v,renderSlot as c,createBlock as p}from"vue";import{useI18n as w}from"vue-i18n";import{BarChart3 as y,CalendarDays as _}from"@lucide/vue";const b={class:"trade-volume-widget"},f={key:0,class:"trade-volume-widget__header"},D={class:"trade-volume-widget__title"},x={class:"trade-volume-widget__toggle"},k=["aria-label"],N=["aria-label"],S={class:"trade-volume-widget__body"},T={key:0,class:"trade-volume-widget__empty"},L={class:"trade-volume-widget__empty-text"},V=t({__name:"EaeraWidgetTradeVolumeStatistics",props:{tradeVolumeData:{default:()=>[]},isLoading:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},currency:{default:"USD"}},setup(t){const V=t,{t:$}=w(),A=a("daily"),C=e=>new Date(e),F=e=>{const t=new Date(e.getFullYear(),e.getMonth(),e.getDate()),a=t.getDay(),l=0===a?-6:1-a;return t.setDate(t.getDate()+l),t},M=e=>new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(e),z=l(()=>{const e=V.tradeVolumeData;if("weekly"===A.value){const t=new Map;for(const a of e){const e=C(a.date);if(isNaN(e.getTime()))continue;const l=F(e),o=`${l.getFullYear()}-${l.getMonth()}-${l.getDate()}`,r=t.get(o);r?r.volume+=Number(a.volume??0):t.set(o,{date:l,volume:Number(a.volume??0)})}return Array.from(t.values()).sort((e,t)=>e.date.getTime()-t.date.getTime()).map(({date:e,volume:t})=>({label:M(e),value:t}))}return e.map(e=>{const t=C(e.date);return{label:isNaN(t.getTime())?String(e.date):String(t.getDate()),value:Number(e.volume??0)}})}),B=l(()=>({tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},xAxis:{type:"category",data:z.value.map(e=>e.label),axisLabel:{color:"var(--er-text-muted)",fontSize:11},axisLine:{show:!1},axisTick:{show:!1}},yAxis:{type:"value",show:!1},series:[{type:"bar",data:z.value.map(e=>e.value),barCategoryGap:"60%",itemStyle:{color:"var(--er-action-primary-default)",borderRadius:[4,4,0,0]}}],grid:{left:0,right:12,top:16,bottom:28,containLabel:!1}}));return(a,l)=>{const w=o("v-chart"),V=e;return r(),i("div",b,[t.showHeader?(r(),i("header",f,[d("span",D,u(s($)("widget.trade-volume.title")),1),d("div",x,[d("button",{type:"button",class:m(["trade-volume-widget__toggle-btn",{"trade-volume-widget__toggle-btn--active":"daily"===A.value}]),"aria-label":s($)("widget.trade-volume.daily"),onClick:l[0]||(l[0]=e=>A.value="daily")},[n(s(y),{class:"trade-volume-widget__toggle-icon"})],10,k),d("button",{type:"button",class:m(["trade-volume-widget__toggle-btn",{"trade-volume-widget__toggle-btn--active":"weekly"===A.value}]),"aria-label":s($)("widget.trade-volume.weekly"),onClick:l[1]||(l[1]=e=>A.value="weekly")},[n(s(_),{class:"trade-volume-widget__toggle-icon"})],10,N)])])):g("",!0),v((r(),i("div",S,[0===t.tradeVolumeData.length?(r(),i("div",T,[c(a.$slots,"empty",{},()=>[n(s(y),{class:"trade-volume-widget__empty-icon"}),d("span",L,u(s($)("widget.trade-volume.no-data")),1)])])):(r(),p(w,{key:1,option:B.value,autoresize:"",class:"trade-volume-widget__chart"},null,8,["option"]))])),[[V,t.isLoading]])])}}});export{V as _};
|