vue-data-ui 2.3.3 → 2.3.5

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 (154) hide show
  1. package/README.md +19 -15
  2. package/dist/Arrow-BSOdhAJO.cjs +1 -0
  3. package/dist/Arrow-BjDVSrfA.js +101 -0
  4. package/dist/BaseIcon-BoKtpbrI.cjs +1 -0
  5. package/dist/BaseIcon-vmmfWlyR.js +174 -0
  6. package/dist/DataTable-CaB7GIwQ.js +127 -0
  7. package/dist/DataTable-ssrNbONo.cjs +1 -0
  8. package/dist/Legend-DHpoRTAE.js +62 -0
  9. package/dist/Legend-Dl5IYoxK.cjs +1 -0
  10. package/dist/Shape-CQT4S7N-.js +107 -0
  11. package/dist/Shape-CaF4pvOn.cjs +1 -0
  12. package/dist/Slicer-Bdb1BlrC.js +156 -0
  13. package/dist/Slicer-QC8nTm24.cjs +1 -0
  14. package/dist/Title-BNPZwnkp.js +46 -0
  15. package/dist/Title-Cj_xubjI.cjs +1 -0
  16. package/dist/Tooltip-CdJ5hegk.cjs +1 -0
  17. package/dist/Tooltip-ZnJAz6dl.js +94 -0
  18. package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
  19. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  20. package/dist/documentation/installation.md +14 -13
  21. package/dist/html2canvas.esm-BA_v9SIU.cjs +22 -0
  22. package/dist/html2canvas.esm-d2sM-0Wm.js +4870 -0
  23. package/dist/index-BMCvLyab.js +10369 -0
  24. package/dist/index-BkomIE9L.cjs +4 -0
  25. package/dist/{index.es-ypwniJN8.js → index.es-YufTdp0y.js} +1 -1
  26. package/dist/{index.es-Dnua3tHc.cjs → index.es-uyeSCnWE.cjs} +1 -1
  27. package/dist/jspdf.es.min-C660YX78.js +8038 -0
  28. package/dist/jspdf.es.min-DLYY9DTT.cjs +243 -0
  29. package/dist/pdf-97UbtKC2.js +44 -0
  30. package/dist/pdf-Cz3729tZ.cjs +1 -0
  31. package/dist/style.css +1 -1
  32. package/dist/types/vue-data-ui.d.cts +105 -5
  33. package/dist/types/vue-data-ui.d.ts +105 -5
  34. package/dist/useNestedProp-BMxXyPbW.cjs +1 -0
  35. package/dist/useNestedProp-CkP8xhG_.js +13 -0
  36. package/dist/usePrinter-BuuBz5JR.js +513 -0
  37. package/dist/usePrinter-r6uHYEcR.cjs +1 -0
  38. package/dist/useResponsive-B3TrDDIG.cjs +1 -0
  39. package/dist/useResponsive-NZB-WLRF.js +187 -0
  40. package/dist/vue-data-ui-Bc5U1cOP.cjs +9 -0
  41. package/dist/vue-data-ui-DxeO0iaC.js +254 -0
  42. package/dist/vue-data-ui.cjs +1 -1
  43. package/dist/vue-data-ui.js +61 -59
  44. package/dist/vue-ui-3d-bar-32wM0tiX.js +1085 -0
  45. package/dist/vue-ui-3d-bar-CgB0fLQT.cjs +19 -0
  46. package/dist/vue-ui-accordion-CLlVxx3Q.js +77 -0
  47. package/dist/vue-ui-accordion-SXsobrUt.cjs +1 -0
  48. package/dist/vue-ui-age-pyramid-D_CY99xF.js +596 -0
  49. package/dist/vue-ui-age-pyramid-DqiwcOIr.cjs +1 -0
  50. package/dist/vue-ui-annotator-DvP-IxDm.js +2177 -0
  51. package/dist/vue-ui-annotator-mntqd3q_.cjs +371 -0
  52. package/dist/vue-ui-candlestick-C-5u3i-1.js +657 -0
  53. package/dist/vue-ui-candlestick-C_TvUQvH.cjs +2 -0
  54. package/dist/vue-ui-carousel-table-BCePqkuz.cjs +1 -0
  55. package/dist/vue-ui-carousel-table-CAqhsLVx.js +304 -0
  56. package/dist/vue-ui-chestnut-DhWlw2MD.cjs +6 -0
  57. package/dist/vue-ui-chestnut-DylSfYMB.js +1051 -0
  58. package/dist/vue-ui-cursor-B04HJQVl.cjs +1 -0
  59. package/dist/vue-ui-cursor-DTYEMgbU.js +229 -0
  60. package/dist/vue-ui-dashboard-Bd0-cmSZ.js +232 -0
  61. package/dist/vue-ui-dashboard-DFIYwP1s.cjs +1 -0
  62. package/dist/vue-ui-digits-CW5qNMIk.js +153 -0
  63. package/dist/vue-ui-digits-Ced5mBJZ.cjs +1 -0
  64. package/dist/vue-ui-donut-DIhhgvWp.cjs +1 -0
  65. package/dist/vue-ui-donut-EeVmrVJs.js +743 -0
  66. package/dist/vue-ui-donut-evolution-BN08Y2hy.js +799 -0
  67. package/dist/vue-ui-donut-evolution-Ct6KAzs-.cjs +1 -0
  68. package/dist/vue-ui-dumbbell-BMlxS1Nq.js +624 -0
  69. package/dist/vue-ui-dumbbell-pextarqH.cjs +9 -0
  70. package/dist/vue-ui-flow-BXVsbmyb.cjs +1 -0
  71. package/dist/vue-ui-flow-CHmkgfyb.js +454 -0
  72. package/dist/vue-ui-galaxy-D4xyd-J1.cjs +1 -0
  73. package/dist/vue-ui-galaxy-kiVOZOBz.js +485 -0
  74. package/dist/vue-ui-gauge-BcO-z97J.js +466 -0
  75. package/dist/vue-ui-gauge-DPFBsbFj.cjs +1 -0
  76. package/dist/vue-ui-heatmap-DBOKYaJz.cjs +1 -0
  77. package/dist/vue-ui-heatmap-DD-Bzddj.js +598 -0
  78. package/dist/vue-ui-kpi-BEgf5yDv.cjs +1 -0
  79. package/dist/vue-ui-kpi-BS0o7zb9.js +54 -0
  80. package/dist/vue-ui-mini-loader-Bm5EJxtG.cjs +1 -0
  81. package/dist/vue-ui-mini-loader-DJEvG6ju.js +131 -0
  82. package/dist/vue-ui-molecule-DdwnFEBJ.js +750 -0
  83. package/dist/vue-ui-molecule-DzUqcaxd.cjs +1 -0
  84. package/dist/vue-ui-mood-radar-B9Gczs_Z.js +548 -0
  85. package/dist/vue-ui-mood-radar-DbB7m4Ku.cjs +1 -0
  86. package/dist/vue-ui-nested-donuts-BSINf8hd.cjs +16 -0
  87. package/dist/vue-ui-nested-donuts-CVQ1CaXo.js +771 -0
  88. package/dist/vue-ui-onion-D3-6Tv4u.cjs +1 -0
  89. package/dist/vue-ui-onion-Ut75t7hB.js +554 -0
  90. package/dist/vue-ui-parallel-coordinate-plot-Bjo09ZTX.js +651 -0
  91. package/dist/vue-ui-parallel-coordinate-plot-CJGkoIgN.cjs +8 -0
  92. package/dist/vue-ui-quadrant-CzCvejGn.cjs +1 -0
  93. package/dist/vue-ui-quadrant-Du9PKvlO.js +1178 -0
  94. package/dist/vue-ui-quick-chart-BsxsPbjz.cjs +13 -0
  95. package/dist/vue-ui-quick-chart-u0cPmD3q.js +1310 -0
  96. package/dist/vue-ui-radar-CBrpuE5r.js +614 -0
  97. package/dist/vue-ui-radar-DIpCrj1h.cjs +1 -0
  98. package/dist/vue-ui-rating-CaeGGlCw.js +271 -0
  99. package/dist/vue-ui-rating-D8fJC8Yt.cjs +1 -0
  100. package/dist/vue-ui-relation-circle-5DNf880s.js +304 -0
  101. package/dist/vue-ui-relation-circle-Ky3nPk6S.cjs +1 -0
  102. package/dist/vue-ui-rings-CffZ4T2S.cjs +1 -0
  103. package/dist/vue-ui-rings-IE3IdNRF.js +510 -0
  104. package/dist/vue-ui-scatter-C4GCZm0V.js +874 -0
  105. package/dist/vue-ui-scatter-TsX5dW9l.cjs +1 -0
  106. package/dist/vue-ui-screenshot-Bl3oooKI.js +160 -0
  107. package/dist/vue-ui-screenshot-Bzpg6yof.cjs +3 -0
  108. package/dist/vue-ui-skeleton-BisWX1sO.js +2064 -0
  109. package/dist/vue-ui-skeleton-JmGp11-u.cjs +41 -0
  110. package/dist/vue-ui-smiley-BhSrt9f-.cjs +2 -0
  111. package/dist/vue-ui-smiley-Sth2pqG1.js +763 -0
  112. package/dist/vue-ui-spark-trend-C8NSz4l8.cjs +1 -0
  113. package/dist/vue-ui-spark-trend-DAqO0TW2.js +246 -0
  114. package/dist/vue-ui-sparkbar-B0zX7NU7.js +242 -0
  115. package/dist/vue-ui-sparkbar-hL1Q6ObK.cjs +1 -0
  116. package/dist/vue-ui-sparkgauge-CWR8zJnU.js +157 -0
  117. package/dist/vue-ui-sparkgauge-tbVqaLCK.cjs +1 -0
  118. package/dist/vue-ui-sparkhistogram-Dv-lml4g.cjs +1 -0
  119. package/dist/vue-ui-sparkhistogram-DxqCtDpw.js +244 -0
  120. package/dist/vue-ui-sparkline-B6pvaBY_.cjs +1 -0
  121. package/dist/vue-ui-sparkline-BpL1jn7F.js +333 -0
  122. package/dist/vue-ui-sparkstackbar-BzbuBNIV.js +244 -0
  123. package/dist/vue-ui-sparkstackbar-CQ2TEi4p.cjs +1 -0
  124. package/dist/vue-ui-strip-plot-DCC6F4VM.cjs +1 -0
  125. package/dist/vue-ui-strip-plot-DCcbD6UE.js +618 -0
  126. package/dist/vue-ui-table-CFqIWfxl.js +1430 -0
  127. package/dist/vue-ui-table-CseaFWgX.cjs +14 -0
  128. package/dist/vue-ui-table-heatmap-Bwut-V1D.cjs +1 -0
  129. package/dist/vue-ui-table-heatmap-Bz8KYDxr.js +237 -0
  130. package/dist/vue-ui-table-sparkline-CJBU3y8-.cjs +1 -0
  131. package/dist/vue-ui-table-sparkline-z29ND2lq.js +420 -0
  132. package/dist/vue-ui-thermometer-BNAITzJa.js +385 -0
  133. package/dist/vue-ui-thermometer-DM2IKhqN.cjs +1 -0
  134. package/dist/vue-ui-timer-DLfXuW8T.cjs +64 -0
  135. package/dist/vue-ui-timer-DV6lQVHU.js +453 -0
  136. package/dist/vue-ui-tiremarks-B1bd1jPf.cjs +1 -0
  137. package/dist/vue-ui-tiremarks-WyQPg7yo.js +249 -0
  138. package/dist/vue-ui-treemap-BZGmoDHb.cjs +1 -0
  139. package/dist/vue-ui-treemap-DKmBhzV-.js +722 -0
  140. package/dist/vue-ui-vertical-bar-Bi-0rRN3.cjs +4 -0
  141. package/dist/vue-ui-vertical-bar-C-ySfrhJ.js +737 -0
  142. package/dist/vue-ui-waffle-CGRWu-da.js +638 -0
  143. package/dist/vue-ui-waffle-VLYkR-YZ.cjs +1 -0
  144. package/dist/vue-ui-wheel-D2q5vy5V.cjs +1 -0
  145. package/dist/vue-ui-wheel-Pj9OPk9f.js +227 -0
  146. package/dist/vue-ui-word-cloud-8Vr-jo1p.js +346 -0
  147. package/dist/vue-ui-word-cloud-Ba4BjatU.cjs +1 -0
  148. package/dist/vue-ui-xy-C4QW5Lfl.cjs +3 -0
  149. package/dist/vue-ui-xy-canvas-Be-Da_0x.cjs +9 -0
  150. package/dist/vue-ui-xy-canvas-DnLWrf0e.js +1006 -0
  151. package/dist/vue-ui-xy-qToggEfh.js +2064 -0
  152. package/package.json +1 -1
  153. package/dist/index-BcMihqI4.cjs +0 -843
  154. package/dist/index-C7FeCQ7K.js +0 -57303
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BkomIE9L.cjs"),F=require("./useResponsive-B3TrDDIG.cjs"),Z=require("./Title-Cj_xubjI.cjs"),D=require("./usePrinter-r6uHYEcR.cjs"),J=require("./DataTable-ssrNbONo.cjs"),K=require("./vue-ui-skeleton-JmGp11-u.cjs"),Q=require("./Legend-Dl5IYoxK.cjs"),ee=require("./vue-ui-accordion-SXsobrUt.cjs"),M=require("./useNestedProp-BMxXyPbW.cjs"),te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le=["id"],ae=["xmlns","viewBox"],oe={key:0},re=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],se={key:1},ne=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ue=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ce={key:2},ie=["x","y","font-size","fill","font-weight"],de=["x","y","font-size","fill"],ve={key:3},he=["x","y","font-size","fill","font-weight"],ye=["id"],me=["stop-color"],be=["stop-color"],fe=["stop-color"],ge=["id"],pe=["stop-color"],ke=["stop-color"],xe=["stop-color"],_e=["id"],Ce=["stop-color"],we=["stop-color"],Be=["id"],Ne=["stop-color"],Ee=["stop-color"],Le={key:0},$e=["d","fill"],Ve={key:1},Se=["x","y","height","width","fill"],ze=["cx","cy","r","fill","stroke","stroke-width"],Xe=["cx","cy","r","fill","stroke","stroke-width"],Ae={key:2},Te=["x","y","fill","font-size"],Pe={key:3},Fe=["x","y","fill","font-size"],De=["xmlns","height","width"],Me=["fill"],Ge=["innerHTML"],Ie={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(G,{expose:I,emit:He}){const y=G,{vue_ui_dumbbell:O}=s.useConfig(),f=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),i=e.ref(s.createUid()),L=e.ref(0),p=e.ref(null),$=e.ref(null),V=e.ref(null),t=e.computed(()=>{const a=M.useNestedProp({userConfig:y.config,defaultConfig:O});return a.theme?{...M.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}),k=e.ref(null);e.onMounted(()=>{if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiDumbbell",type:"dataset"}):y.dataset.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","start","end"]}).forEach(l=>{f.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=F.throttle(()=>{const{width:n,height:l}=F.useResponsive({chart:p.value,title:t.value.style.chart.title.text?$.value:null,legend:t.value.style.chart.legend.show?V.value:null});_.value=n,d.value=l/y.dataset.length,v.value=C()});k.value=new ResizeObserver(a),k.value.observe(p.value.parentNode)}}),e.onBeforeUnmount(()=>{k.value&&k.value.disconnect()});const{isPrinting:H,isImaging:q,generatePdf:S,generateImage:z}=D.usePrinter({elementId:`dumbbell_${i.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),x=e.ref({showTable:t.value.table.show}),m=e.computed(()=>y.dataset.map((a,n)=>({...a,id:s.createUid()}))),N=e.computed(()=>({max:Math.max(...m.value.flatMap(a=>[a.start,a.end])),min:Math.min(...m.value.flatMap(a=>[a.start,a.end]))})),u=e.computed(()=>s.calculateNiceScale(N.value.min<0?N.value.min:0,N.value.max,t.value.style.chart.grid.scaleSteps)),d=e.ref(t.value.style.chart.rowHeight),_=e.ref(t.value.style.chart.width),o=e.computed(()=>{const a=d.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+_.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,r=u.value.ticks.length*(_.value/u.value.ticks.length);return{left:t.value.style.chart.padding.left,right:n-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,bottom:l-t.value.style.chart.padding.bottom,width:_.value,height:a*y.dataset.length,rowHeight:a,absoluteHeight:l,absoluteWidth:n,widthPlotReference:r}});function C(){return m.value.map((a,n)=>{const l=o.value.left+(a.start+Math.abs(u.value.min))/(u.value.max+Math.abs(u.value.min))*o.value.widthPlotReference,r=o.value.left+(a.end+Math.abs(u.value.min))/(u.value.max+Math.abs(u.value.min))*o.value.widthPlotReference,c=l+(r-l)/2;return{...a,startX:l,endX:r,centerX:c,y:o.value.top+n*d.value+d.value/2,endVal:a.start}})}const v=e.ref([]),X=e.ref(null),W=e.computed(()=>m.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{v.value=C();let a=v.value.map(l=>l.start).reduce((l,r)=>l+r,0);function n(){const l=m.value.map(r=>r.end-r.start);a>=W.value?(cancelAnimationFrame(X.value),v.value=C()):(v.value=v.value.map((r,c)=>{r.endVal+=l[c]*(t.value.animationSpeed/100);const h=o.value.left+(r.start+Math.abs(u.value.min))/(u.value.max+Math.abs(u.value.min))*o.value.widthPlotReference,B=o.value.left+(r.endVal+Math.abs(u.value.min))/(u.value.max+Math.abs(u.value.min))*o.value.widthPlotReference,E=h+(B-h)/2;return{...r,startX:h,endX:B,centerX:E,y:o.value.top+c*d.value+d.value/2,endVal:r.endVal}}),a=v.value.map(r=>r.endVal).reduce((r,c)=>r+c,0),X.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()});const A=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${i.value})`:t.value.style.chart.plots.startColor},{name:t.value.style.chart.legend.labelEnd,color:t.value.style.chart.plots.gradient.show?`url(#end_grad_${i.value})`:t.value.style.chart.plots.endColor}]),R=e.computed(()=>({cy:"donut-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,paddingTop:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),b=e.computed(()=>{const a=v.value.map(l=>({name:l.name})),n=v.value.map(l=>({start:l.start,end:l.end}));return{head:a,body:n}}),w=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],n=b.value.head.map((c,h)=>{const B=s.dataLabel({p:t.value.style.chart.labels.prefix,v:b.value.body[h].start,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),E=s.dataLabel({p:t.value.style.chart.labels.prefix,v:b.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),Y=s.dataLabel({v:100*(b.value.body[h].end/b.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:c.name},B,E,Y]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],head:a,body:n,config:l}});function T(){e.nextTick(()=>{const a=b.value.head.map((r,c)=>[[r.name],[b.value.body[c].start],[b.value.body[c].end]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.start],[t.value.table.columnNames.end]]].concat(a),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-dumbbell"})})}const g=e.ref(!1);function U(a){g.value=a,L.value+=1}function j(){return v.value}function P(){x.value.showTable=!x.value.showTable}return I({getData:j,generatePdf:S,generateCsv:T,generateImage:z,toggleTable:P}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:p,class:e.normalizeClass(`vue-ui-dumbbell ${g.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`dumbbell_${i.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:$,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(Z._sfc_main,{config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(D.UserOptions,{ref:"details",key:`user_option_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(H),isImaging:e.unref(q),uid:i.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:p.value,onToggleFullscreen:U,onGeneratePdf:e.unref(S),onGenerateCsv:T,onGenerateImage:e.unref(z),onToggleTable:P},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${o.value.absoluteWidth<=0?10:o.value.absoluteWidth} ${o.value.absoluteHeight<=0?10:o.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left+r*o.value.width/(u.value.ticks.length-1),x2:o.value.left+r*o.value.width/(u.value.ticks.length-1),y1:o.value.top,y2:o.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray},null,8,re))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left,x2:o.value.right,y1:o.value.top+r*d.value,y2:o.value.top+r*d.value,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,ne))),256)),e.createElementVNode("line",{x1:o.value.left,x2:o.value.right,y1:o.value.bottom,y2:o.value.bottom,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,ue)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*d.value+(t.value.style.chart.labels.yAxisLabels.showProgression?d.value/3:d.value/2)+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"font-weight":t.value.style.chart.labels.yAxisLabels.bold?"bold":"normal","text-anchor":"end"},e.toDisplayString(l.name),9,ie))),256)),t.value.style.chart.labels.yAxisLabels.showProgression?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*d.value+d.value/1.3+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(s.dataLabel)({v:100*(l.end/l.start-1),s:"%",r:t.value.style.chart.labels.yAxisLabels.rounding})),9,de))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left+r*(o.value.width/(u.value.ticks.length-1)),y:o.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"font-weight":t.value.style.chart.labels.xAxisLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:l,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.xAxisLabels.rounding})),9,he))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${i.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.startColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,me),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,be),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,fe)],8,ye),e.createElementVNode("radialGradient",{id:`end_grad_${i.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.endColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,pe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,ke),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,xe)],8,ge)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`grad_positive_${i.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,we)],8,_e),e.createElementVNode("linearGradient",{id:`grad_negative_${i.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ee)],8,Be)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Le,[e.createElementVNode("path",{d:`M
2
+ ${l.startX},${l.y+t.value.style.chart.plots.radius/2}
3
+ C ${l.centerX},${l.y} ${l.centerX},${l.y}
4
+ ${l.endX},${l.y+t.value.style.chart.plots.radius/2}
5
+ L ${l.endX},${l.y-t.value.style.chart.plots.radius/2}
6
+ C ${l.centerX},${l.y} ${l.centerX},${l.y}
7
+ ${l.startX},${l.y-t.value.style.chart.plots.radius/2}
8
+ Z
9
+ `,fill:l.endX>l.startX?`url(#grad_positive_${i.value})`:`url(#grad_negative_${i.value})`},null,8,$e)])):(e.openBlock(),e.createElementBlock("g",Ve,[e.createElementVNode("rect",{x:l.endX>l.startX?l.startX:l.endX,y:l.y-t.value.style.chart.plots.link.strokeWidth/2,height:t.value.style.chart.plots.link.strokeWidth,width:Math.abs(l.endX-l.startX),fill:l.endX>l.startX?`url(#grad_positive_${i.value})`:`url(#grad_negative_${i.value})`},null,8,Se)])),e.createElementVNode("circle",{cx:l.startX,cy:l.y,r:t.value.style.chart.plots.radius,fill:t.value.style.chart.plots.gradient.show?`url(#start_grad_${i.value})`:t.value.style.chart.plots.startColor,stroke:t.value.style.chart.plots.stroke,"stroke-width":t.value.style.chart.plots.strokeWidth},null,8,ze),e.createElementVNode("circle",{cx:l.endX,cy:l.y,r:t.value.style.chart.plots.radius,fill:t.value.style.chart.plots.gradient.show?`url(#end_grad_${i.value})`:t.value.style.chart.plots.endColor,stroke:t.value.style.chart.plots.stroke,"stroke-width":t.value.style.chart.plots.strokeWidth},null,8,Xe),t.value.style.chart.labels.startLabels.show?(e.openBlock(),e.createElementBlock("g",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(c,h)=>(e.openBlock(),e.createElementBlock("text",{x:c.startX,y:o.value.top+(h+1)*d.value-t.value.style.chart.labels.startLabels.fontSize/3+t.value.style.chart.labels.startLabels.offsetY,fill:t.value.style.chart.labels.startLabels.useStartColor?t.value.style.chart.plots.startColor:t.value.style.chart.labels.startLabels.color,"font-size":t.value.style.chart.labels.startLabels.fontSize,"text-anchor":"middle"},e.toDisplayString(e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:c.start,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.startLabels.rounding})),9,Te))),256))])):e.createCommentVNode("",!0),t.value.style.chart.labels.endLabels.show?(e.openBlock(),e.createElementBlock("g",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(c,h)=>(e.openBlock(),e.createElementBlock("text",{x:c.endX,y:o.value.top+h*d.value+t.value.style.chart.labels.endLabels.fontSize+t.value.style.chart.labels.endLabels.offsetY,fill:t.value.style.chart.labels.endLabels.useEndColor?t.value.style.chart.plots.endColor:t.value.style.chart.labels.endLabels.color,"font-size":t.value.style.chart.labels.endLabels.fontSize,"text-anchor":"middle"},e.toDisplayString(e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:c.end,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.endLabels.rounding})),9,Fe))),256))])):e.createCommentVNode("",!0)]))),256)),e.renderSlot(a.$slots,"svg",{svg:o.value},void 0,!0)],14,ae)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(K.default,{key:3,config:{type:"dumbbell",style:{backgroundColor:t.value.style.chart.backgroundColor,dumbbell:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:V},[t.value.style.chart.legend.show&&f.value?(e.openBlock(),e.createBlock(Q.Legend,{key:0,legendSet:A.value,config:R.value},{item:e.withCtx(({legend:l})=>[e.createElementVNode("div",{style:e.normalizeStyle(`display:flex;align-items:center;gap:4px;font-size:${t.value.style.chart.legend.fontSize}px`)},[(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:"0 0 20 20",height:t.value.style.chart.legend.fontSize,width:t.value.style.chart.legend.fontSize},[e.createElementVNode("circle",{cx:10,cy:10,r:9,fill:l.color},null,8,Me)],8,De)),e.createTextVNode(" "+e.toDisplayString(l.name),1)],4)]),_:1},8,["legendSet","config"])):e.renderSlot(a.$slots,"legend",{key:1,legend:A.value},void 0,!0)],512),f.value?(e.openBlock(),e.createBlock(ee.default,{key:4,hideDetails:"",config:{open:x.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(J.DataTable,{colNames:w.value.colNames,head:w.value.head,body:w.value.body,config:w.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:n[0]||(n[0]=l=>x.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Ge)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,le))}},Oe=te._export_sfc(Ie,[["__scopeId","data-v-576f289b"]]);exports.default=Oe;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-BkomIE9L.cjs"),ue=require("./Title-Cj_xubjI.cjs"),U=require("./usePrinter-r6uHYEcR.cjs"),ie=require("./DataTable-ssrNbONo.cjs"),ce=require("./vue-ui-accordion-SXsobrUt.cjs"),de=require("./vue-ui-skeleton-JmGp11-u.cjs"),j=require("./useNestedProp-BMxXyPbW.cjs"),ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],he=["xmlns","viewBox"],me=["id"],ge=["stop-color"],pe=["stop-color"],ye=["d","fill","stroke","stroke-width"],be=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],ke=["x","y","font-size","fill"],we=["x","y","font-size","fill"],Ce=["innerHTML"],xe={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(A,{expose:W}){const f=A,{vue_ui_flow:X}=i.useConfig(),$=e.computed(()=>!!f.dataset&&f.dataset.length);e.onMounted(()=>{i.objectIsEmpty(f.dataset)&&i.error({componentName:"VueUiFlow",type:"dataset"})});const B=e.ref(i.createUid()),T=e.ref(null),P=e.ref(0),b=e.ref(!1);function R(n){b.value=n,P.value+=1}const t=e.computed(()=>{const n=j.useNestedProp({userConfig:f.config,defaultConfig:X});return n.theme?{...j.useNestedProp({userConfig:i.themes.vue_ui_flow[n.theme]||f.config,defaultConfig:n}),customPalette:i.themePalettes[n.theme]||i.palette}:n}),{isPrinting:Z,isImaging:J,generatePdf:F,generateImage:L}=U.usePrinter({elementId:`flow_${B.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),N=e.computed(()=>i.convertCustomPalette(t.value.customPalette)),z=e.computed(()=>t.value.style.chart.nodes.gap),p=e.computed(()=>t.value.style.chart.nodes.width),k=e.ref({showTable:t.value.table.show}),I=e.computed(()=>t.value.style.chart.links.width),H=e.computed(()=>{const n={};function o(r){n[r]||(n[r]={inflow:0,outflow:0})}f.dataset.forEach(([r,a,c])=>{o(r),o(a),n[r].outflow+=c,n[a].inflow+=c});let l=0;for(const r in n){const a=Math.max(n[r].inflow,n[r].outflow);l=Math.max(l,a)}return l});function K(n){return n/H.value*100+t.value.style.chart.nodes.minHeight}function Q(n){const o=t.value.style.chart.nodes.minHeight;return(n-o)/100*H.value}function ee(n){const o={},l={};function r(s,u){o[s]||(o[s]={height:0,level:null,inflow:0,outflow:0}),o[s].level===null&&(o[s].level=u),l[u]||(l[u]=[]),l[u].includes(s)||l[u].push(s)}n.forEach(([s,u,v],y)=>{const g=o[s]?o[s].level:0,x=g+1;r(s,g),r(u,x),o[s].children||(o[s].children=[]),o[s].children.push({target:u,value:v}),o[s].outflow+=v,o[u].inflow+=v}),Object.keys(o).forEach((s,u)=>{o[s].color=N.value[u]||N.value[u%N.value.length]||i.palette[u]||i.palette[u%d.length]});for(const s in o)o[s].height=K(Math.max(o[s].inflow,o[s].outflow)),o[s].name=s;const a={};for(const s in l){let u=0;l[s].forEach((v,y)=>{const g=o[v].height;a[v]={x:parseInt(s,10)*I.value+t.value.style.chart.padding.left,y:u,absoluteY:u,height:g,i:y,color:o[v].color,value:Q(g)},u+=g+z.value})}const c=[];for(const s in o){let u=a[s].absoluteY;o[s].children&&o[s].children.forEach(({target:v,value:y},g)=>{const x=a[v].y,E=a[s],S=a[v],Y=u,D=u+y/o[s].outflow*E.height,q=x,G=x+y/o[v].inflow*S.height,re={id:i.createUid(),source:s,target:v,path:`M ${E.x+p.value} ${Y} L ${E.x+p.value} ${D} L ${S.x} ${G} L ${S.x} ${q} Z`,value:y,sourceColor:o[s].color,targetColor:o[v].color};c.push(re),u+=D-Y,a[v].y+=G-q})}return{nodeCoordinates:a,links:c}}const h=e.computed(()=>{const n=ee(f.dataset);return{nodes:Object.keys(n.nodeCoordinates).map((o,l)=>({...n.nodeCoordinates[o],name:o})),links:n.links}}),te=e.computed(()=>le(h.value.nodes));function le(n){const o={};for(const r in n){const{x:a,height:c}=n[r];o[a]||(o[a]=0),o[a]+=c+z.value}return Math.max(...Object.values(o))}const _=e.computed(()=>{const{top:n,right:o,left:l,bottom:r}=t.value.style.chart.padding,a=f.dataset.length*I.value;return{height:te.value+n+r,width:o+Math.max(...h.value.nodes.map(c=>c.x))+p.value,left:l,top:n,right:a-o,p_top:n,p_bottom:r}});function oe(n){const o={},l={},r=new Set;return f.dataset.forEach(([a,c,s])=>{o[a]||(o[a]=[]),l[c]||(l[c]=[]),o[a].push(c),l[c].push(a)}),o[n]&&o[n].forEach(a=>r.add(a)),l[n]&&l[n].forEach(a=>r.add(a)),Array.from(r).concat(n)}const m=e.ref(null),w=e.ref(null);function ne(n){m.value=oe(n.name),w.value=n.name}function ae(){m.value=null,w.value=null}const O=e.computed(()=>h.value.links.map(({source:n,target:o,sourceColor:l,targetColor:r,value:a})=>({source:n,target:o,sourceColor:l,targetColor:r,value:a})));function M(){e.nextTick(()=>{const n=O.value.map((r,a)=>[[r.source],[r.target],[r.value]]),o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.source],[t.value.table.columnNames.target],[t.value.table.columnNames.value]]].concat(n),l=i.createCsvContent(o);i.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const C=e.computed(()=>{const n=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],o=O.value.map((a,c)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},i.dataLabel({p:t.value.style.chart.nodes.labels.prefix,v:a.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:n,body:o,config:l}});function se(){return h.value}function V(){k.value.showTable=!k.value.showTable}return W({getData:se,generateCsv:M,generateImage:L,generatePdf:F,toggleTable:V}),(n,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:T,class:e.normalizeClass(`vue-ui-flow ${b.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`flow_${B.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(ue._sfc_main,{config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref:"details",key:`user_option_${P.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Z),isImaging:e.unref(J),uid:B.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,titles:{...t.value.userOptions.buttonTitles},chartElement:T.value,onToggleFullscreen:R,onGeneratePdf:e.unref(F),onGenerateCsv:M,onGenerateImage:e.unref(L),onToggleTable:V},e.createSlots({_:2},[n.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,n.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,n.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,n.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(n.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,n.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(n.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(i.XMLNS),viewBox:`0 0 ${_.value.width} ${_.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.links,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:l.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":l.sourceColor},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":l.targetColor},null,8,pe)],8,me))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.links,l=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:l.path,fill:`url(#${l.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${w.value?[l.target,l.source].includes(w.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,ye))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:l.x,y:l.absoluteY,height:l.height,width:p.value,fill:l.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>ne(l),onMouseleave:o[0]||(o[0]=a=>ae()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(l.name)?1:.2:1}`)},null,44,be))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+p.value/2,y:l.absoluteY+l.height/2-t.value.style.chart.nodes.labels.fontSize/4,"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(i.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(i.abbreviate)({source:l.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):l.name),13,ke))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+p.value/2,y:l.absoluteY+l.height/2+t.value.style.chart.nodes.labels.fontSize,"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(i.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(e.unref(i.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:l.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})),13,we))),256)),e.renderSlot(n.$slots,"svg",{svg:_.value},void 0,!0)],14,he)),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(de.default,{key:2,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),$.value?(e.openBlock(),e.createBlock(ce.default,{key:3,hideDetails:"",config:{open:k.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ie.DataTable,{colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:o[1]||(o[1]=l=>k.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Ce)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,fe))}},$e=ve._export_sfc(xe,[["__scopeId","data-v-f8a1c2bf"]]);exports.default=$e;
@@ -0,0 +1,454 @@
1
+ import { computed as f, onMounted as _e, ref as k, openBlock as r, createElementBlock as v, normalizeClass as oe, normalizeStyle as w, createVNode as ae, createCommentVNode as L, createBlock as G, unref as g, createSlots as Ne, withCtx as b, renderSlot as $, normalizeProps as Te, guardReactiveProps as Pe, createElementVNode as E, Fragment as N, renderList as T, toDisplayString as B, createTextVNode as Fe, nextTick as Ie } from "vue";
2
+ import { u as He, o as Le, e as Ee, c as ne, t as Oe, a as Me, p as A, b as Se, f as se, X as ze, C as ue, E as Ye, n as De, q as Ge } from "./index-BMCvLyab.js";
3
+ import { _ as Be } from "./Title-BNPZwnkp.js";
4
+ import { u as Ae, U as Ue } from "./usePrinter-BuuBz5JR.js";
5
+ import { D as Ve } from "./DataTable-CaB7GIwQ.js";
6
+ import je from "./vue-ui-accordion-CLlVxx3Q.js";
7
+ import Xe from "./vue-ui-skeleton-BisWX1sO.js";
8
+ import { u as re } from "./useNestedProp-CkP8xhG_.js";
9
+ import { _ as We } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
+ const qe = ["id"], Re = ["xmlns", "viewBox"], Ze = ["id"], Je = ["stop-color"], Ke = ["stop-color"], Qe = ["d", "fill", "stroke", "stroke-width"], et = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "onMouseenter"], tt = ["x", "y", "font-size", "fill"], lt = ["x", "y", "font-size", "fill"], ot = ["innerHTML"], at = {
11
+ __name: "vue-ui-flow",
12
+ props: {
13
+ config: {
14
+ type: Object,
15
+ default() {
16
+ return {};
17
+ }
18
+ },
19
+ dataset: {
20
+ type: Array,
21
+ default() {
22
+ return [];
23
+ }
24
+ }
25
+ },
26
+ setup(ie, { expose: ce }) {
27
+ const h = ie, { vue_ui_flow: de } = He(), O = f(() => !!h.dataset && h.dataset.length);
28
+ _e(() => {
29
+ Le(h.dataset) && Ee({
30
+ componentName: "VueUiFlow",
31
+ type: "dataset"
32
+ });
33
+ });
34
+ const M = k(ne()), U = k(null), V = k(0), _ = k(!1);
35
+ function ve(o) {
36
+ _.value = o, V.value += 1;
37
+ }
38
+ const e = f(() => {
39
+ const o = re({
40
+ userConfig: h.config,
41
+ defaultConfig: de
42
+ });
43
+ return o.theme ? {
44
+ ...re({
45
+ userConfig: Oe.vue_ui_flow[o.theme] || h.config,
46
+ defaultConfig: o
47
+ }),
48
+ customPalette: Me[o.theme] || A
49
+ } : o;
50
+ }), { isPrinting: fe, isImaging: he, generatePdf: j, generateImage: X } = Ae({
51
+ elementId: `flow_${M.value}`,
52
+ fileName: e.value.style.chart.title.text || "vue-ui-flow"
53
+ }), S = f(() => Se(e.value.customPalette)), W = f(() => e.value.style.chart.nodes.gap), C = f(() => e.value.style.chart.nodes.width), P = k({
54
+ showTable: e.value.table.show
55
+ }), q = f(() => e.value.style.chart.links.width), R = f(() => {
56
+ const o = {};
57
+ function l(s) {
58
+ o[s] || (o[s] = { inflow: 0, outflow: 0 });
59
+ }
60
+ h.dataset.forEach(([s, a, i]) => {
61
+ l(s), l(a), o[s].outflow += i, o[a].inflow += i;
62
+ });
63
+ let t = 0;
64
+ for (const s in o) {
65
+ const a = Math.max(o[s].inflow, o[s].outflow);
66
+ t = Math.max(t, a);
67
+ }
68
+ return t;
69
+ });
70
+ function me(o) {
71
+ return o / R.value * 100 + e.value.style.chart.nodes.minHeight;
72
+ }
73
+ function ge(o) {
74
+ const l = e.value.style.chart.nodes.minHeight;
75
+ return (o - l) / 100 * R.value;
76
+ }
77
+ function pe(o) {
78
+ const l = {}, t = {};
79
+ function s(n, u) {
80
+ l[n] || (l[n] = { height: 0, level: null, inflow: 0, outflow: 0 }), l[n].level === null && (l[n].level = u), t[u] || (t[u] = []), t[u].includes(n) || t[u].push(n);
81
+ }
82
+ o.forEach(([n, u, c], x) => {
83
+ const y = l[n] ? l[n].level : 0, H = y + 1;
84
+ s(n, y), s(u, H), l[n].children || (l[n].children = []), l[n].children.push({ target: u, value: c }), l[n].outflow += c, l[u].inflow += c;
85
+ }), Object.keys(l).forEach((n, u) => {
86
+ l[n].color = S.value[u] || S.value[u % S.value.length] || A[u] || A[u % d.length];
87
+ });
88
+ for (const n in l)
89
+ l[n].height = me(Math.max(l[n].inflow, l[n].outflow)), l[n].name = n;
90
+ const a = {};
91
+ for (const n in t) {
92
+ let u = 0;
93
+ t[n].forEach((c, x) => {
94
+ const y = l[c].height;
95
+ a[c] = {
96
+ x: parseInt(n, 10) * q.value + e.value.style.chart.padding.left,
97
+ y: u,
98
+ absoluteY: u,
99
+ height: y,
100
+ i: x,
101
+ color: l[c].color,
102
+ value: ge(y)
103
+ }, u += y + W.value;
104
+ });
105
+ }
106
+ const i = [];
107
+ for (const n in l) {
108
+ let u = a[n].absoluteY;
109
+ l[n].children && l[n].children.forEach(({ target: c, value: x }, y) => {
110
+ const H = a[c].y, Y = a[n], D = a[c], Q = u, ee = u + x / l[n].outflow * Y.height, te = H, le = H + x / l[c].inflow * D.height, $e = {
111
+ id: ne(),
112
+ source: n,
113
+ target: c,
114
+ path: `M ${Y.x + C.value} ${Q} L ${Y.x + C.value} ${ee} L ${D.x} ${le} L ${D.x} ${te} Z`,
115
+ value: x,
116
+ sourceColor: l[n].color,
117
+ targetColor: l[c].color
118
+ };
119
+ i.push($e), u += ee - Q, a[c].y += le - te;
120
+ });
121
+ }
122
+ return { nodeCoordinates: a, links: i };
123
+ }
124
+ const m = f(() => {
125
+ const o = pe(h.dataset);
126
+ return {
127
+ nodes: Object.keys(o.nodeCoordinates).map((l, t) => ({
128
+ ...o.nodeCoordinates[l],
129
+ name: l
130
+ })),
131
+ links: o.links
132
+ };
133
+ }), be = f(() => ye(m.value.nodes));
134
+ function ye(o) {
135
+ const l = {};
136
+ for (const s in o) {
137
+ const { x: a, height: i } = o[s];
138
+ l[a] || (l[a] = 0), l[a] += i + W.value;
139
+ }
140
+ return Math.max(...Object.values(l));
141
+ }
142
+ const z = f(() => {
143
+ const { top: o, right: l, left: t, bottom: s } = e.value.style.chart.padding, a = h.dataset.length * q.value;
144
+ return {
145
+ height: be.value + o + s,
146
+ width: l + Math.max(...m.value.nodes.map((i) => i.x)) + C.value,
147
+ left: t,
148
+ top: o,
149
+ right: a - l,
150
+ p_top: o,
151
+ p_bottom: s
152
+ };
153
+ });
154
+ function ke(o) {
155
+ const l = {}, t = {}, s = /* @__PURE__ */ new Set();
156
+ return h.dataset.forEach(([a, i, n]) => {
157
+ l[a] || (l[a] = []), t[i] || (t[i] = []), l[a].push(i), t[i].push(a);
158
+ }), l[o] && l[o].forEach((a) => s.add(a)), t[o] && t[o].forEach((a) => s.add(a)), Array.from(s).concat(o);
159
+ }
160
+ const p = k(null), F = k(null);
161
+ function we(o) {
162
+ p.value = ke(o.name), F.value = o.name;
163
+ }
164
+ function Ce() {
165
+ p.value = null, F.value = null;
166
+ }
167
+ const Z = f(() => m.value.links.map(({ source: o, target: l, sourceColor: t, targetColor: s, value: a }) => ({
168
+ source: o,
169
+ target: l,
170
+ sourceColor: t,
171
+ targetColor: s,
172
+ value: a
173
+ })));
174
+ function J() {
175
+ Ie(() => {
176
+ const o = Z.value.map((s, a) => [
177
+ [s.source],
178
+ [s.target],
179
+ [s.value]
180
+ ]), l = [
181
+ [e.value.style.chart.title.text],
182
+ [e.value.style.chart.title.subtitle.text],
183
+ [
184
+ [e.value.table.columnNames.source],
185
+ [e.value.table.columnNames.target],
186
+ [e.value.table.columnNames.value]
187
+ ]
188
+ ].concat(o), t = De(l);
189
+ Ge({
190
+ csvContent: t,
191
+ title: e.value.style.chart.title.text || "vue-ui-flow"
192
+ });
193
+ });
194
+ }
195
+ const I = f(() => {
196
+ const o = [
197
+ e.value.table.columnNames.source,
198
+ e.value.table.columnNames.target,
199
+ e.value.table.columnNames.value
200
+ ], l = Z.value.map((a, i) => [
201
+ {
202
+ color: a.sourceColor,
203
+ name: a.source
204
+ },
205
+ {
206
+ color: a.targetColor,
207
+ name: a.target
208
+ },
209
+ se({
210
+ p: e.value.style.chart.nodes.labels.prefix,
211
+ v: a.value,
212
+ s: e.value.style.chart.nodes.labels.suffix,
213
+ r: e.value.style.chart.nodes.labels.rounding
214
+ })
215
+ ]), t = {
216
+ th: {
217
+ backgroundColor: e.value.table.th.backgroundColor,
218
+ color: e.value.table.th.color,
219
+ outline: e.value.table.th.outline
220
+ },
221
+ td: {
222
+ backgroundColor: e.value.table.td.backgroundColor,
223
+ color: e.value.table.td.color,
224
+ outline: e.value.table.td.outline
225
+ },
226
+ breakpoint: e.value.table.responsiveBreakpoint
227
+ };
228
+ return {
229
+ colNames: [
230
+ e.value.table.columnNames.source,
231
+ e.value.table.columnNames.target,
232
+ e.value.table.columnNames.value
233
+ ],
234
+ head: o,
235
+ body: l,
236
+ config: t
237
+ };
238
+ });
239
+ function xe() {
240
+ return m.value;
241
+ }
242
+ function K() {
243
+ P.value.showTable = !P.value.showTable;
244
+ }
245
+ return ce({
246
+ getData: xe,
247
+ generateCsv: J,
248
+ generateImage: X,
249
+ generatePdf: j,
250
+ toggleTable: K
251
+ }), (o, l) => (r(), v("div", {
252
+ ref_key: "flowChart",
253
+ ref: U,
254
+ class: oe(`vue-ui-flow ${_.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
255
+ style: w(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;${e.value.style.chart.title.text ? "" : "padding-top:36px"};background:${e.value.style.chart.backgroundColor}`),
256
+ id: `flow_${M.value}`
257
+ }, [
258
+ e.value.style.chart.title.text ? (r(), v("div", {
259
+ key: 0,
260
+ style: w(`width:100%;background:${e.value.style.chart.backgroundColor};padding-bottom:24px`)
261
+ }, [
262
+ ae(Be, {
263
+ config: {
264
+ title: {
265
+ cy: "flow-title",
266
+ ...e.value.style.chart.title
267
+ },
268
+ subtitle: {
269
+ cy: "flow-subtitle",
270
+ ...e.value.style.chart.title.subtitle
271
+ }
272
+ }
273
+ }, null, 8, ["config"])
274
+ ], 4)) : L("", !0),
275
+ e.value.userOptions.show && O.value ? (r(), G(Ue, {
276
+ ref: "details",
277
+ key: `user_option_${V.value}`,
278
+ backgroundColor: e.value.style.chart.backgroundColor,
279
+ color: e.value.style.chart.color,
280
+ isPrinting: g(fe),
281
+ isImaging: g(he),
282
+ uid: M.value,
283
+ hasPdf: e.value.userOptions.buttons.pdf,
284
+ hasXls: e.value.userOptions.buttons.csv,
285
+ hasImg: e.value.userOptions.buttons.img,
286
+ hasTable: e.value.userOptions.buttons.table,
287
+ hasFullscreen: e.value.userOptions.buttons.fullscreen,
288
+ isFullscreen: _.value,
289
+ titles: { ...e.value.userOptions.buttonTitles },
290
+ chartElement: U.value,
291
+ onToggleFullscreen: ve,
292
+ onGeneratePdf: g(j),
293
+ onGenerateCsv: J,
294
+ onGenerateImage: g(X),
295
+ onToggleTable: K
296
+ }, Ne({ _: 2 }, [
297
+ o.$slots.optionPdf ? {
298
+ name: "optionPdf",
299
+ fn: b(() => [
300
+ $(o.$slots, "optionPdf", {}, void 0, !0)
301
+ ]),
302
+ key: "0"
303
+ } : void 0,
304
+ o.$slots.optionCsv ? {
305
+ name: "optionCsv",
306
+ fn: b(() => [
307
+ $(o.$slots, "optionCsv", {}, void 0, !0)
308
+ ]),
309
+ key: "1"
310
+ } : void 0,
311
+ o.$slots.optionImg ? {
312
+ name: "optionImg",
313
+ fn: b(() => [
314
+ $(o.$slots, "optionImg", {}, void 0, !0)
315
+ ]),
316
+ key: "2"
317
+ } : void 0,
318
+ o.$slots.optionTable ? {
319
+ name: "optionTable",
320
+ fn: b(() => [
321
+ $(o.$slots, "optionTable", {}, void 0, !0)
322
+ ]),
323
+ key: "3"
324
+ } : void 0,
325
+ o.$slots.optionFullscreen ? {
326
+ name: "optionFullscreen",
327
+ fn: b(({ toggleFullscreen: t, isFullscreen: s }) => [
328
+ $(o.$slots, "optionFullscreen", Te(Pe({ toggleFullscreen: t, isFullscreen: s })), void 0, !0)
329
+ ]),
330
+ key: "4"
331
+ } : void 0
332
+ ]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "titles", "chartElement", "onGeneratePdf", "onGenerateImage"])) : L("", !0),
333
+ (r(), v("svg", {
334
+ xmlns: g(ze),
335
+ viewBox: `0 0 ${z.value.width} ${z.value.height}`,
336
+ class: oe({ "vue-data-ui-fullscreen--on": _.value, "vue-data-ui-fulscreen--off": !_.value }),
337
+ style: w(`max-width:100%; overflow: visible; background:${e.value.style.chart.backgroundColor};color:${e.value.style.chart.color}`)
338
+ }, [
339
+ E("defs", null, [
340
+ (r(!0), v(N, null, T(m.value.links, (t, s) => (r(), v("linearGradient", {
341
+ id: t.id,
342
+ x1: "0%",
343
+ y1: "0%",
344
+ x2: "100%",
345
+ y2: "0%"
346
+ }, [
347
+ E("stop", {
348
+ offset: "0%",
349
+ "stop-color": t.sourceColor
350
+ }, null, 8, Je),
351
+ E("stop", {
352
+ offset: "100%",
353
+ "stop-color": t.targetColor
354
+ }, null, 8, Ke)
355
+ ], 8, Ze))), 256))
356
+ ]),
357
+ (r(!0), v(N, null, T(m.value.links, (t) => (r(), v("path", {
358
+ class: "vue-ui-flow-link",
359
+ d: t.path,
360
+ fill: `url(#${t.id})`,
361
+ stroke: e.value.style.chart.links.stroke,
362
+ "stroke-width": e.value.style.chart.links.strokeWidth,
363
+ style: w(`opacity:${F.value ? [t.target, t.source].includes(F.value) ? 1 : 0.3 : e.value.style.chart.links.opacity}`)
364
+ }, null, 12, Qe))), 256)),
365
+ (r(!0), v(N, null, T(m.value.nodes, (t, s) => (r(), v("rect", {
366
+ class: "vue-ui-flow-node",
367
+ x: t.x,
368
+ y: t.absoluteY,
369
+ height: t.height,
370
+ width: C.value,
371
+ fill: t.color,
372
+ stroke: e.value.style.chart.nodes.stroke,
373
+ "stroke-width": e.value.style.chart.nodes.strokeWidth,
374
+ onMouseenter: (a) => we(t),
375
+ onMouseleave: l[0] || (l[0] = (a) => Ce()),
376
+ style: w(`opacity:${p.value ? p.value.includes(t.name) ? 1 : 0.2 : 1}`)
377
+ }, null, 44, et))), 256)),
378
+ (r(!0), v(N, null, T(m.value.nodes, (t, s) => (r(), v("text", {
379
+ x: t.x + C.value / 2,
380
+ y: t.absoluteY + t.height / 2 - e.value.style.chart.nodes.labels.fontSize / 4,
381
+ "font-size": e.value.style.chart.nodes.labels.fontSize,
382
+ fill: g(ue)(t.color),
383
+ "text-anchor": "middle",
384
+ style: w(`pointer-events: none; opacity:${p.value ? p.value.includes(t.name) ? 1 : 0 : 1}`)
385
+ }, B(e.value.style.chart.nodes.labels.abbreviation.use ? g(Ye)({ source: t.name, length: e.value.style.chart.nodes.labels.abbreviation.length }) : t.name), 13, tt))), 256)),
386
+ (r(!0), v(N, null, T(m.value.nodes, (t, s) => (r(), v("text", {
387
+ x: t.x + C.value / 2,
388
+ y: t.absoluteY + t.height / 2 + e.value.style.chart.nodes.labels.fontSize,
389
+ "font-size": e.value.style.chart.nodes.labels.fontSize,
390
+ fill: g(ue)(t.color),
391
+ "text-anchor": "middle",
392
+ style: w(`pointer-events: none; opacity:${p.value ? p.value.includes(t.name) ? 1 : 0 : 1}`)
393
+ }, B(g(se)({
394
+ p: e.value.style.chart.nodes.labels.prefix,
395
+ v: t.value,
396
+ s: e.value.style.chart.nodes.labels.suffix,
397
+ r: e.value.style.chart.nodes.labels.rounding
398
+ })), 13, lt))), 256)),
399
+ $(o.$slots, "svg", { svg: z.value }, void 0, !0)
400
+ ], 14, Re)),
401
+ O.value ? L("", !0) : (r(), G(Xe, {
402
+ key: 2,
403
+ config: {
404
+ type: "flow",
405
+ style: {
406
+ backgroundColor: e.value.style.chart.backgroundColor
407
+ }
408
+ }
409
+ }, null, 8, ["config"])),
410
+ O.value ? (r(), G(je, {
411
+ key: 3,
412
+ hideDetails: "",
413
+ config: {
414
+ open: P.value.showTable,
415
+ maxHeight: 1e4,
416
+ body: {
417
+ backgroundColor: e.value.style.chart.backgroundColor,
418
+ color: e.value.style.chart.color
419
+ },
420
+ head: {
421
+ backgroundColor: e.value.style.chart.backgroundColor,
422
+ color: e.value.style.chart.color
423
+ }
424
+ }
425
+ }, {
426
+ content: b(() => [
427
+ ae(Ve, {
428
+ colNames: I.value.colNames,
429
+ head: I.value.head,
430
+ body: I.value.body,
431
+ config: I.value.config,
432
+ title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
433
+ onClose: l[1] || (l[1] = (t) => P.value.showTable = !1)
434
+ }, {
435
+ th: b(({ th: t }) => [
436
+ E("div", {
437
+ innerHTML: t,
438
+ style: { display: "flex", "align-items": "center" }
439
+ }, null, 8, ot)
440
+ ]),
441
+ td: b(({ td: t }) => [
442
+ Fe(B(t.name || t), 1)
443
+ ]),
444
+ _: 1
445
+ }, 8, ["colNames", "head", "body", "config", "title"])
446
+ ]),
447
+ _: 1
448
+ }, 8, ["config"])) : L("", !0)
449
+ ], 14, qe));
450
+ }
451
+ }, ht = /* @__PURE__ */ We(at, [["__scopeId", "data-v-f8a1c2bf"]]);
452
+ export {
453
+ ht as default
454
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BkomIE9L.cjs"),K=require("./Legend-Dl5IYoxK.cjs"),Q=require("./Title-Cj_xubjI.cjs"),Z=require("./Tooltip-CdJ5hegk.cjs"),ee=require("./DataTable-ssrNbONo.cjs"),O=require("./usePrinter-r6uHYEcR.cjs"),te=require("./vue-ui-skeleton-JmGp11-u.cjs"),le=require("./vue-ui-accordion-SXsobrUt.cjs"),z=require("./useNestedProp-BMxXyPbW.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ae=["id"],re=["xmlns","viewBox"],ne=["id"],ue=["stdDeviation"],se=["d","stroke","stroke-width"],ie=["d","stroke","stroke-width"],ce=["filter"],de=["d","stroke","stroke-width"],ve=["d","stroke-width","onMouseenter","onClick"],he=["onClick"],pe={key:0},ge={key:1},ye=["innerHTML"],fe={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(D,{expose:q,emit:B}){const d=D,{vue_ui_galaxy:G}=r.useConfig(),b=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(()=>{r.objectIsEmpty(d.dataset)?r.error({componentName:"VueUiGalaxy",type:"dataset"}):d.dataset.forEach((l,a)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{r.error({componentName:"VueUiGalaxy",type:"datasetSerieAttribute",property:o,index:a})})})});const y=e.ref(r.createUid()),C=e.ref(null),M=e.ref(null),x=e.ref(!1),w=e.ref(""),i=e.ref(null),S=e.ref(0),t=e.computed(()=>{const l=z.useNestedProp({userConfig:d.config,defaultConfig:G});return l.theme?{...z.useNestedProp({userConfig:r.themes.vue_ui_galaxy[l.theme]||d.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}),{isPrinting:W,isImaging:U,generatePdf:_,generateImage:P}=O.usePrinter({elementId:`galaxy_${y.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),A=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),v=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),$=e.ref({height:180,width:250}),s=e.ref([]);function T(l){s.value.includes(l.id)?s.value=s.value.filter(a=>a!==l.id):s.value.push(l.id),B("selectLegend",f.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const p=e.computed(()=>d.dataset.map((l,a)=>({name:l.name,color:r.convertColorToHex(l.color)||A.value[a]||r.palette[a]||r.palette[a%r.palette.length],value:l.values?l.values.reduce((o,n)=>o+n,0):0,absoluteValues:l.values||[0],id:r.createUid(),seriesIndex:a})).sort((l,a)=>a.value-l.value));function H(){return p.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const c=e.computed(()=>p.value.filter(l=>!s.value.includes(l.id)).map(l=>l.value).reduce((l,a)=>l+a,0)),R=e.ref(190),E=e.computed(()=>p.value.filter(l=>!s.value.includes(l.id))),f=e.computed(()=>{const l=[];for(let a=0;a<E.value.length;a+=1){const o=E.value[a];let n=o.value/c.value*R.value;a>0&&l.length&&(n+=l[a-1].points),l.push({points:n,...o,seriesIndex:a,proportion:o.value/c.value,path:r.createSpiralPath({points:n,startX:115+t.value.style.chart.layout.arcs.offsetX,startY:90+t.value.style.chart.layout.arcs.offsetY})})}return l.filter((a,o)=>!s.value.includes(a.id)).toSorted((a,o)=>o.points-a.points)}),m=e.ref(!1);function X(l){m.value=l,S.value+=1}const N=e.ref(null);function j({datapoint:l,_relativeIndex:a,seriesIndex:o,show:n=!1}){N.value={datapoint:l,seriesIndex:o,series:p.value,config:t.value},x.value=n,i.value=l.id;let u="";const g=t.value.style.chart.tooltip.customFormat;r.isFunction(g)&&r.functionReturnsString(()=>g({seriesIndex:o,datapoint:l,series:p.value,config:t.value}))?w.value=g({seriesIndex:o,datapoint:l,series:p.value,config:t.value}):(u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?u+=`<span>(${(l.proportion*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%)</span></div>`:u+=`<b>${(l.proportion*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%</b></div>`),w.value=`<div>${u}</div>`)}const V=e.computed(()=>p.value.map((l,a)=>({...l,proportion:(l.value||0)/d.dataset.map(o=>(o.values||[]).reduce((n,u)=>n+u,0)).reduce((o,n)=>o+n,0),opacity:s.value.includes(l.id)?.5:1,shape:l.shape||"circle",segregate:()=>T(l),isSegregated:s.value.includes(l.id)}))),Y=e.computed(()=>({cy:"galaxy-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),h=e.computed(()=>{const l=f.value.map(o=>({name:o.name,color:o.color})),a=f.value.map(o=>o.value);return{head:l,body:a}});function F(){e.nextTick(()=>{const l=h.value.head.map((n,u)=>[[n.name],[h.value.body[u]],[isNaN(h.value.body[u]/c.value)?"-":h.value.body[u]/c.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-galaxy"})})}const k=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:c.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=h.value.head.map((u,g)=>{const J=r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:h.value.body[g],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},J,isNaN(h.value.body[g]/c.value)?"-":(h.value.body[g]/c.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:l,body:a,config:o}});function L(){v.value.showTable=!v.value.showTable}function I(){v.value.showTooltip=!v.value.showTooltip}return q({getData:H,generatePdf:_,generateCsv:F,generateImage:P,toggleTable:L,toggleTooltip:I}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"galaxyChart",ref:C,class:e.normalizeClass(`vue-ui-galaxy ${m.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`galaxy_${y.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(Q._sfc_main,{config:{title:{cy:"galaxy-div-title",...t.value.style.chart.title},subtitle:{cy:"galaxy-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(O.UserOptions,{ref_key:"details",ref:M,key:`user_option_${S.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(W),isImaging:e.unref(U),uid:y.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:v.value.showTooltip,isFullscreen:m.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,onToggleFullscreen:X,onGeneratePdf:e.unref(_),onGenerateCsv:F,onGenerateImage:e.unref(P),onToggleTable:L,onToggleTooltip:I},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":m.value,"vue-data-ui-fulscreen--off":!m.value}),viewBox:`0 0 ${$.value.width} ${$.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${y.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.arcs.gradient.intensity},null,8,ue)],8,ne)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,o=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:t.value.style.chart.backgroundColor,"stroke-width":(t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth)*(i.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round"},null,8,se)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:o.path,fill:"none",stroke:o.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth*(i.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`${i.value&&i.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,ie)):e.createCommentVNode("",!0),o.value&&t.value.style.chart.layout.arcs.gradient.show?(e.openBlock(),e.createElementBlock("g",{key:2,filter:`url(#blur_${y.value})`},[e.createElementVNode("path",{d:o.path,fill:"none",stroke:t.value.style.chart.layout.arcs.gradient.color,"stroke-width":t.value.style.chart.layout.arcs.strokeWidth/2*(i.value===o.id&&t.value.style.chart.layout.arcs.hoverEffect.show?t.value.style.chart.layout.arcs.hoverEffect.multiplicator:1),"stroke-linecap":"round",class:e.normalizeClass(`vue-ui-galaxy-gradient ${i.value&&i.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,de)],8,ce)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[o.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:o.path,fill:"none",stroke:"transparent","stroke-width":t.value.style.chart.layout.arcs.strokeWidth+t.value.style.chart.layout.arcs.borderWidth,"stroke-linecap":"round",onMouseenter:u=>j({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=u=>{x.value=!1,i.value=null}),onClick:u=>B("selectDatapoint",o)},null,40,ve)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:$.value},void 0,!0)],14,re)):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(te.default,{key:3,config:{type:"galaxy",style:{backgroundColor:t.value.style.chart.backgroundColor,galaxy:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(K.Legend,{key:4,legendSet:V.value,config:Y.value,onClickMarker:a[1]||(a[1]=({legend:o})=>T(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:u=>T(o),style:e.normalizeStyle(`opacity:${s.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}))+" ",1),s.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",ge," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",pe," ("+e.toDisplayString(isNaN(o.value/c.value)?"-":(o.value/c.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,he)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:V.value},void 0,!0),e.createVNode(Z._sfc_main,{show:v.value.showTooltip&&x.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,parent:C.value,content:w.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...N.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...N.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","parent","content","isCustom"]),b.value?(e.openBlock(),e.createBlock(le.default,{key:5,hideDetails:"",config:{open:v.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ee.DataTable,{colNames:k.value.colNames,head:k.value.head,body:k.value.body,config:k.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=o=>v.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,ye)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ae))}},me=oe._export_sfc(fe,[["__scopeId","data-v-53c416de"]]);exports.default=me;