vue-data-ui 2.4.20 → 2.4.21

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 (147) hide show
  1. package/dist/{Arrow-TG2JsMwT.js → Arrow-BuVX2WoN.js} +1 -1
  2. package/dist/{Arrow-DjiNIFce.cjs → Arrow-DDe-g8rw.cjs} +1 -1
  3. package/dist/{BaseIcon-CgiYTpkb.js → BaseIcon-BRSPQaGQ.js} +1 -1
  4. package/dist/{BaseIcon-D-YgPcX1.cjs → BaseIcon-BdKOa64A.cjs} +1 -1
  5. package/dist/{DataTable-B-_LZJ5T.js → DataTable-BpVz3DBX.js} +2 -2
  6. package/dist/{DataTable-T6NSDRqO.cjs → DataTable-H-KTkjfv.cjs} +1 -1
  7. package/dist/{Legend-B3KPtqT8.cjs → Legend-G5Zc4QaZ.cjs} +1 -1
  8. package/dist/{Legend-CJnJQbiR.js → Legend-hnLfwhmm.js} +1 -1
  9. package/dist/{PackageVersion-BjoP5ypd.cjs → PackageVersion-BbQFSVXm.cjs} +1 -1
  10. package/dist/{PackageVersion-DHeUFci0.js → PackageVersion-wqab02xF.js} +1 -1
  11. package/dist/{PenAndPaper-C0H3KJhQ.cjs → PenAndPaper-BX8pR5oV.cjs} +1 -1
  12. package/dist/{PenAndPaper-BKIQk9Cq.js → PenAndPaper-C_laA5mt.js} +3 -3
  13. package/dist/{Shape-BmBZkR94.cjs → Shape-CJbFv4bs.cjs} +1 -1
  14. package/dist/{Shape-nQyHwd5x.js → Shape-QdnXSUyn.js} +1 -1
  15. package/dist/Slicer-C1blYfez.cjs +1 -0
  16. package/dist/{Slicer-Cs0G0M7b.js → Slicer-DV1kBscZ.js} +58 -58
  17. package/dist/{Title-Az2QIayC.cjs → Title-BRqTk-nT.cjs} +1 -1
  18. package/dist/{Title-Dl6c1jg0.js → Title-DBozX6nP.js} +1 -1
  19. package/dist/{Tooltip-8UZ341MF.js → Tooltip-Com_T8vc.js} +1 -1
  20. package/dist/{Tooltip-wdo3yY_W.cjs → Tooltip-DvGSIp31.cjs} +1 -1
  21. package/dist/{index-DsF7Aej7.cjs → index-CsQwCVqU.cjs} +1 -1
  22. package/dist/{index-C2sScL5o.js → index-hV0hU1iE.js} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useNestedProp-CuE-kmwp.js → useNestedProp-CRAUOmT5.js} +1 -1
  25. package/dist/{useNestedProp-D0YHk8Cd.cjs → useNestedProp-DSYpaLxP.cjs} +1 -1
  26. package/dist/{usePrinter-CUDeluax.cjs → usePrinter-O2fMMTMe.cjs} +1 -1
  27. package/dist/{usePrinter-CddPH-Ds.js → usePrinter-y3d31M4g.js} +1 -1
  28. package/dist/{vue-data-ui-DqHj_pWh.js → vue-data-ui-bEKZH8jG.js} +58 -58
  29. package/dist/{vue-data-ui-owDqn8Xa.cjs → vue-data-ui-qBad3a6z.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-DJscSRTK.cjs → vue-ui-3d-bar-CkqKnqQt.cjs} +1 -1
  33. package/dist/{vue-ui-3d-bar-Bp1Qr_3F.js → vue-ui-3d-bar-f7YaBbrh.js} +9 -9
  34. package/dist/{vue-ui-accordion-Av34wbMx.cjs → vue-ui-accordion-CaktYQoo.cjs} +1 -1
  35. package/dist/{vue-ui-accordion-BH4FO7io.js → vue-ui-accordion-m-s-7akB.js} +3 -3
  36. package/dist/{vue-ui-age-pyramid-BOPzYxu_.js → vue-ui-age-pyramid-DkfNZR86.js} +10 -10
  37. package/dist/{vue-ui-age-pyramid-DbwlbzZl.cjs → vue-ui-age-pyramid-EKKYQu3N.cjs} +1 -1
  38. package/dist/{vue-ui-annotator-CGj1ftbP.js → vue-ui-annotator-DrVu5Pu0.js} +1 -1
  39. package/dist/{vue-ui-annotator-Dd0ZkXyj.cjs → vue-ui-annotator-v07J6oQG.cjs} +1 -1
  40. package/dist/{vue-ui-bullet-C6D22-Ah.js → vue-ui-bullet-CYDMehDZ.js} +8 -8
  41. package/dist/{vue-ui-bullet-B1LUeFVN.cjs → vue-ui-bullet-CdG92x7A.cjs} +1 -1
  42. package/dist/{vue-ui-candlestick-6kWB1Iz6.js → vue-ui-candlestick-Bw1O3QmK.js} +11 -11
  43. package/dist/{vue-ui-candlestick-BfBmmv4x.cjs → vue-ui-candlestick-D9yN-yRo.cjs} +1 -1
  44. package/dist/{vue-ui-carousel-table-BdZ2MO_U.cjs → vue-ui-carousel-table-Cg6hAEVv.cjs} +1 -1
  45. package/dist/{vue-ui-carousel-table-BFyyF9Ql.js → vue-ui-carousel-table-kcQa0FHw.js} +4 -4
  46. package/dist/{vue-ui-chestnut-RzOkxqA7.js → vue-ui-chestnut-DE1AMXeX.js} +8 -8
  47. package/dist/{vue-ui-chestnut-DjG-n6FA.cjs → vue-ui-chestnut-Qu8c3_vB.cjs} +1 -1
  48. package/dist/{vue-ui-cursor-B7aO28Bc.cjs → vue-ui-cursor-DG8oufeh.cjs} +1 -1
  49. package/dist/{vue-ui-cursor-CvZS65zZ.js → vue-ui-cursor-DbfjKtpf.js} +2 -2
  50. package/dist/{vue-ui-dashboard-BMaPi8dt.cjs → vue-ui-dashboard-BbwgfxLx.cjs} +1 -1
  51. package/dist/{vue-ui-dashboard-B5xuKqwS.js → vue-ui-dashboard-CAkCNUBh.js} +2 -2
  52. package/dist/{vue-ui-digits-C8VAWZ3p.js → vue-ui-digits-BaXAiH4u.js} +2 -2
  53. package/dist/{vue-ui-digits-BMNNUYnH.cjs → vue-ui-digits-DgQkxULm.cjs} +1 -1
  54. package/dist/{vue-ui-donut-NsU-zF5W.js → vue-ui-donut-7GM_Wd1Y.js} +11 -11
  55. package/dist/{vue-ui-donut-BMhNabzn.cjs → vue-ui-donut-BHzCOBu6.cjs} +1 -1
  56. package/dist/{vue-ui-donut-evolution-Bi3VA_yA.cjs → vue-ui-donut-evolution-C-TkUOr6.cjs} +1 -1
  57. package/dist/{vue-ui-donut-evolution-BpBAko36.js → vue-ui-donut-evolution-DbU4RlP6.js} +11 -11
  58. package/dist/{vue-ui-dumbbell-DcoUMxUR.js → vue-ui-dumbbell-BacTx3zB.js} +10 -10
  59. package/dist/{vue-ui-dumbbell-Bcyuwjih.cjs → vue-ui-dumbbell-DacMeiTU.cjs} +1 -1
  60. package/dist/{vue-ui-flow-C9usdqKR.cjs → vue-ui-flow-BUAvjG7i.cjs} +1 -1
  61. package/dist/{vue-ui-flow-CHtg7-D-.js → vue-ui-flow-D2G0YWL9.js} +9 -9
  62. package/dist/{vue-ui-galaxy-DCl7i83C.cjs → vue-ui-galaxy-CxfV3BIw.cjs} +1 -1
  63. package/dist/{vue-ui-galaxy-oU6i5aA-.js → vue-ui-galaxy-D6RFyIbQ.js} +11 -11
  64. package/dist/{vue-ui-gauge-C8pggd2h.cjs → vue-ui-gauge-CJ5TKJpb.cjs} +1 -1
  65. package/dist/{vue-ui-gauge-Dy2ZQxvF.js → vue-ui-gauge-DNJXnyLw.js} +7 -7
  66. package/dist/{vue-ui-gizmo-BQdo0Q3v.cjs → vue-ui-gizmo-BBA51j_0.cjs} +1 -1
  67. package/dist/{vue-ui-gizmo-CW4t27JP.js → vue-ui-gizmo-Db7-gRmB.js} +3 -3
  68. package/dist/{vue-ui-heatmap-Cdu2Xhjf.js → vue-ui-heatmap-Ba6RMSTk.js} +10 -10
  69. package/dist/{vue-ui-heatmap-CFT-bLNP.cjs → vue-ui-heatmap-KQj8Jbpt.cjs} +1 -1
  70. package/dist/{vue-ui-kpi-DfRy61t9.cjs → vue-ui-kpi-1srKxA1L.cjs} +1 -1
  71. package/dist/{vue-ui-kpi-Dnh9ZTZH.js → vue-ui-kpi-C8wyHy1H.js} +3 -3
  72. package/dist/{vue-ui-mini-loader-CI0Mwg9T.cjs → vue-ui-mini-loader-BgKTecng.cjs} +1 -1
  73. package/dist/{vue-ui-mini-loader-CLh4mj5Z.js → vue-ui-mini-loader-DutVmCuC.js} +2 -2
  74. package/dist/{vue-ui-molecule-Dyfk9UfE.js → vue-ui-molecule-BOkIojio.js} +11 -11
  75. package/dist/{vue-ui-molecule-Cqvn7ZGx.cjs → vue-ui-molecule-CSezTn3m.cjs} +1 -1
  76. package/dist/{vue-ui-mood-radar-D9XUvCNH.js → vue-ui-mood-radar-C8U8PHaq.js} +11 -11
  77. package/dist/{vue-ui-mood-radar-UqlWcAkr.cjs → vue-ui-mood-radar-CNTDrRs6.cjs} +1 -1
  78. package/dist/{vue-ui-nested-donuts-DP4yfGUH.js → vue-ui-nested-donuts-Bv2D1uFd.js} +11 -11
  79. package/dist/{vue-ui-nested-donuts-vUJ2g2dk.cjs → vue-ui-nested-donuts-DRWWnsdR.cjs} +1 -1
  80. package/dist/{vue-ui-onion-IxyzzuZC.js → vue-ui-onion-CT9YjU8v.js} +11 -11
  81. package/dist/{vue-ui-onion-fJOV7lwQ.cjs → vue-ui-onion-CsnwbXED.cjs} +1 -1
  82. package/dist/{vue-ui-parallel-coordinate-plot-C6CQj1ih.cjs → vue-ui-parallel-coordinate-plot-C8KCRAX1.cjs} +1 -1
  83. package/dist/{vue-ui-parallel-coordinate-plot-6LNS_W9b.js → vue-ui-parallel-coordinate-plot-in5qpfXf.js} +12 -12
  84. package/dist/{vue-ui-quadrant-BPJzCH5I.cjs → vue-ui-quadrant-Bw-0aW4F.cjs} +1 -1
  85. package/dist/{vue-ui-quadrant-eQs9Dod-.js → vue-ui-quadrant-C_9VNAXg.js} +12 -12
  86. package/dist/{vue-ui-quick-chart-CTMgh6oC.js → vue-ui-quick-chart-BDBlm9uu.js} +9 -9
  87. package/dist/{vue-ui-quick-chart-CWhEkYew.cjs → vue-ui-quick-chart-C0YqMjyE.cjs} +1 -1
  88. package/dist/{vue-ui-radar-Rrbv8dAs.js → vue-ui-radar-C2QM_ee9.js} +12 -12
  89. package/dist/{vue-ui-radar-CbwxQra8.cjs → vue-ui-radar-DXKMbeyW.cjs} +1 -1
  90. package/dist/{vue-ui-rating-BDy7Vxiz.cjs → vue-ui-rating-CsOknvaV.cjs} +1 -1
  91. package/dist/{vue-ui-rating-b_H5cz4V.js → vue-ui-rating-DVpgv2AY.js} +2 -2
  92. package/dist/{vue-ui-relation-circle-BsaD2Vz5.js → vue-ui-relation-circle-OXfdAyky.js} +7 -7
  93. package/dist/{vue-ui-relation-circle-CYxPC6gU.cjs → vue-ui-relation-circle-ZA-M7aSc.cjs} +1 -1
  94. package/dist/{vue-ui-rings-CywU-FZc.js → vue-ui-rings-qLQ-gl21.js} +11 -11
  95. package/dist/{vue-ui-rings-Dj329t-Y.cjs → vue-ui-rings-rftqDu-q.cjs} +1 -1
  96. package/dist/{vue-ui-scatter-Cf7C-P1q.js → vue-ui-scatter-4LbMvEAD.js} +12 -12
  97. package/dist/{vue-ui-scatter-BU3bhusK.cjs → vue-ui-scatter-Cv2IcrVH.cjs} +1 -1
  98. package/dist/{vue-ui-screenshot-DBeBfiuI.js → vue-ui-screenshot-BV6ZYQRk.js} +1 -1
  99. package/dist/{vue-ui-screenshot-v4TXqkKi.cjs → vue-ui-screenshot-BgjnQNxG.cjs} +1 -1
  100. package/dist/{vue-ui-skeleton-BgKRd_jD.js → vue-ui-skeleton-BY8Jg9a_.js} +3 -3
  101. package/dist/{vue-ui-skeleton-e8hBgzZq.cjs → vue-ui-skeleton-DsRTbz6d.cjs} +1 -1
  102. package/dist/{vue-ui-smiley-BEPDv0B2.js → vue-ui-smiley-BQ_3uicm.js} +2 -2
  103. package/dist/{vue-ui-smiley-WLjNbXtv.cjs → vue-ui-smiley-DB3y8CIb.cjs} +1 -1
  104. package/dist/{vue-ui-spark-trend-CWlczo-T.js → vue-ui-spark-trend-BhCJfY_p.js} +5 -5
  105. package/dist/{vue-ui-spark-trend-BqJ9Du4S.cjs → vue-ui-spark-trend-Cgn7ONtS.cjs} +1 -1
  106. package/dist/{vue-ui-sparkbar-CC644wqU.cjs → vue-ui-sparkbar-D4GIhUXT.cjs} +1 -1
  107. package/dist/{vue-ui-sparkbar-CpzctkDi.js → vue-ui-sparkbar-DxXt-GHr.js} +4 -4
  108. package/dist/{vue-ui-sparkgauge-DhTYuVVk.js → vue-ui-sparkgauge-BCPkJveV.js} +4 -4
  109. package/dist/{vue-ui-sparkgauge-QdcUMSrr.cjs → vue-ui-sparkgauge-BbltbIrq.cjs} +1 -1
  110. package/dist/{vue-ui-sparkhistogram-DT8aWhy7.js → vue-ui-sparkhistogram-BKcr2mFc.js} +5 -5
  111. package/dist/{vue-ui-sparkhistogram-B_bkoRo5.cjs → vue-ui-sparkhistogram-DzX6lkk8.cjs} +1 -1
  112. package/dist/{vue-ui-sparkline-gNuSbC73.cjs → vue-ui-sparkline-C-svTmFU.cjs} +1 -1
  113. package/dist/{vue-ui-sparkline-B0y9q_YB.js → vue-ui-sparkline-DYHUFUOp.js} +4 -4
  114. package/dist/{vue-ui-sparkstackbar-D0EW5UMR.js → vue-ui-sparkstackbar-Btag2osm.js} +5 -5
  115. package/dist/{vue-ui-sparkstackbar-BObzDdzR.cjs → vue-ui-sparkstackbar-CL0uL_Te.cjs} +1 -1
  116. package/dist/{vue-ui-stackbar-Behinggy.js → vue-ui-stackbar-C2mRU7ya.js} +12 -12
  117. package/dist/{vue-ui-stackbar-BRxbXX0l.cjs → vue-ui-stackbar-CML7v_yU.cjs} +1 -1
  118. package/dist/{vue-ui-strip-plot-DjyK_xfj.js → vue-ui-strip-plot-BIXF3VxN.js} +11 -11
  119. package/dist/{vue-ui-strip-plot-CjhT-LmB.cjs → vue-ui-strip-plot-Vn5sEcME.cjs} +1 -1
  120. package/dist/{vue-ui-table-C2YKKkgd.cjs → vue-ui-table-BbVpmm0B.cjs} +1 -1
  121. package/dist/{vue-ui-table-DYrm2td6.js → vue-ui-table-CyuRalnp.js} +1 -1
  122. package/dist/{vue-ui-table-heatmap-uSw3G5Yp.js → vue-ui-table-heatmap-DlGeS3l9.js} +4 -4
  123. package/dist/{vue-ui-table-heatmap-_A66YkO3.cjs → vue-ui-table-heatmap-DrQXQd41.cjs} +1 -1
  124. package/dist/{vue-ui-table-sparkline-CimHSr9x.cjs → vue-ui-table-sparkline-DauDTktD.cjs} +1 -1
  125. package/dist/{vue-ui-table-sparkline-DP752Vad.js → vue-ui-table-sparkline-Yg2I33yZ.js} +5 -5
  126. package/dist/{vue-ui-thermometer-CqmSsg-L.cjs → vue-ui-thermometer-Bglz0dOQ.cjs} +1 -1
  127. package/dist/{vue-ui-thermometer-BAoZL-gV.js → vue-ui-thermometer-DXwbqNrn.js} +7 -7
  128. package/dist/{vue-ui-timer-CmeHwizl.js → vue-ui-timer-Brr7buaM.js} +5 -5
  129. package/dist/{vue-ui-timer-B3kBoPr3.cjs → vue-ui-timer-CpSEl8UD.cjs} +1 -1
  130. package/dist/{vue-ui-tiremarks-DEcQ-B-G.js → vue-ui-tiremarks-DJowPFwY.js} +7 -7
  131. package/dist/{vue-ui-tiremarks-DyAHN8nt.cjs → vue-ui-tiremarks-zdGmZNjo.cjs} +1 -1
  132. package/dist/{vue-ui-treemap-sI6K1nm9.js → vue-ui-treemap-Bn5JU5BI.js} +11 -11
  133. package/dist/{vue-ui-treemap-CNSeLpGe.cjs → vue-ui-treemap-a7NSP656.cjs} +1 -1
  134. package/dist/{vue-ui-vertical-bar-B1TdmM7c.cjs → vue-ui-vertical-bar-BYG1vGlT.cjs} +1 -1
  135. package/dist/{vue-ui-vertical-bar-COsFMFTH.js → vue-ui-vertical-bar-CZxN7L9z.js} +11 -11
  136. package/dist/{vue-ui-waffle-Cz1aIQK1.cjs → vue-ui-waffle-BbDBOivH.cjs} +1 -1
  137. package/dist/{vue-ui-waffle-DBjvyyH7.js → vue-ui-waffle-CzUpKfkZ.js} +11 -11
  138. package/dist/{vue-ui-wheel-BGT8eh76.js → vue-ui-wheel-CCje_ZSc.js} +7 -7
  139. package/dist/{vue-ui-wheel-D2SqIwip.cjs → vue-ui-wheel-lN3uYCr4.cjs} +1 -1
  140. package/dist/{vue-ui-word-cloud-BFLqOtlV.cjs → vue-ui-word-cloud-BjvG3n7x.cjs} +1 -1
  141. package/dist/{vue-ui-word-cloud-vUXYTp4a.js → vue-ui-word-cloud-D_5y92zN.js} +10 -10
  142. package/dist/{vue-ui-xy-CoDtZktc.cjs → vue-ui-xy-B-WlwJXZ.cjs} +1 -1
  143. package/dist/{vue-ui-xy-DyDkCQL0.js → vue-ui-xy-Drm1aAb-.js} +14 -14
  144. package/dist/{vue-ui-xy-canvas-C6db7VrZ.cjs → vue-ui-xy-canvas-BHrq_CYD.cjs} +1 -1
  145. package/dist/{vue-ui-xy-canvas-DnPYfALY.js → vue-ui-xy-canvas-jieVsnBN.js} +11 -11
  146. package/package.json +1 -1
  147. package/dist/Slicer-BUhJuKdW.cjs +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DsF7Aej7.cjs"),we=require("./useResponsive-BJ7DTGpm.cjs"),re=require("./BaseIcon-D-YgPcX1.cjs"),De=require("./Tooltip-wdo3yY_W.cjs"),Ee=require("./usePrinter-CUDeluax.cjs"),Me=require("./Slicer-BUhJuKdW.cjs"),Ue=require("./vue-ui-skeleton-e8hBgzZq.cjs"),Ae=require("./useNestedProp-D0YHk8Cd.cjs"),qe=require("./PackageVersion-BjoP5ypd.cjs"),We=require("./PenAndPaper-C0H3KJhQ.cjs"),je=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={LINE:"LINE",BAR:"BAR",DONUT:"DONUT"},Ge=["SERIE","SERIES","DATA","VALUE","VALUES","NUM"];function He({dataset:s,barLineSwitch:B=6}){let h=null,L=null,z=0;if((typeof s=="number"||typeof s=="string")&&console.warn(`The provided dataset (${s}) is not sufficient to build a chart`),Q(s)&&(P(s)&&(s.length<B?h=S.BAR:h=S.LINE,L=s,z=s.length),ie(s))){if(!Ye(s))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(s[0]),j=Object.values(s[0]);if(!U.some(E=>Ze(E)))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;Le(j,E=>typeof E=="number")&&(h=S.DONUT,L=s),Le(j,E=>Array.isArray(E)&&P(E))&&(_e(s)>B?h=S.LINE:h=S.BAR,z=_e(s),L=s.map(E=>({...E,data:Je(E,$=>P($))}))),s=s.map(E=>Ce(E)),L=L.map(E=>Ce(E))}return Q(s)&&[...new Set(s.flatMap(U=>Array.isArray(U)))][0],{dataset:s,type:h,usableDataset:L,maxSeriesLength:z}}function Ne(s){return!s||Q(s)&&!s.length}function Q(s){return Array.isArray(s)}function P(s){if(!Q(s)||Ne(s))return!1;const B=s.map(h=>Number(h));return![...new Set(B.flatMap(h=>typeof h=="number"&&!isNaN(h)))].includes(!1)}function ie(s){return!Q(s)||Ne(s)||!![...new Set(s.flatMap(h=>typeof h=="object"&&!Array.isArray(h)))].includes(!1)?!1:!s.map(h=>Object.keys(h).length>0).includes(!1)}function Xe(s,B){const h=Object.keys(s).sort(),L=Object.keys(B).sort();if(h.length!==L.length)return!1;for(let z=0;z<h.length;z+=1){const V=h[z],M=L[z];if(V!==M||typeof s[V]!=typeof B[M])return!1}return!0}function Ye(s){if(s.length<=1)return!0;for(let B=0;B<s.length;B+=1)for(let h=B+1;h<s.length;h+=1)if(!Xe(s[B],s[h]))return!1;return!0}function Ze(s){return Ge.includes(s.toUpperCase())}function Le(s,B){let h=[];for(let L=0;L<s.length;L+=1)h.push(B(s[L]));return h.includes(!0)}function _e(s){return Math.max(...[...s].flatMap(B=>Object.values(B).filter(h=>P(h)).map(h=>h.length)))}function Je(s,B){return Object.values(s).filter(h=>B(h))[0]}function Ce(s){const B={};for(let h in s)s.hasOwnProperty(h)&&(B[h.toUpperCase()]=s[h]);return B}const ze=s=>(e.pushScopeId("data-v-7397d9b6"),s=s(),e.popScopeId(),s),Qe=["id"],Ke=["xmlns","viewBox"],et=["id"],tt=["id"],lt=ze(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),at=["id"],ot=["flood-color"],nt={key:0,class:"donut-label-connectors"},rt=["d","stroke","stroke-width","filter"],it=["cx","cy","r","fill","filter"],ut={class:"donut"},st=["d","fill","stroke","stroke-width","filter"],ct=["d","onMouseenter","onClick"],dt={key:1,class:"donut-labels quick-animation"},vt=["cx","cy","fill","stroke","filter"],mt=["text-anchor","x","y","fill","font-size","filter"],ht=["text-anchor","x","y","fill","font-size","filter"],pt={key:2,class:"donut-hollow quick-animation"},ft=["x","y","font-size","fill"],kt=["x","y","font-size","fill"],gt={key:0,class:"line-grid"},yt=["x1","x2","y1","y2","stroke","stroke-width"],xt=["x1","x2","y1","y2","stroke","stroke-width"],St={key:1,class:"line-axis"},bt=["x1","x2","y1","y2","stroke","stroke-width"],Bt=["x1","x2","y1","y2","stroke","stroke-width"],wt={key:2,class:"yLabels"},Et=["x1","x2","y1","y2","stroke","stroke-width"],At=["x","y","font-size","fill"],Lt={key:3,class:"periodLabels"},_t=["x1","x2","y1","y2","stroke","stroke-width"],Ct=["font-size","text-anchor","fill","transform"],Nt={class:"plots"},zt={class:"line-plot-series"},Vt=["d","stroke","stroke-width"],Ft=["d","stroke","stroke-width"],$t=["d","stroke","stroke-width"],Pt=["d","stroke","stroke-width"],Tt=["cx","cy","fill","stroke"],Rt={key:4,class:"dataLabels"},It=["font-size","fill","x","y"],Ot={class:"tooltip-traps"},Dt=["x","y","height","width","fill","onMouseenter","onClick"],Mt={key:0,class:"line-grid"},Ut=["x1","x2","y1","y2","stroke","stroke-width"],qt=["x1","x2","y1","y2","stroke","stroke-width"],Wt={key:1,class:"line-axis"},jt=["x1","x2","y1","y2","stroke","stroke-width"],Gt=["x1","x2","y1","y2","stroke","stroke-width"],Ht={key:2,class:"yLabels"},Xt=["x1","x2","y1","y2","stroke","stroke-width"],Yt=["x","y","font-size","fill"],Zt={key:3,class:"periodLabels"},Jt=["x1","x2","y1","y2","stroke","stroke-width"],Qt=["font-size","text-anchor","transform","fill"],Kt={class:"plots"},el=["x","width","height","y","fill","stroke","stroke-width"],tl=["to"],ll=["from","to"],al={key:4,class:"dataLabels"},ol=["x","y","font-size","fill"],nl={class:"tooltip-traps"},rl=["x","y","height","width","fill","onMouseenter","onClick"],il={key:3,class:"axis-labels"},ul={key:0},sl=["font-size","fill","x","y"],cl={key:1},dl=["font-size","fill","x","y"],vl={key:2},ml=["font-size","fill","transform"],hl={key:3},pl=["font-size","fill","transform"],fl={key:6,class:"vue-data-ui-watermark"},kl=["onClick"],gl=["onClick"],yl=["onClick"],xl={key:1,class:"vue-ui-quick-chart-not-processable"},Sl=ze(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),bl={__name:"vue-ui-quick-chart",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}}},emits:["selectDatapoint","selectLegend"],setup(s,{expose:B,emit:h}){const L=s,{vue_ui_quick_chart:z}=u.useConfig(),V=e.ref(null),M=e.ref(null),U=e.ref(null),j=e.ref(null),E=e.ref(u.createUid()),$=e.ref(!1),G=e.ref(null),R=e.ref(""),F=e.ref(null),de=e.ref(null),ve=e.ref(null),x=e.ref([]),me=e.ref(0),K=e.ref(0),t=e.computed({get:()=>he(),set:n=>n});function he(){const n=Ae.useNestedProp({userConfig:L.config,defaultConfig:z});return n.theme?{...Ae.useNestedProp({userConfig:u.themes.vue_ui_quick_chart[n.theme]||L.config,defaultConfig:n}),customPalette:u.themePalettes[n.theme]||u.palette}:n}e.watch(()=>L.config,n=>{t.value=he(),y.value.width=t.value.width,y.value.height=t.value.height,ke()},{deep:!0}),e.watch(()=>L.dataset,n=>{f.value=X.value,k.value.start=0,k.value.end=f.value.maxSeriesLength,K.value+=1},{deep:!0});const H=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),X=e.computed(()=>{const n=He({dataset:u.sanitizeArray(L.dataset,["serie","series","data","value","values","num"]),barLineSwitch:t.value.chartIsBarUnderDatasetLength});return n||console.error("VueUiQuickChart : Dataset is not processable"),n}),f=e.ref(X.value),Ve=e.computed(()=>!!f.value),b=e.computed(()=>f.value?f.value.type:null);e.watch(()=>b.value,n=>{n||u.error({componentName:"VueUiQuickChart",type:"dataset"})},{immediate:!0});const{isPrinting:ee,isImaging:te,generatePdf:pe,generateImage:fe}=Ee.usePrinter({elementId:`${b.value}_${E.value}`,fileName:t.value.title||b.value}),Fe=e.computed(()=>t.value.showUserOptions&&!t.value.title),y=e.ref({width:t.value.width,height:t.value.height}),le=e.ref({showTooltip:t.value.showTooltip}),ae=e.ref(null);e.onMounted(()=>{ke()});function ke(){if(t.value.responsive){const n=we.throttle(()=>{const{width:v,height:l}=we.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:de.value,noTitle:ve.value});y.value.width=v,y.value.height=l});ae.value=new ResizeObserver(n),ae.value.observe(V.value.parentNode)}}e.onBeforeUnmount(()=>{ae.value&&ae.value.disconnect()});const $e=e.computed(()=>{switch(b.value){case S.LINE:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`;case S.BAR:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`;case S.DONUT:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`;default:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`}});function ge(n){return[...n].map(v=>v.value).reduce((v,l)=>v+l,0)}function Y(n){return t.value.blurOnHover&&![null,void 0].includes(F.value)&&F.value!==n?`url(#blur_${E.value})`:""}function ye(n,v){x.value.includes(n)?x.value=x.value.filter(l=>l!==n):x.value.length<v&&x.value.push(n)}const xe=e.ref(null),Se=e.ref(null),oe=e.ref(!1);function Pe(n,v){oe.value=!0;let l=n.value;if(x.value.includes(n.id)){let i=function(){l>r?(oe.value=!1,cancelAnimationFrame(Se.value),f.value={...f.value,dataset:f.value.dataset.map((m,_)=>n.id===`donut_${_}`?{...m,value:r,VALUE:r}:m)}):(l+=r*.025,f.value={...f.value,dataset:f.value.dataset.map((m,_)=>n.id===`donut_${_}`?{...m,value:l,VALUE:l}:m)},Se.value=requestAnimationFrame(i))};x.value=x.value.filter(m=>m!==n.id);const r=X.value.dataset.find((m,_)=>n.id===`donut_${_}`).VALUE;i()}else if(v.length>1){let r=function(){l<.1?(oe.value=!1,cancelAnimationFrame(xe.value),x.value.push(n.id),f.value={...f.value,dataset:f.value.dataset.map((i,m)=>n.id===`donut_${m}`?{...i,value:0,VALUE:0}:i)}):(l/=1.1,f.value={...f.value,dataset:f.value.dataset.map((i,m)=>n.id===`donut_${m}`?{...i,value:l,VALUE:l}:i)},xe.value=requestAnimationFrame(r))};r()}}const T=e.ref(null);function Te(n){T.value=n}const be=e.computed(()=>t.value.donutThicknessRatio<.15?.15:t.value.donutThicknessRatio>.4?.4:t.value.donutThicknessRatio),w=e.computed(()=>{if(b.value!==S.DONUT)return null;const n=f.value.dataset.map((a,o)=>({...a,value:a.VALUE||a.DATA||a.SERIE||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`donut_${o}`})).map((a,o)=>({...a,color:a.COLOR?u.convertColorToHex(a.COLOR):H.value[o+t.value.paletteStartIndex]||u.palette[o+t.value.paletteStartIndex]||u.palette[(o+t.value.paletteStartIndex)%u.palette.length],immutableValue:a.value}));function v(a,o){return u.dataLabel({v:isNaN(a.value/ge(o))?0:a.value/ge(o)*100,s:"%",r:t.value.dataLabelRoundingPercentage})}function l(a){return a.proportion*100>t.value.donutHideLabelUnderPercentage}function r(a,o){const g=X.value.dataset.find((A,C)=>`donut_${C}`===a).VALUE;return Math.abs(String(Number(g.toFixed(0))).length-String(Number(o.toFixed(0))).length)}function i({datapoint:a,seriesIndex:o}){G.value={datapoint:a,seriesIndex:o,config:t.value,dataset:n},F.value=a.id;const g=t.value.tooltipCustomFormat;if(u.isFunction(g)&&u.functionReturnsString(()=>g({datapoint:a,seriesIndex:o,series:n,config:t.value})))R.value=g({datapoint:a,seriesIndex:o,series:n,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;">${a.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="${a.color}"/></svg>`,p+=`<b>${u.applyDataLabel(t.value.formatter,a.value,u.dataLabel({p:t.value.valuePrefix,v:a.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:a,seriesIndex:o})}</b>`,p+=`<span>(${u.dataLabel({v:a.proportion*100,s:"%",r:t.value.dataLabelRoundingPercentage})})</span></div>`,R.value=`<div>${p}</div>`}$.value=!0}function m(){$.value=!1,F.value=null,T.value=null}const _={centerX:y.value.width/2,centerY:y.value.height/2},N=n.filter(a=>!x.value.includes(a.id)).map(a=>a.value||0).reduce((a,o)=>a+o,0),q=n.map((a,o)=>({...a,proportion:(a.value||0)/N,value:a.value||0,absoluteValue:X.value.dataset.find((g,p)=>`donut_${p}`===a.id).VALUE})),I=y.value.width/2,W=y.value.height/2,O=y.value.height*t.value.donutRadiusRatio;return{dataset:q.filter(a=>!x.value.includes(a.id)),legend:q,drawingArea:_,displayArcPercentage:v,isArcBigEnough:l,useTooltip:i,killTooltip:m,getSpaces:r,total:N,cx:I,cy:W,radius:O,chart:u.makeDonut({series:n.filter(a=>!x.value.includes(a.id))},I,W,O,O,1.99999,2,1,360,105.25,y.value.height*be.value)}}),k=e.ref({start:0,end:f.value.maxSeriesLength});function Re(){k.value={start:0,end:f.value.maxSeriesLength},K.value+=1}const Ie=e.computed(()=>{if(!t.value.zoomMinimap.show||b.value===S.DONUT)return[];let n=[];P(f.value.dataset)&&(n=f.value.dataset),ie(f.value.dataset)&&(n=f.value.dataset.map((i,m)=>({values:i.VALUE||i.DATA||i.SERIE||i.SERIES||i.VALUES||i.NUM||0,id:b.value===S.LINE?`line_${m}`:`bar_${m}`})).filter(i=>!x.value.includes(i.id)));const v=P(n)?n.length:Math.max(...n.map(i=>i.values.length));let l=[];if(P(n))l=n;else for(let i=0;i<v;i+=1)l.push(n.map(m=>m.values[i]||0).reduce((m,_)=>(m||0)+(_||0),0));const r=Math.min(...l);return l.map(i=>i+(r<0?Math.abs(r):0))}),d=e.computed(()=>{if(b.value!==S.LINE)return null;const n={height:y.value.height,width:y.value.width},v={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:n.width-t.value.xyPaddingRight,bottom:n.height-t.value.xyPaddingBottom,width:n.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:n.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];P(f.value.dataset)&&(l=[{values:f.value.dataset.slice(k.value.start,k.value.end),absoluteIndices:f.value.dataset.map((a,o)=>o).slice(k.value.start,k.value.end),name:t.value.title,color:H.value[t.value.paletteStartIndex]||u.palette[t.value.paletteStartIndex],id:"line_0"}]),ie(f.value.dataset)&&(l=f.value.dataset.map((a,o)=>({...a,values:a.VALUE||a.DATA||a.SERIE||a.SERIES||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`line_${o}`})).map((a,o)=>({...a,color:a.COLOR?u.convertColorToHex(a.COLOR):H.value[o+t.value.paletteStartIndex]||u.palette[o+t.value.paletteStartIndex]||u.palette[(o+t.value.paletteStartIndex)%u.palette.length],values:a.values.slice(k.value.start,k.value.end),absoluteIndices:a.values.map((g,p)=>p).slice(k.value.start,k.value.end)})));const r={max:Math.max(...l.filter(a=>!x.value.includes(a.id)).flatMap(a=>a.values)),min:Math.min(...l.filter(a=>!x.value.includes(a.id)).flatMap(a=>a.values)),maxSeries:Math.max(...l.map(a=>a.values.length))},i=u.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?v.top:v.bottom-m/(i.max+m)*v.height,N=v.width/r.maxSeries,q=i.ticks.map(a=>({y:v.bottom-v.height*((a+m)/(i.max+m)),x:v.left-8,value:a})),I=l.map((a,o)=>({...a,coordinates:a.values.map((g,p)=>({x:v.left+N*(p+1)-N/2,y:v.bottom-(g+m)/(i.max+m)*v.height,value:g}))})).map(a=>{let o=[];return a.coordinates.forEach(g=>{o.push(`${g.x},${g.y} `)}),{...a,linePath:o.join(" ")}});function W(a){F.value=a,T.value=a;const o=l.map(p=>({...p,value:p.values[a],absoluteIndex:p.absoluteIndices[a]})).filter(p=>!x.value.includes(p.id));G.value={datapoint:o,seriesIndex:a,config:t.value,dataset:l};const g=t.value.tooltipCustomFormat;if(u.isFunction(g)&&u.functionReturnsString(()=>g({datapoint:o,seriesIndex:a,series:l,config:t.value})))R.value=g({datapoint:o,seriesIndex:a,series:l,config:t.value});else{let p="";t.value.xyPeriods[o[0].absoluteIndex]&&(p+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[o[0].absoluteIndex]}</div>`),o.forEach((A,C)=>{p+=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-CsQwCVqU.cjs"),we=require("./useResponsive-BJ7DTGpm.cjs"),re=require("./BaseIcon-BdKOa64A.cjs"),De=require("./Tooltip-DvGSIp31.cjs"),Ee=require("./usePrinter-O2fMMTMe.cjs"),Me=require("./Slicer-C1blYfez.cjs"),Ue=require("./vue-ui-skeleton-DsRTbz6d.cjs"),Ae=require("./useNestedProp-DSYpaLxP.cjs"),qe=require("./PackageVersion-BbQFSVXm.cjs"),We=require("./PenAndPaper-BX8pR5oV.cjs"),je=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={LINE:"LINE",BAR:"BAR",DONUT:"DONUT"},Ge=["SERIE","SERIES","DATA","VALUE","VALUES","NUM"];function He({dataset:s,barLineSwitch:B=6}){let h=null,L=null,z=0;if((typeof s=="number"||typeof s=="string")&&console.warn(`The provided dataset (${s}) is not sufficient to build a chart`),Q(s)&&(P(s)&&(s.length<B?h=S.BAR:h=S.LINE,L=s,z=s.length),ie(s))){if(!Ye(s))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(s[0]),j=Object.values(s[0]);if(!U.some(E=>Ze(E)))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;Le(j,E=>typeof E=="number")&&(h=S.DONUT,L=s),Le(j,E=>Array.isArray(E)&&P(E))&&(_e(s)>B?h=S.LINE:h=S.BAR,z=_e(s),L=s.map(E=>({...E,data:Je(E,$=>P($))}))),s=s.map(E=>Ce(E)),L=L.map(E=>Ce(E))}return Q(s)&&[...new Set(s.flatMap(U=>Array.isArray(U)))][0],{dataset:s,type:h,usableDataset:L,maxSeriesLength:z}}function Ne(s){return!s||Q(s)&&!s.length}function Q(s){return Array.isArray(s)}function P(s){if(!Q(s)||Ne(s))return!1;const B=s.map(h=>Number(h));return![...new Set(B.flatMap(h=>typeof h=="number"&&!isNaN(h)))].includes(!1)}function ie(s){return!Q(s)||Ne(s)||!![...new Set(s.flatMap(h=>typeof h=="object"&&!Array.isArray(h)))].includes(!1)?!1:!s.map(h=>Object.keys(h).length>0).includes(!1)}function Xe(s,B){const h=Object.keys(s).sort(),L=Object.keys(B).sort();if(h.length!==L.length)return!1;for(let z=0;z<h.length;z+=1){const V=h[z],M=L[z];if(V!==M||typeof s[V]!=typeof B[M])return!1}return!0}function Ye(s){if(s.length<=1)return!0;for(let B=0;B<s.length;B+=1)for(let h=B+1;h<s.length;h+=1)if(!Xe(s[B],s[h]))return!1;return!0}function Ze(s){return Ge.includes(s.toUpperCase())}function Le(s,B){let h=[];for(let L=0;L<s.length;L+=1)h.push(B(s[L]));return h.includes(!0)}function _e(s){return Math.max(...[...s].flatMap(B=>Object.values(B).filter(h=>P(h)).map(h=>h.length)))}function Je(s,B){return Object.values(s).filter(h=>B(h))[0]}function Ce(s){const B={};for(let h in s)s.hasOwnProperty(h)&&(B[h.toUpperCase()]=s[h]);return B}const ze=s=>(e.pushScopeId("data-v-7397d9b6"),s=s(),e.popScopeId(),s),Qe=["id"],Ke=["xmlns","viewBox"],et=["id"],tt=["id"],lt=ze(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),at=["id"],ot=["flood-color"],nt={key:0,class:"donut-label-connectors"},rt=["d","stroke","stroke-width","filter"],it=["cx","cy","r","fill","filter"],ut={class:"donut"},st=["d","fill","stroke","stroke-width","filter"],ct=["d","onMouseenter","onClick"],dt={key:1,class:"donut-labels quick-animation"},vt=["cx","cy","fill","stroke","filter"],mt=["text-anchor","x","y","fill","font-size","filter"],ht=["text-anchor","x","y","fill","font-size","filter"],pt={key:2,class:"donut-hollow quick-animation"},ft=["x","y","font-size","fill"],kt=["x","y","font-size","fill"],gt={key:0,class:"line-grid"},yt=["x1","x2","y1","y2","stroke","stroke-width"],xt=["x1","x2","y1","y2","stroke","stroke-width"],St={key:1,class:"line-axis"},bt=["x1","x2","y1","y2","stroke","stroke-width"],Bt=["x1","x2","y1","y2","stroke","stroke-width"],wt={key:2,class:"yLabels"},Et=["x1","x2","y1","y2","stroke","stroke-width"],At=["x","y","font-size","fill"],Lt={key:3,class:"periodLabels"},_t=["x1","x2","y1","y2","stroke","stroke-width"],Ct=["font-size","text-anchor","fill","transform"],Nt={class:"plots"},zt={class:"line-plot-series"},Vt=["d","stroke","stroke-width"],Ft=["d","stroke","stroke-width"],$t=["d","stroke","stroke-width"],Pt=["d","stroke","stroke-width"],Tt=["cx","cy","fill","stroke"],Rt={key:4,class:"dataLabels"},It=["font-size","fill","x","y"],Ot={class:"tooltip-traps"},Dt=["x","y","height","width","fill","onMouseenter","onClick"],Mt={key:0,class:"line-grid"},Ut=["x1","x2","y1","y2","stroke","stroke-width"],qt=["x1","x2","y1","y2","stroke","stroke-width"],Wt={key:1,class:"line-axis"},jt=["x1","x2","y1","y2","stroke","stroke-width"],Gt=["x1","x2","y1","y2","stroke","stroke-width"],Ht={key:2,class:"yLabels"},Xt=["x1","x2","y1","y2","stroke","stroke-width"],Yt=["x","y","font-size","fill"],Zt={key:3,class:"periodLabels"},Jt=["x1","x2","y1","y2","stroke","stroke-width"],Qt=["font-size","text-anchor","transform","fill"],Kt={class:"plots"},el=["x","width","height","y","fill","stroke","stroke-width"],tl=["to"],ll=["from","to"],al={key:4,class:"dataLabels"},ol=["x","y","font-size","fill"],nl={class:"tooltip-traps"},rl=["x","y","height","width","fill","onMouseenter","onClick"],il={key:3,class:"axis-labels"},ul={key:0},sl=["font-size","fill","x","y"],cl={key:1},dl=["font-size","fill","x","y"],vl={key:2},ml=["font-size","fill","transform"],hl={key:3},pl=["font-size","fill","transform"],fl={key:6,class:"vue-data-ui-watermark"},kl=["onClick"],gl=["onClick"],yl=["onClick"],xl={key:1,class:"vue-ui-quick-chart-not-processable"},Sl=ze(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),bl={__name:"vue-ui-quick-chart",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}}},emits:["selectDatapoint","selectLegend"],setup(s,{expose:B,emit:h}){const L=s,{vue_ui_quick_chart:z}=u.useConfig(),V=e.ref(null),M=e.ref(null),U=e.ref(null),j=e.ref(null),E=e.ref(u.createUid()),$=e.ref(!1),G=e.ref(null),R=e.ref(""),F=e.ref(null),de=e.ref(null),ve=e.ref(null),x=e.ref([]),me=e.ref(0),K=e.ref(0),t=e.computed({get:()=>he(),set:n=>n});function he(){const n=Ae.useNestedProp({userConfig:L.config,defaultConfig:z});return n.theme?{...Ae.useNestedProp({userConfig:u.themes.vue_ui_quick_chart[n.theme]||L.config,defaultConfig:n}),customPalette:u.themePalettes[n.theme]||u.palette}:n}e.watch(()=>L.config,n=>{t.value=he(),y.value.width=t.value.width,y.value.height=t.value.height,ke()},{deep:!0}),e.watch(()=>L.dataset,n=>{f.value=X.value,k.value.start=0,k.value.end=f.value.maxSeriesLength,K.value+=1},{deep:!0});const H=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),X=e.computed(()=>{const n=He({dataset:u.sanitizeArray(L.dataset,["serie","series","data","value","values","num"]),barLineSwitch:t.value.chartIsBarUnderDatasetLength});return n||console.error("VueUiQuickChart : Dataset is not processable"),n}),f=e.ref(X.value),Ve=e.computed(()=>!!f.value),b=e.computed(()=>f.value?f.value.type:null);e.watch(()=>b.value,n=>{n||u.error({componentName:"VueUiQuickChart",type:"dataset"})},{immediate:!0});const{isPrinting:ee,isImaging:te,generatePdf:pe,generateImage:fe}=Ee.usePrinter({elementId:`${b.value}_${E.value}`,fileName:t.value.title||b.value}),Fe=e.computed(()=>t.value.showUserOptions&&!t.value.title),y=e.ref({width:t.value.width,height:t.value.height}),le=e.ref({showTooltip:t.value.showTooltip}),ae=e.ref(null);e.onMounted(()=>{ke()});function ke(){if(t.value.responsive){const n=we.throttle(()=>{const{width:v,height:l}=we.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:de.value,noTitle:ve.value});y.value.width=v,y.value.height=l});ae.value=new ResizeObserver(n),ae.value.observe(V.value.parentNode)}}e.onBeforeUnmount(()=>{ae.value&&ae.value.disconnect()});const $e=e.computed(()=>{switch(b.value){case S.LINE:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`;case S.BAR:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`;case S.DONUT:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`;default:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`}});function ge(n){return[...n].map(v=>v.value).reduce((v,l)=>v+l,0)}function Y(n){return t.value.blurOnHover&&![null,void 0].includes(F.value)&&F.value!==n?`url(#blur_${E.value})`:""}function ye(n,v){x.value.includes(n)?x.value=x.value.filter(l=>l!==n):x.value.length<v&&x.value.push(n)}const xe=e.ref(null),Se=e.ref(null),oe=e.ref(!1);function Pe(n,v){oe.value=!0;let l=n.value;if(x.value.includes(n.id)){let i=function(){l>r?(oe.value=!1,cancelAnimationFrame(Se.value),f.value={...f.value,dataset:f.value.dataset.map((m,_)=>n.id===`donut_${_}`?{...m,value:r,VALUE:r}:m)}):(l+=r*.025,f.value={...f.value,dataset:f.value.dataset.map((m,_)=>n.id===`donut_${_}`?{...m,value:l,VALUE:l}:m)},Se.value=requestAnimationFrame(i))};x.value=x.value.filter(m=>m!==n.id);const r=X.value.dataset.find((m,_)=>n.id===`donut_${_}`).VALUE;i()}else if(v.length>1){let r=function(){l<.1?(oe.value=!1,cancelAnimationFrame(xe.value),x.value.push(n.id),f.value={...f.value,dataset:f.value.dataset.map((i,m)=>n.id===`donut_${m}`?{...i,value:0,VALUE:0}:i)}):(l/=1.1,f.value={...f.value,dataset:f.value.dataset.map((i,m)=>n.id===`donut_${m}`?{...i,value:l,VALUE:l}:i)},xe.value=requestAnimationFrame(r))};r()}}const T=e.ref(null);function Te(n){T.value=n}const be=e.computed(()=>t.value.donutThicknessRatio<.15?.15:t.value.donutThicknessRatio>.4?.4:t.value.donutThicknessRatio),w=e.computed(()=>{if(b.value!==S.DONUT)return null;const n=f.value.dataset.map((a,o)=>({...a,value:a.VALUE||a.DATA||a.SERIE||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`donut_${o}`})).map((a,o)=>({...a,color:a.COLOR?u.convertColorToHex(a.COLOR):H.value[o+t.value.paletteStartIndex]||u.palette[o+t.value.paletteStartIndex]||u.palette[(o+t.value.paletteStartIndex)%u.palette.length],immutableValue:a.value}));function v(a,o){return u.dataLabel({v:isNaN(a.value/ge(o))?0:a.value/ge(o)*100,s:"%",r:t.value.dataLabelRoundingPercentage})}function l(a){return a.proportion*100>t.value.donutHideLabelUnderPercentage}function r(a,o){const g=X.value.dataset.find((A,C)=>`donut_${C}`===a).VALUE;return Math.abs(String(Number(g.toFixed(0))).length-String(Number(o.toFixed(0))).length)}function i({datapoint:a,seriesIndex:o}){G.value={datapoint:a,seriesIndex:o,config:t.value,dataset:n},F.value=a.id;const g=t.value.tooltipCustomFormat;if(u.isFunction(g)&&u.functionReturnsString(()=>g({datapoint:a,seriesIndex:o,series:n,config:t.value})))R.value=g({datapoint:a,seriesIndex:o,series:n,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;">${a.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="${a.color}"/></svg>`,p+=`<b>${u.applyDataLabel(t.value.formatter,a.value,u.dataLabel({p:t.value.valuePrefix,v:a.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:a,seriesIndex:o})}</b>`,p+=`<span>(${u.dataLabel({v:a.proportion*100,s:"%",r:t.value.dataLabelRoundingPercentage})})</span></div>`,R.value=`<div>${p}</div>`}$.value=!0}function m(){$.value=!1,F.value=null,T.value=null}const _={centerX:y.value.width/2,centerY:y.value.height/2},N=n.filter(a=>!x.value.includes(a.id)).map(a=>a.value||0).reduce((a,o)=>a+o,0),q=n.map((a,o)=>({...a,proportion:(a.value||0)/N,value:a.value||0,absoluteValue:X.value.dataset.find((g,p)=>`donut_${p}`===a.id).VALUE})),I=y.value.width/2,W=y.value.height/2,O=y.value.height*t.value.donutRadiusRatio;return{dataset:q.filter(a=>!x.value.includes(a.id)),legend:q,drawingArea:_,displayArcPercentage:v,isArcBigEnough:l,useTooltip:i,killTooltip:m,getSpaces:r,total:N,cx:I,cy:W,radius:O,chart:u.makeDonut({series:n.filter(a=>!x.value.includes(a.id))},I,W,O,O,1.99999,2,1,360,105.25,y.value.height*be.value)}}),k=e.ref({start:0,end:f.value.maxSeriesLength});function Re(){k.value={start:0,end:f.value.maxSeriesLength},K.value+=1}const Ie=e.computed(()=>{if(!t.value.zoomMinimap.show||b.value===S.DONUT)return[];let n=[];P(f.value.dataset)&&(n=f.value.dataset),ie(f.value.dataset)&&(n=f.value.dataset.map((i,m)=>({values:i.VALUE||i.DATA||i.SERIE||i.SERIES||i.VALUES||i.NUM||0,id:b.value===S.LINE?`line_${m}`:`bar_${m}`})).filter(i=>!x.value.includes(i.id)));const v=P(n)?n.length:Math.max(...n.map(i=>i.values.length));let l=[];if(P(n))l=n;else for(let i=0;i<v;i+=1)l.push(n.map(m=>m.values[i]||0).reduce((m,_)=>(m||0)+(_||0),0));const r=Math.min(...l);return l.map(i=>i+(r<0?Math.abs(r):0))}),d=e.computed(()=>{if(b.value!==S.LINE)return null;const n={height:y.value.height,width:y.value.width},v={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:n.width-t.value.xyPaddingRight,bottom:n.height-t.value.xyPaddingBottom,width:n.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:n.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];P(f.value.dataset)&&(l=[{values:f.value.dataset.slice(k.value.start,k.value.end),absoluteIndices:f.value.dataset.map((a,o)=>o).slice(k.value.start,k.value.end),name:t.value.title,color:H.value[t.value.paletteStartIndex]||u.palette[t.value.paletteStartIndex],id:"line_0"}]),ie(f.value.dataset)&&(l=f.value.dataset.map((a,o)=>({...a,values:a.VALUE||a.DATA||a.SERIE||a.SERIES||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`line_${o}`})).map((a,o)=>({...a,color:a.COLOR?u.convertColorToHex(a.COLOR):H.value[o+t.value.paletteStartIndex]||u.palette[o+t.value.paletteStartIndex]||u.palette[(o+t.value.paletteStartIndex)%u.palette.length],values:a.values.slice(k.value.start,k.value.end),absoluteIndices:a.values.map((g,p)=>p).slice(k.value.start,k.value.end)})));const r={max:Math.max(...l.filter(a=>!x.value.includes(a.id)).flatMap(a=>a.values)),min:Math.min(...l.filter(a=>!x.value.includes(a.id)).flatMap(a=>a.values)),maxSeries:Math.max(...l.map(a=>a.values.length))},i=u.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?v.top:v.bottom-m/(i.max+m)*v.height,N=v.width/r.maxSeries,q=i.ticks.map(a=>({y:v.bottom-v.height*((a+m)/(i.max+m)),x:v.left-8,value:a})),I=l.map((a,o)=>({...a,coordinates:a.values.map((g,p)=>({x:v.left+N*(p+1)-N/2,y:v.bottom-(g+m)/(i.max+m)*v.height,value:g}))})).map(a=>{let o=[];return a.coordinates.forEach(g=>{o.push(`${g.x},${g.y} `)}),{...a,linePath:o.join(" ")}});function W(a){F.value=a,T.value=a;const o=l.map(p=>({...p,value:p.values[a],absoluteIndex:p.absoluteIndices[a]})).filter(p=>!x.value.includes(p.id));G.value={datapoint:o,seriesIndex:a,config:t.value,dataset:l};const g=t.value.tooltipCustomFormat;if(u.isFunction(g)&&u.functionReturnsString(()=>g({datapoint:o,seriesIndex:a,series:l,config:t.value})))R.value=g({datapoint:o,seriesIndex:a,series:l,config:t.value});else{let p="";t.value.xyPeriods[o[0].absoluteIndex]&&(p+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[o[0].absoluteIndex]}</div>`),o.forEach((A,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="${A.color}"/></svg>
4
4
  <span>${A.name}:</span>
@@ -1,17 +1,17 @@
1
1
  import { computed as v, ref as u, watch as Ge, onMounted as We, onBeforeUnmount as Xe, openBlock as r, createElementBlock as s, normalizeClass as z, normalizeStyle as Q, createBlock as w, createCommentVNode as p, unref as g, createSlots as Ye, withCtx as y, renderSlot as m, normalizeProps as R, guardReactiveProps as M, createVNode as Z, createElementVNode as $, Fragment as P, renderList as T, toDisplayString as V, createTextVNode as we, nextTick as je } from "vue";
2
- import { u as qe, c as He, t as Je, a as Ke, p as x, o as Qe, e as S, b as Ze, g as $e, d as Pe, O as Te, v as et, i as xe, f as U, X as tt, s as ee, w as at, P as Ae, x as ot, y as lt, q as rt, r as nt } from "./index-C2sScL5o.js";
2
+ import { u as qe, c as He, t as Je, a as Ke, p as x, o as Qe, e as S, b as Ze, g as $e, d as Pe, O as Te, v as et, i as xe, f as U, X as tt, s as ee, w as at, P as Ae, x as ot, y as lt, q as rt, r as nt } from "./index-hV0hU1iE.js";
3
3
  import { t as st, u as ut } from "./useResponsive-CoxXLe23.js";
4
- import { _ as it } from "./Title-Dl6c1jg0.js";
5
- import { u as ct, U as dt } from "./usePrinter-CddPH-Ds.js";
6
- import { _ as vt } from "./Tooltip-8UZ341MF.js";
7
- import pt from "./vue-ui-sparkbar-CpzctkDi.js";
8
- import { L as ht } from "./Legend-CJnJQbiR.js";
9
- import { D as gt } from "./DataTable-B-_LZJ5T.js";
10
- import ft from "./vue-ui-skeleton-BgKRd_jD.js";
11
- import yt from "./vue-ui-accordion-BH4FO7io.js";
12
- import { u as Oe } from "./useNestedProp-CuE-kmwp.js";
13
- import { _ as mt } from "./PackageVersion-DHeUFci0.js";
14
- import { P as bt } from "./PenAndPaper-BKIQk9Cq.js";
4
+ import { _ as it } from "./Title-DBozX6nP.js";
5
+ import { u as ct, U as dt } from "./usePrinter-y3d31M4g.js";
6
+ import { _ as vt } from "./Tooltip-Com_T8vc.js";
7
+ import pt from "./vue-ui-sparkbar-DxXt-GHr.js";
8
+ import { L as ht } from "./Legend-hnLfwhmm.js";
9
+ import { D as gt } from "./DataTable-BpVz3DBX.js";
10
+ import ft from "./vue-ui-skeleton-BY8Jg9a_.js";
11
+ import yt from "./vue-ui-accordion-m-s-7akB.js";
12
+ import { u as Oe } from "./useNestedProp-CRAUOmT5.js";
13
+ import { _ as mt } from "./PackageVersion-wqab02xF.js";
14
+ import { P as bt } from "./PenAndPaper-C_laA5mt.js";
15
15
  import { _ as kt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
16
16
  const Ct = ["id"], _t = ["xmlns", "viewBox"], wt = ["id"], $t = ["stop-color"], Pt = ["stop-color"], Tt = { key: 0 }, xt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], At = { key: 0 }, Ot = ["d", "stroke", "stroke-width"], Nt = ["d", "stroke", "stroke-width"], St = { key: 1 }, Ft = ["x", "y", "text-anchor", "font-size", "fill", "onMouseenter"], It = ["points", "stroke", "stroke-width"], Lt = ["points", "stroke", "stroke-width", "fill"], zt = { key: 2 }, Rt = ["cx", "cy", "fill", "r", "stroke"], Mt = {
17
17
  key: 5,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-DsF7Aej7.cjs"),ae=require("./useResponsive-BJ7DTGpm.cjs"),ke=require("./Title-Az2QIayC.cjs"),le=require("./usePrinter-CUDeluax.cjs"),be=require("./Tooltip-wdo3yY_W.cjs"),Ce=require("./vue-ui-sparkbar-CC644wqU.cjs"),we=require("./Legend-B3KPtqT8.cjs"),Be=require("./DataTable-T6NSDRqO.cjs"),_e=require("./vue-ui-skeleton-e8hBgzZq.cjs"),Pe=require("./vue-ui-accordion-Av34wbMx.cjs"),re=require("./useNestedProp-D0YHk8Cd.cjs"),$e=require("./PackageVersion-BjoP5ypd.cjs"),xe=require("./PenAndPaper-C0H3KJhQ.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Te=["id"],Se=["xmlns","viewBox"],Ee=["id"],Ve=["stop-color"],Ae=["stop-color"],Oe={key:0},Fe=["x1","y1","x2","y2","stroke","stroke-width"],Le={key:0},ze=["d","stroke","stroke-width"],Ie=["d","stroke","stroke-width"],Re={key:1},qe=["x","y","text-anchor","font-size","fill","onMouseenter"],De=["points","stroke","stroke-width"],Me=["points","stroke","stroke-width","fill"],Ue={key:2},Ge=["cx","cy","fill","r","stroke"],We={key:5,class:"vue-data-ui-watermark"},He=["onClick"],Xe={key:0,style:{"max-width":"200px",margin:"0 auto"}},je={__name:"vue-ui-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(ne,{expose:ue,emit:se}){const d=ne,{vue_ui_radar:ie}=n.useConfig(),b=e.computed(()=>!!d.dataset&&Object.keys(d.dataset).length),m=e.ref(n.createUid()),ce=e.ref(null),x=e.ref(!1),N=e.ref(""),F=e.ref(0),f=e.ref(null),L=e.ref(null),z=e.ref(null),I=e.ref(null),R=e.ref(null),q=e.ref(0),D=e.ref(0),M=e.ref(0),t=e.computed({get:()=>U(),set:o=>o});function U(){const o=re.useNestedProp({userConfig:d.config,defaultConfig:ie});return o.theme?{...re.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=U(),G(),q.value+=1,D.value+=1,M.value+=1},{deep:!0});const B=e.ref(null);function G(){if(n.objectIsEmpty(d.dataset)&&n.error({componentName:"VueUiRadar",type:"dataset"}),t.value.responsive){const o=ae.throttle(()=>{const{width:a,height:l}=ae.useResponsive({chart:f.value,title:t.value.style.chart.title.text?L.value:null,legend:t.value.style.chart.legend.show?z.value:null,source:I.value,noTitle:R.value});s.value.width=a,s.value.height=l});B.value=new ResizeObserver(o),B.value.observe(f.value.parentNode)}}e.onMounted(()=>{G()}),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:W,isImaging:H,generatePdf:X,generateImage:j}=le.usePrinter({elementId:`vue-ui-radar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-radar"}),de=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Y=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),g=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),ve=e.computed(()=>({style:{backgroundColor:t.value.style.chart.tooltip.backgroundColor,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}}})),s=e.ref({height:312,width:512}),i=e.ref([]),C=e.ref(null),y=e.ref(!1);function J(o){y.value=!0,i.value.includes(o)?(C.value=o,i.value=i.value.filter(a=>a!==o),setTimeout(()=>{y.value=!1,C.value=null},500)):(i.value.push(o),setTimeout(()=>{y.value=!1},500)),se("selectLegend",k.value.filter((a,l)=>!i.value.includes(l)).map(a=>({name:a.name,color:a.color,proportion:a.totalProportion})))}function pe(){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_${m.value}_${a}`,color:n.convertColorToHex(o.color)||Y.value[a]||n.palette[a]||n.palette[a%n.palette.length],prefix:o.prefix??"",suffix:o.suffix??""})))),p=e.computed(()=>b.value?d.dataset.series.map((o,a)=>({...o,color:n.convertColorToHex(o.color)||Y.value[a]||n.palette[a]||n.palette[a%n.palette.length],serieId:`radar_serie_${m.value}_${a}`,formatter:o.formatter||null})):[]),K=e.computed(()=>Math.max(...p.value.flatMap(o=>o.values))),Q=e.computed(()=>p.value.length),T=e.computed(()=>Math.min(s.value.width,s.value.height)/3),Z=e.computed(()=>n.createPolygonPath({plot:{x:s.value.width/2,y:s.value.height/2},radius:T.value,sides:Q.value,rotation:0})),ge=e.computed(()=>{const o=[];for(let a=0;a<T.value;a+=T.value/t.value.style.chart.layout.grid.graduations)o.push(a);return o}),h=e.computed(()=>Z.value.coordinates.map((o,a)=>{const l=p.value[a].values.map(r=>he({centerX:s.value.width/2,centerY:s.value.height/2,apexX:o.x,apexY:o.y,proportion:r/(p.value[a].target||K.value)}));return{...o,...p.value[a],plots:l}}));function S({x:o,y:a}){let l="middle";return o=Math.round(o),a=Math.round(a),o>s.value.width/2&&(o+=12,l="start"),o<s.value.width/2&&(o-=12,l="end"),a>s.value.height/2&&(a+=20),a<s.value.height/2&&(a-=12),a===s.value.height/2&&(a+=4),{x:o,y:a,anchor:l}}function he({centerX:o,centerY:a,apexX:l,apexY:r,proportion:u}){return{x:o+(l-o)*u,y:a+(r-a)*u}}const k=e.computed(()=>{const o=p.value.map((a,l)=>a.values.map(r=>r/(a.target||K.value)));return v.value.map((a,l)=>({...a,totalProportion:n.checkNaN(o.map(r=>r[l]).reduce((r,u)=>r+u,0)/p.value.length),shape:"circle",opacity:i.value.includes(l)?.5:1,segregate:()=>J(l),isSegregated:i.value.includes(l)}))}),me=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":""})),_=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((u,c)=>`${n.applyDataLabel(r.formatter,u,n.dataLabel({p:v.value[c].prefix,v:u,s:v.value[c].suffix,r:t.value.table.td.roundingValue}))} (${isNaN(u/r.target)?"":n.dataLabel({v:u/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}}),P=e.ref(null),E=e.ref([]),V=e.ref(null);function fe(o,a){E.value=[],P.value=a,x.value=!0;let l="";V.value={datapoint:o,seriesIndex:a,series:{categories:v.value,datapoints:p.value,radar:h.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:h.value},config:t.value})))N.value=r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:h.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 u=0;u<o.values.length;u+=1)i.value.includes(u)||E.value.push({name:v.value[u].name,value:o.values[u]/o.target*100,color:v.value[u].color,suffix:"%)",prefix:`${n.dataLabel({p:v.value[u].prefix??"",v:o.values[u],s:v.value[u].suffix??"",r:t.value.style.chart.tooltip.roundingValue})} (`,rounding:t.value.style.chart.tooltip.roundingPercentage,formatter:o.formatter});N.value=l}}function ee(){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,Je)=>[c.name,c.target,...c.values.flatMap(O=>[O,isNaN(O/c.target)?"":O/c.target*100])]),r=o.concat([a]).concat(l),u=n.createCsvContent(r);n.downloadCsv({csvContent:u,title:t.value.style.chart.title.text||"vue-ui-radar"})})}const w=e.ref(!1);function ye(o){w.value=o,F.value+=1}function te(){g.value.showTable=!g.value.showTable}function oe(){g.value.showTooltip=!g.value.showTooltip}const $=e.ref(!1);function A(){$.value=!$.value}return ue({getData:pe,generatePdf:X,generateCsv:ee,generateImage:j,toggleTable:te,toggleTooltip:oe,toggleAnnotator:A}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-radar ${w.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"radarChart",ref:f,id:`vue-ui-radar_${m.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}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(xe.PenAndPaper,{key:0,parent:f.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:$.value,onClose:A},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),de.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:R,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:L,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(ke._sfc_main,{key:`title_${q.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&&b.value?(e.openBlock(),e.createBlock(le.UserOptions,{ref_key:"details",ref:ce,key:`user_options_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(H),isPrinting:e.unref(W),uid:m.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:w.value,isTooltip:g.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:f.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:$.value,onToggleFullscreen:ye,onGeneratePdf:e.unref(X),onGenerateCsv:ee,onGenerateImage:e.unref(j),onToggleTable:te,onToggleTooltip:oe,onToggleAnnotator:A},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"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":w.value,"vue-data-ui-fulscreen--off":!w.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($e._sfc_main),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_${m.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,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity)},null,8,Ae)],8,Ee))),256))]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,l=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.width/2,y1:s.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,Fe))),256)),t.value.style.chart.layout.grid.graduations>0?(e.openBlock(),e.createElementBlock("g",Le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,l=>(e.openBlock(),e.createElementBlock("path",{d:e.unref(n.createPolygonPath)({plot:{x:s.value.width/2,y:s.value.height/2},radius:l,sides:Q.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,ze))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:Z.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,Ie),t.value.style.chart.layout.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:S(l).x,y:S(l).y,"text-anchor":S(l).anchor,"font-size":t.value.style.chart.layout.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.labels.dataLabels.color,onMouseenter:u=>fe(l,r),onMouseleave:a[0]||(a[0]=u=>{x.value=!1,P.value=null})},e.toDisplayString(l.name),41,qe))),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)(h.value.map(u=>u.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&&C.value===r&&t.value.useCssAnimation})},null,10,De)):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)(h.value.map(u=>u.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_${m.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&&C.value===r&&t.value.useCssAnimation})},null,10,Me)):e.createCommentVNode("",!0)])]))),256)),t.value.style.chart.layout.plots.show?(e.openBlock(),e.createElementBlock("g",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(u,c)=>(e.openBlock(),e.createElementBlock("circle",{cx:u.x,cy:u.y,fill:i.value.includes(c)?"transparent":v.value[c].color,r:P.value!==null&&P.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&&C.value===c&&t.value.useCssAnimation})},null,10,Ge))),256))]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:s.value},void 0,!0)],14,Se)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",We,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(W)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_e.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:z},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(we.Legend,{key:`legend_${M.value}`,legendSet:k.value,config:me.value,onClickMarker:a[1]||(a[1]=({i:l})=>J(l))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:u=>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,He)]),_: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:I,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(be._sfc_main,{show:g.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:f.value,content:N.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({...V.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",Xe,[e.createVNode(Ce.default,{dataset:E.value,config:ve.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity},null,8,["dataset","config","backgroundOpacity"])])),e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","fontSize","position","offsetY","parent","content","isCustom"]),b.value?(e.openBlock(),e.createBlock(Pe.default,{key:8,hideDetails:"",config:{open:g.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(Be.DataTable,{key:`table_${D.value}`,colNames:_.value.colNames,head:_.value.head,body:_.value.body,config:_.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=>g.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)],14,Te))}},Ye=Ne._export_sfc(je,[["__scopeId","data-v-e797ea4b"]]);exports.default=Ye;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CsQwCVqU.cjs"),ae=require("./useResponsive-BJ7DTGpm.cjs"),ke=require("./Title-BRqTk-nT.cjs"),le=require("./usePrinter-O2fMMTMe.cjs"),be=require("./Tooltip-DvGSIp31.cjs"),Ce=require("./vue-ui-sparkbar-D4GIhUXT.cjs"),we=require("./Legend-G5Zc4QaZ.cjs"),Be=require("./DataTable-H-KTkjfv.cjs"),_e=require("./vue-ui-skeleton-DsRTbz6d.cjs"),Pe=require("./vue-ui-accordion-CaktYQoo.cjs"),re=require("./useNestedProp-DSYpaLxP.cjs"),$e=require("./PackageVersion-BbQFSVXm.cjs"),xe=require("./PenAndPaper-BX8pR5oV.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Te=["id"],Se=["xmlns","viewBox"],Ee=["id"],Ve=["stop-color"],Ae=["stop-color"],Oe={key:0},Fe=["x1","y1","x2","y2","stroke","stroke-width"],Le={key:0},ze=["d","stroke","stroke-width"],Ie=["d","stroke","stroke-width"],Re={key:1},qe=["x","y","text-anchor","font-size","fill","onMouseenter"],De=["points","stroke","stroke-width"],Me=["points","stroke","stroke-width","fill"],Ue={key:2},Ge=["cx","cy","fill","r","stroke"],We={key:5,class:"vue-data-ui-watermark"},He=["onClick"],Xe={key:0,style:{"max-width":"200px",margin:"0 auto"}},je={__name:"vue-ui-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(ne,{expose:ue,emit:se}){const d=ne,{vue_ui_radar:ie}=n.useConfig(),b=e.computed(()=>!!d.dataset&&Object.keys(d.dataset).length),m=e.ref(n.createUid()),ce=e.ref(null),x=e.ref(!1),N=e.ref(""),F=e.ref(0),f=e.ref(null),L=e.ref(null),z=e.ref(null),I=e.ref(null),R=e.ref(null),q=e.ref(0),D=e.ref(0),M=e.ref(0),t=e.computed({get:()=>U(),set:o=>o});function U(){const o=re.useNestedProp({userConfig:d.config,defaultConfig:ie});return o.theme?{...re.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=U(),G(),q.value+=1,D.value+=1,M.value+=1},{deep:!0});const B=e.ref(null);function G(){if(n.objectIsEmpty(d.dataset)&&n.error({componentName:"VueUiRadar",type:"dataset"}),t.value.responsive){const o=ae.throttle(()=>{const{width:a,height:l}=ae.useResponsive({chart:f.value,title:t.value.style.chart.title.text?L.value:null,legend:t.value.style.chart.legend.show?z.value:null,source:I.value,noTitle:R.value});s.value.width=a,s.value.height=l});B.value=new ResizeObserver(o),B.value.observe(f.value.parentNode)}}e.onMounted(()=>{G()}),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:W,isImaging:H,generatePdf:X,generateImage:j}=le.usePrinter({elementId:`vue-ui-radar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-radar"}),de=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Y=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),g=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),ve=e.computed(()=>({style:{backgroundColor:t.value.style.chart.tooltip.backgroundColor,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}}})),s=e.ref({height:312,width:512}),i=e.ref([]),C=e.ref(null),y=e.ref(!1);function J(o){y.value=!0,i.value.includes(o)?(C.value=o,i.value=i.value.filter(a=>a!==o),setTimeout(()=>{y.value=!1,C.value=null},500)):(i.value.push(o),setTimeout(()=>{y.value=!1},500)),se("selectLegend",k.value.filter((a,l)=>!i.value.includes(l)).map(a=>({name:a.name,color:a.color,proportion:a.totalProportion})))}function pe(){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_${m.value}_${a}`,color:n.convertColorToHex(o.color)||Y.value[a]||n.palette[a]||n.palette[a%n.palette.length],prefix:o.prefix??"",suffix:o.suffix??""})))),p=e.computed(()=>b.value?d.dataset.series.map((o,a)=>({...o,color:n.convertColorToHex(o.color)||Y.value[a]||n.palette[a]||n.palette[a%n.palette.length],serieId:`radar_serie_${m.value}_${a}`,formatter:o.formatter||null})):[]),K=e.computed(()=>Math.max(...p.value.flatMap(o=>o.values))),Q=e.computed(()=>p.value.length),T=e.computed(()=>Math.min(s.value.width,s.value.height)/3),Z=e.computed(()=>n.createPolygonPath({plot:{x:s.value.width/2,y:s.value.height/2},radius:T.value,sides:Q.value,rotation:0})),ge=e.computed(()=>{const o=[];for(let a=0;a<T.value;a+=T.value/t.value.style.chart.layout.grid.graduations)o.push(a);return o}),h=e.computed(()=>Z.value.coordinates.map((o,a)=>{const l=p.value[a].values.map(r=>he({centerX:s.value.width/2,centerY:s.value.height/2,apexX:o.x,apexY:o.y,proportion:r/(p.value[a].target||K.value)}));return{...o,...p.value[a],plots:l}}));function S({x:o,y:a}){let l="middle";return o=Math.round(o),a=Math.round(a),o>s.value.width/2&&(o+=12,l="start"),o<s.value.width/2&&(o-=12,l="end"),a>s.value.height/2&&(a+=20),a<s.value.height/2&&(a-=12),a===s.value.height/2&&(a+=4),{x:o,y:a,anchor:l}}function he({centerX:o,centerY:a,apexX:l,apexY:r,proportion:u}){return{x:o+(l-o)*u,y:a+(r-a)*u}}const k=e.computed(()=>{const o=p.value.map((a,l)=>a.values.map(r=>r/(a.target||K.value)));return v.value.map((a,l)=>({...a,totalProportion:n.checkNaN(o.map(r=>r[l]).reduce((r,u)=>r+u,0)/p.value.length),shape:"circle",opacity:i.value.includes(l)?.5:1,segregate:()=>J(l),isSegregated:i.value.includes(l)}))}),me=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":""})),_=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((u,c)=>`${n.applyDataLabel(r.formatter,u,n.dataLabel({p:v.value[c].prefix,v:u,s:v.value[c].suffix,r:t.value.table.td.roundingValue}))} (${isNaN(u/r.target)?"":n.dataLabel({v:u/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}}),P=e.ref(null),E=e.ref([]),V=e.ref(null);function fe(o,a){E.value=[],P.value=a,x.value=!0;let l="";V.value={datapoint:o,seriesIndex:a,series:{categories:v.value,datapoints:p.value,radar:h.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:h.value},config:t.value})))N.value=r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:h.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 u=0;u<o.values.length;u+=1)i.value.includes(u)||E.value.push({name:v.value[u].name,value:o.values[u]/o.target*100,color:v.value[u].color,suffix:"%)",prefix:`${n.dataLabel({p:v.value[u].prefix??"",v:o.values[u],s:v.value[u].suffix??"",r:t.value.style.chart.tooltip.roundingValue})} (`,rounding:t.value.style.chart.tooltip.roundingPercentage,formatter:o.formatter});N.value=l}}function ee(){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,Je)=>[c.name,c.target,...c.values.flatMap(O=>[O,isNaN(O/c.target)?"":O/c.target*100])]),r=o.concat([a]).concat(l),u=n.createCsvContent(r);n.downloadCsv({csvContent:u,title:t.value.style.chart.title.text||"vue-ui-radar"})})}const w=e.ref(!1);function ye(o){w.value=o,F.value+=1}function te(){g.value.showTable=!g.value.showTable}function oe(){g.value.showTooltip=!g.value.showTooltip}const $=e.ref(!1);function A(){$.value=!$.value}return ue({getData:pe,generatePdf:X,generateCsv:ee,generateImage:j,toggleTable:te,toggleTooltip:oe,toggleAnnotator:A}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-radar ${w.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"radarChart",ref:f,id:`vue-ui-radar_${m.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}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(xe.PenAndPaper,{key:0,parent:f.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:$.value,onClose:A},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),de.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:R,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:L,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(ke._sfc_main,{key:`title_${q.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&&b.value?(e.openBlock(),e.createBlock(le.UserOptions,{ref_key:"details",ref:ce,key:`user_options_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(H),isPrinting:e.unref(W),uid:m.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:w.value,isTooltip:g.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:f.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:$.value,onToggleFullscreen:ye,onGeneratePdf:e.unref(X),onGenerateCsv:ee,onGenerateImage:e.unref(j),onToggleTable:te,onToggleTooltip:oe,onToggleAnnotator:A},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"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":w.value,"vue-data-ui-fulscreen--off":!w.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($e._sfc_main),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_${m.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,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity)},null,8,Ae)],8,Ee))),256))]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,l=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.width/2,y1:s.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,Fe))),256)),t.value.style.chart.layout.grid.graduations>0?(e.openBlock(),e.createElementBlock("g",Le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,l=>(e.openBlock(),e.createElementBlock("path",{d:e.unref(n.createPolygonPath)({plot:{x:s.value.width/2,y:s.value.height/2},radius:l,sides:Q.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,ze))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:Z.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,Ie),t.value.style.chart.layout.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:S(l).x,y:S(l).y,"text-anchor":S(l).anchor,"font-size":t.value.style.chart.layout.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.labels.dataLabels.color,onMouseenter:u=>fe(l,r),onMouseleave:a[0]||(a[0]=u=>{x.value=!1,P.value=null})},e.toDisplayString(l.name),41,qe))),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)(h.value.map(u=>u.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&&C.value===r&&t.value.useCssAnimation})},null,10,De)):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)(h.value.map(u=>u.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_${m.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&&C.value===r&&t.value.useCssAnimation})},null,10,Me)):e.createCommentVNode("",!0)])]))),256)),t.value.style.chart.layout.plots.show?(e.openBlock(),e.createElementBlock("g",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(u,c)=>(e.openBlock(),e.createElementBlock("circle",{cx:u.x,cy:u.y,fill:i.value.includes(c)?"transparent":v.value[c].color,r:P.value!==null&&P.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&&C.value===c&&t.value.useCssAnimation})},null,10,Ge))),256))]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:s.value},void 0,!0)],14,Se)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",We,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(W)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_e.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:z},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(we.Legend,{key:`legend_${M.value}`,legendSet:k.value,config:me.value,onClickMarker:a[1]||(a[1]=({i:l})=>J(l))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:u=>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,He)]),_: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:I,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(be._sfc_main,{show:g.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:f.value,content:N.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({...V.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",Xe,[e.createVNode(Ce.default,{dataset:E.value,config:ve.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity},null,8,["dataset","config","backgroundOpacity"])])),e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","fontSize","position","offsetY","parent","content","isCustom"]),b.value?(e.openBlock(),e.createBlock(Pe.default,{key:8,hideDetails:"",config:{open:g.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(Be.DataTable,{key:`table_${D.value}`,colNames:_.value.colNames,head:_.value.head,body:_.value.body,config:_.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=>g.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)],14,Te))}},Ye=Ne._export_sfc(je,[["__scopeId","data-v-e797ea4b"]]);exports.default=Ye;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-DsF7Aej7.cjs"),L=require("./useNestedProp-D0YHk8Cd.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},A=["src","height","width"],R=["xmlns","height","width"],X=["id"],j=["stop-color"],F=["stop-color"],I=["points","fill","stroke","stroke-width"],O=["src","alt","height","width","id"],Y=["xmlns","viewBox","height","id"],G=["id"],q=["stop-color"],U=["stop-color"],H=["points","fill","stroke"],K=["xmlns","height"],P=["onClick","onMouseenter","onKeyup"],T=["onMouseenter"],W={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup(k,{expose:_,emit:S}){const i=k,{vue_ui_rating:z}=a.useConfig(),d=e.ref(a.createUid()),f=e.ref(!1),s=e.ref(void 0),y=e.ref([]),t=e.computed({get:()=>g(),set:o=>o});function g(){return L.useNestedProp({userConfig:i.config,defaultConfig:z})}e.watch(()=>i.config,o=>{t.value=g(),h()},{deep:!0});const w=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)?N(i.dataset.rating):i.dataset.rating),B=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)),r=e.ref(w.value),m=e.computed(()=>t.value.type==="image"),c=e.computed(()=>t.value.readonly);function N(o){let n=0,l=0;for(const u in o){const V=parseInt(u),b=o[u];n+=V*b,l+=b}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(){a.objectIsEmpty(i.dataset)&&a.error({componentName:"VueUiRating",type:"dataset"}),y.value=[];for(let o=t.value.from;o<=t.value.to;o+=1)y.value.push(o)}function p(o,n=!1){return o>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(o,n=!1){const l=r.value-o,v=n?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function $(o){c.value||(r.value=o,S("rate",o))}function C(){return r.value}function E(o=!0){c.value=o}return _({getData:C,toggleReadonly:E}),(o,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=>f.value=!0),onMouseleave:n[3]||(n[3]=l=>{f.value=!1,s.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",M,[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(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.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(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.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,A)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.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(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,j),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,F)],8,X)]),e.createElementVNode("polygon",{points:e.unref(a.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,I)],8,R)),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,O)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(a.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(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,q),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,U)],8,G)]),e.createElementVNode("polygon",{points:e.unref(a.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,H)],8,Y)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(a.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=>$(l),onMouseenter:u=>s.value=l,onMouseleave:n[0]||(n[0]=u=>s.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>$(l),["enter"])},null,40,P)),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,T)):e.createCommentVNode("",!0)],12,K)),t.value.style.tooltip.show&&B.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(a.applyDataLabel)(t.value.style.tooltip.formatter,i.dataset.rating[l],e.unref(a.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(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.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(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],36))}},J=D._export_sfc(W,[["__scopeId","data-v-d90e158f"]]);exports.default=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-CsQwCVqU.cjs"),L=require("./useNestedProp-DSYpaLxP.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},A=["src","height","width"],R=["xmlns","height","width"],X=["id"],j=["stop-color"],F=["stop-color"],I=["points","fill","stroke","stroke-width"],O=["src","alt","height","width","id"],Y=["xmlns","viewBox","height","id"],G=["id"],q=["stop-color"],U=["stop-color"],H=["points","fill","stroke"],K=["xmlns","height"],P=["onClick","onMouseenter","onKeyup"],T=["onMouseenter"],W={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup(k,{expose:_,emit:S}){const i=k,{vue_ui_rating:z}=a.useConfig(),d=e.ref(a.createUid()),f=e.ref(!1),s=e.ref(void 0),y=e.ref([]),t=e.computed({get:()=>g(),set:o=>o});function g(){return L.useNestedProp({userConfig:i.config,defaultConfig:z})}e.watch(()=>i.config,o=>{t.value=g(),h()},{deep:!0});const w=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)?N(i.dataset.rating):i.dataset.rating),B=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)),r=e.ref(w.value),m=e.computed(()=>t.value.type==="image"),c=e.computed(()=>t.value.readonly);function N(o){let n=0,l=0;for(const u in o){const V=parseInt(u),b=o[u];n+=V*b,l+=b}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(){a.objectIsEmpty(i.dataset)&&a.error({componentName:"VueUiRating",type:"dataset"}),y.value=[];for(let o=t.value.from;o<=t.value.to;o+=1)y.value.push(o)}function p(o,n=!1){return o>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(o,n=!1){const l=r.value-o,v=n?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function $(o){c.value||(r.value=o,S("rate",o))}function C(){return r.value}function E(o=!0){c.value=o}return _({getData:C,toggleReadonly:E}),(o,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=>f.value=!0),onMouseleave:n[3]||(n[3]=l=>{f.value=!1,s.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",M,[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(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.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(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.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,A)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.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(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,j),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,F)],8,X)]),e.createElementVNode("polygon",{points:e.unref(a.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,I)],8,R)),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,O)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(a.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(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,q),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,U)],8,G)]),e.createElementVNode("polygon",{points:e.unref(a.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,H)],8,Y)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(a.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=>$(l),onMouseenter:u=>s.value=l,onMouseleave:n[0]||(n[0]=u=>s.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>$(l),["enter"])},null,40,P)),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,T)):e.createCommentVNode("",!0)],12,K)),t.value.style.tooltip.show&&B.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(a.applyDataLabel)(t.value.style.tooltip.formatter,i.dataset.rating[l],e.unref(a.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(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.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(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],36))}},J=D._export_sfc(W,[["__scopeId","data-v-d90e158f"]]);exports.default=J;
@@ -1,6 +1,6 @@
1
1
  import { ref as h, computed as x, watch as U, onMounted as K, openBlock as a, createElementBlock as i, normalizeStyle as o, createElementVNode as r, toDisplayString as g, createCommentVNode as d, unref as s, Fragment as T, renderList as H, withKeys as P } from "vue";
2
- import { u as W, c as q, o as J, e as Q, i as $, f as _, X as k, w as R, V as F } from "./index-C2sScL5o.js";
3
- import { u as Z } from "./useNestedProp-CuE-kmwp.js";
2
+ import { u as W, c as q, o as J, e as Q, i as $, f as _, X as k, w as R, V as F } from "./index-hV0hU1iE.js";
3
+ import { u as Z } from "./useNestedProp-CRAUOmT5.js";
4
4
  import { _ as tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
5
  const et = {
6
6
  key: 0,
@@ -1,12 +1,12 @@
1
1
  import { useCssVars as xe, computed as c, ref as a, watch as be, onMounted as Ae, onBeforeUnmount as Oe, openBlock as n, createElementBlock as i, normalizeStyle as C, createBlock as A, createCommentVNode as f, unref as y, createSlots as Pe, withCtx as O, renderSlot as m, normalizeProps as N, guardReactiveProps as S, normalizeClass as R, createVNode as Ie, createElementVNode as Fe, Fragment as P, renderList as I, toDisplayString as Te } from "vue";
2
- import { u as Ee, c as ze, t as Le, a as Ne, p as ne, b as Se, o as Re, e as re, g as Me, X as je } from "./index-C2sScL5o.js";
2
+ import { u as Ee, c as ze, t as Le, a as Ne, p as ne, b as Se, o as Re, e as re, g as Me, X as je } from "./index-hV0hU1iE.js";
3
3
  import { t as Be, u as Ge } from "./useResponsive-CoxXLe23.js";
4
- import { _ as Ue } from "./Title-Dl6c1jg0.js";
5
- import { u as De, U as Ve } from "./usePrinter-CddPH-Ds.js";
6
- import We from "./vue-ui-skeleton-BgKRd_jD.js";
7
- import { u as se } from "./useNestedProp-CuE-kmwp.js";
8
- import { _ as Xe } from "./PackageVersion-DHeUFci0.js";
9
- import { P as Ye } from "./PenAndPaper-BKIQk9Cq.js";
4
+ import { _ as Ue } from "./Title-DBozX6nP.js";
5
+ import { u as De, U as Ve } from "./usePrinter-y3d31M4g.js";
6
+ import We from "./vue-ui-skeleton-BY8Jg9a_.js";
7
+ import { u as se } from "./useNestedProp-CRAUOmT5.js";
8
+ import { _ as Xe } from "./PackageVersion-wqab02xF.js";
9
+ import { P as Ye } from "./PenAndPaper-C_laA5mt.js";
10
10
  import { _ as qe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
11
  const He = ["id"], Je = ["xmlns", "viewBox"], Ke = ["cx", "cy", "r", "stroke", "stroke-width"], Qe = { key: 0 }, Ze = ["stroke", "d", "stroke-width"], et = { key: 1 }, tt = ["stroke", "x1", "x2", "y1", "y2"], lt = ["text-anchor", "transform", "x", "y", "onClick", "font-weight", "font-size", "fill"], nt = ["cx", "cy", "fill", "onClick", "r"], rt = {
12
12
  key: 5,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-DsF7Aej7.cjs"),U=require("./useResponsive-BJ7DTGpm.cjs"),de=require("./Title-Az2QIayC.cjs"),D=require("./usePrinter-CUDeluax.cjs"),ve=require("./vue-ui-skeleton-e8hBgzZq.cjs"),W=require("./useNestedProp-D0YHk8Cd.cjs"),fe=require("./PackageVersion-BjoP5ypd.cjs"),ge=require("./PenAndPaper-C0H3KJhQ.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=["id"],he=["xmlns","viewBox"],ke=["cx","cy","r","stroke","stroke-width"],pe={key:0},Ce=["stroke","d","stroke-width"],_e={key:1},$e=["stroke","x1","x2","y1","y2"],xe=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],we=["cx","cy","fill","onClick","r"],Be={key:5,class:"vue-data-ui-watermark"},be={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(X,{expose:Y}){const u=X;e.useCssVars(t=>({"47419f48":ee.value,"77774d27":Z.value,df46026e:te.value}));const{vue_ui_relation_circle:H}=i.useConfig(),C=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length),g=e.ref(i.createUid()),B=e.ref(0),m=e.ref(null),b=e.ref(null),P=e.ref(null),A=e.ref(null),O=e.ref(0),n=e.computed({get:()=>E(),set:t=>t});function E(){const t=W.useNestedProp({userConfig:u.config,defaultConfig:H});return t.theme?{...W.useNestedProp({userConfig:i.themes.vue_ui_relation_circle[t.theme]||u.config,defaultConfig:t}),customPalette:i.themePalettes[t.theme]||i.palette}:t}e.watch(()=>u.config,t=>{n.value=E(),T(),O.value+=1},{deep:!0});const{isPrinting:S,isImaging:I,generatePdf:N,generateImage:z}=D.usePrinter({elementId:`relation_circle_${g.value}`,fileName:n.value.style.title.text||"vue-ui-relation-circle"}),J=e.computed(()=>n.value.userOptions.show&&!n.value.style.title.text),F=e.computed(()=>i.convertCustomPalette(n.value.customPalette)),d=e.ref([]),f=e.ref([]),a=e.ref({}),c=e.ref([]),K=e.ref(0),_=e.computed(()=>u.dataset.slice(0,n.value.style.limit)),$=e.ref(n.value.style.size),s=e.ref({height:n.value.style.size,width:n.value.style.size}),v=e.computed({get(){return $.value*n.value.style.circle.radiusProportion},set(t){return t}}),Q=e.computed(()=>n.value.style.links.curved),Z=e.computed(()=>`${n.value.style.animation.speedMs}ms`),ee=e.computed(()=>v.value*2),te=e.computed(()=>v.value*4),h=e.ref(null);e.onMounted(()=>{T(),document.getElementById(`relation_circle_${g.value}`).addEventListener("click",L)});function T(){if(i.objectIsEmpty(u.dataset)?i.error({componentName:"VueUiRelationCircle",type:"dataset"}):u.dataset.forEach((t,r)=>{i.getMissingDatasetAttributes({datasetObject:t,requiredAttributes:["id","label","relations","weights"]}).forEach(l=>{i.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:l,index:r})})}),n.value.responsive){const t=U.throttle(()=>{const{width:r,height:l}=U.useResponsive({chart:m.value,title:n.value.style.title.text?b.value:null,source:P.value,noTitle:A.value});$.value=Math.min(r,l),s.value.width=r,s.value.height=l,v.value=$.value*n.value.style.circle.radiusProportion,d.value=[],f.value=[],V(),R()});h.value=new ResizeObserver(t),h.value.observe(m.value.parentNode)}else d.value=[],f.value=[],V(),R()}e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${g.value}`).removeEventListener("click",L),h.value&&h.value.disconnect()});function L(t){const r=t.target;r&&Array.from(r.classList).includes("vue-ui-user-options")||r&&Array.from(r.classList).includes("vue-ui-user-options-summary")||r&&Array.from(r.classList).includes("vue-data-ui-button")||r&&Array.from(r.classList).includes("vue-ui-relation-circle-legend")||(a.value={},c.value=[])}function V(){const t=6.28319/_.value.length,r=360/_.value.length;let l=0,o=0;_.value.forEach((y,w)=>{const ue=v.value*Math.cos(l)+s.value.width/2,ce=v.value*Math.sin(l)+s.value.height/2+n.value.style.circle.offsetY;d.value.push({x:ue,y:ce,...y,color:y.color?y.color:F.value[w]?F.value[w]:i.palette[w],regAngle:o}),l+=t,o+=r})}function R(){d.value.forEach(t=>{d.value.filter(l=>l.relations.includes(t.id)).forEach((l,o)=>{f.value.push({weight:t.weights&&t.weights[o]?t.weights[o]:1,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,...t})})})}const le=e.computed(()=>Math.max(...f.value.map(t=>t.weight)));function ne(t){return Object.hasOwn(a.value,"x")?c.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function q(t){return Object.hasOwn(a.value,"x")?t.colorTarget:t.colorSource}function M(t){return Object.hasOwn(a.value,"x")?c.value.includes(t.id)&&t.relationId===`${t.id}_${a.value.id}`||t.relationId===`${a.value.id}_${t.id}`?`opacity:1;stroke-width:${G(t)}`:"opacity: 0":"opacity: 1"}function re(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function oe(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function ae(t){return Object.hasOwn(a.value,"x")?a.value.id===t.id||c.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function se(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function j(t){K.value=360-t.regAngle,a.value.id&&t.id===a.value.id?(a.value={},c.value=[]):(a.value=t,c.value=[...t.relations])}function G(t){return t.weight/le.value*n.value.style.links.maxWidth}const k=e.ref(!1);function ie(t){k.value=t,B.value+=1}const p=e.ref(!1);function x(){p.value=!p.value}return Y({generatePdf:N,generateImage:z,toggleAnnotator:x}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:m,class:"vue-ui-relation-circle",style:e.normalizeStyle(`width:100%;background:${n.value.style.backgroundColor};text-align:center;${n.value.responsive?"height: 100%":""}`),id:`relation_circle_${g.value}`},[n.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ge.PenAndPaper,{key:0,parent:m.value,backgroundColor:n.value.style.backgroundColor,color:n.value.style.color,active:p.value,onClose:x},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),J.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:A,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),n.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:b,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(de._sfc_main,{key:`title_${O.value}`,config:{title:{cy:"relation-div-title",...n.value.style.title},subtitle:{cy:"relation-div-subtitle",...n.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),n.value.userOptions.show&&C.value?(e.openBlock(),e.createBlock(D.UserOptions,{ref:"details",key:`user_options_${B.value}`,backgroundColor:n.value.style.backgroundColor,color:n.value.style.color,isPrinting:e.unref(S),isImaging:e.unref(I),uid:g.value,hasPdf:n.value.userOptions.buttons.pdf,hasImg:n.value.userOptions.buttons.img,hasFullscreen:n.value.userOptions.buttons.img,hasXls:!1,isFullscreen:k.value,titles:{...n.value.userOptions.buttonTitles},chartElement:m.value,position:n.value.userOptions.position,hasAnnotator:n.value.userOptions.buttons.annotator,isAnnotation:p.value,onToggleFullscreen:ie,onGeneratePdf:e.unref(N),onGenerateImage:e.unref(z),onToggleAnnotator:x},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:o})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"2"}:void 0,t.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:o})=>[e.renderSlot(t.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:o})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(i.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value},"relation-circle"]),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,width:"100%",style:"user-select:none; background:transparent"},[e.createVNode(fe._sfc_main),e.createElementVNode("circle",{cx:(s.value.width<=0?1e-4:s.value.width)/2,cy:(s.value.height<=0?1e-4:s.value.height)/2+n.value.style.circle.offsetY,r:v.value<=0?1e-4:v.value,stroke:n.value.style.circle.stroke,"stroke-width":n.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,ke),Q.value?(e.openBlock(),e.createElementBlock("g",pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${o}`,style:e.normalizeStyle(M(l)),stroke:q(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":a.value.hasOwnProperty("id")&&c.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${s.value.width/2},${s.value.height/2+n.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":G(l),"stroke-linecap":"round"},null,14,Ce))),128))])):(e.openBlock(),e.createElementBlock("g",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${o}`,stroke:q(l),style:e.normalizeStyle(M(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":a.value.hasOwnProperty("id")&&c.value.includes(l.id)}),"stroke-linecap":"round"},null,14,$e))),128))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${o}`,"text-anchor":re(l),transform:se(l),x:oe(l),y:l.y+5,onClick:y=>j(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":a.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${n.value.style.fontFamily};${ae(l)}`),"font-size":n.value.style.labels.fontSize,fill:n.value.style.labels.color},e.toDisplayString(l.label),13,xe))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${o}`,style:e.normalizeStyle(ne(l)),class:"vue-ui-relation-circle-plot",fill:n.value.style.plot.color,onClick:y=>j(l),r:n.value.style.plot.radius},null,12,we))),128)),e.renderSlot(t.$slots,"svg",{svg:s.value},void 0,!0)],10,he)):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(S)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),t.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:P,dir:"auto"},[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.default,{key:7,config:{type:"relationCircle",style:{backgroundColor:n.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],12,ye))}},Pe=me._export_sfc(be,[["__scopeId","data-v-a4837ff7"]]);exports.default=Pe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-CsQwCVqU.cjs"),U=require("./useResponsive-BJ7DTGpm.cjs"),de=require("./Title-BRqTk-nT.cjs"),D=require("./usePrinter-O2fMMTMe.cjs"),ve=require("./vue-ui-skeleton-DsRTbz6d.cjs"),W=require("./useNestedProp-DSYpaLxP.cjs"),fe=require("./PackageVersion-BbQFSVXm.cjs"),ge=require("./PenAndPaper-BX8pR5oV.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=["id"],he=["xmlns","viewBox"],ke=["cx","cy","r","stroke","stroke-width"],pe={key:0},Ce=["stroke","d","stroke-width"],_e={key:1},$e=["stroke","x1","x2","y1","y2"],xe=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],we=["cx","cy","fill","onClick","r"],Be={key:5,class:"vue-data-ui-watermark"},be={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(X,{expose:Y}){const u=X;e.useCssVars(t=>({"47419f48":ee.value,"77774d27":Z.value,df46026e:te.value}));const{vue_ui_relation_circle:H}=i.useConfig(),C=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length),g=e.ref(i.createUid()),B=e.ref(0),m=e.ref(null),b=e.ref(null),P=e.ref(null),A=e.ref(null),O=e.ref(0),n=e.computed({get:()=>E(),set:t=>t});function E(){const t=W.useNestedProp({userConfig:u.config,defaultConfig:H});return t.theme?{...W.useNestedProp({userConfig:i.themes.vue_ui_relation_circle[t.theme]||u.config,defaultConfig:t}),customPalette:i.themePalettes[t.theme]||i.palette}:t}e.watch(()=>u.config,t=>{n.value=E(),T(),O.value+=1},{deep:!0});const{isPrinting:S,isImaging:I,generatePdf:N,generateImage:z}=D.usePrinter({elementId:`relation_circle_${g.value}`,fileName:n.value.style.title.text||"vue-ui-relation-circle"}),J=e.computed(()=>n.value.userOptions.show&&!n.value.style.title.text),F=e.computed(()=>i.convertCustomPalette(n.value.customPalette)),d=e.ref([]),f=e.ref([]),a=e.ref({}),c=e.ref([]),K=e.ref(0),_=e.computed(()=>u.dataset.slice(0,n.value.style.limit)),$=e.ref(n.value.style.size),s=e.ref({height:n.value.style.size,width:n.value.style.size}),v=e.computed({get(){return $.value*n.value.style.circle.radiusProportion},set(t){return t}}),Q=e.computed(()=>n.value.style.links.curved),Z=e.computed(()=>`${n.value.style.animation.speedMs}ms`),ee=e.computed(()=>v.value*2),te=e.computed(()=>v.value*4),h=e.ref(null);e.onMounted(()=>{T(),document.getElementById(`relation_circle_${g.value}`).addEventListener("click",L)});function T(){if(i.objectIsEmpty(u.dataset)?i.error({componentName:"VueUiRelationCircle",type:"dataset"}):u.dataset.forEach((t,r)=>{i.getMissingDatasetAttributes({datasetObject:t,requiredAttributes:["id","label","relations","weights"]}).forEach(l=>{i.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:l,index:r})})}),n.value.responsive){const t=U.throttle(()=>{const{width:r,height:l}=U.useResponsive({chart:m.value,title:n.value.style.title.text?b.value:null,source:P.value,noTitle:A.value});$.value=Math.min(r,l),s.value.width=r,s.value.height=l,v.value=$.value*n.value.style.circle.radiusProportion,d.value=[],f.value=[],V(),R()});h.value=new ResizeObserver(t),h.value.observe(m.value.parentNode)}else d.value=[],f.value=[],V(),R()}e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${g.value}`).removeEventListener("click",L),h.value&&h.value.disconnect()});function L(t){const r=t.target;r&&Array.from(r.classList).includes("vue-ui-user-options")||r&&Array.from(r.classList).includes("vue-ui-user-options-summary")||r&&Array.from(r.classList).includes("vue-data-ui-button")||r&&Array.from(r.classList).includes("vue-ui-relation-circle-legend")||(a.value={},c.value=[])}function V(){const t=6.28319/_.value.length,r=360/_.value.length;let l=0,o=0;_.value.forEach((y,w)=>{const ue=v.value*Math.cos(l)+s.value.width/2,ce=v.value*Math.sin(l)+s.value.height/2+n.value.style.circle.offsetY;d.value.push({x:ue,y:ce,...y,color:y.color?y.color:F.value[w]?F.value[w]:i.palette[w],regAngle:o}),l+=t,o+=r})}function R(){d.value.forEach(t=>{d.value.filter(l=>l.relations.includes(t.id)).forEach((l,o)=>{f.value.push({weight:t.weights&&t.weights[o]?t.weights[o]:1,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,...t})})})}const le=e.computed(()=>Math.max(...f.value.map(t=>t.weight)));function ne(t){return Object.hasOwn(a.value,"x")?c.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function q(t){return Object.hasOwn(a.value,"x")?t.colorTarget:t.colorSource}function M(t){return Object.hasOwn(a.value,"x")?c.value.includes(t.id)&&t.relationId===`${t.id}_${a.value.id}`||t.relationId===`${a.value.id}_${t.id}`?`opacity:1;stroke-width:${G(t)}`:"opacity: 0":"opacity: 1"}function re(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function oe(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function ae(t){return Object.hasOwn(a.value,"x")?a.value.id===t.id||c.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function se(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function j(t){K.value=360-t.regAngle,a.value.id&&t.id===a.value.id?(a.value={},c.value=[]):(a.value=t,c.value=[...t.relations])}function G(t){return t.weight/le.value*n.value.style.links.maxWidth}const k=e.ref(!1);function ie(t){k.value=t,B.value+=1}const p=e.ref(!1);function x(){p.value=!p.value}return Y({generatePdf:N,generateImage:z,toggleAnnotator:x}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:m,class:"vue-ui-relation-circle",style:e.normalizeStyle(`width:100%;background:${n.value.style.backgroundColor};text-align:center;${n.value.responsive?"height: 100%":""}`),id:`relation_circle_${g.value}`},[n.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ge.PenAndPaper,{key:0,parent:m.value,backgroundColor:n.value.style.backgroundColor,color:n.value.style.color,active:p.value,onClose:x},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),J.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:A,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),n.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:b,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(de._sfc_main,{key:`title_${O.value}`,config:{title:{cy:"relation-div-title",...n.value.style.title},subtitle:{cy:"relation-div-subtitle",...n.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),n.value.userOptions.show&&C.value?(e.openBlock(),e.createBlock(D.UserOptions,{ref:"details",key:`user_options_${B.value}`,backgroundColor:n.value.style.backgroundColor,color:n.value.style.color,isPrinting:e.unref(S),isImaging:e.unref(I),uid:g.value,hasPdf:n.value.userOptions.buttons.pdf,hasImg:n.value.userOptions.buttons.img,hasFullscreen:n.value.userOptions.buttons.img,hasXls:!1,isFullscreen:k.value,titles:{...n.value.userOptions.buttonTitles},chartElement:m.value,position:n.value.userOptions.position,hasAnnotator:n.value.userOptions.buttons.annotator,isAnnotation:p.value,onToggleFullscreen:ie,onGeneratePdf:e.unref(N),onGenerateImage:e.unref(z),onToggleAnnotator:x},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:o})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"2"}:void 0,t.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:o})=>[e.renderSlot(t.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:o})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(i.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value},"relation-circle"]),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,width:"100%",style:"user-select:none; background:transparent"},[e.createVNode(fe._sfc_main),e.createElementVNode("circle",{cx:(s.value.width<=0?1e-4:s.value.width)/2,cy:(s.value.height<=0?1e-4:s.value.height)/2+n.value.style.circle.offsetY,r:v.value<=0?1e-4:v.value,stroke:n.value.style.circle.stroke,"stroke-width":n.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,ke),Q.value?(e.openBlock(),e.createElementBlock("g",pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${o}`,style:e.normalizeStyle(M(l)),stroke:q(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":a.value.hasOwnProperty("id")&&c.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${s.value.width/2},${s.value.height/2+n.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":G(l),"stroke-linecap":"round"},null,14,Ce))),128))])):(e.openBlock(),e.createElementBlock("g",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${o}`,stroke:q(l),style:e.normalizeStyle(M(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":a.value.hasOwnProperty("id")&&c.value.includes(l.id)}),"stroke-linecap":"round"},null,14,$e))),128))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${o}`,"text-anchor":re(l),transform:se(l),x:oe(l),y:l.y+5,onClick:y=>j(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":a.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${n.value.style.fontFamily};${ae(l)}`),"font-size":n.value.style.labels.fontSize,fill:n.value.style.labels.color},e.toDisplayString(l.label),13,xe))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${o}`,style:e.normalizeStyle(ne(l)),class:"vue-ui-relation-circle-plot",fill:n.value.style.plot.color,onClick:y=>j(l),r:n.value.style.plot.radius},null,12,we))),128)),e.renderSlot(t.$slots,"svg",{svg:s.value},void 0,!0)],10,he)):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(S)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),t.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:P,dir:"auto"},[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.default,{key:7,config:{type:"relationCircle",style:{backgroundColor:n.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],12,ye))}},Pe=me._export_sfc(be,[["__scopeId","data-v-a4837ff7"]]);exports.default=Pe;
@@ -1,16 +1,16 @@
1
1
  import { ref as n, computed as v, watch as Re, onMounted as Ve, onBeforeUnmount as Be, openBlock as r, createElementBlock as f, normalizeClass as W, normalizeStyle as I, createBlock as _, createCommentVNode as k, unref as i, createSlots as De, withCtx as p, renderSlot as h, normalizeProps as F, guardReactiveProps as M, createVNode as fe, createElementVNode as C, Fragment as ye, renderList as me, createTextVNode as be, toDisplayString as E, nextTick as Ue } from "vue";
2
- import { u as We, c as ke, t as Ee, a as Ge, p as x, o as He, e as Y, g as Xe, b as je, I as Ye, d as Ce, f as N, X as qe, s as Je, w as Ke, v as q, i as we, x as Qe, y as Ze, q as et, r as tt } from "./index-C2sScL5o.js";
2
+ import { u as We, c as ke, t as Ee, a as Ge, p as x, o as He, e as Y, g as Xe, b as je, I as Ye, d as Ce, f as N, X as qe, s as Je, w as Ke, v as q, i as we, x as Qe, y as Ze, q as et, r as tt } from "./index-hV0hU1iE.js";
3
3
  import { t as lt, u as ot } from "./useResponsive-CoxXLe23.js";
4
- import { _ as at } from "./Title-Dl6c1jg0.js";
5
- import { u as st, U as nt } from "./usePrinter-CddPH-Ds.js";
6
- import { _ as rt } from "./Tooltip-8UZ341MF.js";
7
- import { D as ut } from "./DataTable-B-_LZJ5T.js";
8
- import { L as it } from "./Legend-CJnJQbiR.js";
9
- import vt from "./vue-ui-skeleton-BgKRd_jD.js";
10
- import ct from "./vue-ui-accordion-BH4FO7io.js";
11
- import { u as $e } from "./useNestedProp-CuE-kmwp.js";
12
- import { _ as dt } from "./PackageVersion-DHeUFci0.js";
13
- import { P as pt } from "./PenAndPaper-BKIQk9Cq.js";
4
+ import { _ as at } from "./Title-DBozX6nP.js";
5
+ import { u as st, U as nt } from "./usePrinter-y3d31M4g.js";
6
+ import { _ as rt } from "./Tooltip-Com_T8vc.js";
7
+ import { D as ut } from "./DataTable-BpVz3DBX.js";
8
+ import { L as it } from "./Legend-hnLfwhmm.js";
9
+ import vt from "./vue-ui-skeleton-BY8Jg9a_.js";
10
+ import ct from "./vue-ui-accordion-m-s-7akB.js";
11
+ import { u as $e } from "./useNestedProp-CRAUOmT5.js";
12
+ import { _ as dt } from "./PackageVersion-wqab02xF.js";
13
+ import { P as pt } from "./PenAndPaper-C_laA5mt.js";
14
14
  import { _ as ht } from "./_plugin-vue_export-helper-CHgC5LLL.js";
15
15
  const gt = ["id"], ft = ["xmlns", "viewBox"], yt = ["id"], mt = ["stop-color"], bt = ["stop-color"], kt = ["stroke", "cx", "cy", "r", "fill"], Ct = ["stroke", "stroke-width", "cx", "cy", "r", "fill"], wt = ["cx", "cy", "r", "onMouseenter"], $t = {
16
16
  key: 5,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DsF7Aej7.cjs"),Z=require("./useResponsive-BJ7DTGpm.cjs"),ge=require("./Title-Az2QIayC.cjs"),ee=require("./usePrinter-CUDeluax.cjs"),fe=require("./Tooltip-wdo3yY_W.cjs"),me=require("./DataTable-T6NSDRqO.cjs"),ye=require("./Legend-B3KPtqT8.cjs"),be=require("./vue-ui-skeleton-e8hBgzZq.cjs"),ke=require("./vue-ui-accordion-Av34wbMx.cjs"),te=require("./useNestedProp-D0YHk8Cd.cjs"),Ce=require("./PackageVersion-BjoP5ypd.cjs"),we=require("./PenAndPaper-C0H3KJhQ.cjs"),Te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),xe=["id"],Ne=["xmlns","viewBox"],$e=["id"],Se=["stop-color"],Be=["stop-color"],Pe=["stroke","cx","cy","r","fill"],_e=["stroke","stroke-width","cx","cy","r","fill"],Le=["cx","cy","r","onMouseenter"],Ve={key:5,class:"vue-data-ui-watermark"},Ee=["onClick"],Ae={key:0},Oe={key:1},ze=["innerHTML"],Fe={__name:"vue-ui-rings",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(oe,{expose:le,emit:ae}){const v=oe,{vue_ui_rings:re}=r.useConfig(),b=e.ref(!1),T=e.computed(()=>!!v.dataset&&v.dataset.length),k=e.ref(r.createUid()),ne=e.ref(null),x=e.ref(!1),P=e.ref(""),m=e.ref(null),E=e.ref(0),y=e.ref(null),A=e.ref(null),O=e.ref(null),z=e.ref(null),F=e.ref(null),I=e.ref(0),R=e.ref(0),M=e.ref(0),t=e.computed({get:()=>q(),set:o=>o});function q(){const o=te.useNestedProp({userConfig:v.config,defaultConfig:re});return o.theme?{...te.useNestedProp({userConfig:r.themes.vue_ui_rings[o.theme]||v.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>v.config,o=>{t.value=q(),D(),I.value+=1,R.value+=1,M.value+=1},{deep:!0});const N=e.ref(null);e.onMounted(()=>{D()});function D(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiRings",type:"dataset"}):v.dataset.forEach((o,a)=>{o.values.length||r.error({componentName:"VueUiRings",type:"dataset"}),r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values"]}).forEach(l=>{r.error({componentName:"VueUiRings",type:"datasetSerieAttribute",property:l,index:a})})}),t.value.responsive){const o=Z.throttle(()=>{const{width:a,height:l}=Z.useResponsive({chart:y.value,title:t.value.style.chart.title.text?A.value:null,legend:t.value.style.chart.legend.show?O.value:null,source:z.value,noTitle:F.value});s.value.width=a,s.value.height=l});N.value=new ResizeObserver(o),N.value.observe(y.value.parentNode)}setTimeout(()=>{b.value=!0},600)}e.onBeforeUnmount(()=>{N.value&&N.value.disconnect()});const{isPrinting:U,isImaging:H,generatePdf:W,generateImage:G}=ee.usePrinter({elementId:`rings_${k.value}`,fileName:t.value.style.chart.title.text||"vue-ui-rings"}),ue=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),j=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),g=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:360}),se=e.computed(()=>Math.min(s.value.height,s.value.width)),i=e.ref([]);function _(o){i.value.includes(o)?i.value=i.value.filter(a=>a!==o):i.value.push(o),ae("selectLegend",c.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const ie=e.computed(()=>Math.max(...$.value.filter(o=>!i.value.includes(o.uid)).map(({value:o})=>o)));function X(o){return o/ie.value}const $=e.computed(()=>v.dataset.map(({values:o,name:a,color:l=null},n)=>{const u=r.sanitizeArray(o).reduce((h,w)=>h+w,0);return{name:a,color:l||r.convertColorToHex(l)||j.value[n]||r.palette[n]||r.palette[n%r.palette.length],value:u,proportion:u/v.dataset.map(h=>(h.values||[]).reduce((w,he)=>w+he,0)).reduce((h,w)=>h+w,0),uid:r.createUid()}})),Y=e.computed(()=>$.value.map(o=>({...o,shape:"circle",opacity:i.value.includes(o.uid)?.5:1,segregate:()=>_(o.uid),isSegregated:i.value.includes(o.uid)})).toSorted((o,a)=>a.value-o.value)),ce=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":""})),p=e.computed(()=>$.value.filter(o=>!i.value.includes(o.uid)).map(({value:o})=>o).reduce((o,a)=>o+a,0)),c=e.computed(()=>$.value.filter(o=>!i.value.includes(o.uid)).map(({name:o,value:a,color:l=null,uid:n},u)=>({uid:n,name:o,color:l||r.convertColorToHex(l)||j.value[u]||r.palette[u]||r.palette[u%r.palette.length],value:a,proportion:X(a),percentage:a/p.value*100,strokeWidth:t.value.style.chart.layout.rings.strokeWidth*X(a)})).toSorted((o,a)=>a.value-o.value));function de(){return c.value.map(({name:o,color:a,value:l,absoluteValues:n,percentage:u})=>({name:o,color:a,value:l,absoluteValues:n,percentage:u}))}const d=e.computed(()=>se.value-t.value.style.chart.layout.rings.strokeWidth*2),L=e.ref(null);function ve(o,a){if(i.value.length===v.dataset.length)return;L.value={datapoint:a,seriesIndex:o,series:c.value,config:t.value},m.value=o;const l=c.value[o],n=t.value.style.chart.tooltip.customFormat;if(r.isFunction(n)&&r.functionReturnsString(()=>n({seriesIndex:o,datapoint:a,series:c.value,config:t.value})))P.value=n({seriesIndex:o,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;">${l.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,seriesIndex:o})}
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CsQwCVqU.cjs"),Z=require("./useResponsive-BJ7DTGpm.cjs"),ge=require("./Title-BRqTk-nT.cjs"),ee=require("./usePrinter-O2fMMTMe.cjs"),fe=require("./Tooltip-DvGSIp31.cjs"),me=require("./DataTable-H-KTkjfv.cjs"),ye=require("./Legend-G5Zc4QaZ.cjs"),be=require("./vue-ui-skeleton-DsRTbz6d.cjs"),ke=require("./vue-ui-accordion-CaktYQoo.cjs"),te=require("./useNestedProp-DSYpaLxP.cjs"),Ce=require("./PackageVersion-BbQFSVXm.cjs"),we=require("./PenAndPaper-BX8pR5oV.cjs"),Te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),xe=["id"],Ne=["xmlns","viewBox"],$e=["id"],Se=["stop-color"],Be=["stop-color"],Pe=["stroke","cx","cy","r","fill"],_e=["stroke","stroke-width","cx","cy","r","fill"],Le=["cx","cy","r","onMouseenter"],Ve={key:5,class:"vue-data-ui-watermark"},Ee=["onClick"],Ae={key:0},Oe={key:1},ze=["innerHTML"],Fe={__name:"vue-ui-rings",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(oe,{expose:le,emit:ae}){const v=oe,{vue_ui_rings:re}=r.useConfig(),b=e.ref(!1),T=e.computed(()=>!!v.dataset&&v.dataset.length),k=e.ref(r.createUid()),ne=e.ref(null),x=e.ref(!1),P=e.ref(""),m=e.ref(null),E=e.ref(0),y=e.ref(null),A=e.ref(null),O=e.ref(null),z=e.ref(null),F=e.ref(null),I=e.ref(0),R=e.ref(0),M=e.ref(0),t=e.computed({get:()=>q(),set:o=>o});function q(){const o=te.useNestedProp({userConfig:v.config,defaultConfig:re});return o.theme?{...te.useNestedProp({userConfig:r.themes.vue_ui_rings[o.theme]||v.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>v.config,o=>{t.value=q(),D(),I.value+=1,R.value+=1,M.value+=1},{deep:!0});const N=e.ref(null);e.onMounted(()=>{D()});function D(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiRings",type:"dataset"}):v.dataset.forEach((o,a)=>{o.values.length||r.error({componentName:"VueUiRings",type:"dataset"}),r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values"]}).forEach(l=>{r.error({componentName:"VueUiRings",type:"datasetSerieAttribute",property:l,index:a})})}),t.value.responsive){const o=Z.throttle(()=>{const{width:a,height:l}=Z.useResponsive({chart:y.value,title:t.value.style.chart.title.text?A.value:null,legend:t.value.style.chart.legend.show?O.value:null,source:z.value,noTitle:F.value});s.value.width=a,s.value.height=l});N.value=new ResizeObserver(o),N.value.observe(y.value.parentNode)}setTimeout(()=>{b.value=!0},600)}e.onBeforeUnmount(()=>{N.value&&N.value.disconnect()});const{isPrinting:U,isImaging:H,generatePdf:W,generateImage:G}=ee.usePrinter({elementId:`rings_${k.value}`,fileName:t.value.style.chart.title.text||"vue-ui-rings"}),ue=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),j=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),g=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:360}),se=e.computed(()=>Math.min(s.value.height,s.value.width)),i=e.ref([]);function _(o){i.value.includes(o)?i.value=i.value.filter(a=>a!==o):i.value.push(o),ae("selectLegend",c.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const ie=e.computed(()=>Math.max(...$.value.filter(o=>!i.value.includes(o.uid)).map(({value:o})=>o)));function X(o){return o/ie.value}const $=e.computed(()=>v.dataset.map(({values:o,name:a,color:l=null},n)=>{const u=r.sanitizeArray(o).reduce((h,w)=>h+w,0);return{name:a,color:l||r.convertColorToHex(l)||j.value[n]||r.palette[n]||r.palette[n%r.palette.length],value:u,proportion:u/v.dataset.map(h=>(h.values||[]).reduce((w,he)=>w+he,0)).reduce((h,w)=>h+w,0),uid:r.createUid()}})),Y=e.computed(()=>$.value.map(o=>({...o,shape:"circle",opacity:i.value.includes(o.uid)?.5:1,segregate:()=>_(o.uid),isSegregated:i.value.includes(o.uid)})).toSorted((o,a)=>a.value-o.value)),ce=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":""})),p=e.computed(()=>$.value.filter(o=>!i.value.includes(o.uid)).map(({value:o})=>o).reduce((o,a)=>o+a,0)),c=e.computed(()=>$.value.filter(o=>!i.value.includes(o.uid)).map(({name:o,value:a,color:l=null,uid:n},u)=>({uid:n,name:o,color:l||r.convertColorToHex(l)||j.value[u]||r.palette[u]||r.palette[u%r.palette.length],value:a,proportion:X(a),percentage:a/p.value*100,strokeWidth:t.value.style.chart.layout.rings.strokeWidth*X(a)})).toSorted((o,a)=>a.value-o.value));function de(){return c.value.map(({name:o,color:a,value:l,absoluteValues:n,percentage:u})=>({name:o,color:a,value:l,absoluteValues:n,percentage:u}))}const d=e.computed(()=>se.value-t.value.style.chart.layout.rings.strokeWidth*2),L=e.ref(null);function ve(o,a){if(i.value.length===v.dataset.length)return;L.value={datapoint:a,seriesIndex:o,series:c.value,config:t.value},m.value=o;const l=c.value[o],n=t.value.style.chart.tooltip.customFormat;if(r.isFunction(n)&&r.functionReturnsString(()=>n({seriesIndex:o,datapoint:a,series:c.value,config:t.value})))P.value=n({seriesIndex:o,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;">${l.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,seriesIndex:o})}
2
2
  </b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?u+=`<span>(${r.dataLabel({v:l.value/p.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:u+=`<b>${r.dataLabel({v:l.value/p.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),P.value=u}x.value=!0}const f=e.computed(()=>{const o=c.value.map(l=>({name:l.name,color:l.color})),a=c.value.map(l=>l.value);return{head:o,body:a}}),S=e.computed(()=>{const o=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:p.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=f.value.head.map((u,h)=>[{color:u.color,name:u.name},r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:f.value.body[h],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),isNaN(f.value.body[h]/p.value)?"-":(f.value.body[h]/p.value*100).toFixed(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},n=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:o,body:a,config:l,colNames:n}});function J(){e.nextTick(()=>{const o=f.value.head.map((n,u)=>[[n.name],[f.value.body[u]],[isNaN(f.value.body[u]/p.value)?"-":f.value.body[u]/p.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-rings"})})}const C=e.ref(!1);function pe(o){C.value=o,E.value+=1}function K(){g.value.showTable=!g.value.showTable}function Q(){g.value.showTooltip=!g.value.showTooltip}const B=e.ref(!1);function V(){B.value=!B.value}return le({getData:de,generatePdf:W,generateCsv:J,generateImage:G,toggleTable:K,toggleTooltip:Q,toggleAnnotator:V}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"ringsChart",ref:y,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_${k.value}`,onMouseleave:a[3]||(a[3]=l=>{m.value=null,x.value=!1})},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(we.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:V},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ue.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:A,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(ge._sfc_main,{key:`title_${I.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&&T.value?(e.openBlock(),e.createBlock(ee.UserOptions,{ref_key:"details",ref:ne,key:`user_options_${E.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(U),isImaging:e.unref(H),uid:k.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:g.value.showTooltip,isFullscreen:C.value,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(W),onGenerateCsv:J,onGenerateImage:e.unref(G),onToggleTable:K,onToggleTooltip:Q,onToggleAnnotator:V},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:n})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:n})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:n})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:n})),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"])):e.createCommentVNode("",!0),T.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.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(Ce._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,n)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"30%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${k.value}_${n}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(e.unref(r.shiftHue)(l.color,.05),100-t.value.style.chart.layout.rings.gradient.intensity)},null,8,Se),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,Be)],8,$e))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,n)=>(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":m.value!==null&&m.value!==n}),style:e.normalizeStyle(`animation-delay:${n*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,cx:s.value.width/2,cy:n===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*l.proportion/2-2*(n+1),r:e.unref(r.checkNaN)(d.value*l.proportion/2*.9<=0?1e-4:d.value*l.proportion/2*.9),fill:t.value.style.chart.layout.rings.gradient.underlayerColor},null,14,Pe),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":m.value!==null&&m.value!==n}),style:e.normalizeStyle(`animation-delay:${n*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,"stroke-width":l.strokeWidth<.5?.5:l.strokeWidth,cx:s.value.width/2,cy:n===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*l.proportion/2-2*(n+1),r:e.unref(r.checkNaN)(d.value*l.proportion/2*.9<=0?1e-4:d.value*l.proportion/2*.9),fill:t.value.style.chart.layout.rings.gradient.show?`url(#gradient_${k.value}_${n})`:l.color},null,14,_e),e.createElementVNode("circle",{"data-cy-trap":"",stroke:"none",cx:s.value.width/2,cy:n===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*l.proportion/2-2*(n+1),r:e.unref(r.checkNaN)(d.value*l.proportion/2*.9<=0?1e-4:d.value*l.proportion/2*.9),fill:"transparent",onMouseenter:u=>ve(n,l),onMouseleave:a[0]||(a[0]=u=>{m.value=null,x.value=!1})},null,40,Le)]))),256)),e.renderSlot(o.$slots,"svg",{svg:s.value},void 0,!0)],14,Ne)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ve,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),T.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(be.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:O},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(ye.Legend,{key:`legend_${M.value}`,legendSet:Y.value,config:ce.value,onClickMarker:a[1]||(a[1]=({legend:l})=>_(l.uid))},{item:e.withCtx(({legend:l,index:n})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:u=>_(l.uid),style:e.normalizeStyle(`opacity:${i.value.includes(l.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:n}))+" ",1),i.value.includes(l.uid)?(e.openBlock(),e.createElementBlock("span",Oe," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ae," ("+e.toDisplayString(isNaN(l.value/p.value)?"-":e.unref(r.dataLabel)({v:l.value/p.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Ee)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:Y.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:z,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(fe._sfc_main,{show:g.value.showTooltip&&x.value&&i.value.length<v.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:y.value,content:P.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({...L.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$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","isCustom"]),T.value?(e.openBlock(),e.createBlock(ke.default,{key:8,hideDetails:"",config:{open:g.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(me.DataTable,{key:`table_${R.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]=l=>g.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ze)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,xe))}},Ie=Te._export_sfc(Fe,[["__scopeId","data-v-2a4f4cb4"]]);exports.default=Ie;
@@ -1,17 +1,17 @@
1
1
  import { computed as m, ref as h, watch as Ze, onMounted as et, onBeforeUnmount as tt, openBlock as o, createElementBlock as u, normalizeClass as De, normalizeStyle as U, createBlock as Y, createCommentVNode as c, unref as v, createSlots as lt, withCtx as _, renderSlot as M, normalizeProps as Q, guardReactiveProps as Z, createVNode as he, createElementVNode as d, Fragment as P, renderList as X, toDisplayString as $, createTextVNode as at, nextTick as ot } from "vue";
2
- import { u as st, c as ut, t as rt, a as it, p as q, o as nt, e as pe, b as vt, g as Ye, T as yt, R as ct, W as dt, X as ht, U as pt, s as fe, i as j, v as C, f as W, x as ft, y as gt, q as xt, r as mt } from "./index-C2sScL5o.js";
2
+ import { u as st, c as ut, t as rt, a as it, p as q, o as nt, e as pe, b as vt, g as Ye, T as yt, R as ct, W as dt, X as ht, U as pt, s as fe, i as j, v as C, f as W, x as ft, y as gt, q as xt, r as mt } from "./index-hV0hU1iE.js";
3
3
  import { t as bt, u as kt } from "./useResponsive-CoxXLe23.js";
4
- import { _ as _t } from "./Title-Dl6c1jg0.js";
5
- import { u as wt, U as Mt } from "./usePrinter-CddPH-Ds.js";
6
- import { _ as $t } from "./Tooltip-8UZ341MF.js";
7
- import { L as Ct } from "./Legend-CJnJQbiR.js";
8
- import { _ as je } from "./Shape-nQyHwd5x.js";
9
- import { D as zt } from "./DataTable-B-_LZJ5T.js";
10
- import At from "./vue-ui-skeleton-BgKRd_jD.js";
11
- import St from "./vue-ui-accordion-BH4FO7io.js";
12
- import { u as Ve } from "./useNestedProp-CuE-kmwp.js";
13
- import { _ as Lt } from "./PackageVersion-DHeUFci0.js";
14
- import { P as Tt } from "./PenAndPaper-BKIQk9Cq.js";
4
+ import { _ as _t } from "./Title-DBozX6nP.js";
5
+ import { u as wt, U as Mt } from "./usePrinter-y3d31M4g.js";
6
+ import { _ as $t } from "./Tooltip-Com_T8vc.js";
7
+ import { L as Ct } from "./Legend-hnLfwhmm.js";
8
+ import { _ as je } from "./Shape-QdnXSUyn.js";
9
+ import { D as zt } from "./DataTable-BpVz3DBX.js";
10
+ import At from "./vue-ui-skeleton-BY8Jg9a_.js";
11
+ import St from "./vue-ui-accordion-m-s-7akB.js";
12
+ import { u as Ve } from "./useNestedProp-CRAUOmT5.js";
13
+ import { _ as Lt } from "./PackageVersion-wqab02xF.js";
14
+ import { P as Tt } from "./PenAndPaper-C_laA5mt.js";
15
15
  import { _ as Bt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
16
16
  const Nt = ["id"], Pt = ["xmlns", "viewBox"], Wt = { key: 0 }, Ot = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ft = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Xt = { key: 1 }, It = ["points", "fill", "stroke-width", "stroke-dasharray", "stroke"], Dt = { key: 0 }, Yt = ["cx", "cy", "r", "fill", "stroke", "stroke-width", "onMouseover"], jt = { key: 1 }, Vt = { key: 2 }, Et = ["id"], Gt = ["stop-color"], Rt = ["stop-color"], Ut = ["id"], qt = ["stop-color"], Ht = ["stop-color"], Jt = ["x", "y", "width", "height", "fill", "stroke", "stroke-width", "rx"], Kt = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], Qt = { key: 0 }, Zt = ["d", "stroke", "stroke-width"], el = ["d", "stroke", "stroke-width"], tl = ["d", "stroke", "stroke-width"], ll = ["d", "stroke", "stroke-width"], al = {
17
17
  key: 3,