vue-data-ui 2.3.12 → 2.3.13

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 (136) hide show
  1. package/dist/{Arrow-D9RknCbe.js → Arrow-CxtecoRx.js} +1 -1
  2. package/dist/{Arrow-CAMiXnML.cjs → Arrow-DVPNR1Nh.cjs} +1 -1
  3. package/dist/{BaseIcon-DB1g9sdS.js → BaseIcon-Di0MGg_5.js} +1 -1
  4. package/dist/{BaseIcon-5MAyZTOz.cjs → BaseIcon-Dmx2OFvz.cjs} +1 -1
  5. package/dist/{DataTable-CGX9xKvm.cjs → DataTable-DQGTnBUl.cjs} +1 -1
  6. package/dist/{DataTable-Bza1ed62.js → DataTable-cwJyYtAp.js} +2 -2
  7. package/dist/{Legend-BEMGbN0s.cjs → Legend-BEEbv4va.cjs} +1 -1
  8. package/dist/{Legend-C4cCpb4z.js → Legend-CwT-9P7R.js} +1 -1
  9. package/dist/{Shape-BTzik3V0.cjs → Shape-D_rvgadQ.cjs} +1 -1
  10. package/dist/{Shape-Bttb-v8s.js → Shape-Gv8uj72o.js} +1 -1
  11. package/dist/{Slicer-CuwuufTu.cjs → Slicer-BS_vWPLd.cjs} +1 -1
  12. package/dist/{Slicer-WyjxXfiD.js → Slicer-_2QX31RS.js} +1 -1
  13. package/dist/{Title-BSpLzDC1.js → Title-2ab2u_K8.js} +1 -1
  14. package/dist/{Title-XRMcJkna.cjs → Title-DpgU75bw.cjs} +1 -1
  15. package/dist/{Tooltip-COgv-iii.cjs → Tooltip-B2BLFWIv.cjs} +1 -1
  16. package/dist/{Tooltip-DI8_Wjjy.js → Tooltip-mW2mhj5b.js} +1 -1
  17. package/dist/index--K6Ja9Gj.cjs +4 -0
  18. package/dist/{index-ByO3Ywek.js → index-8jKJqifI.js} +2 -2
  19. package/dist/{useNestedProp-Dikfncsl.cjs → useNestedProp-Bs4c78Cx.cjs} +1 -1
  20. package/dist/{useNestedProp-Da77DnaA.js → useNestedProp-R6UMUTVL.js} +1 -1
  21. package/dist/{usePrinter-Dda5FBG3.js → usePrinter-BZ_nWqN_.js} +1 -1
  22. package/dist/{usePrinter-DedM_6px.cjs → usePrinter-CysnJve5.cjs} +1 -1
  23. package/dist/{vue-data-ui-CV6BvTv3.cjs → vue-data-ui-B_t2clEx.cjs} +1 -1
  24. package/dist/{vue-data-ui-Cl7hqjOh.js → vue-data-ui-cMMDkIkv.js} +55 -55
  25. package/dist/vue-data-ui.cjs +1 -1
  26. package/dist/vue-data-ui.js +1 -1
  27. package/dist/{vue-ui-3d-bar-DoFgj58m.js → vue-ui-3d-bar-BbuTc4wl.js} +7 -7
  28. package/dist/{vue-ui-3d-bar-DMek7e52.cjs → vue-ui-3d-bar-D_KT2ttX.cjs} +1 -1
  29. package/dist/{vue-ui-accordion-BytUYLYl.cjs → vue-ui-accordion-B0UeLf1b.cjs} +1 -1
  30. package/dist/{vue-ui-accordion-CbKHVPHh.js → vue-ui-accordion-BsXo1_Ap.js} +3 -3
  31. package/dist/{vue-ui-age-pyramid-CZy4Y3uw.js → vue-ui-age-pyramid-2ncnyfbF.js} +8 -8
  32. package/dist/{vue-ui-age-pyramid-DjlXDjMI.cjs → vue-ui-age-pyramid-NkJjm7Y5.cjs} +1 -1
  33. package/dist/{vue-ui-annotator-BqG8z2Ms.js → vue-ui-annotator-1XKNdkzk.js} +1 -1
  34. package/dist/{vue-ui-annotator-BJShyHMc.cjs → vue-ui-annotator-Cp_9YW9j.cjs} +1 -1
  35. package/dist/{vue-ui-candlestick-DkOQM3qu.js → vue-ui-candlestick-BRtCmvvk.js} +9 -9
  36. package/dist/{vue-ui-candlestick-DJETMuli.cjs → vue-ui-candlestick-C7UfUhKH.cjs} +1 -1
  37. package/dist/{vue-ui-carousel-table-C2vcNP0X.js → vue-ui-carousel-table-BDSfeqmZ.js} +4 -4
  38. package/dist/{vue-ui-carousel-table-BQipTTWP.cjs → vue-ui-carousel-table-DqFMeiuA.cjs} +1 -1
  39. package/dist/{vue-ui-chestnut-D39qozSK.js → vue-ui-chestnut-BYjoX9jF.js} +6 -6
  40. package/dist/{vue-ui-chestnut-D3FtT3JK.cjs → vue-ui-chestnut-C8OAoRK_.cjs} +1 -1
  41. package/dist/{vue-ui-cursor-LMFBAzPM.js → vue-ui-cursor-D2Z7TPI-.js} +2 -2
  42. package/dist/{vue-ui-cursor-CpJO5mEd.cjs → vue-ui-cursor-g-HCrJEh.cjs} +1 -1
  43. package/dist/{vue-ui-dashboard-BzOic-SZ.cjs → vue-ui-dashboard-BtcFyRqQ.cjs} +1 -1
  44. package/dist/{vue-ui-dashboard-C-LaI61T.js → vue-ui-dashboard-Di61LOP8.js} +2 -2
  45. package/dist/{vue-ui-digits-D2XilsJW.cjs → vue-ui-digits-CWBg_VEu.cjs} +1 -1
  46. package/dist/{vue-ui-digits-BMoM0DwG.js → vue-ui-digits-DZ4PtZ2V.js} +2 -2
  47. package/dist/{vue-ui-donut-BYacXuN1.cjs → vue-ui-donut-D7coup6_.cjs} +1 -1
  48. package/dist/{vue-ui-donut-evolution-DwhuTpBB.cjs → vue-ui-donut-evolution-D0CnAbTe.cjs} +1 -1
  49. package/dist/{vue-ui-donut-evolution-Dr1MkSB2.js → vue-ui-donut-evolution-DFnIT2Ha.js} +9 -9
  50. package/dist/{vue-ui-donut-DvESP2fh.js → vue-ui-donut-goSbPuLj.js} +9 -9
  51. package/dist/{vue-ui-dumbbell-kTZ4cbhw.js → vue-ui-dumbbell-Bg3ZJTCq.js} +8 -8
  52. package/dist/{vue-ui-dumbbell-CzYf1Etr.cjs → vue-ui-dumbbell-CgLLF153.cjs} +1 -1
  53. package/dist/{vue-ui-flow-BkSTX5_A.js → vue-ui-flow-B3z_g_8N.js} +7 -7
  54. package/dist/{vue-ui-flow-BJbCaSJI.cjs → vue-ui-flow-BkxQCKjx.cjs} +1 -1
  55. package/dist/{vue-ui-galaxy-DiKAWRBN.js → vue-ui-galaxy-9GX2Yn08.js} +9 -9
  56. package/dist/{vue-ui-galaxy-Bb-A8wCU.cjs → vue-ui-galaxy-XEjtYCs3.cjs} +1 -1
  57. package/dist/{vue-ui-gauge-Dt6Cuuo0.js → vue-ui-gauge-BlGlMncn.js} +4 -4
  58. package/dist/{vue-ui-gauge-DvYBrZs4.cjs → vue-ui-gauge-CgPj9uEv.cjs} +1 -1
  59. package/dist/{vue-ui-heatmap-KHa42VW8.cjs → vue-ui-heatmap-B4CFPky7.cjs} +1 -1
  60. package/dist/{vue-ui-heatmap-B9B0h5N8.js → vue-ui-heatmap-hMExvod2.js} +8 -8
  61. package/dist/{vue-ui-kpi-BfqVRF0H.cjs → vue-ui-kpi-BK9T4bpj.cjs} +1 -1
  62. package/dist/{vue-ui-kpi-Bts4qzfH.js → vue-ui-kpi-Cq6v98L7.js} +2 -2
  63. package/dist/{vue-ui-mini-loader-DdlM_ms1.cjs → vue-ui-mini-loader-CbxnHLGF.cjs} +1 -1
  64. package/dist/{vue-ui-mini-loader-CZtaTr-s.js → vue-ui-mini-loader-Dlt9PzOu.js} +2 -2
  65. package/dist/{vue-ui-molecule-Y29DXzD8.js → vue-ui-molecule-Do_rYDzn.js} +9 -9
  66. package/dist/{vue-ui-molecule-Cey5Cuqp.cjs → vue-ui-molecule-o7CQo9fo.cjs} +1 -1
  67. package/dist/{vue-ui-mood-radar-CaXsxM2P.js → vue-ui-mood-radar-CUJgwOoe.js} +9 -9
  68. package/dist/{vue-ui-mood-radar-BGQYx51N.cjs → vue-ui-mood-radar-DI5JbPJo.cjs} +1 -1
  69. package/dist/{vue-ui-nested-donuts-B0OSKK4x.cjs → vue-ui-nested-donuts-DKoxrXcL.cjs} +1 -1
  70. package/dist/{vue-ui-nested-donuts-8aIjfQHr.js → vue-ui-nested-donuts-Dj2KRb7e.js} +9 -9
  71. package/dist/{vue-ui-onion-BuM5DcbA.js → vue-ui-onion-Cc2jbWrA.js} +9 -9
  72. package/dist/{vue-ui-onion-D8Ug2z_r.cjs → vue-ui-onion-yFKEaqim.cjs} +1 -1
  73. package/dist/{vue-ui-parallel-coordinate-plot-RAjWALxs.cjs → vue-ui-parallel-coordinate-plot-Bktf9Q8d.cjs} +1 -1
  74. package/dist/{vue-ui-parallel-coordinate-plot-BnylgPQ1.js → vue-ui-parallel-coordinate-plot-sbbh6u1F.js} +10 -10
  75. package/dist/{vue-ui-quadrant-DpUSb39t.js → vue-ui-quadrant-BPR-kNQP.js} +10 -10
  76. package/dist/{vue-ui-quadrant-Bd9XzzOJ.cjs → vue-ui-quadrant-R3-Xo1sw.cjs} +1 -1
  77. package/dist/{vue-ui-quick-chart-CMkvhuhW.js → vue-ui-quick-chart-DO8ZMKIh.js} +6 -6
  78. package/dist/{vue-ui-quick-chart-7dYq_RGE.cjs → vue-ui-quick-chart-DfSCSQqC.cjs} +1 -1
  79. package/dist/{vue-ui-radar-DVFyhzLg.cjs → vue-ui-radar-66Df70XX.cjs} +1 -1
  80. package/dist/{vue-ui-radar-BlHTPxa4.js → vue-ui-radar-aAN29Jds.js} +10 -10
  81. package/dist/{vue-ui-rating-cVAVmnzB.js → vue-ui-rating-CjBBd7yH.js} +2 -2
  82. package/dist/{vue-ui-rating-DRncGN96.cjs → vue-ui-rating-D_ccOaNz.cjs} +1 -1
  83. package/dist/{vue-ui-relation-circle-B8iBDo0q.js → vue-ui-relation-circle-CMzLThvR.js} +5 -5
  84. package/dist/{vue-ui-relation-circle-C8QjpkXl.cjs → vue-ui-relation-circle-Ck1rJqbu.cjs} +1 -1
  85. package/dist/{vue-ui-rings-CQq3JQNk.js → vue-ui-rings-CLZcLdfP.js} +9 -9
  86. package/dist/{vue-ui-rings-m4MWlNsq.cjs → vue-ui-rings-ChK4CWHY.cjs} +1 -1
  87. package/dist/{vue-ui-scatter-C-Egs7S_.js → vue-ui-scatter-08CGJzrL.js} +10 -10
  88. package/dist/{vue-ui-scatter-mNEnBtaf.cjs → vue-ui-scatter-nYfvOhiI.cjs} +1 -1
  89. package/dist/{vue-ui-screenshot-Bl9jX-C2.cjs → vue-ui-screenshot-B-dCSFDA.cjs} +1 -1
  90. package/dist/{vue-ui-screenshot-DfHSBG7u.js → vue-ui-screenshot-BlJChEJa.js} +1 -1
  91. package/dist/{vue-ui-skeleton-rY_nZhMQ.cjs → vue-ui-skeleton-Bf_PLiHN.cjs} +1 -1
  92. package/dist/{vue-ui-skeleton-BxRSQeuo.js → vue-ui-skeleton-CxbgzdoX.js} +2 -2
  93. package/dist/{vue-ui-smiley-J5ng6jFT.js → vue-ui-smiley-C_atoEId.js} +2 -2
  94. package/dist/{vue-ui-smiley-BWTx88Vc.cjs → vue-ui-smiley-CwpLvr5B.cjs} +1 -1
  95. package/dist/{vue-ui-spark-trend-CKllSCO9.cjs → vue-ui-spark-trend-DgvljrXb.cjs} +1 -1
  96. package/dist/{vue-ui-spark-trend-CSgSKyhQ.js → vue-ui-spark-trend-jzplEySC.js} +4 -4
  97. package/dist/{vue-ui-sparkbar-wLasc_jU.cjs → vue-ui-sparkbar-BaqyijV1.cjs} +1 -1
  98. package/dist/{vue-ui-sparkbar-BDSuCvBs.js → vue-ui-sparkbar-DQSTdQ1V.js} +36 -37
  99. package/dist/{vue-ui-sparkgauge-DsKCi2rC.js → vue-ui-sparkgauge-B5UKLj0l.js} +3 -3
  100. package/dist/{vue-ui-sparkgauge-DLf9qwso.cjs → vue-ui-sparkgauge-Z18yo2Z8.cjs} +1 -1
  101. package/dist/{vue-ui-sparkhistogram-BY9WjI96.js → vue-ui-sparkhistogram-Be3ehhGJ.js} +4 -4
  102. package/dist/{vue-ui-sparkhistogram-D3xFCR7z.cjs → vue-ui-sparkhistogram-CmCIpXl6.cjs} +1 -1
  103. package/dist/{vue-ui-sparkline-D8gMceMV.js → vue-ui-sparkline-BYqBWbjw.js} +3 -3
  104. package/dist/{vue-ui-sparkline-BhB4gTda.cjs → vue-ui-sparkline-D80QVWdy.cjs} +1 -1
  105. package/dist/{vue-ui-sparkstackbar-dINlqLlM.cjs → vue-ui-sparkstackbar-DH4dUMx0.cjs} +1 -1
  106. package/dist/{vue-ui-sparkstackbar-8ap_HMW0.js → vue-ui-sparkstackbar-DjnE1I-5.js} +3 -3
  107. package/dist/{vue-ui-strip-plot-wUXpoWOD.cjs → vue-ui-strip-plot-Cln20Ld8.cjs} +1 -1
  108. package/dist/{vue-ui-strip-plot-Duu9jsML.js → vue-ui-strip-plot-DJy6rHjW.js} +9 -9
  109. package/dist/{vue-ui-table-Bbjo6d7J.js → vue-ui-table-Ffw1XO2M.js} +1 -1
  110. package/dist/{vue-ui-table-heatmap-CokrixjX.js → vue-ui-table-heatmap-BQexH7HX.js} +4 -4
  111. package/dist/{vue-ui-table-heatmap-BWUGw4tD.cjs → vue-ui-table-heatmap-D1Nbq4uX.cjs} +1 -1
  112. package/dist/{vue-ui-table-sparkline-DwStFsdv.cjs → vue-ui-table-sparkline-tfvjgw5Z.cjs} +1 -1
  113. package/dist/{vue-ui-table-sparkline-B4f74K6D.js → vue-ui-table-sparkline-uVlNJ867.js} +5 -5
  114. package/dist/{vue-ui-table-DPBuQHl9.cjs → vue-ui-table-zZ7Z9muE.cjs} +1 -1
  115. package/dist/{vue-ui-thermometer-Bvw08auw.js → vue-ui-thermometer-C3aP4aYg.js} +5 -5
  116. package/dist/{vue-ui-thermometer-D4lvsaZQ.cjs → vue-ui-thermometer-DKYjF4LF.cjs} +1 -1
  117. package/dist/{vue-ui-timer-BSU22BD2.cjs → vue-ui-timer-BdwfMEMG.cjs} +1 -1
  118. package/dist/{vue-ui-timer-C6zSHO_W.js → vue-ui-timer-dDMpywVB.js} +4 -4
  119. package/dist/{vue-ui-tiremarks-CH0_xCoD.cjs → vue-ui-tiremarks-CKmVyzxM.cjs} +1 -1
  120. package/dist/{vue-ui-tiremarks-BY4m2mEn.js → vue-ui-tiremarks-pjMd7d-R.js} +5 -5
  121. package/dist/{vue-ui-treemap-DIxqUkmn.cjs → vue-ui-treemap-BuEmj1Sy.cjs} +1 -1
  122. package/dist/{vue-ui-treemap-DWBXR_CR.js → vue-ui-treemap-CXwX04Bu.js} +9 -9
  123. package/dist/{vue-ui-vertical-bar-DnPmmj4p.cjs → vue-ui-vertical-bar-BV_CvoPe.cjs} +1 -1
  124. package/dist/{vue-ui-vertical-bar-BxvhqgWg.js → vue-ui-vertical-bar-DC8B39Uu.js} +9 -9
  125. package/dist/{vue-ui-waffle-CYpc5Enk.cjs → vue-ui-waffle-Doh1T4Ji.cjs} +1 -1
  126. package/dist/{vue-ui-waffle-BlFjCDDx.js → vue-ui-waffle-t4gEowfH.js} +9 -9
  127. package/dist/{vue-ui-wheel-CHvx9zQF.js → vue-ui-wheel-B9yjkkA6.js} +5 -5
  128. package/dist/{vue-ui-wheel-WxC0_YV_.cjs → vue-ui-wheel-Rv1F1zVc.cjs} +1 -1
  129. package/dist/{vue-ui-word-cloud-LMl5vudk.cjs → vue-ui-word-cloud-CIdTdi88.cjs} +1 -1
  130. package/dist/{vue-ui-word-cloud-BnLAMza-.js → vue-ui-word-cloud-SlFlX-fY.js} +6 -6
  131. package/dist/{vue-ui-xy-DHzwqXVf.cjs → vue-ui-xy-CzqnufbM.cjs} +1 -1
  132. package/dist/{vue-ui-xy-DStN5sP4.js → vue-ui-xy-DpnhJcZD.js} +12 -12
  133. package/dist/{vue-ui-xy-canvas-D3zCvIfh.js → vue-ui-xy-canvas-Dwl-uL4T.js} +10 -10
  134. package/dist/{vue-ui-xy-canvas-DTjWEsfN.cjs → vue-ui-xy-canvas-Dzl92nPU.cjs} +1 -1
  135. package/package.json +1 -1
  136. package/dist/index-BDKEFvEF.cjs +0 -4
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),d=require("./index-BDKEFvEF.cjs"),ke=require("./useResponsive-B3TrDDIG.cjs"),ee=require("./BaseIcon-5MAyZTOz.cjs"),Ce=require("./Tooltip-COgv-iii.cjs"),ge=require("./usePrinter-DedM_6px.cjs"),ze=require("./Slicer-CuwuufTu.cjs"),pe=require("./useNestedProp-Dikfncsl.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={LINE:"LINE",BAR:"BAR",DONUT:"DONUT"},Fe=["SERIE","SERIES","DATA","VALUE","VALUES","NUM"];function Ve({dataset:r,barLineSwitch:b=6}){let h=null,A=null,N=0;if((typeof r=="number"||typeof r=="string")&&console.warn(`The provided dataset (${r}) is not sufficient to build a chart`),Y(r)&&(q(r)&&(r.length<b?h=S.BAR:h=S.LINE,A=r,N=r.length),ie(r))){if(!Pe(r))return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."),!1;const D=Object.keys(r[0]),W=Object.values(r[0]);if(!D.some(w=>Te(w)))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;ye(W,w=>typeof w=="number")&&(h=S.DONUT,A=r),ye(W,w=>Array.isArray(w)&&q(w))&&(xe(r)>b?h=S.LINE:h=S.BAR,N=xe(r),A=r.map(w=>({...w,data:Re(w,$=>q($))}))),r=r.map(w=>Se(w)),A=A.map(w=>Se(w))}return Y(r)&&[...new Set(r.flatMap(D=>Array.isArray(D)))][0],{dataset:r,type:h,usableDataset:A,maxSeriesLength:N}}function be(r){return!r||Y(r)&&!r.length}function Y(r){return Array.isArray(r)}function q(r){if(!Y(r)||be(r))return!1;const b=r.map(h=>Number(h));return![...new Set(b.flatMap(h=>typeof h=="number"&&!isNaN(h)))].includes(!1)}function ie(r){return!Y(r)||be(r)||!![...new Set(r.flatMap(h=>typeof h=="object"&&!Array.isArray(h)))].includes(!1)?!1:!r.map(h=>Object.keys(h).length>0).includes(!1)}function $e(r,b){const h=Object.keys(r).sort(),A=Object.keys(b).sort();if(h.length!==A.length)return!1;for(let N=0;N<h.length;N+=1){const V=h[N],I=A[N];if(V!==I||typeof r[V]!=typeof b[I])return!1}return!0}function Pe(r){if(r.length<=1)return!0;for(let b=0;b<r.length;b+=1)for(let h=b+1;h<r.length;h+=1)if(!$e(r[b],r[h]))return!1;return!0}function Te(r){return Fe.includes(r.toUpperCase())}function ye(r,b){let h=[];for(let A=0;A<r.length;A+=1)h.push(b(r[A]));return h.includes(!0)}function xe(r){return Math.max(...[...r].flatMap(b=>Object.values(b).filter(h=>q(h)).map(h=>h.length)))}function Re(r,b){return Object.values(r).filter(h=>b(h))[0]}function Se(r){const b={};for(let h in r)r.hasOwnProperty(h)&&(b[h.toUpperCase()]=r[h]);return b}const Be=r=>(e.pushScopeId("data-v-2223f1be"),r=r(),e.popScopeId(),r),Oe=["id"],Ie=["xmlns","viewBox"],De=["id"],Me=["id"],Ue=Be(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),qe=["id"],We=["flood-color"],je={key:0,class:"donut-label-connectors"},Ge=["d","stroke","stroke-width","filter"],He=["cx","cy","r","fill"],Xe=["cx","cy","r","fill","filter"],Ye={class:"donut"},Ze=["d","fill","stroke","stroke-width","filter"],Je=["d","onMouseenter","onClick"],Ke={key:1,class:"donut-labels quick-animation"},Qe=["cx","cy","fill","filter"],et=["text-anchor","x","y","fill","font-size","filter"],tt=["text-anchor","x","y","fill","font-size","filter"],lt={key:2,class:"donut-hollow quick-animation"},at=["x","y","font-size","fill"],ot=["x","y","font-size","fill"],nt={key:0,class:"line-grid"},rt=["x1","x2","y1","y2","stroke","stroke-width"],it=["x1","x2","y1","y2","stroke","stroke-width"],ut={key:1,class:"line-axis"},st=["x1","x2","y1","y2","stroke","stroke-width"],ct=["x1","x2","y1","y2","stroke","stroke-width"],dt={key:2,class:"yLabels"},vt=["x1","x2","y1","y2","stroke","stroke-width"],mt=["x","y","font-size","fill"],ht={key:3,class:"periodLabels"},ft=["x1","x2","y1","y2","stroke","stroke-width"],kt=["font-size","text-anchor","fill","transform"],gt={class:"plots"},pt={class:"line-plot-series"},yt=["d","stroke","stroke-width"],xt=["d","stroke","stroke-width"],St=["d","stroke","stroke-width"],bt=["d","stroke","stroke-width"],Bt=["cx","cy","fill","stroke"],wt={key:4,class:"dataLabels"},Et=["font-size","fill","x","y"],_t={class:"tooltip-traps"},At=["x","y","height","width","fill","onMouseenter","onClick"],Lt={key:0,class:"line-grid"},Ct=["x1","x2","y1","y2","stroke","stroke-width"],zt=["x1","x2","y1","y2","stroke","stroke-width"],Nt={key:1,class:"line-axis"},Ft=["x1","x2","y1","y2","stroke","stroke-width"],Vt=["x1","x2","y1","y2","stroke","stroke-width"],$t={key:2,class:"yLabels"},Pt=["x1","x2","y1","y2","stroke","stroke-width"],Tt=["x","y","font-size","fill"],Rt={key:3,class:"periodLabels"},Ot=["x1","x2","y1","y2","stroke","stroke-width"],It=["font-size","text-anchor","transform","fill"],Dt={class:"plots"},Mt=["x","width","height","y","fill","stroke","stroke-width"],Ut=["to"],qt=["from","to"],Wt={key:4,class:"dataLabels"},jt=["x","y","font-size","fill"],Gt={class:"tooltip-traps"},Ht=["x","y","height","width","fill","onMouseenter","onClick"],Xt={key:3,class:"axis-labels"},Yt={key:0},Zt=["font-size","fill","x","y"],Jt={key:1},Kt=["font-size","fill","x","y"],Qt={key:2},el=["font-size","fill","transform"],tl={key:3},ll=["font-size","fill","transform"],al=["onClick"],ol=["onClick"],nl=["onClick"],rl={key:1,class:"vue-ui-quick-chart-not-processable"},il=Be(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),ul={__name:"vue-ui-quick-chart",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}}},emits:["selectDatapoint","selectLegend"],setup(r,{expose:b,emit:h}){const A=r,{vue_ui_quick_chart:N}=d.useConfig(),V=e.ref(null),I=e.ref(null),D=e.ref(null),W=e.ref(null),w=e.ref(d.createUid()),$=e.ref(!1),j=e.ref(null),P=e.ref(""),F=e.ref(null),y=e.ref([]),ue=e.ref(0),te=e.ref(0),t=e.computed(()=>{const i=pe.useNestedProp({userConfig:A.config,defaultConfig:N});return i.theme?{...pe.useNestedProp({userConfig:d.themes.vue_ui_quick_chart[i.theme]||A.config,defaultConfig:i}),customPalette:d.themePalettes[i.theme]||d.palette}:i}),G=e.computed(()=>d.convertCustomPalette(t.value.customPalette)),Z=e.computed(()=>{const i=Ve({dataset:A.dataset,barLineSwitch:t.value.chartIsBarUnderDatasetLength});return i||console.error("VueUiQuickChart : Dataset is not processable"),i}),x=e.ref(Z.value),we=e.computed(()=>!!x.value),E=e.computed(()=>x.value?x.value.type:null),{isPrinting:le,isImaging:ae,generatePdf:se,generateImage:ce}=ge.usePrinter({elementId:`${E.value}_${w.value}`,fileName:t.value.title||E.value}),g=e.ref({width:t.value.width,height:t.value.height}),J=e.ref({showTooltip:t.value.showTooltip}),K=e.ref(null);e.onMounted(()=>{if(t.value.responsive){const i=ke.throttle(()=>{const{width:v,height:l}=ke.useResponsive({chart:V.value,title:t.value.title?I.value:null,legend:t.value.showLegend?D.value:null,slicer:[S.BAR,S.LINE].includes(E.value)&&t.value.zoomXy&&x.value.maxSeriesLength>1?W.value:null});g.value.width=v,g.value.height=l});K.value=new ResizeObserver(i),K.value.observe(V.value.parentNode)}}),e.onBeforeUnmount(()=>{K.value&&K.value.disconnect()});const Ee=e.computed(()=>{switch(E.value){case S.LINE:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`;case S.BAR:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`;case S.DONUT:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`;default:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`}});function de(i){return[...i].map(v=>v.value).reduce((v,l)=>v+l,0)}function H(i){return t.value.blurOnHover&&![null,void 0].includes(F.value)&&F.value!==i?`url(#blur_${w.value})`:""}function ve(i,v){y.value.includes(i)?y.value=y.value.filter(l=>l!==i):y.value.length<v&&y.value.push(i)}const me=e.ref(null),he=e.ref(null),Q=e.ref(!1);function _e(i,v){Q.value=!0;let l=i.value;if(y.value.includes(i.id)){let s=function(){l>n?(Q.value=!1,cancelAnimationFrame(he.value),x.value={...x.value,dataset:x.value.dataset.map((m,L)=>i.id===`donut_${L}`?{...m,value:n,VALUE:n}:m)}):(l+=n*.025,x.value={...x.value,dataset:x.value.dataset.map((m,L)=>i.id===`donut_${L}`?{...m,value:l,VALUE:l}:m)},he.value=requestAnimationFrame(s))};y.value=y.value.filter(m=>m!==i.id);const n=Z.value.dataset.find((m,L)=>i.id===`donut_${L}`).VALUE;s()}else if(v.length>1){let n=function(){l<.1?(Q.value=!1,cancelAnimationFrame(me.value),y.value.push(i.id),x.value={...x.value,dataset:x.value.dataset.map((s,m)=>i.id===`donut_${m}`?{...s,value:0,VALUE:0}:s)}):(l/=1.1,x.value={...x.value,dataset:x.value.dataset.map((s,m)=>i.id===`donut_${m}`?{...s,value:l,VALUE:l}:s)},me.value=requestAnimationFrame(n))};n()}}const B=e.computed(()=>{if(E.value!==S.DONUT)return null;const i=x.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?d.convertColorToHex(a.COLOR):G.value[o+t.value.paletteStartIndex]||d.palette[o+t.value.paletteStartIndex]||d.palette[(o+t.value.paletteStartIndex)%d.palette.length],immutableValue:a.value}));function v(a,o){return isNaN(a.value/de(o))?0:(a.value/de(o)*100).toFixed(t.value.dataLabelRoundingPercentage)+"%"}function l(a){return a.proportion*100>t.value.donutHideLabelUnderPercentage}function n(a,o){const k=Z.value.dataset.find((_,z)=>`donut_${z}`===a).VALUE;return Math.abs(String(Number(k.toFixed(0))).length-String(Number(o.toFixed(0))).length)}function s({datapoint:a,seriesIndex:o}){j.value={datapoint:a,seriesIndex:o,config:t.value,dataset:i},F.value=a.id;const k=t.value.tooltipCustomFormat;if(d.isFunction(k)&&d.functionReturnsString(()=>k({datapoint:a,seriesIndex:o,series:i,config:t.value})))P.value=k({datapoint:a,seriesIndex:o,series:i,config:t.value});else{let f="";f+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${a.name}</div>`,f+=`<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>`,f+=`<b>${d.dataLabel({p:t.value.valuePrefix,v:a.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue})}</b>`,f+=`<span>(${d.dataLabel({v:a.proportion*100,s:"%",r:t.value.dataLabelRoundingPercentage})})</span></div>`,P.value=`<div>${f}</div>`}$.value=!0}function m(){$.value=!1,F.value=null}const L={centerX:g.value.width/2,centerY:g.value.height/2},C=i.filter(a=>!y.value.includes(a.id)).map(a=>a.value||0).reduce((a,o)=>a+o,0),M=i.map((a,o)=>({...a,proportion:(a.value||0)/C,value:a.value||0,absoluteValue:Z.value.dataset.find((k,f)=>`donut_${f}`===a.id).VALUE})),T=g.value.width/2,U=g.value.height/2,R=g.value.height*t.value.donutRadiusRatio;return{dataset:M.filter(a=>!y.value.includes(a.id)),legend:M,drawingArea:L,displayArcPercentage:v,isArcBigEnough:l,useTooltip:s,killTooltip:m,getSpaces:n,total:C,cx:T,cy:U,radius:R,chart:d.makeDonut({series:i.filter(a=>!y.value.includes(a.id))},T,U,R,R,1.99999,2,1,360,105.25,g.value.height*t.value.donutThicknessRatio)}}),p=e.ref({start:0,end:x.value.maxSeriesLength});function Ae(){p.value={start:0,end:x.value.maxSeriesLength},te.value+=1}const c=e.computed(()=>{if(E.value!==S.LINE)return null;const i={height:g.value.height,width:g.value.width},v={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:i.width-t.value.xyPaddingRight,bottom:i.height-t.value.xyPaddingBottom,width:i.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:i.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];q(x.value.dataset)&&(l=[{values:x.value.dataset.slice(p.value.start,p.value.end),absoluteIndices:x.value.dataset.map((a,o)=>o).slice(p.value.start,p.value.end),name:t.value.title,color:G.value[t.value.paletteStartIndex]||d.palette[t.value.paletteStartIndex],id:"line_0"}]),ie(x.value.dataset)&&(l=x.value.dataset.map((a,o)=>({...a,values:a.VALUE||a.DATA||a.SERIE||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?d.convertColorToHex(a.COLOR):G.value[o+t.value.paletteStartIndex]||d.palette[o+t.value.paletteStartIndex]||d.palette[(o+t.value.paletteStartIndex)%d.palette.length],values:a.values.slice(p.value.start,p.value.end),absoluteIndices:a.values.map((k,f)=>f).slice(p.value.start,p.value.end)})));const n={max:Math.max(...l.filter(a=>!y.value.includes(a.id)).flatMap(a=>a.values)),min:Math.min(...l.filter(a=>!y.value.includes(a.id)).flatMap(a=>a.values)),maxSeries:Math.max(...l.map(a=>a.values.length))},s=d.calculateNiceScale(n.min<0?n.min:0,n.max<0?0:n.max,t.value.xyScaleSegments),m=n.min<0?Math.abs(n.min):0,L=n.max<0?v.top:v.bottom-m/(s.max+m)*v.height,C=v.width/n.maxSeries,M=s.ticks.map(a=>({y:v.bottom-v.height*((a+m)/(s.max+m)),x:v.left-8,value:a})),T=l.map((a,o)=>({...a,coordinates:a.values.map((k,f)=>({x:v.left+C*(f+1)-C/2,y:v.bottom-(k+m)/(s.max+m)*v.height,value:k}))})).map(a=>{let o=[];return a.coordinates.forEach(k=>{o.push(`${k.x},${k.y} `)}),{...a,linePath:o.join(" ")}});function U(a){F.value=a;const o=l.map(f=>({...f,value:f.values[a],absoluteIndex:f.absoluteIndices[a]})).filter(f=>!y.value.includes(f.id));j.value={datapoint:o,seriesIndex:a,config:t.value,dataset:l};const k=t.value.tooltipCustomFormat;if(d.isFunction(k)&&d.functionReturnsString(()=>k({datapoint:o,seriesIndex:a,series:l,config:t.value})))P.value=k({datapoint:o,seriesIndex:a,series:l,config:t.value});else{let f="";t.value.xyPeriods[o[0].absoluteIndex]&&(f+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[o[0].absoluteIndex]}</div>`),o.forEach(_=>{f+=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),d=require("./index--K6Ja9Gj.cjs"),ke=require("./useResponsive-B3TrDDIG.cjs"),ee=require("./BaseIcon-Dmx2OFvz.cjs"),Ce=require("./Tooltip-B2BLFWIv.cjs"),ge=require("./usePrinter-CysnJve5.cjs"),ze=require("./Slicer-BS_vWPLd.cjs"),pe=require("./useNestedProp-Bs4c78Cx.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={LINE:"LINE",BAR:"BAR",DONUT:"DONUT"},Fe=["SERIE","SERIES","DATA","VALUE","VALUES","NUM"];function Ve({dataset:r,barLineSwitch:b=6}){let h=null,A=null,N=0;if((typeof r=="number"||typeof r=="string")&&console.warn(`The provided dataset (${r}) is not sufficient to build a chart`),Y(r)&&(q(r)&&(r.length<b?h=S.BAR:h=S.LINE,A=r,N=r.length),ie(r))){if(!Pe(r))return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."),!1;const D=Object.keys(r[0]),W=Object.values(r[0]);if(!D.some(w=>Te(w)))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;ye(W,w=>typeof w=="number")&&(h=S.DONUT,A=r),ye(W,w=>Array.isArray(w)&&q(w))&&(xe(r)>b?h=S.LINE:h=S.BAR,N=xe(r),A=r.map(w=>({...w,data:Re(w,$=>q($))}))),r=r.map(w=>Se(w)),A=A.map(w=>Se(w))}return Y(r)&&[...new Set(r.flatMap(D=>Array.isArray(D)))][0],{dataset:r,type:h,usableDataset:A,maxSeriesLength:N}}function be(r){return!r||Y(r)&&!r.length}function Y(r){return Array.isArray(r)}function q(r){if(!Y(r)||be(r))return!1;const b=r.map(h=>Number(h));return![...new Set(b.flatMap(h=>typeof h=="number"&&!isNaN(h)))].includes(!1)}function ie(r){return!Y(r)||be(r)||!![...new Set(r.flatMap(h=>typeof h=="object"&&!Array.isArray(h)))].includes(!1)?!1:!r.map(h=>Object.keys(h).length>0).includes(!1)}function $e(r,b){const h=Object.keys(r).sort(),A=Object.keys(b).sort();if(h.length!==A.length)return!1;for(let N=0;N<h.length;N+=1){const V=h[N],I=A[N];if(V!==I||typeof r[V]!=typeof b[I])return!1}return!0}function Pe(r){if(r.length<=1)return!0;for(let b=0;b<r.length;b+=1)for(let h=b+1;h<r.length;h+=1)if(!$e(r[b],r[h]))return!1;return!0}function Te(r){return Fe.includes(r.toUpperCase())}function ye(r,b){let h=[];for(let A=0;A<r.length;A+=1)h.push(b(r[A]));return h.includes(!0)}function xe(r){return Math.max(...[...r].flatMap(b=>Object.values(b).filter(h=>q(h)).map(h=>h.length)))}function Re(r,b){return Object.values(r).filter(h=>b(h))[0]}function Se(r){const b={};for(let h in r)r.hasOwnProperty(h)&&(b[h.toUpperCase()]=r[h]);return b}const Be=r=>(e.pushScopeId("data-v-2223f1be"),r=r(),e.popScopeId(),r),Oe=["id"],Ie=["xmlns","viewBox"],De=["id"],Me=["id"],Ue=Be(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),qe=["id"],We=["flood-color"],je={key:0,class:"donut-label-connectors"},Ge=["d","stroke","stroke-width","filter"],He=["cx","cy","r","fill"],Xe=["cx","cy","r","fill","filter"],Ye={class:"donut"},Ze=["d","fill","stroke","stroke-width","filter"],Je=["d","onMouseenter","onClick"],Ke={key:1,class:"donut-labels quick-animation"},Qe=["cx","cy","fill","filter"],et=["text-anchor","x","y","fill","font-size","filter"],tt=["text-anchor","x","y","fill","font-size","filter"],lt={key:2,class:"donut-hollow quick-animation"},at=["x","y","font-size","fill"],ot=["x","y","font-size","fill"],nt={key:0,class:"line-grid"},rt=["x1","x2","y1","y2","stroke","stroke-width"],it=["x1","x2","y1","y2","stroke","stroke-width"],ut={key:1,class:"line-axis"},st=["x1","x2","y1","y2","stroke","stroke-width"],ct=["x1","x2","y1","y2","stroke","stroke-width"],dt={key:2,class:"yLabels"},vt=["x1","x2","y1","y2","stroke","stroke-width"],mt=["x","y","font-size","fill"],ht={key:3,class:"periodLabels"},ft=["x1","x2","y1","y2","stroke","stroke-width"],kt=["font-size","text-anchor","fill","transform"],gt={class:"plots"},pt={class:"line-plot-series"},yt=["d","stroke","stroke-width"],xt=["d","stroke","stroke-width"],St=["d","stroke","stroke-width"],bt=["d","stroke","stroke-width"],Bt=["cx","cy","fill","stroke"],wt={key:4,class:"dataLabels"},Et=["font-size","fill","x","y"],_t={class:"tooltip-traps"},At=["x","y","height","width","fill","onMouseenter","onClick"],Lt={key:0,class:"line-grid"},Ct=["x1","x2","y1","y2","stroke","stroke-width"],zt=["x1","x2","y1","y2","stroke","stroke-width"],Nt={key:1,class:"line-axis"},Ft=["x1","x2","y1","y2","stroke","stroke-width"],Vt=["x1","x2","y1","y2","stroke","stroke-width"],$t={key:2,class:"yLabels"},Pt=["x1","x2","y1","y2","stroke","stroke-width"],Tt=["x","y","font-size","fill"],Rt={key:3,class:"periodLabels"},Ot=["x1","x2","y1","y2","stroke","stroke-width"],It=["font-size","text-anchor","transform","fill"],Dt={class:"plots"},Mt=["x","width","height","y","fill","stroke","stroke-width"],Ut=["to"],qt=["from","to"],Wt={key:4,class:"dataLabels"},jt=["x","y","font-size","fill"],Gt={class:"tooltip-traps"},Ht=["x","y","height","width","fill","onMouseenter","onClick"],Xt={key:3,class:"axis-labels"},Yt={key:0},Zt=["font-size","fill","x","y"],Jt={key:1},Kt=["font-size","fill","x","y"],Qt={key:2},el=["font-size","fill","transform"],tl={key:3},ll=["font-size","fill","transform"],al=["onClick"],ol=["onClick"],nl=["onClick"],rl={key:1,class:"vue-ui-quick-chart-not-processable"},il=Be(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),ul={__name:"vue-ui-quick-chart",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}}},emits:["selectDatapoint","selectLegend"],setup(r,{expose:b,emit:h}){const A=r,{vue_ui_quick_chart:N}=d.useConfig(),V=e.ref(null),I=e.ref(null),D=e.ref(null),W=e.ref(null),w=e.ref(d.createUid()),$=e.ref(!1),j=e.ref(null),P=e.ref(""),F=e.ref(null),y=e.ref([]),ue=e.ref(0),te=e.ref(0),t=e.computed(()=>{const i=pe.useNestedProp({userConfig:A.config,defaultConfig:N});return i.theme?{...pe.useNestedProp({userConfig:d.themes.vue_ui_quick_chart[i.theme]||A.config,defaultConfig:i}),customPalette:d.themePalettes[i.theme]||d.palette}:i}),G=e.computed(()=>d.convertCustomPalette(t.value.customPalette)),Z=e.computed(()=>{const i=Ve({dataset:A.dataset,barLineSwitch:t.value.chartIsBarUnderDatasetLength});return i||console.error("VueUiQuickChart : Dataset is not processable"),i}),x=e.ref(Z.value),we=e.computed(()=>!!x.value),E=e.computed(()=>x.value?x.value.type:null),{isPrinting:le,isImaging:ae,generatePdf:se,generateImage:ce}=ge.usePrinter({elementId:`${E.value}_${w.value}`,fileName:t.value.title||E.value}),g=e.ref({width:t.value.width,height:t.value.height}),J=e.ref({showTooltip:t.value.showTooltip}),K=e.ref(null);e.onMounted(()=>{if(t.value.responsive){const i=ke.throttle(()=>{const{width:v,height:l}=ke.useResponsive({chart:V.value,title:t.value.title?I.value:null,legend:t.value.showLegend?D.value:null,slicer:[S.BAR,S.LINE].includes(E.value)&&t.value.zoomXy&&x.value.maxSeriesLength>1?W.value:null});g.value.width=v,g.value.height=l});K.value=new ResizeObserver(i),K.value.observe(V.value.parentNode)}}),e.onBeforeUnmount(()=>{K.value&&K.value.disconnect()});const Ee=e.computed(()=>{switch(E.value){case S.LINE:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`;case S.BAR:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`;case S.DONUT:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`;default:return`0 0 ${g.value.width<=0?10:g.value.width} ${g.value.height<=0?10:g.value.height}`}});function de(i){return[...i].map(v=>v.value).reduce((v,l)=>v+l,0)}function H(i){return t.value.blurOnHover&&![null,void 0].includes(F.value)&&F.value!==i?`url(#blur_${w.value})`:""}function ve(i,v){y.value.includes(i)?y.value=y.value.filter(l=>l!==i):y.value.length<v&&y.value.push(i)}const me=e.ref(null),he=e.ref(null),Q=e.ref(!1);function _e(i,v){Q.value=!0;let l=i.value;if(y.value.includes(i.id)){let s=function(){l>n?(Q.value=!1,cancelAnimationFrame(he.value),x.value={...x.value,dataset:x.value.dataset.map((m,L)=>i.id===`donut_${L}`?{...m,value:n,VALUE:n}:m)}):(l+=n*.025,x.value={...x.value,dataset:x.value.dataset.map((m,L)=>i.id===`donut_${L}`?{...m,value:l,VALUE:l}:m)},he.value=requestAnimationFrame(s))};y.value=y.value.filter(m=>m!==i.id);const n=Z.value.dataset.find((m,L)=>i.id===`donut_${L}`).VALUE;s()}else if(v.length>1){let n=function(){l<.1?(Q.value=!1,cancelAnimationFrame(me.value),y.value.push(i.id),x.value={...x.value,dataset:x.value.dataset.map((s,m)=>i.id===`donut_${m}`?{...s,value:0,VALUE:0}:s)}):(l/=1.1,x.value={...x.value,dataset:x.value.dataset.map((s,m)=>i.id===`donut_${m}`?{...s,value:l,VALUE:l}:s)},me.value=requestAnimationFrame(n))};n()}}const B=e.computed(()=>{if(E.value!==S.DONUT)return null;const i=x.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?d.convertColorToHex(a.COLOR):G.value[o+t.value.paletteStartIndex]||d.palette[o+t.value.paletteStartIndex]||d.palette[(o+t.value.paletteStartIndex)%d.palette.length],immutableValue:a.value}));function v(a,o){return isNaN(a.value/de(o))?0:(a.value/de(o)*100).toFixed(t.value.dataLabelRoundingPercentage)+"%"}function l(a){return a.proportion*100>t.value.donutHideLabelUnderPercentage}function n(a,o){const k=Z.value.dataset.find((_,z)=>`donut_${z}`===a).VALUE;return Math.abs(String(Number(k.toFixed(0))).length-String(Number(o.toFixed(0))).length)}function s({datapoint:a,seriesIndex:o}){j.value={datapoint:a,seriesIndex:o,config:t.value,dataset:i},F.value=a.id;const k=t.value.tooltipCustomFormat;if(d.isFunction(k)&&d.functionReturnsString(()=>k({datapoint:a,seriesIndex:o,series:i,config:t.value})))P.value=k({datapoint:a,seriesIndex:o,series:i,config:t.value});else{let f="";f+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${a.name}</div>`,f+=`<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>`,f+=`<b>${d.dataLabel({p:t.value.valuePrefix,v:a.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue})}</b>`,f+=`<span>(${d.dataLabel({v:a.proportion*100,s:"%",r:t.value.dataLabelRoundingPercentage})})</span></div>`,P.value=`<div>${f}</div>`}$.value=!0}function m(){$.value=!1,F.value=null}const L={centerX:g.value.width/2,centerY:g.value.height/2},C=i.filter(a=>!y.value.includes(a.id)).map(a=>a.value||0).reduce((a,o)=>a+o,0),M=i.map((a,o)=>({...a,proportion:(a.value||0)/C,value:a.value||0,absoluteValue:Z.value.dataset.find((k,f)=>`donut_${f}`===a.id).VALUE})),T=g.value.width/2,U=g.value.height/2,R=g.value.height*t.value.donutRadiusRatio;return{dataset:M.filter(a=>!y.value.includes(a.id)),legend:M,drawingArea:L,displayArcPercentage:v,isArcBigEnough:l,useTooltip:s,killTooltip:m,getSpaces:n,total:C,cx:T,cy:U,radius:R,chart:d.makeDonut({series:i.filter(a=>!y.value.includes(a.id))},T,U,R,R,1.99999,2,1,360,105.25,g.value.height*t.value.donutThicknessRatio)}}),p=e.ref({start:0,end:x.value.maxSeriesLength});function Ae(){p.value={start:0,end:x.value.maxSeriesLength},te.value+=1}const c=e.computed(()=>{if(E.value!==S.LINE)return null;const i={height:g.value.height,width:g.value.width},v={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:i.width-t.value.xyPaddingRight,bottom:i.height-t.value.xyPaddingBottom,width:i.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:i.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];q(x.value.dataset)&&(l=[{values:x.value.dataset.slice(p.value.start,p.value.end),absoluteIndices:x.value.dataset.map((a,o)=>o).slice(p.value.start,p.value.end),name:t.value.title,color:G.value[t.value.paletteStartIndex]||d.palette[t.value.paletteStartIndex],id:"line_0"}]),ie(x.value.dataset)&&(l=x.value.dataset.map((a,o)=>({...a,values:a.VALUE||a.DATA||a.SERIE||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?d.convertColorToHex(a.COLOR):G.value[o+t.value.paletteStartIndex]||d.palette[o+t.value.paletteStartIndex]||d.palette[(o+t.value.paletteStartIndex)%d.palette.length],values:a.values.slice(p.value.start,p.value.end),absoluteIndices:a.values.map((k,f)=>f).slice(p.value.start,p.value.end)})));const n={max:Math.max(...l.filter(a=>!y.value.includes(a.id)).flatMap(a=>a.values)),min:Math.min(...l.filter(a=>!y.value.includes(a.id)).flatMap(a=>a.values)),maxSeries:Math.max(...l.map(a=>a.values.length))},s=d.calculateNiceScale(n.min<0?n.min:0,n.max<0?0:n.max,t.value.xyScaleSegments),m=n.min<0?Math.abs(n.min):0,L=n.max<0?v.top:v.bottom-m/(s.max+m)*v.height,C=v.width/n.maxSeries,M=s.ticks.map(a=>({y:v.bottom-v.height*((a+m)/(s.max+m)),x:v.left-8,value:a})),T=l.map((a,o)=>({...a,coordinates:a.values.map((k,f)=>({x:v.left+C*(f+1)-C/2,y:v.bottom-(k+m)/(s.max+m)*v.height,value:k}))})).map(a=>{let o=[];return a.coordinates.forEach(k=>{o.push(`${k.x},${k.y} `)}),{...a,linePath:o.join(" ")}});function U(a){F.value=a;const o=l.map(f=>({...f,value:f.values[a],absoluteIndex:f.absoluteIndices[a]})).filter(f=>!y.value.includes(f.id));j.value={datapoint:o,seriesIndex:a,config:t.value,dataset:l};const k=t.value.tooltipCustomFormat;if(d.isFunction(k)&&d.functionReturnsString(()=>k({datapoint:o,seriesIndex:a,series:l,config:t.value})))P.value=k({datapoint:o,seriesIndex:a,series:l,config:t.value});else{let f="";t.value.xyPeriods[o[0].absoluteIndex]&&(f+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[o[0].absoluteIndex]}</div>`),o.forEach(_=>{f+=`
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="${_.color}"/></svg>
4
4
  <span>${_.name}:</span>
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BDKEFvEF.cjs"),H=require("./useResponsive-B3TrDDIG.cjs"),ie=require("./Title-XRMcJkna.cjs"),X=require("./usePrinter-DedM_6px.cjs"),ce=require("./Tooltip-COgv-iii.cjs"),de=require("./vue-ui-sparkbar-wLasc_jU.cjs"),ve=require("./Legend-BEMGbN0s.cjs"),pe=require("./DataTable-CGX9xKvm.cjs"),he=require("./vue-ui-skeleton-rY_nZhMQ.cjs"),ge=require("./vue-ui-accordion-BytUYLYl.cjs"),j=require("./useNestedProp-Dikfncsl.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=["id"],fe=["xmlns","viewBox"],ke=["id"],be=["stop-color"],Ce=["stop-color"],we={key:0},Be=["x1","y1","x2","y2","stroke","stroke-width"],_e={key:0},xe=["d","stroke","stroke-width"],$e=["d","stroke","stroke-width"],Pe={key:1},Te=["x","y","text-anchor","font-size","fill","onMouseenter"],Ne=["points","stroke","stroke-width"],Se=["points","stroke","stroke-width","fill"],Ee={key:2},Ve=["cx","cy","fill","r","stroke"],Fe=["onClick"],ze={key:0,style:{"max-width":"200px",margin:"0 auto"}},Oe={__name:"vue-ui-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(Y,{expose:J,emit:K}){const d=Y,{vue_ui_radar:Q}=n.useConfig(),k=e.computed(()=>!!d.dataset&&Object.keys(d.dataset).length),m=e.ref(n.createUid()),Z=e.ref(null),$=e.ref(!1),P=e.ref(""),F=e.ref(0),b=e.ref(null),z=e.ref(null),O=e.ref(null),t=e.computed(()=>{const o=j.useNestedProp({userConfig:d.config,defaultConfig:Q});return o.theme?{...j.useNestedProp({userConfig:n.themes.vue_ui_radar[o.theme]||d.config,defaultConfig:o}),customPalette:n.themePalettes[o.theme]||n.palette}:o}),B=e.ref(null);e.onMounted(()=>{if(n.objectIsEmpty(d.dataset)&&n.error({componentName:"VueUiRadar",type:"dataset"}),t.value.responsive){const o=H.throttle(()=>{const{width:a,height:l}=H.useResponsive({chart:b.value,title:t.value.style.chart.title.text?z.value:null,legend:t.value.style.chart.legend.show?O.value:null});s.value.width=a,s.value.height=l});B.value=new ResizeObserver(o),B.value.observe(b.value.parentNode)}}),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:ee,isImaging:te,generatePdf:A,generateImage:I}=X.usePrinter({elementId:`vue-ui-radar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-radar"}),L=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),h=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),oe=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 R(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)),K("selectLegend",f.value.filter((a,l)=>!i.value.includes(l)).map(a=>({name:a.name,color:a.color,proportion:a.totalProportion})))}function ae(){return f.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)||L.value[a]||n.palette[a]||n.palette[a%n.palette.length],prefix:o.prefix??"",suffix:o.suffix??""})))),p=e.computed(()=>k.value?d.dataset.series.map((o,a)=>({...o,color:n.convertColorToHex(o.color)||L.value[a]||n.palette[a]||n.palette[a%n.palette.length],serieId:`radar_serie_${m.value}_${a}`})):[]),M=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),D=e.computed(()=>n.createPolygonPath({plot:{x:s.value.width/2,y:s.value.height/2},radius:T.value,sides:q.value,rotation:0})),le=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}),g=e.computed(()=>D.value.coordinates.map((o,a)=>{const l=p.value[a].values.map(r=>re({centerX:s.value.width/2,centerY:s.value.height/2,apexX:o.x,apexY:o.y,proportion:r/(p.value[a].target||M.value)}));return{...o,...p.value[a],plots:l}}));function N({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 re({centerX:o,centerY:a,apexX:l,apexY:r,proportion:u}){return{x:o+(l-o)*u,y:a+(r-a)*u}}const f=e.computed(()=>{const o=p.value.map((a,l)=>a.values.map(r=>r/(a.target||M.value)));return v.value.map((a,l)=>({...a,totalProportion:o.map(r=>r[l]).reduce((r,u)=>r+u,0)/p.value.length,shape:"circle",opacity:i.value.includes(l)?.5:1,segregate:()=>R(l),isSegregated:i.value.includes(l)}))}),ne=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:""},...f.value],a=d.dataset.series.map(r=>[r.name,r.target,...r.values.map((u,c)=>`${n.dataLabel({p:v.value[c].prefix,v:u,s:v.value[c].suffix,r:t.value.table.td.roundingValue})} (${isNaN(u/r.target)?"":(u/r.target*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};return{head:o,body:a,config:l,colNames:o}}),x=e.ref(null),S=e.ref([]),E=e.ref(null);function ue(o,a){S.value=[],x.value=a,$.value=!0;let l="";E.value={datapoint:o,seriesIndex:a,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value};const r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value})))P.value=r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value});else{l+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`;for(let u=0;u<o.values.length;u+=1)i.value.includes(u)||S.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});P.value=l}}function U(){e.nextTick(()=>{const o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=[[""],[t.value.translations.target],...f.value.flatMap(c=>[[c.name],["%"]])],l=d.dataset.series.map((c,Ie)=>[c.name,c.target,...c.values.flatMap(V=>[V,isNaN(V/c.target)?"":V/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 se(o){w.value=o,F.value+=1}function G(){h.value.showTable=!h.value.showTable}function W(){h.value.showTooltip=!h.value.showTooltip}return J({getData:ae,generatePdf:A,generateCsv:U,generateImage:I,toggleTable:G,toggleTooltip:W}),(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:b,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;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:z,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(ie._sfc_main,{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"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&k.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref_key:"details",ref:Z,key:`user_options_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(te),isPrinting:e.unref(ee),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:h.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,onToggleFullscreen:se,onGeneratePdf:e.unref(A),onGenerateCsv:U,onGenerateImage:e.unref(I),onToggleTable:G,onToggleTooltip:W},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]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:2,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:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(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.shiftHue)(l.color,.05)}${e.unref(n.opacity)[t.value.style.chart.layout.dataPolygon.opacity]}`},null,8,be),e.createElementVNode("stop",{offset:"100%","stop-color":l.color+e.unref(n.opacity)[t.value.style.chart.layout.dataPolygon.opacity]},null,8,Ce)],8,ke))),256))]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.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,Be))),256)),t.value.style.chart.layout.grid.graduations>0?(e.openBlock(),e.createElementBlock("g",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(le.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,xe))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:D.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,$e),t.value.style.chart.layout.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:N(l).x,y:N(l).y,"text-anchor":N(l).anchor,"font-size":t.value.style.chart.layout.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.labels.dataLabels.color,onMouseenter:u=>ue(l,r),onMouseleave:a[0]||(a[0]=u=>{$.value=!1,x.value=null})},e.toDisplayString(l.name),41,Te))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("g",null,[t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:0,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(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,Ne)):e.createCommentVNode("",!0),t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:1,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(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})`:l.color+e.unref(n.opacity)[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,Se)):e.createCommentVNode("",!0)])]))),256)),t.value.style.chart.layout.plots.show?(e.openBlock(),e.createElementBlock("g",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(u,c)=>(e.openBlock(),e.createElementBlock("circle",{cx:u.x,cy:u.y,fill:i.value.includes(c)?"transparent":v.value[c].color,r:x.value!==null&&x.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,Ve))),256))]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:s.value},void 0,!0)],14,fe)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(he.default,{key:3,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:O},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(ve.Legend,{key:0,legendSet:f.value,config:ne.value,onClickMarker:a[1]||(a[1]=({i:l})=>R(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((l.totalProportion*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"% ",13,Fe)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:f.value},void 0,!0)],512),e.createVNode(ce._sfc_main,{show:h.value.showTooltip&&$.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,parent:b.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({...E.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",ze,[e.createVNode(de.default,{dataset:S.value,config:oe.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity},null,8,["dataset","config","backgroundOpacity"])])),e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...E.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","fontSize","parent","content","isCustom"]),k.value?(e.openBlock(),e.createBlock(ge.default,{key:4,hideDetails:"",config:{open:h.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(pe.DataTable,{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=>h.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name),1)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ye))}},Ae=me._export_sfc(Oe,[["__scopeId","data-v-f89a8c0a"]]);exports.default=Ae;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index--K6Ja9Gj.cjs"),H=require("./useResponsive-B3TrDDIG.cjs"),ie=require("./Title-DpgU75bw.cjs"),X=require("./usePrinter-CysnJve5.cjs"),ce=require("./Tooltip-B2BLFWIv.cjs"),de=require("./vue-ui-sparkbar-BaqyijV1.cjs"),ve=require("./Legend-BEEbv4va.cjs"),pe=require("./DataTable-DQGTnBUl.cjs"),he=require("./vue-ui-skeleton-Bf_PLiHN.cjs"),ge=require("./vue-ui-accordion-B0UeLf1b.cjs"),j=require("./useNestedProp-Bs4c78Cx.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=["id"],fe=["xmlns","viewBox"],ke=["id"],be=["stop-color"],Ce=["stop-color"],we={key:0},Be=["x1","y1","x2","y2","stroke","stroke-width"],_e={key:0},xe=["d","stroke","stroke-width"],$e=["d","stroke","stroke-width"],Pe={key:1},Te=["x","y","text-anchor","font-size","fill","onMouseenter"],Ne=["points","stroke","stroke-width"],Se=["points","stroke","stroke-width","fill"],Ee={key:2},Ve=["cx","cy","fill","r","stroke"],Fe=["onClick"],ze={key:0,style:{"max-width":"200px",margin:"0 auto"}},Oe={__name:"vue-ui-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(Y,{expose:J,emit:K}){const d=Y,{vue_ui_radar:Q}=n.useConfig(),k=e.computed(()=>!!d.dataset&&Object.keys(d.dataset).length),m=e.ref(n.createUid()),Z=e.ref(null),$=e.ref(!1),P=e.ref(""),F=e.ref(0),b=e.ref(null),z=e.ref(null),O=e.ref(null),t=e.computed(()=>{const o=j.useNestedProp({userConfig:d.config,defaultConfig:Q});return o.theme?{...j.useNestedProp({userConfig:n.themes.vue_ui_radar[o.theme]||d.config,defaultConfig:o}),customPalette:n.themePalettes[o.theme]||n.palette}:o}),B=e.ref(null);e.onMounted(()=>{if(n.objectIsEmpty(d.dataset)&&n.error({componentName:"VueUiRadar",type:"dataset"}),t.value.responsive){const o=H.throttle(()=>{const{width:a,height:l}=H.useResponsive({chart:b.value,title:t.value.style.chart.title.text?z.value:null,legend:t.value.style.chart.legend.show?O.value:null});s.value.width=a,s.value.height=l});B.value=new ResizeObserver(o),B.value.observe(b.value.parentNode)}}),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:ee,isImaging:te,generatePdf:A,generateImage:I}=X.usePrinter({elementId:`vue-ui-radar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-radar"}),L=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),h=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),oe=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 R(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)),K("selectLegend",f.value.filter((a,l)=>!i.value.includes(l)).map(a=>({name:a.name,color:a.color,proportion:a.totalProportion})))}function ae(){return f.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)||L.value[a]||n.palette[a]||n.palette[a%n.palette.length],prefix:o.prefix??"",suffix:o.suffix??""})))),p=e.computed(()=>k.value?d.dataset.series.map((o,a)=>({...o,color:n.convertColorToHex(o.color)||L.value[a]||n.palette[a]||n.palette[a%n.palette.length],serieId:`radar_serie_${m.value}_${a}`})):[]),M=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),D=e.computed(()=>n.createPolygonPath({plot:{x:s.value.width/2,y:s.value.height/2},radius:T.value,sides:q.value,rotation:0})),le=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}),g=e.computed(()=>D.value.coordinates.map((o,a)=>{const l=p.value[a].values.map(r=>re({centerX:s.value.width/2,centerY:s.value.height/2,apexX:o.x,apexY:o.y,proportion:r/(p.value[a].target||M.value)}));return{...o,...p.value[a],plots:l}}));function N({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 re({centerX:o,centerY:a,apexX:l,apexY:r,proportion:u}){return{x:o+(l-o)*u,y:a+(r-a)*u}}const f=e.computed(()=>{const o=p.value.map((a,l)=>a.values.map(r=>r/(a.target||M.value)));return v.value.map((a,l)=>({...a,totalProportion:o.map(r=>r[l]).reduce((r,u)=>r+u,0)/p.value.length,shape:"circle",opacity:i.value.includes(l)?.5:1,segregate:()=>R(l),isSegregated:i.value.includes(l)}))}),ne=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:""},...f.value],a=d.dataset.series.map(r=>[r.name,r.target,...r.values.map((u,c)=>`${n.dataLabel({p:v.value[c].prefix,v:u,s:v.value[c].suffix,r:t.value.table.td.roundingValue})} (${isNaN(u/r.target)?"":(u/r.target*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};return{head:o,body:a,config:l,colNames:o}}),x=e.ref(null),S=e.ref([]),E=e.ref(null);function ue(o,a){S.value=[],x.value=a,$.value=!0;let l="";E.value={datapoint:o,seriesIndex:a,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value};const r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value})))P.value=r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:g.value},config:t.value});else{l+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`;for(let u=0;u<o.values.length;u+=1)i.value.includes(u)||S.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});P.value=l}}function U(){e.nextTick(()=>{const o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=[[""],[t.value.translations.target],...f.value.flatMap(c=>[[c.name],["%"]])],l=d.dataset.series.map((c,Ie)=>[c.name,c.target,...c.values.flatMap(V=>[V,isNaN(V/c.target)?"":V/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 se(o){w.value=o,F.value+=1}function G(){h.value.showTable=!h.value.showTable}function W(){h.value.showTooltip=!h.value.showTooltip}return J({getData:ae,generatePdf:A,generateCsv:U,generateImage:I,toggleTable:G,toggleTooltip:W}),(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:b,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;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:z,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:12px`)},[e.createVNode(ie._sfc_main,{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"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&k.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref_key:"details",ref:Z,key:`user_options_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(te),isPrinting:e.unref(ee),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:h.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,onToggleFullscreen:se,onGeneratePdf:e.unref(A),onGenerateCsv:U,onGenerateImage:e.unref(I),onToggleTable:G,onToggleTooltip:W},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]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:2,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:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(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.shiftHue)(l.color,.05)}${e.unref(n.opacity)[t.value.style.chart.layout.dataPolygon.opacity]}`},null,8,be),e.createElementVNode("stop",{offset:"100%","stop-color":l.color+e.unref(n.opacity)[t.value.style.chart.layout.dataPolygon.opacity]},null,8,Ce)],8,ke))),256))]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.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,Be))),256)),t.value.style.chart.layout.grid.graduations>0?(e.openBlock(),e.createElementBlock("g",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(le.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,xe))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:D.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,$e),t.value.style.chart.layout.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:N(l).x,y:N(l).y,"text-anchor":N(l).anchor,"font-size":t.value.style.chart.layout.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.labels.dataLabels.color,onMouseenter:u=>ue(l,r),onMouseleave:a[0]||(a[0]=u=>{$.value=!1,x.value=null})},e.toDisplayString(l.name),41,Te))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("g",null,[t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:0,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(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,Ne)):e.createCommentVNode("",!0),t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:1,"data-cy-radar-path":"",points:e.unref(n.makePath)(g.value.map(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})`:l.color+e.unref(n.opacity)[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,Se)):e.createCommentVNode("",!0)])]))),256)),t.value.style.chart.layout.plots.show?(e.openBlock(),e.createElementBlock("g",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(u,c)=>(e.openBlock(),e.createElementBlock("circle",{cx:u.x,cy:u.y,fill:i.value.includes(c)?"transparent":v.value[c].color,r:x.value!==null&&x.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,Ve))),256))]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:s.value},void 0,!0)],14,fe)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(he.default,{key:3,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:O},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(ve.Legend,{key:0,legendSet:f.value,config:ne.value,onClickMarker:a[1]||(a[1]=({i:l})=>R(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((l.totalProportion*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"% ",13,Fe)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:f.value},void 0,!0)],512),e.createVNode(ce._sfc_main,{show:h.value.showTooltip&&$.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,parent:b.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({...E.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",ze,[e.createVNode(de.default,{dataset:S.value,config:oe.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity},null,8,["dataset","config","backgroundOpacity"])])),e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...E.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","fontSize","parent","content","isCustom"]),k.value?(e.openBlock(),e.createBlock(ge.default,{key:4,hideDetails:"",config:{open:h.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(pe.DataTable,{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=>h.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name),1)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ye))}},Ae=me._export_sfc(Oe,[["__scopeId","data-v-f89a8c0a"]]);exports.default=Ae;
@@ -1,15 +1,15 @@
1
1
  import { computed as v, ref as i, onMounted as Ae, onBeforeUnmount as Se, openBlock as s, createElementBlock as n, normalizeClass as z, normalizeStyle as V, createVNode as E, createCommentVNode as p, createBlock as B, unref as y, createSlots as ze, withCtx as f, renderSlot as b, normalizeProps as J, guardReactiveProps as Y, createElementVNode as w, Fragment as $, renderList as x, toDisplayString as L, createTextVNode as de, nextTick as Le } from "vue";
2
- import { u as Re, c as Me, t as Ue, a as Ve, p as P, o as Ee, e as N, b as Be, g as ve, d as he, I as ge, f as pe, X as De, s as Ge, r as K, J as ye, v as We, w as Xe, n as je, q as qe } from "./index-ByO3Ywek.js";
2
+ import { u as Re, c as Me, t as Ue, a as Ve, p as P, o as Ee, e as N, b as Be, g as ve, d as he, I as ge, f as pe, X as De, s as Ge, r as K, J as ye, v as We, w as Xe, n as je, q as qe } from "./index-8jKJqifI.js";
3
3
  import { t as He, u as Je } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as Ye } from "./Title-BSpLzDC1.js";
5
- import { u as Ke, U as Qe } from "./usePrinter-Dda5FBG3.js";
6
- import { _ as Ze } from "./Tooltip-DI8_Wjjy.js";
7
- import et from "./vue-ui-sparkbar-BDSuCvBs.js";
8
- import { L as tt } from "./Legend-C4cCpb4z.js";
9
- import { D as at } from "./DataTable-Bza1ed62.js";
10
- import ot from "./vue-ui-skeleton-BxRSQeuo.js";
11
- import lt from "./vue-ui-accordion-CbKHVPHh.js";
12
- import { u as fe } from "./useNestedProp-Da77DnaA.js";
4
+ import { _ as Ye } from "./Title-2ab2u_K8.js";
5
+ import { u as Ke, U as Qe } from "./usePrinter-BZ_nWqN_.js";
6
+ import { _ as Ze } from "./Tooltip-mW2mhj5b.js";
7
+ import et from "./vue-ui-sparkbar-DQSTdQ1V.js";
8
+ import { L as tt } from "./Legend-CwT-9P7R.js";
9
+ import { D as at } from "./DataTable-cwJyYtAp.js";
10
+ import ot from "./vue-ui-skeleton-CxbgzdoX.js";
11
+ import lt from "./vue-ui-accordion-BsXo1_Ap.js";
12
+ import { u as fe } from "./useNestedProp-R6UMUTVL.js";
13
13
  import { _ as rt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
14
  const st = ["id"], nt = ["xmlns", "viewBox"], ut = ["id"], it = ["stop-color"], ct = ["stop-color"], dt = { key: 0 }, vt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], ht = { key: 0 }, gt = ["d", "stroke", "stroke-width"], pt = ["d", "stroke", "stroke-width"], yt = { key: 1 }, ft = ["x", "y", "text-anchor", "font-size", "fill", "onMouseenter"], mt = ["points", "stroke", "stroke-width"], bt = ["points", "stroke", "stroke-width", "fill"], kt = { key: 2 }, Ct = ["cx", "cy", "fill", "r", "stroke"], _t = ["onClick"], wt = {
15
15
  key: 0,
@@ -1,6 +1,6 @@
1
1
  import { ref as f, computed as $, onMounted as G, openBlock as l, createElementBlock as i, normalizeStyle as a, createElementVNode as n, toDisplayString as p, createCommentVNode as d, Fragment as E, renderList as L, unref as m, withKeys as U, createTextVNode as D } from "vue";
2
- import { u as K, c as T, o as H, e as P, X as _, s as N, O as F } from "./index-ByO3Ywek.js";
3
- import { u as W } from "./useNestedProp-Da77DnaA.js";
2
+ import { u as K, c as T, o as H, e as P, X as _, s as N, O as F } from "./index-8jKJqifI.js";
3
+ import { u as W } from "./useNestedProp-R6UMUTVL.js";
4
4
  import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
5
  const J = {
6
6
  key: 0,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BDKEFvEF.cjs"),C=require("./useNestedProp-Dikfncsl.cjs"),V=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},F=["src","height","width"],A=["xmlns","height","width"],D=["id"],R=["stop-color"],X=["stop-color"],j=["points","fill","stroke","stroke-width"],I=["src","alt","height","width","id"],O=["xmlns","viewBox","height","id"],Y=["id"],G=["stop-color"],L=["stop-color"],q=["points","fill","stroke"],T=["xmlns","height"],U=["onClick","onMouseenter","onKeyup"],H=["onMouseenter"],K={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup($,{expose:k,emit:S}){const s=$,{vue_ui_rating:_}=n.useConfig(),d=e.ref(n.createUid()),p=e.ref(!1),r=e.ref(void 0),g=e.ref([]),t=e.computed(()=>C.useNestedProp({userConfig:s.config,defaultConfig:_})),b=e.computed(()=>typeof s.dataset.rating=="object"&&!Array.isArray(s.dataset.rating)?z(s.dataset.rating):s.dataset.rating),N=e.computed(()=>typeof s.dataset.rating=="object"&&!Array.isArray(s.dataset.rating)),i=e.ref(b.value),f=e.ref(t.value.type==="image"),c=e.ref(t.value.readonly);function z(o){let a=0,l=0;for(const u in o){const E=parseInt(u),h=o[u];a+=E*h,l+=h}if(l===0)return 0;const v=a/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{n.objectIsEmpty(s.dataset)&&n.error({componentName:"VueUiRating",type:"dataset"});for(let o=t.value.from;o<=t.value.to;o+=1)g.value.push(o)});function y(o,a=!1){return o>r.value||c.value?a?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:a?1:t.value.style.star.useGradient?`url(#star_gradient_under_${d.value})`:t.value.style.star.activeColor}function m(o,a=!1){const l=i.value-o,v=a?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function x(o){c.value||(i.value=o,S("rate",o))}function w(){return i.value}function B(o=!0){c.value=o}return k({getData:w,toggleReadonly:B}),(o,a)=>(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:a[2]||(a[2]=l=>p.value=!0),onMouseleave:a[3]||(a[3]=l=>{p.value=!1,r.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(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),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(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.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`)},[f.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(r.value)?t.value.style.image.inactiveOpacity:y(l,!0)}`)},null,12,F)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.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(n.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,R),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,X)],8,D)]),e.createElementVNode("polygon",{points:e.unref(n.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(r.value)?t.value.style.star.inactiveColor:y(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:r.value?y(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,j)],8,A)),f.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,${m(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,I)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${m(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(n.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,L)],8,Y)]),e.createElementVNode("polygon",{points:e.unref(n.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,q)],8,O)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(n.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=>x(l),onMouseenter:u=>r.value=l,onMouseleave:a[0]||(a[0]=u=>r.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>x(l),["enter"])},null,40,U)),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=>r.value=l,onMouseleave:a[1]||(a[1]=u=>r.value=void 0)},null,40,H)):e.createCommentVNode("",!0)],12,T)),t.value.style.tooltip.show&&N.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${r.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.createTextVNode(" : "),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(s.dataset.rating[l]),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(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),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(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0)],36))}},P=V._export_sfc(K,[["__scopeId","data-v-86ced882"]]);exports.default=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index--K6Ja9Gj.cjs"),C=require("./useNestedProp-Bs4c78Cx.cjs"),V=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},F=["src","height","width"],A=["xmlns","height","width"],D=["id"],R=["stop-color"],X=["stop-color"],j=["points","fill","stroke","stroke-width"],I=["src","alt","height","width","id"],O=["xmlns","viewBox","height","id"],Y=["id"],G=["stop-color"],L=["stop-color"],q=["points","fill","stroke"],T=["xmlns","height"],U=["onClick","onMouseenter","onKeyup"],H=["onMouseenter"],K={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup($,{expose:k,emit:S}){const s=$,{vue_ui_rating:_}=n.useConfig(),d=e.ref(n.createUid()),p=e.ref(!1),r=e.ref(void 0),g=e.ref([]),t=e.computed(()=>C.useNestedProp({userConfig:s.config,defaultConfig:_})),b=e.computed(()=>typeof s.dataset.rating=="object"&&!Array.isArray(s.dataset.rating)?z(s.dataset.rating):s.dataset.rating),N=e.computed(()=>typeof s.dataset.rating=="object"&&!Array.isArray(s.dataset.rating)),i=e.ref(b.value),f=e.ref(t.value.type==="image"),c=e.ref(t.value.readonly);function z(o){let a=0,l=0;for(const u in o){const E=parseInt(u),h=o[u];a+=E*h,l+=h}if(l===0)return 0;const v=a/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{n.objectIsEmpty(s.dataset)&&n.error({componentName:"VueUiRating",type:"dataset"});for(let o=t.value.from;o<=t.value.to;o+=1)g.value.push(o)});function y(o,a=!1){return o>r.value||c.value?a?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:a?1:t.value.style.star.useGradient?`url(#star_gradient_under_${d.value})`:t.value.style.star.activeColor}function m(o,a=!1){const l=i.value-o,v=a?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function x(o){c.value||(i.value=o,S("rate",o))}function w(){return i.value}function B(o=!0){c.value=o}return k({getData:w,toggleReadonly:B}),(o,a)=>(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:a[2]||(a[2]=l=>p.value=!0),onMouseleave:a[3]||(a[3]=l=>{p.value=!1,r.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(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),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(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.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`)},[f.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(r.value)?t.value.style.image.inactiveOpacity:y(l,!0)}`)},null,12,F)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.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(n.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,R),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,X)],8,D)]),e.createElementVNode("polygon",{points:e.unref(n.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(r.value)?t.value.style.star.inactiveColor:y(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:r.value?y(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,j)],8,A)),f.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,${m(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,I)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${m(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(n.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,L)],8,Y)]),e.createElementVNode("polygon",{points:e.unref(n.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,q)],8,O)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(n.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=>x(l),onMouseenter:u=>r.value=l,onMouseleave:a[0]||(a[0]=u=>r.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>x(l),["enter"])},null,40,U)),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=>r.value=l,onMouseleave:a[1]||(a[1]=u=>r.value=void 0)},null,40,H)):e.createCommentVNode("",!0)],12,T)),t.value.style.tooltip.show&&N.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${r.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.createTextVNode(" : "),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(s.dataset.rating[l]),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(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),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(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0)],36))}},P=V._export_sfc(K,[["__scopeId","data-v-86ced882"]]);exports.default=P;
