vue-data-ui 2.3.76 → 2.3.78

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 (161) hide show
  1. package/dist/{Arrow-DY9RKUmG.js → Arrow-BCYtOwX7.js} +1 -1
  2. package/dist/{Arrow-D7M4-bW7.cjs → Arrow-DWkvIpW8.cjs} +1 -1
  3. package/dist/{BaseIcon-rwm-10Hu.js → BaseIcon-BIQXWVMS.js} +1 -1
  4. package/dist/{BaseIcon-DB7Apwv_.cjs → BaseIcon-Bcpzfk34.cjs} +1 -1
  5. package/dist/{DataTable-CsNozyz7.cjs → DataTable-C5TOiC61.cjs} +1 -1
  6. package/dist/{DataTable-e2fnfjXV.js → DataTable-y1lX5jVj.js} +2 -2
  7. package/dist/{Legend-5cQ0xZjK.js → Legend-BLXcdrri.js} +1 -1
  8. package/dist/{Legend-DgFd-O0m.cjs → Legend-CGGD8NhP.cjs} +1 -1
  9. package/dist/{Shape-CiTElr_0.js → Shape-CsoTtJx6.js} +1 -1
  10. package/dist/{Shape-yPECDLiP.cjs → Shape-qJYTY2BC.cjs} +1 -1
  11. package/dist/{Slicer-DaZgCKV7.cjs → Slicer-CZJXKSeE.cjs} +1 -1
  12. package/dist/{Slicer-DwBBu3kB.js → Slicer-DzJZ4axa.js} +12 -12
  13. package/dist/{Title-3EduyW4p.cjs → Title-BSpa3uge.cjs} +1 -1
  14. package/dist/{Title-gUz6GDA3.js → Title-Bx-VO3md.js} +1 -1
  15. package/dist/{Tooltip-DfSM1mNP.js → Tooltip-Dk-cimhQ.js} +23 -23
  16. package/dist/Tooltip-rmhZhv96.cjs +1 -0
  17. package/dist/index-CzjC8LfY.cjs +4 -0
  18. package/dist/{index-CaV1s-yZ.js → index-DP8dqFNd.js} +1147 -1145
  19. package/dist/style.css +1 -1
  20. package/dist/{useNestedProp-tWCzZrLx.js → useNestedProp-B-oZxD4x.js} +1 -1
  21. package/dist/{useNestedProp-CisbRRo_.cjs → useNestedProp-CY7DebVH.cjs} +1 -1
  22. package/dist/{usePrinter-DzTaA1eh.cjs → usePrinter-DiLM6jav.cjs} +1 -1
  23. package/dist/{usePrinter-rvJyT65A.js → usePrinter-DiuHo4LO.js} +1 -1
  24. package/dist/{vue-data-ui-BGkWRPUY.cjs → vue-data-ui-Ce5IFSYA.cjs} +1 -1
  25. package/dist/{vue-data-ui-BO89gTtq.js → vue-data-ui-Ct7n5wkM.js} +57 -57
  26. package/dist/vue-data-ui.cjs +1 -1
  27. package/dist/vue-data-ui.js +9 -9
  28. package/dist/vue-ui-3d-bar-B_i2EoFu.cjs +19 -0
  29. package/dist/{vue-ui-3d-bar-CcTMIHiB.js → vue-ui-3d-bar-O3fB5J7V.js} +342 -342
  30. package/dist/{vue-ui-accordion-CpzGQ63y.js → vue-ui-accordion-Dl8zkZPk.js} +3 -3
  31. package/dist/{vue-ui-accordion-7e4Myhcg.cjs → vue-ui-accordion-DpI7fTKZ.cjs} +1 -1
  32. package/dist/{vue-ui-age-pyramid-D71ZLkVV.js → vue-ui-age-pyramid-BeiREI6d.js} +22 -22
  33. package/dist/vue-ui-age-pyramid-BsAfxkN4.cjs +1 -0
  34. package/dist/{vue-ui-annotator-B8Iu6cYt.js → vue-ui-annotator-0yje27Qq.js} +39 -39
  35. package/dist/{vue-ui-annotator-BKQrweqm.cjs → vue-ui-annotator-DpN-6IwB.cjs} +2 -2
  36. package/dist/{vue-ui-candlestick-Bx4QVkY0.js → vue-ui-candlestick-D9UteVvx.js} +34 -34
  37. package/dist/{vue-ui-candlestick-DAc1FQ-i.cjs → vue-ui-candlestick-lv78wnpS.cjs} +2 -2
  38. package/dist/{vue-ui-carousel-table-uFRqkghO.cjs → vue-ui-carousel-table-Br6FwMKM.cjs} +1 -1
  39. package/dist/{vue-ui-carousel-table-xuQG6bcH.js → vue-ui-carousel-table-jxZ3h5pq.js} +31 -31
  40. package/dist/{vue-ui-chestnut-Bo6rDcU7.js → vue-ui-chestnut-DXuHRJy4.js} +291 -288
  41. package/dist/vue-ui-chestnut-DbYHeNaL.cjs +6 -0
  42. package/dist/{vue-ui-cursor-C0KOqEOq.js → vue-ui-cursor-BzPbdVRJ.js} +20 -20
  43. package/dist/vue-ui-cursor-iss6SJ1Y.cjs +1 -0
  44. package/dist/{vue-ui-dashboard-BT71xS7P.js → vue-ui-dashboard-CGjWuFrI.js} +2 -2
  45. package/dist/{vue-ui-dashboard-0Hsjx-bO.cjs → vue-ui-dashboard-DKT82yQ4.cjs} +1 -1
  46. package/dist/{vue-ui-digits-BRqpKYvD.js → vue-ui-digits-BCguvLxB.js} +2 -2
  47. package/dist/{vue-ui-digits-C2ReH6w0.cjs → vue-ui-digits-BfwDCfYp.cjs} +1 -1
  48. package/dist/{vue-ui-donut-NQW-3prf.js → vue-ui-donut-DJTeGLVG.js} +209 -212
  49. package/dist/{vue-ui-donut-evolution-jbXQQGTc.js → vue-ui-donut-evolution-BaLDZNDG.js} +106 -106
  50. package/dist/vue-ui-donut-evolution-Bil1AIhX.cjs +1 -0
  51. package/dist/vue-ui-donut-uVPdO4UH.cjs +1 -0
  52. package/dist/{vue-ui-dumbbell-Dyz8xdtC.js → vue-ui-dumbbell-BqtDdV5w.js} +17 -17
  53. package/dist/{vue-ui-dumbbell-DXQSg6wa.cjs → vue-ui-dumbbell-DiL3xhKY.cjs} +1 -1
  54. package/dist/{vue-ui-flow-UqSNwH9d.cjs → vue-ui-flow-BVTbbsCK.cjs} +1 -1
  55. package/dist/{vue-ui-flow-BL3JWW1m.js → vue-ui-flow-zfTGon4s.js} +28 -28
  56. package/dist/{vue-ui-galaxy-Dx9nsOuM.js → vue-ui-galaxy-5iRb5sQ-.js} +22 -22
  57. package/dist/{vue-ui-galaxy-DTQWGvRH.cjs → vue-ui-galaxy-GSO_6KIe.cjs} +1 -1
  58. package/dist/vue-ui-gauge-Bz7oLa51.cjs +1 -0
  59. package/dist/{vue-ui-gauge-CLaKGi0-.js → vue-ui-gauge-DljHYdCS.js} +101 -110
  60. package/dist/{vue-ui-gizmo-of-4s5HG.js → vue-ui-gizmo-B-fxFOZy.js} +2 -2
  61. package/dist/{vue-ui-gizmo-Kitfqu0J.cjs → vue-ui-gizmo-KL0OJY2K.cjs} +1 -1
  62. package/dist/{vue-ui-heatmap-BIzjOMXO.js → vue-ui-heatmap-ketn_NV3.js} +17 -17
  63. package/dist/{vue-ui-heatmap-DUw2350O.cjs → vue-ui-heatmap-thMJPCfo.cjs} +1 -1
  64. package/dist/{vue-ui-kpi-By3YPwgo.js → vue-ui-kpi-Bxu8uZ21.js} +3 -3
  65. package/dist/{vue-ui-kpi-DyL2Hcz-.cjs → vue-ui-kpi-e1QWa8D4.cjs} +1 -1
  66. package/dist/{vue-ui-mini-loader-DnK3V2z2.js → vue-ui-mini-loader-BZ_2aV8O.js} +2 -2
  67. package/dist/{vue-ui-mini-loader-C048-8Kd.cjs → vue-ui-mini-loader-paRZQU8H.cjs} +1 -1
  68. package/dist/{vue-ui-molecule-BfhbIqa5.js → vue-ui-molecule-Bpp5unvI.js} +33 -33
  69. package/dist/{vue-ui-molecule-D-ahly6R.cjs → vue-ui-molecule-VOBL4Osc.cjs} +1 -1
  70. package/dist/{vue-ui-mood-radar-DXxEKr3x.js → vue-ui-mood-radar-BY8XP_Q5.js} +129 -132
  71. package/dist/vue-ui-mood-radar-CwtMLwP8.cjs +1 -0
  72. package/dist/{vue-ui-nested-donuts-BdUdHFd-.js → vue-ui-nested-donuts-5uuLi3If.js} +98 -98
  73. package/dist/{vue-ui-nested-donuts-C7qM_FRw.cjs → vue-ui-nested-donuts-CLnVnAiD.cjs} +2 -2
  74. package/dist/{vue-ui-onion-DX3gofXZ.cjs → vue-ui-onion-CMSPSSSG.cjs} +1 -1
  75. package/dist/{vue-ui-onion-D0vF5jBt.js → vue-ui-onion-zDy4ecPl.js} +9 -9
  76. package/dist/{vue-ui-parallel-coordinate-plot-DEx5kFYd.cjs → vue-ui-parallel-coordinate-plot-1PFxiI__.cjs} +1 -1
  77. package/dist/{vue-ui-parallel-coordinate-plot-CTZY-pY8.js → vue-ui-parallel-coordinate-plot-BeEkL7Dq.js} +24 -24
  78. package/dist/vue-ui-quadrant-Cx5z_c90.cjs +1 -0
  79. package/dist/{vue-ui-quadrant-ByY8GP3y.js → vue-ui-quadrant-MCIlbbsW.js} +35 -35
  80. package/dist/{vue-ui-quick-chart-DWZEgUJF.cjs → vue-ui-quick-chart-Xn-47NQG.cjs} +1 -1
  81. package/dist/{vue-ui-quick-chart-DTxJ__7j.js → vue-ui-quick-chart-r6Qa7qg_.js} +69 -69
  82. package/dist/{vue-ui-radar-DEED0rTz.cjs → vue-ui-radar-ANQ1wXFc.cjs} +1 -1
  83. package/dist/{vue-ui-radar-5UBmAU6W.js → vue-ui-radar-DFV5cFkl.js} +39 -39
  84. package/dist/{vue-ui-rating-Ce_Ewqtl.cjs → vue-ui-rating-BVzCbQbv.cjs} +1 -1
  85. package/dist/{vue-ui-rating-Dr6jquxh.js → vue-ui-rating-DYu1EuJF.js} +6 -6
  86. package/dist/{vue-ui-relation-circle-BU8i2miI.js → vue-ui-relation-circle-BAcmDQB_.js} +29 -29
  87. package/dist/vue-ui-relation-circle-DEM6C6Or.cjs +1 -0
  88. package/dist/{vue-ui-rings-Ctl3Jywh.js → vue-ui-rings-BiLlYpgu.js} +31 -31
  89. package/dist/{vue-ui-rings-OQ8a1Ruw.cjs → vue-ui-rings-Ce4G4hat.cjs} +2 -2
  90. package/dist/{vue-ui-scatter-BwJ_koWT.js → vue-ui-scatter-D2ndYfkQ.js} +95 -95
  91. package/dist/vue-ui-scatter-OtlcTCUF.cjs +1 -0
  92. package/dist/{vue-ui-screenshot-BS3L5vhN.js → vue-ui-screenshot-CKCNPn-e.js} +4 -4
  93. package/dist/{vue-ui-screenshot-bAVk3EPl.cjs → vue-ui-screenshot-DTQx4VsM.cjs} +1 -1
  94. package/dist/{vue-ui-skeleton-CvFX_ExX.js → vue-ui-skeleton-B30ZhUV7.js} +96 -96
  95. package/dist/vue-ui-skeleton-CwqzJlQf.cjs +41 -0
  96. package/dist/{vue-ui-smiley-CGYZpNt9.js → vue-ui-smiley-DzLvZR1k.js} +2 -2
  97. package/dist/{vue-ui-smiley-sF8QIso1.cjs → vue-ui-smiley-L6o24M6h.cjs} +1 -1
  98. package/dist/{vue-ui-spark-trend-B4XSSKl9.js → vue-ui-spark-trend-BKsmENbH.js} +21 -21
  99. package/dist/vue-ui-spark-trend-BoWeviHk.cjs +1 -0
  100. package/dist/{vue-ui-sparkbar-BbsJGDMZ.js → vue-ui-sparkbar-DNzZkp8z.js} +10 -10
  101. package/dist/vue-ui-sparkbar-DY3iOLo4.cjs +1 -0
  102. package/dist/{vue-ui-sparkgauge-D4w_i_QJ.js → vue-ui-sparkgauge-B2DngjVP.js} +8 -8
  103. package/dist/{vue-ui-sparkgauge-BKyQoI7C.cjs → vue-ui-sparkgauge-BlZ-lJm4.cjs} +1 -1
  104. package/dist/vue-ui-sparkhistogram-BUBewgdH.cjs +1 -0
  105. package/dist/{vue-ui-sparkhistogram-CYybrW-6.js → vue-ui-sparkhistogram-Co9N3BeQ.js} +111 -101
  106. package/dist/vue-ui-sparkline-BhL0mxXD.cjs +1 -0
  107. package/dist/{vue-ui-sparkline-DjN1SVdO.js → vue-ui-sparkline-Dpqo4aRJ.js} +34 -34
  108. package/dist/{vue-ui-sparkstackbar-BZ2bESBi.cjs → vue-ui-sparkstackbar-DtNbx3EV.cjs} +1 -1
  109. package/dist/{vue-ui-sparkstackbar-BLMhJxaN.js → vue-ui-sparkstackbar-_JwfRxF8.js} +5 -5
  110. package/dist/{vue-ui-stackbar-BTKOHUYc.js → vue-ui-stackbar-BtN7ZM7-.js} +202 -200
  111. package/dist/{vue-ui-stackbar-DRHaJFR8.cjs → vue-ui-stackbar-C7AWHP6m.cjs} +2 -2
  112. package/dist/{vue-ui-strip-plot-o6GTsGAT.js → vue-ui-strip-plot-6L9a7BSw.js} +26 -26
  113. package/dist/{vue-ui-strip-plot-DxQxFbWg.cjs → vue-ui-strip-plot-cgOFTunJ.cjs} +1 -1
  114. package/dist/{vue-ui-table-BFIj1Rgh.cjs → vue-ui-table-4Pf9tmFg.cjs} +1 -1
  115. package/dist/{vue-ui-table-CnquiTpr.js → vue-ui-table-BFYHRMCS.js} +1 -1
  116. package/dist/{vue-ui-table-heatmap-CZRIwv-Q.js → vue-ui-table-heatmap--kPCu8mA.js} +24 -24
  117. package/dist/{vue-ui-table-heatmap-CCGK12Fa.cjs → vue-ui-table-heatmap-CltKb2V9.cjs} +1 -1
  118. package/dist/{vue-ui-table-sparkline-DYmgfHz4.cjs → vue-ui-table-sparkline-B5OjJud8.cjs} +1 -1
  119. package/dist/{vue-ui-table-sparkline-B3zEeq6Z.js → vue-ui-table-sparkline-CsWx1Ksy.js} +26 -26
  120. package/dist/{vue-ui-thermometer-CzPRBt6c.cjs → vue-ui-thermometer-62_4QovL.cjs} +1 -1
  121. package/dist/{vue-ui-thermometer-BopiohUh.js → vue-ui-thermometer-nTD7sp8r.js} +40 -40
  122. package/dist/{vue-ui-timer-Bonw69Lt.cjs → vue-ui-timer-BU0s7Vt9.cjs} +1 -1
  123. package/dist/{vue-ui-timer-C7WkW8hK.js → vue-ui-timer-DMFHjnzA.js} +8 -8
  124. package/dist/{vue-ui-tiremarks-BurRtFv4.js → vue-ui-tiremarks-1X9B1VKM.js} +18 -18
  125. package/dist/{vue-ui-tiremarks-DkIGfq8t.cjs → vue-ui-tiremarks-mwBeBMJY.cjs} +1 -1
  126. package/dist/{vue-ui-treemap-DWy4voIr.js → vue-ui-treemap-CVTwqPFA.js} +29 -29
  127. package/dist/{vue-ui-treemap-CalhJmnp.cjs → vue-ui-treemap-DQmBbm7e.cjs} +1 -1
  128. package/dist/vue-ui-vertical-bar-BXiy8KRC.cjs +4 -0
  129. package/dist/{vue-ui-vertical-bar-CJW1YhtY.js → vue-ui-vertical-bar-Br6Z0A3F.js} +14 -14
  130. package/dist/{vue-ui-waffle-faQMBYNx.cjs → vue-ui-waffle-CLCsHw9j.cjs} +1 -1
  131. package/dist/{vue-ui-waffle-DB7X6nTS.js → vue-ui-waffle-DEXMh07q.js} +84 -84
  132. package/dist/{vue-ui-wheel-CryKap2E.js → vue-ui-wheel-CwjuVi6U.js} +24 -24
  133. package/dist/{vue-ui-wheel-BzjbGP6a.cjs → vue-ui-wheel-DSFKKX65.cjs} +1 -1
  134. package/dist/{vue-ui-word-cloud-COqUkvei.js → vue-ui-word-cloud-BKeD3fHb.js} +19 -19
  135. package/dist/{vue-ui-word-cloud-DJN9I4q4.cjs → vue-ui-word-cloud-DZS4hCeR.cjs} +1 -1
  136. package/dist/vue-ui-xy-B5aCogSL.cjs +3 -0
  137. package/dist/{vue-ui-xy-b1Z_HPsx.js → vue-ui-xy-DA3qqL8u.js} +351 -350
  138. package/dist/{vue-ui-xy-canvas-BgbLnY5B.js → vue-ui-xy-canvas-B7DH4RK5.js} +18 -18
  139. package/dist/vue-ui-xy-canvas-heCdqh5X.cjs +9 -0
  140. package/package.json +1 -1
  141. package/dist/Tooltip-DScSrYXJ.cjs +0 -1
  142. package/dist/index-BTgtr0F8.cjs +0 -4
  143. package/dist/vue-ui-3d-bar-DzmcGuqh.cjs +0 -19
  144. package/dist/vue-ui-age-pyramid-C7qr9EwB.cjs +0 -1
  145. package/dist/vue-ui-chestnut-DJkm72oD.cjs +0 -6
  146. package/dist/vue-ui-cursor-BQbeuW-k.cjs +0 -1
  147. package/dist/vue-ui-donut-evolution-DOe-cwLi.cjs +0 -1
  148. package/dist/vue-ui-donut-v81suIOX.cjs +0 -1
  149. package/dist/vue-ui-gauge-BUB7H0qA.cjs +0 -1
  150. package/dist/vue-ui-mood-radar-DD8R9BpJ.cjs +0 -1
  151. package/dist/vue-ui-quadrant-CgApzie6.cjs +0 -1
  152. package/dist/vue-ui-relation-circle-CRcQ6Zcy.cjs +0 -1
  153. package/dist/vue-ui-scatter-B8StSjt8.cjs +0 -1
  154. package/dist/vue-ui-skeleton-CMQzFTs9.cjs +0 -41
  155. package/dist/vue-ui-spark-trend-CdIoxaqb.cjs +0 -1
  156. package/dist/vue-ui-sparkbar-C3i1K7hi.cjs +0 -1
  157. package/dist/vue-ui-sparkhistogram-CvTYEmbz.cjs +0 -1
  158. package/dist/vue-ui-sparkline-CDowaDRS.cjs +0 -1
  159. package/dist/vue-ui-vertical-bar-rwWp-sai.cjs +0 -4
  160. package/dist/vue-ui-xy-BmA0tspd.cjs +0 -3
  161. package/dist/vue-ui-xy-canvas-DOM2Kq_s.cjs +0 -9
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CzjC8LfY.cjs"),be=require("./Title-BSpa3uge.cjs"),se=require("./usePrinter-DiLM6jav.cjs"),xe=require("./DataTable-C5TOiC61.cjs"),Be=require("./Legend-CGGD8NhP.cjs"),Ce=require("./vue-ui-skeleton-CwqzJlQf.cjs"),_e=require("./Slicer-CZJXKSeE.cjs"),Ee=require("./vue-ui-accordion-DpI7fTKZ.cjs"),ce=require("./useNestedProp-CY7DebVH.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),we=["id"],Se=["xmlns","viewBox"],Le=["id"],Ve=["stop-color"],$e=["stop-color"],ze=["id"],Fe=["stop-color"],Ae=["stop-color"],De=["stop-color"],Pe={key:0},Te=["x1","x2","y1","y2","stroke","stroke-width"],Oe=["x1","x2","y1","y2","stroke","stroke-width"],Ie={key:0},Me=["x1","x2","y1","y2","stroke","stroke-width"],He=["x1","x2","y1","y2","stroke","stroke-width"],Re=["x","y","font-size","fill","font-weight"],We=["text-anchor","font-size","fill","transform"],Ue=["x1","y1","x2","y2","stroke","stroke-width"],Xe={key:1},qe=["cx","cy","r","fill"],Ge={key:0},Ye={key:0},je=["d","stroke"],Ke=["text-anchor","x","y","fill"],Je=["cx","cy","r","fill"],Qe={key:0},Ze=["cx","cy","fill"],et={key:1},tt=["d","fill","stroke"],lt={key:2},at=["d","fill","stroke"],ot=["x","y","font-size","fill"],ut=["x","y","width","fill","onClick"],rt=["x","y","width","height","onMouseenter","onClick"],nt={key:3,"data-cy-zoom":"",class:"vue-ui-donut-evolution-dialog"},st=["x","y","width","height","fill"],ct=["x1","y1","x2","y2","stroke"],it=["x1","y2","x2","y1","stroke"],dt=["onKeypress","cx","cy","r"],vt=["d","stroke"],ht=["cx","cy","r","fill"],yt=["d","fill","stroke"],mt={class:"vue-ui-donut-evolution-focus"},ft=["text-anchor","x","y","fill"],gt=["cx","cy","r","fill"],kt=["cx","cy","r","fill"],pt=["x","y","fill"],bt=["x","y","font-size","fill"],xt={key:3,class:"vue-data-ui-watermark"},Bt=["onClick"],Ct={key:0},_t={key:1},Et={key:0},Nt={key:1},wt={__name:"vue-ui-donut-evolution",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(ie,{expose:de,emit:M}){const k=ie,{vue_ui_donut_evolution:ve}=r.useConfig(),$=e.computed(()=>!!k.dataset&&k.dataset.length),i=e.ref({start:0,end:Math.max(...k.dataset.map(a=>a.values.length))});function H(){i.value={start:0,end:L.value},X.value+=1}e.onMounted(()=>{R()});function R(){r.objectIsEmpty(k.dataset)?r.error({componentName:"VueUiDonutEvolution",type:"dataset"}):k.dataset.length&&k.dataset.forEach((a,c)=>{r.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","values"]}).forEach(l=>{r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:l,index:c})})})}const _=e.ref(r.createUid()),y=e.ref([]),h=e.ref(null),A=e.ref(null),p=e.ref(!1),b=e.ref(null),W=e.ref(null),U=e.ref(0),X=e.ref(0),q=e.ref(0),G=e.ref(0),Y=e.ref(0),t=e.computed({get:()=>j(),set:a=>a});function j(){const a=ce.useNestedProp({userConfig:k.config,defaultConfig:ve});return a.theme?{...ce.useNestedProp({userConfig:r.themes.vue_ui_donut_evolution[a.theme]||k.config,defaultConfig:a}),customPalette:r.themePalettes[a.theme]||r.palette}:a}e.watch(()=>k.config,a=>{t.value=j(),R(),q.value+=1,G.value+=1,Y.value+=1},{deep:!0}),e.watch(()=>k.dataset,a=>{H()},{deep:!0});const{isPrinting:K,isImaging:J,generatePdf:Q,generateImage:Z}=se.usePrinter({elementId:_.value,fileName:t.value.style.chart.title.text||"vue-ui-donut-evolution"}),he=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),z=e.ref({showTable:t.value.table.show}),u=e.computed(()=>({top:t.value.style.chart.layout.padding.top,right:t.value.style.chart.layout.padding.right,bottom:t.value.style.chart.layout.padding.bottom,left:t.value.style.chart.layout.padding.left})),n=e.computed(()=>{const a=t.value.style.chart.layout.height,c=t.value.style.chart.layout.width,l=a-u.value.top-u.value.bottom,s=c-u.value.left-u.value.right;return{absoluteHeight:a,absoluteWidth:c,centerX:u.value.left+s/2,centerY:u.value.top+l/2,height:l,width:s}}),C=e.computed(()=>(k.dataset.forEach((a,c)=>{[null,void 0].includes(a.name)&&r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"name",index:c}),[null,void 0].includes(a.values)&&r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"values",index:c})}),k.dataset.map((a,c)=>({...a,values:r.sanitizeArray(a.values),color:r.convertColorToHex(a.color)||he.value[c]||r.palette[c]||r.palette[c%r.palette.length],length:(a.values||[]).length,uid:r.createUid()})))),S=e.computed(()=>C.value.filter(a=>!y.value.includes(a.uid)).map(a=>({...a,values:a.values.filter((c,l)=>l>=i.value.start&&l<=i.value.end)}))),L=e.computed(()=>Math.max(...S.value.map(a=>a.length))),f=e.computed(()=>n.value.width/(i.value.end-i.value.start)),m=e.computed(()=>{const a=[];for(let o=0;o<i.value.end-i.value.start;o+=1){const v=S.value.map(B=>B.values[o]??null),d=v.filter(B=>[void 0,null].includes(B)).length===v.length,x=v.reduce((B,g)=>B+g,0),I=v.map(B=>B/x),w=u.value.left+f.value*o+f.value/2;a.push({index:o,percentages:I,subtotal:d||x<0?null:x,values:v,x:w})}const c=0,l=Math.max(...a.map(o=>o.subtotal)),s=a.length===1?l*2:l;return a.map((o,v)=>{const d=f.value/2*.7,x=d>n.value.width/16?n.value.width/16:d,I=h.value===o.index?n.value.width/16:x,w=a.length>4?d*2:d*2>f.value/2*.7?f.value/2*.7:d*2,B=n.value.absoluteHeight-u.value.bottom-n.value.height*o.subtotal/r.calculateNiceScale(c,s,t.value.style.chart.layout.grid.yAxis.dataLabels.steps).max;return{...o,y:B,radius:x,activeRadius:I,hoverRadius:w,donut:r.makeDonut({series:S.value.map((g,ne)=>({color:g.color,name:g.name,value:g.values[v]??0}))},o.x,B,x,x,1.99999,2,1,360,105.25,x/2),donutHover:r.makeDonut({series:S.value.map((g,ne)=>({color:g.color,name:g.name,value:g.values[v]??0}))},o.x,B,w,w,1.99999,2,1,360,105.25,w/2),donutFocus:r.makeDonut({series:S.value.map((g,ne)=>({color:g.color,name:g.name,value:g.values[v]??0}))},n.value.centerX,n.value.centerY,n.value.height/3.6,n.value.height/3.6,1.99999,2,1,360,105.25,n.value.height/6)}})});function F(a,c,l){return r.applyDataLabel(t.value.style.chart.layout.dataLabels.formatter,a,r.dataLabel({p:t.value.style.chart.layout.dataLabels.prefix,v:a,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.layout.dataLabels.rounding}),{datapoint:c,index:l})}const D=e.computed(()=>({max:Math.max(...m.value.map(a=>a.subtotal)),min:0})),E=e.computed(()=>{const a=m.value.length===1?D.value.max*2:D.value.max;return r.calculateNiceScale(D.value.min,a,t.value.style.chart.layout.grid.yAxis.dataLabels.steps)});function ye(a){return a/E.value.max}const me=e.computed(()=>E.value.ticks.map(a=>({y:n.value.absoluteHeight-u.value.bottom-n.value.height*ye(a),value:a})));function ee(a,c){return isNaN(a.value/r.sumByAttribute(c,"value"))?0:(a.value/r.sumByAttribute(c,"value")*100).toFixed(0)+"%"}function te(){p.value||(h.value=null,A.value=null)}function fe(a){p.value||(h.value=a.index,A.value=a)}const P=e.ref(null);function T(a,c){a.subtotal&&(A.value=null,h.value=null,p.value=!0,b.value=a,[null,void 0].includes(c)||(P.value=c))}function le(){b.value=null,p.value=!1,P.value=null}const ae=e.computed(()=>C.value.map((a,c)=>({name:a.name,value:a.values.slice(i.value.start,i.value.end).reduce((l,s)=>l+s,0),shape:"circle",uid:a.uid,color:a.color})).sort((a,c)=>c.value-a.value).map(a=>({...a,opacity:y.value.includes(a.uid)?.5:1,segregate:()=>O(a.uid),isSegregated:y.value.includes(a.uid)}))),oe=e.computed(()=>m.value.map(a=>a.subtotal).reduce((a,c)=>a+c,0)),ge=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,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function O(a){if(y.value.includes(a))y.value=y.value.filter(c=>c!==a),M("selectLegend",null);else{if(y.value.length===C.value.length-1)return;y.value.push(a),M("selectLegend",C.value.find(c=>c.uid===a))}b.value&&T(m.value.find((c,l)=>l===P.value))}const N=e.computed(()=>{const a=[""].concat(C.value.filter(o=>!y.value.includes(o.uid)).map(o=>({name:o.name,color:o.color}))).concat(["Σ"]);let c=[];for(let o=0;o<L.value;o+=1){const v=C.value.filter(d=>!y.value.includes(d.uid)).map(d=>d.values[o]??0).reduce((d,x)=>d+x,0);c.push([t.value.style.chart.layout.grid.xAxis.dataLabels.values[o]??"-"].concat(C.value.filter(d=>!y.value.includes(d.uid)).map(d=>({value:d.values[o]??0,percentage:d.values[o]?d.values[o]/v*100:0}))).concat([`${t.value.style.chart.layout.dataLabels.prefix}${Number(v.toFixed(t.value.table.td.roundingValue))}${t.value.style.chart.layout.dataLabels.suffix}`]))}const 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},s=[t.value.table.columnNames.period].concat(C.value.filter(o=>!y.value.includes(o.uid)).map(o=>o.name)).concat(t.value.table.columnNames.total);return{head:a,body:c,config:l,colNames:s}});function ke(){return C.value}function ue(){e.nextTick(()=>{const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],c=[...N.value.head.map(v=>v.name??v)],l=[...N.value.body.map(v=>v.map(d=>d.value??d))],s=a.concat([c]).concat(l),o=r.createCsvContent(s);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-donut-evolution"})})}const V=e.ref(!1);function pe(a){V.value=a,U.value+=1}function re(){z.value.showTable=!z.value.showTable}return de({getData:ke,generatePdf:Q,generateCsv:ue,generateImage:Z,toggleTable:re}),(a,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"donutEvolutionChart",ref:W,class:e.normalizeClass(`vue-ui-donut-evolution ${V.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:_.value},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`),onMouseleave:te},[(e.openBlock(),e.createBlock(be._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"donut-evolution-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-evolution-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],36)):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value?(e.openBlock(),e.createBlock(se.UserOptions,{ref:"details",key:`user_options_${U.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(K),isImaging:e.unref(J),uid:_.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:W.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(Q),onGenerateCsv:ue,onGenerateImage:e.unref(Z),onToggleTable:re},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:s})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:s})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${n.value.absoluteWidth} ${n.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`hover_${_.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(t.value.style.chart.backgroundColor,t.value.style.chart.layout.highlighter.opacity)},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(t.value.style.chart.layout.highlighter.color,t.value.style.chart.layout.highlighter.opacity)},null,8,$e)],8,Le),e.createElementVNode("radialGradient",{id:`focus_${_.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(e.unref(r.convertColorToHex)(t.value.style.chart.backgroundColor),0)},null,8,Fe),e.createElementVNode("stop",{offset:"77%","stop-color":e.unref(r.setOpacity)("#FFFFFF",30)},null,8,Ae),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(e.unref(r.convertColorToHex)(t.value.style.chart.backgroundColor),0)},null,8,De)],8,ze)]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Pe,[e.createElementVNode("line",{x1:u.value.left,x2:u.value.left,y1:u.value.top,y2:u.value.top+n.value.height,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Te),e.createElementVNode("line",{x1:u.value.left,x2:n.value.absoluteWidth-u.value.right,y1:n.value.absoluteHeight-u.value.bottom,y2:n.value.absoluteHeight-u.value.bottom,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Oe),t.value.style.chart.layout.grid.showVerticalLines?(e.openBlock(),e.createElementBlock("g",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.end-i.value.start,(l,s)=>(e.openBlock(),e.createElementBlock("line",{x1:u.value.left+(s+1)*f.value,x2:u.value.left+(s+1)*f.value,y1:u.value.top,y2:n.value.absoluteHeight-u.value.bottom,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Me))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.layout.grid.yAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:1,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":h.value!==null||p.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.value>=E.value.min&&l.value<=E.value.max?(e.openBlock(),e.createElementBlock("line",{key:0,x1:u.value.left,x2:u.value.left-5,y1:l.y,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,He)):e.createCommentVNode("",!0),l.value>=E.value.min&&l.value<=E.value.max?(e.openBlock(),e.createElementBlock("text",{key:1,x:u.value.left-8+t.value.style.chart.layout.grid.yAxis.dataLabels.offsetX,y:l.y+t.value.style.chart.layout.grid.yAxis.dataLabels.fontSize/3,"font-size":t.value.style.chart.layout.grid.yAxis.dataLabels.fontSize,"text-anchor":"end",fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-weight":t.value.style.chart.layout.grid.yAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(e.unref(r.canShowValue)(l.value)?e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.layout.grid.yAxis.dataLabels.roundingValue}),{datapoint:l,seriesIndex:s}):""),9,Re)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),t.value.style.chart.layout.grid.xAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:2,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":p.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.end-i.value.start,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast&&(s===0||s===L.value-1)||!t.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":t.value.style.chart.layout.grid.xAxis.dataLabels.rotation>0?"start":t.value.style.chart.layout.grid.xAxis.dataLabels.rotation<0?"end":"middle","font-size":t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize,fill:t.value.style.chart.layout.grid.xAxis.dataLabels.color,transform:`translate(${u.value.left+f.value*s+f.value/2}, ${t.value.style.chart.layout.grid.xAxis.dataLabels.offsetY+n.value.absoluteHeight-u.value.bottom+t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*2}), rotate(${t.value.style.chart.layout.grid.xAxis.dataLabels.rotation})`},e.toDisplayString(t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(s)+Number(i.value.start)]??""),9,We)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.line.show&&s<m.value.length-1&&![l.subtotal,m.value[s+1].subtotal].includes(null)?(e.openBlock(),e.createElementBlock("line",{key:0,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":h.value!==null||p.value}),x1:l.x,y1:l.y,x2:m.value[s+1].x,y2:m.value[s+1].y,stroke:t.value.style.chart.layout.line.stroke,"stroke-width":t.value.style.chart.layout.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,10,Ue)):e.createCommentVNode("",!0),l.subtotal!==null?(e.openBlock(),e.createElementBlock("g",Xe,[l.subtotal?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x,cy:l.y,r:l.activeRadius,fill:t.value.style.chart.backgroundColor},null,8,qe)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":s!==h.value&&h.value!==null||p.value})},[l.subtotal?(e.openBlock(),e.createElementBlock("g",Ge,[h.value!==null&&h.value===s?(e.openBlock(),e.createElementBlock("g",Ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,o=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{d:e.unref(r.calcNutArrowPath)(o,{x:o.center.endX,y:o.center.endY},12,12,{x:l.x,y:l.y},!0),stroke:o.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,je)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,(o,v)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{"data-cy-hover-label":"","text-anchor":e.unref(r.calcMarkerOffsetX)(o,!0,0).anchor,x:e.unref(r.calcMarkerOffsetX)(o,!0,3).x,y:e.unref(r.calcMarkerOffsetY)(o),fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-size":8,"font-weight":"bold"},e.toDisplayString(o.name)+": "+e.toDisplayString(ee(o,l.donut))+" ("+e.toDisplayString(o.value===null?"-":F(o.value,o,v))+") ",9,Ke)]))),256)),e.createElementVNode("g",null,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:l.hoverRadius,fill:t.value.style.chart.backgroundColor},null,8,Je)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":s!==h.value&&h.value!==null||p.value})},[l.subtotal!==null?(e.openBlock(),e.createElementBlock("g",Qe,[l.subtotal===0?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x,cy:l.y,r:3,fill:t.value.style.chart.color},null,8,Ze)):h.value!==null&&h.value===s?(e.openBlock(),e.createElementBlock("g",et,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,(o,v)=>(e.openBlock(),e.createElementBlock("path",{d:o.arcSlice,fill:`${o.color}`,"stroke-width":1,stroke:t.value.style.chart.backgroundColor},null,8,tt))),256))])):(e.openBlock(),e.createElementBlock("g",lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donut,(o,v)=>(e.openBlock(),e.createElementBlock("path",{d:o.arcSlice,fill:`${o.color}`,"stroke-width":.5,stroke:t.value.style.chart.backgroundColor},null,8,at))),256))]))])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":s!==h.value&&h.value!==null||p.value})},[l.subtotal!==null&&t.value.style.chart.layout.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",x:l.x,y:h.value===l.index&&l.subtotal?l.y+t.value.style.chart.layout.dataLabels.fontSize/3:l.y-l.radius-t.value.style.chart.layout.dataLabels.fontSize+t.value.style.chart.layout.dataLabels.offsetY,"font-size":t.value.style.chart.layout.dataLabels.fontSize,"font-weight":"bold",fill:t.value.style.chart.layout.dataLabels.color},e.toDisplayString(F(l.subtotal,l,s)),9,ot)):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("rect",{x:u.value.left+s*f.value,y:n.value.absoluteHeight-u.value.bottom-10,width:f.value,height:10,fill:h.value===l.index?`url(#hover_${_.value})`:"transparent",onClick:o=>T(l,s),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,10,ut))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("rect",{"data-cy-trap":"",x:u.value.left+s*f.value,y:u.value.top,width:f.value,height:n.value.height,fill:"transparent",onMouseenter:o=>fe(l),onMouseleave:te,onClick:o=>T(l,s),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,42,rt))),256)),p.value?(e.openBlock(),e.createElementBlock("g",nt,[e.createElementVNode("rect",{rx:4,x:u.value.left,y:u.value.top,width:n.value.width,height:n.value.height,fill:t.value.style.chart.backgroundColor,style:{filter:"drop-shadow(0 12px 12px rgba(0,0,0,0.3))"}},null,8,st),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:n.value.absoluteWidth-u.value.right-15,y1:u.value.top+5,x2:n.value.absoluteWidth-u.value.right-4,y2:u.value.top+15.5,"stroke-linecap":"round",stroke:t.value.style.chart.color,"stroke-width":"1.5"},null,8,ct),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:n.value.absoluteWidth-u.value.right-15,y2:u.value.top+5,x2:n.value.absoluteWidth-u.value.right-4,y1:u.value.top+15.5,"stroke-linecap":"round",stroke:t.value.style.chart.color,"stroke-width":"1.5"},null,8,it),e.createElementVNode("circle",{"data-cy-close":"",onClick:le,onKeypress:e.withKeys(le,["enter"]),cx:n.value.absoluteWidth-u.value.right-n.value.width/40,cy:u.value.top+n.value.height/30,r:n.value.height/12,fill:"transparent",style:{cursor:"pointer"},tabindex:"0"},null,40,dt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,l=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{"data-cy-zoom-donut":"",d:e.unref(r.calcNutArrowPath)(l,{x:n.value.centerX,y:n.value.centerY},12,12,!1,!1,15),stroke:l.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",class:"vue-ui-donut-evolution-focus"},null,8,vt)]))),256)),e.createElementVNode("circle",{cx:u.value.left+n.value.width/2,cy:u.value.top+n.value.height/2,r:n.value.height/7,fill:t.value.style.chart.backgroundColor},null,8,ht),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,(l,s)=>(e.openBlock(),e.createElementBlock("path",{d:l.arcSlice,fill:`${l.color}`,"stroke-width":1,stroke:t.value.style.chart.backgroundColor,class:"vue-ui-donut-evolution-focus"},null,8,yt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.donutFocus,(l,s)=>(e.openBlock(),e.createElementBlock("g",mt,[e.createElementVNode("text",{"text-anchor":e.unref(r.calcMarkerOffsetX)(l,!0,20).anchor,x:e.unref(r.calcMarkerOffsetX)(l,!0,10).x,y:e.unref(r.calcMarkerOffsetY)(l),fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-size":10,"font-weight":"bold"},e.toDisplayString(l.name)+": "+e.toDisplayString(ee(l,b.value.donutFocus))+" ("+e.toDisplayString(l.value===null?"-":F(l.value,l,s))+") ",9,ft)]))),256)),e.createElementVNode("circle",{cx:u.value.left+n.value.width/2,cy:u.value.top+n.value.height/2,r:n.value.height/3.8,fill:`url(#focus_${_.value})`},null,8,gt),e.createElementVNode("circle",{cx:u.value.left+n.value.width/2,cy:u.value.top+n.value.height/2,r:n.value.height/7.7,fill:t.value.style.chart.backgroundColor},null,8,kt),e.createElementVNode("text",{"text-anchor":"middle",x:u.value.left+n.value.width/2,y:u.value.top+n.value.height/2+14/3,"font-size":14,"font-weight":"bold",fill:t.value.style.chart.layout.dataLabels.color,class:"vue-ui-donut-evolution-focus"},e.toDisplayString(F(b.value.subtotal,b.value,null)),9,pt),t.value.style.chart.layout.grid.xAxis.dataLabels.values[b.value.index]?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.value.left+6,y:u.value.top+t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*2,"font-size":t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*1.6,fill:t.value.style.chart.layout.dataLabels.color},e.toDisplayString(t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(b.value.index)+Number(i.value.start)]),9,bt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:n.value},void 0,!0)],14,Se)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",xt,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(K)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ce.default,{key:4,config:{type:"donutEvolution",style:{backgroundColor:t.value.style.chart.backgroundColor,donutEvolution:{axis:{color:"#CCCCCC"},donuts:{color:"#CCCCCC"}}}}},null,8,["config"])),L.value>1&&t.value.style.chart.zoom.show?(e.openBlock(),e.createBlock(_e.Slicer,{key:`slicer_${X.value}`,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,fontSize:t.value.style.chart.zoom.fontSize,useResetSlot:t.value.style.chart.zoom.useResetSlot,labelLeft:t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(i.value.start)]||"",labelRight:t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(i.value.end)-1]||"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:L.value,min:0,valueStart:i.value.start,valueEnd:i.value.end,start:i.value.start,"onUpdate:start":c[0]||(c[0]=l=>i.value.start=l),end:i.value.end,"onUpdate:end":c[1]||(c[1]=l=>i.value.end=l),onReset:H},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(a.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end"])):e.createCommentVNode("",!0),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Be.Legend,{key:`legend_${Y.value}`,legendSet:ae.value,config:ge.value,onClickMarker:c[2]||(c[2]=({legend:l})=>O(l.uid))},{item:e.withCtx(({legend:l,index:s})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:o=>O(l.uid),style:e.normalizeStyle(`opacity:${y.value.includes(l.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:s}))+" ",1),y.value.includes(l.uid)?(e.openBlock(),e.createElementBlock("span",_t," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ct," ("+e.toDisplayString(isNaN(l.value/oe.value)?"-":e.unref(r.dataLabel)({v:l.value/oe.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Bt)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:ae.value},void 0,!0),$.value?(e.openBlock(),e.createBlock(Ee.default,{key:7,hideDetails:"",config:{open:z.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(xe.DataTable,{key:`table_${G.value}`,colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:c[3]||(c[3]=l=>z.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name??l),1)]),td:e.withCtx(({td:l})=>[l.value===null?(e.openBlock(),e.createElementBlock("span",Et,"-")):(e.openBlock(),e.createElementBlock("b",Nt,e.toDisplayString(isNaN(l.value)?"":t.value.style.chart.layout.dataLabels.prefix)+e.toDisplayString(!isNaN(l.value)&&l.value!==null?Number(l.value.toFixed(t.value.table.td.roundingValue)).toLocaleString():l)+e.toDisplayString(isNaN(l.value)?"":t.value.style.chart.layout.dataLabels.suffix),1)),e.createElementVNode("span",null,e.toDisplayString(l.percentage&&!isNaN(l.percentage)?`(${Number(l.percentage.toFixed(t.value.table.td.roundingPercentage)).toLocaleString()}%)`:""),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,we))}},St=Ne._export_sfc(wt,[["__scopeId","data-v-df485855"]]);exports.default=St;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CzjC8LfY.cjs"),ie=require("./useResponsive-B3TrDDIG.cjs"),Ce=require("./Title-BSpa3uge.cjs"),ve=require("./usePrinter-DiLM6jav.cjs"),xe=require("./DataTable-C5TOiC61.cjs"),_e=require("./Tooltip-rmhZhv96.cjs"),Be=require("./Legend-CGGD8NhP.cjs"),Se=require("./vue-ui-skeleton-CwqzJlQf.cjs"),$e=require("./vue-ui-accordion-DpI7fTKZ.cjs"),de=require("./useNestedProp-CY7DebVH.cjs"),Le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ne=B=>(e.pushScopeId("data-v-21a9622a"),B=B(),e.popScopeId(),B),Ee=["id"],Ve=["xmlns","viewBox"],ze=["id"],Oe=["stop-color"],Te=["stop-color"],Fe=["stop-color"],De=["stop-color"],Pe=["id"],Me=["id"],Xe=Ne(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Ae=["id"],Ie=["flood-color"],qe=["d","stroke","filter"],Re=["cx","cy","r","fill","filter"],Ge=["stroke","d"],Ye=["d","fill","stroke","stroke-width","filter"],Ue=["cx","cy","r","fill","stroke"],He=["cx","cy","r","fill"],je=["d","fill","onMouseenter","onClick"],We=["x","y","fill","font-size"],Je=["x","y","fill","font-size"],Ke=["x","y","fill","font-size"],Qe=["x","y","fill","font-size"],Ze=["filter"],et={key:0},tt=["x","y"],lt={key:1},at=["cx","cy","fill","filter","onClick"],ot=["text-anchor","x","y","fill","font-size","onClick"],rt=["text-anchor","x","y","fill","font-size","onClick"],ut={key:2},nt=["x","y","width"],st={key:3,class:"vue-data-ui-watermark"},ct=["onClick"],it={key:0,style:{"font-variant-numeric":"tabular-nums"}},vt={key:1},dt=["innerHTML"],ht={__name:"vue-ui-donut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(B,{expose:he,emit:X}){const y=B,{vue_ui_donut:fe}=o.useConfig(),S=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),$=e.ref(null),A=e.ref(null),I=e.ref(null),E=e.ref(null),q=e.ref(0),R=e.ref(0),G=e.ref(0);e.onMounted(()=>{Y()}),e.onBeforeUnmount(()=>{E.value&&E.value.disconnect()});function Y(){if(o.objectIsEmpty(y.dataset)?o.error({componentName:"VueUiDonut",type:"dataset"}):y.dataset.forEach((l,r)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{S.value=!1,o.error({componentName:"VueUiDonut",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.responsive){const l=ie.throttle(()=>{const{width:r,height:a}=ie.useResponsive({chart:$.value,title:t.value.style.chart.title.text?A.value:null,legend:t.value.style.chart.legend.show?I.value:null});s.value.width=r,s.value.height=a});E.value=new ResizeObserver(l),E.value.observe($.value.parentNode)}}const f=e.ref(o.createUid()),ye=e.ref(null),O=e.ref(!1),T=e.ref(""),b=e.ref(null),U=e.ref(0);function H(){const l=de.useNestedProp({userConfig:y.config,defaultConfig:fe});return l.theme?{...de.useNestedProp({userConfig:o.themes.vue_ui_donut[l.theme]||y.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}const t=e.computed({get:()=>H(),set:l=>l});e.watch(()=>y.config,l=>{t.value=H(),Y(),q.value+=1,R.value+=1,G.value+=1},{deep:!0});const{isPrinting:j,isImaging:W,generatePdf:J,generateImage:K}=ve.usePrinter({elementId:`donut__${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-donut"}),Q=e.computed(()=>o.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}),s=e.ref({height:360,width:512}),F=e.computed(()=>{const l=t.value.style.chart.layout.donut.strokeWidth/512,r=s.value.width*l;return r>m.value?m.value:r}),k=e.computed(()=>y.dataset.map((l,r)=>({name:l.name,color:o.convertColorToHex(l.color)||Q.value[r]||o.palette[r]||o.palette[r%o.palette.length],value:l.values.reduce((a,u)=>a+u,0),absoluteValues:l.values,comment:l.comment||""}))),h=e.ref(k.value);e.watch(()=>k.value,l=>h.value=l);function pe(){return k.value.map(l=>({name:l.name,color:l.color,value:l.value}))}const p=e.ref([]),Z=e.ref(null),ee=e.ref(null),w=e.ref(!1);function te(l){const r=k.value.find((n,i)=>i===l);let u=h.value.find((n,i)=>i===l).value;if(p.value.includes(l)){let i=function(){u>n?(cancelAnimationFrame(Z.value),h.value=h.value.map((c,M)=>l===M?{...c,value:n}:c),w.value=!1):(w.value=!0,u+=n*.025,h.value=h.value.map((c,M)=>l===M?{...c,value:u}:c),Z.value=requestAnimationFrame(i))};p.value=p.value.filter(c=>c!==l);const n=r.value;i()}else if(p.value.length<k.value.length-1){let n=function(){u<.1?(cancelAnimationFrame(ee.value),p.value.push(l),h.value=h.value.map((i,c)=>l===c?{...i,value:0}:i),w.value=!1):(w.value=!0,u/=1.1,h.value=h.value.map((i,c)=>l===c?{...i,value:u}:i),ee.value=requestAnimationFrame(n))};n()}X("selectLegend",x.value.map(n=>({name:n.name,color:n.color,value:n.value})))}const x=e.computed(()=>(h.value.forEach((l,r)=>{if([null,void 0].includes(l.values))return{...l,values:[]}}),h.value.map((l,r)=>({...l,seriesIndex:r})).filter((l,r)=>!p.value.includes(r)))),le=e.computed(()=>y.dataset.map((l,r)=>({name:l.name,color:o.convertColorToHex(l.color)||Q.value[r]||o.palette[r]||o.palette[r%o.palette.length],value:(l.values||[]).reduce((a,u)=>a+u,0),shape:"circle"})).map((l,r)=>({...l,proportion:l.value/y.dataset.map(a=>(a.values||[]).reduce((u,n)=>u+n,0)).reduce((a,u)=>a+u,0),opacity:p.value.includes(r)?.5:1,segregate:()=>te(r),isSegregated:p.value.includes(r)}))),me=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,fontWeight:t.value.style.chart.legend.bold?"bold":""})),m=e.computed(()=>{const l=Math.min(s.value.width/3,s.value.height/3);return l<55?55:l}),C=e.computed(()=>o.makeDonut({series:x.value},s.value.width/2,s.value.height/2,m.value,m.value,1.99999,2,1,360,105.25,F.value));function _(l){return l.proportion*100>t.value.style.chart.layout.labels.dataLabels.hideUnderValue}function ae(l,r){const a=l.value/be(r);return isNaN(a)?0:o.applyDataLabel(t.value.style.chart.layout.labels.percentage.formatter,a*100,o.dataLabel({v:a*100,s:"%",r:t.value.style.chart.layout.labels.percentage.rounding}),{datapoint:l})}function be(l){return[...l].map(r=>r.value).reduce((r,a)=>r+a,0)}const d=e.computed(()=>x.value.map(l=>l.value).reduce((l,r)=>l+r,0)),oe=e.computed(()=>d.value/x.value.length),D=e.ref(null),L=e.ref(!1);function ge({datapoint:l,relativeIndex:r,seriesIndex:a,show:u=!1}){D.value={datapoint:l,seriesIndex:a,config:t.value,series:k.value},O.value=u,b.value=r;let n="";const i=t.value.style.chart.tooltip.customFormat;if(L.value=!1,o.isFunction(i))try{const c=i({seriesIndex:a,datapoint:l,series:k.value,config:t.value});typeof c=="string"&&(T.value=c,L.value=!0)}catch{console.warn("Custom format cannot be applied."),L.value=!1}if(!L.value){if(n+=`<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>`,n+=`<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&&(n+=`<b>${o.applyDataLabel(t.value.style.chart.layout.labels.value.formatter,l.value,o.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,relativeIndex:r,seriesIndex:a})}</b>`),t.value.style.chart.tooltip.showPercentage){const c=o.applyDataLabel(t.value.style.chart.layout.labels.percentage.formatter,l.proportion*100,o.dataLabel({v:l.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage}),{datapoint:l,relativeIndex:r,seriesIndex:a});t.value.style.chart.tooltip.showValue?n+=`<span>(${c})</span></div>`:n+=`<b>${c}%</b></div>`}t.value.style.chart.comments.showInTooltip&&l.comment&&(n+=`<div class="vue-data-ui-tooltip-comment" style="background:${l.color}20; padding: 6px; margin-bottom: 6px; margin-top:6px; border-left: 1px solid ${l.color}">${l.comment}</div>`),T.value=`<div>${n}</div>`}}function P(l){return t.value.useBlurOnHover&&![null,void 0].includes(b.value)&&b.value!==l?`url(#blur_${f.value})`:""}const g=e.computed(()=>{const l=x.value.map(a=>({name:a.name,color:a.color})),r=x.value.map(a=>a.value);return{head:l,body:r}});function re(){e.nextTick(()=>{const l=g.value.head.map((u,n)=>[[u.name],[g.value.body[n]],[isNaN(g.value.body[n]/d.value)?"-":g.value.body[n]/d.value*100]]),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=o.createCsvContent(r);o.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-donut"})})}const V=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>',o.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%"],r=g.value.head.map((n,i)=>{const c=o.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:n.color,name:n.name},c,isNaN(g.value.body[i]/d.value)?"-":(g.value.body[i]/d.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]}),a={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:r,config:a}}),N=e.ref(!1);function ke(l){N.value=l,U.value+=1}const ue=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent));function we(l){return l.toFixed(t.value.style.chart.legend.roundingPercentage).split("").map(r=>"-").join("")}function z(l,r){X("selectDatapoint",{datapoint:l,index:r})}function ne(){v.value.showTable=!v.value.showTable}function se(){v.value.dataLabels.show=!v.value.dataLabels.show}function ce(){v.value.showTooltip=!v.value.showTooltip}return he({getData:pe,generatePdf:J,generateCsv:re,generateImage:K,toggleTable:ne,toggleLabels:se,toggleTooltip:ce}),(l,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"donutChart",ref:$,class:e.normalizeClass(`vue-ui-donut ${N.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height:100%;":""} text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`donut__${f.value}`},[e.renderSlot(l.$slots,"userConfig",{},void 0,!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[(e.openBlock(),e.createBlock(Ce._sfc_main,{key:`title_${q.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"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&S.value?(e.openBlock(),e.createBlock(ve.UserOptions,{ref_key:"details",ref:ye,key:`user_option_${U.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(j),isImaging:e.unref(W),uid:f.value,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:N.value,chartElement:$.value,isTooltip:v.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},onToggleFullscreen:ke,onGeneratePdf:e.unref(J),onGenerateCsv:re,onGenerateImage:e.unref(K),onToggleTable:ne,onToggleLabels:se,onToggleTooltip:ce},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.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:u})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasLabel","hasFullscreen","isFullscreen","chartElement","isTooltip","titles","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":N.value,"vue-data-ui-fulscreen--off":!N.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[t.value.style.chart.useGradient?(e.openBlock(),e.createElementBlock("radialGradient",{key:0,id:`gradient_${f.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,0),"stop-opacity":"0"},null,8,Oe),e.createElementVNode("stop",{offset:"60%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,0),"stop-opacity":"0"},null,8,Te),e.createElementVNode("stop",{offset:"77%","stop-color":e.unref(o.setOpacity)("#FFFFFF",t.value.style.chart.gradientIntensity)},null,8,Fe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,0),"stop-opacity":"0"},null,8,De)],8,ze)):e.createCommentVNode("",!0)]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${f.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2,id:`blur_std_${f.value}`},null,8,Me),Xe],8,Pe),e.createElementVNode("filter",{id:`shadow_${f.value}`,"color-interpolation-filters":"sRGB"},[e.createElementVNode("feDropShadow",{dx:"0",dy:"0",stdDeviation:"10","flood-opacity":"0.5","flood-color":t.value.style.chart.layout.donut.shadowColor},null,8,Ie)],8,Ae)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(a,u)=>(e.openBlock(),e.createElementBlock("g",null,[_(a)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("path",{key:0,d:e.unref(o.calcNutArrowPath)(a,{x:s.value.width/2,y:s.value.height/2},16,16,!1,!1,F.value),stroke:a.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",filter:P(u)},null,8,qe)):e.createCommentVNode("",!0)]))),256)),e.createElementVNode("circle",{cx:s.value.width/2,cy:s.value.height/2,r:m.value<=0?10:m.value,fill:t.value.style.chart.backgroundColor,filter:t.value.style.chart.layout.donut.useShadow?`url(#shadow_${f.value})`:""},null,8,Re),d.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(a,u)=>(e.openBlock(),e.createElementBlock("path",{stroke:t.value.style.chart.backgroundColor,d:a.arcSlice,fill:"#FFFFFF"},null,8,Ge))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(a,u)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:a.arcSlice,fill:e.unref(o.setOpacity)(a.color,80),stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.donut.borderWidth,filter:P(u)},null,8,Ye))),256))],64)):(e.openBlock(),e.createElementBlock("circle",{key:1,cx:s.value.width/2,cy:s.value.height/2,r:m.value<=0?10:m.value,fill:t.value.style.chart.backgroundColor,stroke:e.unref(o.adaptColorToBackground)(t.value.style.chart.background)},null,8,Ue)),t.value.style.chart.useGradient?(e.openBlock(),e.createElementBlock("circle",{key:2,cx:s.value.width/2,cy:s.value.height/2,r:m.value<=0?10:m.value,fill:`url(#gradient_${f.value})`},null,8,He)):e.createCommentVNode("",!0),d.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(C.value,(a,u)=>(e.openBlock(),e.createElementBlock("path",{"data-cy-donut-trap":"",d:a.arcSlice,fill:b.value===u?"rgba(0,0,0,0.1)":"transparent",onMouseenter:n=>ge({datapoint:a,relativeIndex:u,seriesIndex:a.seriesIndex,show:!0}),onMouseleave:r[0]||(r[0]=n=>{O.value=!1,b.value=null}),onClick:n=>z(a,u)},null,40,je))),256)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.total.show?(e.openBlock(),e.createElementBlock("text",{key:4,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2-(t.value.style.chart.layout.labels.hollow.average.show?t.value.style.chart.layout.labels.hollow.total.fontSize:0)+t.value.style.chart.layout.labels.hollow.total.offsetY,fill:t.value.style.chart.layout.labels.hollow.total.color,"font-size":t.value.style.chart.layout.labels.hollow.total.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.total.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.layout.labels.hollow.total.text),13,We)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.total.show?(e.openBlock(),e.createElementBlock("text",{key:5,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2+t.value.style.chart.layout.labels.hollow.total.fontSize-(t.value.style.chart.layout.labels.hollow.average.show?t.value.style.chart.layout.labels.hollow.total.fontSize:0)+t.value.style.chart.layout.labels.hollow.total.value.offsetY,fill:t.value.style.chart.layout.labels.hollow.total.value.color,"font-size":t.value.style.chart.layout.labels.hollow.total.value.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.total.value.bold?"bold":""}`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.hollow.total.value.formatter,d.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.labels.hollow.total.value.prefix,v:d.value,s:t.value.style.chart.layout.labels.hollow.total.value.suffix}))),13,Je)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.average.show?(e.openBlock(),e.createElementBlock("text",{key:6,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2+(t.value.style.chart.layout.labels.hollow.total.show?t.value.style.chart.layout.labels.hollow.average.fontSize:0)+t.value.style.chart.layout.labels.hollow.average.offsetY,fill:t.value.style.chart.layout.labels.hollow.average.color,"font-size":t.value.style.chart.layout.labels.hollow.average.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.average.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.layout.labels.hollow.average.text),13,Ke)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.average.show?(e.openBlock(),e.createElementBlock("text",{key:7,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2+(t.value.style.chart.layout.labels.hollow.total.show?t.value.style.chart.layout.labels.hollow.average.fontSize:0)+t.value.style.chart.layout.labels.hollow.average.fontSize+t.value.style.chart.layout.labels.hollow.average.value.offsetY,fill:t.value.style.chart.layout.labels.hollow.average.value.color,"font-size":t.value.style.chart.layout.labels.hollow.average.value.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.average.value.bold?"bold":""}`)},e.toDisplayString(w.value?"--":e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.hollow.average.value.formatter,oe.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.labels.hollow.average.value.prefix,v:oe.value,s:t.value.style.chart.layout.labels.hollow.average.value.suffix,r:t.value.style.chart.layout.labels.hollow.average.value.rounding}))),13,Qe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(a,u)=>(e.openBlock(),e.createElementBlock("g",{filter:P(u),class:e.normalizeClass({animated:t.value.useCssAnimation})},[t.value.style.chart.layout.labels.dataLabels.useLabelSlots?(e.openBlock(),e.createElementBlock("g",et,[(e.openBlock(),e.createElementBlock("foreignObject",{x:e.unref(o.calcMarkerOffsetX)(a,!0).anchor==="end"?e.unref(o.calcMarkerOffsetX)(a).x-120:e.unref(o.calcMarkerOffsetX)(a,!0).anchor==="middle"?e.unref(o.calcMarkerOffsetX)(a).x-60:e.unref(o.calcMarkerOffsetX)(a).x,y:e.unref(o.calcMarkerOffsetY)(a)-(ue.value?20:0),width:"120",height:"60",style:{overflow:"visible"}},[e.createElementVNode("div",null,[e.renderSlot(l.$slots,"dataLabel",e.normalizeProps(e.guardReactiveProps({datapoint:a,isBlur:!t.value.useBlurOnHover||[null,void 0].includes(b.value)||b.value===u,isSafari:ue.value,isVisible:_(a)&&v.value.dataLabels.show,textAlign:e.unref(o.calcMarkerOffsetX)(a,!0,16,!0).anchor,flexAlign:e.unref(o.calcMarkerOffsetX)(a,!0,16).anchor,percentage:ae(a,C.value)})),void 0,!0)])],8,tt))])):(e.openBlock(),e.createElementBlock("g",lt,[_(a)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:e.unref(o.calcMarkerOffsetX)(a).x,cy:e.unref(o.calcMarkerOffsetY)(a)-3.5,fill:a.color,r:3,filter:!t.value.useBlurOnHover||[null,void 0].includes(b.value)||b.value===u?"":`url(#blur_${f.value})`,onClick:n=>z(a,u)},null,8,at)):e.createCommentVNode("",!0),_(a)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":e.unref(o.calcMarkerOffsetX)(a,!0,12).anchor,x:e.unref(o.calcMarkerOffsetX)(a,!0,12).x,y:e.unref(o.calcMarkerOffsetY)(a),fill:t.value.style.chart.layout.labels.percentage.color,"font-size":t.value.style.chart.layout.labels.percentage.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.percentage.bold?"bold":""}`),onClick:n=>z(a,u)},e.toDisplayString(ae(a,C.value))+" "+e.toDisplayString(t.value.style.chart.layout.labels.value.show?`(${e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.value.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.value.rounding}),{datapoint:a})})`:""),13,ot)):e.createCommentVNode("",!0),_(a)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":e.unref(o.calcMarkerOffsetX)(a).anchor,x:e.unref(o.calcMarkerOffsetX)(a,!0,12).x,y:e.unref(o.calcMarkerOffsetY)(a)+t.value.style.chart.layout.labels.percentage.fontSize,fill:t.value.style.chart.layout.labels.name.color,"font-size":t.value.style.chart.layout.labels.name.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.name.bold?"bold":""}`),onClick:n=>z(a,u)},e.toDisplayString(a.name),13,rt)):e.createCommentVNode("",!0)])),v.value.dataLabels.show&&t.value.style.chart.comments.show&&a.comment?(e.openBlock(),e.createElementBlock("g",ut,[_(a)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:t.value.style.chart.comments.offsetX+(e.unref(o.calcMarkerOffsetX)(a,!0).anchor==="end"?e.unref(o.calcMarkerOffsetX)(a).x-t.value.style.chart.comments.width:e.unref(o.calcMarkerOffsetX)(a,!0).anchor==="middle"?e.unref(o.calcMarkerOffsetX)(a).x-t.value.style.chart.comments.width/2:e.unref(o.calcMarkerOffsetX)(a).x),y:e.unref(o.calcMarkerOffsetY)(a)+24+t.value.style.chart.comments.offsetY,width:t.value.style.chart.comments.width,height:"200",style:{overflow:"visible","pointer-events":"none"}},[e.createElementVNode("div",null,[e.renderSlot(l.$slots,"plot-comment",{plot:{...a,textAlign:e.unref(o.calcMarkerOffsetX)(a,!0,16,!0).anchor,flexAlign:e.unref(o.calcMarkerOffsetX)(a,!0,16).anchor}},void 0,!0)])],8,nt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,Ze))),256)),e.renderSlot(l.$slots,"svg",{svg:s.value},void 0,!0)],14,Ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",st,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(j)||e.unref(W)})),void 0,!0)])):e.createCommentVNode("",!0),S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Se.default,{key:4,config:{type:"donut",style:{backgroundColor:t.value.style.chart.backgroundColor,donut:{color:"#CCCCCC",strokeWidth:F.value*.8}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:I},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Be.Legend,{key:`legend_${G.value}`,legendSet:le.value,config:me.value,onClickMarker:r[1]||(r[1]=({i:a})=>te(a))},{item:e.withCtx(({legend:a,index:u})=>[e.createElementVNode("div",{onClick:n=>a.segregate(),style:e.normalizeStyle(`opacity:${p.value.includes(u)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.value.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:a,index:u}))+" ",1),p.value.includes(u)?(e.openBlock(),e.createElementBlock("span",vt," ( "+e.toDisplayString(we(a.proportion*100))+" % ) ",1)):(e.openBlock(),e.createElementBlock("span",it," ("+e.toDisplayString(isNaN(a.value/d.value)?"-":e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.percentage.formatter,w.value?a.proportion*100:a.value/d.value*100,e.unref(o.dataLabel)({v:w.value?a.proportion*100:a.value/d.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage})))+") ",1))],12,ct)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"legend",{legend:le.value},void 0,!0)],512),e.createVNode(_e._sfc_main,{show:v.value.showTooltip&&O.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:$.value,content:T.value,isCustom:L.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...D.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...D.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),S.value?(e.openBlock(),e.createBlock($e.default,{key:5,hideDetails:"",config:{open:v.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(xe.DataTable,{key:`table_${R.value}`,colNames:V.value.colNames,head:V.value.head,body:V.value.body,config:V.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[2]||(r[2]=a=>v.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,dt)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name?a.name:isNaN(Number(a))?a.includes("%")?e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.percentage.formatter,a,e.unref(o.dataLabel)({v:a,s:"%",r:t.value.style.chart.layout.labels.percentage.rounding})):a:e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.value.formatter,a,e.unref(o.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.value.rounding}))),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Ee))}},ft=Le._export_sfc(ht,[["__scopeId","data-v-21a9622a"]]);exports.default=ft;
@@ -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 F, createBlock as S, createCommentVNode as g, unref as d, createSlots as ze, withCtx as _, renderSlot as C, normalizeProps as ue, guardReactiveProps as ie, Fragment as w, renderList as $, createElementVNode as n, toDisplayString as L, createTextVNode as ce, nextTick as Xe } from "vue";
2
- import { u as Se, c as de, t as Ae, o as Ne, e as ve, g as Te, s as he, B as Pe, f as z, X as ye, i as V, l as be, h as fe, q as Ge, r as De } from "./index-CaV1s-yZ.js";
2
+ import { u as Se, c as de, t as Ae, o as Ne, e as ve, g as Te, v as he, C as Pe, f as z, X as ye, i as V, l as be, h as fe, q as Ge, r as De } from "./index-DP8dqFNd.js";
3
3
  import { t as Ie, u as Me } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as Fe } from "./Title-gUz6GDA3.js";
5
- import { u as Oe, U as Ee } from "./usePrinter-rvJyT65A.js";
6
- import { D as Ve } from "./DataTable-e2fnfjXV.js";
7
- import He from "./vue-ui-skeleton-CvFX_ExX.js";
8
- import { L as We } from "./Legend-5cQ0xZjK.js";
9
- import Be from "./vue-ui-accordion-CpzGQ63y.js";
10
- import { u as ge } from "./useNestedProp-tWCzZrLx.js";
11
- import { _ as Re } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ import { _ as Fe } from "./Title-Bx-VO3md.js";
5
+ import { u as Oe, U as Ee } from "./usePrinter-DiuHo4LO.js";
6
+ import { D as Ve } from "./DataTable-y1lX5jVj.js";
7
+ import He from "./vue-ui-skeleton-B30ZhUV7.js";
8
+ import { L as We } from "./Legend-BLXcdrri.js";
9
+ import Re from "./vue-ui-accordion-Dl8zkZPk.js";
10
+ import { u as ge } from "./useNestedProp-B-oZxD4x.js";
11
+ import { _ as Be } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
12
  const Ue = ["id"], je = ["xmlns", "viewBox"], qe = { key: 0 }, Ye = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ze = { key: 1 }, Je = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ke = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Qe = { key: 2 }, et = ["x", "y", "font-size", "fill", "font-weight"], tt = ["x", "y", "font-size", "fill"], lt = { key: 3 }, at = ["x", "y", "font-size", "fill", "font-weight"], st = ["id"], ot = ["stop-color"], rt = ["stop-color"], nt = ["stop-color"], ut = ["id"], it = ["stop-color"], ct = ["stop-color"], dt = ["stop-color"], vt = ["id"], ht = ["stop-color"], yt = ["stop-color"], bt = ["id"], ft = ["stop-color"], gt = ["stop-color"], mt = { key: 0 }, pt = ["d", "fill"], _t = { key: 1 }, xt = ["x", "y", "height", "width", "fill"], kt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Ct = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], wt = { key: 2 }, $t = ["x", "y", "fill", "font-size"], Lt = { key: 3 }, zt = ["x", "y", "fill", "font-size"], Xt = {
13
13
  key: 3,
14
14
  class: "vue-data-ui-watermark"
@@ -37,7 +37,7 @@ const Ue = ["id"], je = ["xmlns", "viewBox"], qe = { key: 0 }, Ye = ["x1", "x2",
37
37
  set(l) {
38
38
  return l;
39
39
  }
40
- }), h = y(de()), H = y(0), T = y(null), W = y(null), B = y(null), R = y(0), U = y(0), j = y(0), e = p({
40
+ }), h = y(de()), H = y(0), T = y(null), W = y(null), R = y(null), B = y(0), U = y(0), j = y(0), e = p({
41
41
  get: () => q(),
42
42
  set: (l) => l
43
43
  });
