vue-data-ui 2.3.40 → 2.3.42
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-DHJ0seDm.js → Arrow-CkHIA6Xt.js} +1 -1
- package/dist/{Arrow-CcJ2U3U0.cjs → Arrow-JjCnte1c.cjs} +1 -1
- package/dist/{BaseIcon-Durv5g7g.cjs → BaseIcon-C6qUG3JH.cjs} +1 -1
- package/dist/{BaseIcon-D7REqiel.js → BaseIcon-CqWidrgW.js} +1 -1
- package/dist/{DataTable-Di-7_6Aq.cjs → DataTable-DkWzYsoO.cjs} +1 -1
- package/dist/{DataTable-xRoJJLCK.js → DataTable-zAsuxqFp.js} +2 -2
- package/dist/{Legend-DFjWlPTO.js → Legend-BJyEF1AJ.js} +1 -1
- package/dist/{Legend-DHtuLr86.cjs → Legend-CMA5DWNL.cjs} +1 -1
- package/dist/{Shape-Cnsn1U1B.js → Shape-DNtGmj4U.js} +1 -1
- package/dist/{Shape-dOTW06jG.cjs → Shape-uxtn2rUk.cjs} +1 -1
- package/dist/{Slicer-B-Doztix.cjs → Slicer-CCRiwPOR.cjs} +1 -1
- package/dist/{Slicer-CdoJYj--.js → Slicer-CLvZcQa8.js} +1 -1
- package/dist/{Title-WVL1w90F.js → Title-BmBtTM10.js} +1 -1
- package/dist/{Title-CUD-K-0i.cjs → Title-Dn_s4xwI.cjs} +1 -1
- package/dist/{Tooltip-B5_8pR7S.js → Tooltip-2egolusz.js} +1 -1
- package/dist/{Tooltip-CdjFc0lT.cjs → Tooltip-CaVyC-lv.cjs} +1 -1
- package/dist/index-BaAW-Jni.cjs +4 -0
- package/dist/{index-CLohkSjv.js → index-C0qeGgGL.js} +227 -219
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +4 -2
- package/dist/types/vue-data-ui.d.ts +4 -2
- package/dist/{useNestedProp-y541YeYg.cjs → useNestedProp-BY4cF5vs.cjs} +1 -1
- package/dist/{useNestedProp-BsIUgLPI.js → useNestedProp-Dqm0GHPD.js} +1 -1
- package/dist/{usePrinter-B9AbYwAC.cjs → usePrinter-BqDyevJ_.cjs} +1 -1
- package/dist/{usePrinter-CLjymPxw.js → usePrinter-CBPQ7BTV.js} +1 -1
- package/dist/{vue-data-ui-8vGw_xvX.cjs → vue-data-ui-BvHhKOgA.cjs} +1 -1
- package/dist/{vue-data-ui-R6Kj9vzU.js → vue-data-ui-DVak_PPl.js} +57 -57
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-tGkaU8fG.js → vue-ui-3d-bar-BZwJJ7pP.js} +7 -7
- package/dist/{vue-ui-3d-bar-D_SoQlA7.cjs → vue-ui-3d-bar-qYMWF7Bo.cjs} +1 -1
- package/dist/{vue-ui-accordion-B6lUgTu6.js → vue-ui-accordion-BhMRX1nr.js} +3 -3
- package/dist/{vue-ui-accordion-Czitboqc.cjs → vue-ui-accordion-Dx2HnLJU.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-CN27TQYe.cjs → vue-ui-age-pyramid-BAWrJkqT.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-yJgEO7Ur.js → vue-ui-age-pyramid-DJ-XtegC.js} +8 -8
- package/dist/{vue-ui-annotator-BByjovvv.cjs → vue-ui-annotator-BtL7EbdF.cjs} +1 -1
- package/dist/{vue-ui-annotator-k8KyQmMk.js → vue-ui-annotator-wLCWoFmj.js} +1 -1
- package/dist/{vue-ui-candlestick-ClOsAfCQ.js → vue-ui-candlestick-Dmgnbx1q.js} +9 -9
- package/dist/{vue-ui-candlestick-DjwGhojD.cjs → vue-ui-candlestick-uIn4m5ME.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-nZYD_4Jp.cjs → vue-ui-carousel-table-DRdOHNQW.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-xdb3tSHu.js → vue-ui-carousel-table-DarpJWWt.js} +4 -4
- package/dist/{vue-ui-chestnut-CQrFwjq4.cjs → vue-ui-chestnut-DUh1_vRz.cjs} +1 -1
- package/dist/{vue-ui-chestnut-CKSdf5Wx.js → vue-ui-chestnut-eNdaOYti.js} +6 -6
- package/dist/{vue-ui-cursor-R-_LJ7BC.cjs → vue-ui-cursor-D21l-EdL.cjs} +1 -1
- package/dist/{vue-ui-cursor-B4fFZ1Xh.js → vue-ui-cursor-dArRavoM.js} +2 -2
- package/dist/{vue-ui-dashboard-BGgb7Ylt.cjs → vue-ui-dashboard-CHxdbevB.cjs} +1 -1
- package/dist/{vue-ui-dashboard-DkYbzLSj.js → vue-ui-dashboard-CiV6R9qW.js} +2 -2
- package/dist/{vue-ui-digits-DdKxR0He.cjs → vue-ui-digits-CXdsqIro.cjs} +1 -1
- package/dist/{vue-ui-digits-Lq_MZu0_.js → vue-ui-digits-y-VetFLI.js} +2 -2
- package/dist/{vue-ui-donut-qzmnXplU.js → vue-ui-donut-DrVhINsI.js} +9 -9
- package/dist/{vue-ui-donut-evolution-D_b9hPYy.js → vue-ui-donut-evolution-BKbTFgau.js} +9 -9
- package/dist/{vue-ui-donut-evolution-C2nM8AVm.cjs → vue-ui-donut-evolution-D5rptVFp.cjs} +1 -1
- package/dist/{vue-ui-donut-C5benoAI.cjs → vue-ui-donut-xihTW5pJ.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-BTbPNzqx.js → vue-ui-dumbbell-kx_eouKE.js} +8 -8
- package/dist/{vue-ui-dumbbell-C94N1mry.cjs → vue-ui-dumbbell-yAPsEkRo.cjs} +1 -1
- package/dist/{vue-ui-flow-C8jT8any.js → vue-ui-flow-Bh-Zjip1.js} +7 -7
- package/dist/{vue-ui-flow-CkZtvF7p.cjs → vue-ui-flow-CyS9hJM4.cjs} +1 -1
- package/dist/{vue-ui-galaxy-DuA4MPUu.js → vue-ui-galaxy-CbUgdDdy.js} +9 -9
- package/dist/{vue-ui-galaxy-DZKVmKTf.cjs → vue-ui-galaxy-D5GEzhai.cjs} +1 -1
- package/dist/{vue-ui-gauge-DBhAo4ED.cjs → vue-ui-gauge-B9ndz1fh.cjs} +1 -1
- package/dist/{vue-ui-gauge-CujXhTuR.js → vue-ui-gauge-C4RwPukH.js} +5 -5
- package/dist/{vue-ui-gizmo-DlWB95Xv.js → vue-ui-gizmo-B0zFYR1W.js} +2 -2
- package/dist/{vue-ui-gizmo-BsxB_JfW.cjs → vue-ui-gizmo-Dn1PAEMe.cjs} +1 -1
- package/dist/{vue-ui-heatmap-DlDIlSK-.js → vue-ui-heatmap-B7vrlB4e.js} +8 -8
- package/dist/{vue-ui-heatmap-B6MbT38S.cjs → vue-ui-heatmap-DJEZ9rFH.cjs} +1 -1
- package/dist/{vue-ui-kpi-C0kZxq3K.js → vue-ui-kpi-B4v-oOGc.js} +3 -3
- package/dist/{vue-ui-kpi-CaqMEHto.cjs → vue-ui-kpi-BzsRof5j.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-DGVlizno.cjs → vue-ui-mini-loader-C7YsQBAX.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-DfiHD95x.js → vue-ui-mini-loader-DFpYM3qb.js} +2 -2
- package/dist/{vue-ui-molecule-MmZA7D4v.js → vue-ui-molecule-Ccc6JG58.js} +9 -9
- package/dist/{vue-ui-molecule-BTtAYDlx.cjs → vue-ui-molecule-wkMW6l03.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-DRHMkdU1.js → vue-ui-mood-radar-Bf6MOhXe.js} +9 -9
- package/dist/{vue-ui-mood-radar-C-qaQqJf.cjs → vue-ui-mood-radar-ULMbwa0t.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-BZV-PTLD.js → vue-ui-nested-donuts-DChC17Jl.js} +9 -9
- package/dist/{vue-ui-nested-donuts-BkpZgLg7.cjs → vue-ui-nested-donuts-DEQvYS12.cjs} +1 -1
- package/dist/{vue-ui-onion-C4OvOsH0.cjs → vue-ui-onion-CL288Y9l.cjs} +1 -1
- package/dist/{vue-ui-onion-Bpw8RJ7Y.js → vue-ui-onion-GDYAfq0s.js} +9 -9
- package/dist/{vue-ui-parallel-coordinate-plot-Bf64Wi3u.js → vue-ui-parallel-coordinate-plot-BPvbmdgp.js} +10 -10
- package/dist/{vue-ui-parallel-coordinate-plot-yFikaAWJ.cjs → vue-ui-parallel-coordinate-plot-DVg4p8pJ.cjs} +1 -1
- package/dist/{vue-ui-quadrant-CmCcySxg.js → vue-ui-quadrant-C9ccU6cn.js} +10 -10
- package/dist/{vue-ui-quadrant-BVHTFKxd.cjs → vue-ui-quadrant-DDMlTHg_.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-Cml1Twya.js → vue-ui-quick-chart-D650NElt.js} +6 -6
- package/dist/{vue-ui-quick-chart-DrZwV4mI.cjs → vue-ui-quick-chart-DLLfjVRL.cjs} +1 -1
- package/dist/{vue-ui-radar-DE3BMdwV.cjs → vue-ui-radar-CY60jZE-.cjs} +1 -1
- package/dist/{vue-ui-radar-DP1EuYGX.js → vue-ui-radar-C_VLLHTH.js} +10 -10
- package/dist/{vue-ui-rating-BkYeHWvl.js → vue-ui-rating-7ZwSUZbi.js} +2 -2
- package/dist/{vue-ui-rating-RbXEpR6a.cjs → vue-ui-rating-DJAUZh8b.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-VO7PJR9n.js → vue-ui-relation-circle-B2AmvtRL.js} +5 -5
- package/dist/{vue-ui-relation-circle-Dx2XZJS8.cjs → vue-ui-relation-circle-DG18e4iI.cjs} +1 -1
- package/dist/{vue-ui-rings-B-t-1DXJ.cjs → vue-ui-rings-1_76sLwH.cjs} +1 -1
- package/dist/{vue-ui-rings-DxG6p7tF.js → vue-ui-rings-rfjVOdTg.js} +9 -9
- package/dist/{vue-ui-scatter-ctKFC1hB.cjs → vue-ui-scatter-D5IZlH3t.cjs} +1 -1
- package/dist/{vue-ui-scatter-BRrsv69b.js → vue-ui-scatter-GrTwhVP4.js} +10 -10
- package/dist/{vue-ui-screenshot-DD0WkpyV.cjs → vue-ui-screenshot-DgHLdia0.cjs} +1 -1
- package/dist/{vue-ui-screenshot-BBoHtZtA.js → vue-ui-screenshot-t-Iu3WWR.js} +1 -1
- package/dist/{vue-ui-skeleton-Gizw7vdX.cjs → vue-ui-skeleton-BKcDxJU1.cjs} +1 -1
- package/dist/{vue-ui-skeleton-Cu-FCvsL.js → vue-ui-skeleton-Bdc0rBji.js} +2 -2
- package/dist/{vue-ui-smiley-NkuQEkp8.js → vue-ui-smiley-B79-rzQb.js} +2 -2
- package/dist/{vue-ui-smiley-L7yruIOu.cjs → vue-ui-smiley-C-3nhDNp.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-DcBzFhgb.cjs → vue-ui-spark-trend-CWv8wyoS.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-MaSpDNrO.js → vue-ui-spark-trend-v7LZED-2.js} +4 -4
- package/dist/{vue-ui-sparkbar-Dok2sQZ3.cjs → vue-ui-sparkbar-CKCgeXd-.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-B7THOIRm.js → vue-ui-sparkbar-DXAVJ6aQ.js} +3 -3
- package/dist/{vue-ui-sparkgauge-CJNO8fex.js → vue-ui-sparkgauge-CPSJdO4H.js} +3 -3
- package/dist/{vue-ui-sparkgauge-C4Edaz_0.cjs → vue-ui-sparkgauge-LvY-AT9d.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-CDuYk_7N.cjs → vue-ui-sparkhistogram-CcfeVOxe.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-DRsRAvI7.js → vue-ui-sparkhistogram-ChvVg_k2.js} +4 -4
- package/dist/{vue-ui-sparkline-KOF_6Pig.cjs → vue-ui-sparkline-CZe9QI-o.cjs} +1 -1
- package/dist/{vue-ui-sparkline-CfsK5XqX.js → vue-ui-sparkline-DOiZIeq7.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-BzvGezvJ.js → vue-ui-sparkstackbar-CiRKGiuH.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-Bd4BF7Ij.cjs → vue-ui-sparkstackbar-pgkORrjY.cjs} +1 -1
- package/dist/{vue-ui-stackbar-0rdD887I.js → vue-ui-stackbar-D-n_HH0x.js} +10 -10
- package/dist/{vue-ui-stackbar-DXvxtOmc.cjs → vue-ui-stackbar-u8Sw84tN.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-CynA1j2D.js → vue-ui-strip-plot-Bd8Ygfg6.js} +9 -9
- package/dist/{vue-ui-strip-plot-DRTrhZ9F.cjs → vue-ui-strip-plot-KwECKyHZ.cjs} +1 -1
- package/dist/{vue-ui-table-DtaMAj7u.cjs → vue-ui-table-Bb3Y8FA8.cjs} +1 -1
- package/dist/{vue-ui-table-sVGjMZTH.js → vue-ui-table-C9xcKDzP.js} +1 -1
- package/dist/{vue-ui-table-heatmap-BO7xu77L.cjs → vue-ui-table-heatmap--c28F5on.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-BDZuT9Qz.js → vue-ui-table-heatmap-DGgRldii.js} +4 -4
- package/dist/{vue-ui-table-sparkline-DSztHLaA.cjs → vue-ui-table-sparkline-BZOTGf_k.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-BYv7kseR.js → vue-ui-table-sparkline-C-R8g7fq.js} +5 -5
- package/dist/{vue-ui-thermometer-DDL90Qop.cjs → vue-ui-thermometer-B5nhD_ah.cjs} +1 -1
- package/dist/{vue-ui-thermometer-1CmzRurR.js → vue-ui-thermometer-CA1tlOVx.js} +5 -5
- package/dist/{vue-ui-timer-CqmIqHeg.cjs → vue-ui-timer-By69Jgs-.cjs} +1 -1
- package/dist/{vue-ui-timer-DLf6i56p.js → vue-ui-timer-EoaK8XxQ.js} +4 -4
- package/dist/{vue-ui-tiremarks-r7bGmMg-.js → vue-ui-tiremarks-Dzlpp_85.js} +5 -5
- package/dist/{vue-ui-tiremarks-BxfUFX-N.cjs → vue-ui-tiremarks-YmBKSs6G.cjs} +1 -1
- package/dist/{vue-ui-treemap-Bs4erg0I.cjs → vue-ui-treemap-C9dhqMUT.cjs} +1 -1
- package/dist/{vue-ui-treemap-Da1vOiTg.js → vue-ui-treemap-CrHLqEi4.js} +9 -9
- package/dist/{vue-ui-vertical-bar-ByBJTeg-.js → vue-ui-vertical-bar-CsQ-X490.js} +9 -9
- package/dist/{vue-ui-vertical-bar-Cd4AmrnX.cjs → vue-ui-vertical-bar-DcAnWIcO.cjs} +1 -1
- package/dist/{vue-ui-waffle-CHtCkZjz.js → vue-ui-waffle-CkLAdSRm.js} +9 -9
- package/dist/{vue-ui-waffle-BEP6xNLO.cjs → vue-ui-waffle-DExGhS_i.cjs} +1 -1
- package/dist/{vue-ui-wheel-BBKNe16o.cjs → vue-ui-wheel-2rGm4Ger.cjs} +1 -1
- package/dist/{vue-ui-wheel-icxa1L4v.js → vue-ui-wheel-ClLdnjXB.js} +5 -5
- package/dist/{vue-ui-word-cloud-CZnELuH6.cjs → vue-ui-word-cloud-Dt2_G407.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-DZOxxmkR.js → vue-ui-word-cloud-DxqpAd03.js} +7 -7
- package/dist/vue-ui-xy-B3gwrFqE.cjs +3 -0
- package/dist/{vue-ui-xy-vIwvvGNZ.js → vue-ui-xy-DGGELzRv.js} +479 -463
- package/dist/{vue-ui-xy-canvas-ChKN_Cn-.js → vue-ui-xy-canvas-B2dQTZ84.js} +10 -10
- package/dist/{vue-ui-xy-canvas-BvaDluOT.cjs → vue-ui-xy-canvas-BigBCSRq.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-Clt49H-j.cjs +0 -4
- package/dist/vue-ui-xy-DNbVDgjT.cjs +0 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCssVars as q, computed as _, onMounted as R, ref as M, openBlock as a, createElementBlock as o, normalizeStyle as w, createElementVNode as h, createTextVNode as T, toDisplayString as v, unref as r, createCommentVNode as p, Fragment as f, renderList as g, normalizeClass as N, createBlock as A } from "vue";
|
|
2
|
-
import { u as P, o as J, e as D, g as K, c as Q, t as Z, v as b, i as ee, f as te, X as le, s as z } from "./index-
|
|
3
|
-
import { u as F } from "./useNestedProp-
|
|
4
|
-
import { _ as ae } from "./Shape-
|
|
5
|
-
import oe from "./vue-ui-skeleton-
|
|
2
|
+
import { u as P, o as J, e as D, g as K, c as Q, t as Z, v as b, i as ee, f as te, X as le, s as z } from "./index-C0qeGgGL.js";
|
|
3
|
+
import { u as F } from "./useNestedProp-Dqm0GHPD.js";
|
|
4
|
+
import { _ as ae } from "./Shape-DNtGmj4U.js";
|
|
5
|
+
import oe from "./vue-ui-skeleton-Bdc0rBji.js";
|
|
6
6
|
import { _ as se } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
const ue = { key: 0 }, ie = { key: 1 }, ne = ["xmlns", "viewBox"], re = ["id"], ve = ["stop-color"], de = ["stop-color"], ce = ["id"], ye = ["stop-color"], he = ["stop-color"], fe = ["id"], ge = ["stop-color"], pe = ["stop-color"], be = { key: 0 }, me = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], _e = { key: 1 }, xe = ["x", "y", "font-size", "font-weight", "fill"], ke = ["x", "y", "font-size", "fill"], $e = ["x", "y", "font-size", "fill"], we = ["height", "width", "x", "onMouseover", "stroke", "stroke-width", "rx", "stroke-dasharray", "onClick"], Ce = {
|
|
8
8
|
__name: "vue-ui-sparkhistogram",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-Clt49H-j.cjs"),L=require("./useNestedProp-y541YeYg.cjs"),z=require("./vue-ui-skeleton-Gizw7vdX.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),A=["id"],F=["xmlns","viewBox"],G=["id"],W=["stop-color"],q=["stop-color"],T=["id"],j=["stop-color"],H=["stop-color"],O=["id"],U=["stop-color"],X=["stop-color"],Z={key:0},R=["d","fill"],Y=["d","fill"],J=["d","stroke","stroke-width"],K=["x1","x2","y1","y2","stroke","stroke-width"],Q=["x","y","width","height","fill","rx"],ee=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],te=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],le=["cx","cy","r","fill","stroke","stroke-width"],ae=["x","y","font-size","font-weight","fill"],oe=["x","y","height","width","onMouseenter","onClick"],ne={__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}},emits:["hoverIndex","selectDatapoint"],setup(p,{emit:x}){const i=p,{vue_ui_sparkline:$}=o.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(o.createUid()),t=e.computed(()=>{const l=L.useNestedProp({userConfig:i.config,defaultConfig:$});return l.theme?{...L.useNestedProp({userConfig:o.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}),f=e.ref(i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}));e.onMounted(()=>{if(o.objectIsEmpty(i.dataset)?o.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,r)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.style.animation.show&&i.dataset.length>1){let a=function(){r<i.dataset.length?(f.value.push(i.dataset[r]),setTimeout(()=>{requestAnimationFrame(a)},l)):f.value=i.dataset,r+=1};f.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let r=0;a()}});const c=e.ref({height:80,width:500}),V=e.ref(6),n=e.computed(()=>({top:12,left:0,right:c.value.width,bottom:c.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?c.value.width-t.value.style.chartWidth:30,width:i.showInfo&&t.value.style.dataLabel.show?t.value.style.chartWidth:c.value.width-30,height:c.value.height-12})),_=e.computed(()=>Math.min(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),E=e.computed(()=>Math.max(...f.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=_.value>=0?0:_.value;return Math.abs(l)}),C=e.computed(()=>E.value+m.value+V.value),b=e.computed(()=>n.value.bottom-n.value.height*w(m.value));function w(l){return l/C.value}const y=e.computed(()=>i.dataset.length-1),u=e.computed(()=>f.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:w(a+m.value),x:n.value.start+r*(n.value.width/(y.value+1)>30?30:n.value.width/(y.value+1)),y:n.value.bottom-n.value.height*w(a+m.value),id:`plot_${v.value}_${r}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?o.shiftHue(t.value.style.line.color,.05*(1-r/y.value)):t.value.style.line.color,width:n.value.width/(y.value+1)>30?30:n.value.width/(y.value+1)}})),I=e.computed(()=>{const l={x:u.value[0].x,y:c.value.height-6},r={x:u.value[u.value.length-1].x,y:c.value.height-6},a=[];return u.value.forEach(s=>{a.push(`${s.x},${s.y} `)}),[l.x,l.y,...a,r.x,r.y].toString()}),d=e.ref(void 0);function S(l,r){d.value=l,x("hoverIndex",{index:r})}function M(){d.value=void 0,x("hoverIndex",{index:void 0})}const h=e.computed(()=>{if(g.value){const l=u.value.map(a=>a.absoluteValue),r=l.reduce((a,s)=>a+s,0);return{latest:u.value[u.value.length-1].absoluteValue,sum:r,average:r/u.value.length,median:o.calcMedian(l),trend:o.calcLinearProgression(u.value.map(({x:a,y:s,absoluteValue:B})=>({x:a,y:s,value:B}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),N=e.computed(()=>g.value?t.value.style.dataLabel.valueType==="latest"?h.value.latest:t.value.style.dataLabel.valueType==="sum"?h.value.sum:t.value.style.dataLabel.valueType==="average"?h.value.average:0:0),k=e.computed(()=>t.value.type&&t.value.type==="bar");function P(l,r){x("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{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:d.value,latest:h.value.latest,sum:h.value.sum,average:h.value.average,median:h.value.median,trend:h.value.trend})),void 0,!0),t.value.style.title.show&&p.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,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(d.value?d.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${c.value.width} ${c.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[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(o.shiftHue)(t.value.style.area.color,.05)}${e.unref(o.opacity)[t.value.style.area.opacity]}`},null,8,W),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.area.color+e.unref(o.opacity)[t.value.style.area.opacity]},null,8,q)],8,G),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,j),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(o.shiftHue)(t.value.style.bar.color,.05)}`},null,8,H)],8,T),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.shiftHue)(t.value.style.bar.color,.05)}`},null,8,U),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,X)],8,O)]),t.value.style.area.show&&!k.value&&u.value[0]?(e.openBlock(),e.createElementBlock("g",Z,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${u.value[0].x},${n.value.bottom} ${e.unref(o.createSmoothPath)(u.value)} L ${u.value.at(-1).x},${n.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(o.opacity)[t.value.style.area.opacity]}`},null,8,R)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${I.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(o.opacity)[t.value.style.area.opacity]}`},null,8,Y))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(o.createSmoothPath)(u.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,J)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[s<u.value.length-1&&!t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:u.value[s+1].x,y1:a.y,y2:u.value[s+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,K)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:b.value,width:a.width,height:Math.abs(a.y-b.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,Q)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(d.value&&a.id===d.value.id||p.selectedIndex===s)?(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,ee)):e.createCommentVNode("",!0)]))),256)),_.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.value.start,x2:n.value.start+n.value.width-16,y1:b.value,y2:b.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,te)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[d.value&&a.id===d.value.id||p.selectedIndex===s?(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,le)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),p.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:c.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(d.value?e.unref(o.applyDataLabel)(t.value.style.dataLabel.formatter,d.value.absoluteValue,e.unref(o.dataLabel)({p:t.value.style.dataLabel.prefix,v:d.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:d.value}):e.unref(o.applyDataLabel)(t.value.style.dataLabel.formatter,N.value,e.unref(o.dataLabel)({p:t.value.style.dataLabel.prefix,v:N.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,ae)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(n.value.width/(y.value+1)>30?30:n.value.width/(y.value+1))/2,y:n.value.top-6,height:n.value.height+6,width:n.value.width/(y.value+1)>30?30:n.value.width/(y.value+1),fill:"transparent",onMouseenter:B=>S(a,s),onMouseleave:M,onClick:()=>P(a,s)},null,40,oe))),256)),e.renderSlot(l.$slots,"svg",{svg:c.value},void 0,!0)],12,F)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(z.default,{key:2,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,A))}},ue=D._export_sfc(ne,[["__scopeId","data-v-71dd1d7d"]]);exports.default=ue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BaAW-Jni.cjs"),L=require("./useNestedProp-BY4cF5vs.cjs"),z=require("./vue-ui-skeleton-BKcDxJU1.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),A=["id"],F=["xmlns","viewBox"],G=["id"],W=["stop-color"],q=["stop-color"],T=["id"],j=["stop-color"],H=["stop-color"],O=["id"],U=["stop-color"],X=["stop-color"],Z={key:0},R=["d","fill"],Y=["d","fill"],J=["d","stroke","stroke-width"],K=["x1","x2","y1","y2","stroke","stroke-width"],Q=["x","y","width","height","fill","rx"],ee=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],te=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],le=["cx","cy","r","fill","stroke","stroke-width"],ae=["x","y","font-size","font-weight","fill"],oe=["x","y","height","width","onMouseenter","onClick"],ne={__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}},emits:["hoverIndex","selectDatapoint"],setup(p,{emit:x}){const i=p,{vue_ui_sparkline:$}=o.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(o.createUid()),t=e.computed(()=>{const l=L.useNestedProp({userConfig:i.config,defaultConfig:$});return l.theme?{...L.useNestedProp({userConfig:o.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}),f=e.ref(i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}));e.onMounted(()=>{if(o.objectIsEmpty(i.dataset)?o.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,r)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.style.animation.show&&i.dataset.length>1){let a=function(){r<i.dataset.length?(f.value.push(i.dataset[r]),setTimeout(()=>{requestAnimationFrame(a)},l)):f.value=i.dataset,r+=1};f.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let r=0;a()}});const c=e.ref({height:80,width:500}),V=e.ref(6),n=e.computed(()=>({top:12,left:0,right:c.value.width,bottom:c.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?c.value.width-t.value.style.chartWidth:30,width:i.showInfo&&t.value.style.dataLabel.show?t.value.style.chartWidth:c.value.width-30,height:c.value.height-12})),_=e.computed(()=>Math.min(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),E=e.computed(()=>Math.max(...f.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=_.value>=0?0:_.value;return Math.abs(l)}),C=e.computed(()=>E.value+m.value+V.value),b=e.computed(()=>n.value.bottom-n.value.height*w(m.value));function w(l){return l/C.value}const y=e.computed(()=>i.dataset.length-1),u=e.computed(()=>f.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:w(a+m.value),x:n.value.start+r*(n.value.width/(y.value+1)>30?30:n.value.width/(y.value+1)),y:n.value.bottom-n.value.height*w(a+m.value),id:`plot_${v.value}_${r}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?o.shiftHue(t.value.style.line.color,.05*(1-r/y.value)):t.value.style.line.color,width:n.value.width/(y.value+1)>30?30:n.value.width/(y.value+1)}})),I=e.computed(()=>{const l={x:u.value[0].x,y:c.value.height-6},r={x:u.value[u.value.length-1].x,y:c.value.height-6},a=[];return u.value.forEach(s=>{a.push(`${s.x},${s.y} `)}),[l.x,l.y,...a,r.x,r.y].toString()}),d=e.ref(void 0);function S(l,r){d.value=l,x("hoverIndex",{index:r})}function M(){d.value=void 0,x("hoverIndex",{index:void 0})}const h=e.computed(()=>{if(g.value){const l=u.value.map(a=>a.absoluteValue),r=l.reduce((a,s)=>a+s,0);return{latest:u.value[u.value.length-1].absoluteValue,sum:r,average:r/u.value.length,median:o.calcMedian(l),trend:o.calcLinearProgression(u.value.map(({x:a,y:s,absoluteValue:B})=>({x:a,y:s,value:B}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),N=e.computed(()=>g.value?t.value.style.dataLabel.valueType==="latest"?h.value.latest:t.value.style.dataLabel.valueType==="sum"?h.value.sum:t.value.style.dataLabel.valueType==="average"?h.value.average:0:0),k=e.computed(()=>t.value.type&&t.value.type==="bar");function P(l,r){x("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{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:d.value,latest:h.value.latest,sum:h.value.sum,average:h.value.average,median:h.value.median,trend:h.value.trend})),void 0,!0),t.value.style.title.show&&p.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,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(d.value?d.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${c.value.width} ${c.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[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(o.shiftHue)(t.value.style.area.color,.05)}${e.unref(o.opacity)[t.value.style.area.opacity]}`},null,8,W),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.area.color+e.unref(o.opacity)[t.value.style.area.opacity]},null,8,q)],8,G),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,j),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(o.shiftHue)(t.value.style.bar.color,.05)}`},null,8,H)],8,T),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.shiftHue)(t.value.style.bar.color,.05)}`},null,8,U),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,X)],8,O)]),t.value.style.area.show&&!k.value&&u.value[0]?(e.openBlock(),e.createElementBlock("g",Z,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${u.value[0].x},${n.value.bottom} ${e.unref(o.createSmoothPath)(u.value)} L ${u.value.at(-1).x},${n.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(o.opacity)[t.value.style.area.opacity]}`},null,8,R)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${I.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(o.opacity)[t.value.style.area.opacity]}`},null,8,Y))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(o.createSmoothPath)(u.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,J)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[s<u.value.length-1&&!t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:u.value[s+1].x,y1:a.y,y2:u.value[s+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,K)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:b.value,width:a.width,height:Math.abs(a.y-b.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,Q)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(d.value&&a.id===d.value.id||p.selectedIndex===s)?(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,ee)):e.createCommentVNode("",!0)]))),256)),_.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.value.start,x2:n.value.start+n.value.width-16,y1:b.value,y2:b.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,te)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[d.value&&a.id===d.value.id||p.selectedIndex===s?(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,le)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),p.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:c.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(d.value?e.unref(o.applyDataLabel)(t.value.style.dataLabel.formatter,d.value.absoluteValue,e.unref(o.dataLabel)({p:t.value.style.dataLabel.prefix,v:d.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}),{datapoint:d.value}):e.unref(o.applyDataLabel)(t.value.style.dataLabel.formatter,N.value,e.unref(o.dataLabel)({p:t.value.style.dataLabel.prefix,v:N.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}))),9,ae)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(n.value.width/(y.value+1)>30?30:n.value.width/(y.value+1))/2,y:n.value.top-6,height:n.value.height+6,width:n.value.width/(y.value+1)>30?30:n.value.width/(y.value+1),fill:"transparent",onMouseenter:B=>S(a,s),onMouseleave:M,onClick:()=>P(a,s)},null,40,oe))),256)),e.renderSlot(l.$slots,"svg",{svg:c.value},void 0,!0)],12,F)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(z.default,{key:2,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,A))}},ue=D._export_sfc(ne,[["__scopeId","data-v-71dd1d7d"]]);exports.default=ue;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed as d, ref as w, onMounted as J, openBlock as s, createElementBlock as n, normalizeStyle as N, renderSlot as F, normalizeProps as K, guardReactiveProps as Q, createElementVNode as f, toDisplayString as G, createCommentVNode as y, unref as v, Fragment as P, renderList as z, createBlock as ee } from "vue";
|
|
2
|
-
import { u as te, c as ae, t as le, o as ue, e as W, g as oe, s as I, R as se, S as ne, X as re, v as C, M as B, i as E, f as T } from "./index-
|
|
3
|
-
import { u as j } from "./useNestedProp-
|
|
4
|
-
import ie from "./vue-ui-skeleton-
|
|
2
|
+
import { u as te, c as ae, t as le, o as ue, e as W, g as oe, s as I, R as se, S as ne, X as re, v as C, M as B, i as E, f as T } from "./index-C0qeGgGL.js";
|
|
3
|
+
import { u as j } from "./useNestedProp-Dqm0GHPD.js";
|
|
4
|
+
import ie from "./vue-ui-skeleton-Bdc0rBji.js";
|
|
5
5
|
import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const ve = ["id"], ce = ["xmlns", "viewBox"], ye = ["id"], he = ["stop-color"], fe = ["stop-color"], pe = ["id"], ge = ["stop-color"], me = ["stop-color"], ke = ["id"], be = ["stop-color"], xe = ["stop-color"], _e = { key: 0 }, we = ["d", "fill"], $e = ["d", "fill"], Le = ["d", "stroke", "stroke-width"], Ne = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ie = ["x", "y", "width", "height", "fill", "rx"], Ce = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Me = ["x1", "x2", "y1", "y2", "stroke", "stroke-dasharray", "stroke-width"], Se = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Ve = ["x", "y", "font-size", "font-weight", "fill"], Pe = ["x", "y", "height", "width", "onMouseenter", "onClick"], ze = {
|
|
7
7
|
__name: "vue-ui-sparkline",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed as p, ref as m, onMounted as T, openBlock as n, createElementBlock as r, normalizeStyle as g, createElementVNode as u, toDisplayString as k, createCommentVNode as h, unref as b, Fragment as D, renderList as z, normalizeClass as A, createBlock as q } from "vue";
|
|
2
|
-
import { u as H, c as j, t as X, a as J, p as d, b as K, d as P, o as Q, e as E, g as R, f as I, X as W, s as Y, v as Z, i as ee } from "./index-
|
|
3
|
-
import { u as U } from "./useNestedProp-
|
|
4
|
-
import te from "./vue-ui-skeleton-
|
|
2
|
+
import { u as H, c as j, t as X, a as J, p as d, b as K, d as P, o as Q, e as E, g as R, f as I, X as W, s as Y, v as Z, i as ee } from "./index-C0qeGgGL.js";
|
|
3
|
+
import { u as U } from "./useNestedProp-Dqm0GHPD.js";
|
|
4
|
+
import te from "./vue-ui-skeleton-Bdc0rBji.js";
|
|
5
5
|
import { _ as le } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const ae = ["xmlns", "viewBox"], oe = ["id"], se = ["stop-color"], ne = ["stop-color"], re = ["stop-color"], ue = {
|
|
7
7
|
id: "stackPill",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BaAW-Jni.cjs"),C=require("./useNestedProp-BY4cF5vs.cjs"),E=require("./vue-ui-skeleton-BKcDxJU1.cjs"),N=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=["xmlns","viewBox"],z=["id"],D=["stop-color"],P=["stop-color"],L=["stop-color"],A={id:"stackPill",clipPathUnits:"objectBoundingBox"},F=["fill"],U={"clip-path":"url(#stackPill)"},j=["height","width","fill"],q=["onClick","x","width","height","fill","stroke"],I=["onClick"],T={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},H=["height","width"],O=["fill"],M={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(B,{emit:w}){const u=B,{vue_ui_sparkstackbar:$}=o.useConfig(),k=e.computed(()=>!!u.dataset&&u.dataset.length),b=e.ref(o.createUid()),t=e.computed(()=>{const l=C.useNestedProp({userConfig:u.config,defaultConfig:$});return l.theme?{...C.useNestedProp({userConfig:o.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}),m=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),d=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?o.convertColorToHex(l.color):m.value[n]||o.palette[n]||o.palette[n%o.palette.length]}))),p=e.ref(!0);e.onMounted(()=>{if(o.objectIsEmpty(u.dataset)?o.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:a,index:n})})}),t.value.style.animation.show){let h=function(){r+=a/l,r<a?(d.value=d.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?o.convertColorToHex(s.color):m.value[i]||o.palette[i]||o.palette[i%o.palette.length]})),requestAnimationFrame(h)):(p.value=!1,d.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?o.convertColorToHex(s.color):m.value[i]||o.palette[i]||o.palette[i%o.palette.length],id:o.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),a=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;p.value=!0,h()}});const v=e.ref({width:500,height:16}),c=e.ref([]),g=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!c.value.includes(n)).reduce((l,n)=>l+n,0)),_=e.computed(()=>d.value.map((l,n)=>({...l,value:l.value||0,proportion:(l.value||0)/g.value,width:(l.value||0)/g.value*v.value.width,proportionLabel:o.dataLabel({v:(l.value||0)/g.value*100,s:"%",r:t.value.style.legend.percentage.rounding})}))),y=e.computed(()=>_.value.filter((l,n)=>!c.value.includes(n)));function S(l){c.value.includes(l)?c.value=c.value.filter(n=>n!==l):c.value.length<d.value.length-1&&c.value.push(l)}const f=e.computed(()=>{let l=0;const n=[];for(let a=0;a<y.value.length;a+=1)n.push({...y.value[a],start:l}),l+=y.value[a].width;return n});function x(l,n){w("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{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:${t.value.style.backgroundColor};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),k.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),width:"100%",viewBox:`0 0 ${v.value.width} ${v.value.height}`},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${b.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,D),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(o.shiftHue)(a.color,.05)}${e.unref(o.opacity)[100-t.value.style.bar.gradient.intensity]}`},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,L)],8,z))),128)),e.createElementVNode("clipPath",A,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,F)])]),e.createElementVNode("g",U,[e.createElementVNode("rect",{x:0,y:0,height:v.value.height,width:f.value.map(a=>a.width).reduce((a,r)=>a+r,0),fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!p.value})},null,10,j),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,onClick:()=>x(a,r),x:a.start,y:0,width:a.width,height:v.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${b.value})`:a.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!p.value})},null,10,q))),128))])],8,V)):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E.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:${t.value.style.backgroundColor};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(_.value,(a,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":c.value.includes(r)}),onClick:h=>{S(r),x(a,r)}},[e.createElementVNode("div",T,[(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:a.color},null,8,O)],8,H)),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(a.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(c.value.includes(r)?" - ":a.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(o.applyDataLabel)(t.value.style.legend.value.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.legend.value.prefix,v:a.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}),{datapoint:a,seriesIndex:r}))+") ",5)):e.createCommentVNode("",!0)])],14,I))),256))],4)):e.createCommentVNode("",!0)],4))}},G=N._export_sfc(M,[["__scopeId","data-v-86f11bbc"]]);exports.default=G;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as h, ref as v, onMounted as Ne, openBlock as i, createElementBlock as n, normalizeClass as ze, normalizeStyle as G, renderSlot as b, createVNode as ie, createCommentVNode as d, createBlock as Y, unref as w, createSlots as tt, withCtx as f, normalizeProps as I, guardReactiveProps as V, Fragment as m, renderList as $, createElementVNode as P, toDisplayString as z, createTextVNode as at } from "vue";
|
|
2
|
-
import { u as lt, c as Me, o as ot, e as Oe, g as st, t as rt, a as it, p as Q, b as ut, d as nt,
|
|
3
|
-
import { u as Ie } from "./useNestedProp-
|
|
2
|
+
import { u as lt, c as Me, o as ot, e as Oe, g as st, t as rt, a as it, p as Q, b as ut, d as nt, a0 as j, A as Pe, X as ct, l as vt, D as dt, f as D, v as ht, w as Fe, i as Re, x as gt, q as yt, r as bt } from "./index-C0qeGgGL.js";
|
|
3
|
+
import { u as Ie } from "./useNestedProp-Dqm0GHPD.js";
|
|
4
4
|
import { t as ft, u as mt } from "./useResponsive-NZB-WLRF.js";
|
|
5
|
-
import { u as pt, U as xt } from "./usePrinter-
|
|
6
|
-
import { S as kt } from "./Slicer-
|
|
7
|
-
import { _ as wt } from "./Tooltip-
|
|
8
|
-
import { _ as Ct } from "./Title-
|
|
9
|
-
import { L as Lt } from "./Legend-
|
|
10
|
-
import St from "./vue-ui-accordion-
|
|
11
|
-
import { D as $t } from "./DataTable-
|
|
12
|
-
import _t from "./vue-ui-skeleton-
|
|
5
|
+
import { u as pt, U as xt } from "./usePrinter-CBPQ7BTV.js";
|
|
6
|
+
import { S as kt } from "./Slicer-CLvZcQa8.js";
|
|
7
|
+
import { _ as wt } from "./Tooltip-2egolusz.js";
|
|
8
|
+
import { _ as Ct } from "./Title-BmBtTM10.js";
|
|
9
|
+
import { L as Lt } from "./Legend-BJyEF1AJ.js";
|
|
10
|
+
import St from "./vue-ui-accordion-BhMRX1nr.js";
|
|
11
|
+
import { D as $t } from "./DataTable-zAsuxqFp.js";
|
|
12
|
+
import _t from "./vue-ui-skeleton-Bdc0rBji.js";
|
|
13
13
|
import { _ as Tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const Nt = ["id"], zt = ["xmlns", "viewBox"], Mt = { key: 0 }, Ot = ["id"], Pt = ["stop-color"], Ft = ["stop-color"], Rt = ["stop-color"], It = ["x1", "x2", "y1", "y2", "stroke"], Vt = ["x1", "x2", "y1", "y2", "stroke"], Dt = ["x", "y", "height", "rx", "width", "fill", "stroke", "stroke-width"], At = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Et = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ht = ["x", "y", "font-size", "fill", "font-weight"], Bt = ["transform", "font-size", "fill", "font-weight"], Ut = ["x", "y", "font-size", "fill", "font-weight"], Wt = { key: 0 }, Gt = ["x", "y", "font-size", "font-weight", "fill"], Yt = ["x1", "x2", "y1", "y2", "stroke"], Xt = ["x", "y", "font-size", "font-weight", "fill"], Jt = ["text-anchor", "font-size", "font-weight", "fill", "transform"], qt = ["x", "y", "width", "height", "onClick", "onMouseenter", "fill"], Zt = {
|
|
15
15
|
key: 3,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-BaAW-Jni.cjs"),de=require("./useNestedProp-BY4cF5vs.cjs"),ve=require("./useResponsive-B3TrDDIG.cjs"),he=require("./usePrinter-BqDyevJ_.cjs"),Ee=require("./Slicer-CCRiwPOR.cjs"),Ve=require("./Tooltip-CaVyC-lv.cjs"),Pe=require("./Title-Dn_s4xwI.cjs"),Me=require("./Legend-CMA5DWNL.cjs"),Fe=require("./vue-ui-accordion-Dx2HnLJU.cjs"),Re=require("./DataTable-DkWzYsoO.cjs"),Oe=require("./vue-ui-skeleton-BKcDxJU1.cjs"),De=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ie=["id"],qe=["xmlns","viewBox"],Ae={key:0},He=["id"],Ue=["stop-color"],We=["stop-color"],Ge=["stop-color"],Ye=["x1","x2","y1","y2","stroke"],Je=["x1","x2","y1","y2","stroke"],Xe=["x","y","height","rx","width","fill","stroke","stroke-width"],Ze=["x1","x2","y1","y2","stroke","stroke-width"],Ke=["x1","x2","y1","y2","stroke","stroke-width"],Qe=["x","y","font-size","fill","font-weight"],je=["transform","font-size","fill","font-weight"],et=["x","y","font-size","fill","font-weight"],tt={key:0},at=["x","y","font-size","font-weight","fill"],lt=["x1","x2","y1","y2","stroke"],ot=["x","y","font-size","font-weight","fill"],rt=["text-anchor","font-size","font-weight","fill","transform"],st=["x","y","width","height","onClick","onMouseenter","fill"],nt={key:3,class:"vue-data-ui-watermark"},it=["onClick"],ut=["innerHTML"],ct={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(U,{expose:ge,emit:W}){const f=U,{vue_ui_stackbar:me}=u.useConfig(),S=e.computed({get(){return!!f.dataset&&f.dataset.length},set(l){return l}}),L=e.ref(null),R=e.ref(u.createUid()),O=e.ref(!1),G=e.ref(null),D=e.ref(""),h=e.ref([]),Y=e.ref(0),J=e.ref(null),X=e.ref(null),Z=e.ref(null),K=e.ref(0),I=e.ref(!1),q=e.ref(null),E=e.ref(!1);e.onMounted(()=>{u.objectIsEmpty(f.dataset)?u.error({componentName:"VueUiStackbar",type:"dataset"}):f.dataset.forEach((l,o)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{S.value=!1,u.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:o})})}),setTimeout(()=>{E.value=!0},10)});const t=e.computed(()=>{const l=de.useNestedProp({userConfig:f.config,defaultConfig:me});return l.theme?{...de.useNestedProp({userConfig:u.themes.vue_ui_stackbar[l.theme]||f.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}),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:Q,isImaging:j,generatePdf:ee,generateImage:te}=he.usePrinter({elementId:`stackbar_${R.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),V=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}}),pe=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),ae=e.ref(null),le=e.ref(null);e.onMounted(()=>{if(t.value.responsive){const l=ve.throttle(()=>{E.value=!1;const{width:o,height:a}=ve.useResponsive({chart:L.value,title:t.value.style.chart.title.text?J.value:null,legend:t.value.style.chart.legend.show?X.value:null,slicer:t.value.style.chart.zoom.show&&N.value>1?Z.value:null});V.value.width=o,V.value.height=a,clearTimeout(le.value),le.value=setTimeout(()=>{E.value=!0},10)});ae.value=new ResizeObserver(l),ae.value.observe(L.value.parentNode)}});const n=e.computed(()=>{const{height:l,width:o}=V.value,{right:a}=V.value.paddingRatio,r=t.value.style.chart.padding.top,s=o-o*a,c=l-t.value.style.chart.padding.bottom,g=t.value.style.chart.padding.left,C=o-g-o*a,w=l-r-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:o,top:r,right:s,bottom:c,left:g,width:C,height:w<0?0:w}}),k=e.computed(()=>f.dataset.map((l,o)=>{const a=u.convertColorToHex(l.color)||pe.value[o]||u.palette[o]||u.palette[o%u.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(r=>t.value.style.chart.bars.distributed?Math.abs(r):r),signedSeries:l.series.map(r=>r>=0?1:-1),absoluteIndex:o,id:u.createUid(),color:a}})),N=e.computed(()=>Math.max(...k.value.filter(l=>!h.value.includes(l.id)).map(l=>l.series.length))),i=e.ref({start:0,end:Math.max(...f.dataset.map(l=>l.series.length))});function ye(){i.value={start:0,end:Math.max(...f.dataset.map(l=>l.series.length))},K.value+=1}const y=e.computed(()=>{const l=n.value.width/(i.value.end-i.value.start);return l<=0?0:l}),A=e.computed(()=>u.sumSeries(k.value.filter(l=>!h.value.includes(l.id))).slice(i.value.start,i.value.end)),be=e.computed(()=>u.sumSeries(k.value.filter(l=>!h.value.includes(l.id)).map(l=>({...l,series:l.series.map((o,a)=>l.signedSeries[a]===-1&&o>=0?-o:o)}))).slice(i.value.start,i.value.end)),P=e.computed(()=>{const l=k.value.filter(o=>!h.value.includes(o.id));return{positive:u.sumSeries(l.map(o=>({...o,series:o.series.slice(i.value.start,i.value.end).map(a=>a>=0?a:0)}))),negative:u.sumSeries(l.map(o=>({...o,series:o.series.slice(i.value.start,i.value.end).map(a=>a<0?a:0)})))}}),$=e.computed(()=>{const l=Math.max(...P.value.positive),o=Math.min(...P.value.negative),a=[-1/0,1/0,NaN,void 0,null].includes(o)?0:o,r=u.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return r.ticks.map(s=>({zero:n.value.bottom-n.value.height*(Math.abs(r.min)/(r.max+Math.abs(r.min))),y:n.value.bottom-n.value.height*((s+Math.abs(r.min))/(r.max+Math.abs(r.min))),x:n.value.left-8,value:s}))}),M=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(i.value.start,i.value.end)),d=e.computed(()=>{if(!S.value)return[];let l=Array(N.value).fill(0),o=Array(N.value).fill(0);const a=Math.max(...P.value.positive)||0,r=Math.min(...P.value.negative),s=[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,c=u.calculateNiceScale(s>0?0:s,a<0?0:a,t.value.style.chart.grid.scale.ticks),{min:g,max:C}=c,w=C+(g>=0?0:Math.abs(g))||1,x=n.value.height,T=$.value[0]?$.value[0].zero:n.value.bottom;return k.value.filter(b=>!h.value.includes(b.id)).map(b=>{const B=b.series.slice(i.value.start,i.value.end),Ne=b.signedSeries.slice(i.value.start,i.value.end),$e=B.map((v,m)=>n.value.left+y.value*m+y.value*t.value.style.chart.bars.gapRatio/4),Te=B.map((v,m)=>{const z=t.value.style.chart.bars.distributed?(v||0)/A.value[m]:(v||0)/w;let H,_;return v>0?(_=x*z,H=T-_-l[m],l[m]+=_):(_=x*z,H=T+o[m],o[m]+=Math.abs(_)),H}),ze=B.map((v,m)=>{const z=t.value.style.chart.bars.distributed?(v||0)/A.value[m]:(v||0)/w;return v>0?x*z:x*Math.abs(z)}),_e=B.map(v=>Math.abs(v)).reduce((v,m)=>v+m,0);return{...b,proportions:B.map((v,m)=>t.value.style.chart.bars.distributed?(v||0)/A.value[m]:(v||0)/_e),series:B,signedSeries:Ne,x:$e,y:Te,height:ze}})}),fe=e.computed(()=>be.value.map((l,o)=>({value:l,sign:l>=0?1:-1})));function oe(l,o,a,r,s){const c=s===-1&&l>=0?-l:l;return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,c,u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:c,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:o,seriesIndex:a,datapointIndex:r})}function ke(l,o,a,r){return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,u.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:o,seriesIndex:a,datapointIndex:r})}function xe(l){const o=JSON.parse(JSON.stringify(d.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}));W("selectDatapoint",{datapoint:o,period:M.value[l]})}function Ce(l){q.value=l,O.value=!0;const o=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(d.value)).map(s=>({name:s.name,value:s.series[l]===0?0:(s.signedSeries[l]===-1&&s.series[l]>=0?-s.series[l]:s.series[l])||null,proportion:s.proportions[l]||null,color:s.color,id:s.id})),r=a.map(s=>Math.abs(s.value)).reduce((s,c)=>s+c,0);if(u.isFunction(o)&&u.functionReturnsString(()=>o({seriesIndex:l,datapoint:a,series:d.value,config:t.value})))D.value=o({seriesIndex:l,datapoint:a,series:d.value,config:t.value});else{const{showValue:s,showPercentage:c,borderColor:g,roundingValue:C,roundingPercentage:w}=t.value.style.chart.tooltip;let x="";M.value[l]&&(x+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${g};padding-bottom:6px;margin-bottom:3px;">${M.value[l]}</div>`);const T=[s&&c?"(":"",s&&c?")":""];a.reverse().forEach(b=>{x+=`
|
|
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_${b.id})`:b.color}"/></svg>
|
|
4
4
|
${b.name}${s||c?":":""} ${s?u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:b.value,s:t.value.style.chart.bars.dataLabels.suffix,r:C}):""} ${T[0]}${c?u.dataLabel({v:isNaN(b.value/r)?0:Math.abs(b.value)/r*100,s:"%",r:w}):""}${T[1]}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { computed as p, ref as c, onMounted as Le, onBeforeUnmount as Pe, openBlock as r, createElementBlock as i, normalizeClass as O, normalizeStyle as V, createVNode as K, createCommentVNode as v, createBlock as H, unref as h, createSlots as Se, withCtx as f, renderSlot as m, normalizeProps as R, guardReactiveProps as U, Fragment as g, renderList as C, createElementVNode as x, toDisplayString as T, mergeProps as ze, createTextVNode as Ae, nextTick as Ne } from "vue";
|
|
2
|
-
import { u as Oe, c as Q, t as Fe, a as We, p as L, o as Ie, e as Z, g as pe, b as Me, d as ye, A as De, f as B, X as Ge, i as ee, l as Ee, h as Ve, w as fe, x as He, q as Re, r as Ue, C as Be } from "./index-
|
|
2
|
+
import { u as Oe, c as Q, t as Fe, a as We, p as L, o as Ie, e as Z, g as pe, b as Me, d as ye, A as De, f as B, X as Ge, i as ee, l as Ee, h as Ve, w as fe, x as He, q as Re, r as Ue, C as Be } from "./index-C0qeGgGL.js";
|
|
3
3
|
import { t as Xe, u as je } from "./useResponsive-NZB-WLRF.js";
|
|
4
|
-
import { _ as Ye } from "./Title-
|
|
5
|
-
import { u as Je, U as qe } from "./usePrinter-
|
|
6
|
-
import { _ as Ke } from "./Tooltip-
|
|
7
|
-
import { D as Qe } from "./DataTable-
|
|
8
|
-
import Ze from "./vue-ui-skeleton-
|
|
9
|
-
import { _ as et } from "./Shape-
|
|
10
|
-
import tt from "./vue-ui-accordion-
|
|
11
|
-
import { u as be } from "./useNestedProp-
|
|
4
|
+
import { _ as Ye } from "./Title-BmBtTM10.js";
|
|
5
|
+
import { u as Je, U as qe } from "./usePrinter-CBPQ7BTV.js";
|
|
6
|
+
import { _ as Ke } from "./Tooltip-2egolusz.js";
|
|
7
|
+
import { D as Qe } from "./DataTable-zAsuxqFp.js";
|
|
8
|
+
import Ze from "./vue-ui-skeleton-Bdc0rBji.js";
|
|
9
|
+
import { _ as et } from "./Shape-DNtGmj4U.js";
|
|
10
|
+
import tt from "./vue-ui-accordion-BhMRX1nr.js";
|
|
11
|
+
import { u as be } from "./useNestedProp-Dqm0GHPD.js";
|
|
12
12
|
import { _ as lt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
13
|
const at = ["id"], ot = ["xmlns", "viewBox"], st = { key: 0 }, rt = { key: 0 }, ut = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], it = { key: 1 }, nt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], ct = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], vt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ht = ["x", "y", "fill", "font-size"], dt = ["x", "y", "font-size", "fill"], pt = ["fill", "font-size", "transform"], yt = ["fill", "font-size", "x", "y"], ft = ["x1", "x2", "y1", "y2", "stroke"], bt = ["cx", "cy", "fill"], mt = ["cx", "cy", "fill"], gt = ["id"], xt = ["stop-color"], kt = ["stop-color"], Ct = ["stop-color"], wt = { key: 0 }, _t = ["x", "y", "font-size", "fill"], $t = {
|
|
14
14
|
key: 3,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-Clt49H-j.cjs"),j=require("./useResponsive-B3TrDDIG.cjs"),re=require("./Title-CUD-K-0i.cjs"),X=require("./usePrinter-B9AbYwAC.cjs"),se=require("./Tooltip-CdjFc0lT.cjs"),ne=require("./DataTable-Di-7_6Aq.cjs"),ue=require("./vue-ui-skeleton-Gizw7vdX.cjs"),ie=require("./Shape-dOTW06jG.cjs"),ce=require("./vue-ui-accordion-Czitboqc.cjs"),Y=require("./useNestedProp-y541YeYg.cjs"),ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),de=["id"],he=["xmlns","viewBox"],pe={key:0},me={key:0},ye=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],fe={key:1},be=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ge=["x1","x2","y1","y2","stroke","stroke-width"],ke=["x1","x2","y1","y2","stroke","stroke-width"],xe=["x","y","fill","font-size"],Ce=["x","y","font-size","fill"],we=["fill","font-size","transform"],Be=["fill","font-size","x","y"],_e=["x1","x2","y1","y2","stroke"],$e=["cx","cy","fill"],Ne=["cx","cy","fill"],Se=["id"],Le=["stop-color"],Te=["stop-color"],Pe=["stop-color"],Ee={key:0},ze=["x","y","font-size","fill"],Ve={key:3,class:"vue-data-ui-watermark"},Ae=["innerHTML"],Fe={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(J,{expose:K,emit:Q}){const d=J,{vue_ui_strip_plot:Z}=o.useConfig(),p=e.computed({get(){return!!d.dataset&&d.dataset.length},set(l){return l}}),L=e.ref(o.createUid()),V=e.ref(0),T=e.ref(!1),P=e.ref(""),b=e.ref(null),A=e.ref(null),F=e.ref(!1),t=e.computed(()=>{const l=Y.useNestedProp({userConfig:d.config,defaultConfig:Z});return l.theme?{...Y.useNestedProp({userConfig:o.themes.vue_ui_strip_plot[l.theme]||d.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}),C=e.ref(null);e.onMounted(()=>{if(o.objectIsEmpty(d.dataset)?o.error({componentName:"VueUiStripPlot",type:"dataset"}):d.dataset.forEach((l,s)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(a=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:a,index:s})}),l.plots&&l.plots.forEach((a,n)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=j.throttle(()=>{const{width:s,height:a}=j.useResponsive({chart:b.value,title:t.value.style.chart.title.text?A.value:null});w.value=a,f.value.width=s,f.value.height=a,k.value=(s-v.value.left-v.value.right)/d.dataset.length,B.value=o.translateSize({relator:Math.min(a,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})});C.value=new ResizeObserver(l),C.value.observe(b.value.parentNode)}F.value=!0,setTimeout(()=>{g.value=!1},ee.value*50)}),e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:D,isImaging:O,generatePdf:M,generateImage:W}=X.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),I=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),g=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),v=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),k=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),f=e.ref({width:k.value*d.dataset.length+v.value.left+v.value.right,height:t.value.style.chart.height}),r=e.computed(()=>{const l=k.value*d.dataset.length+v.value.left+v.value.right;return{left:v.value.left,right:l-v.value.right,top:v.value.top,bottom:w.value-v.value.bottom,width:k.value*d.dataset.length,height:w.value-v.value.top-v.value.bottom,stripWidth:k.value,absoluteHeight:w.value,absoluteWidth:l}}),_=e.computed(()=>p.value?d.dataset.map((l,s)=>{const a=o.createUid();return{...l,id:a,color:l.color?o.convertColorToHex(l.color):I.value[s]||o.palette[s]||o.palette[s%o.palette.length],plots:l.plots.map(n=>({...n,parentId:a,color:l.color?o.convertColorToHex(l.color):I.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:o.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(_.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,x:r.value.left+(s+1)*r.value.stripWidth-r.value.stripWidth/2}))}))),ee=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),E=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(a=>a.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>o.calculateNiceScale(E.value.min<0?E.value.min:0,E.value.max,t.value.style.chart.grid.scaleSteps)),te=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,y:r.value.bottom-(a.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*r.value.height}))}))),G=e.computed(()=>m.value.ticks.map(l=>({y:r.value.bottom-r.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:r.value.left,x2:r.value.right,value:l}))),z=e.ref(null),i=e.ref(null);function le({datapoint:l,seriesIndex:s}){z.value={datapoint:l,seriesIndex:s,config:t.value,series:_.value},T.value=!0,i.value=l;const a=t.value.style.chart.tooltip.customFormat;if(o.isFunction(a)&&o.functionReturnsString(()=>a({seriesIndex:s,datapoint:l,series:_.value,config:t.value})))P.value=a({seriesIndex:s,datapoint:l,series:_.value,config:t.value});else{let n="";n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${o.applyDataLabel(t.value.style.chart.labels.formatter,l.value,o.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,P.value=`<div>${n}</div>`}}const $=e.computed(()=>{const l=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${a.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function q(){e.nextTick(()=>{const l=$.value.head.map((n,u)=>[[n.name],[$.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),a=o.createCsvContent(s);o.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const N=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=$.value.head.map((u,y)=>{const S=o.dataLabel({p:t.value.style.chart.labels.prefix,v:$.value.body[y],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},S]}),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:a}}),x=e.ref(!1);function ae(l){x.value=l,V.value+=1}function oe(){return h.value}function R(){c.value.showTable=!c.value.showTable}function U(){c.value.dataLabels.show=!c.value.dataLabels.show}function H(){c.value.showTooltip=!c.value.showTooltip}return K({getData:oe,generatePdf:M,generateCsv:q,generateImage:W,toggleTable:R,toggleLabels:U,toggleTooltip:H}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:b,class:e.normalizeClass(`vue-ui-strip-plot ${x.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(re._sfc_main,{config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(D),isImaging:e.unref(O),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:x.value,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,onToggleFullscreen:ae,onGeneratePdf:e.unref(M),onGenerateCsv:q,onGenerateImage:e.unref(W),onToggleTable:R,onToggleLabels:U,onToggleTooltip:H},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":x.value,"vue-data-ui-fulscreen--off":!x.value}),viewBox:`0 0 ${f.value.width<=0?10:f.value.width} ${f.value.height<=0?10:f.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};`)},[t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",pe,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,a=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,ye))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+(n+1)*r.value.stripWidth,x2:r.value.left+(n+1)*r.value.stripWidth,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,be))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:r.value.left,x2:r.value.left,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,ge),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:r.value.bottom,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,ke)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(G.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:a.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.chart.labels.prefix,v:a.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:a,seriesIndex:n})),9,xe))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+(n+1)*r.value.stripWidth-r.value.stripWidth/2,y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(a.name),9,Ce))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:3,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${r.value.top+r.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,we)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:r.value.left+r.value.width/2,y:r.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Be)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,_e),e.createElementVNode("circle",{cx:r.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,$e),e.createElementVNode("circle",{cx:r.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ne)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,a=>(e.openBlock(),e.createElementBlock("radialGradient",{id:a.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(o.lightenHexColor)(a.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,Le),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(o.darkenHexColor)(a.color,.1)},null,8,Te),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Pe)],8,Se))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,y)=>(e.openBlock(),e.createBlock(ie._sfc_main,e.mergeProps({plot:{x:u.x,y:F.value?u.y:r.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${a.id})`:a.color,onMouseenter:S=>le({datapoint:u,seriesIndex:y}),onMouseleave:s[0]||(s[0]=S=>{T.value=!1,i.value=null}),onClick:S=>Q("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${g.value?`transition-delay:${y*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&g.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!g.value}},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[y===a.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&g.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(o.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:y}):""),13,ze)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:r.value},void 0,!0)],14,he)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ve,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(D)||e.unref(O)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ue.default,{key:4,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),e.createVNode(se._sfc_main,{show:c.value.showTooltip&&T.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:b.value,content:P.value,isCustom:e.unref(o.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),p.value?(e.openBlock(),e.createBlock(ce.default,{key:5,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ne.DataTable,{colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=a=>c.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Ae)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,de))}},De=ve._export_sfc(Fe,[["__scopeId","data-v-22897da0"]]);exports.default=De;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BaAW-Jni.cjs"),j=require("./useResponsive-B3TrDDIG.cjs"),re=require("./Title-Dn_s4xwI.cjs"),X=require("./usePrinter-BqDyevJ_.cjs"),se=require("./Tooltip-CaVyC-lv.cjs"),ne=require("./DataTable-DkWzYsoO.cjs"),ue=require("./vue-ui-skeleton-BKcDxJU1.cjs"),ie=require("./Shape-uxtn2rUk.cjs"),ce=require("./vue-ui-accordion-Dx2HnLJU.cjs"),Y=require("./useNestedProp-BY4cF5vs.cjs"),ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),de=["id"],he=["xmlns","viewBox"],pe={key:0},me={key:0},ye=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],fe={key:1},be=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ge=["x1","x2","y1","y2","stroke","stroke-width"],ke=["x1","x2","y1","y2","stroke","stroke-width"],xe=["x","y","fill","font-size"],Ce=["x","y","font-size","fill"],we=["fill","font-size","transform"],Be=["fill","font-size","x","y"],_e=["x1","x2","y1","y2","stroke"],$e=["cx","cy","fill"],Ne=["cx","cy","fill"],Se=["id"],Le=["stop-color"],Te=["stop-color"],Pe=["stop-color"],Ee={key:0},ze=["x","y","font-size","fill"],Ve={key:3,class:"vue-data-ui-watermark"},Ae=["innerHTML"],Fe={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(J,{expose:K,emit:Q}){const d=J,{vue_ui_strip_plot:Z}=o.useConfig(),p=e.computed({get(){return!!d.dataset&&d.dataset.length},set(l){return l}}),L=e.ref(o.createUid()),V=e.ref(0),T=e.ref(!1),P=e.ref(""),b=e.ref(null),A=e.ref(null),F=e.ref(!1),t=e.computed(()=>{const l=Y.useNestedProp({userConfig:d.config,defaultConfig:Z});return l.theme?{...Y.useNestedProp({userConfig:o.themes.vue_ui_strip_plot[l.theme]||d.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}),C=e.ref(null);e.onMounted(()=>{if(o.objectIsEmpty(d.dataset)?o.error({componentName:"VueUiStripPlot",type:"dataset"}):d.dataset.forEach((l,s)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(a=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:a,index:s})}),l.plots&&l.plots.forEach((a,n)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=j.throttle(()=>{const{width:s,height:a}=j.useResponsive({chart:b.value,title:t.value.style.chart.title.text?A.value:null});w.value=a,f.value.width=s,f.value.height=a,k.value=(s-v.value.left-v.value.right)/d.dataset.length,B.value=o.translateSize({relator:Math.min(a,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})});C.value=new ResizeObserver(l),C.value.observe(b.value.parentNode)}F.value=!0,setTimeout(()=>{g.value=!1},ee.value*50)}),e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:D,isImaging:O,generatePdf:M,generateImage:W}=X.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),I=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),g=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),v=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),k=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),f=e.ref({width:k.value*d.dataset.length+v.value.left+v.value.right,height:t.value.style.chart.height}),r=e.computed(()=>{const l=k.value*d.dataset.length+v.value.left+v.value.right;return{left:v.value.left,right:l-v.value.right,top:v.value.top,bottom:w.value-v.value.bottom,width:k.value*d.dataset.length,height:w.value-v.value.top-v.value.bottom,stripWidth:k.value,absoluteHeight:w.value,absoluteWidth:l}}),_=e.computed(()=>p.value?d.dataset.map((l,s)=>{const a=o.createUid();return{...l,id:a,color:l.color?o.convertColorToHex(l.color):I.value[s]||o.palette[s]||o.palette[s%o.palette.length],plots:l.plots.map(n=>({...n,parentId:a,color:l.color?o.convertColorToHex(l.color):I.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:o.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(_.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,x:r.value.left+(s+1)*r.value.stripWidth-r.value.stripWidth/2}))}))),ee=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),E=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(a=>a.value));return{max:Math.max(...l),min:Math.min(...l)}}),m=e.computed(()=>o.calculateNiceScale(E.value.min<0?E.value.min:0,E.value.max,t.value.style.chart.grid.scaleSteps)),te=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(a=>({...a,y:r.value.bottom-(a.value+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))*r.value.height}))}))),G=e.computed(()=>m.value.ticks.map(l=>({y:r.value.bottom-r.value.height*((l+Math.abs(m.value.min))/(m.value.max+Math.abs(m.value.min))),x1:r.value.left,x2:r.value.right,value:l}))),z=e.ref(null),i=e.ref(null);function le({datapoint:l,seriesIndex:s}){z.value={datapoint:l,seriesIndex:s,config:t.value,series:_.value},T.value=!0,i.value=l;const a=t.value.style.chart.tooltip.customFormat;if(o.isFunction(a)&&o.functionReturnsString(()=>a({seriesIndex:s,datapoint:l,series:_.value,config:t.value})))P.value=a({seriesIndex:s,datapoint:l,series:_.value,config:t.value});else{let n="";n+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${t.value.style.chart.plots.gradient.show?`url(#${l.parentId})`:l.color}"/></svg>${l.name}</div>`,n+=`<div>${o.applyDataLabel(t.value.style.chart.labels.formatter,l.value,o.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,P.value=`<div>${n}</div>`}}const $=e.computed(()=>{const l=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${a.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(a=>JSON.parse(JSON.stringify(a.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function q(){e.nextTick(()=>{const l=$.value.head.map((n,u)=>[[n.name],[$.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),a=o.createCsvContent(s);o.downloadCsv({csvContent:a,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const N=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=$.value.head.map((u,y)=>{const S=o.dataLabel({p:t.value.style.chart.labels.prefix,v:$.value.body[y],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},S]}),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:a}}),x=e.ref(!1);function ae(l){x.value=l,V.value+=1}function oe(){return h.value}function R(){c.value.showTable=!c.value.showTable}function U(){c.value.dataLabels.show=!c.value.dataLabels.show}function H(){c.value.showTooltip=!c.value.showTooltip}return K({getData:oe,generatePdf:M,generateCsv:q,generateImage:W,toggleTable:R,toggleLabels:U,toggleTooltip:H}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:b,class:e.normalizeClass(`vue-ui-strip-plot ${x.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;${t.value.style.chart.title.text?"":"padding-top:36px"};background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:A,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[e.createVNode(re._sfc_main,{config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(X.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(D),isImaging:e.unref(O),uid:L.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:c.value.showTooltip,isFullscreen:x.value,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,onToggleFullscreen:ae,onGeneratePdf:e.unref(M),onGenerateCsv:q,onGenerateImage:e.unref(W),onToggleTable:R,onToggleLabels:U,onToggleTooltip:H},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":x.value,"vue-data-ui-fulscreen--off":!x.value}),viewBox:`0 0 ${f.value.width<=0?10:f.value.width} ${f.value.height<=0?10:f.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};`)},[t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",pe,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,a=>(e.openBlock(),e.createElementBlock("line",{x1:a.x1,x2:a.x2,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.horizontalGrid.stroke,"stroke-width":t.value.style.chart.grid.horizontalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.horizontalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,ye))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("line",{x1:r.value.left+(n+1)*r.value.stripWidth,x2:r.value.left+(n+1)*r.value.stripWidth,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.verticalGrid.stroke,"stroke-width":t.value.style.chart.grid.verticalGrid.strokeWidth,"stroke-dasharray":t.value.style.chart.grid.verticalGrid.strokeDasharray,"stroke-linecap":"round"},null,8,be))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:r.value.left,x2:r.value.left,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,ge),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:r.value.bottom,y2:r.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,ke)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(G.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:a.y+t.value.style.chart.labels.yAxisLabels.fontSize/3,fill:t.value.style.chart.labels.yAxisLabels.color,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,"text-anchor":"end"},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,a.value,e.unref(o.dataLabel)({p:t.value.style.chart.labels.prefix,v:a.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:a,seriesIndex:n})),9,xe))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(h.value,(a,n)=>(e.openBlock(),e.createElementBlock("text",{x:r.value.left+(n+1)*r.value.stripWidth-r.value.stripWidth/2,y:r.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize*2+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"text-anchor":"middle"},e.toDisplayString(a.name),9,Ce))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:3,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,transform:`translate(${t.value.style.chart.labels.axis.fontSize+t.value.style.chart.labels.axis.yLabelOffsetX}, ${r.value.top+r.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,we)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:4,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:r.value.left+r.value.width/2,y:r.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Be)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:i.value.y,y2:i.value.y,stroke:i.value.color,"stroke-width":1,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,_e),e.createElementVNode("circle",{cx:r.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,$e),e.createElementVNode("circle",{cx:r.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ne)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,a=>(e.openBlock(),e.createElementBlock("radialGradient",{id:a.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(o.lightenHexColor)(a.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,Le),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(o.darkenHexColor)(a.color,.1)},null,8,Te),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Pe)],8,Se))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,y)=>(e.openBlock(),e.createBlock(ie._sfc_main,e.mergeProps({plot:{x:u.x,y:F.value?u.y:r.value.top},radius:i.value&&i.value.id===u.id?B.value*1.5:B.value,shape:t.value.style.chart.plots.shape,stroke:t.value.style.chart.plots.stroke,strokeWidth:t.value.style.chart.plots.strokeWidth,color:t.value.style.chart.plots.gradient.show?`url(#${a.id})`:a.color,onMouseenter:S=>le({datapoint:u,seriesIndex:y}),onMouseleave:s[0]||(s[0]=S=>{T.value=!1,i.value=null}),onClick:S=>Q("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${g.value?`transition-delay:${y*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&g.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!g.value}},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[y===a.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&g.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(o.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(o.dataLabel)({p:`(${t.value.style.chart.labels.prefix}`,v:u.value,s:`${t.value.style.chart.labels.suffix})`,r:t.value.style.chart.labels.bestPlotLabel.rounding}),{datapoint:u,seriesIndex:y}):""),13,ze)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:r.value},void 0,!0)],14,he)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ve,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(D)||e.unref(O)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ue.default,{key:4,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),e.createVNode(se._sfc_main,{show:c.value.showTooltip&&T.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:b.value,content:P.value,isCustom:e.unref(o.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...z.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),p.value?(e.openBlock(),e.createBlock(ce.default,{key:5,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[e.createVNode(ne.DataTable,{colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=a=>c.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a,style:{display:"flex","align-items":"center"}},null,8,Ae)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a.name||a),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,de))}},De=ve._export_sfc(Fe,[["__scopeId","data-v-22897da0"]]);exports.default=De;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"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-BaAW-Jni.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, y as G, m as M, d as T, z as E, q as z, r as B, S as H } from "./index-
|
|
1
|
+
import { p as D, u as x, y as G, m as M, d as T, z as E, q as z, r as B, S as H } from "./index-C0qeGgGL.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-BaAW-Jni.cjs"),C=require("./useNestedProp-BY4cF5vs.cjs"),P=require("./usePrinter-BqDyevJ_.cjs"),z=require("./Shape-uxtn2rUk.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),O=["id"],T={role:"cell"},M={role:"row"},G=["data-cell"],q={key:0,style:{display:"flex","flex-direction":"row",gap:"2px","align-items":"center"}},U=["height","width"],L={key:0,role:"cell","data-cell":"sum"},A={key:1,role:"cell","data-cell":"average"},D={key:2,role:"cell","data-cell":"median"},H={__name:"vue-ui-table-heatmap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(_,{expose:B}){const d=_;e.useCssVars(t=>({bb8dc4a0:V.value,"44bd448b":S.value}));const{vue_ui_table_heatmap:I}=r.useConfig(),p=e.ref(r.createUid()),s=e.ref(!1),c=e.ref(null),m=e.ref(!1),v=e.ref(0),o=e.computed(()=>{const t=C.useNestedProp({userConfig:d.config,defaultConfig:I});return t.theme?{...C.useNestedProp({userConfig:r.themes.vue_ui_table_heatmap[t.theme]||d.config,defaultConfig:t})}:t}),{isPrinting:$,isImaging:N,generatePdf:f,generateImage:g}=P.usePrinter({elementId:`table_heatmap_${p.value}`,fileName:"vue-ui-table-heatmap"}),x=e.computed(()=>o.value.table.responsiveBreakpoint),E=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(()=>{r.objectIsEmpty(d.dataset)&&r.error({componentName:"VueUiTableHeatmap",type:"dataset"});const t=new ResizeObserver(l=>{l.forEach(a=>{s.value=a.contentRect.width<x.value})});c.value&&t.observe(c.value)});const h=e.computed(()=>d.dataset.map(t=>{const l=t.values.map(n=>isNaN(n)?0:n),a=l.reduce((n,i)=>n+i,0);return{...t,values:l,serieExtremes:{max:Math.max(...l),min:Math.min(...l)},sum:a,average:a/l.length,median:r.calcMedian(l),displayValues:[t.name,...t.values],id:r.createUid()}})),b=e.computed(()=>{const t=h.value.flatMap(l=>l.values);return{min:Math.min(...t),max:Math.max(...t)}});function w(t,l){const a=o.value.style.heatmapColors.useIndividualScale;return r.interpolateColorHex(o.value.style.heatmapColors.min,o.value.style.heatmapColors.max,a?l.min:b.value.min,a?l.max:b.value.max,t)}const y=e.computed(()=>h.value.map(t=>({...t,colors:t.displayValues.map(l=>isNaN(l)?o.value.style.backgroundColor:w(l,t.serieExtremes))}))),S=e.computed(()=>o.value.style.backgroundColor),V=e.computed(()=>`${o.value.table.borderWidth}px`);function k(){e.nextTick(()=>{const t=y.value.map(n=>[[n.name],n.displayValues,[n.sum],[n.average],[n.median]]),l=[[[""],o.value.table.head.values,["sum"],["average"],["median"]]].concat(t),a=r.createCsvContent(l);r.downloadCsv({csvContent:a,title:"vue-ui-table-heatmap"})})}function F(t){m.value=t,v.value+=1}return B({generatePdf:f,generateCsv:k,generateImage:g}),(t,l)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:c,style:e.normalizeStyle(`width:100%; overflow-x:auto; container-type: inline-size;padding-top:${o.value.userOptions.show?"36px":""}; ${m.value?"vue-data-ui-wrapper-fullscreen":""}; position:relative;`),class:e.normalizeClass({"vue-ui-responsive":s.value}),id:`table_heatmap_${p.value}`},[o.value.userOptions.show&&E.value?(e.openBlock(),e.createBlock(P.UserOptions,{ref:"details",key:`user_option_${v.value}`,backgroundColor:o.value.style.backgroundColor,color:o.value.style.color,isPrinting:e.unref($),isImaging:e.unref(N),uid:p.value,hasPdf:o.value.userOptions.buttons.pdf,hasXls:o.value.userOptions.buttons.csv,hasImg:o.value.userOptions.buttons.img,hasFullscreen:o.value.userOptions.buttons.fullscreen,isFullscreen:m.value,titles:{...o.value.userOptions.buttonTitles},chartElement:c.value,onToggleFullscreen:F,onGeneratePdf:e.unref(f),onGenerateCsv:k,onGenerateImage:e.unref(g)},e.createSlots({_:2},[t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:n})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:n})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),e.createElementVNode("table",{class:e.normalizeClass({"vue-ui-table-heatmap":!0}),style:e.normalizeStyle(`width:100%;font-family:${o.value.style.fontFamily};background:${o.value.style.backgroundColor};`)},[e.createElementVNode("caption",null,[e.renderSlot(t.$slots,"caption",{},void 0,!0)]),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${o.value.table.head.backgroundColor};color:${o.value.table.head.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value.table.head.values,(a,n)=>(e.openBlock(),e.createElementBlock("th",T,[e.renderSlot(t.$slots,"head",e.normalizeProps(e.guardReactiveProps({value:a,rowIndex:n,type:typeof a,isResponsive:s.value})),void 0,!0)]))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(a,n)=>(e.openBlock(),e.createElementBlock("tr",M,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.displayValues,(i,u)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":o.value.table.head.values[u]},[a.color&&u===0?(e.openBlock(),e.createElementBlock("div",q,[a.color?(e.openBlock(),e.createElementBlock("svg",{key:0,height:o.value.style.shapeSize,width:o.value.style.shapeSize,viewBox:"0 0 20 20",style:{background:"none",overflow:"visible"}},[e.createVNode(z._sfc_main,{plot:{x:10,y:10},color:a.color,radius:9,shape:a.shape||"circle"},null,8,["color","shape"])],8,U)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"rowTitle",e.normalizeProps(e.guardReactiveProps({value:i,rowIndex:n,colIndex:u,type:typeof i,isResponsive:s.value})),void 0,!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[u===0?e.renderSlot(t.$slots,"rowTitle",e.normalizeProps(e.mergeProps({key:0},{value:i,rowIndex:n,colIndex:u,type:typeof i,isResponsive:s.value})),void 0,!0):e.createCommentVNode("",!0),u>0?e.renderSlot(t.$slots,"cell",e.normalizeProps(e.mergeProps({key:1},{value:i,rowIndex:n,colIndex:u,type:typeof i,isResponsive:s.value,color:a.colors[u],textColor:e.unref(r.adaptColorToBackground)(a.colors[u])})),void 0,!0):e.createCommentVNode("",!0)],64))],8,G))),256)),o.value.table.showSum?(e.openBlock(),e.createElementBlock("td",L,[e.renderSlot(t.$slots,"sum",e.normalizeProps(e.guardReactiveProps({value:a.sum,rowIndex:n,isResponsive:s.value})),void 0,!0)])):e.createCommentVNode("",!0),o.value.table.showAverage?(e.openBlock(),e.createElementBlock("td",A,[e.renderSlot(t.$slots,"average",e.normalizeProps(e.guardReactiveProps({value:a.average,rowIndex:n,isResponsive:s.value})),void 0,!0)])):e.createCommentVNode("",!0),o.value.table.showMedian?(e.openBlock(),e.createElementBlock("td",D,[e.renderSlot(t.$slots,"median",e.normalizeProps(e.guardReactiveProps({value:a.median,rowIndex:n,isResponsive:s.value})),void 0,!0)])):e.createCommentVNode("",!0)]))),256))])],4)],14,O))}},X=R._export_sfc(H,[["__scopeId","data-v-3d431bc6"]]);exports.default=X;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCssVars as J, ref as h, computed as c, onMounted as K, openBlock as n, createElementBlock as l, normalizeStyle as $, normalizeClass as V, createBlock as Q, unref as g, createSlots as Y, withCtx as C, renderSlot as r, normalizeProps as v, guardReactiveProps as f, createCommentVNode as p, createElementVNode as b, Fragment as _, renderList as w, createVNode as Z, mergeProps as z, nextTick as j } from "vue";
|
|
2
|
-
import { u as ee, c as E, t as te, o as ae, e as oe, R as se, D as ne, I as le, q as re, r as ue } from "./index-
|
|
3
|
-
import { u as M } from "./useNestedProp-
|
|
4
|
-
import { u as ie, U as de } from "./usePrinter-
|
|
5
|
-
import { _ as ce } from "./Shape-
|
|
2
|
+
import { u as ee, c as E, t as te, o as ae, e as oe, R as se, D as ne, I as le, q as re, r as ue } from "./index-C0qeGgGL.js";
|
|
3
|
+
import { u as M } from "./useNestedProp-Dqm0GHPD.js";
|
|
4
|
+
import { u as ie, U as de } from "./usePrinter-CBPQ7BTV.js";
|
|
5
|
+
import { _ as ce } from "./Shape-DNtGmj4U.js";
|
|
6
6
|
import { _ as ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
const pe = ["id"], me = { role: "cell" }, fe = { role: "row" }, he = ["data-cell"], ge = {
|
|
8
8
|
key: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-Clt49H-j.cjs"),V=require("./useNestedProp-y541YeYg.cjs"),H=require("./vue-ui-sparkline-KOF_6Pig.cjs"),X=require("./BaseIcon-Durv5g7g.cjs"),P=require("./usePrinter-B9AbYwAC.cjs"),J=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),K=["id"],Q={style:{"z-index":"1","padding-right":"24px"}},Y=["onClick"],Z={style:{display:"flex","flex-direction":"row",gap:"3px","align-items":"center"}},j=["data-cell"],ee={dir:"auto",style:{display:"flex","flex-direction":"row","align-items":"center",gap:"6px"}},te=["data-cell","onPointerenter"],le=["data-cell"],ae=["data-cell"],oe=["data-cell"],ne=["data-cell"],re={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup($,{expose:D}){const v=$;e.useCssVars(l=>({"328044aa":l.tdo}));const{vue_ui_table_sparkline:F}=u.useConfig(),y=e.ref(u.createUid()),x=e.ref(0),S=e.ref(0),t=e.computed(()=>{const l=V.useNestedProp({userConfig:v.config,defaultConfig:F});return l.theme?{...V.useNestedProp({userConfig:u.themes.vue_ui_table_sparkline[l.theme]||v.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}),{isPrinting:C,isImaging:z,generatePdf:I,generateImage:N}=P.usePrinter({elementId:`table_${y.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline"}),O=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),f=e.ref(null),w=e.ref(!1),W=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{u.objectIsEmpty(v.dataset)&&u.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(s=>{s.forEach(a=>{w.value=a.contentRect.width<W.value})});f.value&&l.observe(f.value)});const B=e.computed(()=>(v.dataset.forEach((l,s)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{u.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:s})})}),v.dataset.map((l,s)=>{const a=(l.values||[]).map(r=>isNaN(r)?0:r??0),n=a.reduce((r,o)=>r+o,0);return{...l,values:l.values||[],color:u.convertColorToHex(l.color)||O.value[s]||u.palette[s]||u.palette[s%u.palette.length],sum:n,average:n/a.length,median:u.calcMedian(a),sparklineDataset:a.map((r,o)=>({period:t.value.colNames[o]||`col ${o}`,value:r||0}))}})));function L(l){const a=(l[0].values||[]).map((r,o)=>l.map(i=>i.values[o]||[])).map(r=>r.map((o,i)=>[o,i]).sort((o,i)=>i[0]-o[0]).map(o=>o[1]));return l.map((r,o)=>({...r,values:r.values||[],orders:a[o]}))}const m=e.computed(()=>L(B.value)),b=e.ref(m.value),T=e.computed(()=>Math.max(...b.value.map(l=>(l.values||[]).length))),g=e.ref(void 0),k=e.ref(!1),h=e.ref(void 0),_=e.ref(-1);function M(){k.value=!1,h.value=void 0,_.value=-1,b.value=m.value}function G(l){k.value=!0,h.value=l;const s=m.value.map(o=>o.values[l]||[]),a=g.value===l?1:-1;_.value=a,l===g.value?g.value=void 0:g.value=l;const r=s.map((o,i)=>[i,o]).sort((o,i)=>a*(i[1]-o[1])).map(o=>o[0]).map(o=>m.value[o]);b.value=r,S.value+=1}const q=e.computed(()=>Math.max(...v.dataset.map(l=>(l.values||[]).length))),p=e.computed(()=>{let l=t.value.colNames;if(!l.length)for(let a=0;a<q.value;a+=1)l.push(`col ${a+1}`);t.value.showTotal&&(l=[...l,t.value.translations.total]);let s;return t.value.showAverage&&t.value.showMedian?s=[...l,t.value.translations.average,t.value.translations.median]:t.value.showAverage&&!t.value.showMedian?s=[...l,t.value.translations.average]:!t.value.showAverage&&t.value.showMedian?s=[...l,t.value.translations.median]:s=l,t.value.showSparklines?[...s,t.value.translations.chart]:s}),d=e.ref(void 0),c=e.ref(void 0);function R({dataIndex:l,serieIndex:s}){d.value=l,c.value=s}const A=e.ref(!1);function U(l){A.value=l,x.value+=1}function E(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(p.value),s=B.value.map((r,o)=>[[r.name],r.values,[r.sum],[r.average],[r.median]]),a=[l].concat(s),n=u.createCsvContent(a);u.downloadCsv({csvContent:n,title:t.value.title.text||"vue-ui-table-sparkline"})})}return D({generatePdf:I,generateImage:N,generateCsv:E,restoreOrder:M}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:f,class:e.normalizeClass({"vue-ui-responsive":w.value}),style:{overflow:"hidden"},id:`table_${y.value}`},[e.createElementVNode("div",{style:{overflow:"auto"},onPointerleave:s[0]||(s[0]=a=>{c.value=void 0,d.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[t.value.title.text?(e.openBlock(),e.createElementBlock("caption",{key:0,style:e.normalizeStyle({backgroundColor:t.value.title.backgroundColor})},[e.createElementVNode("div",{style:e.normalizeStyle({fontSize:`${t.value.title.fontSize}px`,fontWeight:t.value.title.bold?"bold":"normal",color:t.value.title.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.text),5),t.value.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({fontSize:`${t.value.title.subtitle.fontSize}px`,fontWeight:t.value.title.subtitle.bold?"bold":"normal",color:t.value.title.subtitle.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("thead",Q,[e.createElementVNode("tr",{role:"row",class:"vue-ui-data-table__thead-row",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color})},[e.createElementVNode("th",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,outline:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal"}),class:"sticky-col-first"},e.toDisplayString(t.value.translations.serie),5),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(a,n)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",style:e.normalizeStyle({background:t.value.thead.backgroundColor,outline:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal",minWidth:n===p.value.length-1?"150px":"",cursor:m.value[0].values[n]!==void 0?"pointer":"default"}),onClick:()=>G(n),class:e.normalizeClass({"sticky-col":n===p.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",Z,[e.createElementVNode("span",null,e.toDisplayString(a),1),k.value&&n===h.value&&m.value[0].values[n]!==void 0?(e.openBlock(),e.createBlock(X.default,{key:0,size:18,name:_.value===1?"sort":"sortReverse",stroke:t.value.thead.color},null,8,["name","stroke"])):e.createCommentVNode("",!0)]),t.value.userOptions.show&&n===p.value.length-1?(e.openBlock(),e.createBlock(P.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${x.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(C),isImaging:e.unref(z),uid:y.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:A.value,titles:{...t.value.userOptions.buttonTitles},chartElement:f.value,onToggleFullscreen:U,onGeneratePdf:e.unref(I),onGenerateImage:e.unref(N),onGenerateCsv:E},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:r,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:r,isFullscreen:o})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0)],14,Y))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(a,n)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,color:t.value.tbody.color}),class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":n%2===0,"vue-ui-data-table__tbody__row-odd":n%2!==0})},[e.createElementVNode("td",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.serie,class:"vue-ui-data-table__tbody__td sticky-col-first"},[e.createElementVNode("div",ee,[e.createElementVNode("span",{style:e.normalizeStyle({color:a.color})},"⬤",4),e.createElementVNode("span",null,e.toDisplayString(a.name??"-"),1)])],12,j),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(r,o)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,backgroundColor:d.value!==void 0&&c.value!==void 0&&o===d.value&&c.value===n?`${a.color}33`:"",borderRadius:d.value!==void 0&&c.value!==void 0&&o===d.value&&c.value===n?"3px":""}),"data-cell":p.value[o],class:"vue-ui-data-table__tbody__td",onPointerenter:i=>{c.value=n,d.value=o}},e.toDisplayString([null,void 0].includes(a.values[o])?"-":e.unref(u.applyDataLabel)(t.value.formatter,Number(a.values[o]),e.unref(u.dataLabel)({p:t.value.prefix,v:Number(a.values[o]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:n,datapointIndex:o})),45,te))),256)),t.value.showTotal?(e.openBlock(),e.createElementBlock("td",{key:0,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.total,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.sum,e.unref(u.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:n})),13,le)):e.createCommentVNode("",!0),t.value.showAverage?(e.openBlock(),e.createElementBlock("td",{key:1,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.average,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.average,e.unref(u.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:n})),13,ae)):e.createCommentVNode("",!0),t.value.showMedian?(e.openBlock(),e.createElementBlock("td",{key:2,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.median,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.median,e.unref(u.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:n})),13,oe)):e.createCommentVNode("",!0),t.value.showSparklines?(e.openBlock(),e.createElementBlock("td",{key:3,role:"cell","data-cell":t.value.translations.chart,style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),class:"vue-ui-data-table__tbody__td sticky-col"},[(e.openBlock(),e.createBlock(H.default,{key:`sparkline_${n}_${S.value}`,onHoverIndex:({index:r})=>R({dataIndex:r,serieIndex:n}),dataset:a.sparklineDataset,showInfo:!1,selectedIndex:d.value,config:{type:t.value.sparkline.type,style:{backgroundColor:t.value.tbody.backgroundColor,animation:{show:t.value.sparkline.animation.show&&!e.unref(C)&&!e.unref(z),animationFrames:t.value.sparkline.animation.animationFrames},line:{color:a.color,smooth:t.value.sparkline.smooth,strokeWidth:t.value.sparkline.strokeWidth},bar:{color:a.color},area:{color:a.color,opacity:t.value.sparkline.showArea?16:0,useGradient:t.value.sparkline.useGradient},verticalIndicator:{color:a.color},plot:{radius:9,stroke:t.value.tbody.backgroundColor,strokeWidth:3}}}},null,8,["onHoverIndex","dataset","selectedIndex","config"]))],12,ne)):e.createCommentVNode("",!0)],6))),256))])],4)],32)],10,K))}},ue=J._export_sfc(re,[["__scopeId","data-v-d3c784ed"]]);exports.default=ue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-BaAW-Jni.cjs"),V=require("./useNestedProp-BY4cF5vs.cjs"),H=require("./vue-ui-sparkline-CZe9QI-o.cjs"),X=require("./BaseIcon-C6qUG3JH.cjs"),P=require("./usePrinter-BqDyevJ_.cjs"),J=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),K=["id"],Q={style:{"z-index":"1","padding-right":"24px"}},Y=["onClick"],Z={style:{display:"flex","flex-direction":"row",gap:"3px","align-items":"center"}},j=["data-cell"],ee={dir:"auto",style:{display:"flex","flex-direction":"row","align-items":"center",gap:"6px"}},te=["data-cell","onPointerenter"],le=["data-cell"],ae=["data-cell"],oe=["data-cell"],ne=["data-cell"],re={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup($,{expose:D}){const v=$;e.useCssVars(l=>({"328044aa":l.tdo}));const{vue_ui_table_sparkline:F}=u.useConfig(),y=e.ref(u.createUid()),x=e.ref(0),S=e.ref(0),t=e.computed(()=>{const l=V.useNestedProp({userConfig:v.config,defaultConfig:F});return l.theme?{...V.useNestedProp({userConfig:u.themes.vue_ui_table_sparkline[l.theme]||v.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:l}),{isPrinting:C,isImaging:z,generatePdf:I,generateImage:N}=P.usePrinter({elementId:`table_${y.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline"}),O=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),f=e.ref(null),w=e.ref(!1),W=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{u.objectIsEmpty(v.dataset)&&u.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(s=>{s.forEach(a=>{w.value=a.contentRect.width<W.value})});f.value&&l.observe(f.value)});const B=e.computed(()=>(v.dataset.forEach((l,s)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{u.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:s})})}),v.dataset.map((l,s)=>{const a=(l.values||[]).map(r=>isNaN(r)?0:r??0),n=a.reduce((r,o)=>r+o,0);return{...l,values:l.values||[],color:u.convertColorToHex(l.color)||O.value[s]||u.palette[s]||u.palette[s%u.palette.length],sum:n,average:n/a.length,median:u.calcMedian(a),sparklineDataset:a.map((r,o)=>({period:t.value.colNames[o]||`col ${o}`,value:r||0}))}})));function L(l){const a=(l[0].values||[]).map((r,o)=>l.map(i=>i.values[o]||[])).map(r=>r.map((o,i)=>[o,i]).sort((o,i)=>i[0]-o[0]).map(o=>o[1]));return l.map((r,o)=>({...r,values:r.values||[],orders:a[o]}))}const m=e.computed(()=>L(B.value)),b=e.ref(m.value),T=e.computed(()=>Math.max(...b.value.map(l=>(l.values||[]).length))),g=e.ref(void 0),k=e.ref(!1),h=e.ref(void 0),_=e.ref(-1);function M(){k.value=!1,h.value=void 0,_.value=-1,b.value=m.value}function G(l){k.value=!0,h.value=l;const s=m.value.map(o=>o.values[l]||[]),a=g.value===l?1:-1;_.value=a,l===g.value?g.value=void 0:g.value=l;const r=s.map((o,i)=>[i,o]).sort((o,i)=>a*(i[1]-o[1])).map(o=>o[0]).map(o=>m.value[o]);b.value=r,S.value+=1}const q=e.computed(()=>Math.max(...v.dataset.map(l=>(l.values||[]).length))),p=e.computed(()=>{let l=t.value.colNames;if(!l.length)for(let a=0;a<q.value;a+=1)l.push(`col ${a+1}`);t.value.showTotal&&(l=[...l,t.value.translations.total]);let s;return t.value.showAverage&&t.value.showMedian?s=[...l,t.value.translations.average,t.value.translations.median]:t.value.showAverage&&!t.value.showMedian?s=[...l,t.value.translations.average]:!t.value.showAverage&&t.value.showMedian?s=[...l,t.value.translations.median]:s=l,t.value.showSparklines?[...s,t.value.translations.chart]:s}),d=e.ref(void 0),c=e.ref(void 0);function R({dataIndex:l,serieIndex:s}){d.value=l,c.value=s}const A=e.ref(!1);function U(l){A.value=l,x.value+=1}function E(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(p.value),s=B.value.map((r,o)=>[[r.name],r.values,[r.sum],[r.average],[r.median]]),a=[l].concat(s),n=u.createCsvContent(a);u.downloadCsv({csvContent:n,title:t.value.title.text||"vue-ui-table-sparkline"})})}return D({generatePdf:I,generateImage:N,generateCsv:E,restoreOrder:M}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:f,class:e.normalizeClass({"vue-ui-responsive":w.value}),style:{overflow:"hidden"},id:`table_${y.value}`},[e.createElementVNode("div",{style:{overflow:"auto"},onPointerleave:s[0]||(s[0]=a=>{c.value=void 0,d.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[t.value.title.text?(e.openBlock(),e.createElementBlock("caption",{key:0,style:e.normalizeStyle({backgroundColor:t.value.title.backgroundColor})},[e.createElementVNode("div",{style:e.normalizeStyle({fontSize:`${t.value.title.fontSize}px`,fontWeight:t.value.title.bold?"bold":"normal",color:t.value.title.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.text),5),t.value.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({fontSize:`${t.value.title.subtitle.fontSize}px`,fontWeight:t.value.title.subtitle.bold?"bold":"normal",color:t.value.title.subtitle.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("thead",Q,[e.createElementVNode("tr",{role:"row",class:"vue-ui-data-table__thead-row",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color})},[e.createElementVNode("th",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,outline:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal"}),class:"sticky-col-first"},e.toDisplayString(t.value.translations.serie),5),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(a,n)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",style:e.normalizeStyle({background:t.value.thead.backgroundColor,outline:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal",minWidth:n===p.value.length-1?"150px":"",cursor:m.value[0].values[n]!==void 0?"pointer":"default"}),onClick:()=>G(n),class:e.normalizeClass({"sticky-col":n===p.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",Z,[e.createElementVNode("span",null,e.toDisplayString(a),1),k.value&&n===h.value&&m.value[0].values[n]!==void 0?(e.openBlock(),e.createBlock(X.default,{key:0,size:18,name:_.value===1?"sort":"sortReverse",stroke:t.value.thead.color},null,8,["name","stroke"])):e.createCommentVNode("",!0)]),t.value.userOptions.show&&n===p.value.length-1?(e.openBlock(),e.createBlock(P.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${x.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(C),isImaging:e.unref(z),uid:y.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:A.value,titles:{...t.value.userOptions.buttonTitles},chartElement:f.value,onToggleFullscreen:U,onGeneratePdf:e.unref(I),onGenerateImage:e.unref(N),onGenerateCsv:E},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:r,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:r,isFullscreen:o})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0)],14,Y))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(a,n)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,color:t.value.tbody.color}),class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":n%2===0,"vue-ui-data-table__tbody__row-odd":n%2!==0})},[e.createElementVNode("td",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.serie,class:"vue-ui-data-table__tbody__td sticky-col-first"},[e.createElementVNode("div",ee,[e.createElementVNode("span",{style:e.normalizeStyle({color:a.color})},"⬤",4),e.createElementVNode("span",null,e.toDisplayString(a.name??"-"),1)])],12,j),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(r,o)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,backgroundColor:d.value!==void 0&&c.value!==void 0&&o===d.value&&c.value===n?`${a.color}33`:"",borderRadius:d.value!==void 0&&c.value!==void 0&&o===d.value&&c.value===n?"3px":""}),"data-cell":p.value[o],class:"vue-ui-data-table__tbody__td",onPointerenter:i=>{c.value=n,d.value=o}},e.toDisplayString([null,void 0].includes(a.values[o])?"-":e.unref(u.applyDataLabel)(t.value.formatter,Number(a.values[o]),e.unref(u.dataLabel)({p:t.value.prefix,v:Number(a.values[o]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:n,datapointIndex:o})),45,te))),256)),t.value.showTotal?(e.openBlock(),e.createElementBlock("td",{key:0,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.total,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.sum,e.unref(u.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:n})),13,le)):e.createCommentVNode("",!0),t.value.showAverage?(e.openBlock(),e.createElementBlock("td",{key:1,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.average,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.average,e.unref(u.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:n})),13,ae)):e.createCommentVNode("",!0),t.value.showMedian?(e.openBlock(),e.createElementBlock("td",{key:2,dir:"auto",role:"cell",style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.median,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(u.applyDataLabel)(t.value.formatter,a.median,e.unref(u.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:n})),13,oe)):e.createCommentVNode("",!0),t.value.showSparklines?(e.openBlock(),e.createElementBlock("td",{key:3,role:"cell","data-cell":t.value.translations.chart,style:e.normalizeStyle({outline:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),class:"vue-ui-data-table__tbody__td sticky-col"},[(e.openBlock(),e.createBlock(H.default,{key:`sparkline_${n}_${S.value}`,onHoverIndex:({index:r})=>R({dataIndex:r,serieIndex:n}),dataset:a.sparklineDataset,showInfo:!1,selectedIndex:d.value,config:{type:t.value.sparkline.type,style:{backgroundColor:t.value.tbody.backgroundColor,animation:{show:t.value.sparkline.animation.show&&!e.unref(C)&&!e.unref(z),animationFrames:t.value.sparkline.animation.animationFrames},line:{color:a.color,smooth:t.value.sparkline.smooth,strokeWidth:t.value.sparkline.strokeWidth},bar:{color:a.color},area:{color:a.color,opacity:t.value.sparkline.showArea?16:0,useGradient:t.value.sparkline.useGradient},verticalIndicator:{color:a.color},plot:{radius:9,stroke:t.value.tbody.backgroundColor,strokeWidth:3}}}},null,8,["onHoverIndex","dataset","selectedIndex","config"]))],12,ne)):e.createCommentVNode("",!0)],6))),256))])],4)],32)],10,K))}},ue=J._export_sfc(re,[["__scopeId","data-v-d3c784ed"]]);exports.default=ue;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useCssVars as re, ref as d, computed as b, onMounted as ie, openBlock as u, createElementBlock as v, normalizeClass as W, createElementVNode as c, normalizeStyle as r, toDisplayString as p, createCommentVNode as g, Fragment as D, renderList as T, createBlock as M, unref as i, createSlots as de, withCtx as S, renderSlot as A, normalizeProps as ve, guardReactiveProps as ce, nextTick as fe } from "vue";
|
|
2
|
-
import { u as pe, c as me, t as be, a as ge, p as w, b as he, o as ye, e as J, g as _e, d as ke, R as xe, i as $, f as P, q as Ce, r as Ie } from "./index-
|
|
3
|
-
import { u as K } from "./useNestedProp-
|
|
4
|
-
import Se from "./vue-ui-sparkline-
|
|
5
|
-
import Ae from "./BaseIcon-
|
|
6
|
-
import { u as we, U as $e } from "./usePrinter-
|
|
2
|
+
import { u as pe, c as me, t as be, a as ge, p as w, b as he, o as ye, e as J, g as _e, d as ke, R as xe, i as $, f as P, q as Ce, r as Ie } from "./index-C0qeGgGL.js";
|
|
3
|
+
import { u as K } from "./useNestedProp-Dqm0GHPD.js";
|
|
4
|
+
import Se from "./vue-ui-sparkline-DOiZIeq7.js";
|
|
5
|
+
import Ae from "./BaseIcon-CqWidrgW.js";
|
|
6
|
+
import { u as we, U as $e } from "./usePrinter-CBPQ7BTV.js";
|
|
7
7
|
import { _ as Pe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
const ze = ["id"], Fe = { style: { "z-index": "1", "padding-right": "24px" } }, Oe = ["onClick"], Ne = { style: { display: "flex", "flex-direction": "row", gap: "3px", "align-items": "center" } }, We = ["data-cell"], De = {
|
|
9
9
|
dir: "auto",
|