vue-data-ui 2.3.89 → 2.3.91
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-6DWnAEHt.js → Arrow-CHTslrAF.js} +1 -1
- package/dist/{Arrow-CW5gDSmt.cjs → Arrow-DpuaFuue.cjs} +1 -1
- package/dist/{BaseIcon-Dj8EbAXm.js → BaseIcon-DfaCNBgc.js} +1 -1
- package/dist/{BaseIcon-B_MrASni.cjs → BaseIcon-JWGtHqTA.cjs} +1 -1
- package/dist/{DataTable-BmYcdJ1w.js → DataTable-BKc3r3k3.js} +2 -2
- package/dist/{DataTable-DAwK5x3h.cjs → DataTable-CnkdsvIo.cjs} +1 -1
- package/dist/{Legend-DhQ-a1RH.cjs → Legend-BQJV6Xk4.cjs} +1 -1
- package/dist/{Legend-BRG8ddDy.js → Legend-WNL92WSx.js} +1 -1
- package/dist/PackageVersion-D9PU8glB.js +10 -0
- package/dist/PackageVersion-LdLhc8hQ.cjs +1 -0
- package/dist/{Shape-D7jva0XA.cjs → Shape-CgW0V2Og.cjs} +1 -1
- package/dist/{Shape-BcL3EDZ5.js → Shape-DPvoEBm9.js} +1 -1
- package/dist/{Slicer-DI1kgq9D.js → Slicer-DE9nFM_c.js} +2 -2
- package/dist/{Slicer-DV29nclP.cjs → Slicer-Dma3nlzi.cjs} +1 -1
- package/dist/{Title-DYwo_Q5b.cjs → Title-Bg_BK11V.cjs} +1 -1
- package/dist/{Title-fAvrqioZ.js → Title-CECK1w9L.js} +1 -1
- package/dist/{Tooltip-TZYYFvPe.js → Tooltip-Ci3AprCm.js} +1 -1
- package/dist/{Tooltip-03RvVGln.cjs → Tooltip-lM1Jzkza.cjs} +1 -1
- package/dist/{index-BKTciLz4.cjs → index-BhH89oF0.cjs} +1 -1
- package/dist/{index-Ca4RHJ4t.js → index-mBy4elhB.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-vP7uimPz.js → useNestedProp-BrIRtQj1.js} +1 -1
- package/dist/{useNestedProp-BFnXnY0k.cjs → useNestedProp-m8IH8hWW.cjs} +1 -1
- package/dist/{usePrinter-CxYg-Dw-.cjs → usePrinter-B8jr_V3b.cjs} +1 -1
- package/dist/{usePrinter-5fwXghqP.js → usePrinter-Ck-yukK2.js} +1 -1
- package/dist/{vue-data-ui-BaLkNH7M.cjs → vue-data-ui-BgaY7Noy.cjs} +1 -1
- package/dist/{vue-data-ui-4VG00HFR.js → vue-data-ui-BuL-2aYA.js} +57 -57
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/vue-ui-3d-bar-C9a-AsIX.cjs +19 -0
- package/dist/{vue-ui-3d-bar-DPJWcxqV.js → vue-ui-3d-bar-Cv-56A3m.js} +148 -146
- package/dist/{vue-ui-accordion-SXHdW20_.cjs → vue-ui-accordion-Bzq1iTL2.cjs} +1 -1
- package/dist/{vue-ui-accordion-vYoYjedX.js → vue-ui-accordion-dyF20BlD.js} +3 -3
- package/dist/{vue-ui-age-pyramid-BEC4SHLl.js → vue-ui-age-pyramid-BqsDR6uw.js} +83 -81
- package/dist/vue-ui-age-pyramid-DDPU8QV8.cjs +1 -0
- package/dist/{vue-ui-annotator-B1NZRuJJ.cjs → vue-ui-annotator-B9HxrEVE.cjs} +1 -1
- package/dist/{vue-ui-annotator-DFpv61wn.js → vue-ui-annotator-CkJsRR0r.js} +1 -1
- package/dist/{vue-ui-candlestick-AEKT8X3p.js → vue-ui-candlestick-B8eYA2g0.js} +113 -111
- package/dist/vue-ui-candlestick-DbbbJa-d.cjs +2 -0
- package/dist/{vue-ui-carousel-table-DhzVxOvp.js → vue-ui-carousel-table-BCiTg3Ok.js} +4 -4
- package/dist/{vue-ui-carousel-table-DCk2p-1k.cjs → vue-ui-carousel-table-CCWGcKb7.cjs} +1 -1
- package/dist/{vue-ui-chestnut-qqcIpMGB.js → vue-ui-chestnut-DI-N69Ad.js} +161 -159
- package/dist/vue-ui-chestnut-rsWP_sXY.cjs +6 -0
- package/dist/{vue-ui-cursor-CgSghVjL.js → vue-ui-cursor-BUzJk1oC.js} +2 -2
- package/dist/{vue-ui-cursor-CvJgJk1M.cjs → vue-ui-cursor-wY14Z-Vd.cjs} +1 -1
- package/dist/{vue-ui-dashboard-CtJdVmtu.cjs → vue-ui-dashboard-Cf8TYbAr.cjs} +1 -1
- package/dist/{vue-ui-dashboard-CYzkic0X.js → vue-ui-dashboard-CiG3kXLl.js} +2 -2
- package/dist/{vue-ui-digits-C0dMG-hR.cjs → vue-ui-digits-BBho1-xO.cjs} +1 -1
- package/dist/{vue-ui-digits-BO1hSjoq.js → vue-ui-digits-DZJI0YuX.js} +2 -2
- package/dist/{vue-ui-donut-DP-yxiw3.js → vue-ui-donut-CBG9ECp8.js} +118 -116
- package/dist/vue-ui-donut-D4WpeX9W.cjs +1 -0
- package/dist/vue-ui-donut-evolution-BVnSrr-b.cjs +1 -0
- package/dist/{vue-ui-donut-evolution-C-yDyglF.js → vue-ui-donut-evolution-BtTiBfLb.js} +102 -100
- package/dist/vue-ui-dumbbell-BQKiB9yH.cjs +9 -0
- package/dist/{vue-ui-dumbbell-D2SQ4cKV.js → vue-ui-dumbbell-DlEN2c_X.js} +88 -86
- package/dist/{vue-ui-flow-D_E9V2A1.js → vue-ui-flow-CXqGztWj.js} +65 -63
- package/dist/vue-ui-flow-DfMNmttZ.cjs +1 -0
- package/dist/vue-ui-galaxy-CGn5nkD5.cjs +1 -0
- package/dist/{vue-ui-galaxy-DqE2UiA3.js → vue-ui-galaxy-xI38Kf-S.js} +82 -80
- package/dist/{vue-ui-gauge-CFYXDw2p.js → vue-ui-gauge-BEludqYn.js} +56 -54
- package/dist/vue-ui-gauge-Bz-OSNOJ.cjs +1 -0
- package/dist/{vue-ui-gizmo-BWztIJ3j.js → vue-ui-gizmo-BB28OTr1.js} +32 -30
- package/dist/vue-ui-gizmo-CZZB7YgY.cjs +1 -0
- package/dist/vue-ui-heatmap-BtUvE7rK.cjs +1 -0
- package/dist/{vue-ui-heatmap-E1MlhSCs.js → vue-ui-heatmap-mywZXUV8.js} +99 -97
- package/dist/{vue-ui-kpi-BWDPF-9X.cjs → vue-ui-kpi-CEAGjnkj.cjs} +1 -1
- package/dist/{vue-ui-kpi-DeP0XmP7.js → vue-ui-kpi-zr721ux9.js} +3 -3
- package/dist/{vue-ui-mini-loader-Bal12IrX.js → vue-ui-mini-loader-9zyuKIpT.js} +2 -2
- package/dist/{vue-ui-mini-loader-D5e8uW_d.cjs → vue-ui-mini-loader-DBFAzGb2.cjs} +1 -1
- package/dist/{vue-ui-molecule-DHrHeQgF.js → vue-ui-molecule-Bv_ppQig.js} +77 -75
- package/dist/vue-ui-molecule-DltNL0kV.cjs +1 -0
- package/dist/{vue-ui-mood-radar-dJaJotNf.js → vue-ui-mood-radar-CIK2Xohn.js} +76 -74
- package/dist/vue-ui-mood-radar-CQkF2Rp1.cjs +1 -0
- package/dist/{vue-ui-nested-donuts--K9ygdH3.js → vue-ui-nested-donuts-f-cMx3iQ.js} +112 -110
- package/dist/vue-ui-nested-donuts-vHr23QlH.cjs +17 -0
- package/dist/vue-ui-onion-B6ZrryDW.cjs +5 -0
- package/dist/{vue-ui-onion-Bm1inM56.js → vue-ui-onion-CmUXelhy.js} +82 -80
- package/dist/vue-ui-parallel-coordinate-plot-BU0yoxD9.cjs +8 -0
- package/dist/{vue-ui-parallel-coordinate-plot-9PSGD-LR.js → vue-ui-parallel-coordinate-plot-h9dS2u_k.js} +91 -89
- package/dist/{vue-ui-quadrant-iGQbx93I.js → vue-ui-quadrant-DNT_0fTL.js} +141 -139
- package/dist/vue-ui-quadrant-DPPXilUd.cjs +1 -0
- package/dist/vue-ui-quick-chart-1gG267X0.cjs +15 -0
- package/dist/{vue-ui-quick-chart-DeEQcx6A.js → vue-ui-quick-chart-T6C0BTyw.js} +166 -164
- package/dist/{vue-ui-radar-DfnhsNQV.js → vue-ui-radar-CfCHXIYJ.js} +89 -87
- package/dist/vue-ui-radar-DpzjMFZD.cjs +1 -0
- package/dist/{vue-ui-rating-D0rgVdkT.cjs → vue-ui-rating-DYcT_LS-.cjs} +1 -1
- package/dist/{vue-ui-rating-CCesFD6e.js → vue-ui-rating-DuRLpMwk.js} +2 -2
- package/dist/vue-ui-relation-circle-BMrPtD2n.cjs +1 -0
- package/dist/{vue-ui-relation-circle-D2GXm_Fk.js → vue-ui-relation-circle-WmZMKqHL.js} +54 -52
- package/dist/{vue-ui-rings-B7_-G3JM.js → vue-ui-rings-Ce0Z_osd.js} +97 -93
- package/dist/{vue-ui-rings-CScmcQ1n.cjs → vue-ui-rings-CkYl3uce.cjs} +2 -2
- package/dist/vue-ui-scatter-Cjie2D-t.cjs +1 -0
- package/dist/{vue-ui-scatter-DdhiNjLc.js → vue-ui-scatter-DY9EpoGP.js} +132 -130
- package/dist/{vue-ui-screenshot-BrhjnTwn.cjs → vue-ui-screenshot-BCFym6go.cjs} +1 -1
- package/dist/{vue-ui-screenshot-Cpy2qbf1.js → vue-ui-screenshot-lQLJHBQ2.js} +1 -1
- package/dist/vue-ui-skeleton-Cf89QIhl.cjs +41 -0
- package/dist/{vue-ui-skeleton-D7aLznpP.js → vue-ui-skeleton-DDhwPZd_.js} +423 -388
- package/dist/{vue-ui-smiley-Cj0yi7_H.cjs → vue-ui-smiley-DMA6fgGr.cjs} +1 -1
- package/dist/{vue-ui-smiley-vcpYARLj.js → vue-ui-smiley-xxMwBT9c.js} +2 -2
- package/dist/vue-ui-spark-trend-Btj_H6fa.cjs +1 -0
- package/dist/{vue-ui-spark-trend-CFJSCQnf.js → vue-ui-spark-trend-CLHTqp94.js} +42 -40
- package/dist/{vue-ui-sparkbar-CgRdDfk6.js → vue-ui-sparkbar-Btk6snt4.js} +53 -51
- package/dist/vue-ui-sparkbar-CKrbBVKQ.cjs +1 -0
- package/dist/{vue-ui-sparkgauge-CCPMNge0.js → vue-ui-sparkgauge-DKJtFTSv.js} +31 -29
- package/dist/vue-ui-sparkgauge-DfWLtFYS.cjs +1 -0
- package/dist/{vue-ui-sparkhistogram-D5z2Wtpk.js → vue-ui-sparkhistogram-JRLlw9EX.js} +69 -67
- package/dist/vue-ui-sparkhistogram-wHJ-8zVV.cjs +1 -0
- package/dist/vue-ui-sparkline-DElVaalm.cjs +1 -0
- package/dist/{vue-ui-sparkline-KYN0oKt1.js → vue-ui-sparkline-tBF9iaNm.js} +65 -63
- package/dist/{vue-ui-sparkstackbar-7lurD9-4.js → vue-ui-sparkstackbar-BS9I8en7.js} +102 -87
- package/dist/vue-ui-sparkstackbar-tZa2IYHP.cjs +1 -0
- package/dist/{vue-ui-stackbar-CsVmAvl3.js → vue-ui-stackbar-UiX8q4yL.js} +128 -126
- package/dist/vue-ui-stackbar-rOa0atA9.cjs +6 -0
- package/dist/{vue-ui-strip-plot-B63AgKts.js → vue-ui-strip-plot-BOkfg5vB.js} +78 -76
- package/dist/vue-ui-strip-plot-hRy6QRHK.cjs +1 -0
- package/dist/{vue-ui-table-hPqdMR-m.cjs → vue-ui-table-B9dc0l0k.cjs} +1 -1
- package/dist/{vue-ui-table-G5O8K-F_.js → vue-ui-table-Dtfv71zG.js} +1 -1
- package/dist/{vue-ui-table-heatmap-t9Ngijvp.js → vue-ui-table-heatmap-BMl-sP5Q.js} +4 -4
- package/dist/{vue-ui-table-heatmap-BhVuTdSS.cjs → vue-ui-table-heatmap-DUQEHohs.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-DtjJrGve.cjs → vue-ui-table-sparkline-BVnGb-lu.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-BX4en1c-.js → vue-ui-table-sparkline-BeunspIj.js} +5 -5
- package/dist/vue-ui-thermometer-A3Xxn5Ly.cjs +1 -0
- package/dist/{vue-ui-thermometer-BWGyDQ7_.js → vue-ui-thermometer-Cb9ALBj_.js} +80 -78
- package/dist/{vue-ui-timer-8AlVLAJi.js → vue-ui-timer-2PRDq1w6.js} +62 -60
- package/dist/vue-ui-timer-DltmIdrq.cjs +64 -0
- package/dist/vue-ui-tiremarks-BTlJcW4v.cjs +1 -0
- package/dist/{vue-ui-tiremarks-DYIHGkBU.js → vue-ui-tiremarks-Bse3PMGV.js} +51 -49
- package/dist/vue-ui-treemap-Cv_mHK8H.cjs +1 -0
- package/dist/{vue-ui-treemap-mmvdTHiX.js → vue-ui-treemap-D8fjVYq0.js} +93 -91
- package/dist/{vue-ui-vertical-bar-DAKHNRoR.js → vue-ui-vertical-bar-BVldPT8k.js} +110 -108
- package/dist/vue-ui-vertical-bar-ZgJq3_CI.cjs +4 -0
- package/dist/vue-ui-waffle-BpeGEjCl.cjs +1 -0
- package/dist/{vue-ui-waffle-B-A4NYNd.js → vue-ui-waffle-wikAjwZY.js} +72 -70
- package/dist/vue-ui-wheel-BlgfdULS.cjs +1 -0
- package/dist/{vue-ui-wheel-DN9WvA6Z.js → vue-ui-wheel-D5qyBs0Y.js} +43 -41
- package/dist/{vue-ui-word-cloud-BWTyaGAT.js → vue-ui-word-cloud-Bcdl2iE-.js} +60 -58
- package/dist/vue-ui-word-cloud-sNzfl_Tq.cjs +1 -0
- package/dist/{vue-ui-xy-Dzp4qCjk.js → vue-ui-xy-CUjllUSv.js} +507 -504
- package/dist/vue-ui-xy-FHLTc7xG.cjs +3 -0
- package/dist/{vue-ui-xy-canvas-CAcTkk_r.cjs → vue-ui-xy-canvas-BJUnRVuf.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-9NPbm7dE.js → vue-ui-xy-canvas-BkOlPU8e.js} +10 -10
- package/package.json +1 -1
- package/dist/vue-ui-3d-bar-rOT9iPsm.cjs +0 -19
- package/dist/vue-ui-age-pyramid-HElID9Ax.cjs +0 -1
- package/dist/vue-ui-candlestick-p1s0Av21.cjs +0 -2
- package/dist/vue-ui-chestnut-oFfB3fBF.cjs +0 -6
- package/dist/vue-ui-donut-Dnnoj71c.cjs +0 -1
- package/dist/vue-ui-donut-evolution-vBUH5VVx.cjs +0 -1
- package/dist/vue-ui-dumbbell-BUA_uSse.cjs +0 -9
- package/dist/vue-ui-flow-B-AFlw-n.cjs +0 -1
- package/dist/vue-ui-galaxy-CbL5nONj.cjs +0 -1
- package/dist/vue-ui-gauge-BUV_hQND.cjs +0 -1
- package/dist/vue-ui-gizmo-B-LxuvDh.cjs +0 -1
- package/dist/vue-ui-heatmap-DW5StHKM.cjs +0 -1
- package/dist/vue-ui-molecule-DHBId4h4.cjs +0 -1
- package/dist/vue-ui-mood-radar-DSXB9l99.cjs +0 -1
- package/dist/vue-ui-nested-donuts-CEX2cvop.cjs +0 -17
- package/dist/vue-ui-onion-Iekdjs8b.cjs +0 -5
- package/dist/vue-ui-parallel-coordinate-plot-OlFoYL_3.cjs +0 -8
- package/dist/vue-ui-quadrant-CgJeo2zZ.cjs +0 -1
- package/dist/vue-ui-quick-chart-Du8lDPmh.cjs +0 -15
- package/dist/vue-ui-radar-BYk9DWnM.cjs +0 -1
- package/dist/vue-ui-relation-circle-8eoBav4O.cjs +0 -1
- package/dist/vue-ui-scatter-BnBI8qdt.cjs +0 -1
- package/dist/vue-ui-skeleton-pDeQ3NcD.cjs +0 -41
- package/dist/vue-ui-spark-trend-BW8k0jDd.cjs +0 -1
- package/dist/vue-ui-sparkbar-BbJHfAQj.cjs +0 -1
- package/dist/vue-ui-sparkgauge-BESRB8_4.cjs +0 -1
- package/dist/vue-ui-sparkhistogram-BYnSfLdb.cjs +0 -1
- package/dist/vue-ui-sparkline-D5WUy4p5.cjs +0 -1
- package/dist/vue-ui-sparkstackbar-Dy-IfQ3q.cjs +0 -1
- package/dist/vue-ui-stackbar-Ch-fmE9l.cjs +0 -6
- package/dist/vue-ui-strip-plot-BLRl-tF6.cjs +0 -1
- package/dist/vue-ui-thermometer-B07RI9fZ.cjs +0 -1
- package/dist/vue-ui-timer-CXrENAVg.cjs +0 -64
- package/dist/vue-ui-tiremarks-C43c4_IR.cjs +0 -1
- package/dist/vue-ui-treemap-BN90ISQv.cjs +0 -1
- package/dist/vue-ui-vertical-bar-BRDO_Rsu.cjs +0 -4
- package/dist/vue-ui-waffle-BN_yZEtJ.cjs +0 -1
- package/dist/vue-ui-wheel-50_zeiIW.cjs +0 -1
- package/dist/vue-ui-word-cloud-BVoFIb_q.cjs +0 -1
- package/dist/vue-ui-xy-CJHHesUD.cjs +0 -3
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BhH89oF0.cjs"),ue=require("./useResponsive-B3TrDDIG.cjs"),we=require("./Title-Bg_BK11V.cjs"),se=require("./usePrinter-B8jr_V3b.cjs"),$e=require("./Tooltip-lM1Jzkza.cjs"),ie=require("./Legend-BQJV6Xk4.cjs"),Se=require("./vue-ui-skeleton-Cf89QIhl.cjs"),Ve=require("./BaseIcon-JWGtHqTA.cjs"),Te=require("./vue-ui-accordion-Bzq1iTL2.cjs"),ce=require("./useNestedProp-m8IH8hWW.cjs"),Be=require("./PackageVersion-LdLhc8hQ.cjs"),Ee=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Le=["id"],ze=["onClick"],Pe=["xmlns","viewBox"],De=["id"],Fe=["stop-color"],Me=["stop-color"],Ie=["x","y","width","height","fill","rx"],Oe=["x","y","width","height","fill","rx","stroke","stroke-width"],Re=["x2","y1","y2","stroke","stroke-width"],qe=["x1","x2","y1","y2","stroke","stroke-width"],He=["x","y","text-anchor","font-size","fill","font-weight"],Xe=["x","y","font-size","fill","font-weight"],Ae=["x","y","font-size","fill","font-weight"],Ue=["x","y","font-size","fill","font-weight"],je=["y","width","height","fill","onMouseenter"],Ge={key:4,class:"vue-data-ui-watermark"},We=["onClick"],Ye={style:"width:100%;padding-top: 36px;position:relative"},Ke={class:"vue-ui-data-table"},Je={key:0},Qe={style:{width:"100%"}},Ze=["data-cell"],et={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},tt=["data-cell"],lt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},at=["data-cell"],ot={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},nt=["data-cell"],rt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ut=["data-cell"],st={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},it=["data-cell"],ct={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},dt=["data-cell"],vt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ht={__name:"vue-ui-vertical-bar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(de,{expose:ve,emit:he}){const y=de;e.useCssVars(a=>({"3d035ab4":a.tdo}));const{vue_ui_vertical_bar:pe}=n.useConfig(),B=e.computed(()=>!!y.dataset&&y.dataset.length),_=e.ref(n.createUid()),ye=e.ref(null),P=e.ref(!1),D=e.ref(""),E=e.ref(0),ge=e.ref(null),R=e.ref(0),$=e.ref(null),q=e.ref(null),F=e.ref(null),H=e.ref(0),M=e.ref(0),t=e.computed({get:()=>X(),set:a=>a});function X(){const a=ce.useNestedProp({userConfig:y.config,defaultConfig:pe});return a.theme?{...ce.useNestedProp({userConfig:n.themes.vue_ui_vertical_bar[a.theme]||y.config,defaultConfig:a}),customPalette:n.themePalettes[a.theme]||n.palette}:a}e.watch(()=>y.config,a=>{t.value=X(),J(),H.value+=1,M.value+=1,s.value=t.value.style.chart.layout.bars.height,c.value=t.value.style.chart.layout.bars.gap},{deep:!0}),e.watch(()=>y.dataset,z,{deep:!0});const{isPrinting:A,isImaging:U,generatePdf:j,generateImage:G}=se.usePrinter({elementId:`vue-ui-vertical-bar_${_.value}`,fileName:t.value.style.chart.title.text||"vue-ui-vertical-bar"}),W=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),Y=e.ref(null),K=e.ref(!1),fe=e.computed(()=>t.value.table.responsiveBreakpoint),L=e.ref(null);e.onMounted(()=>{J()});function J(){if(n.objectIsEmpty(y.dataset)&&n.error({componentName:"VueUiVerticalBar",type:"dataset"}),E.value=y.dataset.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0),be(),t.value.responsive){const a=ue.throttle(()=>{const{width:o,height:l}=ue.useResponsive({chart:$.value,title:t.value.style.chart.title.text?q.value:null,legend:t.value.style.chart.legend.show?F.value:null});ee.value=o,s.value=l/E.value-c.value*2});L.value=new ResizeObserver(a),L.value.observe($.value.parentNode)}}e.onBeforeUnmount(()=>{L.value&&L.value.disconnect()});function be(){new ResizeObserver(o=>{o.forEach(l=>{K.value=l.contentRect.width<fe.value})}).observe(Y.value)}const p=e.ref({showTable:t.value.table.show,sortDesc:t.value.style.chart.layout.bars.sort==="desc",showTooltip:t.value.style.chart.tooltip.show}),Q=e.computed(()=>p.value.sortDesc),C=e.computed(()=>(y.dataset.forEach((a,o)=>{!a.value&&!a.children&&n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`value (index ${o})`}),a.children&&(n.objectIsEmpty(a.children)?n.error({componentName:"VueUiVerticalBar",type:"datasetAttributeEmpty",property:`children (index ${o})`}):a.children.forEach((l,r)=>{[null,void 0].includes(l.name)&&n.error({componentName:"VueUiVerticalBar",type:"datasetSerieAttribute",property:"name",key:"children",index:r})}))}),y.dataset.map((a,o)=>{const l=`vertical_parent_${o}_${_.value}`,r=a.children&&a.children.length>0,v=n.checkNaN(a.value?a.value:r?a.children.map(h=>h.value||0).reduce((h,m)=>h+m,0):0),i=v>=0?1:-1;return{...a,id:l,shape:"square",opacity:f.value.includes(l)?.5:1,value:Math.abs(v),sign:i,hasChildren:r,isChild:!1,segregate:()=>S(l),isSegregated:f.value.includes(l),color:n.convertColorToHex(a.color)||W.value[o]||n.palette[o]||n.palette[o%n.palette.length],children:!a.children||!a.children.length?[]:a.children.toSorted((h,m)=>Q.value?m.value-h.value:h.value-m.value).map((h,m)=>({...h,value:n.checkNaN(Math.abs(h.value)),sign:h.value>=0?1:-1,isChild:!0,parentId:l,parentName:a.name,parentValue:v,parentSign:i,id:`vertical_child_${o}_${m}_${_.value}`,childIndex:m,color:n.convertColorToHex(h.color)||n.convertColorToHex(a.color)||W.value[o]||n.palette[o]||n.palette[o%n.palette.length]})).map((h,m)=>({...h,isFirstChild:m===0,isLastChild:m===a.children.length-1}))}}).toSorted((a,o)=>Q.value?o.value-a.value:a.value-o.value))),Z=e.computed(()=>({cy:"vertical-bar-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":""})),s=e.ref(t.value.style.chart.layout.bars.height),c=e.ref(t.value.style.chart.layout.bars.gap),me=e.computed(()=>(s.value+c.value)*E.value),ee=e.ref(512),d=e.computed(()=>({width:ee.value,height:me.value,padding:{top:12,left:128+t.value.style.chart.layout.bars.offsetX,right:64+t.value.style.chart.layout.bars.paddingRight,bottom:12}})),u=e.computed(()=>({fullHeight:d.value.padding.top+d.value.padding.bottom+d.value.height,top:d.value.padding.top,left:d.value.padding.left,right:d.value.width-d.value.padding.right,bottom:d.value.padding.top+d.value.height,width:d.value.width-(d.value.padding.left+d.value.padding.right)}));function z(){E.value=x.value.flatMap(a=>a.children&&a.children.length>0?a.children.length:1).reduce((a,o)=>a+o,0)}const f=e.ref([]);function S(a){f.value.includes(a)?f.value=f.value.filter(o=>o!==a):f.value.push(a),z(),he("selectLegend",x.value)}const x=e.computed(()=>C.value.filter(a=>!f.value.includes(a.id))),b=e.computed(()=>x.value.map(a=>Math.abs(a.value)).reduce((a,o)=>a+o,0));function te(a,o=!1,l=0){return o?n.dataLabel({v:n.checkNaN(Math.abs(a)/b.value*100),s:"%",r:l}):Math.abs(a)/b.value}const N=e.computed(()=>x.value.flatMap(a=>a.hasChildren?a.children:a)),w=e.computed(()=>N.value.map(a=>a.sign).includes(-1)),ke=e.computed(()=>Math.max(...x.value.flatMap(a=>a.children&&a.children.length?Math.max(...a.children.map(o=>o.value)):a.value)));function k(a){const o=a/ke.value;return u.value.width/(w.value?2:1)*o}function _e(a){return k(a)+u.value.left}function V(a,o){const l=x.value.find(i=>i.id===a.parentId),r=u.value.top+(c.value+s.value)*o,v=l.children.length*(c.value+s.value);return{y:r+v/2-t.value.style.chart.layout.bars.parentLabels.fontSize,name:l.name,value:[void 0,NaN,null].includes(l.value)?"":l.sign===1?l.value:-l.value,percentageToTotal:isNaN(l.value/b.value)?"":te(l.value,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage),sign:l.sign}}function Ce(){return x.value}const I=e.ref(null),O=e.ref(null);function xe(a,o){O.value={datapoint:a,seriesIndex:o,series:C.value,config:t.value},P.value=!0,I.value=a.id;let l="";const r=a.isChild?a.parentName:a.name,v=a.isChild?a.name:"",i=t.value.style.chart.tooltip.customFormat;n.isFunction(i)&&n.functionReturnsString(()=>i({datapoint:a,series:C.value,config:t.value,seriesIndex:o}))?D.value=i({datapoint:a,series:C.value,config:t.value,seriesIndex:o}):(l+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;text-align:left;">
|
|
2
|
+
<div style="display:flex;align-items:center;gap:4px;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" rx="2" stroke="none" fill="${a.color}"/></svg> ${r}</div>
|
|
3
|
+
${v?`<div>${v}</div>`:""}
|
|
4
|
+
</div>`,t.value.style.chart.tooltip.showValue&&(l+=`<div>${t.value.translations.value}: <b>${n.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,a.sign===1?a.value:-a.value,n.dataLabel({p:t.value.style.chart.tooltip.prefix,v:a.sign===1?a.value:-a.value,s:t.value.style.chart.tooltip.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,seriesIndex:o})}</b></div>`),t.value.style.chart.tooltip.showPercentage&&(l+=`<div>${t.value.translations.percentageToTotal} : <b>${n.dataLabel({v:Math.abs(a.value)/b.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`,a.isChild&&(l+=`<div>${t.value.translations.percentageToSerie}: <b>${n.dataLabel({v:Math.abs(a.value)/Math.abs(a.parentValue)*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`)),D.value=`<div style="text-align:left">${l}</div>`)}function le(a,o,l,r){if(!t.value.style.chart.layout.bars.dataLabels.value.show)return"";const v=n.applyDataLabel(t.value.style.chart.layout.bars.dataLabels.value.formatter,n.checkNaN(r===-1&&a>=0?-a:a),n.dataLabel({p:t.value.style.chart.layout.bars.dataLabels.value.prefix,v:n.checkNaN(r===-1&&a>=0?-a:a),s:t.value.style.chart.layout.bars.dataLabels.value.suffix,r:t.value.style.chart.layout.bars.dataLabels.value.roundingValue}),{datapoint:o,seriesIndex:l}),i=`(${te(a,!0,t.value.style.chart.layout.bars.dataLabels.percentage.roundingPercentage)})`;return`${v}${t.value.style.chart.layout.bars.dataLabels.percentage.show?` ${i}`:""}`}const g=e.computed(()=>{const a=[t.value.translations.parentName,t.value.translations.value,t.value.translations.percentageToTotal,t.value.translations.childName,t.value.translations.value,t.value.translations.percentageToSerie,t.value.translations.percentageToTotal],o=N.value.map(l=>l.isChild?l.isFirstChild?{color:l.color,parentName:l.parentName,parentValue:l.parentValue,percentageToTotal:l.parentValue/b.value,childName:l.name,childValue:l.sign===1?l.value:-l.value,childPercentageToParent:Math.abs(l.value)/Math.abs(l.parentValue),childPercentageToTotal:Math.abs(l.value)/b.value}:{color:"",parentName:"",parentValue:"",percentageToTotal:"",childName:l.name,childValue:l.sign===1?l.value:-l.value,childPercentageToParent:Math.abs(l.value)/Math.abs(l.parentValue),childPercentageToTotal:Math.abs(l.value)/b.value}:{color:l.color,parentName:l.name,parentValue:l.sign===1?l.value:-l.value,percentageToTotal:Math.abs(l.value)/b.value,childName:"",childValue:"",childPercentageToParent:"",childPercentageToTotal:""});return{head:a,body:o}});function ae(){const a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],o=g.value.head,l=g.value.body.map(i=>[i.parentName,i.parentValue,i.percentageToTotal,i.childName,i.childValue,i.childPercentageToParent,i.childPercentageToTotal]),r=a.concat([o]).concat(l),v=n.createCsvContent(r);n.downloadCsv({csvContent:v,title:t.value.style.chart.title.text||"vue-ui-vertical-bar"})}const T=e.ref(!1);function Ne(a){T.value=a,R.value+=1}function oe(){p.value.showTable=!p.value.showTable}function ne(){p.value.sortDesc=!p.value.sortDesc,z()}function re(){p.value.showTooltip=!p.value.showTooltip}return ve({getData:Ce,recalculateHeight:z,generatePdf:j,generateCsv:ae,generateImage:G,toggleTable:oe,toggleSort:ne,toggleTooltip:re}),(a,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-vertical-bar ${T.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"verticalBarChart",ref:$,id:`vue-ui-vertical-bar_${_.value}`,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%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:q,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(we._sfc_main,{key:`title_${H.value}`,config:{title:{cy:"vertical-bar-div-title",...t.value.style.chart.title},subtitle:{cy:"vertical-bar-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&B.value?(e.openBlock(),e.createBlock(se.UserOptions,{ref_key:"details",ref:ye,key:`user_options_${R.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(U),isPrinting:e.unref(A),uid:_.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasSort:t.value.userOptions.buttons.sort,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:T.value,isTooltip:p.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:$.value,position:t.value.userOptions.position,onToggleFullscreen:Ne,onGeneratePdf:e.unref(j),onGenerateCsv:ae,onGenerateImage:e.unref(G),onToggleTable:oe,onToggleSort:ne,onToggleTooltip:re},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.optionSort?{name:"optionSort",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionSort",{},void 0,!0)]),key:"6"}: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:"7"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasSort","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),t.value.style.chart.legend.show&&t.value.style.chart.legend.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartLegend",ref:F},[(e.openBlock(),e.createBlock(ie.Legend,{key:`legend_top_${M.value}`,legendSet:C.value,config:Z.value,onClickMarker:o[0]||(o[0]=({legend:l})=>S(l.id))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:v=>S(l.id),style:e.normalizeStyle(`opacity:${f.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,l.value,e.unref(n.dataLabel)({p:t.value.style.chart.legend.prefix,v:l.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:r})),13,ze)]),_:1},8,["legendSet","config"]))],512)):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":T.value,"vue-data-ui-fulscreen--off":!T.value}),viewBox:`0 0 ${d.value.width<=0?10:d.value.width} ${u.value.fullHeight<=0?10:u.value.fullHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Be._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(l,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`vertical_bar_gradient_${_.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":l.color},null,8,Fe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(l.color,.03),100-t.value.style.chart.layout.bars.gradientIntensity)},null,8,Me)],8,De))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)(w.value?u.value.left+u.value.width/2-(l.sign===1?0:k(l.value)<=0?1e-4:k(l.value)):u.value.left),y:u.value.top+(c.value+s.value)*r,width:e.unref(n.checkNaN)(k(l.value)<=0?1e-4:k(l.value)),height:s.value<=0?1e-4:s.value,fill:t.value.style.chart.layout.bars.underlayerColor,rx:t.value.style.chart.layout.bars.borderRadius,class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,Ie)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:e.unref(n.checkNaN)(w.value?u.value.left+u.value.width/2-(l.sign===1?0:k(l.value)<=0?1e-4:k(l.value)):u.value.left),y:u.value.top+(c.value+s.value)*r,width:e.unref(n.checkNaN)(k(l.value)<=0?1e-4:k(l.value)),height:s.value<=0?1e-4:s.value,fill:t.value.style.chart.layout.bars.useGradient?`url(#vertical_bar_gradient_${_.value}_${r})`:e.unref(n.setOpacity)(l.color,t.value.style.chart.layout.bars.fillOpacity),rx:t.value.style.chart.layout.bars.borderRadius,stroke:t.value.style.chart.layout.bars.useStroke?l.color:"none","stroke-width":t.value.style.chart.layout.bars.useStroke?t.value.style.chart.layout.bars.strokeWidth:0,class:e.normalizeClass({animated:t.value.useCssAnimation})},null,10,Oe),(!l.isChild||l.isLastChild)&&t.value.style.chart.layout.separators.show&&r!==N.value.length-1?(e.openBlock(),e.createElementBlock("line",{key:0,x1:0,x2:u.value.left,y1:s.value+c.value/2+u.value.top+(c.value+s.value)*r,y2:s.value+c.value/2+u.value.top+(c.value+s.value)*r,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,Re)):e.createCommentVNode("",!0),w.value&&t.value.style.chart.layout.separators.show?(e.openBlock(),e.createElementBlock("line",{key:1,x1:u.value.left+u.value.width/2,x2:u.value.left+u.value.width/2,y1:u.value.top,y2:u.value.bottom,stroke:t.value.style.chart.layout.separators.color,"stroke-width":t.value.style.chart.layout.separators.strokeWidth,"stroke-linecap":"round"},null,8,qe)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:w.value?u.value.left+u.value.width/2+(l.sign===1?-12:12)+(l.sign===1?-t.value.style.chart.layout.bars.dataLabels.offsetX:t.value.style.chart.layout.bars.dataLabels.offsetX):_e(l.value)+3+t.value.style.chart.layout.bars.dataLabels.offsetX,y:u.value.top+(c.value+s.value)*r+s.value/2+t.value.style.chart.layout.bars.dataLabels.fontSize/2,"text-anchor":!w.value||l.sign===-1?"start":"end","font-size":t.value.style.chart.layout.bars.dataLabels.fontSize,fill:t.value.style.chart.layout.bars.dataLabels.color,"font-weight":t.value.style.chart.layout.bars.dataLabels.bold?"bold":"normal"},e.toDisplayString(le(l.value,l,r,l.sign)),9,He),(l.isChild||!l.hasChildren)&&t.value.style.chart.layout.bars.nameLabels.show?(e.openBlock(),e.createElementBlock("text",{key:2,"text-anchor":"end",x:u.value.left-3+t.value.style.chart.layout.bars.nameLabels.offsetX,y:u.value.top+(c.value+s.value)*r+s.value/2+t.value.style.chart.layout.bars.nameLabels.fontSize/2,"font-size":t.value.style.chart.layout.bars.nameLabels.fontSize,fill:t.value.style.chart.layout.bars.nameLabels.color,"font-weight":t.value.style.chart.layout.bars.nameLabels.bold?"bold":"normal"},e.toDisplayString(l.name),9,Xe)):e.createCommentVNode("",!0),l.isChild&&l.childIndex===0&&t.value.style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:3,x:3+t.value.style.chart.layout.bars.parentLabels.offsetX,y:V(l,r).y,"font-size":t.value.style.chart.layout.bars.parentLabels.fontSize,fill:t.value.style.chart.layout.bars.parentLabels.color,"font-weight":t.value.style.chart.layout.bars.parentLabels.bold?"bold":"normal","text-anchor":"start"},e.toDisplayString(V(l,r).name),9,Ae)):e.createCommentVNode("",!0),l.isChild&&l.childIndex===0&&t.value.style.chart.layout.bars.parentLabels.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:3+t.value.style.chart.layout.bars.parentLabels.offsetX,y:V(l,r).y+t.value.style.chart.layout.bars.parentLabels.fontSize+6,"font-size":t.value.style.chart.layout.bars.parentLabels.fontSize,fill:t.value.style.chart.layout.bars.parentLabels.color,"font-weight":t.value.style.chart.layout.bars.dataLabels.bold?"bold":"normal","text-anchor":"start"},e.toDisplayString(le(V(l,r).value),V(l,r),r,l.parentSign||l.sign),9,Ue)):e.createCommentVNode("",!0),e.createElementVNode("rect",{"data-cy-trap":"",x:0,y:u.value.top+(c.value+s.value)*r-c.value/2,width:d.value.width<=0?1e-4:d.value.width,height:s.value+c.value<=0?1e-4:s.value+c.value,fill:I.value===l.id?e.unref(n.setOpacity)(t.value.style.chart.layout.highlighter.color,t.value.style.chart.layout.highlighter.opacity):"transparent",onMouseenter:v=>xe(l,r),onMouseleave:o[1]||(o[1]=v=>{ge.value=null,P.value=!1,I.value=null})},null,40,je)]))),256)),e.renderSlot(a.$slots,"svg",{svg:d.value},void 0,!0)],14,Pe)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ge,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(A)||e.unref(U)})),void 0,!0)])):e.createCommentVNode("",!0),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Se.default,{key:5,config:{type:"verticalBar",style:{backgroundColor:t.value.style.chart.backgroundColor,verticalBar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.chart.legend.show&&t.value.style.chart.legend.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"chartLegend",ref:F},[(e.openBlock(),e.createBlock(ie.Legend,{key:`legend_bottom_${M.value}`,legendSet:C.value,config:Z.value,onClickMarker:o[2]||(o[2]=({legend:l})=>S(l.id))},{item:e.withCtx(({legend:l,index:r})=>[e.createElementVNode("div",{onClick:v=>S(l.id),style:e.normalizeStyle(`opacity:${f.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.bars.dataLabels.value.formatter,l.value,e.unref(n.dataLabel)({p:t.value.style.chart.legend.prefix,v:l.value,s:t.value.style.chart.legend.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:r})),13,We)]),_:1},8,["legendSet","config"]))],512)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:C.value},void 0,!0),e.createVNode($e._sfc_main,{show:p.value.showTooltip&&P.value&&f.value.length<y.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:$.value,content:D.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...O.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...O.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),B.value?(e.openBlock(),e.createBlock(Te.default,{key:7,hideDetails:"",config:{open:p.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.createElementVNode("div",{ref_key:"tableContainer",ref:Y,class:"vue-ui-vertical-bar-table"},[e.createElementVNode("div",Ye,[e.createElementVNode("div",{role:"button",tabindex:"0",style:e.normalizeStyle(`width:32px; position: absolute; top: 0; right:4px; padding: 0 0px; display: flex; align-items:center;justify-content:center;height: 36px; width: 32px; cursor:pointer; background:${t.value.table.th.backgroundColor};`),onClick:o[3]||(o[3]=l=>p.value.showTable=!1),onKeypress:o[4]||(o[4]=e.withKeys(l=>p.value.showTable=!1,["enter"]))},[e.createVNode(Ve.default,{name:"close",stroke:t.value.table.th.color,"stroke-width":2},null,8,["stroke"])],36),e.createElementVNode("div",{style:{width:"100%","container-type":"inline-size"},class:e.normalizeClass({"vue-ui-responsive":K.value})},[e.createElementVNode("table",Ke,[e.createElementVNode("caption",{style:e.normalizeStyle({backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline}),class:"vue-ui-data-table__caption"},[e.createTextVNode(e.toDisplayString(t.value.style.chart.title.text)+" ",1),t.value.style.chart.title.subtitle.text?(e.openBlock(),e.createElementBlock("span",Je,e.toDisplayString(t.value.style.chart.title.subtitle.text),1)):e.createCommentVNode("",!0)],4),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.head,l=>(e.openBlock(),e.createElementBlock("th",{style:e.normalizeStyle(`outline:${t.value.table.th.outline}`)},[e.createElementVNode("div",Qe,e.toDisplayString(l),1)],4))),256))],4),e.createElementVNode("tr",null,[e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},"∑ "+e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(isNaN(b.value)?"":b.value.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),5),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline};text-align:right;padding-right:5px;font-weight:bold`)},"100%",4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4),e.createElementVNode("th",{style:e.normalizeStyle(`background:${t.value.table.th.backgroundColor};color:${t.value.table.th.color};outline:${t.value.table.th.outline}`)},null,4)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value.body,(l,r)=>(e.openBlock(),e.createElementBlock("tr",{class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":r%2===0,"vue-ui-data-table__tbody__row-odd":r%2!==0}),style:e.normalizeStyle(`background:${t.value.table.td.backgroundColor};color:${t.value.table.td.color}`)},[e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline};font-variant-numeric: tabular-nums;`),"data-cell":g.value.head[0]??""},[e.createElementVNode("div",et,[l.color?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`color:${l.color};margin-right:3px`)},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(l.parentName),1)])],12,Ze),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[1]??""},[e.createElementVNode("div",lt,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(l.parentValue)?"":l.parentValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,tt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[2]??""},[e.createElementVNode("div",ot,e.toDisplayString(["",NaN,void 0].includes(l.percentageToTotal)?"":`${(l.percentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,at),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[3]??""},[e.createElementVNode("div",rt,e.toDisplayString(l.childName),1)],12,nt),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[4]??""},[e.createElementVNode("div",st,e.toDisplayString(t.value.table.td.prefix)+e.toDisplayString(["",NaN,void 0].includes(l.childValue)?"":l.childValue.toFixed(t.value.table.td.roundingValue))+e.toDisplayString(t.value.table.td.suffix),1)],12,ut),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[5]??""},[e.createElementVNode("div",ct,e.toDisplayString(["",NaN,void 0].includes(l.childPercentageToParent)?"":`${(l.childPercentageToParent*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,it),e.createElementVNode("td",{class:"vue-ui-data-table__tbody__td",style:e.normalizeStyle(`outline:${t.value.table.td.outline}`),"data-cell":g.value.head[6]??""},[e.createElementVNode("div",vt,e.toDisplayString(["",NaN,void 0].includes(l.childPercentageToTotal)?"":`${(l.childPercentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,dt)],6))),256))])])],2)])],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Le))}},pt=Ee._export_sfc(ht,[["__scopeId","data-v-008d2191"]]);exports.default=pt;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BhH89oF0.cjs"),ie=require("./useResponsive-B3TrDDIG.cjs"),_e=require("./Title-Bg_BK11V.cjs"),ce=require("./usePrinter-B8jr_V3b.cjs"),Se=require("./Tooltip-lM1Jzkza.cjs"),Ne=require("./DataTable-CnkdsvIo.cjs"),Le=require("./Legend-BQJV6Xk4.cjs"),$e=require("./vue-ui-skeleton-Cf89QIhl.cjs"),Te=require("./vue-ui-accordion-Bzq1iTL2.cjs"),ve=require("./useNestedProp-m8IH8hWW.cjs"),Pe=require("./PackageVersion-LdLhc8hQ.cjs"),Ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),de=S=>(e.pushScopeId("data-v-a0574c0d"),S=S(),e.popScopeId(),S),Ie=["id"],Ee=["xmlns","viewBox"],ze=["id"],Fe=["stop-color"],De=["stop-color"],Oe=["id"],Ae=de(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),qe=de(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Me=[Ae,qe],Re=["x","y","height","width"],Ue=["height","width"],je=["rx","x","y","height","width","stroke","stroke-width","filter"],Ge=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],We=["x","y","height","width","filter"],He={key:0},Ye={key:1},Xe={key:2},Je={key:3},Ke=["onMouseover","x","y","height","width"],Qe={key:3,class:"vue-data-ui-watermark"},Ze=["onClick"],et={key:0},tt={key:1},lt=["innerHTML"],at={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(S,{expose:pe,emit:he}){const p=S,{vue_ui_waffle:fe}=n.useConfig(),V=e.computed(()=>!!p.dataset&&p.dataset.length),b=e.ref(n.createUid()),ye=e.ref(null),F=e.ref(!1),D=e.ref(""),B=e.ref(null),M=e.ref(0),N=e.ref(null),R=e.ref(null),U=e.ref(null),j=e.ref(0),G=e.ref(0),W=e.ref(0),t=e.computed({get:()=>H(),set:l=>l});function H(){const l=ve.useNestedProp({userConfig:p.config,defaultConfig:fe});return l.theme?{...ve.useNestedProp({userConfig:n.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>p.config,l=>{t.value=H(),Y(),j.value+=1,G.value+=1,W.value+=1},{deep:!0});const I=e.ref(null);function Y(){if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,r)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.responsive){const l=ie.throttle(()=>{const{width:r,height:a}=ie.useResponsive({chart:N.value,title:t.value.style.chart.title.text?R.value:null,legend:t.value.style.chart.legend.show?U.value:null});k.value.width=r,k.value.height=a,f.value.width=r,f.value.height=a});I.value=new ResizeObserver(l),I.value.observe(N.value.parentNode)}}e.onMounted(()=>{Y()}),e.onBeforeUnmount(()=>{I.value&&I.value.disconnect()});const{isPrinting:X,isImaging:J,generatePdf:K,generateImage:Q}=ce.usePrinter({elementId:`vue-ui-waffle_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),Z=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),k=e.ref({height:512,width:512}),f=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(f.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),x=e.computed(()=>(f.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),L=e.computed(()=>f.value.width/t.value.style.chart.layout.grid.size),E=e.computed(()=>f.value.height/t.value.style.chart.layout.grid.size);function ee(l){const r=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,q)=>h+q,0),o=l.map(h=>h/a*r),u=o.map(Math.floor),i=o.map(h=>h%1);let d=r-u.reduce((h,q)=>h+q,0);for(;d>0;){let h=i.indexOf(Math.max(...i));u[h]+=1,i[h]=0,d-=1}return u}function te(){return p.dataset.map((l,r)=>({...l,color:n.convertColorToHex(l.color)||Z.value[r]||n.palette[r]||n.palette[r%n.palette.length],uid:`serie_${r}`,absoluteIndex:r}))}const le=e.computed(()=>te()),c=e.ref(le.value);e.watch(()=>p.dataset,l=>{c.value=te()},{deep:!0});const ge=e.computed(()=>{const l=c.value.filter((r,a)=>!v.value.includes(r.uid)).map((r,a)=>(r.values||[]).reduce((o,u)=>o+u,0));return ee(l)}),me=e.computed(()=>{const l=c.value.map((r,a)=>(r.values||[]).reduce((o,u)=>o+u));return ee(l)}),$=e.computed(()=>(p.dataset.forEach((l,r)=>{[null,void 0].includes(l.values)&&n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:r})}),c.value.filter((l,r)=>!v.value.includes(l.uid)).map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:ge.value[r]})))),be=e.computed(()=>c.value.map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:me.value[r]})));function ke(){return be.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const we=e.computed(()=>{let l=0;return $.value.map((r,a)=>{const o=l,u=o+r.proportion,i=[];for(let d=Math.floor(o);d<Math.floor(u);d+=1)i.push(d);return l=u,{...r,start:o,rects:i}})}),s=e.computed(()=>we.value.flatMap((l,r)=>l.rects.map((a,o)=>({isFirst:o===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:r,absoluteStartIndex:o<3,serieId:l.uid,...l}))).map((l,r)=>({...l,isAbsoluteFirst:r%t.value.style.chart.layout.grid.size===0}))),T=e.computed(()=>{const l=[];for(let r=0;r<t.value.style.chart.layout.grid.size;r+=1)for(let a=0;a<t.value.style.chart.layout.grid.size;a+=1)l.push({isStartOfLine:a===0,position:t.value.style.chart.layout.grid.vertical?r:a,x:(t.value.style.chart.layout.grid.vertical?r:a)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:r)*(x.value+t.value.style.chart.layout.grid.spaceBetween)+f.value.top});return l}),v=e.ref([]),C=e.ref(!1),ae=e.ref(null),oe=e.ref(null);function re(l){if(!t.value.useAnimation){v.value.includes(l)?v.value=v.value.filter(u=>u!==l):v.value.length<_.value.length-1&&_.value.length>1&&v.value.push(l);return}const r=le.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);let o=c.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);if(v.value.includes(l)){let i=function(){o>u?(cancelAnimationFrame(ae.value),c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[u]}:d),C.value=!1):(C.value=!0,o+=u*.025,c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[o]}:d),ae.value=requestAnimationFrame(i))};v.value=v.value.filter(d=>d!==l);const u=r;i()}else if(v.value.length<_.value.length-1&&_.value.length>1){let u=function(){o<.1?(cancelAnimationFrame(oe.value),v.value.push(l),c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[0]}:i),C.value=!1):(C.value=!0,o/=1.5,c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[o]}:i),oe.value=requestAnimationFrame(u))};u()}he("selectLegend",$.value.map(u=>({name:u.name,color:u.color,value:u.value,proportion:u.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)})))}const _=e.computed(()=>c.value.map((l,r)=>({name:l.name,color:l.color||Z[r]||n.palette[r]||n.palette[r%n.palette.length],value:(l.values||[]).reduce((a,o)=>a+o,0),uid:l.uid,shape:"square"})).map((l,r)=>({...l,proportion:l.value/c.value.map(a=>(a.values||[]).reduce((o,u)=>o+u,0)).reduce((a,o)=>a+o,0),opacity:v.value.includes(l.uid)?.5:1,segregate:()=>re(l.uid),isSegregated:v.value.includes(l.uid)}))),xe=e.computed(()=>({cy:"waffle-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(()=>$.value.map(l=>l.value).reduce((l,r)=>l+r,0)),O=e.ref(null);function Ce(l){if(v.value.length===p.dataset.length)return;const r=s.value[l];O.value={datapoint:r,seriesIndex:r.absoluteIndex,series:c.value,config:t.value},F.value=!0,B.value=s.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(n.isFunction(a)&&n.functionReturnsString(()=>a({seriesIndex:s.value[l].absoluteIndex,datapoint:r,series:c.value,config:t.value})))D.value=a({seriesIndex:s.value[l].absoluteIndex,datapoint:r,series:c.value,config:t.value});else{let o="";if(o+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${r.name}</div>`,o+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${r.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(o+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,r.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:r.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:r,seriesIndex:s.value[l].absoluteIndex,series:c.value})}</b>`),t.value.style.chart.tooltip.showPercentage){const u=n.dataLabel({v:r.value/y.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?o+=`<span>(${u})</span></div>`:o+=`<b>${u}%</b></div>`}D.value=o}}const g=e.computed(()=>{const l=$.value.map(a=>({name:a.name,color:a.color})),r=$.value.map(a=>a.value);return{head:l,body:r}});function A(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${b.value})`:""}function ue(){e.nextTick(()=>{const l=g.value.head.map((o,u)=>[[o.name],[g.value.body[u]],[isNaN(g.value.body[u]/y.value)?"-":g.value.body[u]/y.value*100]]),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=n.createCsvContent(r);n.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const z=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,y.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:y.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],r=g.value.head.map((u,i)=>[{color:u.color,name:u.name},n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,g.value.body[i],n.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})),isNaN(g.value.body[i]/y.value)?"-":n.dataLabel({v:g.value.body[i]/y.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),a={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},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:r,config:a,colNames:o}}),P=e.ref(!1);function Be(l){P.value=l,M.value+=1}function ne(){m.value.showTable=!m.value.showTable}function se(){m.value.showTooltip=!m.value.showTooltip}return pe({getData:ke,generatePdf:K,generateCsv:ue,generateImage:Q,toggleTable:ne,toggleTooltip:se}),(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${P.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:N,id:`vue-ui-waffle_${b.value}`,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%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:R,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(_e._sfc_main,{key:`title_${j.value}`,config:{title:{cy:"waffle-title",...t.value.style.chart.title},subtitle:{cy:"waffle-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&V.value?(e.openBlock(),e.createBlock(ce.UserOptions,{ref_key:"details",ref:ye,key:`user_options_${M.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(X),isImaging:e.unref(J),uid:b.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:P.value,isTooltip:m.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,position:t.value.userOptions.position,onToggleFullscreen:Be,onGeneratePdf:e.unref(K),onGenerateCsv:ue,onGenerateImage:e.unref(Q),onToggleTable:ne,onToggleTooltip:se},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:o})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":P.value,"vue-data-ui-fulscreen--off":!P.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Pe._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,o)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${o}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(a.color,.05),100-t.value.style.chart.layout.rect.gradientIntensity)},null,8,Fe),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,De)],8,ze))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${b.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Me,8,Oe)]),t.value.useCustomCells&&s.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:x.value<=0?1e-4:x.value,width:w.value<=0?1e-4:w.value,class:"vue-ui-waffle-custom-cell-foreignObject"},[e.renderSlot(l.$slots,"cell",e.normalizeProps(e.guardReactiveProps({cell:{...a,color:s.value[o].color,...s.value[o]},isSelected:[null,void 0].includes(B.value)?!0:s.value[o].serieIndex===B.value})),void 0,!0)],8,Re))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:f.value.height-24,width:f.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,Ue)):s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:x.value<=0?1e-4:x.value,width:w.value<=0?1e-4:w.value,fill:"white",stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:A(s.value[o].serieIndex)},null,8,je))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:x.value<=0?1e-4:x.value,width:w.value<=0?1e-4:w.value,fill:t.value.style.chart.layout.rect.useGradient&&t.value.style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${b.value}_${o})`:s.value[o].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:A(s.value[o].serieIndex)},null,8,Ge))),256))],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[s.value.length&&!C.value&&!t.value.style.chart.layout.grid.vertical&&t.value.style.chart.layout.labels.captions.show&&(s.value[o].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||s.value[o].isAbsoluteFirst&&o%t.value.style.chart.layout.grid.size===0&&s.value[o].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:E.value<=0?1e-4:E.value,width:L.value*t.value.style.chart.layout.grid.size<=0?1e-4:L.value*t.value.style.chart.layout.grid.size,filter:A(s.value[o].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${t.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${L.value/12}px;color:${e.unref(n.adaptColorToBackground)(s.value[o].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",He,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(n.abbreviate)({source:s.value[o].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):s.value[o].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",Ye,e.toDisplayString(e.unref(n.dataLabel)({v:s.value[o].proportion,s:"%",r:t.value.style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",Xe," ("+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[o].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[o].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[o],position:a}))+") ",1)):e.createCommentVNode("",!0),!t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",Je,e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[o].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[o].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[o],position:a})),1)):e.createCommentVNode("",!0)],4)],8,We)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:u=>Ce(o),onMouseleave:r[0]||(r[0]=u=>{F.value=!1,B.value=null}),x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:E.value<=0?1e-4:E.value,width:L.value<=0?1e-4:L.value,fill:"transparent",stroke:"none"},null,40,Ke))),256)),e.renderSlot(l.$slots,"svg",{svg:k.value},void 0,!0)],14,Ee)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Qe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($e.default,{key:4,config:{type:"waffle",style:{backgroundColor:t.value.style.chart.backgroundColor,waffle:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:U},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Le.Legend,{key:`legend_${W.value}`,legendSet:_.value,config:xe.value,onClickMarker:r[1]||(r[1]=({legend:a})=>re(a.uid))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:o=>a.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,a.value,e.unref(n.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.legend.roundingValue,isAnimating:C.value}),{datapoint:a}))+" ",1),v.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",tt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",et," ("+e.toDisplayString(isNaN(a.value/y.value)?"-":e.unref(n.dataLabel)({v:a.value/y.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:C.value}))+") ",1))],12,Ze)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_.value},void 0,!0)],512),e.createVNode(Se._sfc_main,{show:m.value.showTooltip&&F.value&&v.value.length<p.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:N.value,content:D.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function",fontSize:t.value.style.chart.tooltip.fontSize},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...O.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...O.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize"]),V.value?(e.openBlock(),e.createBlock(Te.default,{key:5,hideDetails:"",config:{open:m.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ne.DataTable,{key:`table_${G.value}`,colNames:z.value.colNames,head:z.value.head,body:z.value.body,config:z.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]=a=>m.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,lt)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Ie))}},ot=Ve._export_sfc(at,[["__scopeId","data-v-a0574c0d"]]);exports.default=ot;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { computed as d, ref as c, watch as Te, onMounted as
|
|
2
|
-
import { u as Ke, c as Qe, t as Ze, a as et, p as B, o as tt, e as oe, g as lt, b as at, i as D, f as x, X as ot, s as ut, w as st, F as rt, I as nt, d as it, x as ct, y as vt, q as dt, r as ht } from "./index-
|
|
1
|
+
import { computed as d, ref as c, watch as Te, onMounted as We, onBeforeUnmount as qe, openBlock as s, createElementBlock as i, normalizeClass as Se, normalizeStyle as Q, createBlock as V, createCommentVNode as f, unref as h, createSlots as He, withCtx as b, renderSlot as w, normalizeProps as q, guardReactiveProps as H, createVNode as Le, createElementVNode as k, Fragment as T, renderList as M, toDisplayString as S, createTextVNode as Pe, nextTick as Xe, pushScopeId as Ye, popScopeId as Je } from "vue";
|
|
2
|
+
import { u as Ke, c as Qe, t as Ze, a as et, p as B, o as tt, e as oe, g as lt, b as at, i as D, f as x, X as ot, s as ut, w as st, F as rt, I as nt, d as it, x as ct, y as vt, q as dt, r as ht } from "./index-mBy4elhB.js";
|
|
3
3
|
import { t as pt, u as yt } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as ft } from "./Title-
|
|
5
|
-
import { u as gt, U as mt } from "./usePrinter-
|
|
6
|
-
import { _ as bt } from "./Tooltip-
|
|
7
|
-
import { D as wt } from "./DataTable-
|
|
8
|
-
import { L as kt } from "./Legend-
|
|
9
|
-
import xt from "./vue-ui-skeleton-
|
|
10
|
-
import Ct from "./vue-ui-accordion-
|
|
11
|
-
import { u as
|
|
12
|
-
import { _ as _t } from "./
|
|
13
|
-
|
|
4
|
+
import { _ as ft } from "./Title-CECK1w9L.js";
|
|
5
|
+
import { u as gt, U as mt } from "./usePrinter-Ck-yukK2.js";
|
|
6
|
+
import { _ as bt } from "./Tooltip-Ci3AprCm.js";
|
|
7
|
+
import { D as wt } from "./DataTable-BKc3r3k3.js";
|
|
8
|
+
import { L as kt } from "./Legend-WNL92WSx.js";
|
|
9
|
+
import xt from "./vue-ui-skeleton-DDhwPZd_.js";
|
|
10
|
+
import Ct from "./vue-ui-accordion-dyF20BlD.js";
|
|
11
|
+
import { u as ze } from "./useNestedProp-BrIRtQj1.js";
|
|
12
|
+
import { _ as _t } from "./PackageVersion-D9PU8glB.js";
|
|
13
|
+
import { _ as $t } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
|
+
const Fe = (G) => (Ye("data-v-a0574c0d"), G = G(), Je(), G), It = ["id"], Tt = ["xmlns", "viewBox"], St = ["id"], Lt = ["stop-color"], Pt = ["stop-color"], zt = ["id"], Ft = /* @__PURE__ */ Fe(() => /* @__PURE__ */ k("feGaussianBlur", {
|
|
14
15
|
in: "SourceGraphic",
|
|
15
16
|
stdDeviation: 2
|
|
16
|
-
}, null, -1)),
|
|
17
|
+
}, null, -1)), Nt = /* @__PURE__ */ Fe(() => /* @__PURE__ */ k("feColorMatrix", {
|
|
17
18
|
type: "saturate",
|
|
18
19
|
values: "0"
|
|
19
|
-
}, null, -1)),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
],
|
|
20
|
+
}, null, -1)), Bt = [
|
|
21
|
+
Ft,
|
|
22
|
+
Nt
|
|
23
|
+
], Ot = ["x", "y", "height", "width"], At = ["height", "width"], Vt = ["rx", "x", "y", "height", "width", "stroke", "stroke-width", "filter"], Mt = ["rx", "x", "y", "height", "width", "fill", "stroke", "stroke-width", "filter"], Dt = ["x", "y", "height", "width", "filter"], Gt = { key: 0 }, Rt = { key: 1 }, Ut = { key: 2 }, jt = { key: 3 }, Et = ["onMouseover", "x", "y", "height", "width"], Wt = {
|
|
23
24
|
key: 3,
|
|
24
25
|
class: "vue-data-ui-watermark"
|
|
25
|
-
},
|
|
26
|
+
}, qt = ["onClick"], Ht = { key: 0 }, Xt = { key: 1 }, Yt = ["innerHTML"], Jt = {
|
|
26
27
|
__name: "vue-ui-waffle",
|
|
27
28
|
props: {
|
|
28
29
|
config: {
|
|
@@ -39,18 +40,18 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
39
40
|
}
|
|
40
41
|
},
|
|
41
42
|
emits: ["selectLegend"],
|
|
42
|
-
setup(G, { expose:
|
|
43
|
-
const g = G, { vue_ui_waffle:
|
|
43
|
+
setup(G, { expose: Ne, emit: Be }) {
|
|
44
|
+
const g = G, { vue_ui_waffle: Oe } = Ke(), X = d(() => !!g.dataset && g.dataset.length), L = c(Qe()), Ae = c(null), Z = c(!1), ee = c(""), O = c(null), ue = c(0), R = c(null), se = c(null), re = c(null), ne = c(0), ie = c(0), ce = c(0), e = d({
|
|
44
45
|
get: () => ve(),
|
|
45
46
|
set: (t) => t
|
|
46
47
|
});
|
|
47
48
|
function ve() {
|
|
48
|
-
const t =
|
|
49
|
+
const t = ze({
|
|
49
50
|
userConfig: g.config,
|
|
50
|
-
defaultConfig:
|
|
51
|
+
defaultConfig: Oe
|
|
51
52
|
});
|
|
52
53
|
return t.theme ? {
|
|
53
|
-
...
|
|
54
|
+
...ze({
|
|
54
55
|
userConfig: Ze.vue_ui_waffle[t.theme] || g.config,
|
|
55
56
|
defaultConfig: t
|
|
56
57
|
}),
|
|
@@ -89,9 +90,9 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
89
90
|
Y.value = new ResizeObserver(t), Y.value.observe(R.value.parentNode);
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
|
-
|
|
93
|
+
We(() => {
|
|
93
94
|
de();
|
|
94
|
-
}),
|
|
95
|
+
}), qe(() => {
|
|
95
96
|
Y.value && Y.value.disconnect();
|
|
96
97
|
});
|
|
97
98
|
const { isPrinting: he, isImaging: pe, generatePdf: ye, generateImage: fe } = gt({
|
|
@@ -130,10 +131,10 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
130
131
|
Te(() => g.dataset, (t) => {
|
|
131
132
|
v.value = be();
|
|
132
133
|
}, { deep: !0 });
|
|
133
|
-
const
|
|
134
|
+
const Ve = d(() => {
|
|
134
135
|
const t = v.value.filter((o, l) => !p.value.includes(o.uid)).map((o, l) => (o.values || []).reduce((a, u) => a + u, 0));
|
|
135
136
|
return me(t);
|
|
136
|
-
}),
|
|
137
|
+
}), Me = d(() => {
|
|
137
138
|
const t = v.value.map((o, l) => (o.values || []).reduce((a, u) => a + u));
|
|
138
139
|
return me(t);
|
|
139
140
|
}), j = d(() => (g.dataset.forEach((t, o) => {
|
|
@@ -150,25 +151,25 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
150
151
|
color: t.color,
|
|
151
152
|
value: (t.values || []).reduce((l, a) => l + a, 0),
|
|
152
153
|
absoluteValues: t.values || [],
|
|
153
|
-
proportion:
|
|
154
|
-
})))),
|
|
154
|
+
proportion: Ve.value[o]
|
|
155
|
+
})))), De = d(() => v.value.map((t, o) => ({
|
|
155
156
|
absoluteIndex: t.absoluteIndex,
|
|
156
157
|
uid: t.uid,
|
|
157
158
|
name: t.name,
|
|
158
159
|
color: t.color,
|
|
159
160
|
value: (t.values || []).reduce((l, a) => l + a, 0),
|
|
160
161
|
absoluteValues: t.values || [],
|
|
161
|
-
proportion:
|
|
162
|
+
proportion: Me.value[o]
|
|
162
163
|
})));
|
|
163
|
-
function
|
|
164
|
-
return
|
|
164
|
+
function Ge() {
|
|
165
|
+
return De.value.map((t) => ({
|
|
165
166
|
name: t.name,
|
|
166
167
|
color: t.color,
|
|
167
168
|
value: t.value,
|
|
168
169
|
proportion: t.proportion
|
|
169
170
|
}));
|
|
170
171
|
}
|
|
171
|
-
const
|
|
172
|
+
const Re = d(() => {
|
|
172
173
|
let t = 0;
|
|
173
174
|
return j.value.map((o, l) => {
|
|
174
175
|
const a = t, u = a + o.proportion, n = [];
|
|
@@ -180,7 +181,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
180
181
|
rects: n
|
|
181
182
|
};
|
|
182
183
|
});
|
|
183
|
-
}), r = d(() =>
|
|
184
|
+
}), r = d(() => Re.value.flatMap((t, o) => t.rects.map((l, a) => ({
|
|
184
185
|
isFirst: a === 0,
|
|
185
186
|
isLongEnough: l.length > 2,
|
|
186
187
|
name: t.name,
|
|
@@ -237,7 +238,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
237
238
|
};
|
|
238
239
|
u();
|
|
239
240
|
}
|
|
240
|
-
|
|
241
|
+
Be("selectLegend", j.value.map((u) => ({
|
|
241
242
|
name: u.name,
|
|
242
243
|
color: u.color,
|
|
243
244
|
value: u.value,
|
|
@@ -256,7 +257,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
256
257
|
opacity: p.value.includes(t.uid) ? 0.5 : 1,
|
|
257
258
|
segregate: () => Ce(t.uid),
|
|
258
259
|
isSegregated: p.value.includes(t.uid)
|
|
259
|
-
}))),
|
|
260
|
+
}))), Ue = d(() => ({
|
|
260
261
|
cy: "waffle-div-legend",
|
|
261
262
|
backgroundColor: e.value.style.chart.legend.backgroundColor,
|
|
262
263
|
color: e.value.style.chart.legend.color,
|
|
@@ -264,7 +265,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
264
265
|
paddingBottom: 12,
|
|
265
266
|
fontWeight: e.value.style.chart.legend.bold ? "bold" : ""
|
|
266
267
|
})), _ = d(() => j.value.map((t) => t.value).reduce((t, o) => t + o, 0)), te = c(null);
|
|
267
|
-
function
|
|
268
|
+
function je(t) {
|
|
268
269
|
if (p.value.length === g.dataset.length) return;
|
|
269
270
|
const o = r.value[t];
|
|
270
271
|
te.value = {
|
|
@@ -390,7 +391,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
390
391
|
colNames: a
|
|
391
392
|
};
|
|
392
393
|
}), W = c(!1);
|
|
393
|
-
function
|
|
394
|
+
function Ee(t) {
|
|
394
395
|
W.value = t, ue.value += 1;
|
|
395
396
|
}
|
|
396
397
|
function $e() {
|
|
@@ -399,8 +400,8 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
399
400
|
function Ie() {
|
|
400
401
|
I.value.showTooltip = !I.value.showTooltip;
|
|
401
402
|
}
|
|
402
|
-
return
|
|
403
|
-
getData:
|
|
403
|
+
return Ne({
|
|
404
|
+
getData: Ge,
|
|
404
405
|
generatePdf: ye,
|
|
405
406
|
generateCsv: _e,
|
|
406
407
|
generateImage: fe,
|
|
@@ -435,7 +436,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
435
436
|
], 512)) : f("", !0),
|
|
436
437
|
e.value.userOptions.show && X.value ? (s(), V(mt, {
|
|
437
438
|
ref_key: "details",
|
|
438
|
-
ref:
|
|
439
|
+
ref: Ae,
|
|
439
440
|
key: `user_options_${ue.value}`,
|
|
440
441
|
backgroundColor: e.value.style.chart.backgroundColor,
|
|
441
442
|
color: e.value.style.chart.color,
|
|
@@ -453,13 +454,13 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
453
454
|
titles: { ...e.value.userOptions.buttonTitles },
|
|
454
455
|
chartElement: R.value,
|
|
455
456
|
position: e.value.userOptions.position,
|
|
456
|
-
onToggleFullscreen:
|
|
457
|
+
onToggleFullscreen: Ee,
|
|
457
458
|
onGeneratePdf: h(ye),
|
|
458
459
|
onGenerateCsv: _e,
|
|
459
460
|
onGenerateImage: h(fe),
|
|
460
461
|
onToggleTable: $e,
|
|
461
462
|
onToggleTooltip: Ie
|
|
462
|
-
},
|
|
463
|
+
}, He({ _: 2 }, [
|
|
463
464
|
t.$slots.optionTooltip ? {
|
|
464
465
|
name: "optionTooltip",
|
|
465
466
|
fn: b(() => [
|
|
@@ -510,6 +511,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
510
511
|
viewBox: `0 0 ${P.value.width <= 0 ? 10 : P.value.width} ${P.value.height <= 0 ? 10 : P.value.height}`,
|
|
511
512
|
style: Q(`max-width:100%;overflow:visible;background:transparent;color:${e.value.style.chart.color}`)
|
|
512
513
|
}, [
|
|
514
|
+
Le(_t),
|
|
513
515
|
k("defs", null, [
|
|
514
516
|
(s(!0), i(T, null, M(r.value, (l, a) => (s(), i("radialGradient", {
|
|
515
517
|
cx: "50%",
|
|
@@ -522,12 +524,12 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
522
524
|
k("stop", {
|
|
523
525
|
offset: "0%",
|
|
524
526
|
"stop-color": h(ut)(h(st)(l.color, 0.05), 100 - e.value.style.chart.layout.rect.gradientIntensity)
|
|
525
|
-
}, null, 8,
|
|
527
|
+
}, null, 8, Lt),
|
|
526
528
|
k("stop", {
|
|
527
529
|
offset: "100%",
|
|
528
530
|
"stop-color": l.color
|
|
529
|
-
}, null, 8,
|
|
530
|
-
], 8,
|
|
531
|
+
}, null, 8, Pt)
|
|
532
|
+
], 8, St))), 256))
|
|
531
533
|
]),
|
|
532
534
|
k("defs", null, [
|
|
533
535
|
k("filter", {
|
|
@@ -536,7 +538,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
536
538
|
y: "-50%",
|
|
537
539
|
width: "200%",
|
|
538
540
|
height: "200%"
|
|
539
|
-
},
|
|
541
|
+
}, Bt, 8, zt)
|
|
540
542
|
]),
|
|
541
543
|
e.value.useCustomCells && r.value.length ? (s(!0), i(T, { key: 0 }, M(E.value, (l, a) => (s(), i("foreignObject", {
|
|
542
544
|
x: l.x,
|
|
@@ -546,7 +548,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
546
548
|
class: "vue-ui-waffle-custom-cell-foreignObject"
|
|
547
549
|
}, [
|
|
548
550
|
w(t.$slots, "cell", q(H({ cell: { ...l, color: r.value[a].color, ...r.value[a] }, isSelected: [null, void 0].includes(O.value) ? !0 : r.value[a].serieIndex === O.value })), void 0, !0)
|
|
549
|
-
], 8,
|
|
551
|
+
], 8, Ot))), 256)) : f("", !0),
|
|
550
552
|
!r.value.length && !e.value.useCustomCells ? (s(), i("rect", {
|
|
551
553
|
key: 1,
|
|
552
554
|
x: 12,
|
|
@@ -556,7 +558,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
556
558
|
rx: 3,
|
|
557
559
|
fill: "none",
|
|
558
560
|
stroke: "black"
|
|
559
|
-
}, null, 8,
|
|
561
|
+
}, null, 8, At)) : r.value.length && !e.value.useCustomCells ? (s(), i(T, { key: 2 }, [
|
|
560
562
|
(s(!0), i(T, null, M(E.value, (l, a) => (s(), i("rect", {
|
|
561
563
|
rx: e.value.style.chart.layout.rect.rounded ? e.value.style.chart.layout.rect.rounding : 0,
|
|
562
564
|
x: l.x + e.value.style.chart.layout.grid.spaceBetween / 2,
|
|
@@ -567,7 +569,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
567
569
|
stroke: e.value.style.chart.layout.rect.stroke,
|
|
568
570
|
"stroke-width": e.value.style.chart.layout.rect.strokeWidth,
|
|
569
571
|
filter: le(r.value[a].serieIndex)
|
|
570
|
-
}, null, 8,
|
|
572
|
+
}, null, 8, Vt))), 256)),
|
|
571
573
|
(s(!0), i(T, null, M(E.value, (l, a) => (s(), i("rect", {
|
|
572
574
|
rx: e.value.style.chart.layout.rect.rounded ? e.value.style.chart.layout.rect.rounding : 0,
|
|
573
575
|
x: l.x + e.value.style.chart.layout.grid.spaceBetween / 2,
|
|
@@ -578,7 +580,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
578
580
|
stroke: e.value.style.chart.layout.rect.stroke,
|
|
579
581
|
"stroke-width": e.value.style.chart.layout.rect.strokeWidth,
|
|
580
582
|
filter: le(r.value[a].serieIndex)
|
|
581
|
-
}, null, 8,
|
|
583
|
+
}, null, 8, Mt))), 256))
|
|
582
584
|
], 64)) : f("", !0),
|
|
583
585
|
(s(!0), i(T, null, M(E.value, (l, a) => (s(), i(T, null, [
|
|
584
586
|
r.value.length && !N.value && !e.value.style.chart.layout.grid.vertical && e.value.style.chart.layout.labels.captions.show && (r.value[a].isFirst && l.position < e.value.style.chart.layout.grid.size - 2 || r.value[a].isAbsoluteFirst && a % e.value.style.chart.layout.grid.size === 0 && r.value[a].absoluteStartIndex) ? (s(), i("foreignObject", {
|
|
@@ -593,9 +595,9 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
593
595
|
class: "vue-ui-waffle-caption",
|
|
594
596
|
style: Q(`height: 100%; width: 100%; font-size:${e.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${U.value / 12}px;color:${h(rt)(r.value[a].color)};gap:2px`)
|
|
595
597
|
}, [
|
|
596
|
-
e.value.style.chart.layout.labels.captions.showSerieName ? (s(), i("span",
|
|
597
|
-
e.value.style.chart.layout.labels.captions.showPercentage ? (s(), i("span",
|
|
598
|
-
e.value.style.chart.layout.labels.captions.showPercentage && e.value.style.chart.layout.labels.captions.showValue ? (s(), i("span",
|
|
598
|
+
e.value.style.chart.layout.labels.captions.showSerieName ? (s(), i("span", Gt, S(e.value.style.chart.layout.labels.captions.serieNameAbbreviation ? h(nt)({ source: r.value[a].name, length: e.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize }) : r.value[a].name) + ": ", 1)) : f("", !0),
|
|
599
|
+
e.value.style.chart.layout.labels.captions.showPercentage ? (s(), i("span", Rt, S(h(x)({ v: r.value[a].proportion, s: "%", r: e.value.style.chart.layout.labels.captions.roundingPercentage })), 1)) : f("", !0),
|
|
600
|
+
e.value.style.chart.layout.labels.captions.showPercentage && e.value.style.chart.layout.labels.captions.showValue ? (s(), i("span", Ut, " (" + S(h(D)(
|
|
599
601
|
e.value.style.chart.layout.labels.dataLabels.formatter,
|
|
600
602
|
r.value[a].value,
|
|
601
603
|
h(x)({
|
|
@@ -606,7 +608,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
606
608
|
}),
|
|
607
609
|
{ datapoint: r.value[a], position: l }
|
|
608
610
|
)) + ") ", 1)) : f("", !0),
|
|
609
|
-
!e.value.style.chart.layout.labels.captions.showPercentage && e.value.style.chart.layout.labels.captions.showValue ? (s(), i("span",
|
|
611
|
+
!e.value.style.chart.layout.labels.captions.showPercentage && e.value.style.chart.layout.labels.captions.showValue ? (s(), i("span", jt, S(h(D)(
|
|
610
612
|
e.value.style.chart.layout.labels.dataLabels.formatter,
|
|
611
613
|
r.value[a].value,
|
|
612
614
|
h(x)({
|
|
@@ -618,10 +620,10 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
618
620
|
{ datapoint: r.value[a], position: l }
|
|
619
621
|
)), 1)) : f("", !0)
|
|
620
622
|
], 4)
|
|
621
|
-
], 8,
|
|
623
|
+
], 8, Dt)) : f("", !0)
|
|
622
624
|
], 64))), 256)),
|
|
623
625
|
(s(!0), i(T, null, M(E.value, (l, a) => (s(), i("rect", {
|
|
624
|
-
onMouseover: (u) =>
|
|
626
|
+
onMouseover: (u) => je(a),
|
|
625
627
|
onMouseleave: o[0] || (o[0] = (u) => {
|
|
626
628
|
Z.value = !1, O.value = null;
|
|
627
629
|
}),
|
|
@@ -631,10 +633,10 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
631
633
|
width: U.value <= 0 ? 1e-4 : U.value,
|
|
632
634
|
fill: "transparent",
|
|
633
635
|
stroke: "none"
|
|
634
|
-
}, null, 40,
|
|
636
|
+
}, null, 40, Et))), 256)),
|
|
635
637
|
w(t.$slots, "svg", { svg: P.value }, void 0, !0)
|
|
636
|
-
], 14,
|
|
637
|
-
t.$slots.watermark ? (s(), i("div",
|
|
638
|
+
], 14, Tt)) : f("", !0),
|
|
639
|
+
t.$slots.watermark ? (s(), i("div", Wt, [
|
|
638
640
|
w(t.$slots, "watermark", q(H({ isPrinting: h(he) || h(pe) })), void 0, !0)
|
|
639
641
|
])) : f("", !0),
|
|
640
642
|
X.value ? f("", !0) : (s(), V(xt, {
|
|
@@ -656,7 +658,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
656
658
|
e.value.style.chart.legend.show ? (s(), V(kt, {
|
|
657
659
|
key: `legend_${ce.value}`,
|
|
658
660
|
legendSet: A.value,
|
|
659
|
-
config:
|
|
661
|
+
config: Ue.value,
|
|
660
662
|
onClickMarker: o[1] || (o[1] = ({ legend: l }) => Ce(l.uid))
|
|
661
663
|
}, {
|
|
662
664
|
item: b(({ legend: l }) => [
|
|
@@ -664,7 +666,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
664
666
|
onClick: (a) => l.segregate(),
|
|
665
667
|
style: Q(`opacity:${p.value.includes(l.uid) ? 0.5 : 1}`)
|
|
666
668
|
}, [
|
|
667
|
-
|
|
669
|
+
Pe(S(l.name) + ": " + S(h(D)(
|
|
668
670
|
e.value.style.chart.layout.labels.dataLabels.formatter,
|
|
669
671
|
l.value,
|
|
670
672
|
h(x)({
|
|
@@ -676,8 +678,8 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
676
678
|
}),
|
|
677
679
|
{ datapoint: l }
|
|
678
680
|
)) + " ", 1),
|
|
679
|
-
p.value.includes(l.uid) ? (s(), i("span",
|
|
680
|
-
], 12,
|
|
681
|
+
p.value.includes(l.uid) ? (s(), i("span", Xt, " ( - % ) ")) : (s(), i("span", Ht, " (" + S(isNaN(l.value / _.value) ? "-" : h(x)({ v: l.value / _.value * 100, s: "%", r: e.value.style.chart.legend.roundingPercentage, isAnimating: N.value })) + ") ", 1))
|
|
682
|
+
], 12, qt)
|
|
681
683
|
]),
|
|
682
684
|
_: 1
|
|
683
685
|
}, 8, ["legendSet", "config"])) : w(t.$slots, "legend", {
|
|
@@ -685,7 +687,7 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
685
687
|
legend: A.value
|
|
686
688
|
}, void 0, !0)
|
|
687
689
|
], 512),
|
|
688
|
-
|
|
690
|
+
Le(bt, {
|
|
689
691
|
show: I.value.showTooltip && Z.value && p.value.length < g.dataset.length,
|
|
690
692
|
backgroundColor: e.value.style.chart.tooltip.backgroundColor,
|
|
691
693
|
color: e.value.style.chart.tooltip.color,
|
|
@@ -738,19 +740,19 @@ const ze = (G) => (Ye("data-v-a80f56d0"), G = G(), Je(), G), $t = ["id"], It = [
|
|
|
738
740
|
k("div", {
|
|
739
741
|
innerHTML: l,
|
|
740
742
|
style: { display: "flex", "align-items": "center" }
|
|
741
|
-
}, null, 8,
|
|
743
|
+
}, null, 8, Yt)
|
|
742
744
|
]),
|
|
743
745
|
td: b(({ td: l }) => [
|
|
744
|
-
|
|
746
|
+
Pe(S(l.name || l), 1)
|
|
745
747
|
]),
|
|
746
748
|
_: 1
|
|
747
749
|
}, 8, ["colNames", "head", "body", "config", "title"]))
|
|
748
750
|
]),
|
|
749
751
|
_: 1
|
|
750
752
|
}, 8, ["config"])) : f("", !0)
|
|
751
|
-
], 14,
|
|
753
|
+
], 14, It));
|
|
752
754
|
}
|
|
753
|
-
},
|
|
755
|
+
}, cl = /* @__PURE__ */ $t(Jt, [["__scopeId", "data-v-a0574c0d"]]);
|
|
754
756
|
export {
|
|
755
|
-
|
|
757
|
+
cl as default
|
|
756
758
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BhH89oF0.cjs"),U=require("./Title-Bg_BK11V.cjs"),I=require("./usePrinter-B8jr_V3b.cjs"),S=require("./useResponsive-B3TrDDIG.cjs"),V=require("./vue-ui-skeleton-Cf89QIhl.cjs"),z=require("./useNestedProp-m8IH8hWW.cjs"),G=require("./PackageVersion-LdLhc8hQ.cjs"),X=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["id"],H=["xmlns","viewBox"],D=["x1","x2","y1","y2","stroke","stroke-width","stroke-linecap"],Y=["cx","cy","r","stroke","stroke-width"],W=["x","y","font-size","fill","font-weight"],J={key:3,class:"vue-data-ui-watermark"},K={__name:"vue-ui-wheel",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(F,{expose:$}){const u=F,{vue_ui_wheel:O}=r.useConfig(),f=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length),y=e.ref(r.createUid()),M=e.ref(null),p=e.ref(0),h=e.ref(null),g=e.ref(null),k=e.ref(0),t=e.computed({get:()=>w(),set:l=>l});function w(){const l=z.useNestedProp({userConfig:u.config,defaultConfig:O});return l.theme?{...z.useNestedProp({userConfig:r.themes.vue_ui_wheel[l.theme]||u.config,defaultConfig:l})}:l}e.watch(()=>u.config,l=>{t.value=w(),P(),k.value+=1},{deep:!0});const{isPrinting:C,isImaging:b,generatePdf:_,generateImage:x}=I.usePrinter({elementId:y.value,fileName:t.value.style.chart.title.text||"vue-ui-wheel"}),n=e.ref({size:360,height:360,width:360}),m=e.ref(t.value.style.chart.layout.percentage.fontSize),s=e.computed(()=>({radius:Math.min(n.value.width,n.value.height)*.9/2,centerX:n.value.width/2,centerY:n.value.height/2}));function B(l,i=1){return{x:s.value.centerX+s.value.radius*Math.cos(29.85+l*Math.PI/180)*i,y:s.value.centerY+s.value.radius*Math.sin(29.85+l*Math.PI/180)*i}}const o=e.ref(t.value.style.chart.animation.use?0:u.dataset.percentage||0);e.watch(()=>u.dataset,l=>{t.value.style.chart.animation.use?N(l.percentage):o.value=l.percentage||0},{deep:!0});const v=e.ref(null);e.onMounted(()=>{P()});function P(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiWheel",type:"dataset"}),N(u.dataset.percentage||0),t.value.responsive){const l=S.throttle(()=>{const{width:i,height:a}=S.useResponsive({chart:h.value,title:t.value.style.chart.title.text?g.value:null});n.value.width=i,n.value.height=a,m.value=t.value.style.chart.layout.percentage.fontSize/360*Math.min(i,a)});v.value=new ResizeObserver(l),v.value.observe(h.value.parentNode)}}e.onBeforeUnmount(()=>{v.value&&v.value.disconnect()});function N(l){let i=t.value.style.chart.animation.speed;const a=Math.abs(l-o.value)/(i*120);function c(){o.value<l?o.value=Math.min(o.value+a,l):o.value>l&&(o.value=Math.max(o.value-a,l)),o.value!==l&&requestAnimationFrame(c)}c()}const E=e.computed(()=>{const l=[];for(let a=0;a<100;a+=1){const c=o.value>a?t.value.style.chart.layout.wheel.ticks.activeColor:t.value.style.chart.layout.wheel.ticks.inactiveColor,{x:A,y:T}=B(n.value.size/100*a),{x:L,y:R}=B(n.value.size/100*a,t.value.style.chart.layout.wheel.ticks.sizeRatio);l.push({x1:A,y1:T,x2:L,y2:R,color:t.value.style.chart.layout.wheel.ticks.gradient.show?r.shiftHue(c,a/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):c})}return l}),d=e.ref(!1);function q(l){d.value=l,p.value+=1}return $({generatePdf:_,generateImage:x}),(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-wheel",ref_key:"wheelChart",ref:h,id:y.value,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:g,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(U._sfc_main,{key:`title_${k.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(I.UserOptions,{ref_key:"details",ref:M,key:`user_options_${p.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(C),isImaging:e.unref(b),uid:y.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:d.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},chartElement:h.value,onToggleFullscreen:q,onGeneratePdf:e.unref(_),onGenerateImage:e.unref(x)},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:c})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:c})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","position","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":d.value,"vue-data-ui-fulscreen--off":!d.value}),viewBox:`0 0 ${n.value.width<=0?10:n.value.width} ${n.value.height<=0?10:n.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(G._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,(a,c)=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2,stroke:a.color,"stroke-width":5/360*Math.min(n.value.width,n.value.height),"stroke-linecap":t.value.style.chart.layout.wheel.ticks.rounded?"round":"butt",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&c<=o.value})},null,10,D))),256)),t.value.style.chart.layout.innerCircle.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:s.value.centerX,cy:s.value.centerY,r:s.value.radius*.8<=0?1e-4:s.value.radius*.8,stroke:t.value.style.chart.layout.innerCircle.stroke,"stroke-width":t.value.style.chart.layout.innerCircle.strokeWidth,fill:"none"},null,8,Y)):e.createCommentVNode("",!0),t.value.style.chart.layout.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:1,x:s.value.centerX,y:s.value.centerY+m.value/3,"font-size":m.value,fill:t.value.style.chart.layout.wheel.ticks.gradient.show?e.unref(r.shiftHue)(t.value.style.chart.layout.wheel.ticks.activeColor,o.value/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.wheel.ticks.activeColor,"text-anchor":"middle","font-weight":t.value.style.chart.layout.percentage.bold?"bold":"normal",style:{"font-variant-numeric":"tabluar-nums"}},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.percentage.formatter,e.unref(r.checkNaN)(o.value),e.unref(r.dataLabel)({v:e.unref(r.checkNaN)(o.value),s:"%",r:t.value.style.chart.layout.percentage.rounding}))),9,W)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,H)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",J,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(C)||e.unref(b)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:4,config:{type:"wheel",style:{backgroundColor:t.value.style.chart.backgroundColor,wheel:{color:"#CCCCCC"}}}},null,8,["config"]))],12,j))}},Q=X._export_sfc(K,[["__scopeId","data-v-b8e98e43"]]);exports.default=Q;
|