vue-data-ui 2.4.39 → 2.4.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Arrow-gn_WiuJU.js → Arrow-6z0ZQva_.js} +1 -1
- package/dist/{Arrow-BH3TXY5i.cjs → Arrow-Cht76m69.cjs} +1 -1
- package/dist/{BaseIcon-C9eU1XEJ.cjs → BaseIcon-D-JUZiGA.cjs} +1 -1
- package/dist/{BaseIcon-PEMG4fz_.js → BaseIcon-DCE3wRiG.js} +1 -1
- package/dist/{DataTable-D7EHk98Z.js → DataTable-B5DiCrf_.js} +2 -2
- package/dist/{DataTable-Dk61oGV_.cjs → DataTable-Cr3Xkxe4.cjs} +1 -1
- package/dist/{Legend-6jFPkL1P.cjs → Legend-BXG_XPom.cjs} +1 -1
- package/dist/{Legend-C8xQE9Da.js → Legend-DzxQIjDO.js} +1 -1
- package/dist/{PackageVersion-C7okNmPF.cjs → PackageVersion-CMtZxTqq.cjs} +1 -1
- package/dist/{PackageVersion-CiIsJuZg.js → PackageVersion-S7OD_s5u.js} +1 -1
- package/dist/{PenAndPaper-BBXIRAdA.js → PenAndPaper-BxJZd7k9.js} +3 -3
- package/dist/{PenAndPaper-BUjMRWG0.cjs → PenAndPaper-DWYhyZye.cjs} +1 -1
- package/dist/{Shape-C37gcsR4.js → Shape-C3ywBhkW.js} +1 -1
- package/dist/{Shape-f0l9bT7U.cjs → Shape-CvL90fNe.cjs} +1 -1
- package/dist/{Slicer-A-l0DLQY.cjs → Slicer-B2aHb4bj.cjs} +1 -1
- package/dist/{Slicer-DHzuJMcK.js → Slicer-D9ASV60L.js} +2 -2
- package/dist/{Title-DU9SuVY-.js → Title-BB0O0yol.js} +1 -1
- package/dist/{Title-BeCsXJhg.cjs → Title-D9gPXVTT.cjs} +1 -1
- package/dist/{Tooltip-Chiu53IG.js → Tooltip-GvLaModr.js} +1 -1
- package/dist/{Tooltip-DCwHEKeM.cjs → Tooltip-ypQtmi99.cjs} +1 -1
- package/dist/index-B5Ugkauv.cjs +9 -0
- package/dist/{index-hQvps1ng.js → index-B6Q1Fyk0.js} +12 -3
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +9 -0
- package/dist/types/vue-data-ui.d.ts +9 -0
- package/dist/{useNestedProp-CxQ2hIfU.js → useNestedProp-DQpuJSz3.js} +1 -1
- package/dist/{useNestedProp-DzZoHbI7.cjs → useNestedProp-bZitLnbb.cjs} +1 -1
- package/dist/{usePrinter-c5Pf5Hrk.js → usePrinter-D8dIU7aG.js} +1 -1
- package/dist/{usePrinter-C-C264ik.cjs → usePrinter-DtpFEgOX.cjs} +1 -1
- package/dist/{vue-data-ui-DhR5T2GB.cjs → vue-data-ui-DBN7iJHU.cjs} +1 -1
- package/dist/{vue-data-ui-DD3uGHqs.js → vue-data-ui-H24TWcBx.js} +60 -60
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-BNOB6IJY.js → vue-ui-3d-bar-BA2CQYGW.js} +9 -9
- package/dist/{vue-ui-3d-bar-CBVoa_Wd.cjs → vue-ui-3d-bar-BaNI_M3v.cjs} +1 -1
- package/dist/{vue-ui-accordion-CbATWtZa.js → vue-ui-accordion-BOHicozd.js} +3 -3
- package/dist/{vue-ui-accordion-CTxFHMF7.cjs → vue-ui-accordion-u4xDSvRn.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-ahMSlg4_.cjs → vue-ui-age-pyramid-DN25tjv-.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-Ddn0vH-R.js → vue-ui-age-pyramid-vKWko9vn.js} +10 -10
- package/dist/{vue-ui-annotator-DUul7luS.cjs → vue-ui-annotator-BcxUQ5tM.cjs} +1 -1
- package/dist/{vue-ui-annotator-DgPWj2k4.js → vue-ui-annotator-D4KNucw5.js} +1 -1
- package/dist/{vue-ui-bullet-BvFWfcoX.cjs → vue-ui-bullet-C3DKTZbg.cjs} +1 -1
- package/dist/{vue-ui-bullet-C6JmUhDP.js → vue-ui-bullet-DZgtd_qb.js} +8 -8
- package/dist/{vue-ui-candlestick-BUATE5UN.js → vue-ui-candlestick-C8yBMu8-.js} +11 -11
- package/dist/{vue-ui-candlestick-hi4L9XWB.cjs → vue-ui-candlestick-DVEofXBZ.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-Bi9tYRH3.js → vue-ui-carousel-table-Bpsrlbx9.js} +4 -4
- package/dist/{vue-ui-carousel-table-DvotxYl6.cjs → vue-ui-carousel-table-C62szGjt.cjs} +1 -1
- package/dist/{vue-ui-chestnut-CRICzF5h.js → vue-ui-chestnut-DhPSNM96.js} +8 -8
- package/dist/{vue-ui-chestnut-Bv2eLqjB.cjs → vue-ui-chestnut-VWwSZnUX.cjs} +1 -1
- package/dist/{vue-ui-cursor-DfwrrtWf.js → vue-ui-cursor-BM2OiZnZ.js} +2 -2
- package/dist/{vue-ui-cursor-qFWZfG95.cjs → vue-ui-cursor-BwnZYB4D.cjs} +1 -1
- package/dist/vue-ui-dashboard-BcnW7vDs.js +248 -0
- package/dist/vue-ui-dashboard-D8FU1GbE.cjs +1 -0
- package/dist/{vue-ui-digits-C3X-8Guv.cjs → vue-ui-digits-BmQBwho3.cjs} +1 -1
- package/dist/{vue-ui-digits-DUCY8rWv.js → vue-ui-digits-M4Pvrg0n.js} +2 -2
- package/dist/{vue-ui-donut-BiUKzDWv.js → vue-ui-donut-BgsQjURe.js} +11 -11
- package/dist/{vue-ui-donut-Bv2GZaYZ.cjs → vue-ui-donut-CZZfvbPk.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-Cup3zFPj.js → vue-ui-donut-evolution-BO2-ARBX.js} +11 -11
- package/dist/{vue-ui-donut-evolution-j8JKVqXN.cjs → vue-ui-donut-evolution-DP14ctdf.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-CANVwmSA.cjs → vue-ui-dumbbell-CsMqgiGr.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-DJE8-e3A.js → vue-ui-dumbbell-zv7yiPPM.js} +10 -10
- package/dist/{vue-ui-flow-Crq3AVFe.js → vue-ui-flow-BqtIWBkz.js} +9 -9
- package/dist/{vue-ui-flow-Dvz0sa0O.cjs → vue-ui-flow-E5MkZ3Yb.cjs} +1 -1
- package/dist/{vue-ui-funnel-M8uzLylj.js → vue-ui-funnel-CmVLAttG.js} +8 -8
- package/dist/{vue-ui-funnel-BVujl3GY.cjs → vue-ui-funnel-QU0_JscL.cjs} +1 -1
- package/dist/{vue-ui-galaxy-BfQkC9br.cjs → vue-ui-galaxy-BPDH-9KW.cjs} +1 -1
- package/dist/{vue-ui-galaxy-B77VCJR3.js → vue-ui-galaxy-sy8zvgcg.js} +11 -11
- package/dist/{vue-ui-gauge-8xiT5BUm.js → vue-ui-gauge--hARSvgz.js} +7 -7
- package/dist/{vue-ui-gauge-DwMexCwq.cjs → vue-ui-gauge-D_yokJMS.cjs} +1 -1
- package/dist/{vue-ui-gizmo-C9pEyZr1.cjs → vue-ui-gizmo-AUJq3EQL.cjs} +1 -1
- package/dist/{vue-ui-gizmo-CI96cnOM.js → vue-ui-gizmo-CvTeq5j0.js} +3 -3
- package/dist/{vue-ui-heatmap-lXe9Bxsb.cjs → vue-ui-heatmap-D-xNLuqW.cjs} +1 -1
- package/dist/{vue-ui-heatmap-DE6AgqvQ.js → vue-ui-heatmap-lI8oO-nh.js} +10 -10
- package/dist/{vue-ui-history-plot-B2p5Da7E.cjs → vue-ui-history-plot-BC0Rvo-r.cjs} +1 -1
- package/dist/{vue-ui-history-plot-CO2ZBnhb.js → vue-ui-history-plot-D3CwJpll.js} +11 -11
- package/dist/{vue-ui-kpi-D_URPS6w.cjs → vue-ui-kpi-B4FQKZ_r.cjs} +1 -1
- package/dist/{vue-ui-kpi-Cc7Yytho.js → vue-ui-kpi-C0agq-Os.js} +3 -3
- package/dist/{vue-ui-mini-loader-DHXKDtYR.cjs → vue-ui-mini-loader-BJ70GAEv.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-DYbYoCQH.js → vue-ui-mini-loader-CkjJ5pRO.js} +2 -2
- package/dist/{vue-ui-molecule-CYs_u6Wz.cjs → vue-ui-molecule-CsQfkIEE.cjs} +1 -1
- package/dist/{vue-ui-molecule-CYlh7983.js → vue-ui-molecule-V9UFJHeV.js} +11 -11
- package/dist/{vue-ui-mood-radar-BjcUi2lA.cjs → vue-ui-mood-radar-CdU2vusL.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-B3nvz_EX.js → vue-ui-mood-radar-Cj_wOEbY.js} +11 -11
- package/dist/{vue-ui-nested-donuts-BDPVh9VT.js → vue-ui-nested-donuts-DFVQwbHg.js} +11 -11
- package/dist/{vue-ui-nested-donuts-sf-rnAYN.cjs → vue-ui-nested-donuts-DevV-xZr.cjs} +1 -1
- package/dist/{vue-ui-onion-BddrBSxm.js → vue-ui-onion-BJ-PjA7d.js} +11 -11
- package/dist/{vue-ui-onion-DYhBNiT8.cjs → vue-ui-onion-DGWktnME.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-JyWFCBD3.js → vue-ui-parallel-coordinate-plot-33naX1Ss.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-m-ZgXf3c.cjs → vue-ui-parallel-coordinate-plot-CjxZbVNa.cjs} +1 -1
- package/dist/{vue-ui-quadrant-C0XCJA1s.cjs → vue-ui-quadrant-DqZqBb2L.cjs} +1 -1
- package/dist/{vue-ui-quadrant-woZI-oSE.js → vue-ui-quadrant-xJaZzXgo.js} +12 -12
- package/dist/{vue-ui-quick-chart-DT37a1KG.js → vue-ui-quick-chart-BwN9eLye.js} +9 -9
- package/dist/{vue-ui-quick-chart-GAy1Kq_9.cjs → vue-ui-quick-chart-BzpXJYR_.cjs} +1 -1
- package/dist/{vue-ui-radar-BWLte3c3.js → vue-ui-radar-B4EXwJDY.js} +12 -12
- package/dist/{vue-ui-radar-C31U_Z53.cjs → vue-ui-radar-CQ66YUG5.cjs} +1 -1
- package/dist/{vue-ui-rating-B4LMCbX7.cjs → vue-ui-rating-D334I4ju.cjs} +1 -1
- package/dist/{vue-ui-rating-0HTRr8sI.js → vue-ui-rating-DNkygw1i.js} +2 -2
- package/dist/vue-ui-relation-circle-BKeSh28h.js +492 -0
- package/dist/vue-ui-relation-circle-CP2Z6IWV.cjs +1 -0
- package/dist/{vue-ui-rings-CptiG61Q.cjs → vue-ui-rings-2oDSTctd.cjs} +1 -1
- package/dist/{vue-ui-rings-Cd_dJ3co.js → vue-ui-rings-D6M3UNSE.js} +11 -11
- package/dist/{vue-ui-scatter-BK5xv5mP.cjs → vue-ui-scatter-C9ZoWV1q.cjs} +1 -1
- package/dist/{vue-ui-scatter-Do7eIAvo.js → vue-ui-scatter-JUPbbsO7.js} +12 -12
- package/dist/{vue-ui-screenshot-DJjluZur.js → vue-ui-screenshot-DmLDHfF9.js} +1 -1
- package/dist/{vue-ui-screenshot-hW8cPfaI.cjs → vue-ui-screenshot-JMBX_AWn.cjs} +1 -1
- package/dist/{vue-ui-skeleton-Dmee5Xfg.js → vue-ui-skeleton-D7rg5vFC.js} +3 -3
- package/dist/{vue-ui-skeleton-Ckb3hRcQ.cjs → vue-ui-skeleton-E9_X0-sa.cjs} +1 -1
- package/dist/{vue-ui-smiley-B3MEz94h.js → vue-ui-smiley-BAlHZm8H.js} +2 -2
- package/dist/{vue-ui-smiley-CfQTx9Kb.cjs → vue-ui-smiley-aRTznf8z.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-B-sO8emp.cjs → vue-ui-spark-trend-DZR6Fqu5.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-BnziIPLw.js → vue-ui-spark-trend-J9swikF_.js} +5 -5
- package/dist/{vue-ui-sparkbar-D3W-HMC0.js → vue-ui-sparkbar-B0tCpwZ9.js} +4 -4
- package/dist/{vue-ui-sparkbar-DWHagP1f.cjs → vue-ui-sparkbar-Bjmi8pMf.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-Bp20yElv.js → vue-ui-sparkgauge-DVX2pIC3.js} +4 -4
- package/dist/{vue-ui-sparkgauge-Cx_dMzxw.cjs → vue-ui-sparkgauge-Dhzbkn67.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-BdovbgiO.js → vue-ui-sparkhistogram-Wd6q0mqj.js} +5 -5
- package/dist/{vue-ui-sparkhistogram--Ulh-M8t.cjs → vue-ui-sparkhistogram-gIaXDrFh.cjs} +1 -1
- package/dist/{vue-ui-sparkline-DJGZzF_8.cjs → vue-ui-sparkline-B5ySeM9y.cjs} +1 -1
- package/dist/{vue-ui-sparkline-B2cKF2Oq.js → vue-ui-sparkline-DYT-gts9.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-ywMpLSpx.js → vue-ui-sparkstackbar-BMGA05VR.js} +5 -5
- package/dist/{vue-ui-sparkstackbar-BmFppjoc.cjs → vue-ui-sparkstackbar-ilvB3RBv.cjs} +1 -1
- package/dist/{vue-ui-stackbar-NjNO1R4N.cjs → vue-ui-stackbar-BZKwsAjO.cjs} +1 -1
- package/dist/{vue-ui-stackbar-s7gETyOu.js → vue-ui-stackbar-BZbOagnf.js} +12 -12
- package/dist/{vue-ui-strip-plot-CKI7Tk26.js → vue-ui-strip-plot-B-r4luYX.js} +11 -11
- package/dist/{vue-ui-strip-plot-BieHYfvX.cjs → vue-ui-strip-plot-DPo7osh_.cjs} +1 -1
- package/dist/{vue-ui-table-mo4xqDVF.cjs → vue-ui-table-C6z56ODT.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-BI_IFUMP.cjs → vue-ui-table-heatmap-B05GifSw.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-BMmVk6UI.js → vue-ui-table-heatmap-CM-c7n0F.js} +4 -4
- package/dist/{vue-ui-table-sparkline-DOx85BsZ.js → vue-ui-table-sparkline-DHaEHFG_.js} +5 -5
- package/dist/{vue-ui-table-sparkline-nouXTHiN.cjs → vue-ui-table-sparkline-Dx-ePVqW.cjs} +1 -1
- package/dist/{vue-ui-table-CGNRHPdF.js → vue-ui-table-wlXHwJVW.js} +1 -1
- package/dist/{vue-ui-thermometer-Cbqv6RYW.js → vue-ui-thermometer-BU_ckSdu.js} +7 -7
- package/dist/{vue-ui-thermometer-CpbU3pkq.cjs → vue-ui-thermometer-HCpOZBHv.cjs} +1 -1
- package/dist/{vue-ui-timer-BrAZQClf.cjs → vue-ui-timer-CUChwyzF.cjs} +1 -1
- package/dist/{vue-ui-timer-BgueE1dl.js → vue-ui-timer-DiRZ849L.js} +5 -5
- package/dist/{vue-ui-tiremarks-HNlJDrP8.js → vue-ui-tiremarks-BHMNb_tq.js} +7 -7
- package/dist/{vue-ui-tiremarks-DAqAEaPM.cjs → vue-ui-tiremarks-yoQtfbj7.cjs} +1 -1
- package/dist/{vue-ui-treemap-Cqej3ef5.cjs → vue-ui-treemap-BInwLSes.cjs} +1 -1
- package/dist/{vue-ui-treemap-BNNW0aIB.js → vue-ui-treemap-BpD6OdL3.js} +11 -11
- package/dist/{vue-ui-vertical-bar-DjoaIjRt.js → vue-ui-vertical-bar-CBNWMmCg.js} +11 -11
- package/dist/{vue-ui-vertical-bar-BCx0SE0Z.cjs → vue-ui-vertical-bar-hS4gzdKs.cjs} +1 -1
- package/dist/{vue-ui-waffle-CrCgrl2o.js → vue-ui-waffle-BE8iTrGF.js} +11 -11
- package/dist/{vue-ui-waffle-CspQJ4_E.cjs → vue-ui-waffle-Cmq6zhD8.cjs} +1 -1
- package/dist/{vue-ui-wheel-DvpCjvs8.cjs → vue-ui-wheel-BT0mLxln.cjs} +1 -1
- package/dist/{vue-ui-wheel-Wq6OVQ5Z.js → vue-ui-wheel-BXSIBRLM.js} +7 -7
- package/dist/{vue-ui-word-cloud-AXCM7hi3.js → vue-ui-word-cloud-3wvSYRbp.js} +10 -10
- package/dist/{vue-ui-word-cloud-CaW8SZ9y.cjs → vue-ui-word-cloud-BXHlm41O.cjs} +1 -1
- package/dist/vue-ui-xy-CfduqTWA.cjs +3 -0
- package/dist/{vue-ui-xy-BhdOWsqW.js → vue-ui-xy-D8XvOgW6.js} +16 -16
- package/dist/{vue-ui-xy-canvas-o7kCbz5j.cjs → vue-ui-xy-canvas-BTR-cL02.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-sAVL0y81.js → vue-ui-xy-canvas-Cx7vPyfT.js} +11 -11
- package/package.json +1 -1
- package/dist/index-DCccP2Kt.cjs +0 -9
- package/dist/vue-ui-dashboard-CxGCT46n.cjs +0 -1
- package/dist/vue-ui-dashboard-yX9EkLTf.js +0 -232
- package/dist/vue-ui-relation-circle-Ds3zzFbl.js +0 -366
- package/dist/vue-ui-relation-circle-K0EZ_Nkb.cjs +0 -1
- package/dist/vue-ui-xy-Dkl5bPI-.cjs +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-DCccP2Kt.cjs"),W=require("./useResponsive-BJ7DTGpm.cjs"),ae=require("./Title-BeCsXJhg.cjs"),H=require("./usePrinter-C-C264ik.cjs"),oe=require("./Tooltip-DCwHEKeM.cjs"),re=require("./DataTable-Dk61oGV_.cjs"),se=require("./vue-ui-skeleton-Ckb3hRcQ.cjs"),ie=require("./vue-ui-accordion-CTxFHMF7.cjs"),X=require("./useNestedProp-DzZoHbI7.cjs"),ne=require("./PackageVersion-C7okNmPF.cjs"),ue=require("./PenAndPaper-BUjMRWG0.cjs"),de=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],ve=["xmlns","viewBox"],ye=["id"],he=["stop-color"],fe=["stop-color"],pe=["id"],ge=["stop-color"],be=["stop-color"],me=["x","y","width","height","fill","rx"],xe=["x","y","width","height","fill","rx"],ke=["x","y","width","height","fill","rx"],we=["x","y","width","height","fill","rx"],Ce={key:0},_e=["x","y","fill","font-size","font-weight"],Ne=["x","y","fill","font-size","font-weight"],Le={key:1},Te=["x","y","font-size","fill","font-weight"],Se={key:2},Be={key:0},Ae=["x1","x2","y1","y2","stroke","stroke-width"],$e=["x1","x2","y1","y2","stroke","stroke-width"],Ee=["x1","x2","y1","y2","stroke","stroke-width"],ze=["x","y","font-size","fill","font-weight"],Ve=["x1","x2","y1","y2","stroke","stroke-width"],Pe=["x","y","font-size","fill","font-weight"],Oe=["x","y","font-size","fill","font-weight"],Ie=["x","y","width","height","fill","onMouseover"],Fe={key:5,class:"vue-data-ui-watermark"},De={__name:"vue-ui-age-pyramid",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(T,{expose:j}){const u=T,{vue_ui_age_pyramid:Y}=r.useConfig(),m=e.computed(()=>!!u.dataset&&u.dataset.length),c=e.ref(r.createUid()),J=e.ref(null),C=e.ref(!1),_=e.ref(""),x=e.ref(null),S=e.ref(0),y=e.ref(null),B=e.ref(null),A=e.ref(null),$=e.ref(null),E=e.ref(0),z=e.ref(0),t=e.computed({get:()=>V(),set:l=>l});function V(){const l=X.useNestedProp({userConfig:u.config,defaultConfig:Y});return l.theme?{...X.useNestedProp({userConfig:r.themes.vue_ui_age_pyramid[l.theme]||u.config,defaultConfig:l})}:l}e.watch(()=>u.config,l=>{t.value=V(),O(),E.value+=1,z.value+=1},{deep:!0});const P=e.ref(null);e.onMounted(()=>{O()});function O(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiAgePyramid",type:"dataset"}),t.value.responsive){const l=W.throttle(()=>{const{width:i,height:a}=W.useResponsive({chart:y.value,title:t.value.style.title.text?B.value:null,source:A.value,noTitle:$.value});d.value.width=i,d.value.height=a});P.value=new ResizeObserver(l),P.value.observe(y.value.parentNode)}}const{isPrinting:I,isImaging:F,generatePdf:D,generateImage:M}=H.usePrinter({elementId:`vue-ui-age-pyramid_${c.value}`,fileName:t.value.style.title.text||"vue-ui-age-pyramid"}),K=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),v=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),d=e.ref({height:t.value.style.height,width:t.value.style.width}),s=e.computed(()=>{const l=d.value.width-t.value.style.layout.padding.right-t.value.style.layout.padding.left,i=t.value.style.layout.padding.left,a=d.value.width-t.value.style.layout.padding.right;return{top:t.value.style.layout.padding.top,left:i,right:a,bottom:d.value.height-t.value.style.layout.padding.bottom,width:l,height:d.value.height-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,centerX:t.value.style.layout.padding.left+l/2,leftChart:{width:l/2-t.value.style.layout.centerSlit.width,right:i+l/2-t.value.style.layout.centerSlit.width},rightChart:{width:l/2-t.value.style.layout.centerSlit.width,left:i+l/2+t.value.style.layout.centerSlit.width}}}),Q=e.computed(()=>u.dataset.map(l=>t.value.style.layout.dataLabels.yAxis.display==="age"?l[1]:l[0])),h=e.computed(()=>{const l=Z(g.value/5),i=[],a=[];for(let o=0;o<=5;o+=1){const n=l*o,U=l*(o-5);i.push({value:n,x:s.value.left+s.value.width/2+t.value.style.layout.centerSlit.width+n/g.value*s.value.leftChart.width}),a.push({value:Math.abs(U),x:s.value.left+s.value.width/2+U/g.value*s.value.leftChart.width-t.value.style.layout.centerSlit.width})}return{right:i,left:a}});function Z(l){if(l===0)return 0;const a=10**Math.floor(Math.log10(Math.abs(l)));let o;return l<0,o=Math.round(l/a)*a,o}const g=e.computed(()=>Math.max(...u.dataset.flatMap(l=>l.slice(-2).map(i=>r.checkNaN(i))))),f=e.computed(()=>u.dataset.length),ee=e.computed(()=>u.dataset.map(l=>({segment:l[0],age:l[1],left:{value:l[2],proportionToMax:l[2]/g.value},right:{value:l[3],proportionToMax:l[3]/g.value}}))),p=e.computed(()=>ee.value.map((l,i)=>{const a=s.value.top+s.value.height/f.value*i,o=s.value.height/f.value-t.value.style.layout.bars.gap;return{segment:l.segment,age:l.age,left:{...l.left,y:a,color:t.value.style.layout.bars.left.color,x:s.value.leftChart.right-l.left.proportionToMax*s.value.leftChart.width,width:r.checkNaN(l.left.proportionToMax*s.value.leftChart.width),height:o},right:{...l.right,y:a,color:t.value.style.layout.bars.right.color,x:s.value.rightChart.left,width:r.checkNaN(l.right.proportionToMax*s.value.rightChart.width),height:o}}})),N=e.ref(null);function te(l,i){x.value=l,N.value={datapoint:i,seriesIndex:l,series:p.value,config:t.value};const a=t.value.style.tooltip.customFormat;if(r.isFunction(a)&&r.functionReturnsString(()=>a({seriesIndex:l,datapoint:{segment:i[0],index:i[1],left:i[2],right:i[3]},series:p.value,config:t.value})))_.value=a({seriesIndex:l,datapoint:{segment:i[0],index:i[1],left:i[2],right:i[3]},series:p.value,config:t.value});else{let o="";const n=p.value[l];o+=`<div><b>${n.segment}</b></div>`,o+=`<div>${t.value.translations.age}: ${r.applyDataLabel(t.value.style.layout.dataLabels.yAxis.formatter,r.checkNaN(n.age),r.dataLabel({v:r.checkNaN(n.age)}),{datapoint:i,seriesIndex:l})}</div>`,o+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}">`,o+='<div style="display:flex; flex-direction:row;gap:12px">',o+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${t.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${t.value.style.layout.bars.gradient.show?`url(#age_pyramid_left_${c.value})`:t.value.style.layout.bars.left.color}"/></svg><div>${t.value.translations.female}</div><div><b>${r.applyDataLabel(t.value.style.layout.dataLabels.xAxis.formatter,r.checkNaN(n.left.value),r.dataLabel({v:r.checkNaN(n.left.value)}),{datapoint:i,seriesIndex:l})}</b></div></div>`,o+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${t.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${t.value.style.layout.bars.gradient.show?`url(#age_pyramid_right_${c.value})`:t.value.style.layout.bars.right.color}"/></svg><div>${t.value.translations.male}</div><div><b>${r.applyDataLabel(t.value.style.layout.dataLabels.xAxis.formatter,r.checkNaN(n.right.value),r.dataLabel({v:r.checkNaN(n.right.value)}),{datapoint:i,seriesIndex:l})}</b></div></div>`,o+="</div>",o+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}"><div>${t.value.translations.total}</div><div><b>${r.applyDataLabel(t.value.style.layout.dataLabels.xAxis.formatter,r.checkNaN(n.right.value)+r.checkNaN(n.left.value),r.dataLabel({v:r.checkNaN(n.right.value)+r.checkNaN(n.left.value)}),{datapoint:i,seriesIndex:l})}</b></div></div>`,o+="</div>",_.value=`<div>${o}</div>`}C.value=!0}function R(){e.nextTick(()=>{const l=[t.value.translations.year,t.value.translations.age,t.value.translations.female,t.value.translations.male,t.value.translations.total],i=u.dataset.map(n=>[n[0],n[1],n[2],n[3],n[2]+n[3]]),a=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(i),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.title.text||"vue-ui-heatmap"})})}const k=e.computed(()=>{const l=[t.value.translations.year,t.value.translations.age,t.value.translations.female,t.value.translations.male,t.value.translations.total],i=u.dataset.map(o=>[o[0],o[1],o[2].toLocaleString(),o[3].toLocaleString(),(o[2]+o[3]).toLocaleString()]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:l,body:i,config:a,colNames:l}}),b=e.ref(!1);function le(l){b.value=l,S.value+=1}function q(){v.value.showTable=!v.value.showTable}function G(){v.value.showTooltip=!v.value.showTooltip}const w=e.ref(!1);function L(){w.value=!w.value}return j({generatePdf:D,generateCsv:R,generateImage:M,toggleTable:q,toggleTooltip:G,toggleAnnotator:L}),(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-age-pyramid ${b.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"agePyramid",ref:y,id:`vue-ui-age-pyramid_${c.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ue.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,active:w.value,onClose:L},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:$,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:B,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(ae._sfc_main,{key:`title_${E.value}`,config:{title:{cy:"pyramid-div-title",...t.value.style.title},subtitle:{cy:"pyramid-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&m.value?(e.openBlock(),e.createBlock(H.UserOptions,{ref_key:"details",ref:J,key:`user_options_${S.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(F),isPrinting:e.unref(I),uid:c.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:v.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:le,onGeneratePdf:e.unref(D),onGenerateCsv:R,onGenerateImage:e.unref(M),onToggleTable:q,onToggleTooltip:G,onToggleAnnotator:L},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:o})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:o})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:o})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${d.value.width<=0?10:d.value.width} ${d.value.height<=0?10:d.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.color}`)},[e.createVNode(ne._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`age_pyramid_left_${c.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.bars.left.color},null,8,he),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(e.unref(r.shiftHue)(t.value.style.layout.bars.left.color,t.value.style.layout.bars.gradient.shiftHue),100-t.value.style.layout.bars.gradient.intensity)},null,8,fe)],8,ye),e.createElementVNode("linearGradient",{id:`age_pyramid_right_${c.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(e.unref(r.shiftHue)(t.value.style.layout.bars.right.color,t.value.style.layout.bars.gradient.shiftHue),100-t.value.style.layout.bars.gradient.intensity)},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.bars.right.color},null,8,be)],8,pe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:a.left.x,y:a.left.y,width:e.unref(r.checkNaN)(a.left.width<=0?1e-4:a.left.width),height:a.left.height<=0?1e-4:a.left.height,fill:t.value.style.layout.bars.gradient.underlayer,rx:t.value.style.layout.bars.borderRadius},null,8,me),e.createElementVNode("rect",{x:a.left.x,y:a.left.y,width:a.left.width<=0?1e-4:a.left.width,height:a.left.height<=0?1e-4:a.left.height,fill:t.value.style.layout.bars.gradient.show?`url(#age_pyramid_left_${c.value})`:a.left.color,rx:t.value.style.layout.bars.borderRadius},null,8,xe),e.createElementVNode("rect",{x:a.right.x,y:a.right.y,width:a.right.width<=0?1e-4:a.right.width,height:a.right.height<=0?1e-4:a.right.height,fill:t.value.style.layout.bars.gradient.underlayer,rx:t.value.style.layout.bars.borderRadius},null,8,ke),e.createElementVNode("rect",{x:a.right.x,y:a.right.y,width:a.right.width<=0?1e-4:a.right.width,height:a.right.height<=0?1e-4:a.right.height,fill:t.value.style.layout.bars.gradient.show?`url(#age_pyramid_right_${c.value})`:a.right.color,rx:t.value.style.layout.bars.borderRadius},null,8,we)]))),256)),e.createElementVNode("g",null,[t.value.style.layout.dataLabels.sideTitles.show?(e.openBlock(),e.createElementBlock("g",Ce,[e.createElementVNode("text",{x:s.value.left,y:s.value.top+t.value.style.layout.dataLabels.sideTitles.offsetY,fill:t.value.style.layout.dataLabels.sideTitles.useSideColor?t.value.style.layout.bars.left.color:t.value.style.layout.dataLabels.sideTitles.color,"font-size":t.value.style.layout.dataLabels.sideTitles.fontSize,"text-anchor":"start","font-weight":t.value.style.layout.dataLabels.sideTitles.bold?"bold":"normal"},e.toDisplayString(t.value.translations.female),9,_e),e.createElementVNode("text",{x:s.value.right,y:s.value.top+t.value.style.layout.dataLabels.sideTitles.offsetY,fill:t.value.style.layout.dataLabels.sideTitles.useSideColor?t.value.style.layout.bars.right.color:t.value.style.layout.dataLabels.sideTitles.color,"font-size":t.value.style.layout.dataLabels.sideTitles.fontSize,"text-anchor":"end","font-weight":t.value.style.layout.dataLabels.sideTitles.bold?"bold":"normal"},e.toDisplayString(t.value.translations.male),9,Ne)])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.yAxis.show?(e.openBlock(),e.createElementBlock("g",Le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o%t.value.style.layout.dataLabels.yAxis.showEvery===0?(e.openBlock(),e.createElementBlock("text",{key:0,x:s.value.centerX,y:s.value.top+s.value.height/f.value*o+t.value.style.layout.dataLabels.yAxis.fontSize/3,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color,"font-weight":t.value.style.layout.dataLabels.yAxis.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.layout.dataLabels.yAxis.formatter,a,e.unref(r.dataLabel)({v:a}),{datapoint:a,seriesIndex:o})),9,Te)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.xAxis.show?(e.openBlock(),e.createElementBlock("g",Se,[t.value.style.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Be,[e.createElementVNode("line",{x1:h.value.right[0].x,x2:h.value.right.at(-1).x,y1:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ae),e.createElementVNode("line",{x1:h.value.left[0].x,x2:h.value.left.at(-1).x,y1:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,$e)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.right,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.layout.grid.show?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:a.x,y1:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/4,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ee)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:a.x,y:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize*2,"font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color,"text-anchor":"middle","font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.layout.dataLabels.xAxis.formatter,a.value/t.value.style.layout.dataLabels.xAxis.scale,e.unref(r.dataLabel)({v:a.value/t.value.style.layout.dataLabels.xAxis.scale}),{datapoint:a,seriesIndex:o})),9,ze)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.left,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.layout.grid.show?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:a.x,y1:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/4,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ve)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:a.x,y:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize*2,"font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color,"text-anchor":"middle","font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.layout.dataLabels.xAxis.formatter,a.value/t.value.style.layout.dataLabels.xAxis.scale,e.unref(r.dataLabel)({v:a.value/t.value.style.layout.dataLabels.xAxis.scale}),{datapoint:a,seriesIndex:o})),9,Pe)]))),256)),e.createElementVNode("text",{x:s.value.right,y:d.value.height,"text-anchor":"end","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color,"font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},e.toDisplayString(t.value.style.layout.dataLabels.xAxis.translation),9,Oe)])):e.createCommentVNode("",!0)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.dataset,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:s.value.left,y:s.value.top+s.value.height/f.value*o-t.value.style.layout.bars.gap/2,width:s.value.width<=0?1e-4:s.value.width,height:s.value.height/f.value<=0?1e-4:s.value.height/f.value,fill:x.value!==null&&x.value===o?e.unref(r.setOpacity)(t.value.style.highlighter.color,t.value.style.highlighter.opacity):"transparent",onMouseover:n=>te(o,a),onMouseleave:i[0]||(i[0]=n=>{x.value=null,C.value=!1})},null,40,Ie)]))),256)),e.renderSlot(l.$slots,"svg",{svg:d.value},void 0,!0)],14,ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Fe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(F)})),void 0,!0)])):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(se.default,{key:6,config:{type:"pyramid",style:{backgroundColor:t.value.style.backgroundColor,pyramid:{color:"#CCCCCC"}}}},null,8,["config"])),e.renderSlot(l.$slots,"legend",{legend:p.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:A,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(oe._sfc_main,{show:v.value.showTooltip&&C.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,offsetY:t.value.style.tooltip.offsetY,parent:y.value,content:_.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...N.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...N.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),m.value?(e.openBlock(),e.createBlock(ie.default,{key:8,hideDetails:"",config:{open:v.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(re.DataTable,{key:`table_${z.value}`,colNames:k.value.colNames,head:k.value.head,body:k.value.body,config:k.value.config,title:`${t.value.style.title.text}${t.value.style.title.subtitle.text?` : ${t.value.style.title.subtitle.text}`:""}`,onClose:i[1]||(i[1]=a=>v.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createTextVNode(e.toDisplayString(a),1)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ce))}},Me=de._export_sfc(De,[["__scopeId","data-v-c061125a"]]);exports.default=Me;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-B5Ugkauv.cjs"),W=require("./useResponsive-BJ7DTGpm.cjs"),ae=require("./Title-D9gPXVTT.cjs"),H=require("./usePrinter-DtpFEgOX.cjs"),oe=require("./Tooltip-ypQtmi99.cjs"),re=require("./DataTable-Cr3Xkxe4.cjs"),se=require("./vue-ui-skeleton-E9_X0-sa.cjs"),ie=require("./vue-ui-accordion-u4xDSvRn.cjs"),X=require("./useNestedProp-bZitLnbb.cjs"),ne=require("./PackageVersion-CMtZxTqq.cjs"),ue=require("./PenAndPaper-DWYhyZye.cjs"),de=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],ve=["xmlns","viewBox"],ye=["id"],he=["stop-color"],fe=["stop-color"],pe=["id"],ge=["stop-color"],be=["stop-color"],me=["x","y","width","height","fill","rx"],xe=["x","y","width","height","fill","rx"],ke=["x","y","width","height","fill","rx"],we=["x","y","width","height","fill","rx"],Ce={key:0},_e=["x","y","fill","font-size","font-weight"],Ne=["x","y","fill","font-size","font-weight"],Le={key:1},Te=["x","y","font-size","fill","font-weight"],Se={key:2},Be={key:0},Ae=["x1","x2","y1","y2","stroke","stroke-width"],$e=["x1","x2","y1","y2","stroke","stroke-width"],Ee=["x1","x2","y1","y2","stroke","stroke-width"],ze=["x","y","font-size","fill","font-weight"],Ve=["x1","x2","y1","y2","stroke","stroke-width"],Pe=["x","y","font-size","fill","font-weight"],Oe=["x","y","font-size","fill","font-weight"],Ie=["x","y","width","height","fill","onMouseover"],Fe={key:5,class:"vue-data-ui-watermark"},De={__name:"vue-ui-age-pyramid",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(T,{expose:j}){const u=T,{vue_ui_age_pyramid:Y}=r.useConfig(),m=e.computed(()=>!!u.dataset&&u.dataset.length),c=e.ref(r.createUid()),J=e.ref(null),C=e.ref(!1),_=e.ref(""),x=e.ref(null),S=e.ref(0),y=e.ref(null),B=e.ref(null),A=e.ref(null),$=e.ref(null),E=e.ref(0),z=e.ref(0),t=e.computed({get:()=>V(),set:l=>l});function V(){const l=X.useNestedProp({userConfig:u.config,defaultConfig:Y});return l.theme?{...X.useNestedProp({userConfig:r.themes.vue_ui_age_pyramid[l.theme]||u.config,defaultConfig:l})}:l}e.watch(()=>u.config,l=>{t.value=V(),O(),E.value+=1,z.value+=1},{deep:!0});const P=e.ref(null);e.onMounted(()=>{O()});function O(){if(r.objectIsEmpty(u.dataset)&&r.error({componentName:"VueUiAgePyramid",type:"dataset"}),t.value.responsive){const l=W.throttle(()=>{const{width:i,height:a}=W.useResponsive({chart:y.value,title:t.value.style.title.text?B.value:null,source:A.value,noTitle:$.value});d.value.width=i,d.value.height=a});P.value=new ResizeObserver(l),P.value.observe(y.value.parentNode)}}const{isPrinting:I,isImaging:F,generatePdf:D,generateImage:M}=H.usePrinter({elementId:`vue-ui-age-pyramid_${c.value}`,fileName:t.value.style.title.text||"vue-ui-age-pyramid"}),K=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),v=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),d=e.ref({height:t.value.style.height,width:t.value.style.width}),s=e.computed(()=>{const l=d.value.width-t.value.style.layout.padding.right-t.value.style.layout.padding.left,i=t.value.style.layout.padding.left,a=d.value.width-t.value.style.layout.padding.right;return{top:t.value.style.layout.padding.top,left:i,right:a,bottom:d.value.height-t.value.style.layout.padding.bottom,width:l,height:d.value.height-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom,centerX:t.value.style.layout.padding.left+l/2,leftChart:{width:l/2-t.value.style.layout.centerSlit.width,right:i+l/2-t.value.style.layout.centerSlit.width},rightChart:{width:l/2-t.value.style.layout.centerSlit.width,left:i+l/2+t.value.style.layout.centerSlit.width}}}),Q=e.computed(()=>u.dataset.map(l=>t.value.style.layout.dataLabels.yAxis.display==="age"?l[1]:l[0])),h=e.computed(()=>{const l=Z(g.value/5),i=[],a=[];for(let o=0;o<=5;o+=1){const n=l*o,U=l*(o-5);i.push({value:n,x:s.value.left+s.value.width/2+t.value.style.layout.centerSlit.width+n/g.value*s.value.leftChart.width}),a.push({value:Math.abs(U),x:s.value.left+s.value.width/2+U/g.value*s.value.leftChart.width-t.value.style.layout.centerSlit.width})}return{right:i,left:a}});function Z(l){if(l===0)return 0;const a=10**Math.floor(Math.log10(Math.abs(l)));let o;return l<0,o=Math.round(l/a)*a,o}const g=e.computed(()=>Math.max(...u.dataset.flatMap(l=>l.slice(-2).map(i=>r.checkNaN(i))))),f=e.computed(()=>u.dataset.length),ee=e.computed(()=>u.dataset.map(l=>({segment:l[0],age:l[1],left:{value:l[2],proportionToMax:l[2]/g.value},right:{value:l[3],proportionToMax:l[3]/g.value}}))),p=e.computed(()=>ee.value.map((l,i)=>{const a=s.value.top+s.value.height/f.value*i,o=s.value.height/f.value-t.value.style.layout.bars.gap;return{segment:l.segment,age:l.age,left:{...l.left,y:a,color:t.value.style.layout.bars.left.color,x:s.value.leftChart.right-l.left.proportionToMax*s.value.leftChart.width,width:r.checkNaN(l.left.proportionToMax*s.value.leftChart.width),height:o},right:{...l.right,y:a,color:t.value.style.layout.bars.right.color,x:s.value.rightChart.left,width:r.checkNaN(l.right.proportionToMax*s.value.rightChart.width),height:o}}})),N=e.ref(null);function te(l,i){x.value=l,N.value={datapoint:i,seriesIndex:l,series:p.value,config:t.value};const a=t.value.style.tooltip.customFormat;if(r.isFunction(a)&&r.functionReturnsString(()=>a({seriesIndex:l,datapoint:{segment:i[0],index:i[1],left:i[2],right:i[3]},series:p.value,config:t.value})))_.value=a({seriesIndex:l,datapoint:{segment:i[0],index:i[1],left:i[2],right:i[3]},series:p.value,config:t.value});else{let o="";const n=p.value[l];o+=`<div><b>${n.segment}</b></div>`,o+=`<div>${t.value.translations.age}: ${r.applyDataLabel(t.value.style.layout.dataLabels.yAxis.formatter,r.checkNaN(n.age),r.dataLabel({v:r.checkNaN(n.age)}),{datapoint:i,seriesIndex:l})}</div>`,o+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}">`,o+='<div style="display:flex; flex-direction:row;gap:12px">',o+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${t.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${t.value.style.layout.bars.gradient.show?`url(#age_pyramid_left_${c.value})`:t.value.style.layout.bars.left.color}"/></svg><div>${t.value.translations.female}</div><div><b>${r.applyDataLabel(t.value.style.layout.dataLabels.xAxis.formatter,r.checkNaN(n.left.value),r.dataLabel({v:r.checkNaN(n.left.value)}),{datapoint:i,seriesIndex:l})}</b></div></div>`,o+=`<div style="display:flex;flex-direction:column;align-items:center;justify-content:center"><svg viewBox="0 0 12 12" height="12" width="12"><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${t.value.style.layout.bars.gradient.underlayer}"/><rect stroke="none" x="0" y="0" height="12" width="12" rx="2" fill="${t.value.style.layout.bars.gradient.show?`url(#age_pyramid_right_${c.value})`:t.value.style.layout.bars.right.color}"/></svg><div>${t.value.translations.male}</div><div><b>${r.applyDataLabel(t.value.style.layout.dataLabels.xAxis.formatter,r.checkNaN(n.right.value),r.dataLabel({v:r.checkNaN(n.right.value)}),{datapoint:i,seriesIndex:l})}</b></div></div>`,o+="</div>",o+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}"><div>${t.value.translations.total}</div><div><b>${r.applyDataLabel(t.value.style.layout.dataLabels.xAxis.formatter,r.checkNaN(n.right.value)+r.checkNaN(n.left.value),r.dataLabel({v:r.checkNaN(n.right.value)+r.checkNaN(n.left.value)}),{datapoint:i,seriesIndex:l})}</b></div></div>`,o+="</div>",_.value=`<div>${o}</div>`}C.value=!0}function R(){e.nextTick(()=>{const l=[t.value.translations.year,t.value.translations.age,t.value.translations.female,t.value.translations.male,t.value.translations.total],i=u.dataset.map(n=>[n[0],n[1],n[2],n[3],n[2]+n[3]]),a=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(i),o=r.createCsvContent(a);r.downloadCsv({csvContent:o,title:t.value.style.title.text||"vue-ui-heatmap"})})}const k=e.computed(()=>{const l=[t.value.translations.year,t.value.translations.age,t.value.translations.female,t.value.translations.male,t.value.translations.total],i=u.dataset.map(o=>[o[0],o[1],o[2].toLocaleString(),o[3].toLocaleString(),(o[2]+o[3]).toLocaleString()]),a={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:l,body:i,config:a,colNames:l}}),b=e.ref(!1);function le(l){b.value=l,S.value+=1}function q(){v.value.showTable=!v.value.showTable}function G(){v.value.showTooltip=!v.value.showTooltip}const w=e.ref(!1);function L(){w.value=!w.value}return j({generatePdf:D,generateCsv:R,generateImage:M,toggleTable:q,toggleTooltip:G,toggleAnnotator:L}),(l,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-age-pyramid ${b.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"agePyramid",ref:y,id:`vue-ui-age-pyramid_${c.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.backgroundColor};${t.value.responsive?"height:100%":""}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ue.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,active:w.value,onClose:L},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:$,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:B,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(ae._sfc_main,{key:`title_${E.value}`,config:{title:{cy:"pyramid-div-title",...t.value.style.title},subtitle:{cy:"pyramid-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&m.value?(e.openBlock(),e.createBlock(H.UserOptions,{ref_key:"details",ref:J,key:`user_options_${S.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(F),isPrinting:e.unref(I),uid:c.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:v.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:w.value,onToggleFullscreen:le,onGeneratePdf:e.unref(D),onGenerateCsv:R,onGenerateImage:e.unref(M),onToggleTable:q,onToggleTooltip:G,onToggleAnnotator:L},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:o})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:o})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:a,isAnnotator:o})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:a,isAnnotator:o})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),m.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${d.value.width<=0?10:d.value.width} ${d.value.height<=0?10:d.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.color}`)},[e.createVNode(ne._sfc_main),e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`age_pyramid_left_${c.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.bars.left.color},null,8,he),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(r.setOpacity)(e.unref(r.shiftHue)(t.value.style.layout.bars.left.color,t.value.style.layout.bars.gradient.shiftHue),100-t.value.style.layout.bars.gradient.intensity)},null,8,fe)],8,ye),e.createElementVNode("linearGradient",{id:`age_pyramid_right_${c.value}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(e.unref(r.shiftHue)(t.value.style.layout.bars.right.color,t.value.style.layout.bars.gradient.shiftHue),100-t.value.style.layout.bars.gradient.intensity)},null,8,ge),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.bars.right.color},null,8,be)],8,pe)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:a.left.x,y:a.left.y,width:e.unref(r.checkNaN)(a.left.width<=0?1e-4:a.left.width),height:a.left.height<=0?1e-4:a.left.height,fill:t.value.style.layout.bars.gradient.underlayer,rx:t.value.style.layout.bars.borderRadius},null,8,me),e.createElementVNode("rect",{x:a.left.x,y:a.left.y,width:a.left.width<=0?1e-4:a.left.width,height:a.left.height<=0?1e-4:a.left.height,fill:t.value.style.layout.bars.gradient.show?`url(#age_pyramid_left_${c.value})`:a.left.color,rx:t.value.style.layout.bars.borderRadius},null,8,xe),e.createElementVNode("rect",{x:a.right.x,y:a.right.y,width:a.right.width<=0?1e-4:a.right.width,height:a.right.height<=0?1e-4:a.right.height,fill:t.value.style.layout.bars.gradient.underlayer,rx:t.value.style.layout.bars.borderRadius},null,8,ke),e.createElementVNode("rect",{x:a.right.x,y:a.right.y,width:a.right.width<=0?1e-4:a.right.width,height:a.right.height<=0?1e-4:a.right.height,fill:t.value.style.layout.bars.gradient.show?`url(#age_pyramid_right_${c.value})`:a.right.color,rx:t.value.style.layout.bars.borderRadius},null,8,we)]))),256)),e.createElementVNode("g",null,[t.value.style.layout.dataLabels.sideTitles.show?(e.openBlock(),e.createElementBlock("g",Ce,[e.createElementVNode("text",{x:s.value.left,y:s.value.top+t.value.style.layout.dataLabels.sideTitles.offsetY,fill:t.value.style.layout.dataLabels.sideTitles.useSideColor?t.value.style.layout.bars.left.color:t.value.style.layout.dataLabels.sideTitles.color,"font-size":t.value.style.layout.dataLabels.sideTitles.fontSize,"text-anchor":"start","font-weight":t.value.style.layout.dataLabels.sideTitles.bold?"bold":"normal"},e.toDisplayString(t.value.translations.female),9,_e),e.createElementVNode("text",{x:s.value.right,y:s.value.top+t.value.style.layout.dataLabels.sideTitles.offsetY,fill:t.value.style.layout.dataLabels.sideTitles.useSideColor?t.value.style.layout.bars.right.color:t.value.style.layout.dataLabels.sideTitles.color,"font-size":t.value.style.layout.dataLabels.sideTitles.fontSize,"text-anchor":"end","font-weight":t.value.style.layout.dataLabels.sideTitles.bold?"bold":"normal"},e.toDisplayString(t.value.translations.male),9,Ne)])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.yAxis.show?(e.openBlock(),e.createElementBlock("g",Le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[o%t.value.style.layout.dataLabels.yAxis.showEvery===0?(e.openBlock(),e.createElementBlock("text",{key:0,x:s.value.centerX,y:s.value.top+s.value.height/f.value*o+t.value.style.layout.dataLabels.yAxis.fontSize/3,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color,"font-weight":t.value.style.layout.dataLabels.yAxis.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.layout.dataLabels.yAxis.formatter,a,e.unref(r.dataLabel)({v:a}),{datapoint:a,seriesIndex:o})),9,Te)):e.createCommentVNode("",!0)],64))),256))])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.xAxis.show?(e.openBlock(),e.createElementBlock("g",Se,[t.value.style.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Be,[e.createElementVNode("line",{x1:h.value.right[0].x,x2:h.value.right.at(-1).x,y1:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ae),e.createElementVNode("line",{x1:h.value.left[0].x,x2:h.value.left.at(-1).x,y1:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,$e)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.right,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.layout.grid.show?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:a.x,y1:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/4,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ee)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:a.x,y:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize*2,"font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color,"text-anchor":"middle","font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.layout.dataLabels.xAxis.formatter,a.value/t.value.style.layout.dataLabels.xAxis.scale,e.unref(r.dataLabel)({v:a.value/t.value.style.layout.dataLabels.xAxis.scale}),{datapoint:a,seriesIndex:o})),9,ze)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.left,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.layout.grid.show?(e.openBlock(),e.createElementBlock("line",{key:0,x1:a.x,x2:a.x,y1:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/4,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ve)):e.createCommentVNode("",!0),e.createElementVNode("text",{x:a.x,y:s.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize*2,"font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color,"text-anchor":"middle","font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.layout.dataLabels.xAxis.formatter,a.value/t.value.style.layout.dataLabels.xAxis.scale,e.unref(r.dataLabel)({v:a.value/t.value.style.layout.dataLabels.xAxis.scale}),{datapoint:a,seriesIndex:o})),9,Pe)]))),256)),e.createElementVNode("text",{x:s.value.right,y:d.value.height,"text-anchor":"end","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color,"font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal"},e.toDisplayString(t.value.style.layout.dataLabels.xAxis.translation),9,Oe)])):e.createCommentVNode("",!0)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.dataset,(a,o)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("rect",{x:s.value.left,y:s.value.top+s.value.height/f.value*o-t.value.style.layout.bars.gap/2,width:s.value.width<=0?1e-4:s.value.width,height:s.value.height/f.value<=0?1e-4:s.value.height/f.value,fill:x.value!==null&&x.value===o?e.unref(r.setOpacity)(t.value.style.highlighter.color,t.value.style.highlighter.opacity):"transparent",onMouseover:n=>te(o,a),onMouseleave:i[0]||(i[0]=n=>{x.value=null,C.value=!1})},null,40,Ie)]))),256)),e.renderSlot(l.$slots,"svg",{svg:d.value},void 0,!0)],14,ve)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Fe,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(I)||e.unref(F)})),void 0,!0)])):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(se.default,{key:6,config:{type:"pyramid",style:{backgroundColor:t.value.style.backgroundColor,pyramid:{color:"#CCCCCC"}}}},null,8,["config"])),e.renderSlot(l.$slots,"legend",{legend:p.value},void 0,!0),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:A,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(oe._sfc_main,{show:v.value.showTooltip&&C.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,offsetY:t.value.style.tooltip.offsetY,parent:y.value,content:_.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...N.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...N.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),m.value?(e.openBlock(),e.createBlock(ie.default,{key:8,hideDetails:"",config:{open:v.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(re.DataTable,{key:`table_${z.value}`,colNames:k.value.colNames,head:k.value.head,body:k.value.body,config:k.value.config,title:`${t.value.style.title.text}${t.value.style.title.subtitle.text?` : ${t.value.style.title.subtitle.text}`:""}`,onClose:i[1]||(i[1]=a=>v.value.showTable=!1)},{th:e.withCtx(({th:a})=>[e.createTextVNode(e.toDisplayString(a),1)]),td:e.withCtx(({td:a})=>[e.createTextVNode(e.toDisplayString(a),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ce))}},Me=de._export_sfc(De,[["__scopeId","data-v-c061125a"]]);exports.default=Me;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { computed as b, ref as v, watch as _e, onMounted as Ce, openBlock as i, createElementBlock as r, normalizeClass as re, normalizeStyle as ne, createBlock as L, createCommentVNode as y, unref as d, createSlots as $e, withCtx as p, renderSlot as f, normalizeProps as O, guardReactiveProps as P, createVNode as de, createElementVNode as n, Fragment as S, renderList as F, toDisplayString as w, createTextVNode as ve, nextTick as Te } from "vue";
|
|
2
|
-
import { u as Ae, c as Le, t as Se, o as ze, e as Ie, v as h, X as Oe, s as X, w as ye, i as k, f as _, x as Pe, y as Fe, q as Me, r as Ne } from "./index-
|
|
2
|
+
import { u as Ae, c as Le, t as Se, o as ze, e as Ie, v as h, X as Oe, s as X, w as ye, i as k, f as _, x as Pe, y as Fe, q as Me, r as Ne } from "./index-B6Q1Fyk0.js";
|
|
3
3
|
import { t as Re, u as De } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as Ge } from "./Title-
|
|
5
|
-
import { u as Be, U as Ee } from "./usePrinter-
|
|
6
|
-
import { _ as We } from "./Tooltip-
|
|
7
|
-
import { D as Xe } from "./DataTable-
|
|
8
|
-
import Ue from "./vue-ui-skeleton-
|
|
9
|
-
import Ve from "./vue-ui-accordion-
|
|
10
|
-
import { u as he } from "./useNestedProp-
|
|
11
|
-
import { _ as Ye } from "./PackageVersion-
|
|
12
|
-
import { P as je } from "./PenAndPaper-
|
|
4
|
+
import { _ as Ge } from "./Title-BB0O0yol.js";
|
|
5
|
+
import { u as Be, U as Ee } from "./usePrinter-D8dIU7aG.js";
|
|
6
|
+
import { _ as We } from "./Tooltip-GvLaModr.js";
|
|
7
|
+
import { D as Xe } from "./DataTable-B5DiCrf_.js";
|
|
8
|
+
import Ue from "./vue-ui-skeleton-D7rg5vFC.js";
|
|
9
|
+
import Ve from "./vue-ui-accordion-BOHicozd.js";
|
|
10
|
+
import { u as he } from "./useNestedProp-DQpuJSz3.js";
|
|
11
|
+
import { _ as Ye } from "./PackageVersion-S7OD_s5u.js";
|
|
12
|
+
import { P as je } from "./PenAndPaper-BxJZd7k9.js";
|
|
13
13
|
import { _ as He } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
14
|
const qe = ["id"], Je = ["xmlns", "viewBox"], Ke = ["id"], Qe = ["stop-color"], Ze = ["stop-color"], et = ["id"], tt = ["stop-color"], lt = ["stop-color"], at = ["x", "y", "width", "height", "fill", "rx"], ot = ["x", "y", "width", "height", "fill", "rx"], st = ["x", "y", "width", "height", "fill", "rx"], it = ["x", "y", "width", "height", "fill", "rx"], ut = { key: 0 }, rt = ["x", "y", "fill", "font-size", "font-weight"], nt = ["x", "y", "fill", "font-size", "font-weight"], dt = { key: 1 }, vt = ["x", "y", "font-size", "fill", "font-weight"], yt = { key: 2 }, ht = { key: 0 }, ft = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], ct = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], gt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], pt = ["x", "y", "font-size", "fill", "font-weight"], bt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], xt = ["x", "y", "font-size", "fill", "font-weight"], mt = ["x", "y", "font-size", "fill", "font-weight"], wt = ["x", "y", "width", "height", "fill", "onMouseover"], kt = {
|
|
15
15
|
key: 5,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./html2canvas.esm-BA_v9SIU.cjs"),I=require("./jspdf.es.min-DLYY9DTT.cjs"),u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./html2canvas.esm-BA_v9SIU.cjs"),I=require("./jspdf.es.min-DLYY9DTT.cjs"),u=require("./index-B5Ugkauv.cjs"),o=require("vue"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),f={props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{shapes:[],lastSelectedShape:void 0}}}},data(){return{activeShape:void 0,strokeSize:1,currentPointer:{start:{x:0,y:0},end:{x:0,end:0}},currentTarget:void 0,hoveredShapeId:void 0,isBold:!1,isBulletTextMode:!1,isDash:!1,isDeleteMode:!1,isDrawing:!1,isDrawingNewShape:!0,isDrawMode:!1,isItalic:!1,isMouseDown:!1,isMoveMode:!1,isPrinting:!1,isResizeMode:!1,isSelectMode:!1,isSummaryOpen:!1,isTextMode:!1,isUnderline:!1,isWriting:!1,lastSelectedShape:this.dataset.lastSelectedShape,pointerDownId:-1,pointerPosition:{x:0,y:0},preventEdit:!0,selectedGroup:[],shapes:this.dataset.shapes?this.dataset.shapes:[],shapesOrder:[],step:Math.round(Math.random())*1e5,svgHeight:1e3,svgWidth:1e3,options:{arrow:{color:"grey",filled:!0},circle:{color:"grey",filled:!1,radius:3,strokeWidth:2},rect:{color:"grey",filled:!1,strokeWidth:2,height:12,width:12}},selectedColor:"#000000",showCaret:!1,sizeRatio:1,slottedSvg:void 0,sourceWidth:1,sourceHeight:1,textAlign:"start",textFont:20,transparency:100,transparencyCodes:u.opacity}},watch:{shapes:{handler(e){e.length===0&&(this.lastSelectedShape=void 0)}}},computed:{FINAL_CONFIG(){const e=u.useConfig().vue_ui_annotator;if(!Object.keys(this.config||{}).length)return e;const l=this.treeShake({defaultConfig:e,userConfig:this.config});return this.convertConfigColors(l)},canSelect(){return this.shapes.filter(e=>!["line","group"].includes(e.type)).length>1},colorTransparency(){return this.transparencyCodes[this.transparency>98?98:this.transparency]},cursorClass(){switch(!0){case this.isDeleteMode:return"default";case this.isMoveMode:return"move";case this.isTextMode:return"text";case this.isResizeMode:return"se-resize";default:return""}},records(){return this.shapes},userShapes(){return this.records.map(e=>{switch(!0){case(e&&e.type==="arrow"):const l=e.strokeWidth>3?5:10,s=e.strokeWidth>3?2.5:5;return`
|
|
2
2
|
<defs>
|
|
3
3
|
<marker
|
|
4
4
|
id="${e.id}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import p from "./html2canvas.esm-d2sM-0Wm.js";
|
|
2
2
|
import { E as _ } from "./jspdf.es.min-C660YX78.js";
|
|
3
|
-
import { z as v, u as w, A, B as M } from "./index-
|
|
3
|
+
import { z as v, u as w, A, B as M } from "./index-B6Q1Fyk0.js";
|
|
4
4
|
import { openBlock as d, createElementBlock as n, createElementVNode as r, normalizeStyle as c, toDisplayString as u, normalizeClass as y, createCommentVNode as a, withDirectives as f, vModelCheckbox as g, vModelText as C, renderSlot as O, Fragment as L, renderList as G, createStaticVNode as N, pushScopeId as m, popScopeId as T } from "vue";
|
|
5
5
|
import { _ as R } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const D = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-B5Ugkauv.cjs"),V=require("./useNestedProp-bZitLnbb.cjs"),j=require("./Title-D9gPXVTT.cjs"),G=require("./Legend-BXG_XPom.cjs"),$=require("./usePrinter-DtpFEgOX.cjs"),X=require("./PackageVersion-CMtZxTqq.cjs"),Y=require("./PenAndPaper-DWYhyZye.cjs"),J=require("./vue-ui-skeleton-E9_X0-sa.cjs"),K=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Q=["id"],Z={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ee=["xmlns","viewBox"],te={key:0},ae=["x","y","height","width","fill","stroke"],le=["x","y","height","width","rx","fill","stroke","stroke-width"],re=["x","y","height","width","fill","stroke","stroke-width"],oe=["x","y","font-size","font-weight","fill"],se=["x","y","height","width","rx","fill","stroke","stroke-width"],ne={key:3},ue=["x","y","fill","font-size","font-weight"],ie={key:4},ce=["x1","x2","y1","y2","stroke"],de={key:5,class:"vue-data-ui-watermark"},he={class:"vue-ui-bullet-legend-item",dir:"auto"},ve={style:{"margin-right":"2px"}},me={key:7,ref:"source",dir:"auto"},ge={__name:"vue-ui-bullet",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(A,{expose:F}){const n=A,{vue_ui_bullet:O}=s.useConfig(),y=e.ref(null),I=e.ref(null),w=e.ref(0),z=e.ref(null),T=e.ref(0),d=e.computed({get:()=>n.dataset.hasOwnProperty("value"),set:a=>a}),v=e.computed(()=>n.dataset.segments?Array.isArray(n.dataset.segments)?n.dataset.segments.length?!0:(console.warn(`VueUiBullet: dataset segments is empty. Provide segments with this datastructure:
|
|
2
2
|
|
|
3
3
|
segments: [
|
|
4
4
|
{
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ref as d, computed as g, onMounted as ce, watch as V, onBeforeUnmount as he, openBlock as r, createElementBlock as n, normalizeClass as q, normalizeStyle as X, createBlock as k, createCommentVNode as u, unref as v, createSlots as ve, withCtx as w, renderSlot as y, normalizeProps as I, guardReactiveProps as O, createVNode as de, Fragment as H, renderList as T, createElementVNode as x, toDisplayString as L } from "vue";
|
|
2
|
-
import { u as ge, o as fe, e as Y, g as me, c as ye, l as pe, C as be, d as ke, i as $, f as B, X as we, t as xe } from "./index-
|
|
3
|
-
import { u as J } from "./useNestedProp-
|
|
4
|
-
import { _ as _e } from "./Title-
|
|
5
|
-
import { L as Ce } from "./Legend-
|
|
6
|
-
import { u as Le, U as $e } from "./usePrinter-
|
|
7
|
-
import { _ as Be } from "./PackageVersion-
|
|
8
|
-
import { P as Ae } from "./PenAndPaper-
|
|
9
|
-
import Pe from "./vue-ui-skeleton-
|
|
2
|
+
import { u as ge, o as fe, e as Y, g as me, c as ye, l as pe, C as be, d as ke, i as $, f as B, X as we, t as xe } from "./index-B6Q1Fyk0.js";
|
|
3
|
+
import { u as J } from "./useNestedProp-DQpuJSz3.js";
|
|
4
|
+
import { _ as _e } from "./Title-BB0O0yol.js";
|
|
5
|
+
import { L as Ce } from "./Legend-DzxQIjDO.js";
|
|
6
|
+
import { u as Le, U as $e } from "./usePrinter-D8dIU7aG.js";
|
|
7
|
+
import { _ as Be } from "./PackageVersion-S7OD_s5u.js";
|
|
8
|
+
import { P as Ae } from "./PenAndPaper-BxJZd7k9.js";
|
|
9
|
+
import Pe from "./vue-ui-skeleton-D7rg5vFC.js";
|
|
10
10
|
import { _ as Fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
const Se = ["id"], Ie = {
|
|
12
12
|
key: 1,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { computed as h, ref as n, watch as xe, onMounted as Ee, onBeforeUnmount as De, openBlock as s, createElementBlock as u, normalizeClass as ke, normalizeStyle as we, createBlock as _, createCommentVNode as d, unref as f, createSlots as We, withCtx as g, renderSlot as p, normalizeProps as A, guardReactiveProps as T, createVNode as $e, createElementVNode as r, Fragment as z, renderList as F, toDisplayString as O, createTextVNode as Ge, nextTick as Xe } from "vue";
|
|
2
|
-
import { u as je, c as He, t as Ye, o as qe, e as N, C as Je, v as V, X as Ke, w as W, D as Qe, s as Ze, x as et, y as tt, q as lt, r as ot, E as Ce } from "./index-
|
|
2
|
+
import { u as je, c as He, t as Ye, o as qe, e as N, C as Je, v as V, X as Ke, w as W, D as Qe, s as Ze, x as et, y as tt, q as lt, r as ot, E as Ce } from "./index-B6Q1Fyk0.js";
|
|
3
3
|
import { t as at, u as st } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as ut } from "./Title-
|
|
5
|
-
import { u as it, U as nt } from "./usePrinter-
|
|
6
|
-
import { _ as rt } from "./Tooltip-
|
|
7
|
-
import { D as vt } from "./DataTable-
|
|
8
|
-
import dt from "./vue-ui-skeleton-
|
|
9
|
-
import { S as ct } from "./Slicer-
|
|
10
|
-
import yt from "./vue-ui-accordion-
|
|
11
|
-
import { u as _e } from "./useNestedProp-
|
|
12
|
-
import { _ as ht } from "./PackageVersion-
|
|
13
|
-
import { P as pt } from "./PenAndPaper-
|
|
4
|
+
import { _ as ut } from "./Title-BB0O0yol.js";
|
|
5
|
+
import { u as it, U as nt } from "./usePrinter-D8dIU7aG.js";
|
|
6
|
+
import { _ as rt } from "./Tooltip-GvLaModr.js";
|
|
7
|
+
import { D as vt } from "./DataTable-B5DiCrf_.js";
|
|
8
|
+
import dt from "./vue-ui-skeleton-D7rg5vFC.js";
|
|
9
|
+
import { S as ct } from "./Slicer-D9ASV60L.js";
|
|
10
|
+
import yt from "./vue-ui-accordion-BOHicozd.js";
|
|
11
|
+
import { u as _e } from "./useNestedProp-DQpuJSz3.js";
|
|
12
|
+
import { _ as ht } from "./PackageVersion-S7OD_s5u.js";
|
|
13
|
+
import { P as pt } from "./PenAndPaper-BxJZd7k9.js";
|
|
14
14
|
import { _ as ft } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
15
|
const gt = ["id"], bt = ["xmlns", "viewBox"], mt = { key: 0 }, xt = ["id"], kt = ["stop-color"], wt = ["stop-color"], $t = ["stop-color"], Ct = ["id"], _t = ["stop-color"], Nt = ["stop-color"], St = ["stop-color"], At = { key: 0 }, Tt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], zt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ft = { key: 1 }, Lt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Rt = ["x", "y", "font-size", "fill", "font-weight"], Ot = { key: 2 }, Vt = ["transform", "text-anchor", "font-size", "fill", "font-weight"], It = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Pt = { key: 0 }, Bt = ["cx", "cy", "r", "fill"], Mt = ["cx", "cy", "r", "fill"], Ut = { key: 1 }, Et = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Dt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Wt = ["x", "y", "height", "width", "fill", "rx"], Gt = ["x", "y", "height", "width", "fill", "rx", "stroke", "stroke-width"], Xt = ["x", "y", "height", "width", "fill", "onMouseover"], jt = {
|
|
16
16
|
key: 5,
|
|
@@ -1,2 +1,2 @@
|
|
|
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-B5Ugkauv.cjs"),ae=require("./useResponsive-BJ7DTGpm.cjs"),we=require("./Title-D9gPXVTT.cjs"),ne=require("./usePrinter-DtpFEgOX.cjs"),Ce=require("./Tooltip-ypQtmi99.cjs"),Ne=require("./DataTable-Cr3Xkxe4.cjs"),$e=require("./vue-ui-skeleton-E9_X0-sa.cjs"),_e=require("./Slicer-B2aHb4bj.cjs"),Be=require("./vue-ui-accordion-u4xDSvRn.cjs"),ue=require("./useNestedProp-bZitLnbb.cjs"),Se=require("./PackageVersion-CMtZxTqq.cjs"),Ve=require("./PenAndPaper-DWYhyZye.cjs"),Ee=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ze=["id"],Te=["xmlns","viewBox"],Ae={key:0},Fe=["id"],Le=["stop-color"],Pe=["stop-color"],Re=["stop-color"],Oe=["id"],Ie=["stop-color"],Me=["stop-color"],Ue=["stop-color"],qe={key:0},De=["x1","x2","y1","y2","stroke","stroke-width"],We=["x1","x2","y1","y2","stroke","stroke-width"],Ge={key:1},He=["x1","x2","y1","y2","stroke","stroke-width"],je=["x","y","font-size","fill","font-weight"],Xe={key:2},Ye=["transform","text-anchor","font-size","fill","font-weight"],Je=["x1","x2","y1","y2","stroke","stroke-width"],Ke={key:0},Qe=["cx","cy","r","fill"],Ze=["cx","cy","r","fill"],et={key:1},tt=["x1","x2","y1","y2","stroke","stroke-width"],lt=["x1","x2","y1","y2","stroke","stroke-width"],ot=["x","y","height","width","fill","rx"],at=["x","y","height","width","fill","rx","stroke","stroke-width"],nt=["x","y","height","width","fill","onMouseover"],ut={key:5,class:"vue-data-ui-watermark"},rt=["innerHTML"],st={__name:"vue-ui-candlestick",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(f,{expose:re}){const h=f,{vue_ui_candlestick:se}=u.useConfig(),k=e.computed(()=>!!h.dataset&&h.dataset.length),y=e.ref(u.createUid()),ie=e.ref(null),S=e.ref(!1),V=e.ref(""),E=e.ref(void 0),L=e.ref(0),m=e.ref(null),P=e.ref(null),R=e.ref(null),O=e.ref(null),I=e.ref(null),M=e.ref(null),x=e.ref(0),U=e.ref(0),q=e.ref(0),t=e.computed({get:()=>D(),set:l=>l});function D(){const l=ue.useNestedProp({userConfig:h.config,defaultConfig:se});return l.theme?{...ue.useNestedProp({userConfig:u.themes.vue_ui_candlestick[l.theme]||h.config,defaultConfig:l})}:l}e.watch(()=>h.config,l=>{t.value=D(),W(),x.value+=1,q.value+=1,U.value+=1},{deep:!0}),e.watch(()=>h.dataset,l=>{d.value.start=0,d.value.end=l.length,x.value+=1},{deep:!0});const i=e.ref({height:t.value.style.height,width:t.value.style.width,xAxisFontSize:t.value.style.layout.grid.xAxis.dataLabels.fontSize,yAxisFontSize:t.value.style.layout.grid.yAxis.dataLabels.fontSize}),w=e.ref(null);e.onMounted(()=>{W()});function W(){if(u.objectIsEmpty(h.dataset)&&u.error({componentName:"VueUiCandlestick",type:"dataset"}),t.value.responsive){const l=ae.throttle(()=>{const{width:n,height:o}=ae.useResponsive({chart:m.value,title:t.value.style.title.text?P.value:null,slicer:O.value,legend:R.value,source:I.value,noTitle:M.value});i.value.width=n,i.value.height=o,i.value.xAxisFontSize=u.translateSize({relator:Math.min(n,o),adjuster:t.value.style.width,source:t.value.style.layout.grid.xAxis.dataLabels.fontSize,threshold:6,fallback:6}),i.value.yAxisFontSize=u.translateSize({relator:Math.min(n,o),adjuster:t.value.style.width,source:t.value.style.layout.grid.yAxis.dataLabels.fontSize,threshold:6,fallback:6})});w.value=new ResizeObserver(l),w.value.observe(m.value.parentNode)}}e.onBeforeUnmount(()=>{w.value&&w.value.disconnect()});const{isPrinting:G,isImaging:H,generatePdf:j,generateImage:X}=ne.usePrinter({elementId:`vue-ui-candlestick_${y.value}`,fileName:t.value.style.title.text||"vue-ui-candlestick"}),de=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),p=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),r=e.computed(()=>{const{top:l,right:n,bottom:o,left:a}=t.value.style.layout.padding;return{top:l,right:i.value.width-n,left:a,bottom:i.value.height-o,width:i.value.width-a-n,height:i.value.height-l-o}}),z=e.computed(()=>h.dataset.length),d=e.ref({start:0,end:z.value}),Y=e.computed(()=>h.dataset.slice(d.value.start,d.value.end)),T=e.computed(()=>(h.dataset.forEach((l,n)=>{[null,void 0].includes(l[0])&&u.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"period (index 0)",index:n}),[null,void 0].includes(l[1])&&u.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"open (index 1)",index:n}),[null,void 0].includes(l[2])&&u.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"high (index 2)",index:n}),[null,void 0].includes(l[3])&&u.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"low (index 3)",index:n}),[null,void 0].includes(l[4])&&u.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"last (index 4)",index:n}),[null,void 0].includes(l[5])&&u.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"volume (index 5)",index:n})}),Y.value.map(l=>({period:l[0],open:l[1],high:l[2],low:l[3],last:l[4],volume:l[5]})))),s=e.computed(()=>r.value.width/Y.value.length),J=e.computed(()=>({max:Math.max(...T.value.map(l=>l.high)),min:0})),g=e.computed(()=>u.calculateNiceScale(J.value.min,J.value.max,t.value.style.layout.grid.yAxis.dataLabels.steps));function C(l,n){return{...l,x:u.checkNaN(r.value.left+n*s.value+s.value/2),y:u.checkNaN(r.value.top+(1-l/g.value.max)*r.value.height),value:u.checkNaN(l)}}const c=e.computed(()=>T.value.map((l,n)=>{const o=C(l.open,n),a=C(l.high,n),v=C(l.low,n),_=C(l.last,n),B=l.last>l.open;return{period:l.period,open:o,high:a,low:v,last:_,volume:l.volume,isBullish:B}}));function ce(l){return u.checkNaN(l/g.value.max)}const ve=e.computed(()=>g.value.ticks.map(l=>({y:r.value.bottom-r.value.height*ce(l),value:u.checkNaN(l)}))),ye=e.computed(()=>T.value.map(l=>l.period)),A=e.ref(null);function he(l,n){E.value=l,A.value={datapoint:n,seriesIndex:l,series:c.value,config:t.value};const o=t.value.style.tooltip.customFormat;if(u.isFunction(o)&&u.functionReturnsString(()=>o({seriesIndex:l,datapoint:n,series:c.value,config:t.value})))V.value=o({seriesIndex:l,datapoint:n,series:c.value,config:t.value});else if(t.value.style.tooltip.show){let a="";const{period:v,open:_,high:B,low:ee,last:te,volume:le,isBullish:oe}=c.value[l],{period:dt,open:ge,high:me,low:ke,last:be,volume:xe}=t.value.translations;a+=`<div><svg style="margin-right:6px" viewBox="0 0 12 12" height="12" width="12"><rect x="0" y="0" height="12" width="12" rx="${t.value.style.layout.candle.borderRadius*3}" stroke="${t.value.style.layout.candle.stroke}" stroke-width="${t.value.style.layout.candle.strokeWidth}"
|
|
2
2
|
fill="${t.value.style.layout.candle.gradient.show?oe?`url(#bullish_gradient_${y.value})`:`url(#bearish_gradient_${y.value})`:oe?t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.colors.bearish}"/></svg>${v}</div>`,a+=`${xe} : <b>${isNaN(le)?"-":Number(le.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()}</b>`,a+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}">`,a+=`<div>${ge}: <b>${t.value.style.tooltip.prefix} ${isNaN(_.value)?"-":Number(_.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,a+=`<div>${me}: <b>${t.value.style.tooltip.prefix} ${isNaN(B.value)?"-":Number(B.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,a+=`<div>${ke}: <b>${t.value.style.tooltip.prefix} ${isNaN(ee.value)?"-":Number(ee.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,a+=`<div>${be}: <b>${t.value.style.tooltip.prefix} ${isNaN(te.value)?"-":Number(te.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,a+="</div>",V.value=`<div style="text-align:right">${a}</div>`}S.value=!0}function pe(){d.value={start:0,end:z.value},x.value+=1}function K(){e.nextTick(()=>{const l=[t.value.translations.period,t.value.translations.open,t.value.translations.high,t.value.translations.low,t.value.translations.last,t.value.translations.volume],n=c.value.map(v=>[v.period,v.open.value,v.high.value,v.low.value,v.last.value,v.volume]),o=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(n),a=u.createCsvContent(o);u.downloadCsv({csvContent:a,title:t.value.style.title.text||"vue-ui-candlestick"})})}const N=e.computed(()=>{const l=c.value.map(a=>[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" height="12" width="12" style="margin-right: 6px"><rect x="0" y="0" height="12" width="12" :rx="${t.value.style.layout.candle.borderRadius*3}" fill="${t.value.style.layout.candle.gradient.show?a.isBullish?`url(#bullish_gradient_${y.value}`:`url(#bearish_gradient_${y.value})`:a.isBullish?t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.colors.bearish}"/></svg> ${a.period}`,`${t.value.table.td.prefix} ${isNaN(a.open.value)?"-":Number(a.open.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(a.high.value)?"-":Number(a.high.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(a.low.value)?"-":Number(a.low.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(a.last.value)?"-":Number(a.last.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${isNaN(a.volume)?"-":a.volume.toLocaleString()}`]),n={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint},o=[t.value.translations.period,t.value.translations.open,t.value.translations.high,t.value.translations.low,t.value.translations.last,t.value.translations.volume];return{head:o,body:l,config:n,colNames:o}}),b=e.ref(!1);function fe(l){b.value=l,L.value+=1}function Q(){p.value.showTable=!p.value.showTable}function Z(){p.value.showTooltip=!p.value.showTooltip}const $=e.ref(!1);function F(){$.value=!$.value}return re({generatePdf:j,generateCsv:K,generateImage:X,toggleTable:Q,toggleTooltip:Z,toggleAnnotator:F}),(l,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"candlestickChart",ref:m,class:e.normalizeClass(`vue-ui-candlestick ${b.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`position:relative;font-family:${t.value.style.fontFamily}; text-align:center;background:${t.value.style.backgroundColor}; ${t.value.responsive?"height: 100%":""}`),id:`vue-ui-candlestick_${y.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Ve.PenAndPaper,{key:0,parent:m.value,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,active:$.value,onClose:F},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),de.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:M,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:P,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(we._sfc_main,{key:`title_${q.value}`,config:{title:{cy:"candlestick-div-title",...t.value.style.title},subtitle:{cy:"candlestick-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&k.value?(e.openBlock(),e.createBlock(ne.UserOptions,{ref_key:"details",ref:ie,key:`user_options_${L.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(H),isPrinting:e.unref(G),uid:y.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:b.value,isTooltip:p.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:m.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:$.value,onToggleFullscreen:fe,onGeneratePdf:e.unref(j),onGenerateCsv:K,onGenerateImage:e.unref(X),onToggleTable:Q,onToggleTooltip:Z,onToggleAnnotator:F},e.createSlots({_:2},[l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:o,isFullscreen:a})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:a})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:a})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:a})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":b.value,"vue-data-ui-fulscreen--off":!b.value}),viewBox:`0 0 ${i.value.width<=0?10:i.value.width} ${i.value.height<=0?10:i.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.color}`)},[e.createVNode(Se._sfc_main),c.value.length>0?(e.openBlock(),e.createElementBlock("g",Ae,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`bearish_gradient_${y.value}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.candle.colors.bearish},null,8,Le),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(u.shiftHue)(t.value.style.layout.candle.colors.bearish,.02)}DE`},null,8,Pe),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(u.shiftHue)(t.value.style.layout.candle.colors.bearish,.05)}66`},null,8,Re)],8,Fe),e.createElementVNode("linearGradient",{id:`bullish_gradient_${y.value}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.candle.colors.bullish},null,8,Ie),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(u.shiftHue)(t.value.style.layout.candle.colors.bullish,.02)}DE`},null,8,Me),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(u.shiftHue)(t.value.style.layout.candle.colors.bullish,.05)}66`},null,8,Ue)],8,Oe)]),t.value.style.layout.grid.show?(e.openBlock(),e.createElementBlock("g",qe,[e.createElementVNode("line",{x1:r.value.left,x2:r.value.left,y1:r.value.top,y2:r.value.bottom,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,De),e.createElementVNode("line",{x1:r.value.left,x2:r.value.right,y1:r.value.bottom,y2:r.value.bottom,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,We)])):e.createCommentVNode("",!0),t.value.style.layout.grid.yAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[o.value>=g.value.min&&o.value<=g.value.max?(e.openBlock(),e.createElementBlock("line",{key:0,x1:r.value.left,x2:r.value.left-5,y1:o.y,y2:o.y,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,He)):e.createCommentVNode("",!0),o.value>=g.value.min&&o.value<=g.value.max?(e.openBlock(),e.createElementBlock("text",{key:1,x:r.value.left-8+t.value.style.layout.grid.yAxis.dataLabels.offsetX,y:o.y+i.value.yAxisFontSize/3,"font-size":i.value.yAxisFontSize,"text-anchor":"end",fill:t.value.style.layout.grid.yAxis.dataLabels.color,"font-weight":t.value.style.layout.grid.yAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(t.value.style.layout.grid.yAxis.dataLabels.prefix)+" "+e.toDisplayString(e.unref(u.canShowValue)(o.value)?o.value.toFixed(t.value.style.layout.grid.yAxis.dataLabels.roundingValue):"")+" "+e.toDisplayString(t.value.style.layout.grid.yAxis.dataLabels.suffix),9,je)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),t.value.style.layout.grid.xAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye.value,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{transform:`translate(${r.value.left+s.value*a+s.value/2}, ${r.value.bottom+i.value.xAxisFontSize*2+t.value.style.layout.grid.xAxis.dataLabels.offsetY}), rotate(${t.value.style.layout.grid.xAxis.dataLabels.rotation})`,"text-anchor":t.value.style.layout.grid.xAxis.dataLabels.rotation>0?"start":t.value.style.layout.grid.xAxis.dataLabels.rotation<0?"end":"middle","font-size":i.value.xAxisFontSize,fill:t.value.style.layout.grid.xAxis.dataLabels.color,"font-weight":t.value.style.layout.grid.xAxis.dataLabels.bold?"bold":"normal"},e.toDisplayString(o),9,Ye)]))),256))])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,a)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("line",{x1:o.open.x,x2:o.open.x,y1:o.high.y,y2:o.low.y,stroke:t.value.style.layout.wick.stroke,"stroke-width":t.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,Je),t.value.style.layout.wick.extremity.shape==="circle"?(e.openBlock(),e.createElementBlock("g",Ke,[e.createElementVNode("circle",{cx:o.high.x,cy:o.high.y,r:t.value.style.layout.wick.extremity.size==="auto"?s.value/20:t.value.style.layout.wick.extremity.size,fill:t.value.style.layout.wick.extremity.color},null,8,Qe),e.createElementVNode("circle",{cx:o.low.x,cy:o.low.y,r:t.value.style.layout.wick.extremity.size==="auto"?s.value/20:t.value.style.layout.wick.extremity.size,fill:t.value.style.layout.wick.extremity.color},null,8,Ze)])):e.createCommentVNode("",!0),t.value.style.layout.wick.extremity.shape==="line"?(e.openBlock(),e.createElementBlock("g",et,[e.createElementVNode("line",{x1:o.high.x-(t.value.style.layout.wick.extremity.size==="auto"?s.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,x2:o.high.x+(t.value.style.layout.wick.extremity.size==="auto"?s.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,y1:o.high.y,y2:o.high.y,stroke:t.value.style.layout.wick.extremity.color,"stroke-width":t.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,tt),e.createElementVNode("line",{x1:o.low.x-(t.value.style.layout.wick.extremity.size==="auto"?s.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,x2:o.low.x+(t.value.style.layout.wick.extremity.size==="auto"?s.value*t.value.style.layout.candle.widthRatio:t.value.style.layout.wick.extremity.size)/2,y1:o.low.y,y2:o.low.y,stroke:t.value.style.layout.wick.extremity.color,"stroke-width":t.value.style.layout.wick.strokeWidth,"stroke-linecap":"round"},null,8,lt)])):e.createCommentVNode("",!0)]))),256))]),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,a)=>(e.openBlock(),e.createElementBlock("rect",{x:o.open.x-s.value/2+s.value*(1-t.value.style.layout.candle.widthRatio)/2,y:o.isBullish?o.last.y:o.open.y,height:Math.abs(o.last.y-o.open.y)<=0?1e-4:Math.abs(o.last.y-o.open.y),width:s.value*t.value.style.layout.candle.widthRatio<=0?1e-4:s.value*t.value.style.layout.candle.widthRatio,fill:t.value.style.layout.candle.gradient.underlayer,rx:t.value.style.layout.candle.borderRadius,stroke:"none"},null,8,ot))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,a)=>(e.openBlock(),e.createElementBlock("rect",{x:o.open.x-s.value/2+s.value*(1-t.value.style.layout.candle.widthRatio)/2,y:o.isBullish?o.last.y:o.open.y,height:Math.abs(o.last.y-o.open.y)<=0?1e-4:Math.abs(o.last.y-o.open.y),width:s.value*t.value.style.layout.candle.widthRatio<=0?1e-4:s.value*t.value.style.layout.candle.widthRatio,fill:o.isBullish?t.value.style.layout.candle.gradient.show?`url(#bullish_gradient_${y.value})`:t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.gradient.show?`url(#bearish_gradient_${y.value})`:t.value.style.layout.candle.colors.bearish,rx:t.value.style.layout.candle.borderRadius,stroke:t.value.style.layout.candle.stroke,"stroke-width":t.value.style.layout.candle.strokeWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,at))),256))]),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(o,a)=>(e.openBlock(),e.createElementBlock("rect",{x:r.value.left+a*s.value,y:r.value.top,height:r.value.height<=0?1e-4:r.value.height,width:s.value<=0?1e-4:s.value,fill:E.value===a?e.unref(u.setOpacity)(t.value.style.layout.selector.color,t.value.style.layout.selector.opacity):"transparent",onMouseover:v=>he(a,o),onMouseleave:n[0]||(n[0]=v=>{E.value=void 0,S.value=!1})},null,40,nt))),256))])])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:i.value},void 0,!0)],14,Te)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ut,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(G)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($e.default,{key:6,config:{type:"candlesticks",style:{backgroundColor:t.value.style.backgroundColor,candlesticks:{axis:{color:"#CCCCCC"},candle:{color:"#CCCCCC"}}}}},null,8,["config"])),t.value.style.zoom.show&&k.value?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"chartSlicer",ref:O},[(e.openBlock(),e.createBlock(_e.Slicer,{key:`slicer_${x.value}`,background:t.value.style.zoom.color,borderColor:t.value.style.backgroundColor,fontSize:t.value.style.zoom.fontSize,useResetSlot:t.value.style.zoom.useResetSlot,labelLeft:f.dataset[d.value.start]?f.dataset[d.value.start][0]:f.dataset[0][0],labelRight:f.dataset[d.value.end-1]?f.dataset[d.value.end-1][0]:f.dataset.at(-1)[0],textColor:t.value.style.color,inputColor:t.value.style.zoom.color,selectColor:t.value.style.zoom.highlightColor,max:z.value,min:0,valueStart:d.value.start,valueEnd:d.value.end,start:d.value.start,"onUpdate:start":n[1]||(n[1]=o=>d.value.start=o),end:d.value.end,"onUpdate:end":n[2]||(n[2]=o=>d.value.end=o),onReset:pe},{"reset-action":e.withCtx(({reset:o})=>[e.renderSlot(l.$slots,"reset-action",e.normalizeProps(e.guardReactiveProps({reset:o})),void 0,!0)]),_:3},8,["background","borderColor","fontSize","useResetSlot","labelLeft","labelRight","textColor","inputColor","selectColor","max","valueStart","valueEnd","start","end"]))],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"chartLegend",ref:R},[e.renderSlot(l.$slots,"legend",{legend:c.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:8,ref_key:"source",ref:I,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ce._sfc_main,{show:p.value.showTooltip&&S.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,offsetY:t.value.style.tooltip.offsetY,parent:m.value,content:V.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...A.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...A.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),k.value?(e.openBlock(),e.createBlock(Be.default,{key:9,hideDetails:"",config:{open:p.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ne.DataTable,{key:`table_${U.value}`,colNames:N.value.colNames,head:N.value.head,body:N.value.body,config:N.value.config,title:`${t.value.style.title.text}${t.value.style.title.subtitle.text?` : ${t.value.style.title.subtitle.text}`:""}`,onClose:n[3]||(n[3]=o=>p.value.showTable=!1)},{th:e.withCtx(({th:o})=>[e.createTextVNode(e.toDisplayString(o),1)]),td:e.withCtx(({td:o})=>[e.createElementVNode("div",{innerHTML:o},null,8,rt)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,ze))}},it=Ee._export_sfc(st,[["__scopeId","data-v-bec260db"]]);exports.default=it;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ref as o, onMounted as O, computed as F, watch as V, onBeforeUnmount as re, nextTick as de, openBlock as s, createElementBlock as r, createElementVNode as N, normalizeStyle as d, unref as C, normalizeClass as Ae, createTextVNode as G, toDisplayString as M, renderSlot as v, Fragment as q, renderList as D, normalizeProps as X, guardReactiveProps as j, createCommentVNode as B, createBlock as ve, createSlots as ke, withCtx as P } from "vue";
|
|
2
|
-
import { u as we, c as xe, o as J, e as K, s as Ie, q as Oe, r as Fe } from "./index-
|
|
3
|
-
import { u as Be } from "./useNestedProp-
|
|
4
|
-
import { u as Pe, U as Re } from "./usePrinter-
|
|
5
|
-
import ze from "./vue-ui-skeleton-
|
|
2
|
+
import { u as we, c as xe, o as J, e as K, s as Ie, q as Oe, r as Fe } from "./index-B6Q1Fyk0.js";
|
|
3
|
+
import { u as Be } from "./useNestedProp-DQpuJSz3.js";
|
|
4
|
+
import { u as Pe, U as Re } from "./usePrinter-D8dIU7aG.js";
|
|
5
|
+
import ze from "./vue-ui-skeleton-D7rg5vFC.js";
|
|
6
6
|
import { _ as Ee } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
const Ne = ["id"], Se = ["height"], He = ["data-cell", "height"], Le = {
|
|
8
8
|
key: 2,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DCccP2Kt.cjs"),ae=require("./useNestedProp-DzZoHbI7.cjs"),j=require("./usePrinter-C-C264ik.cjs"),ne=require("./vue-ui-skeleton-Ckb3hRcQ.cjs"),le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=["id"],ie=["height"],ue=["data-cell","height"],se={key:2,ref:"source",dir:"auto"},de={__name:"vue-ui-carousel-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(p,{expose:X}){const l=p,{vue_ui_carousel_table:J}=u.useConfig(),A=e.ref(u.createUid()),I=e.ref(!1),g=e.ref(!!l.dataset);e.onMounted(()=>{P()});function P(){u.objectIsEmpty(l.dataset)?u.error({componentName:"VueUiCarouselTable",type:"dataset"}):((!l.dataset.head||u.objectIsEmpty(l.dataset.head))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"head"}),g.value=!1),(!l.dataset.body||u.objectIsEmpty(l.dataset.body))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"body"}),g.value=!1))}const t=e.computed({get:()=>O(),set:o=>o});function O(){return ae.useNestedProp({userConfig:l.config,defaultConfig:J})}e.watch(()=>l.config,o=>{t.value=O(),P()},{deep:!0}),e.watch(()=>l.dataset,o=>{S()},{deep:!0});const{isPrinting:F,isImaging:N,generatePdf:K,generateImage:R}=j.usePrinter({elementId:`carousel-table_${A.value}`,fileName:t.value.caption.text||"vue-ui-carousel-table"}),s=e.ref({showAnimation:t.value.animation.use}),i=e.ref(null),V=e.ref(null),b=e.ref(null),y=e.ref(null),k=e.ref(0),T=e.ref(0),w=e.ref(!1),C=e.ref(null),c=e.ref(null),$=e.ref(0);function S(){C.value&&(c.value={elements:C.value.getElementsByTagName("tr"),heights:Array.from(C.value.getElementsByTagName("tr")).map(o=>o.getBoundingClientRect().height)})}e.onMounted(S);const Q=e.computed(()=>!c.value||!c.value.heights.length?0:Math.max(...c.value.heights)+k.value+T.value),W=e.computed(()=>l.dataset.body?t.value.tbody.tr.visible<=l.dataset.body.length?t.value.tbody.tr.visible:l.dataset.body.length:0),Y=e.computed(()=>(t.value.tbody.tr.height+t.value.tbody.tr.td.padding.top+t.value.tbody.tr.td.padding.bottom+t.value.tbody.tr.border.size*2)*W.value+k.value+T.value),x=e.ref(0),B=e.ref(null),f=e.ref(0),m=e.ref(!1),H=e.ref(0);e.onMounted(()=>{b.value&&(k.value=b.value.getBoundingClientRect().height),y.value&&(T.value=y.value.getBoundingClientRect().height),s.value.showAnimation&&c.value&&L()}),e.onMounted(()=>{if(i.value){let a=function(){const r=o.getBoundingClientRect().bottom;n.forEach(d=>{d.getBoundingClientRect().top<r?d.style.visibility="hidden":d.style.visibility="visible"})};const o=i.value.querySelector("thead"),n=Array.from(C.value.querySelectorAll("tr"));i.value.addEventListener("scroll",a),a(),e.onBeforeUnmount(()=>{i.value.removeEventListener("scroll",a)})}});function Z(o){I.value=o,H.value+=1}function L(){!B.value&&!m.value&&(B.value=requestAnimationFrame(M))}function _(){if(!i.value)return!1;const{scrollTop:o,scrollHeight:n,clientHeight:a}=i.value;return o+a>=n}function M(o){if(m.value)return;f.value||(f.value=o),o-f.value>=t.value.animation.speedMs&&(x.value+=c.value.heights[$.value],(_()||$.value>=c.value.heights.length)&&(x.value=0,$.value=-1),$.value+=1,i.value&&i.value.scrollTo({top:x.value,behavior:"smooth"}),f.value=o),B.value=requestAnimationFrame(M)}function v(){m.value=!0,cancelAnimationFrame(B.value),B.value=null}e.onBeforeUnmount(v);function h(){!m.value||!s.value.showAnimation||(m.value=!1,f.value=0,L())}function ee(){t.value.animation.pauseOnHover&&v()}const E=e.ref(null);function te(){v(),clearTimeout(E.value)}function q(){clearTimeout(E.value),E.value=setTimeout(h,1e3)}e.watch(()=>t.value.animation.use,o=>{o?(s.value.showAnimation=!0,h()):(s.value.showAnimation=!1,v())});const oe=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{const o=new ResizeObserver(n=>{n.forEach(a=>{w.value=a.contentRect.width<oe.value}),k.value=b.value?b.value.getBoundingClientRect().height:0,T.value=y.value?y.value.getBoundingClientRect().height:0,$.value=0,e.nextTick(()=>{v(),f.value=0,x.value=0,S(),h()})});i.value&&o.observe(i.value)});function U(){K()}function D(){s.value.showAnimation=!s.value.showAnimation,s.value.showAnimation?h():v()}function G(){e.nextTick(()=>{const o=l.dataset.head.map((r,d)=>[[l.dataset.body[d]]]),n=[[t.value.caption.text],[l.dataset.head.map(r=>[r])]].concat(o),a=u.createCsvContent(n);u.downloadCsv({csvContent:a,title:t.value.caption.text||"vue-ui-carousel-table"})})}return X({pauseAnimation:v,resumeAnimation:h,toggleAnimation:D,generateCsv:G,generatePdf:U,generateImage:R}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{style:{position:"relative",overflow:"visible"},ref_key:"chartContainer",ref:V},[e.createElementVNode("div",{ref_key:"tableContainer",ref:i,id:`carousel-table_${A.value}`,style:e.normalizeStyle({height:e.unref(F)||e.unref(N)?"auto":`${Math.max(Y.value,Q.value)}px`,containerType:"inline-size",position:"relative",overflow:"auto",fontFamily:t.value.fontFamily}),class:e.normalizeClass({"vue-ui-responsive":w.value,"is-playing":t.value.scrollbar.hide||!m.value&&t.value.scrollbar.showOnlyOnHover}),onMouseover:n[0]||(n[0]=a=>ee()),onMouseleave:n[1]||(n[1]=a=>h()),onTouchstart:n[2]||(n[2]=a=>te()),onTouchend:n[3]||(n[3]=a=>q()),onTouchcancel:n[4]||(n[4]=a=>q())},[g.value?(e.openBlock(),e.createElementBlock("table",{key:0,class:"vue-data-ui-carousel-table",style:e.normalizeStyle({...t.value.style,border:`${t.value.border.size}px solid ${t.value.border.color}`,width:"100%",borderCollapse:"collapse",backgroundColor:t.value.tbody.backgroundColor})},[e.createElementVNode("caption",{ref_key:"caption",ref:b,class:"vue-data-ui-carousel-table-caption",style:e.normalizeStyle({...t.value.caption.style,fontFamily:"inherit",position:"sticky",top:0,zIndex:2,paddingTop:t.value.caption.padding.top+"px",paddingRight:t.value.caption.padding.right+"px",paddingBottom:t.value.caption.padding.bottom+"px",paddingLeft:t.value.caption.padding.left+"px",boxShadow:w.value?t.value.thead.tr.style.boxShadow:"none",minHeight:"36px",display:o.$slots.caption||t.value.caption.text||t.value.userOptions.show?"":"none"})},[e.createTextVNode(e.toDisplayString(t.value.caption.text&&!o.$slots.caption?t.value.caption.text:"")+" ",1),e.renderSlot(o.$slots,"caption",{},void 0,!0)],4),e.createElementVNode("thead",{style:e.normalizeStyle({...t.value.thead.style,position:"sticky",top:`${o.$slots.caption||t.value.caption.text||t.value.userOptions.show?k.value:0}px`,zIndex:1})},[e.createElementVNode("tr",{ref_key:"tableRow",ref:y,role:"row",style:e.normalizeStyle({...t.value.thead.tr.style,border:t.value.thead.tr.border.size?`${t.value.thead.tr.border.size}px solid ${t.value.thead.tr.border.color}`:"none",boxShadow:w.value?"none":t.value.thead.tr.style.boxShadow}),height:`${t.value.thead.tr.height}px`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.dataset.head,(a,r)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",key:`th_${r}`,style:e.normalizeStyle({...t.value.thead.tr.th.style,border:t.value.thead.tr.th.border.size?`${t.value.thead.tr.th.border.size}px solid ${t.value.thead.tr.th.border.color}`:"none",paddingTop:t.value.thead.tr.th.padding.top+"px",paddingRight:t.value.thead.tr.th.padding.right+"px",paddingBottom:t.value.thead.tr.th.padding.bottom+"px",paddingLeft:t.value.thead.tr.th.padding.left+"px"})},[e.createTextVNode(e.toDisplayString(o.$slots.th?"":a)+" ",1),e.renderSlot(o.$slots,"th",e.normalizeProps(e.guardReactiveProps({th:a,colIndex:r})),void 0,!0)],4))),128))],12,ie)],4),p.dataset.body&&p.dataset.head?(e.openBlock(),e.createElementBlock("tbody",{key:0,ref_key:"tbody",ref:C,style:e.normalizeStyle({clipPath:"inset(0,0,0,0)"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.dataset.body,(a,r)=>(e.openBlock(),e.createElementBlock("tr",{style:e.normalizeStyle({...t.value.tbody.tr.style,border:`${t.value.tbody.tr.border.size}px solid ${t.value.tbody.tr.border.color}`,verticalAlign:"middle"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(d,z)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":p.dataset.head[z]||"",style:e.normalizeStyle({...t.value.tbody.tr.td.style,border:`${t.value.tbody.tr.td.border.size}px solid ${t.value.tbody.tr.td.border.color}`,backgroundColor:e.unref(u.setOpacity)(t.value.tbody.tr.td.style.backgroundColor,r%2===0&&t.value.tbody.tr.td.alternateColor?t.value.tbody.tr.td.alternateOpacity*100:100),paddingTop:t.value.tbody.tr.td.padding.top+"px",paddingRight:t.value.tbody.tr.td.padding.right+"px",paddingBottom:t.value.tbody.tr.td.padding.bottom+"px",paddingLeft:t.value.tbody.tr.td.padding.left+"px",verticalAlign:"middle"}),height:`${t.value.tbody.tr.height}px`},[e.createTextVNode(e.toDisplayString(o.$slots.td?"":d)+" ",1),e.renderSlot(o.$slots,"td",e.normalizeProps(e.guardReactiveProps({td:d,rowIndex:r,colIndex:z})),void 0,!0)],12,ue))),256))],4))),256))],4)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],46,re),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ne.default,{key:0,config:{type:"table"}})),t.value.userOptions.show&&g.value?(e.openBlock(),e.createBlock(j.UserOptions,{ref:"details",key:`user_option_${H.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isPrinting:e.unref(F),isImaging:e.unref(N),uid:A.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:!1,hasLabel:!1,hasAnimation:t.value.userOptions.buttons.animation,isAnimation:!s.value.showAnimation,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:I.value,chartElement:V.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},zIndex:3,offsetX:12,onGeneratePdf:U,onGenerateCsv:G,onGenerateImage:e.unref(R),onToggleAnimation:D,onToggleFullscreen:Z},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionAnimation?{name:"optionAnimation",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionAnimation",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasAnimation","isAnimation","hasFullscreen","isFullscreen","chartElement","position","titles","onGenerateImage"])):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",se,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],512))}},ce=le._export_sfc(de,[["__scopeId","data-v-205ef564"]]);exports.default=ce;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-B5Ugkauv.cjs"),ae=require("./useNestedProp-bZitLnbb.cjs"),j=require("./usePrinter-DtpFEgOX.cjs"),ne=require("./vue-ui-skeleton-E9_X0-sa.cjs"),le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=["id"],ie=["height"],ue=["data-cell","height"],se={key:2,ref:"source",dir:"auto"},de={__name:"vue-ui-carousel-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(p,{expose:X}){const l=p,{vue_ui_carousel_table:J}=u.useConfig(),A=e.ref(u.createUid()),I=e.ref(!1),g=e.ref(!!l.dataset);e.onMounted(()=>{P()});function P(){u.objectIsEmpty(l.dataset)?u.error({componentName:"VueUiCarouselTable",type:"dataset"}):((!l.dataset.head||u.objectIsEmpty(l.dataset.head))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"head"}),g.value=!1),(!l.dataset.body||u.objectIsEmpty(l.dataset.body))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"body"}),g.value=!1))}const t=e.computed({get:()=>O(),set:o=>o});function O(){return ae.useNestedProp({userConfig:l.config,defaultConfig:J})}e.watch(()=>l.config,o=>{t.value=O(),P()},{deep:!0}),e.watch(()=>l.dataset,o=>{S()},{deep:!0});const{isPrinting:F,isImaging:N,generatePdf:K,generateImage:R}=j.usePrinter({elementId:`carousel-table_${A.value}`,fileName:t.value.caption.text||"vue-ui-carousel-table"}),s=e.ref({showAnimation:t.value.animation.use}),i=e.ref(null),V=e.ref(null),b=e.ref(null),y=e.ref(null),k=e.ref(0),T=e.ref(0),w=e.ref(!1),C=e.ref(null),c=e.ref(null),$=e.ref(0);function S(){C.value&&(c.value={elements:C.value.getElementsByTagName("tr"),heights:Array.from(C.value.getElementsByTagName("tr")).map(o=>o.getBoundingClientRect().height)})}e.onMounted(S);const Q=e.computed(()=>!c.value||!c.value.heights.length?0:Math.max(...c.value.heights)+k.value+T.value),W=e.computed(()=>l.dataset.body?t.value.tbody.tr.visible<=l.dataset.body.length?t.value.tbody.tr.visible:l.dataset.body.length:0),Y=e.computed(()=>(t.value.tbody.tr.height+t.value.tbody.tr.td.padding.top+t.value.tbody.tr.td.padding.bottom+t.value.tbody.tr.border.size*2)*W.value+k.value+T.value),x=e.ref(0),B=e.ref(null),f=e.ref(0),m=e.ref(!1),H=e.ref(0);e.onMounted(()=>{b.value&&(k.value=b.value.getBoundingClientRect().height),y.value&&(T.value=y.value.getBoundingClientRect().height),s.value.showAnimation&&c.value&&L()}),e.onMounted(()=>{if(i.value){let a=function(){const r=o.getBoundingClientRect().bottom;n.forEach(d=>{d.getBoundingClientRect().top<r?d.style.visibility="hidden":d.style.visibility="visible"})};const o=i.value.querySelector("thead"),n=Array.from(C.value.querySelectorAll("tr"));i.value.addEventListener("scroll",a),a(),e.onBeforeUnmount(()=>{i.value.removeEventListener("scroll",a)})}});function Z(o){I.value=o,H.value+=1}function L(){!B.value&&!m.value&&(B.value=requestAnimationFrame(M))}function _(){if(!i.value)return!1;const{scrollTop:o,scrollHeight:n,clientHeight:a}=i.value;return o+a>=n}function M(o){if(m.value)return;f.value||(f.value=o),o-f.value>=t.value.animation.speedMs&&(x.value+=c.value.heights[$.value],(_()||$.value>=c.value.heights.length)&&(x.value=0,$.value=-1),$.value+=1,i.value&&i.value.scrollTo({top:x.value,behavior:"smooth"}),f.value=o),B.value=requestAnimationFrame(M)}function v(){m.value=!0,cancelAnimationFrame(B.value),B.value=null}e.onBeforeUnmount(v);function h(){!m.value||!s.value.showAnimation||(m.value=!1,f.value=0,L())}function ee(){t.value.animation.pauseOnHover&&v()}const E=e.ref(null);function te(){v(),clearTimeout(E.value)}function q(){clearTimeout(E.value),E.value=setTimeout(h,1e3)}e.watch(()=>t.value.animation.use,o=>{o?(s.value.showAnimation=!0,h()):(s.value.showAnimation=!1,v())});const oe=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{const o=new ResizeObserver(n=>{n.forEach(a=>{w.value=a.contentRect.width<oe.value}),k.value=b.value?b.value.getBoundingClientRect().height:0,T.value=y.value?y.value.getBoundingClientRect().height:0,$.value=0,e.nextTick(()=>{v(),f.value=0,x.value=0,S(),h()})});i.value&&o.observe(i.value)});function U(){K()}function D(){s.value.showAnimation=!s.value.showAnimation,s.value.showAnimation?h():v()}function G(){e.nextTick(()=>{const o=l.dataset.head.map((r,d)=>[[l.dataset.body[d]]]),n=[[t.value.caption.text],[l.dataset.head.map(r=>[r])]].concat(o),a=u.createCsvContent(n);u.downloadCsv({csvContent:a,title:t.value.caption.text||"vue-ui-carousel-table"})})}return X({pauseAnimation:v,resumeAnimation:h,toggleAnimation:D,generateCsv:G,generatePdf:U,generateImage:R}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{style:{position:"relative",overflow:"visible"},ref_key:"chartContainer",ref:V},[e.createElementVNode("div",{ref_key:"tableContainer",ref:i,id:`carousel-table_${A.value}`,style:e.normalizeStyle({height:e.unref(F)||e.unref(N)?"auto":`${Math.max(Y.value,Q.value)}px`,containerType:"inline-size",position:"relative",overflow:"auto",fontFamily:t.value.fontFamily}),class:e.normalizeClass({"vue-ui-responsive":w.value,"is-playing":t.value.scrollbar.hide||!m.value&&t.value.scrollbar.showOnlyOnHover}),onMouseover:n[0]||(n[0]=a=>ee()),onMouseleave:n[1]||(n[1]=a=>h()),onTouchstart:n[2]||(n[2]=a=>te()),onTouchend:n[3]||(n[3]=a=>q()),onTouchcancel:n[4]||(n[4]=a=>q())},[g.value?(e.openBlock(),e.createElementBlock("table",{key:0,class:"vue-data-ui-carousel-table",style:e.normalizeStyle({...t.value.style,border:`${t.value.border.size}px solid ${t.value.border.color}`,width:"100%",borderCollapse:"collapse",backgroundColor:t.value.tbody.backgroundColor})},[e.createElementVNode("caption",{ref_key:"caption",ref:b,class:"vue-data-ui-carousel-table-caption",style:e.normalizeStyle({...t.value.caption.style,fontFamily:"inherit",position:"sticky",top:0,zIndex:2,paddingTop:t.value.caption.padding.top+"px",paddingRight:t.value.caption.padding.right+"px",paddingBottom:t.value.caption.padding.bottom+"px",paddingLeft:t.value.caption.padding.left+"px",boxShadow:w.value?t.value.thead.tr.style.boxShadow:"none",minHeight:"36px",display:o.$slots.caption||t.value.caption.text||t.value.userOptions.show?"":"none"})},[e.createTextVNode(e.toDisplayString(t.value.caption.text&&!o.$slots.caption?t.value.caption.text:"")+" ",1),e.renderSlot(o.$slots,"caption",{},void 0,!0)],4),e.createElementVNode("thead",{style:e.normalizeStyle({...t.value.thead.style,position:"sticky",top:`${o.$slots.caption||t.value.caption.text||t.value.userOptions.show?k.value:0}px`,zIndex:1})},[e.createElementVNode("tr",{ref_key:"tableRow",ref:y,role:"row",style:e.normalizeStyle({...t.value.thead.tr.style,border:t.value.thead.tr.border.size?`${t.value.thead.tr.border.size}px solid ${t.value.thead.tr.border.color}`:"none",boxShadow:w.value?"none":t.value.thead.tr.style.boxShadow}),height:`${t.value.thead.tr.height}px`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.dataset.head,(a,r)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",key:`th_${r}`,style:e.normalizeStyle({...t.value.thead.tr.th.style,border:t.value.thead.tr.th.border.size?`${t.value.thead.tr.th.border.size}px solid ${t.value.thead.tr.th.border.color}`:"none",paddingTop:t.value.thead.tr.th.padding.top+"px",paddingRight:t.value.thead.tr.th.padding.right+"px",paddingBottom:t.value.thead.tr.th.padding.bottom+"px",paddingLeft:t.value.thead.tr.th.padding.left+"px"})},[e.createTextVNode(e.toDisplayString(o.$slots.th?"":a)+" ",1),e.renderSlot(o.$slots,"th",e.normalizeProps(e.guardReactiveProps({th:a,colIndex:r})),void 0,!0)],4))),128))],12,ie)],4),p.dataset.body&&p.dataset.head?(e.openBlock(),e.createElementBlock("tbody",{key:0,ref_key:"tbody",ref:C,style:e.normalizeStyle({clipPath:"inset(0,0,0,0)"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.dataset.body,(a,r)=>(e.openBlock(),e.createElementBlock("tr",{style:e.normalizeStyle({...t.value.tbody.tr.style,border:`${t.value.tbody.tr.border.size}px solid ${t.value.tbody.tr.border.color}`,verticalAlign:"middle"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,(d,z)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":p.dataset.head[z]||"",style:e.normalizeStyle({...t.value.tbody.tr.td.style,border:`${t.value.tbody.tr.td.border.size}px solid ${t.value.tbody.tr.td.border.color}`,backgroundColor:e.unref(u.setOpacity)(t.value.tbody.tr.td.style.backgroundColor,r%2===0&&t.value.tbody.tr.td.alternateColor?t.value.tbody.tr.td.alternateOpacity*100:100),paddingTop:t.value.tbody.tr.td.padding.top+"px",paddingRight:t.value.tbody.tr.td.padding.right+"px",paddingBottom:t.value.tbody.tr.td.padding.bottom+"px",paddingLeft:t.value.tbody.tr.td.padding.left+"px",verticalAlign:"middle"}),height:`${t.value.tbody.tr.height}px`},[e.createTextVNode(e.toDisplayString(o.$slots.td?"":d)+" ",1),e.renderSlot(o.$slots,"td",e.normalizeProps(e.guardReactiveProps({td:d,rowIndex:r,colIndex:z})),void 0,!0)],12,ue))),256))],4))),256))],4)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],46,re),g.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ne.default,{key:0,config:{type:"table"}})),t.value.userOptions.show&&g.value?(e.openBlock(),e.createBlock(j.UserOptions,{ref:"details",key:`user_option_${H.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isPrinting:e.unref(F),isImaging:e.unref(N),uid:A.value,hasTooltip:!1,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:!1,hasLabel:!1,hasAnimation:t.value.userOptions.buttons.animation,isAnimation:!s.value.showAnimation,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:I.value,chartElement:V.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},zIndex:3,offsetX:12,onGeneratePdf:U,onGenerateCsv:G,onGenerateImage:e.unref(R),onToggleAnimation:D,onToggleFullscreen:Z},e.createSlots({_:2},[o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionAnimation?{name:"optionAnimation",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionAnimation",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:r})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:r})),void 0,!0)]),key:"4"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasAnimation","isAnimation","hasFullscreen","isFullscreen","chartElement","position","titles","onGenerateImage"])):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",se,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],512))}},ce=le._export_sfc(de,[["__scopeId","data-v-205ef564"]]);exports.default=ce;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useCssVars as Ee, computed as m, ref as T, watch as Ue, onMounted as De, openBlock as a, createElementBlock as o, normalizeClass as k, normalizeStyle as h, createBlock as K, createCommentVNode as f, unref as n, createSlots as Ye, withCtx as X, renderSlot as I, normalizeProps as se, guardReactiveProps as ue, createVNode as me, toDisplayString as c, createElementVNode as s, Fragment as g, renderList as _, createTextVNode as J, withKeys as qe, nextTick as ke } from "vue";
|
|
2
|
-
import { u as He, c as We, t as Ke, a as Je, p as P, b as Qe, g as ne, e as Q, d as re, o as Ze, X as et, s as S, w as we, i as G, f as z, F as $e, m as Ce, j as tt, k as V, n as H, q as lt, r as at } from "./index-
|
|
3
|
-
import { u as ot, U as st } from "./usePrinter-
|
|
4
|
-
import ut from "./vue-ui-skeleton-
|
|
5
|
-
import nt from "./BaseIcon-
|
|
6
|
-
import rt from "./vue-ui-accordion-
|
|
7
|
-
import { u as Te } from "./useNestedProp-
|
|
8
|
-
import { _ as it } from "./PackageVersion-
|
|
9
|
-
import { P as ct } from "./PenAndPaper-
|
|
2
|
+
import { u as He, c as We, t as Ke, a as Je, p as P, b as Qe, g as ne, e as Q, d as re, o as Ze, X as et, s as S, w as we, i as G, f as z, F as $e, m as Ce, j as tt, k as V, n as H, q as lt, r as at } from "./index-B6Q1Fyk0.js";
|
|
3
|
+
import { u as ot, U as st } from "./usePrinter-D8dIU7aG.js";
|
|
4
|
+
import ut from "./vue-ui-skeleton-D7rg5vFC.js";
|
|
5
|
+
import nt from "./BaseIcon-DCE3wRiG.js";
|
|
6
|
+
import rt from "./vue-ui-accordion-BOHicozd.js";
|
|
7
|
+
import { u as Te } from "./useNestedProp-DQpuJSz3.js";
|
|
8
|
+
import { _ as it } from "./PackageVersion-S7OD_s5u.js";
|
|
9
|
+
import { P as ct } from "./PenAndPaper-BxJZd7k9.js";
|
|
10
10
|
import { _ as dt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
const vt = ["id"], yt = {
|
|
12
12
|
key: 1,
|