vue-data-ui 2.4.49 → 2.4.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/{Arrow-Q0cOmO5p.js → Arrow-D1z9KkQN.js} +1 -1
  2. package/dist/{Arrow-CTukks_V.cjs → Arrow-DuuEh1Nr.cjs} +1 -1
  3. package/dist/{BaseIcon-CaYP30Aq.js → BaseIcon-BHwqOTt4.js} +1 -1
  4. package/dist/{BaseIcon-2ZD3jgGz.cjs → BaseIcon-DemqZ_13.cjs} +1 -1
  5. package/dist/{DataTable-CO5C8Cmb.js → DataTable-CQ8fQnex.js} +2 -2
  6. package/dist/{DataTable-kMUhutQ4.cjs → DataTable-CovKV5Yy.cjs} +1 -1
  7. package/dist/{Legend-DPHcmrzd.cjs → Legend-Bbz-hKDf.cjs} +1 -1
  8. package/dist/{Legend-FZN9UHoI.js → Legend-Br7MWNDo.js} +1 -1
  9. package/dist/{PackageVersion-rnWHRWGI.cjs → PackageVersion-BEtuCME5.cjs} +1 -1
  10. package/dist/{PackageVersion-DYk2hOG1.js → PackageVersion-BV3fHO46.js} +1 -1
  11. package/dist/{PenAndPaper-BQl9-uX0.cjs → PenAndPaper-BIcmfBvD.cjs} +1 -1
  12. package/dist/{PenAndPaper-BfgS_5ux.js → PenAndPaper-CCOywdmm.js} +3 -3
  13. package/dist/{Shape-BqkMzXqo.js → Shape-B7Mekpyf.js} +1 -1
  14. package/dist/{Shape-BblkpCyL.cjs → Shape-BD37ZaX9.cjs} +1 -1
  15. package/dist/{Slicer-yEeqKUDF.cjs → Slicer-CWvkt-8k.cjs} +1 -1
  16. package/dist/{Slicer-DlgqsI5C.js → Slicer-ahFReg7h.js} +2 -2
  17. package/dist/{Title-5Vedk01J.cjs → Title-C2siG5N2.cjs} +1 -1
  18. package/dist/{Title-DED-PQ7X.js → Title-CIsKiWgN.js} +1 -1
  19. package/dist/{Tooltip-CHseiJu8.js → Tooltip-B1LgrF9R.js} +1 -1
  20. package/dist/{Tooltip-DjCKBAC4.cjs → Tooltip-CS4C58T7.cjs} +1 -1
  21. package/dist/{index-igxqCP2w.js → index-BtL_cLa8.js} +1 -1
  22. package/dist/{index-BHQZE19X.cjs → index-DoD-GxZR.cjs} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useNestedProp-CSVnZVwZ.js → useNestedProp-CEAfm1tu.js} +1 -1
  25. package/dist/{useNestedProp-CwpqC_aE.cjs → useNestedProp-D_feh7A_.cjs} +1 -1
  26. package/dist/{usePrinter-DVgxBO4o.cjs → usePrinter-B4xDG31F.cjs} +1 -1
  27. package/dist/{usePrinter-CnZYDQXB.js → usePrinter-sRt2SKr2.js} +1 -1
  28. package/dist/{vue-data-ui-BrRTkOqu.cjs → vue-data-ui-CuEYAddV.cjs} +1 -1
  29. package/dist/{vue-data-ui-B--WWkUM.js → vue-data-ui-NkhaiK6y.js} +60 -60
  30. package/dist/vue-data-ui.cjs +1 -1
  31. package/dist/vue-data-ui.js +1 -1
  32. package/dist/{vue-ui-3d-bar-OzzLYbUl.js → vue-ui-3d-bar-BeXYzdzu.js} +9 -9
  33. package/dist/{vue-ui-3d-bar-BGVLnjCh.cjs → vue-ui-3d-bar-RduHvzwG.cjs} +1 -1
  34. package/dist/{vue-ui-accordion-CRVWlHxs.cjs → vue-ui-accordion-CBxsUoGb.cjs} +1 -1
  35. package/dist/{vue-ui-accordion-lF7yVkiT.js → vue-ui-accordion-Cjc683tN.js} +3 -3
  36. package/dist/{vue-ui-age-pyramid-Cv0Rddsx.cjs → vue-ui-age-pyramid-DVtbyRJw.cjs} +1 -1
  37. package/dist/{vue-ui-age-pyramid-5Vj8AtW1.js → vue-ui-age-pyramid-rnt8M-Qz.js} +10 -10
  38. package/dist/{vue-ui-annotator-BmO78L3H.js → vue-ui-annotator-CFU5Zyfk.js} +1 -1
  39. package/dist/{vue-ui-annotator-D8Hx1BFF.cjs → vue-ui-annotator-Yu-mHS2N.cjs} +1 -1
  40. package/dist/{vue-ui-bullet-C0Q2Vs5p.cjs → vue-ui-bullet-Be5aYhtp.cjs} +1 -1
  41. package/dist/{vue-ui-bullet-DwFD41hN.js → vue-ui-bullet-CRbW1ON6.js} +8 -8
  42. package/dist/{vue-ui-candlestick-C7kRHFF3.cjs → vue-ui-candlestick-B6wSs-JC.cjs} +1 -1
  43. package/dist/{vue-ui-candlestick-By609gwn.js → vue-ui-candlestick-D-ERLtI1.js} +11 -11
  44. package/dist/{vue-ui-carousel-table-1_Hy8sGL.cjs → vue-ui-carousel-table-7reErH8M.cjs} +1 -1
  45. package/dist/{vue-ui-carousel-table-wwMoteEN.js → vue-ui-carousel-table-I1m4HMWf.js} +4 -4
  46. package/dist/{vue-ui-chestnut-hqorA5EW.js → vue-ui-chestnut-CqJRKECX.js} +8 -8
  47. package/dist/{vue-ui-chestnut-D3LGylRp.cjs → vue-ui-chestnut-D-WzX16q.cjs} +1 -1
  48. package/dist/{vue-ui-cursor-BCg5VZUb.cjs → vue-ui-cursor-S83QIsxQ.cjs} +1 -1
  49. package/dist/{vue-ui-cursor-GSkn7N7Z.js → vue-ui-cursor-jrrdh8Lf.js} +2 -2
  50. package/dist/{vue-ui-dashboard-DIoYWyXB.js → vue-ui-dashboard-DR_Bhwa3.js} +2 -2
  51. package/dist/{vue-ui-dashboard-Bkm9bcAc.cjs → vue-ui-dashboard-DW1mIInG.cjs} +1 -1
  52. package/dist/{vue-ui-digits-niqTltAv.js → vue-ui-digits-1jZdiwHJ.js} +2 -2
  53. package/dist/{vue-ui-digits-CpBBTAI9.cjs → vue-ui-digits-s5f9eFtW.cjs} +1 -1
  54. package/dist/{vue-ui-donut-DfufBrkk.js → vue-ui-donut-BAYiPsxp.js} +11 -11
  55. package/dist/{vue-ui-donut-CQEOtlxM.cjs → vue-ui-donut-Ce1SaXNu.cjs} +1 -1
  56. package/dist/{vue-ui-donut-evolution-Dg_XJyX8.cjs → vue-ui-donut-evolution-DI8yeIa4.cjs} +1 -1
  57. package/dist/{vue-ui-donut-evolution-XQp6R0e_.js → vue-ui-donut-evolution-DsHTZ9T2.js} +11 -11
  58. package/dist/{vue-ui-dumbbell-RAkNYRoJ.cjs → vue-ui-dumbbell-CFJkwtM8.cjs} +1 -1
  59. package/dist/{vue-ui-dumbbell-DSS8sHHU.js → vue-ui-dumbbell-DcMmBxLy.js} +10 -10
  60. package/dist/{vue-ui-flow-BUmSGSmR.cjs → vue-ui-flow-B4MtorhO.cjs} +1 -1
  61. package/dist/{vue-ui-flow-BBNuPVgI.js → vue-ui-flow-BTXEmIQG.js} +9 -9
  62. package/dist/{vue-ui-funnel-BDGggRXE.js → vue-ui-funnel-BB_h0FKg.js} +8 -8
  63. package/dist/{vue-ui-funnel-B9HR0owO.cjs → vue-ui-funnel-DNL12vLQ.cjs} +1 -1
  64. package/dist/{vue-ui-galaxy-DmsMWB1a.cjs → vue-ui-galaxy-CmCZGOKz.cjs} +1 -1
  65. package/dist/{vue-ui-galaxy-6Odi2CwM.js → vue-ui-galaxy-DlBk1FUz.js} +11 -11
  66. package/dist/{vue-ui-gauge-DeYvNVnR.js → vue-ui-gauge-1SFhSMfU.js} +7 -7
  67. package/dist/{vue-ui-gauge-Dvv0v56Z.cjs → vue-ui-gauge-B7ieQMud.cjs} +1 -1
  68. package/dist/{vue-ui-gizmo-DXQt_8D0.cjs → vue-ui-gizmo-C8rLR4n5.cjs} +1 -1
  69. package/dist/{vue-ui-gizmo-BcAr2dTN.js → vue-ui-gizmo-CtX6KFN2.js} +3 -3
  70. package/dist/{vue-ui-heatmap-DZ02dS5q.cjs → vue-ui-heatmap-Bfi3KJwS.cjs} +1 -1
  71. package/dist/{vue-ui-heatmap-Btm1mK6D.js → vue-ui-heatmap-BzyvTePn.js} +10 -10
  72. package/dist/{vue-ui-history-plot-DPQWcN0P.cjs → vue-ui-history-plot-5kZ54hgy.cjs} +1 -1
  73. package/dist/{vue-ui-history-plot-OY6N31Ka.js → vue-ui-history-plot-BEoHuZ3N.js} +11 -11
  74. package/dist/{vue-ui-kpi-D5oNUDVm.js → vue-ui-kpi-BYOyJjYg.js} +3 -3
  75. package/dist/{vue-ui-kpi-CQIbWQMk.cjs → vue-ui-kpi-LO4KKRR9.cjs} +1 -1
  76. package/dist/{vue-ui-mini-loader-BjqV22Co.js → vue-ui-mini-loader-ChHdx5me.js} +2 -2
  77. package/dist/{vue-ui-mini-loader-ByDKGMAp.cjs → vue-ui-mini-loader-wlUD77O6.cjs} +1 -1
  78. package/dist/{vue-ui-molecule-FsLf3YTj.js → vue-ui-molecule-Bo7XYpf-.js} +11 -11
  79. package/dist/{vue-ui-molecule-C8O_ViVy.cjs → vue-ui-molecule-D-4cRS5w.cjs} +1 -1
  80. package/dist/{vue-ui-mood-radar-4u98wGWl.cjs → vue-ui-mood-radar-C3x_LH7Q.cjs} +1 -1
  81. package/dist/{vue-ui-mood-radar-31BX-GNG.js → vue-ui-mood-radar-DXj4Ce6l.js} +11 -11
  82. package/dist/{vue-ui-nested-donuts-BMJW2oHk.js → vue-ui-nested-donuts-BBLpNVwF.js} +11 -11
  83. package/dist/{vue-ui-nested-donuts-BPc_OBoe.cjs → vue-ui-nested-donuts-DrL7-SUd.cjs} +1 -1
  84. package/dist/{vue-ui-onion-IhkIHn1A.cjs → vue-ui-onion-8Vz3lPbn.cjs} +1 -1
  85. package/dist/{vue-ui-onion-BUpGgnWA.js → vue-ui-onion-DC8VIInA.js} +11 -11
  86. package/dist/{vue-ui-parallel-coordinate-plot-9I00rQEM.js → vue-ui-parallel-coordinate-plot-Cl1wiHsK.js} +12 -12
  87. package/dist/{vue-ui-parallel-coordinate-plot-DzjggyLA.cjs → vue-ui-parallel-coordinate-plot-D6q4WQ0B.cjs} +1 -1
  88. package/dist/{vue-ui-quadrant-EZqQ-7Ev.cjs → vue-ui-quadrant-DBZS5jFQ.cjs} +1 -1
  89. package/dist/{vue-ui-quadrant-CEmoMAL7.js → vue-ui-quadrant-b5cuEH9z.js} +12 -12
  90. package/dist/{vue-ui-quick-chart-T_oeRTqY.js → vue-ui-quick-chart-CFBPYw2J.js} +9 -9
  91. package/dist/{vue-ui-quick-chart-BKUUR-A1.cjs → vue-ui-quick-chart-Cno_1mzu.cjs} +1 -1
  92. package/dist/{vue-ui-radar-QBwo6ybW.cjs → vue-ui-radar-ChcBO21S.cjs} +1 -1
  93. package/dist/{vue-ui-radar-DG_Zir8w.js → vue-ui-radar-DP8360kx.js} +12 -12
  94. package/dist/{vue-ui-rating-Juprijdi.cjs → vue-ui-rating-D7b-kfyp.cjs} +1 -1
  95. package/dist/{vue-ui-rating-gswAA28b.js → vue-ui-rating-DIthBSp_.js} +2 -2
  96. package/dist/{vue-ui-relation-circle-BWX8zrfH.cjs → vue-ui-relation-circle-C5pO0iHY.cjs} +1 -1
  97. package/dist/{vue-ui-relation-circle-DtnXrnOP.js → vue-ui-relation-circle-D2iwmChn.js} +7 -7
  98. package/dist/{vue-ui-rings-Damuv7g9.cjs → vue-ui-rings-C_NLJYs8.cjs} +1 -1
  99. package/dist/{vue-ui-rings-D3g-ORch.js → vue-ui-rings-y9Zx-DaI.js} +11 -11
  100. package/dist/{vue-ui-scatter-RUeAe7Sx.cjs → vue-ui-scatter-BNeMGDNk.cjs} +1 -1
  101. package/dist/{vue-ui-scatter-DBO-XViT.js → vue-ui-scatter-Cbu5GDc1.js} +12 -12
  102. package/dist/{vue-ui-screenshot-K0a-DVD6.js → vue-ui-screenshot-BZh_sgjP.js} +1 -1
  103. package/dist/{vue-ui-screenshot-3MDyr6v3.cjs → vue-ui-screenshot-oH-YnZBE.cjs} +1 -1
  104. package/dist/{vue-ui-skeleton-CWjNNx-k.js → vue-ui-skeleton-DjFU2X3P.js} +3 -3
  105. package/dist/{vue-ui-skeleton-DUNkS05l.cjs → vue-ui-skeleton-Nuju6X7l.cjs} +1 -1
  106. package/dist/{vue-ui-smiley-MwX1c6qK.js → vue-ui-smiley-DdnzzEYS.js} +2 -2
  107. package/dist/{vue-ui-smiley-Cbqg-N-L.cjs → vue-ui-smiley-DtQVEc4B.cjs} +1 -1
  108. package/dist/{vue-ui-spark-trend-CN5JUPhn.cjs → vue-ui-spark-trend-B36zW41F.cjs} +1 -1
  109. package/dist/{vue-ui-spark-trend-D9eWTtbE.js → vue-ui-spark-trend-CaIGk_53.js} +5 -5
  110. package/dist/{vue-ui-sparkbar-CPF7YNDd.js → vue-ui-sparkbar-DixeozKp.js} +4 -4
  111. package/dist/{vue-ui-sparkbar-IphZ8jXh.cjs → vue-ui-sparkbar-iQKGtxo8.cjs} +1 -1
  112. package/dist/{vue-ui-sparkgauge-B29V7ZTv.js → vue-ui-sparkgauge-C01VB6KP.js} +4 -4
  113. package/dist/{vue-ui-sparkgauge-BRMGqR9Z.cjs → vue-ui-sparkgauge-DEvgucF7.cjs} +1 -1
  114. package/dist/{vue-ui-sparkhistogram-rvYaVHmw.cjs → vue-ui-sparkhistogram-CTUuxOma.cjs} +1 -1
  115. package/dist/{vue-ui-sparkhistogram-BJTgOWF5.js → vue-ui-sparkhistogram-C_6lHF3O.js} +5 -5
  116. package/dist/{vue-ui-sparkline-DX79otAB.js → vue-ui-sparkline-Btm4HVgi.js} +4 -4
  117. package/dist/{vue-ui-sparkline-BI9jqI0h.cjs → vue-ui-sparkline-DrZWPGOG.cjs} +1 -1
  118. package/dist/{vue-ui-sparkstackbar-DuollcwK.cjs → vue-ui-sparkstackbar-7pcfCNMr.cjs} +1 -1
  119. package/dist/{vue-ui-sparkstackbar-vP28A6AT.js → vue-ui-sparkstackbar-D0UGUm-1.js} +5 -5
  120. package/dist/{vue-ui-stackbar-DnJEgIaA.js → vue-ui-stackbar-BPMDmY04.js} +12 -12
  121. package/dist/{vue-ui-stackbar-BumFmZZF.cjs → vue-ui-stackbar-BwRdmPvB.cjs} +1 -1
  122. package/dist/{vue-ui-strip-plot-DqcHBwd_.js → vue-ui-strip-plot-BfWQMGXy.js} +11 -11
  123. package/dist/{vue-ui-strip-plot-DupREfRd.cjs → vue-ui-strip-plot-CLN9LikJ.cjs} +1 -1
  124. package/dist/{vue-ui-table-BMJ0I5nr.cjs → vue-ui-table-Cdo265Yt.cjs} +1 -1
  125. package/dist/{vue-ui-table-D8cgqIJl.js → vue-ui-table-D8GaLhM9.js} +1 -1
  126. package/dist/{vue-ui-table-heatmap-D4qeClXn.js → vue-ui-table-heatmap-C4DRSfsE.js} +4 -4
  127. package/dist/{vue-ui-table-heatmap-D43pTFli.cjs → vue-ui-table-heatmap-CDAf1IIk.cjs} +1 -1
  128. package/dist/vue-ui-table-sparkline-Cw7NOiYx.cjs +1 -0
  129. package/dist/{vue-ui-table-sparkline-B_Po0RuC.js → vue-ui-table-sparkline-DMHf03C9.js} +211 -200
  130. package/dist/{vue-ui-thermometer-CaV3JF3h.cjs → vue-ui-thermometer-7BORZJjd.cjs} +1 -1
  131. package/dist/{vue-ui-thermometer-C6nfW6uY.js → vue-ui-thermometer-BCVqil7E.js} +7 -7
  132. package/dist/{vue-ui-timer-CfwmMRdZ.js → vue-ui-timer-DF5HkeeS.js} +5 -5
  133. package/dist/{vue-ui-timer-ldINTqND.cjs → vue-ui-timer-gxiLCP1n.cjs} +1 -1
  134. package/dist/{vue-ui-tiremarks-BlyxL_IU.cjs → vue-ui-tiremarks-CwGnFx4f.cjs} +1 -1
  135. package/dist/{vue-ui-tiremarks-iNKMnu3P.js → vue-ui-tiremarks-lidhcJsi.js} +7 -7
  136. package/dist/{vue-ui-treemap-YdRDlSHA.cjs → vue-ui-treemap-BZ_LmiBK.cjs} +1 -1
  137. package/dist/{vue-ui-treemap-CwMnkcOi.js → vue-ui-treemap-CIZaPmbi.js} +11 -11
  138. package/dist/{vue-ui-vertical-bar-BZR4YOLh.js → vue-ui-vertical-bar-dQoTddqU.js} +11 -11
  139. package/dist/{vue-ui-vertical-bar-Bji3-X8i.cjs → vue-ui-vertical-bar-venrkqjM.cjs} +1 -1
  140. package/dist/{vue-ui-waffle-D2BccJmB.js → vue-ui-waffle-CnvWOEVU.js} +11 -11
  141. package/dist/{vue-ui-waffle-rO_LJaHR.cjs → vue-ui-waffle-oR54BbIg.cjs} +1 -1
  142. package/dist/{vue-ui-wheel-BTrpdV-C.cjs → vue-ui-wheel-BUHZEzPr.cjs} +1 -1
  143. package/dist/{vue-ui-wheel-GqWFopE1.js → vue-ui-wheel-D3itrMku.js} +7 -7
  144. package/dist/{vue-ui-word-cloud-DD-pKUen.cjs → vue-ui-word-cloud-87gwksmM.cjs} +1 -1
  145. package/dist/{vue-ui-word-cloud-DiG8DHOr.js → vue-ui-word-cloud-o3zU6r0-.js} +10 -10
  146. package/dist/{vue-ui-xy-C32KNdyx.cjs → vue-ui-xy-D56pm4L0.cjs} +1 -1
  147. package/dist/{vue-ui-xy-DicLnkBA.js → vue-ui-xy-GR4PGBDy.js} +14 -14
  148. package/dist/{vue-ui-xy-canvas-D6CYL9A8.js → vue-ui-xy-canvas-BKGOnjut.js} +11 -11
  149. package/dist/{vue-ui-xy-canvas-9e630nJX.cjs → vue-ui-xy-canvas-uikeVe72.cjs} +1 -1
  150. package/package.json +1 -1
  151. package/dist/vue-ui-table-sparkline-B7OPOium.cjs +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-BHQZE19X.cjs"),Ae=require("./useResponsive-BJ7DTGpm.cjs"),ue=require("./BaseIcon-2ZD3jgGz.cjs"),qe=require("./Tooltip-DjCKBAC4.cjs"),Le=require("./usePrinter-DVgxBO4o.cjs"),We=require("./Slicer-yEeqKUDF.cjs"),je=require("./vue-ui-skeleton-DUNkS05l.cjs"),_e=require("./useNestedProp-CwpqC_aE.cjs"),Ge=require("./PackageVersion-rnWHRWGI.cjs"),He=require("./PenAndPaper-BQl9-uX0.cjs"),Xe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={LINE:"LINE",BAR:"BAR",DONUT:"DONUT"},Ye=["SERIE","SERIES","DATA","VALUE","VALUES","NUM"];function Ze({dataset:c,barLineSwitch:w=6}){let f=null,b=null,N=0;if((typeof c=="number"||typeof c=="string")&&console.warn(`The provided dataset (${c}) is not sufficient to build a chart`),K(c)&&($(c)&&(c.length<w?f=S.BAR:f=S.LINE,b=c,N=c.length),se(c))){if(!Qe(c))return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."),!1;const U=Object.keys(c[0]),G=Object.values(c[0]);if(!U.some(A=>Ke(A)))return console.warn("The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important."),!1;ze(G,A=>typeof A=="number")&&(f=S.DONUT,b=c),ze(G,A=>Array.isArray(A)&&$(A))&&(Ce(c)>w?f=S.LINE:f=S.BAR,N=Ce(c),b=c.map(A=>({...A,data:et(A,P=>$(P))}))),c=c.map(A=>Ne(A)),b=b.map(A=>Ne(A))}return K(c)&&[...new Set(c.flatMap(U=>Array.isArray(U)))][0],{dataset:c,type:f,usableDataset:b,maxSeriesLength:N}}function Ve(c){return!c||K(c)&&!c.length}function K(c){return Array.isArray(c)}function $(c){if(!K(c)||Ve(c))return!1;const w=c.map(f=>Number(f));return![...new Set(w.flatMap(f=>typeof f=="number"&&!isNaN(f)))].includes(!1)}function se(c){return!K(c)||Ve(c)||!![...new Set(c.flatMap(f=>typeof f=="object"&&!Array.isArray(f)))].includes(!1)?!1:!c.map(f=>Object.keys(f).length>0).includes(!1)}function Je(c,w){const f=Object.keys(c).sort(),b=Object.keys(w).sort();if(f.length!==b.length)return!1;for(let N=0;N<f.length;N+=1){const V=f[N],M=b[N];if(V!==M||typeof c[V]!=typeof w[M])return!1}return!0}function Qe(c){if(c.length<=1)return!0;for(let w=0;w<c.length;w+=1)for(let f=w+1;f<c.length;f+=1)if(!Je(c[w],c[f]))return!1;return!0}function Ke(c){return Ye.includes(c.toUpperCase())}function ze(c,w){let f=[];for(let b=0;b<c.length;b+=1)f.push(w(c[b]));return f.includes(!0)}function Ce(c){return Math.max(...[...c].flatMap(w=>Object.values(w).filter(f=>$(f)).map(f=>f.length)))}function et(c,w){return Object.values(c).filter(f=>w(f))[0]}function Ne(c){const w={};for(let f in c)c.hasOwnProperty(f)&&(w[f.toUpperCase()]=c[f]);return w}const Fe=c=>(e.pushScopeId("data-v-7c8df607"),c=c(),e.popScopeId(),c),tt=["id"],lt=["xmlns","viewBox"],at=["id"],ot=["id"],nt=Fe(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),rt=["id"],it=["flood-color"],ut={key:0,class:"donut-label-connectors"},st=["d","stroke","stroke-width","filter"],ct=["cx","cy","r","fill","filter"],dt={class:"donut"},vt=["d","fill","stroke","stroke-width","filter"],mt=["d","onMouseenter","onClick"],ft={key:1,class:"donut-labels quick-animation"},ht=["cx","cy","fill","stroke","filter"],pt=["text-anchor","x","y","fill","font-size","filter"],kt=["text-anchor","x","y","fill","font-size","filter"],gt={key:2,class:"donut-hollow quick-animation"},yt=["x","y","font-size","fill"],xt=["x","y","font-size","fill"],St={key:0,class:"line-grid"},bt=["x1","x2","y1","y2","stroke","stroke-width"],Bt=["x1","x2","y1","y2","stroke","stroke-width"],wt={key:1,class:"line-axis"},Et=["x1","x2","y1","y2","stroke","stroke-width"],At=["x1","x2","y1","y2","stroke","stroke-width"],Lt={key:2,class:"yLabels"},_t=["x1","x2","y1","y2","stroke","stroke-width"],zt=["x","y","font-size","fill"],Ct={key:3,class:"periodLabels"},Nt=["x1","x2","y1","y2","stroke","stroke-width"],Vt=["font-size","text-anchor","fill","transform"],Ft={class:"plots"},Pt={class:"line-plot-series"},$t=["d","stroke","stroke-width"],It=["d","stroke","stroke-width"],Tt=["d","stroke","stroke-width"],Rt=["d","stroke","stroke-width"],Ot=["cx","cy","fill","stroke"],Dt={key:4,class:"dataLabels"},Mt=["font-size","fill","x","y"],Ut={class:"tooltip-traps"},qt=["x","y","height","width","fill","onMouseenter","onClick"],Wt={key:0,class:"line-grid"},jt=["x1","x2","y1","y2","stroke","stroke-width"],Gt=["x1","x2","y1","y2","stroke","stroke-width"],Ht={key:1,class:"line-axis"},Xt=["x1","x2","y1","y2","stroke","stroke-width"],Yt=["x1","x2","y1","y2","stroke","stroke-width"],Zt={key:2,class:"yLabels"},Jt=["x1","x2","y1","y2","stroke","stroke-width"],Qt=["x","y","font-size","fill"],Kt={key:3,class:"periodLabels"},el=["x1","x2","y1","y2","stroke","stroke-width"],tl=["font-size","text-anchor","transform","fill"],ll={class:"plots"},al=["x","width","height","y","fill","stroke","stroke-width"],ol=["to"],nl=["from","to"],rl={key:4,class:"dataLabels"},il=["x","y","font-size","fill"],ul={class:"tooltip-traps"},sl=["x","y","height","width","fill","onMouseenter","onClick"],cl={key:3,class:"axis-labels"},dl={key:0},vl=["font-size","fill","x","y"],ml={key:1},fl=["font-size","fill","x","y"],hl={key:2},pl=["font-size","fill","transform"],kl={key:3},gl=["font-size","fill","transform"],yl={key:6,class:"vue-data-ui-watermark"},xl=["onClick"],Sl=["onClick"],bl=["onClick"],Bl={key:1,class:"vue-ui-quick-chart-not-processable"},wl=Fe(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),El={__name:"vue-ui-quick-chart",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}}},emits:["selectDatapoint","selectLegend"],setup(c,{expose:w,emit:f}){const b=c,{vue_ui_quick_chart:N}=u.useConfig(),V=e.ref(null),M=e.ref(null),U=e.ref(null),G=e.ref(null),A=e.ref(u.createUid()),P=e.ref(!1),H=e.ref(null),T=e.ref(""),F=e.ref(null),ve=e.ref(null),me=e.ref(null),x=e.ref([]),fe=e.ref(0),ee=e.ref(0),t=e.computed({get:()=>he(),set:n=>n});function he(){const n=_e.useNestedProp({userConfig:b.config,defaultConfig:N});let s={};return n.theme?s={..._e.useNestedProp({userConfig:u.themes.vue_ui_quick_chart[n.theme]||b.config,defaultConfig:n}),customPalette:u.themePalettes[n.theme]||u.palette}:s=n,b.config&&u.hasDeepProperty(b.config,"zoomStartIndex")?s.zoomStartIndex=b.config.zoomStartIndex:s.zoomStartIndex=null,b.config&&u.hasDeepProperty(b.config,"zoomEndIndex")?s.zoomEndIndex=b.config.zoomEndIndex:s.zoomEndIndex=null,s}e.watch(()=>b.config,n=>{t.value=he(),y.value.width=t.value.width,y.value.height=t.value.height,ge()},{deep:!0}),e.watch(()=>b.dataset,n=>{h.value=Y.value,k.value.start=0,k.value.end=h.value.maxSeriesLength,ee.value+=1},{deep:!0});const X=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),Y=e.computed(()=>{const n=Ze({dataset:u.sanitizeArray(b.dataset,["serie","series","data","value","values","num"]),barLineSwitch:t.value.chartIsBarUnderDatasetLength});return n||console.error("VueUiQuickChart : Dataset is not processable"),n}),h=e.ref(Y.value),Pe=e.computed(()=>!!h.value),B=e.computed(()=>h.value?h.value.type:null);e.watch(()=>B.value,n=>{n||u.error({componentName:"VueUiQuickChart",type:"dataset"})},{immediate:!0});const{isPrinting:te,isImaging:le,generatePdf:pe,generateImage:ke}=Le.usePrinter({elementId:`${B.value}_${A.value}`,fileName:t.value.title||B.value}),$e=e.computed(()=>t.value.showUserOptions&&!t.value.title),y=e.ref({width:t.value.width,height:t.value.height}),ae=e.ref({showTooltip:t.value.showTooltip}),oe=e.ref(null);e.onMounted(()=>{ge()});function ge(){if(t.value.responsive){const n=Ae.throttle(()=>{const{width:s,height:l}=Ae.useResponsive({chart:V.value,title:t.value.title?M.value:null,legend:t.value.showLegend?U.value:null,slicer:[S.BAR,S.LINE].includes(B.value)&&t.value.zoomXy&&h.value.maxSeriesLength>1?G.value:null,source:ve.value,noTitle:me.value});y.value.width=s,y.value.height=l});oe.value=new ResizeObserver(n),oe.value.observe(V.value.parentNode)}we()}e.onBeforeUnmount(()=>{oe.value&&oe.value.disconnect()});const Ie=e.computed(()=>{switch(B.value){case S.LINE:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`;case S.BAR:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`;case S.DONUT:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`;default:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`}});function ye(n){return[...n].map(s=>s.value).reduce((s,l)=>s+l,0)}function Z(n){return t.value.blurOnHover&&![null,void 0].includes(F.value)&&F.value!==n?`url(#blur_${A.value})`:""}function xe(n,s){x.value.includes(n)?x.value=x.value.filter(l=>l!==n):x.value.length<s&&x.value.push(n)}const Se=e.ref(null),be=e.ref(null),ne=e.ref(!1);function Te(n,s){ne.value=!0;let l=n.value;if(x.value.includes(n.id)){let i=function(){l>r?(ne.value=!1,cancelAnimationFrame(be.value),h.value={...h.value,dataset:h.value.dataset.map((m,_)=>n.id===`donut_${_}`?{...m,value:r,VALUE:r}:m)}):(l+=r*.025,h.value={...h.value,dataset:h.value.dataset.map((m,_)=>n.id===`donut_${_}`?{...m,value:l,VALUE:l}:m)},be.value=requestAnimationFrame(i))};x.value=x.value.filter(m=>m!==n.id);const r=Y.value.dataset.find((m,_)=>n.id===`donut_${_}`).VALUE;i()}else if(s.length>1){let r=function(){l<.1?(ne.value=!1,cancelAnimationFrame(Se.value),x.value.push(n.id),h.value={...h.value,dataset:h.value.dataset.map((i,m)=>n.id===`donut_${m}`?{...i,value:0,VALUE:0}:i)}):(l/=1.1,h.value={...h.value,dataset:h.value.dataset.map((i,m)=>n.id===`donut_${m}`?{...i,value:l,VALUE:l}:i)},Se.value=requestAnimationFrame(r))};r()}}const I=e.ref(null);function Re(n){I.value=n}const Be=e.computed(()=>t.value.donutThicknessRatio<.15?.15:t.value.donutThicknessRatio>.4?.4:t.value.donutThicknessRatio),E=e.computed(()=>{if(B.value!==S.DONUT)return null;const n=h.value.dataset.map((a,o)=>({...a,value:a.VALUE||a.DATA||a.SERIE||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`donut_${o}`})).map((a,o)=>({...a,color:a.COLOR?u.convertColorToHex(a.COLOR):X.value[o+t.value.paletteStartIndex]||u.palette[o+t.value.paletteStartIndex]||u.palette[(o+t.value.paletteStartIndex)%u.palette.length],immutableValue:a.value}));function s(a,o){return u.dataLabel({v:isNaN(a.value/ye(o))?0:a.value/ye(o)*100,s:"%",r:t.value.dataLabelRoundingPercentage})}function l(a){return a.proportion*100>t.value.donutHideLabelUnderPercentage}function r(a,o){const g=Y.value.dataset.find((L,z)=>`donut_${z}`===a).VALUE;return Math.abs(String(Number(g.toFixed(0))).length-String(Number(o.toFixed(0))).length)}function i({datapoint:a,seriesIndex:o}){H.value={datapoint:a,seriesIndex:o,config:t.value,dataset:n},F.value=a.id;const g=t.value.tooltipCustomFormat;if(u.isFunction(g)&&u.functionReturnsString(()=>g({datapoint:a,seriesIndex:o,series:n,config:t.value})))T.value=g({datapoint:a,seriesIndex:o,series:n,config:t.value});else{let p="";p+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${a.name}</div>`,p+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${a.color}"/></svg>`,p+=`<b>${u.applyDataLabel(t.value.formatter,a.value,u.dataLabel({p:t.value.valuePrefix,v:a.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:a,seriesIndex:o})}</b>`,p+=`<span>(${u.dataLabel({v:a.proportion*100,s:"%",r:t.value.dataLabelRoundingPercentage})})</span></div>`,T.value=`<div>${p}</div>`}P.value=!0}function m(){P.value=!1,F.value=null,I.value=null}const _={centerX:y.value.width/2,centerY:y.value.height/2},C=n.filter(a=>!x.value.includes(a.id)).map(a=>a.value||0).reduce((a,o)=>a+o,0),W=n.map((a,o)=>({...a,proportion:(a.value||0)/C,value:a.value||0,absoluteValue:Y.value.dataset.find((g,p)=>`donut_${p}`===a.id).VALUE})),R=y.value.width/2,j=y.value.height/2,O=y.value.height*t.value.donutRadiusRatio;return{dataset:W.filter(a=>!x.value.includes(a.id)),legend:W,drawingArea:_,displayArcPercentage:s,isArcBigEnough:l,useTooltip:i,killTooltip:m,getSpaces:r,total:C,cx:R,cy:j,radius:O,chart:u.makeDonut({series:n.filter(a=>!x.value.includes(a.id))},R,j,O,O,1.99999,2,1,360,105.25,y.value.height*Be.value)}}),k=e.ref({start:0,end:h.value.maxSeriesLength});function Oe(){we()}const q=e.ref(null);async function we(){(t.value.zoomStartIndex!==null||t.value.zoomEndIndex!==null)&&q.value?(t.value.zoomStartIndex!==null&&(await e.nextTick(),await e.nextTick(),q.value&&q.value.setStartValue(t.value.zoomStartIndex)),t.value.zoomEndIndex!==null&&(await e.nextTick(),await e.nextTick(),q.value&&q.value.setEndValue(De(t.value.zoomEndIndex+1)))):(k.value={start:0,end:h.value.maxSeriesLength},ee.value+=1)}function De(n){const s=h.value.maxSeriesLength;return n>s?s:n<0||t.value.zoomStartIndex!==null&&n<t.value.zoomStartIndex?t.value.zoomStartIndex!==null?t.value.zoomStartIndex+1:1:n}const Me=e.computed(()=>{if(!t.value.zoomMinimap.show||B.value===S.DONUT)return[];let n=[];$(h.value.dataset)&&(n=h.value.dataset),se(h.value.dataset)&&(n=h.value.dataset.map((i,m)=>({values:i.VALUE||i.DATA||i.SERIE||i.SERIES||i.VALUES||i.NUM||0,id:B.value===S.LINE?`line_${m}`:`bar_${m}`})).filter(i=>!x.value.includes(i.id)));const s=$(n)?n.length:Math.max(...n.map(i=>i.values.length));let l=[];if($(n))l=n;else for(let i=0;i<s;i+=1)l.push(n.map(m=>m.values[i]||0).reduce((m,_)=>(m||0)+(_||0),0));const r=Math.min(...l);return l.map(i=>i+(r<0?Math.abs(r):0))}),v=e.computed(()=>{if(B.value!==S.LINE)return null;const n={height:y.value.height,width:y.value.width},s={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:n.width-t.value.xyPaddingRight,bottom:n.height-t.value.xyPaddingBottom,width:n.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:n.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];$(h.value.dataset)&&(l=[{values:h.value.dataset.slice(k.value.start,k.value.end),absoluteIndices:h.value.dataset.map((a,o)=>o).slice(k.value.start,k.value.end),name:t.value.title,color:X.value[t.value.paletteStartIndex]||u.palette[t.value.paletteStartIndex],id:"line_0"}]),se(h.value.dataset)&&(l=h.value.dataset.map((a,o)=>({...a,values:a.VALUE||a.DATA||a.SERIE||a.SERIES||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`line_${o}`})).map((a,o)=>({...a,color:a.COLOR?u.convertColorToHex(a.COLOR):X.value[o+t.value.paletteStartIndex]||u.palette[o+t.value.paletteStartIndex]||u.palette[(o+t.value.paletteStartIndex)%u.palette.length],values:a.values.slice(k.value.start,k.value.end),absoluteIndices:a.values.map((g,p)=>p).slice(k.value.start,k.value.end)})));const r={max:Math.max(...l.filter(a=>!x.value.includes(a.id)).flatMap(a=>a.values)),min:Math.min(...l.filter(a=>!x.value.includes(a.id)).flatMap(a=>a.values)),maxSeries:Math.max(...l.map(a=>a.values.length))},i=u.calculateNiceScale(r.min<0?r.min:0,r.max<0?0:r.max,t.value.xyScaleSegments),m=r.min<0?Math.abs(r.min):0,_=r.max<0?s.top:s.bottom-m/(i.max+m)*s.height,C=s.width/r.maxSeries,W=i.ticks.map(a=>({y:s.bottom-s.height*((a+m)/(i.max+m)),x:s.left-8,value:a})),R=l.map((a,o)=>({...a,coordinates:a.values.map((g,p)=>({x:s.left+C*(p+1)-C/2,y:s.bottom-(g+m)/(i.max+m)*s.height,value:g}))})).map(a=>{let o=[];return a.coordinates.forEach(g=>{o.push(`${g.x},${g.y} `)}),{...a,linePath:o.join(" ")}});function j(a){F.value=a,I.value=a;const o=l.map(p=>({...p,value:p.values[a],absoluteIndex:p.absoluteIndices[a]})).filter(p=>!x.value.includes(p.id));H.value={datapoint:o,seriesIndex:a,config:t.value,dataset:l};const g=t.value.tooltipCustomFormat;if(u.isFunction(g)&&u.functionReturnsString(()=>g({datapoint:o,seriesIndex:a,series:l,config:t.value})))T.value=g({datapoint:o,seriesIndex:a,series:l,config:t.value});else{let p="";t.value.xyPeriods[o[0].absoluteIndex]&&(p+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[o[0].absoluteIndex]}</div>`),o.forEach((L,z)=>{p+=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DoD-GxZR.cjs"),Ae=require("./useResponsive-BJ7DTGpm.cjs"),ue=require("./BaseIcon-DemqZ_13.cjs"),qe=require("./Tooltip-CS4C58T7.cjs"),Le=require("./usePrinter-B4xDG31F.cjs"),We=require("./Slicer-CWvkt-8k.cjs"),je=require("./vue-ui-skeleton-Nuju6X7l.cjs"),_e=require("./useNestedProp-D_feh7A_.cjs"),Ge=require("./PackageVersion-BEtuCME5.cjs"),He=require("./PenAndPaper-BIcmfBvD.cjs"),Xe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={LINE:"LINE",BAR:"BAR",DONUT:"DONUT"},Ye=["SERIE","SERIES","DATA","VALUE","VALUES","NUM"];function Ze({dataset:c,barLineSwitch:w=6}){let f=null,b=null,N=0;if((typeof c=="number"||typeof c=="string")&&console.warn(`The provided dataset (${c}) is not sufficient to build a chart`),K(c)&&($(c)&&(c.length<w?f=S.BAR:f=S.LINE,b=c,N=c.length),se(c))){if(!Qe(c))return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."),!1;const U=Object.keys(c[0]),G=Object.values(c[0]);if(!U.some(A=>Ke(A)))return console.warn("The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important."),!1;ze(G,A=>typeof A=="number")&&(f=S.DONUT,b=c),ze(G,A=>Array.isArray(A)&&$(A))&&(Ce(c)>w?f=S.LINE:f=S.BAR,N=Ce(c),b=c.map(A=>({...A,data:et(A,P=>$(P))}))),c=c.map(A=>Ne(A)),b=b.map(A=>Ne(A))}return K(c)&&[...new Set(c.flatMap(U=>Array.isArray(U)))][0],{dataset:c,type:f,usableDataset:b,maxSeriesLength:N}}function Ve(c){return!c||K(c)&&!c.length}function K(c){return Array.isArray(c)}function $(c){if(!K(c)||Ve(c))return!1;const w=c.map(f=>Number(f));return![...new Set(w.flatMap(f=>typeof f=="number"&&!isNaN(f)))].includes(!1)}function se(c){return!K(c)||Ve(c)||!![...new Set(c.flatMap(f=>typeof f=="object"&&!Array.isArray(f)))].includes(!1)?!1:!c.map(f=>Object.keys(f).length>0).includes(!1)}function Je(c,w){const f=Object.keys(c).sort(),b=Object.keys(w).sort();if(f.length!==b.length)return!1;for(let N=0;N<f.length;N+=1){const V=f[N],M=b[N];if(V!==M||typeof c[V]!=typeof w[M])return!1}return!0}function Qe(c){if(c.length<=1)return!0;for(let w=0;w<c.length;w+=1)for(let f=w+1;f<c.length;f+=1)if(!Je(c[w],c[f]))return!1;return!0}function Ke(c){return Ye.includes(c.toUpperCase())}function ze(c,w){let f=[];for(let b=0;b<c.length;b+=1)f.push(w(c[b]));return f.includes(!0)}function Ce(c){return Math.max(...[...c].flatMap(w=>Object.values(w).filter(f=>$(f)).map(f=>f.length)))}function et(c,w){return Object.values(c).filter(f=>w(f))[0]}function Ne(c){const w={};for(let f in c)c.hasOwnProperty(f)&&(w[f.toUpperCase()]=c[f]);return w}const Fe=c=>(e.pushScopeId("data-v-7c8df607"),c=c(),e.popScopeId(),c),tt=["id"],lt=["xmlns","viewBox"],at=["id"],ot=["id"],nt=Fe(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),rt=["id"],it=["flood-color"],ut={key:0,class:"donut-label-connectors"},st=["d","stroke","stroke-width","filter"],ct=["cx","cy","r","fill","filter"],dt={class:"donut"},vt=["d","fill","stroke","stroke-width","filter"],mt=["d","onMouseenter","onClick"],ft={key:1,class:"donut-labels quick-animation"},ht=["cx","cy","fill","stroke","filter"],pt=["text-anchor","x","y","fill","font-size","filter"],kt=["text-anchor","x","y","fill","font-size","filter"],gt={key:2,class:"donut-hollow quick-animation"},yt=["x","y","font-size","fill"],xt=["x","y","font-size","fill"],St={key:0,class:"line-grid"},bt=["x1","x2","y1","y2","stroke","stroke-width"],Bt=["x1","x2","y1","y2","stroke","stroke-width"],wt={key:1,class:"line-axis"},Et=["x1","x2","y1","y2","stroke","stroke-width"],At=["x1","x2","y1","y2","stroke","stroke-width"],Lt={key:2,class:"yLabels"},_t=["x1","x2","y1","y2","stroke","stroke-width"],zt=["x","y","font-size","fill"],Ct={key:3,class:"periodLabels"},Nt=["x1","x2","y1","y2","stroke","stroke-width"],Vt=["font-size","text-anchor","fill","transform"],Ft={class:"plots"},Pt={class:"line-plot-series"},$t=["d","stroke","stroke-width"],It=["d","stroke","stroke-width"],Tt=["d","stroke","stroke-width"],Rt=["d","stroke","stroke-width"],Ot=["cx","cy","fill","stroke"],Dt={key:4,class:"dataLabels"},Mt=["font-size","fill","x","y"],Ut={class:"tooltip-traps"},qt=["x","y","height","width","fill","onMouseenter","onClick"],Wt={key:0,class:"line-grid"},jt=["x1","x2","y1","y2","stroke","stroke-width"],Gt=["x1","x2","y1","y2","stroke","stroke-width"],Ht={key:1,class:"line-axis"},Xt=["x1","x2","y1","y2","stroke","stroke-width"],Yt=["x1","x2","y1","y2","stroke","stroke-width"],Zt={key:2,class:"yLabels"},Jt=["x1","x2","y1","y2","stroke","stroke-width"],Qt=["x","y","font-size","fill"],Kt={key:3,class:"periodLabels"},el=["x1","x2","y1","y2","stroke","stroke-width"],tl=["font-size","text-anchor","transform","fill"],ll={class:"plots"},al=["x","width","height","y","fill","stroke","stroke-width"],ol=["to"],nl=["from","to"],rl={key:4,class:"dataLabels"},il=["x","y","font-size","fill"],ul={class:"tooltip-traps"},sl=["x","y","height","width","fill","onMouseenter","onClick"],cl={key:3,class:"axis-labels"},dl={key:0},vl=["font-size","fill","x","y"],ml={key:1},fl=["font-size","fill","x","y"],hl={key:2},pl=["font-size","fill","transform"],kl={key:3},gl=["font-size","fill","transform"],yl={key:6,class:"vue-data-ui-watermark"},xl=["onClick"],Sl=["onClick"],bl=["onClick"],Bl={key:1,class:"vue-ui-quick-chart-not-processable"},wl=Fe(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),El={__name:"vue-ui-quick-chart",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}}},emits:["selectDatapoint","selectLegend"],setup(c,{expose:w,emit:f}){const b=c,{vue_ui_quick_chart:N}=u.useConfig(),V=e.ref(null),M=e.ref(null),U=e.ref(null),G=e.ref(null),A=e.ref(u.createUid()),P=e.ref(!1),H=e.ref(null),T=e.ref(""),F=e.ref(null),ve=e.ref(null),me=e.ref(null),x=e.ref([]),fe=e.ref(0),ee=e.ref(0),t=e.computed({get:()=>he(),set:n=>n});function he(){const n=_e.useNestedProp({userConfig:b.config,defaultConfig:N});let s={};return n.theme?s={..._e.useNestedProp({userConfig:u.themes.vue_ui_quick_chart[n.theme]||b.config,defaultConfig:n}),customPalette:u.themePalettes[n.theme]||u.palette}:s=n,b.config&&u.hasDeepProperty(b.config,"zoomStartIndex")?s.zoomStartIndex=b.config.zoomStartIndex:s.zoomStartIndex=null,b.config&&u.hasDeepProperty(b.config,"zoomEndIndex")?s.zoomEndIndex=b.config.zoomEndIndex:s.zoomEndIndex=null,s}e.watch(()=>b.config,n=>{t.value=he(),y.value.width=t.value.width,y.value.height=t.value.height,ge()},{deep:!0}),e.watch(()=>b.dataset,n=>{h.value=Y.value,k.value.start=0,k.value.end=h.value.maxSeriesLength,ee.value+=1},{deep:!0});const X=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),Y=e.computed(()=>{const n=Ze({dataset:u.sanitizeArray(b.dataset,["serie","series","data","value","values","num"]),barLineSwitch:t.value.chartIsBarUnderDatasetLength});return n||console.error("VueUiQuickChart : Dataset is not processable"),n}),h=e.ref(Y.value),Pe=e.computed(()=>!!h.value),B=e.computed(()=>h.value?h.value.type:null);e.watch(()=>B.value,n=>{n||u.error({componentName:"VueUiQuickChart",type:"dataset"})},{immediate:!0});const{isPrinting:te,isImaging:le,generatePdf:pe,generateImage:ke}=Le.usePrinter({elementId:`${B.value}_${A.value}`,fileName:t.value.title||B.value}),$e=e.computed(()=>t.value.showUserOptions&&!t.value.title),y=e.ref({width:t.value.width,height:t.value.height}),ae=e.ref({showTooltip:t.value.showTooltip}),oe=e.ref(null);e.onMounted(()=>{ge()});function ge(){if(t.value.responsive){const n=Ae.throttle(()=>{const{width:s,height:l}=Ae.useResponsive({chart:V.value,title:t.value.title?M.value:null,legend:t.value.showLegend?U.value:null,slicer:[S.BAR,S.LINE].includes(B.value)&&t.value.zoomXy&&h.value.maxSeriesLength>1?G.value:null,source:ve.value,noTitle:me.value});y.value.width=s,y.value.height=l});oe.value=new ResizeObserver(n),oe.value.observe(V.value.parentNode)}we()}e.onBeforeUnmount(()=>{oe.value&&oe.value.disconnect()});const Ie=e.computed(()=>{switch(B.value){case S.LINE:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`;case S.BAR:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`;case S.DONUT:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`;default:return`0 0 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`}});function ye(n){return[...n].map(s=>s.value).reduce((s,l)=>s+l,0)}function Z(n){return t.value.blurOnHover&&![null,void 0].includes(F.value)&&F.value!==n?`url(#blur_${A.value})`:""}function xe(n,s){x.value.includes(n)?x.value=x.value.filter(l=>l!==n):x.value.length<s&&x.value.push(n)}const Se=e.ref(null),be=e.ref(null),ne=e.ref(!1);function Te(n,s){ne.value=!0;let l=n.value;if(x.value.includes(n.id)){let i=function(){l>r?(ne.value=!1,cancelAnimationFrame(be.value),h.value={...h.value,dataset:h.value.dataset.map((m,_)=>n.id===`donut_${_}`?{...m,value:r,VALUE:r}:m)}):(l+=r*.025,h.value={...h.value,dataset:h.value.dataset.map((m,_)=>n.id===`donut_${_}`?{...m,value:l,VALUE:l}:m)},be.value=requestAnimationFrame(i))};x.value=x.value.filter(m=>m!==n.id);const r=Y.value.dataset.find((m,_)=>n.id===`donut_${_}`).VALUE;i()}else if(s.length>1){let r=function(){l<.1?(ne.value=!1,cancelAnimationFrame(Se.value),x.value.push(n.id),h.value={...h.value,dataset:h.value.dataset.map((i,m)=>n.id===`donut_${m}`?{...i,value:0,VALUE:0}:i)}):(l/=1.1,h.value={...h.value,dataset:h.value.dataset.map((i,m)=>n.id===`donut_${m}`?{...i,value:l,VALUE:l}:i)},Se.value=requestAnimationFrame(r))};r()}}const I=e.ref(null);function Re(n){I.value=n}const Be=e.computed(()=>t.value.donutThicknessRatio<.15?.15:t.value.donutThicknessRatio>.4?.4:t.value.donutThicknessRatio),E=e.computed(()=>{if(B.value!==S.DONUT)return null;const n=h.value.dataset.map((a,o)=>({...a,value:a.VALUE||a.DATA||a.SERIE||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`donut_${o}`})).map((a,o)=>({...a,color:a.COLOR?u.convertColorToHex(a.COLOR):X.value[o+t.value.paletteStartIndex]||u.palette[o+t.value.paletteStartIndex]||u.palette[(o+t.value.paletteStartIndex)%u.palette.length],immutableValue:a.value}));function s(a,o){return u.dataLabel({v:isNaN(a.value/ye(o))?0:a.value/ye(o)*100,s:"%",r:t.value.dataLabelRoundingPercentage})}function l(a){return a.proportion*100>t.value.donutHideLabelUnderPercentage}function r(a,o){const g=Y.value.dataset.find((L,z)=>`donut_${z}`===a).VALUE;return Math.abs(String(Number(g.toFixed(0))).length-String(Number(o.toFixed(0))).length)}function i({datapoint:a,seriesIndex:o}){H.value={datapoint:a,seriesIndex:o,config:t.value,dataset:n},F.value=a.id;const g=t.value.tooltipCustomFormat;if(u.isFunction(g)&&u.functionReturnsString(()=>g({datapoint:a,seriesIndex:o,series:n,config:t.value})))T.value=g({datapoint:a,seriesIndex:o,series:n,config:t.value});else{let p="";p+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${a.name}</div>`,p+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${a.color}"/></svg>`,p+=`<b>${u.applyDataLabel(t.value.formatter,a.value,u.dataLabel({p:t.value.valuePrefix,v:a.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:a,seriesIndex:o})}</b>`,p+=`<span>(${u.dataLabel({v:a.proportion*100,s:"%",r:t.value.dataLabelRoundingPercentage})})</span></div>`,T.value=`<div>${p}</div>`}P.value=!0}function m(){P.value=!1,F.value=null,I.value=null}const _={centerX:y.value.width/2,centerY:y.value.height/2},C=n.filter(a=>!x.value.includes(a.id)).map(a=>a.value||0).reduce((a,o)=>a+o,0),W=n.map((a,o)=>({...a,proportion:(a.value||0)/C,value:a.value||0,absoluteValue:Y.value.dataset.find((g,p)=>`donut_${p}`===a.id).VALUE})),R=y.value.width/2,j=y.value.height/2,O=y.value.height*t.value.donutRadiusRatio;return{dataset:W.filter(a=>!x.value.includes(a.id)),legend:W,drawingArea:_,displayArcPercentage:s,isArcBigEnough:l,useTooltip:i,killTooltip:m,getSpaces:r,total:C,cx:R,cy:j,radius:O,chart:u.makeDonut({series:n.filter(a=>!x.value.includes(a.id))},R,j,O,O,1.99999,2,1,360,105.25,y.value.height*Be.value)}}),k=e.ref({start:0,end:h.value.maxSeriesLength});function Oe(){we()}const q=e.ref(null);async function we(){(t.value.zoomStartIndex!==null||t.value.zoomEndIndex!==null)&&q.value?(t.value.zoomStartIndex!==null&&(await e.nextTick(),await e.nextTick(),q.value&&q.value.setStartValue(t.value.zoomStartIndex)),t.value.zoomEndIndex!==null&&(await e.nextTick(),await e.nextTick(),q.value&&q.value.setEndValue(De(t.value.zoomEndIndex+1)))):(k.value={start:0,end:h.value.maxSeriesLength},ee.value+=1)}function De(n){const s=h.value.maxSeriesLength;return n>s?s:n<0||t.value.zoomStartIndex!==null&&n<t.value.zoomStartIndex?t.value.zoomStartIndex!==null?t.value.zoomStartIndex+1:1:n}const Me=e.computed(()=>{if(!t.value.zoomMinimap.show||B.value===S.DONUT)return[];let n=[];$(h.value.dataset)&&(n=h.value.dataset),se(h.value.dataset)&&(n=h.value.dataset.map((i,m)=>({values:i.VALUE||i.DATA||i.SERIE||i.SERIES||i.VALUES||i.NUM||0,id:B.value===S.LINE?`line_${m}`:`bar_${m}`})).filter(i=>!x.value.includes(i.id)));const s=$(n)?n.length:Math.max(...n.map(i=>i.values.length));let l=[];if($(n))l=n;else for(let i=0;i<s;i+=1)l.push(n.map(m=>m.values[i]||0).reduce((m,_)=>(m||0)+(_||0),0));const r=Math.min(...l);return l.map(i=>i+(r<0?Math.abs(r):0))}),v=e.computed(()=>{if(B.value!==S.LINE)return null;const n={height:y.value.height,width:y.value.width},s={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:n.width-t.value.xyPaddingRight,bottom:n.height-t.value.xyPaddingBottom,width:n.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:n.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];$(h.value.dataset)&&(l=[{values:h.value.dataset.slice(k.value.start,k.value.end),absoluteIndices:h.value.dataset.map((a,o)=>o).slice(k.value.start,k.value.end),name:t.value.title,color:X.value[t.value.paletteStartIndex]||u.palette[t.value.paletteStartIndex],id:"line_0"}]),se(h.value.dataset)&&(l=h.value.dataset.map((a,o)=>({...a,values:a.VALUE||a.DATA||a.SERIE||a.SERIES||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`line_${o}`})).map((a,o)=>({...a,color:a.COLOR?u.convertColorToHex(a.COLOR):X.value[o+t.value.paletteStartIndex]||u.palette[o+t.value.paletteStartIndex]||u.palette[(o+t.value.paletteStartIndex)%u.palette.length],values:a.values.slice(k.value.start,k.value.end),absoluteIndices:a.values.map((g,p)=>p).slice(k.value.start,k.value.end)})));const r={max:Math.max(...l.filter(a=>!x.value.includes(a.id)).flatMap(a=>a.values)),min:Math.min(...l.filter(a=>!x.value.includes(a.id)).flatMap(a=>a.values)),maxSeries:Math.max(...l.map(a=>a.values.length))},i=u.calculateNiceScale(r.min<0?r.min:0,r.max<0?0:r.max,t.value.xyScaleSegments),m=r.min<0?Math.abs(r.min):0,_=r.max<0?s.top:s.bottom-m/(i.max+m)*s.height,C=s.width/r.maxSeries,W=i.ticks.map(a=>({y:s.bottom-s.height*((a+m)/(i.max+m)),x:s.left-8,value:a})),R=l.map((a,o)=>({...a,coordinates:a.values.map((g,p)=>({x:s.left+C*(p+1)-C/2,y:s.bottom-(g+m)/(i.max+m)*s.height,value:g}))})).map(a=>{let o=[];return a.coordinates.forEach(g=>{o.push(`${g.x},${g.y} `)}),{...a,linePath:o.join(" ")}});function j(a){F.value=a,I.value=a;const o=l.map(p=>({...p,value:p.values[a],absoluteIndex:p.absoluteIndices[a]})).filter(p=>!x.value.includes(p.id));H.value={datapoint:o,seriesIndex:a,config:t.value,dataset:l};const g=t.value.tooltipCustomFormat;if(u.isFunction(g)&&u.functionReturnsString(()=>g({datapoint:o,seriesIndex:a,series:l,config:t.value})))T.value=g({datapoint:o,seriesIndex:a,series:l,config:t.value});else{let p="";t.value.xyPeriods[o[0].absoluteIndex]&&(p+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[o[0].absoluteIndex]}</div>`),o.forEach((L,z)=>{p+=`
2
2
  <div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;">
3
3
  <svg viewBox="0 0 12 12" height="14" width="12"><circle cx="6" cy="6" r="6" stroke="none" fill="${L.color}"/></svg>
4
4
  <span>${L.name}:</span>
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BHQZE19X.cjs"),ae=require("./useResponsive-BJ7DTGpm.cjs"),ke=require("./Title-5Vedk01J.cjs"),le=require("./usePrinter-DVgxBO4o.cjs"),be=require("./Tooltip-DjCKBAC4.cjs"),Ce=require("./vue-ui-sparkbar-IphZ8jXh.cjs"),we=require("./Legend-DPHcmrzd.cjs"),Be=require("./DataTable-kMUhutQ4.cjs"),_e=require("./vue-ui-skeleton-DUNkS05l.cjs"),Pe=require("./vue-ui-accordion-CRVWlHxs.cjs"),re=require("./useNestedProp-CwpqC_aE.cjs"),$e=require("./PackageVersion-rnWHRWGI.cjs"),xe=require("./PenAndPaper-BQl9-uX0.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Te=["id"],Se=["xmlns","viewBox"],Ee=["id"],Ve=["stop-color"],Ae=["stop-color"],Oe={key:0},Fe=["x1","y1","x2","y2","stroke","stroke-width"],Le={key:0},ze=["d","stroke","stroke-width"],Ie=["d","stroke","stroke-width"],Re={key:1},qe=["x","y","text-anchor","font-size","fill","onMouseenter"],De=["points","stroke","stroke-width"],Me=["points","stroke","stroke-width","fill"],Ue={key:2},Ge=["cx","cy","fill","r","stroke"],We={key:5,class:"vue-data-ui-watermark"},He=["onClick"],Xe={key:0,style:{"max-width":"200px",margin:"0 auto"}},je={__name:"vue-ui-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(ne,{expose:ue,emit:se}){const d=ne,{vue_ui_radar:ie}=n.useConfig(),C=e.computed(()=>!!d.dataset&&Object.keys(d.dataset).length),m=e.ref(n.createUid()),ce=e.ref(null),x=e.ref(!1),N=e.ref(""),F=e.ref(0),f=e.ref(null),L=e.ref(null),z=e.ref(null),I=e.ref(null),R=e.ref(null),q=e.ref(0),D=e.ref(0),M=e.ref(0),t=e.computed({get:()=>U(),set:o=>o});function U(){const o=re.useNestedProp({userConfig:d.config,defaultConfig:ie});return o.theme?{...re.useNestedProp({userConfig:n.themes.vue_ui_radar[o.theme]||d.config,defaultConfig:o}),customPalette:n.themePalettes[o.theme]||n.palette}:o}e.watch(()=>d.config,o=>{t.value=U(),G(),q.value+=1,D.value+=1,M.value+=1},{deep:!0});const B=e.ref(null);function G(){if(n.objectIsEmpty(d.dataset)&&n.error({componentName:"VueUiRadar",type:"dataset"}),t.value.responsive){const o=ae.throttle(()=>{const{width:a,height:l}=ae.useResponsive({chart:f.value,title:t.value.style.chart.title.text?L.value:null,legend:t.value.style.chart.legend.show?z.value:null,source:I.value,noTitle:R.value});s.value.width=a,s.value.height=l});B.value=new ResizeObserver(o),B.value.observe(f.value.parentNode)}}e.onMounted(()=>{G()}),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:W,isImaging:H,generatePdf:X,generateImage:j}=le.usePrinter({elementId:`vue-ui-radar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-radar"}),de=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Y=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),g=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),ve=e.computed(()=>({style:{backgroundColor:t.value.style.chart.tooltip.backgroundColor,animation:{show:t.value.style.chart.tooltip.animation.show,animationFrames:t.value.style.chart.tooltip.animation.animationFrames},labels:{fontSize:t.value.style.chart.tooltip.fontSize,name:{color:t.value.style.chart.tooltip.color}},gutter:{backgroundColor:"#CCCCCC",opacity:30}}})),s=e.ref({height:312,width:512}),i=e.ref([]),w=e.ref(null),y=e.ref(!1);function J(o){y.value=!0,i.value.includes(o)?(w.value=o,i.value=i.value.filter(a=>a!==o),setTimeout(()=>{y.value=!1,w.value=null},500)):(i.value.push(o),setTimeout(()=>{y.value=!1},500)),se("selectLegend",k.value.filter((a,l)=>!i.value.includes(l)).map(a=>({name:a.name,color:a.color,proportion:a.totalProportion})))}function pe(){return k.value.map(o=>({name:o.name,color:o.color,proportion:o.totalProportion}))}const v=e.computed(()=>[null,void 0].includes(d.dataset.categories)?(n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"categories ({ name: string; prefix?: string; suffix?: string}[])"}),[]):(d.dataset.categories.length===0?n.error({componentName:"VueUiRadar",type:"datasetAttributeEmpty",property:"categories"}):d.dataset.categories.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:`category.${l} at index ${a}`,index:a})})}),[null,void 0].includes(d.dataset.series)?n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"series ({ name: string; values: number[]; color?: string; target: number}[])"}):d.dataset.series.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values","target"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetSerieAttribute",key:"series",property:l,index:a})})}),d.dataset.categories.map((o,a)=>({name:o.name,categoryId:`radar_category_${m.value}_${a}`,color:n.convertColorToHex(o.color)||Y.value[a]||n.palette[a]||n.palette[a%n.palette.length],prefix:o.prefix??"",suffix:o.suffix??""})))),p=e.computed(()=>C.value?d.dataset.series.map((o,a)=>({...o,color:n.convertColorToHex(o.color)||Y.value[a]||n.palette[a]||n.palette[a%n.palette.length],serieId:`radar_serie_${m.value}_${a}`,formatter:o.formatter||null})):[]),K=e.computed(()=>Math.max(...p.value.flatMap(o=>o.values))),Q=e.computed(()=>p.value.length),T=e.computed(()=>Math.min(s.value.width,s.value.height)/3),Z=e.computed(()=>n.createPolygonPath({plot:{x:s.value.width/2,y:s.value.height/2},radius:T.value,sides:Q.value,rotation:0})),ge=e.computed(()=>{const o=[];for(let a=0;a<T.value;a+=T.value/t.value.style.chart.layout.grid.graduations)o.push(a);return o}),h=e.computed(()=>Z.value.coordinates.map((o,a)=>{const l=p.value[a].values.map(r=>he({centerX:s.value.width/2,centerY:s.value.height/2,apexX:o.x,apexY:o.y,proportion:r/(p.value[a].target||K.value)}));return{...o,...p.value[a],plots:l}}));function S({x:o,y:a}){let l="middle";return o=Math.round(o),a=Math.round(a),o>s.value.width/2&&(o+=12,l="start"),o<s.value.width/2&&(o-=12,l="end"),a>s.value.height/2&&(a+=20),a<s.value.height/2&&(a-=12),a===s.value.height/2&&(a+=4),{x:o,y:a,anchor:l}}function he({centerX:o,centerY:a,apexX:l,apexY:r,proportion:u}){return{x:o+(l-o)*u,y:a+(r-a)*u}}const k=e.computed(()=>{const o=p.value.map((a,l)=>a.values.map(r=>r/(a.target||K.value)));return v.value.map((a,l)=>({...a,totalProportion:n.checkNaN(o.map(r=>r[l]).reduce((r,u)=>r+u,0)/p.value.length),shape:"circle",opacity:i.value.includes(l)?.5:1,segregate:()=>J(l),isSegregated:i.value.includes(l)}))}),me=e.computed(()=>({cy:"radar-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),_=e.computed(()=>{const o=[{name:t.value.translations.datapoint,color:""},{name:t.value.translations.target,color:""},...k.value],a=d.dataset.series.map(r=>[r.name,n.applyDataLabel(r.formatter,r.target,n.dataLabel({p:r.prefix,v:r.target,s:r.suffix,r:t.value.table.td.roundingValue})),...r.values.map((u,c)=>`${n.applyDataLabel(r.formatter,u,n.dataLabel({p:v.value[c].prefix,v:u,s:v.value[c].suffix,r:t.value.table.td.roundingValue}))} (${isNaN(u/r.target)?"":n.dataLabel({v:u/r.target*100,s:"%",r:t.value.table.td.roundingPercentage})})`)]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:o,body:a,config:l,colNames:o}}),P=e.ref(null),E=e.ref([]),V=e.ref(null);function fe(o,a){E.value=[],P.value=a,x.value=!0;let l="";V.value={datapoint:o,seriesIndex:a,series:{categories:v.value,datapoints:p.value,radar:h.value},config:t.value};const r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:h.value},config:t.value})))N.value=r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:h.value},config:t.value});else{l+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`;for(let u=0;u<o.values.length;u+=1)i.value.includes(u)||E.value.push({name:v.value[u].name,value:o.values[u]/o.target*100,color:v.value[u].color,suffix:"%)",prefix:`${n.dataLabel({p:v.value[u].prefix??"",v:o.values[u],s:v.value[u].suffix??"",r:t.value.style.chart.tooltip.roundingValue})} (`,rounding:t.value.style.chart.tooltip.roundingPercentage,formatter:o.formatter});N.value=l}}function ee(){e.nextTick(()=>{const o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=[[""],[t.value.translations.target],...k.value.flatMap(c=>[[c.name],["%"]])],l=d.dataset.series.map((c,Je)=>[c.name,c.target,...c.values.flatMap(O=>[O,isNaN(O/c.target)?"":O/c.target*100])]),r=o.concat([a]).concat(l),u=n.createCsvContent(r);n.downloadCsv({csvContent:u,title:t.value.style.chart.title.text||"vue-ui-radar"})})}const b=e.ref(!1);function ye(o){b.value=o,F.value+=1}function te(){g.value.showTable=!g.value.showTable}function oe(){g.value.showTooltip=!g.value.showTooltip}const $=e.ref(!1);function A(){$.value=!$.value}return ue({getData:pe,generatePdf:X,generateCsv:ee,generateImage:j,toggleTable:te,toggleTooltip:oe,toggleAnnotator:A}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-radar ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"radarChart",ref:f,id:`vue-ui-radar_${m.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(xe.PenAndPaper,{key:0,parent:f.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:$.value,onClose:A},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),de.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:R,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:L,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(ke._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"radar-div-title",...t.value.style.chart.title},subtitle:{cy:"radar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&C.value?(e.openBlock(),e.createBlock(le.UserOptions,{ref_key:"details",ref:ce,key:`user_options_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(H),isPrinting:e.unref(W),uid:m.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:g.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:f.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:$.value,onToggleFullscreen:ye,onGeneratePdf:e.unref(X),onGenerateCsv:ee,onGenerateImage:e.unref(j),onToggleTable:te,onToggleTooltip:oe,onToggleAnnotator:A},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode($e._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`radar_gradient_${m.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(l.color,.05),t.value.style.chart.layout.dataPolygon.opacity)},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity)},null,8,Ae)],8,Ee))),256))]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,l=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.width/2,y1:s.value.height/2,x2:l.x,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,Fe))),256)),t.value.style.chart.layout.grid.graduations>0?(e.openBlock(),e.createElementBlock("g",Le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,l=>(e.openBlock(),e.createElementBlock("path",{d:e.unref(n.createPolygonPath)({plot:{x:s.value.width/2,y:s.value.height/2},radius:l,sides:Q.value,rotation:0}).path,fill:"none",stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,ze))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:Z.value.path,fill:"none",stroke:t.value.style.chart.layout.outerPolygon.stroke,"stroke-width":t.value.style.chart.layout.outerPolygon.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,Ie),t.value.style.chart.layout.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:S(l).x,y:S(l).y,"text-anchor":S(l).anchor,"font-size":t.value.style.chart.layout.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.labels.dataLabels.color,onMouseenter:u=>fe(l,r),onMouseleave:a[0]||(a[0]=u=>{x.value=!1,P.value=null})},e.toDisplayString(l.name),41,qe))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("g",null,[t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:0,"data-cy-radar-path":"",points:e.unref(n.makePath)(h.value.map(u=>u.plots[r]),!1,!0),stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth+1,fill:"none",class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===r&&t.value.useCssAnimation})},null,10,De)):e.createCommentVNode("",!0),t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:1,"data-cy-radar-path":"",points:e.unref(n.makePath)(h.value.map(u=>u.plots[r]),!1,!0),stroke:l.color,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth,fill:t.value.style.chart.layout.dataPolygon.transparent?"transparent":t.value.style.chart.layout.dataPolygon.useGradient?`url(#radar_gradient_${m.value}_${r})`:e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity),class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===r&&t.value.useCssAnimation})},null,10,Me)):e.createCommentVNode("",!0)])]))),256)),t.value.style.chart.layout.plots.show?(e.openBlock(),e.createElementBlock("g",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(u,c)=>(e.openBlock(),e.createElementBlock("circle",{cx:u.x,cy:u.y,fill:i.value.includes(c)?"transparent":v.value[c].color,r:P.value!==null&&P.value===r?t.value.style.chart.layout.plots.radius*1.6:t.value.style.chart.layout.plots.radius,stroke:i.value.includes(c)?"transparent":t.value.style.chart.backgroundColor,"stroke-width":.5,class:e.normalizeClass({"animated-out":i.value.includes(c)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===c&&t.value.useCssAnimation})},null,10,Ge))),256))]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:s.value},void 0,!0)],14,Se)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",We,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(W)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_e.default,{key:6,config:{type:"radar",style:{backgroundColor:t.value.style.chart.backgroundColor,radar:{grid:{color:t.value.style.chart.layout.outerPolygon.stroke},shapes:{color:t.value.style.chart.layout.outerPolygon.stroke}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:z},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(we.Legend,{key:`legend_${M.value}`,legendSet:k.value,config:me.value,onClickMarker:a[1]||(a[1]=({i:l})=>J(l))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:u=>l.segregate(),style:e.normalizeStyle(`opacity:${i.value.includes(r)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.dataLabel)({v:l.totalProportion*100,s:"%",r:t.value.style.chart.legend.roundingPercentage})),13,He)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:k.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:I,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(be._sfc_main,{show:g.value.showTooltip&&x.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,fontSize:t.value.style.chart.tooltip.fontSize,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:f.value,content:N.value,isFullscreen:b.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[["function"].includes(typeof t.value.style.chart.tooltip.customFormat)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Xe,[e.createVNode(Ce.default,{dataset:E.value,config:ve.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity},null,8,["dataset","config","backgroundOpacity"])])),e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","fontSize","position","offsetY","parent","content","isFullscreen","isCustom"]),C.value?(e.openBlock(),e.createBlock(Pe.default,{key:8,hideDetails:"",config:{open:g.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Be.DataTable,{key:`table_${D.value}`,colNames:_.value.colNames,head:_.value.head,body:_.value.body,config:_.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>g.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name),1)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Te))}},Ye=Ne._export_sfc(je,[["__scopeId","data-v-55dc5b4a"]]);exports.default=Ye;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-DoD-GxZR.cjs"),ae=require("./useResponsive-BJ7DTGpm.cjs"),ke=require("./Title-C2siG5N2.cjs"),le=require("./usePrinter-B4xDG31F.cjs"),be=require("./Tooltip-CS4C58T7.cjs"),Ce=require("./vue-ui-sparkbar-iQKGtxo8.cjs"),we=require("./Legend-Bbz-hKDf.cjs"),Be=require("./DataTable-CovKV5Yy.cjs"),_e=require("./vue-ui-skeleton-Nuju6X7l.cjs"),Pe=require("./vue-ui-accordion-CBxsUoGb.cjs"),re=require("./useNestedProp-D_feh7A_.cjs"),$e=require("./PackageVersion-BEtuCME5.cjs"),xe=require("./PenAndPaper-BIcmfBvD.cjs"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Te=["id"],Se=["xmlns","viewBox"],Ee=["id"],Ve=["stop-color"],Ae=["stop-color"],Oe={key:0},Fe=["x1","y1","x2","y2","stroke","stroke-width"],Le={key:0},ze=["d","stroke","stroke-width"],Ie=["d","stroke","stroke-width"],Re={key:1},qe=["x","y","text-anchor","font-size","fill","onMouseenter"],De=["points","stroke","stroke-width"],Me=["points","stroke","stroke-width","fill"],Ue={key:2},Ge=["cx","cy","fill","r","stroke"],We={key:5,class:"vue-data-ui-watermark"},He=["onClick"],Xe={key:0,style:{"max-width":"200px",margin:"0 auto"}},je={__name:"vue-ui-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(ne,{expose:ue,emit:se}){const d=ne,{vue_ui_radar:ie}=n.useConfig(),C=e.computed(()=>!!d.dataset&&Object.keys(d.dataset).length),m=e.ref(n.createUid()),ce=e.ref(null),x=e.ref(!1),N=e.ref(""),F=e.ref(0),f=e.ref(null),L=e.ref(null),z=e.ref(null),I=e.ref(null),R=e.ref(null),q=e.ref(0),D=e.ref(0),M=e.ref(0),t=e.computed({get:()=>U(),set:o=>o});function U(){const o=re.useNestedProp({userConfig:d.config,defaultConfig:ie});return o.theme?{...re.useNestedProp({userConfig:n.themes.vue_ui_radar[o.theme]||d.config,defaultConfig:o}),customPalette:n.themePalettes[o.theme]||n.palette}:o}e.watch(()=>d.config,o=>{t.value=U(),G(),q.value+=1,D.value+=1,M.value+=1},{deep:!0});const B=e.ref(null);function G(){if(n.objectIsEmpty(d.dataset)&&n.error({componentName:"VueUiRadar",type:"dataset"}),t.value.responsive){const o=ae.throttle(()=>{const{width:a,height:l}=ae.useResponsive({chart:f.value,title:t.value.style.chart.title.text?L.value:null,legend:t.value.style.chart.legend.show?z.value:null,source:I.value,noTitle:R.value});s.value.width=a,s.value.height=l});B.value=new ResizeObserver(o),B.value.observe(f.value.parentNode)}}e.onMounted(()=>{G()}),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:W,isImaging:H,generatePdf:X,generateImage:j}=le.usePrinter({elementId:`vue-ui-radar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-radar"}),de=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Y=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),g=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),ve=e.computed(()=>({style:{backgroundColor:t.value.style.chart.tooltip.backgroundColor,animation:{show:t.value.style.chart.tooltip.animation.show,animationFrames:t.value.style.chart.tooltip.animation.animationFrames},labels:{fontSize:t.value.style.chart.tooltip.fontSize,name:{color:t.value.style.chart.tooltip.color}},gutter:{backgroundColor:"#CCCCCC",opacity:30}}})),s=e.ref({height:312,width:512}),i=e.ref([]),w=e.ref(null),y=e.ref(!1);function J(o){y.value=!0,i.value.includes(o)?(w.value=o,i.value=i.value.filter(a=>a!==o),setTimeout(()=>{y.value=!1,w.value=null},500)):(i.value.push(o),setTimeout(()=>{y.value=!1},500)),se("selectLegend",k.value.filter((a,l)=>!i.value.includes(l)).map(a=>({name:a.name,color:a.color,proportion:a.totalProportion})))}function pe(){return k.value.map(o=>({name:o.name,color:o.color,proportion:o.totalProportion}))}const v=e.computed(()=>[null,void 0].includes(d.dataset.categories)?(n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"categories ({ name: string; prefix?: string; suffix?: string}[])"}),[]):(d.dataset.categories.length===0?n.error({componentName:"VueUiRadar",type:"datasetAttributeEmpty",property:"categories"}):d.dataset.categories.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:`category.${l} at index ${a}`,index:a})})}),[null,void 0].includes(d.dataset.series)?n.error({componentName:"VueUiRadar",type:"datasetAttribute",property:"series ({ name: string; values: number[]; color?: string; target: number}[])"}):d.dataset.series.forEach((o,a)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values","target"]}).forEach(l=>{n.error({componentName:"VueUiRadar",type:"datasetSerieAttribute",key:"series",property:l,index:a})})}),d.dataset.categories.map((o,a)=>({name:o.name,categoryId:`radar_category_${m.value}_${a}`,color:n.convertColorToHex(o.color)||Y.value[a]||n.palette[a]||n.palette[a%n.palette.length],prefix:o.prefix??"",suffix:o.suffix??""})))),p=e.computed(()=>C.value?d.dataset.series.map((o,a)=>({...o,color:n.convertColorToHex(o.color)||Y.value[a]||n.palette[a]||n.palette[a%n.palette.length],serieId:`radar_serie_${m.value}_${a}`,formatter:o.formatter||null})):[]),K=e.computed(()=>Math.max(...p.value.flatMap(o=>o.values))),Q=e.computed(()=>p.value.length),T=e.computed(()=>Math.min(s.value.width,s.value.height)/3),Z=e.computed(()=>n.createPolygonPath({plot:{x:s.value.width/2,y:s.value.height/2},radius:T.value,sides:Q.value,rotation:0})),ge=e.computed(()=>{const o=[];for(let a=0;a<T.value;a+=T.value/t.value.style.chart.layout.grid.graduations)o.push(a);return o}),h=e.computed(()=>Z.value.coordinates.map((o,a)=>{const l=p.value[a].values.map(r=>he({centerX:s.value.width/2,centerY:s.value.height/2,apexX:o.x,apexY:o.y,proportion:r/(p.value[a].target||K.value)}));return{...o,...p.value[a],plots:l}}));function S({x:o,y:a}){let l="middle";return o=Math.round(o),a=Math.round(a),o>s.value.width/2&&(o+=12,l="start"),o<s.value.width/2&&(o-=12,l="end"),a>s.value.height/2&&(a+=20),a<s.value.height/2&&(a-=12),a===s.value.height/2&&(a+=4),{x:o,y:a,anchor:l}}function he({centerX:o,centerY:a,apexX:l,apexY:r,proportion:u}){return{x:o+(l-o)*u,y:a+(r-a)*u}}const k=e.computed(()=>{const o=p.value.map((a,l)=>a.values.map(r=>r/(a.target||K.value)));return v.value.map((a,l)=>({...a,totalProportion:n.checkNaN(o.map(r=>r[l]).reduce((r,u)=>r+u,0)/p.value.length),shape:"circle",opacity:i.value.includes(l)?.5:1,segregate:()=>J(l),isSegregated:i.value.includes(l)}))}),me=e.computed(()=>({cy:"radar-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),_=e.computed(()=>{const o=[{name:t.value.translations.datapoint,color:""},{name:t.value.translations.target,color:""},...k.value],a=d.dataset.series.map(r=>[r.name,n.applyDataLabel(r.formatter,r.target,n.dataLabel({p:r.prefix,v:r.target,s:r.suffix,r:t.value.table.td.roundingValue})),...r.values.map((u,c)=>`${n.applyDataLabel(r.formatter,u,n.dataLabel({p:v.value[c].prefix,v:u,s:v.value[c].suffix,r:t.value.table.td.roundingValue}))} (${isNaN(u/r.target)?"":n.dataLabel({v:u/r.target*100,s:"%",r:t.value.table.td.roundingPercentage})})`)]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:o,body:a,config:l,colNames:o}}),P=e.ref(null),E=e.ref([]),V=e.ref(null);function fe(o,a){E.value=[],P.value=a,x.value=!0;let l="";V.value={datapoint:o,seriesIndex:a,series:{categories:v.value,datapoints:p.value,radar:h.value},config:t.value};const r=t.value.style.chart.tooltip.customFormat;if(n.isFunction(r)&&n.functionReturnsString(()=>r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:h.value},config:t.value})))N.value=r({seriesIndex:a,datapoint:o,series:{categories:v.value,datapoints:p.value,radar:h.value},config:t.value});else{l+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`;for(let u=0;u<o.values.length;u+=1)i.value.includes(u)||E.value.push({name:v.value[u].name,value:o.values[u]/o.target*100,color:v.value[u].color,suffix:"%)",prefix:`${n.dataLabel({p:v.value[u].prefix??"",v:o.values[u],s:v.value[u].suffix??"",r:t.value.style.chart.tooltip.roundingValue})} (`,rounding:t.value.style.chart.tooltip.roundingPercentage,formatter:o.formatter});N.value=l}}function ee(){e.nextTick(()=>{const o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=[[""],[t.value.translations.target],...k.value.flatMap(c=>[[c.name],["%"]])],l=d.dataset.series.map((c,Je)=>[c.name,c.target,...c.values.flatMap(O=>[O,isNaN(O/c.target)?"":O/c.target*100])]),r=o.concat([a]).concat(l),u=n.createCsvContent(r);n.downloadCsv({csvContent:u,title:t.value.style.chart.title.text||"vue-ui-radar"})})}const b=e.ref(!1);function ye(o){b.value=o,F.value+=1}function te(){g.value.showTable=!g.value.showTable}function oe(){g.value.showTooltip=!g.value.showTooltip}const $=e.ref(!1);function A(){$.value=!$.value}return ue({getData:pe,generatePdf:X,generateCsv:ee,generateImage:j,toggleTable:te,toggleTooltip:oe,toggleAnnotator:A}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-radar ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"radarChart",ref:f,id:`vue-ui-radar_${m.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(xe.PenAndPaper,{key:0,parent:f.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:$.value,onClose:A},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),de.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:R,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:L,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(ke._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"radar-div-title",...t.value.style.chart.title},subtitle:{cy:"radar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&C.value?(e.openBlock(),e.createBlock(le.UserOptions,{ref_key:"details",ref:ce,key:`user_options_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(H),isPrinting:e.unref(W),uid:m.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:g.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:f.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:$.value,onToggleFullscreen:ye,onGeneratePdf:e.unref(X),onGenerateCsv:ee,onGenerateImage:e.unref(j),onToggleTable:te,onToggleTooltip:oe,onToggleAnnotator:A},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode($e._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`radar_gradient_${m.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(l.color,.05),t.value.style.chart.layout.dataPolygon.opacity)},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity)},null,8,Ae)],8,Ee))),256))]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,l=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.width/2,y1:s.value.height/2,x2:l.x,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,Fe))),256)),t.value.style.chart.layout.grid.graduations>0?(e.openBlock(),e.createElementBlock("g",Le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,l=>(e.openBlock(),e.createElementBlock("path",{d:e.unref(n.createPolygonPath)({plot:{x:s.value.width/2,y:s.value.height/2},radius:l,sides:Q.value,rotation:0}).path,fill:"none",stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,ze))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:Z.value.path,fill:"none",stroke:t.value.style.chart.layout.outerPolygon.stroke,"stroke-width":t.value.style.chart.layout.outerPolygon.strokeWidth,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,Ie),t.value.style.chart.layout.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:S(l).x,y:S(l).y,"text-anchor":S(l).anchor,"font-size":t.value.style.chart.layout.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.labels.dataLabels.color,onMouseenter:u=>fe(l,r),onMouseleave:a[0]||(a[0]=u=>{x.value=!1,P.value=null})},e.toDisplayString(l.name),41,qe))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("g",null,[t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:0,"data-cy-radar-path":"",points:e.unref(n.makePath)(h.value.map(u=>u.plots[r]),!1,!0),stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth+1,fill:"none",class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===r&&t.value.useCssAnimation})},null,10,De)):e.createCommentVNode("",!0),t.value.useCssAnimation||!t.value.useCssAnimation&&!i.value.includes(r)?(e.openBlock(),e.createElementBlock("polygon",{key:1,"data-cy-radar-path":"",points:e.unref(n.makePath)(h.value.map(u=>u.plots[r]),!1,!0),stroke:l.color,"stroke-width":t.value.style.chart.layout.dataPolygon.strokeWidth,fill:t.value.style.chart.layout.dataPolygon.transparent?"transparent":t.value.style.chart.layout.dataPolygon.useGradient?`url(#radar_gradient_${m.value}_${r})`:e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity),class:e.normalizeClass({"animated-out":i.value.includes(r)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===r&&t.value.useCssAnimation})},null,10,Me)):e.createCommentVNode("",!0)])]))),256)),t.value.style.chart.layout.plots.show?(e.openBlock(),e.createElementBlock("g",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(u,c)=>(e.openBlock(),e.createElementBlock("circle",{cx:u.x,cy:u.y,fill:i.value.includes(c)?"transparent":v.value[c].color,r:P.value!==null&&P.value===r?t.value.style.chart.layout.plots.radius*1.6:t.value.style.chart.layout.plots.radius,stroke:i.value.includes(c)?"transparent":t.value.style.chart.backgroundColor,"stroke-width":.5,class:e.normalizeClass({"animated-out":i.value.includes(c)&&t.value.useCssAnimation,"animated-in":y.value&&w.value===c&&t.value.useCssAnimation})},null,10,Ge))),256))]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:s.value},void 0,!0)],14,Se)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",We,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(W)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_e.default,{key:6,config:{type:"radar",style:{backgroundColor:t.value.style.chart.backgroundColor,radar:{grid:{color:t.value.style.chart.layout.outerPolygon.stroke},shapes:{color:t.value.style.chart.layout.outerPolygon.stroke}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:z},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(we.Legend,{key:`legend_${M.value}`,legendSet:k.value,config:me.value,onClickMarker:a[1]||(a[1]=({i:l})=>J(l))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:u=>l.segregate(),style:e.normalizeStyle(`opacity:${i.value.includes(r)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.dataLabel)({v:l.totalProportion*100,s:"%",r:t.value.style.chart.legend.roundingPercentage})),13,He)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:k.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:I,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(be._sfc_main,{show:g.value.showTooltip&&x.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,fontSize:t.value.style.chart.tooltip.fontSize,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:f.value,content:N.value,isFullscreen:b.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[["function"].includes(typeof t.value.style.chart.tooltip.customFormat)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Xe,[e.createVNode(Ce.default,{dataset:E.value,config:ve.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity},null,8,["dataset","config","backgroundOpacity"])])),e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","fontSize","position","offsetY","parent","content","isFullscreen","isCustom"]),C.value?(e.openBlock(),e.createBlock(Pe.default,{key:8,hideDetails:"",config:{open:g.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Be.DataTable,{key:`table_${D.value}`,colNames:_.value.colNames,head:_.value.head,body:_.value.body,config:_.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>g.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name),1)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Te))}},Ye=Ne._export_sfc(je,[["__scopeId","data-v-55dc5b4a"]]);exports.default=Ye;
@@ -1,17 +1,17 @@
1
1
  import { computed as v, ref as u, watch as Ge, onMounted as We, onBeforeUnmount as Xe, openBlock as r, createElementBlock as s, normalizeClass as z, normalizeStyle as Q, createBlock as w, createCommentVNode as p, unref as g, createSlots as Ye, withCtx as y, renderSlot as m, normalizeProps as R, guardReactiveProps as M, createVNode as Z, createElementVNode as $, Fragment as P, renderList as T, toDisplayString as V, createTextVNode as we, nextTick as je } from "vue";
2
- import { u as qe, c as He, t as Je, a as Ke, p as x, o as Qe, e as S, b as Ze, g as $e, d as Pe, O as Te, v as et, i as xe, f as U, X as tt, s as ee, w as at, P as Ae, x as ot, y as lt, q as rt, r as nt } from "./index-igxqCP2w.js";
2
+ import { u as qe, c as He, t as Je, a as Ke, p as x, o as Qe, e as S, b as Ze, g as $e, d as Pe, O as Te, v as et, i as xe, f as U, X as tt, s as ee, w as at, P as Ae, x as ot, y as lt, q as rt, r as nt } from "./index-BtL_cLa8.js";
3
3
  import { t as st, u as ut } from "./useResponsive-CoxXLe23.js";
4
- import { _ as it } from "./Title-DED-PQ7X.js";
5
- import { u as ct, U as dt } from "./usePrinter-CnZYDQXB.js";
6
- import { _ as vt } from "./Tooltip-CHseiJu8.js";
7
- import pt from "./vue-ui-sparkbar-CPF7YNDd.js";
8
- import { L as ht } from "./Legend-FZN9UHoI.js";
9
- import { D as gt } from "./DataTable-CO5C8Cmb.js";
10
- import ft from "./vue-ui-skeleton-CWjNNx-k.js";
11
- import yt from "./vue-ui-accordion-lF7yVkiT.js";
12
- import { u as Oe } from "./useNestedProp-CSVnZVwZ.js";
13
- import { _ as mt } from "./PackageVersion-DYk2hOG1.js";
14
- import { P as bt } from "./PenAndPaper-BfgS_5ux.js";
4
+ import { _ as it } from "./Title-CIsKiWgN.js";
5
+ import { u as ct, U as dt } from "./usePrinter-sRt2SKr2.js";
6
+ import { _ as vt } from "./Tooltip-B1LgrF9R.js";
7
+ import pt from "./vue-ui-sparkbar-DixeozKp.js";
8
+ import { L as ht } from "./Legend-Br7MWNDo.js";
9
+ import { D as gt } from "./DataTable-CQ8fQnex.js";
10
+ import ft from "./vue-ui-skeleton-DjFU2X3P.js";
11
+ import yt from "./vue-ui-accordion-Cjc683tN.js";
12
+ import { u as Oe } from "./useNestedProp-CEAfm1tu.js";
13
+ import { _ as mt } from "./PackageVersion-BV3fHO46.js";
14
+ import { P as bt } from "./PenAndPaper-CCOywdmm.js";
15
15
  import { _ as kt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
16
16
  const Ct = ["id"], _t = ["xmlns", "viewBox"], wt = ["id"], $t = ["stop-color"], Pt = ["stop-color"], Tt = { key: 0 }, xt = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], At = { key: 0 }, Ot = ["d", "stroke", "stroke-width"], Nt = ["d", "stroke", "stroke-width"], Ft = { key: 1 }, St = ["x", "y", "text-anchor", "font-size", "fill", "onMouseenter"], It = ["points", "stroke", "stroke-width"], Lt = ["points", "stroke", "stroke-width", "fill"], zt = { key: 2 }, Rt = ["cx", "cy", "fill", "r", "stroke"], Mt = {
17
17
  key: 5,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-BHQZE19X.cjs"),L=require("./useNestedProp-CwpqC_aE.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},A=["src","height","width"],R=["xmlns","height","width"],X=["id"],j=["stop-color"],F=["stop-color"],I=["points","fill","stroke","stroke-width"],O=["src","alt","height","width","id"],Y=["xmlns","viewBox","height","id"],G=["id"],q=["stop-color"],U=["stop-color"],H=["points","fill","stroke"],K=["xmlns","height"],P=["onClick","onMouseenter","onKeyup"],T=["onMouseenter"],W={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup(k,{expose:_,emit:S}){const i=k,{vue_ui_rating:z}=a.useConfig(),d=e.ref(a.createUid()),f=e.ref(!1),s=e.ref(void 0),y=e.ref([]),t=e.computed({get:()=>g(),set:o=>o});function g(){return L.useNestedProp({userConfig:i.config,defaultConfig:z})}e.watch(()=>i.config,o=>{t.value=g(),h()},{deep:!0});const w=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)?N(i.dataset.rating):i.dataset.rating),B=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)),r=e.ref(w.value),m=e.computed(()=>t.value.type==="image"),c=e.computed(()=>t.value.readonly);function N(o){let n=0,l=0;for(const u in o){const V=parseInt(u),b=o[u];n+=V*b,l+=b}if(l===0)return 0;const v=n/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{h()});function h(){a.objectIsEmpty(i.dataset)&&a.error({componentName:"VueUiRating",type:"dataset"}),y.value=[];for(let o=t.value.from;o<=t.value.to;o+=1)y.value.push(o)}function p(o,n=!1){return o>s.value||c.value?n?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:n?1:t.value.style.star.useGradient?`url(#star_gradient_under_${d.value})`:t.value.style.star.activeColor}function x(o,n=!1){const l=r.value-o,v=n?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function $(o){c.value||(r.value=o,S("rate",o))}function C(){return r.value}function E(o=!0){c.value=o}return _({getData:C,toggleReadonly:E}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily};width:100%`),class:"vue-ui-rating",onMouseover:n[2]||(n[2]=l=>f.value=!0),onMouseleave:n[3]||(n[3]=l=>{f.value=!1,s.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",{style:e.normalizeStyle(`color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"};text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.offsetY}px;font-size:${t.value.style.title.fontSize}px`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`color:${t.value.style.title.subtitle.color};font-size:${t.value.style.title.subtitle.fontSize}px;text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.subtitle.offsetY}px;font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.rating.show&&t.value.style.rating.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vue-ui-rating-wrapper",style:e.normalizeStyle(`height:${t.value.style.itemSize}px;width:100%;display:flex;align-items:center;justify-content:center`)},[t.value.style.rating.show&&t.value.style.rating.position==="left"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-right:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(l,v)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-rating-unit-container",style:e.normalizeStyle(`position:relative;height:${t.value.style.itemSize}px;width:${t.value.style.itemSize}px`)},[m.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.value.style.image.src,height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;opacity:${isNaN(s.value)?t.value.style.image.inactiveOpacity:p(l,!0)}`)},null,12,A)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_under_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,j),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,F)],8,X)]),e.createElementVNode("polygon",{points:e.unref(a.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(s.value)?t.value.style.star.inactiveColor:p(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:s.value?p(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,I)],8,R)),m.value?(e.openBlock(),e.createElementBlock("img",{key:2,src:t.value.style.image.src,alt:`${t.value.style.image.alt} ${l}`,height:t.value.style.itemSize,width:t.value.style.itemSize,id:`active_${d.value}_${l}`,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;clip:rect(0px,${x(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,O)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${x(v)} 100`,height:t.value.style.itemSize,class:"vue-ui-rating-unit",id:`active_${d.value}_${l}`,style:{position:"absolute",top:"0",left:"0"}},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_over_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,q),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,U)],8,G)]),e.createElementVNode("polygon",{points:e.unref(a.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:t.value.style.star.useGradient?`url(#star_gradient_over_${d.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,H)],8,Y)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(a.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;${c.value?"":"cursor:pointer"}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("rect",{key:0,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onClick:u=>$(l),onMouseenter:u=>s.value=l,onMouseleave:n[0]||(n[0]=u=>s.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>$(l),["enter"])},null,40,P)),c.value?(e.openBlock(),e.createElementBlock("rect",{key:1,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onMouseenter:u=>s.value=l,onMouseleave:n[1]||(n[1]=u=>s.value=void 0)},null,40,T)):e.createCommentVNode("",!0)],12,K)),t.value.style.tooltip.show&&B.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${s.value===l?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(l)+":",5),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.tooltip.formatter,i.dataset.rating[l],e.unref(a.dataLabel)({v:i.dataset.rating[l],r:t.value.style.tooltip.roundingValue}),t.value)),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0)],4))),256)),t.value.style.rating.show&&t.value.style.rating.position==="right"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],4),t.value.style.rating.show&&t.value.style.rating.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(`width:100%;text-align:center;margin-top:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],36))}},J=D._export_sfc(W,[["__scopeId","data-v-d90e158f"]]);exports.default=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-DoD-GxZR.cjs"),L=require("./useNestedProp-D_feh7A_.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},A=["src","height","width"],R=["xmlns","height","width"],X=["id"],j=["stop-color"],F=["stop-color"],I=["points","fill","stroke","stroke-width"],O=["src","alt","height","width","id"],Y=["xmlns","viewBox","height","id"],G=["id"],q=["stop-color"],U=["stop-color"],H=["points","fill","stroke"],K=["xmlns","height"],P=["onClick","onMouseenter","onKeyup"],T=["onMouseenter"],W={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup(k,{expose:_,emit:S}){const i=k,{vue_ui_rating:z}=a.useConfig(),d=e.ref(a.createUid()),f=e.ref(!1),s=e.ref(void 0),y=e.ref([]),t=e.computed({get:()=>g(),set:o=>o});function g(){return L.useNestedProp({userConfig:i.config,defaultConfig:z})}e.watch(()=>i.config,o=>{t.value=g(),h()},{deep:!0});const w=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)?N(i.dataset.rating):i.dataset.rating),B=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)),r=e.ref(w.value),m=e.computed(()=>t.value.type==="image"),c=e.computed(()=>t.value.readonly);function N(o){let n=0,l=0;for(const u in o){const V=parseInt(u),b=o[u];n+=V*b,l+=b}if(l===0)return 0;const v=n/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{h()});function h(){a.objectIsEmpty(i.dataset)&&a.error({componentName:"VueUiRating",type:"dataset"}),y.value=[];for(let o=t.value.from;o<=t.value.to;o+=1)y.value.push(o)}function p(o,n=!1){return o>s.value||c.value?n?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:n?1:t.value.style.star.useGradient?`url(#star_gradient_under_${d.value})`:t.value.style.star.activeColor}function x(o,n=!1){const l=r.value-o,v=n?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function $(o){c.value||(r.value=o,S("rate",o))}function C(){return r.value}function E(o=!0){c.value=o}return _({getData:C,toggleReadonly:E}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily};width:100%`),class:"vue-ui-rating",onMouseover:n[2]||(n[2]=l=>f.value=!0),onMouseleave:n[3]||(n[3]=l=>{f.value=!1,s.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",{style:e.normalizeStyle(`color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"};text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.offsetY}px;font-size:${t.value.style.title.fontSize}px`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`color:${t.value.style.title.subtitle.color};font-size:${t.value.style.title.subtitle.fontSize}px;text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.subtitle.offsetY}px;font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.rating.show&&t.value.style.rating.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vue-ui-rating-wrapper",style:e.normalizeStyle(`height:${t.value.style.itemSize}px;width:100%;display:flex;align-items:center;justify-content:center`)},[t.value.style.rating.show&&t.value.style.rating.position==="left"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-right:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(l,v)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-rating-unit-container",style:e.normalizeStyle(`position:relative;height:${t.value.style.itemSize}px;width:${t.value.style.itemSize}px`)},[m.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.value.style.image.src,height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;opacity:${isNaN(s.value)?t.value.style.image.inactiveOpacity:p(l,!0)}`)},null,12,A)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_under_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,j),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,F)],8,X)]),e.createElementVNode("polygon",{points:e.unref(a.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(s.value)?t.value.style.star.inactiveColor:p(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:s.value?p(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,I)],8,R)),m.value?(e.openBlock(),e.createElementBlock("img",{key:2,src:t.value.style.image.src,alt:`${t.value.style.image.alt} ${l}`,height:t.value.style.itemSize,width:t.value.style.itemSize,id:`active_${d.value}_${l}`,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;clip:rect(0px,${x(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,O)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${x(v)} 100`,height:t.value.style.itemSize,class:"vue-ui-rating-unit",id:`active_${d.value}_${l}`,style:{position:"absolute",top:"0",left:"0"}},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_over_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,q),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,U)],8,G)]),e.createElementVNode("polygon",{points:e.unref(a.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:t.value.style.star.useGradient?`url(#star_gradient_over_${d.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,H)],8,Y)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(a.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;${c.value?"":"cursor:pointer"}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("rect",{key:0,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onClick:u=>$(l),onMouseenter:u=>s.value=l,onMouseleave:n[0]||(n[0]=u=>s.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>$(l),["enter"])},null,40,P)),c.value?(e.openBlock(),e.createElementBlock("rect",{key:1,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onMouseenter:u=>s.value=l,onMouseleave:n[1]||(n[1]=u=>s.value=void 0)},null,40,T)):e.createCommentVNode("",!0)],12,K)),t.value.style.tooltip.show&&B.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${s.value===l?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(l)+":",5),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.tooltip.formatter,i.dataset.rating[l],e.unref(a.dataLabel)({v:i.dataset.rating[l],r:t.value.style.tooltip.roundingValue}),t.value)),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0)],4))),256)),t.value.style.rating.show&&t.value.style.rating.position==="right"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],4),t.value.style.rating.show&&t.value.style.rating.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(`width:100%;text-align:center;margin-top:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],36))}},J=D._export_sfc(W,[["__scopeId","data-v-d90e158f"]]);exports.default=J;
@@ -1,6 +1,6 @@
1
1
  import { ref as h, computed as x, watch as U, onMounted as K, openBlock as a, createElementBlock as i, normalizeStyle as o, createElementVNode as r, toDisplayString as g, createCommentVNode as d, unref as s, Fragment as T, renderList as H, withKeys as P } from "vue";
2
- import { u as W, c as q, o as J, e as Q, i as $, f as _, X as k, w as R, V as F } from "./index-igxqCP2w.js";
3
- import { u as Z } from "./useNestedProp-CSVnZVwZ.js";
2
+ import { u as W, c as q, o as J, e as Q, i as $, f as _, X as k, w as R, V as F } from "./index-BtL_cLa8.js";
3
+ import { u as Z } from "./useNestedProp-CEAfm1tu.js";
4
4
  import { _ as tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
5
  const et = {
6
6
  key: 0,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BHQZE19X.cjs"),J=require("./useResponsive-BJ7DTGpm.cjs"),xe=require("./Title-5Vedk01J.cjs"),K=require("./usePrinter-DVgxBO4o.cjs"),we=require("./vue-ui-skeleton-DUNkS05l.cjs"),Q=require("./useNestedProp-CwpqC_aE.cjs"),be=require("./PackageVersion-rnWHRWGI.cjs"),Ce=require("./PenAndPaper-BQl9-uX0.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_e=["id"],Pe=["xmlns","viewBox"],$e=["cx","cy","r","stroke","stroke-width"],Le={key:0},ze=["stroke","d","stroke-width"],Ee={style:{"pointer-events":"none"}},Se=["cx","cy","fill","r","stroke"],Oe=["x","y","fill","font-size"],Ae={key:1},Ne=["stroke","stroke-width","x1","x2","y1","y2"],Ie={style:{"pointer-events":"none"}},Fe=["cx","cy","fill","r","stroke"],Me=["x","y","fill","font-size"],Ve=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],Te=["cx","cy","fill","stroke","onClick","r"],Re={key:5,class:"vue-data-ui-watermark"},je={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(Z,{expose:ee}){const y=Z;e.useCssVars(t=>({"7693a9d2":ae.value,"65d94d14":oe.value,fa445a50:se.value}));const{vue_ui_relation_circle:te}=o.useConfig(),_=e.computed(()=>!!y.dataset&&Object.keys(y.dataset).length),x=e.ref(o.createUid()),S=e.ref(0),w=e.ref(null),O=e.ref(null),A=e.ref(null),N=e.ref(null),I=e.ref(0),r=e.computed({get:()=>F(),set:t=>t});function F(){const t=Q.useNestedProp({userConfig:y.config,defaultConfig:te});return t.theme?{...Q.useNestedProp({userConfig:o.themes.vue_ui_relation_circle[t.theme]||y.config,defaultConfig:t}),customPalette:o.themePalettes[t.theme]||o.palette}:t}e.watch(()=>y.config,t=>{r.value=F(),G(),I.value+=1},{deep:!0});const{isPrinting:M,isImaging:V,generatePdf:T,generateImage:R}=K.usePrinter({elementId:`relation_circle_${x.value}`,fileName:r.value.style.title.text||"vue-ui-relation-circle"}),le=e.computed(()=>r.value.userOptions.show&&!r.value.style.title.text),j=e.computed(()=>o.convertCustomPalette(r.value.customPalette)),h=e.ref([]),d=e.ref([]),s=e.ref({}),v=e.ref([]),re=e.ref(0),P=e.computed(()=>y.dataset.slice(0,r.value.style.limit)),k=e.ref(r.value.style.size),f=e.ref(r.value.style.weightLabels.size),D=e.ref(r.value.style.plot.radius),q=e.ref(r.value.style.labels.fontSize),i=e.ref({height:r.value.style.size,width:r.value.style.size}),m=e.computed({get(){return k.value*r.value.style.circle.radiusProportion},set(t){return t}}),ne=e.computed(()=>r.value.style.links.curved),oe=e.computed(()=>`${r.value.style.animation.speedMs}ms`),ae=e.computed(()=>m.value*2),se=e.computed(()=>m.value*4),b=e.ref(null);e.onMounted(()=>{G(),document.getElementById(`relation_circle_${x.value}`).addEventListener("click",U)});function G(){if(o.objectIsEmpty(y.dataset)?o.error({componentName:"VueUiRelationCircle",type:"dataset"}):y.dataset.forEach((t,n)=>{o.getMissingDatasetAttributes({datasetObject:t,requiredAttributes:["id","label","relations","weights"]}).forEach(l=>{o.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:l,index:n})})}),r.value.responsive){const t=J.throttle(()=>{const{width:n,height:l}=J.useResponsive({chart:w.value,title:r.value.style.title.text?O.value:null,source:A.value,noTitle:N.value});k.value=Math.min(n,l),i.value.width=n,i.value.height=l,m.value=k.value*r.value.style.circle.radiusProportion,h.value=[],d.value=[],W(),Y(),f.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.weightLabels.size,threshold:6,fallback:6}),D.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.plot.radius,threshold:1,fallback:1}),q.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.labels.fontSize,threshold:6,fallback:6})});b.value=new ResizeObserver(t),b.value.observe(w.value.parentNode)}else h.value=[],d.value=[],W(),Y()}e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${x.value}`).removeEventListener("click",U),b.value&&b.value.disconnect()});function U(t){const n=t.target;n&&Array.from(n.classList).includes("vue-ui-user-options")||n&&Array.from(n.classList).includes("vue-ui-user-options-summary")||n&&Array.from(n.classList).includes("vue-data-ui-button")||n&&Array.from(n.classList).includes("vue-ui-relation-circle-legend")||(s.value={},v.value=[])}function W(){const t=6.28319/P.value.length,n=360/P.value.length;let l=0,a=0;P.value.forEach((c,u)=>{const z=c.weights.reduce((ke,pe)=>ke+pe,0),E=m.value*Math.cos(l)+i.value.width/2,me=m.value*Math.sin(l)+i.value.height/2+r.value.style.circle.offsetY;h.value.push({x:E,y:me,...c,color:c.color?c.color:j.value[u]?j.value[u]:o.palette[u],regAngle:a,totalWeight:z}),l+=t,a+=n})}function ie(t,n){const l=(t.x+n.x)/2,a=(t.y+n.y)/2;return{x:l,y:a}}function Y(){d.value=[],h.value.forEach(t=>{h.value.filter(l=>l.relations.includes(t.id)).forEach((l,a)=>{const c=l.relations.indexOf(t.id);d.value.push({weight:l.weights[c]?l.weights[c]:0,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,midPointLine:ie({x:t.x,y:t.y},{x:l.x,y:l.y}),midPointBezier:ue({x1:t.x,x2:l.x,y1:t.y,y2:l.y}),...t})})})}function ue(t){const n={x:t.x1,y:t.y1},l={x:t.x2,y:t.y2},a={x:t.x1,y:t.y1},c={x:i.value.width/2,y:i.value.height/2+r.value.style.circle.offsetY},u=.5,z=Math.pow(1-u,3)*n.x+3*Math.pow(1-u,2)*u*a.x+3*(1-u)*Math.pow(u,2)*c.x+Math.pow(u,3)*l.x,E=Math.pow(1-u,3)*n.y+3*Math.pow(1-u,2)*u*a.y+3*(1-u)*Math.pow(u,2)*c.y+Math.pow(u,3)*l.y;return{x:z,y:E}}const ce=e.computed(()=>Math.max(...d.value.map(t=>t.weight)));function de(t){return Object.hasOwn(s.value,"x")?v.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function g(t){return t.colorSource}function X(t){return Object.hasOwn(s.value,"x")?v.value.includes(t.id)&&t.relationId===`${t.id}_${s.value.id}`||t.relationId===`${s.value.id}_${t.id}`?`opacity:1;stroke-width:${$(t)}`:"opacity: 0":"opacity: 1"}function p(t){return Object.hasOwn(s.value,"x")?!!(v.value.includes(t.id)&&t.relationId===`${t.id}_${s.value.id}`||t.relationId===`${s.value.id}_${t.id}`):!1}function ve(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function fe(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function ye(t){return Object.hasOwn(s.value,"x")?s.value.id===t.id||v.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function ge(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function H(t){re.value=360-t.regAngle,s.value.id&&t.id===s.value.id?(s.value={},v.value=[]):(s.value=t,v.value=[...t.relations])}function $(t){const n=t.weight/ce.value*r.value.style.links.maxWidth;return Math.max(.3,n)}const C=e.ref(!1);function he(t){C.value=t,S.value+=1}const B=e.ref(!1);function L(){B.value=!B.value}return ee({generatePdf:T,generateImage:R,toggleAnnotator:L}),(t,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:w,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_${x.value}`},[r.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ce.PenAndPaper,{key:0,parent:w.value,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,active:B.value,onClose:L},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),le.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:N,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),r.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:O,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(xe._sfc_main,{key:`title_${I.value}`,config:{title:{cy:"relation-div-title",...r.value.style.title},subtitle:{cy:"relation-div-subtitle",...r.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),r.value.userOptions.show&&_.value?(e.openBlock(),e.createBlock(K.UserOptions,{ref:"details",key:`user_options_${S.value}`,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,isPrinting:e.unref(M),isImaging:e.unref(V),uid:x.value,hasPdf:r.value.userOptions.buttons.pdf,hasImg:r.value.userOptions.buttons.img,hasFullscreen:r.value.userOptions.buttons.img,hasXls:!1,isFullscreen:C.value,titles:{...r.value.userOptions.buttonTitles},chartElement:w.value,position:r.value.userOptions.position,hasAnnotator:r.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:he,onGeneratePdf:e.unref(T),onGenerateImage:e.unref(R),onToggleAnnotator:L},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:a})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:a})),void 0,!0)]),key:"2"}:void 0,t.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:a})=>[e.renderSlot(t.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:a})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(o.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value},"relation-circle"]),viewBox:`0 0 ${i.value.width<=0?10:i.value.width} ${i.value.height<=0?10:i.value.height}`,width:"100%",style:"user-select:none; background:transparent"},[e.createVNode(be._sfc_main),e.createElementVNode("circle",{cx:(i.value.width<=0?1e-4:i.value.width)/2,cy:(i.value.height<=0?1e-4:i.value.height)/2+r.value.style.circle.offsetY,r:m.value<=0?1e-4:m.value,stroke:r.value.style.circle.stroke,"stroke-width":r.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,$e),ne.value?(e.openBlock(),e.createElementBlock("g",Le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,a)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${a}`,style:e.normalizeStyle(X(l)),stroke:g(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":s.value.hasOwnProperty("id")&&v.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${i.value.width/2},${i.value.height/2+r.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":$(l),"stroke-linecap":"round"},null,14,ze))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",Ee,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.normalizeProps(e.mergeProps({key:0},{x:l.midPointBezier.x,y:l.midPointBezier.y,color:g(l),weight:l.weight,fontSize:f.value})),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointBezier.x,cy:l.midPointBezier.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,Se)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointBezier.x,y:l.midPointBezier.y+f.value/3,fill:e.unref(o.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,Oe)):e.createCommentVNode("",!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,a)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${a}`,stroke:g(l),"stroke-width":$(l),style:e.normalizeStyle(X(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")&&v.value.includes(l.id)}),"stroke-linecap":"round"},null,14,Ne))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",Ie,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.normalizeProps(e.mergeProps({key:0},{x:l.midPointLine.x,y:l.midPointLine.y,color:g(l),weight:l.weight,fontSize:f.value})),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointLine.x,cy:l.midPointLine.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,Fe)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointLine.x,y:l.midPointLine.y+f.value/3,fill:e.unref(o.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,Me)):e.createCommentVNode("",!0)]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,a)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${a}`,"text-anchor":ve(l),transform:ge(l),x:fe(l),y:l.y+5,onClick:c=>H(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};${ye(l)}`),"font-size":q.value,fill:r.value.style.labels.color},e.toDisplayString(l.label)+" ("+e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.totalWeight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.totalWeight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l}))+") ",13,Ve))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,a)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${a}`,style:e.normalizeStyle(de(l)),class:"vue-ui-relation-circle-plot",fill:r.value.style.plot.useSerieColor?l.color:r.value.style.plot.color,stroke:r.value.style.backgroundColor,"stroke-width":"1",onClick:c=>H(l),r:D.value},null,12,Te))),128)),e.renderSlot(t.$slots,"svg",{svg:i.value},void 0,!0)],10,Pe)):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Re,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(M)||e.unref(V)})),void 0,!0)])):e.createCommentVNode("",!0),t.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:A,dir:"auto"},[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),_.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(we.default,{key:7,config:{type:"relationCircle",style:{backgroundColor:r.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],12,_e))}},De=Be._export_sfc(je,[["__scopeId","data-v-f7051bc9"]]);exports.default=De;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-DoD-GxZR.cjs"),J=require("./useResponsive-BJ7DTGpm.cjs"),xe=require("./Title-C2siG5N2.cjs"),K=require("./usePrinter-B4xDG31F.cjs"),we=require("./vue-ui-skeleton-Nuju6X7l.cjs"),Q=require("./useNestedProp-D_feh7A_.cjs"),be=require("./PackageVersion-BEtuCME5.cjs"),Ce=require("./PenAndPaper-BIcmfBvD.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_e=["id"],Pe=["xmlns","viewBox"],$e=["cx","cy","r","stroke","stroke-width"],Le={key:0},ze=["stroke","d","stroke-width"],Ee={style:{"pointer-events":"none"}},Se=["cx","cy","fill","r","stroke"],Oe=["x","y","fill","font-size"],Ae={key:1},Ne=["stroke","stroke-width","x1","x2","y1","y2"],Ie={style:{"pointer-events":"none"}},Fe=["cx","cy","fill","r","stroke"],Me=["x","y","fill","font-size"],Ve=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],Te=["cx","cy","fill","stroke","onClick","r"],Re={key:5,class:"vue-data-ui-watermark"},je={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(Z,{expose:ee}){const y=Z;e.useCssVars(t=>({"7693a9d2":ae.value,"65d94d14":oe.value,fa445a50:se.value}));const{vue_ui_relation_circle:te}=o.useConfig(),_=e.computed(()=>!!y.dataset&&Object.keys(y.dataset).length),x=e.ref(o.createUid()),S=e.ref(0),w=e.ref(null),O=e.ref(null),A=e.ref(null),N=e.ref(null),I=e.ref(0),r=e.computed({get:()=>F(),set:t=>t});function F(){const t=Q.useNestedProp({userConfig:y.config,defaultConfig:te});return t.theme?{...Q.useNestedProp({userConfig:o.themes.vue_ui_relation_circle[t.theme]||y.config,defaultConfig:t}),customPalette:o.themePalettes[t.theme]||o.palette}:t}e.watch(()=>y.config,t=>{r.value=F(),G(),I.value+=1},{deep:!0});const{isPrinting:M,isImaging:V,generatePdf:T,generateImage:R}=K.usePrinter({elementId:`relation_circle_${x.value}`,fileName:r.value.style.title.text||"vue-ui-relation-circle"}),le=e.computed(()=>r.value.userOptions.show&&!r.value.style.title.text),j=e.computed(()=>o.convertCustomPalette(r.value.customPalette)),h=e.ref([]),d=e.ref([]),s=e.ref({}),v=e.ref([]),re=e.ref(0),P=e.computed(()=>y.dataset.slice(0,r.value.style.limit)),k=e.ref(r.value.style.size),f=e.ref(r.value.style.weightLabels.size),D=e.ref(r.value.style.plot.radius),q=e.ref(r.value.style.labels.fontSize),i=e.ref({height:r.value.style.size,width:r.value.style.size}),m=e.computed({get(){return k.value*r.value.style.circle.radiusProportion},set(t){return t}}),ne=e.computed(()=>r.value.style.links.curved),oe=e.computed(()=>`${r.value.style.animation.speedMs}ms`),ae=e.computed(()=>m.value*2),se=e.computed(()=>m.value*4),b=e.ref(null);e.onMounted(()=>{G(),document.getElementById(`relation_circle_${x.value}`).addEventListener("click",U)});function G(){if(o.objectIsEmpty(y.dataset)?o.error({componentName:"VueUiRelationCircle",type:"dataset"}):y.dataset.forEach((t,n)=>{o.getMissingDatasetAttributes({datasetObject:t,requiredAttributes:["id","label","relations","weights"]}).forEach(l=>{o.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:l,index:n})})}),r.value.responsive){const t=J.throttle(()=>{const{width:n,height:l}=J.useResponsive({chart:w.value,title:r.value.style.title.text?O.value:null,source:A.value,noTitle:N.value});k.value=Math.min(n,l),i.value.width=n,i.value.height=l,m.value=k.value*r.value.style.circle.radiusProportion,h.value=[],d.value=[],W(),Y(),f.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.weightLabels.size,threshold:6,fallback:6}),D.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.plot.radius,threshold:1,fallback:1}),q.value=o.translateSize({relator:k.value,adjuster:r.value.style.size,source:r.value.style.labels.fontSize,threshold:6,fallback:6})});b.value=new ResizeObserver(t),b.value.observe(w.value.parentNode)}else h.value=[],d.value=[],W(),Y()}e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${x.value}`).removeEventListener("click",U),b.value&&b.value.disconnect()});function U(t){const n=t.target;n&&Array.from(n.classList).includes("vue-ui-user-options")||n&&Array.from(n.classList).includes("vue-ui-user-options-summary")||n&&Array.from(n.classList).includes("vue-data-ui-button")||n&&Array.from(n.classList).includes("vue-ui-relation-circle-legend")||(s.value={},v.value=[])}function W(){const t=6.28319/P.value.length,n=360/P.value.length;let l=0,a=0;P.value.forEach((c,u)=>{const z=c.weights.reduce((ke,pe)=>ke+pe,0),E=m.value*Math.cos(l)+i.value.width/2,me=m.value*Math.sin(l)+i.value.height/2+r.value.style.circle.offsetY;h.value.push({x:E,y:me,...c,color:c.color?c.color:j.value[u]?j.value[u]:o.palette[u],regAngle:a,totalWeight:z}),l+=t,a+=n})}function ie(t,n){const l=(t.x+n.x)/2,a=(t.y+n.y)/2;return{x:l,y:a}}function Y(){d.value=[],h.value.forEach(t=>{h.value.filter(l=>l.relations.includes(t.id)).forEach((l,a)=>{const c=l.relations.indexOf(t.id);d.value.push({weight:l.weights[c]?l.weights[c]:0,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,midPointLine:ie({x:t.x,y:t.y},{x:l.x,y:l.y}),midPointBezier:ue({x1:t.x,x2:l.x,y1:t.y,y2:l.y}),...t})})})}function ue(t){const n={x:t.x1,y:t.y1},l={x:t.x2,y:t.y2},a={x:t.x1,y:t.y1},c={x:i.value.width/2,y:i.value.height/2+r.value.style.circle.offsetY},u=.5,z=Math.pow(1-u,3)*n.x+3*Math.pow(1-u,2)*u*a.x+3*(1-u)*Math.pow(u,2)*c.x+Math.pow(u,3)*l.x,E=Math.pow(1-u,3)*n.y+3*Math.pow(1-u,2)*u*a.y+3*(1-u)*Math.pow(u,2)*c.y+Math.pow(u,3)*l.y;return{x:z,y:E}}const ce=e.computed(()=>Math.max(...d.value.map(t=>t.weight)));function de(t){return Object.hasOwn(s.value,"x")?v.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function g(t){return t.colorSource}function X(t){return Object.hasOwn(s.value,"x")?v.value.includes(t.id)&&t.relationId===`${t.id}_${s.value.id}`||t.relationId===`${s.value.id}_${t.id}`?`opacity:1;stroke-width:${$(t)}`:"opacity: 0":"opacity: 1"}function p(t){return Object.hasOwn(s.value,"x")?!!(v.value.includes(t.id)&&t.relationId===`${t.id}_${s.value.id}`||t.relationId===`${s.value.id}_${t.id}`):!1}function ve(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function fe(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function ye(t){return Object.hasOwn(s.value,"x")?s.value.id===t.id||v.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function ge(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function H(t){re.value=360-t.regAngle,s.value.id&&t.id===s.value.id?(s.value={},v.value=[]):(s.value=t,v.value=[...t.relations])}function $(t){const n=t.weight/ce.value*r.value.style.links.maxWidth;return Math.max(.3,n)}const C=e.ref(!1);function he(t){C.value=t,S.value+=1}const B=e.ref(!1);function L(){B.value=!B.value}return ee({generatePdf:T,generateImage:R,toggleAnnotator:L}),(t,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:w,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_${x.value}`},[r.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ce.PenAndPaper,{key:0,parent:w.value,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,active:B.value,onClose:L},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),le.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:N,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),r.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:O,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(xe._sfc_main,{key:`title_${I.value}`,config:{title:{cy:"relation-div-title",...r.value.style.title},subtitle:{cy:"relation-div-subtitle",...r.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),r.value.userOptions.show&&_.value?(e.openBlock(),e.createBlock(K.UserOptions,{ref:"details",key:`user_options_${S.value}`,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,isPrinting:e.unref(M),isImaging:e.unref(V),uid:x.value,hasPdf:r.value.userOptions.buttons.pdf,hasImg:r.value.userOptions.buttons.img,hasFullscreen:r.value.userOptions.buttons.img,hasXls:!1,isFullscreen:C.value,titles:{...r.value.userOptions.buttonTitles},chartElement:w.value,position:r.value.userOptions.position,hasAnnotator:r.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:he,onGeneratePdf:e.unref(T),onGenerateImage:e.unref(R),onToggleAnnotator:L},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:a})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:a})),void 0,!0)]),key:"2"}:void 0,t.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:a})=>[e.renderSlot(t.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:a})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(o.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value},"relation-circle"]),viewBox:`0 0 ${i.value.width<=0?10:i.value.width} ${i.value.height<=0?10:i.value.height}`,width:"100%",style:"user-select:none; background:transparent"},[e.createVNode(be._sfc_main),e.createElementVNode("circle",{cx:(i.value.width<=0?1e-4:i.value.width)/2,cy:(i.value.height<=0?1e-4:i.value.height)/2+r.value.style.circle.offsetY,r:m.value<=0?1e-4:m.value,stroke:r.value.style.circle.stroke,"stroke-width":r.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,$e),ne.value?(e.openBlock(),e.createElementBlock("g",Le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,a)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${a}`,style:e.normalizeStyle(X(l)),stroke:g(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":s.value.hasOwnProperty("id")&&v.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${i.value.width/2},${i.value.height/2+r.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":$(l),"stroke-linecap":"round"},null,14,ze))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",Ee,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.normalizeProps(e.mergeProps({key:0},{x:l.midPointBezier.x,y:l.midPointBezier.y,color:g(l),weight:l.weight,fontSize:f.value})),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointBezier.x,cy:l.midPointBezier.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,Se)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointBezier.x,y:l.midPointBezier.y+f.value/3,fill:e.unref(o.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,Oe)):e.createCommentVNode("",!0)]))),256))])):(e.openBlock(),e.createElementBlock("g",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,a)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${a}`,stroke:g(l),"stroke-width":$(l),style:e.normalizeStyle(X(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")&&v.value.includes(l.id)}),"stroke-linecap":"round"},null,14,Ne))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",Ie,[p(l)?e.renderSlot(t.$slots,"dataLabel",e.normalizeProps(e.mergeProps({key:0},{x:l.midPointLine.x,y:l.midPointLine.y,color:g(l),weight:l.weight,fontSize:f.value})),void 0,!0):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("circle",{key:1,cx:l.midPointLine.x,cy:l.midPointLine.y,fill:g(l),r:f.value,stroke:r.value.style.backgroundColor,"stroke-width":"1"},null,8,Fe)):e.createCommentVNode("",!0),p(l)&&!t.$slots.dataLabel&&r.value.style.weightLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,x:l.midPointLine.x,y:l.midPointLine.y+f.value/3,fill:e.unref(o.adaptColorToBackground)(g(l)),"text-anchor":"middle","font-size":f.value},e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.weight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.weight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l})),9,Me)):e.createCommentVNode("",!0)]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,a)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${a}`,"text-anchor":ve(l),transform:ge(l),x:fe(l),y:l.y+5,onClick:c=>H(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};${ye(l)}`),"font-size":q.value,fill:r.value.style.labels.color},e.toDisplayString(l.label)+" ("+e.toDisplayString(e.unref(o.applyDataLabel)(r.value.style.weightLabels.formatter,l.totalWeight,e.unref(o.dataLabel)({p:r.value.style.weightLabels.prefix,v:l.totalWeight,s:r.value.style.weightLabels.suffix,r:r.value.style.weightLabels.rounding}),{...l}))+") ",13,Ve))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,a)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${a}`,style:e.normalizeStyle(de(l)),class:"vue-ui-relation-circle-plot",fill:r.value.style.plot.useSerieColor?l.color:r.value.style.plot.color,stroke:r.value.style.backgroundColor,"stroke-width":"1",onClick:c=>H(l),r:D.value},null,12,Te))),128)),e.renderSlot(t.$slots,"svg",{svg:i.value},void 0,!0)],10,Pe)):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Re,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(M)||e.unref(V)})),void 0,!0)])):e.createCommentVNode("",!0),t.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:A,dir:"auto"},[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),_.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(we.default,{key:7,config:{type:"relationCircle",style:{backgroundColor:r.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],12,_e))}},De=Be._export_sfc(je,[["__scopeId","data-v-f7051bc9"]]);exports.default=De;
