vue-data-ui 2.3.85 → 2.3.86
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-JwDgP3de.js → Arrow-CJ7hmWgf.js} +1 -1
- package/dist/{Arrow-CLOh6oi7.cjs → Arrow-CebZn6E4.cjs} +1 -1
- package/dist/{BaseIcon-BysUnfCR.js → BaseIcon-B9istAKo.js} +1 -1
- package/dist/{BaseIcon-BBQHz_Sf.cjs → BaseIcon-DnG75_Ol.cjs} +1 -1
- package/dist/{DataTable-pVXaNplZ.cjs → DataTable-BA_BCbHC.cjs} +1 -1
- package/dist/{DataTable-MkG5Dqrn.js → DataTable-tSDSY14n.js} +2 -2
- package/dist/{Legend-k2mcTp7z.cjs → Legend-BOY57qwA.cjs} +1 -1
- package/dist/{Legend-KW7sTwN3.js → Legend-D3hovFqM.js} +1 -1
- package/dist/{Shape-COoEWeGM.cjs → Shape-D6jrLLku.cjs} +1 -1
- package/dist/{Shape-BFiZBf3X.js → Shape-XiTBfhJM.js} +1 -1
- package/dist/{Slicer-CALc-Q4W.js → Slicer-BMvzmCKt.js} +2 -2
- package/dist/{Slicer-DCyxUSsn.cjs → Slicer-sZ-DArc4.cjs} +1 -1
- package/dist/{Title-BaKZYHEx.cjs → Title-Ahj4TYHa.cjs} +1 -1
- package/dist/{Title-ISDbzCH8.js → Title-DJ2FNrSN.js} +1 -1
- package/dist/{Tooltip-BHmMXOej.js → Tooltip-CQpXRqRC.js} +1 -1
- package/dist/{Tooltip-okAYzo5Y.cjs → Tooltip-XhevgJmm.cjs} +1 -1
- package/dist/index-CVgBMJU6.cjs +4 -0
- package/dist/{index-BiuHBtkZ.js → index-D2epy0rJ.js} +4 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +3 -0
- package/dist/types/vue-data-ui.d.ts +3 -0
- package/dist/{useNestedProp-B9yDavuy.cjs → useNestedProp-B-NmF2LO.cjs} +1 -1
- package/dist/{useNestedProp-Ck5_RzLu.js → useNestedProp-C_ZrJBd9.js} +1 -1
- package/dist/usePrinter-B6qtXaHk.js +527 -0
- package/dist/usePrinter-DN-6Hoh5.cjs +1 -0
- package/dist/{vue-data-ui-CVYCyzY-.cjs → vue-data-ui-DlNasA0G.cjs} +1 -1
- package/dist/{vue-data-ui-CAl2KJv9.js → vue-data-ui-vegY0BJm.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-CqRRjlUU.cjs +19 -0
- package/dist/{vue-ui-3d-bar-CploAEkY.js → vue-ui-3d-bar-D-0SSMOt.js} +11 -10
- package/dist/{vue-ui-accordion-btKAUUTu.cjs → vue-ui-accordion-BaV9R6cy.cjs} +1 -1
- package/dist/{vue-ui-accordion-D2fhyKpk.js → vue-ui-accordion-DzTB2FL0.js} +3 -3
- package/dist/vue-ui-age-pyramid-Bx4BuL3K.cjs +1 -0
- package/dist/{vue-ui-age-pyramid-DkaM5MrK.js → vue-ui-age-pyramid-_eo2DGen.js} +25 -24
- package/dist/{vue-ui-annotator-38FBI0Pn.js → vue-ui-annotator-8j2dJ0CU.js} +1 -1
- package/dist/{vue-ui-annotator-BMYk78DR.cjs → vue-ui-annotator-CDZtr6tp.cjs} +1 -1
- package/dist/{vue-ui-candlestick-CKsjq0Uw.js → vue-ui-candlestick-CsF7OSvJ.js} +12 -11
- package/dist/vue-ui-candlestick-NypxP0Uu.cjs +2 -0
- package/dist/{vue-ui-carousel-table-DjGaEuM7.js → vue-ui-carousel-table-CMHd2i-6.js} +7 -7
- package/dist/{vue-ui-carousel-table-Cx72LlTd.cjs → vue-ui-carousel-table-CV0eVeRd.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DAiBfoPN.cjs → vue-ui-chestnut-B9miwyAN.cjs} +2 -2
- package/dist/{vue-ui-chestnut-TLyh4dIZ.js → vue-ui-chestnut-CVftKftk.js} +10 -9
- package/dist/{vue-ui-cursor-BunDuWpK.cjs → vue-ui-cursor-Bsrt107X.cjs} +1 -1
- package/dist/{vue-ui-cursor-B1xa5yua.js → vue-ui-cursor-wujy8n_T.js} +2 -2
- package/dist/{vue-ui-dashboard-CMZ736DL.cjs → vue-ui-dashboard-BCN0BhjL.cjs} +1 -1
- package/dist/{vue-ui-dashboard-DdcubzWu.js → vue-ui-dashboard-Cvy0gI52.js} +2 -2
- package/dist/{vue-ui-digits-z5g__gqs.cjs → vue-ui-digits-CnHgzHPI.cjs} +1 -1
- package/dist/{vue-ui-digits-BUpjWWnD.js → vue-ui-digits-J-WrKKHg.js} +2 -2
- package/dist/{vue-ui-donut-ZLpfm-XT.js → vue-ui-donut-BOhWcHY_.js} +34 -33
- package/dist/vue-ui-donut-CZ1iKZq6.cjs +1 -0
- package/dist/{vue-ui-donut-evolution-Bn4asQO3.js → vue-ui-donut-evolution-CSSYuoti.js} +12 -11
- package/dist/vue-ui-donut-evolution-DuY2883r.cjs +1 -0
- package/dist/{vue-ui-dumbbell-D2R9tJ99.js → vue-ui-dumbbell-Cm0Rp_6W.js} +11 -10
- package/dist/{vue-ui-dumbbell-CY6X8J1K.cjs → vue-ui-dumbbell-i9QcsSVO.cjs} +2 -2
- package/dist/{vue-ui-flow-Dd5uPNTQ.js → vue-ui-flow-0m7a1NP7.js} +10 -9
- package/dist/vue-ui-flow-DXCBGdQT.cjs +1 -0
- package/dist/vue-ui-galaxy-D6GyjAnX.cjs +1 -0
- package/dist/{vue-ui-galaxy-B7CoWLhj.js → vue-ui-galaxy-DCHEdZAl.js} +12 -11
- package/dist/{vue-ui-gauge-CGh_m922.js → vue-ui-gauge-HcM2JJpg.js} +29 -28
- package/dist/vue-ui-gauge-wbHQGQro.cjs +1 -0
- package/dist/{vue-ui-gizmo-D5Kn7w7L.cjs → vue-ui-gizmo-B-zMyi1m.cjs} +1 -1
- package/dist/{vue-ui-gizmo-BY3hnKSH.js → vue-ui-gizmo-Bfo_nUnZ.js} +2 -2
- package/dist/{vue-ui-heatmap-yYN0u0I6.js → vue-ui-heatmap-CxIHmv0t.js} +41 -40
- package/dist/vue-ui-heatmap-Du2vI5Ae.cjs +1 -0
- package/dist/{vue-ui-kpi-Q20yM3IP.cjs → vue-ui-kpi-BOe7-M9V.cjs} +1 -1
- package/dist/{vue-ui-kpi-B4zr_geL.js → vue-ui-kpi-DibULfkp.js} +3 -3
- package/dist/{vue-ui-mini-loader-GFSZofpE.cjs → vue-ui-mini-loader-Bv7l-Kx3.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-GImbaGsN.js → vue-ui-mini-loader-qFRhERid.js} +2 -2
- package/dist/{vue-ui-molecule-DmrB3kgA.js → vue-ui-molecule-4cIGPnWg.js} +290 -286
- package/dist/vue-ui-molecule-eOj3ZjvT.cjs +1 -0
- package/dist/{vue-ui-mood-radar-sEkQtzI2.js → vue-ui-mood-radar-BTe21WKk.js} +79 -78
- package/dist/vue-ui-mood-radar-tUFqqekd.cjs +1 -0
- package/dist/{vue-ui-nested-donuts-DvpZLcYd.js → vue-ui-nested-donuts-BVzabOga.js} +35 -34
- package/dist/vue-ui-nested-donuts-BigBLrFR.cjs +17 -0
- package/dist/{vue-ui-onion-DQMLPe3M.js → vue-ui-onion-C3TAKqro.js} +12 -11
- package/dist/vue-ui-onion-_ZC3vbIS.cjs +5 -0
- package/dist/{vue-ui-parallel-coordinate-plot-BBuPdl2K.cjs → vue-ui-parallel-coordinate-plot-BiXGkfj7.cjs} +2 -2
- package/dist/{vue-ui-parallel-coordinate-plot-DN2LPNyS.js → vue-ui-parallel-coordinate-plot-CKoCQXqj.js} +13 -12
- package/dist/vue-ui-quadrant-B67wGTic.cjs +1 -0
- package/dist/{vue-ui-quadrant-D2GpeXI6.js → vue-ui-quadrant-CKnyfJoi.js} +13 -12
- package/dist/vue-ui-quick-chart-DEjdx0AB.cjs +15 -0
- package/dist/{vue-ui-quick-chart-C5K9DfUV.js → vue-ui-quick-chart-DZDYYnsI.js} +60 -59
- package/dist/vue-ui-radar-Cm_QkYGb.cjs +1 -0
- package/dist/{vue-ui-radar-B9TZPujK.js → vue-ui-radar-v9yayJxu.js} +13 -12
- package/dist/{vue-ui-rating-B0pNsmGB.js → vue-ui-rating-Cc_N7qbe.js} +2 -2
- package/dist/{vue-ui-rating-DpxzUDQq.cjs → vue-ui-rating-DV4cCZbB.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-DSnlpLHt.js → vue-ui-relation-circle-Clqo4kkb.js} +46 -45
- package/dist/{vue-ui-relation-circle-D3B-lpdM.cjs → vue-ui-relation-circle-DcpIVbI6.cjs} +1 -1
- package/dist/{vue-ui-rings-BuvFDBXg.js → vue-ui-rings-D27xNq9q.js} +12 -11
- package/dist/{vue-ui-rings-cmeFVitd.cjs → vue-ui-rings-DTn3t8Ku.cjs} +2 -2
- package/dist/{vue-ui-scatter-D_chvOSJ.js → vue-ui-scatter-C07Mon-6.js} +13 -12
- package/dist/vue-ui-scatter-CXbrqLFm.cjs +1 -0
- package/dist/{vue-ui-screenshot-DSHeHshf.js → vue-ui-screenshot-CsxqbqlJ.js} +1 -1
- package/dist/{vue-ui-screenshot-CwrXLMru.cjs → vue-ui-screenshot-D8TAvQYN.cjs} +1 -1
- package/dist/{vue-ui-skeleton-Du4zw-c1.js → vue-ui-skeleton-BLiYyX95.js} +2 -2
- package/dist/{vue-ui-skeleton-DJhwv2oY.cjs → vue-ui-skeleton-Br1K3exH.cjs} +1 -1
- package/dist/{vue-ui-smiley-BtQLJ7rA.js → vue-ui-smiley-BUHatT3Z.js} +2 -2
- package/dist/{vue-ui-smiley-BNkk6suC.cjs → vue-ui-smiley-CR_TkSYT.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-DFIjxBTY.cjs → vue-ui-spark-trend-CnUz6s1m.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-BgA79g7a.js → vue-ui-spark-trend-GY2CfYRt.js} +4 -4
- package/dist/{vue-ui-sparkbar-BlwQfhlY.cjs → vue-ui-sparkbar-DaFwUA6Z.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-DQAWZReF.js → vue-ui-sparkbar-tdgek1gv.js} +3 -3
- package/dist/{vue-ui-sparkgauge-CCApU38s.js → vue-ui-sparkgauge-1zu5KmTA.js} +3 -3
- package/dist/{vue-ui-sparkgauge-BCRSQDpt.cjs → vue-ui-sparkgauge-D8P01Hem.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-PKTt4EmH.js → vue-ui-sparkhistogram-b68QStxA.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-CTxG1Vtn.cjs → vue-ui-sparkhistogram-mg6yuwLH.cjs} +1 -1
- package/dist/{vue-ui-sparkline-BUaixngQ.cjs → vue-ui-sparkline-CAqav9Gn.cjs} +1 -1
- package/dist/{vue-ui-sparkline-EESAiZyt.js → vue-ui-sparkline-CMmtp8MK.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-TnLNixdf.js → vue-ui-sparkstackbar-Cz8tOM3m.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-iQnc0zcO.cjs → vue-ui-sparkstackbar-DOrquZvw.cjs} +1 -1
- package/dist/vue-ui-stackbar-DUa5F_Zl.cjs +6 -0
- package/dist/{vue-ui-stackbar-Ci04sup3.js → vue-ui-stackbar-DeQkP1dj.js} +13 -12
- package/dist/vue-ui-strip-plot-KNL9ToYG.cjs +1 -0
- package/dist/{vue-ui-strip-plot-DbvW0BuF.js → vue-ui-strip-plot-vqOCzdFV.js} +12 -11
- package/dist/{vue-ui-table-328De4vk.cjs → vue-ui-table-BCdHNku5.cjs} +1 -1
- package/dist/{vue-ui-table-CamkBCdL.js → vue-ui-table-DDdVqdHt.js} +1 -1
- package/dist/vue-ui-table-heatmap-BJDnZMZN.cjs +1 -0
- package/dist/{vue-ui-table-heatmap-D-YdrvGV.js → vue-ui-table-heatmap-DQg_jtYq.js} +27 -26
- package/dist/{vue-ui-table-sparkline-Dg2RKv6f.js → vue-ui-table-sparkline-Bg-VFq7X.js} +25 -24
- package/dist/{vue-ui-table-sparkline-Cmg7wnQ0.cjs → vue-ui-table-sparkline-D8DJxb5J.cjs} +1 -1
- package/dist/{vue-ui-thermometer-jWHbZTc2.js → vue-ui-thermometer-CajBbbYc.js} +51 -50
- package/dist/vue-ui-thermometer-eYM8DX7u.cjs +1 -0
- package/dist/{vue-ui-timer-BPepr5eV.js → vue-ui-timer-D3VRVK-8.js} +4 -4
- package/dist/{vue-ui-timer-B_FyRAU7.cjs → vue-ui-timer-RclP4Tql.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-DW8Q2IBl.js → vue-ui-tiremarks-BT0k_3xi.js} +48 -47
- package/dist/{vue-ui-tiremarks-CaJWlyz8.cjs → vue-ui-tiremarks-Bc8bBBAw.cjs} +1 -1
- package/dist/{vue-ui-treemap-B9GpvA0k.cjs → vue-ui-treemap-BjWDt2b2.cjs} +1 -1
- package/dist/{vue-ui-treemap-CWu43qLo.js → vue-ui-treemap-DMhe3zCm.js} +13 -12
- package/dist/vue-ui-vertical-bar-DWzafNBH.cjs +4 -0
- package/dist/{vue-ui-vertical-bar-CndASePh.js → vue-ui-vertical-bar-hH9R9V-K.js} +13 -12
- package/dist/{vue-ui-waffle-c9ycdoKz.cjs → vue-ui-waffle-BvYE9hAY.cjs} +1 -1
- package/dist/{vue-ui-waffle-CdyqwJwN.js → vue-ui-waffle-DnNd6Iba.js} +46 -45
- package/dist/{vue-ui-wheel-Byq_BLhl.js → vue-ui-wheel-Bx9_m-7W.js} +34 -33
- package/dist/vue-ui-wheel-CVBmY6h7.cjs +1 -0
- package/dist/{vue-ui-word-cloud-BVOcsuMP.cjs → vue-ui-word-cloud-3R-mYkIW.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-BRxN5uFD.js → vue-ui-word-cloud-DUk0Xt8q.js} +10 -9
- package/dist/{vue-ui-xy-DgEdZz0O.js → vue-ui-xy-FtaqoNK8.js} +161 -160
- package/dist/{vue-ui-xy-canvas-BI7jUOTn.js → vue-ui-xy-canvas-Bp4PTl_E.js} +54 -53
- package/dist/{vue-ui-xy-canvas-Td0WNYN0.cjs → vue-ui-xy-canvas-Ctw_3PzN.cjs} +2 -2
- package/dist/vue-ui-xy-rX-aml0b.cjs +3 -0
- package/package.json +1 -1
- package/dist/index-D-vy9N1v.cjs +0 -4
- package/dist/usePrinter-Do8KiK5h.js +0 -513
- package/dist/usePrinter-P4nLcXX-.cjs +0 -1
- package/dist/vue-ui-3d-bar-DlUqKETN.cjs +0 -19
- package/dist/vue-ui-age-pyramid-CvSoQ1op.cjs +0 -1
- package/dist/vue-ui-candlestick-BJulnyV3.cjs +0 -2
- package/dist/vue-ui-donut-TY2Z9Ljx.cjs +0 -1
- package/dist/vue-ui-donut-evolution-BEm2dOxe.cjs +0 -1
- package/dist/vue-ui-flow-DswsuPwy.cjs +0 -1
- package/dist/vue-ui-galaxy-Dxy6jzus.cjs +0 -1
- package/dist/vue-ui-gauge-CWd_ol6u.cjs +0 -1
- package/dist/vue-ui-heatmap-AUm42a1v.cjs +0 -1
- package/dist/vue-ui-molecule-C9FcDH4x.cjs +0 -1
- package/dist/vue-ui-mood-radar-CRwStVTV.cjs +0 -1
- package/dist/vue-ui-nested-donuts-BcOgxtZV.cjs +0 -17
- package/dist/vue-ui-onion-C9v9YjdJ.cjs +0 -5
- package/dist/vue-ui-quadrant-ulY-rCMI.cjs +0 -1
- package/dist/vue-ui-quick-chart-DFj17h6h.cjs +0 -15
- package/dist/vue-ui-radar-KA287Tp-.cjs +0 -1
- package/dist/vue-ui-scatter-BWPqoSUN.cjs +0 -1
- package/dist/vue-ui-stackbar-Rrcyg4CC.cjs +0 -6
- package/dist/vue-ui-strip-plot-CowHumiU.cjs +0 -1
- package/dist/vue-ui-table-heatmap-CCHre3Gt.cjs +0 -1
- package/dist/vue-ui-thermometer-BDeKErC9.cjs +0 -1
- package/dist/vue-ui-vertical-bar-a_41JdIn.cjs +0 -4
- package/dist/vue-ui-wheel-B3BMfKmd.cjs +0 -1
- package/dist/vue-ui-xy-CsS5ny0q.cjs +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-D-vy9N1v.cjs"),$e=require("./Title-BaKZYHEx.cjs"),ce=require("./usePrinter-P4nLcXX-.cjs"),Se=require("./Tooltip-okAYzo5Y.cjs"),Ne=require("./Legend-k2mcTp7z.cjs"),Be=require("./vue-ui-skeleton-DJhwv2oY.cjs"),_e=require("./DataTable-pVXaNplZ.cjs"),ze=require("./vue-ui-accordion-btKAUUTu.cjs"),de=require("./useResponsive-B3TrDDIG.cjs"),ve=require("./useNestedProp-B9yDavuy.cjs"),Pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function he(n,d){const s=n.length;if(s===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let u=1/0,i=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>i&&(i=p),v+=p}return Math.max(d**2*i/v**2,v**2/(d**2*u))}}function pe(n){const{xOffset:d,yOffset:s,width:u,height:i}=n;return{x0:d,y0:s,x1:d+u,y1:s+i}}function Oe(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),i=he(n,s),v=he(u,s);return i>=v}}function Ee(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const i=n[u],v=i.length;for(let h=0;h<v;h+=1)d.push(i[h])}return d}function Ve(n,d){const s={...d,children:n};return ge(s)}function Le(n){return(n.x1-n.x0)*(n.y1-n.y0)}function fe(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=G(d),h=n.length,f=n.map(m=>m.normalizedValue||0).reduce((m,k)=>m+k,0),p=f/u,C=f/s;let b=i,w=v;const g=[];if(s>=u){for(let m=0;m<h;m+=1){const k=n[m],x=w+k.normalizedValue/p,B={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,B);w=x,g.push(T)}return g}else{for(let m=0;m<h;m+=1){const k=n[m],x=b+k.normalizedValue/C,B={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,B);b=x,g.push(T)}return g}}function Re(n){const d=G(n),s=d.width,u=d.height;return Math.min(s,u)}function Fe(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),i=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(i||0)}),v.push(h);return v}function G(n){const{x0:d,y0:s,x1:u,y1:i}=n;return{xOffset:d,yOffset:s,width:u-d,height:i-s}}function Ie(n,d,s,u){let i=n,v=d,h=s,f=u;for(;;){const p=i.length;if(p===0){const g=fe(v,h);return f.concat(g)}const C=Re(h),b=i[0],w=i.slice(1,p);if(Oe(v,b,C)){const g=v.concat(b);i=w,v=g,h=h,f=f}else{const g=v.length;let m=0;for(let T=0;T<g;T+=1)m+=v[T].normalizedValue;const k=De(h,m),x=fe(v,h),B=f.concat(x);i=i,v=[],h=k,f=B}}}function ge(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=Fe(n.children,Le(n)),s=Ie(d,[],n,[]),u=s.length,i=[];for(let h=0;h<u;h+=1)i.push(ge(s[h]));return Ee(i)}}function De(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=G(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:i+h,yOffset:v,width:f,height:u};return pe(p)}else{const h=d/s,f=u-h,p={xOffset:i,yOffset:v+h,width:s,height:f};return pe(p)}}const qe=n=>(e.pushScopeId("data-v-18b05952"),n=n(),e.popScopeId(),n),Ae=["id"],He=["xmlns","viewBox"],Me={key:0},We=["id"],Ue=["stop-color"],Ge=["stop-color"],je=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],Xe=["x","y","height","width"],Ye={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},Ze=qe(()=>e.createElementVNode("br",null,null,-1)),Je={key:3,class:"vue-data-ui-watermark"},Ke=["onClick"],Qe={key:0},et={key:1},tt=["innerHTML"],lt={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:d,emit:s}){const u=n,{vue_ui_treemap:i}=r.useConfig(),v=e.computed(()=>!!u.dataset&&u.dataset.length),h=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),f=e.ref(r.createUid()),p=e.ref(!1),C=e.ref(""),b=e.ref(!1),w=e.ref(0),g=e.ref([]),m=e.ref(null),k=e.ref(null),x=e.ref(null),B=e.ref(0),T=e.ref(0),j=e.ref(0),t=e.computed({get:()=>X(),set:l=>l});function X(){const l=ve.useNestedProp({userConfig:u.config,defaultConfig:i});return l.theme?{...ve.useNestedProp({userConfig:r.themes.vue_ui_treemap[l.theme]||u.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>u.config,l=>{t.value=X(),B.value+=1,T.value+=1,j.value+=1},{deep:!0});const{isPrinting:Y,isImaging:Z,generatePdf:J,generateImage:K}=ce.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),D=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),_=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),z=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),O=e.computed(()=>({bottom:z.value.height-t.value.style.chart.padding.bottom,height:z.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:z.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:z.value.height,vbWidth:z.value.width,width:z.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function Q(l){l.forEach((a,o)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||D.value[o]||r.palette[o]||r.palette[o%r.palette.length],a.children&&(a.children.forEach(c=>{c.parentId=a.id,c.color=a.color}),Q(a.children))})}const E=e.ref(u.dataset),q=e.ref(null);e.onMounted(()=>{me()});function me(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),Q(E.value),t.value.responsive){const l=de.throttle(()=>{const{width:a,height:o}=de.useResponsive({chart:m.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null});z.value.width=a,z.value.height=o});q.value=new ResizeObserver(l),q.value.observe(m.value.parentNode)}}e.onBeforeUnmount(()=>{q.value&&q.value.disconnect()});const M=e.ref(E.value),F=e.computed(()=>M.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||D.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(l=>!g.value.includes(l.id))),L=e.computed(()=>E.value.filter(l=>!g.value.includes(l.id)).map(l=>l.value||0).reduce((l,a)=>l+a,0)),ee=e.computed({get(){let l=[...F.value];return t.value.style.chart.layout.sorted&&(l=[...F.value].sort((a,o)=>o.value-a.value)),l.map(a=>({...a}))},set(l){return l}});function te(l,a){return l.value/a}function ye(l,a,o){const c=t.value.style.chart.layout.rects.colorRatio-te(a,o);return r.lightenHexColor(l,c<0?0:c)}function le(l,a,o,c){return l.map((y,P)=>{const H=ye(r.convertColorToHex(a)||D.value[P]||r.palette[P]||r.palette[P%r.palette.length],y,c),Te=te(y,c);return{...y,color:H,proportion:Te,parentName:o,children:y.children?le(y.children,H,y.name,c):void 0}})}const I=e.computed(()=>Ve(ee.value.map((l,a)=>{const o=l.children?l.children.reduce((c,y)=>c+y.value,0):l.value;return{value:l.value,id:l.id,children:l.children?le(l.children.sort((c,y)=>y.value-c.value),l.color,l.name,o):void 0,color:l.color,name:l.name}}),{x0:O.value.left*2,y0:O.value.top,x1:O.value.width,y1:O.value.height}));function oe({y0:l,y1:a}){return a-l<=0?1e-4:a-l}function ae({x0:l,x1:a}){return a-l<=0?1e-4:a-l}function V(l){const a=t.value.style.chart.layout.labels.fontSize*(l.proportion*2>1?1:l.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function be(l){b.value=l,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:O.value.vbWidth,height:O.value.vbHeight})),$=e.ref(!1);function W(l,a=E.value){for(const o of a){if(o.id===l)return o;if(o.children){const c=W(l,o.children);if(c)return c}}return null}function ke(l){if($.value)s("selectDatapoint",void 0),M.value=E.value;else{if(s("selectDatapoint",l),!W(l.parentId))return;M.value=[W(l.parentId)]}$.value=!$.value}const S=e.ref(null),ne=e.computed(()=>E.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||D.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((l,a)=>a.value-l.value).map((l,a)=>({...l,proportion:l.value/E.value.map(o=>o.value).reduce((o,c)=>o+c,0),opacity:g.value.includes(l.id)?.5:1}))),Ce=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function re(l){$.value=!1,S.value=null,g.value.includes(l.id)?g.value=g.value.filter(a=>a!==l.id):g.value.length<u.dataset.length-1&&g.value.push(l.id),s("selectLegend",ee.value)}const U=e.ref(null);function we({datapoint:l,seriesIndex:a}){S.value=l,U.value={datapoint:l,seriesIndex:a,config:t.value,series:F.value};const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:a,datapoint:l,series:F.value,config:t.value})))C.value=o({seriesIndex:a,datapoint:l,series:F.value,config:t.value});else{let c="";c+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,c+=`<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" fill="${l.color}"/></svg>`,c+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:a})}</b>`,C.value=`<div>${c}</div>`}p.value=!0}const N=e.computed(()=>{const l=I.value.map(o=>({name:o.name,color:o.color})),a=I.value.map(o=>o.value);return{head:l,body:a}});function ue(){e.nextTick(()=>{const l=N.value.head.map((c,y)=>[[c.name],[N.value.body[y]],[isNaN(N.value.body[y]/L.value)?"-":N.value.body[y]/L.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const A=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,P)=>{const H=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[P],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[P],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},H,isNaN(N.value.body[P]/L.value)?"-":r.dataLabel({v:N.value.body[P]/L.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:a,config:o}});function xe(){return I.value}function se(){_.value.showTable=!_.value.showTable}function ie(){_.value.showTooltip=!_.value.showTooltip}return d({getData:xe,generateCsv:ue,generateImage:K,generatePdf:J,toggleTable:se,toggleTooltip:ie}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:m,class:e.normalizeClass(`vue-ui-treemap ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock($e._sfc_main,{key:`title_${B.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&v.value?(e.openBlock(),e.createBlock(ce.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Y),isImaging:e.unref(Z),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:_.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,onToggleFullscreen:be,onGeneratePdf:e.unref(J),onGenerateCsv:ue,onGenerateImage:e.unref(K),onToggleTable:se,onToggleTooltip:ie},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:c})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:c})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!$.value,"vue-data-ui-zoom-minus":$.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Me,[e.createElementVNode("radialGradient",{id:`tgrad_${o.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":o.color},null,8,Ue),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Ge)],8,We)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:o.x0,y:o.y0,height:oe(o),width:ae(o),fill:h.value?o.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${o.id})`:o.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>ke(o),onMouseenter:()=>we({datapoint:o,seriesIndex:c}),onMouseleave:a[0]||(a[0]=y=>{S.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${S.value?S.value.id===o.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,je),(e.openBlock(),e.createElementBlock("foreignObject",{x:o.x0,y:o.y0,height:oe(o),width:ae(o),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",Ye,[t.value.style.chart.layout.labels.showDefaultLabels&&(o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${V(o)/1.5}px);text-align:left;line-height:${V(o)<14?14:V(o)}px;padding:${V(o)/3}px; color:${e.unref(r.adaptColorToBackground)(o.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(o.name),5),Ze,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:o})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:o,shouldShow:o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value,fontSize:V(o),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(o.color)})),void 0,!0)])],8,Xe))]))),256)),e.renderSlot(l.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:O.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,He)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Y)||e.unref(Z)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Be.default,{key:4,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:x},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Ne.Legend,{key:`legend_${j.value}`,legendSet:ne.value,config:Ce.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:o})=>re(o))},{item:e.withCtx(({legend:o,index:c})=>[e.createElementVNode("div",{onClick:y=>re(o),style:e.normalizeStyle(`opacity:${g.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:o}))+" ",1),g.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",et," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Qe," ("+e.toDisplayString(isNaN(o.value/L.value)?"-":(o.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,Ke)]),_:1},8,["legendSet","config","id"])):e.renderSlot(l.$slots,"legend",{key:1,legend:ne.value},void 0,!0)],512),e.createVNode(Se._sfc_main,{show:_.value.showTooltip&&p.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:m.value,content:C.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...U.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...U.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),v.value?(e.openBlock(),e.createBlock(ze.default,{key:5,hideDetails:"",config:{open:_.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(_e.DataTable,{key:`table_${T.value}`,colNames:A.value.colNames,head:A.value.head,body:A.value.body,config:A.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=o=>_.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,tt)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Ae))}},ot=Pe._export_sfc(lt,[["__scopeId","data-v-18b05952"]]);exports.default=ot;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CVgBMJU6.cjs"),$e=require("./Title-Ahj4TYHa.cjs"),ce=require("./usePrinter-DN-6Hoh5.cjs"),Se=require("./Tooltip-XhevgJmm.cjs"),Ne=require("./Legend-BOY57qwA.cjs"),Be=require("./vue-ui-skeleton-Br1K3exH.cjs"),_e=require("./DataTable-BA_BCbHC.cjs"),ze=require("./vue-ui-accordion-BaV9R6cy.cjs"),de=require("./useResponsive-B3TrDDIG.cjs"),ve=require("./useNestedProp-B-NmF2LO.cjs"),Pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function he(n,d){const s=n.length;if(s===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let u=1/0,i=-1/0,v=0;for(let f=0;f<s;f+=1){const p=n[f].normalizedValue;p<u&&(u=p),p>i&&(i=p),v+=p}return Math.max(d**2*i/v**2,v**2/(d**2*u))}}function pe(n){const{xOffset:d,yOffset:s,width:u,height:i}=n;return{x0:d,y0:s,x1:d+u,y1:s+i}}function Oe(n,d,s){if(n.length===0)return!0;{const u=n.concat(d),i=he(n,s),v=he(u,s);return i>=v}}function Ee(n){const d=[],s=n.length;for(let u=0;u<s;u+=1){const i=n[u],v=i.length;for(let h=0;h<v;h+=1)d.push(i[h])}return d}function Ve(n,d){const s={...d,children:n};return ge(s)}function Le(n){return(n.x1-n.x0)*(n.y1-n.y0)}function fe(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=G(d),h=n.length,f=n.map(m=>m.normalizedValue||0).reduce((m,k)=>m+k,0),p=f/u,C=f/s;let b=i,w=v;const g=[];if(s>=u){for(let m=0;m<h;m+=1){const k=n[m],x=w+k.normalizedValue/p,B={x0:b,y0:w,x1:b+p,y1:x},T=Object.assign({},k,B);w=x,g.push(T)}return g}else{for(let m=0;m<h;m+=1){const k=n[m],x=b+k.normalizedValue/C,B={x0:b,y0:w,x1:x,y1:w+C},T=Object.assign({},k,B);b=x,g.push(T)}return g}}function Re(n){const d=G(n),s=d.width,u=d.height;return Math.min(s,u)}function Fe(n,d){const s=n.length,u=n.map(p=>p.value??0).reduce((p,C)=>p+C,0),i=d/u,v=[];let h,f;for(let p=0;p<s;p+=1)f=n[p],h=Object.assign({},f,{normalizedValue:f.value*(i||0)}),v.push(h);return v}function G(n){const{x0:d,y0:s,x1:u,y1:i}=n;return{xOffset:d,yOffset:s,width:u-d,height:i-s}}function Ie(n,d,s,u){let i=n,v=d,h=s,f=u;for(;;){const p=i.length;if(p===0){const g=fe(v,h);return f.concat(g)}const C=Re(h),b=i[0],w=i.slice(1,p);if(Oe(v,b,C)){const g=v.concat(b);i=w,v=g,h=h,f=f}else{const g=v.length;let m=0;for(let T=0;T<g;T+=1)m+=v[T].normalizedValue;const k=De(h,m),x=fe(v,h),B=f.concat(x);i=i,v=[],h=k,f=B}}}function ge(n){if(typeof n.children>"u"||!n.children.length)return[n];{const d=Fe(n.children,Le(n)),s=Ie(d,[],n,[]),u=s.length,i=[];for(let h=0;h<u;h+=1)i.push(ge(s[h]));return Ee(i)}}function De(n,d){const{width:s,height:u,xOffset:i,yOffset:v}=G(n);if(s>=u){const h=d/u,f=s-h,p={xOffset:i+h,yOffset:v,width:f,height:u};return pe(p)}else{const h=d/s,f=u-h,p={xOffset:i,yOffset:v+h,width:s,height:f};return pe(p)}}const qe=n=>(e.pushScopeId("data-v-9e17b718"),n=n(),e.popScopeId(),n),Ae=["id"],He=["xmlns","viewBox"],Me={key:0},We=["id"],Ue=["stop-color"],Ge=["stop-color"],je=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],Xe=["x","y","height","width"],Ye={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},Ze=qe(()=>e.createElementVNode("br",null,null,-1)),Je={key:3,class:"vue-data-ui-watermark"},Ke=["onClick"],Qe={key:0},et={key:1},tt=["innerHTML"],lt={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:d,emit:s}){const u=n,{vue_ui_treemap:i}=r.useConfig(),v=e.computed(()=>!!u.dataset&&u.dataset.length),h=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),f=e.ref(r.createUid()),p=e.ref(!1),C=e.ref(""),b=e.ref(!1),w=e.ref(0),g=e.ref([]),m=e.ref(null),k=e.ref(null),x=e.ref(null),B=e.ref(0),T=e.ref(0),j=e.ref(0),t=e.computed({get:()=>X(),set:l=>l});function X(){const l=ve.useNestedProp({userConfig:u.config,defaultConfig:i});return l.theme?{...ve.useNestedProp({userConfig:r.themes.vue_ui_treemap[l.theme]||u.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>u.config,l=>{t.value=X(),B.value+=1,T.value+=1,j.value+=1},{deep:!0});const{isPrinting:Y,isImaging:Z,generatePdf:J,generateImage:K}=ce.usePrinter({elementId:`treemap_${f.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),D=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),_=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),z=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),O=e.computed(()=>({bottom:z.value.height-t.value.style.chart.padding.bottom,height:z.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:z.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:z.value.height,vbWidth:z.value.width,width:z.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function Q(l){l.forEach((a,o)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||D.value[o]||r.palette[o]||r.palette[o%r.palette.length],a.children&&(a.children.forEach(c=>{c.parentId=a.id,c.color=a.color}),Q(a.children))})}const E=e.ref(u.dataset),q=e.ref(null);e.onMounted(()=>{me()});function me(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),Q(E.value),t.value.responsive){const l=de.throttle(()=>{const{width:a,height:o}=de.useResponsive({chart:m.value,title:t.value.style.chart.title.text?k.value:null,legend:t.value.style.chart.legend.show?x.value:null});z.value.width=a,z.value.height=o});q.value=new ResizeObserver(l),q.value.observe(m.value.parentNode)}}e.onBeforeUnmount(()=>{q.value&&q.value.disconnect()});const M=e.ref(E.value),F=e.computed(()=>M.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||D.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(l=>!g.value.includes(l.id))),L=e.computed(()=>E.value.filter(l=>!g.value.includes(l.id)).map(l=>l.value||0).reduce((l,a)=>l+a,0)),ee=e.computed({get(){let l=[...F.value];return t.value.style.chart.layout.sorted&&(l=[...F.value].sort((a,o)=>o.value-a.value)),l.map(a=>({...a}))},set(l){return l}});function te(l,a){return l.value/a}function ye(l,a,o){const c=t.value.style.chart.layout.rects.colorRatio-te(a,o);return r.lightenHexColor(l,c<0?0:c)}function le(l,a,o,c){return l.map((y,P)=>{const H=ye(r.convertColorToHex(a)||D.value[P]||r.palette[P]||r.palette[P%r.palette.length],y,c),Te=te(y,c);return{...y,color:H,proportion:Te,parentName:o,children:y.children?le(y.children,H,y.name,c):void 0}})}const I=e.computed(()=>Ve(ee.value.map((l,a)=>{const o=l.children?l.children.reduce((c,y)=>c+y.value,0):l.value;return{value:l.value,id:l.id,children:l.children?le(l.children.sort((c,y)=>y.value-c.value),l.color,l.name,o):void 0,color:l.color,name:l.name}}),{x0:O.value.left*2,y0:O.value.top,x1:O.value.width,y1:O.value.height}));function oe({y0:l,y1:a}){return a-l<=0?1e-4:a-l}function ae({x0:l,x1:a}){return a-l<=0?1e-4:a-l}function V(l){const a=t.value.style.chart.layout.labels.fontSize*(l.proportion*2>1?1:l.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function be(l){b.value=l,w.value+=1}const R=e.computed(()=>({startX:0,startY:0,width:O.value.vbWidth,height:O.value.vbHeight})),$=e.ref(!1);function W(l,a=E.value){for(const o of a){if(o.id===l)return o;if(o.children){const c=W(l,o.children);if(c)return c}}return null}function ke(l){if($.value)s("selectDatapoint",void 0),M.value=E.value;else{if(s("selectDatapoint",l),!W(l.parentId))return;M.value=[W(l.parentId)]}$.value=!$.value}const S=e.ref(null),ne=e.computed(()=>E.value.map((l,a)=>({...l,color:r.convertColorToHex(l.color)||D.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((l,a)=>a.value-l.value).map((l,a)=>({...l,proportion:l.value/E.value.map(o=>o.value).reduce((o,c)=>o+c,0),opacity:g.value.includes(l.id)?.5:1}))),Ce=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function re(l){$.value=!1,S.value=null,g.value.includes(l.id)?g.value=g.value.filter(a=>a!==l.id):g.value.length<u.dataset.length-1&&g.value.push(l.id),s("selectLegend",ee.value)}const U=e.ref(null);function we({datapoint:l,seriesIndex:a}){S.value=l,U.value={datapoint:l,seriesIndex:a,config:t.value,series:F.value};const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:a,datapoint:l,series:F.value,config:t.value})))C.value=o({seriesIndex:a,datapoint:l,series:F.value,config:t.value});else{let c="";c+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,c+=`<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" fill="${l.color}"/></svg>`,c+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:a})}</b>`,C.value=`<div>${c}</div>`}p.value=!0}const N=e.computed(()=>{const l=I.value.map(o=>({name:o.name,color:o.color})),a=I.value.map(o=>o.value);return{head:l,body:a}});function ue(){e.nextTick(()=>{const l=N.value.head.map((c,y)=>[[c.name],[N.value.body[y]],[isNaN(N.value.body[y]/L.value)?"-":N.value.body[y]/L.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const A=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=N.value.head.map((y,P)=>{const H=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,N.value.body[P],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:N.value.body[P],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:y.color,name:y.name,shape:"square"},H,isNaN(N.value.body[P]/L.value)?"-":r.dataLabel({v:N.value.body[P]/L.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:a,config:o}});function xe(){return I.value}function se(){_.value.showTable=!_.value.showTable}function ie(){_.value.showTooltip=!_.value.showTooltip}return d({getData:xe,generateCsv:ue,generateImage:K,generatePdf:J,toggleTable:se,toggleTooltip:ie}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:m,class:e.normalizeClass(`vue-ui-treemap ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor}`),id:`treemap_${f.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:k,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock($e._sfc_main,{key:`title_${B.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&v.value?(e.openBlock(),e.createBlock(ce.UserOptions,{ref:"details",key:`user_option_${w.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Y),isImaging:e.unref(Z),uid:f.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:_.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,position:t.value.userOptions.position,onToggleFullscreen:be,onGeneratePdf:e.unref(J),onGenerateCsv:ue,onGenerateImage:e.unref(K),onToggleTable:se,onToggleTooltip:ie},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:c})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:c})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!$.value,"vue-data-ui-zoom-minus":$.value}),viewBox:`${R.value.startX} ${R.value.startY} ${R.value.width<=0?10:R.value.width} ${R.value.height<=0?10:R.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",Me,[e.createElementVNode("radialGradient",{id:`tgrad_${o.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":o.color},null,8,Ue),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,Ge)],8,We)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(o,c)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:o.x0,y:o.y0,height:oe(o),width:ae(o),fill:h.value?o.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${o.id})`:o.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":S.value&&S.value.id===o.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:y=>ke(o),onMouseenter:()=>we({datapoint:o,seriesIndex:c}),onMouseleave:a[0]||(a[0]=y=>{S.value=null,p.value=!1}),style:e.normalizeStyle(`opacity:${S.value?S.value.id===o.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,je),(e.openBlock(),e.createElementBlock("foreignObject",{x:o.x0,y:o.y0,height:oe(o),width:ae(o),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",Ye,[t.value.style.chart.layout.labels.showDefaultLabels&&(o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${V(o)/1.5}px);text-align:left;line-height:${V(o)<14?14:V(o)}px;padding:${V(o)/3}px; color:${e.unref(r.adaptColorToBackground)(o.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(o.name),5),Ze,e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${V(o)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:o})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"rect",e.normalizeProps(e.guardReactiveProps({rect:o,shouldShow:o.proportion>t.value.style.chart.layout.labels.hideUnderProportion||$.value,fontSize:V(o),isZoom:$.value,textColor:e.unref(r.adaptColorToBackground)(o.color)})),void 0,!0)])],8,Xe))]))),256)),e.renderSlot(l.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:O.value,isZoom:$.value,rect:S.value,config:t.value})),void 0,!0)],14,He)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Je,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Y)||e.unref(Z)})),void 0,!0)])):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Be.default,{key:4,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:x},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Ne.Legend,{key:`legend_${j.value}`,legendSet:ne.value,config:Ce.value,id:`treemap_legend_${f.value}`,onClickMarker:a[1]||(a[1]=({legend:o})=>re(o))},{item:e.withCtx(({legend:o,index:c})=>[e.createElementVNode("div",{onClick:y=>re(o),style:e.normalizeStyle(`opacity:${g.value.includes(o.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(o.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:o}))+" ",1),g.value.includes(o.id)?(e.openBlock(),e.createElementBlock("span",et," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Qe," ("+e.toDisplayString(isNaN(o.value/L.value)?"-":(o.value/L.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,Ke)]),_:1},8,["legendSet","config","id"])):e.renderSlot(l.$slots,"legend",{key:1,legend:ne.value},void 0,!0)],512),e.createVNode(Se._sfc_main,{show:_.value.showTooltip&&p.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:m.value,content:C.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...U.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...U.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),v.value?(e.openBlock(),e.createBlock(ze.default,{key:5,hideDetails:"",config:{open:_.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(_e.DataTable,{key:`table_${T.value}`,colNames:A.value.colNames,head:A.value.head,body:A.value.body,config:A.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=o=>_.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,tt)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Ae))}},ot=Pe._export_sfc(lt,[["__scopeId","data-v-9e17b718"]]);exports.default=ot;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { computed as C, ref as y, watch as qe, onMounted as je, onBeforeUnmount as Ye, openBlock as m, createElementBlock as k, normalizeClass as _e, normalizeStyle as V, createBlock as X, createCommentVNode as B, unref as b, createSlots as Ze, withCtx as T, renderSlot as _, normalizeProps as q, guardReactiveProps as j, Fragment as Oe, renderList as Se, createElementVNode as O, toDisplayString as Y, createTextVNode as Ne, createVNode as Je, nextTick as Ke, pushScopeId as Qe, popScopeId as et } from "vue";
|
|
2
|
-
import { u as tt, c as ze, t as lt, a as ot, p as x, b as at, o as nt, e as st, d as oe, i as ae, f as K, X as rt, l as Ie, F as Pe, x as Fe, y as ut, q as it, r as ct } from "./index-
|
|
3
|
-
import { _ as dt } from "./Title-
|
|
4
|
-
import { u as vt, U as ht } from "./usePrinter-
|
|
5
|
-
import { _ as ft } from "./Tooltip-
|
|
6
|
-
import { L as pt } from "./Legend-
|
|
7
|
-
import gt from "./vue-ui-skeleton-
|
|
8
|
-
import { D as yt } from "./DataTable-
|
|
9
|
-
import mt from "./vue-ui-accordion-
|
|
2
|
+
import { u as tt, c as ze, t as lt, a as ot, p as x, b as at, o as nt, e as st, d as oe, i as ae, f as K, X as rt, l as Ie, F as Pe, x as Fe, y as ut, q as it, r as ct } from "./index-D2epy0rJ.js";
|
|
3
|
+
import { _ as dt } from "./Title-DJ2FNrSN.js";
|
|
4
|
+
import { u as vt, U as ht } from "./usePrinter-B6qtXaHk.js";
|
|
5
|
+
import { _ as ft } from "./Tooltip-CQpXRqRC.js";
|
|
6
|
+
import { L as pt } from "./Legend-D3hovFqM.js";
|
|
7
|
+
import gt from "./vue-ui-skeleton-BLiYyX95.js";
|
|
8
|
+
import { D as yt } from "./DataTable-tSDSY14n.js";
|
|
9
|
+
import mt from "./vue-ui-accordion-DzTB2FL0.js";
|
|
10
10
|
import { t as bt, u as wt } from "./useResponsive-NZB-WLRF.js";
|
|
11
|
-
import { u as Le } from "./useNestedProp-
|
|
11
|
+
import { u as Le } from "./useNestedProp-C_ZrJBd9.js";
|
|
12
12
|
import { _ as Ct } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
function Re(a, i) {
|
|
14
14
|
const s = a.length;
|
|
@@ -170,7 +170,7 @@ function Nt(a, i) {
|
|
|
170
170
|
return De(v);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
const zt = (a) => (Qe("data-v-
|
|
173
|
+
const zt = (a) => (Qe("data-v-9e17b718"), a = a(), et(), a), It = ["id"], Pt = ["xmlns", "viewBox"], Ft = { key: 0 }, Lt = ["id"], Rt = ["stop-color"], Dt = ["stop-color"], At = ["x", "y", "height", "width", "fill", "rx", "stroke", "stroke-width", "onClick", "onMouseenter"], Mt = ["x", "y", "height", "width"], Vt = {
|
|
174
174
|
style: { width: "100%", height: "100%" },
|
|
175
175
|
class: "vue-ui-treemap-cell"
|
|
176
176
|
}, Bt = /* @__PURE__ */ zt(() => /* @__PURE__ */ O("br", null, null, -1)), Wt = {
|
|
@@ -529,6 +529,7 @@ const zt = (a) => (Qe("data-v-18b05952"), a = a(), et(), a), It = ["id"], Pt = [
|
|
|
529
529
|
isTooltip: D.value.showTooltip,
|
|
530
530
|
titles: { ...e.value.userOptions.buttonTitles },
|
|
531
531
|
chartElement: p.value,
|
|
532
|
+
position: e.value.userOptions.position,
|
|
532
533
|
onToggleFullscreen: We,
|
|
533
534
|
onGeneratePdf: b(he),
|
|
534
535
|
onGenerateCsv: xe,
|
|
@@ -578,7 +579,7 @@ const zt = (a) => (Qe("data-v-18b05952"), a = a(), et(), a), It = ["id"], Pt = [
|
|
|
578
579
|
]),
|
|
579
580
|
key: "5"
|
|
580
581
|
} : void 0
|
|
581
|
-
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "onGeneratePdf", "onGenerateImage"])) : B("", !0),
|
|
582
|
+
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasTooltip", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "position", "onGeneratePdf", "onGenerateImage"])) : B("", !0),
|
|
582
583
|
c.value ? (m(), k("svg", {
|
|
583
584
|
key: 2,
|
|
584
585
|
xmlns: b(rt),
|
|
@@ -783,7 +784,7 @@ const zt = (a) => (Qe("data-v-18b05952"), a = a(), et(), a), It = ["id"], Pt = [
|
|
|
783
784
|
}, 8, ["config"])) : B("", !0)
|
|
784
785
|
], 14, It));
|
|
785
786
|
}
|
|
786
|
-
}, nl = /* @__PURE__ */ Ct(Xt, [["__scopeId", "data-v-
|
|
787
|
+
}, nl = /* @__PURE__ */ Ct(Xt, [["__scopeId", "data-v-9e17b718"]]);
|
|
787
788
|
export {
|
|
788
789
|
nl as default
|
|
789
790
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CVgBMJU6.cjs"),ue=require("./useResponsive-B3TrDDIG.cjs"),we=require("./Title-Ahj4TYHa.cjs"),se=require("./usePrinter-DN-6Hoh5.cjs"),$e=require("./Tooltip-XhevgJmm.cjs"),ie=require("./Legend-BOY57qwA.cjs"),Se=require("./vue-ui-skeleton-Br1K3exH.cjs"),Ve=require("./BaseIcon-DnG75_Ol.cjs"),Te=require("./vue-ui-accordion-BaV9R6cy.cjs"),ce=require("./useNestedProp-B-NmF2LO.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ee=["id"],Le=["onClick"],ze=["xmlns","viewBox"],Pe=["id"],De=["stop-color"],Fe=["stop-color"],Me=["x","y","width","height","fill","rx"],Ie=["x","y","width","height","fill","rx","stroke","stroke-width"],Oe=["x2","y1","y2","stroke","stroke-width"],Re=["x1","x2","y1","y2","stroke","stroke-width"],qe=["x","y","text-anchor","font-size","fill","font-weight"],He=["x","y","font-size","fill","font-weight"],Xe=["x","y","font-size","fill","font-weight"],Ae=["x","y","font-size","fill","font-weight"],Ue=["y","width","height","fill","onMouseenter"],je={key:4,class:"vue-data-ui-watermark"},Ge=["onClick"],We={style:"width:100%;padding-top: 36px;position:relative"},Ye={class:"vue-ui-data-table"},Ke={key:0},Je={style:{width:"100%"}},Qe=["data-cell"],Ze={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},et=["data-cell"],tt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},lt=["data-cell"],at={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ot=["data-cell"],nt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},rt=["data-cell"],ut={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},st=["data-cell"],it={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ct=["data-cell"],dt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},vt={__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=>({"3c6d5f9e":a.tdo}));const{vue_ui_vertical_bar:pe}=n.useConfig(),B=e.computed(()=>!!y.dataset&&y.dataset.length),C=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_${C.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),_=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}_${C.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}_${C.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(()=>_.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 Ce(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 _e(){return x.value}const I=e.ref(null),O=e.ref(null);function xe(a,o){O.value={datapoint:a,seriesIndex:o,series:_.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:_.value,config:t.value,seriesIndex:o}))?D.value=i({datapoint:a,series:_.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:_e,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_${C.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:C.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:_.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,Le)]),_: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.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_${C.value}_${r}`},[e.createElementVNode("stop",{offset:"0%","stop-color":l.color},null,8,De),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,Fe)],8,Pe))),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,Me)]))),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_${C.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,Ie),(!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,Oe)):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,Re)):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):Ce(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,qe),(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,He)):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,Xe)):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,Ae)):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,Ue)]))),256)),e.renderSlot(a.$slots,"svg",{svg:d.value},void 0,!0)],14,ze)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",je,[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:_.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,Ge)]),_:1},8,["legendSet","config"]))],512)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"legend",{legend:_.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",We,[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",Ye,[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",Ke,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",Je,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",Ze,[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,Qe),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",tt,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,et),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",at,e.toDisplayString(["",NaN,void 0].includes(l.percentageToTotal)?"":`${(l.percentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,lt),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",nt,e.toDisplayString(l.childName),1)],12,ot),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",ut,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,rt),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",it,e.toDisplayString(["",NaN,void 0].includes(l.childPercentageToParent)?"":`${(l.childPercentageToParent*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,st),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",dt,e.toDisplayString(["",NaN,void 0].includes(l.childPercentageToTotal)?"":`${(l.childPercentageToTotal*100).toFixed(t.value.table.td.roundingPercentage)}%`),1)],12,ct)],6))),256))])])],2)])],512)]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Ee))}},ht=Be._export_sfc(vt,[["__scopeId","data-v-c7a8f3aa"]]);exports.default=ht;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useCssVars as Ye, computed as b, ref as d, watch as Pe, onMounted as qe, onBeforeUnmount as Ke, openBlock as u, createElementBlock as c, normalizeClass as D, normalizeStyle as i, createBlock as R, createCommentVNode as m, unref as h, createSlots as Je, withCtx as x, renderSlot as k, normalizeProps as K, guardReactiveProps as J, createElementVNode as n, toDisplayString as r, Fragment as U, renderList as H, createVNode as Se, withKeys as Qe, createTextVNode as Ze } from "vue";
|
|
2
|
-
import { u as et, c as tt, t as at, a as lt, p as M, b as ot, o as Ve, e as Q, v as S, d as ue, i as Z, f as I, X as nt, s as se, w as ut, x as st, y as rt, q as it, r as dt } from "./index-
|
|
2
|
+
import { u as et, c as tt, t as at, a as lt, p as M, b as ot, o as Ve, e as Q, v as S, d as ue, i as Z, f as I, X as nt, s as se, w as ut, x as st, y as rt, q as it, r as dt } from "./index-D2epy0rJ.js";
|
|
3
3
|
import { t as ct, u as vt } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as ht } from "./Title-
|
|
5
|
-
import { u as pt, U as gt } from "./usePrinter-
|
|
6
|
-
import { _ as yt } from "./Tooltip-
|
|
7
|
-
import { L as ze } from "./Legend-
|
|
8
|
-
import ft from "./vue-ui-skeleton-
|
|
9
|
-
import bt from "./BaseIcon-
|
|
10
|
-
import mt from "./vue-ui-accordion-
|
|
11
|
-
import { u as Fe } from "./useNestedProp-
|
|
4
|
+
import { _ as ht } from "./Title-DJ2FNrSN.js";
|
|
5
|
+
import { u as pt, U as gt } from "./usePrinter-B6qtXaHk.js";
|
|
6
|
+
import { _ as yt } from "./Tooltip-CQpXRqRC.js";
|
|
7
|
+
import { L as ze } from "./Legend-D3hovFqM.js";
|
|
8
|
+
import ft from "./vue-ui-skeleton-BLiYyX95.js";
|
|
9
|
+
import bt from "./BaseIcon-B9istAKo.js";
|
|
10
|
+
import mt from "./vue-ui-accordion-DzTB2FL0.js";
|
|
11
|
+
import { u as Fe } from "./useNestedProp-C_ZrJBd9.js";
|
|
12
12
|
import { _ as _t } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const xt = ["id"], kt = ["onClick"], $t = ["xmlns", "viewBox"], wt = ["id"], Ct = ["stop-color"], Tt = ["stop-color"], Lt = ["x", "y", "width", "height", "fill", "rx"], Nt = ["x", "y", "width", "height", "fill", "rx", "stroke", "stroke-width"], Pt = ["x2", "y1", "y2", "stroke", "stroke-width"], St = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Vt = ["x", "y", "text-anchor", "font-size", "fill", "font-weight"], zt = ["x", "y", "font-size", "fill", "font-weight"], Ft = ["x", "y", "font-size", "fill", "font-weight"], Mt = ["x", "y", "font-size", "fill", "font-weight"], It = ["y", "width", "height", "fill", "onMouseenter"], Bt = {
|
|
14
14
|
key: 4,
|
|
@@ -33,7 +33,7 @@ const xt = ["id"], kt = ["onClick"], $t = ["xmlns", "viewBox"], wt = ["id"], Ct
|
|
|
33
33
|
setup(Me, { expose: Ie, emit: Be }) {
|
|
34
34
|
const w = Me;
|
|
35
35
|
Ye((a) => ({
|
|
36
|
-
"
|
|
36
|
+
"3c6d5f9e": a.tdo
|
|
37
37
|
}));
|
|
38
38
|
const { vue_ui_vertical_bar: Oe } = et(), W = b(() => !!w.dataset && w.dataset.length), V = d(tt()), De = d(null), ee = d(!1), te = d(""), j = d(0), Re = d(null), re = d(0), X = d(null), ie = d(null), ae = d(null), de = d(0), le = d(0), e = b({
|
|
39
39
|
get: () => ce(),
|
|
@@ -381,6 +381,7 @@ const xt = ["id"], kt = ["onClick"], $t = ["xmlns", "viewBox"], wt = ["id"], Ct
|
|
|
381
381
|
isTooltip: $.value.showTooltip,
|
|
382
382
|
titles: { ...e.value.userOptions.buttonTitles },
|
|
383
383
|
chartElement: X.value,
|
|
384
|
+
position: e.value.userOptions.position,
|
|
384
385
|
onToggleFullscreen: je,
|
|
385
386
|
onGeneratePdf: h(pe),
|
|
386
387
|
onGenerateCsv: Ce,
|
|
@@ -445,7 +446,7 @@ const xt = ["id"], kt = ["onClick"], $t = ["xmlns", "viewBox"], wt = ["id"], Ct
|
|
|
445
446
|
]),
|
|
446
447
|
key: "7"
|
|
447
448
|
} : void 0
|
|
448
|
-
]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasSort", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "onGeneratePdf", "onGenerateImage"])) : m("", !0),
|
|
449
|
+
]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasTooltip", "hasPdf", "hasImg", "hasXls", "hasTable", "hasSort", "hasFullscreen", "isFullscreen", "isTooltip", "titles", "chartElement", "position", "onGeneratePdf", "onGenerateImage"])) : m("", !0),
|
|
449
450
|
e.value.style.chart.legend.show && e.value.style.chart.legend.position === "top" ? (u(), c("div", {
|
|
450
451
|
key: 2,
|
|
451
452
|
ref_key: "chartLegend",
|
|
@@ -819,7 +820,7 @@ const xt = ["id"], kt = ["onClick"], $t = ["xmlns", "viewBox"], wt = ["id"], Ct
|
|
|
819
820
|
}, 8, ["config"])) : m("", !0)
|
|
820
821
|
], 14, xt));
|
|
821
822
|
}
|
|
822
|
-
}, ga = /* @__PURE__ */ _t(aa, [["__scopeId", "data-v-
|
|
823
|
+
}, ga = /* @__PURE__ */ _t(aa, [["__scopeId", "data-v-c7a8f3aa"]]);
|
|
823
824
|
export {
|
|
824
825
|
ga as default
|
|
825
826
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-D-vy9N1v.cjs"),ie=require("./useResponsive-B3TrDDIG.cjs"),_e=require("./Title-BaKZYHEx.cjs"),ce=require("./usePrinter-P4nLcXX-.cjs"),Se=require("./Tooltip-okAYzo5Y.cjs"),Ne=require("./DataTable-pVXaNplZ.cjs"),Le=require("./Legend-k2mcTp7z.cjs"),$e=require("./vue-ui-skeleton-DJhwv2oY.cjs"),Te=require("./vue-ui-accordion-btKAUUTu.cjs"),ve=require("./useNestedProp-B9yDavuy.cjs"),Pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),de=S=>(e.pushScopeId("data-v-59a6d2cc"),S=S(),e.popScopeId(),S),Ie=["id"],Ve=["xmlns","viewBox"],Ee=["id"],ze=["stop-color"],Fe=["stop-color"],De=["id"],Oe=de(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),Ae=de(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Me=[Oe,Ae],qe=["x","y","height","width"],Re=["height","width"],Ue=["rx","x","y","height","width","stroke","stroke-width","filter"],je=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],Ge=["x","y","height","width","filter"],We={key:0},He={key:1},Ye={key:2},Xe={key:3},Je=["onMouseover","x","y","height","width"],Ke={key:3,class:"vue-data-ui-watermark"},Qe=["onClick"],Ze={key:0},et={key:1},tt=["innerHTML"],lt={__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(),I=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),q=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 V=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});V.value=new ResizeObserver(l),V.value.observe(N.value.parentNode)}}e.onMounted(()=>{Y()}),e.onBeforeUnmount(()=>{V.value&&V.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,M)=>h+M,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,M)=>h+M,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,q.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&&I.value?(e.openBlock(),e.createBlock(ce.UserOptions,{ref_key:"details",ref:ye,key:`user_options_${q.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,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","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),I.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.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,ze),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Fe)],8,Ee))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${b.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Me,8,De)]),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,qe))),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,Re)):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,Ue))),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,je))),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",We,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",He,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",Ye," ("+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",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)],4)],8,Ge)):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,Je))),256)),e.renderSlot(l.$slots,"svg",{svg:k.value},void 0,!0)],14,Ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ke,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),I.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",et," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ze," ("+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,Qe)]),_: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"]),I.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,tt)]),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))}},at=Pe._export_sfc(lt,[["__scopeId","data-v-59a6d2cc"]]);exports.default=at;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-CVgBMJU6.cjs"),ie=require("./useResponsive-B3TrDDIG.cjs"),_e=require("./Title-Ahj4TYHa.cjs"),ce=require("./usePrinter-DN-6Hoh5.cjs"),Se=require("./Tooltip-XhevgJmm.cjs"),Ne=require("./DataTable-BA_BCbHC.cjs"),Le=require("./Legend-BOY57qwA.cjs"),$e=require("./vue-ui-skeleton-Br1K3exH.cjs"),Te=require("./vue-ui-accordion-BaV9R6cy.cjs"),ve=require("./useNestedProp-B-NmF2LO.cjs"),Pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),de=S=>(e.pushScopeId("data-v-a80f56d0"),S=S(),e.popScopeId(),S),Ie=["id"],Ve=["xmlns","viewBox"],Ee=["id"],ze=["stop-color"],Fe=["stop-color"],De=["id"],Oe=de(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),Ae=de(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Me=[Oe,Ae],qe=["x","y","height","width"],Re=["height","width"],Ue=["rx","x","y","height","width","stroke","stroke-width","filter"],je=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],Ge=["x","y","height","width","filter"],We={key:0},He={key:1},Ye={key:2},Xe={key:3},Je=["onMouseover","x","y","height","width"],Ke={key:3,class:"vue-data-ui-watermark"},Qe=["onClick"],Ze={key:0},et={key:1},tt=["innerHTML"],lt={__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(),I=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),q=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 V=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});V.value=new ResizeObserver(l),V.value.observe(N.value.parentNode)}}e.onMounted(()=>{Y()}),e.onBeforeUnmount(()=>{V.value&&V.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,M)=>h+M,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,M)=>h+M,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,q.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&&I.value?(e.openBlock(),e.createBlock(ce.UserOptions,{ref_key:"details",ref:ye,key:`user_options_${q.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),I.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.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,ze),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Fe)],8,Ee))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${b.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Me,8,De)]),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,qe))),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,Re)):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,Ue))),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,je))),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",We,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",He,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",Ye," ("+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",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)],4)],8,Ge)):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,Je))),256)),e.renderSlot(l.$slots,"svg",{svg:k.value},void 0,!0)],14,Ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ke,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),I.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",et," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ze," ("+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,Qe)]),_: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"]),I.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,tt)]),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))}},at=Pe._export_sfc(lt,[["__scopeId","data-v-a80f56d0"]]);exports.default=at;
|