@backtest-kit/ui 5.10.0 → 5.11.0
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/build/index.cjs +4 -0
- package/build/index.mjs +4 -0
- package/build/modules/frontend/build/assets/{Article-D0PUfsyZ.js → Article-CV5Q8o6x.js} +1 -1
- package/build/modules/frontend/build/assets/{Background-Bp0-zX1I.js → Background-as5_tKS_.js} +1 -1
- package/build/modules/frontend/build/assets/{Container-BVnjAw0L.js → Container-bTKJUsqX.js} +1 -1
- package/build/modules/frontend/build/assets/{IconPhoto-vJVt5Ncr.js → IconPhoto-iHdj_K8W.js} +1 -1
- package/build/modules/frontend/build/assets/{KeyboardArrowLeft-C6uma9wN.js → KeyboardArrowLeft-sfHB1IYi.js} +1 -1
- package/build/modules/frontend/build/assets/{Refresh-BY0j0EcE.js → Refresh-CH0eiGLB.js} +1 -1
- package/build/modules/frontend/build/assets/emitters-CmNFQZWA.js +1 -0
- package/build/modules/frontend/build/assets/{hasRouteMatch-DohEILWY.js → hasRouteMatch-DzWVcZWi.js} +1 -1
- package/build/modules/frontend/build/assets/{html2canvas-D2jUEpzH.js → html2canvas-DkIH2Xet.js} +1 -1
- package/build/modules/frontend/build/assets/{index-jlDU8JcV.js → index-BneZFtKI.js} +1 -1
- package/build/modules/frontend/build/assets/{index-CjPBJAjp.js → index-Bw-ZorFV.js} +1 -1
- package/build/modules/frontend/build/assets/{index-Bcb8nGYX.js → index-C3UjHQ42.js} +1 -1
- package/build/modules/frontend/build/assets/{index-RtiSuyWs.js → index-CFZzoSq1.js} +1 -1
- package/build/modules/frontend/build/assets/{index-yQQoZEqI.js → index-CHbdbxq4.js} +1 -1
- package/build/modules/frontend/build/assets/{index-Cg1Md-6T.js → index-CMCkXfjC.js} +1 -1
- package/build/modules/frontend/build/assets/{index--twYSr4E.js → index-CkLkivGW.js} +1 -1
- package/build/modules/frontend/build/assets/{index-DAgM7WkM.js → index-CpAgfFDW.js} +6 -6
- package/build/modules/frontend/build/assets/{index-DNrZ-NLx.js → index-DBOjHCyk.js} +1 -1
- package/build/modules/frontend/build/assets/{index-D8XGIcxD.js → index-DOoEVh8-.js} +1 -1
- package/build/modules/frontend/build/assets/{index-BTNj0TPL.js → index-DfJxzRHU.js} +1 -1
- package/build/modules/frontend/build/assets/{index.es-BdwPG30D.js → index.es-BKZV0i2c.js} +1 -1
- package/build/modules/frontend/build/assets/{markdownit-CJIyDibX.js → markdownit-Bu-L1Tz5.js} +1 -1
- package/build/modules/frontend/build/index.html +1 -1
- package/package.json +3 -3
- package/build/modules/frontend/build/assets/emitters-D7EMED_Y.js +0 -1
package/build/index.cjs
CHANGED
|
@@ -110,6 +110,8 @@ const INTERVAL_MINUTES = {
|
|
|
110
110
|
"4h": 240,
|
|
111
111
|
"6h": 360,
|
|
112
112
|
"8h": 480,
|
|
113
|
+
"1d": 1440,
|
|
114
|
+
"1w": 10080,
|
|
113
115
|
};
|
|
114
116
|
const STEP_TICKS = {
|
|
115
117
|
"1m": 960,
|
|
@@ -122,6 +124,8 @@ const STEP_TICKS = {
|
|
|
122
124
|
"4h": 960,
|
|
123
125
|
"6h": 960,
|
|
124
126
|
"8h": 960,
|
|
127
|
+
"1d": 960,
|
|
128
|
+
"1w": 960,
|
|
125
129
|
};
|
|
126
130
|
class ExchangeService {
|
|
127
131
|
constructor() {
|
package/build/index.mjs
CHANGED
|
@@ -107,6 +107,8 @@ const INTERVAL_MINUTES = {
|
|
|
107
107
|
"4h": 240,
|
|
108
108
|
"6h": 360,
|
|
109
109
|
"8h": 480,
|
|
110
|
+
"1d": 1440,
|
|
111
|
+
"1w": 10080,
|
|
110
112
|
};
|
|
111
113
|
const STEP_TICKS = {
|
|
112
114
|
"1m": 960,
|
|
@@ -119,6 +121,8 @@ const STEP_TICKS = {
|
|
|
119
121
|
"4h": 960,
|
|
120
122
|
"6h": 960,
|
|
121
123
|
"8h": 960,
|
|
124
|
+
"1d": 960,
|
|
125
|
+
"1w": 960,
|
|
122
126
|
};
|
|
123
127
|
class ExchangeService {
|
|
124
128
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c,f as v}from"./index-
|
|
1
|
+
import{c,f as v}from"./index-CpAgfFDW.js";const h=c(v("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"}),"Article");export{h as A};
|
package/build/modules/frontend/build/assets/{Background-Bp0-zX1I.js → Background-as5_tKS_.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as n,b8 as o}from"./index-
|
|
1
|
+
import{f as n,b8 as o}from"./index-CpAgfFDW.js";const d=()=>n(o,{children:"\n body {\n background-color: #ddd !important;\n }\n "});export{d as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bh as e,b as t,r as a,_ as s,f as i,bi as n,e as o,bj as r,h as d,bk as m,g as u,u as p,s as x}from"./index-
|
|
1
|
+
import{bh as e,b as t,r as a,_ as s,f as i,bi as n,e as o,bj as r,h as d,bk as m,g as u,u as p,s as x}from"./index-CpAgfFDW.js";const b=e(),h=["className","component","disableGutters","fixed","maxWidth","classes"],l=m(),c=b("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),f=e=>r({props:e,name:"MuiContainer",defaultTheme:l});const g=function(e={}){const{createStyledComponent:r=c,useThemeProps:m=f,componentName:p="MuiContainer"}=e,x=r(({theme:e,ownerState:a})=>t({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!a.disableGutters&&{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}),({theme:e,ownerState:t})=>t.fixed&&Object.keys(e.breakpoints.values).reduce((t,a)=>{const s=a,i=e.breakpoints.values[s];return 0!==i&&(t[e.breakpoints.up(s)]={maxWidth:`${i}${e.breakpoints.unit}`}),t},{}),({theme:e,ownerState:a})=>t({},"xs"===a.maxWidth&&{[e.breakpoints.up("xs")]:{maxWidth:Math.max(e.breakpoints.values.xs,444)}},a.maxWidth&&"xs"!==a.maxWidth&&{[e.breakpoints.up(a.maxWidth)]:{maxWidth:`${e.breakpoints.values[a.maxWidth]}${e.breakpoints.unit}`}}));return a.forwardRef(function(e,a){const r=m(e),{className:b,component:l="div",disableGutters:c=!1,fixed:f=!1,maxWidth:g="lg"}=r,W=s(r,h),k=t({},r,{component:l,disableGutters:c,fixed:f,maxWidth:g}),S=((e,t)=>{const{classes:a,fixed:s,disableGutters:i,maxWidth:n}=e,r={root:["root",n&&`maxWidth${o(String(n))}`,s&&"fixed",i&&"disableGutters"]};return d(r,e=>u(t,e),a)})(k,p);return i(x,t({as:l,ownerState:k,className:n(S.root,b),ref:a},W))})}({createStyledComponent:x("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`maxWidth${o(String(a.maxWidth))}`],a.fixed&&t.fixed,a.disableGutters&&t.disableGutters]}}),useThemeProps:e=>p({props:e,name:"MuiContainer"})});export{g as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as e,v as t,B as r,J as s}from"./index-
|
|
1
|
+
import{f as e,v as t,B as r,J as s}from"./index-CpAgfFDW.js";const o=({className:o,symbol:a,style:i,sx:n})=>e(s,{children:async()=>{try{const s=(await t.symbolGlobalService.getSymbolMap())[a],l=(null==s?void 0:s.logo)||(null==s?void 0:s.icon),c=(null==s?void 0:s.color)||"#ccc";return e(r,{className:o,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:l?"transparent":c,...n},style:i,children:l?e("img",{loading:"lazy",crossOrigin:"anonymous",src:l,alt:a,style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"contain"},onError:e=>{const t=e.target,r=t.parentElement;r&&(r.style.background=c,t.style.display="none")}}):e(r,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}catch(s){return e(r,{className:o,sx:{position:"relative",width:24,height:24,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"#ccc",...n},style:i,children:e(r,{sx:{width:"60%",height:"60%",borderRadius:"50%",backgroundColor:"rgba(255, 255, 255, 0.2)"}})})}}});export{o as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as o,f as r}from"./index-
|
|
1
|
+
import{c as o,f as r}from"./index-CpAgfFDW.js";const a=o(r("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"KeyboardArrowLeft");export{a as K};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as s,f as c}from"./index-
|
|
1
|
+
import{c as s,f as c}from"./index-CpAgfFDW.js";const a=s(c("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"}),"Refresh");export{a as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U as o}from"./index-CpAgfFDW.js";const r=new o;export{r};
|
package/build/modules/frontend/build/assets/{hasRouteMatch-DohEILWY.js → hasRouteMatch-DzWVcZWi.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as a,bl as e,bm as t}from"./index-
|
|
1
|
+
import{v as a,bl as e,bm as t}from"./index-CpAgfFDW.js";const o=(o,r=a.routerService.location.pathname)=>!!e(t.filter(({path:a})=>o.includes(a)),r);export{o as h};
|
package/build/modules/frontend/build/assets/{html2canvas-D2jUEpzH.js → html2canvas-DkIH2Xet.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as e,bo as t}from"./index-
|
|
1
|
+
import{m as e,bo as t}from"./index-CpAgfFDW.js";function r(e,t){for(var r=0;r<t.length;r++){const o=t[r];if("string"!=typeof o&&!Array.isArray(o))for(const t in o)if("default"!==t&&!(t in e)){const r=Object.getOwnPropertyDescriptor(o,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>o[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var o=t();const n=r({__proto__:null,default:e(o)},[o]);export{n as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t,f as a,T as e,K as o,b9 as n,G as i,P as l,o as r,W as c,v as s,Y as d,t as p,Z as m,x as h,y,z as w,A as u,E as x,w as f,aY as g,q as b,aX as v}from"./index-
|
|
1
|
+
import{c as t,f as a,T as e,K as o,b9 as n,G as i,P as l,o as r,W as c,v as s,Y as d,t as p,Z as m,x as h,y,z as w,A as u,E as x,w as f,aY as g,q as b,aX as v}from"./index-CpAgfFDW.js";import{h as S}from"./hasRouteMatch-DzWVcZWi.js";import{r as L}from"./emitters-CmNFQZWA.js";import{I as k}from"./IconPhoto-iHdj_K8W.js";import{C as D}from"./Container-bTKJUsqX.js";import{R}from"./Refresh-CH0eiGLB.js";import{K as j}from"./KeyboardArrowLeft-sfHB1IYi.js";const A=t(a("path",{d:"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H8V4h12v12zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm12 6V9c0-.55-.45-1-1-1h-2v5h2c.55 0 1-.45 1-1zm-2-3h1v3h-1V9zm4 2h1v-1h-1V9h1V8h-2v5h1zm-8 0h1c.55 0 1-.45 1-1V9c0-.55-.45-1-1-1H9v5h1v-2zm0-2h1v1h-1V9z"}),"PictureAsPdfOutlined"),N=r()(t=>({root:{position:"relative",background:"#0001",overflow:"clip"},header:{position:"absolute",top:0,left:0,height:"48px",width:"calc(100% - 16px)",display:"flex",alignItems:"center",justifyContent:"space-between",marginLeft:"8px",marginRight:"8px"},container:{marginTop:"48px",width:"100%",background:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},content:{display:"flex",width:"100%",padding:t.spacing(1),paddingBottom:t.spacing(2),gap:10,flexDirection:"column"},avatar:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"128px",minWidth:"128px"}})),V=[{type:i.Text,name:"totalPnl",title:"Total PNL",compute:t=>null!==t.totalPnl?`${t.totalPnl.toFixed(2)}%`:"N/A",readonly:!0},{type:i.Text,columns:"6",name:"winRate",title:"Win Rate",compute:t=>null!==t.winRate?`${t.winRate.toFixed(2)}%`:"N/A",readonly:!0},{type:i.Text,columns:"6",name:"profitFactor",title:"Profit Factor",compute:t=>null!==t.profitFactor?t.profitFactor.toFixed(2):"N/A",readonly:!0},{type:i.Text,columns:"6",name:"maxDrawdown",title:"Max Drawdown",compute:t=>null!==t.maxDrawdown?`${t.maxDrawdown.toFixed(2)}%`:"N/A",readonly:!0},{type:i.Text,columns:"6",name:"expectancy",title:"Expectancy",compute:t=>null!==t.expectancy?`${t.expectancy.toFixed(2)}%`:"N/A",readonly:!0},{type:i.Text,fieldBottomMargin:"0",name:"totalTrades",title:"Trades",readonly:!0}],F=({row:t})=>{const{classes:i}=N();return a(l,{className:i.root,children:[a("div",{className:i.header,children:a(e,{variant:"h6",sx:{opacity:.8},children:`${o.bullet} ${t.symbol}`})}),a("div",{className:i.container,children:a("div",{className:i.content,children:[a("div",{className:i.avatar,children:a(k,{symbol:t.symbol,sx:{width:128,height:128}})}),a(n,{handler:()=>t,fields:V,sx:{mb:2}})]})})]})},T=[{type:m.Link,action:"back-action",label:a(j,{sx:{display:"block"}})},{type:m.Link,action:"back-action",label:"Dashboard"},{type:m.Link,action:"back-action",label:"Heatmap"},{type:m.Button,action:"download-pdf",label:"Download PDF",icon:A}],H=[{action:"download-json",label:"Download JSON",icon:()=>a(y,{icon:h,color:"#4caf50"})},{action:"download-markdown",label:"Download Markdown",icon:()=>a(y,{icon:w,color:"#4caf50"})},{action:"download-pdf",label:"Download PDF",icon:()=>a(y,{icon:u,color:"#4caf50"})},{divider:!0},{action:"update-now",label:"Refresh",icon:()=>a(y,{icon:R,color:"#4caf50"})}],P=[{id:"main",element:()=>{const[t,{loading:e,execute:o}]=c(async()=>(t=>{if(!t.length)return[{type:i.Typography,typoVariant:"h6",placeholder:"No data",sx:{textAlign:"center",opacity:.5,mt:4}}];const e=t.map(t=>({type:i.Group,desktopColumns:"4",tabletColumns:"6",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",child:{type:i.Component,element:()=>a(F,{row:t})}}));return e.length>2?e:[{type:i.Center,sx:t=>({[t.breakpoints.up("lg")]:{height:"calc(100dvh - 165px)","& > *":{transform:"translateY(-56px)"}}}),fields:e}]})((await s.heatViewService.getStrategyHeatData()).symbols),{onLoadStart:()=>s.layoutService.setAppbarLoader(!0),onLoadEnd:()=>s.layoutService.setAppbarLoader(!1)});d(()=>L.subscribe(o));return a(D,{children:[a(p,{items:T,actions:H,onAction:async t=>{"back-action"===t&&s.routerService.push("/"),"update-now"===t&&await L.next(),"download-markdown"===t&&await(async()=>{const t=await s.heatViewService.getStrategyHeatReport(),a=new Blob([t],{type:"text/plain"}),e=URL.createObjectURL(a);s.layoutService.downloadFile(e,`heat_${Date.now()}.md`)})(),"download-pdf"===t&&await(async()=>{const t=await s.heatViewService.getStrategyHeatReport();await b(t)})(),"download-json"===t&&await(async()=>{const t=await s.heatViewService.getStrategyHeatData(),a=JSON.stringify(t,null,2),e=new Blob([a],{type:"text/plain"}),o=URL.createObjectURL(e);s.layoutService.downloadFile(o,`heat_${Date.now()}.md`)})()}}),!t||e?a(x,{sx:{height:"calc(100dvh - 165px)"}}):a(g,{withScrollbar:!0,sx:{height:"calc(100dvh - 165px)"},hideOverflowX:!0,children:a(f,{fields:t})})]})},isActive:t=>S(["/heat"],t)}],C=({id:t})=>a(v,{history:s.routerService,onLoadStart:()=>s.layoutService.setAppbarLoader(!0),onLoadEnd:()=>s.layoutService.setAppbarLoader(!1),routes:P,params:{id:t}});export{C as HeatPage,C as default};
|