vue-data-ui 2.11.1 → 2.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Arrow-Djn3xrHB.cjs → Arrow-CogAJvGp.cjs} +1 -1
- package/dist/{Arrow-Ch3m7pIz.js → Arrow-OttzfahM.js} +1 -1
- package/dist/{BaseIcon-D9r5PTQj.js → BaseIcon-CpIcYACc.js} +1 -1
- package/dist/{BaseIcon-ljtRuDne.cjs → BaseIcon-DY-33nfj.cjs} +1 -1
- package/dist/{ColorPicker-DuOr2Ic4.js → ColorPicker-BnsG9Qeu.js} +3 -3
- package/dist/{ColorPicker-CiQtzrYd.cjs → ColorPicker-CrMLe8x_.cjs} +1 -1
- package/dist/{DataTable-p1tKJjJU.js → DataTable-CJOtzfgn.js} +2 -2
- package/dist/{DataTable-CzL8BmEn.cjs → DataTable-CNCnRrD-.cjs} +1 -1
- package/dist/{Legend-COUltTuv.js → Legend-DKQ4psNY.js} +2 -2
- package/dist/{Legend-m-jOk1o6.cjs → Legend-ieOu_fKK.cjs} +1 -1
- package/dist/{PackageVersion-BhpRHJg-.cjs → PackageVersion-BxSGdh6L.cjs} +1 -1
- package/dist/{PackageVersion-Db8Jk3Yz.js → PackageVersion-D-aPPO0L.js} +1 -1
- package/dist/{PenAndPaper-Cr_VFW1Y.cjs → PenAndPaper-ByAFuR-l.cjs} +1 -1
- package/dist/{PenAndPaper-Bleo21mI.js → PenAndPaper-D9g_r8-6.js} +3 -3
- package/dist/{Shape-3lpxIkGY.cjs → Shape-BQIcurpe.cjs} +1 -1
- package/dist/{Shape-DThtou8P.js → Shape-DLjaeo5U.js} +1 -1
- package/dist/{Slicer-BSgrBZJB.js → Slicer-DuqI_UVS.js} +2 -2
- package/dist/{Slicer-D5exzdrG.cjs → Slicer-FXxFjXOP.cjs} +1 -1
- package/dist/{Title-DnNgxDaw.cjs → Title-D62pPwLz.cjs} +1 -1
- package/dist/{Title-C6HOVO5o.js → Title-DIYoufYR.js} +1 -1
- package/dist/{Tooltip-CkPkykAp.js → Tooltip-BFz2yelJ.js} +1 -1
- package/dist/{Tooltip-BcRV15Nk.cjs → Tooltip-C_H6-uAa.cjs} +1 -1
- package/dist/{dom-to-png-dbkxxccc.cjs → dom-to-png-B3SeX1JP.cjs} +1 -1
- package/dist/{dom-to-png-C-xt3eHI.js → dom-to-png-BB-m1MuD.js} +1 -1
- package/dist/{img-B6MWbnlo.cjs → img-Bl4Pt1QH.cjs} +1 -1
- package/dist/{img-CeyprTwt.js → img-Cyr1eIO7.js} +1 -1
- package/dist/{index-BKWunRAY.cjs → index-Cn2tUOoX.cjs} +1 -1
- package/dist/{index-Ckt5xLw3.js → index-d3erwTWB.js} +1 -1
- package/dist/{pdf-BoIy0kYM.cjs → pdf-BQABl7QG.cjs} +1 -1
- package/dist/{pdf-C8Uc-ViT.js → pdf-BQRTRQlZ.js} +1 -1
- package/dist/{useNestedProp-BU5A_H6S.js → useNestedProp-BqKuhIvF.js} +1 -1
- package/dist/{useNestedProp-swJfhg8O.cjs → useNestedProp-C8955nsn.cjs} +1 -1
- package/dist/{usePrinter-Dhf-GWO2.cjs → usePrinter-BrH80VBz.cjs} +1 -1
- package/dist/{usePrinter-Drrm-7ZN.js → usePrinter-CHrKIDM7.js} +3 -3
- package/dist/{vue-data-ui-DEFuCGY2.js → vue-data-ui-BRKcN5_z.js} +63 -63
- package/dist/{vue-data-ui-BwmmF0Rx.cjs → vue-data-ui-BbzW2_-6.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-Dejz1jbq.js → vue-ui-3d-bar-BIw7nTYA.js} +9 -9
- package/dist/{vue-ui-3d-bar-B7HO9mUa.cjs → vue-ui-3d-bar-WFymJ4EL.cjs} +1 -1
- package/dist/{vue-ui-accordion-CACZOsPN.cjs → vue-ui-accordion-7GoAZx3k.cjs} +1 -1
- package/dist/{vue-ui-accordion-CHWjFAdS.js → vue-ui-accordion-BJyaBDyF.js} +3 -3
- package/dist/{vue-ui-age-pyramid-BuI0BAu6.cjs → vue-ui-age-pyramid-DGpLdvsL.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-BCbQzcSN.js → vue-ui-age-pyramid-Dn_061NF.js} +10 -10
- package/dist/{vue-ui-annotator-BVkhLQx1.js → vue-ui-annotator-Y65oZVga.js} +2 -2
- package/dist/{vue-ui-annotator-D3WW79fZ.cjs → vue-ui-annotator-ypStRKCB.cjs} +1 -1
- package/dist/{vue-ui-bullet-Dp-pvoks.js → vue-ui-bullet-B5mjXy0q.js} +8 -8
- package/dist/{vue-ui-bullet-Cu4QFP97.cjs → vue-ui-bullet-C_Ppz5nn.cjs} +1 -1
- package/dist/{vue-ui-candlestick-PL89PKKX.js → vue-ui-candlestick-BIC2-GAV.js} +11 -11
- package/dist/{vue-ui-candlestick-CvzvkTZL.cjs → vue-ui-candlestick-BrDk_pc_.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-pGj3lD-7.cjs → vue-ui-carousel-table-BTxtBHvb.cjs} +1 -1
- package/dist/{vue-ui-carousel-table-CxCDgVti.js → vue-ui-carousel-table-CnvQ0CeQ.js} +4 -4
- package/dist/{vue-ui-chestnut-BCLNZl02.cjs → vue-ui-chestnut-D_NZDyDN.cjs} +1 -1
- package/dist/{vue-ui-chestnut-B59bltYj.js → vue-ui-chestnut-IsRTDol2.js} +8 -8
- package/dist/{vue-ui-chord-I12oZYBZ.cjs → vue-ui-chord-CZ66gJ7w.cjs} +1 -1
- package/dist/{vue-ui-chord-311T5EMM.js → vue-ui-chord-iSsr3a59.js} +12 -12
- package/dist/{vue-ui-circle-pack-ckubmbMP.js → vue-ui-circle-pack-CS2l9IXg.js} +9 -9
- package/dist/{vue-ui-circle-pack-BdEy-F2l.cjs → vue-ui-circle-pack-lGkj98rL.cjs} +1 -1
- package/dist/{vue-ui-cursor-DuaNjqbd.js → vue-ui-cursor-Cq9lPDB7.js} +2 -2
- package/dist/{vue-ui-cursor-CB9lfY2N.cjs → vue-ui-cursor-YZyc0ARl.cjs} +1 -1
- package/dist/{vue-ui-dashboard-z6r_7oqD.js → vue-ui-dashboard-7Cm-15oc.js} +62 -62
- package/dist/{vue-ui-dashboard-BYVM2ULB.cjs → vue-ui-dashboard-jP2U4qtK.cjs} +1 -1
- package/dist/{vue-ui-digits-uhUYI1ca.js → vue-ui-digits-BecNI-j7.js} +2 -2
- package/dist/{vue-ui-digits-DKjgPEvR.cjs → vue-ui-digits-C5PfeED6.cjs} +1 -1
- package/dist/{vue-ui-donut-C7VlH0Dm.cjs → vue-ui-donut-BM9i2XHJ.cjs} +1 -1
- package/dist/{vue-ui-donut-C0Wl5tdn.js → vue-ui-donut-D_bFxovZ.js} +12 -12
- package/dist/{vue-ui-donut-evolution-BSZYlpQ4.js → vue-ui-donut-evolution-C8dlmVur.js} +11 -11
- package/dist/{vue-ui-donut-evolution-DS2dqteq.cjs → vue-ui-donut-evolution-Oga32kTV.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-CTcvX2CT.cjs → vue-ui-dumbbell-ClzXgan7.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-9sEMuWdj.js → vue-ui-dumbbell-Ds41wAQh.js} +10 -10
- package/dist/{vue-ui-flow-wAvTzG20.cjs → vue-ui-flow-Bp1oqzTj.cjs} +1 -1
- package/dist/{vue-ui-flow-Bn6eRbfA.js → vue-ui-flow-CqdSvk4_.js} +11 -11
- package/dist/{vue-ui-funnel-ENbP7k7d.js → vue-ui-funnel-CNDgAWjp.js} +9 -9
- package/dist/{vue-ui-funnel-DQflekb1.cjs → vue-ui-funnel-y3hN7BGU.cjs} +1 -1
- package/dist/{vue-ui-galaxy-B6thZdtp.cjs → vue-ui-galaxy-D5vKPiFH.cjs} +1 -1
- package/dist/{vue-ui-galaxy-BXBlLF0x.js → vue-ui-galaxy-DzUAHZ4G.js} +11 -11
- package/dist/{vue-ui-gauge-TLv35WQu.cjs → vue-ui-gauge-57ahTSbZ.cjs} +1 -1
- package/dist/{vue-ui-gauge-D-BFLHdh.js → vue-ui-gauge-Cj-4ZhyL.js} +7 -7
- package/dist/{vue-ui-gizmo-CupuHUJa.js → vue-ui-gizmo-CCS3u0qr.js} +3 -3
- package/dist/{vue-ui-gizmo-CIDsbSUq.cjs → vue-ui-gizmo-D5_kCO9e.cjs} +1 -1
- package/dist/{vue-ui-heatmap-Df3qLtt5.cjs → vue-ui-heatmap-B8sfOhVF.cjs} +1 -1
- package/dist/{vue-ui-heatmap-Bxy7ffI3.js → vue-ui-heatmap-CBRd8kvj.js} +10 -10
- package/dist/{vue-ui-history-plot-CPbp9vdL.js → vue-ui-history-plot-4XT22zB_.js} +11 -11
- package/dist/{vue-ui-history-plot-CPmQ5Xri.cjs → vue-ui-history-plot-DQVpKlp1.cjs} +1 -1
- package/dist/{vue-ui-kpi-D16IoodO.js → vue-ui-kpi-B-lBgRvZ.js} +3 -3
- package/dist/{vue-ui-kpi-D6wD01aX.cjs → vue-ui-kpi-DjI1yXtc.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-BczPBX3e.cjs → vue-ui-mini-loader-BpAnNEHG.cjs} +1 -1
- package/dist/{vue-ui-mini-loader-CceGVViE.js → vue-ui-mini-loader-_ksyazrb.js} +2 -2
- package/dist/{vue-ui-molecule-uQWB-9XK.cjs → vue-ui-molecule-BqpYPmrd.cjs} +1 -1
- package/dist/{vue-ui-molecule-CrQakNH_.js → vue-ui-molecule-Db_QmLY6.js} +11 -11
- package/dist/{vue-ui-mood-radar-BG9otX9u.cjs → vue-ui-mood-radar-DI_FioVr.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-DahDca5w.js → vue-ui-mood-radar-Y_CGEC1L.js} +11 -11
- package/dist/{vue-ui-nested-donuts-DTNxPtmB.cjs → vue-ui-nested-donuts-B0rJlEH0.cjs} +1 -1
- package/dist/{vue-ui-nested-donuts-XJH9z_wF.js → vue-ui-nested-donuts-DosW9Sfg.js} +11 -11
- package/dist/{vue-ui-onion-rmq2wvkV.cjs → vue-ui-onion-CEHc9oKt.cjs} +1 -1
- package/dist/{vue-ui-onion-BJvveHv1.js → vue-ui-onion-CQwIVcfN.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-DUG7AQBu.cjs → vue-ui-parallel-coordinate-plot-C1sxm3Nr.cjs} +1 -1
- package/dist/{vue-ui-parallel-coordinate-plot-C1A6OGCv.js → vue-ui-parallel-coordinate-plot-Cdu0SvMZ.js} +12 -12
- package/dist/{vue-ui-quadrant-CPUtUNLW.js → vue-ui-quadrant-B8H5sBMi.js} +12 -12
- package/dist/{vue-ui-quadrant-wz9ILTxc.cjs → vue-ui-quadrant-DM3Afg_i.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-D5GV86FD.js → vue-ui-quick-chart-ClB6jwSV.js} +9 -9
- package/dist/{vue-ui-quick-chart-BUCAhqff.cjs → vue-ui-quick-chart-ClJi48bc.cjs} +1 -1
- package/dist/{vue-ui-radar-DgxnT6Ia.js → vue-ui-radar-BTluZs04.js} +12 -12
- package/dist/{vue-ui-radar-DEJQlniz.cjs → vue-ui-radar-f0QY_Mal.cjs} +1 -1
- package/dist/{vue-ui-rating-oHYSjb-S.cjs → vue-ui-rating-B71_TxmN.cjs} +1 -1
- package/dist/{vue-ui-rating-YhL9VCJu.js → vue-ui-rating-CTNYeoXO.js} +2 -2
- package/dist/{vue-ui-relation-circle-CuN880Sz.js → vue-ui-relation-circle-CdHhoGcO.js} +7 -7
- package/dist/{vue-ui-relation-circle-fvzrVyeW.cjs → vue-ui-relation-circle-DHOG2jKh.cjs} +1 -1
- package/dist/{vue-ui-ridgeline-0N6HCsbx.cjs → vue-ui-ridgeline-CxhklaLX.cjs} +1 -1
- package/dist/{vue-ui-ridgeline-DcJqJ4Br.js → vue-ui-ridgeline-Dr6UOfwb.js} +12 -12
- package/dist/{vue-ui-rings-B3NvRyTt.cjs → vue-ui-rings-DoGxh2qe.cjs} +1 -1
- package/dist/{vue-ui-rings-CWVbql32.js → vue-ui-rings-N2mHKtLh.js} +12 -12
- package/dist/{vue-ui-scatter-BomRqjIY.js → vue-ui-scatter-BcJRyqbE.js} +12 -12
- package/dist/{vue-ui-scatter-pm9MRNSF.cjs → vue-ui-scatter-BnRkkP5Z.cjs} +1 -1
- package/dist/{vue-ui-skeleton-Buze5CJ9.js → vue-ui-skeleton-BOtCpAcY.js} +3 -3
- package/dist/{vue-ui-skeleton-D5NShLgw.cjs → vue-ui-skeleton-Mcoev-5q.cjs} +1 -1
- package/dist/{vue-ui-smiley-BwfJxJz1.js → vue-ui-smiley-BPqpTUTh.js} +2 -2
- package/dist/{vue-ui-smiley-2dUYrT8i.cjs → vue-ui-smiley-Ch9trBZA.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-C7iY_86w.js → vue-ui-spark-trend-BXo8mbxJ.js} +5 -5
- package/dist/{vue-ui-spark-trend-CEisuf9v.cjs → vue-ui-spark-trend-PqEN-rL8.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-CRuTBzCm.js → vue-ui-sparkbar-DEsL52nJ.js} +4 -4
- package/dist/{vue-ui-sparkbar-CYBJuXyQ.cjs → vue-ui-sparkbar-DnRQFo63.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-BXiL-H2G.cjs → vue-ui-sparkgauge-C0E5Sojk.cjs} +1 -1
- package/dist/{vue-ui-sparkgauge-DlQVyQjt.js → vue-ui-sparkgauge-DkawMq8d.js} +4 -4
- package/dist/{vue-ui-sparkhistogram-dRHZS69c.cjs → vue-ui-sparkhistogram-Bqtsbb3w.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-B0dDhsh7.js → vue-ui-sparkhistogram-D8ZCXl7m.js} +5 -5
- package/dist/{vue-ui-sparkline--7FAyaV6.cjs → vue-ui-sparkline-BTruGe7A.cjs} +1 -1
- package/dist/{vue-ui-sparkline-BPYP_3F7.js → vue-ui-sparkline-D8LYPXpr.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-DIIJj1wV.cjs → vue-ui-sparkstackbar-DeXUgBIH.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-CW8EOoq6.js → vue-ui-sparkstackbar-DzeVCG0H.js} +5 -5
- package/dist/{vue-ui-stackbar-Ck1yeR-g.cjs → vue-ui-stackbar-CaFp42Tn.cjs} +1 -1
- package/dist/{vue-ui-stackbar-C7VZ5PHn.js → vue-ui-stackbar-DQ9CcKUd.js} +13 -13
- package/dist/{vue-ui-strip-plot-DZMIliYA.js → vue-ui-strip-plot-C6gcQLMI.js} +11 -11
- package/dist/{vue-ui-strip-plot-C2YMIwOm.cjs → vue-ui-strip-plot-DzNU6VRW.cjs} +1 -1
- package/dist/{vue-ui-table-DggvYyBd.js → vue-ui-table-D7azsjo3.js} +3 -3
- package/dist/{vue-ui-table-BR32W2JW.cjs → vue-ui-table-DP2ZaGWa.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-Bl8BJlrP.cjs → vue-ui-table-heatmap-B2gZkAqm.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-Co86evBH.js → vue-ui-table-heatmap-DINNMAyX.js} +4 -4
- package/dist/{vue-ui-table-sparkline-bpl24ydD.js → vue-ui-table-sparkline-BrYh6fVq.js} +5 -5
- package/dist/{vue-ui-table-sparkline-CR4Xo17N.cjs → vue-ui-table-sparkline-CgN2nMYT.cjs} +1 -1
- package/dist/{vue-ui-thermometer-C03In60a.cjs → vue-ui-thermometer-DgZfQbR2.cjs} +1 -1
- package/dist/{vue-ui-thermometer-9fpJItF7.js → vue-ui-thermometer-J0A6MZy_.js} +7 -7
- package/dist/{vue-ui-timer-Jei5BiD_.js → vue-ui-timer-CI8zPXh3.js} +5 -5
- package/dist/{vue-ui-timer-B-GRZP1F.cjs → vue-ui-timer-ClM5FpoU.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-CtojdnkW.cjs → vue-ui-tiremarks-19Krsd1f.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-B8WG2ok9.js → vue-ui-tiremarks-BuNik_Pf.js} +7 -7
- package/dist/{vue-ui-treemap-Cb7cgmml.cjs → vue-ui-treemap-DvmJ1MOU.cjs} +1 -1
- package/dist/{vue-ui-treemap-6KYCNZho.js → vue-ui-treemap-oUtdOGWu.js} +12 -12
- package/dist/{vue-ui-vertical-bar-BEFnicAy.js → vue-ui-vertical-bar-2bHPN2lr.js} +12 -12
- package/dist/{vue-ui-vertical-bar-U38k297l.cjs → vue-ui-vertical-bar-RT-SM-us.cjs} +1 -1
- package/dist/{vue-ui-waffle-BiDUa_mf.cjs → vue-ui-waffle-BSKRUJbJ.cjs} +1 -1
- package/dist/{vue-ui-waffle-DkmwDnZR.js → vue-ui-waffle-BuISvHw-.js} +12 -12
- package/dist/{vue-ui-wheel-DP7fvbGp.js → vue-ui-wheel-CSy7_x22.js} +7 -7
- package/dist/{vue-ui-wheel-_n8mecg5.cjs → vue-ui-wheel-DfBVkT9x.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-D7AN_XSy.cjs → vue-ui-word-cloud-BlfCmzD-.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-QJS8wmHH.js → vue-ui-word-cloud-DEpoSRMP.js} +10 -10
- package/dist/vue-ui-world-Cy1VBlK3.js +931 -0
- package/dist/vue-ui-world-EgFhVXSY.cjs +19 -0
- package/dist/{vue-ui-xy-B31mVrV8.js → vue-ui-xy-PaM6vcjk.js} +16 -16
- package/dist/{vue-ui-xy-DrSTGIwE.cjs → vue-ui-xy-aQEDcKbT.cjs} +2 -2
- package/dist/{vue-ui-xy-canvas-Cb-SSn4j.cjs → vue-ui-xy-canvas-C6-sYgU_.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-CcYTS3qd.js → vue-ui-xy-canvas-CSyX_xLO.js} +12 -12
- package/package.json +1 -1
- package/dist/vue-ui-world-BKjsYsNe.js +0 -931
- package/dist/vue-ui-world-Cwu0_sO2.cjs +0 -19
|
@@ -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-Cn2tUOoX.cjs"),F=require("./useNestedProp-C8955nsn.cjs"),J=require("./Title-D62pPwLz.cjs"),K=require("./Legend-ieOu_fKK.cjs"),I=require("./usePrinter-BrH80VBz.cjs"),Q=require("./PackageVersion-BxSGdh6L.cjs"),Z=require("./PenAndPaper-ByAFuR-l.cjs"),ee=require("./vue-ui-skeleton-Mcoev-5q.cjs"),te=require("./useUserOptionState-BgepsfED.cjs"),ae=require("./useChartAccessibility-Cm7nkzTG.cjs"),le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=["id"],oe={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},se=["xmlns","viewBox"],ne=["width","height"],ue={key:1},ie=["x","y","height","width","fill","stroke"],ce=["x","y","height","width","rx","fill","stroke","stroke-width"],de=["x","y","height","width","fill","stroke","stroke-width"],he=["x","y","font-size","font-weight","fill"],ve=["x","y","height","width","rx","fill","stroke","stroke-width"],me={key:3},ge=["x","y","fill","font-size","font-weight"],fe={key:4},ye=["x1","x2","y1","y2","stroke"],pe={key:5,class:"vue-data-ui-watermark"},ke={class:"vue-ui-bullet-legend-item",dir:"auto"},be={style:{"margin-right":"2px"}},we={key:7,ref:"source",dir:"auto"},Be={__name:"vue-ui-bullet",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(z,{expose:H}){const{vue_ui_bullet:T}=s.useConfig(),n=z,w=e.ref(null),q=e.ref(null),B=e.ref(0),M=e.ref(null),U=e.ref(0),h=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 g, ref as n, watch as Ne, onMounted as Je, onBeforeUnmount as Ke, nextTick as V, createElementBlock as u, openBlock as s, unref as v, normalizeStyle as ee, normalizeClass as Ae, createBlock as _, createCommentVNode as y, createElementVNode as r, createVNode as Te, createSlots as Qe, withCtx as m, renderSlot as f, normalizeProps as z, guardReactiveProps as S, Fragment as I, renderList as F, toDisplayString as P, createTextVNode as Ze } from "vue";
|
|
2
|
-
import { u as et, c as tt, a as lt, C as Ie, o as ot, e as N, D as at, v as U, X as st, w as j, E as ut, s as it, F as Fe, q as nt, r as rt, x as dt, y as vt } from "./index-
|
|
2
|
+
import { u as et, c as tt, a as lt, C as Ie, o as ot, e as N, D as at, v as U, X as st, w as j, E as ut, s as it, F as Fe, q as nt, r as rt, x as dt, y as vt } from "./index-d3erwTWB.js";
|
|
3
3
|
import { t as yt, u as ct } from "./useResponsive-JZ9xq-JV.js";
|
|
4
|
-
import { _ as ht } from "./Title-
|
|
5
|
-
import { u as ft, U as pt } from "./usePrinter-
|
|
6
|
-
import { _ as gt } from "./Tooltip-
|
|
7
|
-
import { D as mt } from "./DataTable-
|
|
8
|
-
import bt from "./vue-ui-skeleton-
|
|
9
|
-
import { S as xt } from "./Slicer-
|
|
10
|
-
import kt from "./vue-ui-accordion-
|
|
11
|
-
import { u as Re } from "./useNestedProp-
|
|
12
|
-
import { _ as wt } from "./PackageVersion-
|
|
13
|
-
import { _ as $t } from "./PenAndPaper-
|
|
4
|
+
import { _ as ht } from "./Title-DIYoufYR.js";
|
|
5
|
+
import { u as ft, U as pt } from "./usePrinter-CHrKIDM7.js";
|
|
6
|
+
import { _ as gt } from "./Tooltip-BFz2yelJ.js";
|
|
7
|
+
import { D as mt } from "./DataTable-CJOtzfgn.js";
|
|
8
|
+
import bt from "./vue-ui-skeleton-BOtCpAcY.js";
|
|
9
|
+
import { S as xt } from "./Slicer-DuqI_UVS.js";
|
|
10
|
+
import kt from "./vue-ui-accordion-BJyaBDyF.js";
|
|
11
|
+
import { u as Re } from "./useNestedProp-BqKuhIvF.js";
|
|
12
|
+
import { _ as wt } from "./PackageVersion-D-aPPO0L.js";
|
|
13
|
+
import { _ as $t } from "./PenAndPaper-D9g_r8-6.js";
|
|
14
14
|
import { u as Ct } from "./useUserOptionState-BIvW1Kz7.js";
|
|
15
15
|
import { u as _t } from "./useChartAccessibility-BWojgys7.js";
|
|
16
16
|
import { _ as zt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
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-Cn2tUOoX.cjs"),de=require("./useResponsive-BBkmXXaa.cjs"),ze=require("./Title-D62pPwLz.cjs"),ce=require("./usePrinter-BrH80VBz.cjs"),Ve=require("./Tooltip-C_H6-uAa.cjs"),Ee=require("./DataTable-CNCnRrD-.cjs"),Te=require("./vue-ui-skeleton-Mcoev-5q.cjs"),Ae=require("./Slicer-FXxFjXOP.cjs"),Fe=require("./vue-ui-accordion-7GoAZx3k.cjs"),ve=require("./useNestedProp-C8955nsn.cjs"),Ie=require("./PackageVersion-BxSGdh6L.cjs"),Pe=require("./PenAndPaper-ByAFuR-l.cjs"),Re=require("./useUserOptionState-BgepsfED.cjs"),Le=require("./useChartAccessibility-Cm7nkzTG.cjs"),Oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ue=["id"],De=["xmlns","viewBox"],Me=["x","y","width","height"],qe={key:1},He=["id"],We=["stop-color"],Ge=["stop-color"],je=["stop-color"],Xe=["id"],Ye=["stop-color"],Je=["stop-color"],Ke=["stop-color"],Qe={key:0},Ze=["x1","x2","y1","y2","stroke","stroke-width"],et=["x1","x2","y1","y2","stroke","stroke-width"],tt={key:1},lt=["x1","x2","y1","y2","stroke","stroke-width"],ot=["x","y","font-size","fill","font-weight"],at={key:2},nt=["transform","text-anchor","font-size","fill","font-weight"],st=["x1","x2","y1","y2","stroke","stroke-width"],ut={key:0},rt=["cx","cy","r","fill"],it=["cx","cy","r","fill"],dt={key:1},ct=["x1","x2","y1","y2","stroke","stroke-width"],vt=["x1","x2","y1","y2","stroke","stroke-width"],yt=["x","y","height","width","fill","rx"],ht=["x","y","height","width","fill","rx","stroke","stroke-width"],pt=["x","y","height","width","fill","onMouseover"],ft={key:5,class:"vue-data-ui-watermark"},mt=["innerHTML"],gt={__name:"vue-ui-candlestick",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(f,{expose:ye}){const{vue_ui_candlestick:he}=s.useConfig(),d=f,x=e.computed(()=>!!d.dataset&&d.dataset.length),h=e.ref(s.createUid()),pe=e.ref(null),V=e.ref(!1),E=e.ref(""),T=e.ref(void 0),R=e.ref(0),b=e.ref(null),L=e.ref(null),O=e.ref(null),U=e.ref(null),D=e.ref(null),M=e.ref(null),C=e.ref(0),q=e.ref(0),H=e.ref(0),t=e.computed({get:()=>X(),set:l=>l}),{userOptionsVisible:A,setUserOptionsVisibility:W,keepUserOptionState:G}=Re.useUserOptionState({config:t.value}),{svgRef:j}=Le.useChartAccessibility({config:t.value.style.title});function X(){const l=ve.useNestedProp({userConfig:d.config,defaultConfig:he});let a={};return l.theme?a={...ve.useNestedProp({userConfig:s.themes.vue_ui_candlestick[l.theme]||d.config,defaultConfig:l})}:a=l,d.config&&s.hasDeepProperty(d.config,"style.zoom.startIndex")?a.style.zoom.startIndex=d.config.style.zoom.startIndex:a.style.zoom.startIndex=null,d.config&&s.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=X(),A.value=!t.value.userOptions.showOnChartHover,Y(),C.value+=1,H.value+=1,q.value+=1,p.value.showTable=t.value.table.show,p.value.showTooltip=t.value.style.tooltip.show},{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(()=>{Y()});function Y(){if(s.objectIsEmpty(d.dataset)&&s.error({componentName:"VueUiCandlestick",type:"dataset"}),t.value.responsive){const l=de.throttle(()=>{const{width:a,height:o}=de.useResponsive({chart:b.value,title:t.value.style.title.text?L.value:null,slicer:U.value,legend:O.value,source:D.value,noTitle:M.value});requestAnimationFrame(()=>{i.value.width=a,i.value.height=o,i.value.xAxisFontSize=s.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=s.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(b.value.parentNode)}le()}e.onBeforeUnmount(()=>{N.value&&N.value.disconnect()});const{isPrinting:J,isImaging:K,generatePdf:Q,generateImage:Z}=ce.usePrinter({elementId:`vue-ui-candlestick_${h.value}`,fileName:t.value.style.title.text||"vue-ui-candlestick",options:t.value.userOptions.print}),fe=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}),u=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}),ee=e.computed(()=>d.dataset.slice(c.value.start,c.value.end)),F=e.computed(()=>(d.dataset.forEach((l,a)=>{[null,void 0].includes(l[0])&&s.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"period (index 0)",index:a}),[null,void 0].includes(l[1])&&s.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"open (index 1)",index:a}),[null,void 0].includes(l[2])&&s.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"high (index 2)",index:a}),[null,void 0].includes(l[3])&&s.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"low (index 3)",index:a}),[null,void 0].includes(l[4])&&s.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"last (index 4)",index:a}),[null,void 0].includes(l[5])&&s.error({componentName:"VueUiCandlestick",type:"datasetAttribute",property:"volume (index 5)",index:a})}),ee.value.map(l=>({period:l[0],open:l[1],high:l[2],low:l[3],last:l[4],volume:l[5]})))),r=e.computed(()=>u.value.width/ee.value.length),te=e.computed(()=>({max:Math.max(...F.value.map(l=>l.high)),min:0})),m=e.computed(()=>s.calculateNiceScale(te.value.min,te.value.max,t.value.style.layout.grid.yAxis.dataLabels.steps));function $(l,a){return{...l,x:s.checkNaN(u.value.left+a*r.value+r.value/2),y:s.checkNaN(u.value.top+(1-l/m.value.max)*u.value.height),value:s.checkNaN(l)}}const v=e.computed(()=>F.value.map((l,a)=>{const o=$(l.open,a),n=$(l.high,a),y=$(l.low,a),_=$(l.last,a),z=l.last>l.open;return{period:l.period,open:o,high:n,low:y,last:_,volume:l.volume,isBullish:z}}));function me(l){return s.checkNaN(l/m.value.max)}const ge=e.computed(()=>m.value.ticks.map(l=>({y:u.value.bottom-u.value.height*me(l),value:s.checkNaN(l)}))),ke=e.computed(()=>F.value.map(l=>l.period)),I=e.ref(null);function xe(l,a){T.value=l,I.value={datapoint:a,seriesIndex:l,series:v.value,config:t.value};const o=t.value.style.tooltip.customFormat;if(s.isFunction(o)&&s.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:_,high:z,low:se,last:ue,volume:re,isBullish:ie}=v.value[l],{period:xt,open:Ne,high:$e,low:Se,last:Be,volume:_e}=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?ie?`url(#bullish_gradient_${h.value})`:`url(#bearish_gradient_${h.value})`:ie?t.value.style.layout.candle.colors.bullish:t.value.style.layout.candle.colors.bearish}"/></svg>${y}</div>`,n+=`${_e} : <b>${isNaN(re)?"-":Number(re.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>${Ne}: <b>${t.value.style.tooltip.prefix} ${isNaN(_.value)?"-":Number(_.value.toFixed(t.value.style.tooltip.roundingValue)).toLocaleString()} ${t.value.style.tooltip.suffix}</b></div>`,n+=`<div>${$e}: <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>${Se}: <b>${t.value.style.tooltip.prefix} ${isNaN(se.value)?"-":Number(se.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(ue.value)?"-":Number(ue.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 be(){le()}const g=e.ref(null);async function le(){(t.value.style.zoom.startIndex!==null||t.value.style.zoom.endIndex!==null)&&g.value?(t.value.style.zoom.startIndex!==null&&(await e.nextTick(),await e.nextTick(),g.value&&g.value.setStartValue(t.value.style.zoom.startIndex)),t.value.style.zoom.endIndex!==null&&(await e.nextTick(),await e.nextTick(),g.value&&g.value.setEndValue(we(t.value.style.zoom.endIndex+1)))):(c.value={start:0,end:w.value},C.value+=1)}function we(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 oe(){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=s.createCsvContent(o);s.downloadCsv({csvContent:n,title:t.value.style.title.text||"vue-ui-candlestick"})})}const S=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}}),k=e.ref(!1);function Ce(l){k.value=l,R.value+=1}function ae(){p.value.showTable=!p.value.showTable}function ne(){p.value.showTooltip=!p.value.showTooltip}const B=e.ref(!1);function P(){B.value=!B.value}return ye({generatePdf:Q,generateCsv:oe,generateImage:Z,toggleTable:ae,toggleTooltip:ne,toggleAnnotator:P}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"candlestickChart",ref:b,class:e.normalizeClass(`vue-ui-candlestick ${k.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}`,onMouseenter:a[4]||(a[4]=()=>e.unref(W)(!0)),onMouseleave:a[5]||(a[5]=()=>e.unref(W)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Pe._sfc_main,{key:0,svgRef:e.unref(j),backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,active:B.value,onClose:P},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),fe.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(ze._sfc_main,{key:`title_${H.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&&x.value&&(e.unref(G)||e.unref(A))?(e.openBlock(),e.createBlock(ce.UserOptions,{ref_key:"details",ref:pe,key:`user_options_${R.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(K),isPrinting:e.unref(J),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:k.value,isTooltip:p.value.showTooltip,titles:{...t.value.userOptions.buttonTitles},chartElement:b.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:Ce,onGeneratePdf:e.unref(Q),onGenerateCsv:oe,onGenerateImage:e.unref(Z),onToggleTable:ae,onToggleTooltip:ne,onToggleAnnotator:P,style:e.normalizeStyle({visibility:e.unref(G)?e.unref(A)?"visible":"hidden":"visible"})},e.createSlots({_:2},[l.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:o,color:n})=>[e.renderSlot(l.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:o,color:n})),void 0,!0)]),key:"0"}:void 0,l.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTooltip",{},void 0,!0)]),key:"1"}:void 0,l.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionPdf",{},void 0,!0)]),key:"2"}:void 0,l.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionCsv",{},void 0,!0)]),key:"3"}:void 0,l.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionImg",{},void 0,!0)]),key:"4"}:void 0,l.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(l.$slots,"optionTable",{},void 0,!0)]),key:"5"}:void 0,l.$slots.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:"6"}: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:"7"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","isTooltip","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),x.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:j,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.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(Ie._sfc_main),l.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:u.value.left,y:u.value.top,width:u.value.width,height:u.value.height,style:{pointerEvents:"none"}},[e.renderSlot(l.$slots,"chart-background",{},void 0,!0)],8,Me)):e.createCommentVNode("",!0),v.value.length>0?(e.openBlock(),e.createElementBlock("g",qe,[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,We),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(s.shiftHue)(t.value.style.layout.candle.colors.bearish,.02)}DE`},null,8,Ge),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(s.shiftHue)(t.value.style.layout.candle.colors.bearish,.05)}66`},null,8,je)],8,He),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,Ye),e.createElementVNode("stop",{offset:"50%","stop-color":`${e.unref(s.shiftHue)(t.value.style.layout.candle.colors.bullish,.02)}DE`},null,8,Je),e.createElementVNode("stop",{offset:"100%","stop-color":`${e.unref(s.shiftHue)(t.value.style.layout.candle.colors.bullish,.05)}66`},null,8,Ke)],8,Xe)]),t.value.style.layout.grid.show?(e.openBlock(),e.createElementBlock("g",Qe,[e.createElementVNode("line",{x1:u.value.left,x2:u.value.left,y1:u.value.top,y2:u.value.bottom,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,Ze),e.createElementVNode("line",{x1:u.value.left,x2:u.value.right,y1:u.value.bottom,y2:u.value.bottom,stroke:t.value.style.layout.grid.stroke,"stroke-width":t.value.style.layout.grid.strokeWidth,"stroke-linecap":"round"},null,8,et)])):e.createCommentVNode("",!0),t.value.style.layout.grid.yAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",tt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.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:u.value.left,x2:u.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,lt)):e.createCommentVNode("",!0),o.value>=m.value.min&&o.value<=m.value.max?(e.openBlock(),e.createElementBlock("text",{key:1,x:u.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(s.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,ot)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),t.value.style.layout.grid.xAxis.dataLabels.show?(e.openBlock(),e.createElementBlock("g",at,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,(o,n)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("text",{transform:`translate(${u.value.left+r.value*n+r.value/2}, ${u.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,nt)]))),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,st),t.value.style.layout.wick.extremity.shape==="circle"?(e.openBlock(),e.createElementBlock("g",ut,[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,rt),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,it)])):e.createCommentVNode("",!0),t.value.style.layout.wick.extremity.shape==="line"?(e.openBlock(),e.createElementBlock("g",dt,[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,ct),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,vt)])):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,yt))),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,ht))),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:u.value.left+n*r.value,y:u.value.top,height:u.value.height<=0?1e-4:u.value.height,width:r.value<=0?1e-4:r.value,fill:T.value===n?e.unref(s.setOpacity)(t.value.style.layout.selector.color,t.value.style.layout.selector.opacity):"transparent",onMouseover:y=>xe(n,o),onMouseleave:a[0]||(a[0]=y=>{T.value=void 0,V.value=!1})},null,40,pt))),256))])])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"svg",{svg:i.value},void 0,!0)],14,De)):e.createCommentVNode("",!0),l.$slots.watermark?(e.openBlock(),e.createElementBlock("div",ft,[e.renderSlot(l.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(J)||e.unref(K)})),void 0,!0)])):e.createCommentVNode("",!0),x.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Te.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&&x.value?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"chartSlicer",ref:U},[(e.openBlock(),e.createBlock(Ae.Slicer,{ref_key:"slicerComponent",ref:g,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,enableRangeHandles:t.value.style.zoom.enableRangeHandles,enableSelectionDrag:t.value.style.zoom.enableSelectionDrag,onReset:be},{"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","enableRangeHandles","enableSelectionDrag"]))],512)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"chartLegend",ref:O},[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(Ve._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:b.value,content:E.value,isFullscreen:k.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({...I.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(l.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...I.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isFullscreen","isCustom"]),x.value?(e.openBlock(),e.createBlock(Fe.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(Ee.DataTable,{key:`table_${q.value}`,colNames:S.value.colNames,head:S.value.head,body:S.value.body,config:S.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,mt)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Ue))}},kt=Oe._export_sfc(gt,[["__scopeId","data-v-83916fa7"]]);exports.default=kt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-BKWunRAY.cjs"),ue=require("./useNestedProp-swJfhg8O.cjs"),Q=require("./usePrinter-Dhf-GWO2.cjs"),se=require("./vue-ui-skeleton-D5NShLgw.cjs"),de=require("./useUserOptionState-BgepsfED.cjs"),ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],pe=["height"],fe=["data-cell","height"],me={key:2,ref:"source",dir:"auto"},he={__name:"vue-ui-carousel-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(b,{expose:W}){const{vue_ui_carousel_table:Y}=u.useConfig(),r=b,x=e.ref(u.createUid()),z=e.ref(!1),k=e.ref(!!r.dataset),Z=e.useSlots();e.onMounted(()=>{F()}),e.onMounted(()=>{Z["chart-background"]&&console.warn("VueUiCarouselTable does not support the #chart-background slot.")});function F(){u.objectIsEmpty(r.dataset)?u.error({componentName:"VueUiCarouselTable",type:"dataset"}):((!r.dataset.head||u.objectIsEmpty(r.dataset.head))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"head"}),k.value=!1),(!r.dataset.body||u.objectIsEmpty(r.dataset.body))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"body"}),k.value=!1))}const t=e.computed({get:()=>V(),set:o=>o}),{userOptionsVisible:A,setUserOptionsVisibility:P,keepUserOptionState:N}=de.useUserOptionState({config:t.value});function V(){return ue.useNestedProp({userConfig:r.config,defaultConfig:Y})}e.watch(()=>r.config,o=>{t.value=V(),A.value=!t.value.userOptions.showOnChartHover,F()},{deep:!0}),e.watch(()=>r.dataset,o=>{O()},{deep:!0});const{isPrinting:R,isImaging:M,generatePdf:_,generateImage:q}=Q.usePrinter({elementId:`carousel-table_${x.value}`,fileName:t.value.caption.text||"vue-ui-carousel-table",options:t.value.userOptions.print}),v=e.ref({showAnimation:t.value.animation.use}),l=e.ref(null),U=e.ref(null),C=e.ref(null),T=e.ref(null),$=e.ref(0),B=e.ref(0),S=e.ref(!1),w=e.ref(null),f=e.ref(null),y=e.ref(0);function O(){w.value&&(f.value={elements:w.value.getElementsByTagName("tr"),heights:Array.from(w.value.getElementsByTagName("tr")).map(o=>o.getBoundingClientRect().height)})}e.onMounted(O);const ee=e.computed(()=>!f.value||!f.value.heights.length?0:Math.max(...f.value.heights)+$.value+B.value),te=e.computed(()=>r.dataset.body?t.value.tbody.tr.visible<=r.dataset.body.length?t.value.tbody.tr.visible:r.dataset.body.length:0),oe=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)*te.value+$.value+B.value),d=e.ref(0),m=e.ref(null),s=e.ref(0),h=e.ref(!1),H=e.ref(0);e.onMounted(()=>{C.value&&($.value=C.value.getBoundingClientRect().height),T.value&&(B.value=T.value.getBoundingClientRect().height),v.value.showAnimation&&f.value&&L()}),e.onMounted(()=>{if(l.value){let a=function(){const i=o.getBoundingClientRect().bottom;n.forEach(p=>{p.getBoundingClientRect().top<i?p.style.visibility="hidden":p.style.visibility="visible"})};const o=l.value.querySelector("thead"),n=Array.from(w.value.querySelectorAll("tr"));l.value.addEventListener("scroll",a),a(),e.onBeforeUnmount(()=>{l.value.removeEventListener("scroll",a)})}});function ae(o){z.value=o,H.value+=1}function L(){!m.value&&!h.value&&(t.value.animation.type==="scroll"?m.value=requestAnimationFrame(D):m.value=requestAnimationFrame(G))}function ne(){if(!l.value)return!1;const{scrollTop:o,scrollHeight:n,clientHeight:a}=l.value;return o+a>=n}function D(o){if(h.value)return;s.value||(s.value=o),o-s.value>=t.value.animation.speedMs&&(d.value+=f.value.heights[y.value],(ne()||y.value>=f.value.heights.length)&&(d.value=0,y.value=-1),y.value+=1,l.value&&l.value.scrollTo({top:d.value,behavior:"smooth"}),s.value=o),m.value=requestAnimationFrame(D)}function G(o){if(h.value)return;s.value||(s.value=o);const n=o-s.value,a=t.value.animation.speedMs/4/1e3;n>=a&&(d.value+=a,d.value>=l.value.scrollHeight-l.value.clientHeight&&(d.value=0),l.value&&l.value.scrollTo({top:d.value,behavior:"auto"}),s.value=o),m.value=requestAnimationFrame(G)}function c(){h.value=!0,cancelAnimationFrame(m.value),m.value=null}e.onBeforeUnmount(c);function g(){!h.value||!v.value.showAnimation||(h.value=!1,s.value=0,L())}function le(){t.value.animation.pauseOnHover&&c()}const I=e.ref(null);function re(){c(),clearTimeout(I.value)}function j(){clearTimeout(I.value),I.value=setTimeout(g,1e3)}e.watch(()=>t.value.animation.use,o=>{o?(v.value.showAnimation=!0,g()):(v.value.showAnimation=!1,c())}),e.watch(()=>t.value.animation.type,o=>{c(),d.value=0,y.value=0,l.value.scrollTo({top:0,behavior:"auto"}),g()});const ie=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{const o=new ResizeObserver(n=>{n.forEach(a=>{S.value=a.contentRect.width<ie.value}),$.value=C.value?C.value.getBoundingClientRect().height:0,B.value=T.value?T.value.getBoundingClientRect().height:0,y.value=0,e.nextTick(()=>{c(),s.value=0,d.value=0,O(),g()})});l.value&&o.observe(l.value)});function X(){_()}function J(){v.value.showAnimation=!v.value.showAnimation,v.value.showAnimation?g():c()}function K(){e.nextTick(()=>{const o=r.dataset.head.map((i,p)=>[[r.dataset.body[p]]]),n=[[t.value.caption.text],[r.dataset.head.map(i=>[i])]].concat(o),a=u.createCsvContent(n);u.downloadCsv({csvContent:a,title:t.value.caption.text||"vue-ui-carousel-table"})})}return W({pauseAnimation:c,resumeAnimation:g,toggleAnimation:J,generateCsv:K,generatePdf:X,generateImage:q}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-carousel-table",style:{position:"relative",overflow:"visible"},ref_key:"chartContainer",ref:U,onMouseenter:n[5]||(n[5]=()=>e.unref(P)(!0)),onMouseleave:n[6]||(n[6]=()=>e.unref(P)(!1))},[e.createElementVNode("div",{ref_key:"tableContainer",ref:l,id:`carousel-table_${x.value}`,style:e.normalizeStyle({height:e.unref(R)||e.unref(M)?"auto":`${Math.max(oe.value,ee.value)}px`,containerType:"inline-size",position:"relative",overflow:"auto",fontFamily:t.value.fontFamily}),class:e.normalizeClass({"vue-ui-responsive":S.value,"is-playing":t.value.scrollbar.hide||!h.value&&t.value.scrollbar.showOnlyOnHover}),onMouseover:n[0]||(n[0]=a=>le()),onMouseleave:n[1]||(n[1]=a=>g()),onTouchstart:n[2]||(n[2]=a=>re()),onTouchend:n[3]||(n[3]=a=>j()),onTouchcancel:n[4]||(n[4]=a=>j())},[k.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:C,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:S.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?$.value:0}px`,zIndex:1})},[e.createElementVNode("tr",{ref_key:"tableRow",ref:T,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:S.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(b.dataset.head,(a,i)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",key:`th_${i}`,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.mergeProps({ref_for:!0},{th:a,colIndex:i}),void 0,!0)],4))),128))],12,pe)],4),b.dataset.body&&b.dataset.head?(e.openBlock(),e.createElementBlock("tbody",{key:0,ref_key:"tbody",ref:w,style:{clipPath:"inset(0,0,0,0)"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.dataset.body,(a,i)=>(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,(p,E)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":b.dataset.head[E]||"",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,i%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?"":p)+" ",1),e.renderSlot(o.$slots,"td",e.mergeProps({ref_for:!0},{td:p,rowIndex:i,colIndex:E}),void 0,!0)],12,fe))),256))],4))),256))],512)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],46,ce),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(se.default,{key:0,config:{type:"table"}})),t.value.userOptions.show&&k.value&&(e.unref(N)||e.unref(A))?(e.openBlock(),e.createBlock(Q.UserOptions,{ref:"details",key:`user_option_${H.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isPrinting:e.unref(R),isImaging:e.unref(M),uid:x.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:!v.value.showAnimation,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:z.value,chartElement:U.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},zIndex:3,offsetX:12,onGeneratePdf:X,onGenerateCsv:K,onGenerateImage:e.unref(q),onToggleAnimation:J,onToggleFullscreen:ae,style:e.normalizeStyle({visibility:e.unref(N)?e.unref(A)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:a,color:i})=>[e.renderSlot(o.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:a,color:i})),void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionAnimation?{name:"optionAnimation",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionAnimation",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:i})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasAnimation","isAnimation","hasFullscreen","isFullscreen","chartElement","position","titles","onGenerateImage","style"])):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",me,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],544))}},ge=ve._export_sfc(he,[["__scopeId","data-v-751c3b08"]]);exports.default=ge;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-Cn2tUOoX.cjs"),ue=require("./useNestedProp-C8955nsn.cjs"),Q=require("./usePrinter-BrH80VBz.cjs"),se=require("./vue-ui-skeleton-Mcoev-5q.cjs"),de=require("./useUserOptionState-BgepsfED.cjs"),ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=["id"],pe=["height"],fe=["data-cell","height"],me={key:2,ref:"source",dir:"auto"},he={__name:"vue-ui-carousel-table",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},setup(b,{expose:W}){const{vue_ui_carousel_table:Y}=u.useConfig(),r=b,x=e.ref(u.createUid()),z=e.ref(!1),k=e.ref(!!r.dataset),Z=e.useSlots();e.onMounted(()=>{F()}),e.onMounted(()=>{Z["chart-background"]&&console.warn("VueUiCarouselTable does not support the #chart-background slot.")});function F(){u.objectIsEmpty(r.dataset)?u.error({componentName:"VueUiCarouselTable",type:"dataset"}):((!r.dataset.head||u.objectIsEmpty(r.dataset.head))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"head"}),k.value=!1),(!r.dataset.body||u.objectIsEmpty(r.dataset.body))&&(u.error({componentName:"VueUiCarouselTable",type:"datasetAttribute",property:"body"}),k.value=!1))}const t=e.computed({get:()=>V(),set:o=>o}),{userOptionsVisible:A,setUserOptionsVisibility:P,keepUserOptionState:N}=de.useUserOptionState({config:t.value});function V(){return ue.useNestedProp({userConfig:r.config,defaultConfig:Y})}e.watch(()=>r.config,o=>{t.value=V(),A.value=!t.value.userOptions.showOnChartHover,F()},{deep:!0}),e.watch(()=>r.dataset,o=>{O()},{deep:!0});const{isPrinting:R,isImaging:M,generatePdf:_,generateImage:q}=Q.usePrinter({elementId:`carousel-table_${x.value}`,fileName:t.value.caption.text||"vue-ui-carousel-table",options:t.value.userOptions.print}),v=e.ref({showAnimation:t.value.animation.use}),l=e.ref(null),U=e.ref(null),C=e.ref(null),T=e.ref(null),$=e.ref(0),B=e.ref(0),S=e.ref(!1),w=e.ref(null),f=e.ref(null),y=e.ref(0);function O(){w.value&&(f.value={elements:w.value.getElementsByTagName("tr"),heights:Array.from(w.value.getElementsByTagName("tr")).map(o=>o.getBoundingClientRect().height)})}e.onMounted(O);const ee=e.computed(()=>!f.value||!f.value.heights.length?0:Math.max(...f.value.heights)+$.value+B.value),te=e.computed(()=>r.dataset.body?t.value.tbody.tr.visible<=r.dataset.body.length?t.value.tbody.tr.visible:r.dataset.body.length:0),oe=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)*te.value+$.value+B.value),d=e.ref(0),m=e.ref(null),s=e.ref(0),h=e.ref(!1),H=e.ref(0);e.onMounted(()=>{C.value&&($.value=C.value.getBoundingClientRect().height),T.value&&(B.value=T.value.getBoundingClientRect().height),v.value.showAnimation&&f.value&&L()}),e.onMounted(()=>{if(l.value){let a=function(){const i=o.getBoundingClientRect().bottom;n.forEach(p=>{p.getBoundingClientRect().top<i?p.style.visibility="hidden":p.style.visibility="visible"})};const o=l.value.querySelector("thead"),n=Array.from(w.value.querySelectorAll("tr"));l.value.addEventListener("scroll",a),a(),e.onBeforeUnmount(()=>{l.value.removeEventListener("scroll",a)})}});function ae(o){z.value=o,H.value+=1}function L(){!m.value&&!h.value&&(t.value.animation.type==="scroll"?m.value=requestAnimationFrame(D):m.value=requestAnimationFrame(G))}function ne(){if(!l.value)return!1;const{scrollTop:o,scrollHeight:n,clientHeight:a}=l.value;return o+a>=n}function D(o){if(h.value)return;s.value||(s.value=o),o-s.value>=t.value.animation.speedMs&&(d.value+=f.value.heights[y.value],(ne()||y.value>=f.value.heights.length)&&(d.value=0,y.value=-1),y.value+=1,l.value&&l.value.scrollTo({top:d.value,behavior:"smooth"}),s.value=o),m.value=requestAnimationFrame(D)}function G(o){if(h.value)return;s.value||(s.value=o);const n=o-s.value,a=t.value.animation.speedMs/4/1e3;n>=a&&(d.value+=a,d.value>=l.value.scrollHeight-l.value.clientHeight&&(d.value=0),l.value&&l.value.scrollTo({top:d.value,behavior:"auto"}),s.value=o),m.value=requestAnimationFrame(G)}function c(){h.value=!0,cancelAnimationFrame(m.value),m.value=null}e.onBeforeUnmount(c);function g(){!h.value||!v.value.showAnimation||(h.value=!1,s.value=0,L())}function le(){t.value.animation.pauseOnHover&&c()}const I=e.ref(null);function re(){c(),clearTimeout(I.value)}function j(){clearTimeout(I.value),I.value=setTimeout(g,1e3)}e.watch(()=>t.value.animation.use,o=>{o?(v.value.showAnimation=!0,g()):(v.value.showAnimation=!1,c())}),e.watch(()=>t.value.animation.type,o=>{c(),d.value=0,y.value=0,l.value.scrollTo({top:0,behavior:"auto"}),g()});const ie=e.computed(()=>t.value.responsiveBreakpoint);e.onMounted(()=>{const o=new ResizeObserver(n=>{n.forEach(a=>{S.value=a.contentRect.width<ie.value}),$.value=C.value?C.value.getBoundingClientRect().height:0,B.value=T.value?T.value.getBoundingClientRect().height:0,y.value=0,e.nextTick(()=>{c(),s.value=0,d.value=0,O(),g()})});l.value&&o.observe(l.value)});function X(){_()}function J(){v.value.showAnimation=!v.value.showAnimation,v.value.showAnimation?g():c()}function K(){e.nextTick(()=>{const o=r.dataset.head.map((i,p)=>[[r.dataset.body[p]]]),n=[[t.value.caption.text],[r.dataset.head.map(i=>[i])]].concat(o),a=u.createCsvContent(n);u.downloadCsv({csvContent:a,title:t.value.caption.text||"vue-ui-carousel-table"})})}return W({pauseAnimation:c,resumeAnimation:g,toggleAnimation:J,generateCsv:K,generatePdf:X,generateImage:q}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-carousel-table",style:{position:"relative",overflow:"visible"},ref_key:"chartContainer",ref:U,onMouseenter:n[5]||(n[5]=()=>e.unref(P)(!0)),onMouseleave:n[6]||(n[6]=()=>e.unref(P)(!1))},[e.createElementVNode("div",{ref_key:"tableContainer",ref:l,id:`carousel-table_${x.value}`,style:e.normalizeStyle({height:e.unref(R)||e.unref(M)?"auto":`${Math.max(oe.value,ee.value)}px`,containerType:"inline-size",position:"relative",overflow:"auto",fontFamily:t.value.fontFamily}),class:e.normalizeClass({"vue-ui-responsive":S.value,"is-playing":t.value.scrollbar.hide||!h.value&&t.value.scrollbar.showOnlyOnHover}),onMouseover:n[0]||(n[0]=a=>le()),onMouseleave:n[1]||(n[1]=a=>g()),onTouchstart:n[2]||(n[2]=a=>re()),onTouchend:n[3]||(n[3]=a=>j()),onTouchcancel:n[4]||(n[4]=a=>j())},[k.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:C,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:S.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?$.value:0}px`,zIndex:1})},[e.createElementVNode("tr",{ref_key:"tableRow",ref:T,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:S.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(b.dataset.head,(a,i)=>(e.openBlock(),e.createElementBlock("th",{role:"cell",key:`th_${i}`,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.mergeProps({ref_for:!0},{th:a,colIndex:i}),void 0,!0)],4))),128))],12,pe)],4),b.dataset.body&&b.dataset.head?(e.openBlock(),e.createElementBlock("tbody",{key:0,ref_key:"tbody",ref:w,style:{clipPath:"inset(0,0,0,0)"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.dataset.body,(a,i)=>(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,(p,E)=>(e.openBlock(),e.createElementBlock("td",{role:"cell","data-cell":b.dataset.head[E]||"",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,i%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?"":p)+" ",1),e.renderSlot(o.$slots,"td",e.mergeProps({ref_for:!0},{td:p,rowIndex:i,colIndex:E}),void 0,!0)],12,fe))),256))],4))),256))],512)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],46,ce),k.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(se.default,{key:0,config:{type:"table"}})),t.value.userOptions.show&&k.value&&(e.unref(N)||e.unref(A))?(e.openBlock(),e.createBlock(Q.UserOptions,{ref:"details",key:`user_option_${H.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isPrinting:e.unref(R),isImaging:e.unref(M),uid:x.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:!v.value.showAnimation,hasFullscreen:t.value.userOptions.buttons.fullscreen,isFullscreen:z.value,chartElement:U.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},zIndex:3,offsetX:12,onGeneratePdf:X,onGenerateCsv:K,onGenerateImage:e.unref(q),onToggleAnimation:J,onToggleFullscreen:ae,style:e.normalizeStyle({visibility:e.unref(N)?e.unref(A)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:a,color:i})=>[e.renderSlot(o.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:a,color:i})),void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionAnimation?{name:"optionAnimation",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionAnimation",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:a,isFullscreen:i})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:a,isFullscreen:i})),void 0,!0)]),key:"5"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasAnimation","isAnimation","hasFullscreen","isFullscreen","chartElement","position","titles","onGenerateImage","style"])):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",me,[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0)],544))}},ge=ve._export_sfc(he,[["__scopeId","data-v-751c3b08"]]);exports.default=ge;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ref as n, useSlots as Fe, onMounted as A, computed as P, watch as E, onBeforeUnmount as ve, nextTick as pe, createElementBlock as v, openBlock as u, unref as r, createElementVNode as H, createBlock as ce, createCommentVNode as R, normalizeClass as Be, normalizeStyle as f, createTextVNode as L, renderSlot as p, toDisplayString as G, Fragment as D, renderList as X, mergeProps as fe, createSlots as Pe, withCtx as w, normalizeProps as he, guardReactiveProps as me } from "vue";
|
|
2
|
-
import { u as Re, c as ze, o as j, e as J, s as Se, q as Ee, r as He } from "./index-
|
|
3
|
-
import { u as Ne } from "./useNestedProp-
|
|
4
|
-
import { u as Ue, U as Ve } from "./usePrinter-
|
|
5
|
-
import Me from "./vue-ui-skeleton-
|
|
2
|
+
import { u as Re, c as ze, o as j, e as J, s as Se, q as Ee, r as He } from "./index-d3erwTWB.js";
|
|
3
|
+
import { u as Ne } from "./useNestedProp-BqKuhIvF.js";
|
|
4
|
+
import { u as Ue, U as Ve } from "./usePrinter-CHrKIDM7.js";
|
|
5
|
+
import Me from "./vue-ui-skeleton-BOtCpAcY.js";
|
|
6
6
|
import { u as qe } from "./useUserOptionState-BIvW1Kz7.js";
|
|
7
7
|
import { _ as Le } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
const Ge = ["id"], De = ["height"], Xe = ["data-cell", "height"], je = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-BKWunRAY.cjs"),ee=require("./usePrinter-Dhf-GWO2.cjs"),ge=require("./vue-ui-skeleton-D5NShLgw.cjs"),ke=require("./BaseIcon-ljtRuDne.cjs"),_e=require("./vue-ui-accordion-CACZOsPN.cjs"),te=require("./useNestedProp-swJfhg8O.cjs"),xe=require("./PackageVersion-BhpRHJg-.cjs"),Be=require("./PenAndPaper-Cr_VFW1Y.cjs"),Ee=require("./useUserOptionState-BgepsfED.cjs"),Ne=require("./useChartAccessibility-Cm7nkzTG.cjs"),Se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ce=["id"],we={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ze=["xmlns","viewBox"],Ve=["width","height"],$e={key:1},Te=["fill","font-weight","font-size","x","y"],Fe=["fill","font-weight","font-size","x","y"],Le=["id"],De=["stop-color"],Oe=["stop-color"],Pe=["id"],Ie=["stop-color"],Me=["stop-color"],Re=["id"],Ae=["stop-color"],Xe=["stop-color"],je=["stop-color"],Ge=["id"],Ue=["stop-color"],qe=["stop-color"],Ye=["stop-color"],He=["id"],We=["stop-color"],Ke=["stop-color"],Je=["stop-color"],Qe={key:2},Ze=["x","y","font-size","font-weight","fill"],et=["x","y","font-size","font-weight","fill"],tt=["d","stroke"],lt=["cx","cy","r","fill"],at=["cx","cy","r","fill","stroke","stroke-width","onClick"],ot={key:3},nt=["x","y","font-size","fill","onClick"],rt={key:0},st=["x","y","fill","font-size","font-weight"],ut=["x","y","height","width","fill","rx","onClick"],ct=["x","y","height","width","fill","rx","stroke","stroke-width","onClick"],it={key:4},dt=["x","y","fill","font-size","onClick"],yt=["d","stroke"],vt=["fill","cx","cy","r","onClick"],ht={key:5},pt=["x","y","font-size","font-weight","fill"],ft=["x1","x2","y1","y2","stroke","stroke-width"],mt=["y","height","width"],bt={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},gt={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},kt={viewBox:"0 0 20 20",height:"16",width:"16"},_t=["fill"],xt={key:7},Bt=["y","height","width"],Et={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},Nt={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},St={viewBox:"0 0 20 20",height:"16",width:"16"},Ct=["fill"],wt=["cx","cy","fill"],zt=["d","stroke"],Vt=["cx","cy","fill"],$t=["d","stroke"],Tt=["cx","cy","fill"],Ft=["cx","cy","fill"],Lt=["x","y","fill","font-size","font-weight"],Dt=["x","y","fill","font-size","font-weight"],Ot=["x","text-anchor","y","fill","font-size"],Pt=["x","text-anchor","y","fill","font-size"],It=["x","text-anchor","y","fill","font-size"],Mt=["x","text-anchor","y","fill","font-size"],Rt=["x","text-anchor","y","fill","font-size"],At=["x","y","font-size","fill"],Xt=["x","y","font-size","fill"],jt=["x","y","font-size","fill"],Gt={key:4,class:"vue-data-ui-watermark"},Ut={key:6,ref:"source",dir:"auto"},qt={style:{"padding-top":"36px",position:"relative"}},Yt={class:"vue-ui-data-table"},Ht={key:0},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={key:0},bl={key:1},gl=["data-cell"],kl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},_l={key:0},xl={key:1},Bl=["data-cell"],El={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Nl=["data-cell"],Sl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Cl=["data-cell"],wl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},zl=["data-cell"],Vl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},$l=["data-cell"],Tl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Fl={__name:"vue-ui-chestnut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectRoot","selectBranch","selectNut"],setup(le,{expose:ae,emit:oe}){e.useCssVars(a=>({"4b8440b7":a.tdo}));const{vue_ui_chestnut:ne}=o.useConfig(),k=le,z=e.computed(()=>!!k.dataset&&k.dataset.length),h=e.ref(o.createUid()),I=e.ref(null),re=e.ref(null),M=e.ref(0),t=e.computed({get:()=>j(),set:a=>a}),{userOptionsVisible:T,setUserOptionsVisibility:R,keepUserOptionState:A}=Ee.useUserOptionState({config:t.value}),{svgRef:X}=Ne.useChartAccessibility({config:t.value.style.chart.layout.title});function j(){const a=te.useNestedProp({userConfig:k.config,defaultConfig:ne});return a.theme?{...te.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=j(),T.value=!t.value.userOptions.showOnChartHover,S.value.showTable=t.value.table.show,J()},{deep:!0});const{isPrinting:G,isImaging:U,generatePdf:q,generateImage:Y}=ee.usePrinter({elementId:`vue-ui-chestnut_${h.value}`,fileName:t.value.style.chart.layout.title.text||"vue-ui-chestnut",options:t.value.userOptions.print}),se=e.computed(()=>t.value.userOptions.show),F=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),S=e.ref({showTable:t.value.table.show}),L=e.ref(null),H=e.ref(!1),ue=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 ce(){return m.value}const C=oe,ie=e.computed(()=>m.value.flatMap(a=>a.branches).length),de=e.computed(()=>Math.max(...m.value.map(a=>a.branches.map(s=>s.value).reduce((s,l)=>s+l,0)))),ye=e.computed(()=>Math.max(...m.value.flatMap(a=>a.branches.map(s=>s.value)))),W=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/de.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}})),ve=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),he=e.computed(()=>B.value.flatMap(a=>a.branches)),E=e.computed(()=>he.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:W.value,x2:384*a.value/ye.value*ve.value+W.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 pe(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),C("selectNut",a.breakdown)})}function N(){u.value=null,x.value=null,C("selectNut",null)}function O(a){v.value&&v.value.id===a.id?(v.value=null,p(),C("selectBranch",null)):(p(),v.value=a,C("selectBranch",a))}function K(a){b.value&&b.value.id===a.id?(p(),C("selectRoot",null)):(p(),b.value=a,C("selectRoot",a))}function fe(){return f.value.bottom-(u.value.y1+180)<0?0:f.value.bottom}function w(a){return a.proportion*100>t.value.style.chart.layout.nuts.selected.labels.dataLabels.hideUnderValue}function me(){const a=new ResizeObserver(s=>{s.forEach(l=>{H.value=l.contentRect.width<ue.value})});L.value&&a.observe(L.value)}e.onMounted(()=>{J()});function J(){o.objectIsEmpty(k.dataset)&&o.error({componentName:"VueUiChestnut",type:"dataset"});const a=ie.value*(r.value.branchSize+r.value.gap)+r.value.padding.top+r.value.padding.bottom;r.value.height=a,me()}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,Dl)=>y.table)));return{head:a,body:s}});function Q(){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 be(a){V.value=a,M.value+=1}function Z(){S.value.showTable=!S.value.showTable}const $=e.ref(!1);function P(){$.value=!$.value}return ae({getData:ce,generatePdf:q,generateCsv:Q,generateImage:Y,toggleTable:Z,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:I,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}`),onMouseenter:s[2]||(s[2]=()=>e.unref(R)(!0)),onMouseleave:s[3]||(s[3]=()=>e.unref(R)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Be._sfc_main,{key:0,svgRef:e.unref(X),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:$.value,onClose:P},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),se.value?(e.openBlock(),e.createElementBlock("div",we,null,512)):e.createCommentVNode("",!0),t.value.userOptions.show&&z.value&&(e.unref(A)||e.unref(T))?(e.openBlock(),e.createBlock(ee.UserOptions,{ref_key:"details",ref:re,key:`user_options_${M.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(U),isPrinting:e.unref(G),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:I.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:$.value,onToggleFullscreen:be,onGeneratePdf:e.unref(q),onGenerateCsv:Q,onGenerateImage:e.unref(Y),onToggleTable:Z,onToggleAnnotator:P,style:e.normalizeStyle({visibility:e.unref(A)?e.unref(T)?"visible":"hidden":"visible"})},e.createSlots({_:2},[a.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:l,color:n})=>[e.renderSlot(a.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:l,color:n})),void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}: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:"5"}: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:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),r.value.height>0&&z.value?(e.openBlock(),e.createElementBlock("svg",{key:3,ref_key:"svgRef",ref:X,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<=0?10:r.value.width} ${r.value.height<=0?10:r.value.height}`,style:e.normalizeStyle(`overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(xe._sfc_main),a.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:r.value.width<=0?10:r.value.width,height:r.value.height<=0?10:r.value.height,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,Ve)):e.createCommentVNode("",!0),u.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",$e,[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,Te)):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,Fe)):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,De),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,Oe)],8,Le))),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,Ie),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,Me)],8,Pe))),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,Ae),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)("#FFFFFF",t.value.style.chart.layout.nuts.selected.gradientIntensity)},null,8,Xe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,je)],8,Re),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,Ue),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)("#FFFFFF",t.value.style.chart.layout.nuts.gradientIntensity)},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,Ye)],8,Ge),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,We),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,60)},null,8,Ke),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,0)},null,8,Je)],8,He)]),t.value.style.chart.layout.grandTotal.show?(e.openBlock(),e.createElementBlock("g",Qe,[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,Ze),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,et)])):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-Cn2tUOoX.cjs"),ee=require("./usePrinter-BrH80VBz.cjs"),ge=require("./vue-ui-skeleton-Mcoev-5q.cjs"),ke=require("./BaseIcon-DY-33nfj.cjs"),_e=require("./vue-ui-accordion-7GoAZx3k.cjs"),te=require("./useNestedProp-C8955nsn.cjs"),xe=require("./PackageVersion-BxSGdh6L.cjs"),Be=require("./PenAndPaper-ByAFuR-l.cjs"),Ee=require("./useUserOptionState-BgepsfED.cjs"),Ne=require("./useChartAccessibility-Cm7nkzTG.cjs"),Se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ce=["id"],we={key:1,ref:"noTitle",class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},ze=["xmlns","viewBox"],Ve=["width","height"],$e={key:1},Te=["fill","font-weight","font-size","x","y"],Fe=["fill","font-weight","font-size","x","y"],Le=["id"],De=["stop-color"],Oe=["stop-color"],Pe=["id"],Ie=["stop-color"],Me=["stop-color"],Re=["id"],Ae=["stop-color"],Xe=["stop-color"],je=["stop-color"],Ge=["id"],Ue=["stop-color"],qe=["stop-color"],Ye=["stop-color"],He=["id"],We=["stop-color"],Ke=["stop-color"],Je=["stop-color"],Qe={key:2},Ze=["x","y","font-size","font-weight","fill"],et=["x","y","font-size","font-weight","fill"],tt=["d","stroke"],lt=["cx","cy","r","fill"],at=["cx","cy","r","fill","stroke","stroke-width","onClick"],ot={key:3},nt=["x","y","font-size","fill","onClick"],rt={key:0},st=["x","y","fill","font-size","font-weight"],ut=["x","y","height","width","fill","rx","onClick"],ct=["x","y","height","width","fill","rx","stroke","stroke-width","onClick"],it={key:4},dt=["x","y","fill","font-size","onClick"],yt=["d","stroke"],vt=["fill","cx","cy","r","onClick"],ht={key:5},pt=["x","y","font-size","font-weight","fill"],ft=["x1","x2","y1","y2","stroke","stroke-width"],mt=["y","height","width"],bt={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},gt={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},kt={viewBox:"0 0 20 20",height:"16",width:"16"},_t=["fill"],xt={key:7},Bt=["y","height","width"],Et={style:{width:"100%",height:"100%",display:"flex","align-items":"center","justify-content":"center","flex-direction":"column"}},Nt={style:{display:"flex","align-items":"center","justify-content":"center",gap:"12px","flex-wrap":"wrap","flex-direction":"row"}},St={viewBox:"0 0 20 20",height:"16",width:"16"},Ct=["fill"],wt=["cx","cy","fill"],zt=["d","stroke"],Vt=["cx","cy","fill"],$t=["d","stroke"],Tt=["cx","cy","fill"],Ft=["cx","cy","fill"],Lt=["x","y","fill","font-size","font-weight"],Dt=["x","y","fill","font-size","font-weight"],Ot=["x","text-anchor","y","fill","font-size"],Pt=["x","text-anchor","y","fill","font-size"],It=["x","text-anchor","y","fill","font-size"],Mt=["x","text-anchor","y","fill","font-size"],Rt=["x","text-anchor","y","fill","font-size"],At=["x","y","font-size","fill"],Xt=["x","y","font-size","fill"],jt=["x","y","font-size","fill"],Gt={key:4,class:"vue-data-ui-watermark"},Ut={key:6,ref:"source",dir:"auto"},qt={style:{"padding-top":"36px",position:"relative"}},Yt={class:"vue-ui-data-table"},Ht={key:0},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={key:0},bl={key:1},gl=["data-cell"],kl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},_l={key:0},xl={key:1},Bl=["data-cell"],El={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Nl=["data-cell"],Sl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Cl=["data-cell"],wl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},zl=["data-cell"],Vl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},$l=["data-cell"],Tl={style:{display:"flex","align-items":"center",gap:"5px","justify-content":"flex-end",width:"100%","padding-right":"3px"}},Fl={__name:"vue-ui-chestnut",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectRoot","selectBranch","selectNut"],setup(le,{expose:ae,emit:oe}){e.useCssVars(a=>({"4b8440b7":a.tdo}));const{vue_ui_chestnut:ne}=o.useConfig(),k=le,z=e.computed(()=>!!k.dataset&&k.dataset.length),h=e.ref(o.createUid()),I=e.ref(null),re=e.ref(null),M=e.ref(0),t=e.computed({get:()=>j(),set:a=>a}),{userOptionsVisible:T,setUserOptionsVisibility:R,keepUserOptionState:A}=Ee.useUserOptionState({config:t.value}),{svgRef:X}=Ne.useChartAccessibility({config:t.value.style.chart.layout.title});function j(){const a=te.useNestedProp({userConfig:k.config,defaultConfig:ne});return a.theme?{...te.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=j(),T.value=!t.value.userOptions.showOnChartHover,S.value.showTable=t.value.table.show,J()},{deep:!0});const{isPrinting:G,isImaging:U,generatePdf:q,generateImage:Y}=ee.usePrinter({elementId:`vue-ui-chestnut_${h.value}`,fileName:t.value.style.chart.layout.title.text||"vue-ui-chestnut",options:t.value.userOptions.print}),se=e.computed(()=>t.value.userOptions.show),F=e.computed(()=>o.convertCustomPalette(t.value.customPalette)),S=e.ref({showTable:t.value.table.show}),L=e.ref(null),H=e.ref(!1),ue=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 ce(){return m.value}const C=oe,ie=e.computed(()=>m.value.flatMap(a=>a.branches).length),de=e.computed(()=>Math.max(...m.value.map(a=>a.branches.map(s=>s.value).reduce((s,l)=>s+l,0)))),ye=e.computed(()=>Math.max(...m.value.flatMap(a=>a.branches.map(s=>s.value)))),W=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/de.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}})),ve=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),he=e.computed(()=>B.value.flatMap(a=>a.branches)),E=e.computed(()=>he.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:W.value,x2:384*a.value/ye.value*ve.value+W.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 pe(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),C("selectNut",a.breakdown)})}function N(){u.value=null,x.value=null,C("selectNut",null)}function O(a){v.value&&v.value.id===a.id?(v.value=null,p(),C("selectBranch",null)):(p(),v.value=a,C("selectBranch",a))}function K(a){b.value&&b.value.id===a.id?(p(),C("selectRoot",null)):(p(),b.value=a,C("selectRoot",a))}function fe(){return f.value.bottom-(u.value.y1+180)<0?0:f.value.bottom}function w(a){return a.proportion*100>t.value.style.chart.layout.nuts.selected.labels.dataLabels.hideUnderValue}function me(){const a=new ResizeObserver(s=>{s.forEach(l=>{H.value=l.contentRect.width<ue.value})});L.value&&a.observe(L.value)}e.onMounted(()=>{J()});function J(){o.objectIsEmpty(k.dataset)&&o.error({componentName:"VueUiChestnut",type:"dataset"});const a=ie.value*(r.value.branchSize+r.value.gap)+r.value.padding.top+r.value.padding.bottom;r.value.height=a,me()}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,Dl)=>y.table)));return{head:a,body:s}});function Q(){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 be(a){V.value=a,M.value+=1}function Z(){S.value.showTable=!S.value.showTable}const $=e.ref(!1);function P(){$.value=!$.value}return ae({getData:ce,generatePdf:q,generateCsv:Q,generateImage:Y,toggleTable:Z,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:I,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}`),onMouseenter:s[2]||(s[2]=()=>e.unref(R)(!0)),onMouseleave:s[3]||(s[3]=()=>e.unref(R)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Be._sfc_main,{key:0,svgRef:e.unref(X),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:$.value,onClose:P},null,8,["svgRef","backgroundColor","color","active"])):e.createCommentVNode("",!0),se.value?(e.openBlock(),e.createElementBlock("div",we,null,512)):e.createCommentVNode("",!0),t.value.userOptions.show&&z.value&&(e.unref(A)||e.unref(T))?(e.openBlock(),e.createBlock(ee.UserOptions,{ref_key:"details",ref:re,key:`user_options_${M.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isImaging:e.unref(U),isPrinting:e.unref(G),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:I.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:$.value,onToggleFullscreen:be,onGeneratePdf:e.unref(q),onGenerateCsv:Q,onGenerateImage:e.unref(Y),onToggleTable:Z,onToggleAnnotator:P,style:e.normalizeStyle({visibility:e.unref(A)?e.unref(T)?"visible":"hidden":"visible"})},e.createSlots({_:2},[a.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:l,color:n})=>[e.renderSlot(a.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:l,color:n})),void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}: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:"5"}: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:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),r.value.height>0&&z.value?(e.openBlock(),e.createElementBlock("svg",{key:3,ref_key:"svgRef",ref:X,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<=0?10:r.value.width} ${r.value.height<=0?10:r.value.height}`,style:e.normalizeStyle(`overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(xe._sfc_main),a.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:0,y:0,width:r.value.width<=0?10:r.value.width,height:r.value.height<=0?10:r.value.height,style:{pointerEvents:"none"}},[e.renderSlot(a.$slots,"chart-background",{},void 0,!0)],8,Ve)):e.createCommentVNode("",!0),u.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("g",$e,[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,Te)):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,Fe)):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,De),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,Oe)],8,Le))),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,Ie),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,Me)],8,Pe))),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,Ae),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)("#FFFFFF",t.value.style.chart.layout.nuts.selected.gradientIntensity)},null,8,Xe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,je)],8,Re),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,Ue),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)("#FFFFFF",t.value.style.chart.layout.nuts.gradientIntensity)},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)("#FFFFFF",0)},null,8,Ye)],8,Ge),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,We),e.createElementVNode("stop",{offset:"80%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,60)},null,8,Ke),e.createElementVNode("stop",{offset:"100%","stop-color":e.unref(o.setOpacity)(t.value.style.chart.backgroundColor,0)},null,8,Je)],8,He)]),t.value.style.chart.layout.grandTotal.show?(e.openBlock(),e.createElementBlock("g",Qe,[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,Ze),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,et)])):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,12 +1,12 @@
|
|
|
1
1
|
import { useCssVars as He, computed as m, ref as T, watch as We, onMounted as Ke, createElementBlock as o, openBlock as a, unref as n, normalizeStyle as h, normalizeClass as k, createBlock as K, createCommentVNode as f, renderSlot as S, createSlots as Je, withCtx as B, normalizeProps as J, guardReactiveProps as Q, createVNode as Ce, createElementVNode as s, toDisplayString as c, Fragment as g, renderList as _, createTextVNode as Z, withKeys as Qe, nextTick as Te } from "vue";
|
|
2
|
-
import { u as Ze, c as et, t as tt, p as V, a as lt, b as at, g as ne, e as ee, d as re, o as ot, X as st, s as F, w as ze, i as G, f as z, G as Ne, m as Se, j as ut, k as H, n as P, q as nt, r as rt } from "./index-
|
|
3
|
-
import { u as it, U as ct } from "./usePrinter-
|
|
4
|
-
import dt from "./vue-ui-skeleton-
|
|
5
|
-
import vt from "./BaseIcon-
|
|
6
|
-
import yt from "./vue-ui-accordion-
|
|
7
|
-
import { u as Fe } from "./useNestedProp-
|
|
8
|
-
import { _ as ht } from "./PackageVersion-
|
|
9
|
-
import { _ as ft } from "./PenAndPaper-
|
|
2
|
+
import { u as Ze, c as et, t as tt, p as V, a as lt, b as at, g as ne, e as ee, d as re, o as ot, X as st, s as F, w as ze, i as G, f as z, G as Ne, m as Se, j as ut, k as H, n as P, q as nt, r as rt } from "./index-d3erwTWB.js";
|
|
3
|
+
import { u as it, U as ct } from "./usePrinter-CHrKIDM7.js";
|
|
4
|
+
import dt from "./vue-ui-skeleton-BOtCpAcY.js";
|
|
5
|
+
import vt from "./BaseIcon-CpIcYACc.js";
|
|
6
|
+
import yt from "./vue-ui-accordion-BJyaBDyF.js";
|
|
7
|
+
import { u as Fe } from "./useNestedProp-BqKuhIvF.js";
|
|
8
|
+
import { _ as ht } from "./PackageVersion-D-aPPO0L.js";
|
|
9
|
+
import { _ as ft } from "./PenAndPaper-D9g_r8-6.js";
|
|
10
10
|
import { u as bt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
11
11
|
import { u as pt } from "./useChartAccessibility-BWojgys7.js";
|
|
12
12
|
import { _ as gt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),d=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),d=require("./index-Cn2tUOoX.cjs"),Qe=require("./useUserOptionState-BgepsfED.cjs"),Pe=require("./useNestedProp-C8955nsn.cjs"),Ze=require("./useChartAccessibility-Cm7nkzTG.cjs"),Je=require("./Title-D62pPwLz.cjs"),Ke=require("./PackageVersion-BxSGdh6L.cjs"),et=require("./PenAndPaper-ByAFuR-l.cjs"),tt=require("./BaseIcon-DY-33nfj.cjs"),Ae=require("./usePrinter-BrH80VBz.cjs"),ot=require("./Legend-ieOu_fKK.cjs"),at=require("./Shape-BQIcurpe.cjs"),lt=require("./DataTable-CNCnRrD-.cjs"),nt=require("./vue-ui-accordion-7GoAZx3k.cjs"),rt=require("./vue-ui-skeleton-Mcoev-5q.cjs"),Ie=require("./useResponsive-BBkmXXaa.cjs"),st=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ut=["id"],it=["xmlns","viewBox"],ct=["width","height"],dt={key:1},vt=["id","d"],ht={key:2},ft=["transform"],mt=["d","fill","stroke","stroke-width","onMouseenter","onClick"],pt=["d","fill","stroke","stroke-width"],gt=["d","fill"],bt=["d","fill","stroke","stroke-width","onMouseenter","onClick"],kt=["d","fill","stroke","stroke-width"],yt=["d","fill","stroke","stroke-width"],Ct=["d","fill","stroke","stroke-width"],$t={key:0},wt=["x1","y1","x2","y2","stroke","stroke-width"],Bt=["x1","y1","x2","y2","stroke","stroke-width"],Mt=["cx","cy","r","stroke","stroke-width","fill"],xt=["transform","fill","text-anchor","font-size","font-weight"],Pt={key:1},At=["font-size","font-weight","fill"],It=["href"],_t=["transform","text-anchor","font-size","font-weight","fill"],St={key:5,class:"vue-data-ui-watermark"},Et=["onClick"],Nt={key:8,"data-dom-to-png-ignore":"",class:"reset-wrapper"},Vt={style:{"text-align":"right",width:"100%"}},Tt={__name:"vue-ui-chord",props:{dataset:{type:Object,default(){return{}}},config:{type:Object,default(){return{}}}},emits:["selectLegend","selectGroup","selectRibbon"],setup(_e,{expose:Se,emit:Ee}){e.useCssVars(o=>({"7187d07a":o.slicerColor}));const{vue_ui_chord:Ne}=d.useConfig(),h=_e,L=Ee,P=e.ref(!!h.dataset&&Object.hasOwn(h.dataset,"matrix")),B=e.ref(d.createUid()),b=e.ref(null),m=e.ref(null),v=e.ref(null),H=e.ref(0),E=e.ref(null),Q=e.ref(null),Z=e.ref(null),J=e.ref(null),K=e.ref(null),ee=e.ref(0),te=e.ref(0),oe=e.ref(0),N=e.ref(!1),X=e.ref(null),a=e.computed({get:()=>ie(),set:o=>o}),{userOptionsVisible:j,setUserOptionsVisibility:ae,keepUserOptionState:le}=Qe.useUserOptionState({config:a.value}),{svgRef:V}=Ze.useChartAccessibility({config:a.value.style.chart.title}),{isPrinting:ne,isImaging:re,generatePdf:se,generateImage:ue}=Ae.usePrinter({elementId:`chord_${B.value}`,fileName:a.value.style.chart.title.text||"vue-ui-chord",options:a.value.userOptions.print}),T=e.ref({showTable:a.value.table.show});function ie(){const o=Pe.useNestedProp({userConfig:h.config,defaultConfig:Ne});return o.theme?{...Pe.useNestedProp({userConfig:d.themes.vue_ui_chord[o.theme]||h.config,defaultConfig:o}),customPalette:d.themePalettes[o.theme]||d.palette}:o}e.watch(()=>h.config,o=>{a.value=ie(),j.value=!a.value.userOptions.showOnChartHover,ce(),ee.value+=1,te.value+=1,oe.value+=1,$.value=a.value.initialRotation,T.value.showTable=a.value.table.show},{deep:!0});function ce(){if(d.objectIsEmpty(h.dataset)?d.error({componentName:"VueUiChord",type:"dataset"}):d.getMissingDatasetAttributes({datasetObject:h.dataset,requiredAttributes:["matrix"]}).forEach(o=>{P.value=!1,d.error({componentName:"VueUiChord",type:"datasetAttribute",property:o})}),P.value&&de(),a.value.responsive){const o=E.value.parentNode,l=Ie.throttle(()=>{const{width:n,height:u,heightNoTitle:r,heightSource:s,heightTitle:c,heightLegend:k}=Ie.useResponsive({chart:E.value,title:a.value.style.chart.title.text?Q.value:null,legend:a.value.style.chart.legend.show?Z.value:null,source:J.value,noTitle:K.value}),y=c+k+s+r;n<u?E.value.style.width="100%":(E.value.style.height="100%",V.value.style.height=`calc(100% - ${y}px)`)},100),t=new ResizeObserver(l);t.observe(o),X.value=t,l()}ve.value=setTimeout(()=>{N.value=!0},500)}function de(){h.dataset.matrix.length<2&&(console.warn(`VueUiChord: dataset.matrix requires a minimum of 2 datapoints, for example:
|
|
2
2
|
|
|
3
3
|
matrix:[
|
|
4
4
|
[1, 1],
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { useCssVars as pt, ref as d, computed as x, watch as mt, onMounted as Ge, onBeforeUnmount as Ve, createElementBlock as i, openBlock as n, unref as k, normalizeStyle as N, normalizeClass as X, createBlock as j, createCommentVNode as v, renderSlot as $, createElementVNode as O, createSlots as We, withCtx as P, normalizeProps as oe, guardReactiveProps as le, withModifiers as qe, createVNode as de, Fragment as z, renderList as U, mergeProps as yt, toDisplayString as V, createTextVNode as kt, nextTick as $t } from "vue";
|
|
2
|
-
import { u as wt, c as ve, t as Ct, p as se, a as Mt, o as xt, e as He, g as _t, b as It, d as At, X as Pt, G as Tt, q as St, r as Bt, i as Ot, f as Lt } from "./index-
|
|
2
|
+
import { u as wt, c as ve, t as Ct, p as se, a as Mt, o as xt, e as He, g as _t, b as It, d as At, X as Pt, G as Tt, q as St, r as Bt, i as Ot, f as Lt } from "./index-d3erwTWB.js";
|
|
3
3
|
import { u as Et } from "./useUserOptionState-BIvW1Kz7.js";
|
|
4
|
-
import { u as Qe } from "./useNestedProp-
|
|
4
|
+
import { u as Qe } from "./useNestedProp-BqKuhIvF.js";
|
|
5
5
|
import { u as Nt } from "./useChartAccessibility-BWojgys7.js";
|
|
6
|
-
import { _ as zt } from "./Title-
|
|
7
|
-
import { _ as Ft } from "./PackageVersion-
|
|
8
|
-
import { _ as Xt } from "./PenAndPaper-
|
|
9
|
-
import Rt from "./BaseIcon-
|
|
10
|
-
import { u as Dt, U as jt } from "./usePrinter-
|
|
11
|
-
import { L as Ut } from "./Legend-
|
|
12
|
-
import { _ as Yt } from "./Shape-
|
|
13
|
-
import { D as Gt } from "./DataTable-
|
|
14
|
-
import Vt from "./vue-ui-accordion-
|
|
15
|
-
import Wt from "./vue-ui-skeleton-
|
|
6
|
+
import { _ as zt } from "./Title-DIYoufYR.js";
|
|
7
|
+
import { _ as Ft } from "./PackageVersion-D-aPPO0L.js";
|
|
8
|
+
import { _ as Xt } from "./PenAndPaper-D9g_r8-6.js";
|
|
9
|
+
import Rt from "./BaseIcon-CpIcYACc.js";
|
|
10
|
+
import { u as Dt, U as jt } from "./usePrinter-CHrKIDM7.js";
|
|
11
|
+
import { L as Ut } from "./Legend-DKQ4psNY.js";
|
|
12
|
+
import { _ as Yt } from "./Shape-DLjaeo5U.js";
|
|
13
|
+
import { D as Gt } from "./DataTable-CJOtzfgn.js";
|
|
14
|
+
import Vt from "./vue-ui-accordion-BJyaBDyF.js";
|
|
15
|
+
import Wt from "./vue-ui-skeleton-BOtCpAcY.js";
|
|
16
16
|
import { t as qt, u as Ht } from "./useResponsive-JZ9xq-JV.js";
|
|
17
17
|
import { _ as Qt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
18
18
|
const Zt = ["id"], Jt = ["xmlns", "viewBox"], Kt = ["width", "height"], ea = { key: 1 }, ta = ["id", "d"], aa = { key: 2 }, oa = ["transform"], la = ["d", "fill", "stroke", "stroke-width", "onMouseenter", "onClick"], sa = ["d", "fill", "stroke", "stroke-width"], na = ["d", "fill"], ra = ["d", "fill", "stroke", "stroke-width", "onMouseenter", "onClick"], ua = ["d", "fill", "stroke", "stroke-width"], ia = ["d", "fill", "stroke", "stroke-width"], ca = ["d", "fill", "stroke", "stroke-width"], da = { key: 0 }, va = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], ha = ["x1", "y1", "x2", "y2", "stroke", "stroke-width"], fa = ["cx", "cy", "r", "stroke", "stroke-width", "fill"], ga = ["transform", "fill", "text-anchor", "font-size", "font-weight"], ba = { key: 1 }, pa = ["font-size", "font-weight", "fill"], ma = ["href"], ya = ["transform", "text-anchor", "font-size", "font-weight", "fill"], ka = {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { useCssVars as We, computed as w, ref as p, watch as $e, onMounted as Xe, watchEffect as Ye, createElementBlock as b, openBlock as f, unref as m, normalizeStyle as K, normalizeClass as Te, createBlock as M, createCommentVNode as k, renderSlot as x, createSlots as Ze, withCtx as z, normalizeProps as U, guardReactiveProps as B, createVNode as Je, Fragment as Q, renderList as Ke, createElementVNode as C, mergeProps as Se, toDisplayString as j, createTextVNode as Qe, nextTick as Ie } from "vue";
|
|
2
|
-
import { u as et, c as Oe, t as ie, p as ee, a as tt, o as lt, e as at, b as ot, d as st, h as Pe, f as ce, X as nt, l as rt, G as q, af as ut, q as it, r as ct, i as Fe } from "./index-
|
|
3
|
-
import { u as Ne } from "./useNestedProp-
|
|
4
|
-
import { u as vt, U as dt } from "./usePrinter-
|
|
5
|
-
import { _ as ht } from "./Title-
|
|
6
|
-
import { _ as ft } from "./PenAndPaper-
|
|
2
|
+
import { u as et, c as Oe, t as ie, p as ee, a as tt, o as lt, e as at, b as ot, d as st, h as Pe, f as ce, X as nt, l as rt, G as q, af as ut, q as it, r as ct, i as Fe } from "./index-d3erwTWB.js";
|
|
3
|
+
import { u as Ne } from "./useNestedProp-BqKuhIvF.js";
|
|
4
|
+
import { u as vt, U as dt } from "./usePrinter-CHrKIDM7.js";
|
|
5
|
+
import { _ as ht } from "./Title-DIYoufYR.js";
|
|
6
|
+
import { _ as ft } from "./PenAndPaper-D9g_r8-6.js";
|
|
7
7
|
import { u as yt } from "./useUserOptionState-BIvW1Kz7.js";
|
|
8
|
-
import { _ as mt } from "./PackageVersion-
|
|
9
|
-
import pt from "./vue-ui-accordion-
|
|
10
|
-
import { D as bt } from "./DataTable-
|
|
11
|
-
import gt from "./vue-ui-skeleton-
|
|
8
|
+
import { _ as mt } from "./PackageVersion-D-aPPO0L.js";
|
|
9
|
+
import pt from "./vue-ui-accordion-BJyaBDyF.js";
|
|
10
|
+
import { D as bt } from "./DataTable-CJOtzfgn.js";
|
|
11
|
+
import gt from "./vue-ui-skeleton-BOtCpAcY.js";
|
|
12
12
|
import { u as kt } from "./useChartAccessibility-BWojgys7.js";
|
|
13
13
|
import { t as xt, u as wt } from "./useResponsive-JZ9xq-JV.js";
|
|
14
14
|
import { _ as Ct } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|