vue-data-ui 2.4.74 → 2.4.76

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 (151) hide show
  1. package/dist/{Arrow-Mxl3cE0a.cjs → Arrow-BEL6nGJ5.cjs} +1 -1
  2. package/dist/{Arrow-f8DrP940.js → Arrow-SYMRLSHC.js} +1 -1
  3. package/dist/{BaseIcon-gX2bfcgU.cjs → BaseIcon-Udj2sWh1.cjs} +1 -1
  4. package/dist/{BaseIcon-CkORyrSo.js → BaseIcon-wfQ35Ioa.js} +1 -1
  5. package/dist/{DataTable-DLDlPv_3.js → DataTable-CC3rD9iV.js} +2 -2
  6. package/dist/{DataTable-BBUJJu-a.cjs → DataTable-RY8EUwF3.cjs} +1 -1
  7. package/dist/{Legend-DGRS4QbF.js → Legend-BBFx9L7u.js} +2 -2
  8. package/dist/{Legend-gbTs_R5j.cjs → Legend-CZrlsh2W.cjs} +1 -1
  9. package/dist/{PackageVersion-CKTJ6FRx.cjs → PackageVersion-C1zaH_aJ.cjs} +1 -1
  10. package/dist/{PackageVersion-BN4d5Mju.js → PackageVersion-Cc8-1SRE.js} +1 -1
  11. package/dist/{PenAndPaper-CXPVm0x2.js → PenAndPaper-BKX-8o1h.js} +3 -3
  12. package/dist/{PenAndPaper-D0ovdUpL.cjs → PenAndPaper-Bv8oV7l0.cjs} +1 -1
  13. package/dist/{Shape-BL37b4be.js → Shape-CSj0rOyf.js} +1 -1
  14. package/dist/{Shape-CJanTg1E.cjs → Shape-CuDuYYKF.cjs} +1 -1
  15. package/dist/{Slicer-BV8oAJSi.js → Slicer-4vVJHlL9.js} +86 -89
  16. package/dist/Slicer-De-C8OB8.cjs +1 -0
  17. package/dist/{Title-BxMjvERL.js → Title-CmyP_ypC.js} +1 -1
  18. package/dist/{Title-pZYqvru0.cjs → Title-m5N0oN0G.cjs} +1 -1
  19. package/dist/{Tooltip-BdS8OwyH.cjs → Tooltip-Dq7633oz.cjs} +1 -1
  20. package/dist/{Tooltip-VA-KbJNH.js → Tooltip-Dz6sXvS2.js} +1 -1
  21. package/dist/{index-DXdrUwnE.cjs → index-CH3YkGpv.cjs} +1 -1
  22. package/dist/{index-BU-qdyPq.js → index-CpNLsWVB.js} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useNestedProp-Dq1Hv5-T.cjs → useNestedProp-2TBYsJKg.cjs} +1 -1
  25. package/dist/{useNestedProp-CWSJ5eBm.js → useNestedProp-C14snYQ3.js} +1 -1
  26. package/dist/{usePrinter-BaRMqUmy.cjs → usePrinter-A1_US3Dh.cjs} +1 -1
  27. package/dist/{usePrinter-CIccmyRB.js → usePrinter-D76t2otk.js} +1 -1
  28. package/dist/{vue-data-ui-C8XrgRJI.js → vue-data-ui-0qqDFsDV.js} +60 -60
  29. package/dist/{vue-data-ui-6KXT0ciT.cjs → vue-data-ui-C3B3pxcE.cjs} +1 -1
  30. package/dist/vue-data-ui.cjs +1 -1
  31. package/dist/vue-data-ui.js +1 -1
  32. package/dist/{vue-ui-3d-bar-okEBsdwr.cjs → vue-ui-3d-bar-DsPyvRtf.cjs} +1 -1
  33. package/dist/{vue-ui-3d-bar-DRN43xXL.js → vue-ui-3d-bar-vXI86Ftg.js} +9 -9
  34. package/dist/{vue-ui-accordion-CrpdF6x_.js → vue-ui-accordion-7RGF7sa1.js} +3 -3
  35. package/dist/{vue-ui-accordion-DTreR2ia.cjs → vue-ui-accordion-_LFrGkGx.cjs} +1 -1
  36. package/dist/{vue-ui-age-pyramid-FBgwGDWm.js → vue-ui-age-pyramid-CotXvsaD.js} +10 -10
  37. package/dist/{vue-ui-age-pyramid-Bw1lrQYU.cjs → vue-ui-age-pyramid-ac5bW1yE.cjs} +1 -1
  38. package/dist/{vue-ui-annotator-zYiopESW.js → vue-ui-annotator-C1RLefPu.js} +1 -1
  39. package/dist/{vue-ui-annotator-CkZcyLxZ.cjs → vue-ui-annotator-LO2QBLr-.cjs} +1 -1
  40. package/dist/{vue-ui-bullet-_MP7ORsc.cjs → vue-ui-bullet-CngMCn0G.cjs} +1 -1
  41. package/dist/{vue-ui-bullet-DLxUYT0j.js → vue-ui-bullet-DZknfpTt.js} +8 -8
  42. package/dist/{vue-ui-candlestick-CE8l0E99.js → vue-ui-candlestick-BIhS1XvX.js} +11 -11
  43. package/dist/{vue-ui-candlestick-HoWXPs7Q.cjs → vue-ui-candlestick-BrHsZWBD.cjs} +1 -1
  44. package/dist/{vue-ui-carousel-table-Ci5W6-bg.cjs → vue-ui-carousel-table-CEYvDVp-.cjs} +1 -1
  45. package/dist/{vue-ui-carousel-table-DmOO2PA_.js → vue-ui-carousel-table-DQOyjYrs.js} +4 -4
  46. package/dist/{vue-ui-chestnut-BlfviIgB.cjs → vue-ui-chestnut-Ck7UKhm3.cjs} +1 -1
  47. package/dist/{vue-ui-chestnut-ByXqVTnh.js → vue-ui-chestnut-DOB6e1ur.js} +8 -8
  48. package/dist/{vue-ui-cursor-NoqkcW0L.js → vue-ui-cursor-BaFPplLP.js} +2 -2
  49. package/dist/{vue-ui-cursor-rIjH2zyf.cjs → vue-ui-cursor-DbR8dGQz.cjs} +1 -1
  50. package/dist/{vue-ui-dashboard-CgBPME45.cjs → vue-ui-dashboard-BiYrjIXc.cjs} +1 -1
  51. package/dist/{vue-ui-dashboard-BoaY7cXL.js → vue-ui-dashboard-CU1IswIu.js} +2 -2
  52. package/dist/{vue-ui-digits-B71jvXr9.js → vue-ui-digits-Ccu0VX39.js} +2 -2
  53. package/dist/{vue-ui-digits-nYTnd2Ic.cjs → vue-ui-digits-LLkWsjVe.cjs} +1 -1
  54. package/dist/{vue-ui-donut-ChHP1PpF.js → vue-ui-donut-BZbOZXBY.js} +12 -12
  55. package/dist/{vue-ui-donut-WBtSyY9a.cjs → vue-ui-donut-DzqE2EQ1.cjs} +1 -1
  56. package/dist/{vue-ui-donut-evolution-VMmH1IA9.cjs → vue-ui-donut-evolution-BDBugP7m.cjs} +1 -1
  57. package/dist/{vue-ui-donut-evolution-DokwtS8l.js → vue-ui-donut-evolution-DtgcRiGo.js} +11 -11
  58. package/dist/{vue-ui-dumbbell-DlCsDwQc.js → vue-ui-dumbbell-CeWOqVMa.js} +10 -10
  59. package/dist/{vue-ui-dumbbell-Coj5MhHG.cjs → vue-ui-dumbbell-Dg6X5Vj5.cjs} +1 -1
  60. package/dist/{vue-ui-flow-QuV3KlvH.js → vue-ui-flow-CjG35xEC.js} +9 -9
  61. package/dist/{vue-ui-flow-D8N1A4yB.cjs → vue-ui-flow-CoAgjhdm.cjs} +1 -1
  62. package/dist/{vue-ui-funnel-Dd8Ugq8D.js → vue-ui-funnel-D8c4Gp8b.js} +9 -9
  63. package/dist/{vue-ui-funnel-DxiTZ2to.cjs → vue-ui-funnel-hjZrLAhZ.cjs} +1 -1
  64. package/dist/{vue-ui-galaxy-CC2zkvaK.js → vue-ui-galaxy-2WU_lJvz.js} +11 -11
  65. package/dist/{vue-ui-galaxy-CBODDw5-.cjs → vue-ui-galaxy-DfTXwfQR.cjs} +1 -1
  66. package/dist/{vue-ui-gauge-5AmstOj6.js → vue-ui-gauge-Bj4H5esH.js} +7 -7
  67. package/dist/{vue-ui-gauge-CZCvxqnk.cjs → vue-ui-gauge-C_IgZirr.cjs} +1 -1
  68. package/dist/{vue-ui-gizmo-ki8VB6Il.js → vue-ui-gizmo-CFUkIE1e.js} +3 -3
  69. package/dist/{vue-ui-gizmo-C9hXRs45.cjs → vue-ui-gizmo-Dbsg9oG_.cjs} +1 -1
  70. package/dist/{vue-ui-heatmap-Xrd0iBR9.cjs → vue-ui-heatmap-DECng1-9.cjs} +1 -1
  71. package/dist/{vue-ui-heatmap-BobomFtt.js → vue-ui-heatmap-Df4woeNc.js} +10 -10
  72. package/dist/{vue-ui-history-plot-CvpOjW5M.cjs → vue-ui-history-plot-C0X1_s96.cjs} +1 -1
  73. package/dist/{vue-ui-history-plot-BMmox8vC.js → vue-ui-history-plot-DHUuanXy.js} +11 -11
  74. package/dist/{vue-ui-kpi-D9BefH7y.cjs → vue-ui-kpi-CGrN8rrL.cjs} +1 -1
  75. package/dist/{vue-ui-kpi-C3D-wJxM.js → vue-ui-kpi-d5eW2MQ3.js} +3 -3
  76. package/dist/{vue-ui-mini-loader-DquA0CGg.cjs → vue-ui-mini-loader-C2-zQHTF.cjs} +1 -1
  77. package/dist/{vue-ui-mini-loader-DJMxt_Yu.js → vue-ui-mini-loader-DRUBgzI9.js} +2 -2
  78. package/dist/{vue-ui-molecule-DxSJsN7o.cjs → vue-ui-molecule-Bst8lERC.cjs} +1 -1
  79. package/dist/{vue-ui-molecule-Bbnf1oQV.js → vue-ui-molecule-CqQBdd27.js} +11 -11
  80. package/dist/{vue-ui-mood-radar-j2q_SJKg.cjs → vue-ui-mood-radar-BM7pbHlc.cjs} +1 -1
  81. package/dist/{vue-ui-mood-radar-L5L5doFl.js → vue-ui-mood-radar-oB1S4QFm.js} +11 -11
  82. package/dist/{vue-ui-nested-donuts-C_jjyYj4.cjs → vue-ui-nested-donuts-BUcrd4TR.cjs} +1 -1
  83. package/dist/{vue-ui-nested-donuts-vADHGx-l.js → vue-ui-nested-donuts-DdgoTSGG.js} +11 -11
  84. package/dist/{vue-ui-onion-CSGIE3Qt.js → vue-ui-onion-BD4CSF0A.js} +11 -11
  85. package/dist/{vue-ui-onion-C5QYPmHs.cjs → vue-ui-onion-RimU8400.cjs} +1 -1
  86. package/dist/{vue-ui-parallel-coordinate-plot-CmZjVGQC.js → vue-ui-parallel-coordinate-plot-CTUm9M3z.js} +12 -12
  87. package/dist/{vue-ui-parallel-coordinate-plot-Br51qLaK.cjs → vue-ui-parallel-coordinate-plot-Cj8VtclE.cjs} +1 -1
  88. package/dist/{vue-ui-quadrant-BlHrFXK8.js → vue-ui-quadrant-DKrkCfAn.js} +12 -12
  89. package/dist/{vue-ui-quadrant-BbeKu161.cjs → vue-ui-quadrant-DjsY0y5B.cjs} +1 -1
  90. package/dist/{vue-ui-quick-chart-DBVrQP8_.js → vue-ui-quick-chart-BBCjtI-7.js} +9 -9
  91. package/dist/{vue-ui-quick-chart-BS952vkw.cjs → vue-ui-quick-chart-Dy7EL7ta.cjs} +1 -1
  92. package/dist/{vue-ui-radar-CiBjheSp.cjs → vue-ui-radar-B3SwUPOg.cjs} +1 -1
  93. package/dist/{vue-ui-radar-CidLKYZF.js → vue-ui-radar-D5ufpNKc.js} +12 -12
  94. package/dist/{vue-ui-rating-DgKSGsMB.js → vue-ui-rating-D4G-LFWR.js} +2 -2
  95. package/dist/{vue-ui-rating-2o13jgI8.cjs → vue-ui-rating-DzjVC24x.cjs} +1 -1
  96. package/dist/{vue-ui-relation-circle-PlvwrPkI.cjs → vue-ui-relation-circle-1pWCHVnC.cjs} +1 -1
  97. package/dist/{vue-ui-relation-circle-CzF-iYhR.js → vue-ui-relation-circle-WkD_rUnu.js} +7 -7
  98. package/dist/{vue-ui-rings-wKriCocs.js → vue-ui-rings-C8ty4dWD.js} +12 -12
  99. package/dist/{vue-ui-rings-CJz4x9z1.cjs → vue-ui-rings-CTYnhWv8.cjs} +1 -1
  100. package/dist/{vue-ui-scatter-u7bWFG0l.cjs → vue-ui-scatter-BQVPLg6A.cjs} +1 -1
  101. package/dist/{vue-ui-scatter-o43JXJk8.js → vue-ui-scatter-DfeNfnMl.js} +12 -12
  102. package/dist/{vue-ui-screenshot-DmfAnkcd.cjs → vue-ui-screenshot-C7lsivHN.cjs} +1 -1
  103. package/dist/{vue-ui-screenshot-Di3ghAes.js → vue-ui-screenshot-D03-LKwV.js} +1 -1
  104. package/dist/{vue-ui-skeleton-CpFbwUa0.js → vue-ui-skeleton-CIp8lMA6.js} +3 -3
  105. package/dist/{vue-ui-skeleton-CGcQKCRb.cjs → vue-ui-skeleton-DwmP0u2B.cjs} +1 -1
  106. package/dist/{vue-ui-smiley-BHGZIIT5.cjs → vue-ui-smiley-Bp-UbI5r.cjs} +1 -1
  107. package/dist/{vue-ui-smiley-C22iFSfg.js → vue-ui-smiley-_J08wXf9.js} +2 -2
  108. package/dist/{vue-ui-spark-trend-DN724wXO.cjs → vue-ui-spark-trend-UX4dEhft.cjs} +1 -1
  109. package/dist/{vue-ui-spark-trend-4RyTO6KO.js → vue-ui-spark-trend-iXsvKant.js} +5 -5
  110. package/dist/{vue-ui-sparkbar-CAeIw03m.cjs → vue-ui-sparkbar-BJ_rGX_Y.cjs} +1 -1
  111. package/dist/{vue-ui-sparkbar-BMlgQWPa.js → vue-ui-sparkbar-JQ4SIcqX.js} +4 -4
  112. package/dist/{vue-ui-sparkgauge-gqoNDivm.js → vue-ui-sparkgauge-Ci5Jx-i_.js} +4 -4
  113. package/dist/{vue-ui-sparkgauge-4vhb5HHM.cjs → vue-ui-sparkgauge-YQBQjjX1.cjs} +1 -1
  114. package/dist/{vue-ui-sparkhistogram-RlG3RXcP.cjs → vue-ui-sparkhistogram-C5UeFik2.cjs} +1 -1
  115. package/dist/{vue-ui-sparkhistogram-DwK5zbX7.js → vue-ui-sparkhistogram-D1VEZIa5.js} +5 -5
  116. package/dist/{vue-ui-sparkline-DFsuQ0EZ.js → vue-ui-sparkline-CRFYizW3.js} +4 -4
  117. package/dist/{vue-ui-sparkline-BLr009Hj.cjs → vue-ui-sparkline-fF9WenrE.cjs} +1 -1
  118. package/dist/{vue-ui-sparkstackbar-DyCg09cM.js → vue-ui-sparkstackbar-CWa5ELhE.js} +5 -5
  119. package/dist/{vue-ui-sparkstackbar-C19VkwTY.cjs → vue-ui-sparkstackbar-CynLB9us.cjs} +1 -1
  120. package/dist/{vue-ui-stackbar-nRMzIu4T.js → vue-ui-stackbar-DSammmJH.js} +13 -13
  121. package/dist/{vue-ui-stackbar-DLCS_VQY.cjs → vue-ui-stackbar-jQdQH0Pu.cjs} +1 -1
  122. package/dist/{vue-ui-strip-plot-DAmWiEPY.js → vue-ui-strip-plot-PxONzaXd.js} +11 -11
  123. package/dist/{vue-ui-strip-plot-BmQaPAOF.cjs → vue-ui-strip-plot-yE9w6drR.cjs} +1 -1
  124. package/dist/{vue-ui-table-72syvQe_.js → vue-ui-table-BskwuS44.js} +1 -1
  125. package/dist/{vue-ui-table-B3LNl3t-.cjs → vue-ui-table-DG5RXhLE.cjs} +1 -1
  126. package/dist/{vue-ui-table-heatmap-B4WDy_Pn.js → vue-ui-table-heatmap-CzxnV1-0.js} +4 -4
  127. package/dist/{vue-ui-table-heatmap-l_nKDJyv.cjs → vue-ui-table-heatmap-D9W-4tm9.cjs} +1 -1
  128. package/dist/{vue-ui-table-sparkline-ah9fkFGz.js → vue-ui-table-sparkline-BlQy5f88.js} +5 -5
  129. package/dist/{vue-ui-table-sparkline-D7_vOyHb.cjs → vue-ui-table-sparkline-DT8VzRHY.cjs} +1 -1
  130. package/dist/{vue-ui-thermometer-C9ibNBJH.js → vue-ui-thermometer-BBvQ4tYx.js} +7 -7
  131. package/dist/{vue-ui-thermometer-Yw0k4M4C.cjs → vue-ui-thermometer-CkJBESoa.cjs} +1 -1
  132. package/dist/{vue-ui-timer-wJ2ninrP.cjs → vue-ui-timer-CNp59qFF.cjs} +1 -1
  133. package/dist/{vue-ui-timer-C2HzHfH3.js → vue-ui-timer-DFvFQF6d.js} +5 -5
  134. package/dist/{vue-ui-tiremarks-BzUzmDhY.cjs → vue-ui-tiremarks-Cf1637KV.cjs} +1 -1
  135. package/dist/{vue-ui-tiremarks-QU7Chn0l.js → vue-ui-tiremarks-D4_LO9A5.js} +7 -7
  136. package/dist/{vue-ui-treemap-BnIhuhmM.js → vue-ui-treemap-CWoi0iKf.js} +11 -11
  137. package/dist/{vue-ui-treemap-B4WQ8w_w.cjs → vue-ui-treemap-Dnq85nnj.cjs} +1 -1
  138. package/dist/{vue-ui-vertical-bar-M-nqa4Xm.js → vue-ui-vertical-bar-DgfIA9-H.js} +12 -12
  139. package/dist/{vue-ui-vertical-bar-Da6Z_DL0.cjs → vue-ui-vertical-bar-pyVFnVaF.cjs} +1 -1
  140. package/dist/{vue-ui-waffle-C5Zoz6na.cjs → vue-ui-waffle-DGeQNIVJ.cjs} +1 -1
  141. package/dist/{vue-ui-waffle-DfQJjqlk.js → vue-ui-waffle-DQbEdVDN.js} +12 -12
  142. package/dist/{vue-ui-wheel-V0mjyb9G.js → vue-ui-wheel-B0vgQ4Ps.js} +7 -7
  143. package/dist/{vue-ui-wheel-CaelJ82w.cjs → vue-ui-wheel-Bhmjjfqi.cjs} +1 -1
  144. package/dist/{vue-ui-word-cloud-C7zTaiqX.js → vue-ui-word-cloud-XrUyNMpH.js} +10 -10
  145. package/dist/{vue-ui-word-cloud-BtdYYTox.cjs → vue-ui-word-cloud-hcJsrwPF.cjs} +1 -1
  146. package/dist/{vue-ui-xy-DQV_6n-g.js → vue-ui-xy--QLh9NlZ.js} +54 -54
  147. package/dist/{vue-ui-xy-CgmEtC0p.cjs → vue-ui-xy-B8WkCl69.cjs} +2 -2
  148. package/dist/{vue-ui-xy-canvas-C_Qbfc1s.cjs → vue-ui-xy-canvas-DO3kaKEf.cjs} +1 -1
  149. package/dist/{vue-ui-xy-canvas-BWFJ6yrJ.js → vue-ui-xy-canvas-mtxLsToQ.js} +11 -11
  150. package/package.json +1 -1
  151. package/dist/Slicer-C_yCrY6L.cjs +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-DXdrUwnE.cjs"),Ce=require("./useResponsive-BJ7DTGpm.cjs"),se=require("./BaseIcon-gX2bfcgU.cjs"),Ge=require("./Tooltip-BdS8OwyH.cjs"),ze=require("./usePrinter-BaRMqUmy.cjs"),Xe=require("./Slicer-C_yCrY6L.cjs"),Ye=require("./vue-ui-skeleton-CGcQKCRb.cjs"),Ne=require("./useNestedProp-Dq1Hv5-T.cjs"),Ze=require("./PackageVersion-CKTJ6FRx.cjs"),Je=require("./PenAndPaper-D0ovdUpL.cjs"),Qe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={LINE:"LINE",BAR:"BAR",DONUT:"DONUT"},Ke=["SERIE","SERIES","DATA","VALUE","VALUES","NUM"];function et({dataset:d,barLineSwitch:w=6}){let h=null,B=null,N=0;if((typeof d=="number"||typeof d=="string")&&console.warn(`The provided dataset (${d}) is not sufficient to build a chart`),K(d)&&(P(d)&&(d.length<w?h=S.BAR:h=S.LINE,B=d,N=d.length),ce(d))){if(!lt(d))return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."),!1;const U=Object.keys(d[0]),j=Object.values(d[0]);if(!U.some(A=>at(A)))return console.warn("The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important."),!1;Ve(j,A=>typeof A=="number")&&(h=S.DONUT,B=d),Ve(j,A=>Array.isArray(A)&&P(A))&&($e(d)>w?h=S.LINE:h=S.BAR,N=$e(d),B=d.map(A=>({...A,data:ot(A,F=>P(F))}))),d=d.map(A=>Fe(A)),B=B.map(A=>Fe(A))}return K(d)&&[...new Set(d.flatMap(U=>Array.isArray(U)))][0],{dataset:d,type:h,usableDataset:B,maxSeriesLength:N}}function Pe(d){return!d||K(d)&&!d.length}function K(d){return Array.isArray(d)}function P(d){if(!K(d)||Pe(d))return!1;const w=d.map(h=>Number(h));return![...new Set(w.flatMap(h=>typeof h=="number"&&!isNaN(h)))].includes(!1)}function ce(d){return!K(d)||Pe(d)||!![...new Set(d.flatMap(h=>typeof h=="object"&&!Array.isArray(h)))].includes(!1)?!1:!d.map(h=>Object.keys(h).length>0).includes(!1)}function tt(d,w){const h=Object.keys(d).sort(),B=Object.keys(w).sort();if(h.length!==B.length)return!1;for(let N=0;N<h.length;N+=1){const V=h[N],M=B[N];if(V!==M||typeof d[V]!=typeof w[M])return!1}return!0}function lt(d){if(d.length<=1)return!0;for(let w=0;w<d.length;w+=1)for(let h=w+1;h<d.length;h+=1)if(!tt(d[w],d[h]))return!1;return!0}function at(d){return Ke.includes(d.toUpperCase())}function Ve(d,w){let h=[];for(let B=0;B<d.length;B+=1)h.push(w(d[B]));return h.includes(!0)}function $e(d){return Math.max(...[...d].flatMap(w=>Object.values(w).filter(h=>P(h)).map(h=>h.length)))}function ot(d,w){return Object.values(d).filter(h=>w(h))[0]}function Fe(d){const w={};for(let h in d)d.hasOwnProperty(h)&&(w[h.toUpperCase()]=d[h]);return w}const Ie=d=>(e.pushScopeId("data-v-8b56f397"),d=d(),e.popScopeId(),d),nt=["id"],rt=["xmlns","viewBox"],it=["x","y","width","height"],ut=["x","y","width","height"],st=["width","height"],ct=["id"],dt=["id"],vt=Ie(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),mt=["id"],ht=["flood-color"],ft={key:0,class:"donut-label-connectors"},pt=["d","stroke","stroke-width","filter"],kt=["cx","cy","r","fill","filter"],gt={class:"donut"},yt=["d","fill","stroke","stroke-width","filter"],xt=["d","onMouseenter","onClick"],St={key:1,class:"donut-labels quick-animation"},bt=["cx","cy","fill","stroke","filter"],Bt=["text-anchor","x","y","fill","font-size","filter"],wt=["text-anchor","x","y","fill","font-size","filter"],Et={key:2,class:"donut-hollow quick-animation"},At=["x","y","font-size","fill"],Lt=["x","y","font-size","fill"],_t={key:0,class:"line-grid"},Ct=["x1","x2","y1","y2","stroke","stroke-width"],zt=["x1","x2","y1","y2","stroke","stroke-width"],Nt={key:1,class:"line-axis"},Vt=["x1","x2","y1","y2","stroke","stroke-width"],$t=["x1","x2","y1","y2","stroke","stroke-width"],Ft={key:2,class:"yLabels"},Pt=["x1","x2","y1","y2","stroke","stroke-width"],It=["x","y","font-size","fill"],Tt={key:3,class:"periodLabels"},Ot=["x1","x2","y1","y2","stroke","stroke-width"],Rt=["font-size","text-anchor","fill","transform"],Dt={class:"plots"},Mt={class:"line-plot-series"},Ut=["d","stroke","stroke-width"],qt=["d","stroke","stroke-width"],Ht=["d","stroke","stroke-width"],Wt=["d","stroke","stroke-width"],jt=["cx","cy","fill","stroke"],Gt={key:4,class:"dataLabels"},Xt=["font-size","fill","x","y"],Yt={class:"tooltip-traps"},Zt=["x","y","height","width","fill","onMouseenter","onClick"],Jt={key:0,class:"line-grid"},Qt=["x1","x2","y1","y2","stroke","stroke-width"],Kt=["x1","x2","y1","y2","stroke","stroke-width"],el={key:1,class:"line-axis"},tl=["x1","x2","y1","y2","stroke","stroke-width"],ll=["x1","x2","y1","y2","stroke","stroke-width"],al={key:2,class:"yLabels"},ol=["x1","x2","y1","y2","stroke","stroke-width"],nl=["x","y","font-size","fill"],rl={key:3,class:"periodLabels"},il=["x1","x2","y1","y2","stroke","stroke-width"],ul=["font-size","text-anchor","transform","fill"],sl={class:"plots"},cl=["x","width","height","y","fill","stroke","stroke-width"],dl=["to"],vl=["from","to"],ml={key:4,class:"dataLabels"},hl=["x","y","font-size","fill"],fl={class:"tooltip-traps"},pl=["x","y","height","width","fill","onMouseenter","onClick"],kl={key:6,class:"axis-labels"},gl={key:0},yl=["font-size","fill","x","y"],xl={key:1},Sl=["font-size","fill","x","y"],bl={key:2},Bl=["font-size","fill","transform"],wl={key:3},El=["font-size","fill","transform"],Al={key:6,class:"vue-data-ui-watermark"},Ll=["onClick"],_l=["onClick"],Cl=["onClick"],zl={key:1,class:"vue-ui-quick-chart-not-processable"},Nl=Ie(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),Vl={__name:"vue-ui-quick-chart",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}}},emits:["selectDatapoint","selectLegend"],setup(d,{expose:w,emit:h}){const B=d,{vue_ui_quick_chart:N}=i.useConfig(),V=e.ref(null),M=e.ref(null),U=e.ref(null),j=e.ref(null),A=e.ref(i.createUid()),F=e.ref(!1),G=e.ref(null),T=e.ref(""),$=e.ref(null),me=e.ref(null),he=e.ref(null),x=e.ref([]),fe=e.ref(0),ee=e.ref(0),t=e.computed({get:()=>ge(),set:a=>a}),Te=e.computed(()=>t.value.showUserOptionsOnChartHover),pe=e.computed(()=>t.value.keepUserOptionsStateOnChartLeave),te=e.ref(!t.value.showUserOptionsOnChartHover);function ke(a=!1){Te.value&&(te.value=a)}function ge(){const a=Ne.useNestedProp({userConfig:B.config,defaultConfig:N});let s={};return a.theme?s={...Ne.useNestedProp({userConfig:i.themes.vue_ui_quick_chart[a.theme]||B.config,defaultConfig:a}),customPalette:i.themePalettes[a.theme]||i.palette}:s=a,B.config&&i.hasDeepProperty(B.config,"zoomStartIndex")?s.zoomStartIndex=B.config.zoomStartIndex:s.zoomStartIndex=null,B.config&&i.hasDeepProperty(B.config,"zoomEndIndex")?s.zoomEndIndex=B.config.zoomEndIndex:s.zoomEndIndex=null,s}e.watch(()=>B.config,a=>{t.value=ge(),k.value.width=t.value.width,k.value.height=t.value.height,te.value=!t.value.showUserOptionsOnChartHover,Se()},{deep:!0}),e.watch(()=>B.dataset,a=>{f.value=Y.value,g.value.start=0,g.value.end=f.value.maxSeriesLength,ee.value+=1},{deep:!0});const X=e.computed(()=>i.convertCustomPalette(t.value.customPalette)),Y=e.computed(()=>{const a=et({dataset:i.sanitizeArray(B.dataset,["serie","series","data","value","values","num"]),barLineSwitch:t.value.chartIsBarUnderDatasetLength});return a||console.error("VueUiQuickChart : Dataset is not processable"),a}),f=e.ref(Y.value),Oe=e.computed(()=>!!f.value),b=e.computed(()=>f.value?f.value.type:null);e.watch(()=>b.value,a=>{a||i.error({componentName:"VueUiQuickChart",type:"dataset"})},{immediate:!0});const{isPrinting:le,isImaging:ae,generatePdf:ye,generateImage:xe}=ze.usePrinter({elementId:`${b.value}_${A.value}`,fileName:t.value.title||b.value}),Re=e.computed(()=>t.value.showUserOptions&&!t.value.title),k=e.ref({width:t.value.width,height:t.value.height}),oe=e.ref({showTooltip:t.value.showTooltip}),ne=e.ref(null);e.onMounted(()=>{Se()});function Se(){if(t.value.responsive){const a=Ce.throttle(()=>{const{width:s,height:l}=Ce.useResponsive({chart:V.value,title:t.value.title?M.value:null,legend:t.value.showLegend?U.value:null,slicer:[S.BAR,S.LINE].includes(b.value)&&t.value.zoomXy&&f.value.maxSeriesLength>1?j.value:null,source:me.value,noTitle:he.value});k.value.width=s,k.value.height=l});ne.value=new ResizeObserver(a),ne.value.observe(V.value.parentNode)}Le()}e.onBeforeUnmount(()=>{ne.value&&ne.value.disconnect()});const De=e.computed(()=>{switch(b.value){case S.LINE:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`;case S.BAR:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`;case S.DONUT:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`;default:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`}});function be(a){return[...a].map(s=>s.value).reduce((s,l)=>s+l,0)}function Z(a){return t.value.blurOnHover&&![null,void 0].includes($.value)&&$.value!==a?`url(#blur_${A.value})`:""}function Be(a,s){x.value.includes(a)?x.value=x.value.filter(l=>l!==a):x.value.length<s&&x.value.push(a)}const we=e.ref(null),Ee=e.ref(null),re=e.ref(!1);function Me(a,s){re.value=!0;let l=a.value;const r=Y.value.dataset.find((u,m)=>a.id===`donut_${m}`).VALUE;if(x.value.includes(a.id)){let u=function(){l>r?(re.value=!1,cancelAnimationFrame(Ee.value),f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:r,VALUE:r}:m)}):(l+=r*.025,f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:l,VALUE:l}:m)},Ee.value=requestAnimationFrame(u))};x.value=x.value.filter(m=>m!==a.id),u()}else if(s.length>1){let u=function(){l<r/100?(re.value=!1,cancelAnimationFrame(we.value),x.value.push(a.id),f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:0,VALUE:0}:m)}):(l/=1.1,f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:l,VALUE:l}:m)},we.value=requestAnimationFrame(u))};u()}}const I=e.ref(null);function Ue(a){I.value=a}const Ae=e.computed(()=>t.value.donutThicknessRatio<.15?.15:t.value.donutThicknessRatio>.4?.4:t.value.donutThicknessRatio),E=e.computed(()=>{if(b.value!==S.DONUT)return null;const a=f.value.dataset.map((o,n)=>({...o,value:o.VALUE||o.DATA||o.SERIE||o.VALUES||o.NUM||0,name:o.NAME||o.DESCRIPTION||o.TITLE||o.LABEL||`Serie ${n}`,id:`donut_${n}`})).map((o,n)=>({...o,color:o.COLOR?i.convertColorToHex(o.COLOR):X.value[n+t.value.paletteStartIndex]||i.palette[n+t.value.paletteStartIndex]||i.palette[(n+t.value.paletteStartIndex)%i.palette.length],immutableValue:o.value}));function s(o,n){return i.dataLabel({v:isNaN(o.value/be(n))?0:o.value/be(n)*100,s:"%",r:t.value.dataLabelRoundingPercentage})}function l(o){return o.proportion*100>t.value.donutHideLabelUnderPercentage}function r(o,n){const y=Y.value.dataset.find((L,C)=>`donut_${C}`===o).VALUE;return Math.abs(String(Number(y.toFixed(0))).length-String(Number(n.toFixed(0))).length)}function u({datapoint:o,seriesIndex:n}){G.value={datapoint:o,seriesIndex:n,config:t.value,dataset:a},$.value=o.id;const y=t.value.tooltipCustomFormat;if(i.isFunction(y)&&i.functionReturnsString(()=>y({datapoint:o,seriesIndex:n,series:a,config:t.value})))T.value=y({datapoint:o,seriesIndex:n,series:a,config:t.value});else{let p="";p+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,p+=`<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="${o.color}"/></svg>`,p+=`<b>${i.applyDataLabel(t.value.formatter,o.value,i.dataLabel({p:t.value.valuePrefix,v:o.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:o,seriesIndex:n})}</b>`,p+=`<span>(${i.dataLabel({v:o.proportion*100,s:"%",r:t.value.dataLabelRoundingPercentage})})</span></div>`,T.value=`<div>${p}</div>`}F.value=!0}function m(){F.value=!1,$.value=null,I.value=null}const _={centerX:k.value.width/2,centerY:k.value.height/2},z=a.filter(o=>!x.value.includes(o.id)).map(o=>o.value||0).reduce((o,n)=>o+n,0),H=a.map((o,n)=>({...o,proportion:(o.value||0)/z,value:o.value||0,absoluteValue:Y.value.dataset.find((y,p)=>`donut_${p}`===o.id).VALUE})),O=k.value.width/2,W=k.value.height/2,R=k.value.height*t.value.donutRadiusRatio;return{dataset:H.filter(o=>!x.value.includes(o.id)),legend:H,drawingArea:_,displayArcPercentage:s,isArcBigEnough:l,useTooltip:u,killTooltip:m,getSpaces:r,total:z,cx:O,cy:W,radius:R,chart:i.makeDonut({series:a.filter(o=>!x.value.includes(o.id))},O,W,R,R,1.99999,2,1,360,105.25,k.value.height*Ae.value)}}),g=e.ref({start:0,end:f.value.maxSeriesLength});function qe(){Le()}const q=e.ref(null);async function Le(){(t.value.zoomStartIndex!==null||t.value.zoomEndIndex!==null)&&q.value?(t.value.zoomStartIndex!==null&&(await e.nextTick(),await e.nextTick(),q.value&&q.value.setStartValue(t.value.zoomStartIndex)),t.value.zoomEndIndex!==null&&(await e.nextTick(),await e.nextTick(),q.value&&q.value.setEndValue(He(t.value.zoomEndIndex+1)))):(g.value={start:0,end:f.value.maxSeriesLength},ee.value+=1)}function He(a){const s=f.value.maxSeriesLength;return a>s?s:a<0||t.value.zoomStartIndex!==null&&a<t.value.zoomStartIndex?t.value.zoomStartIndex!==null?t.value.zoomStartIndex+1:1:a}const We=e.computed(()=>{if(!t.value.zoomMinimap.show||b.value===S.DONUT)return[];let a=[];P(f.value.dataset)&&(a=f.value.dataset),ce(f.value.dataset)&&(a=f.value.dataset.map((u,m)=>({values:u.VALUE||u.DATA||u.SERIE||u.SERIES||u.VALUES||u.NUM||0,id:b.value===S.LINE?`line_${m}`:`bar_${m}`})).filter(u=>!x.value.includes(u.id)));const s=P(a)?a.length:Math.max(...a.map(u=>u.values.length));let l=[];if(P(a))l=a;else for(let u=0;u<s;u+=1)l.push(a.map(m=>m.values[u]||0).reduce((m,_)=>(m||0)+(_||0),0));const r=Math.min(...l);return l.map(u=>u+(r<0?Math.abs(r):0))}),v=e.computed(()=>{if(b.value!==S.LINE)return null;const a={height:k.value.height,width:k.value.width},s={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:a.width-t.value.xyPaddingRight,bottom:a.height-t.value.xyPaddingBottom,width:a.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:a.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];P(f.value.dataset)&&(l=[{values:f.value.dataset.slice(g.value.start,g.value.end),absoluteIndices:f.value.dataset.map((o,n)=>n).slice(g.value.start,g.value.end),name:t.value.title,color:X.value[t.value.paletteStartIndex]||i.palette[t.value.paletteStartIndex],id:"line_0"}]),ce(f.value.dataset)&&(l=f.value.dataset.map((o,n)=>({...o,values:o.VALUE||o.DATA||o.SERIE||o.SERIES||o.VALUES||o.NUM||0,name:o.NAME||o.DESCRIPTION||o.TITLE||o.LABEL||`Serie ${n}`,id:`line_${n}`})).map((o,n)=>({...o,color:o.COLOR?i.convertColorToHex(o.COLOR):X.value[n+t.value.paletteStartIndex]||i.palette[n+t.value.paletteStartIndex]||i.palette[(n+t.value.paletteStartIndex)%i.palette.length],values:o.values.slice(g.value.start,g.value.end),absoluteIndices:o.values.map((y,p)=>p).slice(g.value.start,g.value.end)})));const r={max:Math.max(...l.filter(o=>!x.value.includes(o.id)).flatMap(o=>o.values)),min:Math.min(...l.filter(o=>!x.value.includes(o.id)).flatMap(o=>o.values)),maxSeries:Math.max(...l.map(o=>o.values.length))},u=i.calculateNiceScale(r.min<0?r.min:0,r.max<0?0:r.max,t.value.xyScaleSegments),m=r.min<0?Math.abs(r.min):0,_=r.max<0?s.top:s.bottom-m/(u.max+m)*s.height,z=s.width/r.maxSeries,H=u.ticks.map(o=>({y:s.bottom-s.height*((o+m)/(u.max+m)),x:s.left-8,value:o})),O=l.map((o,n)=>({...o,coordinates:o.values.map((y,p)=>({x:s.left+z*(p+1)-z/2,y:s.bottom-(y+m)/(u.max+m)*s.height,value:y}))})).map(o=>{let n=[];return o.coordinates.forEach(y=>{n.push(`${y.x},${y.y} `)}),{...o,linePath:n.join(" ")}});function W(o){$.value=o,I.value=o;const n=l.map(p=>({...p,value:p.values[o],absoluteIndex:p.absoluteIndices[o]})).filter(p=>!x.value.includes(p.id));G.value={datapoint:n,seriesIndex:o,config:t.value,dataset:l};const y=t.value.tooltipCustomFormat;if(i.isFunction(y)&&i.functionReturnsString(()=>y({datapoint:n,seriesIndex:o,series:l,config:t.value})))T.value=y({datapoint:n,seriesIndex:o,series:l,config:t.value});else{let p="";t.value.xyPeriods[n[0].absoluteIndex]&&(p+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[n[0].absoluteIndex]}</div>`),n.forEach((L,C)=>{p+=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-CH3YkGpv.cjs"),Ce=require("./useResponsive-BJ7DTGpm.cjs"),se=require("./BaseIcon-Udj2sWh1.cjs"),Ge=require("./Tooltip-Dq7633oz.cjs"),ze=require("./usePrinter-A1_US3Dh.cjs"),Xe=require("./Slicer-De-C8OB8.cjs"),Ye=require("./vue-ui-skeleton-DwmP0u2B.cjs"),Ne=require("./useNestedProp-2TBYsJKg.cjs"),Ze=require("./PackageVersion-C1zaH_aJ.cjs"),Je=require("./PenAndPaper-Bv8oV7l0.cjs"),Qe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={LINE:"LINE",BAR:"BAR",DONUT:"DONUT"},Ke=["SERIE","SERIES","DATA","VALUE","VALUES","NUM"];function et({dataset:d,barLineSwitch:w=6}){let h=null,B=null,N=0;if((typeof d=="number"||typeof d=="string")&&console.warn(`The provided dataset (${d}) is not sufficient to build a chart`),K(d)&&(P(d)&&(d.length<w?h=S.BAR:h=S.LINE,B=d,N=d.length),ce(d))){if(!lt(d))return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."),!1;const U=Object.keys(d[0]),j=Object.values(d[0]);if(!U.some(A=>at(A)))return console.warn("The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important."),!1;Ve(j,A=>typeof A=="number")&&(h=S.DONUT,B=d),Ve(j,A=>Array.isArray(A)&&P(A))&&($e(d)>w?h=S.LINE:h=S.BAR,N=$e(d),B=d.map(A=>({...A,data:ot(A,F=>P(F))}))),d=d.map(A=>Fe(A)),B=B.map(A=>Fe(A))}return K(d)&&[...new Set(d.flatMap(U=>Array.isArray(U)))][0],{dataset:d,type:h,usableDataset:B,maxSeriesLength:N}}function Pe(d){return!d||K(d)&&!d.length}function K(d){return Array.isArray(d)}function P(d){if(!K(d)||Pe(d))return!1;const w=d.map(h=>Number(h));return![...new Set(w.flatMap(h=>typeof h=="number"&&!isNaN(h)))].includes(!1)}function ce(d){return!K(d)||Pe(d)||!![...new Set(d.flatMap(h=>typeof h=="object"&&!Array.isArray(h)))].includes(!1)?!1:!d.map(h=>Object.keys(h).length>0).includes(!1)}function tt(d,w){const h=Object.keys(d).sort(),B=Object.keys(w).sort();if(h.length!==B.length)return!1;for(let N=0;N<h.length;N+=1){const V=h[N],M=B[N];if(V!==M||typeof d[V]!=typeof w[M])return!1}return!0}function lt(d){if(d.length<=1)return!0;for(let w=0;w<d.length;w+=1)for(let h=w+1;h<d.length;h+=1)if(!tt(d[w],d[h]))return!1;return!0}function at(d){return Ke.includes(d.toUpperCase())}function Ve(d,w){let h=[];for(let B=0;B<d.length;B+=1)h.push(w(d[B]));return h.includes(!0)}function $e(d){return Math.max(...[...d].flatMap(w=>Object.values(w).filter(h=>P(h)).map(h=>h.length)))}function ot(d,w){return Object.values(d).filter(h=>w(h))[0]}function Fe(d){const w={};for(let h in d)d.hasOwnProperty(h)&&(w[h.toUpperCase()]=d[h]);return w}const Ie=d=>(e.pushScopeId("data-v-8b56f397"),d=d(),e.popScopeId(),d),nt=["id"],rt=["xmlns","viewBox"],it=["x","y","width","height"],ut=["x","y","width","height"],st=["width","height"],ct=["id"],dt=["id"],vt=Ie(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),mt=["id"],ht=["flood-color"],ft={key:0,class:"donut-label-connectors"},pt=["d","stroke","stroke-width","filter"],kt=["cx","cy","r","fill","filter"],gt={class:"donut"},yt=["d","fill","stroke","stroke-width","filter"],xt=["d","onMouseenter","onClick"],St={key:1,class:"donut-labels quick-animation"},bt=["cx","cy","fill","stroke","filter"],Bt=["text-anchor","x","y","fill","font-size","filter"],wt=["text-anchor","x","y","fill","font-size","filter"],Et={key:2,class:"donut-hollow quick-animation"},At=["x","y","font-size","fill"],Lt=["x","y","font-size","fill"],_t={key:0,class:"line-grid"},Ct=["x1","x2","y1","y2","stroke","stroke-width"],zt=["x1","x2","y1","y2","stroke","stroke-width"],Nt={key:1,class:"line-axis"},Vt=["x1","x2","y1","y2","stroke","stroke-width"],$t=["x1","x2","y1","y2","stroke","stroke-width"],Ft={key:2,class:"yLabels"},Pt=["x1","x2","y1","y2","stroke","stroke-width"],It=["x","y","font-size","fill"],Tt={key:3,class:"periodLabels"},Ot=["x1","x2","y1","y2","stroke","stroke-width"],Rt=["font-size","text-anchor","fill","transform"],Dt={class:"plots"},Mt={class:"line-plot-series"},Ut=["d","stroke","stroke-width"],qt=["d","stroke","stroke-width"],Ht=["d","stroke","stroke-width"],Wt=["d","stroke","stroke-width"],jt=["cx","cy","fill","stroke"],Gt={key:4,class:"dataLabels"},Xt=["font-size","fill","x","y"],Yt={class:"tooltip-traps"},Zt=["x","y","height","width","fill","onMouseenter","onClick"],Jt={key:0,class:"line-grid"},Qt=["x1","x2","y1","y2","stroke","stroke-width"],Kt=["x1","x2","y1","y2","stroke","stroke-width"],el={key:1,class:"line-axis"},tl=["x1","x2","y1","y2","stroke","stroke-width"],ll=["x1","x2","y1","y2","stroke","stroke-width"],al={key:2,class:"yLabels"},ol=["x1","x2","y1","y2","stroke","stroke-width"],nl=["x","y","font-size","fill"],rl={key:3,class:"periodLabels"},il=["x1","x2","y1","y2","stroke","stroke-width"],ul=["font-size","text-anchor","transform","fill"],sl={class:"plots"},cl=["x","width","height","y","fill","stroke","stroke-width"],dl=["to"],vl=["from","to"],ml={key:4,class:"dataLabels"},hl=["x","y","font-size","fill"],fl={class:"tooltip-traps"},pl=["x","y","height","width","fill","onMouseenter","onClick"],kl={key:6,class:"axis-labels"},gl={key:0},yl=["font-size","fill","x","y"],xl={key:1},Sl=["font-size","fill","x","y"],bl={key:2},Bl=["font-size","fill","transform"],wl={key:3},El=["font-size","fill","transform"],Al={key:6,class:"vue-data-ui-watermark"},Ll=["onClick"],_l=["onClick"],Cl=["onClick"],zl={key:1,class:"vue-ui-quick-chart-not-processable"},Nl=Ie(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),Vl={__name:"vue-ui-quick-chart",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}}},emits:["selectDatapoint","selectLegend"],setup(d,{expose:w,emit:h}){const B=d,{vue_ui_quick_chart:N}=i.useConfig(),V=e.ref(null),M=e.ref(null),U=e.ref(null),j=e.ref(null),A=e.ref(i.createUid()),F=e.ref(!1),G=e.ref(null),T=e.ref(""),$=e.ref(null),me=e.ref(null),he=e.ref(null),x=e.ref([]),fe=e.ref(0),ee=e.ref(0),t=e.computed({get:()=>ge(),set:a=>a}),Te=e.computed(()=>t.value.showUserOptionsOnChartHover),pe=e.computed(()=>t.value.keepUserOptionsStateOnChartLeave),te=e.ref(!t.value.showUserOptionsOnChartHover);function ke(a=!1){Te.value&&(te.value=a)}function ge(){const a=Ne.useNestedProp({userConfig:B.config,defaultConfig:N});let s={};return a.theme?s={...Ne.useNestedProp({userConfig:i.themes.vue_ui_quick_chart[a.theme]||B.config,defaultConfig:a}),customPalette:i.themePalettes[a.theme]||i.palette}:s=a,B.config&&i.hasDeepProperty(B.config,"zoomStartIndex")?s.zoomStartIndex=B.config.zoomStartIndex:s.zoomStartIndex=null,B.config&&i.hasDeepProperty(B.config,"zoomEndIndex")?s.zoomEndIndex=B.config.zoomEndIndex:s.zoomEndIndex=null,s}e.watch(()=>B.config,a=>{t.value=ge(),k.value.width=t.value.width,k.value.height=t.value.height,te.value=!t.value.showUserOptionsOnChartHover,Se()},{deep:!0}),e.watch(()=>B.dataset,a=>{f.value=Y.value,g.value.start=0,g.value.end=f.value.maxSeriesLength,ee.value+=1},{deep:!0});const X=e.computed(()=>i.convertCustomPalette(t.value.customPalette)),Y=e.computed(()=>{const a=et({dataset:i.sanitizeArray(B.dataset,["serie","series","data","value","values","num"]),barLineSwitch:t.value.chartIsBarUnderDatasetLength});return a||console.error("VueUiQuickChart : Dataset is not processable"),a}),f=e.ref(Y.value),Oe=e.computed(()=>!!f.value),b=e.computed(()=>f.value?f.value.type:null);e.watch(()=>b.value,a=>{a||i.error({componentName:"VueUiQuickChart",type:"dataset"})},{immediate:!0});const{isPrinting:le,isImaging:ae,generatePdf:ye,generateImage:xe}=ze.usePrinter({elementId:`${b.value}_${A.value}`,fileName:t.value.title||b.value}),Re=e.computed(()=>t.value.showUserOptions&&!t.value.title),k=e.ref({width:t.value.width,height:t.value.height}),oe=e.ref({showTooltip:t.value.showTooltip}),ne=e.ref(null);e.onMounted(()=>{Se()});function Se(){if(t.value.responsive){const a=Ce.throttle(()=>{const{width:s,height:l}=Ce.useResponsive({chart:V.value,title:t.value.title?M.value:null,legend:t.value.showLegend?U.value:null,slicer:[S.BAR,S.LINE].includes(b.value)&&t.value.zoomXy&&f.value.maxSeriesLength>1?j.value:null,source:me.value,noTitle:he.value});k.value.width=s,k.value.height=l});ne.value=new ResizeObserver(a),ne.value.observe(V.value.parentNode)}Le()}e.onBeforeUnmount(()=>{ne.value&&ne.value.disconnect()});const De=e.computed(()=>{switch(b.value){case S.LINE:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`;case S.BAR:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`;case S.DONUT:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`;default:return`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`}});function be(a){return[...a].map(s=>s.value).reduce((s,l)=>s+l,0)}function Z(a){return t.value.blurOnHover&&![null,void 0].includes($.value)&&$.value!==a?`url(#blur_${A.value})`:""}function Be(a,s){x.value.includes(a)?x.value=x.value.filter(l=>l!==a):x.value.length<s&&x.value.push(a)}const we=e.ref(null),Ee=e.ref(null),re=e.ref(!1);function Me(a,s){re.value=!0;let l=a.value;const r=Y.value.dataset.find((u,m)=>a.id===`donut_${m}`).VALUE;if(x.value.includes(a.id)){let u=function(){l>r?(re.value=!1,cancelAnimationFrame(Ee.value),f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:r,VALUE:r}:m)}):(l+=r*.025,f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:l,VALUE:l}:m)},Ee.value=requestAnimationFrame(u))};x.value=x.value.filter(m=>m!==a.id),u()}else if(s.length>1){let u=function(){l<r/100?(re.value=!1,cancelAnimationFrame(we.value),x.value.push(a.id),f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:0,VALUE:0}:m)}):(l/=1.1,f.value={...f.value,dataset:f.value.dataset.map((m,_)=>a.id===`donut_${_}`?{...m,value:l,VALUE:l}:m)},we.value=requestAnimationFrame(u))};u()}}const I=e.ref(null);function Ue(a){I.value=a}const Ae=e.computed(()=>t.value.donutThicknessRatio<.15?.15:t.value.donutThicknessRatio>.4?.4:t.value.donutThicknessRatio),E=e.computed(()=>{if(b.value!==S.DONUT)return null;const a=f.value.dataset.map((o,n)=>({...o,value:o.VALUE||o.DATA||o.SERIE||o.VALUES||o.NUM||0,name:o.NAME||o.DESCRIPTION||o.TITLE||o.LABEL||`Serie ${n}`,id:`donut_${n}`})).map((o,n)=>({...o,color:o.COLOR?i.convertColorToHex(o.COLOR):X.value[n+t.value.paletteStartIndex]||i.palette[n+t.value.paletteStartIndex]||i.palette[(n+t.value.paletteStartIndex)%i.palette.length],immutableValue:o.value}));function s(o,n){return i.dataLabel({v:isNaN(o.value/be(n))?0:o.value/be(n)*100,s:"%",r:t.value.dataLabelRoundingPercentage})}function l(o){return o.proportion*100>t.value.donutHideLabelUnderPercentage}function r(o,n){const y=Y.value.dataset.find((L,C)=>`donut_${C}`===o).VALUE;return Math.abs(String(Number(y.toFixed(0))).length-String(Number(n.toFixed(0))).length)}function u({datapoint:o,seriesIndex:n}){G.value={datapoint:o,seriesIndex:n,config:t.value,dataset:a},$.value=o.id;const y=t.value.tooltipCustomFormat;if(i.isFunction(y)&&i.functionReturnsString(()=>y({datapoint:o,seriesIndex:n,series:a,config:t.value})))T.value=y({datapoint:o,seriesIndex:n,series:a,config:t.value});else{let p="";p+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,p+=`<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="${o.color}"/></svg>`,p+=`<b>${i.applyDataLabel(t.value.formatter,o.value,i.dataLabel({p:t.value.valuePrefix,v:o.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:o,seriesIndex:n})}</b>`,p+=`<span>(${i.dataLabel({v:o.proportion*100,s:"%",r:t.value.dataLabelRoundingPercentage})})</span></div>`,T.value=`<div>${p}</div>`}F.value=!0}function m(){F.value=!1,$.value=null,I.value=null}const _={centerX:k.value.width/2,centerY:k.value.height/2},z=a.filter(o=>!x.value.includes(o.id)).map(o=>o.value||0).reduce((o,n)=>o+n,0),H=a.map((o,n)=>({...o,proportion:(o.value||0)/z,value:o.value||0,absoluteValue:Y.value.dataset.find((y,p)=>`donut_${p}`===o.id).VALUE})),O=k.value.width/2,W=k.value.height/2,R=k.value.height*t.value.donutRadiusRatio;return{dataset:H.filter(o=>!x.value.includes(o.id)),legend:H,drawingArea:_,displayArcPercentage:s,isArcBigEnough:l,useTooltip:u,killTooltip:m,getSpaces:r,total:z,cx:O,cy:W,radius:R,chart:i.makeDonut({series:a.filter(o=>!x.value.includes(o.id))},O,W,R,R,1.99999,2,1,360,105.25,k.value.height*Ae.value)}}),g=e.ref({start:0,end:f.value.maxSeriesLength});function qe(){Le()}const q=e.ref(null);async function Le(){(t.value.zoomStartIndex!==null||t.value.zoomEndIndex!==null)&&q.value?(t.value.zoomStartIndex!==null&&(await e.nextTick(),await e.nextTick(),q.value&&q.value.setStartValue(t.value.zoomStartIndex)),t.value.zoomEndIndex!==null&&(await e.nextTick(),await e.nextTick(),q.value&&q.value.setEndValue(He(t.value.zoomEndIndex+1)))):(g.value={start:0,end:f.value.maxSeriesLength},ee.value+=1)}function He(a){const s=f.value.maxSeriesLength;return a>s?s:a<0||t.value.zoomStartIndex!==null&&a<t.value.zoomStartIndex?t.value.zoomStartIndex!==null?t.value.zoomStartIndex+1:1:a}const We=e.computed(()=>{if(!t.value.zoomMinimap.show||b.value===S.DONUT)return[];let a=[];P(f.value.dataset)&&(a=f.value.dataset),ce(f.value.dataset)&&(a=f.value.dataset.map((u,m)=>({values:u.VALUE||u.DATA||u.SERIE||u.SERIES||u.VALUES||u.NUM||0,id:b.value===S.LINE?`line_${m}`:`bar_${m}`})).filter(u=>!x.value.includes(u.id)));const s=P(a)?a.length:Math.max(...a.map(u=>u.values.length));let l=[];if(P(a))l=a;else for(let u=0;u<s;u+=1)l.push(a.map(m=>m.values[u]||0).reduce((m,_)=>(m||0)+(_||0),0));const r=Math.min(...l);return l.map(u=>u+(r<0?Math.abs(r):0))}),v=e.computed(()=>{if(b.value!==S.LINE)return null;const a={height:k.value.height,width:k.value.width},s={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:a.width-t.value.xyPaddingRight,bottom:a.height-t.value.xyPaddingBottom,width:a.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:a.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];P(f.value.dataset)&&(l=[{values:f.value.dataset.slice(g.value.start,g.value.end),absoluteIndices:f.value.dataset.map((o,n)=>n).slice(g.value.start,g.value.end),name:t.value.title,color:X.value[t.value.paletteStartIndex]||i.palette[t.value.paletteStartIndex],id:"line_0"}]),ce(f.value.dataset)&&(l=f.value.dataset.map((o,n)=>({...o,values:o.VALUE||o.DATA||o.SERIE||o.SERIES||o.VALUES||o.NUM||0,name:o.NAME||o.DESCRIPTION||o.TITLE||o.LABEL||`Serie ${n}`,id:`line_${n}`})).map((o,n)=>({...o,color:o.COLOR?i.convertColorToHex(o.COLOR):X.value[n+t.value.paletteStartIndex]||i.palette[n+t.value.paletteStartIndex]||i.palette[(n+t.value.paletteStartIndex)%i.palette.length],values:o.values.slice(g.value.start,g.value.end),absoluteIndices:o.values.map((y,p)=>p).slice(g.value.start,g.value.end)})));const r={max:Math.max(...l.filter(o=>!x.value.includes(o.id)).flatMap(o=>o.values)),min:Math.min(...l.filter(o=>!x.value.includes(o.id)).flatMap(o=>o.values)),maxSeries:Math.max(...l.map(o=>o.values.length))},u=i.calculateNiceScale(r.min<0?r.min:0,r.max<0?0:r.max,t.value.xyScaleSegments),m=r.min<0?Math.abs(r.min):0,_=r.max<0?s.top:s.bottom-m/(u.max+m)*s.height,z=s.width/r.maxSeries,H=u.ticks.map(o=>({y:s.bottom-s.height*((o+m)/(u.max+m)),x:s.left-8,value:o})),O=l.map((o,n)=>({...o,coordinates:o.values.map((y,p)=>({x:s.left+z*(p+1)-z/2,y:s.bottom-(y+m)/(u.max+m)*s.height,value:y}))})).map(o=>{let n=[];return o.coordinates.forEach(y=>{n.push(`${y.x},${y.y} `)}),{...o,linePath:n.join(" ")}});function W(o){$.value=o,I.value=o;const n=l.map(p=>({...p,value:p.values[o],absoluteIndex:p.absoluteIndices[o]})).filter(p=>!x.value.includes(p.id));G.value={datapoint:n,seriesIndex:o,config:t.value,dataset:l};const y=t.value.tooltipCustomFormat;if(i.isFunction(y)&&i.functionReturnsString(()=>y({datapoint:n,seriesIndex:o,series:l,config:t.value})))T.value=y({datapoint:n,seriesIndex:o,series:l,config:t.value});else{let p="";t.value.xyPeriods[n[0].absoluteIndex]&&(p+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[n[0].absoluteIndex]}</div>`),n.forEach((L,C)=>{p+=`
2
2
  <div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;">
3
3
  <svg viewBox="0 0 12 12" height="14" width="12"><circle cx="6" cy="6" r="6" stroke="none" fill="${L.color}"/></svg>
4
4
  <span>${L.name}:</span>
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-DXdrUwnE.cjs"),ne=require("./useResponsive-BJ7DTGpm.cjs"),we=require("./Title-pZYqvru0.cjs"),se=require("./usePrinter-BaRMqUmy.cjs"),Be=require("./Tooltip-BdS8OwyH.cjs"),Pe=require("./vue-ui-sparkbar-CAeIw03m.cjs"),_e=require("./Legend-gbTs_R5j.cjs"),$e=require("./DataTable-BBUJJu-a.cjs"),xe=require("./vue-ui-skeleton-CGcQKCRb.cjs"),Ne=require("./vue-ui-accordion-DTreR2ia.cjs"),ue=require("./useNestedProp-Dq1Hv5-T.cjs"),Te=require("./PackageVersion-CKTJ6FRx.cjs"),Se=require("./PenAndPaper-D0ovdUpL.cjs"),Ee=require("./useUserOptionState-BgepsfED.cjs"),Ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Fe=["id"],Oe=["xmlns","viewBox"],Ae=["width","height"],Le=["id"],ze=["stop-color"],Ie=["stop-color"],Re={key:1},qe=["x1","y1","x2","y2","stroke","stroke-width"],Me={key:0},Ue=["d","stroke","stroke-width"],De=["d","stroke","stroke-width"],Ge={key:2},We=["x","y","text-anchor","font-size","fill","onMouseenter"],He=["points","stroke","stroke-width"],je=["points","stroke","stroke-width","fill"],Xe={key:3},Ye=["cx","cy","fill","r","stroke"],Je={key:5,class:"vue-data-ui-watermark"},Ke=["onClick"],Qe={key:0,style:{"max-width":"200px",margin:"0 auto"}},Ze={__name:"vue-ui-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(ie,{expose:ce,emit:de}){const d=ie,{vue_ui_radar:ve}=n.useConfig(),C=e.computed(()=>!!d.dataset&&Object.keys(d.dataset).length),f=e.ref(n.createUid()),pe=e.ref(null),x=e.ref(!1),N=e.ref(""),L=e.ref(0),m=e.ref(null),z=e.ref(null),I=e.ref(null),R=e.ref(null),q=e.ref(null),M=e.ref(0),U=e.ref(0),D=e.ref(0),t=e.computed({get:()=>H(),set:o=>o}),{userOptionsVisible:T,setUserOptionsVisibility:G,keepUserOptionState:W}=Ee.useUserOptionState({config:t.value});function H(){const o=ue.useNestedProp({userConfig:d.config,defaultConfig:ve});return o.theme?{...ue.useNestedProp({userConfig:n.themes.vue_ui_radar[o.theme]||d.config,defaultConfig:o}),customPalette:n.themePalettes[o.theme]||n.palette}:o}e.watch(()=>d.config,o=>{t.value=H(),T.value=!t.value.showOnChartHover,j(),M.value+=1,U.value+=1,D.value+=1},{deep:!0});const B=e.ref(null);function j(){if(n.objectIsEmpty(d.dataset)&&n.error({componentName:"VueUiRadar",type:"dataset"}),t.value.responsive){const o=ne.throttle(()=>{const{width:a,height:l}=ne.useResponsive({chart:m.value,title:t.value.style.chart.title.text?z.value:null,legend:t.value.style.chart.legend.show?I.value:null,source:R.value,noTitle:q.value});u.value.width=a,u.value.height=l});B.value=new ResizeObserver(o),B.value.observe(m.value.parentNode)}}e.onMounted(()=>{j()}),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:X,isImaging:Y,generatePdf:J,generateImage:K}=se.usePrinter({elementId:`vue-ui-radar_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-radar"}),he=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),h=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),ge=e.computed(()=>({style:{backgroundColor:"#FFFFFF00",animation:{show:t.value.style.chart.tooltip.animation.show,animationFrames:t.value.style.chart.tooltip.animation.animationFrames},labels:{fontSize:t.value.style.chart.tooltip.fontSize,name:{color:t.value.style.chart.tooltip.color}},gutter:{backgroundColor:"#CCCCCC",opacity:30}}})),u=e.ref({height:312,width:512}),i=e.ref([]),w=e.ref(null),y=e.ref(!1);function Z(o){y.value=!0,i.value.includes(o)?(w.value=o,i.value=i.value.filter(a=>a!==o),setTimeout(()=>{y.value=!1,w.value=null},500)):(i.value.push(o),setTimeout(()=>{y.value=!1},500)),de("selectLegend",k.value.filter((a,l)=>!i.value.includes(l)).map(a=>({name:a.name,color:a.color,proportion:a.totalProportion})))}function fe(){return k.value.map(o=>({name:o.name,color:o.color,proportion:o.totalProportion}))}const v=e.computed(()=>[null,void 0].includes(d.dataset.categories)?(n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"categories ({ name: string; prefix?: string; suffix?: string}[])"}),[]):(d.dataset.categories.length===0?n.error({componentName:"VueUiRadar",type:"datasetAttributeEmpty",property:"categories"}):d.dataset.categories.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:`category.${l} at index ${a}`,index:a})})}),[null,void 0].includes(d.dataset.series)?n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"series ({ name: string; values: number[]; color?: string; target: number}[])"}):d.dataset.series.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values","target"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetSerieAttribute",key:"series",property:l,index:a})})}),d.dataset.categories.map((o,a)=>({name:o.name,categoryId:`radar_category_${f.value}_${a}`,color:n.convertColorToHex(o.color)||Q.value[a]||n.palette[a]||n.palette[a%n.palette.length],prefix:o.prefix??"",suffix:o.suffix??""})))),p=e.computed(()=>C.value?d.dataset.series.map((o,a)=>({...o,color:n.convertColorToHex(o.color)||Q.value[a]||n.palette[a]||n.palette[a%n.palette.length],serieId:`radar_serie_${f.value}_${a}`,formatter:o.formatter||null})):[]),ee=e.computed(()=>Math.max(...p.value.flatMap(o=>o.values))),te=e.computed(()=>p.value.length),S=e.computed(()=>Math.min(u.value.width,u.value.height)/3),oe=e.computed(()=>n.createPolygonPath({plot:{x:u.value.width/2,y:u.value.height/2},radius:S.value,sides:te.value,rotation:0})),me=e.computed(()=>{const o=[];for(let a=0;a<S.value;a+=S.value/t.value.style.chart.layout.grid.graduations)o.push(a);return o}),g=e.computed(()=>oe.value.coordinates.map((o,a)=>{const l=p.value[a].values.map(r=>ye({centerX:u.value.width/2,centerY:u.value.height/2,apexX:o.x,apexY:o.y,proportion:r/(p.value[a].target||ee.value)}));return{...o,...p.value[a],plots:l}}));function E({x:o,y:a}){let l="middle";return o=Math.round(o),a=Math.round(a),o>u.value.width/2&&(o+=12,l="start"),o<u.value.width/2&&(o-=12,l="end"),a>u.value.height/2&&(a+=20),a<u.value.height/2&&(a-=12),a===u.value.height/2&&(a+=4),{x:o,y:a,anchor:l}}function ye({centerX:o,centerY:a,apexX:l,apexY:r,proportion:s}){return{x:o+(l-o)*s,y:a+(r-a)*s}}const k=e.computed(()=>{const o=p.value.map((a,l)=>a.values.map(r=>r/(a.target||ee.value)));return v.value.map((a,l)=>({...a,totalProportion:n.checkNaN(o.map(r=>r[l]).reduce((r,s)=>r+s,0)/p.value.length),shape:"circle",opacity:i.value.includes(l)?.5:1,segregate:()=>Z(l),isSegregated:i.value.includes(l)}))}),ke=e.computed(()=>({cy:"radar-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":""})),P=e.computed(()=>{const o=[{name:t.value.translations.datapoint,color:""},{name:t.value.translations.target,color:""},...k.value],a=d.dataset.series.map(r=>[r.name,n.applyDataLabel(r.formatter,r.target,n.dataLabel({p:r.prefix,v:r.target,s:r.suffix,r:t.value.table.td.roundingValue})),...r.values.map((s,c)=>`${n.applyDataLabel(r.formatter,s,n.dataLabel({p:v.value[c].prefix,v:s,s:v.value[c].suffix,r:t.value.table.td.roundingValue}))} (${isNaN(s/r.target)?"":n.dataLabel({v:s/r.target*100,s:"%",r:t.value.table.td.roundingPercentage})})`)]),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{head:o,body:a,config:l,colNames:o}}),_=e.ref(null),V=e.ref([]),F=e.ref(null);function be(o,a){V.value=[],_.value=a,x.value=!0;let l="";F.value={datapoint:o,seriesIndex:a,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value};const r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value})))N.value=r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value});else{l+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`;for(let s=0;s<o.values.length;s+=1)i.value.includes(s)||V.value.push({name:v.value[s].name,value:o.values[s]/o.target*100,color:v.value[s].color,suffix:"%)",prefix:`${n.dataLabel({p:v.value[s].prefix??"",v:o.values[s],s:v.value[s].suffix??"",r:t.value.style.chart.tooltip.roundingValue})} (`,rounding:t.value.style.chart.tooltip.roundingPercentage,formatter:o.formatter});N.value=l}}function ae(){e.nextTick(()=>{const o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=[[""],[t.value.translations.target],...k.value.flatMap(c=>[[c.name],["%"]])],l=d.dataset.series.map((c,tt)=>[c.name,c.target,...c.values.flatMap(A=>[A,isNaN(A/c.target)?"":A/c.target*100])]),r=o.concat([a]).concat(l),s=n.createCsvContent(r);n.downloadCsv({csvContent:s,title:t.value.style.chart.title.text||"vue-ui-radar"})})}const b=e.ref(!1);function Ce(o){b.value=o,L.value+=1}function le(){h.value.showTable=!h.value.showTable}function re(){h.value.showTooltip=!h.value.showTooltip}const $=e.ref(!1);function O(){$.value=!$.value}return ce({getData:fe,generatePdf:J,generateCsv:ae,generateImage:K,toggleTable:le,toggleTooltip:re,toggleAnnotator:O}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-radar ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"radarChart",ref:m,id:`vue-ui-radar_${f.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),onMouseenter:a[3]||(a[3]=()=>e.unref(G)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(G)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Se.PenAndPaper,{key:0,parent:m.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:$.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:q,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:z,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(we._sfc_main,{key:`title_${M.value}`,config:{title:{cy:"radar-div-title",...t.value.style.chart.title},subtitle:{cy:"radar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&C.value&&(e.unref(W)||e.unref(T))?(e.openBlock(),e.createBlock(se.UserOptions,{ref_key:"details",ref:pe,key:`user_options_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(Y),isPrinting:e.unref(X),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,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:b.value,isTooltip:h.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:$.value,onToggleFullscreen:Ce,onGeneratePdf:e.unref(J),onGenerateCsv:ae,onGenerateImage:e.unref(K),onToggleTable:le,onToggleTooltip:re,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(W)?e.unref(T)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${u.value.width<=0?10:u.value.width} ${u.value.height<=0?10:u.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Te._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:u.value.width<=0?10:u.value.width,height:u.value.height<=0?10:u.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,Ae)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`radar_gradient_${f.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(l.color,.05),t.value.style.chart.layout.dataPolygon.opacity)},null,8,ze),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity)},null,8,Ie)],8,Le))),256))]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,l=>(e.openBlock(),e.createElementBlock("line",{x1:u.value.width/2,y1:u.value.height/2,x2:l.x,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,qe))),256)),t.value.style.chart.layout.grid.graduations>0?(e.openBlock(),e.createElementBlock("g",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value,l=>(e.openBlock(),e.createElementBlock("path",{d:e.unref(n.createPolygonPath)({plot:{x:u.value.width/2,y:u.value.height/2},radius:l,sides:te.value,rotation:0}).path,fill:"none",stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,Ue))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:oe.value.path,fill:"none",stroke:t.value.style.chart.layout.outerPolygon.stroke,"stroke-width":t.value.style.chart.layout.outerPolygon.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,De),t.value.style.chart.layout.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:E(l).x,y:E(l).y,"text-anchor":E(l).anchor,"font-size":t.value.style.chart.layout.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.labels.dataLabels.color,onMouseenter:s=>be(l,r),onMouseleave:a[0]||(a[0]=s=>{x.value=!1,_.value=null})},e.toDisplayString(l.name),41,We))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("g",null,[t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:0,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(s=>s.plots[r]),!1,!0),stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth+1,fill:"none",class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===r&&t.value.useCssAnimation})},null,10,He)):e.createCommentVNode("",!0),t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:1,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(s=>s.plots[r]),!1,!0),stroke:l.color,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth,fill:t.value.style.chart.layout.dataPolygon.transparent?"transparent":t.value.style.chart.layout.dataPolygon.useGradient?`url(#radar_gradient_${f.value}_${r})`:e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity),class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===r&&t.value.useCssAnimation})},null,10,je)):e.createCommentVNode("",!0)])]))),256)),t.value.style.chart.layout.plots.show?(e.openBlock(),e.createElementBlock("g",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(s,c)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.x,cy:s.y,fill:i.value.includes(c)?"transparent":v.value[c].color,r:_.value!==null&&_.value===r?t.value.style.chart.layout.plots.radius*1.6:t.value.style.chart.layout.plots.radius,stroke:i.value.includes(c)?"transparent":t.value.style.chart.backgroundColor,"stroke-width":.5,class:e.normalizeClass({"animated-out":i.value.includes(c)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===c&&t.value.useCssAnimation})},null,10,Ye))),256))]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:u.value},void 0,!0)],14,Oe)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(Y)})),void 0,!0)])):e.createCommentVNode("",!0),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(xe.default,{key:6,config:{type:"radar",style:{backgroundColor:t.value.style.chart.backgroundColor,radar:{grid:{color:t.value.style.chart.layout.outerPolygon.stroke},shapes:{color:t.value.style.chart.layout.outerPolygon.stroke}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:I},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(_e.Legend,{key:`legend_${D.value}`,legendSet:k.value,config:ke.value,onClickMarker:a[1]||(a[1]=({i:l})=>Z(l))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:s=>l.segregate(),style:e.normalizeStyle(`opacity:${i.value.includes(r)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.dataLabel)({v:l.totalProportion*100,s:"%",r:t.value.style.chart.legend.roundingPercentage})),13,Ke)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:k.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:R,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Be._sfc_main,{show:h.value.showTooltip&&x.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,fontSize:t.value.style.chart.tooltip.fontSize,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:m.value,content:N.value,isFullscreen:b.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[["function"].includes(typeof t.value.style.chart.tooltip.customFormat)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Qe,[e.createVNode(Pe.default,{dataset:V.value,config:ge.value,backgroundOpacity:0},null,8,["dataset","config"])])),e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","fontSize","position","offsetY","parent","content","isFullscreen","isCustom"]),C.value?(e.openBlock(),e.createBlock(Ne.default,{key:8,hideDetails:"",config:{open:h.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($e.DataTable,{key:`table_${U.value}`,colNames:P.value.colNames,head:P.value.head,body:P.value.body,config:P.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>h.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name),1)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Fe))}},et=Ve._export_sfc(Ze,[["__scopeId","data-v-7a50d021"]]);exports.default=et;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CH3YkGpv.cjs"),ne=require("./useResponsive-BJ7DTGpm.cjs"),we=require("./Title-m5N0oN0G.cjs"),se=require("./usePrinter-A1_US3Dh.cjs"),Be=require("./Tooltip-Dq7633oz.cjs"),Pe=require("./vue-ui-sparkbar-BJ_rGX_Y.cjs"),_e=require("./Legend-CZrlsh2W.cjs"),$e=require("./DataTable-RY8EUwF3.cjs"),xe=require("./vue-ui-skeleton-DwmP0u2B.cjs"),Ne=require("./vue-ui-accordion-_LFrGkGx.cjs"),ue=require("./useNestedProp-2TBYsJKg.cjs"),Te=require("./PackageVersion-C1zaH_aJ.cjs"),Se=require("./PenAndPaper-Bv8oV7l0.cjs"),Ee=require("./useUserOptionState-BgepsfED.cjs"),Ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Fe=["id"],Oe=["xmlns","viewBox"],Ae=["width","height"],Le=["id"],ze=["stop-color"],Ie=["stop-color"],Re={key:1},qe=["x1","y1","x2","y2","stroke","stroke-width"],Me={key:0},Ue=["d","stroke","stroke-width"],De=["d","stroke","stroke-width"],Ge={key:2},We=["x","y","text-anchor","font-size","fill","onMouseenter"],He=["points","stroke","stroke-width"],je=["points","stroke","stroke-width","fill"],Xe={key:3},Ye=["cx","cy","fill","r","stroke"],Je={key:5,class:"vue-data-ui-watermark"},Ke=["onClick"],Qe={key:0,style:{"max-width":"200px",margin:"0 auto"}},Ze={__name:"vue-ui-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(ie,{expose:ce,emit:de}){const d=ie,{vue_ui_radar:ve}=n.useConfig(),C=e.computed(()=>!!d.dataset&&Object.keys(d.dataset).length),f=e.ref(n.createUid()),pe=e.ref(null),x=e.ref(!1),N=e.ref(""),L=e.ref(0),m=e.ref(null),z=e.ref(null),I=e.ref(null),R=e.ref(null),q=e.ref(null),M=e.ref(0),U=e.ref(0),D=e.ref(0),t=e.computed({get:()=>H(),set:o=>o}),{userOptionsVisible:T,setUserOptionsVisibility:G,keepUserOptionState:W}=Ee.useUserOptionState({config:t.value});function H(){const o=ue.useNestedProp({userConfig:d.config,defaultConfig:ve});return o.theme?{...ue.useNestedProp({userConfig:n.themes.vue_ui_radar[o.theme]||d.config,defaultConfig:o}),customPalette:n.themePalettes[o.theme]||n.palette}:o}e.watch(()=>d.config,o=>{t.value=H(),T.value=!t.value.showOnChartHover,j(),M.value+=1,U.value+=1,D.value+=1},{deep:!0});const B=e.ref(null);function j(){if(n.objectIsEmpty(d.dataset)&&n.error({componentName:"VueUiRadar",type:"dataset"}),t.value.responsive){const o=ne.throttle(()=>{const{width:a,height:l}=ne.useResponsive({chart:m.value,title:t.value.style.chart.title.text?z.value:null,legend:t.value.style.chart.legend.show?I.value:null,source:R.value,noTitle:q.value});u.value.width=a,u.value.height=l});B.value=new ResizeObserver(o),B.value.observe(m.value.parentNode)}}e.onMounted(()=>{j()}),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:X,isImaging:Y,generatePdf:J,generateImage:K}=se.usePrinter({elementId:`vue-ui-radar_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-radar"}),he=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Q=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),h=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),ge=e.computed(()=>({style:{backgroundColor:"#FFFFFF00",animation:{show:t.value.style.chart.tooltip.animation.show,animationFrames:t.value.style.chart.tooltip.animation.animationFrames},labels:{fontSize:t.value.style.chart.tooltip.fontSize,name:{color:t.value.style.chart.tooltip.color}},gutter:{backgroundColor:"#CCCCCC",opacity:30}}})),u=e.ref({height:312,width:512}),i=e.ref([]),w=e.ref(null),y=e.ref(!1);function Z(o){y.value=!0,i.value.includes(o)?(w.value=o,i.value=i.value.filter(a=>a!==o),setTimeout(()=>{y.value=!1,w.value=null},500)):(i.value.push(o),setTimeout(()=>{y.value=!1},500)),de("selectLegend",k.value.filter((a,l)=>!i.value.includes(l)).map(a=>({name:a.name,color:a.color,proportion:a.totalProportion})))}function fe(){return k.value.map(o=>({name:o.name,color:o.color,proportion:o.totalProportion}))}const v=e.computed(()=>[null,void 0].includes(d.dataset.categories)?(n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"categories ({ name: string; prefix?: string; suffix?: string}[])"}),[]):(d.dataset.categories.length===0?n.error({componentName:"VueUiRadar",type:"datasetAttributeEmpty",property:"categories"}):d.dataset.categories.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:`category.${l} at index ${a}`,index:a})})}),[null,void 0].includes(d.dataset.series)?n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"series ({ name: string; values: number[]; color?: string; target: number}[])"}):d.dataset.series.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values","target"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetSerieAttribute",key:"series",property:l,index:a})})}),d.dataset.categories.map((o,a)=>({name:o.name,categoryId:`radar_category_${f.value}_${a}`,color:n.convertColorToHex(o.color)||Q.value[a]||n.palette[a]||n.palette[a%n.palette.length],prefix:o.prefix??"",suffix:o.suffix??""})))),p=e.computed(()=>C.value?d.dataset.series.map((o,a)=>({...o,color:n.convertColorToHex(o.color)||Q.value[a]||n.palette[a]||n.palette[a%n.palette.length],serieId:`radar_serie_${f.value}_${a}`,formatter:o.formatter||null})):[]),ee=e.computed(()=>Math.max(...p.value.flatMap(o=>o.values))),te=e.computed(()=>p.value.length),S=e.computed(()=>Math.min(u.value.width,u.value.height)/3),oe=e.computed(()=>n.createPolygonPath({plot:{x:u.value.width/2,y:u.value.height/2},radius:S.value,sides:te.value,rotation:0})),me=e.computed(()=>{const o=[];for(let a=0;a<S.value;a+=S.value/t.value.style.chart.layout.grid.graduations)o.push(a);return o}),g=e.computed(()=>oe.value.coordinates.map((o,a)=>{const l=p.value[a].values.map(r=>ye({centerX:u.value.width/2,centerY:u.value.height/2,apexX:o.x,apexY:o.y,proportion:r/(p.value[a].target||ee.value)}));return{...o,...p.value[a],plots:l}}));function E({x:o,y:a}){let l="middle";return o=Math.round(o),a=Math.round(a),o>u.value.width/2&&(o+=12,l="start"),o<u.value.width/2&&(o-=12,l="end"),a>u.value.height/2&&(a+=20),a<u.value.height/2&&(a-=12),a===u.value.height/2&&(a+=4),{x:o,y:a,anchor:l}}function ye({centerX:o,centerY:a,apexX:l,apexY:r,proportion:s}){return{x:o+(l-o)*s,y:a+(r-a)*s}}const k=e.computed(()=>{const o=p.value.map((a,l)=>a.values.map(r=>r/(a.target||ee.value)));return v.value.map((a,l)=>({...a,totalProportion:n.checkNaN(o.map(r=>r[l]).reduce((r,s)=>r+s,0)/p.value.length),shape:"circle",opacity:i.value.includes(l)?.5:1,segregate:()=>Z(l),isSegregated:i.value.includes(l)}))}),ke=e.computed(()=>({cy:"radar-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":""})),P=e.computed(()=>{const o=[{name:t.value.translations.datapoint,color:""},{name:t.value.translations.target,color:""},...k.value],a=d.dataset.series.map(r=>[r.name,n.applyDataLabel(r.formatter,r.target,n.dataLabel({p:r.prefix,v:r.target,s:r.suffix,r:t.value.table.td.roundingValue})),...r.values.map((s,c)=>`${n.applyDataLabel(r.formatter,s,n.dataLabel({p:v.value[c].prefix,v:s,s:v.value[c].suffix,r:t.value.table.td.roundingValue}))} (${isNaN(s/r.target)?"":n.dataLabel({v:s/r.target*100,s:"%",r:t.value.table.td.roundingPercentage})})`)]),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{head:o,body:a,config:l,colNames:o}}),_=e.ref(null),V=e.ref([]),F=e.ref(null);function be(o,a){V.value=[],_.value=a,x.value=!0;let l="";F.value={datapoint:o,seriesIndex:a,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value};const r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value})))N.value=r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value});else{l+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`;for(let s=0;s<o.values.length;s+=1)i.value.includes(s)||V.value.push({name:v.value[s].name,value:o.values[s]/o.target*100,color:v.value[s].color,suffix:"%)",prefix:`${n.dataLabel({p:v.value[s].prefix??"",v:o.values[s],s:v.value[s].suffix??"",r:t.value.style.chart.tooltip.roundingValue})} (`,rounding:t.value.style.chart.tooltip.roundingPercentage,formatter:o.formatter});N.value=l}}function ae(){e.nextTick(()=>{const o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=[[""],[t.value.translations.target],...k.value.flatMap(c=>[[c.name],["%"]])],l=d.dataset.series.map((c,tt)=>[c.name,c.target,...c.values.flatMap(A=>[A,isNaN(A/c.target)?"":A/c.target*100])]),r=o.concat([a]).concat(l),s=n.createCsvContent(r);n.downloadCsv({csvContent:s,title:t.value.style.chart.title.text||"vue-ui-radar"})})}const b=e.ref(!1);function Ce(o){b.value=o,L.value+=1}function le(){h.value.showTable=!h.value.showTable}function re(){h.value.showTooltip=!h.value.showTooltip}const $=e.ref(!1);function O(){$.value=!$.value}return ce({getData:fe,generatePdf:J,generateCsv:ae,generateImage:K,toggleTable:le,toggleTooltip:re,toggleAnnotator:O}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-radar ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"radarChart",ref:m,id:`vue-ui-radar_${f.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),onMouseenter:a[3]||(a[3]=()=>e.unref(G)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(G)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Se.PenAndPaper,{key:0,parent:m.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:$.value,onClose:O},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:q,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:z,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(we._sfc_main,{key:`title_${M.value}`,config:{title:{cy:"radar-div-title",...t.value.style.chart.title},subtitle:{cy:"radar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&C.value&&(e.unref(W)||e.unref(T))?(e.openBlock(),e.createBlock(se.UserOptions,{ref_key:"details",ref:pe,key:`user_options_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(Y),isPrinting:e.unref(X),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,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:b.value,isTooltip:h.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:$.value,onToggleFullscreen:Ce,onGeneratePdf:e.unref(J),onGenerateCsv:ae,onGenerateImage:e.unref(K),onToggleTable:le,onToggleTooltip:re,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(W)?e.unref(T)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${u.value.width<=0?10:u.value.width} ${u.value.height<=0?10:u.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Te._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:u.value.width<=0?10:u.value.width,height:u.value.height<=0?10:u.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,Ae)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`radar_gradient_${f.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(l.color,.05),t.value.style.chart.layout.dataPolygon.opacity)},null,8,ze),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity)},null,8,Ie)],8,Le))),256))]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,l=>(e.openBlock(),e.createElementBlock("line",{x1:u.value.width/2,y1:u.value.height/2,x2:l.x,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,qe))),256)),t.value.style.chart.layout.grid.graduations>0?(e.openBlock(),e.createElementBlock("g",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value,l=>(e.openBlock(),e.createElementBlock("path",{d:e.unref(n.createPolygonPath)({plot:{x:u.value.width/2,y:u.value.height/2},radius:l,sides:te.value,rotation:0}).path,fill:"none",stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,Ue))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:oe.value.path,fill:"none",stroke:t.value.style.chart.layout.outerPolygon.stroke,"stroke-width":t.value.style.chart.layout.outerPolygon.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,De),t.value.style.chart.layout.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:E(l).x,y:E(l).y,"text-anchor":E(l).anchor,"font-size":t.value.style.chart.layout.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.labels.dataLabels.color,onMouseenter:s=>be(l,r),onMouseleave:a[0]||(a[0]=s=>{x.value=!1,_.value=null})},e.toDisplayString(l.name),41,We))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("g",null,[t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:0,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(s=>s.plots[r]),!1,!0),stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth+1,fill:"none",class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===r&&t.value.useCssAnimation})},null,10,He)):e.createCommentVNode("",!0),t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:1,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(s=>s.plots[r]),!1,!0),stroke:l.color,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth,fill:t.value.style.chart.layout.dataPolygon.transparent?"transparent":t.value.style.chart.layout.dataPolygon.useGradient?`url(#radar_gradient_${f.value}_${r})`:e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity),class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===r&&t.value.useCssAnimation})},null,10,je)):e.createCommentVNode("",!0)])]))),256)),t.value.style.chart.layout.plots.show?(e.openBlock(),e.createElementBlock("g",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(s,c)=>(e.openBlock(),e.createElementBlock("circle",{cx:s.x,cy:s.y,fill:i.value.includes(c)?"transparent":v.value[c].color,r:_.value!==null&&_.value===r?t.value.style.chart.layout.plots.radius*1.6:t.value.style.chart.layout.plots.radius,stroke:i.value.includes(c)?"transparent":t.value.style.chart.backgroundColor,"stroke-width":.5,class:e.normalizeClass({"animated-out":i.value.includes(c)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===c&&t.value.useCssAnimation})},null,10,Ye))),256))]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:u.value},void 0,!0)],14,Oe)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(Y)})),void 0,!0)])):e.createCommentVNode("",!0),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(xe.default,{key:6,config:{type:"radar",style:{backgroundColor:t.value.style.chart.backgroundColor,radar:{grid:{color:t.value.style.chart.layout.outerPolygon.stroke},shapes:{color:t.value.style.chart.layout.outerPolygon.stroke}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:I},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(_e.Legend,{key:`legend_${D.value}`,legendSet:k.value,config:ke.value,onClickMarker:a[1]||(a[1]=({i:l})=>Z(l))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:s=>l.segregate(),style:e.normalizeStyle(`opacity:${i.value.includes(r)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.dataLabel)({v:l.totalProportion*100,s:"%",r:t.value.style.chart.legend.roundingPercentage})),13,Ke)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:k.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:R,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Be._sfc_main,{show:h.value.showTooltip&&x.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,fontSize:t.value.style.chart.tooltip.fontSize,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:m.value,content:N.value,isFullscreen:b.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[["function"].includes(typeof t.value.style.chart.tooltip.customFormat)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Qe,[e.createVNode(Pe.default,{dataset:V.value,config:ge.value,backgroundOpacity:0},null,8,["dataset","config"])])),e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","fontSize","position","offsetY","parent","content","isFullscreen","isCustom"]),C.value?(e.openBlock(),e.createBlock(Ne.default,{key:8,hideDetails:"",config:{open:h.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($e.DataTable,{key:`table_${U.value}`,colNames:P.value.colNames,head:P.value.head,body:P.value.body,config:P.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>h.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name),1)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Fe))}},et=Ve._export_sfc(Ze,[["__scopeId","data-v-7a50d021"]]);exports.default=et;
@@ -1,17 +1,17 @@
1
1
  import { computed as h, ref as i, watch as je, onMounted as He, onBeforeUnmount as Ye, openBlock as r, createElementBlock as n, normalizeClass as z, normalizeStyle as W, unref as d, createBlock as _, createCommentVNode as c, createSlots as qe, withCtx as m, renderSlot as f, normalizeProps as M, guardReactiveProps as R, createVNode as ee, createElementVNode as $, Fragment as P, renderList as T, toDisplayString as U, createTextVNode as Te, nextTick as Je } from "vue";
2
- import { u as Ke, c as Qe, t as Ze, a as et, p as x, o as tt, e as S, b as at, g as xe, d as Oe, O as Ae, v as ot, i as Fe, f as V, X as lt, s as te, w as rt, P as Ne, x as st, y as nt, q as ut, r as it } from "./index-BU-qdyPq.js";
2
+ import { u as Ke, c as Qe, t as Ze, a as et, p as x, o as tt, e as S, b as at, g as xe, d as Oe, O as Ae, v as ot, i as Fe, f as V, X as lt, s as te, w as rt, P as Ne, x as st, y as nt, q as ut, r as it } from "./index-CpNLsWVB.js";
3
3
  import { t as dt, u as ct } from "./useResponsive-CoxXLe23.js";
4
- import { _ as vt } from "./Title-BxMjvERL.js";
5
- import { u as pt, U as ht } from "./usePrinter-CIccmyRB.js";
6
- import { _ as gt } from "./Tooltip-VA-KbJNH.js";
7
- import ft from "./vue-ui-sparkbar-BMlgQWPa.js";
8
- import { L as yt } from "./Legend-DGRS4QbF.js";
9
- import { D as mt } from "./DataTable-DLDlPv_3.js";
10
- import bt from "./vue-ui-skeleton-CpFbwUa0.js";
11
- import kt from "./vue-ui-accordion-CrpdF6x_.js";
12
- import { u as Se } from "./useNestedProp-CWSJ5eBm.js";
13
- import { _ as Ct } from "./PackageVersion-BN4d5Mju.js";
14
- import { P as wt } from "./PenAndPaper-CXPVm0x2.js";
4
+ import { _ as vt } from "./Title-CmyP_ypC.js";
5
+ import { u as pt, U as ht } from "./usePrinter-D76t2otk.js";
6
+ import { _ as gt } from "./Tooltip-Dz6sXvS2.js";
7
+ import ft from "./vue-ui-sparkbar-JQ4SIcqX.js";
8
+ import { L as yt } from "./Legend-BBFx9L7u.js";
9
+ import { D as mt } from "./DataTable-CC3rD9iV.js";
10
+ import bt from "./vue-ui-skeleton-CIp8lMA6.js";
11
+ import kt from "./vue-ui-accordion-7RGF7sa1.js";
12
+ import { u as Se } from "./useNestedProp-C14snYQ3.js";
13
+ import { _ as Ct } from "./PackageVersion-Cc8-1SRE.js";
14
+ import { P as wt } from "./PenAndPaper-BKX-8o1h.js";
15
15
  import { u as _t } from "./useUserOptionState-BIvW1Kz7.js";
16
16
  import { _ as $t } from "./_plugin-vue_export-helper-CHgC5LLL.js";
17
17
  const Pt = ["id"], Tt = ["xmlns", "viewBox"], xt = ["width", "height"], Ot = ["id"], At = ["stop-color"], Ft = ["stop-color"], Nt = { key: 1 }, St = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], It = { key: 0 }, Lt = ["d", "stroke", "stroke-width"], zt = ["d", "stroke", "stroke-width"], Mt = { key: 2 }, Rt = ["x", "y", "text-anchor", "font-size", "fill", "onMouseenter"], Ut = ["points", "stroke", "stroke-width"], Vt = ["points", "stroke", "stroke-width", "fill"], Et = { key: 3 }, Bt = ["cx", "cy", "fill", "r", "stroke"], Dt = {
@@ -1,6 +1,6 @@
1
1
  import { ref as h, useSlots as T, onMounted as R, computed as x, watch as H, openBlock as a, createElementBlock as o, normalizeStyle as i, createElementVNode as r, toDisplayString as g, createCommentVNode as y, unref as s, Fragment as P, renderList as W, withKeys as q } from "vue";
2
- import { u as J, c as Q, o as Z, e as tt, i as $, f as b, X as k, w as F, V as X } from "./index-BU-qdyPq.js";
3
- import { u as et } from "./useNestedProp-CWSJ5eBm.js";
2
+ import { u as J, c as Q, o as Z, e as tt, i as $, f as b, X as k, w as F, V as X } from "./index-CpNLsWVB.js";
3
+ import { u as et } from "./useNestedProp-C14snYQ3.js";
4
4
  import { _ as lt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
5
  const at = {
6
6
  key: 0,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-DXdrUwnE.cjs"),M=require("./useNestedProp-Dq1Hv5-T.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),A={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},R=["src","height","width"],X=["xmlns","height","width"],j=["id"],F=["stop-color"],I=["stop-color"],O=["points","fill","stroke","stroke-width"],Y=["src","alt","height","width","id"],G=["xmlns","viewBox","height","id"],U=["id"],q=["stop-color"],H=["stop-color"],K=["points","fill","stroke"],P=["xmlns","height"],T=["onClick","onMouseenter","onKeyup"],W=["onMouseenter"],J={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup(k,{expose:S,emit:_}){const i=k,{vue_ui_rating:w}=o.useConfig(),d=e.ref(o.createUid()),g=e.ref(!1),s=e.ref(void 0),y=e.ref([]),z=e.useSlots();e.onMounted(()=>{z["chart-background"]&&console.warn("VueUiRating does not support the #chart-background slot.")});const t=e.computed({get:()=>f(),set:a=>a});function f(){return M.useNestedProp({userConfig:i.config,defaultConfig:w})}e.watch(()=>i.config,a=>{t.value=f(),h()},{deep:!0});const B=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)?C(i.dataset.rating):i.dataset.rating),N=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)),r=e.ref(B.value),m=e.computed(()=>t.value.type==="image"),c=e.computed(()=>t.value.readonly);function C(a){let n=0,l=0;for(const u in a){const L=parseInt(u),$=a[u];n+=L*$,l+=$}if(l===0)return 0;const v=n/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{h()});function h(){o.objectIsEmpty(i.dataset)&&o.error({componentName:"VueUiRating",type:"dataset"}),y.value=[];for(let a=t.value.from;a<=t.value.to;a+=1)y.value.push(a)}function p(a,n=!1){return a>s.value||c.value?n?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:n?1:t.value.style.star.useGradient?`url(#star_gradient_under_${d.value})`:t.value.style.star.activeColor}function x(a,n=!1){const l=r.value-a,v=n?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function b(a){c.value||(r.value=a,_("rate",a))}function E(){return r.value}function V(a=!0){c.value=a}return S({getData:E,toggleReadonly:V}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily};width:100%`),class:"vue-ui-rating",onMouseover:n[2]||(n[2]=l=>g.value=!0),onMouseleave:n[3]||(n[3]=l=>{g.value=!1,s.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("div",{style:e.normalizeStyle(`color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"};text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.offsetY}px;font-size:${t.value.style.title.fontSize}px`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`color:${t.value.style.title.subtitle.color};font-size:${t.value.style.title.subtitle.fontSize}px;text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.subtitle.offsetY}px;font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.rating.show&&t.value.style.rating.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vue-ui-rating-wrapper",style:e.normalizeStyle(`height:${t.value.style.itemSize}px;width:100%;display:flex;align-items:center;justify-content:center`)},[t.value.style.rating.show&&t.value.style.rating.position==="left"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-right:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(l,v)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-rating-unit-container",style:e.normalizeStyle(`position:relative;height:${t.value.style.itemSize}px;width:${t.value.style.itemSize}px`)},[m.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.value.style.image.src,height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;opacity:${isNaN(s.value)?t.value.style.image.inactiveOpacity:p(l,!0)}`)},null,12,R)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_under_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,F),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,I)],8,j)]),e.createElementVNode("polygon",{points:e.unref(o.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(s.value)?t.value.style.star.inactiveColor:p(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:s.value?p(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,O)],8,X)),m.value?(e.openBlock(),e.createElementBlock("img",{key:2,src:t.value.style.image.src,alt:`${t.value.style.image.alt} ${l}`,height:t.value.style.itemSize,width:t.value.style.itemSize,id:`active_${d.value}_${l}`,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;clip:rect(0px,${x(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,Y)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${x(v)} 100`,height:t.value.style.itemSize,class:"vue-ui-rating-unit",id:`active_${d.value}_${l}`,style:{position:"absolute",top:"0",left:"0"}},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_over_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,q),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,H)],8,U)]),e.createElementVNode("polygon",{points:e.unref(o.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:t.value.style.star.useGradient?`url(#star_gradient_over_${d.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,K)],8,G)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(o.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;${c.value?"":"cursor:pointer"}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("rect",{key:0,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onClick:u=>b(l),onMouseenter:u=>s.value=l,onMouseleave:n[0]||(n[0]=u=>s.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>b(l),["enter"])},null,40,T)),c.value?(e.openBlock(),e.createElementBlock("rect",{key:1,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onMouseenter:u=>s.value=l,onMouseleave:n[1]||(n[1]=u=>s.value=void 0)},null,40,W)):e.createCommentVNode("",!0)],12,P)),t.value.style.tooltip.show&&N.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${s.value===l?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(l)+":",5),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.tooltip.formatter,i.dataset.rating[l],e.unref(o.dataLabel)({v:i.dataset.rating[l],r:t.value.style.tooltip.roundingValue}),t.value)),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0)],4))),256)),t.value.style.rating.show&&t.value.style.rating.position==="right"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],4),t.value.style.rating.show&&t.value.style.rating.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(`width:100%;text-align:center;margin-top:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],36))}},Q=D._export_sfc(J,[["__scopeId","data-v-9e1d13d5"]]);exports.default=Q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CH3YkGpv.cjs"),M=require("./useNestedProp-2TBYsJKg.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),A={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},R=["src","height","width"],X=["xmlns","height","width"],j=["id"],F=["stop-color"],I=["stop-color"],O=["points","fill","stroke","stroke-width"],Y=["src","alt","height","width","id"],G=["xmlns","viewBox","height","id"],U=["id"],q=["stop-color"],H=["stop-color"],K=["points","fill","stroke"],P=["xmlns","height"],T=["onClick","onMouseenter","onKeyup"],W=["onMouseenter"],J={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup(k,{expose:S,emit:_}){const i=k,{vue_ui_rating:w}=o.useConfig(),d=e.ref(o.createUid()),g=e.ref(!1),s=e.ref(void 0),y=e.ref([]),z=e.useSlots();e.onMounted(()=>{z["chart-background"]&&console.warn("VueUiRating does not support the #chart-background slot.")});const t=e.computed({get:()=>f(),set:a=>a});function f(){return M.useNestedProp({userConfig:i.config,defaultConfig:w})}e.watch(()=>i.config,a=>{t.value=f(),h()},{deep:!0});const B=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)?C(i.dataset.rating):i.dataset.rating),N=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)),r=e.ref(B.value),m=e.computed(()=>t.value.type==="image"),c=e.computed(()=>t.value.readonly);function C(a){let n=0,l=0;for(const u in a){const L=parseInt(u),$=a[u];n+=L*$,l+=$}if(l===0)return 0;const v=n/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{h()});function h(){o.objectIsEmpty(i.dataset)&&o.error({componentName:"VueUiRating",type:"dataset"}),y.value=[];for(let a=t.value.from;a<=t.value.to;a+=1)y.value.push(a)}function p(a,n=!1){return a>s.value||c.value?n?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:n?1:t.value.style.star.useGradient?`url(#star_gradient_under_${d.value})`:t.value.style.star.activeColor}function x(a,n=!1){const l=r.value-a,v=n?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function b(a){c.value||(r.value=a,_("rate",a))}function E(){return r.value}function V(a=!0){c.value=a}return S({getData:E,toggleReadonly:V}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily};width:100%`),class:"vue-ui-rating",onMouseover:n[2]||(n[2]=l=>g.value=!0),onMouseleave:n[3]||(n[3]=l=>{g.value=!1,s.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("div",{style:e.normalizeStyle(`color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"};text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.offsetY}px;font-size:${t.value.style.title.fontSize}px`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`color:${t.value.style.title.subtitle.color};font-size:${t.value.style.title.subtitle.fontSize}px;text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.subtitle.offsetY}px;font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.rating.show&&t.value.style.rating.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vue-ui-rating-wrapper",style:e.normalizeStyle(`height:${t.value.style.itemSize}px;width:100%;display:flex;align-items:center;justify-content:center`)},[t.value.style.rating.show&&t.value.style.rating.position==="left"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-right:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(l,v)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-rating-unit-container",style:e.normalizeStyle(`position:relative;height:${t.value.style.itemSize}px;width:${t.value.style.itemSize}px`)},[m.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.value.style.image.src,height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;opacity:${isNaN(s.value)?t.value.style.image.inactiveOpacity:p(l,!0)}`)},null,12,R)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_under_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,F),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,I)],8,j)]),e.createElementVNode("polygon",{points:e.unref(o.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(s.value)?t.value.style.star.inactiveColor:p(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:s.value?p(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,O)],8,X)),m.value?(e.openBlock(),e.createElementBlock("img",{key:2,src:t.value.style.image.src,alt:`${t.value.style.image.alt} ${l}`,height:t.value.style.itemSize,width:t.value.style.itemSize,id:`active_${d.value}_${l}`,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;clip:rect(0px,${x(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,Y)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${x(v)} 100`,height:t.value.style.itemSize,class:"vue-ui-rating-unit",id:`active_${d.value}_${l}`,style:{position:"absolute",top:"0",left:"0"}},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_over_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,q),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,H)],8,U)]),e.createElementVNode("polygon",{points:e.unref(o.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:t.value.style.star.useGradient?`url(#star_gradient_over_${d.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,K)],8,G)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(o.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;${c.value?"":"cursor:pointer"}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("rect",{key:0,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onClick:u=>b(l),onMouseenter:u=>s.value=l,onMouseleave:n[0]||(n[0]=u=>s.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>b(l),["enter"])},null,40,T)),c.value?(e.openBlock(),e.createElementBlock("rect",{key:1,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onMouseenter:u=>s.value=l,onMouseleave:n[1]||(n[1]=u=>s.value=void 0)},null,40,W)):e.createCommentVNode("",!0)],12,P)),t.value.style.tooltip.show&&N.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${s.value===l?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(l)+":",5),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.tooltip.formatter,i.dataset.rating[l],e.unref(o.dataLabel)({v:i.dataset.rating[l],r:t.value.style.tooltip.roundingValue}),t.value)),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0)],4))),256)),t.value.style.rating.show&&t.value.style.rating.position==="right"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],4),t.value.style.rating.show&&t.value.style.rating.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(`width:100%;text-align:center;margin-top:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(o.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],36))}},Q=D._export_sfc(J,[["__scopeId","data-v-9e1d13d5"]]);exports.default=Q;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-DXdrUwnE.cjs"),Z=require("./useResponsive-BJ7DTGpm.cjs"),Ce=require("./Title-pZYqvru0.cjs"),ee=require("./usePrinter-BaRMqUmy.cjs"),Be=require("./vue-ui-skeleton-CGcQKCRb.cjs"),te=require("./useNestedProp-Dq1Hv5-T.cjs"),$e=require("./PackageVersion-CKTJ6FRx.cjs"),Pe=require("./PenAndPaper-D0ovdUpL.cjs"),_e=require("./useUserOptionState-BgepsfED.cjs"),Le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ze=["id"],Oe=["xmlns","viewBox"],Se=["width","height"],Ee=["cx","cy","r","stroke","stroke-width"],Ae={key:1},Ne=["stroke","d","stroke-width"],Ie={style:{"pointer-events":"none"}},Ve=["cx","cy","fill","r","stroke"],Me=["x","y","fill","font-size"],Fe={key:2},Te=["stroke","stroke-width","x1","x2","y1","y2"],Re={style:{"pointer-events":"none"}},je=["cx","cy","fill","r","stroke"],qe=["x","y","fill","font-size"],De=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],Ue=["cx","cy","fill","stroke","onClick","r"],Ge={key:5,class:"vue-data-ui-watermark"},We={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(le,{expose:re}){const y=le;e.useCssVars(t=>({"4beec998":ue.value,15467313:ie.value,e556a096:ce.value}));const{vue_ui_relation_circle:ne}=o.useConfig(),$=e.computed(()=>!!y.dataset&&Object.keys(y.dataset).length),w=e.ref(o.createUid()),E=e.ref(0),x=e.ref(null),A=e.ref(null),N=e.ref(null),I=e.ref(null),V=e.ref(0),r=e.computed({get:()=>T(),set:t=>t}),{userOptionsVisible:P,setUserOptionsVisibility:M,keepUserOptionState:F}=_e.useUserOptionState({config:r.value});function T(){const t=te.useNestedProp({userConfig:y.config,defaultConfig:ne});return t.theme?{...te.useNestedProp({userConfig:o.themes.vue_ui_relation_circle[t.theme]||y.config,defaultConfig:t}),customPalette:o.themePalettes[t.theme]||o.palette}:t}e.watch(()=>y.config,t=>{r.value=T(),P.value=!r.value.showOnChartHover,Y(),V.value+=1},{deep:!0});const{isPrinting:R,isImaging:j,generatePdf:q,generateImage:D}=ee.usePrinter({elementId:`relation_circle_${w.value}`,fileName:r.value.style.title.text||"vue-ui-relation-circle"}),oe=e.computed(()=>r.value.userOptions.show&&!r.value.style.title.text),U=e.computed(()=>o.convertCustomPalette(r.value.customPalette)),h=e.ref([]),d=e.ref([]),i=e.ref({}),v=e.ref([]),se=e.ref(0),_=e.computed(()=>y.dataset.slice(0,r.value.style.limit)),k=e.ref(r.value.style.size),f=e.ref(r.value.style.weightLabels.size),G=e.ref(r.value.style.plot.radius),W=e.ref(r.value.style.labels.fontSize),a=e.ref({height:r.value.style.size,width:r.value.style.size}),m=e.computed({get(){return k.value*r.value.style.circle.radiusProportion},set(t){return t}}),ae=e.computed(()=>r.value.style.links.curved),ie=e.computed(()=>`${r.value.style.animation.speedMs}ms`),ue=e.computed(()=>m.value*2),ce=e.computed(()=>m.value*4),b=e.ref(null);e.onMounted(()=>{Y(),document.getElementById(`relation_circle_${w.value}`).addEventListener("click",X)});function Y(){if(o.objectIsEmpty(y.dataset)?o.error({componentName:"VueUiRelationCircle",type:"dataset"}):y.dataset.forEach((t,n)=>{o.getMissingDatasetAttributes({datasetObject:t,requiredAttributes:["id","label","relations","weights"]}).forEach(l=>{o.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:l,index:n})})}),r.value.responsive){const t=Z.throttle(()=>{const{width:n,height:l}=Z.useResponsive({chart:x.value,title:r.value.style.title.text?A.value:null,source:N.value,noTitle:I.value});k.value=Math.min(n,l),a.value.width=n,a.value.height=l,m.value=k.value*r.value.style.circle.radiusProportion,h.value=[],d.value=[],H(),J(),f.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.weightLabels.size,threshold:6,fallback:6}),G.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.plot.radius,threshold:1,fallback:1}),W.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.labels.fontSize,threshold:6,fallback:6})});b.value=new ResizeObserver(t),b.value.observe(x.value.parentNode)}else h.value=[],d.value=[],H(),J()}e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${w.value}`).removeEventListener("click",X),b.value&&b.value.disconnect()});function X(t){const n=t.target;n&&Array.from(n.classList).includes("vue-ui-user-options")||n&&Array.from(n.classList).includes("vue-ui-user-options-summary")||n&&Array.from(n.classList).includes("vue-data-ui-button")||n&&Array.from(n.classList).includes("vue-ui-relation-circle-legend")||(i.value={},v.value=[])}function H(){const t=6.28319/_.value.length,n=360/_.value.length;let l=0,s=0;_.value.forEach((c,u)=>{const O=c.weights.reduce((xe,be)=>xe+be,0),S=m.value*Math.cos(l)+a.value.width/2,we=m.value*Math.sin(l)+a.value.height/2+r.value.style.circle.offsetY;h.value.push({x:S,y:we,...c,color:c.color?c.color:U.value[u]?U.value[u]:o.palette[u],regAngle:s,totalWeight:O}),l+=t,s+=n})}function de(t,n){const l=(t.x+n.x)/2,s=(t.y+n.y)/2;return{x:l,y:s}}function J(){d.value=[],h.value.forEach(t=>{h.value.filter(l=>l.relations.includes(t.id)).forEach((l,s)=>{const c=l.relations.indexOf(t.id);d.value.push({weight:l.weights[c]?l.weights[c]:0,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,midPointLine:de({x:t.x,y:t.y},{x:l.x,y:l.y}),midPointBezier:ve({x1:t.x,x2:l.x,y1:t.y,y2:l.y}),...t})})})}function ve(t){const n={x:t.x1,y:t.y1},l={x:t.x2,y:t.y2},s={x:t.x1,y:t.y1},c={x:a.value.width/2,y:a.value.height/2+r.value.style.circle.offsetY},u=.5,O=Math.pow(1-u,3)*n.x+3*Math.pow(1-u,2)*u*s.x+3*(1-u)*Math.pow(u,2)*c.x+Math.pow(u,3)*l.x,S=Math.pow(1-u,3)*n.y+3*Math.pow(1-u,2)*u*s.y+3*(1-u)*Math.pow(u,2)*c.y+Math.pow(u,3)*l.y;return{x:O,y:S}}const fe=e.computed(()=>Math.max(...d.value.map(t=>t.weight)));function ye(t){return Object.hasOwn(i.value,"x")?v.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function g(t){return t.colorSource}function K(t){return Object.hasOwn(i.value,"x")?v.value.includes(t.id)&&t.relationId===`${t.id}_${i.value.id}`||t.relationId===`${i.value.id}_${t.id}`?`opacity:1;stroke-width:${L(t)}`:"opacity: 0":"opacity: 1"}function p(t){return Object.hasOwn(i.value,"x")?!!(v.value.includes(t.id)&&t.relationId===`${t.id}_${i.value.id}`||t.relationId===`${i.value.id}_${t.id}`):!1}function ge(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function he(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function me(t){return Object.hasOwn(i.value,"x")?i.value.id===t.id||v.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function ke(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function Q(t){se.value=360-t.regAngle,i.value.id&&t.id===i.value.id?(i.value={},v.value=[]):(i.value=t,v.value=[...t.relations])}function L(t){const n=t.weight/fe.value*r.value.style.links.maxWidth;return Math.max(.3,n)}const C=e.ref(!1);function pe(t){C.value=t,E.value+=1}const B=e.ref(!1);function z(){B.value=!B.value}return re({generatePdf:q,generateImage:D,toggleAnnotator:z}),(t,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:x,class:"vue-ui-relation-circle",style:e.normalizeStyle(`width:100%;background:${r.value.style.backgroundColor};text-align:center;${r.value.responsive?"height: 100%":""}`),id:`relation_circle_${w.value}`,onMouseenter:n[0]||(n[0]=()=>e.unref(M)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(M)(!1))},[r.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Pe.PenAndPaper,{key:0,parent:x.value,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,active:B.value,onClose:z},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),oe.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:I,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),r.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:A,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(Ce._sfc_main,{key:`title_${V.value}`,config:{title:{cy:"relation-div-title",...r.value.style.title},subtitle:{cy:"relation-div-subtitle",...r.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),r.value.userOptions.show&&$.value&&(e.unref(F)||e.unref(P))?(e.openBlock(),e.createBlock(ee.UserOptions,{ref:"details",key:`user_options_${E.value}`,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,isPrinting:e.unref(R),isImaging:e.unref(j),uid:w.value,hasPdf:r.value.userOptions.buttons.pdf,hasImg:r.value.userOptions.buttons.img,hasFullscreen:r.value.userOptions.buttons.img,hasXls:!1,isFullscreen:C.value,titles:{...r.value.userOptions.buttonTitles},chartElement:x.value,position:r.value.userOptions.position,hasAnnotator:r.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(D),onToggleAnnotator:z,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(P)?"visible":"hidden":"visible"})},e.createSlots({_:2},[t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:s})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:s})),void 0,!0)]),key:"2"}:void 0,t.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:s})=>[e.renderSlot(t.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:s})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(o.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value},"relation-circle"]),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,width:"100%",style:"user-select:none; background:transparent"},[e.createVNode($e._sfc_main),t.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:a.value.width<=0?10:a.value.width,height:a.value.height<=0?10:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(t.$slots,"chart-background",{},void 0,!0)],8,Se)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:(a.value.width<=0?1e-4:a.value.width)/2,cy:(a.value.height<=0?1e-4:a.value.height)/2+r.value.style.circle.offsetY,r:m.value<=0?1e-4:m.value,stroke:r.value.style.circle.stroke,"stroke-width":r.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,Ee),ae.value?(e.openBlock(),e.createElementBlock("g",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${s}`,style:e.normalizeStyle(K(l)),stroke:g(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&v.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${a.value.width/2},${a.value.height/2+r.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":L(l),"stroke-linecap":"round"},null,14,Ne))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",Ie,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.normalizeProps(e.mergeProps({key:0},{x:l.midPointBezier.x,y:l.midPointBezier.y,color:g(l),weight:l.weight,fontSize:f.value})),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointBezier.x,cy:l.midPointBezier.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,Ve)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointBezier.x,y:l.midPointBezier.y+f.value/3,fill:e.unref(o.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,Me)):e.createCommentVNode("",!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",Fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${s}`,stroke:g(l),"stroke-width":L(l),style:e.normalizeStyle(K(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&v.value.includes(l.id)}),"stroke-linecap":"round"},null,14,Te))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",Re,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.normalizeProps(e.mergeProps({key:0},{x:l.midPointLine.x,y:l.midPointLine.y,color:g(l),weight:l.weight,fontSize:f.value})),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointLine.x,cy:l.midPointLine.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,je)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointLine.x,y:l.midPointLine.y+f.value/3,fill:e.unref(o.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,qe)):e.createCommentVNode("",!0)]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,s)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${s}`,"text-anchor":ge(l),transform:ke(l),x:he(l),y:l.y+5,onClick:c=>Q(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":i.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${r.value.style.fontFamily};${me(l)}`),"font-size":W.value,fill:r.value.style.labels.color},e.toDisplayString(l.label)+" ("+e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.totalWeight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.totalWeight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l}))+") ",13,De))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,s)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${s}`,style:e.normalizeStyle(ye(l)),class:"vue-ui-relation-circle-plot",fill:r.value.style.plot.useSerieColor?l.color:r.value.style.plot.color,stroke:r.value.style.backgroundColor,"stroke-width":"1",onClick:c=>Q(l),r:G.value},null,12,Ue))),128)),e.renderSlot(t.$slots,"svg",{svg:a.value},void 0,!0)],10,Oe)):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ge,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(R)||e.unref(j)})),void 0,!0)])):e.createCommentVNode("",!0),t.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:N,dir:"auto"},[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Be.default,{key:7,config:{type:"relationCircle",style:{backgroundColor:r.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],44,ze))}},Ye=Le._export_sfc(We,[["__scopeId","data-v-d95c92fd"]]);exports.default=Ye;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CH3YkGpv.cjs"),Z=require("./useResponsive-BJ7DTGpm.cjs"),Ce=require("./Title-m5N0oN0G.cjs"),ee=require("./usePrinter-A1_US3Dh.cjs"),Be=require("./vue-ui-skeleton-DwmP0u2B.cjs"),te=require("./useNestedProp-2TBYsJKg.cjs"),$e=require("./PackageVersion-C1zaH_aJ.cjs"),Pe=require("./PenAndPaper-Bv8oV7l0.cjs"),_e=require("./useUserOptionState-BgepsfED.cjs"),Le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ze=["id"],Oe=["xmlns","viewBox"],Se=["width","height"],Ee=["cx","cy","r","stroke","stroke-width"],Ae={key:1},Ne=["stroke","d","stroke-width"],Ie={style:{"pointer-events":"none"}},Ve=["cx","cy","fill","r","stroke"],Me=["x","y","fill","font-size"],Fe={key:2},Te=["stroke","stroke-width","x1","x2","y1","y2"],Re={style:{"pointer-events":"none"}},je=["cx","cy","fill","r","stroke"],qe=["x","y","fill","font-size"],De=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],Ue=["cx","cy","fill","stroke","onClick","r"],Ge={key:5,class:"vue-data-ui-watermark"},We={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(le,{expose:re}){const y=le;e.useCssVars(t=>({"4beec998":ue.value,15467313:ie.value,e556a096:ce.value}));const{vue_ui_relation_circle:ne}=o.useConfig(),$=e.computed(()=>!!y.dataset&&Object.keys(y.dataset).length),w=e.ref(o.createUid()),E=e.ref(0),x=e.ref(null),A=e.ref(null),N=e.ref(null),I=e.ref(null),V=e.ref(0),r=e.computed({get:()=>T(),set:t=>t}),{userOptionsVisible:P,setUserOptionsVisibility:M,keepUserOptionState:F}=_e.useUserOptionState({config:r.value});function T(){const t=te.useNestedProp({userConfig:y.config,defaultConfig:ne});return t.theme?{...te.useNestedProp({userConfig:o.themes.vue_ui_relation_circle[t.theme]||y.config,defaultConfig:t}),customPalette:o.themePalettes[t.theme]||o.palette}:t}e.watch(()=>y.config,t=>{r.value=T(),P.value=!r.value.showOnChartHover,Y(),V.value+=1},{deep:!0});const{isPrinting:R,isImaging:j,generatePdf:q,generateImage:D}=ee.usePrinter({elementId:`relation_circle_${w.value}`,fileName:r.value.style.title.text||"vue-ui-relation-circle"}),oe=e.computed(()=>r.value.userOptions.show&&!r.value.style.title.text),U=e.computed(()=>o.convertCustomPalette(r.value.customPalette)),h=e.ref([]),d=e.ref([]),i=e.ref({}),v=e.ref([]),se=e.ref(0),_=e.computed(()=>y.dataset.slice(0,r.value.style.limit)),k=e.ref(r.value.style.size),f=e.ref(r.value.style.weightLabels.size),G=e.ref(r.value.style.plot.radius),W=e.ref(r.value.style.labels.fontSize),a=e.ref({height:r.value.style.size,width:r.value.style.size}),m=e.computed({get(){return k.value*r.value.style.circle.radiusProportion},set(t){return t}}),ae=e.computed(()=>r.value.style.links.curved),ie=e.computed(()=>`${r.value.style.animation.speedMs}ms`),ue=e.computed(()=>m.value*2),ce=e.computed(()=>m.value*4),b=e.ref(null);e.onMounted(()=>{Y(),document.getElementById(`relation_circle_${w.value}`).addEventListener("click",X)});function Y(){if(o.objectIsEmpty(y.dataset)?o.error({componentName:"VueUiRelationCircle",type:"dataset"}):y.dataset.forEach((t,n)=>{o.getMissingDatasetAttributes({datasetObject:t,requiredAttributes:["id","label","relations","weights"]}).forEach(l=>{o.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:l,index:n})})}),r.value.responsive){const t=Z.throttle(()=>{const{width:n,height:l}=Z.useResponsive({chart:x.value,title:r.value.style.title.text?A.value:null,source:N.value,noTitle:I.value});k.value=Math.min(n,l),a.value.width=n,a.value.height=l,m.value=k.value*r.value.style.circle.radiusProportion,h.value=[],d.value=[],H(),J(),f.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.weightLabels.size,threshold:6,fallback:6}),G.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.plot.radius,threshold:1,fallback:1}),W.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.labels.fontSize,threshold:6,fallback:6})});b.value=new ResizeObserver(t),b.value.observe(x.value.parentNode)}else h.value=[],d.value=[],H(),J()}e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${w.value}`).removeEventListener("click",X),b.value&&b.value.disconnect()});function X(t){const n=t.target;n&&Array.from(n.classList).includes("vue-ui-user-options")||n&&Array.from(n.classList).includes("vue-ui-user-options-summary")||n&&Array.from(n.classList).includes("vue-data-ui-button")||n&&Array.from(n.classList).includes("vue-ui-relation-circle-legend")||(i.value={},v.value=[])}function H(){const t=6.28319/_.value.length,n=360/_.value.length;let l=0,s=0;_.value.forEach((c,u)=>{const O=c.weights.reduce((xe,be)=>xe+be,0),S=m.value*Math.cos(l)+a.value.width/2,we=m.value*Math.sin(l)+a.value.height/2+r.value.style.circle.offsetY;h.value.push({x:S,y:we,...c,color:c.color?c.color:U.value[u]?U.value[u]:o.palette[u],regAngle:s,totalWeight:O}),l+=t,s+=n})}function de(t,n){const l=(t.x+n.x)/2,s=(t.y+n.y)/2;return{x:l,y:s}}function J(){d.value=[],h.value.forEach(t=>{h.value.filter(l=>l.relations.includes(t.id)).forEach((l,s)=>{const c=l.relations.indexOf(t.id);d.value.push({weight:l.weights[c]?l.weights[c]:0,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,midPointLine:de({x:t.x,y:t.y},{x:l.x,y:l.y}),midPointBezier:ve({x1:t.x,x2:l.x,y1:t.y,y2:l.y}),...t})})})}function ve(t){const n={x:t.x1,y:t.y1},l={x:t.x2,y:t.y2},s={x:t.x1,y:t.y1},c={x:a.value.width/2,y:a.value.height/2+r.value.style.circle.offsetY},u=.5,O=Math.pow(1-u,3)*n.x+3*Math.pow(1-u,2)*u*s.x+3*(1-u)*Math.pow(u,2)*c.x+Math.pow(u,3)*l.x,S=Math.pow(1-u,3)*n.y+3*Math.pow(1-u,2)*u*s.y+3*(1-u)*Math.pow(u,2)*c.y+Math.pow(u,3)*l.y;return{x:O,y:S}}const fe=e.computed(()=>Math.max(...d.value.map(t=>t.weight)));function ye(t){return Object.hasOwn(i.value,"x")?v.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function g(t){return t.colorSource}function K(t){return Object.hasOwn(i.value,"x")?v.value.includes(t.id)&&t.relationId===`${t.id}_${i.value.id}`||t.relationId===`${i.value.id}_${t.id}`?`opacity:1;stroke-width:${L(t)}`:"opacity: 0":"opacity: 1"}function p(t){return Object.hasOwn(i.value,"x")?!!(v.value.includes(t.id)&&t.relationId===`${t.id}_${i.value.id}`||t.relationId===`${i.value.id}_${t.id}`):!1}function ge(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function he(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function me(t){return Object.hasOwn(i.value,"x")?i.value.id===t.id||v.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function ke(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function Q(t){se.value=360-t.regAngle,i.value.id&&t.id===i.value.id?(i.value={},v.value=[]):(i.value=t,v.value=[...t.relations])}function L(t){const n=t.weight/fe.value*r.value.style.links.maxWidth;return Math.max(.3,n)}const C=e.ref(!1);function pe(t){C.value=t,E.value+=1}const B=e.ref(!1);function z(){B.value=!B.value}return re({generatePdf:q,generateImage:D,toggleAnnotator:z}),(t,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:x,class:"vue-ui-relation-circle",style:e.normalizeStyle(`width:100%;background:${r.value.style.backgroundColor};text-align:center;${r.value.responsive?"height: 100%":""}`),id:`relation_circle_${w.value}`,onMouseenter:n[0]||(n[0]=()=>e.unref(M)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(M)(!1))},[r.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Pe.PenAndPaper,{key:0,parent:x.value,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,active:B.value,onClose:z},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),oe.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:I,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),r.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:A,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(Ce._sfc_main,{key:`title_${V.value}`,config:{title:{cy:"relation-div-title",...r.value.style.title},subtitle:{cy:"relation-div-subtitle",...r.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),r.value.userOptions.show&&$.value&&(e.unref(F)||e.unref(P))?(e.openBlock(),e.createBlock(ee.UserOptions,{ref:"details",key:`user_options_${E.value}`,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,isPrinting:e.unref(R),isImaging:e.unref(j),uid:w.value,hasPdf:r.value.userOptions.buttons.pdf,hasImg:r.value.userOptions.buttons.img,hasFullscreen:r.value.userOptions.buttons.img,hasXls:!1,isFullscreen:C.value,titles:{...r.value.userOptions.buttonTitles},chartElement:x.value,position:r.value.userOptions.position,hasAnnotator:r.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(D),onToggleAnnotator:z,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(P)?"visible":"hidden":"visible"})},e.createSlots({_:2},[t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:s})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:s})),void 0,!0)]),key:"2"}:void 0,t.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:s})=>[e.renderSlot(t.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:s})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(o.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value},"relation-circle"]),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,width:"100%",style:"user-select:none; background:transparent"},[e.createVNode($e._sfc_main),t.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:a.value.width<=0?10:a.value.width,height:a.value.height<=0?10:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(t.$slots,"chart-background",{},void 0,!0)],8,Se)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:(a.value.width<=0?1e-4:a.value.width)/2,cy:(a.value.height<=0?1e-4:a.value.height)/2+r.value.style.circle.offsetY,r:m.value<=0?1e-4:m.value,stroke:r.value.style.circle.stroke,"stroke-width":r.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,Ee),ae.value?(e.openBlock(),e.createElementBlock("g",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${s}`,style:e.normalizeStyle(K(l)),stroke:g(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&v.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${a.value.width/2},${a.value.height/2+r.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":L(l),"stroke-linecap":"round"},null,14,Ne))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",Ie,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.normalizeProps(e.mergeProps({key:0},{x:l.midPointBezier.x,y:l.midPointBezier.y,color:g(l),weight:l.weight,fontSize:f.value})),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointBezier.x,cy:l.midPointBezier.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,Ve)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointBezier.x,y:l.midPointBezier.y+f.value/3,fill:e.unref(o.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,Me)):e.createCommentVNode("",!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",Fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${s}`,stroke:g(l),"stroke-width":L(l),style:e.normalizeStyle(K(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&v.value.includes(l.id)}),"stroke-linecap":"round"},null,14,Te))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",Re,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.normalizeProps(e.mergeProps({key:0},{x:l.midPointLine.x,y:l.midPointLine.y,color:g(l),weight:l.weight,fontSize:f.value})),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointLine.x,cy:l.midPointLine.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,je)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointLine.x,y:l.midPointLine.y+f.value/3,fill:e.unref(o.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,qe)):e.createCommentVNode("",!0)]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,s)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${s}`,"text-anchor":ge(l),transform:ke(l),x:he(l),y:l.y+5,onClick:c=>Q(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":i.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${r.value.style.fontFamily};${me(l)}`),"font-size":W.value,fill:r.value.style.labels.color},e.toDisplayString(l.label)+" ("+e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.totalWeight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.totalWeight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l}))+") ",13,De))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,s)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${s}`,style:e.normalizeStyle(ye(l)),class:"vue-ui-relation-circle-plot",fill:r.value.style.plot.useSerieColor?l.color:r.value.style.plot.color,stroke:r.value.style.backgroundColor,"stroke-width":"1",onClick:c=>Q(l),r:G.value},null,12,Ue))),128)),e.renderSlot(t.$slots,"svg",{svg:a.value},void 0,!0)],10,Oe)):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ge,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(R)||e.unref(j)})),void 0,!0)])):e.createCommentVNode("",!0),t.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:N,dir:"auto"},[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Be.default,{key:7,config:{type:"relationCircle",style:{backgroundColor:r.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],44,ze))}},Ye=Le._export_sfc(We,[["__scopeId","data-v-d95c92fd"]]);exports.default=Ye;
@@ -1,12 +1,12 @@
1
1
  import { useCssVars as Ge, computed as f, ref as o, watch as Ve, onMounted as We, onBeforeUnmount as De, openBlock as i, createElementBlock as a, normalizeStyle as C, unref as u, createBlock as F, createCommentVNode as v, createSlots as Xe, withCtx as B, renderSlot as h, normalizeProps as A, guardReactiveProps as W, normalizeClass as D, createVNode as Ye, createElementVNode as qe, Fragment as P, renderList as L, mergeProps as ge, toDisplayString as E } from "vue";
2
- import { u as He, c as Je, t as Ke, a as Qe, p as me, b as Ze, o as et, e as ke, g as tt, X as lt, G as pe, i as X, f as Y, F as q } from "./index-BU-qdyPq.js";
2
+ import { u as He, c as Je, t as Ke, a as Qe, p as me, b as Ze, o as et, e as ke, g as tt, X as lt, G as pe, i as X, f as Y, F as q } from "./index-CpNLsWVB.js";
3
3
  import { t as st, u as it } from "./useResponsive-CoxXLe23.js";
4
- import { _ as at } from "./Title-BxMjvERL.js";
5
- import { u as nt, U as rt } from "./usePrinter-CIccmyRB.js";
6
- import ut from "./vue-ui-skeleton-CpFbwUa0.js";
7
- import { u as we } from "./useNestedProp-CWSJ5eBm.js";
8
- import { _ as ot } from "./PackageVersion-BN4d5Mju.js";
9
- import { P as ct } from "./PenAndPaper-CXPVm0x2.js";
4
+ import { _ as at } from "./Title-CmyP_ypC.js";
5
+ import { u as nt, U as rt } from "./usePrinter-D76t2otk.js";
6
+ import ut from "./vue-ui-skeleton-CIp8lMA6.js";
7
+ import { u as we } from "./useNestedProp-C14snYQ3.js";
8
+ import { _ as ot } from "./PackageVersion-Cc8-1SRE.js";
9
+ import { P as ct } from "./PenAndPaper-BKX-8o1h.js";
10
10
  import { u as dt } from "./useUserOptionState-BIvW1Kz7.js";
11
11
  import { _ as vt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
12
12
  const yt = ["id"], ft = ["xmlns", "viewBox"], ht = ["width", "height"], gt = ["cx", "cy", "r", "stroke", "stroke-width"], mt = { key: 1 }, kt = ["stroke", "d", "stroke-width"], pt = { style: { "pointer-events": "none" } }, wt = ["cx", "cy", "fill", "r", "stroke"], xt = ["x", "y", "fill", "font-size"], bt = { key: 2 }, $t = ["stroke", "stroke-width", "x1", "x2", "y1", "y2"], _t = { style: { "pointer-events": "none" } }, Ct = ["cx", "cy", "fill", "r", "stroke"], Pt = ["x", "y", "fill", "font-size"], Lt = ["text-anchor", "transform", "x", "y", "onClick", "font-weight", "font-size", "fill"], Ot = ["cx", "cy", "fill", "stroke", "onClick", "r"], zt = {
@@ -1,18 +1,18 @@
1
1
  import { useSlots as De, ref as r, computed as h, watch as Ee, onMounted as Ge, onBeforeUnmount as He, openBlock as n, createElementBlock as v, normalizeClass as V, normalizeStyle as N, unref as i, createBlock as O, createCommentVNode as m, createSlots as $e, withCtx as g, renderSlot as p, normalizeProps as L, guardReactiveProps as F, createVNode as J, createElementVNode as w, Fragment as K, renderList as Q, createTextVNode as we, toDisplayString as E, nextTick as je } from "vue";
2
- import { u as Xe, c as _e, t as Ye, a as qe, p as I, o as Je, e as Z, g as Ke, b as Qe, J as Ze, d as Te, f as P, X as et, s as tt, w as lt, v as G, i as xe, x as ot, y as at, q as st, r as nt } from "./index-BU-qdyPq.js";
2
+ import { u as Xe, c as _e, t as Ye, a as qe, p as I, o as Je, e as Z, g as Ke, b as Qe, J as Ze, d as Te, f as P, X as et, s as tt, w as lt, v as G, i as xe, x as ot, y as at, q as st, r as nt } from "./index-CpNLsWVB.js";
3
3
  import { t as ut, u as rt } from "./useResponsive-CoxXLe23.js";
4
- import { _ as it } from "./Title-BxMjvERL.js";
5
- import { u as vt, U as ct } from "./usePrinter-CIccmyRB.js";
6
- import { _ as dt } from "./Tooltip-VA-KbJNH.js";
7
- import { D as pt } from "./DataTable-DLDlPv_3.js";
8
- import { L as ht } from "./Legend-DGRS4QbF.js";
9
- import gt from "./vue-ui-skeleton-CpFbwUa0.js";
10
- import ft from "./vue-ui-accordion-CrpdF6x_.js";
11
- import { u as Ne } from "./useNestedProp-CWSJ5eBm.js";
12
- import { _ as yt } from "./PackageVersion-BN4d5Mju.js";
13
- import { P as mt } from "./PenAndPaper-CXPVm0x2.js";
4
+ import { _ as it } from "./Title-CmyP_ypC.js";
5
+ import { u as vt, U as ct } from "./usePrinter-D76t2otk.js";
6
+ import { _ as dt } from "./Tooltip-Dz6sXvS2.js";
7
+ import { D as pt } from "./DataTable-CC3rD9iV.js";
8
+ import { L as ht } from "./Legend-BBFx9L7u.js";
9
+ import gt from "./vue-ui-skeleton-CIp8lMA6.js";
10
+ import ft from "./vue-ui-accordion-7RGF7sa1.js";
11
+ import { u as Ne } from "./useNestedProp-C14snYQ3.js";
12
+ import { _ as yt } from "./PackageVersion-Cc8-1SRE.js";
13
+ import { P as mt } from "./PenAndPaper-BKX-8o1h.js";
14
14
  import { u as bt } from "./useUserOptionState-BIvW1Kz7.js";
15
- import { _ as kt } from "./Shape-BL37b4be.js";
15
+ import { _ as kt } from "./Shape-CSj0rOyf.js";
16
16
  import { _ as Ct } from "./_plugin-vue_export-helper-CHgC5LLL.js";
17
17
  const $t = ["id"], wt = ["xmlns", "viewBox"], _t = ["width", "height"], Tt = ["id"], xt = ["stop-color"], Nt = ["stop-color"], Ot = { key: 1 }, It = ["stroke", "cx", "cy", "r", "fill"], Pt = ["stroke", "stroke-width", "cx", "cy", "r", "fill"], St = ["stroke", "stroke-width", "cx", "cy", "r", "fill"], At = ["cx", "cy", "r", "onMouseenter"], Lt = {
18
18
  key: 5,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-DXdrUwnE.cjs"),le=require("./useResponsive-BJ7DTGpm.cjs"),be=require("./Title-pZYqvru0.cjs"),oe=require("./usePrinter-BaRMqUmy.cjs"),ke=require("./Tooltip-BdS8OwyH.cjs"),Ce=require("./DataTable-BBUJJu-a.cjs"),we=require("./Legend-gbTs_R5j.cjs"),$e=require("./vue-ui-skeleton-CGcQKCRb.cjs"),xe=require("./vue-ui-accordion-DTreR2ia.cjs"),ae=require("./useNestedProp-Dq1Hv5-T.cjs"),Ne=require("./PackageVersion-CKTJ6FRx.cjs"),Te=require("./PenAndPaper-D0ovdUpL.cjs"),Se=require("./useUserOptionState-BgepsfED.cjs"),Be=require("./Shape-CJanTg1E.cjs"),_e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Pe=["id"],Ve=["xmlns","viewBox"],Le=["width","height"],Ee=["id"],Oe=["stop-color"],Ie=["stop-color"],ze={key:1},Ae=["stroke","cx","cy","r","fill"],Fe=["stroke","stroke-width","cx","cy","r","fill"],Re=["stroke","stroke-width","cx","cy","r","fill"],qe=["cx","cy","r","onMouseenter"],Me={key:5,class:"vue-data-ui-watermark"},Ue=["onClick"],De={key:0},We={key:1},He=["innerHTML"],Ge={__name:"vue-ui-rings",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(re,{expose:ne,emit:se}){const p=re,{vue_ui_rings:ue}=n.useConfig(),ie=e.useSlots(),b=e.ref(!1),$=e.computed(()=>!!p.dataset&&p.dataset.length),f=e.ref(n.createUid()),ce=e.ref(null),x=e.ref(!1),_=e.ref(""),g=e.ref(null),O=e.ref(0),k=e.ref(null),I=e.ref(null),z=e.ref(null),A=e.ref(null),F=e.ref(null),R=e.ref(0),q=e.ref(0),M=e.ref(0),t=e.computed({get:()=>W(),set:l=>l}),{userOptionsVisible:P,setUserOptionsVisibility:U,keepUserOptionState:D}=Se.useUserOptionState({config:t.value});function W(){const l=ae.useNestedProp({userConfig:p.config,defaultConfig:ue});return l.theme?{...ae.useNestedProp({userConfig:n.themes.vue_ui_rings[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>p.config,l=>{t.value=W(),P.value=!t.value.showOnChartHover,H(),R.value+=1,q.value+=1,M.value+=1},{deep:!0});const N=e.ref(null);e.onMounted(()=>{H()});function H(){if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiRings",type:"dataset"}):p.dataset.forEach((l,a)=>{l.values.length||n.error({componentName:"VueUiRings",type:"dataset"}),n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{n.error({componentName:"VueUiRings",type:"datasetSerieAttribute",property:o,index:a})})}),t.value.responsive){const l=le.throttle(()=>{const{width:a,height:o}=le.useResponsive({chart:k.value,title:t.value.style.chart.title.text?I.value:null,legend:t.value.style.chart.legend.show?z.value:null,source:A.value,noTitle:F.value});s.value.width=a,s.value.height=o});N.value=new ResizeObserver(l),N.value.observe(k.value.parentNode)}setTimeout(()=>{b.value=!0},600)}e.onBeforeUnmount(()=>{N.value&&N.value.disconnect()});const{isPrinting:G,isImaging:j,generatePdf:X,generateImage:Y}=oe.usePrinter({elementId:`rings_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-rings"}),de=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),J=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:360}),ve=e.computed(()=>Math.min(s.value.height,s.value.width)),d=e.ref([]);function V(l){d.value.includes(l)?d.value=d.value.filter(a=>a!==l):d.value.push(l),se("selectLegend",c.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const pe=e.computed(()=>Math.max(...T.value.filter(l=>!d.value.includes(l.uid)).map(({value:l})=>l)));function K(l){return l/pe.value}const T=e.computed(()=>p.dataset.map(({values:l,name:a,color:o=null},r)=>{const u=n.sanitizeArray(l).reduce((v,w)=>v+w,0);return{name:a,color:o||n.convertColorToHex(o)||J.value[r]||n.palette[r]||n.palette[r%n.palette.length],value:u,proportion:u/p.dataset.map(v=>(v.values||[]).reduce((w,ye)=>w+ye,0)).reduce((v,w)=>v+w,0),uid:n.createUid(),absoluteIndex:r}})),Q=e.computed(()=>T.value.map(l=>({...l,shape:"circle",opacity:d.value.includes(l.uid)?.5:1,segregate:()=>V(l.uid),isSegregated:d.value.includes(l.uid)})).toSorted((l,a)=>a.value-l.value)),he=e.computed(()=>({cy:"rings-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),h=e.computed(()=>T.value.filter(l=>!d.value.includes(l.uid)).map(({value:l})=>l).reduce((l,a)=>l+a,0)),c=e.computed(()=>T.value.filter(l=>!d.value.includes(l.uid)).map(({name:l,value:a,color:o=null,uid:r,absoluteIndex:u},v)=>({absoluteIndex:u,uid:r,name:l,color:o||n.convertColorToHex(o)||J.value[v]||n.palette[v]||n.palette[v%n.palette.length],value:a,proportion:K(a),percentage:a/h.value*100,strokeWidth:t.value.style.chart.layout.rings.strokeWidth*K(a)})).toSorted((l,a)=>a.value-l.value));function fe(){return c.value.map(({name:l,color:a,value:o,absoluteValues:r,percentage:u})=>({name:l,color:a,value:o,absoluteValues:r,percentage:u}))}const i=e.computed(()=>ve.value-t.value.style.chart.layout.rings.strokeWidth*2),L=e.ref(null);function ge(l,a){if(d.value.length===p.dataset.length)return;L.value={datapoint:a,seriesIndex:l,series:c.value,config:t.value},g.value=l;const o=c.value[l],r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:c.value,config:t.value})))_.value=r({seriesIndex:l,datapoint:a,series:c.value,config:t.value});else{let u="";u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${o.color}" />${ie.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${f.value}_${a.absoluteIndex})" />`:""}</svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,seriesIndex:l})}
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CH3YkGpv.cjs"),le=require("./useResponsive-BJ7DTGpm.cjs"),be=require("./Title-m5N0oN0G.cjs"),oe=require("./usePrinter-A1_US3Dh.cjs"),ke=require("./Tooltip-Dq7633oz.cjs"),Ce=require("./DataTable-RY8EUwF3.cjs"),we=require("./Legend-CZrlsh2W.cjs"),$e=require("./vue-ui-skeleton-DwmP0u2B.cjs"),xe=require("./vue-ui-accordion-_LFrGkGx.cjs"),ae=require("./useNestedProp-2TBYsJKg.cjs"),Ne=require("./PackageVersion-C1zaH_aJ.cjs"),Te=require("./PenAndPaper-Bv8oV7l0.cjs"),Se=require("./useUserOptionState-BgepsfED.cjs"),Be=require("./Shape-CuDuYYKF.cjs"),_e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Pe=["id"],Ve=["xmlns","viewBox"],Le=["width","height"],Ee=["id"],Oe=["stop-color"],Ie=["stop-color"],ze={key:1},Ae=["stroke","cx","cy","r","fill"],Fe=["stroke","stroke-width","cx","cy","r","fill"],Re=["stroke","stroke-width","cx","cy","r","fill"],qe=["cx","cy","r","onMouseenter"],Me={key:5,class:"vue-data-ui-watermark"},Ue=["onClick"],De={key:0},We={key:1},He=["innerHTML"],Ge={__name:"vue-ui-rings",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(re,{expose:ne,emit:se}){const p=re,{vue_ui_rings:ue}=n.useConfig(),ie=e.useSlots(),b=e.ref(!1),$=e.computed(()=>!!p.dataset&&p.dataset.length),f=e.ref(n.createUid()),ce=e.ref(null),x=e.ref(!1),_=e.ref(""),g=e.ref(null),O=e.ref(0),k=e.ref(null),I=e.ref(null),z=e.ref(null),A=e.ref(null),F=e.ref(null),R=e.ref(0),q=e.ref(0),M=e.ref(0),t=e.computed({get:()=>W(),set:l=>l}),{userOptionsVisible:P,setUserOptionsVisibility:U,keepUserOptionState:D}=Se.useUserOptionState({config:t.value});function W(){const l=ae.useNestedProp({userConfig:p.config,defaultConfig:ue});return l.theme?{...ae.useNestedProp({userConfig:n.themes.vue_ui_rings[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>p.config,l=>{t.value=W(),P.value=!t.value.showOnChartHover,H(),R.value+=1,q.value+=1,M.value+=1},{deep:!0});const N=e.ref(null);e.onMounted(()=>{H()});function H(){if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiRings",type:"dataset"}):p.dataset.forEach((l,a)=>{l.values.length||n.error({componentName:"VueUiRings",type:"dataset"}),n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{n.error({componentName:"VueUiRings",type:"datasetSerieAttribute",property:o,index:a})})}),t.value.responsive){const l=le.throttle(()=>{const{width:a,height:o}=le.useResponsive({chart:k.value,title:t.value.style.chart.title.text?I.value:null,legend:t.value.style.chart.legend.show?z.value:null,source:A.value,noTitle:F.value});s.value.width=a,s.value.height=o});N.value=new ResizeObserver(l),N.value.observe(k.value.parentNode)}setTimeout(()=>{b.value=!0},600)}e.onBeforeUnmount(()=>{N.value&&N.value.disconnect()});const{isPrinting:G,isImaging:j,generatePdf:X,generateImage:Y}=oe.usePrinter({elementId:`rings_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-rings"}),de=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),J=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:360}),ve=e.computed(()=>Math.min(s.value.height,s.value.width)),d=e.ref([]);function V(l){d.value.includes(l)?d.value=d.value.filter(a=>a!==l):d.value.push(l),se("selectLegend",c.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const pe=e.computed(()=>Math.max(...T.value.filter(l=>!d.value.includes(l.uid)).map(({value:l})=>l)));function K(l){return l/pe.value}const T=e.computed(()=>p.dataset.map(({values:l,name:a,color:o=null},r)=>{const u=n.sanitizeArray(l).reduce((v,w)=>v+w,0);return{name:a,color:o||n.convertColorToHex(o)||J.value[r]||n.palette[r]||n.palette[r%n.palette.length],value:u,proportion:u/p.dataset.map(v=>(v.values||[]).reduce((w,ye)=>w+ye,0)).reduce((v,w)=>v+w,0),uid:n.createUid(),absoluteIndex:r}})),Q=e.computed(()=>T.value.map(l=>({...l,shape:"circle",opacity:d.value.includes(l.uid)?.5:1,segregate:()=>V(l.uid),isSegregated:d.value.includes(l.uid)})).toSorted((l,a)=>a.value-l.value)),he=e.computed(()=>({cy:"rings-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),h=e.computed(()=>T.value.filter(l=>!d.value.includes(l.uid)).map(({value:l})=>l).reduce((l,a)=>l+a,0)),c=e.computed(()=>T.value.filter(l=>!d.value.includes(l.uid)).map(({name:l,value:a,color:o=null,uid:r,absoluteIndex:u},v)=>({absoluteIndex:u,uid:r,name:l,color:o||n.convertColorToHex(o)||J.value[v]||n.palette[v]||n.palette[v%n.palette.length],value:a,proportion:K(a),percentage:a/h.value*100,strokeWidth:t.value.style.chart.layout.rings.strokeWidth*K(a)})).toSorted((l,a)=>a.value-l.value));function fe(){return c.value.map(({name:l,color:a,value:o,absoluteValues:r,percentage:u})=>({name:l,color:a,value:o,absoluteValues:r,percentage:u}))}const i=e.computed(()=>ve.value-t.value.style.chart.layout.rings.strokeWidth*2),L=e.ref(null);function ge(l,a){if(d.value.length===p.dataset.length)return;L.value={datapoint:a,seriesIndex:l,series:c.value,config:t.value},g.value=l;const o=c.value[l],r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:c.value,config:t.value})))_.value=r({seriesIndex:l,datapoint:a,series:c.value,config:t.value});else{let u="";u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 60 60" height="14" width="14"><circle cx="30" cy="30" r="30" stroke="none" fill="${o.color}" />${ie.pattern?`<circle cx="30" cy="30" r="30" stroke="none" fill="url(#pattern_${f.value}_${a.absoluteIndex})" />`:""}</svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,seriesIndex:l})}
2
2
  </b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?u+=`<span>(${n.dataLabel({v:o.value/h.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:u+=`<b>${n.dataLabel({v:o.value/h.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),_.value=u}x.value=!0}const y=e.computed(()=>{const l=c.value.map(o=>({name:o.name,color:o.color})),a=c.value.map(o=>o.value);return{head:l,body:a}}),S=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>',n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:h.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=y.value.head.map((u,v)=>[{color:u.color,name:u.name},n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:y.value.body[v],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),isNaN(y.value.body[v]/h.value)?"-":(y.value.body[v]/h.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:a,config:o,colNames:r}});function Z(){e.nextTick(()=>{const l=y.value.head.map((r,u)=>[[r.name],[y.value.body[u]],[isNaN(y.value.body[u]/h.value)?"-":y.value.body[u]/h.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=n.createCsvContent(a);n.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-rings"})})}const C=e.ref(!1);function me(l){C.value=l,O.value+=1}function ee(){m.value.showTable=!m.value.showTable}function te(){m.value.showTooltip=!m.value.showTooltip}const B=e.ref(!1);function E(){B.value=!B.value}return ne({getData:fe,generatePdf:X,generateCsv:Z,generateImage:Y,toggleTable:ee,toggleTooltip:te,toggleAnnotator:E}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"ringsChart",ref:k,class:e.normalizeClass(`vue-ui-rings ${C.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};text-align:center;width:100%;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`),id:`rings_${f.value}`,onMouseleave:a[3]||(a[3]=o=>{g.value=null,x.value=!1,e.unref(U)(!1)}),onMouseenter:a[4]||(a[4]=()=>e.unref(U)(!0))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Te.PenAndPaper,{key:0,parent:k.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:E},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),de.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:F,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:I,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(be._sfc_main,{key:`title_${R.value}`,config:{title:{cy:"rings-div-title",...t.value.style.chart.title},subtitle:{cy:"rings-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value&&(e.unref(D)||e.unref(P))?(e.openBlock(),e.createBlock(oe.UserOptions,{ref_key:"details",ref:ce,key:`user_options_${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(G),isImaging:e.unref(j),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:m.value.showTooltip,isFullscreen:C.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:me,onGeneratePdf:e.unref(X),onGenerateCsv:Z,onGenerateImage:e.unref(Y),onToggleTable:ee,onToggleTooltip:te,onToggleAnnotator:E,style:e.normalizeStyle({visibility:e.unref(D)?e.unref(P)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:r})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.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:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ne._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:s.value.width<=0?10:s.value.width,height:s.value.height<=0?10:s.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Le)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"30%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${f.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(o.color,.05),100-t.value.style.chart.layout.rings.gradient.intensity)},null,8,Oe),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,Ie)],8,Ee))),256))]),l.$slots.pattern?(e.openBlock(),e.createElementBlock("g",ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,o=>(e.openBlock(),e.createElementBlock("defs",null,[e.renderSlot(l.$slots,"pattern",e.normalizeProps(e.guardReactiveProps({seriesIndex:o.absoluteIndex,patternId:`pattern_${f.value}_${o.absoluteIndex}`})),void 0,!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":b.value&&t.value.useCssAnimation,"vue-rings-item-onload":!b.value&&t.value.useCssAnimation,"vue-ui-rings-opacity":g.value!==null&&g.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+i.value*c.value[0].proportion/2-i.value*o.proportion/2-2*(r+1),r:e.unref(n.checkNaN)(i.value*o.proportion/2*.9<=0?1e-4:i.value*o.proportion/2*.9),fill:t.value.style.chart.layout.rings.gradient.underlayerColor},null,14,Ae),e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":b.value&&t.value.useCssAnimation,"vue-rings-item-onload":!b.value&&t.value.useCssAnimation,"vue-ui-rings-shadow":t.value.style.chart.layout.rings.useShadow,"vue-ui-rings-blur":g.value!==null&&g.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,"stroke-width":o.strokeWidth<.5?.5:o.strokeWidth,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+i.value*c.value[0].proportion/2-i.value*o.proportion/2-2*(r+1),r:e.unref(n.checkNaN)(i.value*o.proportion/2*.9<=0?1e-4:i.value*o.proportion/2*.9),fill:t.value.style.chart.layout.rings.gradient.show?`url(#gradient_${f.value}_${r})`:o.color},null,14,Fe),l.$slots.pattern?(e.openBlock(),e.createElementBlock("circle",{key:0,class:e.normalizeClass({"vue-ui-rings-item":b.value&&t.value.useCssAnimation,"vue-rings-item-onload":!b.value&&t.value.useCssAnimation,"vue-ui-rings-shadow":t.value.style.chart.layout.rings.useShadow,"vue-ui-rings-blur":g.value!==null&&g.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,"stroke-width":o.strokeWidth<.5?.5:o.strokeWidth,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+i.value*c.value[0].proportion/2-i.value*o.proportion/2-2*(r+1),r:e.unref(n.checkNaN)(i.value*o.proportion/2*.9<=0?1e-4:i.value*o.proportion/2*.9),fill:`url(#pattern_${f.value}_${o.absoluteIndex})`},null,14,Re)):e.createCommentVNode("",!0),e.createElementVNode("circle",{"data-cy-trap":"",stroke:"none",cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+i.value*c.value[0].proportion/2-i.value*o.proportion/2-2*(r+1),r:e.unref(n.checkNaN)(i.value*o.proportion/2*.9<=0?1e-4:i.value*o.proportion/2*.9),fill:"transparent",onMouseenter:u=>ge(r,o),onMouseleave:a[0]||(a[0]=u=>{g.value=null,x.value=!1})},null,40,qe)]))),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",Me,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(G)||e.unref(j)})),void 0,!0)])):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($e.default,{key:6,config:{type:"rings",style:{backgroundColor:t.value.style.chart.backgroundColor,rings:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:z},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(we.Legend,{key:`legend_${M.value}`,legendSet:Q.value,config:he.value,onClickMarker:a[1]||(a[1]=({legend:o})=>V(o.uid))},e.createSlots({item:e.withCtx(({legend:o,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:u=>V(o.uid),style:e.normalizeStyle(`opacity:${d.value.includes(o.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:o,seriesIndex:r}))+" ",1),d.value.includes(o.uid)?(e.openBlock(),e.createElementBlock("span",We," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",De," ("+e.toDisplayString(isNaN(o.value/h.value)?"-":e.unref(n.dataLabel)({v:o.value/h.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Ue)]),_:2},[l.$slots.pattern?{name:"legend-pattern",fn:e.withCtx(({legend:o,index:r})=>[e.createVNode(Be._sfc_main,{shape:o.shape,radius:30,stroke:"none",plot:{x:30,y:30},fill:`url(#pattern_${f.value}_${r})`},null,8,["shape","fill"])]),key:"0"}:void 0]),1032,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:Q.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:A,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ke._sfc_main,{show:m.value.showTooltip&&x.value&&d.value.length<p.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:k.value,content:_.value,isFullscreen:C.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...L.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...L.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),$.value?(e.openBlock(),e.createBlock(xe.default,{key:8,hideDetails:"",config:{open:m.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(Ce.DataTable,{key:`table_${q.value}`,colNames:S.value.colNames,head:S.value.head,body:S.value.body,config:S.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=o=>m.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,He)]),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)],46,Pe))}},je=_e._export_sfc(Ge,[["__scopeId","data-v-966f63d3"]]);exports.default=je;