@@ -54,7 +54,7 @@ const Ue = ["id"], je = ["xmlns", "viewBox"], qe = { key: 0 }, Ye = ["x1", "x2",
54
54
  } : l;
55
55
  }
56
56
  oe(() => m.config, (l) => {
57
- e.value = q(), Y(), R.value += 1, U.value += 1, j.value += 1, v.value = e.value.style.chart.rowHeight, A.value = e.value.style.chart.width;
57
+ e.value = q(), Y(), B.value += 1, U.value += 1, j.value += 1, v.value = e.value.style.chart.rowHeight, A.value = e.value.style.chart.width;
58
58
  }, { deep: !0 }), oe(() => m.dataset, (l) => {
59
59
  te();
60
60
  }, { deep: !0 });
@@ -83,7 +83,7 @@ const Ue = ["id"], je = ["xmlns", "viewBox"], qe = { key: 0 }, Ye = ["x1", "x2",
83
83
  const { width: u, height: t } = Me({
84
84
  chart: T.value,
85
85
  title: e.value.style.chart.title.text ? W.value : null,
86
- legend: e.value.style.chart.legend.show ? B.value : null
86
+ legend: e.value.style.chart.legend.show ? R.value : null
87
87
  });
88
88
  A.value = u, v.value = t / m.dataset.length, b.value = D();
89
89
  });
