vue-data-ui 2.4.45 → 2.4.46
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-DExBMFtJ.js → Arrow-CfjJrWHe.js} +1 -1
- package/dist/{Arrow-dxEccWUa.cjs → Arrow-iQXl1f2j.cjs} +1 -1
- package/dist/{BaseIcon-DpLJi6ci.js → BaseIcon-BA9HUUaA.js} +1 -1
- package/dist/{BaseIcon-DUokibJ1.cjs → BaseIcon-Cy5dUKeV.cjs} +1 -1
- package/dist/{DataTable-aoauqoko.cjs → DataTable-Cj3bRKxc.cjs} +1 -1
- package/dist/{DataTable-NGi-FgLM.js → DataTable-CoZ6Xn0I.js} +2 -2
- package/dist/{Legend-DHE2CFkm.cjs → Legend-CEDlovx8.cjs} +1 -1
- package/dist/{Legend-DRozxv9L.js → Legend-DJlRifH8.js} +1 -1
- package/dist/{PackageVersion-1JWV5loe.cjs → PackageVersion-DL3c2r_c.cjs} +1 -1
- package/dist/{PackageVersion-CTMY4zeY.js → PackageVersion-TpOTCEFd.js} +1 -1
- package/dist/{PenAndPaper-C6mnwE-L.cjs → PenAndPaper-DgVnjC40.cjs} +1 -1
- package/dist/{PenAndPaper-DJ_d10S-.js → PenAndPaper-cjAU-PUf.js} +3 -3
- package/dist/{Shape-C-sY_hlc.js → Shape--6BralbW.js} +1 -1
- package/dist/{Shape-rA2az7tR.cjs → Shape-DYtj-lqw.cjs} +1 -1
- package/dist/{Slicer-D4SO7odF.js → Slicer-6DPtWIL0.js} +2 -2
- package/dist/{Slicer-CJsmloDN.cjs → Slicer-dbxY46t5.cjs} +1 -1
- package/dist/{Title-Coit3NcT.js → Title-BavNfnuK.js} +1 -1
- package/dist/{Title-DkbnpMvf.cjs → Title-a1zU7S4D.cjs} +1 -1
- package/dist/{Tooltip-B8L4NDsX.cjs → Tooltip-BBmtXJ3a.cjs} +1 -1
- package/dist/{Tooltip-BBgfUr4a.js → Tooltip-CK5rPyXN.js} +1 -1
- package/dist/{index-Cm2_6s9o.js → index-D6Fux0KL.js} +2 -1
- package/dist/index-DQqE9z_u.cjs +9 -0
- package/dist/style.css +1 -1
- package/dist/types/vue-data-ui.d.cts +2 -0
- package/dist/types/vue-data-ui.d.ts +2 -0
- package/dist/{useNestedProp-BYPZJNhi.js → useNestedProp-CcZBkd4B.js} +1 -1
- package/dist/{useNestedProp-zkJOoemW.cjs → useNestedProp-DqEFKuPz.cjs} +1 -1
- package/dist/{usePrinter-ardO_DNo.cjs → usePrinter-1s8-9A7g.cjs} +1 -1
- package/dist/{usePrinter-Cx8U1e30.js → usePrinter-BfVNshkJ.js} +1 -1
- package/dist/{vue-data-ui-Blpxr4_M.js → vue-data-ui-BZHviOU-.js} +60 -60
- package/dist/{vue-data-ui-B8Lvjc4V.cjs → vue-data-ui-nyvnXOBP.cjs} +1 -1
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-CqmOoIA2.cjs → vue-ui-3d-bar-Amvwu6fD.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-DvitE1K_.js → vue-ui-3d-bar-BAYRAgaW.js} +9 -9
- package/dist/{vue-ui-accordion-JS5d0ZPi.cjs → vue-ui-accordion-CNQ8JBuy.cjs} +1 -1
- package/dist/{vue-ui-accordion-CxrNF8BI.js → vue-ui-accordion-CyCBwLDa.js} +3 -3
- package/dist/{vue-ui-age-pyramid-Ti2L5N92.js → vue-ui-age-pyramid-BWg8L30G.js} +10 -10
- package/dist/{vue-ui-age-pyramid-CRP36JDm.cjs → vue-ui-age-pyramid-Dx-k5K7o.cjs} +1 -1
- package/dist/{vue-ui-annotator-DtL3BbOJ.cjs → vue-ui-annotator-Bj3j-VvQ.cjs} +1 -1
- package/dist/{vue-ui-annotator-HNK_5tWo.js → vue-ui-annotator-Drlh2nsy.js} +1 -1
- package/dist/{vue-ui-bullet-D3WmBrm4.js → vue-ui-bullet-CskzW_No.js} +8 -8
- package/dist/{vue-ui-bullet-DEUwbTdx.cjs → vue-ui-bullet-KJKcyE57.cjs} +1 -1
- package/dist/{vue-ui-candlestick-B5okP_Jf.js → vue-ui-candlestick-9ARbLuQr.js} +11 -11
- package/dist/{vue-ui-candlestick-C5bTH9oE.cjs → vue-ui-candlestick-Bcem-LL5.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-BgKL0rnF.js → vue-ui-carousel-table-BgabRnN7.js} +4 -4
- package/dist/{vue-ui-carousel-table-Bt2xx2b5.cjs → vue-ui-carousel-table-CCzXqrOD.cjs} +1 -1
- package/dist/{vue-ui-chestnut-DDsFxoUr.js → vue-ui-chestnut-B7q0vmXj.js} +8 -8
- package/dist/{vue-ui-chestnut-D5XfSvCG.cjs → vue-ui-chestnut-BEKG7vJs.cjs} +1 -1
- package/dist/{vue-ui-cursor-B2NOd5i-.js → vue-ui-cursor-BW6KFYih.js} +2 -2
- package/dist/{vue-ui-cursor-CSBJgZLu.cjs → vue-ui-cursor-gRV29a6z.cjs} +1 -1
- package/dist/{vue-ui-dashboard-u-Gt08KE.js → vue-ui-dashboard-B1GgQpTW.js} +2 -2
- package/dist/{vue-ui-dashboard-C6MJN9kG.cjs → vue-ui-dashboard-BU3gco0W.cjs} +1 -1
- package/dist/{vue-ui-digits-B4fzfTox.cjs → vue-ui-digits-B-de-AoF.cjs} +1 -1
- package/dist/{vue-ui-digits-DCXyjW_e.js → vue-ui-digits-pTJfyk6w.js} +2 -2
- package/dist/{vue-ui-donut-BvASz63R.js → vue-ui-donut-3zJvxMAI.js} +11 -11
- package/dist/{vue-ui-donut-CaJSY2gj.cjs → vue-ui-donut-CV4QfMM6.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-DrnLlHPS.cjs → vue-ui-donut-evolution-CHmMquL3.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-DcPk33e8.js → vue-ui-donut-evolution-DwWDUev5.js} +11 -11
- package/dist/{vue-ui-dumbbell-D918XYc8.js → vue-ui-dumbbell-BupMAioY.js} +10 -10
- package/dist/{vue-ui-dumbbell-8v-xIlsx.cjs → vue-ui-dumbbell-CwKisd1V.cjs} +1 -1
- package/dist/{vue-ui-flow-BBmnTxVE.cjs → vue-ui-flow-DjaSPlMc.cjs} +1 -1
- package/dist/{vue-ui-flow-DQ5q2b1Y.js → vue-ui-flow-Gio5LZfS.js} +9 -9
- package/dist/{vue-ui-funnel-v5WCHaw6.js → vue-ui-funnel-B20LEzYC.js} +8 -8
- package/dist/{vue-ui-funnel-CmERxe4h.cjs → vue-ui-funnel-CqcM5pkO.cjs} +1 -1
- package/dist/{vue-ui-galaxy-8xWYo-xy.cjs → vue-ui-galaxy-B6LzA_6c.cjs} +1 -1
- package/dist/{vue-ui-galaxy-COSx0c89.js → vue-ui-galaxy-BlqZ7ul1.js} +11 -11
- package/dist/vue-ui-gauge-C5OATvE7.cjs +1 -0
- package/dist/{vue-ui-gauge-CWnGYcFD.js → vue-ui-gauge-C6-5yI2V.js} +168 -168
- package/dist/{vue-ui-gizmo-DUO_TpvK.cjs → vue-ui-gizmo-CLNN3Udr.cjs} +1 -1
- package/dist/{vue-ui-gizmo-ByuFn-0N.js → vue-ui-gizmo-CsyW__L-.js} +3 -3
- package/dist/{vue-ui-heatmap-DiON-CAI.cjs → vue-ui-heatmap-DLJKnqc8.cjs} +1 -1
- package/dist/{vue-ui-heatmap-UoKourVZ.js → vue-ui-heatmap-DlyP8IiX.js} +10 -10
- package/dist/{vue-ui-history-plot-CkxvdQeV.js → vue-ui-history-plot-BcxMCSa5.js} +11 -11
- package/dist/{vue-ui-history-plot-CjVySabp.cjs → vue-ui-history-plot-DGFH-CY8.cjs} +1 -1
- package/dist/{vue-ui-kpi-BRwkUBxs.js → vue-ui-kpi-BL3vZgx7.js} +3 -3
- package/dist/{vue-ui-kpi-DYHGPjrp.cjs → vue-ui-kpi-pnZp2CvF.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-oviO8Ueo.cjs → vue-ui-mini-loader-BNKPERuk.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-Cbl4ydLu.js → vue-ui-mini-loader-BwmbFCFV.js} +2 -2
- package/dist/{vue-ui-molecule-DM_mX72q.js → vue-ui-molecule-BbpCIJe5.js} +11 -11
- package/dist/{vue-ui-molecule-CX1M509E.cjs → vue-ui-molecule-CZ6KhD_5.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-fuqAjpvg.cjs → vue-ui-mood-radar-9ShpSF_Q.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-Bzsba8qo.js → vue-ui-mood-radar-DQ-UPdoZ.js} +11 -11
- package/dist/{vue-ui-nested-donuts-DfHtC4XP.cjs → vue-ui-nested-donuts-4-Y7Vn9p.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-BG84mskb.js → vue-ui-nested-donuts-B0RhrWpS.js} +11 -11
- package/dist/{vue-ui-onion-gt77JCbM.cjs → vue-ui-onion-DzLCbEcB.cjs} +1 -1
- package/dist/{vue-ui-onion-DpFx1Oy9.js → vue-ui-onion-kMrmbJZm.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-xJTddxji.cjs → vue-ui-parallel-coordinate-plot-BGfy-8GQ.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-CQG_anr7.js → vue-ui-parallel-coordinate-plot-CdWo856d.js} +12 -12
- package/dist/{vue-ui-quadrant-Cddob9c3.js → vue-ui-quadrant-D3OhIIfq.js} +12 -12
- package/dist/{vue-ui-quadrant-D0YgwhwW.cjs → vue-ui-quadrant-D8HGb-Gb.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-DTEubspa.js → vue-ui-quick-chart-BWwbRuD2.js} +9 -9
- package/dist/{vue-ui-quick-chart-CLzNpIFU.cjs → vue-ui-quick-chart-BqJpkpjf.cjs} +1 -1
- package/dist/{vue-ui-radar--uexaa6p.js → vue-ui-radar-BsAiDMi7.js} +12 -12
- package/dist/{vue-ui-radar-BTh9qZ2p.cjs → vue-ui-radar-Ds66K46C.cjs} +1 -1
- package/dist/{vue-ui-rating-BQuZA9UU.js → vue-ui-rating-CcyKPjmP.js} +2 -2
- package/dist/{vue-ui-rating-Dyjk2dub.cjs → vue-ui-rating-ClQjIZ78.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-FtGlV4Ne.cjs → vue-ui-relation-circle-DI24q9Zq.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-C8NYrTHA.js → vue-ui-relation-circle-eOtVdQOL.js} +7 -7
- package/dist/{vue-ui-rings-FEIPR_dS.js → vue-ui-rings-9f1E8ktr.js} +11 -11
- package/dist/{vue-ui-rings-ClJRYeFC.cjs → vue-ui-rings-GJ-RllpC.cjs} +1 -1
- package/dist/{vue-ui-scatter-vYxSs8Gf.cjs → vue-ui-scatter-B7Tm9kTK.cjs} +1 -1
- package/dist/{vue-ui-scatter-CzbgC6ep.js → vue-ui-scatter-DjOO4sai.js} +12 -12
- package/dist/{vue-ui-screenshot-CVQCw0B1.cjs → vue-ui-screenshot-DQd-yU3g.cjs} +1 -1
- package/dist/{vue-ui-screenshot-IaxgY5qE.js → vue-ui-screenshot-k2mC030r.js} +1 -1
- package/dist/{vue-ui-skeleton-DleyAXe1.cjs → vue-ui-skeleton-DYKuE1ZW.cjs} +1 -1
- package/dist/{vue-ui-skeleton-BUS6A44x.js → vue-ui-skeleton-wHDgl1XV.js} +3 -3
- package/dist/{vue-ui-smiley-5CVa-rQU.js → vue-ui-smiley-C02LWJwt.js} +2 -2
- package/dist/{vue-ui-smiley-BTTXNPGY.cjs → vue-ui-smiley-Cds8LoUR.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-CZAgof3m.cjs → vue-ui-spark-trend-5uxFq2pM.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-D9ww-Cv5.js → vue-ui-spark-trend-D0shfbAA.js} +5 -5
- package/dist/{vue-ui-sparkbar-BFsdfuNO.cjs → vue-ui-sparkbar-CGH0sUyT.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-DKeLvkHa.js → vue-ui-sparkbar-DmPdCxF5.js} +4 -4
- package/dist/{vue-ui-sparkgauge-B_bIpe_O.cjs → vue-ui-sparkgauge-BfyVKfCr.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-DLpPuJdG.js → vue-ui-sparkgauge-CqJz8p6J.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-RoW45LV8.cjs → vue-ui-sparkhistogram-B-PxzLAe.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-BA8QV7Cu.js → vue-ui-sparkhistogram-vJBW3am7.js} +5 -5
- package/dist/{vue-ui-sparkline-BwOtPPij.js → vue-ui-sparkline-BoHbGcLX.js} +4 -4
- package/dist/{vue-ui-sparkline-BggHSfaz.cjs → vue-ui-sparkline-D_RzcAKQ.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-DCS6RRgN.js → vue-ui-sparkstackbar-C6lyJ3Yf.js} +5 -5
- package/dist/{vue-ui-sparkstackbar-Uv_p8v9c.cjs → vue-ui-sparkstackbar-DOqRrV5Q.cjs} +1 -1
- package/dist/{vue-ui-stackbar-zcfxba5s.js → vue-ui-stackbar-Drzs1Eyl.js} +12 -12
- package/dist/{vue-ui-stackbar-BqKNaGrf.cjs → vue-ui-stackbar-aGhn0Cot.cjs} +1 -1
- package/dist/{vue-ui-strip-plot-NykStkP9.js → vue-ui-strip-plot-D1OnXpSS.js} +11 -11
- package/dist/{vue-ui-strip-plot-J5SSJPyl.cjs → vue-ui-strip-plot-VyISwa5R.cjs} +1 -1
- package/dist/{vue-ui-table-DWPKVbYC.cjs → vue-ui-table-DLPofj0y.cjs} +1 -1
- package/dist/{vue-ui-table-DhRjI7oG.js → vue-ui-table-H2AWSu1t.js} +1 -1
- package/dist/{vue-ui-table-heatmap-CT5nGoW-.js → vue-ui-table-heatmap-D2Yub14q.js} +4 -4
- package/dist/{vue-ui-table-heatmap-GvLTOGcB.cjs → vue-ui-table-heatmap-wvpaD4ir.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-Ba_Ucvgb.js → vue-ui-table-sparkline-DUTGELZ3.js} +5 -5
- package/dist/{vue-ui-table-sparkline-CBFEknMF.cjs → vue-ui-table-sparkline-Doj1Qy-g.cjs} +1 -1
- package/dist/{vue-ui-thermometer-sqA0TGTi.cjs → vue-ui-thermometer-B-0y1mlR.cjs} +1 -1
- package/dist/{vue-ui-thermometer-C11VSZfb.js → vue-ui-thermometer-yoXfkNqw.js} +7 -7
- package/dist/{vue-ui-timer-CcBNysNG.cjs → vue-ui-timer-BmdGu2OH.cjs} +1 -1
- package/dist/{vue-ui-timer-lwjayVn0.js → vue-ui-timer-CrmRh82y.js} +5 -5
- package/dist/{vue-ui-tiremarks-Jz80HKpg.js → vue-ui-tiremarks--dQqSUAB.js} +7 -7
- package/dist/{vue-ui-tiremarks-FBnh0R_Z.cjs → vue-ui-tiremarks-BTKsqFx9.cjs} +1 -1
- package/dist/{vue-ui-treemap-7YFJ-Pb9.cjs → vue-ui-treemap-CoHv7WB0.cjs} +1 -1
- package/dist/{vue-ui-treemap-B_qVGTnP.js → vue-ui-treemap-xf0R6iJv.js} +11 -11
- package/dist/{vue-ui-vertical-bar-5MwcqOTN.js → vue-ui-vertical-bar-CgyxeziQ.js} +11 -11
- package/dist/{vue-ui-vertical-bar-DGuvFK2h.cjs → vue-ui-vertical-bar-DkEKT7jg.cjs} +1 -1
- package/dist/{vue-ui-waffle-B0JbRRUv.js → vue-ui-waffle-BsWXzCto.js} +11 -11
- package/dist/{vue-ui-waffle-C0F8eexl.cjs → vue-ui-waffle-CkwF305q.cjs} +1 -1
- package/dist/{vue-ui-wheel-pQBqSI5z.js → vue-ui-wheel-BDG6vuLJ.js} +7 -7
- package/dist/{vue-ui-wheel-DP9XwVGM.cjs → vue-ui-wheel-OyKC9U09.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-D39_9P7v.js → vue-ui-word-cloud-D-bzY5ks.js} +10 -10
- package/dist/{vue-ui-word-cloud-CmKH64gk.cjs → vue-ui-word-cloud-NJ7fgwoa.cjs} +1 -1
- package/dist/{vue-ui-xy-DRYbR_nu.js → vue-ui-xy-BRVzv2LA.js} +14 -14
- package/dist/{vue-ui-xy-2m8k1EUB.cjs → vue-ui-xy-ClUJG6UI.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-CywB2tWN.cjs → vue-ui-xy-canvas-CH-U7nNa.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-DZib_307.js → vue-ui-xy-canvas-CvLYBiAC.js} +11 -11
- package/package.json +1 -1
- package/dist/index-DuDeHJyK.cjs +0 -9
- package/dist/vue-ui-gauge-CYth7Lci.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-DuDeHJyK.cjs"),W=require("./useResponsive-BJ7DTGpm.cjs"),ae=require("./Title-DkbnpMvf.cjs"),H=require("./usePrinter-ardO_DNo.cjs"),oe=require("./Tooltip-B8L4NDsX.cjs"),se=require("./DataTable-aoauqoko.cjs"),re=require("./vue-ui-skeleton-DleyAXe1.cjs"),ie=require("./vue-ui-accordion-JS5d0ZPi.cjs"),X=require("./useNestedProp-zkJOoemW.cjs"),ue=require("./PackageVersion-1JWV5loe.cjs"),ne=require("./PenAndPaper-C6mnwE-L.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"],Fe=["x","y","width","height","fill","onMouseover"],Ie={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 n=T,{vue_ui_age_pyramid:Y}=s.useConfig(),m=e.computed(()=>!!n.dataset&&n.dataset.length),c=e.ref(s.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:n.config,defaultConfig:Y});return l.theme?{...X.useNestedProp({userConfig:s.themes.vue_ui_age_pyramid[l.theme]||n.config,defaultConfig:l})}:l}e.watch(()=>n.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(s.objectIsEmpty(n.dataset)&&s.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:F,isImaging:I,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}),r=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(()=>n.dataset.map(l=>t.value.style.layout.dataLabels.yAxis.display==="age"?l[1]:l[0])),h=e.computed(()=>{const l=Z(b.value/5),i=[],a=[];for(let o=0;o<=5;o+=1){const u=l*o,U=l*(o-5);i.push({value:u,x:r.value.left+r.value.width/2+t.value.style.layout.centerSlit.width+u/b.value*r.value.leftChart.width}),a.push({value:Math.abs(U),x:r.value.left+r.value.width/2+U/b.value*r.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 b=e.computed(()=>Math.max(...n.dataset.flatMap(l=>l.slice(-2).map(i=>s.checkNaN(i))))),f=e.computed(()=>n.dataset.length),ee=e.computed(()=>n.dataset.map(l=>({segment:l[0],age:l[1],left:{value:l[2],proportionToMax:l[2]/b.value},right:{value:l[3],proportionToMax:l[3]/b.value}}))),p=e.computed(()=>ee.value.map((l,i)=>{const a=r.value.top+r.value.height/f.value*i,o=r.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:r.value.leftChart.right-l.left.proportionToMax*r.value.leftChart.width,width:s.checkNaN(l.left.proportionToMax*r.value.leftChart.width),height:o},right:{...l.right,y:a,color:t.value.style.layout.bars.right.color,x:r.value.rightChart.left,width:s.checkNaN(l.right.proportionToMax*r.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(s.isFunction(a)&&s.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 u=p.value[l];o+=`<div><b>${u.segment}</b></div>`,o+=`<div>${t.value.translations.age}: ${s.applyDataLabel(t.value.style.layout.dataLabels.yAxis.formatter,s.checkNaN(u.age),s.dataLabel({v:s.checkNaN(u.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>${s.applyDataLabel(t.value.style.layout.dataLabels.xAxis.formatter,s.checkNaN(u.left.value),s.dataLabel({v:s.checkNaN(u.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>${s.applyDataLabel(t.value.style.layout.dataLabels.xAxis.formatter,s.checkNaN(u.right.value),s.dataLabel({v:s.checkNaN(u.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>${s.applyDataLabel(t.value.style.layout.dataLabels.xAxis.formatter,s.checkNaN(u.right.value)+s.checkNaN(u.left.value),s.dataLabel({v:s.checkNaN(u.right.value)+s.checkNaN(u.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=n.dataset.map(u=>[u[0],u[1],u[2],u[3],u[2]+u[3]]),a=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(i),o=s.createCsvContent(a);s.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=n.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}}),g=e.ref(!1);function le(l){g.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 ${g.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(ne.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(I),isPrinting:e.unref(F),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:g.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(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.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(ue._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(s.setOpacity)(e.unref(s.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(s.setOpacity)(e.unref(s.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(s.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:r.value.left,y:r.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:r.value.right,y:r.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:r.value.centerX,y:r.value.top+r.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(s.applyDataLabel)(t.value.style.layout.dataLabels.yAxis.formatter,a,e.unref(s.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:r.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:r.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:r.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:r.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:r.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:r.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:r.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(s.applyDataLabel)(t.value.style.layout.dataLabels.xAxis.formatter,a.value/t.value.style.layout.dataLabels.xAxis.scale,e.unref(s.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:r.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:r.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:r.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(s.applyDataLabel)(t.value.style.layout.dataLabels.xAxis.formatter,a.value/t.value.style.layout.dataLabels.xAxis.scale,e.unref(s.dataLabel)({v:a.value/t.value.style.layout.dataLabels.xAxis.scale}),{datapoint:a,seriesIndex:o})),9,Pe)]))),256)),e.createElementVNode("text",{x:r.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:r.value.left,y:r.value.top+r.value.height/f.value*o-t.value.style.layout.bars.gap/2,width:r.value.width<=0?1e-4:r.value.width,height:r.value.height/f.value<=0?1e-4:r.value.height/f.value,fill:x.value!==null&&x.value===o?e.unref(s.setOpacity)(t.value.style.highlighter.color,t.value.style.highlighter.opacity):"transparent",onMouseover:u=>te(o,a),onMouseleave:i[0]||(i[0]=u=>{x.value=null,C.value=!1})},null,40,Fe)]))),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",Ie,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(F)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(re.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,isFullscreen:g.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","isFullscreen","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(se.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-49080726"]]);exports.default=Me;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-DQqE9z_u.cjs"),W=require("./useResponsive-BJ7DTGpm.cjs"),ae=require("./Title-a1zU7S4D.cjs"),H=require("./usePrinter-1s8-9A7g.cjs"),oe=require("./Tooltip-BBmtXJ3a.cjs"),se=require("./DataTable-Cj3bRKxc.cjs"),re=require("./vue-ui-skeleton-DYKuE1ZW.cjs"),ie=require("./vue-ui-accordion-CNQ8JBuy.cjs"),X=require("./useNestedProp-DqEFKuPz.cjs"),ue=require("./PackageVersion-DL3c2r_c.cjs"),ne=require("./PenAndPaper-DgVnjC40.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"],Fe=["x","y","width","height","fill","onMouseover"],Ie={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 n=T,{vue_ui_age_pyramid:Y}=s.useConfig(),m=e.computed(()=>!!n.dataset&&n.dataset.length),c=e.ref(s.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:n.config,defaultConfig:Y});return l.theme?{...X.useNestedProp({userConfig:s.themes.vue_ui_age_pyramid[l.theme]||n.config,defaultConfig:l})}:l}e.watch(()=>n.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(s.objectIsEmpty(n.dataset)&&s.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:F,isImaging:I,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}),r=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(()=>n.dataset.map(l=>t.value.style.layout.dataLabels.yAxis.display==="age"?l[1]:l[0])),h=e.computed(()=>{const l=Z(b.value/5),i=[],a=[];for(let o=0;o<=5;o+=1){const u=l*o,U=l*(o-5);i.push({value:u,x:r.value.left+r.value.width/2+t.value.style.layout.centerSlit.width+u/b.value*r.value.leftChart.width}),a.push({value:Math.abs(U),x:r.value.left+r.value.width/2+U/b.value*r.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 b=e.computed(()=>Math.max(...n.dataset.flatMap(l=>l.slice(-2).map(i=>s.checkNaN(i))))),f=e.computed(()=>n.dataset.length),ee=e.computed(()=>n.dataset.map(l=>({segment:l[0],age:l[1],left:{value:l[2],proportionToMax:l[2]/b.value},right:{value:l[3],proportionToMax:l[3]/b.value}}))),p=e.computed(()=>ee.value.map((l,i)=>{const a=r.value.top+r.value.height/f.value*i,o=r.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:r.value.leftChart.right-l.left.proportionToMax*r.value.leftChart.width,width:s.checkNaN(l.left.proportionToMax*r.value.leftChart.width),height:o},right:{...l.right,y:a,color:t.value.style.layout.bars.right.color,x:r.value.rightChart.left,width:s.checkNaN(l.right.proportionToMax*r.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(s.isFunction(a)&&s.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 u=p.value[l];o+=`<div><b>${u.segment}</b></div>`,o+=`<div>${t.value.translations.age}: ${s.applyDataLabel(t.value.style.layout.dataLabels.yAxis.formatter,s.checkNaN(u.age),s.dataLabel({v:s.checkNaN(u.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>${s.applyDataLabel(t.value.style.layout.dataLabels.xAxis.formatter,s.checkNaN(u.left.value),s.dataLabel({v:s.checkNaN(u.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>${s.applyDataLabel(t.value.style.layout.dataLabels.xAxis.formatter,s.checkNaN(u.right.value),s.dataLabel({v:s.checkNaN(u.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>${s.applyDataLabel(t.value.style.layout.dataLabels.xAxis.formatter,s.checkNaN(u.right.value)+s.checkNaN(u.left.value),s.dataLabel({v:s.checkNaN(u.right.value)+s.checkNaN(u.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=n.dataset.map(u=>[u[0],u[1],u[2],u[3],u[2]+u[3]]),a=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(i),o=s.createCsvContent(a);s.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=n.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}}),g=e.ref(!1);function le(l){g.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 ${g.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(ne.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(I),isPrinting:e.unref(F),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:g.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(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":g.value,"vue-data-ui-fulscreen--off":!g.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(ue._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(s.setOpacity)(e.unref(s.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(s.setOpacity)(e.unref(s.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(s.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:r.value.left,y:r.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:r.value.right,y:r.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:r.value.centerX,y:r.value.top+r.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(s.applyDataLabel)(t.value.style.layout.dataLabels.yAxis.formatter,a,e.unref(s.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:r.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:r.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:r.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:r.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:r.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:r.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:r.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(s.applyDataLabel)(t.value.style.layout.dataLabels.xAxis.formatter,a.value/t.value.style.layout.dataLabels.xAxis.scale,e.unref(s.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:r.value.bottom+t.value.style.layout.dataLabels.xAxis.fontSize/2,y2:r.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:r.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(s.applyDataLabel)(t.value.style.layout.dataLabels.xAxis.formatter,a.value/t.value.style.layout.dataLabels.xAxis.scale,e.unref(s.dataLabel)({v:a.value/t.value.style.layout.dataLabels.xAxis.scale}),{datapoint:a,seriesIndex:o})),9,Pe)]))),256)),e.createElementVNode("text",{x:r.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:r.value.left,y:r.value.top+r.value.height/f.value*o-t.value.style.layout.bars.gap/2,width:r.value.width<=0?1e-4:r.value.width,height:r.value.height/f.value<=0?1e-4:r.value.height/f.value,fill:x.value!==null&&x.value===o?e.unref(s.setOpacity)(t.value.style.highlighter.color,t.value.style.highlighter.opacity):"transparent",onMouseover:u=>te(o,a),onMouseleave:i[0]||(i[0]=u=>{x.value=null,C.value=!1})},null,40,Fe)]))),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",Ie,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(F)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(re.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,isFullscreen:g.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","isFullscreen","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(se.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-49080726"]]);exports.default=Me;
|
|
@@ -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-DQqE9z_u.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-D6Fux0KL.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,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, D 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, D as be, d as ke, i as $, f as B, X as we, t as xe } from "./index-D6Fux0KL.js";
|
|
3
|
+
import { u as J } from "./useNestedProp-CcZBkd4B.js";
|
|
4
|
+
import { _ as _e } from "./Title-BavNfnuK.js";
|
|
5
|
+
import { L as Ce } from "./Legend-DJlRifH8.js";
|
|
6
|
+
import { u as Le, U as $e } from "./usePrinter-BfVNshkJ.js";
|
|
7
|
+
import { _ as Be } from "./PackageVersion-TpOTCEFd.js";
|
|
8
|
+
import { P as Ae } from "./PenAndPaper-cjAU-PUf.js";
|
|
9
|
+
import Pe from "./vue-ui-skeleton-wHDgl1XV.js";
|
|
10
10
|
import { _ as Fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
const Se = ["id"], Ie = {
|
|
12
12
|
key: 1,
|
|
@@ -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-DQqE9z_u.cjs"),V=require("./useNestedProp-DqEFKuPz.cjs"),j=require("./Title-a1zU7S4D.cjs"),G=require("./Legend-CEDlovx8.cjs"),$=require("./usePrinter-1s8-9A7g.cjs"),X=require("./PackageVersion-DL3c2r_c.cjs"),Y=require("./PenAndPaper-DgVnjC40.cjs"),J=require("./vue-ui-skeleton-DYKuE1ZW.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,16 +1,16 @@
|
|
|
1
1
|
import { computed as f, ref as n, watch as $e, onMounted as je, onBeforeUnmount as He, nextTick as V, openBlock as s, createElementBlock as u, normalizeClass as Ce, normalizeStyle as _e, createBlock as _, createCommentVNode as v, unref as g, createSlots as Ye, withCtx as m, renderSlot as p, normalizeProps as T, guardReactiveProps as I, createVNode as ze, createElementVNode as r, Fragment as F, renderList as L, toDisplayString as O, createTextVNode as qe } from "vue";
|
|
2
|
-
import { u as Je, c as Ke, t as Qe, C as Se, o as Ze, e as z, D as et, v as B, X as tt, w as j, E as lt, s as ot, x as at, y as st, q as ut, r as it, F as Ne } from "./index-
|
|
2
|
+
import { u as Je, c as Ke, t as Qe, C as Se, o as Ze, e as z, D as et, v as B, X as tt, w as j, E as lt, s as ot, x as at, y as st, q as ut, r as it, F as Ne } from "./index-D6Fux0KL.js";
|
|
3
3
|
import { t as nt, u as rt } from "./useResponsive-CoxXLe23.js";
|
|
4
|
-
import { _ as dt } from "./Title-
|
|
5
|
-
import { u as vt, U as yt } from "./usePrinter-
|
|
6
|
-
import { _ as ct } from "./Tooltip-
|
|
7
|
-
import { D as ht } from "./DataTable-
|
|
8
|
-
import ft from "./vue-ui-skeleton-
|
|
9
|
-
import { S as pt } from "./Slicer-
|
|
10
|
-
import gt from "./vue-ui-accordion-
|
|
11
|
-
import { u as Ae } from "./useNestedProp-
|
|
12
|
-
import { _ as mt } from "./PackageVersion-
|
|
13
|
-
import { P as xt } from "./PenAndPaper-
|
|
4
|
+
import { _ as dt } from "./Title-BavNfnuK.js";
|
|
5
|
+
import { u as vt, U as yt } from "./usePrinter-BfVNshkJ.js";
|
|
6
|
+
import { _ as ct } from "./Tooltip-CK5rPyXN.js";
|
|
7
|
+
import { D as ht } from "./DataTable-CoZ6Xn0I.js";
|
|
8
|
+
import ft from "./vue-ui-skeleton-wHDgl1XV.js";
|
|
9
|
+
import { S as pt } from "./Slicer-6DPtWIL0.js";
|
|
10
|
+
import gt from "./vue-ui-accordion-CyCBwLDa.js";
|
|
11
|
+
import { u as Ae } from "./useNestedProp-CcZBkd4B.js";
|
|
12
|
+
import { _ as mt } from "./PackageVersion-TpOTCEFd.js";
|
|
13
|
+
import { P as xt } from "./PenAndPaper-cjAU-PUf.js";
|
|
14
14
|
import { _ as bt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
15
|
const kt = ["id"], wt = ["xmlns", "viewBox"], $t = { key: 0 }, Ct = ["id"], _t = ["stop-color"], zt = ["stop-color"], St = ["stop-color"], Nt = ["id"], At = ["stop-color"], Tt = ["stop-color"], It = ["stop-color"], Ft = { key: 0 }, Lt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Rt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Pt = { key: 1 }, Vt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ot = ["x", "y", "font-size", "fill", "font-weight"], Bt = { key: 2 }, Et = ["transform", "text-anchor", "font-size", "fill", "font-weight"], Mt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ut = { key: 0 }, Dt = ["cx", "cy", "r", "fill"], Wt = ["cx", "cy", "r", "fill"], Gt = { key: 1 }, Xt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], jt = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ht = ["x", "y", "height", "width", "fill", "rx"], Yt = ["x", "y", "height", "width", "fill", "rx", "stroke", "stroke-width"], qt = ["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-DQqE9z_u.cjs"),ue=require("./useResponsive-BJ7DTGpm.cjs"),$e=require("./Title-a1zU7S4D.cjs"),se=require("./usePrinter-1s8-9A7g.cjs"),_e=require("./Tooltip-BBmtXJ3a.cjs"),Be=require("./DataTable-Cj3bRKxc.cjs"),Se=require("./vue-ui-skeleton-DYKuE1ZW.cjs"),ze=require("./Slicer-dbxY46t5.cjs"),Ve=require("./vue-ui-accordion-CNQ8JBuy.cjs"),re=require("./useNestedProp-DqEFKuPz.cjs"),Ee=require("./PackageVersion-DL3c2r_c.cjs"),Te=require("./PenAndPaper-DgVnjC40.cjs"),Ae=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Fe=["id"],Ie=["xmlns","viewBox"],Pe={key:0},Le=["id"],Re=["stop-color"],Oe=["stop-color"],De=["stop-color"],Me=["id"],Ue=["stop-color"],qe=["stop-color"],We=["stop-color"],Ge={key:0},He=["x1","x2","y1","y2","stroke","stroke-width"],je=["x1","x2","y1","y2","stroke","stroke-width"],Xe={key:1},Ye=["x1","x2","y1","y2","stroke","stroke-width"],Je=["x","y","font-size","fill","font-weight"],Ke={key:2},Qe=["transform","text-anchor","font-size","fill","font-weight"],Ze=["x1","x2","y1","y2","stroke","stroke-width"],et={key:0},tt=["cx","cy","r","fill"],lt=["cx","cy","r","fill"],ot={key:1},at=["x1","x2","y1","y2","stroke","stroke-width"],nt=["x1","x2","y1","y2","stroke","stroke-width"],ut=["x","y","height","width","fill","rx"],st=["x","y","height","width","fill","rx","stroke","stroke-width"],rt=["x","y","height","width","fill","onMouseover"],it={key:5,class:"vue-data-ui-watermark"},dt=["innerHTML"],ct={__name:"vue-ui-candlestick",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(f,{expose:ie}){const d=f,{vue_ui_candlestick:de}=u.useConfig(),b=e.computed(()=>!!d.dataset&&d.dataset.length),h=e.ref(u.createUid()),ce=e.ref(null),V=e.ref(!1),E=e.ref(""),T=e.ref(void 0),P=e.ref(0),g=e.ref(null),L=e.ref(null),R=e.ref(null),O=e.ref(null),D=e.ref(null),M=e.ref(null),C=e.ref(0),U=e.ref(0),q=e.ref(0),t=e.computed({get:()=>W(),set:l=>l});function W(){const l=re.useNestedProp({userConfig:d.config,defaultConfig:de});let a={};return l.theme?a={...re.useNestedProp({userConfig:u.themes.vue_ui_candlestick[l.theme]||d.config,defaultConfig:l})}:a=l,d.config&&u.hasDeepProperty(d.config,"style.zoom.startIndex")?a.style.zoom.startIndex=d.config.style.zoom.startIndex:a.style.zoom.startIndex=null,d.config&&u.hasDeepProperty(d.config,"style.zoom.endIndex")?a.style.zoom.endIndex=d.config.style.zoom.endIndex:a.style.zoom.endIndex=null,a}e.watch(()=>d.config,l=>{t.value=W(),G(),C.value+=1,q.value+=1,U.value+=1},{deep:!0}),e.watch(()=>d.dataset,l=>{c.value.start=0,c.value.end=l.length,C.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}),N=e.ref(null);e.onMounted(()=>{G()});function G(){if(u.objectIsEmpty(d.dataset)&&u.error({componentName:"VueUiCandlestick",type:"dataset"}),t.value.responsive){const l=ue.throttle(()=>{const{width:a,height:o}=ue.useResponsive({chart:g.value,title:t.value.style.title.text?L.value:null,slicer:O.value,legend:R.value,source:D.value,noTitle:M.value});i.value.width=a,i.value.height=o,i.value.xAxisFontSize=u.translateSize({relator:Math.min(a,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(a,o),adjuster:t.value.style.width,source:t.value.style.layout.grid.yAxis.dataLabels.fontSize,threshold:6,fallback:6})});N.value=new ResizeObserver(l),N.value.observe(g.value.parentNode)}Q()}e.onBeforeUnmount(()=>{N.value&&N.value.disconnect()});const{isPrinting:H,isImaging:j,generatePdf:X,generateImage:Y}=se.usePrinter({elementId:`vue-ui-candlestick_${h.value}`,fileName:t.value.style.title.text||"vue-ui-candlestick"}),ve=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}),s=e.computed(()=>{const{top:l,right:a,bottom:o,left:n}=t.value.style.layout.padding;return{top:l,right:i.value.width-a,left:n,bottom:i.value.height-o,width:i.value.width-n-a,height:i.value.height-l-o}}),w=e.computed(()=>d.dataset.length),c=e.ref({start:0,end:w.value}),J=e.computed(()=>d.dataset.slice(c.value.start,c.value.end)),A=e.computed(()=>(d.dataset.forEach((l,a)=>{[null,void 0].includes(l[0])&&u.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"period (index 0)",index:a}),[null,void 0].includes(l[1])&&u.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"open (index 1)",index:a}),[null,void 0].includes(l[2])&&u.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"high (index 2)",index:a}),[null,void 0].includes(l[3])&&u.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"low (index 3)",index:a}),[null,void 0].includes(l[4])&&u.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"last (index 4)",index:a}),[null,void 0].includes(l[5])&&u.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"volume (index 5)",index:a})}),J.value.map(l=>({period:l[0],open:l[1],high:l[2],low:l[3],last:l[4],volume:l[5]})))),r=e.computed(()=>s.value.width/J.value.length),K=e.computed(()=>({max:Math.max(...A.value.map(l=>l.high)),min:0})),m=e.computed(()=>u.calculateNiceScale(K.value.min,K.value.max,t.value.style.layout.grid.yAxis.dataLabels.steps));function $(l,a){return{...l,x:u.checkNaN(s.value.left+a*r.value+r.value/2),y:u.checkNaN(s.value.top+(1-l/m.value.max)*s.value.height),value:u.checkNaN(l)}}const v=e.computed(()=>A.value.map((l,a)=>{const o=$(l.open,a),n=$(l.high,a),y=$(l.low,a),S=$(l.last,a),z=l.last>l.open;return{period:l.period,open:o,high:n,low:y,last:S,volume:l.volume,isBullish:z}}));function ye(l){return u.checkNaN(l/m.value.max)}const he=e.computed(()=>m.value.ticks.map(l=>({y:s.value.bottom-s.value.height*ye(l),value:u.checkNaN(l)}))),pe=e.computed(()=>A.value.map(l=>l.period)),F=e.ref(null);function fe(l,a){T.value=l,F.value={datapoint:a,seriesIndex:l,series:v.value,config:t.value};const o=t.value.style.tooltip.customFormat;if(u.isFunction(o)&&u.functionReturnsString(()=>o({seriesIndex:l,datapoint:a,series:v.value,config:t.value})))E.value=o({seriesIndex:l,datapoint:a,series:v.value,config:t.value});else if(t.value.style.tooltip.show){let n="";const{period:y,open:S,high:z,low:le,last:oe,volume:ae,isBullish:ne}=v.value[l],{period:yt,open:xe,high:be,low:we,last:Ce,volume:Ne}=t.value.translations;n+=`<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?ne?`url(#bullish_gradient_${h.value})`:`url(#bearish_gradient_${h.value})`:ne?t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.colors.bearish}"/></svg>${y}</div>`,n+=`${Ne} : <b>${isNaN(ae)?"-":Number(ae.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()}</b>`,n+=`<div style="margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}">`,n+=`<div>${xe}: <b>${t.value.style.tooltip.prefix} ${isNaN(S.value)?"-":Number(S.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,n+=`<div>${be}: <b>${t.value.style.tooltip.prefix} ${isNaN(z.value)?"-":Number(z.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,n+=`<div>${we}: <b>${t.value.style.tooltip.prefix} ${isNaN(le.value)?"-":Number(le.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,n+=`<div>${Ce}: <b>${t.value.style.tooltip.prefix} ${isNaN(oe.value)?"-":Number(oe.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,n+="</div>",E.value=`<div style="text-align:right">${n}</div>`}V.value=!0}function me(){Q()}const k=e.ref(null);async function Q(){(t.value.style.zoom.startIndex!==null||t.value.style.zoom.endIndex!==null)&&k.value?(t.value.style.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),k.value&&k.value.setStartValue(t.value.style.zoom.startIndex)),t.value.style.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),k.value&&k.value.setEndValue(ge(t.value.style.zoom.endIndex+1)))):(c.value={start:0,end:w.value},C.value+=1)}function ge(l){const a=w.value;return l>a?a:l<0||t.value.style.zoom.startIndex!==null&&l<t.value.style.zoom.startIndex?t.value.style.zoom.startIndex!==null?t.value.style.zoom.startIndex+1:1:l}function Z(){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],a=v.value.map(y=>[y.period,y.open.value,y.high.value,y.low.value,y.last.value,y.volume]),o=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([l]).concat(a),n=u.createCsvContent(o);u.downloadCsv({csvContent:n,title:t.value.style.title.text||"vue-ui-candlestick"})})}const _=e.computed(()=>{const l=v.value.map(n=>[`<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?n.isBullish?`url(#bullish_gradient_${h.value}`:`url(#bearish_gradient_${h.value})`:n.isBullish?t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.colors.bearish}"/></svg> ${n.period}`,`${t.value.table.td.prefix} ${isNaN(n.open.value)?"-":Number(n.open.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(n.high.value)?"-":Number(n.high.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(n.low.value)?"-":Number(n.low.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${t.value.table.td.prefix} ${isNaN(n.last.value)?"-":Number(n.last.value.toFixed(t.value.table.td.roundingValue)).toLocaleString()} ${t.value.table.td.suffix}`,`${isNaN(n.volume)?"-":n.volume.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},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:a,colNames:o}}),x=e.ref(!1);function ke(l){x.value=l,P.value+=1}function ee(){p.value.showTable=!p.value.showTable}function te(){p.value.showTooltip=!p.value.showTooltip}const B=e.ref(!1);function I(){B.value=!B.value}return ie({generatePdf:X,generateCsv:Z,generateImage:Y,toggleTable:ee,toggleTooltip:te,toggleAnnotator:I}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"candlestickChart",ref:g,class:e.normalizeClass(`vue-ui-candlestick ${x.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_${h.value}`},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Te.PenAndPaper,{key:0,parent:g.value,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,active:B.value,onClose:I},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ve.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:L,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock($e._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&&b.value?(e.openBlock(),e.createBlock(se.UserOptions,{ref_key:"details",ref:ce,key:`user_options_${P.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(j),isPrinting:e.unref(H),uid:h.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:x.value,isTooltip:p.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:g.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:ke,onGeneratePdf:e.unref(X),onGenerateCsv:Z,onGenerateImage:e.unref(Y),onToggleTable:ee,onToggleTooltip:te,onToggleAnnotator:I},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:n})=>[e.renderSlot(l.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:o,isFullscreen:n})),void 0,!0)]),key:"5"}:void 0,l.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:o,isAnnotator:n})=>[e.renderSlot(l.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:o,isAnnotator:n})),void 0,!0)]),key:"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),b.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(u.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":x.value,"vue-data-ui-fulscreen--off":!x.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(Ee._sfc_main),v.value.length>0?(e.openBlock(),e.createElementBlock("g",Pe,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`bearish_gradient_${h.value}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.candle.colors.bearish},null,8,Re),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(u.shiftHue)(t.value.style.layout.candle.colors.bearish,.02)}DE`},null,8,Oe),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(u.shiftHue)(t.value.style.layout.candle.colors.bearish,.05)}66`},null,8,De)],8,Le),e.createElementVNode("linearGradient",{id:`bullish_gradient_${h.value}`,x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.candle.colors.bullish},null,8,Ue),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(u.shiftHue)(t.value.style.layout.candle.colors.bullish,.02)}DE`},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(u.shiftHue)(t.value.style.layout.candle.colors.bullish,.05)}66`},null,8,We)],8,Me)]),t.value.style.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Ge,[e.createElementVNode("line",{x1:s.value.left,x2:s.value.left,y1:s.value.top,y2:s.value.bottom,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,He),e.createElementVNode("line",{x1:s.value.left,x2:s.value.right,y1:s.value.bottom,y2:s.value.bottom,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,je)])):e.createCommentVNode("",!0),t.value.style.layout.grid.yAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",Xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[o.value>=m.value.min&&o.value<=m.value.max?(e.openBlock(),e.createElementBlock("line",{key:0,x1:s.value.left,x2:s.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,Ye)):e.createCommentVNode("",!0),o.value>=m.value.min&&o.value<=m.value.max?(e.openBlock(),e.createElementBlock("text",{key:1,x:s.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",Ke,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{transform:`translate(${s.value.left+r.value*n+r.value/2}, ${s.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,Qe)]))),256))])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(o,n)=>(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,Ze),t.value.style.layout.wick.extremity.shape==="circle"?(e.openBlock(),e.createElementBlock("g",et,[e.createElementVNode("circle",{cx:o.high.x,cy:o.high.y,r:t.value.style.layout.wick.extremity.size==="auto"?r.value/20:t.value.style.layout.wick.extremity.size,fill:t.value.style.layout.wick.extremity.color},null,8,tt),e.createElementVNode("circle",{cx:o.low.x,cy:o.low.y,r:t.value.style.layout.wick.extremity.size==="auto"?r.value/20:t.value.style.layout.wick.extremity.size,fill:t.value.style.layout.wick.extremity.color},null,8,lt)])):e.createCommentVNode("",!0),t.value.style.layout.wick.extremity.shape==="line"?(e.openBlock(),e.createElementBlock("g",ot,[e.createElementVNode("line",{x1:o.high.x-(t.value.style.layout.wick.extremity.size==="auto"?r.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"?r.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,at),e.createElementVNode("line",{x1:o.low.x-(t.value.style.layout.wick.extremity.size==="auto"?r.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"?r.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,nt)])):e.createCommentVNode("",!0)]))),256))]),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(o,n)=>(e.openBlock(),e.createElementBlock("rect",{x:o.open.x-r.value/2+r.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:r.value*t.value.style.layout.candle.widthRatio<=0?1e-4:r.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,ut))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(o,n)=>(e.openBlock(),e.createElementBlock("rect",{x:o.open.x-r.value/2+r.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:r.value*t.value.style.layout.candle.widthRatio<=0?1e-4:r.value*t.value.style.layout.candle.widthRatio,fill:o.isBullish?t.value.style.layout.candle.gradient.show?`url(#bullish_gradient_${h.value})`:t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.gradient.show?`url(#bearish_gradient_${h.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,st))),256))]),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(o,n)=>(e.openBlock(),e.createElementBlock("rect",{x:s.value.left+n*r.value,y:s.value.top,height:s.value.height<=0?1e-4:s.value.height,width:r.value<=0?1e-4:r.value,fill:T.value===n?e.unref(u.setOpacity)(t.value.style.layout.selector.color,t.value.style.layout.selector.opacity):"transparent",onMouseover:y=>fe(n,o),onMouseleave:a[0]||(a[0]=y=>{T.value=void 0,V.value=!1})},null,40,rt))),256))])])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:i.value},void 0,!0)],14,Ie)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",it,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(H)||e.unref(j)})),void 0,!0)])):e.createCommentVNode("",!0),b.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Se.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&&b.value?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"chartSlicer",ref:O},[(e.openBlock(),e.createBlock(ze.Slicer,{ref_key:"slicerComponent",ref:k,key:`slicer_${C.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[c.value.start]?f.dataset[c.value.start][0]:f.dataset[0][0],labelRight:f.dataset[c.value.end-1]?f.dataset[c.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:w.value,min:0,valueStart:c.value.start,valueEnd:c.value.end,start:c.value.start,"onUpdate:start":a[1]||(a[1]=o=>c.value.start=o),end:c.value.end,"onUpdate:end":a[2]||(a[2]=o=>c.value.end=o),refreshStartPoint:t.value.style.zoom.startIndex!==null?t.value.style.zoom.startIndex:0,refreshEndPoint:t.value.style.zoom.endIndex!==null?t.value.style.zoom.endIndex+1:w.value,onReset:me},{"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","refreshStartPoint","refreshEndPoint"]))],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"chartLegend",ref:R},[e.renderSlot(l.$slots,"legend",{legend:v.value},void 0,!0)],512),l.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:8,ref_key:"source",ref:D,dir:"auto"},[e.renderSlot(l.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(_e._sfc_main,{show:p.value.showTooltip&&V.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:g.value,content:E.value,isFullscreen:x.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({...F.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...F.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),b.value?(e.openBlock(),e.createBlock(Ve.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(Be.DataTable,{key:`table_${U.value}`,colNames:_.value.colNames,head:_.value.head,body:_.value.body,config:_.value.config,title:`${t.value.style.title.text}${t.value.style.title.subtitle.text?` : ${t.value.style.title.subtitle.text}`:""}`,onClose:a[3]||(a[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,dt)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,Fe))}},vt=Ae._export_sfc(ct,[["__scopeId","data-v-c83d8995"]]);exports.default=vt;
|
|
@@ -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-D6Fux0KL.js";
|
|
3
|
+
import { u as Be } from "./useNestedProp-CcZBkd4B.js";
|
|
4
|
+
import { u as Pe, U as Re } from "./usePrinter-BfVNshkJ.js";
|
|
5
|
+
import ze from "./vue-ui-skeleton-wHDgl1XV.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-DuDeHJyK.cjs"),ae=require("./useNestedProp-zkJOoemW.cjs"),j=require("./usePrinter-ardO_DNo.cjs"),ne=require("./vue-ui-skeleton-DleyAXe1.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-DQqE9z_u.cjs"),ae=require("./useNestedProp-DqEFKuPz.cjs"),j=require("./usePrinter-1s8-9A7g.cjs"),ne=require("./vue-ui-skeleton-DYKuE1ZW.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, G 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, G as $e, m as Ce, j as tt, k as V, n as H, q as lt, r as at } from "./index-D6Fux0KL.js";
|
|
3
|
+
import { u as ot, U as st } from "./usePrinter-BfVNshkJ.js";
|
|
4
|
+
import ut from "./vue-ui-skeleton-wHDgl1XV.js";
|
|
5
|
+
import nt from "./BaseIcon-BA9HUUaA.js";
|
|
6
|
+
import rt from "./vue-ui-accordion-CyCBwLDa.js";
|
|
7
|
+
import { u as Te } from "./useNestedProp-CcZBkd4B.js";
|
|
8
|
+
import { _ as it } from "./PackageVersion-TpOTCEFd.js";
|
|
9
|
+
import { P as ct } from "./PenAndPaper-cjAU-PUf.js";
|
|
10
10
|
import { _ as dt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
const vt = ["id"], yt = {
|
|
12
12
|
key: 1,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-DuDeHJyK.cjs"),K=require("./usePrinter-ardO_DNo.cjs"),he=require("./vue-ui-skeleton-DleyAXe1.cjs"),pe=require("./BaseIcon-DUokibJ1.cjs"),fe=require("./vue-ui-accordion-JS5d0ZPi.cjs"),J=require("./useNestedProp-zkJOoemW.cjs"),me=require("./PackageVersion-1JWV5loe.cjs"),be=require("./PenAndPaper-C6mnwE-L.cjs"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ke=["id"],_e={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},xe=["xmlns","viewBox"],Be={key:0},Ee=["fill","font-weight","font-size","x","y"],Ne=["fill","font-weight","font-size","x","y"],Se=["id"],Ce=["stop-color"],ze=["stop-color"],we=["id"],Ve=["stop-color"],$e=["stop-color"],Te=["id"],Fe=["stop-color"],Le=["stop-color"],De=["stop-color"],Oe=["id"],Pe=["stop-color"],Ie=["stop-color"],Me=["stop-color"],Re=["id"],Xe=["stop-color"],Ae=["stop-color"],je=["stop-color"],Ge={key:1},qe=["x","y","font-size","font-weight","fill"],Ue=["x","y","font-size","font-weight","fill"],Ye=["d","stroke"],He=["cx","cy","r","fill"],We=["cx","cy","r","fill","stroke","stroke-width","onClick"],Ke={key:2},Je=["x","y","font-size","fill","onClick"],Qe={key:0},Ze=["x","y","fill","font-size","font-weight"],et=["x","y","height","width","fill","rx","onClick"],tt=["x","y","height","width","fill","rx","stroke","stroke-width","onClick"],lt={key:3},at=["x","y","fill","font-size","onClick"],ot=["d","stroke"],nt=["fill","cx","cy","r","onClick"],rt={key:4},st=["x","y","font-size","font-weight","fill"],ut=["x1","x2","y1","y2","stroke","stroke-width"],ct=["y","height","width"],it={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},dt={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},yt={viewBox:"0 0 20 20",height:"16",width:"16"},vt=["fill"],ht={key:6},pt=["y","height","width"],ft={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},mt={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},bt={viewBox:"0 0 20 20",height:"16",width:"16"},gt=["fill"],kt=["cx","cy","fill"],_t=["d","stroke"],xt=["cx","cy","fill"],Bt=["d","stroke"],Et=["cx","cy","fill"],Nt=["cx","cy","fill"],St=["x","y","fill","font-size","font-weight"],Ct=["x","y","fill","font-size","font-weight"],zt=["x","text-anchor","y","fill","font-size"],wt=["x","text-anchor","y","fill","font-size"],Vt=["x","text-anchor","y","fill","font-size"],$t=["x","text-anchor","y","fill","font-size"],Tt=["x","text-anchor","y","fill","font-size"],Ft=["x","y","font-size","fill"],Lt=["x","y","font-size","fill"],Dt=["x","y","font-size","fill"],Ot={key:4,class:"vue-data-ui-watermark"},Pt={key:6,ref:"source",dir:"auto"},It={style:{"padding-top":"36px",position:"relative"}},Mt={class:"vue-ui-data-table"},Rt={key:0},Xt=["data-cell"],At={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},jt={key:0},Gt={key:1},qt=["data-cell"],Ut={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Yt={key:0},Ht={key:1},Wt=["data-cell"],Kt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Jt={key:0},Qt={key:1},Zt=["data-cell"],el={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},tl={key:0},ll={key:1},al=["data-cell"],ol={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},nl={key:0},rl={key:1},sl=["data-cell"],ul={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},cl={key:0},il={key:1},dl=["data-cell"],yl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},vl={key:0},hl={key:1},pl=["data-cell"],fl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ml=["data-cell"],bl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},gl=["data-cell"],kl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},_l=["data-cell"],xl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Bl=["data-cell"],El={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Nl={__name:"vue-ui-chestnut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectRoot","selectBranch","selectNut"],setup(Q,{expose:Z,emit:S}){const k=Q;e.useCssVars(a=>({e1bbb6a4:a.tdo}));const{vue_ui_chestnut:ee}=o.useConfig(),z=e.computed(()=>!!k.dataset&&k.dataset.length),h=e.ref(o.createUid()),T=e.ref(null),te=e.ref(null),I=e.ref(0),t=e.computed({get:()=>M(),set:a=>a});function M(){const a=J.useNestedProp({userConfig:k.config,defaultConfig:ee});return a.theme?{...J.useNestedProp({userConfig:o.themes.vue_ui_chestnut[a.theme]||k.config,defaultConfig:a}),customPalette:o.themePalettes[a.theme]||o.palette}:a}e.watch(()=>k.config,a=>{t.value=M(),Y()},{deep:!0});const{isPrinting:R,isImaging:X,generatePdf:A,generateImage:j}=K.usePrinter({elementId:`vue-ui-chestnut_${h.value}`,fileName:t.value.style.chart.layout.title.text||"vue-ui-chestnut"}),le=e.computed(()=>t.value.userOptions.show),F=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),w=e.ref({showTable:t.value.table.show}),L=e.ref(null),G=e.ref(!1),ae=e.computed(()=>t.value.table.responsiveBreakpoint),r=e.ref({gap:6,padding:{top:102,left:12,right:12,bottom:96},width:1024,height:0,branchSize:32,branchStart:128}),f=e.computed(()=>({left:r.value.padding.left,top:r.value.padding.top,right:r.value.width-r.value.padding.right,bottom:r.value.height-r.value.padding.bottom,width:r.value.width-(r.value.padding.left+r.value.padding.right),height:r.value.height-(r.value.padding.top+r.value.padding.bottom),seedX:r.value.padding.left+64})),_=e.computed(()=>z.value?k.dataset.flatMap(a=>(a.branches||[]).map(s=>s.value||0)).reduce((a,s)=>a+s,0):0),m=e.computed(()=>(k.dataset.forEach((a,s)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","branches"]}).forEach(l=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:l,index:s})}),a.branches&&a.branches.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(d=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:d,index:`${s} - ${n}`})}),l.breakdown&&l.breakdown.forEach((d,i)=>{o.getMissingDatasetAttributes({datasetObject:d,requiredAttributes:["name","value"]}).forEach(y=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:y,index:`${s} - ${n} - ${i}`})})})})}),k.dataset.map((a,s)=>{const l=(a.branches||[]).map(n=>n.value||0).reduce((n,d)=>n+d,0);return{...a,color:o.convertColorToHex(a.color)||F.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:a.id||`root_${s}_${h.value}`,type:"root",total:l,rootIndex:s,branches:(a.branches||[]).map((n,d)=>({...n,rootName:a.name,rootIndex:s,color:o.convertColorToHex(a.color)||F.value[s]||o.palette[s]||o.palette[s%o.palette.length],value:n.value>=0?n.value:0,id:n.id||`branch_${s}_${d}_${h.value}`,proportionToRoot:n.value/l,type:"branch",breakdown:(n.breakdown||[]).map((i,y)=>({table:{rootName:a.name,rootValue:l,rootToTotal:l/_.value,branchName:n.name,branchValue:n.value,branchToTotal:n.value/_.value,branchToRoot:n.value/l,nutName:i.name,nutValue:i.value,nutToTotal:i.value/_.value,nutToRoot:i.value/l,nutToBranch:i.value/n.value},...i,type:"nut",branchName:n.name,rootName:a.name,branchTotal:n.value>=0?n.value:0,proportionToBranch:i.value/n.value,proportionToRoot:i.value/l,proportionToTree:i.value/_.value,rootIndex:s,id:i.id||`nut_${s}_${d}_${y}_${h.value}`,color:o.convertColorToHex(i.color)||F.value[y]||o.palette[y]||o.palette[y%o.palette.length],value:i.value>=0?i.value:0}))}))}})));function oe(){return m.value}const ne=e.computed(()=>m.value.flatMap(a=>a.branches).length),re=e.computed(()=>Math.max(...m.value.map(a=>a.branches.map(s=>s.value).reduce((s,l)=>s+l,0)))),se=e.computed(()=>Math.max(...m.value.flatMap(a=>a.branches.map(s=>s.value)))),q=e.computed(()=>256+r.value.padding.left),B=e.computed(()=>m.value.sort((a,s)=>s.total-a.total).map((a,s)=>{const l=f.value.height/m.value.length/2,n=a.total/re.value*(l>64?64:l);return{...a,x:f.value.seedX,y:f.value.top+f.value.height/m.value.length*(s+1)-(f.value.height/m.value.length/2+r.value.gap/2),r:n<r.value.branchSize/2?r.value.branchSize/2:n}})),ue=e.computed(()=>t.value.style.chart.layout.branches.widthRatio<=0?.1:t.value.style.chart.layout.branches.widthRatio>1.8?1.8:t.value.style.chart.layout.branches.widthRatio),ce=e.computed(()=>B.value.flatMap(a=>a.branches)),E=e.computed(()=>ce.value.sort((a,s)=>s.value-a.value).map((a,s)=>({...a,y1:s*r.value.branchSize+f.value.top+s*r.value.gap,y2:s*r.value.branchSize+r.value.branchSize,x1:q.value,x2:384*a.value/se.value*ue.value+q.value})));function D(a){const s=B.value.find(l=>l.rootIndex===a.rootIndex);return{x:s.x,y:s.y,r:s.r}}const u=e.ref(null),x=e.ref(null),v=e.ref(null),b=e.ref(null);function p(){u.value=null,v.value=null,b.value=null}function g(a){return b.value?b.value===null?!0:a.type==="root"?a.id===b.value.id:a.rootIndex===b.value.rootIndex:u.value===null&&v.value===null?!0:a.type==="nut"?u.value.id===a.id:a.type==="branch"?v.value.id===a.id:a.type==="root"?v.value&&v.value.rootIndex===a.rootIndex||u.value&&u.value.rootIndex===a.rootIndex:!1}function ie(a){p(),e.nextTick(()=>{u.value=a,v.value=a,x.value=o.makeDonut({series:a.breakdown,base:1},a.x2+24+t.value.style.chart.layout.nuts.offsetX,a.y1+r.value.branchSize/2,80,80),S("selectNut",a.breakdown)})}function N(){u.value=null,x.value=null,S("selectNut",null)}function O(a){v.value&&v.value.id===a.id?(v.value=null,p(),S("selectBranch",null)):(p(),v.value=a,S("selectBranch",a))}function U(a){b.value&&b.value.id===a.id?(p(),S("selectRoot",null)):(p(),b.value=a,S("selectRoot",a))}function de(){return f.value.bottom-(u.value.y1+180)<0?0:f.value.bottom}function C(a){return a.proportion*100>t.value.style.chart.layout.nuts.selected.labels.dataLabels.hideUnderValue}function ye(){const a=new ResizeObserver(s=>{s.forEach(l=>{G.value=l.contentRect.width<ae.value})});L.value&&a.observe(L.value)}e.onMounted(()=>{Y()});function Y(){o.objectIsEmpty(k.dataset)&&o.error({componentName:"VueUiChestnut",type:"dataset"});const a=ne.value*(r.value.branchSize+r.value.gap)+r.value.padding.top+r.value.padding.bottom;r.value.height=a,ye()}const c=e.computed(()=>{const a=[t.value.table.th.translations.rootName,t.value.table.th.translations.rootValue,t.value.table.th.translations.rootToTotal,t.value.table.th.translations.branchName,t.value.table.th.translations.branchValue,t.value.table.th.translations.branchToRoot,t.value.table.th.translations.branchToTotal,t.value.table.th.translations.nutName,t.value.table.th.translations.nutValue,t.value.table.th.translations.nutToBranch,t.value.table.th.translations.nutToRoot,t.value.table.th.translations.nutToTotal],s=m.value.flatMap((l,n)=>l.branches.flatMap((d,i)=>d.breakdown.flatMap((y,Cl)=>y.table)));return{head:a,body:s}});function H(){e.nextTick(()=>{const a=[[t.value.style.chart.layout.title.text],[t.value.style.chart.layout.title.subtitle.text],[""],["Grand total",_.value],[""]],s=c.value.head,l=c.value.body.map((i,y)=>[c.value.body[y-1]&&c.value.body[y-1].rootName===i.rootName?"":i.rootName,c.value.body[y-1]&&c.value.body[y-1].rootName===i.rootName?"":i.rootValue,c.value.body[y-1]&&c.value.body[y-1].rootName===i.rootName?"":i.rootToTotal,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchName,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchValue,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchToRoot,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchToTotal,i.nutName,i.nutValue,i.nutToBranch,i.nutToRoot,i.nutToTotal]),n=a.concat([s]).concat(l),d=o.createCsvContent(n);o.downloadCsv({csvContent:d,title:t.value.style.chart.layout.title.text||"vue-ui-chestnut"})})}const V=e.ref(!1);function ve(a){V.value=a,I.value+=1}function W(){w.value.showTable=!w.value.showTable}const $=e.ref(!1);function P(){$.value=!$.value}return Z({getData:oe,generatePdf:A,generateCsv:H,generateImage:j,toggleTable:W,toggleAnnotator:P}),(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-chestnut ${V.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"chestnutChart",ref:T,id:`vue-ui-chestnut_${h.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(be.PenAndPaper,{key:0,parent:T.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:$.value,onClose:P},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),le.value?(e.openBlock(),e.createElementBlock("div",_e,null,512)):e.createCommentVNode("",!0),t.value.userOptions.show&&z.value?(e.openBlock(),e.createBlock(K.UserOptions,{ref_key:"details",ref:te,key:`user_options_${I.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(X),isPrinting:e.unref(R),uid:h.value,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:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:T.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:$.value,onToggleFullscreen:ve,onGeneratePdf:e.unref(A),onGenerateCsv:H,onGenerateImage:e.unref(j),onToggleTable:W,onToggleAnnotator:P},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:n})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:n})),void 0,!0)]),key:"4"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:n})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:n})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),r.value.height>0&&z.value?(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(me._sfc_main),u.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",Be,[t.value.style.chart.layout.title.text?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",fill:t.value.style.chart.layout.title.color,"font-weight":t.value.style.chart.layout.title.bold?"bold":"normal","font-size":t.value.style.chart.layout.title.fontSize,x:r.value.width/2,y:12+t.value.style.chart.layout.title.fontSize+t.value.style.chart.layout.title.offsetY,onClick:p},e.toDisplayString(t.value.style.chart.layout.title.text),9,Ee)):e.createCommentVNode("",!0),t.value.style.chart.layout.title.subtitle.text?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":"middle",fill:t.value.style.chart.layout.title.subtitle.color,"font-weight":t.value.style.chart.layout.title.subtitle.bold?"bold":"normal","font-size":t.value.style.chart.layout.title.subtitle.fontSize,x:r.value.width/2,y:48+t.value.style.chart.layout.title.subtitle.fontSize+t.value.style.chart.layout.title.subtitle.offsetY,onClick:p},e.toDisplayString(t.value.style.chart.layout.title.subtitle.text),9,Ne)):e.createCommentVNode("",!0)])),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,n)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`root_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(l.color,.05),100-t.value.style.chart.layout.roots.gradientIntensity)},null,8,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,ze)],8,Se))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,l=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`branch_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":l.color},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(l.color,.02),100-t.value.style.chart.layout.branches.gradientIntensity)},null,8,$e)],8,we))),256)),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nutpick_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,Fe),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)("#FFFFFF",t.value.style.chart.layout.nuts.selected.gradientIntensity)},null,8,Le),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,De)],8,Te),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,Pe),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)("#FFFFFF",t.value.style.chart.layout.nuts.gradientIntensity)},null,8,Ie),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,Me)],8,Oe),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_underlayer_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,100)},null,8,Xe),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,60)},null,8,Ae),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,0)},null,8,je)],8,Re)]),t.value.style.chart.layout.grandTotal.show?(e.openBlock(),e.createElementBlock("g",Ge,[e.createElementVNode("text",{x:f.value.seedX,y:32+t.value.style.chart.layout.grandTotal.offsetY,"font-size":t.value.style.chart.layout.grandTotal.fontSize,"font-weight":t.value.style.chart.layout.grandTotal.bold?"bold":"normal",fill:t.value.style.chart.layout.grandTotal.color,"text-anchor":"middle",onClick:p},e.toDisplayString(t.value.style.chart.layout.grandTotal.text),9,qe),e.createElementVNode("text",{x:f.value.seedX,y:38+t.value.style.chart.layout.grandTotal.fontSize+t.value.style.chart.layout.grandTotal.offsetY,"font-size":t.value.style.chart.layout.grandTotal.fontSize,"font-weight":t.value.style.chart.layout.grandTotal.bold?"bold":"normal",fill:t.value.style.chart.layout.grandTotal.color,"text-anchor":"middle",onClick:p},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.grandTotal.formatter,_.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.grandTotal.prefix,v:_.value,s:t.value.style.chart.layout.grandTotal.suffix,r:t.value.style.chart.layout.grandTotal.roundingValue}))),9,Ue)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,l=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.branchSize,(n,d)=>(e.openBlock(),e.createElementBlock("path",{d:`M
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-DQqE9z_u.cjs"),K=require("./usePrinter-1s8-9A7g.cjs"),he=require("./vue-ui-skeleton-DYKuE1ZW.cjs"),pe=require("./BaseIcon-Cy5dUKeV.cjs"),fe=require("./vue-ui-accordion-CNQ8JBuy.cjs"),J=require("./useNestedProp-DqEFKuPz.cjs"),me=require("./PackageVersion-DL3c2r_c.cjs"),be=require("./PenAndPaper-DgVnjC40.cjs"),ge=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ke=["id"],_e={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},xe=["xmlns","viewBox"],Be={key:0},Ee=["fill","font-weight","font-size","x","y"],Ne=["fill","font-weight","font-size","x","y"],Se=["id"],Ce=["stop-color"],ze=["stop-color"],we=["id"],Ve=["stop-color"],$e=["stop-color"],Te=["id"],Fe=["stop-color"],Le=["stop-color"],De=["stop-color"],Oe=["id"],Pe=["stop-color"],Ie=["stop-color"],Me=["stop-color"],Re=["id"],Xe=["stop-color"],Ae=["stop-color"],je=["stop-color"],Ge={key:1},qe=["x","y","font-size","font-weight","fill"],Ue=["x","y","font-size","font-weight","fill"],Ye=["d","stroke"],He=["cx","cy","r","fill"],We=["cx","cy","r","fill","stroke","stroke-width","onClick"],Ke={key:2},Je=["x","y","font-size","fill","onClick"],Qe={key:0},Ze=["x","y","fill","font-size","font-weight"],et=["x","y","height","width","fill","rx","onClick"],tt=["x","y","height","width","fill","rx","stroke","stroke-width","onClick"],lt={key:3},at=["x","y","fill","font-size","onClick"],ot=["d","stroke"],nt=["fill","cx","cy","r","onClick"],rt={key:4},st=["x","y","font-size","font-weight","fill"],ut=["x1","x2","y1","y2","stroke","stroke-width"],ct=["y","height","width"],it={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},dt={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},yt={viewBox:"0 0 20 20",height:"16",width:"16"},vt=["fill"],ht={key:6},pt=["y","height","width"],ft={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},mt={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},bt={viewBox:"0 0 20 20",height:"16",width:"16"},gt=["fill"],kt=["cx","cy","fill"],_t=["d","stroke"],xt=["cx","cy","fill"],Bt=["d","stroke"],Et=["cx","cy","fill"],Nt=["cx","cy","fill"],St=["x","y","fill","font-size","font-weight"],Ct=["x","y","fill","font-size","font-weight"],zt=["x","text-anchor","y","fill","font-size"],wt=["x","text-anchor","y","fill","font-size"],Vt=["x","text-anchor","y","fill","font-size"],$t=["x","text-anchor","y","fill","font-size"],Tt=["x","text-anchor","y","fill","font-size"],Ft=["x","y","font-size","fill"],Lt=["x","y","font-size","fill"],Dt=["x","y","font-size","fill"],Ot={key:4,class:"vue-data-ui-watermark"},Pt={key:6,ref:"source",dir:"auto"},It={style:{"padding-top":"36px",position:"relative"}},Mt={class:"vue-ui-data-table"},Rt={key:0},Xt=["data-cell"],At={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},jt={key:0},Gt={key:1},qt=["data-cell"],Ut={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Yt={key:0},Ht={key:1},Wt=["data-cell"],Kt={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Jt={key:0},Qt={key:1},Zt=["data-cell"],el={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},tl={key:0},ll={key:1},al=["data-cell"],ol={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},nl={key:0},rl={key:1},sl=["data-cell"],ul={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},cl={key:0},il={key:1},dl=["data-cell"],yl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},vl={key:0},hl={key:1},pl=["data-cell"],fl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},ml=["data-cell"],bl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},gl=["data-cell"],kl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},_l=["data-cell"],xl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Bl=["data-cell"],El={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Nl={__name:"vue-ui-chestnut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectRoot","selectBranch","selectNut"],setup(Q,{expose:Z,emit:S}){const k=Q;e.useCssVars(a=>({e1bbb6a4:a.tdo}));const{vue_ui_chestnut:ee}=o.useConfig(),z=e.computed(()=>!!k.dataset&&k.dataset.length),h=e.ref(o.createUid()),T=e.ref(null),te=e.ref(null),I=e.ref(0),t=e.computed({get:()=>M(),set:a=>a});function M(){const a=J.useNestedProp({userConfig:k.config,defaultConfig:ee});return a.theme?{...J.useNestedProp({userConfig:o.themes.vue_ui_chestnut[a.theme]||k.config,defaultConfig:a}),customPalette:o.themePalettes[a.theme]||o.palette}:a}e.watch(()=>k.config,a=>{t.value=M(),Y()},{deep:!0});const{isPrinting:R,isImaging:X,generatePdf:A,generateImage:j}=K.usePrinter({elementId:`vue-ui-chestnut_${h.value}`,fileName:t.value.style.chart.layout.title.text||"vue-ui-chestnut"}),le=e.computed(()=>t.value.userOptions.show),F=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),w=e.ref({showTable:t.value.table.show}),L=e.ref(null),G=e.ref(!1),ae=e.computed(()=>t.value.table.responsiveBreakpoint),r=e.ref({gap:6,padding:{top:102,left:12,right:12,bottom:96},width:1024,height:0,branchSize:32,branchStart:128}),f=e.computed(()=>({left:r.value.padding.left,top:r.value.padding.top,right:r.value.width-r.value.padding.right,bottom:r.value.height-r.value.padding.bottom,width:r.value.width-(r.value.padding.left+r.value.padding.right),height:r.value.height-(r.value.padding.top+r.value.padding.bottom),seedX:r.value.padding.left+64})),_=e.computed(()=>z.value?k.dataset.flatMap(a=>(a.branches||[]).map(s=>s.value||0)).reduce((a,s)=>a+s,0):0),m=e.computed(()=>(k.dataset.forEach((a,s)=>{o.getMissingDatasetAttributes({datasetObject:a,requiredAttributes:["name","branches"]}).forEach(l=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:l,index:s})}),a.branches&&a.branches.forEach((l,n)=>{o.getMissingDatasetAttributes({datasetObject:l,requiredAttributes:["name","value"]}).forEach(d=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:d,index:`${s} - ${n}`})}),l.breakdown&&l.breakdown.forEach((d,i)=>{o.getMissingDatasetAttributes({datasetObject:d,requiredAttributes:["name","value"]}).forEach(y=>{o.error({componentName:"VueUiChestnut",type:"datasetSerieAttribute",property:y,index:`${s} - ${n} - ${i}`})})})})}),k.dataset.map((a,s)=>{const l=(a.branches||[]).map(n=>n.value||0).reduce((n,d)=>n+d,0);return{...a,color:o.convertColorToHex(a.color)||F.value[s]||o.palette[s]||o.palette[s%o.palette.length],id:a.id||`root_${s}_${h.value}`,type:"root",total:l,rootIndex:s,branches:(a.branches||[]).map((n,d)=>({...n,rootName:a.name,rootIndex:s,color:o.convertColorToHex(a.color)||F.value[s]||o.palette[s]||o.palette[s%o.palette.length],value:n.value>=0?n.value:0,id:n.id||`branch_${s}_${d}_${h.value}`,proportionToRoot:n.value/l,type:"branch",breakdown:(n.breakdown||[]).map((i,y)=>({table:{rootName:a.name,rootValue:l,rootToTotal:l/_.value,branchName:n.name,branchValue:n.value,branchToTotal:n.value/_.value,branchToRoot:n.value/l,nutName:i.name,nutValue:i.value,nutToTotal:i.value/_.value,nutToRoot:i.value/l,nutToBranch:i.value/n.value},...i,type:"nut",branchName:n.name,rootName:a.name,branchTotal:n.value>=0?n.value:0,proportionToBranch:i.value/n.value,proportionToRoot:i.value/l,proportionToTree:i.value/_.value,rootIndex:s,id:i.id||`nut_${s}_${d}_${y}_${h.value}`,color:o.convertColorToHex(i.color)||F.value[y]||o.palette[y]||o.palette[y%o.palette.length],value:i.value>=0?i.value:0}))}))}})));function oe(){return m.value}const ne=e.computed(()=>m.value.flatMap(a=>a.branches).length),re=e.computed(()=>Math.max(...m.value.map(a=>a.branches.map(s=>s.value).reduce((s,l)=>s+l,0)))),se=e.computed(()=>Math.max(...m.value.flatMap(a=>a.branches.map(s=>s.value)))),q=e.computed(()=>256+r.value.padding.left),B=e.computed(()=>m.value.sort((a,s)=>s.total-a.total).map((a,s)=>{const l=f.value.height/m.value.length/2,n=a.total/re.value*(l>64?64:l);return{...a,x:f.value.seedX,y:f.value.top+f.value.height/m.value.length*(s+1)-(f.value.height/m.value.length/2+r.value.gap/2),r:n<r.value.branchSize/2?r.value.branchSize/2:n}})),ue=e.computed(()=>t.value.style.chart.layout.branches.widthRatio<=0?.1:t.value.style.chart.layout.branches.widthRatio>1.8?1.8:t.value.style.chart.layout.branches.widthRatio),ce=e.computed(()=>B.value.flatMap(a=>a.branches)),E=e.computed(()=>ce.value.sort((a,s)=>s.value-a.value).map((a,s)=>({...a,y1:s*r.value.branchSize+f.value.top+s*r.value.gap,y2:s*r.value.branchSize+r.value.branchSize,x1:q.value,x2:384*a.value/se.value*ue.value+q.value})));function D(a){const s=B.value.find(l=>l.rootIndex===a.rootIndex);return{x:s.x,y:s.y,r:s.r}}const u=e.ref(null),x=e.ref(null),v=e.ref(null),b=e.ref(null);function p(){u.value=null,v.value=null,b.value=null}function g(a){return b.value?b.value===null?!0:a.type==="root"?a.id===b.value.id:a.rootIndex===b.value.rootIndex:u.value===null&&v.value===null?!0:a.type==="nut"?u.value.id===a.id:a.type==="branch"?v.value.id===a.id:a.type==="root"?v.value&&v.value.rootIndex===a.rootIndex||u.value&&u.value.rootIndex===a.rootIndex:!1}function ie(a){p(),e.nextTick(()=>{u.value=a,v.value=a,x.value=o.makeDonut({series:a.breakdown,base:1},a.x2+24+t.value.style.chart.layout.nuts.offsetX,a.y1+r.value.branchSize/2,80,80),S("selectNut",a.breakdown)})}function N(){u.value=null,x.value=null,S("selectNut",null)}function O(a){v.value&&v.value.id===a.id?(v.value=null,p(),S("selectBranch",null)):(p(),v.value=a,S("selectBranch",a))}function U(a){b.value&&b.value.id===a.id?(p(),S("selectRoot",null)):(p(),b.value=a,S("selectRoot",a))}function de(){return f.value.bottom-(u.value.y1+180)<0?0:f.value.bottom}function C(a){return a.proportion*100>t.value.style.chart.layout.nuts.selected.labels.dataLabels.hideUnderValue}function ye(){const a=new ResizeObserver(s=>{s.forEach(l=>{G.value=l.contentRect.width<ae.value})});L.value&&a.observe(L.value)}e.onMounted(()=>{Y()});function Y(){o.objectIsEmpty(k.dataset)&&o.error({componentName:"VueUiChestnut",type:"dataset"});const a=ne.value*(r.value.branchSize+r.value.gap)+r.value.padding.top+r.value.padding.bottom;r.value.height=a,ye()}const c=e.computed(()=>{const a=[t.value.table.th.translations.rootName,t.value.table.th.translations.rootValue,t.value.table.th.translations.rootToTotal,t.value.table.th.translations.branchName,t.value.table.th.translations.branchValue,t.value.table.th.translations.branchToRoot,t.value.table.th.translations.branchToTotal,t.value.table.th.translations.nutName,t.value.table.th.translations.nutValue,t.value.table.th.translations.nutToBranch,t.value.table.th.translations.nutToRoot,t.value.table.th.translations.nutToTotal],s=m.value.flatMap((l,n)=>l.branches.flatMap((d,i)=>d.breakdown.flatMap((y,Cl)=>y.table)));return{head:a,body:s}});function H(){e.nextTick(()=>{const a=[[t.value.style.chart.layout.title.text],[t.value.style.chart.layout.title.subtitle.text],[""],["Grand total",_.value],[""]],s=c.value.head,l=c.value.body.map((i,y)=>[c.value.body[y-1]&&c.value.body[y-1].rootName===i.rootName?"":i.rootName,c.value.body[y-1]&&c.value.body[y-1].rootName===i.rootName?"":i.rootValue,c.value.body[y-1]&&c.value.body[y-1].rootName===i.rootName?"":i.rootToTotal,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchName,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchValue,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchToRoot,c.value.body[y-1]&&c.value.body[y-1].branchName===i.branchName?"":i.branchToTotal,i.nutName,i.nutValue,i.nutToBranch,i.nutToRoot,i.nutToTotal]),n=a.concat([s]).concat(l),d=o.createCsvContent(n);o.downloadCsv({csvContent:d,title:t.value.style.chart.layout.title.text||"vue-ui-chestnut"})})}const V=e.ref(!1);function ve(a){V.value=a,I.value+=1}function W(){w.value.showTable=!w.value.showTable}const $=e.ref(!1);function P(){$.value=!$.value}return Z({getData:oe,generatePdf:A,generateCsv:H,generateImage:j,toggleTable:W,toggleAnnotator:P}),(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-chestnut ${V.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"chestnutChart",ref:T,id:`vue-ui-chestnut_${h.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.chart.backgroundColor}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(be.PenAndPaper,{key:0,parent:T.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:$.value,onClose:P},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),le.value?(e.openBlock(),e.createElementBlock("div",_e,null,512)):e.createCommentVNode("",!0),t.value.userOptions.show&&z.value?(e.openBlock(),e.createBlock(K.UserOptions,{ref_key:"details",ref:te,key:`user_options_${I.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(X),isPrinting:e.unref(R),uid:h.value,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:V.value,titles:{...t.value.userOptions.buttonTitles},chartElement:T.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:$.value,onToggleFullscreen:ve,onGeneratePdf:e.unref(A),onGenerateCsv:H,onGenerateImage:e.unref(j),onToggleTable:W,onToggleAnnotator:P},e.createSlots({_:2},[a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:n})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:n})),void 0,!0)]),key:"4"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:n})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:n})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),r.value.height>0&&z.value?(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(o.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":V.value,"vue-data-ui-fulscreen--off":!V.value}),viewBox:`0 0 ${r.value.width} ${r.value.height}`,style:e.normalizeStyle(`overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(me._sfc_main),u.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",Be,[t.value.style.chart.layout.title.text?(e.openBlock(),e.createElementBlock("text",{key:0,"text-anchor":"middle",fill:t.value.style.chart.layout.title.color,"font-weight":t.value.style.chart.layout.title.bold?"bold":"normal","font-size":t.value.style.chart.layout.title.fontSize,x:r.value.width/2,y:12+t.value.style.chart.layout.title.fontSize+t.value.style.chart.layout.title.offsetY,onClick:p},e.toDisplayString(t.value.style.chart.layout.title.text),9,Ee)):e.createCommentVNode("",!0),t.value.style.chart.layout.title.subtitle.text?(e.openBlock(),e.createElementBlock("text",{key:1,"text-anchor":"middle",fill:t.value.style.chart.layout.title.subtitle.color,"font-weight":t.value.style.chart.layout.title.subtitle.bold?"bold":"normal","font-size":t.value.style.chart.layout.title.subtitle.fontSize,x:r.value.width/2,y:48+t.value.style.chart.layout.title.subtitle.fontSize+t.value.style.chart.layout.title.subtitle.offsetY,onClick:p},e.toDisplayString(t.value.style.chart.layout.title.subtitle.text),9,Ne)):e.createCommentVNode("",!0)])),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(l,n)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`root_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(l.color,.05),100-t.value.style.chart.layout.roots.gradientIntensity)},null,8,Ce),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,ze)],8,Se))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,l=>(e.openBlock(),e.createElementBlock("linearGradient",{x1:"0%",y1:"0%",x2:"100%",y2:"0%",id:`branch_gradient_${h.value}_${l.rootIndex}`},[e.createElementVNode("stop",{offset:"0%","stop-color":l.color},null,8,Ve),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)(e.unref(o.shiftHue)(l.color,.02),100-t.value.style.chart.layout.branches.gradientIntensity)},null,8,$e)],8,we))),256)),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nutpick_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,Fe),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)("#FFFFFF",t.value.style.chart.layout.nuts.selected.gradientIntensity)},null,8,Le),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,De)],8,Te),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,Pe),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)("#FFFFFF",t.value.style.chart.layout.nuts.gradientIntensity)},null,8,Ie),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,Me)],8,Oe),e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`nut_underlayer_${h.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,100)},null,8,Xe),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,60)},null,8,Ae),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,0)},null,8,je)],8,Re)]),t.value.style.chart.layout.grandTotal.show?(e.openBlock(),e.createElementBlock("g",Ge,[e.createElementVNode("text",{x:f.value.seedX,y:32+t.value.style.chart.layout.grandTotal.offsetY,"font-size":t.value.style.chart.layout.grandTotal.fontSize,"font-weight":t.value.style.chart.layout.grandTotal.bold?"bold":"normal",fill:t.value.style.chart.layout.grandTotal.color,"text-anchor":"middle",onClick:p},e.toDisplayString(t.value.style.chart.layout.grandTotal.text),9,qe),e.createElementVNode("text",{x:f.value.seedX,y:38+t.value.style.chart.layout.grandTotal.fontSize+t.value.style.chart.layout.grandTotal.offsetY,"font-size":t.value.style.chart.layout.grandTotal.fontSize,"font-weight":t.value.style.chart.layout.grandTotal.bold?"bold":"normal",fill:t.value.style.chart.layout.grandTotal.color,"text-anchor":"middle",onClick:p},e.toDisplayString(e.unref(o.applyDataLabel)(t.value.style.chart.layout.grandTotal.formatter,_.value,e.unref(o.dataLabel)({p:t.value.style.chart.layout.grandTotal.prefix,v:_.value,s:t.value.style.chart.layout.grandTotal.suffix,r:t.value.style.chart.layout.grandTotal.roundingValue}))),9,Ue)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,l=>(e.openBlock(),e.createElementBlock("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value.branchSize,(n,d)=>(e.openBlock(),e.createElementBlock("path",{d:`M
|
|
2
2
|
${l.x1},${l.y1+d}
|
|
3
3
|
C${l.x1-20},${l.y1+d}
|
|
4
4
|
${l.x1-80},${l.y1+d}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as n, computed as m, onMounted as R, onBeforeUnmount as E, openBlock as o, createElementBlock as l, unref as C, normalizeStyle as b, createElementVNode as r, createCommentVNode as a, normalizeClass as p, toDisplayString as x, nextTick as F, pushScopeId as I, popScopeId as L } from "vue";
|
|
2
|
-
import { u as z } from "./useNestedProp-
|
|
3
|
-
import { u as O, c as B, X as N, s as T } from "./index-
|
|
2
|
+
import { u as z } from "./useNestedProp-CcZBkd4B.js";
|
|
3
|
+
import { u as O, c as B, X as N, s as T } from "./index-D6Fux0KL.js";
|
|
4
4
|
import { _ as D } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const g = (i) => (I("data-v-6a1383ea"), i = i(), L(), i), $ = ["xmlns", "height", "width"], W = {
|
|
6
6
|
id: "follower",
|