@progress/kendo-react-chart-wizard 8.3.0-develop.9 → 8.3.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.
Files changed (60) hide show
  1. package/ChartWizard.js +1 -1
  2. package/ChartWizard.mjs +88 -942
  3. package/components/ChartComponent.js +8 -0
  4. package/components/ChartComponent.mjs +69 -0
  5. package/components/FormField.js +8 -0
  6. package/components/FormField.mjs +16 -0
  7. package/{common/get-wizard-data-from-data-rows.js → components/FormFieldSet.js} +1 -1
  8. package/{common/get-wizard-data-from-data-rows.mjs → components/FormFieldSet.mjs} +3 -14
  9. package/components/SeriesGrid.js +8 -0
  10. package/components/SeriesGrid.mjs +89 -0
  11. package/components/SeriesTypeButton.js +8 -0
  12. package/components/SeriesTypeButton.mjs +30 -0
  13. package/components/SeriesTypesWrap.js +8 -0
  14. package/components/SeriesTypesWrap.mjs +14 -0
  15. package/components/panels/BarChartPanel.js +8 -0
  16. package/components/panels/BarChartPanel.mjs +71 -0
  17. package/components/panels/CategoryAxisPanel.js +8 -0
  18. package/components/panels/CategoryAxisPanel.mjs +315 -0
  19. package/components/panels/ChartAreaPanel.js +8 -0
  20. package/components/panels/ChartAreaPanel.mjs +200 -0
  21. package/components/panels/ColumnChartPanel.js +8 -0
  22. package/components/panels/ColumnChartPanel.mjs +77 -0
  23. package/components/panels/ConfigurationPanel.js +8 -0
  24. package/components/panels/ConfigurationPanel.mjs +102 -0
  25. package/components/panels/LegendPanel.js +8 -0
  26. package/components/panels/LegendPanel.mjs +190 -0
  27. package/components/panels/LineChartPanel.js +8 -0
  28. package/components/panels/LineChartPanel.mjs +74 -0
  29. package/components/panels/PieChartPanel.js +8 -0
  30. package/components/panels/PieChartPanel.mjs +47 -0
  31. package/components/panels/ScatterChartPanel.js +8 -0
  32. package/components/panels/ScatterChartPanel.mjs +47 -0
  33. package/components/panels/SeriesPanel.js +8 -0
  34. package/components/panels/SeriesPanel.mjs +110 -0
  35. package/components/panels/TitlePanel.js +8 -0
  36. package/components/panels/TitlePanel.mjs +172 -0
  37. package/components/panels/ValueAxisPanel.js +8 -0
  38. package/components/panels/ValueAxisPanel.mjs +332 -0
  39. package/dist/cdn/js/kendo-react-chart-wizard.js +1 -1
  40. package/grid-integration/get-wizard-data-from-grid-selection.js +1 -1
  41. package/grid-integration/get-wizard-data-from-grid-selection.mjs +4 -4
  42. package/index.d.mts +15 -194
  43. package/index.d.ts +15 -194
  44. package/index.js +1 -1
  45. package/index.mjs +8 -18
  46. package/messages.js +1 -1
  47. package/messages.mjs +109 -215
  48. package/package.json +15 -15
  49. package/types/export.js +8 -0
  50. package/types/export.mjs +39 -0
  51. package/utils.js +8 -0
  52. package/utils.mjs +81 -0
  53. package/SeriesGrid.js +0 -8
  54. package/SeriesGrid.mjs +0 -85
  55. package/chart-wizard-state.js +0 -8
  56. package/chart-wizard-state.mjs +0 -360
  57. package/export.js +0 -8
  58. package/export.mjs +0 -70
  59. /package/{SeriesGridCells.js → components/SeriesGridCells.js} +0 -0
  60. /package/{SeriesGridCells.mjs → components/SeriesGridCells.mjs} +0 -0