@@ -268,7 +268,7 @@ const Ue = ["id"], je = ["xmlns", "viewBox"], qe = { key: 0 }, Ye = ["x1", "x2",
268
268
  style: F(`width:100%;background:${e.value.style.chart.backgroundColor};padding-bottom:24px`)
269
269
  }, [
270
270
  (o(), S(Fe, {
271
- key: `title_${R.value}`,
271
+ key: `title_${B.value}`,
272
272
  config: {
273
273
  title: {
274
274
  cy: "donut-div-title",
@@ -585,7 +585,7 @@ const Ue = ["id"], je = ["xmlns", "viewBox"], qe = { key: 0 }, Ye = ["x1", "x2",
585
585
  }, null, 8, ["config"])),
586
586
  n("div", {
587
587
  ref_key: "chartLegend",
588
- ref: B
588
+ ref: R
589
589
  }, [
590
590
  e.value.style.chart.legend.show && X.value ? (o(), S(We, {
591
591
  key: `legend_${j.value}`,
@@ -618,7 +618,7 @@ const Ue = ["id"], je = ["xmlns", "viewBox"], qe = { key: 0 }, Ye = ["x1", "x2",
618
618
  legend: le.value
619
619
  }, void 0, !0)
620
620
  ], 512),
621
- X.value ? (o(), S(Be, {
621
+ X.value ? (o(), S(Re, {
622
622
  key: 5,
623
623
  hideDetails: "",
624
624
  config: {
@@ -660,7 +660,7 @@ const Ue = ["id"], je = ["xmlns", "viewBox"], qe = { key: 0 }, Ye = ["x1", "x2",
660
660
  }, 8, ["config"])) : g("", !0)
661
661
  ], 14, Ue));
662
662
  }
663
- }, Rt = /* @__PURE__ */ Re(Tt, [["__scopeId", "data-v-29e2319d"]]);
663
+ }, Bt = /* @__PURE__ */ Be(Tt, [["__scopeId", "data-v-29e2319d"]]);
664
664
  export {
665
- Rt as default
665
+ Bt as default
666
666
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BTgtr0F8.cjs"),R=require("./useResponsive-B3TrDDIG.cjs"),le=require("./Title-3EduyW4p.cjs"),W=require("./usePrinter-DzTaA1eh.cjs"),ae=require("./DataTable-CsNozyz7.cjs"),oe=require("./vue-ui-skeleton-CMQzFTs9.cjs"),re=require("./Legend-DgFd-O0m.cjs"),se=require("./vue-ui-accordion-7e4Myhcg.cjs"),U=require("./useNestedProp-CisbRRo_.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ue=["id"],ce=["xmlns","viewBox"],ie={key:0},de=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ve={key:1},he=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ye=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],me={key:2},fe=["x","y","font-size","fill","font-weight"],be=["x","y","font-size","fill"],ge={key:3},pe=["x","y","font-size","fill","font-weight"],ke=["id"],_e=["stop-color"],xe=["stop-color"],Ce=["stop-color"],we=["id"],Be=["stop-color"],Ne=["stop-color"],Ee=["stop-color"],Le=["id"],$e=["stop-color"],Se=["stop-color"],Ve=["id"],ze=["stop-color"],Xe=["stop-color"],Ae={key:0},Pe=["d","fill"],Te={key:1},De=["x","y","height","width","fill"],Fe=["cx","cy","r","fill","stroke","stroke-width"],Me=["cx","cy","r","fill","stroke","stroke-width"],Ge={key:2},Ie=["x","y","fill","font-size"],He={key:3},Oe=["x","y","fill","font-size"],qe={key:3,class:"vue-data-ui-watermark"},Re=["xmlns","height","width"],We=["fill"],Ue=["innerHTML"],je={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(j,{expose:Y,emit:Ze}){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),S=e.ref(null),V=e.ref(0),z=e.ref(0),X=e.ref(0),t=e.computed({get:()=>A(),set:a=>a});function A(){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=A(),P(),V.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(()=>{P()});function P(){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?S.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 H=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 O(){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:O,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:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[(e.openBlock(),e.createBlock(le._sfc_main,{key:`title_${V.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"]))],4)):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,onToggleFullscreen:Q,onGeneratePdf:e.unref(F),onGenerateCsv:O,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","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:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",ie,[(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,de))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ve,[(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,he))),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,ye)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",me,[(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,fe))),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,be))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",ge,[(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,pe))),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,_e),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,xe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ce)],8,ke),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,Be),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Ee)],8,we)]),(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,$e),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Se)],8,Le),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,ze),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Xe)],8,Ve)]),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-CzjC8LfY.cjs"),R=require("./useResponsive-B3TrDDIG.cjs"),le=require("./Title-BSpa3uge.cjs"),W=require("./usePrinter-DiLM6jav.cjs"),ae=require("./DataTable-C5TOiC61.cjs"),oe=require("./vue-ui-skeleton-CwqzJlQf.cjs"),re=require("./Legend-CGGD8NhP.cjs"),se=require("./vue-ui-accordion-DpI7fTKZ.cjs"),U=require("./useNestedProp-CY7DebVH.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ue=["id"],ce=["xmlns","viewBox"],ie={key:0},de=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ve={key:1},he=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ye=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],me={key:2},fe=["x","y","font-size","fill","font-weight"],be=["x","y","font-size","fill"],ge={key:3},pe=["x","y","font-size","fill","font-weight"],ke=["id"],_e=["stop-color"],xe=["stop-color"],Ce=["stop-color"],we=["id"],Be=["stop-color"],Ne=["stop-color"],Ee=["stop-color"],Le=["id"],$e=["stop-color"],Se=["stop-color"],Ve=["id"],ze=["stop-color"],Xe=["stop-color"],Ae={key:0},Pe=["d","fill"],Te={key:1},De=["x","y","height","width","fill"],Fe=["cx","cy","r","fill","stroke","stroke-width"],Me=["cx","cy","r","fill","stroke","stroke-width"],Ge={key:2},Ie=["x","y","fill","font-size"],He={key:3},Oe=["x","y","fill","font-size"],qe={key:3,class:"vue-data-ui-watermark"},Re=["xmlns","height","width"],We=["fill"],Ue=["innerHTML"],je={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(j,{expose:Y,emit:Ze}){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),S=e.ref(null),V=e.ref(0),z=e.ref(0),X=e.ref(0),t=e.computed({get:()=>A(),set:a=>a});function A(){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=A(),P(),V.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(()=>{P()});function P(){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?S.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 H=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 O(){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:O,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:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[(e.openBlock(),e.createBlock(le._sfc_main,{key:`title_${V.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"]))],4)):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,onToggleFullscreen:Q,onGeneratePdf:e.unref(F),onGenerateCsv:O,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","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:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",ie,[(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,de))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ve,[(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,he))),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,ye)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",me,[(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,fe))),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,be))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",ge,[(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,pe))),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,_e),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,xe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ce)],8,ke),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,Be),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Ee)],8,we)]),(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,$e),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Se)],8,Le),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,ze),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Xe)],8,Ve)]),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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BTgtr0F8.cjs"),he=require("./Title-3EduyW4p.cjs"),Z=require("./usePrinter-DzTaA1eh.cjs"),fe=require("./DataTable-CsNozyz7.cjs"),ve=require("./vue-ui-accordion-7e4Myhcg.cjs"),me=require("./vue-ui-skeleton-CMQzFTs9.cjs"),J=require("./useNestedProp-CisbRRo_.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ge=["id"],ke=["xmlns","viewBox"],ye=["id"],be=["stop-color"],we=["stop-color"],Ce=["d","fill","stroke","stroke-width"],Ne=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],xe=["x","y","font-size","fill"],$e=["x","y","font-size","fill"],Be={key:2,class:"vue-data-ui-watermark"},_e=["innerHTML"],Ee={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(K,{expose:Q}){const f=K,{vue_ui_flow:ee}=r.useConfig(),x=e.computed(()=>!!f.dataset&&f.dataset.length);e.onMounted(()=>{P()});function P(){r.objectIsEmpty(f.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:f.config,defaultConfig:ee});return l.theme?{...J.useNestedProp({userConfig:r.themes.vue_ui_flow[l.theme]||f.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>f.config,l=>{t.value=I(),P(),z.value+=1},{deep:!0});const{isPrinting:H,isImaging:O,generatePdf:M,generateImage:V}=Z.usePrinter({elementId:`flow_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),B=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),_=e.computed(()=>!f.dataset||!f.dataset.length?[]:f.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})}_.value.forEach(([s,a,i])=>{n(s),n(a),l[s].outflow+=i,l[a].inflow+=i});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,c){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=c),o[c]||(o[c]=[]),o[c].includes(u)||o[c].push(u)}l.forEach(([u,c,h],k)=>{const p=n[u]?n[u].level:0,N=p+1;s(u,p),s(c,N),n[u].children||(n[u].children=[]),n[u].children.push({target:c,value:h}),n[u].outflow+=h,n[c].inflow+=h}),Object.keys(n).forEach((u,c)=>{n[u].color=B.value[c]||B.value[c%B.value.length]||r.palette[c]||r.palette[c%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 c=0;o[u].forEach((h,k)=>{const p=n[h].height;a[h]={x:parseInt(u,10)*Y.value+t.value.style.chart.padding.left,y:c,absoluteY:c,height:p,i:k,color:n[h].color,value:oe(p)},c+=p+D.value})}const i=[];for(const u in n){let c=a[u].absoluteY;n[u].children&&n[u].children.forEach(({target:h,value:k},p)=>{const N=a[h].y,S=a[u],T=a[h],A=r.checkNaN(c),W=r.checkNaN(c+k/n[u].outflow*S.height),X=r.checkNaN(N),R=r.checkNaN(N+k/n[h].inflow*T.height),de={id:r.createUid(),source:u,target:h,path:`M ${r.checkNaN(S.x)+r.checkNaN(g.value)} ${A} L ${r.checkNaN(S.x)+r.checkNaN(g.value)} ${W} L ${r.checkNaN(T.x)} ${R} L ${r.checkNaN(T.x)} ${X} Z`,value:k,sourceColor:n[u].color,targetColor:n[h].color};i.push(de),c+=W-A,a[h].y+=R-X})}return{nodeCoordinates:a,links:i}}const v=e.computed(()=>{const l=ne(f.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:i}=l[s];n[a]||(n[a]=0),n[a]+=i+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=_.value.length*Y.value;return{height:ae.value+l+s,width:n+Math.max(...v.value.nodes.map(i=>i.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 _.value.forEach(([a,i,u])=>{n[a]||(n[a]=[]),o[i]||(o[i]=[]),n[a].push(i),o[i].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 ce(){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,i)=>[{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 ie(){return v.value}function j(){b.value.showTable=!b.value.showTable}return Q({getData:ie,generateCsv:U,generateImage:V,generatePdf:M,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",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[(e.openBlock(),e.createBlock(he._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"]))],4)):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,onToggleFullscreen:te,onGeneratePdf:e.unref(M),onGenerateCsv:U,onGenerateImage:e.unref(V),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","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:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(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,be),e.createElementVNode("stop",{offset:"100%","stop-color":o.targetColor},null,8,we)],8,ye))),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,Ce))),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=>ce()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(o.name)?1:.2:1}`)},null,44,Ne))),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,xe))),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,$e))),256)),e.renderSlot(l.$slots,"svg",{svg:E.value},void 0,!0)],14,ke)),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[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(fe.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,_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,ge))}},Se=pe._export_sfc(Ee,[["__scopeId","data-v-948bb0e4"]]);exports.default=Se;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CzjC8LfY.cjs"),he=require("./Title-BSpa3uge.cjs"),Z=require("./usePrinter-DiLM6jav.cjs"),fe=require("./DataTable-C5TOiC61.cjs"),ve=require("./vue-ui-accordion-DpI7fTKZ.cjs"),me=require("./vue-ui-skeleton-CwqzJlQf.cjs"),J=require("./useNestedProp-CY7DebVH.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ge=["id"],ke=["xmlns","viewBox"],ye=["id"],be=["stop-color"],we=["stop-color"],Ce=["d","fill","stroke","stroke-width"],Ne=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],xe=["x","y","font-size","fill"],$e=["x","y","font-size","fill"],Be={key:2,class:"vue-data-ui-watermark"},_e=["innerHTML"],Ee={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(K,{expose:Q}){const f=K,{vue_ui_flow:ee}=r.useConfig(),x=e.computed(()=>!!f.dataset&&f.dataset.length);e.onMounted(()=>{P()});function P(){r.objectIsEmpty(f.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:f.config,defaultConfig:ee});return l.theme?{...J.useNestedProp({userConfig:r.themes.vue_ui_flow[l.theme]||f.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>f.config,l=>{t.value=I(),P(),z.value+=1},{deep:!0});const{isPrinting:H,isImaging:O,generatePdf:M,generateImage:V}=Z.usePrinter({elementId:`flow_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),B=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),_=e.computed(()=>!f.dataset||!f.dataset.length?[]:f.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})}_.value.forEach(([s,a,i])=>{n(s),n(a),l[s].outflow+=i,l[a].inflow+=i});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,c){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=c),o[c]||(o[c]=[]),o[c].includes(u)||o[c].push(u)}l.forEach(([u,c,h],k)=>{const p=n[u]?n[u].level:0,N=p+1;s(u,p),s(c,N),n[u].children||(n[u].children=[]),n[u].children.push({target:c,value:h}),n[u].outflow+=h,n[c].inflow+=h}),Object.keys(n).forEach((u,c)=>{n[u].color=B.value[c]||B.value[c%B.value.length]||r.palette[c]||r.palette[c%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 c=0;o[u].forEach((h,k)=>{const p=n[h].height;a[h]={x:parseInt(u,10)*Y.value+t.value.style.chart.padding.left,y:c,absoluteY:c,height:p,i:k,color:n[h].color,value:oe(p)},c+=p+D.value})}const i=[];for(const u in n){let c=a[u].absoluteY;n[u].children&&n[u].children.forEach(({target:h,value:k},p)=>{const N=a[h].y,S=a[u],T=a[h],A=r.checkNaN(c),W=r.checkNaN(c+k/n[u].outflow*S.height),X=r.checkNaN(N),R=r.checkNaN(N+k/n[h].inflow*T.height),de={id:r.createUid(),source:u,target:h,path:`M ${r.checkNaN(S.x)+r.checkNaN(g.value)} ${A} L ${r.checkNaN(S.x)+r.checkNaN(g.value)} ${W} L ${r.checkNaN(T.x)} ${R} L ${r.checkNaN(T.x)} ${X} Z`,value:k,sourceColor:n[u].color,targetColor:n[h].color};i.push(de),c+=W-A,a[h].y+=R-X})}return{nodeCoordinates:a,links:i}}const v=e.computed(()=>{const l=ne(f.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:i}=l[s];n[a]||(n[a]=0),n[a]+=i+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=_.value.length*Y.value;return{height:ae.value+l+s,width:n+Math.max(...v.value.nodes.map(i=>i.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 _.value.forEach(([a,i,u])=>{n[a]||(n[a]=[]),o[i]||(o[i]=[]),n[a].push(i),o[i].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 ce(){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,i)=>[{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 ie(){return v.value}function j(){b.value.showTable=!b.value.showTable}return Q({getData:ie,generateCsv:U,generateImage:V,generatePdf:M,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",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[(e.openBlock(),e.createBlock(he._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"]))],4)):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,onToggleFullscreen:te,onGeneratePdf:e.unref(M),onGenerateCsv:U,onGenerateImage:e.unref(V),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","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:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(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,be),e.createElementVNode("stop",{offset:"100%","stop-color":o.targetColor},null,8,we)],8,ye))),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,Ce))),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=>ce()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(o.name)?1:.2:1}`)},null,44,Ne))),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,xe))),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,$e))),256)),e.renderSlot(l.$slots,"svg",{svg:E.value},void 0,!0)],14,ke)),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[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(fe.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,_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,ge))}},Se=pe._export_sfc(Ee,[["__scopeId","data-v-948bb0e4"]]);exports.default=Se;
@@ -1,11 +1,11 @@
1
- import { computed as m, onMounted as He, ref as y, watch as Le, openBlock as r, createElementBlock as h, normalizeClass as ce, normalizeStyle as C, createBlock as O, createCommentVNode as T, unref as i, createSlots as Ee, withCtx as k, renderSlot as x, normalizeProps as de, guardReactiveProps as ve, createElementVNode as S, Fragment as P, renderList as F, toDisplayString as U, createVNode as Oe, createTextVNode as Se, nextTick as Me } from "vue";
2
- import { u as ze, o as Ye, e as De, c as fe, t as Ge, a as Be, p as V, b as Ae, s as v, f as he, X as Ue, E as me, H as Ve, i as je, q as Xe, r as We } from "./index-CaV1s-yZ.js";
3
- import { _ as qe } from "./Title-gUz6GDA3.js";
4
- import { u as Re, U as Ze } from "./usePrinter-rvJyT65A.js";
5
- import { D as Je } from "./DataTable-e2fnfjXV.js";
6
- import Ke from "./vue-ui-accordion-CpzGQ63y.js";
7
- import Qe from "./vue-ui-skeleton-CvFX_ExX.js";
8
- import { u as ge } from "./useNestedProp-tWCzZrLx.js";
1
+ import { computed as m, onMounted as Le, ref as y, watch as He, openBlock as r, createElementBlock as h, normalizeClass as ce, normalizeStyle as C, createBlock as E, createCommentVNode as T, unref as i, createSlots as Oe, withCtx as k, renderSlot as x, normalizeProps as de, guardReactiveProps as ve, createElementVNode as S, Fragment as P, renderList as F, toDisplayString as U, createVNode as Ee, createTextVNode as Se, nextTick as Me } from "vue";
2
+ import { u as ze, o as Ye, e as De, c as fe, t as Ge, a as Be, p as V, b as Ae, v, f as he, X as Ue, F as me, I as Ve, i as je, q as Xe, r as We } from "./index-DP8dqFNd.js";
3
+ import { _ as qe } from "./Title-Bx-VO3md.js";
4
+ import { u as Re, U as Ze } from "./usePrinter-DiuHo4LO.js";
5
+ import { D as Je } from "./DataTable-y1lX5jVj.js";
6
+ import Ke from "./vue-ui-accordion-Dl8zkZPk.js";
7
+ import Qe from "./vue-ui-skeleton-B30ZhUV7.js";
8
+ import { u as ge } from "./useNestedProp-B-oZxD4x.js";
9
9
  import { _ as et } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
