vue-data-ui 2.3.74 → 2.3.75
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-CYCrAySW.js → Arrow-BTG7M25z.js} +1 -1
- package/dist/{Arrow-DK6F5Fq3.cjs → Arrow-CZK77NmC.cjs} +1 -1
- package/dist/{BaseIcon-DBHVtm3A.cjs → BaseIcon--PMhZ3f-.cjs} +1 -1
- package/dist/{BaseIcon-kBIAYqUO.js → BaseIcon-BAOfPaXs.js} +1 -1
- package/dist/{DataTable-CKdV-L0e.js → DataTable-CQANRZju.js} +2 -2
- package/dist/{DataTable-BNFSPjhv.cjs → DataTable-DjQzrklZ.cjs} +1 -1
- package/dist/{Legend-Do2kcWFT.cjs → Legend-CtbPB0Bo.cjs} +1 -1
- package/dist/{Legend-Cj7T-DqJ.js → Legend-DX1kv21U.js} +1 -1
- package/dist/{Shape-DRDUAe_o.cjs → Shape-CadGs1Am.cjs} +1 -1
- package/dist/{Shape-Bo8ZjViG.js → Shape-kqcyauhC.js} +1 -1
- package/dist/{Slicer-D8jHSP7U.cjs → Slicer-i_oECHxH.cjs} +1 -1
- package/dist/{Slicer-4nGKvUYF.js → Slicer-yaJs-izT.js} +2 -2
- package/dist/{Title-DZjnxQdN.js → Title-C26I_HC3.js} +1 -1
- package/dist/{Title-D5cATWsL.cjs → Title-XBiDFYKD.cjs} +1 -1
- package/dist/{Tooltip--kgFEVZs.js → Tooltip-CH8GmDCG.js} +1 -1
- package/dist/{Tooltip-B8yLaegk.cjs → Tooltip-DxtWkIt5.cjs} +1 -1
- package/dist/{index-C8SH0f2u.js → index-Cm4Iry5c.js} +1 -1
- package/dist/{index-D_32ZGWd.cjs → index-DYUBiaGS.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-lS_T5lM3.js → useNestedProp-CurQIHTa.js} +1 -1
- package/dist/{useNestedProp-BvvH633N.cjs → useNestedProp-w7AMWWmz.cjs} +1 -1
- package/dist/{usePrinter-Dj50NAxo.js → usePrinter-B8RnF8_q.js} +1 -1
- package/dist/{usePrinter-BouFNHWR.cjs → usePrinter-ZlHxdaEz.cjs} +1 -1
- package/dist/{vue-data-ui-v_BbbLtJ.cjs → vue-data-ui-B7amrpT-.cjs} +1 -1
- package/dist/{vue-data-ui-DoXqU7xC.js → vue-data-ui-Bj6kEIpq.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-BAz41kL7.cjs +19 -0
- package/dist/{vue-ui-3d-bar-CnoPOJHm.js → vue-ui-3d-bar-Bg9IgVVc.js} +499 -486
- package/dist/{vue-ui-accordion-Cka6b_Up.cjs → vue-ui-accordion-1WxrfiCH.cjs} +1 -1
- package/dist/{vue-ui-accordion-YHleIgkV.js → vue-ui-accordion-Cb6XBCbu.js} +3 -3
- package/dist/{vue-ui-age-pyramid-CENg8fDg.js → vue-ui-age-pyramid-BhwmnQru.js} +182 -169
- package/dist/vue-ui-age-pyramid-CHNvRXx8.cjs +1 -0
- package/dist/{vue-ui-annotator-ByYg6QMs.cjs → vue-ui-annotator-B22cdlhA.cjs} +1 -1
- package/dist/{vue-ui-annotator-VJOLUkqJ.js → vue-ui-annotator-BiHQvMdW.js} +1 -1
- package/dist/{vue-ui-candlestick-CHsGD3bx.js → vue-ui-candlestick-Cl9dyh4l.js} +295 -279
- package/dist/vue-ui-candlestick-D7DjdYyw.cjs +2 -0
- package/dist/vue-ui-carousel-table-Do5cYRqN.cjs +1 -0
- package/dist/{vue-ui-carousel-table-RAtX3VBu.js → vue-ui-carousel-table-QsONwqNz.js} +106 -91
- package/dist/vue-ui-chestnut-CyE8MafY.cjs +6 -0
- package/dist/{vue-ui-chestnut-B5GQX0J_.js → vue-ui-chestnut-Drb01WMC.js} +215 -204
- package/dist/{vue-ui-cursor-CMm7XSSG.js → vue-ui-cursor-BP04_XbB.js} +2 -2
- package/dist/{vue-ui-cursor-DnZqLj21.cjs → vue-ui-cursor-DZeTQBKz.cjs} +1 -1
- package/dist/{vue-ui-dashboard-Ck_5L3eu.js → vue-ui-dashboard-BWdx5gjZ.js} +2 -2
- package/dist/{vue-ui-dashboard-DgEQJnLr.cjs → vue-ui-dashboard-Z63RE1XS.cjs} +1 -1
- package/dist/{vue-ui-digits-UvwUdi6U.cjs → vue-ui-digits-CBQaHW6a.cjs} +1 -1
- package/dist/{vue-ui-digits--ULH35um.js → vue-ui-digits-DUhkLcmd.js} +2 -2
- package/dist/vue-ui-donut-D2YJYgOB.cjs +1 -0
- package/dist/{vue-ui-donut-QQ1fWWvc.js → vue-ui-donut-DRPSwmGr.js} +376 -362
- package/dist/{vue-ui-donut-evolution-Cx8kBB_7.js → vue-ui-donut-evolution-gRXAyxq8.js} +270 -255
- package/dist/vue-ui-donut-evolution-jAMVgNHQ.cjs +1 -0
- package/dist/{vue-ui-dumbbell-BYvwHpU8.js → vue-ui-dumbbell-CQo5jqSK.js} +232 -213
- package/dist/vue-ui-dumbbell-DLfZcrXq.cjs +9 -0
- package/dist/vue-ui-flow-BQ3UbMUb.js +481 -0
- package/dist/vue-ui-flow-BlX2-eEC.cjs +1 -0
- package/dist/{vue-ui-galaxy-B0L57aec.js → vue-ui-galaxy-BHWugUKG.js} +175 -162
- package/dist/vue-ui-galaxy-Cax5o6Yl.cjs +1 -0
- package/dist/vue-ui-gauge-DG6_kvKh.js +500 -0
- package/dist/vue-ui-gauge-DpGcv_00.cjs +1 -0
- package/dist/vue-ui-gizmo-D9Vh9Rmr.cjs +1 -0
- package/dist/{vue-ui-gizmo-D2RfM55X.js → vue-ui-gizmo-bV148qAf.js} +66 -53
- package/dist/{vue-ui-heatmap-DKM0DH41.js → vue-ui-heatmap-BZZUvnMa.js} +157 -143
- package/dist/vue-ui-heatmap-B_ELXKKV.cjs +1 -0
- package/dist/vue-ui-kpi-C5v7qQvZ.js +98 -0
- package/dist/vue-ui-kpi-CwVAvTB2.cjs +1 -0
- package/dist/{vue-ui-mini-loader-MywnWlYI.js → vue-ui-mini-loader-BdKizX_J.js} +2 -2
- package/dist/{vue-ui-mini-loader-CLP19Txv.cjs → vue-ui-mini-loader-DZNY-3rr.cjs} +1 -1
- package/dist/{vue-ui-molecule-CLI9iTRE.js → vue-ui-molecule-MKyrhqqm.js} +177 -167
- package/dist/vue-ui-molecule-bva6OvPc.cjs +1 -0
- package/dist/{vue-ui-mood-radar-O30wZo9a.js → vue-ui-mood-radar-BNIFFvq0.js} +172 -161
- package/dist/vue-ui-mood-radar-CzQOAyNI.cjs +1 -0
- package/dist/{vue-ui-nested-donuts-D8o4TqTt.js → vue-ui-nested-donuts-BDAlZrMF.js} +377 -364
- package/dist/vue-ui-nested-donuts-CxdZC6JF.cjs +17 -0
- package/dist/{vue-ui-onion-Hmcke6xB.js → vue-ui-onion-CFa4VD-w.js} +191 -177
- package/dist/vue-ui-onion-Df7YcsVR.cjs +5 -0
- package/dist/vue-ui-parallel-coordinate-plot-D7Q2zfcR.cjs +8 -0
- package/dist/{vue-ui-parallel-coordinate-plot-CyChE3NP.js → vue-ui-parallel-coordinate-plot-DmqYXT-U.js} +298 -284
- package/dist/{vue-ui-quadrant-DimTQdAj.js → vue-ui-quadrant-D5jHkq9g.js} +347 -334
- package/dist/vue-ui-quadrant-ZqhcVYf5.cjs +1 -0
- package/dist/{vue-ui-quick-chart-DxJvENid.js → vue-ui-quick-chart-BjXXSx7V.js} +483 -469
- package/dist/vue-ui-quick-chart-Dt9AsEU6.cjs +15 -0
- package/dist/vue-ui-radar-2EuZr7i2.cjs +1 -0
- package/dist/{vue-ui-radar-D_FieunT.js → vue-ui-radar-CW8EKW4o.js} +202 -189
- package/dist/{vue-ui-rating-BHW2Onru.cjs → vue-ui-rating-DrtLvVA0.cjs} +1 -1
- package/dist/{vue-ui-rating-DF1BpH4E.js → vue-ui-rating-eSWsmJUU.js} +2 -2
- package/dist/vue-ui-relation-circle-C60OTe88.cjs +1 -0
- package/dist/vue-ui-relation-circle-DiUCpEqa.js +322 -0
- package/dist/{vue-ui-rings-BqS-iece.js → vue-ui-rings-BxhLbyG0.js} +203 -189
- package/dist/vue-ui-rings-CHq-a5ZS.cjs +2 -0
- package/dist/{vue-ui-scatter-Dns49Nht.js → vue-ui-scatter-DQchX_mM.js} +284 -270
- package/dist/vue-ui-scatter-DZUZUbnk.cjs +1 -0
- package/dist/{vue-ui-screenshot-5Gsnd0Wr.js → vue-ui-screenshot-CLa9vMzM.js} +1 -1
- package/dist/{vue-ui-screenshot---q062Kd.cjs → vue-ui-screenshot-SLSIpqx2.cjs} +1 -1
- package/dist/{vue-ui-skeleton-B4eWLjH3.js → vue-ui-skeleton-C1oUnz7R.js} +2 -2
- package/dist/{vue-ui-skeleton-fVPw-oIR.cjs → vue-ui-skeleton-ClpTCY1x.cjs} +1 -1
- package/dist/{vue-ui-smiley-B8Tyunn3.js → vue-ui-smiley-CmWHSt1S.js} +2 -2
- package/dist/{vue-ui-smiley-YfHmv0rQ.cjs → vue-ui-smiley-Daw8fPDy.cjs} +1 -1
- package/dist/vue-ui-spark-trend-CO69Dg31.js +263 -0
- package/dist/vue-ui-spark-trend-DmDlv8ie.cjs +1 -0
- package/dist/{vue-ui-sparkbar-9DBvdYn7.js → vue-ui-sparkbar-BRlqpe4e.js} +95 -87
- package/dist/vue-ui-sparkbar-BUGdi0BY.cjs +1 -0
- package/dist/vue-ui-sparkgauge-CCxKzDjT.cjs +1 -0
- package/dist/vue-ui-sparkgauge-CbuFESsM.js +178 -0
- package/dist/{vue-ui-sparkhistogram-BBUVmco4.js → vue-ui-sparkhistogram-B4-hrDHz.js} +79 -68
- package/dist/vue-ui-sparkhistogram-XtqX10_t.cjs +1 -0
- package/dist/vue-ui-sparkline-BZTEi9YC.cjs +1 -0
- package/dist/{vue-ui-sparkline-CeqNV6Re.js → vue-ui-sparkline-DlXNmG6M.js} +142 -123
- package/dist/vue-ui-sparkstackbar-CDmZeXnq.cjs +1 -0
- package/dist/{vue-ui-sparkstackbar-C3GMC1eW.js → vue-ui-sparkstackbar-J1YowQmP.js} +120 -104
- package/dist/{vue-ui-stackbar-DyGPrFxi.js → vue-ui-stackbar-CKIDqkkY.js} +235 -222
- package/dist/vue-ui-stackbar-CXGWukoJ.cjs +6 -0
- package/dist/vue-ui-strip-plot-CvmoRcYN.cjs +1 -0
- package/dist/{vue-ui-strip-plot-y1AnVJmq.js → vue-ui-strip-plot-JVLwIy0j.js} +246 -232
- package/dist/{vue-ui-table-B4kfykAO.js → vue-ui-table-BSi_cHh7.js} +1 -1
- package/dist/{vue-ui-table-xWvAQS-s.cjs → vue-ui-table-Dqi64VE7.cjs} +1 -1
- package/dist/vue-ui-table-heatmap-BwghEh5t.cjs +1 -0
- package/dist/{vue-ui-table-heatmap-YZRSzwRM.js → vue-ui-table-heatmap-CfvW3rcm.js} +106 -95
- package/dist/{vue-ui-table-sparkline-C0v2r4Kf.js → vue-ui-table-sparkline-Y6Lrrzxy.js} +151 -138
- package/dist/vue-ui-table-sparkline-bIy3kkHB.cjs +1 -0
- package/dist/{vue-ui-thermometer-D5qurIy7.js → vue-ui-thermometer-BPTs7Nxc.js} +116 -104
- package/dist/vue-ui-thermometer-DDtxYr7w.cjs +1 -0
- package/dist/{vue-ui-timer-VWjovnKL.js → vue-ui-timer-CkB7eZaE.js} +191 -176
- package/dist/vue-ui-timer-DRSSYxOX.cjs +64 -0
- package/dist/{vue-ui-tiremarks-jH6cdQOJ.js → vue-ui-tiremarks-BbOaoY8S.js} +115 -103
- package/dist/vue-ui-tiremarks-Bttwg3-p.cjs +1 -0
- package/dist/vue-ui-treemap-Chq0WQPe.cjs +1 -0
- package/dist/{vue-ui-treemap-BCc5sQLB.js → vue-ui-treemap-CoaK3wBl.js} +251 -237
- package/dist/{vue-ui-vertical-bar-2In_g5iC.js → vue-ui-vertical-bar-BA43_uHV.js} +314 -299
- package/dist/vue-ui-vertical-bar-BLIUt-HT.cjs +4 -0
- package/dist/{vue-ui-waffle-OzU830VX.js → vue-ui-waffle-BoEf8CcG.js} +285 -265
- package/dist/vue-ui-waffle-NBjY0mko.cjs +1 -0
- package/dist/vue-ui-wheel-Bgo2jpj0.js +255 -0
- package/dist/vue-ui-wheel-t5bI4a-P.cjs +1 -0
- package/dist/vue-ui-word-cloud-DPW_-Hzz.cjs +1 -0
- package/dist/vue-ui-word-cloud-Jd9_JUyi.js +512 -0
- package/dist/{vue-ui-xy-DuJtYXKl.js → vue-ui-xy-BMBYAC4z.js} +300 -274
- package/dist/vue-ui-xy-CBHEBcZK.cjs +3 -0
- package/dist/vue-ui-xy-canvas-D5FqRF4p.cjs +9 -0
- package/dist/{vue-ui-xy-canvas-CKibMJHh.js → vue-ui-xy-canvas-LOsQ_DM-.js} +345 -327
- package/package.json +1 -1
- package/dist/vue-ui-3d-bar-CwCEoPX-.cjs +0 -19
- package/dist/vue-ui-age-pyramid-GqCNpd_h.cjs +0 -1
- package/dist/vue-ui-candlestick-TdNVq_FX.cjs +0 -2
- package/dist/vue-ui-carousel-table-yXUSFk2u.cjs +0 -1
- package/dist/vue-ui-chestnut-EJj-dQSY.cjs +0 -6
- package/dist/vue-ui-donut-BqUBysA_.cjs +0 -1
- package/dist/vue-ui-donut-evolution-BXtEnop4.cjs +0 -1
- package/dist/vue-ui-dumbbell-CjIh7KTm.cjs +0 -9
- package/dist/vue-ui-flow-hp0Hpuhn.js +0 -469
- package/dist/vue-ui-flow-u29zqSQj.cjs +0 -1
- package/dist/vue-ui-galaxy-DE1HbBi-.cjs +0 -1
- package/dist/vue-ui-gauge-B_IZrsfj.cjs +0 -1
- package/dist/vue-ui-gauge-CPyyn7cL.js +0 -488
- package/dist/vue-ui-gizmo-DR4gacOL.cjs +0 -1
- package/dist/vue-ui-heatmap-DMB_eUpA.cjs +0 -1
- package/dist/vue-ui-kpi-BAxAY13T.js +0 -84
- package/dist/vue-ui-kpi-BD21xshi.cjs +0 -1
- package/dist/vue-ui-molecule-BNsWckH-.cjs +0 -1
- package/dist/vue-ui-mood-radar-BsWE1f8R.cjs +0 -1
- package/dist/vue-ui-nested-donuts-CYyUtXs2.cjs +0 -17
- package/dist/vue-ui-onion-D7TXJu5w.cjs +0 -5
- package/dist/vue-ui-parallel-coordinate-plot-BqZB7xKn.cjs +0 -8
- package/dist/vue-ui-quadrant-BPDTvxlT.cjs +0 -1
- package/dist/vue-ui-quick-chart-C_-ut0if.cjs +0 -15
- package/dist/vue-ui-radar-C5Kq19hg.cjs +0 -1
- package/dist/vue-ui-relation-circle-4kIYttRI.js +0 -310
- package/dist/vue-ui-relation-circle-DHMHHsqY.cjs +0 -1
- package/dist/vue-ui-rings-BqPS8NKl.cjs +0 -2
- package/dist/vue-ui-scatter-BLVcdf3d.cjs +0 -1
- package/dist/vue-ui-spark-trend-Dpv6am0Z.cjs +0 -1
- package/dist/vue-ui-spark-trend-Em9OqYyG.js +0 -251
- package/dist/vue-ui-sparkbar-BuSuwQYl.cjs +0 -1
- package/dist/vue-ui-sparkgauge-BN5feBzp.js +0 -167
- package/dist/vue-ui-sparkgauge-DKtUZMv1.cjs +0 -1
- package/dist/vue-ui-sparkhistogram-BmuusW02.cjs +0 -1
- package/dist/vue-ui-sparkline-Blzv-tIQ.cjs +0 -1
- package/dist/vue-ui-sparkstackbar-D__WDEMv.cjs +0 -1
- package/dist/vue-ui-stackbar-DFqJ5K_q.cjs +0 -6
- package/dist/vue-ui-strip-plot-z9fjJ6Dj.cjs +0 -1
- package/dist/vue-ui-table-heatmap-CGKecjtm.cjs +0 -1
- package/dist/vue-ui-table-sparkline-CHFZG3Tg.cjs +0 -1
- package/dist/vue-ui-thermometer-DoOxxVW1.cjs +0 -1
- package/dist/vue-ui-timer-D63zHe-I.cjs +0 -64
- package/dist/vue-ui-tiremarks-Cp8YEmXh.cjs +0 -1
- package/dist/vue-ui-treemap-DJrdEFW5.cjs +0 -1
- package/dist/vue-ui-vertical-bar-BfJJqN_z.cjs +0 -4
- package/dist/vue-ui-waffle-A2gmRbq0.cjs +0 -1
- package/dist/vue-ui-wheel-C9QXzWu1.js +0 -242
- package/dist/vue-ui-wheel-DGSh9VKq.cjs +0 -1
- package/dist/vue-ui-word-cloud-C2ZaVlfO.js +0 -498
- package/dist/vue-ui-word-cloud-DPFB1MYk.cjs +0 -1
- package/dist/vue-ui-xy-C-2-aijE.cjs +0 -3
- package/dist/vue-ui-xy-canvas-D7wf3xab.cjs +0 -9
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-DYUBiaGS.cjs"),R=require("./useResponsive-B3TrDDIG.cjs"),le=require("./Title-XBiDFYKD.cjs"),W=require("./usePrinter-ZlHxdaEz.cjs"),ae=require("./DataTable-DjQzrklZ.cjs"),oe=require("./vue-ui-skeleton-ClpTCY1x.cjs"),re=require("./Legend-CtbPB0Bo.cjs"),se=require("./vue-ui-accordion-1WxrfiCH.cjs"),U=require("./useNestedProp-w7AMWWmz.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ue=["id"],ce=["xmlns","viewBox"],ie={key:0},de=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ve={key:1},he=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],ye=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],me={key:2},fe=["x","y","font-size","fill","font-weight"],be=["x","y","font-size","fill"],ge={key:3},pe=["x","y","font-size","fill","font-weight"],ke=["id"],_e=["stop-color"],xe=["stop-color"],Ce=["stop-color"],we=["id"],Be=["stop-color"],Ne=["stop-color"],Ee=["stop-color"],Le=["id"],$e=["stop-color"],Se=["stop-color"],Ve=["id"],ze=["stop-color"],Xe=["stop-color"],Ae={key:0},Pe=["d","fill"],Te={key:1},De=["x","y","height","width","fill"],Fe=["cx","cy","r","fill","stroke","stroke-width"],Me=["cx","cy","r","fill","stroke","stroke-width"],Ge={key:2},Ie=["x","y","fill","font-size"],He={key:3},Oe=["x","y","fill","font-size"],qe={key:3,class:"vue-data-ui-watermark"},Re=["xmlns","height","width"],We=["fill"],Ue=["innerHTML"],je={__name:"vue-ui-dumbbell",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(j,{expose:Y,emit:Ze}){const y=j,{vue_ui_dumbbell:Z}=s.useConfig(),b=e.computed({get(){return!!y.dataset&&y.dataset.length},set(a){return a}}),d=e.ref(s.createUid()),L=e.ref(0),k=e.ref(null),$=e.ref(null),S=e.ref(null),V=e.ref(0),z=e.ref(0),X=e.ref(0),t=e.computed({get:()=>A(),set:a=>a});function A(){const a=U.useNestedProp({userConfig:y.config,defaultConfig:Z});return a.theme?{...U.useNestedProp({userConfig:s.themes.vue_ui_dumbbell[a.theme]||y.config,defaultConfig:a})}:a}e.watch(()=>y.config,a=>{t.value=A(),P(),V.value+=1,z.value+=1,X.value+=1,i.value=t.value.style.chart.rowHeight,g.value=t.value.style.chart.width},{deep:!0}),e.watch(()=>y.dataset,a=>{I()},{deep:!0});const _=e.ref(null);e.onMounted(()=>{P()});function P(){if(s.objectIsEmpty(y.dataset)?s.error({componentName:"VueUiDumbbell",type:"dataset"}):y.dataset.forEach((a,n)=>{s.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","start","end"]}).forEach(l=>{b.value=!1,s.error({componentName:"VueUiDumbbell",type:"datasetSerieAttribute",property:l,index:n})})}),t.value.responsive){const a=R.throttle(()=>{const{width:n,height:l}=R.useResponsive({chart:k.value,title:t.value.style.chart.title.text?$.value:null,legend:t.value.style.chart.legend.show?S.value:null});g.value=n,i.value=l/y.dataset.length,v.value=C()});_.value=new ResizeObserver(a),_.value.observe(k.value.parentNode)}}e.onBeforeUnmount(()=>{_.value&&_.value.disconnect()});const{isPrinting:T,isImaging:D,generatePdf:F,generateImage:M}=W.usePrinter({elementId:`dumbbell_${d.value}`,fileName:t.value.style.chart.title.text||"vue-ui-dumbbell"}),x=e.ref({showTable:t.value.table.show}),m=e.computed(()=>y.dataset.map((a,n)=>({...a,start:s.checkNaN(a.start),end:s.checkNaN(a.end),id:s.createUid()}))),N=e.computed(()=>({max:Math.max(...m.value.flatMap(a=>[a.start,a.end])),min:Math.min(...m.value.flatMap(a=>[a.start,a.end]))})),c=e.computed(()=>s.calculateNiceScale(N.value.min<0?N.value.min:0,N.value.max,t.value.style.chart.grid.scaleSteps)),i=e.ref(t.value.style.chart.rowHeight),g=e.ref(t.value.style.chart.width),o=e.computed(()=>{const a=i.value,n=t.value.style.chart.padding.left+t.value.style.chart.padding.right+g.value,l=t.value.style.chart.padding.top+t.value.style.chart.padding.bottom+a*y.dataset.length,r=c.value.ticks.length*(g.value/c.value.ticks.length);return{left:t.value.style.chart.padding.left,right:n-t.value.style.chart.padding.right,top:t.value.style.chart.padding.top,bottom:l-t.value.style.chart.padding.bottom,width:g.value,height:a*y.dataset.length,rowHeight:a,absoluteHeight:l,absoluteWidth:n,widthPlotReference:r}});function C(){return m.value.map((a,n)=>{const l=o.value.left+(a.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,r=o.value.left+(a.end+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,u=l+(r-l)/2;return{...a,startX:l,endX:r,centerX:u,y:o.value.top+n*i.value+i.value/2,endVal:a.start}})}const v=e.ref([]),G=e.ref(null),J=e.computed(()=>m.value.map(a=>a.end).reduce((a,n)=>a+n,0));e.onMounted(()=>{I()});function I(){v.value=C();let a=v.value.map(l=>l.start).reduce((l,r)=>l+r,0);function n(){const l=m.value.map(r=>r.end-r.start);a>=J.value?(cancelAnimationFrame(G.value),v.value=C()):(v.value=v.value.map((r,u)=>{r.endVal+=l[u]*(t.value.animationSpeed/100);const h=o.value.left+(r.start+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,B=o.value.left+(r.endVal+Math.abs(c.value.min))/(c.value.max+Math.abs(c.value.min))*o.value.widthPlotReference,E=h+(B-h)/2;return{...r,startX:h,endX:B,centerX:E,y:o.value.top+u*i.value+i.value/2,endVal:r.endVal}}),a=v.value.map(r=>r.endVal).reduce((r,u)=>r+u,0),G.value=requestAnimationFrame(n))}t.value.useAnimation?n():v.value=C()}const H=e.computed(()=>[{name:t.value.style.chart.legend.labelStart,color:t.value.style.chart.plots.gradient.show?`url(#start_grad_${d.value})`:t.value.style.chart.plots.startColor},{name:t.value.style.chart.legend.labelEnd,color:t.value.style.chart.plots.gradient.show?`url(#end_grad_${d.value})`:t.value.style.chart.plots.endColor}]),K=e.computed(()=>({cy:"donut-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,paddingTop:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),f=e.computed(()=>{const a=v.value.map(l=>({name:l.name})),n=v.value.map(l=>({start:l.start,end:l.end}));return{head:a,body:n}}),w=e.computed(()=>{const a=[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],n=f.value.head.map((u,h)=>{const B=s.dataLabel({p:t.value.style.chart.labels.prefix,v:f.value.body[h].start,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),E=s.dataLabel({p:t.value.style.chart.labels.prefix,v:f.value.body[h].end,s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue}),te=s.dataLabel({v:100*(f.value.body[h].end/f.value.body[h].start-1),s:"%",r:t.value.table.td.roundingPercentage});return[{name:u.name},B,E,te]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.start,t.value.table.columnNames.end,t.value.table.columnNames.progression],head:a,body:n,config:l}});function O(){e.nextTick(()=>{const a=f.value.head.map((r,u)=>[[r.name],[f.value.body[u].start],[f.value.body[u].end]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.start],[t.value.table.columnNames.end]]].concat(a),l=s.createCsvContent(n);s.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-dumbbell"})})}const p=e.ref(!1);function Q(a){p.value=a,L.value+=1}function ee(){return v.value}function q(){x.value.showTable=!x.value.showTable}return Y({getData:ee,generatePdf:F,generateCsv:O,generateImage:M,toggleTable:q}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dumbbellChart",ref:k,class:e.normalizeClass(`vue-ui-dumbbell ${p.value?"vue-data-ui-wrapper-fullscreen":""}`),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:`dumbbell_${d.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:$,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[(e.openBlock(),e.createBlock(le._sfc_main,{key:`title_${V.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&b.value?(e.openBlock(),e.createBlock(W.UserOptions,{ref:"details",key:`user_option_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(T),isImaging:e.unref(D),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:p.value,titles:{...t.value.userOptions.buttonTitles},chartElement:k.value,onToggleFullscreen:Q,onGeneratePdf:e.unref(F),onGenerateCsv:O,onGenerateImage:e.unref(M),onToggleTable:q},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":p.value,"vue-data-ui-fulscreen--off":!p.value}),viewBox:`0 0 ${o.value.absoluteWidth<=0?10:o.value.absoluteWidth} ${o.value.absoluteHeight<=0?10:o.value.absoluteHeight}`,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.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left+r*o.value.width/(c.value.ticks.length-1),x2:o.value.left+r*o.value.width/(c.value.ticks.length-1),y1:o.value.top,y2:o.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},null,8,de))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:o.value.left,x2:o.value.right,y1:o.value.top+r*i.value,y2:o.value.top+r*i.value,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},null,8,he))),256)),e.createElementVNode("line",{x1:o.value.left,x2:o.value.right,y1:o.value.bottom,y2:o.value.bottom,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},null,8,ye)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(),e.createElementBlock("g",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*i.value+(t.value.style.chart.labels.yAxisLabels.showProgression?i.value/3:i.value/2)+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"font-weight":t.value.style.chart.labels.yAxisLabels.bold?"bold":"normal","text-anchor":"end"},e.toDisplayString(l.name),9,fe))),256)),t.value.style.chart.labels.yAxisLabels.showProgression?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left-6+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.value.top+r*i.value+i.value/1.3+t.value.style.chart.labels.yAxisLabels.fontSize/3,"font-size":t.value.style.chart.labels.yAxisLabels.fontSize,fill:t.value.style.chart.labels.yAxisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(s.dataLabel)({v:100*(l.end/l.start-1),s:"%",r:t.value.style.chart.labels.yAxisLabels.rounding})),9,be))),256)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(),e.createElementBlock("g",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value.ticks,(l,r)=>(e.openBlock(),e.createElementBlock("text",{x:o.value.left+r*(o.value.width/(c.value.ticks.length-1)),y:o.value.bottom+t.value.style.chart.labels.xAxisLabels.fontSize+t.value.style.chart.labels.xAxisLabels.offsetY,"font-size":t.value.style.chart.labels.xAxisLabels.fontSize,fill:t.value.style.chart.labels.xAxisLabels.color,"font-weight":t.value.style.chart.labels.xAxisLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.labels.formatter,l,e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:l,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.xAxisLabels.rounding}),{datapoint:l,seriesIndex:r})),9,pe))),256))])):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:`start_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.startColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,_e),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.startColor,.1)},null,8,xe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Ce)],8,ke),e.createElementVNode("radialGradient",{id:`end_grad_${d.value}`,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(s.lightenHexColor)(t.value.style.chart.plots.endColor,t.value.style.chart.plots.gradient.intensity/100)},null,8,Be),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(s.darkenHexColor)(t.value.style.chart.plots.endColor,.1)},null,8,Ne),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Ee)],8,we)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`grad_positive_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.startColor},null,8,$e),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.endColor},null,8,Se)],8,Le),e.createElementVNode("linearGradient",{id:`grad_negative_${d.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.chart.plots.endColor},null,8,ze),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.chart.plots.startColor},null,8,Xe)],8,Ve)]),t.value.style.chart.plots.link.type==="curved"?(e.openBlock(),e.createElementBlock("g",Ae,[e.createElementVNode("path",{d:`M
|
|
2
|
+
${l.startX},${l.y+t.value.style.chart.plots.radius/2}
|
|
3
|
+
C ${l.centerX},${l.y} ${l.centerX},${l.y}
|
|
4
|
+
${l.endX},${l.y+t.value.style.chart.plots.radius/2}
|
|
5
|
+
L ${l.endX},${l.y-t.value.style.chart.plots.radius/2}
|
|
6
|
+
C ${l.centerX},${l.y} ${l.centerX},${l.y}
|
|
7
|
+
${l.startX},${l.y-t.value.style.chart.plots.radius/2}
|
|
8
|
+
Z
|
|
9
|
+
`,fill:l.endX>l.startX?`url(#grad_positive_${d.value})`:`url(#grad_negative_${d.value})`},null,8,Pe)])):(e.openBlock(),e.createElementBlock("g",Te,[e.createElementVNode("rect",{x:l.endX>l.startX?l.startX:l.endX,y:l.y-t.value.style.chart.plots.link.strokeWidth/2,height:t.value.style.chart.plots.link.strokeWidth,width:Math.abs(l.endX-l.startX),fill:l.endX>l.startX?`url(#grad_positive_${d.value})`:`url(#grad_negative_${d.value})`},null,8,De)])),e.createElementVNode("circle",{cx:l.startX,cy:l.y,r:t.value.style.chart.plots.radius,fill:t.value.style.chart.plots.gradient.show?`url(#start_grad_${d.value})`:t.value.style.chart.plots.startColor,stroke:t.value.style.chart.plots.stroke,"stroke-width":t.value.style.chart.plots.strokeWidth},null,8,Fe),e.createElementVNode("circle",{cx:l.endX,cy:l.y,r:t.value.style.chart.plots.radius,fill:t.value.style.chart.plots.gradient.show?`url(#end_grad_${d.value})`:t.value.style.chart.plots.endColor,stroke:t.value.style.chart.plots.stroke,"stroke-width":t.value.style.chart.plots.strokeWidth},null,8,Me),t.value.style.chart.labels.startLabels.show?(e.openBlock(),e.createElementBlock("g",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(u,h)=>(e.openBlock(),e.createElementBlock("text",{x:u.startX,y:o.value.top+(h+1)*i.value-t.value.style.chart.labels.startLabels.fontSize/3+t.value.style.chart.labels.startLabels.offsetY,fill:t.value.style.chart.labels.startLabels.useStartColor?t.value.style.chart.plots.startColor:t.value.style.chart.labels.startLabels.color,"font-size":t.value.style.chart.labels.startLabels.fontSize,"text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.labels.formatter,u.start,e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:u.start,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.startLabels.rounding}),{datapoint:u,seriesIndex:h})),9,Ie))),256))])):e.createCommentVNode("",!0),t.value.style.chart.labels.endLabels.show?(e.openBlock(),e.createElementBlock("g",He,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(u,h)=>(e.openBlock(),e.createElementBlock("text",{x:u.endX,y:o.value.top+h*i.value+t.value.style.chart.labels.endLabels.fontSize+t.value.style.chart.labels.endLabels.offsetY,fill:t.value.style.chart.labels.endLabels.useEndColor?t.value.style.chart.plots.endColor:t.value.style.chart.labels.endLabels.color,"font-size":t.value.style.chart.labels.endLabels.fontSize,"text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.chart.labels.formatter,u.end,e.unref(s.dataLabel)({p:t.value.style.chart.labels.prefix,v:u.end,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.endLabels.rounding}),{datapoint:u,seriesIndex:h})),9,Oe))),256))])):e.createCommentVNode("",!0)]))),256)),e.renderSlot(a.$slots,"svg",{svg:o.value},void 0,!0)],14,ce)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",qe,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(T)||e.unref(D)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(oe.default,{key:4,config:{type:"dumbbell",style:{backgroundColor:t.value.style.chart.backgroundColor,dumbbell:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:S},[t.value.style.chart.legend.show&&b.value?(e.openBlock(),e.createBlock(re.Legend,{key:`legend_${X.value}`,legendSet:H.value,config:K.value},{item:e.withCtx(({legend:l})=>[e.createElementVNode("div",{style:e.normalizeStyle(`display:flex;align-items:center;gap:4px;font-size:${t.value.style.chart.legend.fontSize}px`)},[(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(s.XMLNS),viewBox:"0 0 20 20",height:t.value.style.chart.legend.fontSize,width:t.value.style.chart.legend.fontSize},[e.createElementVNode("circle",{cx:10,cy:10,r:9,fill:l.color},null,8,We)],8,Re)),e.createTextVNode(" "+e.toDisplayString(l.name),1)],4)]),_:1},8,["legendSet","config"])):e.renderSlot(a.$slots,"legend",{key:1,legend:H.value},void 0,!0)],512),b.value?(e.openBlock(),e.createBlock(se.default,{key:5,hideDetails:"",config:{open:x.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(ae.DataTable,{key:`table_${z.value}`,colNames:w.value.colNames,head:w.value.head,body:w.value.body,config:w.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:n[0]||(n[0]=l=>x.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Ue)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ue))}},Ye=ne._export_sfc(je,[["__scopeId","data-v-29e2319d"]]);exports.default=Ye;
|
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
import { computed as m, onMounted as He, ref as y, watch as Le, openBlock as r, createElementBlock as h, normalizeClass as ce, normalizeStyle as C, createBlock as O, createCommentVNode as T, unref as i, createSlots as Ee, withCtx as k, renderSlot as x, normalizeProps as de, guardReactiveProps as ve, createElementVNode as S, Fragment as P, renderList as F, toDisplayString as U, createVNode as Oe, createTextVNode as Se, nextTick as Me } from "vue";
|
|
2
|
+
import { u as ze, o as Ye, e as De, c as fe, t as Ge, a as Be, p as V, b as Ae, s as v, f as he, X as Ue, E as me, H as Ve, i as je, q as Xe, r as We } from "./index-Cm4Iry5c.js";
|
|
3
|
+
import { _ as qe } from "./Title-C26I_HC3.js";
|
|
4
|
+
import { u as Re, U as Ze } from "./usePrinter-B8RnF8_q.js";
|
|
5
|
+
import { D as Je } from "./DataTable-CQANRZju.js";
|
|
6
|
+
import Ke from "./vue-ui-accordion-Cb6XBCbu.js";
|
|
7
|
+
import Qe from "./vue-ui-skeleton-C1oUnz7R.js";
|
|
8
|
+
import { u as ge } from "./useNestedProp-CurQIHTa.js";
|
|
9
|
+
import { _ as et } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
|
+
const tt = ["id"], lt = ["xmlns", "viewBox"], ot = ["id"], at = ["stop-color"], nt = ["stop-color"], st = ["d", "fill", "stroke", "stroke-width"], ut = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "onMouseenter"], rt = ["x", "y", "font-size", "fill"], it = ["x", "y", "font-size", "fill"], ct = {
|
|
11
|
+
key: 2,
|
|
12
|
+
class: "vue-data-ui-watermark"
|
|
13
|
+
}, dt = ["innerHTML"], vt = {
|
|
14
|
+
__name: "vue-ui-flow",
|
|
15
|
+
props: {
|
|
16
|
+
config: {
|
|
17
|
+
type: Object,
|
|
18
|
+
default() {
|
|
19
|
+
return {};
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
dataset: {
|
|
23
|
+
type: Array,
|
|
24
|
+
default() {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
setup(pe, { expose: be }) {
|
|
30
|
+
const g = pe, { vue_ui_flow: ye } = ze(), M = m(() => !!g.dataset && g.dataset.length);
|
|
31
|
+
He(() => {
|
|
32
|
+
j();
|
|
33
|
+
});
|
|
34
|
+
function j() {
|
|
35
|
+
Ye(g.dataset) && De({
|
|
36
|
+
componentName: "VueUiFlow",
|
|
37
|
+
type: "dataset"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const z = y(fe()), X = y(null), W = y(0), q = y(0), N = y(!1);
|
|
41
|
+
function ke(t) {
|
|
42
|
+
N.value = t, W.value += 1;
|
|
43
|
+
}
|
|
44
|
+
const e = m({
|
|
45
|
+
get: () => R(),
|
|
46
|
+
set: (t) => t
|
|
47
|
+
});
|
|
48
|
+
function R() {
|
|
49
|
+
const t = ge({
|
|
50
|
+
userConfig: g.config,
|
|
51
|
+
defaultConfig: ye
|
|
52
|
+
});
|
|
53
|
+
return t.theme ? {
|
|
54
|
+
...ge({
|
|
55
|
+
userConfig: Ge.vue_ui_flow[t.theme] || g.config,
|
|
56
|
+
defaultConfig: t
|
|
57
|
+
}),
|
|
58
|
+
customPalette: Be[t.theme] || V
|
|
59
|
+
} : t;
|
|
60
|
+
}
|
|
61
|
+
Le(() => g.config, (t) => {
|
|
62
|
+
e.value = R(), j(), q.value += 1;
|
|
63
|
+
}, { deep: !0 });
|
|
64
|
+
const { isPrinting: Z, isImaging: J, generatePdf: K, generateImage: Q } = Re({
|
|
65
|
+
elementId: `flow_${z.value}`,
|
|
66
|
+
fileName: e.value.style.chart.title.text || "vue-ui-flow"
|
|
67
|
+
}), Y = m(() => Ae(e.value.customPalette)), ee = m(() => e.value.style.chart.nodes.gap), $ = m(() => e.value.style.chart.nodes.width), I = y({
|
|
68
|
+
showTable: e.value.table.show
|
|
69
|
+
}), te = m(() => e.value.style.chart.links.width), D = m(() => !g.dataset || !g.dataset.length ? [] : g.dataset.map((t) => [
|
|
70
|
+
t[0],
|
|
71
|
+
t[1],
|
|
72
|
+
v(t[2])
|
|
73
|
+
])), le = m(() => {
|
|
74
|
+
const t = {};
|
|
75
|
+
function o(n) {
|
|
76
|
+
t[n] || (t[n] = { inflow: 0, outflow: 0 });
|
|
77
|
+
}
|
|
78
|
+
D.value.forEach(([n, a, c]) => {
|
|
79
|
+
o(n), o(a), t[n].outflow += c, t[a].inflow += c;
|
|
80
|
+
});
|
|
81
|
+
let l = 0;
|
|
82
|
+
for (const n in t) {
|
|
83
|
+
const a = Math.max(t[n].inflow, t[n].outflow);
|
|
84
|
+
l = Math.max(l, a);
|
|
85
|
+
}
|
|
86
|
+
return l;
|
|
87
|
+
});
|
|
88
|
+
function we(t) {
|
|
89
|
+
return t / le.value * 100 + e.value.style.chart.nodes.minHeight;
|
|
90
|
+
}
|
|
91
|
+
function Ce(t) {
|
|
92
|
+
const o = e.value.style.chart.nodes.minHeight;
|
|
93
|
+
return (t - o) / 100 * le.value;
|
|
94
|
+
}
|
|
95
|
+
function xe(t) {
|
|
96
|
+
const o = {}, l = {};
|
|
97
|
+
function n(s, u) {
|
|
98
|
+
o[s] || (o[s] = { height: 0, level: null, inflow: 0, outflow: 0 }), o[s].level === null && (o[s].level = u), l[u] || (l[u] = []), l[u].includes(s) || l[u].push(s);
|
|
99
|
+
}
|
|
100
|
+
t.forEach(([s, u, f], _) => {
|
|
101
|
+
const w = o[s] ? o[s].level : 0, E = w + 1;
|
|
102
|
+
n(s, w), n(u, E), o[s].children || (o[s].children = []), o[s].children.push({ target: u, value: f }), o[s].outflow += f, o[u].inflow += f;
|
|
103
|
+
}), Object.keys(o).forEach((s, u) => {
|
|
104
|
+
o[s].color = Y.value[u] || Y.value[u % Y.value.length] || V[u] || V[u % d.length];
|
|
105
|
+
});
|
|
106
|
+
for (const s in o)
|
|
107
|
+
o[s].height = we(Math.max(o[s].inflow, o[s].outflow)), o[s].name = s;
|
|
108
|
+
const a = {};
|
|
109
|
+
for (const s in l) {
|
|
110
|
+
let u = 0;
|
|
111
|
+
l[s].forEach((f, _) => {
|
|
112
|
+
const w = o[f].height;
|
|
113
|
+
a[f] = {
|
|
114
|
+
x: parseInt(s, 10) * te.value + e.value.style.chart.padding.left,
|
|
115
|
+
y: u,
|
|
116
|
+
absoluteY: u,
|
|
117
|
+
height: w,
|
|
118
|
+
i: _,
|
|
119
|
+
color: o[f].color,
|
|
120
|
+
value: Ce(w)
|
|
121
|
+
}, u += w + ee.value;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
const c = [];
|
|
125
|
+
for (const s in o) {
|
|
126
|
+
let u = a[s].absoluteY;
|
|
127
|
+
o[s].children && o[s].children.forEach(({ target: f, value: _ }, w) => {
|
|
128
|
+
const E = a[f].y, B = a[s], A = a[f], se = v(u), ue = v(u + _ / o[s].outflow * B.height), re = v(E), ie = v(E + _ / o[f].inflow * A.height), Ie = {
|
|
129
|
+
id: fe(),
|
|
130
|
+
source: s,
|
|
131
|
+
target: f,
|
|
132
|
+
path: `M ${v(B.x) + v($.value)} ${se} L ${v(B.x) + v($.value)} ${ue} L ${v(A.x)} ${ie} L ${v(A.x)} ${re} Z`,
|
|
133
|
+
value: _,
|
|
134
|
+
sourceColor: o[s].color,
|
|
135
|
+
targetColor: o[f].color
|
|
136
|
+
};
|
|
137
|
+
c.push(Ie), u += ue - se, a[f].y += ie - re;
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return { nodeCoordinates: a, links: c };
|
|
141
|
+
}
|
|
142
|
+
const p = m(() => {
|
|
143
|
+
const t = xe(g.dataset);
|
|
144
|
+
return {
|
|
145
|
+
nodes: Object.keys(t.nodeCoordinates).map((o, l) => ({
|
|
146
|
+
...t.nodeCoordinates[o],
|
|
147
|
+
name: o
|
|
148
|
+
})),
|
|
149
|
+
links: t.links
|
|
150
|
+
};
|
|
151
|
+
}), $e = m(() => _e(p.value.nodes));
|
|
152
|
+
function _e(t) {
|
|
153
|
+
const o = {};
|
|
154
|
+
for (const n in t) {
|
|
155
|
+
const { x: a, height: c } = t[n];
|
|
156
|
+
o[a] || (o[a] = 0), o[a] += c + ee.value;
|
|
157
|
+
}
|
|
158
|
+
return Math.max(...Object.values(o));
|
|
159
|
+
}
|
|
160
|
+
const G = m(() => {
|
|
161
|
+
const { top: t, right: o, left: l, bottom: n } = e.value.style.chart.padding, a = D.value.length * te.value;
|
|
162
|
+
return {
|
|
163
|
+
height: $e.value + t + n,
|
|
164
|
+
width: o + Math.max(...p.value.nodes.map((c) => c.x)) + $.value,
|
|
165
|
+
left: l,
|
|
166
|
+
top: t,
|
|
167
|
+
right: a - o,
|
|
168
|
+
p_top: t,
|
|
169
|
+
p_bottom: n
|
|
170
|
+
};
|
|
171
|
+
});
|
|
172
|
+
function Ne(t) {
|
|
173
|
+
const o = {}, l = {}, n = /* @__PURE__ */ new Set();
|
|
174
|
+
return D.value.forEach(([a, c, s]) => {
|
|
175
|
+
o[a] || (o[a] = []), l[c] || (l[c] = []), o[a].push(c), l[c].push(a);
|
|
176
|
+
}), o[t] && o[t].forEach((a) => n.add(a)), l[t] && l[t].forEach((a) => n.add(a)), Array.from(n).concat(t);
|
|
177
|
+
}
|
|
178
|
+
const b = y(null), H = y(null);
|
|
179
|
+
function Te(t) {
|
|
180
|
+
b.value = Ne(t.name), H.value = t.name;
|
|
181
|
+
}
|
|
182
|
+
function Pe() {
|
|
183
|
+
b.value = null, H.value = null;
|
|
184
|
+
}
|
|
185
|
+
const oe = m(() => p.value.links.map(({ source: t, target: o, sourceColor: l, targetColor: n, value: a }) => ({
|
|
186
|
+
source: t,
|
|
187
|
+
target: o,
|
|
188
|
+
sourceColor: l,
|
|
189
|
+
targetColor: n,
|
|
190
|
+
value: a
|
|
191
|
+
})));
|
|
192
|
+
function ae() {
|
|
193
|
+
Me(() => {
|
|
194
|
+
const t = oe.value.map((n, a) => [
|
|
195
|
+
[n.source],
|
|
196
|
+
[n.target],
|
|
197
|
+
[n.value]
|
|
198
|
+
]), o = [
|
|
199
|
+
[e.value.style.chart.title.text],
|
|
200
|
+
[e.value.style.chart.title.subtitle.text],
|
|
201
|
+
[
|
|
202
|
+
[e.value.table.columnNames.source],
|
|
203
|
+
[e.value.table.columnNames.target],
|
|
204
|
+
[e.value.table.columnNames.value]
|
|
205
|
+
]
|
|
206
|
+
].concat(t), l = Xe(o);
|
|
207
|
+
We({
|
|
208
|
+
csvContent: l,
|
|
209
|
+
title: e.value.style.chart.title.text || "vue-ui-flow"
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
const L = m(() => {
|
|
214
|
+
const t = [
|
|
215
|
+
e.value.table.columnNames.source,
|
|
216
|
+
e.value.table.columnNames.target,
|
|
217
|
+
e.value.table.columnNames.value
|
|
218
|
+
], o = oe.value.map((a, c) => [
|
|
219
|
+
{
|
|
220
|
+
color: a.sourceColor,
|
|
221
|
+
name: a.source
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
color: a.targetColor,
|
|
225
|
+
name: a.target
|
|
226
|
+
},
|
|
227
|
+
he({
|
|
228
|
+
p: e.value.style.chart.nodes.labels.prefix,
|
|
229
|
+
v: a.value,
|
|
230
|
+
s: e.value.style.chart.nodes.labels.suffix,
|
|
231
|
+
r: e.value.style.chart.nodes.labels.rounding
|
|
232
|
+
})
|
|
233
|
+
]), l = {
|
|
234
|
+
th: {
|
|
235
|
+
backgroundColor: e.value.table.th.backgroundColor,
|
|
236
|
+
color: e.value.table.th.color,
|
|
237
|
+
outline: e.value.table.th.outline
|
|
238
|
+
},
|
|
239
|
+
td: {
|
|
240
|
+
backgroundColor: e.value.table.td.backgroundColor,
|
|
241
|
+
color: e.value.table.td.color,
|
|
242
|
+
outline: e.value.table.td.outline
|
|
243
|
+
},
|
|
244
|
+
breakpoint: e.value.table.responsiveBreakpoint
|
|
245
|
+
};
|
|
246
|
+
return {
|
|
247
|
+
colNames: [
|
|
248
|
+
e.value.table.columnNames.source,
|
|
249
|
+
e.value.table.columnNames.target,
|
|
250
|
+
e.value.table.columnNames.value
|
|
251
|
+
],
|
|
252
|
+
head: t,
|
|
253
|
+
body: o,
|
|
254
|
+
config: l
|
|
255
|
+
};
|
|
256
|
+
});
|
|
257
|
+
function Fe() {
|
|
258
|
+
return p.value;
|
|
259
|
+
}
|
|
260
|
+
function ne() {
|
|
261
|
+
I.value.showTable = !I.value.showTable;
|
|
262
|
+
}
|
|
263
|
+
return be({
|
|
264
|
+
getData: Fe,
|
|
265
|
+
generateCsv: ae,
|
|
266
|
+
generateImage: Q,
|
|
267
|
+
generatePdf: K,
|
|
268
|
+
toggleTable: ne
|
|
269
|
+
}), (t, o) => (r(), h("div", {
|
|
270
|
+
ref_key: "flowChart",
|
|
271
|
+
ref: X,
|
|
272
|
+
class: ce(`vue-ui-flow ${N.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
|
|
273
|
+
style: C(`font-family:${e.value.style.fontFamily};width:100%; text-align:center;${e.value.style.chart.title.text ? "" : "padding-top:36px"};background:${e.value.style.chart.backgroundColor}`),
|
|
274
|
+
id: `flow_${z.value}`
|
|
275
|
+
}, [
|
|
276
|
+
e.value.style.chart.title.text ? (r(), h("div", {
|
|
277
|
+
key: 0,
|
|
278
|
+
style: C(`width:100%;background:${e.value.style.chart.backgroundColor};padding-bottom:24px`)
|
|
279
|
+
}, [
|
|
280
|
+
(r(), O(qe, {
|
|
281
|
+
key: `title_${q.value}`,
|
|
282
|
+
config: {
|
|
283
|
+
title: {
|
|
284
|
+
cy: "flow-title",
|
|
285
|
+
...e.value.style.chart.title
|
|
286
|
+
},
|
|
287
|
+
subtitle: {
|
|
288
|
+
cy: "flow-subtitle",
|
|
289
|
+
...e.value.style.chart.title.subtitle
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}, null, 8, ["config"]))
|
|
293
|
+
], 4)) : T("", !0),
|
|
294
|
+
e.value.userOptions.show && M.value ? (r(), O(Ze, {
|
|
295
|
+
ref: "details",
|
|
296
|
+
key: `user_option_${W.value}`,
|
|
297
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
298
|
+
color: e.value.style.chart.color,
|
|
299
|
+
isPrinting: i(Z),
|
|
300
|
+
isImaging: i(J),
|
|
301
|
+
uid: z.value,
|
|
302
|
+
hasPdf: e.value.userOptions.buttons.pdf,
|
|
303
|
+
hasXls: e.value.userOptions.buttons.csv,
|
|
304
|
+
hasImg: e.value.userOptions.buttons.img,
|
|
305
|
+
hasTable: e.value.userOptions.buttons.table,
|
|
306
|
+
hasFullscreen: e.value.userOptions.buttons.fullscreen,
|
|
307
|
+
isFullscreen: N.value,
|
|
308
|
+
titles: { ...e.value.userOptions.buttonTitles },
|
|
309
|
+
chartElement: X.value,
|
|
310
|
+
onToggleFullscreen: ke,
|
|
311
|
+
onGeneratePdf: i(K),
|
|
312
|
+
onGenerateCsv: ae,
|
|
313
|
+
onGenerateImage: i(Q),
|
|
314
|
+
onToggleTable: ne
|
|
315
|
+
}, Ee({ _: 2 }, [
|
|
316
|
+
t.$slots.optionPdf ? {
|
|
317
|
+
name: "optionPdf",
|
|
318
|
+
fn: k(() => [
|
|
319
|
+
x(t.$slots, "optionPdf", {}, void 0, !0)
|
|
320
|
+
]),
|
|
321
|
+
key: "0"
|
|
322
|
+
} : void 0,
|
|
323
|
+
t.$slots.optionCsv ? {
|
|
324
|
+
name: "optionCsv",
|
|
325
|
+
fn: k(() => [
|
|
326
|
+
x(t.$slots, "optionCsv", {}, void 0, !0)
|
|
327
|
+
]),
|
|
328
|
+
key: "1"
|
|
329
|
+
} : void 0,
|
|
330
|
+
t.$slots.optionImg ? {
|
|
331
|
+
name: "optionImg",
|
|
332
|
+
fn: k(() => [
|
|
333
|
+
x(t.$slots, "optionImg", {}, void 0, !0)
|
|
334
|
+
]),
|
|
335
|
+
key: "2"
|
|
336
|
+
} : void 0,
|
|
337
|
+
t.$slots.optionTable ? {
|
|
338
|
+
name: "optionTable",
|
|
339
|
+
fn: k(() => [
|
|
340
|
+
x(t.$slots, "optionTable", {}, void 0, !0)
|
|
341
|
+
]),
|
|
342
|
+
key: "3"
|
|
343
|
+
} : void 0,
|
|
344
|
+
t.$slots.optionFullscreen ? {
|
|
345
|
+
name: "optionFullscreen",
|
|
346
|
+
fn: k(({ toggleFullscreen: l, isFullscreen: n }) => [
|
|
347
|
+
x(t.$slots, "optionFullscreen", de(ve({ toggleFullscreen: l, isFullscreen: n })), void 0, !0)
|
|
348
|
+
]),
|
|
349
|
+
key: "4"
|
|
350
|
+
} : void 0
|
|
351
|
+
]), 1032, ["backgroundColor", "color", "isPrinting", "isImaging", "uid", "hasPdf", "hasXls", "hasImg", "hasTable", "hasFullscreen", "isFullscreen", "titles", "chartElement", "onGeneratePdf", "onGenerateImage"])) : T("", !0),
|
|
352
|
+
(r(), h("svg", {
|
|
353
|
+
xmlns: i(Ue),
|
|
354
|
+
viewBox: `0 0 ${G.value.width} ${G.value.height}`,
|
|
355
|
+
class: ce({ "vue-data-ui-fullscreen--on": N.value, "vue-data-ui-fulscreen--off": !N.value }),
|
|
356
|
+
style: C(`max-width:100%; overflow: visible; background:${e.value.style.chart.backgroundColor};color:${e.value.style.chart.color}`)
|
|
357
|
+
}, [
|
|
358
|
+
S("defs", null, [
|
|
359
|
+
(r(!0), h(P, null, F(p.value.links, (l, n) => (r(), h("linearGradient", {
|
|
360
|
+
id: l.id,
|
|
361
|
+
x1: "0%",
|
|
362
|
+
y1: "0%",
|
|
363
|
+
x2: "100%",
|
|
364
|
+
y2: "0%"
|
|
365
|
+
}, [
|
|
366
|
+
S("stop", {
|
|
367
|
+
offset: "0%",
|
|
368
|
+
"stop-color": l.sourceColor
|
|
369
|
+
}, null, 8, at),
|
|
370
|
+
S("stop", {
|
|
371
|
+
offset: "100%",
|
|
372
|
+
"stop-color": l.targetColor
|
|
373
|
+
}, null, 8, nt)
|
|
374
|
+
], 8, ot))), 256))
|
|
375
|
+
]),
|
|
376
|
+
(r(!0), h(P, null, F(p.value.links, (l) => (r(), h("path", {
|
|
377
|
+
class: "vue-ui-flow-link",
|
|
378
|
+
d: l.path,
|
|
379
|
+
fill: `url(#${l.id})`,
|
|
380
|
+
stroke: e.value.style.chart.links.stroke,
|
|
381
|
+
"stroke-width": e.value.style.chart.links.strokeWidth,
|
|
382
|
+
style: C(`opacity:${H.value ? [l.target, l.source].includes(H.value) ? 1 : 0.3 : e.value.style.chart.links.opacity}`)
|
|
383
|
+
}, null, 12, st))), 256)),
|
|
384
|
+
(r(!0), h(P, null, F(p.value.nodes, (l, n) => (r(), h("rect", {
|
|
385
|
+
class: "vue-ui-flow-node",
|
|
386
|
+
x: l.x,
|
|
387
|
+
y: i(v)(l.absoluteY),
|
|
388
|
+
height: i(v)(l.height),
|
|
389
|
+
width: $.value,
|
|
390
|
+
fill: l.color,
|
|
391
|
+
stroke: e.value.style.chart.nodes.stroke,
|
|
392
|
+
"stroke-width": e.value.style.chart.nodes.strokeWidth,
|
|
393
|
+
onMouseenter: (a) => Te(l),
|
|
394
|
+
onMouseleave: o[0] || (o[0] = (a) => Pe()),
|
|
395
|
+
style: C(`opacity:${b.value ? b.value.includes(l.name) ? 1 : 0.2 : 1}`)
|
|
396
|
+
}, null, 44, ut))), 256)),
|
|
397
|
+
(r(!0), h(P, null, F(p.value.nodes, (l, n) => (r(), h("text", {
|
|
398
|
+
x: l.x + $.value / 2,
|
|
399
|
+
y: i(v)(l.absoluteY + l.height / 2 - e.value.style.chart.nodes.labels.fontSize / 4),
|
|
400
|
+
"font-size": e.value.style.chart.nodes.labels.fontSize,
|
|
401
|
+
fill: i(me)(l.color),
|
|
402
|
+
"text-anchor": "middle",
|
|
403
|
+
style: C(`pointer-events: none; opacity:${b.value ? b.value.includes(l.name) ? 1 : 0 : 1}`)
|
|
404
|
+
}, U(e.value.style.chart.nodes.labels.abbreviation.use ? i(Ve)({ source: l.name, length: e.value.style.chart.nodes.labels.abbreviation.length }) : l.name), 13, rt))), 256)),
|
|
405
|
+
(r(!0), h(P, null, F(p.value.nodes, (l, n) => (r(), h("text", {
|
|
406
|
+
x: l.x + $.value / 2,
|
|
407
|
+
y: i(v)(l.absoluteY + l.height / 2 + e.value.style.chart.nodes.labels.fontSize),
|
|
408
|
+
"font-size": e.value.style.chart.nodes.labels.fontSize,
|
|
409
|
+
fill: i(me)(l.color),
|
|
410
|
+
"text-anchor": "middle",
|
|
411
|
+
style: C(`pointer-events: none; opacity:${b.value ? b.value.includes(l.name) ? 1 : 0 : 1}`)
|
|
412
|
+
}, U(i(je)(
|
|
413
|
+
e.value.style.chart.nodes.labels.formatter,
|
|
414
|
+
l.value,
|
|
415
|
+
i(he)({
|
|
416
|
+
p: e.value.style.chart.nodes.labels.prefix,
|
|
417
|
+
v: l.value,
|
|
418
|
+
s: e.value.style.chart.nodes.labels.suffix,
|
|
419
|
+
r: e.value.style.chart.nodes.labels.rounding
|
|
420
|
+
}),
|
|
421
|
+
{ datapoint: l, seriesIndex: n }
|
|
422
|
+
)), 13, it))), 256)),
|
|
423
|
+
x(t.$slots, "svg", { svg: G.value }, void 0, !0)
|
|
424
|
+
], 14, lt)),
|
|
425
|
+
t.$slots.watermark ? (r(), h("div", ct, [
|
|
426
|
+
x(t.$slots, "watermark", de(ve({ isPrinting: i(Z) || i(J) })), void 0, !0)
|
|
427
|
+
])) : T("", !0),
|
|
428
|
+
M.value ? T("", !0) : (r(), O(Qe, {
|
|
429
|
+
key: 3,
|
|
430
|
+
config: {
|
|
431
|
+
type: "flow",
|
|
432
|
+
style: {
|
|
433
|
+
backgroundColor: e.value.style.chart.backgroundColor
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}, null, 8, ["config"])),
|
|
437
|
+
M.value ? (r(), O(Ke, {
|
|
438
|
+
key: 4,
|
|
439
|
+
hideDetails: "",
|
|
440
|
+
config: {
|
|
441
|
+
open: I.value.showTable,
|
|
442
|
+
maxHeight: 1e4,
|
|
443
|
+
body: {
|
|
444
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
445
|
+
color: e.value.style.chart.color
|
|
446
|
+
},
|
|
447
|
+
head: {
|
|
448
|
+
backgroundColor: e.value.style.chart.backgroundColor,
|
|
449
|
+
color: e.value.style.chart.color
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}, {
|
|
453
|
+
content: k(() => [
|
|
454
|
+
Oe(Je, {
|
|
455
|
+
colNames: L.value.colNames,
|
|
456
|
+
head: L.value.head,
|
|
457
|
+
body: L.value.body,
|
|
458
|
+
config: L.value.config,
|
|
459
|
+
title: `${e.value.style.chart.title.text}${e.value.style.chart.title.subtitle.text ? ` : ${e.value.style.chart.title.subtitle.text}` : ""}`,
|
|
460
|
+
onClose: o[1] || (o[1] = (l) => I.value.showTable = !1)
|
|
461
|
+
}, {
|
|
462
|
+
th: k(({ th: l }) => [
|
|
463
|
+
S("div", {
|
|
464
|
+
innerHTML: l,
|
|
465
|
+
style: { display: "flex", "align-items": "center" }
|
|
466
|
+
}, null, 8, dt)
|
|
467
|
+
]),
|
|
468
|
+
td: k(({ td: l }) => [
|
|
469
|
+
Se(U(l.name || l), 1)
|
|
470
|
+
]),
|
|
471
|
+
_: 1
|
|
472
|
+
}, 8, ["colNames", "head", "body", "config", "title"])
|
|
473
|
+
]),
|
|
474
|
+
_: 1
|
|
475
|
+
}, 8, ["config"])) : T("", !0)
|
|
476
|
+
], 14, tt));
|
|
477
|
+
}
|
|
478
|
+
}, Ct = /* @__PURE__ */ et(vt, [["__scopeId", "data-v-948bb0e4"]]);
|
|
479
|
+
export {
|
|
480
|
+
Ct as default
|
|
481
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DYUBiaGS.cjs"),he=require("./Title-XBiDFYKD.cjs"),Z=require("./usePrinter-ZlHxdaEz.cjs"),fe=require("./DataTable-DjQzrklZ.cjs"),ve=require("./vue-ui-accordion-1WxrfiCH.cjs"),me=require("./vue-ui-skeleton-ClpTCY1x.cjs"),J=require("./useNestedProp-w7AMWWmz.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ge=["id"],ke=["xmlns","viewBox"],ye=["id"],be=["stop-color"],we=["stop-color"],Ce=["d","fill","stroke","stroke-width"],Ne=["x","y","height","width","fill","stroke","stroke-width","onMouseenter"],xe=["x","y","font-size","fill"],$e=["x","y","font-size","fill"],Be={key:2,class:"vue-data-ui-watermark"},_e=["innerHTML"],Ee={__name:"vue-ui-flow",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(K,{expose:Q}){const f=K,{vue_ui_flow:ee}=r.useConfig(),x=e.computed(()=>!!f.dataset&&f.dataset.length);e.onMounted(()=>{P()});function P(){r.objectIsEmpty(f.dataset)&&r.error({componentName:"VueUiFlow",type:"dataset"})}const $=e.ref(r.createUid()),F=e.ref(null),L=e.ref(0),z=e.ref(0),y=e.ref(!1);function te(l){y.value=l,L.value+=1}const t=e.computed({get:()=>I(),set:l=>l});function I(){const l=J.useNestedProp({userConfig:f.config,defaultConfig:ee});return l.theme?{...J.useNestedProp({userConfig:r.themes.vue_ui_flow[l.theme]||f.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>f.config,l=>{t.value=I(),P(),z.value+=1},{deep:!0});const{isPrinting:H,isImaging:O,generatePdf:M,generateImage:V}=Z.usePrinter({elementId:`flow_${$.value}`,fileName:t.value.style.chart.title.text||"vue-ui-flow"}),B=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),D=e.computed(()=>t.value.style.chart.nodes.gap),g=e.computed(()=>t.value.style.chart.nodes.width),b=e.ref({showTable:t.value.table.show}),Y=e.computed(()=>t.value.style.chart.links.width),_=e.computed(()=>!f.dataset||!f.dataset.length?[]:f.dataset.map(l=>[l[0],l[1],r.checkNaN(l[2])])),q=e.computed(()=>{const l={};function n(s){l[s]||(l[s]={inflow:0,outflow:0})}_.value.forEach(([s,a,i])=>{n(s),n(a),l[s].outflow+=i,l[a].inflow+=i});let o=0;for(const s in l){const a=Math.max(l[s].inflow,l[s].outflow);o=Math.max(o,a)}return o});function le(l){return l/q.value*100+t.value.style.chart.nodes.minHeight}function oe(l){const n=t.value.style.chart.nodes.minHeight;return(l-n)/100*q.value}function ne(l){const n={},o={};function s(u,c){n[u]||(n[u]={height:0,level:null,inflow:0,outflow:0}),n[u].level===null&&(n[u].level=c),o[c]||(o[c]=[]),o[c].includes(u)||o[c].push(u)}l.forEach(([u,c,h],k)=>{const p=n[u]?n[u].level:0,N=p+1;s(u,p),s(c,N),n[u].children||(n[u].children=[]),n[u].children.push({target:c,value:h}),n[u].outflow+=h,n[c].inflow+=h}),Object.keys(n).forEach((u,c)=>{n[u].color=B.value[c]||B.value[c%B.value.length]||r.palette[c]||r.palette[c%d.length]});for(const u in n)n[u].height=le(Math.max(n[u].inflow,n[u].outflow)),n[u].name=u;const a={};for(const u in o){let c=0;o[u].forEach((h,k)=>{const p=n[h].height;a[h]={x:parseInt(u,10)*Y.value+t.value.style.chart.padding.left,y:c,absoluteY:c,height:p,i:k,color:n[h].color,value:oe(p)},c+=p+D.value})}const i=[];for(const u in n){let c=a[u].absoluteY;n[u].children&&n[u].children.forEach(({target:h,value:k},p)=>{const N=a[h].y,S=a[u],T=a[h],A=r.checkNaN(c),W=r.checkNaN(c+k/n[u].outflow*S.height),X=r.checkNaN(N),R=r.checkNaN(N+k/n[h].inflow*T.height),de={id:r.createUid(),source:u,target:h,path:`M ${r.checkNaN(S.x)+r.checkNaN(g.value)} ${A} L ${r.checkNaN(S.x)+r.checkNaN(g.value)} ${W} L ${r.checkNaN(T.x)} ${R} L ${r.checkNaN(T.x)} ${X} Z`,value:k,sourceColor:n[u].color,targetColor:n[h].color};i.push(de),c+=W-A,a[h].y+=R-X})}return{nodeCoordinates:a,links:i}}const v=e.computed(()=>{const l=ne(f.dataset);return{nodes:Object.keys(l.nodeCoordinates).map((n,o)=>({...l.nodeCoordinates[n],name:n})),links:l.links}}),ae=e.computed(()=>re(v.value.nodes));function re(l){const n={};for(const s in l){const{x:a,height:i}=l[s];n[a]||(n[a]=0),n[a]+=i+D.value}return Math.max(...Object.values(n))}const E=e.computed(()=>{const{top:l,right:n,left:o,bottom:s}=t.value.style.chart.padding,a=_.value.length*Y.value;return{height:ae.value+l+s,width:n+Math.max(...v.value.nodes.map(i=>i.x))+g.value,left:o,top:l,right:a-n,p_top:l,p_bottom:s}});function se(l){const n={},o={},s=new Set;return _.value.forEach(([a,i,u])=>{n[a]||(n[a]=[]),o[i]||(o[i]=[]),n[a].push(i),o[i].push(a)}),n[l]&&n[l].forEach(a=>s.add(a)),o[l]&&o[l].forEach(a=>s.add(a)),Array.from(s).concat(l)}const m=e.ref(null),w=e.ref(null);function ue(l){m.value=se(l.name),w.value=l.name}function ce(){m.value=null,w.value=null}const G=e.computed(()=>v.value.links.map(({source:l,target:n,sourceColor:o,targetColor:s,value:a})=>({source:l,target:n,sourceColor:o,targetColor:s,value:a})));function U(){e.nextTick(()=>{const l=G.value.map((s,a)=>[[s.source],[s.target],[s.value]]),n=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.source],[t.value.table.columnNames.target],[t.value.table.columnNames.value]]].concat(l),o=r.createCsvContent(n);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-flow"})})}const C=e.computed(()=>{const l=[t.value.table.columnNames.source,t.value.table.columnNames.target,t.value.table.columnNames.value],n=G.value.map((a,i)=>[{color:a.sourceColor,name:a.source},{color:a.targetColor,name:a.target},r.dataLabel({p:t.value.style.chart.nodes.labels.prefix,v:a.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding})]),o={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.source,t.value.table.columnNames.target,t.value.table.columnNames.value],head:l,body:n,config:o}});function ie(){return v.value}function j(){b.value.showTable=!b.value.showTable}return Q({getData:ie,generateCsv:U,generateImage:V,generatePdf:M,toggleTable:j}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"flowChart",ref:F,class:e.normalizeClass(`vue-ui-flow ${y.value?"vue-data-ui-wrapper-fullscreen":""}`),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}`),id:`flow_${$.value}`},[t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};padding-bottom:24px`)},[(e.openBlock(),e.createBlock(he._sfc_main,{key:`title_${z.value}`,config:{title:{cy:"flow-title",...t.value.style.chart.title},subtitle:{cy:"flow-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],4)):e.createCommentVNode("",!0),t.value.userOptions.show&&x.value?(e.openBlock(),e.createBlock(Z.UserOptions,{ref:"details",key:`user_option_${L.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(H),isImaging:e.unref(O),uid:$.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:y.value,titles:{...t.value.userOptions.buttonTitles},chartElement:F.value,onToggleFullscreen:te,onGeneratePdf:e.unref(M),onGenerateCsv:U,onGenerateImage:e.unref(V),onToggleTable:j},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.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:s})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:s})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","titles","chartElement","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(r.XMLNS),viewBox:`0 0 ${E.value.width} ${E.value.height}`,class:e.normalizeClass({"vue-data-ui-fullscreen--on":y.value,"vue-data-ui-fulscreen--off":!y.value}),style:e.normalizeStyle(`max-width:100%; overflow: visible; background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color}`)},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.links,(o,s)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:o.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.sourceColor},null,8,be),e.createElementVNode("stop",{offset:"100%","stop-color":o.targetColor},null,8,we)],8,ye))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.links,o=>(e.openBlock(),e.createElementBlock("path",{class:"vue-ui-flow-link",d:o.path,fill:`url(#${o.id})`,stroke:t.value.style.chart.links.stroke,"stroke-width":t.value.style.chart.links.strokeWidth,style:e.normalizeStyle(`opacity:${w.value?[o.target,o.source].includes(w.value)?1:.3:t.value.style.chart.links.opacity}`)},null,12,Ce))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.nodes,(o,s)=>(e.openBlock(),e.createElementBlock("rect",{class:"vue-ui-flow-node",x:o.x,y:e.unref(r.checkNaN)(o.absoluteY),height:e.unref(r.checkNaN)(o.height),width:g.value,fill:o.color,stroke:t.value.style.chart.nodes.stroke,"stroke-width":t.value.style.chart.nodes.strokeWidth,onMouseenter:a=>ue(o),onMouseleave:n[0]||(n[0]=a=>ce()),style:e.normalizeStyle(`opacity:${m.value?m.value.includes(o.name)?1:.2:1}`)},null,44,Ne))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.nodes,(o,s)=>(e.openBlock(),e.createElementBlock("text",{x:o.x+g.value/2,y:e.unref(r.checkNaN)(o.absoluteY+o.height/2-t.value.style.chart.nodes.labels.fontSize/4),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(r.adaptColorToBackground)(o.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(o.name)?1:0:1}`)},e.toDisplayString(t.value.style.chart.nodes.labels.abbreviation.use?e.unref(r.abbreviate)({source:o.name,length:t.value.style.chart.nodes.labels.abbreviation.length}):o.name),13,xe))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value.nodes,(o,s)=>(e.openBlock(),e.createElementBlock("text",{x:o.x+g.value/2,y:e.unref(r.checkNaN)(o.absoluteY+o.height/2+t.value.style.chart.nodes.labels.fontSize),"font-size":t.value.style.chart.nodes.labels.fontSize,fill:e.unref(r.adaptColorToBackground)(o.color),"text-anchor":"middle",style:e.normalizeStyle(`pointer-events: none; opacity:${m.value?m.value.includes(o.name)?1:0:1}`)},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.nodes.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.nodes.labels.prefix,v:o.value,s:t.value.style.chart.nodes.labels.suffix,r:t.value.style.chart.nodes.labels.rounding}),{datapoint:o,seriesIndex:s})),13,$e))),256)),e.renderSlot(l.$slots,"svg",{svg:E.value},void 0,!0)],14,ke)),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(H)||e.unref(O)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(me.default,{key:3,config:{type:"flow",style:{backgroundColor:t.value.style.chart.backgroundColor}}},null,8,["config"])),x.value?(e.openBlock(),e.createBlock(ve.default,{key:4,hideDetails:"",config:{open:b.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(fe.DataTable,{colNames:C.value.colNames,head:C.value.head,body:C.value.body,config:C.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:n[1]||(n[1]=o=>b.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,_e)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ge))}},Se=pe._export_sfc(Ee,[["__scopeId","data-v-948bb0e4"]]);exports.default=Se;
|