@@ -1,12 +1,12 @@
1
1
  import { useCssVars as Re, computed as f, ref as r, watch as je, onMounted as Ge, onBeforeUnmount as Ue, openBlock as s, createElementBlock as i, normalizeStyle as O, createBlock as F, createCommentVNode as v, unref as d, createSlots as We, withCtx as B, renderSlot as k, normalizeProps as A, guardReactiveProps as W, normalizeClass as D, createVNode as De, createElementVNode as Ve, Fragment as C, renderList as P, mergeProps as ye, toDisplayString as T } from "vue";
2
- import { u as Xe, c as Ye, t as qe, a as He, p as fe, b as Je, o as Ke, e as he, g as Qe, X as Ze, G as ge, i as V, f as X, F as Y } from "./index-igxqCP2w.js";
2
+ import { u as Xe, c as Ye, t as qe, a as He, p as fe, b as Je, o as Ke, e as he, g as Qe, X as Ze, G as ge, i as V, f as X, F as Y } from "./index-BtL_cLa8.js";
3
3
  import { t as et, u as tt } from "./useResponsive-CoxXLe23.js";
4
- import { _ as lt } from "./Title-DED-PQ7X.js";
5
- import { u as st, U as at } from "./usePrinter-CnZYDQXB.js";
6
- import it from "./vue-ui-skeleton-CWjNNx-k.js";
7
- import { u as me } from "./useNestedProp-CSVnZVwZ.js";
8
- import { _ as nt } from "./PackageVersion-DYk2hOG1.js";
9
- import { P as rt } from "./PenAndPaper-BfgS_5ux.js";
4
+ import { _ as lt } from "./Title-CIsKiWgN.js";
5
+ import { u as st, U as at } from "./usePrinter-sRt2SKr2.js";
6
+ import it from "./vue-ui-skeleton-DjFU2X3P.js";
7
+ import { u as me } from "./useNestedProp-CEAfm1tu.js";
8
+ import { _ as nt } from "./PackageVersion-BV3fHO46.js";
9
+ import { P as rt } from "./PenAndPaper-CCOywdmm.js";
10
10
  import { _ as ut } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
