vue-data-ui 2.3.97 → 2.3.98

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 (143) hide show
  1. package/dist/{Arrow-CD-z6ya0.cjs → Arrow-BLDzSVI-.cjs} +1 -1
  2. package/dist/{Arrow-BAg5kQhG.js → Arrow-DgyN_Z51.js} +1 -1
  3. package/dist/{BaseIcon-JWYc0t9a.cjs → BaseIcon-BriP3G7r.cjs} +1 -1
  4. package/dist/{BaseIcon-CiQsJmEc.js → BaseIcon-CdxkWcA_.js} +1 -1
  5. package/dist/{DataTable-BczvA492.js → DataTable-CFtLoh2y.js} +2 -2
  6. package/dist/{DataTable-DRJUrEXP.cjs → DataTable-DT8VcwR5.cjs} +1 -1
  7. package/dist/{Legend-DDmBZxt8.cjs → Legend-BiaVNQjc.cjs} +1 -1
  8. package/dist/{Legend-DnOc-JGW.js → Legend-DlZZeU8Y.js} +1 -1
  9. package/dist/{PackageVersion-DN8qp-uI.js → PackageVersion-B2pJ6f4s.js} +1 -1
  10. package/dist/{PackageVersion-rOhPenOY.cjs → PackageVersion-DMkpXFFU.cjs} +1 -1
  11. package/dist/{Shape-CDDjN4N-.cjs → Shape-CLCzNUYM.cjs} +1 -1
  12. package/dist/{Shape-DhRVUsKe.js → Shape-CbyenPbK.js} +1 -1
  13. package/dist/{Slicer-B7JFT6tT.js → Slicer-C2ocGjgt.js} +2 -2
  14. package/dist/{Slicer-IdC3VhM9.cjs → Slicer-CCE1xFS8.cjs} +1 -1
  15. package/dist/{Title-0tYDaWv7.js → Title-DqYX5EDQ.js} +1 -1
  16. package/dist/{Title-Cjusozo5.cjs → Title-spYln43E.cjs} +1 -1
  17. package/dist/{Tooltip-DdWGiVyf.js → Tooltip-7I8a4mo2.js} +1 -1
  18. package/dist/{Tooltip-CkqTs_wn.cjs → Tooltip-BgkDlGZj.cjs} +1 -1
  19. package/dist/{index-BJNSbAx7.js → index-CHn5mpNE.js} +731 -709
  20. package/dist/{index-NvxTr0fZ.cjs → index-xtIm3ydy.cjs} +8 -8
  21. package/dist/style.css +1 -1
  22. package/dist/{useNestedProp-CLh4tPxT.js → useNestedProp-BF5raFbY.js} +1 -1
  23. package/dist/{useNestedProp-DhLxBAwX.cjs → useNestedProp-XzXFHriE.cjs} +1 -1
  24. package/dist/{usePrinter-0s8wVGIy.cjs → usePrinter-BrE53tUa.cjs} +1 -1
  25. package/dist/{usePrinter-CkV5eORP.js → usePrinter-DNwJl64i.js} +1 -1
  26. package/dist/{vue-data-ui-CyOAruHW.js → vue-data-ui-D74akyv3.js} +57 -57
  27. package/dist/{vue-data-ui-OR4tWNiS.cjs → vue-data-ui-DyzsgRrE.cjs} +1 -1
  28. package/dist/vue-data-ui.cjs +1 -1
  29. package/dist/vue-data-ui.js +7 -7
  30. package/dist/{vue-ui-3d-bar-CxDdjFAw.js → vue-ui-3d-bar-CEIsvuEw.js} +8 -8
  31. package/dist/{vue-ui-3d-bar-DrnEff_D.cjs → vue-ui-3d-bar-DABkuo-g.cjs} +1 -1
  32. package/dist/{vue-ui-accordion-CxPjShWo.cjs → vue-ui-accordion-DDiQi7FV.cjs} +1 -1
  33. package/dist/{vue-ui-accordion-DDf5Y2GY.js → vue-ui-accordion-DXd5ND_A.js} +3 -3
  34. package/dist/{vue-ui-age-pyramid-BMjBTeyH.js → vue-ui-age-pyramid-Bk87h-18.js} +9 -9
  35. package/dist/{vue-ui-age-pyramid-BiHpf1Rk.cjs → vue-ui-age-pyramid-DgDByrGl.cjs} +1 -1
  36. package/dist/{vue-ui-annotator-B-myvrhe.js → vue-ui-annotator-B6velitp.js} +1 -1
  37. package/dist/{vue-ui-annotator--NmsTiIf.cjs → vue-ui-annotator-CC523zDg.cjs} +1 -1
  38. package/dist/{vue-ui-candlestick-J1JpFsJT.js → vue-ui-candlestick-BW7ajYg7.js} +10 -10
  39. package/dist/{vue-ui-candlestick-DSwIFt7i.cjs → vue-ui-candlestick-DbU_XaYN.cjs} +1 -1
  40. package/dist/{vue-ui-carousel-table-Cg3I81MW.cjs → vue-ui-carousel-table-23OR7otR.cjs} +1 -1
  41. package/dist/{vue-ui-carousel-table-B62mAFeV.js → vue-ui-carousel-table-C2GpkqxJ.js} +4 -4
  42. package/dist/{vue-ui-chestnut-ChAwKgeO.js → vue-ui-chestnut-s4sYE-Yq.js} +7 -7
  43. package/dist/{vue-ui-chestnut-lQvVg9Rn.cjs → vue-ui-chestnut-ynySog92.cjs} +1 -1
  44. package/dist/{vue-ui-cursor-XXjnAIH2.js → vue-ui-cursor-B3OZaotE.js} +2 -2
  45. package/dist/{vue-ui-cursor-D-qe8qez.cjs → vue-ui-cursor-C0JCZjSM.cjs} +1 -1
  46. package/dist/{vue-ui-dashboard-CC-DF6iU.js → vue-ui-dashboard-B8glPKoJ.js} +2 -2
  47. package/dist/{vue-ui-dashboard-CB41KQ7y.cjs → vue-ui-dashboard-Bn3v9JMP.cjs} +1 -1
  48. package/dist/{vue-ui-digits-Degwjx76.js → vue-ui-digits-BTw5A-9I.js} +2 -2
  49. package/dist/{vue-ui-digits-CIHkrLL6.cjs → vue-ui-digits-Bf3jPyKq.cjs} +1 -1
  50. package/dist/{vue-ui-donut-CYBpOCFo.js → vue-ui-donut-CMHiEbv5.js} +10 -10
  51. package/dist/{vue-ui-donut-evolution-Bxq-hr-P.js → vue-ui-donut-evolution-Cn-kZE-i.js} +10 -10
  52. package/dist/{vue-ui-donut-evolution-Bbt27unL.cjs → vue-ui-donut-evolution-DMM09v7x.cjs} +1 -1
  53. package/dist/{vue-ui-donut-jwD3vNoD.cjs → vue-ui-donut-yfNvdjlP.cjs} +1 -1
  54. package/dist/{vue-ui-dumbbell-7f9d2mh-.cjs → vue-ui-dumbbell-6liDM1Uq.cjs} +1 -1
  55. package/dist/{vue-ui-dumbbell-KsVxecua.js → vue-ui-dumbbell-BRgiYAXh.js} +9 -9
  56. package/dist/{vue-ui-flow-BzcB3iiZ.cjs → vue-ui-flow-B7wvK8sK.cjs} +1 -1
  57. package/dist/{vue-ui-flow-FqXhCo7u.js → vue-ui-flow-CkRBNjsz.js} +8 -8
  58. package/dist/{vue-ui-galaxy-xVldWSiq.cjs → vue-ui-galaxy-BuuC5iw-.cjs} +1 -1
  59. package/dist/{vue-ui-galaxy-B9rSYr7m.js → vue-ui-galaxy-C1I2rPqV.js} +10 -10
  60. package/dist/{vue-ui-gauge-k6fqkXqN.js → vue-ui-gauge-B0PNChvw.js} +6 -6
  61. package/dist/{vue-ui-gauge-B4r-qdzi.cjs → vue-ui-gauge-BvJ0qzq4.cjs} +1 -1
  62. package/dist/{vue-ui-gizmo-By3-mz_t.cjs → vue-ui-gizmo-C6G_WlP5.cjs} +1 -1
  63. package/dist/{vue-ui-gizmo-CYaThghf.js → vue-ui-gizmo-HvL1eMUO.js} +3 -3
  64. package/dist/{vue-ui-heatmap-B0w5CXLi.cjs → vue-ui-heatmap-5ALzyHu_.cjs} +1 -1
  65. package/dist/{vue-ui-heatmap-Bdffdnay.js → vue-ui-heatmap-CQXqbbaT.js} +9 -9
  66. package/dist/{vue-ui-kpi-BqN5GILt.cjs → vue-ui-kpi-5u25Gbfg.cjs} +1 -1
  67. package/dist/{vue-ui-kpi-DG8_lFYS.js → vue-ui-kpi-JIlZQFAC.js} +3 -3
  68. package/dist/{vue-ui-mini-loader-C-Na_wY7.cjs → vue-ui-mini-loader-DcJ58uSW.cjs} +1 -1
  69. package/dist/{vue-ui-mini-loader-BZS_gsWT.js → vue-ui-mini-loader-Dktn_fME.js} +2 -2
  70. package/dist/{vue-ui-molecule-BK6bSbRU.js → vue-ui-molecule-BSSNMC6m.js} +10 -10
  71. package/dist/{vue-ui-molecule-Cdg96qiI.cjs → vue-ui-molecule-Wefpekma.cjs} +1 -1
  72. package/dist/{vue-ui-mood-radar-D-BCyG9b.cjs → vue-ui-mood-radar-B7oYZs55.cjs} +1 -1
  73. package/dist/{vue-ui-mood-radar-D5GRHLEE.js → vue-ui-mood-radar-D4fVO5iO.js} +10 -10
  74. package/dist/{vue-ui-nested-donuts-mxJHstX4.js → vue-ui-nested-donuts-4_tabA8c.js} +10 -10
  75. package/dist/{vue-ui-nested-donuts-D1fD0b-H.cjs → vue-ui-nested-donuts-ClqZ-eJl.cjs} +1 -1
  76. package/dist/{vue-ui-onion-6mkIHe9R.js → vue-ui-onion-Ch6BgUFP.js} +10 -10
  77. package/dist/{vue-ui-onion-vKC5zZVM.cjs → vue-ui-onion-DQ9E4dGJ.cjs} +1 -1
  78. package/dist/{vue-ui-parallel-coordinate-plot-B_gGjFqe.js → vue-ui-parallel-coordinate-plot-BtZ1F37V.js} +11 -11
  79. package/dist/{vue-ui-parallel-coordinate-plot-DqbwxRdK.cjs → vue-ui-parallel-coordinate-plot-CeXmNMQ-.cjs} +1 -1
  80. package/dist/{vue-ui-quadrant-SEj9AJdW.js → vue-ui-quadrant-CGiq44Mt.js} +11 -11
  81. package/dist/{vue-ui-quadrant-C54oPX3B.cjs → vue-ui-quadrant-fhNZ5-B5.cjs} +1 -1
  82. package/dist/{vue-ui-quick-chart-CqmbqQdH.js → vue-ui-quick-chart-B-vFmpy5.js} +8 -8
  83. package/dist/{vue-ui-quick-chart-DoEE3OMA.cjs → vue-ui-quick-chart-DI4IPOIj.cjs} +1 -1
  84. package/dist/{vue-ui-radar-Dr91p7eK.cjs → vue-ui-radar-B80HMKEf.cjs} +1 -1
  85. package/dist/{vue-ui-radar-CKjssi06.js → vue-ui-radar-DWzxx466.js} +11 -11
  86. package/dist/{vue-ui-rating-DQvO4ejI.cjs → vue-ui-rating-BOGhqulq.cjs} +1 -1
  87. package/dist/{vue-ui-rating-DUSE6rvR.js → vue-ui-rating-CPuKzB4x.js} +2 -2
  88. package/dist/{vue-ui-relation-circle-D089YHBB.cjs → vue-ui-relation-circle-DNaNyiIv.cjs} +1 -1
  89. package/dist/{vue-ui-relation-circle-BmijKEEN.js → vue-ui-relation-circle-dUlg-_QI.js} +6 -6
  90. package/dist/{vue-ui-rings-D237PxGP.cjs → vue-ui-rings-C_z0XK6f.cjs} +1 -1
  91. package/dist/{vue-ui-rings-BtzbZYTW.js → vue-ui-rings-CqFaPqaR.js} +10 -10
  92. package/dist/{vue-ui-scatter-BeKQhHUw.js → vue-ui-scatter-Bsfc6z4K.js} +147 -147
  93. package/dist/vue-ui-scatter-DFiICBjw.cjs +1 -0
  94. package/dist/{vue-ui-screenshot-DNuimpRf.js → vue-ui-screenshot-CXptYbDY.js} +1 -1
  95. package/dist/{vue-ui-screenshot-CnwCy_Kg.cjs → vue-ui-screenshot-uE34c5Im.cjs} +1 -1
  96. package/dist/{vue-ui-skeleton-CsU74BI7.js → vue-ui-skeleton-BmPO8QNa.js} +3 -3
  97. package/dist/{vue-ui-skeleton-DYHqPo98.cjs → vue-ui-skeleton-g8cEqYmt.cjs} +1 -1
  98. package/dist/{vue-ui-smiley-d0tQ2o9w.js → vue-ui-smiley-ByBzn20M.js} +2 -2
  99. package/dist/{vue-ui-smiley-D150KQ7d.cjs → vue-ui-smiley-DQEb9ejw.cjs} +1 -1
  100. package/dist/{vue-ui-spark-trend-BDibnFmx.cjs → vue-ui-spark-trend-BXiiilKK.cjs} +1 -1
  101. package/dist/{vue-ui-spark-trend-CtZdqmLI.js → vue-ui-spark-trend-DYfjqLKr.js} +18 -18
  102. package/dist/{vue-ui-sparkbar-BpFs4ZhV.cjs → vue-ui-sparkbar-BCqmWJWk.cjs} +1 -1
  103. package/dist/{vue-ui-sparkbar-C-HlLkKi.js → vue-ui-sparkbar-D37uDtG6.js} +4 -4
  104. package/dist/{vue-ui-sparkgauge-BHBI7l12.cjs → vue-ui-sparkgauge-Dp4bJ89f.cjs} +1 -1
  105. package/dist/{vue-ui-sparkgauge-BDRCFVP5.js → vue-ui-sparkgauge-f1tYOMwd.js} +4 -4
  106. package/dist/{vue-ui-sparkhistogram-B5nNXynh.js → vue-ui-sparkhistogram-DHYJG6d0.js} +5 -5
  107. package/dist/{vue-ui-sparkhistogram-BjWnqdfo.cjs → vue-ui-sparkhistogram-Gh_h9QK_.cjs} +1 -1
  108. package/dist/{vue-ui-sparkline-o3mpXRV-.js → vue-ui-sparkline-CENc9bgs.js} +4 -4
  109. package/dist/{vue-ui-sparkline-DpnhvlTf.cjs → vue-ui-sparkline-CkPExlPm.cjs} +1 -1
  110. package/dist/{vue-ui-sparkstackbar-Bko-XhdQ.js → vue-ui-sparkstackbar-BNUyfD4B.js} +4 -4
  111. package/dist/{vue-ui-sparkstackbar-CST5NcMP.cjs → vue-ui-sparkstackbar-WWR3yYii.cjs} +1 -1
  112. package/dist/{vue-ui-stackbar-Br1WGSyo.js → vue-ui-stackbar-BQC8Ca_b.js} +33 -33
  113. package/dist/{vue-ui-stackbar-B3nyr_3-.cjs → vue-ui-stackbar-CFIZ94i3.cjs} +1 -1
  114. package/dist/{vue-ui-strip-plot-DkAf9HPJ.cjs → vue-ui-strip-plot-BEyk6uih.cjs} +1 -1
  115. package/dist/{vue-ui-strip-plot-C7Q-J22i.js → vue-ui-strip-plot-OPkq7c7M.js} +10 -10
  116. package/dist/{vue-ui-table-1vOGIOAk.cjs → vue-ui-table-Btz8Txup.cjs} +1 -1
  117. package/dist/{vue-ui-table-BTXo44Nv.js → vue-ui-table-DQno4vjF.js} +16 -16
  118. package/dist/{vue-ui-table-heatmap-BNcfBY7T.cjs → vue-ui-table-heatmap-DAQ3DL1R.cjs} +1 -1
  119. package/dist/{vue-ui-table-heatmap-BosdMOLZ.js → vue-ui-table-heatmap-Dvl7B3i2.js} +15 -15
  120. package/dist/{vue-ui-table-sparkline-D0NjMfnV.js → vue-ui-table-sparkline-DJwhjePK.js} +16 -16
  121. package/dist/{vue-ui-table-sparkline-BGCEgn2A.cjs → vue-ui-table-sparkline-ZEGDkLve.cjs} +1 -1
  122. package/dist/{vue-ui-thermometer-CUBnp6lX.cjs → vue-ui-thermometer-DCP3GH7M.cjs} +1 -1
  123. package/dist/{vue-ui-thermometer-Bnn77E-v.js → vue-ui-thermometer-Dmi60VAf.js} +6 -6
  124. package/dist/{vue-ui-timer-JupC7c3X.js → vue-ui-timer-BffyRll5.js} +5 -5
  125. package/dist/{vue-ui-timer-D2WCDGWF.cjs → vue-ui-timer-BjlYd8dM.cjs} +1 -1
  126. package/dist/{vue-ui-tiremarks-FxWaEnUD.cjs → vue-ui-tiremarks-2RGbitnQ.cjs} +1 -1
  127. package/dist/{vue-ui-tiremarks-Db9JjYq5.js → vue-ui-tiremarks-GSBKzXEK.js} +6 -6
  128. package/dist/{vue-ui-treemap-DPD9rcYE.js → vue-ui-treemap-CuYV5RnC.js} +10 -10
  129. package/dist/{vue-ui-treemap-oplXghMz.cjs → vue-ui-treemap-D0wMLDpi.cjs} +1 -1
  130. package/dist/{vue-ui-vertical-bar-BrOR3Xkc.cjs → vue-ui-vertical-bar-CqH76_tw.cjs} +1 -1
  131. package/dist/{vue-ui-vertical-bar-DeUOAiy4.js → vue-ui-vertical-bar-n6-aILoL.js} +10 -10
  132. package/dist/{vue-ui-waffle-DGrZjGQR.cjs → vue-ui-waffle-CUw9wjum.cjs} +1 -1
  133. package/dist/{vue-ui-waffle-qvh8AKep.js → vue-ui-waffle-DN0nEorT.js} +10 -10
  134. package/dist/{vue-ui-wheel-CuEobbmN.cjs → vue-ui-wheel-bauD1n_w.cjs} +1 -1
  135. package/dist/{vue-ui-wheel-DmG03DhW.js → vue-ui-wheel-gFxj5brx.js} +6 -6
  136. package/dist/{vue-ui-word-cloud-Dg0WQKL1.js → vue-ui-word-cloud-BXCUAiAK.js} +26 -26
  137. package/dist/{vue-ui-word-cloud-CbnPyd1_.cjs → vue-ui-word-cloud-CzXCfW8Q.cjs} +1 -1
  138. package/dist/{vue-ui-xy-BBlRgHyb.js → vue-ui-xy-BbRzriSg.js} +272 -272
  139. package/dist/{vue-ui-xy-gHnKcmgZ.cjs → vue-ui-xy-CEfc7szr.cjs} +2 -2
  140. package/dist/{vue-ui-xy-canvas-CqyEve92.js → vue-ui-xy-canvas-Cw-F7w38.js} +34 -34
  141. package/dist/{vue-ui-xy-canvas-CzCS04yK.cjs → vue-ui-xy-canvas-DhHuhTxz.cjs} +1 -1
  142. package/package.json +1 -1
  143. package/dist/vue-ui-scatter-_bZ2lVMS.cjs +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-NvxTr0fZ.cjs"),R=require("./useResponsive-B3TrDDIG.cjs"),le=require("./Title-Cjusozo5.cjs"),W=require("./usePrinter-0s8wVGIy.cjs"),ae=require("./DataTable-DRJUrEXP.cjs"),oe=require("./vue-ui-skeleton-DYHqPo98.cjs"),re=require("./Legend-DDmBZxt8.cjs"),se=require("./vue-ui-accordion-CxPjShWo.cjs"),U=require("./useNestedProp-DhLxBAwX.cjs"),ne=require("./PackageVersion-rOhPenOY.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],ie=["xmlns","viewBox"],de={key:0},ve=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],he={key:1},ye=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],me=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],fe={key:2},be=["x","y","font-size","fill","font-weight"],ge=["x","y","font-size","fill"],pe={key:3},ke=["x","y","font-size","fill","font-weight"],_e=["id"],xe=["stop-color"],Ce=["stop-color"],we=["stop-color"],Be=["id"],Ne=["stop-color"],Ee=["stop-color"],Le=["stop-color"],$e=["id"],Ve=["stop-color"],Se=["stop-color"],ze=["id"],Xe=["stop-color"],Pe=["stop-color"],Ae={key:0},Te=["d","fill"],De={key:1},Fe=["x","y","height","width","fill"],Me=["cx","cy","r","fill","stroke","stroke-width"],Ge=["cx","cy","r","fill","stroke","stroke-width"],Ie={key:2},Oe=["x","y","fill","font-size"],He={key:3},qe=["x","y","fill","font-size"],Re={key:3,class:"vue-data-ui-watermark"},We=["xmlns","height","width"],Ue=["fill"],je=["innerHTML"],Ye={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(j,{expose:Y,emit:Je}){const y=j,{vue_ui_dumbbell:Z}=s.useConfig(),b=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),d=e.ref(s.createUid()),L=e.ref(0),k=e.ref(null),$=e.ref(null),V=e.ref(null),S=e.ref(0),z=e.ref(0),X=e.ref(0),t=e.computed({get:()=>P(),set:a=>a});function P(){const a=U.useNestedProp({userConfig:y.config,defaultConfig:Z});return a.theme?{...U.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}e.watch(()=>y.config,a=>{t.value=P(),A(),S.value+=1,z.value+=1,X.value+=1,i.value=t.value.style.chart.rowHeight,g.value=t.value.style.chart.width},{deep:!0}),e.watch(()=>y.dataset,a=>{I()},{deep:!0});const _=e.ref(null);e.onMounted(()=>{A()});function A(){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=>{b.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=R.throttle(()=>{const{width:n,height:l}=R.useResponsive({chart:k.value,title:t.value.style.chart.title.text?$.value:null,legend:t.value.style.chart.legend.show?V.value:null});g.value=n,i.value=l/y.dataset.length,v.value=C()});_.value=new ResizeObserver(a),_.value.observe(k.value.parentNode)}}e.onBeforeUnmount(()=>{_.value&&_.value.disconnect()});const{isPrinting:T,isImaging:D,generatePdf:F,generateImage:M}=W.usePrinter({elementId:`dumbbell_${d.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,start:s.checkNaN(a.start),end:s.checkNaN(a.end),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]))})),c=e.computed(()=>s.calculateNiceScale(N.value.min<0?N.value.min:0,N.value.max,t.value.style.chart.grid.scaleSteps)),i=e.ref(t.value.style.chart.rowHeight),g=e.ref(t.value.style.chart.width),o=e.computed(()=>{const a=i.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+g.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,r=c.value.ticks.length*(g.value/c.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:g.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(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,r=o.value.left+(a.end+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,u=l+(r-l)/2;return{...a,startX:l,endX:r,centerX:u,y:o.value.top+n*i.value+i.value/2,endVal:a.start}})}const v=e.ref([]),G=e.ref(null),J=e.computed(()=>m.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{I()});function I(){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>=J.value?(cancelAnimationFrame(G.value),v.value=C()):(v.value=v.value.map((r,u)=>{r.endVal+=l[u]*(t.value.animationSpeed/100);const h=o.value.left+(r.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,B=o.value.left+(r.endVal+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,E=h+(B-h)/2;return{...r,startX:h,endX:B,centerX:E,y:o.value.top+u*i.value+i.value/2,endVal:r.endVal}}),a=v.value.map(r=>r.endVal).reduce((r,u)=>r+u,0),G.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()}const O=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${d.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_${d.value})`:t.value.style.chart.plots.endColor}]),K=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":""})),f=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=f.value.head.map((u,h)=>{const B=s.dataLabel({p:t.value.style.chart.labels.prefix,v:f.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:f.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),te=s.dataLabel({v:100*(f.value.body[h].end/f.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:u.name},B,E,te]}),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 H(){e.nextTick(()=>{const a=f.value.head.map((r,u)=>[[r.name],[f.value.body[u].start],[f.value.body[u].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 p=e.ref(!1);function Q(a){p.value=a,L.value+=1}function ee(){return v.value}function q(){x.value.showTable=!x.value.showTable}return Y({getData:ee,generatePdf:F,generateCsv:H,generateImage:M,toggleTable:q}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:k,class:e.normalizeClass(`vue-ui-dumbbell ${p.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_${d.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:$,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(le._sfc_main,{key:`title_${S.value}`,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"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(W.UserOptions,{ref:"details",key:`user_option_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(T),isImaging:e.unref(D),uid:d.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:p.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,position:t.value.userOptions.position,onToggleFullscreen:Q,onGeneratePdf:e.unref(F),onGenerateCsv:H,onGenerateImage:e.unref(M),onToggleTable:q},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","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":p.value,"vue-data-ui-fulscreen--off":!p.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:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ne._sfc_main),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left+r*o.value.width/(c.value.ticks.length-1),x2:o.value.left+r*o.value.width/(c.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,ve))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",he,[(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*i.value,y2:o.value.top+r*i.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,ye))),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,me)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",fe,[(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*i.value+(t.value.style.chart.labels.yAxisLabels.showProgression?i.value/3:i.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,be))),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*i.value+i.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,ge))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left+r*(o.value.width/(c.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.applyDataLabel)(t.value.style.chart.labels.formatter,l,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}),{datapoint:l,seriesIndex:r})),9,ke))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${d.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,xe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,we)],8,_e),e.createElementVNode("radialGradient",{id:`end_grad_${d.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,Ne),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,Ee),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Le)],8,Be)]),(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_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Se)],8,$e),e.createElementVNode("linearGradient",{id:`grad_negative_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,Xe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Pe)],8,ze)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Ae,[e.createElementVNode("path",{d:`M
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-xtIm3ydy.cjs"),R=require("./useResponsive-B3TrDDIG.cjs"),le=require("./Title-spYln43E.cjs"),W=require("./usePrinter-BrE53tUa.cjs"),ae=require("./DataTable-DT8VcwR5.cjs"),oe=require("./vue-ui-skeleton-g8cEqYmt.cjs"),re=require("./Legend-BiaVNQjc.cjs"),se=require("./vue-ui-accordion-DDiQi7FV.cjs"),U=require("./useNestedProp-XzXFHriE.cjs"),ne=require("./PackageVersion-DMkpXFFU.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],ie=["xmlns","viewBox"],de={key:0},ve=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],he={key:1},ye=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],me=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],fe={key:2},be=["x","y","font-size","fill","font-weight"],ge=["x","y","font-size","fill"],pe={key:3},ke=["x","y","font-size","fill","font-weight"],_e=["id"],xe=["stop-color"],Ce=["stop-color"],we=["stop-color"],Be=["id"],Ne=["stop-color"],Ee=["stop-color"],Le=["stop-color"],$e=["id"],Ve=["stop-color"],Se=["stop-color"],ze=["id"],Xe=["stop-color"],Pe=["stop-color"],Ae={key:0},Te=["d","fill"],De={key:1},Fe=["x","y","height","width","fill"],Me=["cx","cy","r","fill","stroke","stroke-width"],Ge=["cx","cy","r","fill","stroke","stroke-width"],Ie={key:2},Oe=["x","y","fill","font-size"],He={key:3},qe=["x","y","fill","font-size"],Re={key:3,class:"vue-data-ui-watermark"},We=["xmlns","height","width"],Ue=["fill"],je=["innerHTML"],Ye={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(j,{expose:Y,emit:Je}){const y=j,{vue_ui_dumbbell:Z}=s.useConfig(),b=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),d=e.ref(s.createUid()),L=e.ref(0),k=e.ref(null),$=e.ref(null),V=e.ref(null),S=e.ref(0),z=e.ref(0),X=e.ref(0),t=e.computed({get:()=>P(),set:a=>a});function P(){const a=U.useNestedProp({userConfig:y.config,defaultConfig:Z});return a.theme?{...U.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}e.watch(()=>y.config,a=>{t.value=P(),A(),S.value+=1,z.value+=1,X.value+=1,i.value=t.value.style.chart.rowHeight,g.value=t.value.style.chart.width},{deep:!0}),e.watch(()=>y.dataset,a=>{I()},{deep:!0});const _=e.ref(null);e.onMounted(()=>{A()});function A(){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=>{b.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=R.throttle(()=>{const{width:n,height:l}=R.useResponsive({chart:k.value,title:t.value.style.chart.title.text?$.value:null,legend:t.value.style.chart.legend.show?V.value:null});g.value=n,i.value=l/y.dataset.length,v.value=C()});_.value=new ResizeObserver(a),_.value.observe(k.value.parentNode)}}e.onBeforeUnmount(()=>{_.value&&_.value.disconnect()});const{isPrinting:T,isImaging:D,generatePdf:F,generateImage:M}=W.usePrinter({elementId:`dumbbell_${d.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,start:s.checkNaN(a.start),end:s.checkNaN(a.end),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]))})),c=e.computed(()=>s.calculateNiceScale(N.value.min<0?N.value.min:0,N.value.max,t.value.style.chart.grid.scaleSteps)),i=e.ref(t.value.style.chart.rowHeight),g=e.ref(t.value.style.chart.width),o=e.computed(()=>{const a=i.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+g.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,r=c.value.ticks.length*(g.value/c.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:g.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(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,r=o.value.left+(a.end+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,u=l+(r-l)/2;return{...a,startX:l,endX:r,centerX:u,y:o.value.top+n*i.value+i.value/2,endVal:a.start}})}const v=e.ref([]),G=e.ref(null),J=e.computed(()=>m.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{I()});function I(){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>=J.value?(cancelAnimationFrame(G.value),v.value=C()):(v.value=v.value.map((r,u)=>{r.endVal+=l[u]*(t.value.animationSpeed/100);const h=o.value.left+(r.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,B=o.value.left+(r.endVal+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,E=h+(B-h)/2;return{...r,startX:h,endX:B,centerX:E,y:o.value.top+u*i.value+i.value/2,endVal:r.endVal}}),a=v.value.map(r=>r.endVal).reduce((r,u)=>r+u,0),G.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()}const O=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${d.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_${d.value})`:t.value.style.chart.plots.endColor}]),K=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":""})),f=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=f.value.head.map((u,h)=>{const B=s.dataLabel({p:t.value.style.chart.labels.prefix,v:f.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:f.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),te=s.dataLabel({v:100*(f.value.body[h].end/f.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:u.name},B,E,te]}),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 H(){e.nextTick(()=>{const a=f.value.head.map((r,u)=>[[r.name],[f.value.body[u].start],[f.value.body[u].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 p=e.ref(!1);function Q(a){p.value=a,L.value+=1}function ee(){return v.value}function q(){x.value.showTable=!x.value.showTable}return Y({getData:ee,generatePdf:F,generateCsv:H,generateImage:M,toggleTable:q}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:k,class:e.normalizeClass(`vue-ui-dumbbell ${p.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_${d.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:$,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(le._sfc_main,{key:`title_${S.value}`,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"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(W.UserOptions,{ref:"details",key:`user_option_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(T),isImaging:e.unref(D),uid:d.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:p.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,position:t.value.userOptions.position,onToggleFullscreen:Q,onGeneratePdf:e.unref(F),onGenerateCsv:H,onGenerateImage:e.unref(M),onToggleTable:q},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","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":p.value,"vue-data-ui-fulscreen--off":!p.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:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ne._sfc_main),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left+r*o.value.width/(c.value.ticks.length-1),x2:o.value.left+r*o.value.width/(c.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,ve))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",he,[(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*i.value,y2:o.value.top+r*i.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,ye))),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,me)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",fe,[(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*i.value+(t.value.style.chart.labels.yAxisLabels.showProgression?i.value/3:i.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,be))),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*i.value+i.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,ge))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left+r*(o.value.width/(c.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.applyDataLabel)(t.value.style.chart.labels.formatter,l,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}),{datapoint:l,seriesIndex:r})),9,ke))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${d.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,xe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,we)],8,_e),e.createElementVNode("radialGradient",{id:`end_grad_${d.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,Ne),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,Ee),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Le)],8,Be)]),(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_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Se)],8,$e),e.createElementVNode("linearGradient",{id:`grad_negative_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,Xe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Pe)],8,ze)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Ae,[e.createElementVNode("path",{d:`M
2
2
  ${l.startX},${l.y+t.value.style.chart.plots.radius/2}
3
3
  C ${l.centerX},${l.y} ${l.centerX},${l.y}
4
4
  ${l.endX},${l.y+t.value.style.chart.plots.radius/2}
@@ -1,14 +1,14 @@
1
1
  import { computed as p, ref as y, watch as oe, onMounted as re, onBeforeUnmount as Le, openBlock as o, createElementBlock as r, normalizeClass as ne, normalizeStyle as V, createBlock as S, createCommentVNode as g, unref as d, createSlots as ze, withCtx as _, renderSlot as C, normalizeProps as ue, guardReactiveProps as ie, createVNode as Xe, Fragment as w, renderList as $, createElementVNode as n, toDisplayString as L, createTextVNode as ce, nextTick as Se } from "vue";
2
- import { u as Ne, c as de, t as Ae, o as Te, e as ve, g as Pe, v as he, C as Ge, f as z, X as ye, i as E, l as be, h as fe, q as De, r as Ie } from "./index-BJNSbAx7.js";
2
+ import { u as Ne, c as de, t as Ae, o as Te, e as ve, g as Pe, v as he, C as Ge, f as z, X as ye, i as E, l as be, h as fe, q as De, r as Ie } from "./index-CHn5mpNE.js";
3
3
  import { t as Me, u as Fe } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as Oe } from "./Title-0tYDaWv7.js";
5
- import { u as Ve, U as Ee } from "./usePrinter-CkV5eORP.js";
6
- import { D as He } from "./DataTable-BczvA492.js";
7
- import We from "./vue-ui-skeleton-CsU74BI7.js";
8
- import { L as Re } from "./Legend-DnOc-JGW.js";
9
- import Be from "./vue-ui-accordion-DDf5Y2GY.js";
10
- import { u as ge } from "./useNestedProp-CLh4tPxT.js";
11
- import { _ as Ue } from "./PackageVersion-DN8qp-uI.js";
4
+ import { _ as Oe } from "./Title-DqYX5EDQ.js";
5
+ import { u as Ve, U as Ee } from "./usePrinter-DNwJl64i.js";
6
+ import { D as He } from "./DataTable-CFtLoh2y.js";
7
+ import We from "./vue-ui-skeleton-BmPO8QNa.js";
8
+ import { L as Re } from "./Legend-DlZZeU8Y.js";
9
+ import Be from "./vue-ui-accordion-DXd5ND_A.js";
10
+ import { u as ge } from "./useNestedProp-BF5raFbY.js";
11
+ import { _ as Ue } from "./PackageVersion-B2pJ6f4s.js";
12
12
  import { _ as je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  const qe = ["id"], Ye = ["xmlns", "viewBox"], Ze = { key: 0 }, Je = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ke = { key: 1 }, Qe = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], et = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], tt = { key: 2 }, lt = ["x", "y", "font-size", "fill", "font-weight"], at = ["x", "y", "font-size", "fill"], st = { key: 3 }, ot = ["x", "y", "font-size", "fill", "font-weight"], rt = ["id"], nt = ["stop-color"], ut = ["stop-color"], it = ["stop-color"], ct = ["id"], dt = ["stop-color"], vt = ["stop-color"], ht = ["stop-color"], yt = ["id"], bt = ["stop-color"], ft = ["stop-color"], gt = ["id"], mt = ["stop-color"], pt = ["stop-color"], _t = { key: 0 }, xt = ["d", "fill"], kt = { key: 1 }, Ct = ["x", "y", "height", "width", "fill"], wt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], $t = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Lt = { key: 2 }, zt = ["x", "y", "fill", "font-size"], Xt = { key: 3 }, St = ["x", "y", "fill", "font-size"], Nt = {
14
14
  key: 3,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-NvxTr0fZ.cjs"),fe=require("./Title-Cjusozo5.cjs"),Z=require("./usePrinter-0s8wVGIy.cjs"),he=require("./DataTable-DRJUrEXP.cjs"),ve=require("./vue-ui-accordion-CxPjShWo.cjs"),me=require("./vue-ui-skeleton-DYHqPo98.cjs"),J=require("./useNestedProp-DhLxBAwX.cjs"),pe=require("./PackageVersion-rOhPenOY.cjs"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ke=["id"],ye={key:0,style:"width:100%;background:transparent;padding-bottom:24px"},be=["xmlns","viewBox"],we=["id"],Ce=["stop-color"],Ne=["stop-color"],xe=["d","fill","stroke","stroke-width"],_e=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],$e=["x","y","font-size","fill"],Be=["x","y","font-size","fill"],Ee={key:2,class:"vue-data-ui-watermark"},Se=["innerHTML"],Pe={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(K,{expose:Q}){const h=K,{vue_ui_flow:ee}=r.useConfig(),x=e.computed(()=>!!h.dataset&&h.dataset.length);e.onMounted(()=>{T()});function T(){r.objectIsEmpty(h.dataset)&&r.error({componentName:"VueUiFlow",type:"dataset"})}const _=e.ref(r.createUid()),F=e.ref(null),L=e.ref(0),z=e.ref(0),y=e.ref(!1);function te(l){y.value=l,L.value+=1}const t=e.computed({get:()=>I(),set:l=>l});function I(){const l=J.useNestedProp({userConfig:h.config,defaultConfig:ee});return l.theme?{...J.useNestedProp({userConfig:r.themes.vue_ui_flow[l.theme]||h.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>h.config,l=>{t.value=I(),T(),z.value+=1},{deep:!0});const{isPrinting:H,isImaging:O,generatePdf:V,generateImage:M}=Z.usePrinter({elementId:`flow_${_.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),$=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),D=e.computed(()=>t.value.style.chart.nodes.gap),g=e.computed(()=>t.value.style.chart.nodes.width),b=e.ref({showTable:t.value.table.show}),Y=e.computed(()=>t.value.style.chart.links.width),B=e.computed(()=>!h.dataset||!h.dataset.length?[]:h.dataset.map(l=>[l[0],l[1],r.checkNaN(l[2])])),q=e.computed(()=>{const l={};function n(s){l[s]||(l[s]={inflow:0,outflow:0})}B.value.forEach(([s,a,c])=>{n(s),n(a),l[s].outflow+=c,l[a].inflow+=c});let o=0;for(const s in l){const a=Math.max(l[s].inflow,l[s].outflow);o=Math.max(o,a)}return o});function le(l){return l/q.value*100+t.value.style.chart.nodes.minHeight}function oe(l){const n=t.value.style.chart.nodes.minHeight;return(l-n)/100*q.value}function ne(l){const n={},o={};function s(u,i){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=i),o[i]||(o[i]=[]),o[i].includes(u)||o[i].push(u)}l.forEach(([u,i,f],k)=>{const p=n[u]?n[u].level:0,N=p+1;s(u,p),s(i,N),n[u].children||(n[u].children=[]),n[u].children.push({target:i,value:f}),n[u].outflow+=f,n[i].inflow+=f}),Object.keys(n).forEach((u,i)=>{n[u].color=$.value[i]||$.value[i%$.value.length]||r.palette[i]||r.palette[i%d.length]});for(const u in n)n[u].height=le(Math.max(n[u].inflow,n[u].outflow)),n[u].name=u;const a={};for(const u in o){let i=0;o[u].forEach((f,k)=>{const p=n[f].height;a[f]={x:parseInt(u,10)*Y.value+t.value.style.chart.padding.left,y:i,absoluteY:i,height:p,i:k,color:n[f].color,value:oe(p)},i+=p+D.value})}const c=[];for(const u in n){let i=a[u].absoluteY;n[u].children&&n[u].children.forEach(({target:f,value:k},p)=>{const N=a[f].y,S=a[u],P=a[f],A=r.checkNaN(i),W=r.checkNaN(i+k/n[u].outflow*S.height),X=r.checkNaN(N),R=r.checkNaN(N+k/n[f].inflow*P.height),de={id:r.createUid(),source:u,target:f,path:`M ${r.checkNaN(S.x)+r.checkNaN(g.value)} ${A} L ${r.checkNaN(S.x)+r.checkNaN(g.value)} ${W} L ${r.checkNaN(P.x)} ${R} L ${r.checkNaN(P.x)} ${X} Z`,value:k,sourceColor:n[u].color,targetColor:n[f].color};c.push(de),i+=W-A,a[f].y+=R-X})}return{nodeCoordinates:a,links:c}}const v=e.computed(()=>{const l=ne(h.dataset);return{nodes:Object.keys(l.nodeCoordinates).map((n,o)=>({...l.nodeCoordinates[n],name:n})),links:l.links}}),ae=e.computed(()=>re(v.value.nodes));function re(l){const n={};for(const s in l){const{x:a,height:c}=l[s];n[a]||(n[a]=0),n[a]+=c+D.value}return Math.max(...Object.values(n))}const E=e.computed(()=>{const{top:l,right:n,left:o,bottom:s}=t.value.style.chart.padding,a=B.value.length*Y.value;return{height:ae.value+l+s,width:n+Math.max(...v.value.nodes.map(c=>c.x))+g.value,left:o,top:l,right:a-n,p_top:l,p_bottom:s}});function se(l){const n={},o={},s=new Set;return B.value.forEach(([a,c,u])=>{n[a]||(n[a]=[]),o[c]||(o[c]=[]),n[a].push(c),o[c].push(a)}),n[l]&&n[l].forEach(a=>s.add(a)),o[l]&&o[l].forEach(a=>s.add(a)),Array.from(s).concat(l)}const m=e.ref(null),w=e.ref(null);function ue(l){m.value=se(l.name),w.value=l.name}function ie(){m.value=null,w.value=null}const G=e.computed(()=>v.value.links.map(({source:l,target:n,sourceColor:o,targetColor:s,value:a})=>({source:l,target:n,sourceColor:o,targetColor:s,value:a})));function U(){e.nextTick(()=>{const l=G.value.map((s,a)=>[[s.source],[s.target],[s.value]]),n=[[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(l),o=r.createCsvContent(n);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const C=e.computed(()=>{const l=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],n=G.value.map((a,c)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},r.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})]),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.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:l,body:n,config:o}});function ce(){return v.value}function j(){b.value.showTable=!b.value.showTable}return Q({getData:ce,generateCsv:U,generateImage:M,generatePdf:V,toggleTable:j}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:F,class:e.normalizeClass(`vue-ui-flow ${y.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_${_.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(fe._sfc_main,{key:`title_${z.value}`,config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&x.value?(e.openBlock(),e.createBlock(Z.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(O),uid:_.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:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:F.value,position:t.value.userOptions.position,onToggleFullscreen:te,onGeneratePdf:e.unref(V),onGenerateCsv:U,onGenerateImage:e.unref(M),onToggleTable:j},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:s})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:s})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${E.value.width} ${E.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(pe._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.links,(o,s)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:o.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.sourceColor},null,8,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":o.targetColor},null,8,Ne)],8,we))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.links,o=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:o.path,fill:`url(#${o.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${w.value?[o.target,o.source].includes(w.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,xe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.nodes,(o,s)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:o.x,y:e.unref(r.checkNaN)(o.absoluteY),height:e.unref(r.checkNaN)(o.height),width:g.value,fill:o.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>ue(o),onMouseleave:n[0]||(n[0]=a=>ie()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(o.name)?1:.2:1}`)},null,44,_e))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.nodes,(o,s)=>(e.openBlock(),e.createElementBlock("text",{x:o.x+g.value/2,y:e.unref(r.checkNaN)(o.absoluteY+o.height/2-t.value.style.chart.nodes.labels.fontSize/4),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(r.adaptColorToBackground)(o.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(o.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(r.abbreviate)({source:o.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):o.name),13,$e))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.nodes,(o,s)=>(e.openBlock(),e.createElementBlock("text",{x:o.x+g.value/2,y:e.unref(r.checkNaN)(o.absoluteY+o.height/2+t.value.style.chart.nodes.labels.fontSize),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(r.adaptColorToBackground)(o.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(o.name)?1:0:1}`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.nodes.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:o.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding}),{datapoint:o,seriesIndex:s})),13,Be))),256)),e.renderSlot(l.$slots,"svg",{svg:E.value},void 0,!0)],14,be)),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ee,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(H)||e.unref(O)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(me.default,{key:3,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),x.value?(e.openBlock(),e.createBlock(ve.default,{key:4,hideDetails:"",config:{open:b.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(he.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:n[1]||(n[1]=o=>b.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Se)]),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,ke))}},Te=ge._export_sfc(Pe,[["__scopeId","data-v-53bf76e7"]]);exports.default=Te;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-xtIm3ydy.cjs"),fe=require("./Title-spYln43E.cjs"),Z=require("./usePrinter-BrE53tUa.cjs"),he=require("./DataTable-DT8VcwR5.cjs"),ve=require("./vue-ui-accordion-DDiQi7FV.cjs"),me=require("./vue-ui-skeleton-g8cEqYmt.cjs"),J=require("./useNestedProp-XzXFHriE.cjs"),pe=require("./PackageVersion-DMkpXFFU.cjs"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ke=["id"],ye={key:0,style:"width:100%;background:transparent;padding-bottom:24px"},be=["xmlns","viewBox"],we=["id"],Ce=["stop-color"],Ne=["stop-color"],xe=["d","fill","stroke","stroke-width"],_e=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],$e=["x","y","font-size","fill"],Be=["x","y","font-size","fill"],Ee={key:2,class:"vue-data-ui-watermark"},Se=["innerHTML"],Pe={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(K,{expose:Q}){const h=K,{vue_ui_flow:ee}=r.useConfig(),x=e.computed(()=>!!h.dataset&&h.dataset.length);e.onMounted(()=>{T()});function T(){r.objectIsEmpty(h.dataset)&&r.error({componentName:"VueUiFlow",type:"dataset"})}const _=e.ref(r.createUid()),F=e.ref(null),L=e.ref(0),z=e.ref(0),y=e.ref(!1);function te(l){y.value=l,L.value+=1}const t=e.computed({get:()=>I(),set:l=>l});function I(){const l=J.useNestedProp({userConfig:h.config,defaultConfig:ee});return l.theme?{...J.useNestedProp({userConfig:r.themes.vue_ui_flow[l.theme]||h.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>h.config,l=>{t.value=I(),T(),z.value+=1},{deep:!0});const{isPrinting:H,isImaging:O,generatePdf:V,generateImage:M}=Z.usePrinter({elementId:`flow_${_.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),$=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),D=e.computed(()=>t.value.style.chart.nodes.gap),g=e.computed(()=>t.value.style.chart.nodes.width),b=e.ref({showTable:t.value.table.show}),Y=e.computed(()=>t.value.style.chart.links.width),B=e.computed(()=>!h.dataset||!h.dataset.length?[]:h.dataset.map(l=>[l[0],l[1],r.checkNaN(l[2])])),q=e.computed(()=>{const l={};function n(s){l[s]||(l[s]={inflow:0,outflow:0})}B.value.forEach(([s,a,c])=>{n(s),n(a),l[s].outflow+=c,l[a].inflow+=c});let o=0;for(const s in l){const a=Math.max(l[s].inflow,l[s].outflow);o=Math.max(o,a)}return o});function le(l){return l/q.value*100+t.value.style.chart.nodes.minHeight}function oe(l){const n=t.value.style.chart.nodes.minHeight;return(l-n)/100*q.value}function ne(l){const n={},o={};function s(u,i){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=i),o[i]||(o[i]=[]),o[i].includes(u)||o[i].push(u)}l.forEach(([u,i,f],k)=>{const p=n[u]?n[u].level:0,N=p+1;s(u,p),s(i,N),n[u].children||(n[u].children=[]),n[u].children.push({target:i,value:f}),n[u].outflow+=f,n[i].inflow+=f}),Object.keys(n).forEach((u,i)=>{n[u].color=$.value[i]||$.value[i%$.value.length]||r.palette[i]||r.palette[i%d.length]});for(const u in n)n[u].height=le(Math.max(n[u].inflow,n[u].outflow)),n[u].name=u;const a={};for(const u in o){let i=0;o[u].forEach((f,k)=>{const p=n[f].height;a[f]={x:parseInt(u,10)*Y.value+t.value.style.chart.padding.left,y:i,absoluteY:i,height:p,i:k,color:n[f].color,value:oe(p)},i+=p+D.value})}const c=[];for(const u in n){let i=a[u].absoluteY;n[u].children&&n[u].children.forEach(({target:f,value:k},p)=>{const N=a[f].y,S=a[u],P=a[f],A=r.checkNaN(i),W=r.checkNaN(i+k/n[u].outflow*S.height),X=r.checkNaN(N),R=r.checkNaN(N+k/n[f].inflow*P.height),de={id:r.createUid(),source:u,target:f,path:`M ${r.checkNaN(S.x)+r.checkNaN(g.value)} ${A} L ${r.checkNaN(S.x)+r.checkNaN(g.value)} ${W} L ${r.checkNaN(P.x)} ${R} L ${r.checkNaN(P.x)} ${X} Z`,value:k,sourceColor:n[u].color,targetColor:n[f].color};c.push(de),i+=W-A,a[f].y+=R-X})}return{nodeCoordinates:a,links:c}}const v=e.computed(()=>{const l=ne(h.dataset);return{nodes:Object.keys(l.nodeCoordinates).map((n,o)=>({...l.nodeCoordinates[n],name:n})),links:l.links}}),ae=e.computed(()=>re(v.value.nodes));function re(l){const n={};for(const s in l){const{x:a,height:c}=l[s];n[a]||(n[a]=0),n[a]+=c+D.value}return Math.max(...Object.values(n))}const E=e.computed(()=>{const{top:l,right:n,left:o,bottom:s}=t.value.style.chart.padding,a=B.value.length*Y.value;return{height:ae.value+l+s,width:n+Math.max(...v.value.nodes.map(c=>c.x))+g.value,left:o,top:l,right:a-n,p_top:l,p_bottom:s}});function se(l){const n={},o={},s=new Set;return B.value.forEach(([a,c,u])=>{n[a]||(n[a]=[]),o[c]||(o[c]=[]),n[a].push(c),o[c].push(a)}),n[l]&&n[l].forEach(a=>s.add(a)),o[l]&&o[l].forEach(a=>s.add(a)),Array.from(s).concat(l)}const m=e.ref(null),w=e.ref(null);function ue(l){m.value=se(l.name),w.value=l.name}function ie(){m.value=null,w.value=null}const G=e.computed(()=>v.value.links.map(({source:l,target:n,sourceColor:o,targetColor:s,value:a})=>({source:l,target:n,sourceColor:o,targetColor:s,value:a})));function U(){e.nextTick(()=>{const l=G.value.map((s,a)=>[[s.source],[s.target],[s.value]]),n=[[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(l),o=r.createCsvContent(n);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const C=e.computed(()=>{const l=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],n=G.value.map((a,c)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},r.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})]),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.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:l,body:n,config:o}});function ce(){return v.value}function j(){b.value.showTable=!b.value.showTable}return Q({getData:ce,generateCsv:U,generateImage:M,generatePdf:V,toggleTable:j}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:F,class:e.normalizeClass(`vue-ui-flow ${y.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_${_.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(fe._sfc_main,{key:`title_${z.value}`,config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&x.value?(e.openBlock(),e.createBlock(Z.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(O),uid:_.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:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:F.value,position:t.value.userOptions.position,onToggleFullscreen:te,onGeneratePdf:e.unref(V),onGenerateCsv:U,onGenerateImage:e.unref(M),onToggleTable:j},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:s})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:s})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${E.value.width} ${E.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(pe._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.links,(o,s)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:o.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.sourceColor},null,8,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":o.targetColor},null,8,Ne)],8,we))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.links,o=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:o.path,fill:`url(#${o.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${w.value?[o.target,o.source].includes(w.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,xe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.nodes,(o,s)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:o.x,y:e.unref(r.checkNaN)(o.absoluteY),height:e.unref(r.checkNaN)(o.height),width:g.value,fill:o.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>ue(o),onMouseleave:n[0]||(n[0]=a=>ie()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(o.name)?1:.2:1}`)},null,44,_e))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.nodes,(o,s)=>(e.openBlock(),e.createElementBlock("text",{x:o.x+g.value/2,y:e.unref(r.checkNaN)(o.absoluteY+o.height/2-t.value.style.chart.nodes.labels.fontSize/4),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(r.adaptColorToBackground)(o.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(o.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(r.abbreviate)({source:o.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):o.name),13,$e))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.nodes,(o,s)=>(e.openBlock(),e.createElementBlock("text",{x:o.x+g.value/2,y:e.unref(r.checkNaN)(o.absoluteY+o.height/2+t.value.style.chart.nodes.labels.fontSize),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(r.adaptColorToBackground)(o.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(o.name)?1:0:1}`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.nodes.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:o.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding}),{datapoint:o,seriesIndex:s})),13,Be))),256)),e.renderSlot(l.$slots,"svg",{svg:E.value},void 0,!0)],14,be)),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ee,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(H)||e.unref(O)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(me.default,{key:3,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),x.value?(e.openBlock(),e.createBlock(ve.default,{key:4,hideDetails:"",config:{open:b.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(he.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:n[1]||(n[1]=o=>b.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Se)]),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,ke))}},Te=ge._export_sfc(Pe,[["__scopeId","data-v-53bf76e7"]]);exports.default=Te;
@@ -1,12 +1,12 @@
1
1
  import { computed as m, onMounted as He, ref as y, watch as Oe, openBlock as r, createElementBlock as h, normalizeClass as ce, normalizeStyle as _, createBlock as E, createCommentVNode as T, unref as i, createSlots as Ee, withCtx as k, renderSlot as C, normalizeProps as de, guardReactiveProps as ve, createVNode as fe, createElementVNode as S, Fragment as P, renderList as F, toDisplayString as U, createTextVNode as Se, nextTick as Me } from "vue";
2
- import { u as ze, o as Ye, e as De, c as he, t as Ge, a as Be, p as V, b as Ae, v, f as me, X as Ue, F as ge, K as Ve, i as je, q as Xe, r as We } from "./index-BJNSbAx7.js";
3
- import { _ as qe } from "./Title-0tYDaWv7.js";
4
- import { u as Ke, U as Re } from "./usePrinter-CkV5eORP.js";
5
- import { D as Ze } from "./DataTable-BczvA492.js";
6
- import Je from "./vue-ui-accordion-DDf5Y2GY.js";
7
- import Qe from "./vue-ui-skeleton-CsU74BI7.js";
8
- import { u as pe } from "./useNestedProp-CLh4tPxT.js";
9
- import { _ as et } from "./PackageVersion-DN8qp-uI.js";
2
+ import { u as ze, o as Ye, e as De, c as he, t as Ge, a as Be, p as V, b as Ae, v, f as me, X as Ue, F as ge, K as Ve, i as je, q as Xe, r as We } from "./index-CHn5mpNE.js";
3
+ import { _ as qe } from "./Title-DqYX5EDQ.js";
4
+ import { u as Ke, U as Re } from "./usePrinter-DNwJl64i.js";
5
+ import { D as Ze } from "./DataTable-CFtLoh2y.js";
6
+ import Je from "./vue-ui-accordion-DXd5ND_A.js";
7
+ import Qe from "./vue-ui-skeleton-BmPO8QNa.js";
8
+ import { u as pe } from "./useNestedProp-BF5raFbY.js";
9
+ import { _ as et } from "./PackageVersion-B2pJ6f4s.js";
10
10
  import { _ as tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
11
  const lt = ["id"], ot = {
12
12
  key: 0,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-NvxTr0fZ.cjs"),le=require("./Legend-DDmBZxt8.cjs"),oe=require("./Title-Cjusozo5.cjs"),ae=require("./Tooltip-CkqTs_wn.cjs"),re=require("./DataTable-DRJUrEXP.cjs"),W=require("./usePrinter-0s8wVGIy.cjs"),ne=require("./vue-ui-skeleton-DYHqPo98.cjs"),se=require("./vue-ui-accordion-CxPjShWo.cjs"),U=require("./useNestedProp-DhLxBAwX.cjs"),ue=require("./PackageVersion-rOhPenOY.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],de={key:0,style:"width:100%;background:transparent;padding-bottom:24px"},ve=["xmlns","viewBox"],he=["id"],pe=["stdDeviation"],fe=["d","stroke","stroke-width"],ye=["d","stroke","stroke-width"],ge=["filter"],me=["d","stroke","stroke-width"],be=["d","stroke-width","onMouseenter","onClick"],ke={key:3,class:"vue-data-ui-watermark"},Ce=["onClick"],we={key:0},xe={key:1},$e=["innerHTML"],Be={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(H,{expose:R,emit:T}){const i=H,{vue_ui_galaxy:X}=r.useConfig(),b=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{N()});function N(){r.objectIsEmpty(i.dataset)?r.error({componentName:"VueUiGalaxy",type:"dataset"}):i.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),j=e.ref(null),w=e.ref(!1),x=e.ref(""),c=e.ref(null),S=e.ref(0),P=e.ref(0),L=e.ref(0),E=e.ref(0),t=e.computed({get:()=>V(),set:l=>l});function V(){const l=U.useNestedProp({userConfig:i.config,defaultConfig:X});return l.theme?{...U.useNestedProp({userConfig:r.themes.vue_ui_galaxy[l.theme]||i.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>i.config,l=>{t.value=V(),N(),P.value+=1,L.value+=1,E.value+=1},{deep:!0});const{isPrinting:F,isImaging:I,generatePdf:O,generateImage:z}=W.usePrinter({elementId:`galaxy_${y.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),Y=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}),u=e.ref([]);function B(l){u.value.includes(l.id)?u.value=u.value.filter(a=>a!==l.id):u.value.push(l.id),T("selectLegend",g.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const p=e.computed(()=>i.dataset.map((l,a)=>({name:l.name,color:r.convertColorToHex(l.color)||Y.value[a]||r.palette[a]||r.palette[a%r.palette.length],value:l.values?r.sanitizeArray(l.values).reduce((o,n)=>o+n,0):0,absoluteValues:r.sanitizeArray(l.values),id:r.createUid(),seriesIndex:a})).sort((l,a)=>a.value-l.value));function J(){return p.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const d=e.computed(()=>p.value.filter(l=>!u.value.includes(l.id)).map(l=>l.value).reduce((l,a)=>l+a,0)),K=e.ref(190),D=e.computed(()=>p.value.filter(l=>!u.value.includes(l.id))),g=e.computed(()=>{const l=[];for(let a=0;a<D.value.length;a+=1){const o=D.value[a];let n=o.value/d.value*K.value;a>0&&l.length&&(n+=l[a-1].points),l.push({points:n,...o,seriesIndex:a,proportion:o.value/d.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)=>!u.value.includes(a.id)).toSorted((a,o)=>o.points-a.points)}),m=e.ref(!1);function Q(l){m.value=l,S.value+=1}const _=e.ref(null);function Z({datapoint:l,_relativeIndex:a,seriesIndex:o,show:n=!1}){_.value={datapoint:l,seriesIndex:o,series:p.value,config:t.value},w.value=n,c.value=l.id;let s="";const f=t.value.style.chart.tooltip.customFormat;r.isFunction(f)&&r.functionReturnsString(()=>f({seriesIndex:o,datapoint:l,series:p.value,config:t.value}))?x.value=f({seriesIndex:o,datapoint:l,series:p.value,config:t.value}):(s+=`<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>`,s+=`<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&&(s+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,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}),{datapoint:l,seriesIndex:o})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?s+=`<span>(${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:s+=`<b>${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),x.value=`<div>${s}</div>`)}const q=e.computed(()=>p.value.map((l,a)=>({...l,proportion:(l.value||0)/i.dataset.map(o=>(o.values||[]).reduce((n,s)=>n+s,0)).reduce((o,n)=>o+n,0),opacity:u.value.includes(l.id)?.5:1,shape:l.shape||"circle",segregate:()=>B(l),isSegregated:u.value.includes(l.id)}))),ee=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=g.value.map(o=>({name:o.name,color:o.color})),a=g.value.map(o=>o.value);return{head:l,body:a}});function G(){e.nextTick(()=>{const l=h.value.head.map((n,s)=>[[n.name],[h.value.body[s]],[isNaN(h.value.body[s]/d.value)?"-":h.value.body[s]/d.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:d.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=h.value.head.map((s,f)=>{const te=r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:h.value.body[f],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:s.color,name:s.name},te,isNaN(h.value.body[f]/d.value)?"-":r.dataLabel({v:h.value.body[f]/d.value*100,s:"%",r: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 M(){v.value.showTable=!v.value.showTable}function A(){v.value.showTooltip=!v.value.showTooltip}return R({getData:J,generatePdf:O,generateCsv:G,generateImage:z,toggleTable:M,toggleTooltip:A}),(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",de,[(e.openBlock(),e.createBlock(oe._sfc_main,{key:`title_${P.value}`,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"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(W.UserOptions,{ref_key:"details",ref:j,key:`user_option_${S.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(F),isImaging:e.unref(I),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,position:t.value.userOptions.position,onToggleFullscreen:Q,onGeneratePdf:e.unref(O),onGenerateCsv:G,onGenerateImage:e.unref(z),onToggleTable:M,onToggleTooltip:A},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","position","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:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ue._sfc_main),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,pe)],8,he)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.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)*(c.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,fe)):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*(c.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(`${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,ye)):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*(c.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 ${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,me)],8,ge)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.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:s=>Z({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=s=>{w.value=!1,c.value=null}),onClick:s=>T("selectDatapoint",o)},null,40,be)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:$.value},void 0,!0)],14,ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ke,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(F)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ne.default,{key:4,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(le.Legend,{key:`legend_${E.value}`,legendSet:q.value,config:ee.value,onClickMarker:a[1]||(a[1]=({legend:o})=>B(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:s=>B(o),style:e.normalizeStyle(`opacity:${u.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,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}),{datapoint:o,seriesIndex:n}))+" ",1),u.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",xe," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",we," ("+e.toDisplayString(isNaN(o.value/d.value)?"-":e.unref(r.dataLabel)({v:o.value/d.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Ce)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:q.value},void 0,!0),e.createVNode(ae._sfc_main,{show:v.value.showTooltip&&w.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,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:C.value,content:x.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({..._.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({..._.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),b.value?(e.openBlock(),e.createBlock(se.default,{key:6,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.openBlock(),e.createBlock(re.DataTable,{key:`table_${L.value}`,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,$e)]),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,ce))}},_e=ie._export_sfc(Be,[["__scopeId","data-v-20ef4a66"]]);exports.default=_e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-xtIm3ydy.cjs"),le=require("./Legend-BiaVNQjc.cjs"),oe=require("./Title-spYln43E.cjs"),ae=require("./Tooltip-BgkDlGZj.cjs"),re=require("./DataTable-DT8VcwR5.cjs"),W=require("./usePrinter-BrE53tUa.cjs"),ne=require("./vue-ui-skeleton-g8cEqYmt.cjs"),se=require("./vue-ui-accordion-DDiQi7FV.cjs"),U=require("./useNestedProp-XzXFHriE.cjs"),ue=require("./PackageVersion-DMkpXFFU.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],de={key:0,style:"width:100%;background:transparent;padding-bottom:24px"},ve=["xmlns","viewBox"],he=["id"],pe=["stdDeviation"],fe=["d","stroke","stroke-width"],ye=["d","stroke","stroke-width"],ge=["filter"],me=["d","stroke","stroke-width"],be=["d","stroke-width","onMouseenter","onClick"],ke={key:3,class:"vue-data-ui-watermark"},Ce=["onClick"],we={key:0},xe={key:1},$e=["innerHTML"],Be={__name:"vue-ui-galaxy",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(H,{expose:R,emit:T}){const i=H,{vue_ui_galaxy:X}=r.useConfig(),b=e.computed(()=>!!i.dataset&&i.dataset.length);e.onMounted(()=>{N()});function N(){r.objectIsEmpty(i.dataset)?r.error({componentName:"VueUiGalaxy",type:"dataset"}):i.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),j=e.ref(null),w=e.ref(!1),x=e.ref(""),c=e.ref(null),S=e.ref(0),P=e.ref(0),L=e.ref(0),E=e.ref(0),t=e.computed({get:()=>V(),set:l=>l});function V(){const l=U.useNestedProp({userConfig:i.config,defaultConfig:X});return l.theme?{...U.useNestedProp({userConfig:r.themes.vue_ui_galaxy[l.theme]||i.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>i.config,l=>{t.value=V(),N(),P.value+=1,L.value+=1,E.value+=1},{deep:!0});const{isPrinting:F,isImaging:I,generatePdf:O,generateImage:z}=W.usePrinter({elementId:`galaxy_${y.value}`,fileName:t.value.style.chart.title.text||"vue-ui-galaxy"}),Y=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}),u=e.ref([]);function B(l){u.value.includes(l.id)?u.value=u.value.filter(a=>a!==l.id):u.value.push(l.id),T("selectLegend",g.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const p=e.computed(()=>i.dataset.map((l,a)=>({name:l.name,color:r.convertColorToHex(l.color)||Y.value[a]||r.palette[a]||r.palette[a%r.palette.length],value:l.values?r.sanitizeArray(l.values).reduce((o,n)=>o+n,0):0,absoluteValues:r.sanitizeArray(l.values),id:r.createUid(),seriesIndex:a})).sort((l,a)=>a.value-l.value));function J(){return p.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const d=e.computed(()=>p.value.filter(l=>!u.value.includes(l.id)).map(l=>l.value).reduce((l,a)=>l+a,0)),K=e.ref(190),D=e.computed(()=>p.value.filter(l=>!u.value.includes(l.id))),g=e.computed(()=>{const l=[];for(let a=0;a<D.value.length;a+=1){const o=D.value[a];let n=o.value/d.value*K.value;a>0&&l.length&&(n+=l[a-1].points),l.push({points:n,...o,seriesIndex:a,proportion:o.value/d.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)=>!u.value.includes(a.id)).toSorted((a,o)=>o.points-a.points)}),m=e.ref(!1);function Q(l){m.value=l,S.value+=1}const _=e.ref(null);function Z({datapoint:l,_relativeIndex:a,seriesIndex:o,show:n=!1}){_.value={datapoint:l,seriesIndex:o,series:p.value,config:t.value},w.value=n,c.value=l.id;let s="";const f=t.value.style.chart.tooltip.customFormat;r.isFunction(f)&&r.functionReturnsString(()=>f({seriesIndex:o,datapoint:l,series:p.value,config:t.value}))?x.value=f({seriesIndex:o,datapoint:l,series:p.value,config:t.value}):(s+=`<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>`,s+=`<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&&(s+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,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}),{datapoint:l,seriesIndex:o})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?s+=`<span>(${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:s+=`<b>${r.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),x.value=`<div>${s}</div>`)}const q=e.computed(()=>p.value.map((l,a)=>({...l,proportion:(l.value||0)/i.dataset.map(o=>(o.values||[]).reduce((n,s)=>n+s,0)).reduce((o,n)=>o+n,0),opacity:u.value.includes(l.id)?.5:1,shape:l.shape||"circle",segregate:()=>B(l),isSegregated:u.value.includes(l.id)}))),ee=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=g.value.map(o=>({name:o.name,color:o.color})),a=g.value.map(o=>o.value);return{head:l,body:a}});function G(){e.nextTick(()=>{const l=h.value.head.map((n,s)=>[[n.name],[h.value.body[s]],[isNaN(h.value.body[s]/d.value)?"-":h.value.body[s]/d.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:d.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=h.value.head.map((s,f)=>{const te=r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:h.value.body[f],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:s.color,name:s.name},te,isNaN(h.value.body[f]/d.value)?"-":r.dataLabel({v:h.value.body[f]/d.value*100,s:"%",r: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 M(){v.value.showTable=!v.value.showTable}function A(){v.value.showTooltip=!v.value.showTooltip}return R({getData:J,generatePdf:O,generateCsv:G,generateImage:z,toggleTable:M,toggleTooltip:A}),(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",de,[(e.openBlock(),e.createBlock(oe._sfc_main,{key:`title_${P.value}`,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"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(W.UserOptions,{ref_key:"details",ref:j,key:`user_option_${S.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(F),isImaging:e.unref(I),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,position:t.value.userOptions.position,onToggleFullscreen:Q,onGeneratePdf:e.unref(O),onGenerateCsv:G,onGenerateImage:e.unref(z),onToggleTable:M,onToggleTooltip:A},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","position","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:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(ue._sfc_main),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,pe)],8,he)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.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)*(c.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,fe)):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*(c.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(`${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,ye)):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*(c.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 ${c.value&&c.value!==o.id&&t.value.useBlurOnHover?"vue-ui-galaxy-blur":""}`)},null,10,me)],8,ge)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.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:s=>Z({datapoint:o,relativeIndex:n,seriesIndex:o.seriesIndex,show:!0}),onMouseleave:a[0]||(a[0]=s=>{w.value=!1,c.value=null}),onClick:s=>T("selectDatapoint",o)},null,40,be)):e.createCommentVNode("",!0)]))),256)),e.renderSlot(l.$slots,"svg",{svg:$.value},void 0,!0)],14,ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ke,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(F)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ne.default,{key:4,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(le.Legend,{key:`legend_${E.value}`,legendSet:q.value,config:ee.value,onClickMarker:a[1]||(a[1]=({legend:o})=>B(o))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{onClick:s=>B(o),style:e.normalizeStyle(`opacity:${u.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,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}),{datapoint:o,seriesIndex:n}))+" ",1),u.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",xe," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",we," ("+e.toDisplayString(isNaN(o.value/d.value)?"-":e.unref(r.dataLabel)({v:o.value/d.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Ce)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:q.value},void 0,!0),e.createVNode(ae._sfc_main,{show:v.value.showTooltip&&w.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,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:C.value,content:x.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({..._.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({..._.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),b.value?(e.openBlock(),e.createBlock(se.default,{key:6,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.openBlock(),e.createBlock(re.DataTable,{key:`table_${L.value}`,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,$e)]),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,ce))}},_e=ie._export_sfc(Be,[["__scopeId","data-v-20ef4a66"]]);exports.default=_e;
@@ -1,14 +1,14 @@
1
1
  import { computed as v, onMounted as _e, ref as u, watch as Te, openBlock as s, createElementBlock as n, normalizeClass as L, normalizeStyle as W, createBlock as x, createCommentVNode as d, unref as h, createSlots as Pe, withCtx as i, renderSlot as y, normalizeProps as I, guardReactiveProps as F, createVNode as oe, createElementVNode as $, Fragment as se, renderList as re, createTextVNode as ue, toDisplayString as O, nextTick as Se } from "vue";
2
- import { u as Ne, o as Le, e as ne, g as Ie, c as ie, t as Fe, a as Oe, p as E, b as Ee, d as De, I as ce, L as Ve, f as k, X as Be, i as ve, x as de, y as Ge, q as Me, r as ze } from "./index-BJNSbAx7.js";
3
- import { L as We } from "./Legend-DnOc-JGW.js";
4
- import { _ as Ae } from "./Title-0tYDaWv7.js";
5
- import { _ as He } from "./Tooltip-DdWGiVyf.js";
6
- import { D as Ue } from "./DataTable-BczvA492.js";
7
- import { u as Xe, U as Re } from "./usePrinter-CkV5eORP.js";
8
- import Ye from "./vue-ui-skeleton-CsU74BI7.js";
9
- import je from "./vue-ui-accordion-DDf5Y2GY.js";
10
- import { u as he } from "./useNestedProp-CLh4tPxT.js";
11
- import { _ as qe } from "./PackageVersion-DN8qp-uI.js";
2
+ import { u as Ne, o as Le, e as ne, g as Ie, c as ie, t as Fe, a as Oe, p as E, b as Ee, d as De, I as ce, L as Ve, f as k, X as Be, i as ve, x as de, y as Ge, q as Me, r as ze } from "./index-CHn5mpNE.js";
3
+ import { L as We } from "./Legend-DlZZeU8Y.js";
4
+ import { _ as Ae } from "./Title-DqYX5EDQ.js";
5
+ import { _ as He } from "./Tooltip-7I8a4mo2.js";
6
+ import { D as Ue } from "./DataTable-CFtLoh2y.js";
7
+ import { u as Xe, U as Re } from "./usePrinter-DNwJl64i.js";
8
+ import Ye from "./vue-ui-skeleton-BmPO8QNa.js";
9
+ import je from "./vue-ui-accordion-DXd5ND_A.js";
10
+ import { u as he } from "./useNestedProp-BF5raFbY.js";
11
+ import { _ as qe } from "./PackageVersion-B2pJ6f4s.js";
12
12
  import { _ as Je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  const Ke = ["id"], Qe = {
14
14
  key: 0,
@@ -1,11 +1,11 @@
1
1
  import { computed as g, ref as h, watch as K, onMounted as ke, onBeforeUnmount as be, openBlock as o, createElementBlock as i, normalizeClass as Q, normalizeStyle as ee, createBlock as G, withCtx as I, toDisplayString as S, createCommentVNode as p, unref as c, createSlots as _e, renderSlot as x, normalizeProps as te, guardReactiveProps as ae, createVNode as xe, createElementVNode as f, Fragment as R, renderList as E } from "vue";
2
- import { u as we, c as Fe, t as Se, a as ze, p as le, b as Ce, o as se, d as $e, e as O, g as re, m as oe, X as Me, s as A, H as X, i as Pe, f as Ie, E as ue } from "./index-BJNSbAx7.js";
2
+ import { u as we, c as Fe, t as Se, a as ze, p as le, b as Ce, o as se, d as $e, e as O, g as re, m as oe, X as Me, s as A, H as X, i as Pe, f as Ie, E as ue } from "./index-CHn5mpNE.js";
3
3
  import { t as Oe, u as Xe } from "./useResponsive-NZB-WLRF.js";
4
- import { u as Ne, U as Ye } from "./usePrinter-CkV5eORP.js";
5
- import Ge from "./vue-ui-skeleton-CsU74BI7.js";
6
- import { _ as Re } from "./Title-0tYDaWv7.js";
7
- import { u as ne } from "./useNestedProp-CLh4tPxT.js";
8
- import { _ as Ee } from "./PackageVersion-DN8qp-uI.js";
4
+ import { u as Ne, U as Ye } from "./usePrinter-DNwJl64i.js";
5
+ import Ge from "./vue-ui-skeleton-BmPO8QNa.js";
6
+ import { _ as Re } from "./Title-DqYX5EDQ.js";
7
+ import { u as ne } from "./useNestedProp-BF5raFbY.js";
8
+ import { _ as Ee } from "./PackageVersion-B2pJ6f4s.js";
9
9
  import { _ as Ae } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
10
  const je = ["id"], De = { key: 0 }, Ue = ["xmlns", "viewBox"], Be = ["id"], Le = ["stop-color"], We = ["stop-color"], Te = ["stop-color"], Ve = ["id"], qe = ["stdDeviation"], He = ["d", "fill", "stroke"], Ze = ["d", "filter"], Je = ["x", "y", "text-anchor", "font-size", "font-weight", "fill"], Ke = ["x", "y", "font-size", "font-weight", "fill"], Qe = { key: 1 }, et = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], tt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], at = ["x1", "y1", "x2", "y2", "stroke-width", "filter"], lt = { key: 2 }, st = ["d", "fill", "stroke", "stroke-width"], rt = ["cx", "cy", "fill", "r", "stroke-width", "stroke"], ot = ["x", "y", "font-size", "fill"], ut = {
11
11
  key: 3,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-NvxTr0fZ.cjs"),Y=require("./useResponsive-B3TrDDIG.cjs"),R=require("./usePrinter-0s8wVGIy.cjs"),J=require("./vue-ui-skeleton-DYHqPo98.cjs"),K=require("./Title-Cjusozo5.cjs"),D=require("./useNestedProp-DhLxBAwX.cjs"),Q=require("./PackageVersion-rOhPenOY.cjs"),ee=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),te=["id"],ae={key:0},le=["xmlns","viewBox"],re=["id"],oe=["stop-color"],ne=["stop-color"],se=["stop-color"],ue=["id"],ie=["stdDeviation"],ce=["d","fill","stroke"],de=["d","filter"],ve=["x","y","text-anchor","font-size","font-weight","fill"],he=["x","y","font-size","font-weight","fill"],fe={key:1},pe=["x1","y1","x2","y2","stroke","stroke-width"],me=["x1","y1","x2","y2","stroke","stroke-width"],ye=["x1","y1","x2","y2","stroke-width","filter"],ge={key:2},ke=["d","fill","stroke","stroke-width"],be=["cx","cy","fill","r","stroke-width","stroke"],_e=["x","y","font-size","fill"],xe={key:3,class:"vue-data-ui-watermark"},Se={__name:"vue-ui-gauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(w,{expose:G}){const s=w,{vue_ui_gauge:j}=o.useConfig(),k=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length>0&&s.dataset.series&&s.dataset.series.length),h=e.ref(o.createUid()),q=e.ref(null),C=e.ref(0),b=e.ref(null),z=e.ref(null),B=e.ref(null),N=e.ref(0),t=e.computed({get:()=>P(),set:l=>l});e.watch(()=>s.config,l=>{t.value=P(),V(),N.value+=1},{deep:!0});function P(){const l=D.useNestedProp({userConfig:s.config,defaultConfig:j});return l.theme?{...D.useNestedProp({userConfig:o.themes.vue_ui_gauge[l.theme]||s.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}const{isPrinting:E,isImaging:M,generatePdf:$,generateImage:I}=R.usePrinter({elementId:`vue-ui-gauge_${h.value}`,fileName:t.value.style.chart.title.text||"vue-ui-gauge"}),A=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),p=e.computed(()=>{if(!k.value||o.objectIsEmpty(s.dataset.series||{}))return{value:0,series:[{from:0,to:0}]};const l=[];(s.dataset.series||[]).forEach(r=>{l.push(r.from||0),l.push(r.to||0)});const n=Math.max(...l);return{...s.dataset,series:(s.dataset.series||[]).map((r,i)=>({...r,color:o.convertColorToHex(r.color)||A.value[i]||o.palette[i],value:((r.to||0)-(r.from||0))/n*100}))}}),v=e.ref(512),a=e.ref({height:358.4,width:v.value,top:0,bottom:358.4,centerX:179.2,centerY:v.value/2,labelFontSize:18,legendFontSize:t.value.style.chart.legend.fontSize,pointerRadius:t.value.style.chart.layout.pointer.circle.radius,trackSize:t.value.style.chart.layout.track.size,pointerSize:t.value.style.chart.layout.pointer.size,pointerStrokeWidth:t.value.style.chart.layout.pointer.strokeWidth,markerOffset:t.value.style.chart.layout.markers.offsetY+3}),_=e.ref(0),y=e.ref(0),c=e.ref(t.value.style.chart.animation.use?0:s.dataset.value);e.watch(()=>s.dataset.value,()=>{X(s.dataset.value)});const d=e.computed(()=>{const l=a.value.width/2,n=u.value.base,r=Math.PI*((c.value+0-y.value)/(_.value-y.value))+Math.PI;return{x1:l,y1:n,x2:l+u.value.pointerSize*a.value.pointerSize*.9*Math.cos(r),y2:n+u.value.pointerSize*a.value.pointerSize*.9*Math.sin(r)}}),O=e.computed(()=>{const l=a.value.width/2,n=u.value.base,r=Math.PI*((c.value+0-y.value)/(_.value-y.value))+Math.PI,i=l+u.value.pointerSize*a.value.pointerSize*.9*Math.cos(r),S=n+u.value.pointerSize*a.value.pointerSize*.9*Math.sin(r),f=a.value.pointerRadius,W=l+f*Math.cos(r+Math.PI/2),T=n+f*Math.sin(r+Math.PI/2),H=l+f*Math.cos(r-Math.PI/2),Z=n+f*Math.sin(r-Math.PI/2);return isNaN(i)?null:`M ${i},${S} ${W},${T} ${H},${Z} Z`}),F=e.computed(()=>{for(let l=0;l<p.value.series.length;l+=1){const{color:n,from:r,to:i}=p.value.series[l];if(c.value>=r&&c.value<=i)return n}return"#2D353C"}),x=e.ref(null);function V(){if(o.objectIsEmpty(s.dataset)?o.error({componentName:"VueUiGauge",type:"dataset"}):(o.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","series"]}).forEach(l=>{o.error({componentName:"VueUiGauge",type:"datasetAttribute",property:l})}),Object.hasOwn(s.dataset,"series")&&(s.dataset.series.length?s.dataset.series.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["from","to"]}).forEach(r=>{o.error({componentName:"VueUiGauge",type:"datasetSerieAttribute",property:r,index:n})})}):o.error({componentName:"VueUiGauge",type:"datasetAttributeEmpty",property:"series"}))),X(s.dataset.value||0),t.value.responsive){const l=Y.throttle(()=>{const{width:n,height:r}=Y.useResponsive({chart:b.value,title:t.value.style.chart.title.text?z.value:null,legend:B.value});a.value.width=n,a.value.height=r,a.value.centerX=n/2,a.value.centerY=v.value/2/358.4*r,a.value.bottom=r,a.value.labelFontSize=18/v.value*Math.min(r,n)<10?10:18/v.value*Math.min(r,n),a.value.legendFontSize=t.value.style.chart.legend.fontSize/v.value*Math.min(r,n)<14?14:t.value.style.chart.legend.fontSize/v.value*Math.min(r,n),a.value.pointerRadius=t.value.style.chart.layout.pointer.circle.radius/v.value*Math.min(r,n),a.value.trackSize=t.value.style.chart.layout.track.size/v.value*Math.min(r,n),a.value.pointerStrokeWidth=o.translateSize({relator:Math.min(n,r),adjuster:v.value,source:t.value.style.chart.layout.pointer.strokeWidth,threshold:2,fallback:2}),a.value.markerOffset=o.translateSize({relator:Math.max(n,r),adjuster:v.value,source:t.value.style.chart.layout.markers.offsetY+3,threshold:2,fallback:2})});x.value=new ResizeObserver(l),x.value.observe(b.value.parentNode)}}e.onMounted(()=>{V()}),e.onBeforeUnmount(()=>{x.value&&x.value.disconnect()});function X(l){const n=[];(p.value.series||[]).forEach(f=>{n.push(f.from||0),n.push(f.to||0)}),_.value=Math.max(...n),y.value=Math.min(...n);let r=t.value.style.chart.animation.speed;const i=Math.abs(l-c.value)/(r*60);function S(){c.value<l?c.value=Math.min(c.value+i,l):c.value>l&&(c.value=Math.max(c.value-i,l)),c.value!==l&&requestAnimationFrame(S)}S()}const u=e.computed(()=>{const l=t.value.responsive?Math.min(a.value.width,a.value.height):a.value.width;return{arcs:l/2.5,gradients:l/2.75,base:t.value.responsive?a.value.height/2:a.value.height*.7,ratingBase:t.value.responsive?a.value.height/2+a.value.height/4:a.value.height*.9,pointerSize:t.value.responsive?Math.min(a.value.width,a.value.height)/3:a.value.width/3.2}}),m=e.computed(()=>o.makeDonut({series:p.value.series},a.value.width/2,u.value.base,u.value.arcs,u.value.arcs,1,1,1,180,109.9495,40*a.value.trackSize)),L=e.computed(()=>o.makeDonut({series:p.value.series},a.value.width/2,u.value.base,u.value.gradients,u.value.gradients,.95,1,1,180,110.02,2*a.value.trackSize)),g=e.ref(!1);function U(l){g.value=l,C.value+=1}return G({generatePdf:$,generateImage:I}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-gauge ${g.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"gaugeChart",ref:b,id:`vue-ui-gauge_${h.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:z,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(K._sfc_main,{key:`title_${N.value}`,config:{title:{cy:"gauge-div-title",...t.value.style.chart.title},subtitle:{cy:"gauge-div-subtitle",...t.value.style.chart.title.subtitle}}},{default:e.withCtx(()=>[t.value.translations.base&&w.dataset.base?(e.openBlock(),e.createElementBlock("span",ae,e.toDisplayString(t.value.translations.base)+": "+e.toDisplayString(w.dataset.base),1)):e.createCommentVNode("",!0)]),_:1},8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&k.value?(e.openBlock(),e.createBlock(R.UserOptions,{ref_key:"details",ref:q,key:`user_options_${C.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(M),isPrinting:e.unref(E),uid:h.value,hasXls:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,position:t.value.userOptions.position,onToggleFullscreen:U,onGeneratePdf:e.unref($),onGenerateImage:e.unref(I)},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:r,isFullscreen:i})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:r,isFullscreen:i})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:hidden !important;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Q._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`gradient_${h.value}`,cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)("#FFFFFF",1)},null,8,oe),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)("#FFFFFF",t.value.style.chart.layout.track.gradientIntensity)},null,8,ne),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)("#FFFFFF",1)},null,8,se)],8,re)]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${h.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.track.gradientIntensity},null,8,ie)],8,ue)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(r,i)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${i}`,d:r.arcSlice,fill:r.color,stroke:t.value.style.chart.backgroundColor,"stroke-linecap":"round"},null,8,ce))),128)),t.value.style.chart.layout.track.useGradient?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(L.value,(r,i)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${i}`,d:r.arcSlice,fill:"#FFFFFF",stroke:"none","stroke-linecap":"round",filter:`url(#blur_${h.value})`},null,8,de))),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(r,i)=>(e.openBlock(),e.createElementBlock("text",{x:e.unref(o.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:r.center.startX,initY:r.center.startY,offset:a.value.markerOffset}).x,y:e.unref(o.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:r.center.startX,initY:r.center.startY,offset:a.value.markerOffset}).y,"text-anchor":r.center.startX<a.value.width/2-5?"end":r.center.startX>a.value.width/2+5?"start":"middle","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(r.from.toFixed(t.value.style.chart.layout.markers.roundingValue)),9,ve))),256)),e.createElementVNode("text",{x:e.unref(o.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:m.value.at(-1).endX,initY:m.value.at(-1).endY,offset:a.value.markerOffset}).x,y:e.unref(o.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:m.value.at(-1).endX,initY:m.value.at(-1).endY,offset:a.value.markerOffset}).y,"text-anchor":"start","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(_.value.toFixed(t.value.style.chart.layout.markers.roundingValue)),9,he),t.value.style.chart.layout.pointer.type==="rounded"?(e.openBlock(),e.createElementBlock("g",fe,[isNaN(d.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:0,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":a.value.pointerStrokeWidth,"stroke-linecap":"round"},null,8,pe)),isNaN(d.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:1,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,"stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.7},null,8,me)),!isNaN(d.value.x2)&&t.value.style.chart.layout.track.useGradient?(e.openBlock(),e.createElementBlock("line",{key:2,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:"white","stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.3,filter:`url(#blur_${h.value})`},null,8,ye)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("g",ge,[O.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:O.value,fill:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,"stroke-linejoin":"round"},null,8,ke)):e.createCommentVNode("",!0)])),e.createElementVNode("circle",{cx:a.value.width/2,cy:u.value.base,fill:t.value.style.chart.layout.pointer.circle.color,r:a.value.pointerRadius<=0?1e-4:a.value.pointerRadius,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,stroke:t.value.style.chart.layout.pointer.circle.stroke},null,8,be),e.createElementVNode("text",{x:a.value.width/2,y:u.value.ratingBase,"text-anchor":"middle","font-size":a.value.legendFontSize,"font-weight":"bold",fill:t.value.style.chart.legend.useRatingColor?F.value:t.value.style.chart.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.legend.formatter,c.value,e.unref(o.dataLabel)({p:t.value.style.chart.legend.prefix+(t.value.style.chart.legend.showPlusSymbol&&c.value>0?"+":""),v:c.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}))),9,_e),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,le)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(E)||e.unref(M)})),void 0,!0)])):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(J.default,{key:4,config:{type:"gauge",style:{backgroundColor:t.value.style.chart.backgroundColor,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:B},[e.renderSlot(l.$slots,"legend",{legend:p.value},void 0,!0)],512)],14,te))}},we=ee._export_sfc(Se,[["__scopeId","data-v-2575317d"]]);exports.default=we;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-xtIm3ydy.cjs"),Y=require("./useResponsive-B3TrDDIG.cjs"),R=require("./usePrinter-BrE53tUa.cjs"),J=require("./vue-ui-skeleton-g8cEqYmt.cjs"),K=require("./Title-spYln43E.cjs"),D=require("./useNestedProp-XzXFHriE.cjs"),Q=require("./PackageVersion-DMkpXFFU.cjs"),ee=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),te=["id"],ae={key:0},le=["xmlns","viewBox"],re=["id"],oe=["stop-color"],ne=["stop-color"],se=["stop-color"],ue=["id"],ie=["stdDeviation"],ce=["d","fill","stroke"],de=["d","filter"],ve=["x","y","text-anchor","font-size","font-weight","fill"],he=["x","y","font-size","font-weight","fill"],fe={key:1},pe=["x1","y1","x2","y2","stroke","stroke-width"],me=["x1","y1","x2","y2","stroke","stroke-width"],ye=["x1","y1","x2","y2","stroke-width","filter"],ge={key:2},ke=["d","fill","stroke","stroke-width"],be=["cx","cy","fill","r","stroke-width","stroke"],_e=["x","y","font-size","fill"],xe={key:3,class:"vue-data-ui-watermark"},Se={__name:"vue-ui-gauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(w,{expose:G}){const s=w,{vue_ui_gauge:j}=o.useConfig(),k=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length>0&&s.dataset.series&&s.dataset.series.length),h=e.ref(o.createUid()),q=e.ref(null),C=e.ref(0),b=e.ref(null),z=e.ref(null),B=e.ref(null),N=e.ref(0),t=e.computed({get:()=>P(),set:l=>l});e.watch(()=>s.config,l=>{t.value=P(),V(),N.value+=1},{deep:!0});function P(){const l=D.useNestedProp({userConfig:s.config,defaultConfig:j});return l.theme?{...D.useNestedProp({userConfig:o.themes.vue_ui_gauge[l.theme]||s.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}const{isPrinting:E,isImaging:M,generatePdf:$,generateImage:I}=R.usePrinter({elementId:`vue-ui-gauge_${h.value}`,fileName:t.value.style.chart.title.text||"vue-ui-gauge"}),A=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),p=e.computed(()=>{if(!k.value||o.objectIsEmpty(s.dataset.series||{}))return{value:0,series:[{from:0,to:0}]};const l=[];(s.dataset.series||[]).forEach(r=>{l.push(r.from||0),l.push(r.to||0)});const n=Math.max(...l);return{...s.dataset,series:(s.dataset.series||[]).map((r,i)=>({...r,color:o.convertColorToHex(r.color)||A.value[i]||o.palette[i],value:((r.to||0)-(r.from||0))/n*100}))}}),v=e.ref(512),a=e.ref({height:358.4,width:v.value,top:0,bottom:358.4,centerX:179.2,centerY:v.value/2,labelFontSize:18,legendFontSize:t.value.style.chart.legend.fontSize,pointerRadius:t.value.style.chart.layout.pointer.circle.radius,trackSize:t.value.style.chart.layout.track.size,pointerSize:t.value.style.chart.layout.pointer.size,pointerStrokeWidth:t.value.style.chart.layout.pointer.strokeWidth,markerOffset:t.value.style.chart.layout.markers.offsetY+3}),_=e.ref(0),y=e.ref(0),c=e.ref(t.value.style.chart.animation.use?0:s.dataset.value);e.watch(()=>s.dataset.value,()=>{X(s.dataset.value)});const d=e.computed(()=>{const l=a.value.width/2,n=u.value.base,r=Math.PI*((c.value+0-y.value)/(_.value-y.value))+Math.PI;return{x1:l,y1:n,x2:l+u.value.pointerSize*a.value.pointerSize*.9*Math.cos(r),y2:n+u.value.pointerSize*a.value.pointerSize*.9*Math.sin(r)}}),O=e.computed(()=>{const l=a.value.width/2,n=u.value.base,r=Math.PI*((c.value+0-y.value)/(_.value-y.value))+Math.PI,i=l+u.value.pointerSize*a.value.pointerSize*.9*Math.cos(r),S=n+u.value.pointerSize*a.value.pointerSize*.9*Math.sin(r),f=a.value.pointerRadius,W=l+f*Math.cos(r+Math.PI/2),T=n+f*Math.sin(r+Math.PI/2),H=l+f*Math.cos(r-Math.PI/2),Z=n+f*Math.sin(r-Math.PI/2);return isNaN(i)?null:`M ${i},${S} ${W},${T} ${H},${Z} Z`}),F=e.computed(()=>{for(let l=0;l<p.value.series.length;l+=1){const{color:n,from:r,to:i}=p.value.series[l];if(c.value>=r&&c.value<=i)return n}return"#2D353C"}),x=e.ref(null);function V(){if(o.objectIsEmpty(s.dataset)?o.error({componentName:"VueUiGauge",type:"dataset"}):(o.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","series"]}).forEach(l=>{o.error({componentName:"VueUiGauge",type:"datasetAttribute",property:l})}),Object.hasOwn(s.dataset,"series")&&(s.dataset.series.length?s.dataset.series.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["from","to"]}).forEach(r=>{o.error({componentName:"VueUiGauge",type:"datasetSerieAttribute",property:r,index:n})})}):o.error({componentName:"VueUiGauge",type:"datasetAttributeEmpty",property:"series"}))),X(s.dataset.value||0),t.value.responsive){const l=Y.throttle(()=>{const{width:n,height:r}=Y.useResponsive({chart:b.value,title:t.value.style.chart.title.text?z.value:null,legend:B.value});a.value.width=n,a.value.height=r,a.value.centerX=n/2,a.value.centerY=v.value/2/358.4*r,a.value.bottom=r,a.value.labelFontSize=18/v.value*Math.min(r,n)<10?10:18/v.value*Math.min(r,n),a.value.legendFontSize=t.value.style.chart.legend.fontSize/v.value*Math.min(r,n)<14?14:t.value.style.chart.legend.fontSize/v.value*Math.min(r,n),a.value.pointerRadius=t.value.style.chart.layout.pointer.circle.radius/v.value*Math.min(r,n),a.value.trackSize=t.value.style.chart.layout.track.size/v.value*Math.min(r,n),a.value.pointerStrokeWidth=o.translateSize({relator:Math.min(n,r),adjuster:v.value,source:t.value.style.chart.layout.pointer.strokeWidth,threshold:2,fallback:2}),a.value.markerOffset=o.translateSize({relator:Math.max(n,r),adjuster:v.value,source:t.value.style.chart.layout.markers.offsetY+3,threshold:2,fallback:2})});x.value=new ResizeObserver(l),x.value.observe(b.value.parentNode)}}e.onMounted(()=>{V()}),e.onBeforeUnmount(()=>{x.value&&x.value.disconnect()});function X(l){const n=[];(p.value.series||[]).forEach(f=>{n.push(f.from||0),n.push(f.to||0)}),_.value=Math.max(...n),y.value=Math.min(...n);let r=t.value.style.chart.animation.speed;const i=Math.abs(l-c.value)/(r*60);function S(){c.value<l?c.value=Math.min(c.value+i,l):c.value>l&&(c.value=Math.max(c.value-i,l)),c.value!==l&&requestAnimationFrame(S)}S()}const u=e.computed(()=>{const l=t.value.responsive?Math.min(a.value.width,a.value.height):a.value.width;return{arcs:l/2.5,gradients:l/2.75,base:t.value.responsive?a.value.height/2:a.value.height*.7,ratingBase:t.value.responsive?a.value.height/2+a.value.height/4:a.value.height*.9,pointerSize:t.value.responsive?Math.min(a.value.width,a.value.height)/3:a.value.width/3.2}}),m=e.computed(()=>o.makeDonut({series:p.value.series},a.value.width/2,u.value.base,u.value.arcs,u.value.arcs,1,1,1,180,109.9495,40*a.value.trackSize)),L=e.computed(()=>o.makeDonut({series:p.value.series},a.value.width/2,u.value.base,u.value.gradients,u.value.gradients,.95,1,1,180,110.02,2*a.value.trackSize)),g=e.ref(!1);function U(l){g.value=l,C.value+=1}return G({generatePdf:$,generateImage:I}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-gauge ${g.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"gaugeChart",ref:b,id:`vue-ui-gauge_${h.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:z,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(K._sfc_main,{key:`title_${N.value}`,config:{title:{cy:"gauge-div-title",...t.value.style.chart.title},subtitle:{cy:"gauge-div-subtitle",...t.value.style.chart.title.subtitle}}},{default:e.withCtx(()=>[t.value.translations.base&&w.dataset.base?(e.openBlock(),e.createElementBlock("span",ae,e.toDisplayString(t.value.translations.base)+": "+e.toDisplayString(w.dataset.base),1)):e.createCommentVNode("",!0)]),_:1},8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&k.value?(e.openBlock(),e.createBlock(R.UserOptions,{ref_key:"details",ref:q,key:`user_options_${C.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(M),isPrinting:e.unref(E),uid:h.value,hasXls:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,position:t.value.userOptions.position,onToggleFullscreen:U,onGeneratePdf:e.unref($),onGenerateImage:e.unref(I)},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:r,isFullscreen:i})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:r,isFullscreen:i})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:hidden !important;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Q._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`gradient_${h.value}`,cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)("#FFFFFF",1)},null,8,oe),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)("#FFFFFF",t.value.style.chart.layout.track.gradientIntensity)},null,8,ne),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)("#FFFFFF",1)},null,8,se)],8,re)]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${h.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:100/t.value.style.chart.layout.track.gradientIntensity},null,8,ie)],8,ue)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(r,i)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${i}`,d:r.arcSlice,fill:r.color,stroke:t.value.style.chart.backgroundColor,"stroke-linecap":"round"},null,8,ce))),128)),t.value.style.chart.layout.track.useGradient?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(L.value,(r,i)=>(e.openBlock(),e.createElementBlock("path",{key:`arc_${i}`,d:r.arcSlice,fill:"#FFFFFF",stroke:"none","stroke-linecap":"round",filter:`url(#blur_${h.value})`},null,8,de))),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(r,i)=>(e.openBlock(),e.createElementBlock("text",{x:e.unref(o.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:r.center.startX,initY:r.center.startY,offset:a.value.markerOffset}).x,y:e.unref(o.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:r.center.startX,initY:r.center.startY,offset:a.value.markerOffset}).y,"text-anchor":r.center.startX<a.value.width/2-5?"end":r.center.startX>a.value.width/2+5?"start":"middle","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(r.from.toFixed(t.value.style.chart.layout.markers.roundingValue)),9,ve))),256)),e.createElementVNode("text",{x:e.unref(o.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:m.value.at(-1).endX,initY:m.value.at(-1).endY,offset:a.value.markerOffset}).x,y:e.unref(o.offsetFromCenterPoint)({centerX:a.value.width/2,centerY:u.value.base,initX:m.value.at(-1).endX,initY:m.value.at(-1).endY,offset:a.value.markerOffset}).y,"text-anchor":"start","font-size":a.value.labelFontSize*t.value.style.chart.layout.markers.fontSizeRatio,"font-weight":`${t.value.style.chart.layout.markers.bold?"bold":"normal"}`,fill:t.value.style.chart.layout.markers.color},e.toDisplayString(_.value.toFixed(t.value.style.chart.layout.markers.roundingValue)),9,he),t.value.style.chart.layout.pointer.type==="rounded"?(e.openBlock(),e.createElementBlock("g",fe,[isNaN(d.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:0,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":a.value.pointerStrokeWidth,"stroke-linecap":"round"},null,8,pe)),isNaN(d.value.x2)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("line",{key:1,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,"stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.7},null,8,me)),!isNaN(d.value.x2)&&t.value.style.chart.layout.track.useGradient?(e.openBlock(),e.createElementBlock("line",{key:2,x1:d.value.x1,y1:d.value.y1,x2:d.value.x2,y2:d.value.y2,stroke:"white","stroke-linecap":"round","stroke-width":a.value.pointerStrokeWidth*.3,filter:`url(#blur_${h.value})`},null,8,ye)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("g",ge,[O.value?(e.openBlock(),e.createElementBlock("path",{key:0,d:O.value,fill:t.value.style.chart.layout.pointer.useRatingColor?F.value:t.value.style.chart.layout.pointer.color,stroke:t.value.style.chart.layout.pointer.stroke,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,"stroke-linejoin":"round"},null,8,ke)):e.createCommentVNode("",!0)])),e.createElementVNode("circle",{cx:a.value.width/2,cy:u.value.base,fill:t.value.style.chart.layout.pointer.circle.color,r:a.value.pointerRadius<=0?1e-4:a.value.pointerRadius,"stroke-width":t.value.style.chart.layout.pointer.circle.strokeWidth,stroke:t.value.style.chart.layout.pointer.circle.stroke},null,8,be),e.createElementVNode("text",{x:a.value.width/2,y:u.value.ratingBase,"text-anchor":"middle","font-size":a.value.legendFontSize,"font-weight":"bold",fill:t.value.style.chart.legend.useRatingColor?F.value:t.value.style.chart.legend.color},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.legend.formatter,c.value,e.unref(o.dataLabel)({p:t.value.style.chart.legend.prefix+(t.value.style.chart.legend.showPlusSymbol&&c.value>0?"+":""),v:c.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}))),9,_e),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,le)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",xe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(E)||e.unref(M)})),void 0,!0)])):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(J.default,{key:4,config:{type:"gauge",style:{backgroundColor:t.value.style.chart.backgroundColor,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:B},[e.renderSlot(l.$slots,"legend",{legend:p.value},void 0,!0)],512)],14,te))}},we=ee._export_sfc(Se,[["__scopeId","data-v-2575317d"]]);exports.default=we;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-NvxTr0fZ.cjs"),m=require("./useNestedProp-DhLxBAwX.cjs"),_=require("./PackageVersion-rOhPenOY.cjs"),k=["viewBox","width"],p={key:0},g=["id"],v=["stop-color"],y=["stop-color"],N=["stroke"],C=["stroke"],V=["width","fill"],w=["fill"],x={key:0},B=["id"],E=e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:1},null,-1),b=[E],L=["stroke"],z=["stroke","stroke-dasharray","stroke-dashoffset"],G=["filter"],F=["stroke","stroke-dasharray","stroke-dashoffset"],P=["fill"],$={__name:"vue-ui-gizmo",props:{config:{type:Object,default(){return{}}},dataset:{type:Number,default:0}},setup(i){const o=i,{vue_ui_gizmo:f}=a.useConfig(),n=e.ref(a.createUid());e.onMounted(()=>{c()});function c(){!o.dataset&&o.dataset!==0&&a.error({componentName:"VueUiGizmo",type:"dataset"}),o.dataset<0&&console.warn("VueUiGizmo: dataset cannot be negative.")}const t=e.computed({get:()=>d(),set:r=>r});function d(){return m.useNestedProp({userConfig:o.config,defaultConfig:f})}e.watch(()=>o.config,r=>{t.value=d(),c()},{deep:!0});const u=e.computed(()=>({battery:{width:t.value.showPercentage?140:80,height:50},gauge:{width:80,height:80}})[t.value.type]),l=e.computed(()=>{const s=2*Math.PI*35,h=s-o.dataset/100*s;return{dasharray:`${s} ${s}`,dashoffset:h}});return(r,s)=>(e.openBlock(),e.createElementBlock("svg",{class:"vue-ui-gizmo",viewBox:`0 0 ${u.value.width} ${u.value.height}`,width:t.value.size,style:e.normalizeStyle({background:"transparent",fontFamily:t.value.fontFamily})},[e.createVNode(_._sfc_main),t.value.useGradient?(e.openBlock(),e.createElementBlock("defs",p,[e.createElementVNode("linearGradient",{id:`gizmo_gradient_${n.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.gradientColor},null,8,v),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.color},null,8,y)],8,g)])):e.createCommentVNode("",!0),t.value.type==="battery"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("path",{d:"M 5 10 L 5 40 C 5 43 7 45 9 45 L 65 45 C 68 45 70 43 70 40 L 70 38 C 73 38 75 38 75 33 L 75 17 C 75 12 73 12 70 12 L 70 10 C 70 7 68 5 65 5 L 10 5 C 7 5 5 7 5 10",stroke:t.value.stroke,"stroke-width":2,fill:"none"},null,8,N),e.createElementVNode("path",{d:"M 70 16 L 70 34",stroke:t.value.stroke,"stroke-width":2,fill:"none",style:{opacity:"0.5"}},null,8,C),e.createElementVNode("rect",{x:10,y:10,height:30,width:55*(i.dataset/100),fill:t.value.useGradient?`url(#gizmo_gradient_${n.value})`:t.value.color,rx:2},null,8,V),t.value.showPercentage?(e.openBlock(),e.createElementBlock("text",{key:0,x:85,y:32,"text-anchor":"start","font-size":"20",fill:t.value.textColor},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.formatter,o.dataset,e.unref(a.dataLabel)({v:o.dataset,s:"%"}))),9,w)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.type==="gauge"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[t.value.useGradient?(e.openBlock(),e.createElementBlock("defs",x,[e.createElementVNode("filter",{id:`blur_${n.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},b,8,B)])):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:40,cy:40,r:35,stroke:t.value.stroke,"stroke-width":2*4,fill:"none"},null,8,L),e.createElementVNode("circle",{cx:40,cy:40,r:35,stroke:t.value.color,"stroke-width":2*4,"stroke-dasharray":l.value.dasharray,"stroke-dashoffset":l.value.dashoffset,"stroke-linecap":"round",fill:"none",style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,8,z),t.value.useGradient?(e.openBlock(),e.createElementBlock("g",{key:1,filter:`url(#blur_${n.value})`},[e.createElementVNode("circle",{cx:40,cy:40,r:35,stroke:t.value.gradientColor,"stroke-width":1,fill:"none","stroke-dasharray":l.value.dasharray,"stroke-dashoffset":l.value.dashoffset,style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,8,F)],8,G)):e.createCommentVNode("",!0),t.value.showPercentage?(e.openBlock(),e.createElementBlock("text",{key:2,x:40,y:47,"text-anchor":"middle","font-size":"20",fill:t.value.textColor},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.formatter,o.dataset,e.unref(a.dataLabel)({v:o.dataset,s:"%"}))),9,P)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],12,k))}};exports.default=$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-xtIm3ydy.cjs"),m=require("./useNestedProp-XzXFHriE.cjs"),_=require("./PackageVersion-DMkpXFFU.cjs"),k=["viewBox","width"],p={key:0},g=["id"],v=["stop-color"],y=["stop-color"],N=["stroke"],C=["stroke"],V=["width","fill"],w=["fill"],x={key:0},B=["id"],E=e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:1},null,-1),b=[E],L=["stroke"],z=["stroke","stroke-dasharray","stroke-dashoffset"],G=["filter"],F=["stroke","stroke-dasharray","stroke-dashoffset"],P=["fill"],$={__name:"vue-ui-gizmo",props:{config:{type:Object,default(){return{}}},dataset:{type:Number,default:0}},setup(i){const o=i,{vue_ui_gizmo:f}=a.useConfig(),n=e.ref(a.createUid());e.onMounted(()=>{c()});function c(){!o.dataset&&o.dataset!==0&&a.error({componentName:"VueUiGizmo",type:"dataset"}),o.dataset<0&&console.warn("VueUiGizmo: dataset cannot be negative.")}const t=e.computed({get:()=>d(),set:r=>r});function d(){return m.useNestedProp({userConfig:o.config,defaultConfig:f})}e.watch(()=>o.config,r=>{t.value=d(),c()},{deep:!0});const u=e.computed(()=>({battery:{width:t.value.showPercentage?140:80,height:50},gauge:{width:80,height:80}})[t.value.type]),l=e.computed(()=>{const s=2*Math.PI*35,h=s-o.dataset/100*s;return{dasharray:`${s} ${s}`,dashoffset:h}});return(r,s)=>(e.openBlock(),e.createElementBlock("svg",{class:"vue-ui-gizmo",viewBox:`0 0 ${u.value.width} ${u.value.height}`,width:t.value.size,style:e.normalizeStyle({background:"transparent",fontFamily:t.value.fontFamily})},[e.createVNode(_._sfc_main),t.value.useGradient?(e.openBlock(),e.createElementBlock("defs",p,[e.createElementVNode("linearGradient",{id:`gizmo_gradient_${n.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.gradientColor},null,8,v),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.color},null,8,y)],8,g)])):e.createCommentVNode("",!0),t.value.type==="battery"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("path",{d:"M 5 10 L 5 40 C 5 43 7 45 9 45 L 65 45 C 68 45 70 43 70 40 L 70 38 C 73 38 75 38 75 33 L 75 17 C 75 12 73 12 70 12 L 70 10 C 70 7 68 5 65 5 L 10 5 C 7 5 5 7 5 10",stroke:t.value.stroke,"stroke-width":2,fill:"none"},null,8,N),e.createElementVNode("path",{d:"M 70 16 L 70 34",stroke:t.value.stroke,"stroke-width":2,fill:"none",style:{opacity:"0.5"}},null,8,C),e.createElementVNode("rect",{x:10,y:10,height:30,width:55*(i.dataset/100),fill:t.value.useGradient?`url(#gizmo_gradient_${n.value})`:t.value.color,rx:2},null,8,V),t.value.showPercentage?(e.openBlock(),e.createElementBlock("text",{key:0,x:85,y:32,"text-anchor":"start","font-size":"20",fill:t.value.textColor},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.formatter,o.dataset,e.unref(a.dataLabel)({v:o.dataset,s:"%"}))),9,w)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.type==="gauge"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[t.value.useGradient?(e.openBlock(),e.createElementBlock("defs",x,[e.createElementVNode("filter",{id:`blur_${n.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},b,8,B)])):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:40,cy:40,r:35,stroke:t.value.stroke,"stroke-width":2*4,fill:"none"},null,8,L),e.createElementVNode("circle",{cx:40,cy:40,r:35,stroke:t.value.color,"stroke-width":2*4,"stroke-dasharray":l.value.dasharray,"stroke-dashoffset":l.value.dashoffset,"stroke-linecap":"round",fill:"none",style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,8,z),t.value.useGradient?(e.openBlock(),e.createElementBlock("g",{key:1,filter:`url(#blur_${n.value})`},[e.createElementVNode("circle",{cx:40,cy:40,r:35,stroke:t.value.gradientColor,"stroke-width":1,fill:"none","stroke-dasharray":l.value.dasharray,"stroke-dashoffset":l.value.dashoffset,style:{transform:"rotate(-90deg)","transform-origin":"50% 50%"}},null,8,F)],8,G)):e.createCommentVNode("",!0),t.value.showPercentage?(e.openBlock(),e.createElementBlock("text",{key:2,x:40,y:47,"text-anchor":"middle","font-size":"20",fill:t.value.textColor},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.formatter,o.dataset,e.unref(a.dataLabel)({v:o.dataset,s:"%"}))),9,P)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],12,k))}};exports.default=$;
@@ -1,7 +1,7 @@
1
1
  import { ref as x, onMounted as C, computed as c, watch as z, openBlock as a, createElementBlock as s, normalizeStyle as G, createVNode as L, createElementVNode as t, createCommentVNode as r, Fragment as g, toDisplayString as y, unref as d } from "vue";
2
- import { u as b, c as N, e as $, i as p, f as m } from "./index-BJNSbAx7.js";
3
- import { u as F } from "./useNestedProp-CLh4tPxT.js";
4
- import { _ as B } from "./PackageVersion-DN8qp-uI.js";
2
+ import { u as b, c as N, e as $, i as p, f as m } from "./index-CHn5mpNE.js";
3
+ import { u as F } from "./useNestedProp-BF5raFbY.js";
4
+ import { _ as B } from "./PackageVersion-B2pJ6f4s.js";
5
5
  const P = ["viewBox", "width"], V = { key: 0 }, D = ["id"], I = ["stop-color"], M = ["stop-color"], U = ["stroke"], E = ["stroke"], O = ["width", "fill"], S = ["fill"], A = { key: 0 }, j = ["id"], T = /* @__PURE__ */ t("feGaussianBlur", {
6
6
  in: "SourceGraphic",
7
7
  stdDeviation: 1