vue-data-ui 2.3.96 → 2.3.97
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-Dse9W-xd.js → Arrow-BAg5kQhG.js} +1 -1
- package/dist/{Arrow-eiCuVfYA.cjs → Arrow-CD-z6ya0.cjs} +1 -1
- package/dist/{BaseIcon-DFIHCTyJ.js → BaseIcon-CiQsJmEc.js} +1 -1
- package/dist/{BaseIcon-DJbzYsmN.cjs → BaseIcon-JWYc0t9a.cjs} +1 -1
- package/dist/{DataTable-TdEc8llA.js → DataTable-BczvA492.js} +2 -2
- package/dist/{DataTable-YpBvWSn5.cjs → DataTable-DRJUrEXP.cjs} +1 -1
- package/dist/{Legend-CsYNhmuM.cjs → Legend-DDmBZxt8.cjs} +1 -1
- package/dist/{Legend-BsB-CXKk.js → Legend-DnOc-JGW.js} +1 -1
- package/dist/{PackageVersion-C5LvF-TN.js → PackageVersion-DN8qp-uI.js} +1 -1
- package/dist/{PackageVersion-kqwH1rG4.cjs → PackageVersion-rOhPenOY.cjs} +1 -1
- package/dist/{Shape-CyDjKOjw.cjs → Shape-CDDjN4N-.cjs} +1 -1
- package/dist/{Shape-DpWOBZlx.js → Shape-DhRVUsKe.js} +1 -1
- package/dist/{Slicer-BQr2RZjz.js → Slicer-B7JFT6tT.js} +2 -2
- package/dist/{Slicer-D-wCwIJ3.cjs → Slicer-IdC3VhM9.cjs} +1 -1
- package/dist/{Title-BMSO566P.js → Title-0tYDaWv7.js} +1 -1
- package/dist/{Title-DWSN4YUC.cjs → Title-Cjusozo5.cjs} +1 -1
- package/dist/{Tooltip-Bl8Ilf5h.cjs → Tooltip-CkqTs_wn.cjs} +1 -1
- package/dist/{Tooltip-CHABi2zh.js → Tooltip-DdWGiVyf.js} +1 -1
- package/dist/{index-BcpaEQjg.js → index-BJNSbAx7.js} +22 -22
- package/dist/{index-Bv8wGGBc.cjs → index-NvxTr0fZ.cjs} +3 -3
- package/dist/{useNestedProp-CEsVEbKF.js → useNestedProp-CLh4tPxT.js} +1 -1
- package/dist/{useNestedProp-Bf7w6kTt.cjs → useNestedProp-DhLxBAwX.cjs} +1 -1
- package/dist/{usePrinter-7jNVagoH.cjs → usePrinter-0s8wVGIy.cjs} +1 -1
- package/dist/{usePrinter-DzCuoQHM.js → usePrinter-CkV5eORP.js} +1 -1
- package/dist/{vue-data-ui-BFU1Dig_.js → vue-data-ui-CyOAruHW.js} +57 -57
- package/dist/{vue-data-ui-Bs74qL5y.cjs → vue-data-ui-OR4tWNiS.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-4ue7sfgA.js → vue-ui-3d-bar-CxDdjFAw.js} +8 -8
- package/dist/{vue-ui-3d-bar-DxfiT-RQ.cjs → vue-ui-3d-bar-DrnEff_D.cjs} +1 -1
- package/dist/{vue-ui-accordion-CSkH8Ztm.cjs → vue-ui-accordion-CxPjShWo.cjs} +1 -1
- package/dist/{vue-ui-accordion-Dhi5XiYk.js → vue-ui-accordion-DDf5Y2GY.js} +3 -3
- package/dist/{vue-ui-age-pyramid-BApJ-rfW.js → vue-ui-age-pyramid-BMjBTeyH.js} +9 -9
- package/dist/{vue-ui-age-pyramid-Ds5Q2JFz.cjs → vue-ui-age-pyramid-BiHpf1Rk.cjs} +1 -1
- package/dist/{vue-ui-annotator-8qRRkhYB.cjs → vue-ui-annotator--NmsTiIf.cjs} +1 -1
- package/dist/{vue-ui-annotator-BASwkqF2.js → vue-ui-annotator-B-myvrhe.js} +1 -1
- package/dist/{vue-ui-candlestick-CljlKMFQ.cjs → vue-ui-candlestick-DSwIFt7i.cjs} +1 -1
- package/dist/{vue-ui-candlestick-Dlgm0_M_.js → vue-ui-candlestick-J1JpFsJT.js} +10 -10
- package/dist/{vue-ui-carousel-table-3izbh8XN.js → vue-ui-carousel-table-B62mAFeV.js} +4 -4
- package/dist/{vue-ui-carousel-table-DkveY2W7.cjs → vue-ui-carousel-table-Cg3I81MW.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DzKXA8vJ.js → vue-ui-chestnut-ChAwKgeO.js} +7 -7
- package/dist/{vue-ui-chestnut-CQu1jOyT.cjs → vue-ui-chestnut-lQvVg9Rn.cjs} +1 -1
- package/dist/{vue-ui-cursor-DbQV-LLF.cjs → vue-ui-cursor-D-qe8qez.cjs} +1 -1
- package/dist/{vue-ui-cursor-BrBsIJo3.js → vue-ui-cursor-XXjnAIH2.js} +2 -2
- package/dist/{vue-ui-dashboard-Wzves807.cjs → vue-ui-dashboard-CB41KQ7y.cjs} +1 -1
- package/dist/{vue-ui-dashboard-DXdmiwYq.js → vue-ui-dashboard-CC-DF6iU.js} +2 -2
- package/dist/{vue-ui-digits-CSQi9Lh3.cjs → vue-ui-digits-CIHkrLL6.cjs} +1 -1
- package/dist/{vue-ui-digits-BppnP8CH.js → vue-ui-digits-Degwjx76.js} +2 -2
- package/dist/{vue-ui-donut-DkHShWM1.js → vue-ui-donut-CYBpOCFo.js} +10 -10
- package/dist/{vue-ui-donut-evolution-CwOes6ko.cjs → vue-ui-donut-evolution-Bbt27unL.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-oDtnYccI.js → vue-ui-donut-evolution-Bxq-hr-P.js} +10 -10
- package/dist/{vue-ui-donut-CqlGTsGd.cjs → vue-ui-donut-jwD3vNoD.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-DQlj4MnV.cjs → vue-ui-dumbbell-7f9d2mh-.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-CDv2q1Sr.js → vue-ui-dumbbell-KsVxecua.js} +9 -9
- package/dist/{vue-ui-flow-Bx-zjQWh.cjs → vue-ui-flow-BzcB3iiZ.cjs} +1 -1
- package/dist/{vue-ui-flow-1DFcpdAA.js → vue-ui-flow-FqXhCo7u.js} +8 -8
- package/dist/{vue-ui-galaxy-bE0htYx4.js → vue-ui-galaxy-B9rSYr7m.js} +10 -10
- package/dist/{vue-ui-galaxy-BqB8ilSB.cjs → vue-ui-galaxy-xVldWSiq.cjs} +1 -1
- package/dist/{vue-ui-gauge-B3fJ7NBS.cjs → vue-ui-gauge-B4r-qdzi.cjs} +1 -1
- package/dist/{vue-ui-gauge-QgQpiMpP.js → vue-ui-gauge-k6fqkXqN.js} +6 -6
- package/dist/{vue-ui-gizmo-BPTXhk_5.cjs → vue-ui-gizmo-By3-mz_t.cjs} +1 -1
- package/dist/{vue-ui-gizmo-Dvhxmifg.js → vue-ui-gizmo-CYaThghf.js} +3 -3
- package/dist/{vue-ui-heatmap-mKhWCDCz.cjs → vue-ui-heatmap-B0w5CXLi.cjs} +1 -1
- package/dist/{vue-ui-heatmap-Dz__vLIx.js → vue-ui-heatmap-Bdffdnay.js} +9 -9
- package/dist/{vue-ui-kpi-By6cERhR.cjs → vue-ui-kpi-BqN5GILt.cjs} +1 -1
- package/dist/{vue-ui-kpi-CBUwc_CD.js → vue-ui-kpi-DG8_lFYS.js} +3 -3
- package/dist/{vue-ui-mini-loader-DgHibV20.js → vue-ui-mini-loader-BZS_gsWT.js} +2 -2
- package/dist/{vue-ui-mini-loader-jX_8sp7v.cjs → vue-ui-mini-loader-C-Na_wY7.cjs} +1 -1
- package/dist/{vue-ui-molecule-DKpW8ux_.js → vue-ui-molecule-BK6bSbRU.js} +10 -10
- package/dist/{vue-ui-molecule-B0U_SHX-.cjs → vue-ui-molecule-Cdg96qiI.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-DVChUb6f.cjs → vue-ui-mood-radar-D-BCyG9b.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-DCDK2sIV.js → vue-ui-mood-radar-D5GRHLEE.js} +10 -10
- package/dist/{vue-ui-nested-donuts-CGp-Jubi.cjs → vue-ui-nested-donuts-D1fD0b-H.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-FMQPCwII.js → vue-ui-nested-donuts-mxJHstX4.js} +10 -10
- package/dist/{vue-ui-onion-DL6021Q8.js → vue-ui-onion-6mkIHe9R.js} +10 -10
- package/dist/{vue-ui-onion-uId6GP2z.cjs → vue-ui-onion-vKC5zZVM.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-BQuvfJQt.js → vue-ui-parallel-coordinate-plot-B_gGjFqe.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-BQnqXMkU.cjs → vue-ui-parallel-coordinate-plot-DqbwxRdK.cjs} +1 -1
- package/dist/{vue-ui-quadrant-D0aD-7Tw.cjs → vue-ui-quadrant-C54oPX3B.cjs} +1 -1
- package/dist/{vue-ui-quadrant-rUE9NWa4.js → vue-ui-quadrant-SEj9AJdW.js} +11 -11
- package/dist/{vue-ui-quick-chart-Jh4YDviZ.js → vue-ui-quick-chart-CqmbqQdH.js} +8 -8
- package/dist/{vue-ui-quick-chart-D-sbJNy5.cjs → vue-ui-quick-chart-DoEE3OMA.cjs} +1 -1
- package/dist/{vue-ui-radar-Bfdoz0Xo.js → vue-ui-radar-CKjssi06.js} +11 -11
- package/dist/{vue-ui-radar-De-YX5t1.cjs → vue-ui-radar-Dr91p7eK.cjs} +1 -1
- package/dist/{vue-ui-rating-Dur118_W.cjs → vue-ui-rating-DQvO4ejI.cjs} +1 -1
- package/dist/{vue-ui-rating-D9vACqJ2.js → vue-ui-rating-DUSE6rvR.js} +2 -2
- package/dist/{vue-ui-relation-circle-CnRm-wQ3.js → vue-ui-relation-circle-BmijKEEN.js} +6 -6
- package/dist/{vue-ui-relation-circle-Dux0WfBo.cjs → vue-ui-relation-circle-D089YHBB.cjs} +1 -1
- package/dist/{vue-ui-rings-B3K3LXLl.js → vue-ui-rings-BtzbZYTW.js} +10 -10
- package/dist/{vue-ui-rings-BkrRebjS.cjs → vue-ui-rings-D237PxGP.cjs} +1 -1
- package/dist/{vue-ui-scatter-DejGOjhr.js → vue-ui-scatter-BeKQhHUw.js} +11 -11
- package/dist/{vue-ui-scatter-DeebI4Fn.cjs → vue-ui-scatter-_bZ2lVMS.cjs} +1 -1
- package/dist/{vue-ui-screenshot-Bar9x-5m.cjs → vue-ui-screenshot-CnwCy_Kg.cjs} +1 -1
- package/dist/{vue-ui-screenshot-C08awO8c.js → vue-ui-screenshot-DNuimpRf.js} +1 -1
- package/dist/{vue-ui-skeleton-C53xk8CG.js → vue-ui-skeleton-CsU74BI7.js} +3 -3
- package/dist/{vue-ui-skeleton-TRdDtmHK.cjs → vue-ui-skeleton-DYHqPo98.cjs} +1 -1
- package/dist/{vue-ui-smiley-Dav2CD3O.cjs → vue-ui-smiley-D150KQ7d.cjs} +1 -1
- package/dist/{vue-ui-smiley-Cea-O3KH.js → vue-ui-smiley-d0tQ2o9w.js} +2 -2
- package/dist/{vue-ui-spark-trend-6ntFUEU4.cjs → vue-ui-spark-trend-BDibnFmx.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-Bs8twUaY.js → vue-ui-spark-trend-CtZdqmLI.js} +5 -5
- package/dist/{vue-ui-sparkbar-C21yWQQ3.cjs → vue-ui-sparkbar-BpFs4ZhV.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-Cbmc-caP.js → vue-ui-sparkbar-C-HlLkKi.js} +4 -4
- package/dist/{vue-ui-sparkgauge-0GVv8hjM.js → vue-ui-sparkgauge-BDRCFVP5.js} +4 -4
- package/dist/{vue-ui-sparkgauge-BmamgyGt.cjs → vue-ui-sparkgauge-BHBI7l12.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-DCM-BHkv.js → vue-ui-sparkhistogram-B5nNXynh.js} +5 -5
- package/dist/{vue-ui-sparkhistogram-CfdPXl3J.cjs → vue-ui-sparkhistogram-BjWnqdfo.cjs} +1 -1
- package/dist/{vue-ui-sparkline-BTNHzn2V.cjs → vue-ui-sparkline-DpnhvlTf.cjs} +1 -1
- package/dist/{vue-ui-sparkline-BYJczOkd.js → vue-ui-sparkline-o3mpXRV-.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-CkAqCQvJ.js → vue-ui-sparkstackbar-Bko-XhdQ.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-DRhK17o6.cjs → vue-ui-sparkstackbar-CST5NcMP.cjs} +1 -1
- package/dist/{vue-ui-stackbar-DYBUaxzj.cjs → vue-ui-stackbar-B3nyr_3-.cjs} +1 -1
- package/dist/{vue-ui-stackbar-CfYTo4Ku.js → vue-ui-stackbar-Br1WGSyo.js} +11 -11
- package/dist/{vue-ui-strip-plot-DEXBmsAI.js → vue-ui-strip-plot-C7Q-J22i.js} +10 -10
- package/dist/{vue-ui-strip-plot-CIN4KwoI.cjs → vue-ui-strip-plot-DkAf9HPJ.cjs} +1 -1
- package/dist/{vue-ui-table-DRpceoPe.cjs → vue-ui-table-1vOGIOAk.cjs} +1 -1
- package/dist/{vue-ui-table-nN3CrtRu.js → vue-ui-table-BTXo44Nv.js} +1 -1
- package/dist/{vue-ui-table-heatmap-DGJ9FlVp.cjs → vue-ui-table-heatmap-BNcfBY7T.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-BA2teZNQ.js → vue-ui-table-heatmap-BosdMOLZ.js} +4 -4
- package/dist/{vue-ui-table-sparkline-Cu3WXN2z.cjs → vue-ui-table-sparkline-BGCEgn2A.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-BvnGInz9.js → vue-ui-table-sparkline-D0NjMfnV.js} +5 -5
- package/dist/{vue-ui-thermometer-tMXK87ka.js → vue-ui-thermometer-Bnn77E-v.js} +6 -6
- package/dist/{vue-ui-thermometer-DbZ0o20q.cjs → vue-ui-thermometer-CUBnp6lX.cjs} +1 -1
- package/dist/{vue-ui-timer-BC8eaIGC.cjs → vue-ui-timer-D2WCDGWF.cjs} +1 -1
- package/dist/{vue-ui-timer-SzmYKRd2.js → vue-ui-timer-JupC7c3X.js} +5 -5
- package/dist/{vue-ui-tiremarks-Ckslwdk8.js → vue-ui-tiremarks-Db9JjYq5.js} +6 -6
- package/dist/{vue-ui-tiremarks-D-OLOU0v.cjs → vue-ui-tiremarks-FxWaEnUD.cjs} +1 -1
- package/dist/{vue-ui-treemap-Mm79m8P6.js → vue-ui-treemap-DPD9rcYE.js} +10 -10
- package/dist/{vue-ui-treemap-CUtRsRug.cjs → vue-ui-treemap-oplXghMz.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-CvLxGsDB.cjs → vue-ui-vertical-bar-BrOR3Xkc.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-r6pUOD2L.js → vue-ui-vertical-bar-DeUOAiy4.js} +10 -10
- package/dist/{vue-ui-waffle-CSyW6ncV.cjs → vue-ui-waffle-DGrZjGQR.cjs} +1 -1
- package/dist/{vue-ui-waffle-C_9IOFs2.js → vue-ui-waffle-qvh8AKep.js} +10 -10
- package/dist/{vue-ui-wheel-CKr2Vu47.cjs → vue-ui-wheel-CuEobbmN.cjs} +1 -1
- package/dist/{vue-ui-wheel-BOhOVAnh.js → vue-ui-wheel-DmG03DhW.js} +6 -6
- package/dist/{vue-ui-word-cloud-D2pGh3Xa.cjs → vue-ui-word-cloud-CbnPyd1_.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-ES0R6vuB.js → vue-ui-word-cloud-Dg0WQKL1.js} +9 -9
- package/dist/{vue-ui-xy-CyFLJGSu.js → vue-ui-xy-BBlRgHyb.js} +13 -13
- package/dist/{vue-ui-xy-canvas-BSV_IOwc.js → vue-ui-xy-canvas-CqyEve92.js} +10 -10
- package/dist/{vue-ui-xy-canvas-1N7guNkI.cjs → vue-ui-xy-canvas-CzCS04yK.cjs} +1 -1
- package/dist/{vue-ui-xy-BASuw3ZU.cjs → vue-ui-xy-gHnKcmgZ.cjs} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-Bv8wGGBc.cjs"),ie=require("./useResponsive-B3TrDDIG.cjs"),_e=require("./Title-DWSN4YUC.cjs"),ce=require("./usePrinter-7jNVagoH.cjs"),Se=require("./Tooltip-Bl8Ilf5h.cjs"),Ne=require("./DataTable-YpBvWSn5.cjs"),Le=require("./Legend-CsYNhmuM.cjs"),$e=require("./vue-ui-skeleton-TRdDtmHK.cjs"),Te=require("./vue-ui-accordion-CSkH8Ztm.cjs"),ve=require("./useNestedProp-Bf7w6kTt.cjs"),Pe=require("./PackageVersion-kqwH1rG4.cjs"),Ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),de=S=>(e.pushScopeId("data-v-a0574c0d"),S=S(),e.popScopeId(),S),Ie=["id"],Ee=["xmlns","viewBox"],ze=["id"],Fe=["stop-color"],De=["stop-color"],Oe=["id"],Ae=de(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),qe=de(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Me=[Ae,qe],Re=["x","y","height","width"],Ue=["height","width"],je=["rx","x","y","height","width","stroke","stroke-width","filter"],Ge=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],We=["x","y","height","width","filter"],He={key:0},Ye={key:1},Xe={key:2},Je={key:3},Ke=["onMouseover","x","y","height","width"],Qe={key:3,class:"vue-data-ui-watermark"},Ze=["onClick"],et={key:0},tt={key:1},lt=["innerHTML"],at={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(S,{expose:pe,emit:he}){const p=S,{vue_ui_waffle:fe}=n.useConfig(),V=e.computed(()=>!!p.dataset&&p.dataset.length),b=e.ref(n.createUid()),ye=e.ref(null),F=e.ref(!1),D=e.ref(""),B=e.ref(null),M=e.ref(0),N=e.ref(null),R=e.ref(null),U=e.ref(null),j=e.ref(0),G=e.ref(0),W=e.ref(0),t=e.computed({get:()=>H(),set:l=>l});function H(){const l=ve.useNestedProp({userConfig:p.config,defaultConfig:fe});return l.theme?{...ve.useNestedProp({userConfig:n.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>p.config,l=>{t.value=H(),Y(),j.value+=1,G.value+=1,W.value+=1},{deep:!0});const I=e.ref(null);function Y(){if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,r)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.responsive){const l=ie.throttle(()=>{const{width:r,height:a}=ie.useResponsive({chart:N.value,title:t.value.style.chart.title.text?R.value:null,legend:t.value.style.chart.legend.show?U.value:null});k.value.width=r,k.value.height=a,f.value.width=r,f.value.height=a});I.value=new ResizeObserver(l),I.value.observe(N.value.parentNode)}}e.onMounted(()=>{Y()}),e.onBeforeUnmount(()=>{I.value&&I.value.disconnect()});const{isPrinting:X,isImaging:J,generatePdf:K,generateImage:Q}=ce.usePrinter({elementId:`vue-ui-waffle_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),Z=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),k=e.ref({height:512,width:512}),f=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(f.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),x=e.computed(()=>(f.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),L=e.computed(()=>f.value.width/t.value.style.chart.layout.grid.size),E=e.computed(()=>f.value.height/t.value.style.chart.layout.grid.size);function ee(l){const r=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,q)=>h+q,0),o=l.map(h=>h/a*r),u=o.map(Math.floor),i=o.map(h=>h%1);let d=r-u.reduce((h,q)=>h+q,0);for(;d>0;){let h=i.indexOf(Math.max(...i));u[h]+=1,i[h]=0,d-=1}return u}function te(){return p.dataset.map((l,r)=>({...l,color:n.convertColorToHex(l.color)||Z.value[r]||n.palette[r]||n.palette[r%n.palette.length],uid:`serie_${r}`,absoluteIndex:r}))}const le=e.computed(()=>te()),c=e.ref(le.value);e.watch(()=>p.dataset,l=>{c.value=te()},{deep:!0});const ge=e.computed(()=>{const l=c.value.filter((r,a)=>!v.value.includes(r.uid)).map((r,a)=>(r.values||[]).reduce((o,u)=>o+u,0));return ee(l)}),me=e.computed(()=>{const l=c.value.map((r,a)=>(r.values||[]).reduce((o,u)=>o+u));return ee(l)}),$=e.computed(()=>(p.dataset.forEach((l,r)=>{[null,void 0].includes(l.values)&&n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:r})}),c.value.filter((l,r)=>!v.value.includes(l.uid)).map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:ge.value[r]})))),be=e.computed(()=>c.value.map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:me.value[r]})));function ke(){return be.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const we=e.computed(()=>{let l=0;return $.value.map((r,a)=>{const o=l,u=o+r.proportion,i=[];for(let d=Math.floor(o);d<Math.floor(u);d+=1)i.push(d);return l=u,{...r,start:o,rects:i}})}),s=e.computed(()=>we.value.flatMap((l,r)=>l.rects.map((a,o)=>({isFirst:o===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:r,absoluteStartIndex:o<3,serieId:l.uid,...l}))).map((l,r)=>({...l,isAbsoluteFirst:r%t.value.style.chart.layout.grid.size===0}))),T=e.computed(()=>{const l=[];for(let r=0;r<t.value.style.chart.layout.grid.size;r+=1)for(let a=0;a<t.value.style.chart.layout.grid.size;a+=1)l.push({isStartOfLine:a===0,position:t.value.style.chart.layout.grid.vertical?r:a,x:(t.value.style.chart.layout.grid.vertical?r:a)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:r)*(x.value+t.value.style.chart.layout.grid.spaceBetween)+f.value.top});return l}),v=e.ref([]),C=e.ref(!1),ae=e.ref(null),oe=e.ref(null);function re(l){if(!t.value.useAnimation){v.value.includes(l)?v.value=v.value.filter(u=>u!==l):v.value.length<_.value.length-1&&_.value.length>1&&v.value.push(l);return}const r=le.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);let o=c.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);if(v.value.includes(l)){let i=function(){o>u?(cancelAnimationFrame(ae.value),c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[u]}:d),C.value=!1):(C.value=!0,o+=u*.025,c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[o]}:d),ae.value=requestAnimationFrame(i))};v.value=v.value.filter(d=>d!==l);const u=r;i()}else if(v.value.length<_.value.length-1&&_.value.length>1){let u=function(){o<.1?(cancelAnimationFrame(oe.value),v.value.push(l),c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[0]}:i),C.value=!1):(C.value=!0,o/=1.5,c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[o]}:i),oe.value=requestAnimationFrame(u))};u()}he("selectLegend",$.value.map(u=>({name:u.name,color:u.color,value:u.value,proportion:u.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)})))}const _=e.computed(()=>c.value.map((l,r)=>({name:l.name,color:l.color||Z[r]||n.palette[r]||n.palette[r%n.palette.length],value:(l.values||[]).reduce((a,o)=>a+o,0),uid:l.uid,shape:"square"})).map((l,r)=>({...l,proportion:l.value/c.value.map(a=>(a.values||[]).reduce((o,u)=>o+u,0)).reduce((a,o)=>a+o,0),opacity:v.value.includes(l.uid)?.5:1,segregate:()=>re(l.uid),isSegregated:v.value.includes(l.uid)}))),xe=e.computed(()=>({cy:"waffle-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),y=e.computed(()=>$.value.map(l=>l.value).reduce((l,r)=>l+r,0)),O=e.ref(null);function Ce(l){if(v.value.length===p.dataset.length)return;const r=s.value[l];O.value={datapoint:r,seriesIndex:r.absoluteIndex,series:c.value,config:t.value},F.value=!0,B.value=s.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(n.isFunction(a)&&n.functionReturnsString(()=>a({seriesIndex:s.value[l].absoluteIndex,datapoint:r,series:c.value,config:t.value})))D.value=a({seriesIndex:s.value[l].absoluteIndex,datapoint:r,series:c.value,config:t.value});else{let o="";if(o+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${r.name}</div>`,o+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${r.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(o+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,r.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:r.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:r,seriesIndex:s.value[l].absoluteIndex,series:c.value})}</b>`),t.value.style.chart.tooltip.showPercentage){const u=n.dataLabel({v:r.value/y.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?o+=`<span>(${u})</span></div>`:o+=`<b>${u}%</b></div>`}D.value=o}}const g=e.computed(()=>{const l=$.value.map(a=>({name:a.name,color:a.color})),r=$.value.map(a=>a.value);return{head:l,body:r}});function A(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${b.value})`:""}function ue(){e.nextTick(()=>{const l=g.value.head.map((o,u)=>[[o.name],[g.value.body[u]],[isNaN(g.value.body[u]/y.value)?"-":g.value.body[u]/y.value*100]]),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=n.createCsvContent(r);n.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const z=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,y.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:y.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],r=g.value.head.map((u,i)=>[{color:u.color,name:u.name},n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,g.value.body[i],n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(g.value.body[i]/y.value)?"-":n.dataLabel({v:g.value.body[i]/y.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:r,config:a,colNames:o}}),P=e.ref(!1);function Be(l){P.value=l,M.value+=1}function ne(){m.value.showTable=!m.value.showTable}function se(){m.value.showTooltip=!m.value.showTooltip}return pe({getData:ke,generatePdf:K,generateCsv:ue,generateImage:Q,toggleTable:ne,toggleTooltip:se}),(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${P.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:N,id:`vue-ui-waffle_${b.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:R,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(_e._sfc_main,{key:`title_${j.value}`,config:{title:{cy:"waffle-title",...t.value.style.chart.title},subtitle:{cy:"waffle-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&V.value?(e.openBlock(),e.createBlock(ce.UserOptions,{ref_key:"details",ref:ye,key:`user_options_${M.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(X),isImaging:e.unref(J),uid:b.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:P.value,isTooltip:m.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,position:t.value.userOptions.position,onToggleFullscreen:Be,onGeneratePdf:e.unref(K),onGenerateCsv:ue,onGenerateImage:e.unref(Q),onToggleTable:ne,onToggleTooltip:se},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:o})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":P.value,"vue-data-ui-fulscreen--off":!P.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Pe._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,o)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${o}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(a.color,.05),100-t.value.style.chart.layout.rect.gradientIntensity)},null,8,Fe),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,De)],8,ze))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${b.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Me,8,Oe)]),t.value.useCustomCells&&s.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:x.value<=0?1e-4:x.value,width:w.value<=0?1e-4:w.value,class:"vue-ui-waffle-custom-cell-foreignObject"},[e.renderSlot(l.$slots,"cell",e.normalizeProps(e.guardReactiveProps({cell:{...a,color:s.value[o].color,...s.value[o]},isSelected:[null,void 0].includes(B.value)?!0:s.value[o].serieIndex===B.value})),void 0,!0)],8,Re))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:f.value.height-24,width:f.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,Ue)):s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:x.value<=0?1e-4:x.value,width:w.value<=0?1e-4:w.value,fill:"white",stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:A(s.value[o].serieIndex)},null,8,je))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:x.value<=0?1e-4:x.value,width:w.value<=0?1e-4:w.value,fill:t.value.style.chart.layout.rect.useGradient&&t.value.style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${b.value}_${o})`:s.value[o].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:A(s.value[o].serieIndex)},null,8,Ge))),256))],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[s.value.length&&!C.value&&!t.value.style.chart.layout.grid.vertical&&t.value.style.chart.layout.labels.captions.show&&(s.value[o].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||s.value[o].isAbsoluteFirst&&o%t.value.style.chart.layout.grid.size===0&&s.value[o].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:E.value<=0?1e-4:E.value,width:L.value*t.value.style.chart.layout.grid.size<=0?1e-4:L.value*t.value.style.chart.layout.grid.size,filter:A(s.value[o].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${t.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${L.value/12}px;color:${e.unref(n.adaptColorToBackground)(s.value[o].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",He,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(n.abbreviate)({source:s.value[o].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):s.value[o].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",Ye,e.toDisplayString(e.unref(n.dataLabel)({v:s.value[o].proportion,s:"%",r:t.value.style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",Xe," ("+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[o].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[o].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[o],position:a}))+") ",1)):e.createCommentVNode("",!0),!t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",Je,e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[o].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[o].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[o],position:a})),1)):e.createCommentVNode("",!0)],4)],8,We)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:u=>Ce(o),onMouseleave:r[0]||(r[0]=u=>{F.value=!1,B.value=null}),x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:E.value<=0?1e-4:E.value,width:L.value<=0?1e-4:L.value,fill:"transparent",stroke:"none"},null,40,Ke))),256)),e.renderSlot(l.$slots,"svg",{svg:k.value},void 0,!0)],14,Ee)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Qe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($e.default,{key:4,config:{type:"waffle",style:{backgroundColor:t.value.style.chart.backgroundColor,waffle:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:U},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Le.Legend,{key:`legend_${W.value}`,legendSet:_.value,config:xe.value,onClickMarker:r[1]||(r[1]=({legend:a})=>re(a.uid))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:o=>a.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue,isAnimating:C.value}),{datapoint:a}))+" ",1),v.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",tt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",et," ("+e.toDisplayString(isNaN(a.value/y.value)?"-":e.unref(n.dataLabel)({v:a.value/y.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:C.value}))+") ",1))],12,Ze)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_.value},void 0,!0)],512),e.createVNode(Se._sfc_main,{show:m.value.showTooltip&&F.value&&v.value.length<p.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:N.value,content:D.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function",fontSize:t.value.style.chart.tooltip.fontSize},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...O.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...O.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize"]),V.value?(e.openBlock(),e.createBlock(Te.default,{key:5,hideDetails:"",config:{open:m.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ne.DataTable,{key:`table_${G.value}`,colNames:z.value.colNames,head:z.value.head,body:z.value.body,config:z.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[2]||(r[2]=a=>m.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,lt)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Ie))}},ot=Ve._export_sfc(at,[["__scopeId","data-v-a0574c0d"]]);exports.default=ot;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-NvxTr0fZ.cjs"),ie=require("./useResponsive-B3TrDDIG.cjs"),_e=require("./Title-Cjusozo5.cjs"),ce=require("./usePrinter-0s8wVGIy.cjs"),Se=require("./Tooltip-CkqTs_wn.cjs"),Ne=require("./DataTable-DRJUrEXP.cjs"),Le=require("./Legend-DDmBZxt8.cjs"),$e=require("./vue-ui-skeleton-DYHqPo98.cjs"),Te=require("./vue-ui-accordion-CxPjShWo.cjs"),ve=require("./useNestedProp-DhLxBAwX.cjs"),Pe=require("./PackageVersion-rOhPenOY.cjs"),Ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),de=S=>(e.pushScopeId("data-v-a0574c0d"),S=S(),e.popScopeId(),S),Ie=["id"],Ee=["xmlns","viewBox"],ze=["id"],Fe=["stop-color"],De=["stop-color"],Oe=["id"],Ae=de(()=>e.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:2},null,-1)),qe=de(()=>e.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1)),Me=[Ae,qe],Re=["x","y","height","width"],Ue=["height","width"],je=["rx","x","y","height","width","stroke","stroke-width","filter"],Ge=["rx","x","y","height","width","fill","stroke","stroke-width","filter"],We=["x","y","height","width","filter"],He={key:0},Ye={key:1},Xe={key:2},Je={key:3},Ke=["onMouseover","x","y","height","width"],Qe={key:3,class:"vue-data-ui-watermark"},Ze=["onClick"],et={key:0},tt={key:1},lt=["innerHTML"],at={__name:"vue-ui-waffle",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(S,{expose:pe,emit:he}){const p=S,{vue_ui_waffle:fe}=n.useConfig(),V=e.computed(()=>!!p.dataset&&p.dataset.length),b=e.ref(n.createUid()),ye=e.ref(null),F=e.ref(!1),D=e.ref(""),B=e.ref(null),M=e.ref(0),N=e.ref(null),R=e.ref(null),U=e.ref(null),j=e.ref(0),G=e.ref(0),W=e.ref(0),t=e.computed({get:()=>H(),set:l=>l});function H(){const l=ve.useNestedProp({userConfig:p.config,defaultConfig:fe});return l.theme?{...ve.useNestedProp({userConfig:n.themes.vue_ui_waffle[l.theme]||p.config,defaultConfig:l}),customPalette:n.themePalettes[l.theme]||n.palette}:l}e.watch(()=>p.config,l=>{t.value=H(),Y(),j.value+=1,G.value+=1,W.value+=1},{deep:!0});const I=e.ref(null);function Y(){if(n.objectIsEmpty(p.dataset)?n.error({componentName:"VueUiWaffle",type:"dataset"}):p.dataset.forEach((l,r)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.responsive){const l=ie.throttle(()=>{const{width:r,height:a}=ie.useResponsive({chart:N.value,title:t.value.style.chart.title.text?R.value:null,legend:t.value.style.chart.legend.show?U.value:null});k.value.width=r,k.value.height=a,f.value.width=r,f.value.height=a});I.value=new ResizeObserver(l),I.value.observe(N.value.parentNode)}}e.onMounted(()=>{Y()}),e.onBeforeUnmount(()=>{I.value&&I.value.disconnect()});const{isPrinting:X,isImaging:J,generatePdf:K,generateImage:Q}=ce.usePrinter({elementId:`vue-ui-waffle_${b.value}`,fileName:t.value.style.chart.title.text||"vue-ui-waffle"}),Z=e.computed(()=>n.convertCustomPalette(t.value.customPalette)),m=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),k=e.ref({height:512,width:512}),f=e.ref({top:0,left:0,height:512,width:512}),w=e.computed(()=>(f.value.width-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),x=e.computed(()=>(f.value.height-t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.spaceBetween)/t.value.style.chart.layout.grid.size),L=e.computed(()=>f.value.width/t.value.style.chart.layout.grid.size),E=e.computed(()=>f.value.height/t.value.style.chart.layout.grid.size);function ee(l){const r=t.value.style.chart.layout.grid.size*t.value.style.chart.layout.grid.size,a=l.reduce((h,q)=>h+q,0),o=l.map(h=>h/a*r),u=o.map(Math.floor),i=o.map(h=>h%1);let d=r-u.reduce((h,q)=>h+q,0);for(;d>0;){let h=i.indexOf(Math.max(...i));u[h]+=1,i[h]=0,d-=1}return u}function te(){return p.dataset.map((l,r)=>({...l,color:n.convertColorToHex(l.color)||Z.value[r]||n.palette[r]||n.palette[r%n.palette.length],uid:`serie_${r}`,absoluteIndex:r}))}const le=e.computed(()=>te()),c=e.ref(le.value);e.watch(()=>p.dataset,l=>{c.value=te()},{deep:!0});const ge=e.computed(()=>{const l=c.value.filter((r,a)=>!v.value.includes(r.uid)).map((r,a)=>(r.values||[]).reduce((o,u)=>o+u,0));return ee(l)}),me=e.computed(()=>{const l=c.value.map((r,a)=>(r.values||[]).reduce((o,u)=>o+u));return ee(l)}),$=e.computed(()=>(p.dataset.forEach((l,r)=>{[null,void 0].includes(l.values)&&n.error({componentName:"VueUiWaffle",type:"datasetSerieAttribute",property:"values (number[])",index:r})}),c.value.filter((l,r)=>!v.value.includes(l.uid)).map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:ge.value[r]})))),be=e.computed(()=>c.value.map((l,r)=>({absoluteIndex:l.absoluteIndex,uid:l.uid,name:l.name,color:l.color,value:(l.values||[]).reduce((a,o)=>a+o,0),absoluteValues:l.values||[],proportion:me.value[r]})));function ke(){return be.value.map(l=>({name:l.name,color:l.color,value:l.value,proportion:l.proportion}))}const we=e.computed(()=>{let l=0;return $.value.map((r,a)=>{const o=l,u=o+r.proportion,i=[];for(let d=Math.floor(o);d<Math.floor(u);d+=1)i.push(d);return l=u,{...r,start:o,rects:i}})}),s=e.computed(()=>we.value.flatMap((l,r)=>l.rects.map((a,o)=>({isFirst:o===0,isLongEnough:a.length>2,name:l.name,color:l.color,value:l.value,serieIndex:r,absoluteStartIndex:o<3,serieId:l.uid,...l}))).map((l,r)=>({...l,isAbsoluteFirst:r%t.value.style.chart.layout.grid.size===0}))),T=e.computed(()=>{const l=[];for(let r=0;r<t.value.style.chart.layout.grid.size;r+=1)for(let a=0;a<t.value.style.chart.layout.grid.size;a+=1)l.push({isStartOfLine:a===0,position:t.value.style.chart.layout.grid.vertical?r:a,x:(t.value.style.chart.layout.grid.vertical?r:a)*(w.value+t.value.style.chart.layout.grid.spaceBetween),y:(t.value.style.chart.layout.grid.vertical?a:r)*(x.value+t.value.style.chart.layout.grid.spaceBetween)+f.value.top});return l}),v=e.ref([]),C=e.ref(!1),ae=e.ref(null),oe=e.ref(null);function re(l){if(!t.value.useAnimation){v.value.includes(l)?v.value=v.value.filter(u=>u!==l):v.value.length<_.value.length-1&&_.value.length>1&&v.value.push(l);return}const r=le.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);let o=c.value.find(u=>u.uid===l).values.reduce((u,i)=>u+i,0);if(v.value.includes(l)){let i=function(){o>u?(cancelAnimationFrame(ae.value),c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[u]}:d),C.value=!1):(C.value=!0,o+=u*.025,c.value=c.value.map((d,h)=>d.uid===l?{...d,values:[o]}:d),ae.value=requestAnimationFrame(i))};v.value=v.value.filter(d=>d!==l);const u=r;i()}else if(v.value.length<_.value.length-1&&_.value.length>1){let u=function(){o<.1?(cancelAnimationFrame(oe.value),v.value.push(l),c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[0]}:i),C.value=!1):(C.value=!0,o/=1.5,c.value=c.value.map((i,d)=>i.uid===l?{...i,values:[o]}:i),oe.value=requestAnimationFrame(u))};u()}he("selectLegend",$.value.map(u=>({name:u.name,color:u.color,value:u.value,proportion:u.proportion/Math.pow(t.value.style.chart.layout.grid.size,2)})))}const _=e.computed(()=>c.value.map((l,r)=>({name:l.name,color:l.color||Z[r]||n.palette[r]||n.palette[r%n.palette.length],value:(l.values||[]).reduce((a,o)=>a+o,0),uid:l.uid,shape:"square"})).map((l,r)=>({...l,proportion:l.value/c.value.map(a=>(a.values||[]).reduce((o,u)=>o+u,0)).reduce((a,o)=>a+o,0),opacity:v.value.includes(l.uid)?.5:1,segregate:()=>re(l.uid),isSegregated:v.value.includes(l.uid)}))),xe=e.computed(()=>({cy:"waffle-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),y=e.computed(()=>$.value.map(l=>l.value).reduce((l,r)=>l+r,0)),O=e.ref(null);function Ce(l){if(v.value.length===p.dataset.length)return;const r=s.value[l];O.value={datapoint:r,seriesIndex:r.absoluteIndex,series:c.value,config:t.value},F.value=!0,B.value=s.value[l].serieIndex;const a=t.value.style.chart.tooltip.customFormat;if(n.isFunction(a)&&n.functionReturnsString(()=>a({seriesIndex:s.value[l].absoluteIndex,datapoint:r,series:c.value,config:t.value})))D.value=a({seriesIndex:s.value[l].absoluteIndex,datapoint:r,series:c.value,config:t.value});else{let o="";if(o+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${r.name}</div>`,o+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" rx="1" fill="${r.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(o+=`<b>${n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,r.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:r.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:r,seriesIndex:s.value[l].absoluteIndex,series:c.value})}</b>`),t.value.style.chart.tooltip.showPercentage){const u=n.dataLabel({v:r.value/y.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage});t.value.style.chart.tooltip.showValue?o+=`<span>(${u})</span></div>`:o+=`<b>${u}%</b></div>`}D.value=o}}const g=e.computed(()=>{const l=$.value.map(a=>({name:a.name,color:a.color})),r=$.value.map(a=>a.value);return{head:l,body:r}});function A(l){return t.value.useBlurOnHover&&![null,void 0].includes(B.value)&&B.value!==l?`url(#blur_${b.value})`:""}function ue(){e.nextTick(()=>{const l=g.value.head.map((o,u)=>[[o.name],[g.value.body[u]],[isNaN(g.value.body[u]/y.value)?"-":g.value.body[u]/y.value*100]]),r=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(l),a=n.createCsvContent(r);n.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-waffle"})})}const z=e.computed(()=>{const l=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,y.value,n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:y.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),"100%"],r=g.value.head.map((u,i)=>[{color:u.color,name:u.name},n.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,g.value.body[i],n.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:g.value.body[i],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue})),isNaN(g.value.body[i]/y.value)?"-":n.dataLabel({v:g.value.body[i]/y.value*100,s:"%",r:t.value.table.td.roundingPercentage})]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},shape:"square",breakpoint:t.value.table.responsiveBreakpoint},o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:l,body:r,config:a,colNames:o}}),P=e.ref(!1);function Be(l){P.value=l,M.value+=1}function ne(){m.value.showTable=!m.value.showTable}function se(){m.value.showTooltip=!m.value.showTooltip}return pe({getData:ke,generatePdf:K,generateCsv:ue,generateImage:Q,toggleTable:ne,toggleTooltip:se}),(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-waffle ${P.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"waffleChart",ref:N,id:`vue-ui-waffle_${b.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:R,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(_e._sfc_main,{key:`title_${j.value}`,config:{title:{cy:"waffle-title",...t.value.style.chart.title},subtitle:{cy:"waffle-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&V.value?(e.openBlock(),e.createBlock(ce.UserOptions,{ref_key:"details",ref:ye,key:`user_options_${M.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(X),isImaging:e.unref(J),uid:b.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:P.value,isTooltip:m.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:N.value,position:t.value.userOptions.position,onToggleFullscreen:Be,onGeneratePdf:e.unref(K),onGenerateCsv:ue,onGenerateImage:e.unref(Q),onToggleTable:ne,onToggleTooltip:se},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:o})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(n.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":P.value,"vue-data-ui-fulscreen--off":!P.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Pe._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,o)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${b.value}_${o}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(n.setOpacity)(e.unref(n.shiftHue)(a.color,.05),100-t.value.style.chart.layout.rect.gradientIntensity)},null,8,Fe),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,De)],8,ze))),256))]),e.createElementVNode("defs",null,[e.createElementVNode("filter",{id:`blur_${b.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},Me,8,Oe)]),t.value.useCustomCells&&s.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("foreignObject",{x:a.x,y:a.y,height:x.value<=0?1e-4:x.value,width:w.value<=0?1e-4:w.value,class:"vue-ui-waffle-custom-cell-foreignObject"},[e.renderSlot(l.$slots,"cell",e.normalizeProps(e.guardReactiveProps({cell:{...a,color:s.value[o].color,...s.value[o]},isSelected:[null,void 0].includes(B.value)?!0:s.value[o].serieIndex===B.value})),void 0,!0)],8,Re))),256)):e.createCommentVNode("",!0),!s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock("rect",{key:1,x:12,y:12,height:f.value.height-24,width:f.value.width-24,rx:3,fill:"none",stroke:"black"},null,8,Ue)):s.value.length&&!t.value.useCustomCells?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:x.value<=0?1e-4:x.value,width:w.value<=0?1e-4:w.value,fill:"white",stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:A(s.value[o].serieIndex)},null,8,je))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{rx:t.value.style.chart.layout.rect.rounded?t.value.style.chart.layout.rect.rounding:0,x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:x.value<=0?1e-4:x.value,width:w.value<=0?1e-4:w.value,fill:t.value.style.chart.layout.rect.useGradient&&t.value.style.chart.layout.rect.gradientIntensity>0?`url(#gradient_${b.value}_${o})`:s.value[o].color,stroke:t.value.style.chart.layout.rect.stroke,"stroke-width":t.value.style.chart.layout.rect.strokeWidth,filter:A(s.value[o].serieIndex)},null,8,Ge))),256))],64)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[s.value.length&&!C.value&&!t.value.style.chart.layout.grid.vertical&&t.value.style.chart.layout.labels.captions.show&&(s.value[o].isFirst&&a.position<t.value.style.chart.layout.grid.size-2||s.value[o].isAbsoluteFirst&&o%t.value.style.chart.layout.grid.size===0&&s.value[o].absoluteStartIndex)?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.x+t.value.style.chart.layout.labels.captions.offsetX+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.labels.captions.offsetY+t.value.style.chart.layout.grid.spaceBetween/2,height:E.value<=0?1e-4:E.value,width:L.value*t.value.style.chart.layout.grid.size<=0?1e-4:L.value*t.value.style.chart.layout.grid.size,filter:A(s.value[o].serieIndex)},[e.createElementVNode("div",{class:"vue-ui-waffle-caption",style:e.normalizeStyle(`height: 100%; width: 100%; font-size:${t.value.style.chart.layout.labels.captions.fontSize}px;display:flex;align-items:center;justify-content:flex-start;padding: 0 ${L.value/12}px;color:${e.unref(n.adaptColorToBackground)(s.value[o].color)};gap:2px`)},[t.value.style.chart.layout.labels.captions.showSerieName?(e.openBlock(),e.createElementBlock("span",He,e.toDisplayString(t.value.style.chart.layout.labels.captions.serieNameAbbreviation?e.unref(n.abbreviate)({source:s.value[o].name,length:t.value.style.chart.layout.labels.captions.serieNameMaxAbbreviationSize}):s.value[o].name)+": ",1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage?(e.openBlock(),e.createElementBlock("span",Ye,e.toDisplayString(e.unref(n.dataLabel)({v:s.value[o].proportion,s:"%",r:t.value.style.chart.layout.labels.captions.roundingPercentage})),1)):e.createCommentVNode("",!0),t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",Xe," ("+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[o].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[o].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[o],position:a}))+") ",1)):e.createCommentVNode("",!0),!t.value.style.chart.layout.labels.captions.showPercentage&&t.value.style.chart.layout.labels.captions.showValue?(e.openBlock(),e.createElementBlock("span",Je,e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,s.value[o].value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:s.value[o].value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.layout.labels.captions.roundingValue}),{datapoint:s.value[o],position:a})),1)):e.createCommentVNode("",!0)],4)],8,We)):e.createCommentVNode("",!0)],64))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{onMouseover:u=>Ce(o),onMouseleave:r[0]||(r[0]=u=>{F.value=!1,B.value=null}),x:a.x+t.value.style.chart.layout.grid.spaceBetween/2,y:a.y+t.value.style.chart.layout.grid.spaceBetween/2,height:E.value<=0?1e-4:E.value,width:L.value<=0?1e-4:L.value,fill:"transparent",stroke:"none"},null,40,Ke))),256)),e.renderSlot(l.$slots,"svg",{svg:k.value},void 0,!0)],14,Ee)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Qe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(X)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($e.default,{key:4,config:{type:"waffle",style:{backgroundColor:t.value.style.chart.backgroundColor,waffle:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:U},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Le.Legend,{key:`legend_${W.value}`,legendSet:_.value,config:xe.value,onClickMarker:r[1]||(r[1]=({legend:a})=>re(a.uid))},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:o=>a.segregate(),style:e.normalizeStyle(`opacity:${v.value.includes(a.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(a.name)+": "+e.toDisplayString(e.unref(n.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,a.value,e.unref(n.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:a.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue,isAnimating:C.value}),{datapoint:a}))+" ",1),v.value.includes(a.uid)?(e.openBlock(),e.createElementBlock("span",tt," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",et," ("+e.toDisplayString(isNaN(a.value/y.value)?"-":e.unref(n.dataLabel)({v:a.value/y.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage,isAnimating:C.value}))+") ",1))],12,Ze)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:_.value},void 0,!0)],512),e.createVNode(Se._sfc_main,{show:m.value.showTooltip&&F.value&&v.value.length<p.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:N.value,content:D.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function",fontSize:t.value.style.chart.tooltip.fontSize},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...O.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...O.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom","fontSize"]),V.value?(e.openBlock(),e.createBlock(Te.default,{key:5,hideDetails:"",config:{open:m.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ne.DataTable,{key:`table_${G.value}`,colNames:z.value.colNames,head:z.value.head,body:z.value.body,config:z.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[2]||(r[2]=a=>m.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,lt)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Ie))}},ot=Ve._export_sfc(at,[["__scopeId","data-v-a0574c0d"]]);exports.default=ot;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as d, ref as c, watch as Te, onMounted as We, onBeforeUnmount as qe, openBlock as s, createElementBlock as i, normalizeClass as Se, normalizeStyle as Q, createBlock as V, createCommentVNode as f, unref as h, createSlots as He, withCtx as b, renderSlot as w, normalizeProps as q, guardReactiveProps as H, createVNode as Le, createElementVNode as k, Fragment as T, renderList as M, toDisplayString as S, createTextVNode as Pe, nextTick as Xe, pushScopeId as Ye, popScopeId as Ke } from "vue";
|
|
2
|
-
import { u as Je, c as Qe, t as Ze, a as et, p as B, o as tt, e as oe, g as lt, b as at, i as D, f as x, X as ot, s as ut, w as st, F as rt, K as nt, d as it, x as ct, y as vt, q as dt, r as ht } from "./index-
|
|
2
|
+
import { u as Je, c as Qe, t as Ze, a as et, p as B, o as tt, e as oe, g as lt, b as at, i as D, f as x, X as ot, s as ut, w as st, F as rt, K as nt, d as it, x as ct, y as vt, q as dt, r as ht } from "./index-BJNSbAx7.js";
|
|
3
3
|
import { t as pt, u as yt } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as ft } from "./Title-
|
|
5
|
-
import { u as gt, U as mt } from "./usePrinter-
|
|
6
|
-
import { _ as bt } from "./Tooltip-
|
|
7
|
-
import { D as wt } from "./DataTable-
|
|
8
|
-
import { L as kt } from "./Legend-
|
|
9
|
-
import xt from "./vue-ui-skeleton-
|
|
10
|
-
import Ct from "./vue-ui-accordion-
|
|
11
|
-
import { u as ze } from "./useNestedProp-
|
|
12
|
-
import { _ as _t } from "./PackageVersion-
|
|
4
|
+
import { _ as ft } from "./Title-0tYDaWv7.js";
|
|
5
|
+
import { u as gt, U as mt } from "./usePrinter-CkV5eORP.js";
|
|
6
|
+
import { _ as bt } from "./Tooltip-DdWGiVyf.js";
|
|
7
|
+
import { D as wt } from "./DataTable-BczvA492.js";
|
|
8
|
+
import { L as kt } from "./Legend-DnOc-JGW.js";
|
|
9
|
+
import xt from "./vue-ui-skeleton-CsU74BI7.js";
|
|
10
|
+
import Ct from "./vue-ui-accordion-DDf5Y2GY.js";
|
|
11
|
+
import { u as ze } from "./useNestedProp-CLh4tPxT.js";
|
|
12
|
+
import { _ as _t } from "./PackageVersion-DN8qp-uI.js";
|
|
13
13
|
import { _ as $t } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const Fe = (G) => (Ye("data-v-a0574c0d"), G = G(), Ke(), G), It = ["id"], Tt = ["xmlns", "viewBox"], St = ["id"], Lt = ["stop-color"], Pt = ["stop-color"], zt = ["id"], Ft = /* @__PURE__ */ Fe(() => /* @__PURE__ */ k("feGaussianBlur", {
|
|
15
15
|
in: "SourceGraphic",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-NvxTr0fZ.cjs"),U=require("./Title-Cjusozo5.cjs"),I=require("./usePrinter-0s8wVGIy.cjs"),S=require("./useResponsive-B3TrDDIG.cjs"),V=require("./vue-ui-skeleton-DYHqPo98.cjs"),z=require("./useNestedProp-DhLxBAwX.cjs"),G=require("./PackageVersion-rOhPenOY.cjs"),X=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["id"],H=["xmlns","viewBox"],D=["x1","x2","y1","y2","stroke","stroke-width","stroke-linecap"],Y=["cx","cy","r","stroke","stroke-width"],W=["x","y","font-size","fill","font-weight"],J={key:3,class:"vue-data-ui-watermark"},K={__name:"vue-ui-wheel",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(F,{expose:$}){const u=F,{vue_ui_wheel:O}=r.useConfig(),f=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length),y=e.ref(r.createUid()),M=e.ref(null),p=e.ref(0),h=e.ref(null),g=e.ref(null),k=e.ref(0),t=e.computed({get:()=>w(),set:l=>l});function w(){const l=z.useNestedProp({userConfig:u.config,defaultConfig:O});return l.theme?{...z.useNestedProp({userConfig:r.themes.vue_ui_wheel[l.theme]||u.config,defaultConfig:l})}:l}e.watch(()=>u.config,l=>{t.value=w(),P(),k.value+=1},{deep:!0});const{isPrinting:C,isImaging:b,generatePdf:_,generateImage:x}=I.usePrinter({elementId:y.value,fileName:t.value.style.chart.title.text||"vue-ui-wheel"}),n=e.ref({size:360,height:360,width:360}),m=e.ref(t.value.style.chart.layout.percentage.fontSize),s=e.computed(()=>({radius:Math.min(n.value.width,n.value.height)*.9/2,centerX:n.value.width/2,centerY:n.value.height/2}));function B(l,i=1){return{x:s.value.centerX+s.value.radius*Math.cos(29.85+l*Math.PI/180)*i,y:s.value.centerY+s.value.radius*Math.sin(29.85+l*Math.PI/180)*i}}const o=e.ref(t.value.style.chart.animation.use?0:u.dataset.percentage||0);e.watch(()=>u.dataset,l=>{t.value.style.chart.animation.use?N(l.percentage):o.value=l.percentage||0},{deep:!0});const v=e.ref(null);e.onMounted(()=>{P()});function P(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiWheel",type:"dataset"}),N(u.dataset.percentage||0),t.value.responsive){const l=S.throttle(()=>{const{width:i,height:a}=S.useResponsive({chart:h.value,title:t.value.style.chart.title.text?g.value:null});n.value.width=i,n.value.height=a,m.value=t.value.style.chart.layout.percentage.fontSize/360*Math.min(i,a)});v.value=new ResizeObserver(l),v.value.observe(h.value.parentNode)}}e.onBeforeUnmount(()=>{v.value&&v.value.disconnect()});function N(l){let i=t.value.style.chart.animation.speed;const a=Math.abs(l-o.value)/(i*120);function c(){o.value<l?o.value=Math.min(o.value+a,l):o.value>l&&(o.value=Math.max(o.value-a,l)),o.value!==l&&requestAnimationFrame(c)}c()}const E=e.computed(()=>{const l=[];for(let a=0;a<100;a+=1){const c=o.value>a?t.value.style.chart.layout.wheel.ticks.activeColor:t.value.style.chart.layout.wheel.ticks.inactiveColor,{x:A,y:T}=B(n.value.size/100*a),{x:L,y:R}=B(n.value.size/100*a,t.value.style.chart.layout.wheel.ticks.sizeRatio);l.push({x1:A,y1:T,x2:L,y2:R,color:t.value.style.chart.layout.wheel.ticks.gradient.show?r.shiftHue(c,a/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):c})}return l}),d=e.ref(!1);function q(l){d.value=l,p.value+=1}return $({generatePdf:_,generateImage:x}),(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-wheel",ref_key:"wheelChart",ref:h,id:y.value,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:g,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(U._sfc_main,{key:`title_${k.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(I.UserOptions,{ref_key:"details",ref:M,key:`user_options_${p.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(C),isImaging:e.unref(b),uid:y.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:d.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},chartElement:h.value,onToggleFullscreen:q,onGeneratePdf:e.unref(_),onGenerateImage:e.unref(x)},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:c})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:c})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","position","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":d.value,"vue-data-ui-fulscreen--off":!d.value}),viewBox:`0 0 ${n.value.width<=0?10:n.value.width} ${n.value.height<=0?10:n.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(G._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,(a,c)=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2,stroke:a.color,"stroke-width":5/360*Math.min(n.value.width,n.value.height),"stroke-linecap":t.value.style.chart.layout.wheel.ticks.rounded?"round":"butt",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&c<=o.value})},null,10,D))),256)),t.value.style.chart.layout.innerCircle.show?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:s.value.centerX,cy:s.value.centerY,r:s.value.radius*.8<=0?1e-4:s.value.radius*.8,stroke:t.value.style.chart.layout.innerCircle.stroke,"stroke-width":t.value.style.chart.layout.innerCircle.strokeWidth,fill:"none"},null,8,Y)):e.createCommentVNode("",!0),t.value.style.chart.layout.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:1,x:s.value.centerX,y:s.value.centerY+m.value/3,"font-size":m.value,fill:t.value.style.chart.layout.wheel.ticks.gradient.show?e.unref(r.shiftHue)(t.value.style.chart.layout.wheel.ticks.activeColor,o.value/100*(t.value.style.chart.layout.wheel.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.wheel.ticks.activeColor,"text-anchor":"middle","font-weight":t.value.style.chart.layout.percentage.bold?"bold":"normal",style:{"font-variant-numeric":"tabluar-nums"}},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.percentage.formatter,e.unref(r.checkNaN)(o.value),e.unref(r.dataLabel)({v:e.unref(r.checkNaN)(o.value),s:"%",r:t.value.style.chart.layout.percentage.rounding}))),9,W)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:n.value},void 0,!0)],14,H)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",J,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(C)||e.unref(b)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(V.default,{key:4,config:{type:"wheel",style:{backgroundColor:t.value.style.chart.backgroundColor,wheel:{color:"#CCCCCC"}}}},null,8,["config"]))],12,j))}},Q=X._export_sfc(K,[["__scopeId","data-v-b8e98e43"]]);exports.default=Q;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { computed as p, ref as o, watch as L, onMounted as V, onBeforeUnmount as ee, openBlock as r, createElementBlock as v, normalizeStyle as U, createBlock as C, createCommentVNode as d, unref as n, createSlots as te, withCtx as _, renderSlot as f, normalizeProps as X, guardReactiveProps as B, normalizeClass as G, createVNode as ae, Fragment as le, renderList as se, toDisplayString as ne } from "vue";
|
|
2
|
-
import { u as oe, c as re, t as ue, o as ie, e as ce, w as T, X as he, i as ve, v as E, f as de } from "./index-
|
|
3
|
-
import { _ as fe } from "./Title-
|
|
4
|
-
import { u as ye, U as me } from "./usePrinter-
|
|
2
|
+
import { u as oe, c as re, t as ue, o as ie, e as ce, w as T, X as he, i as ve, v as E, f as de } from "./index-BJNSbAx7.js";
|
|
3
|
+
import { _ as fe } from "./Title-0tYDaWv7.js";
|
|
4
|
+
import { u as ye, U as me } from "./usePrinter-CkV5eORP.js";
|
|
5
5
|
import { t as ge, u as pe } from "./useResponsive-NZB-WLRF.js";
|
|
6
|
-
import ke from "./vue-ui-skeleton-
|
|
7
|
-
import { u as R } from "./useNestedProp-
|
|
8
|
-
import { _ as we } from "./PackageVersion-
|
|
6
|
+
import ke from "./vue-ui-skeleton-CsU74BI7.js";
|
|
7
|
+
import { u as R } from "./useNestedProp-CLh4tPxT.js";
|
|
8
|
+
import { _ as we } from "./PackageVersion-DN8qp-uI.js";
|
|
9
9
|
import { _ as be } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
const Ce = ["id"], _e = ["xmlns", "viewBox"], xe = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-linecap"], Ie = ["cx", "cy", "r", "stroke", "stroke-width"], $e = ["x", "y", "font-size", "fill", "font-weight"], Fe = {
|
|
11
11
|
key: 3,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-Bv8wGGBc.cjs"),ye=require("./Title-DWSN4YUC.cjs"),te=require("./usePrinter-7jNVagoH.cjs"),D=require("./useResponsive-B3TrDDIG.cjs"),be=require("./vue-ui-accordion-CSkH8Ztm.cjs"),Ce=require("./DataTable-YpBvWSn5.cjs"),ke=require("./BaseIcon-DJbzYsmN.cjs"),le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),oe=require("./useNestedProp-Bf7w6kTt.cjs"),we=require("./PackageVersion-kqwH1rG4.cjs"),xe=require("./Tooltip-Bl8Ilf5h.cjs"),Se=i=>(e.pushScopeId("data-v-3fd7d274"),i=i(),e.popScopeId(),i),$e={"data-html2canvas-ignore":""},Te={key:0,class:"reset-wrapper"},Ne={key:1,class:"reset-wrapper"},Fe={class:"mono-slicer"},Pe=Se(()=>e.createElementVNode("div",{class:"slider-track"},null,-1)),Be=["min","max","value"],ze={__name:"MonoSlicer",props:{min:{type:Number,default:0},max:{type:Number,default:0},inputColor:{type:String,default:"#1A1A1A"},background:{type:String,default:"#FFFFFF"},borderColor:{type:String,default:"#FFFFFF"},selectColor:{type:String,default:"#4A4A4A"},textColor:{type:String,default:"#1A1A1A"},useResetSlot:{type:Boolean,default:!1},value:{type:Number,default:0},source:{type:Number,default:0}},emits:["update:value","reset"],setup(i,{emit:F}){const r=i;e.useCssVars(g=>({"90ad3208":V.value,"4f9eef70":S.value,"6e07ae3e":p.value,"2fd430a0":i.selectColor,"6b8169a4":y.value}));const V=e.computed(()=>r.inputColor),y=e.computed(()=>r.background),p=e.computed(()=>`${r.selectColor}33`),S=e.computed(()=>r.borderColor);function $(){F("reset")}const f=e.computed(()=>{const g=r.max-r.min,h=0,b=(r.value-r.min)/g*100;return{left:`${h}%`,width:`${b-h}%`,background:r.selectColor}});return(g,h)=>(e.openBlock(),e.createElementBlock("div",$e,[i.value!==i.source?(e.openBlock(),e.createElementBlock("div",Te,[i.useResetSlot?e.renderSlot(g.$slots,"reset-action",{key:1,reset:$},void 0,!0):(e.openBlock(),e.createElementBlock("button",{key:0,"data-cy-reset":"",tabindex:"0",role:"button",class:"vue-data-ui-refresh-button",onClick:$},[e.createVNode(ke.default,{name:"refresh",stroke:i.textColor},null,8,["stroke"])]))])):(e.openBlock(),e.createElementBlock("div",Ne)),e.createElementVNode("div",Fe,[Pe,e.createElementVNode("div",{class:"range-highlight",style:e.normalizeStyle(f.value)},null,4),e.createElementVNode("input",{type:"range",min:i.min,max:i.max,value:Number(i.value),onInput:h[0]||(h[0]=b=>F("update:value",Number(b.target.value)))},null,40,Be)])]))}},_e=le._export_sfc(ze,[["__scopeId","data-v-3fd7d274"]]),Ee=["id"],Ve=["xmlns","viewBox"],Ie=["transform"],Oe=["fill","font-weight","x","y","font-size","transform","onMouseover"],Me={key:3,class:"vue-data-ui-watermark"},Ae=["innerHTML"],Re={__name:"vue-ui-word-cloud",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,String],default(){return[]}}},setup(i,{expose:F}){const r=i,{vue_ui_word_cloud:V}=s.useConfig(),y=e.computed({get(){return!!r.dataset&&r.dataset.length},set(o){return o}}),p=e.ref(typeof r.dataset=="string"?s.createWordCloudDatasetFromPlainText(r.dataset):r.dataset.map(o=>({...o,value:s.checkNaN(o.value)}))),S=e.ref(s.createUid()),$=e.ref(0),f=e.ref(null),g=e.ref(null),h=e.ref(0),b=e.ref(0),I=e.ref(!1),t=e.computed({get:()=>U(),set:o=>o});function U(){const o=oe.useNestedProp({userConfig:r.config,defaultConfig:V});return o.theme?{...oe.useNestedProp({userConfig:s.themes.vue_ui_word_cloud[o.theme]||r.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>r.config,o=>{t.value=U(),L(),h.value+=1,b.value+=1,O()},{deep:!0});const G=e.ref(null),C=e.ref(0),u=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,maxFontSize:t.value.style.chart.words.maxFontSize,minFontSize:t.value.style.chart.words.minFontSize}),ae=D.throttle(()=>{const{width:o,height:a}=D.useResponsive({chart:f.value,title:t.value.style.chart.title.text?g.value:null,slicer:t.value.style.chart.zoom.show&&G.value});u.value.width=o,u.value.height=a,e.nextTick(M)});e.watch(()=>C.value,()=>{ne()});const ne=D.debounce(()=>{M()},10);function O(){C.value=J.value}const P=e.ref(null);e.onMounted(()=>{L(),O()});function L(){s.objectIsEmpty(r.dataset)?s.error({componentName:"VueUiWordCloud",type:"dataset"}):p.value.forEach((o,a)=>{s.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(l=>{y.value=!1,s.error({componentName:"VueUiWordCloud",type:"datasetSerieAttribute",property:l,index:a})})}),t.value.responsive&&(P.value=new ResizeObserver(ae),P.value.observe(f.value.parentNode))}e.onBeforeUnmount(()=>{P.value&&P.value.disconnect()});const{isPrinting:j,isImaging:X,generatePdf:H,generateImage:Y}=te.usePrinter({elementId:`wordCloud_${S.value}`,fileName:t.value.style.chart.title.text||"vue-ui-word-cloud"}),d=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show});function re(o,a,l="Arial"){const n=document.createElement("canvas").getContext("2d");return n.font=`${a}px ${t.value.style.chart.words.bold?"bold":"normal"} ${l}`,{width:n.measureText(o).width+t.value.style.chart.words.proximity,height:a}}function se(o,a){return o.x<a.x+a.width&&o.x+o.width>a.x&&o.y<a.y+a.height&&o.y+o.height>a.y}function ue(o,a,l){const c=[],n={x:-a/2,y:-l/2,width:a,height:l},v=0,w=0;return o.forEach(x=>{let W=!1;for(let E=0;E<Math.max(a,l)/2&&!W;E+=t.value.style.chart.words.packingWeight)for(let q=0;q<360&&!W;q+=t.value.style.chart.words.packingWeight){const ee=q*Math.PI/180,he=v+E*Math.cos(ee)-x.width/2,me=w+E*Math.sin(ee)-x.height/2,m={...x,x:he,y:me},pe=m.x>=n.x&&m.y>=n.y&&m.x+m.width<=n.x+n.width&&m.y+m.height<=n.y+n.height,fe=c.some(ge=>se(m,ge));pe&&!fe&&(c.push(m),W=!0)}}),c}const T=e.ref([]);e.watch(()=>r.dataset,M,{immediate:!0});const J=e.computed(()=>Math.min(...p.value.map(o=>o.value))),ie=e.computed(()=>Math.max(...p.value.map(o=>o.value)));function M(){const o=[...p.value].filter(n=>n.value>=C.value).map(n=>n.value),a=Math.max(...o),l=Math.min(...o),c=[...p.value].filter(n=>n.value>=C.value).map((n,v)=>{const w=(n.value-l)/(a-l)*(u.value.maxFontSize-u.value.minFontSize)+u.value.minFontSize,x=re(n.name,w);return{...n,id:s.createUid(),fontSize:w,width:x.width,height:x.height,color:t.value.style.chart.words.usePalette?t.value.customPalette[v]||t.value.customPalette[v%t.value.customPalette.length]||s.palette[v]||s.palette[v%s.palette.length]:t.value.style.chart.words.color}});T.value=ue(c,u.value.width,u.value.height).sort((n,v)=>v.fontSize-n.fontSize)}const B=e.computed(()=>{const o=T.value.map(l=>({name:l.name,color:l.color})),a=T.value.map(l=>l.value);return{head:o,body:a}});function K(){e.nextTick(()=>{const o=B.value.head.map((c,n)=>[[c.name],[B.value.body[n]]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(a);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-word-cloud"})})}const z=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value],a=B.value.head.map((n,v)=>{const w=s.dataLabel({p:t.value.table.td.prefix,v:B.value.body[v],s:t.value.table.td.suffix,r:t.value.table.td.roundingValue});return[{color:n.color,name:n.name},w]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}}),_=e.ref(!1);function ce(o){_.value=o,$.value+=1}function de(){return T.value}function Q(){d.value.showTable=!d.value.showTable}function Z(){d.value.showTooltip=!d.value.showTooltip}F({getData:de,generateCsv:K,generatePdf:H,generateImage:Y,toggleTable:Q,toggleTooltip:Z});const k=e.ref(null),N=e.ref(!1),A=e.ref(""),R=e.ref(null);function ve(o){if(!d.value.showTooltip)return;k.value=o.id,R.value={datapoint:o,config:t.value};const a=t.value.style.chart.tooltip.customFormat;if(N.value=!1,s.isFunction(a))try{const l=a({datapoint:o,config:t.value});typeof l=="string"&&(A.value=l,N.value=!0)}catch{console.warn("Custom format cannot be applied."),N.value=!1}if(!N.value){let l=`<svg viewBox="0 0 10 10" height="${t.value.style.chart.tooltip.fontSize}"><circle cx="5" cy="5" r="5" fill="${o.color}"/></svg><span>${o.name}:</span><b>${(o.value||0).toFixed(t.value.style.chart.tooltip.roundingValue)}</b>`;A.value=`<div dir="auto" style="display:flex; gap:4px; align-items:center; jsutify-content:center;">${l}</div>`}I.value=!0}return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-word-cloud",ref_key:"wordCloudChart",ref:f,id:`wordCloud_${S.value}`,style:e.normalizeStyle(`width: 100%; font-family:${t.value.style.fontFamily};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:g,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ye._sfc_main,{key:`title_${h.value}`,config:{title:{...t.value.style.chart.title},subtitle:{...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&y.value?(e.openBlock(),e.createBlock(te.UserOptions,{ref:"details",key:`user_option_${$.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(j),isImaging:e.unref(X),uid:S.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:f.value,position:t.value.userOptions.position,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,isTooltip:d.value.showTooltip,onToggleFullscreen:ce,onGeneratePdf:e.unref(H),onGenerateCsv:K,onGenerateImage:e.unref(Y),onToggleTable:Q,onToggleTooltip:Z},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:c})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:c})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasTooltip","isTooltip","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("svg",{key:2,class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${u.value.width<=0?10:u.value.width} ${u.value.height<=0?10:u.value.height}`,style:"overflow:visible;background:transparent;"},[e.createVNode(we._sfc_main),e.createElementVNode("g",{transform:`translate(${(u.value.width<=0?10:u.value.width)/2}, ${(u.value.height<=0?10:u.value.height)/2})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(),e.createElementBlock("text",{fill:l.color,"font-weight":t.value.style.chart.words.bold?"bold":"normal",key:c,x:l.x,y:l.y,"font-size":l.fontSize,transform:`translate(${l.width/2}, ${l.height/2})`,class:e.normalizeClass({animated:t.value.useCssAnimation,"word-selected":k.value&&k.value===l.id&&d.value.showTooltip,"word-not-selected":k.value&&k.value!==l.id&&d.value.showTooltip}),"text-anchor":"middle","dominant-baseline":"middle",onMouseover:n=>ve(l),onMouseleave:a[0]||(a[0]=n=>{k.value=null,I.value=!1}),style:e.normalizeStyle(`animation-delay:${c*t.value.animationDelayMs}ms !important;`)},e.toDisplayString(l.name),47,Oe))]))),256))],8,Ie),e.renderSlot(o.$slots,"svg",{svg:{height:u.value.height,width:u.value.width}},void 0,!0)],10,Ve)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Me,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(j)||e.unref(X)})),void 0,!0)])):e.createCommentVNode("",!0),e.createVNode(xe._sfc_main,{show:d.value.showTooltip&&I.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:f.value,content:A.value,isCustom:N.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...R.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...R.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),e.createElementVNode("div",{ref_key:"chartSlicer",ref:G,style:"width:100%;background:transparent","data-html2canvas-ignore":""},[t.value.style.chart.zoom.show?(e.openBlock(),e.createBlock(_e,{key:0,value:C.value,"onUpdate:value":a[1]||(a[1]=l=>C.value=l),min:J.value,max:ie.value,textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,useResetSlot:t.value.style.chart.zoom.useResetSlot,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,source:t.value.style.chart.width,onReset:O},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(o.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["value","min","max","textColor","inputColor","selectColor","useResetSlot","background","borderColor","source"])):e.createCommentVNode("",!0)],512),y.value?(e.openBlock(),e.createBlock(be.default,{key:4,hideDetails:"",config:{open:d.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(Ce.DataTable,{key:`table_${b.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:a[2]||(a[2]=l=>d.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Ae)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],12,Ee))}},We=le._export_sfc(Re,[["__scopeId","data-v-7f4cd511"]]);exports.default=We;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-NvxTr0fZ.cjs"),ye=require("./Title-Cjusozo5.cjs"),te=require("./usePrinter-0s8wVGIy.cjs"),D=require("./useResponsive-B3TrDDIG.cjs"),be=require("./vue-ui-accordion-CxPjShWo.cjs"),Ce=require("./DataTable-DRJUrEXP.cjs"),ke=require("./BaseIcon-JWYc0t9a.cjs"),le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),oe=require("./useNestedProp-DhLxBAwX.cjs"),we=require("./PackageVersion-rOhPenOY.cjs"),xe=require("./Tooltip-CkqTs_wn.cjs"),Se=i=>(e.pushScopeId("data-v-3fd7d274"),i=i(),e.popScopeId(),i),$e={"data-html2canvas-ignore":""},Te={key:0,class:"reset-wrapper"},Ne={key:1,class:"reset-wrapper"},Fe={class:"mono-slicer"},Pe=Se(()=>e.createElementVNode("div",{class:"slider-track"},null,-1)),Be=["min","max","value"],ze={__name:"MonoSlicer",props:{min:{type:Number,default:0},max:{type:Number,default:0},inputColor:{type:String,default:"#1A1A1A"},background:{type:String,default:"#FFFFFF"},borderColor:{type:String,default:"#FFFFFF"},selectColor:{type:String,default:"#4A4A4A"},textColor:{type:String,default:"#1A1A1A"},useResetSlot:{type:Boolean,default:!1},value:{type:Number,default:0},source:{type:Number,default:0}},emits:["update:value","reset"],setup(i,{emit:F}){const r=i;e.useCssVars(g=>({"90ad3208":V.value,"4f9eef70":S.value,"6e07ae3e":p.value,"2fd430a0":i.selectColor,"6b8169a4":y.value}));const V=e.computed(()=>r.inputColor),y=e.computed(()=>r.background),p=e.computed(()=>`${r.selectColor}33`),S=e.computed(()=>r.borderColor);function $(){F("reset")}const f=e.computed(()=>{const g=r.max-r.min,h=0,b=(r.value-r.min)/g*100;return{left:`${h}%`,width:`${b-h}%`,background:r.selectColor}});return(g,h)=>(e.openBlock(),e.createElementBlock("div",$e,[i.value!==i.source?(e.openBlock(),e.createElementBlock("div",Te,[i.useResetSlot?e.renderSlot(g.$slots,"reset-action",{key:1,reset:$},void 0,!0):(e.openBlock(),e.createElementBlock("button",{key:0,"data-cy-reset":"",tabindex:"0",role:"button",class:"vue-data-ui-refresh-button",onClick:$},[e.createVNode(ke.default,{name:"refresh",stroke:i.textColor},null,8,["stroke"])]))])):(e.openBlock(),e.createElementBlock("div",Ne)),e.createElementVNode("div",Fe,[Pe,e.createElementVNode("div",{class:"range-highlight",style:e.normalizeStyle(f.value)},null,4),e.createElementVNode("input",{type:"range",min:i.min,max:i.max,value:Number(i.value),onInput:h[0]||(h[0]=b=>F("update:value",Number(b.target.value)))},null,40,Be)])]))}},_e=le._export_sfc(ze,[["__scopeId","data-v-3fd7d274"]]),Ee=["id"],Ve=["xmlns","viewBox"],Ie=["transform"],Oe=["fill","font-weight","x","y","font-size","transform","onMouseover"],Me={key:3,class:"vue-data-ui-watermark"},Ae=["innerHTML"],Re={__name:"vue-ui-word-cloud",props:{config:{type:Object,default(){return{}}},dataset:{type:[Array,String],default(){return[]}}},setup(i,{expose:F}){const r=i,{vue_ui_word_cloud:V}=s.useConfig(),y=e.computed({get(){return!!r.dataset&&r.dataset.length},set(o){return o}}),p=e.ref(typeof r.dataset=="string"?s.createWordCloudDatasetFromPlainText(r.dataset):r.dataset.map(o=>({...o,value:s.checkNaN(o.value)}))),S=e.ref(s.createUid()),$=e.ref(0),f=e.ref(null),g=e.ref(null),h=e.ref(0),b=e.ref(0),I=e.ref(!1),t=e.computed({get:()=>U(),set:o=>o});function U(){const o=oe.useNestedProp({userConfig:r.config,defaultConfig:V});return o.theme?{...oe.useNestedProp({userConfig:s.themes.vue_ui_word_cloud[o.theme]||r.config,defaultConfig:o}),customPalette:s.themePalettes[o.theme]||s.palette}:o}e.watch(()=>r.config,o=>{t.value=U(),L(),h.value+=1,b.value+=1,O()},{deep:!0});const G=e.ref(null),C=e.ref(0),u=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,maxFontSize:t.value.style.chart.words.maxFontSize,minFontSize:t.value.style.chart.words.minFontSize}),ae=D.throttle(()=>{const{width:o,height:a}=D.useResponsive({chart:f.value,title:t.value.style.chart.title.text?g.value:null,slicer:t.value.style.chart.zoom.show&&G.value});u.value.width=o,u.value.height=a,e.nextTick(M)});e.watch(()=>C.value,()=>{ne()});const ne=D.debounce(()=>{M()},10);function O(){C.value=J.value}const P=e.ref(null);e.onMounted(()=>{L(),O()});function L(){s.objectIsEmpty(r.dataset)?s.error({componentName:"VueUiWordCloud",type:"dataset"}):p.value.forEach((o,a)=>{s.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(l=>{y.value=!1,s.error({componentName:"VueUiWordCloud",type:"datasetSerieAttribute",property:l,index:a})})}),t.value.responsive&&(P.value=new ResizeObserver(ae),P.value.observe(f.value.parentNode))}e.onBeforeUnmount(()=>{P.value&&P.value.disconnect()});const{isPrinting:j,isImaging:X,generatePdf:H,generateImage:Y}=te.usePrinter({elementId:`wordCloud_${S.value}`,fileName:t.value.style.chart.title.text||"vue-ui-word-cloud"}),d=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show});function re(o,a,l="Arial"){const n=document.createElement("canvas").getContext("2d");return n.font=`${a}px ${t.value.style.chart.words.bold?"bold":"normal"} ${l}`,{width:n.measureText(o).width+t.value.style.chart.words.proximity,height:a}}function se(o,a){return o.x<a.x+a.width&&o.x+o.width>a.x&&o.y<a.y+a.height&&o.y+o.height>a.y}function ue(o,a,l){const c=[],n={x:-a/2,y:-l/2,width:a,height:l},v=0,w=0;return o.forEach(x=>{let W=!1;for(let E=0;E<Math.max(a,l)/2&&!W;E+=t.value.style.chart.words.packingWeight)for(let q=0;q<360&&!W;q+=t.value.style.chart.words.packingWeight){const ee=q*Math.PI/180,he=v+E*Math.cos(ee)-x.width/2,me=w+E*Math.sin(ee)-x.height/2,m={...x,x:he,y:me},pe=m.x>=n.x&&m.y>=n.y&&m.x+m.width<=n.x+n.width&&m.y+m.height<=n.y+n.height,fe=c.some(ge=>se(m,ge));pe&&!fe&&(c.push(m),W=!0)}}),c}const T=e.ref([]);e.watch(()=>r.dataset,M,{immediate:!0});const J=e.computed(()=>Math.min(...p.value.map(o=>o.value))),ie=e.computed(()=>Math.max(...p.value.map(o=>o.value)));function M(){const o=[...p.value].filter(n=>n.value>=C.value).map(n=>n.value),a=Math.max(...o),l=Math.min(...o),c=[...p.value].filter(n=>n.value>=C.value).map((n,v)=>{const w=(n.value-l)/(a-l)*(u.value.maxFontSize-u.value.minFontSize)+u.value.minFontSize,x=re(n.name,w);return{...n,id:s.createUid(),fontSize:w,width:x.width,height:x.height,color:t.value.style.chart.words.usePalette?t.value.customPalette[v]||t.value.customPalette[v%t.value.customPalette.length]||s.palette[v]||s.palette[v%s.palette.length]:t.value.style.chart.words.color}});T.value=ue(c,u.value.width,u.value.height).sort((n,v)=>v.fontSize-n.fontSize)}const B=e.computed(()=>{const o=T.value.map(l=>({name:l.name,color:l.color})),a=T.value.map(l=>l.value);return{head:o,body:a}});function K(){e.nextTick(()=>{const o=B.value.head.map((c,n)=>[[c.name],[B.value.body[n]]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],[t.value.table.columnNames.value]]].concat(o),l=s.createCsvContent(a);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-word-cloud"})})}const z=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value],a=B.value.head.map((n,v)=>{const w=s.dataLabel({p:t.value.table.td.prefix,v:B.value.body[v],s:t.value.table.td.suffix,r:t.value.table.td.roundingValue});return[{color:n.color,name:n.name},w]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}}),_=e.ref(!1);function ce(o){_.value=o,$.value+=1}function de(){return T.value}function Q(){d.value.showTable=!d.value.showTable}function Z(){d.value.showTooltip=!d.value.showTooltip}F({getData:de,generateCsv:K,generatePdf:H,generateImage:Y,toggleTable:Q,toggleTooltip:Z});const k=e.ref(null),N=e.ref(!1),A=e.ref(""),R=e.ref(null);function ve(o){if(!d.value.showTooltip)return;k.value=o.id,R.value={datapoint:o,config:t.value};const a=t.value.style.chart.tooltip.customFormat;if(N.value=!1,s.isFunction(a))try{const l=a({datapoint:o,config:t.value});typeof l=="string"&&(A.value=l,N.value=!0)}catch{console.warn("Custom format cannot be applied."),N.value=!1}if(!N.value){let l=`<svg viewBox="0 0 10 10" height="${t.value.style.chart.tooltip.fontSize}"><circle cx="5" cy="5" r="5" fill="${o.color}"/></svg><span>${o.name}:</span><b>${(o.value||0).toFixed(t.value.style.chart.tooltip.roundingValue)}</b>`;A.value=`<div dir="auto" style="display:flex; gap:4px; align-items:center; jsutify-content:center;">${l}</div>`}I.value=!0}return(o,a)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-word-cloud",ref_key:"wordCloudChart",ref:f,id:`wordCloud_${S.value}`,style:e.normalizeStyle(`width: 100%; font-family:${t.value.style.fontFamily};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:g,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ye._sfc_main,{key:`title_${h.value}`,config:{title:{...t.value.style.chart.title},subtitle:{...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&y.value?(e.openBlock(),e.createBlock(te.UserOptions,{ref:"details",key:`user_option_${$.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(j),isImaging:e.unref(X),uid:S.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:f.value,position:t.value.userOptions.position,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,isTooltip:d.value.showTooltip,onToggleFullscreen:ce,onGeneratePdf:e.unref(H),onGenerateCsv:K,onGenerateImage:e.unref(Y),onToggleTable:Q,onToggleTooltip:Z},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:c})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:c})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasTooltip","isTooltip","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),y.value?(e.openBlock(),e.createElementBlock("svg",{key:2,class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),xmlns:e.unref(s.XMLNS),viewBox:`0 0 ${u.value.width<=0?10:u.value.width} ${u.value.height<=0?10:u.value.height}`,style:"overflow:visible;background:transparent;"},[e.createVNode(we._sfc_main),e.createElementVNode("g",{transform:`translate(${(u.value.width<=0?10:u.value.width)/2}, ${(u.value.height<=0?10:u.value.height)/2})`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(l,c)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(),e.createElementBlock("text",{fill:l.color,"font-weight":t.value.style.chart.words.bold?"bold":"normal",key:c,x:l.x,y:l.y,"font-size":l.fontSize,transform:`translate(${l.width/2}, ${l.height/2})`,class:e.normalizeClass({animated:t.value.useCssAnimation,"word-selected":k.value&&k.value===l.id&&d.value.showTooltip,"word-not-selected":k.value&&k.value!==l.id&&d.value.showTooltip}),"text-anchor":"middle","dominant-baseline":"middle",onMouseover:n=>ve(l),onMouseleave:a[0]||(a[0]=n=>{k.value=null,I.value=!1}),style:e.normalizeStyle(`animation-delay:${c*t.value.animationDelayMs}ms !important;`)},e.toDisplayString(l.name),47,Oe))]))),256))],8,Ie),e.renderSlot(o.$slots,"svg",{svg:{height:u.value.height,width:u.value.width}},void 0,!0)],10,Ve)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Me,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(j)||e.unref(X)})),void 0,!0)])):e.createCommentVNode("",!0),e.createVNode(xe._sfc_main,{show:d.value.showTooltip&&I.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:f.value,content:A.value,isCustom:N.value},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...R.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...R.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),e.createElementVNode("div",{ref_key:"chartSlicer",ref:G,style:"width:100%;background:transparent","data-html2canvas-ignore":""},[t.value.style.chart.zoom.show?(e.openBlock(),e.createBlock(_e,{key:0,value:C.value,"onUpdate:value":a[1]||(a[1]=l=>C.value=l),min:J.value,max:ie.value,textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,useResetSlot:t.value.style.chart.zoom.useResetSlot,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,source:t.value.style.chart.width,onReset:O},{"reset-action":e.withCtx(({reset:l})=>[e.renderSlot(o.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:l})),void 0,!0)]),_:3},8,["value","min","max","textColor","inputColor","selectColor","useResetSlot","background","borderColor","source"])):e.createCommentVNode("",!0)],512),y.value?(e.openBlock(),e.createBlock(be.default,{key:4,hideDetails:"",config:{open:d.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(Ce.DataTable,{key:`table_${b.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:a[2]||(a[2]=l=>d.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Ae)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],12,Ee))}},We=le._export_sfc(Re,[["__scopeId","data-v-7f4cd511"]]);exports.default=We;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useCssVars as Ae, computed as p, openBlock as u, createElementBlock as f, createVNode as ee, renderSlot as m, createElementVNode as $, normalizeStyle as te, pushScopeId as We, popScopeId as Re, ref as n, watch as Q, onMounted as Be, onBeforeUnmount as De, createBlock as A, createCommentVNode as z, unref as k, createSlots as Ve, withCtx as h, normalizeProps as W, guardReactiveProps as R, normalizeClass as me, Fragment as Ee, renderList as Ue, toDisplayString as fe, createTextVNode as Ge, nextTick as pe } from "vue";
|
|
2
|
-
import { u as Le, Z as Xe, v as je, c as ge, t as Ye, a as qe, p as L, o as He, e as ye, g as Ze, f as Je, X as Ke, q as Qe, r as et, x as tt } from "./index-
|
|
3
|
-
import { _ as ot } from "./Title-
|
|
4
|
-
import { u as at, U as lt } from "./usePrinter-
|
|
2
|
+
import { u as Le, Z as Xe, v as je, c as ge, t as Ye, a as qe, p as L, o as He, e as ye, g as Ze, f as Je, X as Ke, q as Qe, r as et, x as tt } from "./index-BJNSbAx7.js";
|
|
3
|
+
import { _ as ot } from "./Title-0tYDaWv7.js";
|
|
4
|
+
import { u as at, U as lt } from "./usePrinter-CkV5eORP.js";
|
|
5
5
|
import { d as st, t as nt, u as rt } from "./useResponsive-NZB-WLRF.js";
|
|
6
|
-
import ut from "./vue-ui-accordion-
|
|
7
|
-
import { D as it } from "./DataTable-
|
|
8
|
-
import ct from "./BaseIcon-
|
|
6
|
+
import ut from "./vue-ui-accordion-DDf5Y2GY.js";
|
|
7
|
+
import { D as it } from "./DataTable-BczvA492.js";
|
|
8
|
+
import ct from "./BaseIcon-CiQsJmEc.js";
|
|
9
9
|
import { _ as Ce } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
|
-
import { u as be } from "./useNestedProp-
|
|
11
|
-
import { _ as dt } from "./PackageVersion-
|
|
12
|
-
import { _ as vt } from "./Tooltip-
|
|
10
|
+
import { u as be } from "./useNestedProp-CLh4tPxT.js";
|
|
11
|
+
import { _ as dt } from "./PackageVersion-DN8qp-uI.js";
|
|
12
|
+
import { _ as vt } from "./Tooltip-DdWGiVyf.js";
|
|
13
13
|
const ht = (i) => (We("data-v-3fd7d274"), i = i(), Re(), i), mt = { "data-html2canvas-ignore": "" }, ft = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "reset-wrapper"
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { c as J, a as K, t as Q, z as j, p as $, U as q, O as T, f as U, K as ee, F as te, i as ae, _ as ie, Y as re, $ as le, v as se, a0 as ne, d as ce, B as oe, b as he, q as de, R as ue, a1 as ge, r as fe, e as Ne, y as me, M as Ie, x as xe, a2 as be, o as Fe, s as _e, w as ye, E as Ae, A as Le, u as Ce } from "./index-
|
|
2
|
-
import { D as Se } from "./DataTable-
|
|
3
|
-
import { _ as ke } from "./Title-
|
|
4
|
-
import { _ as we, u as Oe } from "./Tooltip-
|
|
5
|
-
import { U as Ge } from "./usePrinter-
|
|
6
|
-
import { _ as ve } from "./Shape-
|
|
7
|
-
import pe from "./BaseIcon-
|
|
8
|
-
import ze from "./vue-ui-table-sparkline-
|
|
9
|
-
import Me from "./vue-ui-skeleton-
|
|
10
|
-
import { S as Pe } from "./Slicer-
|
|
11
|
-
import Te from "./vue-ui-accordion-
|
|
12
|
-
import { u as Z } from "./useNestedProp-
|
|
13
|
-
import { _ as Ve } from "./PackageVersion-
|
|
1
|
+
import { c as J, a as K, t as Q, z as j, p as $, U as q, O as T, f as U, K as ee, F as te, i as ae, _ as ie, Y as re, $ as le, v as se, a0 as ne, d as ce, B as oe, b as he, q as de, R as ue, a1 as ge, r as fe, e as Ne, y as me, M as Ie, x as xe, a2 as be, o as Fe, s as _e, w as ye, E as Ae, A as Le, u as Ce } from "./index-BJNSbAx7.js";
|
|
2
|
+
import { D as Se } from "./DataTable-BczvA492.js";
|
|
3
|
+
import { _ as ke } from "./Title-0tYDaWv7.js";
|
|
4
|
+
import { _ as we, u as Oe } from "./Tooltip-DdWGiVyf.js";
|
|
5
|
+
import { U as Ge } from "./usePrinter-CkV5eORP.js";
|
|
6
|
+
import { _ as ve } from "./Shape-DhRVUsKe.js";
|
|
7
|
+
import pe from "./BaseIcon-CiQsJmEc.js";
|
|
8
|
+
import ze from "./vue-ui-table-sparkline-D0NjMfnV.js";
|
|
9
|
+
import Me from "./vue-ui-skeleton-CsU74BI7.js";
|
|
10
|
+
import { S as Pe } from "./Slicer-B7JFT6tT.js";
|
|
11
|
+
import Te from "./vue-ui-accordion-DDf5Y2GY.js";
|
|
12
|
+
import { u as Z } from "./useNestedProp-CLh4tPxT.js";
|
|
13
|
+
import { _ as Ve } from "./PackageVersion-DN8qp-uI.js";
|
|
14
14
|
import { resolveComponent as V, openBlock as r, createElementBlock as l, normalizeClass as P, normalizeStyle as A, createBlock as R, createCommentVNode as h, createSlots as Re, withCtx as z, renderSlot as G, normalizeProps as B, guardReactiveProps as Y, createVNode as X, createElementVNode as u, Fragment as m, renderList as I, toDisplayString as S, withDirectives as De, vModelCheckbox as We, createTextVNode as He } from "vue";
|
|
15
15
|
import { _ as Ee } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
16
16
|
const Be = J(), Ye = {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ref as v, computed as b, watch as Y, onMounted as pa, onBeforeUnmount as ba, openBlock as S, createElementBlock as se, normalizeStyle as Z, normalizeClass as ma, createBlock as E, createCommentVNode as G, unref as N, createSlots as xa, withCtx as m, renderSlot as k, normalizeProps as V, guardReactiveProps as j, createElementVNode as q, createVNode as La, toDisplayString as Ue, createTextVNode as ka } from "vue";
|
|
2
|
-
import { u as Ca, c as wa, t as Sa, a as $a, p as D, b as za, C as fe, i as J, f as K, I as Ta, d as Ze, _ as Ma, o as Ra, e as Ia, x as Ge, y as Oa, q as Pa, r as Fa, s as Q, l as _a } from "./index-
|
|
2
|
+
import { u as Ca, c as wa, t as Sa, a as $a, p as D, b as za, C as fe, i as J, f as K, I as Ta, d as Ze, _ as Ma, o as Ra, e as Ia, x as Ge, y as Oa, q as Pa, r as Fa, s as Q, l as _a } from "./index-BJNSbAx7.js";
|
|
3
3
|
import { d as Ea, c as Na, a as Ve, t as Da, l as C, r as ye, b as P, p as je, u as Ha } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as Wa } from "./Tooltip-
|
|
5
|
-
import { L as Ya } from "./Legend-
|
|
6
|
-
import { _ as Ba } from "./Title-
|
|
7
|
-
import { S as Xa } from "./Slicer-
|
|
8
|
-
import { u as Aa, U as Ua } from "./usePrinter-
|
|
9
|
-
import Za from "./vue-ui-accordion-
|
|
10
|
-
import { D as Ga } from "./DataTable-
|
|
11
|
-
import Va from "./vue-ui-skeleton-
|
|
12
|
-
import { u as qe } from "./useNestedProp-
|
|
4
|
+
import { _ as Wa } from "./Tooltip-DdWGiVyf.js";
|
|
5
|
+
import { L as Ya } from "./Legend-DnOc-JGW.js";
|
|
6
|
+
import { _ as Ba } from "./Title-0tYDaWv7.js";
|
|
7
|
+
import { S as Xa } from "./Slicer-B7JFT6tT.js";
|
|
8
|
+
import { u as Aa, U as Ua } from "./usePrinter-CkV5eORP.js";
|
|
9
|
+
import Za from "./vue-ui-accordion-DDf5Y2GY.js";
|
|
10
|
+
import { D as Ga } from "./DataTable-BczvA492.js";
|
|
11
|
+
import Va from "./vue-ui-skeleton-CsU74BI7.js";
|
|
12
|
+
import { u as qe } from "./useNestedProp-CLh4tPxT.js";
|
|
13
13
|
import { _ as ja } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const qa = ["id"], Ja = ["onClick"], Ka = {
|
|
15
15
|
key: 2,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),n=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue"),n=require("./index-NvxTr0fZ.cjs"),c=require("./useResponsive-B3TrDDIG.cjs"),Ze=require("./Tooltip-CkqTs_wn.cjs"),Ge=require("./Legend-DDmBZxt8.cjs"),je=require("./Title-Cjusozo5.cjs"),Je=require("./Slicer-IdC3VhM9.cjs"),ze=require("./usePrinter-0s8wVGIy.cjs"),Ke=require("./vue-ui-accordion-CxPjShWo.cjs"),Qe=require("./DataTable-DRJUrEXP.cjs"),et=require("./vue-ui-skeleton-DYHqPo98.cjs"),$e=require("./useNestedProp-DhLxBAwX.cjs"),tt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),at=["id"],lt=["onClick"],ot={key:2,class:"vue-data-ui-watermark"},rt=["innerHTML"],ut={__name:"vue-ui-xy-canvas",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},emits:["selectLegend"],setup(J,{expose:Te,emit:Me}){const P=J,{vue_ui_xy_canvas:Pe}=n.useConfig(),U=a.ref(n.createUid()),D=a.ref(null),C=a.ref(null),N=a.ref(null),i=a.ref(null),g=a.ref(1),z=a.ref(1),_=a.ref(!1),f=a.ref(null),H=a.ref(""),K=a.ref(null),k=a.ref([]),O=a.ref(1),R=a.ref(!0),w=a.ref(!0),X=a.ref(null),Q=a.ref(0),ee=a.ref(0),A=a.ref(!1),te=a.ref(null),ae=a.ref(null),le=a.ref(null),oe=a.ref(0),re=a.ref(0),ue=a.ref(0),Z=a.computed(()=>!!P.dataset&&P.dataset.length),t=a.computed({get:()=>ne(),set:e=>e});function ne(){const e=$e.useNestedProp({userConfig:P.config,defaultConfig:Pe});return e.theme?{...$e.useNestedProp({userConfig:n.themes.vue_ui_xy_canvas[e.theme]||P.config,defaultConfig:e}),customPalette:n.themePalettes[e.theme]||n.palette}:e}a.watch(()=>P.config,e=>{t.value=ne(),pe(),oe.value+=1,re.value+=1,ue.value+=1},{deep:!0});const se=a.ref(t.value.style.chart.aspectRatio),{isPrinting:ie,isImaging:ve,generatePdf:ce,generateImage:de}=ze.usePrinter({elementId:`xy_canvas_${U.value}`,fileName:t.value.style.chart.title.text||"vue-ui-xy-canvas"}),s=a.ref({showTable:t.value.table.show,showDataLabels:t.value.style.chart.dataLabels.show,stacked:t.value.style.chart.stacked,showTooltip:t.value.style.chart.tooltip.show});function Re(e){A.value=e,ee.value+=1}const he=a.computed(()=>n.convertCustomPalette(t.value.customPalette)),$=a.computed(()=>I.value?Math.max(...I.value.filter((e,o)=>!k.value.includes(e.absoluteIndex)).map(e=>e.series.length)):0),l=a.computed(()=>{const e=g.value-g.value*(t.value.style.chart.paddingProportions.left+t.value.style.chart.paddingProportions.right);return{canvasWidth:g.value,canvasHeight:z.value,left:g.value*t.value.style.chart.paddingProportions.left,top:z.value*t.value.style.chart.paddingProportions.top,right:g.value-g.value*t.value.style.chart.paddingProportions.right,bottom:z.value-z.value*t.value.style.chart.paddingProportions.bottom,width:e,height:z.value-z.value*(t.value.style.chart.paddingProportions.top+t.value.style.chart.paddingProportions.bottom),slot:e/(u.value.end-u.value.start)}});function fe(e,o){return e/o}function Oe({hasAutoScale:e,series:o,min:r,max:d,scale:h,yOffset:p,individualHeight:v,stackIndex:m=null}){return o.map((L,j)=>{const S=h.min<0?Math.abs(h.min):0,T=fe(L+S,S+h.max);let M,E;e&&(M=Math.abs(h.min),E=fe(L+M,h.max+M));let B=0;return m===null?B=l.value.bottom-l.value.height*(e?E:T):B=l.value.bottom-p-v*(e?E:T),{x:l.value.left+l.value.slot*j+l.value.slot/2,y:B,value:L}})}const b=a.computed(()=>{const e=Math.min(...I.value.filter((v,m)=>!k.value.includes(v.absoluteIndex)).flatMap(v=>v.series.slice(u.value.start,u.value.end))),o=Math.max(...I.value.filter((v,m)=>!k.value.includes(v.absoluteIndex)).flatMap(v=>v.series.slice(u.value.start,u.value.end))),r=n.calculateNiceScale(e<0?e:0,o===e?e+1<0?0:e+1:o<0?0:o,t.value.style.chart.scale.ticks),d=r.min<0?Math.abs(r.min):0,h=l.value.bottom-l.value.height*(d/(r.max+d)),p=r.ticks.map(v=>({y:l.value.bottom-l.value.height*((v+d)/(r.max+d)),x:l.value.left-8,value:v}));return{absoluteMin:d,max:o,min:e,scale:r,yLabels:p,zero:h}}),Ie=a.computed(()=>y.value.map(e=>`
|
|
2
2
|
<div style="display:flex;flex-direction:row;gap:6px;align-items:center;">
|
|
3
3
|
<svg viewBox="0 0 10 10" height="12" width="12">
|
|
4
4
|
<circle cx="5" cy="5" r="5" fill="${e.color}"/>
|