@@ -1,8 +0,0 @@
1
- /**
2
- * @license
3
- *-------------------------------------------------------------------------------------------
4
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
- * Licensed under commercial license. See LICENSE.md in the package root for more information
6
- *-------------------------------------------------------------------------------------------
7
- */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var _=(t=>(t[t.seriesType=0]="seriesType",t[t.stacked=1]="stacked",t[t.categoryAxisX=2]="categoryAxisX",t[t.valueAxisY=3]="valueAxisY",t[t.seriesChange=4]="seriesChange",t[t.areaMarginLeft=5]="areaMarginLeft",t[t.areaMarginRight=6]="areaMarginRight",t[t.areaMarginTop=7]="areaMarginTop",t[t.areaMarginBottom=8]="areaMarginBottom",t[t.areaBackground=9]="areaBackground",t[t.titleText=10]="titleText",t[t.titleFontName=11]="titleFontName",t[t.titleFontSize=12]="titleFontSize",t[t.titleColor=13]="titleColor",t[t.subtitleText=14]="subtitleText",t[t.subtitleFontName=15]="subtitleFontName",t[t.subtitleFontSize=16]="subtitleFontSize",t[t.subtitleColor=17]="subtitleColor",t[t.seriesColor=18]="seriesColor",t[t.seriesLabel=19]="seriesLabel",t[t.legendVisible=20]="legendVisible",t[t.legendFontName=21]="legendFontName",t[t.legendFontSize=22]="legendFontSize",t[t.legendColor=23]="legendColor",t[t.legendPosition=24]="legendPosition",t[t.categoryAxisTitleText=25]="categoryAxisTitleText",t[t.categoryAxisTitleFontName=26]="categoryAxisTitleFontName",t[t.categoryAxisTitleFontSize=27]="categoryAxisTitleFontSize",t[t.categoryAxisTitleColor=28]="categoryAxisTitleColor",t[t.categoryAxisLabelsFontName=29]="categoryAxisLabelsFontName",t[t.categoryAxisLabelsFontSize=30]="categoryAxisLabelsFontSize",t[t.categoryAxisLabelsColor=31]="categoryAxisLabelsColor",t[t.categoryAxisLabelsRotation=32]="categoryAxisLabelsRotation",t[t.categoryAxisReverseOrder=33]="categoryAxisReverseOrder",t[t.valueAxisTitleText=34]="valueAxisTitleText",t[t.valueAxisTitleFontName=35]="valueAxisTitleFontName",t[t.valueAxisTitleFontSize=36]="valueAxisTitleFontSize",t[t.valueAxisTitleColor=37]="valueAxisTitleColor",t[t.valueAxisLabelsFormat=38]="valueAxisLabelsFormat",t[t.valueAxisLabelsFontName=39]="valueAxisLabelsFontName",t[t.valueAxisLabelsFontSize=40]="valueAxisLabelsFontSize",t[t.valueAxisLabelsColor=41]="valueAxisLabelsColor",t[t.valueAxisLabelsRotation=42]="valueAxisLabelsRotation",t))(_||{});const f=[{text:"8",value:"8px"},{text:"10",value:"10px"},{text:"12",value:"12px"},{text:"14",value:"14px"},{text:"16",value:"16px"},{text:"20",value:"20px"},{text:"24",value:"24px"},{text:"48",value:"48px"},{text:"60",value:"60px"},{text:"96",value:"96px"}],d=[{text:"Arial",value:"Arial, Helvetica, sans-serif",style:{fontFamily:"Arial, Helvetica, sans-serif"}},{text:"Courier New",value:"'Courier New', Courier, monospace",style:{fontFamily:"'Courier New', Courier, monospace"}},{text:"Georgia",value:"Georgia, serif",style:{fontFamily:"Georgia, serif"}},{text:"Impact",value:"Impact, Charcoal, sans-serif",style:{fontFamily:"Impact, Charcoal, sans-serif"}},{text:"Lucida Console",value:"'Lucida Console', Monaco, monospace",style:{fontFamily:"'Lucida Console', Monaco, monospace"}},{text:"Tahoma",value:"Tahoma, Geneva, sans-serif",style:{fontFamily:"Tahoma, Geneva, sans-serif"}},{text:"Times New Roman",value:"'Times New Roman', Times,serif",style:{fontFamily:"'Times New Roman', Times,serif"}},{text:"Trebuchet MS",value:"'Trebuchet MS', Helvetica, sans-serif",style:{fontFamily:"'Trebuchet MS', Helvetica, sans-serif"}},{text:"Verdana",value:"Verdana, Geneva, sans-serif",style:{fontFamily:"Verdana, Geneva, sans-serif"}}],ue="column",ce="bar",T="line",Z="pie",ee="scatter",ge=[ue,ce,T,ee],xe={type:T,width:0},S=t=>t&&ge.includes(t),L=["string","date","number"],N=["number"],te={bar:[{axisType:"category",types:L},{axisType:"value",types:N}],column:[{axisType:"category",types:L},{axisType:"value",types:N}],line:[{axisType:"category",types:L},{axisType:"value",types:N}],pie:[{axisType:"category",types:L},{axisType:"value",types:N,count:1}],scatter:[{axisType:"category",types:L},{axisType:"value",types:N}]},ae=(t,l)=>`${l||""} ${t||""}`.trim(),A=t=>{const l=(t||"").indexOf(" "),a=t==null?void 0:t.substring(0,l),e=t==null?void 0:t.substring(l+1);return{size:a,name:e}},h=(t,l,a)=>{const{size:e}=A(a);return t?ae(t,e||l):""},C=(t,l,a)=>{const{name:e}=A(a);return t?ae(e||l,t):""},z=t=>t!=null,re=t=>{const l=structuredClone(t[0]);return l.forEach((a,e)=>{if(!z(a.value))for(let c=0;c<t.length;c++){const n=t[c][e].value;if(z(n)){a.value=n;break}}}),l},le=(t,l)=>{const a=[],e=re(t);l.types.forEach(n=>{e.forEach((g,o)=>{typeof g.value===n&&a.push(o)})});const c=a.findIndex(n=>{const g=t.map(o=>o[n].value);return new Set(g).size===g.length});return Math.max(c,0)},se=(t,l)=>{const a=[],e=re(t);return l.forEach(c=>{c.types.forEach(n=>{e.forEach((g,o)=>{typeof g.value===n&&a.push(o)})})}),a},ie=()=>structuredClone({columns:[],data:[],series:[],initialSeries:[],categoryAxis:[],valueAxis:[{labels:{visible:!0}}],area:{margin:{left:void 0,right:void 0,top:void 0,bottom:void 0}},stack:!1}),oe=(t,l,a)=>{const e=ie();e.seriesType=l,e.data=t;const c=te[l];if(!c)return e;const n=t[0].slice();e.columns=t[0].map(s=>String(s.field));const g=c.find(s=>s.axisType==="category");let o=-1;g&&(o=a!=null&&a.categoryAxis?e.columns.indexOf(a==null?void 0:a.categoryAxis):le(t,g));const m=c.filter(s=>s.axisType==="value");let u=se(t,m);u.includes(o)&&(u.length>1?u=u.filter(s=>s!==o):o=-1);const b=[];u.forEach(s=>{const x=n[s],y=[];t.forEach(F=>{y.push(F[s].value)}),b.push({name:x.field,type:l,data:y,stack:!1,labels:{visible:!1},...l===ee?xe:{}})});const v=o>-1?t.map(s=>String(z(s[o].value)?s[o].value:" ")):[];return b.length&&(e.series=b.map((s,x)=>({...s,id:x})),e.initialSeries=structuredClone(e.series)),e.categoryAxis=[{categories:v,labels:{visible:!0,rotation:"auto"}}],e.categoryField=e.columns[o],e.legend={visible:!0},e.title={text:void 0},e.subtitle={text:void 0},e},R=(t,l,a)=>{const e=ie();e.seriesType=l,e.data=t;const c=te[l];if(!c)return e;const n=t[0].map(s=>s.field),g=c.find(s=>s.axisType==="category");let o=-1;g&&(o=a!=null&&a.categoryAxis?n.indexOf(a==null?void 0:a.categoryAxis):le(t,g));const m=c.filter(s=>s.axisType==="value");let u=[];a!=null&&a.valueAxis?u=[n.indexOf(a.valueAxis)]:u=se(t,m),u.includes(o)&&u.length>1&&(u=u.filter(s=>s!==o)),typeof m[0].count=="number"&&(u=u.slice(0,m[0].count));const b=o>-1?t.map(s=>String(s[o].value)):[],v=[];return t.forEach(s=>{const x={};u.forEach(y=>{const F=s[y];x[F.field]=F.value||0,x[s[o].field]=s[o].value||" "}),v.push(x)}),e.columns=n,e.categoryAxis=[{categories:b,title:{text:""}}],e.series=[{id:0,data:v,type:l,name:n[o],labels:{visible:!0},categoryField:n[o],field:n[u[0]]}],e.categoryField=n[o],e.valueField=n[u[0]],e.initialSeries=structuredClone(e.series),e},me=(t,l,a)=>{const e=I(t,(a==null?void 0:a.seriesType)||l);return typeof(a==null?void 0:a.stack)!="undefined"?ne(e,1,a.stack):e},I=(t,l)=>(S(l)?oe:R)(t,l),M=(t,l)=>{if(l.legend=t.legend,l.area=t.area,l.title=t.title,l.subtitle=t.subtitle,l.series.length===t.series.length)for(let a=0;a<l.series.length;a++)l.series[a].color=t.series[a].color,l.series[a].labels=t.series[a].labels;return t.series.every(a=>{var e;return(e=a.labels)==null?void 0:e.visible})&&S(l.seriesType)&&S(t.seriesType)&&l.series.forEach(a=>{a.labels=a.labels||{},a.labels.visible=!0}),l},ne=(t,l,a)=>{var c,n,g,o,m,u,b,v,s,x,y,F,k,E,p,V,D,G,O,B,H,P,w,X,Y,$,j,W,q,J,K,Q,U;const e={...t};switch(l){case 0:return I(e.data,a);case 1:return e.series=e.series.map(r=>({...r,stack:a})),e;case 2:{if(e.seriesType&&S(e.seriesType)){const r=oe(e.data,e.seriesType,{categoryAxis:a});return M(e,r)}else if(e.seriesType===Z){const r=R(e.data,e.seriesType,{categoryAxis:a});return M(e,r)}return e}case 3:{if(e.seriesType===Z){const r=R(e.data,e.seriesType,{categoryAxis:e.categoryField,valueAxis:a});return M(e,r)}return e}case 4:return e.series=a,e;case 5:return e.area={...e.area,margin:{...((c=e.area)==null?void 0:c.margin)||{},left:a}},e;case 6:return e.area={...e.area,margin:{...((n=e.area)==null?void 0:n.margin)||{},right:a}},e;case 7:return e.area={...e.area,margin:{...((g=e.area)==null?void 0:g.margin)||{},top:a}},e;case 8:return e.area={...e.area,margin:{...((o=e.area)==null?void 0:o.margin)||{},bottom:a}},e;case 9:return e.area={...e.area,background:a},e;case 10:return e.title={...e.title,text:a},e;case 11:return e.title={...e.title,font:h(a,f[0].value,(m=e.title)==null?void 0:m.font)},e;case 12:return e.title={...e.title,font:C(a,d[0].value,(u=e.title)==null?void 0:u.font)},e;case 13:return e.title={...e.title,color:a},e;case 14:return e.subtitle={...e.subtitle,text:a},e;case 15:return e.subtitle={...e.subtitle,font:h(a,f[0].value,(b=e.subtitle)==null?void 0:b.font)},e;case 16:return e.subtitle={...e.subtitle,font:C(a,d[0].value,(v=e.subtitle)==null?void 0:v.font)},e;case 17:return e.subtitle={...e.subtitle,color:a},e;case 18:return e.series=e.series.map(r=>({...r,color:a.seriesName===r.name?a.color:r.color})),e;case 19:return e.series=e.series.map(r=>a.all||a.seriesName===r.name?{...r,labels:{visible:a.visible}}:r),e;case 20:return e.legend={...e.legend,visible:a},e;case 21:return e.legend={...e.legend,labels:{...(s=e.legend)==null?void 0:s.labels,font:h(a,f[0].value,(y=(x=e.legend)==null?void 0:x.labels)==null?void 0:y.font)}},e;case 22:return e.legend={...e.legend,labels:{...(F=e.legend)==null?void 0:F.labels,font:C(a,d[0].value,(E=(k=e.legend)==null?void 0:k.labels)==null?void 0:E.font)}},e;case 23:return e.legend={...e.legend,labels:{...(p=e.legend)==null?void 0:p.labels,color:a}},e;case 24:return e.legend={...e.legend,position:a},e;case 25:return e.categoryAxis=(V=e.categoryAxis)==null?void 0:V.map(r=>({...r,title:{...r.title,text:a}})),e;case 26:return e.categoryAxis=(D=e.categoryAxis)==null?void 0:D.map(r=>{var i;return{...r,title:{...r.title,font:h(a,f[0].value,(i=r.title)==null?void 0:i.font)}}}),e;case 27:return e.categoryAxis=(G=e.categoryAxis)==null?void 0:G.map(r=>{var i;return{...r,title:{...r.title,font:C(a,d[0].value,(i=r.title)==null?void 0:i.font)}}}),e;case 28:return e.categoryAxis=(O=e.categoryAxis)==null?void 0:O.map(r=>({...r,title:{...r.title,color:a}})),e;case 29:return e.categoryAxis=(B=e.categoryAxis)==null?void 0:B.map(r=>{var i;return{...r,labels:{...r.labels,font:h(a,f[0].value,(i=r.labels)==null?void 0:i.font)}}}),e;case 30:return e.categoryAxis=(H=e.categoryAxis)==null?void 0:H.map(r=>{var i;return{...r,labels:{...r.labels,font:C(a,d[0].value,(i=r.labels)==null?void 0:i.font)}}}),e;case 31:return e.categoryAxis=(P=e.categoryAxis)==null?void 0:P.map(r=>({...r,labels:{...r.labels,color:a}})),e;case 32:{const r=z(a)?a:"auto";return e.categoryAxis=(w=e.categoryAxis)==null?void 0:w.map(i=>({...i,labels:{...i.labels,rotation:r}})),e}case 33:return e.categoryAxis=(X=e.categoryAxis)==null?void 0:X.map(r=>({...r,reverse:a})),e;case 34:return!e.valueAxis||e.valueAxis.length===0?e.valueAxis=[{title:{text:a}}]:e.valueAxis=(Y=e.valueAxis)==null?void 0:Y.map(r=>({...r,title:{...r.title,text:a}})),e;case 35:return e.valueAxis=($=e.valueAxis)==null?void 0:$.map(r=>{var i;return{...r,title:{...r.title,font:h(a,f[0].value,(i=r.title)==null?void 0:i.font)}}}),e;case 36:return e.valueAxis=(j=e.valueAxis)==null?void 0:j.map(r=>{var i;return{...r,title:{...r.title,font:C(a,d[0].value,(i=r.title)==null?void 0:i.font)}}}),e;case 37:return e.valueAxis=(W=e.valueAxis)==null?void 0:W.map(r=>({...r,title:{...r.title,color:a}})),e;case 38:return e.valueAxis=(q=e.valueAxis)==null?void 0:q.map(r=>({...r,labels:{...r.labels,format:a}})),e;case 39:return e.valueAxis=(J=e.valueAxis)==null?void 0:J.map(r=>{var i;return{...r,labels:{...r.labels,font:h(a,f[0].value,(i=r.labels)==null?void 0:i.font)}}}),e;case 40:return e.valueAxis=(K=e.valueAxis)==null?void 0:K.map(r=>{var i;return{...r,labels:{...r.labels,font:C(a,d[0].value,(i=r.labels)==null?void 0:i.font)}}}),e;case 41:return e.valueAxis=(Q=e.valueAxis)==null?void 0:Q.map(r=>({...r,labels:{...r.labels,color:a}})),e;case 42:{const r=z(a)?a:"auto";return e.valueAxis=(U=e.valueAxis)==null?void 0:U.map(i=>({...i,labels:{...i.labels,rotation:r}})),e}default:return e}};exports.ActionTypes=_;exports.createInitialState=me;exports.createState=I;exports.fontNames=d;exports.fontSizes=f;exports.isCategorical=S;exports.mergeStates=M;exports.parseFont=A;exports.updateState=ne;
@@ -1,360 +0,0 @@
1
- /**
2
- * @license
3
- *-------------------------------------------------------------------------------------------
4
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
- * Licensed under commercial license. See LICENSE.md in the package root for more information
6
- *-------------------------------------------------------------------------------------------
7
- */
8
- "use client";
9
- var oe = /* @__PURE__ */ ((t) => (t[t.seriesType = 0] = "seriesType", t[t.stacked = 1] = "stacked", t[t.categoryAxisX = 2] = "categoryAxisX", t[t.valueAxisY = 3] = "valueAxisY", t[t.seriesChange = 4] = "seriesChange", t[t.areaMarginLeft = 5] = "areaMarginLeft", t[t.areaMarginRight = 6] = "areaMarginRight", t[t.areaMarginTop = 7] = "areaMarginTop", t[t.areaMarginBottom = 8] = "areaMarginBottom", t[t.areaBackground = 9] = "areaBackground", t[t.titleText = 10] = "titleText", t[t.titleFontName = 11] = "titleFontName", t[t.titleFontSize = 12] = "titleFontSize", t[t.titleColor = 13] = "titleColor", t[t.subtitleText = 14] = "subtitleText", t[t.subtitleFontName = 15] = "subtitleFontName", t[t.subtitleFontSize = 16] = "subtitleFontSize", t[t.subtitleColor = 17] = "subtitleColor", t[t.seriesColor = 18] = "seriesColor", t[t.seriesLabel = 19] = "seriesLabel", t[t.legendVisible = 20] = "legendVisible", t[t.legendFontName = 21] = "legendFontName", t[t.legendFontSize = 22] = "legendFontSize", t[t.legendColor = 23] = "legendColor", t[t.legendPosition = 24] = "legendPosition", t[t.categoryAxisTitleText = 25] = "categoryAxisTitleText", t[t.categoryAxisTitleFontName = 26] = "categoryAxisTitleFontName", t[t.categoryAxisTitleFontSize = 27] = "categoryAxisTitleFontSize", t[t.categoryAxisTitleColor = 28] = "categoryAxisTitleColor", t[t.categoryAxisLabelsFontName = 29] = "categoryAxisLabelsFontName", t[t.categoryAxisLabelsFontSize = 30] = "categoryAxisLabelsFontSize", t[t.categoryAxisLabelsColor = 31] = "categoryAxisLabelsColor", t[t.categoryAxisLabelsRotation = 32] = "categoryAxisLabelsRotation", t[t.categoryAxisReverseOrder = 33] = "categoryAxisReverseOrder", t[t.valueAxisTitleText = 34] = "valueAxisTitleText", t[t.valueAxisTitleFontName = 35] = "valueAxisTitleFontName", t[t.valueAxisTitleFontSize = 36] = "valueAxisTitleFontSize", t[t.valueAxisTitleColor = 37] = "valueAxisTitleColor", t[t.valueAxisLabelsFormat = 38] = "valueAxisLabelsFormat", t[t.valueAxisLabelsFontName = 39] = "valueAxisLabelsFontName", t[t.valueAxisLabelsFontSize = 40] = "valueAxisLabelsFontSize", t[t.valueAxisLabelsColor = 41] = "valueAxisLabelsColor", t[t.valueAxisLabelsRotation = 42] = "valueAxisLabelsRotation", t))(oe || {});
10
- const h = [
11
- { text: "8", value: "8px" },
12
- { text: "10", value: "10px" },
13
- { text: "12", value: "12px" },
14
- { text: "14", value: "14px" },
15
- { text: "16", value: "16px" },
16
- { text: "20", value: "20px" },
17
- { text: "24", value: "24px" },
18
- { text: "48", value: "48px" },
19
- { text: "60", value: "60px" },
20
- { text: "96", value: "96px" }
21
- ], F = [
22
- {
23
- text: "Arial",
24
- value: "Arial, Helvetica, sans-serif",
25
- style: { fontFamily: "Arial, Helvetica, sans-serif" }
26
- },
27
- {
28
- text: "Courier New",
29
- value: "'Courier New', Courier, monospace",
30
- style: { fontFamily: "'Courier New', Courier, monospace" }
31
- },
32
- {
33
- text: "Georgia",
34
- value: "Georgia, serif",
35
- style: { fontFamily: "Georgia, serif" }
36
- },
37
- {
38
- text: "Impact",
39
- value: "Impact, Charcoal, sans-serif",
40
- style: { fontFamily: "Impact, Charcoal, sans-serif" }
41
- },
42
- {
43
- text: "Lucida Console",
44
- value: "'Lucida Console', Monaco, monospace",
45
- style: { fontFamily: "'Lucida Console', Monaco, monospace" }
46
- },
47
- {
48
- text: "Tahoma",
49
- value: "Tahoma, Geneva, sans-serif",
50
- style: { fontFamily: "Tahoma, Geneva, sans-serif" }
51
- },
52
- {
53
- text: "Times New Roman",
54
- value: "'Times New Roman', Times,serif",
55
- style: { fontFamily: "'Times New Roman', Times,serif" }
56
- },
57
- {
58
- text: "Trebuchet MS",
59
- value: "'Trebuchet MS', Helvetica, sans-serif",
60
- style: { fontFamily: "'Trebuchet MS', Helvetica, sans-serif" }
61
- },
62
- {
63
- text: "Verdana",
64
- value: "Verdana, Geneva, sans-serif",
65
- style: { fontFamily: "Verdana, Geneva, sans-serif" }
66
- }
67
- ], ne = "column", ue = "bar", U = "line", Q = "pie", Z = "scatter", ce = [ne, ue, U, Z], ge = {
68
- type: U,
69
- width: 0
70
- }, S = (t) => t && ce.includes(t), L = ["string", "date", "number"], N = ["number"], _ = {
71
- bar: [
72
- { axisType: "category", types: L },
73
- { axisType: "value", types: N }
74
- ],
75
- column: [
76
- { axisType: "category", types: L },
77
- { axisType: "value", types: N }
78
- ],
79
- line: [
80
- { axisType: "category", types: L },
81
- { axisType: "value", types: N }
82
- ],
83
- pie: [
84
- { axisType: "category", types: L },
85
- { axisType: "value", types: N, count: 1 }
86
- ],
87
- scatter: [
88
- { axisType: "category", types: L },
89
- { axisType: "value", types: N }
90
- ]
91
- }, T = (t, l) => `${l || ""} ${t || ""}`.trim(), ee = (t) => {
92
- const l = (t || "").indexOf(" "), a = t == null ? void 0 : t.substring(0, l), e = t == null ? void 0 : t.substring(l + 1);
93
- return { size: a, name: e };
94
- }, y = (t, l, a) => {
95
- const { size: e } = ee(a);
96
- return t ? T(t, e || l) : "";
97
- }, C = (t, l, a) => {
98
- const { name: e } = ee(a);
99
- return t ? T(e || l, t) : "";
100
- }, z = (t) => t != null, te = (t) => {
101
- const l = structuredClone(t[0]);
102
- return l.forEach((a, e) => {
103
- if (!z(a.value))
104
- for (let c = 0; c < t.length; c++) {
105
- const n = t[c][e].value;
106
- if (z(n)) {
107
- a.value = n;
108
- break;
109
- }
110
- }
111
- }), l;
112
- }, ae = (t, l) => {
113
- const a = [], e = te(t);
114
- l.types.forEach((n) => {
115
- e.forEach((g, o) => {
116
- typeof g.value === n && a.push(o);
117
- });
118
- });
119
- const c = a.findIndex((n) => {
120
- const g = t.map((o) => o[n].value);
121
- return new Set(g).size === g.length;
122
- });
123
- return Math.max(c, 0);
124
- }, re = (t, l) => {
125
- const a = [], e = te(t);
126
- return l.forEach((c) => {
127
- c.types.forEach((n) => {
128
- e.forEach((g, o) => {
129
- typeof g.value === n && a.push(o);
130
- });
131
- });
132
- }), a;
133
- }, le = () => structuredClone({
134
- columns: [],
135
- data: [],
136
- series: [],
137
- initialSeries: [],
138
- categoryAxis: [],
139
- valueAxis: [{ labels: { visible: !0 } }],
140
- area: {
141
- margin: { left: void 0, right: void 0, top: void 0, bottom: void 0 }
142
- },
143
- stack: !1
144
- }), se = (t, l, a) => {
145
- const e = le();
146
- e.seriesType = l, e.data = t;
147
- const c = _[l];
148
- if (!c)
149
- return e;
150
- const n = t[0].slice();
151
- e.columns = t[0].map((s) => String(s.field));
152
- const g = c.find((s) => s.axisType === "category");
153
- let o = -1;
154
- g && (o = a != null && a.categoryAxis ? e.columns.indexOf(a == null ? void 0 : a.categoryAxis) : ae(t, g));
155
- const b = c.filter((s) => s.axisType === "value");
156
- let u = re(t, b);
157
- u.includes(o) && (u.length > 1 ? u = u.filter((s) => s !== o) : o = -1);
158
- const m = [];
159
- u.forEach((s) => {
160
- const x = n[s], v = [];
161
- t.forEach((d) => {
162
- v.push(d[s].value);
163
- }), m.push({
164
- name: x.field,
165
- type: l,
166
- data: v,
167
- stack: !1,
168
- labels: { visible: !1 },
169
- ...l === Z ? ge : {}
170
- });
171
- });
172
- const f = o > -1 ? t.map((s) => String(z(s[o].value) ? s[o].value : " ")) : [];
173
- return m.length && (e.series = m.map((s, x) => ({ ...s, id: x })), e.initialSeries = structuredClone(e.series)), e.categoryAxis = [{ categories: f, labels: { visible: !0, rotation: "auto" } }], e.categoryField = e.columns[o], e.legend = { visible: !0 }, e.title = { text: void 0 }, e.subtitle = { text: void 0 }, e;
174
- }, M = (t, l, a) => {
175
- const e = le();
176
- e.seriesType = l, e.data = t;
177
- const c = _[l];
178
- if (!c)
179
- return e;
180
- const n = t[0].map((s) => s.field), g = c.find((s) => s.axisType === "category");
181
- let o = -1;
182
- g && (o = a != null && a.categoryAxis ? n.indexOf(a == null ? void 0 : a.categoryAxis) : ae(t, g));
183
- const b = c.filter((s) => s.axisType === "value");
184
- let u = [];
185
- a != null && a.valueAxis ? u = [n.indexOf(a.valueAxis)] : u = re(t, b), u.includes(o) && u.length > 1 && (u = u.filter((s) => s !== o)), typeof b[0].count == "number" && (u = u.slice(0, b[0].count));
186
- const m = o > -1 ? t.map((s) => String(s[o].value)) : [], f = [];
187
- return t.forEach((s) => {
188
- const x = {};
189
- u.forEach((v) => {
190
- const d = s[v];
191
- x[d.field] = d.value || 0, x[s[o].field] = s[o].value || " ";
192
- }), f.push(x);
193
- }), e.columns = n, e.categoryAxis = [{ categories: m, title: { text: "" } }], e.series = [{
194
- id: 0,
195
- data: f,
196
- type: l,
197
- name: n[o],
198
- labels: { visible: !0 },
199
- categoryField: n[o],
200
- field: n[u[0]]
201
- }], e.categoryField = n[o], e.valueField = n[u[0]], e.initialSeries = structuredClone(e.series), e;
202
- }, be = (t, l, a) => {
203
- const e = ie(t, (a == null ? void 0 : a.seriesType) || l);
204
- return typeof (a == null ? void 0 : a.stack) != "undefined" ? xe(e, 1, a.stack) : e;
205
- }, ie = (t, l) => (S(l) ? se : M)(t, l), R = (t, l) => {
206
- if (l.legend = t.legend, l.area = t.area, l.title = t.title, l.subtitle = t.subtitle, l.series.length === t.series.length)
207
- for (let a = 0; a < l.series.length; a++)
208
- l.series[a].color = t.series[a].color, l.series[a].labels = t.series[a].labels;
209
- return t.series.every((a) => {
210
- var e;
211
- return (e = a.labels) == null ? void 0 : e.visible;
212
- }) && S(l.seriesType) && S(t.seriesType) && l.series.forEach((a) => {
213
- a.labels = a.labels || {}, a.labels.visible = !0;
214
- }), l;
215
- }, xe = (t, l, a) => {
216
- var c, n, g, o, b, u, m, f, s, x, v, d, A, I, k, E, V, D, G, p, O, B, H, w, P, X, Y, $, W, j, q, J, K;
217
- const e = { ...t };
218
- switch (l) {
219
- case 0:
220
- return ie(e.data, a);
221
- case 1:
222
- return e.series = e.series.map((r) => ({ ...r, stack: a })), e;
223
- case 2: {
224
- if (e.seriesType && S(e.seriesType)) {
225
- const r = se(e.data, e.seriesType, { categoryAxis: a });
226
- return R(e, r);
227
- } else if (e.seriesType === Q) {
228
- const r = M(e.data, e.seriesType, { categoryAxis: a });
229
- return R(e, r);
230
- }
231
- return e;
232
- }
233
- case 3: {
234
- if (e.seriesType === Q) {
235
- const r = M(e.data, e.seriesType, { categoryAxis: e.categoryField, valueAxis: a });
236
- return R(e, r);
237
- }
238
- return e;
239
- }
240
- case 4:
241
- return e.series = a, e;
242
- case 5:
243
- return e.area = { ...e.area, margin: { ...((c = e.area) == null ? void 0 : c.margin) || {}, left: a } }, e;
244
- case 6:
245
- return e.area = { ...e.area, margin: { ...((n = e.area) == null ? void 0 : n.margin) || {}, right: a } }, e;
246
- case 7:
247
- return e.area = { ...e.area, margin: { ...((g = e.area) == null ? void 0 : g.margin) || {}, top: a } }, e;
248
- case 8:
249
- return e.area = { ...e.area, margin: { ...((o = e.area) == null ? void 0 : o.margin) || {}, bottom: a } }, e;
250
- case 9:
251
- return e.area = { ...e.area, background: a }, e;
252
- case 10:
253
- return e.title = { ...e.title, text: a }, e;
254
- case 11:
255
- return e.title = { ...e.title, font: y(a, h[0].value, (b = e.title) == null ? void 0 : b.font) }, e;
256
- case 12:
257
- return e.title = { ...e.title, font: C(a, F[0].value, (u = e.title) == null ? void 0 : u.font) }, e;
258
- case 13:
259
- return e.title = { ...e.title, color: a }, e;
260
- case 14:
261
- return e.subtitle = { ...e.subtitle, text: a }, e;
262
- case 15:
263
- return e.subtitle = { ...e.subtitle, font: y(a, h[0].value, (m = e.subtitle) == null ? void 0 : m.font) }, e;
264
- case 16:
265
- return e.subtitle = { ...e.subtitle, font: C(a, F[0].value, (f = e.subtitle) == null ? void 0 : f.font) }, e;
266
- case 17:
267
- return e.subtitle = { ...e.subtitle, color: a }, e;
268
- case 18:
269
- return e.series = e.series.map((r) => ({ ...r, color: a.seriesName === r.name ? a.color : r.color })), e;
270
- case 19:
271
- return e.series = e.series.map((r) => a.all || a.seriesName === r.name ? { ...r, labels: { visible: a.visible } } : r), e;
272
- case 20:
273
- return e.legend = { ...e.legend, visible: a }, e;
274
- case 21:
275
- return e.legend = { ...e.legend, labels: { ...(s = e.legend) == null ? void 0 : s.labels, font: y(a, h[0].value, (v = (x = e.legend) == null ? void 0 : x.labels) == null ? void 0 : v.font) } }, e;
276
- case 22:
277
- return e.legend = { ...e.legend, labels: { ...(d = e.legend) == null ? void 0 : d.labels, font: C(a, F[0].value, (I = (A = e.legend) == null ? void 0 : A.labels) == null ? void 0 : I.font) } }, e;
278
- case 23:
279
- return e.legend = { ...e.legend, labels: { ...(k = e.legend) == null ? void 0 : k.labels, color: a } }, e;
280
- case 24:
281
- return e.legend = { ...e.legend, position: a }, e;
282
- case 25:
283
- return e.categoryAxis = (E = e.categoryAxis) == null ? void 0 : E.map((r) => ({ ...r, title: { ...r.title, text: a } })), e;
284
- case 26:
285
- return e.categoryAxis = (V = e.categoryAxis) == null ? void 0 : V.map((r) => {
286
- var i;
287
- return { ...r, title: { ...r.title, font: y(a, h[0].value, (i = r.title) == null ? void 0 : i.font) } };
288
- }), e;
289
- case 27:
290
- return e.categoryAxis = (D = e.categoryAxis) == null ? void 0 : D.map((r) => {
291
- var i;
292
- return { ...r, title: { ...r.title, font: C(a, F[0].value, (i = r.title) == null ? void 0 : i.font) } };
293
- }), e;
294
- case 28:
295
- return e.categoryAxis = (G = e.categoryAxis) == null ? void 0 : G.map((r) => ({ ...r, title: { ...r.title, color: a } })), e;
296
- case 29:
297
- return e.categoryAxis = (p = e.categoryAxis) == null ? void 0 : p.map((r) => {
298
- var i;
299
- return { ...r, labels: { ...r.labels, font: y(a, h[0].value, (i = r.labels) == null ? void 0 : i.font) } };
300
- }), e;
301
- case 30:
302
- return e.categoryAxis = (O = e.categoryAxis) == null ? void 0 : O.map((r) => {
303
- var i;
304
- return { ...r, labels: { ...r.labels, font: C(a, F[0].value, (i = r.labels) == null ? void 0 : i.font) } };
305
- }), e;
306
- case 31:
307
- return e.categoryAxis = (B = e.categoryAxis) == null ? void 0 : B.map((r) => ({ ...r, labels: { ...r.labels, color: a } })), e;
308
- case 32: {
309
- const r = z(a) ? a : "auto";
310
- return e.categoryAxis = (H = e.categoryAxis) == null ? void 0 : H.map((i) => ({ ...i, labels: { ...i.labels, rotation: r } })), e;
311
- }
312
- case 33:
313
- return e.categoryAxis = (w = e.categoryAxis) == null ? void 0 : w.map((r) => ({ ...r, reverse: a })), e;
314
- case 34:
315
- return !e.valueAxis || e.valueAxis.length === 0 ? e.valueAxis = [{ title: { text: a } }] : e.valueAxis = (P = e.valueAxis) == null ? void 0 : P.map((r) => ({ ...r, title: { ...r.title, text: a } })), e;
316
- case 35:
317
- return e.valueAxis = (X = e.valueAxis) == null ? void 0 : X.map((r) => {
318
- var i;
319
- return { ...r, title: { ...r.title, font: y(a, h[0].value, (i = r.title) == null ? void 0 : i.font) } };
320
- }), e;
321
- case 36:
322
- return e.valueAxis = (Y = e.valueAxis) == null ? void 0 : Y.map((r) => {
323
- var i;
324
- return { ...r, title: { ...r.title, font: C(a, F[0].value, (i = r.title) == null ? void 0 : i.font) } };
325
- }), e;
326
- case 37:
327
- return e.valueAxis = ($ = e.valueAxis) == null ? void 0 : $.map((r) => ({ ...r, title: { ...r.title, color: a } })), e;
328
- case 38:
329
- return e.valueAxis = (W = e.valueAxis) == null ? void 0 : W.map((r) => ({ ...r, labels: { ...r.labels, format: a } })), e;
330
- case 39:
331
- return e.valueAxis = (j = e.valueAxis) == null ? void 0 : j.map((r) => {
332
- var i;
333
- return { ...r, labels: { ...r.labels, font: y(a, h[0].value, (i = r.labels) == null ? void 0 : i.font) } };
334
- }), e;
335
- case 40:
336
- return e.valueAxis = (q = e.valueAxis) == null ? void 0 : q.map((r) => {
337
- var i;
338
- return { ...r, labels: { ...r.labels, font: C(a, F[0].value, (i = r.labels) == null ? void 0 : i.font) } };
339
- }), e;
340
- case 41:
341
- return e.valueAxis = (J = e.valueAxis) == null ? void 0 : J.map((r) => ({ ...r, labels: { ...r.labels, color: a } })), e;
342
- case 42: {
343
- const r = z(a) ? a : "auto";
344
- return e.valueAxis = (K = e.valueAxis) == null ? void 0 : K.map((i) => ({ ...i, labels: { ...i.labels, rotation: r } })), e;
345
- }
346
- default:
347
- return e;
348
- }
349
- };
350
- export {
351
- oe as ActionTypes,
352
- be as createInitialState,
353
- ie as createState,
354
- F as fontNames,
355
- h as fontSizes,
356
- S as isCategorical,
357
- R as mergeStates,
358
- ee as parseFont,
359
- xe as updateState
360
- };
package/export.js DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * @license
3
- *-------------------------------------------------------------------------------------------
4
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
- * Licensed under commercial license. See LICENSE.md in the package root for more information
6
- *-------------------------------------------------------------------------------------------
7
- */
8
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@progress/kendo-drawing"),n=require("@progress/kendo-file-saver"),i=require("@progress/kendo-react-charts");class p{constructor(){this.prevented=!1}preventDefault(){this.prevented=!0}isDefaultPrevented(){return this.prevented}}class l extends p{constructor(t,r){super(),this.chart=t,this.exportOptions=r}}const s={fileName:"chart",pdf:{paperSize:"A4",margin:"1cm"},image:{width:800,height:600}},c=(e={})=>({fileName:e.fileName||s.fileName,pdf:{...s.pdf,...e.pdf},image:{...s.image,...e.image}}),h=e=>{const t=i.exportVisual(e.chart),r=e.exportOptions;t&&a.exportPDF(t,r.pdf).then(o=>n.saveAs(o,r.fileName+".pdf"))},d=e=>{const t=i.exportVisual(e.chart),r=e.exportOptions;t&&a.exportSVG(t).then(o=>n.saveAs(o,r.fileName+".svg"))},u=e=>{const t=e.exportOptions,r=i.exportVisual(e.chart,t.image);r&&a.exportImage(r,t.image).then(o=>n.saveAs(o,t.fileName+".png"))};exports.ExportEvent=l;exports.PreventableEvent=p;exports.handleImageExport=u;exports.handlePDFExport=h;exports.handleSVGExport=d;exports.resolveExportOptions=c;
package/export.mjs DELETED
@@ -1,70 +0,0 @@
1
- /**
2
- * @license
3
- *-------------------------------------------------------------------------------------------
4
- * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
- * Licensed under commercial license. See LICENSE.md in the package root for more information
6
- *-------------------------------------------------------------------------------------------
7
- */
8
- "use client";
9
- import { exportPDF as n, exportSVG as p, exportImage as c } from "@progress/kendo-drawing";
10
- import { saveAs as i } from "@progress/kendo-file-saver";
11
- import { exportVisual as a } from "@progress/kendo-react-charts";
12
- class f {
13
- constructor() {
14
- this.prevented = !1;
15
- }
16
- /* eslint-disable max-len */
17
- /**
18
- * Prevents the default action for a specified event.
19
- * In this way, the source component suppresses the built-in behavior that follows the event.
20
- */
21
- preventDefault() {
22
- this.prevented = !0;
23
- }
24
- /**
25
- * Returns `true` if the event was prevented by any of its subscribers.
26
- *
27
- * @returns - Returns `true` if the default action was prevented.
28
- * Otherwise, returns `false`.
29
- */
30
- isDefaultPrevented() {
31
- return this.prevented;
32
- }
33
- }
34
- class d extends f {
35
- constructor(e, r) {
36
- super(), this.chart = e, this.exportOptions = r;
37
- }
38
- }
39
- const s = {
40
- fileName: "chart",
41
- pdf: { paperSize: "A4", margin: "1cm" },
42
- image: { width: 800, height: 600 }
43
- }, u = (t = {}) => ({
44
- fileName: t.fileName || s.fileName,
45
- pdf: {
46
- ...s.pdf,
47
- ...t.pdf
48
- },
49
- image: {
50
- ...s.image,
51
- ...t.image
52
- }
53
- }), x = (t) => {
54
- const e = a(t.chart), r = t.exportOptions;
55
- e && n(e, r.pdf).then((o) => i(o, r.fileName + ".pdf"));
56
- }, g = (t) => {
57
- const e = a(t.chart), r = t.exportOptions;
58
- e && p(e).then((o) => i(o, r.fileName + ".svg"));
59
- }, v = (t) => {
60
- const e = t.exportOptions, r = a(t.chart, e.image);
61
- r && c(r, e.image).then((o) => i(o, e.fileName + ".png"));
62
- };
63
- export {
64
- d as ExportEvent,
65
- f as PreventableEvent,
66
- v as handleImageExport,
67
- x as handlePDFExport,
68
- g as handleSVGExport,
69
- u as resolveExportOptions
70
- };