vue-data-ui 2.3.97 → 2.3.99
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.
- package/dist/{Arrow-CD-z6ya0.cjs → Arrow-DwqF2Xky.cjs} +1 -1
- package/dist/{Arrow-BAg5kQhG.js → Arrow-Dyp57i2e.js} +1 -1
- package/dist/BaseIcon-BDeByyf-.cjs +1 -0
- package/dist/{BaseIcon-CiQsJmEc.js → BaseIcon-DHB44s-g.js} +17 -16
- package/dist/{DataTable-DRJUrEXP.cjs → DataTable-CiVu-yQZ.cjs} +1 -1
- package/dist/{DataTable-BczvA492.js → DataTable-Dv3mZD4M.js} +2 -2
- package/dist/{Legend-DDmBZxt8.cjs → Legend-ComtyeZF.cjs} +1 -1
- package/dist/{Legend-DnOc-JGW.js → Legend-iUlykl4S.js} +1 -1
- package/dist/{PackageVersion-rOhPenOY.cjs → PackageVersion-BqVp7cHC.cjs} +1 -1
- package/dist/{PackageVersion-DN8qp-uI.js → PackageVersion-DWAqn7t0.js} +1 -1
- package/dist/{Shape-DhRVUsKe.js → Shape-CDqrt_yL.js} +1 -1
- package/dist/{Shape-CDDjN4N-.cjs → Shape-D-cMBFx-.cjs} +1 -1
- package/dist/{Slicer-B7JFT6tT.js → Slicer-CQbVH6fI.js} +2 -2
- package/dist/{Slicer-IdC3VhM9.cjs → Slicer-iAp8x_Wq.cjs} +1 -1
- package/dist/{Title-Cjusozo5.cjs → Title-Bpx2Ub4Z.cjs} +1 -1
- package/dist/{Title-0tYDaWv7.js → Title-CDfZWgra.js} +1 -1
- package/dist/{Tooltip-DdWGiVyf.js → Tooltip-0-aPeOmA.js} +1 -1
- package/dist/{Tooltip-CkqTs_wn.cjs → Tooltip-D-JR_3NK.cjs} +1 -1
- package/dist/{index-BJNSbAx7.js → index-COTjlcVF.js} +725 -703
- package/dist/{index-NvxTr0fZ.cjs → index-DQRLTu78.cjs} +8 -8
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +1 -1
- package/dist/types/vue-data-ui.d.ts +1 -1
- package/dist/{useNestedProp-CLh4tPxT.js → useNestedProp-CcjyiBlC.js} +1 -1
- package/dist/{useNestedProp-DhLxBAwX.cjs → useNestedProp-np0rM3ep.cjs} +1 -1
- package/dist/{usePrinter-CkV5eORP.js → usePrinter-5XpNgqjh.js} +27 -23
- package/dist/usePrinter-DuYSC89K.cjs +1 -0
- package/dist/{vue-data-ui-CyOAruHW.js → vue-data-ui-Bu3V-W6l.js} +57 -57
- package/dist/{vue-data-ui-OR4tWNiS.cjs → vue-data-ui-D3zaRZjl.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +7 -7
- package/dist/{vue-ui-3d-bar-DrnEff_D.cjs → vue-ui-3d-bar-C3EecSgn.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-CxDdjFAw.js → vue-ui-3d-bar-DmM70v1H.js} +8 -8
- package/dist/{vue-ui-accordion-DDf5Y2GY.js → vue-ui-accordion-CzKJYxd2.js} +3 -3
- package/dist/{vue-ui-accordion-CxPjShWo.cjs → vue-ui-accordion-ZppPKpGK.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-BiHpf1Rk.cjs → vue-ui-age-pyramid-BhmOvXIW.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-BMjBTeyH.js → vue-ui-age-pyramid-Bkyd3O37.js} +9 -9
- package/dist/{vue-ui-annotator-B-myvrhe.js → vue-ui-annotator-Bmk4N4Co.js} +1 -1
- package/dist/{vue-ui-annotator--NmsTiIf.cjs → vue-ui-annotator-rwo7Hm5A.cjs} +1 -1
- package/dist/{vue-ui-candlestick-DSwIFt7i.cjs → vue-ui-candlestick-CnYobq1k.cjs} +1 -1
- package/dist/{vue-ui-candlestick-J1JpFsJT.js → vue-ui-candlestick-o8m1DAm8.js} +10 -10
- package/dist/{vue-ui-carousel-table-B62mAFeV.js → vue-ui-carousel-table-DAck3_R_.js} +26 -25
- package/dist/vue-ui-carousel-table-DLQcAZx4.cjs +1 -0
- package/dist/{vue-ui-chestnut-ChAwKgeO.js → vue-ui-chestnut-BAQVvxrX.js} +7 -7
- package/dist/{vue-ui-chestnut-lQvVg9Rn.cjs → vue-ui-chestnut-r6lsB6H0.cjs} +1 -1
- package/dist/{vue-ui-cursor-XXjnAIH2.js → vue-ui-cursor-CYNxiijm.js} +2 -2
- package/dist/{vue-ui-cursor-D-qe8qez.cjs → vue-ui-cursor-ucua7LYB.cjs} +1 -1
- package/dist/{vue-ui-dashboard-CB41KQ7y.cjs → vue-ui-dashboard-DhLCwsFn.cjs} +1 -1
- package/dist/{vue-ui-dashboard-CC-DF6iU.js → vue-ui-dashboard-nnHIe25Y.js} +2 -2
- package/dist/{vue-ui-digits-Degwjx76.js → vue-ui-digits-BB3ZlyZ6.js} +2 -2
- package/dist/{vue-ui-digits-CIHkrLL6.cjs → vue-ui-digits-CEI69I0y.cjs} +1 -1
- package/dist/{vue-ui-donut-CYBpOCFo.js → vue-ui-donut-Ba9Qhfte.js} +10 -10
- package/dist/{vue-ui-donut-jwD3vNoD.cjs → vue-ui-donut-Cruh6AlQ.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-Bbt27unL.cjs → vue-ui-donut-evolution-BZaYmvPf.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-Bxq-hr-P.js → vue-ui-donut-evolution-CJHa5S50.js} +10 -10
- package/dist/{vue-ui-dumbbell-7f9d2mh-.cjs → vue-ui-dumbbell-D6Yu9qxX.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-KsVxecua.js → vue-ui-dumbbell-D_reERJf.js} +9 -9
- package/dist/{vue-ui-flow-BzcB3iiZ.cjs → vue-ui-flow-1HFdth8-.cjs} +1 -1
- package/dist/{vue-ui-flow-FqXhCo7u.js → vue-ui-flow-sBFdpbtF.js} +8 -8
- package/dist/{vue-ui-galaxy-xVldWSiq.cjs → vue-ui-galaxy-DO1moKk6.cjs} +1 -1
- package/dist/{vue-ui-galaxy-B9rSYr7m.js → vue-ui-galaxy-ccP0yuQ3.js} +10 -10
- package/dist/{vue-ui-gauge-k6fqkXqN.js → vue-ui-gauge-CYjZx4Zz.js} +6 -6
- package/dist/{vue-ui-gauge-B4r-qdzi.cjs → vue-ui-gauge-CuFpl36r.cjs} +1 -1
- package/dist/{vue-ui-gizmo-By3-mz_t.cjs → vue-ui-gizmo-C3dyTngy.cjs} +1 -1
- package/dist/{vue-ui-gizmo-CYaThghf.js → vue-ui-gizmo-DNZwsdp9.js} +3 -3
- package/dist/{vue-ui-heatmap-Bdffdnay.js → vue-ui-heatmap-0qNGXzdN.js} +9 -9
- package/dist/{vue-ui-heatmap-B0w5CXLi.cjs → vue-ui-heatmap-CLjngS-G.cjs} +1 -1
- package/dist/{vue-ui-kpi-DG8_lFYS.js → vue-ui-kpi-BiOt8Z9k.js} +3 -3
- package/dist/{vue-ui-kpi-BqN5GILt.cjs → vue-ui-kpi-iclD49Wb.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-C-Na_wY7.cjs → vue-ui-mini-loader-ASe27a1V.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-BZS_gsWT.js → vue-ui-mini-loader-CBPZAUuP.js} +2 -2
- package/dist/{vue-ui-molecule-BK6bSbRU.js → vue-ui-molecule-VqY8WZHi.js} +10 -10
- package/dist/{vue-ui-molecule-Cdg96qiI.cjs → vue-ui-molecule-uCEX5lMP.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-D5GRHLEE.js → vue-ui-mood-radar-B0cjzFkt.js} +10 -10
- package/dist/{vue-ui-mood-radar-D-BCyG9b.cjs → vue-ui-mood-radar-RYbB7jdY.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-D1fD0b-H.cjs → vue-ui-nested-donuts-Bfu90lZl.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-mxJHstX4.js → vue-ui-nested-donuts-DbBSbOjx.js} +10 -10
- package/dist/{vue-ui-onion-6mkIHe9R.js → vue-ui-onion-DJLGXvfr.js} +10 -10
- package/dist/{vue-ui-onion-vKC5zZVM.cjs → vue-ui-onion-DK7lJvIH.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-B_gGjFqe.js → vue-ui-parallel-coordinate-plot-B0_1Uh7a.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-DqbwxRdK.cjs → vue-ui-parallel-coordinate-plot-BaZ5niQk.cjs} +1 -1
- package/dist/{vue-ui-quadrant-C54oPX3B.cjs → vue-ui-quadrant-BCadkOrx.cjs} +1 -1
- package/dist/{vue-ui-quadrant-SEj9AJdW.js → vue-ui-quadrant-CnAk8Np9.js} +11 -11
- package/dist/{vue-ui-quick-chart-DoEE3OMA.cjs → vue-ui-quick-chart--4pkEtK0.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-CqmbqQdH.js → vue-ui-quick-chart-BrgtffFL.js} +8 -8
- package/dist/{vue-ui-radar-Dr91p7eK.cjs → vue-ui-radar-C68BFXPH.cjs} +1 -1
- package/dist/{vue-ui-radar-CKjssi06.js → vue-ui-radar-CDlE8jus.js} +11 -11
- package/dist/{vue-ui-rating-DQvO4ejI.cjs → vue-ui-rating-DV3d_vAO.cjs} +1 -1
- package/dist/{vue-ui-rating-DUSE6rvR.js → vue-ui-rating-DwTC908t.js} +2 -2
- package/dist/{vue-ui-relation-circle-D089YHBB.cjs → vue-ui-relation-circle-0OvmIoRR.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-BmijKEEN.js → vue-ui-relation-circle-_5UsoCBf.js} +6 -6
- package/dist/{vue-ui-rings-BtzbZYTW.js → vue-ui-rings-BHVrR1L1.js} +10 -10
- package/dist/{vue-ui-rings-D237PxGP.cjs → vue-ui-rings-Duu-Dbns.cjs} +1 -1
- package/dist/{vue-ui-scatter-BeKQhHUw.js → vue-ui-scatter-CSfeAiML.js} +147 -147
- package/dist/vue-ui-scatter-azoiHq_a.cjs +1 -0
- package/dist/{vue-ui-screenshot-CnwCy_Kg.cjs → vue-ui-screenshot-D2-GzcYt.cjs} +1 -1
- package/dist/{vue-ui-screenshot-DNuimpRf.js → vue-ui-screenshot-DhMpdJsm.js} +1 -1
- package/dist/{vue-ui-skeleton-CsU74BI7.js → vue-ui-skeleton-CYgbDsKG.js} +3 -3
- package/dist/{vue-ui-skeleton-DYHqPo98.cjs → vue-ui-skeleton-yOWIPVsZ.cjs} +1 -1
- package/dist/{vue-ui-smiley-D150KQ7d.cjs → vue-ui-smiley-BXV9UMjs.cjs} +1 -1
- package/dist/{vue-ui-smiley-d0tQ2o9w.js → vue-ui-smiley-DDn0IZKJ.js} +2 -2
- package/dist/{vue-ui-spark-trend-BDibnFmx.cjs → vue-ui-spark-trend-BMdLIhg7.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-CtZdqmLI.js → vue-ui-spark-trend-DxwmzstI.js} +18 -18
- package/dist/{vue-ui-sparkbar-C-HlLkKi.js → vue-ui-sparkbar-Dk8VLc5p.js} +4 -4
- package/dist/{vue-ui-sparkbar-BpFs4ZhV.cjs → vue-ui-sparkbar-yocSweJn.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-BHBI7l12.cjs → vue-ui-sparkgauge-CdW6FTRw.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-BDRCFVP5.js → vue-ui-sparkgauge-G7BowYq4.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-BjWnqdfo.cjs → vue-ui-sparkhistogram-BWulWwCi.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-B5nNXynh.js → vue-ui-sparkhistogram-CkkEGb0a.js} +5 -5
- package/dist/{vue-ui-sparkline-DpnhvlTf.cjs → vue-ui-sparkline-CaetICAe.cjs} +1 -1
- package/dist/{vue-ui-sparkline-o3mpXRV-.js → vue-ui-sparkline-LBi6ypp4.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-CST5NcMP.cjs → vue-ui-sparkstackbar-CAJaJ3ZQ.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-Bko-XhdQ.js → vue-ui-sparkstackbar-DxUkSfRG.js} +4 -4
- package/dist/{vue-ui-stackbar-Br1WGSyo.js → vue-ui-stackbar-BP1YHhjl.js} +33 -33
- package/dist/{vue-ui-stackbar-B3nyr_3-.cjs → vue-ui-stackbar-BPyxp0m8.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-DkAf9HPJ.cjs → vue-ui-strip-plot-BJSzqxzi.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-C7Q-J22i.js → vue-ui-strip-plot-BYJWkk2_.js} +10 -10
- package/dist/{vue-ui-table-1vOGIOAk.cjs → vue-ui-table-C0-NQWi3.cjs} +1 -1
- package/dist/{vue-ui-table-BTXo44Nv.js → vue-ui-table-CWHUBpqz.js} +16 -16
- package/dist/{vue-ui-table-heatmap-BNcfBY7T.cjs → vue-ui-table-heatmap-9oVqDvLC.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-BosdMOLZ.js → vue-ui-table-heatmap-uYQph968.js} +15 -15
- package/dist/{vue-ui-table-sparkline-BGCEgn2A.cjs → vue-ui-table-sparkline-BHJAP-Uh.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-D0NjMfnV.js → vue-ui-table-sparkline-Bv39O2DT.js} +16 -16
- package/dist/{vue-ui-thermometer-CUBnp6lX.cjs → vue-ui-thermometer-CqcNegd7.cjs} +1 -1
- package/dist/{vue-ui-thermometer-Bnn77E-v.js → vue-ui-thermometer-JLaF8-hy.js} +6 -6
- package/dist/{vue-ui-timer-JupC7c3X.js → vue-ui-timer-B2ZQBIVg.js} +5 -5
- package/dist/{vue-ui-timer-D2WCDGWF.cjs → vue-ui-timer-fu2zcs6f.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-Db9JjYq5.js → vue-ui-tiremarks-CXuGp82M.js} +6 -6
- package/dist/{vue-ui-tiremarks-FxWaEnUD.cjs → vue-ui-tiremarks-DzrCVTcA.cjs} +1 -1
- package/dist/{vue-ui-treemap-DPD9rcYE.js → vue-ui-treemap-CubutXgp.js} +10 -10
- package/dist/{vue-ui-treemap-oplXghMz.cjs → vue-ui-treemap-DmEpWWkN.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-BrOR3Xkc.cjs → vue-ui-vertical-bar-BpyY1mcc.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-DeUOAiy4.js → vue-ui-vertical-bar-Dqd4bZVC.js} +10 -10
- package/dist/{vue-ui-waffle-qvh8AKep.js → vue-ui-waffle-D1n_ln-O.js} +10 -10
- package/dist/{vue-ui-waffle-DGrZjGQR.cjs → vue-ui-waffle-DzbRkTbY.cjs} +1 -1
- package/dist/{vue-ui-wheel-CuEobbmN.cjs → vue-ui-wheel-BTJ9Ds5T.cjs} +1 -1
- package/dist/{vue-ui-wheel-DmG03DhW.js → vue-ui-wheel-C-BFxhCO.js} +6 -6
- package/dist/{vue-ui-word-cloud-CbnPyd1_.cjs → vue-ui-word-cloud-BZLUTH8A.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-Dg0WQKL1.js → vue-ui-word-cloud-DdbqYmZz.js} +26 -26
- package/dist/{vue-ui-xy-gHnKcmgZ.cjs → vue-ui-xy-BEB7zD0E.cjs} +2 -2
- package/dist/{vue-ui-xy-BBlRgHyb.js → vue-ui-xy-CLJaG6lQ.js} +272 -272
- package/dist/{vue-ui-xy-canvas-CzCS04yK.cjs → vue-ui-xy-canvas-CJHNw8ek.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-CqyEve92.js → vue-ui-xy-canvas-DE1jTXbE.js} +34 -34
- package/package.json +1 -1
- package/dist/BaseIcon-JWYc0t9a.cjs +0 -1
- package/dist/usePrinter-0s8wVGIy.cjs +0 -1
- package/dist/vue-ui-carousel-table-Cg3I81MW.cjs +0 -1
- package/dist/vue-ui-scatter-_bZ2lVMS.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-NvxTr0fZ.cjs"),xe=require("./useResponsive-B3TrDDIG.cjs"),ne=require("./BaseIcon-JWYc0t9a.cjs"),Pe=require("./Tooltip-CkqTs_wn.cjs"),Se=require("./usePrinter-0s8wVGIy.cjs"),Te=require("./Slicer-IdC3VhM9.cjs"),Re=require("./vue-ui-skeleton-DYHqPo98.cjs"),be=require("./useNestedProp-DhLxBAwX.cjs"),Ie=require("./PackageVersion-rOhPenOY.cjs"),Oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={LINE:"LINE",BAR:"BAR",DONUT:"DONUT"},De=["SERIE","SERIES","DATA","VALUE","VALUES","NUM"];function Me({dataset:s,barLineSwitch:B=6}){let h=null,L=null,z=0;if((typeof s=="number"||typeof s=="string")&&console.warn(`The provided dataset (${s}) is not sufficient to build a chart`),Q(s)&&(P(s)&&(s.length<B?h=S.BAR:h=S.LINE,L=s,z=s.length),re(s))){if(!qe(s))return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."),!1;const U=Object.keys(s[0]),j=Object.values(s[0]);if(!U.some(E=>We(E)))return console.warn("The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important."),!1;Be(j,E=>typeof E=="number")&&(h=S.DONUT,L=s),Be(j,E=>Array.isArray(E)&&P(E))&&(we(s)>B?h=S.LINE:h=S.BAR,z=we(s),L=s.map(E=>({...E,data:je(E,$=>P($))}))),s=s.map(E=>Ee(E)),L=L.map(E=>Ee(E))}return Q(s)&&[...new Set(s.flatMap(U=>Array.isArray(U)))][0],{dataset:s,type:h,usableDataset:L,maxSeriesLength:z}}function _e(s){return!s||Q(s)&&!s.length}function Q(s){return Array.isArray(s)}function P(s){if(!Q(s)||_e(s))return!1;const B=s.map(h=>Number(h));return![...new Set(B.flatMap(h=>typeof h=="number"&&!isNaN(h)))].includes(!1)}function re(s){return!Q(s)||_e(s)||!![...new Set(s.flatMap(h=>typeof h=="object"&&!Array.isArray(h)))].includes(!1)?!1:!s.map(h=>Object.keys(h).length>0).includes(!1)}function Ue(s,B){const h=Object.keys(s).sort(),L=Object.keys(B).sort();if(h.length!==L.length)return!1;for(let z=0;z<h.length;z+=1){const F=h[z],M=L[z];if(F!==M||typeof s[F]!=typeof B[M])return!1}return!0}function qe(s){if(s.length<=1)return!0;for(let B=0;B<s.length;B+=1)for(let h=B+1;h<s.length;h+=1)if(!Ue(s[B],s[h]))return!1;return!0}function We(s){return De.includes(s.toUpperCase())}function Be(s,B){let h=[];for(let L=0;L<s.length;L+=1)h.push(B(s[L]));return h.includes(!0)}function we(s){return Math.max(...[...s].flatMap(B=>Object.values(B).filter(h=>P(h)).map(h=>h.length)))}function je(s,B){return Object.values(s).filter(h=>B(h))[0]}function Ee(s){const B={};for(let h in s)s.hasOwnProperty(h)&&(B[h.toUpperCase()]=s[h]);return B}const Le=s=>(e.pushScopeId("data-v-b839026c"),s=s(),e.popScopeId(),s),Ge=["id"],He=["xmlns","viewBox"],Xe=["id"],Ye=["id"],Ze=Le(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Je=["id"],Qe=["flood-color"],Ke={key:0,class:"donut-label-connectors"},et=["d","stroke","stroke-width","filter"],tt=["cx","cy","r","fill","filter"],lt={class:"donut"},at=["d","fill","stroke","stroke-width","filter"],ot=["d","onMouseenter","onClick"],nt={key:1,class:"donut-labels quick-animation"},rt=["cx","cy","fill","stroke","filter"],it=["text-anchor","x","y","fill","font-size","filter"],ut=["text-anchor","x","y","fill","font-size","filter"],st={key:2,class:"donut-hollow quick-animation"},ct=["x","y","font-size","fill"],dt=["x","y","font-size","fill"],vt={key:0,class:"line-grid"},mt=["x1","x2","y1","y2","stroke","stroke-width"],ht=["x1","x2","y1","y2","stroke","stroke-width"],pt={key:1,class:"line-axis"},ft=["x1","x2","y1","y2","stroke","stroke-width"],kt=["x1","x2","y1","y2","stroke","stroke-width"],gt={key:2,class:"yLabels"},yt=["x1","x2","y1","y2","stroke","stroke-width"],xt=["x","y","font-size","fill"],St={key:3,class:"periodLabels"},bt=["x1","x2","y1","y2","stroke","stroke-width"],Bt=["font-size","text-anchor","fill","transform"],wt={class:"plots"},Et={class:"line-plot-series"},_t=["d","stroke","stroke-width"],Lt=["d","stroke","stroke-width"],At=["d","stroke","stroke-width"],Ct=["d","stroke","stroke-width"],Nt=["cx","cy","fill","stroke"],zt={key:4,class:"dataLabels"},Vt=["font-size","fill","x","y"],Ft={class:"tooltip-traps"},$t=["x","y","height","width","fill","onMouseenter","onClick"],Pt={key:0,class:"line-grid"},Tt=["x1","x2","y1","y2","stroke","stroke-width"],Rt=["x1","x2","y1","y2","stroke","stroke-width"],It={key:1,class:"line-axis"},Ot=["x1","x2","y1","y2","stroke","stroke-width"],Dt=["x1","x2","y1","y2","stroke","stroke-width"],Mt={key:2,class:"yLabels"},Ut=["x1","x2","y1","y2","stroke","stroke-width"],qt=["x","y","font-size","fill"],Wt={key:3,class:"periodLabels"},jt=["x1","x2","y1","y2","stroke","stroke-width"],Gt=["font-size","text-anchor","transform","fill"],Ht={class:"plots"},Xt=["x","width","height","y","fill","stroke","stroke-width"],Yt=["to"],Zt=["from","to"],Jt={key:4,class:"dataLabels"},Qt=["x","y","font-size","fill"],Kt={class:"tooltip-traps"},el=["x","y","height","width","fill","onMouseenter","onClick"],tl={key:3,class:"axis-labels"},ll={key:0},al=["font-size","fill","x","y"],ol={key:1},nl=["font-size","fill","x","y"],rl={key:2},il=["font-size","fill","transform"],ul={key:3},sl=["font-size","fill","transform"],cl={key:4,class:"vue-data-ui-watermark"},dl=["onClick"],vl=["onClick"],ml=["onClick"],hl={key:1,class:"vue-ui-quick-chart-not-processable"},pl=Le(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),fl={__name:"vue-ui-quick-chart",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}}},emits:["selectDatapoint","selectLegend"],setup(s,{expose:B,emit:h}){const L=s,{vue_ui_quick_chart:z}=u.useConfig(),F=e.ref(null),M=e.ref(null),U=e.ref(null),j=e.ref(null),E=e.ref(u.createUid()),$=e.ref(!1),G=e.ref(null),R=e.ref(""),V=e.ref(null),x=e.ref([]),se=e.ref(0),K=e.ref(0),t=e.computed({get:()=>ce(),set:n=>n});function ce(){const n=be.useNestedProp({userConfig:L.config,defaultConfig:z});return n.theme?{...be.useNestedProp({userConfig:u.themes.vue_ui_quick_chart[n.theme]||L.config,defaultConfig:n}),customPalette:u.themePalettes[n.theme]||u.palette}:n}e.watch(()=>L.config,n=>{t.value=ce(),y.value.width=t.value.width,y.value.height=t.value.height,me()},{deep:!0}),e.watch(()=>L.dataset,n=>{f.value=X.value,k.value.start=0,k.value.end=f.value.maxSeriesLength,K.value+=1},{deep:!0});const H=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),X=e.computed(()=>{const n=Me({dataset:u.sanitizeArray(L.dataset,["serie","series","data","value","values","num"]),barLineSwitch:t.value.chartIsBarUnderDatasetLength});return n||console.error("VueUiQuickChart : Dataset is not processable"),n}),f=e.ref(X.value),Ae=e.computed(()=>!!f.value),b=e.computed(()=>f.value?f.value.type:null);e.watch(()=>b.value,n=>{n||u.error({componentName:"VueUiQuickChart",type:"dataset"})},{immediate:!0});const{isPrinting:ee,isImaging:te,generatePdf:de,generateImage:ve}=Se.usePrinter({elementId:`${b.value}_${E.value}`,fileName:t.value.title||b.value}),y=e.ref({width:t.value.width,height:t.value.height}),le=e.ref({showTooltip:t.value.showTooltip}),ae=e.ref(null);e.onMounted(()=>{me()});function me(){if(t.value.responsive){const n=xe.throttle(()=>{const{width:v,height:l}=xe.useResponsive({chart:F.value,title:t.value.title?M.value:null,legend:t.value.showLegend?U.value:null,slicer:[S.BAR,S.LINE].includes(b.value)&&t.value.zoomXy&&f.value.maxSeriesLength>1?j.value:null});y.value.width=v,y.value.height=l});ae.value=new ResizeObserver(n),ae.value.observe(F.value.parentNode)}}e.onBeforeUnmount(()=>{ae.value&&ae.value.disconnect()});const Ce=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 he(n){return[...n].map(v=>v.value).reduce((v,l)=>v+l,0)}function Y(n){return t.value.blurOnHover&&![null,void 0].includes(V.value)&&V.value!==n?`url(#blur_${E.value})`:""}function pe(n,v){x.value.includes(n)?x.value=x.value.filter(l=>l!==n):x.value.length<v&&x.value.push(n)}const fe=e.ref(null),ke=e.ref(null),oe=e.ref(!1);function Ne(n,v){oe.value=!0;let l=n.value;if(x.value.includes(n.id)){let i=function(){l>r?(oe.value=!1,cancelAnimationFrame(ke.value),f.value={...f.value,dataset:f.value.dataset.map((m,A)=>n.id===`donut_${A}`?{...m,value:r,VALUE:r}:m)}):(l+=r*.025,f.value={...f.value,dataset:f.value.dataset.map((m,A)=>n.id===`donut_${A}`?{...m,value:l,VALUE:l}:m)},ke.value=requestAnimationFrame(i))};x.value=x.value.filter(m=>m!==n.id);const r=X.value.dataset.find((m,A)=>n.id===`donut_${A}`).VALUE;i()}else if(v.length>1){let r=function(){l<.1?(oe.value=!1,cancelAnimationFrame(fe.value),x.value.push(n.id),f.value={...f.value,dataset:f.value.dataset.map((i,m)=>n.id===`donut_${m}`?{...i,value:0,VALUE:0}:i)}):(l/=1.1,f.value={...f.value,dataset:f.value.dataset.map((i,m)=>n.id===`donut_${m}`?{...i,value:l,VALUE:l}:i)},fe.value=requestAnimationFrame(r))};r()}}const T=e.ref(null);function ze(n){T.value=n}const ge=e.computed(()=>t.value.donutThicknessRatio<.15?.15:t.value.donutThicknessRatio>.4?.4:t.value.donutThicknessRatio),w=e.computed(()=>{if(b.value!==S.DONUT)return null;const n=f.value.dataset.map((a,o)=>({...a,value:a.VALUE||a.DATA||a.SERIE||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`donut_${o}`})).map((a,o)=>({...a,color:a.COLOR?u.convertColorToHex(a.COLOR):H.value[o+t.value.paletteStartIndex]||u.palette[o+t.value.paletteStartIndex]||u.palette[(o+t.value.paletteStartIndex)%u.palette.length],immutableValue:a.value}));function v(a,o){return u.dataLabel({v:isNaN(a.value/he(o))?0:a.value/he(o)*100,s:"%",r:t.value.dataLabelRoundingPercentage})}function l(a){return a.proportion*100>t.value.donutHideLabelUnderPercentage}function r(a,o){const g=X.value.dataset.find((_,C)=>`donut_${C}`===a).VALUE;return Math.abs(String(Number(g.toFixed(0))).length-String(Number(o.toFixed(0))).length)}function i({datapoint:a,seriesIndex:o}){G.value={datapoint:a,seriesIndex:o,config:t.value,dataset:n},V.value=a.id;const g=t.value.tooltipCustomFormat;if(u.isFunction(g)&&u.functionReturnsString(()=>g({datapoint:a,seriesIndex:o,series:n,config:t.value})))R.value=g({datapoint:a,seriesIndex:o,series:n,config:t.value});else{let p="";p+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${a.name}</div>`,p+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${a.color}"/></svg>`,p+=`<b>${u.applyDataLabel(t.value.formatter,a.value,u.dataLabel({p:t.value.valuePrefix,v:a.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:a,seriesIndex:o})}</b>`,p+=`<span>(${u.dataLabel({v:a.proportion*100,s:"%",r:t.value.dataLabelRoundingPercentage})})</span></div>`,R.value=`<div>${p}</div>`}$.value=!0}function m(){$.value=!1,V.value=null,T.value=null}const A={centerX:y.value.width/2,centerY:y.value.height/2},N=n.filter(a=>!x.value.includes(a.id)).map(a=>a.value||0).reduce((a,o)=>a+o,0),q=n.map((a,o)=>({...a,proportion:(a.value||0)/N,value:a.value||0,absoluteValue:X.value.dataset.find((g,p)=>`donut_${p}`===a.id).VALUE})),I=y.value.width/2,W=y.value.height/2,O=y.value.height*t.value.donutRadiusRatio;return{dataset:q.filter(a=>!x.value.includes(a.id)),legend:q,drawingArea:A,displayArcPercentage:v,isArcBigEnough:l,useTooltip:i,killTooltip:m,getSpaces:r,total:N,cx:I,cy:W,radius:O,chart:u.makeDonut({series:n.filter(a=>!x.value.includes(a.id))},I,W,O,O,1.99999,2,1,360,105.25,y.value.height*ge.value)}}),k=e.ref({start:0,end:f.value.maxSeriesLength});function Ve(){k.value={start:0,end:f.value.maxSeriesLength},K.value+=1}const Fe=e.computed(()=>{if(!t.value.zoomMinimap.show||b.value===S.DONUT)return[];let n=[];P(f.value.dataset)&&(n=f.value.dataset),re(f.value.dataset)&&(n=f.value.dataset.map((i,m)=>({values:i.VALUE||i.DATA||i.SERIE||i.SERIES||i.VALUES||i.NUM||0,id:b.value===S.LINE?`line_${m}`:`bar_${m}`})).filter(i=>!x.value.includes(i.id)));const v=P(n)?n.length:Math.max(...n.map(i=>i.values.length));let l=[];if(P(n))l=n;else for(let i=0;i<v;i+=1)l.push(n.map(m=>m.values[i]||0).reduce((m,A)=>(m||0)+(A||0),0));const r=Math.min(...l);return l.map(i=>i+(r<0?Math.abs(r):0))}),d=e.computed(()=>{if(b.value!==S.LINE)return null;const n={height:y.value.height,width:y.value.width},v={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:n.width-t.value.xyPaddingRight,bottom:n.height-t.value.xyPaddingBottom,width:n.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:n.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];P(f.value.dataset)&&(l=[{values:f.value.dataset.slice(k.value.start,k.value.end),absoluteIndices:f.value.dataset.map((a,o)=>o).slice(k.value.start,k.value.end),name:t.value.title,color:H.value[t.value.paletteStartIndex]||u.palette[t.value.paletteStartIndex],id:"line_0"}]),re(f.value.dataset)&&(l=f.value.dataset.map((a,o)=>({...a,values:a.VALUE||a.DATA||a.SERIE||a.SERIES||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`line_${o}`})).map((a,o)=>({...a,color:a.COLOR?u.convertColorToHex(a.COLOR):H.value[o+t.value.paletteStartIndex]||u.palette[o+t.value.paletteStartIndex]||u.palette[(o+t.value.paletteStartIndex)%u.palette.length],values:a.values.slice(k.value.start,k.value.end),absoluteIndices:a.values.map((g,p)=>p).slice(k.value.start,k.value.end)})));const r={max:Math.max(...l.filter(a=>!x.value.includes(a.id)).flatMap(a=>a.values)),min:Math.min(...l.filter(a=>!x.value.includes(a.id)).flatMap(a=>a.values)),maxSeries:Math.max(...l.map(a=>a.values.length))},i=u.calculateNiceScale(r.min<0?r.min:0,r.max<0?0:r.max,t.value.xyScaleSegments),m=r.min<0?Math.abs(r.min):0,A=r.max<0?v.top:v.bottom-m/(i.max+m)*v.height,N=v.width/r.maxSeries,q=i.ticks.map(a=>({y:v.bottom-v.height*((a+m)/(i.max+m)),x:v.left-8,value:a})),I=l.map((a,o)=>({...a,coordinates:a.values.map((g,p)=>({x:v.left+N*(p+1)-N/2,y:v.bottom-(g+m)/(i.max+m)*v.height,value:g}))})).map(a=>{let o=[];return a.coordinates.forEach(g=>{o.push(`${g.x},${g.y} `)}),{...a,linePath:o.join(" ")}});function W(a){V.value=a,T.value=a;const o=l.map(p=>({...p,value:p.values[a],absoluteIndex:p.absoluteIndices[a]})).filter(p=>!x.value.includes(p.id));G.value={datapoint:o,seriesIndex:a,config:t.value,dataset:l};const g=t.value.tooltipCustomFormat;if(u.isFunction(g)&&u.functionReturnsString(()=>g({datapoint:o,seriesIndex:a,series:l,config:t.value})))R.value=g({datapoint:o,seriesIndex:a,series:l,config:t.value});else{let p="";t.value.xyPeriods[o[0].absoluteIndex]&&(p+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[o[0].absoluteIndex]}</div>`),o.forEach((_,C)=>{p+=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DQRLTu78.cjs"),xe=require("./useResponsive-B3TrDDIG.cjs"),ne=require("./BaseIcon-BDeByyf-.cjs"),Pe=require("./Tooltip-D-JR_3NK.cjs"),Se=require("./usePrinter-DuYSC89K.cjs"),Te=require("./Slicer-iAp8x_Wq.cjs"),Re=require("./vue-ui-skeleton-yOWIPVsZ.cjs"),be=require("./useNestedProp-np0rM3ep.cjs"),Ie=require("./PackageVersion-BqVp7cHC.cjs"),Oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={LINE:"LINE",BAR:"BAR",DONUT:"DONUT"},De=["SERIE","SERIES","DATA","VALUE","VALUES","NUM"];function Me({dataset:s,barLineSwitch:B=6}){let h=null,L=null,z=0;if((typeof s=="number"||typeof s=="string")&&console.warn(`The provided dataset (${s}) is not sufficient to build a chart`),Q(s)&&(P(s)&&(s.length<B?h=S.BAR:h=S.LINE,L=s,z=s.length),re(s))){if(!qe(s))return console.warn("The objects in the dataset array have a different data structure. Either keys or value types are different."),!1;const U=Object.keys(s[0]),j=Object.values(s[0]);if(!U.some(E=>We(E)))return console.warn("The data type of the dataset objects in the array must contain one of the following keys: DATA, SERIES, VALUE, VALUES, NUM. Casing is not important."),!1;Be(j,E=>typeof E=="number")&&(h=S.DONUT,L=s),Be(j,E=>Array.isArray(E)&&P(E))&&(we(s)>B?h=S.LINE:h=S.BAR,z=we(s),L=s.map(E=>({...E,data:je(E,$=>P($))}))),s=s.map(E=>Ee(E)),L=L.map(E=>Ee(E))}return Q(s)&&[...new Set(s.flatMap(U=>Array.isArray(U)))][0],{dataset:s,type:h,usableDataset:L,maxSeriesLength:z}}function _e(s){return!s||Q(s)&&!s.length}function Q(s){return Array.isArray(s)}function P(s){if(!Q(s)||_e(s))return!1;const B=s.map(h=>Number(h));return![...new Set(B.flatMap(h=>typeof h=="number"&&!isNaN(h)))].includes(!1)}function re(s){return!Q(s)||_e(s)||!![...new Set(s.flatMap(h=>typeof h=="object"&&!Array.isArray(h)))].includes(!1)?!1:!s.map(h=>Object.keys(h).length>0).includes(!1)}function Ue(s,B){const h=Object.keys(s).sort(),L=Object.keys(B).sort();if(h.length!==L.length)return!1;for(let z=0;z<h.length;z+=1){const F=h[z],M=L[z];if(F!==M||typeof s[F]!=typeof B[M])return!1}return!0}function qe(s){if(s.length<=1)return!0;for(let B=0;B<s.length;B+=1)for(let h=B+1;h<s.length;h+=1)if(!Ue(s[B],s[h]))return!1;return!0}function We(s){return De.includes(s.toUpperCase())}function Be(s,B){let h=[];for(let L=0;L<s.length;L+=1)h.push(B(s[L]));return h.includes(!0)}function we(s){return Math.max(...[...s].flatMap(B=>Object.values(B).filter(h=>P(h)).map(h=>h.length)))}function je(s,B){return Object.values(s).filter(h=>B(h))[0]}function Ee(s){const B={};for(let h in s)s.hasOwnProperty(h)&&(B[h.toUpperCase()]=s[h]);return B}const Le=s=>(e.pushScopeId("data-v-b839026c"),s=s(),e.popScopeId(),s),Ge=["id"],He=["xmlns","viewBox"],Xe=["id"],Ye=["id"],Ze=Le(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Je=["id"],Qe=["flood-color"],Ke={key:0,class:"donut-label-connectors"},et=["d","stroke","stroke-width","filter"],tt=["cx","cy","r","fill","filter"],lt={class:"donut"},at=["d","fill","stroke","stroke-width","filter"],ot=["d","onMouseenter","onClick"],nt={key:1,class:"donut-labels quick-animation"},rt=["cx","cy","fill","stroke","filter"],it=["text-anchor","x","y","fill","font-size","filter"],ut=["text-anchor","x","y","fill","font-size","filter"],st={key:2,class:"donut-hollow quick-animation"},ct=["x","y","font-size","fill"],dt=["x","y","font-size","fill"],vt={key:0,class:"line-grid"},mt=["x1","x2","y1","y2","stroke","stroke-width"],ht=["x1","x2","y1","y2","stroke","stroke-width"],pt={key:1,class:"line-axis"},ft=["x1","x2","y1","y2","stroke","stroke-width"],kt=["x1","x2","y1","y2","stroke","stroke-width"],gt={key:2,class:"yLabels"},yt=["x1","x2","y1","y2","stroke","stroke-width"],xt=["x","y","font-size","fill"],St={key:3,class:"periodLabels"},bt=["x1","x2","y1","y2","stroke","stroke-width"],Bt=["font-size","text-anchor","fill","transform"],wt={class:"plots"},Et={class:"line-plot-series"},_t=["d","stroke","stroke-width"],Lt=["d","stroke","stroke-width"],At=["d","stroke","stroke-width"],Ct=["d","stroke","stroke-width"],Nt=["cx","cy","fill","stroke"],zt={key:4,class:"dataLabels"},Vt=["font-size","fill","x","y"],Ft={class:"tooltip-traps"},$t=["x","y","height","width","fill","onMouseenter","onClick"],Pt={key:0,class:"line-grid"},Tt=["x1","x2","y1","y2","stroke","stroke-width"],Rt=["x1","x2","y1","y2","stroke","stroke-width"],It={key:1,class:"line-axis"},Ot=["x1","x2","y1","y2","stroke","stroke-width"],Dt=["x1","x2","y1","y2","stroke","stroke-width"],Mt={key:2,class:"yLabels"},Ut=["x1","x2","y1","y2","stroke","stroke-width"],qt=["x","y","font-size","fill"],Wt={key:3,class:"periodLabels"},jt=["x1","x2","y1","y2","stroke","stroke-width"],Gt=["font-size","text-anchor","transform","fill"],Ht={class:"plots"},Xt=["x","width","height","y","fill","stroke","stroke-width"],Yt=["to"],Zt=["from","to"],Jt={key:4,class:"dataLabels"},Qt=["x","y","font-size","fill"],Kt={class:"tooltip-traps"},el=["x","y","height","width","fill","onMouseenter","onClick"],tl={key:3,class:"axis-labels"},ll={key:0},al=["font-size","fill","x","y"],ol={key:1},nl=["font-size","fill","x","y"],rl={key:2},il=["font-size","fill","transform"],ul={key:3},sl=["font-size","fill","transform"],cl={key:4,class:"vue-data-ui-watermark"},dl=["onClick"],vl=["onClick"],ml=["onClick"],hl={key:1,class:"vue-ui-quick-chart-not-processable"},pl=Le(()=>e.createElementVNode("span",null,"Dataset is not processable",-1)),fl={__name:"vue-ui-quick-chart",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,Object,String,Number],default(){return null}}},emits:["selectDatapoint","selectLegend"],setup(s,{expose:B,emit:h}){const L=s,{vue_ui_quick_chart:z}=u.useConfig(),F=e.ref(null),M=e.ref(null),U=e.ref(null),j=e.ref(null),E=e.ref(u.createUid()),$=e.ref(!1),G=e.ref(null),R=e.ref(""),V=e.ref(null),x=e.ref([]),se=e.ref(0),K=e.ref(0),t=e.computed({get:()=>ce(),set:n=>n});function ce(){const n=be.useNestedProp({userConfig:L.config,defaultConfig:z});return n.theme?{...be.useNestedProp({userConfig:u.themes.vue_ui_quick_chart[n.theme]||L.config,defaultConfig:n}),customPalette:u.themePalettes[n.theme]||u.palette}:n}e.watch(()=>L.config,n=>{t.value=ce(),y.value.width=t.value.width,y.value.height=t.value.height,me()},{deep:!0}),e.watch(()=>L.dataset,n=>{f.value=X.value,k.value.start=0,k.value.end=f.value.maxSeriesLength,K.value+=1},{deep:!0});const H=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),X=e.computed(()=>{const n=Me({dataset:u.sanitizeArray(L.dataset,["serie","series","data","value","values","num"]),barLineSwitch:t.value.chartIsBarUnderDatasetLength});return n||console.error("VueUiQuickChart : Dataset is not processable"),n}),f=e.ref(X.value),Ae=e.computed(()=>!!f.value),b=e.computed(()=>f.value?f.value.type:null);e.watch(()=>b.value,n=>{n||u.error({componentName:"VueUiQuickChart",type:"dataset"})},{immediate:!0});const{isPrinting:ee,isImaging:te,generatePdf:de,generateImage:ve}=Se.usePrinter({elementId:`${b.value}_${E.value}`,fileName:t.value.title||b.value}),y=e.ref({width:t.value.width,height:t.value.height}),le=e.ref({showTooltip:t.value.showTooltip}),ae=e.ref(null);e.onMounted(()=>{me()});function me(){if(t.value.responsive){const n=xe.throttle(()=>{const{width:v,height:l}=xe.useResponsive({chart:F.value,title:t.value.title?M.value:null,legend:t.value.showLegend?U.value:null,slicer:[S.BAR,S.LINE].includes(b.value)&&t.value.zoomXy&&f.value.maxSeriesLength>1?j.value:null});y.value.width=v,y.value.height=l});ae.value=new ResizeObserver(n),ae.value.observe(F.value.parentNode)}}e.onBeforeUnmount(()=>{ae.value&&ae.value.disconnect()});const Ce=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 he(n){return[...n].map(v=>v.value).reduce((v,l)=>v+l,0)}function Y(n){return t.value.blurOnHover&&![null,void 0].includes(V.value)&&V.value!==n?`url(#blur_${E.value})`:""}function pe(n,v){x.value.includes(n)?x.value=x.value.filter(l=>l!==n):x.value.length<v&&x.value.push(n)}const fe=e.ref(null),ke=e.ref(null),oe=e.ref(!1);function Ne(n,v){oe.value=!0;let l=n.value;if(x.value.includes(n.id)){let i=function(){l>r?(oe.value=!1,cancelAnimationFrame(ke.value),f.value={...f.value,dataset:f.value.dataset.map((m,A)=>n.id===`donut_${A}`?{...m,value:r,VALUE:r}:m)}):(l+=r*.025,f.value={...f.value,dataset:f.value.dataset.map((m,A)=>n.id===`donut_${A}`?{...m,value:l,VALUE:l}:m)},ke.value=requestAnimationFrame(i))};x.value=x.value.filter(m=>m!==n.id);const r=X.value.dataset.find((m,A)=>n.id===`donut_${A}`).VALUE;i()}else if(v.length>1){let r=function(){l<.1?(oe.value=!1,cancelAnimationFrame(fe.value),x.value.push(n.id),f.value={...f.value,dataset:f.value.dataset.map((i,m)=>n.id===`donut_${m}`?{...i,value:0,VALUE:0}:i)}):(l/=1.1,f.value={...f.value,dataset:f.value.dataset.map((i,m)=>n.id===`donut_${m}`?{...i,value:l,VALUE:l}:i)},fe.value=requestAnimationFrame(r))};r()}}const T=e.ref(null);function ze(n){T.value=n}const ge=e.computed(()=>t.value.donutThicknessRatio<.15?.15:t.value.donutThicknessRatio>.4?.4:t.value.donutThicknessRatio),w=e.computed(()=>{if(b.value!==S.DONUT)return null;const n=f.value.dataset.map((a,o)=>({...a,value:a.VALUE||a.DATA||a.SERIE||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`donut_${o}`})).map((a,o)=>({...a,color:a.COLOR?u.convertColorToHex(a.COLOR):H.value[o+t.value.paletteStartIndex]||u.palette[o+t.value.paletteStartIndex]||u.palette[(o+t.value.paletteStartIndex)%u.palette.length],immutableValue:a.value}));function v(a,o){return u.dataLabel({v:isNaN(a.value/he(o))?0:a.value/he(o)*100,s:"%",r:t.value.dataLabelRoundingPercentage})}function l(a){return a.proportion*100>t.value.donutHideLabelUnderPercentage}function r(a,o){const g=X.value.dataset.find((_,C)=>`donut_${C}`===a).VALUE;return Math.abs(String(Number(g.toFixed(0))).length-String(Number(o.toFixed(0))).length)}function i({datapoint:a,seriesIndex:o}){G.value={datapoint:a,seriesIndex:o,config:t.value,dataset:n},V.value=a.id;const g=t.value.tooltipCustomFormat;if(u.isFunction(g)&&u.functionReturnsString(()=>g({datapoint:a,seriesIndex:o,series:n,config:t.value})))R.value=g({datapoint:a,seriesIndex:o,series:n,config:t.value});else{let p="";p+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${a.name}</div>`,p+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${a.color}"/></svg>`,p+=`<b>${u.applyDataLabel(t.value.formatter,a.value,u.dataLabel({p:t.value.valuePrefix,v:a.value,s:t.value.valueSuffix,r:t.value.dataLabelRoundingValue}),{datapoint:a,seriesIndex:o})}</b>`,p+=`<span>(${u.dataLabel({v:a.proportion*100,s:"%",r:t.value.dataLabelRoundingPercentage})})</span></div>`,R.value=`<div>${p}</div>`}$.value=!0}function m(){$.value=!1,V.value=null,T.value=null}const A={centerX:y.value.width/2,centerY:y.value.height/2},N=n.filter(a=>!x.value.includes(a.id)).map(a=>a.value||0).reduce((a,o)=>a+o,0),q=n.map((a,o)=>({...a,proportion:(a.value||0)/N,value:a.value||0,absoluteValue:X.value.dataset.find((g,p)=>`donut_${p}`===a.id).VALUE})),I=y.value.width/2,W=y.value.height/2,O=y.value.height*t.value.donutRadiusRatio;return{dataset:q.filter(a=>!x.value.includes(a.id)),legend:q,drawingArea:A,displayArcPercentage:v,isArcBigEnough:l,useTooltip:i,killTooltip:m,getSpaces:r,total:N,cx:I,cy:W,radius:O,chart:u.makeDonut({series:n.filter(a=>!x.value.includes(a.id))},I,W,O,O,1.99999,2,1,360,105.25,y.value.height*ge.value)}}),k=e.ref({start:0,end:f.value.maxSeriesLength});function Ve(){k.value={start:0,end:f.value.maxSeriesLength},K.value+=1}const Fe=e.computed(()=>{if(!t.value.zoomMinimap.show||b.value===S.DONUT)return[];let n=[];P(f.value.dataset)&&(n=f.value.dataset),re(f.value.dataset)&&(n=f.value.dataset.map((i,m)=>({values:i.VALUE||i.DATA||i.SERIE||i.SERIES||i.VALUES||i.NUM||0,id:b.value===S.LINE?`line_${m}`:`bar_${m}`})).filter(i=>!x.value.includes(i.id)));const v=P(n)?n.length:Math.max(...n.map(i=>i.values.length));let l=[];if(P(n))l=n;else for(let i=0;i<v;i+=1)l.push(n.map(m=>m.values[i]||0).reduce((m,A)=>(m||0)+(A||0),0));const r=Math.min(...l);return l.map(i=>i+(r<0?Math.abs(r):0))}),d=e.computed(()=>{if(b.value!==S.LINE)return null;const n={height:y.value.height,width:y.value.width},v={left:t.value.xyPaddingLeft,top:t.value.xyPaddingTop,right:n.width-t.value.xyPaddingRight,bottom:n.height-t.value.xyPaddingBottom,width:n.width-t.value.xyPaddingLeft-t.value.xyPaddingRight,height:n.height-t.value.xyPaddingTop-t.value.xyPaddingBottom};let l=[];P(f.value.dataset)&&(l=[{values:f.value.dataset.slice(k.value.start,k.value.end),absoluteIndices:f.value.dataset.map((a,o)=>o).slice(k.value.start,k.value.end),name:t.value.title,color:H.value[t.value.paletteStartIndex]||u.palette[t.value.paletteStartIndex],id:"line_0"}]),re(f.value.dataset)&&(l=f.value.dataset.map((a,o)=>({...a,values:a.VALUE||a.DATA||a.SERIE||a.SERIES||a.VALUES||a.NUM||0,name:a.NAME||a.DESCRIPTION||a.TITLE||a.LABEL||`Serie ${o}`,id:`line_${o}`})).map((a,o)=>({...a,color:a.COLOR?u.convertColorToHex(a.COLOR):H.value[o+t.value.paletteStartIndex]||u.palette[o+t.value.paletteStartIndex]||u.palette[(o+t.value.paletteStartIndex)%u.palette.length],values:a.values.slice(k.value.start,k.value.end),absoluteIndices:a.values.map((g,p)=>p).slice(k.value.start,k.value.end)})));const r={max:Math.max(...l.filter(a=>!x.value.includes(a.id)).flatMap(a=>a.values)),min:Math.min(...l.filter(a=>!x.value.includes(a.id)).flatMap(a=>a.values)),maxSeries:Math.max(...l.map(a=>a.values.length))},i=u.calculateNiceScale(r.min<0?r.min:0,r.max<0?0:r.max,t.value.xyScaleSegments),m=r.min<0?Math.abs(r.min):0,A=r.max<0?v.top:v.bottom-m/(i.max+m)*v.height,N=v.width/r.maxSeries,q=i.ticks.map(a=>({y:v.bottom-v.height*((a+m)/(i.max+m)),x:v.left-8,value:a})),I=l.map((a,o)=>({...a,coordinates:a.values.map((g,p)=>({x:v.left+N*(p+1)-N/2,y:v.bottom-(g+m)/(i.max+m)*v.height,value:g}))})).map(a=>{let o=[];return a.coordinates.forEach(g=>{o.push(`${g.x},${g.y} `)}),{...a,linePath:o.join(" ")}});function W(a){V.value=a,T.value=a;const o=l.map(p=>({...p,value:p.values[a],absoluteIndex:p.absoluteIndices[a]})).filter(p=>!x.value.includes(p.id));G.value={datapoint:o,seriesIndex:a,config:t.value,dataset:l};const g=t.value.tooltipCustomFormat;if(u.isFunction(g)&&u.functionReturnsString(()=>g({datapoint:o,seriesIndex:a,series:l,config:t.value})))R.value=g({datapoint:o,seriesIndex:a,series:l,config:t.value});else{let p="";t.value.xyPeriods[o[0].absoluteIndex]&&(p+=`<div style="border-bottom:1px solid ${t.value.tooltipBorderColor};padding-bottom:6px;margin-bottom:3px;">${t.value.xyPeriods[o[0].absoluteIndex]}</div>`),o.forEach((_,C)=>{p+=`
|
|
2
2
|
<div style="display:flex; flex-wrap: wrap; align-items:center; gap:3px;">
|
|
3
3
|
<svg viewBox="0 0 12 12" height="14" width="12"><circle cx="6" cy="6" r="6" stroke="none" fill="${_.color}"/></svg>
|
|
4
4
|
<span>${_.name}:</span>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ref as I, computed as D, watch as Pe, onMounted as rt, onBeforeUnmount as st, openBlock as a, createElementBlock as l, normalizeClass as ne, normalizeStyle as O, createBlock as Te, unref as f, createSlots as vt, withCtx as ae, renderSlot as V, normalizeProps as J, guardReactiveProps as me, createCommentVNode as p, toDisplayString as E, createVNode as re, createElementVNode as _, Fragment as m, renderList as L, mergeProps as Ie, pushScopeId as dt, popScopeId as ct } from "vue";
|
|
2
|
-
import { u as ht, c as ft, t as gt, a as mt, p as U, b as pt, I as xt, e as yt, d as Ee, m as kt, C as He, X as bt, j as St, k as pe, n as Re, i as H, f as M, R as Xe, v as X, x as Ae, y as Ne } from "./index-
|
|
2
|
+
import { u as ht, c as ft, t as gt, a as mt, p as U, b as pt, I as xt, e as yt, d as Ee, m as kt, C as He, X as bt, j as St, k as pe, n as Re, i as H, f as M, R as Xe, v as X, x as Ae, y as Ne } from "./index-COTjlcVF.js";
|
|
3
3
|
import { t as wt, u as _t } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import Le from "./BaseIcon-
|
|
5
|
-
import { _ as At } from "./Tooltip-
|
|
6
|
-
import { u as Lt, U as zt } from "./usePrinter-
|
|
7
|
-
import { S as $t } from "./Slicer-
|
|
8
|
-
import Ct from "./vue-ui-skeleton-
|
|
9
|
-
import { u as Ze } from "./useNestedProp-
|
|
10
|
-
import { _ as Pt } from "./PackageVersion-
|
|
4
|
+
import Le from "./BaseIcon-DHB44s-g.js";
|
|
5
|
+
import { _ as At } from "./Tooltip-0-aPeOmA.js";
|
|
6
|
+
import { u as Lt, U as zt } from "./usePrinter-5XpNgqjh.js";
|
|
7
|
+
import { S as $t } from "./Slicer-CQbVH6fI.js";
|
|
8
|
+
import Ct from "./vue-ui-skeleton-CYgbDsKG.js";
|
|
9
|
+
import { u as Ze } from "./useNestedProp-CcjyiBlC.js";
|
|
10
|
+
import { _ as Pt } from "./PackageVersion-DWAqn7t0.js";
|
|
11
11
|
import { _ as Tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const A = {
|
|
13
13
|
LINE: "LINE",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-NvxTr0fZ.cjs"),Z=require("./useResponsive-B3TrDDIG.cjs"),ge=require("./Title-Cjusozo5.cjs"),ee=require("./usePrinter-0s8wVGIy.cjs"),he=require("./Tooltip-CkqTs_wn.cjs"),me=require("./vue-ui-sparkbar-BpFs4ZhV.cjs"),fe=require("./Legend-DDmBZxt8.cjs"),ye=require("./DataTable-DRJUrEXP.cjs"),ke=require("./vue-ui-skeleton-DYHqPo98.cjs"),be=require("./vue-ui-accordion-CxPjShWo.cjs"),te=require("./useNestedProp-DhLxBAwX.cjs"),Ce=require("./PackageVersion-rOhPenOY.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Be=["id"],_e=["xmlns","viewBox"],xe=["id"],Pe=["stop-color"],$e=["stop-color"],Ne={key:0},Te=["x1","y1","x2","y2","stroke","stroke-width"],Se={key:0},Ee=["d","stroke","stroke-width"],Ve=["d","stroke","stroke-width"],Fe={key:1},Oe=["x","y","text-anchor","font-size","fill","onMouseenter"],Le=["points","stroke","stroke-width"],ze=["points","stroke","stroke-width","fill"],Ae={key:2},Ie=["cx","cy","fill","r","stroke"],Re={key:3,class:"vue-data-ui-watermark"},qe=["onClick"],De={key:0,style:{"max-width":"200px",margin:"0 auto"}},Me={__name:"vue-ui-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(oe,{expose:ae,emit:le}){const d=oe,{vue_ui_radar:re}=n.useConfig(),k=e.computed(()=>!!d.dataset&&Object.keys(d.dataset).length),m=e.ref(n.createUid()),ne=e.ref(null),P=e.ref(!1),$=e.ref(""),F=e.ref(0),b=e.ref(null),O=e.ref(null),L=e.ref(null),z=e.ref(0),A=e.ref(0),I=e.ref(0),t=e.computed({get:()=>R(),set:o=>o});function R(){const o=te.useNestedProp({userConfig:d.config,defaultConfig:re});return o.theme?{...te.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=R(),q(),z.value+=1,A.value+=1,I.value+=1},{deep:!0});const B=e.ref(null);function q(){if(n.objectIsEmpty(d.dataset)&&n.error({componentName:"VueUiRadar",type:"dataset"}),t.value.responsive){const o=Z.throttle(()=>{const{width:a,height:l}=Z.useResponsive({chart:b.value,title:t.value.style.chart.title.text?O.value:null,legend:t.value.style.chart.legend.show?L.value:null});s.value.width=a,s.value.height=l});B.value=new ResizeObserver(o),B.value.observe(b.value.parentNode)}}e.onMounted(()=>{q()}),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:D,isImaging:M,generatePdf:U,generateImage:G}=ee.usePrinter({elementId:`vue-ui-radar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-radar"}),W=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}),ue=e.computed(()=>({style:{backgroundColor:t.value.style.chart.tooltip.backgroundColor,animation:{show:t.value.style.chart.tooltip.animation.show,animationFrames:t.value.style.chart.tooltip.animation.animationFrames},labels:{fontSize:t.value.style.chart.tooltip.fontSize,name:{color:t.value.style.chart.tooltip.color}},gutter:{backgroundColor:"#CCCCCC",opacity:30}}})),s=e.ref({height:312,width:512}),i=e.ref([]),C=e.ref(null),f=e.ref(!1);function H(o){f.value=!0,i.value.includes(o)?(C.value=o,i.value=i.value.filter(a=>a!==o),setTimeout(()=>{f.value=!1,C.value=null},500)):(i.value.push(o),setTimeout(()=>{f.value=!1},500)),le("selectLegend",y.value.filter((a,l)=>!i.value.includes(l)).map(a=>({name:a.name,color:a.color,proportion:a.totalProportion})))}function se(){return y.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)||W.value[a]||n.palette[a]||n.palette[a%n.palette.length],prefix:o.prefix??"",suffix:o.suffix??""})))),p=e.computed(()=>k.value?d.dataset.series.map((o,a)=>({...o,color:n.convertColorToHex(o.color)||W.value[a]||n.palette[a]||n.palette[a%n.palette.length],serieId:`radar_serie_${m.value}_${a}`,formatter:o.formatter||null})):[]),X=e.computed(()=>Math.max(...p.value.flatMap(o=>o.values))),j=e.computed(()=>p.value.length),N=e.computed(()=>Math.min(s.value.width,s.value.height)/3),Y=e.computed(()=>n.createPolygonPath({plot:{x:s.value.width/2,y:s.value.height/2},radius:N.value,sides:j.value,rotation:0})),ie=e.computed(()=>{const o=[];for(let a=0;a<N.value;a+=N.value/t.value.style.chart.layout.grid.graduations)o.push(a);return o}),h=e.computed(()=>Y.value.coordinates.map((o,a)=>{const l=p.value[a].values.map(r=>ce({centerX:s.value.width/2,centerY:s.value.height/2,apexX:o.x,apexY:o.y,proportion:r/(p.value[a].target||X.value)}));return{...o,...p.value[a],plots:l}}));function T({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 ce({centerX:o,centerY:a,apexX:l,apexY:r,proportion:u}){return{x:o+(l-o)*u,y:a+(r-a)*u}}const y=e.computed(()=>{const o=p.value.map((a,l)=>a.values.map(r=>r/(a.target||X.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:()=>H(l),isSegregated:i.value.includes(l)}))}),de=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:""},...y.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}}),x=e.ref(null),S=e.ref([]),E=e.ref(null);function ve(o,a){S.value=[],x.value=a,P.value=!0;let l="";E.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})))$.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)||S.value.push({name:v.value[u].name,value:o.values[u]/o.target*100,color:v.value[u].color,suffix:"%)",prefix:`${n.dataLabel({p:v.value[u].prefix??"",v:o.values[u],s:v.value[u].suffix??"",r:t.value.style.chart.tooltip.roundingValue})} (`,rounding:t.value.style.chart.tooltip.roundingPercentage,formatter:o.formatter});$.value=l}}function J(){e.nextTick(()=>{const o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=[[""],[t.value.translations.target],...y.value.flatMap(c=>[[c.name],["%"]])],l=d.dataset.series.map((c,Ge)=>[c.name,c.target,...c.values.flatMap(V=>[V,isNaN(V/c.target)?"":V/c.target*100])]),r=o.concat([a]).concat(l),u=n.createCsvContent(r);n.downloadCsv({csvContent:u,title:t.value.style.chart.title.text||"vue-ui-radar"})})}const w=e.ref(!1);function pe(o){w.value=o,F.value+=1}function K(){g.value.showTable=!g.value.showTable}function Q(){g.value.showTooltip=!g.value.showTooltip}return ae({getData:se,generatePdf:U,generateCsv:J,generateImage:G,toggleTable:K,toggleTooltip:Q}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-radar ${w.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"radarChart",ref:b,id:`vue-ui-radar_${m.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:O,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(ge._sfc_main,{key:`title_${z.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&&k.value?(e.openBlock(),e.createBlock(ee.UserOptions,{ref_key:"details",ref:ne,key:`user_options_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(M),isPrinting:e.unref(D),uid:m.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:w.value,isTooltip:g.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,position:t.value.userOptions.position,onToggleFullscreen:pe,onGeneratePdf:e.unref(U),onGenerateCsv:J,onGenerateImage:e.unref(G),onToggleTable:K,onToggleTooltip:Q},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":w.value,"vue-data-ui-fulscreen--off":!w.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background: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(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,Pe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity)},null,8,$e)],8,xe))),256))]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Ne,[(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,Te))),256)),t.value.style.chart.layout.grid.graduations>0?(e.openBlock(),e.createElementBlock("g",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie.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:j.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,Ee))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:Y.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,Ve),t.value.style.chart.layout.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:T(l).x,y:T(l).y,"text-anchor":T(l).anchor,"font-size":t.value.style.chart.layout.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.labels.dataLabels.color,onMouseenter:u=>ve(l,r),onMouseleave:a[0]||(a[0]=u=>{P.value=!1,x.value=null})},e.toDisplayString(l.name),41,Oe))),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":f.value&&C.value===r&&t.value.useCssAnimation})},null,10,Le)):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":f.value&&C.value===r&&t.value.useCssAnimation})},null,10,ze)):e.createCommentVNode("",!0)])]))),256)),t.value.style.chart.layout.plots.show?(e.openBlock(),e.createElementBlock("g",Ae,[(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:x.value!==null&&x.value===r?t.value.style.chart.layout.plots.radius*1.6:t.value.style.chart.layout.plots.radius,stroke:i.value.includes(c)?"transparent":t.value.style.chart.backgroundColor,"stroke-width":.5,class:e.normalizeClass({"animated-out":i.value.includes(c)&&t.value.useCssAnimation,"animated-in":f.value&&C.value===c&&t.value.useCssAnimation})},null,10,Ie))),256))]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:s.value},void 0,!0)],14,_e)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Re,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(D)||e.unref(M)})),void 0,!0)])):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:4,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:L},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(fe.Legend,{key:`legend_${I.value}`,legendSet:y.value,config:de.value,onClickMarker:a[1]||(a[1]=({i:l})=>H(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,qe)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:y.value},void 0,!0)],512),e.createVNode(he._sfc_main,{show:g.value.showTooltip&&P.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:b.value,content:$.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...E.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[["function"].includes(typeof t.value.style.chart.tooltip.customFormat)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",De,[e.createVNode(me.default,{dataset:S.value,config:ue.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity},null,8,["dataset","config","backgroundOpacity"])])),e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...E.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","fontSize","position","offsetY","parent","content","isCustom"]),k.value?(e.openBlock(),e.createBlock(be.default,{key:5,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(ye.DataTable,{key:`table_${A.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,Be))}},Ue=we._export_sfc(Me,[["__scopeId","data-v-ed1fdeb2"]]);exports.default=Ue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-DQRLTu78.cjs"),Z=require("./useResponsive-B3TrDDIG.cjs"),ge=require("./Title-Bpx2Ub4Z.cjs"),ee=require("./usePrinter-DuYSC89K.cjs"),he=require("./Tooltip-D-JR_3NK.cjs"),me=require("./vue-ui-sparkbar-yocSweJn.cjs"),fe=require("./Legend-ComtyeZF.cjs"),ye=require("./DataTable-CiVu-yQZ.cjs"),ke=require("./vue-ui-skeleton-yOWIPVsZ.cjs"),be=require("./vue-ui-accordion-ZppPKpGK.cjs"),te=require("./useNestedProp-np0rM3ep.cjs"),Ce=require("./PackageVersion-BqVp7cHC.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Be=["id"],_e=["xmlns","viewBox"],xe=["id"],Pe=["stop-color"],$e=["stop-color"],Ne={key:0},Te=["x1","y1","x2","y2","stroke","stroke-width"],Se={key:0},Ee=["d","stroke","stroke-width"],Ve=["d","stroke","stroke-width"],Fe={key:1},Oe=["x","y","text-anchor","font-size","fill","onMouseenter"],Le=["points","stroke","stroke-width"],ze=["points","stroke","stroke-width","fill"],Ae={key:2},Ie=["cx","cy","fill","r","stroke"],Re={key:3,class:"vue-data-ui-watermark"},qe=["onClick"],De={key:0,style:{"max-width":"200px",margin:"0 auto"}},Me={__name:"vue-ui-radar",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(oe,{expose:ae,emit:le}){const d=oe,{vue_ui_radar:re}=n.useConfig(),k=e.computed(()=>!!d.dataset&&Object.keys(d.dataset).length),m=e.ref(n.createUid()),ne=e.ref(null),P=e.ref(!1),$=e.ref(""),F=e.ref(0),b=e.ref(null),O=e.ref(null),L=e.ref(null),z=e.ref(0),A=e.ref(0),I=e.ref(0),t=e.computed({get:()=>R(),set:o=>o});function R(){const o=te.useNestedProp({userConfig:d.config,defaultConfig:re});return o.theme?{...te.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=R(),q(),z.value+=1,A.value+=1,I.value+=1},{deep:!0});const B=e.ref(null);function q(){if(n.objectIsEmpty(d.dataset)&&n.error({componentName:"VueUiRadar",type:"dataset"}),t.value.responsive){const o=Z.throttle(()=>{const{width:a,height:l}=Z.useResponsive({chart:b.value,title:t.value.style.chart.title.text?O.value:null,legend:t.value.style.chart.legend.show?L.value:null});s.value.width=a,s.value.height=l});B.value=new ResizeObserver(o),B.value.observe(b.value.parentNode)}}e.onMounted(()=>{q()}),e.onBeforeUnmount(()=>{B.value&&B.value.disconnect()});const{isPrinting:D,isImaging:M,generatePdf:U,generateImage:G}=ee.usePrinter({elementId:`vue-ui-radar_${m.value}`,fileName:t.value.style.chart.title.text||"vue-ui-radar"}),W=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}),ue=e.computed(()=>({style:{backgroundColor:t.value.style.chart.tooltip.backgroundColor,animation:{show:t.value.style.chart.tooltip.animation.show,animationFrames:t.value.style.chart.tooltip.animation.animationFrames},labels:{fontSize:t.value.style.chart.tooltip.fontSize,name:{color:t.value.style.chart.tooltip.color}},gutter:{backgroundColor:"#CCCCCC",opacity:30}}})),s=e.ref({height:312,width:512}),i=e.ref([]),C=e.ref(null),f=e.ref(!1);function H(o){f.value=!0,i.value.includes(o)?(C.value=o,i.value=i.value.filter(a=>a!==o),setTimeout(()=>{f.value=!1,C.value=null},500)):(i.value.push(o),setTimeout(()=>{f.value=!1},500)),le("selectLegend",y.value.filter((a,l)=>!i.value.includes(l)).map(a=>({name:a.name,color:a.color,proportion:a.totalProportion})))}function se(){return y.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)||W.value[a]||n.palette[a]||n.palette[a%n.palette.length],prefix:o.prefix??"",suffix:o.suffix??""})))),p=e.computed(()=>k.value?d.dataset.series.map((o,a)=>({...o,color:n.convertColorToHex(o.color)||W.value[a]||n.palette[a]||n.palette[a%n.palette.length],serieId:`radar_serie_${m.value}_${a}`,formatter:o.formatter||null})):[]),X=e.computed(()=>Math.max(...p.value.flatMap(o=>o.values))),j=e.computed(()=>p.value.length),N=e.computed(()=>Math.min(s.value.width,s.value.height)/3),Y=e.computed(()=>n.createPolygonPath({plot:{x:s.value.width/2,y:s.value.height/2},radius:N.value,sides:j.value,rotation:0})),ie=e.computed(()=>{const o=[];for(let a=0;a<N.value;a+=N.value/t.value.style.chart.layout.grid.graduations)o.push(a);return o}),h=e.computed(()=>Y.value.coordinates.map((o,a)=>{const l=p.value[a].values.map(r=>ce({centerX:s.value.width/2,centerY:s.value.height/2,apexX:o.x,apexY:o.y,proportion:r/(p.value[a].target||X.value)}));return{...o,...p.value[a],plots:l}}));function T({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 ce({centerX:o,centerY:a,apexX:l,apexY:r,proportion:u}){return{x:o+(l-o)*u,y:a+(r-a)*u}}const y=e.computed(()=>{const o=p.value.map((a,l)=>a.values.map(r=>r/(a.target||X.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:()=>H(l),isSegregated:i.value.includes(l)}))}),de=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:""},...y.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}}),x=e.ref(null),S=e.ref([]),E=e.ref(null);function ve(o,a){S.value=[],x.value=a,P.value=!0;let l="";E.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})))$.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)||S.value.push({name:v.value[u].name,value:o.values[u]/o.target*100,color:v.value[u].color,suffix:"%)",prefix:`${n.dataLabel({p:v.value[u].prefix??"",v:o.values[u],s:v.value[u].suffix??"",r:t.value.style.chart.tooltip.roundingValue})} (`,rounding:t.value.style.chart.tooltip.roundingPercentage,formatter:o.formatter});$.value=l}}function J(){e.nextTick(()=>{const o=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],a=[[""],[t.value.translations.target],...y.value.flatMap(c=>[[c.name],["%"]])],l=d.dataset.series.map((c,Ge)=>[c.name,c.target,...c.values.flatMap(V=>[V,isNaN(V/c.target)?"":V/c.target*100])]),r=o.concat([a]).concat(l),u=n.createCsvContent(r);n.downloadCsv({csvContent:u,title:t.value.style.chart.title.text||"vue-ui-radar"})})}const w=e.ref(!1);function pe(o){w.value=o,F.value+=1}function K(){g.value.showTable=!g.value.showTable}function Q(){g.value.showTooltip=!g.value.showTooltip}return ae({getData:se,generatePdf:U,generateCsv:J,generateImage:G,toggleTable:K,toggleTooltip:Q}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-radar ${w.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"radarChart",ref:b,id:`vue-ui-radar_${m.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:O,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(ge._sfc_main,{key:`title_${z.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&&k.value?(e.openBlock(),e.createBlock(ee.UserOptions,{ref_key:"details",ref:ne,key:`user_options_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(M),isPrinting:e.unref(D),uid:m.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:w.value,isTooltip:g.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,position:t.value.userOptions.position,onToggleFullscreen:pe,onGeneratePdf:e.unref(U),onGenerateCsv:J,onGenerateImage:e.unref(G),onToggleTable:K,onToggleTooltip:Q},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":w.value,"vue-data-ui-fulscreen--off":!w.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background: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(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,Pe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.dataPolygon.opacity)},null,8,$e)],8,xe))),256))]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Ne,[(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,Te))),256)),t.value.style.chart.layout.grid.graduations>0?(e.openBlock(),e.createElementBlock("g",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie.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:j.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,Ee))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:Y.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,Ve),t.value.style.chart.layout.labels.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:T(l).x,y:T(l).y,"text-anchor":T(l).anchor,"font-size":t.value.style.chart.layout.labels.dataLabels.fontSize,fill:t.value.style.chart.layout.labels.dataLabels.color,onMouseenter:u=>ve(l,r),onMouseleave:a[0]||(a[0]=u=>{P.value=!1,x.value=null})},e.toDisplayString(l.name),41,Oe))),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":f.value&&C.value===r&&t.value.useCssAnimation})},null,10,Le)):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":f.value&&C.value===r&&t.value.useCssAnimation})},null,10,ze)):e.createCommentVNode("",!0)])]))),256)),t.value.style.chart.layout.plots.show?(e.openBlock(),e.createElementBlock("g",Ae,[(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:x.value!==null&&x.value===r?t.value.style.chart.layout.plots.radius*1.6:t.value.style.chart.layout.plots.radius,stroke:i.value.includes(c)?"transparent":t.value.style.chart.backgroundColor,"stroke-width":.5,class:e.normalizeClass({"animated-out":i.value.includes(c)&&t.value.useCssAnimation,"animated-in":f.value&&C.value===c&&t.value.useCssAnimation})},null,10,Ie))),256))]))),256))])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:s.value},void 0,!0)],14,_e)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Re,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(D)||e.unref(M)})),void 0,!0)])):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:4,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:L},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(fe.Legend,{key:`legend_${I.value}`,legendSet:y.value,config:de.value,onClickMarker:a[1]||(a[1]=({i:l})=>H(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,qe)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:y.value},void 0,!0)],512),e.createVNode(he._sfc_main,{show:g.value.showTooltip&&P.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:b.value,content:$.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...E.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[["function"].includes(typeof t.value.style.chart.tooltip.customFormat)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",De,[e.createVNode(me.default,{dataset:S.value,config:ue.value,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity},null,8,["dataset","config","backgroundOpacity"])])),e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...E.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","fontSize","position","offsetY","parent","content","isCustom"]),k.value?(e.openBlock(),e.createBlock(be.default,{key:5,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(ye.DataTable,{key:`table_${A.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,Be))}},Ue=we._export_sfc(Me,[["__scopeId","data-v-ed1fdeb2"]]);exports.default=Ue;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { computed as p, ref as i, watch as Ve, onMounted as Ue, onBeforeUnmount as Ee, openBlock as s, createElementBlock as n, normalizeClass as z, normalizeStyle as J, createBlock as O, createCommentVNode as f, unref as h, createSlots as Be, withCtx as y, renderSlot as m, normalizeProps as B, guardReactiveProps as D, createVNode as K, createElementVNode as w, Fragment as $, renderList as x, toDisplayString as R, createTextVNode as be, nextTick as De } from "vue";
|
|
2
|
-
import { u as Ge, c as We, t as Xe, a as Ye, p as P, o as je, e as S, b as qe, g as ke, d as Ce, O as _e, v as He, i as we, f as M, X as Je, s as Q, w as Ke, P as $e, x as Qe, y as Ze, q as et, r as tt } from "./index-
|
|
2
|
+
import { u as Ge, c as We, t as Xe, a as Ye, p as P, o as je, e as S, b as qe, g as ke, d as Ce, O as _e, v as He, i as we, f as M, X as Je, s as Q, w as Ke, P as $e, x as Qe, y as Ze, q as et, r as tt } from "./index-COTjlcVF.js";
|
|
3
3
|
import { t as at, u as ot } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as lt } from "./Title-
|
|
5
|
-
import { u as rt, U as st } from "./usePrinter-
|
|
6
|
-
import { _ as nt } from "./Tooltip-
|
|
7
|
-
import ut from "./vue-ui-sparkbar-
|
|
8
|
-
import { L as it } from "./Legend-
|
|
9
|
-
import { D as ct } from "./DataTable-
|
|
10
|
-
import dt from "./vue-ui-skeleton-
|
|
11
|
-
import vt from "./vue-ui-accordion-
|
|
12
|
-
import { u as xe } from "./useNestedProp-
|
|
13
|
-
import { _ as pt } from "./PackageVersion-
|
|
4
|
+
import { _ as lt } from "./Title-CDfZWgra.js";
|
|
5
|
+
import { u as rt, U as st } from "./usePrinter-5XpNgqjh.js";
|
|
6
|
+
import { _ as nt } from "./Tooltip-0-aPeOmA.js";
|
|
7
|
+
import ut from "./vue-ui-sparkbar-Dk8VLc5p.js";
|
|
8
|
+
import { L as it } from "./Legend-iUlykl4S.js";
|
|
9
|
+
import { D as ct } from "./DataTable-Dv3mZD4M.js";
|
|
10
|
+
import dt from "./vue-ui-skeleton-CYgbDsKG.js";
|
|
11
|
+
import vt from "./vue-ui-accordion-CzKJYxd2.js";
|
|
12
|
+
import { u as xe } from "./useNestedProp-CcjyiBlC.js";
|
|
13
|
+
import { _ as pt } from "./PackageVersion-DWAqn7t0.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 = { key: 0 }, Ct = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], _t = { key: 0 }, wt = ["d", "stroke", "stroke-width"], $t = ["d", "stroke", "stroke-width"], xt = { key: 1 }, Pt = ["x", "y", "text-anchor", "font-size", "fill", "onMouseenter"], Tt = ["points", "stroke", "stroke-width"], Nt = ["points", "stroke", "stroke-width", "fill"], Ot = { key: 2 }, St = ["cx", "cy", "fill", "r", "stroke"], Ft = {
|
|
16
16
|
key: 3,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-NvxTr0fZ.cjs"),C=require("./useNestedProp-DhLxBAwX.cjs"),V=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},F=["src","height","width"],A=["xmlns","height","width"],D=["id"],R=["stop-color"],X=["stop-color"],j=["points","fill","stroke","stroke-width"],I=["src","alt","height","width","id"],O=["xmlns","viewBox","height","id"],Y=["id"],G=["stop-color"],L=["stop-color"],q=["points","fill","stroke"],T=["xmlns","height"],U=["onClick","onMouseenter","onKeyup"],H=["onMouseenter"],K={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup($,{expose:k,emit:S}){const s=$,{vue_ui_rating:_}=n.useConfig(),d=e.ref(n.createUid()),p=e.ref(!1),r=e.ref(void 0),g=e.ref([]),t=e.computed(()=>C.useNestedProp({userConfig:s.config,defaultConfig:_})),b=e.computed(()=>typeof s.dataset.rating=="object"&&!Array.isArray(s.dataset.rating)?z(s.dataset.rating):s.dataset.rating),N=e.computed(()=>typeof s.dataset.rating=="object"&&!Array.isArray(s.dataset.rating)),i=e.ref(b.value),f=e.ref(t.value.type==="image"),c=e.ref(t.value.readonly);function z(o){let a=0,l=0;for(const u in o){const E=parseInt(u),h=o[u];a+=E*h,l+=h}if(l===0)return 0;const v=a/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{n.objectIsEmpty(s.dataset)&&n.error({componentName:"VueUiRating",type:"dataset"});for(let o=t.value.from;o<=t.value.to;o+=1)g.value.push(o)});function y(o,a=!1){return o>r.value||c.value?a?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:a?1:t.value.style.star.useGradient?`url(#star_gradient_under_${d.value})`:t.value.style.star.activeColor}function m(o,a=!1){const l=i.value-o,v=a?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function x(o){c.value||(i.value=o,S("rate",o))}function w(){return i.value}function B(o=!0){c.value=o}return k({getData:w,toggleReadonly:B}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily};width:100%`),class:"vue-ui-rating",onMouseover:a[2]||(a[2]=l=>p.value=!0),onMouseleave:a[3]||(a[3]=l=>{p.value=!1,r.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",{style:e.normalizeStyle(`color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"};text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.offsetY}px;font-size:${t.value.style.title.fontSize}px`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`color:${t.value.style.title.subtitle.color};font-size:${t.value.style.title.subtitle.fontSize}px;text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.subtitle.offsetY}px;font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.rating.show&&t.value.style.rating.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vue-ui-rating-wrapper",style:e.normalizeStyle(`height:${t.value.style.itemSize}px;width:100%;display:flex;align-items:center;justify-content:center`)},[t.value.style.rating.show&&t.value.style.rating.position==="left"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-right:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,v)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-rating-unit-container",style:e.normalizeStyle(`position:relative;height:${t.value.style.itemSize}px;width:${t.value.style.itemSize}px`)},[f.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.value.style.image.src,height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;opacity:${isNaN(r.value)?t.value.style.image.inactiveOpacity:y(l,!0)}`)},null,12,F)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_under_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,R),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,X)],8,D)]),e.createElementVNode("polygon",{points:e.unref(n.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(r.value)?t.value.style.star.inactiveColor:y(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:r.value?y(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,j)],8,A)),f.value?(e.openBlock(),e.createElementBlock("img",{key:2,src:t.value.style.image.src,alt:`${t.value.style.image.alt} ${l}`,height:t.value.style.itemSize,width:t.value.style.itemSize,id:`active_${d.value}_${l}`,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;clip:rect(0px,${m(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,I)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${m(v)} 100`,height:t.value.style.itemSize,class:"vue-ui-rating-unit",id:`active_${d.value}_${l}`,style:{position:"absolute",top:"0",left:"0"}},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_over_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,L)],8,Y)]),e.createElementVNode("polygon",{points:e.unref(n.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:t.value.style.star.useGradient?`url(#star_gradient_over_${d.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,q)],8,O)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(n.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;${c.value?"":"cursor:pointer"}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("rect",{key:0,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onClick:u=>x(l),onMouseenter:u=>r.value=l,onMouseleave:a[0]||(a[0]=u=>r.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>x(l),["enter"])},null,40,U)),c.value?(e.openBlock(),e.createElementBlock("rect",{key:1,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onMouseenter:u=>r.value=l,onMouseleave:a[1]||(a[1]=u=>r.value=void 0)},null,40,H)):e.createCommentVNode("",!0)],12,T)),t.value.style.tooltip.show&&N.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${r.value===l?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(l),5),e.createTextVNode(" : "),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(s.dataset.rating[l]),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0)],4))),256)),t.value.style.rating.show&&t.value.style.rating.position==="right"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0)],4),t.value.style.rating.show&&t.value.style.rating.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(`width:100%;text-align:center;margin-top:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0)],36))}},P=V._export_sfc(K,[["__scopeId","data-v-86ced882"]]);exports.default=P;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-DQRLTu78.cjs"),C=require("./useNestedProp-np0rM3ep.cjs"),V=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},F=["src","height","width"],A=["xmlns","height","width"],D=["id"],R=["stop-color"],X=["stop-color"],j=["points","fill","stroke","stroke-width"],I=["src","alt","height","width","id"],O=["xmlns","viewBox","height","id"],Y=["id"],G=["stop-color"],L=["stop-color"],q=["points","fill","stroke"],T=["xmlns","height"],U=["onClick","onMouseenter","onKeyup"],H=["onMouseenter"],K={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup($,{expose:k,emit:S}){const s=$,{vue_ui_rating:_}=n.useConfig(),d=e.ref(n.createUid()),p=e.ref(!1),r=e.ref(void 0),g=e.ref([]),t=e.computed(()=>C.useNestedProp({userConfig:s.config,defaultConfig:_})),b=e.computed(()=>typeof s.dataset.rating=="object"&&!Array.isArray(s.dataset.rating)?z(s.dataset.rating):s.dataset.rating),N=e.computed(()=>typeof s.dataset.rating=="object"&&!Array.isArray(s.dataset.rating)),i=e.ref(b.value),f=e.ref(t.value.type==="image"),c=e.ref(t.value.readonly);function z(o){let a=0,l=0;for(const u in o){const E=parseInt(u),h=o[u];a+=E*h,l+=h}if(l===0)return 0;const v=a/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{n.objectIsEmpty(s.dataset)&&n.error({componentName:"VueUiRating",type:"dataset"});for(let o=t.value.from;o<=t.value.to;o+=1)g.value.push(o)});function y(o,a=!1){return o>r.value||c.value?a?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:a?1:t.value.style.star.useGradient?`url(#star_gradient_under_${d.value})`:t.value.style.star.activeColor}function m(o,a=!1){const l=i.value-o,v=a?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function x(o){c.value||(i.value=o,S("rate",o))}function w(){return i.value}function B(o=!0){c.value=o}return k({getData:w,toggleReadonly:B}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily};width:100%`),class:"vue-ui-rating",onMouseover:a[2]||(a[2]=l=>p.value=!0),onMouseleave:a[3]||(a[3]=l=>{p.value=!1,r.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",{style:e.normalizeStyle(`color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"};text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.offsetY}px;font-size:${t.value.style.title.fontSize}px`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`color:${t.value.style.title.subtitle.color};font-size:${t.value.style.title.subtitle.fontSize}px;text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.subtitle.offsetY}px;font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.rating.show&&t.value.style.rating.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vue-ui-rating-wrapper",style:e.normalizeStyle(`height:${t.value.style.itemSize}px;width:100%;display:flex;align-items:center;justify-content:center`)},[t.value.style.rating.show&&t.value.style.rating.position==="left"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-right:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(l,v)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-rating-unit-container",style:e.normalizeStyle(`position:relative;height:${t.value.style.itemSize}px;width:${t.value.style.itemSize}px`)},[f.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.value.style.image.src,height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;opacity:${isNaN(r.value)?t.value.style.image.inactiveOpacity:y(l,!0)}`)},null,12,F)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_under_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,R),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,X)],8,D)]),e.createElementVNode("polygon",{points:e.unref(n.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(r.value)?t.value.style.star.inactiveColor:y(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:r.value?y(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,j)],8,A)),f.value?(e.openBlock(),e.createElementBlock("img",{key:2,src:t.value.style.image.src,alt:`${t.value.style.image.alt} ${l}`,height:t.value.style.itemSize,width:t.value.style.itemSize,id:`active_${d.value}_${l}`,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;clip:rect(0px,${m(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,I)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${m(v)} 100`,height:t.value.style.itemSize,class:"vue-ui-rating-unit",id:`active_${d.value}_${l}`,style:{position:"absolute",top:"0",left:"0"}},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_over_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,G),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,L)],8,Y)]),e.createElementVNode("polygon",{points:e.unref(n.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:t.value.style.star.useGradient?`url(#star_gradient_over_${d.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,q)],8,O)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(n.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;${c.value?"":"cursor:pointer"}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("rect",{key:0,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onClick:u=>x(l),onMouseenter:u=>r.value=l,onMouseleave:a[0]||(a[0]=u=>r.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>x(l),["enter"])},null,40,U)),c.value?(e.openBlock(),e.createElementBlock("rect",{key:1,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onMouseenter:u=>r.value=l,onMouseleave:a[1]||(a[1]=u=>r.value=void 0)},null,40,H)):e.createCommentVNode("",!0)],12,T)),t.value.style.tooltip.show&&N.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${r.value===l?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(l),5),e.createTextVNode(" : "),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(s.dataset.rating[l]),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0)],4))),256)),t.value.style.rating.show&&t.value.style.rating.position==="right"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0)],4),t.value.style.rating.show&&t.value.style.rating.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(`width:100%;text-align:center;margin-top:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(i.value)?"":i.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0)],36))}},P=V._export_sfc(K,[["__scopeId","data-v-86ced882"]]);exports.default=P;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as f, computed as $, onMounted as O, openBlock as l, createElementBlock as i, normalizeStyle as a, createElementVNode as n, toDisplayString as p, createCommentVNode as d, Fragment as U, renderList as E, unref as m, withKeys as L, createTextVNode as D } from "vue";
|
|
2
|
-
import { u as K, c as T, o as H, e as P, X as _, w as N, U as F } from "./index-
|
|
3
|
-
import { u as W } from "./useNestedProp-
|
|
2
|
+
import { u as K, c as T, o as H, e as P, X as _, w as N, U as F } from "./index-COTjlcVF.js";
|
|
3
|
+
import { u as W } from "./useNestedProp-CcjyiBlC.js";
|
|
4
4
|
import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const J = {
|
|
6
6
|
key: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-NvxTr0fZ.cjs"),q=require("./useResponsive-B3TrDDIG.cjs"),ae=require("./Title-Cjusozo5.cjs"),M=require("./usePrinter-0s8wVGIy.cjs"),se=require("./vue-ui-skeleton-DYHqPo98.cjs"),j=require("./useNestedProp-DhLxBAwX.cjs"),oe=require("./PackageVersion-rOhPenOY.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],de=["xmlns","viewBox"],ve=["cx","cy","r","stroke","stroke-width"],fe={key:0},ge=["stroke","d","stroke-width"],me={key:1},ye=["stroke","x1","x2","y1","y2"],he=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],ke=["cx","cy","fill","onClick","r"],pe={key:3,class:"vue-data-ui-watermark"},_e={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(G,{expose:U}){const u=G;e.useCssVars(t=>({db99e4e4:H.value,"1847af26":Y.value,"36a818e2":J.value}));const{vue_ui_relation_circle:D}=o.useConfig(),p=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length),g=e.ref(o.createUid()),$=e.ref(0),y=e.ref(null),w=e.ref(null),B=e.ref(0),r=e.computed({get:()=>b(),set:t=>t});function b(){const t=j.useNestedProp({userConfig:u.config,defaultConfig:D});return t.theme?{...j.useNestedProp({userConfig:o.themes.vue_ui_relation_circle[t.theme]||u.config,defaultConfig:t}),customPalette:o.themePalettes[t.theme]||o.palette}:t}e.watch(()=>u.config,t=>{r.value=b(),S(),B.value+=1},{deep:!0});const{isPrinting:P,isImaging:O,generatePdf:E,generateImage:A}=M.usePrinter({elementId:`relation_circle_${g.value}`,fileName:r.value.style.title.text||"vue-ui-relation-circle"}),I=e.computed(()=>o.convertCustomPalette(r.value.customPalette)),d=e.ref([]),f=e.ref([]),i=e.ref({}),c=e.ref([]),W=e.ref(0),_=e.computed(()=>u.dataset.slice(0,r.value.style.limit)),C=e.ref(r.value.style.size),a=e.ref({height:r.value.style.size,width:r.value.style.size}),v=e.computed({get(){return C.value*r.value.style.circle.radiusProportion},set(t){return t}}),X=e.computed(()=>r.value.style.links.curved),Y=e.computed(()=>`${r.value.style.animation.speedMs}ms`),H=e.computed(()=>v.value*2),J=e.computed(()=>v.value*4),h=e.ref(null);e.onMounted(()=>{S(),document.getElementById(`relation_circle_${g.value}`).addEventListener("click",z)});function S(){if(o.objectIsEmpty(u.dataset)?o.error({componentName:"VueUiRelationCircle",type:"dataset"}):u.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=q.throttle(()=>{const{width:n,height:l}=q.useResponsive({chart:y.value,title:r.value.style.title.text?w.value:null});C.value=Math.min(n,l),a.value.width=n,a.value.height=l,v.value=C.value*r.value.style.circle.radiusProportion,d.value=[],f.value=[],F(),N()});h.value=new ResizeObserver(t),h.value.observe(y.value.parentNode)}else d.value=[],f.value=[],F(),N()}e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${g.value}`).removeEventListener("click",z),h.value&&h.value.disconnect()});function z(t){const n=t.target;n&&Array.from(n.classList).includes("vue-ui-user-options")||n&&Array.from(n.classList).includes("vue-ui-user-options-summary")||n&&Array.from(n.classList).includes("vue-data-ui-button")||n&&Array.from(n.classList).includes("vue-ui-relation-circle-legend")||(i.value={},c.value=[])}function F(){const t=6.28319/_.value.length,n=360/_.value.length;let l=0,s=0;_.value.forEach((m,x)=>{const ne=v.value*Math.cos(l)+a.value.width/2,ie=v.value*Math.sin(l)+a.value.height/2+r.value.style.circle.offsetY;d.value.push({x:ne,y:ie,...m,color:m.color?m.color:I.value[x]?I.value[x]:o.palette[x],regAngle:s}),l+=t,s+=n})}function N(){d.value.forEach(t=>{d.value.filter(l=>l.relations.includes(t.id)).forEach((l,s)=>{f.value.push({weight:t.weights&&t.weights[s]?t.weights[s]:1,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,...t})})})}const K=e.computed(()=>Math.max(...f.value.map(t=>t.weight)));function Q(t){return Object.hasOwn(i.value,"x")?c.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function L(t){return Object.hasOwn(i.value,"x")?t.colorTarget:t.colorSource}function R(t){return Object.hasOwn(i.value,"x")?c.value.includes(t.id)&&t.relationId===`${t.id}_${i.value.id}`||t.relationId===`${i.value.id}_${t.id}`?`opacity:1;stroke-width:${V(t)}`:"opacity: 0":"opacity: 1"}function Z(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function ee(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function te(t){return Object.hasOwn(i.value,"x")?i.value.id===t.id||c.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function le(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function T(t){W.value=360-t.regAngle,i.value.id&&t.id===i.value.id?(i.value={},c.value=[]):(i.value=t,c.value=[...t.relations])}function V(t){return t.weight/K.value*r.value.style.links.maxWidth}const k=e.ref(!1);function re(t){k.value=t,$.value+=1}return U({generatePdf:E,generateImage:A}),(t,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:y,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_${g.value}`},[r.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:w,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(ae._sfc_main,{key:`title_${B.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&&p.value?(e.openBlock(),e.createBlock(M.UserOptions,{ref:"details",key:`user_options_${$.value}`,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,isPrinting:e.unref(P),isImaging:e.unref(O),uid:g.value,hasPdf:r.value.userOptions.buttons.pdf,hasImg:r.value.userOptions.buttons.img,hasFullscreen:r.value.userOptions.buttons.img,hasXls:!1,isFullscreen:k.value,titles:{...r.value.userOptions.buttonTitles},chartElement:y.value,position:r.value.userOptions.position,onToggleFullscreen:re,onGeneratePdf:e.unref(E),onGenerateImage:e.unref(A)},e.createSlots({_:2},[t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:s})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:s})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value},"relation-circle"]),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,width:"100%",style:"user-select:none; background:transparent"},[e.createVNode(oe._sfc_main),e.createElementVNode("circle",{cx:(a.value.width<=0?1e-4:a.value.width)/2,cy:(a.value.height<=0?1e-4:a.value.height)/2+r.value.style.circle.offsetY,r:v.value<=0?1e-4:v.value,stroke:r.value.style.circle.stroke,"stroke-width":r.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,ve),X.value?(e.openBlock(),e.createElementBlock("g",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,s)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${s}`,style:e.normalizeStyle(R(l)),stroke:L(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&c.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${a.value.width/2},${a.value.height/2+r.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":V(l),"stroke-linecap":"round"},null,14,ge))),128))])):(e.openBlock(),e.createElementBlock("g",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,s)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${s}`,stroke:L(l),style:e.normalizeStyle(R(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&c.value.includes(l.id)}),"stroke-linecap":"round"},null,14,ye))),128))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${s}`,"text-anchor":Z(l),transform:le(l),x:ee(l),y:l.y+5,onClick:m=>T(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":i.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${r.value.style.fontFamily};${te(l)}`),"font-size":r.value.style.labels.fontSize,fill:r.value.style.labels.color},e.toDisplayString(l.label),13,he))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${s}`,style:e.normalizeStyle(Q(l)),class:"vue-ui-relation-circle-plot",fill:r.value.style.plot.color,onClick:m=>T(l),r:r.value.style.plot.radius},null,12,ke))),128)),e.renderSlot(t.$slots,"svg",{svg:a.value},void 0,!0)],10,de)):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",pe,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(P)||e.unref(O)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(se.default,{key:4,config:{type:"relationCircle",style:{backgroundColor:r.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],12,ce))}},Ce=ue._export_sfc(_e,[["__scopeId","data-v-0d6438fc"]]);exports.default=Ce;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-DQRLTu78.cjs"),q=require("./useResponsive-B3TrDDIG.cjs"),ae=require("./Title-Bpx2Ub4Z.cjs"),M=require("./usePrinter-DuYSC89K.cjs"),se=require("./vue-ui-skeleton-yOWIPVsZ.cjs"),j=require("./useNestedProp-np0rM3ep.cjs"),oe=require("./PackageVersion-BqVp7cHC.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],de=["xmlns","viewBox"],ve=["cx","cy","r","stroke","stroke-width"],fe={key:0},ge=["stroke","d","stroke-width"],me={key:1},ye=["stroke","x1","x2","y1","y2"],he=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],ke=["cx","cy","fill","onClick","r"],pe={key:3,class:"vue-data-ui-watermark"},_e={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(G,{expose:U}){const u=G;e.useCssVars(t=>({db99e4e4:H.value,"1847af26":Y.value,"36a818e2":J.value}));const{vue_ui_relation_circle:D}=o.useConfig(),p=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length),g=e.ref(o.createUid()),$=e.ref(0),y=e.ref(null),w=e.ref(null),B=e.ref(0),r=e.computed({get:()=>b(),set:t=>t});function b(){const t=j.useNestedProp({userConfig:u.config,defaultConfig:D});return t.theme?{...j.useNestedProp({userConfig:o.themes.vue_ui_relation_circle[t.theme]||u.config,defaultConfig:t}),customPalette:o.themePalettes[t.theme]||o.palette}:t}e.watch(()=>u.config,t=>{r.value=b(),S(),B.value+=1},{deep:!0});const{isPrinting:P,isImaging:O,generatePdf:E,generateImage:A}=M.usePrinter({elementId:`relation_circle_${g.value}`,fileName:r.value.style.title.text||"vue-ui-relation-circle"}),I=e.computed(()=>o.convertCustomPalette(r.value.customPalette)),d=e.ref([]),f=e.ref([]),i=e.ref({}),c=e.ref([]),W=e.ref(0),_=e.computed(()=>u.dataset.slice(0,r.value.style.limit)),C=e.ref(r.value.style.size),a=e.ref({height:r.value.style.size,width:r.value.style.size}),v=e.computed({get(){return C.value*r.value.style.circle.radiusProportion},set(t){return t}}),X=e.computed(()=>r.value.style.links.curved),Y=e.computed(()=>`${r.value.style.animation.speedMs}ms`),H=e.computed(()=>v.value*2),J=e.computed(()=>v.value*4),h=e.ref(null);e.onMounted(()=>{S(),document.getElementById(`relation_circle_${g.value}`).addEventListener("click",z)});function S(){if(o.objectIsEmpty(u.dataset)?o.error({componentName:"VueUiRelationCircle",type:"dataset"}):u.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=q.throttle(()=>{const{width:n,height:l}=q.useResponsive({chart:y.value,title:r.value.style.title.text?w.value:null});C.value=Math.min(n,l),a.value.width=n,a.value.height=l,v.value=C.value*r.value.style.circle.radiusProportion,d.value=[],f.value=[],F(),N()});h.value=new ResizeObserver(t),h.value.observe(y.value.parentNode)}else d.value=[],f.value=[],F(),N()}e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${g.value}`).removeEventListener("click",z),h.value&&h.value.disconnect()});function z(t){const n=t.target;n&&Array.from(n.classList).includes("vue-ui-user-options")||n&&Array.from(n.classList).includes("vue-ui-user-options-summary")||n&&Array.from(n.classList).includes("vue-data-ui-button")||n&&Array.from(n.classList).includes("vue-ui-relation-circle-legend")||(i.value={},c.value=[])}function F(){const t=6.28319/_.value.length,n=360/_.value.length;let l=0,s=0;_.value.forEach((m,x)=>{const ne=v.value*Math.cos(l)+a.value.width/2,ie=v.value*Math.sin(l)+a.value.height/2+r.value.style.circle.offsetY;d.value.push({x:ne,y:ie,...m,color:m.color?m.color:I.value[x]?I.value[x]:o.palette[x],regAngle:s}),l+=t,s+=n})}function N(){d.value.forEach(t=>{d.value.filter(l=>l.relations.includes(t.id)).forEach((l,s)=>{f.value.push({weight:t.weights&&t.weights[s]?t.weights[s]:1,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,...t})})})}const K=e.computed(()=>Math.max(...f.value.map(t=>t.weight)));function Q(t){return Object.hasOwn(i.value,"x")?c.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function L(t){return Object.hasOwn(i.value,"x")?t.colorTarget:t.colorSource}function R(t){return Object.hasOwn(i.value,"x")?c.value.includes(t.id)&&t.relationId===`${t.id}_${i.value.id}`||t.relationId===`${i.value.id}_${t.id}`?`opacity:1;stroke-width:${V(t)}`:"opacity: 0":"opacity: 1"}function Z(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function ee(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function te(t){return Object.hasOwn(i.value,"x")?i.value.id===t.id||c.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function le(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function T(t){W.value=360-t.regAngle,i.value.id&&t.id===i.value.id?(i.value={},c.value=[]):(i.value=t,c.value=[...t.relations])}function V(t){return t.weight/K.value*r.value.style.links.maxWidth}const k=e.ref(!1);function re(t){k.value=t,$.value+=1}return U({generatePdf:E,generateImage:A}),(t,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:y,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_${g.value}`},[r.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:w,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(ae._sfc_main,{key:`title_${B.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&&p.value?(e.openBlock(),e.createBlock(M.UserOptions,{ref:"details",key:`user_options_${$.value}`,backgroundColor:r.value.style.backgroundColor,color:r.value.style.color,isPrinting:e.unref(P),isImaging:e.unref(O),uid:g.value,hasPdf:r.value.userOptions.buttons.pdf,hasImg:r.value.userOptions.buttons.img,hasFullscreen:r.value.userOptions.buttons.img,hasXls:!1,isFullscreen:k.value,titles:{...r.value.userOptions.buttonTitles},chartElement:y.value,position:r.value.userOptions.position,onToggleFullscreen:re,onGeneratePdf:e.unref(E),onGenerateImage:e.unref(A)},e.createSlots({_:2},[t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:s})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:s})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value},"relation-circle"]),viewBox:`0 0 ${a.value.width<=0?10:a.value.width} ${a.value.height<=0?10:a.value.height}`,width:"100%",style:"user-select:none; background:transparent"},[e.createVNode(oe._sfc_main),e.createElementVNode("circle",{cx:(a.value.width<=0?1e-4:a.value.width)/2,cy:(a.value.height<=0?1e-4:a.value.height)/2+r.value.style.circle.offsetY,r:v.value<=0?1e-4:v.value,stroke:r.value.style.circle.stroke,"stroke-width":r.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,ve),X.value?(e.openBlock(),e.createElementBlock("g",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,s)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${s}`,style:e.normalizeStyle(R(l)),stroke:L(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&c.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${a.value.width/2},${a.value.height/2+r.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":V(l),"stroke-linecap":"round"},null,14,ge))),128))])):(e.openBlock(),e.createElementBlock("g",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,s)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${s}`,stroke:L(l),style:e.normalizeStyle(R(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":i.value.hasOwnProperty("id")&&c.value.includes(l.id)}),"stroke-linecap":"round"},null,14,ye))),128))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${s}`,"text-anchor":Z(l),transform:le(l),x:ee(l),y:l.y+5,onClick:m=>T(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":i.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${r.value.style.fontFamily};${te(l)}`),"font-size":r.value.style.labels.fontSize,fill:r.value.style.labels.color},e.toDisplayString(l.label),13,he))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,s)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${s}`,style:e.normalizeStyle(Q(l)),class:"vue-ui-relation-circle-plot",fill:r.value.style.plot.color,onClick:m=>T(l),r:r.value.style.plot.radius},null,12,ke))),128)),e.renderSlot(t.$slots,"svg",{svg:a.value},void 0,!0)],10,de)):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",pe,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(P)||e.unref(O)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(se.default,{key:4,config:{type:"relationCircle",style:{backgroundColor:r.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],12,ce))}},Ce=ue._export_sfc(_e,[["__scopeId","data-v-0d6438fc"]]);exports.default=Ce;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useCssVars as _e, computed as c, ref as u, watch as ke, onMounted as $e, onBeforeUnmount as xe, openBlock as s, createElementBlock as o, normalizeStyle as _, createBlock as E, createCommentVNode as k, unref as h, createSlots as Ce, withCtx as z, renderSlot as $, normalizeProps as K, guardReactiveProps as Q, normalizeClass as L, createVNode as we, createElementVNode as be, Fragment as b, renderList as O, toDisplayString as Oe } from "vue";
|
|
2
|
-
import { u as Pe, c as Ae, t as Ie, a as Fe, p as Z, b as Ee, o as ze, e as ee, g as Le, X as Ne } from "./index-
|
|
2
|
+
import { u as Pe, c as Ae, t as Ie, a as Fe, p as Z, b as Ee, o as ze, e as ee, g as Le, X as Ne } from "./index-COTjlcVF.js";
|
|
3
3
|
import { t as Se, u as Re } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as Te } from "./Title-
|
|
5
|
-
import { u as Me, U as je } from "./usePrinter-
|
|
6
|
-
import Be from "./vue-ui-skeleton-
|
|
7
|
-
import { u as te } from "./useNestedProp-
|
|
8
|
-
import { _ as Ge } from "./PackageVersion-
|
|
4
|
+
import { _ as Te } from "./Title-CDfZWgra.js";
|
|
5
|
+
import { u as Me, U as je } from "./usePrinter-5XpNgqjh.js";
|
|
6
|
+
import Be from "./vue-ui-skeleton-CYgbDsKG.js";
|
|
7
|
+
import { u as te } from "./useNestedProp-CcjyiBlC.js";
|
|
8
|
+
import { _ as Ge } from "./PackageVersion-DWAqn7t0.js";
|
|
9
9
|
import { _ as Ue } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
const De = ["id"], Ve = ["xmlns", "viewBox"], We = ["cx", "cy", "r", "stroke", "stroke-width"], Xe = { key: 0 }, Ye = ["stroke", "d", "stroke-width"], qe = { key: 1 }, He = ["stroke", "x1", "x2", "y1", "y2"], Je = ["text-anchor", "transform", "x", "y", "onClick", "font-weight", "font-size", "fill"], Ke = ["cx", "cy", "fill", "onClick", "r"], Qe = {
|
|
11
11
|
key: 3,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ref as u, computed as d, watch as Fe, onMounted as Oe, onBeforeUnmount as Me, openBlock as n, createElementBlock as m, normalizeClass as B, normalizeStyle as O, createBlock as x, createCommentVNode as N, unref as i, createSlots as ze, withCtx as h, renderSlot as f, normalizeProps as D, guardReactiveProps as U, createVNode as de, createElementVNode as k, Fragment as pe, renderList as he, createTextVNode as ge, toDisplayString as W, nextTick as Ae } from "vue";
|
|
2
|
-
import { u as Re, c as fe, t as Ve, a as Be, p as T, o as De, e as X, g as Ue, b as We, I as Ee, d as ye, f as _, X as Ge, s as He, w as Xe, v as j, i as me, x as je, y as Ye, q as qe, r as Je } from "./index-
|
|
2
|
+
import { u as Re, c as fe, t as Ve, a as Be, p as T, o as De, e as X, g as Ue, b as We, I as Ee, d as ye, f as _, X as Ge, s as He, w as Xe, v as j, i as me, x as je, y as Ye, q as qe, r as Je } from "./index-COTjlcVF.js";
|
|
3
3
|
import { t as Ke, u as Qe } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as Ze } from "./Title-
|
|
5
|
-
import { u as et, U as tt } from "./usePrinter-
|
|
6
|
-
import { _ as lt } from "./Tooltip-
|
|
7
|
-
import { D as at } from "./DataTable-
|
|
8
|
-
import { L as ot } from "./Legend-
|
|
9
|
-
import st from "./vue-ui-skeleton-
|
|
10
|
-
import ut from "./vue-ui-accordion-
|
|
11
|
-
import { u as be } from "./useNestedProp-
|
|
12
|
-
import { _ as rt } from "./PackageVersion-
|
|
4
|
+
import { _ as Ze } from "./Title-CDfZWgra.js";
|
|
5
|
+
import { u as et, U as tt } from "./usePrinter-5XpNgqjh.js";
|
|
6
|
+
import { _ as lt } from "./Tooltip-0-aPeOmA.js";
|
|
7
|
+
import { D as at } from "./DataTable-Dv3mZD4M.js";
|
|
8
|
+
import { L as ot } from "./Legend-iUlykl4S.js";
|
|
9
|
+
import st from "./vue-ui-skeleton-CYgbDsKG.js";
|
|
10
|
+
import ut from "./vue-ui-accordion-CzKJYxd2.js";
|
|
11
|
+
import { u as be } from "./useNestedProp-CcjyiBlC.js";
|
|
12
|
+
import { _ as rt } from "./PackageVersion-DWAqn7t0.js";
|
|
13
13
|
import { _ as nt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const it = ["id"], vt = ["xmlns", "viewBox"], ct = ["id"], dt = ["stop-color"], pt = ["stop-color"], ht = ["stroke", "cx", "cy", "r", "fill"], gt = ["stroke", "stroke-width", "cx", "cy", "r", "fill"], ft = ["cx", "cy", "r", "onMouseenter"], yt = {
|
|
15
15
|
key: 3,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DQRLTu78.cjs"),Y=require("./useResponsive-B3TrDDIG.cjs"),ce=require("./Title-Bpx2Ub4Z.cjs"),J=require("./usePrinter-DuYSC89K.cjs"),de=require("./Tooltip-D-JR_3NK.cjs"),ve=require("./DataTable-CiVu-yQZ.cjs"),pe=require("./Legend-ComtyeZF.cjs"),he=require("./vue-ui-skeleton-yOWIPVsZ.cjs"),ge=require("./vue-ui-accordion-ZppPKpGK.cjs"),K=require("./useNestedProp-np0rM3ep.cjs"),fe=require("./PackageVersion-BqVp7cHC.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=["id"],be=["xmlns","viewBox"],ke=["id"],Ce=["stop-color"],we=["stop-color"],xe=["stroke","cx","cy","r","fill"],Te=["stroke","stroke-width","cx","cy","r","fill"],Ne=["cx","cy","r","onMouseenter"],$e={key:3,class:"vue-data-ui-watermark"},_e=["onClick"],Se={key:0},Be={key:1},Pe=["innerHTML"],Le={__name:"vue-ui-rings",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(Q,{expose:Z,emit:ee}){const v=Q,{vue_ui_rings:te}=r.useConfig(),y=e.ref(!1),x=e.computed(()=>!!v.dataset&&v.dataset.length),b=e.ref(r.createUid()),le=e.ref(null),T=e.ref(!1),S=e.ref(""),m=e.ref(null),L=e.ref(0),k=e.ref(null),V=e.ref(null),E=e.ref(null),z=e.ref(0),F=e.ref(0),I=e.ref(0),t=e.computed({get:()=>O(),set:l=>l});function O(){const l=K.useNestedProp({userConfig:v.config,defaultConfig:te});return l.theme?{...K.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=O(),R(),z.value+=1,F.value+=1,I.value+=1},{deep:!0});const N=e.ref(null);e.onMounted(()=>{R()});function R(){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=Y.throttle(()=>{const{width:a,height:o}=Y.useResponsive({chart:k.value,title:t.value.style.chart.title.text?V.value:null,legend:t.value.style.chart.legend.show?E.value:null});s.value.width=a,s.value.height=o});N.value=new ResizeObserver(l),N.value.observe(k.value.parentNode)}setTimeout(()=>{y.value=!0},600)}e.onBeforeUnmount(()=>{N.value&&N.value.disconnect()});const{isPrinting:M,isImaging:q,generatePdf:D,generateImage:A}=J.usePrinter({elementId:`rings_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-rings"}),U=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}),oe=e.computed(()=>Math.min(s.value.height,s.value.width)),i=e.ref([]);function B(l){i.value.includes(l)?i.value=i.value.filter(a=>a!==l):i.value.push(l),ee("selectLegend",c.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const ae=e.computed(()=>Math.max(...$.value.filter(l=>!i.value.includes(l.uid)).map(({value:l})=>l)));function H(l){return l/ae.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)||U.value[n]||r.palette[n]||r.palette[n%r.palette.length],value:u,proportion:u/v.dataset.map(h=>(h.values||[]).reduce((w,ie)=>w+ie,0)).reduce((h,w)=>h+w,0),uid:r.createUid()}})),W=e.computed(()=>$.value.map(l=>({...l,shape:"circle",opacity:i.value.includes(l.uid)?.5:1,segregate:()=>B(l.uid),isSegregated:i.value.includes(l.uid)})).toSorted((l,a)=>a.value-l.value)),re=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)||U.value[u]||r.palette[u]||r.palette[u%r.palette.length],value:a,proportion:H(a),percentage:a/p.value*100,strokeWidth:t.value.style.chart.layout.rings.strokeWidth*H(a)})).toSorted((l,a)=>a.value-l.value));function ne(){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(()=>oe.value-t.value.style.chart.layout.rings.strokeWidth*2),P=e.ref(null);function ue(l,a){if(i.value.length===v.dataset.length)return;P.value={datapoint:a,seriesIndex:l,series:c.value,config:t.value},m.value=l;const o=c.value[l],n=t.value.style.chart.tooltip.customFormat;if(r.isFunction(n)&&r.functionReturnsString(()=>n({seriesIndex:l,datapoint:a,series:c.value,config:t.value})))S.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>`),S.value=u}T.value=!0}const f=e.computed(()=>{const l=c.value.map(o=>({name:o.name,color:o.color})),a=c.value.map(o=>o.value);return{head:l,body:a}}),_=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 G(){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 C=e.ref(!1);function se(l){C.value=l,L.value+=1}function j(){g.value.showTable=!g.value.showTable}function X(){g.value.showTooltip=!g.value.showTooltip}return Z({getData:ne,generatePdf:D,generateCsv:G,generateImage:A,toggleTable:j,toggleTooltip:X}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"ringsChart",ref:k,class:e.normalizeClass(`vue-ui-rings ${C.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};text-align:center;width:100%;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`),id:`rings_${b.value}`,onMouseleave:a[3]||(a[3]=o=>{m.value=null,T.value=!1})},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:V,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(ce._sfc_main,{key:`title_${z.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&&x.value?(e.openBlock(),e.createBlock(J.UserOptions,{ref_key:"details",ref:le,key:`user_options_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(M),isImaging:e.unref(q),uid:b.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:g.value.showTooltip,isFullscreen:C.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,position:t.value.userOptions.position,onToggleFullscreen:se,onGeneratePdf:e.unref(D),onGenerateCsv:G,onGenerateImage:e.unref(A),onToggleTable:j,onToggleTooltip:X},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]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(fe._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_${b.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,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,we)],8,ke))),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":y.value&&t.value.useCssAnimation,"vue-rings-item-onload":!y.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,xe),e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":y.value&&t.value.useCssAnimation,"vue-rings-item-onload":!y.value&&t.value.useCssAnimation,"vue-ui-rings-shadow":t.value.style.chart.layout.rings.useShadow,"vue-ui-rings-blur":m.value!==null&&m.value!==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_${b.value}_${n})`:o.color},null,14,Te),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=>ue(n,o),onMouseleave:a[0]||(a[0]=u=>{m.value=null,T.value=!1})},null,40,Ne)]))),256)),e.renderSlot(l.$slots,"svg",{svg:s.value},void 0,!0)],14,be)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",$e,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(M)||e.unref(q)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(he.default,{key:4,config:{type:"rings",style:{backgroundColor:t.value.style.chart.backgroundColor,rings:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:E},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(pe.Legend,{key:`legend_${I.value}`,legendSet:W.value,config:re.value,onClickMarker:a[1]||(a[1]=({legend:o})=>B(o.uid))},{item:e.withCtx(({legend:o,index:n})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:u=>B(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",Be," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Se," ("+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,_e)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:W.value},void 0,!0)],512),e.createVNode(de._sfc_main,{show:g.value.showTooltip&&T.value&&i.value.length<v.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:k.value,content:S.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...P.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...P.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),x.value?(e.openBlock(),e.createBlock(ge.default,{key:5,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(ve.DataTable,{key:`table_${F.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]=o=>g.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,Pe)]),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,ye))}},Ve=me._export_sfc(Le,[["__scopeId","data-v-08656179"]]);exports.default=Ve;
|