vue-data-ui 2.3.27 → 2.3.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/{Arrow-O38M_J_k.js → Arrow-BPoxM_Tq.js} +1 -1
- package/dist/{Arrow-HROOtfWV.cjs → Arrow-C6lQ94rK.cjs} +1 -1
- package/dist/{BaseIcon-CiO8gP9x.cjs → BaseIcon-BK5xYOzV.cjs} +1 -1
- package/dist/{BaseIcon-D8FXGup9.js → BaseIcon-Op8_v5x7.js} +1 -1
- package/dist/{DataTable-C6HTLT7L.cjs → DataTable-B4_9ynlY.cjs} +1 -1
- package/dist/{DataTable-EqeVt-K-.js → DataTable-bEXuvNn5.js} +2 -2
- package/dist/{Legend-C_lBCmBu.cjs → Legend-BNfS77GS.cjs} +1 -1
- package/dist/{Legend-8eVERYMn.js → Legend-DwludSgp.js} +1 -1
- package/dist/{Shape-DvcgW6uK.js → Shape-COYAxpcP.js} +1 -1
- package/dist/{Shape-D8RdmYWq.cjs → Shape-CcWWIf-s.cjs} +1 -1
- package/dist/{Slicer-CH_5wnFM.js → Slicer-Cv-2s_-r.js} +1 -1
- package/dist/{Slicer-BvYL7yVK.cjs → Slicer-DGkm-5p-.cjs} +1 -1
- package/dist/{Title-C3Ez1ceq.js → Title-CtWGLaoz.js} +1 -1
- package/dist/{Title-B9iq63n1.cjs → Title-DQz9dO4d.cjs} +1 -1
- package/dist/{Tooltip-7SRMoiu-.js → Tooltip-D6BUVHr1.js} +1 -1
- package/dist/{Tooltip-DcDEanxk.cjs → Tooltip-DQgBkgFk.cjs} +1 -1
- package/dist/documentation/installation.md +1 -1
- package/dist/{index-DiWO-_ca.js → index-BhCM2QF1.js} +5 -1
- package/dist/index-Y23HeR26.cjs +4 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +1 -0
- package/dist/types/vue-data-ui.d.ts +1 -0
- package/dist/{useNestedProp-BtqgWTf9.cjs → useNestedProp-C2H2jmU6.cjs} +1 -1
- package/dist/{useNestedProp-DNX5EefQ.js → useNestedProp-CH3PVhvc.js} +1 -1
- package/dist/{usePrinter-BD40aUzH.js → usePrinter-B75HLwzw.js} +1 -1
- package/dist/{usePrinter-Q1J--baX.cjs → usePrinter-DTF28E03.cjs} +1 -1
- package/dist/{vue-data-ui-GHpxkf8a.js → vue-data-ui-DdhV5Pth.js} +57 -57
- package/dist/{vue-data-ui-yd5q4Ura.cjs → vue-data-ui-cqeqQWwY.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-DkJ4c3HQ.cjs → vue-ui-3d-bar-BB6yidY7.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-CAmoj5dT.js → vue-ui-3d-bar-gi0fEJUl.js} +7 -7
- package/dist/{vue-ui-accordion-CiNdgRO9.js → vue-ui-accordion-CSZdj7wA.js} +3 -3
- package/dist/{vue-ui-accordion-ogVvFfQy.cjs → vue-ui-accordion-CVrj6roI.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-BrTpbEha.js → vue-ui-age-pyramid-CFSWDX3d.js} +8 -8
- package/dist/{vue-ui-age-pyramid-CkKVbbl8.cjs → vue-ui-age-pyramid-CrTadT86.cjs} +1 -1
- package/dist/{vue-ui-annotator-B9IqZ-Hy.js → vue-ui-annotator-DqZU11ky.js} +1 -1
- package/dist/{vue-ui-annotator-QbetAXoj.cjs → vue-ui-annotator-u5YbenPl.cjs} +1 -1
- package/dist/{vue-ui-candlestick-BvRwlc3d.cjs → vue-ui-candlestick-C3xswSm3.cjs} +1 -1
- package/dist/{vue-ui-candlestick-XjjwFaDO.js → vue-ui-candlestick-Dph2PhZC.js} +9 -9
- package/dist/{vue-ui-carousel-table-DtxcnSEp.cjs → vue-ui-carousel-table-0S6lSZnt.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-KYENY5gp.js → vue-ui-carousel-table-eY08SE2G.js} +4 -4
- package/dist/{vue-ui-chestnut-DfIcguJd.js → vue-ui-chestnut-BikYCrjQ.js} +6 -6
- package/dist/{vue-ui-chestnut-C7gFvKLJ.cjs → vue-ui-chestnut-C3XOHDgw.cjs} +1 -1
- package/dist/{vue-ui-cursor-COS_MXr8.cjs → vue-ui-cursor-DUA57VkZ.cjs} +1 -1
- package/dist/{vue-ui-cursor-C4pJe90O.js → vue-ui-cursor-OFgeAFSo.js} +2 -2
- package/dist/{vue-ui-dashboard-DNOjWStr.cjs → vue-ui-dashboard-BTG0m9YL.cjs} +1 -1
- package/dist/{vue-ui-dashboard-B_NUnxEF.js → vue-ui-dashboard-DA4M1Z0-.js} +2 -2
- package/dist/{vue-ui-digits-uufqLbRt.js → vue-ui-digits-55Zmunkv.js} +2 -2
- package/dist/{vue-ui-digits-Vx5prxaT.cjs → vue-ui-digits-COxRiMVI.cjs} +1 -1
- package/dist/{vue-ui-donut-C33U3e8H.js → vue-ui-donut-CG3VWjnG.js} +9 -9
- package/dist/{vue-ui-donut-CeHnjIGu.cjs → vue-ui-donut-JA9hlLlV.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-IzfAVo5I.js → vue-ui-donut-evolution-CA8sDbwX.js} +9 -9
- package/dist/{vue-ui-donut-evolution-hHfvz1Yd.cjs → vue-ui-donut-evolution-_E0xUI9Y.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-z_Ck4W33.cjs → vue-ui-dumbbell-BSFT-Bce.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-KvrVLLw6.js → vue-ui-dumbbell-BtEXt5Ox.js} +8 -8
- package/dist/{vue-ui-flow-BjMikE9b.js → vue-ui-flow-BBoXBTkC.js} +7 -7
- package/dist/{vue-ui-flow-Dg4dkrcd.cjs → vue-ui-flow-BPEGOFRZ.cjs} +1 -1
- package/dist/{vue-ui-galaxy-B8EoId23.cjs → vue-ui-galaxy-DPrJum3L.cjs} +1 -1
- package/dist/{vue-ui-galaxy-BdgveN18.js → vue-ui-galaxy-ZFEufIyy.js} +9 -9
- package/dist/{vue-ui-gauge-D01FLnNz.js → vue-ui-gauge-BqZp_V5m.js} +5 -5
- package/dist/{vue-ui-gauge-D8pokfoA.cjs → vue-ui-gauge-CfZ9XJW_.cjs} +1 -1
- package/dist/{vue-ui-gizmo-8lKc8m8b.cjs → vue-ui-gizmo-CrSaW32p.cjs} +1 -1
- package/dist/{vue-ui-gizmo-Cp-EftjP.js → vue-ui-gizmo-DitbWAJp.js} +2 -2
- package/dist/{vue-ui-heatmap-DvpvKq3Q.cjs → vue-ui-heatmap-CTRjjhmd.cjs} +1 -1
- package/dist/{vue-ui-heatmap-BEsvmj5R.js → vue-ui-heatmap-zV0pg2Q5.js} +8 -8
- package/dist/{vue-ui-kpi-PWurAGxE.cjs → vue-ui-kpi-B2Bo26hh.cjs} +1 -1
- package/dist/{vue-ui-kpi-D6rVKouk.js → vue-ui-kpi-BWuzEkyY.js} +2 -2
- package/dist/{vue-ui-mini-loader-YV68i0nk.js → vue-ui-mini-loader-BwAWiK3k.js} +2 -2
- package/dist/{vue-ui-mini-loader-BsypWozL.cjs → vue-ui-mini-loader-C_Nb-qVd.cjs} +1 -1
- package/dist/{vue-ui-molecule-BWYCf3Km.js → vue-ui-molecule-BD2UW2lJ.js} +9 -9
- package/dist/{vue-ui-molecule-Bx3fXHnw.cjs → vue-ui-molecule-CSbXNrvu.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-DsZozq6x.js → vue-ui-mood-radar-CbMab8pJ.js} +9 -9
- package/dist/{vue-ui-mood-radar-C6devC4e.cjs → vue-ui-mood-radar-zpxdsZ4u.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-BtT3VsSf.cjs → vue-ui-nested-donuts-07UI_VlW.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-qaViBhR3.js → vue-ui-nested-donuts-SDaiotgC.js} +9 -9
- package/dist/{vue-ui-onion-0iFsjuLM.js → vue-ui-onion-BamHJBdP.js} +9 -9
- package/dist/{vue-ui-onion-9ATTDUpw.cjs → vue-ui-onion-DiychUul.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-DxDFs1Lb.js → vue-ui-parallel-coordinate-plot-1R4CyBdQ.js} +10 -10
- package/dist/{vue-ui-parallel-coordinate-plot-BkZOKTIS.cjs → vue-ui-parallel-coordinate-plot-BaAa3t1h.cjs} +1 -1
- package/dist/{vue-ui-quadrant-Tw7SKMbQ.js → vue-ui-quadrant-CKCLhAS7.js} +10 -10
- package/dist/{vue-ui-quadrant-DD4H_Dhk.cjs → vue-ui-quadrant-DxLYb8Mk.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-CpFHKtpm.js → vue-ui-quick-chart-CAXuRSdm.js} +6 -6
- package/dist/{vue-ui-quick-chart-D1udOl47.cjs → vue-ui-quick-chart-DgCRM6WA.cjs} +1 -1
- package/dist/{vue-ui-radar-D5FV2IDm.js → vue-ui-radar-BY-y8Mal.js} +10 -10
- package/dist/{vue-ui-radar-CZmJDj3q.cjs → vue-ui-radar-iETP_3US.cjs} +1 -1
- package/dist/{vue-ui-rating-Dds9tjxd.js → vue-ui-rating-Bq1SsByA.js} +2 -2
- package/dist/{vue-ui-rating-DTWIh_CV.cjs → vue-ui-rating-DGEgzOaB.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-B2p8F7-L.js → vue-ui-relation-circle-BPzLP6U6.js} +5 -5
- package/dist/{vue-ui-relation-circle-Cu9lKkX3.cjs → vue-ui-relation-circle-pdZ79G9r.cjs} +1 -1
- package/dist/{vue-ui-rings-BKzCFSx-.js → vue-ui-rings-C5ce6pEf.js} +9 -9
- package/dist/{vue-ui-rings-DN7XmhKZ.cjs → vue-ui-rings-DdpKT3DJ.cjs} +1 -1
- package/dist/{vue-ui-scatter-CwV9l1P7.js → vue-ui-scatter-CMetujXJ.js} +10 -10
- package/dist/{vue-ui-scatter-DJlC5mz4.cjs → vue-ui-scatter-Dsc6RABP.cjs} +1 -1
- package/dist/{vue-ui-screenshot-Bo6i-aRF.js → vue-ui-screenshot--2aeIH_x.js} +1 -1
- package/dist/{vue-ui-screenshot-CnPWz57l.cjs → vue-ui-screenshot-BqzljUT3.cjs} +1 -1
- package/dist/{vue-ui-skeleton-CcrGR_Vh.cjs → vue-ui-skeleton-B5Z4craS.cjs} +1 -1
- package/dist/{vue-ui-skeleton-CeNL0kH-.js → vue-ui-skeleton-_VMQ594N.js} +2 -2
- package/dist/{vue-ui-smiley-BBcmwq4z.cjs → vue-ui-smiley-CL-bubXk.cjs} +1 -1
- package/dist/{vue-ui-smiley-BGMzw-SW.js → vue-ui-smiley-Cty3e_yE.js} +2 -2
- package/dist/{vue-ui-spark-trend-DlvTlA9z.cjs → vue-ui-spark-trend-DT1fMqf_.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-CSC9zmt7.js → vue-ui-spark-trend-pgdWTEqG.js} +4 -4
- package/dist/{vue-ui-sparkbar-0CNZluKs.js → vue-ui-sparkbar-BVQPOz2O.js} +3 -3
- package/dist/{vue-ui-sparkbar-Di-BPkJ0.cjs → vue-ui-sparkbar-kfA-BPVJ.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-B5g5nxUh.cjs → vue-ui-sparkgauge-DdzlyDsm.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-DJPt0cLe.js → vue-ui-sparkgauge-Dx2gFX6H.js} +3 -3
- package/dist/{vue-ui-sparkhistogram-BhkYmR4U.cjs → vue-ui-sparkhistogram-B5xstgQG.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-DpvQcFls.js → vue-ui-sparkhistogram-Bg_fJsT5.js} +4 -4
- package/dist/{vue-ui-sparkline-CDSg9rhl.js → vue-ui-sparkline-BWl_B6LX.js} +3 -3
- package/dist/{vue-ui-sparkline-Bw3y-88R.cjs → vue-ui-sparkline-WMI-RgkW.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-DveNwcVx.js → vue-ui-sparkstackbar-MMGRG9eS.js} +3 -3
- package/dist/{vue-ui-sparkstackbar-Ckcir2dk.cjs → vue-ui-sparkstackbar-Skcshn6g.cjs} +1 -1
- package/dist/{vue-ui-stackbar-jNWFgXiA.cjs → vue-ui-stackbar-DZ0CArmk.cjs} +1 -1
- package/dist/{vue-ui-stackbar-CZUsUeZ_.js → vue-ui-stackbar-NZFO3R77.js} +10 -10
- package/dist/{vue-ui-strip-plot-lVVqtsNc.js → vue-ui-strip-plot-CJmCgC_a.js} +9 -9
- package/dist/{vue-ui-strip-plot-CzHFNhr3.cjs → vue-ui-strip-plot-Db_dqjd9.cjs} +1 -1
- package/dist/{vue-ui-table-8hNkBy1z.js → vue-ui-table-B-vHHlRw.js} +1 -1
- package/dist/{vue-ui-table-heatmap-BAPA4nvf.js → vue-ui-table-heatmap-BfzDb2H7.js} +4 -4
- package/dist/{vue-ui-table-heatmap-HgHQKSax.cjs → vue-ui-table-heatmap-YCyFyq8J.cjs} +1 -1
- package/dist/{vue-ui-table-qtBWpg0m.cjs → vue-ui-table-jJ3daLHe.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-Q8y6tloS.cjs → vue-ui-table-sparkline-4Qbmxxsy.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-DZY_23mg.js → vue-ui-table-sparkline-DZt-bo2D.js} +5 -5
- package/dist/{vue-ui-thermometer-CcH1qmLq.js → vue-ui-thermometer-CdtG1AoI.js} +5 -5
- package/dist/{vue-ui-thermometer-Cbu9jVvC.cjs → vue-ui-thermometer-HXWDU2wD.cjs} +1 -1
- package/dist/{vue-ui-timer-C52mSn4m.cjs → vue-ui-timer-Cb95XSdn.cjs} +1 -1
- package/dist/{vue-ui-timer-DJfYr02u.js → vue-ui-timer-DBqMb9iX.js} +4 -4
- package/dist/{vue-ui-tiremarks-dNuNMt_R.cjs → vue-ui-tiremarks-BqXfvQ4t.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-CcLcd5oA.js → vue-ui-tiremarks-CHKETcHr.js} +5 -5
- package/dist/{vue-ui-treemap-orjA7Y0U.cjs → vue-ui-treemap-CW9JmJ2d.cjs} +1 -1
- package/dist/{vue-ui-treemap-BOz94BVK.js → vue-ui-treemap-DxKunHfW.js} +9 -9
- package/dist/{vue-ui-vertical-bar-BHIt5cjc.cjs → vue-ui-vertical-bar-83AMwsHD.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-BquCm_UG.js → vue-ui-vertical-bar-DRLwZjIz.js} +9 -9
- package/dist/{vue-ui-waffle-CNlp7RTS.js → vue-ui-waffle-BRuDxyDU.js} +9 -9
- package/dist/{vue-ui-waffle-Dv8pXiYm.cjs → vue-ui-waffle-BwUbvdOE.cjs} +1 -1
- package/dist/{vue-ui-wheel-DMRiVkhu.js → vue-ui-wheel-4HKXl04I.js} +5 -5
- package/dist/{vue-ui-wheel-BVjbh4oM.cjs → vue-ui-wheel-kMVi976p.cjs} +1 -1
- package/dist/vue-ui-word-cloud-CrC3iKGd.js +495 -0
- package/dist/vue-ui-word-cloud-WgbYJhMF.cjs +1 -0
- package/dist/{vue-ui-xy-CsFr8tix.js → vue-ui-xy-BN_H7q0X.js} +12 -12
- package/dist/{vue-ui-xy-BOoG4xg8.cjs → vue-ui-xy-BXfP5pz5.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-Bb2Z3E-7.js → vue-ui-xy-canvas-DAY9Ylzs.js} +10 -10
- package/dist/{vue-ui-xy-canvas-BHa3-phi.cjs → vue-ui-xy-canvas-NrhVgFsv.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-BQOxn6SH.cjs +0 -4
- package/dist/vue-ui-word-cloud-CHRE8f_k.js +0 -352
- package/dist/vue-ui-word-cloud-CZum_IjT.cjs +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("./index-Y23HeR26.cjs"),$=require("./useNestedProp-C2H2jmU6.cjs"),S=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),i=y=>(e.pushScopeId("data-v-3e41118a"),y=y(),e.popScopeId(),y),w={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},M=["xmlns","stroke"],B={id:"vueUiSmiley0"},C=["stop-color"],R=["stop-color"],H=i(()=>e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1)),X=["fill"],j=["stroke"],U=e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3e41118a></path><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" data-v-3e41118a></path><path d="M9 10l.01 0" data-v-3e41118a></path><path d="M15 10l.01 0" data-v-3e41118a></path><path d="M9.5 15.25a3.5 3.5 0 0 1 5 0" data-v-3e41118a></path>',5),G=[U],L=["xmlns","viewBox","stroke"],A={id:"vueUiSmiley0"},D=["stop-color"],Y=["stop-color"],F=i(()=>e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1)),K=["fill"],I=["viewBox","stroke"],T=e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3e41118a></path><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" data-v-3e41118a></path><path d="M9 10l.01 0" data-v-3e41118a></path><path d="M15 10l.01 0" data-v-3e41118a></path><path d="M9.5 15.25a3.5 3.5 0 0 1 5 0" data-v-3e41118a></path>',5),O=[T],q=["xmlns","stroke"],P={id:"vueUiSmiley1"},J=["stop-color"],Q=["stop-color"],W=i(()=>e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1)),Z=["fill"],ee=["xmlns","stroke"],te=e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3e41118a></path><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" data-v-3e41118a></path><path d="M9 10l.01 0" data-v-3e41118a></path><path d="M15 10l.01 0" data-v-3e41118a></path><path d="M9 15l6 0" data-v-3e41118a></path>',5),oe=[te],le=["xmlns","viewBox","stroke"],ae={id:"vueUiSmiley1"},ne=["stop-color"],se=["stop-color"],ie=i(()=>e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1)),re=["fill"],de=["viewBox","stroke"],ue=e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3e41118a></path><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" data-v-3e41118a></path><path d="M9 10l.01 0" data-v-3e41118a></path><path d="M15 10l.01 0" data-v-3e41118a></path><path d="M9 15l6 0" data-v-3e41118a></path>',5),ce=[ue],pe=["xmlns","stroke"],ve={id:"vueUiSmiley2"},ye=["stop-color"],me=["stop-color"],fe=i(()=>e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1)),he=["fill"],ke=["xmlns","stroke"],ge=i(()=>e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1)),xe=i(()=>e.createElementVNode("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"},null,-1)),_e=i(()=>e.createElementVNode("path",{d:"M9 10l.01 0"},null,-1)),Ne=i(()=>e.createElementVNode("path",{d:"M15 10l.01 0"},null,-1)),ze=[ge,xe,_e,Ne],Ve=["xmlns","viewBox","stroke"],be=i(()=>e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1)),Ee={id:"vueUiSmiley2"},$e=["stop-color"],Se=["stop-color"],we=["fill"],Me=["xmlns","viewBox","stroke"],Be=i(()=>e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1)),Ce=i(()=>e.createElementVNode("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"},null,-1)),Re=i(()=>e.createElementVNode("path",{d:"M9 10l.01 0"},null,-1)),He=i(()=>e.createElementVNode("path",{d:"M15 10l.01 0"},null,-1)),Xe=[Be,Ce,Re,He],je=["xmlns","stroke"],Ue={id:"vueUiSmiley3"},Ge=["stop-color"],Le=["stop-color"],Ae=i(()=>e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1)),De=["fill"],Ye=["xmlns","stroke"],Fe=e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3e41118a></path><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" data-v-3e41118a></path><path d="M9 10l.01 0" data-v-3e41118a></path><path d="M15 10l.01 0" data-v-3e41118a></path><path d="M9.5 15a3.5 3.5 0 0 0 5 0" data-v-3e41118a></path>',5),Ke=[Fe],Ie=["xmlns","viewBox","stroke"],Te=i(()=>e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1)),Oe={id:"vueUiSmiley3"},qe=["stop-color"],Pe=["stop-color"],Je=["fill"],Qe=["xmlns","viewBox","stroke"],We=e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3e41118a></path><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" data-v-3e41118a></path><path d="M9 10l.01 0" data-v-3e41118a></path><path d="M15 10l.01 0" data-v-3e41118a></path><path d="M9.5 15a3.5 3.5 0 0 0 5 0" data-v-3e41118a></path>',5),Ze=[We],et=["xmlns","stroke"],tt={id:"vueUiSmiley4"},ot=["stop-color"],lt=["stop-color"],at=i(()=>e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1)),nt=["fill"],st=["xmlns","stroke"],it=e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3e41118a></path><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" data-v-3e41118a></path><path d="M9 9l.01 0" data-v-3e41118a></path><path d="M15 9l.01 0" data-v-3e41118a></path><path d="M8 13a4 4 0 1 0 8 0h-8" data-v-3e41118a></path>',5),rt=[it],dt=["xmlns","viewBox","stroke"],ut=i(()=>e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1)),ct={id:"vueUiSmiley4"},pt=["stop-color"],vt=["stop-color"],yt=["fill"],mt=["xmlns","viewBox","stroke"],ft=e.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-3e41118a></path><path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" data-v-3e41118a></path><path d="M9 9l.01 0" data-v-3e41118a></path><path d="M15 9l.01 0" data-v-3e41118a></path><path d="M8 13a4 4 0 1 0 8 0h-8" data-v-3e41118a></path>',5),ht=[ft],kt={__name:"vue-ui-smiley",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup(y,{expose:g,emit:x}){const c=y,{vue_ui_smiley:_}=l.useConfig();e.onMounted(()=>{l.objectIsEmpty(c.dataset)&&l.error({componentName:"VueUiSmiley",type:"dataset"})});const f=e.ref(!1),s=e.ref(void 0),t=e.computed(()=>$.useNestedProp({userConfig:c.config,defaultConfig:_})),N=e.computed(()=>typeof c.dataset.rating=="object"&&!Array.isArray(c.dataset.rating)?z(c.dataset.rating):c.dataset.rating||null),m=e.computed(()=>typeof c.dataset.rating=="object"&&!Array.isArray(c.dataset.rating)),r=e.ref(N.value),d=e.ref(t.value.readonly);function z(n){if(n===null)return null;let o=0,a=0;for(const h in n){const E=parseInt(h),k=n[h];o+=E*k,a+=k}return a===0?0:o/a}function p(n){const o=r.value-n,a=24;switch(!0){case o<0:return 0;case o>1:return 1*a;default:return o*a}}function v(n){d.value||(r.value=n,x("rate",n))}function V(){return r.value}function b(n=!0){d.value=n}g({getData:V,toggleReadonly:b});function u(n){return t.value.readonly?t.value.style.colors.inactive[n]:r.value===n+1?t.value.style.icons.useGradient&&t.value.style.icons.filled?`url(#vueUiSmiley${n})`:t.value.style.colors.active[n]:s.value!==void 0&&s.value===n?t.value.style.icons.useGradient&&t.value.style.icons.filled?`url(#vueUiSmiley${n})`:t.value.style.colors.active[n]:t.value.style.colors.inactive[n]}return(n,o)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily};width:100%;`),onMouseover:o[20]||(o[20]=a=>f.value=!0),onMouseleave:o[21]||(o[21]=a=>{f.value=!1,s.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("div",{style:e.normalizeStyle(`color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"};text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.offsetY}px;font-size:${t.value.style.title.fontSize}px`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`color:${t.value.style.title.subtitle.color};font-size:${t.value.style.title.subtitle.fontSize}px;text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.subtitle.offsetY}px;font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.rating.show&&t.value.style.rating.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(r.value)?"":r.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vue-ui-smiley-wrapper",style:e.normalizeStyle(`overflow:visible;height:${t.value.style.itemSize}px;width:fit-content;margin:0 auto;display:flex;align-items:center;justify-content:center;`)},[t.value.style.rating.show&&t.value.style.rating.position==="left"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-right:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(r.value)?"":r.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{tabindex:"0",class:e.normalizeClass({"vue-ui-smiley-rated":!t.value.readonly&&r.value===1}),style:e.normalizeStyle(`cursor:${t.value.readonly?"default":"pointer"};height:${t.value.style.itemSize}px;aspect-ratio:1/1;
|
|
2
2
|
position:relative`),onMouseenter:o[0]||(o[0]=a=>s.value=0),onMouseleave:o[1]||(o[1]=a=>s.value=void 0),onClick:o[2]||(o[2]=a=>v(1)),onKeyup:o[3]||(o[3]=e.withKeys(a=>v(1),["enter"]))},[t.value.style.tooltip.show&&m.value&&d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${s.value===0?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},"1",4),e.createTextVNode(" : "),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(c.dataset.rating[1]),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0),t.value.style.icons.filled?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(l.XMLNS),style:{transition:"all 0.1s ease-in-out",position:"absolute",top:"0",left:"0"},height:"100%",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:u(0),fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",B,[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(l.shiftHue)(t.value.style.colors.active[0],.05)},null,8,C),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.active[0]},null,8,R)])]),H,e.createElementVNode("path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-5 9.86a4.5 4.5 0 0 0 -3.214 1.35a1 1 0 1 0 1.428 1.4a2.5 2.5 0 0 1 3.572 0a1 1 0 0 0 1.428 -1.4a4.5 4.5 0 0 0 -3.214 -1.35zm-2.99 -4.2l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm6 0l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z","stroke-width":"0",fill:u(0)},null,8,X)],8,M)):(e.openBlock(),e.createElementBlock("svg",{key:2,style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:u(0),fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},G,8,j)),t.value.style.icons.filled&&d.value?(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(l.XMLNS),style:{transition:"all 0.1s ease-in-out",position:"absolute",top:"0",left:"0"},height:"100%",viewBox:`0 0 ${p(0)} 24`,"stroke-width":"1.5",stroke:t.value.style.colors.activeReadonly[0],fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",A,[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(l.shiftHue)(t.value.style.colors.activeReadonly[0],.05)},null,8,D),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.activeReadonly[0]},null,8,Y)])]),F,e.createElementVNode("path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-5 9.86a4.5 4.5 0 0 0 -3.214 1.35a1 1 0 1 0 1.428 1.4a2.5 2.5 0 0 1 3.572 0a1 1 0 0 0 1.428 -1.4a4.5 4.5 0 0 0 -3.214 -1.35zm-2.99 -4.2l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm6 0l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z","stroke-width":"0",fill:t.value.style.icons.useGradient?"url(#vueUiSmiley0)":t.value.style.colors.activeReadonly[0]},null,8,K)],8,L)):e.createCommentVNode("",!0),!t.value.style.icons.filled&&d.value?(e.openBlock(),e.createElementBlock("svg",{key:4,style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:`0 0 ${p(0)} 24`,"stroke-width":"1.5",stroke:t.value.style.colors.activeReadonly[0],fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},O,8,I)):e.createCommentVNode("",!0)],38),e.createElementVNode("div",{tabindex:"0",class:e.normalizeClass({"vue-ui-smiley-rated":!t.value.readonly&&r.value===2}),style:e.normalizeStyle(`cursor:${t.value.readonly?"default":"pointer"};height:${t.value.style.itemSize}px;aspect-ratio:1/1;position:relative`),onMouseenter:o[4]||(o[4]=a=>s.value=1),onMouseleave:o[5]||(o[5]=a=>s.value=void 0),onClick:o[6]||(o[6]=a=>v(2)),onKeyup:o[7]||(o[7]=e.withKeys(a=>v(2),["enter"]))},[t.value.style.tooltip.show&&m.value&&d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${s.value===1?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},"2",4),e.createTextVNode(" : "),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(c.dataset.rating[2]),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0),t.value.style.icons.filled?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(l.XMLNS),style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:u(1),fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",P,[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(l.shiftHue)(t.value.style.colors.active[1],.05)},null,8,J),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.active[1]},null,8,Q)])]),W,e.createElementVNode("path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-2 10.66h-6l-.117 .007a1 1 0 0 0 0 1.986l.117 .007h6l.117 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-5.99 -5l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm6 0l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z","stroke-width":"0",fill:u(1)},null,8,Z)],8,q)):(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(l.XMLNS),style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:u(1),fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},oe,8,ee)),t.value.style.icons.filled&&d.value?(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(l.XMLNS),style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:`0 0 ${p(1)} 24`,"stroke-width":"1.5",stroke:t.value.style.colors.activeReadonly[1],fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",ae,[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(l.shiftHue)(t.value.style.colors.activeReadonly[1],.05)},null,8,ne),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.activeReadonly[1]},null,8,se)])]),ie,e.createElementVNode("path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-2 10.66h-6l-.117 .007a1 1 0 0 0 0 1.986l.117 .007h6l.117 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm-5.99 -5l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm6 0l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z","stroke-width":"0",fill:t.value.style.icons.useGradient?"url(#vueUiSmiley1)":t.value.style.colors.activeReadonly[1]},null,8,re)],8,le)):e.createCommentVNode("",!0),!t.value.style.icons.filled&&d.value?(e.openBlock(),e.createElementBlock("svg",{key:4,style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:`0 0 ${p(1)} 24`,"stroke-width":"1.5",stroke:t.value.style.colors.activeReadonly[1],fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},ce,8,de)):e.createCommentVNode("",!0)],38),e.createElementVNode("div",{tabindex:"0",class:e.normalizeClass({"vue-ui-smiley-rated":!t.value.readonly&&r.value===3}),style:e.normalizeStyle(`cursor:${t.value.readonly?"default":"pointer"};height:${t.value.style.itemSize}px;aspect-ratio:1/1;position:relative`),onMouseenter:o[8]||(o[8]=a=>s.value=2),onMouseleave:o[9]||(o[9]=a=>s.value=void 0),onClick:o[10]||(o[10]=a=>v(3)),onKeyup:o[11]||(o[11]=e.withKeys(a=>v(3),["enter"]))},[t.value.style.tooltip.show&&m.value&&d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${s.value===2?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},"3",4),e.createTextVNode(" : "),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(c.dataset.rating[3]),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0),t.value.style.icons.filled?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(l.XMLNS),style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:u(2),fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",ve,[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(l.shiftHue)(t.value.style.colors.activeReadonly[2],.05)},null,8,ye),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.activeReadonly[2]},null,8,me)])]),fe,e.createElementVNode("path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-7.99 5.66l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm6 0l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z","stroke-width":"0",fill:u(2)},null,8,he)],8,pe)):(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(l.XMLNS),style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:u(2),fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},ze,8,ke)),t.value.style.icons.filled&&d.value?(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(l.XMLNS),style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:`0 0 ${p(2)} 24`,"stroke-width":"1.5",stroke:t.value.style.colors.activeReadonly[2],fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[be,e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",Ee,[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(l.shiftHue)(t.value.style.colors.activeReadonly[2],.05)},null,8,$e),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.activeReadonly[2]},null,8,Se)])]),e.createElementVNode("path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-7.99 5.66l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007zm6 0l-.127 .007a1 1 0 0 0 0 1.986l.117 .007l.127 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z","stroke-width":"0",fill:t.value.style.icons.useGradient?"url(#vueUiSmiley2)":t.value.style.colors.activeReadonly[2]},null,8,we)],8,Ve)):e.createCommentVNode("",!0),!t.value.style.icons.filled&&d.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(l.XMLNS),style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:`0 0 ${p(2)} 24`,"stroke-width":"1.5",stroke:t.value.style.colors.activeReadonly[2],fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Xe,8,Me)):e.createCommentVNode("",!0)],38),e.createElementVNode("div",{tabindex:"0",class:e.normalizeClass({"vue-ui-smiley-rated":!t.value.readonly&&r.value===4}),style:e.normalizeStyle(`cursor:${t.value.readonly?"default":"pointer"};height:${t.value.style.itemSize}px;aspect-ratio:1/1;position:relative`),onMouseenter:o[12]||(o[12]=a=>s.value=3),onMouseleave:o[13]||(o[13]=a=>s.value=void 0),onClick:o[14]||(o[14]=a=>v(4)),onKeyup:o[15]||(o[15]=e.withKeys(a=>v(4),["enter"]))},[t.value.style.tooltip.show&&m.value&&d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${s.value===3?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},"4",4),e.createTextVNode(" : "),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(c.dataset.rating[4]),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0),t.value.style.icons.filled?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(l.XMLNS),style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:u(3),fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",Ue,[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(l.shiftHue)(t.value.style.colors.activeReadonly[3],.95)},null,8,Ge),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.activeReadonly[3]},null,8,Le)])]),Ae,e.createElementVNode("path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.8 10.946a1 1 0 0 0 -1.414 .014a2.5 2.5 0 0 1 -3.572 0a1 1 0 0 0 -1.428 1.4a4.5 4.5 0 0 0 6.428 0a1 1 0 0 0 -.014 -1.414zm-6.19 -5.286l-.127 .007a1 1 0 0 0 .117 1.993l.127 -.007a1 1 0 0 0 -.117 -1.993zm6 0l-.127 .007a1 1 0 0 0 .117 1.993l.127 -.007a1 1 0 0 0 -.117 -1.993z","stroke-width":"0",fill:u(3)},null,8,De)],8,je)):(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(l.XMLNS),style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:u(3),fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Ke,8,Ye)),t.value.style.icons.filled&&d.value?(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(l.XMLNS),style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:`0 0 ${p(3)} 24`,"stroke-width":"1.5",stroke:t.value.style.colors.activeReadonly[3],fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[Te,e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",Oe,[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(l.shiftHue)(t.value.style.colors.activeReadonly[3],.95)},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.activeReadonly[3]},null,8,Pe)])]),e.createElementVNode("path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.8 10.946a1 1 0 0 0 -1.414 .014a2.5 2.5 0 0 1 -3.572 0a1 1 0 0 0 -1.428 1.4a4.5 4.5 0 0 0 6.428 0a1 1 0 0 0 -.014 -1.414zm-6.19 -5.286l-.127 .007a1 1 0 0 0 .117 1.993l.127 -.007a1 1 0 0 0 -.117 -1.993zm6 0l-.127 .007a1 1 0 0 0 .117 1.993l.127 -.007a1 1 0 0 0 -.117 -1.993z","stroke-width":"0",fill:t.value.style.icons.useGradient?"url(#vueUiSmiley3)":t.value.style.colors.activeReadonly[3]},null,8,Je)],8,Ie)):e.createCommentVNode("",!0),!t.value.style.icons.filled&&d.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(l.XMLNS),style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:`0 0 ${p(3)} 24`,"stroke-width":"1.5",stroke:t.value.style.colors.activeReadonly[3],fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},Ze,8,Qe)):e.createCommentVNode("",!0)],38),e.createElementVNode("div",{tabindex:"0",class:e.normalizeClass({"vue-ui-smiley-rated":!t.value.readonly&&r.value===5}),style:e.normalizeStyle(`cursor:${t.value.readonly?"default":"pointer"};height:${t.value.style.itemSize}px;aspect-ratio:1/1;position:relative`),onMouseenter:o[16]||(o[16]=a=>s.value=4),onMouseleave:o[17]||(o[17]=a=>s.value=void 0),onClick:o[18]||(o[18]=a=>v(5)),onKeyup:o[19]||(o[19]=e.withKeys(a=>v(5),["enter"]))},[t.value.style.tooltip.show&&m.value&&d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${s.value===4?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},"5",4),e.createTextVNode(" : "),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(c.dataset.rating[5]),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0),t.value.style.icons.filled?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(l.XMLNS),style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:u(4),fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",tt,[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(l.shiftHue)(t.value.style.colors.activeReadonly[4],.9)},null,8,ot),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.activeReadonly[4]},null,8,lt)])]),at,e.createElementVNode("path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-2 9.66h-6a1 1 0 0 0 -1 1v.05a3.975 3.975 0 0 0 3.777 3.97l.227 .005a4.026 4.026 0 0 0 3.99 -3.79l.006 -.206a1 1 0 0 0 -1 -1.029zm-5.99 -5l-.127 .007a1 1 0 0 0 .117 1.993l.127 -.007a1 1 0 0 0 -.117 -1.993zm6 0l-.127 .007a1 1 0 0 0 .117 1.993l.127 -.007a1 1 0 0 0 -.117 -1.993z","stroke-width":"0",fill:u(4)},null,8,nt)],8,et)):(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:e.unref(l.XMLNS),style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:u(4),fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},rt,8,st)),t.value.style.icons.filled&&d.value?(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(l.XMLNS),style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:`0 0 ${p(4)} 24`,"stroke-width":"1.5",stroke:t.value.style.colors.activeReadonly[4],fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[ut,e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",ct,[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(l.shiftHue)(t.value.style.colors.activeReadonly[4],.9)},null,8,pt),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.activeReadonly[4]},null,8,vt)])]),e.createElementVNode("path",{d:"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-2 9.66h-6a1 1 0 0 0 -1 1v.05a3.975 3.975 0 0 0 3.777 3.97l.227 .005a4.026 4.026 0 0 0 3.99 -3.79l.006 -.206a1 1 0 0 0 -1 -1.029zm-5.99 -5l-.127 .007a1 1 0 0 0 .117 1.993l.127 -.007a1 1 0 0 0 -.117 -1.993zm6 0l-.127 .007a1 1 0 0 0 .117 1.993l.127 -.007a1 1 0 0 0 -.117 -1.993z","stroke-width":"0",fill:t.value.style.icons.useGradient?"url(#vueUiSmiley4)":t.value.style.colors.activeReadonly[4]},null,8,yt)],8,dt)):e.createCommentVNode("",!0),!t.value.style.icons.filled&&d.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(l.XMLNS),style:{position:"absolute",top:"0",left:"0",transition:"all 0.1s ease-in-out"},height:"100%",viewBox:`0 0 ${p(4)} 24`,"stroke-width":"1.5",stroke:t.value.style.colors.activeReadonly[4],fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},ht,8,mt)):e.createCommentVNode("",!0)],38),t.value.style.rating.show&&t.value.style.rating.position==="right"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(r.value)?"":r.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0)],4),t.value.style.rating.show&&t.value.style.rating.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(`width:100%;text-align:center;margin-top:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(isNaN(r.value)?"":r.value.toFixed(t.value.style.rating.roundingValue)),5)):e.createCommentVNode("",!0)],36))}},gt=S._export_sfc(kt,[["__scopeId","data-v-3e41118a"]]);exports.default=gt;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { onMounted as F, ref as S, computed as R, openBlock as s, createElementBlock as a, normalizeStyle as l, createElementVNode as e, toDisplayString as k, createCommentVNode as r, normalizeClass as w, withKeys as z, createTextVNode as M, unref as n, pushScopeId as I, popScopeId as K, createStaticVNode as _ } from "vue";
|
|
2
|
-
import { u as E, o as O, e as D, X as c, s as m } from "./index-
|
|
3
|
-
import { u as L } from "./useNestedProp-
|
|
2
|
+
import { u as E, o as O, e as D, X as c, s as m } from "./index-BhCM2QF1.js";
|
|
3
|
+
import { u as L } from "./useNestedProp-CH3PVhvc.js";
|
|
4
4
|
import { _ as T } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const v = ($) => (I("data-v-3e41118a"), $ = $(), K(), $), P = {
|
|
6
6
|
key: 0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-Y23HeR26.cjs"),L=require("./useNestedProp-C2H2jmU6.cjs"),x=require("./BaseIcon-BK5xYOzV.cjs"),M=require("./vue-ui-skeleton-B5Z4craS.cjs"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),j=["id"],q=["xmlns","viewBox"],A=["id"],I=["stop-color"],P=["stop-color"],D={key:0},G=["d","fill"],O=["d","fill"],U=["d","stroke","stroke-width","stroke-linecap","stroke-linejoin"],W=["d","stroke","stroke-width","stroke-linecap","stroke-linejoin"],Z=["height","width","x"],H={style:{width:"100%"}},R=["x","y","fill","font-size","font-weight"],X=["stroke","cx","cy","fill"],J=["x","y","font-size","fill","font-weight"],K={__name:"vue-ui-spark-trend",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(N){const r=N,{vue_ui_spark_trend:$}=u.useConfig(),E=e.computed(()=>!!r.dataset&&r.dataset.length),y=e.ref(u.createUid()),t=e.computed(()=>{const l=L.useNestedProp({userConfig:r.config,defaultConfig:$});return l.theme?{...L.useNestedProp({userConfig:u.themes.vue_ui_spark_trend[l.theme]||r.config,defaultConfig:l})}:l});function k(l){return l.map(n=>[void 0].includes(n)?null:n)}const h=e.ref(r.dataset.map(l=>t.value.style.animation.show||[void 0].includes(l)?null:l)),v=e.ref(!1),g=e.ref(null);e.onMounted(()=>{u.objectIsEmpty(r.dataset)&&u.error({componentName:"VueUiTrendPill",type:"dataset"});let n=1e3/t.value.style.animation.animationFrames,i=performance.now();if(t.value.style.animation.show&&t.value.style.animation.animationFrames&&r.dataset.length>1){let b=function(){v.value=!0;let w=performance.now(),B=w-i;B>n?(i=w-B%n,c<r.dataset.length?(h.value.push(r.dataset[c]),c+=1,g.value=requestAnimationFrame(b)):(cancelAnimationFrame(g.value),h.value=k(r.dataset),v.value=!1)):g.value=requestAnimationFrame(b)};h.value=[];let c=0;b()}});const o=e.ref({height:80,width:300}),d=e.computed(()=>({top:t.value.style.padding.top,left:t.value.style.padding.left,right:o.value.width-t.value.style.padding.right,bottom:o.value.height-t.value.style.padding.bottom,height:o.value.height-(t.value.style.padding.top+t.value.style.padding.bottom)-(t.value.style.dataLabel.show?t.value.style.dataLabel.fontSize:0),width:o.value.width-(t.value.style.padding.left+t.value.style.padding.right)})),_=e.computed(()=>{const l=k(r.dataset);return{max:Math.max(...l),min:Math.min(...l)}}),p=e.computed(()=>{const l=_.value.min>=0?0:_.value.min;return Math.abs(l)}),V=e.computed(()=>_.value.max+p.value);function C(l){return l/V.value}const T=e.computed(()=>r.dataset.length),a=e.computed(()=>h.value.map((l,n)=>{const i=isNaN(l)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l)?0:l||0;return{value:l,absoluteValue:i,plotValue:i+p.value,toMax:C(i+p.value),x:d.value.left+n*(d.value.width/(T.value-1))-t.value.style.padding.right,y:d.value.bottom-d.value.height*C(i+p.value)}})),m=e.computed(()=>{const l=k(r.dataset);return t.value.style.trendLabel.trendType==="global"?u.calcTrend(l):t.value.style.trendLabel.trendType==="n-1"&&l.length>1?(l.at(-1)/l.at(-2)-1)*100:t.value.style.trendLabel.trendType==="lastToFirst"?(l.at(-1)/l[0]-1)*100:0}),f=e.computed(()=>v.value||m.value===0?"neutral":m.value>0?"positive":"negative"),s=e.computed(()=>t.value.style.arrow.colors[f.value]),z=e.computed(()=>{const l={x:a.value[0].x,y:o.value.height-6},n={x:a.value[a.value.length-1].x,y:o.value.height-6},i=[];return a.value.forEach(c=>{i.push(`${c.x},${c.y} `)}),[l.x,l.y,...i,n.x,n.y].toString()}),S=e.computed(()=>{let l=[];return a.value.forEach(n=>{l.push(`${n.x},${n.y} `)}),`M ${l.toString()}`});return(l,n)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-spark-trend",id:y.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily};backgroundColor:${t.value.style.backgroundColor}`)},[E.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${o.value.width} ${o.value.height}`,style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};overflow:visible`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"0%",y2:"100%",id:`pill_gradient_${y.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":(t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke)+e.unref(u.opacity)[t.value.style.area.opacity]},null,8,I),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.backgroundColor},null,8,P)],8,A)]),t.value.style.area.show&&a.value[0]?(e.openBlock(),e.createElementBlock("g",D,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${a.value[0].x},${d.value.bottom} ${e.unref(u.createSmoothPath)(a.value)} L ${a.value.at(-1).x},${d.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#pill_gradient_${y.value})`:`${t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke}${e.unref(u.opacity)[t.value.style.area.opacity]}`,stroke:"none"},null,8,G)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${z.value}Z`,fill:t.value.style.area.useGradient?`url(#pill_gradient_${y.value})`:`${t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke}${e.unref(u.opacity)[t.value.style.area.opacity]}`,stroke:"none"},null,8,O))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&a.value.length?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(u.createSmoothPath)(a.value)}`,stroke:t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":t.value.style.line.strokeLinecap,"stroke-linejoin":t.value.style.line.strokeLinejoin},null,8,U)):e.createCommentVNode("",!0),!t.value.style.line.smooth&&a.value.length?(e.openBlock(),e.createElementBlock("path",{key:2,d:S.value,stroke:t.value.style.line.useColorTrend?s.value:t.value.style.line.stroke,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":t.value.style.line.strokeLinecap,"stroke-linejoin":t.value.style.line.strokeLinejoin},null,8,W)):e.createCommentVNode("",!0),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("foreignObject",{key:3,height:o.value.height/2,width:o.value.height/2,x:o.value.height/5,y:8},[e.createElementVNode("div",H,[f.value==="positive"?(e.openBlock(),e.createBlock(x.default,{key:0,stroke:s.value,name:"arrowTop",size:o.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0),f.value==="negative"?(e.openBlock(),e.createBlock(x.default,{key:1,stroke:s.value,name:"arrowBottom",size:o.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0),f.value==="neutral"?(e.openBlock(),e.createBlock(x.default,{key:2,stroke:s.value,name:"arrowRight",size:o.value.height/2},null,8,["stroke","size"])):e.createCommentVNode("",!0)])],8,Z)),v.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("text",{key:4,x:o.value.height/2-o.value.height/20,y:d.value.bottom,"text-anchor":"middle",fill:t.value.style.trendLabel.useColorTrend?s.value:t.value.style.trendLabel.color,"font-size":t.value.style.trendLabel.fontSize,"font-weight":t.value.style.trendLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(u.dataLabel)({p:m.value>0?"+":"",v:m.value,s:"%",r:t.value.style.trendLabel.rounding})),9,R)),a.value.length&&a.value.at(-1).x!==void 0?(e.openBlock(),e.createElementBlock("circle",{key:5,stroke:t.value.style.backgroundColor,"stroke-width":2,cx:a.value.at(-1).x,cy:a.value.at(-1).y,r:4,fill:s.value},null,8,X)):e.createCommentVNode("",!0),a.value.length&&a.value.at(-1).x!==void 0&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:6,"text-anchor":"middle",x:a.value.at(-1).x,y:a.value.at(-1).y-t.value.style.dataLabel.fontSize/1.5,"font-size":t.value.style.dataLabel.fontSize,fill:t.value.style.dataLabel.useColorTrend?s.value:t.value.style.dataLabel.color,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:a.value.at(-1).value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding})),9,J)):e.createCommentVNode("",!0)],12,q)):(e.openBlock(),e.createBlock(M.default,{key:0,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,j))}},Q=F._export_sfc(K,[["__scopeId","data-v-456001fa"]]);exports.default=Q;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { computed as u, ref as p, onMounted as W, openBlock as n, createElementBlock as i, normalizeStyle as j, createBlock as w, unref as c, createElementVNode as g, createCommentVNode as v, toDisplayString as A } from "vue";
|
|
2
|
-
import { u as X, c as Z, t as R, o as H, e as J, P as K, X as Q, r as z, L as I, f as B } from "./index-
|
|
3
|
-
import { u as E } from "./useNestedProp-
|
|
4
|
-
import N from "./BaseIcon-
|
|
5
|
-
import Y from "./vue-ui-skeleton-
|
|
2
|
+
import { u as X, c as Z, t as R, o as H, e as J, P as K, X as Q, r as z, L as I, f as B } from "./index-BhCM2QF1.js";
|
|
3
|
+
import { u as E } from "./useNestedProp-CH3PVhvc.js";
|
|
4
|
+
import N from "./BaseIcon-Op8_v5x7.js";
|
|
5
|
+
import Y from "./vue-ui-skeleton-_VMQ594N.js";
|
|
6
6
|
import { _ as ee } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
const te = ["id"], le = ["xmlns", "viewBox"], ae = ["id"], ne = ["stop-color"], oe = ["stop-color"], se = { key: 0 }, ue = ["d", "fill"], re = ["d", "fill"], ie = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"], de = ["d", "stroke", "stroke-width", "stroke-linecap", "stroke-linejoin"], ve = ["height", "width", "x"], ce = { style: { width: "100%" } }, he = ["x", "y", "fill", "font-size", "font-weight"], ye = ["stroke", "cx", "cy", "fill"], fe = ["x", "y", "font-size", "fill", "font-weight"], pe = {
|
|
8
8
|
__name: "vue-ui-spark-trend",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed as f, ref as h, onMounted as j, watch as G, nextTick as W, openBlock as i, createElementBlock as n, normalizeStyle as y, unref as r, renderSlot as D, normalizeProps as P, mergeProps as q, createCommentVNode as c, createElementVNode as v, toDisplayString as p, Fragment as z, renderList as H, guardReactiveProps as X, createBlock as R } from "vue";
|
|
2
|
-
import { u as J, c as K, t as Q, a as Y, p as x, b as Z, o as ee, e as T, g as te, d as le, r as C, f as k, X as ae, s as se } from "./index-
|
|
3
|
-
import { u as L } from "./useNestedProp-
|
|
4
|
-
import oe from "./vue-ui-skeleton-
|
|
2
|
+
import { u as J, c as K, t as Q, a as Y, p as x, b as Z, o as ee, e as T, g as te, d as le, r as C, f as k, X as ae, s as se } from "./index-BhCM2QF1.js";
|
|
3
|
+
import { u as L } from "./useNestedProp-CH3PVhvc.js";
|
|
4
|
+
import oe from "./vue-ui-skeleton-_VMQ594N.js";
|
|
5
5
|
const ue = ["onClick"], ie = { key: 1 }, ne = ["xmlns", "viewBox"], re = ["id"], ve = ["stop-color"], ce = ["stop-color"], de = ["height", "width", "fill", "rx"], ye = ["height", "width", "fill", "rx"], pe = ["height", "width", "fill", "rx"], xe = {
|
|
6
6
|
__name: "vue-ui-sparkbar",
|
|
7
7
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-Y23HeR26.cjs"),x=require("./useNestedProp-C2H2jmU6.cjs"),E=require("./vue-ui-skeleton-B5Z4craS.cjs"),V=["onClick"],$={key:1},z=["xmlns","viewBox"],D=["id"],P=["stop-color"],A=["stop-color"],F=["height","width","fill","rx"],L=["height","width","fill","rx"],T=["height","width","fill","rx"],O={__name:"vue-ui-sparkbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},backgroundOpacity:{type:Number,default:100}},emits:["selectDatapoint"],setup(v,{emit:b}){const n=v,{vue_ui_sparkbar:C}=o.useConfig(),p=e.computed(()=>!!n.dataset&&n.dataset.length),y=e.ref(o.createUid()),t=e.computed(()=>{const l=x.useNestedProp({userConfig:n.config,defaultConfig:C});return l.theme?{...x.useNestedProp({userConfig:o.themes.vue_ui_sparkbar[l.theme]||n.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}),S=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),c=e.ref(n.dataset.map(l=>({...l,value:t.value.style.animation.show?0:l.value||0}))),f=e.ref(null);e.onMounted(async()=>{o.objectIsEmpty(n.dataset)&&o.error({componentName:"VueUiSparkbar",type:"dataset"}),g()});function g(){if(t.value.style.animation.show){let k=function(){s+=a/l,s<a?(c.value=c.value.map((u,d)=>({...u,value:u.value+=r[d]})),f.value=requestAnimationFrame(k)):c.value=n.dataset.map(u=>({...u,value:u.value||0}))};const l=t.value.style.animation.animationFrames,r=n.dataset.map((u,d)=>u.value/l),a=n.dataset.map(u=>u.value||0).reduce((u,d)=>u+d,0);let s=0;k()}}e.watch(()=>n.dataset,async l=>{cancelAnimationFrame(f.value),c.value=n.dataset.map(r=>({...r,value:t.value.style.animation.show?0:r.value||0})),e.nextTick(g)},{deep:!0});const i=e.ref({width:500,height:16}),w=e.computed(()=>Math.max(...n.dataset.map(l=>l.value))),N=e.computed(()=>(n.dataset.forEach((l,r)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkbar",type:"datasetSerieAttribute",property:a,index:r})})}),c.value.map((l,r)=>({...l,value:l.value||0,color:o.convertColorToHex(l.color)||S.value[r]||o.palette[r]||o.palette[r%o.palette.length]}))));function _(l){return l/w.value}function h(l){return t.value.style.layout.independant?l.target?l.value/l.target:t.value.style.layout.percentage?l.value>100?1:l.value/100:t.value.style.layout.target===0?1:l.value/t.value.style.layout.target:_(l.value)}function m(l){return t.value.style.layout.independant&&l.target||t.value.style.layout.target}function B(l,r){b("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({width:"100%",fontFamily:t.value.style.fontFamily,background:t.value.style.backgroundColor+e.unref(o.opacity)[n.backgroundOpacity]})},[l.$slots.title?e.renderSlot(l.$slots,"title",e.normalizeProps(e.mergeProps({key:0},{title:{...l.title,title:t.value.style.title.text,subtitle:t.value.style.title.subtitle.text}}))):e.createCommentVNode("",!0),!l.$slots.title&&t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:1,class:"vue-ui-sparkbar-title-container",style:e.normalizeStyle({background:t.value.style.title.backgroundColor,margin:t.value.style.title.margin,textAlign:t.value.style.title.textAlign})},[e.createElementVNode("div",{class:"vue-ui-sparkbar-title",style:e.normalizeStyle({fontSize:t.value.style.title.fontSize+"px",color:t.value.style.title.color,fontWeight:t.value.style.title.bold?"bold":"normal"})},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-sparkbar-subtitle",style:e.normalizeStyle({fontSize:t.value.style.title.subtitle.fontSize+"px",color:t.value.style.title.subtitle.color,fontWeight:t.value.style.title.subtitle.bold?"bold":"normal"})},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(a,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`display:flex !important;${["left","right"].includes(t.value.style.labels.name.position)?`flex-direction: ${t.value.style.labels.name.position==="right"?"row-reverse":"row"} !important`:"flex-direction:column !important"};gap:${t.value.style.gap}px !important;align-items:center;${v.dataset.length>0&&s!==v.dataset.length-1?"margin-bottom:6px":""}`),onClick:()=>B(a,s)},[e.renderSlot(l.$slots,"data-label",e.normalizeProps(e.guardReactiveProps({bar:{...a,target:m(a),valueLabel:e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0}),targetLabel:e.unref(o.dataLabel)({p:a.prefix||"",v:m(a),s:a.suffix||"",r:a.rounding||0})}}))),l.$slots["data-label"]?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({width:t.value.style.labels.name.width,color:t.value.style.labels.name.color,fontSize:t.value.style.labels.fontSize+"px",fontWeight:t.value.style.labels.name.bold?"bold":"normal",textAlign:["left","right"].includes(t.value.style.labels.name.position)||["top","top-left"].includes(t.value.style.labels.name.position)?"left":t.value.style.labels.name.position==="top-center"?"center":"right"})},[e.createElementVNode("span",null,e.toDisplayString(a.name),1),t.value.style.labels.value.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.labels.value.bold?"bold":"normal"}`)},": "+e.toDisplayString(e.unref(o.dataLabel)({p:a.prefix||"",v:a.value,s:a.suffix||"",r:a.rounding||0})),5)):e.createCommentVNode("",!0),t.value.style.layout.showTargetValue?(e.openBlock(),e.createElementBlock("span",$,e.toDisplayString(" "+t.value.style.layout.targetValueText)+" "+e.toDisplayString(e.unref(o.dataLabel)({p:a.prefix||"",v:m(a),s:a.suffix||"",r:a.rounding||0})),1)):e.createCommentVNode("",!0)],4)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(o.XMLNS),viewBox:`0 0 ${i.value.width} ${i.value.height}`,width:"100%"},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkbar_gradient_${s}_${y.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(o.shiftHue)(a.color,.03)}${e.unref(o.opacity)[100-t.value.style.bar.gradient.intensity]}`},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,A)],8,D)]),e.createElementVNode("rect",{height:i.value.height,width:i.value.width,x:0,y:0,fill:`${t.value.style.gutter.backgroundColor}${e.unref(o.opacity)[t.value.style.gutter.opacity]}`,rx:i.value.height/2},null,8,F),e.createElementVNode("rect",{height:i.value.height,width:i.value.width*h(a),x:0,y:0,fill:t.value.style.bar.gradient.underlayerColor,rx:i.value.height/2},null,8,L),e.createElementVNode("rect",{height:i.value.height,width:i.value.width*h(a),x:0,y:0,fill:t.value.style.bar.gradient.show?`url(#sparkbar_gradient_${s}_${y.value})`:a.color,rx:i.value.height/2},null,8,T)],8,z))],12,V)):e.createCommentVNode("",!0)],64))),256)),p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E.default,{key:2,config:{type:"sparkbar",style:{backgroundColor:t.value.style.backgroundColor,sparkbar:{color:"#CCCCCC"}}}},null,8,["config"]))],4))}};exports.default=O;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-Y23HeR26.cjs"),p=require("./useNestedProp-C2H2jmU6.cjs"),C=require("./vue-ui-skeleton-B5Z4craS.cjs"),$=["xmlns","viewBox"],w=["id"],N=["stop-color"],S=["stop-color"],L=["d","stroke","stroke-linecap"],B=["d","stroke","stroke-linecap","stroke-dashoffset"],E=["x","y","font-size","fill","font-weight"],z={__name:"vue-ui-sparkgauge",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(g){const a=g,{vue_ui_sparkgauge:k}=u.useConfig(),c=e.computed(()=>!!a.dataset&&Object.keys(a.dataset).length);e.onMounted(()=>{u.objectIsEmpty(a.dataset)?u.error({componentName:"VueUiSparkgauge",type:"dataset"}):u.getMissingDatasetAttributes({datasetObject:a.dataset,requiredAttributes:["value","min","max"]}).forEach(o=>{u.error({componentName:"VueUiSparkgauge",type:"datasetAttribute",property:o})})});const d=e.ref(u.createUid()),t=e.computed(()=>{const o=p.useNestedProp({userConfig:a.config,defaultConfig:k});return o.theme?{...p.useNestedProp({userConfig:u.themes.vue_ui_sparkgauge[o.theme]||a.config,defaultConfig:o})}:o}),n=e.computed(()=>({height:t.value.style.height,width:128,base:t.value.style.basePosition})),l=e.computed(()=>{const o=a.dataset.min??0,i=a.dataset.max??0,_=i-o;return{min:o,max:i,diff:_}}),s=e.ref(t.value.style.animation.show?l.value.min:a.dataset.value);e.watch(()=>a.dataset.value,()=>{s.value=e.ref(t.value.style.animation.show?l.value.min:a.dataset.value),m()});const v=e.computed(()=>s.value>l.value.max?l.value.max:s.value<l.value.min?l.value.min:s.value),b=e.computed(()=>l.value.diff/t.value.style.animation.speedMs);e.onMounted(()=>{m()});function m(){function o(){s.value+=b.value,s.value<a.dataset.value?requestAnimationFrame(o):s.value=a.dataset.value}t.value.style.animation.show&&(s.value=l.value.min,o())}const r=e.computed(()=>a.dataset.title??""),y=e.computed(()=>s.value>=0?(v.value-l.value.min)/l.value.diff:(Math.abs(l.value.min)-Math.abs(v.value))/l.value.diff),f=e.computed(()=>u.interpolateColorHex(t.value.style.colors.min,t.value.style.colors.max,l.value.min,l.value.max,s.value)),h=e.computed(()=>t.value.style.dataLabel.autoColor?f.value:t.value.style.dataLabel.color),x=e.computed(()=>t.value.style.track.autoColor?f.value:t.value.style.track.color);return(o,i)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width: 100%; background:${t.value.style.background}`)},[t.value.style.title.show&&r.value&&t.value.style.title.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-data-ui-sparkgauge-label",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;text-align:${t.value.style.title.textAlign};font-weight:${t.value.style.title.bold?"bold":"normal"};color:${t.value.style.title.color}`)},e.toDisplayString(r.value),5)):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(u.XMLNS),viewBox:`0 0 ${n.value.width} ${n.value.height}`,style:e.normalizeStyle(`overflow: visible; background:${t.value.style.background}; width:100%;`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`gradient_${d.value}`,x1:"-10%",y1:"100%",x2:"110%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.colors.min},null,8,N),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.colors.max},null,8,S)],8,w)]),e.createElementVNode("path",{d:`M10 ${n.value.base} A 1 1 0 1 1 118 ${n.value.base}`,stroke:t.value.style.gutter.color,"stroke-width":8,"stroke-linecap":t.value.style.gutter.strokeLinecap,fill:"none"},null,8,L),y.value!==0?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M10 ${n.value.base} A 1 1 0 1 1 118 ${n.value.base}`,stroke:t.value.style.colors.showGradient?`url(#gradient_${d.value})`:x.value,"stroke-width":8,"stroke-linecap":t.value.style.track.strokeLinecap,fill:"none","stroke-dasharray":169.5,"stroke-dashoffset":169.5-169.5*y.value,class:e.normalizeClass({"vue-ui-sparkgauge-track":t.value.style.animation.show}),style:e.normalizeStyle(t.value.style.animation.show?`animation: vue-ui-sparkgauge-animation ${t.value.style.animation.speedMs}ms ease-in;`:"")},null,14,B)):e.createCommentVNode("",!0),e.createElementVNode("text",{"text-anchor":"middle",x:n.value.width/2,y:n.value.base+6+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,fill:h.value,"font-weight":t.value.style.dataLabel.bold?"bold":"normal"},e.toDisplayString(e.unref(u.dataLabel)({p:t.value.style.dataLabel.prefix,v:s.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.rounding})),9,E)],12,$)):e.createCommentVNode("",!0),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(C.default,{key:2,config:{type:"gauge",style:{backgroundColor:t.value.style.background,gauge:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.title.show&&r.value&&t.value.style.title.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:3,class:"vue-data-ui-sparkgauge-label",style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;text-align:${t.value.style.title.textAlign};font-weight:${t.value.style.title.bold?"bold":"normal"};font-weight:${t.value.style.title.bold?"bold":"normal"};color:${t.value.style.title.color}`)},e.toDisplayString(r.value),5)):e.createCommentVNode("",!0)],4))}};exports.default=z;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed as s, onMounted as _, ref as m, watch as F, openBlock as n, createElementBlock as r, normalizeStyle as v, toDisplayString as y, createCommentVNode as c, unref as $, createElementVNode as i, normalizeClass as O, createBlock as j } from "vue";
|
|
2
|
-
import { u as B, o as E, e as w, g as D, c as G, t as I, H as U, X as V, f as q } from "./index-
|
|
3
|
-
import { u as C } from "./useNestedProp-
|
|
4
|
-
import H from "./vue-ui-skeleton-
|
|
2
|
+
import { u as B, o as E, e as w, g as D, c as G, t as I, H as U, X as V, f as q } from "./index-BhCM2QF1.js";
|
|
3
|
+
import { u as C } from "./useNestedProp-CH3PVhvc.js";
|
|
4
|
+
import H from "./vue-ui-skeleton-_VMQ594N.js";
|
|
5
5
|
const P = ["xmlns", "viewBox"], T = ["id"], X = ["stop-color"], R = ["stop-color"], Y = ["d", "stroke", "stroke-linecap"], J = ["d", "stroke", "stroke-linecap", "stroke-dashoffset"], K = ["x", "y", "font-size", "fill", "font-weight"], te = {
|
|
6
6
|
__name: "vue-ui-sparkgauge",
|
|
7
7
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BQOxn6SH.cjs"),k=require("./useNestedProp-BtqgWTf9.cjs"),z=require("./Shape-D8RdmYWq.cjs"),D=require("./vue-ui-skeleton-CcrGR_Vh.cjs"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0},A={key:1},H=["xmlns","viewBox"],q=["id"],I=["stop-color"],U=["stop-color"],W=["id"],O=["stop-color"],j=["stop-color"],P=["id"],T=["stop-color"],G=["stop-color"],X={key:0},Y=["x","y","height","width","fill","stroke","stroke-width","rx"],R={key:1},J=["x","y","font-size","font-weight","fill"],K=["x","y","font-size","fill"],Q=["x","y","font-size","fill"],Z=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],ee={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(b,{emit:_}){const u=b;e.useCssVars(o=>({"17d37044":S.value}));const{vue_ui_sparkhistogram:x}=n.useConfig(),f=e.computed(()=>!!u.dataset&&u.dataset.length);e.onMounted(()=>{n.objectIsEmpty(u.dataset)?n.error({componentName:"VueUiSparkHistogram",type:"dataset"}):u.dataset.forEach((o,s)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["value"]}).forEach(l=>{n.error({componentName:"VueUiSparkHistogram",type:"datasetSerieAttribute",property:l,index:s})})})});const v=e.ref(n.createUid()),t=e.computed(()=>{const o=k.useNestedProp({userConfig:u.config,defaultConfig:x});return o.theme?{...k.useNestedProp({userConfig:n.themes.vue_ui_sparkhistogram[o.theme]||u.config,defaultConfig:o})}:o}),c=e.computed(()=>{const o=t.value.style.layout.height,s=t.value.style.layout.width,l=t.value.style.layout.padding.top,a=o-t.value.style.layout.padding.bottom,d=t.value.style.layout.padding.left,y=s-t.value.style.layout.padding.right,p=l+(o-l-t.value.style.layout.padding.bottom)/2,g=o-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,m=s-t.value.style.layout.padding.left-t.value.style.layout.padding.right;return{bottom:a,centerY:p,drawingHeight:g,drawingWidth:m,height:o,left:d,right:y,top:l,width:s}}),B=e.computed(()=>Math.max(...u.dataset.map(o=>Math.abs(o.value||0))));function $(o){return Math.abs(o)/B.value}const r=e.computed(()=>u.dataset.map((o,s)=>{const l=$(o.value||0),a=c.value.drawingHeight*l,d=c.value.drawingWidth/u.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,g=c.value.centerY-a/2,m=c.value.left+(y/2+s*d),N=c.value.left+s*d,h=typeof o.intensity>"u"?100:Math.round(o.intensity*100),w=o.color?o.color:o.value>=0?`${t.value.style.bars.colors.positive}${n.opacity[h]}`:`${t.value.style.bars.colors.negative}${n.opacity[h]}`,C=o.color?o.color:o.value>=0?t.value.style.bars.colors.positive:t.value.style.bars.colors.negative,L=o.color?`url(#gradient_datapoint_${s}_${v.value})`:o.value>=0?`url(#gradient_positive_${s}_${v.value})`:`url(#gradient_negative_${s}_${v.value})`,V=m+p/2;return{...o,color:w,gradient:L,height:a,intensity:h,proportion:l,stroke:C,textAnchor:V,trapX:N,unitWidth:d,width:p,x:m,y:g}})),i=e.ref(null);function E(o,s){_("selectDatapoint",{datapoint:o,index:s})}const S=e.computed(()=>`${t.value.style.animation.speedMs}ms`);return(o,s)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily}`),onMouseleave:s[1]||(s[1]=l=>i.value=null)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:${t.value.style.backgroundColor};margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},[e.createTextVNode(e.toDisplayString(t.value.style.title.text)+" ",1),i.value!==null?(e.openBlock(),e.createElementBlock("span",M,"- "+e.toDisplayString(r.value[i.value].timeLabel||"")+" "+e.toDisplayString(t.value.style.labels.value.prefix)+e.toDisplayString(isNaN(r.value[i.value].value)?"":": "+Number(r.value[i.value].value.toFixed(t.value.style.labels.value.rounding)).toLocaleString())+e.toDisplayString(t.value.style.labels.value.suffix),1)):e.createCommentVNode("",!0),e.createTextVNode(),![void 0,null].includes(i.value)&&![null,void 0].includes(r.value[i.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",A,"("+e.toDisplayString(r.value[i.value].valueLabel||0)+")",1)):e.createCommentVNode("",!0)],4),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${c.value.width} ${c.value.height}`,style:{overflow:"visible"}},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_positive_${a}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bars.colors.positive,.05)}${e.unref(n.opacity)[l.intensity]}`},null,8,I),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.bars.colors.positive}${e.unref(n.opacity)[l.intensity]}`},null,8,U)],8,q))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_negative_${a}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bars.colors.negative,.05)}${e.unref(n.opacity)[l.intensity]}`},null,8,O),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.bars.colors.negative}${e.unref(n.opacity)[l.intensity]}`},null,8,j)],8,W))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_datapoint_${a}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(l.color,.05)}${e.unref(n.opacity)[l.intensity]}`},null,8,T),e.createElementVNode("stop",{offset:"100%","stop-color":`${l.color}${e.unref(n.opacity)[l.intensity]}`},null,8,G)],8,P))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("rect",{x:l.x,y:l.y,height:l.height,width:l.width,fill:t.value.style.bars.colors.gradient.show?l.gradient:l.color,stroke:l.stroke,"stroke-width":t.value.style.bars.strokeWidth,rx:`${t.value.style.bars.borderRadius*l.proportion/12}%`,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,10,Y))),256))])):(e.openBlock(),e.createElementBlock("g",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createBlock(z._sfc_main,{plot:{x:l.x+l.width/2,y:l.y+l.height/2},color:t.value.style.bars.colors.gradient.show?l.gradient:l.color,shape:t.value.style.bars.shape,radius:l.height*.4,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,8,["plot","color","shape","radius","class"]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"middle",x:l.textAnchor,y:l.y-t.value.style.labels.value.fontSize/3+t.value.style.labels.value.offsetY,"font-size":t.value.style.labels.value.fontSize,"font-weight":t.value.style.labels.value.bold?"bold":"normal",fill:t.value.style.labels.value.color},e.toDisplayString(t.value.style.labels.value.prefix)+e.toDisplayString(isNaN(l.value)?"":Number(l.value.toFixed(t.value.style.labels.value.rounding)).toLocaleString())+e.toDisplayString(t.value.style.labels.value.suffix),9,J))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[l.valueLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:l.y+l.height+t.value.style.labels.valueLabel.fontSize,"font-size":t.value.style.labels.valueLabel.fontSize,"text-anchor":"middle",fill:t.value.style.labels.valueLabel.color},e.toDisplayString(l.valueLabel),9,K)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[l.timeLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:c.value.height-t.value.style.labels.timeLabel.fontSize/2,"font-size":t.value.style.labels.timeLabel.fontSize,fill:t.value.style.labels.timeLabel.color,"text-anchor":"middle"},e.toDisplayString(l.timeLabel),9,Q)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{height:c.value.height,width:l.unitWidth,fill:"transparent",x:l.trapX,y:0,onMouseover:d=>i.value=a,onMouseleave:s[0]||(s[0]=d=>i.value=null),stroke:i.value!==null&&i.value===a?t.value.style.selector.stroke:"","stroke-width":i.value!==null&&i.value===a?t.value.style.selector.strokeWidth:0,rx:t.value.style.selector.borderRadius,"stroke-dasharray":t.value.style.selector.strokeDasharray,onClick:()=>E(l,a)},null,40,Z)]))),256))],8,H)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(D.default,{key:2,config:{type:"sparkHistogram",style:{backgroundColor:t.value.style.backgroundColor,sparkHistogram:{color:"#CCCCCC"}}}},null,8,["config"]))],36))}},te=F._export_sfc(ee,[["__scopeId","data-v-12e37596"]]);exports.default=te;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-Y23HeR26.cjs"),k=require("./useNestedProp-C2H2jmU6.cjs"),z=require("./Shape-CcWWIf-s.cjs"),D=require("./vue-ui-skeleton-B5Z4craS.cjs"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0},A={key:1},H=["xmlns","viewBox"],q=["id"],I=["stop-color"],U=["stop-color"],W=["id"],O=["stop-color"],j=["stop-color"],P=["id"],T=["stop-color"],G=["stop-color"],X={key:0},Y=["x","y","height","width","fill","stroke","stroke-width","rx"],R={key:1},J=["x","y","font-size","font-weight","fill"],K=["x","y","font-size","fill"],Q=["x","y","font-size","fill"],Z=["height","width","x","onMouseover","stroke","stroke-width","rx","stroke-dasharray","onClick"],ee={__name:"vue-ui-sparkhistogram",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(b,{emit:_}){const u=b;e.useCssVars(o=>({"17d37044":S.value}));const{vue_ui_sparkhistogram:x}=n.useConfig(),f=e.computed(()=>!!u.dataset&&u.dataset.length);e.onMounted(()=>{n.objectIsEmpty(u.dataset)?n.error({componentName:"VueUiSparkHistogram",type:"dataset"}):u.dataset.forEach((o,s)=>{n.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["value"]}).forEach(l=>{n.error({componentName:"VueUiSparkHistogram",type:"datasetSerieAttribute",property:l,index:s})})})});const v=e.ref(n.createUid()),t=e.computed(()=>{const o=k.useNestedProp({userConfig:u.config,defaultConfig:x});return o.theme?{...k.useNestedProp({userConfig:n.themes.vue_ui_sparkhistogram[o.theme]||u.config,defaultConfig:o})}:o}),c=e.computed(()=>{const o=t.value.style.layout.height,s=t.value.style.layout.width,l=t.value.style.layout.padding.top,a=o-t.value.style.layout.padding.bottom,d=t.value.style.layout.padding.left,y=s-t.value.style.layout.padding.right,p=l+(o-l-t.value.style.layout.padding.bottom)/2,g=o-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,m=s-t.value.style.layout.padding.left-t.value.style.layout.padding.right;return{bottom:a,centerY:p,drawingHeight:g,drawingWidth:m,height:o,left:d,right:y,top:l,width:s}}),B=e.computed(()=>Math.max(...u.dataset.map(o=>Math.abs(o.value||0))));function $(o){return Math.abs(o)/B.value}const r=e.computed(()=>u.dataset.map((o,s)=>{const l=$(o.value||0),a=c.value.drawingHeight*l,d=c.value.drawingWidth/u.dataset.length,y=d*(t.value.style.bars.gap/100),p=d-y,g=c.value.centerY-a/2,m=c.value.left+(y/2+s*d),N=c.value.left+s*d,h=typeof o.intensity>"u"?100:Math.round(o.intensity*100),w=o.color?o.color:o.value>=0?`${t.value.style.bars.colors.positive}${n.opacity[h]}`:`${t.value.style.bars.colors.negative}${n.opacity[h]}`,C=o.color?o.color:o.value>=0?t.value.style.bars.colors.positive:t.value.style.bars.colors.negative,L=o.color?`url(#gradient_datapoint_${s}_${v.value})`:o.value>=0?`url(#gradient_positive_${s}_${v.value})`:`url(#gradient_negative_${s}_${v.value})`,V=m+p/2;return{...o,color:w,gradient:L,height:a,intensity:h,proportion:l,stroke:C,textAnchor:V,trapX:N,unitWidth:d,width:p,x:m,y:g}})),i=e.ref(null);function E(o,s){_("selectDatapoint",{datapoint:o,index:s})}const S=e.computed(()=>`${t.value.style.animation.speedMs}ms`);return(o,s)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%;background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily}`),onMouseleave:s[1]||(s[1]=l=>i.value=null)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:${t.value.style.backgroundColor};margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},[e.createTextVNode(e.toDisplayString(t.value.style.title.text)+" ",1),i.value!==null?(e.openBlock(),e.createElementBlock("span",M,"- "+e.toDisplayString(r.value[i.value].timeLabel||"")+" "+e.toDisplayString(t.value.style.labels.value.prefix)+e.toDisplayString(isNaN(r.value[i.value].value)?"":": "+Number(r.value[i.value].value.toFixed(t.value.style.labels.value.rounding)).toLocaleString())+e.toDisplayString(t.value.style.labels.value.suffix),1)):e.createCommentVNode("",!0),e.createTextVNode(),![void 0,null].includes(i.value)&&![null,void 0].includes(r.value[i.value].valueLabel)?(e.openBlock(),e.createElementBlock("span",A,"("+e.toDisplayString(r.value[i.value].valueLabel||0)+")",1)):e.createCommentVNode("",!0)],4),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${c.value.width} ${c.value.height}`,style:{overflow:"visible"}},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_positive_${a}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bars.colors.positive,.05)}${e.unref(n.opacity)[l.intensity]}`},null,8,I),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.bars.colors.positive}${e.unref(n.opacity)[l.intensity]}`},null,8,U)],8,q))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_negative_${a}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bars.colors.negative,.05)}${e.unref(n.opacity)[l.intensity]}`},null,8,O),e.createElementVNode("stop",{offset:"100%","stop-color":`${t.value.style.bars.colors.negative}${e.unref(n.opacity)[l.intensity]}`},null,8,j)],8,W))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("radialGradient",{id:`gradient_datapoint_${a}_${v.value}`,cy:"50%",cx:"50%",r:"50%",fx:"50%",fy:"50%"},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(l.color,.05)}${e.unref(n.opacity)[l.intensity]}`},null,8,T),e.createElementVNode("stop",{offset:"100%","stop-color":`${l.color}${e.unref(n.opacity)[l.intensity]}`},null,8,G)],8,P))),256))]),!t.value.style.bars.shape||t.value.style.bars.shape==="square"?(e.openBlock(),e.createElementBlock("g",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("rect",{x:l.x,y:l.y,height:l.height,width:l.width,fill:t.value.style.bars.colors.gradient.show?l.gradient:l.color,stroke:l.stroke,"stroke-width":t.value.style.bars.strokeWidth,rx:`${t.value.style.bars.borderRadius*l.proportion/12}%`,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,10,Y))),256))])):(e.openBlock(),e.createElementBlock("g",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createBlock(z._sfc_main,{plot:{x:l.x+l.width/2,y:l.y+l.height/2},color:t.value.style.bars.colors.gradient.show?l.gradient:l.color,shape:t.value.style.bars.shape,radius:l.height*.4,class:e.normalizeClass({"vue-ui-sparkhistogram-shape":t.value.style.animation.show})},null,8,["plot","color","shape","radius","class"]))),256))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("text",{"text-anchor":"middle",x:l.textAnchor,y:l.y-t.value.style.labels.value.fontSize/3+t.value.style.labels.value.offsetY,"font-size":t.value.style.labels.value.fontSize,"font-weight":t.value.style.labels.value.bold?"bold":"normal",fill:t.value.style.labels.value.color},e.toDisplayString(t.value.style.labels.value.prefix)+e.toDisplayString(isNaN(l.value)?"":Number(l.value.toFixed(t.value.style.labels.value.rounding)).toLocaleString())+e.toDisplayString(t.value.style.labels.value.suffix),9,J))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[l.valueLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:l.y+l.height+t.value.style.labels.valueLabel.fontSize,"font-size":t.value.style.labels.valueLabel.fontSize,"text-anchor":"middle",fill:t.value.style.labels.valueLabel.color},e.toDisplayString(l.valueLabel),9,K)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[l.timeLabel?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.textAnchor,y:c.value.height-t.value.style.labels.timeLabel.fontSize/2,"font-size":t.value.style.labels.timeLabel.fontSize,fill:t.value.style.labels.timeLabel.color,"text-anchor":"middle"},e.toDisplayString(l.timeLabel),9,Q)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,a)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{height:c.value.height,width:l.unitWidth,fill:"transparent",x:l.trapX,y:0,onMouseover:d=>i.value=a,onMouseleave:s[0]||(s[0]=d=>i.value=null),stroke:i.value!==null&&i.value===a?t.value.style.selector.stroke:"","stroke-width":i.value!==null&&i.value===a?t.value.style.selector.strokeWidth:0,rx:t.value.style.selector.borderRadius,"stroke-dasharray":t.value.style.selector.strokeDasharray,onClick:()=>E(l,a)},null,40,Z)]))),256))],8,H)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(D.default,{key:2,config:{type:"sparkHistogram",style:{backgroundColor:t.value.style.backgroundColor,sparkHistogram:{color:"#CCCCCC"}}}},null,8,["config"]))],36))}},te=F._export_sfc(ee,[["__scopeId","data-v-12e37596"]]);exports.default=te;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCssVars as R, computed as _, onMounted as T, ref as N, openBlock as a, createElementBlock as o, normalizeStyle as w, createElementVNode as h, createTextVNode as M, toDisplayString as r, createCommentVNode as p, unref as v, Fragment as g, renderList as f, normalizeClass as A, createBlock as D } from "vue";
|
|
2
|
-
import { u as P, o as J, e as F, g as K, c as Q, t as Z, r as m, X as ee, s as z } from "./index-
|
|
3
|
-
import { u as H } from "./useNestedProp-
|
|
4
|
-
import { _ as te } from "./Shape-
|
|
5
|
-
import le from "./vue-ui-skeleton-
|
|
2
|
+
import { u as P, o as J, e as F, g as K, c as Q, t as Z, r as m, X as ee, s as z } from "./index-BhCM2QF1.js";
|
|
3
|
+
import { u as H } from "./useNestedProp-CH3PVhvc.js";
|
|
4
|
+
import { _ as te } from "./Shape-COYAxpcP.js";
|
|
5
|
+
import le from "./vue-ui-skeleton-_VMQ594N.js";
|
|
6
6
|
import { _ as ae } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
const oe = { key: 0 }, se = { key: 1 }, ie = ["xmlns", "viewBox"], ue = ["id"], ne = ["stop-color"], re = ["stop-color"], ve = ["id"], de = ["stop-color"], ce = ["stop-color"], ye = ["id"], he = ["stop-color"], ge = ["stop-color"], fe = { key: 0 }, pe = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], me = { key: 1 }, be = ["x", "y", "font-size", "font-weight", "fill"], _e = ["x", "y", "font-size", "fill"], xe = ["x", "y", "font-size", "fill"], ke = ["height", "width", "x", "onMouseover", "stroke", "stroke-width", "rx", "stroke-dasharray", "onClick"], $e = {
|
|
8
8
|
__name: "vue-ui-sparkhistogram",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed as d, ref as w, onMounted as Q, openBlock as s, createElementBlock as n, normalizeStyle as N, renderSlot as D, normalizeProps as Y, guardReactiveProps as J, createElementVNode as f, toDisplayString as F, createCommentVNode as v, unref as c, Fragment as P, renderList as z, createBlock as K } from "vue";
|
|
2
|
-
import { u as ee, c as te, t as ae, o as le, e as G, g as ue, s as I, Q as oe, R as se, X as ne, r as C, L as W, f as B } from "./index-
|
|
3
|
-
import { u as E } from "./useNestedProp-
|
|
4
|
-
import re from "./vue-ui-skeleton-
|
|
2
|
+
import { u as ee, c as te, t as ae, o as le, e as G, g as ue, s as I, Q as oe, R as se, X as ne, r as C, L as W, f as B } from "./index-BhCM2QF1.js";
|
|
3
|
+
import { u as E } from "./useNestedProp-CH3PVhvc.js";
|
|
4
|
+
import re from "./vue-ui-skeleton-_VMQ594N.js";
|
|
5
5
|
import { _ as ie } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const de = ["id"], ve = ["xmlns", "viewBox"], ce = ["id"], ye = ["stop-color"], he = ["stop-color"], fe = ["id"], pe = ["stop-color"], ge = ["stop-color"], ke = ["id"], me = ["stop-color"], xe = ["stop-color"], _e = { key: 0 }, be = ["d", "fill"], we = ["d", "fill"], $e = ["d", "stroke", "stroke-width"], Le = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ne = ["x", "y", "width", "height", "fill", "rx"], Ie = ["x1", "x2", "y1", "y2", "stroke", "stroke-width", "stroke-dasharray"], Ce = ["x1", "x2", "y1", "y2", "stroke", "stroke-dasharray", "stroke-width"], Me = ["cx", "cy", "r", "fill", "stroke", "stroke-width"], Se = ["x", "y", "font-size", "font-weight", "fill"], Ve = ["x", "y", "height", "width", "onMouseenter", "onClick"], Pe = {
|
|
7
7
|
__name: "vue-ui-sparkline",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-BQOxn6SH.cjs"),B=require("./useNestedProp-BtqgWTf9.cjs"),z=require("./vue-ui-skeleton-CcrGR_Vh.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),D=["id"],F=["xmlns","viewBox"],G=["id"],W=["stop-color"],q=["stop-color"],T=["id"],j=["stop-color"],H=["stop-color"],O=["id"],U=["stop-color"],X=["stop-color"],Z={key:0},R=["d","fill"],Y=["d","fill"],J=["d","stroke","stroke-width"],K=["x1","x2","y1","y2","stroke","stroke-width"],Q=["x","y","width","height","fill","rx"],ee=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],te=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],le=["cx","cy","r","fill","stroke","stroke-width"],ae=["x","y","font-size","font-weight","fill"],oe=["x","y","height","width","onMouseenter","onClick"],ne={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0}},emits:["hoverIndex","selectDatapoint"],setup(m,{emit:b}){const i=m,{vue_ui_sparkline:$}=n.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(n.createUid()),t=e.computed(()=>{const l=B.useNestedProp({userConfig:i.config,defaultConfig:$});return l.theme?{...B.useNestedProp({userConfig:n.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}),f=e.ref(i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}));e.onMounted(()=>{if(n.objectIsEmpty(i.dataset)?n.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,r)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{n.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.style.animation.show&&i.dataset.length>1){let a=function(){r<i.dataset.length?(f.value.push(i.dataset[r]),setTimeout(()=>{requestAnimationFrame(a)},l)):f.value=i.dataset,r+=1};f.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let r=0;a()}});const d=e.ref({height:80,width:500}),L=e.ref(6),o=e.computed(()=>({top:12,left:0,right:d.value.width,bottom:d.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?d.value.width-t.value.style.chartWidth:30,width:i.showInfo&&t.value.style.dataLabel.show?t.value.style.chartWidth:d.value.width-30,height:d.value.height-12})),_=e.computed(()=>Math.min(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),V=e.computed(()=>Math.max(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),p=e.computed(()=>{const l=_.value>=0?0:_.value;return Math.abs(l)}),E=e.computed(()=>V.value+p.value+L.value),x=e.computed(()=>o.value.bottom-o.value.height*w(p.value));function w(l){return l/E.value}const y=e.computed(()=>i.dataset.length-1),u=e.computed(()=>f.value.map((l,r)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0;return{absoluteValue:a,period:l.period,plotValue:a+p.value,toMax:w(a+p.value),x:o.value.start+r*(o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1)),y:o.value.bottom-o.value.height*w(a+p.value),id:`plot_${v.value}_${r}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?n.shiftHue(t.value.style.line.color,.05*(1-r/y.value)):t.value.style.line.color,width:o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1)}})),C=e.computed(()=>{const l={x:u.value[0].x,y:d.value.height-6},r={x:u.value[u.value.length-1].x,y:d.value.height-6},a=[];return u.value.forEach(s=>{a.push(`${s.x},${s.y} `)}),[l.x,l.y,...a,r.x,r.y].toString()}),c=e.ref(void 0);function I(l,r){c.value=l,b("hoverIndex",{index:r})}function S(){c.value=void 0,b("hoverIndex",{index:void 0})}const h=e.computed(()=>{if(g.value){const l=u.value.map(a=>a.absoluteValue),r=l.reduce((a,s)=>a+s,0);return{latest:u.value[u.value.length-1].absoluteValue,sum:r,average:r/u.value.length,median:n.calcMedian(l),trend:n.calcLinearProgression(u.value.map(({x:a,y:s,absoluteValue:N})=>({x:a,y:s,value:N}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),M=e.computed(()=>g.value?t.value.style.dataLabel.valueType==="latest"?h.value.latest:t.value.style.dataLabel.valueType==="sum"?h.value.sum:t.value.style.dataLabel.valueType==="average"?h.value.average:0:0),k=e.computed(()=>t.value.type&&t.value.type==="bar");function P(l,r){b("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-sparkline",id:v.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily}`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:c.value,latest:h.value.latest,sum:h.value.sum,average:h.value.average,median:h.value.median,trend:h.value.trend})),void 0,!0),t.value.style.title.show&&m.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-sparkline-title",style:e.normalizeStyle(`display:flex;align-items:center;width:100%;color:${t.value.style.title.color};background:${t.value.style.backgroundColor};justify-content:${t.value.style.title.textAlign==="left"?"flex-start":t.value.style.title.textAlign==="right"?"flex-end":"center"};height:${t.value.style.title.fontSize*2}px;font-size:${t.value.style.title.fontSize}px;font-weight:${t.value.style.title.bold?"bold":"normal"};`)},[e.createElementVNode("span",{style:e.normalizeStyle(`padding:${t.value.style.title.textAlign==="left"?"0 0 0 12px":t.value.style.title.textAlign==="right"?"0 12px 0 0":"0"}`)},e.toDisplayString(c.value?c.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${d.value.width} ${d.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkline_gradient_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.area.color,.05)}${e.unref(n.opacity)[t.value.style.area.opacity]}`},null,8,W),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.area.color+e.unref(n.opacity)[t.value.style.area.opacity]},null,8,q)],8,G),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_pos_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.bar.color},null,8,j),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bar.color,.05)}`},null,8,H)],8,T),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bar.color,.05)}`},null,8,U),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,X)],8,O)]),t.value.style.area.show&&!k.value&&u.value[0]?(e.openBlock(),e.createElementBlock("g",Z,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${u.value[0].x},${o.value.bottom} ${e.unref(n.createSmoothPath)(u.value)} L ${u.value.at(-1).x},${o.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(n.opacity)[t.value.style.area.opacity]}`},null,8,R)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${C.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(n.opacity)[t.value.style.area.opacity]}`},null,8,Y))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(n.createSmoothPath)(u.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,J)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[s<u.value.length-1&&!t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:u.value[s+1].x,y1:a.y,y2:u.value[s+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,K)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:x.value,width:a.width,height:Math.abs(a.y-x.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${v.value})`:`url(#sparkline_bar_gradient_neg_${v.value})`,rx:t.value.style.bar.borderRadius},null,8,Q)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||m.selectedIndex===s)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:o.value.top-6,y2:o.value.bottom,stroke:t.value.style.verticalIndicator.color||a.color,"stroke-width":t.value.style.verticalIndicator.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.verticalIndicator.strokeDasharray||0},null,8,ee)):e.createCommentVNode("",!0)]))),256)),_.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.value.start,x2:o.value.start+o.value.width-16,y1:x.value,y2:x.value,stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,te)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||m.selectedIndex===s?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:a.x,cy:a.y,r:t.value.style.plot.radius,fill:a.color,stroke:t.value.style.plot.stroke,"stroke-width":t.value.style.plot.strokeWidth},null,8,le)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),m.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:o.value.width+12+t.value.style.dataLabel.offsetX,y:d.value.height/2+t.value.style.dataLabel.fontSize/2.5+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,"font-weight":t.value.style.dataLabel.bold?"bold":"normal",fill:t.value.style.dataLabel.color},e.toDisplayString(c.value?e.unref(n.dataLabel)({p:t.value.style.dataLabel.prefix,v:c.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}):e.unref(n.dataLabel)({p:t.value.style.dataLabel.prefix,v:M.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue})),9,ae)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1))/2,y:o.value.top-6,height:o.value.height+6,width:o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1),fill:"transparent",onMouseenter:N=>I(a,s),onMouseleave:S,onClick:()=>P(a,s)},null,40,oe))),256)),e.renderSlot(l.$slots,"svg",{svg:d.value},void 0,!0)],12,F)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(z.default,{key:2,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,D))}},ue=A._export_sfc(ne,[["__scopeId","data-v-ee68f40e"]]);exports.default=ue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-Y23HeR26.cjs"),B=require("./useNestedProp-C2H2jmU6.cjs"),z=require("./vue-ui-skeleton-B5Z4craS.cjs"),A=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),D=["id"],F=["xmlns","viewBox"],G=["id"],W=["stop-color"],q=["stop-color"],T=["id"],j=["stop-color"],H=["stop-color"],O=["id"],U=["stop-color"],X=["stop-color"],Z={key:0},R=["d","fill"],Y=["d","fill"],J=["d","stroke","stroke-width"],K=["x1","x2","y1","y2","stroke","stroke-width"],Q=["x","y","width","height","fill","rx"],ee=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],te=["x1","x2","y1","y2","stroke","stroke-dasharray","stroke-width"],le=["cx","cy","r","fill","stroke","stroke-width"],ae=["x","y","font-size","font-weight","fill"],oe=["x","y","height","width","onMouseenter","onClick"],ne={__name:"vue-ui-sparkline",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}},showInfo:{type:Boolean,default:!0},selectedIndex:{type:Number,default:void 0}},emits:["hoverIndex","selectDatapoint"],setup(m,{emit:b}){const i=m,{vue_ui_sparkline:$}=n.useConfig(),g=e.computed(()=>!!i.dataset&&i.dataset.length),v=e.ref(n.createUid()),t=e.computed(()=>{const l=B.useNestedProp({userConfig:i.config,defaultConfig:$});return l.theme?{...B.useNestedProp({userConfig:n.themes.vue_ui_sparkline[l.theme]||i.config,defaultConfig:l})}:l}),f=e.ref(i.dataset.map(l=>t.value.style.animation.show?{...l,value:null}:{...l,value:[void 0].includes(l.value)?null:l.value}));e.onMounted(()=>{if(n.objectIsEmpty(i.dataset)?n.error({componentName:"VueUiSparkline",type:"dataset"}):i.dataset.forEach((l,r)=>{n.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["period","value"]}).forEach(a=>{n.error({componentName:"VueUiSparkline",type:"datasetSerieAttribute",property:a,index:r})})}),t.value.style.animation.show&&i.dataset.length>1){let a=function(){r<i.dataset.length?(f.value.push(i.dataset[r]),setTimeout(()=>{requestAnimationFrame(a)},l)):f.value=i.dataset,r+=1};f.value=[];const l=t.value.style.animation.animationFrames/i.dataset.length;let r=0;a()}});const d=e.ref({height:80,width:500}),L=e.ref(6),o=e.computed(()=>({top:12,left:0,right:d.value.width,bottom:d.value.height-3,start:i.showInfo&&t.value.style.dataLabel.show&&t.value.style.dataLabel.position==="left"?d.value.width-t.value.style.chartWidth:30,width:i.showInfo&&t.value.style.dataLabel.show?t.value.style.chartWidth:d.value.width-30,height:d.value.height-12})),_=e.computed(()=>Math.min(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),V=e.computed(()=>Math.max(...f.value.map(l=>isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0))),p=e.computed(()=>{const l=_.value>=0?0:_.value;return Math.abs(l)}),E=e.computed(()=>V.value+p.value+L.value),x=e.computed(()=>o.value.bottom-o.value.height*w(p.value));function w(l){return l/E.value}const y=e.computed(()=>i.dataset.length-1),u=e.computed(()=>f.value.map((l,r)=>{const a=isNaN(l.value)||[void 0,null,"NaN",NaN,1/0,-1/0].includes(l.value)?0:l.value||0;return{absoluteValue:a,period:l.period,plotValue:a+p.value,toMax:w(a+p.value),x:o.value.start+r*(o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1)),y:o.value.bottom-o.value.height*w(a+p.value),id:`plot_${v.value}_${r}`,color:k.value?t.value.style.bar.color:t.value.style.area.useGradient?n.shiftHue(t.value.style.line.color,.05*(1-r/y.value)):t.value.style.line.color,width:o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1)}})),C=e.computed(()=>{const l={x:u.value[0].x,y:d.value.height-6},r={x:u.value[u.value.length-1].x,y:d.value.height-6},a=[];return u.value.forEach(s=>{a.push(`${s.x},${s.y} `)}),[l.x,l.y,...a,r.x,r.y].toString()}),c=e.ref(void 0);function I(l,r){c.value=l,b("hoverIndex",{index:r})}function S(){c.value=void 0,b("hoverIndex",{index:void 0})}const h=e.computed(()=>{if(g.value){const l=u.value.map(a=>a.absoluteValue),r=l.reduce((a,s)=>a+s,0);return{latest:u.value[u.value.length-1].absoluteValue,sum:r,average:r/u.value.length,median:n.calcMedian(l),trend:n.calcLinearProgression(u.value.map(({x:a,y:s,absoluteValue:N})=>({x:a,y:s,value:N}))).trend}}else return{latest:null,sum:null,average:null,median:null,trend:null}}),M=e.computed(()=>g.value?t.value.style.dataLabel.valueType==="latest"?h.value.latest:t.value.style.dataLabel.valueType==="sum"?h.value.sum:t.value.style.dataLabel.valueType==="average"?h.value.average:0:0),k=e.computed(()=>t.value.type&&t.value.type==="bar");function P(l,r){b("selectDatapoint",{datapoint:l,index:r})}return(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-sparkline",id:v.value,style:e.normalizeStyle(`width:100%;font-family:${t.value.style.fontFamily}`)},[e.renderSlot(l.$slots,"before",e.normalizeProps(e.guardReactiveProps({selected:c.value,latest:h.value.latest,sum:h.value.sum,average:h.value.average,median:h.value.median,trend:h.value.trend})),void 0,!0),t.value.style.title.show&&m.showInfo?(e.openBlock(),e.createElementBlock("div",{key:0,class:"vue-ui-sparkline-title",style:e.normalizeStyle(`display:flex;align-items:center;width:100%;color:${t.value.style.title.color};background:${t.value.style.backgroundColor};justify-content:${t.value.style.title.textAlign==="left"?"flex-start":t.value.style.title.textAlign==="right"?"flex-end":"center"};height:${t.value.style.title.fontSize*2}px;font-size:${t.value.style.title.fontSize}px;font-weight:${t.value.style.title.bold?"bold":"normal"};`)},[e.createElementVNode("span",{style:e.normalizeStyle(`padding:${t.value.style.title.textAlign==="left"?"0 0 0 12px":t.value.style.title.textAlign==="right"?"0 12px 0 0":"0"}`)},e.toDisplayString(c.value?c.value.period:t.value.style.title.text),5)],4)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(n.XMLNS),viewBox:`0 0 ${d.value.width} ${d.value.height}`,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};overflow:visible`)},[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`sparkline_gradient_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.area.color,.05)}${e.unref(n.opacity)[t.value.style.area.opacity]}`},null,8,W),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.area.color+e.unref(n.opacity)[t.value.style.area.opacity]},null,8,q)],8,G),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_pos_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.bar.color},null,8,j),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bar.color,.05)}`},null,8,H)],8,T),e.createElementVNode("linearGradient",{x2:"0%",y2:"100%",id:`sparkline_bar_gradient_neg_${v.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(n.shiftHue)(t.value.style.bar.color,.05)}`},null,8,U),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.bar.color},null,8,X)],8,O)]),t.value.style.area.show&&!k.value&&u.value[0]?(e.openBlock(),e.createElementBlock("g",Z,[t.value.style.line.smooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${u.value[0].x},${o.value.bottom} ${e.unref(n.createSmoothPath)(u.value)} L ${u.value.at(-1).x},${o.value.bottom} Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(n.opacity)[t.value.style.area.opacity]}`},null,8,R)):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M${C.value}Z`,fill:t.value.style.area.useGradient?`url(#sparkline_gradient_${v.value})`:`${t.value.style.area.color}${e.unref(n.opacity)[t.value.style.area.opacity]}`},null,8,Y))])):e.createCommentVNode("",!0),t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${e.unref(n.createSmoothPath)(u.value)}`,stroke:t.value.style.line.color,fill:"none","stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round"},null,8,J)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[s<u.value.length-1&&!t.value.style.line.smooth&&!k.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:u.value[s+1].x,y1:a.y,y2:u.value[s+1].y,stroke:a.color,"stroke-width":t.value.style.line.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round","shape-rendering":"geometricPrecision"},null,8,K)):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("rect",{key:1,x:a.x-a.width/2,y:a.absoluteValue>0?a.y:x.value,width:a.width,height:Math.abs(a.y-x.value),fill:a.absoluteValue>0?`url(#sparkline_bar_gradient_pos_${v.value})`:`url(#sparkline_bar_gradient_neg_${v.value})`,rx:t.value.style.bar.borderRadius},null,8,Q)):e.createCommentVNode("",!0),t.value.style.verticalIndicator.show&&(c.value&&a.id===c.value.id||m.selectedIndex===s)?(e.openBlock(),e.createElementBlock("line",{key:2,x1:a.x,x2:a.x,y1:o.value.top-6,y2:o.value.bottom,stroke:t.value.style.verticalIndicator.color||a.color,"stroke-width":t.value.style.verticalIndicator.strokeWidth,"stroke-linecap":"round","stroke-dasharray":t.value.style.verticalIndicator.strokeDasharray||0},null,8,ee)):e.createCommentVNode("",!0)]))),256)),_.value<0?(e.openBlock(),e.createElementBlock("line",{key:2,x1:o.value.start,x2:o.value.start+o.value.width-16,y1:x.value,y2:x.value,stroke:t.value.style.zeroLine.color,"stroke-dasharray":t.value.style.zeroLine.strokeWidth*2,"stroke-width":t.value.style.zeroLine.strokeWidth,"stroke-linecap":"round"},null,8,te)):e.createCommentVNode("",!0),t.value.style.plot.show?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:3},e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("g",null,[c.value&&a.id===c.value.id||m.selectedIndex===s?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:a.x,cy:a.y,r:t.value.style.plot.radius,fill:a.color,stroke:t.value.style.plot.stroke,"stroke-width":t.value.style.plot.strokeWidth},null,8,le)):e.createCommentVNode("",!0)]))),256)):e.createCommentVNode("",!0),m.showInfo&&t.value.style.dataLabel.show?(e.openBlock(),e.createElementBlock("text",{key:4,x:t.value.style.dataLabel.position==="left"?12+t.value.style.dataLabel.offsetX:o.value.width+12+t.value.style.dataLabel.offsetX,y:d.value.height/2+t.value.style.dataLabel.fontSize/2.5+t.value.style.dataLabel.offsetY,"font-size":t.value.style.dataLabel.fontSize,"font-weight":t.value.style.dataLabel.bold?"bold":"normal",fill:t.value.style.dataLabel.color},e.toDisplayString(c.value?e.unref(n.dataLabel)({p:t.value.style.dataLabel.prefix,v:c.value.absoluteValue,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue}):e.unref(n.dataLabel)({p:t.value.style.dataLabel.prefix,v:M.value,s:t.value.style.dataLabel.suffix,r:t.value.style.dataLabel.roundingValue})),9,ae)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(a,s)=>(e.openBlock(),e.createElementBlock("rect",{x:a.x-(o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1))/2,y:o.value.top-6,height:o.value.height+6,width:o.value.width/(y.value+1)>30?30:o.value.width/(y.value+1),fill:"transparent",onMouseenter:N=>I(a,s),onMouseleave:S,onClick:()=>P(a,s)},null,40,oe))),256)),e.renderSlot(l.$slots,"svg",{svg:d.value},void 0,!0)],12,F)):e.createCommentVNode("",!0),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(z.default,{key:2,config:{type:"sparkline",style:{backgroundColor:t.value.style.backgroundColor,sparkline:{color:"#CCCCCC"}}}},null,8,["config"]))],12,D))}},ue=A._export_sfc(ne,[["__scopeId","data-v-ee68f40e"]]);exports.default=ue;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed as p, ref as m, onMounted as T, openBlock as n, createElementBlock as r, normalizeStyle as g, createElementVNode as u, toDisplayString as k, createCommentVNode as h, unref as _, Fragment as D, renderList as z, normalizeClass as A, createBlock as q } from "vue";
|
|
2
|
-
import { u as H, c as j, t as X, a as J, p as d, b as K, d as P, o as Q, e as E, g as R, f as U, X as W, s as Y, r as Z } from "./index-
|
|
3
|
-
import { u as I } from "./useNestedProp-
|
|
4
|
-
import ee from "./vue-ui-skeleton-
|
|
2
|
+
import { u as H, c as j, t as X, a as J, p as d, b as K, d as P, o as Q, e as E, g as R, f as U, X as W, s as Y, r as Z } from "./index-BhCM2QF1.js";
|
|
3
|
+
import { u as I } from "./useNestedProp-CH3PVhvc.js";
|
|
4
|
+
import ee from "./vue-ui-skeleton-_VMQ594N.js";
|
|
5
5
|
import { _ as te } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const le = ["xmlns", "viewBox"], ae = ["id"], oe = ["stop-color"], se = ["stop-color"], ne = ["stop-color"], re = {
|
|
7
7
|
id: "stackPill",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-Y23HeR26.cjs"),x=require("./useNestedProp-C2H2jmU6.cjs"),E=require("./vue-ui-skeleton-B5Z4craS.cjs"),N=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=["xmlns","viewBox"],z=["id"],D=["stop-color"],P=["stop-color"],L=["stop-color"],A={id:"stackPill",clipPathUnits:"objectBoundingBox"},F=["fill"],U={"clip-path":"url(#stackPill)"},j=["height","width","fill"],q=["onClick","x","width","height","fill","stroke"],T=["onClick"],H={style:{display:"flex","flex-direction":"row","align-items":"center",gap:"4px","justify-content":"center"}},I=["height","width"],O=["fill"],M={__name:"vue-ui-sparkstackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(B,{emit:w}){const u=B,{vue_ui_sparkstackbar:$}=o.useConfig(),f=e.computed(()=>!!u.dataset&&u.dataset.length),b=e.ref(o.createUid()),t=e.computed(()=>{const l=x.useNestedProp({userConfig:u.config,defaultConfig:$});return l.theme?{...x.useNestedProp({userConfig:o.themes.vue_ui_sparkstackbar[l.theme]||u.config,defaultConfig:l}),customPalette:o.themePalettes[l.theme]||o.palette}:l}),m=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),d=e.ref(u.dataset.map((l,n)=>({...l,value:t.value.style.animation.show?0:l.value||0,color:l.color?o.convertColorToHex(l.color):m.value[n]||o.palette[n]||o.palette[n%o.palette.length]}))),p=e.ref(!0);e.onMounted(()=>{if(o.objectIsEmpty(u.dataset)?o.error({componentName:"VueUiSparkStackbar",type:"dataset"}):u.dataset.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(a=>{o.error({componentName:"VueUiSparkStackbar",type:"datasetSerieAttribute",property:a,index:n})})}),t.value.style.animation.show){let k=function(){r+=a/l,r<a?(d.value=d.value.map((s,i)=>({...s,value:s.value+=n[i],color:s.color?o.convertColorToHex(s.color):m.value[i]||o.palette[i]||o.palette[i%o.palette.length]})),requestAnimationFrame(k)):(p.value=!1,d.value=u.dataset.map((s,i)=>({...s,value:s.value||0,color:s.color?o.convertColorToHex(s.color):m.value[i]||o.palette[i]||o.palette[i%o.palette.length],id:o.createUid()})))};const l=t.value.style.animation.animationFrames,n=u.dataset.map((s,i)=>s.value/l),a=u.dataset.map(s=>s.value||0).reduce((s,i)=>s+i,0);let r=0;p.value=!0,k()}});const v=e.ref({width:500,height:16}),c=e.ref([]),g=e.computed(()=>u.dataset.map(l=>l.value||0).filter((l,n)=>!c.value.includes(n)).reduce((l,n)=>l+n,0)),_=e.computed(()=>d.value.map((l,n)=>({...l,value:l.value||0,proportion:(l.value||0)/g.value,width:(l.value||0)/g.value*v.value.width,proportionLabel:o.dataLabel({v:(l.value||0)/g.value*100,s:"%",r:t.value.style.legend.percentage.rounding})}))),y=e.computed(()=>_.value.filter((l,n)=>!c.value.includes(n)));function S(l){c.value.includes(l)?c.value=c.value.filter(n=>n!==l):c.value.length<d.value.length-1&&c.value.push(l)}const h=e.computed(()=>{let l=0;const n=[];for(let a=0;a<y.value.length;a+=1)n.push({...y.value[a],start:l}),l+=y.value[a].width;return n});function C(l,n){w("selectDatapoint",{datapoint:l,index:n})}return(l,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`width:100%; background:${t.value.style.backgroundColor}`)},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:calc(100% - 12px);background:${t.value.style.backgroundColor};margin:0 auto;margin:${t.value.style.title.margin};padding: 0 6px;text-align:${t.value.style.title.textAlign}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`font-size:${t.value.style.title.fontSize}px;color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`font-size:${t.value.style.title.subtitle.fontSize}px;color:${t.value.style.title.subtitle.color};font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(o.XMLNS),width:"100%",viewBox:`0 0 ${v.value.width} ${v.value.height}`},[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,r)=>(e.openBlock(),e.createElementBlock("linearGradient",{key:`stack_gradient_${r}`,gradientTransform:"rotate(90)",id:`stack_gradient_${r}_${b.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":a.color},null,8,D),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(o.shiftHue)(a.color,.05)}${e.unref(o.opacity)[100-t.value.style.bar.gradient.intensity]}`},null,8,P),e.createElementVNode("stop",{offset:"100%","stop-color":a.color},null,8,L)],8,z))),128)),e.createElementVNode("clipPath",A,[e.createElementVNode("rect",{x:"0.005",y:"-2",width:"0.99",height:"5",rx:"3",ry:"3",fill:t.value.style.backgroundColor},null,8,F)])]),e.createElementVNode("g",U,[e.createElementVNode("rect",{x:0,y:0,height:v.value.height,width:h.value.map(a=>a.width).reduce((a,r)=>a+r,0),fill:t.value.style.bar.gradient.underlayerColor,class:e.normalizeClass({animated:!p.value})},null,10,j),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(a,r)=>(e.openBlock(),e.createElementBlock("rect",{key:`stack_${r}`,onClick:()=>C(a,r),x:a.start,y:0,width:a.width,height:v.value.height,fill:t.value.style.bar.gradient.show?`url(#stack_gradient_${r}_${b.value})`:a.color,stroke:t.value.style.backgroundColor,"stroke-linecap":"round",class:e.normalizeClass({animated:!p.value})},null,10,q))),128))])],8,V)):e.createCommentVNode("",!0),f.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E.default,{key:2,config:{type:"sparkStackbar",style:{backgroundColor:t.value.style.backgroundColor,sparkStackbar:{color:"#CCCCCC"}}}},null,8,["config"])),t.value.style.legend.show?(e.openBlock(),e.createElementBlock("div",{key:3,style:e.normalizeStyle(`background:${t.value.style.backgroundColor};margin:0 auto;margin:${t.value.style.legend.margin};justify-content:${t.value.style.legend.textAlign==="left"?"flex-start":t.value.style.legend.textAlign==="right"?"flex-end":"center"}`),class:"vue-ui-sparkstackbar-legend"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`font-size:${t.value.style.legend.fontSize}px;`),class:e.normalizeClass({"vue-ui-sparkstackbar-legend-item":!0,"vue-ui-sparkstackbar-legend-item-unselected":c.value.includes(r)}),onClick:k=>{S(r),C(a,r)}},[e.createElementVNode("div",H,[(e.openBlock(),e.createElementBlock("svg",{height:`${t.value.style.legend.fontSize}px`,width:`${t.value.style.legend.fontSize}px`,viewBox:"0 0 10 10"},[e.createElementVNode("circle",{cx:5,cy:5,r:5,fill:a.color},null,8,O)],8,I)),e.createElementVNode("span",{style:e.normalizeStyle(`color:${t.value.style.legend.name.color}; font-weight:${t.value.style.legend.name.bold?"bold":"normal"}`)},e.toDisplayString(a.name),5),t.value.style.legend.percentage.show?(e.openBlock(),e.createElementBlock("span",{key:0,style:e.normalizeStyle(`font-weight:${t.value.style.legend.percentage.bold?"bold":"normal"};color:${t.value.style.legend.percentage.color}`)},e.toDisplayString(c.value.includes(r)?" - ":a.proportionLabel),5)):e.createCommentVNode("",!0),t.value.style.legend.value.show?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(`font-weight:${t.value.style.legend.value.bold?"bold":"normal"};color:${t.value.style.legend.value.color}`)}," ("+e.toDisplayString(e.unref(o.dataLabel)({p:t.value.style.legend.value.prefix,v:a.value,s:t.value.style.legend.value.suffix,r:t.value.style.legend.value.rounding}))+") ",5)):e.createCommentVNode("",!0)])],14,T))),256))],4)):e.createCommentVNode("",!0)],4))}},G=N._export_sfc(M,[["__scopeId","data-v-2006741b"]]);exports.default=G;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-Y23HeR26.cjs"),ae=require("./useNestedProp-C2H2jmU6.cjs"),le=require("./useResponsive-B3TrDDIG.cjs"),oe=require("./usePrinter-DTF28E03.cjs"),pe=require("./Slicer-DGkm-5p-.cjs"),be=require("./Tooltip-DQgBkgFk.cjs"),fe=require("./Title-DQz9dO4d.cjs"),ke=require("./Legend-BNfS77GS.cjs"),xe=require("./vue-ui-accordion-CVrj6roI.cjs"),Ce=require("./DataTable-B4_9ynlY.cjs"),we=require("./vue-ui-skeleton-B5Z4craS.cjs"),Be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Se=["id"],$e=["xmlns","viewBox"],Le={key:0},Ne=["id"],ze=["stop-color"],_e=["stop-color"],Te=["stop-color"],Ee=["x1","x2","y1","y2","stroke"],Ve=["x1","x2","y1","y2","stroke"],Re=["d","fill","stroke","stroke-width"],Pe=["x1","x2","y1","y2","stroke","stroke-width"],Fe=["x1","x2","y1","y2","stroke","stroke-width"],Me=["x","y","font-size","fill","font-weight"],De=["transform","font-size","fill","font-weight"],Oe=["x","y","font-size","fill","font-weight"],qe={key:0},Ae=["x","y","font-size","font-weight","fill"],He=["x1","x2","y1","y2","stroke"],Ie=["x","y","font-size","font-weight","fill"],Ue=["text-anchor","font-size","font-weight","fill","transform"],We=["x","y","width","height","onClick","onMouseenter","fill"],Ge={key:3,class:"vue-data-ui-watermark"},Ye=["onClick"],Xe=["innerHTML"],Je={__name:"vue-ui-stackbar",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint","selectLegend"],setup(F,{expose:re,emit:M}){const b=F,{vue_ui_stackbar:se}=i.useConfig(),C=e.computed({get(){return!!b.dataset&&b.dataset.length},set(l){return l}}),B=e.ref(null),_=e.ref(i.createUid()),T=e.ref(!1),D=e.ref(null),E=e.ref(""),p=e.ref([]),O=e.ref(0),q=e.ref(null),A=e.ref(null),H=e.ref(null),I=e.ref(0),V=e.ref(!1),R=e.ref(null);e.onMounted(()=>{i.objectIsEmpty(b.dataset)?i.error({componentName:"VueUiStackbar",type:"dataset"}):b.dataset.forEach((l,o)=>{i.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","series"]}).forEach(a=>{C.value=!1,i.error({componentName:"VueUiStackbar",type:"datasetSerieAttribute",property:a,index:o})})})});const t=e.computed(()=>{const l=ae.useNestedProp({userConfig:b.config,defaultConfig:se});return l.theme?{...ae.useNestedProp({userConfig:i.themes.vue_ui_stackbar[l.theme]||b.config,defaultConfig:l}),customPalette:i.themePalettes[l.theme]||i.palette}:l}),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:U,isImaging:W,generatePdf:G,generateImage:Y}=oe.usePrinter({elementId:`stackbar_${_.value}`,fileName:t.value.style.chart.title.text||"vue-ui-stackbar"}),$=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}}),ne=e.computed(()=>i.convertCustomPalette(t.value.customPalette)),X=e.ref(null);e.onMounted(()=>{if(t.value.responsive){const l=le.throttle(()=>{const{width:o,height:a}=le.useResponsive({chart:B.value,title:t.value.style.chart.title.text?q.value:null,legend:t.value.style.chart.legend.show?A.value:null,slicer:t.value.style.chart.zoom.show&&L.value>1?H.value:null});$.value.width=o,$.value.height=a});X.value=new ResizeObserver(l),X.value.observe(B.value.parentNode)}});const n=e.computed(()=>{const{height:l,width:o}=$.value,{right:a}=$.value.paddingRatio,s=t.value.style.chart.padding.top,r=o-o*a,u=l-t.value.style.chart.padding.bottom,v=t.value.style.chart.padding.left,g=o-v-o*a,m=l-s-t.value.style.chart.padding.bottom;return{chartHeight:l,chartWidth:o,top:s,right:r,bottom:u,left:v,width:g,height:m}}),w=e.computed(()=>b.dataset.map((l,o)=>{const a=i.convertColorToHex(l.color)||ne.value[o]||i.palette[o]||i.palette[o%i.palette.length];return{...l,absoluteIndex:o,id:i.createUid(),color:a}})),L=e.computed(()=>Math.max(...w.value.filter(l=>!p.value.includes(l.id)).map(l=>l.series.length))),c=e.ref({start:0,end:Math.max(...b.dataset.map(l=>l.series.length))});function ue(){c.value={start:0,end:Math.max(...b.dataset.map(l=>l.series.length))},I.value+=1}const h=e.computed(()=>{const l=n.value.width/(c.value.end-c.value.start);return l<=0?0:l}),x=e.computed(()=>i.sumSeries(w.value.filter(l=>!p.value.includes(l.id))).slice(c.value.start,c.value.end)),P=e.computed(()=>{const l=Math.max(...x.value),o=i.calculateNiceScale(0,l,t.value.style.chart.grid.scale.ticks);return o.ticks.map(a=>({y:n.value.bottom-n.value.height*(a/o.max),x:n.value.left-8,value:a}))}),N=e.computed(()=>t.value.style.chart.grid.x.timeLabels.values.slice(c.value.start,c.value.end)),d=e.computed(()=>{if(!C.value)return[];let l=Array(L.value).fill(0);const o=n.value.height,a=Math.max(...x.value),r=i.calculateNiceScale(0,a,t.value.style.chart.grid.scale.ticks).max;return w.value.filter(u=>!p.value.includes(u.id)).map(u=>{const v=u.series.slice(c.value.start,c.value.end);return{...u,proportions:v.map((g,m)=>t.value.style.chart.bars.distributed?(g||0)/x.value[m]:(g||0)/r),series:v,x:v.map((g,m)=>n.value.left+h.value*m+h.value*t.value.style.chart.bars.gapRatio/4),y:v.map((g,m)=>{const f=t.value.style.chart.bars.distributed?(g||0)/x.value[m]:(g||0)/r,S=o*f,k=o-S-l[m];return l[m]+=S,k+n.value.top}),height:v.map((g,m)=>{const f=t.value.style.chart.bars.distributed?(g||0)/x.value[m]:(g||0)/r;return o*f<=0?0:o*f})}})}),ie=e.computed(()=>{const l=Math.max(...x.value),a=i.calculateNiceScale(0,l,t.value.style.chart.grid.scale.ticks).max;return x.value.map((s,r)=>({value:s,y:(1-s/a)*n.value.height}))});function J(l){return i.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:l,s:t.value.style.chart.bars.dataLabels.suffix,r:t.value.style.chart.bars.dataLabels.rounding})}function ce(l){return i.dataLabel({v:l,s:"%",r:t.value.style.chart.bars.dataLabels.rounding})}function de(l){const o=JSON.parse(JSON.stringify(d.value)).map(a=>({name:a.name,value:a.series[l]===0?0:a.series[l]||null,proportion:a.proportions[l]||null,color:a.color,id:a.id}));M("selectDatapoint",{datapoint:o,period:N.value[l]})}function ve(l){R.value=l,T.value=!0;const o=t.value.style.chart.tooltip.customFormat,a=JSON.parse(JSON.stringify(d.value)).map(r=>({name:r.name,value:r.series[l]===0?0:r.series[l]||null,proportion:r.proportions[l]||null,color:r.color,id:r.id})),s=a.map(r=>r.value).reduce((r,u)=>r+u,0);if(i.isFunction(o)&&i.functionReturnsString(()=>o({seriesIndex:l,datapoint:a,series:d.value,config:t.value})))E.value=o({seriesIndex:l,datapoint:a,series:d.value,config:t.value});else{const{showValue:r,showPercentage:u,borderColor:v,roundingValue:g,roundingPercentage:m}=t.value.style.chart.tooltip;let f="";N.value[l]&&(f+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${v};padding-bottom:6px;margin-bottom:3px;">${N.value[l]}</div>`);const S=[r&&u?"(":"",r&&u?")":""];a.reverse().forEach(k=>{f+=`
|
|
2
2
|
<div style="display:flex;flex-direction:row;align-items:center;gap:4px">
|
|
3
3
|
<svg viewBox="0 0 12 12" height="14" width="14"><rect rx="1" x="0" y="0" height="12" width="12" stroke="none" fill="${t.value.style.chart.bars.gradient.show?`url(#gradient_${k.id})`:k.color}"/></svg>
|
|
4
4
|
${k.name}${r||u?":":""} ${r?i.dataLabel({p:t.value.style.chart.bars.dataLabels.prefix,v:k.value,s:t.value.style.chart.bars.dataLabels.suffix,r:g}):""} ${S[0]}${u?i.dataLabel({v:isNaN(k.value/s)?0:k.value/s*100,s:"%",r:m}):""}${S[1]}
|