vue-data-ui 2.4.47 → 2.4.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Arrow-C3u-U00V.cjs → Arrow-CTukks_V.cjs} +1 -1
- package/dist/{Arrow-C-PQX3ZC.js → Arrow-Q0cOmO5p.js} +1 -1
- package/dist/{BaseIcon-8y_okNW6.cjs → BaseIcon-2ZD3jgGz.cjs} +1 -1
- package/dist/{BaseIcon-BeAMtwQX.js → BaseIcon-CaYP30Aq.js} +1 -1
- package/dist/{DataTable-D7JlgAbC.js → DataTable-CO5C8Cmb.js} +2 -2
- package/dist/{DataTable-CfxOc-In.cjs → DataTable-kMUhutQ4.cjs} +1 -1
- package/dist/{Legend-DDuxh17p.cjs → Legend-DPHcmrzd.cjs} +1 -1
- package/dist/{Legend-CEhIHRJc.js → Legend-FZN9UHoI.js} +1 -1
- package/dist/{PackageVersion-8Ql1gdmo.js → PackageVersion-DYk2hOG1.js} +1 -1
- package/dist/{PackageVersion-Df1iPzMk.cjs → PackageVersion-rnWHRWGI.cjs} +1 -1
- package/dist/{PenAndPaper-CvGft3ku.cjs → PenAndPaper-BQl9-uX0.cjs} +1 -1
- package/dist/{PenAndPaper-b1ZmLra1.js → PenAndPaper-BfgS_5ux.js} +3 -3
- package/dist/{Shape-D3F3Ki5y.cjs → Shape-BblkpCyL.cjs} +1 -1
- package/dist/{Shape-CvBLjLSE.js → Shape-BqkMzXqo.js} +1 -1
- package/dist/{Slicer-CRXNOGCh.js → Slicer-DlgqsI5C.js} +2 -2
- package/dist/{Slicer-CHKuuOOo.cjs → Slicer-yEeqKUDF.cjs} +1 -1
- package/dist/{Title-URF9hufV.cjs → Title-5Vedk01J.cjs} +1 -1
- package/dist/{Title-_dfoh5WC.js → Title-DED-PQ7X.js} +1 -1
- package/dist/{Tooltip-CAkj2Rmy.js → Tooltip-CHseiJu8.js} +1 -1
- package/dist/{Tooltip-87gbw8Ir.cjs → Tooltip-DjCKBAC4.cjs} +1 -1
- package/dist/index-BHQZE19X.cjs +9 -0
- package/dist/{index-BUHajhqq.js → index-igxqCP2w.js} +7 -1
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +6 -0
- package/dist/types/vue-data-ui.d.ts +6 -0
- package/dist/{useNestedProp-a0uhe7rJ.js → useNestedProp-CSVnZVwZ.js} +1 -1
- package/dist/{useNestedProp-C-g0SLHN.cjs → useNestedProp-CwpqC_aE.cjs} +1 -1
- package/dist/{usePrinter-DLHRtlhI.js → usePrinter-CnZYDQXB.js} +1 -1
- package/dist/{usePrinter-4Zj_RZ5v.cjs → usePrinter-DVgxBO4o.cjs} +1 -1
- package/dist/{vue-data-ui-zjfs-rk-.js → vue-data-ui-B--WWkUM.js} +60 -60
- package/dist/{vue-data-ui-CPc7dZQe.cjs → vue-data-ui-BrRTkOqu.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-zI1BF0gA.cjs → vue-ui-3d-bar-BGVLnjCh.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-B60j7yco.js → vue-ui-3d-bar-OzzLYbUl.js} +9 -9
- package/dist/{vue-ui-accordion-C0oMKEv0.cjs → vue-ui-accordion-CRVWlHxs.cjs} +1 -1
- package/dist/{vue-ui-accordion-2QOotHrr.js → vue-ui-accordion-lF7yVkiT.js} +3 -3
- package/dist/{vue-ui-age-pyramid-BT7HUZpj.js → vue-ui-age-pyramid-5Vj8AtW1.js} +10 -10
- package/dist/{vue-ui-age-pyramid-hZLKWqN9.cjs → vue-ui-age-pyramid-Cv0Rddsx.cjs} +1 -1
- package/dist/{vue-ui-annotator-ZpGqgGMp.js → vue-ui-annotator-BmO78L3H.js} +1 -1
- package/dist/{vue-ui-annotator-Da8-IgfK.cjs → vue-ui-annotator-D8Hx1BFF.cjs} +1 -1
- package/dist/{vue-ui-bullet-BfkujrD0.cjs → vue-ui-bullet-C0Q2Vs5p.cjs} +1 -1
- package/dist/{vue-ui-bullet-Da56_P30.js → vue-ui-bullet-DwFD41hN.js} +8 -8
- package/dist/{vue-ui-candlestick-CblCXKhS.js → vue-ui-candlestick-By609gwn.js} +11 -11
- package/dist/{vue-ui-candlestick-fM3nUsgr.cjs → vue-ui-candlestick-C7kRHFF3.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-D3rcSdcC.cjs → vue-ui-carousel-table-1_Hy8sGL.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-B1U41lku.js → vue-ui-carousel-table-wwMoteEN.js} +4 -4
- package/dist/{vue-ui-chestnut-CtMm9Hev.cjs → vue-ui-chestnut-D3LGylRp.cjs} +1 -1
- package/dist/{vue-ui-chestnut-Cnvf2Aav.js → vue-ui-chestnut-hqorA5EW.js} +8 -8
- package/dist/{vue-ui-cursor-C-7zi0ol.cjs → vue-ui-cursor-BCg5VZUb.cjs} +1 -1
- package/dist/{vue-ui-cursor-TzS0sCy1.js → vue-ui-cursor-GSkn7N7Z.js} +2 -2
- package/dist/{vue-ui-dashboard-DdMkGnE7.cjs → vue-ui-dashboard-Bkm9bcAc.cjs} +1 -1
- package/dist/{vue-ui-dashboard-Ajvddjlt.js → vue-ui-dashboard-DIoYWyXB.js} +2 -2
- package/dist/{vue-ui-digits-DwB-tHKl.cjs → vue-ui-digits-CpBBTAI9.cjs} +1 -1
- package/dist/{vue-ui-digits-CBPttkF2.js → vue-ui-digits-niqTltAv.js} +2 -2
- package/dist/{vue-ui-donut-Cz6xpVSC.cjs → vue-ui-donut-CQEOtlxM.cjs} +1 -1
- package/dist/{vue-ui-donut-DidXxdXO.js → vue-ui-donut-DfufBrkk.js} +11 -11
- package/dist/{vue-ui-donut-evolution-Dj73srrD.cjs → vue-ui-donut-evolution-Dg_XJyX8.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-B0xdulgT.js → vue-ui-donut-evolution-XQp6R0e_.js} +11 -11
- package/dist/{vue-ui-dumbbell-Cimude8K.js → vue-ui-dumbbell-DSS8sHHU.js} +10 -10
- package/dist/{vue-ui-dumbbell-BdwXaRk2.cjs → vue-ui-dumbbell-RAkNYRoJ.cjs} +1 -1
- package/dist/{vue-ui-flow-D2ekJwov.js → vue-ui-flow-BBNuPVgI.js} +9 -9
- package/dist/{vue-ui-flow-DMNNOEJy.cjs → vue-ui-flow-BUmSGSmR.cjs} +1 -1
- package/dist/{vue-ui-funnel-DLmzVrrA.cjs → vue-ui-funnel-B9HR0owO.cjs} +1 -1
- package/dist/{vue-ui-funnel-BsKFz_A9.js → vue-ui-funnel-BDGggRXE.js} +8 -8
- package/dist/{vue-ui-galaxy-WAy90dGq.js → vue-ui-galaxy-6Odi2CwM.js} +11 -11
- package/dist/{vue-ui-galaxy-CnZYKQA2.cjs → vue-ui-galaxy-DmsMWB1a.cjs} +1 -1
- package/dist/{vue-ui-gauge-Xvk_SGCc.js → vue-ui-gauge-DeYvNVnR.js} +7 -7
- package/dist/{vue-ui-gauge-DhqOgkfq.cjs → vue-ui-gauge-Dvv0v56Z.cjs} +1 -1
- package/dist/{vue-ui-gizmo-D-djUfJw.js → vue-ui-gizmo-BcAr2dTN.js} +3 -3
- package/dist/{vue-ui-gizmo-B6qoNeBK.cjs → vue-ui-gizmo-DXQt_8D0.cjs} +1 -1
- package/dist/{vue-ui-heatmap-jmKDOYnr.js → vue-ui-heatmap-Btm1mK6D.js} +10 -10
- package/dist/{vue-ui-heatmap-CitZU9av.cjs → vue-ui-heatmap-DZ02dS5q.cjs} +1 -1
- package/dist/{vue-ui-history-plot-EzFdtBwU.cjs → vue-ui-history-plot-DPQWcN0P.cjs} +1 -1
- package/dist/{vue-ui-history-plot-BoR791Gc.js → vue-ui-history-plot-OY6N31Ka.js} +11 -11
- package/dist/{vue-ui-kpi-CMXhw4Ll.cjs → vue-ui-kpi-CQIbWQMk.cjs} +1 -1
- package/dist/{vue-ui-kpi-CB47PO72.js → vue-ui-kpi-D5oNUDVm.js} +3 -3
- package/dist/{vue-ui-mini-loader-D4dKItUb.js → vue-ui-mini-loader-BjqV22Co.js} +2 -2
- package/dist/{vue-ui-mini-loader-DJx2b1Hs.cjs → vue-ui-mini-loader-ByDKGMAp.cjs} +1 -1
- package/dist/{vue-ui-molecule-CnERhdxF.cjs → vue-ui-molecule-C8O_ViVy.cjs} +1 -1
- package/dist/{vue-ui-molecule-C_VM1ZP2.js → vue-ui-molecule-FsLf3YTj.js} +11 -11
- package/dist/{vue-ui-mood-radar-BESMMSxA.js → vue-ui-mood-radar-31BX-GNG.js} +11 -11
- package/dist/{vue-ui-mood-radar-BBlokNSE.cjs → vue-ui-mood-radar-4u98wGWl.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-r1v-A7E3.js → vue-ui-nested-donuts-BMJW2oHk.js} +11 -11
- package/dist/{vue-ui-nested-donuts-C0IAo5oO.cjs → vue-ui-nested-donuts-BPc_OBoe.cjs} +1 -1
- package/dist/{vue-ui-onion-CZuFxIOX.js → vue-ui-onion-BUpGgnWA.js} +11 -11
- package/dist/{vue-ui-onion-PaHP7qHI.cjs → vue-ui-onion-IhkIHn1A.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-BeAArg3p.js → vue-ui-parallel-coordinate-plot-9I00rQEM.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-Bwu4Q1dB.cjs → vue-ui-parallel-coordinate-plot-DzjggyLA.cjs} +1 -1
- package/dist/{vue-ui-quadrant-D5m9y_Vd.js → vue-ui-quadrant-CEmoMAL7.js} +12 -12
- package/dist/{vue-ui-quadrant-BLpgNZs9.cjs → vue-ui-quadrant-EZqQ-7Ev.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-CZ6gBVVk.cjs → vue-ui-quick-chart-BKUUR-A1.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-Ci4RKL62.js → vue-ui-quick-chart-T_oeRTqY.js} +9 -9
- package/dist/{vue-ui-radar-03mjX9gn.js → vue-ui-radar-DG_Zir8w.js} +12 -12
- package/dist/{vue-ui-radar-Ca1AvJAF.cjs → vue-ui-radar-QBwo6ybW.cjs} +1 -1
- package/dist/{vue-ui-rating-Dilq1rrJ.cjs → vue-ui-rating-Juprijdi.cjs} +1 -1
- package/dist/{vue-ui-rating-CSSdVGTk.js → vue-ui-rating-gswAA28b.js} +2 -2
- package/dist/{vue-ui-relation-circle-DsckG4af.cjs → vue-ui-relation-circle-BWX8zrfH.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-B3J9KW9u.js → vue-ui-relation-circle-DtnXrnOP.js} +7 -7
- package/dist/{vue-ui-rings-COAgson6.js → vue-ui-rings-D3g-ORch.js} +11 -11
- package/dist/{vue-ui-rings-6g022zEh.cjs → vue-ui-rings-Damuv7g9.cjs} +1 -1
- package/dist/{vue-ui-scatter-BrdWaLV6.js → vue-ui-scatter-DBO-XViT.js} +12 -12
- package/dist/{vue-ui-scatter-B3t_Q_4g.cjs → vue-ui-scatter-RUeAe7Sx.cjs} +1 -1
- package/dist/{vue-ui-screenshot-NpTxyR66.cjs → vue-ui-screenshot-3MDyr6v3.cjs} +1 -1
- package/dist/{vue-ui-screenshot-CWMAfSH3.js → vue-ui-screenshot-K0a-DVD6.js} +1 -1
- package/dist/{vue-ui-skeleton-BXPvqUO_.js → vue-ui-skeleton-CWjNNx-k.js} +3 -3
- package/dist/{vue-ui-skeleton-D6mdHYxB.cjs → vue-ui-skeleton-DUNkS05l.cjs} +1 -1
- package/dist/{vue-ui-smiley-BIAA0JuB.cjs → vue-ui-smiley-Cbqg-N-L.cjs} +1 -1
- package/dist/{vue-ui-smiley-TNgEIMFs.js → vue-ui-smiley-MwX1c6qK.js} +2 -2
- package/dist/{vue-ui-spark-trend-BWb59zfs.cjs → vue-ui-spark-trend-CN5JUPhn.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-Xtb0H-Ra.js → vue-ui-spark-trend-D9eWTtbE.js} +5 -5
- package/dist/{vue-ui-sparkbar-CO0RYq4S.js → vue-ui-sparkbar-CPF7YNDd.js} +4 -4
- package/dist/{vue-ui-sparkbar-mgvNuWjK.cjs → vue-ui-sparkbar-IphZ8jXh.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-Cn17RyPJ.js → vue-ui-sparkgauge-B29V7ZTv.js} +4 -4
- package/dist/{vue-ui-sparkgauge-CfgH_pIo.cjs → vue-ui-sparkgauge-BRMGqR9Z.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-yTF-QJCM.js → vue-ui-sparkhistogram-BJTgOWF5.js} +5 -5
- package/dist/{vue-ui-sparkhistogram-BU1jgcm9.cjs → vue-ui-sparkhistogram-rvYaVHmw.cjs} +1 -1
- package/dist/{vue-ui-sparkline-3ym-6DFE.cjs → vue-ui-sparkline-BI9jqI0h.cjs} +1 -1
- package/dist/{vue-ui-sparkline-D80w9cUt.js → vue-ui-sparkline-DX79otAB.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-C1zVZqZh.cjs → vue-ui-sparkstackbar-DuollcwK.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-DhQNOgjS.js → vue-ui-sparkstackbar-vP28A6AT.js} +5 -5
- package/dist/{vue-ui-stackbar-yiVhLavI.cjs → vue-ui-stackbar-BumFmZZF.cjs} +1 -1
- package/dist/{vue-ui-stackbar-C_b754Op.js → vue-ui-stackbar-DnJEgIaA.js} +12 -12
- package/dist/{vue-ui-strip-plot-CqP7E3Fr.js → vue-ui-strip-plot-DqcHBwd_.js} +11 -11
- package/dist/{vue-ui-strip-plot-CK-U0tNX.cjs → vue-ui-strip-plot-DupREfRd.cjs} +1 -1
- package/dist/{vue-ui-table-x2Ylaftx.cjs → vue-ui-table-BMJ0I5nr.cjs} +1 -1
- package/dist/{vue-ui-table-BLPLqFFd.js → vue-ui-table-D8cgqIJl.js} +1 -1
- package/dist/{vue-ui-table-heatmap-2Qm41w8P.cjs → vue-ui-table-heatmap-D43pTFli.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-jWG59f0S.js → vue-ui-table-heatmap-D4qeClXn.js} +4 -4
- package/dist/vue-ui-table-sparkline-B7OPOium.cjs +1 -0
- package/dist/vue-ui-table-sparkline-B_Po0RuC.js +583 -0
- package/dist/{vue-ui-thermometer-CS4v4vKk.js → vue-ui-thermometer-C6nfW6uY.js} +7 -7
- package/dist/{vue-ui-thermometer-DVPaZfi5.cjs → vue-ui-thermometer-CaV3JF3h.cjs} +1 -1
- package/dist/{vue-ui-timer-op_p9xjL.js → vue-ui-timer-CfwmMRdZ.js} +5 -5
- package/dist/{vue-ui-timer-Bu17pe7S.cjs → vue-ui-timer-ldINTqND.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-CoKFLMWh.cjs → vue-ui-tiremarks-BlyxL_IU.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-CzNBUmn2.js → vue-ui-tiremarks-iNKMnu3P.js} +7 -7
- package/dist/{vue-ui-treemap-DLDn1gQ2.js → vue-ui-treemap-CwMnkcOi.js} +11 -11
- package/dist/{vue-ui-treemap-DXU0BagE.cjs → vue-ui-treemap-YdRDlSHA.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-BqTIL5Np.js → vue-ui-vertical-bar-BZR4YOLh.js} +11 -11
- package/dist/{vue-ui-vertical-bar-BlG3HwaX.cjs → vue-ui-vertical-bar-Bji3-X8i.cjs} +1 -1
- package/dist/{vue-ui-waffle-DFjArEi_.js → vue-ui-waffle-D2BccJmB.js} +11 -11
- package/dist/{vue-ui-waffle-CaTFfTmj.cjs → vue-ui-waffle-rO_LJaHR.cjs} +1 -1
- package/dist/{vue-ui-wheel-B22xmLY4.cjs → vue-ui-wheel-BTrpdV-C.cjs} +1 -1
- package/dist/{vue-ui-wheel-C95mjUTI.js → vue-ui-wheel-GqWFopE1.js} +7 -7
- package/dist/{vue-ui-word-cloud-05iWIjGT.cjs → vue-ui-word-cloud-DD-pKUen.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-Byx-M5Jn.js → vue-ui-word-cloud-DiG8DHOr.js} +10 -10
- package/dist/{vue-ui-xy-lPnzrWt8.cjs → vue-ui-xy-C32KNdyx.cjs} +1 -1
- package/dist/{vue-ui-xy-C8YrIKK6.js → vue-ui-xy-DicLnkBA.js} +14 -14
- package/dist/{vue-ui-xy-canvas-os8jbTXb.cjs → vue-ui-xy-canvas-9e630nJX.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-Cg0PIT5i.js → vue-ui-xy-canvas-D6CYL9A8.js} +11 -11
- package/package.json +1 -1
- package/dist/index-KYU_8xrX.cjs +0 -9
- package/dist/vue-ui-table-sparkline-BEeO-aWa.js +0 -516
- package/dist/vue-ui-table-sparkline-C0vzS1F3.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-KYU_8xrX.cjs"),P=require("./useNestedProp-C-g0SLHN.cjs"),G=require("./vue-ui-skeleton-D6mdHYxB.cjs"),M=require("./useResponsive-BJ7DTGpm.cjs"),R=require("./PackageVersion-Df1iPzMk.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U=["id"],X=["xmlns","viewBox"],Z=["id"],Y=["stop-color"],J=["stop-color"],K=["id"],Q=["stop-color"],ee=["stop-color"],te=["id"],le=["stop-color"],ae=["stop-color"],oe={key:0},re=["d","fill"],ue=["d","fill"],ne=["d","stroke","stroke-width"],se=["x1","x2","y1","y2","stroke","stroke-width"],ie=["x","y","width","height","fill","rx"],de=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ce=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ve=["cx","cy","r","fill","stroke","stroke-width"],he=["x","y","font-size","font-weight","fill"],ye=["x","y","height","width","onMouseenter","onClick"],pe={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0},heightRatio:{type:Number,default:1},forcedPadding:{type:Number,default:30}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:x}){const i=f,{vue_ui_sparkline:z}=u.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(u.createUid()),w=e.ref(null),L=e.ref(null),C=e.ref(null),t=e.computed({get:()=>V(),set:l=>l});function V(){const l=P.useNestedProp({userConfig:i.config,defaultConfig:z});return l.theme?{...P.useNestedProp({userConfig:u.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}const b=e.computed(()=>u.largestTriangleThreeBucketsArrayObjects({data:i.dataset,threshold:t.value.downsample.threshold}));e.watch(()=>i.config,l=>{t.value=V(),$(),o.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>i.dataset,l=>{p.value=u.largestTriangleThreeBucketsArrayObjects({data:i.dataset.map(r=>({...r,value:[void 0].includes(r.value)?null:r.value})),threshold:t.value.downsample.threshold})},{deep:!0});const p=e.ref(A());function A(){return u.largestTriangleThreeBucketsArrayObjects({data:i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}),threshold:t.value.downsample.threshold})}const E=e.ref(null);e.onMounted(()=>{if($(),t.value.style.animation.show&&i.dataset.length>1){let a=function(){r<b.value.length?(p.value.push(b.value[r]),setTimeout(()=>{requestAnimationFrame(a)},l)):p.value=b.value,r+=1};p.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let r=0;a()}});function $(){if(u.objectIsEmpty(i.dataset)?u.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,r)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{u.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.responsive){const l=M.throttle(()=>{const{width:r,height:a}=M.useResponsive({chart:w.value,title:t.value.style.title.show&&i.showInfo?L.value:null,source:C.value});o.value.width=r,o.value.height=a,o.value.chartWidth=t.value.style.chartWidth/500*r,o.value.padding=i.forcedPadding/500*r});E.value=new ResizeObserver(l),E.value.observe(w.value.parentNode)}}const o=e.ref({height:80*i.heightRatio,width:500,chartWidth:t.value.style.chartWidth,padding:i.forcedPadding}),T=e.ref(6),n=e.computed(()=>({top:12,left:0,right:o.value.width,bottom:o.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?o.value.width-o.value.chartWidth:o.value.padding,width:i.showInfo&&t.value.style.dataLabel.show?o.value.chartWidth:o.value.width-o.value.padding,height:o.value.height-12})),N=e.computed(()=>Math.min(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),D=e.computed(()=>Math.max(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),m=e.computed(()=>{const l=N.value>=0?0:N.value;return Math.abs(l)}),O=e.computed(()=>D.value+m.value+T.value),_=e.computed(()=>n.value.bottom-n.value.height*B(m.value));function B(l){return l/O.value}const h=e.computed(()=>b.value.length-1),s=e.computed(()=>p.value.map((l,r)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0;return{absoluteValue:a,period:l.period,plotValue:a+m.value,toMax:B(a+m.value),x:n.value.start+r*(n.value.width/(h.value+1)>o.padding?o.padding:n.value.width/(h.value+1)),y:n.value.bottom-n.value.height*B(a+m.value),id:`plot_${v.value}_${r}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?u.shiftHue(t.value.style.line.color,.05*(1-r/h.value)):t.value.style.line.color,width:n.value.width/(h.value+1)>o.padding?o.padding:n.value.width/(h.value+1)}})),W=e.computed(()=>{const l={x:s.value[0].x,y:o.value.height-6},r={x:s.value[s.value.length-1].x,y:o.value.height-6},a=[];return s.value.forEach(d=>{a.push(`${d.x},${d.y} `)}),[l.x,l.y,...a,r.x,r.y].toString()}),c=e.ref(void 0);function F(l,r){c.value=l,x("hoverIndex",{index:r})}function j(){c.value=void 0,x("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(g.value){const l=s.value.map(a=>a.absoluteValue),r=l.reduce((a,d)=>a+d,0);return{latest:s.value[s.value.length-1].absoluteValue,sum:r,average:r/s.value.length,median:u.calcMedian(l),trend:u.calcLinearProgression(s.value.map(({x:a,y:d,absoluteValue:S})=>({x:a,y:d,value:S}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),I=e.computed(()=>g.value?t.value.style.dataLabel.valueType==="latest"?y.value.latest:t.value.style.dataLabel.valueType==="sum"?y.value.sum:t.value.style.dataLabel.valueType==="average"?y.value.average:0:0),k=e.computed(()=>t.value.type&&t.value.type==="bar");function q(l,r){x("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:w,class:"vue-ui-sparkline",id:v.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily};`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:c.value,latest:y.value.latest,sum:y.value.sum,average:y.value.average,median:y.value.median,trend:y.value.trend})),void 0,!0),t.value.style.title.show&&f.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:L,class:"vue-ui-sparkline-title",style:e.normalizeStyle(`display:flex;align-items:center;width:100%;color:${t.value.style.title.color};background:${t.value.style.backgroundColor};justify-content:${t.value.style.title.textAlign==="left"?"flex-start":t.value.style.title.textAlign==="right"?"flex-end":"center"};height:${t.value.style.title.fontSize*2}px;font-size:${t.value.style.title.fontSize}px;font-weight:${t.value.style.title.bold?"bold":"normal"};`)},[e.createElementVNode("span",{style:e.normalizeStyle(`padding:${t.value.style.title.textAlign==="left"?"0 0 0 12px":t.value.style.title.textAlign==="right"?"0 12px 0 0":"0"}`)},e.toDisplayString(c.value?c.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createVNode(R._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkline_gradient_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.setOpacity)(e.unref(u.shiftHue)(t.value.style.area.color,.05),t.value.style.area.opacity)},null,8,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,J)],8,Z),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_pos_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.bar.color},null,8,Q),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,ee)],8,K),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,le),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,ae)],8,te)]),t.value.style.area.show&&!k.value&&s.value[0]?(e.openBlock(),e.createElementBlock("g",oe,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${s.value[0].x},${n.value.bottom} ${e.unref(u.createSmoothPath)(s.value)} L ${s.value.at(-1).x},${n.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,re)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${W.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ue))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(u.createSmoothPath)(s.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,ne)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[d<s.value.length-1&&!t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:s.value[d+1].x,y1:a.y,y2:s.value[d+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,se)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:_.value,width:a.width,height:Math.abs(a.y-_.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${v.value})`:`url(#sparkline_bar_gradient_neg_${v.value})`,rx:t.value.style.bar.borderRadius},null,8,ie)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||f.selectedIndex===d)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:n.value.top-6,y2:n.value.bottom,stroke:t.value.style.verticalIndicator.color||a.color,"stroke-width":t.value.style.verticalIndicator.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.verticalIndicator.strokeDasharray||0},null,8,de)):e.createCommentVNode("",!0)]))),256)),N.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.value.start,x2:n.value.start+n.value.width-16,y1:_.value,y2:_.value,stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,ce)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||f.selectedIndex===d?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:a.x,cy:a.y,r:t.value.style.plot.radius,fill:a.color,stroke:t.value.style.plot.stroke,"stroke-width":t.value.style.plot.strokeWidth},null,8,ve)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),f.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:n.value.width+12+t.value.style.dataLabel.offsetX,y:o.value.height/2+t.value.style.dataLabel.fontSize/2.5+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,"font-weight":t.value.style.dataLabel.bold?"bold":"normal",fill:t.value.style.dataLabel.color},e.toDisplayString(c.value?e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,c.value.absoluteValue,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:c.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:c.value}):e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,I.value,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:I.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,he)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(n.value.width/(h.value+1)>o.value.padding?o.value.padding:n.value.width/(h.value+1))/2,y:n.value.top-6,height:n.value.height+6,width:n.value.width/(h.value+1)>o.value.padding?o.value.padding:n.value.width/(h.value+1),fill:"transparent",onMouseenter:S=>F(a,d),onMouseleave:j,onClick:()=>q(a,d)},null,40,ye))),256)),e.renderSlot(l.$slots,"svg",{svg:o.value},void 0,!0)],12,X)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"source",ref:C,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(G.default,{key:3,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,U))}},fe=H._export_sfc(pe,[["__scopeId","data-v-f4a182c7"]]);exports.default=fe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-BHQZE19X.cjs"),P=require("./useNestedProp-CwpqC_aE.cjs"),G=require("./vue-ui-skeleton-DUNkS05l.cjs"),M=require("./useResponsive-BJ7DTGpm.cjs"),R=require("./PackageVersion-rnWHRWGI.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U=["id"],X=["xmlns","viewBox"],Z=["id"],Y=["stop-color"],J=["stop-color"],K=["id"],Q=["stop-color"],ee=["stop-color"],te=["id"],le=["stop-color"],ae=["stop-color"],oe={key:0},re=["d","fill"],ue=["d","fill"],ne=["d","stroke","stroke-width"],se=["x1","x2","y1","y2","stroke","stroke-width"],ie=["x","y","width","height","fill","rx"],de=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ce=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],ve=["cx","cy","r","fill","stroke","stroke-width"],he=["x","y","font-size","font-weight","fill"],ye=["x","y","height","width","onMouseenter","onClick"],pe={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0},heightRatio:{type:Number,default:1},forcedPadding:{type:Number,default:30}},emits:["hoverIndex","selectDatapoint"],setup(f,{emit:x}){const i=f,{vue_ui_sparkline:z}=u.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(u.createUid()),w=e.ref(null),L=e.ref(null),C=e.ref(null),t=e.computed({get:()=>V(),set:l=>l});function V(){const l=P.useNestedProp({userConfig:i.config,defaultConfig:z});return l.theme?{...P.useNestedProp({userConfig:u.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}const b=e.computed(()=>u.largestTriangleThreeBucketsArrayObjects({data:i.dataset,threshold:t.value.downsample.threshold}));e.watch(()=>i.config,l=>{t.value=V(),$(),o.value.chartWidth=t.value.style.chartWidth},{deep:!0}),e.watch(()=>i.dataset,l=>{p.value=u.largestTriangleThreeBucketsArrayObjects({data:i.dataset.map(r=>({...r,value:[void 0].includes(r.value)?null:r.value})),threshold:t.value.downsample.threshold})},{deep:!0});const p=e.ref(A());function A(){return u.largestTriangleThreeBucketsArrayObjects({data:i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}),threshold:t.value.downsample.threshold})}const E=e.ref(null);e.onMounted(()=>{if($(),t.value.style.animation.show&&i.dataset.length>1){let a=function(){r<b.value.length?(p.value.push(b.value[r]),setTimeout(()=>{requestAnimationFrame(a)},l)):p.value=b.value,r+=1};p.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let r=0;a()}});function $(){if(u.objectIsEmpty(i.dataset)?u.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,r)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{u.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.responsive){const l=M.throttle(()=>{const{width:r,height:a}=M.useResponsive({chart:w.value,title:t.value.style.title.show&&i.showInfo?L.value:null,source:C.value});o.value.width=r,o.value.height=a,o.value.chartWidth=t.value.style.chartWidth/500*r,o.value.padding=i.forcedPadding/500*r});E.value=new ResizeObserver(l),E.value.observe(w.value.parentNode)}}const o=e.ref({height:80*i.heightRatio,width:500,chartWidth:t.value.style.chartWidth,padding:i.forcedPadding}),T=e.ref(6),n=e.computed(()=>({top:12,left:0,right:o.value.width,bottom:o.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?o.value.width-o.value.chartWidth:o.value.padding,width:i.showInfo&&t.value.style.dataLabel.show?o.value.chartWidth:o.value.width-o.value.padding,height:o.value.height-12})),N=e.computed(()=>Math.min(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),D=e.computed(()=>Math.max(...p.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),m=e.computed(()=>{const l=N.value>=0?0:N.value;return Math.abs(l)}),O=e.computed(()=>D.value+m.value+T.value),_=e.computed(()=>n.value.bottom-n.value.height*B(m.value));function B(l){return l/O.value}const h=e.computed(()=>b.value.length-1),s=e.computed(()=>p.value.map((l,r)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0;return{absoluteValue:a,period:l.period,plotValue:a+m.value,toMax:B(a+m.value),x:n.value.start+r*(n.value.width/(h.value+1)>o.padding?o.padding:n.value.width/(h.value+1)),y:n.value.bottom-n.value.height*B(a+m.value),id:`plot_${v.value}_${r}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?u.shiftHue(t.value.style.line.color,.05*(1-r/h.value)):t.value.style.line.color,width:n.value.width/(h.value+1)>o.padding?o.padding:n.value.width/(h.value+1)}})),W=e.computed(()=>{const l={x:s.value[0].x,y:o.value.height-6},r={x:s.value[s.value.length-1].x,y:o.value.height-6},a=[];return s.value.forEach(d=>{a.push(`${d.x},${d.y} `)}),[l.x,l.y,...a,r.x,r.y].toString()}),c=e.ref(void 0);function F(l,r){c.value=l,x("hoverIndex",{index:r})}function j(){c.value=void 0,x("hoverIndex",{index:void 0})}const y=e.computed(()=>{if(g.value){const l=s.value.map(a=>a.absoluteValue),r=l.reduce((a,d)=>a+d,0);return{latest:s.value[s.value.length-1].absoluteValue,sum:r,average:r/s.value.length,median:u.calcMedian(l),trend:u.calcLinearProgression(s.value.map(({x:a,y:d,absoluteValue:S})=>({x:a,y:d,value:S}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),I=e.computed(()=>g.value?t.value.style.dataLabel.valueType==="latest"?y.value.latest:t.value.style.dataLabel.valueType==="sum"?y.value.sum:t.value.style.dataLabel.valueType==="average"?y.value.average:0:0),k=e.computed(()=>t.value.type&&t.value.type==="bar");function q(l,r){x("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparklineChart",ref:w,class:"vue-ui-sparkline",id:v.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily};`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:c.value,latest:y.value.latest,sum:y.value.sum,average:y.value.average,median:y.value.median,trend:y.value.trend})),void 0,!0),t.value.style.title.show&&f.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:L,class:"vue-ui-sparkline-title",style:e.normalizeStyle(`display:flex;align-items:center;width:100%;color:${t.value.style.title.color};background:${t.value.style.backgroundColor};justify-content:${t.value.style.title.textAlign==="left"?"flex-start":t.value.style.title.textAlign==="right"?"flex-end":"center"};height:${t.value.style.title.fontSize*2}px;font-size:${t.value.style.title.fontSize}px;font-weight:${t.value.style.title.bold?"bold":"normal"};`)},[e.createElementVNode("span",{style:e.normalizeStyle(`padding:${t.value.style.title.textAlign==="left"?"0 0 0 12px":t.value.style.title.textAlign==="right"?"0 12px 0 0":"0"}`)},e.toDisplayString(c.value?c.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createVNode(R._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkline_gradient_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.setOpacity)(e.unref(u.shiftHue)(t.value.style.area.color,.05),t.value.style.area.opacity)},null,8,Y),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,J)],8,Z),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_pos_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.bar.color},null,8,Q),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,ee)],8,K),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(u.shiftHue)(t.value.style.bar.color,.05)},null,8,le),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,ae)],8,te)]),t.value.style.area.show&&!k.value&&s.value[0]?(e.openBlock(),e.createElementBlock("g",oe,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${s.value[0].x},${n.value.bottom} ${e.unref(u.createSmoothPath)(s.value)} L ${s.value.at(-1).x},${n.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,re)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${W.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:e.unref(u.setOpacity)(t.value.style.area.color,t.value.style.area.opacity)},null,8,ue))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(u.createSmoothPath)(s.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,ne)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[d<s.value.length-1&&!t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:s.value[d+1].x,y1:a.y,y2:s.value[d+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,se)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:_.value,width:a.width,height:Math.abs(a.y-_.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${v.value})`:`url(#sparkline_bar_gradient_neg_${v.value})`,rx:t.value.style.bar.borderRadius},null,8,ie)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||f.selectedIndex===d)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:n.value.top-6,y2:n.value.bottom,stroke:t.value.style.verticalIndicator.color||a.color,"stroke-width":t.value.style.verticalIndicator.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.verticalIndicator.strokeDasharray||0},null,8,de)):e.createCommentVNode("",!0)]))),256)),N.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.value.start,x2:n.value.start+n.value.width-16,y1:_.value,y2:_.value,stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,ce)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||f.selectedIndex===d?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:a.x,cy:a.y,r:t.value.style.plot.radius,fill:a.color,stroke:t.value.style.plot.stroke,"stroke-width":t.value.style.plot.strokeWidth},null,8,ve)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),f.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:n.value.width+12+t.value.style.dataLabel.offsetX,y:o.value.height/2+t.value.style.dataLabel.fontSize/2.5+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,"font-weight":t.value.style.dataLabel.bold?"bold":"normal",fill:t.value.style.dataLabel.color},e.toDisplayString(c.value?e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,c.value.absoluteValue,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:c.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:c.value}):e.unref(u.applyDataLabel)(t.value.style.dataLabel.formatter,I.value,e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:I.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,he)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(a,d)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(n.value.width/(h.value+1)>o.value.padding?o.value.padding:n.value.width/(h.value+1))/2,y:n.value.top-6,height:n.value.height+6,width:n.value.width/(h.value+1)>o.value.padding?o.value.padding:n.value.width/(h.value+1),fill:"transparent",onMouseenter:S=>F(a,d),onMouseleave:j,onClick:()=>q(a,d)},null,40,ye))),256)),e.renderSlot(l.$slots,"svg",{svg:o.value},void 0,!0)],12,X)):e.createCommentVNode("",!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"source",ref:C,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(G.default,{key:3,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,U))}},fe=H._export_sfc(pe,[["__scopeId","data-v-f4a182c7"]]);exports.default=fe;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { computed as v, ref as m, watch as U, onMounted as re, openBlock as o, createElementBlock as n, normalizeStyle as C, renderSlot as W, normalizeProps as ne, guardReactiveProps as ie, createElementVNode as f, toDisplayString as X, createCommentVNode as y, unref as c, createVNode as de, Fragment as A, renderList as D, createBlock as ve } from "vue";
|
|
2
|
-
import { u as ce, c as he, t as ye, _ as T, o as fe, e as Z, g as pe, w as I, $ as ge, a0 as me, X as ke, s as M, R as q, i as H, f as Y } from "./index-
|
|
3
|
-
import { u as J } from "./useNestedProp-
|
|
4
|
-
import be from "./vue-ui-skeleton-
|
|
2
|
+
import { u as ce, c as he, t as ye, _ as T, o as fe, e as Z, g as pe, w as I, $ as ge, a0 as me, X as ke, s as M, R as q, i as H, f as Y } from "./index-igxqCP2w.js";
|
|
3
|
+
import { u as J } from "./useNestedProp-CSVnZVwZ.js";
|
|
4
|
+
import be from "./vue-ui-skeleton-CWjNNx-k.js";
|
|
5
5
|
import { t as _e, u as xe } from "./useResponsive-CoxXLe23.js";
|
|
6
|
-
import { _ as we } from "./PackageVersion-
|
|
6
|
+
import { _ as we } from "./PackageVersion-DYk2hOG1.js";
|
|
7
7
|
import { _ as Le } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
const $e = ["id"], Ne = ["xmlns", "viewBox"], Ce = ["id"], Ie = ["stop-color"], Me = ["stop-color"], Pe = ["id"], Ve = ["stop-color"], ze = ["stop-color"], Se = ["id"], We = ["stop-color"], Ae = ["stop-color"], De = { key: 0 }, Te = ["d", "fill"], Be = ["d", "fill"], Fe = ["d", "stroke", "stroke-width"], Ge = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Oe = ["x", "y", "width", "height", "fill", "rx"], Re = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ee = ["x1", "x2", "y1", "y2", "stroke", "stroke-dasharray", "stroke-width"], je = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Ue = ["x", "y", "font-size", "font-weight", "fill"], Xe = ["x", "y", "height", "width", "onMouseenter", "onClick"], Ze = {
|
|
9
9
|
__name: "vue-ui-sparkline",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-KYU_8xrX.cjs"),V=require("./useNestedProp-C-g0SLHN.cjs"),A=require("./vue-ui-skeleton-D6mdHYxB.cjs"),q=require("./PackageVersion-Df1iPzMk.cjs"),O=require("./Tooltip-87gbw8Ir.cjs"),U=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["xmlns","viewBox"],M=["id"],H=["stop-color"],I=["stop-color"],R=["stop-color"],W={id:"stackPill",clipPathUnits:"objectBoundingBox"},Y=["fill"],G={key:0,"clip-path":"url(#stackPill)"},X=["x","width","height","fill"],J=["x","width","height","fill","stroke"],K=["onClick","x","width","height","onMouseenter"],Q=["width","height","rx"],Z=["onClick"],ee={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},te=["height","width"],le=["fill"],oe={key:4,ref:"source",dir:"auto"},ae={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(P,{emit:D}){const u=P,{vue_ui_sparkstackbar:L}=a.useConfig(),x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),_=e.ref(""),t=e.computed({get:()=>$(),set:l=>l});function $(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:L});return l.theme?{...V.useNestedProp({userConfig:a.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>u.config,l=>{t.value=$(),E()},{deep:!0}),e.watch(()=>u.dataset,l=>{p.value=u.dataset.map((n,o)=>({...n,color:n.color?a.convertColorToHex(n.color):f.value[o]||a.palette[o]||a.palette[o%a.palette.length]}))},{deep:!0});const f=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),p=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?a.convertColorToHex(l.color):f.value[n]||a.palette[n]||a.palette[n%a.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(E(),t.value.style.animation.show){let v=function(){r+=o/l,r<o?(p.value=p.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length]})),requestAnimationFrame(v)):(g.value=!1,p.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length],id:a.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),o=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,v()}});function E(){a.objectIsEmpty(u.dataset)?a.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(o=>{a.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:o,index:n})})})}const c=e.ref({width:500,height:16}),d=e.ref([]),N=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!d.value.includes(n)).reduce((l,n)=>l+n,0)),y=e.computed(()=>p.value.map((l,n)=>{const o=l.value||0,r=o/N.value,v=isNaN(r)?0:r,s=v*c.value.width;return{...l,value:o,proportion:v,width:s,proportionLabel:a.dataLabel({v:v*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),C=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function F(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<p.value.length-1&&d.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let o=0;o<C.value.length;o+=1)n.push({...C.value[o],start:l}),l+=C.value[o].width;return n});function z(l,n){D("selectDatapoint",{datapoint:l,index:n})}const w=e.ref(null),k=e.ref(!1),m=e.ref(null);function T({datapoint:l,seriesIndex:n}){if(!t.value.style.tooltip.show)return;w.value={datapoint:l,seriesIndex:n,config:t.value,series:y.value},b.value=!0,m.value=n;const o=t.value.style.tooltip.customFormat;if(a.isFunction(o))try{const r=o({seriesIndex:n,datapoint:l,series:y.value,config:t.value});typeof r=="string"&&(_.value=r,k.value=!0)}catch{console.warn("Custom format cannot be applied."),k.value=!1}if(!k.value){let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,r+=`<b>${l.proportionLabel}</b>`,r+=`<span>(${a.applyDataLabel(t.value.style.legend.value.formatter,l.value,a.dataLabel({p:t.value.style.legend.value.prefix,v:l.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:l,seriesIndex:n})})</span>`,_.value=`<div>${r}</div>`}}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparkstackbarChart",ref:B,style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),width:"100%",viewBox:`0 0 ${c.value.width} ${c.value.height}`},[e.createVNode(q._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${S.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,H),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(o.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,I),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,R)],8,M))),128)),e.createElementVNode("clipPath",W,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,Y)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",G,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_underlayer_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,X))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${S.value})`:o.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,J))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_trap_${r}`,onClick:()=>z(o,r),x:o.start,y:0,width:o.width,height:c.value.height,fill:"transparent",stroke:"none",class:e.normalizeClass({animated:!g.value}),onMouseenter:()=>T({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=v=>{b.value=!1,m.value=null})},null,42,K))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:c.value.width-4,height:c.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(c.value.height-4)/2},null,8,Q))],8,j)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(A.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":d.value.includes(r)}),onClick:v=>{F(r),z(o,r)}},[e.createElementVNode("div",ee,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:o.color},null,8,le)],8,te)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(o.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(d.value.includes(r)?" - ":o.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.legend.value.formatter,o.value,e.unref(a.dataLabel)({p:t.value.style.legend.value.prefix,v:o.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:o,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,Z))),256))],4)):e.createCommentVNode("",!0),e.createVNode(O._sfc_main,{show:b.value&&t.value.style.tooltip.show,parent:B.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,content:_.value,isCustom:k.value,offsetY:-124+t.value.style.tooltip.offsetY,blockShiftY:!0},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),_:3},8,["show","parent","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","content","isCustom","offsetY"]),l.$slots.source?(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},re=U._export_sfc(ae,[["__scopeId","data-v-233900f7"]]);exports.default=re;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-BHQZE19X.cjs"),V=require("./useNestedProp-CwpqC_aE.cjs"),A=require("./vue-ui-skeleton-DUNkS05l.cjs"),q=require("./PackageVersion-rnWHRWGI.cjs"),O=require("./Tooltip-DjCKBAC4.cjs"),U=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["xmlns","viewBox"],M=["id"],H=["stop-color"],I=["stop-color"],R=["stop-color"],W={id:"stackPill",clipPathUnits:"objectBoundingBox"},Y=["fill"],G={key:0,"clip-path":"url(#stackPill)"},X=["x","width","height","fill"],J=["x","width","height","fill","stroke"],K=["onClick","x","width","height","onMouseenter"],Q=["width","height","rx"],Z=["onClick"],ee={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},te=["height","width"],le=["fill"],oe={key:4,ref:"source",dir:"auto"},ae={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(P,{emit:D}){const u=P,{vue_ui_sparkstackbar:L}=a.useConfig(),x=e.computed(()=>!!u.dataset&&u.dataset.length),B=e.ref(null),S=e.ref(a.createUid()),b=e.ref(!1),_=e.ref(""),t=e.computed({get:()=>$(),set:l=>l});function $(){const l=V.useNestedProp({userConfig:u.config,defaultConfig:L});return l.theme?{...V.useNestedProp({userConfig:a.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:a.themePalettes[l.theme]||a.palette}:l}e.watch(()=>u.config,l=>{t.value=$(),E()},{deep:!0}),e.watch(()=>u.dataset,l=>{p.value=u.dataset.map((n,o)=>({...n,color:n.color?a.convertColorToHex(n.color):f.value[o]||a.palette[o]||a.palette[o%a.palette.length]}))},{deep:!0});const f=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),p=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?a.convertColorToHex(l.color):f.value[n]||a.palette[n]||a.palette[n%a.palette.length]}))),g=e.ref(!0);e.onMounted(()=>{if(E(),t.value.style.animation.show){let v=function(){r+=o/l,r<o?(p.value=p.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length]})),requestAnimationFrame(v)):(g.value=!1,p.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?a.convertColorToHex(s.color):f.value[i]||a.palette[i]||a.palette[i%a.palette.length],id:a.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),o=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;g.value=!0,v()}});function E(){a.objectIsEmpty(u.dataset)?a.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{a.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(o=>{a.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:o,index:n})})})}const c=e.ref({width:500,height:16}),d=e.ref([]),N=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!d.value.includes(n)).reduce((l,n)=>l+n,0)),y=e.computed(()=>p.value.map((l,n)=>{const o=l.value||0,r=o/N.value,v=isNaN(r)?0:r,s=v*c.value.width;return{...l,value:o,proportion:v,width:s,proportionLabel:a.dataLabel({v:v*100,s:"%",r:t.value.style.legend.percentage.rounding})}})),C=e.computed(()=>y.value.filter((l,n)=>!d.value.includes(n)));function F(l){d.value.includes(l)?d.value=d.value.filter(n=>n!==l):d.value.length<p.value.length-1&&d.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let o=0;o<C.value.length;o+=1)n.push({...C.value[o],start:l}),l+=C.value[o].width;return n});function z(l,n){D("selectDatapoint",{datapoint:l,index:n})}const w=e.ref(null),k=e.ref(!1),m=e.ref(null);function T({datapoint:l,seriesIndex:n}){if(!t.value.style.tooltip.show)return;w.value={datapoint:l,seriesIndex:n,config:t.value,series:y.value},b.value=!0,m.value=n;const o=t.value.style.tooltip.customFormat;if(a.isFunction(o))try{const r=o({seriesIndex:n,datapoint:l,series:y.value,config:t.value});typeof r=="string"&&(_.value=r,k.value=!0)}catch{console.warn("Custom format cannot be applied."),k.value=!1}if(!k.value){let r="";r+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,r+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}"/></svg>`,r+=`<b>${l.proportionLabel}</b>`,r+=`<span>(${a.applyDataLabel(t.value.style.legend.value.formatter,l.value,a.dataLabel({p:t.value.style.legend.value.prefix,v:l.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:l,seriesIndex:n})})</span>`,_.value=`<div>${r}</div>`}}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"sparkstackbarChart",ref:B,style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:transparent;margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),width:"100%",viewBox:`0 0 ${c.value.width} ${c.value.height}`},[e.createVNode(q._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${S.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,H),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(e.unref(a.shiftHue)(o.color,.05),100-t.value.style.bar.gradient.intensity)},null,8,I),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,R)],8,M))),128)),e.createElementVNode("clipPath",W,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,Y)])]),N.value>0?(e.openBlock(),e.createElementBlock("g",G,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_underlayer_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,X))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,x:o.start,y:0,width:o.width,height:c.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${S.value})`:o.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!g.value}),style:e.normalizeStyle({opacity:m.value!==null&&t.value.style.tooltip.show?m.value===r?1:.5:1})},null,14,J))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_trap_${r}`,onClick:()=>z(o,r),x:o.start,y:0,width:o.width,height:c.value.height,fill:"transparent",stroke:"none",class:e.normalizeClass({animated:!g.value}),onMouseenter:()=>T({datapoint:o,seriesIndex:r}),onMouseleave:n[0]||(n[0]=v=>{b.value=!1,m.value=null})},null,42,K))),128))])):(e.openBlock(),e.createElementBlock("rect",{key:1,x:2,y:1,width:c.value.width-4,height:c.value.height-2,stroke:"#CCCCCC","stroke-width":"2",fill:"transparent",rx:(c.value.height-4)/2},null,8,Q))],8,j)):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(A.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:transparent;margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(o,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":d.value.includes(r)}),onClick:v=>{F(r),z(o,r)}},[e.createElementVNode("div",ee,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:o.color},null,8,le)],8,te)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(o.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(d.value.includes(r)?" - ":o.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.legend.value.formatter,o.value,e.unref(a.dataLabel)({p:t.value.style.legend.value.prefix,v:o.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:o,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,Z))),256))],4)):e.createCommentVNode("",!0),e.createVNode(O._sfc_main,{show:b.value&&t.value.style.tooltip.show,parent:B.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,fontSize:t.value.style.tooltip.fontSize,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,content:_.value,isCustom:k.value,offsetY:-124+t.value.style.tooltip.offsetY,blockShiftY:!0},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...w.value})),void 0,!0)]),_:3},8,["show","parent","backgroundColor","color","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","content","isCustom","offsetY"]),l.$slots.source?(e.openBlock(),e.createElementBlock("div",oe,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],4))}},re=U._export_sfc(ae,[["__scopeId","data-v-233900f7"]]);exports.default=re;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { computed as m, ref as d, watch as Y, onMounted as se, openBlock as s, createElementBlock as r, normalizeStyle as v, createElementVNode as p, toDisplayString as w, createCommentVNode as y, unref as C, createVNode as G, Fragment as x, renderList as $, normalizeClass as F, createBlock as re, withCtx as q, renderSlot as j, normalizeProps as H, guardReactiveProps as X } from "vue";
|
|
2
|
-
import { u as ne, c as J, t as ue, a as ie, p as i, d as N, b as ce, o as de, e as K, g as ve, f as E, X as pe, s as ge, w as fe, i as Q, x as he } from "./index-
|
|
3
|
-
import { u as Z } from "./useNestedProp-
|
|
4
|
-
import ye from "./vue-ui-skeleton-
|
|
5
|
-
import { _ as me } from "./PackageVersion-
|
|
6
|
-
import { _ as be } from "./Tooltip-
|
|
2
|
+
import { u as ne, c as J, t as ue, a as ie, p as i, d as N, b as ce, o as de, e as K, g as ve, f as E, X as pe, s as ge, w as fe, i as Q, x as he } from "./index-igxqCP2w.js";
|
|
3
|
+
import { u as Z } from "./useNestedProp-CSVnZVwZ.js";
|
|
4
|
+
import ye from "./vue-ui-skeleton-CWjNNx-k.js";
|
|
5
|
+
import { _ as me } from "./PackageVersion-DYk2hOG1.js";
|
|
6
|
+
import { _ as be } from "./Tooltip-CHseiJu8.js";
|
|
7
7
|
import { _ as ke } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
const _e = ["xmlns", "viewBox"], we = ["id"], Ce = ["stop-color"], xe = ["stop-color"], $e = ["stop-color"], Se = {
|
|
9
9
|
id: "stackPill",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-KYU_8xrX.cjs"),_e=require("./useNestedProp-C-g0SLHN.cjs"),Ne=require("./useResponsive-BJ7DTGpm.cjs"),Ee=require("./usePrinter-4Zj_RZ5v.cjs"),Ke=require("./Slicer-CHKuuOOo.cjs"),Qe=require("./Tooltip-87gbw8Ir.cjs"),je=require("./Title-URF9hufV.cjs"),et=require("./Legend-DDuxh17p.cjs"),tt=require("./vue-ui-accordion-C0oMKEv0.cjs"),at=require("./DataTable-CfxOc-In.cjs"),lt=require("./vue-ui-skeleton-D6mdHYxB.cjs"),ot=require("./PackageVersion-Df1iPzMk.cjs"),rt=require("./PenAndPaper-CvGft3ku.cjs"),st=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),nt=["id"],it=["xmlns","viewBox"],ut={key:0},ct=["id"],dt=["stop-color"],vt=["stop-color"],ht=["stop-color"],gt=["x1","x2","y1","y2","stroke"],mt=["x1","x2","y1","y2","stroke"],yt=["x1","x2","y1","y2","stroke"],pt=["x1","x2","y1","y2","stroke"],bt=["x","y","height","rx","width","fill","stroke","stroke-width"],ft=["x","y","width","rx","height","fill","stroke","stroke-width"],kt=["x1","x2","y1","y2","stroke","stroke-width"],xt=["x1","x2","y1","y2","stroke","stroke-width"],wt=["x","y","font-size","fill","font-weight"],Bt=["transform","font-size","fill","font-weight"],Ct=["x","y","font-size","fill","font-weight"],zt={key:0},St=["x","y","font-size","font-weight","fill"],Lt=["x","y","font-size","fill","font-weight"],_t={key:0},Nt=["x","y","font-size","font-weight","fill"],Et=["x1","x2","y1","y2","stroke"],$t=["x","y","font-size","font-weight","fill"],Tt=["x1","x2","y1","y2","stroke"],Mt=["font-size","font-weight","fill","text-anchor","transform"],Vt={key:0},Pt={key:1},Ft=["text-anchor","font-size","font-weight","fill","transform","onClick"],It={key:0},Rt={key:1},Ot=["font-size","font-weight","fill","x","y","onClick"],Dt=["x","y","width","height","onClick","onMouseenter","fill"],At=["x","y","width","height","onClick","onMouseenter","fill"],qt={key:4,class:"vue-data-ui-watermark"},Ht=["onClick"],Wt=["innerHTML"],Ut={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend","selectTimeLabel"],setup(X,{expose:$e,emit:G}){const v=X,{vue_ui_stackbar:Te}=c.useConfig(),$=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),T=e.ref(null),J=e.ref(c.createUid()),O=e.ref(!1),j=e.ref(null),Z=e.ref(""),b=e.ref([]),ee=e.ref(0),te=e.ref(null),ae=e.ref(null),le=e.ref(null),oe=e.ref(null),re=e.ref(0),D=e.ref(!1),V=e.ref(null),P=e.ref(!1),Me=e.ref(0),Ve=e.ref(0),Pe=e.ref(0),M=e.ref(null);e.onMounted(()=>{K()});const t=e.computed({get:()=>se(),set:l=>l});function se(){const l=_e.useNestedProp({userConfig:v.config,defaultConfig:Te});let r={};return l.theme?r={..._e.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||v.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:r=l,v.config&&c.hasDeepProperty(v.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=v.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,v.config&&c.hasDeepProperty(v.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=v.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,v.config&&c.hasDeepProperty(v.config,"style.chart.zoom.startIndex")?r.style.chart.zoom.startIndex=v.config.style.chart.zoom.startIndex:r.style.chart.zoom.startIndex=null,v.config&&c.hasDeepProperty(v.config,"style.chart.zoom.endIndex")?r.style.chart.zoom.endIndex=v.config.style.chart.zoom.endIndex:r.style.chart.zoom.endIndex=null,r}e.watch(()=>v.config,l=>{t.value=se(),K(),Me.value+=1,Ve.value+=1,Pe.value+=1},{deep:!0}),e.watch(()=>v.dataset,l=>{he()},{deep:!0});const p=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:ne,isImaging:ie,generatePdf:ue,generateImage:ce}=Ee.usePrinter({elementId:`stackbar_${J.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),A=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),Fe=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),de=e.ref(null),ve=e.ref(null);e.onMounted(()=>{K()});function K(){if(c.objectIsEmpty(v.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):v.dataset.forEach((l,r)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{$.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{P.value=!0},10),t.value.responsive){const l=Ne.throttle(()=>{P.value=!1;const{width:r,height:a}=Ne.useResponsive({chart:T.value,title:t.value.style.chart.title.text?te.value:null,legend:t.value.style.chart.legend.show?ae.value:null,slicer:t.value.style.chart.zoom.show&&z.value>1?le.value:null,source:oe.value});A.value.width=r,A.value.height=a,clearTimeout(ve.value),ve.value=setTimeout(()=>{P.value=!0},10)});de.value=new ResizeObserver(l),de.value.observe(T.value.parentNode)}ge()}const s=e.computed(()=>{const{height:l,width:r}=A.value,{right:a}=A.value.paddingRatio,o=t.value.style.chart.padding.top,n=r-r*a,i=l-t.value.style.chart.padding.bottom,y=t.value.style.chart.padding.left,L=r-y-r*a,_=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:n,bottom:i,left:y,width:L,height:_<0?0:_}}),C=e.computed(()=>v.dataset.map((l,r)=>{const a=c.convertColorToHex(l.color)||Fe.value[r]||c.palette[r]||c.palette[r%c.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:c.createUid(),color:a}})),z=e.computed(()=>Math.max(...C.value.filter(l=>!b.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...v.dataset.map(l=>l.series.length))});function he(){ge()}async function ge(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&M.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setEndValue(Ie(t.value.style.chart.zoom.endIndex+1)))):(u.value={start:0,end:Math.max(...v.dataset.map(l=>l.series.length))},re.value+=1)}function Ie(l){const r=Math.max(...v.dataset.map(a=>a.series.length));return l>r?r:l<0||t.value.style.chart.zoom.startIndex!==null&&l<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:l}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),F=e.computed(()=>c.sumSeries(C.value.filter(l=>!b.value.includes(l.id))).slice(u.value.start,u.value.end)),Re=e.computed(()=>c.sumSeries(C.value.filter(l=>!b.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(u.value.start,u.value.end)),q=e.computed(()=>{const l=C.value.filter(r=>!b.value.includes(r.id));return{positive:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...q.value.positive),r=Math.min(...q.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:n}))}),S=e.computed(()=>{const l=[];for(let r=0;r<z.value;r+=1)l.push({text:t.value.style.chart.grid.x.timeLabels.values[r]||String(r),absoluteIndex:r});return l.slice(u.value.start,u.value.end)}),m=e.computed(()=>{if(!$.value)return[];let l=Array(z.value).fill(0),r=Array(z.value).fill(0),a=Array(z.value).fill(0),o=Array(z.value).fill(0);const n=Math.max(...q.value.positive)||0,i=Math.min(...q.value.negative),y=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,L=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:y>0?0:y,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:y>0?0:y,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:_,max:I}=L,N=I+(_>=0?0:Math.abs(_))||1,f=s.value.height,Y=s.value.width,Se=w.value[0]?w.value[0].zero:s.value.bottom,Le=w.value[0]?w.value[0].horizontal_zero:s.value.left;return C.value.filter(R=>!b.value.includes(R.id)).map(R=>{const B=R.series.slice(u.value.start,u.value.end),He=R.signedSeries.slice(u.value.start,u.value.end),We=B.map((h,g)=>s.value.left+d.value*g+d.value*t.value.style.chart.bars.gapRatio/4),Ue=B.map((h,g)=>s.value.top+d.value*g+d.value*t.value.style.chart.bars.gapRatio/4),Ye=B.map((h,g)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[g]:(h||0)/N;let E,x;return h>0?(x=f*k,E=Se-x-l[g],l[g]+=x):(x=f*k,E=Se+a[g],a[g]+=Math.abs(x)),E}),Xe=B.map((h,g)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[g]:(h||0)/N;let E,x;return h>0?(x=Y*k,E=Le+r[g],r[g]+=x):(x=Y*k,E=Le-Math.abs(x)-o[g],o[g]+=Math.abs(x)),E}),Ge=B.map((h,g)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[g]:(h||0)/N;return h>0?f*k:f*Math.abs(k)}),Je=B.map((h,g)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[g]:(h||0)/N;return h>0?Y*k:Y*Math.abs(k)}),Ze=B.map(h=>Math.abs(h)).reduce((h,g)=>h+g,0);return{...R,proportions:B.map((h,g)=>t.value.style.chart.bars.distributed?(h||0)/F.value[g]:(h||0)/Ze),series:B,signedSeries:He,x:We,y:Ye,height:Ge,horizontal_width:Je,horizontal_y:Ue,horizontal_x:Xe}})}),me=e.computed(()=>Re.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function H(l,r,a,o,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ye(l,r,a,o){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function pe(l){const r=JSON.parse(JSON.stringify(m.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));G("selectDatapoint",{datapoint:r,period:S.value[l]})}function be(l){V.value=l,O.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(m.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),o=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:m.value,config:t.value})))Z.value=r({seriesIndex:l,datapoint:a,series:m.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:y,roundingValue:L,roundingPercentage:_}=t.value.style.chart.tooltip;let I="";S.value[l]&&S.value[l].text&&t.value.style.chart.tooltip.showTimeLabel&&(I+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${y};padding-bottom:6px;margin-bottom:3px;">${S.value[l].text}</div>`);const N=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{I+=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-BHQZE19X.cjs"),_e=require("./useNestedProp-CwpqC_aE.cjs"),Ne=require("./useResponsive-BJ7DTGpm.cjs"),Ee=require("./usePrinter-DVgxBO4o.cjs"),Ke=require("./Slicer-yEeqKUDF.cjs"),Qe=require("./Tooltip-DjCKBAC4.cjs"),je=require("./Title-5Vedk01J.cjs"),et=require("./Legend-DPHcmrzd.cjs"),tt=require("./vue-ui-accordion-CRVWlHxs.cjs"),at=require("./DataTable-kMUhutQ4.cjs"),lt=require("./vue-ui-skeleton-DUNkS05l.cjs"),ot=require("./PackageVersion-rnWHRWGI.cjs"),rt=require("./PenAndPaper-BQl9-uX0.cjs"),st=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),nt=["id"],it=["xmlns","viewBox"],ut={key:0},ct=["id"],dt=["stop-color"],vt=["stop-color"],ht=["stop-color"],gt=["x1","x2","y1","y2","stroke"],mt=["x1","x2","y1","y2","stroke"],yt=["x1","x2","y1","y2","stroke"],pt=["x1","x2","y1","y2","stroke"],bt=["x","y","height","rx","width","fill","stroke","stroke-width"],ft=["x","y","width","rx","height","fill","stroke","stroke-width"],kt=["x1","x2","y1","y2","stroke","stroke-width"],xt=["x1","x2","y1","y2","stroke","stroke-width"],wt=["x","y","font-size","fill","font-weight"],Bt=["transform","font-size","fill","font-weight"],Ct=["x","y","font-size","fill","font-weight"],zt={key:0},St=["x","y","font-size","font-weight","fill"],Lt=["x","y","font-size","fill","font-weight"],_t={key:0},Nt=["x","y","font-size","font-weight","fill"],Et=["x1","x2","y1","y2","stroke"],$t=["x","y","font-size","font-weight","fill"],Tt=["x1","x2","y1","y2","stroke"],Mt=["font-size","font-weight","fill","text-anchor","transform"],Vt={key:0},Pt={key:1},Ft=["text-anchor","font-size","font-weight","fill","transform","onClick"],It={key:0},Rt={key:1},Ot=["font-size","font-weight","fill","x","y","onClick"],Dt=["x","y","width","height","onClick","onMouseenter","fill"],At=["x","y","width","height","onClick","onMouseenter","fill"],qt={key:4,class:"vue-data-ui-watermark"},Ht=["onClick"],Wt=["innerHTML"],Ut={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend","selectTimeLabel"],setup(X,{expose:$e,emit:G}){const v=X,{vue_ui_stackbar:Te}=c.useConfig(),$=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),T=e.ref(null),J=e.ref(c.createUid()),O=e.ref(!1),j=e.ref(null),Z=e.ref(""),b=e.ref([]),ee=e.ref(0),te=e.ref(null),ae=e.ref(null),le=e.ref(null),oe=e.ref(null),re=e.ref(0),D=e.ref(!1),V=e.ref(null),P=e.ref(!1),Me=e.ref(0),Ve=e.ref(0),Pe=e.ref(0),M=e.ref(null);e.onMounted(()=>{K()});const t=e.computed({get:()=>se(),set:l=>l});function se(){const l=_e.useNestedProp({userConfig:v.config,defaultConfig:Te});let r={};return l.theme?r={..._e.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||v.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:r=l,v.config&&c.hasDeepProperty(v.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=v.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,v.config&&c.hasDeepProperty(v.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=v.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,v.config&&c.hasDeepProperty(v.config,"style.chart.zoom.startIndex")?r.style.chart.zoom.startIndex=v.config.style.chart.zoom.startIndex:r.style.chart.zoom.startIndex=null,v.config&&c.hasDeepProperty(v.config,"style.chart.zoom.endIndex")?r.style.chart.zoom.endIndex=v.config.style.chart.zoom.endIndex:r.style.chart.zoom.endIndex=null,r}e.watch(()=>v.config,l=>{t.value=se(),K(),Me.value+=1,Ve.value+=1,Pe.value+=1},{deep:!0}),e.watch(()=>v.dataset,l=>{he()},{deep:!0});const p=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:ne,isImaging:ie,generatePdf:ue,generateImage:ce}=Ee.usePrinter({elementId:`stackbar_${J.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),A=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),Fe=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),de=e.ref(null),ve=e.ref(null);e.onMounted(()=>{K()});function K(){if(c.objectIsEmpty(v.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):v.dataset.forEach((l,r)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{$.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{P.value=!0},10),t.value.responsive){const l=Ne.throttle(()=>{P.value=!1;const{width:r,height:a}=Ne.useResponsive({chart:T.value,title:t.value.style.chart.title.text?te.value:null,legend:t.value.style.chart.legend.show?ae.value:null,slicer:t.value.style.chart.zoom.show&&z.value>1?le.value:null,source:oe.value});A.value.width=r,A.value.height=a,clearTimeout(ve.value),ve.value=setTimeout(()=>{P.value=!0},10)});de.value=new ResizeObserver(l),de.value.observe(T.value.parentNode)}ge()}const s=e.computed(()=>{const{height:l,width:r}=A.value,{right:a}=A.value.paddingRatio,o=t.value.style.chart.padding.top,n=r-r*a,i=l-t.value.style.chart.padding.bottom,y=t.value.style.chart.padding.left,L=r-y-r*a,_=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:n,bottom:i,left:y,width:L,height:_<0?0:_}}),C=e.computed(()=>v.dataset.map((l,r)=>{const a=c.convertColorToHex(l.color)||Fe.value[r]||c.palette[r]||c.palette[r%c.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:c.createUid(),color:a}})),z=e.computed(()=>Math.max(...C.value.filter(l=>!b.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...v.dataset.map(l=>l.series.length))});function he(){ge()}async function ge(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&M.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setEndValue(Ie(t.value.style.chart.zoom.endIndex+1)))):(u.value={start:0,end:Math.max(...v.dataset.map(l=>l.series.length))},re.value+=1)}function Ie(l){const r=Math.max(...v.dataset.map(a=>a.series.length));return l>r?r:l<0||t.value.style.chart.zoom.startIndex!==null&&l<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:l}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),F=e.computed(()=>c.sumSeries(C.value.filter(l=>!b.value.includes(l.id))).slice(u.value.start,u.value.end)),Re=e.computed(()=>c.sumSeries(C.value.filter(l=>!b.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(u.value.start,u.value.end)),q=e.computed(()=>{const l=C.value.filter(r=>!b.value.includes(r.id));return{positive:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...q.value.positive),r=Math.min(...q.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:n}))}),S=e.computed(()=>{const l=[];for(let r=0;r<z.value;r+=1)l.push({text:t.value.style.chart.grid.x.timeLabels.values[r]||String(r),absoluteIndex:r});return l.slice(u.value.start,u.value.end)}),m=e.computed(()=>{if(!$.value)return[];let l=Array(z.value).fill(0),r=Array(z.value).fill(0),a=Array(z.value).fill(0),o=Array(z.value).fill(0);const n=Math.max(...q.value.positive)||0,i=Math.min(...q.value.negative),y=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,L=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:y>0?0:y,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:y>0?0:y,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:_,max:I}=L,N=I+(_>=0?0:Math.abs(_))||1,f=s.value.height,Y=s.value.width,Se=w.value[0]?w.value[0].zero:s.value.bottom,Le=w.value[0]?w.value[0].horizontal_zero:s.value.left;return C.value.filter(R=>!b.value.includes(R.id)).map(R=>{const B=R.series.slice(u.value.start,u.value.end),He=R.signedSeries.slice(u.value.start,u.value.end),We=B.map((h,g)=>s.value.left+d.value*g+d.value*t.value.style.chart.bars.gapRatio/4),Ue=B.map((h,g)=>s.value.top+d.value*g+d.value*t.value.style.chart.bars.gapRatio/4),Ye=B.map((h,g)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[g]:(h||0)/N;let E,x;return h>0?(x=f*k,E=Se-x-l[g],l[g]+=x):(x=f*k,E=Se+a[g],a[g]+=Math.abs(x)),E}),Xe=B.map((h,g)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[g]:(h||0)/N;let E,x;return h>0?(x=Y*k,E=Le+r[g],r[g]+=x):(x=Y*k,E=Le-Math.abs(x)-o[g],o[g]+=Math.abs(x)),E}),Ge=B.map((h,g)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[g]:(h||0)/N;return h>0?f*k:f*Math.abs(k)}),Je=B.map((h,g)=>{const k=t.value.style.chart.bars.distributed?(h||0)/F.value[g]:(h||0)/N;return h>0?Y*k:Y*Math.abs(k)}),Ze=B.map(h=>Math.abs(h)).reduce((h,g)=>h+g,0);return{...R,proportions:B.map((h,g)=>t.value.style.chart.bars.distributed?(h||0)/F.value[g]:(h||0)/Ze),series:B,signedSeries:He,x:We,y:Ye,height:Ge,horizontal_width:Je,horizontal_y:Ue,horizontal_x:Xe}})}),me=e.computed(()=>Re.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function H(l,r,a,o,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ye(l,r,a,o){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function pe(l){const r=JSON.parse(JSON.stringify(m.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));G("selectDatapoint",{datapoint:r,period:S.value[l]})}function be(l){V.value=l,O.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(m.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),o=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:m.value,config:t.value})))Z.value=r({seriesIndex:l,datapoint:a,series:m.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:y,roundingValue:L,roundingPercentage:_}=t.value.style.chart.tooltip;let I="";S.value[l]&&S.value[l].text&&t.value.style.chart.tooltip.showTimeLabel&&(I+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${y};padding-bottom:6px;margin-bottom:3px;">${S.value[l].text}</div>`);const N=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{I+=`
|
|
2
2
|
<div style="display:flex;flex-direction:row;align-items:center;gap:4px">
|
|
3
3
|
<svg viewBox="0 0 12 12" height="14" width="14"><rect rx="1" x="0" y="0" height="12" width="12" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${f.id})`:f.color}"/></svg>
|
|
4
4
|
${f.name}${n||i?":":""} ${n?c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:f.value,s:t.value.style.chart.bars.dataLabels.suffix,r:L}):""} ${N[0]}${i?c.dataLabel({v:isNaN(f.value/o)?0:Math.abs(f.value)/o*100,s:"%",r:_}):""}${N[1]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { computed as x, ref as y, onMounted as qe, watch as Ze, nextTick as ne, openBlock as r, createElementBlock as i, normalizeClass as pe, normalizeStyle as U, createBlock as J, createCommentVNode as d, renderSlot as k, createVNode as ue, unref as _, createSlots as _t, withCtx as z, normalizeProps as O, guardReactiveProps as P, Fragment as h, renderList as f, createElementVNode as B, toDisplayString as S, createTextVNode as Lt } from "vue";
|
|
2
|
-
import { u as St, c as Ke, t as $t, a as Mt, p as ce, C as ve, b as Tt, o as Nt, e as Qe, g as It, d as Ot, a7 as he, a3 as je, D as et, X as Pt, l as At, G as tt, f as W, x as at, i as lt, y as Rt, q as Vt, r as Ft } from "./index-
|
|
3
|
-
import { u as ot } from "./useNestedProp-
|
|
2
|
+
import { u as St, c as Ke, t as $t, a as Mt, p as ce, C as ve, b as Tt, o as Nt, e as Qe, g as It, d as Ot, a7 as he, a3 as je, D as et, X as Pt, l as At, G as tt, f as W, x as at, i as lt, y as Rt, q as Vt, r as Ft } from "./index-igxqCP2w.js";
|
|
3
|
+
import { u as ot } from "./useNestedProp-CSVnZVwZ.js";
|
|
4
4
|
import { t as Dt, u as Et } from "./useResponsive-CoxXLe23.js";
|
|
5
|
-
import { u as Ht, U as Bt } from "./usePrinter-
|
|
6
|
-
import { S as Wt } from "./Slicer-
|
|
7
|
-
import { _ as Yt } from "./Tooltip-
|
|
8
|
-
import { _ as Xt } from "./Title-
|
|
9
|
-
import { L as Gt } from "./Legend-
|
|
10
|
-
import Ut from "./vue-ui-accordion-
|
|
11
|
-
import { D as Jt } from "./DataTable-
|
|
12
|
-
import qt from "./vue-ui-skeleton-
|
|
13
|
-
import { _ as Zt } from "./PackageVersion-
|
|
14
|
-
import { P as Kt } from "./PenAndPaper-
|
|
5
|
+
import { u as Ht, U as Bt } from "./usePrinter-CnZYDQXB.js";
|
|
6
|
+
import { S as Wt } from "./Slicer-DlgqsI5C.js";
|
|
7
|
+
import { _ as Yt } from "./Tooltip-CHseiJu8.js";
|
|
8
|
+
import { _ as Xt } from "./Title-DED-PQ7X.js";
|
|
9
|
+
import { L as Gt } from "./Legend-FZN9UHoI.js";
|
|
10
|
+
import Ut from "./vue-ui-accordion-lF7yVkiT.js";
|
|
11
|
+
import { D as Jt } from "./DataTable-CO5C8Cmb.js";
|
|
12
|
+
import qt from "./vue-ui-skeleton-CWjNNx-k.js";
|
|
13
|
+
import { _ as Zt } from "./PackageVersion-DYk2hOG1.js";
|
|
14
|
+
import { P as Kt } from "./PenAndPaper-BfgS_5ux.js";
|
|
15
15
|
import { _ as Qt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
16
16
|
const jt = ["id"], ea = ["xmlns", "viewBox"], ta = { key: 0 }, aa = ["id"], la = ["stop-color"], oa = ["stop-color"], ra = ["stop-color"], sa = ["x1", "x2", "y1", "y2", "stroke"], ia = ["x1", "x2", "y1", "y2", "stroke"], na = ["x1", "x2", "y1", "y2", "stroke"], ua = ["x1", "x2", "y1", "y2", "stroke"], ca = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], va = ["x", "y", "width", "rx", "height", "fill", "stroke", "stroke-width"], ha = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], da = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ya = ["x", "y", "font-size", "fill", "font-weight"], ga = ["transform", "font-size", "fill", "font-weight"], ba = ["x", "y", "font-size", "fill", "font-weight"], fa = { key: 0 }, ma = ["x", "y", "font-size", "font-weight", "fill"], pa = ["x", "y", "font-size", "fill", "font-weight"], xa = { key: 0 }, ka = ["x", "y", "font-size", "font-weight", "fill"], wa = ["x1", "x2", "y1", "y2", "stroke"], za = ["x", "y", "font-size", "font-weight", "fill"], Ca = ["x1", "x2", "y1", "y2", "stroke"], _a = ["font-size", "font-weight", "fill", "text-anchor", "transform"], La = { key: 0 }, Sa = { key: 1 }, $a = ["text-anchor", "font-size", "font-weight", "fill", "transform", "onClick"], Ma = { key: 0 }, Ta = { key: 1 }, Na = ["font-size", "font-weight", "fill", "x", "y", "onClick"], Ia = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Oa = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Pa = {
|
|
17
17
|
key: 4,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { computed as h, ref as i, watch as Ie, onMounted as Me, onBeforeUnmount as De, openBlock as o, createElementBlock as u, normalizeClass as F, normalizeStyle as Q, createBlock as T, createCommentVNode as c, unref as d, createSlots as Ge, withCtx as f, renderSlot as y, normalizeProps as W, guardReactiveProps as I, createVNode as xe, Fragment as g, renderList as C, createElementVNode as k, toDisplayString as L, mergeProps as Ee, createTextVNode as Ve, nextTick as He } from "vue";
|
|
2
|
-
import { u as Re, c as Z, t as Ue, a as Be, p as A, o as Xe, e as ee, g as Ce, b as je, d as we, v as Ye, D as Je, f as B, X as qe, i as te, l as Ke, h as Qe, x as _e, y as Ze, q as et, r as tt, F as lt } from "./index-
|
|
2
|
+
import { u as Re, c as Z, t as Ue, a as Be, p as A, o as Xe, e as ee, g as Ce, b as je, d as we, v as Ye, D as Je, f as B, X as qe, i as te, l as Ke, h as Qe, x as _e, y as Ze, q as et, r as tt, F as lt } from "./index-igxqCP2w.js";
|
|
3
3
|
import { t as at, u as ot } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as st } from "./Title-
|
|
5
|
-
import { u as rt, U as ut } from "./usePrinter-
|
|
6
|
-
import { _ as nt } from "./Tooltip-
|
|
7
|
-
import { D as it } from "./DataTable-
|
|
8
|
-
import ct from "./vue-ui-skeleton-
|
|
9
|
-
import { _ as vt } from "./Shape-
|
|
10
|
-
import ht from "./vue-ui-accordion-
|
|
11
|
-
import { u as $e } from "./useNestedProp-
|
|
12
|
-
import { _ as dt } from "./PackageVersion-
|
|
13
|
-
import { P as pt } from "./PenAndPaper-
|
|
4
|
+
import { _ as st } from "./Title-DED-PQ7X.js";
|
|
5
|
+
import { u as rt, U as ut } from "./usePrinter-CnZYDQXB.js";
|
|
6
|
+
import { _ as nt } from "./Tooltip-CHseiJu8.js";
|
|
7
|
+
import { D as it } from "./DataTable-CO5C8Cmb.js";
|
|
8
|
+
import ct from "./vue-ui-skeleton-CWjNNx-k.js";
|
|
9
|
+
import { _ as vt } from "./Shape-BqkMzXqo.js";
|
|
10
|
+
import ht from "./vue-ui-accordion-lF7yVkiT.js";
|
|
11
|
+
import { u as $e } from "./useNestedProp-CSVnZVwZ.js";
|
|
12
|
+
import { _ as dt } from "./PackageVersion-DYk2hOG1.js";
|
|
13
|
+
import { P as pt } from "./PenAndPaper-BfgS_5ux.js";
|
|
14
14
|
import { _ as ft } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
15
|
const yt = ["id"], bt = ["xmlns", "viewBox"], mt = { key: 0 }, gt = { key: 0 }, kt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], xt = { key: 1 }, Ct = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], wt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], _t = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], $t = ["x", "y", "fill", "font-size"], Tt = ["x", "y", "font-size", "fill"], Lt = ["fill", "font-size", "transform"], At = ["fill", "font-size", "x", "y"], Pt = ["x1", "x2", "y1", "y2", "stroke"], St = ["cx", "cy", "fill"], zt = ["cx", "cy", "fill"], Nt = ["id"], Ot = ["stop-color"], Ft = ["stop-color"], Wt = ["stop-color"], It = { key: 0 }, Mt = ["x", "y", "font-size", "fill"], Dt = {
|
|
16
16
|
key: 5,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-KYU_8xrX.cjs"),te=require("./useResponsive-BJ7DTGpm.cjs"),pe=require("./Title-URF9hufV.cjs"),le=require("./usePrinter-4Zj_RZ5v.cjs"),me=require("./Tooltip-87gbw8Ir.cjs"),fe=require("./DataTable-CfxOc-In.cjs"),ye=require("./vue-ui-skeleton-D6mdHYxB.cjs"),be=require("./Shape-D3F3Ki5y.cjs"),ge=require("./vue-ui-accordion-C0oMKEv0.cjs"),ae=require("./useNestedProp-C-g0SLHN.cjs"),ke=require("./PackageVersion-Df1iPzMk.cjs"),xe=require("./PenAndPaper-CvGft3ku.cjs"),Ce=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),we=["id"],Be=["xmlns","viewBox"],Ne={key:0},_e={key:0},$e=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Se={key:1},Te=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Le=["x1","x2","y1","y2","stroke","stroke-width"],Pe=["x1","x2","y1","y2","stroke","stroke-width"],Ee=["x","y","fill","font-size"],Ae=["x","y","font-size","fill"],ze=["fill","font-size","transform"],Ve=["fill","font-size","x","y"],Fe=["x1","x2","y1","y2","stroke"],Oe=["cx","cy","fill"],De=["cx","cy","fill"],Me=["id"],We=["stop-color"],Ie=["stop-color"],qe=["stop-color"],Ge={key:0},Re=["x","y","font-size","fill"],Ue={key:5,class:"vue-data-ui-watermark"},He=["innerHTML"],je={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(oe,{expose:re,emit:se}){const v=oe,{vue_ui_strip_plot:ne}=o.useConfig(),p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(o.createUid()),F=e.ref(0),P=e.ref(!1),E=e.ref(""),y=e.ref(null),O=e.ref(null),D=e.ref(null),M=e.ref(null),W=e.ref(!1),I=e.ref(0),q=e.ref(0),t=e.computed({get:()=>G(),set:l=>l});function G(){const l=ae.useNestedProp({userConfig:v.config,defaultConfig:ne});return l.theme?{...ae.useNestedProp({userConfig:o.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>v.config,l=>{t.value=G(),R(),I.value+=1,q.value+=1},{deep:!0});const C=e.ref(null);e.onMounted(()=>{R()});function R(){if(o.objectIsEmpty(v.dataset)?o.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(a=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:a,index:s})}),l.plots&&l.plots.forEach((a,n)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=te.throttle(()=>{const{width:s,height:a}=te.useResponsive({chart:y.value,title:t.value.style.chart.title.text?O.value:null,source:D.value,noTitle:M.value});w.value=a,b.value.width=s,b.value.height=a,x.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=o.translateSize({relator:Math.min(a,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})});C.value=new ResizeObserver(l),C.value.observe(y.value.parentNode)}W.value=!0,setTimeout(()=>{k.value=!1},ie.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:U,isImaging:H,generatePdf:j,generateImage:X}=le.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),ue=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Y=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),k=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),x=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),b=e.ref({width:x.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),r=e.computed(()=>{const l=x.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:x.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:x.value,absoluteHeight:w.value,absoluteWidth:l}}),N=e.computed(()=>p.value?v.dataset.map((l,s)=>{const a=o.createUid();return{...l,id:a,color:l.color?o.convertColorToHex(l.color):Y.value[s]||o.palette[s]||o.palette[s%o.palette.length],plots:l.plots.map(n=>({...n,value:o.checkNaN(n.value),parentId:a,color:l.color?o.convertColorToHex(l.color):Y.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:o.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(N.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,x:r.value.left+(s+1)*r.value.stripWidth-r.value.stripWidth/2}))}))),ie=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),A=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(a=>a.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>o.calculateNiceScale(A.value.min<0?A.value.min:0,A.value.max,t.value.style.chart.grid.scaleSteps)),ce=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,y:r.value.bottom-(a.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*r.value.height}))}))),J=e.computed(()=>m.value.ticks.map(l=>({y:r.value.bottom-r.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:r.value.left,x2:r.value.right,value:l}))),z=e.ref(null),i=e.ref(null);function ve({datapoint:l,seriesIndex:s}){z.value={datapoint:l,seriesIndex:s,config:t.value,series:N.value},P.value=!0,i.value=l;const a=t.value.style.chart.tooltip.customFormat;if(o.isFunction(a)&&o.functionReturnsString(()=>a({seriesIndex:s,datapoint:l,series:N.value,config:t.value})))E.value=a({seriesIndex:s,datapoint:l,series:N.value,config:t.value});else{let n="";n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${o.applyDataLabel(t.value.style.chart.labels.formatter,l.value,o.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,E.value=`<div>${n}</div>`}}const _=e.computed(()=>{const l=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${a.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function K(){e.nextTick(()=>{const l=_.value.head.map((n,u)=>[[n.name],[_.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),a=o.createCsvContent(s);o.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const $=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=_.value.head.map((u,f)=>{const T=o.dataLabel({p:t.value.style.chart.labels.prefix,v:_.value.body[f],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},T]}),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:a}}),g=e.ref(!1);function de(l){g.value=l,F.value+=1}function he(){return h.value}function Q(){c.value.showTable=!c.value.showTable}function Z(){c.value.dataLabels.show=!c.value.dataLabels.show}function ee(){c.value.showTooltip=!c.value.showTooltip}const S=e.ref(!1);function V(){S.value=!S.value}return re({getData:he,generatePdf:j,generateCsv:K,generateImage:X,toggleTable:Q,toggleLabels:Z,toggleTooltip:ee,toggleAnnotator:V}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:y,class:e.normalizeClass(`vue-ui-strip-plot ${g.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(xe.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:S.value,onClose:V},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ue.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:M,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:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(pe._sfc_main,{key:`title_${I.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(le.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(U),isImaging:e.unref(H),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:S.value,onToggleFullscreen:de,onGeneratePdf:e.unref(j),onGenerateCsv:K,onGenerateImage:e.unref(X),onToggleTable:Q,onToggleLabels:Z,onToggleTooltip:ee,onToggleAnnotator:V},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:n})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${b.value.width<=0?10:b.value.width} ${b.value.height<=0?10:b.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[e.createVNode(ke._sfc_main),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",Ne,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,a=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,$e))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+(n+1)*r.value.stripWidth,x2:r.value.left+(n+1)*r.value.stripWidth,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Te))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:r.value.left,x2:r.value.left,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Le),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:r.value.bottom,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Pe)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(J.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:a.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.chart.labels.prefix,v:a.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:a,seriesIndex:n})),9,Ee))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+(n+1)*r.value.stripWidth-r.value.stripWidth/2,y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(a.name),9,Ae))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:3,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${r.value.top+r.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,ze)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:r.value.left+r.value.width/2,y:r.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Ve)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Fe),e.createElementVNode("circle",{cx:r.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Oe),e.createElementVNode("circle",{cx:r.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,De)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,a=>(e.openBlock(),e.createElementBlock("radialGradient",{id:a.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(o.lightenHexColor)(a.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,We),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(o.darkenHexColor)(a.color,.1)},null,8,Ie),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,qe)],8,Me))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,f)=>(e.openBlock(),e.createBlock(be._sfc_main,e.mergeProps({plot:{x:u.x,y:W.value?u.y:r.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${a.id})`:a.color,onMouseenter:T=>ve({datapoint:u,seriesIndex:f}),onMouseleave:s[0]||(s[0]=T=>{P.value=!1,i.value=null}),onClick:T=>se("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${k.value?`transition-delay:${f*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&k.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!k.value}},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f===a.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&k.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(o.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:f}):""),13,Re)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:r.value},void 0,!0)],14,Be)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ue,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ye.default,{key:6,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:D,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(me._sfc_main,{show:c.value.showTooltip&&P.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:y.value,content:E.value,isFullscreen:g.value,isCustom:e.unref(o.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),p.value?(e.openBlock(),e.createBlock(ge.default,{key:8,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(fe.DataTable,{key:`table_${q.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=a=>c.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,He)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,we))}},Xe=Ce._export_sfc(je,[["__scopeId","data-v-8cbdee95"]]);exports.default=Xe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BHQZE19X.cjs"),te=require("./useResponsive-BJ7DTGpm.cjs"),pe=require("./Title-5Vedk01J.cjs"),le=require("./usePrinter-DVgxBO4o.cjs"),me=require("./Tooltip-DjCKBAC4.cjs"),fe=require("./DataTable-kMUhutQ4.cjs"),ye=require("./vue-ui-skeleton-DUNkS05l.cjs"),be=require("./Shape-BblkpCyL.cjs"),ge=require("./vue-ui-accordion-CRVWlHxs.cjs"),ae=require("./useNestedProp-CwpqC_aE.cjs"),ke=require("./PackageVersion-rnWHRWGI.cjs"),xe=require("./PenAndPaper-BQl9-uX0.cjs"),Ce=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),we=["id"],Be=["xmlns","viewBox"],Ne={key:0},_e={key:0},$e=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Se={key:1},Te=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Le=["x1","x2","y1","y2","stroke","stroke-width"],Pe=["x1","x2","y1","y2","stroke","stroke-width"],Ee=["x","y","fill","font-size"],Ae=["x","y","font-size","fill"],ze=["fill","font-size","transform"],Ve=["fill","font-size","x","y"],Fe=["x1","x2","y1","y2","stroke"],Oe=["cx","cy","fill"],De=["cx","cy","fill"],Me=["id"],We=["stop-color"],Ie=["stop-color"],qe=["stop-color"],Ge={key:0},Re=["x","y","font-size","fill"],Ue={key:5,class:"vue-data-ui-watermark"},He=["innerHTML"],je={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(oe,{expose:re,emit:se}){const v=oe,{vue_ui_strip_plot:ne}=o.useConfig(),p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(o.createUid()),F=e.ref(0),P=e.ref(!1),E=e.ref(""),y=e.ref(null),O=e.ref(null),D=e.ref(null),M=e.ref(null),W=e.ref(!1),I=e.ref(0),q=e.ref(0),t=e.computed({get:()=>G(),set:l=>l});function G(){const l=ae.useNestedProp({userConfig:v.config,defaultConfig:ne});return l.theme?{...ae.useNestedProp({userConfig:o.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>v.config,l=>{t.value=G(),R(),I.value+=1,q.value+=1},{deep:!0});const C=e.ref(null);e.onMounted(()=>{R()});function R(){if(o.objectIsEmpty(v.dataset)?o.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(a=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:a,index:s})}),l.plots&&l.plots.forEach((a,n)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=te.throttle(()=>{const{width:s,height:a}=te.useResponsive({chart:y.value,title:t.value.style.chart.title.text?O.value:null,source:D.value,noTitle:M.value});w.value=a,b.value.width=s,b.value.height=a,x.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=o.translateSize({relator:Math.min(a,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})});C.value=new ResizeObserver(l),C.value.observe(y.value.parentNode)}W.value=!0,setTimeout(()=>{k.value=!1},ie.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:U,isImaging:H,generatePdf:j,generateImage:X}=le.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),ue=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Y=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),k=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),x=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),b=e.ref({width:x.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),r=e.computed(()=>{const l=x.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:x.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:x.value,absoluteHeight:w.value,absoluteWidth:l}}),N=e.computed(()=>p.value?v.dataset.map((l,s)=>{const a=o.createUid();return{...l,id:a,color:l.color?o.convertColorToHex(l.color):Y.value[s]||o.palette[s]||o.palette[s%o.palette.length],plots:l.plots.map(n=>({...n,value:o.checkNaN(n.value),parentId:a,color:l.color?o.convertColorToHex(l.color):Y.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:o.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(N.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,x:r.value.left+(s+1)*r.value.stripWidth-r.value.stripWidth/2}))}))),ie=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),A=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(a=>a.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>o.calculateNiceScale(A.value.min<0?A.value.min:0,A.value.max,t.value.style.chart.grid.scaleSteps)),ce=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,y:r.value.bottom-(a.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*r.value.height}))}))),J=e.computed(()=>m.value.ticks.map(l=>({y:r.value.bottom-r.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:r.value.left,x2:r.value.right,value:l}))),z=e.ref(null),i=e.ref(null);function ve({datapoint:l,seriesIndex:s}){z.value={datapoint:l,seriesIndex:s,config:t.value,series:N.value},P.value=!0,i.value=l;const a=t.value.style.chart.tooltip.customFormat;if(o.isFunction(a)&&o.functionReturnsString(()=>a({seriesIndex:s,datapoint:l,series:N.value,config:t.value})))E.value=a({seriesIndex:s,datapoint:l,series:N.value,config:t.value});else{let n="";n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${o.applyDataLabel(t.value.style.chart.labels.formatter,l.value,o.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,E.value=`<div>${n}</div>`}}const _=e.computed(()=>{const l=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${a.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function K(){e.nextTick(()=>{const l=_.value.head.map((n,u)=>[[n.name],[_.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),a=o.createCsvContent(s);o.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const $=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=_.value.head.map((u,f)=>{const T=o.dataLabel({p:t.value.style.chart.labels.prefix,v:_.value.body[f],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},T]}),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:a}}),g=e.ref(!1);function de(l){g.value=l,F.value+=1}function he(){return h.value}function Q(){c.value.showTable=!c.value.showTable}function Z(){c.value.dataLabels.show=!c.value.dataLabels.show}function ee(){c.value.showTooltip=!c.value.showTooltip}const S=e.ref(!1);function V(){S.value=!S.value}return re({getData:he,generatePdf:j,generateCsv:K,generateImage:X,toggleTable:Q,toggleLabels:Z,toggleTooltip:ee,toggleAnnotator:V}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:y,class:e.normalizeClass(`vue-ui-strip-plot ${g.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(xe.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:S.value,onClose:V},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ue.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:M,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:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(pe._sfc_main,{key:`title_${I.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(le.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(U),isImaging:e.unref(H),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:g.value,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:S.value,onToggleFullscreen:de,onGeneratePdf:e.unref(j),onGenerateCsv:K,onGenerateImage:e.unref(X),onToggleTable:Q,onToggleLabels:Z,onToggleTooltip:ee,onToggleAnnotator:V},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:n})),void 0,!0)]),key:"7"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.value}),viewBox:`0 0 ${b.value.width<=0?10:b.value.width} ${b.value.height<=0?10:b.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[e.createVNode(ke._sfc_main),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",Ne,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,a=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,$e))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",Se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+(n+1)*r.value.stripWidth,x2:r.value.left+(n+1)*r.value.stripWidth,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,Te))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:r.value.left,x2:r.value.left,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Le),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:r.value.bottom,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Pe)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(J.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:a.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.chart.labels.prefix,v:a.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:a,seriesIndex:n})),9,Ee))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+(n+1)*r.value.stripWidth-r.value.stripWidth/2,y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(a.name),9,Ae))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:3,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${r.value.top+r.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,ze)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:r.value.left+r.value.width/2,y:r.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Ve)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Fe),e.createElementVNode("circle",{cx:r.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Oe),e.createElementVNode("circle",{cx:r.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,De)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,a=>(e.openBlock(),e.createElementBlock("radialGradient",{id:a.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(o.lightenHexColor)(a.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,We),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(o.darkenHexColor)(a.color,.1)},null,8,Ie),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,qe)],8,Me))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,f)=>(e.openBlock(),e.createBlock(be._sfc_main,e.mergeProps({plot:{x:u.x,y:W.value?u.y:r.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${a.id})`:a.color,onMouseenter:T=>ve({datapoint:u,seriesIndex:f}),onMouseleave:s[0]||(s[0]=T=>{P.value=!1,i.value=null}),onClick:T=>se("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${k.value?`transition-delay:${f*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&k.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!k.value}},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f===a.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&k.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(o.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:f}):""),13,Re)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:r.value},void 0,!0)],14,Be)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ue,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ye.default,{key:6,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:D,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(me._sfc_main,{show:c.value.showTooltip&&P.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:y.value,content:E.value,isFullscreen:g.value,isCustom:e.unref(o.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),p.value?(e.openBlock(),e.createBlock(ge.default,{key:8,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(fe.DataTable,{key:`table_${q.value}`,colNames:$.value.colNames,head:$.value.head,body:$.value.body,config:$.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=a=>c.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,He)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,we))}},Xe=Ce._export_sfc(je,[["__scopeId","data-v-8cbdee95"]]);exports.default=Xe;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./index-BHQZE19X.cjs"),e=require("vue"),b=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),C={name:"vue-ui-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},data(){return{uid:`vue-ui-table-${Math.random()}`,bodyCopy:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),buttonTimeout:null,canMoveChart:!1,chart:{height:316,type:"bar",width:512},constants:{ASC:1,BAR:"bar",DATE:"date",DESC:-1,DONUT:"donut",LINE:"line",NUMERIC:"numeric",PERCENTAGE:"percentage",TEXT:"text"},clientX:100,clientY:100,cssClass:{CELL:"smart-td-selected",FIRST_TD:"smart-td-selected-first",LAST_TD:"smart-td-selected-last",ROW:"smart-td-selected-neighbor"},currentDonut:void 0,currentFilter:void 0,currentSearch:void 0,currentSelectionSpan:{col:void 0,rows:[]},currentPage:0,dates:{},filteredDatesIndexes:{},hasNaN:{},iconColor:"#2D353C",iconSize:20,immutableRangeFilters:{},isExportRequest:!1,isLoading:!1,itemsPerPage:this.config.rowsPerPage?this.config.rowsPerPage:25,multiselects:{},paginatorOptions:[...new Set([10,25,50,100,250,500,this.config.rowsPerPage?this.config.rowsPerPage:25,this.dataset.body.length])].sort((l,o)=>l-o),palette:g.palette,percentages:{},rafId:null,rangeFilters:{},searches:{},selectedColumn:void 0,selectedDonutCategory:void 0,selectedPlot:void 0,showChart:!1,showDonutOptions:!1,sorts:{},tableBody:JSON.parse(JSON.stringify(this.dataset.body)).map((l,o)=>({...l,absoluteIndex:o})),tableHead:JSON.parse(JSON.stringify(this.dataset.header)).map(l=>({average:Object.hasOwn(l,"average")?l.average:!1,decimals:Object.hasOwn(l,"decimals")?l.decimals:0,isMultiselect:Object.hasOwn(l,"isMultiselect")?l.isMultiselect:!1,isPercentage:Object.hasOwn(l,"isPercentage")?l.isPercentage:!1,isSearch:Object.hasOwn(l,"isSearch")?l.isSearch:!1,isSort:Object.hasOwn(l,"isSort")?l.isSort:!1,name:l.name,percentageTo:Object.hasOwn(l,"percentageTo")?l.percentageTo:void 0,prefix:Object.hasOwn(l,"prefix")?l.prefix:"",rangeFilter:Object.hasOwn(l,"rangeFilter")?l.rangeFilter:!1,suffix:Object.hasOwn(l,"suffix")?l.suffix:"",sum:Object.hasOwn(l,"sum")?l.sum:!1,type:l.type}))}},mounted(){if(this.dataset.header.length===0)throw new Error(`vue-ui-table error: missing header data.
|
|
2
2
|
Provide an array of objects of type:
|
|
3
3
|
{
|
|
4
4
|
name: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as D, u as x, A as G, m as M, d as T, B as E, q as z, r as B, a0 as H } from "./index-
|
|
1
|
+
import { p as D, u as x, A as G, m as M, d as T, B as E, q as z, r as B, a0 as H } from "./index-igxqCP2w.js";
|
|
2
2
|
import { openBlock as i, createElementBlock as c, normalizeStyle as g, createElementVNode as a, toDisplayString as u, Fragment as b, renderList as _, normalizeClass as f, createTextVNode as I, createCommentVNode as N, withDirectives as k, vModelText as w, withKeys as S, withModifiers as O, vModelSelect as P, createStaticVNode as R, pushScopeId as U, popScopeId as V } from "vue";
|
|
3
3
|
import { _ as j } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const X = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-BHQZE19X.cjs"),B=require("./useNestedProp-CwpqC_aE.cjs"),P=require("./usePrinter-DVgxBO4o.cjs"),O=require("./Shape-BblkpCyL.cjs"),T=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M=["id"],G={role:"cell"},q={role:"row"},U=["data-cell"],L={key:0,style:{display:"flex","flex-direction":"row",gap:"2px","align-items":"center"}},A=["height","width"],D={key:0,role:"cell","data-cell":"sum"},H={key:1,role:"cell","data-cell":"average"},X={key:2,role:"cell","data-cell":"median"},W={key:1,ref:"source",dir:"auto"},J={__name:"vue-ui-table-heatmap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(I,{expose:$}){const d=I;e.useCssVars(t=>({"4e1c0e72":z.value,"6ed4bc22":F.value}));const{vue_ui_table_heatmap:N}=r.useConfig(),p=e.ref(r.createUid()),s=e.ref(!1),c=e.ref(null),m=e.ref(!1),v=e.ref(0),o=e.computed({get:()=>f(),set:t=>t});function f(){const t=B.useNestedProp({userConfig:d.config,defaultConfig:N});return t.theme?{...B.useNestedProp({userConfig:r.themes.vue_ui_table_heatmap[t.theme]||d.config,defaultConfig:t})}:t}e.watch(()=>d.config,t=>{o.value=f(),k()},{deep:!0});const{isPrinting:w,isImaging:E,generatePdf:g,generateImage:h}=P.usePrinter({elementId:`table_heatmap_${p.value}`,fileName:"vue-ui-table-heatmap"}),S=e.computed(()=>o.value.table.responsiveBreakpoint),x=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(()=>{k()});function k(){r.objectIsEmpty(d.dataset)&&r.error({componentName:"VueUiTableHeatmap",type:"dataset"});const t=new ResizeObserver(l=>{l.forEach(n=>{s.value=n.contentRect.width<S.value})});c.value&&t.observe(c.value)}const y=e.computed(()=>d.dataset.map(t=>{const l=t.values.map(a=>isNaN(a)?0:a),n=l.reduce((a,i)=>a+i,0);return{...t,values:l,serieExtremes:{max:Math.max(...l),min:Math.min(...l)},sum:n,average:n/l.length,median:r.calcMedian(l),displayValues:[t.name,...t.values],id:r.createUid()}})),b=e.computed(()=>{const t=y.value.flatMap(l=>l.values);return{min:Math.min(...t),max:Math.max(...t)}});function V(t,l){const n=o.value.style.heatmapColors.useIndividualScale;return r.interpolateColorHex(o.value.style.heatmapColors.min,o.value.style.heatmapColors.max,n?l.min:b.value.min,n?l.max:b.value.max,t)}const C=e.computed(()=>y.value.map(t=>({...t,colors:t.displayValues.map(l=>isNaN(l)?o.value.style.backgroundColor:V(l,t.serieExtremes))}))),F=e.computed(()=>o.value.style.backgroundColor),z=e.computed(()=>`${o.value.table.borderWidth}px`);function _(){e.nextTick(()=>{const t=C.value.map(a=>[[a.name],a.displayValues,[a.sum],[a.average],[a.median]]),l=[[[""],o.value.table.head.values,["sum"],["average"],["median"]]].concat(t),n=r.createCsvContent(l);r.downloadCsv({csvContent:n,title:"vue-ui-table-heatmap"})})}function R(t){m.value=t,v.value+=1}return $({generatePdf:g,generateCsv:_,generateImage:h}),(t,l)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:c,style:e.normalizeStyle(`width:100%; overflow-x:auto; container-type: inline-size;padding-top:${o.value.userOptions.show?"36px":""}; ${m.value?"vue-data-ui-wrapper-fullscreen":""}; position:relative;`),class:e.normalizeClass({"vue-ui-responsive":s.value}),id:`table_heatmap_${p.value}`},[o.value.userOptions.show&&x.value?(e.openBlock(),e.createBlock(P.UserOptions,{ref:"details",key:`user_option_${v.value}`,backgroundColor:o.value.style.backgroundColor,color:o.value.style.color,isPrinting:e.unref(w),isImaging:e.unref(E),uid:p.value,hasPdf:o.value.userOptions.buttons.pdf,hasXls:o.value.userOptions.buttons.csv,hasImg:o.value.userOptions.buttons.img,hasFullscreen:o.value.userOptions.buttons.fullscreen,isFullscreen:m.value,titles:{...o.value.userOptions.buttonTitles},chartElement:c.value,position:o.value.userOptions.position,onToggleFullscreen:R,onGeneratePdf:e.unref(g),onGenerateCsv:_,onGenerateImage:e.unref(h)},e.createSlots({_:2},[t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:a})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:a})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),e.createElementVNode("table",{class:e.normalizeClass({"vue-ui-table-heatmap":!0}),style:e.normalizeStyle(`width:100%;font-family:${o.value.style.fontFamily};background:${o.value.style.backgroundColor};`)},[e.createElementVNode("caption",null,[e.renderSlot(t.$slots,"caption",{},void 0,!0)]),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${o.value.table.head.backgroundColor};color:${o.value.table.head.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value.table.head.values,(n,a)=>(e.openBlock(),e.createElementBlock("th",G,[e.renderSlot(t.$slots,"head",e.normalizeProps(e.guardReactiveProps({value:n,rowIndex:a,type:typeof n,isResponsive:s.value})),void 0,!0)]))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(n,a)=>(e.openBlock(),e.createElementBlock("tr",q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.displayValues,(i,u)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":o.value.table.head.values[u]},[n.color&&u===0?(e.openBlock(),e.createElementBlock("div",L,[n.color?(e.openBlock(),e.createElementBlock("svg",{key:0,height:o.value.style.shapeSize,width:o.value.style.shapeSize,viewBox:"0 0 20 20",style:{background:"none",overflow:"visible"}},[e.createVNode(O._sfc_main,{plot:{x:10,y:10},color:n.color,radius:9,shape:n.shape||"circle"},null,8,["color","shape"])],8,A)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"rowTitle",e.normalizeProps(e.guardReactiveProps({value:i,rowIndex:a,colIndex:u,type:typeof i,isResponsive:s.value})),void 0,!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[u===0?e.renderSlot(t.$slots,"rowTitle",e.normalizeProps(e.mergeProps({key:0},{value:i,rowIndex:a,colIndex:u,type:typeof i,isResponsive:s.value})),void 0,!0):e.createCommentVNode("",!0),u>0?e.renderSlot(t.$slots,"cell",e.normalizeProps(e.mergeProps({key:1},{value:i,rowIndex:a,colIndex:u,type:typeof i,isResponsive:s.value,color:n.colors[u],textColor:e.unref(r.adaptColorToBackground)(n.colors[u])})),void 0,!0):e.createCommentVNode("",!0)],64))],8,U))),256)),o.value.table.showSum?(e.openBlock(),e.createElementBlock("td",D,[e.renderSlot(t.$slots,"sum",e.normalizeProps(e.guardReactiveProps({value:n.sum,rowIndex:a,isResponsive:s.value})),void 0,!0)])):e.createCommentVNode("",!0),o.value.table.showAverage?(e.openBlock(),e.createElementBlock("td",H,[e.renderSlot(t.$slots,"average",e.normalizeProps(e.guardReactiveProps({value:n.average,rowIndex:a,isResponsive:s.value})),void 0,!0)])):e.createCommentVNode("",!0),o.value.table.showMedian?(e.openBlock(),e.createElementBlock("td",X,[e.renderSlot(t.$slots,"median",e.normalizeProps(e.guardReactiveProps({value:n.median,rowIndex:a,isResponsive:s.value})),void 0,!0)])):e.createCommentVNode("",!0)]))),256))])],4),t.$slots.source?(e.openBlock(),e.createElementBlock("div",W,[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],14,M))}},K=T._export_sfc(J,[["__scopeId","data-v-393e4e2f"]]);exports.default=K;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCssVars as Q, ref as h, computed as c, watch as Y, onMounted as Z, openBlock as n, createElementBlock as l, normalizeStyle as I, normalizeClass as E, createBlock as j, unref as g, createSlots as ee, withCtx as C, renderSlot as r, normalizeProps as p, guardReactiveProps as f, createCommentVNode as v, createElementVNode as y, Fragment as _, renderList as w, createVNode as te, mergeProps as G, nextTick as ae } from "vue";
|
|
2
|
-
import { u as oe, c as M, t as se, o as ne, e as le, $ as re, G as ue, N as ie, q as de, r as ce } from "./index-
|
|
3
|
-
import { u as S } from "./useNestedProp-
|
|
4
|
-
import { u as pe, U as ve } from "./usePrinter-
|
|
5
|
-
import { _ as me } from "./Shape-
|
|
2
|
+
import { u as oe, c as M, t as se, o as ne, e as le, $ as re, G as ue, N as ie, q as de, r as ce } from "./index-igxqCP2w.js";
|
|
3
|
+
import { u as S } from "./useNestedProp-CSVnZVwZ.js";
|
|
4
|
+
import { u as pe, U as ve } from "./usePrinter-CnZYDQXB.js";
|
|
5
|
+
import { _ as me } from "./Shape-BqkMzXqo.js";
|
|
6
6
|
import { _ as fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
const he = ["id"], ge = { role: "cell" }, ye = { role: "row" }, be = ["data-cell"], Ce = {
|
|
8
8
|
key: 0,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-BHQZE19X.cjs"),U=require("./useNestedProp-CwpqC_aE.cjs"),ne=require("./vue-ui-sparkline-BI9jqI0h.cjs"),H=require("./BaseIcon-2ZD3jgGz.cjs"),E=require("./usePrinter-DVgxBO4o.cjs"),re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ue=["id"],se={style:{"z-index":"1","padding-right":"24px"}},ie=["onClick"],de=["data-cell"],ce=["data-cell","onPointerenter"],ve=["data-cell"],pe=["data-cell"],me=["data-cell"],fe=["data-cell"],ge={key:0,ref:"source",dir:"auto"},ye={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(X,{expose:j}){const v=X;e.useCssVars(l=>({dba64318:l.tdo}));const{vue_ui_table_sparkline:J}=s.useConfig(),_=e.ref(s.createUid()),D=e.ref(0),x=e.ref(0),N=e.ref(null),t=e.computed({get:()=>$(),set:l=>l});function $(){const l=U.useNestedProp({userConfig:v.config,defaultConfig:J});return l.theme?{...U.useNestedProp({userConfig:s.themes.vue_ui_table_sparkline[l.theme]||v.config,defaultConfig:l}),customPalette:s.themePalettes[l.theme]||s.palette}:l}e.watch(()=>v.config,l=>{t.value=$(),L(),x.value+=1},{deep:!0}),e.watch(()=>v.dataset,l=>{d.value=g.value,x.value+=1},{deep:!0});const{isPrinting:O,isImaging:P,generatePdf:F,generateImage:W}=E.usePrinter({elementId:`table_${_.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline"}),K=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),b=e.ref(null),w=e.ref(!1),Q=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{L()});const z=e.ref(t.value.colNames);function L(){s.objectIsEmpty(v.dataset)&&s.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(o=>{o.forEach(a=>{w.value=a.contentRect.width<Q.value})});b.value&&l.observe(b.value),z.value=[];for(let o=0;o<G.value;o+=1)z.value.push(t.value.colNames[o]||`col ${o}`)}const T=e.computed(()=>(v.dataset.forEach((l,o)=>{s.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{s.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:o})})}),v.dataset.map((l,o)=>{const a=(l.values||[]).map(r=>isNaN(r)?0:r??0),u=a.reduce((r,p)=>r+p,0),i=u/a.length,n=s.calcMedian(a);return{...l,values:l.values||[],color:s.convertColorToHex(l.color)||K.value[o]||s.palette[o]||s.palette[o%s.palette.length],sum:u,average:i,median:n,sparklineDataset:a.map((r,p)=>({period:t.value.colNames[p]||`col ${p}`,value:r||0}))}})));function Y(l){const a=(l[0].values||[]).map((i,n)=>l.map(r=>r.values[n]||[])).map(i=>i.map((n,r)=>[n,r]).sort((n,r)=>r[0]-n[0]).map(n=>n[1]));return l.map((i,n)=>({...i,values:i.values||[],orders:a[n]}))}const g=e.computed(()=>Y(T.value)),d=e.ref(g.value),Z=e.computed(()=>Math.max(...d.value.map(l=>(l.values||[]).length))),k=e.ref(void 0),B=e.ref(!1),y=e.ref(void 0),h=e.ref(-1);function C(){B.value=!1,y.value=void 0,c.value=void 0,h.value=-1,d.value=g.value}function M(l,o){if(["name","sum","average","median"].includes(l.type)){ee(l.type);return}if(!I(o))return;if(f.value=o,c.value=void 0,h.value===1){h.value=-1,y.value=void 0,C();return}B.value=!0,y.value=o;const a=g.value.map(r=>r.values[o]||[]),u=k.value===o?1:-1;h.value=u,o===k.value?k.value=void 0:k.value=o;const n=a.map((r,p)=>[p,r]).sort((r,p)=>u*(p[1]-r[1])).map(r=>r[0]).map(r=>g.value[r]);d.value=n,x.value+=1}const G=e.computed(()=>Math.max(...v.dataset.map(l=>(l.values||[]).length))),m=e.computed(()=>{let l=z.value.map(a=>({type:"reg",value:a}));if(!l.length)for(let a=0;a<G.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}),S=e.ref({name:-1,sum:-1,average:-1,median:-1}),c=e.ref(void 0);function ee(l){if(!d.value||d.value.length===0||!V(l))return;if(c.value!==l&&(c.value=void 0),y.value=void 0,S.value[l]===-1&&c.value){c.value=void 0,C();return}c.value=l,B.value=!0,S.value[l]=S.value[l]===-1?1:-1;const o=S.value[l],a=[...d.value].sort((u,i)=>{const n=u[l]??(typeof u[l]=="number"?0:""),r=i[l]??(typeof i[l]=="number"?0:"");return typeof n=="string"&&typeof r=="string"?o===-1?n.localeCompare(r):r.localeCompare(n):typeof n=="number"&&typeof r=="number"?o===-1?n-r:r-n:0});d.value=a}const f=e.ref(void 0),A=e.ref(void 0);function te({dataIndex:l,serieIndex:o}){f.value=l,A.value=o,N.value[l]&&!w.value&&N.value[l].scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}const q=e.ref(!1);function le(l){q.value=l,D.value+=1}function R(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(m.value),o=T.value.map((i,n)=>[[i.name],i.values,[i.sum],[i.average],[i.median]]),a=[l].concat(o),u=s.createCsvContent(a);s.downloadCsv({csvContent:u,title:t.value.title.text||"vue-ui-table-sparkline"})})}function I(l){return t.value.sortedDataColumnIndices.includes(l)}function V(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 ae(l,o){return["sum","average","median"].includes(o.type)?c.value===o.type?1:.3:l===y.value?1:.3}function oe(){t.value.resetSortOnClickOutside&&C()}return j({generatePdf:F,generateImage:W,generateCsv:R,restoreOrder:C}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:b,class:e.normalizeClass({"vue-ui-responsive":w.value}),style:{overflow:"hidden"},id:`table_${_.value}`},[e.createElementVNode("div",{style:{overflow:"auto"},onPointerleave:o[1]||(o[1]=a=>{A.value=void 0,f.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[t.value.title.text?(e.openBlock(),e.createElementBlock("caption",{key:0,style:e.normalizeStyle({backgroundColor:t.value.title.backgroundColor})},[e.createElementVNode("div",{style:e.normalizeStyle({fontSize:`${t.value.title.fontSize}px`,fontWeight:t.value.title.bold?"bold":"normal",color:t.value.title.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.text),5),t.value.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({fontSize:`${t.value.title.subtitle.fontSize}px`,fontWeight:t.value.title.subtitle.bold?"bold":"normal",color:t.value.title.subtitle.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("thead",se,[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",cursor:t.value.sortedSeriesName?"pointer":"default"}),class:"sticky-col-first",onClick:o[0]||(o[0]=a=>M({type:"name"},null))},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"6px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(t.value.translations.serie),1),t.value.sortedSeriesName?(e.openBlock(),e.createBlock(H.default,{key:0,size:18,name:"sort",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:c.value==="name"?1:.3})},null,8,["stroke","style"])):e.createCommentVNode("",!0)],4)],4),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(a,u)=>(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:u===m.value.length-1?`${t.value.sparkline.dimensions.width}px`:"48px",cursor:I(u)||V(a)?"pointer":"default",paddingRight:u===m.value.length-1&&t.value.userOptions.show?"36px":""}),onClick:()=>M(a,u),class:e.normalizeClass({"sticky-col":u===m.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"6px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(a.value),1),I(u)||V(a)?(e.openBlock(),e.createBlock(H.default,{key:0,size:18,name:"sort",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:ae(u,a)})},null,8,["stroke","style"])):e.createCommentVNode("",!0)],4),t.value.userOptions.show&&u===m.value.length-1?(e.openBlock(),e.createBlock(E.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${D.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(O),isImaging:e.unref(P),uid:_.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:q.value,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,position:t.value.userOptions.position,onToggleFullscreen:le,onGeneratePdf:e.unref(F),onGenerateImage:e.unref(W),onGenerateCsv:R},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:i,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:i,isFullscreen:n})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0)],14,ie))),256))],4)),[[e.unref(E.vClickOutside),oe]])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(a,u)=>(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":u%2===0,"vue-ui-data-table__tbody__row-odd":u%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,de),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z.value,(i,n)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",ref_for:!0,ref_key:"TD",ref:N,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:f.value!==void 0&&n===f.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":m.value[n],class:"vue-ui-data-table__tbody__td",onPointerenter:r=>{A.value=u,f.value=n}},e.toDisplayString([null,void 0].includes(a.values[n])?"-":e.unref(s.applyDataLabel)(t.value.formatter,Number(a.values[n]),e.unref(s.dataLabel)({p:t.value.prefix,v:Number(a.values[n]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:u,datapointIndex:n})),45,ce))),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:u})),13,ve)):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:u})),13,pe)):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:u})),13,me)):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(ne.default,{onHoverIndex:({index:i})=>te({dataIndex:i,serieIndex:u}),"height-ratio":t.value.sparkline.dimensions.heightRatio,"forced-padding":30,dataset:a.sparklineDataset,showInfo:!1,selectedIndex:f.value,config:{type:t.value.sparkline.type,style:{backgroundColor:"transparent",animation:{show:t.value.sparkline.animation.show&&!e.unref(O)&&!e.unref(P),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,fe)):e.createCommentVNode("",!0)],6))),256))])],4)],32),l.$slots.source?(e.openBlock(),e.createElementBlock("div",ge,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],10,ue))}},be=re._export_sfc(ye,[["__scopeId","data-v-12c6b6f3"]]);exports.default=be;
|