vue-data-ui 2.10.2-beta.1 → 2.10.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-Durz-Lij.js → Arrow-B2-rOYz8.js} +1 -1
- package/dist/{Arrow-D_EAhs0m.cjs → Arrow-D6UBVyNr.cjs} +1 -1
- package/dist/{BaseIcon-BnWfrW1B.js → BaseIcon-Br5G8Cdk.js} +1 -1
- package/dist/{BaseIcon-DPT0BaqM.cjs → BaseIcon-DfoJJxST.cjs} +1 -1
- package/dist/{ColorPicker-COqCncYu.js → ColorPicker-CiQzB3a-.js} +3 -3
- package/dist/{ColorPicker-CYaUst4k.cjs → ColorPicker-Dvgprgpv.cjs} +1 -1
- package/dist/{DataTable-DSiJ_YaA.cjs → DataTable-CGucPqAQ.cjs} +1 -1
- package/dist/{DataTable-CyKnS5wp.js → DataTable-Dk-94kK2.js} +2 -2
- package/dist/{Legend-RwWQ6l8r.cjs → Legend-B9aoKeq3.cjs} +1 -1
- package/dist/{Legend-Dj_es4iV.js → Legend-Cx6NYPTA.js} +2 -2
- package/dist/{PackageVersion-vJyd5YD8.js → PackageVersion-BdNfnIm2.js} +1 -1
- package/dist/{PackageVersion-DCriWnX3.cjs → PackageVersion-C2bjLIu9.cjs} +1 -1
- package/dist/{PenAndPaper-lj1PPAzR.cjs → PenAndPaper-CJIFAI78.cjs} +1 -1
- package/dist/{PenAndPaper-BgZ0aAW2.js → PenAndPaper-wrVNMaG8.js} +3 -3
- package/dist/{Shape-BgbyzOCz.cjs → Shape-Cn2RU1NY.cjs} +1 -1
- package/dist/{Shape-0QfdCJdX.js → Shape-vIKj52KP.js} +1 -1
- package/dist/{Slicer-B-i-6x8C.cjs → Slicer-t3EfI94H.cjs} +1 -1
- package/dist/{Slicer-lB3lQUsg.js → Slicer-yki6JqTB.js} +2 -2
- package/dist/{Title-zlQvBTwR.cjs → Title-Bae0QJu7.cjs} +1 -1
- package/dist/{Title-UITSl88n.js → Title-CDYBDpu3.js} +1 -1
- package/dist/{Tooltip-QHKaXOYQ.js → Tooltip-BzsAOdBd.js} +1 -1
- package/dist/{Tooltip-DY4rXOAP.cjs → Tooltip-CfqYTd5O.cjs} +1 -1
- package/dist/{dom-to-png-BoSiNLCZ.cjs → dom-to-png-DgRl9bEH.cjs} +1 -1
- package/dist/{dom-to-png-IpAl2vt0.js → dom-to-png-IAiARGiU.js} +1 -1
- package/dist/{img-1Hu7T2L5.js → img-DaDUVggy.js} +1 -1
- package/dist/{img-DOJMU48p.cjs → img-DxEvbX77.cjs} +1 -1
- package/dist/{index-Br1RehUb.js → index-BI6O7K58.js} +1 -1
- package/dist/{index-DiJiQMBB.cjs → index-DgIVCHLv.cjs} +1 -1
- package/dist/{pdf-C6M_O5rS.js → pdf-DBVNp7s2.js} +1 -1
- package/dist/{pdf-Bg3JLNad.cjs → pdf-Dq3h9PEr.cjs} +1 -1
- package/dist/{useNestedProp-DqEOzYzu.cjs → useNestedProp-CCR03NVM.cjs} +1 -1
- package/dist/{useNestedProp-DXxFHEXa.js → useNestedProp-Cvz4MkSy.js} +1 -1
- package/dist/{usePrinter-Bkd5ycBt.cjs → usePrinter-B2xVvtiy.cjs} +1 -1
- package/dist/{usePrinter-BotFh1ji.js → usePrinter-Jr3eyr8H.js} +3 -3
- package/dist/{vue-data-ui-DmyMMva1.cjs → vue-data-ui-DhWKehHS.cjs} +1 -1
- package/dist/{vue-data-ui-ceT6Ds8c.js → vue-data-ui-bm5wfGa_.js} +62 -62
- package/dist/vue-data-ui.cjs +1 -1
- package/dist/vue-data-ui.js +1 -1
- package/dist/{vue-ui-3d-bar-BuLR9KPG.cjs → vue-ui-3d-bar-Bpm8dKya.cjs} +1 -1
- package/dist/{vue-ui-3d-bar-D8gTYv2q.js → vue-ui-3d-bar-CHOAZoDV.js} +9 -9
- package/dist/{vue-ui-accordion-P5hXhzth.cjs → vue-ui-accordion-DE1isSE9.cjs} +1 -1
- package/dist/{vue-ui-accordion-BlsQ4IFe.js → vue-ui-accordion-ldF7KsjV.js} +3 -3
- package/dist/{vue-ui-age-pyramid-DQjIgLoF.cjs → vue-ui-age-pyramid-BnHOxOPT.cjs} +1 -1
- package/dist/{vue-ui-age-pyramid-C_WRa17B.js → vue-ui-age-pyramid-BuKSta-B.js} +10 -10
- package/dist/{vue-ui-annotator-SHkR_9cj.cjs → vue-ui-annotator-B9j16TKW.cjs} +1 -1
- package/dist/{vue-ui-annotator-BI4gOYbV.js → vue-ui-annotator-BBuH-QB4.js} +2 -2
- package/dist/{vue-ui-bullet-DQnycr6Q.js → vue-ui-bullet-B0C_rPTQ.js} +8 -8
- package/dist/{vue-ui-bullet-Dv-CldQs.cjs → vue-ui-bullet-CRChR0Qe.cjs} +1 -1
- package/dist/{vue-ui-candlestick-Bd9v_ssR.cjs → vue-ui-candlestick-Bq66GLxw.cjs} +1 -1
- package/dist/{vue-ui-candlestick-CxPvkEtR.js → vue-ui-candlestick-By5MsCcS.js} +11 -11
- package/dist/{vue-ui-carousel-table-DuwoXFJH.js → vue-ui-carousel-table-BOtjI2Ov.js} +4 -4
- package/dist/{vue-ui-carousel-table-Dwvy8FmR.cjs → vue-ui-carousel-table-CyywZulq.cjs} +1 -1
- package/dist/{vue-ui-chestnut-1P_kvZFR.js → vue-ui-chestnut-BS2kXrPU.js} +8 -8
- package/dist/{vue-ui-chestnut-Da5lD-jy.cjs → vue-ui-chestnut-D8QPZS8n.cjs} +1 -1
- package/dist/{vue-ui-circle-pack-_d0WvVlg.js → vue-ui-circle-pack-C8m10WZ0.js} +9 -9
- package/dist/{vue-ui-circle-pack-H7fs4aWV.cjs → vue-ui-circle-pack-iOxdB75t.cjs} +1 -1
- package/dist/{vue-ui-cursor-CcxO5N6B.js → vue-ui-cursor-Bn-CCFO0.js} +2 -2
- package/dist/{vue-ui-cursor-CeAtprXI.cjs → vue-ui-cursor-Ccym3tFb.cjs} +1 -1
- package/dist/{vue-ui-dashboard-nLTbt8rE.cjs → vue-ui-dashboard-Cw4IXhXY.cjs} +1 -1
- package/dist/{vue-ui-dashboard-DQql8FoJ.js → vue-ui-dashboard-D-vs2N_7.js} +62 -62
- package/dist/{vue-ui-digits-CIm6jt9J.js → vue-ui-digits-BXBXg7wv.js} +2 -2
- package/dist/{vue-ui-digits-DYzQpKDk.cjs → vue-ui-digits-D66h3nUw.cjs} +1 -1
- package/dist/{vue-ui-donut-CMmo-xas.js → vue-ui-donut-BGZIwC5D.js} +12 -12
- package/dist/{vue-ui-donut-BZBTtRIT.cjs → vue-ui-donut-Bf3THSxi.cjs} +1 -1
- package/dist/{vue-ui-donut-evolution-CmVkOgHk.js → vue-ui-donut-evolution-5yOibvNM.js} +11 -11
- package/dist/{vue-ui-donut-evolution-BigkaF3K.cjs → vue-ui-donut-evolution-xxrUJzgG.cjs} +1 -1
- package/dist/{vue-ui-dumbbell-DNRxfbMB.js → vue-ui-dumbbell-C-KqKhxI.js} +10 -10
- package/dist/{vue-ui-dumbbell-COVwDZf9.cjs → vue-ui-dumbbell-CWn7cNsm.cjs} +1 -1
- package/dist/{vue-ui-flow-CWn5Xgfv.js → vue-ui-flow-D4_2VnaB.js} +9 -9
- package/dist/{vue-ui-flow-C2-V4oXf.cjs → vue-ui-flow-DFxWNRRJ.cjs} +1 -1
- package/dist/{vue-ui-funnel-Caa_fg2B.js → vue-ui-funnel-ADEjZ8yz.js} +9 -9
- package/dist/{vue-ui-funnel-CzUX32Ub.cjs → vue-ui-funnel-DIoqpwbm.cjs} +1 -1
- package/dist/{vue-ui-galaxy-Dh6mXUEh.cjs → vue-ui-galaxy-BRle40mR.cjs} +1 -1
- package/dist/{vue-ui-galaxy-DlPI9C4p.js → vue-ui-galaxy-DLtA9Ebb.js} +11 -11
- package/dist/{vue-ui-gauge-C0-BHMRe.cjs → vue-ui-gauge-B4vEWkRk.cjs} +1 -1
- package/dist/{vue-ui-gauge-DCKwx-39.js → vue-ui-gauge-BVj-IBdi.js} +7 -7
- package/dist/{vue-ui-gizmo-Dbyg4lfp.js → vue-ui-gizmo-BTe8CPyi.js} +3 -3
- package/dist/{vue-ui-gizmo-CBEmt6wS.cjs → vue-ui-gizmo-BwBtkZ5z.cjs} +1 -1
- package/dist/{vue-ui-heatmap-B8aHMTRT.js → vue-ui-heatmap-DrXMOxbe.js} +10 -10
- package/dist/{vue-ui-heatmap-L44qq3tT.cjs → vue-ui-heatmap-VdFtflO6.cjs} +1 -1
- package/dist/{vue-ui-history-plot-cK3Eyct-.cjs → vue-ui-history-plot-B-ScOcEy.cjs} +1 -1
- package/dist/{vue-ui-history-plot-Db9VBFJo.js → vue-ui-history-plot-_DfuZIMP.js} +11 -11
- package/dist/{vue-ui-kpi-3Y6KGCu8.cjs → vue-ui-kpi-DSQV0Kf2.cjs} +1 -1
- package/dist/{vue-ui-kpi-DTVFlqqr.js → vue-ui-kpi-DfFiDtCP.js} +3 -3
- package/dist/{vue-ui-mini-loader-C0-qR0Wv.js → vue-ui-mini-loader-1JZipPcP.js} +2 -2
- package/dist/{vue-ui-mini-loader-DYQjIOkq.cjs → vue-ui-mini-loader-CDOlO_1_.cjs} +1 -1
- package/dist/{vue-ui-molecule-CZYTkXRy.js → vue-ui-molecule-Db_C7mVS.js} +11 -11
- package/dist/{vue-ui-molecule-BsbB0T8n.cjs → vue-ui-molecule-jEcRTe4V.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-Dcgb3cQR.cjs → vue-ui-mood-radar-BoKSTE-Y.cjs} +1 -1
- package/dist/{vue-ui-mood-radar-zWFTh0WG.js → vue-ui-mood-radar-m48vvkft.js} +11 -11
- package/dist/{vue-ui-nested-donuts-Ci2TbHCY.js → vue-ui-nested-donuts-DNhMOryo.js} +11 -11
- package/dist/{vue-ui-nested-donuts-CElXmrE_.cjs → vue-ui-nested-donuts-ihd00Tpn.cjs} +1 -1
- package/dist/{vue-ui-onion-DTYqd0S7.cjs → vue-ui-onion-D9AHOWa5.cjs} +1 -1
- package/dist/{vue-ui-onion-C3w_0U-6.js → vue-ui-onion-YKxsqnI7.js} +11 -11
- package/dist/{vue-ui-parallel-coordinate-plot-DmAaG5vE.js → vue-ui-parallel-coordinate-plot-7SCwFkrU.js} +12 -12
- package/dist/{vue-ui-parallel-coordinate-plot-DXgrYF8V.cjs → vue-ui-parallel-coordinate-plot-BmO6zenq.cjs} +1 -1
- package/dist/{vue-ui-quadrant-xIalSKQB.js → vue-ui-quadrant-Bi0by7IK.js} +12 -12
- package/dist/{vue-ui-quadrant--MXxqtPm.cjs → vue-ui-quadrant-CAJ4dTBu.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-DrEeKIP-.cjs → vue-ui-quick-chart-C37lGqa1.cjs} +1 -1
- package/dist/{vue-ui-quick-chart-CSffm4a5.js → vue-ui-quick-chart-DlV0Qv_x.js} +9 -9
- package/dist/{vue-ui-radar-BkYTilrU.js → vue-ui-radar-B14zLIww.js} +12 -12
- package/dist/{vue-ui-radar-Baujx0zJ.cjs → vue-ui-radar-H08KmB3s.cjs} +1 -1
- package/dist/{vue-ui-rating-CoCspb5w.cjs → vue-ui-rating-CYarWaTf.cjs} +1 -1
- package/dist/{vue-ui-rating-D9mcamSQ.js → vue-ui-rating-CdSQUBG6.js} +2 -2
- package/dist/{vue-ui-relation-circle-BOQbjwio.cjs → vue-ui-relation-circle-A4Vw8kYl.cjs} +1 -1
- package/dist/{vue-ui-relation-circle-D1QRMkRv.js → vue-ui-relation-circle-IzAvPPGl.js} +7 -7
- package/dist/{vue-ui-ridgeline-DAhVh2wO.js → vue-ui-ridgeline-BF5X6KQR.js} +12 -12
- package/dist/{vue-ui-ridgeline-evw3STiF.cjs → vue-ui-ridgeline-BaHgOn_p.cjs} +1 -1
- package/dist/{vue-ui-rings-BbaMc09d.js → vue-ui-rings-DUhnXy1h.js} +12 -12
- package/dist/{vue-ui-rings-BhG1riq2.cjs → vue-ui-rings-DnVeMrOw.cjs} +1 -1
- package/dist/{vue-ui-scatter-BA1innim.js → vue-ui-scatter-D7bXuxob.js} +12 -12
- package/dist/{vue-ui-scatter-D2EXkBxx.cjs → vue-ui-scatter-DoGX7iHp.cjs} +1 -1
- package/dist/{vue-ui-skeleton-DEI0qJZY.cjs → vue-ui-skeleton-DeEGdJEn.cjs} +1 -1
- package/dist/{vue-ui-skeleton-BksknW8F.js → vue-ui-skeleton-Dxm7rqic.js} +3 -3
- package/dist/{vue-ui-smiley-D_lDFgTX.js → vue-ui-smiley-95l4UiqT.js} +2 -2
- package/dist/{vue-ui-smiley-B4dNIhTF.cjs → vue-ui-smiley-DmAtXVht.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-JPsaMYzx.cjs → vue-ui-spark-trend-C3CO25Jy.cjs} +1 -1
- package/dist/{vue-ui-spark-trend-YVwnvmen.js → vue-ui-spark-trend-DdH43oVm.js} +5 -5
- package/dist/{vue-ui-sparkbar-P7ab216P.cjs → vue-ui-sparkbar-C2roDWfv.cjs} +1 -1
- package/dist/{vue-ui-sparkbar-COtSp75m.js → vue-ui-sparkbar-DTe3QrR3.js} +4 -4
- package/dist/{vue-ui-sparkgauge-DBTs_fko.js → vue-ui-sparkgauge-BwclNj3C.js} +4 -4
- package/dist/{vue-ui-sparkgauge-BrmBThWX.cjs → vue-ui-sparkgauge-nq6-9TjT.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-Bbui1Mjp.cjs → vue-ui-sparkhistogram-BdWirDjI.cjs} +1 -1
- package/dist/{vue-ui-sparkhistogram-D9ltgqDi.js → vue-ui-sparkhistogram-Brau127G.js} +5 -5
- package/dist/{vue-ui-sparkline-DkRtUZjr.cjs → vue-ui-sparkline-B2mOJzkG.cjs} +1 -1
- package/dist/{vue-ui-sparkline-DxlyRPM_.js → vue-ui-sparkline-qqfyQyVz.js} +4 -4
- package/dist/{vue-ui-sparkstackbar-CAAfi-lB.cjs → vue-ui-sparkstackbar-BJl9lbBp.cjs} +1 -1
- package/dist/{vue-ui-sparkstackbar-DjrHKvP-.js → vue-ui-sparkstackbar-DLlDU0B2.js} +5 -5
- package/dist/{vue-ui-stackbar-hDFg5vfU.cjs → vue-ui-stackbar-CEvmDjq3.cjs} +1 -1
- package/dist/{vue-ui-stackbar-BQw6lOEm.js → vue-ui-stackbar-RRGnblUm.js} +13 -13
- package/dist/{vue-ui-strip-plot-D5X65rGR.js → vue-ui-strip-plot-C9LKjSkW.js} +11 -11
- package/dist/{vue-ui-strip-plot-BuA2QRro.cjs → vue-ui-strip-plot-Dlsv-yRI.cjs} +1 -1
- package/dist/{vue-ui-table-4x1r1zJ4.js → vue-ui-table-DxdJ151X.js} +3 -3
- package/dist/{vue-ui-table-heatmap-BuGa0tHQ.cjs → vue-ui-table-heatmap-BhxOvDDW.cjs} +1 -1
- package/dist/{vue-ui-table-heatmap-gU7N3s52.js → vue-ui-table-heatmap-CzGeU_uL.js} +4 -4
- package/dist/{vue-ui-table-DN4G0Xcv.cjs → vue-ui-table-qULtmHGA.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-B3YUUzDD.cjs → vue-ui-table-sparkline-D1hriLB0.cjs} +1 -1
- package/dist/{vue-ui-table-sparkline-CrNEnGwB.js → vue-ui-table-sparkline-DSZhEDKX.js} +5 -5
- package/dist/{vue-ui-thermometer-D5NxA-Pu.cjs → vue-ui-thermometer-Cvnh4jvE.cjs} +1 -1
- package/dist/{vue-ui-thermometer-BRTBFuLr.js → vue-ui-thermometer-Pw4X3Bun.js} +7 -7
- package/dist/{vue-ui-timer-CUdy26j8.cjs → vue-ui-timer-BlmIXPv6.cjs} +1 -1
- package/dist/{vue-ui-timer-DjpkBrmE.js → vue-ui-timer-CvvexEeN.js} +5 -5
- package/dist/{vue-ui-tiremarks-DK1Y5NS-.cjs → vue-ui-tiremarks-BAkMBz3o.cjs} +1 -1
- package/dist/{vue-ui-tiremarks-C3oH7Ida.js → vue-ui-tiremarks-DbZQvV_2.js} +7 -7
- package/dist/{vue-ui-treemap-B9Ttncgf.js → vue-ui-treemap-CF-RjM16.js} +12 -12
- package/dist/{vue-ui-treemap-DeDaY1tK.cjs → vue-ui-treemap-a6b1vWy-.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-jQ534ONL.cjs → vue-ui-vertical-bar-Dm5zMIeE.cjs} +1 -1
- package/dist/{vue-ui-vertical-bar-DbGWFmAZ.js → vue-ui-vertical-bar-ZJbSI-xR.js} +12 -12
- package/dist/{vue-ui-waffle-BEAMerlK.js → vue-ui-waffle-I9AKkwb4.js} +12 -12
- package/dist/{vue-ui-waffle-Dlq-kfVb.cjs → vue-ui-waffle-XNiw-qtb.cjs} +1 -1
- package/dist/{vue-ui-wheel-BwxXgxYN.js → vue-ui-wheel-BA7wZUZL.js} +7 -7
- package/dist/{vue-ui-wheel-BpoGeeG1.cjs → vue-ui-wheel-DJUrO6CA.cjs} +1 -1
- package/dist/{vue-ui-word-cloud-DRihn0ID.js → vue-ui-word-cloud-BVqb1Yix.js} +11 -11
- package/dist/vue-ui-word-cloud-ByjkRq1g.cjs +1 -0
- package/dist/{vue-ui-world-zCrAoO8x.cjs → vue-ui-world-9nlcZMH1.cjs} +1 -1
- package/dist/{vue-ui-world-BvwaCfKu.js → vue-ui-world-DkYRlp5s.js} +11 -11
- package/dist/{vue-ui-xy-D8ZtpWDi.js → vue-ui-xy-B1HwPMFi.js} +16 -16
- package/dist/{vue-ui-xy-DTbAGaIM.cjs → vue-ui-xy-B4sqGuw6.cjs} +2 -2
- package/dist/{vue-ui-xy-canvas-DI6-54yO.cjs → vue-ui-xy-canvas-C-rykR_6.cjs} +1 -1
- package/dist/{vue-ui-xy-canvas-DQhK_N_z.js → vue-ui-xy-canvas-CGCtkn9g.js} +12 -12
- package/package.json +1 -1
- package/dist/vue-ui-word-cloud-Bwp55Vjk.cjs +0 -1
|
@@ -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-DgIVCHLv.cjs"),de=require("./useResponsive-DQmBAoBf.cjs"),ze=require("./Title-Bae0QJu7.cjs"),ce=require("./usePrinter-B2xVvtiy.cjs"),Ve=require("./Tooltip-CfqYTd5O.cjs"),Ee=require("./DataTable-CGucPqAQ.cjs"),Te=require("./vue-ui-skeleton-DeEGdJEn.cjs"),Ae=require("./Slicer-t3EfI94H.cjs"),Fe=require("./vue-ui-accordion-DE1isSE9.cjs"),ve=require("./useNestedProp-CCR03NVM.cjs"),Ie=require("./PackageVersion-C2bjLIu9.cjs"),Pe=require("./PenAndPaper-CJIFAI78.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,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-BI6O7K58.js";
|
|
3
3
|
import { t as yt, u as ct } from "./useResponsive-Cw4oZ8sQ.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-CDYBDpu3.js";
|
|
5
|
+
import { u as ft, U as pt } from "./usePrinter-Jr3eyr8H.js";
|
|
6
|
+
import { _ as gt } from "./Tooltip-BzsAOdBd.js";
|
|
7
|
+
import { D as mt } from "./DataTable-Dk-94kK2.js";
|
|
8
|
+
import bt from "./vue-ui-skeleton-Dxm7rqic.js";
|
|
9
|
+
import { S as xt } from "./Slicer-yki6JqTB.js";
|
|
10
|
+
import kt from "./vue-ui-accordion-ldF7KsjV.js";
|
|
11
|
+
import { u as Re } from "./useNestedProp-Cvz4MkSy.js";
|
|
12
|
+
import { _ as wt } from "./PackageVersion-BdNfnIm2.js";
|
|
13
|
+
import { _ as $t } from "./PenAndPaper-wrVNMaG8.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,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-BI6O7K58.js";
|
|
3
|
+
import { u as Ne } from "./useNestedProp-Cvz4MkSy.js";
|
|
4
|
+
import { u as Ue, U as Ve } from "./usePrinter-Jr3eyr8H.js";
|
|
5
|
+
import Me from "./vue-ui-skeleton-Dxm7rqic.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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DiJiQMBB.cjs"),ue=require("./useNestedProp-DqEOzYzu.cjs"),Q=require("./usePrinter-Bkd5ycBt.cjs"),se=require("./vue-ui-skeleton-DEI0qJZY.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-DgIVCHLv.cjs"),ue=require("./useNestedProp-CCR03NVM.cjs"),Q=require("./usePrinter-B2xVvtiy.cjs"),se=require("./vue-ui-skeleton-DeEGdJEn.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,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-BI6O7K58.js";
|
|
3
|
+
import { u as it, U as ct } from "./usePrinter-Jr3eyr8H.js";
|
|
4
|
+
import dt from "./vue-ui-skeleton-Dxm7rqic.js";
|
|
5
|
+
import vt from "./BaseIcon-Br5G8Cdk.js";
|
|
6
|
+
import yt from "./vue-ui-accordion-ldF7KsjV.js";
|
|
7
|
+
import { u as Fe } from "./useNestedProp-Cvz4MkSy.js";
|
|
8
|
+
import { _ as ht } from "./PackageVersion-BdNfnIm2.js";
|
|
9
|
+
import { _ as ft } from "./PenAndPaper-wrVNMaG8.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"),o=require("./index-DiJiQMBB.cjs"),ee=require("./usePrinter-Bkd5ycBt.cjs"),ge=require("./vue-ui-skeleton-DEI0qJZY.cjs"),ke=require("./BaseIcon-DPT0BaqM.cjs"),_e=require("./vue-ui-accordion-P5hXhzth.cjs"),te=require("./useNestedProp-DqEOzYzu.cjs"),xe=require("./PackageVersion-DCriWnX3.cjs"),Be=require("./PenAndPaper-lj1PPAzR.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-DgIVCHLv.cjs"),ee=require("./usePrinter-B2xVvtiy.cjs"),ge=require("./vue-ui-skeleton-DeEGdJEn.cjs"),ke=require("./BaseIcon-DfoJJxST.cjs"),_e=require("./vue-ui-accordion-DE1isSE9.cjs"),te=require("./useNestedProp-CCR03NVM.cjs"),xe=require("./PackageVersion-C2bjLIu9.cjs"),Be=require("./PenAndPaper-CJIFAI78.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,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, ae 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, ae as ut, q as it, r as ct, i as Fe } from "./index-BI6O7K58.js";
|
|
3
|
+
import { u as Ne } from "./useNestedProp-Cvz4MkSy.js";
|
|
4
|
+
import { u as vt, U as dt } from "./usePrinter-Jr3eyr8H.js";
|
|
5
|
+
import { _ as ht } from "./Title-CDYBDpu3.js";
|
|
6
|
+
import { _ as ft } from "./PenAndPaper-wrVNMaG8.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-BdNfnIm2.js";
|
|
9
|
+
import pt from "./vue-ui-accordion-ldF7KsjV.js";
|
|
10
|
+
import { D as bt } from "./DataTable-Dk-94kK2.js";
|
|
11
|
+
import gt from "./vue-ui-skeleton-Dxm7rqic.js";
|
|
12
12
|
import { u as kt } from "./useChartAccessibility-BWojgys7.js";
|
|
13
13
|
import { t as xt, u as wt } from "./useResponsive-Cw4oZ8sQ.js";
|
|
14
14
|
import { _ as Ct } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DiJiQMBB.cjs"),ie=require("./useNestedProp-DqEOzYzu.cjs"),ce=require("./usePrinter-Bkd5ycBt.cjs"),_e=require("./Title-zlQvBTwR.cjs"),Be=require("./PenAndPaper-lj1PPAzR.cjs"),Se=require("./useUserOptionState-BgepsfED.cjs"),$e=require("./PackageVersion-DCriWnX3.cjs"),Ne=require("./vue-ui-accordion-P5hXhzth.cjs"),Ee=require("./DataTable-DSiJ_YaA.cjs"),Pe=require("./vue-ui-skeleton-DEI0qJZY.cjs"),Te=require("./useChartAccessibility-Cm7nkzTG.cjs"),ve=require("./useResponsive-DQmBAoBf.cjs"),Ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function de(i,d=0){const m=i.reduce((a,{x:r,r:c})=>Math.min(a,r-c-d),1/0),v=i.reduce((a,{x:r,r:c})=>Math.max(a,r+c+d),-1/0),f=i.reduce((a,{y:r,r:c})=>Math.min(a,r-c-d),1/0),n=i.reduce((a,{y:r,r:c})=>Math.max(a,r+c+d),-1/0);return[m,f,v-m,n-f]}function Oe(i,d,m){const v=i._,f=i.next._,n=v.r+f.r,a=(v.x*f.r+f.x*v.r)/n,r=(v.y*f.r+f.y*v.r)/n;return Math.max(Math.abs(a*m),Math.abs(r*d))}function fe(i,d,m){const v=Oe,f=i.length;if(!f)return i;let n,a,r;if(n=i[0],n.x=0,n.y=0,!(f>1)||(a=i[1],n.x=-a.r,a.x=n.r,a.y=0,!(f>2)))return i;he(a,n,r=i[2]),n=new q(n),a=new q(a),r=new q(r),n.next=r.previous=a,a.next=n.previous=r,r.next=a.previous=n;e:for(let c=3;c<f;++c){he(n._,a._,r=i[c]),r=new q(r);let y=a.next,b=n.previous,S=a._.r,$=n._.r;do if(S<=$){if(me(y._,r._)){a=y,n.next=a,a.previous=n,--c;continue e}S+=y._.r,y=y.next}else{if(me(b._,r._)){n=b,n.next=a,a.previous=n,--c;continue e}$+=b._.r,b=b.previous}while(y!==b.next);r.previous=n,r.next=a,n.next=a.previous=a=r;let N=v(n,m,d),F;for(;(r=r.next)!==a;)(F=v(r,m,d))<N&&(n=r,N=F);a=n.next}return i}function he(i,d,m){const v=i.x-d.x,f=i.y-d.y,n=v*v+f*f;if(n){const a=(d.r+m.r)**2,r=(i.r+m.r)**2;if(a>r){const c=(n+r-a)/(2*n),y=Math.sqrt(Math.max(0,r/n-c*c));m.x=i.x-c*v-y*f,m.y=i.y-c*f+y*v}else{const c=(n+a-r)/(2*n),y=Math.sqrt(Math.max(0,a/n-c*c));m.x=d.x+c*v-y*f,m.y=d.y+c*f+y*v}}else m.x=d.x+m.r,m.y=d.y}function me(i,d){const m=i.r+d.r-1e-6,v=d.x-i.x,f=d.y-i.y;return m>0&&m*m>v*v+f*f}class q{constructor(d){this._=d,this.next=null,this.previous=null}}const Fe=["id"],Ie=["xmlns","viewBox","height","width"],Re=["x","y","width","height"],Me=["id"],Ae=["stop-color"],qe=["stop-color"],De=["stop-color"],Le={key:0},He=["x","y","width","height","stroke","stroke-width","fill","rx","onMouseenter","onClick"],Ue=["x","y","width","height","stroke","stroke-width","fill","rx"],je=["opacity","x","y","font-size","fill","font-weight"],Ge=["opacity","x","y","font-size","fill","font-weight"],We=["cx","cy","r","opacity","stroke","stroke-width","fill"],Ye={key:0,style:{pointerEvents:"none"}},Xe={key:1},Ze=["opacity","x","y","font-size","fill","font-weight"],Je=["opacity","x","y","font-size","fill","font-weight"],Ke={key:6,class:"vue-data-ui-watermark"},Qe=["innerHTML"],et={__name:"vue-ui-circle-pack",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(i,{expose:d,emit:m}){e.useCssVars(o=>({cf72f1fe:B.value,"4e89318c":H.value}));const v=i,f=m,{vue_ui_circle_pack:n}=u.useConfig(),a=e.computed(()=>!!v.dataset&&v.dataset.length),r=e.ref(u.createUid()),c=e.ref(null),y=e.ref(null),b=e.ref(null),S=e.ref(0),$=e.ref(0),N=e.ref(0),F=e.ref(null),t=e.computed({get:()=>J(),set:o=>o}),{svgRef:Y}=Te.useChartAccessibility({config:t.value.style.chart.title}),{userOptionsVisible:D,setUserOptionsVisibility:X,keepUserOptionState:Z}=Se.useUserOptionState({config:t.value});function J(){const o=ie.useNestedProp({userConfig:v.config,defaultConfig:n});return o.theme?{...ie.useNestedProp({userConfig:u.themes.vue_ui_circle_pack[o.theme]||v.config,defaultConfig:o}),customPalette:u.themePalettes[o.theme]||u.palette}:o}e.watch(()=>v.config,o=>{t.value=J(),D.value=!t.value.userOptions.showOnChartHover,L(),S.value+=1,$.value+=1,E.value.showTable=t.value.table.show},{deep:!0});const{isPrinting:K,isImaging:Q,generatePdf:ee,generateImage:te}=ce.usePrinter({elementId:`vue-ui-circle-pack_${r.value}`,fileName:t.value.style.chart.title.text||"vue-ui-circle-pack",options:t.value.userOptions.print}),pe=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),E=e.ref({showTable:t.value.table.show}),oe=e.ref(null),w=e.ref({h:10,w:10}),le=e.ref(0),z=e.ref([0,0,100,100]),I=e.ref({h:0,w:0});async function L(){u.objectIsEmpty(v.dataset)&&u.error({componentName:"VueUiCirclePack",type:"dataset"}),_.value=await fe(R.value),k.value=de(_.value,1).join(" "),I.value=ae(c.value);const o=ve.throttle(()=>{const{width:s,height:l,heightTitle:p,heightNoTitle:g}=ve.useResponsive({chart:c.value,title:y.value,noTitle:b.value}),G=s||10,W=l&&l>10?l:10;le.value=t.value.style.chart.title.text?p:g,requestAnimationFrame(()=>{w.value.w=G,w.value.h=W-le.value,e.nextTick(async()=>{const we=R.value.map(ze=>({...ze}));_.value=await fe(we,w.value.h,w.value.w),z.value=de(_.value,1),k.value=z.value.join(" "),I.value=ae(c.value)})})});oe.value=new ResizeObserver(o),oe.value.observe(c.value.parentNode)}e.onMounted(L);function ae(o){if(!o||!o.parentElement)return console.warn("Component or parent element is missing."),{w:0,h:0};const s=o.parentElement;if(s.offsetWidth>0&&s.offsetHeight>0)return{w:s.offsetWidth,h:s.offsetHeight};const l=window.getComputedStyle(s),p=l.width,g=l.height;return p!=="auto"&&g!=="auto"&&parseFloat(p)>0&&parseFloat(g)>0?{w:parseFloat(p),h:parseFloat(g)}:{w:0,h:0}}e.watch(()=>v.dataset,async o=>{await L()},{deep:!0});const ye=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),R=e.computed(()=>v.dataset.map((o,s)=>{const l=u.convertColorToHex(o.color)||ye.value[s]||u.themePalettes[t.value.theme||"default"][s%u.themePalettes[t.value.theme||"default"].length]||u.palette[s]||u.palette[s%u.palette.length];return{...o,r:o.value,id:u.createUid(),color:l}}).filter(o=>![null,void 0,1/0,-1/0].includes(o.value))),_=e.ref([]),k=e.ref("0 0 100 100"),P=e.computed(()=>Math.max(..._.value.map(o=>o.r)));function ne(o,s){return s/P.value*o}const h=e.ref(null);function ge(o){t.value.style.chart.circles.zoom.show&&(h.value=o)}const B=e.computed(()=>h.value?h.value.r:0),H=e.computed(()=>C.value?B.value:h.value?h.value.r>z.value[3]/6*t.value.style.chart.circles.zoom.zoomRatio?h.value.r:z.value[3]/6*t.value.style.chart.circles.zoom.zoomRatio:0),x=e.ref(0),be=e.computed(()=>({pointerEvents:"none",opacity:x.value,filter:`drop-shadow(0px 0px 6px ${u.darkenHexColor(h.value.color,t.value.style.chart.circles.zoom.shadowForce)})`})),T=e.ref(B.value);e.watchEffect(()=>{T.value=B.value,x.value=0;let o=null;function s(l){o||(o=l);const p=(l-o)/t.value.style.chart.circles.zoom.animationFrameMs;p<1?(T.value=B.value+(H.value-B.value)*p,x.value=0+t.value.style.chart.circles.zoom.opacity*p,requestAnimationFrame(s)):(T.value=H.value,x.value=t.value.style.chart.circles.zoom.opacity)}requestAnimationFrame(s)});const V=e.computed(()=>({name:t.value.style.chart.circles.zoom.label.name.fontSize*z.value[3]/300,value:t.value.style.chart.circles.zoom.label.value.fontSize*z.value[3]/300}));function U(o){return u.applyDataLabel(t.value.style.chart.circles.labels.value.formatter,o.value,u.dataLabel({p:t.value.style.chart.circles.labels.value.prefix,v:o.value,s:t.value.style.chart.circles.labels.value.suffix,r:t.value.style.chart.circles.labels.value.rounding}))}function ke(){return u.applyDataLabel(t.value.style.chart.circles.zoom.label.value.formatter,h.value.value,u.dataLabel({p:t.value.style.chart.circles.zoom.label.value.prefix,v:h.value.value,s:t.value.style.chart.circles.zoom.label.value.suffix,r:t.value.style.chart.circles.zoom.label.value.rounding}))}function re(o){if(!o)return 0;const s=o.r/U(o).length*(U(o).length===1?1:2);return Math.min(o.r/2.5,s)}const O=e.ref(!1);function xe(o){O.value=o,N.value+=1}const C=e.ref(!1);function j(){C.value=!C.value}const M=e.computed(()=>{const o=R.value.map(l=>({name:l.name,value:l.value,color:l.color})).toSorted((l,p)=>p.value-l.value),s=o.map(l=>l.value);return{head:o,body:s}});function se(){e.nextTick(()=>{const o=M.value.head.map((p,g)=>[[p.name],[M.value.body[g]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],[t.value.table.columnNames.value]]].concat(o),l=u.createCsvContent(s);u.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-circle-pack"})})}const A=e.computed(()=>{const o=[t.value.table.columnNames.datapoint,t.value.table.columnNames.value],s=M.value.head.map((g,G)=>{const W=u.dataLabel({p:t.value.style.chart.circles.labels.value.prefix,v:M.value.body[G],s:t.value.style.chart.circles.labels.value.suffix,r:t.value.style.chart.circles.labels.value.rounding});return[{color:g.color,name:g.name},W]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.datapoint,t.value.table.columnNames.value],head:o,body:s,config:l}});function ue(){E.value.showTable=!E.value.showTable}function Ce(){return R.value}return d({getData:Ce,generateCsv:se,generatePdf:ee,generateImage:te,toggleTable:ue,toggleAnnotator:j}),(o,s)=>(e.openBlock(),e.createElementBlock("div",{id:`vue-ui-circle-pack_${r.value}`,class:e.normalizeClass(`vue-ui-circle-pack ${O.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"circlePackChart",ref:c,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};text-align:center;background:${t.value.style.chart.backgroundColor}; height: ${I.value.h}px; width:${I.value.w}px`),onMouseenter:s[2]||(s[2]=()=>e.unref(X)(!0)),onMouseleave:s[3]||(s[3]=()=>e.unref(X)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Be._sfc_main,{key:0,svgRef:e.unref(Y),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:C.value,scale:P.value/100,onClose:j},null,8,["svgRef","backgroundColor","color","active","scale"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"userConfig",{},void 0,!0),pe.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:b,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:y,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(_e._sfc_main,{key:`title_${S.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&a.value&&(e.unref(Z)||e.unref(D))?(e.openBlock(),e.createBlock(ce.UserOptions,{ref:"details",key:`user_option_${N.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(K),isImaging:e.unref(Q),uid:r.value,hasTooltip:!1,hasLabel:!1,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:O.value,chartElement:c.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:C.value,onToggleFullscreen:xe,onGeneratePdf:e.unref(ee),onGenerateCsv:se,onGenerateImage:e.unref(te),onToggleTable:ue,onToggleAnnotator:j,style:e.normalizeStyle({visibility:e.unref(Z)?e.unref(D)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:l,color:p})=>[e.renderSlot(o.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:l,color:p})),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.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:p})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:p})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:p})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:p})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","chartElement","position","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:Y,xmlns:e.unref(u.XMLNS),viewBox:k.value,height:w.value.h,width:w.value.w,class:e.normalizeClass({"vue-data-ui-fullscreen--on":O.value,"vue-data-ui-fulscreen--off":!O.value}),style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color};background:${t.value.style.chart.backgroundColor};`)},[e.createVNode($e._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:k.value.x,y:k.value.y,width:k.value.width,height:k.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,Re)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:l.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(u.lightenHexColor)(l.color,t.value.style.chart.circles.gradient.intensity/100)},null,8,Ae),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(u.darkenHexColor)(l.color,.1)},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,De)],8,Me)]),o.$slots.pattern?(e.openBlock(),e.createElementBlock("g",Le,[e.createElementVNode("defs",null,[e.renderSlot(o.$slots,"pattern",e.mergeProps({ref_for:!0},{...l,patternId:`pattern_${r.value}_${l.id}`}),void 0,!0)])])):e.createCommentVNode("",!0),e.createElementVNode("rect",{x:l.x-l.r,y:l.y-l.r,width:l.r*2,height:l.r*2,stroke:t.value.style.chart.circles.stroke,"stroke-width":t.value.style.chart.circles.strokeWidth*P.value/100,fill:t.value.style.chart.circles.gradient.show?`url(#${l.id})`:l.color,rx:l.r,onMouseenter:()=>ge(l),onMouseout:s[0]||(s[0]=p=>h.value=null),onClick:p=>f("selectDatapoint",l)},null,40,He),o.$slots.pattern?(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x-l.r,y:l.y-l.r,width:l.r*2,height:l.r*2,stroke:t.value.style.chart.circles.stroke,"stroke-width":t.value.style.chart.circles.strokeWidth*P.value/100,fill:`url(#pattern_${r.value}_${l.id})`,rx:l.r,style:{pointerEvents:"none"}},null,8,Ue)):e.createCommentVNode("",!0),o.$slots["data-label"]?e.renderSlot(o.$slots,"data-label",e.mergeProps({key:2,ref_for:!0},{...l,createTSpans:e.unref(u.createTSpans),fontSize:{name:l.r/3*t.value.style.chart.circles.labels.name.fontSizeRatio,value:re(l)*t.value.style.chart.circles.labels.value.fontSizeRatio},color:t.value.style.chart.circles.labels.name.color?t.value.style.chart.circles.labels.name.color:e.unref(u.adaptColorToBackground)(l.color)}),void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.value.style.chart.circles.labels.name.show&&l.name?(e.openBlock(),e.createElementBlock("text",{key:0,style:{pointerEvents:"none",transition:"opacity 0.2s ease-in-out"},opacity:h.value&&!C.value?.2:1,x:l.x,y:l.y+ne(l.r,t.value.style.chart.circles.labels.name.offsetY)-l.r/10,"font-size":l.r/3*t.value.style.chart.circles.labels.name.fontSizeRatio,fill:t.value.style.chart.circles.labels.name.color?t.value.style.chart.circles.labels.name.color:e.unref(u.adaptColorToBackground)(l.color),"font-weight":t.value.style.chart.circles.labels.name.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(l.name),9,je)):e.createCommentVNode("",!0),t.value.style.chart.circles.labels.value.show?(e.openBlock(),e.createElementBlock("text",{key:1,style:{pointerEvents:"none",transition:"opacity 0.2s ease-in-out"},opacity:h.value&&!C.value?.2:1,x:l.x,y:l.y+ne(l.r,t.value.style.chart.circles.labels.value.offsetY)+l.r/2.5,"font-size":re(l)*t.value.style.chart.circles.labels.value.fontSizeRatio,fill:t.value.style.chart.circles.labels.value.color?t.value.style.chart.circles.labels.value.color:e.unref(u.adaptColorToBackground)(l.color),"font-weight":t.value.style.chart.circles.labels.value.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(U(l)),9,Ge)):e.createCommentVNode("",!0)],64))],64))),256)),h.value&&t.value.style.chart.circles.zoom.show&&!C.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("circle",{style:e.normalizeStyle(be.value),cx:h.value.x,cy:h.value.y,r:T.value,opacity:x.value,stroke:t.value.style.chart.circles.stroke,"stroke-width":t.value.style.chart.circles.strokeWidth*P.value/100,fill:t.value.style.chart.circles.gradient.show?`url(#${h.value.id})`:h.value.color},null,12,We),o.$slots["zoom-label"]?(e.openBlock(),e.createElementBlock("g",Ye,[e.renderSlot(o.$slots,"zoom-label",e.normalizeProps(e.guardReactiveProps({...h.value,zoomOpacity:x.value,currentRadius:T.value,fontSize:V.value})),void 0,!0)])):(e.openBlock(),e.createElementBlock("g",Xe,[e.createElementVNode("text",{style:{pointerEvents:"none"},opacity:x.value,x:h.value.x,y:h.value.y+t.value.style.chart.circles.zoom.label.name.offsetY-V.value.name/4,"text-anchor":"middle","font-size":V.value.name,fill:t.value.style.chart.circles.zoom.label.name.color?t.value.style.chart.circles.zoom.label.name.color:e.unref(u.adaptColorToBackground)(h.value.color),"font-weight":t.value.style.chart.circles.zoom.label.name.bold?"bold":"normal"},e.toDisplayString(h.value.name),9,Ze),e.createElementVNode("text",{style:{pointerEvents:"none"},opacity:x.value,x:h.value.x,y:h.value.y+V.value.value+t.value.style.chart.circles.zoom.label.value.offsetY,"text-anchor":"middle","font-size":V.value.value,fill:t.value.style.chart.circles.zoom.label.value.color?t.value.style.chart.circles.zoom.label.value.color:e.unref(u.adaptColorToBackground)(h.value.color),"font-weight":t.value.style.chart.circles.zoom.label.value.bold?"bold":"normal"},e.toDisplayString(ke()),9,Je)]))],64)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:{...k.value}},void 0,!0)],14,Ie)):e.createCommentVNode("",!0),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Pe.default,{key:5,config:{type:"circlePack",style:{color:"#CCCCCC"}}})),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ke,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(K)||e.unref(Q)})),void 0,!0)])):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:F,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createBlock(Ne.default,{key:8,hideDetails:"",config:{open:E.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ee.DataTable,{key:`table_${$.value}`,colNames:A.value.colNames,head:A.value.head,body:A.value.body,config:A.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=l=>E.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Qe)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Fe))}},tt=Ve._export_sfc(et,[["__scopeId","data-v-bb4f66a5"]]);exports.default=tt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-DgIVCHLv.cjs"),ie=require("./useNestedProp-CCR03NVM.cjs"),ce=require("./usePrinter-B2xVvtiy.cjs"),_e=require("./Title-Bae0QJu7.cjs"),Be=require("./PenAndPaper-CJIFAI78.cjs"),Se=require("./useUserOptionState-BgepsfED.cjs"),$e=require("./PackageVersion-C2bjLIu9.cjs"),Ne=require("./vue-ui-accordion-DE1isSE9.cjs"),Ee=require("./DataTable-CGucPqAQ.cjs"),Pe=require("./vue-ui-skeleton-DeEGdJEn.cjs"),Te=require("./useChartAccessibility-Cm7nkzTG.cjs"),ve=require("./useResponsive-DQmBAoBf.cjs"),Ve=require("./_plugin-vue_export-helper-BHFhmbuH.cjs");function de(i,d=0){const m=i.reduce((a,{x:r,r:c})=>Math.min(a,r-c-d),1/0),v=i.reduce((a,{x:r,r:c})=>Math.max(a,r+c+d),-1/0),f=i.reduce((a,{y:r,r:c})=>Math.min(a,r-c-d),1/0),n=i.reduce((a,{y:r,r:c})=>Math.max(a,r+c+d),-1/0);return[m,f,v-m,n-f]}function Oe(i,d,m){const v=i._,f=i.next._,n=v.r+f.r,a=(v.x*f.r+f.x*v.r)/n,r=(v.y*f.r+f.y*v.r)/n;return Math.max(Math.abs(a*m),Math.abs(r*d))}function fe(i,d,m){const v=Oe,f=i.length;if(!f)return i;let n,a,r;if(n=i[0],n.x=0,n.y=0,!(f>1)||(a=i[1],n.x=-a.r,a.x=n.r,a.y=0,!(f>2)))return i;he(a,n,r=i[2]),n=new q(n),a=new q(a),r=new q(r),n.next=r.previous=a,a.next=n.previous=r,r.next=a.previous=n;e:for(let c=3;c<f;++c){he(n._,a._,r=i[c]),r=new q(r);let y=a.next,b=n.previous,S=a._.r,$=n._.r;do if(S<=$){if(me(y._,r._)){a=y,n.next=a,a.previous=n,--c;continue e}S+=y._.r,y=y.next}else{if(me(b._,r._)){n=b,n.next=a,a.previous=n,--c;continue e}$+=b._.r,b=b.previous}while(y!==b.next);r.previous=n,r.next=a,n.next=a.previous=a=r;let N=v(n,m,d),F;for(;(r=r.next)!==a;)(F=v(r,m,d))<N&&(n=r,N=F);a=n.next}return i}function he(i,d,m){const v=i.x-d.x,f=i.y-d.y,n=v*v+f*f;if(n){const a=(d.r+m.r)**2,r=(i.r+m.r)**2;if(a>r){const c=(n+r-a)/(2*n),y=Math.sqrt(Math.max(0,r/n-c*c));m.x=i.x-c*v-y*f,m.y=i.y-c*f+y*v}else{const c=(n+a-r)/(2*n),y=Math.sqrt(Math.max(0,a/n-c*c));m.x=d.x+c*v-y*f,m.y=d.y+c*f+y*v}}else m.x=d.x+m.r,m.y=d.y}function me(i,d){const m=i.r+d.r-1e-6,v=d.x-i.x,f=d.y-i.y;return m>0&&m*m>v*v+f*f}class q{constructor(d){this._=d,this.next=null,this.previous=null}}const Fe=["id"],Ie=["xmlns","viewBox","height","width"],Re=["x","y","width","height"],Me=["id"],Ae=["stop-color"],qe=["stop-color"],De=["stop-color"],Le={key:0},He=["x","y","width","height","stroke","stroke-width","fill","rx","onMouseenter","onClick"],Ue=["x","y","width","height","stroke","stroke-width","fill","rx"],je=["opacity","x","y","font-size","fill","font-weight"],Ge=["opacity","x","y","font-size","fill","font-weight"],We=["cx","cy","r","opacity","stroke","stroke-width","fill"],Ye={key:0,style:{pointerEvents:"none"}},Xe={key:1},Ze=["opacity","x","y","font-size","fill","font-weight"],Je=["opacity","x","y","font-size","fill","font-weight"],Ke={key:6,class:"vue-data-ui-watermark"},Qe=["innerHTML"],et={__name:"vue-ui-circle-pack",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectDatapoint"],setup(i,{expose:d,emit:m}){e.useCssVars(o=>({cf72f1fe:B.value,"4e89318c":H.value}));const v=i,f=m,{vue_ui_circle_pack:n}=u.useConfig(),a=e.computed(()=>!!v.dataset&&v.dataset.length),r=e.ref(u.createUid()),c=e.ref(null),y=e.ref(null),b=e.ref(null),S=e.ref(0),$=e.ref(0),N=e.ref(0),F=e.ref(null),t=e.computed({get:()=>J(),set:o=>o}),{svgRef:Y}=Te.useChartAccessibility({config:t.value.style.chart.title}),{userOptionsVisible:D,setUserOptionsVisibility:X,keepUserOptionState:Z}=Se.useUserOptionState({config:t.value});function J(){const o=ie.useNestedProp({userConfig:v.config,defaultConfig:n});return o.theme?{...ie.useNestedProp({userConfig:u.themes.vue_ui_circle_pack[o.theme]||v.config,defaultConfig:o}),customPalette:u.themePalettes[o.theme]||u.palette}:o}e.watch(()=>v.config,o=>{t.value=J(),D.value=!t.value.userOptions.showOnChartHover,L(),S.value+=1,$.value+=1,E.value.showTable=t.value.table.show},{deep:!0});const{isPrinting:K,isImaging:Q,generatePdf:ee,generateImage:te}=ce.usePrinter({elementId:`vue-ui-circle-pack_${r.value}`,fileName:t.value.style.chart.title.text||"vue-ui-circle-pack",options:t.value.userOptions.print}),pe=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),E=e.ref({showTable:t.value.table.show}),oe=e.ref(null),w=e.ref({h:10,w:10}),le=e.ref(0),z=e.ref([0,0,100,100]),I=e.ref({h:0,w:0});async function L(){u.objectIsEmpty(v.dataset)&&u.error({componentName:"VueUiCirclePack",type:"dataset"}),_.value=await fe(R.value),k.value=de(_.value,1).join(" "),I.value=ae(c.value);const o=ve.throttle(()=>{const{width:s,height:l,heightTitle:p,heightNoTitle:g}=ve.useResponsive({chart:c.value,title:y.value,noTitle:b.value}),G=s||10,W=l&&l>10?l:10;le.value=t.value.style.chart.title.text?p:g,requestAnimationFrame(()=>{w.value.w=G,w.value.h=W-le.value,e.nextTick(async()=>{const we=R.value.map(ze=>({...ze}));_.value=await fe(we,w.value.h,w.value.w),z.value=de(_.value,1),k.value=z.value.join(" "),I.value=ae(c.value)})})});oe.value=new ResizeObserver(o),oe.value.observe(c.value.parentNode)}e.onMounted(L);function ae(o){if(!o||!o.parentElement)return console.warn("Component or parent element is missing."),{w:0,h:0};const s=o.parentElement;if(s.offsetWidth>0&&s.offsetHeight>0)return{w:s.offsetWidth,h:s.offsetHeight};const l=window.getComputedStyle(s),p=l.width,g=l.height;return p!=="auto"&&g!=="auto"&&parseFloat(p)>0&&parseFloat(g)>0?{w:parseFloat(p),h:parseFloat(g)}:{w:0,h:0}}e.watch(()=>v.dataset,async o=>{await L()},{deep:!0});const ye=e.computed(()=>u.convertCustomPalette(t.value.customPalette)),R=e.computed(()=>v.dataset.map((o,s)=>{const l=u.convertColorToHex(o.color)||ye.value[s]||u.themePalettes[t.value.theme||"default"][s%u.themePalettes[t.value.theme||"default"].length]||u.palette[s]||u.palette[s%u.palette.length];return{...o,r:o.value,id:u.createUid(),color:l}}).filter(o=>![null,void 0,1/0,-1/0].includes(o.value))),_=e.ref([]),k=e.ref("0 0 100 100"),P=e.computed(()=>Math.max(..._.value.map(o=>o.r)));function ne(o,s){return s/P.value*o}const h=e.ref(null);function ge(o){t.value.style.chart.circles.zoom.show&&(h.value=o)}const B=e.computed(()=>h.value?h.value.r:0),H=e.computed(()=>C.value?B.value:h.value?h.value.r>z.value[3]/6*t.value.style.chart.circles.zoom.zoomRatio?h.value.r:z.value[3]/6*t.value.style.chart.circles.zoom.zoomRatio:0),x=e.ref(0),be=e.computed(()=>({pointerEvents:"none",opacity:x.value,filter:`drop-shadow(0px 0px 6px ${u.darkenHexColor(h.value.color,t.value.style.chart.circles.zoom.shadowForce)})`})),T=e.ref(B.value);e.watchEffect(()=>{T.value=B.value,x.value=0;let o=null;function s(l){o||(o=l);const p=(l-o)/t.value.style.chart.circles.zoom.animationFrameMs;p<1?(T.value=B.value+(H.value-B.value)*p,x.value=0+t.value.style.chart.circles.zoom.opacity*p,requestAnimationFrame(s)):(T.value=H.value,x.value=t.value.style.chart.circles.zoom.opacity)}requestAnimationFrame(s)});const V=e.computed(()=>({name:t.value.style.chart.circles.zoom.label.name.fontSize*z.value[3]/300,value:t.value.style.chart.circles.zoom.label.value.fontSize*z.value[3]/300}));function U(o){return u.applyDataLabel(t.value.style.chart.circles.labels.value.formatter,o.value,u.dataLabel({p:t.value.style.chart.circles.labels.value.prefix,v:o.value,s:t.value.style.chart.circles.labels.value.suffix,r:t.value.style.chart.circles.labels.value.rounding}))}function ke(){return u.applyDataLabel(t.value.style.chart.circles.zoom.label.value.formatter,h.value.value,u.dataLabel({p:t.value.style.chart.circles.zoom.label.value.prefix,v:h.value.value,s:t.value.style.chart.circles.zoom.label.value.suffix,r:t.value.style.chart.circles.zoom.label.value.rounding}))}function re(o){if(!o)return 0;const s=o.r/U(o).length*(U(o).length===1?1:2);return Math.min(o.r/2.5,s)}const O=e.ref(!1);function xe(o){O.value=o,N.value+=1}const C=e.ref(!1);function j(){C.value=!C.value}const M=e.computed(()=>{const o=R.value.map(l=>({name:l.name,value:l.value,color:l.color})).toSorted((l,p)=>p.value-l.value),s=o.map(l=>l.value);return{head:o,body:s}});function se(){e.nextTick(()=>{const o=M.value.head.map((p,g)=>[[p.name],[M.value.body[g]]]),s=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],[t.value.table.columnNames.value]]].concat(o),l=u.createCsvContent(s);u.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-circle-pack"})})}const A=e.computed(()=>{const o=[t.value.table.columnNames.datapoint,t.value.table.columnNames.value],s=M.value.head.map((g,G)=>{const W=u.dataLabel({p:t.value.style.chart.circles.labels.value.prefix,v:M.value.body[G],s:t.value.style.chart.circles.labels.value.suffix,r:t.value.style.chart.circles.labels.value.rounding});return[{color:g.color,name:g.name},W]}),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{colNames:[t.value.table.columnNames.datapoint,t.value.table.columnNames.value],head:o,body:s,config:l}});function ue(){E.value.showTable=!E.value.showTable}function Ce(){return R.value}return d({getData:Ce,generateCsv:se,generatePdf:ee,generateImage:te,toggleTable:ue,toggleAnnotator:j}),(o,s)=>(e.openBlock(),e.createElementBlock("div",{id:`vue-ui-circle-pack_${r.value}`,class:e.normalizeClass(`vue-ui-circle-pack ${O.value?"vue-data-ui-wrapper-fullscreen":""}`),ref_key:"circlePackChart",ref:c,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};text-align:center;background:${t.value.style.chart.backgroundColor}; height: ${I.value.h}px; width:${I.value.w}px`),onMouseenter:s[2]||(s[2]=()=>e.unref(X)(!0)),onMouseleave:s[3]||(s[3]=()=>e.unref(X)(!1))},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Be._sfc_main,{key:0,svgRef:e.unref(Y),backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:C.value,scale:P.value/100,onClose:j},null,8,["svgRef","backgroundColor","color","active","scale"])):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"userConfig",{},void 0,!0),pe.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:b,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:y,style:"width:100%;background:transparent;padding-bottom:12px"},[(e.openBlock(),e.createBlock(_e._sfc_main,{key:`title_${S.value}`,config:{title:{cy:"donut-div-title",...t.value.style.chart.title},subtitle:{cy:"donut-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&a.value&&(e.unref(Z)||e.unref(D))?(e.openBlock(),e.createBlock(ce.UserOptions,{ref:"details",key:`user_option_${N.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(K),isImaging:e.unref(Q),uid:r.value,hasTooltip:!1,hasLabel:!1,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:O.value,chartElement:c.value,position:t.value.userOptions.position,titles:{...t.value.userOptions.buttonTitles},hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:C.value,onToggleFullscreen:xe,onGeneratePdf:e.unref(ee),onGenerateCsv:se,onGenerateImage:e.unref(te),onToggleTable:ue,onToggleAnnotator:j,style:e.normalizeStyle({visibility:e.unref(Z)?e.unref(D)?"visible":"hidden":"visible"})},e.createSlots({_:2},[o.$slots.menuIcon?{name:"menuIcon",fn:e.withCtx(({isOpen:l,color:p})=>[e.renderSlot(o.$slots,"menuIcon",e.normalizeProps(e.guardReactiveProps({isOpen:l,color:p})),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.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:p})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:p})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:p})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:p})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isFullscreen","chartElement","position","titles","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage","style"])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("svg",{key:4,ref_key:"svgRef",ref:Y,xmlns:e.unref(u.XMLNS),viewBox:k.value,height:w.value.h,width:w.value.w,class:e.normalizeClass({"vue-data-ui-fullscreen--on":O.value,"vue-data-ui-fulscreen--off":!O.value}),style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color};background:${t.value.style.chart.backgroundColor};`)},[e.createVNode($e._sfc_main),o.$slots["chart-background"]?(e.openBlock(),e.createElementBlock("foreignObject",{key:0,x:k.value.x,y:k.value.y,width:k.value.width,height:k.value.height,style:{pointerEvents:"none"}},[e.renderSlot(o.$slots,"chart-background",{},void 0,!0)],8,Re)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{id:l.id,fy:"30%"},[e.createElementVNode("stop",{offset:"10%","stop-color":e.unref(u.lightenHexColor)(l.color,t.value.style.chart.circles.gradient.intensity/100)},null,8,Ae),e.createElementVNode("stop",{offset:"90%","stop-color":e.unref(u.darkenHexColor)(l.color,.1)},null,8,qe),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,De)],8,Me)]),o.$slots.pattern?(e.openBlock(),e.createElementBlock("g",Le,[e.createElementVNode("defs",null,[e.renderSlot(o.$slots,"pattern",e.mergeProps({ref_for:!0},{...l,patternId:`pattern_${r.value}_${l.id}`}),void 0,!0)])])):e.createCommentVNode("",!0),e.createElementVNode("rect",{x:l.x-l.r,y:l.y-l.r,width:l.r*2,height:l.r*2,stroke:t.value.style.chart.circles.stroke,"stroke-width":t.value.style.chart.circles.strokeWidth*P.value/100,fill:t.value.style.chart.circles.gradient.show?`url(#${l.id})`:l.color,rx:l.r,onMouseenter:()=>ge(l),onMouseout:s[0]||(s[0]=p=>h.value=null),onClick:p=>f("selectDatapoint",l)},null,40,He),o.$slots.pattern?(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x-l.r,y:l.y-l.r,width:l.r*2,height:l.r*2,stroke:t.value.style.chart.circles.stroke,"stroke-width":t.value.style.chart.circles.strokeWidth*P.value/100,fill:`url(#pattern_${r.value}_${l.id})`,rx:l.r,style:{pointerEvents:"none"}},null,8,Ue)):e.createCommentVNode("",!0),o.$slots["data-label"]?e.renderSlot(o.$slots,"data-label",e.mergeProps({key:2,ref_for:!0},{...l,createTSpans:e.unref(u.createTSpans),fontSize:{name:l.r/3*t.value.style.chart.circles.labels.name.fontSizeRatio,value:re(l)*t.value.style.chart.circles.labels.value.fontSizeRatio},color:t.value.style.chart.circles.labels.name.color?t.value.style.chart.circles.labels.name.color:e.unref(u.adaptColorToBackground)(l.color)}),void 0,!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[t.value.style.chart.circles.labels.name.show&&l.name?(e.openBlock(),e.createElementBlock("text",{key:0,style:{pointerEvents:"none",transition:"opacity 0.2s ease-in-out"},opacity:h.value&&!C.value?.2:1,x:l.x,y:l.y+ne(l.r,t.value.style.chart.circles.labels.name.offsetY)-l.r/10,"font-size":l.r/3*t.value.style.chart.circles.labels.name.fontSizeRatio,fill:t.value.style.chart.circles.labels.name.color?t.value.style.chart.circles.labels.name.color:e.unref(u.adaptColorToBackground)(l.color),"font-weight":t.value.style.chart.circles.labels.name.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(l.name),9,je)):e.createCommentVNode("",!0),t.value.style.chart.circles.labels.value.show?(e.openBlock(),e.createElementBlock("text",{key:1,style:{pointerEvents:"none",transition:"opacity 0.2s ease-in-out"},opacity:h.value&&!C.value?.2:1,x:l.x,y:l.y+ne(l.r,t.value.style.chart.circles.labels.value.offsetY)+l.r/2.5,"font-size":re(l)*t.value.style.chart.circles.labels.value.fontSizeRatio,fill:t.value.style.chart.circles.labels.value.color?t.value.style.chart.circles.labels.value.color:e.unref(u.adaptColorToBackground)(l.color),"font-weight":t.value.style.chart.circles.labels.value.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(U(l)),9,Ge)):e.createCommentVNode("",!0)],64))],64))),256)),h.value&&t.value.style.chart.circles.zoom.show&&!C.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("circle",{style:e.normalizeStyle(be.value),cx:h.value.x,cy:h.value.y,r:T.value,opacity:x.value,stroke:t.value.style.chart.circles.stroke,"stroke-width":t.value.style.chart.circles.strokeWidth*P.value/100,fill:t.value.style.chart.circles.gradient.show?`url(#${h.value.id})`:h.value.color},null,12,We),o.$slots["zoom-label"]?(e.openBlock(),e.createElementBlock("g",Ye,[e.renderSlot(o.$slots,"zoom-label",e.normalizeProps(e.guardReactiveProps({...h.value,zoomOpacity:x.value,currentRadius:T.value,fontSize:V.value})),void 0,!0)])):(e.openBlock(),e.createElementBlock("g",Xe,[e.createElementVNode("text",{style:{pointerEvents:"none"},opacity:x.value,x:h.value.x,y:h.value.y+t.value.style.chart.circles.zoom.label.name.offsetY-V.value.name/4,"text-anchor":"middle","font-size":V.value.name,fill:t.value.style.chart.circles.zoom.label.name.color?t.value.style.chart.circles.zoom.label.name.color:e.unref(u.adaptColorToBackground)(h.value.color),"font-weight":t.value.style.chart.circles.zoom.label.name.bold?"bold":"normal"},e.toDisplayString(h.value.name),9,Ze),e.createElementVNode("text",{style:{pointerEvents:"none"},opacity:x.value,x:h.value.x,y:h.value.y+V.value.value+t.value.style.chart.circles.zoom.label.value.offsetY,"text-anchor":"middle","font-size":V.value.value,fill:t.value.style.chart.circles.zoom.label.value.color?t.value.style.chart.circles.zoom.label.value.color:e.unref(u.adaptColorToBackground)(h.value.color),"font-weight":t.value.style.chart.circles.zoom.label.value.bold?"bold":"normal"},e.toDisplayString(ke()),9,Je)]))],64)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"svg",{svg:{...k.value}},void 0,!0)],14,Ie)):e.createCommentVNode("",!0),a.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Pe.default,{key:5,config:{type:"circlePack",style:{color:"#CCCCCC"}}})),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ke,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(K)||e.unref(Q)})),void 0,!0)])):e.createCommentVNode("",!0),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:F,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createBlock(Ne.default,{key:8,hideDetails:"",config:{open:E.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Ee.DataTable,{key:`table_${$.value}`,colNames:A.value.colNames,head:A.value.head,body:A.value.body,config:A.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:s[1]||(s[1]=l=>E.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,Qe)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,Fe))}},tt=Ve._export_sfc(et,[["__scopeId","data-v-bb4f66a5"]]);exports.default=tt;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as c, computed as _, onMounted as R, onBeforeUnmount as S, createElementBlock as l, createCommentVNode as o, openBlock as i, normalizeStyle as E, unref as m, createElementVNode as r, normalizeClass as C, toDisplayString as p, nextTick as b } from "vue";
|
|
2
|
-
import { u as F } from "./useNestedProp-
|
|
3
|
-
import { u as L, c as z, X as O, s as I } from "./index-
|
|
2
|
+
import { u as F } from "./useNestedProp-Cvz4MkSy.js";
|
|
3
|
+
import { u as L, c as z, X as O, s as I } from "./index-BI6O7K58.js";
|
|
4
4
|
import { _ as B } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const N = ["xmlns", "height", "width"], T = {
|
|
6
6
|
id: "follower",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),y=require("./useNestedProp-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),y=require("./useNestedProp-CCR03NVM.cjs"),i=require("./index-DgIVCHLv.cjs"),C=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_=["xmlns","height","width"],p={id:"follower",fy:"30%",fx:"30%"},x=["stop-color","stop-opacity"],E=["r","fill","stroke","stroke-width","stroke-dasharray"],N=["r"],g={key:2,class:"wave"},V=["id"],w=["id"],S=["filter","stroke"],B={key:3,class:"crosshair"},R=["x1","stroke","stroke-width","stroke-dasharray"],b=["x1","stroke","stroke-width","stroke-dasharray"],F=["y1","stroke","stroke-width","stroke-dasharray"],z=["y1","stroke","stroke-width","stroke-dasharray"],L=["cy","r","fill"],O=["cy","r","fill"],I=["cx","r","fill"],T=["cx","r","fill"],D={key:5,class:"coordinates"},$=["x","y","font-size","fill"],W=["transform"],G=["font-size","fill"],P={__name:"vue-ui-cursor",props:{config:{type:Object,default:{}}},setup(f){const{vue_ui_cursor:h}=i.useConfig(),k=f,n=t.ref(i.createUid()),e=t.computed(()=>y.useNestedProp({userConfig:k.config,defaultConfig:h})),o=t.ref({x:-100,y:-100});function u({clientX:r,clientY:l,...A}){o.value.x=r-e.value.centerCircleRadius,o.value.y=l-e.value.centerCircleRadius}function d(r){o.value.x=r.targetTouches[0].clientX-e.value.centerCircleRadius,o.value.y=r.targetTouches[0].clientY-e.value.centerCircleRadius}const v=t.ref(!0);function a(r){v.value=r}const s=t.ref(!1),c=t.ref(null);function m(){s.value=!1,c.value&&clearTimeout(c.value),t.nextTick(()=>{s.value=!0,c.value=setTimeout(()=>{s.value=!1},1e3)})}return t.onMounted(()=>{const r=e.value.parentId?document.getElementById(e.value.parentId):document.getElementsByTagName("div")[0];r.addEventListener("mousemove",u),r.addEventListener("touchmove",d),r.addEventListener("mouseleave",()=>a(!1)),r.addEventListener("mouseenter",()=>a(!0)),r.addEventListener("click",m)}),t.onBeforeUnmount(()=>{const r=e.value.parentId?document.getElementById(e.value.parentId):document.getElementsByTagName("div")[0];r.removeEventListener("mousemove",u),r.removeEventListener("touchmove",d),r.removeEventListener("mouseleave",()=>a(!1)),r.removeEventListener("mouseenter",()=>a(!0)),r.removeEventListener("click",m)}),t.computed(()=>e.value.centerCircleRadius/2.5),(r,l)=>v.value?(t.openBlock(),t.createElementBlock("svg",{key:0,"data-dom-to-png-ignore":"",xmlns:t.unref(i.XMLNS),style:t.normalizeStyle(`z-index: 2147483647; overflow: visible; pointer-events: none;background: transparent; position:fixed; top:${o.value.y}px; left:${o.value.x}px;`),viewBox:"0 0 100 100",height:e.value.centerCircleRadius*2,width:e.value.centerCircleRadius*2},[t.createElementVNode("defs",null,[t.createElementVNode("radialGradient",p,[t.createElementVNode("stop",{offset:"10%","stop-color":e.value.bubbleEffectColor,"stop-opacity":e.value.bubbleEffectOpacity},null,8,x),l[0]||(l[0]=t.createElementVNode("stop",{offset:"95%","stop-color":"transparent"},null,-1))])]),e.value.showCenterCircle?(t.openBlock(),t.createElementBlock("circle",{key:0,cx:50,cy:50,r:e.value.centerCircleRadius,fill:t.unref(i.setOpacity)(e.value.centerCircleColor,e.value.centerCircleOpacity*100),stroke:e.value.centerCircleStroke,"stroke-width":e.value.centerCircleStrokeWidth,"stroke-dasharray":e.value.centerCircleDasharray},null,8,E)):t.createCommentVNode("",!0),e.value.bubbleEffect?(t.openBlock(),t.createElementBlock("circle",{key:1,cx:50,cy:50,r:e.value.centerCircleRadius,fill:"url(#follower)",stroke:"none"},null,8,N)):t.createCommentVNode("",!0),e.value.useWaveOnClick?(t.openBlock(),t.createElementBlock("g",g,[t.createElementVNode("defs",null,[t.createElementVNode("filter",{id:`blur_${n.value}`,x:"-50%",y:"-50%",width:"200%",height:"200%"},[t.createElementVNode("feGaussianBlur",{in:"SourceGraphic",stdDeviation:4,id:`blur_std_${n.value}`},null,8,w),l[1]||(l[1]=t.createElementVNode("feColorMatrix",{type:"saturate",values:"0"},null,-1))],8,V)]),s.value?(t.openBlock(),t.createElementBlock("circle",{key:0,class:t.normalizeClass({"circle-wave":s.value}),cx:50,cy:50,r:50,filter:`url(#blur_${n.value})`,stroke:e.value.centerCircleStroke,fill:"none","stroke-width":"3"},null,10,S)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),e.value.showCrosshair?(t.openBlock(),t.createElementBlock("g",B,[t.createElementVNode("line",{x1:-e.value.centerCircleRadius+50,x2:-5e3,y1:50,y2:50,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,R),t.createElementVNode("line",{x1:50+e.value.centerCircleRadius,x2:5e3,y1:50,y2:50,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,b),t.createElementVNode("line",{x1:50,x2:50,y1:-e.value.centerCircleRadius+50,y2:-5e3,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,F),t.createElementVNode("line",{x1:50,x2:50,y1:e.value.centerCircleRadius+50,y2:5e3,stroke:e.value.crosshairStroke,"stroke-width":e.value.crosshairStrokeWidth,"stroke-dasharray":e.value.crosshairDasharray,"stroke-linecap":"round"},null,8,z)])):t.createCommentVNode("",!0),e.value.showIntersectCircles?(t.openBlock(),t.createElementBlock("g",{key:4,class:t.normalizeClass({"rotating-circles":e.value.isLoading})},[t.createElementVNode("circle",{cx:50,cy:e.value.centerCircleRadius+50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,L),t.createElementVNode("circle",{cx:50,cy:-e.value.centerCircleRadius+50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,O),t.createElementVNode("circle",{cx:-e.value.centerCircleRadius+50,cy:50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,I),t.createElementVNode("circle",{cx:e.value.centerCircleRadius+50,cy:50,r:e.value.intersectCirclesRadius,fill:e.value.intersectCirclesFill},null,8,T)],2)):t.createCommentVNode("",!0),e.value.showCoordinates?(t.openBlock(),t.createElementBlock("g",D,[t.createElementVNode("text",{"text-anchor":"end",x:-e.value.centerCircleRadius+50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset,y:50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset,"font-size":e.value.coordinatesFontSize,fill:e.value.coordinatesColor,style:{"font-variant-numeric":"tabular-nums"},"font-family":"Arial"},t.toDisplayString(o.value.x.toFixed(0)),9,$),t.createElementVNode("g",{transform:`translate(${50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset}, ${-e.value.centerCircleRadius+50-e.value.coordinatesFontSize/2+e.value.coordinatesOffset})`},[t.createElementVNode("text",{"text-anchor":"start","font-size":e.value.coordinatesFontSize,fill:e.value.coordinatesColor,style:{"font-variant-numeric":"tabular-nums"},transform:"rotate(-90)","font-family":"Arial"},t.toDisplayString(o.value.y.toFixed(0)),9,G)],8,W)])):t.createCommentVNode("",!0)],12,_)):t.createCommentVNode("",!0)}},q=C._export_sfc(P,[["__scopeId","data-v-e07e5d09"]]);exports.default=q;
|