vue-data-ui 2.3.48 → 2.3.49
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-Zxlib5TA.js → Arrow-Bo8pfwKs.js} +1 -1
- package/dist/{Arrow-DVDUyObR.cjs → Arrow-iqIdxIKZ.cjs} +1 -1
- package/dist/{BaseIcon-B_4EdVx8.js → BaseIcon-BoVYVkUT.js} +1 -1
- package/dist/{BaseIcon-DQUa2wbN.cjs → BaseIcon-DuVD-1qH.cjs} +1 -1
- package/dist/{DataTable-pfsiGYAz.cjs → DataTable-CMF1l-gL.cjs} +1 -1
- package/dist/{DataTable-97z7jeB3.js → DataTable-Dy0vFXS7.js} +2 -2
- package/dist/{Legend-Dc30ZC8U.js → Legend-BbSR193q.js} +1 -1
- package/dist/{Legend-lleMcfy9.cjs → Legend-C3LgyVKP.cjs} +1 -1
- package/dist/{Shape-Cjf9rDFw.js → Shape-B5VTXCQH.js} +1 -1
- package/dist/{Shape-BtSgIgD_.cjs → Shape-BNlNwrBB.cjs} +1 -1
- package/dist/Slicer-CIqhDVuv.cjs +1 -0
- package/dist/{Slicer-dehuss8u.js → Slicer-D62jXLRQ.js} +53 -49
- package/dist/{Title-DZ-9X7T_.js → Title-0px6u9U5.js} +1 -1
- package/dist/{Title-CUtmTGbN.cjs → Title-CSRD5z1r.cjs} +1 -1
- package/dist/{Tooltip-DhxfsNhL.cjs → Tooltip-DFpYO4rz.cjs} +1 -1
- package/dist/{Tooltip-BE1vKyP4.js → Tooltip-TTopnCsK.js} +1 -1
- package/dist/{index-CAkeI2u7.js → index-8Lp8V0TB.js} +2 -1
- package/dist/index-De6Dj52h.cjs +4 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +1 -0
- package/dist/types/vue-data-ui.d.ts +1 -0
- package/dist/{useNestedProp-N72tOTWX.js → useNestedProp-DE-a5lMx.js} +1 -1
- package/dist/{useNestedProp-DM4rgjhE.cjs → useNestedProp-Vjg1xsU_.cjs} +1 -1
- package/dist/{usePrinter-DbJ9I2vE.cjs → usePrinter-SLYneJmG.cjs} +1 -1
- package/dist/{usePrinter-MbSdbzew.js → usePrinter-cCBJ71Cc.js} +1 -1
- package/dist/{vue-data-ui-BQHuRwzO.cjs → vue-data-ui-B1ngLIqD.cjs} +1 -1
- package/dist/{vue-data-ui-BtPs_riR.js → vue-data-ui-pmpX1nQY.js} +57 -57
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-DXIhL0TF.cjs → vue-ui-3d-bar-8yOSr9F5.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-CLfyDLPQ.js → vue-ui-3d-bar-DcoFVkRG.js} +7 -7
- package/dist/{vue-ui-accordion-BbsnFhS8.js → vue-ui-accordion-BQfLl7n5.js} +3 -3
- package/dist/{vue-ui-accordion-Bs0EHuxc.cjs → vue-ui-accordion-CiSEQOBc.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-DpsPcpxc.cjs → vue-ui-age-pyramid-BRr6sDTU.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-B4ZZuW-3.js → vue-ui-age-pyramid-Cyzoxsd_.js} +8 -8
- package/dist/{vue-ui-annotator-B6tm7G-3.cjs → vue-ui-annotator-60JYTNTN.cjs} +1 -1
- package/dist/{vue-ui-annotator-BhE_ZF6c.js → vue-ui-annotator-DkkEj4IE.js} +1 -1
- package/dist/{vue-ui-candlestick-C4uPOJHQ.js → vue-ui-candlestick-CDLGf1AM.js} +9 -9
- package/dist/{vue-ui-candlestick-DWF0o42E.cjs → vue-ui-candlestick-D7IRuRY-.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-CuK3NH57.js → vue-ui-carousel-table-CGqR-L66.js} +4 -4
- package/dist/{vue-ui-carousel-table-BOx_7UQr.cjs → vue-ui-carousel-table-dITvFJuB.cjs} +1 -1
- package/dist/{vue-ui-chestnut-C7w4B_ur.js → vue-ui-chestnut-BGLp2adQ.js} +6 -6
- package/dist/{vue-ui-chestnut-wEen0cKE.cjs → vue-ui-chestnut-x6ysM7Re.cjs} +1 -1
- package/dist/{vue-ui-cursor-Yv8kl6qP.cjs → vue-ui-cursor-C5gPJbwq.cjs} +1 -1
- package/dist/{vue-ui-cursor-Ctgm3n3f.js → vue-ui-cursor-X_1-s3ik.js} +2 -2
- package/dist/{vue-ui-dashboard-DPpvlOhB.cjs → vue-ui-dashboard-Cgtk8oJP.cjs} +1 -1
- package/dist/{vue-ui-dashboard-2lnPhwSk.js → vue-ui-dashboard-zfHS3YDI.js} +2 -2
- package/dist/{vue-ui-digits-BaQVgAB3.js → vue-ui-digits-C6o6diGb.js} +2 -2
- package/dist/{vue-ui-digits-CDsLYZQx.cjs → vue-ui-digits-DJL1XNX-.cjs} +1 -1
- package/dist/{vue-ui-donut-BJvvOCw4.cjs → vue-ui-donut-BwdyNBGR.cjs} +1 -1
- package/dist/{vue-ui-donut-Bkhnx2Na.js → vue-ui-donut-Do84LyRn.js} +9 -9
- package/dist/{vue-ui-donut-evolution-R7XCcHKT.cjs → vue-ui-donut-evolution-CIjVTIAJ.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-ASmhsxgl.js → vue-ui-donut-evolution-DQnRpcIw.js} +9 -9
- package/dist/{vue-ui-dumbbell-Bnx1whQL.js → vue-ui-dumbbell-B71pIx5Z.js} +8 -8
- package/dist/{vue-ui-dumbbell-DOf__qbw.cjs → vue-ui-dumbbell-D_Bvl_1q.cjs} +1 -1
- package/dist/{vue-ui-flow-Cpt4rGww.js → vue-ui-flow-BFXzVNCo.js} +7 -7
- package/dist/{vue-ui-flow-DESqaa_D.cjs → vue-ui-flow-DpFcTi7P.cjs} +1 -1
- package/dist/{vue-ui-galaxy-lyWd6uQ2.cjs → vue-ui-galaxy-CI546a3O.cjs} +1 -1
- package/dist/{vue-ui-galaxy-yll2l5no.js → vue-ui-galaxy-DC0LoWFu.js} +9 -9
- package/dist/{vue-ui-gauge-_imuFpna.cjs → vue-ui-gauge-COVSZG36.cjs} +1 -1
- package/dist/{vue-ui-gauge-DvErHglc.js → vue-ui-gauge-Chz7KDBu.js} +5 -5
- package/dist/{vue-ui-gizmo-BoTTd12O.cjs → vue-ui-gizmo-DuSQv_6q.cjs} +1 -1
- package/dist/{vue-ui-gizmo-CcJZ1BaJ.js → vue-ui-gizmo-ydAuESKo.js} +2 -2
- package/dist/{vue-ui-heatmap-DJ1FMowz.js → vue-ui-heatmap-Ba_jzJB2.js} +8 -8
- package/dist/{vue-ui-heatmap-BfVdowyK.cjs → vue-ui-heatmap-CdpBaTry.cjs} +1 -1
- package/dist/{vue-ui-kpi-tyv7wQWA.js → vue-ui-kpi-C5yFYQ19.js} +3 -3
- package/dist/{vue-ui-kpi-BtOxRhb1.cjs → vue-ui-kpi-D2TypVZG.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-BZSFz3n8.js → vue-ui-mini-loader-BD6Lu94h.js} +2 -2
- package/dist/{vue-ui-mini-loader-DAp6v1OO.cjs → vue-ui-mini-loader-DJXMipP5.cjs} +1 -1
- package/dist/{vue-ui-molecule-DRC62I9B.cjs → vue-ui-molecule-DCCCC-6a.cjs} +1 -1
- package/dist/{vue-ui-molecule-B_IidHvj.js → vue-ui-molecule-DCsLwmnF.js} +9 -9
- package/dist/{vue-ui-mood-radar-DTVywXlL.cjs → vue-ui-mood-radar-CX6Gq6UB.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-BdYscbyC.js → vue-ui-mood-radar-D-FUCHS-.js} +9 -9
- package/dist/{vue-ui-nested-donuts-Bw0Iifx1.js → vue-ui-nested-donuts-CgRfdcJy.js} +9 -9
- package/dist/{vue-ui-nested-donuts-EPd_poHo.cjs → vue-ui-nested-donuts-DWuCVtg8.cjs} +1 -1
- package/dist/{vue-ui-onion-B9wG-dIS.js → vue-ui-onion-BWo7GrFe.js} +9 -9
- package/dist/{vue-ui-onion-4ULM84d3.cjs → vue-ui-onion-Dg-7GylY.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-5T4gwxht.js → vue-ui-parallel-coordinate-plot-DSUZL2Sy.js} +10 -10
- package/dist/{vue-ui-parallel-coordinate-plot-BUfuDzc3.cjs → vue-ui-parallel-coordinate-plot-prF4TxQD.cjs} +1 -1
- package/dist/{vue-ui-quadrant-Dr5JjCka.cjs → vue-ui-quadrant-Ct06vgiw.cjs} +1 -1
- package/dist/{vue-ui-quadrant-C8Gob7gq.js → vue-ui-quadrant-DYApa1bj.js} +10 -10
- package/dist/{vue-ui-quick-chart-8GGtO2tf.cjs → vue-ui-quick-chart-CwIWb_LQ.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-CFHyJ7rZ.js → vue-ui-quick-chart-DOHmWoHL.js} +6 -6
- package/dist/{vue-ui-radar-Dy5kHYce.cjs → vue-ui-radar-BJ23WOh7.cjs} +1 -1
- package/dist/{vue-ui-radar-Cr1Mb9Bx.js → vue-ui-radar-C4SFHmfz.js} +10 -10
- package/dist/{vue-ui-rating-ClL1a6MY.js → vue-ui-rating-BSFASHFc.js} +2 -2
- package/dist/{vue-ui-rating-BDKvG8bm.cjs → vue-ui-rating-BsRGR-VS.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-Cq__UW9k.cjs → vue-ui-relation-circle-CEzXa3yt.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-oVSySfff.js → vue-ui-relation-circle-Dg-99k9k.js} +5 -5
- package/dist/{vue-ui-rings-B7381qCZ.js → vue-ui-rings-CCcc9cFR.js} +9 -9
- package/dist/{vue-ui-rings-C8g7Xj86.cjs → vue-ui-rings-DiQhsWx_.cjs} +1 -1
- package/dist/{vue-ui-scatter-Bh2Mjbi3.js → vue-ui-scatter-BgsexKX4.js} +10 -10
- package/dist/{vue-ui-scatter-D_DPdRoK.cjs → vue-ui-scatter-D7z4c6k-.cjs} +1 -1
- package/dist/{vue-ui-screenshot-D46q2vBL.cjs → vue-ui-screenshot-Bj85MdEJ.cjs} +1 -1
- package/dist/{vue-ui-screenshot-Bl86uY0k.js → vue-ui-screenshot-viGaG1cU.js} +1 -1
- package/dist/{vue-ui-skeleton-CHI4nqtV.cjs → vue-ui-skeleton-Cl9Kp9yE.cjs} +1 -1
- package/dist/{vue-ui-skeleton-DtWvFTM9.js → vue-ui-skeleton-apODtH32.js} +2 -2
- package/dist/{vue-ui-smiley-BCsFzW-q.js → vue-ui-smiley-BUDu21nW.js} +2 -2
- package/dist/{vue-ui-smiley-CvpjObu1.cjs → vue-ui-smiley-CfDLeydH.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-Cb1unGKY.js → vue-ui-spark-trend-B1bpQlNI.js} +4 -4
- package/dist/{vue-ui-spark-trend-BGEFwDpP.cjs → vue-ui-spark-trend-ZS_m-z6R.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-K6DV0yr0.cjs → vue-ui-sparkbar-C8fgdM5i.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-2-EGfoOE.js → vue-ui-sparkbar-CpwYwA2h.js} +3 -3
- package/dist/{vue-ui-sparkgauge-0uv6HhvN.cjs → vue-ui-sparkgauge-CGy4jbtz.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-DdQDS2KM.js → vue-ui-sparkgauge-DpDoOc6V.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-DV6-Hmhz.cjs → vue-ui-sparkhistogram-CX35Cfkc.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-CQOY13sM.js → vue-ui-sparkhistogram-CcEB0gwD.js} +4 -4
- package/dist/{vue-ui-sparkline-Cnu3UnAn.js → vue-ui-sparkline-Bk4kWGco.js} +3 -3
- package/dist/{vue-ui-sparkline-oYEzsMF2.cjs → vue-ui-sparkline-CdPAtBR8.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-vJoAUAZJ.cjs → vue-ui-sparkstackbar-6xwj9rme.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-CoHqnRmF.js → vue-ui-sparkstackbar-B7Pvvmo_.js} +3 -3
- package/dist/{vue-ui-stackbar-BKiUGEDc.cjs → vue-ui-stackbar-7xZmgZo4.cjs} +1 -1
- package/dist/{vue-ui-stackbar-BGNfdn6K.js → vue-ui-stackbar-BMhowvyb.js} +10 -10
- package/dist/{vue-ui-strip-plot-CPXr1Unl.js → vue-ui-strip-plot-CnLnX_zO.js} +9 -9
- package/dist/{vue-ui-strip-plot-DTvz7qPm.cjs → vue-ui-strip-plot-DOXU1HhU.cjs} +1 -1
- package/dist/{vue-ui-table-BkY3KOTh.js → vue-ui-table-CoIUKpaM.js} +1 -1
- package/dist/{vue-ui-table-XywHpa9F.cjs → vue-ui-table-Ly0OlueB.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-Ft_4H5TG.js → vue-ui-table-heatmap-CtVr--3k.js} +4 -4
- package/dist/{vue-ui-table-heatmap-CiRaCqLh.cjs → vue-ui-table-heatmap-cLUGY_I8.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-CXD6RQwT.js → vue-ui-table-sparkline-Ct4n3vjB.js} +5 -5
- package/dist/{vue-ui-table-sparkline-c_fn53DV.cjs → vue-ui-table-sparkline-i_FQjHJt.cjs} +1 -1
- package/dist/{vue-ui-thermometer-DPv-QZyR.js → vue-ui-thermometer-CELrItTb.js} +5 -5
- package/dist/{vue-ui-thermometer-Cm-phIMA.cjs → vue-ui-thermometer-vrEGhPDN.cjs} +1 -1
- package/dist/{vue-ui-timer-B_e8jeFu.js → vue-ui-timer-BKhOVqdo.js} +4 -4
- package/dist/{vue-ui-timer-B-1okA9J.cjs → vue-ui-timer-C5oaCNfC.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-n429npvo.cjs → vue-ui-tiremarks-CSbL6U73.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-BTx3UPF6.js → vue-ui-tiremarks-p6l5H8Xo.js} +5 -5
- package/dist/{vue-ui-treemap-C6dlrtc-.cjs → vue-ui-treemap-BwegaYVE.cjs} +1 -1
- package/dist/{vue-ui-treemap-Df7c03TV.js → vue-ui-treemap-C4DTISo2.js} +9 -9
- package/dist/{vue-ui-vertical-bar-D04Qa1Ve.cjs → vue-ui-vertical-bar-B3GbC7E_.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-bipz8aIc.js → vue-ui-vertical-bar-C8dwl1ez.js} +9 -9
- package/dist/{vue-ui-waffle-Dc-Drk3w.js → vue-ui-waffle-BjXgV05U.js} +9 -9
- package/dist/{vue-ui-waffle-1JK9OthJ.cjs → vue-ui-waffle-DfhoqEtv.cjs} +1 -1
- package/dist/{vue-ui-wheel-CTD6Bxrd.js → vue-ui-wheel-BpGLo5wJ.js} +5 -5
- package/dist/{vue-ui-wheel-w2xLqgyW.cjs → vue-ui-wheel-CtUEp9En.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-DxIS-nBr.cjs → vue-ui-word-cloud-BSmOL5UE.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-DO8E-MmK.js → vue-ui-word-cloud-DNBF-X9H.js} +7 -7
- package/dist/{vue-ui-xy-y3ThqwCN.cjs → vue-ui-xy-ClD6S1Ok.cjs} +2 -2
- package/dist/{vue-ui-xy-CM5MM7qx.js → vue-ui-xy-W_Zawlkz.js} +137 -136
- package/dist/{vue-ui-xy-canvas-Dg1-pLp8.cjs → vue-ui-xy-canvas-BZTwibcy.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-Any2UpuS.js → vue-ui-xy-canvas-DELc-ZEx.js} +10 -10
- package/package.json +1 -1
- package/dist/Slicer-CanBZJ4V.cjs +0 -1
- package/dist/index-DGxA8bUJ.cjs +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-DGxA8bUJ.cjs"),pe=require("./useNestedProp-DM4rgjhE.cjs"),ke=require("./useResponsive-B3TrDDIG.cjs"),xe=require("./usePrinter-DbJ9I2vE.cjs"),De=require("./Slicer-CanBZJ4V.cjs"),Ie=require("./Tooltip-DhxfsNhL.cjs"),Ae=require("./Title-CUtmTGbN.cjs"),He=require("./Legend-lleMcfy9.cjs"),qe=require("./vue-ui-accordion-Bs0EHuxc.cjs"),We=require("./DataTable-pfsiGYAz.cjs"),Ue=require("./vue-ui-skeleton-CHI4nqtV.cjs"),Xe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ye=["id"],Ge=["xmlns","viewBox"],Je={key:0},Ze=["id"],Ke=["stop-color"],Qe=["stop-color"],je=["stop-color"],et=["x1","x2","y1","y2","stroke"],tt=["x1","x2","y1","y2","stroke"],at=["x1","x2","y1","y2","stroke"],lt=["x1","x2","y1","y2","stroke"],ot=["x","y","height","rx","width","fill","stroke","stroke-width"],rt=["x","y","width","rx","height","fill","stroke","stroke-width"],st=["x1","x2","y1","y2","stroke","stroke-width"],nt=["x1","x2","y1","y2","stroke","stroke-width"],it=["x","y","font-size","fill","font-weight"],ut=["transform","font-size","fill","font-weight"],ct=["x","y","font-size","fill","font-weight"],dt={key:0},vt=["x","y","font-size","font-weight","fill"],ht=["x","y","font-size","fill","font-weight"],gt={key:0},yt=["x","y","font-size","font-weight","fill"],mt=["x1","x2","y1","y2","stroke"],bt=["x","y","font-size","font-weight","fill"],ft=["x1","x2","y1","y2","stroke"],pt=["font-size","font-weight","fill","text-anchor","transform"],kt=["text-anchor","font-size","font-weight","fill","transform"],xt=["font-size","font-weight","fill","x","y"],wt=["x","y","width","height","onClick","onMouseenter","fill"],Ct=["x","y","width","height","onClick","onMouseenter","fill"],Bt={key:3,class:"vue-data-ui-watermark"},Lt=["onClick"],St=["innerHTML"],zt={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(Y,{expose:we,emit:G}){const y=Y,{vue_ui_stackbar:Ce}=c.useConfig(),E=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),M=e.ref(null),W=e.ref(c.createUid()),O=e.ref(!1),J=e.ref(null),U=e.ref(""),f=e.ref([]),Z=e.ref(0),K=e.ref(null),Q=e.ref(null),j=e.ref(null),ee=e.ref(0),X=e.ref(!1),$=e.ref(null),T=e.ref(!1);e.onMounted(()=>{c.objectIsEmpty(y.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):y.dataset.forEach((l,r)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{E.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{T.value=!0},10)});const t=e.computed(()=>{const l=pe.useNestedProp({userConfig:y.config,defaultConfig:Ce});let r={};return l.theme?r={...pe.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||y.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:r=l,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=y.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=y.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,r}),b=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:te,isImaging:ae,generatePdf:le,generateImage:oe}=xe.usePrinter({elementId:`stackbar_${W.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),D=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),Be=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),re=e.ref(null),se=e.ref(null);e.onMounted(()=>{if(t.value.responsive){const l=ke.throttle(()=>{T.value=!1;const{width:r,height:a}=ke.useResponsive({chart:M.value,title:t.value.style.chart.title.text?K.value:null,legend:t.value.style.chart.legend.show?Q.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?j.value:null});D.value.width=r,D.value.height=a,clearTimeout(se.value),se.value=setTimeout(()=>{T.value=!0},10)});re.value=new ResizeObserver(l),re.value.observe(M.value.parentNode)}});const s=e.computed(()=>{const{height:l,width:r}=D.value,{right:a}=D.value.paddingRatio,o=t.value.style.chart.padding.top,n=r-r*a,i=l-t.value.style.chart.padding.bottom,m=t.value.style.chart.padding.left,S=r-m-r*a,z=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:n,bottom:i,left:m,width:S,height:z<0?0:z}}),B=e.computed(()=>y.dataset.map((l,r)=>{const a=c.convertColorToHex(l.color)||Be.value[r]||c.palette[r]||c.palette[r%c.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:c.createUid(),color:a}})),L=e.computed(()=>Math.max(...B.value.filter(l=>!f.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...y.dataset.map(l=>l.series.length))});function Le(){u.value={start:0,end:Math.max(...y.dataset.map(l=>l.series.length))},ee.value+=1}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),V=e.computed(()=>c.sumSeries(B.value.filter(l=>!f.value.includes(l.id))).slice(u.value.start,u.value.end)),Se=e.computed(()=>c.sumSeries(B.value.filter(l=>!f.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(u.value.start,u.value.end)),I=e.computed(()=>{const l=B.value.filter(r=>!f.value.includes(r.id));return{positive:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...I.value.positive),r=Math.min(...I.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:n}))}),F=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)),g=e.computed(()=>{if(!E.value)return[];let l=Array(L.value).fill(0),r=Array(L.value).fill(0),a=Array(L.value).fill(0),o=Array(L.value).fill(0);const n=Math.max(...I.value.positive)||0,i=Math.min(...I.value.negative),m=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,S=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:z,max:P}=S,_=P+(z>=0?0:Math.abs(z))||1,p=s.value.height,q=s.value.width,be=w.value[0]?w.value[0].zero:s.value.bottom,fe=w.value[0]?w.value[0].horizontal_zero:s.value.left;return B.value.filter(R=>!f.value.includes(R.id)).map(R=>{const C=R.series.slice(u.value.start,u.value.end),Me=R.signedSeries.slice(u.value.start,u.value.end),$e=C.map((v,h)=>s.value.left+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Te=C.map((v,h)=>s.value.top+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Ve=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=p*k,N=be-x-l[h],l[h]+=x):(x=p*k,N=be+a[h],a[h]+=Math.abs(x)),N}),Fe=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=q*k,N=fe+r[h],r[h]+=x):(x=q*k,N=fe-Math.abs(x)-o[h],o[h]+=Math.abs(x)),N}),Pe=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?p*k:p*Math.abs(k)}),Re=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?q*k:q*Math.abs(k)}),Oe=C.map(v=>Math.abs(v)).reduce((v,h)=>v+h,0);return{...R,proportions:C.map((v,h)=>t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/Oe),series:C,signedSeries:Me,x:$e,y:Ve,height:Pe,horizontal_width:Re,horizontal_y:Te,horizontal_x:Fe}})}),ne=e.computed(()=>Se.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function A(l,r,a,o,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ie(l,r,a,o){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ue(l){const r=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));G("selectDatapoint",{datapoint:r,period:F.value[l]})}function ce(l){$.value=l,O.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),o=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))U.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:m,roundingValue:S,roundingPercentage:z}=t.value.style.chart.tooltip;let P="";F.value[l]&&(P+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${m};padding-bottom:6px;margin-bottom:3px;">${F.value[l]}</div>`);const _=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(p=>{P+=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-De6Dj52h.cjs"),pe=require("./useNestedProp-Vjg1xsU_.cjs"),ke=require("./useResponsive-B3TrDDIG.cjs"),xe=require("./usePrinter-SLYneJmG.cjs"),De=require("./Slicer-CIqhDVuv.cjs"),Ie=require("./Tooltip-DFpYO4rz.cjs"),Ae=require("./Title-CSRD5z1r.cjs"),He=require("./Legend-C3LgyVKP.cjs"),qe=require("./vue-ui-accordion-CiSEQOBc.cjs"),We=require("./DataTable-CMF1l-gL.cjs"),Ue=require("./vue-ui-skeleton-Cl9Kp9yE.cjs"),Xe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ye=["id"],Ge=["xmlns","viewBox"],Je={key:0},Ze=["id"],Ke=["stop-color"],Qe=["stop-color"],je=["stop-color"],et=["x1","x2","y1","y2","stroke"],tt=["x1","x2","y1","y2","stroke"],at=["x1","x2","y1","y2","stroke"],lt=["x1","x2","y1","y2","stroke"],ot=["x","y","height","rx","width","fill","stroke","stroke-width"],rt=["x","y","width","rx","height","fill","stroke","stroke-width"],st=["x1","x2","y1","y2","stroke","stroke-width"],nt=["x1","x2","y1","y2","stroke","stroke-width"],it=["x","y","font-size","fill","font-weight"],ut=["transform","font-size","fill","font-weight"],ct=["x","y","font-size","fill","font-weight"],dt={key:0},vt=["x","y","font-size","font-weight","fill"],ht=["x","y","font-size","fill","font-weight"],gt={key:0},yt=["x","y","font-size","font-weight","fill"],mt=["x1","x2","y1","y2","stroke"],bt=["x","y","font-size","font-weight","fill"],ft=["x1","x2","y1","y2","stroke"],pt=["font-size","font-weight","fill","text-anchor","transform"],kt=["text-anchor","font-size","font-weight","fill","transform"],xt=["font-size","font-weight","fill","x","y"],wt=["x","y","width","height","onClick","onMouseenter","fill"],Ct=["x","y","width","height","onClick","onMouseenter","fill"],Bt={key:3,class:"vue-data-ui-watermark"},Lt=["onClick"],St=["innerHTML"],zt={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(Y,{expose:we,emit:G}){const y=Y,{vue_ui_stackbar:Ce}=c.useConfig(),E=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),M=e.ref(null),W=e.ref(c.createUid()),O=e.ref(!1),J=e.ref(null),U=e.ref(""),f=e.ref([]),Z=e.ref(0),K=e.ref(null),Q=e.ref(null),j=e.ref(null),ee=e.ref(0),X=e.ref(!1),$=e.ref(null),T=e.ref(!1);e.onMounted(()=>{c.objectIsEmpty(y.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):y.dataset.forEach((l,r)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{E.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{T.value=!0},10)});const t=e.computed(()=>{const l=pe.useNestedProp({userConfig:y.config,defaultConfig:Ce});let r={};return l.theme?r={...pe.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||y.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:r=l,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=y.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=y.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,r}),b=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:te,isImaging:ae,generatePdf:le,generateImage:oe}=xe.usePrinter({elementId:`stackbar_${W.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),D=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),Be=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),re=e.ref(null),se=e.ref(null);e.onMounted(()=>{if(t.value.responsive){const l=ke.throttle(()=>{T.value=!1;const{width:r,height:a}=ke.useResponsive({chart:M.value,title:t.value.style.chart.title.text?K.value:null,legend:t.value.style.chart.legend.show?Q.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?j.value:null});D.value.width=r,D.value.height=a,clearTimeout(se.value),se.value=setTimeout(()=>{T.value=!0},10)});re.value=new ResizeObserver(l),re.value.observe(M.value.parentNode)}});const s=e.computed(()=>{const{height:l,width:r}=D.value,{right:a}=D.value.paddingRatio,o=t.value.style.chart.padding.top,n=r-r*a,i=l-t.value.style.chart.padding.bottom,m=t.value.style.chart.padding.left,S=r-m-r*a,z=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:n,bottom:i,left:m,width:S,height:z<0?0:z}}),B=e.computed(()=>y.dataset.map((l,r)=>{const a=c.convertColorToHex(l.color)||Be.value[r]||c.palette[r]||c.palette[r%c.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:c.createUid(),color:a}})),L=e.computed(()=>Math.max(...B.value.filter(l=>!f.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...y.dataset.map(l=>l.series.length))});function Le(){u.value={start:0,end:Math.max(...y.dataset.map(l=>l.series.length))},ee.value+=1}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),V=e.computed(()=>c.sumSeries(B.value.filter(l=>!f.value.includes(l.id))).slice(u.value.start,u.value.end)),Se=e.computed(()=>c.sumSeries(B.value.filter(l=>!f.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(u.value.start,u.value.end)),I=e.computed(()=>{const l=B.value.filter(r=>!f.value.includes(r.id));return{positive:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...I.value.positive),r=Math.min(...I.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:n}))}),F=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)),g=e.computed(()=>{if(!E.value)return[];let l=Array(L.value).fill(0),r=Array(L.value).fill(0),a=Array(L.value).fill(0),o=Array(L.value).fill(0);const n=Math.max(...I.value.positive)||0,i=Math.min(...I.value.negative),m=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,S=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:z,max:P}=S,_=P+(z>=0?0:Math.abs(z))||1,p=s.value.height,q=s.value.width,be=w.value[0]?w.value[0].zero:s.value.bottom,fe=w.value[0]?w.value[0].horizontal_zero:s.value.left;return B.value.filter(R=>!f.value.includes(R.id)).map(R=>{const C=R.series.slice(u.value.start,u.value.end),Me=R.signedSeries.slice(u.value.start,u.value.end),$e=C.map((v,h)=>s.value.left+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Te=C.map((v,h)=>s.value.top+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Ve=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=p*k,N=be-x-l[h],l[h]+=x):(x=p*k,N=be+a[h],a[h]+=Math.abs(x)),N}),Fe=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=q*k,N=fe+r[h],r[h]+=x):(x=q*k,N=fe-Math.abs(x)-o[h],o[h]+=Math.abs(x)),N}),Pe=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?p*k:p*Math.abs(k)}),Re=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?q*k:q*Math.abs(k)}),Oe=C.map(v=>Math.abs(v)).reduce((v,h)=>v+h,0);return{...R,proportions:C.map((v,h)=>t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/Oe),series:C,signedSeries:Me,x:$e,y:Ve,height:Pe,horizontal_width:Re,horizontal_y:Te,horizontal_x:Fe}})}),ne=e.computed(()=>Se.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function A(l,r,a,o,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ie(l,r,a,o){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ue(l){const r=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));G("selectDatapoint",{datapoint:r,period:F.value[l]})}function ce(l){$.value=l,O.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),o=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))U.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:m,roundingValue:S,roundingPercentage:z}=t.value.style.chart.tooltip;let P="";F.value[l]&&(P+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${m};padding-bottom:6px;margin-bottom:3px;">${F.value[l]}</div>`);const _=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(p=>{P+=`
|
|
2
2
|
<div style="display:flex;flex-direction:row;align-items:center;gap:4px">
|
|
3
3
|
<svg viewBox="0 0 12 12" height="14" width="14"><rect rx="1" x="0" y="0" height="12" width="12" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${p.id})`:p.color}"/></svg>
|
|
4
4
|
${p.name}${n||i?":":""} ${n?c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:p.value,s:t.value.style.chart.bars.dataLabels.suffix,r:S}):""} ${_[0]}${i?c.dataLabel({v:isNaN(p.value/o)?0:Math.abs(p.value)/o*100,s:"%",r:z}):""}${_[1]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as p, ref as f, onMounted as Ae, openBlock as s, createElementBlock as u, normalizeClass as ce, normalizeStyle as K, renderSlot as _, createVNode as ve, createCommentVNode as v, createBlock as Q, unref as x, createSlots as ht, withCtx as z, normalizeProps as B, guardReactiveProps as W, Fragment as h, renderList as b, createElementVNode as D, toDisplayString as S, createTextVNode as dt } from "vue";
|
|
2
|
-
import { u as yt, c as De, o as gt, e as Ee, g as bt, t as ft, a as mt, p as oe, _ as He, b as pt, d as xt, a0 as se, V as Be, A as We, X as kt, l as wt, D as Xe, f as E, v as Ue, w as Ye, i as Ge, x as Ct, q as _t, r as zt } from "./index-
|
|
3
|
-
import { u as Je } from "./useNestedProp-
|
|
2
|
+
import { u as yt, c as De, o as gt, e as Ee, g as bt, t as ft, a as mt, p as oe, _ as He, b as pt, d as xt, a0 as se, V as Be, A as We, X as kt, l as wt, D as Xe, f as E, v as Ue, w as Ye, i as Ge, x as Ct, q as _t, r as zt } from "./index-8Lp8V0TB.js";
|
|
3
|
+
import { u as Je } from "./useNestedProp-DE-a5lMx.js";
|
|
4
4
|
import { t as Lt, u as St } from "./useResponsive-NZB-WLRF.js";
|
|
5
|
-
import { u as $t, U as Mt } from "./usePrinter-
|
|
6
|
-
import { S as Tt } from "./Slicer-
|
|
7
|
-
import { _ as Nt } from "./Tooltip-
|
|
8
|
-
import { _ as Ot } from "./Title-
|
|
9
|
-
import { L as Pt } from "./Legend-
|
|
10
|
-
import Rt from "./vue-ui-accordion-
|
|
11
|
-
import { D as It } from "./DataTable-
|
|
12
|
-
import Vt from "./vue-ui-skeleton-
|
|
5
|
+
import { u as $t, U as Mt } from "./usePrinter-cCBJ71Cc.js";
|
|
6
|
+
import { S as Tt } from "./Slicer-D62jXLRQ.js";
|
|
7
|
+
import { _ as Nt } from "./Tooltip-TTopnCsK.js";
|
|
8
|
+
import { _ as Ot } from "./Title-0px6u9U5.js";
|
|
9
|
+
import { L as Pt } from "./Legend-BbSR193q.js";
|
|
10
|
+
import Rt from "./vue-ui-accordion-BQfLl7n5.js";
|
|
11
|
+
import { D as It } from "./DataTable-Dy0vFXS7.js";
|
|
12
|
+
import Vt from "./vue-ui-skeleton-apODtH32.js";
|
|
13
13
|
import { _ as Ft } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const At = ["id"], Dt = ["xmlns", "viewBox"], Et = { key: 0 }, Ht = ["id"], Bt = ["stop-color"], Wt = ["stop-color"], Xt = ["stop-color"], Ut = ["x1", "x2", "y1", "y2", "stroke"], Yt = ["x1", "x2", "y1", "y2", "stroke"], Gt = ["x1", "x2", "y1", "y2", "stroke"], Jt = ["x1", "x2", "y1", "y2", "stroke"], qt = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], Zt = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], Kt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Qt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], jt = ["x", "y", "font-size", "fill", "font-weight"], ea = ["transform", "font-size", "fill", "font-weight"], ta = ["x", "y", "font-size", "fill", "font-weight"], aa = { key: 0 }, la = ["x", "y", "font-size", "font-weight", "fill"], ra = ["x", "y", "font-size", "fill", "font-weight"], oa = { key: 0 }, sa = ["x", "y", "font-size", "font-weight", "fill"], ia = ["x1", "x2", "y1", "y2", "stroke"], ua = ["x", "y", "font-size", "font-weight", "fill"], na = ["x1", "x2", "y1", "y2", "stroke"], ca = ["font-size", "font-weight", "fill", "text-anchor", "transform"], va = ["text-anchor", "font-size", "font-weight", "fill", "transform"], ha = ["font-size", "font-weight", "fill", "x", "y"], da = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], ya = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], ga = {
|
|
15
15
|
key: 3,
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { computed as p, ref as c, onMounted as Le, onBeforeUnmount as Pe, openBlock as r, createElementBlock as i, normalizeClass as O, normalizeStyle as V, createVNode as K, createCommentVNode as v, createBlock as H, unref as h, createSlots as Se, withCtx as f, renderSlot as m, normalizeProps as R, guardReactiveProps as U, Fragment as g, renderList as C, createElementVNode as x, toDisplayString as T, mergeProps as ze, createTextVNode as Ae, nextTick as Ne } from "vue";
|
|
2
|
-
import { u as Oe, c as Q, t as Fe, a as We, p as L, o as Ie, e as Z, g as pe, b as Me, d as ye, A as De, f as B, X as Ge, i as ee, l as Ee, h as Ve, w as fe, x as He, q as Re, r as Ue, C as Be } from "./index-
|
|
2
|
+
import { u as Oe, c as Q, t as Fe, a as We, p as L, o as Ie, e as Z, g as pe, b as Me, d as ye, A as De, f as B, X as Ge, i as ee, l as Ee, h as Ve, w as fe, x as He, q as Re, r as Ue, C as Be } from "./index-8Lp8V0TB.js";
|
|
3
3
|
import { t as Xe, u as je } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as Ye } from "./Title-
|
|
5
|
-
import { u as Je, U as qe } from "./usePrinter-
|
|
6
|
-
import { _ as Ke } from "./Tooltip-
|
|
7
|
-
import { D as Qe } from "./DataTable-
|
|
8
|
-
import Ze from "./vue-ui-skeleton-
|
|
9
|
-
import { _ as et } from "./Shape-
|
|
10
|
-
import tt from "./vue-ui-accordion-
|
|
11
|
-
import { u as be } from "./useNestedProp-
|
|
4
|
+
import { _ as Ye } from "./Title-0px6u9U5.js";
|
|
5
|
+
import { u as Je, U as qe } from "./usePrinter-cCBJ71Cc.js";
|
|
6
|
+
import { _ as Ke } from "./Tooltip-TTopnCsK.js";
|
|
7
|
+
import { D as Qe } from "./DataTable-Dy0vFXS7.js";
|
|
8
|
+
import Ze from "./vue-ui-skeleton-apODtH32.js";
|
|
9
|
+
import { _ as et } from "./Shape-B5VTXCQH.js";
|
|
10
|
+
import tt from "./vue-ui-accordion-BQfLl7n5.js";
|
|
11
|
+
import { u as be } from "./useNestedProp-DE-a5lMx.js";
|
|
12
12
|
import { _ as lt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const at = ["id"], ot = ["xmlns", "viewBox"], st = { key: 0 }, rt = { key: 0 }, ut = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], it = { key: 1 }, nt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], ct = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], vt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ht = ["x", "y", "fill", "font-size"], dt = ["x", "y", "font-size", "fill"], pt = ["fill", "font-size", "transform"], yt = ["fill", "font-size", "x", "y"], ft = ["x1", "x2", "y1", "y2", "stroke"], bt = ["cx", "cy", "fill"], mt = ["cx", "cy", "fill"], gt = ["id"], xt = ["stop-color"], kt = ["stop-color"], Ct = ["stop-color"], wt = { key: 0 }, _t = ["x", "y", "font-size", "fill"], $t = {
|
|
14
14
|
key: 3,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-DGxA8bUJ.cjs"),j=require("./useResponsive-B3TrDDIG.cjs"),re=require("./Title-CUtmTGbN.cjs"),X=require("./usePrinter-DbJ9I2vE.cjs"),se=require("./Tooltip-DhxfsNhL.cjs"),ne=require("./DataTable-pfsiGYAz.cjs"),ue=require("./vue-ui-skeleton-CHI4nqtV.cjs"),ie=require("./Shape-BtSgIgD_.cjs"),ce=require("./vue-ui-accordion-Bs0EHuxc.cjs"),Y=require("./useNestedProp-DM4rgjhE.cjs"),ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),de=["id"],he=["xmlns","viewBox"],pe={key:0},me={key:0},ye=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],fe={key:1},be=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ge=["x1","x2","y1","y2","stroke","stroke-width"],ke=["x1","x2","y1","y2","stroke","stroke-width"],xe=["x","y","fill","font-size"],Ce=["x","y","font-size","fill"],we=["fill","font-size","transform"],Be=["fill","font-size","x","y"],_e=["x1","x2","y1","y2","stroke"],$e=["cx","cy","fill"],Ne=["cx","cy","fill"],Se=["id"],Le=["stop-color"],Te=["stop-color"],Pe=["stop-color"],Ee={key:0},ze=["x","y","font-size","fill"],Ve={key:3,class:"vue-data-ui-watermark"},Ae=["innerHTML"],Fe={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(J,{expose:K,emit:Q}){const d=J,{vue_ui_strip_plot:Z}=o.useConfig(),p=e.computed({get(){return!!d.dataset&&d.dataset.length},set(l){return l}}),L=e.ref(o.createUid()),V=e.ref(0),T=e.ref(!1),P=e.ref(""),b=e.ref(null),A=e.ref(null),F=e.ref(!1),t=e.computed(()=>{const l=Y.useNestedProp({userConfig:d.config,defaultConfig:Z});return l.theme?{...Y.useNestedProp({userConfig:o.themes.vue_ui_strip_plot[l.theme]||d.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}),C=e.ref(null);e.onMounted(()=>{if(o.objectIsEmpty(d.dataset)?o.error({componentName:"VueUiStripPlot",type:"dataset"}):d.dataset.forEach((l,s)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(a=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:a,index:s})}),l.plots&&l.plots.forEach((a,n)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=j.throttle(()=>{const{width:s,height:a}=j.useResponsive({chart:b.value,title:t.value.style.chart.title.text?A.value:null});w.value=a,f.value.width=s,f.value.height=a,k.value=(s-v.value.left-v.value.right)/d.dataset.length,B.value=o.translateSize({relator:Math.min(a,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})});C.value=new ResizeObserver(l),C.value.observe(b.value.parentNode)}F.value=!0,setTimeout(()=>{g.value=!1},ee.value*50)}),e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:D,isImaging:O,generatePdf:M,generateImage:W}=X.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),I=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),g=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),v=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),k=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),f=e.ref({width:k.value*d.dataset.length+v.value.left+v.value.right,height:t.value.style.chart.height}),r=e.computed(()=>{const l=k.value*d.dataset.length+v.value.left+v.value.right;return{left:v.value.left,right:l-v.value.right,top:v.value.top,bottom:w.value-v.value.bottom,width:k.value*d.dataset.length,height:w.value-v.value.top-v.value.bottom,stripWidth:k.value,absoluteHeight:w.value,absoluteWidth:l}}),_=e.computed(()=>p.value?d.dataset.map((l,s)=>{const a=o.createUid();return{...l,id:a,color:l.color?o.convertColorToHex(l.color):I.value[s]||o.palette[s]||o.palette[s%o.palette.length],plots:l.plots.map(n=>({...n,parentId:a,color:l.color?o.convertColorToHex(l.color):I.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:o.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(_.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,x:r.value.left+(s+1)*r.value.stripWidth-r.value.stripWidth/2}))}))),ee=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),E=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(a=>a.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>o.calculateNiceScale(E.value.min<0?E.value.min:0,E.value.max,t.value.style.chart.grid.scaleSteps)),te=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,y:r.value.bottom-(a.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*r.value.height}))}))),G=e.computed(()=>m.value.ticks.map(l=>({y:r.value.bottom-r.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:r.value.left,x2:r.value.right,value:l}))),z=e.ref(null),i=e.ref(null);function le({datapoint:l,seriesIndex:s}){z.value={datapoint:l,seriesIndex:s,config:t.value,series:_.value},T.value=!0,i.value=l;const a=t.value.style.chart.tooltip.customFormat;if(o.isFunction(a)&&o.functionReturnsString(()=>a({seriesIndex:s,datapoint:l,series:_.value,config:t.value})))P.value=a({seriesIndex:s,datapoint:l,series:_.value,config:t.value});else{let n="";n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${o.applyDataLabel(t.value.style.chart.labels.formatter,l.value,o.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,P.value=`<div>${n}</div>`}}const $=e.computed(()=>{const l=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${a.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function q(){e.nextTick(()=>{const l=$.value.head.map((n,u)=>[[n.name],[$.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),a=o.createCsvContent(s);o.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const N=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=$.value.head.map((u,y)=>{const S=o.dataLabel({p:t.value.style.chart.labels.prefix,v:$.value.body[y],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},S]}),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},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:a}}),x=e.ref(!1);function ae(l){x.value=l,V.value+=1}function oe(){return h.value}function R(){c.value.showTable=!c.value.showTable}function U(){c.value.dataLabels.show=!c.value.dataLabels.show}function H(){c.value.showTooltip=!c.value.showTooltip}return K({getData:oe,generatePdf:M,generateCsv:q,generateImage:W,toggleTable:R,toggleLabels:U,toggleTooltip:H}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:b,class:e.normalizeClass(`vue-ui-strip-plot ${x.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(re._sfc_main,{config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(D),isImaging:e.unref(O),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:x.value,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,onToggleFullscreen:ae,onGeneratePdf:e.unref(M),onGenerateCsv:q,onGenerateImage:e.unref(W),onToggleTable:R,onToggleLabels:U,onToggleTooltip:H},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.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":x.value,"vue-data-ui-fulscreen--off":!x.value}),viewBox:`0 0 ${f.value.width<=0?10:f.value.width} ${f.value.height<=0?10:f.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};`)},[t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",pe,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,a=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,ye))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+(n+1)*r.value.stripWidth,x2:r.value.left+(n+1)*r.value.stripWidth,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,be))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:r.value.left,x2:r.value.left,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,ge),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:r.value.bottom,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,ke)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(G.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:a.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.chart.labels.prefix,v:a.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:a,seriesIndex:n})),9,xe))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+(n+1)*r.value.stripWidth-r.value.stripWidth/2,y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(a.name),9,Ce))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:3,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${r.value.top+r.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,we)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:r.value.left+r.value.width/2,y:r.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Be)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,_e),e.createElementVNode("circle",{cx:r.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,$e),e.createElementVNode("circle",{cx:r.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ne)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,a=>(e.openBlock(),e.createElementBlock("radialGradient",{id:a.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(o.lightenHexColor)(a.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,Le),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(o.darkenHexColor)(a.color,.1)},null,8,Te),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Pe)],8,Se))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,y)=>(e.openBlock(),e.createBlock(ie._sfc_main,e.mergeProps({plot:{x:u.x,y:F.value?u.y:r.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${a.id})`:a.color,onMouseenter:S=>le({datapoint:u,seriesIndex:y}),onMouseleave:s[0]||(s[0]=S=>{T.value=!1,i.value=null}),onClick:S=>Q("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${g.value?`transition-delay:${y*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&g.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!g.value}},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[y===a.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&g.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(o.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:y}):""),13,ze)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:r.value},void 0,!0)],14,he)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ve,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(D)||e.unref(O)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ue.default,{key:4,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),e.createVNode(se._sfc_main,{show:c.value.showTooltip&&T.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:b.value,content:P.value,isCustom:e.unref(o.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),p.value?(e.openBlock(),e.createBlock(ce.default,{key:5,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ne.DataTable,{colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=a=>c.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Ae)]),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,de))}},De=ve._export_sfc(Fe,[["__scopeId","data-v-22897da0"]]);exports.default=De;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-De6Dj52h.cjs"),j=require("./useResponsive-B3TrDDIG.cjs"),re=require("./Title-CSRD5z1r.cjs"),X=require("./usePrinter-SLYneJmG.cjs"),se=require("./Tooltip-DFpYO4rz.cjs"),ne=require("./DataTable-CMF1l-gL.cjs"),ue=require("./vue-ui-skeleton-Cl9Kp9yE.cjs"),ie=require("./Shape-BNlNwrBB.cjs"),ce=require("./vue-ui-accordion-CiSEQOBc.cjs"),Y=require("./useNestedProp-Vjg1xsU_.cjs"),ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),de=["id"],he=["xmlns","viewBox"],pe={key:0},me={key:0},ye=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],fe={key:1},be=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ge=["x1","x2","y1","y2","stroke","stroke-width"],ke=["x1","x2","y1","y2","stroke","stroke-width"],xe=["x","y","fill","font-size"],Ce=["x","y","font-size","fill"],we=["fill","font-size","transform"],Be=["fill","font-size","x","y"],_e=["x1","x2","y1","y2","stroke"],$e=["cx","cy","fill"],Ne=["cx","cy","fill"],Se=["id"],Le=["stop-color"],Te=["stop-color"],Pe=["stop-color"],Ee={key:0},ze=["x","y","font-size","fill"],Ve={key:3,class:"vue-data-ui-watermark"},Ae=["innerHTML"],Fe={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(J,{expose:K,emit:Q}){const d=J,{vue_ui_strip_plot:Z}=o.useConfig(),p=e.computed({get(){return!!d.dataset&&d.dataset.length},set(l){return l}}),L=e.ref(o.createUid()),V=e.ref(0),T=e.ref(!1),P=e.ref(""),b=e.ref(null),A=e.ref(null),F=e.ref(!1),t=e.computed(()=>{const l=Y.useNestedProp({userConfig:d.config,defaultConfig:Z});return l.theme?{...Y.useNestedProp({userConfig:o.themes.vue_ui_strip_plot[l.theme]||d.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}),C=e.ref(null);e.onMounted(()=>{if(o.objectIsEmpty(d.dataset)?o.error({componentName:"VueUiStripPlot",type:"dataset"}):d.dataset.forEach((l,s)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(a=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:a,index:s})}),l.plots&&l.plots.forEach((a,n)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=j.throttle(()=>{const{width:s,height:a}=j.useResponsive({chart:b.value,title:t.value.style.chart.title.text?A.value:null});w.value=a,f.value.width=s,f.value.height=a,k.value=(s-v.value.left-v.value.right)/d.dataset.length,B.value=o.translateSize({relator:Math.min(a,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})});C.value=new ResizeObserver(l),C.value.observe(b.value.parentNode)}F.value=!0,setTimeout(()=>{g.value=!1},ee.value*50)}),e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:D,isImaging:O,generatePdf:M,generateImage:W}=X.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),I=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),g=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),v=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),k=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),f=e.ref({width:k.value*d.dataset.length+v.value.left+v.value.right,height:t.value.style.chart.height}),r=e.computed(()=>{const l=k.value*d.dataset.length+v.value.left+v.value.right;return{left:v.value.left,right:l-v.value.right,top:v.value.top,bottom:w.value-v.value.bottom,width:k.value*d.dataset.length,height:w.value-v.value.top-v.value.bottom,stripWidth:k.value,absoluteHeight:w.value,absoluteWidth:l}}),_=e.computed(()=>p.value?d.dataset.map((l,s)=>{const a=o.createUid();return{...l,id:a,color:l.color?o.convertColorToHex(l.color):I.value[s]||o.palette[s]||o.palette[s%o.palette.length],plots:l.plots.map(n=>({...n,parentId:a,color:l.color?o.convertColorToHex(l.color):I.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:o.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(_.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,x:r.value.left+(s+1)*r.value.stripWidth-r.value.stripWidth/2}))}))),ee=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),E=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(a=>a.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>o.calculateNiceScale(E.value.min<0?E.value.min:0,E.value.max,t.value.style.chart.grid.scaleSteps)),te=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,y:r.value.bottom-(a.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*r.value.height}))}))),G=e.computed(()=>m.value.ticks.map(l=>({y:r.value.bottom-r.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:r.value.left,x2:r.value.right,value:l}))),z=e.ref(null),i=e.ref(null);function le({datapoint:l,seriesIndex:s}){z.value={datapoint:l,seriesIndex:s,config:t.value,series:_.value},T.value=!0,i.value=l;const a=t.value.style.chart.tooltip.customFormat;if(o.isFunction(a)&&o.functionReturnsString(()=>a({seriesIndex:s,datapoint:l,series:_.value,config:t.value})))P.value=a({seriesIndex:s,datapoint:l,series:_.value,config:t.value});else{let n="";n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${o.applyDataLabel(t.value.style.chart.labels.formatter,l.value,o.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,P.value=`<div>${n}</div>`}}const $=e.computed(()=>{const l=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${a.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function q(){e.nextTick(()=>{const l=$.value.head.map((n,u)=>[[n.name],[$.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),a=o.createCsvContent(s);o.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const N=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=$.value.head.map((u,y)=>{const S=o.dataLabel({p:t.value.style.chart.labels.prefix,v:$.value.body[y],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},S]}),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},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:a}}),x=e.ref(!1);function ae(l){x.value=l,V.value+=1}function oe(){return h.value}function R(){c.value.showTable=!c.value.showTable}function U(){c.value.dataLabels.show=!c.value.dataLabels.show}function H(){c.value.showTooltip=!c.value.showTooltip}return K({getData:oe,generatePdf:M,generateCsv:q,generateImage:W,toggleTable:R,toggleLabels:U,toggleTooltip:H}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:b,class:e.normalizeClass(`vue-ui-strip-plot ${x.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(re._sfc_main,{config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(D),isImaging:e.unref(O),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:x.value,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,onToggleFullscreen:ae,onGeneratePdf:e.unref(M),onGenerateCsv:q,onGenerateImage:e.unref(W),onToggleTable:R,onToggleLabels:U,onToggleTooltip:H},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.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":x.value,"vue-data-ui-fulscreen--off":!x.value}),viewBox:`0 0 ${f.value.width<=0?10:f.value.width} ${f.value.height<=0?10:f.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};`)},[t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",pe,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,a=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,ye))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+(n+1)*r.value.stripWidth,x2:r.value.left+(n+1)*r.value.stripWidth,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,be))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:r.value.left,x2:r.value.left,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,ge),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:r.value.bottom,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,ke)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(G.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:a.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.chart.labels.prefix,v:a.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:a,seriesIndex:n})),9,xe))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+(n+1)*r.value.stripWidth-r.value.stripWidth/2,y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(a.name),9,Ce))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:3,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${r.value.top+r.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,we)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:r.value.left+r.value.width/2,y:r.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Be)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,_e),e.createElementVNode("circle",{cx:r.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,$e),e.createElementVNode("circle",{cx:r.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ne)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,a=>(e.openBlock(),e.createElementBlock("radialGradient",{id:a.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(o.lightenHexColor)(a.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,Le),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(o.darkenHexColor)(a.color,.1)},null,8,Te),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Pe)],8,Se))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,y)=>(e.openBlock(),e.createBlock(ie._sfc_main,e.mergeProps({plot:{x:u.x,y:F.value?u.y:r.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${a.id})`:a.color,onMouseenter:S=>le({datapoint:u,seriesIndex:y}),onMouseleave:s[0]||(s[0]=S=>{T.value=!1,i.value=null}),onClick:S=>Q("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${g.value?`transition-delay:${y*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&g.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!g.value}},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[y===a.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&g.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(o.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:y}):""),13,ze)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:r.value},void 0,!0)],14,he)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ve,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(D)||e.unref(O)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ue.default,{key:4,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),e.createVNode(se._sfc_main,{show:c.value.showTooltip&&T.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:b.value,content:P.value,isCustom:e.unref(o.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),p.value?(e.openBlock(),e.createBlock(ce.default,{key:5,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ne.DataTable,{colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=a=>c.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Ae)]),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,de))}},De=ve._export_sfc(Fe,[["__scopeId","data-v-22897da0"]]);exports.default=De;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as D, u as x, y as G, m as M, d as T, z as E, q as z, r as B, S as H } from "./index-
|
|
1
|
+
import { p as D, u as x, y as G, m as M, d as T, z as E, q as z, r as B, S as H } from "./index-8Lp8V0TB.js";
|
|
2
2
|
import { openBlock as i, createElementBlock as c, normalizeStyle as g, createElementVNode as a, toDisplayString as u, Fragment as b, renderList as _, normalizeClass as f, createTextVNode as I, createCommentVNode as N, withDirectives as k, vModelText as w, withKeys as S, withModifiers as O, vModelSelect as P, createStaticVNode as R, pushScopeId as U, popScopeId as V } from "vue";
|
|
3
3
|
import { _ as j } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const X = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-De6Dj52h.cjs"),e=require("vue"),b=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),C={name:"vue-ui-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},data(){return{uid:`vue-ui-table-${Math.random()}`,bodyCopy:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),buttonTimeout:null,canMoveChart:!1,chart:{height:316,type:"bar",width:512},constants:{ASC:1,BAR:"bar",DATE:"date",DESC:-1,DONUT:"donut",LINE:"line",NUMERIC:"numeric",PERCENTAGE:"percentage",TEXT:"text"},clientX:100,clientY:100,cssClass:{CELL:"smart-td-selected",FIRST_TD:"smart-td-selected-first",LAST_TD:"smart-td-selected-last",ROW:"smart-td-selected-neighbor"},currentDonut:void 0,currentFilter:void 0,currentSearch:void 0,currentSelectionSpan:{col:void 0,rows:[]},currentPage:0,dates:{},filteredDatesIndexes:{},hasNaN:{},iconColor:"#2D353C",iconSize:20,immutableRangeFilters:{},isExportRequest:!1,isLoading:!1,itemsPerPage:this.config.rowsPerPage?this.config.rowsPerPage:25,multiselects:{},paginatorOptions:[...new Set([10,25,50,100,250,500,this.config.rowsPerPage?this.config.rowsPerPage:25,this.dataset.body.length])].sort((l,o)=>l-o),palette:g.palette,percentages:{},rafId:null,rangeFilters:{},searches:{},selectedColumn:void 0,selectedDonutCategory:void 0,selectedPlot:void 0,showChart:!1,showDonutOptions:!1,sorts:{},tableBody:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),tableHead:JSON.parse(JSON.stringify(this.dataset.header)).map(l=>({average:Object.hasOwn(l,"average")?l.average:!1,decimals:Object.hasOwn(l,"decimals")?l.decimals:0,isMultiselect:Object.hasOwn(l,"isMultiselect")?l.isMultiselect:!1,isPercentage:Object.hasOwn(l,"isPercentage")?l.isPercentage:!1,isSearch:Object.hasOwn(l,"isSearch")?l.isSearch:!1,isSort:Object.hasOwn(l,"isSort")?l.isSort:!1,name:l.name,percentageTo:Object.hasOwn(l,"percentageTo")?l.percentageTo:void 0,prefix:Object.hasOwn(l,"prefix")?l.prefix:"",rangeFilter:Object.hasOwn(l,"rangeFilter")?l.rangeFilter:!1,suffix:Object.hasOwn(l,"suffix")?l.suffix:"",sum:Object.hasOwn(l,"sum")?l.sum:!1,type:l.type}))}},mounted(){if(this.dataset.header.length===0)throw new Error(`vue-ui-table error: missing header data.
|
|
2
2
|
Provide an array of objects of type:
|
|
3
3
|
{
|
|
4
4
|
name: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCssVars as J, ref as h, computed as c, onMounted as K, openBlock as n, createElementBlock as l, normalizeStyle as $, normalizeClass as V, createBlock as Q, unref as g, createSlots as Y, withCtx as C, renderSlot as r, normalizeProps as v, guardReactiveProps as f, createCommentVNode as p, createElementVNode as b, Fragment as _, renderList as w, createVNode as Z, mergeProps as z, nextTick as j } from "vue";
|
|
2
|
-
import { u as ee, c as E, t as te, o as ae, e as oe, R as se, D as ne, I as le, q as re, r as ue } from "./index-
|
|
3
|
-
import { u as M } from "./useNestedProp-
|
|
4
|
-
import { u as ie, U as de } from "./usePrinter-
|
|
5
|
-
import { _ as ce } from "./Shape-
|
|
2
|
+
import { u as ee, c as E, t as te, o as ae, e as oe, R as se, D as ne, I as le, q as re, r as ue } from "./index-8Lp8V0TB.js";
|
|
3
|
+
import { u as M } from "./useNestedProp-DE-a5lMx.js";
|
|
4
|
+
import { u as ie, U as de } from "./usePrinter-cCBJ71Cc.js";
|
|
5
|
+
import { _ as ce } from "./Shape-B5VTXCQH.js";
|
|
6
6
|
import { _ as ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
const pe = ["id"], me = { role: "cell" }, fe = { role: "row" }, he = ["data-cell"], ge = {
|
|
8
8
|
key: 0,
|
|
@@ -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-De6Dj52h.cjs"),C=require("./useNestedProp-Vjg1xsU_.cjs"),P=require("./usePrinter-SLYneJmG.cjs"),z=require("./Shape-BNlNwrBB.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),O=["id"],T={role:"cell"},M={role:"row"},G=["data-cell"],q={key:0,style:{display:"flex","flex-direction":"row",gap:"2px","align-items":"center"}},U=["height","width"],L={key:0,role:"cell","data-cell":"sum"},A={key:1,role:"cell","data-cell":"average"},D={key:2,role:"cell","data-cell":"median"},H={__name:"vue-ui-table-heatmap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(_,{expose:B}){const d=_;e.useCssVars(t=>({bb8dc4a0:V.value,"44bd448b":S.value}));const{vue_ui_table_heatmap:I}=r.useConfig(),p=e.ref(r.createUid()),s=e.ref(!1),c=e.ref(null),m=e.ref(!1),v=e.ref(0),o=e.computed(()=>{const t=C.useNestedProp({userConfig:d.config,defaultConfig:I});return t.theme?{...C.useNestedProp({userConfig:r.themes.vue_ui_table_heatmap[t.theme]||d.config,defaultConfig:t})}:t}),{isPrinting:$,isImaging:N,generatePdf:f,generateImage:g}=P.usePrinter({elementId:`table_heatmap_${p.value}`,fileName:"vue-ui-table-heatmap"}),x=e.computed(()=>o.value.table.responsiveBreakpoint),E=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(()=>{r.objectIsEmpty(d.dataset)&&r.error({componentName:"VueUiTableHeatmap",type:"dataset"});const t=new ResizeObserver(l=>{l.forEach(a=>{s.value=a.contentRect.width<x.value})});c.value&&t.observe(c.value)});const h=e.computed(()=>d.dataset.map(t=>{const l=t.values.map(n=>isNaN(n)?0:n),a=l.reduce((n,i)=>n+i,0);return{...t,values:l,serieExtremes:{max:Math.max(...l),min:Math.min(...l)},sum:a,average:a/l.length,median:r.calcMedian(l),displayValues:[t.name,...t.values],id:r.createUid()}})),b=e.computed(()=>{const t=h.value.flatMap(l=>l.values);return{min:Math.min(...t),max:Math.max(...t)}});function w(t,l){const a=o.value.style.heatmapColors.useIndividualScale;return r.interpolateColorHex(o.value.style.heatmapColors.min,o.value.style.heatmapColors.max,a?l.min:b.value.min,a?l.max:b.value.max,t)}const y=e.computed(()=>h.value.map(t=>({...t,colors:t.displayValues.map(l=>isNaN(l)?o.value.style.backgroundColor:w(l,t.serieExtremes))}))),S=e.computed(()=>o.value.style.backgroundColor),V=e.computed(()=>`${o.value.table.borderWidth}px`);function k(){e.nextTick(()=>{const t=y.value.map(n=>[[n.name],n.displayValues,[n.sum],[n.average],[n.median]]),l=[[[""],o.value.table.head.values,["sum"],["average"],["median"]]].concat(t),a=r.createCsvContent(l);r.downloadCsv({csvContent:a,title:"vue-ui-table-heatmap"})})}function F(t){m.value=t,v.value+=1}return B({generatePdf:f,generateCsv:k,generateImage:g}),(t,l)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:c,style:e.normalizeStyle(`width:100%; overflow-x:auto; container-type: inline-size;padding-top:${o.value.userOptions.show?"36px":""}; ${m.value?"vue-data-ui-wrapper-fullscreen":""}; position:relative;`),class:e.normalizeClass({"vue-ui-responsive":s.value}),id:`table_heatmap_${p.value}`},[o.value.userOptions.show&&E.value?(e.openBlock(),e.createBlock(P.UserOptions,{ref:"details",key:`user_option_${v.value}`,backgroundColor:o.value.style.backgroundColor,color:o.value.style.color,isPrinting:e.unref($),isImaging:e.unref(N),uid:p.value,hasPdf:o.value.userOptions.buttons.pdf,hasXls:o.value.userOptions.buttons.csv,hasImg:o.value.userOptions.buttons.img,hasFullscreen:o.value.userOptions.buttons.fullscreen,isFullscreen:m.value,titles:{...o.value.userOptions.buttonTitles},chartElement:c.value,onToggleFullscreen:F,onGeneratePdf:e.unref(f),onGenerateCsv:k,onGenerateImage:e.unref(g)},e.createSlots({_:2},[t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:n})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:n})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),e.createElementVNode("table",{class:e.normalizeClass({"vue-ui-table-heatmap":!0}),style:e.normalizeStyle(`width:100%;font-family:${o.value.style.fontFamily};background:${o.value.style.backgroundColor};`)},[e.createElementVNode("caption",null,[e.renderSlot(t.$slots,"caption",{},void 0,!0)]),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${o.value.table.head.backgroundColor};color:${o.value.table.head.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value.table.head.values,(a,n)=>(e.openBlock(),e.createElementBlock("th",T,[e.renderSlot(t.$slots,"head",e.normalizeProps(e.guardReactiveProps({value:a,rowIndex:n,type:typeof a,isResponsive:s.value})),void 0,!0)]))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,n)=>(e.openBlock(),e.createElementBlock("tr",M,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.displayValues,(i,u)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":o.value.table.head.values[u]},[a.color&&u===0?(e.openBlock(),e.createElementBlock("div",q,[a.color?(e.openBlock(),e.createElementBlock("svg",{key:0,height:o.value.style.shapeSize,width:o.value.style.shapeSize,viewBox:"0 0 20 20",style:{background:"none",overflow:"visible"}},[e.createVNode(z._sfc_main,{plot:{x:10,y:10},color:a.color,radius:9,shape:a.shape||"circle"},null,8,["color","shape"])],8,U)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"rowTitle",e.normalizeProps(e.guardReactiveProps({value:i,rowIndex:n,colIndex:u,type:typeof i,isResponsive:s.value})),void 0,!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[u===0?e.renderSlot(t.$slots,"rowTitle",e.normalizeProps(e.mergeProps({key:0},{value:i,rowIndex:n,colIndex:u,type:typeof i,isResponsive:s.value})),void 0,!0):e.createCommentVNode("",!0),u>0?e.renderSlot(t.$slots,"cell",e.normalizeProps(e.mergeProps({key:1},{value:i,rowIndex:n,colIndex:u,type:typeof i,isResponsive:s.value,color:a.colors[u],textColor:e.unref(r.adaptColorToBackground)(a.colors[u])})),void 0,!0):e.createCommentVNode("",!0)],64))],8,G))),256)),o.value.table.showSum?(e.openBlock(),e.createElementBlock("td",L,[e.renderSlot(t.$slots,"sum",e.normalizeProps(e.guardReactiveProps({value:a.sum,rowIndex:n,isResponsive:s.value})),void 0,!0)])):e.createCommentVNode("",!0),o.value.table.showAverage?(e.openBlock(),e.createElementBlock("td",A,[e.renderSlot(t.$slots,"average",e.normalizeProps(e.guardReactiveProps({value:a.average,rowIndex:n,isResponsive:s.value})),void 0,!0)])):e.createCommentVNode("",!0),o.value.table.showMedian?(e.openBlock(),e.createElementBlock("td",D,[e.renderSlot(t.$slots,"median",e.normalizeProps(e.guardReactiveProps({value:a.median,rowIndex:n,isResponsive:s.value})),void 0,!0)])):e.createCommentVNode("",!0)]))),256))])],4)],14,O))}},X=R._export_sfc(H,[["__scopeId","data-v-3d431bc6"]]);exports.default=X;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useCssVars as re, ref as d, computed as b, onMounted as ie, openBlock as u, createElementBlock as v, normalizeClass as W, createElementVNode as c, normalizeStyle as r, toDisplayString as p, createCommentVNode as g, Fragment as D, renderList as T, createBlock as M, unref as i, createSlots as de, withCtx as S, renderSlot as A, normalizeProps as ve, guardReactiveProps as ce, nextTick as fe } from "vue";
|
|
2
|
-
import { u as pe, c as me, t as be, a as ge, p as w, b as he, o as ye, e as J, g as _e, d as ke, R as xe, i as $, f as P, q as Ce, r as Ie } from "./index-
|
|
3
|
-
import { u as K } from "./useNestedProp-
|
|
4
|
-
import Se from "./vue-ui-sparkline-
|
|
5
|
-
import Ae from "./BaseIcon-
|
|
6
|
-
import { u as we, U as $e } from "./usePrinter-
|
|
2
|
+
import { u as pe, c as me, t as be, a as ge, p as w, b as he, o as ye, e as J, g as _e, d as ke, R as xe, i as $, f as P, q as Ce, r as Ie } from "./index-8Lp8V0TB.js";
|
|
3
|
+
import { u as K } from "./useNestedProp-DE-a5lMx.js";
|
|
4
|
+
import Se from "./vue-ui-sparkline-Bk4kWGco.js";
|
|
5
|
+
import Ae from "./BaseIcon-BoVYVkUT.js";
|
|
6
|
+
import { u as we, U as $e } from "./usePrinter-cCBJ71Cc.js";
|
|
7
7
|
import { _ as Pe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
const ze = ["id"], Fe = { style: { "z-index": "1", "padding-right": "24px" } }, Oe = ["onClick"], Ne = { style: { display: "flex", "flex-direction": "row", gap: "3px", "align-items": "center" } }, We = ["data-cell"], De = {
|
|
9
9
|
dir: "auto",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DGxA8bUJ.cjs"),V=require("./useNestedProp-DM4rgjhE.cjs"),H=require("./vue-ui-sparkline-oYEzsMF2.cjs"),X=require("./BaseIcon-DQUa2wbN.cjs"),P=require("./usePrinter-DbJ9I2vE.cjs"),J=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),K=["id"],Q={style:{"z-index":"1","padding-right":"24px"}},Y=["onClick"],Z={style:{display:"flex","flex-direction":"row",gap:"3px","align-items":"center"}},j=["data-cell"],ee={dir:"auto",style:{display:"flex","flex-direction":"row","align-items":"center",gap:"6px"}},te=["data-cell","onPointerenter"],le=["data-cell"],ae=["data-cell"],oe=["data-cell"],ne=["data-cell"],re={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup($,{expose:D}){const v=$;e.useCssVars(l=>({"328044aa":l.tdo}));const{vue_ui_table_sparkline:F}=u.useConfig(),y=e.ref(u.createUid()),x=e.ref(0),S=e.ref(0),t=e.computed(()=>{const l=V.useNestedProp({userConfig:v.config,defaultConfig:F});return l.theme?{...V.useNestedProp({userConfig:u.themes.vue_ui_table_sparkline[l.theme]||v.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}),{isPrinting:C,isImaging:z,generatePdf:I,generateImage:N}=P.usePrinter({elementId:`table_${y.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline"}),O=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),f=e.ref(null),w=e.ref(!1),W=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{u.objectIsEmpty(v.dataset)&&u.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(s=>{s.forEach(a=>{w.value=a.contentRect.width<W.value})});f.value&&l.observe(f.value)});const B=e.computed(()=>(v.dataset.forEach((l,s)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{u.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:s})})}),v.dataset.map((l,s)=>{const a=(l.values||[]).map(r=>isNaN(r)?0:r??0),n=a.reduce((r,o)=>r+o,0);return{...l,values:l.values||[],color:u.convertColorToHex(l.color)||O.value[s]||u.palette[s]||u.palette[s%u.palette.length],sum:n,average:n/a.length,median:u.calcMedian(a),sparklineDataset:a.map((r,o)=>({period:t.value.colNames[o]||`col ${o}`,value:r||0}))}})));function L(l){const a=(l[0].values||[]).map((r,o)=>l.map(i=>i.values[o]||[])).map(r=>r.map((o,i)=>[o,i]).sort((o,i)=>i[0]-o[0]).map(o=>o[1]));return l.map((r,o)=>({...r,values:r.values||[],orders:a[o]}))}const m=e.computed(()=>L(B.value)),b=e.ref(m.value),T=e.computed(()=>Math.max(...b.value.map(l=>(l.values||[]).length))),g=e.ref(void 0),k=e.ref(!1),h=e.ref(void 0),_=e.ref(-1);function M(){k.value=!1,h.value=void 0,_.value=-1,b.value=m.value}function G(l){k.value=!0,h.value=l;const s=m.value.map(o=>o.values[l]||[]),a=g.value===l?1:-1;_.value=a,l===g.value?g.value=void 0:g.value=l;const r=s.map((o,i)=>[i,o]).sort((o,i)=>a*(i[1]-o[1])).map(o=>o[0]).map(o=>m.value[o]);b.value=r,S.value+=1}const q=e.computed(()=>Math.max(...v.dataset.map(l=>(l.values||[]).length))),p=e.computed(()=>{let l=t.value.colNames;if(!l.length)for(let a=0;a<q.value;a+=1)l.push(`col ${a+1}`);t.value.showTotal&&(l=[...l,t.value.translations.total]);let s;return t.value.showAverage&&t.value.showMedian?s=[...l,t.value.translations.average,t.value.translations.median]:t.value.showAverage&&!t.value.showMedian?s=[...l,t.value.translations.average]:!t.value.showAverage&&t.value.showMedian?s=[...l,t.value.translations.median]:s=l,t.value.showSparklines?[...s,t.value.translations.chart]:s}),d=e.ref(void 0),c=e.ref(void 0);function R({dataIndex:l,serieIndex:s}){d.value=l,c.value=s}const A=e.ref(!1);function U(l){A.value=l,x.value+=1}function E(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(p.value),s=B.value.map((r,o)=>[[r.name],r.values,[r.sum],[r.average],[r.median]]),a=[l].concat(s),n=u.createCsvContent(a);u.downloadCsv({csvContent:n,title:t.value.title.text||"vue-ui-table-sparkline"})})}return D({generatePdf:I,generateImage:N,generateCsv:E,restoreOrder:M}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:f,class:e.normalizeClass({"vue-ui-responsive":w.value}),style:{overflow:"hidden"},id:`table_${y.value}`},[e.createElementVNode("div",{style:{overflow:"auto"},onPointerleave:s[0]||(s[0]=a=>{c.value=void 0,d.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[t.value.title.text?(e.openBlock(),e.createElementBlock("caption",{key:0,style:e.normalizeStyle({backgroundColor:t.value.title.backgroundColor})},[e.createElementVNode("div",{style:e.normalizeStyle({fontSize:`${t.value.title.fontSize}px`,fontWeight:t.value.title.bold?"bold":"normal",color:t.value.title.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.text),5),t.value.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({fontSize:`${t.value.title.subtitle.fontSize}px`,fontWeight:t.value.title.subtitle.bold?"bold":"normal",color:t.value.title.subtitle.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("thead",Q,[e.createElementVNode("tr",{role:"row",class:"vue-ui-data-table__thead-row",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color})},[e.createElementVNode("th",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,outline:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal"}),class:"sticky-col-first"},e.toDisplayString(t.value.translations.serie),5),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(a,n)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",style:e.normalizeStyle({background:t.value.thead.backgroundColor,outline:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal",minWidth:n===p.value.length-1?"150px":"",cursor:m.value[0].values[n]!==void 0?"pointer":"default"}),onClick:()=>G(n),class:e.normalizeClass({"sticky-col":n===p.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",Z,[e.createElementVNode("span",null,e.toDisplayString(a),1),k.value&&n===h.value&&m.value[0].values[n]!==void 0?(e.openBlock(),e.createBlock(X.default,{key:0,size:18,name:_.value===1?"sort":"sortReverse",stroke:t.value.thead.color},null,8,["name","stroke"])):e.createCommentVNode("",!0)]),t.value.userOptions.show&&n===p.value.length-1?(e.openBlock(),e.createBlock(P.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${x.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(C),isImaging:e.unref(z),uid:y.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:A.value,titles:{...t.value.userOptions.buttonTitles},chartElement:f.value,onToggleFullscreen:U,onGeneratePdf:e.unref(I),onGenerateImage:e.unref(N),onGenerateCsv:E},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.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:r,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:r,isFullscreen:o})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0)],14,Y))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(a,n)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,color:t.value.tbody.color}),class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":n%2===0,"vue-ui-data-table__tbody__row-odd":n%2!==0})},[e.createElementVNode("td",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.serie,class:"vue-ui-data-table__tbody__td sticky-col-first"},[e.createElementVNode("div",ee,[e.createElementVNode("span",{style:e.normalizeStyle({color:a.color})},"⬤",4),e.createElementVNode("span",null,e.toDisplayString(a.name??"-"),1)])],12,j),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(r,o)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,backgroundColor:d.value!==void 0&&c.value!==void 0&&o===d.value&&c.value===n?`${a.color}33`:"",borderRadius:d.value!==void 0&&c.value!==void 0&&o===d.value&&c.value===n?"3px":""}),"data-cell":p.value[o],class:"vue-ui-data-table__tbody__td",onPointerenter:i=>{c.value=n,d.value=o}},e.toDisplayString([null,void 0].includes(a.values[o])?"-":e.unref(u.applyDataLabel)(t.value.formatter,Number(a.values[o]),e.unref(u.dataLabel)({p:t.value.prefix,v:Number(a.values[o]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:n,datapointIndex:o})),45,te))),256)),t.value.showTotal?(e.openBlock(),e.createElementBlock("td",{key:0,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.total,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.sum,e.unref(u.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:n})),13,le)):e.createCommentVNode("",!0),t.value.showAverage?(e.openBlock(),e.createElementBlock("td",{key:1,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.average,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.average,e.unref(u.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:n})),13,ae)):e.createCommentVNode("",!0),t.value.showMedian?(e.openBlock(),e.createElementBlock("td",{key:2,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.median,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.median,e.unref(u.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:n})),13,oe)):e.createCommentVNode("",!0),t.value.showSparklines?(e.openBlock(),e.createElementBlock("td",{key:3,role:"cell","data-cell":t.value.translations.chart,style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),class:"vue-ui-data-table__tbody__td sticky-col"},[(e.openBlock(),e.createBlock(H.default,{key:`sparkline_${n}_${S.value}`,onHoverIndex:({index:r})=>R({dataIndex:r,serieIndex:n}),dataset:a.sparklineDataset,showInfo:!1,selectedIndex:d.value,config:{type:t.value.sparkline.type,style:{backgroundColor:t.value.tbody.backgroundColor,animation:{show:t.value.sparkline.animation.show&&!e.unref(C)&&!e.unref(z),animationFrames:t.value.sparkline.animation.animationFrames},line:{color:a.color,smooth:t.value.sparkline.smooth,strokeWidth:t.value.sparkline.strokeWidth},bar:{color:a.color},area:{color:a.color,opacity:t.value.sparkline.showArea?16:0,useGradient:t.value.sparkline.useGradient},verticalIndicator:{color:a.color},plot:{radius:9,stroke:t.value.tbody.backgroundColor,strokeWidth:3}}}},null,8,["onHoverIndex","dataset","selectedIndex","config"]))],12,ne)):e.createCommentVNode("",!0)],6))),256))])],4)],32)],10,K))}},ue=J._export_sfc(re,[["__scopeId","data-v-d3c784ed"]]);exports.default=ue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-De6Dj52h.cjs"),V=require("./useNestedProp-Vjg1xsU_.cjs"),H=require("./vue-ui-sparkline-CdPAtBR8.cjs"),X=require("./BaseIcon-DuVD-1qH.cjs"),P=require("./usePrinter-SLYneJmG.cjs"),J=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),K=["id"],Q={style:{"z-index":"1","padding-right":"24px"}},Y=["onClick"],Z={style:{display:"flex","flex-direction":"row",gap:"3px","align-items":"center"}},j=["data-cell"],ee={dir:"auto",style:{display:"flex","flex-direction":"row","align-items":"center",gap:"6px"}},te=["data-cell","onPointerenter"],le=["data-cell"],ae=["data-cell"],oe=["data-cell"],ne=["data-cell"],re={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup($,{expose:D}){const v=$;e.useCssVars(l=>({"328044aa":l.tdo}));const{vue_ui_table_sparkline:F}=u.useConfig(),y=e.ref(u.createUid()),x=e.ref(0),S=e.ref(0),t=e.computed(()=>{const l=V.useNestedProp({userConfig:v.config,defaultConfig:F});return l.theme?{...V.useNestedProp({userConfig:u.themes.vue_ui_table_sparkline[l.theme]||v.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}),{isPrinting:C,isImaging:z,generatePdf:I,generateImage:N}=P.usePrinter({elementId:`table_${y.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline"}),O=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),f=e.ref(null),w=e.ref(!1),W=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{u.objectIsEmpty(v.dataset)&&u.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(s=>{s.forEach(a=>{w.value=a.contentRect.width<W.value})});f.value&&l.observe(f.value)});const B=e.computed(()=>(v.dataset.forEach((l,s)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{u.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:s})})}),v.dataset.map((l,s)=>{const a=(l.values||[]).map(r=>isNaN(r)?0:r??0),n=a.reduce((r,o)=>r+o,0);return{...l,values:l.values||[],color:u.convertColorToHex(l.color)||O.value[s]||u.palette[s]||u.palette[s%u.palette.length],sum:n,average:n/a.length,median:u.calcMedian(a),sparklineDataset:a.map((r,o)=>({period:t.value.colNames[o]||`col ${o}`,value:r||0}))}})));function L(l){const a=(l[0].values||[]).map((r,o)=>l.map(i=>i.values[o]||[])).map(r=>r.map((o,i)=>[o,i]).sort((o,i)=>i[0]-o[0]).map(o=>o[1]));return l.map((r,o)=>({...r,values:r.values||[],orders:a[o]}))}const m=e.computed(()=>L(B.value)),b=e.ref(m.value),T=e.computed(()=>Math.max(...b.value.map(l=>(l.values||[]).length))),g=e.ref(void 0),k=e.ref(!1),h=e.ref(void 0),_=e.ref(-1);function M(){k.value=!1,h.value=void 0,_.value=-1,b.value=m.value}function G(l){k.value=!0,h.value=l;const s=m.value.map(o=>o.values[l]||[]),a=g.value===l?1:-1;_.value=a,l===g.value?g.value=void 0:g.value=l;const r=s.map((o,i)=>[i,o]).sort((o,i)=>a*(i[1]-o[1])).map(o=>o[0]).map(o=>m.value[o]);b.value=r,S.value+=1}const q=e.computed(()=>Math.max(...v.dataset.map(l=>(l.values||[]).length))),p=e.computed(()=>{let l=t.value.colNames;if(!l.length)for(let a=0;a<q.value;a+=1)l.push(`col ${a+1}`);t.value.showTotal&&(l=[...l,t.value.translations.total]);let s;return t.value.showAverage&&t.value.showMedian?s=[...l,t.value.translations.average,t.value.translations.median]:t.value.showAverage&&!t.value.showMedian?s=[...l,t.value.translations.average]:!t.value.showAverage&&t.value.showMedian?s=[...l,t.value.translations.median]:s=l,t.value.showSparklines?[...s,t.value.translations.chart]:s}),d=e.ref(void 0),c=e.ref(void 0);function R({dataIndex:l,serieIndex:s}){d.value=l,c.value=s}const A=e.ref(!1);function U(l){A.value=l,x.value+=1}function E(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(p.value),s=B.value.map((r,o)=>[[r.name],r.values,[r.sum],[r.average],[r.median]]),a=[l].concat(s),n=u.createCsvContent(a);u.downloadCsv({csvContent:n,title:t.value.title.text||"vue-ui-table-sparkline"})})}return D({generatePdf:I,generateImage:N,generateCsv:E,restoreOrder:M}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:f,class:e.normalizeClass({"vue-ui-responsive":w.value}),style:{overflow:"hidden"},id:`table_${y.value}`},[e.createElementVNode("div",{style:{overflow:"auto"},onPointerleave:s[0]||(s[0]=a=>{c.value=void 0,d.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[t.value.title.text?(e.openBlock(),e.createElementBlock("caption",{key:0,style:e.normalizeStyle({backgroundColor:t.value.title.backgroundColor})},[e.createElementVNode("div",{style:e.normalizeStyle({fontSize:`${t.value.title.fontSize}px`,fontWeight:t.value.title.bold?"bold":"normal",color:t.value.title.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.text),5),t.value.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({fontSize:`${t.value.title.subtitle.fontSize}px`,fontWeight:t.value.title.subtitle.bold?"bold":"normal",color:t.value.title.subtitle.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("thead",Q,[e.createElementVNode("tr",{role:"row",class:"vue-ui-data-table__thead-row",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color})},[e.createElementVNode("th",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,outline:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal"}),class:"sticky-col-first"},e.toDisplayString(t.value.translations.serie),5),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(a,n)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",style:e.normalizeStyle({background:t.value.thead.backgroundColor,outline:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal",minWidth:n===p.value.length-1?"150px":"",cursor:m.value[0].values[n]!==void 0?"pointer":"default"}),onClick:()=>G(n),class:e.normalizeClass({"sticky-col":n===p.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",Z,[e.createElementVNode("span",null,e.toDisplayString(a),1),k.value&&n===h.value&&m.value[0].values[n]!==void 0?(e.openBlock(),e.createBlock(X.default,{key:0,size:18,name:_.value===1?"sort":"sortReverse",stroke:t.value.thead.color},null,8,["name","stroke"])):e.createCommentVNode("",!0)]),t.value.userOptions.show&&n===p.value.length-1?(e.openBlock(),e.createBlock(P.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${x.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(C),isImaging:e.unref(z),uid:y.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:A.value,titles:{...t.value.userOptions.buttonTitles},chartElement:f.value,onToggleFullscreen:U,onGeneratePdf:e.unref(I),onGenerateImage:e.unref(N),onGenerateCsv:E},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.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:r,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:r,isFullscreen:o})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0)],14,Y))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(a,n)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,color:t.value.tbody.color}),class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":n%2===0,"vue-ui-data-table__tbody__row-odd":n%2!==0})},[e.createElementVNode("td",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.serie,class:"vue-ui-data-table__tbody__td sticky-col-first"},[e.createElementVNode("div",ee,[e.createElementVNode("span",{style:e.normalizeStyle({color:a.color})},"⬤",4),e.createElementVNode("span",null,e.toDisplayString(a.name??"-"),1)])],12,j),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(r,o)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,backgroundColor:d.value!==void 0&&c.value!==void 0&&o===d.value&&c.value===n?`${a.color}33`:"",borderRadius:d.value!==void 0&&c.value!==void 0&&o===d.value&&c.value===n?"3px":""}),"data-cell":p.value[o],class:"vue-ui-data-table__tbody__td",onPointerenter:i=>{c.value=n,d.value=o}},e.toDisplayString([null,void 0].includes(a.values[o])?"-":e.unref(u.applyDataLabel)(t.value.formatter,Number(a.values[o]),e.unref(u.dataLabel)({p:t.value.prefix,v:Number(a.values[o]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:n,datapointIndex:o})),45,te))),256)),t.value.showTotal?(e.openBlock(),e.createElementBlock("td",{key:0,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.total,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.sum,e.unref(u.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:n})),13,le)):e.createCommentVNode("",!0),t.value.showAverage?(e.openBlock(),e.createElementBlock("td",{key:1,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.average,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.average,e.unref(u.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:n})),13,ae)):e.createCommentVNode("",!0),t.value.showMedian?(e.openBlock(),e.createElementBlock("td",{key:2,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.median,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.median,e.unref(u.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:n})),13,oe)):e.createCommentVNode("",!0),t.value.showSparklines?(e.openBlock(),e.createElementBlock("td",{key:3,role:"cell","data-cell":t.value.translations.chart,style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),class:"vue-ui-data-table__tbody__td sticky-col"},[(e.openBlock(),e.createBlock(H.default,{key:`sparkline_${n}_${S.value}`,onHoverIndex:({index:r})=>R({dataIndex:r,serieIndex:n}),dataset:a.sparklineDataset,showInfo:!1,selectedIndex:d.value,config:{type:t.value.sparkline.type,style:{backgroundColor:t.value.tbody.backgroundColor,animation:{show:t.value.sparkline.animation.show&&!e.unref(C)&&!e.unref(z),animationFrames:t.value.sparkline.animation.animationFrames},line:{color:a.color,smooth:t.value.sparkline.smooth,strokeWidth:t.value.sparkline.strokeWidth},bar:{color:a.color},area:{color:a.color,opacity:t.value.sparkline.showArea?16:0,useGradient:t.value.sparkline.useGradient},verticalIndicator:{color:a.color},plot:{radius:9,stroke:t.value.tbody.backgroundColor,strokeWidth:3}}}},null,8,["onHoverIndex","dataset","selectedIndex","config"]))],12,ne)):e.createCommentVNode("",!0)],6))),256))])],4)],32)],10,K))}},ue=J._export_sfc(re,[["__scopeId","data-v-d3c784ed"]]);exports.default=ue;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useCssVars as ne, computed as c, onMounted as ie, ref as p, openBlock as o, createElementBlock as n, normalizeClass as C, normalizeStyle as z, createVNode as he, createCommentVNode as h, createBlock as B, unref as v, createSlots as ce, withCtx as q, renderSlot as k, normalizeProps as j, guardReactiveProps as A, createElementVNode as d, Fragment as $, renderList as D, toDisplayString as de } from "vue";
|
|
2
|
-
import { u as ve, o as ye, e as H, g as fe, c as me, t as ge, a as pe, p as x, b as ke, d as F, X as xe, v as be, i as _e, f as we } from "./index-
|
|
3
|
-
import { _ as Ce } from "./Title-
|
|
4
|
-
import { u as $e, U as Fe } from "./usePrinter-
|
|
5
|
-
import Pe from "./vue-ui-skeleton-
|
|
6
|
-
import { u as X } from "./useNestedProp-
|
|
2
|
+
import { u as ve, o as ye, e as H, g as fe, c as me, t as ge, a as pe, p as x, b as ke, d as F, X as xe, v as be, i as _e, f as we } from "./index-8Lp8V0TB.js";
|
|
3
|
+
import { _ as Ce } from "./Title-0px6u9U5.js";
|
|
4
|
+
import { u as $e, U as Fe } from "./usePrinter-cCBJ71Cc.js";
|
|
5
|
+
import Pe from "./vue-ui-skeleton-apODtH32.js";
|
|
6
|
+
import { u as X } from "./useNestedProp-DE-a5lMx.js";
|
|
7
7
|
import { _ as Ie } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
const Ye = ["id"], Me = {
|
|
9
9
|
key: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-DGxA8bUJ.cjs"),A=require("./Title-CUtmTGbN.cjs"),F=require("./usePrinter-DbJ9I2vE.cjs"),D=require("./vue-ui-skeleton-CHI4nqtV.cjs"),I=require("./useNestedProp-DM4rgjhE.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),X=["id"],J={key:0,style:"width:100%"},K=["xmlns","viewBox"],Q={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},Z=["fill"],ee=["id"],te=["stop-color"],oe=["stop-color"],le=["stop-color"],re={"clip-path":"url(#vueUiPill)"},ae=["x","y","height","width"],se=["x","y","height","width","fill"],ne=["x1","x2","y1","y2","stroke-width","stroke"],ue=["x1","x2","y1","y2","stroke-width","stroke"],ie=["x1","x2","y1","y2","stroke-width","stroke"],ce=["x1","x2","y1","y2","stroke-width","stroke"],de=["x1","x2","y1","y2","stroke-width","stroke"],he=["x1","x2","y1","y2","stroke-width","stroke"],ve=["x1","x2","y1","y2","stroke-width","stroke"],me=["x1","x2","y1","y2","stroke-width","stroke"],ye=["x","y","height","width"],pe=["y","x","fill","font-size","font-weight"],fe={key:3,class:"vue-data-ui-watermark"},ge={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:q}){const a=m;e.useCssVars(l=>({"3d1a25cf":z.value,"52cc1c9f":O.value,"90b36568":M.value}));const{vue_ui_thermometer:S}=s.useConfig(),f=e.computed(()=>!!a.dataset&&Object.keys(a.dataset).length);e.onMounted(()=>{s.objectIsEmpty(a.dataset)?s.error({componentName:"VueUiThermometer",type:"dataset"}):s.getMissingDatasetAttributes({datasetObject:a.dataset,requiredAttributes:["value","from","to"]}).forEach(l=>{s.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:l})})});const d=e.ref(s.createUid()),w=e.ref(null),C=e.ref(0),t=e.computed(()=>{const l=I.useNestedProp({userConfig:a.config,defaultConfig:S});return l.theme?{...I.useNestedProp({userConfig:s.themes.vue_ui_thermometer[l.theme]||a.config,defaultConfig:l}),customPalette:s.themePalettes[l.theme]||s.palette}:l}),{isPrinting:B,isImaging:N,generatePdf:E,generateImage:V}=F.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),y=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),T=e.computed(()=>t.value.style.chart.thermometer.width),c=e.computed(()=>a.dataset.steps||10),i=e.ref({top:t.value.style.chart.padding.top,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right,bottom:t.value.style.chart.padding.bottom});function p(l,n,o){const u=[],b=P(l),_=P(n);for(let v=0;v<o;v++){const G=g(b.red,_.red,v,o),W=g(b.green,_.green,v,o),H=g(b.blue,_.blue,v,o),j=`#${k(G)}${k(W)}${k(H)}`;u.push(j)}return u}function P(l){const n=l.slice(1);return{red:parseInt(n.slice(0,2),16),green:parseInt(n.slice(2,4),16),blue:parseInt(n.slice(4,6),16)}}function g(l,n,o,u){return Math.round(l+(n-l)*o/u)}function k(l){return l.toString(16).padStart(2,"0")}const r=e.computed(()=>{const l=T.value+i.value.left+i.value.right,n=t.value.style.chart.height;return{width:l,left:i.value.left,right:l-i.value.right,top:i.value.top,bottom:n-i.value.bottom,height:n}}),Y=e.computed(()=>r.value),x=e.computed(()=>{const l=a.dataset.from<0?Math.abs(a.dataset.from):a.dataset.from,n=a.dataset.to<0?Math.abs(a.dataset.to):a.dataset.to;let o=0;return a.dataset.to>0?o=l+n:l>n?o=l-n:o=n-l,(1-(Math.abs(a.dataset.from)+a.dataset.value)/o)*(r.value.height-i.value.top-i.value.bottom)}),M=e.computed(()=>`${x.value}px`),O=e.computed(()=>`${r.value.height-t.value.style.chart.padding.bottom-i.value.top}px`),z=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),L=e.computed(()=>{if(a.dataset.colors){if(!a.dataset.colors.from)return p(y.value[0]||s.palette[0],s.convertColorToHex(a.dataset.colors.to),c.value||10);if(!a.dataset.colors.to)return p(s.convertColorToHex(a.dataset.colors.from),y.value[1]||s.palette[1],c.value||10)}else return p(y.value[1]||s.palette[1],y.value[0]||s.palette[0],c.value||10);return p(s.convertColorToHex(a.dataset.colors.from),s.convertColorToHex(a.dataset.colors.to),c.value||10)}),$=e.computed(()=>{const l=[];let n=0;const o=r.value.height-i.value.top-i.value.bottom;for(let u=0;u<o-1;u+=o/c.value)l.push({x:r.value.left,y:r.value.top+u,qYLess:r.value.top+u+o/c.value/4,halfY:r.value.top+u+o/c.value/2,qYMore:r.value.top+u+o/c.value/4*3,color:L.value[n],height:o/c.value}),n+=1;return l}),h=e.ref(!1);function U(l){h.value=l,C.value+=1}return q({generatePdf:E,generateImage:V}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:w,class:e.normalizeClass(`vue-ui-thermometer ${h.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}`),id:`thermometer__${d.value}`},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",J,[e.createVNode(A._sfc_main,{config:{title:{cy:"thermometer-div-title",...t.value.style.title},subtitle:{cy:"thermometer-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"])])):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(F.UserOptions,{ref:"details",key:`user_options_${C.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(N),isPrinting:e.unref(B),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,titles:{...t.value.userOptions.buttonTitles},chartElement:w.value,onToggleFullscreen:U,onGeneratePdf:e.unref(E),onGenerateImage:e.unref(V)},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:o,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`background:${t.value.style.chart.backgroundColor}`)},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",Q,[e.createElementVNode("rect",{x:"0",y:"0",width:"1",height:"1",rx:"0.5",ry:"0.07",fill:t.value.style.chart.backgroundColor},null,8,Z)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(o,u)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${u}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,te),e.createElementVNode("stop",{offset:"50%","stop-color":`${o.color}${e.unref(s.opacity)[100-t.value.style.chart.graduations.gradient.intensity]}`},null,8,oe),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,le)],8,ee))),256))]),e.createElementVNode("g",re,[e.createElementVNode("rect",{x:r.value.left,y:r.value.top,height:r.value.height-i.value.top-i.value.bottom,width:r.value.width-i.value.left-i.value.right,fill:"#FFFFFF"},null,8,ae),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(o,u)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${u}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:r.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:t.value.style.chart.graduations.gradient.show?`url(#vueUiThermometerGradient_${u}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,se),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ne)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ue)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x+2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ie)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x+2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ce)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.right,x2:r.value.right-10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,de)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:r.value.right,x2:r.value.right-5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,he)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:r.value.right,x2:r.value.right-2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ve)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.right,x2:r.value.right-2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,me)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("rect",{class:e.normalizeClass({"vue-ui-thermometer-temperature":t.value.style.chart.animation.use}),x:r.value.left,y:r.value.top,height:x.value,width:r.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,ye)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:x.value+r.value.top+t.value.style.chart.label.fontSize/3,x:r.value.left-10,"text-anchor":"end",fill:t.value.style.chart.label.color,"font-size":t.value.style.chart.label.fontSize,"font-weight":t.value.style.chart.label.bold?"bold":"normal"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.label.formatter,m.dataset.value,e.unref(s.dataLabel)({p:t.value.style.chart.label.prefix,v:m.dataset.value,s:t.value.style.chart.label.suffix,r:t.value.style.chart.label.rounding}),{datapoint:m.dataset})),11,pe),e.renderSlot(l.$slots,"svg",{svg:Y.value},void 0,!0)],14,K)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",fe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(B)||e.unref(N)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(D.default,{key:4,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],14,X))}},ke=R._export_sfc(ge,[["__scopeId","data-v-1375e978"]]);exports.default=ke;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-De6Dj52h.cjs"),A=require("./Title-CSRD5z1r.cjs"),F=require("./usePrinter-SLYneJmG.cjs"),D=require("./vue-ui-skeleton-Cl9Kp9yE.cjs"),I=require("./useNestedProp-Vjg1xsU_.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),X=["id"],J={key:0,style:"width:100%"},K=["xmlns","viewBox"],Q={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},Z=["fill"],ee=["id"],te=["stop-color"],oe=["stop-color"],le=["stop-color"],re={"clip-path":"url(#vueUiPill)"},ae=["x","y","height","width"],se=["x","y","height","width","fill"],ne=["x1","x2","y1","y2","stroke-width","stroke"],ue=["x1","x2","y1","y2","stroke-width","stroke"],ie=["x1","x2","y1","y2","stroke-width","stroke"],ce=["x1","x2","y1","y2","stroke-width","stroke"],de=["x1","x2","y1","y2","stroke-width","stroke"],he=["x1","x2","y1","y2","stroke-width","stroke"],ve=["x1","x2","y1","y2","stroke-width","stroke"],me=["x1","x2","y1","y2","stroke-width","stroke"],ye=["x","y","height","width"],pe=["y","x","fill","font-size","font-weight"],fe={key:3,class:"vue-data-ui-watermark"},ge={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:q}){const a=m;e.useCssVars(l=>({"3d1a25cf":z.value,"52cc1c9f":O.value,"90b36568":M.value}));const{vue_ui_thermometer:S}=s.useConfig(),f=e.computed(()=>!!a.dataset&&Object.keys(a.dataset).length);e.onMounted(()=>{s.objectIsEmpty(a.dataset)?s.error({componentName:"VueUiThermometer",type:"dataset"}):s.getMissingDatasetAttributes({datasetObject:a.dataset,requiredAttributes:["value","from","to"]}).forEach(l=>{s.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:l})})});const d=e.ref(s.createUid()),w=e.ref(null),C=e.ref(0),t=e.computed(()=>{const l=I.useNestedProp({userConfig:a.config,defaultConfig:S});return l.theme?{...I.useNestedProp({userConfig:s.themes.vue_ui_thermometer[l.theme]||a.config,defaultConfig:l}),customPalette:s.themePalettes[l.theme]||s.palette}:l}),{isPrinting:B,isImaging:N,generatePdf:E,generateImage:V}=F.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),y=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),T=e.computed(()=>t.value.style.chart.thermometer.width),c=e.computed(()=>a.dataset.steps||10),i=e.ref({top:t.value.style.chart.padding.top,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right,bottom:t.value.style.chart.padding.bottom});function p(l,n,o){const u=[],b=P(l),_=P(n);for(let v=0;v<o;v++){const G=g(b.red,_.red,v,o),W=g(b.green,_.green,v,o),H=g(b.blue,_.blue,v,o),j=`#${k(G)}${k(W)}${k(H)}`;u.push(j)}return u}function P(l){const n=l.slice(1);return{red:parseInt(n.slice(0,2),16),green:parseInt(n.slice(2,4),16),blue:parseInt(n.slice(4,6),16)}}function g(l,n,o,u){return Math.round(l+(n-l)*o/u)}function k(l){return l.toString(16).padStart(2,"0")}const r=e.computed(()=>{const l=T.value+i.value.left+i.value.right,n=t.value.style.chart.height;return{width:l,left:i.value.left,right:l-i.value.right,top:i.value.top,bottom:n-i.value.bottom,height:n}}),Y=e.computed(()=>r.value),x=e.computed(()=>{const l=a.dataset.from<0?Math.abs(a.dataset.from):a.dataset.from,n=a.dataset.to<0?Math.abs(a.dataset.to):a.dataset.to;let o=0;return a.dataset.to>0?o=l+n:l>n?o=l-n:o=n-l,(1-(Math.abs(a.dataset.from)+a.dataset.value)/o)*(r.value.height-i.value.top-i.value.bottom)}),M=e.computed(()=>`${x.value}px`),O=e.computed(()=>`${r.value.height-t.value.style.chart.padding.bottom-i.value.top}px`),z=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),L=e.computed(()=>{if(a.dataset.colors){if(!a.dataset.colors.from)return p(y.value[0]||s.palette[0],s.convertColorToHex(a.dataset.colors.to),c.value||10);if(!a.dataset.colors.to)return p(s.convertColorToHex(a.dataset.colors.from),y.value[1]||s.palette[1],c.value||10)}else return p(y.value[1]||s.palette[1],y.value[0]||s.palette[0],c.value||10);return p(s.convertColorToHex(a.dataset.colors.from),s.convertColorToHex(a.dataset.colors.to),c.value||10)}),$=e.computed(()=>{const l=[];let n=0;const o=r.value.height-i.value.top-i.value.bottom;for(let u=0;u<o-1;u+=o/c.value)l.push({x:r.value.left,y:r.value.top+u,qYLess:r.value.top+u+o/c.value/4,halfY:r.value.top+u+o/c.value/2,qYMore:r.value.top+u+o/c.value/4*3,color:L.value[n],height:o/c.value}),n+=1;return l}),h=e.ref(!1);function U(l){h.value=l,C.value+=1}return q({generatePdf:E,generateImage:V}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:w,class:e.normalizeClass(`vue-ui-thermometer ${h.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}`),id:`thermometer__${d.value}`},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",J,[e.createVNode(A._sfc_main,{config:{title:{cy:"thermometer-div-title",...t.value.style.title},subtitle:{cy:"thermometer-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"])])):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(F.UserOptions,{ref:"details",key:`user_options_${C.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(N),isPrinting:e.unref(B),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,titles:{...t.value.userOptions.buttonTitles},chartElement:w.value,onToggleFullscreen:U,onGeneratePdf:e.unref(E),onGenerateImage:e.unref(V)},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:o,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`background:${t.value.style.chart.backgroundColor}`)},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",Q,[e.createElementVNode("rect",{x:"0",y:"0",width:"1",height:"1",rx:"0.5",ry:"0.07",fill:t.value.style.chart.backgroundColor},null,8,Z)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(o,u)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${u}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,te),e.createElementVNode("stop",{offset:"50%","stop-color":`${o.color}${e.unref(s.opacity)[100-t.value.style.chart.graduations.gradient.intensity]}`},null,8,oe),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,le)],8,ee))),256))]),e.createElementVNode("g",re,[e.createElementVNode("rect",{x:r.value.left,y:r.value.top,height:r.value.height-i.value.top-i.value.bottom,width:r.value.width-i.value.left-i.value.right,fill:"#FFFFFF"},null,8,ae),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(o,u)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${u}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:r.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:t.value.style.chart.graduations.gradient.show?`url(#vueUiThermometerGradient_${u}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,se),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ne)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ue)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x+2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ie)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x+2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ce)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.right,x2:r.value.right-10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,de)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:r.value.right,x2:r.value.right-5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,he)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:r.value.right,x2:r.value.right-2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ve)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:r.value.right,x2:r.value.right-2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,me)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("rect",{class:e.normalizeClass({"vue-ui-thermometer-temperature":t.value.style.chart.animation.use}),x:r.value.left,y:r.value.top,height:x.value,width:r.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,ye)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:x.value+r.value.top+t.value.style.chart.label.fontSize/3,x:r.value.left-10,"text-anchor":"end",fill:t.value.style.chart.label.color,"font-size":t.value.style.chart.label.fontSize,"font-weight":t.value.style.chart.label.bold?"bold":"normal"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.label.formatter,m.dataset.value,e.unref(s.dataLabel)({p:t.value.style.chart.label.prefix,v:m.dataset.value,s:t.value.style.chart.label.suffix,r:t.value.style.chart.label.rounding}),{datapoint:m.dataset})),11,pe),e.renderSlot(l.$slots,"svg",{svg:Y.value},void 0,!0)],14,K)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",fe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(B)||e.unref(N)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(D.default,{key:4,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],14,X))}},ke=R._export_sfc(ge,[["__scopeId","data-v-1375e978"]]);exports.default=ke;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ref as d, onMounted as q, onBeforeUnmount as J, computed as D, openBlock as r, createElementBlock as u, normalizeStyle as f, createVNode as _, createCommentVNode as p, unref as K, createElementVNode as M, mergeProps as E, renderSlot as N, normalizeProps as j, guardReactiveProps as B, toDisplayString as Q } from "vue";
|
|
2
|
-
import { u as Y } from "./useNestedProp-
|
|
3
|
-
import { u as Z, c as ee, X as te, C as O } from "./index-
|
|
2
|
+
import { u as Y } from "./useNestedProp-DE-a5lMx.js";
|
|
3
|
+
import { u as Z, c as ee, X as te, C as O } from "./index-8Lp8V0TB.js";
|
|
4
4
|
import { t as ae, u as se } from "./useResponsive-NZB-WLRF.js";
|
|
5
|
-
import x from "./BaseIcon-
|
|
6
|
-
import { _ as le } from "./Title-
|
|
5
|
+
import x from "./BaseIcon-BoVYVkUT.js";
|
|
6
|
+
import { _ as le } from "./Title-0px6u9U5.js";
|
|
7
7
|
import { _ as oe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
class re {
|
|
9
9
|
constructor(F, w, I, z = !0, C = !0) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),F=require("./useNestedProp-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),F=require("./useNestedProp-Vjg1xsU_.cjs"),w=require("./index-De6Dj52h.cjs"),z=require("./useResponsive-B3TrDDIG.cjs"),b=require("./BaseIcon-DuVD-1qH.cjs"),H=require("./Title-CSRD5z1r.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class L{constructor(N,p,_,T=!0,g=!0){this.interval=p,this.elapsed=0,this.isPaused=!1;const C=`
|
|
2
2
|
let interval;
|
|
3
3
|
let elapsed = 0;
|
|
4
4
|
let paused = false;
|