@@ -1,10 +1,10 @@
1
1
  import { useCssVars as ge, computed as c, ref as u, onMounted as he, onBeforeUnmount as ye, openBlock as a, createElementBlock as o, normalizeStyle as g, createVNode as me, createCommentVNode as C, createBlock as W, unref as _, createSlots as ke, withCtx as E, renderSlot as b, normalizeProps as _e, guardReactiveProps as pe, normalizeClass as z, createElementVNode as $e, Fragment as w, renderList as O, toDisplayString as xe } from "vue";
2
- import { u as Ce, c as be, t as we, a as Oe, p as X, b as Pe, o as Ae, e as Y, g as Ie, X as Fe } from "./index-ByO3Ywek.js";
2
+ import { u as Ce, c as be, t as we, a as Oe, p as X, b as Pe, o as Ae, e as Y, g as Ie, X as Fe } from "./index-8jKJqifI.js";
3
3
  import { t as Ee, u as ze } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as Le } from "./Title-BSpLzDC1.js";
5
- import { u as Ne, U as Re } from "./usePrinter-Dda5FBG3.js";
6
- import Se from "./vue-ui-skeleton-BxRSQeuo.js";
7
- import { u as q } from "./useNestedProp-Da77DnaA.js";
4
+ import { _ as Le } from "./Title-2ab2u_K8.js";
5
+ import { u as Ne, U as Re } from "./usePrinter-BZ_nWqN_.js";
6
+ import Se from "./vue-ui-skeleton-CxbgzdoX.js";
7
+ import { u as q } from "./useNestedProp-R6UMUTVL.js";
8
8
  import { _ as Te } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
