@nocobase/plugin-charts 0.17.0-alpha.7 → 0.18.0-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.
package/dist/client/index.js
CHANGED
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
`,children:[u.jsx(L.Card,{size:"default",title:m("Chart preview"),children:C&&u.jsx(u.Fragment,{children:u.jsx(o.SchemaComponent,{schema:{properties:{chartPreview:{type:"void","x-decorator":"CardItem","x-component":"ChartBlockEngine","x-component-props":{chartBlockEngineMetaData:C}}}}})})}),u.jsx(L.Card,{size:"default",title:m("Data preview"),className:o.css`
|
|
34
34
|
margin-top: 24px;
|
|
35
35
|
overflow: scroll;
|
|
36
|
-
`,children:((P=C==null?void 0:C.query)==null?void 0:P.id)&&u.jsx(mu,{queryId:(N=C==null?void 0:C.query)==null?void 0:N.id,fields:z})})]})]})})})},M).open({initialValues:b({},h)}).then(x=>{x={query:g,chart:x},F.title=x.chart.title,D.title=x.chart.title,F.componentProps.chartBlockEngineMetaData=x,D["x-component-props"].chartBlockEngineMetaData=x,a.emit("patch",{schema:{"x-uid":D["x-uid"],"x-component-props":D["x-component-props"]}}),a.refresh()}).catch(x=>{G.error(x)})}),children:e.children||e.title||m("Edit chart block")})},fu=new Map;fu.set("G2Plot",o.G2Plot),fu.set("DataSetPreviewTable",mu);const ye=({chartBlockEngineMetaData:e})=>{var z,M,Q;const t=o.useCompile(),n=e.chart.type,i=(z=j.get(n))==null?void 0:z.renderComponent,a=fu.get(i),D=e.chart,{loading:c,dataSet:F,error:s}=zu(e.query.id),[h,g]=B.useState({});if(B.useEffect(()=>{g(D)},[JSON.stringify(D)]),s)return u.jsx(u.Fragment,{children:u.jsx(L.Empty,{description:u.jsx("span",{children:"May be this chart block's query data has been deleted,please check!"})})});if(h.type!==D.type)return u.jsx(u.Fragment,{});switch(i){case"G2Plot":{const x=(M=j.get(n))==null?void 0:M.defaultChartOptions;let p;try{p=V.parse(D==null?void 0:D.template)}catch(l){p={}}const C=t(U(b(b({},x),p),{data:F}),U(b({},D),{category:(Q=D==null?void 0:D.category)!=null?Q:""}));if(C&&D){const{dimension:l,metric:P,category:N}=D;if(!P||!l)return u.jsx(u.Fragment,{children:m("Please check the chart config")})}return u.jsx(u.Fragment,{children:c?u.jsx(L.Spin,{}):u.jsx(a,{plot:D.type,config:C})})}}return u.jsx(u.Fragment,{})},zu=e=>{const{data:t,loading:n,error:i}=o.useRequest({url:`/chartsQueries:getData/${e}`}),a=t==null?void 0:t.data;return{loading:n,dataSet:a,error:i}},Mu=({chartBlockEngineMetaData:e})=>{var i,a;let t;const n=(i=e==null?void 0:e.chart)==null?void 0:i.type;return n&&(t=(a=j.get(n))==null?void 0:a.renderComponent),!n||!t?u.jsx(u.Fragment,{children:m("Please check the chart config")}):u.jsx(u.Fragment,{children:u.jsx(ye,{chartBlockEngineMetaData:e})})};Mu.Designer=he;const ge=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M523 573.5c-3.9 0.7-7.9 1.1-12 1.1-5.3 0-10.4-0.6-15.2-1.8l-62.2 189.7 167.4-76L523 573.5z"}),u.jsx("path",{d:"M398.3 767.3l68.9-210.1c-6.4-6-11.5-13.3-15-21.4l-192.6 52.7L398.3 767.3z"}),u.jsx("path",{d:"M528 448.9c4.1 1.1 8 2.6 11.7 4.5l72.5-61.8L528 263.7 528 448.9z"}),u.jsx("path",{d:"M259.6 555.4 447.3 504c0.4-4.2 1.3-8.3 2.5-12.2L270.9 373.4 259.6 555.4z"}),u.jsx("path",{d:"M655.5 396.7l208.3 185.7 30.2 4.8c4.8-24.6 7.4-49.9 7.4-75.9 0-95.9-34.6-183.7-92-251.6L655.5 396.7z"}),u.jsx("path",{d:"M794.4 563.4 630.9 417.7l-67 57.1c5.6 8.3 9.3 18 10.6 28.4L794.4 563.4z"}),u.jsx("path",{d:"M496 448.4 496 239.6l-218.8 99.6 189.4 125.4C474.7 456.8 484.8 451.1 496 448.4z"}),u.jsx("path",{d:"M619.3 713.3 420 803.8l-19.1 81.6c35 10.3 72.1 15.9 110.4 15.9 74.4 0 143.9-20.8 203-56.9L619.3 713.3z"}),u.jsx("path",{d:"M648.7 699.5l92.3 127.2c63.3-46.2 112.2-111 138.6-186.4L648.7 699.5z"}),u.jsx("path",{d:"M386.2 804 226.1 597.7l-87.9 27.4c34.9 114.7 121.3 207 232.2 250L386.2 804z"}),u.jsx("path",{d:"M226.9 564.3 240.2 353l-64.4-40.5c-34.6 58.2-54.4 126.2-54.4 198.8 0 28.4 3 56.2 8.8 82.9L226.9 564.3z"}),u.jsx("path",{d:"M842.8 609.8l-272.7-74.7c-4 9.5-10.1 17.9-17.9 24.4l77.3 112.1L842.8 609.8z"}),u.jsx("path",{d:"M528 205.4l108.8 165.2 151-134.5c-67-67.3-158.4-110.2-259.7-114.5L528.1 205.4z"}),u.jsx("path",{d:"M245.7 318.4l250.3-114 0-82.8c-125 4.8-234.8 68.5-302.8 164L245.7 318.4z"})]}),xe=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M533.6 784.5c6.6 16.4-1.3 35-17.6 41.7l0 0c-16.4 6.6-35-1.3-41.7-17.6L129.9 236c-6.6-16.4 1.3-35 17.6-41.7l0 0c16.4-6.6 35 1.3 41.7 17.6L533.6 784.5z"}),u.jsx("path",{d:"M536 812.2c-6.9 16.3-25.7 23.9-41.9 17l0 0c-16.3-6.9-23.9-25.7-17-41.9l357.6-575.7c6.9-16.3 25.7-23.9 41.9-17l0 0c16.3 6.9 23.9 25.7 17 41.9L536 812.2z"}),u.jsx("path",{d:"M895.4 224c0 17.7-14.3 32-32 32l-704 0c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l704 0C881 192 895.4 206.3 895.4 224L895.4 224z"}),u.jsx("path",{d:"M278.6 384l465 0 0 64-465 0 0-64Z"}),u.jsx("path",{d:"M391.6 576l232.5 0 0 64-232.5 0 0-64Z"})]}),Se=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M745.6 765.9"}),u.jsx("path",{d:"M307.6 244.3m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M560 479.2m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M391.9 387.7m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M540.4 244.3m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M732.9 292.3m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M792.9 717.9m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M307.6 527.2m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M439.9 662.4m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"})]}),ve=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M745.6 765.9"}),u.jsx("path",{d:"M342.1 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7L278.7 489c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L342.1 734.3z"}),u.jsx("path",{d:"M493.8 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7L430.4 387c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L493.8 734.3z"}),u.jsx("path",{d:"M797.3 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7L733.9 234.5c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L797.3 734.3z"}),u.jsx("path",{d:"M645.5 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7l0-97.2c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L645.5 734.3z"})]}),be=()=>u.jsx("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:u.jsx("path",{d:"M131.072 156.16c0-17.92 14.336-31.744 31.744-31.744 17.92 0 31.744 14.336 31.744 31.744v712.192c0 17.92-14.336 31.744-31.744 31.744-17.92 0-31.744-14.336-31.744-31.744V156.16zM292.864 338.944c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744h245.248c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-245.248zM292.864 490.496c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744H640c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-347.136zM292.864 794.112c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744h499.712c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-499.712zM292.864 642.56c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744h97.28c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-97.28z"})}),we=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M307.1 686.3c-12.4 12.4-32.4 12.4-44.8 0l0 0c-12.4-12.4-12.4-32.4 0-44.8l173.4-173.4c12.4-12.4 32.4-12.4 44.8 0l0 0c12.4 12.4 12.4 32.4 0 44.8L307.1 686.3z"}),u.jsx("path",{d:"M608.8 640c-12.4 12.4-32.4 12.4-44.8 0l0 0c-12.4-12.4-12.4-32.4 0-44.8l212.7-212.7c12.4-12.4 32.4-12.4 44.8 0l0 0c12.4 12.4 12.4 32.4 0 44.8L608.8 640z"}),u.jsx("path",{d:"M608 595.3c12.4 12.4 12.4 32.4 0 44.8l0 0c-12.4 12.4-32.4 12.4-44.8 0L436 512.8c-12.4-12.4-12.4-32.4 0-44.8l0 0c12.4-12.4 32.4-12.4 44.8 0L608 595.3z"})]}),Ie=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M489.7 511 489 511 489 126.9c-201 12.3-360.1 179.2-360.1 383.3 0 212.1 171.9 384 384 384 106.5 0 202.9-43.4 272.5-113.4L489.7 511z"}),u.jsx("path",{d:"M773.1 237.2l6-6c-62.7-59.6-143.5-95.8-228.2-104l0 304.7L773.1 237.2z"}),u.jsx("path",{d:"M819.5 281.6 564.1 505.1 822 739c3-4 5.9-8.1 8.7-12.3 41.4-61.3 65.6-135.2 65.6-214.7C896.3 425.6 867.7 345.8 819.5 281.6z"})]}),Pe=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M830.6 338.2 830.6 338.2c0.9-9.2-2.1-18.6-9.1-25.7-12.4-12.4-32.4-12.4-44.8 0L586 503.3 480.8 398.1c-6.2-6.2-14.4-9.3-22.5-9.3-8.1 0-16.3 3.1-22.5 9.3L262.4 571.5c-6 6-9.1 13.8-9.3 21.6 0 0.1 0 0.1 0 0.2l0 111.8c0 35.3 28.7 64 64 64l449.7 0c33.8 0 61.4-26.1 63.8-59.3l0 0 0-0.2c0.1-1.5 0.2-3 0.2-4.5L830.8 593.3c0-0.3-0.1-0.7-0.2-1L830.6 338.2z"})]});o.Icon.register({"icon-area":e=>u.jsx(o.Icon,b({component:Pe},e)),"icon-pie":e=>u.jsx(o.Icon,b({component:Ie},e)),"icon-radar":e=>u.jsx(o.Icon,b({component:ge},e)),"icon-funnel":e=>u.jsx(o.Icon,b({component:xe},e)),"icon-line":e=>u.jsx(o.Icon,b({component:we},e)),"icon-bar":e=>u.jsx(o.Icon,b({component:be},e)),"icon-column":e=>u.jsx(o.Icon,b({component:ve},e)),"icon-scatter":e=>u.jsx(o.Icon,b({component:Se},e))});const Ne={label:"label",value:"value",color:"color",options:"children"},qe=(e,t,n)=>{function i(c){const F=[];for(let s=0;s<c.length;s++){const h=c[s][n.options];Array.isArray(h)&&F.push(...i(h)),F.push(b({},c[s]))}return F}const a=i(t);return e=hu.castArray(e).filter(c=>c!=null).map(c=>typeof c=="object"?c[n.value]:c),(c=>{if(!c)return[];const F=[];for(const s of e){const h=c.find(g=>g[n.value]===s)||{value:s,label:s};F.push(h)}return F})(a)},Tu=I.observer(e=>{var c;const t=b(b({},Ne),e.fieldNames),n=I.useField(),i=o.useCompile();if(!nu.isValid(e.value))return u.jsx("div",{});if(w.isArrayField(n)&&((c=n==null?void 0:n.value)==null?void 0:c.length)===0)return u.jsx("div",{});const a=n.dataSource||e.options||[],D=qe(n.value,a,t);return u.jsx("div",{children:D.map((F,s)=>u.jsx(L.Tag,{color:F[t.color],icon:F.icon,children:i(F[t.label])},s))})},{displayName:"ReadPretty"}),{Option:ju,OptGroup:Vu}=L.Select,Le=(e,t)=>{var n;return((n=t==null?void 0:t.label)!=null?n:"").toLowerCase().includes((e||"").toLowerCase())},Ju=I.connect(e=>{const t=cu(e,[]),F=b({},t),{options:n}=F,i=cu(F,["options"]),a=e.mode||e.multiple?"multiple":void 0,D=n.filter(s=>s.group===2),c=n.filter(s=>s.group===1);return u.jsxs(L.Select,U(b({showSearch:!0,filterOption:Le,allowClear:!0},i),{onChange:s=>{var h;(h=e.onChange)==null||h.call(e,s===void 0?null:s)},mode:a,children:[u.jsx(Vu,{label:m("Basic charts"),children:D.map(s=>u.jsx(ju,{value:s.key,label:m(s.title),children:u.jsx(o.PopoverWithStopPropagation,{placement:"right",zIndex:99999999999,content:()=>{var h;return u.jsx("span",{children:(h=m(s==null?void 0:s.description))==null?void 0:h.split(",").map(g=>u.jsx("div",{children:g},g))})},trigger:"hover",children:u.jsxs("div",{className:o.css`
|
|
36
|
+
`,children:((P=C==null?void 0:C.query)==null?void 0:P.id)&&u.jsx(mu,{queryId:(N=C==null?void 0:C.query)==null?void 0:N.id,fields:z})})]})]})})})},M).open({initialValues:b({},h)}).then(x=>{x={query:g,chart:x},F.title=x.chart.title,D.title=x.chart.title,F.componentProps.chartBlockEngineMetaData=x,D["x-component-props"].chartBlockEngineMetaData=x,a.emit("patch",{schema:{"x-uid":D["x-uid"],"x-component-props":D["x-component-props"]}}),a.refresh()}).catch(x=>{G.error(x)})}),children:e.children||e.title||m("Edit chart block")})},fu=new Map;fu.set("G2Plot",o.G2Plot),fu.set("DataSetPreviewTable",mu);const ye=({chartBlockEngineMetaData:e})=>{var z,M,Q;const t=o.useCompile(),n=e.chart.type,i=(z=j.get(n))==null?void 0:z.renderComponent,a=fu.get(i),D=e.chart,{loading:c,dataSet:F,error:s}=zu(e.query.id),[h,g]=B.useState({});if(B.useEffect(()=>{g(D)},[JSON.stringify(D)]),s)return u.jsx(u.Fragment,{children:u.jsx(L.Empty,{description:u.jsx("span",{children:"May be this chart block's query data has been deleted,please check!"})})});if(h.type!==D.type)return u.jsx(u.Fragment,{});switch(i){case"G2Plot":{const x=(M=j.get(n))==null?void 0:M.defaultChartOptions;let p;try{p=V.parse(D==null?void 0:D.template)}catch(l){p={}}const C=t(U(b(b({},x),p),{data:F}),U(b({},D),{category:(Q=D==null?void 0:D.category)!=null?Q:""}));if(C&&D){const{dimension:l,metric:P,category:N}=D;if(!P||!l)return u.jsx(u.Fragment,{children:m("Please check the chart config")})}return u.jsx(u.Fragment,{children:c?u.jsx(L.Spin,{}):u.jsx(a,{plot:D.type,config:C})})}}return u.jsx(u.Fragment,{})},zu=e=>{const{data:t,loading:n,error:i}=o.useRequest({url:`/chartsQueries:getData/${e}`}),a=t==null?void 0:t.data;return{loading:n,dataSet:a,error:i}},Mu=({chartBlockEngineMetaData:e})=>{var i,a;let t;const n=(i=e==null?void 0:e.chart)==null?void 0:i.type;return n&&(t=(a=j.get(n))==null?void 0:a.renderComponent),!n||!t?u.jsx(u.Fragment,{children:m("Please check the chart config")}):u.jsx(u.Fragment,{children:u.jsx(ye,{chartBlockEngineMetaData:e})})};Mu.Designer=he;const ge=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M523 573.5c-3.9 0.7-7.9 1.1-12 1.1-5.3 0-10.4-0.6-15.2-1.8l-62.2 189.7 167.4-76L523 573.5z"}),u.jsx("path",{d:"M398.3 767.3l68.9-210.1c-6.4-6-11.5-13.3-15-21.4l-192.6 52.7L398.3 767.3z"}),u.jsx("path",{d:"M528 448.9c4.1 1.1 8 2.6 11.7 4.5l72.5-61.8L528 263.7 528 448.9z"}),u.jsx("path",{d:"M259.6 555.4 447.3 504c0.4-4.2 1.3-8.3 2.5-12.2L270.9 373.4 259.6 555.4z"}),u.jsx("path",{d:"M655.5 396.7l208.3 185.7 30.2 4.8c4.8-24.6 7.4-49.9 7.4-75.9 0-95.9-34.6-183.7-92-251.6L655.5 396.7z"}),u.jsx("path",{d:"M794.4 563.4 630.9 417.7l-67 57.1c5.6 8.3 9.3 18 10.6 28.4L794.4 563.4z"}),u.jsx("path",{d:"M496 448.4 496 239.6l-218.8 99.6 189.4 125.4C474.7 456.8 484.8 451.1 496 448.4z"}),u.jsx("path",{d:"M619.3 713.3 420 803.8l-19.1 81.6c35 10.3 72.1 15.9 110.4 15.9 74.4 0 143.9-20.8 203-56.9L619.3 713.3z"}),u.jsx("path",{d:"M648.7 699.5l92.3 127.2c63.3-46.2 112.2-111 138.6-186.4L648.7 699.5z"}),u.jsx("path",{d:"M386.2 804 226.1 597.7l-87.9 27.4c34.9 114.7 121.3 207 232.2 250L386.2 804z"}),u.jsx("path",{d:"M226.9 564.3 240.2 353l-64.4-40.5c-34.6 58.2-54.4 126.2-54.4 198.8 0 28.4 3 56.2 8.8 82.9L226.9 564.3z"}),u.jsx("path",{d:"M842.8 609.8l-272.7-74.7c-4 9.5-10.1 17.9-17.9 24.4l77.3 112.1L842.8 609.8z"}),u.jsx("path",{d:"M528 205.4l108.8 165.2 151-134.5c-67-67.3-158.4-110.2-259.7-114.5L528.1 205.4z"}),u.jsx("path",{d:"M245.7 318.4l250.3-114 0-82.8c-125 4.8-234.8 68.5-302.8 164L245.7 318.4z"})]}),xe=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M533.6 784.5c6.6 16.4-1.3 35-17.6 41.7l0 0c-16.4 6.6-35-1.3-41.7-17.6L129.9 236c-6.6-16.4 1.3-35 17.6-41.7l0 0c16.4-6.6 35 1.3 41.7 17.6L533.6 784.5z"}),u.jsx("path",{d:"M536 812.2c-6.9 16.3-25.7 23.9-41.9 17l0 0c-16.3-6.9-23.9-25.7-17-41.9l357.6-575.7c6.9-16.3 25.7-23.9 41.9-17l0 0c16.3 6.9 23.9 25.7 17 41.9L536 812.2z"}),u.jsx("path",{d:"M895.4 224c0 17.7-14.3 32-32 32l-704 0c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l704 0C881 192 895.4 206.3 895.4 224L895.4 224z"}),u.jsx("path",{d:"M278.6 384l465 0 0 64-465 0 0-64Z"}),u.jsx("path",{d:"M391.6 576l232.5 0 0 64-232.5 0 0-64Z"})]}),Se=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M745.6 765.9"}),u.jsx("path",{d:"M307.6 244.3m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M560 479.2m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M391.9 387.7m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M540.4 244.3m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M732.9 292.3m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M792.9 717.9m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M307.6 527.2m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"}),u.jsx("path",{d:"M439.9 662.4m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z"})]}),ve=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M745.6 765.9"}),u.jsx("path",{d:"M342.1 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7L278.7 489c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L342.1 734.3z"}),u.jsx("path",{d:"M493.8 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7L430.4 387c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L493.8 734.3z"}),u.jsx("path",{d:"M797.3 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7L733.9 234.5c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L797.3 734.3z"}),u.jsx("path",{d:"M645.5 734.3c0 17.5-14.2 31.7-31.7 31.7l0 0c-17.5 0-31.7-14.2-31.7-31.7l0-97.2c0-17.5 14.2-31.7 31.7-31.7l0 0c17.5 0 31.7 14.2 31.7 31.7L645.5 734.3z"})]}),be=()=>u.jsx("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:u.jsx("path",{d:"M131.072 156.16c0-17.92 14.336-31.744 31.744-31.744 17.92 0 31.744 14.336 31.744 31.744v712.192c0 17.92-14.336 31.744-31.744 31.744-17.92 0-31.744-14.336-31.744-31.744V156.16zM292.864 338.944c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744h245.248c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-245.248zM292.864 490.496c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744H640c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-347.136zM292.864 794.112c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744h499.712c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-499.712zM292.864 642.56c-17.408 0-31.744-14.336-31.744-31.744 0-17.408 14.336-31.744 31.744-31.744h97.28c17.408 0 31.744 14.336 31.744 31.744 0 17.408-14.336 31.744-31.744 31.744h-97.28z"})}),we=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M307.1 686.3c-12.4 12.4-32.4 12.4-44.8 0l0 0c-12.4-12.4-12.4-32.4 0-44.8l173.4-173.4c12.4-12.4 32.4-12.4 44.8 0l0 0c12.4 12.4 12.4 32.4 0 44.8L307.1 686.3z"}),u.jsx("path",{d:"M608.8 640c-12.4 12.4-32.4 12.4-44.8 0l0 0c-12.4-12.4-12.4-32.4 0-44.8l212.7-212.7c12.4-12.4 32.4-12.4 44.8 0l0 0c12.4 12.4 12.4 32.4 0 44.8L608.8 640z"}),u.jsx("path",{d:"M608 595.3c12.4 12.4 12.4 32.4 0 44.8l0 0c-12.4 12.4-32.4 12.4-44.8 0L436 512.8c-12.4-12.4-12.4-32.4 0-44.8l0 0c12.4-12.4 32.4-12.4 44.8 0L608 595.3z"})]}),Ie=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M489.7 511 489 511 489 126.9c-201 12.3-360.1 179.2-360.1 383.3 0 212.1 171.9 384 384 384 106.5 0 202.9-43.4 272.5-113.4L489.7 511z"}),u.jsx("path",{d:"M773.1 237.2l6-6c-62.7-59.6-143.5-95.8-228.2-104l0 304.7L773.1 237.2z"}),u.jsx("path",{d:"M819.5 281.6 564.1 505.1 822 739c3-4 5.9-8.1 8.7-12.3 41.4-61.3 65.6-135.2 65.6-214.7C896.3 425.6 867.7 345.8 819.5 281.6z"})]}),Pe=()=>u.jsxs("svg",{width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",children:[u.jsx("path",{d:"M191 864c0 17.7-14.3 32-32 32l0 0c-17.7 0-32-14.3-32-32L127 160c0-17.7 14.3-32 32-32l0 0c17.7 0 32 14.3 32 32L191 864z"}),u.jsx("path",{d:"M159 896c-17.7 0-32-14.3-32-32l0 0c0-17.7 14.3-32 32-32l712 0c17.7 0 32 14.3 32 32l0 0c0 17.7-14.3 32-32 32L159 896z"}),u.jsx("path",{d:"M830.6 338.2 830.6 338.2c0.9-9.2-2.1-18.6-9.1-25.7-12.4-12.4-32.4-12.4-44.8 0L586 503.3 480.8 398.1c-6.2-6.2-14.4-9.3-22.5-9.3-8.1 0-16.3 3.1-22.5 9.3L262.4 571.5c-6 6-9.1 13.8-9.3 21.6 0 0.1 0 0.1 0 0.2l0 111.8c0 35.3 28.7 64 64 64l449.7 0c33.8 0 61.4-26.1 63.8-59.3l0 0 0-0.2c0.1-1.5 0.2-3 0.2-4.5L830.8 593.3c0-0.3-0.1-0.7-0.2-1L830.6 338.2z"})]});o.Icon.register({"icon-area":e=>u.jsx(o.Icon,b({component:Pe},e)),"icon-pie":e=>u.jsx(o.Icon,b({component:Ie},e)),"icon-radar":e=>u.jsx(o.Icon,b({component:ge},e)),"icon-funnel":e=>u.jsx(o.Icon,b({component:xe},e)),"icon-line":e=>u.jsx(o.Icon,b({component:we},e)),"icon-bar":e=>u.jsx(o.Icon,b({component:be},e)),"icon-column":e=>u.jsx(o.Icon,b({component:ve},e)),"icon-scatter":e=>u.jsx(o.Icon,b({component:Se},e))});const Ne={label:"label",value:"value",color:"color",options:"children"},qe=(e,t,n)=>{function i(c){const F=[];for(let s=0;s<c.length;s++){const h=c[s][n.options];Array.isArray(h)&&F.push(...i(h)),F.push(b({},c[s]))}return F}const a=i(t);return e=hu.castArray(e).filter(c=>c!=null).map(c=>typeof c=="object"?c[n.value]:c),(c=>{if(!c)return[];const F=[];for(const s of e){const h=c.find(g=>g[n.value]===s)||{value:s,label:s};F.push(h)}return F})(a)},Tu=I.observer(e=>{var c;const t=b(b({},Ne),e.fieldNames),n=I.useField(),i=o.useCompile();if(!nu.isValid(e.value))return u.jsx("div",{});if(w.isArrayField(n)&&((c=n==null?void 0:n.value)==null?void 0:c.length)===0)return u.jsx("div",{});const a=n.dataSource||e.options||[],D=qe(n.value,a,t);return u.jsx("div",{children:D.map((F,s)=>u.jsx(L.Tag,{color:F[t.color],icon:F.icon,children:i(F[t.label])},s))})},{displayName:"ReadPretty"}),{Option:ju,OptGroup:Vu}=L.Select,Le=(e,t)=>{var n;return((n=t==null?void 0:t.label)!=null?n:"").toLowerCase().includes((e||"").toLowerCase())},Ju=I.connect(e=>{const t=cu(e,[]),F=b({},t),{options:n}=F,i=cu(F,["options"]),a=e.mode||e.multiple?"multiple":void 0,D=n.filter(s=>s.group===2),c=n.filter(s=>s.group===1);return u.jsxs(L.Select,U(b({showSearch:!0,filterOption:Le,allowClear:!0},i),{onChange:s=>{var h;(h=e.onChange)==null||h.call(e,s===void 0?null:s)},mode:a,children:[u.jsx(Vu,{label:m("Basic charts"),children:D.map(s=>u.jsx(ju,{value:s.key,label:m(s.title),children:u.jsx(o.StablePopover,{placement:"right",zIndex:99999999999,content:()=>{var h;return u.jsx("span",{children:(h=m(s==null?void 0:s.description))==null?void 0:h.split(",").map(g=>u.jsx("div",{children:g},g))})},trigger:"hover",children:u.jsxs("div",{className:o.css`
|
|
37
37
|
display: flex;
|
|
38
38
|
gap: 4px;
|
|
39
39
|
align-items: center;
|
|
40
|
-
`,children:[u.jsx(o.Icon,{type:s.iconId}),u.jsx("span",{role:"img","aria-label":m(s.title),children:m(s.title)})]})})},s.key))}),u.jsx(Vu,{label:m("More charts"),children:c.map(s=>u.jsx(ju,{value:s.key,label:m(s.title),children:u.jsx(o.
|
|
40
|
+
`,children:[u.jsx(o.Icon,{type:s.iconId}),u.jsx("span",{role:"img","aria-label":m(s.title),children:m(s.title)})]})})},s.key))}),u.jsx(Vu,{label:m("More charts"),children:c.map(s=>u.jsx(ju,{value:s.key,label:m(s.title),children:u.jsx(o.StablePopover,{placement:"right",zIndex:99999999999,content:()=>{var h;return u.jsx("span",{children:(h=m(s==null?void 0:s.description))==null?void 0:h.split(",").map(g=>u.jsx("div",{children:g},g))})},trigger:"hover",children:u.jsxs("div",{className:o.css`
|
|
41
41
|
display: flex;
|
|
42
42
|
gap: 4px;
|
|
43
43
|
align-items: center;
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@nocobase/client": "0.
|
|
3
|
-
"antd": "5.
|
|
2
|
+
"@nocobase/client": "0.18.0-alpha.1",
|
|
3
|
+
"antd": "5.12.2",
|
|
4
4
|
"react": "18.2.0",
|
|
5
|
-
"@formily/antd-v5": "1.1.
|
|
6
|
-
"@formily/react": "2.
|
|
7
|
-
"@nocobase/utils": "0.
|
|
5
|
+
"@formily/antd-v5": "1.1.9",
|
|
6
|
+
"@formily/react": "2.3.0",
|
|
7
|
+
"@nocobase/utils": "0.18.0-alpha.1",
|
|
8
8
|
"react-i18next": "11.18.6",
|
|
9
|
-
"@formily/core": "2.
|
|
10
|
-
"@ant-design/icons": "5.
|
|
11
|
-
"react-router-dom": "6.
|
|
12
|
-
"@formily/shared": "2.
|
|
13
|
-
"@nocobase/server": "0.
|
|
14
|
-
"@nocobase/database": "0.
|
|
9
|
+
"@formily/core": "2.3.0",
|
|
10
|
+
"@ant-design/icons": "5.2.6",
|
|
11
|
+
"react-router-dom": "6.21.0",
|
|
12
|
+
"@formily/shared": "2.3.0",
|
|
13
|
+
"@nocobase/server": "0.18.0-alpha.1",
|
|
14
|
+
"@nocobase/database": "0.18.0-alpha.1",
|
|
15
15
|
"lodash": "4.17.21"
|
|
16
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"json5","version":"2.2.3","description":"JSON for Humans","main":"lib/index.js","module":"dist/index.mjs","bin":"lib/cli.js","browser":"dist/index.js","types":"lib/index.d.ts","files":["lib/","dist/"],"engines":{"node":">=6"},"scripts":{"build":"rollup -c","build-package":"node build/package.js","build-unicode":"node build/unicode.js","coverage":"tap --coverage-report html test","lint":"eslint --fix .","lint-report":"eslint .","prepublishOnly":"npm run production","preversion":"npm run production","production":"run-s test build","tap":"tap -Rspec --100 test","test":"run-s lint-report tap","version":"npm run build-package && git add package.json5"},"repository":{"type":"git","url":"git+https://github.com/json5/json5.git"},"keywords":["json","json5","es5","es2015","ecmascript"],"author":"Aseem Kishore <aseem.kishore@gmail.com>","contributors":["Max Nanasy <max.nanasy@gmail.com>","Andrew Eisenberg <andrew@eisenberg.as>","Jordan Tucker <jordanbtucker@gmail.com>"],"license":"MIT","bugs":{"url":"https://github.com/json5/json5/issues"},"homepage":"http://json5.org/","devDependencies":{"core-js":"^2.6.5","eslint":"^5.15.3","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.16.0","eslint-plugin-node":"^8.0.1","eslint-plugin-promise":"^4.0.1","eslint-plugin-standard":"^4.0.0","npm-run-all":"^4.1.5","regenerate":"^1.4.0","rollup":"^0.64.1","rollup-plugin-buble":"^0.19.6","rollup-plugin-commonjs":"^9.2.1","rollup-plugin-node-resolve":"^3.4.0","rollup-plugin-terser":"^1.0.1","sinon":"^6.3.5","tap":"^12.6.0","unicode-10.0.0":"^0.7.5"},"_lastModified":"2023-12-
|
|
1
|
+
{"name":"json5","version":"2.2.3","description":"JSON for Humans","main":"lib/index.js","module":"dist/index.mjs","bin":"lib/cli.js","browser":"dist/index.js","types":"lib/index.d.ts","files":["lib/","dist/"],"engines":{"node":">=6"},"scripts":{"build":"rollup -c","build-package":"node build/package.js","build-unicode":"node build/unicode.js","coverage":"tap --coverage-report html test","lint":"eslint --fix .","lint-report":"eslint .","prepublishOnly":"npm run production","preversion":"npm run production","production":"run-s test build","tap":"tap -Rspec --100 test","test":"run-s lint-report tap","version":"npm run build-package && git add package.json5"},"repository":{"type":"git","url":"git+https://github.com/json5/json5.git"},"keywords":["json","json5","es5","es2015","ecmascript"],"author":"Aseem Kishore <aseem.kishore@gmail.com>","contributors":["Max Nanasy <max.nanasy@gmail.com>","Andrew Eisenberg <andrew@eisenberg.as>","Jordan Tucker <jordanbtucker@gmail.com>"],"license":"MIT","bugs":{"url":"https://github.com/json5/json5/issues"},"homepage":"http://json5.org/","devDependencies":{"core-js":"^2.6.5","eslint":"^5.15.3","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.16.0","eslint-plugin-node":"^8.0.1","eslint-plugin-promise":"^4.0.1","eslint-plugin-standard":"^4.0.0","npm-run-all":"^4.1.5","regenerate":"^1.4.0","rollup":"^0.64.1","rollup-plugin-buble":"^0.19.6","rollup-plugin-commonjs":"^9.2.1","rollup-plugin-node-resolve":"^3.4.0","rollup-plugin-terser":"^1.0.1","sinon":"^6.3.5","tap":"^12.6.0","unicode-10.0.0":"^0.7.5"},"_lastModified":"2023-12-21T12:48:06.734Z"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "图表(废弃)",
|
|
5
5
|
"description": "Out-of-the-box, feature-rich chart plugins.",
|
|
6
6
|
"description.zh-CN": "开箱即用、丰富的报表。",
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.18.0-alpha.1",
|
|
8
8
|
"main": "./dist/server/index.js",
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"@ant-design/icons": "5.x",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"@nocobase/test": "0.x",
|
|
26
26
|
"@nocobase/utils": "0.x"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "0f5f1c0a37dc397a9dc4c8eec0c4ec20fd8107b0"
|
|
29
29
|
}
|