vue-data-ui 2.4.0 → 2.4.2
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/README.md +56 -54
- package/dist/{Arrow-CbntjQjr.cjs → Arrow-DLTRnzcG.cjs} +1 -1
- package/dist/{Arrow-NcE21Ngm.js → Arrow-JuK2z9IB.js} +1 -1
- package/dist/BaseIcon-BGExhz6v.cjs +1 -0
- package/dist/{BaseIcon-BUTpMnXi.js → BaseIcon-rRli6Sfv.js} +8 -4
- package/dist/{DataTable-BwH-MU-S.cjs → DataTable-DJzhv96s.cjs} +1 -1
- package/dist/{DataTable-DAgyf9zN.js → DataTable-DTk7C4Pr.js} +2 -2
- package/dist/{Legend-DBhpIX2x.js → Legend-CYF2gpXG.js} +23 -17
- package/dist/Legend-YZ7Hz3o1.cjs +1 -0
- package/dist/{PackageVersion-wB6dCDZw.js → PackageVersion-CvCRsT5_.js} +1 -1
- package/dist/{PackageVersion-Djty0wb2.cjs → PackageVersion-DVZtsuy4.cjs} +1 -1
- package/dist/PenAndPaper-CyXm-yVL.cjs +1 -0
- package/dist/PenAndPaper-Jb0pLt3G.js +269 -0
- package/dist/{Shape-CQVJz33T.js → Shape-BpPn4eWR.js} +1 -1
- package/dist/{Shape-DQ0Hh2Gg.cjs → Shape-X2F-QV_B.cjs} +1 -1
- package/dist/{Slicer-CiSmaE0_.cjs → Slicer-CL0tP5a5.cjs} +1 -1
- package/dist/{Slicer-DXw23eOC.js → Slicer-CU7dRZR0.js} +2 -2
- package/dist/{Title-DlVZnHjs.js → Title-5VmBwT4i.js} +21 -17
- package/dist/Title-Co5jI5ed.cjs +1 -0
- package/dist/{Tooltip-DBzXz806.cjs → Tooltip-Bl6W8Zn7.cjs} +1 -1
- package/dist/{Tooltip-CveCRFgK.js → Tooltip-Cj4EF7v1.js} +1 -1
- package/dist/documentation/installation.md +10 -9
- package/dist/{index-B0CpCD8z.js → index-DnVHQ2xI.js} +1138 -907
- package/dist/index-FfZRtJ6A.cjs +9 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +101 -20
- package/dist/types/vue-data-ui.d.ts +101 -20
- package/dist/{useNestedProp-DGWP4D-K.js → useNestedProp-Cox0K0Y5.js} +1 -1
- package/dist/{useNestedProp-iuDCMc2p.cjs → useNestedProp-q7byAAIJ.cjs} +1 -1
- package/dist/usePrinter-BCAFeO_J.cjs +1 -0
- package/dist/{usePrinter-Dr30K4cu.js → usePrinter-BEeNAqS5.js} +230 -185
- package/dist/vue-data-ui-CRLLZpt0.cjs +9 -0
- package/dist/vue-data-ui-W7nnqn0v.js +261 -0
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +52 -51
- package/dist/{vue-ui-3d-bar-C3hYrYTV.js → vue-ui-3d-bar-BwBrUabe.js} +414 -390
- package/dist/vue-ui-3d-bar-bD_n6qL_.cjs +19 -0
- package/dist/{vue-ui-accordion-CmENcGVW.js → vue-ui-accordion-DspS4q3f.js} +3 -3
- package/dist/{vue-ui-accordion-Deyo7jw7.cjs → vue-ui-accordion-xXgqfR2l.cjs} +1 -1
- package/dist/vue-ui-age-pyramid-BZcAwcVQ.cjs +1 -0
- package/dist/{vue-ui-age-pyramid-C075Lvfe.js → vue-ui-age-pyramid-CxBvm3uM.js} +218 -194
- package/dist/{vue-ui-annotator-Bb6fUz4x.js → vue-ui-annotator-BOofWpzv.js} +1 -1
- package/dist/{vue-ui-annotator-DslXalSQ.cjs → vue-ui-annotator-C6T5_7ZV.cjs} +1 -1
- package/dist/vue-ui-bullet-ChaEgXvR.cjs +23 -0
- package/dist/vue-ui-bullet-DraC-oFu.js +433 -0
- package/dist/vue-ui-candlestick--hPCfMFH.cjs +2 -0
- package/dist/{vue-ui-candlestick-C4VEOmY_.js → vue-ui-candlestick-DQZ5eT1f.js} +267 -243
- package/dist/{vue-ui-carousel-table-Coq4gg_P.cjs → vue-ui-carousel-table-DpRQklDZ.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-DZfMMpZ7.js → vue-ui-carousel-table-PdLjpH1p.js} +4 -4
- package/dist/{vue-ui-chestnut-CUnbj-Zb.js → vue-ui-chestnut-ByI_O5hB.js} +293 -269
- package/dist/vue-ui-chestnut-ae6x87wl.cjs +6 -0
- package/dist/{vue-ui-cursor-CtuPho-s.js → vue-ui-cursor-BM74l93B.js} +2 -2
- package/dist/{vue-ui-cursor-B9UvQwLp.cjs → vue-ui-cursor-BvadpA2m.cjs} +1 -1
- package/dist/{vue-ui-dashboard-8gQ1bGCn.js → vue-ui-dashboard-CoANBhAM.js} +2 -2
- package/dist/{vue-ui-dashboard-KMTRqXzR.cjs → vue-ui-dashboard-OP51Gs8I.cjs} +1 -1
- package/dist/{vue-ui-digits-DSMNN4z_.cjs → vue-ui-digits-C7jJJg9k.cjs} +1 -1
- package/dist/{vue-ui-digits-DuEyX8op.js → vue-ui-digits-DioaBnkB.js} +2 -2
- package/dist/vue-ui-donut-CplNylps.cjs +1 -0
- package/dist/vue-ui-donut-evolution-CQpr-6IS.cjs +1 -0
- package/dist/{vue-ui-donut-evolution-DbojarYN.js → vue-ui-donut-evolution-DAb1xzNd.js} +330 -306
- package/dist/{vue-ui-donut-0xdYBc41.js → vue-ui-donut-ldqSm_JV.js} +345 -321
- package/dist/{vue-ui-dumbbell-BxhWjCvR.js → vue-ui-dumbbell-Dg7PkiKJ.js} +265 -241
- package/dist/vue-ui-dumbbell-_ijaYr8W.cjs +9 -0
- package/dist/vue-ui-flow-BPt35d5K.cjs +1 -0
- package/dist/vue-ui-flow-DKT7ZEnr.js +508 -0
- package/dist/vue-ui-galaxy-e06PkTmp.cjs +1 -0
- package/dist/{vue-ui-galaxy-BddgLpP-.js → vue-ui-galaxy-qAA9be3S.js} +193 -169
- package/dist/vue-ui-gauge-D8yVTIgP.js +518 -0
- package/dist/vue-ui-gauge-DiZVIU0D.cjs +1 -0
- package/dist/{vue-ui-gizmo-hXBWaB0c.js → vue-ui-gizmo-DC0uUwI3.js} +3 -3
- package/dist/{vue-ui-gizmo-DRASsqlp.cjs → vue-ui-gizmo-W6bTkg59.cjs} +1 -1
- package/dist/vue-ui-heatmap-CbZcv_2I.cjs +1 -0
- package/dist/{vue-ui-heatmap-B43q8UHu.js → vue-ui-heatmap-u1raIzBQ.js} +252 -228
- package/dist/{vue-ui-kpi-_GVnhxEd.js → vue-ui-kpi-C-iTxMD2.js} +3 -3
- package/dist/{vue-ui-kpi-BiJnqtGR.cjs → vue-ui-kpi-DY_2WF7U.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-DVZtFcHw.cjs → vue-ui-mini-loader-Bfq2MNWu.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-qvtu5jtI.js → vue-ui-mini-loader-C7x7S0hi.js} +2 -2
- package/dist/vue-ui-molecule-BFnOIxxs.js +798 -0
- package/dist/vue-ui-molecule-CbKMLrDT.cjs +1 -0
- package/dist/vue-ui-mood-radar-6LmFXuiw.cjs +1 -0
- package/dist/{vue-ui-mood-radar-iZJ0B1Wf.js → vue-ui-mood-radar-CR1v5v2x.js} +263 -239
- package/dist/{vue-ui-nested-donuts-CovQfZ81.js → vue-ui-nested-donuts-DEiloQzq.js} +342 -318
- package/dist/vue-ui-nested-donuts-DS0fjiLi.cjs +17 -0
- package/dist/vue-ui-onion-CLvvu4Ku.cjs +5 -0
- package/dist/{vue-ui-onion-CJb2Pg0t.js → vue-ui-onion-LsEhBe4x.js} +226 -202
- package/dist/vue-ui-parallel-coordinate-plot-BWg8OFqH.cjs +8 -0
- package/dist/{vue-ui-parallel-coordinate-plot-CUA_fFC3.js → vue-ui-parallel-coordinate-plot-CTlIjJqG.js} +243 -219
- package/dist/{vue-ui-quadrant-IAIp5IZq.js → vue-ui-quadrant-DKVVFufb.js} +350 -326
- package/dist/vue-ui-quadrant-OM5J1mG3.cjs +1 -0
- package/dist/{vue-ui-quick-chart-Bb2RQ6qI.js → vue-ui-quick-chart-8vJikiGH.js} +505 -481
- package/dist/vue-ui-quick-chart-gG5Ar8-i.cjs +15 -0
- package/dist/{vue-ui-radar-mIQMBRHx.js → vue-ui-radar-20QhOUer.js} +255 -231
- package/dist/vue-ui-radar-CAaHjDO7.cjs +1 -0
- package/dist/{vue-ui-rating-BGRWSTGr.cjs → vue-ui-rating-Bbzm5nUK.cjs} +1 -1
- package/dist/{vue-ui-rating-DcJb7_bV.js → vue-ui-rating-DRWJsve1.js} +2 -2
- package/dist/vue-ui-relation-circle-BoGAFXuS.cjs +1 -0
- package/dist/vue-ui-relation-circle-I45_Sk5l.js +349 -0
- package/dist/vue-ui-rings-B9WQ7S5m.cjs +2 -0
- package/dist/vue-ui-rings-DG8GCi3y.js +593 -0
- package/dist/vue-ui-scatter-BZfg1YIN.cjs +1 -0
- package/dist/{vue-ui-scatter-DiQJtMz1.js → vue-ui-scatter-Hqu5-F2H.js} +369 -345
- package/dist/{vue-ui-screenshot-BdnW3WFN.cjs → vue-ui-screenshot-D8nxd5RV.cjs} +1 -1
- package/dist/{vue-ui-screenshot-QRt5bT48.js → vue-ui-screenshot-cjiqbtLK.js} +1 -1
- package/dist/{vue-ui-skeleton-fqwO2mHD.cjs → vue-ui-skeleton-Djv08J67.cjs} +1 -1
- package/dist/{vue-ui-skeleton-DEv_1TFa.js → vue-ui-skeleton-aZmkNzAe.js} +3 -3
- package/dist/{vue-ui-smiley-D-zRYR9g.cjs → vue-ui-smiley-B1TA19Hv.cjs} +1 -1
- package/dist/{vue-ui-smiley-BAr3XuJG.js → vue-ui-smiley-ChNvxygm.js} +2 -2
- package/dist/{vue-ui-spark-trend-Br0GTMx_.cjs → vue-ui-spark-trend-BqrPr63O.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-CS6jl2aN.js → vue-ui-spark-trend-CQxELQcf.js} +5 -5
- package/dist/{vue-ui-sparkbar-tgfbnVYO.js → vue-ui-sparkbar-0ixbKZzf.js} +4 -4
- package/dist/{vue-ui-sparkbar-N8aFbuJv.cjs → vue-ui-sparkbar-CrTEPTU5.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge--hgbxLQS.cjs → vue-ui-sparkgauge-BYxpe_WV.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-CqH25hj7.js → vue-ui-sparkgauge-pdYb7OwH.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-vVRA6Z_l.cjs → vue-ui-sparkhistogram-D21XDUH2.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-Cry2PFGH.js → vue-ui-sparkhistogram-N69h2q0U.js} +5 -5
- package/dist/{vue-ui-sparkline-DXwqMlzQ.js → vue-ui-sparkline-2BKYZMOb.js} +4 -4
- package/dist/{vue-ui-sparkline-BZir7JxD.cjs → vue-ui-sparkline-Cf4m-Fxo.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-Dc6tZvej.cjs → vue-ui-sparkstackbar-dAS8XoJs.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-CQjpberv.js → vue-ui-sparkstackbar-sh03cuOU.js} +4 -4
- package/dist/vue-ui-stackbar-B1si-1RM.js +938 -0
- package/dist/vue-ui-stackbar-Dy_saeSe.cjs +6 -0
- package/dist/{vue-ui-strip-plot-C8dme7tS.js → vue-ui-strip-plot-BYn-QrTQ.js} +274 -250
- package/dist/vue-ui-strip-plot-D53LABpZ.cjs +1 -0
- package/dist/{vue-ui-table-DGmUNjR_.cjs → vue-ui-table-Ce4waJaj.cjs} +1 -1
- package/dist/{vue-ui-table-BvbXppa1.js → vue-ui-table-DQORPCDJ.js} +1 -1
- package/dist/{vue-ui-table-heatmap-ccoLJyce.js → vue-ui-table-heatmap-Csp7Tx8N.js} +4 -4
- package/dist/{vue-ui-table-heatmap-Ch2UwsIw.cjs → vue-ui-table-heatmap-EqHt-O7Y.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-DT5a8gHs.cjs → vue-ui-table-sparkline-DONmVOMh.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-BZ8faxdR.js → vue-ui-table-sparkline-DdwVrfUj.js} +5 -5
- package/dist/vue-ui-thermometer-I6ZnlfAv.js +440 -0
- package/dist/vue-ui-thermometer-hQBkMa7u.cjs +1 -0
- package/dist/{vue-ui-timer-CNpKGbIg.cjs → vue-ui-timer-COOXcn14.cjs} +1 -1
- package/dist/{vue-ui-timer-DE_m5wxu.js → vue-ui-timer-pi1SazTU.js} +5 -5
- package/dist/vue-ui-tiremarks-hdNqoGyd.cjs +1 -0
- package/dist/vue-ui-tiremarks-vdPQYiDp.js +303 -0
- package/dist/vue-ui-treemap-3FNUlKxL.js +816 -0
- package/dist/vue-ui-treemap-Cv0TSFQa.cjs +1 -0
- package/dist/vue-ui-vertical-bar-C--Ma0Dw.cjs +4 -0
- package/dist/{vue-ui-vertical-bar-CVZI3v1Y.js → vue-ui-vertical-bar-DwxpB46q.js} +312 -288
- package/dist/vue-ui-waffle-CKM0QyJN.cjs +1 -0
- package/dist/vue-ui-waffle-XecHJIc-.js +782 -0
- package/dist/vue-ui-wheel-Bbih5sSL.js +282 -0
- package/dist/vue-ui-wheel-C0dJrzOJ.cjs +1 -0
- package/dist/vue-ui-word-cloud-Cfd2wxsT.cjs +1 -0
- package/dist/vue-ui-word-cloud-DnhXUn5x.js +598 -0
- package/dist/vue-ui-xy-BDpqVzAq.cjs +3 -0
- package/dist/{vue-ui-xy-D3TaTkPR.js → vue-ui-xy-CqlRuFMc.js} +775 -751
- package/dist/{vue-ui-xy-canvas-ClETpddw.js → vue-ui-xy-canvas-C8c2X5fk.js} +409 -385
- package/dist/vue-ui-xy-canvas-Cansjd3L.cjs +9 -0
- package/package.json +1 -1
- package/dist/BaseIcon-7IlvRUX2.cjs +0 -1
- package/dist/Legend-CHQgjBuK.cjs +0 -1
- package/dist/Title-BHmTg9iK.cjs +0 -1
- package/dist/index-Dfhvf8hT.cjs +0 -9
- package/dist/usePrinter-BQQasUin.cjs +0 -1
- package/dist/vue-data-ui-BdSFeW_X.js +0 -256
- package/dist/vue-data-ui-BgVPGbxq.cjs +0 -9
- package/dist/vue-ui-3d-bar-DhHuwXZ1.cjs +0 -19
- package/dist/vue-ui-age-pyramid-DaenyRp2.cjs +0 -1
- package/dist/vue-ui-candlestick-CnVzd826.cjs +0 -2
- package/dist/vue-ui-chestnut-CLnJ0jmo.cjs +0 -6
- package/dist/vue-ui-donut-C4ek9m3R.cjs +0 -1
- package/dist/vue-ui-donut-evolution-B4TkwvNq.cjs +0 -1
- package/dist/vue-ui-dumbbell-Cn3spRSv.cjs +0 -9
- package/dist/vue-ui-flow-D00VdtGU.cjs +0 -1
- package/dist/vue-ui-flow-DreN8go4.js +0 -484
- package/dist/vue-ui-galaxy-DVN-S67V.cjs +0 -1
- package/dist/vue-ui-gauge-DYZYFzHP.cjs +0 -1
- package/dist/vue-ui-gauge-DoTctAHq.js +0 -494
- package/dist/vue-ui-heatmap-ldCySJFf.cjs +0 -1
- package/dist/vue-ui-molecule-DP9jhODZ.cjs +0 -1
- package/dist/vue-ui-molecule-Dpu7Xmu5.js +0 -774
- package/dist/vue-ui-mood-radar-BR0INhYL.cjs +0 -1
- package/dist/vue-ui-nested-donuts-CwIsGnyH.cjs +0 -17
- package/dist/vue-ui-onion-DjEChSmi.cjs +0 -5
- package/dist/vue-ui-parallel-coordinate-plot-B8Kl6AMk.cjs +0 -8
- package/dist/vue-ui-quadrant-CmdbW8yZ.cjs +0 -1
- package/dist/vue-ui-quick-chart-DcEk6Ho7.cjs +0 -15
- package/dist/vue-ui-radar-TjgO9_LA.cjs +0 -1
- package/dist/vue-ui-relation-circle-f0fKvSSw.js +0 -325
- package/dist/vue-ui-relation-circle-x4sKnxbi.cjs +0 -1
- package/dist/vue-ui-rings-B3mUyyQ9.cjs +0 -2
- package/dist/vue-ui-rings-M1PUv5Wu.js +0 -569
- package/dist/vue-ui-scatter-DF_nobsG.cjs +0 -1
- package/dist/vue-ui-stackbar-BF0M1KJf.js +0 -915
- package/dist/vue-ui-stackbar-BGmTwxvv.cjs +0 -6
- package/dist/vue-ui-strip-plot-DT9Od_To.cjs +0 -1
- package/dist/vue-ui-thermometer-BOs1_H4X.js +0 -416
- package/dist/vue-ui-thermometer-Biv2CIsy.cjs +0 -1
- package/dist/vue-ui-tiremarks-CTMS_E0z.js +0 -279
- package/dist/vue-ui-tiremarks-YU4wuZl3.cjs +0 -1
- package/dist/vue-ui-treemap-5Dm82baA.js +0 -792
- package/dist/vue-ui-treemap-C0E1_DGA.cjs +0 -1
- package/dist/vue-ui-vertical-bar-CVZHDENz.cjs +0 -4
- package/dist/vue-ui-waffle-Bf4epEaH.js +0 -758
- package/dist/vue-ui-waffle-DD09_Fdb.cjs +0 -1
- package/dist/vue-ui-wheel-BybAQ0bR.cjs +0 -1
- package/dist/vue-ui-wheel-DMvZZCzi.js +0 -258
- package/dist/vue-ui-word-cloud-B8hdGDYI.js +0 -574
- package/dist/vue-ui-word-cloud-MQ0kgdPw.cjs +0 -1
- package/dist/vue-ui-xy-B4C0WR56.cjs +0 -3
- package/dist/vue-ui-xy-canvas-qbn0PHMN.cjs +0 -9
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./index-Dfhvf8hT.cjs"),we=require("./useNestedProp-iuDCMc2p.cjs"),Ce=require("./useResponsive-B3TrDDIG.cjs"),Be=require("./usePrinter-BQQasUin.cjs"),We=require("./Slicer-CiSmaE0_.cjs"),Ue=require("./Tooltip-DBzXz806.cjs"),Xe=require("./Title-BHmTg9iK.cjs"),Ye=require("./Legend-CHQgjBuK.cjs"),Ge=require("./vue-ui-accordion-Deyo7jw7.cjs"),Je=require("./DataTable-BwH-MU-S.cjs"),Ze=require("./vue-ui-skeleton-fqwO2mHD.cjs"),Ke=require("./PackageVersion-Djty0wb2.cjs"),Qe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),je=["id"],et=["xmlns","viewBox"],tt={key:0},at=["id"],lt=["stop-color"],ot=["stop-color"],rt=["stop-color"],st=["x1","x2","y1","y2","stroke"],nt=["x1","x2","y1","y2","stroke"],it=["x1","x2","y1","y2","stroke"],ut=["x1","x2","y1","y2","stroke"],ct=["x","y","height","rx","width","fill","stroke","stroke-width"],dt=["x","y","width","rx","height","fill","stroke","stroke-width"],vt=["x1","x2","y1","y2","stroke","stroke-width"],ht=["x1","x2","y1","y2","stroke","stroke-width"],gt=["x","y","font-size","fill","font-weight"],yt=["transform","font-size","fill","font-weight"],mt=["x","y","font-size","fill","font-weight"],bt={key:0},pt=["x","y","font-size","font-weight","fill"],ft=["x","y","font-size","fill","font-weight"],kt={key:0},xt=["x","y","font-size","font-weight","fill"],wt=["x1","x2","y1","y2","stroke"],Ct=["x","y","font-size","font-weight","fill"],Bt=["x1","x2","y1","y2","stroke"],Lt=["font-size","font-weight","fill","text-anchor","transform"],St=["text-anchor","font-size","font-weight","fill","transform"],zt=["font-size","font-weight","fill","x","y"],_t=["x","y","width","height","onClick","onMouseenter","fill"],Nt=["x","y","width","height","onClick","onMouseenter","fill"],Et={key:3,class:"vue-data-ui-watermark"},Mt=["onClick"],$t=["innerHTML"],Tt={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(G,{expose:Le,emit:J}){const y=G,{vue_ui_stackbar:Se}=c.useConfig(),E=e.computed({get(){return!!y.dataset&&y.dataset.length},set(l){return l}}),M=e.ref(null),W=e.ref(c.createUid()),O=e.ref(!1),Z=e.ref(null),U=e.ref(""),p=e.ref([]),K=e.ref(0),Q=e.ref(null),j=e.ref(null),ee=e.ref(null),te=e.ref(0),X=e.ref(!1),$=e.ref(null),T=e.ref(!1),ze=e.ref(0),_e=e.ref(0),Ne=e.ref(0);e.onMounted(()=>{Y()});const t=e.computed({get:()=>ae(),set:l=>l});function ae(){const l=we.useNestedProp({userConfig:y.config,defaultConfig:Se});let r={};return l.theme?r={...we.useNestedProp({userConfig:c.themes.vue_ui_stackbar[l.theme]||y.config,defaultConfig:l}),customPalette:c.themePalettes[l.theme]||c.palette}:r=l,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=y.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,y.config&&c.hasDeepProperty(y.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=y.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,r}e.watch(()=>y.config,l=>{t.value=ae(),Y(),ze.value+=1,_e.value+=1,Ne.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{ue()},{deep:!0});const b=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:le,isImaging:oe,generatePdf:re,generateImage:se}=Be.usePrinter({elementId:`stackbar_${W.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),D=e.ref({width:t.value.style.chart.width,height:t.value.style.chart.height,paddingRatio:{top:t.value.style.chart.padding.top/t.value.style.chart.height,right:t.value.style.chart.padding.right/t.value.style.chart.width,bottom:t.value.style.chart.padding.bottom/t.value.style.chart.height,left:t.value.style.chart.padding.left/t.value.style.chart.width}}),Ee=e.computed(()=>c.convertCustomPalette(t.value.customPalette)),ne=e.ref(null),ie=e.ref(null);e.onMounted(()=>{Y()});function Y(){if(c.objectIsEmpty(y.dataset)?c.error({componentName:"VueUiStackbar",type:"dataset"}):y.dataset.forEach((l,r)=>{c.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{E.value=!1,c.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{T.value=!0},10),t.value.responsive){const l=Ce.throttle(()=>{T.value=!1;const{width:r,height:a}=Ce.useResponsive({chart:M.value,title:t.value.style.chart.title.text?Q.value:null,legend:t.value.style.chart.legend.show?j.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?ee.value:null});D.value.width=r,D.value.height=a,clearTimeout(ie.value),ie.value=setTimeout(()=>{T.value=!0},10)});ne.value=new ResizeObserver(l),ne.value.observe(M.value.parentNode)}}const s=e.computed(()=>{const{height:l,width:r}=D.value,{right:a}=D.value.paddingRatio,o=t.value.style.chart.padding.top,n=r-r*a,i=l-t.value.style.chart.padding.bottom,m=t.value.style.chart.padding.left,S=r-m-r*a,z=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:n,bottom:i,left:m,width:S,height:z<0?0:z}}),B=e.computed(()=>y.dataset.map((l,r)=>{const a=c.convertColorToHex(l.color)||Ee.value[r]||c.palette[r]||c.palette[r%c.palette.length];return{...l,series:JSON.parse(JSON.stringify(l.series)).map(o=>t.value.style.chart.bars.distributed?Math.abs(o):o),signedSeries:l.series.map(o=>o>=0?1:-1),absoluteIndex:r,id:c.createUid(),color:a}})),L=e.computed(()=>Math.max(...B.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),u=e.ref({start:0,end:Math.max(...y.dataset.map(l=>l.series.length))});function ue(){u.value={start:0,end:Math.max(...y.dataset.map(l=>l.series.length))},te.value+=1}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(u.value.end-u.value.start):l=s.value.height/(u.value.end-u.value.start),l<=0?0:l}),V=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id))).slice(u.value.start,u.value.end)),Me=e.computed(()=>c.sumSeries(B.value.filter(l=>!p.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(u.value.start,u.value.end)),I=e.computed(()=>{const l=B.value.filter(r=>!p.value.includes(r.id));return{positive:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a>=0?a:0)}))),negative:c.sumSeries(l.map(r=>({...r,series:r.series.slice(u.value.start,u.value.end).map(a=>a<0?a:0)})))}}),w=e.computed(()=>{const l=t.value.style.chart.grid.scale.scaleMax!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMax:Math.max(...I.value.positive),r=Math.min(...I.value.negative),a=t.value.style.chart.grid.scale.scaleMin!==null&&!t.value.style.chart.bars.distributed?t.value.style.chart.grid.scale.scaleMin:[-1/0,1/0,NaN,void 0,null].includes(r)?0:r,o=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(n=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),x:s.value.left-8,horizontal_zero:s.value.left+s.value.width*(Math.abs(o.min)/(o.max+Math.abs(o.min))),horizontal_x:s.value.left+s.value.width*((n+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:n}))}),F=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)),g=e.computed(()=>{if(!E.value)return[];let l=Array(L.value).fill(0),r=Array(L.value).fill(0),a=Array(L.value).fill(0),o=Array(L.value).fill(0);const n=Math.max(...I.value.positive)||0,i=Math.min(...I.value.negative),m=[-1/0,1/0,NaN,void 0,null].includes(i)?0:i,S=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?c.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks):c.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:m>0?0:m,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:n<0?0:n,t.value.style.chart.grid.scale.ticks),{min:z,max:P}=S,_=P+(z>=0?0:Math.abs(z))||1,f=s.value.height,q=s.value.width,ke=w.value[0]?w.value[0].zero:s.value.bottom,xe=w.value[0]?w.value[0].horizontal_zero:s.value.left;return B.value.filter(R=>!p.value.includes(R.id)).map(R=>{const C=R.series.slice(u.value.start,u.value.end),Pe=R.signedSeries.slice(u.value.start,u.value.end),Re=C.map((v,h)=>s.value.left+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),Oe=C.map((v,h)=>s.value.top+d.value*h+d.value*t.value.style.chart.bars.gapRatio/4),De=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=f*k,N=ke-x-l[h],l[h]+=x):(x=f*k,N=ke+a[h],a[h]+=Math.abs(x)),N}),Ie=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;let N,x;return v>0?(x=q*k,N=xe+r[h],r[h]+=x):(x=q*k,N=xe-Math.abs(x)-o[h],o[h]+=Math.abs(x)),N}),Ae=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?f*k:f*Math.abs(k)}),He=C.map((v,h)=>{const k=t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/_;return v>0?q*k:q*Math.abs(k)}),qe=C.map(v=>Math.abs(v)).reduce((v,h)=>v+h,0);return{...R,proportions:C.map((v,h)=>t.value.style.chart.bars.distributed?(v||0)/V.value[h]:(v||0)/qe),series:C,signedSeries:Pe,x:Re,y:De,height:Ae,horizontal_width:He,horizontal_y:Oe,horizontal_x:Ie}})}),ce=e.computed(()=>Me.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function A(l,r,a,o,n){const i=n===-1&&l>=0?-l:l;return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,i,c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:i,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function de(l,r,a,o){return c.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,c.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ve(l){const r=JSON.parse(JSON.stringify(g.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));J("selectDatapoint",{datapoint:r,period:F.value[l]})}function he(l){$.value=l,O.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(n=>({name:n.name,value:n.series[l]===0?0:(n.signedSeries[l]===-1&&n.series[l]>=0?-n.series[l]:n.series[l])||null,proportion:n.proportions[l]||null,color:n.color,id:n.id})),o=a.map(n=>Math.abs(n.value)).reduce((n,i)=>n+i,0);if(c.isFunction(r)&&c.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))U.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:n,showPercentage:i,borderColor:m,roundingValue:S,roundingPercentage:z}=t.value.style.chart.tooltip;let P="";F.value[l]&&(P+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${m};padding-bottom:6px;margin-bottom:3px;">${F.value[l]}</div>`);const _=[n&&i?"(":"",n&&i?")":""];a.reverse().forEach(f=>{P+=`
|
|
2
|
-
<div style="display:flex;flex-direction:row;align-items:center;gap:4px">
|
|
3
|
-
<svg viewBox="0 0 12 12" height="14" width="14"><rect rx="1" x="0" y="0" height="12" width="12" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${f.id})`:f.color}"/></svg>
|
|
4
|
-
${f.name}${n||i?":":""} ${n?c.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:f.value,s:t.value.style.chart.bars.dataLabels.suffix,r:S}):""} ${_[0]}${i?c.dataLabel({v:isNaN(f.value/o)?0:Math.abs(f.value)/o*100,s:"%",r:z}):""}${_[1]}
|
|
5
|
-
</div>
|
|
6
|
-
`}),U.value=`<div>${P}</div>`}}function $e(l){X.value=l,K.value+=1}function ge(){b.value.showTable=!b.value.showTable}function ye(){b.value.dataLabels.show=!b.value.dataLabels.show}function me(){b.value.showTooltip=!b.value.showTooltip}function Te(){return g.value}const be=e.computed(()=>{if(g.value.length===0)return{head:[],body:[],config:{},columnNames:[]};const l=g.value.map(({name:a,color:o})=>({label:a,color:o})),r=[];for(let a=u.value.start;a<u.value.end;a+=1){const o=[t.value.style.chart.grid.x.timeLabels.values[a]||a+1];B.value.forEach(n=>{o.push(Number((n.series[a]||0).toFixed(t.value.table.td.roundingValue)))}),r.push(o)}return{head:l,body:r}});function pe(){const l=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[""]],r=["",...be.value.head.map(i=>i.label)],a=be.value.body,o=l.concat([r]).concat(a),n=c.createCsvContent(o);c.downloadCsv({csvContent:n,title:t.value.style.chart.title.text||"vue-ui-stackbar"})}const H=e.computed(()=>{const l=[""].concat(g.value.map(n=>n.name)).concat(' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>');let r=[];for(let n=0;n<L.value;n+=1){const i=g.value.map(m=>m.series[n]??0).reduce((m,S)=>m+S,0);r.push([t.value.style.chart.grid.x.timeLabels.values.slice(u.value.start,u.value.end)[n]??n+1].concat(g.value.map(m=>(m.series[n]??0).toFixed(t.value.table.td.roundingValue))).concat((i??0).toFixed(t.value.table.td.roundingValue)))}const 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},o=[t.value.table.columnNames.period].concat(g.value.map(n=>n.name)).concat(t.value.table.columnNames.total);return{head:l,body:r.slice(0,u.value.end-u.value.start),config:a,colNames:o}});function Ve(l,r){if(J("selectLegend",g.value.find(a=>a.absoluteIndex===l)),p.value.includes(r.id))p.value=p.value.filter(a=>a!==r.id);else{if(p.value.length===B.value.length-1)return;p.value.push(r.id)}}const fe=e.computed(()=>B.value.map((l,r)=>({...l,shape:"square"})).map(l=>({...l,opacity:p.value.includes(l.id)?.5:1,segregate:()=>Ve(l.absoluteIndex,l),isSegregated:p.value.includes(l.id)}))),Fe=e.computed(()=>({cy:"stackbar-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""}));return Le({getData:Te,generatePdf:re,generateCsv:pe,generateImage:se,toggleTable:ge,toggleLabels:ye,toggleTooltip:me}),(l,r)=>(e.openBlock(),e.createElementBlock("div",{id:`stackbar_${W.value}`,ref_key:"stackbarChart",ref:M,class:e.normalizeClass({"vue-ui-stackbar":!0,"vue-data-ui-wrapper-fullscreen":X.value}),style:e.normalizeStyle(`background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}; position: relative; ${t.value.responsive?"height: 100%":""}`)},[e.renderSlot(l.$slots,"userConfig",{},void 0,!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"chartTitle",ref:Q,style:"width:100%;background:transparent;padding-bottom:24px"},[e.createVNode(Xe._sfc_main,{config:{title:{cy:"stackbar-title",...t.value.style.chart.title},subtitle:{cy:"stackbar-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"])],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&E.value?(e.openBlock(),e.createBlock(Be.UserOptions,{ref:"details",key:`user_option_${K.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(le),isImaging:e.unref(oe),uid:W.value,hasTooltip:t.value.style.chart.tooltip.show&&t.value.userOptions.buttons.tooltip,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasLabel:t.value.userOptions.buttons.labels,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:X.value,chartElement:M.value,position:t.value.userOptions.position,isTooltip:b.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},onToggleFullscreen:$e,onGeneratePdf:e.unref(re),onGenerateCsv:pe,onGenerateImage:e.unref(se),onToggleTable:ge,onToggleLabels:ye,onToggleTooltip:me},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:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:o})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasLabel","hasFullscreen","isFullscreen","chartElement","position","isTooltip","titles","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(c.XMLNS),viewBox:`0 0 ${s.value.chartWidth<=0?10:s.value.chartWidth} ${s.value.chartHeight<=0?10:s.value.chartHeight}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ke._sfc_main),t.value.style.chart.bars.gradient.show?(e.openBlock(),e.createElementBlock("defs",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,o)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`gradient_${a.id}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,lt),e.createElementVNode("stop",{offset:"61.8%","stop-color":e.unref(c.lightenHexColor)(a.color,t.value.style.chart.bars.gradient.intensity/100)},null,8,ot),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,rt)],8,at))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.x.showHorizontalLines&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left,x2:s.value.right,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,st))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.showHorizontalLines&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(u.value.end-u.value.start+1,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left,x2:s.value.right,y1:s.value.top+d.value*o,y2:s.value.top+d.value*o,stroke:t.value.style.chart.grid.y.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,nt))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.showVerticalLines&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(u.value.end-u.value.start+1,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left+d.value*o,x2:s.value.left+d.value*o,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.chart.grid.y.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,it))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.showHorizontalLines&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:4},e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:a.horizontal_x,x2:a.horizontal_x,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,ut))),256)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.x,(n,i)=>(e.openBlock(),e.createElementBlock("rect",{x:n,y:a.y[i]<0?0:a.y[i],height:a.height[i]<0?1e-4:a.height[i],rx:t.value.style.chart.bars.borderRadius>a.height[i]/2?(a.height[i]<0?0:a.height[i])/2:t.value.style.chart.bars.borderRadius,width:d.value*(1-t.value.style.chart.bars.gapRatio/2),fill:t.value.style.chart.bars.gradient.show?`url(#gradient_${a.id})`:a.color,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.bars.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-data-ui-bar-animated":t.value.useCssAnimation,"vue-data-ui-bar-transition":T.value})},null,10,ct))),256)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.horizontal_x,(n,i)=>(e.openBlock(),e.createElementBlock("rect",{x:n,y:a.horizontal_y[i]<0?0:a.horizontal_y[i],width:a.horizontal_width[i]<0?1e-4:a.horizontal_width[i],rx:t.value.style.chart.bars.borderRadius>a.height[i]/2?(a.height[i]<0?0:a.height[i])/2:t.value.style.chart.bars.borderRadius,height:d.value*(1-t.value.style.chart.bars.gapRatio/2),fill:t.value.style.chart.bars.gradient.show?`url(#gradient_${a.id})`:a.color,stroke:t.value.style.chart.backgroundColor,"stroke-width":t.value.style.chart.bars.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"vue-data-ui-bar-animated":t.value.useCssAnimation,"vue-data-ui-bar-transition":T.value})},null,10,dt))),256))]))),256)),t.value.style.chart.grid.x.showAxis?(e.openBlock(),e.createElementBlock("line",{key:5,x1:s.value.left,x2:s.value.right,y1:s.value.bottom,y2:s.value.bottom,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":t.value.style.chart.grid.x.axisThickness,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,vt)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.showAxis&&!t.value.style.chart.bars.distributed?(e.openBlock(),e.createElementBlock("line",{key:6,x1:s.value.left,x2:s.value.left,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.chart.grid.y.axisColor,"stroke-width":t.value.style.chart.grid.y.axisThickness,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,ht)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.axisName.show&&t.value.style.chart.grid.x.axisName.text?(e.openBlock(),e.createElementBlock("text",{key:7,x:s.value.left+s.value.width/2,y:s.value.chartHeight+t.value.style.chart.grid.x.axisName.offsetY,"font-size":t.value.style.chart.grid.x.axisName.fontSize,fill:t.value.style.chart.grid.x.axisName.color,"font-weight":t.value.style.chart.grid.x.axisName.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.grid.x.axisName.text),9,gt)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.axisName.show&&t.value.style.chart.grid.y.axisName.text?(e.openBlock(),e.createElementBlock("text",{key:8,transform:`translate(${t.value.style.chart.grid.y.axisName.fontSize+t.value.style.chart.grid.y.axisName.offsetX}, ${s.value.top+s.value.height/2}) rotate(-90)`,"font-size":t.value.style.chart.grid.y.axisName.fontSize,fill:t.value.style.chart.grid.y.axisName.color,"font-weight":t.value.style.chart.grid.y.axisName.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.grid.y.axisName.text),9,yt)):e.createCommentVNode("",!0),b.value.dataLabels.show&&t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:9},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.x,(n,i)=>(e.openBlock(),e.createElementBlock("text",{x:n+d.value*(1-t.value.style.chart.bars.gapRatio/2)/2,y:a.y[i]+a.height[i]/2+t.value.style.chart.bars.dataLabels.fontSize/3,"font-size":t.value.style.chart.bars.dataLabels.fontSize,fill:t.value.style.chart.bars.dataLabels.adaptColorToBackground?e.unref(c.adaptColorToBackground)(a.color):t.value.style.chart.bars.dataLabels.color,"font-weight":t.value.style.chart.bars.dataLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.bars.showDistributedPercentage&&t.value.style.chart.bars.distributed?de(a.proportions[i]*100,a,o,i):A(a.series[i],a,o,i,a.signedSeries[i])),9,mt))),256))]))),256)),t.value.style.chart.bars.totalValues.show&&g.value.length>1?(e.openBlock(),e.createElementBlock("g",bt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value,(a,o)=>(e.openBlock(),e.createElementBlock("text",{x:s.value.left+d.value*o+d.value/2,y:s.value.top-t.value.style.chart.bars.totalValues.fontSize/3,"text-anchor":"middle","font-size":t.value.style.chart.bars.totalValues.fontSize,"font-weight":t.value.style.chart.bars.totalValues.bold?"bold":"normal",fill:t.value.style.chart.bars.totalValues.color},e.toDisplayString(A(a.value,a,o,a.sign)),9,pt))),256))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),b.value.dataLabels.show&&t.value.orientation==="horizontal"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:10},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.horizontal_x,(n,i)=>(e.openBlock(),e.createElementBlock("text",{x:n+(a.horizontal_width[i]<0?1e-4:a.horizontal_width[i])/2,y:a.horizontal_y[i]+d.value*(1-t.value.style.chart.bars.gapRatio/2)/2+t.value.style.chart.bars.dataLabels.fontSize/3,"font-size":t.value.style.chart.bars.dataLabels.fontSize,fill:t.value.style.chart.bars.dataLabels.adaptColorToBackground?e.unref(c.adaptColorToBackground)(a.color):t.value.style.chart.bars.dataLabels.color,"font-weight":t.value.style.chart.bars.dataLabels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(t.value.style.chart.bars.showDistributedPercentage&&t.value.style.chart.bars.distributed?de(a.proportions[i]*100,a,o,i):A(a.series[i],a,o,i,a.signedSeries[i])),9,ft))),256))]))),256)),t.value.style.chart.bars.totalValues.show&&g.value.length>1?(e.openBlock(),e.createElementBlock("g",kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ce.value,(a,o)=>(e.openBlock(),e.createElementBlock("text",{x:s.value.right+t.value.style.chart.bars.totalValues.fontSize/3,y:s.value.top+d.value*o+d.value/2,"text-anchor":"start","font-size":t.value.style.chart.bars.totalValues.fontSize,"font-weight":t.value.style.chart.bars.totalValues.bold?"bold":"normal",fill:t.value.style.chart.bars.totalValues.color},e.toDisplayString(A(a.value,a,o,a.sign)),9,xt))),256))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.axisLabels.show&&!t.value.style.chart.bars.distributed&&t.value.orientation==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:11},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:s.value.left,x2:s.value.left-6,y1:a.y,y2:a.y,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1},null,8,wt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("text",{x:a.x,y:a.y+t.value.style.chart.grid.y.axisLabels.fontSize/3,"font-size":t.value.style.chart.grid.y.axisLabels.fontSize,"font-weight":t.value.style.chart.grid.y.axisLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.y.axisLabels.color,"text-anchor":"end"},e.toDisplayString(e.unref(c.dataLabel)({p:t.value.style.chart.bars.dataLabels.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.grid.y.axisLabels.rounding})),9,Ct))),256))],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.y.axisLabels.show&&!t.value.style.chart.bars.distributed&&t.value.orientation==="horizontal"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:12},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("line",{x1:a.horizontal_x,x2:a.horizontal_x,y1:s.value.bottom,y2:s.value.bottom+6,stroke:t.value.style.chart.grid.x.axisColor,"stroke-width":1,"stroke-linecap":"round"},null,8,Bt))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(a,o)=>(e.openBlock(),e.createElementBlock("text",{"font-size":t.value.style.chart.grid.x.timeLabels.fontSize,"font-weight":t.value.style.chart.grid.y.axisLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.y.axisLabels.color,"text-anchor":t.value.style.chart.grid.x.timeLabels.rotation>0?"start":t.value.style.chart.grid.x.timeLabels.rotation<0?"end":"middle",transform:`translate(${a.horizontal_x}, ${s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${t.value.style.chart.grid.x.timeLabels.rotation})`},e.toDisplayString(e.unref(c.dataLabel)({p:t.value.style.chart.bars.dataLabels.prefix,v:a.value,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.grid.y.axisLabels.rounding})),9,Lt))),256))],64)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.timeLabels.show&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:13},e.renderList(F.value,(a,o)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":t.value.style.chart.grid.x.timeLabels.rotation>0?"start":t.value.style.chart.grid.x.timeLabels.rotation<0?"end":"middle","font-size":t.value.style.chart.grid.x.timeLabels.fontSize,"font-weight":t.value.style.chart.grid.x.timeLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.x.timeLabels.color,transform:`translate(${s.value.left+d.value*o+d.value/2}, ${s.value.bottom+t.value.style.chart.grid.x.timeLabels.fontSize*1.3+t.value.style.chart.grid.x.timeLabels.offsetY}), rotate(${t.value.style.chart.grid.x.timeLabels.rotation})`},e.toDisplayString(a),9,St))),256)):e.createCommentVNode("",!0),t.value.style.chart.grid.x.timeLabels.show&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:14},e.renderList(F.value,(a,o)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"end","font-size":t.value.style.chart.grid.y.axisLabels.fontSize,"font-weight":t.value.style.chart.grid.y.axisLabels.bold?"bold":"normal",fill:t.value.style.chart.grid.y.axisLabels.color,x:s.value.left-8,y:s.value.top+d.value*o+d.value/2+t.value.style.chart.grid.y.axisLabels.fontSize/3},e.toDisplayString(a),9,zt))),256)):e.createCommentVNode("",!0),b.value.showTooltip&&t.value.orientation==="vertical"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:15},e.renderList(u.value.end-u.value.start,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{x:s.value.left+o*d.value,y:s.value.top,width:d.value,height:s.value.height<0?0:s.value.height,onClick:n=>ve(o),onMouseenter:n=>he(o),onMouseleave:r[0]||(r[0]=n=>{$.value=null,O.value=!1}),fill:o===$.value?t.value.style.chart.highlighter.color:"transparent",style:e.normalizeStyle({opacity:t.value.style.chart.highlighter.opacity/100})},null,44,_t))),256)):e.createCommentVNode("",!0),b.value.showTooltip&&t.value.orientation==="horizontal"?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:16},e.renderList(u.value.end-u.value.start,(a,o)=>(e.openBlock(),e.createElementBlock("rect",{x:s.value.left,y:s.value.top+o*d.value,width:s.value.width<0?0:s.value.width,height:d.value,onClick:n=>ve(o),onMouseenter:n=>he(o),onMouseleave:r[1]||(r[1]=n=>{$.value=null,O.value=!1}),fill:o===$.value?t.value.style.chart.highlighter.color:"transparent",style:e.normalizeStyle({opacity:t.value.style.chart.highlighter.opacity/100})},null,44,Nt))),256)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",e.normalizeProps(e.guardReactiveProps({...s.value})),void 0,!0)],12,et)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Et,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(le)||e.unref(oe)})),void 0,!0)])):e.createCommentVNode("",!0),E.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ze.default,{key:4,config:{type:"bar",style:{backgroundColor:t.value.style.chart.backgroundColor,bar:{axis:{color:"#CCCCCC"},color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartSlicer",ref:ee,style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor}`),"data-html2canvas-ignore":""},[t.value.style.chart.zoom.show&&L.value>1?(e.openBlock(),e.createBlock(We.Slicer,{key:`slicer_${te.value}`,background:t.value.style.chart.zoom.color,borderColor:t.value.style.chart.backgroundColor,fontSize:t.value.style.chart.zoom.fontSize,useResetSlot:t.value.style.chart.zoom.useResetSlot,labelLeft:t.value.style.chart.grid.x.timeLabels.values[u.value.start]?t.value.style.chart.grid.x.timeLabels.values[u.value.start]:"",labelRight:t.value.style.chart.grid.x.timeLabels.values[u.value.end-1]?t.value.style.chart.grid.x.timeLabels.values[u.value.end-1]:"",textColor:t.value.style.chart.color,inputColor:t.value.style.chart.zoom.color,selectColor:t.value.style.chart.zoom.highlightColor,max:Math.max(...G.dataset.map(a=>a.series.length)),min:0,valueStart:u.value.start,valueEnd:u.value.end,start:u.value.start,"onUpdate:start":r[2]||(r[2]=a=>u.value.start=a),end:u.value.end,"onUpdate:end":r[3]||(r[3]=a=>u.value.end=a),onReset:ue},{"reset-action":e.withCtx(({reset:a})=>[e.renderSlot(l.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:a})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end"])):e.createCommentVNode("",!0)],4),e.createVNode(Ue._sfc_main,{show:b.value.showTooltip&&O.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,fontSize:t.value.style.chart.tooltip.fontSize,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:M.value,content:U.value,isCustom:e.unref(c.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","fontSize","borderRadius","borderColor","borderWidth","backgroundOpacity","position","offsetY","parent","content","isCustom"]),e.createElementVNode("div",{ref_key:"chartLegend",ref:j},[t.value.style.chart.legend.show&&E.value?(e.openBlock(),e.createBlock(Ye.Legend,{key:0,legendSet:fe.value,config:Fe.value,onClickMarker:r[4]||(r[4]=({legend:a})=>a.segregate())},{item:e.withCtx(({legend:a})=>[e.createElementVNode("div",{onClick:o=>a.segregate(),style:e.normalizeStyle(`opacity:${p.value.includes(a.id)?.5:1}`)},e.toDisplayString(a.name),13,Mt)]),_:1},8,["legendSet","config"])):e.renderSlot(l.$slots,"legend",{key:1,legend:fe.value},void 0,!0)],512),u.value.end-u.value.start<200?(e.openBlock(),e.createBlock(Ge.default,{key:5,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(Je.DataTable,{colNames:H.value.colNames,head:H.value.head,body:H.value.body,config:H.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:r[5]||(r[5]=a=>b.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createElementVNode("div",{innerHTML:a},null,8,$t)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(isNaN(Number(a))?a:e.unref(c.dataLabel)({p:t.value.style.chart.bars.dataLabels.prefix,v:a,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.table.td.roundingValue})),1)]),_:1},8,["colNames","head","body","config","title"])]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,je))}},Vt=Qe._export_sfc(Tt,[["__scopeId","data-v-a4f47dd7"]]);exports.default=Vt;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-Dfhvf8hT.cjs"),K=require("./useResponsive-B3TrDDIG.cjs"),ie=require("./Title-BHmTg9iK.cjs"),Q=require("./usePrinter-BQQasUin.cjs"),ce=require("./Tooltip-DBzXz806.cjs"),ve=require("./DataTable-BwH-MU-S.cjs"),de=require("./vue-ui-skeleton-fqwO2mHD.cjs"),he=require("./Shape-DQ0Hh2Gg.cjs"),pe=require("./vue-ui-accordion-Deyo7jw7.cjs"),Z=require("./useNestedProp-iuDCMc2p.cjs"),me=require("./PackageVersion-Djty0wb2.cjs"),fe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=["id"],be=["xmlns","viewBox"],ge={key:0},ke={key:0},xe=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Ce={key:1},we=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Be=["x1","x2","y1","y2","stroke","stroke-width"],_e=["x1","x2","y1","y2","stroke","stroke-width"],Ne=["x","y","fill","font-size"],Se=["x","y","font-size","fill"],$e=["fill","font-size","transform"],Le=["fill","font-size","x","y"],Te=["x1","x2","y1","y2","stroke"],Pe=["cx","cy","fill"],Ee=["cx","cy","fill"],ze=["id"],Ve=["stop-color"],Ae=["stop-color"],Fe=["stop-color"],Oe={key:0},De=["x","y","font-size","fill"],Me={key:3,class:"vue-data-ui-watermark"},We=["innerHTML"],Ie={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ee,{expose:te,emit:le}){const v=ee,{vue_ui_strip_plot:ae}=o.useConfig(),p=e.computed({get(){return!!v.dataset&&v.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),O=e.ref(0),D=e.ref(0),t=e.computed({get:()=>M(),set:l=>l});function M(){const l=Z.useNestedProp({userConfig:v.config,defaultConfig:ae});return l.theme?{...Z.useNestedProp({userConfig:o.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}e.watch(()=>v.config,l=>{t.value=M(),W(),O.value+=1,D.value+=1},{deep:!0});const C=e.ref(null);e.onMounted(()=>{W()});function W(){if(o.objectIsEmpty(v.dataset)?o.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(a=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:a,index:s})}),l.plots&&l.plots.forEach((a,n)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,o.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=K.throttle(()=>{const{width:s,height:a}=K.useResponsive({chart:b.value,title:t.value.style.chart.title.text?A.value:null});w.value=a,y.value.width=s,y.value.height=a,k.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=o.translateSize({relator:Math.min(a,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})});C.value=new ResizeObserver(l),C.value.observe(b.value.parentNode)}F.value=!0,setTimeout(()=>{g.value=!1},oe.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:I,isImaging:G,generatePdf:q,generateImage:R}=Q.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot"}),U=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}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),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),y=e.ref({width:k.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),r=e.computed(()=>{const l=k.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:k.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:k.value,absoluteHeight:w.value,absoluteWidth:l}}),_=e.computed(()=>p.value?v.dataset.map((l,s)=>{const a=o.createUid();return{...l,id:a,color:l.color?o.convertColorToHex(l.color):U.value[s]||o.palette[s]||o.palette[s%o.palette.length],plots:l.plots.map(n=>({...n,value:o.checkNaN(n.value),parentId:a,color:l.color?o.convertColorToHex(l.color):U.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}))}))),oe=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)),re=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}))}))),H=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 se({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 N=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 j(){e.nextTick(()=>{const l=N.value.head.map((n,u)=>[[n.name],[N.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 S=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=N.value.head.map((u,f)=>{const $=o.dataLabel({p:t.value.style.chart.labels.prefix,v:N.value.body[f],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},$]}),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 ne(l){x.value=l,V.value+=1}function ue(){return h.value}function X(){c.value.showTable=!c.value.showTable}function Y(){c.value.dataLabels.show=!c.value.dataLabels.show}function J(){c.value.showTooltip=!c.value.showTooltip}return te({getData:ue,generatePdf:q,generateCsv:j,generateImage:R,toggleTable:X,toggleLabels:Y,toggleTooltip:J}),(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:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ie._sfc_main,{key:`title_${O.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&p.value?(e.openBlock(),e.createBlock(Q.UserOptions,{ref:"details",key:`user_option_${V.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(I),isImaging:e.unref(G),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,position:t.value.userOptions.position,onToggleFullscreen:ne,onGeneratePdf:e.unref(q),onGenerateCsv:j,onGenerateImage:e.unref(R),onToggleTable:X,onToggleLabels:Y,onToggleTooltip:J},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","position","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 ${y.value.width<=0?10:y.value.width} ${y.value.height<=0?10:y.value.height}`,style:e.normalizeStyle(`max-width:100%; overflow: visible; background:transparent;color:${t.value.style.chart.color};`)},[e.createVNode(me._sfc_main),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",ge,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.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,xe))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",Ce,[(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,we))),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,Be),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,_e)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H.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,Ne))),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,Se))),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,$e)):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,Le)):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,Te),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,Pe),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,Ee)],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,Ve),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(o.darkenHexColor)(a.color,.1)},null,8,Ae),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,Fe)],8,ze))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(a,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,f)=>(e.openBlock(),e.createBlock(he._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:$=>se({datapoint:u,seriesIndex:f}),onMouseleave:s[0]||(s[0]=$=>{T.value=!1,i.value=null}),onClick:$=>le("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:${f*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",Oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.plots,(u,f)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f===a.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&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:f}):""),13,De)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:r.value},void 0,!0)],14,be)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Me,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(G)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(de.default,{key:4,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),e.createVNode(ce._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(pe.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.openBlock(),e.createBlock(ve.DataTable,{key:`table_${D.value}`,colNames:S.value.colNames,head:S.value.head,body:S.value.body,config:S.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,We)]),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,ye))}},Ge=fe._export_sfc(Ie,[["__scopeId","data-v-85774736"]]);exports.default=Ge;
|
|
@@ -1,416 +0,0 @@
|
|
|
1
|
-
import { useCssVars as he, computed as h, onMounted as de, ref as m, watch as ve, openBlock as o, createElementBlock as n, normalizeClass as $, normalizeStyle as ye, createBlock as U, createCommentVNode as c, unref as v, createSlots as fe, withCtx as q, renderSlot as x, normalizeProps as H, guardReactiveProps as X, createVNode as me, createElementVNode as d, Fragment as F, renderList as R, toDisplayString as ge } from "vue";
|
|
2
|
-
import { u as pe, o as ke, e as J, g as xe, c as _e, t as be, a as we, p as _, b as Ce, v as f, d as P, X as $e, s as Fe, i as Pe, f as Ie } from "./index-B0CpCD8z.js";
|
|
3
|
-
import { _ as Ye } from "./Title-DlVZnHjs.js";
|
|
4
|
-
import { u as Oe, U as Me } from "./usePrinter-Dr30K4cu.js";
|
|
5
|
-
import Ne from "./vue-ui-skeleton-DEv_1TFa.js";
|
|
6
|
-
import { u as K } from "./useNestedProp-DGWP4D-K.js";
|
|
7
|
-
import { _ as Se } from "./PackageVersion-wB6dCDZw.js";
|
|
8
|
-
import { _ as Ue } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
|
-
const qe = ["id"], Le = {
|
|
10
|
-
key: 0,
|
|
11
|
-
style: "width:100%"
|
|
12
|
-
}, Te = ["xmlns", "viewBox"], Ge = {
|
|
13
|
-
id: "vueUiPill",
|
|
14
|
-
clipPathUnits: "objectBoundingBox"
|
|
15
|
-
}, Ve = ["fill"], We = ["id"], Ee = ["stop-color"], ze = ["stop-color"], Be = ["stop-color"], je = { "clip-path": "url(#vueUiPill)" }, Ae = ["x", "y", "height", "width"], De = ["x", "y", "height", "width", "fill"], He = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], Xe = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], Re = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], Je = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], Ke = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], Qe = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], Ze = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], et = ["x1", "x2", "y1", "y2", "stroke-width", "stroke"], tt = ["x", "y", "height", "width"], st = ["y", "x", "fill", "font-size", "font-weight"], lt = {
|
|
16
|
-
key: 3,
|
|
17
|
-
class: "vue-data-ui-watermark"
|
|
18
|
-
}, at = {
|
|
19
|
-
__name: "vue-ui-thermometer",
|
|
20
|
-
props: {
|
|
21
|
-
dataset: {
|
|
22
|
-
type: Object,
|
|
23
|
-
default() {
|
|
24
|
-
return {};
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
config: {
|
|
28
|
-
type: Object,
|
|
29
|
-
default() {
|
|
30
|
-
return {};
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
setup(b, { expose: Q }) {
|
|
35
|
-
const a = b;
|
|
36
|
-
he((s) => ({
|
|
37
|
-
ff9f54a6: ae.value,
|
|
38
|
-
"727be881": le.value,
|
|
39
|
-
"673ba9ae": se.value
|
|
40
|
-
}));
|
|
41
|
-
const { vue_ui_thermometer: Z } = pe(), I = h(() => !!a.dataset && Object.keys(a.dataset).length);
|
|
42
|
-
de(() => {
|
|
43
|
-
L();
|
|
44
|
-
});
|
|
45
|
-
function L() {
|
|
46
|
-
ke(a.dataset) ? J({
|
|
47
|
-
componentName: "VueUiThermometer",
|
|
48
|
-
type: "dataset"
|
|
49
|
-
}) : xe({
|
|
50
|
-
datasetObject: a.dataset,
|
|
51
|
-
requiredAttributes: ["value", "from", "to"]
|
|
52
|
-
}).forEach((s) => {
|
|
53
|
-
J({
|
|
54
|
-
componentName: "VueUiThermometer",
|
|
55
|
-
type: "datasetAttribute",
|
|
56
|
-
property: s
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
const g = m(_e()), T = m(null), G = m(0), V = m(0), e = h({
|
|
61
|
-
get: () => W(),
|
|
62
|
-
set: (s) => s
|
|
63
|
-
});
|
|
64
|
-
function W() {
|
|
65
|
-
const s = K({
|
|
66
|
-
userConfig: a.config,
|
|
67
|
-
defaultConfig: Z
|
|
68
|
-
});
|
|
69
|
-
return s.theme ? {
|
|
70
|
-
...K({
|
|
71
|
-
userConfig: be.vue_ui_thermometer[s.theme] || a.config,
|
|
72
|
-
defaultConfig: s
|
|
73
|
-
}),
|
|
74
|
-
customPalette: we[s.theme] || _
|
|
75
|
-
} : s;
|
|
76
|
-
}
|
|
77
|
-
ve(() => a.config, (s) => {
|
|
78
|
-
e.value = W(), L(), V.value += 1;
|
|
79
|
-
}, { deep: !0 });
|
|
80
|
-
const { isPrinting: E, isImaging: z, generatePdf: B, generateImage: j } = Oe({
|
|
81
|
-
elementId: `thermometer__${g.value}`,
|
|
82
|
-
fileName: e.value.style.title.text || "vue-ui-thermometer"
|
|
83
|
-
}), w = h(() => Ce(e.value.customPalette)), ee = h(() => e.value.style.chart.thermometer.width), y = h(() => a.dataset.steps || 10), i = m({
|
|
84
|
-
top: e.value.style.chart.padding.top,
|
|
85
|
-
left: e.value.style.chart.padding.left,
|
|
86
|
-
right: e.value.style.chart.padding.right,
|
|
87
|
-
bottom: e.value.style.chart.padding.bottom
|
|
88
|
-
});
|
|
89
|
-
function C(s, r, t) {
|
|
90
|
-
const u = [], N = A(s), S = A(r);
|
|
91
|
-
for (let k = 0; k < t; k++) {
|
|
92
|
-
const ue = Y(N.red, S.red, k, t), ne = Y(N.green, S.green, k, t), ie = Y(N.blue, S.blue, k, t), ce = `#${O(ue)}${O(ne)}${O(ie)}`;
|
|
93
|
-
u.push(ce);
|
|
94
|
-
}
|
|
95
|
-
return u;
|
|
96
|
-
}
|
|
97
|
-
function A(s) {
|
|
98
|
-
const r = s.slice(1);
|
|
99
|
-
return {
|
|
100
|
-
red: parseInt(r.slice(0, 2), 16),
|
|
101
|
-
green: parseInt(r.slice(2, 4), 16),
|
|
102
|
-
blue: parseInt(r.slice(4, 6), 16)
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
function Y(s, r, t, u) {
|
|
106
|
-
return Math.round(s + (r - s) * t / u);
|
|
107
|
-
}
|
|
108
|
-
function O(s) {
|
|
109
|
-
return s.toString(16).padStart(2, "0");
|
|
110
|
-
}
|
|
111
|
-
const l = h(() => {
|
|
112
|
-
const s = ee.value + i.value.left + i.value.right, r = e.value.style.chart.height;
|
|
113
|
-
return {
|
|
114
|
-
width: s,
|
|
115
|
-
left: i.value.left,
|
|
116
|
-
right: s - i.value.right,
|
|
117
|
-
top: i.value.top,
|
|
118
|
-
bottom: r - i.value.bottom,
|
|
119
|
-
height: r
|
|
120
|
-
};
|
|
121
|
-
}), te = h(() => l.value), M = h(() => {
|
|
122
|
-
const s = f(a.dataset.from) < 0 ? Math.abs(f(a.dataset.from)) : f(a.dataset.from), r = f(a.dataset.to) < 0 ? Math.abs(f(a.dataset.to)) : f(a.dataset.to);
|
|
123
|
-
let t = 0;
|
|
124
|
-
return f(a.dataset.to) > 0 ? t = s + r : s > r ? t = s - r : t = r - s, (1 - (Math.abs(f(a.dataset.from)) + f(a.dataset.value)) / t) * (l.value.height - i.value.top - i.value.bottom);
|
|
125
|
-
}), se = h(() => `${M.value}px`), le = h(() => `${l.value.height - e.value.style.chart.padding.bottom - i.value.top}px`), ae = h(() => `${e.value.style.chart.animation.speedMs}ms`), oe = h(() => {
|
|
126
|
-
if (a.dataset.colors) {
|
|
127
|
-
if (!a.dataset.colors.from)
|
|
128
|
-
return C(w.value[0] || _[0], P(a.dataset.colors.to), y.value || 10);
|
|
129
|
-
if (!a.dataset.colors.to)
|
|
130
|
-
return C(P(a.dataset.colors.from), w.value[1] || _[1], y.value || 10);
|
|
131
|
-
} else
|
|
132
|
-
return C(w.value[1] || _[1], w.value[0] || _[0], y.value || 10);
|
|
133
|
-
return C(P(a.dataset.colors.from), P(a.dataset.colors.to), y.value || 10);
|
|
134
|
-
}), D = h(() => {
|
|
135
|
-
const s = [];
|
|
136
|
-
let r = 0;
|
|
137
|
-
const t = l.value.height - i.value.top - i.value.bottom;
|
|
138
|
-
for (let u = 0; u < t - 1; u += t / y.value)
|
|
139
|
-
s.push({
|
|
140
|
-
x: l.value.left,
|
|
141
|
-
y: l.value.top + u,
|
|
142
|
-
qYLess: l.value.top + u + t / y.value / 4,
|
|
143
|
-
halfY: l.value.top + u + t / y.value / 2,
|
|
144
|
-
qYMore: l.value.top + u + t / y.value / 4 * 3,
|
|
145
|
-
color: oe.value[r],
|
|
146
|
-
height: t / y.value
|
|
147
|
-
}), r += 1;
|
|
148
|
-
return s;
|
|
149
|
-
}), p = m(!1);
|
|
150
|
-
function re(s) {
|
|
151
|
-
p.value = s, G.value += 1;
|
|
152
|
-
}
|
|
153
|
-
return Q({
|
|
154
|
-
generatePdf: B,
|
|
155
|
-
generateImage: j
|
|
156
|
-
}), (s, r) => (o(), n("div", {
|
|
157
|
-
ref_key: "thermoChart",
|
|
158
|
-
ref: T,
|
|
159
|
-
class: $(`vue-ui-thermometer ${p.value ? "vue-data-ui-wrapper-fullscreen" : ""}`),
|
|
160
|
-
style: ye(`width:100%;background:${e.value.style.chart.backgroundColor};color:${e.value.style.chart.color};font-family:${e.value.style.fontFamily}`),
|
|
161
|
-
id: `thermometer__${g.value}`
|
|
162
|
-
}, [
|
|
163
|
-
e.value.style.title.text ? (o(), n("div", Le, [
|
|
164
|
-
(o(), U(Ye, {
|
|
165
|
-
key: `title_${V.value}`,
|
|
166
|
-
config: {
|
|
167
|
-
title: {
|
|
168
|
-
cy: "thermometer-div-title",
|
|
169
|
-
...e.value.style.title
|
|
170
|
-
},
|
|
171
|
-
subtitle: {
|
|
172
|
-
cy: "thermometer-div-subtitle",
|
|
173
|
-
...e.value.style.title.subtitle
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}, null, 8, ["config"]))
|
|
177
|
-
])) : c("", !0),
|
|
178
|
-
e.value.userOptions.show && I.value ? (o(), U(Me, {
|
|
179
|
-
ref: "details",
|
|
180
|
-
key: `user_options_${G.value}`,
|
|
181
|
-
backgroundColor: e.value.style.chart.backgroundColor,
|
|
182
|
-
color: e.value.style.chart.color,
|
|
183
|
-
isImaging: v(z),
|
|
184
|
-
isPrinting: v(E),
|
|
185
|
-
uid: g.value,
|
|
186
|
-
hasPdf: e.value.userOptions.buttons.pdf,
|
|
187
|
-
hasImg: e.value.userOptions.buttons.img,
|
|
188
|
-
hasFullscreen: e.value.userOptions.buttons.fullscreen,
|
|
189
|
-
hasXls: !1,
|
|
190
|
-
isFullscreen: p.value,
|
|
191
|
-
titles: { ...e.value.userOptions.buttonTitles },
|
|
192
|
-
chartElement: T.value,
|
|
193
|
-
position: e.value.userOptions.position,
|
|
194
|
-
onToggleFullscreen: re,
|
|
195
|
-
onGeneratePdf: v(B),
|
|
196
|
-
onGenerateImage: v(j)
|
|
197
|
-
}, fe({ _: 2 }, [
|
|
198
|
-
s.$slots.optionPdf ? {
|
|
199
|
-
name: "optionPdf",
|
|
200
|
-
fn: q(() => [
|
|
201
|
-
x(s.$slots, "optionPdf", {}, void 0, !0)
|
|
202
|
-
]),
|
|
203
|
-
key: "0"
|
|
204
|
-
} : void 0,
|
|
205
|
-
s.$slots.optionImg ? {
|
|
206
|
-
name: "optionImg",
|
|
207
|
-
fn: q(() => [
|
|
208
|
-
x(s.$slots, "optionImg", {}, void 0, !0)
|
|
209
|
-
]),
|
|
210
|
-
key: "1"
|
|
211
|
-
} : void 0,
|
|
212
|
-
s.$slots.optionFullscreen ? {
|
|
213
|
-
name: "optionFullscreen",
|
|
214
|
-
fn: q(({ toggleFullscreen: t, isFullscreen: u }) => [
|
|
215
|
-
x(s.$slots, "optionFullscreen", H(X({ toggleFullscreen: t, isFullscreen: u })), void 0, !0)
|
|
216
|
-
]),
|
|
217
|
-
key: "2"
|
|
218
|
-
} : void 0
|
|
219
|
-
]), 1032, ["backgroundColor", "color", "isImaging", "isPrinting", "uid", "hasPdf", "hasImg", "hasFullscreen", "isFullscreen", "titles", "chartElement", "position", "onGeneratePdf", "onGenerateImage"])) : c("", !0),
|
|
220
|
-
I.value ? (o(), n("svg", {
|
|
221
|
-
key: 2,
|
|
222
|
-
xmlns: v($e),
|
|
223
|
-
class: $({ "vue-data-ui-fullscreen--on": p.value, "vue-data-ui-fulscreen--off": !p.value }),
|
|
224
|
-
width: "100%",
|
|
225
|
-
viewBox: `0 0 ${l.value.width} ${l.value.height}`,
|
|
226
|
-
style: "background:transparent"
|
|
227
|
-
}, [
|
|
228
|
-
me(Se),
|
|
229
|
-
d("defs", null, [
|
|
230
|
-
d("clipPath", Ge, [
|
|
231
|
-
d("rect", {
|
|
232
|
-
x: "0",
|
|
233
|
-
y: "0",
|
|
234
|
-
width: "1",
|
|
235
|
-
height: "1",
|
|
236
|
-
rx: "0.5",
|
|
237
|
-
ry: "0.07",
|
|
238
|
-
fill: e.value.style.chart.backgroundColor
|
|
239
|
-
}, null, 8, Ve)
|
|
240
|
-
]),
|
|
241
|
-
(o(!0), n(F, null, R(D.value, (t, u) => (o(), n("linearGradient", {
|
|
242
|
-
id: `vueUiThermometerGradient_${u}_${g.value}`,
|
|
243
|
-
x1: "0%",
|
|
244
|
-
y1: "0%",
|
|
245
|
-
x2: "100%",
|
|
246
|
-
y2: "0%"
|
|
247
|
-
}, [
|
|
248
|
-
d("stop", {
|
|
249
|
-
offset: "0%",
|
|
250
|
-
"stop-color": t.color
|
|
251
|
-
}, null, 8, Ee),
|
|
252
|
-
d("stop", {
|
|
253
|
-
offset: "50%",
|
|
254
|
-
"stop-color": v(Fe)(t.color, 100 - e.value.style.chart.graduations.gradient.intensity)
|
|
255
|
-
}, null, 8, ze),
|
|
256
|
-
d("stop", {
|
|
257
|
-
offset: "100%",
|
|
258
|
-
"stop-color": t.color
|
|
259
|
-
}, null, 8, Be)
|
|
260
|
-
], 8, We))), 256))
|
|
261
|
-
]),
|
|
262
|
-
d("g", je, [
|
|
263
|
-
d("rect", {
|
|
264
|
-
x: l.value.left,
|
|
265
|
-
y: l.value.top,
|
|
266
|
-
height: l.value.height - i.value.top - i.value.bottom,
|
|
267
|
-
width: l.value.width - i.value.left - i.value.right,
|
|
268
|
-
fill: "#FFFFFF"
|
|
269
|
-
}, null, 8, Ae),
|
|
270
|
-
(o(!0), n(F, null, R(D.value, (t, u) => (o(), n("g", {
|
|
271
|
-
key: `graduation_${u}`
|
|
272
|
-
}, [
|
|
273
|
-
d("rect", {
|
|
274
|
-
x: t.x,
|
|
275
|
-
y: t.y,
|
|
276
|
-
height: t.height,
|
|
277
|
-
width: l.value.width - e.value.style.chart.padding.left - e.value.style.chart.padding.right,
|
|
278
|
-
fill: e.value.style.chart.graduations.gradient.show ? `url(#vueUiThermometerGradient_${u}_${g.value})` : t.color,
|
|
279
|
-
"shape-rendering": "crispEdges"
|
|
280
|
-
}, null, 8, De),
|
|
281
|
-
e.value.style.chart.graduations.show && ["both", "left"].includes(e.value.style.chart.graduations.sides) ? (o(), n("line", {
|
|
282
|
-
key: 0,
|
|
283
|
-
x1: t.x,
|
|
284
|
-
x2: t.x + 10,
|
|
285
|
-
y1: t.y,
|
|
286
|
-
y2: t.y,
|
|
287
|
-
"stroke-width": e.value.style.chart.graduations.strokeWidth,
|
|
288
|
-
stroke: e.value.style.chart.graduations.stroke,
|
|
289
|
-
"stroke-linecap": "round"
|
|
290
|
-
}, null, 8, He)) : c("", !0),
|
|
291
|
-
e.value.style.chart.graduations.showIntermediate ? (o(), n(F, { key: 1 }, [
|
|
292
|
-
e.value.style.chart.graduations.show && ["both", "left"].includes(e.value.style.chart.graduations.sides) ? (o(), n("line", {
|
|
293
|
-
key: 0,
|
|
294
|
-
x1: t.x,
|
|
295
|
-
x2: t.x + 5,
|
|
296
|
-
y1: t.halfY,
|
|
297
|
-
y2: t.halfY,
|
|
298
|
-
"stroke-width": e.value.style.chart.graduations.strokeWidth / 2,
|
|
299
|
-
stroke: e.value.style.chart.graduations.stroke,
|
|
300
|
-
"stroke-linecap": "round"
|
|
301
|
-
}, null, 8, Xe)) : c("", !0),
|
|
302
|
-
e.value.style.chart.graduations.show && ["both", "left"].includes(e.value.style.chart.graduations.sides) ? (o(), n("line", {
|
|
303
|
-
key: 1,
|
|
304
|
-
x1: t.x,
|
|
305
|
-
x2: t.x + 2.5,
|
|
306
|
-
y1: t.qYLess,
|
|
307
|
-
y2: t.qYLess,
|
|
308
|
-
"stroke-width": e.value.style.chart.graduations.strokeWidth / 2,
|
|
309
|
-
stroke: e.value.style.chart.graduations.stroke,
|
|
310
|
-
"stroke-linecap": "round"
|
|
311
|
-
}, null, 8, Re)) : c("", !0),
|
|
312
|
-
e.value.style.chart.graduations.show && ["both", "left"].includes(e.value.style.chart.graduations.sides) ? (o(), n("line", {
|
|
313
|
-
key: 2,
|
|
314
|
-
x1: t.x,
|
|
315
|
-
x2: t.x + 2.5,
|
|
316
|
-
y1: t.qYMore,
|
|
317
|
-
y2: t.qYMore,
|
|
318
|
-
"stroke-width": e.value.style.chart.graduations.strokeWidth / 2,
|
|
319
|
-
stroke: e.value.style.chart.graduations.stroke,
|
|
320
|
-
"stroke-linecap": "round"
|
|
321
|
-
}, null, 8, Je)) : c("", !0)
|
|
322
|
-
], 64)) : c("", !0),
|
|
323
|
-
e.value.style.chart.graduations.show && ["both", "right"].includes(e.value.style.chart.graduations.sides) ? (o(), n("line", {
|
|
324
|
-
key: 2,
|
|
325
|
-
x1: l.value.right,
|
|
326
|
-
x2: l.value.right - 10,
|
|
327
|
-
y1: t.y,
|
|
328
|
-
y2: t.y,
|
|
329
|
-
"stroke-width": e.value.style.chart.graduations.strokeWidth,
|
|
330
|
-
stroke: e.value.style.chart.graduations.stroke,
|
|
331
|
-
"stroke-linecap": "round"
|
|
332
|
-
}, null, 8, Ke)) : c("", !0),
|
|
333
|
-
e.value.style.chart.graduations.showIntermediate ? (o(), n(F, { key: 3 }, [
|
|
334
|
-
e.value.style.chart.graduations.show && ["both", "right"].includes(e.value.style.chart.graduations.sides) ? (o(), n("line", {
|
|
335
|
-
key: 0,
|
|
336
|
-
x1: l.value.right,
|
|
337
|
-
x2: l.value.right - 5,
|
|
338
|
-
y1: t.halfY,
|
|
339
|
-
y2: t.halfY,
|
|
340
|
-
"stroke-width": e.value.style.chart.graduations.strokeWidth / 2,
|
|
341
|
-
stroke: e.value.style.chart.graduations.stroke,
|
|
342
|
-
"stroke-linecap": "round"
|
|
343
|
-
}, null, 8, Qe)) : c("", !0),
|
|
344
|
-
e.value.style.chart.graduations.show && ["both", "right"].includes(e.value.style.chart.graduations.sides) ? (o(), n("line", {
|
|
345
|
-
key: 1,
|
|
346
|
-
x1: l.value.right,
|
|
347
|
-
x2: l.value.right - 2.5,
|
|
348
|
-
y1: t.qYLess,
|
|
349
|
-
y2: t.qYLess,
|
|
350
|
-
"stroke-width": e.value.style.chart.graduations.strokeWidth / 2,
|
|
351
|
-
stroke: e.value.style.chart.graduations.stroke,
|
|
352
|
-
"stroke-linecap": "round"
|
|
353
|
-
}, null, 8, Ze)) : c("", !0),
|
|
354
|
-
e.value.style.chart.graduations.show && ["both", "right"].includes(e.value.style.chart.graduations.sides) ? (o(), n("line", {
|
|
355
|
-
key: 2,
|
|
356
|
-
x1: l.value.right,
|
|
357
|
-
x2: l.value.right - 2.5,
|
|
358
|
-
y1: t.qYMore,
|
|
359
|
-
y2: t.qYMore,
|
|
360
|
-
"stroke-width": e.value.style.chart.graduations.strokeWidth / 2,
|
|
361
|
-
stroke: e.value.style.chart.graduations.stroke,
|
|
362
|
-
"stroke-linecap": "round"
|
|
363
|
-
}, null, 8, et)) : c("", !0)
|
|
364
|
-
], 64)) : c("", !0)
|
|
365
|
-
]))), 128)),
|
|
366
|
-
d("rect", {
|
|
367
|
-
class: $({ "vue-ui-thermometer-temperature": e.value.style.chart.animation.use }),
|
|
368
|
-
x: l.value.left,
|
|
369
|
-
y: l.value.top,
|
|
370
|
-
height: M.value,
|
|
371
|
-
width: l.value.width - e.value.style.chart.padding.left - e.value.style.chart.padding.right,
|
|
372
|
-
fill: "#FFFFFF66"
|
|
373
|
-
}, null, 10, tt)
|
|
374
|
-
]),
|
|
375
|
-
d("text", {
|
|
376
|
-
class: $({ "vue-ui-thermometer-temperature-value": e.value.style.chart.animation.use }),
|
|
377
|
-
y: M.value + l.value.top + e.value.style.chart.label.fontSize / 3,
|
|
378
|
-
x: l.value.left - 10,
|
|
379
|
-
"text-anchor": "end",
|
|
380
|
-
fill: e.value.style.chart.label.color,
|
|
381
|
-
"font-size": e.value.style.chart.label.fontSize,
|
|
382
|
-
"font-weight": e.value.style.chart.label.bold ? "bold" : "normal"
|
|
383
|
-
}, ge(v(Pe)(
|
|
384
|
-
e.value.style.chart.label.formatter,
|
|
385
|
-
b.dataset.value,
|
|
386
|
-
v(Ie)({
|
|
387
|
-
p: e.value.style.chart.label.prefix,
|
|
388
|
-
v: b.dataset.value,
|
|
389
|
-
s: e.value.style.chart.label.suffix,
|
|
390
|
-
r: e.value.style.chart.label.rounding
|
|
391
|
-
}),
|
|
392
|
-
{ datapoint: b.dataset }
|
|
393
|
-
)), 11, st),
|
|
394
|
-
x(s.$slots, "svg", { svg: te.value }, void 0, !0)
|
|
395
|
-
], 10, Te)) : c("", !0),
|
|
396
|
-
s.$slots.watermark ? (o(), n("div", lt, [
|
|
397
|
-
x(s.$slots, "watermark", H(X({ isPrinting: v(E) || v(z) })), void 0, !0)
|
|
398
|
-
])) : c("", !0),
|
|
399
|
-
I.value ? c("", !0) : (o(), U(Ne, {
|
|
400
|
-
key: 4,
|
|
401
|
-
config: {
|
|
402
|
-
type: "thermometer",
|
|
403
|
-
style: {
|
|
404
|
-
backgroundColor: e.value.style.chart.backgroundColor,
|
|
405
|
-
thermometer: {
|
|
406
|
-
color: "#CCCCCC"
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
}, null, 8, ["config"]))
|
|
411
|
-
], 14, qe));
|
|
412
|
-
}
|
|
413
|
-
}, vt = /* @__PURE__ */ Ue(at, [["__scopeId", "data-v-cef2c8d4"]]);
|
|
414
|
-
export {
|
|
415
|
-
vt as default
|
|
416
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-Dfhvf8hT.cjs"),X=require("./Title-BHmTg9iK.cjs"),S=require("./usePrinter-BQQasUin.cjs"),J=require("./vue-ui-skeleton-fqwO2mHD.cjs"),O=require("./useNestedProp-iuDCMc2p.cjs"),K=require("./PackageVersion-Djty0wb2.cjs"),Q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Z=["id"],ee={key:0,style:"width:100%"},te=["xmlns","viewBox"],oe={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},le=["fill"],re=["id"],ae=["stop-color"],se=["stop-color"],ne=["stop-color"],ue={"clip-path":"url(#vueUiPill)"},ce=["x","y","height","width"],ie=["x","y","height","width","fill"],de=["x1","x2","y1","y2","stroke-width","stroke"],he=["x1","x2","y1","y2","stroke-width","stroke"],ve=["x1","x2","y1","y2","stroke-width","stroke"],me=["x1","x2","y1","y2","stroke-width","stroke"],ye=["x1","x2","y1","y2","stroke-width","stroke"],pe=["x1","x2","y1","y2","stroke-width","stroke"],fe=["x1","x2","y1","y2","stroke-width","stroke"],ge=["x1","x2","y1","y2","stroke-width","stroke"],ke=["x","y","height","width"],xe=["y","x","fill","font-size","font-weight"],_e={key:3,class:"vue-data-ui-watermark"},be={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:T}){const s=m;e.useCssVars(l=>({ff9f54a6:G.value,"727be881":z.value,"673ba9ae":U.value}));const{vue_ui_thermometer:Y}=r.useConfig(),f=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{w()});function w(){r.objectIsEmpty(s.dataset)?r.error({componentName:"VueUiThermometer",type:"dataset"}):r.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","from","to"]}).forEach(l=>{r.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:l})})}const d=e.ref(r.createUid()),C=e.ref(null),N=e.ref(0),B=e.ref(0),t=e.computed({get:()=>E(),set:l=>l});function E(){const l=O.useNestedProp({userConfig:s.config,defaultConfig:Y});return l.theme?{...O.useNestedProp({userConfig:r.themes.vue_ui_thermometer[l.theme]||s.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>s.config,l=>{t.value=E(),w(),B.value+=1},{deep:!0});const{isPrinting:V,isImaging:P,generatePdf:F,generateImage:$}=S.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer"}),y=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),M=e.computed(()=>t.value.style.chart.thermometer.width),i=e.computed(()=>s.dataset.steps||10),c=e.ref({top:t.value.style.chart.padding.top,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right,bottom:t.value.style.chart.padding.bottom});function p(l,n,o){const u=[],_=I(l),b=I(n);for(let v=0;v<o;v++){const j=g(_.red,b.red,v,o),A=g(_.green,b.green,v,o),D=g(_.blue,b.blue,v,o),R=`#${k(j)}${k(A)}${k(D)}`;u.push(R)}return u}function I(l){const n=l.slice(1);return{red:parseInt(n.slice(0,2),16),green:parseInt(n.slice(2,4),16),blue:parseInt(n.slice(4,6),16)}}function g(l,n,o,u){return Math.round(l+(n-l)*o/u)}function k(l){return l.toString(16).padStart(2,"0")}const a=e.computed(()=>{const l=M.value+c.value.left+c.value.right,n=t.value.style.chart.height;return{width:l,left:c.value.left,right:l-c.value.right,top:c.value.top,bottom:n-c.value.bottom,height:n}}),L=e.computed(()=>a.value),x=e.computed(()=>{const l=r.checkNaN(s.dataset.from)<0?Math.abs(r.checkNaN(s.dataset.from)):r.checkNaN(s.dataset.from),n=r.checkNaN(s.dataset.to)<0?Math.abs(r.checkNaN(s.dataset.to)):r.checkNaN(s.dataset.to);let o=0;return r.checkNaN(s.dataset.to)>0?o=l+n:l>n?o=l-n:o=n-l,(1-(Math.abs(r.checkNaN(s.dataset.from))+r.checkNaN(s.dataset.value))/o)*(a.value.height-c.value.top-c.value.bottom)}),U=e.computed(()=>`${x.value}px`),z=e.computed(()=>`${a.value.height-t.value.style.chart.padding.bottom-c.value.top}px`),G=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),W=e.computed(()=>{if(s.dataset.colors){if(!s.dataset.colors.from)return p(y.value[0]||r.palette[0],r.convertColorToHex(s.dataset.colors.to),i.value||10);if(!s.dataset.colors.to)return p(r.convertColorToHex(s.dataset.colors.from),y.value[1]||r.palette[1],i.value||10)}else return p(y.value[1]||r.palette[1],y.value[0]||r.palette[0],i.value||10);return p(r.convertColorToHex(s.dataset.colors.from),r.convertColorToHex(s.dataset.colors.to),i.value||10)}),q=e.computed(()=>{const l=[];let n=0;const o=a.value.height-c.value.top-c.value.bottom;for(let u=0;u<o-1;u+=o/i.value)l.push({x:a.value.left,y:a.value.top+u,qYLess:a.value.top+u+o/i.value/4,halfY:a.value.top+u+o/i.value/2,qYMore:a.value.top+u+o/i.value/4*3,color:W.value[n],height:o/i.value}),n+=1;return l}),h=e.ref(!1);function H(l){h.value=l,N.value+=1}return T({generatePdf:F,generateImage:$}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:C,class:e.normalizeClass(`vue-ui-thermometer ${h.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}`),id:`thermometer__${d.value}`},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",ee,[(e.openBlock(),e.createBlock(X._sfc_main,{key:`title_${B.value}`,config:{title:{cy:"thermometer-div-title",...t.value.style.title},subtitle:{cy:"thermometer-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&f.value?(e.openBlock(),e.createBlock(S.UserOptions,{ref:"details",key:`user_options_${N.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(P),isPrinting:e.unref(V),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,position:t.value.userOptions.position,onToggleFullscreen:H,onGeneratePdf:e.unref(F),onGenerateImage:e.unref($)},e.createSlots({_:2},[l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"2"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${a.value.width} ${a.value.height}`,style:"background:transparent"},[e.createVNode(K._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",oe,[e.createElementVNode("rect",{x:"0",y:"0",width:"1",height:"1",rx:"0.5",ry:"0.07",fill:t.value.style.chart.backgroundColor},null,8,le)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(o,u)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${u}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,ae),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(r.setOpacity)(o.color,100-t.value.style.chart.graduations.gradient.intensity)},null,8,se),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,ne)],8,re))),256))]),e.createElementVNode("g",ue,[e.createElementVNode("rect",{x:a.value.left,y:a.value.top,height:a.value.height-c.value.top-c.value.bottom,width:a.value.width-c.value.left-c.value.right,fill:"#FFFFFF"},null,8,ce),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(q.value,(o,u)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${u}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:a.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:t.value.style.chart.graduations.gradient.show?`url(#vueUiThermometerGradient_${u}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,ie),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,de)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,he)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x+2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ve)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x+2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,me)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.value.right,x2:a.value.right-10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ye)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.value.right,x2:a.value.right-5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,pe)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:a.value.right,x2:a.value.right-2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,fe)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.value.right,x2:a.value.right-2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,ge)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("rect",{class:e.normalizeClass({"vue-ui-thermometer-temperature":t.value.style.chart.animation.use}),x:a.value.left,y:a.value.top,height:x.value,width:a.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,ke)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:x.value+a.value.top+t.value.style.chart.label.fontSize/3,x:a.value.left-10,"text-anchor":"end",fill:t.value.style.chart.label.color,"font-size":t.value.style.chart.label.fontSize,"font-weight":t.value.style.chart.label.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.label.formatter,m.dataset.value,e.unref(r.dataLabel)({p:t.value.style.chart.label.prefix,v:m.dataset.value,s:t.value.style.chart.label.suffix,r:t.value.style.chart.label.rounding}),{datapoint:m.dataset})),11,xe),e.renderSlot(l.$slots,"svg",{svg:L.value},void 0,!0)],10,te)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",_e,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(V)||e.unref(P)})),void 0,!0)])):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(J.default,{key:4,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],14,Z))}},we=Q._export_sfc(be,[["__scopeId","data-v-cef2c8d4"]]);exports.default=we;
|