9
  const Me = ["id"], je = ["xmlns", "viewBox"], Be = ["cx", "cy", "r", "stroke", "stroke-width"], Ge = { key: 0 }, Ue = ["stroke", "d", "stroke-width"], De = { key: 1 }, Ve = ["stroke", "x1", "x2", "y1", "y2"], We = ["text-anchor", "transform", "x", "y", "onClick", "font-weight", "font-size", "fill"], Xe = ["cx", "cy", "fill", "onClick", "r"], Ye = {
10
10
  __name: "vue-ui-relation-circle",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BDKEFvEF.cjs"),N=require("./useResponsive-B3TrDDIG.cjs"),re=require("./Title-XRMcJkna.cjs"),L=require("./usePrinter-DedM_6px.cjs"),ne=require("./vue-ui-skeleton-rY_nZhMQ.cjs"),T=require("./useNestedProp-Dikfncsl.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),se=["id"],ae=["xmlns","viewBox"],oe=["cx","cy","r","stroke","stroke-width"],ue={key:0},ce=["stroke","d","stroke-width"],de={key:1},ve=["stroke","x1","x2","y1","y2"],fe=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],ge=["cx","cy","fill","onClick","r"],ye={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(R,{expose:M}){const c=R;e.useCssVars(t=>({"69fb0529":W.value,"3158da88":D.value,"2b571f2c":X.value}));const{vue_ui_relation_circle:V}=o.useConfig(),p=e.computed(()=>!!c.dataset&&Object.keys(c.dataset).length),f=e.ref(o.createUid()),$=e.ref(0),m=e.ref(null),b=e.ref(null),r=e.computed(()=>{const t=T.useNestedProp({userConfig:c.config,defaultConfig:V});return t.theme?{...T.useNestedProp({userConfig:o.themes.vue_ui_relation_circle[t.theme]||c.config,defaultConfig:t}),customPalette:o.themePalettes[t.theme]||o.palette}:t}),{isPrinting:j,isImaging:q,generatePdf:w,generateImage:B}=L.usePrinter({elementId:`relation_circle_${f.value}`,fileName:r.value.style.title.text||"vue-ui-relation-circle"}),P=e.computed(()=>o.convertCustomPalette(r.value.customPalette)),v=e.ref([]),g=e.ref([]),s=e.ref({}),u=e.ref([]),G=e.ref(0),_=e.computed(()=>c.dataset.slice(0,r.value.style.limit)),x=e.ref(r.value.style.size),a=e.ref({height:r.value.style.size,width:r.value.style.size}),d=e.computed({get(){return x.value*r.value.style.circle.radiusProportion},set(t){return t}}),U=e.computed(()=>r.value.style.links.curved),D=e.computed(()=>`${r.value.style.animation.speedMs}ms`),W=e.computed(()=>d.value*2),X=e.computed(()=>d.value*4),h=e.ref(null);e.onMounted(()=>{if(o.objectIsEmpty(c.dataset)?o.error({componentName:"VueUiRelationCircle",type:"dataset"}):c.dataset.forEach((i,l)=>{o.getMissingDatasetAttributes({datasetObject:i,requiredAttributes:["id","label","relations","weights"]}).forEach(n=>{o.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:n,index:l})})}),r.value.responsive){const i=N.throttle(()=>{const{width:l,height:n}=N.useResponsive({chart:m.value,title:r.value.style.title.text?b.value:null});x.value=Math.min(l,n),a.value.width=l,a.value.height=n,d.value=x.value*r.value.style.circle.radiusProportion,v.value=[],g.value=[],E(),A()});h.value=new ResizeObserver(i),h.value.observe(m.value.parentNode)}else E(),A();document.getElementById(`relation_circle_${f.value}`).addEventListener("click",O)}),e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${f.value}`).removeEventListener("click",O),h.value&&h.value.disconnect()});function O(t){const i=t.target;i&&Array.from(i.classList).includes("vue-ui-user-options")||i&&Array.from(i.classList).includes("vue-ui-user-options-summary")||i&&Array.from(i.classList).includes("vue-data-ui-button")||i&&Array.from(i.classList).includes("vue-ui-relation-circle-legend")||(s.value={},u.value=[])}function E(){const t=6.28319/_.value.length,i=360/_.value.length;let l=0,n=0;_.value.forEach((y,C)=>{const te=d.value*Math.cos(l)+a.value.width/2,le=d.value*Math.sin(l)+a.value.height/2+r.value.style.circle.offsetY;v.value.push({x:te,y:le,...y,color:y.color?y.color:P.value[C]?P.value[C]:o.palette[C],regAngle:n}),l+=t,n+=i})}function A(){v.value.forEach(t=>{v.value.filter(l=>l.relations.includes(t.id)).forEach((l,n)=>{g.value.push({weight:t.weights&&t.weights[n]?t.weights[n]: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 Y=e.computed(()=>Math.max(...g.value.map(t=>t.weight)));function H(t){return Object.hasOwn(s.value,"x")?u.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function I(t){return Object.hasOwn(s.value,"x")?t.colorTarget:t.colorSource}function S(t){return Object.hasOwn(s.value,"x")?u.value.includes(t.id)&&t.relationId===`${t.id}_${s.value.id}`||t.relationId===`${s.value.id}_${t.id}`?`opacity:1;stroke-width:${F(t)}`:"opacity: 0":"opacity: 1"}function J(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function K(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function Q(t){return Object.hasOwn(s.value,"x")?s.value.id===t.id||u.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function Z(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function z(t){G.value=360-t.regAngle,s.value.id&&t.id===s.value.id?(s.value={},u.value=[]):(s.value=t,u.value=[...t.relations])}function F(t){return t.weight/Y.value*r.value.style.links.maxWidth}const k=e.ref(!1);function ee(t){k.value=t,$.value+=1}return M({generatePdf:w,generateImage:B}),(t,i)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:m,class:"vue-ui-relation-circle",style:e.normalizeStyle(`width:100%;background:${r.value.style.backgroundColor};text-align:center;${r.value.responsive?"height: 100%":""}`),id:`relation_circle_${f.value}`},[r.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:b,style:e.normalizeStyle(`width:100%;background:${r.value.style.backgroundColor}`)},[e.createVNode(re._sfc_main,{config:{title:{cy:"relation-div-title",...r.value.style.title},subtitle:{cy:"relation-div-subtitle",...r.value.style.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),r.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(L.UserOptions,{ref:"details",key:`user_options_${$.value}`,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,isPrinting:e.unref(j),isImaging:e.unref(q),uid:f.value,hasPdf:r.value.userOptions.buttons.pdf,hasImg:r.value.userOptions.buttons.img,hasFullscreen:r.value.userOptions.buttons.img,hasXls:!1,isFullscreen:k.value,titles:{...r.value.userOptions.buttonTitles},chartElement:m.value,onToggleFullscreen:ee,onGeneratePdf:e.unref(w),onGenerateImage:e.unref(B)},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:n})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:n})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value},"relation-circle"]),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,width:"100%",style:e.normalizeStyle(`user-select:none; background:${r.value.style.backgroundColor}`)},[e.createElementVNode("circle",{cx:(a.value.width<=0?1e-4:a.value.width)/2,cy:(a.value.height<=0?1e-4:a.value.height)/2+r.value.style.circle.offsetY,r:d.value<=0?1e-4:d.value,stroke:r.value.style.circle.stroke,"stroke-width":r.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,oe),U.value?(e.openBlock(),e.createElementBlock("g",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,n)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${n}`,style:e.normalizeStyle(S(l)),stroke:I(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":s.value.hasOwnProperty("id")&&u.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${a.value.width/2},${a.value.height/2+r.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":F(l),"stroke-linecap":"round"},null,14,ce))),128))])):(e.openBlock(),e.createElementBlock("g",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,n)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${n}`,stroke:I(l),style:e.normalizeStyle(S(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":s.value.hasOwnProperty("id")&&u.value.includes(l.id)}),"stroke-linecap":"round"},null,14,ve))),128))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,n)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${n}`,"text-anchor":J(l),transform:Z(l),x:K(l),y:l.y+5,onClick:y=>z(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":s.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${r.value.style.fontFamily};${Q(l)}`),"font-size":r.value.style.labels.fontSize,fill:r.value.style.labels.color},e.toDisplayString(l.label),13,fe))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,n)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${n}`,style:e.normalizeStyle(H(l)),class:"vue-ui-relation-circle-plot",fill:r.value.style.plot.color,onClick:y=>z(l),r:r.value.style.plot.radius},null,12,ge))),128)),e.renderSlot(t.$slots,"svg",{svg:a.value},void 0,!0)],14,ae)):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ne.default,{key:3,config:{type:"relationCircle",style:{backgroundColor:r.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],12,se))}},me=ie._export_sfc(ye,[["__scopeId","data-v-44982e30"]]);exports.default=me;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index--K6Ja9Gj.cjs"),N=require("./useResponsive-B3TrDDIG.cjs"),re=require("./Title-DpgU75bw.cjs"),L=require("./usePrinter-CysnJve5.cjs"),ne=require("./vue-ui-skeleton-Bf_PLiHN.cjs"),T=require("./useNestedProp-Bs4c78Cx.cjs"),ie=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),se=["id"],ae=["xmlns","viewBox"],oe=["cx","cy","r","stroke","stroke-width"],ue={key:0},ce=["stroke","d","stroke-width"],de={key:1},ve=["stroke","x1","x2","y1","y2"],fe=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],ge=["cx","cy","fill","onClick","r"],ye={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(R,{expose:M}){const c=R;e.useCssVars(t=>({"69fb0529":W.value,"3158da88":D.value,"2b571f2c":X.value}));const{vue_ui_relation_circle:V}=o.useConfig(),p=e.computed(()=>!!c.dataset&&Object.keys(c.dataset).length),f=e.ref(o.createUid()),$=e.ref(0),m=e.ref(null),b=e.ref(null),r=e.computed(()=>{const t=T.useNestedProp({userConfig:c.config,defaultConfig:V});return t.theme?{...T.useNestedProp({userConfig:o.themes.vue_ui_relation_circle[t.theme]||c.config,defaultConfig:t}),customPalette:o.themePalettes[t.theme]||o.palette}:t}),{isPrinting:j,isImaging:q,generatePdf:w,generateImage:B}=L.usePrinter({elementId:`relation_circle_${f.value}`,fileName:r.value.style.title.text||"vue-ui-relation-circle"}),P=e.computed(()=>o.convertCustomPalette(r.value.customPalette)),v=e.ref([]),g=e.ref([]),s=e.ref({}),u=e.ref([]),G=e.ref(0),_=e.computed(()=>c.dataset.slice(0,r.value.style.limit)),x=e.ref(r.value.style.size),a=e.ref({height:r.value.style.size,width:r.value.style.size}),d=e.computed({get(){return x.value*r.value.style.circle.radiusProportion},set(t){return t}}),U=e.computed(()=>r.value.style.links.curved),D=e.computed(()=>`${r.value.style.animation.speedMs}ms`),W=e.computed(()=>d.value*2),X=e.computed(()=>d.value*4),h=e.ref(null);e.onMounted(()=>{if(o.objectIsEmpty(c.dataset)?o.error({componentName:"VueUiRelationCircle",type:"dataset"}):c.dataset.forEach((i,l)=>{o.getMissingDatasetAttributes({datasetObject:i,requiredAttributes:["id","label","relations","weights"]}).forEach(n=>{o.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:n,index:l})})}),r.value.responsive){const i=N.throttle(()=>{const{width:l,height:n}=N.useResponsive({chart:m.value,title:r.value.style.title.text?b.value:null});x.value=Math.min(l,n),a.value.width=l,a.value.height=n,d.value=x.value*r.value.style.circle.radiusProportion,v.value=[],g.value=[],E(),A()});h.value=new ResizeObserver(i),h.value.observe(m.value.parentNode)}else E(),A();document.getElementById(`relation_circle_${f.value}`).addEventListener("click",O)}),e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${f.value}`).removeEventListener("click",O),h.value&&h.value.disconnect()});function O(t){const i=t.target;i&&Array.from(i.classList).includes("vue-ui-user-options")||i&&Array.from(i.classList).includes("vue-ui-user-options-summary")||i&&Array.from(i.classList).includes("vue-data-ui-button")||i&&Array.from(i.classList).includes("vue-ui-relation-circle-legend")||(s.value={},u.value=[])}function E(){const t=6.28319/_.value.length,i=360/_.value.length;let l=0,n=0;_.value.forEach((y,C)=>{const te=d.value*Math.cos(l)+a.value.width/2,le=d.value*Math.sin(l)+a.value.height/2+r.value.style.circle.offsetY;v.value.push({x:te,y:le,...y,color:y.color?y.color:P.value[C]?P.value[C]:o.palette[C],regAngle:n}),l+=t,n+=i})}function A(){v.value.forEach(t=>{v.value.filter(l=>l.relations.includes(t.id)).forEach((l,n)=>{g.value.push({weight:t.weights&&t.weights[n]?t.weights[n]: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 Y=e.computed(()=>Math.max(...g.value.map(t=>t.weight)));function H(t){return Object.hasOwn(s.value,"x")?u.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function I(t){return Object.hasOwn(s.value,"x")?t.colorTarget:t.colorSource}function S(t){return Object.hasOwn(s.value,"x")?u.value.includes(t.id)&&t.relationId===`${t.id}_${s.value.id}`||t.relationId===`${s.value.id}_${t.id}`?`opacity:1;stroke-width:${F(t)}`:"opacity: 0":"opacity: 1"}function J(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function K(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function Q(t){return Object.hasOwn(s.value,"x")?s.value.id===t.id||u.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function Z(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function z(t){G.value=360-t.regAngle,s.value.id&&t.id===s.value.id?(s.value={},u.value=[]):(s.value=t,u.value=[...t.relations])}function F(t){return t.weight/Y.value*r.value.style.links.maxWidth}const k=e.ref(!1);function ee(t){k.value=t,$.value+=1}return M({generatePdf:w,generateImage:B}),(t,i)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:m,class:"vue-ui-relation-circle",style:e.normalizeStyle(`width:100%;background:${r.value.style.backgroundColor};text-align:center;${r.value.responsive?"height: 100%":""}`),id:`relation_circle_${f.value}`},[r.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:b,style:e.normalizeStyle(`width:100%;background:${r.value.style.backgroundColor}`)},[e.createVNode(re._sfc_main,{config:{title:{cy:"relation-div-title",...r.value.style.title},subtitle:{cy:"relation-div-subtitle",...r.value.style.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),r.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(L.UserOptions,{ref:"details",key:`user_options_${$.value}`,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,isPrinting:e.unref(j),isImaging:e.unref(q),uid:f.value,hasPdf:r.value.userOptions.buttons.pdf,hasImg:r.value.userOptions.buttons.img,hasFullscreen:r.value.userOptions.buttons.img,hasXls:!1,isFullscreen:k.value,titles:{...r.value.userOptions.buttonTitles},chartElement:m.value,onToggleFullscreen:ee,onGeneratePdf:e.unref(w),onGenerateImage:e.unref(B)},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:n})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:n})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value},"relation-circle"]),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,width:"100%",style:e.normalizeStyle(`user-select:none; background:${r.value.style.backgroundColor}`)},[e.createElementVNode("circle",{cx:(a.value.width<=0?1e-4:a.value.width)/2,cy:(a.value.height<=0?1e-4:a.value.height)/2+r.value.style.circle.offsetY,r:d.value<=0?1e-4:d.value,stroke:r.value.style.circle.stroke,"stroke-width":r.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,oe),U.value?(e.openBlock(),e.createElementBlock("g",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,n)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${n}`,style:e.normalizeStyle(S(l)),stroke:I(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":s.value.hasOwnProperty("id")&&u.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${a.value.width/2},${a.value.height/2+r.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":F(l),"stroke-linecap":"round"},null,14,ce))),128))])):(e.openBlock(),e.createElementBlock("g",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,n)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${n}`,stroke:I(l),style:e.normalizeStyle(S(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":s.value.hasOwnProperty("id")&&u.value.includes(l.id)}),"stroke-linecap":"round"},null,14,ve))),128))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,n)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${n}`,"text-anchor":J(l),transform:Z(l),x:K(l),y:l.y+5,onClick:y=>z(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":s.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${r.value.style.fontFamily};${Q(l)}`),"font-size":r.value.style.labels.fontSize,fill:r.value.style.labels.color},e.toDisplayString(l.label),13,fe))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,n)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${n}`,style:e.normalizeStyle(H(l)),class:"vue-ui-relation-circle-plot",fill:r.value.style.plot.color,onClick:y=>z(l),r:r.value.style.plot.radius},null,12,ge))),128)),e.renderSlot(t.$slots,"svg",{svg:a.value},void 0,!0)],14,ae)):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ne.default,{key:3,config:{type:"relationCircle",style:{backgroundColor:r.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],12,se))}},me=ie._export_sfc(ye,[["__scopeId","data-v-44982e30"]]);exports.default=me;
@@ -1,14 +1,14 @@
1
1
  import { ref as n, computed as v, onMounted as xe, onBeforeUnmount as _e, openBlock as c, createElementBlock as m, normalizeClass as R, normalizeStyle as x, createVNode as U, createCommentVNode as S, createBlock as V, unref as C, createSlots as Ne, withCtx as h, renderSlot as f, normalizeProps as H, guardReactiveProps as X, Fragment as ae, renderList as se, createElementVNode as w, createTextVNode as ue, toDisplayString as B, nextTick as Fe } from "vue";
2
- import { u as Pe, c as ne, t as Le, a as Se, p as T, o as Ie, e as re, g as Oe, b as Me, d as ie, f as D, X as ze, s as Ae, r as Re, v as Ve, w as Be, n as De, q as We } from "./index-ByO3Ywek.js";
2
+ import { u as Pe, c as ne, t as Le, a as Se, p as T, o as Ie, e as re, g as Oe, b as Me, d as ie, f as D, X as ze, s as Ae, r as Re, v as Ve, w as Be, n as De, q as We } from "./index-8jKJqifI.js";
3
3
  import { t as Ee, u as Ge } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as Ue } from "./Title-BSpLzDC1.js";
5
- import { u as He, U as Xe } from "./usePrinter-Dda5FBG3.js";
6
- import { _ as je } from "./Tooltip-DI8_Wjjy.js";
7
- import { D as qe } from "./DataTable-Bza1ed62.js";
8
- import { L as Je } from "./Legend-C4cCpb4z.js";
9
- import Ke from "./vue-ui-skeleton-BxRSQeuo.js";
10
- import Qe from "./vue-ui-accordion-CbKHVPHh.js";
11
- import { u as ve } from "./useNestedProp-Da77DnaA.js";
4
+ import { _ as Ue } from "./Title-2ab2u_K8.js";
5
+ import { u as He, U as Xe } from "./usePrinter-BZ_nWqN_.js";
6
+ import { _ as je } from "./Tooltip-mW2mhj5b.js";
7
+ import { D as qe } from "./DataTable-cwJyYtAp.js";
8
+ import { L as Je } from "./Legend-CwT-9P7R.js";
9
+ import Ke from "./vue-ui-skeleton-CxbgzdoX.js";
10
+ import Qe from "./vue-ui-accordion-BsXo1_Ap.js";
11
+ import { u as ve } from "./useNestedProp-R6UMUTVL.js";
12
12
  import { _ as Ye } from "./_plugin-vue_export-helper-CHgC5LLL.js";
13
13
  const Ze = ["id"], et = ["xmlns", "viewBox"], tt = ["id"], lt = ["stop-color"], ot = ["stop-color"], at = ["stroke", "cx", "cy", "r", "fill"], st = ["stroke", "stroke-width", "cx", "cy", "r", "fill"], ut = ["cx", "cy", "r", "onMouseenter"], nt = ["onClick"], rt = { key: 0 }, it = { key: 1 }, vt = ["innerHTML"], ct = {
14
14
  __name: "vue-ui-rings",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BDKEFvEF.cjs"),D=require("./useResponsive-B3TrDDIG.cjs"),re=require("./Title-XRMcJkna.cjs"),U=require("./usePrinter-DedM_6px.cjs"),ne=require("./Tooltip-COgv-iii.cjs"),ue=require("./DataTable-CGX9xKvm.cjs"),se=require("./Legend-BEMGbN0s.cjs"),ie=require("./vue-ui-skeleton-rY_nZhMQ.cjs"),ce=require("./vue-ui-accordion-BytUYLYl.cjs"),H=require("./useNestedProp-Dikfncsl.cjs"),de=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ve=["id"],pe=["xmlns","viewBox"],he=["id"],ge=["stop-color"],fe=["stop-color"],me=["stroke","cx","cy","r","fill"],ye=["stroke","stroke-width","cx","cy","r","fill"],be=["cx","cy","r","onMouseenter"],ke=["onClick"],Ce={key:0},we={key:1},xe=["innerHTML"],Te={__name:"vue-ui-rings",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(W,{expose:G,emit:j}){const v=W,{vue_ui_rings:X}=n.useConfig(),y=e.ref(!1),x=e.computed(()=>!!v.dataset&&v.dataset.length),b=e.ref(n.createUid()),J=e.ref(null),T=e.ref(!1),_=e.ref(""),m=e.ref(null),V=e.ref(0),k=e.ref(null),F=e.ref(null),L=e.ref(null),t=e.computed(()=>{const l=H.useNestedProp({userConfig:v.config,defaultConfig:X});return l.theme?{...H.useNestedProp({userConfig:n.themes.vue_ui_rings[l.theme]||v.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}),$=e.ref(null);e.onMounted(()=>{if(n.objectIsEmpty(v.dataset)?n.error({componentName:"VueUiRings",type:"dataset"}):v.dataset.forEach((l,a)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{n.error({componentName:"VueUiRings",type:"datasetSerieAttribute",property:o,index:a})})}),t.value.responsive){const l=D.throttle(()=>{const{width:a,height:o}=D.useResponsive({chart:k.value,title:t.value.style.chart.title.text?F.value:null,legend:t.value.style.chart.legend.show?L.value:null});s.value.width=a,s.value.height=o});$.value=new ResizeObserver(l),$.value.observe(k.value.parentNode)}setTimeout(()=>{y.value=!0},600)}),e.onBeforeUnmount(()=>{$.value&&$.value.disconnect()});const{isPrinting:K,isImaging:Q,generatePdf:E,generateImage:z}=U.usePrinter({elementId:`rings_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-rings"}),I=e.computed(()=>n.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}),Y=e.computed(()=>Math.min(s.value.height,s.value.width)),i=e.ref([]);function B(l){i.value.includes(l)?i.value=i.value.filter(a=>a!==l):i.value.push(l),j("selectLegend",c.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const Z=e.computed(()=>Math.max(...N.value.filter(l=>!i.value.includes(l.uid)).map(({value:l})=>l)));function O(l){return l/Z.value}const N=e.computed(()=>v.dataset.map(({values:l,name:a,color:o=null},r)=>{const u=(l||[]).reduce((h,w)=>h+w,0);return{name:a,color:o||n.convertColorToHex(o)||I.value[r]||n.palette[r]||n.palette[r%n.palette.length],value:u,proportion:u/v.dataset.map(h=>(h.values||[]).reduce((w,ae)=>w+ae,0)).reduce((h,w)=>h+w,0),uid:n.createUid()}})),M=e.computed(()=>N.value.map(l=>({...l,shape:"circle",opacity:i.value.includes(l.uid)?.5:1,segregate:()=>B(l.uid),isSegregated:i.value.includes(l.uid)})).toSorted((l,a)=>a.value-l.value)),ee=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(()=>N.value.filter(l=>!i.value.includes(l.uid)).map(({value:l})=>l).reduce((l,a)=>l+a,0)),c=e.computed(()=>N.value.filter(l=>!i.value.includes(l.uid)).map(({name:l,value:a,color:o=null,uid:r},u)=>({uid:r,name:l,color:o||n.convertColorToHex(o)||I.value[u]||n.palette[u]||n.palette[u%n.palette.length],value:a,proportion:O(a),percentage:a/p.value*100,strokeWidth:t.value.style.chart.layout.rings.strokeWidth*O(a)})).toSorted((l,a)=>a.value-l.value));function te(){return c.value.map(({name:l,color:a,value:o,absoluteValues:r,percentage:u})=>({name:l,color:a,value:o,absoluteValues:r,percentage:u}))}const d=e.computed(()=>Y.value-t.value.style.chart.layout.rings.strokeWidth*2),P=e.ref(null);function le(l,a){if(i.value.length===v.dataset.length)return;P.value={datapoint:a,seriesIndex:l,series:c.value,config:t.value},m.value=l;const o=c.value[l],r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:c.value,config:t.value})))_.value=r({seriesIndex:l,datapoint:a,series:c.value,config:t.value});else{let u="";u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${o.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?u+=`<span>(${(o.value/p.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%)</span></div>`:u+=`<b>${(o.value/p.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%</b></div>`),_.value=u}T.value=!0}const f=e.computed(()=>{const l=c.value.map(o=>({name:o.name,color:o.color})),a=c.value.map(o=>o.value);return{head:l,body:a}}),S=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v: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},n.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)+"%"]),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:a,config:o,colNames:r}});function R(){e.nextTick(()=>{const l=f.value.head.map((r,u)=>[[r.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(l),o=n.createCsvContent(a);n.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-rings"})})}const C=e.ref(!1);function oe(l){C.value=l,V.value+=1}function q(){g.value.showTable=!g.value.showTable}function A(){g.value.showTooltip=!g.value.showTooltip}return G({getData:te,generatePdf:E,generateCsv:R,generateImage:z,toggleTable:q,toggleTooltip:A}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"ringsChart",ref:k,class:e.normalizeClass(`vue-ui-rings ${C.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};text-align:center;width:100%;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`),id:`rings_${b.value}`,onMouseleave:a[3]||(a[3]=o=>{m.value=null,T.value=!1})},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:F,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`)},[e.createVNode(re._sfc_main,{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"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&x.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:J,key:`user_options_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(K),isImaging:e.unref(Q),uid:b.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:k.value,onToggleFullscreen:oe,onGeneratePdf:e.unref(E),onGenerateCsv:R,onGenerateImage:e.unref(z),onToggleTable:q,onToggleTooltip:A},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"30%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(o.color,.05)}${e.unref(n.opacity)[100-t.value.style.chart.layout.rings.gradient.intensity]}`},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,fe)],8,he))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":y.value&&t.value.useCssAnimation,"vue-rings-item-onload":!y.value&&t.value.useCssAnimation,"vue-ui-rings-opacity":m.value!==null&&m.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*o.proportion/2-2*(r+1),r:d.value*o.proportion/2*.9<=0?1e-4:d.value*o.proportion/2*.9,fill:t.value.style.chart.layout.rings.gradient.underlayerColor},null,14,me),e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":y.value&&t.value.useCssAnimation,"vue-rings-item-onload":!y.value&&t.value.useCssAnimation,"vue-ui-rings-shadow":t.value.style.chart.layout.rings.useShadow,"vue-ui-rings-blur":m.value!==null&&m.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,"stroke-width":o.strokeWidth<.5?.5:o.strokeWidth,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*o.proportion/2-2*(r+1),r:d.value*o.proportion/2*.9<=0?1e-4:d.value*o.proportion/2*.9,fill:t.value.style.chart.layout.rings.gradient.show?`url(#gradient_${b.value}_${r})`:o.color},null,14,ye),e.createElementVNode("circle",{"data-cy-trap":"",stroke:"none",cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*o.proportion/2-2*(r+1),r:d.value*o.proportion/2*.9<=0?1e-4:d.value*o.proportion/2*.9,fill:"transparent",onMouseenter:u=>le(r,o),onMouseleave:a[0]||(a[0]=u=>{m.value=null,T.value=!1})},null,40,be)]))),256)),e.renderSlot(l.$slots,"svg",{svg:s.value},void 0,!0)],14,pe)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie.default,{key:3,config:{type:"rings",style:{backgroundColor:t.value.style.chart.backgroundColor,rings:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:L},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(se.Legend,{key:0,legendSet:M.value,config:ee.value,onClickMarker:a[1]||(a[1]=({legend:o})=>B(o.uid))},{item:e.withCtx(({legend:o})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:r=>B(o.uid),style:e.normalizeStyle(`opacity:${i.value.includes(o.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}))+" ",1),i.value.includes(o.uid)?(e.openBlock(),e.createElementBlock("span",we," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ce," ("+e.toDisplayString(isNaN(o.value/p.value)?"-":(o.value/p.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,ke)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:M.value},void 0,!0)],512),e.createVNode(ne._sfc_main,{show:g.value.showTooltip&&T.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,parent:k.value,content:_.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...P.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...P.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","parent","content","isCustom"]),x.value?(e.openBlock(),e.createBlock(ce.default,{key:4,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.createVNode(ue.DataTable,{colNames:S.value.colNames,head:S.value.head,body:S.value.body,config:S.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=o=>g.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,xe)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,ve))}},$e=de._export_sfc(Te,[["__scopeId","data-v-c7da9220"]]);exports.default=$e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index--K6Ja9Gj.cjs"),D=require("./useResponsive-B3TrDDIG.cjs"),re=require("./Title-DpgU75bw.cjs"),U=require("./usePrinter-CysnJve5.cjs"),ne=require("./Tooltip-B2BLFWIv.cjs"),ue=require("./DataTable-DQGTnBUl.cjs"),se=require("./Legend-BEEbv4va.cjs"),ie=require("./vue-ui-skeleton-Bf_PLiHN.cjs"),ce=require("./vue-ui-accordion-B0UeLf1b.cjs"),H=require("./useNestedProp-Bs4c78Cx.cjs"),de=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ve=["id"],pe=["xmlns","viewBox"],he=["id"],ge=["stop-color"],fe=["stop-color"],me=["stroke","cx","cy","r","fill"],ye=["stroke","stroke-width","cx","cy","r","fill"],be=["cx","cy","r","onMouseenter"],ke=["onClick"],Ce={key:0},we={key:1},xe=["innerHTML"],Te={__name:"vue-ui-rings",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(W,{expose:G,emit:j}){const v=W,{vue_ui_rings:X}=n.useConfig(),y=e.ref(!1),x=e.computed(()=>!!v.dataset&&v.dataset.length),b=e.ref(n.createUid()),J=e.ref(null),T=e.ref(!1),_=e.ref(""),m=e.ref(null),V=e.ref(0),k=e.ref(null),F=e.ref(null),L=e.ref(null),t=e.computed(()=>{const l=H.useNestedProp({userConfig:v.config,defaultConfig:X});return l.theme?{...H.useNestedProp({userConfig:n.themes.vue_ui_rings[l.theme]||v.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}),$=e.ref(null);e.onMounted(()=>{if(n.objectIsEmpty(v.dataset)?n.error({componentName:"VueUiRings",type:"dataset"}):v.dataset.forEach((l,a)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{n.error({componentName:"VueUiRings",type:"datasetSerieAttribute",property:o,index:a})})}),t.value.responsive){const l=D.throttle(()=>{const{width:a,height:o}=D.useResponsive({chart:k.value,title:t.value.style.chart.title.text?F.value:null,legend:t.value.style.chart.legend.show?L.value:null});s.value.width=a,s.value.height=o});$.value=new ResizeObserver(l),$.value.observe(k.value.parentNode)}setTimeout(()=>{y.value=!0},600)}),e.onBeforeUnmount(()=>{$.value&&$.value.disconnect()});const{isPrinting:K,isImaging:Q,generatePdf:E,generateImage:z}=U.usePrinter({elementId:`rings_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-rings"}),I=e.computed(()=>n.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}),Y=e.computed(()=>Math.min(s.value.height,s.value.width)),i=e.ref([]);function B(l){i.value.includes(l)?i.value=i.value.filter(a=>a!==l):i.value.push(l),j("selectLegend",c.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const Z=e.computed(()=>Math.max(...N.value.filter(l=>!i.value.includes(l.uid)).map(({value:l})=>l)));function O(l){return l/Z.value}const N=e.computed(()=>v.dataset.map(({values:l,name:a,color:o=null},r)=>{const u=(l||[]).reduce((h,w)=>h+w,0);return{name:a,color:o||n.convertColorToHex(o)||I.value[r]||n.palette[r]||n.palette[r%n.palette.length],value:u,proportion:u/v.dataset.map(h=>(h.values||[]).reduce((w,ae)=>w+ae,0)).reduce((h,w)=>h+w,0),uid:n.createUid()}})),M=e.computed(()=>N.value.map(l=>({...l,shape:"circle",opacity:i.value.includes(l.uid)?.5:1,segregate:()=>B(l.uid),isSegregated:i.value.includes(l.uid)})).toSorted((l,a)=>a.value-l.value)),ee=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(()=>N.value.filter(l=>!i.value.includes(l.uid)).map(({value:l})=>l).reduce((l,a)=>l+a,0)),c=e.computed(()=>N.value.filter(l=>!i.value.includes(l.uid)).map(({name:l,value:a,color:o=null,uid:r},u)=>({uid:r,name:l,color:o||n.convertColorToHex(o)||I.value[u]||n.palette[u]||n.palette[u%n.palette.length],value:a,proportion:O(a),percentage:a/p.value*100,strokeWidth:t.value.style.chart.layout.rings.strokeWidth*O(a)})).toSorted((l,a)=>a.value-l.value));function te(){return c.value.map(({name:l,color:a,value:o,absoluteValues:r,percentage:u})=>({name:l,color:a,value:o,absoluteValues:r,percentage:u}))}const d=e.computed(()=>Y.value-t.value.style.chart.layout.rings.strokeWidth*2),P=e.ref(null);function le(l,a){if(i.value.length===v.dataset.length)return;P.value={datapoint:a,seriesIndex:l,series:c.value,config:t.value},m.value=l;const o=c.value[l],r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:c.value,config:t.value})))_.value=r({seriesIndex:l,datapoint:a,series:c.value,config:t.value});else{let u="";u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${o.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue})}</b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?u+=`<span>(${(o.value/p.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%)</span></div>`:u+=`<b>${(o.value/p.value*100).toFixed(t.value.style.chart.tooltip.roundingPercentage)}%</b></div>`),_.value=u}T.value=!0}const f=e.computed(()=>{const l=c.value.map(o=>({name:o.name,color:o.color})),a=c.value.map(o=>o.value);return{head:l,body:a}}),S=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v: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},n.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)+"%"]),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint},r=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:a,config:o,colNames:r}});function R(){e.nextTick(()=>{const l=f.value.head.map((r,u)=>[[r.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(l),o=n.createCsvContent(a);n.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-rings"})})}const C=e.ref(!1);function oe(l){C.value=l,V.value+=1}function q(){g.value.showTable=!g.value.showTable}function A(){g.value.showTooltip=!g.value.showTooltip}return G({getData:te,generatePdf:E,generateCsv:R,generateImage:z,toggleTable:q,toggleTooltip:A}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"ringsChart",ref:k,class:e.normalizeClass(`vue-ui-rings ${C.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};text-align:center;width:100%;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`),id:`rings_${b.value}`,onMouseleave:a[3]||(a[3]=o=>{m.value=null,T.value=!1})},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:F,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`)},[e.createVNode(re._sfc_main,{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"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&x.value?(e.openBlock(),e.createBlock(U.UserOptions,{ref_key:"details",ref:J,key:`user_options_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(K),isImaging:e.unref(Q),uid:b.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:k.value,onToggleFullscreen:oe,onGeneratePdf:e.unref(E),onGenerateCsv:R,onGenerateImage:e.unref(z),onToggleTable:q,onToggleTooltip:A},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"30%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(o.color,.05)}${e.unref(n.opacity)[100-t.value.style.chart.layout.rings.gradient.intensity]}`},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,fe)],8,he))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":y.value&&t.value.useCssAnimation,"vue-rings-item-onload":!y.value&&t.value.useCssAnimation,"vue-ui-rings-opacity":m.value!==null&&m.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*o.proportion/2-2*(r+1),r:d.value*o.proportion/2*.9<=0?1e-4:d.value*o.proportion/2*.9,fill:t.value.style.chart.layout.rings.gradient.underlayerColor},null,14,me),e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":y.value&&t.value.useCssAnimation,"vue-rings-item-onload":!y.value&&t.value.useCssAnimation,"vue-ui-rings-shadow":t.value.style.chart.layout.rings.useShadow,"vue-ui-rings-blur":m.value!==null&&m.value!==r}),style:e.normalizeStyle(`animation-delay:${r*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,"stroke-width":o.strokeWidth<.5?.5:o.strokeWidth,cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*o.proportion/2-2*(r+1),r:d.value*o.proportion/2*.9<=0?1e-4:d.value*o.proportion/2*.9,fill:t.value.style.chart.layout.rings.gradient.show?`url(#gradient_${b.value}_${r})`:o.color},null,14,ye),e.createElementVNode("circle",{"data-cy-trap":"",stroke:"none",cx:s.value.width/2,cy:r===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*o.proportion/2-2*(r+1),r:d.value*o.proportion/2*.9<=0?1e-4:d.value*o.proportion/2*.9,fill:"transparent",onMouseenter:u=>le(r,o),onMouseleave:a[0]||(a[0]=u=>{m.value=null,T.value=!1})},null,40,be)]))),256)),e.renderSlot(l.$slots,"svg",{svg:s.value},void 0,!0)],14,pe)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie.default,{key:3,config:{type:"rings",style:{backgroundColor:t.value.style.chart.backgroundColor,rings:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:L},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(se.Legend,{key:0,legendSet:M.value,config:ee.value,onClickMarker:a[1]||(a[1]=({legend:o})=>B(o.uid))},{item:e.withCtx(({legend:o})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:r=>B(o.uid),style:e.normalizeStyle(`opacity:${i.value.includes(o.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}))+" ",1),i.value.includes(o.uid)?(e.openBlock(),e.createElementBlock("span",we," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ce," ("+e.toDisplayString(isNaN(o.value/p.value)?"-":(o.value/p.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,ke)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:M.value},void 0,!0)],512),e.createVNode(ne._sfc_main,{show:g.value.showTooltip&&T.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,parent:k.value,content:_.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...P.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...P.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","parent","content","isCustom"]),x.value?(e.openBlock(),e.createBlock(ce.default,{key:4,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.createVNode(ue.DataTable,{colNames:S.value.colNames,head:S.value.head,body:S.value.body,config:S.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=o=>g.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,xe)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,ve))}},$e=de._export_sfc(Te,[["__scopeId","data-v-c7da9220"]]);exports.default=$e;
@@ -1,15 +1,15 @@
1
1
  import { computed as m, ref as b, onMounted as je, onBeforeUnmount as Ee, openBlock as s, createElementBlock as i, normalizeClass as ze, normalizeStyle as X, createVNode as te, createCommentVNode as c, createBlock as U, unref as L, createSlots as Ve, withCtx as _, renderSlot as B, normalizeProps as ne, guardReactiveProps as ve, createElementVNode as y, Fragment as N, renderList as W, toDisplayString as w, createTextVNode as Ge, nextTick as Re } from "vue";
2
- import { u as qe, c as Ue, t as He, a as Je, p as V, o as Ke, e as ye, b as Qe, g as Se, L as Le, X as Ze, N as et, r as ce, f as H, v as tt, w as lt, n as at, q as ot } from "./index-ByO3Ywek.js";
2
+ import { u as qe, c as Ue, t as He, a as Je, p as V, o as Ke, e as ye, b as Qe, g as Se, L as Le, X as Ze, N as et, r as ce, f as H, v as tt, w as lt, n as at, q as ot } from "./index-8jKJqifI.js";
3
3
  import { t as st, u as ut } from "./useResponsive-NZB-WLRF.js";
4
- import { _ as it } from "./Title-BSpLzDC1.js";
5
- import { u as rt, U as nt } from "./usePrinter-Dda5FBG3.js";
6
- import { _ as vt } from "./Tooltip-DI8_Wjjy.js";
7
- import { L as yt } from "./Legend-C4cCpb4z.js";
8
- import { _ as Ae } from "./Shape-Bttb-v8s.js";
9
- import { D as ct } from "./DataTable-Bza1ed62.js";
10
- import dt from "./vue-ui-skeleton-BxRSQeuo.js";
11
- import ht from "./vue-ui-accordion-CbKHVPHh.js";
12
- import { u as Te } from "./useNestedProp-Da77DnaA.js";
4
+ import { _ as it } from "./Title-2ab2u_K8.js";
5
+ import { u as rt, U as nt } from "./usePrinter-BZ_nWqN_.js";
6
+ import { _ as vt } from "./Tooltip-mW2mhj5b.js";
7
+ import { L as yt } from "./Legend-CwT-9P7R.js";
8
+ import { _ as Ae } from "./Shape-Gv8uj72o.js";
9
+ import { D as ct } from "./DataTable-cwJyYtAp.js";
10
+ import dt from "./vue-ui-skeleton-CxbgzdoX.js";
11
+ import ht from "./vue-ui-accordion-BsXo1_Ap.js";
12
+ import { u as Te } from "./useNestedProp-R6UMUTVL.js";
13
13
  import { _ as pt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
14
  const ft = ["id"], gt = ["xmlns", "viewBox"], xt = { key: 0 }, mt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], bt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], kt = { key: 1 }, _t = ["points", "fill", "stroke-width", "stroke-dasharray", "stroke"], wt = { key: 0 }, $t = ["cx", "cy", "r", "fill", "stroke", "stroke-width", "onMouseover"], Mt = { key: 1 }, Ct = { key: 2 }, zt = ["id"], St = ["stop-color"], Lt = ["stop-color"], At = ["id"], Tt = ["stop-color"], Bt = ["stop-color"], Nt = ["x", "y", "width", "height", "fill", "stroke", "stroke-width", "rx"], Ft = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], Wt = { key: 0 }, Pt = ["d", "stroke", "stroke-width"], It = ["d", "stroke", "stroke-width"], Ot = ["d", "stroke", "stroke-width"], Xt = ["d", "stroke", "stroke-width"], Dt = {
15
15
  key: 3,