vue-data-ui 2.3.72 → 2.3.73
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-ZIElM1Qw.cjs → Arrow-B8nZeqNJ.cjs} +1 -1
- package/dist/{Arrow-CC7jRg59.js → Arrow-B9ZuNkP-.js} +1 -1
- package/dist/{BaseIcon-CBTIJ_i3.cjs → BaseIcon-CXbZK6D-.cjs} +1 -1
- package/dist/{BaseIcon-CPk98Gv1.js → BaseIcon-_V_BEdy8.js} +1 -1
- package/dist/{DataTable-B9bLH4Tw.js → DataTable-BOdJVZzF.js} +2 -2
- package/dist/{DataTable-03mHwPdu.cjs → DataTable-wmKwMbsJ.cjs} +1 -1
- package/dist/{Legend-VJiB_MLq.js → Legend-CHd5QFPM.js} +1 -1
- package/dist/{Legend-rxEBmJRW.cjs → Legend-DdndVhHV.cjs} +1 -1
- package/dist/{Shape-DGhwVgQc.cjs → Shape-CLRxBhyM.cjs} +1 -1
- package/dist/{Shape-D95l9PFa.js → Shape-DNbJlwSU.js} +1 -1
- package/dist/{Slicer-DBgvUVRS.js → Slicer-8Gg45iGX.js} +2 -2
- package/dist/{Slicer-DUMKJ_f0.cjs → Slicer-Dts-BToH.cjs} +1 -1
- package/dist/{Title-Du743m6e.cjs → Title-CujodUjt.cjs} +1 -1
- package/dist/{Title-B_AI8tEZ.js → Title-Ngy9HNqO.js} +1 -1
- package/dist/{Tooltip-CPewpyRa.js → Tooltip-BCtg7xYX.js} +1 -1
- package/dist/{Tooltip-B_WP5J9X.cjs → Tooltip-DsmWz8gF.cjs} +1 -1
- package/dist/{index-BYuu8ZDR.js → index-Dvs5Ra-u.js} +1 -1
- package/dist/{index-Cuc8JBQE.cjs → index-sFjJ2dIj.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-DdJ6Grxg.js → useNestedProp-UohhCyBz.js} +1 -1
- package/dist/{useNestedProp-DZwVoxS3.cjs → useNestedProp-ir0jEo5M.cjs} +1 -1
- package/dist/{usePrinter-DqIk1aRq.js → usePrinter-B8-keRMa.js} +1 -1
- package/dist/{usePrinter-BaExNQdD.cjs → usePrinter-DSMMs1w9.cjs} +1 -1
- package/dist/{vue-data-ui-C-epWCMP.js → vue-data-ui-Bgo6YUhl.js} +57 -57
- package/dist/{vue-data-ui-CUctczUX.cjs → vue-data-ui-NvV5qa--.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-BWgmK5sr.js → vue-ui-3d-bar-DckNIYgA.js} +7 -7
- package/dist/{vue-ui-3d-bar-xEpa156l.cjs → vue-ui-3d-bar-DhzN0gd4.cjs} +1 -1
- package/dist/{vue-ui-accordion-CW9p_36e.js → vue-ui-accordion-C-qAry7P.js} +3 -3
- package/dist/{vue-ui-accordion-CX_qmhfk.cjs → vue-ui-accordion-RuCkf_li.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-C2anlrIJ.js → vue-ui-age-pyramid-CamjaXUw.js} +8 -8
- package/dist/{vue-ui-age-pyramid-DgdE2kzJ.cjs → vue-ui-age-pyramid-CfUUEeKt.cjs} +1 -1
- package/dist/{vue-ui-annotator-DBsLmFva.cjs → vue-ui-annotator-D0kYZ56C.cjs} +1 -1
- package/dist/{vue-ui-annotator-BsFyYQmg.js → vue-ui-annotator-DMmdqorj.js} +1 -1
- package/dist/{vue-ui-candlestick-CuAxLf7q.cjs → vue-ui-candlestick-DJIJnnI_.cjs} +1 -1
- package/dist/{vue-ui-candlestick-BvObxrrO.js → vue-ui-candlestick-DRi8lDTn.js} +9 -9
- package/dist/{vue-ui-carousel-table-D7VggXPa.js → vue-ui-carousel-table-u5OoOMr1.js} +4 -4
- package/dist/{vue-ui-carousel-table-B8uXpuho.cjs → vue-ui-carousel-table-uYt1zVjx.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DsDFUMa1.cjs → vue-ui-chestnut-CG5krVO-.cjs} +1 -1
- package/dist/{vue-ui-chestnut-WVNJAAhE.js → vue-ui-chestnut-D5a4OH1D.js} +6 -6
- package/dist/{vue-ui-cursor-BHDKuzwQ.js → vue-ui-cursor-Bp_PHbz4.js} +2 -2
- package/dist/{vue-ui-cursor-Dv2x-leV.cjs → vue-ui-cursor-DpBsZNEE.cjs} +1 -1
- package/dist/{vue-ui-dashboard-CW2crD7k.cjs → vue-ui-dashboard--kjU0uMc.cjs} +1 -1
- package/dist/{vue-ui-dashboard-B7UJ5m3e.js → vue-ui-dashboard-BwBYH8V_.js} +2 -2
- package/dist/{vue-ui-digits-DgAV9vHK.cjs → vue-ui-digits-CIV9J3SW.cjs} +1 -1
- package/dist/{vue-ui-digits-S4d-vjPw.js → vue-ui-digits-t2G4B6uD.js} +2 -2
- package/dist/{vue-ui-donut-D-Obra62.js → vue-ui-donut-BTug2gsP.js} +9 -9
- package/dist/{vue-ui-donut-CXrbo2vS.cjs → vue-ui-donut-D6SrEIEJ.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-DMN5gqox.cjs → vue-ui-donut-evolution-Cb45erSA.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-CPp91gGc.js → vue-ui-donut-evolution-DTD0Hfgh.js} +9 -9
- package/dist/{vue-ui-dumbbell-B6VqQ1kW.js → vue-ui-dumbbell-BZw7lntE.js} +8 -8
- package/dist/{vue-ui-dumbbell-C5QNKImY.cjs → vue-ui-dumbbell-DVabaAYH.cjs} +1 -1
- package/dist/{vue-ui-flow-C265HMf-.cjs → vue-ui-flow-Bn1EP9Z1.cjs} +1 -1
- package/dist/{vue-ui-flow-DxDFmEMo.js → vue-ui-flow-Cz_xaLAs.js} +7 -7
- package/dist/{vue-ui-galaxy-3W5_FamU.js → vue-ui-galaxy-Bjlm3WtB.js} +9 -9
- package/dist/{vue-ui-galaxy-CE6eSTiR.cjs → vue-ui-galaxy-Drnhlmmw.cjs} +1 -1
- package/dist/{vue-ui-gauge-i_mEreL4.js → vue-ui-gauge-CxIVYnG2.js} +5 -5
- package/dist/{vue-ui-gauge-Ct9Pm6Rr.cjs → vue-ui-gauge-D2reVZ-b.cjs} +1 -1
- package/dist/{vue-ui-gizmo-fpcEpQC_.cjs → vue-ui-gizmo-B6ZwXwFY.cjs} +1 -1
- package/dist/{vue-ui-gizmo-DjKx8zQ3.js → vue-ui-gizmo-CiutQM-A.js} +2 -2
- package/dist/{vue-ui-heatmap-BHVAAWge.js → vue-ui-heatmap-C933pQPU.js} +8 -8
- package/dist/{vue-ui-heatmap-BJ5WgKkA.cjs → vue-ui-heatmap-ClFm7qUu.cjs} +1 -1
- package/dist/{vue-ui-kpi-BJO4Si4A.cjs → vue-ui-kpi-CdPFWSHA.cjs} +1 -1
- package/dist/{vue-ui-kpi-3vwX1pb-.js → vue-ui-kpi-ClreiT4V.js} +3 -3
- package/dist/{vue-ui-mini-loader-BGNVjrVa.js → vue-ui-mini-loader-B5XG2gKd.js} +2 -2
- package/dist/{vue-ui-mini-loader-Bkz8xXIn.cjs → vue-ui-mini-loader-C67Z1C6r.cjs} +1 -1
- package/dist/{vue-ui-molecule-DmcAp7Nw.js → vue-ui-molecule-DzIeuL8t.js} +9 -9
- package/dist/{vue-ui-molecule-Be2hKLP4.cjs → vue-ui-molecule-JJQ3af-R.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-mzy-m7VP.js → vue-ui-mood-radar-02L4M-n_.js} +9 -9
- package/dist/{vue-ui-mood-radar-DkhEq8kd.cjs → vue-ui-mood-radar-DT4JU_6B.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-CrZglRrG.js → vue-ui-nested-donuts-BY50trfJ.js} +9 -9
- package/dist/{vue-ui-nested-donuts-BiCvS_99.cjs → vue-ui-nested-donuts-D6Dihmne.cjs} +1 -1
- package/dist/{vue-ui-onion-BiM0osaA.js → vue-ui-onion-BmQ7B9xY.js} +9 -9
- package/dist/{vue-ui-onion-Cvm8iYyA.cjs → vue-ui-onion-DoNDCpth.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-B2F5TA1E.js → vue-ui-parallel-coordinate-plot-BdfcqlfT.js} +10 -10
- package/dist/{vue-ui-parallel-coordinate-plot-CSKNUGrK.cjs → vue-ui-parallel-coordinate-plot-CJMjEDXR.cjs} +1 -1
- package/dist/{vue-ui-quadrant-DPqbsYX0.js → vue-ui-quadrant-CLimyRoA.js} +10 -10
- package/dist/{vue-ui-quadrant-BMxBMaop.cjs → vue-ui-quadrant-DWqmU3-5.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-CUFDSDf1.cjs → vue-ui-quick-chart-CB5VelG0.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-BsF68NGZ.js → vue-ui-quick-chart-CX8Kas-o.js} +7 -7
- package/dist/{vue-ui-radar-CP99GsF6.js → vue-ui-radar-CK0PB5oY.js} +10 -10
- package/dist/{vue-ui-radar-D85U18Fh.cjs → vue-ui-radar-aTceo-HQ.cjs} +1 -1
- package/dist/{vue-ui-rating-D2_B2CmO.js → vue-ui-rating-BnqWN2ui.js} +2 -2
- package/dist/{vue-ui-rating-fCVonNIH.cjs → vue-ui-rating-Ceu3pXmF.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-CCw0p9C1.js → vue-ui-relation-circle-D1z8MBVH.js} +5 -5
- package/dist/{vue-ui-relation-circle-BwhjRfE-.cjs → vue-ui-relation-circle-DWGtziD_.cjs} +1 -1
- package/dist/{vue-ui-rings-CP9xh0Jf.js → vue-ui-rings-CYthauSM.js} +9 -9
- package/dist/{vue-ui-rings-Cyb2-Fz9.cjs → vue-ui-rings-gp0sEMy6.cjs} +1 -1
- package/dist/{vue-ui-scatter-C_7m-HWT.cjs → vue-ui-scatter-BKl2fUIR.cjs} +1 -1
- package/dist/{vue-ui-scatter-DahRqX0n.js → vue-ui-scatter-Cxr9eymz.js} +10 -10
- package/dist/{vue-ui-screenshot-Bz8ypntU.js → vue-ui-screenshot-CVWC5rbJ.js} +1 -1
- package/dist/{vue-ui-screenshot-kjxK6cGN.cjs → vue-ui-screenshot-sBd8-Oyh.cjs} +1 -1
- package/dist/{vue-ui-skeleton-DY6dv9ms.js → vue-ui-skeleton-CAvlIcgk.js} +2 -2
- package/dist/{vue-ui-skeleton-DBlDHYe3.cjs → vue-ui-skeleton-CqF0NJ4g.cjs} +1 -1
- package/dist/{vue-ui-smiley-QjSvhCpm.js → vue-ui-smiley-CXbipVsb.js} +2 -2
- package/dist/{vue-ui-smiley-D4LI_UP4.cjs → vue-ui-smiley-c_I60YOy.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-sS5omLKN.js → vue-ui-spark-trend-C3sBXu8D.js} +4 -4
- package/dist/{vue-ui-spark-trend-D2lgLtNe.cjs → vue-ui-spark-trend-CXkkMK6N.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-BSa3E1PW.cjs → vue-ui-sparkbar-BkN5iTUq.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-D477mrPt.js → vue-ui-sparkbar-Dm-2_5Ef.js} +3 -3
- package/dist/{vue-ui-sparkgauge-CBdtHXSj.cjs → vue-ui-sparkgauge-D4EqU3x3.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge--a3JMX4H.js → vue-ui-sparkgauge-FKTXvE7e.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-GY3NORZf.cjs → vue-ui-sparkhistogram-BkJz2dBD.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-B7vG6DfM.js → vue-ui-sparkhistogram-qf87TXA-.js} +4 -4
- package/dist/{vue-ui-sparkline-DQv6RoBk.js → vue-ui-sparkline-CZBgvY1A.js} +3 -3
- package/dist/{vue-ui-sparkline-DGM2gvJO.cjs → vue-ui-sparkline-TPkuvKtA.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-CwSD66G_.cjs → vue-ui-sparkstackbar-CzzfnPDS.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-CgCC9OyA.js → vue-ui-sparkstackbar-GtkDZDXZ.js} +3 -3
- package/dist/{vue-ui-stackbar-CYlI2qNa.js → vue-ui-stackbar-D_Ui7xec.js} +10 -10
- package/dist/{vue-ui-stackbar-DE06kEdr.cjs → vue-ui-stackbar-NHgsl2-Z.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-cLATedZC.js → vue-ui-strip-plot--VJ3f5UV.js} +9 -9
- package/dist/{vue-ui-strip-plot-CTPE5LwY.cjs → vue-ui-strip-plot-CU6OtKt7.cjs} +1 -1
- package/dist/{vue-ui-table-isDxWkmA.js → vue-ui-table-BCQ7voEV.js} +1 -1
- package/dist/{vue-ui-table-CYfUUquW.cjs → vue-ui-table-B_6N0VOD.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-tqdvfQH_.cjs → vue-ui-table-heatmap-DFMF1RZ0.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-DdEcsnYm.js → vue-ui-table-heatmap-UwpQQMHB.js} +4 -4
- package/dist/{vue-ui-table-sparkline-By0R0tDV.js → vue-ui-table-sparkline-Bzqs2Hcp.js} +5 -5
- package/dist/{vue-ui-table-sparkline-D2Eyb3oO.cjs → vue-ui-table-sparkline-DWvOKdPb.cjs} +1 -1
- package/dist/{vue-ui-thermometer-DT_17Yji.cjs → vue-ui-thermometer-BOuuVWuf.cjs} +1 -1
- package/dist/{vue-ui-thermometer-CewCkrgl.js → vue-ui-thermometer-BQbYzsSV.js} +5 -5
- package/dist/{vue-ui-timer-aFikwHk0.cjs → vue-ui-timer-BCiMjXdm.cjs} +1 -1
- package/dist/{vue-ui-timer-VmBMBL_O.js → vue-ui-timer-KGEswANF.js} +4 -4
- package/dist/{vue-ui-tiremarks-8YMG58Ot.js → vue-ui-tiremarks-BSkMCIu1.js} +5 -5
- package/dist/{vue-ui-tiremarks-CyvUhC9g.cjs → vue-ui-tiremarks-DuEz8cO5.cjs} +1 -1
- package/dist/{vue-ui-treemap-83V4TBu2.cjs → vue-ui-treemap-BO8gKQ4O.cjs} +1 -1
- package/dist/{vue-ui-treemap-DlU_2b5A.js → vue-ui-treemap-DIWveOrq.js} +9 -9
- package/dist/{vue-ui-vertical-bar-DFlujd2F.cjs → vue-ui-vertical-bar-Dpzyha_P.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-D8KpbB9m.js → vue-ui-vertical-bar-Dx6wReOw.js} +9 -9
- package/dist/{vue-ui-waffle-Dn1tci28.cjs → vue-ui-waffle-C0-IVDjk.cjs} +1 -1
- package/dist/{vue-ui-waffle-D5nczTQz.js → vue-ui-waffle-D3jMPOd3.js} +9 -9
- package/dist/{vue-ui-wheel-D0B43FnX.js → vue-ui-wheel-B10kCoLD.js} +5 -5
- package/dist/{vue-ui-wheel-DWqZIkI0.cjs → vue-ui-wheel-mWdIHlXV.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-BEebLRtX.cjs → vue-ui-word-cloud-CYtRxpdV.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-DXEW7oYX.js → vue-ui-word-cloud-rhrsHes4.js} +7 -7
- package/dist/{vue-ui-xy-O3zBtp22.js → vue-ui-xy-9_2IHEOX.js} +16 -16
- package/dist/{vue-ui-xy-8508ou3J.cjs → vue-ui-xy-CFqs5rtd.cjs} +2 -2
- package/dist/{vue-ui-xy-canvas-AMNGVzal.js → vue-ui-xy-canvas-DGuGy69l.js} +10 -10
- package/dist/{vue-ui-xy-canvas-CssfbLPK.cjs → vue-ui-xy-canvas-sLH0pM-i.cjs} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-Cuc8JBQE.cjs"),re=require("./useResponsive-B3TrDDIG.cjs"),me=require("./Title-Du743m6e.cjs"),ue=require("./usePrinter-BaExNQdD.cjs"),be=require("./DataTable-03mHwPdu.cjs"),ge=require("./Tooltip-B_WP5J9X.cjs"),ke=require("./Legend-rxEBmJRW.cjs"),we=require("./vue-ui-skeleton-DBlDHYe3.cjs"),Ce=require("./vue-ui-accordion-CX_qmhfk.cjs"),ne=require("./useNestedProp-DZwVoxS3.cjs"),xe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_e=B=>(e.pushScopeId("data-v-8cc49fb9"),B=B(),e.popScopeId(),B),Be=["id"],Se=["xmlns","viewBox"],$e=["id"],Le=["stop-color"],Ne=["stop-color"],Ee=["stop-color"],Ve=["id"],Te=["id"],ze=_e(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Oe=["id"],Fe=["flood-color"],De=["d","stroke","filter"],Pe=["cx","cy","r","fill","filter"],Me=["stroke","d"],Xe=["d","fill","stroke","stroke-width","filter"],Ae=["cx","cy","r","fill","stroke"],Ie=["cx","cy","r","fill"],qe=["d","fill","onMouseenter","onClick"],Re=["cx","cy","r","fill"],Ge=["x","y","fill","font-size"],Ye=["x","y","fill","font-size"],He=["x","y","fill","font-size"],Ue=["x","y","fill","font-size"],je=["filter"],We={key:0},Je=["x","y"],Ke={key:1},Qe=["cx","cy","fill","filter","onClick"],Ze=["text-anchor","x","y","fill","font-size","onClick"],et=["text-anchor","x","y","fill","font-size","onClick"],tt={key:2},lt=["x","y","width"],at={key:3,class:"vue-data-ui-watermark"},ot=["onClick"],rt={key:0,style:{"font-variant-numeric":"tabular-nums"}},ut={key:1},nt=["innerHTML"],st={__name:"vue-ui-donut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(B,{expose:se,emit:X}){const m=B,{vue_ui_donut:ce}=o.useConfig(),S=e.computed({get(){return!!m.dataset&&m.dataset.length},set(a){return a}}),$=e.ref(null),A=e.ref(null),I=e.ref(null),V=e.ref(null);e.onMounted(()=>{if(o.objectIsEmpty(m.dataset)?o.error({componentName:"VueUiDonut",type:"dataset"}):m.dataset.forEach((a,r)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","values"]}).forEach(l=>{S.value=!1,o.error({componentName:"VueUiDonut",type:"datasetSerieAttribute",property:l,index:r})})}),t.value.responsive){const a=re.throttle(()=>{const{width:r,height:l}=re.useResponsive({chart:$.value,title:t.value.style.chart.title.text?A.value:null,legend:t.value.style.chart.legend.show?I.value:null});s.value.width=r,s.value.height=l});V.value=new ResizeObserver(a),V.value.observe($.value.parentNode)}}),e.onBeforeUnmount(()=>{V.value&&V.value.disconnect()});const f=e.ref(o.createUid()),ie=e.ref(null),O=e.ref(!1),F=e.ref(""),b=e.ref(null),q=e.ref(0),t=e.computed(()=>{const a=ne.useNestedProp({userConfig:m.config,defaultConfig:ce});return a.theme?{...ne.useNestedProp({userConfig:o.themes.vue_ui_donut[a.theme]||m.config,defaultConfig:a}),customPalette:o.themePalettes[a.theme]||o.palette}:a}),{isPrinting:R,isImaging:G,generatePdf:Y,generateImage:H}=ue.usePrinter({elementId:`donut__${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-donut"}),U=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),v=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:512}),L=e.computed(()=>{const a=t.value.style.chart.layout.donut.strokeWidth/512,r=s.value.width*a;return r>y.value/2?t.value.style.chart.layout.donut.strokeWidth:r}),k=e.computed(()=>m.dataset.map((a,r)=>({name:a.name,color:o.convertColorToHex(a.color)||U.value[r]||o.palette[r]||o.palette[r%o.palette.length],value:a.values.reduce((l,u)=>l+u,0),absoluteValues:a.values,comment:a.comment||""}))),h=e.ref(k.value);e.watch(()=>k.value,a=>h.value=a);function ve(){return k.value.map(a=>({name:a.name,color:a.color,value:a.value}))}const p=e.ref([]),j=e.ref(null),W=e.ref(null),w=e.ref(!1);function J(a){const r=k.value.find((n,i)=>i===a);let u=h.value.find((n,i)=>i===a).value;if(p.value.includes(a)){let i=function(){u>n?(cancelAnimationFrame(j.value),h.value=h.value.map((c,M)=>a===M?{...c,value:n}:c),w.value=!1):(w.value=!0,u+=n*.025,h.value=h.value.map((c,M)=>a===M?{...c,value:u}:c),j.value=requestAnimationFrame(i))};p.value=p.value.filter(c=>c!==a);const n=r.value;i()}else if(p.value.length<k.value.length-1){let n=function(){u<.1?(cancelAnimationFrame(W.value),p.value.push(a),h.value=h.value.map((i,c)=>a===c?{...i,value:0}:i),w.value=!1):(w.value=!0,u/=1.1,h.value=h.value.map((i,c)=>a===c?{...i,value:u}:i),W.value=requestAnimationFrame(n))};n()}X("selectLegend",x.value.map(n=>({name:n.name,color:n.color,value:n.value})))}const x=e.computed(()=>(h.value.forEach((a,r)=>{if([null,void 0].includes(a.values))return{...a,values:[]}}),h.value.map((a,r)=>({...a,seriesIndex:r})).filter((a,r)=>!p.value.includes(r)))),K=e.computed(()=>m.dataset.map((a,r)=>({name:a.name,color:o.convertColorToHex(a.color)||U.value[r]||o.palette[r]||o.palette[r%o.palette.length],value:(a.values||[]).reduce((l,u)=>l+u,0),shape:"circle"})).map((a,r)=>({...a,proportion:a.value/m.dataset.map(l=>(l.values||[]).reduce((u,n)=>u+n,0)).reduce((l,u)=>l+u,0),opacity:p.value.includes(r)?.5:1,segregate:()=>J(r),isSegregated:p.value.includes(r)}))),de=e.computed(()=>({cy:"donut-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":""})),y=e.computed(()=>{const a=Math.min(s.value.width/3,s.value.height/3);return a<55?55:a}),C=e.computed(()=>o.makeDonut({series:x.value},s.value.width/2,s.value.height/2,y.value,y.value,1.99999,2,1,360,105.25,L.value));function _(a){return a.proportion*100>t.value.style.chart.layout.labels.dataLabels.hideUnderValue}function Q(a,r){const l=a.value/he(r);return isNaN(l)?0:o.applyDataLabel(t.value.style.chart.layout.labels.percentage.formatter,l*100,o.dataLabel({v:l*100,s:"%",r:t.value.style.chart.layout.labels.percentage.rounding}),{datapoint:a})}function he(a){return[...a].map(r=>r.value).reduce((r,l)=>r+l,0)}const d=e.computed(()=>x.value.map(a=>a.value).reduce((a,r)=>a+r,0)),Z=e.computed(()=>d.value/x.value.length),D=e.ref(null),N=e.ref(!1);function fe({datapoint:a,relativeIndex:r,seriesIndex:l,show:u=!1}){D.value={datapoint:a,seriesIndex:l,config:t.value,series:k.value},O.value=u,b.value=r;let n="";const i=t.value.style.chart.tooltip.customFormat;if(N.value=!1,o.isFunction(i))try{const c=i({seriesIndex:l,datapoint:a,series:k.value,config:t.value});typeof c=="string"&&(F.value=c,N.value=!0)}catch{console.warn("Custom format cannot be applied."),N.value=!1}if(!N.value){if(n+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${a.name}</div>`,n+=`<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>`,t.value.style.chart.tooltip.showValue&&(n+=`<b>${o.applyDataLabel(t.value.style.chart.layout.labels.value.formatter,a.value,o.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,relativeIndex:r,seriesIndex:l})}</b>`),t.value.style.chart.tooltip.showPercentage){const c=o.applyDataLabel(t.value.style.chart.layout.labels.percentage.formatter,a.proportion*100,o.dataLabel({v:a.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage}),{datapoint:a,relativeIndex:r,seriesIndex:l});t.value.style.chart.tooltip.showValue?n+=`<span>(${c})</span></div>`:n+=`<b>${c}%</b></div>`}t.value.style.chart.comments.showInTooltip&&a.comment&&(n+=`<div class="vue-data-ui-tooltip-comment" style="background:${a.color}20; padding: 6px; margin-bottom: 6px; margin-top:6px; border-left: 1px solid ${a.color}">${a.comment}</div>`),F.value=`<div>${n}</div>`}}function P(a){return t.value.useBlurOnHover&&![null,void 0].includes(b.value)&&b.value!==a?`url(#blur_${f.value})`:""}const g=e.computed(()=>{const a=x.value.map(l=>({name:l.name,color:l.color})),r=x.value.map(l=>l.value);return{head:a,body:r}});function ee(){e.nextTick(()=>{const a=g.value.head.map((u,n)=>[[u.name],[g.value.body[n]],[isNaN(g.value.body[n]/d.value)?"-":g.value.body[n]/d.value*100]]),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(a),l=o.createCsvContent(r);o.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-donut"})})}const T=e.computed(()=>{const a=[' <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>',o.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:d.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],r=g.value.head.map((n,i)=>{const c=o.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:n.color,name:n.name},c,isNaN(g.value.body[i]/d.value)?"-":(g.value.body[i]/d.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:a,body:r,config:l}}),E=e.ref(!1);function ye(a){E.value=a,q.value+=1}const te=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent));function pe(a){return a.toFixed(t.value.style.chart.legend.roundingPercentage).split("").map(r=>"-").join("")}function z(a,r){X("selectDatapoint",{datapoint:a,index:r})}function le(){v.value.showTable=!v.value.showTable}function ae(){v.value.dataLabels.show=!v.value.dataLabels.show}function oe(){v.value.showTooltip=!v.value.showTooltip}return se({getData:ve,generatePdf:Y,generateCsv:ee,generateImage:H,toggleTable:le,toggleLabels:ae,toggleTooltip:oe}),(a,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"donutChart",ref:$,class:e.normalizeClass(`vue-ui-donut ${E.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),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}`),id:`donut__${f.value}`},[e.renderSlot(a.$slots,"userConfig",{},void 0,!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(me._sfc_main,{config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&S.value?(e.openBlock(),e.createBlock(ue.UserOptions,{ref_key:"details",ref:ie,key:`user_option_${q.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(R),isImaging:e.unref(G),uid:f.value,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:E.value,chartElement:$.value,isTooltip:v.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},onToggleFullscreen:ye,onGeneratePdf:e.unref(Y),onGenerateCsv:ee,onGenerateImage:e.unref(H),onToggleTable:le,onToggleLabels:ae,onToggleTooltip:oe},e.createSlots({_:2},[a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,a.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:u})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:u})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasLabel","hasFullscreen","isFullscreen","chartElement","isTooltip","titles","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":E.value,"vue-data-ui-fulscreen--off":!E.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[t.value.style.chart.useGradient?(e.openBlock(),e.createElementBlock("radialGradient",{key:0,id:`gradient_${f.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.convertColorToHex)(t.value.style.chart.backgroundColor)}00`},null,8,Le),e.createElementVNode("stop",{offset:"77%","stop-color":"#FFFFFF"+e.unref(o.opacity)[t.value.style.chart.gradientIntensity]},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(o.convertColorToHex)(t.value.style.chart.backgroundColor)}00`},null,8,Ee)],8,$e)):e.createCommentVNode("",!0)]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${f.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2,id:`blur_std_${f.value}`},null,8,Te),ze],8,Ve),e.createElementVNode("filter",{id:`shadow_${f.value}`,"color-interpolation-filters":"sRGB"},[e.createElementVNode("feDropShadow",{dx:"0",dy:"0",stdDeviation:"10","flood-opacity":"0.5","flood-color":t.value.style.chart.layout.donut.shadowColor},null,8,Fe)],8,Oe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(l,u)=>(e.openBlock(),e.createElementBlock("g",null,[_(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("path",{key:0,d:e.unref(o.calcNutArrowPath)(l,{x:s.value.width/2,y:s.value.height/2},16,16,!1,!1,L.value),stroke:l.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",filter:P(u)},null,8,De)):e.createCommentVNode("",!0)]))),256)),e.createElementVNode("circle",{cx:s.value.width/2,cy:s.value.height/2,r:y.value<=0?10:y.value,fill:t.value.style.chart.backgroundColor,filter:t.value.style.chart.layout.donut.useShadow?`url(#shadow_${f.value})`:""},null,8,Pe),d.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(l,u)=>(e.openBlock(),e.createElementBlock("path",{stroke:t.value.style.chart.backgroundColor,d:l.arcSlice,fill:"#FFFFFF"},null,8,Me))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(l,u)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:l.arcSlice,fill:`${l.color}CC`,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.donut.borderWidth,filter:P(u)},null,8,Xe))),256))],64)):(e.openBlock(),e.createElementBlock("circle",{key:1,cx:s.value.width/2,cy:s.value.height/2,r:y.value<=0?10:y.value,fill:t.value.style.chart.backgroundColor,stroke:e.unref(o.adaptColorToBackground)(t.value.style.chart.background)},null,8,Ae)),t.value.style.chart.useGradient?(e.openBlock(),e.createElementBlock("circle",{key:2,cx:s.value.width/2,cy:s.value.height/2,r:y.value<=0?10:y.value,fill:`url(#gradient_${f.value})`},null,8,Ie)):e.createCommentVNode("",!0),d.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(C.value,(l,u)=>(e.openBlock(),e.createElementBlock("path",{"data-cy-donut-trap":"",d:l.arcSlice,fill:b.value===u?"rgba(0,0,0,0.1)":"transparent",onMouseenter:n=>fe({datapoint:l,relativeIndex:u,seriesIndex:l.seriesIndex,show:!0}),onMouseleave:r[0]||(r[0]=n=>{O.value=!1,b.value=null}),onClick:n=>z(l,u)},null,40,qe))),256)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.show?(e.openBlock(),e.createElementBlock("circle",{key:4,cx:s.value.width/2,cy:s.value.height/2,r:y.value-L.value<=0?10:y.value-L.value,fill:t.value.style.chart.backgroundColor},null,8,Re)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.total.show?(e.openBlock(),e.createElementBlock("text",{key:5,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2-(t.value.style.chart.layout.labels.hollow.average.show?t.value.style.chart.layout.labels.hollow.total.fontSize:0)+t.value.style.chart.layout.labels.hollow.total.offsetY,fill:t.value.style.chart.layout.labels.hollow.total.color,"font-size":t.value.style.chart.layout.labels.hollow.total.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.total.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.layout.labels.hollow.total.text),13,Ge)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.total.show?(e.openBlock(),e.createElementBlock("text",{key:6,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2+t.value.style.chart.layout.labels.hollow.total.fontSize-(t.value.style.chart.layout.labels.hollow.average.show?t.value.style.chart.layout.labels.hollow.total.fontSize:0)+t.value.style.chart.layout.labels.hollow.total.value.offsetY,fill:t.value.style.chart.layout.labels.hollow.total.value.color,"font-size":t.value.style.chart.layout.labels.hollow.total.value.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.total.value.bold?"bold":""}`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.hollow.total.value.formatter,d.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.labels.hollow.total.value.prefix,v:d.value,s:t.value.style.chart.layout.labels.hollow.total.value.suffix}))),13,Ye)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.average.show?(e.openBlock(),e.createElementBlock("text",{key:7,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2+(t.value.style.chart.layout.labels.hollow.total.show?t.value.style.chart.layout.labels.hollow.average.fontSize:0)+t.value.style.chart.layout.labels.hollow.average.offsetY,fill:t.value.style.chart.layout.labels.hollow.average.color,"font-size":t.value.style.chart.layout.labels.hollow.average.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.average.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.layout.labels.hollow.average.text),13,He)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.average.show?(e.openBlock(),e.createElementBlock("text",{key:8,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2+(t.value.style.chart.layout.labels.hollow.total.show?t.value.style.chart.layout.labels.hollow.average.fontSize:0)+t.value.style.chart.layout.labels.hollow.average.fontSize+t.value.style.chart.layout.labels.hollow.average.value.offsetY,fill:t.value.style.chart.layout.labels.hollow.average.value.color,"font-size":t.value.style.chart.layout.labels.hollow.average.value.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.average.value.bold?"bold":""}`)},e.toDisplayString(w.value?"--":e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.hollow.average.value.formatter,Z.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.labels.hollow.average.value.prefix,v:Z.value,s:t.value.style.chart.layout.labels.hollow.average.value.suffix,r:t.value.style.chart.layout.labels.hollow.average.value.rounding}))),13,Ue)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(l,u)=>(e.openBlock(),e.createElementBlock("g",{filter:P(u),class:e.normalizeClass({animated:t.value.useCssAnimation})},[t.value.style.chart.layout.labels.dataLabels.useLabelSlots?(e.openBlock(),e.createElementBlock("g",We,[(e.openBlock(),e.createElementBlock("foreignObject",{x:e.unref(o.calcMarkerOffsetX)(l,!0).anchor==="end"?e.unref(o.calcMarkerOffsetX)(l).x-120:e.unref(o.calcMarkerOffsetX)(l,!0).anchor==="middle"?e.unref(o.calcMarkerOffsetX)(l).x-60:e.unref(o.calcMarkerOffsetX)(l).x,y:e.unref(o.calcMarkerOffsetY)(l)-(te.value?20:0),width:"120",height:"60",style:{overflow:"visible"}},[e.createElementVNode("div",null,[e.renderSlot(a.$slots,"dataLabel",e.normalizeProps(e.guardReactiveProps({datapoint:l,isBlur:!t.value.useBlurOnHover||[null,void 0].includes(b.value)||b.value===u,isSafari:te.value,isVisible:_(l)&&v.value.dataLabels.show,textAlign:e.unref(o.calcMarkerOffsetX)(l,!0,16,!0).anchor,flexAlign:e.unref(o.calcMarkerOffsetX)(l,!0,16).anchor,percentage:Q(l,C.value)})),void 0,!0)])],8,Je))])):(e.openBlock(),e.createElementBlock("g",Ke,[_(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:e.unref(o.calcMarkerOffsetX)(l).x,cy:e.unref(o.calcMarkerOffsetY)(l)-3.5,fill:l.color,r:3,filter:!t.value.useBlurOnHover||[null,void 0].includes(b.value)||b.value===u?"":`url(#blur_${f.value})`,onClick:n=>z(l,u)},null,8,Qe)):e.createCommentVNode("",!0),_(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":e.unref(o.calcMarkerOffsetX)(l,!0,12).anchor,x:e.unref(o.calcMarkerOffsetX)(l,!0,12).x,y:e.unref(o.calcMarkerOffsetY)(l),fill:t.value.style.chart.layout.labels.percentage.color,"font-size":t.value.style.chart.layout.labels.percentage.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.percentage.bold?"bold":""}`),onClick:n=>z(l,u)},e.toDisplayString(Q(l,C.value))+" "+e.toDisplayString(t.value.style.chart.layout.labels.value.show?`(${e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.value.formatter,l.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.value.rounding}),{datapoint:l})})`:""),13,Ze)):e.createCommentVNode("",!0),_(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":e.unref(o.calcMarkerOffsetX)(l).anchor,x:e.unref(o.calcMarkerOffsetX)(l,!0,12).x,y:e.unref(o.calcMarkerOffsetY)(l)+t.value.style.chart.layout.labels.percentage.fontSize,fill:t.value.style.chart.layout.labels.name.color,"font-size":t.value.style.chart.layout.labels.name.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.name.bold?"bold":""}`),onClick:n=>z(l,u)},e.toDisplayString(l.name),13,et)):e.createCommentVNode("",!0)])),v.value.dataLabels.show&&t.value.style.chart.comments.show&&l.comment?(e.openBlock(),e.createElementBlock("g",tt,[_(l)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:t.value.style.chart.comments.offsetX+(e.unref(o.calcMarkerOffsetX)(l,!0).anchor==="end"?e.unref(o.calcMarkerOffsetX)(l).x-t.value.style.chart.comments.width:e.unref(o.calcMarkerOffsetX)(l,!0).anchor==="middle"?e.unref(o.calcMarkerOffsetX)(l).x-t.value.style.chart.comments.width/2:e.unref(o.calcMarkerOffsetX)(l).x),y:e.unref(o.calcMarkerOffsetY)(l)+24+t.value.style.chart.comments.offsetY,width:t.value.style.chart.comments.width,height:"200",style:{overflow:"visible","pointer-events":"none"}},[e.createElementVNode("div",null,[e.renderSlot(a.$slots,"plot-comment",{plot:{...l,textAlign:e.unref(o.calcMarkerOffsetX)(l,!0,16,!0).anchor,flexAlign:e.unref(o.calcMarkerOffsetX)(l,!0,16).anchor}},void 0,!0)])],8,lt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,je))),256)),e.renderSlot(a.$slots,"svg",{svg:s.value},void 0,!0)],14,Se)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",at,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(R)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(we.default,{key:4,config:{type:"donut",style:{backgroundColor:t.value.style.chart.backgroundColor,donut:{color:"#CCCCCC",strokeWidth:L.value*.8}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:I},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(ke.Legend,{key:0,legendSet:K.value,config:de.value,onClickMarker:r[1]||(r[1]=({i:l})=>J(l))},{item:e.withCtx(({legend:l,index:u})=>[e.createElementVNode("div",{onClick:n=>l.segregate(),style:e.normalizeStyle(`opacity:${p.value.includes(u)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.value.formatter,l.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,index:u}))+" ",1),p.value.includes(u)?(e.openBlock(),e.createElementBlock("span",ut," ( "+e.toDisplayString(pe(l.proportion*100))+" % ) ",1)):(e.openBlock(),e.createElementBlock("span",rt," ("+e.toDisplayString(isNaN(l.value/d.value)?"-":e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.percentage.formatter,w.value?l.proportion*100:l.value/d.value*100,e.unref(o.dataLabel)({v:w.value?l.proportion*100:l.value/d.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage})))+") ",1))],12,ot)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:K.value},void 0,!0)],512),e.createVNode(ge._sfc_main,{show:v.value.showTooltip&&O.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,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,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:$.value,content:F.value,isCustom:N.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...D.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...D.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),S.value?(e.openBlock(),e.createBlock(Ce.default,{key:5,hideDetails:"",config:{open:v.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(be.DataTable,{colNames:T.value.colNames,head:T.value.head,body:T.value.body,config:T.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[2]||(r[2]=l=>v.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,nt)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name?l.name:isNaN(Number(l))?l.includes("%")?e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.percentage.formatter,l,e.unref(o.dataLabel)({v:l,s:"%",r:t.value.style.chart.layout.labels.percentage.rounding})):l:e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.value.formatter,l,e.unref(o.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.value.rounding}))),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Be))}},ct=xe._export_sfc(st,[["__scopeId","data-v-8cc49fb9"]]);exports.default=ct;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-sFjJ2dIj.cjs"),re=require("./useResponsive-B3TrDDIG.cjs"),me=require("./Title-CujodUjt.cjs"),ue=require("./usePrinter-DSMMs1w9.cjs"),be=require("./DataTable-wmKwMbsJ.cjs"),ge=require("./Tooltip-DsmWz8gF.cjs"),ke=require("./Legend-DdndVhHV.cjs"),we=require("./vue-ui-skeleton-CqF0NJ4g.cjs"),Ce=require("./vue-ui-accordion-RuCkf_li.cjs"),ne=require("./useNestedProp-ir0jEo5M.cjs"),xe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_e=B=>(e.pushScopeId("data-v-8cc49fb9"),B=B(),e.popScopeId(),B),Be=["id"],Se=["xmlns","viewBox"],$e=["id"],Le=["stop-color"],Ne=["stop-color"],Ee=["stop-color"],Ve=["id"],Te=["id"],ze=_e(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Oe=["id"],Fe=["flood-color"],De=["d","stroke","filter"],Pe=["cx","cy","r","fill","filter"],Me=["stroke","d"],Xe=["d","fill","stroke","stroke-width","filter"],Ae=["cx","cy","r","fill","stroke"],Ie=["cx","cy","r","fill"],qe=["d","fill","onMouseenter","onClick"],Re=["cx","cy","r","fill"],Ge=["x","y","fill","font-size"],Ye=["x","y","fill","font-size"],He=["x","y","fill","font-size"],Ue=["x","y","fill","font-size"],je=["filter"],We={key:0},Je=["x","y"],Ke={key:1},Qe=["cx","cy","fill","filter","onClick"],Ze=["text-anchor","x","y","fill","font-size","onClick"],et=["text-anchor","x","y","fill","font-size","onClick"],tt={key:2},lt=["x","y","width"],at={key:3,class:"vue-data-ui-watermark"},ot=["onClick"],rt={key:0,style:{"font-variant-numeric":"tabular-nums"}},ut={key:1},nt=["innerHTML"],st={__name:"vue-ui-donut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(B,{expose:se,emit:X}){const m=B,{vue_ui_donut:ce}=o.useConfig(),S=e.computed({get(){return!!m.dataset&&m.dataset.length},set(a){return a}}),$=e.ref(null),A=e.ref(null),I=e.ref(null),V=e.ref(null);e.onMounted(()=>{if(o.objectIsEmpty(m.dataset)?o.error({componentName:"VueUiDonut",type:"dataset"}):m.dataset.forEach((a,r)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","values"]}).forEach(l=>{S.value=!1,o.error({componentName:"VueUiDonut",type:"datasetSerieAttribute",property:l,index:r})})}),t.value.responsive){const a=re.throttle(()=>{const{width:r,height:l}=re.useResponsive({chart:$.value,title:t.value.style.chart.title.text?A.value:null,legend:t.value.style.chart.legend.show?I.value:null});s.value.width=r,s.value.height=l});V.value=new ResizeObserver(a),V.value.observe($.value.parentNode)}}),e.onBeforeUnmount(()=>{V.value&&V.value.disconnect()});const f=e.ref(o.createUid()),ie=e.ref(null),O=e.ref(!1),F=e.ref(""),b=e.ref(null),q=e.ref(0),t=e.computed(()=>{const a=ne.useNestedProp({userConfig:m.config,defaultConfig:ce});return a.theme?{...ne.useNestedProp({userConfig:o.themes.vue_ui_donut[a.theme]||m.config,defaultConfig:a}),customPalette:o.themePalettes[a.theme]||o.palette}:a}),{isPrinting:R,isImaging:G,generatePdf:Y,generateImage:H}=ue.usePrinter({elementId:`donut__${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-donut"}),U=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),v=e.ref({dataLabels:{show:t.value.style.chart.layout.labels.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:512}),L=e.computed(()=>{const a=t.value.style.chart.layout.donut.strokeWidth/512,r=s.value.width*a;return r>y.value/2?t.value.style.chart.layout.donut.strokeWidth:r}),k=e.computed(()=>m.dataset.map((a,r)=>({name:a.name,color:o.convertColorToHex(a.color)||U.value[r]||o.palette[r]||o.palette[r%o.palette.length],value:a.values.reduce((l,u)=>l+u,0),absoluteValues:a.values,comment:a.comment||""}))),h=e.ref(k.value);e.watch(()=>k.value,a=>h.value=a);function ve(){return k.value.map(a=>({name:a.name,color:a.color,value:a.value}))}const p=e.ref([]),j=e.ref(null),W=e.ref(null),w=e.ref(!1);function J(a){const r=k.value.find((n,i)=>i===a);let u=h.value.find((n,i)=>i===a).value;if(p.value.includes(a)){let i=function(){u>n?(cancelAnimationFrame(j.value),h.value=h.value.map((c,M)=>a===M?{...c,value:n}:c),w.value=!1):(w.value=!0,u+=n*.025,h.value=h.value.map((c,M)=>a===M?{...c,value:u}:c),j.value=requestAnimationFrame(i))};p.value=p.value.filter(c=>c!==a);const n=r.value;i()}else if(p.value.length<k.value.length-1){let n=function(){u<.1?(cancelAnimationFrame(W.value),p.value.push(a),h.value=h.value.map((i,c)=>a===c?{...i,value:0}:i),w.value=!1):(w.value=!0,u/=1.1,h.value=h.value.map((i,c)=>a===c?{...i,value:u}:i),W.value=requestAnimationFrame(n))};n()}X("selectLegend",x.value.map(n=>({name:n.name,color:n.color,value:n.value})))}const x=e.computed(()=>(h.value.forEach((a,r)=>{if([null,void 0].includes(a.values))return{...a,values:[]}}),h.value.map((a,r)=>({...a,seriesIndex:r})).filter((a,r)=>!p.value.includes(r)))),K=e.computed(()=>m.dataset.map((a,r)=>({name:a.name,color:o.convertColorToHex(a.color)||U.value[r]||o.palette[r]||o.palette[r%o.palette.length],value:(a.values||[]).reduce((l,u)=>l+u,0),shape:"circle"})).map((a,r)=>({...a,proportion:a.value/m.dataset.map(l=>(l.values||[]).reduce((u,n)=>u+n,0)).reduce((l,u)=>l+u,0),opacity:p.value.includes(r)?.5:1,segregate:()=>J(r),isSegregated:p.value.includes(r)}))),de=e.computed(()=>({cy:"donut-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":""})),y=e.computed(()=>{const a=Math.min(s.value.width/3,s.value.height/3);return a<55?55:a}),C=e.computed(()=>o.makeDonut({series:x.value},s.value.width/2,s.value.height/2,y.value,y.value,1.99999,2,1,360,105.25,L.value));function _(a){return a.proportion*100>t.value.style.chart.layout.labels.dataLabels.hideUnderValue}function Q(a,r){const l=a.value/he(r);return isNaN(l)?0:o.applyDataLabel(t.value.style.chart.layout.labels.percentage.formatter,l*100,o.dataLabel({v:l*100,s:"%",r:t.value.style.chart.layout.labels.percentage.rounding}),{datapoint:a})}function he(a){return[...a].map(r=>r.value).reduce((r,l)=>r+l,0)}const d=e.computed(()=>x.value.map(a=>a.value).reduce((a,r)=>a+r,0)),Z=e.computed(()=>d.value/x.value.length),D=e.ref(null),N=e.ref(!1);function fe({datapoint:a,relativeIndex:r,seriesIndex:l,show:u=!1}){D.value={datapoint:a,seriesIndex:l,config:t.value,series:k.value},O.value=u,b.value=r;let n="";const i=t.value.style.chart.tooltip.customFormat;if(N.value=!1,o.isFunction(i))try{const c=i({seriesIndex:l,datapoint:a,series:k.value,config:t.value});typeof c=="string"&&(F.value=c,N.value=!0)}catch{console.warn("Custom format cannot be applied."),N.value=!1}if(!N.value){if(n+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${a.name}</div>`,n+=`<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>`,t.value.style.chart.tooltip.showValue&&(n+=`<b>${o.applyDataLabel(t.value.style.chart.layout.labels.value.formatter,a.value,o.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,relativeIndex:r,seriesIndex:l})}</b>`),t.value.style.chart.tooltip.showPercentage){const c=o.applyDataLabel(t.value.style.chart.layout.labels.percentage.formatter,a.proportion*100,o.dataLabel({v:a.proportion*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage}),{datapoint:a,relativeIndex:r,seriesIndex:l});t.value.style.chart.tooltip.showValue?n+=`<span>(${c})</span></div>`:n+=`<b>${c}%</b></div>`}t.value.style.chart.comments.showInTooltip&&a.comment&&(n+=`<div class="vue-data-ui-tooltip-comment" style="background:${a.color}20; padding: 6px; margin-bottom: 6px; margin-top:6px; border-left: 1px solid ${a.color}">${a.comment}</div>`),F.value=`<div>${n}</div>`}}function P(a){return t.value.useBlurOnHover&&![null,void 0].includes(b.value)&&b.value!==a?`url(#blur_${f.value})`:""}const g=e.computed(()=>{const a=x.value.map(l=>({name:l.name,color:l.color})),r=x.value.map(l=>l.value);return{head:a,body:r}});function ee(){e.nextTick(()=>{const a=g.value.head.map((u,n)=>[[u.name],[g.value.body[n]],[isNaN(g.value.body[n]/d.value)?"-":g.value.body[n]/d.value*100]]),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(a),l=o.createCsvContent(r);o.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-donut"})})}const T=e.computed(()=>{const a=[' <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>',o.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:d.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],r=g.value.head.map((n,i)=>{const c=o.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue});return[{color:n.color,name:n.name},c,isNaN(g.value.body[i]/d.value)?"-":(g.value.body[i]/d.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],head:a,body:r,config:l}}),E=e.ref(!1);function ye(a){E.value=a,q.value+=1}const te=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent));function pe(a){return a.toFixed(t.value.style.chart.legend.roundingPercentage).split("").map(r=>"-").join("")}function z(a,r){X("selectDatapoint",{datapoint:a,index:r})}function le(){v.value.showTable=!v.value.showTable}function ae(){v.value.dataLabels.show=!v.value.dataLabels.show}function oe(){v.value.showTooltip=!v.value.showTooltip}return se({getData:ve,generatePdf:Y,generateCsv:ee,generateImage:H,toggleTable:le,toggleLabels:ae,toggleTooltip:oe}),(a,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"donutChart",ref:$,class:e.normalizeClass(`vue-ui-donut ${E.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),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}`),id:`donut__${f.value}`},[e.renderSlot(a.$slots,"userConfig",{},void 0,!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(me._sfc_main,{config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&S.value?(e.openBlock(),e.createBlock(ue.UserOptions,{ref_key:"details",ref:ie,key:`user_option_${q.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(R),isImaging:e.unref(G),uid:f.value,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:E.value,chartElement:$.value,isTooltip:v.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},onToggleFullscreen:ye,onGeneratePdf:e.unref(Y),onGenerateCsv:ee,onGenerateImage:e.unref(H),onToggleTable:le,onToggleLabels:ae,onToggleTooltip:oe},e.createSlots({_:2},[a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,a.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:u})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:u})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasLabel","hasFullscreen","isFullscreen","chartElement","isTooltip","titles","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":E.value,"vue-data-ui-fulscreen--off":!E.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[t.value.style.chart.useGradient?(e.openBlock(),e.createElementBlock("radialGradient",{key:0,id:`gradient_${f.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.convertColorToHex)(t.value.style.chart.backgroundColor)}00`},null,8,Le),e.createElementVNode("stop",{offset:"77%","stop-color":"#FFFFFF"+e.unref(o.opacity)[t.value.style.chart.gradientIntensity]},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(o.convertColorToHex)(t.value.style.chart.backgroundColor)}00`},null,8,Ee)],8,$e)):e.createCommentVNode("",!0)]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${f.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2,id:`blur_std_${f.value}`},null,8,Te),ze],8,Ve),e.createElementVNode("filter",{id:`shadow_${f.value}`,"color-interpolation-filters":"sRGB"},[e.createElementVNode("feDropShadow",{dx:"0",dy:"0",stdDeviation:"10","flood-opacity":"0.5","flood-color":t.value.style.chart.layout.donut.shadowColor},null,8,Fe)],8,Oe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(l,u)=>(e.openBlock(),e.createElementBlock("g",null,[_(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("path",{key:0,d:e.unref(o.calcNutArrowPath)(l,{x:s.value.width/2,y:s.value.height/2},16,16,!1,!1,L.value),stroke:l.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",filter:P(u)},null,8,De)):e.createCommentVNode("",!0)]))),256)),e.createElementVNode("circle",{cx:s.value.width/2,cy:s.value.height/2,r:y.value<=0?10:y.value,fill:t.value.style.chart.backgroundColor,filter:t.value.style.chart.layout.donut.useShadow?`url(#shadow_${f.value})`:""},null,8,Pe),d.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(l,u)=>(e.openBlock(),e.createElementBlock("path",{stroke:t.value.style.chart.backgroundColor,d:l.arcSlice,fill:"#FFFFFF"},null,8,Me))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(l,u)=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-donut-arc-path",d:l.arcSlice,fill:`${l.color}CC`,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.layout.donut.borderWidth,filter:P(u)},null,8,Xe))),256))],64)):(e.openBlock(),e.createElementBlock("circle",{key:1,cx:s.value.width/2,cy:s.value.height/2,r:y.value<=0?10:y.value,fill:t.value.style.chart.backgroundColor,stroke:e.unref(o.adaptColorToBackground)(t.value.style.chart.background)},null,8,Ae)),t.value.style.chart.useGradient?(e.openBlock(),e.createElementBlock("circle",{key:2,cx:s.value.width/2,cy:s.value.height/2,r:y.value<=0?10:y.value,fill:`url(#gradient_${f.value})`},null,8,Ie)):e.createCommentVNode("",!0),d.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(C.value,(l,u)=>(e.openBlock(),e.createElementBlock("path",{"data-cy-donut-trap":"",d:l.arcSlice,fill:b.value===u?"rgba(0,0,0,0.1)":"transparent",onMouseenter:n=>fe({datapoint:l,relativeIndex:u,seriesIndex:l.seriesIndex,show:!0}),onMouseleave:r[0]||(r[0]=n=>{O.value=!1,b.value=null}),onClick:n=>z(l,u)},null,40,qe))),256)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.show?(e.openBlock(),e.createElementBlock("circle",{key:4,cx:s.value.width/2,cy:s.value.height/2,r:y.value-L.value<=0?10:y.value-L.value,fill:t.value.style.chart.backgroundColor},null,8,Re)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.total.show?(e.openBlock(),e.createElementBlock("text",{key:5,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2-(t.value.style.chart.layout.labels.hollow.average.show?t.value.style.chart.layout.labels.hollow.total.fontSize:0)+t.value.style.chart.layout.labels.hollow.total.offsetY,fill:t.value.style.chart.layout.labels.hollow.total.color,"font-size":t.value.style.chart.layout.labels.hollow.total.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.total.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.layout.labels.hollow.total.text),13,Ge)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.total.show?(e.openBlock(),e.createElementBlock("text",{key:6,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2+t.value.style.chart.layout.labels.hollow.total.fontSize-(t.value.style.chart.layout.labels.hollow.average.show?t.value.style.chart.layout.labels.hollow.total.fontSize:0)+t.value.style.chart.layout.labels.hollow.total.value.offsetY,fill:t.value.style.chart.layout.labels.hollow.total.value.color,"font-size":t.value.style.chart.layout.labels.hollow.total.value.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.total.value.bold?"bold":""}`)},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.hollow.total.value.formatter,d.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.labels.hollow.total.value.prefix,v:d.value,s:t.value.style.chart.layout.labels.hollow.total.value.suffix}))),13,Ye)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.average.show?(e.openBlock(),e.createElementBlock("text",{key:7,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2+(t.value.style.chart.layout.labels.hollow.total.show?t.value.style.chart.layout.labels.hollow.average.fontSize:0)+t.value.style.chart.layout.labels.hollow.average.offsetY,fill:t.value.style.chart.layout.labels.hollow.average.color,"font-size":t.value.style.chart.layout.labels.hollow.average.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.average.bold?"bold":""}`)},e.toDisplayString(t.value.style.chart.layout.labels.hollow.average.text),13,He)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.hollow.average.show?(e.openBlock(),e.createElementBlock("text",{key:8,"text-anchor":"middle",x:s.value.width/2,y:s.value.height/2+(t.value.style.chart.layout.labels.hollow.total.show?t.value.style.chart.layout.labels.hollow.average.fontSize:0)+t.value.style.chart.layout.labels.hollow.average.fontSize+t.value.style.chart.layout.labels.hollow.average.value.offsetY,fill:t.value.style.chart.layout.labels.hollow.average.value.color,"font-size":t.value.style.chart.layout.labels.hollow.average.value.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.hollow.average.value.bold?"bold":""}`)},e.toDisplayString(w.value?"--":e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.hollow.average.value.formatter,Z.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.labels.hollow.average.value.prefix,v:Z.value,s:t.value.style.chart.layout.labels.hollow.average.value.suffix,r:t.value.style.chart.layout.labels.hollow.average.value.rounding}))),13,Ue)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(l,u)=>(e.openBlock(),e.createElementBlock("g",{filter:P(u),class:e.normalizeClass({animated:t.value.useCssAnimation})},[t.value.style.chart.layout.labels.dataLabels.useLabelSlots?(e.openBlock(),e.createElementBlock("g",We,[(e.openBlock(),e.createElementBlock("foreignObject",{x:e.unref(o.calcMarkerOffsetX)(l,!0).anchor==="end"?e.unref(o.calcMarkerOffsetX)(l).x-120:e.unref(o.calcMarkerOffsetX)(l,!0).anchor==="middle"?e.unref(o.calcMarkerOffsetX)(l).x-60:e.unref(o.calcMarkerOffsetX)(l).x,y:e.unref(o.calcMarkerOffsetY)(l)-(te.value?20:0),width:"120",height:"60",style:{overflow:"visible"}},[e.createElementVNode("div",null,[e.renderSlot(a.$slots,"dataLabel",e.normalizeProps(e.guardReactiveProps({datapoint:l,isBlur:!t.value.useBlurOnHover||[null,void 0].includes(b.value)||b.value===u,isSafari:te.value,isVisible:_(l)&&v.value.dataLabels.show,textAlign:e.unref(o.calcMarkerOffsetX)(l,!0,16,!0).anchor,flexAlign:e.unref(o.calcMarkerOffsetX)(l,!0,16).anchor,percentage:Q(l,C.value)})),void 0,!0)])],8,Je))])):(e.openBlock(),e.createElementBlock("g",Ke,[_(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:e.unref(o.calcMarkerOffsetX)(l).x,cy:e.unref(o.calcMarkerOffsetY)(l)-3.5,fill:l.color,r:3,filter:!t.value.useBlurOnHover||[null,void 0].includes(b.value)||b.value===u?"":`url(#blur_${f.value})`,onClick:n=>z(l,u)},null,8,Qe)):e.createCommentVNode("",!0),_(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":e.unref(o.calcMarkerOffsetX)(l,!0,12).anchor,x:e.unref(o.calcMarkerOffsetX)(l,!0,12).x,y:e.unref(o.calcMarkerOffsetY)(l),fill:t.value.style.chart.layout.labels.percentage.color,"font-size":t.value.style.chart.layout.labels.percentage.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.percentage.bold?"bold":""}`),onClick:n=>z(l,u)},e.toDisplayString(Q(l,C.value))+" "+e.toDisplayString(t.value.style.chart.layout.labels.value.show?`(${e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.value.formatter,l.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.value.rounding}),{datapoint:l})})`:""),13,Ze)):e.createCommentVNode("",!0),_(l)&&v.value.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":e.unref(o.calcMarkerOffsetX)(l).anchor,x:e.unref(o.calcMarkerOffsetX)(l,!0,12).x,y:e.unref(o.calcMarkerOffsetY)(l)+t.value.style.chart.layout.labels.percentage.fontSize,fill:t.value.style.chart.layout.labels.name.color,"font-size":t.value.style.chart.layout.labels.name.fontSize,style:e.normalizeStyle(`font-weight:${t.value.style.chart.layout.labels.name.bold?"bold":""}`),onClick:n=>z(l,u)},e.toDisplayString(l.name),13,et)):e.createCommentVNode("",!0)])),v.value.dataLabels.show&&t.value.style.chart.comments.show&&l.comment?(e.openBlock(),e.createElementBlock("g",tt,[_(l)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:t.value.style.chart.comments.offsetX+(e.unref(o.calcMarkerOffsetX)(l,!0).anchor==="end"?e.unref(o.calcMarkerOffsetX)(l).x-t.value.style.chart.comments.width:e.unref(o.calcMarkerOffsetX)(l,!0).anchor==="middle"?e.unref(o.calcMarkerOffsetX)(l).x-t.value.style.chart.comments.width/2:e.unref(o.calcMarkerOffsetX)(l).x),y:e.unref(o.calcMarkerOffsetY)(l)+24+t.value.style.chart.comments.offsetY,width:t.value.style.chart.comments.width,height:"200",style:{overflow:"visible","pointer-events":"none"}},[e.createElementVNode("div",null,[e.renderSlot(a.$slots,"plot-comment",{plot:{...l,textAlign:e.unref(o.calcMarkerOffsetX)(l,!0,16,!0).anchor,flexAlign:e.unref(o.calcMarkerOffsetX)(l,!0,16).anchor}},void 0,!0)])],8,lt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],10,je))),256)),e.renderSlot(a.$slots,"svg",{svg:s.value},void 0,!0)],14,Se)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",at,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(R)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(we.default,{key:4,config:{type:"donut",style:{backgroundColor:t.value.style.chart.backgroundColor,donut:{color:"#CCCCCC",strokeWidth:L.value*.8}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:I},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(ke.Legend,{key:0,legendSet:K.value,config:de.value,onClickMarker:r[1]||(r[1]=({i:l})=>J(l))},{item:e.withCtx(({legend:l,index:u})=>[e.createElementVNode("div",{onClick:n=>l.segregate(),style:e.normalizeStyle(`opacity:${p.value.includes(u)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.value.formatter,l.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,index:u}))+" ",1),p.value.includes(u)?(e.openBlock(),e.createElementBlock("span",ut," ( "+e.toDisplayString(pe(l.proportion*100))+" % ) ",1)):(e.openBlock(),e.createElementBlock("span",rt," ("+e.toDisplayString(isNaN(l.value/d.value)?"-":e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.percentage.formatter,w.value?l.proportion*100:l.value/d.value*100,e.unref(o.dataLabel)({v:w.value?l.proportion*100:l.value/d.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage})))+") ",1))],12,ot)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:K.value},void 0,!0)],512),e.createVNode(ge._sfc_main,{show:v.value.showTooltip&&O.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,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,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:$.value,content:F.value,isCustom:N.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...D.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...D.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),S.value?(e.openBlock(),e.createBlock(Ce.default,{key:5,hideDetails:"",config:{open:v.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(be.DataTable,{colNames:T.value.colNames,head:T.value.head,body:T.value.body,config:T.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[2]||(r[2]=l=>v.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,nt)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name?l.name:isNaN(Number(l))?l.includes("%")?e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.percentage.formatter,l,e.unref(o.dataLabel)({v:l,s:"%",r:t.value.style.chart.layout.labels.percentage.rounding})):l:e.unref(o.applyDataLabel)(t.value.style.chart.layout.labels.value.formatter,l,e.unref(o.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.value.rounding}))),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Be))}},ct=xe._export_sfc(st,[["__scopeId","data-v-8cc49fb9"]]);exports.default=ct;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-Cuc8JBQE.cjs"),me=require("./Title-Du743m6e.cjs"),le=require("./usePrinter-BaExNQdD.cjs"),ge=require("./DataTable-03mHwPdu.cjs"),fe=require("./Legend-rxEBmJRW.cjs"),ke=require("./vue-ui-skeleton-DBlDHYe3.cjs"),pe=require("./Slicer-DUMKJ_f0.cjs"),be=require("./vue-ui-accordion-CX_qmhfk.cjs"),ae=require("./useNestedProp-DZwVoxS3.cjs"),xe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Be=["id"],Ce=["xmlns","viewBox"],_e=["id"],Ee=["stop-color"],Ne=["stop-color"],we=["id"],Le=["stop-color"],Se=["stop-color"],Ve=["stop-color"],$e={key:0},ze=["x1","x2","y1","y2","stroke","stroke-width"],Fe=["x1","x2","y1","y2","stroke","stroke-width"],Ae={key:0},De=["x1","x2","y1","y2","stroke","stroke-width"],Pe=["x1","x2","y1","y2","stroke","stroke-width"],Te=["x","y","font-size","fill","font-weight"],Ie=["text-anchor","font-size","fill","transform"],Oe=["x1","y1","x2","y2","stroke","stroke-width"],Me={key:1},He=["cx","cy","r","fill"],Re={key:0},We={key:0},Ue=["d","stroke"],Xe=["text-anchor","x","y","fill"],qe=["cx","cy","r","fill"],Ge={key:0},Ye=["cx","cy","fill"],je={key:1},Ke=["d","fill","stroke"],Je={key:2},Qe=["d","fill","stroke"],Ze=["x","y","font-size","fill"],et=["x","y","width","fill","onClick"],tt=["x","y","width","height","onMouseenter","onClick"],lt={key:3,"data-cy-zoom":"",class:"vue-ui-donut-evolution-dialog"},at=["x","y","width","height","fill"],ot=["x1","y1","x2","y2","stroke"],ut=["x1","y2","x2","y1","stroke"],rt=["onKeypress","cx","cy","r"],nt=["d","stroke"],st=["cx","cy","r","fill"],ct=["d","fill","stroke"],it={class:"vue-ui-donut-evolution-focus"},dt=["text-anchor","x","y","fill"],vt=["cx","cy","r","fill"],ht=["cx","cy","r","fill"],yt=["x","y","fill"],mt=["x","y","font-size","fill"],gt={key:3,class:"vue-data-ui-watermark"},ft=["onClick"],kt={key:0},pt={key:1},bt={key:0},xt={key:1},Bt={__name:"vue-ui-donut-evolution",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(oe,{expose:ue,emit:M}){const B=oe,{vue_ui_donut_evolution:re}=r.useConfig(),$=e.computed(()=>!!B.dataset&&B.dataset.length),i=e.ref({start:0,end:Math.max(...B.dataset.map(a=>a.values.length))});function ne(){i.value={start:0,end:S.value},W.value+=1}e.onMounted(()=>{r.objectIsEmpty(B.dataset)?r.error({componentName:"VueUiDonutEvolution",type:"dataset"}):B.dataset.length&&B.dataset.forEach((a,c)=>{r.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","values"]}).forEach(l=>{r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:l,index:c})})})});const _=e.ref(r.createUid()),y=e.ref([]),h=e.ref(null),A=e.ref(null),k=e.ref(!1),p=e.ref(null),H=e.ref(null),R=e.ref(0),W=e.ref(0),t=e.computed(()=>{const a=ae.useNestedProp({userConfig:B.config,defaultConfig:re});return a.theme?{...ae.useNestedProp({userConfig:r.themes.vue_ui_donut_evolution[a.theme]||B.config,defaultConfig:a}),customPalette:r.themePalettes[a.theme]||r.palette}:a}),{isPrinting:U,isImaging:X,generatePdf:q,generateImage:G}=le.usePrinter({elementId:_.value,fileName:t.value.style.chart.title.text||"vue-ui-donut-evolution"}),se=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),z=e.ref({showTable:t.value.table.show}),u=e.computed(()=>({top:t.value.style.chart.layout.padding.top,right:t.value.style.chart.layout.padding.right,bottom:t.value.style.chart.layout.padding.bottom,left:t.value.style.chart.layout.padding.left})),n=e.computed(()=>{const a=t.value.style.chart.layout.height,c=t.value.style.chart.layout.width,l=a-u.value.top-u.value.bottom,s=c-u.value.left-u.value.right;return{absoluteHeight:a,absoluteWidth:c,centerX:u.value.left+s/2,centerY:u.value.top+l/2,height:l,width:s}}),C=e.computed(()=>(B.dataset.forEach((a,c)=>{[null,void 0].includes(a.name)&&r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"name",index:c}),[null,void 0].includes(a.values)&&r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"values",index:c})}),B.dataset.map((a,c)=>({...a,values:r.sanitizeArray(a.values),color:r.convertColorToHex(a.color)||se.value[c]||r.palette[c]||r.palette[c%r.palette.length],length:(a.values||[]).length,uid:r.createUid()})))),L=e.computed(()=>C.value.filter(a=>!y.value.includes(a.uid)).map(a=>({...a,values:a.values.filter((c,l)=>l>=i.value.start&&l<=i.value.end)}))),S=e.computed(()=>Math.max(...L.value.map(a=>a.length))),g=e.computed(()=>n.value.width/(i.value.end-i.value.start)),m=e.computed(()=>{const a=[];for(let o=0;o<i.value.end-i.value.start;o+=1){const v=L.value.map(x=>x.values[o]??null),d=v.filter(x=>[void 0,null].includes(x)).length===v.length,b=v.reduce((x,f)=>x+f,0),O=v.map(x=>x/b),w=u.value.left+g.value*o+g.value/2;a.push({index:o,percentages:O,subtotal:d||b<0?null:b,values:v,x:w})}const c=0,l=Math.max(...a.map(o=>o.subtotal)),s=a.length===1?l*2:l;return a.map((o,v)=>{const d=g.value/2*.7,b=d>n.value.width/16?n.value.width/16:d,O=h.value===o.index?n.value.width/16:b,w=a.length>4?d*2:d*2>g.value/2*.7?g.value/2*.7:d*2,x=n.value.absoluteHeight-u.value.bottom-n.value.height*o.subtotal/r.calculateNiceScale(c,s,t.value.style.chart.layout.grid.yAxis.dataLabels.steps).max;return{...o,y:x,radius:b,activeRadius:O,hoverRadius:w,donut:r.makeDonut({series:L.value.map((f,te)=>({color:f.color,name:f.name,value:f.values[v]??0}))},o.x,x,b,b,1.99999,2,1,360,105.25,b/2),donutHover:r.makeDonut({series:L.value.map((f,te)=>({color:f.color,name:f.name,value:f.values[v]??0}))},o.x,x,w,w,1.99999,2,1,360,105.25,w/2),donutFocus:r.makeDonut({series:L.value.map((f,te)=>({color:f.color,name:f.name,value:f.values[v]??0}))},n.value.centerX,n.value.centerY,n.value.height/3.6,n.value.height/3.6,1.99999,2,1,360,105.25,n.value.height/6)}})});function F(a,c,l){return r.applyDataLabel(t.value.style.chart.layout.dataLabels.formatter,a,r.dataLabel({p:t.value.style.chart.layout.dataLabels.prefix,v:a,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.layout.dataLabels.rounding}),{datapoint:c,index:l})}const D=e.computed(()=>({max:Math.max(...m.value.map(a=>a.subtotal)),min:0})),E=e.computed(()=>{const a=m.value.length===1?D.value.max*2:D.value.max;return r.calculateNiceScale(D.value.min,a,t.value.style.chart.layout.grid.yAxis.dataLabels.steps)});function ce(a){return a/E.value.max}const ie=e.computed(()=>E.value.ticks.map(a=>({y:n.value.absoluteHeight-u.value.bottom-n.value.height*ce(a),value:a})));function Y(a,c){return isNaN(a.value/r.sumByAttribute(c,"value"))?0:(a.value/r.sumByAttribute(c,"value")*100).toFixed(0)+"%"}function j(){k.value||(h.value=null,A.value=null)}function de(a){k.value||(h.value=a.index,A.value=a)}const P=e.ref(null);function T(a,c){a.subtotal&&(A.value=null,h.value=null,k.value=!0,p.value=a,[null,void 0].includes(c)||(P.value=c))}function K(){p.value=null,k.value=!1,P.value=null}const J=e.computed(()=>C.value.map((a,c)=>({name:a.name,value:a.values.slice(i.value.start,i.value.end).reduce((l,s)=>l+s,0),shape:"circle",uid:a.uid,color:a.color})).sort((a,c)=>c.value-a.value).map(a=>({...a,opacity:y.value.includes(a.uid)?.5:1,segregate:()=>I(a.uid),isSegregated:y.value.includes(a.uid)}))),Q=e.computed(()=>m.value.map(a=>a.subtotal).reduce((a,c)=>a+c,0)),ve=e.computed(()=>({cy:"donut-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":""}));function I(a){if(y.value.includes(a))y.value=y.value.filter(c=>c!==a),M("selectLegend",null);else{if(y.value.length===C.value.length-1)return;y.value.push(a),M("selectLegend",C.value.find(c=>c.uid===a))}p.value&&T(m.value.find((c,l)=>l===P.value))}const N=e.computed(()=>{const a=[""].concat(C.value.filter(o=>!y.value.includes(o.uid)).map(o=>({name:o.name,color:o.color}))).concat(["Σ"]);let c=[];for(let o=0;o<S.value;o+=1){const v=C.value.filter(d=>!y.value.includes(d.uid)).map(d=>d.values[o]??0).reduce((d,b)=>d+b,0);c.push([t.value.style.chart.layout.grid.xAxis.dataLabels.values[o]??"-"].concat(C.value.filter(d=>!y.value.includes(d.uid)).map(d=>({value:d.values[o]??0,percentage:d.values[o]?d.values[o]/v*100:0}))).concat([`${t.value.style.chart.layout.dataLabels.prefix}${Number(v.toFixed(t.value.table.td.roundingValue))}${t.value.style.chart.layout.dataLabels.suffix}`]))}const 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},s=[t.value.table.columnNames.period].concat(C.value.filter(o=>!y.value.includes(o.uid)).map(o=>o.name)).concat(t.value.table.columnNames.total);return{head:a,body:c,config:l,colNames:s}});function he(){return C.value}function Z(){e.nextTick(()=>{const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],c=[...N.value.head.map(v=>v.name??v)],l=[...N.value.body.map(v=>v.map(d=>d.value??d))],s=a.concat([c]).concat(l),o=r.createCsvContent(s);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-donut-evolution"})})}const V=e.ref(!1);function ye(a){V.value=a,R.value+=1}function ee(){z.value.showTable=!z.value.showTable}return ue({getData:he,generatePdf:q,generateCsv:Z,generateImage:G,toggleTable:ee}),(a,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"donutEvolutionChart",ref:H,class:e.normalizeClass(`vue-ui-donut-evolution ${V.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:_.value},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`),onMouseleave:j},[e.createVNode(me._sfc_main,{config:{title:{cy:"donut-evolution-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-evolution-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],36)):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value?(e.openBlock(),e.createBlock(le.UserOptions,{ref:"details",key:`user_options_${R.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(U),isImaging:e.unref(X),uid:_.value,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:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:H.value,onToggleFullscreen:ye,onGeneratePdf:e.unref(q),onGenerateCsv:Z,onGenerateImage:e.unref(G),onToggleTable:ee},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:s})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:s})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${n.value.absoluteWidth} ${n.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`hover_${_.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(r.opacity)[t.value.style.chart.layout.highlighter.opacity]}`},null,8,Ee),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.chart.layout.highlighter.color}${e.unref(r.opacity)[t.value.style.chart.layout.highlighter.opacity]}`},null,8,Ne)],8,_e),e.createElementVNode("radialGradient",{id:`focus_${_.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(r.convertColorToHex)(t.value.style.chart.backgroundColor)}00`},null,8,Le),e.createElementVNode("stop",{offset:"77%","stop-color":"#FFFFFF"+e.unref(r.opacity)[30]},null,8,Se),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(r.convertColorToHex)(t.value.style.chart.backgroundColor)}00`},null,8,Ve)],8,we)]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",$e,[e.createElementVNode("line",{x1:u.value.left,x2:u.value.left,y1:u.value.top,y2:u.value.top+n.value.height,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,ze),e.createElementVNode("line",{x1:u.value.left,x2:n.value.absoluteWidth-u.value.right,y1:n.value.absoluteHeight-u.value.bottom,y2:n.value.absoluteHeight-u.value.bottom,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Fe),t.value.style.chart.layout.grid.showVerticalLines?(e.openBlock(),e.createElementBlock("g",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.end-i.value.start,(l,s)=>(e.openBlock(),e.createElementBlock("line",{x1:u.value.left+(s+1)*g.value,x2:u.value.left+(s+1)*g.value,y1:u.value.top,y2:n.value.absoluteHeight-u.value.bottom,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,De))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.layout.grid.yAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:1,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":h.value!==null||k.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.value>=E.value.min&&l.value<=E.value.max?(e.openBlock(),e.createElementBlock("line",{key:0,x1:u.value.left,x2:u.value.left-5,y1:l.y,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,Pe)):e.createCommentVNode("",!0),l.value>=E.value.min&&l.value<=E.value.max?(e.openBlock(),e.createElementBlock("text",{key:1,x:u.value.left-8+t.value.style.chart.layout.grid.yAxis.dataLabels.offsetX,y:l.y+t.value.style.chart.layout.grid.yAxis.dataLabels.fontSize/3,"font-size":t.value.style.chart.layout.grid.yAxis.dataLabels.fontSize,"text-anchor":"end",fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-weight":t.value.style.chart.layout.grid.yAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(e.unref(r.canShowValue)(l.value)?e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.layout.grid.yAxis.dataLabels.roundingValue}),{datapoint:l,seriesIndex:s}):""),9,Te)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),t.value.style.chart.layout.grid.xAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:2,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":k.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.end-i.value.start,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast&&(s===0||s===S.value-1)||!t.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":t.value.style.chart.layout.grid.xAxis.dataLabels.rotation>0?"start":t.value.style.chart.layout.grid.xAxis.dataLabels.rotation<0?"end":"middle","font-size":t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize,fill:t.value.style.chart.layout.grid.xAxis.dataLabels.color,transform:`translate(${u.value.left+g.value*s+g.value/2}, ${t.value.style.chart.layout.grid.xAxis.dataLabels.offsetY+n.value.absoluteHeight-u.value.bottom+t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*2}), rotate(${t.value.style.chart.layout.grid.xAxis.dataLabels.rotation})`},e.toDisplayString(t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(s)+Number(i.value.start)]??""),9,Ie)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.line.show&&s<m.value.length-1&&![l.subtotal,m.value[s+1].subtotal].includes(null)?(e.openBlock(),e.createElementBlock("line",{key:0,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":h.value!==null||k.value}),x1:l.x,y1:l.y,x2:m.value[s+1].x,y2:m.value[s+1].y,stroke:t.value.style.chart.layout.line.stroke,"stroke-width":t.value.style.chart.layout.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,10,Oe)):e.createCommentVNode("",!0),l.subtotal!==null?(e.openBlock(),e.createElementBlock("g",Me,[l.subtotal?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x,cy:l.y,r:l.activeRadius,fill:t.value.style.chart.backgroundColor},null,8,He)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":s!==h.value&&h.value!==null||k.value})},[l.subtotal?(e.openBlock(),e.createElementBlock("g",Re,[h.value!==null&&h.value===s?(e.openBlock(),e.createElementBlock("g",We,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,o=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{d:e.unref(r.calcNutArrowPath)(o,{x:o.center.endX,y:o.center.endY},12,12,{x:l.x,y:l.y},!0),stroke:o.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,Ue)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,(o,v)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{"data-cy-hover-label":"","text-anchor":e.unref(r.calcMarkerOffsetX)(o,!0,0).anchor,x:e.unref(r.calcMarkerOffsetX)(o,!0,3).x,y:e.unref(r.calcMarkerOffsetY)(o),fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-size":8,"font-weight":"bold"},e.toDisplayString(o.name)+": "+e.toDisplayString(Y(o,l.donut))+" ("+e.toDisplayString(o.value===null?"-":F(o.value,o,v))+") ",9,Xe)]))),256)),e.createElementVNode("g",null,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:l.hoverRadius,fill:t.value.style.chart.backgroundColor},null,8,qe)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":s!==h.value&&h.value!==null||k.value})},[l.subtotal!==null?(e.openBlock(),e.createElementBlock("g",Ge,[l.subtotal===0?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x,cy:l.y,r:3,fill:t.value.style.chart.color},null,8,Ye)):h.value!==null&&h.value===s?(e.openBlock(),e.createElementBlock("g",je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,(o,v)=>(e.openBlock(),e.createElementBlock("path",{d:o.arcSlice,fill:`${o.color}`,"stroke-width":1,stroke:t.value.style.chart.backgroundColor},null,8,Ke))),256))])):(e.openBlock(),e.createElementBlock("g",Je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donut,(o,v)=>(e.openBlock(),e.createElementBlock("path",{d:o.arcSlice,fill:`${o.color}`,"stroke-width":.5,stroke:t.value.style.chart.backgroundColor},null,8,Qe))),256))]))])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":s!==h.value&&h.value!==null||k.value})},[l.subtotal!==null&&t.value.style.chart.layout.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",x:l.x,y:h.value===l.index&&l.subtotal?l.y+t.value.style.chart.layout.dataLabels.fontSize/3:l.y-l.radius-t.value.style.chart.layout.dataLabels.fontSize+t.value.style.chart.layout.dataLabels.offsetY,"font-size":t.value.style.chart.layout.dataLabels.fontSize,"font-weight":"bold",fill:t.value.style.chart.layout.dataLabels.color},e.toDisplayString(F(l.subtotal,l,s)),9,Ze)):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("rect",{x:u.value.left+s*g.value,y:n.value.absoluteHeight-u.value.bottom-10,width:g.value,height:10,fill:h.value===l.index?`url(#hover_${_.value})`:"transparent",onClick:o=>T(l,s),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,10,et))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("rect",{"data-cy-trap":"",x:u.value.left+s*g.value,y:u.value.top,width:g.value,height:n.value.height,fill:"transparent",onMouseenter:o=>de(l),onMouseleave:j,onClick:o=>T(l,s),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,42,tt))),256)),k.value?(e.openBlock(),e.createElementBlock("g",lt,[e.createElementVNode("rect",{rx:4,x:u.value.left,y:u.value.top,width:n.value.width,height:n.value.height,fill:t.value.style.chart.backgroundColor,style:{filter:"drop-shadow(0 12px 12px rgba(0,0,0,0.3))"}},null,8,at),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:n.value.absoluteWidth-u.value.right-15,y1:u.value.top+5,x2:n.value.absoluteWidth-u.value.right-4,y2:u.value.top+15.5,"stroke-linecap":"round",stroke:t.value.style.chart.color,"stroke-width":"1.5"},null,8,ot),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:n.value.absoluteWidth-u.value.right-15,y2:u.value.top+5,x2:n.value.absoluteWidth-u.value.right-4,y1:u.value.top+15.5,"stroke-linecap":"round",stroke:t.value.style.chart.color,"stroke-width":"1.5"},null,8,ut),e.createElementVNode("circle",{"data-cy-close":"",onClick:K,onKeypress:e.withKeys(K,["enter"]),cx:n.value.absoluteWidth-u.value.right-n.value.width/40,cy:u.value.top+n.value.height/30,r:n.value.height/12,fill:"transparent",style:{cursor:"pointer"},tabindex:"0"},null,40,rt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value.donutFocus,l=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{"data-cy-zoom-donut":"",d:e.unref(r.calcNutArrowPath)(l,{x:n.value.centerX,y:n.value.centerY},12,12,!1,!1,1),stroke:l.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",class:"vue-ui-donut-evolution-focus"},null,8,nt)]))),256)),e.createElementVNode("circle",{cx:u.value.left+n.value.width/2,cy:u.value.top+n.value.height/2,r:n.value.height/7,fill:t.value.style.chart.backgroundColor},null,8,st),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value.donutFocus,(l,s)=>(e.openBlock(),e.createElementBlock("path",{d:l.arcSlice,fill:`${l.color}`,"stroke-width":1,stroke:t.value.style.chart.backgroundColor,class:"vue-ui-donut-evolution-focus"},null,8,ct))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value.donutFocus,(l,s)=>(e.openBlock(),e.createElementBlock("g",it,[e.createElementVNode("text",{"text-anchor":e.unref(r.calcMarkerOffsetX)(l,!0,20).anchor,x:e.unref(r.calcMarkerOffsetX)(l,!0,10).x,y:e.unref(r.calcMarkerOffsetY)(l),fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-size":10,"font-weight":"bold"},e.toDisplayString(l.name)+": "+e.toDisplayString(Y(l,p.value.donutFocus))+" ("+e.toDisplayString(l.value===null?"-":F(l.value,l,s))+") ",9,dt)]))),256)),e.createElementVNode("circle",{cx:u.value.left+n.value.width/2,cy:u.value.top+n.value.height/2,r:n.value.height/3.8,fill:`url(#focus_${_.value})`},null,8,vt),e.createElementVNode("circle",{cx:u.value.left+n.value.width/2,cy:u.value.top+n.value.height/2,r:n.value.height/7.7,fill:t.value.style.chart.backgroundColor},null,8,ht),e.createElementVNode("text",{"text-anchor":"middle",x:u.value.left+n.value.width/2,y:u.value.top+n.value.height/2+14/3,"font-size":14,"font-weight":"bold",fill:t.value.style.chart.layout.dataLabels.color,class:"vue-ui-donut-evolution-focus"},e.toDisplayString(F(p.value.subtotal,p.value,a.i)),9,yt),t.value.style.chart.layout.grid.xAxis.dataLabels.values[p.value.index]?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.value.left+6,y:u.value.top+t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*2,"font-size":t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*1.6,fill:t.value.style.chart.layout.dataLabels.color},e.toDisplayString(t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(p.value.index)+Number(i.value.start)]),9,mt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:n.value},void 0,!0)],14,Ce)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",gt,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(X)})),void 0,!0)])):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:4,config:{type:"donutEvolution",style:{backgroundColor:t.value.style.chart.backgroundColor,donutEvolution:{axis:{color:"#CCCCCC"},donuts:{color:"#CCCCCC"}}}}},null,8,["config"])),S.value>1&&t.value.style.chart.zoom.show?(e.openBlock(),e.createBlock(pe.Slicer,{key:`slicer_${W.value}`,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,fontSize:t.value.style.chart.zoom.fontSize,useResetSlot:t.value.style.chart.zoom.useResetSlot,labelLeft:t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(i.value.start)]||"",labelRight:t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(i.value.end)-1]||"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:S.value,min:0,valueStart:i.value.start,valueEnd:i.value.end,start:i.value.start,"onUpdate:start":c[0]||(c[0]=l=>i.value.start=l),end:i.value.end,"onUpdate:end":c[1]||(c[1]=l=>i.value.end=l),onReset:ne},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(a.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end"])):e.createCommentVNode("",!0),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(fe.Legend,{key:6,legendSet:J.value,config:ve.value,onClickMarker:c[2]||(c[2]=({legend:l})=>I(l.uid))},{item:e.withCtx(({legend:l,index:s})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:o=>I(l.uid),style:e.normalizeStyle(`opacity:${y.value.includes(l.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:s}))+" ",1),y.value.includes(l.uid)?(e.openBlock(),e.createElementBlock("span",pt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",kt," ("+e.toDisplayString(isNaN(l.value/Q.value)?"-":e.unref(r.dataLabel)({v:l.value/Q.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,ft)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:J.value},void 0,!0),$.value?(e.openBlock(),e.createBlock(be.default,{key:7,hideDetails:"",config:{open:z.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ge.DataTable,{colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:c[3]||(c[3]=l=>z.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name??l),1)]),td:e.withCtx(({td:l})=>[l.value===null?(e.openBlock(),e.createElementBlock("span",bt,"-")):(e.openBlock(),e.createElementBlock("b",xt,e.toDisplayString(isNaN(l.value)?"":t.value.style.chart.layout.dataLabels.prefix)+e.toDisplayString(!isNaN(l.value)&&l.value!==null?Number(l.value.toFixed(t.value.table.td.roundingValue)).toLocaleString():l)+e.toDisplayString(isNaN(l.value)?"":t.value.style.chart.layout.dataLabels.suffix),1)),e.createElementVNode("span",null,e.toDisplayString(l.percentage&&!isNaN(l.percentage)?`(${Number(l.percentage.toFixed(t.value.table.td.roundingPercentage)).toLocaleString()}%)`:""),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Be))}},Ct=xe._export_sfc(Bt,[["__scopeId","data-v-29ce04eb"]]);exports.default=Ct;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-sFjJ2dIj.cjs"),me=require("./Title-CujodUjt.cjs"),le=require("./usePrinter-DSMMs1w9.cjs"),ge=require("./DataTable-wmKwMbsJ.cjs"),fe=require("./Legend-DdndVhHV.cjs"),ke=require("./vue-ui-skeleton-CqF0NJ4g.cjs"),pe=require("./Slicer-Dts-BToH.cjs"),be=require("./vue-ui-accordion-RuCkf_li.cjs"),ae=require("./useNestedProp-ir0jEo5M.cjs"),xe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Be=["id"],Ce=["xmlns","viewBox"],_e=["id"],Ee=["stop-color"],Ne=["stop-color"],we=["id"],Le=["stop-color"],Se=["stop-color"],Ve=["stop-color"],$e={key:0},ze=["x1","x2","y1","y2","stroke","stroke-width"],Fe=["x1","x2","y1","y2","stroke","stroke-width"],Ae={key:0},De=["x1","x2","y1","y2","stroke","stroke-width"],Pe=["x1","x2","y1","y2","stroke","stroke-width"],Te=["x","y","font-size","fill","font-weight"],Ie=["text-anchor","font-size","fill","transform"],Oe=["x1","y1","x2","y2","stroke","stroke-width"],Me={key:1},He=["cx","cy","r","fill"],Re={key:0},We={key:0},Ue=["d","stroke"],Xe=["text-anchor","x","y","fill"],qe=["cx","cy","r","fill"],Ge={key:0},Ye=["cx","cy","fill"],je={key:1},Ke=["d","fill","stroke"],Je={key:2},Qe=["d","fill","stroke"],Ze=["x","y","font-size","fill"],et=["x","y","width","fill","onClick"],tt=["x","y","width","height","onMouseenter","onClick"],lt={key:3,"data-cy-zoom":"",class:"vue-ui-donut-evolution-dialog"},at=["x","y","width","height","fill"],ot=["x1","y1","x2","y2","stroke"],ut=["x1","y2","x2","y1","stroke"],rt=["onKeypress","cx","cy","r"],nt=["d","stroke"],st=["cx","cy","r","fill"],ct=["d","fill","stroke"],it={class:"vue-ui-donut-evolution-focus"},dt=["text-anchor","x","y","fill"],vt=["cx","cy","r","fill"],ht=["cx","cy","r","fill"],yt=["x","y","fill"],mt=["x","y","font-size","fill"],gt={key:3,class:"vue-data-ui-watermark"},ft=["onClick"],kt={key:0},pt={key:1},bt={key:0},xt={key:1},Bt={__name:"vue-ui-donut-evolution",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(oe,{expose:ue,emit:M}){const B=oe,{vue_ui_donut_evolution:re}=r.useConfig(),$=e.computed(()=>!!B.dataset&&B.dataset.length),i=e.ref({start:0,end:Math.max(...B.dataset.map(a=>a.values.length))});function ne(){i.value={start:0,end:S.value},W.value+=1}e.onMounted(()=>{r.objectIsEmpty(B.dataset)?r.error({componentName:"VueUiDonutEvolution",type:"dataset"}):B.dataset.length&&B.dataset.forEach((a,c)=>{r.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","values"]}).forEach(l=>{r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:l,index:c})})})});const _=e.ref(r.createUid()),y=e.ref([]),h=e.ref(null),A=e.ref(null),k=e.ref(!1),p=e.ref(null),H=e.ref(null),R=e.ref(0),W=e.ref(0),t=e.computed(()=>{const a=ae.useNestedProp({userConfig:B.config,defaultConfig:re});return a.theme?{...ae.useNestedProp({userConfig:r.themes.vue_ui_donut_evolution[a.theme]||B.config,defaultConfig:a}),customPalette:r.themePalettes[a.theme]||r.palette}:a}),{isPrinting:U,isImaging:X,generatePdf:q,generateImage:G}=le.usePrinter({elementId:_.value,fileName:t.value.style.chart.title.text||"vue-ui-donut-evolution"}),se=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),z=e.ref({showTable:t.value.table.show}),u=e.computed(()=>({top:t.value.style.chart.layout.padding.top,right:t.value.style.chart.layout.padding.right,bottom:t.value.style.chart.layout.padding.bottom,left:t.value.style.chart.layout.padding.left})),n=e.computed(()=>{const a=t.value.style.chart.layout.height,c=t.value.style.chart.layout.width,l=a-u.value.top-u.value.bottom,s=c-u.value.left-u.value.right;return{absoluteHeight:a,absoluteWidth:c,centerX:u.value.left+s/2,centerY:u.value.top+l/2,height:l,width:s}}),C=e.computed(()=>(B.dataset.forEach((a,c)=>{[null,void 0].includes(a.name)&&r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"name",index:c}),[null,void 0].includes(a.values)&&r.error({componentName:"VueUiDonutEvolution",type:"datasetSerieAttribute",property:"values",index:c})}),B.dataset.map((a,c)=>({...a,values:r.sanitizeArray(a.values),color:r.convertColorToHex(a.color)||se.value[c]||r.palette[c]||r.palette[c%r.palette.length],length:(a.values||[]).length,uid:r.createUid()})))),L=e.computed(()=>C.value.filter(a=>!y.value.includes(a.uid)).map(a=>({...a,values:a.values.filter((c,l)=>l>=i.value.start&&l<=i.value.end)}))),S=e.computed(()=>Math.max(...L.value.map(a=>a.length))),g=e.computed(()=>n.value.width/(i.value.end-i.value.start)),m=e.computed(()=>{const a=[];for(let o=0;o<i.value.end-i.value.start;o+=1){const v=L.value.map(x=>x.values[o]??null),d=v.filter(x=>[void 0,null].includes(x)).length===v.length,b=v.reduce((x,f)=>x+f,0),O=v.map(x=>x/b),w=u.value.left+g.value*o+g.value/2;a.push({index:o,percentages:O,subtotal:d||b<0?null:b,values:v,x:w})}const c=0,l=Math.max(...a.map(o=>o.subtotal)),s=a.length===1?l*2:l;return a.map((o,v)=>{const d=g.value/2*.7,b=d>n.value.width/16?n.value.width/16:d,O=h.value===o.index?n.value.width/16:b,w=a.length>4?d*2:d*2>g.value/2*.7?g.value/2*.7:d*2,x=n.value.absoluteHeight-u.value.bottom-n.value.height*o.subtotal/r.calculateNiceScale(c,s,t.value.style.chart.layout.grid.yAxis.dataLabels.steps).max;return{...o,y:x,radius:b,activeRadius:O,hoverRadius:w,donut:r.makeDonut({series:L.value.map((f,te)=>({color:f.color,name:f.name,value:f.values[v]??0}))},o.x,x,b,b,1.99999,2,1,360,105.25,b/2),donutHover:r.makeDonut({series:L.value.map((f,te)=>({color:f.color,name:f.name,value:f.values[v]??0}))},o.x,x,w,w,1.99999,2,1,360,105.25,w/2),donutFocus:r.makeDonut({series:L.value.map((f,te)=>({color:f.color,name:f.name,value:f.values[v]??0}))},n.value.centerX,n.value.centerY,n.value.height/3.6,n.value.height/3.6,1.99999,2,1,360,105.25,n.value.height/6)}})});function F(a,c,l){return r.applyDataLabel(t.value.style.chart.layout.dataLabels.formatter,a,r.dataLabel({p:t.value.style.chart.layout.dataLabels.prefix,v:a,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.layout.dataLabels.rounding}),{datapoint:c,index:l})}const D=e.computed(()=>({max:Math.max(...m.value.map(a=>a.subtotal)),min:0})),E=e.computed(()=>{const a=m.value.length===1?D.value.max*2:D.value.max;return r.calculateNiceScale(D.value.min,a,t.value.style.chart.layout.grid.yAxis.dataLabels.steps)});function ce(a){return a/E.value.max}const ie=e.computed(()=>E.value.ticks.map(a=>({y:n.value.absoluteHeight-u.value.bottom-n.value.height*ce(a),value:a})));function Y(a,c){return isNaN(a.value/r.sumByAttribute(c,"value"))?0:(a.value/r.sumByAttribute(c,"value")*100).toFixed(0)+"%"}function j(){k.value||(h.value=null,A.value=null)}function de(a){k.value||(h.value=a.index,A.value=a)}const P=e.ref(null);function T(a,c){a.subtotal&&(A.value=null,h.value=null,k.value=!0,p.value=a,[null,void 0].includes(c)||(P.value=c))}function K(){p.value=null,k.value=!1,P.value=null}const J=e.computed(()=>C.value.map((a,c)=>({name:a.name,value:a.values.slice(i.value.start,i.value.end).reduce((l,s)=>l+s,0),shape:"circle",uid:a.uid,color:a.color})).sort((a,c)=>c.value-a.value).map(a=>({...a,opacity:y.value.includes(a.uid)?.5:1,segregate:()=>I(a.uid),isSegregated:y.value.includes(a.uid)}))),Q=e.computed(()=>m.value.map(a=>a.subtotal).reduce((a,c)=>a+c,0)),ve=e.computed(()=>({cy:"donut-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":""}));function I(a){if(y.value.includes(a))y.value=y.value.filter(c=>c!==a),M("selectLegend",null);else{if(y.value.length===C.value.length-1)return;y.value.push(a),M("selectLegend",C.value.find(c=>c.uid===a))}p.value&&T(m.value.find((c,l)=>l===P.value))}const N=e.computed(()=>{const a=[""].concat(C.value.filter(o=>!y.value.includes(o.uid)).map(o=>({name:o.name,color:o.color}))).concat(["Σ"]);let c=[];for(let o=0;o<S.value;o+=1){const v=C.value.filter(d=>!y.value.includes(d.uid)).map(d=>d.values[o]??0).reduce((d,b)=>d+b,0);c.push([t.value.style.chart.layout.grid.xAxis.dataLabels.values[o]??"-"].concat(C.value.filter(d=>!y.value.includes(d.uid)).map(d=>({value:d.values[o]??0,percentage:d.values[o]?d.values[o]/v*100:0}))).concat([`${t.value.style.chart.layout.dataLabels.prefix}${Number(v.toFixed(t.value.table.td.roundingValue))}${t.value.style.chart.layout.dataLabels.suffix}`]))}const 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},s=[t.value.table.columnNames.period].concat(C.value.filter(o=>!y.value.includes(o.uid)).map(o=>o.name)).concat(t.value.table.columnNames.total);return{head:a,body:c,config:l,colNames:s}});function he(){return C.value}function Z(){e.nextTick(()=>{const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],c=[...N.value.head.map(v=>v.name??v)],l=[...N.value.body.map(v=>v.map(d=>d.value??d))],s=a.concat([c]).concat(l),o=r.createCsvContent(s);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-donut-evolution"})})}const V=e.ref(!1);function ye(a){V.value=a,R.value+=1}function ee(){z.value.showTable=!z.value.showTable}return ue({getData:he,generatePdf:q,generateCsv:Z,generateImage:G,toggleTable:ee}),(a,c)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"donutEvolutionChart",ref:H,class:e.normalizeClass(`vue-ui-donut-evolution ${V.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:_.value},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`),onMouseleave:j},[e.createVNode(me._sfc_main,{config:{title:{cy:"donut-evolution-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-evolution-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],36)):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value?(e.openBlock(),e.createBlock(le.UserOptions,{ref:"details",key:`user_options_${R.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(U),isImaging:e.unref(X),uid:_.value,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:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:H.value,onToggleFullscreen:ye,onGeneratePdf:e.unref(q),onGenerateCsv:Z,onGenerateImage:e.unref(G),onToggleTable:ee},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:s})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:s})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${n.value.absoluteWidth} ${n.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`hover_${_.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${t.value.style.chart.backgroundColor}${e.unref(r.opacity)[t.value.style.chart.layout.highlighter.opacity]}`},null,8,Ee),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.chart.layout.highlighter.color}${e.unref(r.opacity)[t.value.style.chart.layout.highlighter.opacity]}`},null,8,Ne)],8,_e),e.createElementVNode("radialGradient",{id:`focus_${_.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(r.convertColorToHex)(t.value.style.chart.backgroundColor)}00`},null,8,Le),e.createElementVNode("stop",{offset:"77%","stop-color":"#FFFFFF"+e.unref(r.opacity)[30]},null,8,Se),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(r.convertColorToHex)(t.value.style.chart.backgroundColor)}00`},null,8,Ve)],8,we)]),t.value.style.chart.layout.grid.show?(e.openBlock(),e.createElementBlock("g",$e,[e.createElementVNode("line",{x1:u.value.left,x2:u.value.left,y1:u.value.top,y2:u.value.top+n.value.height,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,ze),e.createElementVNode("line",{x1:u.value.left,x2:n.value.absoluteWidth-u.value.right,y1:n.value.absoluteHeight-u.value.bottom,y2:n.value.absoluteHeight-u.value.bottom,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Fe),t.value.style.chart.layout.grid.showVerticalLines?(e.openBlock(),e.createElementBlock("g",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.end-i.value.start,(l,s)=>(e.openBlock(),e.createElementBlock("line",{x1:u.value.left+(s+1)*g.value,x2:u.value.left+(s+1)*g.value,y1:u.value.top,y2:n.value.absoluteHeight-u.value.bottom,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,De))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.layout.grid.yAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:1,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":h.value!==null||k.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[l.value>=E.value.min&&l.value<=E.value.max?(e.openBlock(),e.createElementBlock("line",{key:0,x1:u.value.left,x2:u.value.left-5,y1:l.y,y2:l.y,stroke:t.value.style.chart.layout.grid.stroke,"stroke-width":t.value.style.chart.layout.grid.strokeWidth},null,8,Pe)):e.createCommentVNode("",!0),l.value>=E.value.min&&l.value<=E.value.max?(e.openBlock(),e.createElementBlock("text",{key:1,x:u.value.left-8+t.value.style.chart.layout.grid.yAxis.dataLabels.offsetX,y:l.y+t.value.style.chart.layout.grid.yAxis.dataLabels.fontSize/3,"font-size":t.value.style.chart.layout.grid.yAxis.dataLabels.fontSize,"text-anchor":"end",fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-weight":t.value.style.chart.layout.grid.yAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(e.unref(r.canShowValue)(l.value)?e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.layout.grid.yAxis.dataLabels.roundingValue}),{datapoint:l,seriesIndex:s}):""),9,Te)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),t.value.style.chart.layout.grid.xAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",{key:2,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":k.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value.end-i.value.start,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast&&(s===0||s===S.value-1)||!t.value.style.chart.layout.grid.xAxis.dataLabels.showOnlyFirstAndLast?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":t.value.style.chart.layout.grid.xAxis.dataLabels.rotation>0?"start":t.value.style.chart.layout.grid.xAxis.dataLabels.rotation<0?"end":"middle","font-size":t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize,fill:t.value.style.chart.layout.grid.xAxis.dataLabels.color,transform:`translate(${u.value.left+g.value*s+g.value/2}, ${t.value.style.chart.layout.grid.xAxis.dataLabels.offsetY+n.value.absoluteHeight-u.value.bottom+t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*2}), rotate(${t.value.style.chart.layout.grid.xAxis.dataLabels.rotation})`},e.toDisplayString(t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(s)+Number(i.value.start)]??""),9,Ie)):e.createCommentVNode("",!0)]))),256))],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.line.show&&s<m.value.length-1&&![l.subtotal,m.value[s+1].subtotal].includes(null)?(e.openBlock(),e.createElementBlock("line",{key:0,class:e.normalizeClass({"donut-opacity":!0,"donut-behind":h.value!==null||k.value}),x1:l.x,y1:l.y,x2:m.value[s+1].x,y2:m.value[s+1].y,stroke:t.value.style.chart.layout.line.stroke,"stroke-width":t.value.style.chart.layout.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,10,Oe)):e.createCommentVNode("",!0),l.subtotal!==null?(e.openBlock(),e.createElementBlock("g",Me,[l.subtotal?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x,cy:l.y,r:l.activeRadius,fill:t.value.style.chart.backgroundColor},null,8,He)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":s!==h.value&&h.value!==null||k.value})},[l.subtotal?(e.openBlock(),e.createElementBlock("g",Re,[h.value!==null&&h.value===s?(e.openBlock(),e.createElementBlock("g",We,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,o=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{d:e.unref(r.calcNutArrowPath)(o,{x:o.center.endX,y:o.center.endY},12,12,{x:l.x,y:l.y},!0),stroke:o.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,Ue)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,(o,v)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{"data-cy-hover-label":"","text-anchor":e.unref(r.calcMarkerOffsetX)(o,!0,0).anchor,x:e.unref(r.calcMarkerOffsetX)(o,!0,3).x,y:e.unref(r.calcMarkerOffsetY)(o),fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-size":8,"font-weight":"bold"},e.toDisplayString(o.name)+": "+e.toDisplayString(Y(o,l.donut))+" ("+e.toDisplayString(o.value===null?"-":F(o.value,o,v))+") ",9,Xe)]))),256)),e.createElementVNode("g",null,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:l.hoverRadius,fill:t.value.style.chart.backgroundColor},null,8,qe)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":s!==h.value&&h.value!==null||k.value})},[l.subtotal!==null?(e.openBlock(),e.createElementBlock("g",Ge,[l.subtotal===0?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x,cy:l.y,r:3,fill:t.value.style.chart.color},null,8,Ye)):h.value!==null&&h.value===s?(e.openBlock(),e.createElementBlock("g",je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donutHover,(o,v)=>(e.openBlock(),e.createElementBlock("path",{d:o.arcSlice,fill:`${o.color}`,"stroke-width":1,stroke:t.value.style.chart.backgroundColor},null,8,Ke))),256))])):(e.openBlock(),e.createElementBlock("g",Je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.donut,(o,v)=>(e.openBlock(),e.createElementBlock("path",{d:o.arcSlice,fill:`${o.color}`,"stroke-width":.5,stroke:t.value.style.chart.backgroundColor},null,8,Qe))),256))]))])):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass({"donut-opacity":!0,"donut-behind":s!==h.value&&h.value!==null||k.value})},[l.subtotal!==null&&t.value.style.chart.layout.dataLabels.show?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",x:l.x,y:h.value===l.index&&l.subtotal?l.y+t.value.style.chart.layout.dataLabels.fontSize/3:l.y-l.radius-t.value.style.chart.layout.dataLabels.fontSize+t.value.style.chart.layout.dataLabels.offsetY,"font-size":t.value.style.chart.layout.dataLabels.fontSize,"font-weight":"bold",fill:t.value.style.chart.layout.dataLabels.color},e.toDisplayString(F(l.subtotal,l,s)),9,Ze)):e.createCommentVNode("",!0)],2))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("rect",{x:u.value.left+s*g.value,y:n.value.absoluteHeight-u.value.bottom-10,width:g.value,height:10,fill:h.value===l.index?`url(#hover_${_.value})`:"transparent",onClick:o=>T(l,s),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,10,et))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,s)=>(e.openBlock(),e.createElementBlock("rect",{"data-cy-trap":"",x:u.value.left+s*g.value,y:u.value.top,width:g.value,height:n.value.height,fill:"transparent",onMouseenter:o=>de(l),onMouseleave:j,onClick:o=>T(l,s),class:e.normalizeClass({"donut-hover":h.value===l.index&&l.subtotal})},null,42,tt))),256)),k.value?(e.openBlock(),e.createElementBlock("g",lt,[e.createElementVNode("rect",{rx:4,x:u.value.left,y:u.value.top,width:n.value.width,height:n.value.height,fill:t.value.style.chart.backgroundColor,style:{filter:"drop-shadow(0 12px 12px rgba(0,0,0,0.3))"}},null,8,at),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:n.value.absoluteWidth-u.value.right-15,y1:u.value.top+5,x2:n.value.absoluteWidth-u.value.right-4,y2:u.value.top+15.5,"stroke-linecap":"round",stroke:t.value.style.chart.color,"stroke-width":"1.5"},null,8,ot),e.createElementVNode("line",{"data-html2canvas-ignore":"",x1:n.value.absoluteWidth-u.value.right-15,y2:u.value.top+5,x2:n.value.absoluteWidth-u.value.right-4,y1:u.value.top+15.5,"stroke-linecap":"round",stroke:t.value.style.chart.color,"stroke-width":"1.5"},null,8,ut),e.createElementVNode("circle",{"data-cy-close":"",onClick:K,onKeypress:e.withKeys(K,["enter"]),cx:n.value.absoluteWidth-u.value.right-n.value.width/40,cy:u.value.top+n.value.height/30,r:n.value.height/12,fill:"transparent",style:{cursor:"pointer"},tabindex:"0"},null,40,rt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value.donutFocus,l=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("path",{"data-cy-zoom-donut":"",d:e.unref(r.calcNutArrowPath)(l,{x:n.value.centerX,y:n.value.centerY},12,12,!1,!1,1),stroke:l.color,"stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",class:"vue-ui-donut-evolution-focus"},null,8,nt)]))),256)),e.createElementVNode("circle",{cx:u.value.left+n.value.width/2,cy:u.value.top+n.value.height/2,r:n.value.height/7,fill:t.value.style.chart.backgroundColor},null,8,st),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value.donutFocus,(l,s)=>(e.openBlock(),e.createElementBlock("path",{d:l.arcSlice,fill:`${l.color}`,"stroke-width":1,stroke:t.value.style.chart.backgroundColor,class:"vue-ui-donut-evolution-focus"},null,8,ct))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value.donutFocus,(l,s)=>(e.openBlock(),e.createElementBlock("g",it,[e.createElementVNode("text",{"text-anchor":e.unref(r.calcMarkerOffsetX)(l,!0,20).anchor,x:e.unref(r.calcMarkerOffsetX)(l,!0,10).x,y:e.unref(r.calcMarkerOffsetY)(l),fill:t.value.style.chart.layout.grid.yAxis.dataLabels.color,"font-size":10,"font-weight":"bold"},e.toDisplayString(l.name)+": "+e.toDisplayString(Y(l,p.value.donutFocus))+" ("+e.toDisplayString(l.value===null?"-":F(l.value,l,s))+") ",9,dt)]))),256)),e.createElementVNode("circle",{cx:u.value.left+n.value.width/2,cy:u.value.top+n.value.height/2,r:n.value.height/3.8,fill:`url(#focus_${_.value})`},null,8,vt),e.createElementVNode("circle",{cx:u.value.left+n.value.width/2,cy:u.value.top+n.value.height/2,r:n.value.height/7.7,fill:t.value.style.chart.backgroundColor},null,8,ht),e.createElementVNode("text",{"text-anchor":"middle",x:u.value.left+n.value.width/2,y:u.value.top+n.value.height/2+14/3,"font-size":14,"font-weight":"bold",fill:t.value.style.chart.layout.dataLabels.color,class:"vue-ui-donut-evolution-focus"},e.toDisplayString(F(p.value.subtotal,p.value,a.i)),9,yt),t.value.style.chart.layout.grid.xAxis.dataLabels.values[p.value.index]?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.value.left+6,y:u.value.top+t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*2,"font-size":t.value.style.chart.layout.grid.xAxis.dataLabels.fontSize*1.6,fill:t.value.style.chart.layout.dataLabels.color},e.toDisplayString(t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(p.value.index)+Number(i.value.start)]),9,mt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:n.value},void 0,!0)],14,Ce)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",gt,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(X)})),void 0,!0)])):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ke.default,{key:4,config:{type:"donutEvolution",style:{backgroundColor:t.value.style.chart.backgroundColor,donutEvolution:{axis:{color:"#CCCCCC"},donuts:{color:"#CCCCCC"}}}}},null,8,["config"])),S.value>1&&t.value.style.chart.zoom.show?(e.openBlock(),e.createBlock(pe.Slicer,{key:`slicer_${W.value}`,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,fontSize:t.value.style.chart.zoom.fontSize,useResetSlot:t.value.style.chart.zoom.useResetSlot,labelLeft:t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(i.value.start)]||"",labelRight:t.value.style.chart.layout.grid.xAxis.dataLabels.values[Number(i.value.end)-1]||"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:S.value,min:0,valueStart:i.value.start,valueEnd:i.value.end,start:i.value.start,"onUpdate:start":c[0]||(c[0]=l=>i.value.start=l),end:i.value.end,"onUpdate:end":c[1]||(c[1]=l=>i.value.end=l),onReset:ne},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(a.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end"])):e.createCommentVNode("",!0),t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(fe.Legend,{key:6,legendSet:J.value,config:ve.value,onClickMarker:c[2]||(c[2]=({legend:l})=>I(l.uid))},{item:e.withCtx(({legend:l,index:s})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:o=>I(l.uid),style:e.normalizeStyle(`opacity:${y.value.includes(l.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.dataLabels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:s}))+" ",1),y.value.includes(l.uid)?(e.openBlock(),e.createElementBlock("span",pt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",kt," ("+e.toDisplayString(isNaN(l.value/Q.value)?"-":e.unref(r.dataLabel)({v:l.value/Q.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,ft)]),_:1},8,["legendSet","config"])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:J.value},void 0,!0),$.value?(e.openBlock(),e.createBlock(be.default,{key:7,hideDetails:"",config:{open:z.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ge.DataTable,{colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:c[3]||(c[3]=l=>z.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l.name??l),1)]),td:e.withCtx(({td:l})=>[l.value===null?(e.openBlock(),e.createElementBlock("span",bt,"-")):(e.openBlock(),e.createElementBlock("b",xt,e.toDisplayString(isNaN(l.value)?"":t.value.style.chart.layout.dataLabels.prefix)+e.toDisplayString(!isNaN(l.value)&&l.value!==null?Number(l.value.toFixed(t.value.table.td.roundingValue)).toLocaleString():l)+e.toDisplayString(isNaN(l.value)?"":t.value.style.chart.layout.dataLabels.suffix),1)),e.createElementVNode("span",null,e.toDisplayString(l.percentage&&!isNaN(l.percentage)?`(${Number(l.percentage.toFixed(t.value.table.td.roundingPercentage)).toLocaleString()}%)`:""),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Be))}},Ct=xe._export_sfc(Bt,[["__scopeId","data-v-29ce04eb"]]);exports.default=Ct;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { computed as x, ref as L, onMounted as Xe, openBlock as a, createElementBlock as u, normalizeClass as F, normalizeStyle as B, createVNode as Le, createCommentVNode as d, createBlock as R, unref as c, createSlots as Ge, withCtx as P, renderSlot as T, normalizeProps as ae, guardReactiveProps as ue, createElementVNode as v, Fragment as m, renderList as p, toDisplayString as b, withKeys as Be, createTextVNode as $e, nextTick as je } from "vue";
|
|
2
|
-
import { u as Ye, o as Ke, e as j, g as qe, c as Se, t as Je, a as Qe, p as Y, b as Ze, F as et, d as oe, B as Ae, m as se, X as tt, w as re, C as lt, i as ne, f as K, j as Ne, k as q, n as ze, G as Fe, q as at, r as ut } from "./index-
|
|
3
|
-
import { _ as ot } from "./Title-
|
|
4
|
-
import { u as st, U as rt } from "./usePrinter-
|
|
5
|
-
import { D as nt } from "./DataTable-
|
|
6
|
-
import { L as it } from "./Legend-
|
|
7
|
-
import ct from "./vue-ui-skeleton-
|
|
8
|
-
import { S as vt } from "./Slicer-
|
|
9
|
-
import dt from "./vue-ui-accordion-
|
|
10
|
-
import { u as Pe } from "./useNestedProp-
|
|
2
|
+
import { u as Ye, o as Ke, e as j, g as qe, c as Se, t as Je, a as Qe, p as Y, b as Ze, F as et, d as oe, B as Ae, m as se, X as tt, w as re, C as lt, i as ne, f as K, j as Ne, k as q, n as ze, G as Fe, q as at, r as ut } from "./index-Dvs5Ra-u.js";
|
|
3
|
+
import { _ as ot } from "./Title-Ngy9HNqO.js";
|
|
4
|
+
import { u as st, U as rt } from "./usePrinter-B8-keRMa.js";
|
|
5
|
+
import { D as nt } from "./DataTable-BOdJVZzF.js";
|
|
6
|
+
import { L as it } from "./Legend-CHd5QFPM.js";
|
|
7
|
+
import ct from "./vue-ui-skeleton-CAvlIcgk.js";
|
|
8
|
+
import { S as vt } from "./Slicer-8Gg45iGX.js";
|
|
9
|
+
import dt from "./vue-ui-accordion-C-qAry7P.js";
|
|
10
|
+
import { u as Pe } from "./useNestedProp-UohhCyBz.js";
|
|
11
11
|
import { _ as ht } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const yt = ["id"], ft = ["xmlns", "viewBox"], gt = ["id"], bt = ["stop-color"], xt = ["stop-color"], mt = ["id"], pt = ["stop-color"], kt = ["stop-color"], _t = ["stop-color"], Ct = { key: 0 }, wt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Lt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], $t = { key: 0 }, St = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], At = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Nt = ["x", "y", "font-size", "fill", "font-weight"], zt = ["text-anchor", "font-size", "fill", "transform"], Ft = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], Pt = { key: 1 }, Dt = ["cx", "cy", "r", "fill"], Tt = { key: 0 }, It = { key: 0 }, Et = ["d", "stroke"], Ot = ["text-anchor", "x", "y", "fill"], Vt = ["cx", "cy", "r", "fill"], Ht = { key: 0 }, Mt = ["cx", "cy", "fill"], Wt = { key: 1 }, Rt = ["d", "fill", "stroke"], Ut = { key: 2 }, Xt = ["d", "fill", "stroke"], Gt = ["x", "y", "font-size", "fill"], Bt = ["x", "y", "width", "fill", "onClick"], jt = ["x", "y", "width", "height", "onMouseenter", "onClick"], Yt = {
|
|
13
13
|
key: 3,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { computed as m, ref as g, onMounted as Q, onBeforeUnmount as _e, openBlock as o, createElementBlock as r, normalizeClass as ee, normalizeStyle as D, createVNode as te, createCommentVNode as f, createBlock as F, unref as d, createSlots as xe, withCtx as _, renderSlot as C, normalizeProps as le, guardReactiveProps as ae, Fragment as w, renderList as $, createElementVNode as n, toDisplayString as L, createTextVNode as se, nextTick as ke } from "vue";
|
|
2
|
-
import { u as Ce, c as oe, t as we, o as $e, e as re, g as Le, s as ne, B as ze, f as z, X as ue, i as E, l as ie, h as ce, q as Xe, r as Ne } from "./index-
|
|
2
|
+
import { u as Ce, c as oe, t as we, o as $e, e as re, g as Le, s as ne, B as ze, f as z, X as ue, i as E, l as ie, h as ce, q as Xe, r as Ne } from "./index-Dvs5Ra-u.js";
|
|
3
3
|
import { t as Ae, u as Se } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as Te } from "./Title-
|
|
5
|
-
import { u as Pe, U as Ge } from "./usePrinter-
|
|
6
|
-
import { D as Ie } from "./DataTable-
|
|
7
|
-
import Me from "./vue-ui-skeleton-
|
|
8
|
-
import { L as De } from "./Legend-
|
|
9
|
-
import Fe from "./vue-ui-accordion-
|
|
10
|
-
import { u as de } from "./useNestedProp-
|
|
4
|
+
import { _ as Te } from "./Title-Ngy9HNqO.js";
|
|
5
|
+
import { u as Pe, U as Ge } from "./usePrinter-B8-keRMa.js";
|
|
6
|
+
import { D as Ie } from "./DataTable-BOdJVZzF.js";
|
|
7
|
+
import Me from "./vue-ui-skeleton-CAvlIcgk.js";
|
|
8
|
+
import { L as De } from "./Legend-CHd5QFPM.js";
|
|
9
|
+
import Fe from "./vue-ui-accordion-C-qAry7P.js";
|
|
10
|
+
import { u as de } from "./useNestedProp-UohhCyBz.js";
|
|
11
11
|
import { _ as Oe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
12
|
const Ve = ["id"], Ee = ["xmlns", "viewBox"], We = { key: 0 }, He = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Be = { key: 1 }, Re = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ue = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], je = { key: 2 }, qe = ["x", "y", "font-size", "fill", "font-weight"], Ye = ["x", "y", "font-size", "fill"], Ze = { key: 3 }, Je = ["x", "y", "font-size", "fill", "font-weight"], Ke = ["id"], Qe = ["stop-color"], et = ["stop-color"], tt = ["stop-color"], lt = ["id"], at = ["stop-color"], st = ["stop-color"], ot = ["stop-color"], rt = ["id"], nt = ["stop-color"], ut = ["stop-color"], it = ["id"], ct = ["stop-color"], dt = ["stop-color"], vt = { key: 0 }, ht = ["d", "fill"], yt = { key: 1 }, bt = ["x", "y", "height", "width", "fill"], ft = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], gt = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], mt = { key: 2 }, pt = ["x", "y", "fill", "font-size"], _t = { key: 3 }, xt = ["x", "y", "fill", "font-size"], kt = {
|
|
13
13
|
key: 3,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-Cuc8JBQE.cjs"),M=require("./useResponsive-B3TrDDIG.cjs"),Z=require("./Title-Du743m6e.cjs"),G=require("./usePrinter-BaExNQdD.cjs"),J=require("./DataTable-03mHwPdu.cjs"),K=require("./vue-ui-skeleton-DBlDHYe3.cjs"),Q=require("./Legend-rxEBmJRW.cjs"),ee=require("./vue-ui-accordion-CX_qmhfk.cjs"),I=require("./useNestedProp-DZwVoxS3.cjs"),te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le=["id"],ae=["xmlns","viewBox"],oe={key:0},re=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],se={key:1},ne=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ue=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ce={key:2},ie=["x","y","font-size","fill","font-weight"],de=["x","y","font-size","fill"],ve={key:3},he=["x","y","font-size","fill","font-weight"],ye=["id"],me=["stop-color"],be=["stop-color"],fe=["stop-color"],ge=["id"],pe=["stop-color"],ke=["stop-color"],xe=["stop-color"],_e=["id"],Ce=["stop-color"],we=["stop-color"],Ne=["id"],Be=["stop-color"],Ee=["stop-color"],Le={key:0},$e=["d","fill"],Ve={key:1},Se=["x","y","height","width","fill"],ze=["cx","cy","r","fill","stroke","stroke-width"],Xe=["cx","cy","r","fill","stroke","stroke-width"],Ae={key:2},Pe=["x","y","fill","font-size"],Te={key:3},De=["x","y","fill","font-size"],Fe={key:3,class:"vue-data-ui-watermark"},Me=["xmlns","height","width"],Ge=["fill"],Ie=["innerHTML"],Oe={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(O,{expose:H,emit:qe}){const y=O,{vue_ui_dumbbell:q}=s.useConfig(),f=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),i=e.ref(s.createUid()),L=e.ref(0),p=e.ref(null),$=e.ref(null),V=e.ref(null),t=e.computed(()=>{const a=I.useNestedProp({userConfig:y.config,defaultConfig:q});return a.theme?{...I.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}),k=e.ref(null);e.onMounted(()=>{if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiDumbbell",type:"dataset"}):y.dataset.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","start","end"]}).forEach(l=>{f.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=M.throttle(()=>{const{width:n,height:l}=M.useResponsive({chart:p.value,title:t.value.style.chart.title.text?$.value:null,legend:t.value.style.chart.legend.show?V.value:null});_.value=n,d.value=l/y.dataset.length,v.value=C()});k.value=new ResizeObserver(a),k.value.observe(p.value.parentNode)}}),e.onBeforeUnmount(()=>{k.value&&k.value.disconnect()});const{isPrinting:S,isImaging:z,generatePdf:X,generateImage:A}=G.usePrinter({elementId:`dumbbell_${i.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),x=e.ref({showTable:t.value.table.show}),m=e.computed(()=>y.dataset.map((a,n)=>({...a,start:s.checkNaN(a.start),end:s.checkNaN(a.end),id:s.createUid()}))),B=e.computed(()=>({max:Math.max(...m.value.flatMap(a=>[a.start,a.end])),min:Math.min(...m.value.flatMap(a=>[a.start,a.end]))})),c=e.computed(()=>s.calculateNiceScale(B.value.min<0?B.value.min:0,B.value.max,t.value.style.chart.grid.scaleSteps)),d=e.ref(t.value.style.chart.rowHeight),_=e.ref(t.value.style.chart.width),o=e.computed(()=>{const a=d.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+_.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,r=c.value.ticks.length*(_.value/c.value.ticks.length);return{left:t.value.style.chart.padding.left,right:n-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,bottom:l-t.value.style.chart.padding.bottom,width:_.value,height:a*y.dataset.length,rowHeight:a,absoluteHeight:l,absoluteWidth:n,widthPlotReference:r}});function C(){return m.value.map((a,n)=>{const l=o.value.left+(a.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,r=o.value.left+(a.end+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,u=l+(r-l)/2;return{...a,startX:l,endX:r,centerX:u,y:o.value.top+n*d.value+d.value/2,endVal:a.start}})}const v=e.ref([]),P=e.ref(null),R=e.computed(()=>m.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{v.value=C();let a=v.value.map(l=>l.start).reduce((l,r)=>l+r,0);function n(){const l=m.value.map(r=>r.end-r.start);a>=R.value?(cancelAnimationFrame(P.value),v.value=C()):(v.value=v.value.map((r,u)=>{r.endVal+=l[u]*(t.value.animationSpeed/100);const h=o.value.left+(r.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,N=o.value.left+(r.endVal+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,E=h+(N-h)/2;return{...r,startX:h,endX:N,centerX:E,y:o.value.top+u*d.value+d.value/2,endVal:r.endVal}}),a=v.value.map(r=>r.endVal).reduce((r,u)=>r+u,0),P.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()});const T=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${i.value})`:t.value.style.chart.plots.startColor},{name:t.value.style.chart.legend.labelEnd,color:t.value.style.chart.plots.gradient.show?`url(#end_grad_${i.value})`:t.value.style.chart.plots.endColor}]),W=e.computed(()=>({cy:"donut-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,paddingTop:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),b=e.computed(()=>{const a=v.value.map(l=>({name:l.name})),n=v.value.map(l=>({start:l.start,end:l.end}));return{head:a,body:n}}),w=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],n=b.value.head.map((u,h)=>{const N=s.dataLabel({p:t.value.style.chart.labels.prefix,v:b.value.body[h].start,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),E=s.dataLabel({p:t.value.style.chart.labels.prefix,v:b.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),Y=s.dataLabel({v:100*(b.value.body[h].end/b.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:u.name},N,E,Y]}),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{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],head:a,body:n,config:l}});function D(){e.nextTick(()=>{const a=b.value.head.map((r,u)=>[[r.name],[b.value.body[u].start],[b.value.body[u].end]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.start],[t.value.table.columnNames.end]]].concat(a),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-dumbbell"})})}const g=e.ref(!1);function U(a){g.value=a,L.value+=1}function j(){return v.value}function F(){x.value.showTable=!x.value.showTable}return H({getData:j,generatePdf:X,generateCsv:D,generateImage:A,toggleTable:F}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:p,class:e.normalizeClass(`vue-ui-dumbbell ${g.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`dumbbell_${i.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:$,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(Z._sfc_main,{config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(G.UserOptions,{ref:"details",key:`user_option_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(S),isImaging:e.unref(z),uid:i.value,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,isFullscreen:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:p.value,onToggleFullscreen:U,onGeneratePdf:e.unref(X),onGenerateCsv:D,onGenerateImage:e.unref(A),onToggleTable:F},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${o.value.absoluteWidth<=0?10:o.value.absoluteWidth} ${o.value.absoluteHeight<=0?10:o.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left+r*o.value.width/(c.value.ticks.length-1),x2:o.value.left+r*o.value.width/(c.value.ticks.length-1),y1:o.value.top,y2:o.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray},null,8,re))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left,x2:o.value.right,y1:o.value.top+r*d.value,y2:o.value.top+r*d.value,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,ne))),256)),e.createElementVNode("line",{x1:o.value.left,x2:o.value.right,y1:o.value.bottom,y2:o.value.bottom,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,ue)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*d.value+(t.value.style.chart.labels.yAxisLabels.showProgression?d.value/3:d.value/2)+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"font-weight":t.value.style.chart.labels.yAxisLabels.bold?"bold":"normal","text-anchor":"end"},e.toDisplayString(l.name),9,ie))),256)),t.value.style.chart.labels.yAxisLabels.showProgression?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*d.value+d.value/1.3+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(s.dataLabel)({v:100*(l.end/l.start-1),s:"%",r:t.value.style.chart.labels.yAxisLabels.rounding})),9,de))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left+r*(o.value.width/(c.value.ticks.length-1)),y:o.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"font-weight":t.value.style.chart.labels.xAxisLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.labels.formatter,l,e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:l,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.xAxisLabels.rounding}),{datapoint:l,seriesIndex:r})),9,he))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${i.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.startColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,me),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,be),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,fe)],8,ye),e.createElementVNode("radialGradient",{id:`end_grad_${i.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.endColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,pe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,ke),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,xe)],8,ge)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`grad_positive_${i.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,we)],8,_e),e.createElementVNode("linearGradient",{id:`grad_negative_${i.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,Be),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ee)],8,Ne)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Le,[e.createElementVNode("path",{d:`M
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-sFjJ2dIj.cjs"),M=require("./useResponsive-B3TrDDIG.cjs"),Z=require("./Title-CujodUjt.cjs"),G=require("./usePrinter-DSMMs1w9.cjs"),J=require("./DataTable-wmKwMbsJ.cjs"),K=require("./vue-ui-skeleton-CqF0NJ4g.cjs"),Q=require("./Legend-DdndVhHV.cjs"),ee=require("./vue-ui-accordion-RuCkf_li.cjs"),I=require("./useNestedProp-ir0jEo5M.cjs"),te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le=["id"],ae=["xmlns","viewBox"],oe={key:0},re=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],se={key:1},ne=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ue=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ce={key:2},ie=["x","y","font-size","fill","font-weight"],de=["x","y","font-size","fill"],ve={key:3},he=["x","y","font-size","fill","font-weight"],ye=["id"],me=["stop-color"],be=["stop-color"],fe=["stop-color"],ge=["id"],pe=["stop-color"],ke=["stop-color"],xe=["stop-color"],_e=["id"],Ce=["stop-color"],we=["stop-color"],Ne=["id"],Be=["stop-color"],Ee=["stop-color"],Le={key:0},$e=["d","fill"],Ve={key:1},Se=["x","y","height","width","fill"],ze=["cx","cy","r","fill","stroke","stroke-width"],Xe=["cx","cy","r","fill","stroke","stroke-width"],Ae={key:2},Pe=["x","y","fill","font-size"],Te={key:3},De=["x","y","fill","font-size"],Fe={key:3,class:"vue-data-ui-watermark"},Me=["xmlns","height","width"],Ge=["fill"],Ie=["innerHTML"],Oe={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(O,{expose:H,emit:qe}){const y=O,{vue_ui_dumbbell:q}=s.useConfig(),f=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),i=e.ref(s.createUid()),L=e.ref(0),p=e.ref(null),$=e.ref(null),V=e.ref(null),t=e.computed(()=>{const a=I.useNestedProp({userConfig:y.config,defaultConfig:q});return a.theme?{...I.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}),k=e.ref(null);e.onMounted(()=>{if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiDumbbell",type:"dataset"}):y.dataset.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","start","end"]}).forEach(l=>{f.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=M.throttle(()=>{const{width:n,height:l}=M.useResponsive({chart:p.value,title:t.value.style.chart.title.text?$.value:null,legend:t.value.style.chart.legend.show?V.value:null});_.value=n,d.value=l/y.dataset.length,v.value=C()});k.value=new ResizeObserver(a),k.value.observe(p.value.parentNode)}}),e.onBeforeUnmount(()=>{k.value&&k.value.disconnect()});const{isPrinting:S,isImaging:z,generatePdf:X,generateImage:A}=G.usePrinter({elementId:`dumbbell_${i.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),x=e.ref({showTable:t.value.table.show}),m=e.computed(()=>y.dataset.map((a,n)=>({...a,start:s.checkNaN(a.start),end:s.checkNaN(a.end),id:s.createUid()}))),B=e.computed(()=>({max:Math.max(...m.value.flatMap(a=>[a.start,a.end])),min:Math.min(...m.value.flatMap(a=>[a.start,a.end]))})),c=e.computed(()=>s.calculateNiceScale(B.value.min<0?B.value.min:0,B.value.max,t.value.style.chart.grid.scaleSteps)),d=e.ref(t.value.style.chart.rowHeight),_=e.ref(t.value.style.chart.width),o=e.computed(()=>{const a=d.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+_.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,r=c.value.ticks.length*(_.value/c.value.ticks.length);return{left:t.value.style.chart.padding.left,right:n-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,bottom:l-t.value.style.chart.padding.bottom,width:_.value,height:a*y.dataset.length,rowHeight:a,absoluteHeight:l,absoluteWidth:n,widthPlotReference:r}});function C(){return m.value.map((a,n)=>{const l=o.value.left+(a.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,r=o.value.left+(a.end+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,u=l+(r-l)/2;return{...a,startX:l,endX:r,centerX:u,y:o.value.top+n*d.value+d.value/2,endVal:a.start}})}const v=e.ref([]),P=e.ref(null),R=e.computed(()=>m.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{v.value=C();let a=v.value.map(l=>l.start).reduce((l,r)=>l+r,0);function n(){const l=m.value.map(r=>r.end-r.start);a>=R.value?(cancelAnimationFrame(P.value),v.value=C()):(v.value=v.value.map((r,u)=>{r.endVal+=l[u]*(t.value.animationSpeed/100);const h=o.value.left+(r.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,N=o.value.left+(r.endVal+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,E=h+(N-h)/2;return{...r,startX:h,endX:N,centerX:E,y:o.value.top+u*d.value+d.value/2,endVal:r.endVal}}),a=v.value.map(r=>r.endVal).reduce((r,u)=>r+u,0),P.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()});const T=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${i.value})`:t.value.style.chart.plots.startColor},{name:t.value.style.chart.legend.labelEnd,color:t.value.style.chart.plots.gradient.show?`url(#end_grad_${i.value})`:t.value.style.chart.plots.endColor}]),W=e.computed(()=>({cy:"donut-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,paddingTop:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),b=e.computed(()=>{const a=v.value.map(l=>({name:l.name})),n=v.value.map(l=>({start:l.start,end:l.end}));return{head:a,body:n}}),w=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],n=b.value.head.map((u,h)=>{const N=s.dataLabel({p:t.value.style.chart.labels.prefix,v:b.value.body[h].start,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),E=s.dataLabel({p:t.value.style.chart.labels.prefix,v:b.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),Y=s.dataLabel({v:100*(b.value.body[h].end/b.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:u.name},N,E,Y]}),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{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],head:a,body:n,config:l}});function D(){e.nextTick(()=>{const a=b.value.head.map((r,u)=>[[r.name],[b.value.body[u].start],[b.value.body[u].end]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.start],[t.value.table.columnNames.end]]].concat(a),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-dumbbell"})})}const g=e.ref(!1);function U(a){g.value=a,L.value+=1}function j(){return v.value}function F(){x.value.showTable=!x.value.showTable}return H({getData:j,generatePdf:X,generateCsv:D,generateImage:A,toggleTable:F}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:p,class:e.normalizeClass(`vue-ui-dumbbell ${g.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`dumbbell_${i.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:$,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(Z._sfc_main,{config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(G.UserOptions,{ref:"details",key:`user_option_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(S),isImaging:e.unref(z),uid:i.value,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,isFullscreen:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:p.value,onToggleFullscreen:U,onGeneratePdf:e.unref(X),onGenerateCsv:D,onGenerateImage:e.unref(A),onToggleTable:F},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${o.value.absoluteWidth<=0?10:o.value.absoluteWidth} ${o.value.absoluteHeight<=0?10:o.value.absoluteHeight}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left+r*o.value.width/(c.value.ticks.length-1),x2:o.value.left+r*o.value.width/(c.value.ticks.length-1),y1:o.value.top,y2:o.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray},null,8,re))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left,x2:o.value.right,y1:o.value.top+r*d.value,y2:o.value.top+r*d.value,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,ne))),256)),e.createElementVNode("line",{x1:o.value.left,x2:o.value.right,y1:o.value.bottom,y2:o.value.bottom,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray},null,8,ue)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",ce,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*d.value+(t.value.style.chart.labels.yAxisLabels.showProgression?d.value/3:d.value/2)+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"font-weight":t.value.style.chart.labels.yAxisLabels.bold?"bold":"normal","text-anchor":"end"},e.toDisplayString(l.name),9,ie))),256)),t.value.style.chart.labels.yAxisLabels.showProgression?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*d.value+d.value/1.3+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(s.dataLabel)({v:100*(l.end/l.start-1),s:"%",r:t.value.style.chart.labels.yAxisLabels.rounding})),9,de))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left+r*(o.value.width/(c.value.ticks.length-1)),y:o.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"font-weight":t.value.style.chart.labels.xAxisLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.labels.formatter,l,e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:l,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.xAxisLabels.rounding}),{datapoint:l,seriesIndex:r})),9,he))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${i.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.startColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,me),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,be),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,fe)],8,ye),e.createElementVNode("radialGradient",{id:`end_grad_${i.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.endColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,pe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,ke),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,xe)],8,ge)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`grad_positive_${i.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,we)],8,_e),e.createElementVNode("linearGradient",{id:`grad_negative_${i.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,Be),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ee)],8,Ne)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Le,[e.createElementVNode("path",{d:`M
|
|
2
2
|
${l.startX},${l.y+t.value.style.chart.plots.radius/2}
|
|
3
3
|
C ${l.centerX},${l.y} ${l.centerX},${l.y}
|
|
4
4
|
${l.endX},${l.y+t.value.style.chart.plots.radius/2}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-Cuc8JBQE.cjs"),ce=require("./Title-Du743m6e.cjs"),W=require("./usePrinter-BaExNQdD.cjs"),ie=require("./DataTable-03mHwPdu.cjs"),de=require("./vue-ui-accordion-CX_qmhfk.cjs"),he=require("./vue-ui-skeleton-DBlDHYe3.cjs"),X=require("./useNestedProp-DZwVoxS3.cjs"),ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],me=["xmlns","viewBox"],pe=["id"],ge=["stop-color"],ke=["stop-color"],ye=["d","fill","stroke","stroke-width"],be=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],we=["x","y","font-size","fill"],Ne=["x","y","font-size","fill"],Ce={key:2,class:"vue-data-ui-watermark"},xe=["innerHTML"],$e={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(R,{expose:Z}){const v=R,{vue_ui_flow:J}=s.useConfig(),x=e.computed(()=>!!v.dataset&&v.dataset.length);e.onMounted(()=>{s.objectIsEmpty(v.dataset)&&s.error({componentName:"VueUiFlow",type:"dataset"})});const $=e.ref(s.createUid()),P=e.ref(null),F=e.ref(0),y=e.ref(!1);function K(o){y.value=o,F.value+=1}const t=e.computed(()=>{const o=X.useNestedProp({userConfig:v.config,defaultConfig:J});return o.theme?{...X.useNestedProp({userConfig:s.themes.vue_ui_flow[o.theme]||v.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}),{isPrinting:L,isImaging:z,generatePdf:I,generateImage:H}=W.usePrinter({elementId:`flow_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),B=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),O=e.computed(()=>t.value.style.chart.nodes.gap),g=e.computed(()=>t.value.style.chart.nodes.width),b=e.ref({showTable:t.value.table.show}),V=e.computed(()=>t.value.style.chart.links.width),_=e.computed(()=>!v.dataset||!v.dataset.length?[]:v.dataset.map(o=>[o[0],o[1],s.checkNaN(o[2])])),M=e.computed(()=>{const o={};function n(r){o[r]||(o[r]={inflow:0,outflow:0})}_.value.forEach(([r,a,i])=>{n(r),n(a),o[r].outflow+=i,o[a].inflow+=i});let l=0;for(const r in o){const a=Math.max(o[r].inflow,o[r].outflow);l=Math.max(l,a)}return l});function Q(o){return o/M.value*100+t.value.style.chart.nodes.minHeight}function ee(o){const n=t.value.style.chart.nodes.minHeight;return(o-n)/100*M.value}function te(o){const n={},l={};function r(u,c){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=c),l[c]||(l[c]=[]),l[c].includes(u)||l[c].push(u)}o.forEach(([u,c,h],k)=>{const p=n[u]?n[u].level:0,C=p+1;r(u,p),r(c,C),n[u].children||(n[u].children=[]),n[u].children.push({target:c,value:h}),n[u].outflow+=h,n[c].inflow+=h}),Object.keys(n).forEach((u,c)=>{n[u].color=B.value[c]||B.value[c%B.value.length]||s.palette[c]||s.palette[c%d.length]});for(const u in n)n[u].height=Q(Math.max(n[u].inflow,n[u].outflow)),n[u].name=u;const a={};for(const u in l){let c=0;l[u].forEach((h,k)=>{const p=n[h].height;a[h]={x:parseInt(u,10)*V.value+t.value.style.chart.padding.left,y:c,absoluteY:c,height:p,i:k,color:n[h].color,value:ee(p)},c+=p+O.value})}const i=[];for(const u in n){let c=a[u].absoluteY;n[u].children&&n[u].children.forEach(({target:h,value:k},p)=>{const C=a[h].y,S=a[u],T=a[h],G=s.checkNaN(c),U=s.checkNaN(c+k/n[u].outflow*S.height),j=s.checkNaN(C),A=s.checkNaN(C+k/n[h].inflow*T.height),ue={id:s.createUid(),source:u,target:h,path:`M ${s.checkNaN(S.x)+s.checkNaN(g.value)} ${G} L ${s.checkNaN(S.x)+s.checkNaN(g.value)} ${U} L ${s.checkNaN(T.x)} ${A} L ${s.checkNaN(T.x)} ${j} Z`,value:k,sourceColor:n[u].color,targetColor:n[h].color};i.push(ue),c+=U-G,a[h].y+=A-j})}return{nodeCoordinates:a,links:i}}const f=e.computed(()=>{const o=te(v.dataset);return{nodes:Object.keys(o.nodeCoordinates).map((n,l)=>({...o.nodeCoordinates[n],name:n})),links:o.links}}),le=e.computed(()=>oe(f.value.nodes));function oe(o){const n={};for(const r in o){const{x:a,height:i}=o[r];n[a]||(n[a]=0),n[a]+=i+O.value}return Math.max(...Object.values(n))}const E=e.computed(()=>{const{top:o,right:n,left:l,bottom:r}=t.value.style.chart.padding,a=_.value.length*V.value;return{height:le.value+o+r,width:n+Math.max(...f.value.nodes.map(i=>i.x))+g.value,left:l,top:o,right:a-n,p_top:o,p_bottom:r}});function ne(o){const n={},l={},r=new Set;return _.value.forEach(([a,i,u])=>{n[a]||(n[a]=[]),l[i]||(l[i]=[]),n[a].push(i),l[i].push(a)}),n[o]&&n[o].forEach(a=>r.add(a)),l[o]&&l[o].forEach(a=>r.add(a)),Array.from(r).concat(o)}const m=e.ref(null),w=e.ref(null);function ae(o){m.value=ne(o.name),w.value=o.name}function se(){m.value=null,w.value=null}const D=e.computed(()=>f.value.links.map(({source:o,target:n,sourceColor:l,targetColor:r,value:a})=>({source:o,target:n,sourceColor:l,targetColor:r,value:a})));function Y(){e.nextTick(()=>{const o=D.value.map((r,a)=>[[r.source],[r.target],[r.value]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.source],[t.value.table.columnNames.target],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const N=e.computed(()=>{const o=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],n=D.value.map((a,i)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},s.dataLabel({p:t.value.style.chart.nodes.labels.prefix,v:a.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})]),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{colNames:[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:o,body:n,config:l}});function re(){return f.value}function q(){b.value.showTable=!b.value.showTable}return Z({getData:re,generateCsv:Y,generateImage:H,generatePdf:I,toggleTable:q}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:P,class:e.normalizeClass(`vue-ui-flow ${y.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`flow_${$.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(ce._sfc_main,{config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&x.value?(e.openBlock(),e.createBlock(W.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(L),isImaging:e.unref(z),uid:$.value,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,isFullscreen:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:P.value,onToggleFullscreen:K,onGeneratePdf:e.unref(I),onGenerateCsv:Y,onGenerateImage:e.unref(H),onToggleTable:q},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}: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:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${E.value.width} ${E.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:l.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":l.sourceColor},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":l.targetColor},null,8,ke)],8,pe))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,l=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:l.path,fill:`url(#${l.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${w.value?[l.target,l.source].includes(w.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,ye))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:l.x,y:e.unref(s.checkNaN)(l.absoluteY),height:e.unref(s.checkNaN)(l.height),width:g.value,fill:l.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>ae(l),onMouseleave:n[0]||(n[0]=a=>se()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(l.name)?1:.2:1}`)},null,44,be))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2-t.value.style.chart.nodes.labels.fontSize/4),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(s.abbreviate)({source:l.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):l.name),13,we))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2+t.value.style.chart.nodes.labels.fontSize),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.nodes.labels.formatter,l.value,e.unref(s.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:l.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding}),{datapoint:l,seriesIndex:r})),13,Ne))),256)),e.renderSlot(o.$slots,"svg",{svg:E.value},void 0,!0)],14,me)),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ce,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(L)||e.unref(z)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(he.default,{key:3,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),x.value?(e.openBlock(),e.createBlock(de.default,{key:4,hideDetails:"",config:{open:b.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ie.DataTable,{colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:n[1]||(n[1]=l=>b.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,xe)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,fe))}},Be=ve._export_sfc($e,[["__scopeId","data-v-c5ae33a6"]]);exports.default=Be;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-sFjJ2dIj.cjs"),ce=require("./Title-CujodUjt.cjs"),W=require("./usePrinter-DSMMs1w9.cjs"),ie=require("./DataTable-wmKwMbsJ.cjs"),de=require("./vue-ui-accordion-RuCkf_li.cjs"),he=require("./vue-ui-skeleton-CqF0NJ4g.cjs"),X=require("./useNestedProp-ir0jEo5M.cjs"),ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=["id"],me=["xmlns","viewBox"],pe=["id"],ge=["stop-color"],ke=["stop-color"],ye=["d","fill","stroke","stroke-width"],be=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],we=["x","y","font-size","fill"],Ne=["x","y","font-size","fill"],Ce={key:2,class:"vue-data-ui-watermark"},xe=["innerHTML"],$e={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(R,{expose:Z}){const v=R,{vue_ui_flow:J}=s.useConfig(),x=e.computed(()=>!!v.dataset&&v.dataset.length);e.onMounted(()=>{s.objectIsEmpty(v.dataset)&&s.error({componentName:"VueUiFlow",type:"dataset"})});const $=e.ref(s.createUid()),P=e.ref(null),F=e.ref(0),y=e.ref(!1);function K(o){y.value=o,F.value+=1}const t=e.computed(()=>{const o=X.useNestedProp({userConfig:v.config,defaultConfig:J});return o.theme?{...X.useNestedProp({userConfig:s.themes.vue_ui_flow[o.theme]||v.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}),{isPrinting:L,isImaging:z,generatePdf:I,generateImage:H}=W.usePrinter({elementId:`flow_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),B=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),O=e.computed(()=>t.value.style.chart.nodes.gap),g=e.computed(()=>t.value.style.chart.nodes.width),b=e.ref({showTable:t.value.table.show}),V=e.computed(()=>t.value.style.chart.links.width),_=e.computed(()=>!v.dataset||!v.dataset.length?[]:v.dataset.map(o=>[o[0],o[1],s.checkNaN(o[2])])),M=e.computed(()=>{const o={};function n(r){o[r]||(o[r]={inflow:0,outflow:0})}_.value.forEach(([r,a,i])=>{n(r),n(a),o[r].outflow+=i,o[a].inflow+=i});let l=0;for(const r in o){const a=Math.max(o[r].inflow,o[r].outflow);l=Math.max(l,a)}return l});function Q(o){return o/M.value*100+t.value.style.chart.nodes.minHeight}function ee(o){const n=t.value.style.chart.nodes.minHeight;return(o-n)/100*M.value}function te(o){const n={},l={};function r(u,c){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=c),l[c]||(l[c]=[]),l[c].includes(u)||l[c].push(u)}o.forEach(([u,c,h],k)=>{const p=n[u]?n[u].level:0,C=p+1;r(u,p),r(c,C),n[u].children||(n[u].children=[]),n[u].children.push({target:c,value:h}),n[u].outflow+=h,n[c].inflow+=h}),Object.keys(n).forEach((u,c)=>{n[u].color=B.value[c]||B.value[c%B.value.length]||s.palette[c]||s.palette[c%d.length]});for(const u in n)n[u].height=Q(Math.max(n[u].inflow,n[u].outflow)),n[u].name=u;const a={};for(const u in l){let c=0;l[u].forEach((h,k)=>{const p=n[h].height;a[h]={x:parseInt(u,10)*V.value+t.value.style.chart.padding.left,y:c,absoluteY:c,height:p,i:k,color:n[h].color,value:ee(p)},c+=p+O.value})}const i=[];for(const u in n){let c=a[u].absoluteY;n[u].children&&n[u].children.forEach(({target:h,value:k},p)=>{const C=a[h].y,S=a[u],T=a[h],G=s.checkNaN(c),U=s.checkNaN(c+k/n[u].outflow*S.height),j=s.checkNaN(C),A=s.checkNaN(C+k/n[h].inflow*T.height),ue={id:s.createUid(),source:u,target:h,path:`M ${s.checkNaN(S.x)+s.checkNaN(g.value)} ${G} L ${s.checkNaN(S.x)+s.checkNaN(g.value)} ${U} L ${s.checkNaN(T.x)} ${A} L ${s.checkNaN(T.x)} ${j} Z`,value:k,sourceColor:n[u].color,targetColor:n[h].color};i.push(ue),c+=U-G,a[h].y+=A-j})}return{nodeCoordinates:a,links:i}}const f=e.computed(()=>{const o=te(v.dataset);return{nodes:Object.keys(o.nodeCoordinates).map((n,l)=>({...o.nodeCoordinates[n],name:n})),links:o.links}}),le=e.computed(()=>oe(f.value.nodes));function oe(o){const n={};for(const r in o){const{x:a,height:i}=o[r];n[a]||(n[a]=0),n[a]+=i+O.value}return Math.max(...Object.values(n))}const E=e.computed(()=>{const{top:o,right:n,left:l,bottom:r}=t.value.style.chart.padding,a=_.value.length*V.value;return{height:le.value+o+r,width:n+Math.max(...f.value.nodes.map(i=>i.x))+g.value,left:l,top:o,right:a-n,p_top:o,p_bottom:r}});function ne(o){const n={},l={},r=new Set;return _.value.forEach(([a,i,u])=>{n[a]||(n[a]=[]),l[i]||(l[i]=[]),n[a].push(i),l[i].push(a)}),n[o]&&n[o].forEach(a=>r.add(a)),l[o]&&l[o].forEach(a=>r.add(a)),Array.from(r).concat(o)}const m=e.ref(null),w=e.ref(null);function ae(o){m.value=ne(o.name),w.value=o.name}function se(){m.value=null,w.value=null}const D=e.computed(()=>f.value.links.map(({source:o,target:n,sourceColor:l,targetColor:r,value:a})=>({source:o,target:n,sourceColor:l,targetColor:r,value:a})));function Y(){e.nextTick(()=>{const o=D.value.map((r,a)=>[[r.source],[r.target],[r.value]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.source],[t.value.table.columnNames.target],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const N=e.computed(()=>{const o=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],n=D.value.map((a,i)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},s.dataLabel({p:t.value.style.chart.nodes.labels.prefix,v:a.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})]),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{colNames:[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:o,body:n,config:l}});function re(){return f.value}function q(){b.value.showTable=!b.value.showTable}return Z({getData:re,generateCsv:Y,generateImage:H,generatePdf:I,toggleTable:q}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:P,class:e.normalizeClass(`vue-ui-flow ${y.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`flow_${$.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(ce._sfc_main,{config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&x.value?(e.openBlock(),e.createBlock(W.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(L),isImaging:e.unref(z),uid:$.value,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,isFullscreen:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:P.value,onToggleFullscreen:K,onGeneratePdf:e.unref(I),onGenerateCsv:Y,onGenerateImage:e.unref(H),onToggleTable:q},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}: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:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${E.value.width} ${E.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:l.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":l.sourceColor},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":l.targetColor},null,8,ke)],8,pe))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.links,l=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:l.path,fill:`url(#${l.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${w.value?[l.target,l.source].includes(w.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,ye))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:l.x,y:e.unref(s.checkNaN)(l.absoluteY),height:e.unref(s.checkNaN)(l.height),width:g.value,fill:l.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>ae(l),onMouseleave:n[0]||(n[0]=a=>se()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(l.name)?1:.2:1}`)},null,44,be))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2-t.value.style.chart.nodes.labels.fontSize/4),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(s.abbreviate)({source:l.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):l.name),13,we))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.nodes,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:l.x+g.value/2,y:e.unref(s.checkNaN)(l.absoluteY+l.height/2+t.value.style.chart.nodes.labels.fontSize),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(s.adaptColorToBackground)(l.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(l.name)?1:0:1}`)},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.nodes.labels.formatter,l.value,e.unref(s.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:l.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding}),{datapoint:l,seriesIndex:r})),13,Ne))),256)),e.renderSlot(o.$slots,"svg",{svg:E.value},void 0,!0)],14,me)),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ce,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(L)||e.unref(z)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(he.default,{key:3,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),x.value?(e.openBlock(),e.createBlock(de.default,{key:4,hideDetails:"",config:{open:b.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ie.DataTable,{colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:n[1]||(n[1]=l=>b.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,xe)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,fe))}},Be=ve._export_sfc($e,[["__scopeId","data-v-c5ae33a6"]]);exports.default=Be;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { computed as m, onMounted as Fe, ref as w, openBlock as r, createElementBlock as h, normalizeClass as ue, normalizeStyle as C, createVNode as re, createCommentVNode as T, createBlock as A, unref as i, createSlots as Ie, withCtx as y, renderSlot as x, normalizeProps as ie, guardReactiveProps as ce, createElementVNode as O, Fragment as P, renderList as F, toDisplayString as U, createTextVNode as He, nextTick as Le } from "vue";
|
|
2
|
-
import { u as Ee, o as Oe, e as Me, c as de, t as Se, a as ze, p as V, b as Ye, s as v, f as ve, X as De, E as fe, H as Ge, i as Be, q as Ae, r as Ue } from "./index-
|
|
3
|
-
import { _ as Ve } from "./Title-
|
|
4
|
-
import { u as je, U as Xe } from "./usePrinter-
|
|
5
|
-
import { D as We } from "./DataTable-
|
|
6
|
-
import qe from "./vue-ui-accordion-
|
|
7
|
-
import Re from "./vue-ui-skeleton-
|
|
8
|
-
import { u as he } from "./useNestedProp-
|
|
2
|
+
import { u as Ee, o as Oe, e as Me, c as de, t as Se, a as ze, p as V, b as Ye, s as v, f as ve, X as De, E as fe, H as Ge, i as Be, q as Ae, r as Ue } from "./index-Dvs5Ra-u.js";
|
|
3
|
+
import { _ as Ve } from "./Title-Ngy9HNqO.js";
|
|
4
|
+
import { u as je, U as Xe } from "./usePrinter-B8-keRMa.js";
|
|
5
|
+
import { D as We } from "./DataTable-BOdJVZzF.js";
|
|
6
|
+
import qe from "./vue-ui-accordion-C-qAry7P.js";
|
|
7
|
+
import Re from "./vue-ui-skeleton-CAvlIcgk.js";
|
|
8
|
+
import { u as he } from "./useNestedProp-UohhCyBz.js";
|
|
9
9
|
import { _ as Ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
const Je = ["id"], Ke = ["xmlns", "viewBox"], Qe = ["id"], et = ["stop-color"], tt = ["stop-color"], lt = ["d", "fill", "stroke", "stroke-width"], ot = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "onMouseenter"], at = ["x", "y", "font-size", "fill"], nt = ["x", "y", "font-size", "fill"], st = {
|
|
11
11
|
key: 2,
|