10
  const tt = ["id"], lt = ["xmlns", "viewBox"], ot = ["id"], at = ["stop-color"], nt = ["stop-color"], st = ["d", "fill", "stroke", "stroke-width"], ut = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "onMouseenter"], rt = ["x", "y", "font-size", "fill"], it = ["x", "y", "font-size", "fill"], ct = {
11
11
  key: 2,
@@ -28,7 +28,7 @@ const tt = ["id"], lt = ["xmlns", "viewBox"], ot = ["id"], at = ["stop-color"],
28
28
  },
29
29
  setup(pe, { expose: be }) {
30
30
  const g = pe, { vue_ui_flow: ye } = ze(), M = m(() => !!g.dataset && g.dataset.length);
31
- He(() => {
31
+ Le(() => {
32
32
  j();
33
33
  });
34
34
  function j() {
@@ -58,7 +58,7 @@ const tt = ["id"], lt = ["xmlns", "viewBox"], ot = ["id"], at = ["stop-color"],
58
58
  customPalette: Be[t.theme] || V
59
59
  } : t;
60
60
  }
61
- Le(() => g.config, (t) => {
61
+ He(() => g.config, (t) => {
62
62
  e.value = R(), j(), q.value += 1;
63
63
  }, { deep: !0 });
64
64
  const { isPrinting: Z, isImaging: J, generatePdf: K, generateImage: Q } = Re({
@@ -98,8 +98,8 @@ const tt = ["id"], lt = ["xmlns", "viewBox"], ot = ["id"], at = ["stop-color"],
98
98
  o[s] || (o[s] = { height: 0, level: null, inflow: 0, outflow: 0 }), o[s].level === null && (o[s].level = u), l[u] || (l[u] = []), l[u].includes(s) || l[u].push(s);
99
99
  }
100
100
  t.forEach(([s, u, f], _) => {
101
- const w = o[s] ? o[s].level : 0, E = w + 1;
102
- n(s, w), n(u, E), o[s].children || (o[s].children = []), o[s].children.push({ target: u, value: f }), o[s].outflow += f, o[u].inflow += f;
101
+ const w = o[s] ? o[s].level : 0, O = w + 1;
102
+ n(s, w), n(u, O), o[s].children || (o[s].children = []), o[s].children.push({ target: u, value: f }), o[s].outflow += f, o[u].inflow += f;
103
103
  }), Object.keys(o).forEach((s, u) => {
104
104
  o[s].color = Y.value[u] || Y.value[u % Y.value.length] || V[u] || V[u % d.length];
105
105
  });
@@ -125,7 +125,7 @@ const tt = ["id"], lt = ["xmlns", "viewBox"], ot = ["id"], at = ["stop-color"],
125
125
  for (const s in o) {
126
126
  let u = a[s].absoluteY;
127
127
  o[s].children && o[s].children.forEach(({ target: f, value: _ }, w) => {
128
- const E = a[f].y, B = a[s], A = a[f], se = v(u), ue = v(u + _ / o[s].outflow * B.height), re = v(E), ie = v(E + _ / o[f].inflow * A.height), Ie = {
128
+ const O = a[f].y, B = a[s], A = a[f], se = v(u), ue = v(u + _ / o[s].outflow * B.height), re = v(O), ie = v(O + _ / o[f].inflow * A.height), Ie = {
129
129
  id: fe(),
130
130
  source: s,
131
131
  target: f,
@@ -175,12 +175,12 @@ const tt = ["id"], lt = ["xmlns", "viewBox"], ot = ["id"], at = ["stop-color"],
175
175
  o[a] || (o[a] = []), l[c] || (l[c] = []), o[a].push(c), l[c].push(a);
176
176
  }), o[t] && o[t].forEach((a) => n.add(a)), l[t] && l[t].forEach((a) => n.add(a)), Array.from(n).concat(t);
177
177
  }
178
- const b = y(null), H = y(null);
178
+ const b = y(null), L = y(null);
179
179
  function Te(t) {
180
- b.value = Ne(t.name), H.value = t.name;
180
+ b.value = Ne(t.name), L.value = t.name;
181
181
  }
182
182
  function Pe() {
183
- b.value = null, H.value = null;
183
+ b.value = null, L.value = null;
184
184
  }
185
185
  const oe = m(() => p.value.links.map(({ source: t, target: o, sourceColor: l, targetColor: n, value: a }) => ({
186
186
  source: t,
@@ -210,7 +210,7 @@ const tt = ["id"], lt = ["xmlns", "viewBox"], ot = ["id"], at = ["stop-color"],
210
210
  });
211
211
  });
212
212
  }
213
- const L = m(() => {
213
+ const H = m(() => {
214
214
  const t = [
215
215
  e.value.table.columnNames.source,
216
216
  e.value.table.columnNames.target,
@@ -277,7 +277,7 @@ const tt = ["id"], lt = ["xmlns", "viewBox"], ot = ["id"], at = ["stop-color"],
277
277
  key: 0,
278
278
  style: C(`width:100%;background:${e.value.style.chart.backgroundColor};padding-bottom:24px`)
279
279
  }, [
280
- (r(), O(qe, {
280
+ (r(), E(qe, {
281
281
  key: `title_${q.value}`,
282
282
  config: {
283
283
  title: {
@@ -291,7 +291,7 @@ const tt = ["id"], lt = ["xmlns", "viewBox"], ot = ["id"], at = ["stop-color"],
291
291
  }
292
292
  }, null, 8, ["config"]))
293
293
  ], 4)) : T("", !0),
294
- e.value.userOptions.show && M.value ? (r(), O(Ze, {
294
+ e.value.userOptions.show && M.value ? (r(), E(Ze, {
295
295
  ref: "details",
296
296
  key: `user_option_${W.value}`,
297
297
  backgroundColor: e.value.style.chart.backgroundColor,
@@ -312,7 +312,7 @@ const tt = ["id"], lt = ["xmlns", "viewBox"], ot = ["id"], at = ["stop-color"],
312
312
  onGenerateCsv: ae,
313
313
  onGenerateImage: i(Q),
314
314
  onToggleTable: ne
315
- }, Ee({ _: 2 }, [
315
+ }, Oe({ _: 2 }, [
316
316
  t.$slots.optionPdf ? {
317
317
  name: "optionPdf",
318
318
  fn: k(() => [
@@ -379,7 +379,7 @@ const tt = ["id"], lt = ["xmlns", "viewBox"], ot = ["id"], at = ["stop-color"],
379
379
  fill: `url(#${l.id})`,
380
380
  stroke: e.value.style.chart.links.stroke,
381
381
  "stroke-width": e.value.style.chart.links.strokeWidth,
382
- style: C(`opacity:${H.value ? [l.target, l.source].includes(H.value) ? 1 : 0.3 : e.value.style.chart.links.opacity}`)
382
+ style: C(`opacity:${L.value ? [l.target, l.source].includes(L.value) ? 1 : 0.3 : e.value.style.chart.links.opacity}`)
383
383
  }, null, 12, st))), 256)),
384
384
  (r(!0), h(P, null, F(p.value.nodes, (l, n) => (r(), h("rect", {
385
385
  class: "vue-ui-flow-node",
@@ -425,7 +425,7 @@ const tt = ["id"], lt = ["xmlns", "viewBox"], ot = ["id"], at = ["stop-color"],
425
425
  t.$slots.watermark ? (r(), h("div", ct, [
426
426
  x(t.$slots, "watermark", de(ve({ isPrinting: i(Z) || i(J) })), void 0, !0)
427
427
  ])) : T("", !0),
428
- M.value ? T("", !0) : (r(), O(Qe, {
428
+ M.value ? T("", !0) : (r(), E(Qe, {
429
429
  key: 3,
430
430
  config: {
431
431
  type: "flow",
@@ -434,7 +434,7 @@ const tt = ["id"], lt = ["xmlns", "viewBox"], ot = ["id"], at = ["stop-color"],
434
434
  }
435
435
  }
436
436
  }, null, 8, ["config"])),
437
- M.value ? (r(), O(Ke, {
437
+ M.value ? (r(), E(Ke, {
438
438
  key: 4,
439
439
  hideDetails: "",
440
440
  config: {
@@ -451,11 +451,11 @@ const tt = ["id"], lt = ["xmlns", "viewBox"], ot = ["id"], at = ["stop-color"],
451
451
  }
452
452
  }, {
453
453
  content: k(() => [
454
- Oe(Je, {
455
- colNames: L.value.colNames,
456
- head: L.value.head,
457
- body: L.value.body,
458
- config: L.value.config,
454
+ Ee(Je, {
455
+ colNames: H.value.colNames,
456
+ head: H.value.head,
457
+ body: H.value.body,
458
+ config: H.value.config,
459
459
  title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
460
460
  onClose: o[1] || (o[1] = (l) => I.value.showTable = !1)
461
461
  }, {