11
  const ot = ["id"], ct = ["xmlns", "viewBox"], dt = ["cx", "cy", "r", "stroke", "stroke-width"], vt = { key: 0 }, yt = ["stroke", "d", "stroke-width"], ft = { style: { "pointer-events": "none" } }, ht = ["cx", "cy", "fill", "r", "stroke"], gt = ["x", "y", "fill", "font-size"], mt = { key: 1 }, kt = ["stroke", "stroke-width", "x1", "x2", "y1", "y2"], xt = { style: { "pointer-events": "none" } }, pt = ["cx", "cy", "fill", "r", "stroke"], wt = ["x", "y", "fill", "font-size"], bt = ["text-anchor", "transform", "x", "y", "onClick", "font-weight", "font-size", "fill"], _t = ["cx", "cy", "fill", "stroke", "onClick", "r"], $t = {
12
12
  key: 5,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BHQZE19X.cjs"),Z=require("./useResponsive-BJ7DTGpm.cjs"),ge=require("./Title-5Vedk01J.cjs"),ee=require("./usePrinter-DVgxBO4o.cjs"),fe=require("./Tooltip-DjCKBAC4.cjs"),me=require("./DataTable-kMUhutQ4.cjs"),ye=require("./Legend-DPHcmrzd.cjs"),be=require("./vue-ui-skeleton-DUNkS05l.cjs"),ke=require("./vue-ui-accordion-CRVWlHxs.cjs"),te=require("./useNestedProp-CwpqC_aE.cjs"),Ce=require("./PackageVersion-rnWHRWGI.cjs"),we=require("./PenAndPaper-BQl9-uX0.cjs"),Te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),xe=["id"],Ne=["xmlns","viewBox"],$e=["id"],Se=["stop-color"],Be=["stop-color"],Pe=["stroke","cx","cy","r","fill"],_e=["stroke","stroke-width","cx","cy","r","fill"],Le=["cx","cy","r","onMouseenter"],Ve={key:5,class:"vue-data-ui-watermark"},Ee=["onClick"],Ae={key:0},Fe={key:1},Oe=["innerHTML"],ze={__name:"vue-ui-rings",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(le,{expose:oe,emit:ae}){const v=le,{vue_ui_rings:re}=r.useConfig(),k=e.ref(!1),T=e.computed(()=>!!v.dataset&&v.dataset.length),C=e.ref(r.createUid()),ne=e.ref(null),x=e.ref(!1),P=e.ref(""),m=e.ref(null),E=e.ref(0),y=e.ref(null),A=e.ref(null),F=e.ref(null),O=e.ref(null),z=e.ref(null),I=e.ref(0),R=e.ref(0),M=e.ref(0),t=e.computed({get:()=>q(),set:l=>l});function q(){const l=te.useNestedProp({userConfig:v.config,defaultConfig:re});return l.theme?{...te.useNestedProp({userConfig:r.themes.vue_ui_rings[l.theme]||v.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>v.config,l=>{t.value=q(),D(),I.value+=1,R.value+=1,M.value+=1},{deep:!0});const N=e.ref(null);e.onMounted(()=>{D()});function D(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiRings",type:"dataset"}):v.dataset.forEach((l,a)=>{l.values.length||r.error({componentName:"VueUiRings",type:"dataset"}),r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{r.error({componentName:"VueUiRings",type:"datasetSerieAttribute",property:o,index:a})})}),t.value.responsive){const l=Z.throttle(()=>{const{width:a,height:o}=Z.useResponsive({chart:y.value,title:t.value.style.chart.title.text?A.value:null,legend:t.value.style.chart.legend.show?F.value:null,source:O.value,noTitle:z.value});s.value.width=a,s.value.height=o});N.value=new ResizeObserver(l),N.value.observe(y.value.parentNode)}setTimeout(()=>{k.value=!0},600)}e.onBeforeUnmount(()=>{N.value&&N.value.disconnect()});const{isPrinting:U,isImaging:H,generatePdf:W,generateImage:G}=ee.usePrinter({elementId:`rings_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-rings"}),ue=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),j=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),g=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:360}),se=e.computed(()=>Math.min(s.value.height,s.value.width)),i=e.ref([]);function _(l){i.value.includes(l)?i.value=i.value.filter(a=>a!==l):i.value.push(l),ae("selectLegend",c.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const ie=e.computed(()=>Math.max(...$.value.filter(l=>!i.value.includes(l.uid)).map(({value:l})=>l)));function X(l){return l/ie.value}const $=e.computed(()=>v.dataset.map(({values:l,name:a,color:o=null},n)=>{const u=r.sanitizeArray(l).reduce((h,w)=>h+w,0);return{name:a,color:o||r.convertColorToHex(o)||j.value[n]||r.palette[n]||r.palette[n%r.palette.length],value:u,proportion:u/v.dataset.map(h=>(h.values||[]).reduce((w,he)=>w+he,0)).reduce((h,w)=>h+w,0),uid:r.createUid()}})),Y=e.computed(()=>$.value.map(l=>({...l,shape:"circle",opacity:i.value.includes(l.uid)?.5:1,segregate:()=>_(l.uid),isSegregated:i.value.includes(l.uid)})).toSorted((l,a)=>a.value-l.value)),ce=e.computed(()=>({cy:"rings-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),p=e.computed(()=>$.value.filter(l=>!i.value.includes(l.uid)).map(({value:l})=>l).reduce((l,a)=>l+a,0)),c=e.computed(()=>$.value.filter(l=>!i.value.includes(l.uid)).map(({name:l,value:a,color:o=null,uid:n},u)=>({uid:n,name:l,color:o||r.convertColorToHex(o)||j.value[u]||r.palette[u]||r.palette[u%r.palette.length],value:a,proportion:X(a),percentage:a/p.value*100,strokeWidth:t.value.style.chart.layout.rings.strokeWidth*X(a)})).toSorted((l,a)=>a.value-l.value));function de(){return c.value.map(({name:l,color:a,value:o,absoluteValues:n,percentage:u})=>({name:l,color:a,value:o,absoluteValues:n,percentage:u}))}const d=e.computed(()=>se.value-t.value.style.chart.layout.rings.strokeWidth*2),L=e.ref(null);function ve(l,a){if(i.value.length===v.dataset.length)return;L.value={datapoint:a,seriesIndex:l,series:c.value,config:t.value},m.value=l;const o=c.value[l],n=t.value.style.chart.tooltip.customFormat;if(r.isFunction(n)&&r.functionReturnsString(()=>n({seriesIndex:l,datapoint:a,series:c.value,config:t.value})))P.value=n({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>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,seriesIndex:l})}
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DoD-GxZR.cjs"),Z=require("./useResponsive-BJ7DTGpm.cjs"),ge=require("./Title-C2siG5N2.cjs"),ee=require("./usePrinter-B4xDG31F.cjs"),fe=require("./Tooltip-CS4C58T7.cjs"),me=require("./DataTable-CovKV5Yy.cjs"),ye=require("./Legend-Bbz-hKDf.cjs"),be=require("./vue-ui-skeleton-Nuju6X7l.cjs"),ke=require("./vue-ui-accordion-CBxsUoGb.cjs"),te=require("./useNestedProp-D_feh7A_.cjs"),Ce=require("./PackageVersion-BEtuCME5.cjs"),we=require("./PenAndPaper-BIcmfBvD.cjs"),Te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),xe=["id"],Ne=["xmlns","viewBox"],$e=["id"],Se=["stop-color"],Be=["stop-color"],Pe=["stroke","cx","cy","r","fill"],_e=["stroke","stroke-width","cx","cy","r","fill"],Le=["cx","cy","r","onMouseenter"],Ve={key:5,class:"vue-data-ui-watermark"},Ee=["onClick"],Ae={key:0},Fe={key:1},Oe=["innerHTML"],ze={__name:"vue-ui-rings",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(le,{expose:oe,emit:ae}){const v=le,{vue_ui_rings:re}=r.useConfig(),k=e.ref(!1),T=e.computed(()=>!!v.dataset&&v.dataset.length),C=e.ref(r.createUid()),ne=e.ref(null),x=e.ref(!1),P=e.ref(""),m=e.ref(null),E=e.ref(0),y=e.ref(null),A=e.ref(null),F=e.ref(null),O=e.ref(null),z=e.ref(null),I=e.ref(0),R=e.ref(0),M=e.ref(0),t=e.computed({get:()=>q(),set:l=>l});function q(){const l=te.useNestedProp({userConfig:v.config,defaultConfig:re});return l.theme?{...te.useNestedProp({userConfig:r.themes.vue_ui_rings[l.theme]||v.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>v.config,l=>{t.value=q(),D(),I.value+=1,R.value+=1,M.value+=1},{deep:!0});const N=e.ref(null);e.onMounted(()=>{D()});function D(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiRings",type:"dataset"}):v.dataset.forEach((l,a)=>{l.values.length||r.error({componentName:"VueUiRings",type:"dataset"}),r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(o=>{r.error({componentName:"VueUiRings",type:"datasetSerieAttribute",property:o,index:a})})}),t.value.responsive){const l=Z.throttle(()=>{const{width:a,height:o}=Z.useResponsive({chart:y.value,title:t.value.style.chart.title.text?A.value:null,legend:t.value.style.chart.legend.show?F.value:null,source:O.value,noTitle:z.value});s.value.width=a,s.value.height=o});N.value=new ResizeObserver(l),N.value.observe(y.value.parentNode)}setTimeout(()=>{k.value=!0},600)}e.onBeforeUnmount(()=>{N.value&&N.value.disconnect()});const{isPrinting:U,isImaging:H,generatePdf:W,generateImage:G}=ee.usePrinter({elementId:`rings_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-rings"}),ue=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),j=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),g=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:360}),se=e.computed(()=>Math.min(s.value.height,s.value.width)),i=e.ref([]);function _(l){i.value.includes(l)?i.value=i.value.filter(a=>a!==l):i.value.push(l),ae("selectLegend",c.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const ie=e.computed(()=>Math.max(...$.value.filter(l=>!i.value.includes(l.uid)).map(({value:l})=>l)));function X(l){return l/ie.value}const $=e.computed(()=>v.dataset.map(({values:l,name:a,color:o=null},n)=>{const u=r.sanitizeArray(l).reduce((h,w)=>h+w,0);return{name:a,color:o||r.convertColorToHex(o)||j.value[n]||r.palette[n]||r.palette[n%r.palette.length],value:u,proportion:u/v.dataset.map(h=>(h.values||[]).reduce((w,he)=>w+he,0)).reduce((h,w)=>h+w,0),uid:r.createUid()}})),Y=e.computed(()=>$.value.map(l=>({...l,shape:"circle",opacity:i.value.includes(l.uid)?.5:1,segregate:()=>_(l.uid),isSegregated:i.value.includes(l.uid)})).toSorted((l,a)=>a.value-l.value)),ce=e.computed(()=>({cy:"rings-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),p=e.computed(()=>$.value.filter(l=>!i.value.includes(l.uid)).map(({value:l})=>l).reduce((l,a)=>l+a,0)),c=e.computed(()=>$.value.filter(l=>!i.value.includes(l.uid)).map(({name:l,value:a,color:o=null,uid:n},u)=>({uid:n,name:l,color:o||r.convertColorToHex(o)||j.value[u]||r.palette[u]||r.palette[u%r.palette.length],value:a,proportion:X(a),percentage:a/p.value*100,strokeWidth:t.value.style.chart.layout.rings.strokeWidth*X(a)})).toSorted((l,a)=>a.value-l.value));function de(){return c.value.map(({name:l,color:a,value:o,absoluteValues:n,percentage:u})=>({name:l,color:a,value:o,absoluteValues:n,percentage:u}))}const d=e.computed(()=>se.value-t.value.style.chart.layout.rings.strokeWidth*2),L=e.ref(null);function ve(l,a){if(i.value.length===v.dataset.length)return;L.value={datapoint:a,seriesIndex:l,series:c.value,config:t.value},m.value=l;const o=c.value[l],n=t.value.style.chart.tooltip.customFormat;if(r.isFunction(n)&&r.functionReturnsString(()=>n({seriesIndex:l,datapoint:a,series:c.value,config:t.value})))P.value=n({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>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,seriesIndex:l})}
2
2
  </b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?u+=`<span>(${r.dataLabel({v:o.value/p.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:u+=`<b>${r.dataLabel({v:o.value/p.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),P.value=u}x.value=!0}const f=e.computed(()=>{const 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>',r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:p.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=f.value.head.map((u,h)=>[{color:u.color,name:u.name},r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:f.value.body[h],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),isNaN(f.value.body[h]/p.value)?"-":(f.value.body[h]/p.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]),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},n=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:a,config:o,colNames:n}});function J(){e.nextTick(()=>{const l=f.value.head.map((n,u)=>[[n.name],[f.value.body[u]],[isNaN(f.value.body[u]/p.value)?"-":f.value.body[u]/p.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-rings"})})}const b=e.ref(!1);function pe(l){b.value=l,E.value+=1}function K(){g.value.showTable=!g.value.showTable}function Q(){g.value.showTooltip=!g.value.showTooltip}const B=e.ref(!1);function V(){B.value=!B.value}return oe({getData:de,generatePdf:W,generateCsv:J,generateImage:G,toggleTable:K,toggleTooltip:Q,toggleAnnotator:V}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"ringsChart",ref:y,class:e.normalizeClass(`vue-ui-rings ${b.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_${C.value}`,onMouseleave:a[3]||(a[3]=o=>{m.value=null,x.value=!1})},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(we.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:V},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ue.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:z,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:A,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(ge._sfc_main,{key:`title_${I.value}`,config:{title:{cy:"rings-div-title",...t.value.style.chart.title},subtitle:{cy:"rings-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&T.value?(e.openBlock(),e.createBlock(ee.UserOptions,{ref_key:"details",ref:ne,key:`user_options_${E.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(U),isImaging:e.unref(H),uid:C.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:b.value,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(W),onGenerateCsv:J,onGenerateImage:e.unref(G),onToggleTable:K,onToggleTooltip:Q,onToggleAnnotator:V},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),T.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ce._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,n)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"30%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${C.value}_${n}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(e.unref(r.shiftHue)(o.color,.05),100-t.value.style.chart.layout.rings.gradient.intensity)},null,8,Se),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,Be)],8,$e))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":k.value&&t.value.useCssAnimation,"vue-rings-item-onload":!k.value&&t.value.useCssAnimation,"vue-ui-rings-opacity":m.value!==null&&m.value!==n}),style:e.normalizeStyle(`animation-delay:${n*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,cx:s.value.width/2,cy:n===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*o.proportion/2-2*(n+1),r:e.unref(r.checkNaN)(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,Pe),e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":k.value&&t.value.useCssAnimation,"vue-rings-item-onload":!k.value&&t.value.useCssAnimation,"vue-ui-rings-shadow":t.value.style.chart.layout.rings.useShadow,"vue-ui-rings-blur":m.value!==null&&m.value!==n}),style:e.normalizeStyle(`animation-delay:${n*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,"stroke-width":o.strokeWidth<.5?.5:o.strokeWidth,cx:s.value.width/2,cy:n===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*o.proportion/2-2*(n+1),r:e.unref(r.checkNaN)(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_${C.value}_${n})`:o.color},null,14,_e),e.createElementVNode("circle",{"data-cy-trap":"",stroke:"none",cx:s.value.width/2,cy:n===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*o.proportion/2-2*(n+1),r:e.unref(r.checkNaN)(d.value*o.proportion/2*.9<=0?1e-4:d.value*o.proportion/2*.9),fill:"transparent",onMouseenter:u=>ve(n,o),onMouseleave:a[0]||(a[0]=u=>{m.value=null,x.value=!1})},null,40,Le)]))),256)),e.renderSlot(l.$slots,"svg",{svg:s.value},void 0,!0)],14,Ne)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ve,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),T.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(be.default,{key:6,config:{type:"rings",style:{backgroundColor:t.value.style.chart.backgroundColor,rings:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:F},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(ye.Legend,{key:`legend_${M.value}`,legendSet:Y.value,config:ce.value,onClickMarker:a[1]||(a[1]=({legend:o})=>_(o.uid))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:u=>_(o.uid),style:e.normalizeStyle(`opacity:${i.value.includes(o.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:o.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:o,seriesIndex:n}))+" ",1),i.value.includes(o.uid)?(e.openBlock(),e.createElementBlock("span",Fe," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ae," ("+e.toDisplayString(isNaN(o.value/p.value)?"-":e.unref(r.dataLabel)({v:o.value/p.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Ee)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:Y.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:O,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(fe._sfc_main,{show:g.value.showTooltip&&x.value&&i.value.length<v.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:y.value,content:P.value,isFullscreen:b.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...L.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...L.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),T.value?(e.openBlock(),e.createBlock(ke.default,{key:8,hideDetails:"",config:{open:g.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(me.DataTable,{key:`table_${R.value}`,colNames:S.value.colNames,head:S.value.head,body:S.value.body,config:S.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=o=>g.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Oe)]),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,xe))}},Ie=Te._export_sfc(ze,[["__scopeId","data-v-55a9dc26"]]);exports.default=Ie;
@@ -1,16 +1,16 @@
1
1
  import { ref as n, computed as v, watch as Re, onMounted as Ve, onBeforeUnmount as Be, openBlock as r, createElementBlock as f, normalizeClass as W, normalizeStyle as O, createBlock as _, createCommentVNode as k, unref as i, createSlots as De, withCtx as p, renderSlot as h, normalizeProps as I, guardReactiveProps as M, createVNode as fe, createElementVNode as C, Fragment as ye, renderList as me, createTextVNode as be, toDisplayString as E, nextTick as Ue } from "vue";
2
- import { u as We, c as ke, t as Ee, a as Ge, p as x, o as He, e as Y, g as Xe, b as je, J as Ye, d as Ce, f as N, X as qe, s as Je, w as Ke, v as q, i as we, x as Qe, y as Ze, q as et, r as tt } from "./index-igxqCP2w.js";
2
+ import { u as We, c as ke, t as Ee, a as Ge, p as x, o as He, e as Y, g as Xe, b as je, J as Ye, d as Ce, f as N, X as qe, s as Je, w as Ke, v as q, i as we, x as Qe, y as Ze, q as et, r as tt } from "./index-BtL_cLa8.js";
3
3
  import { t as lt, u as ot } from "./useResponsive-CoxXLe23.js";
4
- import { _ as at } from "./Title-DED-PQ7X.js";
5
- import { u as st, U as nt } from "./usePrinter-CnZYDQXB.js";
6
- import { _ as rt } from "./Tooltip-CHseiJu8.js";
7
- import { D as ut } from "./DataTable-CO5C8Cmb.js";
8
- import { L as it } from "./Legend-FZN9UHoI.js";
9
- import vt from "./vue-ui-skeleton-CWjNNx-k.js";
10
- import ct from "./vue-ui-accordion-lF7yVkiT.js";
11
- import { u as $e } from "./useNestedProp-CSVnZVwZ.js";
12
- import { _ as dt } from "./PackageVersion-DYk2hOG1.js";
13
- import { P as pt } from "./PenAndPaper-BfgS_5ux.js";
4
+ import { _ as at } from "./Title-CIsKiWgN.js";
5
+ import { u as st, U as nt } from "./usePrinter-sRt2SKr2.js";
6
+ import { _ as rt } from "./Tooltip-B1LgrF9R.js";
7
+ import { D as ut } from "./DataTable-CQ8fQnex.js";
8
+ import { L as it } from "./Legend-Br7MWNDo.js";
9
+ import vt from "./vue-ui-skeleton-DjFU2X3P.js";
10
+ import ct from "./vue-ui-accordion-Cjc683tN.js";
11
+ import { u as $e } from "./useNestedProp-CEAfm1tu.js";
12
+ import { _ as dt } from "./PackageVersion-BV3fHO46.js";
13
+ import { P as pt } from "./PenAndPaper-CCOywdmm.js";
14
14
  import { _ as ht } from "./_plugin-vue_export-helper-CHgC5LLL.js";
15
15
  const gt = ["id"], ft = ["xmlns", "viewBox"], yt = ["id"], mt = ["stop-color"], bt = ["stop-color"], kt = ["stroke", "cx", "cy", "r", "fill"], Ct = ["stroke", "stroke-width", "cx", "cy", "r", "fill"], wt = ["cx", "cy", "r", "onMouseenter"], $t = {
16
16
  key: 5,