vue-data-ui 2.6.36 → 2.6.38
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-N2GJrlZ5.cjs → Arrow-DH-nqfuu.cjs} +1 -1
- package/dist/{Arrow-gL2x8gBV.js → Arrow-xcaRkI_P.js} +1 -1
- package/dist/{BaseIcon-BeYtmHYP.js → BaseIcon-CCOXJ43P.js} +1 -1
- package/dist/{BaseIcon-CKGrammw.cjs → BaseIcon-Dhgv4Qgl.cjs} +1 -1
- package/dist/{ColorPicker-DnxHVSYm.cjs → ColorPicker-DdX3Ab75.cjs} +1 -1
- package/dist/{ColorPicker-Ci1h5-O2.js → ColorPicker-DwgQNiHO.js} +3 -3
- package/dist/{DataTable-CzdnyXwf.js → DataTable--Aq5n5mR.js} +2 -2
- package/dist/{DataTable-D8BtUoMR.cjs → DataTable-DhEDo7W6.cjs} +1 -1
- package/dist/{Legend-DIS7P475.cjs → Legend-2PWaf6Bj.cjs} +1 -1
- package/dist/{Legend-DlmKiU2-.js → Legend-BbSQMgm3.js} +2 -2
- package/dist/{PackageVersion-D3YmcdiE.js → PackageVersion-CZ0-Jk6A.js} +1 -1
- package/dist/{PackageVersion-BO8DjgSz.cjs → PackageVersion-DdCp9lqS.cjs} +1 -1
- package/dist/{PenAndPaper-CcfHGdzR.cjs → PenAndPaper-4dibNTrE.cjs} +1 -1
- package/dist/{PenAndPaper-Dp6WplHM.js → PenAndPaper-BFkX-O1c.js} +3 -3
- package/dist/{Shape-L4y8ots7.cjs → Shape-Ba8jxKwR.cjs} +1 -1
- package/dist/{Shape-B0AhdeF9.js → Shape-CxNXalS-.js} +1 -1
- package/dist/{Slicer-alO3bh4c.js → Slicer-m9Y8-Ul1.js} +2 -2
- package/dist/{Slicer-B9K_7oxI.cjs → Slicer-rJxCx_c3.cjs} +1 -1
- package/dist/{Title-Bl_liOmz.cjs → Title-BGQhFU2C.cjs} +1 -1
- package/dist/{Title-piAm9Tnd.js → Title-xPTli3hs.js} +1 -1
- package/dist/{Tooltip-CFY5zGjZ.cjs → Tooltip-CnSZ7sO1.cjs} +1 -1
- package/dist/{Tooltip-cN2TpnrW.js → Tooltip-D42o7dze.js} +1 -1
- package/dist/{index-D7Ewdm4E.js → index-BsIlHNy8.js} +41 -22
- package/dist/index-CtzlfT2i.cjs +9 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +19 -0
- package/dist/types/vue-data-ui.d.ts +19 -0
- package/dist/{useNestedProp-DRJssOTC.cjs → useNestedProp-B5jFEsaz.cjs} +1 -1
- package/dist/{useNestedProp-C8VbY0xY.js → useNestedProp-CyyJlG5K.js} +1 -1
- package/dist/{usePrinter-DuhxcNIN.js → usePrinter-D5N6w7Rg.js} +1 -1
- package/dist/{usePrinter-BxutFFjw.cjs → usePrinter-LlH3giBA.cjs} +1 -1
- package/dist/{vue-data-ui-DXuMkWTC.js → vue-data-ui-BLYRqJkx.js} +61 -61
- package/dist/{vue-data-ui-DJOzOOXH.cjs → vue-data-ui-Ba8lztG5.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-BLSl2tDn.cjs → vue-ui-3d-bar-BGJLygG0.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-CJkVltOV.js → vue-ui-3d-bar-BJZ5zSaf.js} +9 -9
- package/dist/{vue-ui-accordion-ySvYUHFf.js → vue-ui-accordion-COi2Xtsr.js} +3 -3
- package/dist/{vue-ui-accordion-CtgNWNEP.cjs → vue-ui-accordion-tUPDXqYS.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-iM6u-9Ma.cjs → vue-ui-age-pyramid-2Fxcq3FV.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-jHBz2IVM.js → vue-ui-age-pyramid-k5Fu7j2-.js} +10 -10
- package/dist/{vue-ui-annotator-B4pfkWCP.js → vue-ui-annotator-BZ0Yy6ia.js} +1 -1
- package/dist/{vue-ui-annotator-DpS13K21.cjs → vue-ui-annotator-MPzfaArN.cjs} +1 -1
- package/dist/{vue-ui-bullet-DVJzVi6v.cjs → vue-ui-bullet-CQ7tn9wm.cjs} +1 -1
- package/dist/{vue-ui-bullet-Dr3oGjcd.js → vue-ui-bullet-u2ESqCXp.js} +8 -8
- package/dist/{vue-ui-candlestick-CokeFE_v.cjs → vue-ui-candlestick-4-kNBi7o.cjs} +1 -1
- package/dist/{vue-ui-candlestick-BxAxfhIT.js → vue-ui-candlestick-CwJ_u0fV.js} +11 -11
- package/dist/{vue-ui-carousel-table-Bajl3mg-.js → vue-ui-carousel-table-BoC8-DRG.js} +4 -4
- package/dist/{vue-ui-carousel-table-LYGNkIOD.cjs → vue-ui-carousel-table-C0_aau0U.cjs} +1 -1
- package/dist/{vue-ui-chestnut-mDJHkFXO.cjs → vue-ui-chestnut-C7fb69a8.cjs} +1 -1
- package/dist/{vue-ui-chestnut-CB793NSQ.js → vue-ui-chestnut-DPuTvEo_.js} +8 -8
- package/dist/{vue-ui-circle-pack-DwqiOLoh.cjs → vue-ui-circle-pack-DDQON0rO.cjs} +1 -1
- package/dist/{vue-ui-circle-pack-CPRsncLh.js → vue-ui-circle-pack-_hLdrihN.js} +9 -9
- package/dist/{vue-ui-cursor-B4mdSJZh.js → vue-ui-cursor-BWDfw2Ie.js} +2 -2
- package/dist/{vue-ui-cursor-D5Ii40BK.cjs → vue-ui-cursor-gcJigUgC.cjs} +1 -1
- package/dist/{vue-ui-dashboard-XbXml9zX.js → vue-ui-dashboard-BkGZ-fol.js} +2 -2
- package/dist/{vue-ui-dashboard-CMpfKMTh.cjs → vue-ui-dashboard-DesRs2ZI.cjs} +1 -1
- package/dist/{vue-ui-digits-BTCU_FMZ.js → vue-ui-digits-BTsRKOh6.js} +2 -2
- package/dist/{vue-ui-digits-BiaPI1za.cjs → vue-ui-digits-D7S2s6dm.cjs} +1 -1
- package/dist/{vue-ui-donut-BZZ66joN.cjs → vue-ui-donut-C8YIBga9.cjs} +1 -1
- package/dist/{vue-ui-donut-BxqtuaoC.js → vue-ui-donut-CHFJ4llc.js} +12 -12
- package/dist/{vue-ui-donut-evolution-BpQMtoLc.cjs → vue-ui-donut-evolution-Dpvf2iFq.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-kNH3n2fH.js → vue-ui-donut-evolution-Du7EzpBa.js} +11 -11
- package/dist/{vue-ui-dumbbell-BWviTcM9.cjs → vue-ui-dumbbell-D52rmaD-.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-lFN2RAWw.js → vue-ui-dumbbell-D_ZrpG52.js} +10 -10
- package/dist/{vue-ui-flow-DX7Fs1BI.cjs → vue-ui-flow-CR8zPj0k.cjs} +1 -1
- package/dist/{vue-ui-flow-C66HjSFo.js → vue-ui-flow-EOVRHoOo.js} +9 -9
- package/dist/{vue-ui-funnel-lsOuqc3g.js → vue-ui-funnel-BeEfwpch.js} +9 -9
- package/dist/{vue-ui-funnel-WL0WKRum.cjs → vue-ui-funnel-DttSlnhO.cjs} +1 -1
- package/dist/{vue-ui-galaxy-CrYwVVFY.cjs → vue-ui-galaxy-BiG7_RQM.cjs} +1 -1
- package/dist/{vue-ui-galaxy-Bt6u8odG.js → vue-ui-galaxy-CV_lO5aH.js} +11 -11
- package/dist/{vue-ui-gauge-D2NcZ0JK.js → vue-ui-gauge-DLN6zs3X.js} +7 -7
- package/dist/{vue-ui-gauge-D1mAs9p0.cjs → vue-ui-gauge-DcTEz7z0.cjs} +1 -1
- package/dist/{vue-ui-gizmo-D1Au9pal.cjs → vue-ui-gizmo-DB55cesa.cjs} +1 -1
- package/dist/{vue-ui-gizmo-D1FliTrf.js → vue-ui-gizmo-G1WtSE2E.js} +3 -3
- package/dist/vue-ui-heatmap-BdWCJv-X.js +853 -0
- package/dist/vue-ui-heatmap-D2mxryA0.cjs +1 -0
- package/dist/{vue-ui-history-plot-XO5ZKDNX.cjs → vue-ui-history-plot-B1UvPHEt.cjs} +1 -1
- package/dist/{vue-ui-history-plot-b7PwRPRf.js → vue-ui-history-plot-Bch7yEUY.js} +11 -11
- package/dist/{vue-ui-kpi-C4zF2o6a.js → vue-ui-kpi-B9HqS8K-.js} +3 -3
- package/dist/{vue-ui-kpi-DneC8BkA.cjs → vue-ui-kpi-D_x-1qay.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-DlrrjOiN.cjs → vue-ui-mini-loader-CVUQ6Jdq.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-1B_5M3k4.js → vue-ui-mini-loader-sTAHynyd.js} +2 -2
- package/dist/{vue-ui-molecule-D2Movk5N.js → vue-ui-molecule-CBY0mkv6.js} +10 -10
- package/dist/{vue-ui-molecule-BX7U1WTo.cjs → vue-ui-molecule-CzV5mFr9.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-DQa9BahX.js → vue-ui-mood-radar-0l5kOwOS.js} +11 -11
- package/dist/{vue-ui-mood-radar-D2uAfuwm.cjs → vue-ui-mood-radar-CjZZdlwC.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-Cggv-zeT.js → vue-ui-nested-donuts-CaMgxVbA.js} +11 -11
- package/dist/{vue-ui-nested-donuts-BBvwAf7R.cjs → vue-ui-nested-donuts-DmAwQmwD.cjs} +1 -1
- package/dist/{vue-ui-onion-BD3r54OZ.js → vue-ui-onion-LcKtpoza.js} +11 -11
- package/dist/{vue-ui-onion-BXZIEMVN.cjs → vue-ui-onion-dzs4bSVa.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-CJikL6gT.cjs → vue-ui-parallel-coordinate-plot-BF8Erw_q.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-uZvEbgR2.js → vue-ui-parallel-coordinate-plot-BNLSWVnA.js} +12 -12
- package/dist/{vue-ui-quadrant-ChMILvlU.js → vue-ui-quadrant-DNIbdRlI.js} +12 -12
- package/dist/{vue-ui-quadrant-P2-ZkSQP.cjs → vue-ui-quadrant-DQgc8mxK.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-BIndXg0D.js → vue-ui-quick-chart-Bd2xUcYS.js} +9 -9
- package/dist/{vue-ui-quick-chart-vav6olrR.cjs → vue-ui-quick-chart-DD6Dgaf_.cjs} +1 -1
- package/dist/{vue-ui-radar-DARcNkq9.js → vue-ui-radar-CO7-BuKy.js} +12 -12
- package/dist/{vue-ui-radar-BkPF3Jeu.cjs → vue-ui-radar-D0aFz3M1.cjs} +1 -1
- package/dist/{vue-ui-rating-3-i3OH4l.js → vue-ui-rating-BXw-c2re.js} +2 -2
- package/dist/{vue-ui-rating-Bxv4df9w.cjs → vue-ui-rating-DBQcGPBa.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-zNLV1U2L.js → vue-ui-relation-circle-BVEursNY.js} +7 -7
- package/dist/{vue-ui-relation-circle-CMbFOjlL.cjs → vue-ui-relation-circle-CrCtoGdS.cjs} +1 -1
- package/dist/{vue-ui-rings-CtG_3iHa.cjs → vue-ui-rings-B_NxR1q-.cjs} +1 -1
- package/dist/{vue-ui-rings-BFeGt1zp.js → vue-ui-rings-DW_FdNSK.js} +12 -12
- package/dist/{vue-ui-scatter-DMPBaoxy.cjs → vue-ui-scatter-Bly8ezts.cjs} +1 -1
- package/dist/{vue-ui-scatter-DUPlxrBM.js → vue-ui-scatter-CNltzVkT.js} +12 -12
- package/dist/{vue-ui-screenshot-Co3A5NRW.cjs → vue-ui-screenshot-B3_3bmXo.cjs} +1 -1
- package/dist/{vue-ui-screenshot-DRx_J0ja.js → vue-ui-screenshot-iEAAudBg.js} +1 -1
- package/dist/{vue-ui-skeleton-xKlKI0a0.js → vue-ui-skeleton-DApuwwZF.js} +3 -3
- package/dist/{vue-ui-skeleton-BLaR1CnV.cjs → vue-ui-skeleton-MFudy6Nx.cjs} +1 -1
- package/dist/{vue-ui-smiley-CEOeQC3U.js → vue-ui-smiley-C-RH5eaS.js} +2 -2
- package/dist/{vue-ui-smiley-D8kwZ46X.cjs → vue-ui-smiley-D17Lq5EM.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-CWz13Uvn.js → vue-ui-spark-trend-CY_5HSpU.js} +5 -5
- package/dist/{vue-ui-spark-trend-BZUODh_y.cjs → vue-ui-spark-trend-q3XeHnoN.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-CShtXDO2.js → vue-ui-sparkbar-DSsaunzO.js} +4 -4
- package/dist/{vue-ui-sparkbar-DYcWTih2.cjs → vue-ui-sparkbar-FsR-gK2w.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-DsdWEp_U.cjs → vue-ui-sparkgauge-BBBk29g7.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-B5PjkMMc.js → vue-ui-sparkgauge-DS_jMTUO.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-BnWykleJ.cjs → vue-ui-sparkhistogram-BFd0lABr.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-DHgPrCp6.js → vue-ui-sparkhistogram-D_gxEiyc.js} +5 -5
- package/dist/{vue-ui-sparkline-BQPpJkzd.js → vue-ui-sparkline-BJBtHg1Z.js} +4 -4
- package/dist/{vue-ui-sparkline-DOPInRh9.cjs → vue-ui-sparkline-BQhNHjjY.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-BIb9AMmJ.cjs → vue-ui-sparkstackbar-D8i69QTv.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-xV1Z0YvP.js → vue-ui-sparkstackbar-sk6RTxgo.js} +5 -5
- package/dist/{vue-ui-stackbar-zggYEepp.cjs → vue-ui-stackbar-BxbovsxZ.cjs} +1 -1
- package/dist/{vue-ui-stackbar-YLypx-MG.js → vue-ui-stackbar-usPJtqEt.js} +13 -13
- package/dist/{vue-ui-strip-plot-6HPRyTMm.js → vue-ui-strip-plot-Y_MY3klS.js} +11 -11
- package/dist/{vue-ui-strip-plot-DLbUrTCO.cjs → vue-ui-strip-plot-xeKRF2hz.cjs} +1 -1
- package/dist/{vue-ui-table-DnZgJLEZ.js → vue-ui-table-CiYMFIvc.js} +1 -1
- package/dist/{vue-ui-table-C_doFZgt.cjs → vue-ui-table-gdZlpeCl.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-D4-15I10.js → vue-ui-table-heatmap-E_W8ydlD.js} +4 -4
- package/dist/{vue-ui-table-heatmap-C63mns1l.cjs → vue-ui-table-heatmap-RAhNv1Yt.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-MKRsBbm1.cjs → vue-ui-table-sparkline-BoW8p8nM.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-LfQUNNiv.js → vue-ui-table-sparkline-qnUHp7_y.js} +5 -5
- package/dist/{vue-ui-thermometer-DwS-Oa-u.js → vue-ui-thermometer-B1pc1sTh.js} +7 -7
- package/dist/{vue-ui-thermometer-DNqcKOLp.cjs → vue-ui-thermometer-Cgknp6e4.cjs} +1 -1
- package/dist/{vue-ui-timer-Ctk6g3hd.js → vue-ui-timer-aBhtv50v.js} +5 -5
- package/dist/{vue-ui-timer-bL33Olqk.cjs → vue-ui-timer-artBhlnJ.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-HcQb6R3A.cjs → vue-ui-tiremarks-BzacI8bL.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-Cxg-9Zea.js → vue-ui-tiremarks-DiWKoU3P.js} +7 -7
- package/dist/{vue-ui-treemap-Dp9X6on1.cjs → vue-ui-treemap-CQaOFvON.cjs} +1 -1
- package/dist/{vue-ui-treemap-DxYk1DWA.js → vue-ui-treemap-gTJuFH2s.js} +11 -11
- package/dist/{vue-ui-vertical-bar-BLaZPh-V.js → vue-ui-vertical-bar-BBuDOBoW.js} +12 -12
- package/dist/{vue-ui-vertical-bar-WOIy7ko_.cjs → vue-ui-vertical-bar-CmhO5QXM.cjs} +1 -1
- package/dist/{vue-ui-waffle-DbP7wRRF.js → vue-ui-waffle-BL0NYWzA.js} +12 -12
- package/dist/{vue-ui-waffle-DlCT2jB9.cjs → vue-ui-waffle-BSelvhkc.cjs} +1 -1
- package/dist/{vue-ui-wheel-DTqfeQ4i.cjs → vue-ui-wheel-6MfSLLjP.cjs} +1 -1
- package/dist/{vue-ui-wheel-D1pRUGqU.js → vue-ui-wheel-Di-LA-Pk.js} +7 -7
- package/dist/{vue-ui-word-cloud-N6eYDJtR.js → vue-ui-word-cloud-CIL5uwJc.js} +10 -10
- package/dist/{vue-ui-word-cloud-DM6dHiiN.cjs → vue-ui-word-cloud-cO7rCys5.cjs} +1 -1
- package/dist/{vue-ui-xy-Dfz8T77S.js → vue-ui-xy-Caw1sPOs.js} +17 -17
- package/dist/vue-ui-xy-HQqWXfCj.cjs +3 -0
- package/dist/{vue-ui-xy-canvas-CP8-xr3t.js → vue-ui-xy-canvas-CO_1a0bx.js} +12 -12
- package/dist/{vue-ui-xy-canvas-BWGsDEfm.cjs → vue-ui-xy-canvas-CZffRCNl.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-Ce9ZD8zz.cjs +0 -9
- package/dist/vue-ui-heatmap-BIkcoCBo.js +0 -748
- package/dist/vue-ui-heatmap-CWnkF0Ea.cjs +0 -1
- package/dist/vue-ui-xy-CZo_tphg.cjs +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-Ce9ZD8zz.cjs"),Y=require("./useNestedProp-DRJssOTC.cjs"),ce=require("./vue-ui-sparkline-DOPInRh9.cjs"),x=require("./BaseIcon-CKGrammw.cjs"),D=require("./usePrinter-BxutFFjw.cjs"),ve=require("./useUserOptionState-BgepsfED.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=["id"],fe={style:{"z-index":"1","padding-right":"24px"}},ye={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},ge={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},be=["onClick"],ke=["onClick"],he=["data-cell"],Se=["data-cell","onPointerenter"],Ce=["data-cell"],_e=["data-cell"],xe=["data-cell"],we=["data-cell"],Ne={key:1,ref:"source",dir:"auto"},ze={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(Z,{expose:ee}){e.useCssVars(l=>({"5bf76bd6":l.tdo}));const{vue_ui_table_sparkline:te}=s.useConfig(),y=Z,w=e.ref(s.createUid()),$=e.ref(0),N=e.ref(0),z=e.ref(null),le=e.useSlots();e.onMounted(()=>{le["chart-background"]&&console.warn("VueUiTableSparkline does not support the #chart-background slot.")});const t=e.computed({get:()=>T(),set:l=>l}),{userOptionsVisible:V,setUserOptionsVisibility:P,keepUserOptionState:F}=ve.useUserOptionState({config:t.value});function T(){const l=Y.useNestedProp({userConfig:y.config,defaultConfig:te});return l.theme?{...Y.useNestedProp({userConfig:s.themes.vue_ui_table_sparkline[l.theme]||y.config,defaultConfig:l}),customPalette:s.themePalettes[l.theme]||s.palette}:l}e.watch(()=>y.config,l=>{t.value=T(),V.value=!t.value.userOptions.showOnChartHover,q(),N.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{c.value=h.value,N.value+=1},{deep:!0});const{isPrinting:M,isImaging:W,generatePdf:L,generateImage:U}=D.usePrinter({elementId:`table_${w.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline"}),ae=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),C=e.ref(null),I=e.ref(!1),oe=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{q()});const B=e.ref(t.value.colNames);function q(){s.objectIsEmpty(y.dataset)&&s.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(o=>{o.forEach(a=>{I.value=a.contentRect.width<oe.value})});C.value&&l.observe(C.value),B.value=[];for(let o=0;o<R.value;o+=1)B.value.push(t.value.colNames[o]||`col ${o}`)}const G=e.computed(()=>(y.dataset.forEach((l,o)=>{s.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{s.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:o})})}),y.dataset.map((l,o)=>{const a=(l.values||[]).map(d=>isNaN(d)?0:d??0),n=a.reduce((d,i)=>d+i,0),u=n/a.length,r=s.calcMedian(a);return{...l,values:l.values||[],color:s.convertColorToHex(l.color)||ae.value[o]||s.palette[o]||s.palette[o%s.palette.length],sum:n,average:u,median:r,sparklineDataset:a.map((d,i)=>({period:t.value.colNames[i]||`col ${i}`,value:d||0}))}})));function ne(l){const a=(l[0].values||[]).map((u,r)=>l.map(d=>d.values[r]||[])).map(u=>u.map((r,d)=>[r,d]).sort((r,d)=>d[0]-r[0]).map(r=>r[1]));return l.map((u,r)=>({...u,values:u.values||[],orders:a[r]}))}const h=e.computed(()=>ne(G.value)),c=e.ref(h.value),re=e.computed(()=>Math.max(...c.value.map(l=>(l.values||[]).length))),E=e.ref(void 0),A=e.ref(!1),v=e.ref(void 0),H=e.ref(1);function k(){A.value=!1,v.value=void 0,p.value=void 0,H.value=1,S.value.forEach(l=>l.state=1),g.value={name:1,sum:1,average:1,median:1},c.value=h.value}function _(l,o,a){if(["name","sum","average","median"].includes(l.type)){ue(l.type,o,a);return}if(!J(o))return;if(b.value=o,p.value=void 0,![null,void 0].includes(v.value)&&o!==v.value&&(v.value=void 0,k()),S.value[o].state===a&&v.value===o){v.value=void 0,k();return}A.value=!0,v.value=o;const n=h.value.map(i=>i.values[o]||[]),u=a;S.value[o].state=u,H.value=u,o===E.value?E.value=void 0:E.value=o;const d=n.map((i,m)=>[m,i]).sort((i,m)=>u*(m[1]-i[1])).map(i=>i[0]).map(i=>h.value[i]);c.value=d,N.value+=1}const R=e.computed(()=>Math.max(...y.dataset.map(l=>(l.values||[]).length))),f=e.computed(()=>{let l=B.value.map(a=>({type:"reg",value:a}));if(!l.length)for(let a=0;a<R.value;a+=1)l.push({type:"reg",value:`col ${a+1}`});t.value.showTotal&&(l=[...l,{type:"sum",value:t.value.translations.total}]);let o;return t.value.showAverage&&t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average},{type:"median",value:t.value.translations.median}]:t.value.showAverage&&!t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average}]:!t.value.showAverage&&t.value.showMedian?o=[...l,{type:"median",value:t.value.translations.median}]:o=l,t.value.showSparklines?[...o,{type:"chart",value:t.value.translations.chart}]:o}),g=e.ref({name:1,sum:1,average:1,median:1}),p=e.ref(void 0);function ue(l,o,a){if(!c.value||c.value.length===0||!K(l))return;if(p.value!==l&&(p.value=void 0),![null,void 0].includes(v.value)&&o!==v.value&&k(),v.value=void 0,g.value[l]===a&&p.value){p.value=void 0,k();return}p.value=l,A.value=!0,g.value[l]=a,[null,void 0].includes(o)||(S.value[o].state=g.value[l]);const n=g.value[l],u=[...c.value].sort((r,d)=>{const i=r[l]??(typeof r[l]=="number"?0:""),m=d[l]??(typeof d[l]=="number"?0:"");return typeof i=="string"&&typeof m=="string"?n===-1?i.localeCompare(m):m.localeCompare(i):typeof i=="number"&&typeof m=="number"?n===-1?i-m:m-i:0});c.value=u}const b=e.ref(void 0),O=e.ref(void 0);function se({dataIndex:l,serieIndex:o}){b.value=l,O.value=o,z.value[l]&&!I.value&&z.value[l].scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}const X=e.ref(!1);function ie(l){X.value=l,$.value+=1}function j(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(f.value),o=G.value.map((u,r)=>[[u.name],u.values,[u.sum],[u.average],[u.median]]),a=[l].concat(o),n=s.createCsvContent(a);s.downloadCsv({csvContent:n,title:t.value.title.text||"vue-ui-table-sparkline"})})}function J(l){return t.value.sortedDataColumnIndices.includes(l)}function K(l){return l.type==="name"||l==="name"?t.value.sortedSeriesName:l.type==="sum"||l==="sum"?t.value.sortedSum:l.type==="average"||l==="average"?t.value.sortedAverage:l.type==="median"||l==="median"?t.value.sortedMedian:!1}function Q(l,o,a){return["sum","average","median"].includes(o.type)?p.value===o.type&&g.value[o.type]===a?1:.3:l===v.value&&S.value[l].state===a?1:.3}function de(){t.value.resetSortOnClickOutside&&k()}const S=e.computed({get:()=>f.value.map(l=>({state:1})),set:l=>l});return ee({generatePdf:L,generateImage:U,generateCsv:j,restoreOrder:k}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:C,class:e.normalizeClass({"vue-ui-table-sparkline":!0,"vue-ui-responsive":I.value}),style:{overflow:"hidden"},id:`table_${w.value}`,onMouseenter:o[3]||(o[3]=()=>e.unref(P)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(P)(!1))},[t.value.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-table-sparkline-caption",style:e.normalizeStyle({backgroundColor:t.value.title.backgroundColor})},[e.createElementVNode("div",{class:"atom-title",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,class:"atom-subtitle",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("div",{style:{overflow:"auto"},onPointerleave:o[2]||(o[2]=a=>{O.value=void 0,b.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[e.createElementVNode("thead",fe,[e.withDirectives((e.openBlock(),e.createElementBlock("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,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal"}),class:"sticky-col-first"},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(t.value.translations.serie),1),c.value.length>1&&t.value.sortedSeriesName?(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:o[0]||(o[0]=a=>_({type:"name"},null,-1))},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===-1?1:.3})},null,8,["stroke","style"])]),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:o[1]||(o[1]=a=>_({type:"name"},null,1))},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===1?1:.3})},null,8,["stroke","style"])])])):e.createCommentVNode("",!0)],4)],4),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,n)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",style:e.normalizeStyle({background:t.value.thead.backgroundColor,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal",minWidth:n===f.value.length-1?`${t.value.sparkline.dimensions.width}px`:"48px",paddingRight:n===f.value.length-1&&t.value.userOptions.show?"36px":""}),class:e.normalizeClass({"sticky-col":n===f.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(a.value),1),c.value.length>1&&(J(n)||K(a))?(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:()=>_(a,n,-1)},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,-1)})},null,8,["stroke","style"])],8,be),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:()=>_(a,n,1)},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,1)})},null,8,["stroke","style"])],8,ke)])):e.createCommentVNode("",!0)],4),t.value.userOptions.show&&n===f.value.length-1&&(e.unref(F)||e.unref(V))?(e.openBlock(),e.createBlock(D.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${$.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(M),isImaging:e.unref(W),uid:w.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:X.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,position:t.value.userOptions.position,onToggleFullscreen:ie,onGeneratePdf:e.unref(L),onGenerateImage:e.unref(U),onGenerateCsv:j,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(V)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:u,color:r})=>[e.renderSlot(l.$slots,"menuIcon",e.mergeProps({ref_for:!0},{isOpen:u,color:r}),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.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:u,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.mergeProps({ref_for:!0},{toggleFullscreen:u,isFullscreen:r}),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0)],6))),256))],4)),[[e.unref(D.vClickOutside),de]])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.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,border: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",{dir:"auto",style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"6px",justifyContent:t.value.tbody.textAlign})},[t.value.tbody.showColorMarker?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle({color:a.color})},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a.name??"-"),1)],4)],12,he),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(u,r)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",ref_for:!0,ref_key:"TD",ref:z,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,background:b.value!==void 0&&r===b.value?t.value.tbody.selectedColor.useSerieColor?`${a.color.length>7?a.color.slice(0,-2):a.color}33`:t.value.tbody.selectedColor.fallback:""}),"data-cell":f.value[r]?f.value[r].value:"",class:"vue-ui-data-table__tbody__td",onPointerenter:d=>{O.value=n,b.value=r}},e.toDisplayString([null,void 0].includes(a.values[r])?"-":e.unref(s.applyDataLabel)(t.value.formatter,Number(a.values[r]),e.unref(s.dataLabel)({p:t.value.prefix,v:Number(a.values[r]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:n,datapointIndex:r})),45,Se))),256)),t.value.showTotal?(e.openBlock(),e.createElementBlock("td",{key:0,dir:"auto",role:"cell",style:e.normalizeStyle({border: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(s.applyDataLabel)(t.value.formatter,a.sum,e.unref(s.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:n})),13,Ce)):e.createCommentVNode("",!0),t.value.showAverage?(e.openBlock(),e.createElementBlock("td",{key:1,dir:"auto",role:"cell",style:e.normalizeStyle({border: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(s.applyDataLabel)(t.value.formatter,a.average,e.unref(s.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:n})),13,_e)):e.createCommentVNode("",!0),t.value.showMedian?(e.openBlock(),e.createElementBlock("td",{key:2,dir:"auto",role:"cell",style:e.normalizeStyle({border: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(s.applyDataLabel)(t.value.formatter,a.median,e.unref(s.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:n})),13,xe)):e.createCommentVNode("",!0),t.value.showSparklines?(e.openBlock(),e.createElementBlock("td",{key:3,role:"cell","data-cell":t.value.translations.chart,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,backgroundColor:t.value.tbody.backgroundColor,padding:"0"}),class:"vue-ui-data-table__tbody__td sticky-col"},[e.createVNode(ce.default,{onHoverIndex:({index:u})=>se({dataIndex:u,serieIndex:n}),"height-ratio":t.value.sparkline.dimensions.heightRatio,"forced-padding":30,dataset:a.sparklineDataset,showInfo:!1,selectedIndex:b.value,config:{type:t.value.sparkline.type,style:{backgroundColor:"transparent",animation:{show:t.value.sparkline.animation.show&&!e.unref(M)&&!e.unref(W),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","height-ratio","dataset","selectedIndex","config"])],12,we)):e.createCommentVNode("",!0)],6))),256))])],4)],32),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Ne,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],42,me))}},Ve=pe._export_sfc(ze,[["__scopeId","data-v-938176cd"]]);exports.default=Ve;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-CtzlfT2i.cjs"),Y=require("./useNestedProp-B5jFEsaz.cjs"),ce=require("./vue-ui-sparkline-BQhNHjjY.cjs"),x=require("./BaseIcon-Dhgv4Qgl.cjs"),D=require("./usePrinter-LlH3giBA.cjs"),ve=require("./useUserOptionState-BgepsfED.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=["id"],fe={style:{"z-index":"1","padding-right":"24px"}},ye={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},ge={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},be=["onClick"],ke=["onClick"],he=["data-cell"],Se=["data-cell","onPointerenter"],Ce=["data-cell"],_e=["data-cell"],xe=["data-cell"],we=["data-cell"],Ne={key:1,ref:"source",dir:"auto"},ze={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(Z,{expose:ee}){e.useCssVars(l=>({"5bf76bd6":l.tdo}));const{vue_ui_table_sparkline:te}=s.useConfig(),y=Z,w=e.ref(s.createUid()),$=e.ref(0),N=e.ref(0),z=e.ref(null),le=e.useSlots();e.onMounted(()=>{le["chart-background"]&&console.warn("VueUiTableSparkline does not support the #chart-background slot.")});const t=e.computed({get:()=>T(),set:l=>l}),{userOptionsVisible:V,setUserOptionsVisibility:P,keepUserOptionState:F}=ve.useUserOptionState({config:t.value});function T(){const l=Y.useNestedProp({userConfig:y.config,defaultConfig:te});return l.theme?{...Y.useNestedProp({userConfig:s.themes.vue_ui_table_sparkline[l.theme]||y.config,defaultConfig:l}),customPalette:s.themePalettes[l.theme]||s.palette}:l}e.watch(()=>y.config,l=>{t.value=T(),V.value=!t.value.userOptions.showOnChartHover,q(),N.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{c.value=h.value,N.value+=1},{deep:!0});const{isPrinting:M,isImaging:W,generatePdf:L,generateImage:U}=D.usePrinter({elementId:`table_${w.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline"}),ae=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),C=e.ref(null),I=e.ref(!1),oe=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{q()});const B=e.ref(t.value.colNames);function q(){s.objectIsEmpty(y.dataset)&&s.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(o=>{o.forEach(a=>{I.value=a.contentRect.width<oe.value})});C.value&&l.observe(C.value),B.value=[];for(let o=0;o<R.value;o+=1)B.value.push(t.value.colNames[o]||`col ${o}`)}const G=e.computed(()=>(y.dataset.forEach((l,o)=>{s.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{s.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:o})})}),y.dataset.map((l,o)=>{const a=(l.values||[]).map(d=>isNaN(d)?0:d??0),n=a.reduce((d,i)=>d+i,0),u=n/a.length,r=s.calcMedian(a);return{...l,values:l.values||[],color:s.convertColorToHex(l.color)||ae.value[o]||s.palette[o]||s.palette[o%s.palette.length],sum:n,average:u,median:r,sparklineDataset:a.map((d,i)=>({period:t.value.colNames[i]||`col ${i}`,value:d||0}))}})));function ne(l){const a=(l[0].values||[]).map((u,r)=>l.map(d=>d.values[r]||[])).map(u=>u.map((r,d)=>[r,d]).sort((r,d)=>d[0]-r[0]).map(r=>r[1]));return l.map((u,r)=>({...u,values:u.values||[],orders:a[r]}))}const h=e.computed(()=>ne(G.value)),c=e.ref(h.value),re=e.computed(()=>Math.max(...c.value.map(l=>(l.values||[]).length))),E=e.ref(void 0),A=e.ref(!1),v=e.ref(void 0),H=e.ref(1);function k(){A.value=!1,v.value=void 0,p.value=void 0,H.value=1,S.value.forEach(l=>l.state=1),g.value={name:1,sum:1,average:1,median:1},c.value=h.value}function _(l,o,a){if(["name","sum","average","median"].includes(l.type)){ue(l.type,o,a);return}if(!J(o))return;if(b.value=o,p.value=void 0,![null,void 0].includes(v.value)&&o!==v.value&&(v.value=void 0,k()),S.value[o].state===a&&v.value===o){v.value=void 0,k();return}A.value=!0,v.value=o;const n=h.value.map(i=>i.values[o]||[]),u=a;S.value[o].state=u,H.value=u,o===E.value?E.value=void 0:E.value=o;const d=n.map((i,m)=>[m,i]).sort((i,m)=>u*(m[1]-i[1])).map(i=>i[0]).map(i=>h.value[i]);c.value=d,N.value+=1}const R=e.computed(()=>Math.max(...y.dataset.map(l=>(l.values||[]).length))),f=e.computed(()=>{let l=B.value.map(a=>({type:"reg",value:a}));if(!l.length)for(let a=0;a<R.value;a+=1)l.push({type:"reg",value:`col ${a+1}`});t.value.showTotal&&(l=[...l,{type:"sum",value:t.value.translations.total}]);let o;return t.value.showAverage&&t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average},{type:"median",value:t.value.translations.median}]:t.value.showAverage&&!t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average}]:!t.value.showAverage&&t.value.showMedian?o=[...l,{type:"median",value:t.value.translations.median}]:o=l,t.value.showSparklines?[...o,{type:"chart",value:t.value.translations.chart}]:o}),g=e.ref({name:1,sum:1,average:1,median:1}),p=e.ref(void 0);function ue(l,o,a){if(!c.value||c.value.length===0||!K(l))return;if(p.value!==l&&(p.value=void 0),![null,void 0].includes(v.value)&&o!==v.value&&k(),v.value=void 0,g.value[l]===a&&p.value){p.value=void 0,k();return}p.value=l,A.value=!0,g.value[l]=a,[null,void 0].includes(o)||(S.value[o].state=g.value[l]);const n=g.value[l],u=[...c.value].sort((r,d)=>{const i=r[l]??(typeof r[l]=="number"?0:""),m=d[l]??(typeof d[l]=="number"?0:"");return typeof i=="string"&&typeof m=="string"?n===-1?i.localeCompare(m):m.localeCompare(i):typeof i=="number"&&typeof m=="number"?n===-1?i-m:m-i:0});c.value=u}const b=e.ref(void 0),O=e.ref(void 0);function se({dataIndex:l,serieIndex:o}){b.value=l,O.value=o,z.value[l]&&!I.value&&z.value[l].scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}const X=e.ref(!1);function ie(l){X.value=l,$.value+=1}function j(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(f.value),o=G.value.map((u,r)=>[[u.name],u.values,[u.sum],[u.average],[u.median]]),a=[l].concat(o),n=s.createCsvContent(a);s.downloadCsv({csvContent:n,title:t.value.title.text||"vue-ui-table-sparkline"})})}function J(l){return t.value.sortedDataColumnIndices.includes(l)}function K(l){return l.type==="name"||l==="name"?t.value.sortedSeriesName:l.type==="sum"||l==="sum"?t.value.sortedSum:l.type==="average"||l==="average"?t.value.sortedAverage:l.type==="median"||l==="median"?t.value.sortedMedian:!1}function Q(l,o,a){return["sum","average","median"].includes(o.type)?p.value===o.type&&g.value[o.type]===a?1:.3:l===v.value&&S.value[l].state===a?1:.3}function de(){t.value.resetSortOnClickOutside&&k()}const S=e.computed({get:()=>f.value.map(l=>({state:1})),set:l=>l});return ee({generatePdf:L,generateImage:U,generateCsv:j,restoreOrder:k}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:C,class:e.normalizeClass({"vue-ui-table-sparkline":!0,"vue-ui-responsive":I.value}),style:{overflow:"hidden"},id:`table_${w.value}`,onMouseenter:o[3]||(o[3]=()=>e.unref(P)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(P)(!1))},[t.value.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-table-sparkline-caption",style:e.normalizeStyle({backgroundColor:t.value.title.backgroundColor})},[e.createElementVNode("div",{class:"atom-title",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,class:"atom-subtitle",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("div",{style:{overflow:"auto"},onPointerleave:o[2]||(o[2]=a=>{O.value=void 0,b.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[e.createElementVNode("thead",fe,[e.withDirectives((e.openBlock(),e.createElementBlock("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,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal"}),class:"sticky-col-first"},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(t.value.translations.serie),1),c.value.length>1&&t.value.sortedSeriesName?(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:o[0]||(o[0]=a=>_({type:"name"},null,-1))},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===-1?1:.3})},null,8,["stroke","style"])]),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:o[1]||(o[1]=a=>_({type:"name"},null,1))},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===1?1:.3})},null,8,["stroke","style"])])])):e.createCommentVNode("",!0)],4)],4),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,n)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",style:e.normalizeStyle({background:t.value.thead.backgroundColor,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal",minWidth:n===f.value.length-1?`${t.value.sparkline.dimensions.width}px`:"48px",paddingRight:n===f.value.length-1&&t.value.userOptions.show?"36px":""}),class:e.normalizeClass({"sticky-col":n===f.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(a.value),1),c.value.length>1&&(J(n)||K(a))?(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:()=>_(a,n,-1)},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,-1)})},null,8,["stroke","style"])],8,be),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:()=>_(a,n,1)},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,1)})},null,8,["stroke","style"])],8,ke)])):e.createCommentVNode("",!0)],4),t.value.userOptions.show&&n===f.value.length-1&&(e.unref(F)||e.unref(V))?(e.openBlock(),e.createBlock(D.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${$.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(M),isImaging:e.unref(W),uid:w.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:X.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,position:t.value.userOptions.position,onToggleFullscreen:ie,onGeneratePdf:e.unref(L),onGenerateImage:e.unref(U),onGenerateCsv:j,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(V)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:u,color:r})=>[e.renderSlot(l.$slots,"menuIcon",e.mergeProps({ref_for:!0},{isOpen:u,color:r}),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.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:u,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.mergeProps({ref_for:!0},{toggleFullscreen:u,isFullscreen:r}),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0)],6))),256))],4)),[[e.unref(D.vClickOutside),de]])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.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,border: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",{dir:"auto",style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"6px",justifyContent:t.value.tbody.textAlign})},[t.value.tbody.showColorMarker?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle({color:a.color})},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a.name??"-"),1)],4)],12,he),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(u,r)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",ref_for:!0,ref_key:"TD",ref:z,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,background:b.value!==void 0&&r===b.value?t.value.tbody.selectedColor.useSerieColor?`${a.color.length>7?a.color.slice(0,-2):a.color}33`:t.value.tbody.selectedColor.fallback:""}),"data-cell":f.value[r]?f.value[r].value:"",class:"vue-ui-data-table__tbody__td",onPointerenter:d=>{O.value=n,b.value=r}},e.toDisplayString([null,void 0].includes(a.values[r])?"-":e.unref(s.applyDataLabel)(t.value.formatter,Number(a.values[r]),e.unref(s.dataLabel)({p:t.value.prefix,v:Number(a.values[r]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:n,datapointIndex:r})),45,Se))),256)),t.value.showTotal?(e.openBlock(),e.createElementBlock("td",{key:0,dir:"auto",role:"cell",style:e.normalizeStyle({border: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(s.applyDataLabel)(t.value.formatter,a.sum,e.unref(s.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:n})),13,Ce)):e.createCommentVNode("",!0),t.value.showAverage?(e.openBlock(),e.createElementBlock("td",{key:1,dir:"auto",role:"cell",style:e.normalizeStyle({border: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(s.applyDataLabel)(t.value.formatter,a.average,e.unref(s.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:n})),13,_e)):e.createCommentVNode("",!0),t.value.showMedian?(e.openBlock(),e.createElementBlock("td",{key:2,dir:"auto",role:"cell",style:e.normalizeStyle({border: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(s.applyDataLabel)(t.value.formatter,a.median,e.unref(s.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:n})),13,xe)):e.createCommentVNode("",!0),t.value.showSparklines?(e.openBlock(),e.createElementBlock("td",{key:3,role:"cell","data-cell":t.value.translations.chart,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,backgroundColor:t.value.tbody.backgroundColor,padding:"0"}),class:"vue-ui-data-table__tbody__td sticky-col"},[e.createVNode(ce.default,{onHoverIndex:({index:u})=>se({dataIndex:u,serieIndex:n}),"height-ratio":t.value.sparkline.dimensions.heightRatio,"forced-padding":30,dataset:a.sparklineDataset,showInfo:!1,selectedIndex:b.value,config:{type:t.value.sparkline.type,style:{backgroundColor:"transparent",animation:{show:t.value.sparkline.animation.show&&!e.unref(M)&&!e.unref(W),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","height-ratio","dataset","selectedIndex","config"])],12,we)):e.createCommentVNode("",!0)],6))),256))])],4)],32),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Ne,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],42,me))}},Ve=pe._export_sfc(ze,[["__scopeId","data-v-938176cd"]]);exports.default=Ve;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useCssVars as ze, ref as p, useSlots as De, onMounted as pe, computed as _, watch as fe, createElementBlock as c, openBlock as d, unref as i, normalizeClass as X, createCommentVNode as g, createElementVNode as f, normalizeStyle as s, toDisplayString as C, withDirectives as Pe, createVNode as z, Fragment as J, renderList as K, createBlock as Ne, createSlots as Fe, withCtx as D, renderSlot as A, mergeProps as me, nextTick as Ve } from "vue";
|
|
2
|
-
import { u as Te, c as We, t as Me, p as F, a as Ee, b as Ue, o as Be, e as be, g as Ge, a3 as Le, d as Re, i as V, f as T, q as He, r as qe } from "./index-
|
|
3
|
-
import { u as ge } from "./useNestedProp-
|
|
4
|
-
import Xe from "./vue-ui-sparkline-
|
|
5
|
-
import W from "./BaseIcon-
|
|
6
|
-
import { u as Je, U as Ke, v as Qe } from "./usePrinter-
|
|
2
|
+
import { u as Te, c as We, t as Me, p as F, a as Ee, b as Ue, o as Be, e as be, g as Ge, a3 as Le, d as Re, i as V, f as T, q as He, r as qe } from "./index-BsIlHNy8.js";
|
|
3
|
+
import { u as ge } from "./useNestedProp-CyyJlG5K.js";
|
|
4
|
+
import Xe from "./vue-ui-sparkline-BJBtHg1Z.js";
|
|
5
|
+
import W from "./BaseIcon-CCOXJ43P.js";
|
|
6
|
+
import { u as Je, U as Ke, v as Qe } from "./usePrinter-D5N6w7Rg.js";
|
|
7
7
|
import { u as Ye } from "./useUserOptionState-BIvW1Kz7.js";
|
|
8
8
|
import { _ as Ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const je = ["id"], et = { style: { "z-index": "1", "padding-right": "24px" } }, tt = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useCssVars as ke, computed as d, onMounted as be, ref as m, watch as xe, createElementBlock as u, openBlock as l, unref as h, normalizeStyle as te, normalizeClass as F, createBlock as I, createCommentVNode as i, createSlots as _e, withCtx as x, renderSlot as f, normalizeProps as O, guardReactiveProps as A, createVNode as we, createElementVNode as v, Fragment as M, renderList as se, toDisplayString as Ce } from "vue";
|
|
2
|
-
import { u as $e, o as Pe, e as oe, g as Fe, c as Ie, t as Oe, p as _, a as Ae, b as Me, v as g, d as U, X as Ue, s as Ye, i as Ne, f as Se } from "./index-
|
|
3
|
-
import { _ as Te } from "./Title-
|
|
4
|
-
import { u as qe, U as Le } from "./usePrinter-
|
|
5
|
-
import Ve from "./vue-ui-skeleton-
|
|
6
|
-
import { u as le } from "./useNestedProp-
|
|
7
|
-
import { _ as Ee } from "./PackageVersion-
|
|
8
|
-
import { P as Ge } from "./PenAndPaper-
|
|
2
|
+
import { u as $e, o as Pe, e as oe, g as Fe, c as Ie, t as Oe, p as _, a as Ae, b as Me, v as g, d as U, X as Ue, s as Ye, i as Ne, f as Se } from "./index-BsIlHNy8.js";
|
|
3
|
+
import { _ as Te } from "./Title-xPTli3hs.js";
|
|
4
|
+
import { u as qe, U as Le } from "./usePrinter-D5N6w7Rg.js";
|
|
5
|
+
import Ve from "./vue-ui-skeleton-DApuwwZF.js";
|
|
6
|
+
import { u as le } from "./useNestedProp-CyyJlG5K.js";
|
|
7
|
+
import { _ as Ee } from "./PackageVersion-CZ0-Jk6A.js";
|
|
8
|
+
import { P as Ge } from "./PenAndPaper-BFkX-O1c.js";
|
|
9
9
|
import { u as We } from "./useUserOptionState-BIvW1Kz7.js";
|
|
10
10
|
import { u as je } from "./useChartAccessibility-BWojgys7.js";
|
|
11
11
|
import { _ as ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-Ce9ZD8zz.cjs"),oe=require("./Title-Bl_liOmz.cjs"),Y=require("./usePrinter-BxutFFjw.cjs"),re=require("./vue-ui-skeleton-BLaR1CnV.cjs"),z=require("./useNestedProp-DRJssOTC.cjs"),le=require("./PackageVersion-BO8DjgSz.cjs"),ae=require("./PenAndPaper-CcfHGdzR.cjs"),se=require("./useUserOptionState-BgepsfED.cjs"),ne=require("./useChartAccessibility-Cm7nkzTG.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ie=["id"],ce={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},de={key:2,style:"width:100%"},he=["xmlns","viewBox"],ve=["width","height"],me={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},pe=["fill"],ye=["id"],fe=["stop-color"],ge=["stop-color"],ke=["stop-color"],be={"clip-path":"url(#vueUiPill)"},xe=["x","y","height","width"],Ce=["x","y","height","width","fill"],we=["x1","x2","y1","y2","stroke-width","stroke"],_e=["x1","x2","y1","y2","stroke-width","stroke"],Ne=["x1","x2","y1","y2","stroke-width","stroke"],Be=["x1","x2","y1","y2","stroke-width","stroke"],Pe=["x1","x2","y1","y2","stroke-width","stroke"],Ve=["x1","x2","y1","y2","stroke-width","stroke"],Ee=["x1","x2","y1","y2","stroke-width","stroke"],$e=["x1","x2","y1","y2","stroke-width","stroke"],Fe=["x","y","height","width"],Oe=["y","x","fill","font-size","font-weight"],Ie={key:5,class:"vue-data-ui-watermark"},Se={key:6,ref:"source",dir:"auto"},qe={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:L}){e.useCssVars(r=>({"81f57fe8":X.value,"0e444a02":D.value,"6100776f":j.value}));const{vue_ui_thermometer:G}=a.useConfig(),s=m,g=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{B()});function B(){a.objectIsEmpty(s.dataset)?a.error({componentName:"VueUiThermometer",type:"dataset"}):a.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","from","to"]}).forEach(r=>{a.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:r})})}const d=e.ref(a.createUid()),P=e.ref(null),V=e.ref(0),E=e.ref(0),t=e.computed({get:()=>I(),set:r=>r}),{userOptionsVisible:k,setUserOptionsVisibility:$,keepUserOptionState:F}=se.useUserOptionState({config:t.value}),{svgRef:O}=ne.useChartAccessibility({config:t.value.style.title});function I(){const r=z.useNestedProp({userConfig:s.config,defaultConfig:G});return r.theme?{...z.useNestedProp({userConfig:a.themes.vue_ui_thermometer[r.theme]||s.config,defaultConfig:r}),customPalette:a.themePalettes[r.theme]||a.palette}:r}e.watch(()=>s.config,r=>{t.value=I(),k.value=!t.value.userOptions.showOnChartHover,B(),E.value+=1},{deep:!0});const{isPrinting:S,isImaging:q,generatePdf:A,generateImage:T}=Y.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),H=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),p=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),R=e.computed(()=>t.value.style.chart.thermometer.width),c=e.computed(()=>s.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 y(r,n,o){const u=[],_=M(r),N=M(n);for(let v=0;v<o;v++){const Q=b(_.red,N.red,v,o),Z=b(_.green,N.green,v,o),ee=b(_.blue,N.blue,v,o),te=`#${x(Q)}${x(Z)}${x(ee)}`;u.push(te)}return u}function M(r){const n=r.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 b(r,n,o,u){return Math.round(r+(n-r)*o/u)}function x(r){return r.toString(16).padStart(2,"0")}const l=e.computed(()=>{const r=R.value+i.value.left+i.value.right,n=t.value.style.chart.height;return{width:r,left:i.value.left,right:r-i.value.right,top:i.value.top,bottom:n-i.value.bottom,height:n}}),W=e.computed(()=>l.value),C=e.computed(()=>{const r=a.checkNaN(s.dataset.from)<0?Math.abs(a.checkNaN(s.dataset.from)):a.checkNaN(s.dataset.from),n=a.checkNaN(s.dataset.to)<0?Math.abs(a.checkNaN(s.dataset.to)):a.checkNaN(s.dataset.to);let o=0;return a.checkNaN(s.dataset.to)>0?o=r+n:r>n?o=r-n:o=n-r,(1-(Math.abs(a.checkNaN(s.dataset.from))+a.checkNaN(s.dataset.value))/o)*(l.value.height-i.value.top-i.value.bottom)}),j=e.computed(()=>`${C.value}px`),D=e.computed(()=>`${l.value.height-t.value.style.chart.padding.bottom-i.value.top}px`),X=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),J=e.computed(()=>{if(s.dataset.colors){if(!s.dataset.colors.from)return y(p.value[0]||a.palette[0],a.convertColorToHex(s.dataset.colors.to),c.value||10);if(!s.dataset.colors.to)return y(a.convertColorToHex(s.dataset.colors.from),p.value[1]||a.palette[1],c.value||10)}else return y(p.value[1]||a.palette[1],p.value[0]||a.palette[0],c.value||10);return y(a.convertColorToHex(s.dataset.colors.from),a.convertColorToHex(s.dataset.colors.to),c.value||10)}),U=e.computed(()=>{const r=[];let n=0;const o=l.value.height-i.value.top-i.value.bottom;for(let u=0;u<o-1;u+=o/c.value)r.push({x:l.value.left,y:l.value.top+u,qYLess:l.value.top+u+o/c.value/4,halfY:l.value.top+u+o/c.value/2,qYMore:l.value.top+u+o/c.value/4*3,color:J.value[n],height:o/c.value}),n+=1;return r}),h=e.ref(!1);function K(r){h.value=r,V.value+=1}const f=e.ref(!1);function w(){f.value=!f.value}return L({generatePdf:A,generateImage:T,toggleAnnotator:w}),(r,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:P,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}`,onMouseenter:n[0]||(n[0]=()=>e.unref($)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref($)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ae.PenAndPaper,{key:0,svgRef:e.unref(O),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:f.value,onClose:w},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),H.value?(e.openBlock(),e.createElementBlock("div",ce,null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",de,[(e.openBlock(),e.createBlock(oe._sfc_main,{key:`title_${E.value}`,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&&g.value&&(e.unref(F)||e.unref(k))?(e.openBlock(),e.createBlock(Y.UserOptions,{ref:"details",key:`user_options_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(q),isPrinting:e.unref(S),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:P.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:f.value,onToggleFullscreen:K,onGeneratePdf:e.unref(A),onGenerateImage:e.unref(T),onToggleAnnotator:w,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(k)?"visible":"hidden":"visible"})},e.createSlots({_:2},[r.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:o,color:u})=>[e.renderSlot(r.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:o,color:u})),void 0,!0)]),key:"0"}:void 0,r.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,r.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,r.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(r.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"3"}:void 0,r.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:u})=>[e.renderSlot(r.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:u})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:O,xmlns:e.unref(a.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:"background:transparent"},[e.createVNode(le._sfc_main),r.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width,height:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(r.$slots,"chart-background",{},void 0,!0)],8,ve)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",me,[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,pe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.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,fe),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(o.color,100-t.value.style.chart.graduations.gradient.intensity)},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,ke)],8,ye))),256))]),e.createElementVNode("g",be,[e.createElementVNode("rect",{x:l.value.left,y:l.value.top,height:l.value.height-i.value.top-i.value.bottom,width:l.value.width-i.value.left-i.value.right,fill:"#FFFFFF"},null,8,xe),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(o,u)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${u}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:l.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,Ce),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,we)):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,_e)):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,Ne)):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,Be)):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:l.value.right,x2:l.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,Pe)):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:l.value.right,x2:l.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,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:1,x1:l.value.right,x2:l.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,Ee)):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:l.value.right,x2:l.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,$e)):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:l.value.left,y:l.value.top,height:C.value,width:l.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,Fe)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:C.value+l.value.top+t.value.style.chart.label.fontSize/3,x:l.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(a.applyDataLabel)(t.value.style.chart.label.formatter,m.dataset.value,e.unref(a.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,Oe),e.renderSlot(r.$slots,"svg",{svg:W.value},void 0,!0)],10,he)):e.createCommentVNode("",!0),r.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ie,[e.renderSlot(r.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(S)||e.unref(q)})),void 0,!0)])):e.createCommentVNode("",!0),r.$slots.source?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(r.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(re.default,{key:7,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],46,ie))}},Ae=ue._export_sfc(qe,[["__scopeId","data-v-b9d565e0"]]);exports.default=Ae;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-CtzlfT2i.cjs"),oe=require("./Title-BGQhFU2C.cjs"),Y=require("./usePrinter-LlH3giBA.cjs"),re=require("./vue-ui-skeleton-MFudy6Nx.cjs"),z=require("./useNestedProp-B5jFEsaz.cjs"),le=require("./PackageVersion-DdCp9lqS.cjs"),ae=require("./PenAndPaper-4dibNTrE.cjs"),se=require("./useUserOptionState-BgepsfED.cjs"),ne=require("./useChartAccessibility-Cm7nkzTG.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ie=["id"],ce={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},de={key:2,style:"width:100%"},he=["xmlns","viewBox"],ve=["width","height"],me={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},pe=["fill"],ye=["id"],fe=["stop-color"],ge=["stop-color"],ke=["stop-color"],be={"clip-path":"url(#vueUiPill)"},xe=["x","y","height","width"],Ce=["x","y","height","width","fill"],we=["x1","x2","y1","y2","stroke-width","stroke"],_e=["x1","x2","y1","y2","stroke-width","stroke"],Ne=["x1","x2","y1","y2","stroke-width","stroke"],Be=["x1","x2","y1","y2","stroke-width","stroke"],Pe=["x1","x2","y1","y2","stroke-width","stroke"],Ve=["x1","x2","y1","y2","stroke-width","stroke"],Ee=["x1","x2","y1","y2","stroke-width","stroke"],$e=["x1","x2","y1","y2","stroke-width","stroke"],Fe=["x","y","height","width"],Oe=["y","x","fill","font-size","font-weight"],Ie={key:5,class:"vue-data-ui-watermark"},Se={key:6,ref:"source",dir:"auto"},qe={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:L}){e.useCssVars(r=>({"81f57fe8":X.value,"0e444a02":D.value,"6100776f":j.value}));const{vue_ui_thermometer:G}=a.useConfig(),s=m,g=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{B()});function B(){a.objectIsEmpty(s.dataset)?a.error({componentName:"VueUiThermometer",type:"dataset"}):a.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","from","to"]}).forEach(r=>{a.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:r})})}const d=e.ref(a.createUid()),P=e.ref(null),V=e.ref(0),E=e.ref(0),t=e.computed({get:()=>I(),set:r=>r}),{userOptionsVisible:k,setUserOptionsVisibility:$,keepUserOptionState:F}=se.useUserOptionState({config:t.value}),{svgRef:O}=ne.useChartAccessibility({config:t.value.style.title});function I(){const r=z.useNestedProp({userConfig:s.config,defaultConfig:G});return r.theme?{...z.useNestedProp({userConfig:a.themes.vue_ui_thermometer[r.theme]||s.config,defaultConfig:r}),customPalette:a.themePalettes[r.theme]||a.palette}:r}e.watch(()=>s.config,r=>{t.value=I(),k.value=!t.value.userOptions.showOnChartHover,B(),E.value+=1},{deep:!0});const{isPrinting:S,isImaging:q,generatePdf:A,generateImage:T}=Y.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),H=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),p=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),R=e.computed(()=>t.value.style.chart.thermometer.width),c=e.computed(()=>s.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 y(r,n,o){const u=[],_=M(r),N=M(n);for(let v=0;v<o;v++){const Q=b(_.red,N.red,v,o),Z=b(_.green,N.green,v,o),ee=b(_.blue,N.blue,v,o),te=`#${x(Q)}${x(Z)}${x(ee)}`;u.push(te)}return u}function M(r){const n=r.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 b(r,n,o,u){return Math.round(r+(n-r)*o/u)}function x(r){return r.toString(16).padStart(2,"0")}const l=e.computed(()=>{const r=R.value+i.value.left+i.value.right,n=t.value.style.chart.height;return{width:r,left:i.value.left,right:r-i.value.right,top:i.value.top,bottom:n-i.value.bottom,height:n}}),W=e.computed(()=>l.value),C=e.computed(()=>{const r=a.checkNaN(s.dataset.from)<0?Math.abs(a.checkNaN(s.dataset.from)):a.checkNaN(s.dataset.from),n=a.checkNaN(s.dataset.to)<0?Math.abs(a.checkNaN(s.dataset.to)):a.checkNaN(s.dataset.to);let o=0;return a.checkNaN(s.dataset.to)>0?o=r+n:r>n?o=r-n:o=n-r,(1-(Math.abs(a.checkNaN(s.dataset.from))+a.checkNaN(s.dataset.value))/o)*(l.value.height-i.value.top-i.value.bottom)}),j=e.computed(()=>`${C.value}px`),D=e.computed(()=>`${l.value.height-t.value.style.chart.padding.bottom-i.value.top}px`),X=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),J=e.computed(()=>{if(s.dataset.colors){if(!s.dataset.colors.from)return y(p.value[0]||a.palette[0],a.convertColorToHex(s.dataset.colors.to),c.value||10);if(!s.dataset.colors.to)return y(a.convertColorToHex(s.dataset.colors.from),p.value[1]||a.palette[1],c.value||10)}else return y(p.value[1]||a.palette[1],p.value[0]||a.palette[0],c.value||10);return y(a.convertColorToHex(s.dataset.colors.from),a.convertColorToHex(s.dataset.colors.to),c.value||10)}),U=e.computed(()=>{const r=[];let n=0;const o=l.value.height-i.value.top-i.value.bottom;for(let u=0;u<o-1;u+=o/c.value)r.push({x:l.value.left,y:l.value.top+u,qYLess:l.value.top+u+o/c.value/4,halfY:l.value.top+u+o/c.value/2,qYMore:l.value.top+u+o/c.value/4*3,color:J.value[n],height:o/c.value}),n+=1;return r}),h=e.ref(!1);function K(r){h.value=r,V.value+=1}const f=e.ref(!1);function w(){f.value=!f.value}return L({generatePdf:A,generateImage:T,toggleAnnotator:w}),(r,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:P,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}`,onMouseenter:n[0]||(n[0]=()=>e.unref($)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref($)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ae.PenAndPaper,{key:0,svgRef:e.unref(O),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:f.value,onClose:w},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),H.value?(e.openBlock(),e.createElementBlock("div",ce,null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",de,[(e.openBlock(),e.createBlock(oe._sfc_main,{key:`title_${E.value}`,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&&g.value&&(e.unref(F)||e.unref(k))?(e.openBlock(),e.createBlock(Y.UserOptions,{ref:"details",key:`user_options_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(q),isPrinting:e.unref(S),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:P.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:f.value,onToggleFullscreen:K,onGeneratePdf:e.unref(A),onGenerateImage:e.unref(T),onToggleAnnotator:w,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(k)?"visible":"hidden":"visible"})},e.createSlots({_:2},[r.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:o,color:u})=>[e.renderSlot(r.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:o,color:u})),void 0,!0)]),key:"0"}:void 0,r.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,r.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,r.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(r.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"3"}:void 0,r.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:u})=>[e.renderSlot(r.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:u})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:O,xmlns:e.unref(a.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:"background:transparent"},[e.createVNode(le._sfc_main),r.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width,height:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(r.$slots,"chart-background",{},void 0,!0)],8,ve)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",me,[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,pe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.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,fe),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(o.color,100-t.value.style.chart.graduations.gradient.intensity)},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,ke)],8,ye))),256))]),e.createElementVNode("g",be,[e.createElementVNode("rect",{x:l.value.left,y:l.value.top,height:l.value.height-i.value.top-i.value.bottom,width:l.value.width-i.value.left-i.value.right,fill:"#FFFFFF"},null,8,xe),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(o,u)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${u}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:l.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,Ce),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,we)):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,_e)):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,Ne)):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,Be)):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:l.value.right,x2:l.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,Pe)):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:l.value.right,x2:l.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,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:1,x1:l.value.right,x2:l.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,Ee)):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:l.value.right,x2:l.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,$e)):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:l.value.left,y:l.value.top,height:C.value,width:l.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,Fe)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:C.value+l.value.top+t.value.style.chart.label.fontSize/3,x:l.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(a.applyDataLabel)(t.value.style.chart.label.formatter,m.dataset.value,e.unref(a.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,Oe),e.renderSlot(r.$slots,"svg",{svg:W.value},void 0,!0)],10,he)):e.createCommentVNode("",!0),r.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ie,[e.renderSlot(r.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(S)||e.unref(q)})),void 0,!0)])):e.createCommentVNode("",!0),r.$slots.source?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(r.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(re.default,{key:7,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],46,ie))}},Ae=ue._export_sfc(qe,[["__scopeId","data-v-b9d565e0"]]);exports.default=Ae;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ref as i, onMounted as Z, computed as z, onBeforeUnmount as ee, watch as te, createElementBlock as o, openBlock as l, normalizeStyle as p, createCommentVNode as d, createElementVNode as _, createBlock as ae, unref as se, createVNode as C, renderSlot as H, mergeProps as q, normalizeProps as W, guardReactiveProps as G, toDisplayString as le } from "vue";
|
|
2
|
-
import { u as oe } from "./useNestedProp-
|
|
3
|
-
import { u as re, c as ue, X as ie, F as V } from "./index-
|
|
2
|
+
import { u as oe } from "./useNestedProp-CyyJlG5K.js";
|
|
3
|
+
import { u as re, c as ue, X as ie, F as V } from "./index-BsIlHNy8.js";
|
|
4
4
|
import { t as ne, u as ce } from "./useResponsive-vZgZwV-S.js";
|
|
5
|
-
import R from "./BaseIcon-
|
|
6
|
-
import { _ as de } from "./Title-
|
|
7
|
-
import { _ as he } from "./PackageVersion-
|
|
5
|
+
import R from "./BaseIcon-CCOXJ43P.js";
|
|
6
|
+
import { _ as de } from "./Title-xPTli3hs.js";
|
|
7
|
+
import { _ as he } from "./PackageVersion-CZ0-Jk6A.js";
|
|
8
8
|
import { u as ve } from "./useChartAccessibility-BWojgys7.js";
|
|
9
9
|
import { _ as pe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
class fe {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),j=require("./useNestedProp-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),j=require("./useNestedProp-B5jFEsaz.cjs"),w=require("./index-CtzlfT2i.cjs"),D=require("./useResponsive-N8jl0-aC.cjs"),B=require("./BaseIcon-Dhgv4Qgl.cjs"),O=require("./Title-BGQhFU2C.cjs"),U=require("./PackageVersion-DdCp9lqS.cjs"),W=require("./useChartAccessibility-Cm7nkzTG.cjs"),G=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");class X{constructor(T,V,S,M=!0,h=!0){this.interval=V,this.elapsed=0,this.isPaused=!1;const g=`
|
|
2
2
|
let interval;
|
|
3
3
|
let elapsed = 0;
|
|
4
4
|
let paused = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-DRJssOTC.cjs"),c=require("./index-Ce9ZD8zz.cjs"),K=require("./Title-Bl_liOmz.cjs"),j=require("./usePrinter-BxutFFjw.cjs"),Q=require("./vue-ui-skeleton-BLaR1CnV.cjs"),W=require("./PackageVersion-BO8DjgSz.cjs"),Z=require("./PenAndPaper-CcfHGdzR.cjs"),ee=require("./useUserOptionState-BgepsfED.cjs"),te=require("./useChartAccessibility-Cm7nkzTG.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ae=["id"],le={key:2,style:"width:100%;background:transparent;padding-bottom:12px"},re=["xmlns","viewBox"],ne=["width","height"],se={key:1},ue=["d","stroke-width","stroke"],ie={key:2},ce=["x1","y1","x2","y2","stroke-width","stroke"],ve=["x","y","font-size","fill","font-weight","text-anchor"],de={key:5,class:"vue-data-ui-watermark"},he={key:6,ref:"source",dir:"auto"},pe={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(G,{expose:H}){const{vue_ui_tiremarks:D}=c.useConfig(),v=G,$=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),P=e.ref(c.createUid()),S=e.ref(null),X=e.ref(null),O=e.ref(0),A=e.ref(0),t=e.computed({get:()=>E(),set:o=>o}),{userOptionsVisible:B,setUserOptionsVisibility:z,keepUserOptionState:N}=ee.useUserOptionState({config:t.value}),{svgRef:I}=te.useChartAccessibility({config:t.value.style.chart.title});function E(){const o=L.useNestedProp({userConfig:v.config,defaultConfig:D});return o.theme?{...L.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[o.theme]||v.config,defaultConfig:o})}:o}e.watch(()=>v.config,o=>{t.value=E(),B.value=!t.value.userOptions.showOnChartHover,U(),A.value+=1},{deep:!0});const{isPrinting:F,isImaging:V,generatePdf:q,generateImage:T}=j.usePrinter({elementId:P.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),Y=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),s=e.ref(t.value.style.chart.animation.use?0:c.checkNaN(v.dataset.percentage));e.watch(()=>v.dataset,o=>{t.value.style.chart.animation.use?M(o.percentage):s.value=o.percentage||0},{deep:!0}),e.onMounted(()=>{U()});function M(o){let n=t.value.style.chart.animation.speed;const a=Math.abs(o-s.value)/(n*120);function r(){s.value<o?s.value=Math.min(s.value+a,o):s.value>o&&(s.value=Math.max(s.value-a,o)),s.value!==o&&requestAnimationFrame(r)}r()}function U(){c.objectIsEmpty(v.dataset)&&c.error({componentName:"VueUiTiremarks",type:"dataset"}),M(v.dataset.percentage||0)}const f=e.computed(()=>t.value.style.chart.layout.display==="vertical"),u=e.computed(()=>{const o={top:48,left:64,right:64,bottom:48};return f.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?o.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?o.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?o.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?o.right:10}}),C=e.computed(()=>Object.values(u.value).reduce((o,n)=>o+n,0)),l=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),i=e.computed(()=>f.value?{mark:(l.value.height-C.value)/100*.5,space:(l.value.height-C.value)/100*.5}:{mark:(l.value.width-C.value)/100*.5,space:(l.value.width-C.value)/100*.5}),R=e.computed(()=>{const o=[];for(let a=0;a<100;a+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.shiftHue(t.value.style.chart.layout.activeColor,a/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.activeColor;if(f.value){const y=t.value.style.chart.layout.crescendo?(100-a)*(l.value.width-u.value.left-u.value.right)/100/3:0,d=u.value.left+4+y,h=l.value.width-u.value.right-4-y,p=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,m=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,b=t.value.style.chart.layout.curveAngleY*((1+a)/100);o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p-b}, ${h-k} ${m-b}, ${h} ${m}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-a)*(l.value.height-u.value.top-u.value.bottom)/100/3:0,d=u.value.left+a*i.value.mark+a*i.value.space-i.value.mark,h=d,p=u.value.top+4+y,m=l.value.height-u.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+a)/100),b=(m-p)/t.value.style.chart.layout.curveAngleX;o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p+b}, ${h+k} ${m-b}, ${h} ${m}`,color:r})}}return o}),g=e.computed(()=>{let o,n,a;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(o=l.value.width/2,n=u.value.top/2,a="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(o=l.value.width/2,n=l.value.height-u.value.bottom/2+r,a="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(o=4,n=l.value.height/2+r,a="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(o=l.value.width-u.value.right+8,n=l.value.height/2+r,a="start"),{x:o,y:n,textAnchor:a,bold:t.value.style.chart.percentage.bold,fontSize:t.value.style.chart.percentage.fontSize,fill:t.value.style.chart.percentage.color}}),_=e.ref(!1);function J(o){_.value=o,O.value+=1}const w=e.ref(!1);function x(){w.value=!w.value}return H({generatePdf:q,generateImage:T,toggleAnnotator:x}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:S,class:e.normalizeClass(`vue-ui-tiremarks ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:P.value,onMouseenter:n[0]||(n[0]=()=>e.unref(z)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(z)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Z.PenAndPaper,{key:0,svgRef:e.unref(I),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:x},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:X,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",le,[(e.openBlock(),e.createBlock(K._sfc_main,{key:`title_${A.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value&&(e.unref(N)||e.unref(B))?(e.openBlock(),e.createBlock(j.UserOptions,{ref:"details",key:`user_options_${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(F),isImaging:e.unref(V),uid:P.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:S.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:J,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(T),onToggleAnnotator:x,style:e.normalizeStyle({visibility:e.unref(N)?e.unref(B)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:a,color:r})=>[e.renderSlot(o.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:a,color:r})),void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"3"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:I,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(W._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width,height:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,ne)):e.createCommentVNode("",!0),t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(a,r)=>(e.openBlock(),e.createElementBlock("path",{d:a.curve,"stroke-width":i.value.mark,stroke:s.value>=r?a.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&r<=s.value})},null,10,ue))),256))])):(e.openBlock(),e.createElementBlock("g",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2,"stroke-width":i.value.mark,stroke:s.value>=r?a.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,ce))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:3,x:g.value.x,y:g.value.y,"font-size":g.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(c.shiftHue)(t.value.style.chart.layout.activeColor,s.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":g.value.bold?"bold":"normal","text-anchor":g.value.textAnchor},e.toDisplayString(e.unref(c.applyDataLabel)(t.value.style.chart.percentage.formatter,s.value,e.unref(c.dataLabel)({v:s.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,ve)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:l.value},void 0,!0)],14,re)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",de,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(F)||e.unref(V)})),void 0,!0)])):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",he,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Q.default,{key:7,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],46,ae))}},me=oe._export_sfc(pe,[["__scopeId","data-v-0911c677"]]);exports.default=me;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),L=require("./useNestedProp-B5jFEsaz.cjs"),c=require("./index-CtzlfT2i.cjs"),K=require("./Title-BGQhFU2C.cjs"),j=require("./usePrinter-LlH3giBA.cjs"),Q=require("./vue-ui-skeleton-MFudy6Nx.cjs"),W=require("./PackageVersion-DdCp9lqS.cjs"),Z=require("./PenAndPaper-4dibNTrE.cjs"),ee=require("./useUserOptionState-BgepsfED.cjs"),te=require("./useChartAccessibility-Cm7nkzTG.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ae=["id"],le={key:2,style:"width:100%;background:transparent;padding-bottom:12px"},re=["xmlns","viewBox"],ne=["width","height"],se={key:1},ue=["d","stroke-width","stroke"],ie={key:2},ce=["x1","y1","x2","y2","stroke-width","stroke"],ve=["x","y","font-size","fill","font-weight","text-anchor"],de={key:5,class:"vue-data-ui-watermark"},he={key:6,ref:"source",dir:"auto"},pe={__name:"vue-ui-tiremarks",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(G,{expose:H}){const{vue_ui_tiremarks:D}=c.useConfig(),v=G,$=e.computed(()=>!!v.dataset&&Object.keys(v.dataset).length),P=e.ref(c.createUid()),S=e.ref(null),X=e.ref(null),O=e.ref(0),A=e.ref(0),t=e.computed({get:()=>E(),set:o=>o}),{userOptionsVisible:B,setUserOptionsVisibility:z,keepUserOptionState:N}=ee.useUserOptionState({config:t.value}),{svgRef:I}=te.useChartAccessibility({config:t.value.style.chart.title});function E(){const o=L.useNestedProp({userConfig:v.config,defaultConfig:D});return o.theme?{...L.useNestedProp({userConfig:c.themes.vue_ui_tiremarks[o.theme]||v.config,defaultConfig:o})}:o}e.watch(()=>v.config,o=>{t.value=E(),B.value=!t.value.userOptions.showOnChartHover,U(),A.value+=1},{deep:!0});const{isPrinting:F,isImaging:V,generatePdf:q,generateImage:T}=j.usePrinter({elementId:P.value,fileName:t.value.style.chart.title.text||"vue-ui-tiremarks"}),Y=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),s=e.ref(t.value.style.chart.animation.use?0:c.checkNaN(v.dataset.percentage));e.watch(()=>v.dataset,o=>{t.value.style.chart.animation.use?M(o.percentage):s.value=o.percentage||0},{deep:!0}),e.onMounted(()=>{U()});function M(o){let n=t.value.style.chart.animation.speed;const a=Math.abs(o-s.value)/(n*120);function r(){s.value<o?s.value=Math.min(s.value+a,o):s.value>o&&(s.value=Math.max(s.value-a,o)),s.value!==o&&requestAnimationFrame(r)}r()}function U(){c.objectIsEmpty(v.dataset)&&c.error({componentName:"VueUiTiremarks",type:"dataset"}),M(v.dataset.percentage||0)}const f=e.computed(()=>t.value.style.chart.layout.display==="vertical"),u=e.computed(()=>{const o={top:48,left:64,right:64,bottom:48};return f.value?{top:t.value.style.chart.percentage.verticalPosition==="top"?o.top:3,left:3,right:3,bottom:t.value.style.chart.percentage.verticalPosition==="bottom"?o.bottom:3}:{top:0,bottom:0,left:t.value.style.chart.percentage.horizontalPosition==="left"?o.left:3,right:t.value.style.chart.percentage.horizontalPosition==="right"?o.right:10}}),C=e.computed(()=>Object.values(u.value).reduce((o,n)=>o+n,0)),l=e.computed(()=>({height:f.value?312:56,width:f.value?56:312})),i=e.computed(()=>f.value?{mark:(l.value.height-C.value)/100*.5,space:(l.value.height-C.value)/100*.5}:{mark:(l.value.width-C.value)/100*.5,space:(l.value.width-C.value)/100*.5}),R=e.computed(()=>{const o=[];for(let a=0;a<100;a+=1){const r=t.value.style.chart.layout.ticks.gradient.show?c.shiftHue(t.value.style.chart.layout.activeColor,a/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.layout.activeColor;if(f.value){const y=t.value.style.chart.layout.crescendo?(100-a)*(l.value.width-u.value.left-u.value.right)/100/3:0,d=u.value.left+4+y,h=l.value.width-u.value.right-4-y,p=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,m=l.value.height-u.value.bottom-a*i.value.mark-a*i.value.space-i.value.mark,k=(h-d)/t.value.style.chart.layout.curveAngleX,b=t.value.style.chart.layout.curveAngleY*((1+a)/100);o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p-b}, ${h-k} ${m-b}, ${h} ${m}`,color:r})}else{const y=t.value.style.chart.layout.crescendo?(100-a)*(l.value.height-u.value.top-u.value.bottom)/100/3:0,d=u.value.left+a*i.value.mark+a*i.value.space-i.value.mark,h=d,p=u.value.top+4+y,m=l.value.height-u.value.bottom-4-y,k=t.value.style.chart.layout.curveAngleY*((1+a)/100),b=(m-p)/t.value.style.chart.layout.curveAngleX;o.push({x1:d,x2:h,y1:p,y2:m,curve:`M ${d} ${p} C ${d+k} ${p+b}, ${h+k} ${m-b}, ${h} ${m}`,color:r})}}return o}),g=e.computed(()=>{let o,n,a;const r=t.value.style.chart.percentage.fontSize/3;return f.value?t.value.style.chart.percentage.verticalPosition==="top"?(o=l.value.width/2,n=u.value.top/2,a="middle"):t.value.style.chart.percentage.verticalPosition==="bottom"&&(o=l.value.width/2,n=l.value.height-u.value.bottom/2+r,a="middle"):t.value.style.chart.percentage.horizontalPosition==="left"?(o=4,n=l.value.height/2+r,a="start"):t.value.style.chart.percentage.horizontalPosition==="right"&&(o=l.value.width-u.value.right+8,n=l.value.height/2+r,a="start"),{x:o,y:n,textAnchor:a,bold:t.value.style.chart.percentage.bold,fontSize:t.value.style.chart.percentage.fontSize,fill:t.value.style.chart.percentage.color}}),_=e.ref(!1);function J(o){_.value=o,O.value+=1}const w=e.ref(!1);function x(){w.value=!w.value}return H({generatePdf:q,generateImage:T,toggleAnnotator:x}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tiremarksChart",ref:S,class:e.normalizeClass(`vue-ui-tiremarks ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`),id:P.value,onMouseenter:n[0]||(n[0]=()=>e.unref(z)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref(z)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Z.PenAndPaper,{key:0,svgRef:e.unref(I),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:w.value,onClose:x},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:X,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",le,[(e.openBlock(),e.createBlock(K._sfc_main,{key:`title_${A.value}`,config:{title:{cy:"wheel-title",...t.value.style.chart.title},subtitle:{cy:"wheel-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&$.value&&(e.unref(N)||e.unref(B))?(e.openBlock(),e.createBlock(j.UserOptions,{ref:"details",key:`user_options_${O.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(F),isImaging:e.unref(V),uid:P.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:_.value,titles:{...t.value.userOptions.buttonTitles},chartElement:S.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:J,onGeneratePdf:e.unref(q),onGenerateImage:e.unref(T),onToggleAnnotator:x,style:e.normalizeStyle({visibility:e.unref(N)?e.unref(B)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:a,color:r})=>[e.renderSlot(o.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:a,color:r})),void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"3"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:r})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:r})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),$.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:I,xmlns:e.unref(c.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":_.value,"vue-data-ui-fulscreen--off":!_.value}),viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(W._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width,height:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,ne)):e.createCommentVNode("",!0),t.value.style.chart.layout.curved?(e.openBlock(),e.createElementBlock("g",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(a,r)=>(e.openBlock(),e.createElementBlock("path",{d:a.curve,"stroke-width":i.value.mark,stroke:s.value>=r?a.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round",fill:"none",class:e.normalizeClass({"vue-ui-tick-animated":t.value.style.chart.animation.use&&r<=s.value})},null,10,ue))),256))])):(e.openBlock(),e.createElementBlock("g",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(a,r)=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2,"stroke-width":i.value.mark,stroke:s.value>=r?a.color:t.value.style.chart.layout.inactiveColor,"stroke-linecap":"round"},null,8,ce))),256))])),t.value.style.chart.percentage.show?(e.openBlock(),e.createElementBlock("text",{key:3,x:g.value.x,y:g.value.y,"font-size":g.value.fontSize,fill:t.value.style.chart.layout.ticks.gradient.show&&t.value.style.chart.percentage.useGradientColor?e.unref(c.shiftHue)(t.value.style.chart.layout.activeColor,s.value/100*(t.value.style.chart.layout.ticks.gradient.shiftHueIntensity/100)):t.value.style.chart.percentage.color,"font-weight":g.value.bold?"bold":"normal","text-anchor":g.value.textAnchor},e.toDisplayString(e.unref(c.applyDataLabel)(t.value.style.chart.percentage.formatter,s.value,e.unref(c.dataLabel)({v:s.value,s:"%",r:t.value.style.chart.percentage.rounding}))),9,ve)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:l.value},void 0,!0)],14,re)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",de,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(F)||e.unref(V)})),void 0,!0)])):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",he,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),$.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Q.default,{key:7,config:{type:"tiremarks",style:{backgroundColor:t.value.style.chart.backgroundColor,tiremarks:{color:"#CCCCCC"}}}},null,8,["config"]))],46,ae))}},me=oe._export_sfc(pe,[["__scopeId","data-v-0911c677"]]);exports.default=me;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { computed as h, ref as b, watch as Z, onMounted as ce, createElementBlock as c, openBlock as s, unref as r, normalizeStyle as G, normalizeClass as L, createBlock as F, createCommentVNode as d, createSlots as ve, withCtx as x, renderSlot as y, normalizeProps as z, guardReactiveProps as S, createVNode as he, Fragment as ee, renderList as te, toDisplayString as de } from "vue";
|
|
2
|
-
import { u as ae } from "./useNestedProp-
|
|
3
|
-
import { u as fe, c as ge, a as ye, v as me, o as pe, e as ke, w as oe, X as be, i as _e, f as Ce } from "./index-
|
|
4
|
-
import { _ as $e } from "./Title-
|
|
5
|
-
import { u as we, U as Pe } from "./usePrinter-
|
|
6
|
-
import xe from "./vue-ui-skeleton-
|
|
7
|
-
import { _ as Oe } from "./PackageVersion-
|
|
8
|
-
import { P as Ae } from "./PenAndPaper-
|
|
2
|
+
import { u as ae } from "./useNestedProp-CyyJlG5K.js";
|
|
3
|
+
import { u as fe, c as ge, a as ye, v as me, o as pe, e as ke, w as oe, X as be, i as _e, f as Ce } from "./index-BsIlHNy8.js";
|
|
4
|
+
import { _ as $e } from "./Title-xPTli3hs.js";
|
|
5
|
+
import { u as we, U as Pe } from "./usePrinter-D5N6w7Rg.js";
|
|
6
|
+
import xe from "./vue-ui-skeleton-DApuwwZF.js";
|
|
7
|
+
import { _ as Oe } from "./PackageVersion-CZ0-Jk6A.js";
|
|
8
|
+
import { P as Ae } from "./PenAndPaper-BFkX-O1c.js";
|
|
9
9
|
import { u as Ie } from "./useUserOptionState-BIvW1Kz7.js";
|
|
10
10
|
import { u as Fe } from "./useChartAccessibility-BWojgys7.js";
|
|
11
11
|
import { _ as ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-Ce9ZD8zz.cjs"),Ae=require("./Title-Bl_liOmz.cjs"),ke=require("./usePrinter-BxutFFjw.cjs"),Le=require("./Tooltip-CFY5zGjZ.cjs"),Fe=require("./Legend-DIS7P475.cjs"),Ie=require("./vue-ui-skeleton-BLaR1CnV.cjs"),De=require("./DataTable-D8BtUoMR.cjs"),qe=require("./vue-ui-accordion-CtgNWNEP.cjs"),Ce=require("./useResponsive-N8jl0-aC.cjs"),we=require("./useNestedProp-DRJssOTC.cjs"),Me=require("./PackageVersion-BO8DjgSz.cjs"),He=require("./PenAndPaper-CcfHGdzR.cjs"),Ue=require("./useUserOptionState-BgepsfED.cjs"),We=require("./useChartAccessibility-Cm7nkzTG.cjs"),Ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function xe(n,c){const i=n.length;if(i===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let d=1/0,s=-1/0,h=0;for(let p=0;p<i;p+=1){const f=n[p].normalizedValue;f<d&&(d=f),f>s&&(s=f),h+=f}return Math.max(c**2*s/h**2,h**2/(c**2*d))}}function Te(n){const{xOffset:c,yOffset:i,width:d,height:s}=n;return{x0:c,y0:i,x1:c+d,y1:i+s}}function je(n,c,i){if(n.length===0)return!0;{const d=n.concat(c),s=xe(n,i),h=xe(d,i);return s>=h}}function Xe(n){const c=[],i=n.length;for(let d=0;d<i;d+=1){const s=n[d],h=s.length;for(let v=0;v<h;v+=1)c.push(s[v])}return c}function Ye(n,c){const i={...c,children:n};return Se(i)}function Ze(n){return(n.x1-n.x0)*(n.y1-n.y0)}function $e(n,c){const{width:i,height:d,xOffset:s,yOffset:h}=Y(c),v=n.length,p=n.map(y=>y.normalizedValue||0).reduce((y,g)=>y+g,0),f=p/d,w=p/i;let C=s,x=h;const b=[];if(i>=d){for(let y=0;y<v;y+=1){const g=n[y],k=x+g.normalizedValue/f,O={x0:C,y0:x,x1:C+f,y1:k},T=Object.assign({},g,O);x=k,b.push(T)}return b}else{for(let y=0;y<v;y+=1){const g=n[y],k=C+g.normalizedValue/w,O={x0:C,y0:x,x1:k,y1:x+w},T=Object.assign({},g,O);C=k,b.push(T)}return b}}function Je(n){const c=Y(n),i=c.width,d=c.height;return Math.min(i,d)}function Ke(n,c){const i=n.length,d=n.map(f=>f.value??0).reduce((f,w)=>f+w,0),s=c/d,h=[];let v,p;for(let f=0;f<i;f+=1)p=n[f],v=Object.assign({},p,{normalizedValue:p.value*(s||0)}),h.push(v);return h}function Y(n){const{x0:c,y0:i,x1:d,y1:s}=n;return{xOffset:c,yOffset:i,width:d-c,height:s-i}}function Qe(n,c,i,d){let s=n,h=c,v=i,p=d;for(;;){const f=s.length;if(f===0){const b=$e(h,v);return p.concat(b)}const w=Je(v),C=s[0],x=s.slice(1,f);if(je(h,C,w)){const b=h.concat(C);s=x,h=b,v=v,p=p}else{const b=h.length;let y=0;for(let T=0;T<b;T+=1)y+=h[T].normalizedValue;const g=et(v,y),k=$e(h,v),O=p.concat(k);s=s,h=[],v=g,p=O}}}function Se(n){if(typeof n.children>"u"||!n.children.length)return[n];{const c=Ke(n.children,Ze(n)),i=Qe(c,[],n,[]),d=i.length,s=[];for(let v=0;v<d;v+=1)s.push(Se(i[v]));return Xe(s)}}function et(n,c){const{width:i,height:d,xOffset:s,yOffset:h}=Y(n);if(i>=d){const v=c/d,p=i-v,f={xOffset:s+v,yOffset:h,width:p,height:d};return Te(f)}else{const v=c/i,p=d-v,f={xOffset:s,yOffset:h+v,width:i,height:p};return Te(f)}}const tt=["id"],ot=["xmlns","viewBox"],lt={key:0},at=["id"],nt=["stop-color"],rt=["stop-color"],st=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],ut=["x","y","height","width"],it={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},ct={key:5,class:"vue-data-ui-watermark"},dt=["onClick"],vt={key:0},ht={key:1},pt=["innerHTML"],ft={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:c,emit:i}){const{vue_ui_treemap:d}=r.useConfig(),s=n,h=i,v=e.useSlots();e.onMounted(()=>{v["chart-background"]&&console.warn("VueUiTreemap does not support the #chart-background slot.")});const p=e.computed(()=>!!s.dataset&&s.dataset.length),f=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),w=e.ref(r.createUid()),C=e.ref(!1),x=e.ref(""),b=e.ref(!1),y=e.ref(0),g=e.ref([]),k=e.ref(null),O=e.ref(null),T=e.ref(null),Z=e.ref(null),J=e.ref(null),K=e.ref(0),Q=e.ref(0),ee=e.ref(0),t=e.computed({get:()=>ae(),set:o=>o}),{userOptionsVisible:U,setUserOptionsVisibility:te,keepUserOptionState:oe}=Ue.useUserOptionState({config:t.value}),{svgRef:le}=We.useChartAccessibility({config:t.value.style.chart.title});function ae(){const o=we.useNestedProp({userConfig:s.config,defaultConfig:d});return o.theme?{...we.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||s.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>s.config,o=>{t.value=ae(),U.value=!t.value.userOptions.showOnChartHover,K.value+=1,Q.value+=1,ee.value+=1,$.value.showTable=t.value.table.show,$.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const{isPrinting:ne,isImaging:re,generatePdf:se,generateImage:ue}=ke.usePrinter({elementId:`treemap_${w.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Ne=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),$=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),P=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),V=e.computed(()=>({bottom:P.value.height-t.value.style.chart.padding.bottom,height:P.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:P.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:P.value.height,vbWidth:P.value.width,width:P.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function ie(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(u=>{u.parentId=a.id,u.color=a.color}),ie(a.children))})}const _=e.ref(s.dataset),D=e.ref(null);e.onMounted(()=>{Be()});function Be(){if(r.objectIsEmpty(s.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),ie(_.value),t.value.responsive){const o=Ce.throttle(()=>{const{width:a,height:l}=Ce.useResponsive({chart:k.value,title:t.value.style.chart.title.text?O.value:null,legend:t.value.style.chart.legend.show?T.value:null,source:Z.value,noTitle:J.value});requestAnimationFrame(()=>{P.value.width=a,P.value.height=l})});D.value=new ResizeObserver(o),D.value.observe(k.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const W=e.ref(_.value),L=e.computed(()=>W.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!g.value.includes(o.id))),R=e.computed(()=>_.value.filter(o=>!g.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),ce=e.computed({get(){let o=[...L.value];return t.value.style.chart.layout.sorted&&(o=[...L.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function de(o,a){return o.value/a}function Oe(o,a,l){const u=t.value.style.chart.layout.rects.colorRatio-de(a,l);return r.lightenHexColor(o,u<0?0:u)}function ve(o,a,l,u){return o.map((m,z)=>{const H=Oe(r.convertColorToHex(a)||I.value[z]||r.palette[z]||r.palette[z%r.palette.length],m,u),Re=de(m,u);return{...m,color:H,proportion:Re,parentName:l,children:m.children?ve(m.children,H,m.name,u):void 0}})}const F=e.computed(()=>Ye(ce.value.map((o,a)=>{const l=o.children?o.children.reduce((u,m)=>u+m.value,0):o.value;return{value:o.value,id:o.id,children:o.children?ve(o.children.sort((u,m)=>m.value-u.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:V.value.left*2,y0:V.value.top,x1:V.value.width,y1:V.value.height}));function he({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function pe({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function E(o){const a=t.value.style.chart.layout.labels.fontSize*(o.proportion*2>1?1:o.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function Pe(o){b.value=o,y.value+=1}const A=e.computed(()=>({startX:0,startY:0,width:V.value.vbWidth,height:V.value.vbHeight})),S=e.ref(!1);function G(o,a=_.value){for(const l of a){if(l.id===o)return l;if(l.children){const u=G(o,l.children);if(u)return u}}return null}function ze(o){if(S.value)h("selectDatapoint",void 0),W.value=_.value;else{if(h("selectDatapoint",o),!G(o.parentId))return;W.value=[G(o.parentId)]}S.value=!S.value}const N=e.ref(null),fe=e.computed(()=>_.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((o,a)=>a.value-o.value).map((o,a)=>({...o,proportion:o.value/_.value.map(l=>l.value).reduce((l,u)=>l+u,0),opacity:g.value.includes(o.id)?.5:1}))),Ve=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function ge(o){S.value=!1,N.value=null,g.value.includes(o.id)?g.value=g.value.filter(a=>a!==o.id):g.value.length<s.dataset.length-1&&g.value.push(o.id),h("selectLegend",ce.value)}const j=e.ref(null);function _e({datapoint:o,seriesIndex:a}){N.value=o,j.value={datapoint:o,seriesIndex:a,config:t.value,series:L.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:L.value,config:t.value})))x.value=l({seriesIndex:a,datapoint:o,series:L.value,config:t.value});else{let u="";u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${o.color}"/></svg>`,u+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:a})}</b>`,x.value=`<div>${u}</div>`}C.value=!0}const B=e.computed(()=>{const o=F.value.map(l=>({name:l.name,color:l.color})),a=F.value.map(l=>l.value);return{head:o,body:a}});function me(){e.nextTick(()=>{const o=B.value.head.map((u,m)=>[[u.name],[B.value.body[m]],[isNaN(B.value.body[m]/R.value)?"-":B.value.body[m]/R.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=B.value.head.map((m,z)=>{const H=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,B.value.body[z],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:B.value.body[z],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:m.color,name:m.name,shape:"square"},H,isNaN(B.value.body[z]/R.value)?"-":r.dataLabel({v:B.value.body[z]/R.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}});function Ee(){return F.value}function ye(){$.value.showTable=!$.value.showTable}function be(){$.value.showTooltip=!$.value.showTooltip}const M=e.ref(!1);function X(){M.value=!M.value}return c({getData:Ee,generateCsv:me,generateImage:ue,generatePdf:se,toggleTable:ye,toggleTooltip:be,toggleAnnotator:X}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:k,class:e.normalizeClass(`vue-ui-treemap ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`treemap_${w.value}`,onMouseenter:a[3]||(a[3]=()=>e.unref(te)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(te)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(He.PenAndPaper,{key:0,svgRef:e.unref(le),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:M.value,onClose:X},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),Ne.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:J,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:O,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Ae._sfc_main,{key:`title_${K.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value&&(e.unref(oe)||e.unref(U))?(e.openBlock(),e.createBlock(ke.UserOptions,{ref:"details",key:`user_option_${y.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(ne),isImaging:e.unref(re),uid:w.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:$.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:M.value,onToggleFullscreen:Pe,onGeneratePdf:e.unref(se),onGenerateCsv:me,onGenerateImage:e.unref(ue),onToggleTable:ye,onToggleTooltip:be,onToggleAnnotator:X,style:e.normalizeStyle({visibility:e.unref(oe)?e.unref(U)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:l,color:u})=>[e.renderSlot(o.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:l,color:u})),void 0,!0)]),key:"0"}:void 0,o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:u})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:u})),void 0,!0)]),key:"6"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:u})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:u})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:le,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!S.value,"vue-data-ui-zoom-minus":S.value}),viewBox:`${A.value.startX} ${A.value.startY} ${A.value.width<=0?10:A.value.width} ${A.value.height<=0?10:A.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Me._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,u)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",lt,[e.createElementVNode("radialGradient",{id:`tgrad_${l.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":l.color},null,8,nt),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,rt)],8,at)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,u)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:he(l),width:pe(l),fill:f.value?l.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${l.id})`:l.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:N.value&&N.value.id===l.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":N.value&&N.value.id===l.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:m=>ze(l),onMouseenter:()=>_e({datapoint:l,seriesIndex:u}),onMouseleave:a[0]||(a[0]=m=>{N.value=null,C.value=!1}),style:e.normalizeStyle(`opacity:${N.value?N.value.id===l.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,st),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:he(l),width:pe(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",it,[t.value.style.chart.layout.labels.showDefaultLabels&&(l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${E(l)/1.5}px);text-align:left;line-height:${E(l)<14?14:E(l)}px;padding:${E(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(l.name),5),a[5]||(a[5]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:l})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"rect",e.mergeProps({ref_for:!0},{rect:l,shouldShow:l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value,fontSize:E(l),isZoom:S.value,textColor:e.unref(r.adaptColorToBackground)(l.color)}),void 0,!0)])],8,ut))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:V.value,isZoom:S.value,rect:N.value,config:t.value})),void 0,!0)],14,ot)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ct,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(ne)||e.unref(re)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ie.default,{key:6,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:T},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Fe.Legend,{key:`legend_${ee.value}`,legendSet:fe.value,config:Ve.value,id:`treemap_legend_${w.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>ge(l))},{item:e.withCtx(({legend:l,index:u})=>[e.createElementVNode("div",{onClick:m=>ge(l),style:e.normalizeStyle(`opacity:${g.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l}))+" ",1),g.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",ht," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",vt," ("+e.toDisplayString(isNaN(l.value/R.value)?"-":(l.value/R.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,dt)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:fe.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:Z,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Le._sfc_main,{show:$.value.showTooltip&&C.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:k.value,content:x.value,isFullscreen:b.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),p.value?(e.openBlock(),e.createBlock(qe.default,{key:8,hideDetails:"",config:{open:$.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(De.DataTable,{key:`table_${Q.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>$.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,pt)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,tt))}},gt=Ge._export_sfc(ft,[["__scopeId","data-v-4d059d9f"]]);exports.default=gt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CtzlfT2i.cjs"),Ae=require("./Title-BGQhFU2C.cjs"),ke=require("./usePrinter-LlH3giBA.cjs"),Le=require("./Tooltip-CnSZ7sO1.cjs"),Fe=require("./Legend-2PWaf6Bj.cjs"),Ie=require("./vue-ui-skeleton-MFudy6Nx.cjs"),De=require("./DataTable-DhEDo7W6.cjs"),qe=require("./vue-ui-accordion-tUPDXqYS.cjs"),Ce=require("./useResponsive-N8jl0-aC.cjs"),we=require("./useNestedProp-B5jFEsaz.cjs"),Me=require("./PackageVersion-DdCp9lqS.cjs"),He=require("./PenAndPaper-4dibNTrE.cjs"),Ue=require("./useUserOptionState-BgepsfED.cjs"),We=require("./useChartAccessibility-Cm7nkzTG.cjs"),Ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function xe(n,c){const i=n.length;if(i===0)throw new Error(`Max aspect ratio cannot be computed: ${n} is an empty array`);{let d=1/0,s=-1/0,h=0;for(let p=0;p<i;p+=1){const f=n[p].normalizedValue;f<d&&(d=f),f>s&&(s=f),h+=f}return Math.max(c**2*s/h**2,h**2/(c**2*d))}}function Te(n){const{xOffset:c,yOffset:i,width:d,height:s}=n;return{x0:c,y0:i,x1:c+d,y1:i+s}}function je(n,c,i){if(n.length===0)return!0;{const d=n.concat(c),s=xe(n,i),h=xe(d,i);return s>=h}}function Xe(n){const c=[],i=n.length;for(let d=0;d<i;d+=1){const s=n[d],h=s.length;for(let v=0;v<h;v+=1)c.push(s[v])}return c}function Ye(n,c){const i={...c,children:n};return Se(i)}function Ze(n){return(n.x1-n.x0)*(n.y1-n.y0)}function $e(n,c){const{width:i,height:d,xOffset:s,yOffset:h}=Y(c),v=n.length,p=n.map(y=>y.normalizedValue||0).reduce((y,g)=>y+g,0),f=p/d,w=p/i;let C=s,x=h;const b=[];if(i>=d){for(let y=0;y<v;y+=1){const g=n[y],k=x+g.normalizedValue/f,O={x0:C,y0:x,x1:C+f,y1:k},T=Object.assign({},g,O);x=k,b.push(T)}return b}else{for(let y=0;y<v;y+=1){const g=n[y],k=C+g.normalizedValue/w,O={x0:C,y0:x,x1:k,y1:x+w},T=Object.assign({},g,O);C=k,b.push(T)}return b}}function Je(n){const c=Y(n),i=c.width,d=c.height;return Math.min(i,d)}function Ke(n,c){const i=n.length,d=n.map(f=>f.value??0).reduce((f,w)=>f+w,0),s=c/d,h=[];let v,p;for(let f=0;f<i;f+=1)p=n[f],v=Object.assign({},p,{normalizedValue:p.value*(s||0)}),h.push(v);return h}function Y(n){const{x0:c,y0:i,x1:d,y1:s}=n;return{xOffset:c,yOffset:i,width:d-c,height:s-i}}function Qe(n,c,i,d){let s=n,h=c,v=i,p=d;for(;;){const f=s.length;if(f===0){const b=$e(h,v);return p.concat(b)}const w=Je(v),C=s[0],x=s.slice(1,f);if(je(h,C,w)){const b=h.concat(C);s=x,h=b,v=v,p=p}else{const b=h.length;let y=0;for(let T=0;T<b;T+=1)y+=h[T].normalizedValue;const g=et(v,y),k=$e(h,v),O=p.concat(k);s=s,h=[],v=g,p=O}}}function Se(n){if(typeof n.children>"u"||!n.children.length)return[n];{const c=Ke(n.children,Ze(n)),i=Qe(c,[],n,[]),d=i.length,s=[];for(let v=0;v<d;v+=1)s.push(Se(i[v]));return Xe(s)}}function et(n,c){const{width:i,height:d,xOffset:s,yOffset:h}=Y(n);if(i>=d){const v=c/d,p=i-v,f={xOffset:s+v,yOffset:h,width:p,height:d};return Te(f)}else{const v=c/i,p=d-v,f={xOffset:s,yOffset:h+v,width:i,height:p};return Te(f)}}const tt=["id"],ot=["xmlns","viewBox"],lt={key:0},at=["id"],nt=["stop-color"],rt=["stop-color"],st=["x","y","height","width","fill","rx","stroke","stroke-width","onClick","onMouseenter"],ut=["x","y","height","width"],it={style:{width:"100%",height:"100%"},class:"vue-ui-treemap-cell"},ct={key:5,class:"vue-data-ui-watermark"},dt=["onClick"],vt={key:0},ht={key:1},pt=["innerHTML"],ft={__name:"vue-ui-treemap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend","selectDatapoint"],setup(n,{expose:c,emit:i}){const{vue_ui_treemap:d}=r.useConfig(),s=n,h=i,v=e.useSlots();e.onMounted(()=>{v["chart-background"]&&console.warn("VueUiTreemap does not support the #chart-background slot.")});const p=e.computed(()=>!!s.dataset&&s.dataset.length),f=e.computed(()=>/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),w=e.ref(r.createUid()),C=e.ref(!1),x=e.ref(""),b=e.ref(!1),y=e.ref(0),g=e.ref([]),k=e.ref(null),O=e.ref(null),T=e.ref(null),Z=e.ref(null),J=e.ref(null),K=e.ref(0),Q=e.ref(0),ee=e.ref(0),t=e.computed({get:()=>ae(),set:o=>o}),{userOptionsVisible:U,setUserOptionsVisibility:te,keepUserOptionState:oe}=Ue.useUserOptionState({config:t.value}),{svgRef:le}=We.useChartAccessibility({config:t.value.style.chart.title});function ae(){const o=we.useNestedProp({userConfig:s.config,defaultConfig:d});return o.theme?{...we.useNestedProp({userConfig:r.themes.vue_ui_treemap[o.theme]||s.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>s.config,o=>{t.value=ae(),U.value=!t.value.userOptions.showOnChartHover,K.value+=1,Q.value+=1,ee.value+=1,$.value.showTable=t.value.table.show,$.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const{isPrinting:ne,isImaging:re,generatePdf:se,generateImage:ue}=ke.usePrinter({elementId:`treemap_${w.value}`,fileName:t.value.style.chart.title.text||"vue-ui-treemap"}),Ne=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),I=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),$=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),P=e.ref({height:t.value.style.chart.height,width:t.value.style.chart.width}),V=e.computed(()=>({bottom:P.value.height-t.value.style.chart.padding.bottom,height:P.value.height-t.value.style.chart.padding.top-t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:P.value.width-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,vbHeight:P.value.height,vbWidth:P.value.width,width:P.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right}));function ie(o){o.forEach((a,l)=>{a.id=r.createUid(),a.color=r.convertColorToHex(a.color)||I.value[l]||r.palette[l]||r.palette[l%r.palette.length],a.children&&(a.children.forEach(u=>{u.parentId=a.id,u.color=a.color}),ie(a.children))})}const _=e.ref(s.dataset),D=e.ref(null);e.onMounted(()=>{Be()});function Be(){if(r.objectIsEmpty(s.dataset)&&r.error({componentName:"VueUiTreemap",type:"dataset"}),ie(_.value),t.value.responsive){const o=Ce.throttle(()=>{const{width:a,height:l}=Ce.useResponsive({chart:k.value,title:t.value.style.chart.title.text?O.value:null,legend:t.value.style.chart.legend.show?T.value:null,source:Z.value,noTitle:J.value});requestAnimationFrame(()=>{P.value.width=a,P.value.height=l})});D.value=new ResizeObserver(o),D.value.observe(k.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const W=e.ref(_.value),L=e.computed(()=>W.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length]})).filter(o=>!g.value.includes(o.id))),R=e.computed(()=>_.value.filter(o=>!g.value.includes(o.id)).map(o=>o.value||0).reduce((o,a)=>o+a,0)),ce=e.computed({get(){let o=[...L.value];return t.value.style.chart.layout.sorted&&(o=[...L.value].sort((a,l)=>l.value-a.value)),o.map(a=>({...a}))},set(o){return o}});function de(o,a){return o.value/a}function Oe(o,a,l){const u=t.value.style.chart.layout.rects.colorRatio-de(a,l);return r.lightenHexColor(o,u<0?0:u)}function ve(o,a,l,u){return o.map((m,z)=>{const H=Oe(r.convertColorToHex(a)||I.value[z]||r.palette[z]||r.palette[z%r.palette.length],m,u),Re=de(m,u);return{...m,color:H,proportion:Re,parentName:l,children:m.children?ve(m.children,H,m.name,u):void 0}})}const F=e.computed(()=>Ye(ce.value.map((o,a)=>{const l=o.children?o.children.reduce((u,m)=>u+m.value,0):o.value;return{value:o.value,id:o.id,children:o.children?ve(o.children.sort((u,m)=>m.value-u.value),o.color,o.name,l):void 0,color:o.color,name:o.name}}),{x0:V.value.left*2,y0:V.value.top,x1:V.value.width,y1:V.value.height}));function he({y0:o,y1:a}){return a-o<=0?1e-4:a-o}function pe({x0:o,x1:a}){return a-o<=0?1e-4:a-o}function E(o){const a=t.value.style.chart.layout.labels.fontSize*(o.proportion*2>1?1:o.proportion*2);return a<t.value.style.chart.layout.labels.minFontSize?t.value.style.chart.layout.labels.minFontSize:a}function Pe(o){b.value=o,y.value+=1}const A=e.computed(()=>({startX:0,startY:0,width:V.value.vbWidth,height:V.value.vbHeight})),S=e.ref(!1);function G(o,a=_.value){for(const l of a){if(l.id===o)return l;if(l.children){const u=G(o,l.children);if(u)return u}}return null}function ze(o){if(S.value)h("selectDatapoint",void 0),W.value=_.value;else{if(h("selectDatapoint",o),!G(o.parentId))return;W.value=[G(o.parentId)]}S.value=!S.value}const N=e.ref(null),fe=e.computed(()=>_.value.map((o,a)=>({...o,color:r.convertColorToHex(o.color)||I.value[a]||r.palette[a]||r.palette[a%r.palette.length],shape:"square"})).sort((o,a)=>a.value-o.value).map((o,a)=>({...o,proportion:o.value/_.value.map(l=>l.value).reduce((l,u)=>l+u,0),opacity:g.value.includes(o.id)?.5:1}))),Ve=e.computed(()=>({cy:"treemap-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));function ge(o){S.value=!1,N.value=null,g.value.includes(o.id)?g.value=g.value.filter(a=>a!==o.id):g.value.length<s.dataset.length-1&&g.value.push(o.id),h("selectLegend",ce.value)}const j=e.ref(null);function _e({datapoint:o,seriesIndex:a}){N.value=o,j.value={datapoint:o,seriesIndex:a,config:t.value,series:L.value};const l=t.value.style.chart.tooltip.customFormat;if(r.isFunction(l)&&r.functionReturnsString(()=>l({seriesIndex:a,datapoint:o,series:L.value,config:t.value})))x.value=l({seriesIndex:a,datapoint:o,series:L.value,config:t.value});else{let u="";u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${o.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><rect x="0" y="0" height="12" width="12" stroke="none" fill="${o.color}"/></svg>`,u+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.formatter,o.value,r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:o.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:o,seriesIndex:a})}</b>`,x.value=`<div>${u}</div>`}C.value=!0}const B=e.computed(()=>{const o=F.value.map(l=>({name:l.name,color:l.color})),a=F.value.map(l=>l.value);return{head:o,body:a}});function me(){e.nextTick(()=>{const o=B.value.head.map((u,m)=>[[u.name],[B.value.body[m]],[isNaN(B.value.body[m]/R.value)?"-":B.value.body[m]/R.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-treemap"})})}const q=e.computed(()=>{const o=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage],a=B.value.head.map((m,z)=>{const H=r.applyDataLabel(t.value.style.chart.layout.labels.formatter,B.value.body[z],r.dataLabel({p:t.value.style.chart.layout.labels.prefix,v:B.value.body[z],s:t.value.style.chart.layout.labels.suffix,r:t.value.table.td.roundingValue}));return[{color:m.color,name:m.name,shape:"square"},H,isNaN(B.value.body[z]/R.value)?"-":r.dataLabel({v:B.value.body[z]/R.value*100,s:"%",r:t.value.table.td.roundingPercentage})]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:o,body:a,config:l}});function Ee(){return F.value}function ye(){$.value.showTable=!$.value.showTable}function be(){$.value.showTooltip=!$.value.showTooltip}const M=e.ref(!1);function X(){M.value=!M.value}return c({getData:Ee,generateCsv:me,generateImage:ue,generatePdf:se,toggleTable:ye,toggleTooltip:be,toggleAnnotator:X}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"treemapChart",ref:k,class:e.normalizeClass(`vue-ui-treemap ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; ${t.value.responsive?"height: 100%;":""} text-align:center;background:${t.value.style.chart.backgroundColor}`),id:`treemap_${w.value}`,onMouseenter:a[3]||(a[3]=()=>e.unref(te)(!0)),onMouseleave:a[4]||(a[4]=()=>e.unref(te)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(He.PenAndPaper,{key:0,svgRef:e.unref(le),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:M.value,onClose:X},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),Ne.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:J,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:O,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:6px`)},[(e.openBlock(),e.createBlock(Ae._sfc_main,{key:`title_${K.value}`,config:{title:{cy:"treemap-div-title",...t.value.style.chart.title},subtitle:{cy:"treemap-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value&&(e.unref(oe)||e.unref(U))?(e.openBlock(),e.createBlock(ke.UserOptions,{ref:"details",key:`user_option_${y.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(ne),isImaging:e.unref(re),uid:w.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:$.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:M.value,onToggleFullscreen:Pe,onGeneratePdf:e.unref(se),onGenerateCsv:me,onGenerateImage:e.unref(ue),onToggleTable:ye,onToggleTooltip:be,onToggleAnnotator:X,style:e.normalizeStyle({visibility:e.unref(oe)?e.unref(U)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:l,color:u})=>[e.renderSlot(o.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:l,color:u})),void 0,!0)]),key:"0"}:void 0,o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:u})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:u})),void 0,!0)]),key:"6"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:u})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:u})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:le,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value,"vue-data-ui-zoom-plus":!S.value,"vue-data-ui-zoom-minus":S.value}),viewBox:`${A.value.startX} ${A.value.startY} ${A.value.width<=0?10:A.value.width} ${A.value.height<=0?10:A.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: hidden; background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Me._sfc_main),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,u)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.chart.layout.rects.gradient.show?(e.openBlock(),e.createElementBlock("defs",lt,[e.createElementVNode("radialGradient",{id:`tgrad_${l.id}`,gradientTransform:"translate(-1, -1.000001) scale(2, 2)"},[e.createElementVNode("stop",{offset:"18%","stop-color":l.color},null,8,nt),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.lightenHexColor)(l.color,t.value.style.chart.layout.rects.gradient.intensity/100)},null,8,rt)],8,at)])):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(l,u)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:l.x0,y:l.y0,height:he(l),width:pe(l),fill:f.value?l.color:t.value.style.chart.layout.rects.gradient.show?`url(#tgrad_${l.id})`:l.color,rx:t.value.style.chart.layout.rects.borderRadius,stroke:N.value&&N.value.id===l.id?t.value.style.chart.layout.rects.selected.stroke:t.value.style.chart.layout.rects.stroke,"stroke-width":N.value&&N.value.id===l.id?t.value.style.chart.layout.rects.selected.strokeWidth:t.value.style.chart.layout.rects.strokeWidth,onClick:m=>ze(l),onMouseenter:()=>_e({datapoint:l,seriesIndex:u}),onMouseleave:a[0]||(a[0]=m=>{N.value=null,C.value=!1}),style:e.normalizeStyle(`opacity:${N.value?N.value.id===l.id?1:t.value.style.chart.layout.rects.selected.unselectedOpacity:1}`),class:"vue-ui-treemap-rect"},null,44,st),(e.openBlock(),e.createElementBlock("foreignObject",{x:l.x0,y:l.y0,height:he(l),width:pe(l),class:"vue-ui-treemap-cell-foreignObject"},[e.createElementVNode("div",it,[t.value.style.chart.layout.labels.showDefaultLabels&&(l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-treemap-cell-default",style:e.normalizeStyle(`width:calc(100% - ${E(l)/1.5}px);text-align:left;line-height:${E(l)<14?14:E(l)}px;padding:${E(l)/3}px; color:${e.unref(r.adaptColorToBackground)(l.color)}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(l.name),5),a[5]||(a[5]=e.createElementVNode("br",null,null,-1)),e.createElementVNode("span",{style:e.normalizeStyle(`width:100%;font-size:${E(l)}px;`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.layout.labels.rounding}),{datapoint:l})),5)],4)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"rect",e.mergeProps({ref_for:!0},{rect:l,shouldShow:l.proportion>t.value.style.chart.layout.labels.hideUnderProportion||S.value,fontSize:E(l),isZoom:S.value,textColor:e.unref(r.adaptColorToBackground)(l.color)}),void 0,!0)])],8,ut))]))),256)),e.renderSlot(o.$slots,"svg",e.normalizeProps(e.guardReactiveProps({svg:V.value,isZoom:S.value,rect:N.value,config:t.value})),void 0,!0)],14,ot)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ct,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(ne)||e.unref(re)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ie.default,{key:6,config:{type:"treemap",style:{backgroundColor:t.value.style.chart.backgroundColor,treemap:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:T},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(Fe.Legend,{key:`legend_${ee.value}`,legendSet:fe.value,config:Ve.value,id:`treemap_legend_${w.value}`,onClickMarker:a[1]||(a[1]=({legend:l})=>ge(l))},{item:e.withCtx(({legend:l,index:u})=>[e.createElementVNode("div",{onClick:m=>ge(l),style:e.normalizeStyle(`opacity:${g.value.includes(l.id)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.prefix,v:l.value,s:t.value.style.chart.layout.labels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l}))+" ",1),g.value.includes(l.id)?(e.openBlock(),e.createElementBlock("span",ht," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",vt," ("+e.toDisplayString(isNaN(l.value/R.value)?"-":(l.value/R.value*100).toFixed(t.value.style.chart.legend.roundingPercentage))+"%) ",1))],12,dt)]),_:1},8,["legendSet","config","id"])):e.renderSlot(o.$slots,"legend",{key:1,legend:fe.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:Z,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Le._sfc_main,{show:$.value.showTooltip&&C.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:k.value,content:x.value,isFullscreen:b.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),p.value?(e.openBlock(),e.createBlock(qe.default,{key:8,hideDetails:"",config:{open:$.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(De.DataTable,{key:`table_${Q.value}`,colNames:q.value.colNames,head:q.value.head,body:q.value.body,config:q.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>$.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,pt)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,tt))}},gt=Ge._export_sfc(ft,[["__scopeId","data-v-4d059d9f"]]);exports.default=gt;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useSlots as st, onMounted as Le, computed as k, ref as f, watch as rt, onBeforeUnmount as ut, createElementBlock as C, openBlock as p, unref as g, normalizeStyle as D, normalizeClass as De, createBlock as E, createCommentVNode as P, createElementVNode as z, createVNode as Me, createSlots as it, withCtx as x, renderSlot as $, normalizeProps as G, guardReactiveProps as q, Fragment as Ve, renderList as Ue, toDisplayString as Y, mergeProps as ct, createTextVNode as Be, nextTick as dt } from "vue";
|
|
2
|
-
import { u as vt, c as He, t as ht, p as O, a as ft, b as pt, o as gt, e as yt, d as ae, i as ne, f as K, X as mt, l as We, G as Ee, x as Ge, q as bt, r as wt, y as kt } from "./index-
|
|
3
|
-
import { _ as Ct } from "./Title-
|
|
4
|
-
import { u as $t, U as xt } from "./usePrinter-
|
|
5
|
-
import { _ as Tt } from "./Tooltip-
|
|
6
|
-
import { L as Ot } from "./Legend-
|
|
7
|
-
import _t from "./vue-ui-skeleton-
|
|
8
|
-
import { D as St } from "./DataTable
|
|
9
|
-
import Nt from "./vue-ui-accordion-
|
|
2
|
+
import { u as vt, c as He, t as ht, p as O, a as ft, b as pt, o as gt, e as yt, d as ae, i as ne, f as K, X as mt, l as We, G as Ee, x as Ge, q as bt, r as wt, y as kt } from "./index-BsIlHNy8.js";
|
|
3
|
+
import { _ as Ct } from "./Title-xPTli3hs.js";
|
|
4
|
+
import { u as $t, U as xt } from "./usePrinter-D5N6w7Rg.js";
|
|
5
|
+
import { _ as Tt } from "./Tooltip-D42o7dze.js";
|
|
6
|
+
import { L as Ot } from "./Legend-BbSQMgm3.js";
|
|
7
|
+
import _t from "./vue-ui-skeleton-DApuwwZF.js";
|
|
8
|
+
import { D as St } from "./DataTable--Aq5n5mR.js";
|
|
9
|
+
import Nt from "./vue-ui-accordion-COi2Xtsr.js";
|
|
10
10
|
import { t as Pt, u as zt } from "./useResponsive-vZgZwV-S.js";
|
|
11
|
-
import { u as qe } from "./useNestedProp-
|
|
12
|
-
import { _ as At } from "./PackageVersion-
|
|
13
|
-
import { P as Ft } from "./PenAndPaper-
|
|
11
|
+
import { u as qe } from "./useNestedProp-CyyJlG5K.js";
|
|
12
|
+
import { _ as At } from "./PackageVersion-CZ0-Jk6A.js";
|
|
13
|
+
import { P as Ft } from "./PenAndPaper-BFkX-O1c.js";
|
|
14
14
|
import { u as It } from "./useUserOptionState-BIvW1Kz7.js";
|
|
15
15
|
import { u as Rt } from "./useChartAccessibility-BWojgys7.js";
|
|
16
16
|
import { _ as Lt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { useCssVars as ct, useSlots as ht, computed as m, ref as i, watch as Ue, onMounted as Xe, onBeforeUnmount as pt, createElementBlock as r, openBlock as u, unref as d, normalizeStyle as c, normalizeClass as A, createBlock as B, createCommentVNode as p, renderSlot as b, createVNode as Y, createSlots as ce, withCtx as k, normalizeProps as X, guardReactiveProps as E, createElementVNode as n, toDisplayString as h, Fragment as H, renderList as W, mergeProps as yt, withKeys as gt, createTextVNode as ft } from "vue";
|
|
2
|
-
import { u as bt, c as mt, t as kt, p as R, a as _t, b as $t, o as Ee, e as K, v as N, d as he, i as le, f as D, X as wt, s as pe, w as xt, q as Ct, r as Tt, x as Lt, y as Nt } from "./index-
|
|
2
|
+
import { u as bt, c as mt, t as kt, p as R, a as _t, b as $t, o as Ee, e as K, v as N, d as he, i as le, f as D, X as wt, s as pe, w as xt, q as Ct, r as Tt, x as Lt, y as Nt } from "./index-BsIlHNy8.js";
|
|
3
3
|
import { t as Pt, u as St } from "./useResponsive-vZgZwV-S.js";
|
|
4
|
-
import { _ as Vt } from "./Title-
|
|
5
|
-
import { u as It, U as Ot } from "./usePrinter-
|
|
6
|
-
import { _ as Ft } from "./Tooltip-
|
|
7
|
-
import { L as He } from "./Legend-
|
|
8
|
-
import Mt from "./vue-ui-skeleton-
|
|
9
|
-
import zt from "./BaseIcon-
|
|
10
|
-
import At from "./vue-ui-accordion-
|
|
11
|
-
import { u as We } from "./useNestedProp-
|
|
12
|
-
import { _ as Bt } from "./PackageVersion-
|
|
13
|
-
import { P as Rt } from "./PenAndPaper-
|
|
4
|
+
import { _ as Vt } from "./Title-xPTli3hs.js";
|
|
5
|
+
import { u as It, U as Ot } from "./usePrinter-D5N6w7Rg.js";
|
|
6
|
+
import { _ as Ft } from "./Tooltip-D42o7dze.js";
|
|
7
|
+
import { L as He } from "./Legend-BbSQMgm3.js";
|
|
8
|
+
import Mt from "./vue-ui-skeleton-DApuwwZF.js";
|
|
9
|
+
import zt from "./BaseIcon-CCOXJ43P.js";
|
|
10
|
+
import At from "./vue-ui-accordion-COi2Xtsr.js";
|
|
11
|
+
import { u as We } from "./useNestedProp-CyyJlG5K.js";
|
|
12
|
+
import { _ as Bt } from "./PackageVersion-CZ0-Jk6A.js";
|
|
13
|
+
import { P as Rt } from "./PenAndPaper-BFkX-O1c.js";
|
|
14
14
|
import { u as Dt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
15
|
-
import { _ as Ge } from "./Shape-
|
|
15
|
+
import { _ as Ge } from "./Shape-CxNXalS-.js";
|
|
16
16
|
import { u as Ut } from "./useChartAccessibility-BWojgys7.js";
|
|
17
17
|
import { _ as Xt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
18
18
|
const Et = ["id"], Ht = ["onClick"], Wt = ["xmlns", "viewBox"], Gt = ["width", "height"], jt = ["id"], qt = ["stop-color"], Yt = ["stop-color"], Kt = { key: 1 }, Jt = ["x", "y", "width", "height", "fill", "rx"], Qt = ["x", "y", "width", "height", "fill", "rx", "stroke", "stroke-width"], Zt = ["x", "y", "width", "height", "fill", "rx", "stroke", "stroke-width"], ea = ["x2", "y1", "y2", "stroke", "stroke-width"], ta = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], aa = ["x", "y", "text-anchor", "font-size", "fill", "font-weight"], la = ["x", "y", "font-size", "fill", "font-weight"], oa = ["x", "y", "font-size", "fill", "font-weight"], na = ["x", "y", "font-size", "fill", "font-weight"], ua = ["y", "width", "height", "fill", "onMouseenter"], sa = {
|