vue-data-ui 2.10.8 → 2.10.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Arrow-aCcBx0NS.js → Arrow-DCEAiiSq.js} +1 -1
- package/dist/{Arrow-NnfTvwbg.cjs → Arrow-kcA0IBBo.cjs} +1 -1
- package/dist/{BaseIcon-DmfPEj6j.cjs → BaseIcon-CmdFxgkp.cjs} +1 -1
- package/dist/{BaseIcon-DTt4YbQE.js → BaseIcon-DPO_4Adb.js} +1 -1
- package/dist/{ColorPicker-DrovFYIL.js → ColorPicker-D0FMoBTo.js} +3 -3
- package/dist/{ColorPicker-DsEujcIN.cjs → ColorPicker-DJn8_rVA.cjs} +1 -1
- package/dist/{DataTable-CX-Ynkp4.js → DataTable-BaAjwD5U.js} +2 -2
- package/dist/{DataTable-zSU-0X__.cjs → DataTable-OM4js4qI.cjs} +1 -1
- package/dist/{Legend-BTvPguV6.js → Legend-DqxOfhbM.js} +2 -2
- package/dist/{Legend-DFQ4iWI3.cjs → Legend-qwuGpvF8.cjs} +1 -1
- package/dist/{PackageVersion-DxR-fKLM.cjs → PackageVersion-Di-ZyR0_.cjs} +1 -1
- package/dist/{PackageVersion-CkUbRQrt.js → PackageVersion-gI4tUgWr.js} +1 -1
- package/dist/{PenAndPaper-CG9o3ymS.cjs → PenAndPaper-CtYhqkG5.cjs} +1 -1
- package/dist/{PenAndPaper-Br3OdauM.js → PenAndPaper-Di3hcmp3.js} +3 -3
- package/dist/{Shape-D9l3WJGO.cjs → Shape-CHiMFkEQ.cjs} +1 -1
- package/dist/{Shape-Y1FgLdPz.js → Shape-DJcgH2ks.js} +1 -1
- package/dist/{Slicer-B7FJCuCB.cjs → Slicer-BrBOWXeJ.cjs} +1 -1
- package/dist/{Slicer-C2GR76As.js → Slicer-DWZhB9e4.js} +2 -2
- package/dist/{Title-tlFeM12I.js → Title-B55VMGbm.js} +1 -1
- package/dist/{Title-CEZO2hzQ.cjs → Title-BiyGREAz.cjs} +1 -1
- package/dist/{Tooltip-BZa-QzER.cjs → Tooltip-C-Kq18lz.cjs} +1 -1
- package/dist/{Tooltip-BCtHh3BT.js → Tooltip-CMiCE06y.js} +1 -1
- package/dist/{dom-to-png-CjxHTZgX.js → dom-to-png-C6TvW1Fi.js} +1 -1
- package/dist/{dom-to-png-fAhFmKHV.cjs → dom-to-png-vuA7iQ84.cjs} +1 -1
- package/dist/{img-Ds_hWTTu.cjs → img-DHHWE-ji.cjs} +1 -1
- package/dist/{img-w_iFTYRY.js → img-z4AasNO4.js} +1 -1
- package/dist/{index-Dy2-pNb6.cjs → index-DlALYfRS.cjs} +1 -1
- package/dist/{index-Co5UfCMK.js → index-bVqxfptX.js} +1 -1
- package/dist/{pdf-BfkOvZWw.js → pdf-Ch5KSecz.js} +1 -1
- package/dist/{pdf-CCdcXY_7.cjs → pdf-D2qvws06.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useNestedProp-DQ8Jt3-Y.cjs → useNestedProp-BZX7zlGv.cjs} +1 -1
- package/dist/{useNestedProp-C22WP03t.js → useNestedProp-DU-vsdTb.js} +1 -1
- package/dist/{usePrinter-D_wgo-7k.js → usePrinter-BbeIGqpA.js} +3 -3
- package/dist/{usePrinter-BQEYwy4a.cjs → usePrinter-n1HzfoSm.cjs} +1 -1
- package/dist/{vue-data-ui-C18HDIa2.js → vue-data-ui-BI_bQ5jM.js} +62 -62
- package/dist/{vue-data-ui-zmg06AF1.cjs → vue-data-ui-DRqEhGYC.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-C_gJuhTV.cjs → vue-ui-3d-bar-BBKU0pAV.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-SB6p5amV.js → vue-ui-3d-bar-MSs9iIHL.js} +9 -9
- package/dist/{vue-ui-accordion-dVGUWjXH.cjs → vue-ui-accordion-CByAeInD.cjs} +1 -1
- package/dist/{vue-ui-accordion-CfB_jW1X.js → vue-ui-accordion-DQKCLM2T.js} +3 -3
- package/dist/{vue-ui-age-pyramid-DZ_ajGY_.cjs → vue-ui-age-pyramid-D05rUuJG.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-G8ggvkGU.js → vue-ui-age-pyramid-pX29qF4-.js} +10 -10
- package/dist/{vue-ui-annotator-DeoWv4A3.js → vue-ui-annotator-BuG8aus2.js} +2 -2
- package/dist/{vue-ui-annotator-BkZat_7T.cjs → vue-ui-annotator-CvcBBO7e.cjs} +1 -1
- package/dist/{vue-ui-bullet-CvjS0_Pz.js → vue-ui-bullet-B9Xg6ifm.js} +8 -8
- package/dist/{vue-ui-bullet-D9jaszdm.cjs → vue-ui-bullet-BdvVX5da.cjs} +1 -1
- package/dist/{vue-ui-candlestick-xBYW3oOn.js → vue-ui-candlestick-B_iC_QzE.js} +11 -11
- package/dist/{vue-ui-candlestick-gnsNiFI3.cjs → vue-ui-candlestick-DPEZe5JP.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-BKQIWhzt.js → vue-ui-carousel-table-DGEoBYe-.js} +4 -4
- package/dist/{vue-ui-carousel-table-DNW8HJNv.cjs → vue-ui-carousel-table-DOB6NiBx.cjs} +1 -1
- package/dist/{vue-ui-chestnut-C5RprHfl.js → vue-ui-chestnut-CiWVelvx.js} +8 -8
- package/dist/{vue-ui-chestnut-D9UKh8la.cjs → vue-ui-chestnut-DxF_6jB2.cjs} +1 -1
- package/dist/{vue-ui-circle-pack-Cx4gGG1K.js → vue-ui-circle-pack-CJN2ybvx.js} +9 -9
- package/dist/{vue-ui-circle-pack-OTXbeD89.cjs → vue-ui-circle-pack-XEEX0oEn.cjs} +1 -1
- package/dist/{vue-ui-cursor-BuEDX1kV.cjs → vue-ui-cursor-7loRJMGF.cjs} +1 -1
- package/dist/{vue-ui-cursor-Cdvi-0lD.js → vue-ui-cursor-CqAjc9W_.js} +2 -2
- package/dist/{vue-ui-dashboard-BAPaHtqr.cjs → vue-ui-dashboard-CQn61jnh.cjs} +1 -1
- package/dist/{vue-ui-dashboard-BLHl6FJI.js → vue-ui-dashboard-CdpzgIs_.js} +62 -62
- package/dist/{vue-ui-digits-CCAt8_aJ.js → vue-ui-digits-7ACjmgPM.js} +2 -2
- package/dist/{vue-ui-digits-YV4qxb86.cjs → vue-ui-digits-CuxGcV9M.cjs} +1 -1
- package/dist/{vue-ui-donut-BvjPFjpd.cjs → vue-ui-donut-BtvQmKji.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-DNhwy9qU.js → vue-ui-donut-evolution-BpEJNoJM.js} +11 -11
- package/dist/{vue-ui-donut-evolution-Dxx5Psl4.cjs → vue-ui-donut-evolution-fOc16UtY.cjs} +1 -1
- package/dist/{vue-ui-donut-CNZIha3Z.js → vue-ui-donut-m7KcUt0k.js} +12 -12
- package/dist/{vue-ui-dumbbell-MGMSs7vG.cjs → vue-ui-dumbbell-BTvPq02T.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-BmRkAtBK.js → vue-ui-dumbbell-Sy7rxejU.js} +10 -10
- package/dist/vue-ui-flow-BccWxEzt.cjs +3 -0
- package/dist/{vue-ui-flow-CxhJwDZa.js → vue-ui-flow-CbszU2ms.js} +314 -326
- package/dist/{vue-ui-funnel-CJHKcUDg.js → vue-ui-funnel-D3b6l6X6.js} +9 -9
- package/dist/{vue-ui-funnel-twMmn36_.cjs → vue-ui-funnel-D87BZsNK.cjs} +1 -1
- package/dist/{vue-ui-galaxy-BjBTNZ6j.cjs → vue-ui-galaxy-CDGqzTCy.cjs} +1 -1
- package/dist/{vue-ui-galaxy-CDonLoXv.js → vue-ui-galaxy-CUuzThWx.js} +11 -11
- package/dist/{vue-ui-gauge-C7L0uVvx.js → vue-ui-gauge-24FEcSzr.js} +7 -7
- package/dist/{vue-ui-gauge-DXadxMZn.cjs → vue-ui-gauge-B6RkYKug.cjs} +1 -1
- package/dist/{vue-ui-gizmo-u7ypeW6n.cjs → vue-ui-gizmo-BAsoCXMw.cjs} +1 -1
- package/dist/{vue-ui-gizmo-C9JuTLL-.js → vue-ui-gizmo-DeYTfhQU.js} +3 -3
- package/dist/{vue-ui-heatmap-DaAgigHH.js → vue-ui-heatmap-DpmJyXn-.js} +10 -10
- package/dist/{vue-ui-heatmap-Cjckqsrg.cjs → vue-ui-heatmap-QCkbTog8.cjs} +1 -1
- package/dist/{vue-ui-history-plot-YLMX8PqM.cjs → vue-ui-history-plot-BAW3WchG.cjs} +1 -1
- package/dist/{vue-ui-history-plot-KoGpnC64.js → vue-ui-history-plot-CBeiEcTE.js} +11 -11
- package/dist/{vue-ui-kpi-DNUDGlWM.js → vue-ui-kpi-3gKMDrTH.js} +3 -3
- package/dist/{vue-ui-kpi-GZlFX5zg.cjs → vue-ui-kpi-Pki59wPC.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-D1HhmCbC.cjs → vue-ui-mini-loader-BdSgh6y-.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-9YvdM0_A.js → vue-ui-mini-loader-Bo-F8i3n.js} +2 -2
- package/dist/{vue-ui-molecule-DDsKb9re.cjs → vue-ui-molecule-Bbs_Vy-A.cjs} +1 -1
- package/dist/{vue-ui-molecule-B71fJREj.js → vue-ui-molecule-DkVkHwM_.js} +11 -11
- package/dist/{vue-ui-mood-radar-DH4RYmdT.js → vue-ui-mood-radar-7qs15-ye.js} +11 -11
- package/dist/{vue-ui-mood-radar-BO4yaBxo.cjs → vue-ui-mood-radar-DcyKE-45.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-bOXvQ01U.js → vue-ui-nested-donuts-BYwluLLM.js} +11 -11
- package/dist/{vue-ui-nested-donuts-BlxuqLPb.cjs → vue-ui-nested-donuts-iifvTxeT.cjs} +1 -1
- package/dist/{vue-ui-onion-D7VhEicc.js → vue-ui-onion-B7Asvx4M.js} +11 -11
- package/dist/{vue-ui-onion-BugH4ThJ.cjs → vue-ui-onion-DsS8vdCr.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-DjTMM1Zt.cjs → vue-ui-parallel-coordinate-plot-CWyjLwOL.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-Bc5Yr0Yr.js → vue-ui-parallel-coordinate-plot-CayH9RQe.js} +12 -12
- package/dist/{vue-ui-quadrant-Dni5Lkhg.cjs → vue-ui-quadrant--6zm3Tkv.cjs} +1 -1
- package/dist/{vue-ui-quadrant-PrjG5beo.js → vue-ui-quadrant-BSjpS3JD.js} +12 -12
- package/dist/{vue-ui-quick-chart-C46V8Ffa.js → vue-ui-quick-chart-DbfWPULd.js} +9 -9
- package/dist/{vue-ui-quick-chart-LuGKbIvU.cjs → vue-ui-quick-chart-DkUGMBfD.cjs} +1 -1
- package/dist/{vue-ui-radar-j2Vgot8p.cjs → vue-ui-radar-BrA-apr-.cjs} +1 -1
- package/dist/{vue-ui-radar-05pd47HM.js → vue-ui-radar-CvK5Nz5U.js} +12 -12
- package/dist/{vue-ui-rating-Bl_q3TYs.js → vue-ui-rating-C5qFRKy9.js} +2 -2
- package/dist/{vue-ui-rating-ClxiMhPq.cjs → vue-ui-rating-ctOiwHRD.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-BuoQTWw_.cjs → vue-ui-relation-circle-35rE0_C0.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-Bu5eYbEg.js → vue-ui-relation-circle-ChUKc3S5.js} +7 -7
- package/dist/{vue-ui-ridgeline-ESRn_Q1y.cjs → vue-ui-ridgeline-C_LoyQPY.cjs} +1 -1
- package/dist/{vue-ui-ridgeline-D4ot7MF8.js → vue-ui-ridgeline-DDrBrbxq.js} +12 -12
- package/dist/{vue-ui-rings-Dyl5VV9I.js → vue-ui-rings-DGhi_Jcb.js} +12 -12
- package/dist/{vue-ui-rings-D7o_vleu.cjs → vue-ui-rings-IM473vOr.cjs} +1 -1
- package/dist/{vue-ui-scatter-B31kZz0w.cjs → vue-ui-scatter-B7h_hWj7.cjs} +1 -1
- package/dist/{vue-ui-scatter-njuULIsD.js → vue-ui-scatter-DS9rUuE5.js} +12 -12
- package/dist/{vue-ui-skeleton-BSlYUHZA.js → vue-ui-skeleton-BARmXI9_.js} +3 -3
- package/dist/{vue-ui-skeleton-Db7PiDqL.cjs → vue-ui-skeleton-C-I7hIHS.cjs} +1 -1
- package/dist/{vue-ui-smiley-BmNRkSub.js → vue-ui-smiley-Ce4Rju1r.js} +2 -2
- package/dist/{vue-ui-smiley-CfdbRWq6.cjs → vue-ui-smiley-DwI6j0i8.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-CwtYlUEX.cjs → vue-ui-spark-trend-BfcDH-Gp.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-B0Xvu1YP.js → vue-ui-spark-trend-CE1USqg6.js} +5 -5
- package/dist/{vue-ui-sparkbar-e2-8wHQH.js → vue-ui-sparkbar-B3NBNGl8.js} +4 -4
- package/dist/{vue-ui-sparkbar-Xy7idkhv.cjs → vue-ui-sparkbar-CdDBwkff.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-vjcDqzGe.cjs → vue-ui-sparkgauge-CPq_DRcO.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-_cMBBl3V.js → vue-ui-sparkgauge-Kgl_vvc7.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-BpD6XxfA.cjs → vue-ui-sparkhistogram-B9Mf4nA9.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-DUyGQgqZ.js → vue-ui-sparkhistogram-DNvaByAm.js} +5 -5
- package/dist/{vue-ui-sparkline-D1wfG3Yw.js → vue-ui-sparkline-6fUsXxoo.js} +4 -4
- package/dist/{vue-ui-sparkline-cPPxz94c.cjs → vue-ui-sparkline-DPFtUR9k.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-BCTx016Z.js → vue-ui-sparkstackbar-B_O87Udb.js} +5 -5
- package/dist/{vue-ui-sparkstackbar-iRVpx_xT.cjs → vue-ui-sparkstackbar-D8gErBiD.cjs} +1 -1
- package/dist/{vue-ui-stackbar--QKW68d6.js → vue-ui-stackbar-SQkqb5uZ.js} +13 -13
- package/dist/{vue-ui-stackbar-DCotybpB.cjs → vue-ui-stackbar-a7bzDCRQ.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-CdceC4jP.cjs → vue-ui-strip-plot-BbCMpSG9.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-BhLBOV7s.js → vue-ui-strip-plot-Czg_UcLg.js} +11 -11
- package/dist/{vue-ui-table-DjDENKmJ.js → vue-ui-table-B0ANgSAH.js} +3 -3
- package/dist/{vue-ui-table-Cd9UeZXy.cjs → vue-ui-table-DTys0wh5.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-CZdiE-l3.js → vue-ui-table-heatmap---afBYht.js} +4 -4
- package/dist/{vue-ui-table-heatmap-gbdWhEG_.cjs → vue-ui-table-heatmap-B46ApT8a.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-BFQ4DQRu.cjs → vue-ui-table-sparkline-CSi_2E82.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-zGotm14D.js → vue-ui-table-sparkline-cuO4BEcb.js} +5 -5
- package/dist/{vue-ui-thermometer-CRhrvWm0.cjs → vue-ui-thermometer-Bco6ThIk.cjs} +1 -1
- package/dist/{vue-ui-thermometer-DA3KgSw1.js → vue-ui-thermometer-Cu3N2aZN.js} +7 -7
- package/dist/{vue-ui-timer-ult9htF3.js → vue-ui-timer-DnQAvYVy.js} +5 -5
- package/dist/{vue-ui-timer-DnXYrfrB.cjs → vue-ui-timer-GkxVjTEC.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-Dht-uT9E.cjs → vue-ui-tiremarks-CNW6BXVF.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-CRXtVmEM.js → vue-ui-tiremarks-PX1AQ6u9.js} +7 -7
- package/dist/{vue-ui-treemap-Ck5tHVnE.js → vue-ui-treemap-Drg5MEcW.js} +12 -12
- package/dist/{vue-ui-treemap-pbhS4FfC.cjs → vue-ui-treemap-dm6Ion7A.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-egz76l34.js → vue-ui-vertical-bar-BtkKFF7C.js} +12 -12
- package/dist/{vue-ui-vertical-bar-BZjsolLB.cjs → vue-ui-vertical-bar-eA-iYb9s.cjs} +1 -1
- package/dist/{vue-ui-waffle-CrMkCjJJ.js → vue-ui-waffle-BAFVYzdi.js} +12 -12
- package/dist/{vue-ui-waffle-C7za7d0u.cjs → vue-ui-waffle-Bn77Yd88.cjs} +1 -1
- package/dist/{vue-ui-wheel-DIgPyNrB.cjs → vue-ui-wheel-D4VdCS3n.cjs} +1 -1
- package/dist/{vue-ui-wheel-DzMpr4xY.js → vue-ui-wheel-fMANwaEy.js} +7 -7
- package/dist/{vue-ui-word-cloud-TS3az-LK.js → vue-ui-word-cloud-Du0UUBsh.js} +10 -10
- package/dist/{vue-ui-word-cloud-CNqAz548.cjs → vue-ui-word-cloud-bX4J2Y8V.cjs} +1 -1
- package/dist/{vue-ui-world-D3X01xYB.js → vue-ui-world-B-Guo08O.js} +11 -11
- package/dist/{vue-ui-world-DMdqTY5G.cjs → vue-ui-world-BHNBu5o5.cjs} +1 -1
- package/dist/{vue-ui-xy-tIBPr8r8.js → vue-ui-xy-BN9Lh6Ic.js} +16 -16
- package/dist/{vue-ui-xy-CF87Afh2.cjs → vue-ui-xy-BkQt8l_A.cjs} +2 -2
- package/dist/{vue-ui-xy-canvas-BHeV-3t9.js → vue-ui-xy-canvas-D9avmh08.js} +12 -12
- package/dist/{vue-ui-xy-canvas-2IL8lPL4.cjs → vue-ui-xy-canvas-cfQsHd-5.cjs} +1 -1
- package/package.json +1 -1
- package/dist/vue-ui-flow-B3t_sNr4.cjs +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-Dy2-pNb6.cjs"),Te=require("./useNestedProp-DQ8Jt3-Y.cjs"),Me=require("./useResponsive-DQmBAoBf.cjs"),Fe=require("./usePrinter-BQEYwy4a.cjs"),ot=require("./Slicer-B7FJCuCB.cjs"),rt=require("./Tooltip-BZa-QzER.cjs"),st=require("./Title-CEZO2hzQ.cjs"),nt=require("./Legend-DFQ4iWI3.cjs"),it=require("./vue-ui-accordion-dVGUWjXH.cjs"),ut=require("./DataTable-zSU-0X__.cjs"),ct=require("./vue-ui-skeleton-Db7PiDqL.cjs"),dt=require("./PackageVersion-DxR-fKLM.cjs"),ht=require("./PenAndPaper-CG9o3ymS.cjs"),vt=require("./useUserOptionState-BgepsfED.cjs"),mt=require("./Shape-D9l3WJGO.cjs"),gt=require("./useChartAccessibility-Cm7nkzTG.cjs"),yt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),bt=["id"],ft=["xmlns","viewBox"],pt=["x","y","width","height"],kt={key:1},xt=["id"],wt=["stop-color"],Bt=["stop-color"],Ct=["stop-color"],St=["x1","x2","y1","y2","stroke"],zt=["x1","x2","y1","y2","stroke"],Lt=["x1","x2","y1","y2","stroke"],_t=["x1","x2","y1","y2","stroke"],Et={key:0},Nt=["x","y","height","rx","width","fill","stroke","stroke-width"],$t={key:0},Vt=["x","y","height","rx","width","fill","stroke","stroke-width"],Tt=["x","y","width","rx","height","fill","stroke","stroke-width"],Mt={key:0},Ft=["x","y","width","rx","height","fill","stroke","stroke-width"],Pt=["x1","x2","y1","y2","stroke","stroke-width"],It=["x1","x2","y1","y2","stroke","stroke-width"],Rt=["x","y","font-size","fill","font-weight"],Ot=["transform","font-size","fill","font-weight"],Dt=["x","y","font-size","fill","font-weight"],At={key:0},qt=["x","y","font-size","font-weight","fill"],Ht=["x","y","font-size","fill","font-weight"],Ut={key:0},Wt=["x","y","font-size","font-weight","fill"],Yt=["x1","x2","y1","y2","stroke"],Xt=["x","y","font-size","font-weight","fill"],Gt=["x1","x2","y1","y2","stroke"],Jt=["font-size","font-weight","fill","text-anchor","transform"],Zt={key:0},Kt={key:1},Qt=["text-anchor","font-size","font-weight","fill","transform","onClick"],jt={key:0},ea={key:1},ta=["font-size","font-weight","fill","x","y","onClick"],aa=["x","y","width","height","onClick","onMouseenter","fill"],la=["x","y","width","height","onClick","onMouseenter","fill"],oa={key:4,class:"vue-data-ui-watermark"},ra=["onClick"],sa=["innerHTML"],na={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend","selectTimeLabel"],setup(G,{expose:Pe,emit:Ie}){const{vue_ui_stackbar:Re}=u.useConfig(),Oe=e.useSlots(),h=G,J=Ie,T=e.computed({get(){return!!h.dataset&&h.dataset.length},set(l){return l}}),F=e.ref(null),C=e.ref(u.createUid()),D=e.ref(!1),Z=e.ref(null),K=e.ref(""),f=e.ref([]),te=e.ref(0),ae=e.ref(null),le=e.ref(null),oe=e.ref(null),re=e.ref(null),se=e.ref(0),A=e.ref(!1),P=e.ref(null),_=e.ref(!1),De=e.ref(0),Ae=e.ref(0),qe=e.ref(0),M=e.ref(null);e.onMounted(()=>{j()});const t=e.computed({get:()=>ce(),set:l=>l}),{userOptionsVisible:Q,setUserOptionsVisibility:ne,keepUserOptionState:ie}=vt.useUserOptionState({config:t.value}),{svgRef:ue}=gt.useChartAccessibility({config:t.value.style.chart.title});function ce(){const l=Te.useNestedProp({userConfig:h.config,defaultConfig:Re});let r={};return l.theme?r={...Te.useNestedProp({userConfig:u.themes.vue_ui_stackbar[l.theme]||h.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:r=l,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=h.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=h.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.startIndex")?r.style.chart.zoom.startIndex=h.config.style.chart.zoom.startIndex:r.style.chart.zoom.startIndex=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.endIndex")?r.style.chart.zoom.endIndex=h.config.style.chart.zoom.endIndex:r.style.chart.zoom.endIndex=null,r}e.watch(()=>h.config,l=>{t.value=ce(),Q.value=!t.value.userOptions.showOnChartHover,j(),De.value+=1,Ae.value+=1,qe.value+=1,y.value.dataLabels.show=t.value.style.chart.bars.dataLabels.show,y.value.showTable=t.value.table.show,y.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0}),e.watch(()=>h.dataset,l=>{be()},{deep:!0});const y=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:de,isImaging:he,generatePdf:ve,generateImage:me}=Fe.usePrinter({elementId:`stackbar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar",options:t.value.userOptions.print}),q=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}}),He=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),ge=e.ref(null),ye=e.ref(null);e.onMounted(()=>{j()});function j(){if(u.objectIsEmpty(h.dataset)?u.error({componentName:"VueUiStackbar",type:"dataset"}):h.dataset.forEach((l,r)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{T.value=!1,u.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{_.value=!0},10),t.value.responsive){const l=Me.throttle(()=>{_.value=!1;const{width:r,height:a}=Me.useResponsive({chart:F.value,title:t.value.style.chart.title.text?ae.value:null,legend:t.value.style.chart.legend.show?le.value:null,slicer:t.value.style.chart.zoom.show&&z.value>1?oe.value:null,source:re.value});requestAnimationFrame(()=>{q.value.width=r,q.value.height=a,clearTimeout(ye.value),ye.value=setTimeout(()=>{_.value=!0},10)})});ge.value=new ResizeObserver(l),ge.value.observe(F.value.parentNode)}fe()}const s=e.computed(()=>{const{height:l,width:r}=q.value,{right:a}=q.value.paddingRatio,o=t.value.style.chart.padding.top,i=r-r*a,n=l-t.value.style.chart.padding.bottom,b=t.value.style.chart.padding.left,E=r-b-r*a,N=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:i,bottom:n,left:b,width:E,height:N<0?0:N}}),S=e.computed(()=>h.dataset.map((l,r)=>{const a=u.convertColorToHex(l.color)||He.value[r]||u.palette[r]||u.palette[r%u.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:u.createUid(),color:a}})),z=e.computed(()=>Math.max(...S.value.filter(l=>!f.value.includes(l.id)).map(l=>l.series.length))),c=e.ref({start:0,end:Math.max(...h.dataset.map(l=>l.series.length))});function be(){fe()}async function fe(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&M.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setEndValue(Ue(t.value.style.chart.zoom.endIndex+1)))):(c.value={start:0,end:Math.max(...h.dataset.map(l=>l.series.length))},se.value+=1)}function Ue(l){const r=Math.max(...h.dataset.map(a=>a.series.length));return l>r?r:l<0||t.value.style.chart.zoom.startIndex!==null&&l<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:l}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(c.value.end-c.value.start):l=s.value.height/(c.value.end-c.value.start),l<=0?0:l}),I=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id))).slice(c.value.start,c.value.end)),We=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(c.value.start,c.value.end)),H=e.computed(()=>{const l=S.value.filter(r=>!f.value.includes(r.id));return{positive:u.sumSeries(l.map(r=>({...r,series:r.series.slice(c.value.start,c.value.end).map(a=>a>=0?a:0)}))),negative:u.sumSeries(l.map(r=>({...r,series:r.series.slice(c.value.start,c.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(...H.value.positive),r=Math.min(...H.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)?u.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(i=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((i+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*((i+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:i}))}),L=e.computed(()=>{const l=[];for(let r=0;r<z.value;r+=1)l.push({text:t.value.style.chart.grid.x.timeLabels.values[r]||String(r),absoluteIndex:r});return l.slice(c.value.start,c.value.end)}),g=e.computed(()=>{if(!T.value)return[];let l=Array(z.value).fill(0),r=Array(z.value).fill(0),a=Array(z.value).fill(0),o=Array(z.value).fill(0);const i=Math.max(...H.value.positive)||0,n=Math.min(...H.value.negative),b=[-1/0,1/0,NaN,void 0,null].includes(n)?0:n,E=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks),{min:N,max:R}=E,$=R+(N>=0?0:Math.abs(N))||1,p=s.value.height,X=s.value.width,$e=w.value[0]?w.value[0].zero:s.value.bottom,Ve=w.value[0]?w.value[0].horizontal_zero:s.value.left;return S.value.filter(O=>!f.value.includes(O.id)).map(O=>{const B=O.series.slice(c.value.start,c.value.end),Ze=O.signedSeries.slice(c.value.start,c.value.end),Ke=B.map((v,m)=>s.value.left+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Qe=B.map((v,m)=>s.value.top+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),je=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=p*k,V=$e-x-l[m],l[m]+=x):(x=p*k,V=$e+a[m],a[m]+=Math.abs(x)),V}),et=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=X*k,V=Ve+r[m],r[m]+=x):(x=X*k,V=Ve-Math.abs(x)-o[m],o[m]+=Math.abs(x)),V}),tt=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?p*k:p*Math.abs(k)}),at=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?X*k:X*Math.abs(k)}),lt=B.map(v=>Math.abs(v)).reduce((v,m)=>v+m,0);return{...O,proportions:B.map((v,m)=>t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/lt),series:B,signedSeries:Ze,x:Ke,y:je,height:tt,horizontal_width:at,horizontal_y:Qe,horizontal_x:et}})}),pe=e.computed(()=>We.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function U(l,r,a,o,i){const n=i===-1&&l>=0?-l:l;return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,n,u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:n,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ke(l,r,a,o){return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,u.dataLabel({v:isNaN(l)?0:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function xe(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:L.value[l]})}function we(l){P.value=l,D.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(i=>({name:i.name,absoluteIndex:i.absoluteIndex,value:i.series[l]===0?0:(i.signedSeries[l]===-1&&i.series[l]>=0?-i.series[l]:i.series[l])||null,proportion:i.proportions[l]||null,color:i.color,id:i.id}));Z.value={datapoint:a,seriesIndex:l,config:t.value,series:g.value};const o=a.map(i=>Math.abs(i.value)).reduce((i,n)=>i+n,0);if(u.isFunction(r)&&u.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))K.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:i,showPercentage:n,borderColor:b,roundingValue:E,roundingPercentage:N}=t.value.style.chart.tooltip;let R="";L.value[l]&&L.value[l].text&&t.value.style.chart.tooltip.showTimeLabel&&(R+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${b};padding-bottom:6px;margin-bottom:3px;">${L.value[l].text}</div>`);const $=[i&&n?"(":"",i&&n?")":""];a.reverse().forEach(p=>{R+=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DlALYfRS.cjs"),Te=require("./useNestedProp-BZX7zlGv.cjs"),Me=require("./useResponsive-DQmBAoBf.cjs"),Fe=require("./usePrinter-n1HzfoSm.cjs"),ot=require("./Slicer-BrBOWXeJ.cjs"),rt=require("./Tooltip-C-Kq18lz.cjs"),st=require("./Title-BiyGREAz.cjs"),nt=require("./Legend-qwuGpvF8.cjs"),it=require("./vue-ui-accordion-CByAeInD.cjs"),ut=require("./DataTable-OM4js4qI.cjs"),ct=require("./vue-ui-skeleton-C-I7hIHS.cjs"),dt=require("./PackageVersion-Di-ZyR0_.cjs"),ht=require("./PenAndPaper-CtYhqkG5.cjs"),vt=require("./useUserOptionState-BgepsfED.cjs"),mt=require("./Shape-CHiMFkEQ.cjs"),gt=require("./useChartAccessibility-Cm7nkzTG.cjs"),yt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),bt=["id"],ft=["xmlns","viewBox"],pt=["x","y","width","height"],kt={key:1},xt=["id"],wt=["stop-color"],Bt=["stop-color"],Ct=["stop-color"],St=["x1","x2","y1","y2","stroke"],zt=["x1","x2","y1","y2","stroke"],Lt=["x1","x2","y1","y2","stroke"],_t=["x1","x2","y1","y2","stroke"],Et={key:0},Nt=["x","y","height","rx","width","fill","stroke","stroke-width"],$t={key:0},Vt=["x","y","height","rx","width","fill","stroke","stroke-width"],Tt=["x","y","width","rx","height","fill","stroke","stroke-width"],Mt={key:0},Ft=["x","y","width","rx","height","fill","stroke","stroke-width"],Pt=["x1","x2","y1","y2","stroke","stroke-width"],It=["x1","x2","y1","y2","stroke","stroke-width"],Rt=["x","y","font-size","fill","font-weight"],Ot=["transform","font-size","fill","font-weight"],Dt=["x","y","font-size","fill","font-weight"],At={key:0},qt=["x","y","font-size","font-weight","fill"],Ht=["x","y","font-size","fill","font-weight"],Ut={key:0},Wt=["x","y","font-size","font-weight","fill"],Yt=["x1","x2","y1","y2","stroke"],Xt=["x","y","font-size","font-weight","fill"],Gt=["x1","x2","y1","y2","stroke"],Jt=["font-size","font-weight","fill","text-anchor","transform"],Zt={key:0},Kt={key:1},Qt=["text-anchor","font-size","font-weight","fill","transform","onClick"],jt={key:0},ea={key:1},ta=["font-size","font-weight","fill","x","y","onClick"],aa=["x","y","width","height","onClick","onMouseenter","fill"],la=["x","y","width","height","onClick","onMouseenter","fill"],oa={key:4,class:"vue-data-ui-watermark"},ra=["onClick"],sa=["innerHTML"],na={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend","selectTimeLabel"],setup(G,{expose:Pe,emit:Ie}){const{vue_ui_stackbar:Re}=u.useConfig(),Oe=e.useSlots(),h=G,J=Ie,T=e.computed({get(){return!!h.dataset&&h.dataset.length},set(l){return l}}),F=e.ref(null),C=e.ref(u.createUid()),D=e.ref(!1),Z=e.ref(null),K=e.ref(""),f=e.ref([]),te=e.ref(0),ae=e.ref(null),le=e.ref(null),oe=e.ref(null),re=e.ref(null),se=e.ref(0),A=e.ref(!1),P=e.ref(null),_=e.ref(!1),De=e.ref(0),Ae=e.ref(0),qe=e.ref(0),M=e.ref(null);e.onMounted(()=>{j()});const t=e.computed({get:()=>ce(),set:l=>l}),{userOptionsVisible:Q,setUserOptionsVisibility:ne,keepUserOptionState:ie}=vt.useUserOptionState({config:t.value}),{svgRef:ue}=gt.useChartAccessibility({config:t.value.style.chart.title});function ce(){const l=Te.useNestedProp({userConfig:h.config,defaultConfig:Re});let r={};return l.theme?r={...Te.useNestedProp({userConfig:u.themes.vue_ui_stackbar[l.theme]||h.config,defaultConfig:l}),customPalette:u.themePalettes[l.theme]||u.palette}:r=l,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMin")?r.style.chart.grid.scale.scaleMin=h.config.style.chart.grid.scale.scaleMin:r.style.chart.grid.scale.scaleMin=null,h.config&&u.hasDeepProperty(h.config,"style.chart.grid.scale.scaleMax")?r.style.chart.grid.scale.scaleMax=h.config.style.chart.grid.scale.scaleMax:r.style.chart.grid.scale.scaleMax=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.startIndex")?r.style.chart.zoom.startIndex=h.config.style.chart.zoom.startIndex:r.style.chart.zoom.startIndex=null,h.config&&u.hasDeepProperty(h.config,"style.chart.zoom.endIndex")?r.style.chart.zoom.endIndex=h.config.style.chart.zoom.endIndex:r.style.chart.zoom.endIndex=null,r}e.watch(()=>h.config,l=>{t.value=ce(),Q.value=!t.value.userOptions.showOnChartHover,j(),De.value+=1,Ae.value+=1,qe.value+=1,y.value.dataLabels.show=t.value.style.chart.bars.dataLabels.show,y.value.showTable=t.value.table.show,y.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0}),e.watch(()=>h.dataset,l=>{be()},{deep:!0});const y=e.ref({dataLabels:{show:t.value.style.chart.bars.dataLabels.show},showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),{isPrinting:de,isImaging:he,generatePdf:ve,generateImage:me}=Fe.usePrinter({elementId:`stackbar_${C.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar",options:t.value.userOptions.print}),q=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}}),He=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),ge=e.ref(null),ye=e.ref(null);e.onMounted(()=>{j()});function j(){if(u.objectIsEmpty(h.dataset)?u.error({componentName:"VueUiStackbar",type:"dataset"}):h.dataset.forEach((l,r)=>{u.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{T.value=!1,u.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:r})})}),setTimeout(()=>{_.value=!0},10),t.value.responsive){const l=Me.throttle(()=>{_.value=!1;const{width:r,height:a}=Me.useResponsive({chart:F.value,title:t.value.style.chart.title.text?ae.value:null,legend:t.value.style.chart.legend.show?le.value:null,slicer:t.value.style.chart.zoom.show&&z.value>1?oe.value:null,source:re.value});requestAnimationFrame(()=>{q.value.width=r,q.value.height=a,clearTimeout(ye.value),ye.value=setTimeout(()=>{_.value=!0},10)})});ge.value=new ResizeObserver(l),ge.value.observe(F.value.parentNode)}fe()}const s=e.computed(()=>{const{height:l,width:r}=q.value,{right:a}=q.value.paddingRatio,o=t.value.style.chart.padding.top,i=r-r*a,n=l-t.value.style.chart.padding.bottom,b=t.value.style.chart.padding.left,E=r-b-r*a,N=l-o-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:r,top:o,right:i,bottom:n,left:b,width:E,height:N<0?0:N}}),S=e.computed(()=>h.dataset.map((l,r)=>{const a=u.convertColorToHex(l.color)||He.value[r]||u.palette[r]||u.palette[r%u.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:u.createUid(),color:a}})),z=e.computed(()=>Math.max(...S.value.filter(l=>!f.value.includes(l.id)).map(l=>l.series.length))),c=e.ref({start:0,end:Math.max(...h.dataset.map(l=>l.series.length))});function be(){fe()}async function fe(){(t.value.style.chart.zoom.startIndex!==null||t.value.style.chart.zoom.endIndex!==null)&&M.value?(t.value.style.chart.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setStartValue(t.value.style.chart.zoom.startIndex)),t.value.style.chart.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),M.value&&M.value.setEndValue(Ue(t.value.style.chart.zoom.endIndex+1)))):(c.value={start:0,end:Math.max(...h.dataset.map(l=>l.series.length))},se.value+=1)}function Ue(l){const r=Math.max(...h.dataset.map(a=>a.series.length));return l>r?r:l<0||t.value.style.chart.zoom.startIndex!==null&&l<t.value.style.chart.zoom.startIndex?t.value.style.chart.zoom.startIndex!==null?t.value.style.chart.zoom.startIndex+1:1:l}const d=e.computed(()=>{let l;return t.value.orientation==="vertical"?l=s.value.width/(c.value.end-c.value.start):l=s.value.height/(c.value.end-c.value.start),l<=0?0:l}),I=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id))).slice(c.value.start,c.value.end)),We=e.computed(()=>u.sumSeries(S.value.filter(l=>!f.value.includes(l.id)).map(l=>({...l,series:l.series.map((r,a)=>l.signedSeries[a]===-1&&r>=0?-r:r)}))).slice(c.value.start,c.value.end)),H=e.computed(()=>{const l=S.value.filter(r=>!f.value.includes(r.id));return{positive:u.sumSeries(l.map(r=>({...r,series:r.series.slice(c.value.start,c.value.end).map(a=>a>=0?a:0)}))),negative:u.sumSeries(l.map(r=>({...r,series:r.series.slice(c.value.start,c.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(...H.value.positive),r=Math.min(...H.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)?u.calculateNiceScaleWithExactExtremes(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(a>0?0:a,l<0?0:l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(i=>({zero:s.value.bottom-s.value.height*(Math.abs(o.min)/(o.max+Math.abs(o.min))),y:s.value.bottom-s.value.height*((i+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*((i+Math.abs(o.min))/(o.max+Math.abs(o.min))),horizontal_y:s.value.bottom-8,value:i}))}),L=e.computed(()=>{const l=[];for(let r=0;r<z.value;r+=1)l.push({text:t.value.style.chart.grid.x.timeLabels.values[r]||String(r),absoluteIndex:r});return l.slice(c.value.start,c.value.end)}),g=e.computed(()=>{if(!T.value)return[];let l=Array(z.value).fill(0),r=Array(z.value).fill(0),a=Array(z.value).fill(0),o=Array(z.value).fill(0);const i=Math.max(...H.value.positive)||0,n=Math.min(...H.value.negative),b=[-1/0,1/0,NaN,void 0,null].includes(n)?0:n,E=!t.value.style.chart.bars.distributed&&(t.value.style.chart.grid.scale.scaleMax!==null||t.value.style.chart.grid.scale.scaleMin!==null)?u.calculateNiceScaleWithExactExtremes(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks):u.calculateNiceScale(t.value.style.chart.grid.scale.scaleMin!==null?t.value.style.chart.grid.scale.scaleMin:b>0?0:b,t.value.style.chart.grid.scale.scaleMax!==null?t.value.style.chart.grid.scale.scaleMax:i<0?0:i,t.value.style.chart.grid.scale.ticks),{min:N,max:R}=E,$=R+(N>=0?0:Math.abs(N))||1,p=s.value.height,X=s.value.width,$e=w.value[0]?w.value[0].zero:s.value.bottom,Ve=w.value[0]?w.value[0].horizontal_zero:s.value.left;return S.value.filter(O=>!f.value.includes(O.id)).map(O=>{const B=O.series.slice(c.value.start,c.value.end),Ze=O.signedSeries.slice(c.value.start,c.value.end),Ke=B.map((v,m)=>s.value.left+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),Qe=B.map((v,m)=>s.value.top+d.value*m+d.value*t.value.style.chart.bars.gapRatio/4),je=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=p*k,V=$e-x-l[m],l[m]+=x):(x=p*k,V=$e+a[m],a[m]+=Math.abs(x)),V}),et=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;let V,x;return v>0?(x=X*k,V=Ve+r[m],r[m]+=x):(x=X*k,V=Ve-Math.abs(x)-o[m],o[m]+=Math.abs(x)),V}),tt=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?p*k:p*Math.abs(k)}),at=B.map((v,m)=>{const k=t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/$;return v>0?X*k:X*Math.abs(k)}),lt=B.map(v=>Math.abs(v)).reduce((v,m)=>v+m,0);return{...O,proportions:B.map((v,m)=>t.value.style.chart.bars.distributed?(v||0)/I.value[m]:(v||0)/lt),series:B,signedSeries:Ze,x:Ke,y:je,height:tt,horizontal_width:at,horizontal_y:Qe,horizontal_x:et}})}),pe=e.computed(()=>We.value.map((l,r)=>({value:l,sign:l>=0?1:-1})));function U(l,r,a,o,i){const n=i===-1&&l>=0?-l:l;return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,n,u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:n,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function ke(l,r,a,o){return u.applyDataLabel(t.value.style.chart.bars.dataLabels.formatter,l,u.dataLabel({v:isNaN(l)?0:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding}),{datapoint:r,seriesIndex:a,datapointIndex:o})}function xe(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:L.value[l]})}function we(l){P.value=l,D.value=!0;const r=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(g.value)).map(i=>({name:i.name,absoluteIndex:i.absoluteIndex,value:i.series[l]===0?0:(i.signedSeries[l]===-1&&i.series[l]>=0?-i.series[l]:i.series[l])||null,proportion:i.proportions[l]||null,color:i.color,id:i.id}));Z.value={datapoint:a,seriesIndex:l,config:t.value,series:g.value};const o=a.map(i=>Math.abs(i.value)).reduce((i,n)=>i+n,0);if(u.isFunction(r)&&u.functionReturnsString(()=>r({seriesIndex:l,datapoint:a,series:g.value,config:t.value})))K.value=r({seriesIndex:l,datapoint:a,series:g.value,config:t.value});else{const{showValue:i,showPercentage:n,borderColor:b,roundingValue:E,roundingPercentage:N}=t.value.style.chart.tooltip;let R="";L.value[l]&&L.value[l].text&&t.value.style.chart.tooltip.showTimeLabel&&(R+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${b};padding-bottom:6px;margin-bottom:3px;">${L.value[l].text}</div>`);const $=[i&&n?"(":"",i&&n?")":""];a.reverse().forEach(p=>{R+=`
|
|
2
2
|
<div style="display:flex;flex-direction:row;align-items:center;gap:4px">
|
|
3
3
|
<svg viewBox="0 0 60 60" height="14" width="14"><rect rx="5" x="0" y="0" height="60" width="60" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${p.id})`:p.color}"/>${Oe.pattern?`<rect rx="5" x="0" y="0" height="60" width="60" stroke="none" fill="url(#pattern_${C.value}_${p.absoluteIndex})"/>`:""}</svg>
|
|
4
4
|
${p.name}${i||n?":":""} ${i?u.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:p.value,s:t.value.style.chart.bars.dataLabels.suffix,r:E}):""} ${$[0]}${n?u.dataLabel({v:isNaN(p.value/o)?0:Math.abs(p.value)/o*100,s:"%",r:N}):""}${$[1]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-Dy2-pNb6.cjs"),re=require("./useResponsive-DQmBAoBf.cjs"),ge=require("./Title-CEZO2hzQ.cjs"),se=require("./usePrinter-BQEYwy4a.cjs"),ke=require("./Tooltip-BZa-QzER.cjs"),xe=require("./DataTable-zSU-0X__.cjs"),Ce=require("./vue-ui-skeleton-Db7PiDqL.cjs"),we=require("./Shape-D9l3WJGO.cjs"),Be=require("./vue-ui-accordion-dVGUWjXH.cjs"),ne=require("./useNestedProp-DQ8Jt3-Y.cjs"),Se=require("./PackageVersion-DxR-fKLM.cjs"),$e=require("./PenAndPaper-CG9o3ymS.cjs"),Ne=require("./useUserOptionState-BgepsfED.cjs"),_e=require("./useChartAccessibility-Cm7nkzTG.cjs"),Te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Le=["id"],Pe=["xmlns","viewBox"],Ee=["x","y","width","height"],Ae={key:1},ze={key:0},Ve=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Oe={key:1},Fe=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],De=["x1","x2","y1","y2","stroke","stroke-width"],Me=["x1","x2","y1","y2","stroke","stroke-width"],Ie=["x","y","fill","font-size"],We=["x","y","font-size","fill"],qe=["fill","font-size","transform"],Re=["fill","font-size","x","y"],Ge=["x1","x2","y1","y2","stroke"],Ue=["cx","cy","fill"],He=["cx","cy","fill"],je=["id"],Xe=["stop-color"],Ye=["stop-color"],Je=["stop-color"],Ke={key:0},Qe=["x","y","font-size","fill"],Ze={key:5,class:"vue-data-ui-watermark"},et=["innerHTML"],tt={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ue,{expose:ie,emit:ce}){const{vue_ui_strip_plot:ve}=r.useConfig(),v=ue,de=ce,p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(r.createUid()),F=e.ref(0),P=e.ref(!1),E=e.ref(""),g=e.ref(null),D=e.ref(null),M=e.ref(null),I=e.ref(null),W=e.ref(!1),q=e.ref(0),R=e.ref(0),t=e.computed({get:()=>j(),set:l=>l}),{userOptionsVisible:A,setUserOptionsVisibility:G,keepUserOptionState:U}=Ne.useUserOptionState({config:t.value}),{svgRef:H}=_e.useChartAccessibility({config:t.value.style.chart.title});function j(){const l=ne.useNestedProp({userConfig:v.config,defaultConfig:ve});return l.theme?{...ne.useNestedProp({userConfig:r.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>v.config,l=>{t.value=j(),A.value=!t.value.userOptions.showOnChartHover,X(),q.value+=1,R.value+=1,c.value.dataLabels.show=t.value.style.chart.labels.bestPlotLabel.show,c.value.showTable=t.value.table.show,c.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const C=e.ref(null);e.onMounted(()=>{X()});function X(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(o=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:o,index:s})}),l.plots&&l.plots.forEach((o,n)=>{r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=re.throttle(()=>{const{width:s,height:o}=re.useResponsive({chart:g.value,title:t.value.style.chart.title.text?D.value:null,source:M.value,noTitle:I.value});requestAnimationFrame(()=>{w.value=o,y.value.width=s,y.value.height=o,x.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=r.translateSize({relator:Math.min(o,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})})});C.value=new ResizeObserver(l),C.value.observe(g.value.parentNode)}W.value=!0,setTimeout(()=>{k.value=!1},pe.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:Y,isImaging:J,generatePdf:K,generateImage:Q}=se.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot",options:t.value.userOptions.print}),he=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Z=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),k=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),x=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),y=e.ref({width:x.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),a=e.computed(()=>{const l=x.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:x.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:x.value,absoluteHeight:w.value,absoluteWidth:l}}),S=e.computed(()=>p.value?v.dataset.map((l,s)=>{const o=r.createUid();return{...l,id:o,color:l.color?r.convertColorToHex(l.color):Z.value[s]||r.palette[s]||r.palette[s%r.palette.length],plots:l.plots.map(n=>({...n,value:r.checkNaN(n.value),parentId:o,color:l.color?r.convertColorToHex(l.color):Z.value[s]||r.palette[s]||r.palette[s%r.palette.length],id:r.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(S.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,x:a.value.left+(s+1)*a.value.stripWidth-a.value.stripWidth/2}))}))),pe=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),z=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(o=>o.value));return{max:Math.max(...l),min:Math.min(...l)}}),f=e.computed(()=>r.calculateNiceScale(z.value.min<0?z.value.min:0,z.value.max,t.value.style.chart.grid.scaleSteps)),fe=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,y:a.value.bottom-(o.value+Math.abs(f.value.min))/(f.value.max+Math.abs(f.value.min))*a.value.height}))}))),ee=e.computed(()=>f.value.ticks.map(l=>({y:a.value.bottom-a.value.height*((l+Math.abs(f.value.min))/(f.value.max+Math.abs(f.value.min))),x1:a.value.left,x2:a.value.right,value:l}))),V=e.ref(null),i=e.ref(null);function me({datapoint:l,seriesIndex:s}){V.value={datapoint:l,seriesIndex:s,config:t.value,series:S.value},P.value=!0,i.value=l;const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:s,datapoint:l,series:S.value,config:t.value})))E.value=o({seriesIndex:s,datapoint:l,series:S.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>${r.applyDataLabel(t.value.style.chart.labels.formatter,l.value,r.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,E.value=`<div>${n}</div>`}}const $=e.computed(()=>{const l=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${o.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function te(){e.nextTick(()=>{const l=$.value.head.map((n,u)=>[[n.name],[$.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),o=r.createCsvContent(s);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const N=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=$.value.head.map((u,m)=>{const T=r.dataLabel({p:t.value.style.chart.labels.prefix,v:$.value.body[m],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},T]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:o}}),b=e.ref(!1);function ye(l){b.value=l,F.value+=1}function be(){return h.value}function le(){c.value.showTable=!c.value.showTable}function oe(){c.value.dataLabels.show=!c.value.dataLabels.show}function ae(){c.value.showTooltip=!c.value.showTooltip}const _=e.ref(!1);function O(){_.value=!_.value}return ie({getData:be,generatePdf:K,generateCsv:te,generateImage:Q,toggleTable:le,toggleLabels:oe,toggleTooltip:ae,toggleAnnotator:O}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:g,class:e.normalizeClass(`vue-ui-strip-plot ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`,onMouseenter:s[2]||(s[2]=()=>e.unref(G)(!0)),onMouseleave:s[3]||(s[3]=()=>e.unref(G)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock($e._sfc_main,{key:0,svgRef:e.unref(H),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:_.value,onClose:O},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:I,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:D,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ge._sfc_main,{key:`title_${q.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.unref(U)||e.unref(A))?(e.openBlock(),e.createBlock(se.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Y),isImaging:e.unref(J),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:b.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:_.value,onToggleFullscreen:ye,onGeneratePdf:e.unref(K),onGenerateCsv:te,onGenerateImage:e.unref(Q),onToggleTable:le,onToggleLabels:oe,onToggleTooltip:ae,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(U)?e.unref(A)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:o,color:n})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:o,color:n})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"6"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"7"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:H,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.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(Se._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.value.left,y:a.value.top,width:a.value.width,height:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Ee)):e.createCommentVNode("",!0),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",Ae,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,o=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y,y2:o.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,Ve))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",Oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("line",{x1:a.value.left+(n+1)*a.value.stripWidth,x2:a.value.left+(n+1)*a.value.stripWidth,y1:a.value.top,y2:a.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,Fe))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:a.value.left,x2:a.value.left,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,De),e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:a.value.bottom,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Me)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(ee.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:o.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.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(r.applyDataLabel)(t.value.style.chart.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.labels.prefix,v:o.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:o,seriesIndex:n})),9,Ie))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.value.left+(n+1)*a.value.stripWidth-a.value.stripWidth/2,y:a.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(o.name),9,We))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:4,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}, ${a.value.top+a.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,qe)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:5,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:a.value.left+a.value.width/2,y:a.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Re)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[e.createElementVNode("line",{x1:a.value.left,x2:a.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,Ge),e.createElementVNode("circle",{cx:a.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ue),e.createElementVNode("circle",{cx:a.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,He)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,o=>(e.openBlock(),e.createElementBlock("radialGradient",{id:o.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,Xe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(r.darkenHexColor)(o.color,.1)},null,8,Ye),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,Je)],8,je))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,m)=>(e.openBlock(),e.createBlock(we._sfc_main,e.mergeProps({plot:{x:u.x,y:W.value?u.y:a.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(#${o.id})`:o.color,onMouseenter:T=>me({datapoint:u,seriesIndex:m}),onMouseleave:s[0]||(s[0]=T=>{P.value=!1,i.value=null}),onClick:T=>de("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${k.value?`transition-delay:${m*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&k.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!k.value}},{ref_for:!0},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[m===o.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&k.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(r.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:m}):""),13,Qe)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,Pe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ze,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Y)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ce.default,{key:6,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:M,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ke._sfc_main,{show:c.value.showTooltip&&P.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:g.value,content:E.value,isFullscreen:b.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),p.value?(e.openBlock(),e.createBlock(Be.default,{key:8,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(xe.DataTable,{key:`table_${R.value}`,colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=o=>c.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,et)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Le))}},lt=Te._export_sfc(tt,[["__scopeId","data-v-409e2195"]]);exports.default=lt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DlALYfRS.cjs"),re=require("./useResponsive-DQmBAoBf.cjs"),ge=require("./Title-BiyGREAz.cjs"),se=require("./usePrinter-n1HzfoSm.cjs"),ke=require("./Tooltip-C-Kq18lz.cjs"),xe=require("./DataTable-OM4js4qI.cjs"),Ce=require("./vue-ui-skeleton-C-I7hIHS.cjs"),we=require("./Shape-CHiMFkEQ.cjs"),Be=require("./vue-ui-accordion-CByAeInD.cjs"),ne=require("./useNestedProp-BZX7zlGv.cjs"),Se=require("./PackageVersion-Di-ZyR0_.cjs"),$e=require("./PenAndPaper-CtYhqkG5.cjs"),Ne=require("./useUserOptionState-BgepsfED.cjs"),_e=require("./useChartAccessibility-Cm7nkzTG.cjs"),Te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Le=["id"],Pe=["xmlns","viewBox"],Ee=["x","y","width","height"],Ae={key:1},ze={key:0},Ve=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],Oe={key:1},Fe=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],De=["x1","x2","y1","y2","stroke","stroke-width"],Me=["x1","x2","y1","y2","stroke","stroke-width"],Ie=["x","y","fill","font-size"],We=["x","y","font-size","fill"],qe=["fill","font-size","transform"],Re=["fill","font-size","x","y"],Ge=["x1","x2","y1","y2","stroke"],Ue=["cx","cy","fill"],He=["cx","cy","fill"],je=["id"],Xe=["stop-color"],Ye=["stop-color"],Je=["stop-color"],Ke={key:0},Qe=["x","y","font-size","fill"],Ze={key:5,class:"vue-data-ui-watermark"},et=["innerHTML"],tt={__name:"vue-ui-strip-plot",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(ue,{expose:ie,emit:ce}){const{vue_ui_strip_plot:ve}=r.useConfig(),v=ue,de=ce,p=e.computed({get(){return!!v.dataset&&v.dataset.length},set(l){return l}}),L=e.ref(r.createUid()),F=e.ref(0),P=e.ref(!1),E=e.ref(""),g=e.ref(null),D=e.ref(null),M=e.ref(null),I=e.ref(null),W=e.ref(!1),q=e.ref(0),R=e.ref(0),t=e.computed({get:()=>j(),set:l=>l}),{userOptionsVisible:A,setUserOptionsVisibility:G,keepUserOptionState:U}=Ne.useUserOptionState({config:t.value}),{svgRef:H}=_e.useChartAccessibility({config:t.value.style.chart.title});function j(){const l=ne.useNestedProp({userConfig:v.config,defaultConfig:ve});return l.theme?{...ne.useNestedProp({userConfig:r.themes.vue_ui_strip_plot[l.theme]||v.config,defaultConfig:l}),customPalette:r.themePalettes[l.theme]||r.palette}:l}e.watch(()=>v.config,l=>{t.value=j(),A.value=!t.value.userOptions.showOnChartHover,X(),q.value+=1,R.value+=1,c.value.dataLabels.show=t.value.style.chart.labels.bestPlotLabel.show,c.value.showTable=t.value.table.show,c.value.showTooltip=t.value.style.chart.tooltip.show},{deep:!0});const C=e.ref(null);e.onMounted(()=>{X()});function X(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiStripPlot",type:"dataset"}):v.dataset.forEach((l,s)=>{r.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","plots"]}).forEach(o=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:o,index:s})}),l.plots&&l.plots.forEach((o,n)=>{r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","value"]}).forEach(u=>{p.value=!1,r.error({componentName:"VueUiStripPlot",type:"datasetSerieAttribute",property:u,index:`${s},${n}`})})})}),t.value.responsive){const l=re.throttle(()=>{const{width:s,height:o}=re.useResponsive({chart:g.value,title:t.value.style.chart.title.text?D.value:null,source:M.value,noTitle:I.value});requestAnimationFrame(()=>{w.value=o,y.value.width=s,y.value.height=o,x.value=(s-d.value.left-d.value.right)/v.dataset.length,B.value=r.translateSize({relator:Math.min(o,s),adjuster:600,source:t.value.style.chart.plots.radius,threshold:6,fallback:6})})});C.value=new ResizeObserver(l),C.value.observe(g.value.parentNode)}W.value=!0,setTimeout(()=>{k.value=!1},pe.value*50)}e.onBeforeUnmount(()=>{C.value&&C.value.disconnect()});const{isPrinting:Y,isImaging:J,generatePdf:K,generateImage:Q}=se.usePrinter({elementId:`strip-plot_${L.value}`,fileName:t.value.style.chart.title.text||"vue-ui-strip-plot",options:t.value.userOptions.print}),he=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),Z=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),k=e.ref(t.value.useCssAnimation),c=e.ref({showTable:t.value.table.show,dataLabels:{show:t.value.style.chart.labels.bestPlotLabel.show},showTooltip:t.value.style.chart.tooltip.show}),d=e.ref({top:t.value.style.chart.padding.top,bottom:t.value.style.chart.padding.bottom,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right}),x=e.ref(t.value.style.chart.stripWidth),w=e.ref(t.value.style.chart.height),B=e.ref(t.value.style.chart.plots.radius),y=e.ref({width:x.value*v.dataset.length+d.value.left+d.value.right,height:t.value.style.chart.height}),a=e.computed(()=>{const l=x.value*v.dataset.length+d.value.left+d.value.right;return{left:d.value.left,right:l-d.value.right,top:d.value.top,bottom:w.value-d.value.bottom,width:x.value*v.dataset.length,height:w.value-d.value.top-d.value.bottom,stripWidth:x.value,absoluteHeight:w.value,absoluteWidth:l}}),S=e.computed(()=>p.value?v.dataset.map((l,s)=>{const o=r.createUid();return{...l,id:o,color:l.color?r.convertColorToHex(l.color):Z.value[s]||r.palette[s]||r.palette[s%r.palette.length],plots:l.plots.map(n=>({...n,value:r.checkNaN(n.value),parentId:o,color:l.color?r.convertColorToHex(l.color):Z.value[s]||r.palette[s]||r.palette[s%r.palette.length],id:r.createUid()})).sort((n,u)=>n.value-u.value)}}):null),h=e.computed(()=>(S.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,x:a.value.left+(s+1)*a.value.stripWidth-a.value.stripWidth/2}))}))),pe=e.computed(()=>Math.max(...h.value.map(l=>l.plots.length))),z=e.computed(()=>{const l=h.value.flatMap(s=>s.plots.map(o=>o.value));return{max:Math.max(...l),min:Math.min(...l)}}),f=e.computed(()=>r.calculateNiceScale(z.value.min<0?z.value.min:0,z.value.max,t.value.style.chart.grid.scaleSteps)),fe=e.computed(()=>(h.value||[]).map((l,s)=>({...l,plots:l.plots.map(o=>({...o,y:a.value.bottom-(o.value+Math.abs(f.value.min))/(f.value.max+Math.abs(f.value.min))*a.value.height}))}))),ee=e.computed(()=>f.value.ticks.map(l=>({y:a.value.bottom-a.value.height*((l+Math.abs(f.value.min))/(f.value.max+Math.abs(f.value.min))),x1:a.value.left,x2:a.value.right,value:l}))),V=e.ref(null),i=e.ref(null);function me({datapoint:l,seriesIndex:s}){V.value={datapoint:l,seriesIndex:s,config:t.value,series:S.value},P.value=!0,i.value=l;const o=t.value.style.chart.tooltip.customFormat;if(r.isFunction(o)&&r.functionReturnsString(()=>o({seriesIndex:s,datapoint:l,series:S.value,config:t.value})))E.value=o({seriesIndex:s,datapoint:l,series:S.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>${r.applyDataLabel(t.value.style.chart.labels.formatter,l.value,r.dataLabel({p:t.value.style.chart.labels.prefix,v:l.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:l,seriesIndex:s})}</div>`,E.value=`<div>${n}</div>`}}const $=e.computed(()=>{const l=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>({name:`${o.name} - ${n.name}`,color:n.color}))),s=h.value.flatMap(o=>JSON.parse(JSON.stringify(o.plots)).sort((n,u)=>u.value-n.value).map(n=>n.value));return{head:l,body:s}});function te(){e.nextTick(()=>{const l=$.value.head.map((n,u)=>[[n.name],[$.value.body[u]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[t.value.table.columnNames.series],[t.value.table.columnNames.value]]].concat(l),o=r.createCsvContent(s);r.downloadCsv({csvContent:o,title:t.value.style.chart.title.text||"vue-ui-strip-plot"})})}const N=e.computed(()=>{const l=[t.value.table.columnNames.series,t.value.table.columnNames.value],s=$.value.head.map((u,m)=>{const T=r.dataLabel({p:t.value.style.chart.labels.prefix,v:$.value.body[m],s:t.value.style.chart.labels.suffix,r:t.value.table.td.roundingValue});return[{color:u.color,name:u.name},T]}),o={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.series,t.value.table.columnNames.value],head:l,body:s,config:o}}),b=e.ref(!1);function ye(l){b.value=l,F.value+=1}function be(){return h.value}function le(){c.value.showTable=!c.value.showTable}function oe(){c.value.dataLabels.show=!c.value.dataLabels.show}function ae(){c.value.showTooltip=!c.value.showTooltip}const _=e.ref(!1);function O(){_.value=!_.value}return ie({getData:be,generatePdf:K,generateCsv:te,generateImage:Q,toggleTable:le,toggleLabels:oe,toggleTooltip:ae,toggleAnnotator:O}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"stripPlotChart",ref:g,class:e.normalizeClass(`vue-ui-strip-plot ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height:100%":""}`),id:`strip-plot_${L.value}`,onMouseenter:s[2]||(s[2]=()=>e.unref(G)(!0)),onMouseleave:s[3]||(s[3]=()=>e.unref(G)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock($e._sfc_main,{key:0,svgRef:e.unref(H),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:_.value,onClose:O},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:I,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:D,style:"width:100%;background:transparent;padding-bottom:24px"},[(e.openBlock(),e.createBlock(ge._sfc_main,{key:`title_${q.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.unref(U)||e.unref(A))?(e.openBlock(),e.createBlock(se.UserOptions,{ref:"details",key:`user_option_${F.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(Y),isImaging:e.unref(J),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:b.value,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:_.value,onToggleFullscreen:ye,onGeneratePdf:e.unref(K),onGenerateCsv:te,onGenerateImage:e.unref(Q),onToggleTable:le,onToggleLabels:oe,onToggleTooltip:ae,onToggleAnnotator:O,style:e.normalizeStyle({visibility:e.unref(U)?e.unref(A)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:o,color:n})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:o,color:n})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,l.$slots.optionLabels?{name:"optionLabels",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionLabels",{},void 0,!0)]),key:"6"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"7"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"8"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasLabel","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:H,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.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(Se._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:a.value.left,y:a.value.top,width:a.value.width,height:a.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Ee)):e.createCommentVNode("",!0),t.value.style.chart.grid.show?(e.openBlock(),e.createElementBlock("g",Ae,[t.value.style.chart.grid.horizontalGrid.show?(e.openBlock(),e.createElementBlock("g",ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,o=>(e.openBlock(),e.createElementBlock("line",{x1:o.x1,x2:o.x2,y1:o.y,y2:o.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,Ve))),256))])):e.createCommentVNode("",!0),t.value.style.chart.grid.verticalGrid.show?(e.openBlock(),e.createElementBlock("g",Oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("line",{x1:a.value.left+(n+1)*a.value.stripWidth,x2:a.value.left+(n+1)*a.value.stripWidth,y1:a.value.top,y2:a.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,Fe))),256))])):e.createCommentVNode("",!0),e.createElementVNode("line",{x1:a.value.left,x2:a.value.left,y1:a.value.top,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,De),e.createElementVNode("line",{x1:a.value.left,x2:a.value.right,y1:a.value.bottom,y2:a.value.bottom,stroke:t.value.style.chart.grid.stroke,"stroke-width":t.value.style.chart.grid.strokeWidth,"stroke-linecap":"round"},null,8,Me)])):e.createCommentVNode("",!0),t.value.style.chart.labels.yAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(ee.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:o.x1-t.value.style.chart.labels.yAxisLabels.fontSize/2+t.value.style.chart.labels.yAxisLabels.offsetX,y:o.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(r.applyDataLabel)(t.value.style.chart.labels.formatter,o.value,e.unref(r.dataLabel)({p:t.value.style.chart.labels.prefix,v:o.value,s:t.value.style.chart.labels.suffix,r:t.value.style.chart.labels.yAxisLabels.rounding}),{datapoint:o,seriesIndex:n})),9,Ie))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.xAxisLabels.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(h.value,(o,n)=>(e.openBlock(),e.createElementBlock("text",{x:a.value.left+(n+1)*a.value.stripWidth-a.value.stripWidth/2,y:a.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(o.name),9,We))),256)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.yLabel?(e.openBlock(),e.createElementBlock("text",{key:4,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}, ${a.value.top+a.value.height/2}) rotate(-90)`,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.yLabel),9,qe)):e.createCommentVNode("",!0),t.value.style.chart.labels.axis.xLabel?(e.openBlock(),e.createElementBlock("text",{key:5,fill:t.value.style.chart.labels.axis.color,"font-size":t.value.style.chart.labels.axis.fontSize,x:a.value.left+a.value.width/2,y:a.value.absoluteHeight,"text-anchor":"middle"},e.toDisplayString(t.value.style.chart.labels.axis.xLabel),9,Re)):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:6},[e.createElementVNode("line",{x1:a.value.left,x2:a.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,Ge),e.createElementVNode("circle",{cx:a.value.left,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,Ue),e.createElementVNode("circle",{cx:a.value.right,cy:i.value.y,r:3,fill:i.value.color,class:e.normalizeClass({"select-circle":t.value.useCssAnimation})},null,10,He)],64)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,o=>(e.openBlock(),e.createElementBlock("radialGradient",{id:o.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(r.lightenHexColor)(o.color,t.value.style.chart.plots.gradient.intensity/100)},null,8,Xe),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(r.darkenHexColor)(o.color,.1)},null,8,Ye),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,Je)],8,je))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(o,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,m)=>(e.openBlock(),e.createBlock(we._sfc_main,e.mergeProps({plot:{x:u.x,y:W.value?u.y:a.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(#${o.id})`:o.color,onMouseenter:T=>me({datapoint:u,seriesIndex:m}),onMouseleave:s[0]||(s[0]=T=>{P.value=!1,i.value=null}),onClick:T=>de("selectDatapoint",u),style:`transition: all 0.2s ease-in-out; opacity:${i.value?i.value.id===u.id?1:.2:t.value.style.chart.plots.opacity};${k.value?`transition-delay:${m*50}ms`:""}`,class:{"vue-ui-strip-plot-animated":t.value.useCssAnimation&&k.value,"vue-ui-strip-plot-select-circle":t.value.useCssAnimation&&!k.value}},{ref_for:!0},l.$attrs),null,16,["plot","radius","shape","stroke","strokeWidth","color","onMouseenter","onClick","style","class"]))),256)),c.value.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.plots,(u,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[m===o.plots.length-1||i.value&&i.value.id===u.id&&!c.value.showTooltip?(e.openBlock(),e.createElementBlock("text",{key:0,x:u.x,y:u.y+t.value.style.chart.labels.bestPlotLabel.offsetY-B.value*(i.value&&i.value.id===u.id&&!c.value.showTooltip?2:1.5),"font-size":t.value.style.chart.labels.bestPlotLabel.fontSize,fill:t.value.style.chart.labels.bestPlotLabel.color,"text-anchor":"middle",style:e.normalizeStyle(`opacity:${t.value.useCssAnimation&&k.value?0:1};transition:opacity 0.2s ease-in;`)},e.toDisplayString(u.name)+" "+e.toDisplayString(t.value.style.chart.labels.bestPlotLabel.showValue?e.unref(r.applyDataLabel)(t.value.style.chart.labels.formatter,u.value,e.unref(r.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:m}):""),13,Qe)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0)],64))),256)),e.renderSlot(l.$slots,"svg",{svg:a.value},void 0,!0)],14,Pe)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ze,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(Y)||e.unref(J)})),void 0,!0)])):e.createCommentVNode("",!0),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ce.default,{key:6,config:{type:"stripPlot",style:{backgroundColor:t.value.style.chart.backgroundColor,stripPlot:{color:"#CCCCCC"}}}},null,8,["config"])),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:M,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(ke._sfc_main,{show:c.value.showTooltip&&P.value,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:g.value,content:E.value,isFullscreen:b.value,isCustom:e.unref(r.isFunction)(t.value.style.chart.tooltip.customFormat)},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...V.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),p.value?(e.openBlock(),e.createBlock(Be.default,{key:8,hideDetails:"",config:{open:c.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(xe.DataTable,{key:`table_${R.value}`,colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=o=>c.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createElementVNode("div",{innerHTML:o,style:{display:"flex","align-items":"center"}},null,8,et)]),td:e.withCtx(({td:o})=>[e.createTextVNode(e.toDisplayString(o.name||o),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Le))}},lt=Te._export_sfc(tt,[["__scopeId","data-v-409e2195"]]);exports.default=lt;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { computed as f, ref as n, watch as Ue, onMounted as Ve, onBeforeUnmount as Ee, createElementBlock as u, openBlock as s, unref as v, normalizeStyle as B, normalizeClass as M, createBlock as T, createCommentVNode as c, createVNode as _e, createSlots as He, withCtx as y, renderSlot as p, normalizeProps as P, guardReactiveProps as z, createElementVNode as k, Fragment as g, renderList as w, toDisplayString as L, mergeProps as Be, createTextVNode as Xe, nextTick as je } from "vue";
|
|
2
|
-
import { u as Ye, c as ee, t as qe, p as A, a as Je, o as Ke, e as te, g as Te, b as Qe, d as Le, v as Ze, D as et, f as X, X as tt, i as le, l as lt, h as at, x as Ae, F as ot, q as st, r as rt, y as ut } from "./index-
|
|
2
|
+
import { u as Ye, c as ee, t as qe, p as A, a as Je, o as Ke, e as te, g as Te, b as Qe, d as Le, v as Ze, D as et, f as X, X as tt, i as le, l as lt, h as at, x as Ae, F as ot, q as st, r as rt, y as ut } from "./index-bVqxfptX.js";
|
|
3
3
|
import { t as it, u as nt } from "./useResponsive-Cw4oZ8sQ.js";
|
|
4
|
-
import { _ as vt } from "./Title-
|
|
5
|
-
import { u as ct, U as ht } from "./usePrinter-
|
|
6
|
-
import { _ as dt } from "./Tooltip-
|
|
7
|
-
import { D as pt } from "./DataTable-
|
|
8
|
-
import ft from "./vue-ui-skeleton-
|
|
9
|
-
import { _ as yt } from "./Shape-
|
|
10
|
-
import bt from "./vue-ui-accordion-
|
|
11
|
-
import { u as Se } from "./useNestedProp-
|
|
12
|
-
import { _ as mt } from "./PackageVersion-
|
|
13
|
-
import { _ as gt } from "./PenAndPaper-
|
|
4
|
+
import { _ as vt } from "./Title-B55VMGbm.js";
|
|
5
|
+
import { u as ct, U as ht } from "./usePrinter-BbeIGqpA.js";
|
|
6
|
+
import { _ as dt } from "./Tooltip-CMiCE06y.js";
|
|
7
|
+
import { D as pt } from "./DataTable-BaAjwD5U.js";
|
|
8
|
+
import ft from "./vue-ui-skeleton-BARmXI9_.js";
|
|
9
|
+
import { _ as yt } from "./Shape-DJcgH2ks.js";
|
|
10
|
+
import bt from "./vue-ui-accordion-DQKCLM2T.js";
|
|
11
|
+
import { u as Se } from "./useNestedProp-DU-vsdTb.js";
|
|
12
|
+
import { _ as mt } from "./PackageVersion-gI4tUgWr.js";
|
|
13
|
+
import { _ as gt } from "./PenAndPaper-Di3hcmp3.js";
|
|
14
14
|
import { u as kt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
15
15
|
import { u as xt } from "./useChartAccessibility-BWojgys7.js";
|
|
16
16
|
import { _ as wt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a4 as z, A as P, l as T, r as U, f as V, h as X, q as j, z as Y, d as W, G as J, u as K, p as Z } from "./index-
|
|
2
|
-
import q from "./vue-ui-xy-
|
|
3
|
-
import Q from "./vue-ui-donut-
|
|
1
|
+
import { a4 as z, A as P, l as T, r as U, f as V, h as X, q as j, z as Y, d as W, G as J, u as K, p as Z } from "./index-bVqxfptX.js";
|
|
2
|
+
import q from "./vue-ui-xy-BN9Lh6Ic.js";
|
|
3
|
+
import Q from "./vue-ui-donut-m7KcUt0k.js";
|
|
4
4
|
import { resolveComponent as x, createElementBlock as u, openBlock as c, normalizeStyle as g, createElementVNode as a, createCommentVNode as b, toDisplayString as d, Fragment as I, renderList as _, normalizeClass as p, createTextVNode as w, withDirectives as O, vModelText as S, withKeys as L, withModifiers as A, vModelSelect as $, createBlock as E, createVNode as ee } from "vue";
|
|
5
5
|
import { _ as te } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const se = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./index-DlALYfRS.cjs"),S=require("./vue-ui-xy-BkQt8l_A.cjs"),w=require("./vue-ui-donut-BtvQmKji.cjs"),e=require("vue"),_=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),O={name:"vue-ui-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},components:{VueUiXy:S.default,VueUiDonut:w.default},data(){return{uid:`vue-ui-table-${Math.random()}`,bodyCopy:JSON.parse(JSON.stringify(this.dataset.body)).map((n,o)=>({...n,absoluteIndex:o})),buttonTimeout:null,canMoveChart:!1,chart:{height:316,type:"bar",width:512},constants:{ASC:1,BAR:"bar",DATE:"date",DESC:-1,DONUT:"donut",LINE:"line",NUMERIC:"numeric",PERCENTAGE:"percentage",TEXT:"text"},clientX:100,clientY:100,dragOffsetX:0,dragOffsetY:0,modalWidth:400,modalHeight:200,cssClass:{CELL:"smart-td-selected",FIRST_TD:"smart-td-selected-first",LAST_TD:"smart-td-selected-last",ROW:"smart-td-selected-neighbor"},currentDonut:void 0,currentFilter:void 0,currentSearch:void 0,currentSelectionSpan:{col:void 0,rows:[]},currentPage:0,dates:{},filteredDatesIndexes:{},hasNaN:{},iconColor:"#2D353C",iconSize:20,immutableRangeFilters:{},isExportRequest:!1,isLoading:!1,itemsPerPage:this.config.rowsPerPage?this.config.rowsPerPage:25,multiselects:{},paginatorOptions:[...new Set([10,25,50,100,250,500,this.config.rowsPerPage?this.config.rowsPerPage:25,this.dataset.body.length])].sort((n,o)=>n-o),palette:N.palette,percentages:{},rafId:null,rangeFilters:{},searches:{},selectedColumn:void 0,selectedDonutCategory:void 0,selectedPlot:void 0,showChart:!1,showDonutOptions:!1,sorts:{},tableBody:JSON.parse(JSON.stringify(this.dataset.body)).map((n,o)=>({...n,absoluteIndex:o})),tableHead:JSON.parse(JSON.stringify(this.dataset.header)).map(n=>({average:Object.hasOwn(n,"average")?n.average:!1,decimals:Object.hasOwn(n,"decimals")?n.decimals:0,isMultiselect:Object.hasOwn(n,"isMultiselect")?n.isMultiselect:!1,isPercentage:Object.hasOwn(n,"isPercentage")?n.isPercentage:!1,isSearch:Object.hasOwn(n,"isSearch")?n.isSearch:!1,isSort:Object.hasOwn(n,"isSort")?n.isSort:!1,name:n.name,percentageTo:Object.hasOwn(n,"percentageTo")?n.percentageTo:void 0,prefix:Object.hasOwn(n,"prefix")?n.prefix:"",rangeFilter:Object.hasOwn(n,"rangeFilter")?n.rangeFilter:!1,suffix:Object.hasOwn(n,"suffix")?n.suffix:"",sum:Object.hasOwn(n,"sum")?n.sum:!1,type:n.type}))}},mounted(){if(this.dataset.header.length===0)throw new Error(`vue-ui-table error: missing header data.
|
|
2
2
|
Provide an array of objects of type:
|
|
3
3
|
{
|
|
4
4
|
name: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCssVars as te, computed as v, ref as h, useSlots as ae, onMounted as z, watch as oe, createElementBlock as l, openBlock as n, unref as u, normalizeClass as E, normalizeStyle as C, createBlock as se, createCommentVNode as c, createElementVNode as g, createSlots as ne, withCtx as b, renderSlot as r, normalizeProps as G, guardReactiveProps as B, Fragment as k, renderList as w, mergeProps as f, createVNode as le, nextTick as re } from "vue";
|
|
2
|
-
import { u as ue, c as H, a as ie, o as de, e as pe, a5 as ve, G as ce, N as me, q as fe, r as he } from "./index-
|
|
3
|
-
import { u as A } from "./useNestedProp-
|
|
4
|
-
import { u as ge, U as be } from "./usePrinter-
|
|
5
|
-
import { _ as ye } from "./Shape-
|
|
2
|
+
import { u as ue, c as H, a as ie, o as de, e as pe, a5 as ve, G as ce, N as me, q as fe, r as he } from "./index-bVqxfptX.js";
|
|
3
|
+
import { u as A } from "./useNestedProp-DU-vsdTb.js";
|
|
4
|
+
import { u as ge, U as be } from "./usePrinter-BbeIGqpA.js";
|
|
5
|
+
import { _ as ye } from "./Shape-DJcgH2ks.js";
|
|
6
6
|
import { u as Ce } from "./useUserOptionState-BIvW1Kz7.js";
|
|
7
7
|
import { _ as ke } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
const _e = ["id"], Ie = { role: "cell" }, $e = { role: "row" }, we = ["data-cell"], Oe = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-DlALYfRS.cjs"),$=require("./useNestedProp-BZX7zlGv.cjs"),w=require("./usePrinter-n1HzfoSm.cjs"),q=require("./Shape-CHiMFkEQ.cjs"),G=require("./useUserOptionState-BgepsfED.cjs"),H=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),L=["id"],A={role:"cell"},D={role:"row"},X=["data-cell"],W={key:0,style:{display:"flex","flex-direction":"row",gap:"2px","align-items":"center"}},J=["height","width"],K={key:0,role:"cell","data-cell":"sum"},Q={key:1,role:"cell","data-cell":"average"},Y={key:2,role:"cell","data-cell":"median"},Z={key:1,ref:"source",dir:"auto"},j={__name:"vue-ui-table-heatmap",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(P,{expose:N}){e.useCssVars(t=>({"1e8210e3":T.value,"7fb93384":R.value}));const{vue_ui_table_heatmap:E}=a.useConfig(),d=P,p=e.ref(a.createUid()),s=e.ref(!1),c=e.ref(null),m=e.ref(!1),f=e.ref(0),V=e.useSlots();e.onMounted(()=>{V["chart-background"]&&console.warn("VueUiTableHeatmap does not support the #chart-background slot.")});const o=e.computed({get:()=>y(),set:t=>t}),{userOptionsVisible:v,setUserOptionsVisibility:g,keepUserOptionState:h}=G.useUserOptionState({config:o.value});function y(){const t=$.useNestedProp({userConfig:d.config,defaultConfig:E});return t.theme?{...$.useNestedProp({userConfig:a.themes.vue_ui_table_heatmap[t.theme]||d.config,defaultConfig:t})}:t}e.watch(()=>d.config,t=>{o.value=y(),v.value=!o.value.userOptions.showOnChartHover,C()},{deep:!0});const{isPrinting:O,isImaging:x,generatePdf:k,generateImage:b}=w.usePrinter({elementId:`table_heatmap_${p.value}`,fileName:"vue-ui-table-heatmap",options:o.value.userOptions.print}),F=e.computed(()=>o.value.table.responsiveBreakpoint),z=e.computed(()=>!!d.dataset&&d.dataset.length);e.onMounted(()=>{C()});function C(){a.objectIsEmpty(d.dataset)&&a.error({componentName:"VueUiTableHeatmap",type:"dataset"});const t=new ResizeObserver(r=>{r.forEach(n=>{s.value=n.contentRect.width<F.value})});c.value&&t.observe(c.value)}const _=e.computed(()=>d.dataset.map(t=>{const r=t.values.map(l=>isNaN(l)?0:l),n=r.reduce((l,i)=>l+i,0);return{...t,values:r,serieExtremes:{max:Math.max(...r),min:Math.min(...r)},sum:n,average:n/r.length,median:a.calcMedian(r),displayValues:[t.name,...t.values],id:a.createUid()}})),B=e.computed(()=>{const t=_.value.flatMap(r=>r.values);return{min:Math.min(...t),max:Math.max(...t)}});function M(t,r){const n=o.value.style.heatmapColors.useIndividualScale;return a.interpolateColorHex(o.value.style.heatmapColors.min,o.value.style.heatmapColors.max,n?r.min:B.value.min,n?r.max:B.value.max,t)}const I=e.computed(()=>_.value.map(t=>({...t,colors:t.displayValues.map(r=>isNaN(r)?o.value.style.backgroundColor:M(r,t.serieExtremes))}))),R=e.computed(()=>o.value.style.backgroundColor),T=e.computed(()=>`${o.value.table.borderWidth}px`);function S(){e.nextTick(()=>{const t=I.value.map(l=>[[l.name],l.displayValues,[l.sum],[l.average],[l.median]]),r=[[[""],o.value.table.head.values,["sum"],["average"],["median"]]].concat(t),n=a.createCsvContent(r);a.downloadCsv({csvContent:n,title:"vue-ui-table-heatmap"})})}function U(t){m.value=t,f.value+=1}return N({generatePdf:k,generateCsv:S,generateImage:b}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:c,style:e.normalizeStyle(`width:100%; overflow-x:auto; container-type: inline-size;padding-top:${o.value.userOptions.show?"36px":""}; ${m.value?"vue-data-ui-wrapper-fullscreen":""}; position:relative;`),class:e.normalizeClass({"vue-ui-responsive":s.value}),id:`table_heatmap_${p.value}`,onMouseenter:r[0]||(r[0]=()=>e.unref(g)(!0)),onMouseleave:r[1]||(r[1]=()=>e.unref(g)(!1))},[o.value.userOptions.show&&z.value&&(e.unref(h)||e.unref(v))?(e.openBlock(),e.createBlock(w.UserOptions,{ref:"details",key:`user_option_${f.value}`,backgroundColor:o.value.style.backgroundColor,color:o.value.style.color,isPrinting:e.unref(O),isImaging:e.unref(x),uid:p.value,hasPdf:o.value.userOptions.buttons.pdf,hasXls:o.value.userOptions.buttons.csv,hasImg:o.value.userOptions.buttons.img,hasFullscreen:o.value.userOptions.buttons.fullscreen,isFullscreen:m.value,titles:{...o.value.userOptions.buttonTitles},chartElement:c.value,position:o.value.userOptions.position,onToggleFullscreen:U,onGeneratePdf:e.unref(k),onGenerateCsv:S,onGenerateImage:e.unref(b),style:e.normalizeStyle({visibility:e.unref(h)?e.unref(v)?"visible":"hidden":"visible"})},e.createSlots({_:2},[t.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:n,color:l})=>[e.renderSlot(t.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:n,color:l})),void 0,!0)]),key:"0"}:void 0,t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:n,isFullscreen:l})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:n,isFullscreen:l})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),e.createElementVNode("table",{class:e.normalizeClass({"vue-ui-table-heatmap":!0}),style:e.normalizeStyle(`width:100%;font-family:${o.value.style.fontFamily};background:${o.value.style.backgroundColor};`)},[e.createElementVNode("caption",null,[e.renderSlot(t.$slots,"caption",{},void 0,!0)]),e.createElementVNode("thead",null,[e.createElementVNode("tr",{role:"row",style:e.normalizeStyle(`background:${o.value.table.head.backgroundColor};color:${o.value.table.head.color}`)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value.table.head.values,(n,l)=>(e.openBlock(),e.createElementBlock("th",A,[e.renderSlot(t.$slots,"head",e.mergeProps({ref_for:!0},{value:n,rowIndex:l,type:typeof n,isResponsive:s.value}),void 0,!0)]))),256))],4)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(n,l)=>(e.openBlock(),e.createElementBlock("tr",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.displayValues,(i,u)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":o.value.table.head.values[u]},[n.color&&u===0?(e.openBlock(),e.createElementBlock("div",W,[n.color?(e.openBlock(),e.createElementBlock("svg",{key:0,height:o.value.style.shapeSize,width:o.value.style.shapeSize,viewBox:"0 0 20 20",style:{background:"none",overflow:"visible"}},[e.createVNode(q._sfc_main,{plot:{x:10,y:10},color:n.color,radius:9,shape:n.shape||"circle"},null,8,["color","shape"])],8,J)):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"rowTitle",e.mergeProps({ref_for:!0},{value:i,rowIndex:l,colIndex:u,type:typeof i,isResponsive:s.value}),void 0,!0)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[u===0?e.renderSlot(t.$slots,"rowTitle",e.mergeProps({key:0,ref_for:!0},{value:i,rowIndex:l,colIndex:u,type:typeof i,isResponsive:s.value}),void 0,!0):e.createCommentVNode("",!0),u>0?e.renderSlot(t.$slots,"cell",e.mergeProps({key:1,ref_for:!0},{value:i,rowIndex:l,colIndex:u,type:typeof i,isResponsive:s.value,color:n.colors[u],textColor:e.unref(a.adaptColorToBackground)(n.colors[u])}),void 0,!0):e.createCommentVNode("",!0)],64))],8,X))),256)),o.value.table.showSum?(e.openBlock(),e.createElementBlock("td",K,[e.renderSlot(t.$slots,"sum",e.mergeProps({ref_for:!0},{value:n.sum,rowIndex:l,isResponsive:s.value}),void 0,!0)])):e.createCommentVNode("",!0),o.value.table.showAverage?(e.openBlock(),e.createElementBlock("td",Q,[e.renderSlot(t.$slots,"average",e.mergeProps({ref_for:!0},{value:n.average,rowIndex:l,isResponsive:s.value}),void 0,!0)])):e.createCommentVNode("",!0),o.value.table.showMedian?(e.openBlock(),e.createElementBlock("td",Y,[e.renderSlot(t.$slots,"median",e.mergeProps({ref_for:!0},{value:n.median,rowIndex:l,isResponsive:s.value}),void 0,!0)])):e.createCommentVNode("",!0)]))),256))])],4),t.$slots.source?(e.openBlock(),e.createElementBlock("div",Z,[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],46,L))}},ee=H._export_sfc(j,[["__scopeId","data-v-dd493d6a"]]);exports.default=ee;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-Dy2-pNb6.cjs"),Y=require("./useNestedProp-DQ8Jt3-Y.cjs"),ce=require("./vue-ui-sparkline-cPPxz94c.cjs"),x=require("./BaseIcon-DmfPEj6j.cjs"),D=require("./usePrinter-BQEYwy4a.cjs"),ve=require("./useUserOptionState-BgepsfED.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=["id"],fe={style:{"z-index":"1","padding-right":"24px"}},ye={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},ge={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},be=["onClick"],ke=["onClick"],he=["data-cell"],Se=["data-cell","onPointerenter"],Ce=["data-cell"],_e=["data-cell"],xe=["data-cell"],we=["data-cell"],Ne={key:1,ref:"source",dir:"auto"},ze={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(Z,{expose:ee}){e.useCssVars(l=>({"8765d8b0":l.tdo}));const{vue_ui_table_sparkline:te}=s.useConfig(),y=Z,w=e.ref(s.createUid()),$=e.ref(0),N=e.ref(0),z=e.ref(null),le=e.useSlots();e.onMounted(()=>{le["chart-background"]&&console.warn("VueUiTableSparkline does not support the #chart-background slot.")});const t=e.computed({get:()=>T(),set:l=>l}),{userOptionsVisible:V,setUserOptionsVisibility:P,keepUserOptionState:F}=ve.useUserOptionState({config:t.value});function T(){const l=Y.useNestedProp({userConfig:y.config,defaultConfig:te});return l.theme?{...Y.useNestedProp({userConfig:s.themes.vue_ui_table_sparkline[l.theme]||y.config,defaultConfig:l}),customPalette:s.themePalettes[l.theme]||s.palette}:l}e.watch(()=>y.config,l=>{t.value=T(),V.value=!t.value.userOptions.showOnChartHover,q(),N.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{c.value=h.value,N.value+=1},{deep:!0});const{isPrinting:M,isImaging:W,generatePdf:L,generateImage:U}=D.usePrinter({elementId:`table_${w.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline",options:t.value.userOptions.print}),ae=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),C=e.ref(null),I=e.ref(!1),oe=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{q()});const B=e.ref(t.value.colNames);function q(){s.objectIsEmpty(y.dataset)&&s.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(o=>{o.forEach(a=>{I.value=a.contentRect.width<oe.value})});C.value&&l.observe(C.value),B.value=[];for(let o=0;o<R.value;o+=1)B.value.push(t.value.colNames[o]||`col ${o}`)}const G=e.computed(()=>(y.dataset.forEach((l,o)=>{s.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{s.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:o})})}),y.dataset.map((l,o)=>{const a=(l.values||[]).map(d=>isNaN(d)?0:d??0),n=a.reduce((d,i)=>d+i,0),u=n/a.length,r=s.calcMedian(a);return{...l,values:l.values||[],color:s.convertColorToHex(l.color)||ae.value[o]||s.palette[o]||s.palette[o%s.palette.length],sum:n,average:u,median:r,sparklineDataset:a.map((d,i)=>({period:t.value.colNames[i]||`col ${i}`,value:d||0}))}})));function ne(l){const a=(l[0].values||[]).map((u,r)=>l.map(d=>d.values[r]||[])).map(u=>u.map((r,d)=>[r,d]).sort((r,d)=>d[0]-r[0]).map(r=>r[1]));return l.map((u,r)=>({...u,values:u.values||[],orders:a[r]}))}const h=e.computed(()=>ne(G.value)),c=e.ref(h.value),re=e.computed(()=>Math.max(...c.value.map(l=>(l.values||[]).length))),E=e.ref(void 0),A=e.ref(!1),v=e.ref(void 0),H=e.ref(1);function k(){A.value=!1,v.value=void 0,p.value=void 0,H.value=1,S.value.forEach(l=>l.state=1),g.value={name:1,sum:1,average:1,median:1},c.value=h.value}function _(l,o,a){if(["name","sum","average","median"].includes(l.type)){ue(l.type,o,a);return}if(!J(o))return;if(b.value=o,p.value=void 0,![null,void 0].includes(v.value)&&o!==v.value&&(v.value=void 0,k()),S.value[o].state===a&&v.value===o){v.value=void 0,k();return}A.value=!0,v.value=o;const n=h.value.map(i=>i.values[o]||[]),u=a;S.value[o].state=u,H.value=u,o===E.value?E.value=void 0:E.value=o;const d=n.map((i,m)=>[m,i]).sort((i,m)=>u*(m[1]-i[1])).map(i=>i[0]).map(i=>h.value[i]);c.value=d,N.value+=1}const R=e.computed(()=>Math.max(...y.dataset.map(l=>(l.values||[]).length))),f=e.computed(()=>{let l=B.value.map(a=>({type:"reg",value:a}));if(!l.length)for(let a=0;a<R.value;a+=1)l.push({type:"reg",value:`col ${a+1}`});t.value.showTotal&&(l=[...l,{type:"sum",value:t.value.translations.total}]);let o;return t.value.showAverage&&t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average},{type:"median",value:t.value.translations.median}]:t.value.showAverage&&!t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average}]:!t.value.showAverage&&t.value.showMedian?o=[...l,{type:"median",value:t.value.translations.median}]:o=l,t.value.showSparklines?[...o,{type:"chart",value:t.value.translations.chart}]:o}),g=e.ref({name:1,sum:1,average:1,median:1}),p=e.ref(void 0);function ue(l,o,a){if(!c.value||c.value.length===0||!K(l))return;if(p.value!==l&&(p.value=void 0),![null,void 0].includes(v.value)&&o!==v.value&&k(),v.value=void 0,g.value[l]===a&&p.value){p.value=void 0,k();return}p.value=l,A.value=!0,g.value[l]=a,[null,void 0].includes(o)||(S.value[o].state=g.value[l]);const n=g.value[l],u=[...c.value].sort((r,d)=>{const i=r[l]??(typeof r[l]=="number"?0:""),m=d[l]??(typeof d[l]=="number"?0:"");return typeof i=="string"&&typeof m=="string"?n===-1?i.localeCompare(m):m.localeCompare(i):typeof i=="number"&&typeof m=="number"?n===-1?i-m:m-i:0});c.value=u}const b=e.ref(void 0),O=e.ref(void 0);function se({dataIndex:l,serieIndex:o}){b.value=l,O.value=o,z.value[l]&&!I.value&&z.value[l].scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}const X=e.ref(!1);function ie(l){X.value=l,$.value+=1}function j(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(f.value),o=G.value.map((u,r)=>[[u.name],u.values,[u.sum],[u.average],[u.median]]),a=[l].concat(o),n=s.createCsvContent(a);s.downloadCsv({csvContent:n,title:t.value.title.text||"vue-ui-table-sparkline"})})}function J(l){return t.value.sortedDataColumnIndices.includes(l)}function K(l){return l.type==="name"||l==="name"?t.value.sortedSeriesName:l.type==="sum"||l==="sum"?t.value.sortedSum:l.type==="average"||l==="average"?t.value.sortedAverage:l.type==="median"||l==="median"?t.value.sortedMedian:!1}function Q(l,o,a){return["sum","average","median"].includes(o.type)?p.value===o.type&&g.value[o.type]===a?1:.3:l===v.value&&S.value[l].state===a?1:.3}function de(){t.value.resetSortOnClickOutside&&k()}const S=e.computed({get:()=>f.value.map(l=>({state:1})),set:l=>l});return ee({generatePdf:L,generateImage:U,generateCsv:j,restoreOrder:k}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:C,class:e.normalizeClass({"vue-ui-table-sparkline":!0,"vue-ui-responsive":I.value}),style:{overflow:"hidden"},id:`table_${w.value}`,onMouseenter:o[3]||(o[3]=()=>e.unref(P)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(P)(!1))},[t.value.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-table-sparkline-caption",style:e.normalizeStyle({backgroundColor:t.value.title.backgroundColor})},[e.createElementVNode("div",{class:"atom-title",style:e.normalizeStyle({fontSize:`${t.value.title.fontSize}px`,fontWeight:t.value.title.bold?"bold":"normal",color:t.value.title.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.text),5),t.value.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"atom-subtitle",style:e.normalizeStyle({fontSize:`${t.value.title.subtitle.fontSize}px`,fontWeight:t.value.title.subtitle.bold?"bold":"normal",color:t.value.title.subtitle.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{style:{overflow:"auto"},onPointerleave:o[2]||(o[2]=a=>{O.value=void 0,b.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[e.createElementVNode("thead",fe,[e.withDirectives((e.openBlock(),e.createElementBlock("tr",{role:"row",class:"vue-ui-data-table__thead-row",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color})},[e.createElementVNode("th",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal"}),class:"sticky-col-first"},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(t.value.translations.serie),1),c.value.length>1&&t.value.sortedSeriesName?(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:o[0]||(o[0]=a=>_({type:"name"},null,-1))},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===-1?1:.3})},null,8,["stroke","style"])]),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:o[1]||(o[1]=a=>_({type:"name"},null,1))},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===1?1:.3})},null,8,["stroke","style"])])])):e.createCommentVNode("",!0)],4)],4),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,n)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",style:e.normalizeStyle({background:t.value.thead.backgroundColor,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal",minWidth:n===f.value.length-1?`${t.value.sparkline.dimensions.width}px`:"48px",paddingRight:n===f.value.length-1&&t.value.userOptions.show?"36px":""}),class:e.normalizeClass({"sticky-col":n===f.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(a.value),1),c.value.length>1&&(J(n)||K(a))?(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:()=>_(a,n,-1)},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,-1)})},null,8,["stroke","style"])],8,be),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:()=>_(a,n,1)},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,1)})},null,8,["stroke","style"])],8,ke)])):e.createCommentVNode("",!0)],4),t.value.userOptions.show&&n===f.value.length-1&&(e.unref(F)||e.unref(V))?(e.openBlock(),e.createBlock(D.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${$.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(M),isImaging:e.unref(W),uid:w.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:X.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,position:t.value.userOptions.position,onToggleFullscreen:ie,onGeneratePdf:e.unref(L),onGenerateImage:e.unref(U),onGenerateCsv:j,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(V)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:u,color:r})=>[e.renderSlot(l.$slots,"menuIcon",e.mergeProps({ref_for:!0},{isOpen:u,color:r}),void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:u,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.mergeProps({ref_for:!0},{toggleFullscreen:u,isFullscreen:r}),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0)],6))),256))],4)),[[e.unref(D.vClickOutside),de]])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,n)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,color:t.value.tbody.color}),class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":n%2===0,"vue-ui-data-table__tbody__row-odd":n%2!==0})},[e.createElementVNode("td",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.serie,class:"vue-ui-data-table__tbody__td sticky-col-first"},[e.createElementVNode("div",{dir:"auto",style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"6px",justifyContent:t.value.tbody.textAlign})},[t.value.tbody.showColorMarker?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle({color:a.color})},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a.name??"-"),1)],4)],12,he),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(u,r)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",ref_for:!0,ref_key:"TD",ref:z,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,background:b.value!==void 0&&r===b.value?t.value.tbody.selectedColor.useSerieColor?`${a.color.length>7?a.color.slice(0,-2):a.color}33`:t.value.tbody.selectedColor.fallback:""}),"data-cell":f.value[r]?f.value[r].value:"",class:"vue-ui-data-table__tbody__td",onPointerenter:d=>{O.value=n,b.value=r}},e.toDisplayString([null,void 0].includes(a.values[r])?"-":e.unref(s.applyDataLabel)(t.value.formatter,Number(a.values[r]),e.unref(s.dataLabel)({p:t.value.prefix,v:Number(a.values[r]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:n,datapointIndex:r})),45,Se))),256)),t.value.showTotal?(e.openBlock(),e.createElementBlock("td",{key:0,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.total,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.formatter,a.sum,e.unref(s.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:n})),13,Ce)):e.createCommentVNode("",!0),t.value.showAverage?(e.openBlock(),e.createElementBlock("td",{key:1,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.average,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.formatter,a.average,e.unref(s.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:n})),13,_e)):e.createCommentVNode("",!0),t.value.showMedian?(e.openBlock(),e.createElementBlock("td",{key:2,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.median,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.formatter,a.median,e.unref(s.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:n})),13,xe)):e.createCommentVNode("",!0),t.value.showSparklines?(e.openBlock(),e.createElementBlock("td",{key:3,role:"cell","data-cell":t.value.translations.chart,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,backgroundColor:t.value.tbody.backgroundColor,padding:"0"}),class:"vue-ui-data-table__tbody__td sticky-col"},[e.createVNode(ce.default,{onHoverIndex:({index:u})=>se({dataIndex:u,serieIndex:n}),"height-ratio":t.value.sparkline.dimensions.heightRatio,"forced-padding":30,dataset:a.sparklineDataset,showInfo:!1,selectedIndex:b.value,config:{type:t.value.sparkline.type,style:{backgroundColor:"transparent",animation:{show:t.value.sparkline.animation.show&&!e.unref(M)&&!e.unref(W),animationFrames:t.value.sparkline.animation.animationFrames},line:{color:a.color,smooth:t.value.sparkline.smooth,strokeWidth:t.value.sparkline.strokeWidth},bar:{color:a.color},area:{color:a.color,opacity:t.value.sparkline.showArea?16:0,useGradient:t.value.sparkline.useGradient},verticalIndicator:{color:a.color},plot:{radius:9,stroke:t.value.tbody.backgroundColor,strokeWidth:3}}}},null,8,["onHoverIndex","height-ratio","dataset","selectedIndex","config"])],12,we)):e.createCommentVNode("",!0)],6))),256))])],4)],32),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Ne,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],42,me))}},Ve=pe._export_sfc(ze,[["__scopeId","data-v-6ebcec2e"]]);exports.default=Ve;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-DlALYfRS.cjs"),Y=require("./useNestedProp-BZX7zlGv.cjs"),ce=require("./vue-ui-sparkline-DPFtUR9k.cjs"),x=require("./BaseIcon-CmdFxgkp.cjs"),D=require("./usePrinter-n1HzfoSm.cjs"),ve=require("./useUserOptionState-BgepsfED.cjs"),pe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=["id"],fe={style:{"z-index":"1","padding-right":"24px"}},ye={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},ge={key:0,style:{display:"flex",flexDirection:"row",alignItems:"center"}},be=["onClick"],ke=["onClick"],he=["data-cell"],Se=["data-cell","onPointerenter"],Ce=["data-cell"],_e=["data-cell"],xe=["data-cell"],we=["data-cell"],Ne={key:1,ref:"source",dir:"auto"},ze={__name:"vue-ui-table-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(Z,{expose:ee}){e.useCssVars(l=>({"8765d8b0":l.tdo}));const{vue_ui_table_sparkline:te}=s.useConfig(),y=Z,w=e.ref(s.createUid()),$=e.ref(0),N=e.ref(0),z=e.ref(null),le=e.useSlots();e.onMounted(()=>{le["chart-background"]&&console.warn("VueUiTableSparkline does not support the #chart-background slot.")});const t=e.computed({get:()=>T(),set:l=>l}),{userOptionsVisible:V,setUserOptionsVisibility:P,keepUserOptionState:F}=ve.useUserOptionState({config:t.value});function T(){const l=Y.useNestedProp({userConfig:y.config,defaultConfig:te});return l.theme?{...Y.useNestedProp({userConfig:s.themes.vue_ui_table_sparkline[l.theme]||y.config,defaultConfig:l}),customPalette:s.themePalettes[l.theme]||s.palette}:l}e.watch(()=>y.config,l=>{t.value=T(),V.value=!t.value.userOptions.showOnChartHover,q(),N.value+=1},{deep:!0}),e.watch(()=>y.dataset,l=>{c.value=h.value,N.value+=1},{deep:!0});const{isPrinting:M,isImaging:W,generatePdf:L,generateImage:U}=D.usePrinter({elementId:`table_${w.value}`,fileName:t.value.title.text||"vue-ui-table-sparkline",options:t.value.userOptions.print}),ae=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),C=e.ref(null),I=e.ref(!1),oe=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{q()});const B=e.ref(t.value.colNames);function q(){s.objectIsEmpty(y.dataset)&&s.error({componentName:"VueUiTableSparkline",type:"dataset"});const l=new ResizeObserver(o=>{o.forEach(a=>{I.value=a.contentRect.width<oe.value})});C.value&&l.observe(C.value),B.value=[];for(let o=0;o<R.value;o+=1)B.value.push(t.value.colNames[o]||`col ${o}`)}const G=e.computed(()=>(y.dataset.forEach((l,o)=>{s.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","values"]}).forEach(a=>{s.error({componentName:"VueUiTableSparkline",type:"datasetSerieAttribute",property:a,index:o})})}),y.dataset.map((l,o)=>{const a=(l.values||[]).map(d=>isNaN(d)?0:d??0),n=a.reduce((d,i)=>d+i,0),u=n/a.length,r=s.calcMedian(a);return{...l,values:l.values||[],color:s.convertColorToHex(l.color)||ae.value[o]||s.palette[o]||s.palette[o%s.palette.length],sum:n,average:u,median:r,sparklineDataset:a.map((d,i)=>({period:t.value.colNames[i]||`col ${i}`,value:d||0}))}})));function ne(l){const a=(l[0].values||[]).map((u,r)=>l.map(d=>d.values[r]||[])).map(u=>u.map((r,d)=>[r,d]).sort((r,d)=>d[0]-r[0]).map(r=>r[1]));return l.map((u,r)=>({...u,values:u.values||[],orders:a[r]}))}const h=e.computed(()=>ne(G.value)),c=e.ref(h.value),re=e.computed(()=>Math.max(...c.value.map(l=>(l.values||[]).length))),E=e.ref(void 0),A=e.ref(!1),v=e.ref(void 0),H=e.ref(1);function k(){A.value=!1,v.value=void 0,p.value=void 0,H.value=1,S.value.forEach(l=>l.state=1),g.value={name:1,sum:1,average:1,median:1},c.value=h.value}function _(l,o,a){if(["name","sum","average","median"].includes(l.type)){ue(l.type,o,a);return}if(!J(o))return;if(b.value=o,p.value=void 0,![null,void 0].includes(v.value)&&o!==v.value&&(v.value=void 0,k()),S.value[o].state===a&&v.value===o){v.value=void 0,k();return}A.value=!0,v.value=o;const n=h.value.map(i=>i.values[o]||[]),u=a;S.value[o].state=u,H.value=u,o===E.value?E.value=void 0:E.value=o;const d=n.map((i,m)=>[m,i]).sort((i,m)=>u*(m[1]-i[1])).map(i=>i[0]).map(i=>h.value[i]);c.value=d,N.value+=1}const R=e.computed(()=>Math.max(...y.dataset.map(l=>(l.values||[]).length))),f=e.computed(()=>{let l=B.value.map(a=>({type:"reg",value:a}));if(!l.length)for(let a=0;a<R.value;a+=1)l.push({type:"reg",value:`col ${a+1}`});t.value.showTotal&&(l=[...l,{type:"sum",value:t.value.translations.total}]);let o;return t.value.showAverage&&t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average},{type:"median",value:t.value.translations.median}]:t.value.showAverage&&!t.value.showMedian?o=[...l,{type:"average",value:t.value.translations.average}]:!t.value.showAverage&&t.value.showMedian?o=[...l,{type:"median",value:t.value.translations.median}]:o=l,t.value.showSparklines?[...o,{type:"chart",value:t.value.translations.chart}]:o}),g=e.ref({name:1,sum:1,average:1,median:1}),p=e.ref(void 0);function ue(l,o,a){if(!c.value||c.value.length===0||!K(l))return;if(p.value!==l&&(p.value=void 0),![null,void 0].includes(v.value)&&o!==v.value&&k(),v.value=void 0,g.value[l]===a&&p.value){p.value=void 0,k();return}p.value=l,A.value=!0,g.value[l]=a,[null,void 0].includes(o)||(S.value[o].state=g.value[l]);const n=g.value[l],u=[...c.value].sort((r,d)=>{const i=r[l]??(typeof r[l]=="number"?0:""),m=d[l]??(typeof d[l]=="number"?0:"");return typeof i=="string"&&typeof m=="string"?n===-1?i.localeCompare(m):m.localeCompare(i):typeof i=="number"&&typeof m=="number"?n===-1?i-m:m-i:0});c.value=u}const b=e.ref(void 0),O=e.ref(void 0);function se({dataIndex:l,serieIndex:o}){b.value=l,O.value=o,z.value[l]&&!I.value&&z.value[l].scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}const X=e.ref(!1);function ie(l){X.value=l,$.value+=1}function j(){e.nextTick(()=>{const l=[t.value.translations.serie].concat(f.value),o=G.value.map((u,r)=>[[u.name],u.values,[u.sum],[u.average],[u.median]]),a=[l].concat(o),n=s.createCsvContent(a);s.downloadCsv({csvContent:n,title:t.value.title.text||"vue-ui-table-sparkline"})})}function J(l){return t.value.sortedDataColumnIndices.includes(l)}function K(l){return l.type==="name"||l==="name"?t.value.sortedSeriesName:l.type==="sum"||l==="sum"?t.value.sortedSum:l.type==="average"||l==="average"?t.value.sortedAverage:l.type==="median"||l==="median"?t.value.sortedMedian:!1}function Q(l,o,a){return["sum","average","median"].includes(o.type)?p.value===o.type&&g.value[o.type]===a?1:.3:l===v.value&&S.value[l].state===a?1:.3}function de(){t.value.resetSortOnClickOutside&&k()}const S=e.computed({get:()=>f.value.map(l=>({state:1})),set:l=>l});return ee({generatePdf:L,generateImage:U,generateCsv:j,restoreOrder:k}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"tableContainer",ref:C,class:e.normalizeClass({"vue-ui-table-sparkline":!0,"vue-ui-responsive":I.value}),style:{overflow:"hidden"},id:`table_${w.value}`,onMouseenter:o[3]||(o[3]=()=>e.unref(P)(!0)),onMouseleave:o[4]||(o[4]=()=>e.unref(P)(!1))},[t.value.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-table-sparkline-caption",style:e.normalizeStyle({backgroundColor:t.value.title.backgroundColor})},[e.createElementVNode("div",{class:"atom-title",style:e.normalizeStyle({fontSize:`${t.value.title.fontSize}px`,fontWeight:t.value.title.bold?"bold":"normal",color:t.value.title.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.text),5),t.value.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"atom-subtitle",style:e.normalizeStyle({fontSize:`${t.value.title.subtitle.fontSize}px`,fontWeight:t.value.title.subtitle.bold?"bold":"normal",color:t.value.title.subtitle.color,textAlign:t.value.title.textAlign})},e.toDisplayString(t.value.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),e.createElementVNode("div",{style:{overflow:"auto"},onPointerleave:o[2]||(o[2]=a=>{O.value=void 0,b.value=void 0})},[e.createElementVNode("table",{class:"vue-ui-data-table",style:e.normalizeStyle({fontFamily:t.value.fontFamily,position:"relative"})},[e.createElementVNode("thead",fe,[e.withDirectives((e.openBlock(),e.createElementBlock("tr",{role:"row",class:"vue-ui-data-table__thead-row",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color})},[e.createElementVNode("th",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.thead.backgroundColor,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal"}),class:"sticky-col-first"},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(t.value.translations.serie),1),c.value.length>1&&t.value.sortedSeriesName?(e.openBlock(),e.createElementBlock("div",ye,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:o[0]||(o[0]=a=>_({type:"name"},null,-1))},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===-1?1:.3})},null,8,["stroke","style"])]),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:o[1]||(o[1]=a=>_({type:"name"},null,1))},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:p.value==="name"&&g.value.name===1?1:.3})},null,8,["stroke","style"])])])):e.createCommentVNode("",!0)],4)],4),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(a,n)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",style:e.normalizeStyle({background:t.value.thead.backgroundColor,border:t.value.thead.outline,textAlign:t.value.thead.textAlign,fontWeight:t.value.thead.bold?"bold":"normal",minWidth:n===f.value.length-1?`${t.value.sparkline.dimensions.width}px`:"48px",paddingRight:n===f.value.length-1&&t.value.userOptions.show?"36px":""}),class:e.normalizeClass({"sticky-col":n===f.value.length-1&&t.value.showSparklines})},[e.createElementVNode("div",{style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"3px",justifyContent:t.value.thead.textAlign})},[e.createElementVNode("span",null,e.toDisplayString(a.value),1),c.value.length>1&&(J(n)||K(a))?(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-down",onClick:()=>_(a,n,-1)},[e.createVNode(x.default,{size:12,name:"arrowBottom",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,-1)})},null,8,["stroke","style"])],8,be),e.createElementVNode("button",{class:"vue-ui-table-sparkline-sorting-button vue-ui-table-sparkline-sorting-button-up",onClick:()=>_(a,n,1)},[e.createVNode(x.default,{size:12,name:"arrowTop",stroke:t.value.thead.color,style:e.normalizeStyle({opacity:Q(n,a,1)})},null,8,["stroke","style"])],8,ke)])):e.createCommentVNode("",!0)],4),t.value.userOptions.show&&n===f.value.length-1&&(e.unref(F)||e.unref(V))?(e.openBlock(),e.createBlock(D.UserOptions,{ref_for:!0,ref:"details",key:`user_option_${$.value}`,backgroundColor:t.value.thead.backgroundColor,color:t.value.thead.color,isPrinting:e.unref(M),isImaging:e.unref(W),uid:w.value,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:X.value,titles:{...t.value.userOptions.buttonTitles},chartElement:C.value,position:t.value.userOptions.position,onToggleFullscreen:ie,onGeneratePdf:e.unref(L),onGenerateImage:e.unref(U),onGenerateCsv:j,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(V)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:u,color:r})=>[e.renderSlot(l.$slots,"menuIcon",e.mergeProps({ref_for:!0},{isOpen:u,color:r}),void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:u,isFullscreen:r})=>[e.renderSlot(l.$slots,"optionFullscreen",e.mergeProps({ref_for:!0},{toggleFullscreen:u,isFullscreen:r}),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasXls","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0)],6))),256))],4)),[[e.unref(D.vClickOutside),de]])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(a,n)=>(e.openBlock(),e.createElementBlock("tr",{role:"row",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,color:t.value.tbody.color}),class:e.normalizeClass({"vue-ui-data-table__tbody__row":!0,"vue-ui-data-table__tbody__row-even":n%2===0,"vue-ui-data-table__tbody__row-odd":n%2!==0})},[e.createElementVNode("td",{role:"cell",style:e.normalizeStyle({backgroundColor:t.value.tbody.backgroundColor,border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.serie,class:"vue-ui-data-table__tbody__td sticky-col-first"},[e.createElementVNode("div",{dir:"auto",style:e.normalizeStyle({display:"flex",flexDirection:"row",alignItems:"center",gap:"6px",justifyContent:t.value.tbody.textAlign})},[t.value.tbody.showColorMarker?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle({color:a.color})},"⬤",4)):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a.name??"-"),1)],4)],12,he),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(u,r)=>(e.openBlock(),e.createElementBlock("td",{dir:"auto",role:"cell",ref_for:!0,ref_key:"TD",ref:z,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,background:b.value!==void 0&&r===b.value?t.value.tbody.selectedColor.useSerieColor?`${a.color.length>7?a.color.slice(0,-2):a.color}33`:t.value.tbody.selectedColor.fallback:""}),"data-cell":f.value[r]?f.value[r].value:"",class:"vue-ui-data-table__tbody__td",onPointerenter:d=>{O.value=n,b.value=r}},e.toDisplayString([null,void 0].includes(a.values[r])?"-":e.unref(s.applyDataLabel)(t.value.formatter,Number(a.values[r]),e.unref(s.dataLabel)({p:t.value.prefix,v:Number(a.values[r]),s:t.value.suffix,r:t.value.roundingValues}),{datapoint:a,seriesIndex:n,datapointIndex:r})),45,Se))),256)),t.value.showTotal?(e.openBlock(),e.createElementBlock("td",{key:0,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.total,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.formatter,a.sum,e.unref(s.dataLabel)({p:t.value.prefix,v:a.sum,s:t.value.suffix,r:t.value.roundingTotal}),{datapoint:a.sum,seriesIndex:n})),13,Ce)):e.createCommentVNode("",!0),t.value.showAverage?(e.openBlock(),e.createElementBlock("td",{key:1,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.average,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.formatter,a.average,e.unref(s.dataLabel)({p:t.value.prefix,v:a.average,s:t.value.suffix,r:t.value.roundingAverage}),{datapoint:a.average,seriesIndex:n})),13,_e)):e.createCommentVNode("",!0),t.value.showMedian?(e.openBlock(),e.createElementBlock("td",{key:2,dir:"auto",role:"cell",style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign}),"data-cell":t.value.translations.median,class:"vue-ui-data-table__tbody__td"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.formatter,a.median,e.unref(s.dataLabel)({p:t.value.prefix,v:a.median,s:t.value.suffix,r:t.value.roundingMedian}),{datapoint:a.median,seriesIndex:n})),13,xe)):e.createCommentVNode("",!0),t.value.showSparklines?(e.openBlock(),e.createElementBlock("td",{key:3,role:"cell","data-cell":t.value.translations.chart,style:e.normalizeStyle({border:t.value.tbody.outline,fontSize:`${t.value.tbody.fontSize}px`,fontWeight:t.value.tbody.bold?"bold":"normal",textAlign:t.value.tbody.textAlign,backgroundColor:t.value.tbody.backgroundColor,padding:"0"}),class:"vue-ui-data-table__tbody__td sticky-col"},[e.createVNode(ce.default,{onHoverIndex:({index:u})=>se({dataIndex:u,serieIndex:n}),"height-ratio":t.value.sparkline.dimensions.heightRatio,"forced-padding":30,dataset:a.sparklineDataset,showInfo:!1,selectedIndex:b.value,config:{type:t.value.sparkline.type,style:{backgroundColor:"transparent",animation:{show:t.value.sparkline.animation.show&&!e.unref(M)&&!e.unref(W),animationFrames:t.value.sparkline.animation.animationFrames},line:{color:a.color,smooth:t.value.sparkline.smooth,strokeWidth:t.value.sparkline.strokeWidth},bar:{color:a.color},area:{color:a.color,opacity:t.value.sparkline.showArea?16:0,useGradient:t.value.sparkline.useGradient},verticalIndicator:{color:a.color},plot:{radius:9,stroke:t.value.tbody.backgroundColor,strokeWidth:3}}}},null,8,["onHoverIndex","height-ratio","dataset","selectedIndex","config"])],12,we)):e.createCommentVNode("",!0)],6))),256))])],4)],32),l.$slots.source?(e.openBlock(),e.createElementBlock("div",Ne,[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],42,me))}},Ve=pe._export_sfc(ze,[["__scopeId","data-v-6ebcec2e"]]);exports.default=Ve;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useCssVars as ze, ref as p, useSlots as De, onMounted as pe, computed as _, watch as fe, createElementBlock as c, openBlock as d, unref as i, normalizeClass as X, createCommentVNode as g, createElementVNode as f, normalizeStyle as s, toDisplayString as C, withDirectives as Pe, createVNode as z, Fragment as J, renderList as K, createBlock as Ne, createSlots as Fe, withCtx as D, renderSlot as A, mergeProps as me, nextTick as Ve } from "vue";
|
|
2
|
-
import { u as Te, c as We, t as Me, p as F, a as Ee, b as Ue, o as Be, e as be, g as Ge, a5 as Le, d as Re, i as V, f as T, q as He, r as qe } from "./index-
|
|
3
|
-
import { u as ge } from "./useNestedProp-
|
|
4
|
-
import Xe from "./vue-ui-sparkline-
|
|
5
|
-
import W from "./BaseIcon-
|
|
6
|
-
import { u as Je, U as Ke, v as Qe } from "./usePrinter-
|
|
2
|
+
import { u as Te, c as We, t as Me, p as F, a as Ee, b as Ue, o as Be, e as be, g as Ge, a5 as Le, d as Re, i as V, f as T, q as He, r as qe } from "./index-bVqxfptX.js";
|
|
3
|
+
import { u as ge } from "./useNestedProp-DU-vsdTb.js";
|
|
4
|
+
import Xe from "./vue-ui-sparkline-6fUsXxoo.js";
|
|
5
|
+
import W from "./BaseIcon-DPO_4Adb.js";
|
|
6
|
+
import { u as Je, U as Ke, v as Qe } from "./usePrinter-BbeIGqpA.js";
|
|
7
7
|
import { u as Ye } from "./useUserOptionState-BIvW1Kz7.js";
|
|
8
8
|
import { _ as Ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
9
|
const je = ["id"], et = { style: { "z-index": "1", "padding-right": "24px" } }, tt = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-Dy2-pNb6.cjs"),oe=require("./Title-CEZO2hzQ.cjs"),Y=require("./usePrinter-BQEYwy4a.cjs"),re=require("./vue-ui-skeleton-Db7PiDqL.cjs"),z=require("./useNestedProp-DQ8Jt3-Y.cjs"),le=require("./PackageVersion-DxR-fKLM.cjs"),ae=require("./PenAndPaper-CG9o3ymS.cjs"),se=require("./useUserOptionState-BgepsfED.cjs"),ne=require("./useChartAccessibility-Cm7nkzTG.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ie=["id"],ce={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},de={key:2,style:"width:100%"},he=["xmlns","viewBox"],ve=["width","height"],me={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},pe=["fill"],fe=["id"],ye=["stop-color"],ge=["stop-color"],ke=["stop-color"],be={"clip-path":"url(#vueUiPill)"},xe=["x","y","height","width"],Ce=["x","y","height","width","fill"],we=["x1","x2","y1","y2","stroke-width","stroke"],_e=["x1","x2","y1","y2","stroke-width","stroke"],Ne=["x1","x2","y1","y2","stroke-width","stroke"],Be=["x1","x2","y1","y2","stroke-width","stroke"],Ve=["x1","x2","y1","y2","stroke-width","stroke"],Ee=["x1","x2","y1","y2","stroke-width","stroke"],Pe=["x1","x2","y1","y2","stroke-width","stroke"],$e=["x1","x2","y1","y2","stroke-width","stroke"],Fe=["x","y","height","width"],Oe=["y","x","fill","font-size","font-weight"],Ie={key:5,class:"vue-data-ui-watermark"},Se={key:6,ref:"source",dir:"auto"},qe={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:L}){e.useCssVars(r=>({"3272b184":X.value,"0885078a":D.value,"09e2f6f7":j.value}));const{vue_ui_thermometer:G}=a.useConfig(),s=m,g=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{B()});function B(){a.objectIsEmpty(s.dataset)?a.error({componentName:"VueUiThermometer",type:"dataset"}):a.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","from","to"]}).forEach(r=>{a.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:r})})}const d=e.ref(a.createUid()),V=e.ref(null),E=e.ref(0),P=e.ref(0),t=e.computed({get:()=>I(),set:r=>r}),{userOptionsVisible:k,setUserOptionsVisibility:$,keepUserOptionState:F}=se.useUserOptionState({config:t.value}),{svgRef:O}=ne.useChartAccessibility({config:t.value.style.title});function I(){const r=z.useNestedProp({userConfig:s.config,defaultConfig:G});return r.theme?{...z.useNestedProp({userConfig:a.themes.vue_ui_thermometer[r.theme]||s.config,defaultConfig:r}),customPalette:a.themePalettes[r.theme]||a.palette}:r}e.watch(()=>s.config,r=>{t.value=I(),k.value=!t.value.userOptions.showOnChartHover,B(),P.value+=1},{deep:!0});const{isPrinting:S,isImaging:q,generatePdf:A,generateImage:T}=Y.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer",options:t.value.userOptions.print}),H=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),p=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),R=e.computed(()=>t.value.style.chart.thermometer.width),c=e.computed(()=>s.dataset.steps||10),i=e.ref({top:t.value.style.chart.padding.top,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right,bottom:t.value.style.chart.padding.bottom});function f(r,n,o){const u=[],_=M(r),N=M(n);for(let v=0;v<o;v++){const Q=b(_.red,N.red,v,o),Z=b(_.green,N.green,v,o),ee=b(_.blue,N.blue,v,o),te=`#${x(Q)}${x(Z)}${x(ee)}`;u.push(te)}return u}function M(r){const n=r.slice(1);return{red:parseInt(n.slice(0,2),16),green:parseInt(n.slice(2,4),16),blue:parseInt(n.slice(4,6),16)}}function b(r,n,o,u){return Math.round(r+(n-r)*o/u)}function x(r){return r.toString(16).padStart(2,"0")}const l=e.computed(()=>{const r=R.value+i.value.left+i.value.right,n=t.value.style.chart.height;return{width:r,left:i.value.left,right:r-i.value.right,top:i.value.top,bottom:n-i.value.bottom,height:n}}),W=e.computed(()=>l.value),C=e.computed(()=>{const r=a.checkNaN(s.dataset.from)<0?Math.abs(a.checkNaN(s.dataset.from)):a.checkNaN(s.dataset.from),n=a.checkNaN(s.dataset.to)<0?Math.abs(a.checkNaN(s.dataset.to)):a.checkNaN(s.dataset.to);let o=0;return a.checkNaN(s.dataset.to)>0?o=r+n:r>n?o=r-n:o=n-r,(1-(Math.abs(a.checkNaN(s.dataset.from))+a.checkNaN(s.dataset.value))/o)*(l.value.height-i.value.top-i.value.bottom)}),j=e.computed(()=>`${C.value}px`),D=e.computed(()=>`${l.value.height-t.value.style.chart.padding.bottom-i.value.top}px`),X=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),J=e.computed(()=>{if(s.dataset.colors){if(!s.dataset.colors.from)return f(p.value[0]||a.palette[0],a.convertColorToHex(s.dataset.colors.to),c.value||10);if(!s.dataset.colors.to)return f(a.convertColorToHex(s.dataset.colors.from),p.value[1]||a.palette[1],c.value||10)}else return f(p.value[1]||a.palette[1],p.value[0]||a.palette[0],c.value||10);return f(a.convertColorToHex(s.dataset.colors.from),a.convertColorToHex(s.dataset.colors.to),c.value||10)}),U=e.computed(()=>{const r=[];let n=0;const o=l.value.height-i.value.top-i.value.bottom;for(let u=0;u<o-1;u+=o/c.value)r.push({x:l.value.left,y:l.value.top+u,qYLess:l.value.top+u+o/c.value/4,halfY:l.value.top+u+o/c.value/2,qYMore:l.value.top+u+o/c.value/4*3,color:J.value[n],height:o/c.value}),n+=1;return r}),h=e.ref(!1);function K(r){h.value=r,E.value+=1}const y=e.ref(!1);function w(){y.value=!y.value}return L({generatePdf:A,generateImage:T,toggleAnnotator:w}),(r,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:V,class:e.normalizeClass(`vue-ui-thermometer ${h.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}`),id:`thermometer__${d.value}`,onMouseenter:n[0]||(n[0]=()=>e.unref($)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref($)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ae._sfc_main,{key:0,svgRef:e.unref(O),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:y.value,onClose:w},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),H.value?(e.openBlock(),e.createElementBlock("div",ce,null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",de,[(e.openBlock(),e.createBlock(oe._sfc_main,{key:`title_${P.value}`,config:{title:{cy:"thermometer-div-title",...t.value.style.title},subtitle:{cy:"thermometer-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&g.value&&(e.unref(F)||e.unref(k))?(e.openBlock(),e.createBlock(Y.UserOptions,{ref:"details",key:`user_options_${E.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(q),isPrinting:e.unref(S),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,titles:{...t.value.userOptions.buttonTitles},chartElement:V.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:y.value,onToggleFullscreen:K,onGeneratePdf:e.unref(A),onGenerateImage:e.unref(T),onToggleAnnotator:w,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(k)?"visible":"hidden":"visible"})},e.createSlots({_:2},[r.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:o,color:u})=>[e.renderSlot(r.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:o,color:u})),void 0,!0)]),key:"0"}:void 0,r.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,r.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,r.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(r.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"3"}:void 0,r.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:u})=>[e.renderSlot(r.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:u})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:O,xmlns:e.unref(a.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:"background:transparent"},[e.createVNode(le._sfc_main),r.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width,height:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(r.$slots,"chart-background",{},void 0,!0)],8,ve)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",me,[e.createElementVNode("rect",{x:"0",y:"0",width:"1",height:"1",rx:"0.5",ry:"0.07",fill:t.value.style.chart.backgroundColor},null,8,pe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(o,u)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${u}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,ye),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(o.color,100-t.value.style.chart.graduations.gradient.intensity)},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,ke)],8,fe))),256))]),e.createElementVNode("g",be,[e.createElementVNode("rect",{x:l.value.left,y:l.value.top,height:l.value.height-i.value.top-i.value.bottom,width:l.value.width-i.value.left-i.value.right,fill:"#FFFFFF"},null,8,xe),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(o,u)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${u}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:l.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:t.value.style.chart.graduations.gradient.show?`url(#vueUiThermometerGradient_${u}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,Ce),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,we)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,_e)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x+2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ne)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x+2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Be)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.value.right,x2:l.value.right-10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ve)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.value.right,x2:l.value.right-5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ee)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.value.right,x2:l.value.right-2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,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:2,x1:l.value.right,x2:l.value.right-2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,$e)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("rect",{class:e.normalizeClass({"vue-ui-thermometer-temperature":t.value.style.chart.animation.use}),x:l.value.left,y:l.value.top,height:C.value,width:l.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,Fe)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:C.value+l.value.top+t.value.style.chart.label.fontSize/3,x:l.value.left-10,"text-anchor":"end",fill:t.value.style.chart.label.color,"font-size":t.value.style.chart.label.fontSize,"font-weight":t.value.style.chart.label.bold?"bold":"normal"},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.chart.label.formatter,m.dataset.value,e.unref(a.dataLabel)({p:t.value.style.chart.label.prefix,v:m.dataset.value,s:t.value.style.chart.label.suffix,r:t.value.style.chart.label.rounding}),{datapoint:m.dataset})),11,Oe),e.renderSlot(r.$slots,"svg",{svg:W.value},void 0,!0)],10,he)):e.createCommentVNode("",!0),r.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ie,[e.renderSlot(r.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(S)||e.unref(q)})),void 0,!0)])):e.createCommentVNode("",!0),r.$slots.source?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(r.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(re.default,{key:7,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],46,ie))}},Ae=ue._export_sfc(qe,[["__scopeId","data-v-b0579fd1"]]);exports.default=Ae;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-DlALYfRS.cjs"),oe=require("./Title-BiyGREAz.cjs"),Y=require("./usePrinter-n1HzfoSm.cjs"),re=require("./vue-ui-skeleton-C-I7hIHS.cjs"),z=require("./useNestedProp-BZX7zlGv.cjs"),le=require("./PackageVersion-Di-ZyR0_.cjs"),ae=require("./PenAndPaper-CtYhqkG5.cjs"),se=require("./useUserOptionState-BgepsfED.cjs"),ne=require("./useChartAccessibility-Cm7nkzTG.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ie=["id"],ce={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},de={key:2,style:"width:100%"},he=["xmlns","viewBox"],ve=["width","height"],me={id:"vueUiPill",clipPathUnits:"objectBoundingBox"},pe=["fill"],fe=["id"],ye=["stop-color"],ge=["stop-color"],ke=["stop-color"],be={"clip-path":"url(#vueUiPill)"},xe=["x","y","height","width"],Ce=["x","y","height","width","fill"],we=["x1","x2","y1","y2","stroke-width","stroke"],_e=["x1","x2","y1","y2","stroke-width","stroke"],Ne=["x1","x2","y1","y2","stroke-width","stroke"],Be=["x1","x2","y1","y2","stroke-width","stroke"],Ve=["x1","x2","y1","y2","stroke-width","stroke"],Ee=["x1","x2","y1","y2","stroke-width","stroke"],Pe=["x1","x2","y1","y2","stroke-width","stroke"],$e=["x1","x2","y1","y2","stroke-width","stroke"],Fe=["x","y","height","width"],Oe=["y","x","fill","font-size","font-weight"],Ie={key:5,class:"vue-data-ui-watermark"},Se={key:6,ref:"source",dir:"auto"},qe={__name:"vue-ui-thermometer",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},setup(m,{expose:L}){e.useCssVars(r=>({"3272b184":X.value,"0885078a":D.value,"09e2f6f7":j.value}));const{vue_ui_thermometer:G}=a.useConfig(),s=m,g=e.computed(()=>!!s.dataset&&Object.keys(s.dataset).length);e.onMounted(()=>{B()});function B(){a.objectIsEmpty(s.dataset)?a.error({componentName:"VueUiThermometer",type:"dataset"}):a.getMissingDatasetAttributes({datasetObject:s.dataset,requiredAttributes:["value","from","to"]}).forEach(r=>{a.error({componentName:"VueUiThermometer",type:"datasetAttribute",property:r})})}const d=e.ref(a.createUid()),V=e.ref(null),E=e.ref(0),P=e.ref(0),t=e.computed({get:()=>I(),set:r=>r}),{userOptionsVisible:k,setUserOptionsVisibility:$,keepUserOptionState:F}=se.useUserOptionState({config:t.value}),{svgRef:O}=ne.useChartAccessibility({config:t.value.style.title});function I(){const r=z.useNestedProp({userConfig:s.config,defaultConfig:G});return r.theme?{...z.useNestedProp({userConfig:a.themes.vue_ui_thermometer[r.theme]||s.config,defaultConfig:r}),customPalette:a.themePalettes[r.theme]||a.palette}:r}e.watch(()=>s.config,r=>{t.value=I(),k.value=!t.value.userOptions.showOnChartHover,B(),P.value+=1},{deep:!0});const{isPrinting:S,isImaging:q,generatePdf:A,generateImage:T}=Y.usePrinter({elementId:`thermometer__${d.value}`,fileName:t.value.style.title.text||"vue-ui-thermometer",options:t.value.userOptions.print}),H=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),p=e.computed(()=>a.convertCustomPalette(t.value.customPalette)),R=e.computed(()=>t.value.style.chart.thermometer.width),c=e.computed(()=>s.dataset.steps||10),i=e.ref({top:t.value.style.chart.padding.top,left:t.value.style.chart.padding.left,right:t.value.style.chart.padding.right,bottom:t.value.style.chart.padding.bottom});function f(r,n,o){const u=[],_=M(r),N=M(n);for(let v=0;v<o;v++){const Q=b(_.red,N.red,v,o),Z=b(_.green,N.green,v,o),ee=b(_.blue,N.blue,v,o),te=`#${x(Q)}${x(Z)}${x(ee)}`;u.push(te)}return u}function M(r){const n=r.slice(1);return{red:parseInt(n.slice(0,2),16),green:parseInt(n.slice(2,4),16),blue:parseInt(n.slice(4,6),16)}}function b(r,n,o,u){return Math.round(r+(n-r)*o/u)}function x(r){return r.toString(16).padStart(2,"0")}const l=e.computed(()=>{const r=R.value+i.value.left+i.value.right,n=t.value.style.chart.height;return{width:r,left:i.value.left,right:r-i.value.right,top:i.value.top,bottom:n-i.value.bottom,height:n}}),W=e.computed(()=>l.value),C=e.computed(()=>{const r=a.checkNaN(s.dataset.from)<0?Math.abs(a.checkNaN(s.dataset.from)):a.checkNaN(s.dataset.from),n=a.checkNaN(s.dataset.to)<0?Math.abs(a.checkNaN(s.dataset.to)):a.checkNaN(s.dataset.to);let o=0;return a.checkNaN(s.dataset.to)>0?o=r+n:r>n?o=r-n:o=n-r,(1-(Math.abs(a.checkNaN(s.dataset.from))+a.checkNaN(s.dataset.value))/o)*(l.value.height-i.value.top-i.value.bottom)}),j=e.computed(()=>`${C.value}px`),D=e.computed(()=>`${l.value.height-t.value.style.chart.padding.bottom-i.value.top}px`),X=e.computed(()=>`${t.value.style.chart.animation.speedMs}ms`),J=e.computed(()=>{if(s.dataset.colors){if(!s.dataset.colors.from)return f(p.value[0]||a.palette[0],a.convertColorToHex(s.dataset.colors.to),c.value||10);if(!s.dataset.colors.to)return f(a.convertColorToHex(s.dataset.colors.from),p.value[1]||a.palette[1],c.value||10)}else return f(p.value[1]||a.palette[1],p.value[0]||a.palette[0],c.value||10);return f(a.convertColorToHex(s.dataset.colors.from),a.convertColorToHex(s.dataset.colors.to),c.value||10)}),U=e.computed(()=>{const r=[];let n=0;const o=l.value.height-i.value.top-i.value.bottom;for(let u=0;u<o-1;u+=o/c.value)r.push({x:l.value.left,y:l.value.top+u,qYLess:l.value.top+u+o/c.value/4,halfY:l.value.top+u+o/c.value/2,qYMore:l.value.top+u+o/c.value/4*3,color:J.value[n],height:o/c.value}),n+=1;return r}),h=e.ref(!1);function K(r){h.value=r,E.value+=1}const y=e.ref(!1);function w(){y.value=!y.value}return L({generatePdf:A,generateImage:T,toggleAnnotator:w}),(r,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"thermoChart",ref:V,class:e.normalizeClass(`vue-ui-thermometer ${h.value?"vue-data-ui-wrapper-fullscreen":""}`),style:e.normalizeStyle(`width:100%;background:${t.value.style.chart.backgroundColor};color:${t.value.style.chart.color};font-family:${t.value.style.fontFamily}`),id:`thermometer__${d.value}`,onMouseenter:n[0]||(n[0]=()=>e.unref($)(!0)),onMouseleave:n[1]||(n[1]=()=>e.unref($)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ae._sfc_main,{key:0,svgRef:e.unref(O),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:y.value,onClose:w},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),H.value?(e.openBlock(),e.createElementBlock("div",ce,null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",de,[(e.openBlock(),e.createBlock(oe._sfc_main,{key:`title_${P.value}`,config:{title:{cy:"thermometer-div-title",...t.value.style.title},subtitle:{cy:"thermometer-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))])):e.createCommentVNode("",!0),t.value.userOptions.show&&g.value&&(e.unref(F)||e.unref(k))?(e.openBlock(),e.createBlock(Y.UserOptions,{ref:"details",key:`user_options_${E.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(q),isPrinting:e.unref(S),uid:d.value,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasFullscreen:t.value.userOptions.buttons.fullscreen,hasXls:!1,isFullscreen:h.value,titles:{...t.value.userOptions.buttonTitles},chartElement:V.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:y.value,onToggleFullscreen:K,onGeneratePdf:e.unref(A),onGenerateImage:e.unref(T),onToggleAnnotator:w,style:e.normalizeStyle({visibility:e.unref(F)?e.unref(k)?"visible":"hidden":"visible"})},e.createSlots({_:2},[r.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:o,color:u})=>[e.renderSlot(r.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:o,color:u})),void 0,!0)]),key:"0"}:void 0,r.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,r.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(r.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,r.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:u})=>[e.renderSlot(r.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:u})),void 0,!0)]),key:"3"}:void 0,r.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:u})=>[e.renderSlot(r.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:u})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:O,xmlns:e.unref(a.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":h.value,"vue-data-ui-fulscreen--off":!h.value}),width:"100%",viewBox:`0 0 ${l.value.width} ${l.value.height}`,style:"background:transparent"},[e.createVNode(le._sfc_main),r.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:l.value.width,height:l.value.height,style:{pointerEvents:"none"}},[e.renderSlot(r.$slots,"chart-background",{},void 0,!0)],8,ve)):e.createCommentVNode("",!0),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",me,[e.createElementVNode("rect",{x:"0",y:"0",width:"1",height:"1",rx:"0.5",ry:"0.07",fill:t.value.style.chart.backgroundColor},null,8,pe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(o,u)=>(e.openBlock(),e.createElementBlock("linearGradient",{id:`vueUiThermometerGradient_${u}_${d.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":o.color},null,8,ye),e.createElementVNode("stop",{offset:"50%","stop-color":e.unref(a.setOpacity)(o.color,100-t.value.style.chart.graduations.gradient.intensity)},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":o.color},null,8,ke)],8,fe))),256))]),e.createElementVNode("g",be,[e.createElementVNode("rect",{x:l.value.left,y:l.value.top,height:l.value.height-i.value.top-i.value.bottom,width:l.value.width-i.value.left-i.value.right,fill:"#FFFFFF"},null,8,xe),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(o,u)=>(e.openBlock(),e.createElementBlock("g",{key:`graduation_${u}`},[e.createElementVNode("rect",{x:o.x,y:o.y,height:o.height,width:l.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:t.value.style.chart.graduations.gradient.show?`url(#vueUiThermometerGradient_${u}_${d.value})`:o.color,"shape-rendering":"crispEdges"},null,8,Ce),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,we)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:o.x,x2:o.x+5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,_e)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:o.x,x2:o.x+2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ne)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","left"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.x,x2:o.x+2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Be)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.value.right,x2:l.value.right-10,y1:o.y,y2:o.y,"stroke-width":t.value.style.chart.graduations.strokeWidth,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ve)):e.createCommentVNode("",!0),t.value.style.chart.graduations.showIntermediate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.value.right,x2:l.value.right-5,y1:o.halfY,y2:o.halfY,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,Ee)):e.createCommentVNode("",!0),t.value.style.chart.graduations.show&&["both","right"].includes(t.value.style.chart.graduations.sides)?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.value.right,x2:l.value.right-2.5,y1:o.qYLess,y2:o.qYLess,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,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:2,x1:l.value.right,x2:l.value.right-2.5,y1:o.qYMore,y2:o.qYMore,"stroke-width":t.value.style.chart.graduations.strokeWidth/2,stroke:t.value.style.chart.graduations.stroke,"stroke-linecap":"round"},null,8,$e)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)]))),128)),e.createElementVNode("rect",{class:e.normalizeClass({"vue-ui-thermometer-temperature":t.value.style.chart.animation.use}),x:l.value.left,y:l.value.top,height:C.value,width:l.value.width-t.value.style.chart.padding.left-t.value.style.chart.padding.right,fill:"#FFFFFF66"},null,10,Fe)]),e.createElementVNode("text",{class:e.normalizeClass({"vue-ui-thermometer-temperature-value":t.value.style.chart.animation.use}),y:C.value+l.value.top+t.value.style.chart.label.fontSize/3,x:l.value.left-10,"text-anchor":"end",fill:t.value.style.chart.label.color,"font-size":t.value.style.chart.label.fontSize,"font-weight":t.value.style.chart.label.bold?"bold":"normal"},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.chart.label.formatter,m.dataset.value,e.unref(a.dataLabel)({p:t.value.style.chart.label.prefix,v:m.dataset.value,s:t.value.style.chart.label.suffix,r:t.value.style.chart.label.rounding}),{datapoint:m.dataset})),11,Oe),e.renderSlot(r.$slots,"svg",{svg:W.value},void 0,!0)],10,he)):e.createCommentVNode("",!0),r.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ie,[e.renderSlot(r.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(S)||e.unref(q)})),void 0,!0)])):e.createCommentVNode("",!0),r.$slots.source?(e.openBlock(),e.createElementBlock("div",Se,[e.renderSlot(r.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(re.default,{key:7,config:{type:"thermometer",style:{backgroundColor:t.value.style.chart.backgroundColor,thermometer:{color:"#CCCCCC"}}}},null,8,["config"]))],46,ie))}},Ae=ue._export_sfc(qe,[["__scopeId","data-v-b0579fd1"]]);exports.default=Ae;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useCssVars as ke, computed as d, onMounted as be, ref as m, watch as _e, createElementBlock as u, openBlock as l, unref as h, normalizeStyle as te, normalizeClass as I, createBlock as O, createCommentVNode as i, createSlots as xe, withCtx as _, renderSlot as f, normalizeProps as P, guardReactiveProps as A, createVNode as we, createElementVNode as v, Fragment as M, renderList as se, toDisplayString as Ce } from "vue";
|
|
2
|
-
import { u as $e, o as Fe, e as oe, g as Ie, c as Oe, t as Pe, p as x, a as Ae, b as Me, v as g, d as U, X as Ue, s as Ye, i as Ne, f as Se } from "./index-
|
|
3
|
-
import { _ as Te } from "./Title-
|
|
4
|
-
import { u as qe, U as Le } from "./usePrinter-
|
|
5
|
-
import Ve from "./vue-ui-skeleton-
|
|
6
|
-
import { u as le } from "./useNestedProp-
|
|
7
|
-
import { _ as Ee } from "./PackageVersion-
|
|
8
|
-
import { _ as Ge } from "./PenAndPaper-
|
|
2
|
+
import { u as $e, o as Fe, e as oe, g as Ie, c as Oe, t as Pe, p as x, a as Ae, b as Me, v as g, d as U, X as Ue, s as Ye, i as Ne, f as Se } from "./index-bVqxfptX.js";
|
|
3
|
+
import { _ as Te } from "./Title-B55VMGbm.js";
|
|
4
|
+
import { u as qe, U as Le } from "./usePrinter-BbeIGqpA.js";
|
|
5
|
+
import Ve from "./vue-ui-skeleton-BARmXI9_.js";
|
|
6
|
+
import { u as le } from "./useNestedProp-DU-vsdTb.js";
|
|
7
|
+
import { _ as Ee } from "./PackageVersion-gI4tUgWr.js";
|
|
8
|
+
import { _ as Ge } from "./PenAndPaper-Di3hcmp3.js";
|
|
9
9
|
import { u as We } from "./useUserOptionState-BIvW1Kz7.js";
|
|
10
10
|
import { u as je } from "./useChartAccessibility-BWojgys7.js";
|
|
11
11
|
import { _ as ze } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ref as i, onMounted as Z, computed as z, onBeforeUnmount as ee, watch as te, createElementBlock as o, openBlock as l, normalizeStyle as p, createCommentVNode as d, createElementVNode as _, createBlock as ae, unref as se, createVNode as C, renderSlot as H, mergeProps as q, normalizeProps as W, guardReactiveProps as G, toDisplayString as le } from "vue";
|
|
2
|
-
import { u as oe } from "./useNestedProp-
|
|
3
|
-
import { u as re, c as ue, X as ie, F as V } from "./index-
|
|
2
|
+
import { u as oe } from "./useNestedProp-DU-vsdTb.js";
|
|
3
|
+
import { u as re, c as ue, X as ie, F as V } from "./index-bVqxfptX.js";
|
|
4
4
|
import { t as ne, u as ce } from "./useResponsive-Cw4oZ8sQ.js";
|
|
5
|
-
import R from "./BaseIcon-
|
|
6
|
-
import { _ as de } from "./Title-
|
|
7
|
-
import { _ as he } from "./PackageVersion-
|
|
5
|
+
import R from "./BaseIcon-DPO_4Adb.js";
|
|
6
|
+
import { _ as de } from "./Title-B55VMGbm.js";
|
|
7
|
+
import { _ as he } from "./PackageVersion-gI4tUgWr.js";
|
|
8
8
|
import { u as ve } from "./useChartAccessibility-BWojgys7.js";
|
|
9
9
|
import { _ as pe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
class fe {
|